diff --git a/CHECKSUMS.txt b/CHECKSUMS.txt index 500dc129151e1db3c0bbd58883bed1e07e630426..b98e862d7284621a01c1343065a629dad0d4ff72 100644 --- a/CHECKSUMS.txt +++ b/CHECKSUMS.txt @@ -1,23 +1,23 @@ -Cover Charge v0.3.12.192: web apps, plus the Cover Charge for Display tablet app for Android (downloads/android/, its SHA-256 is in downloads/android/SHA256.txt). No phone APKs were built for v0.1.2 to v0.3.12.192. +Cover Charge v0.3.12.193: web apps, plus the Cover Charge for Display tablet app for Android (downloads/android/, its SHA-256 is in downloads/android/SHA256.txt). No phone APKs were built for v0.1.2 to v0.3.12.193. SHA-256 of each web app's start page, service worker, manifest and logo: -a42e7eab2ae0b08333b3a52782f0c6598a2afc687d1ffb888dc42dd267a82754 owner-app/index.html -8d4f76b5c0c7fb017f312ba0a1390c2f0f527d11726160324e4a09dba2a454f9 owner-app/sw.js +0d94bf4d69325f1db416bf391a61f99e457ab3d3ab475eaed54809fcb77cfa69 owner-app/index.html +bd11dad7989ef1f8d8bae6c08e74a7b3d1223cd5b0e3f85001e43e8e3d68f3dc owner-app/sw.js e305c44d11a9c25f37372f3fa4d329d4ffb04df2edee6e7b4b9ac91f3875ac67 owner-app/manifest.webmanifest cc3dd9b8a359ba6c3f28d625c27cc6a01a46233311c2a5f5c8aaf09e91be8239 owner-app/brand-logo.png -79ba1abcda332fc867f1b220b8cf28d6919581cc67319451638a8adbfff4b62b staff-app/index.html -796194aa8b242b3cc075c5d5993a095e4de2cc70f24b284e5a1e31a0c27622ee staff-app/sw.js +0387c4b21e9fdb92fe47fa09a8704f380e21d8284a828ff3e486d16114a04e72 staff-app/index.html +df2ee642a8386570892490e6ab1d58398ac64f4660b278b31356273d8938228d staff-app/sw.js bd1d310ebf8e2a80808e100c41fb7fe1c4369d3026478f3ad8eececaeadaf4ac staff-app/manifest.webmanifest cc3dd9b8a359ba6c3f28d625c27cc6a01a46233311c2a5f5c8aaf09e91be8239 staff-app/brand-logo.png -84e8d941a89f40ba16b942dd41c22c9c24d3d12b28e8a506bb572103c51c0e88 customer-app/index.html -dfb9482bef1a425b5ab2e0743bd0c38fea8e85bd85a68363e9fe7c78dd659599 customer-app/sw.js +ac2e0ce27ca5805b22872bb3df5c13596f7a6c355c356e635683e474f042bfbc customer-app/index.html +49f30dd171f5442447d3ee2472bba054fa2a1619179869f80857a9b6fc53e65f customer-app/sw.js 3bfb1fd10cc13f09ca6be65c461e1f6b5750ae51a3ece12e079750b2a066052e customer-app/manifest.webmanifest cc3dd9b8a359ba6c3f28d625c27cc6a01a46233311c2a5f5c8aaf09e91be8239 customer-app/brand-logo.png -953bd0ec4df1c1f64b9caa9ed3ccb794a18d8011d652ed68de97e64be0814716 display-app/index.html -c29edd942dbd74a9b4b5d3fbc4345b49a3da949915f35fb2bceb0af39086afe1 display-app/sw.js +dde7b9699d41e82b5f2708e439ac478c4bba3a2ac74edbb7785b4ab7f74da277 display-app/index.html +5f1fd642a4e7fa0dd7a5445469e99d9f0c00d80ffaf0af73ad6e6ffd9bf997b3 display-app/sw.js 35e2721b86eb1ae1605e55bee64177adcee72f4e53a24ac417d19ea2873434a1 display-app/manifest.webmanifest cc3dd9b8a359ba6c3f28d625c27cc6a01a46233311c2a5f5c8aaf09e91be8239 display-app/brand-logo.png -ef4e0021350576bbb67d9fbe7a179a485cad2891778c959b6fed75a3a865cb0d chef-app/index.html -8d48b40fd1f0284f9ec766eefc2abf2f498bad83b550de573436f7cc4d3f37b6 chef-app/sw.js +e123ed87bb2e7de121c40f05a89f9483e6a312481cdde5dd60e2a13463b9535e chef-app/index.html +0c5957da85120216692349134f2f4abd4155a41e8bbfc587284c76778cf4526d chef-app/sw.js 97ed43decde8a888e22b7411e13a2122c6f8b9944cf38b2e28e8f62ef2e25397 chef-app/manifest.webmanifest cc3dd9b8a359ba6c3f28d625c27cc6a01a46233311c2a5f5c8aaf09e91be8239 chef-app/brand-logo.png diff --git a/car-app/_expo/static/js/web/bundle.js b/car-app/_expo/static/js/web/bundle.js index 678086d86a3a995dd38e51dc3861b0eac56fb26e..978805fd69212569725f6e3396be1a3d8c2f458f 100644 --- a/car-app/_expo/static/js/web/bundle.js +++ b/car-app/_expo/static/js/web/bundle.js @@ -921,7 +921,7 @@ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{v __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"ANCHORAGE_PAY",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"ANCHORAGE_KITCHEN",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"ANCHORAGE_KITCHEN_OLD",{enumerable:!0,get:function(){return u}}),Object.defineProperty(e,"restaurants",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"demoMenus",{enumerable:!0,get:function(){return l}});var t=r(d[0]);const n={slotMinutes:15,slotCap:3,bufferMins:5,leadMins:20,takeawayPaused:!1,bookingCoversPerSlot:20,bookingSlotMinutes:15,deposit:{...r(d[1]).DEPOSIT_DEFAULT},stampTarget:8,stampReward:'Free dessert',stampMinSpend:1e3,capacityPerHour:48,walkInShare:.35,turnMins:75,orderAtTable:!0},o={tipsFrequency:'fortnightly',tipsAnchorPayday:'2026-11-02',tipsEndsDaysBefore:1,wagePayDay:28,wageCutoffDay:23,weekendRule:'none'},s={0:['12:30','19:00'],1:null,2:null,3:['12:00','19:00'],4:['12:00','19:00'],5:['12:00','20:00'],6:['12:00','20:00']},u={0:['12:30','20:00'],1:null,2:null,3:['12:00','19:00'],4:['12:00','19:00'],5:['12:00','20:30'],6:['12:00','20:30']},c=[{id:'anchorage',name:'The Anchorage',tagline:'Harbourside seafood & Scottish produce',location:'Harbour View, Dunure, South Ayrshire',fictional:!1,phone:'01292 502826',website:'anchoragedunure.com',kitchenHours:s,hoursNote:'Kitchen (food) hours from Gordon, 30 Oct 2026: closed Mon\u2013Tue. The closing time is last food orders. Bar hours not set.',settings:{...n,orderAtTable:!1,pay:o,cashUpRecord:[...t.ANCHORAGE_CASH_UP],bookingCoversPerStart:15,bookingPartiesPerStart:4,onlinePartyMin:1,onlinePartyMax:8,bookingNoticeMins:15,autoAcceptUpTo:8},sections:[]}],l=[]},838,[839,841]); __d(function(g,_r,_i,_a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"TAKINGS_FIELDS",{enumerable:!0,get:function(){return t}}),Object.defineProperty(_e,"NO_SERVICE_SPLIT",{enumerable:!0,get:function(){return n}}),Object.defineProperty(_e,"TAKINGS_KEYS",{enumerable:!0,get:function(){return r}}),_e.withTakingsFields=function(e){e=e.filter(e=>!n.includes(e.key));const r=new Set(e.map(e=>e.key)),o=t.filter(e=>!r.has(e.key)).map(e=>({...e}));if(!o.length)return e;const a=e.findIndex(e=>'cash'===e.key),i=a<0?e.length:a+1;return[...e.slice(0,i),...o,...e.slice(i)]},Object.defineProperty(_e,"grossOf",{enumerable:!0,get:function(){return o}}),Object.defineProperty(_e,"ANCHORAGE_CASH_UP",{enumerable:!0,get:function(){return a}}),_e.cashFieldsForRecord=function(e,t){if(!t?.length)return e;const n=new Set,r=[];for(const o of t){const t=i[o],a=t?.key??`cu-${o.toLowerCase().replace(/[^a-z0-9]+/g,'-').replace(/^-|-$/g,'')||'figure'}`,l=e.find(e=>e.key===a);r.push({...l,...t??{kind:'money'},key:a,label:o}),n.add(a)}return[...r,...e.filter(e=>!n.has(e.key))]},Object.defineProperty(_e,"DEFAULT_CASHUP_FIELDS",{enumerable:!0,get:function(){return l}}),Object.defineProperty(_e,"DEFAULT_SALES_FIELDS",{enumerable:!0,get:function(){return u}}),_e.parseAmount=function(t,n="money"){if('number'===n){const e=t.replace(/[\xa3\s]/g,'');return/^\d{1,6}$/.test(e)?Number(e):null}return(0,e.parseMoneyInput)(t)},Object.defineProperty(_e,"isBlank",{enumerable:!0,get:function(){return s}}),Object.defineProperty(_e,"ymdUTC",{enumerable:!0,get:function(){return c}}),Object.defineProperty(_e,"addDaysYmd",{enumerable:!0,get:function(){return y}}),_e.weekStartOf=function(e){const t=(d(e).getUTCDay()+6)%7;return y(e,-t)},_e.combinedTips=function(e){const t='number'==typeof e.cashTips?e.cashTips:null,n='number'==typeof e.cardTips?e.cardTips:null;return null==t&&null==n?null:Math.round(100*((t??0)+(n??0)))/100},Object.defineProperty(_e,"takings",{enumerable:!0,get:function(){return f}}),Object.defineProperty(_e,"missing",{enumerable:!0,get:function(){return m}}),_e.dailySeries=function(e,t,n,r=f){const o=new Map(e.filter(e=>e.confirmedAt).map(e=>[e.date,e]));return Array.from({length:n},(e,a)=>{const i=y(t,a-n+1),l=o.get(i);return{date:i,value:l?r(l.vals):null}})},_e.weekCompare=function(e,t,n="net"){const r=t=>{const r=e.find(e=>e.weekStart===t&&e.confirmedAt),o=r?.vals[n];return'number'==typeof o?o:null},o=r(t),a=r(y(t,-7)),i=null!=o&&null!=a&&0!==a?Math.round((o-a)/a*1e3)/10:null;return{now:o,prev:a,change:i}},_e.tipsPot=function(e,t,n,r){const o=t.filter(e=>'payout'===e.kind&&e.throughDate).sort((e,t)=>e.at.localeCompare(t.at)),a=o[o.length-1],i=a?y(a.throughDate,1):n,l=e.filter(e=>e.date>=i&&e.date<=r).sort((e,t)=>e.date.localeCompare(t.date)),u=t.filter(e=>'correction'===e.kind&&e.forDate&&e.forDate>=i&&e.forDate<=r&&(!a||e.at>a.at)),s=Math.round(100*(l.reduce((e,t)=>e+t.total,0)+u.reduce((e,t)=>e+t.amount,0)))/100;return{from:i,total:Math.max(0,s),days:l,corrections:u,lastPayout:a??null,history:o.slice().reverse()}},_e.shareByHours=function(e,t,n){return e>0&&t>0&&n>0?Math.round(e*(t/n)*100)/100:0},_e.cashLocked=function(e,t=Date.now()){return!(!e.onServer||!e.confirmedAt)&&!(e.unlockedUntil&&Date.parse(e.unlockedUntil)>t)},_e.changedFields=function(e,t){const n=e??{},r=t??{},o=[],a=n.vals??{},i=r.vals??{};for(const e of new Set([...Object.keys(a),...Object.keys(i)]))JSON.stringify(a[e])!==JSON.stringify(i[e])&&o.push(e);JSON.stringify(n.categories??null)!==JSON.stringify(r.categories??null)&&(n.categories||r.categories)&&o.push('categories');JSON.stringify(n.photos??[])!==JSON.stringify(r.photos??[])&&e&&t&&o.push('photos');return o},Object.defineProperty(_e,"dayTakingsOf",{enumerable:!0,get:function(){return p}}),Object.defineProperty(_e,"daysInMonth",{enumerable:!0,get:function(){return k}}),_e.addMonths=b,Object.defineProperty(_e,"monthName",{enumerable:!0,get:function(){return O}}),Object.defineProperty(_e,"shortDay",{enumerable:!0,get:function(){return C}}),Object.defineProperty(_e,"longDay",{enumerable:!0,get:function(){return D}}),_e.poundsWhole=function(e){const t=e<0,n=String(Math.round(Math.abs(e))).replace(/\B(?=(\d{3})+(?!\d))/g,',');return`${t?'-':''}\xa3${n}`},_e.monthTakings=function(e,t,n,r){const o=new Map;for(const n of e){if(n.rid!==t)continue;const e=p(n);null!=e&&o.set(n.date,e)}const a=Number(n.slice(0,4)),i=Number(n.slice(5,7)),l=k(a,i),u=Array.from({length:l},(e,t)=>{const a=`${n}-${String(t+1).padStart(2,'0')}`,i=o.get(a),l=null!=i&&a<=r?'recorded':a>r?'future':a===r?'pending':'missing';return{date:a,day:t+1,value:'recorded'===l?i:null,state:l}}),s=u.filter(e=>'recorded'===e.state),c=Math.round(100*s.reduce((e,t)=>e+(t.value??0),0))/100,d=s.reduce((e,t)=>!e||t.value>e.value?{date:t.date,value:t.value}:e,null),y=r.slice(0,7)===n,f=n0?Math.round((c-T)/T*100):null;return{ym:n,month:O(n),days:u,total:c,recorded:s.length,current:y,past:f,best:d,vsPct:D}},Object.defineProperty(_e,"firstTakingsMonth",{enumerable:!0,get:function(){return P}}),_e.canSeeMonthTakings=function(e,t,n={}){return!n.inStaffApp&&'owner'===e&&(t?'owner'===t.role||!0===t.ownerAccess:!n.live)},_e.ownerHomeLayout=function(e,t,n=!1){return!n&&'owner'===e&&(!t||'owner'===t.role||!0===t.ownerAccess)};var e=_r(_d[0]);const t=[{key:'gross',label:'Gross takings',kind:'money',fixed:!0,optional:!0},{key:'food',label:'Food takings (optional)',kind:'money',fixed:!0,optional:!0},{key:'drink',label:'Drink takings (optional)',kind:'money',fixed:!0,optional:!0}],n=['lunchGross','dinnerGross'],r=t.map(e=>e.key);const o=e=>'number'==typeof e.gross?e.gross:null,a=['Z total','Card total','Cash total','Paid out','Card tips','Cash tips'],i={'Z total':{key:'zTotal',kind:'money'},'Card total':{key:'card',kind:'money'},'Cash total':{key:'cash',kind:'money'},'Paid out':{key:'paidOut',kind:'money',optional:!0},'Card tips':{key:'cardTips',kind:'money',fixed:!0},'Cash tips':{key:'cashTips',kind:'money',fixed:!0}};const l=[{key:'card',label:'Card takings',kind:'money'},{key:'cash',label:'Cash takings',kind:'money'},{key:'paidOut',label:'Paid out',kind:'money',fixed:!0,optional:!0},...t,{key:'float',label:'Float (tills)',kind:'money'},{key:'cashTips',label:'Cash tips total',kind:'money',fixed:!0},{key:'cardTips',label:'Card tips total',kind:'money',fixed:!0},{key:'overUnder',label:'Over / under (discrepancy)',kind:'money'},{key:'notes',label:'Notes',kind:'text'}],u=[{key:'gross',label:'Gross sales',kind:'money'},{key:'net',label:'Net sales',kind:'money',fixed:!0},{key:'vat',label:'VAT',kind:'money'},{key:'covers',label:'Covers',kind:'number'},{key:'discounts',label:'Discounts',kind:'money'},{key:'refunds',label:'Refunds',kind:'money'}];const s=e=>null==e||''===e,c=e=>e.toISOString().slice(0,10),d=e=>new Date(`${e}T12:00:00Z`),y=(e,t)=>{const n=d(e);return n.setUTCDate(n.getUTCDate()+t),c(n)};const f=e=>{const t='number'==typeof e.card?e.card:null,n='number'==typeof e.cash?e.cash:null;return null==t&&null==n?null:(t??0)+(n??0)},m=(e,t)=>e.filter(e=>'text'!==e.kind&&!e.optional&&s(t[e.key])).map(e=>e.key);const p=e=>e.confirmedAt?o(e.vals)??f(e.vals):null,k=(e,t)=>new Date(Date.UTC(e,t,0)).getUTCDate();function b(e,t){const n=Number(e.slice(0,4)),r=Number(e.slice(5,7))-1+t;return`${n+Math.floor(r/12)}-${String((r%12+12)%12+1).padStart(2,'0')}`}const h=['January','February','March','April','May','June','July','August','September','October','November','December'],S=['Sun','Mon','Tue','Wed','Thu','Fri','Sat'],T=['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'],O=e=>h[Number(e.slice(5,7))-1]??'',C=e=>{const t=d(e);return`${S[t.getUTCDay()]} ${t.getUTCDate()} ${h[t.getUTCMonth()].slice(0,3)}`},D=e=>{const t=d(e);return`${T[t.getUTCDay()]} ${t.getUTCDate()} ${h[t.getUTCMonth()]}`};const P=(e,t)=>e.filter(e=>e.rid===t&&null!=p(e)).map(e=>e.date.slice(0,7)).sort()[0]??null},839,[840]); __d(function(g,r,_i,_a,m,e,d){"use strict";function t(t,n){const i=!(!n?.allowMinus||!String(t??'').trim().startsWith('-'));let s=String(t??'').replace(/,/g,'.');s=s.replace(/[^\d.]/g,'');const l=s.indexOf('.');if(l>=0){s=s.slice(0,l+1)+s.slice(l+1).replace(/\./g,'');const[t,n=""]=s.split('.');s=t+'.'+n.slice(0,2)}return(i?'-':'')+s}Object.defineProperty(e,'__esModule',{value:!0}),e.sanitiseMoneyTyping=t,e.parseMoneyInput=function(n){const i=String(n??''),s=i.trim().startsWith('-'),l=i.trim().replace(/^\xa3/,'').replace(/\xa3/g,'').replace(/\s/g,'').replace(/^-/,'');if(l&&/[^\d.,]/.test(l))return null;const c=t(n);if(!c||'.'===c)return null;if(!/^\d+(\.\d{0,2})?$/.test(c))return null;const u=Math.round(100*Number(c))/100;return Number.isFinite(u)?s?-u:u:null},Object.defineProperty(e,"onMoneyChange",{enumerable:!0,get:function(){return n}});const n=n=>i=>n(t(i))},840,[]); -__d(function(g,r,i,a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"DEPOSIT_DEFAULT",{enumerable:!0,get:function(){return e}}),_e.depositOf=function(t){const n=t?.deposit;return n&&'object'==typeof n?{on:n.on??e.on,...!0===n.needsConfirmation?{needsConfirmation:!0}:{},perPersonPence:Number.isFinite(n.perPersonPence)?Math.max(0,Math.round(n.perPersonPence)):n.needsConfirmation?0:e.perPersonPence,fromParty:Number.isFinite(n.fromParty)?Math.max(1,Math.round(n.fromParty)):n.needsConfirmation?1:e.fromParty,refundable:'boolean'==typeof n.refundable?n.refundable:null,cutoffHours:Number.isFinite(n.cutoffHours)?Math.max(0,Math.round(n.cutoffHours)):null,policy:'string'==typeof n.policy?n.policy.slice(0,600):'',wixLinksOn:!0===n.wixLinksOn,wixLinkHours:Number.isFinite(n.wixLinkHours)?Math.max(1,Math.min(168,Math.round(n.wixLinkHours))):48}:{...e}},_e.childrenIn=t,Object.defineProperty(_e,"adultsIn",{enumerable:!0,get:function(){return n}}),_e.depositDue=o,_e.depositWords=function(e,d,u,p=0){if(e.needsConfirmation&&!e.on)return[e.policy.trim()||'Deposit policy awaiting venue confirmation.'];if(e.needsConfirmation)return['Table deposit policy not set yet. Ticketed event deposits are separate and are not a table policy.'];const l=o(e,d,p);if(!l)return[];const c=[t(d,p)?`A deposit of ${s(l)} (${s(e.perPersonPence)} for each of the ${n(d,p)} adults; children are free) is needed for ${e.fromParty} or more guests.`:`A deposit of ${s(l)} (${s(e.perPersonPence)} per adult; children are free) is needed for ${e.fromParty} or more guests.`];!0===e.refundable?c.push(e.cutoffHours?`Refundable if you cancel at least ${e.cutoffHours} hours before your booking.`:'Refundable if you cancel.'):!1===e.refundable?c.push('The deposit is not refundable.'):c.push(`Ask ${u} about refunds.`);e.policy.trim()&&c.push(e.policy.trim());return c.push(e.wixLinksOn?`${u} will send you a link to pay the deposit securely through website bookings.`:`No payment is taken in the app yet: ${u} will tell you how to pay the deposit.`),c},_e.waiverOf=d,_e.depositState=u,_e.waiverText=p,_e.canWaiveDeposit=function(e){if(['cancelled','finished','noshow','declined'].includes(e.status??''))return!1;const t=l(e);return'PAID'!==t&&'FULLY_REFUNDED'!==t&&'PARTIALLY_REFUNDED'!==t&&'FREE'!==t&&('paid'!==e.depositLink?.state&&('NOT_PAID'===t||'PARTIALLY_PAID'===t?!d(e):'due'===u(e)))},_e.wixPayStatus=l,_e.knownPaid=c,_e.fromWixOrder=f,_e.estimatedWix=b,_e.depositBadge=m,_e.canTickDeposit=function(e){if(d(e))return!1;const t=l(e);return'NOT_PAID'!==t&&'PAID'!==t&&'FULLY_REFUNDED'!==t&&'PARTIALLY_REFUNDED'!==t&&('paid'!==e.depositLink?.state&&'due'===u(e))},_e.canSendDepositLink=function(e,t){return!(!t.wixLinksOn||l(e)||d(e))&&(!e.walkIn&&!['cancelled','finished','noshow','declined'].includes(e.status??'')&&('due'===u(e)&&'paid'!==e.depositLink?.state))},_e.depositTerms=function(e){const t=[];!0===e.refundable?t.push(e.cutoffHours?`The deposit is refundable if you cancel at least ${e.cutoffHours} hours before.`:'The deposit is refundable if you cancel.'):!1===e.refundable&&t.push('The deposit is not refundable.');e.policy.trim()&&t.push(e.policy.trim());return t.join(' ')},_e.depositLinkMessage=function(e){const t=(e.name||'').trim().split(/\s+/)[0]||'there',[n,o,d]=e.date.split('-').map(Number),u=new Date(n,(o||1)-1,d||1).toLocaleDateString('en-GB',{weekday:'long',day:'numeric',month:'long'}),p=e.expiresAt?new Date(e.expiresAt).toLocaleString('en-GB',{timeZone:'Europe/London',weekday:'long',day:'numeric',month:'long',hour:'numeric',minute:'2-digit',hourCycle:'h12'}).replace(/\s?(am|pm)$/i,e=>e.trim().toLowerCase()):'',l=[`Hello ${t}, thank you for booking ${e.venue} for ${e.partySize} on ${u} at ${e.time.slice(0,5)}.`,`To hold your table, please pay the ${s(e.amountPence)} deposit here: ${e.url}`];p&&l.push(`The link works until ${p}.`);e.terms?.trim()&&l.push(e.terms.trim());return l.push(`Thank you, ${e.venue}`),l.join('\n')},_e.depositView=D,_e.depositShort=function(e){const t=D(e,!1);return t?t.a11y.split(',')[0]:null};const e={on:!0,perPersonPence:1e3,fromParty:6,refundable:null,cutoffHours:null,policy:''};function t(e,t){const n=Math.max(0,Math.round(Number(e)||0)),o=Math.round(Number(t)||0);return Math.max(0,Math.min(n,o))}const n=(e,n)=>Math.max(0,Math.round(Number(e)||0)-t(e,n));function o(e,t,o=0){return!e.on||e.perPersonPence<=0||t`\xa3${(e/100).toFixed(e%100?2:0)}`;function d(e){const t=e.depositWaived;return t&&'object'==typeof t&&'string'==typeof t.by&&t.by?t:null}function u(e){if('deposit'!==e.security)return'none';const t=e.depositDue??e.depositPaid??0;return t?(e.depositPaid??0)>=t?'paid':d(e)?'waived':'due':'none'}function p(e){const t=new Date(e.at),n=!Number.isNaN(t.getTime())?t.toLocaleString('en-GB',{timeZone:'Europe/London',day:'2-digit',month:'2-digit',hour:'2-digit',minute:'2-digit',hourCycle:'h23'}).replace(',',''):'';return`Waived by ${e.by}${n?`, ${n}`:''}${e.note?.trim()?` (${e.note.trim()})`:''}`}function l(e){const t=e.wix?.paymentStatus;return t&&['FREE','NOT_PAID','PAID','PARTIALLY_PAID','PARTIALLY_REFUNDED','FULLY_REFUNDED'].includes(t)?t:null}function c(e){return'paid'===e.depositLink?.state&&(e.depositLink.paidPence??0)>0?e.depositLink.paidPence:e.depositPaidBy&&'Wix'!==e.depositPaidBy&&(e.depositPaid??0)>0&&!e.wix?.depositEstimated||f(e)&&(e.depositPaid??0)>0?e.depositPaid:null}function f(e){return'wix-order'===e.wix?.amountSource||'wix-order'===e.depositSource}function b(e){if(f(e)||!e.wix?.depositEstimated&&'estimate'!==e.depositSource)return null;const t=e.depositPaid??0;if(t<=0)return null;const n=e.partySize??0;return{pence:t,perHead:e.wix?.perPersonPence??(n?Math.round(t/n):0),party:n}}function m(e,t=s){const n=l(e),o=c(e),p=d(e);if(p&&'PAID'!==n&&(!e.depositPaidBy||!o)&&'paid'!==e.depositLink?.state&&'paid'!==u(e))return{label:`Deposit waived \xb7 ${p.by}`,kind:'neutral'};if(n&&'FREE'!==n){if(e.depositPaidBy&&o)return{label:`Deposit paid \xb7 ${t(o)}`,kind:'gold'};if('PAID'===n){if(o)return{label:`Deposit paid \xb7 ${t(o)}`,kind:'gold'};const n=b(e);return n?{label:n.party&&n.perHead?`Deposit paid (about ${t(n.pence)}, ${n.party} \xd7 ${t(n.perHead)})`:`Deposit paid (about ${t(n.pence)})`,kind:'gold'}:{label:'Deposit paid on website bookings',kind:'gold'}}return'PARTIALLY_PAID'===n?{label:o&&(e.depositDue??0)>o?`Part paid on website bookings \xb7 ${t(o)} of ${t(e.depositDue)}`:'Part paid on website bookings',kind:'amber'}:'NOT_PAID'===n?{label:(e.depositDue??0)>0?`Deposit not paid \xb7 ${t(e.depositDue)} due`:'Deposit not paid',kind:'amber'}:'FULLY_REFUNDED'===n?{label:'Deposit refunded on website bookings',kind:'neutral'}:{label:'Deposit part refunded on website bookings',kind:'neutral'}}const f=u(e);if('none'===f)return null;const m=e.depositLink;return'paid'===m?.state?{label:o?`Deposit paid on website bookings \xb7 ${t(o)}`:'Deposit paid on website bookings',kind:'gold'}:'paid'===f?{label:o?`Deposit paid \xb7 ${t(o)}`:'Deposit paid',kind:'gold'}:'open'===m?.state?{label:`Deposit link sent \xb7 waiting \xb7 ${t(m.amountPence??e.depositDue??0)}`,kind:'amber'}:'expired'===m?.state?{label:'Deposit link ran out \xb7 send a new one',kind:'amber'}:{label:`Deposit due \xb7 ${t(e.depositDue??0)}`,kind:'amber'}}function D(e,t,n=s){const o=m(e,n);if(!o)return null;const u=l(e),c=o.label.startsWith('Deposit paid');if(o.label.startsWith('Deposit waived')){const n=d(e);return{label:t?o.label:'Deposit waived',kind:'neutral',a11y:p(n).replace(/^Waived/,'Deposit waived'),note:t?p(n):void 0,paid:!1}}if(!t)return c?{label:'\u2713 Deposit paid',kind:'gold',a11y:'Deposit paid',paid:c}:'PARTIALLY_PAID'===u?{label:'Deposit part paid',kind:'amber',a11y:'Deposit part paid',paid:c}:'FULLY_REFUNDED'===u||'PARTIALLY_REFUNDED'===u?{label:'Deposit refunded',kind:'neutral',a11y:'Deposit refunded',paid:c}:'NOT_PAID'===u?{label:'Deposit not paid',kind:'amber',a11y:'Deposit not paid yet',paid:c}:{label:'Deposit due',kind:'amber',a11y:'Deposit due, not paid yet',paid:c};const D='PAID'===u?b(e):null,y=D&&D.perHead?`Website bookings shows paid; amount worked out at ${n(D.perHead)} a head`:f(e)&&c?'Amount from the website bookings order':void 0,P=o.label.replace(/ \xb7 /g,', ').replace(/\xd7/g,'times').replace(/[()]/g,'')+(y?`. ${y}`:'');return{label:o.label,kind:o.kind,a11y:P,note:y,paid:c}}},841,[]); +__d(function(g,r,i,a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"DEPOSIT_DEFAULT",{enumerable:!0,get:function(){return e}}),_e.depositOf=function(t){const n=t?.deposit;return n&&'object'==typeof n?{on:n.on??e.on,...!0===n.needsConfirmation?{needsConfirmation:!0}:{},perPersonPence:Number.isFinite(n.perPersonPence)?Math.max(0,Math.round(n.perPersonPence)):n.needsConfirmation?0:e.perPersonPence,fromParty:Number.isFinite(n.fromParty)?Math.max(1,Math.round(n.fromParty)):n.needsConfirmation?1:e.fromParty,refundable:'boolean'==typeof n.refundable?n.refundable:null,cutoffHours:Number.isFinite(n.cutoffHours)?Math.max(0,Math.round(n.cutoffHours)):null,policy:'string'==typeof n.policy?n.policy.slice(0,600):'',wixLinksOn:!0===n.wixLinksOn,wixLinkHours:Number.isFinite(n.wixLinkHours)?Math.max(1,Math.min(168,Math.round(n.wixLinkHours))):48}:{...e}},_e.childrenIn=t,Object.defineProperty(_e,"adultsIn",{enumerable:!0,get:function(){return n}}),_e.depositDue=o,_e.depositWords=function(e,d,u,p=0){if(e.needsConfirmation&&!e.on)return[e.policy.trim()||'Deposit policy awaiting venue confirmation.'];if(e.needsConfirmation)return['Table deposit policy not set yet. Ticketed event deposits are separate and are not a table policy.'];const l=o(e,d,p);if(!l)return[];const c=[t(d,p)?`A deposit of ${s(l)} (${s(e.perPersonPence)} for each of the ${n(d,p)} adults; children don't count towards the ${e.fromParty} and don't pay) is needed for ${e.fromParty} or more adults.`:`A deposit of ${s(l)} (${s(e.perPersonPence)} per adult; children don't count towards the ${e.fromParty} and don't pay) is needed for ${e.fromParty} or more adults.`];!0===e.refundable?c.push(e.cutoffHours?`Refundable if you cancel at least ${e.cutoffHours} hours before your booking.`:'Refundable if you cancel.'):!1===e.refundable?c.push('The deposit is not refundable.'):c.push(`Ask ${u} about refunds.`);e.policy.trim()&&c.push(e.policy.trim());return c.push(e.wixLinksOn?`${u} will send you a link to pay the deposit securely through website bookings.`:`No payment is taken in the app yet: ${u} will tell you how to pay the deposit.`),c},_e.waiverOf=d,_e.depositState=u,_e.waiverText=p,_e.canWaiveDeposit=function(e){if(['cancelled','finished','noshow','declined'].includes(e.status??''))return!1;const t=l(e);return'PAID'!==t&&'FULLY_REFUNDED'!==t&&'PARTIALLY_REFUNDED'!==t&&'FREE'!==t&&('paid'!==e.depositLink?.state&&('NOT_PAID'===t||'PARTIALLY_PAID'===t?!d(e):'due'===u(e)))},_e.wixPayStatus=l,_e.knownPaid=c,_e.fromWixOrder=f,_e.estimatedWix=b,_e.depositBadge=m,_e.canTickDeposit=function(e){if(d(e))return!1;const t=l(e);return'NOT_PAID'!==t&&'PAID'!==t&&'FULLY_REFUNDED'!==t&&'PARTIALLY_REFUNDED'!==t&&('paid'!==e.depositLink?.state&&'due'===u(e))},_e.canSendDepositLink=function(e,t){return!(!t.wixLinksOn||l(e)||d(e))&&(!e.walkIn&&!['cancelled','finished','noshow','declined'].includes(e.status??'')&&('due'===u(e)&&'paid'!==e.depositLink?.state))},_e.depositTerms=function(e){const t=[];!0===e.refundable?t.push(e.cutoffHours?`The deposit is refundable if you cancel at least ${e.cutoffHours} hours before.`:'The deposit is refundable if you cancel.'):!1===e.refundable&&t.push('The deposit is not refundable.');e.policy.trim()&&t.push(e.policy.trim());return t.join(' ')},_e.depositLinkMessage=function(e){const t=(e.name||'').trim().split(/\s+/)[0]||'there',[n,o,d]=e.date.split('-').map(Number),u=new Date(n,(o||1)-1,d||1).toLocaleDateString('en-GB',{weekday:'long',day:'numeric',month:'long'}),p=e.expiresAt?new Date(e.expiresAt).toLocaleString('en-GB',{timeZone:'Europe/London',weekday:'long',day:'numeric',month:'long',hour:'numeric',minute:'2-digit',hourCycle:'h12'}).replace(/\s?(am|pm)$/i,e=>e.trim().toLowerCase()):'',l=[`Hello ${t}, thank you for booking ${e.venue} for ${e.partySize} on ${u} at ${e.time.slice(0,5)}.`,`To hold your table, please pay the ${s(e.amountPence)} deposit here: ${e.url}`];p&&l.push(`The link works until ${p}.`);e.terms?.trim()&&l.push(e.terms.trim());return l.push(`Thank you, ${e.venue}`),l.join('\n')},_e.depositView=y,_e.depositShort=function(e){const t=y(e,!1);return t?t.a11y.split(',')[0]:null};const e={on:!0,perPersonPence:1e3,fromParty:6,refundable:null,cutoffHours:null,policy:''};function t(e,t){const n=Math.max(0,Math.round(Number(e)||0)),o=Math.round(Number(t)||0);return Math.max(0,Math.min(n,o))}const n=(e,n)=>Math.max(0,Math.round(Number(e)||0)-t(e,n));function o(e,t,o=0){return!e.on||e.perPersonPence<=0||n(t,o)`\xa3${(e/100).toFixed(e%100?2:0)}`;function d(e){const t=e.depositWaived;return t&&'object'==typeof t&&'string'==typeof t.by&&t.by?t:null}function u(e){if('deposit'!==e.security)return'none';const t=e.depositDue??e.depositPaid??0;return t?(e.depositPaid??0)>=t?'paid':d(e)?'waived':'due':'none'}function p(e){const t=new Date(e.at),n=!Number.isNaN(t.getTime())?t.toLocaleString('en-GB',{timeZone:'Europe/London',day:'2-digit',month:'2-digit',hour:'2-digit',minute:'2-digit',hourCycle:'h23'}).replace(',',''):'';return`Waived by ${e.by}${n?`, ${n}`:''}${e.note?.trim()?` (${e.note.trim()})`:''}`}function l(e){const t=e.wix?.paymentStatus;return t&&['FREE','NOT_PAID','PAID','PARTIALLY_PAID','PARTIALLY_REFUNDED','FULLY_REFUNDED'].includes(t)?t:null}function c(e){return'paid'===e.depositLink?.state&&(e.depositLink.paidPence??0)>0?e.depositLink.paidPence:e.depositPaidBy&&'Wix'!==e.depositPaidBy&&(e.depositPaid??0)>0&&!e.wix?.depositEstimated||f(e)&&(e.depositPaid??0)>0?e.depositPaid:null}function f(e){return'wix-order'===e.wix?.amountSource||'wix-order'===e.depositSource}function b(e){if(f(e)||!e.wix?.depositEstimated&&'estimate'!==e.depositSource)return null;const t=e.depositPaid??0;if(t<=0)return null;const n=e.partySize??0;return{pence:t,perHead:e.wix?.perPersonPence??(n?Math.round(t/n):0),party:n}}function m(e,t=s){const n=l(e),o=c(e),p=d(e);if(p&&'PAID'!==n&&(!e.depositPaidBy||!o)&&'paid'!==e.depositLink?.state&&'paid'!==u(e))return{label:`Deposit waived \xb7 ${p.by}`,kind:'neutral'};if(n&&'FREE'!==n){if(e.depositPaidBy&&o)return{label:`Deposit paid \xb7 ${t(o)}`,kind:'gold'};if('PAID'===n){if(o)return{label:`Deposit paid \xb7 ${t(o)}`,kind:'gold'};const n=b(e);return n?{label:n.party&&n.perHead?`Deposit paid (about ${t(n.pence)}, ${n.party} \xd7 ${t(n.perHead)})`:`Deposit paid (about ${t(n.pence)})`,kind:'gold'}:{label:'Deposit paid on website bookings',kind:'gold'}}return'PARTIALLY_PAID'===n?{label:o&&(e.depositDue??0)>o?`Part paid on website bookings \xb7 ${t(o)} of ${t(e.depositDue)}`:'Part paid on website bookings',kind:'amber'}:'NOT_PAID'===n?{label:(e.depositDue??0)>0?`Deposit not paid \xb7 ${t(e.depositDue)} due`:'Deposit not paid',kind:'amber'}:'FULLY_REFUNDED'===n?{label:'Deposit refunded on website bookings',kind:'neutral'}:{label:'Deposit part refunded on website bookings',kind:'neutral'}}const f=u(e);if('none'===f)return null;const m=e.depositLink;return'paid'===m?.state?{label:o?`Deposit paid on website bookings \xb7 ${t(o)}`:'Deposit paid on website bookings',kind:'gold'}:'paid'===f?{label:o?`Deposit paid \xb7 ${t(o)}`:'Deposit paid',kind:'gold'}:'open'===m?.state?{label:`Deposit link sent \xb7 waiting \xb7 ${t(m.amountPence??e.depositDue??0)}`,kind:'amber'}:'expired'===m?.state?{label:'Deposit link ran out \xb7 send a new one',kind:'amber'}:{label:`Deposit due \xb7 ${t(e.depositDue??0)}`,kind:'amber'}}function y(e,t,n=s){const o=m(e,n);if(!o)return null;const u=l(e),c=o.label.startsWith('Deposit paid');if(o.label.startsWith('Deposit waived')){const n=d(e);return{label:t?o.label:'Deposit waived',kind:'neutral',a11y:p(n).replace(/^Waived/,'Deposit waived'),note:t?p(n):void 0,paid:!1}}if(!t)return c?{label:'\u2713 Deposit paid',kind:'gold',a11y:'Deposit paid',paid:c}:'PARTIALLY_PAID'===u?{label:'Deposit part paid',kind:'amber',a11y:'Deposit part paid',paid:c}:'FULLY_REFUNDED'===u||'PARTIALLY_REFUNDED'===u?{label:'Deposit refunded',kind:'neutral',a11y:'Deposit refunded',paid:c}:'NOT_PAID'===u?{label:'Deposit not paid',kind:'amber',a11y:'Deposit not paid yet',paid:c}:{label:'Deposit due',kind:'amber',a11y:'Deposit due, not paid yet',paid:c};const y='PAID'===u?b(e):null,D=y&&y.perHead?`Website bookings shows paid; amount worked out at ${n(y.perHead)} a head`:f(e)&&c?'Amount from the website bookings order':void 0,P=o.label.replace(/ \xb7 /g,', ').replace(/\xd7/g,'times').replace(/[()]/g,'')+(D?`. ${D}`:'');return{label:o.label,kind:o.kind,a11y:P,note:D,paid:c}}},841,[]); __d(function(_g,_r,_i,_a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"SHAPES",{enumerable:!0,get:function(){return a}}),Object.defineProperty(_e,"shapeLabel",{enumerable:!0,get:function(){return o}}),Object.defineProperty(_e,"tableLabel",{enumerable:!0,get:function(){return s}}),Object.defineProperty(_e,"tableNumber",{enumerable:!0,get:function(){return u}}),_e.numberClashes=function(e){const t=new Map;for(const n of e){const e=u(n);t.set(e,[...t.get(e)??[],{name:n.name,areaId:n.areaId}])}const n=new Set,r=[];for(const[e,a]of t){if(a.length<2)continue;const t=new Map;a.forEach(e=>t.set(e.areaId,[...t.get(e.areaId)??[],e.name]));for(const e of t.values())e.length>1&&e.forEach(e=>n.add(e));t.size>1&&r.push(e)}return{sameArea:n,acrossAreas:r}},Object.defineProperty(_e,"liveTableLabel",{enumerable:!0,get:function(){return l}}),Object.defineProperty(_e,"FIXTURES",{enumerable:!0,get:function(){return i}}),Object.defineProperty(_e,"PLAN_W",{enumerable:!0,get:function(){return c}}),Object.defineProperty(_e,"PLAN_H",{enumerable:!0,get:function(){return b}}),Object.defineProperty(_e,"GRID",{enumerable:!0,get:function(){return m}}),Object.defineProperty(_e,"snap",{enumerable:!0,get:function(){return f}}),Object.defineProperty(_e,"clamp",{enumerable:!0,get:function(){return h}}),Object.defineProperty(_e,"fid",{enumerable:!0,get:function(){return g}}),Object.defineProperty(_e,"slug",{enumerable:!0,get:function(){return w}}),_e.sizeFor=y,Object.defineProperty(_e,"minFor",{enumerable:!0,get:function(){return x}}),Object.defineProperty(_e,"numOf",{enumerable:!0,get:function(){return O}}),Object.defineProperty(_e,"byNumber",{enumerable:!0,get:function(){return P}}),_e.newTable=j,_e.autoArrange=M,_e.placeNew=S,_e.rotate90=function(e){const t=e.x+e.w/2,n=e.y+e.h/2;return{...e,w:e.h,h:e.w,x:h(f(t-e.h/2),0,c-e.h),y:h(f(n-e.w/2),0,b-e.w)}},_e.normalisePlan=function(e){return{...e,fixtures:e.fixtures??[],tables:e.tables.map(e=>{const t=e.shape;let n='booth'===t||'rect'===t?'rect':'round'===t?'round':'square',{w:r,h:a}=e;if('square'===n||'round'===n){const e=Math.max(r,a);r=e,a=e}if(90===e.rot||270===e.rot){const e=r;r=a,a=e}return'rect'===n&&r===a&&(n='square'),{...e,shape:n,w:r,h:a,rot:0}})}},Object.defineProperty(_e,"SECTION_COLOURS",{enumerable:!0,get:function(){return I}}),_e.buildPlan=k,_e.anchoragePlan=$,_e.starterPlan=function(){return k({areas:[{name:'Main room',tables:[[1,2],[2,4],[3,6],[4,4],[5,2],[6,6]],fixtures:[A(450,600)]}]},['SV'])},Object.defineProperty(_e,"TEMPLATES",{enumerable:!0,get:function(){return v}}),_e.parseTableList=function(e){const t=[],n=[];let r;for(const a of e.split(/\r?\n/)){const e=a.trim();if(!e)continue;if(!/\d/.test(e)){r=e.replace(/[:\-\u2013]+$/,'').trim()||r;continue}const o=e.match(/^(?:table|tbl|tab|t)?\s*(?:no\.?|number|#)?\s*([a-z]?\d+[a-z]?)\b[^\d]*?(\d+)/i);if(!o){n.push(e);continue}const s=parseInt(o[2],10);!s||s>30?n.push(e):t.push({area:r,name:o[1].toUpperCase(),seats:s})}return{items:t,skipped:n}},Object.defineProperty(_e,"planCounts",{enumerable:!0,get:function(){return C}}),Object.defineProperty(_e,"tableDogOk",{enumerable:!0,get:function(){return B}}),Object.defineProperty(_e,"dogTables",{enumerable:!0,get:function(){return L}}),Object.defineProperty(_e,"areaOfTable",{enumerable:!0,get:function(){return q}}),_e.bestTables=E,Object.defineProperty(_e,"isBestTable",{enumerable:!0,get:function(){return _}}),_e.withSeedBest=function(e,t){if('anchorage'!==e||!t?.areas?.some(e=>void 0===e.best))return t;const n=$();return{...t,areas:t.areas.map(e=>{if(void 0!==e.best)return e;const r=n.areas.find(t=>t.id===e.id||t.name===e.name),a=(r?.best??[]).filter(n=>t.tables.some(t=>t.name===n&&t.areaId===e.id));return a.length?{...e,best:a}:e})}};var e,t=_r(d[0]),n=_r(d[1]),r=(e=n)&&e.__esModule?e:{default:e};const a=[{id:'square',label:'Square'},{id:'rect',label:'Rectangle'},{id:'round',label:'Round'}],o=e=>'rect'===e?'Rectangle':'round'===e?'Round':'Square',s=e=>/\d/.test(e.name)?(0,t.plainTableNumber)(e.name):(0,t.plainTableNumber)(e.label?.trim()||e.name),u=s;const l=(e,t)=>u(e),i=[{id:'bar',label:'Bar',w:300,h:50},{id:'wall',label:'Wall',w:250,h:25},{id:'door',label:'Door',w:100,h:25},{id:'window',label:'Window',w:200,h:25}],c=1e3,b=625,m=25,f=e=>Math.round(e/m)*m,h=(e,t,n)=>Math.max(t,Math.min(n,e));let p=0;const g=e=>`${e}-${Date.now().toString(36)}${(p++).toString(36)}`,w=e=>e.toLowerCase().replace(/[^a-z0-9]+/g,'-').replace(/^-|-$/g,'')||'area';function y(e){return e<=2?{shape:'square',w:75,h:75}:e<=4?{shape:'square',w:100,h:100}:e<=6?{shape:'rect',w:150,h:100}:e<=8?{shape:'rect',w:200,h:100}:e<=10?{shape:'rect',w:250,h:100}:{shape:'rect',w:300,h:100}}const x=e=>e<=2?1:Math.max(2,Math.ceil(e/2)),O=e=>{const t=e.match(/\d+/);return t?parseInt(t[0],10):9999},P=(e,t)=>O(e.name)-O(t.name)||e.name.localeCompare(t.name);function j(e,t,n,r){const a=y(n);return{id:`t-${e}-${g('x').slice(2)}`,name:e,areaId:t,shape:a.shape,minSeats:x(n),maxSeats:n,x:0,y:0,w:a.w,h:a.h,rot:0,online:!0,sectionId:r}}function M(e,t=125,n=75){const r=[...e].sort(P);if(!r.length)return r;let a=75;const o=e=>{const t=[];let n=[],a=0;for(const o of r){const r=(n.length?e:0)+o.w;n.length&&a+r>850&&(t.push(n),n=[],a=0),n.push(o),a+=(n.length>1?e:0)+o.w}return n.length&&t.push(n),t};let s=o(a);const u=(e,t)=>e.reduce((e,t)=>e+Math.max(...t.map(e=>e.h)),0)+t*(e.length-1);for(;u(s,a)>b-t-n&&a>25;)a-=25,s=o(a);const l=u(s,a),i=b-t-n,p=s.length>1?Math.min(150,a+Math.max(0,Math.floor((i-l)/(s.length-1)/m)*m)):0,g=s.reduce((e,t)=>e+Math.max(...t.map(e=>e.h)),0)+p*(s.length-1);let w=f(t+Math.max(0,(i-g)/2));const y=[];for(const e of s){const t=Math.max(...e.map(e=>e.h)),n=e.reduce((e,t)=>e+t.w,0)+a*(e.length-1);let r=f((c-n)/2);for(const n of e)y.push({...n,x:h(r,0,c-n.w),y:h(f(w+(t-n.h)/2),0,b-n.h),rot:0}),r+=n.w+a;w+=t+p}return y}function S(e,t,n=[]){const r=[...e,...n].map(e=>({x:e.x,y:e.y,w:e.w,h:e.h})),a=[];for(const e of t){let t=null;for(let n=50;n<=b-e.h-25&&!t;n+=m)for(let a=50;a<=c-e.w-25&&!t;a+=m){const o=50;r.some(t=>at.x&&nt.y)||(t={x:a,y:n})}const n=t??{x:50,y:50},o={...e,x:n.x,y:n.y};r.push({x:o.x,y:o.y,w:o.w,h:o.h}),a.push(o)}return a}const I=['#CFA45F','#E2C489','#A88B5A','#8C6A3A','#FFB547','#D9B98A'];function k(e,t=[]){const n=[],r=[],a=[],o=[];e.areas.forEach((e,s)=>{const u=w(e.name),l=e.best?e.best.map(String).filter(t=>e.tables.some(([e])=>String(e)===t)):void 0;n.push({id:u,name:e.name,dogs:!!e.dogs,outdoor:!!e.outdoor,...e.label?{label:e.label}:{},...e.colour?{colour:e.colour}:{},...l?{best:l}:{}});const i=`s-${u}`;o.push({id:i,name:e.name,colour:e.colour??I[s%I.length],server:t[s]??''});const m=(e.fixtures??[]).map((e,t)=>({...e,id:`fx-${u}-${t}`,areaId:u}));a.push(...m);const f=m.some(e=>e.y<100&&('bar'===e.kind||e.w>=300))?150:100,p=e.tables.map(([e,t])=>({...j(String(e),u,t,i),id:`t-${e}`})),g=e.layout??{},y=p.filter(e=>g[e.name]).map(e=>{const t=g[e.name],n=t.shape??(t.w===t.h?'square':'rect'),r=h(Math.round(t.w),50,c),a=h(Math.round('rect'===n?t.h:t.w),50,b);return{...e,shape:n,w:r,h:a,x:h(Math.round(t.x),0,c-r),y:h(Math.round(t.y),0,b-a),...t.label?{label:t.label}:{}}}),x=p.filter(e=>!g[e.name]);y.length?r.push(...y,...S(y,x,m)):r.push(...M(p,f,75))});const s=new Set(r.map(e=>e.name)),u=(e.joins??[]).filter(e=>e.every(e=>s.has(e))).map(e=>({id:`j-${e.join('-')}`,tables:e}));return{areas:n,tables:r,joins:u,sections:o,fixtures:a}}const T=(e,t,n=0,r=25)=>({kind:'window',x:e,y:n,w:t,h:r}),A=(e,t,n=100,r=25)=>({kind:'door',x:e,y:t,w:n,h:r});function $(){const e=r.default;return k({areas:e.areas.map(e=>({name:e.name,dogs:!!e.dogFriendly,outdoor:!(!e.outdoor&&!e.weatherDependent),label:e.label,colour:e.colour,tables:e.tables.map(([e,t])=>[e,t]),layout:e.layout,fixtures:[],best:e.best?.map(String)})),joins:e.joins??[]},e.areas.map(e=>e.server??''))}const v=[{id:'anchorage',name:'The Anchorage',sub:'4 areas \xb7 29 tables \xb7 119 seats',make:$},{id:'cafe',name:'Small caf\xe9',sub:'1 room \xb7 8 tables \xb7 dogs welcome',make:()=>k({areas:[{name:'Caf\xe9',dogs:!0,tables:[[1,2],[2,2],[3,4],[4,4],[5,2],[6,4],[7,2],[8,6]],fixtures:[{kind:'bar',x:300,y:25,w:400,h:50},A(450,600)]}]})},{id:'pub',name:'Pub with garden',sub:'Bar, lounge and beer garden',make:()=>k({areas:[{name:'Bar',dogs:!0,tables:[[1,2],[2,4],[3,4],[4,2],[5,4],[6,6]],fixtures:[{kind:'bar',x:250,y:25,w:500,h:75}]},{name:'Lounge',tables:[[7,4],[8,4],[9,2],[10,6],[11,4],[12,2],[13,4],[14,8]],fixtures:[T(150,700)]},{name:'Beer garden',dogs:!0,outdoor:!0,tables:[[20,6],[21,6],[22,4],[23,4],[24,6],[25,6]]}]})},{id:'restaurant',name:'Restaurant and terrace',sub:'Dining room with an outdoor terrace',make:()=>k({areas:[{name:'Dining room',tables:[[1,2],[2,2],[3,4],[4,4],[5,4],[6,6],[7,2],[8,2],[9,4],[10,4],[11,6],[12,8]],fixtures:[T(100,800),A(450,600)]},{name:'Terrace',outdoor:!0,tables:[[20,2],[21,4],[22,4],[23,2]]}]})},{id:'blank',name:'Blank',sub:'One empty room to start from',make:()=>k({areas:[{name:'Main room',tables:[]}]})}];const C=(e,t)=>{const n=t?e.tables.filter(e=>e.areaId===t):e.tables;return{tables:n.length,seats:n.reduce((e,t)=>e+t.maxSeats,0)}},B=(e,t)=>void 0!==t.dogOk?t.dogOk:!!e.areas.find(e=>e.id===t.areaId)?.dogs,L=e=>new Set(e.tables.filter(t=>B(e,t)).map(e=>e.name)),q=(e,t)=>e.areas.find(n=>n.id===e.tables.find(e=>e.name===t)?.areaId);function E(e,t){return e.areas.filter(e=>!t||e.id===t).flatMap(t=>(t.best??[]).filter(n=>e.tables.some(e=>e.name===n&&e.areaId===t.id)))}const _=(e,t)=>E(e).includes(t)},842,[843,844]); __d(function(g,r,i,a,m,e,d){"use strict";function t(t){const n=String(t??'').trim(),l=n.match(/\d+/g);return 1===l?.length?l[0].replace(/^0+(?=\d)/,''):n}Object.defineProperty(e,'__esModule',{value:!0}),e.plainTableNumber=t,Object.defineProperty(e,"tableNumbers",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"tableListNumbers",{enumerable:!0,get:function(){return l}}),e.tableNumbersA11y=function(t){const l=n(t).split('+').filter(Boolean);return l.length?`${1===l.length?'Table':'Tables'} ${l.join(', ')}`:'No table'},e.withTableWord=function(t){const n=t.trim();return!n||/^tables?\b/i.test(n)||/^no table\b/i.test(n)?n:`Table ${n}`};const n=n=>String(n??'').split('+').map(t).filter(Boolean).join('+'),l=(t,l=" + ")=>t.map(n).filter(Boolean).join(l)},843,[]); __d(function(e,a,l,r,t,o,s){t.exports={venue:"The Anchorage",note:"From Gordon 28 Oct 2026; layout from Gordon's floor-plan photo 29 Oct 2026 (positions, sizes, shapes, labels scaled from the photo, one scale for all areas). Photo shows MT12 and no MT8: table 8 replaced by 12. Gordon confirmed 29 Oct: no table 8; MT11 and MT12 both exist, MT11 keeps 2 seats, MT12 = 2 seats. No tables 4 or 8. No joined tables: Gordon confirmed 29 Oct that DT1 and DT2 are not joined.",areas:[{name:"Public Bar",label:"Dog friendly area (Public Bar), Area 1",colour:"#CFA45F",server:"BR",dogFriendly:!0,tables:[[1,4],[2,4],[3,5],[5,2],[6,4]],layout:{1:{label:"DT1",shape:"rect",x:600,y:125,w:205,h:90},2:{label:"DT2",shape:"rect",x:395,y:130,w:100,h:190},3:{label:"DT3",shape:"rect",x:205,y:120,w:110,h:245},5:{label:"DT5",shape:"square",x:500,y:395,w:105,h:105},6:{label:"DT6",shape:"rect",x:195,y:395,w:205,h:110}},best:[1,3]},{name:"Main Restaurant",label:"Main restaurant (no pets)",colour:"#8EC5FF",server:"SV",dogFriendly:!1,tables:[[7,5],[9,7],[10,4],[11,2],[12,2],[13,4],[14,4],[15,4],[16,2]],layout:{7:{label:"MT7",shape:"rect",x:590,y:410,w:225,h:115},9:{label:"MT9",shape:"rect",x:560,y:105,w:260,h:110},10:{label:"MT10",shape:"square",x:430,y:400,w:130,h:130},11:{label:"MT11",shape:"rect",x:545,y:270,w:115,h:90},12:{label:"MT12",shape:"rect",x:400,y:270,w:120,h:95},13:{label:"MT13",shape:"rect",x:400,y:100,w:90,h:115},14:{label:"MT14",shape:"rect",x:185,y:420,w:230,h:100},15:{label:"MT15",shape:"rect",x:190,y:220,w:165,h:145},16:{label:"MT16",shape:"rect",x:185,y:105,w:125,h:80}},best:[7,9]},{name:"Sitooterie",label:"Sitooterie (fully covered conservatory, no pets)",colour:"#C79BE8",server:"DM",dogFriendly:!1,tables:[[17,2],[18,6],[19,4],[20,6],[21,4],[22,4],[23,4]],layout:{17:{label:"ST17",shape:"square",x:760,y:325,w:110,h:110},18:{label:"ST18",shape:"rect",x:605,y:135,w:270,h:115},19:{label:"ST19",shape:"rect",x:460,y:160,w:105,h:150},20:{label:"ST20",shape:"rect",x:135,y:125,w:265,h:120},21:{label:"ST21",shape:"rect",x:120,y:305,w:110,h:175},22:{label:"ST22",shape:"rect",x:255,y:310,w:115,h:175},23:{label:"ST23",shape:"rect",x:410,y:350,w:110,h:155}},best:[19,21]},{name:"Beer Garden",label:"Outdoor beer garden (weather permitting, no shelter, pets allowed)",colour:"#B08D57",server:"GD",dogFriendly:!0,outdoor:!0,weatherDependent:!0,tables:[[24,4],[25,4],[26,4],[27,6],[28,6],[29,4],[30,4],[31,4]],layout:{24:{label:"BGT24",shape:"round",x:740,y:70,w:130,h:130},25:{label:"BGT25",shape:"round",x:515,y:50,w:135,h:135},26:{label:"BGT26",shape:"round",x:310,y:50,w:135,h:135},27:{label:"BGT27",shape:"rect",x:560,y:235,w:280,h:115},28:{label:"BGT28",shape:"rect",x:245,y:235,w:270,h:110},29:{label:"BGT29",shape:"rect",x:210,y:365,w:190,h:60},30:{label:"BGT30",shape:"rect",x:180,y:445,w:190,h:55},31:{label:"BGT31",shape:"rect",x:130,y:520,w:215,h:60}},best:[27,28]}],photoScale:1.8,joins:[],bestNote:"Best tables per area from Gordon, 1 Nov 2026: Bar 1 and 3; Restaurant 7 and 9; Sitooterie 19 and 21; Outside (Beer Garden) 27 and 28. Shown as BEST for walk-ins and bookings when they fit; editable per area in the table plan."}},844,[]); @@ -1059,7 +1059,7 @@ __d(function(g,r,i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule' __d(function(g,r,i,a,_m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.setClockServer=function(t){s=t,c()},e.markClockUnsent=function(t){o.set(t,Date.now()),c()},e.markClockSent=function(t){o.delete(t)&&c()},e.clockNotSent=l,e.useClockNotSent=function(o){const[,c]=(0,t.useState)(0);return(0,t.useEffect)(()=>{const t=()=>c(t=>t+1);u.add(t);const o=n.mutationQueue.subscribe(t);return()=>{u.delete(t),o()}},[]),l(o)};var t=r(d[0]),n=r(d[1]);const o=new Map,u=new Set,c=()=>{for(const t of u)t()};let s=()=>!1;function l(t){if(!t)return!1;return n.mutationQueue.pending.some(n=>'attendance'===n.table&&n.rowKey===t)||o.has(t)&&s()}n.mutationQueue.onDone(t=>{'attendance'===t.table&&o.delete(t.rowKey)&&c()})},976,[17,977]); __d(function(g,_r,i,a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"MutationQueue",{enumerable:!0,get:function(){return l}}),Object.defineProperty(_e,"mutationQueue",{enumerable:!0,get:function(){return o}});var t=_r(d[0]),e=_r(d[1]),s=_r(d[2]);const n='queue:v1',r='queue:failed:v1',h=t=>`${t.table}|${t.venueId}|${t.rowKey}`;class l{items=[];failedItems=[];loaded=null;flushing=null;flushingSince=0;exec=null;listeners=new Set;onFailure=new Set;onSaved=new Set;retryTimer=null;waitTimer=null;backoffMs=2e3;now=()=>Date.now();constructor(){(0,t.onConnectivity)(t=>{t&&this.flush()})}setExecutor(t){this.exec=t}load(){return this.loaded||(this.loaded=(async()=>{const t=await e.kv.get(n,[]);this.items=[...t.map(t=>({...t,nextAt:void 0})),...this.items],this.failedItems=await e.kv.get(r,[]),this.emit()})()),this.loaded}get pending(){return this.items}get waiting(){return this.items.filter(t=>t.attempts>0)}get failed(){return this.failedItems}hasPending(t,e,s){return this.items.some(n=>n.table===t&&n.venueId===e&&n.rowKey===s)}async enqueue(t){await this.load();const s={...t,id:(0,e.uuid)(),createdAt:(new Date).toISOString(),attempts:0};return this.items.push(s),await this.persist(),this.flush(),s}nextReady(){const t=new Set,e=this.now();for(const s of this.items){const n=h(s);if(!t.has(n)){if(!(s.nextAt&&s.nextAt>e))return s;t.add(n)}}}remove(t){this.items=this.items.filter(e=>e!==t)}flush(){if(this.flushing&&Date.now()-this.flushingSince<6e4)return this.flushing;this.flushingSince=Date.now();let e=null;return e=(async()=>{for(await this.load();this.exec;){if(this.flushing&&this.flushing!==e)return;const n=this.nextReady();if(!n)break;if(!(0,t.isOnline)()){this.scheduleRetry();break}try{const t=await this.exec(n);this.remove(n),this.backoffMs=2e3,'conflict'===t?this.fail(n,'conflict','Row changed on the server (version conflict) or is not visible to you'):this.onSaved.forEach(t=>t(n))}catch(e){n.attempts+=1,n.lastError=String(e?.message??e);const r=e??{};n.lastErr={code:r.code?String(r.code):void 0,status:Number(r.status)||void 0,message:n.lastError.slice(0,300)};const h=(0,s.classifyWriteError)(e);if('network'===h){n.attempts-=1,(0,t.setOnline)(!1),this.scheduleRetry(),await this.persist();break}'retry'===h?n.nextAt=this.now()+(0,s.retryDelayMs)(n.attempts):(this.remove(n),this.fail(n,'rejected',n.lastError))}await this.persist()}this.flushing===e&&(this.flushing=null),this.scheduleWaiting()})(),this.flushing=e,e}retryNow(){for(const t of this.items)t.nextAt=void 0;return this.flush()}subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}onFailed(t){return this.onFailure.add(t),()=>{this.onFailure.delete(t)}}onDone(t){return this.onSaved.add(t),()=>{this.onSaved.delete(t)}}async clearFailed(){this.failedItems=[],await e.kv.set(r,[]),this.emit()}fail(t,s,n){const h={...t,lastError:n,failedAt:(new Date).toISOString(),reason:s};this.failedItems=[h,...this.failedItems].slice(0,100),e.kv.set(r,this.failedItems),this.onFailure.forEach(t=>t(h))}scheduleWaiting(){this.waitTimer&&(clearTimeout(this.waitTimer),this.waitTimer=null);const t=this.items.map(t=>t.nextAt??0).filter(t=>t>0);if(!t.length)return;const e=Math.max(500,Math.min(...t)-this.now());this.waitTimer=setTimeout(()=>{this.waitTimer=null,this.flush()},e)}scheduleRetry(){if(this.retryTimer)return;const e=this.backoffMs;this.backoffMs=Math.min(2*this.backoffMs,6e4),this.retryTimer=setTimeout(()=>{this.retryTimer=null,(0,t.setOnline)(!0),this.flush()},e)}async persist(){await e.kv.set(n,this.items),this.emit()}emit(){this.listeners.forEach(t=>t())}}const o=new l},977,[974,936,978]); __d(function(g,r,i,a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.classifyWriteError=function(o){if((0,e.isNetworkError)(o))return'network';const{code:n,status:c,msg:l}=t(o);return s(o)?'refused':/^(08|53|57|58)/.test(n)||['40001','40P01','55P03','23505','23503'].includes(n)||/^PGRST30[0-3]$/.test(n)||/jwt|token.*expired/i.test(l)||401===c||408===c||425===c||429===c||c>=500?'retry':409!==c||n?'refused':'retry'},Object.defineProperty(_e,"retryDelayMs",{enumerable:!0,get:function(){return o}}),_e.describeWrite=function(e){const t='rpc'===e.kind?(e.fn??'change').replace(/_/g,' '):n[e.table]??e.table.replace(/_/g,' ').replace(/s$/,''),s=e.values??{},o=s.guest_name??s.name??s.display_name??s.title??s.reason,c='string'==typeof o&&o.trim()?` for ${o.trim().slice(0,60)}`:'';return'delete'===e.kind?`deleting a ${t}${c}`:`the ${t}${c}`},_e.plainReason=function(e,o){const{code:n,status:c,msg:l}=t(e);if('refused'===o)return s(e)?'more than 20 deletes in 10 minutes from one sign-in are stopped to keep your data safe':'42501'===n||403===c||/row-level security|permission/i.test(l)?'your sign-in isn\u2019t allowed to change this':'conflict'===n?'it was changed or removed on another device first':/^(22|23)/.test(n)?'the shared system says some of the details aren\u2019t valid':'P0001'===n&&l?l.slice(0,140):l?`the shared system said: ${l.slice(0,120)}`:'the shared system refused it';return'23505'===n?'the shared system already has another copy of it':'23503'===n?'a related change has to save first':/^PGRST30/.test(n)||401===c||/jwt/i.test(l)?'your sign-in is being refreshed':'the shared system is busy'};var e=r(d[0]);const t=e=>{const t=e&&'object'==typeof e?e:{};return{msg:String(t.message??e??''),code:String(t.code??''),status:Number(t.status??0)||0,hint:String(t.hint??'')}},s=e=>{const s=t(e);return/delete guard/i.test(s.hint)||/too many .* deleted in 10 minutes/i.test(s.msg)};const o=e=>Math.min(5e3*Math.pow(3,Math.max(0,e-1)),3e5),n={bookings:'booking',walk_ins:'walk-in',blocks:'blocked time',sold_out_items:'sold-out mark',sold_out_links:'dish stock link',staff:'staff details',rota_shifts:'rota shift',stock_items:'stock item',stock_events:'stock count',stock_counts:'stock count',chat_messages:'chat message',recipe_cards:'recipe card',order_lists:'order list',order_list_items:'order list item',daily_task_ticks:'task tick',daily_tasks:'daily task',attendance:'clock in or out',cash_ups:'cash-up',table_plans:'table plan',guest_profiles:'guest profile',floor_live:'table status',venues:'venue settings',time_requests:'clock correction request',staff_leave:'time off',scheduled_notifications:'reminder',suppliers:'supplier',supplier_orders:'supplier order',takeaway_orders:'takeaway order'}},978,[974]); -__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"APP_VERSION",{enumerable:!0,get:function(){return t}});const t='v0.3.12.192'},979,[]); +__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"APP_VERSION",{enumerable:!0,get:function(){return t}});const t='v0.3.12.193'},979,[]); __d(function(g,_r,i,a,_m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"TableRepository",{enumerable:!0,get:function(){return c}}),e.executeMutation=async function(t){const s=(t,s)=>{throw Object.assign(t,{status:s})};if('rpc'===t.kind){const{error:n,status:r}=await u().rpc(t.fn,t.values??{});return n&&s(n,r),'ok'}const n=u().from(t.table);if('upsert'===t.kind||'insert'===t.kind){const{error:r,status:o}=await n.upsert(t.values??{},{onConflict:t.conflictKey??'id',ignoreDuplicates:'insert'===t.kind});if(r&&'stock_events'===t.table&&'23503'===r.code&&/undoes/i.test(String(r.message??''))&&t.values?.undoes){t.values={...t.values,undoes:null};const r=await n.upsert(t.values,{onConflict:t.conflictKey??'id',ignoreDuplicates:'insert'===t.kind});return r.error&&s(r.error,r.status),'ok'}return r&&s(r,o),'ok'}let r='update'===t.kind?n.update(t.values??{}):n.delete();for(const[s,n]of Object.entries(t.match??{}))r=r.eq(s,n);const{data:o,error:c,status:l}=await r.select();c&&s(c,l);return'update'!==t.kind||o&&0!==o.length?'ok':'conflict'};var t=_r(d[0]),s=_r(d[1]),n=_r(d[2]),r=_r(d[3]),o=_r(d[4]);const u=()=>(0,n.getSupabase)();class c{constructor(t,s={}){this.table=t,this.opts=s,this.keyOf=s.keyOf??(t=>String(t.id)),this.keyColumns=s.keyColumns??['id'],this.venueCol=s.venueColumn??'venue_id'}rows(t){return s.cache.rows(this.table,t)}get(t,n){return s.cache.get(this.table,t,n)}subscribe(t,n){return s.cache.subscribe(this.table,t,n)}hydrate(t){return s.cache.hydrate(this.table,t)}async refresh(n,r={}){const c=()=>{let t=u().from(this.table).select('*').eq(this.venueCol,n);return this.opts.orderBy&&(t=t.order(this.opts.orderBy.column,{ascending:this.opts.orderBy.ascending??!0})),r.filter&&(t=r.filter(t)),t},l='bookings'===this.table?await(0,t.readPages)(async(t,s)=>{const{data:n,error:r}=await c().order('id').range(t,s);if(r)throw r;return n??[]}):await(async()=>{const{data:t,error:s}=await c().limit(this.opts.limit??1e3);if(s)throw s;return t??[]})();return s.cache.replace(this.table,n,l.map(t=>[this.keyOf(t),t]),t=>o.mutationQueue.hasPending(this.table,n,t)),l}async create(t,n){const u={...1===this.keyColumns.length&&'id'===this.keyColumns[0]?{id:(0,r.uuid)()}:{},...n,[this.venueCol]:t},c=this.keyOf(u);return s.cache.put(this.table,t,c,u),await o.mutationQueue.enqueue({table:this.table,venueId:t,kind:'insert'===this.opts.writeMode?'insert':'upsert',rowKey:c,values:u,conflictKey:this.opts.conflictKey??'id'}),u}async update(t,n,r,u={}){const c=s.cache.get(this.table,t,n),l={...this.matchFor(n,c),...u,[this.venueCol]:t};s.cache.patch(this.table,t,n,{...r,updated_at:(new Date).toISOString()}),await o.mutationQueue.enqueue({table:this.table,venueId:t,kind:'update',rowKey:n,values:r,match:l})}async remove(t,n){const r=s.cache.get(this.table,t,n),u={...this.matchFor(n,r),[this.venueCol]:t};s.cache.remove(this.table,t,n),await o.mutationQueue.enqueue({table:this.table,venueId:t,kind:'delete',rowKey:n,match:u})}matchFor(t,s){if(1===this.keyColumns.length&&'id'===this.keyColumns[0])return{id:t};const n={};for(const t of this.keyColumns)n[t]=s?.[t];return n}}},980,[981,982,892,936,977]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.readPages=async function(t,n=1e3){const s=[];for(let c=0;;c+=n){const o=await t(c,c+n-1);if(s.push(...o),o.length`cache:${t}:${n}`;function f(t){let s=n.get(t);return s||(s=new Map,n.set(t,s)),s}function p(n){s.delete(n),c.get(n)?.forEach(t=>t());const u=o.get(n);u&&clearTimeout(u),o.set(n,setTimeout(()=>{o.delete(n),t.kv.set(n,Array.from(f(n).entries()))},250))}const w={async hydrate(n,s){const c=l(n,s);if(u.has(c))return;u.add(c);const o=await t.kv.get(c,[]),w=f(c);let h=0;for(const[t,n]of o)w.has(t)||(w.set(t,n),h++);h&&p(c)},rows(t,n){const c=l(t,n);let o=s.get(c);return o||(o=Array.from(f(c).values()),s.set(c,o)),o},get:(t,n,s)=>f(l(t,n)).get(s),put(t,n,s,c){f(l(t,n)).set(s,c),p(l(t,n))},patch(t,n,s,c){const o=f(l(t,n)),u=o.get(s);u&&(o.set(s,{...u,...c}),p(l(t,n)))},remove(t,n,s){f(l(t,n)).delete(s)&&p(l(t,n))},replace(t,s,c,o=()=>!1){const u=l(t,s),w=f(u),h=new Map(c);w.forEach((t,n)=>{o(n)&&h.set(n,t)}),n.set(u,h),p(u)},subscribe(t,n,s){const o=l(t,n);let u=c.get(o);return u||(u=new Set,c.set(o,u)),u.add(s),()=>{u?.delete(s)}},async clearVenue(o,f){for(const p of f){const f=l(p,o);n.delete(f),s.delete(f),u.delete(f),await t.kv.remove(f),c.get(f)?.forEach(t=>t())}}}},982,[936]); @@ -1174,7 +1174,7 @@ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{v __d(function(g,_r,i,a,_m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.guardBookingChange=w,_e.saveTablesReported=async function(e,t,n,o,s,u){if(!w(u,{b:t,tables:n}))return!1;const v=n.length?(0,h.notSavedWhat)({...t,name:o,table:n.join('+')}):`Taking the table off ${o}`;u(`Saving ${v}\u2026`);try{await(0,b.saveBookingTables)(e,t,n)}catch(e){const t=`${v} did not save: ${String(e?.message??e).slice(0,120)}`;return u(t),(0,l.announce)(t),!1}const y=await(0,c.waitForBookingSave)(t.id);if('saved'===y.state||'local'===y.state){const e=(0,r.savedWords)(o,t.partySize,n,s);return u(e),(0,l.announce)(e),!0}const k='waiting'===y.state?`${v}: not saved yet. It saves by itself when the connection is back; a red banner shows if it fails.`:`${v} did not save. ${f("why"in y?y.why:"the shared system did not take it")}. Tap the red banner to try again.`;return u(k),(0,l.announce)(k),!1},_e.reportBookingSave=async function(e,t,n,o){const s=await(0,c.waitForBookingSave)(e);if('saved'===s.state||'local'===s.state)return o(t),(0,l.announce)(t),!0;const r='waiting'===s.state?`${n}: not saved yet. It saves by itself when the connection is back; a red banner shows if it fails.`:`${n} did not save. ${f('why'in s?s.why:'the shared system did not take it')}. Tap the red banner to try again.`;return o(r),(0,l.announce)(r),!1},_e.BookingSaveBanner=function({rid:e,testID:r="booking-save-banner",margin:c}){const b=(0,h.useBookingSaves)(e=>e.notSaved),w=(0,s.useBookings)(e).filter(e=>b[e.id]).map(e=>void 0!==b[e.id].want?{...e,table:b[e.id].want||void 0}:e),{msg:S,retry:$}=k(),m=(0,t.useRef)(''),p=w.map(e=>(0,h.notSavedLine)(e)),B=w.map(e=>e.id).sort().join(',');if((0,t.useEffect)(()=>{B&&B!==m.current&&(0,l.announce)(1===w.length?p[0]:`${w.length} booking changes did not save. Tap the red banner to try again.`),m.current=B},[B]),!w.length)return null;const j=1===w.length?p[0]:`${w.length} booking changes did not save. Tap to try again.`;return(0,y.jsx)(n.default,{testID:r,accessibilityRole:"button",accessibilityLiveRegion:"assertive",accessibilityLabel:`${j}${w.length>1?` ${w.map(e=>(0,h.notSavedWhat)(e)).join('. ')}.`:''} ${f(b[w[0].id].why)}.`,onPress:$,style:{...c??{},alignSelf:'stretch',gap:4,padding:12,borderRadius:12,borderWidth:2,borderColor:u.colours.red,backgroundColor:'#3a1210',alignItems:'center'},children:(0,y.jsxs)(o.default,{accessibilityRole:"alert",style:{alignItems:'center',gap:4},children:[(0,y.jsx)(v.T,{testID:`${r}-title`,size:17,weight:"semibold",center:!0,colour:"#FFD2CC",children:j}),w.length>1?w.slice(0,6).map(e=>(0,y.jsx)(v.T,{testID:`${r}-line`,size:15,center:!0,colour:"#FFD2CC",children:(0,h.notSavedWhat)(e)},e.id)):null,(0,y.jsx)(v.T,{testID:`${r}-why`,size:14,center:!0,colour:"#FFB3AA",children:w.length>1?`${f(b[w[0].id].why)}${w.length>6?` \xb7 and ${w.length-6} more`:''}`:f(b[w[0].id].why)}),S?(0,y.jsx)(v.T,{testID:`${r}-msg`,size:14,center:!0,colour:u.colours.goldLight,children:S}):null]})})},_e.BookingNotSavedLine=function({b:e}){const t=(0,h.useBookingSaves)(t=>t.notSaved[e.id]),{msg:o,retry:s}=k();if(!t)return null;void 0!==t.want&&(e={...e,table:t.want||void 0});return(0,y.jsxs)(n.default,{testID:`booking-not-saved-${e.id}`,accessibilityRole:"button",accessibilityLiveRegion:"assertive",accessibilityLabel:`${(0,h.notSavedLine)(e)} ${f(t.why)}.`,onPress:s,style:{alignSelf:'stretch',padding:8,borderRadius:10,borderWidth:1.5,borderColor:u.colours.red,backgroundColor:'#3a1210',alignItems:'center'},children:[(0,y.jsx)(v.T,{size:15,weight:"semibold",center:!0,colour:"#FFD2CC",children:(0,h.notSavedLine)(e)}),o?(0,y.jsx)(v.T,{size:13,center:!0,colour:u.colours.goldLight,children:o}):null]})};var t=_r(d[0]),n=e(_r(d[1])),o=e(_r(d[2])),s=_r(d[3]),r=_r(d[4]),l=_r(d[5]),c=_r(d[6]),h=_r(d[7]),u=_r(d[8]),b=_r(d[9]),v=_r(d[10]),y=_r(d[11]);const f=e=>e.charAt(0).toUpperCase()+e.slice(1);function w(e,t){const n=(0,c.bookingSaveBlocker)();if(!n)return!0;t&&h.useBookingSaves.getState().mark({id:t.b.id,table:t.b.walkIn?'walk_ins':'bookings',why:n,...t.tables?{want:t.tables.join('+')}:{}});const o=`${t?(0,h.notSavedWhat)({...t.b,...t.tables?{table:t.tables.join('+')||void 0}:{}}):'This change'} did not save: ${n}.`;return e?.(o),(0,l.announce)(o),!1}function k(){const[e,n]=(0,t.useState)('');return{msg:e,retry:async()=>{n('Saving\u2026'),(0,l.announce)('Saving');const e=await(0,c.saveBookingsNow)(!0),t=e?`Not saved: ${e}.`:h.useBookingSaves.getState().count()?'Sent again. The banner clears when the shared system takes it.':'Nothing is left waiting. Check the plan and make the change again if it is not there.';n(t),(0,l.announce)(t)}}}},1091,[17,385,85,858,1092,1093,946,984,804,1089,777,8]); __d(function(_g,r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"byNum",{enumerable:!0,get:function(){return s}}),e.tableKey=o,e.toggleTable=function(t,n){return t.includes(n)?t.filter(t=>t!==n):a(o([...t,n]))},e.seatsOf=function(t,n){const a={};for(const s of n)a[s]=t.tables.find(t=>t.name===s)?.maxSeats??0;return{per:a,total:Object.values(a).reduce((t,n)=>t+n,0)}},e.seatLine=function(t,n){const a=Math.max(0,n-t);return{text:`${t} ${1===t?'seat':'seats'} for ${l(n)}${a?`: ${a} short`:''}`,short:a,fits:0===a&&t>0}},e.pickClashes=u,e.requestedFreeTable=function(t,n,a,s,l=90){const o={id:n.id??'new',status:'confirmed',...n};for(const n of t)if(a.includes(n)&&!u(o,[n],s,l).length)return n;return null},e.overCapacityAsk=function(n,s,l){const u=a(o(n));if(!u.length||s>=l)return null;const c=u.map(n=>(0,t.tableNumbers)(n));return`${1===c.length?`Table ${c[0]} seats`:`Tables ${c.slice(0,-1).join(', ')} and ${c[c.length-1]} seat`} ${s} \u2013 this booking is ${l}. Use it anyway?`},e.clashWords=function(n){return n.map(n=>`${(0,t.tableNumbers)(n.table)} has ${n.with.walkIn?'a walk-in':(n.with.name||'a booking').replace(' (example)','')} at ${n.with.time}`).join('. ')+(n.length?'.':'')},e.tablesWords=c,e.pickA11y=function(n,a,s,l){return`Table ${(0,t.tableNumbers)(n)}, ${a} ${1===a?'seat':'seats'}${s?', selected':''}${l?`, has ${l.walkIn?'a walk-in':l.name} at ${l.time}`:''}`},e.pickGroups=function(t){return t.areas.map(n=>({area:n.name,tables:t.tables.filter(t=>t.areaId===n.id).map(t=>({name:t.name,seats:t.maxSeats})).sort((t,n)=>s(t.name,n.name))})).filter(t=>t.tables.length)},e.savedWords=function(t,n,a,s){return a.length?`${t}, ${l(n)}: ${c(a)} (${s} seats).`:`${t}: table taken off.`},e.tableActions=function(t,n){const s=a(t.table);if(['cancelled','noshow'].includes(t.status))return[];const o=[s.length?{id:'assign',label:'Change table',a11y:`Change table for ${n}, ${l(t.partySize)}, now ${c(s).toLowerCase()}. You can pick several tables to join.`}:{id:'assign',label:'Assign table',a11y:`Assign table for ${n}, ${l(t.partySize)}. You can pick several tables to join.`}];s.length&&o.push({id:'clear',label:'Clear table',a11y:`Clear table for ${n}, take ${c(s).toLowerCase()} off this booking`});return o},e.dragTables=function(t,n,s){if(!s||'__none'===s||s===n)return null;const l=a(t);if(l.includes(s))return null;return o('__none'!==n&&l.includes(n)?l.map(t=>t===n?s:t):[s])};var t=r(d[0]),n=r(d[1]);const a=t=>t?t.split('+').map(t=>t.trim()).filter(Boolean):[],s=(t,n)=>t.localeCompare(n,'en-GB',{numeric:!0}),l=t=>`${t} ${1===t?'person':'people'}`;function o(t){return[...new Set(t.map(t=>String(t).trim()).filter(Boolean))].sort(s).join('+')}function u(t,l,u,c=90){if(!l.length)return[];const f={...t,table:o(l)},b=[];for(const s of u)if(s.id!==t.id&&s.date===t.date&&!['cancelled','noshow','finished'].includes(s.status)&&(0,n.startOf)(f)<(0,n.endOf)(s,c)&&(0,n.startOf)(s)<(0,n.endOf)(f,c))for(const t of a(s.table))l.includes(t)&&b.push({table:t,with:s});return b.sort((t,n)=>s(t.table,n.table))}function c(n){const s=a(o(n));return s.length?(0,t.tableListNumbers)(s):'No table'}},1092,[843,1074]); __d(function(g,r,i,a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.primeAnnouncer=function(){u()},_e.announce=function(t){const e=String(t??'').trim();if(!e)return;{const t=u();if(!t)return;const n=++o;return t.textContent='',void setTimeout(()=>{n===o&&(t.textContent=e)},80)}},Object.defineProperty(_e,"lastAnnounced",{enumerable:!0,get:function(){return c}});var t,e=r(d[0]);(t=e)&&t.__esModule;r(d[1]);let n=null,o=0;function u(){if('undefined'==typeof document||!document.body)return null;if(n&&document.body.contains(n))return n;const t=document.createElement('div');return t.id='cc-announcer',t.setAttribute('aria-live','assertive'),t.setAttribute('aria-atomic','true'),t.setAttribute('role','status'),t.setAttribute('data-testid','cc-announcer'),Object.assign(t.style,{position:'absolute',width:'1px',height:'1px',margin:'-1px',padding:'0',overflow:'hidden',clip:'rect(0 0 0 0)',whiteSpace:'nowrap',border:'0'}),document.body.appendChild(t),n=t,t}const c=()=>n?.textContent??''},1093,[264,219]); -__d(function(g,_r,_i,_a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"TABLES",{enumerable:!0,get:function(){return A}}),_e.useTableNames=R,_e.resetTableLive=W,_e.seatBookingNow=async function(e,t){await k.repo.bookings.setStatus(t.id,'seated'),W(e,t.table)},_e.finishBookingNow=async function(e,t){const s=(new Date).toISOString();await k.repo.bookings.update(t.id,(0,N.finishClearPatch)(s,t.table)),(0,v.tablesOf)(t.table).forEach(t=>v.useFloor.getState().setLive(e,t,{stage:void 0,dirty:!0}))},_e.useTableUse=E,Object.defineProperty(_e,"walkInLabel",{enumerable:!0,get:function(){return _}}),_e.TablePicker=H,_e.WalkInSheet=q,_e.AssignTableSheet=V,_e.undoNotice=Y,_e.NewBookingSheet=G,_e.useFrontDoor=function(e,t){const[s,o]=(0,c.useState)(!1),[l,a]=(0,c.useState)(!1),[i,n]=(0,c.useState)(null);return{openWalkIn:()=>o({}),openWalkInAt:e=>o({table:e}),openBooking:()=>a(!0),assignTable:e=>n({b:e}),combineTables:e=>n({b:e,combine:!0}),elements:(0,F.jsxs)(F.Fragment,{children:[s?(0,F.jsx)(q,{wide:t,initialTable:s.table,onClose:()=>o(!1),onSeated:Y}):null,l?(0,F.jsx)(G,{wide:t,date:e,onClose:()=>a(!1),onSaved:e=>(0,u.notify)({id:`booked:${Date.now()}`,testID:'booking-saved-toast',timeoutMs:5e3,icon:'\u2713',title:`Booked: ${e.name} \xb7 ${(0,w.niceDate)((0,w.parseYmd)(e.date))} at ${e.time}`})}):null,i?(0,F.jsx)(V,{booking:i.b,combine:i.combine,onClose:()=>n(null)}):null]})}};var t=_r(_d[0]),s=_r(_d[1]),o=_r(_d[2]),l=_r(_d[3]),a=_r(_d[4]),i=_r(_d[5]),n=_r(_d[6]),r=_r(_d[7]),d=_r(_d[8]),u=_r(_d[9]),c=_r(_d[10]),b=e(c),h=_r(_d[11]),p=e(_r(_d[12])),m=e(_r(_d[13])),f=_r(_d[14]),y=_r(_d[15]),k=_r(_d[16]),x=_r(_d[17]),j=_r(_d[18]),w=_r(_d[19]),S=_r(_d[20]),T=_r(_d[21]),C=_r(_d[22]),v=_r(_d[23]),D=_r(_d[24]),I=_r(_d[25]),$=_r(_d[26]),P=_r(_d[27]),O=_r(_d[28]),B=_r(_d[29]),z=_r(_d[30]),M=_r(_d[31]),N=_r(_d[32]),F=_r(_d[33]);const L=e=>(0,u.notify)({id:'booking-blocked',testID:'booking-blocked-toast',timeoutMs:9e3,icon:'\u26a0',title:e}),A=Array.from({length:12},(e,t)=>String(t+1));function R(e){const t=(0,v.usePlan)(e);return t.areas.flatMap(e=>t.tables.filter(t=>t.areaId===e.id).map(e=>e.name))}function W(e,t){(0,v.tablesOf)(t).forEach(t=>v.useFloor.getState().setLive(e,t,{stage:'seated',dirty:!1}))}function E(e,t){const s=(0,k.useBookings)(e),o=(0,k.useOrders)(e),l=R(e),a=(0,v.useFloor)(t=>t.live[e])??{},i=(0,v.usePlan)(e),n=(0,D.useBlocks)(e=>e.blocks),r=(0,w.ymd)(t),d=(0,D.closedAreasAt)(n,e,r,(0,w.hm)(t)),u={};for(const e of l)u[e]=a[e]?.blocked||d.has(`tbl:${e}`)?{busy:!0,label:'Blocked'}:d.has(i.tables.find(t=>t.name===e)?.areaId??'')?{busy:!0,label:'Closed'}:a[e]?.dirty?{busy:!0,label:'Needs clearing'}:{busy:!1,label:'Free'};for(const e of s)if(e.date===r&&e.table)for(const s of(0,v.tablesOf)(e.table))if(u[s])if('seated'===e.status)u[s]={busy:!0,label:`${e.walkIn?'Walk-in':`${e.name.slice(0,1)}.`} \xb7 ${e.partySize}`};else if('confirmed'===e.status&&!u[s].busy){const o=(0,w.minsBetween)(t,new Date(`${e.date}T${e.time}:00`));o>=-15&&o<=90&&(u[s]={...u[s],soon:`Booked ${e.time}`})}for(const e of o)'table'===e.type&&e.tableNo&&u[e.tableNo]&&!['closed','cancelled','collected'].includes(e.status)&&!u[e.tableNo].busy&&(u[e.tableNo]={busy:!0,label:'Open order'});return u}const _=e=>e.walkIn?`Walk-in \xb7 ${e.partySize}`:`${e.name} \xb7 ${e.partySize}`;function H({use:e,value:t,onPick:s,big:o,best:a,dense:i,bestSet:n,picked:r}){const d=Object.keys(e),[u,b]=(0,c.useState)(0),h=i?6:8,f=i?64:o?92:76,y=u?Math.max(3,Math.floor((u+h)/(f+h))):0,k=y?Math.floor((u-h*(y-1))/y):f,x=new Set(n??[]),j=a?(0,v.tablesOf)(a)[0]:null;return(0,F.jsx)(m.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:h},testID:"table-picker",onLayout:e=>b(Math.floor(e.nativeEvent.layout.width)),children:d.map(o=>{const a=e[o],n=t===o||!!r?.includes(o),d=x.has(o),u=j===o&&!n,c=a.busy?['Blocked','Needs clearing','Closed'].includes(a.label)?a.label:'In use':a.soon??'Free';return(0,F.jsxs)(p.default,{accessibilityRole:"button",testID:`pick-table-${o}`,accessibilityLabel:`Table ${(0,l.tableNumbers)(o)}${r?n?', picked':', not picked':''}, ${a.busy?`in use (${a.label})`:a.soon?`free, ${a.soon}`:'free'}${d?', best table':''}${u?', suggested for this party':''}`,accessibilityState:{selected:n,disabled:'Closed'===a.label},disabled:'Closed'===a.label,onPress:()=>s(o),style:{width:k,minHeight:i?58:64,borderRadius:12,borderWidth:n||u?2.5:1.5,paddingVertical:i?3:6,paddingHorizontal:4,alignItems:'center',justifyContent:'center',gap:2,borderColor:n||u?S.colours.gold:a.busy?S.colours.red:S.colours.ok,backgroundColor:n?S.colours.goldTint:a.busy?S.colours.redBg:S.colours.surface2,opacity:'Closed'!==a.label||n?1:.55},children:[(0,F.jsxs)(m.default,{style:{flexDirection:'row',alignItems:'center',gap:4},children:[(0,F.jsx)(C.T,{weight:"bold",size:22,colour:n?S.colours.goldLight:S.colours.text,children:(0,l.tableNumbers)(o)}),d?(0,F.jsx)(m.default,{testID:"best-table",style:{backgroundColor:S.colours.gold,borderRadius:5,paddingHorizontal:4,paddingVertical:1},children:(0,F.jsx)(C.T,{size:11,weight:"bold",colour:S.colours.onGold,children:"BEST"})}):null]}),(0,F.jsx)(C.T,{size:i?13:14,colour:a.busy?'#FFD9D4':a.soon?'#FFE2A8':'#E2C489',center:!0,numberOfLines:1,children:c})]},o)})})}const U=[1,2,3,4,5,6,7,8];function q({onClose:e,onSeated:a,wide:i,initialTable:n}){const{rid:r,r:d,now:u}=(0,y.useCtx)(15e3),x=E(r,u),[T,I]=(0,c.useState)(2),[$,P]=(0,c.useState)(!1),[O,B]=(0,c.useState)(n??null),z=(0,v.usePlan)(r),N=(0,k.useBookings)(r),A=(0,D.useBlocks)(e=>e.blocks),R=(0,D.closedAreasAt)(A,r,(0,w.ymd)(u),(0,w.hm)(u)),_=b.default.useMemo(()=>{const e=Object.fromEntries(Object.entries(x).map(([e,t])=>[e,{status:t.busy?'seated':'free'}]));return(0,j.suggestTable)(z,N.filter(e=>e.date===(0,w.ymd)(u)),e,T,u,(0,j.turnFor)(T,d.settings.turnMins),90,void 0,{closed:R})?.table??null},[z,N,x,T,R.size,u.getTime()]);(0,c.useEffect)(()=>{O&&(0,v.tablesOf)(O).some(e=>'Closed'===x[e]?.label)&&B(null)},[O,R.size]);const[q,V]=(0,c.useState)(!1),[Y,G]=(0,c.useState)(''),K=(e,t=String(e),s=()=>{P(!1),I(e)})=>{const o='9+'===t?$:!$&&T===e;return(0,F.jsx)(p.default,{accessibilityRole:"button",accessibilityLabel:'9+'===t?'Party of 9 or more':`Party of ${e}`,accessibilityState:{selected:o},onPress:s,style:{width:i?58:60,height:i?58:56,borderRadius:14,borderWidth:2,borderColor:S.colours.gold,alignItems:'center',justifyContent:'center',backgroundColor:o?S.colours.gold:'transparent'},children:(0,F.jsx)(C.T,{weight:"bold",size:22,colour:o?S.colours.onGold:S.colours.gold,children:t})},t)},Q=(0,F.jsx)(s.PartySizeInput,{value:T,onChange:I,min:9,max:o.MAX_PARTY,label:"Walk-in party size",testID:"walkin-party-size"}),X=(0,F.jsxs)(m.default,{style:{gap:8,width:i?256:void 0},children:[(0,F.jsx)(C.T,{weight:"semibold",children:"How many people?"}),(0,F.jsxs)(m.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:8},testID:"walkin-party",children:[U.map(e=>K(e)),K(9,'9+',()=>{P(!0),I(e=>e>=9?e:9)})]}),$?Q:null]}),[J,Z]=(0,c.useState)(!1),ee=async(t=O)=>{if(!J&&(0,M.guardBookingChange)(L)){Z(!0);try{const s=await k.repo.bookings.seatWalkIn(r,T,t??void 0,Y);W(r,t??void 0),a(s),e()}finally{Z(!1)}}},te=(0,F.jsxs)(m.default,{style:{gap:8,flex:i?1:void 0,minWidth:0},children:[(0,F.jsxs)(C.Row,{style:{justifyContent:'space-between'},children:[(0,F.jsxs)(C.T,{weight:"semibold",children:["Table ",(0,F.jsx)(C.T,{colour:S.colours.muted,size:14,children:"(optional)"})]}),O?(0,F.jsx)(C.Button,{small:!0,kind:"ghost",label:"Clear table",onPress:()=>B(null)}):null]}),(0,F.jsx)(H,{use:x,value:O,onPick:e=>{x[e]&&!x[e].busy?ee(e):B(O===e?null:e)},big:i,dense:i,best:_,bestSet:(0,h.bestTables)(z)}),(0,F.jsxs)(C.Muted,{children:["Tap a free table to seat them there",_&&!O?` (suggested for ${T}: ${(0,l.tableNumbers)(_)})`:'',", or Seat for no table yet. BEST marks the venue\u2019s best tables."]})]});return(0,F.jsxs)(C.Sheet,{visible:!0,onClose:e,title:`Walk-in \xb7 ${(0,w.hm)(u)}`,maxWidth:i?1100:void 0,testID:"walkin-sheet",children:[(0,F.jsx)(C.Button,{label:`Seat walk-in \xb7 ${T} ${1===T?'person':'people'}${O?` \xb7 ${(0,l.tableNumbers)(O)}`:''}`,disabled:J,onPress:()=>{ee()},testID:"seat-walkin",style:{minHeight:52}}),i?(0,F.jsxs)(C.Row,{gap:16,style:{alignItems:'flex-start'},children:[X,te]}):(0,F.jsxs)(F.Fragment,{children:[X,te]}),(0,F.jsxs)(C.Row,{gap:10,wrap:!0,style:{alignItems:'center'},children:[q?(0,F.jsx)(t.TextInput,{accessibilityLabel:"Walk-in note",placeholder:"Note (optional), e.g. high chair",placeholderTextColor:"#7D776C",value:Y,onChangeText:G,style:[C.styles.input,{flex:1,minWidth:220}],autoFocus:!0}):(0,F.jsx)(C.Button,{small:!0,kind:"ghost",label:"Add a note (optional)",onPress:()=>V(!0)}),(0,F.jsx)(m.default,{style:{flex:1,minWidth:220},children:(0,F.jsxs)(C.Muted,{children:["No name needed. Counts in today's covers.",'staff'!==f.APP_VARIANT?' Using website bookings too? Mark the table there as well.':'']})})]})]})}function V({booking:e,onClose:t,combine:s}){const{rid:o,r:a,now:i}=(0,y.useCtx)(15e3),n=E(o,i),r=(0,v.usePlan)(o),d=(0,k.useBookings)(o),u=(0,v.tablesOf)(e.table),p=b.default.useMemo(()=>Object.fromEntries(Object.entries(n).map(([e,t])=>[e,u.includes(e)?{busy:!1,label:'This party',soon:'This party'}:t])),[n,e.table]),f=b.default.useMemo(()=>{const t=Object.fromEntries(Object.entries(p).map(([e,t])=>[e,{status:t.busy?'seated':'free'}]));return(0,j.suggestTable)(r,d.filter(e=>e.date===(0,w.ymd)(i)),t,e.partySize,i,(0,j.turnFor)(e.partySize,a.settings.turnMins),90,e.id)?.table??null},[r,d,p,e.partySize,i.getTime()]),[x,T]=(0,c.useState)(!!s||u.length>1),[D,I]=(0,c.useState)(u),$=e=>r.tables.find(t=>t.name===e)?.maxSeats??0,P=D.reduce((e,t)=>e+$(t),0),O=D.length>0&&P{if(!(0,M.guardBookingChange)(L))return;const l=(0,v.joinTables)(s);await k.repo.bookings.assignTable(e.id,l);u.filter(e=>!s.includes(e)).forEach(t=>v.useFloor.getState().setLive(o,t,{stage:void 0,dirty:'seated'===e.status})),'seated'===e.status&&W(o,l),t()},z=x?(0,F.jsxs)(m.default,{style:{gap:8},testID:"assign-table-tip",children:[(0,F.jsx)(m.default,{accessibilityLiveRegion:"polite",children:(0,F.jsx)(C.T,{size:17,weight:"semibold",colour:S.colours.text,children:D.length?`${(0,v.tablesLabel)((0,v.joinTables)(D))} \xb7 ${P} seats for ${e.partySize} Covers`:'No tables picked yet'})}),O?(0,F.jsx)(m.default,{testID:"combine-short",children:(0,F.jsxs)(C.T,{size:15,weight:"semibold",colour:"#FFD9D4",children:["Not enough seats yet: ",e.partySize-P," more needed. Add another table."]})}):null,(0,F.jsx)(C.T,{size:15,colour:S.colours.text,children:"Tap each table to add or remove it, then tap Done. All of them show as taken until the party has finished."}),(0,F.jsxs)(C.Row,{gap:8,wrap:!0,children:[(0,F.jsx)(C.Button,{label:"Done",testID:"combine-done",disabled:!D.length,accessibilityLabel:D.length?`Done, save ${(0,v.tableCardLabel)((0,v.joinTables)(D))}`:'Done',onPress:()=>B(D)}),(0,F.jsx)(C.Button,{kind:"ghost",label:"Cancel",onPress:t})]})]}):(0,F.jsx)(m.default,{style:{gap:8},testID:"assign-table-tip",children:(0,F.jsx)(C.T,{size:15,colour:S.colours.text,children:"Red tables are in use right now; you can still pick one (e.g. joining a table). BEST marks the venue\u2019s best tables. Big party? Tap Combine tables."})});return(0,F.jsxs)(C.Sheet,{visible:!0,onClose:t,title:`${x?'Combine tables':'Assign table'} \xb7 ${_(e)}`,testID:"assign-table-sheet",footer:z,children:[f&&!x?(0,F.jsx)(m.default,{testID:"assign-suggested",children:(0,F.jsxs)(C.T,{size:16,weight:"semibold",colour:S.colours.goldLight,accessibilityLabel:`Suggested for ${e.partySize}: ${(0,v.tableCardLabel)(f)}`,children:["Suggested for ",e.partySize,": ",(0,l.tableNumbers)(f)]})}):null,x?null:(0,F.jsx)(C.Button,{kind:"secondary",label:"Combine tables",testID:"combine-start",accessibilityLabel:"Combine tables: pick several tables for this party",onPress:()=>T(!0)}),(0,F.jsx)(H,{use:p,best:x?null:f,bestSet:(0,h.bestTables)(r),picked:x?D:void 0,onPick:x?e=>I(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]):async e=>{await B([e])}})]})}function Y(e){(0,u.notify)({id:`walkin:${e.id}`,testID:'walkin-toast',timeoutMs:6e3,title:`${_(e)} seated \xb7 ${e.table?`${(0,l.tableNumbers)(e.table)}`:'table to assign'} (${e.ref})`,actions:[{label:'Undo',testID:'undo-walkin',onPress:()=>k.repo.bookings.undoWalkIn(e.id)},{label:'OK',kind:'ghost'}]})}function G({date:e,onClose:t,wide:s,onSaved:u}){const{rid:b,r:h,now:p,role:f,meId:N}=(0,y.useCtx)(6e4);(0,d.useBlurOutside)();const A=(0,w.ymd)(p),[R,W]=(0,c.useState)(ee.blocks),[H,U]=(0,c.useState)(!1),[q,V]=(0,c.useState)(''),[Y,G]=(0,c.useState)(2),[K,Q]=(0,c.useState)(0),X=Math.min(K,Math.max(0,Y-1)),[J,Z]=(0,c.useState)(null),[ee,te]=(0,c.useState)(''),[se,oe]=(0,c.useState)(''),[le,ae]=(0,c.useState)(''),[ie,ne]=(0,c.useState)('phone'),[re,de]=(0,c.useState)((0,$.emptyNeeds)()),ue=(0,$.needsMissing)(re),[ce,be]=(0,c.useState)(null),ge=(0,v.usePlan)(b),he=(0,B.dogSetUp)(ge),pe=!0===re.dog&&he,me=re.dog?re.dogs:0,fe=(0,w.parseYmd)(R),ye=(0,j.turnFor)(Y,h.settings.turnMins),ke=E.filter(e=>e.date===R),xe=e=>(0,j.freeTablesAt)(ge,ke,Y,new Date(`${R}${(0,l.tableNumbers)(e)}:00`),ye,h.settings.turnMins,{dog:!0,closed:(0,D.closedAreasAt)(_,b,R,e)}),je=pe&&J?xe(J):[];(0,c.useEffect)(()=>{be(null)},[pe,J,Y]);const we=(0,x.bookingSlots)(h,fe,e=>E.filter(t=>t.date===R&&t.time===e&&'cancelled'!==t.status&&!t.walkIn).reduce((e,t)=>e+t.partySize,0),Y,R===(0,w.ymd)(p)?p:(0,w.addMins)(fe,0),e=>E.filter(t=>t.date===R&&t.time===e&&'cancelled'!==t.status&&!t.walkIn).length),Se=(0,T.guestPhone)(se),[Te,Ce]=(0,c.useState)(!1),ve=J?we.find(e=>e.time===J):void 0,De=ve&&ve.left=2&&!!J&&(!$e||Te)&&(0,o.validParty)(Y)&&Se.ok&&(0,T.emailOk)(le)&&(!Pe||Oe&&H)&&(!pe||je.length>0)&&!Be,Me=re.wheelchair>0||re.stepFree;return(0,F.jsxs)(C.Sheet,{visible:!0,onClose:t,title:`New booking \xb7 ${(0,w.niceDate)(fe)}`,maxWidth:s?760:void 0,testID:"booking-sheet",children:[(0,F.jsx)($.FirstQuestions,{rid:b,value:re,onChange:de,party:Y,audience:"staff"}),re.dog&&!he?(0,F.jsx)(C.T,{size:13,colour:S.colours.amber,children:"Dog-friendly tables aren\u2019t marked yet. Managers \u203a Booking options \u203a Tables. Booking is allowed; check where the dog can sit."}):null,(0,F.jsx)(I.BookingDatePicker,{r:h,today:p,value:R,onChange:e=>{e!==R&&(W(e),Z(null),U(!1))}}),(0,F.jsxs)(C.Row,{gap:6,children:[(0,F.jsx)(C.Chip,{label:"Phone",selected:'phone'===ie,onPress:()=>ne('phone')}),(0,F.jsx)(C.Chip,{label:"In person",selected:'in-person'===ie,onPress:()=>ne('in-person')})]}),(0,F.jsx)(C.Field,{label:"Name",value:q,onChangeText:V,placeholder:"e.g. Reid",testID:"nb-name"}),(0,F.jsx)(C.Field,{label:"Mobile or phone number (needed)",value:se,onChangeText:oe,keyboardType:"phone-pad",placeholder:"e.g. 07700 900123",testID:"nb-phone"}),!Se.ok&&se?(0,F.jsx)(C.T,{size:13,colour:S.colours.amber,children:Se.error}):null,(0,F.jsx)(C.Field,{label:"Email (optional)",value:le,onChangeText:ae,keyboardType:"email-address",autoCapitalize:"none",placeholder:"For an email confirmation too",testID:"nb-email"}),(0,T.emailOk)(le)?null:(0,F.jsx)(C.T,{size:13,colour:S.colours.amber,children:"That email doesn\u2019t look quite right."}),(0,F.jsx)(n.AdultsChildren,{value:(0,r.peopleOf)(Y,X),onChange:e=>{G(e.partySize),Q(e.children),Ce(!1)},depositsOn:(0,i.depositOf)(h.settings).on&&(0,i.depositOf)(h.settings).perPersonPence>0,testID:"nb-people"}),(0,F.jsx)(C.Row,{wrap:!0,gap:6,children:we.map(e=>{const t=pe&&e.available&&!xe(e.time).length||!(0,$.dogTimeOk)(h,E,R,e.time,me);return(0,F.jsx)(C.Chip,{testID:`nb-slot-${e.time}`,label:e.time,sub:(0,D.blockAt)(_,b,R,e.time)?'Paused':t?'Dogs full':e.drinksOnly?'Drinks only':null!=e.partiesLeft&&e.partiesLeft<1||e.left<=0?'Full':`${e.left} left`,disabled:(e.past??!e.available)||t,selected:J===e.time,onPress:()=>{Z(e.time),U(!1),Ce(!1)}},e.time)})}),$e?(0,F.jsxs)(m.default,{testID:"nb-over-capacity",accessible:!0,accessibilityLiveRegion:"polite",style:{borderWidth:1.5,borderColor:S.colours.amber,backgroundColor:S.colours.amberBg,borderRadius:12,padding:10,gap:6},children:[De?(0,F.jsx)(C.T,{weight:"semibold",colour:S.colours.amber,children:(0,o.overCapacityNote)(Y,De.left,De.time)}):null,Ie?(0,F.jsx)(C.T,{weight:"semibold",colour:S.colours.amber,children:(0,o.overPartiesNote)(Ie.time,Ie.cap)}):null,(0,F.jsx)(C.Chip,{label:Te?'Booking over the limit: on':'Book anyway (over the limit)',selected:Te,onPress:()=>Ce(e=>!e),testID:"nb-over-ok"})]}):null,pe&&J?(0,F.jsxs)(m.default,{style:{gap:6},testID:"nb-dog-tables",children:[(0,F.jsxs)(C.T,{size:14,weight:"semibold",children:["Dog-friendly table ",(0,F.jsxs)(C.T,{size:13,colour:S.colours.muted,children:["(",ge.areas.filter(e=>e.dogs).map(e=>e.name).join(' or '),")"]})]}),je.length?(0,F.jsx)(C.Row,{wrap:!0,gap:6,children:je.slice(0,10).map((e,t)=>(0,F.jsx)(C.Chip,{label:`${(0,l.tableNumbers)(e.table)}`,sub:`${e.area} \xb7 ${e.seats}${0===t?' \xb7 best':''}${Me&&(0,B.accessibleSetUp)(ge)&&!(0,B.isAccessible)(ge,e.table)?' \xb7 not step-free':''}`,selected:(ce??je[0].table)===e.table,onPress:()=>be(e.table)},e.table))}):(0,F.jsxs)(C.T,{size:14,colour:S.colours.amber,children:["No dog-friendly table free for ",Y," at ",J,". Try another time."]})]}):null,Pe?(0,F.jsxs)(m.default,{testID:"nb-block-warning",style:{borderWidth:1.5,borderColor:S.colours.amber,backgroundColor:S.colours.amberBg,borderRadius:12,padding:10,gap:6},children:[(0,F.jsxs)(C.T,{weight:"semibold",colour:S.colours.amber,children:["Bookings are paused ",Pe.from,"\u2013",Pe.to,Pe.reason?` (${Pe.reason})`:'']}),Oe?(0,F.jsx)(C.Chip,{label:H?'Manager override on':'Override and book anyway',selected:H,onPress:()=>U(e=>!e)}):(0,F.jsx)(C.Muted,{children:"Ask a manager to override, or pick another time."})]}):null,we.length?null:(0,F.jsx)(m.default,{testID:"nb-closed",children:(0,F.jsxs)(C.T,{size:14,weight:"semibold",colour:S.colours.amber,children:["Closed on ",(0,w.niceDate)(fe)," (per the venue\u2019s opening hours). Pick another date."]})}),(0,F.jsx)($.MoreQuestions,{rid:b,r:h,value:re,onChange:de,party:Y,date:R,time:J,today:(0,w.ymd)(p),bookings:E,audience:"staff",showTables:!1!==h.settings.tableRequests}),Me&&!(0,B.accessibleSetUp)(ge)?(0,F.jsx)(C.T,{size:13,colour:S.colours.amber,children:"Step-free tables aren\u2019t marked yet (Managers \u203a Booking options \u203a Tables). Check the table works for a wheelchair."}):null,(0,F.jsx)(C.Field,{label:"Notes (optional)",value:ee,onChangeText:te,placeholder:P.NOTES_PLACEHOLDER,multiline:!0,numberOfLines:3,testID:"nb-notes"}),(0,i.depositDue)((0,i.depositOf)(h.settings),Y,X)?(0,F.jsxs)(C.Muted,{testID:"nb-deposit",children:["Deposit due: ",(0,a.gbp)((0,i.depositDue)((0,i.depositOf)(h.settings),Y,X))," (",(0,a.gbp)((0,i.depositOf)(h.settings).perPersonPence)," per adult for ",(0,i.depositOf)(h.settings).fromParty,"+",X?`; ${X} ${1===X?'child':'children'} free`:'; children free',"). Deposits are paid through website bookings or to you, never in CoverCharge: tick Deposit paid on the booking once the guest has paid."]}):null,(0,F.jsxs)(C.Muted,{children:["The guest gets a confirmation text",le.trim()?' and email':''," automatically (preview mode: shown in the Outbox, not sent)."]}),Be?(0,F.jsxs)(C.T,{size:14,colour:S.colours.amber,children:["We already have the most dogs we can look after at ",J,". Try another time: dogs are very welcome then."]}):null,(0,F.jsx)(C.Button,{label:ue.length?ue[0]:'Save booking',testID:"nb-save",disabled:!ze,onPress:()=>{if(R<(0,w.ymd)(p))return;if(!(0,M.guardBookingChange)(L))return;const e=(0,$.needsPatch)(re),s=re.tableReq.find(e=>!pe||je.some(t=>t.table===e)),o=pe?null:(0,z.requestedFreeTable)(re.tableReq,{date:R,time:J,partySize:Y},ge.tables.map(e=>e.name),ke,h.settings.turnMins);k.repo.bookings.create({restaurantId:b,customerId:null,name:q.trim(),partySize:Y,date:R,time:J,notes:ee.trim(),security:(0,i.depositDue)((0,i.depositOf)(h.settings),Y,X)?'deposit':'none',depositPaid:0,...X?{children:X}:{},...(0,i.depositDue)((0,i.depositOf)(h.settings),Y,X)?{depositDue:(0,i.depositDue)((0,i.depositOf)(h.settings),Y,X),depositPolicy:(0,i.depositWords)((0,i.depositOf)(h.settings),Y,h.name,X).join(' '),depositRefundable:(0,i.depositOf)(h.settings).refundable,depositCutoffHours:(0,i.depositOf)(h.settings).cutoffHours}:{},phone:Se.pretty,email:le.trim()||void 0,source:ie,...e,...we.find(e=>e.time===J)?.drinksOnly?{drinksOnly:!0}:{},allergies:e.allergies??[],...pe?{table:ce??s??je[0]?.table}:o?{table:o}:{}}).then(e=>(0,O.postNewBookingToKitchen)(e,N)).catch(()=>{}),u?.({date:R,time:J,name:q.trim()}),t()}})]})}},1094,[812,1095,1096,843,851,841,1097,1098,1099,1100,17,842,385,85,856,1055,858,1101,1074,863,804,848,777,996,993,1102,1103,1108,1076,1053,1092,1091,1109,8]); +__d(function(g,_r,_i,_a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"TABLES",{enumerable:!0,get:function(){return A}}),_e.useTableNames=R,_e.resetTableLive=W,_e.seatBookingNow=async function(e,t){await k.repo.bookings.setStatus(t.id,'seated'),W(e,t.table)},_e.finishBookingNow=async function(e,t){const s=(new Date).toISOString();await k.repo.bookings.update(t.id,(0,N.finishClearPatch)(s,t.table)),(0,v.tablesOf)(t.table).forEach(t=>v.useFloor.getState().setLive(e,t,{stage:void 0,dirty:!0}))},_e.useTableUse=E,Object.defineProperty(_e,"walkInLabel",{enumerable:!0,get:function(){return _}}),_e.TablePicker=H,_e.WalkInSheet=q,_e.AssignTableSheet=V,_e.undoNotice=Y,_e.NewBookingSheet=G,_e.useFrontDoor=function(e,t){const[s,o]=(0,c.useState)(!1),[l,a]=(0,c.useState)(!1),[i,n]=(0,c.useState)(null);return{openWalkIn:()=>o({}),openWalkInAt:e=>o({table:e}),openBooking:()=>a(!0),assignTable:e=>n({b:e}),combineTables:e=>n({b:e,combine:!0}),elements:(0,F.jsxs)(F.Fragment,{children:[s?(0,F.jsx)(q,{wide:t,initialTable:s.table,onClose:()=>o(!1),onSeated:Y}):null,l?(0,F.jsx)(G,{wide:t,date:e,onClose:()=>a(!1),onSaved:e=>(0,u.notify)({id:`booked:${Date.now()}`,testID:'booking-saved-toast',timeoutMs:5e3,icon:'\u2713',title:`Booked: ${e.name} \xb7 ${(0,w.niceDate)((0,w.parseYmd)(e.date))} at ${e.time}`})}):null,i?(0,F.jsx)(V,{booking:i.b,combine:i.combine,onClose:()=>n(null)}):null]})}};var t=_r(_d[0]),s=_r(_d[1]),o=_r(_d[2]),l=_r(_d[3]),a=_r(_d[4]),i=_r(_d[5]),n=_r(_d[6]),r=_r(_d[7]),d=_r(_d[8]),u=_r(_d[9]),c=_r(_d[10]),b=e(c),h=_r(_d[11]),p=e(_r(_d[12])),m=e(_r(_d[13])),f=_r(_d[14]),y=_r(_d[15]),k=_r(_d[16]),x=_r(_d[17]),j=_r(_d[18]),w=_r(_d[19]),S=_r(_d[20]),T=_r(_d[21]),C=_r(_d[22]),v=_r(_d[23]),D=_r(_d[24]),I=_r(_d[25]),$=_r(_d[26]),P=_r(_d[27]),O=_r(_d[28]),B=_r(_d[29]),z=_r(_d[30]),M=_r(_d[31]),N=_r(_d[32]),F=_r(_d[33]);const L=e=>(0,u.notify)({id:'booking-blocked',testID:'booking-blocked-toast',timeoutMs:9e3,icon:'\u26a0',title:e}),A=Array.from({length:12},(e,t)=>String(t+1));function R(e){const t=(0,v.usePlan)(e);return t.areas.flatMap(e=>t.tables.filter(t=>t.areaId===e.id).map(e=>e.name))}function W(e,t){(0,v.tablesOf)(t).forEach(t=>v.useFloor.getState().setLive(e,t,{stage:'seated',dirty:!1}))}function E(e,t){const s=(0,k.useBookings)(e),o=(0,k.useOrders)(e),l=R(e),a=(0,v.useFloor)(t=>t.live[e])??{},i=(0,v.usePlan)(e),n=(0,D.useBlocks)(e=>e.blocks),r=(0,w.ymd)(t),d=(0,D.closedAreasAt)(n,e,r,(0,w.hm)(t)),u={};for(const e of l)u[e]=a[e]?.blocked||d.has(`tbl:${e}`)?{busy:!0,label:'Blocked'}:d.has(i.tables.find(t=>t.name===e)?.areaId??'')?{busy:!0,label:'Closed'}:a[e]?.dirty?{busy:!0,label:'Needs clearing'}:{busy:!1,label:'Free'};for(const e of s)if(e.date===r&&e.table)for(const s of(0,v.tablesOf)(e.table))if(u[s])if('seated'===e.status)u[s]={busy:!0,label:`${e.walkIn?'Walk-in':`${e.name.slice(0,1)}.`} \xb7 ${e.partySize}`};else if('confirmed'===e.status&&!u[s].busy){const o=(0,w.minsBetween)(t,new Date(`${e.date}T${e.time}:00`));o>=-15&&o<=90&&(u[s]={...u[s],soon:`Booked ${e.time}`})}for(const e of o)'table'===e.type&&e.tableNo&&u[e.tableNo]&&!['closed','cancelled','collected'].includes(e.status)&&!u[e.tableNo].busy&&(u[e.tableNo]={busy:!0,label:'Open order'});return u}const _=e=>e.walkIn?`Walk-in \xb7 ${e.partySize}`:`${e.name} \xb7 ${e.partySize}`;function H({use:e,value:t,onPick:s,big:o,best:a,dense:i,bestSet:n,picked:r}){const d=Object.keys(e),[u,b]=(0,c.useState)(0),h=i?6:8,f=i?64:o?92:76,y=u?Math.max(3,Math.floor((u+h)/(f+h))):0,k=y?Math.floor((u-h*(y-1))/y):f,x=new Set(n??[]),j=a?(0,v.tablesOf)(a)[0]:null;return(0,F.jsx)(m.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:h},testID:"table-picker",onLayout:e=>b(Math.floor(e.nativeEvent.layout.width)),children:d.map(o=>{const a=e[o],n=t===o||!!r?.includes(o),d=x.has(o),u=j===o&&!n,c=a.busy?['Blocked','Needs clearing','Closed'].includes(a.label)?a.label:'In use':a.soon??'Free';return(0,F.jsxs)(p.default,{accessibilityRole:"button",testID:`pick-table-${o}`,accessibilityLabel:`Table ${(0,l.tableNumbers)(o)}${r?n?', picked':', not picked':''}, ${a.busy?`in use (${a.label})`:a.soon?`free, ${a.soon}`:'free'}${d?', best table':''}${u?', suggested for this party':''}`,accessibilityState:{selected:n,disabled:'Closed'===a.label},disabled:'Closed'===a.label,onPress:()=>s(o),style:{width:k,minHeight:i?58:64,borderRadius:12,borderWidth:n||u?2.5:1.5,paddingVertical:i?3:6,paddingHorizontal:4,alignItems:'center',justifyContent:'center',gap:2,borderColor:n||u?S.colours.gold:a.busy?S.colours.red:S.colours.ok,backgroundColor:n?S.colours.goldTint:a.busy?S.colours.redBg:S.colours.surface2,opacity:'Closed'!==a.label||n?1:.55},children:[(0,F.jsxs)(m.default,{style:{flexDirection:'row',alignItems:'center',gap:4},children:[(0,F.jsx)(C.T,{weight:"bold",size:22,colour:n?S.colours.goldLight:S.colours.text,children:(0,l.tableNumbers)(o)}),d?(0,F.jsx)(m.default,{testID:"best-table",style:{backgroundColor:S.colours.gold,borderRadius:5,paddingHorizontal:4,paddingVertical:1},children:(0,F.jsx)(C.T,{size:11,weight:"bold",colour:S.colours.onGold,children:"BEST"})}):null]}),(0,F.jsx)(C.T,{size:i?13:14,colour:a.busy?'#FFD9D4':a.soon?'#FFE2A8':'#E2C489',center:!0,numberOfLines:1,children:c})]},o)})})}const U=[1,2,3,4,5,6,7,8];function q({onClose:e,onSeated:a,wide:i,initialTable:n}){const{rid:r,r:d,now:u}=(0,y.useCtx)(15e3),x=E(r,u),[T,I]=(0,c.useState)(2),[$,P]=(0,c.useState)(!1),[O,B]=(0,c.useState)(n??null),z=(0,v.usePlan)(r),N=(0,k.useBookings)(r),A=(0,D.useBlocks)(e=>e.blocks),R=(0,D.closedAreasAt)(A,r,(0,w.ymd)(u),(0,w.hm)(u)),_=b.default.useMemo(()=>{const e=Object.fromEntries(Object.entries(x).map(([e,t])=>[e,{status:t.busy?'seated':'free'}]));return(0,j.suggestTable)(z,N.filter(e=>e.date===(0,w.ymd)(u)),e,T,u,(0,j.turnFor)(T,d.settings.turnMins),90,void 0,{closed:R})?.table??null},[z,N,x,T,R.size,u.getTime()]);(0,c.useEffect)(()=>{O&&(0,v.tablesOf)(O).some(e=>'Closed'===x[e]?.label)&&B(null)},[O,R.size]);const[q,V]=(0,c.useState)(!1),[Y,G]=(0,c.useState)(''),K=(e,t=String(e),s=()=>{P(!1),I(e)})=>{const o='9+'===t?$:!$&&T===e;return(0,F.jsx)(p.default,{accessibilityRole:"button",accessibilityLabel:'9+'===t?'Party of 9 or more':`Party of ${e}`,accessibilityState:{selected:o},onPress:s,style:{width:i?58:60,height:i?58:56,borderRadius:14,borderWidth:2,borderColor:S.colours.gold,alignItems:'center',justifyContent:'center',backgroundColor:o?S.colours.gold:'transparent'},children:(0,F.jsx)(C.T,{weight:"bold",size:22,colour:o?S.colours.onGold:S.colours.gold,children:t})},t)},Q=(0,F.jsx)(s.PartySizeInput,{value:T,onChange:I,min:9,max:o.MAX_PARTY,label:"Walk-in party size",testID:"walkin-party-size"}),X=(0,F.jsxs)(m.default,{style:{gap:8,width:i?256:void 0},children:[(0,F.jsx)(C.T,{weight:"semibold",children:"How many people?"}),(0,F.jsxs)(m.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:8},testID:"walkin-party",children:[U.map(e=>K(e)),K(9,'9+',()=>{P(!0),I(e=>e>=9?e:9)})]}),$?Q:null]}),[J,Z]=(0,c.useState)(!1),ee=async(t=O)=>{if(!J&&(0,M.guardBookingChange)(L)){Z(!0);try{const s=await k.repo.bookings.seatWalkIn(r,T,t??void 0,Y);W(r,t??void 0),a(s),e()}finally{Z(!1)}}},te=(0,F.jsxs)(m.default,{style:{gap:8,flex:i?1:void 0,minWidth:0},children:[(0,F.jsxs)(C.Row,{style:{justifyContent:'space-between'},children:[(0,F.jsxs)(C.T,{weight:"semibold",children:["Table ",(0,F.jsx)(C.T,{colour:S.colours.muted,size:14,children:"(optional)"})]}),O?(0,F.jsx)(C.Button,{small:!0,kind:"ghost",label:"Clear table",onPress:()=>B(null)}):null]}),(0,F.jsx)(H,{use:x,value:O,onPick:e=>{x[e]&&!x[e].busy?ee(e):B(O===e?null:e)},big:i,dense:i,best:_,bestSet:(0,h.bestTables)(z)}),(0,F.jsxs)(C.Muted,{children:["Tap a free table to seat them there",_&&!O?` (suggested for ${T}: ${(0,l.tableNumbers)(_)})`:'',", or Seat for no table yet. BEST marks the venue\u2019s best tables."]})]});return(0,F.jsxs)(C.Sheet,{visible:!0,onClose:e,title:`Walk-in \xb7 ${(0,w.hm)(u)}`,maxWidth:i?1100:void 0,testID:"walkin-sheet",children:[(0,F.jsx)(C.Button,{label:`Seat walk-in \xb7 ${T} ${1===T?'person':'people'}${O?` \xb7 ${(0,l.tableNumbers)(O)}`:''}`,disabled:J,onPress:()=>{ee()},testID:"seat-walkin",style:{minHeight:52}}),i?(0,F.jsxs)(C.Row,{gap:16,style:{alignItems:'flex-start'},children:[X,te]}):(0,F.jsxs)(F.Fragment,{children:[X,te]}),(0,F.jsxs)(C.Row,{gap:10,wrap:!0,style:{alignItems:'center'},children:[q?(0,F.jsx)(t.TextInput,{accessibilityLabel:"Walk-in note",placeholder:"Note (optional), e.g. high chair",placeholderTextColor:"#7D776C",value:Y,onChangeText:G,style:[C.styles.input,{flex:1,minWidth:220}],autoFocus:!0}):(0,F.jsx)(C.Button,{small:!0,kind:"ghost",label:"Add a note (optional)",onPress:()=>V(!0)}),(0,F.jsx)(m.default,{style:{flex:1,minWidth:220},children:(0,F.jsxs)(C.Muted,{children:["No name needed. Counts in today's covers.",'staff'!==f.APP_VARIANT?' Using website bookings too? Mark the table there as well.':'']})})]})]})}function V({booking:e,onClose:t,combine:s}){const{rid:o,r:a,now:i}=(0,y.useCtx)(15e3),n=E(o,i),r=(0,v.usePlan)(o),d=(0,k.useBookings)(o),u=(0,v.tablesOf)(e.table),p=b.default.useMemo(()=>Object.fromEntries(Object.entries(n).map(([e,t])=>[e,u.includes(e)?{busy:!1,label:'This party',soon:'This party'}:t])),[n,e.table]),f=b.default.useMemo(()=>{const t=Object.fromEntries(Object.entries(p).map(([e,t])=>[e,{status:t.busy?'seated':'free'}]));return(0,j.suggestTable)(r,d.filter(e=>e.date===(0,w.ymd)(i)),t,e.partySize,i,(0,j.turnFor)(e.partySize,a.settings.turnMins),90,e.id)?.table??null},[r,d,p,e.partySize,i.getTime()]),[x,T]=(0,c.useState)(!!s||u.length>1),[D,I]=(0,c.useState)(u),$=e=>r.tables.find(t=>t.name===e)?.maxSeats??0,P=D.reduce((e,t)=>e+$(t),0),O=D.length>0&&P{if(!(0,M.guardBookingChange)(L))return;const l=(0,v.joinTables)(s);await k.repo.bookings.assignTable(e.id,l);u.filter(e=>!s.includes(e)).forEach(t=>v.useFloor.getState().setLive(o,t,{stage:void 0,dirty:'seated'===e.status})),'seated'===e.status&&W(o,l),t()},z=x?(0,F.jsxs)(m.default,{style:{gap:8},testID:"assign-table-tip",children:[(0,F.jsx)(m.default,{accessibilityLiveRegion:"polite",children:(0,F.jsx)(C.T,{size:17,weight:"semibold",colour:S.colours.text,children:D.length?`${(0,v.tablesLabel)((0,v.joinTables)(D))} \xb7 ${P} seats for ${e.partySize} Covers`:'No tables picked yet'})}),O?(0,F.jsx)(m.default,{testID:"combine-short",children:(0,F.jsxs)(C.T,{size:15,weight:"semibold",colour:"#FFD9D4",children:["Not enough seats yet: ",e.partySize-P," more needed. Add another table."]})}):null,(0,F.jsx)(C.T,{size:15,colour:S.colours.text,children:"Tap each table to add or remove it, then tap Done. All of them show as taken until the party has finished."}),(0,F.jsxs)(C.Row,{gap:8,wrap:!0,children:[(0,F.jsx)(C.Button,{label:"Done",testID:"combine-done",disabled:!D.length,accessibilityLabel:D.length?`Done, save ${(0,v.tableCardLabel)((0,v.joinTables)(D))}`:'Done',onPress:()=>B(D)}),(0,F.jsx)(C.Button,{kind:"ghost",label:"Cancel",onPress:t})]})]}):(0,F.jsx)(m.default,{style:{gap:8},testID:"assign-table-tip",children:(0,F.jsx)(C.T,{size:15,colour:S.colours.text,children:"Red tables are in use right now; you can still pick one (e.g. joining a table). BEST marks the venue\u2019s best tables. Big party? Tap Combine tables."})});return(0,F.jsxs)(C.Sheet,{visible:!0,onClose:t,title:`${x?'Combine tables':'Assign table'} \xb7 ${_(e)}`,testID:"assign-table-sheet",footer:z,children:[f&&!x?(0,F.jsx)(m.default,{testID:"assign-suggested",children:(0,F.jsxs)(C.T,{size:16,weight:"semibold",colour:S.colours.goldLight,accessibilityLabel:`Suggested for ${e.partySize}: ${(0,v.tableCardLabel)(f)}`,children:["Suggested for ",e.partySize,": ",(0,l.tableNumbers)(f)]})}):null,x?null:(0,F.jsx)(C.Button,{kind:"secondary",label:"Combine tables",testID:"combine-start",accessibilityLabel:"Combine tables: pick several tables for this party",onPress:()=>T(!0)}),(0,F.jsx)(H,{use:p,best:x?null:f,bestSet:(0,h.bestTables)(r),picked:x?D:void 0,onPick:x?e=>I(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]):async e=>{await B([e])}})]})}function Y(e){(0,u.notify)({id:`walkin:${e.id}`,testID:'walkin-toast',timeoutMs:6e3,title:`${_(e)} seated \xb7 ${e.table?`${(0,l.tableNumbers)(e.table)}`:'table to assign'} (${e.ref})`,actions:[{label:'Undo',testID:'undo-walkin',onPress:()=>k.repo.bookings.undoWalkIn(e.id)},{label:'OK',kind:'ghost'}]})}function G({date:e,onClose:t,wide:s,onSaved:u}){const{rid:b,r:h,now:p,role:f,meId:N}=(0,y.useCtx)(6e4);(0,d.useBlurOutside)();const A=(0,w.ymd)(p),[R,W]=(0,c.useState)(ee.blocks),[H,U]=(0,c.useState)(!1),[q,V]=(0,c.useState)(''),[Y,G]=(0,c.useState)(2),[K,Q]=(0,c.useState)(0),X=Math.min(K,Math.max(0,Y-1)),[J,Z]=(0,c.useState)(null),[ee,te]=(0,c.useState)(''),[se,oe]=(0,c.useState)(''),[le,ae]=(0,c.useState)(''),[ie,ne]=(0,c.useState)('phone'),[re,de]=(0,c.useState)((0,$.emptyNeeds)()),ue=(0,$.needsMissing)(re),[ce,be]=(0,c.useState)(null),ge=(0,v.usePlan)(b),he=(0,B.dogSetUp)(ge),pe=!0===re.dog&&he,me=re.dog?re.dogs:0,fe=(0,w.parseYmd)(R),ye=(0,j.turnFor)(Y,h.settings.turnMins),ke=E.filter(e=>e.date===R),xe=e=>(0,j.freeTablesAt)(ge,ke,Y,new Date(`${R}${(0,l.tableNumbers)(e)}:00`),ye,h.settings.turnMins,{dog:!0,closed:(0,D.closedAreasAt)(_,b,R,e)}),je=pe&&J?xe(J):[];(0,c.useEffect)(()=>{be(null)},[pe,J,Y]);const we=(0,x.bookingSlots)(h,fe,e=>E.filter(t=>t.date===R&&t.time===e&&'cancelled'!==t.status&&!t.walkIn).reduce((e,t)=>e+t.partySize,0),Y,R===(0,w.ymd)(p)?p:(0,w.addMins)(fe,0),e=>E.filter(t=>t.date===R&&t.time===e&&'cancelled'!==t.status&&!t.walkIn).length),Se=(0,T.guestPhone)(se),[Te,Ce]=(0,c.useState)(!1),ve=J?we.find(e=>e.time===J):void 0,De=ve&&ve.left=2&&!!J&&(!$e||Te)&&(0,o.validParty)(Y)&&Se.ok&&(0,T.emailOk)(le)&&(!Pe||Oe&&H)&&(!pe||je.length>0)&&!Be,Me=re.wheelchair>0||re.stepFree;return(0,F.jsxs)(C.Sheet,{visible:!0,onClose:t,title:`New booking \xb7 ${(0,w.niceDate)(fe)}`,maxWidth:s?760:void 0,testID:"booking-sheet",children:[(0,F.jsx)($.FirstQuestions,{rid:b,value:re,onChange:de,party:Y,audience:"staff"}),re.dog&&!he?(0,F.jsx)(C.T,{size:13,colour:S.colours.amber,children:"Dog-friendly tables aren\u2019t marked yet. Managers \u203a Booking options \u203a Tables. Booking is allowed; check where the dog can sit."}):null,(0,F.jsx)(I.BookingDatePicker,{r:h,today:p,value:R,onChange:e=>{e!==R&&(W(e),Z(null),U(!1))}}),(0,F.jsxs)(C.Row,{gap:6,children:[(0,F.jsx)(C.Chip,{label:"Phone",selected:'phone'===ie,onPress:()=>ne('phone')}),(0,F.jsx)(C.Chip,{label:"In person",selected:'in-person'===ie,onPress:()=>ne('in-person')})]}),(0,F.jsx)(C.Field,{label:"Name",value:q,onChangeText:V,placeholder:"e.g. Reid",testID:"nb-name"}),(0,F.jsx)(C.Field,{label:"Mobile or phone number (needed)",value:se,onChangeText:oe,keyboardType:"phone-pad",placeholder:"e.g. 07700 900123",testID:"nb-phone"}),!Se.ok&&se?(0,F.jsx)(C.T,{size:13,colour:S.colours.amber,children:Se.error}):null,(0,F.jsx)(C.Field,{label:"Email (optional)",value:le,onChangeText:ae,keyboardType:"email-address",autoCapitalize:"none",placeholder:"For an email confirmation too",testID:"nb-email"}),(0,T.emailOk)(le)?null:(0,F.jsx)(C.T,{size:13,colour:S.colours.amber,children:"That email doesn\u2019t look quite right."}),(0,F.jsx)(n.AdultsChildren,{value:(0,r.peopleOf)(Y,X),onChange:e=>{G(e.partySize),Q(e.children),Ce(!1)},depositsOn:(0,i.depositOf)(h.settings).on&&(0,i.depositOf)(h.settings).perPersonPence>0,testID:"nb-people"}),(0,F.jsx)(C.Row,{wrap:!0,gap:6,children:we.map(e=>{const t=pe&&e.available&&!xe(e.time).length||!(0,$.dogTimeOk)(h,E,R,e.time,me);return(0,F.jsx)(C.Chip,{testID:`nb-slot-${e.time}`,label:e.time,sub:(0,D.blockAt)(_,b,R,e.time)?'Paused':t?'Dogs full':e.drinksOnly?'Drinks only':null!=e.partiesLeft&&e.partiesLeft<1||e.left<=0?'Full':`${e.left} left`,disabled:(e.past??!e.available)||t,selected:J===e.time,onPress:()=>{Z(e.time),U(!1),Ce(!1)}},e.time)})}),$e?(0,F.jsxs)(m.default,{testID:"nb-over-capacity",accessible:!0,accessibilityLiveRegion:"polite",style:{borderWidth:1.5,borderColor:S.colours.amber,backgroundColor:S.colours.amberBg,borderRadius:12,padding:10,gap:6},children:[De?(0,F.jsx)(C.T,{weight:"semibold",colour:S.colours.amber,children:(0,o.overCapacityNote)(Y,De.left,De.time)}):null,Ie?(0,F.jsx)(C.T,{weight:"semibold",colour:S.colours.amber,children:(0,o.overPartiesNote)(Ie.time,Ie.cap)}):null,(0,F.jsx)(C.Chip,{label:Te?'Booking over the limit: on':'Book anyway (over the limit)',selected:Te,onPress:()=>Ce(e=>!e),testID:"nb-over-ok"})]}):null,pe&&J?(0,F.jsxs)(m.default,{style:{gap:6},testID:"nb-dog-tables",children:[(0,F.jsxs)(C.T,{size:14,weight:"semibold",children:["Dog-friendly table ",(0,F.jsxs)(C.T,{size:13,colour:S.colours.muted,children:["(",ge.areas.filter(e=>e.dogs).map(e=>e.name).join(' or '),")"]})]}),je.length?(0,F.jsx)(C.Row,{wrap:!0,gap:6,children:je.slice(0,10).map((e,t)=>(0,F.jsx)(C.Chip,{label:`${(0,l.tableNumbers)(e.table)}`,sub:`${e.area} \xb7 ${e.seats}${0===t?' \xb7 best':''}${Me&&(0,B.accessibleSetUp)(ge)&&!(0,B.isAccessible)(ge,e.table)?' \xb7 not step-free':''}`,selected:(ce??je[0].table)===e.table,onPress:()=>be(e.table)},e.table))}):(0,F.jsxs)(C.T,{size:14,colour:S.colours.amber,children:["No dog-friendly table free for ",Y," at ",J,". Try another time."]})]}):null,Pe?(0,F.jsxs)(m.default,{testID:"nb-block-warning",style:{borderWidth:1.5,borderColor:S.colours.amber,backgroundColor:S.colours.amberBg,borderRadius:12,padding:10,gap:6},children:[(0,F.jsxs)(C.T,{weight:"semibold",colour:S.colours.amber,children:["Bookings are paused ",Pe.from,"\u2013",Pe.to,Pe.reason?` (${Pe.reason})`:'']}),Oe?(0,F.jsx)(C.Chip,{label:H?'Manager override on':'Override and book anyway',selected:H,onPress:()=>U(e=>!e)}):(0,F.jsx)(C.Muted,{children:"Ask a manager to override, or pick another time."})]}):null,we.length?null:(0,F.jsx)(m.default,{testID:"nb-closed",children:(0,F.jsxs)(C.T,{size:14,weight:"semibold",colour:S.colours.amber,children:["Closed on ",(0,w.niceDate)(fe)," (per the venue\u2019s opening hours). Pick another date."]})}),(0,F.jsx)($.MoreQuestions,{rid:b,r:h,value:re,onChange:de,party:Y,date:R,time:J,today:(0,w.ymd)(p),bookings:E,audience:"staff",showTables:!1!==h.settings.tableRequests}),Me&&!(0,B.accessibleSetUp)(ge)?(0,F.jsx)(C.T,{size:13,colour:S.colours.amber,children:"Step-free tables aren\u2019t marked yet (Managers \u203a Booking options \u203a Tables). Check the table works for a wheelchair."}):null,(0,F.jsx)(C.Field,{label:"Notes (optional)",value:ee,onChangeText:te,placeholder:P.NOTES_PLACEHOLDER,multiline:!0,numberOfLines:3,testID:"nb-notes"}),(0,i.depositDue)((0,i.depositOf)(h.settings),Y,X)?(0,F.jsxs)(C.Muted,{testID:"nb-deposit",children:["Deposit due: ",(0,a.gbp)((0,i.depositDue)((0,i.depositOf)(h.settings),Y,X))," (",(0,a.gbp)((0,i.depositOf)(h.settings).perPersonPence)," per adult for tables of ",(0,i.depositOf)(h.settings).fromParty,"+ adults",X?`; ${X} ${1===X?'child':'children'} free`:'; children free, and they do not count towards the number that needs a deposit',"). Staff can waive it. Deposits are paid through website bookings or to you, never in CoverCharge: tick Deposit paid on the booking once the guest has paid."]}):null,(0,F.jsxs)(C.Muted,{children:["The guest gets a confirmation text",le.trim()?' and email':''," automatically (preview mode: shown in the Outbox, not sent)."]}),Be?(0,F.jsxs)(C.T,{size:14,colour:S.colours.amber,children:["We already have the most dogs we can look after at ",J,". Try another time: dogs are very welcome then."]}):null,(0,F.jsx)(C.Button,{label:ue.length?ue[0]:'Save booking',testID:"nb-save",disabled:!ze,onPress:()=>{if(R<(0,w.ymd)(p))return;if(!(0,M.guardBookingChange)(L))return;const e=(0,$.needsPatch)(re),s=re.tableReq.find(e=>!pe||je.some(t=>t.table===e)),o=pe?null:(0,z.requestedFreeTable)(re.tableReq,{date:R,time:J,partySize:Y},ge.tables.map(e=>e.name),ke,h.settings.turnMins);k.repo.bookings.create({restaurantId:b,customerId:null,name:q.trim(),partySize:Y,date:R,time:J,notes:ee.trim(),security:(0,i.depositDue)((0,i.depositOf)(h.settings),Y,X)?'deposit':'none',depositPaid:0,...X?{children:X}:{},...(0,i.depositDue)((0,i.depositOf)(h.settings),Y,X)?{depositDue:(0,i.depositDue)((0,i.depositOf)(h.settings),Y,X),depositPolicy:(0,i.depositWords)((0,i.depositOf)(h.settings),Y,h.name,X).join(' '),depositRefundable:(0,i.depositOf)(h.settings).refundable,depositCutoffHours:(0,i.depositOf)(h.settings).cutoffHours}:{},phone:Se.pretty,email:le.trim()||void 0,source:ie,...e,...we.find(e=>e.time===J)?.drinksOnly?{drinksOnly:!0}:{},allergies:e.allergies??[],...pe?{table:ce??s??je[0]?.table}:o?{table:o}:{}}).then(e=>(0,O.postNewBookingToKitchen)(e,N)).catch(()=>{}),u?.({date:R,time:J,name:q.trim()}),t()}})]})}},1094,[812,1095,1096,843,851,841,1097,1098,1099,1100,17,842,385,85,856,1055,858,1101,1074,863,804,848,777,996,993,1102,1103,1108,1076,1053,1092,1091,1109,8]); __d(function(g,r,i,a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.PartySizeInput=function({value:e,onChange:p,min:b=s.MIN_PARTY,max:y=s.MAX_PARTY,label:f="Party size",testID:h="party-size"}){const[x,S]=(0,t.useState)(String(e));(0,t.useEffect)(()=>{S(String(e))},[e]);const T=e=>p((0,s.clampParty)(e,b,y)),$=(t,n,l)=>{const s=t<0?e<=b:e>=y;return(0,d.jsx)(o.default,{testID:`${h}-${t>0?'up':'down'}${10===Math.abs(t)?'10':''}`,accessibilityRole:"button",accessibilityLabel:l,accessibilityState:{disabled:s},disabled:s,onPress:()=>T(e+t),hitSlop:4,style:{minWidth:44,height:44,paddingHorizontal:8,borderRadius:22,borderWidth:1.5,borderColor:u.colours.gold,alignItems:'center',justifyContent:'center',opacity:s?.4:1},children:(0,d.jsx)(c.T,{size:10===Math.abs(t)?14:20,weight:"semibold",colour:u.colours.gold,center:!0,children:n})},t)};return(0,d.jsxs)(l.default,{testID:h,style:{flexDirection:'row',alignItems:'center',gap:6,flexWrap:'wrap',justifyContent:'center'},children:[y-b>=20?$(-10,'\u221210',"10 fewer people"):null,$(-1,'\u2212','One fewer person'),(0,d.jsx)(n.default,{testID:`${h}-input`,value:x,keyboardType:"number-pad",inputMode:"numeric",maxLength:3,selectTextOnFocus:!0,accessibilityLabel:`${f}, ${b} to ${y} people`,accessibilityValue:{min:b,max:y,now:e,text:`${e} ${1===e?'person':'people'}`},onChangeText:e=>{S(e.replace(/\D/g,'')),e.replace(/\D/g,'')&&T((0,s.partyFromText)(e,b,y))},onBlur:()=>{const e=(0,s.partyFromText)(x,b,y);S(String(e)),T(e)},returnKeyType:"done",blurOnSubmit:!0,onSubmitEditing:e=>{e?.target?.blur?.()},style:{width:64,height:44,borderRadius:10,borderWidth:1,borderColor:u.colours.border,color:u.colours.text,backgroundColor:u.colours.surface,textAlign:'center',fontSize:20,fontFamily:u.fonts.semibold}}),$(1,'+','One more person'),y-b>=20?$(10,'+10',"10 more people"):null]})};var t=r(_d[0]),o=e(r(_d[1])),n=e(r(_d[2])),l=e(r(_d[3])),s=r(_d[4]),u=r(_d[5]),c=r(_d[6]),d=r(_d[7])},1095,[17,385,395,85,1096,804,777,8]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"MAX_PARTY",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"MIN_PARTY",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"PARTY_RULE",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"validParty",{enumerable:!0,get:function(){return u}}),Object.defineProperty(e,"partyFromText",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"clampParty",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"overCapacityNote",{enumerable:!0,get:function(){return f}}),Object.defineProperty(e,"overPartiesNote",{enumerable:!0,get:function(){return b}});const t=100,n=1,o=`Bookings are for ${n} to ${t} people.`,u=o=>'number'==typeof o&&Number.isInteger(o)&&o>=n&&o<=t,c=(o,u=n,c=t)=>{const s=parseInt(String(o??'').replace(/\D/g,'').slice(0,4),10);return Math.max(u,Math.min(c,Number.isFinite(s)?s:u))},s=(o,u=n,c=t)=>Math.max(u,Math.min(c,Math.round(Number(o)||u))),f=(t,n,o)=>n<=0?`${o} is already full for booked Covers. Booking ${t} more goes over the venue\u2019s limit: check tables and staffing.`:`${t} is more than the ${n} Covers left at ${o}. Booking goes over the venue\u2019s limit by ${t-n}: check tables and staffing.`,b=(t,n)=>`${t} already has the most bookings we take at one start time (${n}). Booking another goes over the venue\u2019s limit: check tables and staffing.`},1096,[]); __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.AdultsChildren=function({value:e,onChange:t,depositsOn:h,testID:x="people"}){const p=e=>t((0,s.storedPeople)(e)),b=(0,s.totalLine)(e);return(0,o.jsxs)(l.default,{testID:x,style:{gap:8,alignItems:'center',width:'100%'},children:[(0,o.jsx)(u.T,{size:18,center:!0,weight:"semibold",children:"Adults"}),(0,o.jsx)(n.PartySizeInput,{value:e.adults,min:1,max:(0,s.maxAdults)(e.children),onChange:t=>p({adults:t,children:e.children}),label:"Adults",testID:`${x}-adults`}),(0,o.jsx)(u.T,{size:18,center:!0,weight:"semibold",children:"Children"}),(0,o.jsx)(n.PartySizeInput,{value:e.children,min:0,max:(0,s.maxKids)(e.adults),onChange:t=>p({adults:e.adults,children:t}),label:"Children",testID:`${x}-children`}),(0,o.jsx)(u.T,{size:18,center:!0,weight:"semibold",colour:c.colours.goldLight,testID:`${x}-total`,accessibilityLabel:b,children:b}),h?(0,o.jsx)(u.Muted,{center:!0,children:"Children never pay a deposit."}):null]})},r(d[0]);var e,t=r(d[1]),l=(e=t)&&e.__esModule?e:{default:e},s=r(d[2]),n=r(d[3]),u=r(d[4]),c=r(d[5]),o=r(d[6])},1097,[17,85,1098,1095,777,804,8]); @@ -1318,9 +1318,9 @@ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{v __d(function(g,_r,i,_a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"useChefAssistant",{enumerable:!0,get:function(){return I}}),Object.defineProperty(_e,"CHEF_PROMPTS",{enumerable:!0,get:function(){return P}}),_e.ChefAssistantButton=function({compact:e}){return e?(0,S.jsx)(u.default,{testID:"chef-assistant-open",accessibilityRole:"button",accessibilityLabel:"Assistant",onPress:()=>I.getState().setOpen(!0),style:{borderRadius:12,backgroundColor:w.colours.accentBg,borderWidth:1,borderColor:w.colours.accentBorder,paddingVertical:6,paddingHorizontal:12,minHeight:36,justifyContent:'center'},children:(0,S.jsx)(m.T,{weight:"semibold",colour:w.colours.goldLight,size:13,children:"\u2726 Assistant"})}):(0,S.jsx)(d.ActionTile,{primary:!0,testID:"chef-assistant-open",icon:"sparkle",label:"Assistant",sub:"Recipe card, order, allergens, GP, temps",accessibilityLabel:"Assistant",onPress:()=>I.getState().setOpen(!0)})},_e.ChefAssistantSheet=function({go:e}){const l=I(e=>e.open),d=()=>I.getState().setOpen(!1),{rid:f,me:W,menu:L,k:B,c:F}=(0,$.useChef)(3e4),G=(0,T.useSuggestions)(),E=(0,r.useSafetyView)('chef').points,[M,H]=(0,o.useState)([]),[N,_]=(0,o.useState)(''),[V,K]=(0,o.useState)(!1),[Y,q]=(0,o.useState)(!1),Q=(0,o.useRef)(null),U=(0,o.useRef)(null);if((0,o.useEffect)(()=>{setTimeout(()=>Q.current?.scrollToEnd?.({animated:!0}),50)},[M.length]),!l)return null;const J=(e,t=!1)=>H(n=>[...n,{id:R(),from:'bot',text:e,demo:t}]),X=e=>H(t=>[...t,{id:R(),from:'bot',plan:e,state:'open'}]),Z=L.filter(e=>!e.name.includes('(example)')||!0),ee=(t,n)=>{const r=A(t);if(!(0,s.chefCanSee)(f,t))return void J('That check is managed in the Managers app.');if(/\b(send|email|text|pay|delete|remove|order now|place the order)\b/.test(r)&&!/\b(build|draft|make|prepare)\b/.test(r))return void J('I can\u2019t send, pay for or delete anything. I can prepare it for you to check and do yourself, for example \u201cbuild the fish order\u201d.');const o=(0,y.parseQuick)(t,E).filter(e=>e.point&&(0,y.isTempKind)(e.point.kind));if(o.length&&(/\b(fridge|freezer|walk ?in|core|probe|cool|hot|deliver|degree|temp)/.test(r)||o.some(e=>null!=e.value))){const t=o.filter(e=>null!=e.value),r=o.filter(e=>null==e.value);if(r.length&&J(`I didn\u2019t hear a temperature for ${r.map(e=>e.point.name).join(', ')}. Say or type the reading, for example \u201c${r[0].point.name} 4 degrees\u201d. I never fill one in.`),!t.length)return;const s=t.filter(e=>!(0,y.inRange)(e.point,e.value));return void X({title:`Log ${1===t.length?'a reading':`${t.length} readings`} in the food safety log`,detail:t.map(e=>`${e.point.name}: ${e.value}\xb0C (${(0,y.limitText)(e.point)})${(0,y.inRange)(e.point,e.value)?'':' \xb7 OUT OF RANGE'}`).join('\n')+`\nSigned ${(0,y.initialsOf)(W)} \xb7 ${n?'voice':'typed'}`,warn:s.length?`${s.map(e=>e.point.name).join(', ')} out of range: you\u2019ll need to add the corrective action in the food safety log.`:void 0,confirm:'Log it',run:()=>{const r=(new Date).toISOString();return v.useSafety.getState().addEntries(t.map(e=>({pointId:e.point.id,name:e.point.name,kind:e.point.kind,at:r,by:W.replace(' (example)',''),byId:$.CHEF_ID,app:'chef',value:e.value,ok:(0,y.inRange)(e.point,e.value),source:n?'voice':'typed',initials:(0,y.initialsOf)(W)}))),s.length&&setTimeout(()=>e('haccp'),600),`Logged ${t.map(e=>`${e.point.name} ${e.value}\xb0C`).join(', ')}.${s.length?' Opening the food safety log for the corrective action.':''}`}})}if(/\b(fridge|freezer|temp|temperature|degrees)\b/.test(r))return void J('Which unit, and what does it read? For example \u201cprep fridge 4 degrees\u201d or \u201cfreezer minus 19\u201d. I only log the number you give me.');if(/allergen|allerg|contain|gluten|nut|dairy|milk|shellfish|crustacean|coeliac/.test(r)){const e=D(t,Z,e=>e.name);if(!e)return void J('Which dish? For example \u201callergens in the fish and chips\u201d.');const n=(0,j.recipeCards)().byMenuItem(e.id),r=e=>b.ALLERGENS.find(t=>t.id===e)?.label??e,s=Object.entries(e.allergens??{}).filter(([,e])=>'contains'===e).map(([e])=>r(e)),a=Object.entries(e.allergens??{}).filter(([,e])=>'may'===e).map(([e])=>r(e));return void J(`${e.name}: ${s.length?`contains ${s.join(', ')}`:'no allergens recorded as \u201ccontains\u201d'}${a.length?`; may contain ${a.join(', ')}`:''}. ${n?n.signOff?`From the signed-off recipe card (${n.signOff.by}).`:'The recipe card is awaiting your sign-off, so check it before telling a guest.':'There\u2019s no recipe card for it yet.'} Always check the card and the ingredients with the guest.`)}if(/\bgp\b|gross profit|margin|price for|what price|cost of|costing/.test(r)){const e=D(t,F,e=>e.item.name),n=Number((t.toLowerCase().match(/(\d{2})\s*(?:%|percent|per cent)/)??[])[1])||B.targetGp;if(!e)return void J(`Which dish? I can cost the dishes that have a recipe in GP & costing (${F.length} do). For example \u201cGP on the haddock\u201d.`);const r=(0,C.priceForTarget)(e.cost,n);return void J(`${e.item.name}: food cost ${(0,x.gbp)(e.cost)}, sells at ${(0,x.gbp)(e.priceInc)} (inc VAT) = ${e.gp.toFixed(1)}% GP. For ${n}% GP it would need ${(0,x.gbp)(r)} inc VAT. Prices are changed by a manager; I haven\u2019t changed anything.`)}if(/\border|supplier|delivery|par\b|restock/.test(r)){const n=D(t,G,e=>`${e.s.name} ${e.s.category??''}`)??(1===G.length?G[0]:void 0);return n?void X({title:`Build an order for ${n.s.name}`,detail:(n.lines.length?n.lines.map(e=>`${e.i.name}: ${(0,a.fishQtyText)(f,e.i,e.qty)}`).join('\n')+`\nAbout ${(0,x.gbp)(n.total)} at the latest prices.`:'Nothing is below par for this supplier yet.')+'\nI\u2019ll open it in Ordering for you to check, change and place yourself. Nothing is sent.',confirm:'Open the order',run:()=>(setTimeout(()=>{d(),e('orders',n.s.id)},400),`Opening the ${n.s.name} order. You check it and place it yourself.`)}):void J(G.length?`Which supplier? ${G.map(e=>e.s.name).join(', ')}.`:'Nothing is below par and no supplier orders today.')}if(/recipe|card|new dish|write up|spec/.test(r)){const n=t.replace(/^.*?(?:recipe card|card|recipe|dish|spec)\s*(?:for|of)?\s*/i,'').replace(/[.?!]+$/,'').trim();if(!n||n.length<3)return void J('What\u2019s the dish called? For example \u201cdraft a recipe card for crab linguine\u201d.');const r=n.replace(/^the\s+/i,'').replace(/^./,e=>e.toUpperCase()).slice(0,60),s=(0,j.recipeCards)().list(f).find(e=>A(e.dish)===A(r));return s?(J(`There\u2019s already a card for ${s.dish}. Opening Recipe cards.`),void setTimeout(()=>{d(),e('recipes')},600)):void X({title:`Draft a recipe card: ${r}`,detail:'A new card, awaiting your sign-off, with the dish name and section filled in. You add the ingredients, method, allergens, photo and price, then sign it off. It isn\u2019t shown to guests until you do.',confirm:'Make the draft',run:async()=>(await(0,j.recipeCards)().create(f,{dish:r,section:'Specials',price:null,ingredients:[],steps:[]},{name:W,role:'head-chef'}),setTimeout(()=>{d(),e('recipes')},500),`Draft card for ${r} saved, awaiting sign-off. Opening Recipe cards.`)})}const l='I can help with: drafting a recipe card, building a supplier order, a dish\u2019s allergens, GP pricing, and logging a temperature you read out. Try one of the suggestions.';(0,k.askServer)('chef',t,[]).then(e=>J('text'===e.kind?e.text:l)).catch(()=>J(l))},te=(e,t=!1)=>{const n=e.trim();if(n){_(''),H(e=>[...e,{id:R(),from:'you',text:n}]);try{ee(n,t)}catch(e){J(`Sorry, that didn\u2019t work: ${e.message}`)}}},ne=async e=>{if(e.plan){H(t=>t.map(t=>t.id===e.id?{...t,state:'done'}:t));try{J(String(await e.plan.run()))}catch(e){J(`Couldn\u2019t do that: ${e.message}`)}}},ie=e=>{H(t=>t.map(t=>t.id===e.id?{...t,state:'cancelled'}:t)),J('Cancelled. Nothing was changed.')},re=()=>{te(N,Y),q(!1)};return(0,S.jsx)(c.default,{visible:!0,transparent:!0,animationType:"fade",onRequestClose:d,children:(0,S.jsx)(p.default,{style:[m.styles.overlay,{justifyContent:'flex-end',padding:0}],children:(0,S.jsxs)(p.default,{testID:"chef-assistant",style:{backgroundColor:w.colours.surface,borderTopLeftRadius:18,borderTopRightRadius:18,borderWidth:1,borderColor:w.colours.border,width:'100%',maxWidth:640,alignSelf:'center',maxHeight:'92%',minHeight:'70%',padding:14,gap:10},children:[(0,S.jsxs)(m.Row,{style:{justifyContent:'space-between'},children:[(0,S.jsx)(m.T,{size:20,weight:"semibold",children:"\u2726 Kitchen Assistant"}),(0,S.jsx)(n.GoldClose,{testID:"chef-assistant-close",onPress:d,style:{marginRight:-6}})]}),(0,S.jsx)(p.default,{testID:"chef-assistant-demo",children:(0,S.jsx)(m.Badge,{kind:"amber",label:O})}),(0,S.jsxs)(h.default,{ref:Q,style:{flex:1},contentContainerStyle:{gap:10,paddingBottom:6},keyboardShouldPersistTaps:"handled",children:[0===M.length?(0,S.jsxs)(p.default,{style:{gap:8},children:[(0,S.jsxs)(m.T,{children:["Hi ",W.split(' ')[0],". Type or tap \ud83c\udfa4 and say what you need. I\u2019ll show you what I\u2019m about to do and wait for you to confirm. I never send, pay or delete."]}),P.map(e=>(0,S.jsx)(u.default,{accessibilityRole:"button",onPress:()=>te(e),style:{borderWidth:1,borderColor:w.colours.border,borderRadius:12,paddingVertical:9,paddingHorizontal:12,backgroundColor:w.colours.surface2},children:(0,S.jsx)(m.T,{size:14,children:e})},e))]}):null,M.map(e=>'you'===e.from?(0,S.jsx)(p.default,{style:{alignSelf:'flex-end',maxWidth:'85%',backgroundColor:'#3A2F12',borderRadius:14,padding:10},children:(0,S.jsx)(m.T,{children:e.text})},e.id):e.plan?(0,S.jsxs)(p.default,{testID:"chef-confirm-card",style:{borderWidth:1.5,borderColor:'open'===e.state?w.colours.gold:w.colours.border,borderRadius:14,padding:12,gap:8,backgroundColor:w.colours.surface2},children:[(0,S.jsx)(m.T,{weight:"semibold",children:e.plan.title}),(0,S.jsx)(m.T,{size:14,colour:w.colours.muted,children:e.plan.detail}),e.plan.warn?(0,S.jsxs)(m.T,{size:13,colour:w.colours.amber,children:["\u26a0 ",e.plan.warn]}):null,'open'===e.state?(0,S.jsxs)(m.Row,{gap:8,children:[(0,S.jsx)(m.Button,{small:!0,testID:"chef-confirm",label:e.plan.confirm,onPress:()=>ne(e)}),(0,S.jsx)(m.Button,{small:!0,kind:"ghost",label:"Cancel",onPress:()=>ie(e)})]}):(0,S.jsx)(m.Badge,{kind:'done'===e.state?'ok':'neutral',label:'done'===e.state?'Confirmed':'Cancelled: nothing done'}),'open'===e.state?(0,S.jsxs)(m.Muted,{children:["Nothing happens until you tap ",e.plan.confirm,"."]}):null]},e.id):(0,S.jsx)(p.default,{testID:"chef-assistant-reply",style:{alignSelf:'flex-start',maxWidth:'92%',backgroundColor:w.colours.surface2,borderRadius:14,padding:10},children:(0,S.jsx)(m.T,{children:e.text})},e.id))]}),(0,S.jsxs)(m.Row,{gap:8,children:[(0,S.jsx)(t.TextInput,{testID:"chef-assistant-input",accessibilityLabel:"Ask the Assistant",placeholder:"Type a kitchen task\u2026",placeholderTextColor:"#7D776C",value:N,onChangeText:e=>{_(e),e||q(!1)},onSubmitEditing:re,returnKeyType:"send",style:[m.styles.input,{flex:1,minWidth:0,width:40}]}),(0,S.jsx)(u.default,{testID:"chef-assistant-mic",accessibilityRole:"button",accessibilityLabel:V?'Stop listening':'Speak',onPress:()=>{const e=z();if(e)if(V)U.current?.stop?.();else try{const t=new e;U.current=t,t.lang='en-GB',t.interimResults=!1,t.maxAlternatives=1,t.onresult=e=>{const t=e.results?.[0]?.[0]?.transcript;t&&(_(t),q(!0))},t.onend=()=>K(!1),t.onerror=()=>{K(!1),J('Sorry, I didn\u2019t catch that. You can type instead.')},K(!0),t.start()}catch{K(!1),J('Voice input isn\u2019t available here. Please type instead.')}else J('Voice input isn\u2019t available in this browser. Please type instead.')},style:{width:48,height:48,borderRadius:24,borderWidth:1.5,borderColor:w.colours.gold,alignItems:'center',justifyContent:'center',backgroundColor:V?w.colours.gold:'transparent'},children:(0,S.jsx)(m.T,{size:20,children:"\ud83c\udfa4"})}),(0,S.jsx)(m.Button,{label:"Send",disabled:!N.trim(),onPress:re})]}),(0,S.jsx)(m.Muted,{center:!0,children:"Every action waits for your Confirm \xb7 nothing is sent, paid or deleted"})]})})})};var t=_r(_d[0]),n=_r(_d[1]),r=_r(_d[2]),s=_r(_d[3]),a=_r(_d[4]),o=_r(_d[5]),l=_r(_d[6]),d=_r(_d[7]),c=e(_r(_d[8]));_r(_d[9]);var u=e(_r(_d[10])),h=e(_r(_d[11])),p=e(_r(_d[12])),f=_r(_d[13]),m=_r(_d[14]),b=_r(_d[15]),y=_r(_d[16]),x=_r(_d[17]),j=_r(_d[18]),v=_r(_d[19]),w=_r(_d[20]),$=_r(_d[21]),C=_r(_d[22]),T=_r(_d[23]),k=_r(_d[24]),S=_r(_d[25]);const I=(0,f.create)(e=>({open:!1,setOpen:t=>e({open:t})})),R=()=>Math.random().toString(36).slice(2,9),P=['Draft a recipe card for crab linguine','Build the fish order','What allergens are in the fish and chips?','What price gives 70% GP on the lobster?','Walk-in fridge 3.5 degrees'],O='The secure AI server: not set up yet',A=e=>e.toLowerCase().replace(/[^a-z0-9 ]/g,' ').replace(/\s+/g,' ').trim(),W=new Set(['the','and','with','for','our','house','served','side','of','in','on','from']);function D(e,t,n){const r=` ${A(e)} `;let s,a=0;for(const e of t){const t=A(n(e).replace(/\(example\)/i,'')).split(' ').filter(e=>e.length>2&&!W.has(e)),o=t.filter(e=>r.includes(` ${e} `)||r.includes(` ${e}s `)).length,l=t.length?o/t.length+.01*o:0;o&&l>a&&(s=e,a=l)}return s}function z(){return'undefined'==typeof window?null:(0,l.speechRecognizer)()}},1235,[812,779,1207,820,943,17,890,1183,378,219,385,278,85,831,777,845,1002,851,867,1001,804,1140,1135,1163,891,8]); __d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"BOTTOM_TABS_HEIGHT",{enumerable:!0,get:function(){return h}}),_e.BottomTabs=function({tabs:e,active:b,onPress:y,background:x,tablist:p}){const{width:j}=(0,s.default)(),v=j/Math.max(1,e.length),w=v>=60?11:10,I=v<56?20:22,[F,S]=(0,t.useState)({}),[H,_]=(0,t.useState)(0),M=H>0&&e.some(e=>(F[e.id]??0)>H-6),z={flexDirection:'row',flexWrap:'nowrap',alignItems:'stretch',borderTopWidth:1,borderColor:c.colours.border,backgroundColor:x};return(0,f.jsx)(l.default,{testID:"app-bottom-tabs",accessibilityRole:p?'tablist':void 0,style:z,children:e.map(t=>{const s=b===t.id,x=s?c.colours.gold:c.colours.muted;return(0,f.jsxs)(n.default,{onLayout:t===e[0]?e=>_(e.nativeEvent.layout.width):void 0,testID:`tab-${t.id}`,accessibilityRole:"tab",accessibilityState:{selected:s},accessibilityLabel:t.a11y??t.label,onPress:()=>y(t.id),style:{flexGrow:1,flexShrink:1,flexBasis:0,minWidth:44,minHeight:h,alignItems:'center',justifyContent:'center',paddingVertical:4,paddingHorizontal:1,gap:2},children:[(0,f.jsxs)(l.default,{style:{width:I,height:I,alignItems:'center',justifyContent:'center'},children:[(0,f.jsx)(u.Icon,{name:t.icon,size:I,colour:x}),t.badge?(0,f.jsx)(l.default,{testID:t.badge.testID,style:{position:'absolute',right:-10,top:-5,backgroundColor:t.badge.bg,borderRadius:8,minWidth:16,height:16,paddingHorizontal:3,alignItems:'center',justifyContent:'center'},children:(0,f.jsx)(o.default,{style:{fontFamily:c.fonts.bold,fontSize:10,lineHeight:12,color:t.badge.fg??'#FFFFFF'},children:t.badge.text})}):null]}),(0,f.jsx)(l.default,{pointerEvents:"none","aria-hidden":!0,importantForAccessibility:"no-hide-descendants",accessibilityElementsHidden:!0,style:{position:'absolute',left:0,top:0,width:0,height:0,overflow:'hidden',opacity:0},children:(0,f.jsx)(l.default,{style:{width:400,flexDirection:'row',alignItems:'flex-start'},children:(0,f.jsx)(o.default,{onLayout:e=>{const n=Math.ceil(e.nativeEvent.layout.width);S(e=>e[t.id]===n?e:{...e,[t.id]:n})},style:{fontFamily:c.fonts.semibold,fontSize:w,lineHeight:Math.round(1.3*w),flexShrink:0},children:t.short??t.label})})}),M?null:(0,f.jsx)(o.default,{numberOfLines:1,style:{fontFamily:s?c.fonts.semibold:c.fonts.regular,fontSize:w,lineHeight:Math.round(1.3*w),color:x,textAlign:'center',alignSelf:'center',maxWidth:'100%'},children:t.short??t.label})]},t.id)})})};var t=r(d[0]),n=e(r(d[1])),o=e(r(d[2])),l=e(r(d[3])),s=e(r(d[4])),c=r(d[5]),u=r(d[6]),f=r(d[7]);const h=56},1236,[17,385,329,85,409,804,1184,8]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return f}});var t=r(d[0]);r(d[1]);var n=r(d[2]),u=r(d[3]),c=r(d[4]);function f(){return(0,u.canShow)('chef')?(0,c.jsx)(n.ChefApp,{}):(0,c.jsx)(t.Redirect,{href:u.ENTRY[u.APP_VARIANT]})}},1237,[13,17,775,856,8]); -__d(function(g,_r,_i,_a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return A}});var e,t=_r(d[0]),o=_r(d[1]),n=_r(d[2]),s=_r(d[3]),l=_r(d[4]),i=_r(d[5]),a=_r(d[6]),r=_r(d[7]),u=(e=r)&&e.__esModule?e:{default:e},c=_r(d[8]),h=_r(d[9]),p=_r(d[10]),b=_r(d[11]),f=_r(d[12]),y=_r(d[13]),x=_r(d[14]),k=_r(d[15]),j=_r(d[16]),v=_r(d[17]),S=_r(d[18]),w=_r(d[19]),T=_r(d[20]),C=_r(d[21]),D=_r(d[22]),$=_r(d[23]),P=_r(d[24]),M=_r(d[25]),B=_r(d[26]),O=_r(d[27]);function A(){const{rid:e,date:r}=(0,s.useLocalSearchParams)(),A=(0,j.useRestaurant)(e),N=(0,j.useCustomer)(),z=(0,j.useBookings)(e),I=(0,j.useEvents)(e),R=(0,j.useNow)(6e4),[q]=(0,l.useState)(()=>(0,a.startForm)()),[F,L]=(0,l.useState)(''),[E,H]=(0,l.useState)(2),[W,_]=(0,l.useState)(0),Y=Math.min(W,Math.max(0,E-1)),[U,G]=(0,l.useState)(r??(0,k.ymd)(R)),[Q,V]=(0,l.useState)(null),[J,K]=(0,l.useState)(N.name),[X,Z]=(0,l.useState)(N.phone??''),[ee,te]=(0,l.useState)(N.email??''),[oe,ne]=(0,l.useState)(!1),[se,le]=(0,l.useState)(''),[ie,ae]=(0,l.useState)(!1),[re,de]=(0,l.useState)([]),[ue,ce]=(0,l.useState)(!1),he=[...N.allergies,...re.filter(e=>!N.allergies.some(t=>t.allergen===e)).map(e=>({allergen:e,severity:'allergy'}))],[me,ge]=(0,l.useState)(null),pe=(0,C.useBlocks)(e=>e.blocks);(0,v.usePublicDayStore)(e=>e.n);const be=e?(0,v.publicDay)(e,U):null,fe=be?[...be.bookings,...z.filter(e=>e.date!==U)]:z,ye=be?[...pe.filter(t=>t.rid!==e||t.date!==U),...be.blocks]:pe,xe=(0,D.usePlan)(e),[ke,je]=(0,l.useState)((0,P.emptyNeeds)()),ve=!0===ke.dog,Se=ve?ke.dogs:0;if(!A)return(0,O.jsx)(b.Screen,{title:"Not found",children:(0,O.jsx)(b.T,{children:"Restaurant not found."})});const we=A.settings,Te=(0,k.parseYmd)(U),Ce=(0,x.onlinePartyBounds)(A),De=(0,C.blocksOn)(ye,A.id,U),$e=fe.filter(e=>e.date===U),Pe=xe.areas.filter(e=>e.dogs),Me=(0,M.dogSetUp)(xe),Be=e=>(0,$.freeTablesAt)(xe,$e,E,new Date(`${U}${(0,t.tableNumbers)(e)}:00`),(0,$.turnFor)(E,we.turnMins),we.turnMins,{dog:!0,closed:(0,C.closedAreasAt)(ye,A.id,U,e)}),Oe=(0,x.bookingSlots)(A,Te,e=>fe.filter(t=>t.date===U&&t.time===e&&!['cancelled','noshow'].includes(t.status)).reduce((e,t)=>e+t.partySize,0),E,R,e=>fe.filter(t=>t.date===U&&t.time===e&&!['cancelled','noshow'].includes(t.status)).length).map(e=>{const t=(0,C.blockAt)(ye,A.id,U,e.time),o=ve&&Me&&e.available&&!t&&(!Be(e.time).length||!(0,P.dogTimeOk)(A,fe,U,e.time,Se));return{...e,blocked:!!t,noDog:o,available:e.available&&!t&&!o}}),Ae=Oe.some(e=>e.available),Ne=(0,c.depositOf)(we),ze=(0,c.depositDue)(Ne,E,Y),Ie=ze>0?'deposit':'none',Re=(0,c.depositWords)(Ne,E,A.name,Y),qe=I.filter(e=>e.date===U),Fe=(0,T.guestPhone)(X),Le=(0,T.emailOk)(ee),Ee=(0,P.needsMissing)(ke,N.allergies),He=!!Q&&ie&&!Ee.length&&J.trim().length>1&&Fe.ok&&Le,We=async()=>{const e=(0,P.needsPatch)(ke,N.allergies),t=ve&&Me?Be(Q).map(e=>e.table):[],o=ve?ke.tableReq.find(e=>t.includes(e))??t[0]:void 0,n=await j.repo.bookings.create({restaurantId:A.id,customerId:N.id,name:J,partySize:E,...Y?{children:Y}:{},date:U,time:Q,notes:se.trim(),security:Ie,depositPaid:0,...ze?{depositDue:ze,depositPolicy:Re.join(' '),depositRefundable:Ne.refundable,depositCutoffHours:Ne.cutoffHours}:{},phone:Fe.pretty,email:ee.trim()||void 0,source:'online',...e,...Oe.find(e=>e.time===Q)?.drinksOnly?{drinksOnly:!0}:{},allergies:e.allergies??he,...o?{table:o}:{}});(0,a.rememberGuard)(n.id,(0,a.guardFor)({...q,hp:F})),ge(n)},Ye=(0,j.useStore)(e=>me?e.bookings.find(e=>e.id===me.id)?.ref:void 0),Ue=e=>(0,w.waMeLink)(A.settings.whatsapp,(0,w.guestWhatsAppText)({name:e.name,ref:Ye??e.ref,date:e.date,time:e.time,partySize:e.partySize},A.name));if(me){const e='pending'===me.status;return(0,O.jsxs)(b.Screen,{title:e?'Booking request received':'Booking confirmed',subtitle:A.name,children:[(0,O.jsx)(b.Banner,{kind:e?'info':'success',title:`Reference ${Ye??me.ref}`,children:`${me.partySize} people \xb7 ${(0,k.niceDateYear)((0,k.parseYmd)(me.date))} at ${me.time}`}),e?(0,O.jsx)(b.Banner,{kind:"warn",title:"The team will confirm shortly",children:"For larger parties and special requests, a member of the team checks your booking first. Contact the venue if you need an update."}):null,(0,O.jsxs)(b.Card,{children:[(0,O.jsxs)(b.T,{children:["Name: ",me.name]}),(0,O.jsxs)(b.T,{children:["Mobile: ",me.phone]}),me.email?(0,O.jsxs)(b.T,{children:["Email: ",me.email]}):null,(0,O.jsxs)(b.T,{children:["Allergies shared with the restaurant: ",me.allergies.length?me.allergies.map(e=>`${(0,f.allergenLabel)(e.allergen)} (${(0,f.severityLabel)(e.severity)})`).join(', '):'none']}),me.notes?(0,O.jsxs)(b.T,{children:["Notes: ",me.notes]}):null,me.dog?(0,O.jsxs)(b.T,{children:["\ud83d\udc15 Dog coming too",me.table?` \xb7 dog-friendly table ${me.table}`:'']}):null,me.holds?.length?(0,O.jsxs)(b.T,{children:["Reserved: ",me.holds.map(e=>`${e.qty} \xd7 ${'item'===e.kind?(A.settings.reservables??M.ANCHORAGE_RESERVABLES).find(t=>t.id===e.id)?.name??'item':e.id}`).join(', ')," (the kitchen confirms it)"]}):null,me.tableReq?.length?(0,O.jsxs)(b.T,{children:["Table requested: ",me.tableReq.map(e=>`${(0,t.tableNumbers)(e)}`).join(' or ')," (not guaranteed, but we\u2019ll do our best)"]}):null,'deposit'===me.security&&me.depositDue?(0,O.jsxs)(b.T,{weight:"semibold",children:["Deposit due: ",(0,y.gbp)(me.depositDue),". ",A.name," will tell you how to pay it."]}):null,'deposit'===me.security&&me.depositPolicy?(0,O.jsx)(b.Muted,{children:me.depositPolicy}):null,(0,O.jsx)(b.Muted,{children:"Your booking details are shown above. If you need confirmation, contact the venue and quote your reference."}),(0,O.jsxs)(b.Muted,{children:["Need to change or cancel? Call ",A.phone," and quote ",Ye??me.ref,"."]})]}),Ue(me)?(0,O.jsxs)(u.default,{style:{gap:4},children:[(0,O.jsx)(b.Button,{kind:"secondary",label:"\ud83d\udcac Message us on WhatsApp",testID:"guest-whatsapp",onPress:()=>{const e=Ue(me);e&&(0,w.openWhatsApp)(e)}}),(0,O.jsx)(b.Muted,{size:13,children:"Opens WhatsApp with your booking details typed in. You can change the message before you send it."})]}):null,(0,O.jsx)(b.Button,{label:"Back to restaurant",onPress:()=>s.router.replace(`/customer/${A.id}`)})]})}return(0,O.jsxs)(b.Screen,{title:"Book a table",subtitle:A.name,footer:(0,O.jsx)(b.Button,{label:Ee.length?Ee[0]:E>(we.autoAcceptUpTo??7)?'Send booking request':'Confirm booking',disabled:!He,onPress:()=>We(),testID:"confirm-booking"}),children:[(0,O.jsx)(P.FirstQuestions,{rid:A.id,value:ke,onChange:e=>{e.dog===ke.dog&&e.dogs===ke.dogs||V(null),je(e)},party:E,audience:"guest",profile:N.allergies}),(0,O.jsxs)(b.Card,{children:[(0,O.jsxs)(u.default,{style:{gap:6,alignItems:'center'},children:[(0,O.jsx)(b.H2,{children:"Party size"}),(0,O.jsx)(o.PartySizeInput,{value:E,onChange:e=>{H(e),V(null)},min:Ce.min,max:Ce.max,label:"Party size",testID:"party-size"})]}),(0,O.jsx)(h.ChildrenCount,{guest:!0,party:E,value:Y,onChange:_,depositsOn:Ne.on&&Ne.perPersonPence>0,testID:"book-children"}),ze?(0,O.jsx)(b.Banner,{kind:"info",title:Y?`Deposit: ${(0,y.gbp)(ze)} for ${E-Y} adults (children free)`:`Deposit: ${(0,y.gbp)(ze)} for ${E} guests`,children:(0,O.jsx)(u.default,{style:{gap:4},children:Re.map(e=>(0,O.jsx)(b.T,{size:13,children:e},e))})}):Ne.on&&Ne.perPersonPence>0?(0,O.jsxs)(b.Muted,{children:["No deposit for fewer than ",Ne.fromParty," guests."]}):null,E>(we.autoAcceptUpTo??7)?(0,O.jsxs)(b.Muted,{children:["For ",E," people the team checks the booking first, then texts you to confirm."]}):null,ve&&Me?(0,O.jsxs)(b.Muted,{children:["Dogs are welcome in the ",Pe.map(e=>`${e.name}${e.outdoor?' (outdoors, weather permitting)':''}`).join(' and ')||'dog-friendly tables',". We\u2019ll only show times with a dog-friendly table",A.settings.maxDogsPerSlot?' and room for your dog':'',"."]}):null]}),(0,O.jsxs)(b.Card,{children:[(0,O.jsx)(b.H2,{children:"Date"}),(0,O.jsx)(B.CustomerDatePicker,{r:A,today:R,value:U,events:I,onChange:e=>{G(e),V(null)}}),qe.map(e=>(0,O.jsx)(b.Banner,{kind:"demo",title:e.title,children:e.description},e.id))]}),(0,O.jsxs)(b.Card,{children:[(0,O.jsx)(b.H2,{children:"Time"}),0===Oe.length?(0,O.jsx)(b.Muted,{children:"Closed on this day (per listed kitchen hours)."}):(0,O.jsx)(b.Row,{wrap:!0,gap:6,children:Oe.map(e=>(0,O.jsx)(b.Chip,{testID:`book-slot-${e.time}`,label:e.time,sub:e.available?e.drinksOnly?'Drinks only':void 0:e.blocked?'Unavailable':e.noDog?'No dog table':e.leftV(e.time)},e.time))}),De.length>0&&Oe.some(e=>e.blocked)?(0,O.jsx)(b.Banner,{kind:"info",title:Ae?'Some times aren\u2019t available online':'Online booking isn\u2019t available for this time',children:`We\u2019re not taking online bookings ${De.map(e=>`${e.from}\u2013${e.to}`).join(', ')} on ${(0,k.niceDate)(Te)}. Please give us a ring on ${A.phone??"the restaurant"} and we\u2019ll do our best to fit you in.`}):null,(()=>{const e=(0,n.lastFoodOn)(A,U);return e&&Oe.some(e=>e.drinksOnly)?(0,O.jsx)(b.Banner,{kind:"info",title:`Last food orders ${(0,n.fmt12)(e.time)}${'kitchen closes'!==e.reason?` (${e.reason})`:''}`,children:"Times marked \u201cDrinks only\u201d are after the kitchen\u2019s last food orders that day: you\u2019re welcome for drinks, but we can\u2019t serve food."}):null})(),ve&&Oe.some(e=>e.noDog)?(0,O.jsx)(b.Banner,{kind:"info",title:"Some times are full for dogs",children:`Times marked "No dog table" are full in the ${Pe.map(e=>e.name).join(' and ')}${A.settings.maxDogsPerSlot?' or already have the most dogs we can look after':''}${(0,C.closedAreasAt)(ye,A.id,U,Q??'12:00').size?', or the garden is closed for weather':''}. We\u2019d love to see you both, so please try one of the other times shown.`}):null,(0,O.jsx)(b.Muted,{children:(0,x.bookingLimitsHint)(A)})]}),(0,O.jsx)(P.MoreQuestions,{rid:A.id,r:A,value:ke,onChange:je,party:E,date:U,time:Q,today:(0,k.ymd)(R),bookings:fe,audience:"guest",showTables:!0}),(0,O.jsxs)(b.Card,{highlight:ie?void 0:S.colours.amber,children:[(0,O.jsx)(b.Field,{label:"Notes (optional)",value:se,onChangeText:le,placeholder:p.NOTES_PLACEHOLDER,multiline:!0,numberOfLines:3,testID:"book-notes"}),(0,O.jsx)(b.Toggle,{label:"I confirm the allergy information for this booking",value:ie,onChange:ae}),(0,O.jsx)(b.Muted,{children:"Table requests aren\u2019t guaranteed, but we\u2019ll do our best. Nothing here is charged now; reserved dishes are paid on the night."})]}),(0,O.jsxs)(b.Card,{children:[(0,O.jsx)(b.H2,{children:"Your details"}),(0,O.jsx)(b.Field,{label:"Name for the booking",value:J,onChangeText:K}),(0,O.jsx)(b.Field,{testID:"book-phone",label:"Mobile number (needed to book)",value:X,onChangeText:Z,onBlur:()=>ne(!0),keyboardType:"phone-pad",autoComplete:"tel",placeholder:"e.g. 07700 900123"}),Fe.ok||!oe&&!X?null:(0,O.jsx)(b.T,{size:13,colour:S.colours.amber,children:Fe.error}),(0,O.jsx)(b.Field,{testID:"book-email",label:"Email (optional)",value:ee,onChangeText:te,keyboardType:"email-address",autoCapitalize:"none",autoComplete:"email",placeholder:"you@example.com"}),Le?null:(0,O.jsx)(b.T,{size:13,colour:S.colours.amber,children:"That email doesn\u2019t look quite right. Check it, or leave it blank."}),(0,O.jsxs)(b.Muted,{children:["We\u2019ll text you a confirmation",ee.trim()?' and email it too':'',", with how to change or cancel. We only use your number for this booking."]})]}),(0,O.jsx)(i.Honeypot,{value:F,onChange:L})]})}},1238,[843,1095,861,13,17,1239,963,85,841,1240,1108,777,845,851,1101,863,858,946,804,1181,848,993,996,1074,1103,1053,1241,8]); +__d(function(g,_r,_i,_a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return A}});var e,t=_r(d[0]),o=_r(d[1]),n=_r(d[2]),s=_r(d[3]),a=_r(d[4]),l=_r(d[5]),i=_r(d[6]),r=_r(d[7]),u=(e=r)&&e.__esModule?e:{default:e},c=_r(d[8]),h=_r(d[9]),p=_r(d[10]),b=_r(d[11]),f=_r(d[12]),y=_r(d[13]),x=_r(d[14]),k=_r(d[15]),j=_r(d[16]),v=_r(d[17]),w=_r(d[18]),S=_r(d[19]),C=_r(d[20]),T=_r(d[21]),D=_r(d[22]),$=_r(d[23]),P=_r(d[24]),M=_r(d[25]),B=_r(d[26]),O=_r(d[27]);function A(){const{rid:e,date:r}=(0,s.useLocalSearchParams)(),A=(0,j.useRestaurant)(e),N=(0,j.useCustomer)(),z=(0,j.useBookings)(e),I=(0,j.useEvents)(e),R=(0,j.useNow)(6e4),[q]=(0,a.useState)(()=>(0,i.startForm)()),[F,L]=(0,a.useState)(''),[E,H]=(0,a.useState)(2),[W,_]=(0,a.useState)(0),Y=Math.min(W,Math.max(0,E-1)),[U,G]=(0,a.useState)(r??(0,k.ymd)(R)),[Q,V]=(0,a.useState)(null),[J,K]=(0,a.useState)(N.name),[X,Z]=(0,a.useState)(N.phone??''),[ee,te]=(0,a.useState)(N.email??''),[oe,ne]=(0,a.useState)(!1),[se,ae]=(0,a.useState)(''),[le,ie]=(0,a.useState)(!1),[re,de]=(0,a.useState)([]),[ue,ce]=(0,a.useState)(!1),he=[...N.allergies,...re.filter(e=>!N.allergies.some(t=>t.allergen===e)).map(e=>({allergen:e,severity:'allergy'}))],[me,ge]=(0,a.useState)(null),pe=(0,T.useBlocks)(e=>e.blocks);(0,v.usePublicDayStore)(e=>e.n);const be=e?(0,v.publicDay)(e,U):null,fe=be?[...be.bookings,...z.filter(e=>e.date!==U)]:z,ye=be?[...pe.filter(t=>t.rid!==e||t.date!==U),...be.blocks]:pe,xe=(0,D.usePlan)(e),[ke,je]=(0,a.useState)((0,P.emptyNeeds)()),ve=!0===ke.dog,we=ve?ke.dogs:0;if(!A)return(0,O.jsx)(b.Screen,{title:"Not found",children:(0,O.jsx)(b.T,{children:"Restaurant not found."})});const Se=A.settings,Ce=(0,k.parseYmd)(U),Te=(0,x.onlinePartyBounds)(A),De=(0,T.blocksOn)(ye,A.id,U),$e=fe.filter(e=>e.date===U),Pe=xe.areas.filter(e=>e.dogs),Me=(0,M.dogSetUp)(xe),Be=e=>(0,$.freeTablesAt)(xe,$e,E,new Date(`${U}${(0,t.tableNumbers)(e)}:00`),(0,$.turnFor)(E,Se.turnMins),Se.turnMins,{dog:!0,closed:(0,T.closedAreasAt)(ye,A.id,U,e)}),Oe=(0,x.bookingSlots)(A,Ce,e=>fe.filter(t=>t.date===U&&t.time===e&&!['cancelled','noshow'].includes(t.status)).reduce((e,t)=>e+t.partySize,0),E,R,e=>fe.filter(t=>t.date===U&&t.time===e&&!['cancelled','noshow'].includes(t.status)).length).map(e=>{const t=(0,T.blockAt)(ye,A.id,U,e.time),o=ve&&Me&&e.available&&!t&&(!Be(e.time).length||!(0,P.dogTimeOk)(A,fe,U,e.time,we));return{...e,blocked:!!t,noDog:o,available:e.available&&!t&&!o}}),Ae=Oe.some(e=>e.available),Ne=(0,c.depositOf)(Se),ze=(0,c.depositDue)(Ne,E,Y),Ie=ze>0?'deposit':'none',Re=(0,c.depositWords)(Ne,E,A.name,Y),qe=I.filter(e=>e.date===U),Fe=(0,C.guestPhone)(X),Le=(0,C.emailOk)(ee),Ee=(0,P.needsMissing)(ke,N.allergies),He=!!Q&&le&&!Ee.length&&J.trim().length>1&&Fe.ok&&Le,We=async()=>{const e=(0,P.needsPatch)(ke,N.allergies),t=ve&&Me?Be(Q).map(e=>e.table):[],o=ve?ke.tableReq.find(e=>t.includes(e))??t[0]:void 0,n=await j.repo.bookings.create({restaurantId:A.id,customerId:N.id,name:J,partySize:E,...Y?{children:Y}:{},date:U,time:Q,notes:se.trim(),security:Ie,depositPaid:0,...ze?{depositDue:ze,depositPolicy:Re.join(' '),depositRefundable:Ne.refundable,depositCutoffHours:Ne.cutoffHours}:{},phone:Fe.pretty,email:ee.trim()||void 0,source:'online',...e,...Oe.find(e=>e.time===Q)?.drinksOnly?{drinksOnly:!0}:{},allergies:e.allergies??he,...o?{table:o}:{}});(0,i.rememberGuard)(n.id,(0,i.guardFor)({...q,hp:F})),ge(n)},Ye=(0,j.useStore)(e=>me?e.bookings.find(e=>e.id===me.id)?.ref:void 0),Ue=e=>(0,S.waMeLink)(A.settings.whatsapp,(0,S.guestWhatsAppText)({name:e.name,ref:Ye??e.ref,date:e.date,time:e.time,partySize:e.partySize},A.name));if(me){const e='pending'===me.status;return(0,O.jsxs)(b.Screen,{title:e?'Booking request received':'Booking confirmed',subtitle:A.name,children:[(0,O.jsx)(b.Banner,{kind:e?'info':'success',title:`Reference ${Ye??me.ref}`,children:`${me.partySize} people \xb7 ${(0,k.niceDateYear)((0,k.parseYmd)(me.date))} at ${me.time}`}),e?(0,O.jsx)(b.Banner,{kind:"warn",title:"The team will confirm shortly",children:"For larger parties and special requests, a member of the team checks your booking first. Contact the venue if you need an update."}):null,(0,O.jsxs)(b.Card,{children:[(0,O.jsxs)(b.T,{children:["Name: ",me.name]}),(0,O.jsxs)(b.T,{children:["Mobile: ",me.phone]}),me.email?(0,O.jsxs)(b.T,{children:["Email: ",me.email]}):null,(0,O.jsxs)(b.T,{children:["Allergies shared with the restaurant: ",me.allergies.length?me.allergies.map(e=>`${(0,f.allergenLabel)(e.allergen)} (${(0,f.severityLabel)(e.severity)})`).join(', '):'none']}),me.notes?(0,O.jsxs)(b.T,{children:["Notes: ",me.notes]}):null,me.dog?(0,O.jsxs)(b.T,{children:["\ud83d\udc15 Dog coming too",me.table?` \xb7 dog-friendly table ${me.table}`:'']}):null,me.holds?.length?(0,O.jsxs)(b.T,{children:["Reserved: ",me.holds.map(e=>`${e.qty} \xd7 ${'item'===e.kind?(A.settings.reservables??M.ANCHORAGE_RESERVABLES).find(t=>t.id===e.id)?.name??'item':e.id}`).join(', ')," (the kitchen confirms it)"]}):null,me.tableReq?.length?(0,O.jsxs)(b.T,{children:["Table requested: ",me.tableReq.map(e=>`${(0,t.tableNumbers)(e)}`).join(' or ')," (not guaranteed, but we\u2019ll do our best)"]}):null,'deposit'===me.security&&me.depositDue?(0,O.jsxs)(b.T,{weight:"semibold",children:["Deposit due: ",(0,y.gbp)(me.depositDue),". ",A.name," will tell you how to pay it."]}):null,'deposit'===me.security&&me.depositPolicy?(0,O.jsx)(b.Muted,{children:me.depositPolicy}):null,(0,O.jsx)(b.Muted,{children:"Your booking details are shown above. If you need confirmation, contact the venue and quote your reference."}),(0,O.jsxs)(b.Muted,{children:["Need to change or cancel? Call ",A.phone," and quote ",Ye??me.ref,"."]})]}),Ue(me)?(0,O.jsxs)(u.default,{style:{gap:4},children:[(0,O.jsx)(b.Button,{kind:"secondary",label:"\ud83d\udcac Message us on WhatsApp",testID:"guest-whatsapp",onPress:()=>{const e=Ue(me);e&&(0,S.openWhatsApp)(e)}}),(0,O.jsx)(b.Muted,{size:13,children:"Opens WhatsApp with your booking details typed in. You can change the message before you send it."})]}):null,(0,O.jsx)(b.Button,{label:"Back to restaurant",onPress:()=>s.router.replace(`/customer/${A.id}`)})]})}return(0,O.jsxs)(b.Screen,{title:"Book a table",subtitle:A.name,footer:(0,O.jsx)(b.Button,{label:Ee.length?Ee[0]:E>(Se.autoAcceptUpTo??7)?'Send booking request':'Confirm booking',disabled:!He,onPress:()=>We(),testID:"confirm-booking"}),children:[(0,O.jsx)(P.FirstQuestions,{rid:A.id,value:ke,onChange:e=>{e.dog===ke.dog&&e.dogs===ke.dogs||V(null),je(e)},party:E,audience:"guest",profile:N.allergies}),(0,O.jsxs)(b.Card,{children:[(0,O.jsxs)(u.default,{style:{gap:6,alignItems:'center'},children:[(0,O.jsx)(b.H2,{children:"Party size"}),(0,O.jsx)(o.PartySizeInput,{value:E,onChange:e=>{H(e),V(null)},min:Te.min,max:Te.max,label:"Party size",testID:"party-size"})]}),(0,O.jsx)(h.ChildrenCount,{guest:!0,party:E,value:Y,onChange:_,depositsOn:Ne.on&&Ne.perPersonPence>0,testID:"book-children"}),ze?(0,O.jsx)(b.Banner,{kind:"info",title:Y?`Deposit: ${(0,y.gbp)(ze)} for ${E-Y} adults (children don't count towards the ${Ne.fromParty} and don't pay)`:`Deposit: ${(0,y.gbp)(ze)} for ${E} adults`,children:(0,O.jsx)(u.default,{style:{gap:4},children:Re.map(e=>(0,O.jsx)(b.T,{size:13,children:e},e))})}):Ne.on&&Ne.perPersonPence>0?(0,O.jsxs)(b.Muted,{children:["No deposit for fewer than ",Ne.fromParty," adults. Children don't count towards the ",Ne.fromParty," and don't pay, and staff can waive a deposit."]}):null,E>(Se.autoAcceptUpTo??7)?(0,O.jsxs)(b.Muted,{children:["For ",E," people the team checks the booking first, then texts you to confirm."]}):null,ve&&Me?(0,O.jsxs)(b.Muted,{children:["Dogs are welcome in the ",Pe.map(e=>`${e.name}${e.outdoor?' (outdoors, weather permitting)':''}`).join(' and ')||'dog-friendly tables',". We\u2019ll only show times with a dog-friendly table",A.settings.maxDogsPerSlot?' and room for your dog':'',"."]}):null]}),(0,O.jsxs)(b.Card,{children:[(0,O.jsx)(b.H2,{children:"Date"}),(0,O.jsx)(B.CustomerDatePicker,{r:A,today:R,value:U,events:I,onChange:e=>{G(e),V(null)}}),qe.map(e=>(0,O.jsx)(b.Banner,{kind:"demo",title:e.title,children:e.description},e.id))]}),(0,O.jsxs)(b.Card,{children:[(0,O.jsx)(b.H2,{children:"Time"}),0===Oe.length?(0,O.jsx)(b.Muted,{children:"Closed on this day (per listed kitchen hours)."}):(0,O.jsx)(b.Row,{wrap:!0,gap:6,children:Oe.map(e=>(0,O.jsx)(b.Chip,{testID:`book-slot-${e.time}`,label:e.time,sub:e.available?e.drinksOnly?'Drinks only':void 0:e.blocked?'Unavailable':e.noDog?'No dog table':e.leftV(e.time)},e.time))}),De.length>0&&Oe.some(e=>e.blocked)?(0,O.jsx)(b.Banner,{kind:"info",title:Ae?'Some times aren\u2019t available online':'Online booking isn\u2019t available for this time',children:`We\u2019re not taking online bookings ${De.map(e=>`${e.from}\u2013${e.to}`).join(', ')} on ${(0,k.niceDate)(Ce)}. Please give us a ring on ${A.phone??"the restaurant"} and we\u2019ll do our best to fit you in.`}):null,(()=>{const e=(0,n.lastFoodOn)(A,U);return e&&Oe.some(e=>e.drinksOnly)?(0,O.jsx)(b.Banner,{kind:"info",title:`Last food orders ${(0,n.fmt12)(e.time)}${'kitchen closes'!==e.reason?` (${e.reason})`:''}`,children:"Times marked \u201cDrinks only\u201d are after the kitchen\u2019s last food orders that day: you\u2019re welcome for drinks, but we can\u2019t serve food."}):null})(),ve&&Oe.some(e=>e.noDog)?(0,O.jsx)(b.Banner,{kind:"info",title:"Some times are full for dogs",children:`Times marked "No dog table" are full in the ${Pe.map(e=>e.name).join(' and ')}${A.settings.maxDogsPerSlot?' or already have the most dogs we can look after':''}${(0,T.closedAreasAt)(ye,A.id,U,Q??'12:00').size?', or the garden is closed for weather':''}. We\u2019d love to see you both, so please try one of the other times shown.`}):null,(0,O.jsx)(b.Muted,{children:(0,x.bookingLimitsHint)(A)})]}),(0,O.jsx)(P.MoreQuestions,{rid:A.id,r:A,value:ke,onChange:je,party:E,date:U,time:Q,today:(0,k.ymd)(R),bookings:fe,audience:"guest",showTables:!0}),(0,O.jsxs)(b.Card,{highlight:le?void 0:w.colours.amber,children:[(0,O.jsx)(b.Field,{label:"Notes (optional)",value:se,onChangeText:ae,placeholder:p.NOTES_PLACEHOLDER,multiline:!0,numberOfLines:3,testID:"book-notes"}),(0,O.jsx)(b.Toggle,{label:"I confirm the allergy information for this booking",value:le,onChange:ie}),(0,O.jsx)(b.Muted,{children:"Table requests aren\u2019t guaranteed, but we\u2019ll do our best. Nothing here is charged now; reserved dishes are paid on the night."})]}),(0,O.jsxs)(b.Card,{children:[(0,O.jsx)(b.H2,{children:"Your details"}),(0,O.jsx)(b.Field,{label:"Name for the booking",value:J,onChangeText:K}),(0,O.jsx)(b.Field,{testID:"book-phone",label:"Mobile number (needed to book)",value:X,onChangeText:Z,onBlur:()=>ne(!0),keyboardType:"phone-pad",autoComplete:"tel",placeholder:"e.g. 07700 900123"}),Fe.ok||!oe&&!X?null:(0,O.jsx)(b.T,{size:13,colour:w.colours.amber,children:Fe.error}),(0,O.jsx)(b.Field,{testID:"book-email",label:"Email (optional)",value:ee,onChangeText:te,keyboardType:"email-address",autoCapitalize:"none",autoComplete:"email",placeholder:"you@example.com"}),Le?null:(0,O.jsx)(b.T,{size:13,colour:w.colours.amber,children:"That email doesn\u2019t look quite right. Check it, or leave it blank."}),(0,O.jsxs)(b.Muted,{children:["We\u2019ll text you a confirmation",ee.trim()?' and email it too':'',", with how to change or cancel. We only use your number for this booking."]})]}),(0,O.jsx)(l.Honeypot,{value:F,onChange:L})]})}},1238,[843,1095,861,13,17,1239,963,85,841,1240,1108,777,845,851,1101,863,858,946,804,1181,848,993,996,1074,1103,1053,1241,8]); __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.Honeypot=function({value:t,onChange:n}){return(0,l.jsx)(o.default,{"aria-hidden":!0,pointerEvents:"none",style:{position:'absolute',left:-1e4,top:0,width:1,height:1,overflow:'hidden',opacity:0},children:(0,l.jsx)(e.TextInput,{testID:"hp-field",accessibilityLabel:"Leave this empty",value:t,onChangeText:n,tabIndex:-1,autoComplete:'off',name:'cc_extra_info','aria-hidden':!0})})};var e=r(d[0]);r(d[1]),r(d[2]);var t,n=r(d[3]),o=(t=n)&&t.__esModule?t:{default:t},l=r(d[4])},1239,[812,17,219,85,8]); -__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"maxChildren",{enumerable:!0,get:function(){return u}}),_e.ChildrenCount=function({party:e,value:t,onChange:o,depositsOn:h,testID:c="children-count",guest:p}){const f=u(e);if(f<1)return null;const x=Math.min(t,f);return(0,s.jsxs)(n.default,{style:{gap:6,alignItems:'center',width:'100%'},testID:c,children:[(0,s.jsx)(l.T,{size:17,weight:"semibold",center:!0,children:p?`How many of the ${e} are children?`:`Children in the ${e}`}),(0,s.jsx)(l.Stepper,{value:x,onChange:e=>o(Math.max(0,Math.min(f,e))),min:0,max:f,label:"children",testID:`${c}-stepper`,format:e=>e?String(e):'None'}),h?(0,s.jsx)(l.Muted,{center:!0,children:"Children never pay a deposit."}):null]})},r(d[0]);var e,t=r(d[1]),n=(e=t)&&e.__esModule?e:{default:e},l=r(d[2]),s=r(d[3]);const u=e=>Math.max(0,Math.round(Number(e)||0)-1)},1240,[17,85,777,8]); +__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"maxChildren",{enumerable:!0,get:function(){return o}}),_e.ChildrenCount=function({party:e,value:t,onChange:u,depositsOn:h,testID:c="children-count",guest:p}){const f=o(e);if(f<1)return null;const x=Math.min(t,f);return(0,s.jsxs)(n.default,{style:{gap:6,alignItems:'center',width:'100%'},testID:c,children:[(0,s.jsx)(l.T,{size:17,weight:"semibold",center:!0,children:p?`How many of the ${e} are children?`:`Children in the ${e}`}),(0,s.jsx)(l.Stepper,{value:x,onChange:e=>u(Math.max(0,Math.min(f,e))),min:0,max:f,label:"children",testID:`${c}-stepper`,format:e=>e?String(e):'None'}),h?(0,s.jsx)(l.Muted,{center:!0,children:"Children don't count towards the number that needs a deposit, and never pay."}):null]})},r(d[0]);var e,t=r(d[1]),n=(e=t)&&e.__esModule?e:{default:e},l=r(d[2]),s=r(d[3]);const o=e=>Math.max(0,Math.round(Number(e)||0)-1)},1240,[17,85,777,8]); __d(function(g,_r,_i,a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.CustomerDatePicker=function({r:e,today:m,value:D,events:x,onChange:f}){const p=(0,n.ymd)(m),j=(0,r.lastBookableDay)(p,e),[C,w]=(0,t.useState)(!1),[Y,k]=(0,t.useState)((0,i.slashDay)(D)),[I,P]=(0,t.useState)(D);I!==D&&(P(D),k((0,i.slashDay)(D)));const T=new Date(m);T.setHours(12,0,0,0);const $=Array.from({length:b},(e,t)=>{const s=new Date(T);return s.setDate(T.getDate()+t),s}).filter(e=>(0,n.ymd)(e)<=j),v=t=>!!(0,o.hoursFor)(e,t),F=(0,n.parseYmd)(D),[L,M]=(0,t.useState)(()=>({y:F.getFullYear(),m:F.getMonth()})),S=(new Date(L.y,L.m,1,12).getDay()+6)%7,R=new Date(L.y,L.m+1,0).getDate(),A=[...Array.from({length:S},()=>null),...Array.from({length:R},(e,t)=>new Date(L.y,L.m,t+1,12))];for(;A.length%7;)A.push(null);const z=(0,n.parseYmd)(j),W=L.y>m.getFullYear()||L.y===m.getFullYear()&&L.m>m.getMonth(),B=L.yM(({y:t,m:s})=>{const l=new Date(t,s+e,1);return{y:l.getFullYear(),m:l.getMonth()}}),_=Y===(0,i.slashDay)(D)?null:(0,r.typedBookDateProblem)(Y,p,e),O=e=>{f(e),w(!1)},G=(e,t)=>0===t?'Today':1===t?'Tomorrow':`${(0,n.dayShort)(e)} ${e.getDate()}`,N=$.some(e=>(0,n.ymd)(e)===D);return(0,h.jsxs)(l.default,{testID:"cust-date",style:{gap:10,alignItems:'center',width:'100%'},children:[(0,h.jsx)(l.default,{accessible:!0,accessibilityLiveRegion:"polite",testID:"cust-date-chosen",children:(0,h.jsx)(d.T,{center:!0,weight:"semibold",colour:c.colours.goldLight,children:`Booking for ${(0,n.niceDateYear)(F)}${v(F)?'':' (closed that day)'}`})}),(0,h.jsxs)(d.Row,{wrap:!0,gap:6,style:{justifyContent:'center'},children:[$.map((e,t)=>{const s=(0,n.ymd)(e),l=x.some(e=>e.date===s);return(0,h.jsx)(d.Chip,{testID:`cust-day-${s}`,label:G(e,t),sub:v(e)?l?'\u2605 event':void 0:'Closed',disabled:!v(e),selected:D===s,accessibilityLabel:`${(0,n.niceDate)(e)}${v(e)?l?', event':'':', closed'}`,onPress:()=>O(s)},s)}),N?null:(0,h.jsx)(d.Chip,{label:(0,n.niceDate)(F),sub:v(F)?void 0:'Closed',selected:!0,onPress:()=>w(!0),accessibilityLabel:`Chosen: ${(0,n.niceDateYear)(F)}. Opens the calendar`})]}),(0,h.jsxs)(l.default,{style:{width:'100%',maxWidth:360,gap:4},children:[(0,h.jsx)(d.Field,{label:"Any other date (DD/MM/YYYY)",testID:"cust-date-typed",value:Y,placeholder:"24/12/2026",keyboardType:"numbers-and-punctuation",maxLength:10,autoCapitalize:"none",autoCorrect:!1,style:{textAlign:'center'},accessibilityLabel:"Booking date, typed as day, month and four-digit year",onChangeText:t=>{const s=(0,i.slashDate)(t,Y);k(s);const l=(0,i.dayFromSlash)(s);l&&!(0,r.typedBookDateProblem)(s,p,e)&&f(l)}}),_&&Y.length>=10?(0,h.jsx)(d.T,{center:!0,size:15,colour:c.colours.amber,testID:"cust-date-problem",children:_}):null]}),(0,h.jsx)(d.Button,{kind:"secondary",label:C?'Hide calendar':'\ud83d\udcc5 Pick a date from a calendar',testID:"cust-date-cal",style:{minHeight:48},accessibilityLabel:C?'Hide the calendar':'Pick a date from a month calendar',onPress:()=>{C||M({y:F.getFullYear(),m:F.getMonth()}),w(!C)}}),C?(0,h.jsxs)(l.default,{testID:"cust-calendar",style:{borderWidth:1,borderColor:c.colours.border,borderRadius:14,padding:10,gap:6,backgroundColor:c.colours.surface2,width:'100%',maxWidth:420},children:[(0,h.jsx)(l.default,{style:{alignItems:'flex-end'},children:(0,h.jsx)(u.GoldClose,{label:"Close the calendar",testID:"cust-calendar-close",onPress:()=>w(!1),size:"sm"})}),(0,h.jsxs)(d.Row,{style:{justifyContent:'space-between',alignItems:'center'},children:[(0,h.jsx)(s.default,{accessibilityRole:"button",accessibilityLabel:"Previous month",accessibilityState:{disabled:!W},disabled:!W,onPress:()=>H(-1),style:{minWidth:48,minHeight:48,alignItems:'center',justifyContent:'center',opacity:W?1:.3},children:(0,h.jsx)(d.T,{size:22,colour:c.colours.gold,children:"\u2039"})}),(0,h.jsxs)(d.T,{center:!0,weight:"semibold",accessibilityRole:"header",children:[(0,n.monthLong)(L.m)," ",L.y]}),(0,h.jsx)(s.default,{accessibilityRole:"button",accessibilityLabel:"Next month",accessibilityState:{disabled:!B},disabled:!B,onPress:()=>H(1),style:{minWidth:48,minHeight:48,alignItems:'center',justifyContent:'center',opacity:B?1:.3},children:(0,h.jsx)(d.T,{size:22,colour:c.colours.gold,children:"\u203a"})})]}),(0,h.jsx)(l.default,{style:{flexDirection:'row'},importantForAccessibility:"no-hide-descendants",children:y.map(e=>(0,h.jsx)(d.T,{size:12,colour:c.colours.muted,center:!0,style:{flex:1},children:e},e))}),Array.from({length:A.length/7},(e,t)=>(0,h.jsx)(l.default,{style:{flexDirection:'row',gap:4},children:A.slice(7*t,7*t+7).map((e,t)=>{if(!e)return(0,h.jsx)(l.default,{style:{flex:1,height:44}},t);const o=(0,n.ymd)(e),i=oj,r=o===D,u=!v(e);return(0,h.jsx)(s.default,{testID:`cust-cal-${o}`,accessibilityRole:"button",accessibilityLabel:`${(0,n.niceDateYear)(e)}${i?', not bookable online':u?', closed':''}`,accessibilityState:{disabled:i||u,selected:r},disabled:i||u,onPress:()=>O(o),style:{flex:1,height:44,borderRadius:10,alignItems:'center',justifyContent:'center',borderWidth:o===p?1.5:0,borderColor:c.colours.gold,backgroundColor:r?c.colours.gold:'transparent',opacity:i?.3:1},children:(0,h.jsx)(d.T,{size:15,center:!0,weight:r?'bold':'regular',colour:r?c.colours.onGold:u?c.colours.muted:c.colours.text,style:u&&!i?{textDecorationLine:'line-through'}:void 0,children:e.getDate()})},t)})},t)),(0,h.jsxs)(d.Muted,{center:!0,children:["Crossed-out days: closed. ",(0,r.bookAheadUnlimited)(e)?`You can book up to ${(0,i.slashDay)(j)}.`:`Online booking is open up to ${(0,i.slashDay)(j)}.`]})]}):null]})};var t=_r(_d[0]),s=e(_r(_d[1])),l=e(_r(_d[2])),o=_r(_d[3]),n=_r(_d[4]),i=_r(_d[5]),r=_r(_d[6]),c=_r(_d[7]),d=_r(_d[8]),u=_r(_d[9]),h=_r(_d[10]);const y=['Mon','Tue','Wed','Thu','Fri','Sat','Sun'],b=14},1241,[17,385,85,862,863,1031,1242,804,777,779,8]); __d(function(g,_r,i,a,_m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"SERVER_MAX_DAYS_AHEAD",{enumerable:!0,get:function(){return n}}),e.bookAheadDays=r,Object.defineProperty(e,"bookAheadUnlimited",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"lastBookableDay",{enumerable:!0,get:function(){return u}}),e.typedBookDateProblem=function(n,r,o){const s=(n??'').trim();if(!s)return'Type a date as DD/MM/YYYY, for example 24/12/2026.';const l=(0,t.dayFromSlash)(s);if(!l)return'That isn\u2019t a date yet. Type it as DD/MM/YYYY, for example 24/12/2026.';if(lc){const[t,n,r]=c.split('-');return`Online booking is open up to ${r}/${n}/${t}. For later dates, please call us.`}return null};var t=_r(_d[0]);const n=366;function r(t){const r=Number(t?.settings?.onlineBookDaysAhead);return Number.isFinite(r)&&r>=1?Math.min(Math.round(r),n):n}const o=t=>r(t)>=n,s=(t,n)=>{const r=new Date(t+'T12:00:00Z');return r.setUTCDate(r.getUTCDate()+n),r.toISOString().slice(0,10)},u=(t,n)=>s(t,r(n))},1242,[1031]); __d(function(_g,_r,i,_a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return b}});var n=_r(_d[0]),t=_r(_d[1]),s=_r(_d[2]),a=e(_r(_d[3])),l=e(_r(_d[4])),r=_r(_d[5]),o=_r(_d[6]),d=_r(_d[7]),c=_r(_d[8]),u=_r(_d[9]),h=_r(_d[10]),g=_r(_d[11]),p=_r(_d[12]),f=_r(_d[13]);function b(){const{rid:e,did:b}=(0,t.useLocalSearchParams)(),j=(0,h.useRestaurant)(e),x=(0,h.useMenu)(e).find(e=>e.id===b),y=(0,h.useCustomer)(),m=(0,h.useRecipeCards)(e).find(e=>e.id===x?.recipeCardId),k=m?.signOff&&m.photo?(0,g.recipeCards)().photoSource(m.photo):null,v=(0,h.useStore)(e=>e.addLine),w=(0,n.useTakeawayMenu)(n=>n.byVenue[e]),S=(0,h.useStore)(n=>n.basket.restaurantId===e&&'table'===n.basket.mode),[C,B]=(0,s.useState)(()=>(x?.optionGroups??[]).filter(e=>e.required).map(e=>e.choices[0].id)),[$,I]=(0,s.useState)(1),[P,T]=(0,s.useState)(''),[L,O]=(0,s.useState)(!1),[D,A]=(0,s.useState)(!1),[M,R]=(0,s.useState)(!1),[q,_]=(0,s.useState)(!1),N=(0,s.useMemo)(()=>x?(0,c.effectiveAllergens)(x,C):{},[x,C]);if(!j||!x)return(0,f.jsx)(d.Screen,{title:"Not found",children:(0,f.jsx)(d.T,{children:"Dish not found."})});const G=(0,c.conflictsFor)(N,y.allergies),Y=(x.price??0)+(x.optionGroups??[]).flatMap(e=>e.choices).filter(e=>C.includes(e.id)).reduce((e,n)=>e+n.priceDelta,0),z=S||j.fictional?'on':(0,n.takeawayAvail)(x,w),F=x.soldOut||!x.signOff||null===x.price||'on'!==z,Q=(e,n)=>{const t=x.optionGroups.find(n=>n.id===e);B(e=>{const s=t.choices.map(e=>e.id);return t.multi?e.includes(n)?e.filter(e=>e!==n):[...e,n]:e.includes(n)&&!t.required?e.filter(e=>e!==n):[...e.filter(e=>!s.includes(e)),n]})},V=e=>{h.useStore.getState().basket.restaurantId!==j.id&&h.useStore.getState().startBasket(j.id,'takeaway'),v({itemId:x.id,qty:$,choiceIds:C,notes:P,override:e?{allergens:G.contains,at:(new Date).toISOString()}:void 0}),O(!1),_(!0)};return(0,f.jsxs)(d.Screen,{title:x.name,subtitle:j.name,right:(0,f.jsx)(o.BasketButton,{}),children:[k?(0,f.jsx)(a.default,{testID:"dish-photo",source:k,accessibilityLabel:`${x.name}${'example'===m?.origin?' (example photo)':''}`,style:{width:'100%',height:200,borderRadius:12},resizeMode:"cover"}):null,(0,f.jsxs)(d.Row,{wrap:!0,gap:6,children:[(0,f.jsx)(d.T,{weight:"bold",size:20,colour:p.colours.gold,children:null===x.price?x.priceNote:(0,u.gbp)(Y)}),x.dietary.map(e=>(0,f.jsx)(d.Badge,{kind:"ok",label:e},e))]}),(0,f.jsx)(d.T,{children:x.description}),G.contains.length?(0,f.jsx)(d.Banner,{kind:"danger",title:`Blocked: contains ${G.contains.map(c.allergenLabel).join(', ')}`,children:`You\u2019ve told us: ${y.allergies.filter(e=>G.contains.includes(e.allergen)).map(e=>`${(0,c.allergenLabel)(e.allergen)} \u2014 ${(0,c.severityLabel)(e.severity)}`).join('; ')}. This dish can\u2019t be added unless you deliberately override (for example, ordering for someone else).`}):null,G.may.length?(0,f.jsx)(d.Banner,{kind:"warn",title:`Warning: may contain ${G.may.map(c.allergenLabel).join(', ')}`,children:"Cross-contact is possible (e.g. shared fryer). Please speak to staff before ordering."}):null,(x.optionGroups??[]).map(e=>(0,f.jsxs)(d.Card,{children:[(0,f.jsxs)(d.T,{weight:"semibold",children:[e.name,e.required?' (required)':' (optional)']}),(0,f.jsx)(d.Row,{wrap:!0,gap:6,children:e.choices.map(n=>(0,f.jsx)(d.Chip,{label:n.label,sub:n.priceDelta?`+${(0,u.gbp)(n.priceDelta)}`:void 0,selected:C.includes(n.id),onPress:()=>Q(e.id,n.id)},n.id))})]},e.id)),(0,f.jsx)(d.Card,{children:(0,f.jsx)(r.AllergenPanel,{item:x,map:N,declared:y.allergies})}),j.fictional?null:(0,f.jsx)(d.AllergenNotice,{phone:j.phone}),(0,f.jsx)(d.Field,{label:"Notes for the kitchen (optional)",placeholder:"e.g. no gherkins",value:P,onChangeText:T}),(0,f.jsxs)(d.Row,{style:{justifyContent:'space-between'},children:[(0,f.jsx)(d.T,{weight:"semibold",children:"Quantity"}),(0,f.jsx)(d.Stepper,{value:$,onChange:I,label:"quantity"})]}),q?(0,f.jsx)(d.Banner,{kind:"success",title:"Added to basket",children:G.contains.length?'Allergy override recorded \u2014 the kitchen will see a large allergy alert.':'Carry on browsing or go to your basket.'}):null,F?(0,f.jsx)(d.Banner,{kind:"warn",children:x.soldOut||'sold-out'===z?'Sold out today.':'off'===z&&x.signOff&&null!==x.price?'This dish isn\u2019t on the takeaway menu. You can have it when you eat in.':x.signOff?'Price on the specials board \u2014 ask staff.':'Not available to order online until the head chef signs off its allergens.'}):G.contains.length?(0,f.jsxs)(l.default,{style:{gap:8},children:[(0,f.jsx)(d.Button,{kind:"secondary",label:"Choose something else",onPress:()=>t.router.back()}),(0,f.jsx)(d.Button,{kind:"danger",label:"Override and add anyway\u2026",onPress:()=>{A(!1),R(!1),O(!0)},testID:"override-open"})]}):(0,f.jsxs)(d.Row,{gap:8,children:[(0,f.jsx)(d.Button,{style:{flex:1},label:`Add ${$} to basket \xb7 ${(0,u.gbp)(Y*$)}`,onPress:()=>V(!1),testID:"add-to-basket"}),q?(0,f.jsx)(d.Button,{kind:"secondary",label:"Basket",onPress:()=>t.router.push('/customer/basket')}):null]}),(0,f.jsxs)(d.Sheet,{visible:L,onClose:()=>O(!1),title:"Allergy override",children:[(0,f.jsx)(d.Banner,{kind:"danger",title:`${x.name} contains ${G.contains.map(c.allergenLabel).join(', ')}`,children:`Your profile says: ${y.allergies.filter(e=>G.contains.includes(e.allergen)).map(e=>`${(0,c.allergenLabel)(e.allergen)} \u2014 ${(0,c.severityLabel)(e.severity)}`).join('; ')}.`}),(0,f.jsx)(d.Toggle,{label:"I understand this dish contains an allergen I have declared",value:D,onChange:A}),(0,f.jsx)(d.Toggle,{label:"It is for someone without this allergy, or I have spoken to staff",value:M,onChange:R}),(0,f.jsx)(d.Muted,{children:"The override is logged and shown to the kitchen as an allergy alert that must be acknowledged."}),(0,f.jsx)(d.Button,{kind:"danger",disabled:!D||!M,label:"Confirm override and add",onPress:()=>V(!0),testID:"override-confirm"})]})]})}},1243,[947,13,17,319,85,1216,1244,777,845,851,858,867,804,8]); @@ -1498,7 +1498,7 @@ __d(function(g,_r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule? __d(function(g,r,i,a,_m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"DESKTOP_EXPIRED",{enumerable:!0,get:function(){return n}}),e.handoverCodeFrom=function(n){const t=(n||'').trim();if(!t)return null;const o=t.match(/[#&]ccchrome=([A-Za-z0-9_-]{24,64})(?:&|\s|$)/);if(o)return o[1];if(/[/#?=]/.test(t))return null;const c=t.replace(/\s+/g,'');return/^[A-Za-z0-9_-]{24,64}$/.test(c)?c:null},e.desktopLinkFor=function(n,t){try{const o=new URL(n),c=o.pathname.match(/^(.*?\/)(?:owner|staff|chef|display|customer|car)-app\/|^(.*?\/)owner-desktop\//),s=c?c[1]??c[2]:o.pathname.replace(/[^/]*$/,'');return`${o.origin}${s}owner-desktop/index.html#ccchrome=${t}`}catch{return null}},Object.defineProperty(e,"codeGroups",{enumerable:!0,get:function(){return t}}),e.desktopRefusal=function(t){return/no longer active/i.test(t)?'This person is no longer active in CoverCharge. Ask the other owner.':/expired|Chrome link|already been used/i.test(t)?n:t};const n='That sign-in link has run out or has already been used. On your phone, open More, then Use on a computer, and make a new one.';const t=n=>(n.match(/.{1,4}/g)??[]).join(' ')},1415,[]); __d(function(g,_r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.LaunchWelcome=function({p:e,onDone:t}){(0,r.useEffect)(()=>{if(!O||document.getElementById('cc-launch-css'))return;const e=document.createElement('style');e.id='cc-launch-css',e.textContent=I,document.head.appendChild(e)},[]),(0,r.useEffect)(()=>{if(O)return document.documentElement.classList.add('cc-welcome'),()=>document.documentElement.classList.remove('cc-welcome')},[]);const[o,k]=(0,r.useState)(P()?0:3),[E,_]=(0,r.useState)('main'),[Y,F]=(0,r.useState)(''),[H,M]=(0,r.useState)(0);(0,r.useEffect)(()=>{if(o<=0)return;const e=setTimeout(()=>k(e=>e-1),300);return()=>clearTimeout(e)},[o]);const B=(0,f.useAvatars)(t=>!!t.photos[e.id]),K=(0,b.useStore)(e=>e.restaurants[0]?.name??'Your venue').toUpperCase(),V=(0,x.useOwner)(t=>t.hourly[e.id]),G=(0,x.useOwner)(t=>t.staff.find(t=>t.id===e.id)),$=(0,y.useSync)(e=>e.mode),q='live'===$||'offline'===$,J=G?.salaried||e.salaried?'Salaried':null!=V?`\xa3${(V/100).toFixed(2)} an hour${G?.noTax?' \xb7 no-tax code':''}`:'connecting'===$?'Loading\u2026':'Ask your manager',Q='staff'!==e.app&&'staff'!==p.APP_VARIANT?(0,v.appUrl)('staff'):null,X=`AN-${String(j.ROSTER.findIndex(t=>t.id===e.id)+1).padStart(2,'0')}`,Z=p.IS_OWNER_DESKTOP?'CoverCharge for desktop':v.APP_NAME['staff'===p.APP_VARIANT?'staff':e.app],ee=L['staff'===p.APP_VARIANT&&'staff'!==e.app?'Staff':e.level]??L.Staff;return(0,C.jsxs)(h.default,{testID:"invite-welcome",style:[u.default.absoluteFill,{backgroundColor:(0,n.soutersSurface)('#000'),zIndex:1e3}],children:[(0,C.jsxs)(h.default,{...R('space'),pointerEvents:"none",children:[(0,C.jsx)(h.default,{...R('stars1')}),(0,C.jsx)(h.default,{...R('stars2')})]}),o>0?(0,C.jsxs)(l.default,{testID:"invite-countdown",accessibilityLabel:"Skip intro",onPress:()=>k(0),style:{flex:1,alignItems:'center',justifyContent:'center',gap:10},children:[(0,C.jsxs)(D,{colour:w.colours.muted,children:[K," \xb7 COVER CHARGE"]}),(0,C.jsx)(h.default,{...R('count'),children:(0,C.jsx)(T.T,{size:120,weight:"bold",colour:A,children:o})},o),(0,C.jsx)(D,{children:"GETTING YOU ON BOARD"})]}):'selfie'===E?(0,C.jsx)(W,{p:e,onClose:e=>{_('main'),e?(F('Avatar saved. Looking good!'),M(e=>e+1)):F('')}}):(0,C.jsxs)(c.default,{contentContainerStyle:{padding:22,paddingTop:34,gap:18,alignItems:'center',maxWidth:520,width:'100%',alignSelf:'center',paddingBottom:56},children:[(0,C.jsxs)(h.default,{...R('rise1'),style:{alignItems:'center',gap:2},children:[(0,C.jsxs)(D,{children:[K," \xb7 ",Z.toUpperCase()]}),(0,C.jsx)(T.T,{size:20,colour:w.colours.muted,center:!0,style:{marginTop:10},children:"Welcome aboard,"}),(0,C.jsx)(T.T,{size:42,weight:"bold",center:!0,style:{lineHeight:50},children:e.name})]}),(0,C.jsxs)(h.default,{...R('reveal'),style:{marginVertical:8},children:[(0,C.jsx)(h.default,{...R('orbit'),pointerEvents:"none"}),(0,C.jsx)(h.default,{...R('halo'),children:(0,C.jsx)(S.StaffAvatar,{id:e.id,size:156})})]},H),Y?(0,C.jsx)(T.T,{size:16,weight:"semibold",colour:w.colours.ok,center:!0,children:Y}):null,(0,C.jsx)(h.default,{...R('rise2'),style:{alignSelf:'stretch'},children:(0,C.jsxs)(h.default,{testID:"invite-crew-card",...R('card'),style:{borderRadius:20,borderWidth:1,borderColor:'rgba(207,164,95,0.55)',overflow:'hidden',padding:18,gap:12},children:[(0,C.jsx)(h.default,{...R('sheen'),pointerEvents:"none"}),(0,C.jsxs)(h.default,{style:{flexDirection:'row',justifyContent:'space-between',alignItems:'center'},children:[(0,C.jsx)(D,{children:"CREW ID"}),(0,C.jsx)(T.T,{size:15,weight:"semibold",colour:w.colours.muted,style:{letterSpacing:1.5},children:X})]}),(0,C.jsx)(h.default,{style:{height:2,backgroundColor:A,opacity:.7,borderRadius:1}}),(0,C.jsx)(N,{k:"NAME",v:e.name}),(0,C.jsx)(N,{k:"ROLE",v:(0,v.levelJob)(e.level,e.job)}),(0,C.jsx)(N,{k:"APP",v:Z}),'owner'!==e.role?(0,C.jsx)(h.default,{testID:"invite-pay",children:(0,C.jsx)(N,{k:"PAY",v:J})}):null,(0,C.jsx)(N,{k:"ACCESS",v:'Owner'===e.level?'Everything':'Manager'===e.level?'Manager':'Supervisor'===e.level?'Supervisor':'Head Chef'===e.level?'Kitchen lead':'Team member'}),(0,C.jsxs)(h.default,{style:{flexDirection:'row',alignItems:'center',gap:8},children:[(0,C.jsx)(h.default,{...R('blink'),style:{width:10,height:10,borderRadius:5,backgroundColor:w.colours.ok}}),(0,C.jsx)(T.T,{size:15,colour:w.colours.ok,children:p.IS_OWNER_DESKTOP?'Signed in on this computer':'Signed in on this phone'})]})]})}),(0,C.jsxs)(h.default,{...R('rise3'),style:{alignSelf:'stretch',gap:10},children:[(0,C.jsx)(D,{children:"WHAT YOU CAN DO"}),ee.map(e=>(0,C.jsxs)(h.default,{style:{flexDirection:'row',gap:12,alignItems:'flex-start'},children:[(0,C.jsx)(T.T,{size:16,colour:A,children:"\u25c6"}),(0,C.jsx)(T.T,{size:16,style:{flex:1},children:e})]},e))]}),O?(0,C.jsxs)(h.default,{testID:"invite-avatar-offer",...R('rise4'),style:{alignSelf:'stretch',gap:12,borderRadius:20,padding:18,borderWidth:1,borderColor:'rgba(255,255,255,0.14)',backgroundColor:'rgba(255,255,255,0.03)'},children:[(0,C.jsx)(D,{children:"YOUR AVATAR \xb7 OPTIONAL"}),(0,C.jsx)(T.T,{size:16,children:B?'You made your own avatar from a photo.':'Keep this one, choose an original icon, or make your own from a photo.'}),(0,C.jsx)(z,{kind:"ghost",label:B?'Choose another avatar':'Choose my avatar',testID:"invite-avatar-make",onPress:()=>{F(''),_('selfie')}}),(0,C.jsxs)(T.T,{size:15,colour:w.colours.muted,children:["Your photo stays on this ",p.IS_OWNER_DESKTOP?'computer':'phone',". It\u2019s turned into your avatar here; only the finished avatar is shared with your team."]})]}):null,(0,C.jsx)(h.default,{style:{alignSelf:'stretch',gap:10,marginTop:4},children:(0,C.jsx)(z,{label:B?'Get started':'Skip, keep this one and get started',testID:"invite-get-started",onPress:t})}),(0,s.inPhoneApp)()?null:(0,C.jsxs)(h.default,{style:{alignSelf:'stretch',gap:6,borderRadius:16,padding:16,borderWidth:1,borderColor:'rgba(255,255,255,0.12)'},children:[(0,C.jsx)(T.T,{size:16,weight:"semibold",colour:A,children:"Tip: add it to your Home screen"}),(0,C.jsxs)(T.T,{size:15,children:[U()," It then opens like a normal app and remembers you."]})]}),Q?(0,C.jsx)(l.default,{accessibilityRole:"link",onPress:()=>{O&&window.location.assign(Q)},children:(0,C.jsx)(T.T,{size:15,colour:A,center:!0,children:"Also open CoverCharge for Staff (your clock-in, rota and pay) \u203a"})}):null,(0,C.jsx)(T.T,{size:14,colour:w.colours.muted,center:!0,children:q?'Connected: bookings, orders and stock are shared live with the rest of the team. Your pay is only visible to you and your managers.':'Connecting\u2026 if there\u2019s no signal, what you enter is kept on this phone and shared once you\u2019re back online.'})]})]})};var t=_r(d[0]),n=_r(d[1]),r=_r(d[2]),s=_r(d[3]),o=e(_r(d[4]));_r(d[5]);var l=e(_r(d[6])),c=e(_r(d[7])),u=e(_r(d[8])),h=e(_r(d[9])),p=_r(d[10]),f=_r(d[11]),x=_r(d[12]),b=_r(d[13]),y=_r(d[14]),v=_r(d[15]),j=_r(d[16]),k=_r(d[17]),w=_r(d[18]),S=_r(d[19]),T=_r(d[20]),C=_r(d[21]);const A=w.colours.gold,I="\n[data-cc=\"space\"]{position:absolute;top:0;left:0;right:0;bottom:0;overflow:hidden;background:radial-gradient(ellipse at 50% 115%,#2a1f0c 0%,#0a0805 38%,#000 70%)}\n[data-cc=\"stars1\"],[data-cc=\"stars2\"]{position:absolute;top:-50%;left:-50%;width:200%;height:200%;will-change:transform}\n[data-cc=\"stars1\"]{background-image:radial-gradient(1.2px 1.2px at 23px 41px,#fff,transparent),radial-gradient(1px 1px at 97px 13px,#fff9,transparent),radial-gradient(1.4px 1.4px at 151px 120px,#f5e6c8,transparent),radial-gradient(1px 1px at 61px 163px,#fffa,transparent),radial-gradient(1.2px 1.2px at 183px 77px,#fff8,transparent);background-size:211px 199px;animation:cc-drift 90s linear infinite;opacity:.75}\n[data-cc=\"stars2\"]{background-image:radial-gradient(2px 2px at 40px 60px,#CFA45F,transparent),radial-gradient(1.6px 1.6px at 250px 210px,#fff,transparent),radial-gradient(1.8px 1.8px at 330px 40px,#fffc,transparent);background-size:397px 367px;animation:cc-drift2 60s linear infinite,cc-twinkle 3.2s ease-in-out infinite alternate;opacity:.8}\n@keyframes cc-drift{to{transform:translate3d(-211px,199px,0)}}\n@keyframes cc-drift2{to{transform:translate3d(-397px,367px,0)}}\n@keyframes cc-twinkle{from{opacity:.45}to{opacity:.95}}\n[data-cc=\"count\"]{animation:cc-count .32s cubic-bezier(.2,.8,.2,1) both}\n@keyframes cc-count{from{opacity:0;transform:scale(1.9)}to{opacity:1;transform:scale(1)}}\n[data-cc=\"reveal\"]{animation:cc-reveal .75s cubic-bezier(.2,.9,.25,1.25) both}\n@keyframes cc-reveal{0%{opacity:0;transform:scale(.35) rotate(-12deg)}100%{opacity:1;transform:scale(1) rotate(0)}}\n[data-cc=\"halo\"]{border-radius:999px;box-shadow:0 0 0 2px rgba(207,164,95,.85),0 0 38px 6px rgba(207,164,95,.35);animation:cc-glow 2.6s ease-in-out infinite}\n@keyframes cc-glow{0%,100%{box-shadow:0 0 0 2px rgba(207,164,95,.85),0 0 30px 4px rgba(207,164,95,.28)}50%{box-shadow:0 0 0 2px rgba(207,164,95,1),0 0 52px 10px rgba(207,164,95,.5)}}\n[data-cc=\"orbit\"]{position:absolute;top:-14px;left:-14px;right:-14px;bottom:-14px;border-radius:999px;border:1px dashed rgba(207,164,95,.45);animation:cc-spin 14s linear infinite}\n@keyframes cc-spin{to{transform:rotate(360deg)}}\n[data-cc=\"rise1\"],[data-cc=\"rise2\"],[data-cc=\"rise3\"],[data-cc=\"rise4\"]{animation:cc-rise .5s cubic-bezier(.2,.8,.2,1) both}\n[data-cc=\"rise2\"]{animation-delay:.12s}[data-cc=\"rise3\"]{animation-delay:.24s}[data-cc=\"rise4\"]{animation-delay:.36s}\n@keyframes cc-rise{from{opacity:0;transform:translate3d(0,18px,0)}to{opacity:1;transform:none}}\n[data-cc=\"btn\"]{transition:transform .12s ease,box-shadow .2s ease,filter .2s ease;cursor:pointer}\n[data-cc=\"btn\"]:hover{filter:brightness(1.08)}\n[data-cc=\"btnp\"]{transition:transform .12s ease,box-shadow .2s ease;cursor:pointer;box-shadow:0 0 0 1px rgba(207,164,95,.9),0 8px 30px rgba(207,164,95,.35)}\n[data-cc=\"btnp\"]:hover{box-shadow:0 0 0 1px #CFA45F,0 8px 44px rgba(207,164,95,.6)}\n[data-cc=\"card\"]{background:linear-gradient(135deg,rgba(255,255,255,.07),rgba(255,255,255,.02));backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px)}\n[data-cc=\"sheen\"]{position:absolute;top:0;bottom:0;width:40%;left:-60%;background:linear-gradient(100deg,transparent,rgba(255,255,255,.10),transparent);animation:cc-sheen 3.8s ease-in-out 1s infinite}\n@keyframes cc-sheen{0%{left:-60%}35%,100%{left:130%}}\n[data-cc=\"scan\"]{position:absolute;left:0;right:0;height:4px;background:linear-gradient(90deg,transparent,#CFA45F,#fff,#CFA45F,transparent);box-shadow:0 0 18px 4px rgba(207,164,95,.75);animation:cc-scan .9s ease-in-out infinite alternate}\n@keyframes cc-scan{from{top:2%}to{top:96%}}\n[data-cc=\"grid\"]{position:absolute;top:0;left:0;right:0;bottom:0;background-image:linear-gradient(rgba(207,164,95,.18) 1px,transparent 1px),linear-gradient(90deg,rgba(207,164,95,.18) 1px,transparent 1px);background-size:22px 22px}\n[data-cc=\"blink\"]{animation:cc-blink 1s steps(2,start) infinite}\n@keyframes cc-blink{to{visibility:hidden}}\nhtml.cc-welcome #cc-install-hint{display:none !important}\n@media (prefers-reduced-motion: reduce){[data-cc]{animation:none !important;transition:none !important}}\n",R=e=>({dataSet:{cc:e}}),O='undefined'!=typeof document,P=()=>O&&'function'==typeof window.matchMedia&&window.matchMedia('(prefers-reduced-motion: reduce)').matches,E=()=>{try{O&&navigator.vibrate?.(12)}catch{}};function z({label:e,onPress:t,kind:n="primary",testID:r,disabled:s}){const o='primary'===n;return(0,C.jsx)(l.default,{testID:r,accessibilityRole:"button",accessibilityLabel:e,disabled:s,onPress:()=>{E(),t()},...R(o&&!s?'btnp':'btn'),style:({pressed:e})=>[{alignSelf:'stretch',minHeight:56,borderRadius:28,alignItems:'center',justifyContent:'center',paddingHorizontal:20,backgroundColor:o?A:'rgba(255,255,255,0.04)',borderWidth:o?0:1.5,borderColor:A,opacity:s?.45:1,transform:[{scale:e?.96:1}]}],children:(0,C.jsx)(T.T,{size:18,weight:"semibold",colour:o?'#0B0B0B':A,center:!0,children:e})})}const D=({children:e,colour:t=A})=>(0,C.jsx)(T.T,{size:14,weight:"semibold",colour:t,style:{letterSpacing:2.2},children:e}),L={Owner:['Takings, sales, labour cost and payroll','Bookings (Tables and Covers), orders, the rota and team chat','Every setting, plus the Assistant for quick answers'],Manager:['Run service: orders, bookings (Tables and Covers) and the waitlist','The rota, timesheets and team pay rates','Your own clock-in and pay in the Staff app'],Supervisor:['Run service: orders, bookings (Tables and Covers) and the waitlist','The rota, timesheets and team pay rates','Your own clock-in and pay in the Staff app'],'Head Chef':['Stock, costings, prep, ordering and the specials board','Food safety checks, allergens and live tickets','Your own clock-in, rota and pay in the Staff app'],Staff:['Clock in and out, see your rota, swap shifts, ask for time off','Team chat, food safety checks and the accident book','Your own hours, pay and tips (only yours)']};function U(){const e=O?navigator.userAgent:'';return/iPhone|iPad|iPod/.test(e)?'In Safari, tap Share (the square with an arrow), then Add to Home Screen.':/SamsungBrowser/.test(e)?'Tap the menu, then Add page to, then Home screen.':'In Chrome, tap \u22ee then Add to Home screen (or Install app).'}const N=({k:e,v:t})=>(0,C.jsxs)(h.default,{style:{flexDirection:'row',gap:12,alignItems:'baseline'},children:[(0,C.jsx)(T.T,{size:14,weight:"semibold",colour:w.colours.muted,numberOfLines:1,style:{width:74,letterSpacing:1.2},children:e}),(0,C.jsx)(T.T,{size:18,weight:"semibold",style:{flex:1},children:t})]});function W({p:e,onClose:s}){const[u,x]=(0,r.useState)('choose'),[b,y]=(0,r.useState)(null),[v,j]=(0,r.useState)(null),[I,O]=(0,r.useState)(!1),[L,U]=(0,r.useState)(''),N=(0,r.useRef)(null);(0,r.useEffect)(()=>()=>{N.current&&URL.revokeObjectURL(N.current)},[]);const W=async e=>{U('');const t=await(0,k.pickPhoto)(e);if(!t)return;N.current&&URL.revokeObjectURL(N.current);const n=URL.createObjectURL(t);N.current=n,y(n),O(!1),x('scan');const r=Date.now();try{const e=await(0,k.styliseOnDevice)(t),n=P()?0:Math.max(0,1300-(Date.now()-r));setTimeout(()=>{j(e),x('reveal'),E()},n)}catch{U("That photo couldn't be opened. Try another one (JPEG or PNG)."),x('choose')}},_=({children:e})=>(0,C.jsx)(h.default,{style:{width:236,height:236,borderRadius:118,overflow:'hidden',borderWidth:2,borderColor:A,alignItems:'center',justifyContent:'center',backgroundColor:(0,n.soutersSurface)('#050505')},children:e});return(0,C.jsxs)(c.default,{testID:"invite-avatar-step",contentContainerStyle:{padding:22,paddingTop:34,gap:18,alignItems:'center',maxWidth:520,width:'100%',alignSelf:'center',paddingBottom:56},children:[(0,C.jsx)(D,{children:"MAKE YOUR AVATAR"}),(0,C.jsx)(T.T,{size:28,weight:"bold",center:!0,children:'choose'===u?'Choose your look':'scan'===u?'Scanning\u2026':`Looking good, ${e.name}`}),'choose'===u?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(h.default,{...R('reveal'),children:(0,C.jsx)(h.default,{...R('halo'),children:(0,C.jsxs)(_,{children:[(0,C.jsx)(h.default,{style:{opacity:.55},children:(0,C.jsx)(S.StaffAvatar,{id:e.id,size:200,ring:!1})}),(0,C.jsx)(h.default,{...R('grid'),pointerEvents:"none"})]})})}),(0,C.jsxs)(T.T,{size:16,center:!0,colour:w.colours.muted,children:["Take a selfie or pick a photo. ",p.IS_OWNER_DESKTOP?'This computer turns it into a space-age avatar. The photo never leaves this computer and isn\u2019t kept.':'Your phone turns it into a space-age avatar. The photo never leaves this phone and isn\u2019t kept.']}),(0,C.jsx)(z,{label:"Take a selfie",testID:"avatar-selfie",onPress:()=>W(!0)}),(0,C.jsx)(z,{kind:"ghost",label:"Upload a photo",testID:"avatar-upload",onPress:()=>W(!1)}),(0,C.jsx)(h.default,{style:{width:'100%',minWidth:0},children:(0,C.jsx)(t.AvatarOptions,{onSelect:t=>{f.useAvatars.getState().setOwn(e.id,e.id,t.dataUrl,e.name)?s(!0):U('Could not save your avatar. Try again.')}})})]}):'scan'===u?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(h.default,{...R('halo'),children:(0,C.jsxs)(_,{children:[b?(0,C.jsx)(o.default,{source:{uri:b},style:{width:236,height:236},accessibilityLabel:"Your photo"}):null,(0,C.jsx)(h.default,{...R('grid'),pointerEvents:"none"}),(0,C.jsx)(h.default,{...R('scan'),pointerEvents:"none"})]})}),(0,C.jsx)(D,{colour:w.colours.muted,children:"MAKING YOUR AVATAR ON THIS PHONE"})]}):(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(h.default,{...R('reveal'),children:(0,C.jsx)(h.default,{...R('halo'),children:v?(0,C.jsx)(o.default,{testID:"avatar-result",source:{uri:v},style:{width:220,height:220,borderRadius:110},accessibilityLabel:"Your new avatar"}):null})}),(0,C.jsxs)(l.default,{accessibilityRole:"checkbox",accessibilityState:{checked:I},accessibilityLabel:"I agree to use this avatar",testID:"avatar-consent",onPress:()=>{E(),O(!I)},style:{alignSelf:'stretch',flexDirection:'row',gap:12,alignItems:'flex-start',padding:14,borderRadius:16,borderWidth:1.5,borderColor:I?A:'rgba(255,255,255,0.2)'},children:[(0,C.jsx)(h.default,{style:{width:28,height:28,borderRadius:8,borderWidth:2,borderColor:A,backgroundColor:I?A:'transparent',alignItems:'center',justifyContent:'center'},children:I?(0,C.jsx)(T.T,{size:17,weight:"bold",colour:"#111",children:"\u2713"}):null}),(0,C.jsx)(T.T,{size:15,style:{flex:1},children:"I\u2019m happy for this avatar, made from my photo, to be shown to my team in CoverCharge. Only the finished avatar is shared; my photo isn\u2019t uploaded or kept, and a manager can reset my avatar."})]}),(0,C.jsx)(z,{label:"Use this avatar",testID:"avatar-save",disabled:!I,onPress:()=>{if(!v)return;f.useAvatars.getState().setOwn(e.id,e.id,v,e.name)?(N.current&&URL.revokeObjectURL(N.current),N.current=null,s(!0)):U("Couldn't save the avatar. Please try again.")}}),(0,C.jsx)(z,{kind:"ghost",label:"Try another photo",onPress:()=>{j(null),x('choose')}})]}),L?(0,C.jsx)(T.T,{size:15,colour:w.colours.red,center:!0,children:L}):null,'scan'!==u?(0,C.jsx)(l.default,{testID:"invite-avatar-done",accessibilityRole:"button",onPress:()=>{E(),s(!1)},style:({pressed:e})=>({padding:12,transform:[{scale:e?.96:1}]}),children:(0,C.jsx)(T.T,{size:17,weight:"semibold",colour:w.colours.text,children:"Skip, keep this one"})}):null]})}},1416,[888,813,17,1067,319,219,385,278,24,85,856,885,876,816,946,966,878,776,804,884,777,8]); __d(function(g,_r,_i,_a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.Dashboard=function({go:e,ownerHome:a=!1}){const{rid:n,r:x,now:F,role:le,me:ae,today:ne}=(0,A.useCtx)(5e3),ie=(0,p.useOrders)(n),re=(0,p.useBookings)(n),de=(0,p.useWaitlist)(n),ue=(0,p.useEvents)(n),ge=(0,p.useRatings)(n),ye=(0,j.useOwner)(e=>e.staff),xe=(0,j.useOwner)(e=>(0,j.liveAttendance)(e.attendance)),me=(0,j.useOwner)(e=>e.shifts),be=(0,M.useRealHistory)(n,F),fe=(0,l.useMemo)(()=>(0,s.forecastToday)(x,re,ie,ue,F,be??void 0),[x,re,ie,ue,be,F.getTime()/6e4|0]),pe=(0,S.useExamples)(),je=(0,N.useCashUp)(e=>e.cashUps),ke=re.filter(e=>e.date===ne),we=ie.filter(B.LIVE),$e=de.filter(e=>'waiting'===e.status||'notified'===e.status),ve=(0,C.seatedCoversOn)(re,ne),Ie=(0,se.coversSplit)(ke,ne),Ce=we.filter(e=>(0,_.chainNeedsAction)(e,re)),De=ke.filter(e=>['confirmed','seated'].includes(e.status)&&(0,_.bookingNeedsAction)(e,we)),Te=we.flatMap(e=>(0,v.readinessFor)(e,x,F).map(t=>({...t,order:e}))).filter(e=>'due'===e.state||'overdue'===e.state),Be=fe.nextHour,Ae=(0,B.busyLevel)(Be?.coversHigh??0,fe.busy.busy),Le=(0,B.restOfDayLevel)(fe,x),Me=ie.filter(e=>e.paid>0&&!!e.createdAt&&(0,I.ymd)(new Date(e.createdAt))===ne).reduce((e,t)=>e+t.paid,0),Se=(0,R.tradingDay)(F),Ne=pe?(0,L.revenueHistory)(x,F,7).filter(e=>e.date.getDay()===F.getDay()).pop():void 0,Pe=pe?{today:186e3+Me,last:Ne?{date:(0,I.ymd)(Ne.date),pence:Ne.total}:null,online:0,show:!0}:(0,O.takingsToday)(je,n,Se,Me),Fe=j.CAN.takings(le)&&(!(0,H.isLive)()||(0,H.can)('takings.view')),We=(0,l.useMemo)(()=>(0,L.insights)(x,re,ie,ue,ge,F,ve),[x.id,re.length,ge.length,ve]),He=((0,A.weekday)(F),(0,k.openWorkingRows)(xe,ne)),Re=(0,J.useFrontDoor)(ne),Oe=(0,u.useBookingWrite)(),ze=(0,w.useOutstanding)(),Ee=(0,i.useTravelDay)('owner',ne),Ge=(0,A.useSignedIn)(),Ue=(0,A.useInStaffApp)(),qe=(0,P.canSeeMonthTakings)(le,Ge,{inStaffApp:Ue,live:(0,H.isLive)()}),Ye=(0,W.homeSetupNagsHidden)(n),Ke=(0,j.useOwner)(e=>e.socialPosts.reduce((e,t)=>e+('awaiting approval'===t.status?1:0),0)),[Ve,Qe]=(0,l.useState)(!1),[Xe,Ze]=(0,l.useState)(!1),Je=ae.replace(' (example)',''),et=j.CAN.manage(le)?(0,oe.jsx)(f.Button,{testID:"home-restaurant-dashboard",label:"Restaurant dashboard",accessibilityLabel:"Restaurant dashboard, everything on the Display: any day, table plan, Timeline, guests, Covers and actions",onPress:()=>e('more','serviceboard'),style:{minHeight:56}}):null;return Ee?(0,oe.jsxs)(b.default,{style:{gap:12},children:[et,(0,oe.jsx)(i.DayBar,{app:"owner",today:ne}),(0,oe.jsx)(i.DayView,{rid:n,day:Ee,today:ne,app:"owner"})]}):(0,oe.jsxs)(b.default,{style:{gap:12},testID:a?'owner-home':'managers-home',children:[et,(0,oe.jsx)(i.DayBar,{app:"owner",today:ne}),(0,oe.jsx)(K.WhoBar,{}),Ge&&'owner'!==Ge.role?(0,oe.jsx)(V.MyShiftCard,{go:e}):null,Ge?(0,oe.jsx)(Q.MyTasksToday,{rid:n,staffId:Ge.id,name:Ge.name,onShift:(0,Z.shiftNow)(Ge.id,Date.now()).on}):null,'staff'!==le?(0,oe.jsx)(X.TodaysTipsCard,{rid:n,today:ne}):null,'staff'!==le?(0,oe.jsx)(X.TipsPotCard,{rid:n,today:ne}):null,j.CAN.manage(le)?(0,oe.jsx)(b.default,{testID:"home-business-insights-wrap",style:{alignItems:'center',width:'100%'},children:(0,oe.jsx)(f.Button,{testID:"home-business-insights",label:"Business insights",accessibilityLabel:"Business insights, stats and percentages from your bookings and cash ups",onPress:()=>e('more','bizinsights'),style:{minHeight:56,width:'100%'}})}):null,(0,oe.jsx)(he,{split:Ie}),(0,oe.jsx)(ee.BlocksBanner,{rid:n,now:F,by:ae}),(0,oe.jsx)(y.KitchenSignoffs,{rid:n,today:ne,by:ae,app:"owner",canConfirm:j.CAN.manage(le)}),j.CAN.manage(le)&&!Ye?(0,oe.jsx)(q.SetupCard,{go:e}):null,j.CAN.manage(le)&&!Ye?(0,oe.jsx)(o.SeasonsTodo,{go:e}):null,(0,oe.jsx)(r.LastFoodBanner,{rid:n,now:F}),(0,oe.jsx)(d.NextTableFreeCard,{rid:n,now:F}),j.CAN.manage(le)?(0,oe.jsx)(f.Button,{testID:"home-blocks",label:"Block bookings",accessibilityLabel:"Block bookings: block now, add a block, see future blocks",accessibilityHint:Oe.hint,disabled:!Oe.ok,onPress:()=>e('more','blocks')}):null,(0,oe.jsx)(f.Button,{testID:"home-add-soldout",label:"Add sold out",accessibilityLabel:"Add sold out, mark a dish sold out or put it back on",onPress:()=>Qe(!0),style:{minHeight:56}}),(0,oe.jsxs)(b.default,{testID:"front-door-bar",dataSet:{centre:'buttons'},style:{flexDirection:'row',flexWrap:'wrap',gap:8,justifyContent:'center'},children:[(0,oe.jsx)(c.QuietButton,{label:"New booking",onPress:Re.openBooking,testID:"home-booking",disabled:!Oe.ok,accessibilityHint:Oe.hint}),j.CAN.manage(le)?(0,oe.jsx)(ee.CloseGardenButton,{quiet:!0,short:!0,rid:n,r:x,now:F,by:ae}):null]}),Re.elements,j.CAN.manage(le)?(0,oe.jsx)(Y.PaydaysCard,{go:e}):null,(0,oe.jsx)(E.FadeIn,{children:(0,oe.jsxs)(f.Card,{highlight:T.colours.gold,style:{alignItems:'center'},children:[(0,oe.jsxs)(f.T,{weight:"semibold",colour:T.colours.gold,center:!0,accessibilityRole:"header",children:["Next hour",Be?` \xb7 ${(0,A.fmtH)(Be.hour)}\u2013${(0,A.fmtH)(Be.hour+1)}`:'']}),fe.example?(0,oe.jsx)(M.ExampleBadge,{}):fe.enough?(0,oe.jsx)(f.Badge,{kind:"amber",label:"ESTIMATE"}):(0,oe.jsx)(f.Badge,{kind:"neutral",label:"BOOKED ONLY"}),(0,oe.jsx)(E.Gauge,{pct:Be?Ae.pct:0,label:Be?Ae.label:fe.open?'Kitchen closing':'Closed today',sub:Be&&!fe.enough?`${Be.booked} booked${Be.walkIns?` + ${Be.walkIns} walk-ins seated`:''} \xb7 not enough history for a forecast yet`:Be?`Estimated ${(0,s.coversRange)(Be.coversLow,Be.coversHigh)} \xb7 Busy at ${fe.busy.busy} Covers an hour \xb7 ${Be.booked} booked + about ${Be.walkIns} walk-ins${(0,h.showTakeaway)(x)?` \xb7 about ${Be.takeaway} takeaway`:''}`:'No forecast for the next hour'}),(0,oe.jsxs)(f.Row,{wrap:!0,gap:6,style:{justifyContent:'center'},children:[fe.enough?(0,oe.jsx)(f.Badge,{kind:"gold",label:`Rest of today: ${Le.level.label}${Le.peak?`, peak ${(0,A.fmtH)(Le.peak.hour)}`:''}`}):null,fe.enough?(0,oe.jsx)(f.Badge,{kind:"neutral",label:`${(0,s.coversRange)(fe.restOfDay.low,fe.restOfDay.high)}${(0,h.showTakeaway)(x)?` \xb7 about ${fe.restOfDay.takeaway} takeaways`:''}`}):(0,oe.jsx)(f.Badge,{kind:"neutral",label:`Booked so far: ${fe.restOfDay.booked} Covers`})]}),fe.flags.length?(0,oe.jsxs)(f.Muted,{center:!0,children:["Calendar: ",fe.flags.join(', ')]}):null,j.CAN.forecasts(le)?(0,oe.jsx)(f.Button,{small:!0,kind:"ghost",label:"Open forecasts \u2192",onPress:()=>e('forecast')}):null]})}),(0,oe.jsxs)(f.Row,{wrap:!0,gap:10,children:[(0,h.showTakeaway)(x)||we.length?(0,oe.jsx)(E.FadeIn,{delay:200,style:{flexGrow:1,flexBasis:150},children:(0,oe.jsx)(B.Tile,{label:"Live orders",value:"",accent:we.some(e=>'new'===e.status)?T.colours.red:void 0,onPress:()=>e('orders'),sub:(0,D.orderAtTableOn)(x)?`${we.filter(e=>'takeaway'===e.type).length} takeaway \xb7 ${we.filter(e=>'table'===e.type).length} table`:`${we.filter(e=>'takeaway'===e.type).length} takeaway`,children:(0,oe.jsx)(E.CountUp,{value:we.length})})}):null,$e.length>0?(0,oe.jsx)(E.FadeIn,{delay:260,style:{flexGrow:1,flexBasis:150},children:(0,oe.jsx)(B.Tile,{label:"Waitlist",value:"",onPress:()=>e('bookings','waitlist'),sub:`${$e.reduce((e,t)=>e+t.partySize,0)} Covers waiting`,children:(0,oe.jsx)(E.CountUp,{value:$e.length})})}):null,Fe&&Pe.show?(0,oe.jsx)(E.FadeIn,{delay:320,style:{flexGrow:1,flexBasis:150},children:(0,oe.jsx)(z.TakingsTodayCard,{t:Pe,example:pe,onPress:()=>e('more','analytics')})}):null,(0,oe.jsx)(E.FadeIn,{delay:380,style:{flexGrow:1,flexBasis:150},children:(0,oe.jsx)(B.Tile,{label:"Allergy alerts",value:"",accent:Ce.length+De.length?T.colours.red:T.colours.ok,sub:"Need a sign-off",children:(0,oe.jsx)(E.CountUp,{value:Ce.length+De.length,colour:Ce.length+De.length?T.colours.red:T.colours.ok})})})]}),Ce.length+De.length+Te.length?(0,oe.jsx)(B.SectionHead,{title:"Needs action now"}):null,Ce.map(e=>(0,oe.jsxs)(B.AlertBox,{colour:T.colours.red,title:`ALLERGY \xb7 ${e.ref} ${'table'===e.type?`${(0,t.tableNumbers)(e.tableNo)}`:'takeaway'}`,children:[(0,oe.jsx)(f.T,{size:14,children:e.allergies.map(e=>`${(0,$.allergenLabel)(e.allergen)} (${(0,$.severityLabel)(e.severity)})`).join('; ')}),(0,oe.jsx)(U.AllergyChain,{o:e,me:ae,compact:!0})]},e.id)),De.map(e=>(0,oe.jsxs)(B.AlertBox,{colour:T.colours.red,title:`ALLERGY \xb7 booking ${e.time} ${e.name} (${e.partySize})`,children:[(0,oe.jsx)(f.T,{size:14,children:e.allergies.map(e=>`${(0,$.allergenLabel)(e.allergen)} (${(0,$.severityLabel)(e.severity)})`).join('; ')}),(0,oe.jsx)(U.BookingAllergyChain,{b:e,me:ae})]},e.id)),Te.map(t=>(0,oe.jsxs)(B.AlertBox,{colour:'overdue'===t.state?T.colours.red:T.colours.amber,title:`${'cook'===t.stage?'START COOKING':'bag'===t.stage?'BAG IT':'READY'} \xb7 ${t.order.ref} pickup ${(0,I.hm)(new Date(t.order.slotTime))}${'overdue'===t.state?' \xb7 OVERDUE':''}`,children:[(0,oe.jsx)(f.T,{size:14,children:t.detail}),(0,oe.jsx)(f.Button,{small:!0,kind:"secondary",label:"Open orders",onPress:()=>e('orders')})]},t.id)),j.CAN.manage(le)&&(ze.days.length||ze.requests)?(0,oe.jsxs)(B.AlertBox,{colour:T.colours.amber,title:`HOURS \xb7 ${ze.days.length?`${ze.days.length} earlier day${ze.days.length>1?'s':''} to sign off`:''}${ze.days.length&&ze.requests?' \xb7 ':''}${ze.requests?`${ze.requests} correction request${ze.requests>1?'s':''}`:''}`,children:[(0,oe.jsx)(f.T,{size:14,children:"Hours only count for pay once a manager confirms them."}),(0,oe.jsx)(f.Button,{small:!0,kind:"secondary",label:"Sign off hours",testID:"nudge-signoff",onPress:()=>e('more','signoff')})]}):null,Ke&&j.CAN.publishSocial(le)?(0,oe.jsxs)(B.AlertBox,{colour:T.colours.amber,title:`SOCIAL \xb7 ${Ke} post${Ke>1?'s':''} awaiting approval`,children:[(0,oe.jsx)(f.T,{size:14,children:"Drafted by staff. Review and approve before anything goes out. Posting: not set up yet."}),(0,oe.jsx)(f.Button,{small:!0,kind:"secondary",label:"Review posts",onPress:()=>e('more','social')})]}):null,(0,oe.jsx)(B.SectionHead,{title:"Quick actions"}),(0,oe.jsxs)(m.default,{accessibilityRole:"button",accessibilityLabel:"Post to social",onPress:()=>e('more','social'),style:({pressed:e})=>({borderRadius:16,borderWidth:1.5,borderColor:T.colours.gold,backgroundColor:e?T.colours.goldTint:T.colours.surface,padding:12,flexDirection:'row',alignItems:'center',gap:10}),children:[(0,oe.jsxs)(f.Row,{gap:4,children:[(0,oe.jsx)(G.Mark,{p:"facebook"}),(0,oe.jsx)(G.Mark,{p:"instagram"}),(0,oe.jsx)(G.Mark,{p:"tiktok"}),(0,oe.jsx)(G.Mark,{p:"youtube"})]}),(0,oe.jsxs)(b.default,{style:{flex:1},children:[(0,oe.jsx)(f.T,{weight:"bold",children:"Post to social"}),(0,oe.jsx)(f.Muted,{children:"Facebook + Instagram, TikTok + YouTube: not set up yet"})]}),(0,oe.jsx)(f.T,{colour:T.colours.gold,size:20,children:"\u203a"})]}),(0,oe.jsx)(G.QuickLinksSection,{go:e,heading:e=>(0,oe.jsx)(B.SectionHead,{title:e})}),(0,oe.jsx)(B.SectionHead,{title:"Who\u2019s on now",right:(0,oe.jsx)(f.Badge,{kind:"ok",label:`${He.length} clocked in`})}),(0,oe.jsxs)(f.Card,{children:[0===He.length?(0,oe.jsx)(f.Muted,{children:"Nobody clocked in yet."}):null,He.map(e=>{const t=ye.find(t=>t.id===e.staffId),s=(0,j.shiftOf)(me,e.staffId,ne),o=new Date(e.in),l=!!s&&o.getHours()+o.getMinutes()/60-s.start>.08333333333333333;return(0,oe.jsxs)(f.Row,{style:{justifyContent:'space-between'},children:[(0,oe.jsxs)(b.default,{style:{flex:1},children:[(0,oe.jsx)(f.T,{weight:"semibold",children:t?.name??e.staffId}),(0,oe.jsxs)(f.Muted,{children:[t?.job," \xb7 in ",(0,I.hm)(o),s?` \xb7 shift ${(0,A.fmtH)(s.start)}\u2013${(0,A.fmtH)(s.end)}`:' \xb7 unscheduled']})]}),l?(0,oe.jsx)(f.Badge,{kind:"amber",label:"Late"}):(0,oe.jsx)(f.Badge,{kind:"ok",label:"On site"})]},e.id)}),j.CAN.manage(le)?(0,oe.jsx)(f.Button,{small:!0,kind:"ghost",label:"Rota & timesheets \u2192",onPress:()=>e('more','rota')}):(0,oe.jsx)(f.Button,{small:!0,kind:"secondary",label:"Clock in / out",onPress:()=>e('more','clock')})]}),'staff'!==le?(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(B.SectionHead,{title:"Insights",sub:pe?'AI-style suggestions from your bookings, orders, stock and calendar (example figures)':'From your own bookings, reviews and calendar'}),We.slice(0,4).map((t,s)=>(0,oe.jsx)(E.FadeIn,{delay:100+90*s,children:(0,oe.jsxs)(f.Card,{style:{borderLeftWidth:4,borderLeftColor:{gold:T.colours.gold,red:T.colours.red,amber:T.colours.amber,ok:T.colours.ok,blue:T.colours.blue}[t.tone]},children:[(0,oe.jsxs)(f.T,{weight:"semibold",children:[t.icon," ",t.title]}),(0,oe.jsx)(f.Muted,{children:t.body}),t.action?(0,oe.jsx)(f.Button,{small:!0,kind:"ghost",label:`${t.action.label} \u2192`,onPress:()=>e(t.action.tab,t.action.sub??null),style:{alignSelf:'flex-start'}}):null]})},t.id)),(0,oe.jsx)(f.Button,{small:!0,kind:"secondary",label:"All insights",onPress:()=>e('more','insights')})]}):null,qe?(0,oe.jsx)(f.Button,{testID:"home-takings-button",kind:Xe?'secondary':'primary',label:Xe?'Hide takings':'Takings',accessibilityLabel:Xe?'Hide takings':'Takings: this month by day, from confirmed cash ups',onPress:()=>Ze(e=>!e),style:{minHeight:56}}):null,qe&&Xe?(0,oe.jsx)(E.FadeIn,{children:(0,oe.jsx)(ce,{rid:n,today:ne})}):null,(0,oe.jsx)(te.SoldOutSheet,{visible:Ve,onClose:()=>Qe(!1),rid:n,by:Je,hideLinks:!0,testID:"home-soldout-sheet"})]})},_e.monthAxisDays=de,_e.MonthTakingsCard=ce,_e.WalkInSplitCard=he;var t=_r(_d[0]),s=_r(_d[1]),o=_r(_d[2]),l=_r(_d[3]),a=_r(_d[4]),n=e(a),i=_r(_d[5]),r=_r(_d[6]),d=_r(_d[7]),c=_r(_d[8]),u=_r(_d[9]),h=_r(_d[10]),y=_r(_d[11]),x=e(_r(_d[12])),m=e(_r(_d[13])),b=e(_r(_d[14])),f=_r(_d[15]),p=_r(_d[16]),j=_r(_d[17]),k=_r(_d[18]),w=_r(_d[19]),$=_r(_d[20]),v=_r(_d[21]),I=_r(_d[22]),C=_r(_d[23]),D=_r(_d[24]),T=_r(_d[25]),B=_r(_d[26]),A=_r(_d[27]),L=_r(_d[28]),M=_r(_d[29]),S=_r(_d[30]),N=_r(_d[31]),P=_r(_d[32]),F=_r(_d[33]),W=_r(_d[34]),H=_r(_d[35]),R=_r(_d[36]),O=_r(_d[37]),z=_r(_d[38]),E=_r(_d[39]),G=_r(_d[40]),U=_r(_d[41]),_=_r(_d[42]),q=_r(_d[43]),Y=_r(_d[44]),K=_r(_d[45]),V=_r(_d[46]),Q=_r(_d[47]),X=_r(_d[48]),Z=_r(_d[49]),J=_r(_d[50]),ee=_r(_d[51]),te=_r(_d[52]),se=_r(_d[53]),oe=_r(_d[54]);const le=18,ae=18,ne=150,ie=34;function re(e){if(!e.length)return'';if(1===e.length)return`M${e[0].x.toFixed(1)},${e[0].y.toFixed(1)}`;const t=e.length,s=[],o=[];for(let o=0;o9){const n=3/Math.sqrt(a);o[e]=n*t*s[e],o[e+1]=n*l*s[e]}}let l=`M${e[0].x.toFixed(1)},${e[0].y.toFixed(1)}`;for(let s=0;sle+(t-1)/Math.max(1,e-1)*s,l=[1,5,10,15,20,25].filter(t=>t=36)&&a.push(e);for(;a.length&&o(e)-o(a[a.length-1])<36;)a.pop();return[...a,e]}function ce({rid:e,today:t}){const s=(0,N.useCashUp)(e=>e.cashUps),[o,i]=(0,l.useState)(t.slice(0,7)),[r,d]=(0,l.useState)(0),[c,u]=(0,l.useState)(null),h=(0,l.useMemo)(()=>(0,P.monthTakings)(s,e,o,t),[s,e,o,t]),y=(0,l.useMemo)(()=>(0,P.firstTakingsMonth)(s,e),[s,e]),p=!!y&&yle+(e-1)/Math.max(1,k-1)*w,C=e=>$-e/v*128,D=[];h.days.forEach((e,t)=>{if('recorded'!==e.state)return;const s={x:I(e.day),y:C(e.value)};t&&'recorded'===h.days[t-1].state?D[D.length-1].push(s):D.push([s])});const B=h.days.filter(e=>'future'!==e.state),A=[...h.days].reverse().find(e=>'recorded'===e.state),L=h.days.find(e=>e.date===c&&'future'!==e.state)??(h.current?h.days.find(e=>e.date===t):void 0)??A??B[B.length-1],M=e=>{const t=B.findIndex(e=>e.date===L?.date),s=B[Math.max(0,Math.min(B.length-1,t+e))];s&&(u(s.date),x.default.announceForAccessibility?.(S(s)))},S=e=>`${(0,P.longDay)(e.date)}, ${'recorded'===e.state?(0,P.poundsWhole)(e.value):'pending'===e.state?'not cashed up yet':'no cash up'}`,W=h.current?`so far in ${h.month}`:`in ${h.month} ${o.slice(0,4)}`,H=null==h.vsPct?null:`vs ${h.current?'same point last month':(0,P.monthName)((0,P.addMonths)(o,-1))} ${h.vsPct>0?'+':''}${h.vsPct}%`,R=h.recorded?`Takings ${h.current?'this month':`${h.month} ${o.slice(0,4)}`}. ${(0,P.poundsWhole)(h.total)} ${W}, from ${h.recorded} cash up${1===h.recorded?'':'s'}. Best day ${(0,P.longDay)(h.best.date)}, ${(0,P.poundsWhole)(h.best.value)}.${H?` ${H.replace('+','up ').replace(/ -(\d)/,' down $1')}.`:''}`:`Takings ${h.current?'this month':`${h.month} ${o.slice(0,4)}`}. No cash-ups yet${h.current?' this month':''}.`,O=r?de(k,r):[],z=(e,t,s,l,a)=>(0,oe.jsx)(m.default,{testID:a,accessibilityRole:"button",accessibilityLabel:t,accessibilityState:{disabled:!s},disabled:!s,onPress:()=>{i((0,P.addMonths)(o,l)),u(null)},style:({pressed:e})=>({minWidth:48,minHeight:48,alignItems:'center',justifyContent:'center',borderRadius:24,opacity:s?e?.6:1:.25}),children:(0,oe.jsx)(f.T,{size:24,colour:T.colours.gold,center:!0,children:e})});return(0,oe.jsx)(f.Card,{highlight:T.colours.gold,style:{alignItems:'center',gap:6},children:(0,oe.jsxs)(b.default,{testID:"home-month-takings",style:{width:'100%',alignItems:'center',gap:6,minWidth:0},children:[(0,oe.jsxs)(f.T,{weight:"semibold",colour:T.colours.gold,center:!0,accessibilityRole:"header",children:["Takings ",h.current?'this month':'by month']}),p||j?(0,oe.jsxs)(b.default,{style:{flexDirection:'row',alignItems:'center',justifyContent:'center',gap:4,width:'100%'},children:[z('\u2039',`Previous month, ${(0,P.monthName)((0,P.addMonths)(o,-1))}`,p,-1,'mt-prev'),(0,oe.jsxs)(f.T,{center:!0,colour:T.colours.goldLight,style:{flexShrink:1},testID:"mt-month",children:[h.month," ",o.slice(0,4)]}),z('\u203a',`Next month, ${(0,P.monthName)((0,P.addMonths)(o,1))}`,j,1,'mt-next')]}):null,(0,oe.jsx)(b.default,{accessible:!0,accessibilityLabel:R,testID:"mt-summary",style:{alignItems:'center',width:'100%',gap:2},children:h.recorded?(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(f.T,{size:38,weight:"bold",colour:T.colours.gold,center:!0,testID:"mt-total",children:(0,P.poundsWhole)(h.total)}),(0,oe.jsx)(f.T,{center:!0,colour:T.colours.goldLight,children:W}),(0,oe.jsxs)(f.Muted,{center:!0,testID:"mt-best",children:["Best day: ",(0,P.shortDay)(h.best.date)," \xb7 ",(0,P.poundsWhole)(h.best.value)]}),H?(0,oe.jsx)(f.Muted,{center:!0,testID:"mt-vs",children:H}):null]}):(0,oe.jsx)(f.Muted,{center:!0,testID:"mt-empty",children:h.current?'No cash-ups yet this month.':`No cash-ups in ${h.month}.`})}),(0,oe.jsxs)(b.default,{style:{width:'100%',minWidth:0},children:[(0,oe.jsxs)(b.default,{testID:"mt-plot",onLayout:e=>d(e.nativeEvent.layout.width),style:{height:ne,width:'100%',overflow:'visible'},children:[r?(0,oe.jsxs)(n.default,{width:r,height:ne,accessibilityElementsHidden:!0,importantForAccessibility:"no-hide-descendants",children:[(0,oe.jsx)(a.Defs,{children:(0,oe.jsxs)(a.LinearGradient,{id:"mtFill",x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,oe.jsx)(a.Stop,{offset:"0",stopColor:"#3A2F1E",stopOpacity:1}),(0,oe.jsx)(a.Stop,{offset:"1",stopColor:"#3A2F1E",stopOpacity:.35})]})}),(0,oe.jsx)(a.Line,{x1:le,y1:$,x2:r-ae,y2:$,stroke:T.colours.hairline,strokeWidth:1}),D.filter(e=>e.length>1).map((e,t)=>(0,oe.jsx)(a.Path,{d:`${re(e)} L${e[e.length-1].x.toFixed(1)},142 L${e[0].x.toFixed(1)},142 Z`,fill:"url(#mtFill)",stroke:"none"},`a${t}`)),D.filter(e=>e.length>1).map((e,t)=>(0,oe.jsx)(a.Path,{d:re(e),stroke:T.colours.gold,strokeWidth:2.5,fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},`l${t}`)),D.filter(e=>1===e.length).map((e,t)=>(0,oe.jsx)(a.Circle,{cx:e[0].x,cy:e[0].y,r:3,fill:T.colours.gold},`s${t}`)),h.days.filter(e=>'missing'===e.state).map(e=>(0,oe.jsx)(a.Circle,{cx:I(e.day),cy:$,r:2,fill:"none",stroke:T.colours.muted,strokeWidth:1},e.date)),L&&'recorded'===L.state?(0,oe.jsx)(a.Line,{x1:I(L.day),y1:10,x2:I(L.day),y2:$,stroke:T.colours.goldMuted,strokeWidth:1,strokeDasharray:"3,3"}):null,h.current?(()=>{const e=h.days.find(e=>e.date===t);return(0,oe.jsx)(a.Circle,{cx:I(e.day),cy:'recorded'===e.state?C(e.value):$,r:4.5,fill:T.colours.gold,stroke:T.colours.surface,strokeWidth:1.5})})():null,L&&'recorded'===L.state&&L.date!==t?(0,oe.jsx)(a.Circle,{cx:I(L.day),cy:C(L.value),r:5,fill:T.colours.surface,stroke:T.colours.gold,strokeWidth:2}):null]}):null,r?B.map(e=>(0,oe.jsx)(m.default,{testID:`mt-day-${e.day}`,accessibilityRole:"button",accessibilityLabel:S(e),accessibilityState:{selected:L?.date===e.date},onPress:()=>u(e.date),style:{position:'absolute',top:0,height:ne,left:I(e.day)-w/Math.max(1,k-1)/2,width:w/Math.max(1,k-1)}},e.date)):null]}),(0,oe.jsx)(b.default,{testID:"mt-axis",style:{height:F.AXIS_BAND+6,minHeight:F.AXIS_BAND+6,width:'100%',position:'relative',overflow:'visible'},accessibilityElementsHidden:!0,importantForAccessibility:"no-hide-descendants",children:O.map(e=>(0,oe.jsx)(f.T,{size:F.AXIS_FONT,colour:T.colours.muted,style:{position:'absolute',left:I(e)-17,width:ie,top:0,textAlign:'center'},children:String(e)},e))})]}),L&&B.length?(0,oe.jsxs)(b.default,{style:{flexDirection:'row',alignItems:'center',justifyContent:'center',width:'100%',gap:4},children:[(0,oe.jsx)(m.default,{testID:"mt-day-prev",accessibilityRole:"button",accessibilityLabel:"Previous day",disabled:B[0]?.date===L.date,onPress:()=>M(-1),style:({pressed:e})=>({minWidth:48,minHeight:48,alignItems:'center',justifyContent:'center',opacity:B[0]?.date===L.date?.25:e?.6:1}),children:(0,oe.jsx)(f.T,{size:20,colour:T.colours.gold,center:!0,children:"\u2039"})}),(0,oe.jsxs)(b.default,{testID:"mt-readout",accessible:!0,accessibilityLiveRegion:"polite",accessibilityLabel:S(L),style:{flexShrink:1,minWidth:0,alignItems:'center',paddingVertical:4},children:[(0,oe.jsx)(f.Muted,{center:!0,children:L.date===t?`Today \xb7 ${(0,P.shortDay)(L.date)}`:(0,P.shortDay)(L.date)}),(0,oe.jsx)(f.T,{center:!0,size:20,weight:"semibold",colour:'recorded'===L.state?T.colours.goldLight:T.colours.muted,children:'recorded'===L.state?(0,P.poundsWhole)(L.value):'pending'===L.state?'Not cashed up yet':'No cash-up'})]}),(0,oe.jsx)(m.default,{testID:"mt-day-next",accessibilityRole:"button",accessibilityLabel:"Next day",disabled:B[B.length-1]?.date===L.date,onPress:()=>M(1),style:({pressed:e})=>({minWidth:48,minHeight:48,alignItems:'center',justifyContent:'center',opacity:B[B.length-1]?.date===L.date?.25:e?.6:1}),children:(0,oe.jsx)(f.T,{size:20,colour:T.colours.gold,center:!0,children:"\u203a"})})]}):null,(0,oe.jsx)(f.Muted,{center:!0,size:13,children:"From confirmed cash ups: gross takings, or card + cash. \u25cb = no cash up that day."})]})})}const ue='#3A2F1E';function he({split:e}){return(0,oe.jsx)(f.Card,{style:{alignItems:'center',gap:8},children:(0,oe.jsxs)(b.default,{testID:"home-covers-split",accessible:!0,accessibilityLabel:`Walk-ins and bookings today. ${e.a11y}`,style:{width:'100%',alignItems:'center',gap:8},children:[(0,oe.jsx)(f.T,{weight:"semibold",colour:T.colours.gold,center:!0,children:"Walk-ins and bookings today"}),e.empty?(0,oe.jsx)(f.Muted,{center:!0,children:"No Covers yet"}):(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsxs)(b.default,{style:{flexDirection:'row',flexWrap:'wrap',justifyContent:'center',gap:18,width:'100%'},children:[(0,oe.jsxs)(b.default,{style:{alignItems:'center',minWidth:120},children:[(0,oe.jsx)(f.T,{size:26,weight:"bold",colour:T.colours.gold,center:!0,testID:"split-walkin-pct",children:`${e.walkInPct}%`}),(0,oe.jsx)(f.T,{size:14,colour:T.colours.goldLight,center:!0,children:`Walk-ins \xb7 ${e.walkIns} Covers`})]}),(0,oe.jsxs)(b.default,{style:{alignItems:'center',minWidth:120},children:[(0,oe.jsx)(f.T,{size:26,weight:"bold",center:!0,testID:"split-booked-pct",children:`${e.bookingPct}%`}),(0,oe.jsx)(f.T,{size:14,colour:T.colours.muted,center:!0,children:`Booked \xb7 ${e.bookings} Covers`})]})]}),(0,oe.jsxs)(b.default,{style:{width:'100%',maxWidth:420,height:10,borderRadius:5,overflow:'hidden',flexDirection:'row',backgroundColor:ue,borderWidth:1,borderColor:T.colours.gold},children:[(0,oe.jsx)(b.default,{style:{width:`${e.walkInPct}%`,backgroundColor:T.colours.gold}}),(0,oe.jsx)(b.default,{style:{flex:1,backgroundColor:ue}})]})]})]})})}},1417,[843,1137,1418,17,780,1179,1072,1073,1410,1330,861,1076,264,385,85,777,858,876,1204,1187,845,1154,863,1053,866,804,1178,1055,1136,1141,1142,1006,839,1146,886,946,961,1428,1429,1145,1430,1156,853,1433,1182,1202,1201,1029,1030,1064,1094,1384,1149,1329,8]); -__d(function(_g,_r,_i,_a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.AdvancedSettings=function({go:e}){const{r:x,rid:P,today:O,me:z}=(0,R.useCtx)(6e4),V=z.replace(" (example)",""),J=x.settings,X=e=>v.useStore.getState().updateSettings(P,e),[ee,te]=(0,m.useState)(()=>(0,h.takeAdvancedPrefill)()),[oe,ae]=(0,m.useState)(null),ne=e=>{if(e.onReset)return e.onReset(),void ae(`${e.title}: back to the defaults.`);X(Object.fromEntries(e.reset.map(e=>[e,void 0]))),ae(`${e.title}: back to the defaults.`)},le=(0,M.useBookings)(P),re=(0,W.jsxs)(y.default,{style:{gap:8},children:[(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(j.T,{style:{flex:1},children:"Ask about allergies first (in red)"}),(0,W.jsx)(j.Badge,{kind:"red",label:"ALWAYS ON"})]}),(0,W.jsx)(j.Muted,{size:13,children:"Food safety: every booking answers this before anything else, and staff tick \u201cAllergens seen\u201d."}),(0,W.jsx)(j.Toggle,{label:"Ask if they\u2019re bringing a dog",value:(0,T.dogQuestionOn)(x),onChange:e=>X({dogQuestion:e})}),(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(j.T,{style:{flex:1},children:"Most dogs per booking time"}),(0,W.jsx)(K,{label:"dogs per time",step:1,min:0,max:20,value:J.maxDogsPerSlot??0,unit:e=>e?`${e} dog${1===e?'':'s'}`:'No limit',onChange:e=>X({maxDogsPerSlot:e||void 0})})]}),(0,W.jsx)(j.Toggle,{label:"Ask about wheelchair or step-free access",value:(0,T.accessQuestionOn)(x),onChange:e=>X({accessQuestion:e})}),(0,W.jsx)(j.Toggle,{label:"Vegan and vegetarian ticks (optional for guests)",value:(0,T.dietQuestionOn)(x),onChange:e=>X({dietQuestion:e})}),(0,W.jsx)(j.Toggle,{label:"Let guests ask for a table (shown as \u2018not guaranteed\u2019)",value:!1!==J.tableRequests,onChange:e=>X({tableRequests:e})}),(0,W.jsx)(j.Muted,{size:13,children:"Dog-friendly and step-free tables are marked on the table plan."}),e?(0,W.jsx)(j.Button,{small:!0,kind:"ghost",label:"Mark tables on the Table plan \u203a",onPress:()=>e('more','tableplan')}):null]}),ie=(0,T.dwellBands)(x),de=(e,s)=>X({dwellBands:ie.map((t,o)=>o===e?{...t,mins:s}:t)}),he=(0,W.jsxs)(y.default,{style:{gap:8},children:[(0,W.jsx)(j.Muted,{size:13,children:"How long a table usually stays, by party size. Used for \u201cNext table free\u201d and for spacing bookings on a table."}),ie.map((e,s)=>{const t=(0,T.dwellFor)(x,9999===e.upTo?20:e.upTo,le);return(0,W.jsxs)(y.default,{style:{gap:2},children:[(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(j.T,{style:{flex:1},children:(0,T.bandLabel)(ie,s)}),(0,W.jsx)(K,{label:`table time for ${(0,T.bandLabel)(ie,s)}`,min:30,max:360,value:e.mins,unit:Q,onChange:e=>de(s,e)})]}),t.learned&&t.mins!==e.mins?(0,W.jsxs)(j.Muted,{size:12,children:["From your last ",t.samples," tables: about ",Q(t.mins)," (used for estimates)"]}):null]},s)}),(0,W.jsx)(j.Toggle,{label:"Fine-tune from how long tables really stay",value:!1!==J.dwellLearn,onChange:e=>X({dwellLearn:e})}),(0,W.jsx)(j.Muted,{size:13,children:"Defaults: 90 min for 1\u20132 Covers, 105 min for 3\u20135, 2 hours for 6\u201319, 3 hours for 20 or more."})]}),ue=J.reservables??(0,S.reservablesOf)(x),ce=J.reservables??('anchorage'===P?ue:[]),pe=(e,s)=>X({reservables:ce.map(t=>t.id===e?{...t,...s}:t)}),ge=(0,W.jsxs)(y.default,{style:{gap:8},children:[ce.length?ce.map(e=>(0,W.jsxs)(y.default,{style:{gap:4},children:[(0,W.jsx)(j.Toggle,{label:`${e.name} can be reserved`,value:e.active,onChange:s=>pe(e.id,{active:s})}),(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(j.Muted,{children:"Price"}),(0,W.jsx)(K,{label:`${e.name} price`,min:5,max:1e3,value:Math.round(e.price/100),unit:e=>`\xa3${e}`,onChange:s=>pe(e.id,{price:100*s})})]}),(0,W.jsxs)(j.Muted,{size:12,children:["Uses: ",e.uses.map(e=>`${e.qty} ${e.key}`).join(' + ')," from the counted stock. Held from the Display count and shown as \u201cReserved\u201d."]})]},e.id)):(0,W.jsx)(j.Muted,{children:"No reservable dishes yet."}),(0,W.jsx)(j.Toggle,{label:"Guests can reserve a crab or lobster on its own",value:!1!==J.reserveStock,onChange:e=>X({reserveStock:e})}),(0,W.jsx)(j.Muted,{size:13,children:"The kitchen is told about each reservation and the Head Chef taps OK."})]}),be=(0,T.regularEventsOf)(x),[me,xe]=(0,m.useState)(null),fe=e=>X({regularEvents:e}),ye=me?me.name.trim()?me.time&&!H.test(me.time)?'Start time looks wrong (use 20:00).':me.lastFood&&!H.test(me.lastFood)?'Last food orders looks wrong (use 19:00).':'once'!==me.rule.kind||_.test(me.rule.date)?'':'Date looks wrong (use 2026-12-31).':'Give it a name.':'',je=(0,W.jsxs)(y.default,{style:{gap:8},children:[be.map(e=>(0,W.jsxs)(j.Card,{children:[(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(j.T,{weight:"semibold",style:{flex:1},children:e.name}),e.busier?(0,W.jsx)(j.Badge,{kind:"gold",label:"BUSIER"}):null,e.active?null:(0,W.jsx)(j.Badge,{kind:"neutral",label:"OFF"})]}),(0,W.jsxs)(j.Muted,{children:[(0,T.ruleText)(e.rule),e.time?` \xb7 from ${e.time}`:'',e.lastFood?` \xb7 last food orders ${e.lastFood}`:'']}),e.active?(0,W.jsxs)(j.Muted,{size:12,children:["Next: ",(0,T.nextOccurrence)(e,O)??'\u2014']}):null,(0,W.jsxs)(j.Row,{gap:6,children:[(0,W.jsx)(j.Button,{small:!0,kind:"secondary",label:"Edit",testID:`event-edit-${e.id}`,onPress:()=>xe({...e})}),(0,W.jsx)(j.Button,{small:!0,kind:"ghost",label:"Remove",onPress:()=>fe(be.filter(s=>s.id!==e.id))})]})]},e.id)),me?(0,W.jsxs)(j.Card,{highlight:D.colours.gold,children:[(0,W.jsxs)(j.Row,{gap:8,style:{flexWrap:'wrap'},children:[(0,W.jsx)(j.Muted,{children:"Name"}),(0,W.jsx)(q,{label:"Event name",width:220,value:me.name,onChange:e=>xe({...me,name:e}),placeholder:"Open Mic Night"})]}),(0,W.jsx)(j.Muted,{children:"Repeats"}),(0,W.jsxs)(j.Row,{wrap:!0,gap:6,children:[(0,W.jsx)(j.Chip,{label:"Last \u2026 of the month",selected:'last'===me.rule.kind,onPress:()=>xe({...me,rule:{kind:'last',weekday:'weekday'in me.rule?me.rule.weekday:0}})}),(0,W.jsx)(j.Chip,{label:"Every week",selected:'weekly'===me.rule.kind,onPress:()=>xe({...me,rule:{kind:'weekly',weekday:'weekday'in me.rule?me.rule.weekday:0}})}),(0,W.jsx)(j.Chip,{label:"One-off date",selected:'once'===me.rule.kind,onPress:()=>xe({...me,rule:{kind:'once',date:O}})})]}),'weekday'in me.rule?(0,W.jsx)(j.Row,{wrap:!0,gap:6,children:Y.map(e=>(0,W.jsx)(j.Chip,{label:G[e],selected:me.rule.weekday===e,onPress:()=>xe({...me,rule:{...me.rule,weekday:e}})},e))}):(0,W.jsxs)(j.Row,{gap:8,children:[(0,W.jsx)(j.Muted,{children:"Date (DD/MM/YYYY)"}),(0,W.jsx)(q,{label:"Event date",width:130,value:(0,t.slashDay)(me.rule.date),onChange:e=>{const s=(0,t.slashDate)(e,(0,t.slashDay)(me.rule.date));xe({...me,rule:{kind:'once',date:(0,t.dayFromSlash)(s)??s}})},placeholder:"31/12/2026"})]}),(0,W.jsxs)(j.Row,{gap:8,style:{flexWrap:'wrap'},children:[(0,W.jsx)(j.Muted,{children:"Starts (optional)"}),(0,W.jsx)(q,{label:"Start time",value:me.time??'',onChange:e=>xe({...me,time:e||void 0}),placeholder:"20:00",bad:!!me.time&&!H.test(me.time)})]}),(0,W.jsxs)(j.Row,{gap:8,style:{flexWrap:'wrap'},children:[(0,W.jsx)(j.Muted,{children:"Last food orders (optional)"}),(0,W.jsx)(q,{label:"Last food orders",value:me.lastFood??'',onChange:e=>xe({...me,lastFood:e||void 0}),placeholder:"19:00",bad:!!me.lastFood&&!H.test(me.lastFood)})]}),(0,W.jsxs)(j.Row,{gap:8,style:{flexWrap:'wrap'},children:[(0,W.jsx)(j.Muted,{children:"Notes"}),(0,W.jsx)(q,{label:"Notes",width:240,value:me.notes??'',onChange:e=>xe({...me,notes:e||void 0}),placeholder:"Live music from 8pm"})]}),(0,W.jsx)(j.Toggle,{label:"Expect busier (raises the forecast)",value:me.busier,onChange:e=>xe({...me,busier:e})}),(0,W.jsx)(j.Toggle,{label:"On",value:me.active,onChange:e=>xe({...me,active:e})}),ye?(0,W.jsx)(j.T,{size:13,colour:D.colours.red,children:ye}):null,(0,W.jsxs)(j.Row,{gap:6,children:[(0,W.jsx)(j.Button,{small:!0,label:"Save event",disabled:!!ye,testID:"event-save",onPress:()=>{const e={...me,name:me.name.trim()};fe(be.some(s=>s.id===e.id)?be.map(s=>s.id===e.id?e:s):[...be,e]),xe(null),ae(`Saved ${e.name}.`)}}),(0,W.jsx)(j.Button,{small:!0,kind:"ghost",label:"Cancel",onPress:()=>xe(null)})]})]}):(0,W.jsx)(j.Button,{small:!0,kind:"secondary",label:"\uff0b Add a regular event",testID:"event-add",onPress:()=>xe({id:`ev-${Date.now().toString(36)}`,name:'',rule:{kind:'last',weekday:0},busier:!0,active:!0})}),(0,W.jsx)(j.Muted,{size:13,children:"Events show in Forecast key dates (with a Promote button), on the Today date bar, and lift the forecast when \u201cExpect busier\u201d is on."})]}),we=(0,C.hourSetsOf)(x),ke=(0,C.seasonOn)(x,new Date),[ve,Ce]=(0,m.useState)(null),[Se,Te]=(0,m.useState)(null),De=J.hourOverrides??[],Re=ve?ve.start&&!U.test(ve.start)?'Start date looks wrong (use day and month as MM-DD, e.g. 04-01 for 1 April).':ve.hours&&Object.values(ve.hours).some(e=>e&&(!H.test(e[0])||!H.test(e[1])||e[0]>=e[1]))?'Check the times: use 12:00 and 19:00, and closing must be after opening.':'':'',Me=Object.values(J.lastFoodByDay??{}).some(e=>e&&!H.test(e)),Le=[];we.some(e=>!e.hours)&&Le.push(`${we.filter(e=>!e.hours).map(e=>e.name).join(' and ')} kitchen hours`);we.filter(e=>e.hours).length>=1&&we.length>1&&we.some(e=>!e.start)&&Le.push('the date each season starts');const Pe=(0,W.jsxs)(y.default,{style:{gap:8},children:[(0,W.jsx)(j.Muted,{size:13,children:"Kitchen (food) hours, not bar hours. The closing time is last food orders. Dining bookings are only offered inside these hours."}),Le.length?(0,W.jsxs)(j.Banner,{kind:"warn",title:"To finish setting up",children:["Please add ",Le.join(' and '),". Until then the app uses ",ke?.name??'your weekly'," hours all year."]}):null,ke?(0,W.jsxs)(j.T,{colour:D.colours.goldLight,children:["In use today: ",ke.name]}):null,we.map(e=>(0,W.jsxs)(j.Card,{children:[(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(j.T,{weight:"semibold",children:e.name}),ke?.id===e.id?(0,W.jsx)(j.Badge,{kind:"gold",label:"IN USE"}):e.hours?null:(0,W.jsx)(j.Badge,{kind:"amber",label:"NOT SET"})]}),(0,W.jsx)(j.Muted,{children:e.start?`Starts every year on ${e.start}`:'Start date: not set yet'}),e.hours?(0,W.jsx)(j.Muted,{size:13,children:Y.map(s=>`${G[s]} ${e.hours[s]?`${e.hours[s][0]}\u2013${e.hours[s][1]}`:'closed'}`).join(' \xb7 ')}):(0,W.jsx)(j.Muted,{size:13,children:"No hours yet."}),(0,W.jsx)(j.Button,{small:!0,kind:"secondary",label:e.hours?'Edit':`Set ${e.name} hours`,testID:`season-edit-${e.id}`,onPress:()=>Ce({...e,hours:e.hours?{...e.hours}:{...we.find(e=>e.hours)?.hours??x.kitchenHours}})})]},e.id)),ve?(0,W.jsxs)(j.Card,{highlight:D.colours.gold,children:[(0,W.jsxs)(j.T,{weight:"semibold",children:[ve.name," hours"]}),(0,W.jsxs)(j.Row,{gap:8,style:{flexWrap:'wrap'},children:[(0,W.jsx)(j.Muted,{children:"Starts every year on (MM-DD)"}),(0,W.jsx)(q,{label:"Season start date",value:ve.start??'',onChange:e=>Ce({...ve,start:e||void 0}),placeholder:"04-01",bad:!!ve.start&&!U.test(ve.start)})]}),Y.map(e=>{const s=ve.hours?.[e]??null,t=s=>Ce({...ve,hours:{...ve.hours,[e]:s}});return(0,W.jsxs)(j.Row,{gap:6,style:{flexWrap:'wrap'},children:[(0,W.jsx)(j.T,{style:{width:44},children:G[e]}),(0,W.jsx)(j.Chip,{label:s?'Open':'Closed',selected:!!s,onPress:()=>t(s?null:['12:00','19:00'])}),s?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(q,{label:`${T.DAYS[e]} opens`,value:s[0],width:74,onChange:e=>t([e,s[1]]),bad:!H.test(s[0])}),(0,W.jsx)(j.Muted,{children:"to"}),(0,W.jsx)(q,{label:`${T.DAYS[e]} last food orders`,value:s[1],width:74,onChange:e=>t([s[0],e]),bad:!H.test(s[1])||s[0]>=s[1]})]}):null]},e)}),Re?(0,W.jsx)(j.T,{size:13,colour:D.colours.red,children:Re}):null,(0,W.jsxs)(j.Row,{gap:6,children:[(0,W.jsx)(j.Button,{small:!0,label:"Save hours",disabled:!!Re,testID:"season-save",onPress:()=>{var e;e=we.map(e=>e.id===ve.id?ve:e),X({hourSets:e}),Ce(null),ae(`Saved ${ve.name} hours.`)}}),(0,W.jsx)(j.Button,{small:!0,kind:"ghost",label:"Cancel",onPress:()=>Ce(null)})]})]}):null,(0,W.jsx)(j.T,{weight:"semibold",style:{marginTop:6},children:"Special days"}),(0,W.jsx)(j.Muted,{size:13,children:"One-off changes, e.g. closed for a private party or open late on Hogmanay."}),De.map(e=>(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsxs)(j.T,{style:{flex:1},children:[e.date,": ",e.hours?`${e.hours[0]}\u2013${e.hours[1]}`:'kitchen closed',e.note?` \xb7 ${e.note}`:'']}),(0,W.jsx)(j.Button,{small:!0,kind:"ghost",label:"Remove",onPress:()=>X({hourOverrides:De.filter(s=>s.date!==e.date)})})]},e.date)),Se?(0,W.jsxs)(j.Card,{highlight:D.colours.gold,children:[(0,W.jsxs)(j.Row,{gap:8,children:[(0,W.jsx)(j.Muted,{children:"Date (DD/MM/YYYY)"}),(0,W.jsx)(q,{label:"Special day date",width:130,value:(0,t.slashDay)(Se.date),onChange:e=>{const s=(0,t.slashDate)(e,(0,t.slashDay)(Se.date));Te({...Se,date:(0,t.dayFromSlash)(s)??s})},placeholder:"31/12/2026",bad:!_.test(Se.date)})]}),(0,W.jsxs)(j.Row,{gap:6,style:{flexWrap:'wrap'},children:[(0,W.jsx)(j.Chip,{label:Se.hours?'Open':'Closed',selected:!!Se.hours,onPress:()=>Te({...Se,hours:Se.hours?null:['12:00','19:00']})}),Se.hours?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(q,{label:"Opens",width:74,value:Se.hours[0],onChange:e=>Te({...Se,hours:[e,Se.hours[1]]})}),(0,W.jsx)(j.Muted,{children:"to"}),(0,W.jsx)(q,{label:"Last food orders",width:74,value:Se.hours[1],onChange:e=>Te({...Se,hours:[Se.hours[0],e]})})]}):null]}),(0,W.jsxs)(j.Row,{gap:8,children:[(0,W.jsx)(j.Muted,{children:"Note"}),(0,W.jsx)(q,{label:"Note",width:220,value:Se.note??'',onChange:e=>Te({...Se,note:e||void 0}),placeholder:"Private party"})]}),(()=>{const e=_.test(Se.date)?Se.hours&&(!H.test(Se.hours[0])||!H.test(Se.hours[1])||Se.hours[0]>=Se.hours[1])?'Check the times.':'':'Date looks wrong (use 2026-12-31).';return(0,W.jsxs)(W.Fragment,{children:[e?(0,W.jsx)(j.T,{size:13,colour:D.colours.red,children:e}):null,(0,W.jsxs)(j.Row,{gap:6,children:[(0,W.jsx)(j.Button,{small:!0,label:"Save special day",disabled:!!e,onPress:()=>{X({hourOverrides:[...De.filter(e=>e.date!==Se.date),Se].sort((e,s)=>e.date.localeCompare(s.date))}),Te(null)}}),(0,W.jsx)(j.Button,{small:!0,kind:"ghost",label:"Cancel",onPress:()=>Te(null)})]})]})})()]}):(0,W.jsx)(j.Button,{small:!0,kind:"secondary",label:"\uff0b Add a special day",testID:"override-add",onPress:()=>Te({date:O,hours:null})}),(0,W.jsx)(j.T,{weight:"semibold",style:{marginTop:6},children:"Earlier last food orders (optional)"}),(0,W.jsx)(j.Muted,{size:13,children:"Leave blank to use the kitchen closing time. Regular events can set their own (Open Mic Night: 7pm)."}),(0,W.jsx)(j.Row,{wrap:!0,gap:8,children:Y.map(e=>(0,W.jsxs)(y.default,{style:{gap:2},children:[(0,W.jsx)(j.Muted,{size:12,children:G[e]}),(0,W.jsx)(q,{label:`${T.DAYS[e]} last food orders`,width:74,value:J.lastFoodByDay?.[e]??'',placeholder:"\u2014",bad:!!J.lastFoodByDay?.[e]&&!H.test(J.lastFoodByDay[e]),onChange:s=>X({lastFoodByDay:{...J.lastFoodByDay??{},[e]:s||void 0}})})]},e))}),Me?(0,W.jsx)(j.T,{size:13,colour:D.colours.red,children:"Use times like 19:00 (blank = kitchen close)."}):null,(0,W.jsx)(j.Muted,{children:"After last food orders, booking times are\u2026"}),(0,W.jsxs)(j.Row,{gap:6,children:[(0,W.jsx)(j.Chip,{label:"Offered for drinks only",selected:'drinks'===(0,T.afterLastFood)(x),onPress:()=>X({afterLastFood:'drinks'})}),(0,W.jsx)(j.Chip,{label:"Not offered",selected:'block'===(0,T.afterLastFood)(x),onPress:()=>X({afterLastFood:'block'})})]})]}),Oe=(0,W.jsxs)(y.default,{style:{gap:8},children:[(0,W.jsx)(j.Toggle,{label:"COVERS counter on Today (done / to come / total)",value:(0,T.coversCounterOn)(x),onChange:e=>X({coversCounter:e})}),(0,W.jsx)(j.Toggle,{label:"\u2018Next table free\u2019 when you\u2019re full",value:(0,T.nextTableOn)(x),onChange:e=>X({nextTableFree:e})}),(0,W.jsx)(j.Toggle,{label:"Show takeaway on home screens",value:(0,T.showTakeaway)(x),onChange:e=>X({showTakeaway:e})}),(0,W.jsx)(j.Muted,{size:13,children:"Takeaway order alerts always work. With this off, takeaway figures sit in a collapsed Takeaway section."}),(0,W.jsx)(j.Muted,{size:13,children:"The flap click sound is set on each Display (Display settings), off by default."})]}),ze=(0,W.jsxs)(y.default,{style:{gap:8},children:[(0,W.jsx)(j.Toggle,{label:"Show full gov.uk names, e.g. \u2018(substitute day)\u2019",value:!!J.holidayFullNames,onChange:e=>X({holidayFullNames:e})}),(0,W.jsx)(j.Muted,{size:13,children:"Off: \u201cChristmas Day\u201d shows on its date without \u201c(substitute day)\u201d."})]}),[Ie,$e]=(0,m.useState)(null),Ae=Ie??J.whatsapp??'',Be=!Ae.trim()||!!(0,L.waNumber)(Ae),Fe=(0,W.jsxs)(y.default,{style:{gap:8},children:[(0,W.jsx)(j.T,{children:"The venue\u2019s WhatsApp number"}),(0,W.jsxs)(j.Row,{gap:8,wrap:!0,children:[(0,W.jsx)(q,{label:"Venue WhatsApp number",testID:"adv-whatsapp-number",width:220,value:Ae,placeholder:"e.g. 01292 500123 or +44 7\u2026",bad:!Be,onChange:e=>{$e(e),e.trim()?(0,L.waNumber)(e)&&X({whatsapp:e.trim()}):X({whatsapp:void 0})}}),Ae.trim()&&Be?(0,W.jsx)(j.Badge,{kind:"gold",label:`wa.me/${(0,L.waNumber)(Ae)}`}):null]}),Be?null:(0,W.jsx)(j.T,{size:13,colour:D.colours.red,children:"That doesn\u2019t look like a phone number. Use the full number, e.g. 01292 500123 or +44 7700 900123."}),(0,W.jsx)(j.Muted,{size:13,children:"With a number here, guests see \u201cMessage us on WhatsApp\u201d on their booking confirmation, and staff and managers see \u201cWhatsApp guest\u201d on bookings that have a mobile number. Blank: all WhatsApp buttons stay hidden."}),(0,W.jsx)(j.Muted,{size:13,children:"Tip: nothing is ever sent for you. The button opens WhatsApp with a message typed in, and the person taps Send themselves."})]}),Ee=(0,N.soldOutSettingsOf)(J.soldOut),Ne=(0,W.jsxs)(y.default,{style:{gap:8},children:[(0,W.jsx)(j.Toggle,{testID:"adv-soldout-auto",label:"Mark dishes sold out from the counts",value:Ee.auto,onChange:e=>X({soldOut:{...Ee,auto:e}}),a11y:"Mark dishes sold out from the live counts"}),(0,W.jsx)(j.Muted,{size:13,children:Ee.auto?'On: when a count (lobster, crab\u2026) runs out or drops below what a dish needs, every dish that uses it is marked sold out, with the reason, e.g. \u201cDeluxe Seafood Platter (no lobster)\u201d. It goes back on when the count is back up. Dishes marked by hand are left alone. Change which dishes use what in any Sold out list.':'Off: dishes are only marked sold out by hand. Dishes marked from the counts go back on.'}),(0,W.jsx)(j.T,{children:"Clear sold out dishes by themselves"}),(0,W.jsx)(j.Row,{wrap:!0,gap:8,children:['close','morning','manual'].map(e=>(0,W.jsx)(j.Chip,{testID:`adv-soldout-${e}`,label:N.SOLD_OUT_CLEAR_LABEL[e],selected:Ee.clear===e,onPress:()=>X({soldOut:{...Ee,clear:e}})},e))}),'manual'!==Ee.clear?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(j.T,{children:"Next morning means"}),(0,W.jsx)(j.Row,{wrap:!0,gap:8,children:['04:00','05:00','06:00','08:00'].map(e=>(0,W.jsx)(j.Chip,{label:e,selected:Ee.morningAt===e,onPress:()=>X({soldOut:{...Ee,morningAt:e}})},e))})]}):null,(0,W.jsx)(j.Muted,{size:13,children:'close'===Ee.clear?'Dishes go back on at the kitchen\u2019s closing time that day (from Kitchen hours). Marked after closing: the next morning.':'morning'===Ee.clear?`Dishes go back on at ${Ee.morningAt} the next morning.`:'Dishes stay sold out until someone taps Back on.'}),(0,W.jsx)(j.Muted,{size:13,children:"Tip: Sold out is a reminder for staff. It shows on the Display\u2019s slim strip and in every staff app\u2019s Sold out list. CoverCharge doesn\u2019t link up to your till, so it doesn\u2019t change the till."})]}),We=(0,s.venueBusy)(x,le,new Date),He=(0,E.clampWeeks)(J.forecastMinWeeks),Ue=(0,W.jsxs)(y.default,{style:{gap:8},children:[(0,W.jsxs)(y.default,{testID:"busy-level-setting",style:{alignItems:'center',gap:12},accessible:!0,accessibilityLabel:We.words,children:[(0,W.jsx)(j.T,{center:!0,size:20,weight:"semibold",children:We.words}),(0,W.jsx)(j.Stepper,{testID:"busy-covers-hour",label:"Busy level in Covers an hour",value:J.busyCoversPerHour??30,min:1,max:200,onChange:e=>X({busyCoversPerHour:e,busyLearning:!1})}),(0,W.jsx)(j.Muted,{children:"Learning starts from your chosen level; enabling it starts a fresh history period, so older trading patterns do not immediately replace your choice."}),(0,W.jsx)(j.Toggle,{label:"Learn the busy level from our real history",value:!1!==J.busyLearning,onChange:e=>X({busyLearning:e,busyLearningSince:(new Date).toISOString().slice(0,10)})}),(0,W.jsx)(j.T,{center:!0,size:16,children:"Steady starts at half the busy level. Busy starts at the busy level. Hourly forecasts use the upper end of their range."}),(0,W.jsx)(j.T,{center:!0,size:16,children:"Learning needs at least 4 weeks, 16 trading days and 40 recorded hours. It uses the 85th percentile of recorded hourly arrivals over the last 8 weeks, including walk-ins, excluding cancellations and no-shows. Changing the number keeps your override until learning is switched on again."}),We.enough?null:(0,W.jsx)(j.T,{center:!0,size:16,children:"Not enough real hourly history to learn yet. Using the starting or owner-set level."})]}),(0,W.jsx)(j.T,{children:"History needed before forecasts show"}),(0,W.jsx)(j.Row,{wrap:!0,gap:8,children:[1,2,3,4,6,8].map(e=>(0,W.jsx)(j.Chip,{testID:`adv-forecast-weeks-${e}`,label:1===e?'1 week':`${e} weeks`,selected:He===e,onPress:()=>X({forecastMinWeeks:e})},e))}),(0,W.jsx)(j.Muted,{size:13,children:`Forecasts, expected walk-ins and labour vs sales start once CoverCharge has ${1===He?'1 week':`${He} weeks`} of your bookings (and cash-ups for sales). Until then you see what is booked and your real labour cost, never invented figures.`}),(0,W.jsx)(j.Muted,{size:13,children:"Tip: 2 weeks is a sensible start. More weeks give steadier forecasts but take longer to begin."}),(0,W.jsx)(l.ForecastDaySettings,{r:x,set:X})]}),Ye=(0,w.depositOf)(J),Ge=e=>X({deposit:{...Ye,...e}}),qe=o.IS_GREENSIDE?(0,W.jsx)(a.GreensideCashOnly,{}):(0,W.jsxs)(y.default,{style:{gap:8},children:[(0,W.jsx)(j.Toggle,{testID:"adv-deposit-on",label:"Ask bigger tables for a deposit",value:Ye.on,onChange:e=>Ge({on:e})}),(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(j.T,{children:"Amount per adult"}),(0,W.jsx)(j.Stepper,{testID:"adv-deposit-amount",value:Ye.perPersonPence/100,min:0,max:100,format:e=>`\xa3${e}`,onChange:e=>Ge({perPersonPence:100*e}),label:"deposit per person"})]}),(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(j.T,{children:"From a party of"}),(0,W.jsx)(j.Stepper,{testID:"adv-deposit-party",value:Ye.fromParty,min:1,max:30,onChange:e=>Ge({fromParty:e}),label:"deposit from party size"})]}),(0,W.jsx)(j.T,{children:"Refundable?"}),(0,W.jsxs)(j.Row,{wrap:!0,gap:8,children:[(0,W.jsx)(j.Chip,{testID:"adv-deposit-ref-yes",label:"Yes",selected:!0===Ye.refundable,onPress:()=>Ge({refundable:!0})}),(0,W.jsx)(j.Chip,{testID:"adv-deposit-ref-no",label:"No",selected:!1===Ye.refundable,onPress:()=>Ge({refundable:!1,cutoffHours:null})}),(0,W.jsx)(j.Chip,{testID:"adv-deposit-ref-unset",label:"Not set yet",selected:null===Ye.refundable,onPress:()=>Ge({refundable:null,cutoffHours:null})})]}),!0===Ye.refundable?(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(j.T,{children:"Refunded if cancelled this many hours before"}),(0,W.jsx)(j.Stepper,{testID:"adv-deposit-cutoff",value:Ye.cutoffHours??0,min:0,max:168,step:6,format:e=>e?`${e} h`:'Any time',onChange:e=>Ge({cutoffHours:e||null}),label:"refund cut-off hours"})]}):null,(0,W.jsx)(j.T,{children:"Words guests see (optional)"}),(0,W.jsx)(n.TextInput,{accessibilityLabel:"Deposit policy shown to guests",testID:"adv-deposit-policy",value:Ye.policy,multiline:!0,onChangeText:e=>Ge({policy:e.slice(0,600)}),placeholder:"e.g. The deposit comes off your bill on the night.",placeholderTextColor:D.colours.muted,style:{minHeight:70,borderRadius:10,borderWidth:1,borderColor:D.colours.hairline,backgroundColor:D.colours.surface2,color:D.colours.text,padding:10,fontSize:15}}),(0,W.jsx)(j.Muted,{size:13,children:Ye.on&&Ye.perPersonPence>0?`Guests booking for ${Ye.fromParty} or more see: \u201c${(0,w.depositWords)(Ye,Ye.fromParty,x.name).join(' ')}\u201d`:'Off: no booking asks for a deposit.'}),(0,W.jsx)(j.Toggle,{testID:"adv-deposit-wixlinks",label:"Send website bookings deposit links for phone and walk-in bookings",a11y:"Send website bookings deposit links for phone and walk-in bookings",value:!!Ye.wixLinksOn,onChange:e=>Ge({wixLinksOn:e})}),Ye.wixLinksOn?(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(j.T,{children:"Link works for"}),(0,W.jsx)(j.Stepper,{testID:"adv-deposit-linkhours",value:Ye.wixLinkHours??48,min:6,max:168,step:6,format:e=>`${e} hours`,onChange:e=>Ge({wixLinkHours:e}),label:"hours a deposit link works"})]}):null,(0,W.jsx)(j.Muted,{size:13,children:Ye.wixLinksOn?'On here, but website bookings deposit links also need the server switch, which stays off until the first \xa31 test is approved. Until then the button says so and nothing goes to website bookings.':'Off: no deposit links. Bookings work as before.'}),(0,W.jsx)(j.Muted,{size:13,children:"Tip: deposits are paid through website bookings, never in CoverCharge, and no card is saved. Guests who book on your website pay there, and the booking shows Deposit paid on website bookings by itself. For phone and walk-in bookings, tick Deposit paid once the guest has paid you, or send a website bookings deposit link. Refunds are done in Website bookings \u203a Orders. Deposit amounts are shown on bookings in Managers, Display and Staff. This does not grant access to other financial or HR information."})]}),Ke=(0,W.jsx)(k.LoyaltySettingsPanel,{}),Qe=(0,W.jsx)(se,{rid:P}),Ve=[{id:'bookings',title:'Bookings',words:'allergen allergy dog dogs cap limit access wheelchair step-free vegan vegetarian veg table request',reset:['dogQuestion','maxDogsPerSlot','accessQuestion','dietQuestion','tableRequests'],body:re,help:'adv-bookings'},{id:'times',title:'Table times',words:'dwell table time turn how long minutes party size next table free',reset:['dwellBands','dwellLearn'],body:he,help:'adv-table-times'},{id:'reserve',title:'Reservable items',words:'platter seafood crab lobster reserve price stock',reset:['reservables','reserveStock'],body:ge,help:'adv-reservable'},{id:'events',title:'Regular events',words:'open mic night music night event repeat monthly weekly promote busier forecast last food',reset:['regularEvents'],body:je,help:'adv-events'},{id:'hours',title:'Kitchen hours & last food orders',words:'hours kitchen season winter summer open close closed special day last food orders cutoff drinks',reset:['hourSets','hourOverrides','lastFoodByDay','afterLastFood'],body:Pe,help:'adv-hours'},{id:'home',title:'Display & home',words:'covers counter flip sound takeaway next table free home display',reset:['coversCounter','nextTableFree','showTakeaway'],body:Oe,help:'adv-home'},{id:'deposits',title:'Deposits',words:'deposit deposits per person party size refund refundable cut off policy paid due booking money wix link pay link online',reset:['deposit'],body:qe,help:'adv-deposits'},{id:'loyalty',title:'Loyalty: stamp card, offers & bring a friend',words:'loyalty stamp stamps card reward rewards offer offers referral refer friend bring expiry',reset:[],body:Ke,help:'adv-loyalty',noReset:!0},{id:'tableorder',title:'Order at the table',words:'order at table qr code scan phone guest menu tables areas accept first order last orders kitchen cut off print sheet pdf pay bar till',reset:[],body:o.IS_GREENSIDE?(0,W.jsx)(a.GreensideCashOnly,{}):(0,W.jsx)(r.TableOrderSettings,{rid:P,me:V}),help:'adv-table-order',noReset:!0},{id:'whatsapp',title:'WhatsApp',words:'whatsapp wa.me message chat guest phone mobile number tap',reset:['whatsapp'],body:Fe,help:'adv-whatsapp'},{id:'reminders',title:'Reminders',words:'reminder reminders break breaks chairs tables close closing shift staff nudge 6 hours law snooze later done',reset:[],body:Qe,help:'adv-reminders',onReset:()=>Z(P)},{id:'notifications',title:'Notifications',words:'notification notifications push phone scheduled order milk mills pieroni pieronis fish veg olsen rota upload remind time send',reset:[],body:(0,W.jsx)(B.NotificationsSettings,{rid:P}),help:'adv-notifications',onReset:()=>F.useNotifs.getState().resetSeeds(P)},{id:'orderlists',title:'Order lists',words:'order list lists alsons drinks cash carry trip shopping supplier logo staff add',reset:[],body:(0,W.jsx)(B.OrderListsSettings,{rid:P}),help:'adv-order-lists',onReset:()=>(0,B.resetOrderLists)(P)},{id:'tasks',title:'Tasks',words:'daily tasks library jobs checklist duties to do todo',reset:[],body:(0,W.jsx)(c.TaskLibrarySettings,{rid:P}),help:'adv-tasks',onReset:()=>b.useDailyTasks.getState().resetLibrary(P)},{id:'cashup',title:'Cash up',words:'cash up sheet takings till float card cash tips weekly sales report pos printout figures fields vat covers',reset:[],body:(0,W.jsx)(p.CashUpSettings,{rid:P}),help:'adv-cashup',onReset:()=>g.useCashUp.getState().resetFields(P)},{id:'tips',title:'Tips',words:'tips pot today tips show hide staff apps payout correction',reset:[],body:(0,W.jsx)(p.TipsSettings,{rid:P}),help:'adv-tips',onReset:()=>g.useCashUp.getState().setShow(P,{showToday:!0,showPot:!0})},{id:'clockarea',title:'Clock-in area',words:'clock in out geofence location area radius gps break forgot forgotten rota visiting map',reset:[],body:(0,W.jsx)(B.ClockAreaSettings,{rid:P,me:V}),help:'adv-clock-area',onReset:()=>(0,B.resetClockArea)(P,V)},{id:'checkout',title:'Shift check-out & question board',words:'check out checkout morale mood staffing staff enough overstaffed survey anonymous question board vote shout out shoutout wellbeing hr wording',reset:['hr'],body:(0,W.jsx)(u.HrSettingsCard,{rid:P}),help:'adv-checkout'},{id:'forecast',title:'Forecast history',words:'forecast history weeks estimate walk-ins opening hours minimum covers floor saturday sunday labour sales example figures not enough history',reset:['forecastMinWeeks'],body:Ue,help:'adv-forecast'},{id:'soldout',title:'Sold out reminders',words:'sold out 86 eighty six run out ran out back on clear end of service morning display strip auto automatic counts shellfish lobster crab platter link uses',reset:['soldOut'],body:Ne,help:'adv-soldout'},{id:'tablegrid',title:'Table plan grid',words:'table plan grid snap line up align tidy tables floor layout guides spacing restore',reset:[],body:(0,W.jsx)(I.GridSettings,{rid:P,me:V}),help:'adv-tablegrid',onReset:()=>{const e=A.useFloor.getState().settings[P];A.useFloor.getState().setSettings(P,{...A.DEFAULT_SETTINGS,...e??{},gridSnap:!0,gridSize:25})}},{id:'printers',title:'Printers',words:'print printer printers printing ticket tickets kitchen ticket docket receipt epson star bluetooth wifi reprint takeaway auto front of house copies',reset:[],body:(0,W.jsx)($.PrintersSettings,{rid:P,go:e}),help:'adv-printers',onReset:()=>{const e=A.useFloor.getState().settings[P];e&&A.useFloor.getState().setSettings(P,{...e,printing:void 0})}},{id:'blocks',title:'Block bookings: lunch, dinner and website bookings',words:'block blocks blocked pause close lunch dinner service times wix website online push',reset:[],noReset:!0,body:(0,W.jsx)(d.BlockSettings,{rid:P}),help:'adv-blocks'},{id:'giftqr',title:'Gift cards on the Display',words:'gift card cards voucher qr code display buy sell wix website page link',reset:[],noReset:!0,body:(0,W.jsx)(i.GiftQrSettings,{rid:P}),help:'adv-giftqr'},{id:'holidays',title:'Holiday names',words:'bank holiday substitute day names',reset:['holidayFullNames'],body:ze,help:'adv-holidays'}],Ze=ee.trim().toLowerCase(),Je=(0,m.useMemo)(()=>Ve.filter(e=>!Ze||`${e.title} ${e.words}`.toLowerCase().includes(Ze)),[Ze,Ve]);return(0,W.jsxs)(y.default,{style:{gap:12},testID:"advanced-settings",children:[(0,W.jsx)(j.Muted,{children:"Owners and managers only. Changes are shared with your team\u2019s devices."}),(0,W.jsx)(n.TextInput,{accessibilityLabel:"Search settings",testID:"advanced-search",value:ee,onChangeText:te,placeholder:"Search, e.g. dogs, Open Mic Night, hours",placeholderTextColor:D.colours.muted,style:{minHeight:46,borderRadius:12,borderWidth:1,borderColor:D.colours.accentBorder,backgroundColor:D.colours.surface2,color:D.colours.text,paddingHorizontal:12,fontSize:16}}),oe?(0,W.jsx)(j.Banner,{kind:"success",title:oe}):null,Je.length?null:(0,W.jsxs)(j.Muted,{children:["No settings match \u201c",ee,"\u201d."]}),Je.map(s=>(0,W.jsx)(j.Card,{children:(0,W.jsxs)(y.default,{testID:`adv-${s.id}`,style:{gap:10},children:[(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(j.T,{size:17,weight:"semibold",colour:D.colours.gold,children:s.title}),e?(0,W.jsx)(f.default,{accessibilityRole:"button",accessibilityLabel:`Help: ${s.title}`,onPress:()=>e('more','help'),hitSlop:8,style:{minHeight:44,minWidth:44,justifyContent:'center'},children:(0,W.jsx)(j.T,{colour:D.colours.muted,children:"? Help"})}):null]}),s.body,s.noReset?null:(0,W.jsx)(j.Row,{style:{justifyContent:'flex-end'},children:(0,W.jsx)(j.Button,{small:!0,kind:"ghost",label:"Reset to default",testID:`reset-${s.id}`,onPress:()=>ne(s)})})]})},s.id))]})},Object.defineProperty(_e,"ADVANCED_DEFAULTS",{enumerable:!0,get:function(){return V}}),_e.SeasonsTodo=function({go:e}){const{r:s}=(0,R.useCtx)(6e4),t=(0,C.hourSetsOf)(s),o=[],a=t.filter(e=>!e.hours).map(e=>e.name);a.length&&o.push(`${a.join(' and ')} kitchen hours`);t.length>1&&t.some(e=>!e.start)&&o.push('the date each season starts');return o.length?(0,W.jsx)(j.Card,{onPress:()=>e('more','advanced'),highlight:D.colours.gold,children:(0,W.jsxs)(y.default,{testID:"seasons-todo",style:{gap:4},children:[(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(j.T,{weight:"semibold",colour:D.colours.gold,children:"Setup checklist: kitchen hours"}),(0,W.jsx)(j.T,{colour:D.colours.muted,children:"\u203a"})]}),(0,W.jsxs)(j.Muted,{size:13,children:["Please add ",o.join(' and ')," (Settings \u203a Advanced \u203a Kitchen hours). Until then the app uses the Winter hours all year."]})]})}):null};var s=_r(_d[0]),t=_r(_d[1]),o=_r(_d[2]),a=_r(_d[3]),n=_r(_d[4]),l=_r(_d[5]),r=_r(_d[6]),i=_r(_d[7]),d=_r(_d[8]),h=_r(_d[9]),u=_r(_d[10]),c=_r(_d[11]),p=_r(_d[12]),g=_r(_d[13]),b=_r(_d[14]),m=_r(_d[15]),x=e(m),f=e(_r(_d[16])),y=e(_r(_d[17])),j=_r(_d[18]),w=_r(_d[19]),k=_r(_d[20]),v=_r(_d[21]),C=_r(_d[22]),S=_r(_d[23]),T=_r(_d[24]),D=_r(_d[25]),R=_r(_d[26]),M=_r(_d[27]),L=_r(_d[28]),P=_r(_d[29]),O=_r(_d[30]),z=_r(_d[31]),I=_r(_d[32]),$=_r(_d[33]),A=_r(_d[34]),B=_r(_d[35]),F=_r(_d[36]),E=_r(_d[37]),N=_r(_d[38]),W=_r(_d[39]);const H=/^([01]\d|2[0-3]):[0-5]\d$/,U=/^(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/,_=/^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/,Y=[1,2,3,4,5,6,0],G=['Sun','Mon','Tue','Wed','Thu','Fri','Sat'];function q({value:e,onChange:s,placeholder:t,label:o,width:a=90,bad:l,testID:r}){return(0,W.jsx)(n.TextInput,{accessibilityLabel:o,testID:r,value:e,onChangeText:s,placeholder:t,placeholderTextColor:D.colours.muted,style:{width:a,minHeight:44,borderRadius:10,borderWidth:1,borderColor:l?D.colours.red:D.colours.hairline,backgroundColor:D.colours.surface2,color:D.colours.text,paddingHorizontal:10,fontSize:15}})}function K({value:e,onChange:s,min:t,max:o,unit:a,label:n,step:l=5}){const r=(a,l)=>(0,W.jsx)(f.default,{accessibilityRole:"button",accessibilityLabel:`${l<0?'Less':'More'}: ${n}`,onPress:()=>s(Math.min(o,Math.max(t,e+l))),style:{width:44,height:44,borderRadius:10,borderWidth:1,borderColor:D.colours.accentBorder,alignItems:'center',justifyContent:'center'},children:(0,W.jsx)(j.T,{size:20,colour:D.colours.gold,children:a})});return(0,W.jsxs)(j.Row,{gap:8,children:[r('\u2212',-l),(0,W.jsx)(j.T,{weight:"semibold",style:{minWidth:76,textAlign:'center'},children:a(e)}),r('+',l)]})}const Q=e=>e%60?`${Math.floor(e/60)}h ${e%60}m`:`${e/60} hour${60===e?'':'s'}`;const V={DEFAULT_DWELL:T.DEFAULT_DWELL,ANCHORAGE_SEASONS:C.ANCHORAGE_SEASONS};function Z(e){const s=P.useReminders.getState();s.ensure(e),s.resetRules(e),s.resetReminder((0,P.chairsId)(e))}const J=[1,2,3,4,5,6,0],X=e=>`${7===e.days.length?'Every day':J.filter(s=>e.days.includes(s)).map(e=>O.DAY_NAMES[e]).join(', ')||'No days'} at ${e.time} (UK time) \xb7 ${O.AUDIENCE_LABEL[e.audience]}`;function ee({init:e,onSave:s,onCancel:t}){const[o,a]=(0,m.useState)(e.text),[l,r]=(0,m.useState)(e.days),[i,d]=(0,m.useState)(e.time),[h,u]=(0,m.useState)(e.audience),c=o.trim().length>1&&l.length>0&&(0,O.validTime)(i);return(0,W.jsxs)(y.default,{testID:"reminder-editor",style:{gap:8,borderWidth:1,borderColor:D.colours.accentBorder,borderRadius:12,padding:10},children:[(0,W.jsx)(j.T,{weight:"semibold",children:"What it says"}),(0,W.jsx)(n.TextInput,{accessibilityLabel:"Reminder wording",testID:"reminder-text",value:o,onChangeText:a,maxLength:120,placeholder:"e.g. Time to put the chairs up on the tables",placeholderTextColor:D.colours.muted,style:{minHeight:44,borderRadius:10,borderWidth:1,borderColor:D.colours.hairline,backgroundColor:D.colours.surface2,color:D.colours.text,paddingHorizontal:10,fontSize:15}}),(0,W.jsx)(j.T,{weight:"semibold",children:"Days"}),(0,W.jsx)(j.Row,{wrap:!0,gap:6,children:J.map(e=>(0,W.jsx)(j.Chip,{label:O.DAY_NAMES[e],selected:l.includes(e),onPress:()=>r(l.includes(e)?l.filter(s=>s!==e):[...l,e])},e))}),(0,W.jsxs)(j.Row,{gap:8,children:[(0,W.jsx)(j.T,{weight:"semibold",children:"Time (UK)"}),(0,W.jsx)(q,{label:"Reminder time",testID:"reminder-time",value:i,onChange:d,placeholder:"21:00",bad:!(0,O.validTime)(i)})]}),(0,W.jsx)(j.T,{weight:"semibold",children:"Who sees it"}),(0,W.jsx)(j.Row,{wrap:!0,gap:6,children:['all','foh','kitchen'].map(e=>(0,W.jsx)(j.Chip,{label:O.AUDIENCE_LABEL[e],selected:h===e,onPress:()=>u(e)},e))}),c?null:(0,W.jsx)(j.Muted,{size:13,children:"Add the wording, at least one day and a time like 21:00."}),(0,W.jsxs)(j.Row,{gap:8,style:{justifyContent:'flex-end'},children:[(0,W.jsx)(j.Button,{small:!0,kind:"ghost",label:"Cancel",onPress:t}),(0,W.jsx)(j.Button,{small:!0,label:"Save reminder",testID:"reminder-save",disabled:!c,onPress:()=>s({text:o.trim(),days:[...l].sort(),time:i,audience:h})})]})]})}function se({rid:e}){x.default.useEffect(()=>{P.useReminders.getState().ensure(e)},[e]);const s=(0,P.useReminders)(e=>e.reminders),t=s.filter(s=>s.rid===e&&!s.removed),o=(0,P.useReminders)(s=>s.rules[e]),a=(0,O.clampRules)(o??O.DEFAULT_BREAK_RULES),n=(0,P.useReminders)(e=>e.done).filter(s=>s.rid===e).slice(0,5),l=(0,z.useOwner)(e=>e.staff),r=P.useReminders.getState(),[i,d]=(0,m.useState)(null),[h,u]=(0,m.useState)(null),c=s=>r.setRules(e,s);return(0,W.jsxs)(y.default,{style:{gap:10},testID:"reminders-settings",children:[(0,W.jsx)(j.Muted,{size:13,children:"Reminders slide up on the phones of staff who are on shift right now (clocked in, or on the rota at that time), in the Staff and Head Chef apps, while the app is open."}),(0,W.jsx)(j.T,{weight:"semibold",children:"Break reminders"}),(0,W.jsx)(j.Toggle,{label:"Remind staff to take their break",value:a.on,onChange:e=>c({on:e})}),(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},wrap:!0,children:[(0,W.jsx)(j.T,{center:!0,style:{width:'100%'},children:"First reminder, if the rota has no break time"}),(0,W.jsx)(K,{label:"first break reminder",step:15,min:30,max:O.LEGAL_LIMIT_MINS,value:a.afterMins,unit:e=>`${Q(e)} in`,onChange:e=>c({afterMins:e})})]}),(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},wrap:!0,children:[(0,W.jsx)(j.T,{style:{flex:1},children:"Remind once more after"}),(0,W.jsx)(K,{label:"second break reminder",step:5,min:5,max:120,value:a.repeatMins,unit:e=>`${e} min`,onChange:e=>c({repeatMins:e})})]}),(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},wrap:!0,children:[(0,W.jsx)(j.T,{style:{flex:1},children:"\u2018Later\u2019 hides it for"}),(0,W.jsx)(K,{label:"snooze",step:5,min:5,max:60,value:a.snoozeMins,unit:e=>`${e} min`,onChange:e=>c({snoozeMins:e})})]}),(0,W.jsxs)(j.Muted,{size:13,children:["How it works: if the shift on the rota has a break time, the reminder comes at that time. If not, it comes ",Q(a.afterMins)," after they clock in (or after the shift starts, if they haven\u2019t clocked in). If they still haven\u2019t started a break, it comes once more ",a.repeatMins," minutes later, and again at 6 hours. Nobody works more than 6 hours without a reminder: UK law says a shift over 6 hours needs a 20-minute break. \u2018Start break\u2019 starts their break, the same as on the clock screen."]}),(0,W.jsx)(j.T,{weight:"semibold",style:{marginTop:6},children:"Venue reminders"}),t.map(e=>(0,W.jsx)(y.default,{testID:`reminder-${e.builtIn??e.id}`,style:{gap:6,borderBottomWidth:1,borderColor:D.colours.hairline,paddingBottom:8},children:i===e.id?(0,W.jsx)(ee,{init:e,onCancel:()=>d(null),onSave:s=>{r.update(e.id,s),d(null)}}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},gap:8,children:[(0,W.jsx)(j.T,{weight:"semibold",style:{flex:1},children:e.text}),e.paused?(0,W.jsx)(j.Badge,{kind:"amber",label:"PAUSED"}):null]}),(0,W.jsx)(j.Muted,{size:13,children:X(e)}),h===e.id?(0,W.jsxs)(j.Row,{gap:8,wrap:!0,children:[(0,W.jsx)(j.T,{size:14,style:{flex:1},children:"Delete this reminder?"}),(0,W.jsx)(j.Button,{small:!0,kind:"danger",label:"Yes, delete it",onPress:()=>{r.remove(e.id),u(null)}}),(0,W.jsx)(j.Button,{small:!0,kind:"ghost",label:"Keep it",onPress:()=>u(null)})]}):(0,W.jsxs)(j.Row,{gap:8,wrap:!0,children:[(0,W.jsx)(j.Button,{small:!0,kind:"secondary",label:"Edit",testID:"reminder-edit",onPress:()=>d(e.id)}),(0,W.jsx)(j.Button,{small:!0,kind:"secondary",label:e.paused?'Resume':'Pause',onPress:()=>r.update(e.id,{paused:!e.paused})}),(0,W.jsx)(j.Button,{small:!0,kind:"ghost",label:"Delete",onPress:()=>u(e.id)})]})]})},e.id)),t.length?null:(0,W.jsx)(j.Muted,{children:"No venue reminders. Add one below, or Reset to default to bring back \u201cchairs up\u201d."}),'new'===i?(0,W.jsx)(ee,{init:{text:'',days:[5,6],time:'21:00',audience:'all'},onCancel:()=>d(null),onSave:s=>{r.add(e,s),d(null)}}):(0,W.jsx)(j.Button,{small:!0,kind:"secondary",label:"\uff0b Add a reminder",testID:"reminder-add",onPress:()=>d('new')}),n.length?(0,W.jsxs)(y.default,{style:{gap:2},children:[(0,W.jsx)(j.T,{weight:"semibold",children:"Recently done"}),n.map(e=>(0,W.jsxs)(j.Muted,{size:13,children:[new Date(e.at).toLocaleString('en-GB',{weekday:'short',day:'numeric',month:'short',hour:'2-digit',minute:'2-digit',timeZone:'Europe/London'})," \xb7 ",(l.find(s=>s.id===e.staffRef)?.name??e.staffName).replace(' (example)','')," \xb7 ",s.find(s=>s.id===e.reminderId)?.text??'Reminder']},e.id))]}):null,(0,W.jsxs)(j.Muted,{size:13,children:["Tip: once anyone taps Done, the reminder goes away for everyone that day, and you can see who did it here. \u2018Later\u2019 hides it on that phone for ",a.snoozeMins," minutes. Reset to default puts back the break times and \u201cchairs up\u201d (",(0,O.defaultChairs)('x',e).days.map(e=>O.DAY_NAMES[e]).join(' and '),", 21:00); your own reminders stay."]}),(0,W.jsx)(j.Muted,{size:13,children:"Reminders show while the app is open. Phones with the app closed don\u2019t get them yet."})]})}},1418,[1051,1031,805,1405,812,1419,1420,1422,1423,1424,1197,1029,1030,1006,1012,17,385,85,777,841,1425,816,862,1053,861,804,1055,858,1181,972,973,876,1426,1379,996,1427,1003,1139,939,8]); +__d(function(_g,_r,_i,_a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.AdvancedSettings=function({go:e}){const{r:x,rid:P,today:O,me:I}=(0,R.useCtx)(6e4),V=I.replace(" (example)",""),J=x.settings,X=e=>v.useStore.getState().updateSettings(P,e),[ee,te]=(0,m.useState)(()=>(0,h.takeAdvancedPrefill)()),[oe,ae]=(0,m.useState)(null),ne=e=>{if(e.onReset)return e.onReset(),void ae(`${e.title}: back to the defaults.`);X(Object.fromEntries(e.reset.map(e=>[e,void 0]))),ae(`${e.title}: back to the defaults.`)},le=(0,M.useBookings)(P),re=(0,W.jsxs)(y.default,{style:{gap:8},children:[(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(j.T,{style:{flex:1},children:"Ask about allergies first (in red)"}),(0,W.jsx)(j.Badge,{kind:"red",label:"ALWAYS ON"})]}),(0,W.jsx)(j.Muted,{size:13,children:"Food safety: every booking answers this before anything else, and staff tick \u201cAllergens seen\u201d."}),(0,W.jsx)(j.Toggle,{label:"Ask if they\u2019re bringing a dog",value:(0,T.dogQuestionOn)(x),onChange:e=>X({dogQuestion:e})}),(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(j.T,{style:{flex:1},children:"Most dogs per booking time"}),(0,W.jsx)(K,{label:"dogs per time",step:1,min:0,max:20,value:J.maxDogsPerSlot??0,unit:e=>e?`${e} dog${1===e?'':'s'}`:'No limit',onChange:e=>X({maxDogsPerSlot:e||void 0})})]}),(0,W.jsx)(j.Toggle,{label:"Ask about wheelchair or step-free access",value:(0,T.accessQuestionOn)(x),onChange:e=>X({accessQuestion:e})}),(0,W.jsx)(j.Toggle,{label:"Vegan and vegetarian ticks (optional for guests)",value:(0,T.dietQuestionOn)(x),onChange:e=>X({dietQuestion:e})}),(0,W.jsx)(j.Toggle,{label:"Let guests ask for a table (shown as \u2018not guaranteed\u2019)",value:!1!==J.tableRequests,onChange:e=>X({tableRequests:e})}),(0,W.jsx)(j.Muted,{size:13,children:"Dog-friendly and step-free tables are marked on the table plan."}),e?(0,W.jsx)(j.Button,{small:!0,kind:"ghost",label:"Mark tables on the Table plan \u203a",onPress:()=>e('more','tableplan')}):null]}),ie=(0,T.dwellBands)(x),de=(e,s)=>X({dwellBands:ie.map((t,o)=>o===e?{...t,mins:s}:t)}),he=(0,W.jsxs)(y.default,{style:{gap:8},children:[(0,W.jsx)(j.Muted,{size:13,children:"How long a table usually stays, by party size. Used for \u201cNext table free\u201d and for spacing bookings on a table."}),ie.map((e,s)=>{const t=(0,T.dwellFor)(x,9999===e.upTo?20:e.upTo,le);return(0,W.jsxs)(y.default,{style:{gap:2},children:[(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(j.T,{style:{flex:1},children:(0,T.bandLabel)(ie,s)}),(0,W.jsx)(K,{label:`table time for ${(0,T.bandLabel)(ie,s)}`,min:30,max:360,value:e.mins,unit:Q,onChange:e=>de(s,e)})]}),t.learned&&t.mins!==e.mins?(0,W.jsxs)(j.Muted,{size:12,children:["From your last ",t.samples," tables: about ",Q(t.mins)," (used for estimates)"]}):null]},s)}),(0,W.jsx)(j.Toggle,{label:"Fine-tune from how long tables really stay",value:!1!==J.dwellLearn,onChange:e=>X({dwellLearn:e})}),(0,W.jsx)(j.Muted,{size:13,children:"Defaults: 90 min for 1\u20132 Covers, 105 min for 3\u20135, 2 hours for 6\u201319, 3 hours for 20 or more."})]}),ue=J.reservables??(0,S.reservablesOf)(x),ce=J.reservables??('anchorage'===P?ue:[]),pe=(e,s)=>X({reservables:ce.map(t=>t.id===e?{...t,...s}:t)}),ge=(0,W.jsxs)(y.default,{style:{gap:8},children:[ce.length?ce.map(e=>(0,W.jsxs)(y.default,{style:{gap:4},children:[(0,W.jsx)(j.Toggle,{label:`${e.name} can be reserved`,value:e.active,onChange:s=>pe(e.id,{active:s})}),(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(j.Muted,{children:"Price"}),(0,W.jsx)(K,{label:`${e.name} price`,min:5,max:1e3,value:Math.round(e.price/100),unit:e=>`\xa3${e}`,onChange:s=>pe(e.id,{price:100*s})})]}),(0,W.jsxs)(j.Muted,{size:12,children:["Uses: ",e.uses.map(e=>`${e.qty} ${e.key}`).join(' + ')," from the counted stock. Held from the Display count and shown as \u201cReserved\u201d."]})]},e.id)):(0,W.jsx)(j.Muted,{children:"No reservable dishes yet."}),(0,W.jsx)(j.Toggle,{label:"Guests can reserve a crab or lobster on its own",value:!1!==J.reserveStock,onChange:e=>X({reserveStock:e})}),(0,W.jsx)(j.Muted,{size:13,children:"The kitchen is told about each reservation and the Head Chef taps OK."})]}),be=(0,T.regularEventsOf)(x),[me,xe]=(0,m.useState)(null),fe=e=>X({regularEvents:e}),ye=me?me.name.trim()?me.time&&!H.test(me.time)?'Start time looks wrong (use 20:00).':me.lastFood&&!H.test(me.lastFood)?'Last food orders looks wrong (use 19:00).':'once'!==me.rule.kind||_.test(me.rule.date)?'':'Date looks wrong (use 2026-12-31).':'Give it a name.':'',je=(0,W.jsxs)(y.default,{style:{gap:8},children:[be.map(e=>(0,W.jsxs)(j.Card,{children:[(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(j.T,{weight:"semibold",style:{flex:1},children:e.name}),e.busier?(0,W.jsx)(j.Badge,{kind:"gold",label:"BUSIER"}):null,e.active?null:(0,W.jsx)(j.Badge,{kind:"neutral",label:"OFF"})]}),(0,W.jsxs)(j.Muted,{children:[(0,T.ruleText)(e.rule),e.time?` \xb7 from ${e.time}`:'',e.lastFood?` \xb7 last food orders ${e.lastFood}`:'']}),e.active?(0,W.jsxs)(j.Muted,{size:12,children:["Next: ",(0,T.nextOccurrence)(e,O)??'\u2014']}):null,(0,W.jsxs)(j.Row,{gap:6,children:[(0,W.jsx)(j.Button,{small:!0,kind:"secondary",label:"Edit",testID:`event-edit-${e.id}`,onPress:()=>xe({...e})}),(0,W.jsx)(j.Button,{small:!0,kind:"ghost",label:"Remove",onPress:()=>fe(be.filter(s=>s.id!==e.id))})]})]},e.id)),me?(0,W.jsxs)(j.Card,{highlight:D.colours.gold,children:[(0,W.jsxs)(j.Row,{gap:8,style:{flexWrap:'wrap'},children:[(0,W.jsx)(j.Muted,{children:"Name"}),(0,W.jsx)(q,{label:"Event name",width:220,value:me.name,onChange:e=>xe({...me,name:e}),placeholder:"Open Mic Night"})]}),(0,W.jsx)(j.Muted,{children:"Repeats"}),(0,W.jsxs)(j.Row,{wrap:!0,gap:6,children:[(0,W.jsx)(j.Chip,{label:"Last \u2026 of the month",selected:'last'===me.rule.kind,onPress:()=>xe({...me,rule:{kind:'last',weekday:'weekday'in me.rule?me.rule.weekday:0}})}),(0,W.jsx)(j.Chip,{label:"Every week",selected:'weekly'===me.rule.kind,onPress:()=>xe({...me,rule:{kind:'weekly',weekday:'weekday'in me.rule?me.rule.weekday:0}})}),(0,W.jsx)(j.Chip,{label:"One-off date",selected:'once'===me.rule.kind,onPress:()=>xe({...me,rule:{kind:'once',date:O}})})]}),'weekday'in me.rule?(0,W.jsx)(j.Row,{wrap:!0,gap:6,children:Y.map(e=>(0,W.jsx)(j.Chip,{label:G[e],selected:me.rule.weekday===e,onPress:()=>xe({...me,rule:{...me.rule,weekday:e}})},e))}):(0,W.jsxs)(j.Row,{gap:8,children:[(0,W.jsx)(j.Muted,{children:"Date (DD/MM/YYYY)"}),(0,W.jsx)(q,{label:"Event date",width:130,value:(0,t.slashDay)(me.rule.date),onChange:e=>{const s=(0,t.slashDate)(e,(0,t.slashDay)(me.rule.date));xe({...me,rule:{kind:'once',date:(0,t.dayFromSlash)(s)??s}})},placeholder:"31/12/2026"})]}),(0,W.jsxs)(j.Row,{gap:8,style:{flexWrap:'wrap'},children:[(0,W.jsx)(j.Muted,{children:"Starts (optional)"}),(0,W.jsx)(q,{label:"Start time",value:me.time??'',onChange:e=>xe({...me,time:e||void 0}),placeholder:"20:00",bad:!!me.time&&!H.test(me.time)})]}),(0,W.jsxs)(j.Row,{gap:8,style:{flexWrap:'wrap'},children:[(0,W.jsx)(j.Muted,{children:"Last food orders (optional)"}),(0,W.jsx)(q,{label:"Last food orders",value:me.lastFood??'',onChange:e=>xe({...me,lastFood:e||void 0}),placeholder:"19:00",bad:!!me.lastFood&&!H.test(me.lastFood)})]}),(0,W.jsxs)(j.Row,{gap:8,style:{flexWrap:'wrap'},children:[(0,W.jsx)(j.Muted,{children:"Notes"}),(0,W.jsx)(q,{label:"Notes",width:240,value:me.notes??'',onChange:e=>xe({...me,notes:e||void 0}),placeholder:"Live music from 8pm"})]}),(0,W.jsx)(j.Toggle,{label:"Expect busier (raises the forecast)",value:me.busier,onChange:e=>xe({...me,busier:e})}),(0,W.jsx)(j.Toggle,{label:"On",value:me.active,onChange:e=>xe({...me,active:e})}),ye?(0,W.jsx)(j.T,{size:13,colour:D.colours.red,children:ye}):null,(0,W.jsxs)(j.Row,{gap:6,children:[(0,W.jsx)(j.Button,{small:!0,label:"Save event",disabled:!!ye,testID:"event-save",onPress:()=>{const e={...me,name:me.name.trim()};fe(be.some(s=>s.id===e.id)?be.map(s=>s.id===e.id?e:s):[...be,e]),xe(null),ae(`Saved ${e.name}.`)}}),(0,W.jsx)(j.Button,{small:!0,kind:"ghost",label:"Cancel",onPress:()=>xe(null)})]})]}):(0,W.jsx)(j.Button,{small:!0,kind:"secondary",label:"\uff0b Add a regular event",testID:"event-add",onPress:()=>xe({id:`ev-${Date.now().toString(36)}`,name:'',rule:{kind:'last',weekday:0},busier:!0,active:!0})}),(0,W.jsx)(j.Muted,{size:13,children:"Events show in Forecast key dates (with a Promote button), on the Today date bar, and lift the forecast when \u201cExpect busier\u201d is on."})]}),we=(0,C.hourSetsOf)(x),ke=(0,C.seasonOn)(x,new Date),[ve,Ce]=(0,m.useState)(null),[Se,Te]=(0,m.useState)(null),De=J.hourOverrides??[],Re=ve?ve.start&&!U.test(ve.start)?'Start date looks wrong (use day and month as MM-DD, e.g. 04-01 for 1 April).':ve.hours&&Object.values(ve.hours).some(e=>e&&(!H.test(e[0])||!H.test(e[1])||e[0]>=e[1]))?'Check the times: use 12:00 and 19:00, and closing must be after opening.':'':'',Me=Object.values(J.lastFoodByDay??{}).some(e=>e&&!H.test(e)),Le=[];we.some(e=>!e.hours)&&Le.push(`${we.filter(e=>!e.hours).map(e=>e.name).join(' and ')} kitchen hours`);we.filter(e=>e.hours).length>=1&&we.length>1&&we.some(e=>!e.start)&&Le.push('the date each season starts');const Pe=(0,W.jsxs)(y.default,{style:{gap:8},children:[(0,W.jsx)(j.Muted,{size:13,children:"Kitchen (food) hours, not bar hours. The closing time is last food orders. Dining bookings are only offered inside these hours."}),Le.length?(0,W.jsxs)(j.Banner,{kind:"warn",title:"To finish setting up",children:["Please add ",Le.join(' and '),". Until then the app uses ",ke?.name??'your weekly'," hours all year."]}):null,ke?(0,W.jsxs)(j.T,{colour:D.colours.goldLight,children:["In use today: ",ke.name]}):null,we.map(e=>(0,W.jsxs)(j.Card,{children:[(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(j.T,{weight:"semibold",children:e.name}),ke?.id===e.id?(0,W.jsx)(j.Badge,{kind:"gold",label:"IN USE"}):e.hours?null:(0,W.jsx)(j.Badge,{kind:"amber",label:"NOT SET"})]}),(0,W.jsx)(j.Muted,{children:e.start?`Starts every year on ${e.start}`:'Start date: not set yet'}),e.hours?(0,W.jsx)(j.Muted,{size:13,children:Y.map(s=>`${G[s]} ${e.hours[s]?`${e.hours[s][0]}\u2013${e.hours[s][1]}`:'closed'}`).join(' \xb7 ')}):(0,W.jsx)(j.Muted,{size:13,children:"No hours yet."}),(0,W.jsx)(j.Button,{small:!0,kind:"secondary",label:e.hours?'Edit':`Set ${e.name} hours`,testID:`season-edit-${e.id}`,onPress:()=>Ce({...e,hours:e.hours?{...e.hours}:{...we.find(e=>e.hours)?.hours??x.kitchenHours}})})]},e.id)),ve?(0,W.jsxs)(j.Card,{highlight:D.colours.gold,children:[(0,W.jsxs)(j.T,{weight:"semibold",children:[ve.name," hours"]}),(0,W.jsxs)(j.Row,{gap:8,style:{flexWrap:'wrap'},children:[(0,W.jsx)(j.Muted,{children:"Starts every year on (MM-DD)"}),(0,W.jsx)(q,{label:"Season start date",value:ve.start??'',onChange:e=>Ce({...ve,start:e||void 0}),placeholder:"04-01",bad:!!ve.start&&!U.test(ve.start)})]}),Y.map(e=>{const s=ve.hours?.[e]??null,t=s=>Ce({...ve,hours:{...ve.hours,[e]:s}});return(0,W.jsxs)(j.Row,{gap:6,style:{flexWrap:'wrap'},children:[(0,W.jsx)(j.T,{style:{width:44},children:G[e]}),(0,W.jsx)(j.Chip,{label:s?'Open':'Closed',selected:!!s,onPress:()=>t(s?null:['12:00','19:00'])}),s?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(q,{label:`${T.DAYS[e]} opens`,value:s[0],width:74,onChange:e=>t([e,s[1]]),bad:!H.test(s[0])}),(0,W.jsx)(j.Muted,{children:"to"}),(0,W.jsx)(q,{label:`${T.DAYS[e]} last food orders`,value:s[1],width:74,onChange:e=>t([s[0],e]),bad:!H.test(s[1])||s[0]>=s[1]})]}):null]},e)}),Re?(0,W.jsx)(j.T,{size:13,colour:D.colours.red,children:Re}):null,(0,W.jsxs)(j.Row,{gap:6,children:[(0,W.jsx)(j.Button,{small:!0,label:"Save hours",disabled:!!Re,testID:"season-save",onPress:()=>{var e;e=we.map(e=>e.id===ve.id?ve:e),X({hourSets:e}),Ce(null),ae(`Saved ${ve.name} hours.`)}}),(0,W.jsx)(j.Button,{small:!0,kind:"ghost",label:"Cancel",onPress:()=>Ce(null)})]})]}):null,(0,W.jsx)(j.T,{weight:"semibold",style:{marginTop:6},children:"Special days"}),(0,W.jsx)(j.Muted,{size:13,children:"One-off changes, e.g. closed for a private party or open late on Hogmanay."}),De.map(e=>(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsxs)(j.T,{style:{flex:1},children:[e.date,": ",e.hours?`${e.hours[0]}\u2013${e.hours[1]}`:'kitchen closed',e.note?` \xb7 ${e.note}`:'']}),(0,W.jsx)(j.Button,{small:!0,kind:"ghost",label:"Remove",onPress:()=>X({hourOverrides:De.filter(s=>s.date!==e.date)})})]},e.date)),Se?(0,W.jsxs)(j.Card,{highlight:D.colours.gold,children:[(0,W.jsxs)(j.Row,{gap:8,children:[(0,W.jsx)(j.Muted,{children:"Date (DD/MM/YYYY)"}),(0,W.jsx)(q,{label:"Special day date",width:130,value:(0,t.slashDay)(Se.date),onChange:e=>{const s=(0,t.slashDate)(e,(0,t.slashDay)(Se.date));Te({...Se,date:(0,t.dayFromSlash)(s)??s})},placeholder:"31/12/2026",bad:!_.test(Se.date)})]}),(0,W.jsxs)(j.Row,{gap:6,style:{flexWrap:'wrap'},children:[(0,W.jsx)(j.Chip,{label:Se.hours?'Open':'Closed',selected:!!Se.hours,onPress:()=>Te({...Se,hours:Se.hours?null:['12:00','19:00']})}),Se.hours?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(q,{label:"Opens",width:74,value:Se.hours[0],onChange:e=>Te({...Se,hours:[e,Se.hours[1]]})}),(0,W.jsx)(j.Muted,{children:"to"}),(0,W.jsx)(q,{label:"Last food orders",width:74,value:Se.hours[1],onChange:e=>Te({...Se,hours:[Se.hours[0],e]})})]}):null]}),(0,W.jsxs)(j.Row,{gap:8,children:[(0,W.jsx)(j.Muted,{children:"Note"}),(0,W.jsx)(q,{label:"Note",width:220,value:Se.note??'',onChange:e=>Te({...Se,note:e||void 0}),placeholder:"Private party"})]}),(()=>{const e=_.test(Se.date)?Se.hours&&(!H.test(Se.hours[0])||!H.test(Se.hours[1])||Se.hours[0]>=Se.hours[1])?'Check the times.':'':'Date looks wrong (use 2026-12-31).';return(0,W.jsxs)(W.Fragment,{children:[e?(0,W.jsx)(j.T,{size:13,colour:D.colours.red,children:e}):null,(0,W.jsxs)(j.Row,{gap:6,children:[(0,W.jsx)(j.Button,{small:!0,label:"Save special day",disabled:!!e,onPress:()=>{X({hourOverrides:[...De.filter(e=>e.date!==Se.date),Se].sort((e,s)=>e.date.localeCompare(s.date))}),Te(null)}}),(0,W.jsx)(j.Button,{small:!0,kind:"ghost",label:"Cancel",onPress:()=>Te(null)})]})]})})()]}):(0,W.jsx)(j.Button,{small:!0,kind:"secondary",label:"\uff0b Add a special day",testID:"override-add",onPress:()=>Te({date:O,hours:null})}),(0,W.jsx)(j.T,{weight:"semibold",style:{marginTop:6},children:"Earlier last food orders (optional)"}),(0,W.jsx)(j.Muted,{size:13,children:"Leave blank to use the kitchen closing time. Regular events can set their own (Open Mic Night: 7pm)."}),(0,W.jsx)(j.Row,{wrap:!0,gap:8,children:Y.map(e=>(0,W.jsxs)(y.default,{style:{gap:2},children:[(0,W.jsx)(j.Muted,{size:12,children:G[e]}),(0,W.jsx)(q,{label:`${T.DAYS[e]} last food orders`,width:74,value:J.lastFoodByDay?.[e]??'',placeholder:"\u2014",bad:!!J.lastFoodByDay?.[e]&&!H.test(J.lastFoodByDay[e]),onChange:s=>X({lastFoodByDay:{...J.lastFoodByDay??{},[e]:s||void 0}})})]},e))}),Me?(0,W.jsx)(j.T,{size:13,colour:D.colours.red,children:"Use times like 19:00 (blank = kitchen close)."}):null,(0,W.jsx)(j.Muted,{children:"After last food orders, booking times are\u2026"}),(0,W.jsxs)(j.Row,{gap:6,children:[(0,W.jsx)(j.Chip,{label:"Offered for drinks only",selected:'drinks'===(0,T.afterLastFood)(x),onPress:()=>X({afterLastFood:'drinks'})}),(0,W.jsx)(j.Chip,{label:"Not offered",selected:'block'===(0,T.afterLastFood)(x),onPress:()=>X({afterLastFood:'block'})})]})]}),Oe=(0,W.jsxs)(y.default,{style:{gap:8},children:[(0,W.jsx)(j.Toggle,{label:"COVERS counter on Today (done / to come / total)",value:(0,T.coversCounterOn)(x),onChange:e=>X({coversCounter:e})}),(0,W.jsx)(j.Toggle,{label:"\u2018Next table free\u2019 when you\u2019re full",value:(0,T.nextTableOn)(x),onChange:e=>X({nextTableFree:e})}),(0,W.jsx)(j.Toggle,{label:"Show takeaway on home screens",value:(0,T.showTakeaway)(x),onChange:e=>X({showTakeaway:e})}),(0,W.jsx)(j.Muted,{size:13,children:"Takeaway order alerts always work. With this off, takeaway figures sit in a collapsed Takeaway section."}),(0,W.jsx)(j.Muted,{size:13,children:"The flap click sound is set on each Display (Display settings), off by default."})]}),Ie=(0,W.jsxs)(y.default,{style:{gap:8},children:[(0,W.jsx)(j.Toggle,{label:"Show full gov.uk names, e.g. \u2018(substitute day)\u2019",value:!!J.holidayFullNames,onChange:e=>X({holidayFullNames:e})}),(0,W.jsx)(j.Muted,{size:13,children:"Off: \u201cChristmas Day\u201d shows on its date without \u201c(substitute day)\u201d."})]}),[ze,$e]=(0,m.useState)(null),Ae=ze??J.whatsapp??'',Be=!Ae.trim()||!!(0,L.waNumber)(Ae),Fe=(0,W.jsxs)(y.default,{style:{gap:8},children:[(0,W.jsx)(j.T,{children:"The venue\u2019s WhatsApp number"}),(0,W.jsxs)(j.Row,{gap:8,wrap:!0,children:[(0,W.jsx)(q,{label:"Venue WhatsApp number",testID:"adv-whatsapp-number",width:220,value:Ae,placeholder:"e.g. 01292 500123 or +44 7\u2026",bad:!Be,onChange:e=>{$e(e),e.trim()?(0,L.waNumber)(e)&&X({whatsapp:e.trim()}):X({whatsapp:void 0})}}),Ae.trim()&&Be?(0,W.jsx)(j.Badge,{kind:"gold",label:`wa.me/${(0,L.waNumber)(Ae)}`}):null]}),Be?null:(0,W.jsx)(j.T,{size:13,colour:D.colours.red,children:"That doesn\u2019t look like a phone number. Use the full number, e.g. 01292 500123 or +44 7700 900123."}),(0,W.jsx)(j.Muted,{size:13,children:"With a number here, guests see \u201cMessage us on WhatsApp\u201d on their booking confirmation, and staff and managers see \u201cWhatsApp guest\u201d on bookings that have a mobile number. Blank: all WhatsApp buttons stay hidden."}),(0,W.jsx)(j.Muted,{size:13,children:"Tip: nothing is ever sent for you. The button opens WhatsApp with a message typed in, and the person taps Send themselves."})]}),Ee=(0,N.soldOutSettingsOf)(J.soldOut),Ne=(0,W.jsxs)(y.default,{style:{gap:8},children:[(0,W.jsx)(j.Toggle,{testID:"adv-soldout-auto",label:"Mark dishes sold out from the counts",value:Ee.auto,onChange:e=>X({soldOut:{...Ee,auto:e}}),a11y:"Mark dishes sold out from the live counts"}),(0,W.jsx)(j.Muted,{size:13,children:Ee.auto?'On: when a count (lobster, crab\u2026) runs out or drops below what a dish needs, every dish that uses it is marked sold out, with the reason, e.g. \u201cDeluxe Seafood Platter (no lobster)\u201d. It goes back on when the count is back up. Dishes marked by hand are left alone. Change which dishes use what in any Sold out list.':'Off: dishes are only marked sold out by hand. Dishes marked from the counts go back on.'}),(0,W.jsx)(j.T,{children:"Clear sold out dishes by themselves"}),(0,W.jsx)(j.Row,{wrap:!0,gap:8,children:['close','morning','manual'].map(e=>(0,W.jsx)(j.Chip,{testID:`adv-soldout-${e}`,label:N.SOLD_OUT_CLEAR_LABEL[e],selected:Ee.clear===e,onPress:()=>X({soldOut:{...Ee,clear:e}})},e))}),'manual'!==Ee.clear?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(j.T,{children:"Next morning means"}),(0,W.jsx)(j.Row,{wrap:!0,gap:8,children:['04:00','05:00','06:00','08:00'].map(e=>(0,W.jsx)(j.Chip,{label:e,selected:Ee.morningAt===e,onPress:()=>X({soldOut:{...Ee,morningAt:e}})},e))})]}):null,(0,W.jsx)(j.Muted,{size:13,children:'close'===Ee.clear?'Dishes go back on at the kitchen\u2019s closing time that day (from Kitchen hours). Marked after closing: the next morning.':'morning'===Ee.clear?`Dishes go back on at ${Ee.morningAt} the next morning.`:'Dishes stay sold out until someone taps Back on.'}),(0,W.jsx)(j.Muted,{size:13,children:"Tip: Sold out is a reminder for staff. It shows on the Display\u2019s slim strip and in every staff app\u2019s Sold out list. CoverCharge doesn\u2019t link up to your till, so it doesn\u2019t change the till."})]}),We=(0,s.venueBusy)(x,le,new Date),He=(0,E.clampWeeks)(J.forecastMinWeeks),Ue=(0,W.jsxs)(y.default,{style:{gap:8},children:[(0,W.jsxs)(y.default,{testID:"busy-level-setting",style:{alignItems:'center',gap:12},accessible:!0,accessibilityLabel:We.words,children:[(0,W.jsx)(j.T,{center:!0,size:20,weight:"semibold",children:We.words}),(0,W.jsx)(j.Stepper,{testID:"busy-covers-hour",label:"Busy level in Covers an hour",value:J.busyCoversPerHour??30,min:1,max:200,onChange:e=>X({busyCoversPerHour:e,busyLearning:!1})}),(0,W.jsx)(j.Muted,{children:"Learning starts from your chosen level; enabling it starts a fresh history period, so older trading patterns do not immediately replace your choice."}),(0,W.jsx)(j.Toggle,{label:"Learn the busy level from our real history",value:!1!==J.busyLearning,onChange:e=>X({busyLearning:e,busyLearningSince:(new Date).toISOString().slice(0,10)})}),(0,W.jsx)(j.T,{center:!0,size:16,children:"Steady starts at half the busy level. Busy starts at the busy level. Hourly forecasts use the upper end of their range."}),(0,W.jsx)(j.T,{center:!0,size:16,children:"Learning needs at least 4 weeks, 16 trading days and 40 recorded hours. It uses the 85th percentile of recorded hourly arrivals over the last 8 weeks, including walk-ins, excluding cancellations and no-shows. Changing the number keeps your override until learning is switched on again."}),We.enough?null:(0,W.jsx)(j.T,{center:!0,size:16,children:"Not enough real hourly history to learn yet. Using the starting or owner-set level."})]}),(0,W.jsx)(j.T,{children:"History needed before forecasts show"}),(0,W.jsx)(j.Row,{wrap:!0,gap:8,children:[1,2,3,4,6,8].map(e=>(0,W.jsx)(j.Chip,{testID:`adv-forecast-weeks-${e}`,label:1===e?'1 week':`${e} weeks`,selected:He===e,onPress:()=>X({forecastMinWeeks:e})},e))}),(0,W.jsx)(j.Muted,{size:13,children:`Forecasts, expected walk-ins and labour vs sales start once CoverCharge has ${1===He?'1 week':`${He} weeks`} of your bookings (and cash-ups for sales). Until then you see what is booked and your real labour cost, never invented figures.`}),(0,W.jsx)(j.Muted,{size:13,children:"Tip: 2 weeks is a sensible start. More weeks give steadier forecasts but take longer to begin."}),(0,W.jsx)(l.ForecastDaySettings,{r:x,set:X})]}),Ye=(0,w.depositOf)(J),Ge=e=>X({deposit:{...Ye,...e}}),qe=o.IS_GREENSIDE?(0,W.jsx)(a.GreensideCashOnly,{}):(0,W.jsxs)(y.default,{style:{gap:8},children:[(0,W.jsx)(j.Toggle,{testID:"adv-deposit-on",label:"Ask bigger tables for a deposit",value:Ye.on,onChange:e=>Ge({on:e})}),(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(j.T,{children:"Amount per adult"}),(0,W.jsx)(j.Stepper,{testID:"adv-deposit-amount",value:Ye.perPersonPence/100,min:0,max:100,format:e=>`\xa3${e}`,onChange:e=>Ge({perPersonPence:100*e}),label:"deposit per person"})]}),(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(j.T,{children:"From this many adults"}),(0,W.jsx)(j.Stepper,{testID:"adv-deposit-party",value:Ye.fromParty,min:1,max:30,onChange:e=>Ge({fromParty:e}),label:"deposit from this many adults"})]}),(0,W.jsx)(j.T,{children:"Refundable?"}),(0,W.jsxs)(j.Row,{wrap:!0,gap:8,children:[(0,W.jsx)(j.Chip,{testID:"adv-deposit-ref-yes",label:"Yes",selected:!0===Ye.refundable,onPress:()=>Ge({refundable:!0})}),(0,W.jsx)(j.Chip,{testID:"adv-deposit-ref-no",label:"No",selected:!1===Ye.refundable,onPress:()=>Ge({refundable:!1,cutoffHours:null})}),(0,W.jsx)(j.Chip,{testID:"adv-deposit-ref-unset",label:"Not set yet",selected:null===Ye.refundable,onPress:()=>Ge({refundable:null,cutoffHours:null})})]}),!0===Ye.refundable?(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(j.T,{children:"Refunded if cancelled this many hours before"}),(0,W.jsx)(j.Stepper,{testID:"adv-deposit-cutoff",value:Ye.cutoffHours??0,min:0,max:168,step:6,format:e=>e?`${e} h`:'Any time',onChange:e=>Ge({cutoffHours:e||null}),label:"refund cut-off hours"})]}):null,(0,W.jsx)(j.T,{children:"Words guests see (optional)"}),(0,W.jsx)(n.TextInput,{accessibilityLabel:"Deposit policy shown to guests",testID:"adv-deposit-policy",value:Ye.policy,multiline:!0,onChangeText:e=>Ge({policy:e.slice(0,600)}),placeholder:"e.g. The deposit comes off your bill on the night.",placeholderTextColor:D.colours.muted,style:{minHeight:70,borderRadius:10,borderWidth:1,borderColor:D.colours.hairline,backgroundColor:D.colours.surface2,color:D.colours.text,padding:10,fontSize:15}}),(0,W.jsx)(j.Muted,{size:13,children:Ye.on&&Ye.perPersonPence>0?`Guests booking for ${Ye.fromParty} or more adults see: \u201c${(0,w.depositWords)(Ye,Ye.fromParty,x.name).join(' ')}\u201d`:'Off: no booking asks for a deposit.'}),(0,W.jsx)(j.Toggle,{testID:"adv-deposit-wixlinks",label:"Send website bookings deposit links for phone and walk-in bookings",a11y:"Send website bookings deposit links for phone and walk-in bookings",value:!!Ye.wixLinksOn,onChange:e=>Ge({wixLinksOn:e})}),Ye.wixLinksOn?(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(j.T,{children:"Link works for"}),(0,W.jsx)(j.Stepper,{testID:"adv-deposit-linkhours",value:Ye.wixLinkHours??48,min:6,max:168,step:6,format:e=>`${e} hours`,onChange:e=>Ge({wixLinkHours:e}),label:"hours a deposit link works"})]}):null,(0,W.jsx)(j.Muted,{size:13,children:Ye.wixLinksOn?'On here, but website bookings deposit links also need the server switch, which stays off until the first \xa31 test is approved. Until then the button says so and nothing goes to website bookings.':'Off: no deposit links. Bookings work as before.'}),(0,W.jsx)(j.Muted,{size:13,children:"Tip: deposits are paid through website bookings, never in CoverCharge, and no card is saved. Guests who book on your website pay there, and the booking shows Deposit paid on website bookings by itself. For phone and walk-in bookings, tick Deposit paid once the guest has paid you, or send a website bookings deposit link. Refunds are done in Website bookings \u203a Orders. Deposit amounts are shown on bookings in Managers, Display and Staff. This does not grant access to other financial or HR information."})]}),Ke=(0,W.jsx)(k.LoyaltySettingsPanel,{}),Qe=(0,W.jsx)(se,{rid:P}),Ve=[{id:'bookings',title:'Bookings',words:'allergen allergy dog dogs cap limit access wheelchair step-free vegan vegetarian veg table request',reset:['dogQuestion','maxDogsPerSlot','accessQuestion','dietQuestion','tableRequests'],body:re,help:'adv-bookings'},{id:'times',title:'Table times',words:'dwell table time turn how long minutes party size next table free',reset:['dwellBands','dwellLearn'],body:he,help:'adv-table-times'},{id:'reserve',title:'Reservable items',words:'platter seafood crab lobster reserve price stock',reset:['reservables','reserveStock'],body:ge,help:'adv-reservable'},{id:'events',title:'Regular events',words:'open mic night music night event repeat monthly weekly promote busier forecast last food',reset:['regularEvents'],body:je,help:'adv-events'},{id:'hours',title:'Kitchen hours & last food orders',words:'hours kitchen season winter summer open close closed special day last food orders cutoff drinks',reset:['hourSets','hourOverrides','lastFoodByDay','afterLastFood'],body:Pe,help:'adv-hours'},{id:'home',title:'Display & home',words:'covers counter flip sound takeaway next table free home display',reset:['coversCounter','nextTableFree','showTakeaway'],body:Oe,help:'adv-home'},{id:'deposits',title:'Deposits',words:'deposit deposits per person party size refund refundable cut off policy paid due booking money wix link pay link online',reset:['deposit'],body:qe,help:'adv-deposits'},{id:'loyalty',title:'Loyalty: stamp card, offers & bring a friend',words:'loyalty stamp stamps card reward rewards offer offers referral refer friend bring expiry',reset:[],body:Ke,help:'adv-loyalty',noReset:!0},{id:'tableorder',title:'Order at the table',words:'order at table qr code scan phone guest menu tables areas accept first order last orders kitchen cut off print sheet pdf pay bar till',reset:[],body:o.IS_GREENSIDE?(0,W.jsx)(a.GreensideCashOnly,{}):(0,W.jsx)(r.TableOrderSettings,{rid:P,me:V}),help:'adv-table-order',noReset:!0},{id:'whatsapp',title:'WhatsApp',words:'whatsapp wa.me message chat guest phone mobile number tap',reset:['whatsapp'],body:Fe,help:'adv-whatsapp'},{id:'reminders',title:'Reminders',words:'reminder reminders break breaks chairs tables close closing shift staff nudge 6 hours law snooze later done',reset:[],body:Qe,help:'adv-reminders',onReset:()=>Z(P)},{id:'notifications',title:'Notifications',words:'notification notifications push phone scheduled order milk mills pieroni pieronis fish veg olsen rota upload remind time send',reset:[],body:(0,W.jsx)(B.NotificationsSettings,{rid:P}),help:'adv-notifications',onReset:()=>F.useNotifs.getState().resetSeeds(P)},{id:'orderlists',title:'Order lists',words:'order list lists alsons drinks cash carry trip shopping supplier logo staff add',reset:[],body:(0,W.jsx)(B.OrderListsSettings,{rid:P}),help:'adv-order-lists',onReset:()=>(0,B.resetOrderLists)(P)},{id:'tasks',title:'Tasks',words:'daily tasks library jobs checklist duties to do todo',reset:[],body:(0,W.jsx)(c.TaskLibrarySettings,{rid:P}),help:'adv-tasks',onReset:()=>b.useDailyTasks.getState().resetLibrary(P)},{id:'cashup',title:'Cash up',words:'cash up sheet takings till float card cash tips weekly sales report pos printout figures fields vat covers',reset:[],body:(0,W.jsx)(p.CashUpSettings,{rid:P}),help:'adv-cashup',onReset:()=>g.useCashUp.getState().resetFields(P)},{id:'tips',title:'Tips',words:'tips pot today tips show hide staff apps payout correction',reset:[],body:(0,W.jsx)(p.TipsSettings,{rid:P}),help:'adv-tips',onReset:()=>g.useCashUp.getState().setShow(P,{showToday:!0,showPot:!0})},{id:'clockarea',title:'Clock-in area',words:'clock in out geofence location area radius gps break forgot forgotten rota visiting map',reset:[],body:(0,W.jsx)(B.ClockAreaSettings,{rid:P,me:V}),help:'adv-clock-area',onReset:()=>(0,B.resetClockArea)(P,V)},{id:'checkout',title:'Shift check-out & question board',words:'check out checkout morale mood staffing staff enough overstaffed survey anonymous question board vote shout out shoutout wellbeing hr wording',reset:['hr'],body:(0,W.jsx)(u.HrSettingsCard,{rid:P}),help:'adv-checkout'},{id:'forecast',title:'Forecast history',words:'forecast history weeks estimate walk-ins opening hours minimum covers floor saturday sunday labour sales example figures not enough history',reset:['forecastMinWeeks'],body:Ue,help:'adv-forecast'},{id:'soldout',title:'Sold out reminders',words:'sold out 86 eighty six run out ran out back on clear end of service morning display strip auto automatic counts shellfish lobster crab platter link uses',reset:['soldOut'],body:Ne,help:'adv-soldout'},{id:'tablegrid',title:'Table plan grid',words:'table plan grid snap line up align tidy tables floor layout guides spacing restore',reset:[],body:(0,W.jsx)(z.GridSettings,{rid:P,me:V}),help:'adv-tablegrid',onReset:()=>{const e=A.useFloor.getState().settings[P];A.useFloor.getState().setSettings(P,{...A.DEFAULT_SETTINGS,...e??{},gridSnap:!0,gridSize:25})}},{id:'printers',title:'Printers',words:'print printer printers printing ticket tickets kitchen ticket docket receipt epson star bluetooth wifi reprint takeaway auto front of house copies',reset:[],body:(0,W.jsx)($.PrintersSettings,{rid:P,go:e}),help:'adv-printers',onReset:()=>{const e=A.useFloor.getState().settings[P];e&&A.useFloor.getState().setSettings(P,{...e,printing:void 0})}},{id:'blocks',title:'Block bookings: lunch, dinner and website bookings',words:'block blocks blocked pause close lunch dinner service times wix website online push',reset:[],noReset:!0,body:(0,W.jsx)(d.BlockSettings,{rid:P}),help:'adv-blocks'},{id:'giftqr',title:'Gift cards on the Display',words:'gift card cards voucher qr code display buy sell wix website page link',reset:[],noReset:!0,body:(0,W.jsx)(i.GiftQrSettings,{rid:P}),help:'adv-giftqr'},{id:'holidays',title:'Holiday names',words:'bank holiday substitute day names',reset:['holidayFullNames'],body:Ie,help:'adv-holidays'}],Ze=ee.trim().toLowerCase(),Je=(0,m.useMemo)(()=>Ve.filter(e=>!Ze||`${e.title} ${e.words}`.toLowerCase().includes(Ze)),[Ze,Ve]);return(0,W.jsxs)(y.default,{style:{gap:12},testID:"advanced-settings",children:[(0,W.jsx)(j.Muted,{children:"Owners and managers only. Changes are shared with your team\u2019s devices."}),(0,W.jsx)(n.TextInput,{accessibilityLabel:"Search settings",testID:"advanced-search",value:ee,onChangeText:te,placeholder:"Search, e.g. dogs, Open Mic Night, hours",placeholderTextColor:D.colours.muted,style:{minHeight:46,borderRadius:12,borderWidth:1,borderColor:D.colours.accentBorder,backgroundColor:D.colours.surface2,color:D.colours.text,paddingHorizontal:12,fontSize:16}}),oe?(0,W.jsx)(j.Banner,{kind:"success",title:oe}):null,Je.length?null:(0,W.jsxs)(j.Muted,{children:["No settings match \u201c",ee,"\u201d."]}),Je.map(s=>(0,W.jsx)(j.Card,{children:(0,W.jsxs)(y.default,{testID:`adv-${s.id}`,style:{gap:10},children:[(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(j.T,{size:17,weight:"semibold",colour:D.colours.gold,children:s.title}),e?(0,W.jsx)(f.default,{accessibilityRole:"button",accessibilityLabel:`Help: ${s.title}`,onPress:()=>e('more','help'),hitSlop:8,style:{minHeight:44,minWidth:44,justifyContent:'center'},children:(0,W.jsx)(j.T,{colour:D.colours.muted,children:"? Help"})}):null]}),s.body,s.noReset?null:(0,W.jsx)(j.Row,{style:{justifyContent:'flex-end'},children:(0,W.jsx)(j.Button,{small:!0,kind:"ghost",label:"Reset to default",testID:`reset-${s.id}`,onPress:()=>ne(s)})})]})},s.id))]})},Object.defineProperty(_e,"ADVANCED_DEFAULTS",{enumerable:!0,get:function(){return V}}),_e.SeasonsTodo=function({go:e}){const{r:s}=(0,R.useCtx)(6e4),t=(0,C.hourSetsOf)(s),o=[],a=t.filter(e=>!e.hours).map(e=>e.name);a.length&&o.push(`${a.join(' and ')} kitchen hours`);t.length>1&&t.some(e=>!e.start)&&o.push('the date each season starts');return o.length?(0,W.jsx)(j.Card,{onPress:()=>e('more','advanced'),highlight:D.colours.gold,children:(0,W.jsxs)(y.default,{testID:"seasons-todo",style:{gap:4},children:[(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(j.T,{weight:"semibold",colour:D.colours.gold,children:"Setup checklist: kitchen hours"}),(0,W.jsx)(j.T,{colour:D.colours.muted,children:"\u203a"})]}),(0,W.jsxs)(j.Muted,{size:13,children:["Please add ",o.join(' and ')," (Settings \u203a Advanced \u203a Kitchen hours). Until then the app uses the Winter hours all year."]})]})}):null};var s=_r(_d[0]),t=_r(_d[1]),o=_r(_d[2]),a=_r(_d[3]),n=_r(_d[4]),l=_r(_d[5]),r=_r(_d[6]),i=_r(_d[7]),d=_r(_d[8]),h=_r(_d[9]),u=_r(_d[10]),c=_r(_d[11]),p=_r(_d[12]),g=_r(_d[13]),b=_r(_d[14]),m=_r(_d[15]),x=e(m),f=e(_r(_d[16])),y=e(_r(_d[17])),j=_r(_d[18]),w=_r(_d[19]),k=_r(_d[20]),v=_r(_d[21]),C=_r(_d[22]),S=_r(_d[23]),T=_r(_d[24]),D=_r(_d[25]),R=_r(_d[26]),M=_r(_d[27]),L=_r(_d[28]),P=_r(_d[29]),O=_r(_d[30]),I=_r(_d[31]),z=_r(_d[32]),$=_r(_d[33]),A=_r(_d[34]),B=_r(_d[35]),F=_r(_d[36]),E=_r(_d[37]),N=_r(_d[38]),W=_r(_d[39]);const H=/^([01]\d|2[0-3]):[0-5]\d$/,U=/^(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/,_=/^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/,Y=[1,2,3,4,5,6,0],G=['Sun','Mon','Tue','Wed','Thu','Fri','Sat'];function q({value:e,onChange:s,placeholder:t,label:o,width:a=90,bad:l,testID:r}){return(0,W.jsx)(n.TextInput,{accessibilityLabel:o,testID:r,value:e,onChangeText:s,placeholder:t,placeholderTextColor:D.colours.muted,style:{width:a,minHeight:44,borderRadius:10,borderWidth:1,borderColor:l?D.colours.red:D.colours.hairline,backgroundColor:D.colours.surface2,color:D.colours.text,paddingHorizontal:10,fontSize:15}})}function K({value:e,onChange:s,min:t,max:o,unit:a,label:n,step:l=5}){const r=(a,l)=>(0,W.jsx)(f.default,{accessibilityRole:"button",accessibilityLabel:`${l<0?'Less':'More'}: ${n}`,onPress:()=>s(Math.min(o,Math.max(t,e+l))),style:{width:44,height:44,borderRadius:10,borderWidth:1,borderColor:D.colours.accentBorder,alignItems:'center',justifyContent:'center'},children:(0,W.jsx)(j.T,{size:20,colour:D.colours.gold,children:a})});return(0,W.jsxs)(j.Row,{gap:8,children:[r('\u2212',-l),(0,W.jsx)(j.T,{weight:"semibold",style:{minWidth:76,textAlign:'center'},children:a(e)}),r('+',l)]})}const Q=e=>e%60?`${Math.floor(e/60)}h ${e%60}m`:`${e/60} hour${60===e?'':'s'}`;const V={DEFAULT_DWELL:T.DEFAULT_DWELL,ANCHORAGE_SEASONS:C.ANCHORAGE_SEASONS};function Z(e){const s=P.useReminders.getState();s.ensure(e),s.resetRules(e),s.resetReminder((0,P.chairsId)(e))}const J=[1,2,3,4,5,6,0],X=e=>`${7===e.days.length?'Every day':J.filter(s=>e.days.includes(s)).map(e=>O.DAY_NAMES[e]).join(', ')||'No days'} at ${e.time} (UK time) \xb7 ${O.AUDIENCE_LABEL[e.audience]}`;function ee({init:e,onSave:s,onCancel:t}){const[o,a]=(0,m.useState)(e.text),[l,r]=(0,m.useState)(e.days),[i,d]=(0,m.useState)(e.time),[h,u]=(0,m.useState)(e.audience),c=o.trim().length>1&&l.length>0&&(0,O.validTime)(i);return(0,W.jsxs)(y.default,{testID:"reminder-editor",style:{gap:8,borderWidth:1,borderColor:D.colours.accentBorder,borderRadius:12,padding:10},children:[(0,W.jsx)(j.T,{weight:"semibold",children:"What it says"}),(0,W.jsx)(n.TextInput,{accessibilityLabel:"Reminder wording",testID:"reminder-text",value:o,onChangeText:a,maxLength:120,placeholder:"e.g. Time to put the chairs up on the tables",placeholderTextColor:D.colours.muted,style:{minHeight:44,borderRadius:10,borderWidth:1,borderColor:D.colours.hairline,backgroundColor:D.colours.surface2,color:D.colours.text,paddingHorizontal:10,fontSize:15}}),(0,W.jsx)(j.T,{weight:"semibold",children:"Days"}),(0,W.jsx)(j.Row,{wrap:!0,gap:6,children:J.map(e=>(0,W.jsx)(j.Chip,{label:O.DAY_NAMES[e],selected:l.includes(e),onPress:()=>r(l.includes(e)?l.filter(s=>s!==e):[...l,e])},e))}),(0,W.jsxs)(j.Row,{gap:8,children:[(0,W.jsx)(j.T,{weight:"semibold",children:"Time (UK)"}),(0,W.jsx)(q,{label:"Reminder time",testID:"reminder-time",value:i,onChange:d,placeholder:"21:00",bad:!(0,O.validTime)(i)})]}),(0,W.jsx)(j.T,{weight:"semibold",children:"Who sees it"}),(0,W.jsx)(j.Row,{wrap:!0,gap:6,children:['all','foh','kitchen'].map(e=>(0,W.jsx)(j.Chip,{label:O.AUDIENCE_LABEL[e],selected:h===e,onPress:()=>u(e)},e))}),c?null:(0,W.jsx)(j.Muted,{size:13,children:"Add the wording, at least one day and a time like 21:00."}),(0,W.jsxs)(j.Row,{gap:8,style:{justifyContent:'flex-end'},children:[(0,W.jsx)(j.Button,{small:!0,kind:"ghost",label:"Cancel",onPress:t}),(0,W.jsx)(j.Button,{small:!0,label:"Save reminder",testID:"reminder-save",disabled:!c,onPress:()=>s({text:o.trim(),days:[...l].sort(),time:i,audience:h})})]})]})}function se({rid:e}){x.default.useEffect(()=>{P.useReminders.getState().ensure(e)},[e]);const s=(0,P.useReminders)(e=>e.reminders),t=s.filter(s=>s.rid===e&&!s.removed),o=(0,P.useReminders)(s=>s.rules[e]),a=(0,O.clampRules)(o??O.DEFAULT_BREAK_RULES),n=(0,P.useReminders)(e=>e.done).filter(s=>s.rid===e).slice(0,5),l=(0,I.useOwner)(e=>e.staff),r=P.useReminders.getState(),[i,d]=(0,m.useState)(null),[h,u]=(0,m.useState)(null),c=s=>r.setRules(e,s);return(0,W.jsxs)(y.default,{style:{gap:10},testID:"reminders-settings",children:[(0,W.jsx)(j.Muted,{size:13,children:"Reminders slide up on the phones of staff who are on shift right now (clocked in, or on the rota at that time), in the Staff and Head Chef apps, while the app is open."}),(0,W.jsx)(j.T,{weight:"semibold",children:"Break reminders"}),(0,W.jsx)(j.Toggle,{label:"Remind staff to take their break",value:a.on,onChange:e=>c({on:e})}),(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},wrap:!0,children:[(0,W.jsx)(j.T,{center:!0,style:{width:'100%'},children:"First reminder, if the rota has no break time"}),(0,W.jsx)(K,{label:"first break reminder",step:15,min:30,max:O.LEGAL_LIMIT_MINS,value:a.afterMins,unit:e=>`${Q(e)} in`,onChange:e=>c({afterMins:e})})]}),(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},wrap:!0,children:[(0,W.jsx)(j.T,{style:{flex:1},children:"Remind once more after"}),(0,W.jsx)(K,{label:"second break reminder",step:5,min:5,max:120,value:a.repeatMins,unit:e=>`${e} min`,onChange:e=>c({repeatMins:e})})]}),(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},wrap:!0,children:[(0,W.jsx)(j.T,{style:{flex:1},children:"\u2018Later\u2019 hides it for"}),(0,W.jsx)(K,{label:"snooze",step:5,min:5,max:60,value:a.snoozeMins,unit:e=>`${e} min`,onChange:e=>c({snoozeMins:e})})]}),(0,W.jsxs)(j.Muted,{size:13,children:["How it works: if the shift on the rota has a break time, the reminder comes at that time. If not, it comes ",Q(a.afterMins)," after they clock in (or after the shift starts, if they haven\u2019t clocked in). If they still haven\u2019t started a break, it comes once more ",a.repeatMins," minutes later, and again at 6 hours. Nobody works more than 6 hours without a reminder: UK law says a shift over 6 hours needs a 20-minute break. \u2018Start break\u2019 starts their break, the same as on the clock screen."]}),(0,W.jsx)(j.T,{weight:"semibold",style:{marginTop:6},children:"Venue reminders"}),t.map(e=>(0,W.jsx)(y.default,{testID:`reminder-${e.builtIn??e.id}`,style:{gap:6,borderBottomWidth:1,borderColor:D.colours.hairline,paddingBottom:8},children:i===e.id?(0,W.jsx)(ee,{init:e,onCancel:()=>d(null),onSave:s=>{r.update(e.id,s),d(null)}}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},gap:8,children:[(0,W.jsx)(j.T,{weight:"semibold",style:{flex:1},children:e.text}),e.paused?(0,W.jsx)(j.Badge,{kind:"amber",label:"PAUSED"}):null]}),(0,W.jsx)(j.Muted,{size:13,children:X(e)}),h===e.id?(0,W.jsxs)(j.Row,{gap:8,wrap:!0,children:[(0,W.jsx)(j.T,{size:14,style:{flex:1},children:"Delete this reminder?"}),(0,W.jsx)(j.Button,{small:!0,kind:"danger",label:"Yes, delete it",onPress:()=>{r.remove(e.id),u(null)}}),(0,W.jsx)(j.Button,{small:!0,kind:"ghost",label:"Keep it",onPress:()=>u(null)})]}):(0,W.jsxs)(j.Row,{gap:8,wrap:!0,children:[(0,W.jsx)(j.Button,{small:!0,kind:"secondary",label:"Edit",testID:"reminder-edit",onPress:()=>d(e.id)}),(0,W.jsx)(j.Button,{small:!0,kind:"secondary",label:e.paused?'Resume':'Pause',onPress:()=>r.update(e.id,{paused:!e.paused})}),(0,W.jsx)(j.Button,{small:!0,kind:"ghost",label:"Delete",onPress:()=>u(e.id)})]})]})},e.id)),t.length?null:(0,W.jsx)(j.Muted,{children:"No venue reminders. Add one below, or Reset to default to bring back \u201cchairs up\u201d."}),'new'===i?(0,W.jsx)(ee,{init:{text:'',days:[5,6],time:'21:00',audience:'all'},onCancel:()=>d(null),onSave:s=>{r.add(e,s),d(null)}}):(0,W.jsx)(j.Button,{small:!0,kind:"secondary",label:"\uff0b Add a reminder",testID:"reminder-add",onPress:()=>d('new')}),n.length?(0,W.jsxs)(y.default,{style:{gap:2},children:[(0,W.jsx)(j.T,{weight:"semibold",children:"Recently done"}),n.map(e=>(0,W.jsxs)(j.Muted,{size:13,children:[new Date(e.at).toLocaleString('en-GB',{weekday:'short',day:'numeric',month:'short',hour:'2-digit',minute:'2-digit',timeZone:'Europe/London'})," \xb7 ",(l.find(s=>s.id===e.staffRef)?.name??e.staffName).replace(' (example)','')," \xb7 ",s.find(s=>s.id===e.reminderId)?.text??'Reminder']},e.id))]}):null,(0,W.jsxs)(j.Muted,{size:13,children:["Tip: once anyone taps Done, the reminder goes away for everyone that day, and you can see who did it here. \u2018Later\u2019 hides it on that phone for ",a.snoozeMins," minutes. Reset to default puts back the break times and \u201cchairs up\u201d (",(0,O.defaultChairs)('x',e).days.map(e=>O.DAY_NAMES[e]).join(' and '),", 21:00); your own reminders stay."]}),(0,W.jsx)(j.Muted,{size:13,children:"Reminders show while the app is open. Phones with the app closed don\u2019t get them yet."})]})}},1418,[1051,1031,805,1405,812,1419,1420,1422,1423,1424,1197,1029,1030,1006,1012,17,385,85,777,841,1425,816,862,1053,861,804,1055,858,1181,972,973,876,1426,1379,996,1427,1003,1139,939,8]); __d(function(g,_r,_i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.ForecastDaySettings=function({r:t,set:s}){const c=(0,o.forecastHoursOf)(t),y=(0,o.minCoversOf)(t),v=t.settings.minCoversNote??('anchorage'!==t.id||t.settings.minCoversByDay?void 0:o.MIN_COVERS_NOTE),x=(e,t,n)=>{const i=c[e]??['12:00','22:00'],o=0===t?[n,i[1]]:[i[0],n];h(o[0])&&h(o[1])&&s({forecastHours:{...c,[e]:o}})},f=(e,t)=>{const n=''===t.trim()?null:Math.max(0,Math.min(999,Math.round(Number(t)||0)));s({minCoversByDay:{...y,[e]:n||null},minCoversNote:void 0})};return(0,u.jsxs)(n.default,{style:{gap:8},testID:"forecast-day-settings",children:[(0,u.jsx)(i.T,{children:"Opening hours shown on the forecast"}),(0,u.jsx)(i.Muted,{size:13,children:"The hours your bar or dining room is open, so the forecast covers the whole day, not just kitchen hours. Any hour with a booking always shows."}),d.map(t=>(0,u.jsxs)(i.Row,{gap:8,style:{alignItems:'center'},children:[(0,u.jsx)(i.T,{center:!0,size:15,style:{width:'100%'},children:r.DAYS[t]}),c[t]?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(e.TextInput,{testID:`fc-open-${t}`,accessibilityLabel:`${r.DAYS[t]} opens`,defaultValue:c[t][0],onEndEditing:e=>x(t,0,e.nativeEvent.text),onBlur:e=>x(t,0,e?.target?.value??c[t][0]),style:[i.styles.input,{width:90,minHeight:44}]}),(0,u.jsx)(i.T,{size:15,children:"to"}),(0,u.jsx)(e.TextInput,{testID:`fc-close-${t}`,accessibilityLabel:`${r.DAYS[t]} closes`,defaultValue:c[t][1],onEndEditing:e=>x(t,1,e.nativeEvent.text),onBlur:e=>x(t,1,e?.target?.value??c[t][1]),style:[i.styles.input,{width:90,minHeight:44}]})]}):(0,u.jsx)(i.Muted,{children:"Kitchen hours"})]},`h${t}`)),(0,u.jsx)(i.T,{style:{marginTop:8},children:"Usual minimum Covers"}),(0,u.jsx)(i.Muted,{size:13,children:"The fewest Covers you always do on that day. The forecast never shows less. Leave blank if you have no usual minimum."}),d.map(t=>(0,u.jsxs)(i.Row,{gap:8,style:{alignItems:'center'},children:[(0,u.jsx)(i.T,{center:!0,size:15,style:{width:'100%'},children:r.DAYS[t]}),(0,u.jsx)(e.TextInput,{testID:`fc-min-${t}`,accessibilityLabel:`${r.DAYS[t]} usual minimum Covers`,keyboardType:"number-pad",defaultValue:y[t]?String(y[t]):'',placeholder:"Blank",placeholderTextColor:"#7D776C",onEndEditing:e=>f(t,e.nativeEvent.text),onBlur:e=>f(t,e?.target?.value??''),style:[i.styles.input,{width:90,minHeight:44}]}),(0,u.jsx)(i.Muted,{children:"Covers"})]},`m${t}`)),v?(0,u.jsxs)(i.T,{size:13,colour:l.colours.goldLight,children:["Set from ",v,"."]}):null,(0,u.jsx)(i.Muted,{size:13,children:"Tip: use a number you are sure of, such as the quietest Saturday in the last few months."})]})};var e=_r(_d[0]);_r(_d[1]);var t,s=_r(_d[2]),n=(t=s)&&t.__esModule?t:{default:t},i=_r(_d[3]),o=_r(_d[4]),r=_r(_d[5]),l=_r(_d[6]),u=_r(_d[7]);const d=[1,2,3,4,5,6,0],h=e=>/^([01]\d|2[0-3]):[0-5]\d$/.test(e)},1419,[812,17,85,777,1137,861,804,8]); __d(function(g,_r,i,_a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.TableOrderSettings=function({rid:s,me:a}){const k=(0,r.useRestaurant)(s),v=(0,o.usePlan)(s),T=(0,h.staffServer)(),R=!T||(0,b.can)('venue.settings'),[C,S]=(0,t.useState)({...c.TABLE_ORDER_DEFAULT}),[N,P]=(0,t.useState)([]),[$,D]=(0,t.useState)(null),[M,Q]=(0,t.useState)(!1),[O,B]=(0,t.useState)(!1),[A,I]=(0,t.useState)(null),[_,L]=(0,t.useState)(null),[F,E]=(0,t.useState)('sticker'),G=(0,t.useCallback)(async()=>{if(T)try{S(await(0,u.loadTableSettings)()),B(!1),(0,b.can)('venue.settings')&&(P(await(0,u.listTableCodes)()),I(await(0,u.tableReadiness)().catch(()=>null)))}catch(e){D({kind:'danger',t:`Couldn't load: ${e.message}`})}},[T]);(0,t.useEffect)(()=>(G(),T?(0,u.watchTableSettings)(()=>{O||G()}):void 0),[G]);const z=e=>{S(t=>({...t,...e})),B(!0),D(null)},W=v.tables.map(e=>e.name).filter(c.isTableNo).sort((e,t)=>Number(e)-Number(t)),H=C.tables??W,U=e=>z({tables:H.includes(e)?H.filter(t=>t!==e):[...H,e].sort((e,t)=>Number(e)-Number(t))}),Y=e=>v.tables.filter(t=>t.areaId===e).map(e=>e.name).filter(c.isTableNo),q=e=>{const t=Y(e);return t.length>0&&t.every(e=>H.includes(e))},J=e=>{const t=Y(e),s=q(e);z({tables:s?H.filter(e=>!t.includes(e)):[...new Set([...H,...t])].sort((e,t)=>Number(e)-Number(t))})},K=async()=>{Q(!0);try{const e=C.tables&&C.tables.length===W.length&&W.every(e=>C.tables.includes(e))?null:C.tables;T&&await(0,u.saveTableSettings)({...C,tables:e},a),r.useStore.getState().updateSettings(s,{orderAtTable:C.on}),B(!1),D({kind:'success',t:C.on?'Saved. Guests can order from the tables you picked.':'Saved. Order at the table is off.'})}catch(e){D({kind:'danger',t:`Not saved: ${e.message}`})}Q(!1)},V=async()=>{Q(!0);try{const e=await(0,u.makeTableCodes)(H);P(await(0,u.listTableCodes)()),D({kind:'success',t:e.made?`Made ${e.made} new QR code${e.made>1?'s':''}.`:'Every table you picked already has a code.'})}catch(e){D({kind:'danger',t:e.message})}Q(!1)},X=async t=>{Q(!0),L(null);try{await(0,u.renewTableCode)(t),P(await(0,u.listTableCodes)()),D({kind:'warn',t:`Table ${(0,e.tableNumbers)(t)} has a new code. The old QR on that table has stopped working, so print this one and swap it.`})}catch(e){D({kind:'danger',t:e.message})}Q(!1)},Z=e=>{const t=N.filter(t=>e?t.table===e:H.includes(t.table)),s=(0,p.printQrSheet)(k?.name??'Our venue',t.map(e=>({table:e.table,link:(0,c.tableLink)(w(),e.token)})),{logo:`${w()}/customer-app/brand-logo.png`,size:F});D(s?{kind:'success',t:'QR sheet opened. Choose "Save as PDF" or your printer.'}:{kind:'warn',t:'Printing works from the web app on a computer or tablet.'})};return T?(0,f.jsxs)(n.default,{style:{gap:10},testID:"table-order-settings",children:[(0,f.jsx)(l.Muted,{center:!0,children:"Tip: start with a few tables and keep \"Staff accept the first order\" on. Guests pay at the bar or with their server, and the kitchen gets the order like any other ticket."}),A&&A.priced>0&&A.signedz({on:e}),disabled:!R,testID:"tos-on"}),(0,f.jsx)(l.Toggle,{label:"Staff accept the first order from each new phone",value:C.staffAccept,onChange:e=>z({staffAccept:e}),disabled:!R}),(0,f.jsx)(l.Muted,{children:"On is safer: someone sat at the table can't be told apart from someone who photographed the QR. After staff accept one order, that phone's next orders go straight to the kitchen for 12 hours."}),(0,f.jsx)(l.T,{weight:"semibold",children:"Which areas and tables"}),(0,f.jsx)(l.Row,{wrap:!0,gap:6,children:v.areas.filter(e=>Y(e.id).length).map(e=>(0,f.jsx)(l.Chip,{label:e.name,selected:q(e.id),onPress:R?()=>J(e.id):void 0},e.id))}),(0,f.jsx)(l.Row,{wrap:!0,gap:6,children:W.map(t=>(0,f.jsx)(l.Chip,{label:`${(0,e.tableNumbers)(t)}`,selected:H.includes(t),onPress:R?()=>U(t):void 0},t))}),(0,f.jsxs)(l.Muted,{children:[C.tables?`${H.length} of ${W.length} tables`:'All tables',"."]}),(0,f.jsx)(l.T,{weight:"semibold",children:"Hours"}),(0,f.jsxs)(l.Row,{style:{justifyContent:'space-between'},children:[(0,f.jsx)(l.T,{children:"Opens at"}),(0,f.jsx)(l.Stepper,{label:"Opens at",value:j(C.openFrom),min:-15,max:1425,step:15,format:y,onChange:e=>R&&z({openFrom:x(e)})})]}),(0,f.jsxs)(l.Row,{style:{justifyContent:'space-between'},children:[(0,f.jsx)(l.T,{children:"Last orders (kitchen cut-off)"}),(0,f.jsx)(l.Stepper,{label:"Last orders",value:j(C.lastOrders),min:-15,max:1425,step:15,format:y,onChange:e=>R&&z({lastOrders:x(e)})})]}),(0,f.jsx)(l.Muted,{children:(0,c.hoursWords)(C)}),(0,f.jsx)(l.Field,{label:"Note guests see above the menu (optional)",value:C.guestTip,onChangeText:e=>z({guestTip:e.slice(0,160)}),editable:R,placeholder:"e.g. Drinks are ordered at the bar."}),R?(0,f.jsx)(l.Button,{label:M?'Saving\u2026':'Save order at the table',disabled:M||!O,onPress:()=>{K()},testID:"tos-save"}):null,$?(0,f.jsx)(l.Banner,{kind:$.kind,children:$.t}):null,R?(0,f.jsxs)(l.Card,{children:[(0,f.jsxs)(l.Row,{style:{justifyContent:'space-between'},children:[(0,f.jsx)(l.T,{weight:"semibold",children:"QR codes"}),(0,f.jsx)(l.Badge,{kind:"gold",label:`${N.length} made`})]}),(0,f.jsx)(l.Muted,{children:"Each table gets its own code. A guest can only order with the code that's on the table."}),(0,f.jsx)(l.T,{center:!0,size:13,weight:"semibold",children:"Card size"}),(0,f.jsx)(n.default,{testID:"tos-card-size",children:(0,f.jsx)(l.Row,{gap:6,wrap:!0,style:{justifyContent:'center'},children:Object.keys(p.QR_CARD).map(e=>(0,f.jsx)(l.Chip,{label:p.QR_CARD[e].label,selected:F===e,onPress:()=>E(e)},e))})}),(0,f.jsxs)(l.Muted,{center:!0,children:['sticker'===F?'For stickers and small QR table stands: 20 to a page, QR 30 mm.':'For table stand cards (about 2 \xd7 3 in): 16 to a page, QR 34 mm, with the short link.'," Print at 100% (actual size), then cut along the dashed lines."]}),(0,f.jsxs)(l.Row,{gap:8,wrap:!0,style:{justifyContent:'center'},children:[(0,f.jsx)(l.Button,{small:!0,label:"Make codes for the tables picked",disabled:M,onPress:()=>{V()}}),(0,f.jsx)(l.Button,{small:!0,kind:"secondary",label:"Print all QR cards",disabled:!N.length,onPress:()=>Z(),testID:"tos-print"})]}),N.map(t=>(0,f.jsxs)(l.Row,{style:{justifyContent:'space-between'},children:[(0,f.jsxs)(l.T,{children:["Table ",(0,e.tableNumbers)(t.table),H.includes(t.table)?'':' (not taking orders)']}),(0,f.jsxs)(l.Row,{gap:6,children:[(0,f.jsx)(l.Button,{small:!0,kind:"secondary",label:"Reprint",accessibilityLabel:`Reprint the QR for table ${t.table}`,disabled:M,onPress:()=>Z(t.table),testID:`tos-reprint-${t.table}`}),(0,f.jsx)(l.Button,{small:!0,kind:"ghost",label:"New code",accessibilityLabel:`New code for table ${t.table}`,disabled:M,onPress:()=>L(t.table),testID:`tos-renew-${t.table}`})]})]},t.table)),(0,f.jsx)(l.Muted,{children:"Lost or copied QR? Make a new code for that table; the old one stops working."})]}):null,(0,f.jsxs)(l.Card,{children:[(0,f.jsx)(l.T,{center:!0,weight:"semibold",children:"Paying"}),(0,f.jsx)(l.Muted,{center:!0,children:"Guests pay at the bar or with their server. Paying by card from the phone is coming later; no card details are asked for."})]}),_?(0,f.jsxs)(l.Sheet,{visible:!0,onClose:()=>L(null),title:`New code for table ${(0,e.tableNumbers)(_)}?`,maxWidth:520,testID:"tos-renew-confirm",children:[(0,f.jsxs)(l.T,{center:!0,children:["The QR code on table ",(0,e.tableNumbers)(_)," stops working straight away. Guests who scan the old one are told to ask a member of staff."]}),(0,f.jsx)(l.Muted,{center:!0,children:"Print the new one and swap it on the table."}),(0,f.jsx)(l.Button,{label:"Yes, make a new code",onPress:()=>{X(_)},testID:"tos-renew-yes"}),(0,f.jsx)(l.Button,{kind:"secondary",label:"Cancel",onPress:()=>L(null)})]}):null]}):(0,f.jsx)(l.Banner,{kind:"demo",title:"Needs the venue connection",children:"Order at the table runs on the server, so it works once this app is connected to your venue. Nothing here is sent anywhere."})};var e=_r(d[0]),t=_r(d[1]);_r(d[2]);var s,a=_r(d[3]),n=(s=a)&&s.__esModule?s:{default:s},l=_r(d[4]),r=_r(d[5]),o=_r(d[6]),c=_r(d[7]),h=_r(d[8]),b=_r(d[9]),u=_r(d[10]),p=_r(d[11]),f=_r(d[12]);const w=()=>'undefined'!=typeof window&&/^https:/.test(window.location.origin)?window.location.origin:"https://covercharge-apps.static.hf.space",j=e=>e?60*Number(e.slice(0,2))+Number(e.slice(3,5)):-15,x=e=>e<0?null:(0,c.hm)(e),y=e=>e<0?'Not set':(0,c.hm)(e)},1420,[843,17,219,85,777,858,996,1150,1253,946,1324,1421,8]); __d(function(g,_r,_i,a,_m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.qrSvg=n,Object.defineProperty(e,"QR_CARD",{enumerable:!0,get:function(){return r}}),e.qrSheetHtml=s,e.printQrSheet=function(t,o,i={}){if('undefined'==typeof window||!window.open)return!1;const n=window.open('','_blank');return!!n&&(n.document.write(s(t,o,i)),n.document.close(),n.focus(),setTimeout(()=>{try{n.print()}catch{}},800),!0)};var t=_r(_d[0]);const o=_r(_d[1]),i=t=>t.replace(/[&<>"']/g,t=>({'&':'&','<':'<','>':'>','"':'"',"'":'''}[t]));function n(t,i=220){const n=o.create(t,{errorCorrectionLevel:'M'}).modules,r=n.size,s=r+8;let l='';for(let t=0;t`}const r={sticker:{w:50,h:50,qr:30,cols:4,rows:5,label:'Stickers 50 \xd7 50 mm'},stand:{w:50,h:70,qr:34,cols:4,rows:4,label:'Stand cards 50 \xd7 70 mm'}};function s(o,s,l={}){const d=l.size??'sticker',c=r[d],m='stand'===d,h=l.logo?``:'',f=o=>`
${h}
${i((0,t.tableNumbersA11y)(o.table))}
${n(o.link,240)}
Scan to order
${m?`
Pay at the bar or with your server
${i(o.link.replace(/^https?:\/\//,''))}
`:''}
`,p=c.cols*c.rows,u=[];for(let t=0;t${s.slice(t,t+p).map(f).join('')}`);return`${i(o)} table QR codes \xb7 ${c.label}

${i(o)} \xb7 ${c.label} \xb7 cut along the dashed lines \xb7 print at 100% (actual size, not "fit to page")

${u.join('')}`}},1421,[843,1275]); @@ -1591,7 +1591,7 @@ __d(function(g,_r,_i,_a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModu __d(function(g,_r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.deviceKind=o,e.deviceSyncLine=function(r,c){const l=Date.parse(r.seen_at),u=r.last_synced_at?Date.parse(r.last_synced_at):0,$=c-l>18e4,h=!u||l-u>6e4,p=!$&&!h,_=`${t[r.app]??r.app}${r.who?` \xb7 ${r.who}`:''} \xb7 ${o(r.user_agent)}`,f=$?`Not reporting since ${n(r.seen_at)} (${s(c-l)})${u?`, last synced ${n(r.last_synced_at)}`:''}`:h?`Out of sync${u?` since ${n(r.last_synced_at)}`:''}, reconnecting`:`In sync \xb7 last synced ${n(r.last_synced_at)} (${s(c-u)})`,y=[r.version??'','SUBSCRIBED'===r.realtime?'live channel on':`live channel ${String(r.realtime??'off').toLowerCase()}`];r.pending&&y.push(`${r.pending} change${1===r.pending?'':'s'} waiting`);r.failed&&y.push(`${r.failed} not saved`);return{ok:p,title:_,state:f,detail:y.filter(Boolean).join(' \xb7 ')}};const t={owner:'Managers',staff:'Staff',chef:'Chef',display:'Display',car:'Car'},n=t=>new Date(t).toLocaleTimeString('en-GB',{hour:'2-digit',minute:'2-digit',timeZone:'Europe/London'}),s=t=>t<9e4?`${Math.max(0,Math.round(t/1e3))} s ago`:t<54e5?`${Math.round(t/6e4)} min ago`:`${Math.round(t/36e5)} h ago`;function o(t){const n=t??'';return/CoverChargeTablet|TB\d|Tablet/i.test(n)?'tablet':/iPhone/i.test(n)?'iPhone':/iPad/i.test(n)?'iPad':/Android/i.test(n)?'Android':/Tesla/i.test(n)?'car':/Mac OS X|Windows|Linux/i.test(n)?'computer':'device'}},1508,[]); __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.TableQrPage=function(){const{rid:e,me:t}=(0,h.useCtx)(6e4),b=t.replace(' (example)','');return(0,u.jsxs)(s.default,{style:{gap:14,width:'100%',maxWidth:760,alignSelf:'center'},testID:"table-qr-page",children:[(0,u.jsx)(l.T,{center:!0,size:22,weight:"semibold",colour:o.colours.gold,accessibilityRole:"header",children:"Table QR codes"}),(0,u.jsx)(l.Muted,{center:!0,children:"Guests scan the code on their table, see the menu and send their order to the kitchen. They pay at the bar or with their server."}),(0,u.jsx)(c.TableOrderSettings,{rid:e,me:b}),(0,u.jsx)(l.T,{center:!0,size:20,weight:"semibold",colour:o.colours.gold,accessibilityRole:"header",children:"Orders from the tables"}),(0,u.jsx)(n.StaffTableOrders,{rid:e,me:b})]})},r(d[0]);var e,t=r(d[1]),s=(e=t)&&e.__esModule?e:{default:e},l=r(d[2]),o=r(d[3]),c=r(d[4]),n=r(d[5]),h=r(d[6]),u=r(d[7])},1509,[17,85,777,804,1420,1498,1055,8]); __d(function(g,_r,_i,_a,_m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.showMe=j,_e.HelpPage=function({go:e}){const[s,a]=(0,n.useState)(''),[r,h]=(0,n.useState)(null),[p,m]=(0,n.useState)(null),j=(0,n.useMemo)(()=>s.trim()?(0,u.searchHelp)(c.HELP,s,10).map(e=>e.a):c.HELP.filter(e=>!r||e.topic===r),[s,r]);return(0,f.jsxs)(o.default,{style:{gap:10},testID:"help-page",children:[(0,f.jsxs)(o.default,{style:[i.styles.input,{flexDirection:'row',alignItems:'center',gap:8,paddingVertical:4}],children:[(0,f.jsx)(i.T,{colour:x.colours.muted,children:"\ud83d\udd0d"}),(0,f.jsx)(t.TextInput,{testID:"help-search",value:s,onChangeText:a,placeholder:"Search help",placeholderTextColor:"#7D776C",accessibilityLabel:"Search help",style:{flex:1,minWidth:0,width:0,boxSizing:'border-box',color:x.colours.text,paddingVertical:8,fontSize:16,outlineStyle:'none'}}),s?(0,f.jsx)(l.GoldClose,{testID:"help-search-clear",size:"sm",label:"Clear search",onPress:()=>a('')}):null]}),(0,f.jsx)(b,{go:e}),s?(0,f.jsx)(i.Muted,{children:j.length?`${j.length} result${1===j.length?'':'s'} for \u201c${s.trim()}\u201d`:`Nothing for \u201c${s.trim()}\u201d. Try other words, or ask the Assistant above.`}):(0,f.jsx)(i.Row,{wrap:!0,gap:6,children:[null,...c.HELP_TOPICS].map(e=>(0,f.jsx)(i.Chip,{label:e??'All',selected:r===e,onPress:()=>h(e)},e??'all'))}),j.map((t,l)=>(0,f.jsx)(y,{a:t,go:e,open:p===t.id||!!s&&0===l&&null===p,onToggle:()=>m(p===t.id?'':t.id)},t.id)),(0,f.jsxs)(i.Card,{style:{alignItems:'center'},children:[(0,f.jsx)(i.T,{center:!0,weight:"semibold",colour:x.colours.gold,children:"Chat with CoverCharge support"}),(0,f.jsx)(i.Muted,{center:!0,children:"Send a message to the CoverCharge team. Nobody replies automatically."}),(0,f.jsx)(i.Button,{label:"Open the chat",accessibilityLabel:"Open the chat with CoverCharge support",onPress:()=>e('more','support')})]})]})},_e.AskAssistant=b;var t=_r(d[0]),s=_r(d[1]),l=_r(d[2]),n=_r(d[3]),a=e(_r(d[4])),o=e(_r(d[5])),i=_r(d[6]),r=_r(d[7]),h=_r(d[8]),c=_r(d[9]),u=_r(d[10]),p=_r(d[11]),x=_r(d[12]),m=_r(d[13]),f=_r(d[14]);function j(e,t){e.showMe&&(t(e.showMe.tab,e.showMe.page??null),setTimeout(()=>h.useCoach.getState().show(e.showMe.target,e.showMe.hint),300))}function y({a:e,go:t,open:s,onToggle:l}){return(0,f.jsx)(o.default,{testID:`help-${e.id}`,children:(0,f.jsxs)(i.Card,{children:[(0,f.jsx)(a.default,{accessibilityRole:"button",onPress:l,children:(0,f.jsxs)(i.Row,{style:{justifyContent:'space-between'},gap:8,children:[(0,f.jsxs)(o.default,{style:{flex:1},children:[(0,f.jsx)(i.T,{weight:"semibold",children:e.title}),(0,f.jsxs)(i.Row,{gap:6,children:[(0,f.jsx)(i.Badge,{kind:'guide'===e.kind?'gold':'neutral',label:'guide'===e.kind?'Step by step':'FAQ'}),(0,f.jsx)(i.Muted,{size:12,children:e.topic})]})]}),(0,f.jsx)(i.T,{colour:x.colours.muted,children:s?'\u25be':'\u203a'})]})}),s?(0,f.jsxs)(o.default,{style:{gap:6},children:[(0,f.jsx)(i.Muted,{children:e.body}),e.steps?.map((e,t)=>(0,f.jsxs)(i.Row,{gap:8,style:{alignItems:'flex-start'},children:[(0,f.jsx)(o.default,{style:{width:22,height:22,borderRadius:11,backgroundColor:x.colours.gold,alignItems:'center',justifyContent:'center'},children:(0,f.jsx)(i.T,{size:12,weight:"bold",colour:"#1A1408",children:t+1})}),(0,f.jsx)(i.T,{style:{flex:1},children:e})]},t))]}):null,e.showMe?(0,f.jsx)(i.Row,{wrap:!0,gap:6,children:(0,f.jsx)(i.Button,{small:!0,kind:"success",label:"Show me",testID:`showme-${e.id}`,onPress:()=>j(e,t)})}):null]})})}function b({go:e}){const{rid:t,today:s}=(0,m.useCtx)(6e4),l={rid:t,today:s,go:(t,s)=>e(t,s??null)},[a,r]=(0,n.useState)(''),[h,u]=(0,n.useState)(null),[y,b]=(0,n.useState)(null),k=async()=>{const e=a.trim();if(!e)return;b(null),u(null);const t=(0,p.matchIntent)(e,s);if('action'!==t.kind)'help'!==t.kind?b({text:'Sorry, I didn\u2019t follow that. Try \u201cadd a walk-in for 4 at table 7\u201d, \u201cput Ellie on Friday 5 till 11\u201d, or ask \u201chow do I export hours?\u201d.',kind:'note'}):b({text:'Here\u2019s what I found. Tap Show me and I\u2019ll point to it.',kind:'note',help:t.ids});else{if(!(0,p.needsConfirm)(t.action.risk)){const e=await(0,p.runAction)(t.action.id,t.params,l);return void b({text:'done'===e.status?e.message:e.message??'',kind:'done'})}u({action:t.action,params:{...w(t.action,s),...t.params},asked:e})}};return(0,f.jsx)(o.default,{testID:"ask-assistant",children:(0,f.jsxs)(i.Card,{highlight:x.colours.gold,children:[(0,f.jsxs)(i.Row,{gap:8,children:[(0,f.jsx)(o.default,{style:{width:28,height:28,borderRadius:14,backgroundColor:x.colours.gold,alignItems:'center',justifyContent:'center'},children:(0,f.jsx)(i.T,{weight:"bold",colour:"#1A1408",children:"\u2726"})}),(0,f.jsx)(i.T,{weight:"semibold",style:{flex:1},children:"Ask the Assistant"})]}),(0,f.jsxs)(o.default,{testID:"help-assistant-stack",style:{gap:8,width:'100%',minWidth:0},children:[(0,f.jsx)(i.Field,{label:"Ask or tell it what to do",testID:"assistant-input",value:a,onChangeText:r,placeholder:"Ask in plain words",onSubmitEditing:k,returnKeyType:"send",style:{width:'100%',minWidth:0,boxSizing:'border-box'}}),(0,f.jsx)(i.Button,{label:"Ask",testID:"assistant-ask",disabled:!a.trim(),onPress:k,style:{width:'100%',minWidth:0,minHeight:52}})]}),(0,f.jsx)(i.Row,{wrap:!0,gap:6,children:['Add a walk-in for 4 at table 7','Put a shift on Friday 5 till 11','How do I export hours for payroll?','Pay out the tips'].map(e=>(0,f.jsx)(i.Chip,{label:e,onPress:()=>r(e)},e))}),h?(0,f.jsx)(C,{p:h,today:s,onChange:e=>u({...h,params:e}),onConfirm:async()=>{if(!h)return;const e=await(0,p.runAction)(h.action.id,h.params,l,!0);u(null),r(''),b('done'===e.status?{text:e.message,kind:'done'}:'demo_only'===e.status?{text:e.message,kind:'demo'}:{text:e.message??'Couldn\u2019t do that.',kind:'error'})},onCancel:()=>{u(null),b({text:'Cancelled. Nothing was changed.',kind:'note'})}}):null,y?(0,f.jsxs)(o.default,{style:{gap:6},testID:"assistant-reply",children:[(0,f.jsx)(i.Banner,{kind:'done'===y.kind?'success':'error'===y.kind?'warn':'demo'===y.kind?'demo':'info',title:y.text}),y.help?.map(t=>{const s=(0,c.helpById)(t);return(0,f.jsxs)(i.Row,{gap:6,style:{justifyContent:'space-between'},children:[(0,f.jsx)(i.T,{style:{flex:1},children:s.title}),s.showMe?(0,f.jsx)(i.Button,{small:!0,kind:"success",label:"Show me",onPress:()=>j(s,e)}):null]},t)})]}):null,(0,f.jsx)(i.Muted,{size:12,children:"It shows you what it will do and waits for your tap. It never sends, pays or deletes anything."})]})})}function w(e,t){return'add_rota_shift'===e.id?{date:t,start:17,end:23}:'add_walkin'===e.id?{covers:2}:{}}function C({p:e,today:t,onChange:l,onConfirm:n,onCancel:a}){const h=(0,r.useOwner)(e=>e.staff).filter(e=>e.active),c=(0,p.demoOnly)(e.action.risk),u=(t,s)=>l({...e.params,[t]:s}),m=e.action,j=e.params,y=m.params.every(e=>!e.required||void 0!==j[e.name]&&''!==j[e.name]);return(0,f.jsxs)(o.default,{testID:"assistant-confirm",style:{borderWidth:2,borderColor:c?x.colours.red:x.colours.ok,borderRadius:14,padding:12,gap:8,backgroundColor:c?'#2a1010':x.colours.okBg},children:[(0,f.jsxs)(i.Row,{gap:6,children:[(0,f.jsx)(i.Badge,{kind:c?'red':'ok',label:p.RISK_LABEL[m.risk]}),(0,f.jsx)(i.T,{weight:"semibold",style:{flex:1},children:m.title})]}),m.form&&'add_walkin'===m.id?(0,f.jsxs)(i.Row,{gap:6,children:[(0,f.jsx)(o.default,{style:{flex:1},children:(0,f.jsx)(i.Field,{label:"Covers",value:void 0===j.covers?'':String(j.covers),onChangeText:e=>u('covers',e.replace(/\D/g,'')?Number(e.replace(/\D/g,'')):void 0),keyboardType:"number-pad"})}),(0,f.jsx)(o.default,{style:{flex:1},children:(0,f.jsx)(i.Field,{label:"Table (optional)",value:void 0===j.table?'':String(j.table),onChangeText:e=>u('table',e.trim()?e.trim().toUpperCase():void 0)})})]}):null,m.form&&'add_rota_shift'===m.id?(0,f.jsxs)(o.default,{style:{gap:6},children:[(0,f.jsx)(i.Muted,{size:12,children:"Who"}),(0,f.jsx)(i.Row,{wrap:!0,gap:6,children:h.slice(0,14).map(e=>(0,f.jsx)(i.Chip,{label:e.name.replace(' (example)','').split(' ')[0],selected:j.staffId===e.id,onPress:()=>u('staffId',e.id)},e.id))}),(0,f.jsxs)(i.Row,{gap:6,children:[(0,f.jsx)(o.default,{style:{flex:1.3},children:(0,f.jsx)(i.Field,{label:"Date (DD/MM/YYYY)",...(0,s.slashBox)(String(j.date??t),e=>u('date',e)),placeholder:"20/11/2026",keyboardType:"numbers-and-punctuation",maxLength:10})}),(0,f.jsx)(o.default,{style:{flex:1},children:(0,f.jsx)(i.Field,{label:"Start (24h)",value:String(j.start??''),onChangeText:e=>u('start',''===e?void 0:Number(e)),keyboardType:"decimal-pad"})}),(0,f.jsx)(o.default,{style:{flex:1},children:(0,f.jsx)(i.Field,{label:"End (24h)",value:String(j.end??''),onChangeText:e=>u('end',''===e?void 0:Number(e)),keyboardType:"decimal-pad"})})]})]}):null,(0,f.jsx)(i.T,{children:y?m.preview(j,{rid:'',today:t,go:()=>{}}):'Fill in the missing details above.'}),c?(0,f.jsx)(i.Muted,{children:"This Assistant does not send, pay or delete. Confirm only shows what would happen."}):(0,f.jsx)(i.Muted,{children:"Nothing happens until you tap Confirm."}),(0,f.jsxs)(i.Row,{gap:8,children:[(0,f.jsx)(i.Button,{kind:c?'danger':'success',label:c?'Confirm (nothing is sent)':'Confirm',testID:"assistant-confirm-yes",disabled:!y,onPress:n,style:{flex:1}}),(0,f.jsx)(i.Button,{kind:"ghost",label:"Cancel",onPress:a,style:{flex:1}})]})]})}},1510,[812,1031,779,17,385,85,777,876,1458,1511,1512,1513,804,1055,8]); -__d(function(g,r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"HELP_TOPICS",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"HELP",{enumerable:!0,get:function(){return a}}),Object.defineProperty(e,"helpById",{enumerable:!0,get:function(){return o}});const t=['Bookings','Walk-ins','Table plan','Rota','Hours & pay','Tips','Team','Suppliers','Stock','Recipe cards','Displays','Settings','Accounts'],a=[{id:'new-booking',kind:'guide',topic:'Bookings',title:'Take a phone booking',keywords:['booking','reservation','book','table','phone','covers','reserve'],body:'Add a booking for a guest who calls or walks up to ask. The app only offers times that are really free.',steps:['Open Bookings (or tap New booking on Today).','Pick the date, time and number of covers.','Add the guest\u2019s name and phone, plus any allergies or notes.','Tap Save. The booking appears on the timeline and the floor plan.'],showMe:{tab:'bookings',target:{testID:'add-booking'},hint:'Tap New booking to start a booking.'}},{id:'move-booking',kind:'faq',topic:'Bookings',title:'How do I move a booking to another table or time?',keywords:['move','change','reschedule','table','booking','swap'],body:'Open the booking from Bookings or the timeline and tap Edit, or drag it to another table on the Display. Guests are not messaged unless you choose to.',showMe:{tab:'bookings',target:{testID:'add-booking'},hint:'Your bookings list is here. Tap a booking to change it.'}},{id:'walk-in',kind:'guide',topic:'Walk-ins',title:'Seat a walk-in',keywords:['walk-in','walkin','walk in','seat','no booking','covers','party'],body:'Record guests who arrive without a booking so the floor plan and covers stay right.',steps:['On the Display (the venue tablet), tap Walk-in. On a phone, say \u201cadd a walk-in for 2\u201d to the Assistant.','Choose the number of covers.','Pick a free table (the best fit is suggested).','Tap Seat. The table shows as seated.'],actions:['add_walkin']},{id:'table-plan',kind:'guide',topic:'Table plan',title:'Edit the table plan',keywords:['table plan','floor plan','layout','tables','move tables','designer','areas','seats'],body:'Drag tables into place, set seats, join tables and add areas such as Terrace or Garden.',steps:['Go to More \u203a Table plan.','Tap Open the designer.','Drag tables, or tap one to change its name and seats.','Tap Save. Displays and bookings use the new plan straight away.'],showMe:{tab:'more',page:'tableplan',target:{testID:'open-designer'},hint:'Open the designer to move tables.'}},{id:'rota',kind:'guide',topic:'Rota',title:'Build and publish the rota',keywords:['rota','shift','schedule','week','publish','staff hours','add shift'],body:'Plan the week, then publish it so staff see their shifts in the Staff app.',steps:['Go to More \u203a Rota.','Tap a person\u2019s day to add a shift (presets: lunch, dinner, double).','New shifts are drafts with a dashed amber border.','Tap Publish when the week is ready. Staff see only published shifts.'],showMe:{tab:'more',page:'rota',target:{testID:'rota-publish'},hint:'Tap a day to add a shift, then Publish here.'},actions:['add_rota_shift','publish_rota']},{id:'rota-copy',kind:'faq',topic:'Rota',title:'Can I copy last week\u2019s rota?',keywords:['copy','last week','repeat','rota','duplicate'],body:'Yes. On the Rota tap Copy last week. The shifts come over as drafts so you can tweak them before publishing.',showMe:{tab:'more',page:'rota',target:{testID:'rota-copy'},hint:'Copy last week\u2019s shifts as drafts.'}},{id:'sign-off',kind:'guide',topic:'Hours & pay',title:'Sign off hours',keywords:['sign off','signoff','confirm hours','approve','timesheet','clock','pending'],body:'Only confirmed hours count for pay and tips. Check clocked times against the rota and confirm them.',steps:['Go to More \u203a Sign off hours.','Flagged days (late, missing clock-out, long breaks) are at the top.','Tap a row to fix a time; give a short reason.','Tap Confirm all unflagged, then deal with the rest.'],showMe:{tab:'more',page:'signoff',target:{testID:'confirm-unflagged'},hint:'Confirm all the days that look right in one tap.'}},{id:'payroll-hours',kind:'guide',topic:'Hours & pay',title:'Export hours for payroll',keywords:['payroll','export','hours','spreadsheet','csv','excel','accountant','copy','print'],body:'Get each person\u2019s confirmed hours for a pay period into your spreadsheet or to your accountant.',steps:['Go to More \u203a Payroll hours.','Pick the pay period (or a tips fortnight, or a custom range).','Check the pending banner: sign those off first if you can.','Tap Copy for spreadsheet and paste into Excel or Google Sheets, or download a CSV, or print.'],showMe:{tab:'more',page:'hours',target:{testID:'copy-tsv'},hint:'Copy, then paste straight into your spreadsheet.'}},{id:'pay-dates',kind:'faq',topic:'Hours & pay',title:'How do I set our pay dates?',keywords:['pay day','payday','pay dates','cut-off','wages','monthly','fortnightly'],body:'Settings \u203a Pay & tips: set when tips are paid and how often, the wage pay day and the cut-off. Payroll hours and Tips day use these dates.',showMe:{tab:'more',page:'paysettings',target:{testID:'save-pay'},hint:'Change the dates above, then Save.'}},{id:'tips-day',kind:'guide',topic:'Tips',title:'Share out tips on tips day',keywords:['tips','tronc','gratuity','share','split','tips day','service charge'],body:'Enter the tips total and it\u2019s shared by confirmed hours for the fortnight, to the penny.',steps:['Go to More \u203a Tips day (the right fortnight is picked for you).','Type the total tips.','Check anyone with pending hours; sign them off first if you can.','Copy or download the split for payroll.'],showMe:{tab:'more',page:'tipsday',target:{testID:'tips-total'},hint:'Type the tips total here.'}},{id:'invites',kind:'guide',topic:'Team',title:'Invite staff to the app',keywords:['invite','link','staff app','new starter','sign in','add staff','team member'],body:'Each person gets their own sign-in link. You choose when and how to share it.',steps:['Go to Settings \u203a Invite links.','Tap Make invite link next to the person.','Share the link yourself (text or WhatsApp). The app never sends it for you.','They tap it once and the Staff app remembers them.'],showMe:{tab:'more',page:'setup-invites',target:{text:'Make invite link'},hint:'Make a personal link, then share it yourself.'}},{id:'suppliers',kind:'guide',topic:'Suppliers',title:'Suppliers and order sheets',keywords:['supplier','order','order sheet','delivery','cut-off','fish','veg','dairy'],body:'Keep supplier contacts, order days and cut-offs together, and log what you ordered.',steps:['Go to More \u203a Suppliers to add or edit a supplier.','Use Supplier order sheets for the items you usually order.','Tap Log an order after you place it by phone or email.'],showMe:{tab:'more',page:'ordersheets',target:{testID:'sheet-add'},hint:'Add an order sheet for a supplier.'}},{id:'display-glance',kind:'guide',topic:'Display',title:'Today at a glance (Display)',keywords:['glance','today','covers by hour','breaks','on now','next','cut-off','cutoff','order times','display bar'],body:'The bar under the Display header shows today in one line: covers by hour (booked in solid gold, the walk-in estimate dashed), quiet times for breaks, who is on now and next, today\u2019s supplier order cut-offs with a countdown (amber under 30 minutes) and one tip. Cut-offs come from Scheduled notifications.'},{id:'sold-out',kind:'guide',topic:'Menu',title:'Sold out dishes',keywords:['sold out','run out','ran out','none left','back on','86','eighty six','display strip'],body:'When a dish runs out, mark it sold out so every member of staff knows. It\u2019s a reminder for staff: CoverCharge doesn\u2019t link up to your till, so it doesn\u2019t change the till. Sold out dishes show in a slim strip along the bottom of the Display within seconds, and in the Sold out list in Front of House, Managers and Head Chef. They clear by themselves when the kitchen closes (or the next morning, or only when you tap Back on: Settings \u203a Advanced \u203a Sold out reminders).',steps:['Open the Sold out list (Managers: More \u203a Sold out; Front of House: Me \u203a Sold out; Head Chef: Kitchen \u203a Live tickets \u203a Sold out).','Tap Mark sold out next to the dish.','When it\u2019s back, tap Back on.'],showMe:{tab:'more',page:'soldout',target:{testID:'soldout-search'},hint:'Find the dish, then tap Mark sold out.'}},{id:'shellfish',kind:'guide',topic:'Stock',title:'Live shellfish (and other) counts',keywords:['shellfish','lobster','crab','oysters','count','stock','tracked','sold out','86'],body:'Counters for things you sell by the unit, like lobster or crab. They show on the Display and warn when low.',steps:['Go to Settings \u203a Tracked stock.','Tap Add an item to track; set the name, icon and low warning.','Staff update the count from the small lobster and crab chip at the top of the Display, or in the app.'],showMe:{tab:'more',page:'trackedstock',target:{text:'Add an item to track'},hint:'Add something to count, like lobster.'}},{id:'recipe-cards',kind:'guide',topic:'Recipe cards',title:'Recipe cards',keywords:['recipe','card','dish','ingredients','method','allergens','spec'],body:'Photo, ingredients, method and allergens for each dish; the head chef signs them off and staff can read them.',steps:['Go to More \u203a Recipe cards.','Search for a dish or add a new one.','Fill in ingredients (allergens are suggested) and the method.','Send for head chef sign-off.'],showMe:{tab:'more',page:'recipecards',target:{testID:'card-search'},hint:'Search your recipe cards here.'}},{id:'display-pair',kind:'guide',topic:'Displays',title:'Pair a display or tablet',keywords:['display','tablet','pair','screen','code','front of house','kitchen screen'],body:'Connect a tablet to your venue with a one-time code. You can switch any display off from here.',steps:['Open the Display app on the tablet.','In Managers go to Settings \u203a Displays and tap Make a pairing code.','Type the code on the tablet. It joins your venue straight away.'],showMe:{tab:'more',page:'displays',target:{text:'Make a pairing code'},hint:'Make a one-time code for the tablet.'}},{id:'settings-hours',kind:'faq',topic:'Settings',title:'How do I change our opening hours?',keywords:['opening hours','hours','closed','open','kitchen hours','times'],body:'Settings \u203a Opening hours. Guests see these on your booking and order pages; bookings outside them are turned away.',showMe:{tab:'more',page:'setup-hours',hint:'Set each day\u2019s opening and closing time here.'}},{id:'replay-setup',kind:'faq',topic:'Settings',title:'Can I see the welcome walkthrough again?',keywords:['welcome','setup','walkthrough','onboarding','checklist','questionnaire'],body:'Yes: Settings \u203a Setup checklist \u203a Replay welcome. Everything is pre-filled from your questionnaire.',showMe:{tab:'more',page:'setupchecklist',target:{testID:'replay-welcome'},hint:'Replay the welcome walkthrough.'}},{id:'connected-accounts',kind:'guide',topic:'Accounts',title:'Connect your email, website and socials',keywords:['connect','account','gmail','outlook','wix','facebook','instagram','square','xero','quickbooks','login'],body:'Settings \u203a Connected accounts: tap a logo, save the account to your list, and use Connect with\u2026 to sign in on that service\u2019s own page (rolling out service by service; it shows Coming soon until then). CoverCharge never sees your password that way, and you can remove an account any time.',steps:['Go to Settings \u203a Connected accounts.','Tap the service\u2019s logo.','Tap Connect with\u2026 and sign in on their page.','To stop, tap Remove.'],showMe:{tab:'more',page:'connections',target:{testID:'conn-tile-gmail'},hint:'Tap a logo to connect that account.'}},{id:'supplier-portals',kind:'guide',topic:'Suppliers',title:'Order from your suppliers',keywords:['bidfood','booker','wholesale','cash and carry','order online','supplier login','account number','customer number'],body:'Settings \u203a Connected accounts \u203a Suppliers. Add supplier links for this venue, with an account number if you like. Open ordering and Log in open the supplier\u2019s own website, where you sign in; CoverCharge never keeps the password.',steps:['Go to Settings \u203a Connected accounts.','Scroll to Suppliers.','Tap Add against a supplier (account number optional).','Tap Open ordering or Log in whenever you need them.','To stop, tap Remove and confirm.'],showMe:{tab:'more',page:'connections',target:{testID:'portal-bidfood'},hint:'Your supplier ordering websites live here.'}},{id:'support',kind:'faq',topic:'Settings',title:'How do I get help from a person?',keywords:['support','help','contact','person','problem','broken','stuck'],body:'Support is free for life. Message the CoverCharge team from Settings \u203a Help, or email us, and we\u2019ll reply. We help by message and email.'},{id:'assistant-safe',kind:'faq',topic:'Settings',title:'Can the Assistant send or pay for things by itself?',keywords:['assistant','safe','confirm','send','pay','delete','ai'],body:'No. The Assistant and the voice helper show you exactly what they will do and wait for you to tap Confirm (or say yes). Anything that would send a message, order from a supplier or pay is only saved as a draft in Drafts for approval; nothing goes out by itself.'},{id:'restaurant-dashboard',kind:'guide',topic:'Bookings',title:'Restaurant dashboard',keywords:['restaurant dashboard','tables','timeline','guests','covers','joined tables'],body:'In Managers, tap Restaurant dashboard on Home, or More > Run the day > Restaurant dashboard. It is the same live table plan, Timeline, guest list, deposits, dogs, joined tables, Covers, covers-through-the-day chart and block bookings as the Display. Use the day arrows and Back to today. Assign or join tables on any day; seat, finish, no-show and cancel walk-in actions apply today. You can also say \u201copen Restaurant dashboard\u201d. The helper replies in text only.',showMe:{tab:'more',page:'serviceboard',target:{testID:'restaurant-dashboard-close'},hint:'Restaurant dashboard is open. Pick a day, or tap Back to Managers to close.'}},{id:'voice-helper',kind:'guide',topic:'Settings',title:'Use the hold-to-talk voice button',keywords:['voice','talk','speak','microphone','mic','hold','walkie','button','hands free','gloves'],body:'Hold the big gold button, say what you need, then let go. It logs fridge and freezer temperatures, answers allergen questions, marks dishes sold out, checks tables, adds to the waitlist, reads orders and covers, and drafts bookings, offers, events and supplier lists. The helper replies in text only, never aloud. Changes are shown in text first with Confirm and Cancel buttons: tap Confirm or say yes. Tap the button to type instead (in Managers this also opens the Assistant). It sits at the top right of the header in Managers, Head Chef, the Staff app (the full voice assistant, with no money, tips or HR) and on the Display (no money, tips or HR). Until the voice assistant\u2019s server is switched on, anything new says \u201cVoice assistant is switching on soon\u201d. Fair usage: 1,000 voice tasks a month per venue.',steps:['Hold the gold microphone button (the first time, allow the microphone).','Speak, for example \u201cprep fridge 3 degrees\u201d.','Let go to send.','If it reads something back, tap Confirm or hold again and say \u201cyes\u201d.','The button stays at the top right so it never covers the screen.'],showMe:{tab:'more',page:'voice',hint:'Turn the voice button on or off for each role here.'}},{id:'voice-drafts',kind:'faq',topic:'Settings',title:'Where do voice bookings and shopping lists go?',keywords:['drafts','approve','approval','shopping list','booker list','bidfood list','draft booking','offer','event'],body:'To Settings \u203a Drafts for approval. Bookings, supplier lists, offers, events and specials made by voice wait there for an owner or manager. Approving marks it approved and opens the right screen; you still place the order or confirm the booking yourself.',showMe:{tab:'more',page:'drafts',hint:'Drafts from the voice helper wait here.'}},{id:'voice-temps',kind:'guide',topic:'Settings',title:'Log fridge and freezer temperatures by voice',keywords:['temperature','fridge','freezer','haccp','food safety','eho','log temps','probe'],body:'Hold the voice button and say the unit and the number, for example \u201cprep fridge 3, freezer minus 19\u201d. Fridges should be 5\xb0C or colder and freezers -18\xb0C or colder; anything outside is flagged. Everything is in the Food safety log with who and when, ready to export or print for the EHO.',showMe:{tab:'more',page:'haccp',hint:'Every voice reading appears in the food safety log.'}},{id:'voice-fair-usage',kind:'faq',topic:'Settings',title:'Is there a limit on voice tasks?',keywords:['voice','limit','allowance','fair usage','fair use','how many','tasks','month','plan'],body:'Fair usage: 1,000 voice tasks a month per venue. It is one allowance shared by all of the venue\u2019s apps and devices, and it resets on the 1st. Each request counts once, spoken or typed; saying \u201cyes\u201d to confirm does not count again. You will see a note at 80%. If the venue reaches 1,000, the voice helper pauses until the 1st, except food safety and temperature logging, which always works. The owner can contact CoverCharge if you need more. See the count in Plan & billing or Settings \u203a Voice helper.',showMe:{tab:'more',page:'voice',hint:'This month\u2019s voice task count is shown here.'}},{id:'adv-bookings',kind:'guide',topic:'Settings',title:'Booking questions: allergies, dogs, access, vegan',keywords:['advanced','allergen','dog','dogs','cap','wheelchair','access','vegan','vegetarian','table request','settings'],body:'Choose what guests are asked when they book. Allergies are always asked first, in red, and staff tick \u201cAllergens seen\u201d. The others can be switched off.',steps:['Open More \u203a Settings \u203a Advanced.','In Bookings, tick or untick each question.','Use the dog stepper to cap dogs per booking time (No limit = only the dog-friendly tables).','Mark dog-friendly and step-free tables on the Table plan.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-bookings'},hint:'Booking questions are here.'}},{id:'adv-table-times',kind:'guide',topic:'Settings',title:'How long tables stay (table times)',keywords:['advanced','dwell','table time','turn','how long','next table free','minutes'],body:'Usual table times by party size: 90 min for 1\u20132 covers, 105 for 3\u20135, 2 hours for 6\u201319 and 3 hours for 20 or more. The app fine-tunes them from how long your tables really stay, and uses them for \u201cNext table free\u201d.',steps:['Open More \u203a Settings \u203a Advanced \u203a Table times.','Tap \u2212 or + to change a band by 5 minutes.','Untick \u201cFine-tune\u201d to use your numbers exactly.','Reset to default puts the four bands back.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-times'},hint:'Table times are here.'}},{id:'adv-reservable',kind:'guide',topic:'Settings',title:'Seafood platter, crab and lobster reservations',keywords:['advanced','platter','seafood','crab','lobster','reserve','price'],body:'Guests can reserve the Seafood Platter (1 crab + 1 lobster, \xa3160) or a crab or lobster with their booking. Reserved ones come off the Display count with a \u201cReserved\u201d line, the kitchen is told, and the Head Chef taps OK.',steps:['Open More \u203a Settings \u203a Advanced \u203a Reservable items.','Tick what guests can reserve and set the price.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-reserve'},hint:'Reservable items are here.'}},{id:'adv-events',kind:'guide',topic:'Settings',title:'Regular events like Open Mic Night',keywords:['advanced','open mic night','music night','event','regular','monthly','promote','busier','last food'],body:'Add events that repeat, e.g. Open Mic Night on the last Sunday of every month from 8pm with last food orders at 7pm. They show in Forecast key dates with a Promote button and on Today, and \u201cExpect busier\u201d raises the forecast.',steps:['Open More \u203a Settings \u203a Advanced \u203a Regular events.','Tap Add a regular event (or Edit).','Pick how it repeats and the day, add a start time and last food orders if needed.','Tap Save event.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-events'},hint:'Regular events are here.'}},{id:'adv-hours',kind:'guide',topic:'Settings',title:'Kitchen hours, seasons and special days',keywords:['advanced','hours','kitchen','season','winter','summer','special day','closed','last food orders','cutoff'],body:'Kitchen (food) hours decide which booking times are offered; the closing time is last food orders. Keep Winter and Summer hours, each with the date it starts every year, and the app switches by itself. Add special days for one-off changes.',steps:['Open More \u203a Settings \u203a Advanced \u203a Kitchen hours.','Tap Set Summer hours, fill in each day and the start date (e.g. 04-01 for 1 April).','Set the Winter start date too.','Use Add a special day for closures or late nights.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-hours'},hint:'Kitchen hours and seasons are here.'}},{id:'adv-home',kind:'faq',topic:'Settings',title:'Covers counter, Next table free and takeaway on home screens',keywords:['advanced','covers counter','takeaway','next table free','home','display','flip'],body:'Turn the COVERS counter and the \u201cNext table free\u201d card on or off, and choose whether takeaway figures show on home screens (off at the Anchorage). Takeaway order alerts always work. The flap click sound is set on each Display.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-home'},hint:'Display and home options are here.'}},{id:'adv-holidays',kind:'faq',topic:'Settings',title:'Why don\u2019t bank holidays say \u201c(substitute day)\u201d?',keywords:['advanced','holiday','substitute','bank holiday'],body:'The date already shows when a holiday moves, so the extra words are hidden. Tick \u201cShow full gov.uk names\u201d in Settings \u203a Advanced \u203a Holiday names to bring them back.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-holidays'},hint:'Holiday names are here.'}},{id:'adv-blocks',kind:'guide',topic:'Settings',title:'Lunch and dinner times for Block now',keywords:['block','lunch','dinner','service','wix','advanced','pause'],body:'Settings \u203a Advanced \u203a Block bookings sets when Lunch and Dinner run, for the Block now buttons and Spend per head. At The Anchorage, blocks also close those times on website bookings, and blocks made on the website show in CoverCharge. Website bookings can only close the whole venue, not one area or some tables.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-blocks'},hint:'Block bookings settings are here.'}},{id:'blocks-screen',kind:'guide',topic:'Bookings',title:'Block bookings: today, a future date, an area or some tables',keywords:['block','blocks','pause','close','closed','stop bookings','private','repeat','future'],body:'Tap Block bookings on the home screen. Block now pauses bookings today (Rest of today, Next hour, Lunch, Dinner, or a From\u2013To). Add a block closes a future date or range, the whole day or set times, the whole venue, one area or some tables, once or every week or on the last weekday of the month. Every future block is listed by month with Edit and Remove; removing asks first and is logged. Bookings already made are kept, and you are told how many.',showMe:{tab:'more',page:'blocks',target:{testID:'blocks-screen'},hint:'Block bookings is here.'}},{id:'spend-per-head',kind:'guide',topic:'Money',title:'Spend per head',keywords:['spend per head','sph','average spend','takings','covers','gross'],body:'Spend per head is Gross takings \xf7 Covers, by day, by week and for lunch and dinner. Enter the gross on the cash up (Enter the cash up, Upload a spreadsheet, or Enter takings). Covers are seated and finished bookings and walk-ins; no-shows and cancellations are left out. A day with no takings shows \u201cNo takings entered\u201d, never \xa30.',showMe:{tab:'more',page:'spendhead',target:{testID:'sph-screen'},hint:'Spend per head is here.'}},{id:'cashup-photo',kind:'guide',topic:'Money',title:'Enter the cash up, or upload a spreadsheet',keywords:['cash up','paid out','spreadsheet','csv','excel','xlsx','sheet','gross','card','cash','tips','takings','drawer'],body:'In Cash up & sales tap Enter the cash up and type the figures (Z total, card, cash, paid outs, tips, and gross if you have it). In Paid out, add a line for each amount taken from the till \u2014 for example lobsters or supermarket shopping \u2014 with the amount, an optional note, and your name. The paid-out total comes off the expected cash in the drawer. Check every figure, then tap Confirm and save. Bigger venues can tap Upload a spreadsheet (CSV or Excel): match the columns, check the preview (dates already saved are flagged), then confirm. Nothing is saved before you confirm, and every save is logged. You can export cash ups as a spreadsheet from Recent cash ups.',showMe:{tab:'more',page:'cashup',target:{testID:'cashup-by-hand'},hint:'Start the cash up here.'}},{id:'adv-giftqr',kind:'guide',topic:'Settings',title:'Buy a gift card on the Display',keywords:['gift','gift card','voucher','qr','display','wix','advanced'],body:'Switch on \u201cShow Buy a gift card on the Display\u201d in Settings \u203a Advanced \u203a Gift cards on the Display, and save your gift card page address. The Display has a Gift vouchers button: it opens the list of website vouchers (search, use by dates, Mark as used), with Show the buy QR code at the bottom. Guests buy on your website.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-giftqr'},hint:'Gift cards on the Display are here.'}},{id:'adv-whatsapp',kind:'guide',topic:'Settings',title:'WhatsApp buttons (tap to chat)',keywords:['whatsapp','wa.me','message','chat','guest','mobile','number','advanced'],body:'Put the venue\u2019s WhatsApp number in Settings \u203a Advanced \u203a WhatsApp, e.g. 01292 500123 or +44 7700 900123. Guests then see \u201cMessage us on WhatsApp\u201d on their booking confirmation, with their booking details typed in. Staff and managers see \u201cWhatsApp guest\u201d on bookings with a mobile number, with a confirmation typed in that you can change. Nothing is ever sent for you: WhatsApp opens and you tap Send yourself. Leave the number blank and every WhatsApp button stays hidden. Reset to default clears the number.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-whatsapp'},hint:'The WhatsApp number is here.'}},{id:'adv-reminders',kind:'guide',topic:'Settings',title:'Staff reminders: breaks and \u201cchairs up\u201d',keywords:['reminder','reminders','break','breaks','chairs','closing','6 hours','law','snooze','later','done','advanced'],body:'Reminders slide up for staff who are on shift right now (clocked in, or on the rota at that time) in the Staff and Head Chef apps, while the app is open. Break reminders: if the rota shift has a break time, the reminder comes at that time; if not, it comes 4 hours after they clock in (or after the shift starts). If they still haven\u2019t started a break it comes once more 30 minutes later, and again at 6 hours, because UK law says a shift over 6 hours needs a 20-minute break. \u201cStart break\u201d starts their break; \u201cLater\u201d hides it for 15 minutes. You can change these times. Venue reminders, such as \u201cTime to put the chairs up on the tables\u201d (Friday and Sunday, 21:00), have wording, days, a time (UK) and who sees them: everyone on shift, front of house or kitchen. Pause, edit or delete any of them, or add your own. Once anyone taps Done it goes for everyone that day, and the Reminders screen shows who did it. Reset to default brings back the standard break times and \u201cchairs up\u201d; your own reminders stay. Phones with the app closed don\u2019t get reminders yet.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-reminders'},hint:'Reminders are here.'}},{id:'adv-notifications',kind:'guide',topic:'Settings',title:'Scheduled notifications (e.g. the Mills milk order)',keywords:['notification','notifications','push','phone','milk','mills','pieroni','pieronis','veg','olsen','rota upload','scheduled','advanced'],body:'Settings \u203a Advanced \u203a Notifications lists reminders that go to named people at a set UK time, such as \u201cMills milk order\u201d for the Head Chef and Gordon. Each has a title, a message, the days, a time (you can set a different time on some days, e.g. 20:55 on Fridays), who gets it (tick people or pick a group like Everyone on shift) and how it is sent. In the app it is the gold slider with Done and Later; Done is logged with the name and time, and Later hides it for 15 minutes. Urgent notices (like the 6-hour break) always come first and only one shows at a time. Phone notifications: each person taps \u201cTurn on phone notifications\u201d on their own phone (iPhone: add the app to the Home Screen first, iOS 16.4 or later). Nothing goes to phones until an owner or manager switches \u201cSend to phones\u201d on. The Display never gets these. Reset to default restores the configured rules.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-notifications'},hint:'Notifications are here.'}},{id:'adv-order-lists',kind:'guide',topic:'Settings',title:'Order lists (Alsons, Cash and carry)',keywords:['order list','orders','alsons','drinks','cash and carry','trip','shopping','logo','carry over','advanced'],body:'Order lists collect what you need from a supplier. A running list (Alsons drinks) fills up until you order; a trip list (Cash and carry) is for a shopping day, Friday by default, which you can change for each trip. Add an item with a quantity and unit and an optional note; the app records who added it and when. Adding something already on the list offers to add to the quantity instead. On the day, tick Got or Ordered, or mark Missing / not in stock. Finish order saves it to History (date and who) and asks whether to carry over anything not got. Removing an item can be undone. Settings \u203a Advanced \u203a Order lists: add, rename or archive lists, the default trip day, and \u201cLet all staff add items\u201d (on: staff can add and see lists; only managers and the Head Chef tick, remove or finish). Each list can have a logo (take a photo or choose one) or shows its initials, and a phone number to tap to call (never called for you).',showMe:{tab:'more',page:'advanced',target:{testID:'adv-orderlists'},hint:'Order list settings are here.'}},{id:'adv-clock-area',kind:'guide',topic:'Settings',title:'Clock-in area, forgotten breaks and off-rota arrivals',keywords:['clock','clock in','geofence','location','area','radius','break','forgot','rota','visiting','override','advanced'],body:'Clock in, clock out, start break and end break only work at the venue once the centre is set. Stand in the middle of the venue and tap \u201cUse my current location\u201d, then choose how far (at least 50 m, 100 m to start). Phones are not exact, so up to 50 m of the phone\u2019s own accuracy is allowed on top. Each clock record keeps the reading, its accuracy and whether it was inside. If location is off or blocked, the app says how to allow it. Managers can record it for someone from Clock in / out \u203a Record it for someone, with a reason that is logged. Until the centre is set nobody is blocked and managers see a warning. Rota and pay screens are never blocked. Forgotten breaks: if no break was recorded, Clock out asks \u201cDid you take a break? If so, how long?\u201d; a length you pick is saved as a break marked \u201cadded at clock-out\u201d, which managers see and can edit in Hours. Not on the rota: if someone is at the venue, not clocked in and not on the rota, the Staff and Head Chef apps ask \u201cDo you want to sign in?\u201d. Yes clocks them in, marked off-rota, and managers get a notice; \u201cNo, just visiting\u201d stops asking for the day. This only checks while the app is open; web apps can\u2019t watch location in the background.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-clockarea'},hint:'Clock-in area settings are here.'}},{id:'adv-tablegrid',kind:'guide',topic:'Table plan',title:'Table plan grid and Tidy up (Advanced)',keywords:['grid','snap','line up','align','tidy','guides','spacing','restore','table plan','option','alt'],body:'Tables snap to the grid when you drag them, and gold guides show when an edge or centre lines up with another table. A small number shows when the gaps either side are even. Hold Alt (Option on a Mac) to move freely. Tidy up lines every table up on the grid and evens out the rows; only positions change. The old positions are kept, so one tap puts them back.',steps:['Go to Settings \u203a Advanced.','Find Table plan grid.','Turn snapping on or off, pick a grid size, or tap Tidy up the whole plan.','Changed your mind? Tap Put the tables back where they were.']},{id:'adv-printers',kind:'guide',topic:'Orders',title:'Kitchen ticket printers (Advanced)',keywords:['print','printer','printing','ticket','kitchen ticket','docket','receipt','epson','star','bluetooth','reprint','takeaway'],body:'Print a kitchen ticket by itself for every takeaway order, as soon as it comes in or when it is accepted. The ticket has the order number, collection time, name, every dish with its options and notes, allergies in white-on-black, and paid or not paid. Works with Epson (TM-m30, TM-T20, TM-T88), Star WebPRNT, most other network receipt printers (port 9100) and Bluetooth printers from the tablet app. If a ticket does not print, an amber warning shows and the order stays on screen.',steps:['Go to Settings \u203a Advanced.','Find Printers.','Tap Add a printer by IP address or Find printers on this Wi-Fi, choose the type and tap Test print.','Turn on Print a kitchen ticket for every takeaway order.']},{id:'adv-deposits',kind:'guide',topic:'Bookings',title:'Deposits (Advanced)',keywords:['deposit','deposits','per person','per adult','children','waive','waived','regular','party size','refund','refundable','cut off','policy','paid','due'],body:'Ask bigger tables for a deposit: set the amount per adult (children never pay: a table of 8 with 3 children pays for 5), the smallest party that pays one, whether it is refundable and up to how many hours before, and the words guests see. No card is saved in CoverCharge. Deposits are paid through website bookings: website bookings show Deposit paid on website bookings, Part paid on website bookings or Deposit not paid by themselves. For phone and walk-in bookings, staff tick Deposit paid once the guest has paid you, or (once switched on) press Send deposit link to send a website bookings pay link by text, WhatsApp or email. Refunds are done in Website bookings \u203a Orders. Deposit amounts are shown on bookings in Managers, Display and Staff. Other financial and HR information remains restricted.',steps:['Go to Settings \u203a Advanced.','Find Deposits.','Turn deposits on or off, and set the amount, party size, refund terms and the words guests see.','On a booking, tap Mark deposit paid once the guest has paid.','To let a regular off, tap Waive deposit on the booking (or in Edit booking), add why if you like, and tap Yes, waive it. Your name is saved with it.']},{id:'adv-loyalty',kind:'guide',topic:'Guests',title:'Loyalty: stamp card, offers & bring a friend (Advanced)',keywords:['loyalty','stamp','stamps','card','reward','offer','offers','referral','friend','expiry'],body:'The stamp card, offers and bring-a-friend are saved on the server, so every phone and tablet shows the same card. Set how many stamps earn a reward, what the reward is, when stamps or rewards run out, and how often one guest can get a stamp. Stamps only come from staff, or from a code or QR staff make, and each reward can be used once. Guests join with their agreement recorded, and a manager can remove a guest and their details.',steps:['Go to Settings \u203a Advanced.','Find Loyalty.','Turn the stamp card on, write the reward and tap Save loyalty settings.','Add offers with their dates, and turn bring-a-friend on if you want it.']},{id:'adv-table-order',kind:'guide',topic:'Guests',title:'Order at the table (Advanced)',keywords:['order at table','qr','qr code','scan','table','phone','accept','last orders','print','pdf','pay at bar'],body:'Guests scan the small QR card on their table (Managers \u203a Table QR codes prints them, 20 to a page), see your menu with allergens, and send an order. It lands in Front of House and on the kitchen screen within seconds. Prices, sold-out dishes and hours are checked on the server, so a phone can\u2019t change them. Staff accept the first order from each new phone (you can turn this off). Guests pay at the bar or with their server; paying by card from the phone is coming later.',steps:['Go to Settings \u203a Advanced.','Find Order at the table.','Turn it on, pick the areas or tables, set the hours and tap Save order at the table.','Tap Make codes, pick Stickers 50 \xd7 50 mm or Stand cards 50 \xd7 70 mm, then Print all QR cards (PDF) and put each code on its table.']},{id:'adv-soldout',kind:'guide',topic:'Menu',title:'Sold out reminders (Advanced)',keywords:['sold out','86','clear','end of service','next morning','back on','advanced','display strip','automatic','counts','lobster','crab'],body:'Choose when sold out dishes go back on by themselves: when the kitchen closes (from your Kitchen hours), the next morning (pick the time), or only when someone taps Back on. \u201cMark dishes sold out from the counts\u201d (on unless you turn it off) marks every dish that uses a counted item, like lobster or crab, when the count runs out, and puts it back on when the count is back up. Sold out is a reminder for staff on the Display and in the staff apps; it doesn\u2019t change your till.',steps:['Go to Settings \u203a Advanced.','Find Sold out reminders.','Pick when they clear, and turn marking from the counts on or off.']},{id:'sold-out-auto',kind:'guide',topic:'Menu',title:'Sold out from the counts (lobster, crab\u2026)',keywords:['sold out','automatic','auto','counts','shellfish','lobster','crab','platter','link','uses','none left'],body:'When a counted item runs out, or drops below what a dish needs, every dish that uses it is marked sold out by itself, with the reason: \u201cDeluxe Seafood Platter (no lobster or crab)\u201d. When the count is back up (a delivery or a recount), those dishes go back on by themselves. Dishes marked by hand are left alone. CoverCharge works out what each dish uses from its recipe card, its description (\u201cone whole lobster\u201d) or its name; you can change it for any dish. If you tap Back on while the count is still short, the dish stays on until the count changes.',steps:['Open the Sold out list.','Under Dishes linked to the counts, tap Change next to a dish.','Set how many of each item one portion uses (0 = not linked), then tap Save. Back to automatic undoes it.'],showMe:{tab:'more',page:'soldout',target:{testID:'soldout-links'},hint:'Tap Change next to a dish to set what it uses.'}},{id:'adv-forecast',kind:'guide',topic:'Forecasts',title:'Forecast history and "Not enough history yet"',keywords:['forecast','not enough history','history','estimate','example figures','labour','sales','walk-ins','advanced'],body:'Forecasts are built only from your own bookings, seated walk-ins, takeaway orders and cash-ups. Until CoverCharge has enough of your history (2 weeks to start with; change it in Settings \u203a Advanced \u203a Forecast history) you see \u2018Not enough history yet\u2019, what is already booked and your real labour cost from the rota, with no sales forecast or labour %. No history is invented for a live venue.',steps:['Go to Settings \u203a Advanced.','Find Forecast history.','Pick how many weeks are needed.']},{id:'adv-checkout',kind:'guide',topic:'Team',title:'Shift check-out, question board and team morale',keywords:['check out','checkout','morale','mood','staffing','overstaffed','survey','anonymous','question board','vote','shout out','wellbeing','advanced'],body:'When someone clocks out, they get a quick card: team morale from Low to High, and whether there was enough staff for the customers. They can also post a question for the board or shout out a teammate, or tap Skip. Nothing shows at clock in. Answers are anonymous: no name or staff number is saved, and each phone can answer a shift once. Team morale (Managers app \u203a More \u203a Team morale) shows a day only once 3 or more people have answered, next to that day\u2019s covers. Change the wording or switch parts off here.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-checkout'},hint:'Check-out and board settings are here.'}},{id:'hr-board',kind:'guide',topic:'Team',title:'The anonymous question board',keywords:['question board','board','anonymous','vote','yes no','reply','hide','moderation','log'],body:'Anyone on the team can post a question and vote it up, or vote Yes or No. No names are shown or saved. Owners and managers can reply (shown as \u201cReply from the managers\u201d) and hide offensive posts with a reason. Every hide, unhide and reply is in the Moderation log.',showMe:{tab:'more',page:'board',hint:'The question board.'}},{id:'adv-tasks',kind:'guide',topic:'Team',title:'Daily tasks',keywords:['tasks','daily tasks','checklist','duties','jobs','to do','my tasks','library','head chef'],body:'Give each person a short list of daily tasks: open Staff & roles, tap Daily tasks on their card, then pick from the venue\u2019s task library or type a new one. Use the arrows to reorder, \u2715 to remove (with Undo) and Days to limit a task to certain days. They see \u201cMy tasks today\u201d on their home screen and tick each one off while on shift; each tick records who and when, and you see \u201c2 of 5 done today\u201d on their card. Lists start fresh every day. Owners and managers can change anyone\u2019s list, including the Head Chef\u2019s. The Head Chef can change the lists of kitchen staff (chefs, commis and KPs) from Kitchen \u203a Kitchen team tasks, but not their own and not front of house. The task library is in Settings \u203a Advanced \u203a Tasks.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-tasks'},hint:'The task library is here.'}},{id:'adv-cashup',kind:'guide',topic:'Money',title:'Cash up and weekly sales',keywords:['cash up','cashup','takings','float','till','sales report','weekly sales','pos','printout','photo','graphs','charts'],body:'At the end of the night open Cash up & sales and tap Enter the cash up. Type each figure; boxes left blank stay blank (never counted as zero) and are highlighted in amber. Add any cash paid out of the till (lobsters, supermarket shopping, and the like) in the Paid out section: each line has what it was for, the amount, an optional note and who entered it. The total reduces the expected cash in the drawer. Nothing is saved until you tap Confirm and save. Do the same with the weekly sales report from the till (several pages is fine). The graphs show daily takings, tips, weekly net sales against the week before and sales by category. Owners and managers can enter and change cash ups; the Head Chef can see the graphs if they are allowed to see takings. Change the boxes to match your sheet in Settings \u203a Advanced \u203a Cash up; Cash tips total and Card tips total are always kept.',showMe:{tab:'more',page:'cashup',target:{testID:'cashup-by-hand'},hint:'Start the cash up here.'}},{id:'adv-tips',kind:'guide',topic:'Money',title:'Today\u2019s tips and the Tips pot',keywords:['tips','today tips','tips pot','pot','payout','tip pay','correction','coins'],body:'When a cash up with Cash tips total and Card tips total is confirmed, the team\u2019s combined tips for that day show as Today\u2019s tips in every staff app and on the Display, with a short notice. The Tips pot adds up confirmed daily tips since the last payout (fortnightly tip pay). After paying the tips, an owner or manager taps Mark payout done on the Tips pot card: the pot goes back to \xa30.00 and the old pot is kept in Past pots. Use Correct an entry to add or take off an amount for a day; a reason is required and every correction is logged with your name. Only the team total is ever shown, never anyone\u2019s share. Hide either card in Settings \u203a Advanced \u203a Tips.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-tips'},hint:'Show or hide the tips cards here.'}},{id:'manager-access',kind:'guide',topic:'Team',title:'Manager access',keywords:['manager access','manager','access','role','promote','front of house','head chef','owner'],body:'In Staff & roles each person has a Manager access switch. On: they use the Manager app (rota, bookings, staff, hours, settings, plus their own clock in, rota and pay). Off: they use the Front of House app, or the Head Chef app for the Head Chef. Owners can switch anyone except owners; managers can switch anyone except themselves and owners. The last owner can never be removed. You confirm each change; it is logged with who and when (Access changes). Job titles are free text and don\u2019t change.',showMe:{tab:'more',page:'staff',target:{testID:'access-tip'},hint:'Manager access switches are on each person.'}},{id:'next-table-free',kind:'faq',topic:'Walk-ins',title:'When is the next table free?',keywords:['next table','free','wait','walk-in','quote','full'],body:'When you\u2019re full, Today and the Display show \u201cNext table free about 19:40 (T6, 4 seats)\u201d with \u201clikely\u201d or \u201cmaybe\u201d, and how long a walk-in for 2 or 4 would wait. Tap Bill requested or Table finished on the plan and it updates. You can also ask the Assistant \u201cwhen\u2019s the next table free?\u201d.'},{id:'time-travel',kind:'faq',topic:'Today',title:'Look at another day (time travel)',keywords:['yesterday','tomorrow','next week','past','future','day','time travel'],body:'On Today, tap \u2039 or \u203a beside the date to step a day back or forward. You\u2019ll see that day\u2019s kitchen hours, events, covers (booked, or how it went), platters and each booking\u2019s allergens and needs. It\u2019s read-only and nothing changes live service. Tap Today to come back. The Display goes back to today by itself after 2 minutes. Staff can look 7 days back and 14 days ahead.'},{id:'sign-in-links',kind:'guide',topic:'Team',title:'Personal sign-in links',keywords:['link','invite','sign in','new link','expired','already used','phone','login'],body:'Each personal link works on one phone only and lasts 5 days, so nobody else can sign in as that person. The same phone can open it again, in any of the apps. If someone gets a new phone, or their link has expired, open Staff & roles, tap New sign-in link on their entry, then Copy link and send it to them yourself. The app never sends it. Owners can make links for anyone; managers for anyone except owners. Their old unused link stops working; phones already signed in stay signed in.',showMe:{tab:'more',page:'staff',target:{testID:'access-tip'},hint:'New sign-in link is on each person.'}},{id:'pins-security',kind:'faq',topic:'Team',title:'PINs for the Display',keywords:['pin','display pin','clock in','wake pin','2580','manager pin','locked'],body:'Staff PINs for clocking in at the Display are 4 to 8 digits. Managers and owners need 6 to 8 digits, because their PIN can add temp staff. Easy PINs such as 1111 or 1234 are refused. Five wrong tries locks that person for 15 minutes; 20 wrong tries on one Display stops it for 15 minutes. The Display wake PIN (Settings \u203a Display) is 6 to 8 digits and is kept only as a scrambled hash. If it still says 2580, change it.'},{id:'cash-up-lock',kind:'faq',topic:'Money',title:'Correcting a signed-off cash up',keywords:['cash up','locked','unlock','correct','mistake','history','audit','sales report'],body:'Once a cash up or weekly sales report is confirmed and saved, it is locked so the figures can\u2019t change quietly. An owner taps Unlock to correct on it, says why, and has 30 minutes to fix it. History on each one shows who signed it off, changed or unlocked it, and when.'},{id:'wipe-device',kind:'faq',topic:'Settings',title:'Sign out and wipe a shared tablet or phone',keywords:['wipe','sign out','shared','tablet','leaver','lost','reset device'],body:'Tap the sync badge (bottom left), or go to Settings \u203a Display, and choose Sign out and wipe this device. It signs out and removes everything CoverCharge keeps on that device: sign-ins, pairing, saved screens and changes not sent yet. The venue\u2019s shared data is not touched. On the Display you type the wake PIN first.'}],o=t=>a.find(a=>a.id===t)},1511,[]); +__d(function(g,r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"HELP_TOPICS",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"HELP",{enumerable:!0,get:function(){return a}}),Object.defineProperty(e,"helpById",{enumerable:!0,get:function(){return o}});const t=['Bookings','Walk-ins','Table plan','Rota','Hours & pay','Tips','Team','Suppliers','Stock','Recipe cards','Displays','Settings','Accounts'],a=[{id:'new-booking',kind:'guide',topic:'Bookings',title:'Take a phone booking',keywords:['booking','reservation','book','table','phone','covers','reserve'],body:'Add a booking for a guest who calls or walks up to ask. The app only offers times that are really free.',steps:['Open Bookings (or tap New booking on Today).','Pick the date, time and number of covers.','Add the guest\u2019s name and phone, plus any allergies or notes.','Tap Save. The booking appears on the timeline and the floor plan.'],showMe:{tab:'bookings',target:{testID:'add-booking'},hint:'Tap New booking to start a booking.'}},{id:'move-booking',kind:'faq',topic:'Bookings',title:'How do I move a booking to another table or time?',keywords:['move','change','reschedule','table','booking','swap'],body:'Open the booking from Bookings or the timeline and tap Edit, or drag it to another table on the Display. Guests are not messaged unless you choose to.',showMe:{tab:'bookings',target:{testID:'add-booking'},hint:'Your bookings list is here. Tap a booking to change it.'}},{id:'walk-in',kind:'guide',topic:'Walk-ins',title:'Seat a walk-in',keywords:['walk-in','walkin','walk in','seat','no booking','covers','party'],body:'Record guests who arrive without a booking so the floor plan and covers stay right.',steps:['On the Display (the venue tablet), tap Walk-in. On a phone, say \u201cadd a walk-in for 2\u201d to the Assistant.','Choose the number of covers.','Pick a free table (the best fit is suggested).','Tap Seat. The table shows as seated.'],actions:['add_walkin']},{id:'table-plan',kind:'guide',topic:'Table plan',title:'Edit the table plan',keywords:['table plan','floor plan','layout','tables','move tables','designer','areas','seats'],body:'Drag tables into place, set seats, join tables and add areas such as Terrace or Garden.',steps:['Go to More \u203a Table plan.','Tap Open the designer.','Drag tables, or tap one to change its name and seats.','Tap Save. Displays and bookings use the new plan straight away.'],showMe:{tab:'more',page:'tableplan',target:{testID:'open-designer'},hint:'Open the designer to move tables.'}},{id:'rota',kind:'guide',topic:'Rota',title:'Build and publish the rota',keywords:['rota','shift','schedule','week','publish','staff hours','add shift'],body:'Plan the week, then publish it so staff see their shifts in the Staff app.',steps:['Go to More \u203a Rota.','Tap a person\u2019s day to add a shift (presets: lunch, dinner, double).','New shifts are drafts with a dashed amber border.','Tap Publish when the week is ready. Staff see only published shifts.'],showMe:{tab:'more',page:'rota',target:{testID:'rota-publish'},hint:'Tap a day to add a shift, then Publish here.'},actions:['add_rota_shift','publish_rota']},{id:'rota-copy',kind:'faq',topic:'Rota',title:'Can I copy last week\u2019s rota?',keywords:['copy','last week','repeat','rota','duplicate'],body:'Yes. On the Rota tap Copy last week. The shifts come over as drafts so you can tweak them before publishing.',showMe:{tab:'more',page:'rota',target:{testID:'rota-copy'},hint:'Copy last week\u2019s shifts as drafts.'}},{id:'sign-off',kind:'guide',topic:'Hours & pay',title:'Sign off hours',keywords:['sign off','signoff','confirm hours','approve','timesheet','clock','pending'],body:'Only confirmed hours count for pay and tips. Check clocked times against the rota and confirm them.',steps:['Go to More \u203a Sign off hours.','Flagged days (late, missing clock-out, long breaks) are at the top.','Tap a row to fix a time; give a short reason.','Tap Confirm all unflagged, then deal with the rest.'],showMe:{tab:'more',page:'signoff',target:{testID:'confirm-unflagged'},hint:'Confirm all the days that look right in one tap.'}},{id:'payroll-hours',kind:'guide',topic:'Hours & pay',title:'Export hours for payroll',keywords:['payroll','export','hours','spreadsheet','csv','excel','accountant','copy','print'],body:'Get each person\u2019s confirmed hours for a pay period into your spreadsheet or to your accountant.',steps:['Go to More \u203a Payroll hours.','Pick the pay period (or a tips fortnight, or a custom range).','Check the pending banner: sign those off first if you can.','Tap Copy for spreadsheet and paste into Excel or Google Sheets, or download a CSV, or print.'],showMe:{tab:'more',page:'hours',target:{testID:'copy-tsv'},hint:'Copy, then paste straight into your spreadsheet.'}},{id:'pay-dates',kind:'faq',topic:'Hours & pay',title:'How do I set our pay dates?',keywords:['pay day','payday','pay dates','cut-off','wages','monthly','fortnightly'],body:'Settings \u203a Pay & tips: set when tips are paid and how often, the wage pay day and the cut-off. Payroll hours and Tips day use these dates.',showMe:{tab:'more',page:'paysettings',target:{testID:'save-pay'},hint:'Change the dates above, then Save.'}},{id:'tips-day',kind:'guide',topic:'Tips',title:'Share out tips on tips day',keywords:['tips','tronc','gratuity','share','split','tips day','service charge'],body:'Enter the tips total and it\u2019s shared by confirmed hours for the fortnight, to the penny.',steps:['Go to More \u203a Tips day (the right fortnight is picked for you).','Type the total tips.','Check anyone with pending hours; sign them off first if you can.','Copy or download the split for payroll.'],showMe:{tab:'more',page:'tipsday',target:{testID:'tips-total'},hint:'Type the tips total here.'}},{id:'invites',kind:'guide',topic:'Team',title:'Invite staff to the app',keywords:['invite','link','staff app','new starter','sign in','add staff','team member'],body:'Each person gets their own sign-in link. You choose when and how to share it.',steps:['Go to Settings \u203a Invite links.','Tap Make invite link next to the person.','Share the link yourself (text or WhatsApp). The app never sends it for you.','They tap it once and the Staff app remembers them.'],showMe:{tab:'more',page:'setup-invites',target:{text:'Make invite link'},hint:'Make a personal link, then share it yourself.'}},{id:'suppliers',kind:'guide',topic:'Suppliers',title:'Suppliers and order sheets',keywords:['supplier','order','order sheet','delivery','cut-off','fish','veg','dairy'],body:'Keep supplier contacts, order days and cut-offs together, and log what you ordered.',steps:['Go to More \u203a Suppliers to add or edit a supplier.','Use Supplier order sheets for the items you usually order.','Tap Log an order after you place it by phone or email.'],showMe:{tab:'more',page:'ordersheets',target:{testID:'sheet-add'},hint:'Add an order sheet for a supplier.'}},{id:'display-glance',kind:'guide',topic:'Display',title:'Today at a glance (Display)',keywords:['glance','today','covers by hour','breaks','on now','next','cut-off','cutoff','order times','display bar'],body:'The bar under the Display header shows today in one line: covers by hour (booked in solid gold, the walk-in estimate dashed), quiet times for breaks, who is on now and next, today\u2019s supplier order cut-offs with a countdown (amber under 30 minutes) and one tip. Cut-offs come from Scheduled notifications.'},{id:'sold-out',kind:'guide',topic:'Menu',title:'Sold out dishes',keywords:['sold out','run out','ran out','none left','back on','86','eighty six','display strip'],body:'When a dish runs out, mark it sold out so every member of staff knows. It\u2019s a reminder for staff: CoverCharge doesn\u2019t link up to your till, so it doesn\u2019t change the till. Sold out dishes show in a slim strip along the bottom of the Display within seconds, and in the Sold out list in Front of House, Managers and Head Chef. They clear by themselves when the kitchen closes (or the next morning, or only when you tap Back on: Settings \u203a Advanced \u203a Sold out reminders).',steps:['Open the Sold out list (Managers: More \u203a Sold out; Front of House: Me \u203a Sold out; Head Chef: Kitchen \u203a Live tickets \u203a Sold out).','Tap Mark sold out next to the dish.','When it\u2019s back, tap Back on.'],showMe:{tab:'more',page:'soldout',target:{testID:'soldout-search'},hint:'Find the dish, then tap Mark sold out.'}},{id:'shellfish',kind:'guide',topic:'Stock',title:'Live shellfish (and other) counts',keywords:['shellfish','lobster','crab','oysters','count','stock','tracked','sold out','86'],body:'Counters for things you sell by the unit, like lobster or crab. They show on the Display and warn when low.',steps:['Go to Settings \u203a Tracked stock.','Tap Add an item to track; set the name, icon and low warning.','Staff update the count from the small lobster and crab chip at the top of the Display, or in the app.'],showMe:{tab:'more',page:'trackedstock',target:{text:'Add an item to track'},hint:'Add something to count, like lobster.'}},{id:'recipe-cards',kind:'guide',topic:'Recipe cards',title:'Recipe cards',keywords:['recipe','card','dish','ingredients','method','allergens','spec'],body:'Photo, ingredients, method and allergens for each dish; the head chef signs them off and staff can read them.',steps:['Go to More \u203a Recipe cards.','Search for a dish or add a new one.','Fill in ingredients (allergens are suggested) and the method.','Send for head chef sign-off.'],showMe:{tab:'more',page:'recipecards',target:{testID:'card-search'},hint:'Search your recipe cards here.'}},{id:'display-pair',kind:'guide',topic:'Displays',title:'Pair a display or tablet',keywords:['display','tablet','pair','screen','code','front of house','kitchen screen'],body:'Connect a tablet to your venue with a one-time code. You can switch any display off from here.',steps:['Open the Display app on the tablet.','In Managers go to Settings \u203a Displays and tap Make a pairing code.','Type the code on the tablet. It joins your venue straight away.'],showMe:{tab:'more',page:'displays',target:{text:'Make a pairing code'},hint:'Make a one-time code for the tablet.'}},{id:'settings-hours',kind:'faq',topic:'Settings',title:'How do I change our opening hours?',keywords:['opening hours','hours','closed','open','kitchen hours','times'],body:'Settings \u203a Opening hours. Guests see these on your booking and order pages; bookings outside them are turned away.',showMe:{tab:'more',page:'setup-hours',hint:'Set each day\u2019s opening and closing time here.'}},{id:'replay-setup',kind:'faq',topic:'Settings',title:'Can I see the welcome walkthrough again?',keywords:['welcome','setup','walkthrough','onboarding','checklist','questionnaire'],body:'Yes: Settings \u203a Setup checklist \u203a Replay welcome. Everything is pre-filled from your questionnaire.',showMe:{tab:'more',page:'setupchecklist',target:{testID:'replay-welcome'},hint:'Replay the welcome walkthrough.'}},{id:'connected-accounts',kind:'guide',topic:'Accounts',title:'Connect your email, website and socials',keywords:['connect','account','gmail','outlook','wix','facebook','instagram','square','xero','quickbooks','login'],body:'Settings \u203a Connected accounts: tap a logo, save the account to your list, and use Connect with\u2026 to sign in on that service\u2019s own page (rolling out service by service; it shows Coming soon until then). CoverCharge never sees your password that way, and you can remove an account any time.',steps:['Go to Settings \u203a Connected accounts.','Tap the service\u2019s logo.','Tap Connect with\u2026 and sign in on their page.','To stop, tap Remove.'],showMe:{tab:'more',page:'connections',target:{testID:'conn-tile-gmail'},hint:'Tap a logo to connect that account.'}},{id:'supplier-portals',kind:'guide',topic:'Suppliers',title:'Order from your suppliers',keywords:['bidfood','booker','wholesale','cash and carry','order online','supplier login','account number','customer number'],body:'Settings \u203a Connected accounts \u203a Suppliers. Add supplier links for this venue, with an account number if you like. Open ordering and Log in open the supplier\u2019s own website, where you sign in; CoverCharge never keeps the password.',steps:['Go to Settings \u203a Connected accounts.','Scroll to Suppliers.','Tap Add against a supplier (account number optional).','Tap Open ordering or Log in whenever you need them.','To stop, tap Remove and confirm.'],showMe:{tab:'more',page:'connections',target:{testID:'portal-bidfood'},hint:'Your supplier ordering websites live here.'}},{id:'support',kind:'faq',topic:'Settings',title:'How do I get help from a person?',keywords:['support','help','contact','person','problem','broken','stuck'],body:'Support is free for life. Message the CoverCharge team from Settings \u203a Help, or email us, and we\u2019ll reply. We help by message and email.'},{id:'assistant-safe',kind:'faq',topic:'Settings',title:'Can the Assistant send or pay for things by itself?',keywords:['assistant','safe','confirm','send','pay','delete','ai'],body:'No. The Assistant and the voice helper show you exactly what they will do and wait for you to tap Confirm (or say yes). Anything that would send a message, order from a supplier or pay is only saved as a draft in Drafts for approval; nothing goes out by itself.'},{id:'restaurant-dashboard',kind:'guide',topic:'Bookings',title:'Restaurant dashboard',keywords:['restaurant dashboard','tables','timeline','guests','covers','joined tables'],body:'In Managers, tap Restaurant dashboard on Home, or More > Run the day > Restaurant dashboard. It is the same live table plan, Timeline, guest list, deposits, dogs, joined tables, Covers, covers-through-the-day chart and block bookings as the Display. Use the day arrows and Back to today. Assign or join tables on any day; seat, finish, no-show and cancel walk-in actions apply today. You can also say \u201copen Restaurant dashboard\u201d. The helper replies in text only.',showMe:{tab:'more',page:'serviceboard',target:{testID:'restaurant-dashboard-close'},hint:'Restaurant dashboard is open. Pick a day, or tap Back to Managers to close.'}},{id:'voice-helper',kind:'guide',topic:'Settings',title:'Use the hold-to-talk voice button',keywords:['voice','talk','speak','microphone','mic','hold','walkie','button','hands free','gloves'],body:'Hold the big gold button, say what you need, then let go. It logs fridge and freezer temperatures, answers allergen questions, marks dishes sold out, checks tables, adds to the waitlist, reads orders and covers, and drafts bookings, offers, events and supplier lists. The helper replies in text only, never aloud. Changes are shown in text first with Confirm and Cancel buttons: tap Confirm or say yes. Tap the button to type instead (in Managers this also opens the Assistant). It sits at the top right of the header in Managers, Head Chef, the Staff app (the full voice assistant, with no money, tips or HR) and on the Display (no money, tips or HR). Until the voice assistant\u2019s server is switched on, anything new says \u201cVoice assistant is switching on soon\u201d. Fair usage: 1,000 voice tasks a month per venue.',steps:['Hold the gold microphone button (the first time, allow the microphone).','Speak, for example \u201cprep fridge 3 degrees\u201d.','Let go to send.','If it reads something back, tap Confirm or hold again and say \u201cyes\u201d.','The button stays at the top right so it never covers the screen.'],showMe:{tab:'more',page:'voice',hint:'Turn the voice button on or off for each role here.'}},{id:'voice-drafts',kind:'faq',topic:'Settings',title:'Where do voice bookings and shopping lists go?',keywords:['drafts','approve','approval','shopping list','booker list','bidfood list','draft booking','offer','event'],body:'To Settings \u203a Drafts for approval. Bookings, supplier lists, offers, events and specials made by voice wait there for an owner or manager. Approving marks it approved and opens the right screen; you still place the order or confirm the booking yourself.',showMe:{tab:'more',page:'drafts',hint:'Drafts from the voice helper wait here.'}},{id:'voice-temps',kind:'guide',topic:'Settings',title:'Log fridge and freezer temperatures by voice',keywords:['temperature','fridge','freezer','haccp','food safety','eho','log temps','probe'],body:'Hold the voice button and say the unit and the number, for example \u201cprep fridge 3, freezer minus 19\u201d. Fridges should be 5\xb0C or colder and freezers -18\xb0C or colder; anything outside is flagged. Everything is in the Food safety log with who and when, ready to export or print for the EHO.',showMe:{tab:'more',page:'haccp',hint:'Every voice reading appears in the food safety log.'}},{id:'voice-fair-usage',kind:'faq',topic:'Settings',title:'Is there a limit on voice tasks?',keywords:['voice','limit','allowance','fair usage','fair use','how many','tasks','month','plan'],body:'Fair usage: 1,000 voice tasks a month per venue. It is one allowance shared by all of the venue\u2019s apps and devices, and it resets on the 1st. Each request counts once, spoken or typed; saying \u201cyes\u201d to confirm does not count again. You will see a note at 80%. If the venue reaches 1,000, the voice helper pauses until the 1st, except food safety and temperature logging, which always works. The owner can contact CoverCharge if you need more. See the count in Plan & billing or Settings \u203a Voice helper.',showMe:{tab:'more',page:'voice',hint:'This month\u2019s voice task count is shown here.'}},{id:'adv-bookings',kind:'guide',topic:'Settings',title:'Booking questions: allergies, dogs, access, vegan',keywords:['advanced','allergen','dog','dogs','cap','wheelchair','access','vegan','vegetarian','table request','settings'],body:'Choose what guests are asked when they book. Allergies are always asked first, in red, and staff tick \u201cAllergens seen\u201d. The others can be switched off.',steps:['Open More \u203a Settings \u203a Advanced.','In Bookings, tick or untick each question.','Use the dog stepper to cap dogs per booking time (No limit = only the dog-friendly tables).','Mark dog-friendly and step-free tables on the Table plan.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-bookings'},hint:'Booking questions are here.'}},{id:'adv-table-times',kind:'guide',topic:'Settings',title:'How long tables stay (table times)',keywords:['advanced','dwell','table time','turn','how long','next table free','minutes'],body:'Usual table times by party size: 90 min for 1\u20132 covers, 105 for 3\u20135, 2 hours for 6\u201319 and 3 hours for 20 or more. The app fine-tunes them from how long your tables really stay, and uses them for \u201cNext table free\u201d.',steps:['Open More \u203a Settings \u203a Advanced \u203a Table times.','Tap \u2212 or + to change a band by 5 minutes.','Untick \u201cFine-tune\u201d to use your numbers exactly.','Reset to default puts the four bands back.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-times'},hint:'Table times are here.'}},{id:'adv-reservable',kind:'guide',topic:'Settings',title:'Seafood platter, crab and lobster reservations',keywords:['advanced','platter','seafood','crab','lobster','reserve','price'],body:'Guests can reserve the Seafood Platter (1 crab + 1 lobster, \xa3160) or a crab or lobster with their booking. Reserved ones come off the Display count with a \u201cReserved\u201d line, the kitchen is told, and the Head Chef taps OK.',steps:['Open More \u203a Settings \u203a Advanced \u203a Reservable items.','Tick what guests can reserve and set the price.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-reserve'},hint:'Reservable items are here.'}},{id:'adv-events',kind:'guide',topic:'Settings',title:'Regular events like Open Mic Night',keywords:['advanced','open mic night','music night','event','regular','monthly','promote','busier','last food'],body:'Add events that repeat, e.g. Open Mic Night on the last Sunday of every month from 8pm with last food orders at 7pm. They show in Forecast key dates with a Promote button and on Today, and \u201cExpect busier\u201d raises the forecast.',steps:['Open More \u203a Settings \u203a Advanced \u203a Regular events.','Tap Add a regular event (or Edit).','Pick how it repeats and the day, add a start time and last food orders if needed.','Tap Save event.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-events'},hint:'Regular events are here.'}},{id:'adv-hours',kind:'guide',topic:'Settings',title:'Kitchen hours, seasons and special days',keywords:['advanced','hours','kitchen','season','winter','summer','special day','closed','last food orders','cutoff'],body:'Kitchen (food) hours decide which booking times are offered; the closing time is last food orders. Keep Winter and Summer hours, each with the date it starts every year, and the app switches by itself. Add special days for one-off changes.',steps:['Open More \u203a Settings \u203a Advanced \u203a Kitchen hours.','Tap Set Summer hours, fill in each day and the start date (e.g. 04-01 for 1 April).','Set the Winter start date too.','Use Add a special day for closures or late nights.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-hours'},hint:'Kitchen hours and seasons are here.'}},{id:'adv-home',kind:'faq',topic:'Settings',title:'Covers counter, Next table free and takeaway on home screens',keywords:['advanced','covers counter','takeaway','next table free','home','display','flip'],body:'Turn the COVERS counter and the \u201cNext table free\u201d card on or off, and choose whether takeaway figures show on home screens (off at the Anchorage). Takeaway order alerts always work. The flap click sound is set on each Display.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-home'},hint:'Display and home options are here.'}},{id:'adv-holidays',kind:'faq',topic:'Settings',title:'Why don\u2019t bank holidays say \u201c(substitute day)\u201d?',keywords:['advanced','holiday','substitute','bank holiday'],body:'The date already shows when a holiday moves, so the extra words are hidden. Tick \u201cShow full gov.uk names\u201d in Settings \u203a Advanced \u203a Holiday names to bring them back.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-holidays'},hint:'Holiday names are here.'}},{id:'adv-blocks',kind:'guide',topic:'Settings',title:'Lunch and dinner times for Block now',keywords:['block','lunch','dinner','service','wix','advanced','pause'],body:'Settings \u203a Advanced \u203a Block bookings sets when Lunch and Dinner run, for the Block now buttons and Spend per head. At The Anchorage, blocks also close those times on website bookings, and blocks made on the website show in CoverCharge. Website bookings can only close the whole venue, not one area or some tables.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-blocks'},hint:'Block bookings settings are here.'}},{id:'blocks-screen',kind:'guide',topic:'Bookings',title:'Block bookings: today, a future date, an area or some tables',keywords:['block','blocks','pause','close','closed','stop bookings','private','repeat','future'],body:'Tap Block bookings on the home screen. Block now pauses bookings today (Rest of today, Next hour, Lunch, Dinner, or a From\u2013To). Add a block closes a future date or range, the whole day or set times, the whole venue, one area or some tables, once or every week or on the last weekday of the month. Every future block is listed by month with Edit and Remove; removing asks first and is logged. Bookings already made are kept, and you are told how many.',showMe:{tab:'more',page:'blocks',target:{testID:'blocks-screen'},hint:'Block bookings is here.'}},{id:'spend-per-head',kind:'guide',topic:'Money',title:'Spend per head',keywords:['spend per head','sph','average spend','takings','covers','gross'],body:'Spend per head is Gross takings \xf7 Covers, by day, by week and for lunch and dinner. Enter the gross on the cash up (Enter the cash up, Upload a spreadsheet, or Enter takings). Covers are seated and finished bookings and walk-ins; no-shows and cancellations are left out. A day with no takings shows \u201cNo takings entered\u201d, never \xa30.',showMe:{tab:'more',page:'spendhead',target:{testID:'sph-screen'},hint:'Spend per head is here.'}},{id:'cashup-photo',kind:'guide',topic:'Money',title:'Enter the cash up, or upload a spreadsheet',keywords:['cash up','paid out','spreadsheet','csv','excel','xlsx','sheet','gross','card','cash','tips','takings','drawer'],body:'In Cash up & sales tap Enter the cash up and type the figures (Z total, card, cash, paid outs, tips, and gross if you have it). In Paid out, add a line for each amount taken from the till \u2014 for example lobsters or supermarket shopping \u2014 with the amount, an optional note, and your name. The paid-out total comes off the expected cash in the drawer. Check every figure, then tap Confirm and save. Bigger venues can tap Upload a spreadsheet (CSV or Excel): match the columns, check the preview (dates already saved are flagged), then confirm. Nothing is saved before you confirm, and every save is logged. You can export cash ups as a spreadsheet from Recent cash ups.',showMe:{tab:'more',page:'cashup',target:{testID:'cashup-by-hand'},hint:'Start the cash up here.'}},{id:'adv-giftqr',kind:'guide',topic:'Settings',title:'Buy a gift card on the Display',keywords:['gift','gift card','voucher','qr','display','wix','advanced'],body:'Switch on \u201cShow Buy a gift card on the Display\u201d in Settings \u203a Advanced \u203a Gift cards on the Display, and save your gift card page address. The Display has a Gift vouchers button: it opens the list of website vouchers (search, use by dates, Mark as used), with Show the buy QR code at the bottom. Guests buy on your website.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-giftqr'},hint:'Gift cards on the Display are here.'}},{id:'adv-whatsapp',kind:'guide',topic:'Settings',title:'WhatsApp buttons (tap to chat)',keywords:['whatsapp','wa.me','message','chat','guest','mobile','number','advanced'],body:'Put the venue\u2019s WhatsApp number in Settings \u203a Advanced \u203a WhatsApp, e.g. 01292 500123 or +44 7700 900123. Guests then see \u201cMessage us on WhatsApp\u201d on their booking confirmation, with their booking details typed in. Staff and managers see \u201cWhatsApp guest\u201d on bookings with a mobile number, with a confirmation typed in that you can change. Nothing is ever sent for you: WhatsApp opens and you tap Send yourself. Leave the number blank and every WhatsApp button stays hidden. Reset to default clears the number.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-whatsapp'},hint:'The WhatsApp number is here.'}},{id:'adv-reminders',kind:'guide',topic:'Settings',title:'Staff reminders: breaks and \u201cchairs up\u201d',keywords:['reminder','reminders','break','breaks','chairs','closing','6 hours','law','snooze','later','done','advanced'],body:'Reminders slide up for staff who are on shift right now (clocked in, or on the rota at that time) in the Staff and Head Chef apps, while the app is open. Break reminders: if the rota shift has a break time, the reminder comes at that time; if not, it comes 4 hours after they clock in (or after the shift starts). If they still haven\u2019t started a break it comes once more 30 minutes later, and again at 6 hours, because UK law says a shift over 6 hours needs a 20-minute break. \u201cStart break\u201d starts their break; \u201cLater\u201d hides it for 15 minutes. You can change these times. Venue reminders, such as \u201cTime to put the chairs up on the tables\u201d (Friday and Sunday, 21:00), have wording, days, a time (UK) and who sees them: everyone on shift, front of house or kitchen. Pause, edit or delete any of them, or add your own. Once anyone taps Done it goes for everyone that day, and the Reminders screen shows who did it. Reset to default brings back the standard break times and \u201cchairs up\u201d; your own reminders stay. Phones with the app closed don\u2019t get reminders yet.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-reminders'},hint:'Reminders are here.'}},{id:'adv-notifications',kind:'guide',topic:'Settings',title:'Scheduled notifications (e.g. the Mills milk order)',keywords:['notification','notifications','push','phone','milk','mills','pieroni','pieronis','veg','olsen','rota upload','scheduled','advanced'],body:'Settings \u203a Advanced \u203a Notifications lists reminders that go to named people at a set UK time, such as \u201cMills milk order\u201d for the Head Chef and Gordon. Each has a title, a message, the days, a time (you can set a different time on some days, e.g. 20:55 on Fridays), who gets it (tick people or pick a group like Everyone on shift) and how it is sent. In the app it is the gold slider with Done and Later; Done is logged with the name and time, and Later hides it for 15 minutes. Urgent notices (like the 6-hour break) always come first and only one shows at a time. Phone notifications: each person taps \u201cTurn on phone notifications\u201d on their own phone (iPhone: add the app to the Home Screen first, iOS 16.4 or later). Nothing goes to phones until an owner or manager switches \u201cSend to phones\u201d on. The Display never gets these. Reset to default restores the configured rules.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-notifications'},hint:'Notifications are here.'}},{id:'adv-order-lists',kind:'guide',topic:'Settings',title:'Order lists (Alsons, Cash and carry)',keywords:['order list','orders','alsons','drinks','cash and carry','trip','shopping','logo','carry over','advanced'],body:'Order lists collect what you need from a supplier. A running list (Alsons drinks) fills up until you order; a trip list (Cash and carry) is for a shopping day, Friday by default, which you can change for each trip. Add an item with a quantity and unit and an optional note; the app records who added it and when. Adding something already on the list offers to add to the quantity instead. On the day, tick Got or Ordered, or mark Missing / not in stock. Finish order saves it to History (date and who) and asks whether to carry over anything not got. Removing an item can be undone. Settings \u203a Advanced \u203a Order lists: add, rename or archive lists, the default trip day, and \u201cLet all staff add items\u201d (on: staff can add and see lists; only managers and the Head Chef tick, remove or finish). Each list can have a logo (take a photo or choose one) or shows its initials, and a phone number to tap to call (never called for you).',showMe:{tab:'more',page:'advanced',target:{testID:'adv-orderlists'},hint:'Order list settings are here.'}},{id:'adv-clock-area',kind:'guide',topic:'Settings',title:'Clock-in area, forgotten breaks and off-rota arrivals',keywords:['clock','clock in','geofence','location','area','radius','break','forgot','rota','visiting','override','advanced'],body:'Clock in, clock out, start break and end break only work at the venue once the centre is set. Stand in the middle of the venue and tap \u201cUse my current location\u201d, then choose how far (at least 50 m, 100 m to start). Phones are not exact, so up to 50 m of the phone\u2019s own accuracy is allowed on top. Each clock record keeps the reading, its accuracy and whether it was inside. If location is off or blocked, the app says how to allow it. Managers can record it for someone from Clock in / out \u203a Record it for someone, with a reason that is logged. Until the centre is set nobody is blocked and managers see a warning. Rota and pay screens are never blocked. Forgotten breaks: if no break was recorded, Clock out asks \u201cDid you take a break? If so, how long?\u201d; a length you pick is saved as a break marked \u201cadded at clock-out\u201d, which managers see and can edit in Hours. Not on the rota: if someone is at the venue, not clocked in and not on the rota, the Staff and Head Chef apps ask \u201cDo you want to sign in?\u201d. Yes clocks them in, marked off-rota, and managers get a notice; \u201cNo, just visiting\u201d stops asking for the day. This only checks while the app is open; web apps can\u2019t watch location in the background.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-clockarea'},hint:'Clock-in area settings are here.'}},{id:'adv-tablegrid',kind:'guide',topic:'Table plan',title:'Table plan grid and Tidy up (Advanced)',keywords:['grid','snap','line up','align','tidy','guides','spacing','restore','table plan','option','alt'],body:'Tables snap to the grid when you drag them, and gold guides show when an edge or centre lines up with another table. A small number shows when the gaps either side are even. Hold Alt (Option on a Mac) to move freely. Tidy up lines every table up on the grid and evens out the rows; only positions change. The old positions are kept, so one tap puts them back.',steps:['Go to Settings \u203a Advanced.','Find Table plan grid.','Turn snapping on or off, pick a grid size, or tap Tidy up the whole plan.','Changed your mind? Tap Put the tables back where they were.']},{id:'adv-printers',kind:'guide',topic:'Orders',title:'Kitchen ticket printers (Advanced)',keywords:['print','printer','printing','ticket','kitchen ticket','docket','receipt','epson','star','bluetooth','reprint','takeaway'],body:'Print a kitchen ticket by itself for every takeaway order, as soon as it comes in or when it is accepted. The ticket has the order number, collection time, name, every dish with its options and notes, allergies in white-on-black, and paid or not paid. Works with Epson (TM-m30, TM-T20, TM-T88), Star WebPRNT, most other network receipt printers (port 9100) and Bluetooth printers from the tablet app. If a ticket does not print, an amber warning shows and the order stays on screen.',steps:['Go to Settings \u203a Advanced.','Find Printers.','Tap Add a printer by IP address or Find printers on this Wi-Fi, choose the type and tap Test print.','Turn on Print a kitchen ticket for every takeaway order.']},{id:'adv-deposits',kind:'guide',topic:'Bookings',title:'Deposits (Advanced)',keywords:['deposit','deposits','per person','per adult','children','waive','waived','regular','party size','refund','refundable','cut off','policy','paid','due'],body:'Ask bigger tables for a deposit: set the amount per adult (children never pay and do not count towards the number that needs one: a table of 8 with 3 children pays nothing; a table of 6 adults, or 7 with 1 child, pays for 6), the smallest number of adults that pays one (6 or more adults at The Anchorage), whether it is refundable and up to how many hours before, and the words guests see. Staff can waive a deposit. No card is saved in CoverCharge. Deposits are paid through website bookings: website bookings show Deposit paid on website bookings, Part paid on website bookings or Deposit not paid by themselves. For phone and walk-in bookings, staff tick Deposit paid once the guest has paid you, or (once switched on) press Send deposit link to send a website bookings pay link by text, WhatsApp or email. Refunds are done in Website bookings \u203a Orders. Deposit amounts are shown on bookings in Managers, Display and Staff. Other financial and HR information remains restricted.',steps:['Go to Settings \u203a Advanced.','Find Deposits.','Turn deposits on or off, and set the amount, party size, refund terms and the words guests see.','On a booking, tap Mark deposit paid once the guest has paid.','To let a regular off, tap Waive deposit on the booking (or in Edit booking), add why if you like, and tap Yes, waive it. Your name is saved with it.']},{id:'adv-loyalty',kind:'guide',topic:'Guests',title:'Loyalty: stamp card, offers & bring a friend (Advanced)',keywords:['loyalty','stamp','stamps','card','reward','offer','offers','referral','friend','expiry'],body:'The stamp card, offers and bring-a-friend are saved on the server, so every phone and tablet shows the same card. Set how many stamps earn a reward, what the reward is, when stamps or rewards run out, and how often one guest can get a stamp. Stamps only come from staff, or from a code or QR staff make, and each reward can be used once. Guests join with their agreement recorded, and a manager can remove a guest and their details.',steps:['Go to Settings \u203a Advanced.','Find Loyalty.','Turn the stamp card on, write the reward and tap Save loyalty settings.','Add offers with their dates, and turn bring-a-friend on if you want it.']},{id:'adv-table-order',kind:'guide',topic:'Guests',title:'Order at the table (Advanced)',keywords:['order at table','qr','qr code','scan','table','phone','accept','last orders','print','pdf','pay at bar'],body:'Guests scan the small QR card on their table (Managers \u203a Table QR codes prints them, 20 to a page), see your menu with allergens, and send an order. It lands in Front of House and on the kitchen screen within seconds. Prices, sold-out dishes and hours are checked on the server, so a phone can\u2019t change them. Staff accept the first order from each new phone (you can turn this off). Guests pay at the bar or with their server; paying by card from the phone is coming later.',steps:['Go to Settings \u203a Advanced.','Find Order at the table.','Turn it on, pick the areas or tables, set the hours and tap Save order at the table.','Tap Make codes, pick Stickers 50 \xd7 50 mm or Stand cards 50 \xd7 70 mm, then Print all QR cards (PDF) and put each code on its table.']},{id:'adv-soldout',kind:'guide',topic:'Menu',title:'Sold out reminders (Advanced)',keywords:['sold out','86','clear','end of service','next morning','back on','advanced','display strip','automatic','counts','lobster','crab'],body:'Choose when sold out dishes go back on by themselves: when the kitchen closes (from your Kitchen hours), the next morning (pick the time), or only when someone taps Back on. \u201cMark dishes sold out from the counts\u201d (on unless you turn it off) marks every dish that uses a counted item, like lobster or crab, when the count runs out, and puts it back on when the count is back up. Sold out is a reminder for staff on the Display and in the staff apps; it doesn\u2019t change your till.',steps:['Go to Settings \u203a Advanced.','Find Sold out reminders.','Pick when they clear, and turn marking from the counts on or off.']},{id:'sold-out-auto',kind:'guide',topic:'Menu',title:'Sold out from the counts (lobster, crab\u2026)',keywords:['sold out','automatic','auto','counts','shellfish','lobster','crab','platter','link','uses','none left'],body:'When a counted item runs out, or drops below what a dish needs, every dish that uses it is marked sold out by itself, with the reason: \u201cDeluxe Seafood Platter (no lobster or crab)\u201d. When the count is back up (a delivery or a recount), those dishes go back on by themselves. Dishes marked by hand are left alone. CoverCharge works out what each dish uses from its recipe card, its description (\u201cone whole lobster\u201d) or its name; you can change it for any dish. If you tap Back on while the count is still short, the dish stays on until the count changes.',steps:['Open the Sold out list.','Under Dishes linked to the counts, tap Change next to a dish.','Set how many of each item one portion uses (0 = not linked), then tap Save. Back to automatic undoes it.'],showMe:{tab:'more',page:'soldout',target:{testID:'soldout-links'},hint:'Tap Change next to a dish to set what it uses.'}},{id:'adv-forecast',kind:'guide',topic:'Forecasts',title:'Forecast history and "Not enough history yet"',keywords:['forecast','not enough history','history','estimate','example figures','labour','sales','walk-ins','advanced'],body:'Forecasts are built only from your own bookings, seated walk-ins, takeaway orders and cash-ups. Until CoverCharge has enough of your history (2 weeks to start with; change it in Settings \u203a Advanced \u203a Forecast history) you see \u2018Not enough history yet\u2019, what is already booked and your real labour cost from the rota, with no sales forecast or labour %. No history is invented for a live venue.',steps:['Go to Settings \u203a Advanced.','Find Forecast history.','Pick how many weeks are needed.']},{id:'adv-checkout',kind:'guide',topic:'Team',title:'Shift check-out, question board and team morale',keywords:['check out','checkout','morale','mood','staffing','overstaffed','survey','anonymous','question board','vote','shout out','wellbeing','advanced'],body:'When someone clocks out, they get a quick card: team morale from Low to High, and whether there was enough staff for the customers. They can also post a question for the board or shout out a teammate, or tap Skip. Nothing shows at clock in. Answers are anonymous: no name or staff number is saved, and each phone can answer a shift once. Team morale (Managers app \u203a More \u203a Team morale) shows a day only once 3 or more people have answered, next to that day\u2019s covers. Change the wording or switch parts off here.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-checkout'},hint:'Check-out and board settings are here.'}},{id:'hr-board',kind:'guide',topic:'Team',title:'The anonymous question board',keywords:['question board','board','anonymous','vote','yes no','reply','hide','moderation','log'],body:'Anyone on the team can post a question and vote it up, or vote Yes or No. No names are shown or saved. Owners and managers can reply (shown as \u201cReply from the managers\u201d) and hide offensive posts with a reason. Every hide, unhide and reply is in the Moderation log.',showMe:{tab:'more',page:'board',hint:'The question board.'}},{id:'adv-tasks',kind:'guide',topic:'Team',title:'Daily tasks',keywords:['tasks','daily tasks','checklist','duties','jobs','to do','my tasks','library','head chef'],body:'Give each person a short list of daily tasks: open Staff & roles, tap Daily tasks on their card, then pick from the venue\u2019s task library or type a new one. Use the arrows to reorder, \u2715 to remove (with Undo) and Days to limit a task to certain days. They see \u201cMy tasks today\u201d on their home screen and tick each one off while on shift; each tick records who and when, and you see \u201c2 of 5 done today\u201d on their card. Lists start fresh every day. Owners and managers can change anyone\u2019s list, including the Head Chef\u2019s. The Head Chef can change the lists of kitchen staff (chefs, commis and KPs) from Kitchen \u203a Kitchen team tasks, but not their own and not front of house. The task library is in Settings \u203a Advanced \u203a Tasks.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-tasks'},hint:'The task library is here.'}},{id:'adv-cashup',kind:'guide',topic:'Money',title:'Cash up and weekly sales',keywords:['cash up','cashup','takings','float','till','sales report','weekly sales','pos','printout','photo','graphs','charts'],body:'At the end of the night open Cash up & sales and tap Enter the cash up. Type each figure; boxes left blank stay blank (never counted as zero) and are highlighted in amber. Add any cash paid out of the till (lobsters, supermarket shopping, and the like) in the Paid out section: each line has what it was for, the amount, an optional note and who entered it. The total reduces the expected cash in the drawer. Nothing is saved until you tap Confirm and save. Do the same with the weekly sales report from the till (several pages is fine). The graphs show daily takings, tips, weekly net sales against the week before and sales by category. Owners and managers can enter and change cash ups; the Head Chef can see the graphs if they are allowed to see takings. Change the boxes to match your sheet in Settings \u203a Advanced \u203a Cash up; Cash tips total and Card tips total are always kept.',showMe:{tab:'more',page:'cashup',target:{testID:'cashup-by-hand'},hint:'Start the cash up here.'}},{id:'adv-tips',kind:'guide',topic:'Money',title:'Today\u2019s tips and the Tips pot',keywords:['tips','today tips','tips pot','pot','payout','tip pay','correction','coins'],body:'When a cash up with Cash tips total and Card tips total is confirmed, the team\u2019s combined tips for that day show as Today\u2019s tips in every staff app and on the Display, with a short notice. The Tips pot adds up confirmed daily tips since the last payout (fortnightly tip pay). After paying the tips, an owner or manager taps Mark payout done on the Tips pot card: the pot goes back to \xa30.00 and the old pot is kept in Past pots. Use Correct an entry to add or take off an amount for a day; a reason is required and every correction is logged with your name. Only the team total is ever shown, never anyone\u2019s share. Hide either card in Settings \u203a Advanced \u203a Tips.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-tips'},hint:'Show or hide the tips cards here.'}},{id:'manager-access',kind:'guide',topic:'Team',title:'Manager access',keywords:['manager access','manager','access','role','promote','front of house','head chef','owner'],body:'In Staff & roles each person has a Manager access switch. On: they use the Manager app (rota, bookings, staff, hours, settings, plus their own clock in, rota and pay). Off: they use the Front of House app, or the Head Chef app for the Head Chef. Owners can switch anyone except owners; managers can switch anyone except themselves and owners. The last owner can never be removed. You confirm each change; it is logged with who and when (Access changes). Job titles are free text and don\u2019t change.',showMe:{tab:'more',page:'staff',target:{testID:'access-tip'},hint:'Manager access switches are on each person.'}},{id:'next-table-free',kind:'faq',topic:'Walk-ins',title:'When is the next table free?',keywords:['next table','free','wait','walk-in','quote','full'],body:'When you\u2019re full, Today and the Display show \u201cNext table free about 19:40 (T6, 4 seats)\u201d with \u201clikely\u201d or \u201cmaybe\u201d, and how long a walk-in for 2 or 4 would wait. Tap Bill requested or Table finished on the plan and it updates. You can also ask the Assistant \u201cwhen\u2019s the next table free?\u201d.'},{id:'time-travel',kind:'faq',topic:'Today',title:'Look at another day (time travel)',keywords:['yesterday','tomorrow','next week','past','future','day','time travel'],body:'On Today, tap \u2039 or \u203a beside the date to step a day back or forward. You\u2019ll see that day\u2019s kitchen hours, events, covers (booked, or how it went), platters and each booking\u2019s allergens and needs. It\u2019s read-only and nothing changes live service. Tap Today to come back. The Display goes back to today by itself after 2 minutes. Staff can look 7 days back and 14 days ahead.'},{id:'sign-in-links',kind:'guide',topic:'Team',title:'Personal sign-in links',keywords:['link','invite','sign in','new link','expired','already used','phone','login'],body:'Each personal link works on one phone only and lasts 5 days, so nobody else can sign in as that person. The same phone can open it again, in any of the apps. If someone gets a new phone, or their link has expired, open Staff & roles, tap New sign-in link on their entry, then Copy link and send it to them yourself. The app never sends it. Owners can make links for anyone; managers for anyone except owners. Their old unused link stops working; phones already signed in stay signed in.',showMe:{tab:'more',page:'staff',target:{testID:'access-tip'},hint:'New sign-in link is on each person.'}},{id:'pins-security',kind:'faq',topic:'Team',title:'PINs for the Display',keywords:['pin','display pin','clock in','wake pin','2580','manager pin','locked'],body:'Staff PINs for clocking in at the Display are 4 to 8 digits. Managers and owners need 6 to 8 digits, because their PIN can add temp staff. Easy PINs such as 1111 or 1234 are refused. Five wrong tries locks that person for 15 minutes; 20 wrong tries on one Display stops it for 15 minutes. The Display wake PIN (Settings \u203a Display) is 6 to 8 digits and is kept only as a scrambled hash. If it still says 2580, change it.'},{id:'cash-up-lock',kind:'faq',topic:'Money',title:'Correcting a signed-off cash up',keywords:['cash up','locked','unlock','correct','mistake','history','audit','sales report'],body:'Once a cash up or weekly sales report is confirmed and saved, it is locked so the figures can\u2019t change quietly. An owner taps Unlock to correct on it, says why, and has 30 minutes to fix it. History on each one shows who signed it off, changed or unlocked it, and when.'},{id:'wipe-device',kind:'faq',topic:'Settings',title:'Sign out and wipe a shared tablet or phone',keywords:['wipe','sign out','shared','tablet','leaver','lost','reset device'],body:'Tap the sync badge (bottom left), or go to Settings \u203a Display, and choose Sign out and wipe this device. It signs out and removes everything CoverCharge keeps on that device: sign-ins, pairing, saved screens and changes not sent yet. The venue\u2019s shared data is not touched. On the Display you type the wake PIN first.'}],o=t=>a.find(a=>a.id===t)},1511,[]); __d(function(g,r,_i,_a,m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"tokens",{enumerable:!0,get:function(){return o}}),e.lev=l,e.searchHelp=function(n,l,i=8){const h=o(l);if(!h.length)return[];const a=t(l);return n.map(n=>{const l=o(n.title),i=o(n.keywords.join(' ')),c=o(`${n.body} ${(n.steps??[]).join(' ')}`);let f=3*s(h,l)+2.5*s(h,i)+.8*s(h,c);return n.keywords.some(n=>a.includes(t(n))&&t(n).length>3)&&(f+=2),t(n.title).includes(a)&&a.length>3&&(f+=3),{a:n,score:f/Math.sqrt(h.length)}}).filter(t=>t.score>=1.2).sort((t,n)=>n.score-t.score).slice(0,i)};const t=t=>t.toLowerCase().replace(/[\u2019']/g,'').replace(/[^a-z0-9\xa3 ]+/g,' ').replace(/\s+/g,' ').trim(),n=new Set(['how','do','i','a','an','the','to','can','my','our','we','is','it','of','for','in','on','and','what','where','please','me','you','with']),o=o=>t(o).split(' ').filter(t=>t&&!n.has(t));function l(t,n,o=2){if(Math.abs(t.length-n.length)>o)return o+1;let l=Array.from({length:n.length+1},(t,n)=>n);for(let i=1;i<=t.length;i++){const s=[i];let h=i;for(let o=1;o<=n.length;o++)s[o]=Math.min(l[o]+1,s[o-1]+1,l[o-1]+(t[i-1]===n[o-1]?0:1)),h=Math.min(h,s[o]);if(h>o)return o+1;l=s}return l[n.length]}function i(t,n){if(t===n)return 1;if(t.length>=3&&n.startsWith(t))return.8;if(n.length>=4&&t.startsWith(n))return.7;if(t.length>=4){if(l(t,n,t.length>=7?2:1)<=(t.length>=7?2:1))return.6}return 0}function s(t,n){let o=0;for(const l of t){let t=0;for(const o of n)if(t=Math.max(t,i(l,o)),1===t)break;o+=t}return o}},1512,[]); __d(function(g,_r,_i,_a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"staffMay",{enumerable:!0,get:function(){return w}}),_e.noMoney=k,Object.defineProperty(_e,"hasMoney",{enumerable:!0,get:function(){return v}}),Object.defineProperty(_e,"moneySafe",{enumerable:!0,get:function(){return S}}),Object.defineProperty(_e,"RISK_LABEL",{enumerable:!0,get:function(){return $}}),Object.defineProperty(_e,"needsConfirm",{enumerable:!0,get:function(){return O}}),Object.defineProperty(_e,"demoOnly",{enumerable:!0,get:function(){return I}}),Object.defineProperty(_e,"PAGES",{enumerable:!0,get:function(){return P}}),Object.defineProperty(_e,"tableName",{enumerable:!0,get:function(){return T}}),Object.defineProperty(_e,"ACTIONS",{enumerable:!0,get:function(){return j}}),Object.defineProperty(_e,"actionById",{enumerable:!0,get:function(){return D}}),_e.toolSpecs=function(){const e=e=>({type:'integer'===e.type?'integer':'string',description:e.description,...e.enum?{enum:e.enum}:{}});return j.map(t=>({type:'function',function:{name:t.id,description:`${t.description} [${$[t.risk]}${O(t.risk)?'; the app asks the manager to confirm':''}]`,parameters:{type:'object',properties:Object.fromEntries(t.params.map(t=>[t.name,e(t)])),required:t.params.filter(e=>e.required).map(e=>e.name)}}}))},_e.runAction=async function(e,t,a,s=!1){const r=D(e);if(!r)return{status:'error',message:`Unknown action ${e}`};if(m.BOOKING_CHANGE_ACTIONS.has(e)&&!(0,b.currentCanChangeBookings)())return{status:'error',message:m.BOOKING_VIEW_ONLY};if(('staff'===a.app||'staff'===a.role)&&!w(r))return{status:'error',message:'That isn\u2019t available in the Staff app. Ask a manager.'};if(r.apps&&a.app&&!r.apps.includes(a.app))return{status:'error',message:'That isn\u2019t available in this app.'};const n=r.params.filter(e=>e.required&&(void 0===t[e.name]||''===t[e.name])).map(e=>e.name);if(n.length)return{status:'error',message:`Missing ${n.join(', ')}`};if(O(r.risk)&&!s)return{status:'needs_confirmation',preview:r.preview(t,a),risk:r.risk};if(I(r.risk)){const e=String(await r.run(t,a));return'send'===r.risk||'pay'===r.risk?(u.useDrafts.getState().add({rid:a.rid,kind:'pay'===r.risk?'payment':'message',title:r.title,lines:[r.preview(t,a)],by:a.who??'Assistant',app:a.app??'owner'}),{status:'demo_only',message:`${e} Saved as a draft for the owner to approve.`}):{status:'demo_only',message:e}}try{const e=String(await r.run(t,a));return{status:'done',message:S(a.app,a.role)?k(e):e}}catch(e){return{status:'error',message:e.message}}},_e.extract=Y,_e.matchIntent=function(e,t,a={}){const s=` ${(e=(0,h.normaliseHeard)(e)).toLowerCase()} `,r=(0,l.tokens)(e),n=/\b(how|where|what|why|can i|help)\b/.test(s);let i=null;const o=a.app??'owner';for(const e of j){if('show_me'===e.id||'open_screen'===e.id)continue;if(e.apps&&!e.apps.includes(o))continue;if('staff'===o&&!w(e))continue;let t=0;if(e.match)t=e.match(s);else for(const a of e.keywords)s.includes(a)&&(t+=a.includes(' ')?2:1);'add_rota_shift'!==e.id||s.includes('shift')||s.includes('rota')||(t=0),'add_walkin'!==e.id||/walk|seat|arriv/.test(s)||(t=0),t>(i?.s??0)&&(i={a:e,s:t})}if(i&&i.s>=1&&(!n||'look'===i.a.risk||i.s>=3))return{kind:'action',action:i.a,params:i.a.parse?i.a.parse(e,{rid:a.rid??'',today:t,app:o,whoId:a.whoId}):Y(e,t),score:i.s};if('owner'!==o){const t=(0,l.searchHelp)(p.HELP,e,3);return t.length?{kind:'help',ids:t.map(e=>e.a.id)}:{kind:'none'}}const d=s.match(/\b(?:open|show|go to|take me to)\s+(.+?)\s*$/);if(d){const e=P.find(e=>e.words.some(e=>d[1].includes(e)));if(e)return{kind:'action',action:D('open_screen'),params:{screen:e.title},score:2}}const u=(0,l.searchHelp)(p.HELP,e,3);return u.length?{kind:'help',ids:u.map(e=>e.a.id)}:(r.length,{kind:'none'})};var e=_r(_d[0]),t=_r(_d[1]),a=_r(_d[2]),s=_r(_d[3]),r=_r(_d[4]),n=_r(_d[5]),i=_r(_d[6]),o=_r(_d[7]),d=_r(_d[8]),p=_r(_d[9]),l=_r(_d[10]),u=_r(_d[11]),c=_r(_d[12]),f=_r(_d[13]),h=_r(_d[14]),m=_r(_d[15]),b=_r(_d[16]);const w=e=>!e.apps||e.apps.includes('staff'),y=/\xa3|\btips?\b|\btronc\b|\btakings\b|\bwages?\b|\bsalar(y|ies)\b|\bpay(slip|roll)?\b|\bsales\b|\brevenue\b|\bdisciplinar|\bsick(ness)? (leave|pay)\b/i;function k(e){const t=e.split(/(?<=[.!?])\s+/).filter(e=>!y.test(e));return t.length?t.join(' '):'That isn\u2019t shown here. Ask a manager in the Managers app.'}const v=e=>y.test(e),S=(e,t)=>'display'===e||'staff'===e||'staff'===t,$={look:'Looks something up',navigate:'Opens a screen',change:'Changes something in the app',draft:'Saves a DRAFT for the owner to approve (nothing is sent or bought)',send:'SENDS to someone',pay:'PAYS money',delete:'DELETES something'},O=e=>'change'===e||'draft'===e||'send'===e||'pay'===e||'delete'===e,I=e=>'send'===e||'pay'===e||'delete'===e,_=e=>(n.useOwner.getState().staff.find(t=>t.id===e)?.name??'someone').replace(' (example)',''),N=e=>{const[t,a,s]=e.split('-').map(Number);return new Date(t,a-1,s).toLocaleDateString('en-GB',{weekday:'short',day:'numeric',month:'short'})},C=e=>{const t=(Math.round(60*e)%1440+1440)%1440;return`${String(Math.floor(t/60)).padStart(2,'0')}:${String(t%60).padStart(2,'0')}`},P=[{page:'lookback',tab:'more',title:'Look back',words:['look back','booking history']},{page:'serviceboard',tab:'more',title:'Restaurant dashboard',words:['restaurant dashboard','dashboard']},{page:'',tab:'bookings',title:'Bookings',words:['bookings','reservations','diary']},{page:'',tab:'orders',title:'Orders',words:['orders','takeaway','tickets']},{page:'rota',tab:'more',title:'Rota',words:['rota','shifts','schedule']},{page:'signoff',tab:'more',title:'Sign off hours',words:['sign off','signoff','approve hours']},{page:'hours',tab:'more',title:'Payroll hours',words:['payroll hours','payroll','hours export']},{page:'tipsday',tab:'more',title:'Tips day',words:['tips day','tips','tronc']},{page:'tableplan',tab:'more',title:'Table plan',words:['table plan','floor plan','layout']},{page:'suppliers',tab:'more',title:'Suppliers',words:['suppliers','supplier']},{page:'recipecards',tab:'more',title:'Recipe cards',words:['recipe cards','recipes']},{page:'displays',tab:'more',title:'Displays',words:['displays','tablets','pairing']},{page:'paysettings',tab:'more',title:'Pay & tips settings',words:['pay settings','pay dates','payday']},{page:'connections',tab:'more',title:'Connected accounts',words:['connected accounts','connections','accounts']},{page:'help',tab:'more',title:'Help & tutorials',words:['help','tutorials']}],A=['owner'],M=['zero','one','two','three','four','five','six','seven','eight','nine','ten','eleven','twelve','thirteen','fourteen','fifteen','sixteen','seventeen','eighteen','nineteen','twenty'],T=e=>{const t=String(e??'').replace(/^table\s+/i,'').trim(),a=M.indexOf(t.toLowerCase());return a>0?String(a):t};function E(e,t){if(!e||null==t||''===t)return'';const s=T(t),r=o.useFloor.getState().live[e]??{},n=Object.keys(r).find(e=>e.toLowerCase()===s.toLowerCase()||e.toLowerCase()===`t${s}`.toLowerCase()),i=n?r[n]:void 0;return i?i.blocked?`. ${(0,a.tableNumbers)(s)} is marked blocked`:i.dirty?`. ${(0,a.tableNumbers)(s)} still needs clearing`:i.stage?`. ${(0,a.tableNumbers)(s)} already has people seated`:'':''}const j=[...e.HISTORY_VOICE_ACTIONS,{id:'open_screen',apps:A,title:'Open a screen',description:'Navigate to a screen of the Managers app.',risk:'navigate',params:[{name:'screen',type:'string',required:!0,description:'Screen to open',enum:P.map(e=>e.title)}],keywords:['open','go to','take me','show','where is'],preview:e=>`Open ${e.screen}`,run:(e,t)=>{const a=P.find(t=>t.title===e.screen);return a?(t.go(a.tab,a.page||null),`Opened ${a.title}.`):'I couldn\u2019t find that screen.'}},{id:'show_me',apps:A,title:'Show me how',description:'Open the screen for a help guide and highlight the control to tap.',risk:'navigate',params:[{name:'guide',type:'string',required:!0,description:'Help article id',enum:p.HELP.filter(e=>e.showMe).map(e=>e.id)}],keywords:['how do i','how to','show me','where do i','help'],preview:e=>`Show me: ${(0,p.helpById)(String(e.guide))?.title??''}`,run:(e,t)=>{const a=(0,p.helpById)(String(e.guide));return a?.showMe?(t.go(a.showMe.tab,a.showMe.page??null),setTimeout(()=>d.useCoach.getState().show(a.showMe.target,a.showMe.hint),250),`Here\u2019s where: ${a.showMe.hint}`):'No guide for that.'}},{id:'add_walkin',title:'Add a walk-in',description:'Seat a walk-in party now, optionally at a table.',risk:'change',form:!0,params:[{name:'covers',type:'integer',required:!0,description:'Number of covers (1\u2013100)'},{name:'table',type:'string',description:'Table name, if known'}],keywords:['walk-in','walkin','walk in','seat','just arrived','no booking'],match:e=>/\bwalk-in\b/.test(e)&&!/\b(fridges?|freezers?|cold room|degrees|temps?|temperatures?|probe|minus|how long|wait|waiting|waitlist|how many|undo|remove|cancel)\b/.test(e)||/\b(seat|sit)\b/.test(e)&&/\b(just arrived|no booking)\b/.test(e)?9:/\b(just arrived|no booking)\b/.test(e)?3:/\b(seat|sit)\b/.test(e)?1:0,parse:e=>{const t={},a=(0,h.walkInCovers)(e);a&&(t.covers=a);const s=(0,h.tableSaid)(e);return s&&(t.table=s),t},preview:(e,t)=>`Seat a walk-in of ${e.covers} cover${1===Number(e.covers)?'':'s'}${e.table?` at table ${T(e.table)}`:' (table to assign)'}${E(t?.rid,e.table)}`,run:async(e,a)=>{const s=Number(e.covers);return(0,t.validParty)(s)?(await i.repo.bookings.seatWalkIn(a.rid,s,e.table?T(e.table):void 0,'Added by Assistant'),`Done: walk-in of ${s} seated${e.table?` at table ${T(e.table)}`:''}. It\u2019s in Bookings now.`):`${t.PARTY_RULE} Say for example \u201cwalk-in of 2 at table 4\u201d.`}},{id:'add_rota_shift',apps:A,title:'Add a rota shift',description:'Add a DRAFT shift for one person (staff see it only after the week is published).',risk:'change',form:!0,params:[{name:'staffId',type:'string',required:!0,description:'Staff member id'},{name:'date',type:'date',required:!0,description:'YYYY-MM-DD'},{name:'start',type:'time',required:!0,description:'Start hour, e.g. 17 or 17.5'},{name:'end',type:'time',required:!0,description:'End hour, e.g. 23'}],keywords:['shift','rota','put','add','schedule','on'],preview:e=>`Add a draft shift: ${_(e.staffId)}, ${e.date?N(String(e.date)):'?'}, ${C(Number(e.start))}\u2013${C(Number(e.end))}`,run:e=>{const t=Number(e.start),a=Number(e.end);if(!(e.staffId&&e.date&&a>t))return'That shift isn\u2019t complete.';const s=(0,n.leaveOn)(n.useOwner.getState().leave,String(e.staffId),String(e.date));return s?`${_(e.staffId)} has time off then (${N(s.from)} to ${N(s.to)}). Add the shift on the Rota yourself if they\u2019ve agreed to work.`:(n.useOwner.getState().addShift({staffId:String(e.staffId),date:String(e.date),start:t,end:a}),`Done: draft shift for ${_(e.staffId)} on ${N(String(e.date))} (${(0,n.weekdayOf)(String(e.date))>=0?'publish the week when ready':''}).`)}},{id:'publish_rota',apps:A,title:'Publish the rota',description:'Make the week\u2019s draft shifts visible to staff (they\u2019re told in the app).',risk:'send',params:[],keywords:['publish','send rota','release rota'],preview:()=>'Publish this week\u2019s rota so staff are notified in the Staff app',run:()=>'Nothing was published or sent. Open the Rota and tap Publish yourself when you\u2019re ready.'},{id:'message_staff',apps:A,title:'Message the team',description:'Post a message to staff chat.',risk:'send',params:[{name:'text',type:'string',required:!0,description:'Message'}],keywords:['message','tell the team','text staff','announce'],preview:e=>`Send to All staff: \u201c${e.text??''}\u201d`,run:()=>'Nothing was sent.'},{id:'pay_tips',apps:A,title:'Pay out tips',description:'Pay each person their tips share.',risk:'pay',params:[],keywords:['pay tips','pay out','transfer','pay staff'],preview:()=>'Pay out this fortnight\u2019s tips',run:()=>'CoverCharge never moves money. Use Tips day to work out the split, then pay through your payroll.'},{id:'remove_shift',apps:A,title:'Remove a shift',description:'Delete a rota shift.',risk:'delete',params:[{name:'staffId',type:'string',description:'Staff member id'},{name:'date',type:'date',description:'YYYY-MM-DD'}],keywords:['remove shift','delete shift','cancel shift','take off'],preview:e=>`Delete ${_(e.staffId)}\u2019s shift${e.date?` on ${N(String(e.date))}`:''}`,run:()=>'Nothing was deleted. Open the Rota and tap the shift to remove it yourself.'},...c.VOICE_ACTIONS,...f.STAFF_VOICE_ACTIONS,...s.OPS_VOICE_ACTIONS,...r.GAP_VOICE_ACTIONS],D=e=>j.find(t=>t.id===e);const L={one:1,two:2,three:3,four:4,five:5,six:6,seven:7,eight:8,nine:9,ten:10,eleven:11,twelve:12},x=['monday','tuesday','wednesday','thursday','friday','saturday','sunday'];function R(e){const t=e.match(/^(\d{1,2})(?::(\d{2}))?\s*(am|pm)?$/);if(!t)return null;let a=Number(t[1]);const s=Number(t[2]??0);return'pm'===t[3]&&a<12&&(a+=12),'am'===t[3]&&12===a&&(a=0),!t[3]&&a>=1&&a<=7&&(a+=12),a>24||s>59?null:a+s/60}function Y(e,t){const a=` ${e.toLowerCase().replace(/\u2019/g,"'")} `,s={},r=a.match(/(?:for|of|party of|x)\s+(\d{1,2}|one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve)\b/)??a.match(/\b(\d{1,2})\s*(?:covers|people|guests|pax|persons)\b/);r&&(s.covers=L[r[1]]??Number(r[1]));const i=a.match(/\btable\s+([a-z]?\d{1,3}[a-z]?)\b/);i&&(s.table=i[1].toUpperCase()),/\btomorrow\b/.test(a)?s.date=(0,n.addDays)(t,1):/\btoday\b|\btonight\b/.test(a)&&(s.date=t);const o=a.match(/\b(\d{1,2})\/(\d{1,2})(?:\/(\d{2,4}))?\b/);if(o){const e=o[3]?2===o[3].length?2e3+Number(o[3]):Number(o[3]):Number(t.slice(0,4));s.date=`${e}-${o[2].padStart(2,'0')}-${o[1].padStart(2,'0')}`}const d=x.findIndex(e=>a.includes(` ${e}`)||a.includes(` ${e.slice(0,3)} `));if(!s.date&&d>=0){const e=(0,n.weekdayOf)(t);s.date=(0,n.addDays)(t,(d-e+7)%7||7)}const p=a.match(/(\d{1,2}(?::\d{2})?\s*(?:am|pm)?)\s*(?:-|\u2013|to|till|until)\s*(\d{1,2}(?::\d{2})?\s*(?:am|pm)?)/);if(p){const e=R(p[1].trim()),t=R(p[2].trim());null!==e&&null!==t&&(s.start=e,s.end=t<=e?t+12:t)}const l=n.useOwner.getState().staff.filter(e=>e.active).find(e=>(0,n.staffCalls)(e).some(e=>e.length>2&&/^[a-z' -]+$/.test(e)&&new RegExp(`\\b${e}\\b`).test(a)));return l&&(s.staffId=l.id),s}},1513,[1514,1096,843,1515,1516,876,858,996,1458,1511,1512,1518,1517,1520,1521,994,995]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"HISTORY_VOICE_ACTIONS",{enumerable:!0,get:function(){return t}});var o=r(d[0]);const t=[{id:'look_back_bookings',title:'Look back at bookings',apps:['owner'],risk:'look',description:'Read booking times, party sizes, recorded tables and Booked covers for one exact past date. Incomplete supplementary previous booking system history; text only.',params:[{name:'date',type:'date',required:!0,description:'Exact past date YYYY-MM-DD, with explicitly supplied four-digit year'}],keywords:['look back','booked covers','historical bookings'],match:o=>/\b(open|go to)\s+(?:the\s+)?look back\b/.test(o)&&!/\b\d{4}\b/.test(o)?0:/\b(look back|booked covers|historical bookings)\b/.test(o)||/\b(bookings|reservations|covers)\b/.test(o)&&/\b\d{4}\b/.test(o)&&!/\b(add|create|new|book a|reserve|move|change|cancel)\b/.test(o)?10:0,parse:(t,s)=>({date:(0,o.exactHistoryDate)(t,s.today)}),preview:o=>`Look up Booked covers and bookings for ${o.date??'an exact past date'}`,run:async(t,s)=>{const n=(0,o.exactHistoryDate)(String(t.date??''),s.today);if(!n)return'Give an exact past date with day, month and four-digit year, for example 5 November 2025.';const{lookupBookingDay:c}=await r(d[2])(d[1],d.paths);return(0,o.bookingDayText)(await c(s.rid,n))}}]},1514,[1062,1061,1021]); diff --git a/car-app/index.html b/car-app/index.html index 8f59b8ea6c48294869a15982afd6a33305b17e37..27ff63a9a1808d0e3e9c5cf979a1d54d4e6f8bd5 100644 --- a/car-app/index.html +++ b/car-app/index.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/car-app/owner.html b/car-app/owner.html index 522d89990cc6ce2b7140b79fef9e1a25aca1968f..becfc25a55e570c706adbe819ae40786271f67bd 100644 --- a/car-app/owner.html +++ b/car-app/owner.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/car-app/sw.js b/car-app/sw.js index a9353ac71338698c5aabe1f20184f51be1df5c9c..4b09a31885b6f08ed5635adbe7015d8c50c5cc4f 100644 --- a/car-app/sw.js +++ b/car-app/sw.js @@ -1,7 +1,7 @@ // Anchorage car screen service worker: precache the app shell so it opens offline after the first visit. -const V = "cc-car-b38986d6f1"; +const V = "cc-car-766185fa16"; const BASE = "/car-app/"; -const PRECACHE = ["/car-app/assets/assets/brand/anchorage-hero.0450b828e4f9c1f4456240096598f6f5.png", "/car-app/assets/assets/brand/anchorage.fea5ce2f6fd18bf2950aa21c0980ed8e.png", "/car-app/assets/assets/recipes/fishsupper.1609c58319e1e8721f5c639049fb054e.jpg", "/car-app/assets/assets/recipes/lobster.2fb3485c8e372972099259017358c1b8.jpg", "/car-app/assets/assets/recipes/moules.a4f342fc7e7fb62c8a0b5c1678bbea3f.jpg", "/car-app/assets/assets/recipes/skink.4ce7b7c676f9cdcd0a060eda46f5a00e.jpg", "/car-app/assets/assets/recipes/stp.1061ced765efdcafff2554adc3fc7113.jpg", "/car-app/assets/assets/specials/sample-chalkboard.e7b4e4450a8483d4219bc6a214158d8f.jpg", "/car-app/assets/node_modules/@expo-google-fonts/poppins/400Regular/Poppins_400Regular.093ee89be9ede30383f39a899c485a82.ttf", "/car-app/assets/node_modules/@expo-google-fonts/poppins/500Medium/Poppins_500Medium.bf59c687bc6d3a70204d3944082c5cc0.ttf", "/car-app/assets/node_modules/@expo-google-fonts/poppins/600SemiBold/Poppins_600SemiBold.6f1520d107205975713ba09df778f93f.ttf", "/car-app/assets/node_modules/@expo-google-fonts/poppins/700Bold/Poppins_700Bold.08c20a487911694291bd8c5de41315ad.ttf", "/car-app/assets/node_modules/expo-router/assets/arrow_down.017bc6ba3fc25503e5eb5e53826d48a8.png", "/car-app/assets/node_modules/expo-router/assets/error.d1ea1496f9057eb392d5bbf3732a61b7.png", "/car-app/assets/node_modules/expo-router/assets/file.19eeb73b9593a38f8e9f418337fc7d10.png", "/car-app/assets/node_modules/expo-router/assets/forward.d8b800c443b8972542883e0b9de2bdc6.png", "/car-app/assets/node_modules/expo-router/assets/pkg.ab19f4cbc543357183a20571f68380a3.png", "/car-app/assets/node_modules/expo-router/assets/react-navigation/elements/back-icon-mask.0a328cd9c1afd0afe8e3b1ec5165b1b4.png", "/car-app/assets/node_modules/expo-router/assets/react-navigation/elements/back-icon.35ba0eaec5a4f5ed12ca16fabeae451d.png", "/car-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55.png", "/car-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@2x.png", "/car-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@3x.png", "/car-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@4x.png", "/car-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7.png", "/car-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@2x.png", "/car-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@3x.png", "/car-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@4x.png", "/car-app/assets/node_modules/expo-router/assets/react-navigation/elements/search-icon.286d67d3f74808a60a78d3ebf1a5fb57.png", "/car-app/assets/node_modules/expo-router/assets/sitemap.412dd9275b6b48ad28f5e3d81bb1f626.png", "/car-app/assets/node_modules/expo-router/assets/unmatched.20e71bdf79e3a97bf55fd9e164041578.png", "/car-app/favicon.ico", "/car-app/index.html", "/car-app/_expo/static/js/web/bundle.js?v=b38986d6f11ad09836038cec62e3e014a4a12c27c100a4a473b55b2696a4c284"]; +const PRECACHE = ["/car-app/assets/assets/brand/anchorage-hero.0450b828e4f9c1f4456240096598f6f5.png", "/car-app/assets/assets/brand/anchorage.fea5ce2f6fd18bf2950aa21c0980ed8e.png", "/car-app/assets/assets/recipes/fishsupper.1609c58319e1e8721f5c639049fb054e.jpg", "/car-app/assets/assets/recipes/lobster.2fb3485c8e372972099259017358c1b8.jpg", "/car-app/assets/assets/recipes/moules.a4f342fc7e7fb62c8a0b5c1678bbea3f.jpg", "/car-app/assets/assets/recipes/skink.4ce7b7c676f9cdcd0a060eda46f5a00e.jpg", "/car-app/assets/assets/recipes/stp.1061ced765efdcafff2554adc3fc7113.jpg", "/car-app/assets/assets/specials/sample-chalkboard.e7b4e4450a8483d4219bc6a214158d8f.jpg", "/car-app/assets/node_modules/@expo-google-fonts/poppins/400Regular/Poppins_400Regular.093ee89be9ede30383f39a899c485a82.ttf", "/car-app/assets/node_modules/@expo-google-fonts/poppins/500Medium/Poppins_500Medium.bf59c687bc6d3a70204d3944082c5cc0.ttf", "/car-app/assets/node_modules/@expo-google-fonts/poppins/600SemiBold/Poppins_600SemiBold.6f1520d107205975713ba09df778f93f.ttf", "/car-app/assets/node_modules/@expo-google-fonts/poppins/700Bold/Poppins_700Bold.08c20a487911694291bd8c5de41315ad.ttf", "/car-app/assets/node_modules/expo-router/assets/arrow_down.017bc6ba3fc25503e5eb5e53826d48a8.png", "/car-app/assets/node_modules/expo-router/assets/error.d1ea1496f9057eb392d5bbf3732a61b7.png", "/car-app/assets/node_modules/expo-router/assets/file.19eeb73b9593a38f8e9f418337fc7d10.png", "/car-app/assets/node_modules/expo-router/assets/forward.d8b800c443b8972542883e0b9de2bdc6.png", "/car-app/assets/node_modules/expo-router/assets/pkg.ab19f4cbc543357183a20571f68380a3.png", "/car-app/assets/node_modules/expo-router/assets/react-navigation/elements/back-icon-mask.0a328cd9c1afd0afe8e3b1ec5165b1b4.png", "/car-app/assets/node_modules/expo-router/assets/react-navigation/elements/back-icon.35ba0eaec5a4f5ed12ca16fabeae451d.png", "/car-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55.png", "/car-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@2x.png", "/car-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@3x.png", "/car-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@4x.png", "/car-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7.png", "/car-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@2x.png", "/car-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@3x.png", "/car-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@4x.png", "/car-app/assets/node_modules/expo-router/assets/react-navigation/elements/search-icon.286d67d3f74808a60a78d3ebf1a5fb57.png", "/car-app/assets/node_modules/expo-router/assets/sitemap.412dd9275b6b48ad28f5e3d81bb1f626.png", "/car-app/assets/node_modules/expo-router/assets/unmatched.20e71bdf79e3a97bf55fd9e164041578.png", "/car-app/favicon.ico", "/car-app/index.html", "/car-app/_expo/static/js/web/bundle.js?v=766185fa16d62d7e55c3d907023f2c9e2293e93743c75830ae934a7ae2c10e27"]; // Hugging Face serves large files (fonts) through a redirect to its CDN. Browsers refuse to hand a *redirected* cached // response to a page, so store a plain copy instead (otherwise fonts, and so the app, fail to load offline). const plain = r => r.redirected ? r.blob().then(b => new Response(b, { status: 200, headers: { 'Content-Type': r.headers.get('Content-Type') || b.type || 'application/octet-stream' } })) : Promise.resolve(r); diff --git a/chef-app/_expo/static/js/web/bundle.js b/chef-app/_expo/static/js/web/bundle.js index 0d7cdaafd2061e2a5b58fe158a2d500b3cc2a184..24c63bc100483416f2daa7c29edc4c169102781a 100644 --- a/chef-app/_expo/static/js/web/bundle.js +++ b/chef-app/_expo/static/js/web/bundle.js @@ -921,7 +921,7 @@ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{v __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"ANCHORAGE_PAY",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"ANCHORAGE_KITCHEN",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"ANCHORAGE_KITCHEN_OLD",{enumerable:!0,get:function(){return u}}),Object.defineProperty(e,"restaurants",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"demoMenus",{enumerable:!0,get:function(){return l}});var t=r(d[0]);const n={slotMinutes:15,slotCap:3,bufferMins:5,leadMins:20,takeawayPaused:!1,bookingCoversPerSlot:20,bookingSlotMinutes:15,deposit:{...r(d[1]).DEPOSIT_DEFAULT},stampTarget:8,stampReward:'Free dessert',stampMinSpend:1e3,capacityPerHour:48,walkInShare:.35,turnMins:75,orderAtTable:!0},o={tipsFrequency:'fortnightly',tipsAnchorPayday:'2026-11-02',tipsEndsDaysBefore:1,wagePayDay:28,wageCutoffDay:23,weekendRule:'none'},s={0:['12:30','19:00'],1:null,2:null,3:['12:00','19:00'],4:['12:00','19:00'],5:['12:00','20:00'],6:['12:00','20:00']},u={0:['12:30','20:00'],1:null,2:null,3:['12:00','19:00'],4:['12:00','19:00'],5:['12:00','20:30'],6:['12:00','20:30']},c=[{id:'anchorage',name:'The Anchorage',tagline:'Harbourside seafood & Scottish produce',location:'Harbour View, Dunure, South Ayrshire',fictional:!1,phone:'01292 502826',website:'anchoragedunure.com',kitchenHours:s,hoursNote:'Kitchen (food) hours from Gordon, 30 Oct 2026: closed Mon\u2013Tue. The closing time is last food orders. Bar hours not set.',settings:{...n,orderAtTable:!1,pay:o,cashUpRecord:[...t.ANCHORAGE_CASH_UP],bookingCoversPerStart:15,bookingPartiesPerStart:4,onlinePartyMin:1,onlinePartyMax:8,bookingNoticeMins:15,autoAcceptUpTo:8},sections:[]}],l=[]},838,[839,841]); __d(function(g,_r,_i,_a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"TAKINGS_FIELDS",{enumerable:!0,get:function(){return t}}),Object.defineProperty(_e,"NO_SERVICE_SPLIT",{enumerable:!0,get:function(){return n}}),Object.defineProperty(_e,"TAKINGS_KEYS",{enumerable:!0,get:function(){return r}}),_e.withTakingsFields=function(e){e=e.filter(e=>!n.includes(e.key));const r=new Set(e.map(e=>e.key)),o=t.filter(e=>!r.has(e.key)).map(e=>({...e}));if(!o.length)return e;const a=e.findIndex(e=>'cash'===e.key),i=a<0?e.length:a+1;return[...e.slice(0,i),...o,...e.slice(i)]},Object.defineProperty(_e,"grossOf",{enumerable:!0,get:function(){return o}}),Object.defineProperty(_e,"ANCHORAGE_CASH_UP",{enumerable:!0,get:function(){return a}}),_e.cashFieldsForRecord=function(e,t){if(!t?.length)return e;const n=new Set,r=[];for(const o of t){const t=i[o],a=t?.key??`cu-${o.toLowerCase().replace(/[^a-z0-9]+/g,'-').replace(/^-|-$/g,'')||'figure'}`,l=e.find(e=>e.key===a);r.push({...l,...t??{kind:'money'},key:a,label:o}),n.add(a)}return[...r,...e.filter(e=>!n.has(e.key))]},Object.defineProperty(_e,"DEFAULT_CASHUP_FIELDS",{enumerable:!0,get:function(){return l}}),Object.defineProperty(_e,"DEFAULT_SALES_FIELDS",{enumerable:!0,get:function(){return u}}),_e.parseAmount=function(t,n="money"){if('number'===n){const e=t.replace(/[\xa3\s]/g,'');return/^\d{1,6}$/.test(e)?Number(e):null}return(0,e.parseMoneyInput)(t)},Object.defineProperty(_e,"isBlank",{enumerable:!0,get:function(){return s}}),Object.defineProperty(_e,"ymdUTC",{enumerable:!0,get:function(){return c}}),Object.defineProperty(_e,"addDaysYmd",{enumerable:!0,get:function(){return y}}),_e.weekStartOf=function(e){const t=(d(e).getUTCDay()+6)%7;return y(e,-t)},_e.combinedTips=function(e){const t='number'==typeof e.cashTips?e.cashTips:null,n='number'==typeof e.cardTips?e.cardTips:null;return null==t&&null==n?null:Math.round(100*((t??0)+(n??0)))/100},Object.defineProperty(_e,"takings",{enumerable:!0,get:function(){return f}}),Object.defineProperty(_e,"missing",{enumerable:!0,get:function(){return m}}),_e.dailySeries=function(e,t,n,r=f){const o=new Map(e.filter(e=>e.confirmedAt).map(e=>[e.date,e]));return Array.from({length:n},(e,a)=>{const i=y(t,a-n+1),l=o.get(i);return{date:i,value:l?r(l.vals):null}})},_e.weekCompare=function(e,t,n="net"){const r=t=>{const r=e.find(e=>e.weekStart===t&&e.confirmedAt),o=r?.vals[n];return'number'==typeof o?o:null},o=r(t),a=r(y(t,-7)),i=null!=o&&null!=a&&0!==a?Math.round((o-a)/a*1e3)/10:null;return{now:o,prev:a,change:i}},_e.tipsPot=function(e,t,n,r){const o=t.filter(e=>'payout'===e.kind&&e.throughDate).sort((e,t)=>e.at.localeCompare(t.at)),a=o[o.length-1],i=a?y(a.throughDate,1):n,l=e.filter(e=>e.date>=i&&e.date<=r).sort((e,t)=>e.date.localeCompare(t.date)),u=t.filter(e=>'correction'===e.kind&&e.forDate&&e.forDate>=i&&e.forDate<=r&&(!a||e.at>a.at)),s=Math.round(100*(l.reduce((e,t)=>e+t.total,0)+u.reduce((e,t)=>e+t.amount,0)))/100;return{from:i,total:Math.max(0,s),days:l,corrections:u,lastPayout:a??null,history:o.slice().reverse()}},_e.shareByHours=function(e,t,n){return e>0&&t>0&&n>0?Math.round(e*(t/n)*100)/100:0},_e.cashLocked=function(e,t=Date.now()){return!(!e.onServer||!e.confirmedAt)&&!(e.unlockedUntil&&Date.parse(e.unlockedUntil)>t)},_e.changedFields=function(e,t){const n=e??{},r=t??{},o=[],a=n.vals??{},i=r.vals??{};for(const e of new Set([...Object.keys(a),...Object.keys(i)]))JSON.stringify(a[e])!==JSON.stringify(i[e])&&o.push(e);JSON.stringify(n.categories??null)!==JSON.stringify(r.categories??null)&&(n.categories||r.categories)&&o.push('categories');JSON.stringify(n.photos??[])!==JSON.stringify(r.photos??[])&&e&&t&&o.push('photos');return o},Object.defineProperty(_e,"dayTakingsOf",{enumerable:!0,get:function(){return p}}),Object.defineProperty(_e,"daysInMonth",{enumerable:!0,get:function(){return k}}),_e.addMonths=b,Object.defineProperty(_e,"monthName",{enumerable:!0,get:function(){return O}}),Object.defineProperty(_e,"shortDay",{enumerable:!0,get:function(){return C}}),Object.defineProperty(_e,"longDay",{enumerable:!0,get:function(){return D}}),_e.poundsWhole=function(e){const t=e<0,n=String(Math.round(Math.abs(e))).replace(/\B(?=(\d{3})+(?!\d))/g,',');return`${t?'-':''}\xa3${n}`},_e.monthTakings=function(e,t,n,r){const o=new Map;for(const n of e){if(n.rid!==t)continue;const e=p(n);null!=e&&o.set(n.date,e)}const a=Number(n.slice(0,4)),i=Number(n.slice(5,7)),l=k(a,i),u=Array.from({length:l},(e,t)=>{const a=`${n}-${String(t+1).padStart(2,'0')}`,i=o.get(a),l=null!=i&&a<=r?'recorded':a>r?'future':a===r?'pending':'missing';return{date:a,day:t+1,value:'recorded'===l?i:null,state:l}}),s=u.filter(e=>'recorded'===e.state),c=Math.round(100*s.reduce((e,t)=>e+(t.value??0),0))/100,d=s.reduce((e,t)=>!e||t.value>e.value?{date:t.date,value:t.value}:e,null),y=r.slice(0,7)===n,f=n0?Math.round((c-T)/T*100):null;return{ym:n,month:O(n),days:u,total:c,recorded:s.length,current:y,past:f,best:d,vsPct:D}},Object.defineProperty(_e,"firstTakingsMonth",{enumerable:!0,get:function(){return P}}),_e.canSeeMonthTakings=function(e,t,n={}){return!n.inStaffApp&&'owner'===e&&(t?'owner'===t.role||!0===t.ownerAccess:!n.live)},_e.ownerHomeLayout=function(e,t,n=!1){return!n&&'owner'===e&&(!t||'owner'===t.role||!0===t.ownerAccess)};var e=_r(_d[0]);const t=[{key:'gross',label:'Gross takings',kind:'money',fixed:!0,optional:!0},{key:'food',label:'Food takings (optional)',kind:'money',fixed:!0,optional:!0},{key:'drink',label:'Drink takings (optional)',kind:'money',fixed:!0,optional:!0}],n=['lunchGross','dinnerGross'],r=t.map(e=>e.key);const o=e=>'number'==typeof e.gross?e.gross:null,a=['Z total','Card total','Cash total','Paid out','Card tips','Cash tips'],i={'Z total':{key:'zTotal',kind:'money'},'Card total':{key:'card',kind:'money'},'Cash total':{key:'cash',kind:'money'},'Paid out':{key:'paidOut',kind:'money',optional:!0},'Card tips':{key:'cardTips',kind:'money',fixed:!0},'Cash tips':{key:'cashTips',kind:'money',fixed:!0}};const l=[{key:'card',label:'Card takings',kind:'money'},{key:'cash',label:'Cash takings',kind:'money'},{key:'paidOut',label:'Paid out',kind:'money',fixed:!0,optional:!0},...t,{key:'float',label:'Float (tills)',kind:'money'},{key:'cashTips',label:'Cash tips total',kind:'money',fixed:!0},{key:'cardTips',label:'Card tips total',kind:'money',fixed:!0},{key:'overUnder',label:'Over / under (discrepancy)',kind:'money'},{key:'notes',label:'Notes',kind:'text'}],u=[{key:'gross',label:'Gross sales',kind:'money'},{key:'net',label:'Net sales',kind:'money',fixed:!0},{key:'vat',label:'VAT',kind:'money'},{key:'covers',label:'Covers',kind:'number'},{key:'discounts',label:'Discounts',kind:'money'},{key:'refunds',label:'Refunds',kind:'money'}];const s=e=>null==e||''===e,c=e=>e.toISOString().slice(0,10),d=e=>new Date(`${e}T12:00:00Z`),y=(e,t)=>{const n=d(e);return n.setUTCDate(n.getUTCDate()+t),c(n)};const f=e=>{const t='number'==typeof e.card?e.card:null,n='number'==typeof e.cash?e.cash:null;return null==t&&null==n?null:(t??0)+(n??0)},m=(e,t)=>e.filter(e=>'text'!==e.kind&&!e.optional&&s(t[e.key])).map(e=>e.key);const p=e=>e.confirmedAt?o(e.vals)??f(e.vals):null,k=(e,t)=>new Date(Date.UTC(e,t,0)).getUTCDate();function b(e,t){const n=Number(e.slice(0,4)),r=Number(e.slice(5,7))-1+t;return`${n+Math.floor(r/12)}-${String((r%12+12)%12+1).padStart(2,'0')}`}const h=['January','February','March','April','May','June','July','August','September','October','November','December'],S=['Sun','Mon','Tue','Wed','Thu','Fri','Sat'],T=['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'],O=e=>h[Number(e.slice(5,7))-1]??'',C=e=>{const t=d(e);return`${S[t.getUTCDay()]} ${t.getUTCDate()} ${h[t.getUTCMonth()].slice(0,3)}`},D=e=>{const t=d(e);return`${T[t.getUTCDay()]} ${t.getUTCDate()} ${h[t.getUTCMonth()]}`};const P=(e,t)=>e.filter(e=>e.rid===t&&null!=p(e)).map(e=>e.date.slice(0,7)).sort()[0]??null},839,[840]); __d(function(g,r,_i,_a,m,e,d){"use strict";function t(t,n){const i=!(!n?.allowMinus||!String(t??'').trim().startsWith('-'));let s=String(t??'').replace(/,/g,'.');s=s.replace(/[^\d.]/g,'');const l=s.indexOf('.');if(l>=0){s=s.slice(0,l+1)+s.slice(l+1).replace(/\./g,'');const[t,n=""]=s.split('.');s=t+'.'+n.slice(0,2)}return(i?'-':'')+s}Object.defineProperty(e,'__esModule',{value:!0}),e.sanitiseMoneyTyping=t,e.parseMoneyInput=function(n){const i=String(n??''),s=i.trim().startsWith('-'),l=i.trim().replace(/^\xa3/,'').replace(/\xa3/g,'').replace(/\s/g,'').replace(/^-/,'');if(l&&/[^\d.,]/.test(l))return null;const c=t(n);if(!c||'.'===c)return null;if(!/^\d+(\.\d{0,2})?$/.test(c))return null;const u=Math.round(100*Number(c))/100;return Number.isFinite(u)?s?-u:u:null},Object.defineProperty(e,"onMoneyChange",{enumerable:!0,get:function(){return n}});const n=n=>i=>n(t(i))},840,[]); -__d(function(g,r,i,a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"DEPOSIT_DEFAULT",{enumerable:!0,get:function(){return e}}),_e.depositOf=function(t){const n=t?.deposit;return n&&'object'==typeof n?{on:n.on??e.on,...!0===n.needsConfirmation?{needsConfirmation:!0}:{},perPersonPence:Number.isFinite(n.perPersonPence)?Math.max(0,Math.round(n.perPersonPence)):n.needsConfirmation?0:e.perPersonPence,fromParty:Number.isFinite(n.fromParty)?Math.max(1,Math.round(n.fromParty)):n.needsConfirmation?1:e.fromParty,refundable:'boolean'==typeof n.refundable?n.refundable:null,cutoffHours:Number.isFinite(n.cutoffHours)?Math.max(0,Math.round(n.cutoffHours)):null,policy:'string'==typeof n.policy?n.policy.slice(0,600):'',wixLinksOn:!0===n.wixLinksOn,wixLinkHours:Number.isFinite(n.wixLinkHours)?Math.max(1,Math.min(168,Math.round(n.wixLinkHours))):48}:{...e}},_e.childrenIn=t,Object.defineProperty(_e,"adultsIn",{enumerable:!0,get:function(){return n}}),_e.depositDue=o,_e.depositWords=function(e,d,u,p=0){if(e.needsConfirmation&&!e.on)return[e.policy.trim()||'Deposit policy awaiting venue confirmation.'];if(e.needsConfirmation)return['Table deposit policy not set yet. Ticketed event deposits are separate and are not a table policy.'];const l=o(e,d,p);if(!l)return[];const c=[t(d,p)?`A deposit of ${s(l)} (${s(e.perPersonPence)} for each of the ${n(d,p)} adults; children are free) is needed for ${e.fromParty} or more guests.`:`A deposit of ${s(l)} (${s(e.perPersonPence)} per adult; children are free) is needed for ${e.fromParty} or more guests.`];!0===e.refundable?c.push(e.cutoffHours?`Refundable if you cancel at least ${e.cutoffHours} hours before your booking.`:'Refundable if you cancel.'):!1===e.refundable?c.push('The deposit is not refundable.'):c.push(`Ask ${u} about refunds.`);e.policy.trim()&&c.push(e.policy.trim());return c.push(e.wixLinksOn?`${u} will send you a link to pay the deposit securely through website bookings.`:`No payment is taken in the app yet: ${u} will tell you how to pay the deposit.`),c},_e.waiverOf=d,_e.depositState=u,_e.waiverText=p,_e.canWaiveDeposit=function(e){if(['cancelled','finished','noshow','declined'].includes(e.status??''))return!1;const t=l(e);return'PAID'!==t&&'FULLY_REFUNDED'!==t&&'PARTIALLY_REFUNDED'!==t&&'FREE'!==t&&('paid'!==e.depositLink?.state&&('NOT_PAID'===t||'PARTIALLY_PAID'===t?!d(e):'due'===u(e)))},_e.wixPayStatus=l,_e.knownPaid=c,_e.fromWixOrder=f,_e.estimatedWix=b,_e.depositBadge=m,_e.canTickDeposit=function(e){if(d(e))return!1;const t=l(e);return'NOT_PAID'!==t&&'PAID'!==t&&'FULLY_REFUNDED'!==t&&'PARTIALLY_REFUNDED'!==t&&('paid'!==e.depositLink?.state&&'due'===u(e))},_e.canSendDepositLink=function(e,t){return!(!t.wixLinksOn||l(e)||d(e))&&(!e.walkIn&&!['cancelled','finished','noshow','declined'].includes(e.status??'')&&('due'===u(e)&&'paid'!==e.depositLink?.state))},_e.depositTerms=function(e){const t=[];!0===e.refundable?t.push(e.cutoffHours?`The deposit is refundable if you cancel at least ${e.cutoffHours} hours before.`:'The deposit is refundable if you cancel.'):!1===e.refundable&&t.push('The deposit is not refundable.');e.policy.trim()&&t.push(e.policy.trim());return t.join(' ')},_e.depositLinkMessage=function(e){const t=(e.name||'').trim().split(/\s+/)[0]||'there',[n,o,d]=e.date.split('-').map(Number),u=new Date(n,(o||1)-1,d||1).toLocaleDateString('en-GB',{weekday:'long',day:'numeric',month:'long'}),p=e.expiresAt?new Date(e.expiresAt).toLocaleString('en-GB',{timeZone:'Europe/London',weekday:'long',day:'numeric',month:'long',hour:'numeric',minute:'2-digit',hourCycle:'h12'}).replace(/\s?(am|pm)$/i,e=>e.trim().toLowerCase()):'',l=[`Hello ${t}, thank you for booking ${e.venue} for ${e.partySize} on ${u} at ${e.time.slice(0,5)}.`,`To hold your table, please pay the ${s(e.amountPence)} deposit here: ${e.url}`];p&&l.push(`The link works until ${p}.`);e.terms?.trim()&&l.push(e.terms.trim());return l.push(`Thank you, ${e.venue}`),l.join('\n')},_e.depositView=D,_e.depositShort=function(e){const t=D(e,!1);return t?t.a11y.split(',')[0]:null};const e={on:!0,perPersonPence:1e3,fromParty:6,refundable:null,cutoffHours:null,policy:''};function t(e,t){const n=Math.max(0,Math.round(Number(e)||0)),o=Math.round(Number(t)||0);return Math.max(0,Math.min(n,o))}const n=(e,n)=>Math.max(0,Math.round(Number(e)||0)-t(e,n));function o(e,t,o=0){return!e.on||e.perPersonPence<=0||t`\xa3${(e/100).toFixed(e%100?2:0)}`;function d(e){const t=e.depositWaived;return t&&'object'==typeof t&&'string'==typeof t.by&&t.by?t:null}function u(e){if('deposit'!==e.security)return'none';const t=e.depositDue??e.depositPaid??0;return t?(e.depositPaid??0)>=t?'paid':d(e)?'waived':'due':'none'}function p(e){const t=new Date(e.at),n=!Number.isNaN(t.getTime())?t.toLocaleString('en-GB',{timeZone:'Europe/London',day:'2-digit',month:'2-digit',hour:'2-digit',minute:'2-digit',hourCycle:'h23'}).replace(',',''):'';return`Waived by ${e.by}${n?`, ${n}`:''}${e.note?.trim()?` (${e.note.trim()})`:''}`}function l(e){const t=e.wix?.paymentStatus;return t&&['FREE','NOT_PAID','PAID','PARTIALLY_PAID','PARTIALLY_REFUNDED','FULLY_REFUNDED'].includes(t)?t:null}function c(e){return'paid'===e.depositLink?.state&&(e.depositLink.paidPence??0)>0?e.depositLink.paidPence:e.depositPaidBy&&'Wix'!==e.depositPaidBy&&(e.depositPaid??0)>0&&!e.wix?.depositEstimated||f(e)&&(e.depositPaid??0)>0?e.depositPaid:null}function f(e){return'wix-order'===e.wix?.amountSource||'wix-order'===e.depositSource}function b(e){if(f(e)||!e.wix?.depositEstimated&&'estimate'!==e.depositSource)return null;const t=e.depositPaid??0;if(t<=0)return null;const n=e.partySize??0;return{pence:t,perHead:e.wix?.perPersonPence??(n?Math.round(t/n):0),party:n}}function m(e,t=s){const n=l(e),o=c(e),p=d(e);if(p&&'PAID'!==n&&(!e.depositPaidBy||!o)&&'paid'!==e.depositLink?.state&&'paid'!==u(e))return{label:`Deposit waived \xb7 ${p.by}`,kind:'neutral'};if(n&&'FREE'!==n){if(e.depositPaidBy&&o)return{label:`Deposit paid \xb7 ${t(o)}`,kind:'gold'};if('PAID'===n){if(o)return{label:`Deposit paid \xb7 ${t(o)}`,kind:'gold'};const n=b(e);return n?{label:n.party&&n.perHead?`Deposit paid (about ${t(n.pence)}, ${n.party} \xd7 ${t(n.perHead)})`:`Deposit paid (about ${t(n.pence)})`,kind:'gold'}:{label:'Deposit paid on website bookings',kind:'gold'}}return'PARTIALLY_PAID'===n?{label:o&&(e.depositDue??0)>o?`Part paid on website bookings \xb7 ${t(o)} of ${t(e.depositDue)}`:'Part paid on website bookings',kind:'amber'}:'NOT_PAID'===n?{label:(e.depositDue??0)>0?`Deposit not paid \xb7 ${t(e.depositDue)} due`:'Deposit not paid',kind:'amber'}:'FULLY_REFUNDED'===n?{label:'Deposit refunded on website bookings',kind:'neutral'}:{label:'Deposit part refunded on website bookings',kind:'neutral'}}const f=u(e);if('none'===f)return null;const m=e.depositLink;return'paid'===m?.state?{label:o?`Deposit paid on website bookings \xb7 ${t(o)}`:'Deposit paid on website bookings',kind:'gold'}:'paid'===f?{label:o?`Deposit paid \xb7 ${t(o)}`:'Deposit paid',kind:'gold'}:'open'===m?.state?{label:`Deposit link sent \xb7 waiting \xb7 ${t(m.amountPence??e.depositDue??0)}`,kind:'amber'}:'expired'===m?.state?{label:'Deposit link ran out \xb7 send a new one',kind:'amber'}:{label:`Deposit due \xb7 ${t(e.depositDue??0)}`,kind:'amber'}}function D(e,t,n=s){const o=m(e,n);if(!o)return null;const u=l(e),c=o.label.startsWith('Deposit paid');if(o.label.startsWith('Deposit waived')){const n=d(e);return{label:t?o.label:'Deposit waived',kind:'neutral',a11y:p(n).replace(/^Waived/,'Deposit waived'),note:t?p(n):void 0,paid:!1}}if(!t)return c?{label:'\u2713 Deposit paid',kind:'gold',a11y:'Deposit paid',paid:c}:'PARTIALLY_PAID'===u?{label:'Deposit part paid',kind:'amber',a11y:'Deposit part paid',paid:c}:'FULLY_REFUNDED'===u||'PARTIALLY_REFUNDED'===u?{label:'Deposit refunded',kind:'neutral',a11y:'Deposit refunded',paid:c}:'NOT_PAID'===u?{label:'Deposit not paid',kind:'amber',a11y:'Deposit not paid yet',paid:c}:{label:'Deposit due',kind:'amber',a11y:'Deposit due, not paid yet',paid:c};const D='PAID'===u?b(e):null,y=D&&D.perHead?`Website bookings shows paid; amount worked out at ${n(D.perHead)} a head`:f(e)&&c?'Amount from the website bookings order':void 0,P=o.label.replace(/ \xb7 /g,', ').replace(/\xd7/g,'times').replace(/[()]/g,'')+(y?`. ${y}`:'');return{label:o.label,kind:o.kind,a11y:P,note:y,paid:c}}},841,[]); +__d(function(g,r,i,a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"DEPOSIT_DEFAULT",{enumerable:!0,get:function(){return e}}),_e.depositOf=function(t){const n=t?.deposit;return n&&'object'==typeof n?{on:n.on??e.on,...!0===n.needsConfirmation?{needsConfirmation:!0}:{},perPersonPence:Number.isFinite(n.perPersonPence)?Math.max(0,Math.round(n.perPersonPence)):n.needsConfirmation?0:e.perPersonPence,fromParty:Number.isFinite(n.fromParty)?Math.max(1,Math.round(n.fromParty)):n.needsConfirmation?1:e.fromParty,refundable:'boolean'==typeof n.refundable?n.refundable:null,cutoffHours:Number.isFinite(n.cutoffHours)?Math.max(0,Math.round(n.cutoffHours)):null,policy:'string'==typeof n.policy?n.policy.slice(0,600):'',wixLinksOn:!0===n.wixLinksOn,wixLinkHours:Number.isFinite(n.wixLinkHours)?Math.max(1,Math.min(168,Math.round(n.wixLinkHours))):48}:{...e}},_e.childrenIn=t,Object.defineProperty(_e,"adultsIn",{enumerable:!0,get:function(){return n}}),_e.depositDue=o,_e.depositWords=function(e,d,u,p=0){if(e.needsConfirmation&&!e.on)return[e.policy.trim()||'Deposit policy awaiting venue confirmation.'];if(e.needsConfirmation)return['Table deposit policy not set yet. Ticketed event deposits are separate and are not a table policy.'];const l=o(e,d,p);if(!l)return[];const c=[t(d,p)?`A deposit of ${s(l)} (${s(e.perPersonPence)} for each of the ${n(d,p)} adults; children don't count towards the ${e.fromParty} and don't pay) is needed for ${e.fromParty} or more adults.`:`A deposit of ${s(l)} (${s(e.perPersonPence)} per adult; children don't count towards the ${e.fromParty} and don't pay) is needed for ${e.fromParty} or more adults.`];!0===e.refundable?c.push(e.cutoffHours?`Refundable if you cancel at least ${e.cutoffHours} hours before your booking.`:'Refundable if you cancel.'):!1===e.refundable?c.push('The deposit is not refundable.'):c.push(`Ask ${u} about refunds.`);e.policy.trim()&&c.push(e.policy.trim());return c.push(e.wixLinksOn?`${u} will send you a link to pay the deposit securely through website bookings.`:`No payment is taken in the app yet: ${u} will tell you how to pay the deposit.`),c},_e.waiverOf=d,_e.depositState=u,_e.waiverText=p,_e.canWaiveDeposit=function(e){if(['cancelled','finished','noshow','declined'].includes(e.status??''))return!1;const t=l(e);return'PAID'!==t&&'FULLY_REFUNDED'!==t&&'PARTIALLY_REFUNDED'!==t&&'FREE'!==t&&('paid'!==e.depositLink?.state&&('NOT_PAID'===t||'PARTIALLY_PAID'===t?!d(e):'due'===u(e)))},_e.wixPayStatus=l,_e.knownPaid=c,_e.fromWixOrder=f,_e.estimatedWix=b,_e.depositBadge=m,_e.canTickDeposit=function(e){if(d(e))return!1;const t=l(e);return'NOT_PAID'!==t&&'PAID'!==t&&'FULLY_REFUNDED'!==t&&'PARTIALLY_REFUNDED'!==t&&('paid'!==e.depositLink?.state&&'due'===u(e))},_e.canSendDepositLink=function(e,t){return!(!t.wixLinksOn||l(e)||d(e))&&(!e.walkIn&&!['cancelled','finished','noshow','declined'].includes(e.status??'')&&('due'===u(e)&&'paid'!==e.depositLink?.state))},_e.depositTerms=function(e){const t=[];!0===e.refundable?t.push(e.cutoffHours?`The deposit is refundable if you cancel at least ${e.cutoffHours} hours before.`:'The deposit is refundable if you cancel.'):!1===e.refundable&&t.push('The deposit is not refundable.');e.policy.trim()&&t.push(e.policy.trim());return t.join(' ')},_e.depositLinkMessage=function(e){const t=(e.name||'').trim().split(/\s+/)[0]||'there',[n,o,d]=e.date.split('-').map(Number),u=new Date(n,(o||1)-1,d||1).toLocaleDateString('en-GB',{weekday:'long',day:'numeric',month:'long'}),p=e.expiresAt?new Date(e.expiresAt).toLocaleString('en-GB',{timeZone:'Europe/London',weekday:'long',day:'numeric',month:'long',hour:'numeric',minute:'2-digit',hourCycle:'h12'}).replace(/\s?(am|pm)$/i,e=>e.trim().toLowerCase()):'',l=[`Hello ${t}, thank you for booking ${e.venue} for ${e.partySize} on ${u} at ${e.time.slice(0,5)}.`,`To hold your table, please pay the ${s(e.amountPence)} deposit here: ${e.url}`];p&&l.push(`The link works until ${p}.`);e.terms?.trim()&&l.push(e.terms.trim());return l.push(`Thank you, ${e.venue}`),l.join('\n')},_e.depositView=y,_e.depositShort=function(e){const t=y(e,!1);return t?t.a11y.split(',')[0]:null};const e={on:!0,perPersonPence:1e3,fromParty:6,refundable:null,cutoffHours:null,policy:''};function t(e,t){const n=Math.max(0,Math.round(Number(e)||0)),o=Math.round(Number(t)||0);return Math.max(0,Math.min(n,o))}const n=(e,n)=>Math.max(0,Math.round(Number(e)||0)-t(e,n));function o(e,t,o=0){return!e.on||e.perPersonPence<=0||n(t,o)`\xa3${(e/100).toFixed(e%100?2:0)}`;function d(e){const t=e.depositWaived;return t&&'object'==typeof t&&'string'==typeof t.by&&t.by?t:null}function u(e){if('deposit'!==e.security)return'none';const t=e.depositDue??e.depositPaid??0;return t?(e.depositPaid??0)>=t?'paid':d(e)?'waived':'due':'none'}function p(e){const t=new Date(e.at),n=!Number.isNaN(t.getTime())?t.toLocaleString('en-GB',{timeZone:'Europe/London',day:'2-digit',month:'2-digit',hour:'2-digit',minute:'2-digit',hourCycle:'h23'}).replace(',',''):'';return`Waived by ${e.by}${n?`, ${n}`:''}${e.note?.trim()?` (${e.note.trim()})`:''}`}function l(e){const t=e.wix?.paymentStatus;return t&&['FREE','NOT_PAID','PAID','PARTIALLY_PAID','PARTIALLY_REFUNDED','FULLY_REFUNDED'].includes(t)?t:null}function c(e){return'paid'===e.depositLink?.state&&(e.depositLink.paidPence??0)>0?e.depositLink.paidPence:e.depositPaidBy&&'Wix'!==e.depositPaidBy&&(e.depositPaid??0)>0&&!e.wix?.depositEstimated||f(e)&&(e.depositPaid??0)>0?e.depositPaid:null}function f(e){return'wix-order'===e.wix?.amountSource||'wix-order'===e.depositSource}function b(e){if(f(e)||!e.wix?.depositEstimated&&'estimate'!==e.depositSource)return null;const t=e.depositPaid??0;if(t<=0)return null;const n=e.partySize??0;return{pence:t,perHead:e.wix?.perPersonPence??(n?Math.round(t/n):0),party:n}}function m(e,t=s){const n=l(e),o=c(e),p=d(e);if(p&&'PAID'!==n&&(!e.depositPaidBy||!o)&&'paid'!==e.depositLink?.state&&'paid'!==u(e))return{label:`Deposit waived \xb7 ${p.by}`,kind:'neutral'};if(n&&'FREE'!==n){if(e.depositPaidBy&&o)return{label:`Deposit paid \xb7 ${t(o)}`,kind:'gold'};if('PAID'===n){if(o)return{label:`Deposit paid \xb7 ${t(o)}`,kind:'gold'};const n=b(e);return n?{label:n.party&&n.perHead?`Deposit paid (about ${t(n.pence)}, ${n.party} \xd7 ${t(n.perHead)})`:`Deposit paid (about ${t(n.pence)})`,kind:'gold'}:{label:'Deposit paid on website bookings',kind:'gold'}}return'PARTIALLY_PAID'===n?{label:o&&(e.depositDue??0)>o?`Part paid on website bookings \xb7 ${t(o)} of ${t(e.depositDue)}`:'Part paid on website bookings',kind:'amber'}:'NOT_PAID'===n?{label:(e.depositDue??0)>0?`Deposit not paid \xb7 ${t(e.depositDue)} due`:'Deposit not paid',kind:'amber'}:'FULLY_REFUNDED'===n?{label:'Deposit refunded on website bookings',kind:'neutral'}:{label:'Deposit part refunded on website bookings',kind:'neutral'}}const f=u(e);if('none'===f)return null;const m=e.depositLink;return'paid'===m?.state?{label:o?`Deposit paid on website bookings \xb7 ${t(o)}`:'Deposit paid on website bookings',kind:'gold'}:'paid'===f?{label:o?`Deposit paid \xb7 ${t(o)}`:'Deposit paid',kind:'gold'}:'open'===m?.state?{label:`Deposit link sent \xb7 waiting \xb7 ${t(m.amountPence??e.depositDue??0)}`,kind:'amber'}:'expired'===m?.state?{label:'Deposit link ran out \xb7 send a new one',kind:'amber'}:{label:`Deposit due \xb7 ${t(e.depositDue??0)}`,kind:'amber'}}function y(e,t,n=s){const o=m(e,n);if(!o)return null;const u=l(e),c=o.label.startsWith('Deposit paid');if(o.label.startsWith('Deposit waived')){const n=d(e);return{label:t?o.label:'Deposit waived',kind:'neutral',a11y:p(n).replace(/^Waived/,'Deposit waived'),note:t?p(n):void 0,paid:!1}}if(!t)return c?{label:'\u2713 Deposit paid',kind:'gold',a11y:'Deposit paid',paid:c}:'PARTIALLY_PAID'===u?{label:'Deposit part paid',kind:'amber',a11y:'Deposit part paid',paid:c}:'FULLY_REFUNDED'===u||'PARTIALLY_REFUNDED'===u?{label:'Deposit refunded',kind:'neutral',a11y:'Deposit refunded',paid:c}:'NOT_PAID'===u?{label:'Deposit not paid',kind:'amber',a11y:'Deposit not paid yet',paid:c}:{label:'Deposit due',kind:'amber',a11y:'Deposit due, not paid yet',paid:c};const y='PAID'===u?b(e):null,D=y&&y.perHead?`Website bookings shows paid; amount worked out at ${n(y.perHead)} a head`:f(e)&&c?'Amount from the website bookings order':void 0,P=o.label.replace(/ \xb7 /g,', ').replace(/\xd7/g,'times').replace(/[()]/g,'')+(D?`. ${D}`:'');return{label:o.label,kind:o.kind,a11y:P,note:D,paid:c}}},841,[]); __d(function(_g,_r,_i,_a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"SHAPES",{enumerable:!0,get:function(){return a}}),Object.defineProperty(_e,"shapeLabel",{enumerable:!0,get:function(){return o}}),Object.defineProperty(_e,"tableLabel",{enumerable:!0,get:function(){return s}}),Object.defineProperty(_e,"tableNumber",{enumerable:!0,get:function(){return u}}),_e.numberClashes=function(e){const t=new Map;for(const n of e){const e=u(n);t.set(e,[...t.get(e)??[],{name:n.name,areaId:n.areaId}])}const n=new Set,r=[];for(const[e,a]of t){if(a.length<2)continue;const t=new Map;a.forEach(e=>t.set(e.areaId,[...t.get(e.areaId)??[],e.name]));for(const e of t.values())e.length>1&&e.forEach(e=>n.add(e));t.size>1&&r.push(e)}return{sameArea:n,acrossAreas:r}},Object.defineProperty(_e,"liveTableLabel",{enumerable:!0,get:function(){return l}}),Object.defineProperty(_e,"FIXTURES",{enumerable:!0,get:function(){return i}}),Object.defineProperty(_e,"PLAN_W",{enumerable:!0,get:function(){return c}}),Object.defineProperty(_e,"PLAN_H",{enumerable:!0,get:function(){return b}}),Object.defineProperty(_e,"GRID",{enumerable:!0,get:function(){return m}}),Object.defineProperty(_e,"snap",{enumerable:!0,get:function(){return f}}),Object.defineProperty(_e,"clamp",{enumerable:!0,get:function(){return h}}),Object.defineProperty(_e,"fid",{enumerable:!0,get:function(){return g}}),Object.defineProperty(_e,"slug",{enumerable:!0,get:function(){return w}}),_e.sizeFor=y,Object.defineProperty(_e,"minFor",{enumerable:!0,get:function(){return x}}),Object.defineProperty(_e,"numOf",{enumerable:!0,get:function(){return O}}),Object.defineProperty(_e,"byNumber",{enumerable:!0,get:function(){return P}}),_e.newTable=j,_e.autoArrange=M,_e.placeNew=S,_e.rotate90=function(e){const t=e.x+e.w/2,n=e.y+e.h/2;return{...e,w:e.h,h:e.w,x:h(f(t-e.h/2),0,c-e.h),y:h(f(n-e.w/2),0,b-e.w)}},_e.normalisePlan=function(e){return{...e,fixtures:e.fixtures??[],tables:e.tables.map(e=>{const t=e.shape;let n='booth'===t||'rect'===t?'rect':'round'===t?'round':'square',{w:r,h:a}=e;if('square'===n||'round'===n){const e=Math.max(r,a);r=e,a=e}if(90===e.rot||270===e.rot){const e=r;r=a,a=e}return'rect'===n&&r===a&&(n='square'),{...e,shape:n,w:r,h:a,rot:0}})}},Object.defineProperty(_e,"SECTION_COLOURS",{enumerable:!0,get:function(){return I}}),_e.buildPlan=k,_e.anchoragePlan=$,_e.starterPlan=function(){return k({areas:[{name:'Main room',tables:[[1,2],[2,4],[3,6],[4,4],[5,2],[6,6]],fixtures:[A(450,600)]}]},['SV'])},Object.defineProperty(_e,"TEMPLATES",{enumerable:!0,get:function(){return v}}),_e.parseTableList=function(e){const t=[],n=[];let r;for(const a of e.split(/\r?\n/)){const e=a.trim();if(!e)continue;if(!/\d/.test(e)){r=e.replace(/[:\-\u2013]+$/,'').trim()||r;continue}const o=e.match(/^(?:table|tbl|tab|t)?\s*(?:no\.?|number|#)?\s*([a-z]?\d+[a-z]?)\b[^\d]*?(\d+)/i);if(!o){n.push(e);continue}const s=parseInt(o[2],10);!s||s>30?n.push(e):t.push({area:r,name:o[1].toUpperCase(),seats:s})}return{items:t,skipped:n}},Object.defineProperty(_e,"planCounts",{enumerable:!0,get:function(){return C}}),Object.defineProperty(_e,"tableDogOk",{enumerable:!0,get:function(){return B}}),Object.defineProperty(_e,"dogTables",{enumerable:!0,get:function(){return L}}),Object.defineProperty(_e,"areaOfTable",{enumerable:!0,get:function(){return q}}),_e.bestTables=E,Object.defineProperty(_e,"isBestTable",{enumerable:!0,get:function(){return _}}),_e.withSeedBest=function(e,t){if('anchorage'!==e||!t?.areas?.some(e=>void 0===e.best))return t;const n=$();return{...t,areas:t.areas.map(e=>{if(void 0!==e.best)return e;const r=n.areas.find(t=>t.id===e.id||t.name===e.name),a=(r?.best??[]).filter(n=>t.tables.some(t=>t.name===n&&t.areaId===e.id));return a.length?{...e,best:a}:e})}};var e,t=_r(d[0]),n=_r(d[1]),r=(e=n)&&e.__esModule?e:{default:e};const a=[{id:'square',label:'Square'},{id:'rect',label:'Rectangle'},{id:'round',label:'Round'}],o=e=>'rect'===e?'Rectangle':'round'===e?'Round':'Square',s=e=>/\d/.test(e.name)?(0,t.plainTableNumber)(e.name):(0,t.plainTableNumber)(e.label?.trim()||e.name),u=s;const l=(e,t)=>u(e),i=[{id:'bar',label:'Bar',w:300,h:50},{id:'wall',label:'Wall',w:250,h:25},{id:'door',label:'Door',w:100,h:25},{id:'window',label:'Window',w:200,h:25}],c=1e3,b=625,m=25,f=e=>Math.round(e/m)*m,h=(e,t,n)=>Math.max(t,Math.min(n,e));let p=0;const g=e=>`${e}-${Date.now().toString(36)}${(p++).toString(36)}`,w=e=>e.toLowerCase().replace(/[^a-z0-9]+/g,'-').replace(/^-|-$/g,'')||'area';function y(e){return e<=2?{shape:'square',w:75,h:75}:e<=4?{shape:'square',w:100,h:100}:e<=6?{shape:'rect',w:150,h:100}:e<=8?{shape:'rect',w:200,h:100}:e<=10?{shape:'rect',w:250,h:100}:{shape:'rect',w:300,h:100}}const x=e=>e<=2?1:Math.max(2,Math.ceil(e/2)),O=e=>{const t=e.match(/\d+/);return t?parseInt(t[0],10):9999},P=(e,t)=>O(e.name)-O(t.name)||e.name.localeCompare(t.name);function j(e,t,n,r){const a=y(n);return{id:`t-${e}-${g('x').slice(2)}`,name:e,areaId:t,shape:a.shape,minSeats:x(n),maxSeats:n,x:0,y:0,w:a.w,h:a.h,rot:0,online:!0,sectionId:r}}function M(e,t=125,n=75){const r=[...e].sort(P);if(!r.length)return r;let a=75;const o=e=>{const t=[];let n=[],a=0;for(const o of r){const r=(n.length?e:0)+o.w;n.length&&a+r>850&&(t.push(n),n=[],a=0),n.push(o),a+=(n.length>1?e:0)+o.w}return n.length&&t.push(n),t};let s=o(a);const u=(e,t)=>e.reduce((e,t)=>e+Math.max(...t.map(e=>e.h)),0)+t*(e.length-1);for(;u(s,a)>b-t-n&&a>25;)a-=25,s=o(a);const l=u(s,a),i=b-t-n,p=s.length>1?Math.min(150,a+Math.max(0,Math.floor((i-l)/(s.length-1)/m)*m)):0,g=s.reduce((e,t)=>e+Math.max(...t.map(e=>e.h)),0)+p*(s.length-1);let w=f(t+Math.max(0,(i-g)/2));const y=[];for(const e of s){const t=Math.max(...e.map(e=>e.h)),n=e.reduce((e,t)=>e+t.w,0)+a*(e.length-1);let r=f((c-n)/2);for(const n of e)y.push({...n,x:h(r,0,c-n.w),y:h(f(w+(t-n.h)/2),0,b-n.h),rot:0}),r+=n.w+a;w+=t+p}return y}function S(e,t,n=[]){const r=[...e,...n].map(e=>({x:e.x,y:e.y,w:e.w,h:e.h})),a=[];for(const e of t){let t=null;for(let n=50;n<=b-e.h-25&&!t;n+=m)for(let a=50;a<=c-e.w-25&&!t;a+=m){const o=50;r.some(t=>at.x&&nt.y)||(t={x:a,y:n})}const n=t??{x:50,y:50},o={...e,x:n.x,y:n.y};r.push({x:o.x,y:o.y,w:o.w,h:o.h}),a.push(o)}return a}const I=['#CFA45F','#E2C489','#A88B5A','#8C6A3A','#FFB547','#D9B98A'];function k(e,t=[]){const n=[],r=[],a=[],o=[];e.areas.forEach((e,s)=>{const u=w(e.name),l=e.best?e.best.map(String).filter(t=>e.tables.some(([e])=>String(e)===t)):void 0;n.push({id:u,name:e.name,dogs:!!e.dogs,outdoor:!!e.outdoor,...e.label?{label:e.label}:{},...e.colour?{colour:e.colour}:{},...l?{best:l}:{}});const i=`s-${u}`;o.push({id:i,name:e.name,colour:e.colour??I[s%I.length],server:t[s]??''});const m=(e.fixtures??[]).map((e,t)=>({...e,id:`fx-${u}-${t}`,areaId:u}));a.push(...m);const f=m.some(e=>e.y<100&&('bar'===e.kind||e.w>=300))?150:100,p=e.tables.map(([e,t])=>({...j(String(e),u,t,i),id:`t-${e}`})),g=e.layout??{},y=p.filter(e=>g[e.name]).map(e=>{const t=g[e.name],n=t.shape??(t.w===t.h?'square':'rect'),r=h(Math.round(t.w),50,c),a=h(Math.round('rect'===n?t.h:t.w),50,b);return{...e,shape:n,w:r,h:a,x:h(Math.round(t.x),0,c-r),y:h(Math.round(t.y),0,b-a),...t.label?{label:t.label}:{}}}),x=p.filter(e=>!g[e.name]);y.length?r.push(...y,...S(y,x,m)):r.push(...M(p,f,75))});const s=new Set(r.map(e=>e.name)),u=(e.joins??[]).filter(e=>e.every(e=>s.has(e))).map(e=>({id:`j-${e.join('-')}`,tables:e}));return{areas:n,tables:r,joins:u,sections:o,fixtures:a}}const T=(e,t,n=0,r=25)=>({kind:'window',x:e,y:n,w:t,h:r}),A=(e,t,n=100,r=25)=>({kind:'door',x:e,y:t,w:n,h:r});function $(){const e=r.default;return k({areas:e.areas.map(e=>({name:e.name,dogs:!!e.dogFriendly,outdoor:!(!e.outdoor&&!e.weatherDependent),label:e.label,colour:e.colour,tables:e.tables.map(([e,t])=>[e,t]),layout:e.layout,fixtures:[],best:e.best?.map(String)})),joins:e.joins??[]},e.areas.map(e=>e.server??''))}const v=[{id:'anchorage',name:'The Anchorage',sub:'4 areas \xb7 29 tables \xb7 119 seats',make:$},{id:'cafe',name:'Small caf\xe9',sub:'1 room \xb7 8 tables \xb7 dogs welcome',make:()=>k({areas:[{name:'Caf\xe9',dogs:!0,tables:[[1,2],[2,2],[3,4],[4,4],[5,2],[6,4],[7,2],[8,6]],fixtures:[{kind:'bar',x:300,y:25,w:400,h:50},A(450,600)]}]})},{id:'pub',name:'Pub with garden',sub:'Bar, lounge and beer garden',make:()=>k({areas:[{name:'Bar',dogs:!0,tables:[[1,2],[2,4],[3,4],[4,2],[5,4],[6,6]],fixtures:[{kind:'bar',x:250,y:25,w:500,h:75}]},{name:'Lounge',tables:[[7,4],[8,4],[9,2],[10,6],[11,4],[12,2],[13,4],[14,8]],fixtures:[T(150,700)]},{name:'Beer garden',dogs:!0,outdoor:!0,tables:[[20,6],[21,6],[22,4],[23,4],[24,6],[25,6]]}]})},{id:'restaurant',name:'Restaurant and terrace',sub:'Dining room with an outdoor terrace',make:()=>k({areas:[{name:'Dining room',tables:[[1,2],[2,2],[3,4],[4,4],[5,4],[6,6],[7,2],[8,2],[9,4],[10,4],[11,6],[12,8]],fixtures:[T(100,800),A(450,600)]},{name:'Terrace',outdoor:!0,tables:[[20,2],[21,4],[22,4],[23,2]]}]})},{id:'blank',name:'Blank',sub:'One empty room to start from',make:()=>k({areas:[{name:'Main room',tables:[]}]})}];const C=(e,t)=>{const n=t?e.tables.filter(e=>e.areaId===t):e.tables;return{tables:n.length,seats:n.reduce((e,t)=>e+t.maxSeats,0)}},B=(e,t)=>void 0!==t.dogOk?t.dogOk:!!e.areas.find(e=>e.id===t.areaId)?.dogs,L=e=>new Set(e.tables.filter(t=>B(e,t)).map(e=>e.name)),q=(e,t)=>e.areas.find(n=>n.id===e.tables.find(e=>e.name===t)?.areaId);function E(e,t){return e.areas.filter(e=>!t||e.id===t).flatMap(t=>(t.best??[]).filter(n=>e.tables.some(e=>e.name===n&&e.areaId===t.id)))}const _=(e,t)=>E(e).includes(t)},842,[843,844]); __d(function(g,r,i,a,m,e,d){"use strict";function t(t){const n=String(t??'').trim(),l=n.match(/\d+/g);return 1===l?.length?l[0].replace(/^0+(?=\d)/,''):n}Object.defineProperty(e,'__esModule',{value:!0}),e.plainTableNumber=t,Object.defineProperty(e,"tableNumbers",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"tableListNumbers",{enumerable:!0,get:function(){return l}}),e.tableNumbersA11y=function(t){const l=n(t).split('+').filter(Boolean);return l.length?`${1===l.length?'Table':'Tables'} ${l.join(', ')}`:'No table'},e.withTableWord=function(t){const n=t.trim();return!n||/^tables?\b/i.test(n)||/^no table\b/i.test(n)?n:`Table ${n}`};const n=n=>String(n??'').split('+').map(t).filter(Boolean).join('+'),l=(t,l=" + ")=>t.map(n).filter(Boolean).join(l)},843,[]); __d(function(e,a,l,r,t,o,s){t.exports={venue:"The Anchorage",note:"From Gordon 28 Oct 2026; layout from Gordon's floor-plan photo 29 Oct 2026 (positions, sizes, shapes, labels scaled from the photo, one scale for all areas). Photo shows MT12 and no MT8: table 8 replaced by 12. Gordon confirmed 29 Oct: no table 8; MT11 and MT12 both exist, MT11 keeps 2 seats, MT12 = 2 seats. No tables 4 or 8. No joined tables: Gordon confirmed 29 Oct that DT1 and DT2 are not joined.",areas:[{name:"Public Bar",label:"Dog friendly area (Public Bar), Area 1",colour:"#CFA45F",server:"BR",dogFriendly:!0,tables:[[1,4],[2,4],[3,5],[5,2],[6,4]],layout:{1:{label:"DT1",shape:"rect",x:600,y:125,w:205,h:90},2:{label:"DT2",shape:"rect",x:395,y:130,w:100,h:190},3:{label:"DT3",shape:"rect",x:205,y:120,w:110,h:245},5:{label:"DT5",shape:"square",x:500,y:395,w:105,h:105},6:{label:"DT6",shape:"rect",x:195,y:395,w:205,h:110}},best:[1,3]},{name:"Main Restaurant",label:"Main restaurant (no pets)",colour:"#8EC5FF",server:"SV",dogFriendly:!1,tables:[[7,5],[9,7],[10,4],[11,2],[12,2],[13,4],[14,4],[15,4],[16,2]],layout:{7:{label:"MT7",shape:"rect",x:590,y:410,w:225,h:115},9:{label:"MT9",shape:"rect",x:560,y:105,w:260,h:110},10:{label:"MT10",shape:"square",x:430,y:400,w:130,h:130},11:{label:"MT11",shape:"rect",x:545,y:270,w:115,h:90},12:{label:"MT12",shape:"rect",x:400,y:270,w:120,h:95},13:{label:"MT13",shape:"rect",x:400,y:100,w:90,h:115},14:{label:"MT14",shape:"rect",x:185,y:420,w:230,h:100},15:{label:"MT15",shape:"rect",x:190,y:220,w:165,h:145},16:{label:"MT16",shape:"rect",x:185,y:105,w:125,h:80}},best:[7,9]},{name:"Sitooterie",label:"Sitooterie (fully covered conservatory, no pets)",colour:"#C79BE8",server:"DM",dogFriendly:!1,tables:[[17,2],[18,6],[19,4],[20,6],[21,4],[22,4],[23,4]],layout:{17:{label:"ST17",shape:"square",x:760,y:325,w:110,h:110},18:{label:"ST18",shape:"rect",x:605,y:135,w:270,h:115},19:{label:"ST19",shape:"rect",x:460,y:160,w:105,h:150},20:{label:"ST20",shape:"rect",x:135,y:125,w:265,h:120},21:{label:"ST21",shape:"rect",x:120,y:305,w:110,h:175},22:{label:"ST22",shape:"rect",x:255,y:310,w:115,h:175},23:{label:"ST23",shape:"rect",x:410,y:350,w:110,h:155}},best:[19,21]},{name:"Beer Garden",label:"Outdoor beer garden (weather permitting, no shelter, pets allowed)",colour:"#B08D57",server:"GD",dogFriendly:!0,outdoor:!0,weatherDependent:!0,tables:[[24,4],[25,4],[26,4],[27,6],[28,6],[29,4],[30,4],[31,4]],layout:{24:{label:"BGT24",shape:"round",x:740,y:70,w:130,h:130},25:{label:"BGT25",shape:"round",x:515,y:50,w:135,h:135},26:{label:"BGT26",shape:"round",x:310,y:50,w:135,h:135},27:{label:"BGT27",shape:"rect",x:560,y:235,w:280,h:115},28:{label:"BGT28",shape:"rect",x:245,y:235,w:270,h:110},29:{label:"BGT29",shape:"rect",x:210,y:365,w:190,h:60},30:{label:"BGT30",shape:"rect",x:180,y:445,w:190,h:55},31:{label:"BGT31",shape:"rect",x:130,y:520,w:215,h:60}},best:[27,28]}],photoScale:1.8,joins:[],bestNote:"Best tables per area from Gordon, 1 Nov 2026: Bar 1 and 3; Restaurant 7 and 9; Sitooterie 19 and 21; Outside (Beer Garden) 27 and 28. Shown as BEST for walk-ins and bookings when they fit; editable per area in the table plan."}},844,[]); @@ -1059,7 +1059,7 @@ __d(function(g,r,i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule' __d(function(g,r,i,a,_m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.setClockServer=function(t){s=t,c()},e.markClockUnsent=function(t){o.set(t,Date.now()),c()},e.markClockSent=function(t){o.delete(t)&&c()},e.clockNotSent=l,e.useClockNotSent=function(o){const[,c]=(0,t.useState)(0);return(0,t.useEffect)(()=>{const t=()=>c(t=>t+1);u.add(t);const o=n.mutationQueue.subscribe(t);return()=>{u.delete(t),o()}},[]),l(o)};var t=r(d[0]),n=r(d[1]);const o=new Map,u=new Set,c=()=>{for(const t of u)t()};let s=()=>!1;function l(t){if(!t)return!1;return n.mutationQueue.pending.some(n=>'attendance'===n.table&&n.rowKey===t)||o.has(t)&&s()}n.mutationQueue.onDone(t=>{'attendance'===t.table&&o.delete(t.rowKey)&&c()})},976,[17,977]); __d(function(g,_r,i,a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"MutationQueue",{enumerable:!0,get:function(){return l}}),Object.defineProperty(_e,"mutationQueue",{enumerable:!0,get:function(){return o}});var t=_r(d[0]),e=_r(d[1]),s=_r(d[2]);const n='queue:v1',r='queue:failed:v1',h=t=>`${t.table}|${t.venueId}|${t.rowKey}`;class l{items=[];failedItems=[];loaded=null;flushing=null;flushingSince=0;exec=null;listeners=new Set;onFailure=new Set;onSaved=new Set;retryTimer=null;waitTimer=null;backoffMs=2e3;now=()=>Date.now();constructor(){(0,t.onConnectivity)(t=>{t&&this.flush()})}setExecutor(t){this.exec=t}load(){return this.loaded||(this.loaded=(async()=>{const t=await e.kv.get(n,[]);this.items=[...t.map(t=>({...t,nextAt:void 0})),...this.items],this.failedItems=await e.kv.get(r,[]),this.emit()})()),this.loaded}get pending(){return this.items}get waiting(){return this.items.filter(t=>t.attempts>0)}get failed(){return this.failedItems}hasPending(t,e,s){return this.items.some(n=>n.table===t&&n.venueId===e&&n.rowKey===s)}async enqueue(t){await this.load();const s={...t,id:(0,e.uuid)(),createdAt:(new Date).toISOString(),attempts:0};return this.items.push(s),await this.persist(),this.flush(),s}nextReady(){const t=new Set,e=this.now();for(const s of this.items){const n=h(s);if(!t.has(n)){if(!(s.nextAt&&s.nextAt>e))return s;t.add(n)}}}remove(t){this.items=this.items.filter(e=>e!==t)}flush(){if(this.flushing&&Date.now()-this.flushingSince<6e4)return this.flushing;this.flushingSince=Date.now();let e=null;return e=(async()=>{for(await this.load();this.exec;){if(this.flushing&&this.flushing!==e)return;const n=this.nextReady();if(!n)break;if(!(0,t.isOnline)()){this.scheduleRetry();break}try{const t=await this.exec(n);this.remove(n),this.backoffMs=2e3,'conflict'===t?this.fail(n,'conflict','Row changed on the server (version conflict) or is not visible to you'):this.onSaved.forEach(t=>t(n))}catch(e){n.attempts+=1,n.lastError=String(e?.message??e);const r=e??{};n.lastErr={code:r.code?String(r.code):void 0,status:Number(r.status)||void 0,message:n.lastError.slice(0,300)};const h=(0,s.classifyWriteError)(e);if('network'===h){n.attempts-=1,(0,t.setOnline)(!1),this.scheduleRetry(),await this.persist();break}'retry'===h?n.nextAt=this.now()+(0,s.retryDelayMs)(n.attempts):(this.remove(n),this.fail(n,'rejected',n.lastError))}await this.persist()}this.flushing===e&&(this.flushing=null),this.scheduleWaiting()})(),this.flushing=e,e}retryNow(){for(const t of this.items)t.nextAt=void 0;return this.flush()}subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}onFailed(t){return this.onFailure.add(t),()=>{this.onFailure.delete(t)}}onDone(t){return this.onSaved.add(t),()=>{this.onSaved.delete(t)}}async clearFailed(){this.failedItems=[],await e.kv.set(r,[]),this.emit()}fail(t,s,n){const h={...t,lastError:n,failedAt:(new Date).toISOString(),reason:s};this.failedItems=[h,...this.failedItems].slice(0,100),e.kv.set(r,this.failedItems),this.onFailure.forEach(t=>t(h))}scheduleWaiting(){this.waitTimer&&(clearTimeout(this.waitTimer),this.waitTimer=null);const t=this.items.map(t=>t.nextAt??0).filter(t=>t>0);if(!t.length)return;const e=Math.max(500,Math.min(...t)-this.now());this.waitTimer=setTimeout(()=>{this.waitTimer=null,this.flush()},e)}scheduleRetry(){if(this.retryTimer)return;const e=this.backoffMs;this.backoffMs=Math.min(2*this.backoffMs,6e4),this.retryTimer=setTimeout(()=>{this.retryTimer=null,(0,t.setOnline)(!0),this.flush()},e)}async persist(){await e.kv.set(n,this.items),this.emit()}emit(){this.listeners.forEach(t=>t())}}const o=new l},977,[974,936,978]); __d(function(g,r,i,a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.classifyWriteError=function(o){if((0,e.isNetworkError)(o))return'network';const{code:n,status:c,msg:l}=t(o);return s(o)?'refused':/^(08|53|57|58)/.test(n)||['40001','40P01','55P03','23505','23503'].includes(n)||/^PGRST30[0-3]$/.test(n)||/jwt|token.*expired/i.test(l)||401===c||408===c||425===c||429===c||c>=500?'retry':409!==c||n?'refused':'retry'},Object.defineProperty(_e,"retryDelayMs",{enumerable:!0,get:function(){return o}}),_e.describeWrite=function(e){const t='rpc'===e.kind?(e.fn??'change').replace(/_/g,' '):n[e.table]??e.table.replace(/_/g,' ').replace(/s$/,''),s=e.values??{},o=s.guest_name??s.name??s.display_name??s.title??s.reason,c='string'==typeof o&&o.trim()?` for ${o.trim().slice(0,60)}`:'';return'delete'===e.kind?`deleting a ${t}${c}`:`the ${t}${c}`},_e.plainReason=function(e,o){const{code:n,status:c,msg:l}=t(e);if('refused'===o)return s(e)?'more than 20 deletes in 10 minutes from one sign-in are stopped to keep your data safe':'42501'===n||403===c||/row-level security|permission/i.test(l)?'your sign-in isn\u2019t allowed to change this':'conflict'===n?'it was changed or removed on another device first':/^(22|23)/.test(n)?'the shared system says some of the details aren\u2019t valid':'P0001'===n&&l?l.slice(0,140):l?`the shared system said: ${l.slice(0,120)}`:'the shared system refused it';return'23505'===n?'the shared system already has another copy of it':'23503'===n?'a related change has to save first':/^PGRST30/.test(n)||401===c||/jwt/i.test(l)?'your sign-in is being refreshed':'the shared system is busy'};var e=r(d[0]);const t=e=>{const t=e&&'object'==typeof e?e:{};return{msg:String(t.message??e??''),code:String(t.code??''),status:Number(t.status??0)||0,hint:String(t.hint??'')}},s=e=>{const s=t(e);return/delete guard/i.test(s.hint)||/too many .* deleted in 10 minutes/i.test(s.msg)};const o=e=>Math.min(5e3*Math.pow(3,Math.max(0,e-1)),3e5),n={bookings:'booking',walk_ins:'walk-in',blocks:'blocked time',sold_out_items:'sold-out mark',sold_out_links:'dish stock link',staff:'staff details',rota_shifts:'rota shift',stock_items:'stock item',stock_events:'stock count',stock_counts:'stock count',chat_messages:'chat message',recipe_cards:'recipe card',order_lists:'order list',order_list_items:'order list item',daily_task_ticks:'task tick',daily_tasks:'daily task',attendance:'clock in or out',cash_ups:'cash-up',table_plans:'table plan',guest_profiles:'guest profile',floor_live:'table status',venues:'venue settings',time_requests:'clock correction request',staff_leave:'time off',scheduled_notifications:'reminder',suppliers:'supplier',supplier_orders:'supplier order',takeaway_orders:'takeaway order'}},978,[974]); -__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"APP_VERSION",{enumerable:!0,get:function(){return t}});const t='v0.3.12.192'},979,[]); +__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"APP_VERSION",{enumerable:!0,get:function(){return t}});const t='v0.3.12.193'},979,[]); __d(function(g,_r,i,a,_m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"TableRepository",{enumerable:!0,get:function(){return c}}),e.executeMutation=async function(t){const s=(t,s)=>{throw Object.assign(t,{status:s})};if('rpc'===t.kind){const{error:n,status:r}=await u().rpc(t.fn,t.values??{});return n&&s(n,r),'ok'}const n=u().from(t.table);if('upsert'===t.kind||'insert'===t.kind){const{error:r,status:o}=await n.upsert(t.values??{},{onConflict:t.conflictKey??'id',ignoreDuplicates:'insert'===t.kind});if(r&&'stock_events'===t.table&&'23503'===r.code&&/undoes/i.test(String(r.message??''))&&t.values?.undoes){t.values={...t.values,undoes:null};const r=await n.upsert(t.values,{onConflict:t.conflictKey??'id',ignoreDuplicates:'insert'===t.kind});return r.error&&s(r.error,r.status),'ok'}return r&&s(r,o),'ok'}let r='update'===t.kind?n.update(t.values??{}):n.delete();for(const[s,n]of Object.entries(t.match??{}))r=r.eq(s,n);const{data:o,error:c,status:l}=await r.select();c&&s(c,l);return'update'!==t.kind||o&&0!==o.length?'ok':'conflict'};var t=_r(d[0]),s=_r(d[1]),n=_r(d[2]),r=_r(d[3]),o=_r(d[4]);const u=()=>(0,n.getSupabase)();class c{constructor(t,s={}){this.table=t,this.opts=s,this.keyOf=s.keyOf??(t=>String(t.id)),this.keyColumns=s.keyColumns??['id'],this.venueCol=s.venueColumn??'venue_id'}rows(t){return s.cache.rows(this.table,t)}get(t,n){return s.cache.get(this.table,t,n)}subscribe(t,n){return s.cache.subscribe(this.table,t,n)}hydrate(t){return s.cache.hydrate(this.table,t)}async refresh(n,r={}){const c=()=>{let t=u().from(this.table).select('*').eq(this.venueCol,n);return this.opts.orderBy&&(t=t.order(this.opts.orderBy.column,{ascending:this.opts.orderBy.ascending??!0})),r.filter&&(t=r.filter(t)),t},l='bookings'===this.table?await(0,t.readPages)(async(t,s)=>{const{data:n,error:r}=await c().order('id').range(t,s);if(r)throw r;return n??[]}):await(async()=>{const{data:t,error:s}=await c().limit(this.opts.limit??1e3);if(s)throw s;return t??[]})();return s.cache.replace(this.table,n,l.map(t=>[this.keyOf(t),t]),t=>o.mutationQueue.hasPending(this.table,n,t)),l}async create(t,n){const u={...1===this.keyColumns.length&&'id'===this.keyColumns[0]?{id:(0,r.uuid)()}:{},...n,[this.venueCol]:t},c=this.keyOf(u);return s.cache.put(this.table,t,c,u),await o.mutationQueue.enqueue({table:this.table,venueId:t,kind:'insert'===this.opts.writeMode?'insert':'upsert',rowKey:c,values:u,conflictKey:this.opts.conflictKey??'id'}),u}async update(t,n,r,u={}){const c=s.cache.get(this.table,t,n),l={...this.matchFor(n,c),...u,[this.venueCol]:t};s.cache.patch(this.table,t,n,{...r,updated_at:(new Date).toISOString()}),await o.mutationQueue.enqueue({table:this.table,venueId:t,kind:'update',rowKey:n,values:r,match:l})}async remove(t,n){const r=s.cache.get(this.table,t,n),u={...this.matchFor(n,r),[this.venueCol]:t};s.cache.remove(this.table,t,n),await o.mutationQueue.enqueue({table:this.table,venueId:t,kind:'delete',rowKey:n,match:u})}matchFor(t,s){if(1===this.keyColumns.length&&'id'===this.keyColumns[0])return{id:t};const n={};for(const t of this.keyColumns)n[t]=s?.[t];return n}}},980,[981,982,892,936,977]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.readPages=async function(t,n=1e3){const s=[];for(let c=0;;c+=n){const o=await t(c,c+n-1);if(s.push(...o),o.length`cache:${t}:${n}`;function f(t){let s=n.get(t);return s||(s=new Map,n.set(t,s)),s}function p(n){s.delete(n),c.get(n)?.forEach(t=>t());const u=o.get(n);u&&clearTimeout(u),o.set(n,setTimeout(()=>{o.delete(n),t.kv.set(n,Array.from(f(n).entries()))},250))}const w={async hydrate(n,s){const c=l(n,s);if(u.has(c))return;u.add(c);const o=await t.kv.get(c,[]),w=f(c);let h=0;for(const[t,n]of o)w.has(t)||(w.set(t,n),h++);h&&p(c)},rows(t,n){const c=l(t,n);let o=s.get(c);return o||(o=Array.from(f(c).values()),s.set(c,o)),o},get:(t,n,s)=>f(l(t,n)).get(s),put(t,n,s,c){f(l(t,n)).set(s,c),p(l(t,n))},patch(t,n,s,c){const o=f(l(t,n)),u=o.get(s);u&&(o.set(s,{...u,...c}),p(l(t,n)))},remove(t,n,s){f(l(t,n)).delete(s)&&p(l(t,n))},replace(t,s,c,o=()=>!1){const u=l(t,s),w=f(u),h=new Map(c);w.forEach((t,n)=>{o(n)&&h.set(n,t)}),n.set(u,h),p(u)},subscribe(t,n,s){const o=l(t,n);let u=c.get(o);return u||(u=new Set,c.set(o,u)),u.add(s),()=>{u?.delete(s)}},async clearVenue(o,f){for(const p of f){const f=l(p,o);n.delete(f),s.delete(f),u.delete(f),await t.kv.remove(f),c.get(f)?.forEach(t=>t())}}}},982,[936]); @@ -1174,7 +1174,7 @@ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{v __d(function(g,_r,i,a,_m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.guardBookingChange=w,_e.saveTablesReported=async function(e,t,n,o,s,u){if(!w(u,{b:t,tables:n}))return!1;const v=n.length?(0,h.notSavedWhat)({...t,name:o,table:n.join('+')}):`Taking the table off ${o}`;u(`Saving ${v}\u2026`);try{await(0,b.saveBookingTables)(e,t,n)}catch(e){const t=`${v} did not save: ${String(e?.message??e).slice(0,120)}`;return u(t),(0,l.announce)(t),!1}const y=await(0,c.waitForBookingSave)(t.id);if('saved'===y.state||'local'===y.state){const e=(0,r.savedWords)(o,t.partySize,n,s);return u(e),(0,l.announce)(e),!0}const k='waiting'===y.state?`${v}: not saved yet. It saves by itself when the connection is back; a red banner shows if it fails.`:`${v} did not save. ${f("why"in y?y.why:"the shared system did not take it")}. Tap the red banner to try again.`;return u(k),(0,l.announce)(k),!1},_e.reportBookingSave=async function(e,t,n,o){const s=await(0,c.waitForBookingSave)(e);if('saved'===s.state||'local'===s.state)return o(t),(0,l.announce)(t),!0;const r='waiting'===s.state?`${n}: not saved yet. It saves by itself when the connection is back; a red banner shows if it fails.`:`${n} did not save. ${f('why'in s?s.why:'the shared system did not take it')}. Tap the red banner to try again.`;return o(r),(0,l.announce)(r),!1},_e.BookingSaveBanner=function({rid:e,testID:r="booking-save-banner",margin:c}){const b=(0,h.useBookingSaves)(e=>e.notSaved),w=(0,s.useBookings)(e).filter(e=>b[e.id]).map(e=>void 0!==b[e.id].want?{...e,table:b[e.id].want||void 0}:e),{msg:S,retry:$}=k(),m=(0,t.useRef)(''),p=w.map(e=>(0,h.notSavedLine)(e)),B=w.map(e=>e.id).sort().join(',');if((0,t.useEffect)(()=>{B&&B!==m.current&&(0,l.announce)(1===w.length?p[0]:`${w.length} booking changes did not save. Tap the red banner to try again.`),m.current=B},[B]),!w.length)return null;const j=1===w.length?p[0]:`${w.length} booking changes did not save. Tap to try again.`;return(0,y.jsx)(n.default,{testID:r,accessibilityRole:"button",accessibilityLiveRegion:"assertive",accessibilityLabel:`${j}${w.length>1?` ${w.map(e=>(0,h.notSavedWhat)(e)).join('. ')}.`:''} ${f(b[w[0].id].why)}.`,onPress:$,style:{...c??{},alignSelf:'stretch',gap:4,padding:12,borderRadius:12,borderWidth:2,borderColor:u.colours.red,backgroundColor:'#3a1210',alignItems:'center'},children:(0,y.jsxs)(o.default,{accessibilityRole:"alert",style:{alignItems:'center',gap:4},children:[(0,y.jsx)(v.T,{testID:`${r}-title`,size:17,weight:"semibold",center:!0,colour:"#FFD2CC",children:j}),w.length>1?w.slice(0,6).map(e=>(0,y.jsx)(v.T,{testID:`${r}-line`,size:15,center:!0,colour:"#FFD2CC",children:(0,h.notSavedWhat)(e)},e.id)):null,(0,y.jsx)(v.T,{testID:`${r}-why`,size:14,center:!0,colour:"#FFB3AA",children:w.length>1?`${f(b[w[0].id].why)}${w.length>6?` \xb7 and ${w.length-6} more`:''}`:f(b[w[0].id].why)}),S?(0,y.jsx)(v.T,{testID:`${r}-msg`,size:14,center:!0,colour:u.colours.goldLight,children:S}):null]})})},_e.BookingNotSavedLine=function({b:e}){const t=(0,h.useBookingSaves)(t=>t.notSaved[e.id]),{msg:o,retry:s}=k();if(!t)return null;void 0!==t.want&&(e={...e,table:t.want||void 0});return(0,y.jsxs)(n.default,{testID:`booking-not-saved-${e.id}`,accessibilityRole:"button",accessibilityLiveRegion:"assertive",accessibilityLabel:`${(0,h.notSavedLine)(e)} ${f(t.why)}.`,onPress:s,style:{alignSelf:'stretch',padding:8,borderRadius:10,borderWidth:1.5,borderColor:u.colours.red,backgroundColor:'#3a1210',alignItems:'center'},children:[(0,y.jsx)(v.T,{size:15,weight:"semibold",center:!0,colour:"#FFD2CC",children:(0,h.notSavedLine)(e)}),o?(0,y.jsx)(v.T,{size:13,center:!0,colour:u.colours.goldLight,children:o}):null]})};var t=_r(d[0]),n=e(_r(d[1])),o=e(_r(d[2])),s=_r(d[3]),r=_r(d[4]),l=_r(d[5]),c=_r(d[6]),h=_r(d[7]),u=_r(d[8]),b=_r(d[9]),v=_r(d[10]),y=_r(d[11]);const f=e=>e.charAt(0).toUpperCase()+e.slice(1);function w(e,t){const n=(0,c.bookingSaveBlocker)();if(!n)return!0;t&&h.useBookingSaves.getState().mark({id:t.b.id,table:t.b.walkIn?'walk_ins':'bookings',why:n,...t.tables?{want:t.tables.join('+')}:{}});const o=`${t?(0,h.notSavedWhat)({...t.b,...t.tables?{table:t.tables.join('+')||void 0}:{}}):'This change'} did not save: ${n}.`;return e?.(o),(0,l.announce)(o),!1}function k(){const[e,n]=(0,t.useState)('');return{msg:e,retry:async()=>{n('Saving\u2026'),(0,l.announce)('Saving');const e=await(0,c.saveBookingsNow)(!0),t=e?`Not saved: ${e}.`:h.useBookingSaves.getState().count()?'Sent again. The banner clears when the shared system takes it.':'Nothing is left waiting. Check the plan and make the change again if it is not there.';n(t),(0,l.announce)(t)}}}},1091,[17,385,85,858,1092,1093,946,984,804,1089,777,8]); __d(function(_g,r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"byNum",{enumerable:!0,get:function(){return s}}),e.tableKey=o,e.toggleTable=function(t,n){return t.includes(n)?t.filter(t=>t!==n):a(o([...t,n]))},e.seatsOf=function(t,n){const a={};for(const s of n)a[s]=t.tables.find(t=>t.name===s)?.maxSeats??0;return{per:a,total:Object.values(a).reduce((t,n)=>t+n,0)}},e.seatLine=function(t,n){const a=Math.max(0,n-t);return{text:`${t} ${1===t?'seat':'seats'} for ${l(n)}${a?`: ${a} short`:''}`,short:a,fits:0===a&&t>0}},e.pickClashes=u,e.requestedFreeTable=function(t,n,a,s,l=90){const o={id:n.id??'new',status:'confirmed',...n};for(const n of t)if(a.includes(n)&&!u(o,[n],s,l).length)return n;return null},e.overCapacityAsk=function(n,s,l){const u=a(o(n));if(!u.length||s>=l)return null;const c=u.map(n=>(0,t.tableNumbers)(n));return`${1===c.length?`Table ${c[0]} seats`:`Tables ${c.slice(0,-1).join(', ')} and ${c[c.length-1]} seat`} ${s} \u2013 this booking is ${l}. Use it anyway?`},e.clashWords=function(n){return n.map(n=>`${(0,t.tableNumbers)(n.table)} has ${n.with.walkIn?'a walk-in':(n.with.name||'a booking').replace(' (example)','')} at ${n.with.time}`).join('. ')+(n.length?'.':'')},e.tablesWords=c,e.pickA11y=function(n,a,s,l){return`Table ${(0,t.tableNumbers)(n)}, ${a} ${1===a?'seat':'seats'}${s?', selected':''}${l?`, has ${l.walkIn?'a walk-in':l.name} at ${l.time}`:''}`},e.pickGroups=function(t){return t.areas.map(n=>({area:n.name,tables:t.tables.filter(t=>t.areaId===n.id).map(t=>({name:t.name,seats:t.maxSeats})).sort((t,n)=>s(t.name,n.name))})).filter(t=>t.tables.length)},e.savedWords=function(t,n,a,s){return a.length?`${t}, ${l(n)}: ${c(a)} (${s} seats).`:`${t}: table taken off.`},e.tableActions=function(t,n){const s=a(t.table);if(['cancelled','noshow'].includes(t.status))return[];const o=[s.length?{id:'assign',label:'Change table',a11y:`Change table for ${n}, ${l(t.partySize)}, now ${c(s).toLowerCase()}. You can pick several tables to join.`}:{id:'assign',label:'Assign table',a11y:`Assign table for ${n}, ${l(t.partySize)}. You can pick several tables to join.`}];s.length&&o.push({id:'clear',label:'Clear table',a11y:`Clear table for ${n}, take ${c(s).toLowerCase()} off this booking`});return o},e.dragTables=function(t,n,s){if(!s||'__none'===s||s===n)return null;const l=a(t);if(l.includes(s))return null;return o('__none'!==n&&l.includes(n)?l.map(t=>t===n?s:t):[s])};var t=r(d[0]),n=r(d[1]);const a=t=>t?t.split('+').map(t=>t.trim()).filter(Boolean):[],s=(t,n)=>t.localeCompare(n,'en-GB',{numeric:!0}),l=t=>`${t} ${1===t?'person':'people'}`;function o(t){return[...new Set(t.map(t=>String(t).trim()).filter(Boolean))].sort(s).join('+')}function u(t,l,u,c=90){if(!l.length)return[];const f={...t,table:o(l)},b=[];for(const s of u)if(s.id!==t.id&&s.date===t.date&&!['cancelled','noshow','finished'].includes(s.status)&&(0,n.startOf)(f)<(0,n.endOf)(s,c)&&(0,n.startOf)(s)<(0,n.endOf)(f,c))for(const t of a(s.table))l.includes(t)&&b.push({table:t,with:s});return b.sort((t,n)=>s(t.table,n.table))}function c(n){const s=a(o(n));return s.length?(0,t.tableListNumbers)(s):'No table'}},1092,[843,1074]); __d(function(g,r,i,a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.primeAnnouncer=function(){u()},_e.announce=function(t){const e=String(t??'').trim();if(!e)return;{const t=u();if(!t)return;const n=++o;return t.textContent='',void setTimeout(()=>{n===o&&(t.textContent=e)},80)}},Object.defineProperty(_e,"lastAnnounced",{enumerable:!0,get:function(){return c}});var t,e=r(d[0]);(t=e)&&t.__esModule;r(d[1]);let n=null,o=0;function u(){if('undefined'==typeof document||!document.body)return null;if(n&&document.body.contains(n))return n;const t=document.createElement('div');return t.id='cc-announcer',t.setAttribute('aria-live','assertive'),t.setAttribute('aria-atomic','true'),t.setAttribute('role','status'),t.setAttribute('data-testid','cc-announcer'),Object.assign(t.style,{position:'absolute',width:'1px',height:'1px',margin:'-1px',padding:'0',overflow:'hidden',clip:'rect(0 0 0 0)',whiteSpace:'nowrap',border:'0'}),document.body.appendChild(t),n=t,t}const c=()=>n?.textContent??''},1093,[264,219]); -__d(function(g,_r,_i,_a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"TABLES",{enumerable:!0,get:function(){return A}}),_e.useTableNames=R,_e.resetTableLive=W,_e.seatBookingNow=async function(e,t){await k.repo.bookings.setStatus(t.id,'seated'),W(e,t.table)},_e.finishBookingNow=async function(e,t){const s=(new Date).toISOString();await k.repo.bookings.update(t.id,(0,N.finishClearPatch)(s,t.table)),(0,v.tablesOf)(t.table).forEach(t=>v.useFloor.getState().setLive(e,t,{stage:void 0,dirty:!0}))},_e.useTableUse=E,Object.defineProperty(_e,"walkInLabel",{enumerable:!0,get:function(){return _}}),_e.TablePicker=H,_e.WalkInSheet=q,_e.AssignTableSheet=V,_e.undoNotice=Y,_e.NewBookingSheet=G,_e.useFrontDoor=function(e,t){const[s,o]=(0,c.useState)(!1),[l,a]=(0,c.useState)(!1),[i,n]=(0,c.useState)(null);return{openWalkIn:()=>o({}),openWalkInAt:e=>o({table:e}),openBooking:()=>a(!0),assignTable:e=>n({b:e}),combineTables:e=>n({b:e,combine:!0}),elements:(0,F.jsxs)(F.Fragment,{children:[s?(0,F.jsx)(q,{wide:t,initialTable:s.table,onClose:()=>o(!1),onSeated:Y}):null,l?(0,F.jsx)(G,{wide:t,date:e,onClose:()=>a(!1),onSaved:e=>(0,u.notify)({id:`booked:${Date.now()}`,testID:'booking-saved-toast',timeoutMs:5e3,icon:'\u2713',title:`Booked: ${e.name} \xb7 ${(0,w.niceDate)((0,w.parseYmd)(e.date))} at ${e.time}`})}):null,i?(0,F.jsx)(V,{booking:i.b,combine:i.combine,onClose:()=>n(null)}):null]})}};var t=_r(_d[0]),s=_r(_d[1]),o=_r(_d[2]),l=_r(_d[3]),a=_r(_d[4]),i=_r(_d[5]),n=_r(_d[6]),r=_r(_d[7]),d=_r(_d[8]),u=_r(_d[9]),c=_r(_d[10]),b=e(c),h=_r(_d[11]),p=e(_r(_d[12])),m=e(_r(_d[13])),f=_r(_d[14]),y=_r(_d[15]),k=_r(_d[16]),x=_r(_d[17]),j=_r(_d[18]),w=_r(_d[19]),S=_r(_d[20]),T=_r(_d[21]),C=_r(_d[22]),v=_r(_d[23]),D=_r(_d[24]),I=_r(_d[25]),$=_r(_d[26]),P=_r(_d[27]),O=_r(_d[28]),B=_r(_d[29]),z=_r(_d[30]),M=_r(_d[31]),N=_r(_d[32]),F=_r(_d[33]);const L=e=>(0,u.notify)({id:'booking-blocked',testID:'booking-blocked-toast',timeoutMs:9e3,icon:'\u26a0',title:e}),A=Array.from({length:12},(e,t)=>String(t+1));function R(e){const t=(0,v.usePlan)(e);return t.areas.flatMap(e=>t.tables.filter(t=>t.areaId===e.id).map(e=>e.name))}function W(e,t){(0,v.tablesOf)(t).forEach(t=>v.useFloor.getState().setLive(e,t,{stage:'seated',dirty:!1}))}function E(e,t){const s=(0,k.useBookings)(e),o=(0,k.useOrders)(e),l=R(e),a=(0,v.useFloor)(t=>t.live[e])??{},i=(0,v.usePlan)(e),n=(0,D.useBlocks)(e=>e.blocks),r=(0,w.ymd)(t),d=(0,D.closedAreasAt)(n,e,r,(0,w.hm)(t)),u={};for(const e of l)u[e]=a[e]?.blocked||d.has(`tbl:${e}`)?{busy:!0,label:'Blocked'}:d.has(i.tables.find(t=>t.name===e)?.areaId??'')?{busy:!0,label:'Closed'}:a[e]?.dirty?{busy:!0,label:'Needs clearing'}:{busy:!1,label:'Free'};for(const e of s)if(e.date===r&&e.table)for(const s of(0,v.tablesOf)(e.table))if(u[s])if('seated'===e.status)u[s]={busy:!0,label:`${e.walkIn?'Walk-in':`${e.name.slice(0,1)}.`} \xb7 ${e.partySize}`};else if('confirmed'===e.status&&!u[s].busy){const o=(0,w.minsBetween)(t,new Date(`${e.date}T${e.time}:00`));o>=-15&&o<=90&&(u[s]={...u[s],soon:`Booked ${e.time}`})}for(const e of o)'table'===e.type&&e.tableNo&&u[e.tableNo]&&!['closed','cancelled','collected'].includes(e.status)&&!u[e.tableNo].busy&&(u[e.tableNo]={busy:!0,label:'Open order'});return u}const _=e=>e.walkIn?`Walk-in \xb7 ${e.partySize}`:`${e.name} \xb7 ${e.partySize}`;function H({use:e,value:t,onPick:s,big:o,best:a,dense:i,bestSet:n,picked:r}){const d=Object.keys(e),[u,b]=(0,c.useState)(0),h=i?6:8,f=i?64:o?92:76,y=u?Math.max(3,Math.floor((u+h)/(f+h))):0,k=y?Math.floor((u-h*(y-1))/y):f,x=new Set(n??[]),j=a?(0,v.tablesOf)(a)[0]:null;return(0,F.jsx)(m.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:h},testID:"table-picker",onLayout:e=>b(Math.floor(e.nativeEvent.layout.width)),children:d.map(o=>{const a=e[o],n=t===o||!!r?.includes(o),d=x.has(o),u=j===o&&!n,c=a.busy?['Blocked','Needs clearing','Closed'].includes(a.label)?a.label:'In use':a.soon??'Free';return(0,F.jsxs)(p.default,{accessibilityRole:"button",testID:`pick-table-${o}`,accessibilityLabel:`Table ${(0,l.tableNumbers)(o)}${r?n?', picked':', not picked':''}, ${a.busy?`in use (${a.label})`:a.soon?`free, ${a.soon}`:'free'}${d?', best table':''}${u?', suggested for this party':''}`,accessibilityState:{selected:n,disabled:'Closed'===a.label},disabled:'Closed'===a.label,onPress:()=>s(o),style:{width:k,minHeight:i?58:64,borderRadius:12,borderWidth:n||u?2.5:1.5,paddingVertical:i?3:6,paddingHorizontal:4,alignItems:'center',justifyContent:'center',gap:2,borderColor:n||u?S.colours.gold:a.busy?S.colours.red:S.colours.ok,backgroundColor:n?S.colours.goldTint:a.busy?S.colours.redBg:S.colours.surface2,opacity:'Closed'!==a.label||n?1:.55},children:[(0,F.jsxs)(m.default,{style:{flexDirection:'row',alignItems:'center',gap:4},children:[(0,F.jsx)(C.T,{weight:"bold",size:22,colour:n?S.colours.goldLight:S.colours.text,children:(0,l.tableNumbers)(o)}),d?(0,F.jsx)(m.default,{testID:"best-table",style:{backgroundColor:S.colours.gold,borderRadius:5,paddingHorizontal:4,paddingVertical:1},children:(0,F.jsx)(C.T,{size:11,weight:"bold",colour:S.colours.onGold,children:"BEST"})}):null]}),(0,F.jsx)(C.T,{size:i?13:14,colour:a.busy?'#FFD9D4':a.soon?'#FFE2A8':'#E2C489',center:!0,numberOfLines:1,children:c})]},o)})})}const U=[1,2,3,4,5,6,7,8];function q({onClose:e,onSeated:a,wide:i,initialTable:n}){const{rid:r,r:d,now:u}=(0,y.useCtx)(15e3),x=E(r,u),[T,I]=(0,c.useState)(2),[$,P]=(0,c.useState)(!1),[O,B]=(0,c.useState)(n??null),z=(0,v.usePlan)(r),N=(0,k.useBookings)(r),A=(0,D.useBlocks)(e=>e.blocks),R=(0,D.closedAreasAt)(A,r,(0,w.ymd)(u),(0,w.hm)(u)),_=b.default.useMemo(()=>{const e=Object.fromEntries(Object.entries(x).map(([e,t])=>[e,{status:t.busy?'seated':'free'}]));return(0,j.suggestTable)(z,N.filter(e=>e.date===(0,w.ymd)(u)),e,T,u,(0,j.turnFor)(T,d.settings.turnMins),90,void 0,{closed:R})?.table??null},[z,N,x,T,R.size,u.getTime()]);(0,c.useEffect)(()=>{O&&(0,v.tablesOf)(O).some(e=>'Closed'===x[e]?.label)&&B(null)},[O,R.size]);const[q,V]=(0,c.useState)(!1),[Y,G]=(0,c.useState)(''),K=(e,t=String(e),s=()=>{P(!1),I(e)})=>{const o='9+'===t?$:!$&&T===e;return(0,F.jsx)(p.default,{accessibilityRole:"button",accessibilityLabel:'9+'===t?'Party of 9 or more':`Party of ${e}`,accessibilityState:{selected:o},onPress:s,style:{width:i?58:60,height:i?58:56,borderRadius:14,borderWidth:2,borderColor:S.colours.gold,alignItems:'center',justifyContent:'center',backgroundColor:o?S.colours.gold:'transparent'},children:(0,F.jsx)(C.T,{weight:"bold",size:22,colour:o?S.colours.onGold:S.colours.gold,children:t})},t)},Q=(0,F.jsx)(s.PartySizeInput,{value:T,onChange:I,min:9,max:o.MAX_PARTY,label:"Walk-in party size",testID:"walkin-party-size"}),X=(0,F.jsxs)(m.default,{style:{gap:8,width:i?256:void 0},children:[(0,F.jsx)(C.T,{weight:"semibold",children:"How many people?"}),(0,F.jsxs)(m.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:8},testID:"walkin-party",children:[U.map(e=>K(e)),K(9,'9+',()=>{P(!0),I(e=>e>=9?e:9)})]}),$?Q:null]}),[J,Z]=(0,c.useState)(!1),ee=async(t=O)=>{if(!J&&(0,M.guardBookingChange)(L)){Z(!0);try{const s=await k.repo.bookings.seatWalkIn(r,T,t??void 0,Y);W(r,t??void 0),a(s),e()}finally{Z(!1)}}},te=(0,F.jsxs)(m.default,{style:{gap:8,flex:i?1:void 0,minWidth:0},children:[(0,F.jsxs)(C.Row,{style:{justifyContent:'space-between'},children:[(0,F.jsxs)(C.T,{weight:"semibold",children:["Table ",(0,F.jsx)(C.T,{colour:S.colours.muted,size:14,children:"(optional)"})]}),O?(0,F.jsx)(C.Button,{small:!0,kind:"ghost",label:"Clear table",onPress:()=>B(null)}):null]}),(0,F.jsx)(H,{use:x,value:O,onPick:e=>{x[e]&&!x[e].busy?ee(e):B(O===e?null:e)},big:i,dense:i,best:_,bestSet:(0,h.bestTables)(z)}),(0,F.jsxs)(C.Muted,{children:["Tap a free table to seat them there",_&&!O?` (suggested for ${T}: ${(0,l.tableNumbers)(_)})`:'',", or Seat for no table yet. BEST marks the venue\u2019s best tables."]})]});return(0,F.jsxs)(C.Sheet,{visible:!0,onClose:e,title:`Walk-in \xb7 ${(0,w.hm)(u)}`,maxWidth:i?1100:void 0,testID:"walkin-sheet",children:[(0,F.jsx)(C.Button,{label:`Seat walk-in \xb7 ${T} ${1===T?'person':'people'}${O?` \xb7 ${(0,l.tableNumbers)(O)}`:''}`,disabled:J,onPress:()=>{ee()},testID:"seat-walkin",style:{minHeight:52}}),i?(0,F.jsxs)(C.Row,{gap:16,style:{alignItems:'flex-start'},children:[X,te]}):(0,F.jsxs)(F.Fragment,{children:[X,te]}),(0,F.jsxs)(C.Row,{gap:10,wrap:!0,style:{alignItems:'center'},children:[q?(0,F.jsx)(t.TextInput,{accessibilityLabel:"Walk-in note",placeholder:"Note (optional), e.g. high chair",placeholderTextColor:"#7D776C",value:Y,onChangeText:G,style:[C.styles.input,{flex:1,minWidth:220}],autoFocus:!0}):(0,F.jsx)(C.Button,{small:!0,kind:"ghost",label:"Add a note (optional)",onPress:()=>V(!0)}),(0,F.jsx)(m.default,{style:{flex:1,minWidth:220},children:(0,F.jsxs)(C.Muted,{children:["No name needed. Counts in today's covers.",'staff'!==f.APP_VARIANT?' Using website bookings too? Mark the table there as well.':'']})})]})]})}function V({booking:e,onClose:t,combine:s}){const{rid:o,r:a,now:i}=(0,y.useCtx)(15e3),n=E(o,i),r=(0,v.usePlan)(o),d=(0,k.useBookings)(o),u=(0,v.tablesOf)(e.table),p=b.default.useMemo(()=>Object.fromEntries(Object.entries(n).map(([e,t])=>[e,u.includes(e)?{busy:!1,label:'This party',soon:'This party'}:t])),[n,e.table]),f=b.default.useMemo(()=>{const t=Object.fromEntries(Object.entries(p).map(([e,t])=>[e,{status:t.busy?'seated':'free'}]));return(0,j.suggestTable)(r,d.filter(e=>e.date===(0,w.ymd)(i)),t,e.partySize,i,(0,j.turnFor)(e.partySize,a.settings.turnMins),90,e.id)?.table??null},[r,d,p,e.partySize,i.getTime()]),[x,T]=(0,c.useState)(!!s||u.length>1),[D,I]=(0,c.useState)(u),$=e=>r.tables.find(t=>t.name===e)?.maxSeats??0,P=D.reduce((e,t)=>e+$(t),0),O=D.length>0&&P{if(!(0,M.guardBookingChange)(L))return;const l=(0,v.joinTables)(s);await k.repo.bookings.assignTable(e.id,l);u.filter(e=>!s.includes(e)).forEach(t=>v.useFloor.getState().setLive(o,t,{stage:void 0,dirty:'seated'===e.status})),'seated'===e.status&&W(o,l),t()},z=x?(0,F.jsxs)(m.default,{style:{gap:8},testID:"assign-table-tip",children:[(0,F.jsx)(m.default,{accessibilityLiveRegion:"polite",children:(0,F.jsx)(C.T,{size:17,weight:"semibold",colour:S.colours.text,children:D.length?`${(0,v.tablesLabel)((0,v.joinTables)(D))} \xb7 ${P} seats for ${e.partySize} Covers`:'No tables picked yet'})}),O?(0,F.jsx)(m.default,{testID:"combine-short",children:(0,F.jsxs)(C.T,{size:15,weight:"semibold",colour:"#FFD9D4",children:["Not enough seats yet: ",e.partySize-P," more needed. Add another table."]})}):null,(0,F.jsx)(C.T,{size:15,colour:S.colours.text,children:"Tap each table to add or remove it, then tap Done. All of them show as taken until the party has finished."}),(0,F.jsxs)(C.Row,{gap:8,wrap:!0,children:[(0,F.jsx)(C.Button,{label:"Done",testID:"combine-done",disabled:!D.length,accessibilityLabel:D.length?`Done, save ${(0,v.tableCardLabel)((0,v.joinTables)(D))}`:'Done',onPress:()=>B(D)}),(0,F.jsx)(C.Button,{kind:"ghost",label:"Cancel",onPress:t})]})]}):(0,F.jsx)(m.default,{style:{gap:8},testID:"assign-table-tip",children:(0,F.jsx)(C.T,{size:15,colour:S.colours.text,children:"Red tables are in use right now; you can still pick one (e.g. joining a table). BEST marks the venue\u2019s best tables. Big party? Tap Combine tables."})});return(0,F.jsxs)(C.Sheet,{visible:!0,onClose:t,title:`${x?'Combine tables':'Assign table'} \xb7 ${_(e)}`,testID:"assign-table-sheet",footer:z,children:[f&&!x?(0,F.jsx)(m.default,{testID:"assign-suggested",children:(0,F.jsxs)(C.T,{size:16,weight:"semibold",colour:S.colours.goldLight,accessibilityLabel:`Suggested for ${e.partySize}: ${(0,v.tableCardLabel)(f)}`,children:["Suggested for ",e.partySize,": ",(0,l.tableNumbers)(f)]})}):null,x?null:(0,F.jsx)(C.Button,{kind:"secondary",label:"Combine tables",testID:"combine-start",accessibilityLabel:"Combine tables: pick several tables for this party",onPress:()=>T(!0)}),(0,F.jsx)(H,{use:p,best:x?null:f,bestSet:(0,h.bestTables)(r),picked:x?D:void 0,onPick:x?e=>I(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]):async e=>{await B([e])}})]})}function Y(e){(0,u.notify)({id:`walkin:${e.id}`,testID:'walkin-toast',timeoutMs:6e3,title:`${_(e)} seated \xb7 ${e.table?`${(0,l.tableNumbers)(e.table)}`:'table to assign'} (${e.ref})`,actions:[{label:'Undo',testID:'undo-walkin',onPress:()=>k.repo.bookings.undoWalkIn(e.id)},{label:'OK',kind:'ghost'}]})}function G({date:e,onClose:t,wide:s,onSaved:u}){const{rid:b,r:h,now:p,role:f,meId:N}=(0,y.useCtx)(6e4);(0,d.useBlurOutside)();const A=(0,w.ymd)(p),[R,W]=(0,c.useState)(ee.blocks),[H,U]=(0,c.useState)(!1),[q,V]=(0,c.useState)(''),[Y,G]=(0,c.useState)(2),[K,Q]=(0,c.useState)(0),X=Math.min(K,Math.max(0,Y-1)),[J,Z]=(0,c.useState)(null),[ee,te]=(0,c.useState)(''),[se,oe]=(0,c.useState)(''),[le,ae]=(0,c.useState)(''),[ie,ne]=(0,c.useState)('phone'),[re,de]=(0,c.useState)((0,$.emptyNeeds)()),ue=(0,$.needsMissing)(re),[ce,be]=(0,c.useState)(null),ge=(0,v.usePlan)(b),he=(0,B.dogSetUp)(ge),pe=!0===re.dog&&he,me=re.dog?re.dogs:0,fe=(0,w.parseYmd)(R),ye=(0,j.turnFor)(Y,h.settings.turnMins),ke=E.filter(e=>e.date===R),xe=e=>(0,j.freeTablesAt)(ge,ke,Y,new Date(`${R}${(0,l.tableNumbers)(e)}:00`),ye,h.settings.turnMins,{dog:!0,closed:(0,D.closedAreasAt)(_,b,R,e)}),je=pe&&J?xe(J):[];(0,c.useEffect)(()=>{be(null)},[pe,J,Y]);const we=(0,x.bookingSlots)(h,fe,e=>E.filter(t=>t.date===R&&t.time===e&&'cancelled'!==t.status&&!t.walkIn).reduce((e,t)=>e+t.partySize,0),Y,R===(0,w.ymd)(p)?p:(0,w.addMins)(fe,0),e=>E.filter(t=>t.date===R&&t.time===e&&'cancelled'!==t.status&&!t.walkIn).length),Se=(0,T.guestPhone)(se),[Te,Ce]=(0,c.useState)(!1),ve=J?we.find(e=>e.time===J):void 0,De=ve&&ve.left=2&&!!J&&(!$e||Te)&&(0,o.validParty)(Y)&&Se.ok&&(0,T.emailOk)(le)&&(!Pe||Oe&&H)&&(!pe||je.length>0)&&!Be,Me=re.wheelchair>0||re.stepFree;return(0,F.jsxs)(C.Sheet,{visible:!0,onClose:t,title:`New booking \xb7 ${(0,w.niceDate)(fe)}`,maxWidth:s?760:void 0,testID:"booking-sheet",children:[(0,F.jsx)($.FirstQuestions,{rid:b,value:re,onChange:de,party:Y,audience:"staff"}),re.dog&&!he?(0,F.jsx)(C.T,{size:13,colour:S.colours.amber,children:"Dog-friendly tables aren\u2019t marked yet. Managers \u203a Booking options \u203a Tables. Booking is allowed; check where the dog can sit."}):null,(0,F.jsx)(I.BookingDatePicker,{r:h,today:p,value:R,onChange:e=>{e!==R&&(W(e),Z(null),U(!1))}}),(0,F.jsxs)(C.Row,{gap:6,children:[(0,F.jsx)(C.Chip,{label:"Phone",selected:'phone'===ie,onPress:()=>ne('phone')}),(0,F.jsx)(C.Chip,{label:"In person",selected:'in-person'===ie,onPress:()=>ne('in-person')})]}),(0,F.jsx)(C.Field,{label:"Name",value:q,onChangeText:V,placeholder:"e.g. Reid",testID:"nb-name"}),(0,F.jsx)(C.Field,{label:"Mobile or phone number (needed)",value:se,onChangeText:oe,keyboardType:"phone-pad",placeholder:"e.g. 07700 900123",testID:"nb-phone"}),!Se.ok&&se?(0,F.jsx)(C.T,{size:13,colour:S.colours.amber,children:Se.error}):null,(0,F.jsx)(C.Field,{label:"Email (optional)",value:le,onChangeText:ae,keyboardType:"email-address",autoCapitalize:"none",placeholder:"For an email confirmation too",testID:"nb-email"}),(0,T.emailOk)(le)?null:(0,F.jsx)(C.T,{size:13,colour:S.colours.amber,children:"That email doesn\u2019t look quite right."}),(0,F.jsx)(n.AdultsChildren,{value:(0,r.peopleOf)(Y,X),onChange:e=>{G(e.partySize),Q(e.children),Ce(!1)},depositsOn:(0,i.depositOf)(h.settings).on&&(0,i.depositOf)(h.settings).perPersonPence>0,testID:"nb-people"}),(0,F.jsx)(C.Row,{wrap:!0,gap:6,children:we.map(e=>{const t=pe&&e.available&&!xe(e.time).length||!(0,$.dogTimeOk)(h,E,R,e.time,me);return(0,F.jsx)(C.Chip,{testID:`nb-slot-${e.time}`,label:e.time,sub:(0,D.blockAt)(_,b,R,e.time)?'Paused':t?'Dogs full':e.drinksOnly?'Drinks only':null!=e.partiesLeft&&e.partiesLeft<1||e.left<=0?'Full':`${e.left} left`,disabled:(e.past??!e.available)||t,selected:J===e.time,onPress:()=>{Z(e.time),U(!1),Ce(!1)}},e.time)})}),$e?(0,F.jsxs)(m.default,{testID:"nb-over-capacity",accessible:!0,accessibilityLiveRegion:"polite",style:{borderWidth:1.5,borderColor:S.colours.amber,backgroundColor:S.colours.amberBg,borderRadius:12,padding:10,gap:6},children:[De?(0,F.jsx)(C.T,{weight:"semibold",colour:S.colours.amber,children:(0,o.overCapacityNote)(Y,De.left,De.time)}):null,Ie?(0,F.jsx)(C.T,{weight:"semibold",colour:S.colours.amber,children:(0,o.overPartiesNote)(Ie.time,Ie.cap)}):null,(0,F.jsx)(C.Chip,{label:Te?'Booking over the limit: on':'Book anyway (over the limit)',selected:Te,onPress:()=>Ce(e=>!e),testID:"nb-over-ok"})]}):null,pe&&J?(0,F.jsxs)(m.default,{style:{gap:6},testID:"nb-dog-tables",children:[(0,F.jsxs)(C.T,{size:14,weight:"semibold",children:["Dog-friendly table ",(0,F.jsxs)(C.T,{size:13,colour:S.colours.muted,children:["(",ge.areas.filter(e=>e.dogs).map(e=>e.name).join(' or '),")"]})]}),je.length?(0,F.jsx)(C.Row,{wrap:!0,gap:6,children:je.slice(0,10).map((e,t)=>(0,F.jsx)(C.Chip,{label:`${(0,l.tableNumbers)(e.table)}`,sub:`${e.area} \xb7 ${e.seats}${0===t?' \xb7 best':''}${Me&&(0,B.accessibleSetUp)(ge)&&!(0,B.isAccessible)(ge,e.table)?' \xb7 not step-free':''}`,selected:(ce??je[0].table)===e.table,onPress:()=>be(e.table)},e.table))}):(0,F.jsxs)(C.T,{size:14,colour:S.colours.amber,children:["No dog-friendly table free for ",Y," at ",J,". Try another time."]})]}):null,Pe?(0,F.jsxs)(m.default,{testID:"nb-block-warning",style:{borderWidth:1.5,borderColor:S.colours.amber,backgroundColor:S.colours.amberBg,borderRadius:12,padding:10,gap:6},children:[(0,F.jsxs)(C.T,{weight:"semibold",colour:S.colours.amber,children:["Bookings are paused ",Pe.from,"\u2013",Pe.to,Pe.reason?` (${Pe.reason})`:'']}),Oe?(0,F.jsx)(C.Chip,{label:H?'Manager override on':'Override and book anyway',selected:H,onPress:()=>U(e=>!e)}):(0,F.jsx)(C.Muted,{children:"Ask a manager to override, or pick another time."})]}):null,we.length?null:(0,F.jsx)(m.default,{testID:"nb-closed",children:(0,F.jsxs)(C.T,{size:14,weight:"semibold",colour:S.colours.amber,children:["Closed on ",(0,w.niceDate)(fe)," (per the venue\u2019s opening hours). Pick another date."]})}),(0,F.jsx)($.MoreQuestions,{rid:b,r:h,value:re,onChange:de,party:Y,date:R,time:J,today:(0,w.ymd)(p),bookings:E,audience:"staff",showTables:!1!==h.settings.tableRequests}),Me&&!(0,B.accessibleSetUp)(ge)?(0,F.jsx)(C.T,{size:13,colour:S.colours.amber,children:"Step-free tables aren\u2019t marked yet (Managers \u203a Booking options \u203a Tables). Check the table works for a wheelchair."}):null,(0,F.jsx)(C.Field,{label:"Notes (optional)",value:ee,onChangeText:te,placeholder:P.NOTES_PLACEHOLDER,multiline:!0,numberOfLines:3,testID:"nb-notes"}),(0,i.depositDue)((0,i.depositOf)(h.settings),Y,X)?(0,F.jsxs)(C.Muted,{testID:"nb-deposit",children:["Deposit due: ",(0,a.gbp)((0,i.depositDue)((0,i.depositOf)(h.settings),Y,X))," (",(0,a.gbp)((0,i.depositOf)(h.settings).perPersonPence)," per adult for ",(0,i.depositOf)(h.settings).fromParty,"+",X?`; ${X} ${1===X?'child':'children'} free`:'; children free',"). Deposits are paid through website bookings or to you, never in CoverCharge: tick Deposit paid on the booking once the guest has paid."]}):null,(0,F.jsxs)(C.Muted,{children:["The guest gets a confirmation text",le.trim()?' and email':''," automatically (preview mode: shown in the Outbox, not sent)."]}),Be?(0,F.jsxs)(C.T,{size:14,colour:S.colours.amber,children:["We already have the most dogs we can look after at ",J,". Try another time: dogs are very welcome then."]}):null,(0,F.jsx)(C.Button,{label:ue.length?ue[0]:'Save booking',testID:"nb-save",disabled:!ze,onPress:()=>{if(R<(0,w.ymd)(p))return;if(!(0,M.guardBookingChange)(L))return;const e=(0,$.needsPatch)(re),s=re.tableReq.find(e=>!pe||je.some(t=>t.table===e)),o=pe?null:(0,z.requestedFreeTable)(re.tableReq,{date:R,time:J,partySize:Y},ge.tables.map(e=>e.name),ke,h.settings.turnMins);k.repo.bookings.create({restaurantId:b,customerId:null,name:q.trim(),partySize:Y,date:R,time:J,notes:ee.trim(),security:(0,i.depositDue)((0,i.depositOf)(h.settings),Y,X)?'deposit':'none',depositPaid:0,...X?{children:X}:{},...(0,i.depositDue)((0,i.depositOf)(h.settings),Y,X)?{depositDue:(0,i.depositDue)((0,i.depositOf)(h.settings),Y,X),depositPolicy:(0,i.depositWords)((0,i.depositOf)(h.settings),Y,h.name,X).join(' '),depositRefundable:(0,i.depositOf)(h.settings).refundable,depositCutoffHours:(0,i.depositOf)(h.settings).cutoffHours}:{},phone:Se.pretty,email:le.trim()||void 0,source:ie,...e,...we.find(e=>e.time===J)?.drinksOnly?{drinksOnly:!0}:{},allergies:e.allergies??[],...pe?{table:ce??s??je[0]?.table}:o?{table:o}:{}}).then(e=>(0,O.postNewBookingToKitchen)(e,N)).catch(()=>{}),u?.({date:R,time:J,name:q.trim()}),t()}})]})}},1094,[812,1095,1096,843,851,841,1097,1098,1099,1100,17,842,385,85,856,1055,858,1101,1074,863,804,848,777,996,993,1102,1103,1108,1076,1053,1092,1091,1109,8]); +__d(function(g,_r,_i,_a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"TABLES",{enumerable:!0,get:function(){return A}}),_e.useTableNames=R,_e.resetTableLive=W,_e.seatBookingNow=async function(e,t){await k.repo.bookings.setStatus(t.id,'seated'),W(e,t.table)},_e.finishBookingNow=async function(e,t){const s=(new Date).toISOString();await k.repo.bookings.update(t.id,(0,N.finishClearPatch)(s,t.table)),(0,v.tablesOf)(t.table).forEach(t=>v.useFloor.getState().setLive(e,t,{stage:void 0,dirty:!0}))},_e.useTableUse=E,Object.defineProperty(_e,"walkInLabel",{enumerable:!0,get:function(){return _}}),_e.TablePicker=H,_e.WalkInSheet=q,_e.AssignTableSheet=V,_e.undoNotice=Y,_e.NewBookingSheet=G,_e.useFrontDoor=function(e,t){const[s,o]=(0,c.useState)(!1),[l,a]=(0,c.useState)(!1),[i,n]=(0,c.useState)(null);return{openWalkIn:()=>o({}),openWalkInAt:e=>o({table:e}),openBooking:()=>a(!0),assignTable:e=>n({b:e}),combineTables:e=>n({b:e,combine:!0}),elements:(0,F.jsxs)(F.Fragment,{children:[s?(0,F.jsx)(q,{wide:t,initialTable:s.table,onClose:()=>o(!1),onSeated:Y}):null,l?(0,F.jsx)(G,{wide:t,date:e,onClose:()=>a(!1),onSaved:e=>(0,u.notify)({id:`booked:${Date.now()}`,testID:'booking-saved-toast',timeoutMs:5e3,icon:'\u2713',title:`Booked: ${e.name} \xb7 ${(0,w.niceDate)((0,w.parseYmd)(e.date))} at ${e.time}`})}):null,i?(0,F.jsx)(V,{booking:i.b,combine:i.combine,onClose:()=>n(null)}):null]})}};var t=_r(_d[0]),s=_r(_d[1]),o=_r(_d[2]),l=_r(_d[3]),a=_r(_d[4]),i=_r(_d[5]),n=_r(_d[6]),r=_r(_d[7]),d=_r(_d[8]),u=_r(_d[9]),c=_r(_d[10]),b=e(c),h=_r(_d[11]),p=e(_r(_d[12])),m=e(_r(_d[13])),f=_r(_d[14]),y=_r(_d[15]),k=_r(_d[16]),x=_r(_d[17]),j=_r(_d[18]),w=_r(_d[19]),S=_r(_d[20]),T=_r(_d[21]),C=_r(_d[22]),v=_r(_d[23]),D=_r(_d[24]),I=_r(_d[25]),$=_r(_d[26]),P=_r(_d[27]),O=_r(_d[28]),B=_r(_d[29]),z=_r(_d[30]),M=_r(_d[31]),N=_r(_d[32]),F=_r(_d[33]);const L=e=>(0,u.notify)({id:'booking-blocked',testID:'booking-blocked-toast',timeoutMs:9e3,icon:'\u26a0',title:e}),A=Array.from({length:12},(e,t)=>String(t+1));function R(e){const t=(0,v.usePlan)(e);return t.areas.flatMap(e=>t.tables.filter(t=>t.areaId===e.id).map(e=>e.name))}function W(e,t){(0,v.tablesOf)(t).forEach(t=>v.useFloor.getState().setLive(e,t,{stage:'seated',dirty:!1}))}function E(e,t){const s=(0,k.useBookings)(e),o=(0,k.useOrders)(e),l=R(e),a=(0,v.useFloor)(t=>t.live[e])??{},i=(0,v.usePlan)(e),n=(0,D.useBlocks)(e=>e.blocks),r=(0,w.ymd)(t),d=(0,D.closedAreasAt)(n,e,r,(0,w.hm)(t)),u={};for(const e of l)u[e]=a[e]?.blocked||d.has(`tbl:${e}`)?{busy:!0,label:'Blocked'}:d.has(i.tables.find(t=>t.name===e)?.areaId??'')?{busy:!0,label:'Closed'}:a[e]?.dirty?{busy:!0,label:'Needs clearing'}:{busy:!1,label:'Free'};for(const e of s)if(e.date===r&&e.table)for(const s of(0,v.tablesOf)(e.table))if(u[s])if('seated'===e.status)u[s]={busy:!0,label:`${e.walkIn?'Walk-in':`${e.name.slice(0,1)}.`} \xb7 ${e.partySize}`};else if('confirmed'===e.status&&!u[s].busy){const o=(0,w.minsBetween)(t,new Date(`${e.date}T${e.time}:00`));o>=-15&&o<=90&&(u[s]={...u[s],soon:`Booked ${e.time}`})}for(const e of o)'table'===e.type&&e.tableNo&&u[e.tableNo]&&!['closed','cancelled','collected'].includes(e.status)&&!u[e.tableNo].busy&&(u[e.tableNo]={busy:!0,label:'Open order'});return u}const _=e=>e.walkIn?`Walk-in \xb7 ${e.partySize}`:`${e.name} \xb7 ${e.partySize}`;function H({use:e,value:t,onPick:s,big:o,best:a,dense:i,bestSet:n,picked:r}){const d=Object.keys(e),[u,b]=(0,c.useState)(0),h=i?6:8,f=i?64:o?92:76,y=u?Math.max(3,Math.floor((u+h)/(f+h))):0,k=y?Math.floor((u-h*(y-1))/y):f,x=new Set(n??[]),j=a?(0,v.tablesOf)(a)[0]:null;return(0,F.jsx)(m.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:h},testID:"table-picker",onLayout:e=>b(Math.floor(e.nativeEvent.layout.width)),children:d.map(o=>{const a=e[o],n=t===o||!!r?.includes(o),d=x.has(o),u=j===o&&!n,c=a.busy?['Blocked','Needs clearing','Closed'].includes(a.label)?a.label:'In use':a.soon??'Free';return(0,F.jsxs)(p.default,{accessibilityRole:"button",testID:`pick-table-${o}`,accessibilityLabel:`Table ${(0,l.tableNumbers)(o)}${r?n?', picked':', not picked':''}, ${a.busy?`in use (${a.label})`:a.soon?`free, ${a.soon}`:'free'}${d?', best table':''}${u?', suggested for this party':''}`,accessibilityState:{selected:n,disabled:'Closed'===a.label},disabled:'Closed'===a.label,onPress:()=>s(o),style:{width:k,minHeight:i?58:64,borderRadius:12,borderWidth:n||u?2.5:1.5,paddingVertical:i?3:6,paddingHorizontal:4,alignItems:'center',justifyContent:'center',gap:2,borderColor:n||u?S.colours.gold:a.busy?S.colours.red:S.colours.ok,backgroundColor:n?S.colours.goldTint:a.busy?S.colours.redBg:S.colours.surface2,opacity:'Closed'!==a.label||n?1:.55},children:[(0,F.jsxs)(m.default,{style:{flexDirection:'row',alignItems:'center',gap:4},children:[(0,F.jsx)(C.T,{weight:"bold",size:22,colour:n?S.colours.goldLight:S.colours.text,children:(0,l.tableNumbers)(o)}),d?(0,F.jsx)(m.default,{testID:"best-table",style:{backgroundColor:S.colours.gold,borderRadius:5,paddingHorizontal:4,paddingVertical:1},children:(0,F.jsx)(C.T,{size:11,weight:"bold",colour:S.colours.onGold,children:"BEST"})}):null]}),(0,F.jsx)(C.T,{size:i?13:14,colour:a.busy?'#FFD9D4':a.soon?'#FFE2A8':'#E2C489',center:!0,numberOfLines:1,children:c})]},o)})})}const U=[1,2,3,4,5,6,7,8];function q({onClose:e,onSeated:a,wide:i,initialTable:n}){const{rid:r,r:d,now:u}=(0,y.useCtx)(15e3),x=E(r,u),[T,I]=(0,c.useState)(2),[$,P]=(0,c.useState)(!1),[O,B]=(0,c.useState)(n??null),z=(0,v.usePlan)(r),N=(0,k.useBookings)(r),A=(0,D.useBlocks)(e=>e.blocks),R=(0,D.closedAreasAt)(A,r,(0,w.ymd)(u),(0,w.hm)(u)),_=b.default.useMemo(()=>{const e=Object.fromEntries(Object.entries(x).map(([e,t])=>[e,{status:t.busy?'seated':'free'}]));return(0,j.suggestTable)(z,N.filter(e=>e.date===(0,w.ymd)(u)),e,T,u,(0,j.turnFor)(T,d.settings.turnMins),90,void 0,{closed:R})?.table??null},[z,N,x,T,R.size,u.getTime()]);(0,c.useEffect)(()=>{O&&(0,v.tablesOf)(O).some(e=>'Closed'===x[e]?.label)&&B(null)},[O,R.size]);const[q,V]=(0,c.useState)(!1),[Y,G]=(0,c.useState)(''),K=(e,t=String(e),s=()=>{P(!1),I(e)})=>{const o='9+'===t?$:!$&&T===e;return(0,F.jsx)(p.default,{accessibilityRole:"button",accessibilityLabel:'9+'===t?'Party of 9 or more':`Party of ${e}`,accessibilityState:{selected:o},onPress:s,style:{width:i?58:60,height:i?58:56,borderRadius:14,borderWidth:2,borderColor:S.colours.gold,alignItems:'center',justifyContent:'center',backgroundColor:o?S.colours.gold:'transparent'},children:(0,F.jsx)(C.T,{weight:"bold",size:22,colour:o?S.colours.onGold:S.colours.gold,children:t})},t)},Q=(0,F.jsx)(s.PartySizeInput,{value:T,onChange:I,min:9,max:o.MAX_PARTY,label:"Walk-in party size",testID:"walkin-party-size"}),X=(0,F.jsxs)(m.default,{style:{gap:8,width:i?256:void 0},children:[(0,F.jsx)(C.T,{weight:"semibold",children:"How many people?"}),(0,F.jsxs)(m.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:8},testID:"walkin-party",children:[U.map(e=>K(e)),K(9,'9+',()=>{P(!0),I(e=>e>=9?e:9)})]}),$?Q:null]}),[J,Z]=(0,c.useState)(!1),ee=async(t=O)=>{if(!J&&(0,M.guardBookingChange)(L)){Z(!0);try{const s=await k.repo.bookings.seatWalkIn(r,T,t??void 0,Y);W(r,t??void 0),a(s),e()}finally{Z(!1)}}},te=(0,F.jsxs)(m.default,{style:{gap:8,flex:i?1:void 0,minWidth:0},children:[(0,F.jsxs)(C.Row,{style:{justifyContent:'space-between'},children:[(0,F.jsxs)(C.T,{weight:"semibold",children:["Table ",(0,F.jsx)(C.T,{colour:S.colours.muted,size:14,children:"(optional)"})]}),O?(0,F.jsx)(C.Button,{small:!0,kind:"ghost",label:"Clear table",onPress:()=>B(null)}):null]}),(0,F.jsx)(H,{use:x,value:O,onPick:e=>{x[e]&&!x[e].busy?ee(e):B(O===e?null:e)},big:i,dense:i,best:_,bestSet:(0,h.bestTables)(z)}),(0,F.jsxs)(C.Muted,{children:["Tap a free table to seat them there",_&&!O?` (suggested for ${T}: ${(0,l.tableNumbers)(_)})`:'',", or Seat for no table yet. BEST marks the venue\u2019s best tables."]})]});return(0,F.jsxs)(C.Sheet,{visible:!0,onClose:e,title:`Walk-in \xb7 ${(0,w.hm)(u)}`,maxWidth:i?1100:void 0,testID:"walkin-sheet",children:[(0,F.jsx)(C.Button,{label:`Seat walk-in \xb7 ${T} ${1===T?'person':'people'}${O?` \xb7 ${(0,l.tableNumbers)(O)}`:''}`,disabled:J,onPress:()=>{ee()},testID:"seat-walkin",style:{minHeight:52}}),i?(0,F.jsxs)(C.Row,{gap:16,style:{alignItems:'flex-start'},children:[X,te]}):(0,F.jsxs)(F.Fragment,{children:[X,te]}),(0,F.jsxs)(C.Row,{gap:10,wrap:!0,style:{alignItems:'center'},children:[q?(0,F.jsx)(t.TextInput,{accessibilityLabel:"Walk-in note",placeholder:"Note (optional), e.g. high chair",placeholderTextColor:"#7D776C",value:Y,onChangeText:G,style:[C.styles.input,{flex:1,minWidth:220}],autoFocus:!0}):(0,F.jsx)(C.Button,{small:!0,kind:"ghost",label:"Add a note (optional)",onPress:()=>V(!0)}),(0,F.jsx)(m.default,{style:{flex:1,minWidth:220},children:(0,F.jsxs)(C.Muted,{children:["No name needed. Counts in today's covers.",'staff'!==f.APP_VARIANT?' Using website bookings too? Mark the table there as well.':'']})})]})]})}function V({booking:e,onClose:t,combine:s}){const{rid:o,r:a,now:i}=(0,y.useCtx)(15e3),n=E(o,i),r=(0,v.usePlan)(o),d=(0,k.useBookings)(o),u=(0,v.tablesOf)(e.table),p=b.default.useMemo(()=>Object.fromEntries(Object.entries(n).map(([e,t])=>[e,u.includes(e)?{busy:!1,label:'This party',soon:'This party'}:t])),[n,e.table]),f=b.default.useMemo(()=>{const t=Object.fromEntries(Object.entries(p).map(([e,t])=>[e,{status:t.busy?'seated':'free'}]));return(0,j.suggestTable)(r,d.filter(e=>e.date===(0,w.ymd)(i)),t,e.partySize,i,(0,j.turnFor)(e.partySize,a.settings.turnMins),90,e.id)?.table??null},[r,d,p,e.partySize,i.getTime()]),[x,T]=(0,c.useState)(!!s||u.length>1),[D,I]=(0,c.useState)(u),$=e=>r.tables.find(t=>t.name===e)?.maxSeats??0,P=D.reduce((e,t)=>e+$(t),0),O=D.length>0&&P{if(!(0,M.guardBookingChange)(L))return;const l=(0,v.joinTables)(s);await k.repo.bookings.assignTable(e.id,l);u.filter(e=>!s.includes(e)).forEach(t=>v.useFloor.getState().setLive(o,t,{stage:void 0,dirty:'seated'===e.status})),'seated'===e.status&&W(o,l),t()},z=x?(0,F.jsxs)(m.default,{style:{gap:8},testID:"assign-table-tip",children:[(0,F.jsx)(m.default,{accessibilityLiveRegion:"polite",children:(0,F.jsx)(C.T,{size:17,weight:"semibold",colour:S.colours.text,children:D.length?`${(0,v.tablesLabel)((0,v.joinTables)(D))} \xb7 ${P} seats for ${e.partySize} Covers`:'No tables picked yet'})}),O?(0,F.jsx)(m.default,{testID:"combine-short",children:(0,F.jsxs)(C.T,{size:15,weight:"semibold",colour:"#FFD9D4",children:["Not enough seats yet: ",e.partySize-P," more needed. Add another table."]})}):null,(0,F.jsx)(C.T,{size:15,colour:S.colours.text,children:"Tap each table to add or remove it, then tap Done. All of them show as taken until the party has finished."}),(0,F.jsxs)(C.Row,{gap:8,wrap:!0,children:[(0,F.jsx)(C.Button,{label:"Done",testID:"combine-done",disabled:!D.length,accessibilityLabel:D.length?`Done, save ${(0,v.tableCardLabel)((0,v.joinTables)(D))}`:'Done',onPress:()=>B(D)}),(0,F.jsx)(C.Button,{kind:"ghost",label:"Cancel",onPress:t})]})]}):(0,F.jsx)(m.default,{style:{gap:8},testID:"assign-table-tip",children:(0,F.jsx)(C.T,{size:15,colour:S.colours.text,children:"Red tables are in use right now; you can still pick one (e.g. joining a table). BEST marks the venue\u2019s best tables. Big party? Tap Combine tables."})});return(0,F.jsxs)(C.Sheet,{visible:!0,onClose:t,title:`${x?'Combine tables':'Assign table'} \xb7 ${_(e)}`,testID:"assign-table-sheet",footer:z,children:[f&&!x?(0,F.jsx)(m.default,{testID:"assign-suggested",children:(0,F.jsxs)(C.T,{size:16,weight:"semibold",colour:S.colours.goldLight,accessibilityLabel:`Suggested for ${e.partySize}: ${(0,v.tableCardLabel)(f)}`,children:["Suggested for ",e.partySize,": ",(0,l.tableNumbers)(f)]})}):null,x?null:(0,F.jsx)(C.Button,{kind:"secondary",label:"Combine tables",testID:"combine-start",accessibilityLabel:"Combine tables: pick several tables for this party",onPress:()=>T(!0)}),(0,F.jsx)(H,{use:p,best:x?null:f,bestSet:(0,h.bestTables)(r),picked:x?D:void 0,onPick:x?e=>I(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]):async e=>{await B([e])}})]})}function Y(e){(0,u.notify)({id:`walkin:${e.id}`,testID:'walkin-toast',timeoutMs:6e3,title:`${_(e)} seated \xb7 ${e.table?`${(0,l.tableNumbers)(e.table)}`:'table to assign'} (${e.ref})`,actions:[{label:'Undo',testID:'undo-walkin',onPress:()=>k.repo.bookings.undoWalkIn(e.id)},{label:'OK',kind:'ghost'}]})}function G({date:e,onClose:t,wide:s,onSaved:u}){const{rid:b,r:h,now:p,role:f,meId:N}=(0,y.useCtx)(6e4);(0,d.useBlurOutside)();const A=(0,w.ymd)(p),[R,W]=(0,c.useState)(ee.blocks),[H,U]=(0,c.useState)(!1),[q,V]=(0,c.useState)(''),[Y,G]=(0,c.useState)(2),[K,Q]=(0,c.useState)(0),X=Math.min(K,Math.max(0,Y-1)),[J,Z]=(0,c.useState)(null),[ee,te]=(0,c.useState)(''),[se,oe]=(0,c.useState)(''),[le,ae]=(0,c.useState)(''),[ie,ne]=(0,c.useState)('phone'),[re,de]=(0,c.useState)((0,$.emptyNeeds)()),ue=(0,$.needsMissing)(re),[ce,be]=(0,c.useState)(null),ge=(0,v.usePlan)(b),he=(0,B.dogSetUp)(ge),pe=!0===re.dog&&he,me=re.dog?re.dogs:0,fe=(0,w.parseYmd)(R),ye=(0,j.turnFor)(Y,h.settings.turnMins),ke=E.filter(e=>e.date===R),xe=e=>(0,j.freeTablesAt)(ge,ke,Y,new Date(`${R}${(0,l.tableNumbers)(e)}:00`),ye,h.settings.turnMins,{dog:!0,closed:(0,D.closedAreasAt)(_,b,R,e)}),je=pe&&J?xe(J):[];(0,c.useEffect)(()=>{be(null)},[pe,J,Y]);const we=(0,x.bookingSlots)(h,fe,e=>E.filter(t=>t.date===R&&t.time===e&&'cancelled'!==t.status&&!t.walkIn).reduce((e,t)=>e+t.partySize,0),Y,R===(0,w.ymd)(p)?p:(0,w.addMins)(fe,0),e=>E.filter(t=>t.date===R&&t.time===e&&'cancelled'!==t.status&&!t.walkIn).length),Se=(0,T.guestPhone)(se),[Te,Ce]=(0,c.useState)(!1),ve=J?we.find(e=>e.time===J):void 0,De=ve&&ve.left=2&&!!J&&(!$e||Te)&&(0,o.validParty)(Y)&&Se.ok&&(0,T.emailOk)(le)&&(!Pe||Oe&&H)&&(!pe||je.length>0)&&!Be,Me=re.wheelchair>0||re.stepFree;return(0,F.jsxs)(C.Sheet,{visible:!0,onClose:t,title:`New booking \xb7 ${(0,w.niceDate)(fe)}`,maxWidth:s?760:void 0,testID:"booking-sheet",children:[(0,F.jsx)($.FirstQuestions,{rid:b,value:re,onChange:de,party:Y,audience:"staff"}),re.dog&&!he?(0,F.jsx)(C.T,{size:13,colour:S.colours.amber,children:"Dog-friendly tables aren\u2019t marked yet. Managers \u203a Booking options \u203a Tables. Booking is allowed; check where the dog can sit."}):null,(0,F.jsx)(I.BookingDatePicker,{r:h,today:p,value:R,onChange:e=>{e!==R&&(W(e),Z(null),U(!1))}}),(0,F.jsxs)(C.Row,{gap:6,children:[(0,F.jsx)(C.Chip,{label:"Phone",selected:'phone'===ie,onPress:()=>ne('phone')}),(0,F.jsx)(C.Chip,{label:"In person",selected:'in-person'===ie,onPress:()=>ne('in-person')})]}),(0,F.jsx)(C.Field,{label:"Name",value:q,onChangeText:V,placeholder:"e.g. Reid",testID:"nb-name"}),(0,F.jsx)(C.Field,{label:"Mobile or phone number (needed)",value:se,onChangeText:oe,keyboardType:"phone-pad",placeholder:"e.g. 07700 900123",testID:"nb-phone"}),!Se.ok&&se?(0,F.jsx)(C.T,{size:13,colour:S.colours.amber,children:Se.error}):null,(0,F.jsx)(C.Field,{label:"Email (optional)",value:le,onChangeText:ae,keyboardType:"email-address",autoCapitalize:"none",placeholder:"For an email confirmation too",testID:"nb-email"}),(0,T.emailOk)(le)?null:(0,F.jsx)(C.T,{size:13,colour:S.colours.amber,children:"That email doesn\u2019t look quite right."}),(0,F.jsx)(n.AdultsChildren,{value:(0,r.peopleOf)(Y,X),onChange:e=>{G(e.partySize),Q(e.children),Ce(!1)},depositsOn:(0,i.depositOf)(h.settings).on&&(0,i.depositOf)(h.settings).perPersonPence>0,testID:"nb-people"}),(0,F.jsx)(C.Row,{wrap:!0,gap:6,children:we.map(e=>{const t=pe&&e.available&&!xe(e.time).length||!(0,$.dogTimeOk)(h,E,R,e.time,me);return(0,F.jsx)(C.Chip,{testID:`nb-slot-${e.time}`,label:e.time,sub:(0,D.blockAt)(_,b,R,e.time)?'Paused':t?'Dogs full':e.drinksOnly?'Drinks only':null!=e.partiesLeft&&e.partiesLeft<1||e.left<=0?'Full':`${e.left} left`,disabled:(e.past??!e.available)||t,selected:J===e.time,onPress:()=>{Z(e.time),U(!1),Ce(!1)}},e.time)})}),$e?(0,F.jsxs)(m.default,{testID:"nb-over-capacity",accessible:!0,accessibilityLiveRegion:"polite",style:{borderWidth:1.5,borderColor:S.colours.amber,backgroundColor:S.colours.amberBg,borderRadius:12,padding:10,gap:6},children:[De?(0,F.jsx)(C.T,{weight:"semibold",colour:S.colours.amber,children:(0,o.overCapacityNote)(Y,De.left,De.time)}):null,Ie?(0,F.jsx)(C.T,{weight:"semibold",colour:S.colours.amber,children:(0,o.overPartiesNote)(Ie.time,Ie.cap)}):null,(0,F.jsx)(C.Chip,{label:Te?'Booking over the limit: on':'Book anyway (over the limit)',selected:Te,onPress:()=>Ce(e=>!e),testID:"nb-over-ok"})]}):null,pe&&J?(0,F.jsxs)(m.default,{style:{gap:6},testID:"nb-dog-tables",children:[(0,F.jsxs)(C.T,{size:14,weight:"semibold",children:["Dog-friendly table ",(0,F.jsxs)(C.T,{size:13,colour:S.colours.muted,children:["(",ge.areas.filter(e=>e.dogs).map(e=>e.name).join(' or '),")"]})]}),je.length?(0,F.jsx)(C.Row,{wrap:!0,gap:6,children:je.slice(0,10).map((e,t)=>(0,F.jsx)(C.Chip,{label:`${(0,l.tableNumbers)(e.table)}`,sub:`${e.area} \xb7 ${e.seats}${0===t?' \xb7 best':''}${Me&&(0,B.accessibleSetUp)(ge)&&!(0,B.isAccessible)(ge,e.table)?' \xb7 not step-free':''}`,selected:(ce??je[0].table)===e.table,onPress:()=>be(e.table)},e.table))}):(0,F.jsxs)(C.T,{size:14,colour:S.colours.amber,children:["No dog-friendly table free for ",Y," at ",J,". Try another time."]})]}):null,Pe?(0,F.jsxs)(m.default,{testID:"nb-block-warning",style:{borderWidth:1.5,borderColor:S.colours.amber,backgroundColor:S.colours.amberBg,borderRadius:12,padding:10,gap:6},children:[(0,F.jsxs)(C.T,{weight:"semibold",colour:S.colours.amber,children:["Bookings are paused ",Pe.from,"\u2013",Pe.to,Pe.reason?` (${Pe.reason})`:'']}),Oe?(0,F.jsx)(C.Chip,{label:H?'Manager override on':'Override and book anyway',selected:H,onPress:()=>U(e=>!e)}):(0,F.jsx)(C.Muted,{children:"Ask a manager to override, or pick another time."})]}):null,we.length?null:(0,F.jsx)(m.default,{testID:"nb-closed",children:(0,F.jsxs)(C.T,{size:14,weight:"semibold",colour:S.colours.amber,children:["Closed on ",(0,w.niceDate)(fe)," (per the venue\u2019s opening hours). Pick another date."]})}),(0,F.jsx)($.MoreQuestions,{rid:b,r:h,value:re,onChange:de,party:Y,date:R,time:J,today:(0,w.ymd)(p),bookings:E,audience:"staff",showTables:!1!==h.settings.tableRequests}),Me&&!(0,B.accessibleSetUp)(ge)?(0,F.jsx)(C.T,{size:13,colour:S.colours.amber,children:"Step-free tables aren\u2019t marked yet (Managers \u203a Booking options \u203a Tables). Check the table works for a wheelchair."}):null,(0,F.jsx)(C.Field,{label:"Notes (optional)",value:ee,onChangeText:te,placeholder:P.NOTES_PLACEHOLDER,multiline:!0,numberOfLines:3,testID:"nb-notes"}),(0,i.depositDue)((0,i.depositOf)(h.settings),Y,X)?(0,F.jsxs)(C.Muted,{testID:"nb-deposit",children:["Deposit due: ",(0,a.gbp)((0,i.depositDue)((0,i.depositOf)(h.settings),Y,X))," (",(0,a.gbp)((0,i.depositOf)(h.settings).perPersonPence)," per adult for tables of ",(0,i.depositOf)(h.settings).fromParty,"+ adults",X?`; ${X} ${1===X?'child':'children'} free`:'; children free, and they do not count towards the number that needs a deposit',"). Staff can waive it. Deposits are paid through website bookings or to you, never in CoverCharge: tick Deposit paid on the booking once the guest has paid."]}):null,(0,F.jsxs)(C.Muted,{children:["The guest gets a confirmation text",le.trim()?' and email':''," automatically (preview mode: shown in the Outbox, not sent)."]}),Be?(0,F.jsxs)(C.T,{size:14,colour:S.colours.amber,children:["We already have the most dogs we can look after at ",J,". Try another time: dogs are very welcome then."]}):null,(0,F.jsx)(C.Button,{label:ue.length?ue[0]:'Save booking',testID:"nb-save",disabled:!ze,onPress:()=>{if(R<(0,w.ymd)(p))return;if(!(0,M.guardBookingChange)(L))return;const e=(0,$.needsPatch)(re),s=re.tableReq.find(e=>!pe||je.some(t=>t.table===e)),o=pe?null:(0,z.requestedFreeTable)(re.tableReq,{date:R,time:J,partySize:Y},ge.tables.map(e=>e.name),ke,h.settings.turnMins);k.repo.bookings.create({restaurantId:b,customerId:null,name:q.trim(),partySize:Y,date:R,time:J,notes:ee.trim(),security:(0,i.depositDue)((0,i.depositOf)(h.settings),Y,X)?'deposit':'none',depositPaid:0,...X?{children:X}:{},...(0,i.depositDue)((0,i.depositOf)(h.settings),Y,X)?{depositDue:(0,i.depositDue)((0,i.depositOf)(h.settings),Y,X),depositPolicy:(0,i.depositWords)((0,i.depositOf)(h.settings),Y,h.name,X).join(' '),depositRefundable:(0,i.depositOf)(h.settings).refundable,depositCutoffHours:(0,i.depositOf)(h.settings).cutoffHours}:{},phone:Se.pretty,email:le.trim()||void 0,source:ie,...e,...we.find(e=>e.time===J)?.drinksOnly?{drinksOnly:!0}:{},allergies:e.allergies??[],...pe?{table:ce??s??je[0]?.table}:o?{table:o}:{}}).then(e=>(0,O.postNewBookingToKitchen)(e,N)).catch(()=>{}),u?.({date:R,time:J,name:q.trim()}),t()}})]})}},1094,[812,1095,1096,843,851,841,1097,1098,1099,1100,17,842,385,85,856,1055,858,1101,1074,863,804,848,777,996,993,1102,1103,1108,1076,1053,1092,1091,1109,8]); __d(function(g,r,i,a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.PartySizeInput=function({value:e,onChange:p,min:b=s.MIN_PARTY,max:y=s.MAX_PARTY,label:f="Party size",testID:h="party-size"}){const[x,S]=(0,t.useState)(String(e));(0,t.useEffect)(()=>{S(String(e))},[e]);const T=e=>p((0,s.clampParty)(e,b,y)),$=(t,n,l)=>{const s=t<0?e<=b:e>=y;return(0,d.jsx)(o.default,{testID:`${h}-${t>0?'up':'down'}${10===Math.abs(t)?'10':''}`,accessibilityRole:"button",accessibilityLabel:l,accessibilityState:{disabled:s},disabled:s,onPress:()=>T(e+t),hitSlop:4,style:{minWidth:44,height:44,paddingHorizontal:8,borderRadius:22,borderWidth:1.5,borderColor:u.colours.gold,alignItems:'center',justifyContent:'center',opacity:s?.4:1},children:(0,d.jsx)(c.T,{size:10===Math.abs(t)?14:20,weight:"semibold",colour:u.colours.gold,center:!0,children:n})},t)};return(0,d.jsxs)(l.default,{testID:h,style:{flexDirection:'row',alignItems:'center',gap:6,flexWrap:'wrap',justifyContent:'center'},children:[y-b>=20?$(-10,'\u221210',"10 fewer people"):null,$(-1,'\u2212','One fewer person'),(0,d.jsx)(n.default,{testID:`${h}-input`,value:x,keyboardType:"number-pad",inputMode:"numeric",maxLength:3,selectTextOnFocus:!0,accessibilityLabel:`${f}, ${b} to ${y} people`,accessibilityValue:{min:b,max:y,now:e,text:`${e} ${1===e?'person':'people'}`},onChangeText:e=>{S(e.replace(/\D/g,'')),e.replace(/\D/g,'')&&T((0,s.partyFromText)(e,b,y))},onBlur:()=>{const e=(0,s.partyFromText)(x,b,y);S(String(e)),T(e)},returnKeyType:"done",blurOnSubmit:!0,onSubmitEditing:e=>{e?.target?.blur?.()},style:{width:64,height:44,borderRadius:10,borderWidth:1,borderColor:u.colours.border,color:u.colours.text,backgroundColor:u.colours.surface,textAlign:'center',fontSize:20,fontFamily:u.fonts.semibold}}),$(1,'+','One more person'),y-b>=20?$(10,'+10',"10 more people"):null]})};var t=r(_d[0]),o=e(r(_d[1])),n=e(r(_d[2])),l=e(r(_d[3])),s=r(_d[4]),u=r(_d[5]),c=r(_d[6]),d=r(_d[7])},1095,[17,385,395,85,1096,804,777,8]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"MAX_PARTY",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"MIN_PARTY",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"PARTY_RULE",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"validParty",{enumerable:!0,get:function(){return u}}),Object.defineProperty(e,"partyFromText",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"clampParty",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"overCapacityNote",{enumerable:!0,get:function(){return f}}),Object.defineProperty(e,"overPartiesNote",{enumerable:!0,get:function(){return b}});const t=100,n=1,o=`Bookings are for ${n} to ${t} people.`,u=o=>'number'==typeof o&&Number.isInteger(o)&&o>=n&&o<=t,c=(o,u=n,c=t)=>{const s=parseInt(String(o??'').replace(/\D/g,'').slice(0,4),10);return Math.max(u,Math.min(c,Number.isFinite(s)?s:u))},s=(o,u=n,c=t)=>Math.max(u,Math.min(c,Math.round(Number(o)||u))),f=(t,n,o)=>n<=0?`${o} is already full for booked Covers. Booking ${t} more goes over the venue\u2019s limit: check tables and staffing.`:`${t} is more than the ${n} Covers left at ${o}. Booking goes over the venue\u2019s limit by ${t-n}: check tables and staffing.`,b=(t,n)=>`${t} already has the most bookings we take at one start time (${n}). Booking another goes over the venue\u2019s limit: check tables and staffing.`},1096,[]); __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.AdultsChildren=function({value:e,onChange:t,depositsOn:h,testID:x="people"}){const p=e=>t((0,s.storedPeople)(e)),b=(0,s.totalLine)(e);return(0,o.jsxs)(l.default,{testID:x,style:{gap:8,alignItems:'center',width:'100%'},children:[(0,o.jsx)(u.T,{size:18,center:!0,weight:"semibold",children:"Adults"}),(0,o.jsx)(n.PartySizeInput,{value:e.adults,min:1,max:(0,s.maxAdults)(e.children),onChange:t=>p({adults:t,children:e.children}),label:"Adults",testID:`${x}-adults`}),(0,o.jsx)(u.T,{size:18,center:!0,weight:"semibold",children:"Children"}),(0,o.jsx)(n.PartySizeInput,{value:e.children,min:0,max:(0,s.maxKids)(e.adults),onChange:t=>p({adults:e.adults,children:t}),label:"Children",testID:`${x}-children`}),(0,o.jsx)(u.T,{size:18,center:!0,weight:"semibold",colour:c.colours.goldLight,testID:`${x}-total`,accessibilityLabel:b,children:b}),h?(0,o.jsx)(u.Muted,{center:!0,children:"Children never pay a deposit."}):null]})},r(d[0]);var e,t=r(d[1]),l=(e=t)&&e.__esModule?e:{default:e},s=r(d[2]),n=r(d[3]),u=r(d[4]),c=r(d[5]),o=r(d[6])},1097,[17,85,1098,1095,777,804,8]); @@ -1318,9 +1318,9 @@ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{v __d(function(g,_r,i,_a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"useChefAssistant",{enumerable:!0,get:function(){return I}}),Object.defineProperty(_e,"CHEF_PROMPTS",{enumerable:!0,get:function(){return P}}),_e.ChefAssistantButton=function({compact:e}){return e?(0,S.jsx)(u.default,{testID:"chef-assistant-open",accessibilityRole:"button",accessibilityLabel:"Assistant",onPress:()=>I.getState().setOpen(!0),style:{borderRadius:12,backgroundColor:w.colours.accentBg,borderWidth:1,borderColor:w.colours.accentBorder,paddingVertical:6,paddingHorizontal:12,minHeight:36,justifyContent:'center'},children:(0,S.jsx)(m.T,{weight:"semibold",colour:w.colours.goldLight,size:13,children:"\u2726 Assistant"})}):(0,S.jsx)(d.ActionTile,{primary:!0,testID:"chef-assistant-open",icon:"sparkle",label:"Assistant",sub:"Recipe card, order, allergens, GP, temps",accessibilityLabel:"Assistant",onPress:()=>I.getState().setOpen(!0)})},_e.ChefAssistantSheet=function({go:e}){const l=I(e=>e.open),d=()=>I.getState().setOpen(!1),{rid:f,me:W,menu:L,k:B,c:F}=(0,$.useChef)(3e4),G=(0,T.useSuggestions)(),E=(0,r.useSafetyView)('chef').points,[M,H]=(0,o.useState)([]),[N,_]=(0,o.useState)(''),[V,K]=(0,o.useState)(!1),[Y,q]=(0,o.useState)(!1),Q=(0,o.useRef)(null),U=(0,o.useRef)(null);if((0,o.useEffect)(()=>{setTimeout(()=>Q.current?.scrollToEnd?.({animated:!0}),50)},[M.length]),!l)return null;const J=(e,t=!1)=>H(n=>[...n,{id:R(),from:'bot',text:e,demo:t}]),X=e=>H(t=>[...t,{id:R(),from:'bot',plan:e,state:'open'}]),Z=L.filter(e=>!e.name.includes('(example)')||!0),ee=(t,n)=>{const r=A(t);if(!(0,s.chefCanSee)(f,t))return void J('That check is managed in the Managers app.');if(/\b(send|email|text|pay|delete|remove|order now|place the order)\b/.test(r)&&!/\b(build|draft|make|prepare)\b/.test(r))return void J('I can\u2019t send, pay for or delete anything. I can prepare it for you to check and do yourself, for example \u201cbuild the fish order\u201d.');const o=(0,y.parseQuick)(t,E).filter(e=>e.point&&(0,y.isTempKind)(e.point.kind));if(o.length&&(/\b(fridge|freezer|walk ?in|core|probe|cool|hot|deliver|degree|temp)/.test(r)||o.some(e=>null!=e.value))){const t=o.filter(e=>null!=e.value),r=o.filter(e=>null==e.value);if(r.length&&J(`I didn\u2019t hear a temperature for ${r.map(e=>e.point.name).join(', ')}. Say or type the reading, for example \u201c${r[0].point.name} 4 degrees\u201d. I never fill one in.`),!t.length)return;const s=t.filter(e=>!(0,y.inRange)(e.point,e.value));return void X({title:`Log ${1===t.length?'a reading':`${t.length} readings`} in the food safety log`,detail:t.map(e=>`${e.point.name}: ${e.value}\xb0C (${(0,y.limitText)(e.point)})${(0,y.inRange)(e.point,e.value)?'':' \xb7 OUT OF RANGE'}`).join('\n')+`\nSigned ${(0,y.initialsOf)(W)} \xb7 ${n?'voice':'typed'}`,warn:s.length?`${s.map(e=>e.point.name).join(', ')} out of range: you\u2019ll need to add the corrective action in the food safety log.`:void 0,confirm:'Log it',run:()=>{const r=(new Date).toISOString();return v.useSafety.getState().addEntries(t.map(e=>({pointId:e.point.id,name:e.point.name,kind:e.point.kind,at:r,by:W.replace(' (example)',''),byId:$.CHEF_ID,app:'chef',value:e.value,ok:(0,y.inRange)(e.point,e.value),source:n?'voice':'typed',initials:(0,y.initialsOf)(W)}))),s.length&&setTimeout(()=>e('haccp'),600),`Logged ${t.map(e=>`${e.point.name} ${e.value}\xb0C`).join(', ')}.${s.length?' Opening the food safety log for the corrective action.':''}`}})}if(/\b(fridge|freezer|temp|temperature|degrees)\b/.test(r))return void J('Which unit, and what does it read? For example \u201cprep fridge 4 degrees\u201d or \u201cfreezer minus 19\u201d. I only log the number you give me.');if(/allergen|allerg|contain|gluten|nut|dairy|milk|shellfish|crustacean|coeliac/.test(r)){const e=D(t,Z,e=>e.name);if(!e)return void J('Which dish? For example \u201callergens in the fish and chips\u201d.');const n=(0,j.recipeCards)().byMenuItem(e.id),r=e=>b.ALLERGENS.find(t=>t.id===e)?.label??e,s=Object.entries(e.allergens??{}).filter(([,e])=>'contains'===e).map(([e])=>r(e)),a=Object.entries(e.allergens??{}).filter(([,e])=>'may'===e).map(([e])=>r(e));return void J(`${e.name}: ${s.length?`contains ${s.join(', ')}`:'no allergens recorded as \u201ccontains\u201d'}${a.length?`; may contain ${a.join(', ')}`:''}. ${n?n.signOff?`From the signed-off recipe card (${n.signOff.by}).`:'The recipe card is awaiting your sign-off, so check it before telling a guest.':'There\u2019s no recipe card for it yet.'} Always check the card and the ingredients with the guest.`)}if(/\bgp\b|gross profit|margin|price for|what price|cost of|costing/.test(r)){const e=D(t,F,e=>e.item.name),n=Number((t.toLowerCase().match(/(\d{2})\s*(?:%|percent|per cent)/)??[])[1])||B.targetGp;if(!e)return void J(`Which dish? I can cost the dishes that have a recipe in GP & costing (${F.length} do). For example \u201cGP on the haddock\u201d.`);const r=(0,C.priceForTarget)(e.cost,n);return void J(`${e.item.name}: food cost ${(0,x.gbp)(e.cost)}, sells at ${(0,x.gbp)(e.priceInc)} (inc VAT) = ${e.gp.toFixed(1)}% GP. For ${n}% GP it would need ${(0,x.gbp)(r)} inc VAT. Prices are changed by a manager; I haven\u2019t changed anything.`)}if(/\border|supplier|delivery|par\b|restock/.test(r)){const n=D(t,G,e=>`${e.s.name} ${e.s.category??''}`)??(1===G.length?G[0]:void 0);return n?void X({title:`Build an order for ${n.s.name}`,detail:(n.lines.length?n.lines.map(e=>`${e.i.name}: ${(0,a.fishQtyText)(f,e.i,e.qty)}`).join('\n')+`\nAbout ${(0,x.gbp)(n.total)} at the latest prices.`:'Nothing is below par for this supplier yet.')+'\nI\u2019ll open it in Ordering for you to check, change and place yourself. Nothing is sent.',confirm:'Open the order',run:()=>(setTimeout(()=>{d(),e('orders',n.s.id)},400),`Opening the ${n.s.name} order. You check it and place it yourself.`)}):void J(G.length?`Which supplier? ${G.map(e=>e.s.name).join(', ')}.`:'Nothing is below par and no supplier orders today.')}if(/recipe|card|new dish|write up|spec/.test(r)){const n=t.replace(/^.*?(?:recipe card|card|recipe|dish|spec)\s*(?:for|of)?\s*/i,'').replace(/[.?!]+$/,'').trim();if(!n||n.length<3)return void J('What\u2019s the dish called? For example \u201cdraft a recipe card for crab linguine\u201d.');const r=n.replace(/^the\s+/i,'').replace(/^./,e=>e.toUpperCase()).slice(0,60),s=(0,j.recipeCards)().list(f).find(e=>A(e.dish)===A(r));return s?(J(`There\u2019s already a card for ${s.dish}. Opening Recipe cards.`),void setTimeout(()=>{d(),e('recipes')},600)):void X({title:`Draft a recipe card: ${r}`,detail:'A new card, awaiting your sign-off, with the dish name and section filled in. You add the ingredients, method, allergens, photo and price, then sign it off. It isn\u2019t shown to guests until you do.',confirm:'Make the draft',run:async()=>(await(0,j.recipeCards)().create(f,{dish:r,section:'Specials',price:null,ingredients:[],steps:[]},{name:W,role:'head-chef'}),setTimeout(()=>{d(),e('recipes')},500),`Draft card for ${r} saved, awaiting sign-off. Opening Recipe cards.`)})}const l='I can help with: drafting a recipe card, building a supplier order, a dish\u2019s allergens, GP pricing, and logging a temperature you read out. Try one of the suggestions.';(0,k.askServer)('chef',t,[]).then(e=>J('text'===e.kind?e.text:l)).catch(()=>J(l))},te=(e,t=!1)=>{const n=e.trim();if(n){_(''),H(e=>[...e,{id:R(),from:'you',text:n}]);try{ee(n,t)}catch(e){J(`Sorry, that didn\u2019t work: ${e.message}`)}}},ne=async e=>{if(e.plan){H(t=>t.map(t=>t.id===e.id?{...t,state:'done'}:t));try{J(String(await e.plan.run()))}catch(e){J(`Couldn\u2019t do that: ${e.message}`)}}},ie=e=>{H(t=>t.map(t=>t.id===e.id?{...t,state:'cancelled'}:t)),J('Cancelled. Nothing was changed.')},re=()=>{te(N,Y),q(!1)};return(0,S.jsx)(c.default,{visible:!0,transparent:!0,animationType:"fade",onRequestClose:d,children:(0,S.jsx)(p.default,{style:[m.styles.overlay,{justifyContent:'flex-end',padding:0}],children:(0,S.jsxs)(p.default,{testID:"chef-assistant",style:{backgroundColor:w.colours.surface,borderTopLeftRadius:18,borderTopRightRadius:18,borderWidth:1,borderColor:w.colours.border,width:'100%',maxWidth:640,alignSelf:'center',maxHeight:'92%',minHeight:'70%',padding:14,gap:10},children:[(0,S.jsxs)(m.Row,{style:{justifyContent:'space-between'},children:[(0,S.jsx)(m.T,{size:20,weight:"semibold",children:"\u2726 Kitchen Assistant"}),(0,S.jsx)(n.GoldClose,{testID:"chef-assistant-close",onPress:d,style:{marginRight:-6}})]}),(0,S.jsx)(p.default,{testID:"chef-assistant-demo",children:(0,S.jsx)(m.Badge,{kind:"amber",label:O})}),(0,S.jsxs)(h.default,{ref:Q,style:{flex:1},contentContainerStyle:{gap:10,paddingBottom:6},keyboardShouldPersistTaps:"handled",children:[0===M.length?(0,S.jsxs)(p.default,{style:{gap:8},children:[(0,S.jsxs)(m.T,{children:["Hi ",W.split(' ')[0],". Type or tap \ud83c\udfa4 and say what you need. I\u2019ll show you what I\u2019m about to do and wait for you to confirm. I never send, pay or delete."]}),P.map(e=>(0,S.jsx)(u.default,{accessibilityRole:"button",onPress:()=>te(e),style:{borderWidth:1,borderColor:w.colours.border,borderRadius:12,paddingVertical:9,paddingHorizontal:12,backgroundColor:w.colours.surface2},children:(0,S.jsx)(m.T,{size:14,children:e})},e))]}):null,M.map(e=>'you'===e.from?(0,S.jsx)(p.default,{style:{alignSelf:'flex-end',maxWidth:'85%',backgroundColor:'#3A2F12',borderRadius:14,padding:10},children:(0,S.jsx)(m.T,{children:e.text})},e.id):e.plan?(0,S.jsxs)(p.default,{testID:"chef-confirm-card",style:{borderWidth:1.5,borderColor:'open'===e.state?w.colours.gold:w.colours.border,borderRadius:14,padding:12,gap:8,backgroundColor:w.colours.surface2},children:[(0,S.jsx)(m.T,{weight:"semibold",children:e.plan.title}),(0,S.jsx)(m.T,{size:14,colour:w.colours.muted,children:e.plan.detail}),e.plan.warn?(0,S.jsxs)(m.T,{size:13,colour:w.colours.amber,children:["\u26a0 ",e.plan.warn]}):null,'open'===e.state?(0,S.jsxs)(m.Row,{gap:8,children:[(0,S.jsx)(m.Button,{small:!0,testID:"chef-confirm",label:e.plan.confirm,onPress:()=>ne(e)}),(0,S.jsx)(m.Button,{small:!0,kind:"ghost",label:"Cancel",onPress:()=>ie(e)})]}):(0,S.jsx)(m.Badge,{kind:'done'===e.state?'ok':'neutral',label:'done'===e.state?'Confirmed':'Cancelled: nothing done'}),'open'===e.state?(0,S.jsxs)(m.Muted,{children:["Nothing happens until you tap ",e.plan.confirm,"."]}):null]},e.id):(0,S.jsx)(p.default,{testID:"chef-assistant-reply",style:{alignSelf:'flex-start',maxWidth:'92%',backgroundColor:w.colours.surface2,borderRadius:14,padding:10},children:(0,S.jsx)(m.T,{children:e.text})},e.id))]}),(0,S.jsxs)(m.Row,{gap:8,children:[(0,S.jsx)(t.TextInput,{testID:"chef-assistant-input",accessibilityLabel:"Ask the Assistant",placeholder:"Type a kitchen task\u2026",placeholderTextColor:"#7D776C",value:N,onChangeText:e=>{_(e),e||q(!1)},onSubmitEditing:re,returnKeyType:"send",style:[m.styles.input,{flex:1,minWidth:0,width:40}]}),(0,S.jsx)(u.default,{testID:"chef-assistant-mic",accessibilityRole:"button",accessibilityLabel:V?'Stop listening':'Speak',onPress:()=>{const e=z();if(e)if(V)U.current?.stop?.();else try{const t=new e;U.current=t,t.lang='en-GB',t.interimResults=!1,t.maxAlternatives=1,t.onresult=e=>{const t=e.results?.[0]?.[0]?.transcript;t&&(_(t),q(!0))},t.onend=()=>K(!1),t.onerror=()=>{K(!1),J('Sorry, I didn\u2019t catch that. You can type instead.')},K(!0),t.start()}catch{K(!1),J('Voice input isn\u2019t available here. Please type instead.')}else J('Voice input isn\u2019t available in this browser. Please type instead.')},style:{width:48,height:48,borderRadius:24,borderWidth:1.5,borderColor:w.colours.gold,alignItems:'center',justifyContent:'center',backgroundColor:V?w.colours.gold:'transparent'},children:(0,S.jsx)(m.T,{size:20,children:"\ud83c\udfa4"})}),(0,S.jsx)(m.Button,{label:"Send",disabled:!N.trim(),onPress:re})]}),(0,S.jsx)(m.Muted,{center:!0,children:"Every action waits for your Confirm \xb7 nothing is sent, paid or deleted"})]})})})};var t=_r(_d[0]),n=_r(_d[1]),r=_r(_d[2]),s=_r(_d[3]),a=_r(_d[4]),o=_r(_d[5]),l=_r(_d[6]),d=_r(_d[7]),c=e(_r(_d[8]));_r(_d[9]);var u=e(_r(_d[10])),h=e(_r(_d[11])),p=e(_r(_d[12])),f=_r(_d[13]),m=_r(_d[14]),b=_r(_d[15]),y=_r(_d[16]),x=_r(_d[17]),j=_r(_d[18]),v=_r(_d[19]),w=_r(_d[20]),$=_r(_d[21]),C=_r(_d[22]),T=_r(_d[23]),k=_r(_d[24]),S=_r(_d[25]);const I=(0,f.create)(e=>({open:!1,setOpen:t=>e({open:t})})),R=()=>Math.random().toString(36).slice(2,9),P=['Draft a recipe card for crab linguine','Build the fish order','What allergens are in the fish and chips?','What price gives 70% GP on the lobster?','Walk-in fridge 3.5 degrees'],O='The secure AI server: not set up yet',A=e=>e.toLowerCase().replace(/[^a-z0-9 ]/g,' ').replace(/\s+/g,' ').trim(),W=new Set(['the','and','with','for','our','house','served','side','of','in','on','from']);function D(e,t,n){const r=` ${A(e)} `;let s,a=0;for(const e of t){const t=A(n(e).replace(/\(example\)/i,'')).split(' ').filter(e=>e.length>2&&!W.has(e)),o=t.filter(e=>r.includes(` ${e} `)||r.includes(` ${e}s `)).length,l=t.length?o/t.length+.01*o:0;o&&l>a&&(s=e,a=l)}return s}function z(){return'undefined'==typeof window?null:(0,l.speechRecognizer)()}},1235,[812,779,1207,820,943,17,890,1183,378,219,385,278,85,831,777,845,1002,851,867,1001,804,1140,1135,1163,891,8]); __d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"BOTTOM_TABS_HEIGHT",{enumerable:!0,get:function(){return h}}),_e.BottomTabs=function({tabs:e,active:b,onPress:y,background:x,tablist:p}){const{width:j}=(0,s.default)(),v=j/Math.max(1,e.length),w=v>=60?11:10,I=v<56?20:22,[F,S]=(0,t.useState)({}),[H,_]=(0,t.useState)(0),M=H>0&&e.some(e=>(F[e.id]??0)>H-6),z={flexDirection:'row',flexWrap:'nowrap',alignItems:'stretch',borderTopWidth:1,borderColor:c.colours.border,backgroundColor:x};return(0,f.jsx)(l.default,{testID:"app-bottom-tabs",accessibilityRole:p?'tablist':void 0,style:z,children:e.map(t=>{const s=b===t.id,x=s?c.colours.gold:c.colours.muted;return(0,f.jsxs)(n.default,{onLayout:t===e[0]?e=>_(e.nativeEvent.layout.width):void 0,testID:`tab-${t.id}`,accessibilityRole:"tab",accessibilityState:{selected:s},accessibilityLabel:t.a11y??t.label,onPress:()=>y(t.id),style:{flexGrow:1,flexShrink:1,flexBasis:0,minWidth:44,minHeight:h,alignItems:'center',justifyContent:'center',paddingVertical:4,paddingHorizontal:1,gap:2},children:[(0,f.jsxs)(l.default,{style:{width:I,height:I,alignItems:'center',justifyContent:'center'},children:[(0,f.jsx)(u.Icon,{name:t.icon,size:I,colour:x}),t.badge?(0,f.jsx)(l.default,{testID:t.badge.testID,style:{position:'absolute',right:-10,top:-5,backgroundColor:t.badge.bg,borderRadius:8,minWidth:16,height:16,paddingHorizontal:3,alignItems:'center',justifyContent:'center'},children:(0,f.jsx)(o.default,{style:{fontFamily:c.fonts.bold,fontSize:10,lineHeight:12,color:t.badge.fg??'#FFFFFF'},children:t.badge.text})}):null]}),(0,f.jsx)(l.default,{pointerEvents:"none","aria-hidden":!0,importantForAccessibility:"no-hide-descendants",accessibilityElementsHidden:!0,style:{position:'absolute',left:0,top:0,width:0,height:0,overflow:'hidden',opacity:0},children:(0,f.jsx)(l.default,{style:{width:400,flexDirection:'row',alignItems:'flex-start'},children:(0,f.jsx)(o.default,{onLayout:e=>{const n=Math.ceil(e.nativeEvent.layout.width);S(e=>e[t.id]===n?e:{...e,[t.id]:n})},style:{fontFamily:c.fonts.semibold,fontSize:w,lineHeight:Math.round(1.3*w),flexShrink:0},children:t.short??t.label})})}),M?null:(0,f.jsx)(o.default,{numberOfLines:1,style:{fontFamily:s?c.fonts.semibold:c.fonts.regular,fontSize:w,lineHeight:Math.round(1.3*w),color:x,textAlign:'center',alignSelf:'center',maxWidth:'100%'},children:t.short??t.label})]},t.id)})})};var t=r(d[0]),n=e(r(d[1])),o=e(r(d[2])),l=e(r(d[3])),s=e(r(d[4])),c=r(d[5]),u=r(d[6]),f=r(d[7]);const h=56},1236,[17,385,329,85,409,804,1184,8]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return f}});var t=r(d[0]);r(d[1]);var n=r(d[2]),u=r(d[3]),c=r(d[4]);function f(){return(0,u.canShow)('chef')?(0,c.jsx)(n.ChefApp,{}):(0,c.jsx)(t.Redirect,{href:u.ENTRY[u.APP_VARIANT]})}},1237,[13,17,775,856,8]); -__d(function(g,_r,_i,_a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return A}});var e,t=_r(d[0]),o=_r(d[1]),n=_r(d[2]),s=_r(d[3]),l=_r(d[4]),i=_r(d[5]),a=_r(d[6]),r=_r(d[7]),u=(e=r)&&e.__esModule?e:{default:e},c=_r(d[8]),h=_r(d[9]),p=_r(d[10]),b=_r(d[11]),f=_r(d[12]),y=_r(d[13]),x=_r(d[14]),k=_r(d[15]),j=_r(d[16]),v=_r(d[17]),S=_r(d[18]),w=_r(d[19]),T=_r(d[20]),C=_r(d[21]),D=_r(d[22]),$=_r(d[23]),P=_r(d[24]),M=_r(d[25]),B=_r(d[26]),O=_r(d[27]);function A(){const{rid:e,date:r}=(0,s.useLocalSearchParams)(),A=(0,j.useRestaurant)(e),N=(0,j.useCustomer)(),z=(0,j.useBookings)(e),I=(0,j.useEvents)(e),R=(0,j.useNow)(6e4),[q]=(0,l.useState)(()=>(0,a.startForm)()),[F,L]=(0,l.useState)(''),[E,H]=(0,l.useState)(2),[W,_]=(0,l.useState)(0),Y=Math.min(W,Math.max(0,E-1)),[U,G]=(0,l.useState)(r??(0,k.ymd)(R)),[Q,V]=(0,l.useState)(null),[J,K]=(0,l.useState)(N.name),[X,Z]=(0,l.useState)(N.phone??''),[ee,te]=(0,l.useState)(N.email??''),[oe,ne]=(0,l.useState)(!1),[se,le]=(0,l.useState)(''),[ie,ae]=(0,l.useState)(!1),[re,de]=(0,l.useState)([]),[ue,ce]=(0,l.useState)(!1),he=[...N.allergies,...re.filter(e=>!N.allergies.some(t=>t.allergen===e)).map(e=>({allergen:e,severity:'allergy'}))],[me,ge]=(0,l.useState)(null),pe=(0,C.useBlocks)(e=>e.blocks);(0,v.usePublicDayStore)(e=>e.n);const be=e?(0,v.publicDay)(e,U):null,fe=be?[...be.bookings,...z.filter(e=>e.date!==U)]:z,ye=be?[...pe.filter(t=>t.rid!==e||t.date!==U),...be.blocks]:pe,xe=(0,D.usePlan)(e),[ke,je]=(0,l.useState)((0,P.emptyNeeds)()),ve=!0===ke.dog,Se=ve?ke.dogs:0;if(!A)return(0,O.jsx)(b.Screen,{title:"Not found",children:(0,O.jsx)(b.T,{children:"Restaurant not found."})});const we=A.settings,Te=(0,k.parseYmd)(U),Ce=(0,x.onlinePartyBounds)(A),De=(0,C.blocksOn)(ye,A.id,U),$e=fe.filter(e=>e.date===U),Pe=xe.areas.filter(e=>e.dogs),Me=(0,M.dogSetUp)(xe),Be=e=>(0,$.freeTablesAt)(xe,$e,E,new Date(`${U}${(0,t.tableNumbers)(e)}:00`),(0,$.turnFor)(E,we.turnMins),we.turnMins,{dog:!0,closed:(0,C.closedAreasAt)(ye,A.id,U,e)}),Oe=(0,x.bookingSlots)(A,Te,e=>fe.filter(t=>t.date===U&&t.time===e&&!['cancelled','noshow'].includes(t.status)).reduce((e,t)=>e+t.partySize,0),E,R,e=>fe.filter(t=>t.date===U&&t.time===e&&!['cancelled','noshow'].includes(t.status)).length).map(e=>{const t=(0,C.blockAt)(ye,A.id,U,e.time),o=ve&&Me&&e.available&&!t&&(!Be(e.time).length||!(0,P.dogTimeOk)(A,fe,U,e.time,Se));return{...e,blocked:!!t,noDog:o,available:e.available&&!t&&!o}}),Ae=Oe.some(e=>e.available),Ne=(0,c.depositOf)(we),ze=(0,c.depositDue)(Ne,E,Y),Ie=ze>0?'deposit':'none',Re=(0,c.depositWords)(Ne,E,A.name,Y),qe=I.filter(e=>e.date===U),Fe=(0,T.guestPhone)(X),Le=(0,T.emailOk)(ee),Ee=(0,P.needsMissing)(ke,N.allergies),He=!!Q&&ie&&!Ee.length&&J.trim().length>1&&Fe.ok&&Le,We=async()=>{const e=(0,P.needsPatch)(ke,N.allergies),t=ve&&Me?Be(Q).map(e=>e.table):[],o=ve?ke.tableReq.find(e=>t.includes(e))??t[0]:void 0,n=await j.repo.bookings.create({restaurantId:A.id,customerId:N.id,name:J,partySize:E,...Y?{children:Y}:{},date:U,time:Q,notes:se.trim(),security:Ie,depositPaid:0,...ze?{depositDue:ze,depositPolicy:Re.join(' '),depositRefundable:Ne.refundable,depositCutoffHours:Ne.cutoffHours}:{},phone:Fe.pretty,email:ee.trim()||void 0,source:'online',...e,...Oe.find(e=>e.time===Q)?.drinksOnly?{drinksOnly:!0}:{},allergies:e.allergies??he,...o?{table:o}:{}});(0,a.rememberGuard)(n.id,(0,a.guardFor)({...q,hp:F})),ge(n)},Ye=(0,j.useStore)(e=>me?e.bookings.find(e=>e.id===me.id)?.ref:void 0),Ue=e=>(0,w.waMeLink)(A.settings.whatsapp,(0,w.guestWhatsAppText)({name:e.name,ref:Ye??e.ref,date:e.date,time:e.time,partySize:e.partySize},A.name));if(me){const e='pending'===me.status;return(0,O.jsxs)(b.Screen,{title:e?'Booking request received':'Booking confirmed',subtitle:A.name,children:[(0,O.jsx)(b.Banner,{kind:e?'info':'success',title:`Reference ${Ye??me.ref}`,children:`${me.partySize} people \xb7 ${(0,k.niceDateYear)((0,k.parseYmd)(me.date))} at ${me.time}`}),e?(0,O.jsx)(b.Banner,{kind:"warn",title:"The team will confirm shortly",children:"For larger parties and special requests, a member of the team checks your booking first. Contact the venue if you need an update."}):null,(0,O.jsxs)(b.Card,{children:[(0,O.jsxs)(b.T,{children:["Name: ",me.name]}),(0,O.jsxs)(b.T,{children:["Mobile: ",me.phone]}),me.email?(0,O.jsxs)(b.T,{children:["Email: ",me.email]}):null,(0,O.jsxs)(b.T,{children:["Allergies shared with the restaurant: ",me.allergies.length?me.allergies.map(e=>`${(0,f.allergenLabel)(e.allergen)} (${(0,f.severityLabel)(e.severity)})`).join(', '):'none']}),me.notes?(0,O.jsxs)(b.T,{children:["Notes: ",me.notes]}):null,me.dog?(0,O.jsxs)(b.T,{children:["\ud83d\udc15 Dog coming too",me.table?` \xb7 dog-friendly table ${me.table}`:'']}):null,me.holds?.length?(0,O.jsxs)(b.T,{children:["Reserved: ",me.holds.map(e=>`${e.qty} \xd7 ${'item'===e.kind?(A.settings.reservables??M.ANCHORAGE_RESERVABLES).find(t=>t.id===e.id)?.name??'item':e.id}`).join(', ')," (the kitchen confirms it)"]}):null,me.tableReq?.length?(0,O.jsxs)(b.T,{children:["Table requested: ",me.tableReq.map(e=>`${(0,t.tableNumbers)(e)}`).join(' or ')," (not guaranteed, but we\u2019ll do our best)"]}):null,'deposit'===me.security&&me.depositDue?(0,O.jsxs)(b.T,{weight:"semibold",children:["Deposit due: ",(0,y.gbp)(me.depositDue),". ",A.name," will tell you how to pay it."]}):null,'deposit'===me.security&&me.depositPolicy?(0,O.jsx)(b.Muted,{children:me.depositPolicy}):null,(0,O.jsx)(b.Muted,{children:"Your booking details are shown above. If you need confirmation, contact the venue and quote your reference."}),(0,O.jsxs)(b.Muted,{children:["Need to change or cancel? Call ",A.phone," and quote ",Ye??me.ref,"."]})]}),Ue(me)?(0,O.jsxs)(u.default,{style:{gap:4},children:[(0,O.jsx)(b.Button,{kind:"secondary",label:"\ud83d\udcac Message us on WhatsApp",testID:"guest-whatsapp",onPress:()=>{const e=Ue(me);e&&(0,w.openWhatsApp)(e)}}),(0,O.jsx)(b.Muted,{size:13,children:"Opens WhatsApp with your booking details typed in. You can change the message before you send it."})]}):null,(0,O.jsx)(b.Button,{label:"Back to restaurant",onPress:()=>s.router.replace(`/customer/${A.id}`)})]})}return(0,O.jsxs)(b.Screen,{title:"Book a table",subtitle:A.name,footer:(0,O.jsx)(b.Button,{label:Ee.length?Ee[0]:E>(we.autoAcceptUpTo??7)?'Send booking request':'Confirm booking',disabled:!He,onPress:()=>We(),testID:"confirm-booking"}),children:[(0,O.jsx)(P.FirstQuestions,{rid:A.id,value:ke,onChange:e=>{e.dog===ke.dog&&e.dogs===ke.dogs||V(null),je(e)},party:E,audience:"guest",profile:N.allergies}),(0,O.jsxs)(b.Card,{children:[(0,O.jsxs)(u.default,{style:{gap:6,alignItems:'center'},children:[(0,O.jsx)(b.H2,{children:"Party size"}),(0,O.jsx)(o.PartySizeInput,{value:E,onChange:e=>{H(e),V(null)},min:Ce.min,max:Ce.max,label:"Party size",testID:"party-size"})]}),(0,O.jsx)(h.ChildrenCount,{guest:!0,party:E,value:Y,onChange:_,depositsOn:Ne.on&&Ne.perPersonPence>0,testID:"book-children"}),ze?(0,O.jsx)(b.Banner,{kind:"info",title:Y?`Deposit: ${(0,y.gbp)(ze)} for ${E-Y} adults (children free)`:`Deposit: ${(0,y.gbp)(ze)} for ${E} guests`,children:(0,O.jsx)(u.default,{style:{gap:4},children:Re.map(e=>(0,O.jsx)(b.T,{size:13,children:e},e))})}):Ne.on&&Ne.perPersonPence>0?(0,O.jsxs)(b.Muted,{children:["No deposit for fewer than ",Ne.fromParty," guests."]}):null,E>(we.autoAcceptUpTo??7)?(0,O.jsxs)(b.Muted,{children:["For ",E," people the team checks the booking first, then texts you to confirm."]}):null,ve&&Me?(0,O.jsxs)(b.Muted,{children:["Dogs are welcome in the ",Pe.map(e=>`${e.name}${e.outdoor?' (outdoors, weather permitting)':''}`).join(' and ')||'dog-friendly tables',". We\u2019ll only show times with a dog-friendly table",A.settings.maxDogsPerSlot?' and room for your dog':'',"."]}):null]}),(0,O.jsxs)(b.Card,{children:[(0,O.jsx)(b.H2,{children:"Date"}),(0,O.jsx)(B.CustomerDatePicker,{r:A,today:R,value:U,events:I,onChange:e=>{G(e),V(null)}}),qe.map(e=>(0,O.jsx)(b.Banner,{kind:"demo",title:e.title,children:e.description},e.id))]}),(0,O.jsxs)(b.Card,{children:[(0,O.jsx)(b.H2,{children:"Time"}),0===Oe.length?(0,O.jsx)(b.Muted,{children:"Closed on this day (per listed kitchen hours)."}):(0,O.jsx)(b.Row,{wrap:!0,gap:6,children:Oe.map(e=>(0,O.jsx)(b.Chip,{testID:`book-slot-${e.time}`,label:e.time,sub:e.available?e.drinksOnly?'Drinks only':void 0:e.blocked?'Unavailable':e.noDog?'No dog table':e.leftV(e.time)},e.time))}),De.length>0&&Oe.some(e=>e.blocked)?(0,O.jsx)(b.Banner,{kind:"info",title:Ae?'Some times aren\u2019t available online':'Online booking isn\u2019t available for this time',children:`We\u2019re not taking online bookings ${De.map(e=>`${e.from}\u2013${e.to}`).join(', ')} on ${(0,k.niceDate)(Te)}. Please give us a ring on ${A.phone??"the restaurant"} and we\u2019ll do our best to fit you in.`}):null,(()=>{const e=(0,n.lastFoodOn)(A,U);return e&&Oe.some(e=>e.drinksOnly)?(0,O.jsx)(b.Banner,{kind:"info",title:`Last food orders ${(0,n.fmt12)(e.time)}${'kitchen closes'!==e.reason?` (${e.reason})`:''}`,children:"Times marked \u201cDrinks only\u201d are after the kitchen\u2019s last food orders that day: you\u2019re welcome for drinks, but we can\u2019t serve food."}):null})(),ve&&Oe.some(e=>e.noDog)?(0,O.jsx)(b.Banner,{kind:"info",title:"Some times are full for dogs",children:`Times marked "No dog table" are full in the ${Pe.map(e=>e.name).join(' and ')}${A.settings.maxDogsPerSlot?' or already have the most dogs we can look after':''}${(0,C.closedAreasAt)(ye,A.id,U,Q??'12:00').size?', or the garden is closed for weather':''}. We\u2019d love to see you both, so please try one of the other times shown.`}):null,(0,O.jsx)(b.Muted,{children:(0,x.bookingLimitsHint)(A)})]}),(0,O.jsx)(P.MoreQuestions,{rid:A.id,r:A,value:ke,onChange:je,party:E,date:U,time:Q,today:(0,k.ymd)(R),bookings:fe,audience:"guest",showTables:!0}),(0,O.jsxs)(b.Card,{highlight:ie?void 0:S.colours.amber,children:[(0,O.jsx)(b.Field,{label:"Notes (optional)",value:se,onChangeText:le,placeholder:p.NOTES_PLACEHOLDER,multiline:!0,numberOfLines:3,testID:"book-notes"}),(0,O.jsx)(b.Toggle,{label:"I confirm the allergy information for this booking",value:ie,onChange:ae}),(0,O.jsx)(b.Muted,{children:"Table requests aren\u2019t guaranteed, but we\u2019ll do our best. Nothing here is charged now; reserved dishes are paid on the night."})]}),(0,O.jsxs)(b.Card,{children:[(0,O.jsx)(b.H2,{children:"Your details"}),(0,O.jsx)(b.Field,{label:"Name for the booking",value:J,onChangeText:K}),(0,O.jsx)(b.Field,{testID:"book-phone",label:"Mobile number (needed to book)",value:X,onChangeText:Z,onBlur:()=>ne(!0),keyboardType:"phone-pad",autoComplete:"tel",placeholder:"e.g. 07700 900123"}),Fe.ok||!oe&&!X?null:(0,O.jsx)(b.T,{size:13,colour:S.colours.amber,children:Fe.error}),(0,O.jsx)(b.Field,{testID:"book-email",label:"Email (optional)",value:ee,onChangeText:te,keyboardType:"email-address",autoCapitalize:"none",autoComplete:"email",placeholder:"you@example.com"}),Le?null:(0,O.jsx)(b.T,{size:13,colour:S.colours.amber,children:"That email doesn\u2019t look quite right. Check it, or leave it blank."}),(0,O.jsxs)(b.Muted,{children:["We\u2019ll text you a confirmation",ee.trim()?' and email it too':'',", with how to change or cancel. We only use your number for this booking."]})]}),(0,O.jsx)(i.Honeypot,{value:F,onChange:L})]})}},1238,[843,1095,861,13,17,1239,963,85,841,1240,1108,777,845,851,1101,863,858,946,804,1181,848,993,996,1074,1103,1053,1241,8]); +__d(function(g,_r,_i,_a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return A}});var e,t=_r(d[0]),o=_r(d[1]),n=_r(d[2]),s=_r(d[3]),a=_r(d[4]),l=_r(d[5]),i=_r(d[6]),r=_r(d[7]),u=(e=r)&&e.__esModule?e:{default:e},c=_r(d[8]),h=_r(d[9]),p=_r(d[10]),b=_r(d[11]),f=_r(d[12]),y=_r(d[13]),x=_r(d[14]),k=_r(d[15]),j=_r(d[16]),v=_r(d[17]),w=_r(d[18]),S=_r(d[19]),C=_r(d[20]),T=_r(d[21]),D=_r(d[22]),$=_r(d[23]),P=_r(d[24]),M=_r(d[25]),B=_r(d[26]),O=_r(d[27]);function A(){const{rid:e,date:r}=(0,s.useLocalSearchParams)(),A=(0,j.useRestaurant)(e),N=(0,j.useCustomer)(),z=(0,j.useBookings)(e),I=(0,j.useEvents)(e),R=(0,j.useNow)(6e4),[q]=(0,a.useState)(()=>(0,i.startForm)()),[F,L]=(0,a.useState)(''),[E,H]=(0,a.useState)(2),[W,_]=(0,a.useState)(0),Y=Math.min(W,Math.max(0,E-1)),[U,G]=(0,a.useState)(r??(0,k.ymd)(R)),[Q,V]=(0,a.useState)(null),[J,K]=(0,a.useState)(N.name),[X,Z]=(0,a.useState)(N.phone??''),[ee,te]=(0,a.useState)(N.email??''),[oe,ne]=(0,a.useState)(!1),[se,ae]=(0,a.useState)(''),[le,ie]=(0,a.useState)(!1),[re,de]=(0,a.useState)([]),[ue,ce]=(0,a.useState)(!1),he=[...N.allergies,...re.filter(e=>!N.allergies.some(t=>t.allergen===e)).map(e=>({allergen:e,severity:'allergy'}))],[me,ge]=(0,a.useState)(null),pe=(0,T.useBlocks)(e=>e.blocks);(0,v.usePublicDayStore)(e=>e.n);const be=e?(0,v.publicDay)(e,U):null,fe=be?[...be.bookings,...z.filter(e=>e.date!==U)]:z,ye=be?[...pe.filter(t=>t.rid!==e||t.date!==U),...be.blocks]:pe,xe=(0,D.usePlan)(e),[ke,je]=(0,a.useState)((0,P.emptyNeeds)()),ve=!0===ke.dog,we=ve?ke.dogs:0;if(!A)return(0,O.jsx)(b.Screen,{title:"Not found",children:(0,O.jsx)(b.T,{children:"Restaurant not found."})});const Se=A.settings,Ce=(0,k.parseYmd)(U),Te=(0,x.onlinePartyBounds)(A),De=(0,T.blocksOn)(ye,A.id,U),$e=fe.filter(e=>e.date===U),Pe=xe.areas.filter(e=>e.dogs),Me=(0,M.dogSetUp)(xe),Be=e=>(0,$.freeTablesAt)(xe,$e,E,new Date(`${U}${(0,t.tableNumbers)(e)}:00`),(0,$.turnFor)(E,Se.turnMins),Se.turnMins,{dog:!0,closed:(0,T.closedAreasAt)(ye,A.id,U,e)}),Oe=(0,x.bookingSlots)(A,Ce,e=>fe.filter(t=>t.date===U&&t.time===e&&!['cancelled','noshow'].includes(t.status)).reduce((e,t)=>e+t.partySize,0),E,R,e=>fe.filter(t=>t.date===U&&t.time===e&&!['cancelled','noshow'].includes(t.status)).length).map(e=>{const t=(0,T.blockAt)(ye,A.id,U,e.time),o=ve&&Me&&e.available&&!t&&(!Be(e.time).length||!(0,P.dogTimeOk)(A,fe,U,e.time,we));return{...e,blocked:!!t,noDog:o,available:e.available&&!t&&!o}}),Ae=Oe.some(e=>e.available),Ne=(0,c.depositOf)(Se),ze=(0,c.depositDue)(Ne,E,Y),Ie=ze>0?'deposit':'none',Re=(0,c.depositWords)(Ne,E,A.name,Y),qe=I.filter(e=>e.date===U),Fe=(0,C.guestPhone)(X),Le=(0,C.emailOk)(ee),Ee=(0,P.needsMissing)(ke,N.allergies),He=!!Q&&le&&!Ee.length&&J.trim().length>1&&Fe.ok&&Le,We=async()=>{const e=(0,P.needsPatch)(ke,N.allergies),t=ve&&Me?Be(Q).map(e=>e.table):[],o=ve?ke.tableReq.find(e=>t.includes(e))??t[0]:void 0,n=await j.repo.bookings.create({restaurantId:A.id,customerId:N.id,name:J,partySize:E,...Y?{children:Y}:{},date:U,time:Q,notes:se.trim(),security:Ie,depositPaid:0,...ze?{depositDue:ze,depositPolicy:Re.join(' '),depositRefundable:Ne.refundable,depositCutoffHours:Ne.cutoffHours}:{},phone:Fe.pretty,email:ee.trim()||void 0,source:'online',...e,...Oe.find(e=>e.time===Q)?.drinksOnly?{drinksOnly:!0}:{},allergies:e.allergies??he,...o?{table:o}:{}});(0,i.rememberGuard)(n.id,(0,i.guardFor)({...q,hp:F})),ge(n)},Ye=(0,j.useStore)(e=>me?e.bookings.find(e=>e.id===me.id)?.ref:void 0),Ue=e=>(0,S.waMeLink)(A.settings.whatsapp,(0,S.guestWhatsAppText)({name:e.name,ref:Ye??e.ref,date:e.date,time:e.time,partySize:e.partySize},A.name));if(me){const e='pending'===me.status;return(0,O.jsxs)(b.Screen,{title:e?'Booking request received':'Booking confirmed',subtitle:A.name,children:[(0,O.jsx)(b.Banner,{kind:e?'info':'success',title:`Reference ${Ye??me.ref}`,children:`${me.partySize} people \xb7 ${(0,k.niceDateYear)((0,k.parseYmd)(me.date))} at ${me.time}`}),e?(0,O.jsx)(b.Banner,{kind:"warn",title:"The team will confirm shortly",children:"For larger parties and special requests, a member of the team checks your booking first. Contact the venue if you need an update."}):null,(0,O.jsxs)(b.Card,{children:[(0,O.jsxs)(b.T,{children:["Name: ",me.name]}),(0,O.jsxs)(b.T,{children:["Mobile: ",me.phone]}),me.email?(0,O.jsxs)(b.T,{children:["Email: ",me.email]}):null,(0,O.jsxs)(b.T,{children:["Allergies shared with the restaurant: ",me.allergies.length?me.allergies.map(e=>`${(0,f.allergenLabel)(e.allergen)} (${(0,f.severityLabel)(e.severity)})`).join(', '):'none']}),me.notes?(0,O.jsxs)(b.T,{children:["Notes: ",me.notes]}):null,me.dog?(0,O.jsxs)(b.T,{children:["\ud83d\udc15 Dog coming too",me.table?` \xb7 dog-friendly table ${me.table}`:'']}):null,me.holds?.length?(0,O.jsxs)(b.T,{children:["Reserved: ",me.holds.map(e=>`${e.qty} \xd7 ${'item'===e.kind?(A.settings.reservables??M.ANCHORAGE_RESERVABLES).find(t=>t.id===e.id)?.name??'item':e.id}`).join(', ')," (the kitchen confirms it)"]}):null,me.tableReq?.length?(0,O.jsxs)(b.T,{children:["Table requested: ",me.tableReq.map(e=>`${(0,t.tableNumbers)(e)}`).join(' or ')," (not guaranteed, but we\u2019ll do our best)"]}):null,'deposit'===me.security&&me.depositDue?(0,O.jsxs)(b.T,{weight:"semibold",children:["Deposit due: ",(0,y.gbp)(me.depositDue),". ",A.name," will tell you how to pay it."]}):null,'deposit'===me.security&&me.depositPolicy?(0,O.jsx)(b.Muted,{children:me.depositPolicy}):null,(0,O.jsx)(b.Muted,{children:"Your booking details are shown above. If you need confirmation, contact the venue and quote your reference."}),(0,O.jsxs)(b.Muted,{children:["Need to change or cancel? Call ",A.phone," and quote ",Ye??me.ref,"."]})]}),Ue(me)?(0,O.jsxs)(u.default,{style:{gap:4},children:[(0,O.jsx)(b.Button,{kind:"secondary",label:"\ud83d\udcac Message us on WhatsApp",testID:"guest-whatsapp",onPress:()=>{const e=Ue(me);e&&(0,S.openWhatsApp)(e)}}),(0,O.jsx)(b.Muted,{size:13,children:"Opens WhatsApp with your booking details typed in. You can change the message before you send it."})]}):null,(0,O.jsx)(b.Button,{label:"Back to restaurant",onPress:()=>s.router.replace(`/customer/${A.id}`)})]})}return(0,O.jsxs)(b.Screen,{title:"Book a table",subtitle:A.name,footer:(0,O.jsx)(b.Button,{label:Ee.length?Ee[0]:E>(Se.autoAcceptUpTo??7)?'Send booking request':'Confirm booking',disabled:!He,onPress:()=>We(),testID:"confirm-booking"}),children:[(0,O.jsx)(P.FirstQuestions,{rid:A.id,value:ke,onChange:e=>{e.dog===ke.dog&&e.dogs===ke.dogs||V(null),je(e)},party:E,audience:"guest",profile:N.allergies}),(0,O.jsxs)(b.Card,{children:[(0,O.jsxs)(u.default,{style:{gap:6,alignItems:'center'},children:[(0,O.jsx)(b.H2,{children:"Party size"}),(0,O.jsx)(o.PartySizeInput,{value:E,onChange:e=>{H(e),V(null)},min:Te.min,max:Te.max,label:"Party size",testID:"party-size"})]}),(0,O.jsx)(h.ChildrenCount,{guest:!0,party:E,value:Y,onChange:_,depositsOn:Ne.on&&Ne.perPersonPence>0,testID:"book-children"}),ze?(0,O.jsx)(b.Banner,{kind:"info",title:Y?`Deposit: ${(0,y.gbp)(ze)} for ${E-Y} adults (children don't count towards the ${Ne.fromParty} and don't pay)`:`Deposit: ${(0,y.gbp)(ze)} for ${E} adults`,children:(0,O.jsx)(u.default,{style:{gap:4},children:Re.map(e=>(0,O.jsx)(b.T,{size:13,children:e},e))})}):Ne.on&&Ne.perPersonPence>0?(0,O.jsxs)(b.Muted,{children:["No deposit for fewer than ",Ne.fromParty," adults. Children don't count towards the ",Ne.fromParty," and don't pay, and staff can waive a deposit."]}):null,E>(Se.autoAcceptUpTo??7)?(0,O.jsxs)(b.Muted,{children:["For ",E," people the team checks the booking first, then texts you to confirm."]}):null,ve&&Me?(0,O.jsxs)(b.Muted,{children:["Dogs are welcome in the ",Pe.map(e=>`${e.name}${e.outdoor?' (outdoors, weather permitting)':''}`).join(' and ')||'dog-friendly tables',". We\u2019ll only show times with a dog-friendly table",A.settings.maxDogsPerSlot?' and room for your dog':'',"."]}):null]}),(0,O.jsxs)(b.Card,{children:[(0,O.jsx)(b.H2,{children:"Date"}),(0,O.jsx)(B.CustomerDatePicker,{r:A,today:R,value:U,events:I,onChange:e=>{G(e),V(null)}}),qe.map(e=>(0,O.jsx)(b.Banner,{kind:"demo",title:e.title,children:e.description},e.id))]}),(0,O.jsxs)(b.Card,{children:[(0,O.jsx)(b.H2,{children:"Time"}),0===Oe.length?(0,O.jsx)(b.Muted,{children:"Closed on this day (per listed kitchen hours)."}):(0,O.jsx)(b.Row,{wrap:!0,gap:6,children:Oe.map(e=>(0,O.jsx)(b.Chip,{testID:`book-slot-${e.time}`,label:e.time,sub:e.available?e.drinksOnly?'Drinks only':void 0:e.blocked?'Unavailable':e.noDog?'No dog table':e.leftV(e.time)},e.time))}),De.length>0&&Oe.some(e=>e.blocked)?(0,O.jsx)(b.Banner,{kind:"info",title:Ae?'Some times aren\u2019t available online':'Online booking isn\u2019t available for this time',children:`We\u2019re not taking online bookings ${De.map(e=>`${e.from}\u2013${e.to}`).join(', ')} on ${(0,k.niceDate)(Ce)}. Please give us a ring on ${A.phone??"the restaurant"} and we\u2019ll do our best to fit you in.`}):null,(()=>{const e=(0,n.lastFoodOn)(A,U);return e&&Oe.some(e=>e.drinksOnly)?(0,O.jsx)(b.Banner,{kind:"info",title:`Last food orders ${(0,n.fmt12)(e.time)}${'kitchen closes'!==e.reason?` (${e.reason})`:''}`,children:"Times marked \u201cDrinks only\u201d are after the kitchen\u2019s last food orders that day: you\u2019re welcome for drinks, but we can\u2019t serve food."}):null})(),ve&&Oe.some(e=>e.noDog)?(0,O.jsx)(b.Banner,{kind:"info",title:"Some times are full for dogs",children:`Times marked "No dog table" are full in the ${Pe.map(e=>e.name).join(' and ')}${A.settings.maxDogsPerSlot?' or already have the most dogs we can look after':''}${(0,T.closedAreasAt)(ye,A.id,U,Q??'12:00').size?', or the garden is closed for weather':''}. We\u2019d love to see you both, so please try one of the other times shown.`}):null,(0,O.jsx)(b.Muted,{children:(0,x.bookingLimitsHint)(A)})]}),(0,O.jsx)(P.MoreQuestions,{rid:A.id,r:A,value:ke,onChange:je,party:E,date:U,time:Q,today:(0,k.ymd)(R),bookings:fe,audience:"guest",showTables:!0}),(0,O.jsxs)(b.Card,{highlight:le?void 0:w.colours.amber,children:[(0,O.jsx)(b.Field,{label:"Notes (optional)",value:se,onChangeText:ae,placeholder:p.NOTES_PLACEHOLDER,multiline:!0,numberOfLines:3,testID:"book-notes"}),(0,O.jsx)(b.Toggle,{label:"I confirm the allergy information for this booking",value:le,onChange:ie}),(0,O.jsx)(b.Muted,{children:"Table requests aren\u2019t guaranteed, but we\u2019ll do our best. Nothing here is charged now; reserved dishes are paid on the night."})]}),(0,O.jsxs)(b.Card,{children:[(0,O.jsx)(b.H2,{children:"Your details"}),(0,O.jsx)(b.Field,{label:"Name for the booking",value:J,onChangeText:K}),(0,O.jsx)(b.Field,{testID:"book-phone",label:"Mobile number (needed to book)",value:X,onChangeText:Z,onBlur:()=>ne(!0),keyboardType:"phone-pad",autoComplete:"tel",placeholder:"e.g. 07700 900123"}),Fe.ok||!oe&&!X?null:(0,O.jsx)(b.T,{size:13,colour:w.colours.amber,children:Fe.error}),(0,O.jsx)(b.Field,{testID:"book-email",label:"Email (optional)",value:ee,onChangeText:te,keyboardType:"email-address",autoCapitalize:"none",autoComplete:"email",placeholder:"you@example.com"}),Le?null:(0,O.jsx)(b.T,{size:13,colour:w.colours.amber,children:"That email doesn\u2019t look quite right. Check it, or leave it blank."}),(0,O.jsxs)(b.Muted,{children:["We\u2019ll text you a confirmation",ee.trim()?' and email it too':'',", with how to change or cancel. We only use your number for this booking."]})]}),(0,O.jsx)(l.Honeypot,{value:F,onChange:L})]})}},1238,[843,1095,861,13,17,1239,963,85,841,1240,1108,777,845,851,1101,863,858,946,804,1181,848,993,996,1074,1103,1053,1241,8]); __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.Honeypot=function({value:t,onChange:n}){return(0,l.jsx)(o.default,{"aria-hidden":!0,pointerEvents:"none",style:{position:'absolute',left:-1e4,top:0,width:1,height:1,overflow:'hidden',opacity:0},children:(0,l.jsx)(e.TextInput,{testID:"hp-field",accessibilityLabel:"Leave this empty",value:t,onChangeText:n,tabIndex:-1,autoComplete:'off',name:'cc_extra_info','aria-hidden':!0})})};var e=r(d[0]);r(d[1]),r(d[2]);var t,n=r(d[3]),o=(t=n)&&t.__esModule?t:{default:t},l=r(d[4])},1239,[812,17,219,85,8]); -__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"maxChildren",{enumerable:!0,get:function(){return u}}),_e.ChildrenCount=function({party:e,value:t,onChange:o,depositsOn:h,testID:c="children-count",guest:p}){const f=u(e);if(f<1)return null;const x=Math.min(t,f);return(0,s.jsxs)(n.default,{style:{gap:6,alignItems:'center',width:'100%'},testID:c,children:[(0,s.jsx)(l.T,{size:17,weight:"semibold",center:!0,children:p?`How many of the ${e} are children?`:`Children in the ${e}`}),(0,s.jsx)(l.Stepper,{value:x,onChange:e=>o(Math.max(0,Math.min(f,e))),min:0,max:f,label:"children",testID:`${c}-stepper`,format:e=>e?String(e):'None'}),h?(0,s.jsx)(l.Muted,{center:!0,children:"Children never pay a deposit."}):null]})},r(d[0]);var e,t=r(d[1]),n=(e=t)&&e.__esModule?e:{default:e},l=r(d[2]),s=r(d[3]);const u=e=>Math.max(0,Math.round(Number(e)||0)-1)},1240,[17,85,777,8]); +__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"maxChildren",{enumerable:!0,get:function(){return o}}),_e.ChildrenCount=function({party:e,value:t,onChange:u,depositsOn:h,testID:c="children-count",guest:p}){const f=o(e);if(f<1)return null;const x=Math.min(t,f);return(0,s.jsxs)(n.default,{style:{gap:6,alignItems:'center',width:'100%'},testID:c,children:[(0,s.jsx)(l.T,{size:17,weight:"semibold",center:!0,children:p?`How many of the ${e} are children?`:`Children in the ${e}`}),(0,s.jsx)(l.Stepper,{value:x,onChange:e=>u(Math.max(0,Math.min(f,e))),min:0,max:f,label:"children",testID:`${c}-stepper`,format:e=>e?String(e):'None'}),h?(0,s.jsx)(l.Muted,{center:!0,children:"Children don't count towards the number that needs a deposit, and never pay."}):null]})},r(d[0]);var e,t=r(d[1]),n=(e=t)&&e.__esModule?e:{default:e},l=r(d[2]),s=r(d[3]);const o=e=>Math.max(0,Math.round(Number(e)||0)-1)},1240,[17,85,777,8]); __d(function(g,_r,_i,a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.CustomerDatePicker=function({r:e,today:m,value:D,events:x,onChange:f}){const p=(0,n.ymd)(m),j=(0,r.lastBookableDay)(p,e),[C,w]=(0,t.useState)(!1),[Y,k]=(0,t.useState)((0,i.slashDay)(D)),[I,P]=(0,t.useState)(D);I!==D&&(P(D),k((0,i.slashDay)(D)));const T=new Date(m);T.setHours(12,0,0,0);const $=Array.from({length:b},(e,t)=>{const s=new Date(T);return s.setDate(T.getDate()+t),s}).filter(e=>(0,n.ymd)(e)<=j),v=t=>!!(0,o.hoursFor)(e,t),F=(0,n.parseYmd)(D),[L,M]=(0,t.useState)(()=>({y:F.getFullYear(),m:F.getMonth()})),S=(new Date(L.y,L.m,1,12).getDay()+6)%7,R=new Date(L.y,L.m+1,0).getDate(),A=[...Array.from({length:S},()=>null),...Array.from({length:R},(e,t)=>new Date(L.y,L.m,t+1,12))];for(;A.length%7;)A.push(null);const z=(0,n.parseYmd)(j),W=L.y>m.getFullYear()||L.y===m.getFullYear()&&L.m>m.getMonth(),B=L.yM(({y:t,m:s})=>{const l=new Date(t,s+e,1);return{y:l.getFullYear(),m:l.getMonth()}}),_=Y===(0,i.slashDay)(D)?null:(0,r.typedBookDateProblem)(Y,p,e),O=e=>{f(e),w(!1)},G=(e,t)=>0===t?'Today':1===t?'Tomorrow':`${(0,n.dayShort)(e)} ${e.getDate()}`,N=$.some(e=>(0,n.ymd)(e)===D);return(0,h.jsxs)(l.default,{testID:"cust-date",style:{gap:10,alignItems:'center',width:'100%'},children:[(0,h.jsx)(l.default,{accessible:!0,accessibilityLiveRegion:"polite",testID:"cust-date-chosen",children:(0,h.jsx)(d.T,{center:!0,weight:"semibold",colour:c.colours.goldLight,children:`Booking for ${(0,n.niceDateYear)(F)}${v(F)?'':' (closed that day)'}`})}),(0,h.jsxs)(d.Row,{wrap:!0,gap:6,style:{justifyContent:'center'},children:[$.map((e,t)=>{const s=(0,n.ymd)(e),l=x.some(e=>e.date===s);return(0,h.jsx)(d.Chip,{testID:`cust-day-${s}`,label:G(e,t),sub:v(e)?l?'\u2605 event':void 0:'Closed',disabled:!v(e),selected:D===s,accessibilityLabel:`${(0,n.niceDate)(e)}${v(e)?l?', event':'':', closed'}`,onPress:()=>O(s)},s)}),N?null:(0,h.jsx)(d.Chip,{label:(0,n.niceDate)(F),sub:v(F)?void 0:'Closed',selected:!0,onPress:()=>w(!0),accessibilityLabel:`Chosen: ${(0,n.niceDateYear)(F)}. Opens the calendar`})]}),(0,h.jsxs)(l.default,{style:{width:'100%',maxWidth:360,gap:4},children:[(0,h.jsx)(d.Field,{label:"Any other date (DD/MM/YYYY)",testID:"cust-date-typed",value:Y,placeholder:"24/12/2026",keyboardType:"numbers-and-punctuation",maxLength:10,autoCapitalize:"none",autoCorrect:!1,style:{textAlign:'center'},accessibilityLabel:"Booking date, typed as day, month and four-digit year",onChangeText:t=>{const s=(0,i.slashDate)(t,Y);k(s);const l=(0,i.dayFromSlash)(s);l&&!(0,r.typedBookDateProblem)(s,p,e)&&f(l)}}),_&&Y.length>=10?(0,h.jsx)(d.T,{center:!0,size:15,colour:c.colours.amber,testID:"cust-date-problem",children:_}):null]}),(0,h.jsx)(d.Button,{kind:"secondary",label:C?'Hide calendar':'\ud83d\udcc5 Pick a date from a calendar',testID:"cust-date-cal",style:{minHeight:48},accessibilityLabel:C?'Hide the calendar':'Pick a date from a month calendar',onPress:()=>{C||M({y:F.getFullYear(),m:F.getMonth()}),w(!C)}}),C?(0,h.jsxs)(l.default,{testID:"cust-calendar",style:{borderWidth:1,borderColor:c.colours.border,borderRadius:14,padding:10,gap:6,backgroundColor:c.colours.surface2,width:'100%',maxWidth:420},children:[(0,h.jsx)(l.default,{style:{alignItems:'flex-end'},children:(0,h.jsx)(u.GoldClose,{label:"Close the calendar",testID:"cust-calendar-close",onPress:()=>w(!1),size:"sm"})}),(0,h.jsxs)(d.Row,{style:{justifyContent:'space-between',alignItems:'center'},children:[(0,h.jsx)(s.default,{accessibilityRole:"button",accessibilityLabel:"Previous month",accessibilityState:{disabled:!W},disabled:!W,onPress:()=>H(-1),style:{minWidth:48,minHeight:48,alignItems:'center',justifyContent:'center',opacity:W?1:.3},children:(0,h.jsx)(d.T,{size:22,colour:c.colours.gold,children:"\u2039"})}),(0,h.jsxs)(d.T,{center:!0,weight:"semibold",accessibilityRole:"header",children:[(0,n.monthLong)(L.m)," ",L.y]}),(0,h.jsx)(s.default,{accessibilityRole:"button",accessibilityLabel:"Next month",accessibilityState:{disabled:!B},disabled:!B,onPress:()=>H(1),style:{minWidth:48,minHeight:48,alignItems:'center',justifyContent:'center',opacity:B?1:.3},children:(0,h.jsx)(d.T,{size:22,colour:c.colours.gold,children:"\u203a"})})]}),(0,h.jsx)(l.default,{style:{flexDirection:'row'},importantForAccessibility:"no-hide-descendants",children:y.map(e=>(0,h.jsx)(d.T,{size:12,colour:c.colours.muted,center:!0,style:{flex:1},children:e},e))}),Array.from({length:A.length/7},(e,t)=>(0,h.jsx)(l.default,{style:{flexDirection:'row',gap:4},children:A.slice(7*t,7*t+7).map((e,t)=>{if(!e)return(0,h.jsx)(l.default,{style:{flex:1,height:44}},t);const o=(0,n.ymd)(e),i=oj,r=o===D,u=!v(e);return(0,h.jsx)(s.default,{testID:`cust-cal-${o}`,accessibilityRole:"button",accessibilityLabel:`${(0,n.niceDateYear)(e)}${i?', not bookable online':u?', closed':''}`,accessibilityState:{disabled:i||u,selected:r},disabled:i||u,onPress:()=>O(o),style:{flex:1,height:44,borderRadius:10,alignItems:'center',justifyContent:'center',borderWidth:o===p?1.5:0,borderColor:c.colours.gold,backgroundColor:r?c.colours.gold:'transparent',opacity:i?.3:1},children:(0,h.jsx)(d.T,{size:15,center:!0,weight:r?'bold':'regular',colour:r?c.colours.onGold:u?c.colours.muted:c.colours.text,style:u&&!i?{textDecorationLine:'line-through'}:void 0,children:e.getDate()})},t)})},t)),(0,h.jsxs)(d.Muted,{center:!0,children:["Crossed-out days: closed. ",(0,r.bookAheadUnlimited)(e)?`You can book up to ${(0,i.slashDay)(j)}.`:`Online booking is open up to ${(0,i.slashDay)(j)}.`]})]}):null]})};var t=_r(_d[0]),s=e(_r(_d[1])),l=e(_r(_d[2])),o=_r(_d[3]),n=_r(_d[4]),i=_r(_d[5]),r=_r(_d[6]),c=_r(_d[7]),d=_r(_d[8]),u=_r(_d[9]),h=_r(_d[10]);const y=['Mon','Tue','Wed','Thu','Fri','Sat','Sun'],b=14},1241,[17,385,85,862,863,1031,1242,804,777,779,8]); __d(function(g,_r,i,a,_m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"SERVER_MAX_DAYS_AHEAD",{enumerable:!0,get:function(){return n}}),e.bookAheadDays=r,Object.defineProperty(e,"bookAheadUnlimited",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"lastBookableDay",{enumerable:!0,get:function(){return u}}),e.typedBookDateProblem=function(n,r,o){const s=(n??'').trim();if(!s)return'Type a date as DD/MM/YYYY, for example 24/12/2026.';const l=(0,t.dayFromSlash)(s);if(!l)return'That isn\u2019t a date yet. Type it as DD/MM/YYYY, for example 24/12/2026.';if(lc){const[t,n,r]=c.split('-');return`Online booking is open up to ${r}/${n}/${t}. For later dates, please call us.`}return null};var t=_r(_d[0]);const n=366;function r(t){const r=Number(t?.settings?.onlineBookDaysAhead);return Number.isFinite(r)&&r>=1?Math.min(Math.round(r),n):n}const o=t=>r(t)>=n,s=(t,n)=>{const r=new Date(t+'T12:00:00Z');return r.setUTCDate(r.getUTCDate()+n),r.toISOString().slice(0,10)},u=(t,n)=>s(t,r(n))},1242,[1031]); __d(function(_g,_r,i,_a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return b}});var n=_r(_d[0]),t=_r(_d[1]),s=_r(_d[2]),a=e(_r(_d[3])),l=e(_r(_d[4])),r=_r(_d[5]),o=_r(_d[6]),d=_r(_d[7]),c=_r(_d[8]),u=_r(_d[9]),h=_r(_d[10]),g=_r(_d[11]),p=_r(_d[12]),f=_r(_d[13]);function b(){const{rid:e,did:b}=(0,t.useLocalSearchParams)(),j=(0,h.useRestaurant)(e),x=(0,h.useMenu)(e).find(e=>e.id===b),y=(0,h.useCustomer)(),m=(0,h.useRecipeCards)(e).find(e=>e.id===x?.recipeCardId),k=m?.signOff&&m.photo?(0,g.recipeCards)().photoSource(m.photo):null,v=(0,h.useStore)(e=>e.addLine),w=(0,n.useTakeawayMenu)(n=>n.byVenue[e]),S=(0,h.useStore)(n=>n.basket.restaurantId===e&&'table'===n.basket.mode),[C,B]=(0,s.useState)(()=>(x?.optionGroups??[]).filter(e=>e.required).map(e=>e.choices[0].id)),[$,I]=(0,s.useState)(1),[P,T]=(0,s.useState)(''),[L,O]=(0,s.useState)(!1),[D,A]=(0,s.useState)(!1),[M,R]=(0,s.useState)(!1),[q,_]=(0,s.useState)(!1),N=(0,s.useMemo)(()=>x?(0,c.effectiveAllergens)(x,C):{},[x,C]);if(!j||!x)return(0,f.jsx)(d.Screen,{title:"Not found",children:(0,f.jsx)(d.T,{children:"Dish not found."})});const G=(0,c.conflictsFor)(N,y.allergies),Y=(x.price??0)+(x.optionGroups??[]).flatMap(e=>e.choices).filter(e=>C.includes(e.id)).reduce((e,n)=>e+n.priceDelta,0),z=S||j.fictional?'on':(0,n.takeawayAvail)(x,w),F=x.soldOut||!x.signOff||null===x.price||'on'!==z,Q=(e,n)=>{const t=x.optionGroups.find(n=>n.id===e);B(e=>{const s=t.choices.map(e=>e.id);return t.multi?e.includes(n)?e.filter(e=>e!==n):[...e,n]:e.includes(n)&&!t.required?e.filter(e=>e!==n):[...e.filter(e=>!s.includes(e)),n]})},V=e=>{h.useStore.getState().basket.restaurantId!==j.id&&h.useStore.getState().startBasket(j.id,'takeaway'),v({itemId:x.id,qty:$,choiceIds:C,notes:P,override:e?{allergens:G.contains,at:(new Date).toISOString()}:void 0}),O(!1),_(!0)};return(0,f.jsxs)(d.Screen,{title:x.name,subtitle:j.name,right:(0,f.jsx)(o.BasketButton,{}),children:[k?(0,f.jsx)(a.default,{testID:"dish-photo",source:k,accessibilityLabel:`${x.name}${'example'===m?.origin?' (example photo)':''}`,style:{width:'100%',height:200,borderRadius:12},resizeMode:"cover"}):null,(0,f.jsxs)(d.Row,{wrap:!0,gap:6,children:[(0,f.jsx)(d.T,{weight:"bold",size:20,colour:p.colours.gold,children:null===x.price?x.priceNote:(0,u.gbp)(Y)}),x.dietary.map(e=>(0,f.jsx)(d.Badge,{kind:"ok",label:e},e))]}),(0,f.jsx)(d.T,{children:x.description}),G.contains.length?(0,f.jsx)(d.Banner,{kind:"danger",title:`Blocked: contains ${G.contains.map(c.allergenLabel).join(', ')}`,children:`You\u2019ve told us: ${y.allergies.filter(e=>G.contains.includes(e.allergen)).map(e=>`${(0,c.allergenLabel)(e.allergen)} \u2014 ${(0,c.severityLabel)(e.severity)}`).join('; ')}. This dish can\u2019t be added unless you deliberately override (for example, ordering for someone else).`}):null,G.may.length?(0,f.jsx)(d.Banner,{kind:"warn",title:`Warning: may contain ${G.may.map(c.allergenLabel).join(', ')}`,children:"Cross-contact is possible (e.g. shared fryer). Please speak to staff before ordering."}):null,(x.optionGroups??[]).map(e=>(0,f.jsxs)(d.Card,{children:[(0,f.jsxs)(d.T,{weight:"semibold",children:[e.name,e.required?' (required)':' (optional)']}),(0,f.jsx)(d.Row,{wrap:!0,gap:6,children:e.choices.map(n=>(0,f.jsx)(d.Chip,{label:n.label,sub:n.priceDelta?`+${(0,u.gbp)(n.priceDelta)}`:void 0,selected:C.includes(n.id),onPress:()=>Q(e.id,n.id)},n.id))})]},e.id)),(0,f.jsx)(d.Card,{children:(0,f.jsx)(r.AllergenPanel,{item:x,map:N,declared:y.allergies})}),j.fictional?null:(0,f.jsx)(d.AllergenNotice,{phone:j.phone}),(0,f.jsx)(d.Field,{label:"Notes for the kitchen (optional)",placeholder:"e.g. no gherkins",value:P,onChangeText:T}),(0,f.jsxs)(d.Row,{style:{justifyContent:'space-between'},children:[(0,f.jsx)(d.T,{weight:"semibold",children:"Quantity"}),(0,f.jsx)(d.Stepper,{value:$,onChange:I,label:"quantity"})]}),q?(0,f.jsx)(d.Banner,{kind:"success",title:"Added to basket",children:G.contains.length?'Allergy override recorded \u2014 the kitchen will see a large allergy alert.':'Carry on browsing or go to your basket.'}):null,F?(0,f.jsx)(d.Banner,{kind:"warn",children:x.soldOut||'sold-out'===z?'Sold out today.':'off'===z&&x.signOff&&null!==x.price?'This dish isn\u2019t on the takeaway menu. You can have it when you eat in.':x.signOff?'Price on the specials board \u2014 ask staff.':'Not available to order online until the head chef signs off its allergens.'}):G.contains.length?(0,f.jsxs)(l.default,{style:{gap:8},children:[(0,f.jsx)(d.Button,{kind:"secondary",label:"Choose something else",onPress:()=>t.router.back()}),(0,f.jsx)(d.Button,{kind:"danger",label:"Override and add anyway\u2026",onPress:()=>{A(!1),R(!1),O(!0)},testID:"override-open"})]}):(0,f.jsxs)(d.Row,{gap:8,children:[(0,f.jsx)(d.Button,{style:{flex:1},label:`Add ${$} to basket \xb7 ${(0,u.gbp)(Y*$)}`,onPress:()=>V(!1),testID:"add-to-basket"}),q?(0,f.jsx)(d.Button,{kind:"secondary",label:"Basket",onPress:()=>t.router.push('/customer/basket')}):null]}),(0,f.jsxs)(d.Sheet,{visible:L,onClose:()=>O(!1),title:"Allergy override",children:[(0,f.jsx)(d.Banner,{kind:"danger",title:`${x.name} contains ${G.contains.map(c.allergenLabel).join(', ')}`,children:`Your profile says: ${y.allergies.filter(e=>G.contains.includes(e.allergen)).map(e=>`${(0,c.allergenLabel)(e.allergen)} \u2014 ${(0,c.severityLabel)(e.severity)}`).join('; ')}.`}),(0,f.jsx)(d.Toggle,{label:"I understand this dish contains an allergen I have declared",value:D,onChange:A}),(0,f.jsx)(d.Toggle,{label:"It is for someone without this allergy, or I have spoken to staff",value:M,onChange:R}),(0,f.jsx)(d.Muted,{children:"The override is logged and shown to the kitchen as an allergy alert that must be acknowledged."}),(0,f.jsx)(d.Button,{kind:"danger",disabled:!D||!M,label:"Confirm override and add",onPress:()=>V(!0),testID:"override-confirm"})]})]})}},1243,[947,13,17,319,85,1216,1244,777,845,851,858,867,804,8]); @@ -1572,7 +1572,7 @@ __d(function(_g,_r,_i,_a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esMo __d(function(g,r,i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"DRAFT_LABEL",{enumerable:!0,get:function(){return o}}),Object.defineProperty(_e,"useDrafts",{enumerable:!0,get:function(){return p}});var e,t=r(_d[0]),s=(e=t)&&e.__esModule?e:{default:e},n=r(_d[1]),d=r(_d[2]);const o={booking:'Booking',shopping:'Shopping list',offer:'Offer',event:'Event',special:'Special',message:'Message',payment:'Payment',other:'Request'},p=(0,n.create)()((0,d.persist)((e,t)=>({drafts:[],add:t=>{const s={...t,id:`dr-${Date.now().toString(36)}${Math.random().toString(36).slice(2,6)}`,at:(new Date).toISOString(),status:'draft'};return e(e=>({drafts:[s,...e.drafts].slice(0,300)})),s},addToList:(s,n,d,o,p)=>{const f=t().drafts.find(e=>e.rid===s&&'shopping'===e.kind&&e.supplier===n&&'draft'===e.status);if(f){const t={...f,lines:[...f.lines,...d]};return e(e=>({drafts:e.drafts.map(e=>e.id===f.id?t:e)})),t}return t().add({rid:s,kind:'shopping',supplier:n,title:'Supplier shopping list',lines:d,by:o,app:p})},decide:(t,s,n)=>e(e=>({drafts:e.drafts.map(e=>e.id===t?{...e,status:s,decidedBy:n,decidedAt:(new Date).toISOString()}:e)}))}),{name:'covercharge-drafts-v1',version:1,storage:(0,d.createJSONStorage)(()=>s.default)}))},1489,[824,831,834]); __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"useShiftNotes",{enumerable:!0,get:function(){return c}});var e,t=r(d[0]),n=(e=t)&&e.__esModule?e:{default:e},s=r(d[1]),o=r(d[2]);const c=(0,s.create)()((0,o.persist)(e=>({notes:[],add:t=>e(e=>({notes:[Object.assign({},t,{id:'sn-'+Date.now().toString(36),at:(new Date).toISOString()}),...e.notes].slice(0,300)})),setDone:(t,n)=>e(e=>({notes:e.notes.map(e=>e.id===t?Object.assign({},e,{done:n}):e)}))}),{name:'covercharge-shiftnotes-v1',version:1,storage:(0,o.createJSONStorage)(()=>n.default)}))},1490,[824,831,834]); __d(function(g,_r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"useCoach",{enumerable:!0,get:function(){return p}}),_e.findTarget=b,_e.CoachHost=function(){const{target:e,hint:s,nonce:x}=p(),[y,w]=(0,o.useState)(null),v=(0,o.useRef)(new n.default.Value(0)).current;if((0,o.useEffect)(()=>{n.default.loop(n.default.timing(v,{toValue:1,duration:1300,easing:l.default.out(l.default.quad),useNativeDriver:!1})).start()},[]),(0,o.useEffect)(()=>{if(w(null),!s||!e)return;let t=0,o=null,n=!1;const l=()=>{if(o=o&&o.isConnected?o:b(e),o){n||(o.scrollIntoView?.({block:'center',behavior:'smooth'}),n=!0);const e=o.getBoundingClientRect();w({x:e.left,y:e.top,w:e.width,h:e.height,vw:window.innerWidth,vh:window.innerHeight})}else++t>40&&w(null)},r=setInterval(l,150);l();const u=setTimeout(()=>p.getState().clear(),2e4);return()=>{clearInterval(r),clearTimeout(u)}},[x]),!s)return null;const C='fixed',R=!y||y.y+y.h+110p.getState().clear(),style:{alignSelf:'flex-end',backgroundColor:(0,t.soutersSurface)('#1A1408'),borderRadius:10,paddingHorizontal:14,paddingVertical:6},children:(0,h.jsx)(c.T,{colour:f.colours.gold,weight:"semibold",children:"Got it"})})]})})]})};var t=_r(d[0]),o=_r(d[1]),n=e(_r(d[2])),l=e(_r(d[3]));_r(d[4]);var r=e(_r(d[5])),u=e(_r(d[6])),s=_r(d[7]),c=_r(d[8]),f=_r(d[9]),h=_r(d[10]);const p=(0,s.create)(e=>({target:null,hint:null,nonce:0,show:(t,o)=>e(e=>({target:t??null,hint:o,nonce:e.nonce+1})),clear:()=>e({target:null,hint:null})}));function b(e){if('undefined'==typeof document)return null;const t=e=>e&&e.getClientRects().length?e:null;if(e.testID){const o=Array.from(document.querySelectorAll(`[data-testid="${e.testID}"]`)).map(t).find(Boolean);if(o)return o}if(e.label){const o=Array.from(document.querySelectorAll(`[aria-label="${e.label}"]`)).map(t).find(Boolean);if(o)return o}if(e.text){const o=e.text.toLowerCase(),n=Array.from(document.querySelectorAll('[role="button"], button, a')).filter(e=>(e.textContent??'').trim().toLowerCase().includes(o)).map(t).find(Boolean);if(n)return n}return null}},1491,[813,17,266,347,219,385,85,831,777,804,8]); -__d(function(g,r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"HELP_TOPICS",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"HELP",{enumerable:!0,get:function(){return a}}),Object.defineProperty(e,"helpById",{enumerable:!0,get:function(){return o}});const t=['Bookings','Walk-ins','Table plan','Rota','Hours & pay','Tips','Team','Suppliers','Stock','Recipe cards','Displays','Settings','Accounts'],a=[{id:'new-booking',kind:'guide',topic:'Bookings',title:'Take a phone booking',keywords:['booking','reservation','book','table','phone','covers','reserve'],body:'Add a booking for a guest who calls or walks up to ask. The app only offers times that are really free.',steps:['Open Bookings (or tap New booking on Today).','Pick the date, time and number of covers.','Add the guest\u2019s name and phone, plus any allergies or notes.','Tap Save. The booking appears on the timeline and the floor plan.'],showMe:{tab:'bookings',target:{testID:'add-booking'},hint:'Tap New booking to start a booking.'}},{id:'move-booking',kind:'faq',topic:'Bookings',title:'How do I move a booking to another table or time?',keywords:['move','change','reschedule','table','booking','swap'],body:'Open the booking from Bookings or the timeline and tap Edit, or drag it to another table on the Display. Guests are not messaged unless you choose to.',showMe:{tab:'bookings',target:{testID:'add-booking'},hint:'Your bookings list is here. Tap a booking to change it.'}},{id:'walk-in',kind:'guide',topic:'Walk-ins',title:'Seat a walk-in',keywords:['walk-in','walkin','walk in','seat','no booking','covers','party'],body:'Record guests who arrive without a booking so the floor plan and covers stay right.',steps:['On the Display (the venue tablet), tap Walk-in. On a phone, say \u201cadd a walk-in for 2\u201d to the Assistant.','Choose the number of covers.','Pick a free table (the best fit is suggested).','Tap Seat. The table shows as seated.'],actions:['add_walkin']},{id:'table-plan',kind:'guide',topic:'Table plan',title:'Edit the table plan',keywords:['table plan','floor plan','layout','tables','move tables','designer','areas','seats'],body:'Drag tables into place, set seats, join tables and add areas such as Terrace or Garden.',steps:['Go to More \u203a Table plan.','Tap Open the designer.','Drag tables, or tap one to change its name and seats.','Tap Save. Displays and bookings use the new plan straight away.'],showMe:{tab:'more',page:'tableplan',target:{testID:'open-designer'},hint:'Open the designer to move tables.'}},{id:'rota',kind:'guide',topic:'Rota',title:'Build and publish the rota',keywords:['rota','shift','schedule','week','publish','staff hours','add shift'],body:'Plan the week, then publish it so staff see their shifts in the Staff app.',steps:['Go to More \u203a Rota.','Tap a person\u2019s day to add a shift (presets: lunch, dinner, double).','New shifts are drafts with a dashed amber border.','Tap Publish when the week is ready. Staff see only published shifts.'],showMe:{tab:'more',page:'rota',target:{testID:'rota-publish'},hint:'Tap a day to add a shift, then Publish here.'},actions:['add_rota_shift','publish_rota']},{id:'rota-copy',kind:'faq',topic:'Rota',title:'Can I copy last week\u2019s rota?',keywords:['copy','last week','repeat','rota','duplicate'],body:'Yes. On the Rota tap Copy last week. The shifts come over as drafts so you can tweak them before publishing.',showMe:{tab:'more',page:'rota',target:{testID:'rota-copy'},hint:'Copy last week\u2019s shifts as drafts.'}},{id:'sign-off',kind:'guide',topic:'Hours & pay',title:'Sign off hours',keywords:['sign off','signoff','confirm hours','approve','timesheet','clock','pending'],body:'Only confirmed hours count for pay and tips. Check clocked times against the rota and confirm them.',steps:['Go to More \u203a Sign off hours.','Flagged days (late, missing clock-out, long breaks) are at the top.','Tap a row to fix a time; give a short reason.','Tap Confirm all unflagged, then deal with the rest.'],showMe:{tab:'more',page:'signoff',target:{testID:'confirm-unflagged'},hint:'Confirm all the days that look right in one tap.'}},{id:'payroll-hours',kind:'guide',topic:'Hours & pay',title:'Export hours for payroll',keywords:['payroll','export','hours','spreadsheet','csv','excel','accountant','copy','print'],body:'Get each person\u2019s confirmed hours for a pay period into your spreadsheet or to your accountant.',steps:['Go to More \u203a Payroll hours.','Pick the pay period (or a tips fortnight, or a custom range).','Check the pending banner: sign those off first if you can.','Tap Copy for spreadsheet and paste into Excel or Google Sheets, or download a CSV, or print.'],showMe:{tab:'more',page:'hours',target:{testID:'copy-tsv'},hint:'Copy, then paste straight into your spreadsheet.'}},{id:'pay-dates',kind:'faq',topic:'Hours & pay',title:'How do I set our pay dates?',keywords:['pay day','payday','pay dates','cut-off','wages','monthly','fortnightly'],body:'Settings \u203a Pay & tips: set when tips are paid and how often, the wage pay day and the cut-off. Payroll hours and Tips day use these dates.',showMe:{tab:'more',page:'paysettings',target:{testID:'save-pay'},hint:'Change the dates above, then Save.'}},{id:'tips-day',kind:'guide',topic:'Tips',title:'Share out tips on tips day',keywords:['tips','tronc','gratuity','share','split','tips day','service charge'],body:'Enter the tips total and it\u2019s shared by confirmed hours for the fortnight, to the penny.',steps:['Go to More \u203a Tips day (the right fortnight is picked for you).','Type the total tips.','Check anyone with pending hours; sign them off first if you can.','Copy or download the split for payroll.'],showMe:{tab:'more',page:'tipsday',target:{testID:'tips-total'},hint:'Type the tips total here.'}},{id:'invites',kind:'guide',topic:'Team',title:'Invite staff to the app',keywords:['invite','link','staff app','new starter','sign in','add staff','team member'],body:'Each person gets their own sign-in link. You choose when and how to share it.',steps:['Go to Settings \u203a Invite links.','Tap Make invite link next to the person.','Share the link yourself (text or WhatsApp). The app never sends it for you.','They tap it once and the Staff app remembers them.'],showMe:{tab:'more',page:'setup-invites',target:{text:'Make invite link'},hint:'Make a personal link, then share it yourself.'}},{id:'suppliers',kind:'guide',topic:'Suppliers',title:'Suppliers and order sheets',keywords:['supplier','order','order sheet','delivery','cut-off','fish','veg','dairy'],body:'Keep supplier contacts, order days and cut-offs together, and log what you ordered.',steps:['Go to More \u203a Suppliers to add or edit a supplier.','Use Supplier order sheets for the items you usually order.','Tap Log an order after you place it by phone or email.'],showMe:{tab:'more',page:'ordersheets',target:{testID:'sheet-add'},hint:'Add an order sheet for a supplier.'}},{id:'display-glance',kind:'guide',topic:'Display',title:'Today at a glance (Display)',keywords:['glance','today','covers by hour','breaks','on now','next','cut-off','cutoff','order times','display bar'],body:'The bar under the Display header shows today in one line: covers by hour (booked in solid gold, the walk-in estimate dashed), quiet times for breaks, who is on now and next, today\u2019s supplier order cut-offs with a countdown (amber under 30 minutes) and one tip. Cut-offs come from Scheduled notifications.'},{id:'sold-out',kind:'guide',topic:'Menu',title:'Sold out dishes',keywords:['sold out','run out','ran out','none left','back on','86','eighty six','display strip'],body:'When a dish runs out, mark it sold out so every member of staff knows. It\u2019s a reminder for staff: CoverCharge doesn\u2019t link up to your till, so it doesn\u2019t change the till. Sold out dishes show in a slim strip along the bottom of the Display within seconds, and in the Sold out list in Front of House, Managers and Head Chef. They clear by themselves when the kitchen closes (or the next morning, or only when you tap Back on: Settings \u203a Advanced \u203a Sold out reminders).',steps:['Open the Sold out list (Managers: More \u203a Sold out; Front of House: Me \u203a Sold out; Head Chef: Kitchen \u203a Live tickets \u203a Sold out).','Tap Mark sold out next to the dish.','When it\u2019s back, tap Back on.'],showMe:{tab:'more',page:'soldout',target:{testID:'soldout-search'},hint:'Find the dish, then tap Mark sold out.'}},{id:'shellfish',kind:'guide',topic:'Stock',title:'Live shellfish (and other) counts',keywords:['shellfish','lobster','crab','oysters','count','stock','tracked','sold out','86'],body:'Counters for things you sell by the unit, like lobster or crab. They show on the Display and warn when low.',steps:['Go to Settings \u203a Tracked stock.','Tap Add an item to track; set the name, icon and low warning.','Staff update the count from the small lobster and crab chip at the top of the Display, or in the app.'],showMe:{tab:'more',page:'trackedstock',target:{text:'Add an item to track'},hint:'Add something to count, like lobster.'}},{id:'recipe-cards',kind:'guide',topic:'Recipe cards',title:'Recipe cards',keywords:['recipe','card','dish','ingredients','method','allergens','spec'],body:'Photo, ingredients, method and allergens for each dish; the head chef signs them off and staff can read them.',steps:['Go to More \u203a Recipe cards.','Search for a dish or add a new one.','Fill in ingredients (allergens are suggested) and the method.','Send for head chef sign-off.'],showMe:{tab:'more',page:'recipecards',target:{testID:'card-search'},hint:'Search your recipe cards here.'}},{id:'display-pair',kind:'guide',topic:'Displays',title:'Pair a display or tablet',keywords:['display','tablet','pair','screen','code','front of house','kitchen screen'],body:'Connect a tablet to your venue with a one-time code. You can switch any display off from here.',steps:['Open the Display app on the tablet.','In Managers go to Settings \u203a Displays and tap Make a pairing code.','Type the code on the tablet. It joins your venue straight away.'],showMe:{tab:'more',page:'displays',target:{text:'Make a pairing code'},hint:'Make a one-time code for the tablet.'}},{id:'settings-hours',kind:'faq',topic:'Settings',title:'How do I change our opening hours?',keywords:['opening hours','hours','closed','open','kitchen hours','times'],body:'Settings \u203a Opening hours. Guests see these on your booking and order pages; bookings outside them are turned away.',showMe:{tab:'more',page:'setup-hours',hint:'Set each day\u2019s opening and closing time here.'}},{id:'replay-setup',kind:'faq',topic:'Settings',title:'Can I see the welcome walkthrough again?',keywords:['welcome','setup','walkthrough','onboarding','checklist','questionnaire'],body:'Yes: Settings \u203a Setup checklist \u203a Replay welcome. Everything is pre-filled from your questionnaire.',showMe:{tab:'more',page:'setupchecklist',target:{testID:'replay-welcome'},hint:'Replay the welcome walkthrough.'}},{id:'connected-accounts',kind:'guide',topic:'Accounts',title:'Connect your email, website and socials',keywords:['connect','account','gmail','outlook','wix','facebook','instagram','square','xero','quickbooks','login'],body:'Settings \u203a Connected accounts: tap a logo, save the account to your list, and use Connect with\u2026 to sign in on that service\u2019s own page (rolling out service by service; it shows Coming soon until then). CoverCharge never sees your password that way, and you can remove an account any time.',steps:['Go to Settings \u203a Connected accounts.','Tap the service\u2019s logo.','Tap Connect with\u2026 and sign in on their page.','To stop, tap Remove.'],showMe:{tab:'more',page:'connections',target:{testID:'conn-tile-gmail'},hint:'Tap a logo to connect that account.'}},{id:'supplier-portals',kind:'guide',topic:'Suppliers',title:'Order from your suppliers',keywords:['bidfood','booker','wholesale','cash and carry','order online','supplier login','account number','customer number'],body:'Settings \u203a Connected accounts \u203a Suppliers. Add supplier links for this venue, with an account number if you like. Open ordering and Log in open the supplier\u2019s own website, where you sign in; CoverCharge never keeps the password.',steps:['Go to Settings \u203a Connected accounts.','Scroll to Suppliers.','Tap Add against a supplier (account number optional).','Tap Open ordering or Log in whenever you need them.','To stop, tap Remove and confirm.'],showMe:{tab:'more',page:'connections',target:{testID:'portal-bidfood'},hint:'Your supplier ordering websites live here.'}},{id:'support',kind:'faq',topic:'Settings',title:'How do I get help from a person?',keywords:['support','help','contact','person','problem','broken','stuck'],body:'Support is free for life. Message the CoverCharge team from Settings \u203a Help, or email us, and we\u2019ll reply. We help by message and email.'},{id:'assistant-safe',kind:'faq',topic:'Settings',title:'Can the Assistant send or pay for things by itself?',keywords:['assistant','safe','confirm','send','pay','delete','ai'],body:'No. The Assistant and the voice helper show you exactly what they will do and wait for you to tap Confirm (or say yes). Anything that would send a message, order from a supplier or pay is only saved as a draft in Drafts for approval; nothing goes out by itself.'},{id:'restaurant-dashboard',kind:'guide',topic:'Bookings',title:'Restaurant dashboard',keywords:['restaurant dashboard','tables','timeline','guests','covers','joined tables'],body:'In Managers, tap Restaurant dashboard on Home, or More > Run the day > Restaurant dashboard. It is the same live table plan, Timeline, guest list, deposits, dogs, joined tables, Covers, covers-through-the-day chart and block bookings as the Display. Use the day arrows and Back to today. Assign or join tables on any day; seat, finish, no-show and cancel walk-in actions apply today. You can also say \u201copen Restaurant dashboard\u201d. The helper replies in text only.',showMe:{tab:'more',page:'serviceboard',target:{testID:'restaurant-dashboard-close'},hint:'Restaurant dashboard is open. Pick a day, or tap Back to Managers to close.'}},{id:'voice-helper',kind:'guide',topic:'Settings',title:'Use the hold-to-talk voice button',keywords:['voice','talk','speak','microphone','mic','hold','walkie','button','hands free','gloves'],body:'Hold the big gold button, say what you need, then let go. It logs fridge and freezer temperatures, answers allergen questions, marks dishes sold out, checks tables, adds to the waitlist, reads orders and covers, and drafts bookings, offers, events and supplier lists. The helper replies in text only, never aloud. Changes are shown in text first with Confirm and Cancel buttons: tap Confirm or say yes. Tap the button to type instead (in Managers this also opens the Assistant). It sits at the top right of the header in Managers, Head Chef, the Staff app (the full voice assistant, with no money, tips or HR) and on the Display (no money, tips or HR). Until the voice assistant\u2019s server is switched on, anything new says \u201cVoice assistant is switching on soon\u201d. Fair usage: 1,000 voice tasks a month per venue.',steps:['Hold the gold microphone button (the first time, allow the microphone).','Speak, for example \u201cprep fridge 3 degrees\u201d.','Let go to send.','If it reads something back, tap Confirm or hold again and say \u201cyes\u201d.','The button stays at the top right so it never covers the screen.'],showMe:{tab:'more',page:'voice',hint:'Turn the voice button on or off for each role here.'}},{id:'voice-drafts',kind:'faq',topic:'Settings',title:'Where do voice bookings and shopping lists go?',keywords:['drafts','approve','approval','shopping list','booker list','bidfood list','draft booking','offer','event'],body:'To Settings \u203a Drafts for approval. Bookings, supplier lists, offers, events and specials made by voice wait there for an owner or manager. Approving marks it approved and opens the right screen; you still place the order or confirm the booking yourself.',showMe:{tab:'more',page:'drafts',hint:'Drafts from the voice helper wait here.'}},{id:'voice-temps',kind:'guide',topic:'Settings',title:'Log fridge and freezer temperatures by voice',keywords:['temperature','fridge','freezer','haccp','food safety','eho','log temps','probe'],body:'Hold the voice button and say the unit and the number, for example \u201cprep fridge 3, freezer minus 19\u201d. Fridges should be 5\xb0C or colder and freezers -18\xb0C or colder; anything outside is flagged. Everything is in the Food safety log with who and when, ready to export or print for the EHO.',showMe:{tab:'more',page:'haccp',hint:'Every voice reading appears in the food safety log.'}},{id:'voice-fair-usage',kind:'faq',topic:'Settings',title:'Is there a limit on voice tasks?',keywords:['voice','limit','allowance','fair usage','fair use','how many','tasks','month','plan'],body:'Fair usage: 1,000 voice tasks a month per venue. It is one allowance shared by all of the venue\u2019s apps and devices, and it resets on the 1st. Each request counts once, spoken or typed; saying \u201cyes\u201d to confirm does not count again. You will see a note at 80%. If the venue reaches 1,000, the voice helper pauses until the 1st, except food safety and temperature logging, which always works. The owner can contact CoverCharge if you need more. See the count in Plan & billing or Settings \u203a Voice helper.',showMe:{tab:'more',page:'voice',hint:'This month\u2019s voice task count is shown here.'}},{id:'adv-bookings',kind:'guide',topic:'Settings',title:'Booking questions: allergies, dogs, access, vegan',keywords:['advanced','allergen','dog','dogs','cap','wheelchair','access','vegan','vegetarian','table request','settings'],body:'Choose what guests are asked when they book. Allergies are always asked first, in red, and staff tick \u201cAllergens seen\u201d. The others can be switched off.',steps:['Open More \u203a Settings \u203a Advanced.','In Bookings, tick or untick each question.','Use the dog stepper to cap dogs per booking time (No limit = only the dog-friendly tables).','Mark dog-friendly and step-free tables on the Table plan.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-bookings'},hint:'Booking questions are here.'}},{id:'adv-table-times',kind:'guide',topic:'Settings',title:'How long tables stay (table times)',keywords:['advanced','dwell','table time','turn','how long','next table free','minutes'],body:'Usual table times by party size: 90 min for 1\u20132 covers, 105 for 3\u20135, 2 hours for 6\u201319 and 3 hours for 20 or more. The app fine-tunes them from how long your tables really stay, and uses them for \u201cNext table free\u201d.',steps:['Open More \u203a Settings \u203a Advanced \u203a Table times.','Tap \u2212 or + to change a band by 5 minutes.','Untick \u201cFine-tune\u201d to use your numbers exactly.','Reset to default puts the four bands back.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-times'},hint:'Table times are here.'}},{id:'adv-reservable',kind:'guide',topic:'Settings',title:'Seafood platter, crab and lobster reservations',keywords:['advanced','platter','seafood','crab','lobster','reserve','price'],body:'Guests can reserve the Seafood Platter (1 crab + 1 lobster, \xa3160) or a crab or lobster with their booking. Reserved ones come off the Display count with a \u201cReserved\u201d line, the kitchen is told, and the Head Chef taps OK.',steps:['Open More \u203a Settings \u203a Advanced \u203a Reservable items.','Tick what guests can reserve and set the price.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-reserve'},hint:'Reservable items are here.'}},{id:'adv-events',kind:'guide',topic:'Settings',title:'Regular events like Open Mic Night',keywords:['advanced','open mic night','music night','event','regular','monthly','promote','busier','last food'],body:'Add events that repeat, e.g. Open Mic Night on the last Sunday of every month from 8pm with last food orders at 7pm. They show in Forecast key dates with a Promote button and on Today, and \u201cExpect busier\u201d raises the forecast.',steps:['Open More \u203a Settings \u203a Advanced \u203a Regular events.','Tap Add a regular event (or Edit).','Pick how it repeats and the day, add a start time and last food orders if needed.','Tap Save event.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-events'},hint:'Regular events are here.'}},{id:'adv-hours',kind:'guide',topic:'Settings',title:'Kitchen hours, seasons and special days',keywords:['advanced','hours','kitchen','season','winter','summer','special day','closed','last food orders','cutoff'],body:'Kitchen (food) hours decide which booking times are offered; the closing time is last food orders. Keep Winter and Summer hours, each with the date it starts every year, and the app switches by itself. Add special days for one-off changes.',steps:['Open More \u203a Settings \u203a Advanced \u203a Kitchen hours.','Tap Set Summer hours, fill in each day and the start date (e.g. 04-01 for 1 April).','Set the Winter start date too.','Use Add a special day for closures or late nights.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-hours'},hint:'Kitchen hours and seasons are here.'}},{id:'adv-home',kind:'faq',topic:'Settings',title:'Covers counter, Next table free and takeaway on home screens',keywords:['advanced','covers counter','takeaway','next table free','home','display','flip'],body:'Turn the COVERS counter and the \u201cNext table free\u201d card on or off, and choose whether takeaway figures show on home screens (off at the Anchorage). Takeaway order alerts always work. The flap click sound is set on each Display.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-home'},hint:'Display and home options are here.'}},{id:'adv-holidays',kind:'faq',topic:'Settings',title:'Why don\u2019t bank holidays say \u201c(substitute day)\u201d?',keywords:['advanced','holiday','substitute','bank holiday'],body:'The date already shows when a holiday moves, so the extra words are hidden. Tick \u201cShow full gov.uk names\u201d in Settings \u203a Advanced \u203a Holiday names to bring them back.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-holidays'},hint:'Holiday names are here.'}},{id:'adv-blocks',kind:'guide',topic:'Settings',title:'Lunch and dinner times for Block now',keywords:['block','lunch','dinner','service','wix','advanced','pause'],body:'Settings \u203a Advanced \u203a Block bookings sets when Lunch and Dinner run, for the Block now buttons and Spend per head. At The Anchorage, blocks also close those times on website bookings, and blocks made on the website show in CoverCharge. Website bookings can only close the whole venue, not one area or some tables.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-blocks'},hint:'Block bookings settings are here.'}},{id:'blocks-screen',kind:'guide',topic:'Bookings',title:'Block bookings: today, a future date, an area or some tables',keywords:['block','blocks','pause','close','closed','stop bookings','private','repeat','future'],body:'Tap Block bookings on the home screen. Block now pauses bookings today (Rest of today, Next hour, Lunch, Dinner, or a From\u2013To). Add a block closes a future date or range, the whole day or set times, the whole venue, one area or some tables, once or every week or on the last weekday of the month. Every future block is listed by month with Edit and Remove; removing asks first and is logged. Bookings already made are kept, and you are told how many.',showMe:{tab:'more',page:'blocks',target:{testID:'blocks-screen'},hint:'Block bookings is here.'}},{id:'spend-per-head',kind:'guide',topic:'Money',title:'Spend per head',keywords:['spend per head','sph','average spend','takings','covers','gross'],body:'Spend per head is Gross takings \xf7 Covers, by day, by week and for lunch and dinner. Enter the gross on the cash up (Enter the cash up, Upload a spreadsheet, or Enter takings). Covers are seated and finished bookings and walk-ins; no-shows and cancellations are left out. A day with no takings shows \u201cNo takings entered\u201d, never \xa30.',showMe:{tab:'more',page:'spendhead',target:{testID:'sph-screen'},hint:'Spend per head is here.'}},{id:'cashup-photo',kind:'guide',topic:'Money',title:'Enter the cash up, or upload a spreadsheet',keywords:['cash up','paid out','spreadsheet','csv','excel','xlsx','sheet','gross','card','cash','tips','takings','drawer'],body:'In Cash up & sales tap Enter the cash up and type the figures (Z total, card, cash, paid outs, tips, and gross if you have it). In Paid out, add a line for each amount taken from the till \u2014 for example lobsters or supermarket shopping \u2014 with the amount, an optional note, and your name. The paid-out total comes off the expected cash in the drawer. Check every figure, then tap Confirm and save. Bigger venues can tap Upload a spreadsheet (CSV or Excel): match the columns, check the preview (dates already saved are flagged), then confirm. Nothing is saved before you confirm, and every save is logged. You can export cash ups as a spreadsheet from Recent cash ups.',showMe:{tab:'more',page:'cashup',target:{testID:'cashup-by-hand'},hint:'Start the cash up here.'}},{id:'adv-giftqr',kind:'guide',topic:'Settings',title:'Buy a gift card on the Display',keywords:['gift','gift card','voucher','qr','display','wix','advanced'],body:'Switch on \u201cShow Buy a gift card on the Display\u201d in Settings \u203a Advanced \u203a Gift cards on the Display, and save your gift card page address. The Display has a Gift vouchers button: it opens the list of website vouchers (search, use by dates, Mark as used), with Show the buy QR code at the bottom. Guests buy on your website.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-giftqr'},hint:'Gift cards on the Display are here.'}},{id:'adv-whatsapp',kind:'guide',topic:'Settings',title:'WhatsApp buttons (tap to chat)',keywords:['whatsapp','wa.me','message','chat','guest','mobile','number','advanced'],body:'Put the venue\u2019s WhatsApp number in Settings \u203a Advanced \u203a WhatsApp, e.g. 01292 500123 or +44 7700 900123. Guests then see \u201cMessage us on WhatsApp\u201d on their booking confirmation, with their booking details typed in. Staff and managers see \u201cWhatsApp guest\u201d on bookings with a mobile number, with a confirmation typed in that you can change. Nothing is ever sent for you: WhatsApp opens and you tap Send yourself. Leave the number blank and every WhatsApp button stays hidden. Reset to default clears the number.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-whatsapp'},hint:'The WhatsApp number is here.'}},{id:'adv-reminders',kind:'guide',topic:'Settings',title:'Staff reminders: breaks and \u201cchairs up\u201d',keywords:['reminder','reminders','break','breaks','chairs','closing','6 hours','law','snooze','later','done','advanced'],body:'Reminders slide up for staff who are on shift right now (clocked in, or on the rota at that time) in the Staff and Head Chef apps, while the app is open. Break reminders: if the rota shift has a break time, the reminder comes at that time; if not, it comes 4 hours after they clock in (or after the shift starts). If they still haven\u2019t started a break it comes once more 30 minutes later, and again at 6 hours, because UK law says a shift over 6 hours needs a 20-minute break. \u201cStart break\u201d starts their break; \u201cLater\u201d hides it for 15 minutes. You can change these times. Venue reminders, such as \u201cTime to put the chairs up on the tables\u201d (Friday and Sunday, 21:00), have wording, days, a time (UK) and who sees them: everyone on shift, front of house or kitchen. Pause, edit or delete any of them, or add your own. Once anyone taps Done it goes for everyone that day, and the Reminders screen shows who did it. Reset to default brings back the standard break times and \u201cchairs up\u201d; your own reminders stay. Phones with the app closed don\u2019t get reminders yet.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-reminders'},hint:'Reminders are here.'}},{id:'adv-notifications',kind:'guide',topic:'Settings',title:'Scheduled notifications (e.g. the Mills milk order)',keywords:['notification','notifications','push','phone','milk','mills','pieroni','pieronis','veg','olsen','rota upload','scheduled','advanced'],body:'Settings \u203a Advanced \u203a Notifications lists reminders that go to named people at a set UK time, such as \u201cMills milk order\u201d for the Head Chef and Gordon. Each has a title, a message, the days, a time (you can set a different time on some days, e.g. 20:55 on Fridays), who gets it (tick people or pick a group like Everyone on shift) and how it is sent. In the app it is the gold slider with Done and Later; Done is logged with the name and time, and Later hides it for 15 minutes. Urgent notices (like the 6-hour break) always come first and only one shows at a time. Phone notifications: each person taps \u201cTurn on phone notifications\u201d on their own phone (iPhone: add the app to the Home Screen first, iOS 16.4 or later). Nothing goes to phones until an owner or manager switches \u201cSend to phones\u201d on. The Display never gets these. Reset to default restores the configured rules.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-notifications'},hint:'Notifications are here.'}},{id:'adv-order-lists',kind:'guide',topic:'Settings',title:'Order lists (Alsons, Cash and carry)',keywords:['order list','orders','alsons','drinks','cash and carry','trip','shopping','logo','carry over','advanced'],body:'Order lists collect what you need from a supplier. A running list (Alsons drinks) fills up until you order; a trip list (Cash and carry) is for a shopping day, Friday by default, which you can change for each trip. Add an item with a quantity and unit and an optional note; the app records who added it and when. Adding something already on the list offers to add to the quantity instead. On the day, tick Got or Ordered, or mark Missing / not in stock. Finish order saves it to History (date and who) and asks whether to carry over anything not got. Removing an item can be undone. Settings \u203a Advanced \u203a Order lists: add, rename or archive lists, the default trip day, and \u201cLet all staff add items\u201d (on: staff can add and see lists; only managers and the Head Chef tick, remove or finish). Each list can have a logo (take a photo or choose one) or shows its initials, and a phone number to tap to call (never called for you).',showMe:{tab:'more',page:'advanced',target:{testID:'adv-orderlists'},hint:'Order list settings are here.'}},{id:'adv-clock-area',kind:'guide',topic:'Settings',title:'Clock-in area, forgotten breaks and off-rota arrivals',keywords:['clock','clock in','geofence','location','area','radius','break','forgot','rota','visiting','override','advanced'],body:'Clock in, clock out, start break and end break only work at the venue once the centre is set. Stand in the middle of the venue and tap \u201cUse my current location\u201d, then choose how far (at least 50 m, 100 m to start). Phones are not exact, so up to 50 m of the phone\u2019s own accuracy is allowed on top. Each clock record keeps the reading, its accuracy and whether it was inside. If location is off or blocked, the app says how to allow it. Managers can record it for someone from Clock in / out \u203a Record it for someone, with a reason that is logged. Until the centre is set nobody is blocked and managers see a warning. Rota and pay screens are never blocked. Forgotten breaks: if no break was recorded, Clock out asks \u201cDid you take a break? If so, how long?\u201d; a length you pick is saved as a break marked \u201cadded at clock-out\u201d, which managers see and can edit in Hours. Not on the rota: if someone is at the venue, not clocked in and not on the rota, the Staff and Head Chef apps ask \u201cDo you want to sign in?\u201d. Yes clocks them in, marked off-rota, and managers get a notice; \u201cNo, just visiting\u201d stops asking for the day. This only checks while the app is open; web apps can\u2019t watch location in the background.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-clockarea'},hint:'Clock-in area settings are here.'}},{id:'adv-tablegrid',kind:'guide',topic:'Table plan',title:'Table plan grid and Tidy up (Advanced)',keywords:['grid','snap','line up','align','tidy','guides','spacing','restore','table plan','option','alt'],body:'Tables snap to the grid when you drag them, and gold guides show when an edge or centre lines up with another table. A small number shows when the gaps either side are even. Hold Alt (Option on a Mac) to move freely. Tidy up lines every table up on the grid and evens out the rows; only positions change. The old positions are kept, so one tap puts them back.',steps:['Go to Settings \u203a Advanced.','Find Table plan grid.','Turn snapping on or off, pick a grid size, or tap Tidy up the whole plan.','Changed your mind? Tap Put the tables back where they were.']},{id:'adv-printers',kind:'guide',topic:'Orders',title:'Kitchen ticket printers (Advanced)',keywords:['print','printer','printing','ticket','kitchen ticket','docket','receipt','epson','star','bluetooth','reprint','takeaway'],body:'Print a kitchen ticket by itself for every takeaway order, as soon as it comes in or when it is accepted. The ticket has the order number, collection time, name, every dish with its options and notes, allergies in white-on-black, and paid or not paid. Works with Epson (TM-m30, TM-T20, TM-T88), Star WebPRNT, most other network receipt printers (port 9100) and Bluetooth printers from the tablet app. If a ticket does not print, an amber warning shows and the order stays on screen.',steps:['Go to Settings \u203a Advanced.','Find Printers.','Tap Add a printer by IP address or Find printers on this Wi-Fi, choose the type and tap Test print.','Turn on Print a kitchen ticket for every takeaway order.']},{id:'adv-deposits',kind:'guide',topic:'Bookings',title:'Deposits (Advanced)',keywords:['deposit','deposits','per person','per adult','children','waive','waived','regular','party size','refund','refundable','cut off','policy','paid','due'],body:'Ask bigger tables for a deposit: set the amount per adult (children never pay: a table of 8 with 3 children pays for 5), the smallest party that pays one, whether it is refundable and up to how many hours before, and the words guests see. No card is saved in CoverCharge. Deposits are paid through website bookings: website bookings show Deposit paid on website bookings, Part paid on website bookings or Deposit not paid by themselves. For phone and walk-in bookings, staff tick Deposit paid once the guest has paid you, or (once switched on) press Send deposit link to send a website bookings pay link by text, WhatsApp or email. Refunds are done in Website bookings \u203a Orders. Deposit amounts are shown on bookings in Managers, Display and Staff. Other financial and HR information remains restricted.',steps:['Go to Settings \u203a Advanced.','Find Deposits.','Turn deposits on or off, and set the amount, party size, refund terms and the words guests see.','On a booking, tap Mark deposit paid once the guest has paid.','To let a regular off, tap Waive deposit on the booking (or in Edit booking), add why if you like, and tap Yes, waive it. Your name is saved with it.']},{id:'adv-loyalty',kind:'guide',topic:'Guests',title:'Loyalty: stamp card, offers & bring a friend (Advanced)',keywords:['loyalty','stamp','stamps','card','reward','offer','offers','referral','friend','expiry'],body:'The stamp card, offers and bring-a-friend are saved on the server, so every phone and tablet shows the same card. Set how many stamps earn a reward, what the reward is, when stamps or rewards run out, and how often one guest can get a stamp. Stamps only come from staff, or from a code or QR staff make, and each reward can be used once. Guests join with their agreement recorded, and a manager can remove a guest and their details.',steps:['Go to Settings \u203a Advanced.','Find Loyalty.','Turn the stamp card on, write the reward and tap Save loyalty settings.','Add offers with their dates, and turn bring-a-friend on if you want it.']},{id:'adv-table-order',kind:'guide',topic:'Guests',title:'Order at the table (Advanced)',keywords:['order at table','qr','qr code','scan','table','phone','accept','last orders','print','pdf','pay at bar'],body:'Guests scan the small QR card on their table (Managers \u203a Table QR codes prints them, 20 to a page), see your menu with allergens, and send an order. It lands in Front of House and on the kitchen screen within seconds. Prices, sold-out dishes and hours are checked on the server, so a phone can\u2019t change them. Staff accept the first order from each new phone (you can turn this off). Guests pay at the bar or with their server; paying by card from the phone is coming later.',steps:['Go to Settings \u203a Advanced.','Find Order at the table.','Turn it on, pick the areas or tables, set the hours and tap Save order at the table.','Tap Make codes, pick Stickers 50 \xd7 50 mm or Stand cards 50 \xd7 70 mm, then Print all QR cards (PDF) and put each code on its table.']},{id:'adv-soldout',kind:'guide',topic:'Menu',title:'Sold out reminders (Advanced)',keywords:['sold out','86','clear','end of service','next morning','back on','advanced','display strip','automatic','counts','lobster','crab'],body:'Choose when sold out dishes go back on by themselves: when the kitchen closes (from your Kitchen hours), the next morning (pick the time), or only when someone taps Back on. \u201cMark dishes sold out from the counts\u201d (on unless you turn it off) marks every dish that uses a counted item, like lobster or crab, when the count runs out, and puts it back on when the count is back up. Sold out is a reminder for staff on the Display and in the staff apps; it doesn\u2019t change your till.',steps:['Go to Settings \u203a Advanced.','Find Sold out reminders.','Pick when they clear, and turn marking from the counts on or off.']},{id:'sold-out-auto',kind:'guide',topic:'Menu',title:'Sold out from the counts (lobster, crab\u2026)',keywords:['sold out','automatic','auto','counts','shellfish','lobster','crab','platter','link','uses','none left'],body:'When a counted item runs out, or drops below what a dish needs, every dish that uses it is marked sold out by itself, with the reason: \u201cDeluxe Seafood Platter (no lobster or crab)\u201d. When the count is back up (a delivery or a recount), those dishes go back on by themselves. Dishes marked by hand are left alone. CoverCharge works out what each dish uses from its recipe card, its description (\u201cone whole lobster\u201d) or its name; you can change it for any dish. If you tap Back on while the count is still short, the dish stays on until the count changes.',steps:['Open the Sold out list.','Under Dishes linked to the counts, tap Change next to a dish.','Set how many of each item one portion uses (0 = not linked), then tap Save. Back to automatic undoes it.'],showMe:{tab:'more',page:'soldout',target:{testID:'soldout-links'},hint:'Tap Change next to a dish to set what it uses.'}},{id:'adv-forecast',kind:'guide',topic:'Forecasts',title:'Forecast history and "Not enough history yet"',keywords:['forecast','not enough history','history','estimate','example figures','labour','sales','walk-ins','advanced'],body:'Forecasts are built only from your own bookings, seated walk-ins, takeaway orders and cash-ups. Until CoverCharge has enough of your history (2 weeks to start with; change it in Settings \u203a Advanced \u203a Forecast history) you see \u2018Not enough history yet\u2019, what is already booked and your real labour cost from the rota, with no sales forecast or labour %. No history is invented for a live venue.',steps:['Go to Settings \u203a Advanced.','Find Forecast history.','Pick how many weeks are needed.']},{id:'adv-checkout',kind:'guide',topic:'Team',title:'Shift check-out, question board and team morale',keywords:['check out','checkout','morale','mood','staffing','overstaffed','survey','anonymous','question board','vote','shout out','wellbeing','advanced'],body:'When someone clocks out, they get a quick card: team morale from Low to High, and whether there was enough staff for the customers. They can also post a question for the board or shout out a teammate, or tap Skip. Nothing shows at clock in. Answers are anonymous: no name or staff number is saved, and each phone can answer a shift once. Team morale (Managers app \u203a More \u203a Team morale) shows a day only once 3 or more people have answered, next to that day\u2019s covers. Change the wording or switch parts off here.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-checkout'},hint:'Check-out and board settings are here.'}},{id:'hr-board',kind:'guide',topic:'Team',title:'The anonymous question board',keywords:['question board','board','anonymous','vote','yes no','reply','hide','moderation','log'],body:'Anyone on the team can post a question and vote it up, or vote Yes or No. No names are shown or saved. Owners and managers can reply (shown as \u201cReply from the managers\u201d) and hide offensive posts with a reason. Every hide, unhide and reply is in the Moderation log.',showMe:{tab:'more',page:'board',hint:'The question board.'}},{id:'adv-tasks',kind:'guide',topic:'Team',title:'Daily tasks',keywords:['tasks','daily tasks','checklist','duties','jobs','to do','my tasks','library','head chef'],body:'Give each person a short list of daily tasks: open Staff & roles, tap Daily tasks on their card, then pick from the venue\u2019s task library or type a new one. Use the arrows to reorder, \u2715 to remove (with Undo) and Days to limit a task to certain days. They see \u201cMy tasks today\u201d on their home screen and tick each one off while on shift; each tick records who and when, and you see \u201c2 of 5 done today\u201d on their card. Lists start fresh every day. Owners and managers can change anyone\u2019s list, including the Head Chef\u2019s. The Head Chef can change the lists of kitchen staff (chefs, commis and KPs) from Kitchen \u203a Kitchen team tasks, but not their own and not front of house. The task library is in Settings \u203a Advanced \u203a Tasks.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-tasks'},hint:'The task library is here.'}},{id:'adv-cashup',kind:'guide',topic:'Money',title:'Cash up and weekly sales',keywords:['cash up','cashup','takings','float','till','sales report','weekly sales','pos','printout','photo','graphs','charts'],body:'At the end of the night open Cash up & sales and tap Enter the cash up. Type each figure; boxes left blank stay blank (never counted as zero) and are highlighted in amber. Add any cash paid out of the till (lobsters, supermarket shopping, and the like) in the Paid out section: each line has what it was for, the amount, an optional note and who entered it. The total reduces the expected cash in the drawer. Nothing is saved until you tap Confirm and save. Do the same with the weekly sales report from the till (several pages is fine). The graphs show daily takings, tips, weekly net sales against the week before and sales by category. Owners and managers can enter and change cash ups; the Head Chef can see the graphs if they are allowed to see takings. Change the boxes to match your sheet in Settings \u203a Advanced \u203a Cash up; Cash tips total and Card tips total are always kept.',showMe:{tab:'more',page:'cashup',target:{testID:'cashup-by-hand'},hint:'Start the cash up here.'}},{id:'adv-tips',kind:'guide',topic:'Money',title:'Today\u2019s tips and the Tips pot',keywords:['tips','today tips','tips pot','pot','payout','tip pay','correction','coins'],body:'When a cash up with Cash tips total and Card tips total is confirmed, the team\u2019s combined tips for that day show as Today\u2019s tips in every staff app and on the Display, with a short notice. The Tips pot adds up confirmed daily tips since the last payout (fortnightly tip pay). After paying the tips, an owner or manager taps Mark payout done on the Tips pot card: the pot goes back to \xa30.00 and the old pot is kept in Past pots. Use Correct an entry to add or take off an amount for a day; a reason is required and every correction is logged with your name. Only the team total is ever shown, never anyone\u2019s share. Hide either card in Settings \u203a Advanced \u203a Tips.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-tips'},hint:'Show or hide the tips cards here.'}},{id:'manager-access',kind:'guide',topic:'Team',title:'Manager access',keywords:['manager access','manager','access','role','promote','front of house','head chef','owner'],body:'In Staff & roles each person has a Manager access switch. On: they use the Manager app (rota, bookings, staff, hours, settings, plus their own clock in, rota and pay). Off: they use the Front of House app, or the Head Chef app for the Head Chef. Owners can switch anyone except owners; managers can switch anyone except themselves and owners. The last owner can never be removed. You confirm each change; it is logged with who and when (Access changes). Job titles are free text and don\u2019t change.',showMe:{tab:'more',page:'staff',target:{testID:'access-tip'},hint:'Manager access switches are on each person.'}},{id:'next-table-free',kind:'faq',topic:'Walk-ins',title:'When is the next table free?',keywords:['next table','free','wait','walk-in','quote','full'],body:'When you\u2019re full, Today and the Display show \u201cNext table free about 19:40 (T6, 4 seats)\u201d with \u201clikely\u201d or \u201cmaybe\u201d, and how long a walk-in for 2 or 4 would wait. Tap Bill requested or Table finished on the plan and it updates. You can also ask the Assistant \u201cwhen\u2019s the next table free?\u201d.'},{id:'time-travel',kind:'faq',topic:'Today',title:'Look at another day (time travel)',keywords:['yesterday','tomorrow','next week','past','future','day','time travel'],body:'On Today, tap \u2039 or \u203a beside the date to step a day back or forward. You\u2019ll see that day\u2019s kitchen hours, events, covers (booked, or how it went), platters and each booking\u2019s allergens and needs. It\u2019s read-only and nothing changes live service. Tap Today to come back. The Display goes back to today by itself after 2 minutes. Staff can look 7 days back and 14 days ahead.'},{id:'sign-in-links',kind:'guide',topic:'Team',title:'Personal sign-in links',keywords:['link','invite','sign in','new link','expired','already used','phone','login'],body:'Each personal link works on one phone only and lasts 5 days, so nobody else can sign in as that person. The same phone can open it again, in any of the apps. If someone gets a new phone, or their link has expired, open Staff & roles, tap New sign-in link on their entry, then Copy link and send it to them yourself. The app never sends it. Owners can make links for anyone; managers for anyone except owners. Their old unused link stops working; phones already signed in stay signed in.',showMe:{tab:'more',page:'staff',target:{testID:'access-tip'},hint:'New sign-in link is on each person.'}},{id:'pins-security',kind:'faq',topic:'Team',title:'PINs for the Display',keywords:['pin','display pin','clock in','wake pin','2580','manager pin','locked'],body:'Staff PINs for clocking in at the Display are 4 to 8 digits. Managers and owners need 6 to 8 digits, because their PIN can add temp staff. Easy PINs such as 1111 or 1234 are refused. Five wrong tries locks that person for 15 minutes; 20 wrong tries on one Display stops it for 15 minutes. The Display wake PIN (Settings \u203a Display) is 6 to 8 digits and is kept only as a scrambled hash. If it still says 2580, change it.'},{id:'cash-up-lock',kind:'faq',topic:'Money',title:'Correcting a signed-off cash up',keywords:['cash up','locked','unlock','correct','mistake','history','audit','sales report'],body:'Once a cash up or weekly sales report is confirmed and saved, it is locked so the figures can\u2019t change quietly. An owner taps Unlock to correct on it, says why, and has 30 minutes to fix it. History on each one shows who signed it off, changed or unlocked it, and when.'},{id:'wipe-device',kind:'faq',topic:'Settings',title:'Sign out and wipe a shared tablet or phone',keywords:['wipe','sign out','shared','tablet','leaver','lost','reset device'],body:'Tap the sync badge (bottom left), or go to Settings \u203a Display, and choose Sign out and wipe this device. It signs out and removes everything CoverCharge keeps on that device: sign-ins, pairing, saved screens and changes not sent yet. The venue\u2019s shared data is not touched. On the Display you type the wake PIN first.'}],o=t=>a.find(a=>a.id===t)},1492,[]); +__d(function(g,r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"HELP_TOPICS",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"HELP",{enumerable:!0,get:function(){return a}}),Object.defineProperty(e,"helpById",{enumerable:!0,get:function(){return o}});const t=['Bookings','Walk-ins','Table plan','Rota','Hours & pay','Tips','Team','Suppliers','Stock','Recipe cards','Displays','Settings','Accounts'],a=[{id:'new-booking',kind:'guide',topic:'Bookings',title:'Take a phone booking',keywords:['booking','reservation','book','table','phone','covers','reserve'],body:'Add a booking for a guest who calls or walks up to ask. The app only offers times that are really free.',steps:['Open Bookings (or tap New booking on Today).','Pick the date, time and number of covers.','Add the guest\u2019s name and phone, plus any allergies or notes.','Tap Save. The booking appears on the timeline and the floor plan.'],showMe:{tab:'bookings',target:{testID:'add-booking'},hint:'Tap New booking to start a booking.'}},{id:'move-booking',kind:'faq',topic:'Bookings',title:'How do I move a booking to another table or time?',keywords:['move','change','reschedule','table','booking','swap'],body:'Open the booking from Bookings or the timeline and tap Edit, or drag it to another table on the Display. Guests are not messaged unless you choose to.',showMe:{tab:'bookings',target:{testID:'add-booking'},hint:'Your bookings list is here. Tap a booking to change it.'}},{id:'walk-in',kind:'guide',topic:'Walk-ins',title:'Seat a walk-in',keywords:['walk-in','walkin','walk in','seat','no booking','covers','party'],body:'Record guests who arrive without a booking so the floor plan and covers stay right.',steps:['On the Display (the venue tablet), tap Walk-in. On a phone, say \u201cadd a walk-in for 2\u201d to the Assistant.','Choose the number of covers.','Pick a free table (the best fit is suggested).','Tap Seat. The table shows as seated.'],actions:['add_walkin']},{id:'table-plan',kind:'guide',topic:'Table plan',title:'Edit the table plan',keywords:['table plan','floor plan','layout','tables','move tables','designer','areas','seats'],body:'Drag tables into place, set seats, join tables and add areas such as Terrace or Garden.',steps:['Go to More \u203a Table plan.','Tap Open the designer.','Drag tables, or tap one to change its name and seats.','Tap Save. Displays and bookings use the new plan straight away.'],showMe:{tab:'more',page:'tableplan',target:{testID:'open-designer'},hint:'Open the designer to move tables.'}},{id:'rota',kind:'guide',topic:'Rota',title:'Build and publish the rota',keywords:['rota','shift','schedule','week','publish','staff hours','add shift'],body:'Plan the week, then publish it so staff see their shifts in the Staff app.',steps:['Go to More \u203a Rota.','Tap a person\u2019s day to add a shift (presets: lunch, dinner, double).','New shifts are drafts with a dashed amber border.','Tap Publish when the week is ready. Staff see only published shifts.'],showMe:{tab:'more',page:'rota',target:{testID:'rota-publish'},hint:'Tap a day to add a shift, then Publish here.'},actions:['add_rota_shift','publish_rota']},{id:'rota-copy',kind:'faq',topic:'Rota',title:'Can I copy last week\u2019s rota?',keywords:['copy','last week','repeat','rota','duplicate'],body:'Yes. On the Rota tap Copy last week. The shifts come over as drafts so you can tweak them before publishing.',showMe:{tab:'more',page:'rota',target:{testID:'rota-copy'},hint:'Copy last week\u2019s shifts as drafts.'}},{id:'sign-off',kind:'guide',topic:'Hours & pay',title:'Sign off hours',keywords:['sign off','signoff','confirm hours','approve','timesheet','clock','pending'],body:'Only confirmed hours count for pay and tips. Check clocked times against the rota and confirm them.',steps:['Go to More \u203a Sign off hours.','Flagged days (late, missing clock-out, long breaks) are at the top.','Tap a row to fix a time; give a short reason.','Tap Confirm all unflagged, then deal with the rest.'],showMe:{tab:'more',page:'signoff',target:{testID:'confirm-unflagged'},hint:'Confirm all the days that look right in one tap.'}},{id:'payroll-hours',kind:'guide',topic:'Hours & pay',title:'Export hours for payroll',keywords:['payroll','export','hours','spreadsheet','csv','excel','accountant','copy','print'],body:'Get each person\u2019s confirmed hours for a pay period into your spreadsheet or to your accountant.',steps:['Go to More \u203a Payroll hours.','Pick the pay period (or a tips fortnight, or a custom range).','Check the pending banner: sign those off first if you can.','Tap Copy for spreadsheet and paste into Excel or Google Sheets, or download a CSV, or print.'],showMe:{tab:'more',page:'hours',target:{testID:'copy-tsv'},hint:'Copy, then paste straight into your spreadsheet.'}},{id:'pay-dates',kind:'faq',topic:'Hours & pay',title:'How do I set our pay dates?',keywords:['pay day','payday','pay dates','cut-off','wages','monthly','fortnightly'],body:'Settings \u203a Pay & tips: set when tips are paid and how often, the wage pay day and the cut-off. Payroll hours and Tips day use these dates.',showMe:{tab:'more',page:'paysettings',target:{testID:'save-pay'},hint:'Change the dates above, then Save.'}},{id:'tips-day',kind:'guide',topic:'Tips',title:'Share out tips on tips day',keywords:['tips','tronc','gratuity','share','split','tips day','service charge'],body:'Enter the tips total and it\u2019s shared by confirmed hours for the fortnight, to the penny.',steps:['Go to More \u203a Tips day (the right fortnight is picked for you).','Type the total tips.','Check anyone with pending hours; sign them off first if you can.','Copy or download the split for payroll.'],showMe:{tab:'more',page:'tipsday',target:{testID:'tips-total'},hint:'Type the tips total here.'}},{id:'invites',kind:'guide',topic:'Team',title:'Invite staff to the app',keywords:['invite','link','staff app','new starter','sign in','add staff','team member'],body:'Each person gets their own sign-in link. You choose when and how to share it.',steps:['Go to Settings \u203a Invite links.','Tap Make invite link next to the person.','Share the link yourself (text or WhatsApp). The app never sends it for you.','They tap it once and the Staff app remembers them.'],showMe:{tab:'more',page:'setup-invites',target:{text:'Make invite link'},hint:'Make a personal link, then share it yourself.'}},{id:'suppliers',kind:'guide',topic:'Suppliers',title:'Suppliers and order sheets',keywords:['supplier','order','order sheet','delivery','cut-off','fish','veg','dairy'],body:'Keep supplier contacts, order days and cut-offs together, and log what you ordered.',steps:['Go to More \u203a Suppliers to add or edit a supplier.','Use Supplier order sheets for the items you usually order.','Tap Log an order after you place it by phone or email.'],showMe:{tab:'more',page:'ordersheets',target:{testID:'sheet-add'},hint:'Add an order sheet for a supplier.'}},{id:'display-glance',kind:'guide',topic:'Display',title:'Today at a glance (Display)',keywords:['glance','today','covers by hour','breaks','on now','next','cut-off','cutoff','order times','display bar'],body:'The bar under the Display header shows today in one line: covers by hour (booked in solid gold, the walk-in estimate dashed), quiet times for breaks, who is on now and next, today\u2019s supplier order cut-offs with a countdown (amber under 30 minutes) and one tip. Cut-offs come from Scheduled notifications.'},{id:'sold-out',kind:'guide',topic:'Menu',title:'Sold out dishes',keywords:['sold out','run out','ran out','none left','back on','86','eighty six','display strip'],body:'When a dish runs out, mark it sold out so every member of staff knows. It\u2019s a reminder for staff: CoverCharge doesn\u2019t link up to your till, so it doesn\u2019t change the till. Sold out dishes show in a slim strip along the bottom of the Display within seconds, and in the Sold out list in Front of House, Managers and Head Chef. They clear by themselves when the kitchen closes (or the next morning, or only when you tap Back on: Settings \u203a Advanced \u203a Sold out reminders).',steps:['Open the Sold out list (Managers: More \u203a Sold out; Front of House: Me \u203a Sold out; Head Chef: Kitchen \u203a Live tickets \u203a Sold out).','Tap Mark sold out next to the dish.','When it\u2019s back, tap Back on.'],showMe:{tab:'more',page:'soldout',target:{testID:'soldout-search'},hint:'Find the dish, then tap Mark sold out.'}},{id:'shellfish',kind:'guide',topic:'Stock',title:'Live shellfish (and other) counts',keywords:['shellfish','lobster','crab','oysters','count','stock','tracked','sold out','86'],body:'Counters for things you sell by the unit, like lobster or crab. They show on the Display and warn when low.',steps:['Go to Settings \u203a Tracked stock.','Tap Add an item to track; set the name, icon and low warning.','Staff update the count from the small lobster and crab chip at the top of the Display, or in the app.'],showMe:{tab:'more',page:'trackedstock',target:{text:'Add an item to track'},hint:'Add something to count, like lobster.'}},{id:'recipe-cards',kind:'guide',topic:'Recipe cards',title:'Recipe cards',keywords:['recipe','card','dish','ingredients','method','allergens','spec'],body:'Photo, ingredients, method and allergens for each dish; the head chef signs them off and staff can read them.',steps:['Go to More \u203a Recipe cards.','Search for a dish or add a new one.','Fill in ingredients (allergens are suggested) and the method.','Send for head chef sign-off.'],showMe:{tab:'more',page:'recipecards',target:{testID:'card-search'},hint:'Search your recipe cards here.'}},{id:'display-pair',kind:'guide',topic:'Displays',title:'Pair a display or tablet',keywords:['display','tablet','pair','screen','code','front of house','kitchen screen'],body:'Connect a tablet to your venue with a one-time code. You can switch any display off from here.',steps:['Open the Display app on the tablet.','In Managers go to Settings \u203a Displays and tap Make a pairing code.','Type the code on the tablet. It joins your venue straight away.'],showMe:{tab:'more',page:'displays',target:{text:'Make a pairing code'},hint:'Make a one-time code for the tablet.'}},{id:'settings-hours',kind:'faq',topic:'Settings',title:'How do I change our opening hours?',keywords:['opening hours','hours','closed','open','kitchen hours','times'],body:'Settings \u203a Opening hours. Guests see these on your booking and order pages; bookings outside them are turned away.',showMe:{tab:'more',page:'setup-hours',hint:'Set each day\u2019s opening and closing time here.'}},{id:'replay-setup',kind:'faq',topic:'Settings',title:'Can I see the welcome walkthrough again?',keywords:['welcome','setup','walkthrough','onboarding','checklist','questionnaire'],body:'Yes: Settings \u203a Setup checklist \u203a Replay welcome. Everything is pre-filled from your questionnaire.',showMe:{tab:'more',page:'setupchecklist',target:{testID:'replay-welcome'},hint:'Replay the welcome walkthrough.'}},{id:'connected-accounts',kind:'guide',topic:'Accounts',title:'Connect your email, website and socials',keywords:['connect','account','gmail','outlook','wix','facebook','instagram','square','xero','quickbooks','login'],body:'Settings \u203a Connected accounts: tap a logo, save the account to your list, and use Connect with\u2026 to sign in on that service\u2019s own page (rolling out service by service; it shows Coming soon until then). CoverCharge never sees your password that way, and you can remove an account any time.',steps:['Go to Settings \u203a Connected accounts.','Tap the service\u2019s logo.','Tap Connect with\u2026 and sign in on their page.','To stop, tap Remove.'],showMe:{tab:'more',page:'connections',target:{testID:'conn-tile-gmail'},hint:'Tap a logo to connect that account.'}},{id:'supplier-portals',kind:'guide',topic:'Suppliers',title:'Order from your suppliers',keywords:['bidfood','booker','wholesale','cash and carry','order online','supplier login','account number','customer number'],body:'Settings \u203a Connected accounts \u203a Suppliers. Add supplier links for this venue, with an account number if you like. Open ordering and Log in open the supplier\u2019s own website, where you sign in; CoverCharge never keeps the password.',steps:['Go to Settings \u203a Connected accounts.','Scroll to Suppliers.','Tap Add against a supplier (account number optional).','Tap Open ordering or Log in whenever you need them.','To stop, tap Remove and confirm.'],showMe:{tab:'more',page:'connections',target:{testID:'portal-bidfood'},hint:'Your supplier ordering websites live here.'}},{id:'support',kind:'faq',topic:'Settings',title:'How do I get help from a person?',keywords:['support','help','contact','person','problem','broken','stuck'],body:'Support is free for life. Message the CoverCharge team from Settings \u203a Help, or email us, and we\u2019ll reply. We help by message and email.'},{id:'assistant-safe',kind:'faq',topic:'Settings',title:'Can the Assistant send or pay for things by itself?',keywords:['assistant','safe','confirm','send','pay','delete','ai'],body:'No. The Assistant and the voice helper show you exactly what they will do and wait for you to tap Confirm (or say yes). Anything that would send a message, order from a supplier or pay is only saved as a draft in Drafts for approval; nothing goes out by itself.'},{id:'restaurant-dashboard',kind:'guide',topic:'Bookings',title:'Restaurant dashboard',keywords:['restaurant dashboard','tables','timeline','guests','covers','joined tables'],body:'In Managers, tap Restaurant dashboard on Home, or More > Run the day > Restaurant dashboard. It is the same live table plan, Timeline, guest list, deposits, dogs, joined tables, Covers, covers-through-the-day chart and block bookings as the Display. Use the day arrows and Back to today. Assign or join tables on any day; seat, finish, no-show and cancel walk-in actions apply today. You can also say \u201copen Restaurant dashboard\u201d. The helper replies in text only.',showMe:{tab:'more',page:'serviceboard',target:{testID:'restaurant-dashboard-close'},hint:'Restaurant dashboard is open. Pick a day, or tap Back to Managers to close.'}},{id:'voice-helper',kind:'guide',topic:'Settings',title:'Use the hold-to-talk voice button',keywords:['voice','talk','speak','microphone','mic','hold','walkie','button','hands free','gloves'],body:'Hold the big gold button, say what you need, then let go. It logs fridge and freezer temperatures, answers allergen questions, marks dishes sold out, checks tables, adds to the waitlist, reads orders and covers, and drafts bookings, offers, events and supplier lists. The helper replies in text only, never aloud. Changes are shown in text first with Confirm and Cancel buttons: tap Confirm or say yes. Tap the button to type instead (in Managers this also opens the Assistant). It sits at the top right of the header in Managers, Head Chef, the Staff app (the full voice assistant, with no money, tips or HR) and on the Display (no money, tips or HR). Until the voice assistant\u2019s server is switched on, anything new says \u201cVoice assistant is switching on soon\u201d. Fair usage: 1,000 voice tasks a month per venue.',steps:['Hold the gold microphone button (the first time, allow the microphone).','Speak, for example \u201cprep fridge 3 degrees\u201d.','Let go to send.','If it reads something back, tap Confirm or hold again and say \u201cyes\u201d.','The button stays at the top right so it never covers the screen.'],showMe:{tab:'more',page:'voice',hint:'Turn the voice button on or off for each role here.'}},{id:'voice-drafts',kind:'faq',topic:'Settings',title:'Where do voice bookings and shopping lists go?',keywords:['drafts','approve','approval','shopping list','booker list','bidfood list','draft booking','offer','event'],body:'To Settings \u203a Drafts for approval. Bookings, supplier lists, offers, events and specials made by voice wait there for an owner or manager. Approving marks it approved and opens the right screen; you still place the order or confirm the booking yourself.',showMe:{tab:'more',page:'drafts',hint:'Drafts from the voice helper wait here.'}},{id:'voice-temps',kind:'guide',topic:'Settings',title:'Log fridge and freezer temperatures by voice',keywords:['temperature','fridge','freezer','haccp','food safety','eho','log temps','probe'],body:'Hold the voice button and say the unit and the number, for example \u201cprep fridge 3, freezer minus 19\u201d. Fridges should be 5\xb0C or colder and freezers -18\xb0C or colder; anything outside is flagged. Everything is in the Food safety log with who and when, ready to export or print for the EHO.',showMe:{tab:'more',page:'haccp',hint:'Every voice reading appears in the food safety log.'}},{id:'voice-fair-usage',kind:'faq',topic:'Settings',title:'Is there a limit on voice tasks?',keywords:['voice','limit','allowance','fair usage','fair use','how many','tasks','month','plan'],body:'Fair usage: 1,000 voice tasks a month per venue. It is one allowance shared by all of the venue\u2019s apps and devices, and it resets on the 1st. Each request counts once, spoken or typed; saying \u201cyes\u201d to confirm does not count again. You will see a note at 80%. If the venue reaches 1,000, the voice helper pauses until the 1st, except food safety and temperature logging, which always works. The owner can contact CoverCharge if you need more. See the count in Plan & billing or Settings \u203a Voice helper.',showMe:{tab:'more',page:'voice',hint:'This month\u2019s voice task count is shown here.'}},{id:'adv-bookings',kind:'guide',topic:'Settings',title:'Booking questions: allergies, dogs, access, vegan',keywords:['advanced','allergen','dog','dogs','cap','wheelchair','access','vegan','vegetarian','table request','settings'],body:'Choose what guests are asked when they book. Allergies are always asked first, in red, and staff tick \u201cAllergens seen\u201d. The others can be switched off.',steps:['Open More \u203a Settings \u203a Advanced.','In Bookings, tick or untick each question.','Use the dog stepper to cap dogs per booking time (No limit = only the dog-friendly tables).','Mark dog-friendly and step-free tables on the Table plan.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-bookings'},hint:'Booking questions are here.'}},{id:'adv-table-times',kind:'guide',topic:'Settings',title:'How long tables stay (table times)',keywords:['advanced','dwell','table time','turn','how long','next table free','minutes'],body:'Usual table times by party size: 90 min for 1\u20132 covers, 105 for 3\u20135, 2 hours for 6\u201319 and 3 hours for 20 or more. The app fine-tunes them from how long your tables really stay, and uses them for \u201cNext table free\u201d.',steps:['Open More \u203a Settings \u203a Advanced \u203a Table times.','Tap \u2212 or + to change a band by 5 minutes.','Untick \u201cFine-tune\u201d to use your numbers exactly.','Reset to default puts the four bands back.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-times'},hint:'Table times are here.'}},{id:'adv-reservable',kind:'guide',topic:'Settings',title:'Seafood platter, crab and lobster reservations',keywords:['advanced','platter','seafood','crab','lobster','reserve','price'],body:'Guests can reserve the Seafood Platter (1 crab + 1 lobster, \xa3160) or a crab or lobster with their booking. Reserved ones come off the Display count with a \u201cReserved\u201d line, the kitchen is told, and the Head Chef taps OK.',steps:['Open More \u203a Settings \u203a Advanced \u203a Reservable items.','Tick what guests can reserve and set the price.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-reserve'},hint:'Reservable items are here.'}},{id:'adv-events',kind:'guide',topic:'Settings',title:'Regular events like Open Mic Night',keywords:['advanced','open mic night','music night','event','regular','monthly','promote','busier','last food'],body:'Add events that repeat, e.g. Open Mic Night on the last Sunday of every month from 8pm with last food orders at 7pm. They show in Forecast key dates with a Promote button and on Today, and \u201cExpect busier\u201d raises the forecast.',steps:['Open More \u203a Settings \u203a Advanced \u203a Regular events.','Tap Add a regular event (or Edit).','Pick how it repeats and the day, add a start time and last food orders if needed.','Tap Save event.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-events'},hint:'Regular events are here.'}},{id:'adv-hours',kind:'guide',topic:'Settings',title:'Kitchen hours, seasons and special days',keywords:['advanced','hours','kitchen','season','winter','summer','special day','closed','last food orders','cutoff'],body:'Kitchen (food) hours decide which booking times are offered; the closing time is last food orders. Keep Winter and Summer hours, each with the date it starts every year, and the app switches by itself. Add special days for one-off changes.',steps:['Open More \u203a Settings \u203a Advanced \u203a Kitchen hours.','Tap Set Summer hours, fill in each day and the start date (e.g. 04-01 for 1 April).','Set the Winter start date too.','Use Add a special day for closures or late nights.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-hours'},hint:'Kitchen hours and seasons are here.'}},{id:'adv-home',kind:'faq',topic:'Settings',title:'Covers counter, Next table free and takeaway on home screens',keywords:['advanced','covers counter','takeaway','next table free','home','display','flip'],body:'Turn the COVERS counter and the \u201cNext table free\u201d card on or off, and choose whether takeaway figures show on home screens (off at the Anchorage). Takeaway order alerts always work. The flap click sound is set on each Display.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-home'},hint:'Display and home options are here.'}},{id:'adv-holidays',kind:'faq',topic:'Settings',title:'Why don\u2019t bank holidays say \u201c(substitute day)\u201d?',keywords:['advanced','holiday','substitute','bank holiday'],body:'The date already shows when a holiday moves, so the extra words are hidden. Tick \u201cShow full gov.uk names\u201d in Settings \u203a Advanced \u203a Holiday names to bring them back.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-holidays'},hint:'Holiday names are here.'}},{id:'adv-blocks',kind:'guide',topic:'Settings',title:'Lunch and dinner times for Block now',keywords:['block','lunch','dinner','service','wix','advanced','pause'],body:'Settings \u203a Advanced \u203a Block bookings sets when Lunch and Dinner run, for the Block now buttons and Spend per head. At The Anchorage, blocks also close those times on website bookings, and blocks made on the website show in CoverCharge. Website bookings can only close the whole venue, not one area or some tables.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-blocks'},hint:'Block bookings settings are here.'}},{id:'blocks-screen',kind:'guide',topic:'Bookings',title:'Block bookings: today, a future date, an area or some tables',keywords:['block','blocks','pause','close','closed','stop bookings','private','repeat','future'],body:'Tap Block bookings on the home screen. Block now pauses bookings today (Rest of today, Next hour, Lunch, Dinner, or a From\u2013To). Add a block closes a future date or range, the whole day or set times, the whole venue, one area or some tables, once or every week or on the last weekday of the month. Every future block is listed by month with Edit and Remove; removing asks first and is logged. Bookings already made are kept, and you are told how many.',showMe:{tab:'more',page:'blocks',target:{testID:'blocks-screen'},hint:'Block bookings is here.'}},{id:'spend-per-head',kind:'guide',topic:'Money',title:'Spend per head',keywords:['spend per head','sph','average spend','takings','covers','gross'],body:'Spend per head is Gross takings \xf7 Covers, by day, by week and for lunch and dinner. Enter the gross on the cash up (Enter the cash up, Upload a spreadsheet, or Enter takings). Covers are seated and finished bookings and walk-ins; no-shows and cancellations are left out. A day with no takings shows \u201cNo takings entered\u201d, never \xa30.',showMe:{tab:'more',page:'spendhead',target:{testID:'sph-screen'},hint:'Spend per head is here.'}},{id:'cashup-photo',kind:'guide',topic:'Money',title:'Enter the cash up, or upload a spreadsheet',keywords:['cash up','paid out','spreadsheet','csv','excel','xlsx','sheet','gross','card','cash','tips','takings','drawer'],body:'In Cash up & sales tap Enter the cash up and type the figures (Z total, card, cash, paid outs, tips, and gross if you have it). In Paid out, add a line for each amount taken from the till \u2014 for example lobsters or supermarket shopping \u2014 with the amount, an optional note, and your name. The paid-out total comes off the expected cash in the drawer. Check every figure, then tap Confirm and save. Bigger venues can tap Upload a spreadsheet (CSV or Excel): match the columns, check the preview (dates already saved are flagged), then confirm. Nothing is saved before you confirm, and every save is logged. You can export cash ups as a spreadsheet from Recent cash ups.',showMe:{tab:'more',page:'cashup',target:{testID:'cashup-by-hand'},hint:'Start the cash up here.'}},{id:'adv-giftqr',kind:'guide',topic:'Settings',title:'Buy a gift card on the Display',keywords:['gift','gift card','voucher','qr','display','wix','advanced'],body:'Switch on \u201cShow Buy a gift card on the Display\u201d in Settings \u203a Advanced \u203a Gift cards on the Display, and save your gift card page address. The Display has a Gift vouchers button: it opens the list of website vouchers (search, use by dates, Mark as used), with Show the buy QR code at the bottom. Guests buy on your website.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-giftqr'},hint:'Gift cards on the Display are here.'}},{id:'adv-whatsapp',kind:'guide',topic:'Settings',title:'WhatsApp buttons (tap to chat)',keywords:['whatsapp','wa.me','message','chat','guest','mobile','number','advanced'],body:'Put the venue\u2019s WhatsApp number in Settings \u203a Advanced \u203a WhatsApp, e.g. 01292 500123 or +44 7700 900123. Guests then see \u201cMessage us on WhatsApp\u201d on their booking confirmation, with their booking details typed in. Staff and managers see \u201cWhatsApp guest\u201d on bookings with a mobile number, with a confirmation typed in that you can change. Nothing is ever sent for you: WhatsApp opens and you tap Send yourself. Leave the number blank and every WhatsApp button stays hidden. Reset to default clears the number.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-whatsapp'},hint:'The WhatsApp number is here.'}},{id:'adv-reminders',kind:'guide',topic:'Settings',title:'Staff reminders: breaks and \u201cchairs up\u201d',keywords:['reminder','reminders','break','breaks','chairs','closing','6 hours','law','snooze','later','done','advanced'],body:'Reminders slide up for staff who are on shift right now (clocked in, or on the rota at that time) in the Staff and Head Chef apps, while the app is open. Break reminders: if the rota shift has a break time, the reminder comes at that time; if not, it comes 4 hours after they clock in (or after the shift starts). If they still haven\u2019t started a break it comes once more 30 minutes later, and again at 6 hours, because UK law says a shift over 6 hours needs a 20-minute break. \u201cStart break\u201d starts their break; \u201cLater\u201d hides it for 15 minutes. You can change these times. Venue reminders, such as \u201cTime to put the chairs up on the tables\u201d (Friday and Sunday, 21:00), have wording, days, a time (UK) and who sees them: everyone on shift, front of house or kitchen. Pause, edit or delete any of them, or add your own. Once anyone taps Done it goes for everyone that day, and the Reminders screen shows who did it. Reset to default brings back the standard break times and \u201cchairs up\u201d; your own reminders stay. Phones with the app closed don\u2019t get reminders yet.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-reminders'},hint:'Reminders are here.'}},{id:'adv-notifications',kind:'guide',topic:'Settings',title:'Scheduled notifications (e.g. the Mills milk order)',keywords:['notification','notifications','push','phone','milk','mills','pieroni','pieronis','veg','olsen','rota upload','scheduled','advanced'],body:'Settings \u203a Advanced \u203a Notifications lists reminders that go to named people at a set UK time, such as \u201cMills milk order\u201d for the Head Chef and Gordon. Each has a title, a message, the days, a time (you can set a different time on some days, e.g. 20:55 on Fridays), who gets it (tick people or pick a group like Everyone on shift) and how it is sent. In the app it is the gold slider with Done and Later; Done is logged with the name and time, and Later hides it for 15 minutes. Urgent notices (like the 6-hour break) always come first and only one shows at a time. Phone notifications: each person taps \u201cTurn on phone notifications\u201d on their own phone (iPhone: add the app to the Home Screen first, iOS 16.4 or later). Nothing goes to phones until an owner or manager switches \u201cSend to phones\u201d on. The Display never gets these. Reset to default restores the configured rules.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-notifications'},hint:'Notifications are here.'}},{id:'adv-order-lists',kind:'guide',topic:'Settings',title:'Order lists (Alsons, Cash and carry)',keywords:['order list','orders','alsons','drinks','cash and carry','trip','shopping','logo','carry over','advanced'],body:'Order lists collect what you need from a supplier. A running list (Alsons drinks) fills up until you order; a trip list (Cash and carry) is for a shopping day, Friday by default, which you can change for each trip. Add an item with a quantity and unit and an optional note; the app records who added it and when. Adding something already on the list offers to add to the quantity instead. On the day, tick Got or Ordered, or mark Missing / not in stock. Finish order saves it to History (date and who) and asks whether to carry over anything not got. Removing an item can be undone. Settings \u203a Advanced \u203a Order lists: add, rename or archive lists, the default trip day, and \u201cLet all staff add items\u201d (on: staff can add and see lists; only managers and the Head Chef tick, remove or finish). Each list can have a logo (take a photo or choose one) or shows its initials, and a phone number to tap to call (never called for you).',showMe:{tab:'more',page:'advanced',target:{testID:'adv-orderlists'},hint:'Order list settings are here.'}},{id:'adv-clock-area',kind:'guide',topic:'Settings',title:'Clock-in area, forgotten breaks and off-rota arrivals',keywords:['clock','clock in','geofence','location','area','radius','break','forgot','rota','visiting','override','advanced'],body:'Clock in, clock out, start break and end break only work at the venue once the centre is set. Stand in the middle of the venue and tap \u201cUse my current location\u201d, then choose how far (at least 50 m, 100 m to start). Phones are not exact, so up to 50 m of the phone\u2019s own accuracy is allowed on top. Each clock record keeps the reading, its accuracy and whether it was inside. If location is off or blocked, the app says how to allow it. Managers can record it for someone from Clock in / out \u203a Record it for someone, with a reason that is logged. Until the centre is set nobody is blocked and managers see a warning. Rota and pay screens are never blocked. Forgotten breaks: if no break was recorded, Clock out asks \u201cDid you take a break? If so, how long?\u201d; a length you pick is saved as a break marked \u201cadded at clock-out\u201d, which managers see and can edit in Hours. Not on the rota: if someone is at the venue, not clocked in and not on the rota, the Staff and Head Chef apps ask \u201cDo you want to sign in?\u201d. Yes clocks them in, marked off-rota, and managers get a notice; \u201cNo, just visiting\u201d stops asking for the day. This only checks while the app is open; web apps can\u2019t watch location in the background.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-clockarea'},hint:'Clock-in area settings are here.'}},{id:'adv-tablegrid',kind:'guide',topic:'Table plan',title:'Table plan grid and Tidy up (Advanced)',keywords:['grid','snap','line up','align','tidy','guides','spacing','restore','table plan','option','alt'],body:'Tables snap to the grid when you drag them, and gold guides show when an edge or centre lines up with another table. A small number shows when the gaps either side are even. Hold Alt (Option on a Mac) to move freely. Tidy up lines every table up on the grid and evens out the rows; only positions change. The old positions are kept, so one tap puts them back.',steps:['Go to Settings \u203a Advanced.','Find Table plan grid.','Turn snapping on or off, pick a grid size, or tap Tidy up the whole plan.','Changed your mind? Tap Put the tables back where they were.']},{id:'adv-printers',kind:'guide',topic:'Orders',title:'Kitchen ticket printers (Advanced)',keywords:['print','printer','printing','ticket','kitchen ticket','docket','receipt','epson','star','bluetooth','reprint','takeaway'],body:'Print a kitchen ticket by itself for every takeaway order, as soon as it comes in or when it is accepted. The ticket has the order number, collection time, name, every dish with its options and notes, allergies in white-on-black, and paid or not paid. Works with Epson (TM-m30, TM-T20, TM-T88), Star WebPRNT, most other network receipt printers (port 9100) and Bluetooth printers from the tablet app. If a ticket does not print, an amber warning shows and the order stays on screen.',steps:['Go to Settings \u203a Advanced.','Find Printers.','Tap Add a printer by IP address or Find printers on this Wi-Fi, choose the type and tap Test print.','Turn on Print a kitchen ticket for every takeaway order.']},{id:'adv-deposits',kind:'guide',topic:'Bookings',title:'Deposits (Advanced)',keywords:['deposit','deposits','per person','per adult','children','waive','waived','regular','party size','refund','refundable','cut off','policy','paid','due'],body:'Ask bigger tables for a deposit: set the amount per adult (children never pay and do not count towards the number that needs one: a table of 8 with 3 children pays nothing; a table of 6 adults, or 7 with 1 child, pays for 6), the smallest number of adults that pays one (6 or more adults at The Anchorage), whether it is refundable and up to how many hours before, and the words guests see. Staff can waive a deposit. No card is saved in CoverCharge. Deposits are paid through website bookings: website bookings show Deposit paid on website bookings, Part paid on website bookings or Deposit not paid by themselves. For phone and walk-in bookings, staff tick Deposit paid once the guest has paid you, or (once switched on) press Send deposit link to send a website bookings pay link by text, WhatsApp or email. Refunds are done in Website bookings \u203a Orders. Deposit amounts are shown on bookings in Managers, Display and Staff. Other financial and HR information remains restricted.',steps:['Go to Settings \u203a Advanced.','Find Deposits.','Turn deposits on or off, and set the amount, party size, refund terms and the words guests see.','On a booking, tap Mark deposit paid once the guest has paid.','To let a regular off, tap Waive deposit on the booking (or in Edit booking), add why if you like, and tap Yes, waive it. Your name is saved with it.']},{id:'adv-loyalty',kind:'guide',topic:'Guests',title:'Loyalty: stamp card, offers & bring a friend (Advanced)',keywords:['loyalty','stamp','stamps','card','reward','offer','offers','referral','friend','expiry'],body:'The stamp card, offers and bring-a-friend are saved on the server, so every phone and tablet shows the same card. Set how many stamps earn a reward, what the reward is, when stamps or rewards run out, and how often one guest can get a stamp. Stamps only come from staff, or from a code or QR staff make, and each reward can be used once. Guests join with their agreement recorded, and a manager can remove a guest and their details.',steps:['Go to Settings \u203a Advanced.','Find Loyalty.','Turn the stamp card on, write the reward and tap Save loyalty settings.','Add offers with their dates, and turn bring-a-friend on if you want it.']},{id:'adv-table-order',kind:'guide',topic:'Guests',title:'Order at the table (Advanced)',keywords:['order at table','qr','qr code','scan','table','phone','accept','last orders','print','pdf','pay at bar'],body:'Guests scan the small QR card on their table (Managers \u203a Table QR codes prints them, 20 to a page), see your menu with allergens, and send an order. It lands in Front of House and on the kitchen screen within seconds. Prices, sold-out dishes and hours are checked on the server, so a phone can\u2019t change them. Staff accept the first order from each new phone (you can turn this off). Guests pay at the bar or with their server; paying by card from the phone is coming later.',steps:['Go to Settings \u203a Advanced.','Find Order at the table.','Turn it on, pick the areas or tables, set the hours and tap Save order at the table.','Tap Make codes, pick Stickers 50 \xd7 50 mm or Stand cards 50 \xd7 70 mm, then Print all QR cards (PDF) and put each code on its table.']},{id:'adv-soldout',kind:'guide',topic:'Menu',title:'Sold out reminders (Advanced)',keywords:['sold out','86','clear','end of service','next morning','back on','advanced','display strip','automatic','counts','lobster','crab'],body:'Choose when sold out dishes go back on by themselves: when the kitchen closes (from your Kitchen hours), the next morning (pick the time), or only when someone taps Back on. \u201cMark dishes sold out from the counts\u201d (on unless you turn it off) marks every dish that uses a counted item, like lobster or crab, when the count runs out, and puts it back on when the count is back up. Sold out is a reminder for staff on the Display and in the staff apps; it doesn\u2019t change your till.',steps:['Go to Settings \u203a Advanced.','Find Sold out reminders.','Pick when they clear, and turn marking from the counts on or off.']},{id:'sold-out-auto',kind:'guide',topic:'Menu',title:'Sold out from the counts (lobster, crab\u2026)',keywords:['sold out','automatic','auto','counts','shellfish','lobster','crab','platter','link','uses','none left'],body:'When a counted item runs out, or drops below what a dish needs, every dish that uses it is marked sold out by itself, with the reason: \u201cDeluxe Seafood Platter (no lobster or crab)\u201d. When the count is back up (a delivery or a recount), those dishes go back on by themselves. Dishes marked by hand are left alone. CoverCharge works out what each dish uses from its recipe card, its description (\u201cone whole lobster\u201d) or its name; you can change it for any dish. If you tap Back on while the count is still short, the dish stays on until the count changes.',steps:['Open the Sold out list.','Under Dishes linked to the counts, tap Change next to a dish.','Set how many of each item one portion uses (0 = not linked), then tap Save. Back to automatic undoes it.'],showMe:{tab:'more',page:'soldout',target:{testID:'soldout-links'},hint:'Tap Change next to a dish to set what it uses.'}},{id:'adv-forecast',kind:'guide',topic:'Forecasts',title:'Forecast history and "Not enough history yet"',keywords:['forecast','not enough history','history','estimate','example figures','labour','sales','walk-ins','advanced'],body:'Forecasts are built only from your own bookings, seated walk-ins, takeaway orders and cash-ups. Until CoverCharge has enough of your history (2 weeks to start with; change it in Settings \u203a Advanced \u203a Forecast history) you see \u2018Not enough history yet\u2019, what is already booked and your real labour cost from the rota, with no sales forecast or labour %. No history is invented for a live venue.',steps:['Go to Settings \u203a Advanced.','Find Forecast history.','Pick how many weeks are needed.']},{id:'adv-checkout',kind:'guide',topic:'Team',title:'Shift check-out, question board and team morale',keywords:['check out','checkout','morale','mood','staffing','overstaffed','survey','anonymous','question board','vote','shout out','wellbeing','advanced'],body:'When someone clocks out, they get a quick card: team morale from Low to High, and whether there was enough staff for the customers. They can also post a question for the board or shout out a teammate, or tap Skip. Nothing shows at clock in. Answers are anonymous: no name or staff number is saved, and each phone can answer a shift once. Team morale (Managers app \u203a More \u203a Team morale) shows a day only once 3 or more people have answered, next to that day\u2019s covers. Change the wording or switch parts off here.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-checkout'},hint:'Check-out and board settings are here.'}},{id:'hr-board',kind:'guide',topic:'Team',title:'The anonymous question board',keywords:['question board','board','anonymous','vote','yes no','reply','hide','moderation','log'],body:'Anyone on the team can post a question and vote it up, or vote Yes or No. No names are shown or saved. Owners and managers can reply (shown as \u201cReply from the managers\u201d) and hide offensive posts with a reason. Every hide, unhide and reply is in the Moderation log.',showMe:{tab:'more',page:'board',hint:'The question board.'}},{id:'adv-tasks',kind:'guide',topic:'Team',title:'Daily tasks',keywords:['tasks','daily tasks','checklist','duties','jobs','to do','my tasks','library','head chef'],body:'Give each person a short list of daily tasks: open Staff & roles, tap Daily tasks on their card, then pick from the venue\u2019s task library or type a new one. Use the arrows to reorder, \u2715 to remove (with Undo) and Days to limit a task to certain days. They see \u201cMy tasks today\u201d on their home screen and tick each one off while on shift; each tick records who and when, and you see \u201c2 of 5 done today\u201d on their card. Lists start fresh every day. Owners and managers can change anyone\u2019s list, including the Head Chef\u2019s. The Head Chef can change the lists of kitchen staff (chefs, commis and KPs) from Kitchen \u203a Kitchen team tasks, but not their own and not front of house. The task library is in Settings \u203a Advanced \u203a Tasks.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-tasks'},hint:'The task library is here.'}},{id:'adv-cashup',kind:'guide',topic:'Money',title:'Cash up and weekly sales',keywords:['cash up','cashup','takings','float','till','sales report','weekly sales','pos','printout','photo','graphs','charts'],body:'At the end of the night open Cash up & sales and tap Enter the cash up. Type each figure; boxes left blank stay blank (never counted as zero) and are highlighted in amber. Add any cash paid out of the till (lobsters, supermarket shopping, and the like) in the Paid out section: each line has what it was for, the amount, an optional note and who entered it. The total reduces the expected cash in the drawer. Nothing is saved until you tap Confirm and save. Do the same with the weekly sales report from the till (several pages is fine). The graphs show daily takings, tips, weekly net sales against the week before and sales by category. Owners and managers can enter and change cash ups; the Head Chef can see the graphs if they are allowed to see takings. Change the boxes to match your sheet in Settings \u203a Advanced \u203a Cash up; Cash tips total and Card tips total are always kept.',showMe:{tab:'more',page:'cashup',target:{testID:'cashup-by-hand'},hint:'Start the cash up here.'}},{id:'adv-tips',kind:'guide',topic:'Money',title:'Today\u2019s tips and the Tips pot',keywords:['tips','today tips','tips pot','pot','payout','tip pay','correction','coins'],body:'When a cash up with Cash tips total and Card tips total is confirmed, the team\u2019s combined tips for that day show as Today\u2019s tips in every staff app and on the Display, with a short notice. The Tips pot adds up confirmed daily tips since the last payout (fortnightly tip pay). After paying the tips, an owner or manager taps Mark payout done on the Tips pot card: the pot goes back to \xa30.00 and the old pot is kept in Past pots. Use Correct an entry to add or take off an amount for a day; a reason is required and every correction is logged with your name. Only the team total is ever shown, never anyone\u2019s share. Hide either card in Settings \u203a Advanced \u203a Tips.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-tips'},hint:'Show or hide the tips cards here.'}},{id:'manager-access',kind:'guide',topic:'Team',title:'Manager access',keywords:['manager access','manager','access','role','promote','front of house','head chef','owner'],body:'In Staff & roles each person has a Manager access switch. On: they use the Manager app (rota, bookings, staff, hours, settings, plus their own clock in, rota and pay). Off: they use the Front of House app, or the Head Chef app for the Head Chef. Owners can switch anyone except owners; managers can switch anyone except themselves and owners. The last owner can never be removed. You confirm each change; it is logged with who and when (Access changes). Job titles are free text and don\u2019t change.',showMe:{tab:'more',page:'staff',target:{testID:'access-tip'},hint:'Manager access switches are on each person.'}},{id:'next-table-free',kind:'faq',topic:'Walk-ins',title:'When is the next table free?',keywords:['next table','free','wait','walk-in','quote','full'],body:'When you\u2019re full, Today and the Display show \u201cNext table free about 19:40 (T6, 4 seats)\u201d with \u201clikely\u201d or \u201cmaybe\u201d, and how long a walk-in for 2 or 4 would wait. Tap Bill requested or Table finished on the plan and it updates. You can also ask the Assistant \u201cwhen\u2019s the next table free?\u201d.'},{id:'time-travel',kind:'faq',topic:'Today',title:'Look at another day (time travel)',keywords:['yesterday','tomorrow','next week','past','future','day','time travel'],body:'On Today, tap \u2039 or \u203a beside the date to step a day back or forward. You\u2019ll see that day\u2019s kitchen hours, events, covers (booked, or how it went), platters and each booking\u2019s allergens and needs. It\u2019s read-only and nothing changes live service. Tap Today to come back. The Display goes back to today by itself after 2 minutes. Staff can look 7 days back and 14 days ahead.'},{id:'sign-in-links',kind:'guide',topic:'Team',title:'Personal sign-in links',keywords:['link','invite','sign in','new link','expired','already used','phone','login'],body:'Each personal link works on one phone only and lasts 5 days, so nobody else can sign in as that person. The same phone can open it again, in any of the apps. If someone gets a new phone, or their link has expired, open Staff & roles, tap New sign-in link on their entry, then Copy link and send it to them yourself. The app never sends it. Owners can make links for anyone; managers for anyone except owners. Their old unused link stops working; phones already signed in stay signed in.',showMe:{tab:'more',page:'staff',target:{testID:'access-tip'},hint:'New sign-in link is on each person.'}},{id:'pins-security',kind:'faq',topic:'Team',title:'PINs for the Display',keywords:['pin','display pin','clock in','wake pin','2580','manager pin','locked'],body:'Staff PINs for clocking in at the Display are 4 to 8 digits. Managers and owners need 6 to 8 digits, because their PIN can add temp staff. Easy PINs such as 1111 or 1234 are refused. Five wrong tries locks that person for 15 minutes; 20 wrong tries on one Display stops it for 15 minutes. The Display wake PIN (Settings \u203a Display) is 6 to 8 digits and is kept only as a scrambled hash. If it still says 2580, change it.'},{id:'cash-up-lock',kind:'faq',topic:'Money',title:'Correcting a signed-off cash up',keywords:['cash up','locked','unlock','correct','mistake','history','audit','sales report'],body:'Once a cash up or weekly sales report is confirmed and saved, it is locked so the figures can\u2019t change quietly. An owner taps Unlock to correct on it, says why, and has 30 minutes to fix it. History on each one shows who signed it off, changed or unlocked it, and when.'},{id:'wipe-device',kind:'faq',topic:'Settings',title:'Sign out and wipe a shared tablet or phone',keywords:['wipe','sign out','shared','tablet','leaver','lost','reset device'],body:'Tap the sync badge (bottom left), or go to Settings \u203a Display, and choose Sign out and wipe this device. It signs out and removes everything CoverCharge keeps on that device: sign-ins, pairing, saved screens and changes not sent yet. The venue\u2019s shared data is not touched. On the Display you type the wake PIN first.'}],o=t=>a.find(a=>a.id===t)},1492,[]); __d(function(g,r,_i,_a,m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"tokens",{enumerable:!0,get:function(){return o}}),e.lev=l,e.searchHelp=function(n,l,i=8){const h=o(l);if(!h.length)return[];const a=t(l);return n.map(n=>{const l=o(n.title),i=o(n.keywords.join(' ')),c=o(`${n.body} ${(n.steps??[]).join(' ')}`);let f=3*s(h,l)+2.5*s(h,i)+.8*s(h,c);return n.keywords.some(n=>a.includes(t(n))&&t(n).length>3)&&(f+=2),t(n.title).includes(a)&&a.length>3&&(f+=3),{a:n,score:f/Math.sqrt(h.length)}}).filter(t=>t.score>=1.2).sort((t,n)=>n.score-t.score).slice(0,i)};const t=t=>t.toLowerCase().replace(/[\u2019']/g,'').replace(/[^a-z0-9\xa3 ]+/g,' ').replace(/\s+/g,' ').trim(),n=new Set(['how','do','i','a','an','the','to','can','my','our','we','is','it','of','for','in','on','and','what','where','please','me','you','with']),o=o=>t(o).split(' ').filter(t=>t&&!n.has(t));function l(t,n,o=2){if(Math.abs(t.length-n.length)>o)return o+1;let l=Array.from({length:n.length+1},(t,n)=>n);for(let i=1;i<=t.length;i++){const s=[i];let h=i;for(let o=1;o<=n.length;o++)s[o]=Math.min(l[o]+1,s[o-1]+1,l[o-1]+(t[i-1]===n[o-1]?0:1)),h=Math.min(h,s[o]);if(h>o)return o+1;l=s}return l[n.length]}function i(t,n){if(t===n)return 1;if(t.length>=3&&n.startsWith(t))return.8;if(n.length>=4&&t.startsWith(n))return.7;if(t.length>=4){if(l(t,n,t.length>=7?2:1)<=(t.length>=7?2:1))return.6}return 0}function s(t,n){let o=0;for(const l of t){let t=0;for(const o of n)if(t=Math.max(t,i(l,o)),1===t)break;o+=t}return o}},1493,[]); __d(function(g,r,_i,_a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"STAFF_VOICE_ACTIONS",{enumerable:!0,get:function(){return x}}),Object.defineProperty(_e,"STAFF_ALLOWED",{enumerable:!0,get:function(){return C}});var e=r(_d[0]),t=r(_d[1]),a=r(_d[2]),s=r(_d[3]),o=r(_d[4]),n=r(_d[5]),i=r(_d[6]);const h=()=>{try{return(0,e.nowFrom)(e.useStore.getState().clock)}catch{return new Date}},c=e=>String(e).padStart(2,'0'),d=e=>e.getFullYear()+'-'+c(e.getMonth()+1)+'-'+c(e.getDate()),l=e=>{const t=new Date(e);return c(t.getHours())+':'+c(t.getMinutes())},u=e=>{const t=(Math.round(60*e)%1440+1440)%1440;return c(Math.floor(t/60))+':'+c(t%60)},m=(e,t)=>{if(e===t)return'today';const[a,s,o]=e.split('-').map(Number),n=new Date(a,s-1,o),i=new Date(h());return i.setDate(i.getDate()+1),e===d(i)?'tomorrow':n.toLocaleDateString('en-GB',{weekday:'long',day:'numeric',month:'long'})},p=(e,t)=>t.test(e),f=e=>(e??'').replace(' (example)',''),b=e=>t.useOwner.getState().staff.find(t=>t.id===e.whoId),k=['staff'],w=[['kitchen',/\bkitchen\b/],['foh',/\b(front of house|foh|floor|bar)\b/],['managers',/\bmanagers?\b/],['all',/\b(all staff|everyone|whole team|team|group)\b/]],y={all:'the Team chat',kitchen:'Kitchen',foh:'Front of house',managers:'Managers'};function S(e,t){return'all'===e||(0,n.inChannel)(e,t)}function v(e,a){const s=e.toLowerCase().match(/\b(?:message|pm|private message|dm|text|tell)\s+([a-z' -]+?)(?:\s*[:,]|\s+(?:that|saying|to say)\b)/),o=(s?.[1]??'').trim();if(o&&!/^(the )?(team|everyone|kitchen|front of house|managers|group|all staff)$/.test(o))return t.useOwner.getState().staff.filter(e=>e.active&&e.id!==a.whoId).find(e=>(0,t.staffCalled)({name:f(e.name),nickname:e.nickname},o))}const x=[{id:'post_kitchen_chat',apps:['owner','chef'],title:'Post in the Kitchen chat',risk:'change',description:'Post a message in the pinned Kitchen chat (owners, managers, head chefs and kitchen staff).',params:[{name:'text',type:'string',required:!0,description:'The message'}],keywords:['kitchen chat'],match:e=>p(e,/\bkitchen (chat|group|channel)\b/)&&!p(e,/\b(read|any|unread|latest)\b/)?7:0,parse:e=>{const t=e.replace(/^.*?\bkitchen (?:chat|group|channel)\b\s*(?:[:,-]|\bthat\b|\bsaying\b)?\s*/i,'').trim();return{text:t.charAt(0).toUpperCase()+t.slice(1)}},preview:e=>'Post in the Kitchen chat: \u201c'+e.text+'\u201d?',run:(e,a)=>!e.text||String(e.text).length<2?'What should the message say?':(t.useOwner.getState().chatSend({ch:'kitchen',from:String(a.whoId??'system'),text:String(e.text),at:h().toISOString()}),'Posted in the Kitchen chat.')},{id:'post_team_chat',apps:k,title:'Post to the team chat or message one person',risk:'change',description:'Post a message in the team chat (All staff, Kitchen or Front of house), or a private message to one person. Read back first; posted only after Confirm.',params:[{name:'text',type:'string',required:!0,description:'The message'},{name:'ch',type:'string',required:!0,description:'Channel id or dm id'},{name:'to',type:'string',description:'Name of the person, for a private message'}],keywords:['team chat','group chat','message'],match:e=>p(e,/\b(message|pm|dm|text|tell|post|send|let)\b/)&&p(e,/\b(chat|team|everyone|group|kitchen|front of house|managers|know|:)|\b(message|pm|dm|text)\s+[a-z]+\s*[:,]/)&&!p(e,/\b(read|any|unread|what did|latest|last)\b.*\b(messages?|chat)\b/)?5:0,parse:(e,t)=>{const a=t,s=e.toLowerCase(),o=v(e,a),n=e.replace(/^.*?(?:[:]|\b(?:saying|that|to say)\b)\s*/i,'').replace(/^\s*(?:(?:post|send|put|write)\s+(?:in|on|to)\s+(?:the\s+)?(?:team|group|kitchen|front of house|all staff)?\s*chat\s*)/i,'').trim(),i=n&&n!==e?n:e.replace(/^\s*(?:tell|message|post to|let)\s+(?:the\s+)?(?:team|everyone|group chat|team chat|kitchen|front of house)\s*(?:know\s*)?(?:that\s*)?/i,'').trim();if(o)return{text:i.charAt(0).toUpperCase()+i.slice(1),ch:'dm:'+[String(a.whoId),o.id].sort().join(':'),to:f(o.name)};const h=w.find(([,e])=>e.test(s))?.[0]??'all';return{text:i.charAt(0).toUpperCase()+i.slice(1),ch:h}},preview:e=>e.to?'Private message to '+e.to+': \u201c'+e.text+'\u201d. Send it?':'Post in '+(y[String(e.ch)]??'the team chat')+': \u201c'+e.text+'\u201d?',run:(e,a)=>{const s=String(e.ch),o=b(a);return!e.text||String(e.text).length<2?'What should the message say?':s.startsWith('dm:')||S(s,o)?(t.useOwner.getState().chatSend({ch:s,from:String(a.whoId??'system'),text:String(e.text),at:h().toISOString()}),e.to?'Sent to '+e.to+'.':'Posted in '+(y[s]??'the team chat')+'.'):'You can\u2019t post in '+(y[s]??s)+'. Try the Team chat.'}},{id:'read_chat',apps:k,title:'Read out chat messages',risk:'look',description:'Read out unread messages (team chat and private messages), or the latest ones.',params:[],keywords:['messages','chat'],match:e=>p(e,/\b(read|any|unread|new|what did|latest|last|check)\b.*\b(messages?|chats?|pms?)\b|\bwhat.?s (been said|in the chat)\b/)?6:0,preview:()=>'Read out chat messages',run:(e,a)=>{const s=t.useOwner.getState(),o=b(a),n=String(a.whoId??''),i=s.chat.filter(e=>{return!e.removed&&e.text&&((t=e.ch).startsWith('dm:')?t.split(':').slice(1).includes(n):o?'all'===t||S(t,o):'all'===t);var t}).sort((e,t)=>e.at.localeCompare(t.at)),h=i.filter(e=>e.from!==n&&!e.seenBy.includes(n)),c=(h.length?h:i.filter(e=>'system'!==e.from)).slice(-5),d=e=>'system'===e.from?'CoverCharge':f(s.staff.find(t=>t.id===e.from)?.name??'Someone');return c.length?(h.length?h.length+' unread. ':'No unread messages. The latest: ')+c.map(e=>{return d(e)+' '+(((t=e.ch).startsWith('dm:')?'privately':'in '+(y[t]??t))+' at ')+l(e.at)+': '+e.text;var t}).join('. '):'No messages yet.'}},{id:'my_shift',apps:k,title:'My next shift or rota',risk:'look',description:'Your next published shift, or your shifts this week.',params:[],keywords:['shift','rota'],match:e=>p(e,/\b(my|next|when am i|am i (on|working|in)|when do i (start|work|finish))\b/)&&p(e,/\b(shifts?|rota|working|on|in|start|finish)\b/)&&!p(e,/\b(break|clock)/)?5:0,preview:()=>'Your shifts',run:(e,a)=>{const s=a.today,o=t.useOwner.getState().shifts.filter(e=>e.staffId===a.whoId&&e.published&&e.date>=s).sort((e,t)=>e.date.localeCompare(t.date)||e.start-t.start);if(!o.length)return'You have no published shifts coming up. Your manager publishes the rota in the app.';const n=h(),i=n.getHours()+n.getMinutes()/60,c=o.find(e=>e.date>s||e.end>i)??o[0],d=o.filter(e=>e!==c).slice(0,4);return'Your next shift: '+m(c.date,s)+', '+u(c.start)+' to '+u(c.end)+(c.note?' ('+c.note+')':'')+'.'+(d.length?' Then '+d.map(e=>m(e.date,s)+' '+u(e.start)+'\u2013'+u(e.end)).join(', ')+'.':'')}},{id:'clock_status',apps:k,title:'Am I clocked in?',risk:'look',description:'Whether you are clocked in, since when, and a reminder to clock in or out on the Clock tab.',params:[],keywords:['clock'],match:e=>p(e,/\b(clock(ed)?|clocking)\b/)?6:0,preview:()=>'Clock status',run:(e,a)=>{const s=t.useOwner.getState(),o=h(),n=(0,t.openShiftOf)(s.attendance,String(a.whoId),o),c=a.today,d=o.getHours()+o.getMinutes()/60,m=(0,i.workingShifts)(s.shifts,s.leave).find(e=>e.staffId===a.whoId&&e.published&&e.date===c);return n?'You\u2019re clocked in since '+l(n.in)+'.'+(m?' Your shift ends at '+u(m.end)+'.':'')+' Remember to clock out on the Clock tab when you finish.':m&&m.end>d?'You\u2019re not clocked in. Your shift today is '+u(m.start)+' to '+u(m.end)+'. Clock in on the Clock tab when you start.':'You\u2019re not clocked in.'+(m?'':' You have no shift today.')+' Use the Clock tab to clock in or out.'}},{id:'my_break',apps:k,title:'My break',risk:'look',description:'Whether you are on a break, and how long your breaks have been today.',params:[],keywords:['break'],match:e=>p(e,/\bbreaks?\b/)?6:0,preview:()=>'Your break',run:(e,a)=>{const s=t.useOwner.getState(),o=h(),n=(0,t.openShiftOf)(s.attendance,String(a.whoId),o);if(!n)return'You\u2019re not clocked in, so there\u2019s no break to show. Breaks are started and ended on the Clock tab.';const i=(0,t.loggedBreakMins)(n,o);if((0,t.isOnBreak)(n)){const e=n.breaks.find(e=>!e.end);return'You\u2019re on a break since '+l(e.start)+'. Breaks today: '+i+' minutes. Tap End break on the Clock tab when you\u2019re back.'}return i?'You\u2019ve had '+i+' minutes of break today. Start a break on the Clock tab.':'No break taken yet today. Start one on the Clock tab.'}},{id:'todays_specials',apps:k,title:'Today\u2019s specials',risk:'look',description:'Read out today\u2019s specials board.',params:[],keywords:['specials'],match:e=>p(e,/\bspecials?\b/)&&!p(e,/\b(draft|add|new|make)\b/)?6:0,preview:()=>'Today\u2019s specials',run:(e,t)=>{const o=a.useSpecials.getState().current[t.rid]?.items??[];return o.length?'Today\u2019s specials: '+o.map(e=>e.name+(null!=e.price?', '+(0,s.gbp)(e.price):'')).join('; ')+'.':'There are no specials on the board today.'}},{id:'sold_out_list',apps:k,title:'What\u2019s sold out',risk:'look',description:'List dishes that are sold out right now.',params:[],keywords:['sold out','86'],match:e=>p(e,/\b(sold out|86(ed)?|run out|off the menu|unavailable)\b/)?6:0,preview:()=>'What\u2019s sold out',run:(e,t)=>{const a=(0,o.dishesFor)(t.rid).filter(e=>e.soldOut).map(e=>e.name);return a.length?'Sold out: '+a.join(', ')+'.':'Nothing is sold out right now.'}}],C=new Set(['log_check','allergen_info','next_table_free',...x.filter(e=>e.apps?.includes('staff')).map(e=>e.id)])},1494,[816,876,956,851,1488,1015,1069]); __d(function(g,r,i,_a,_m2,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"NUM_WORDS",{enumerable:!0,get:function(){return s}}),e.numberOf=l,e.normaliseHeard=function(t){let n=` ${t.replace(/[\u2019\u2018]/g,"'").replace(/\s+/g,' ').trim()} `;n=n.replace(/\bwalk[\s-]?ins?\b/gi,'walk-in').replace(/\bwalking\b(?=\s+(?:of|for|in|on|at|party|\d|one|two|three|four|five|six|seven|eight|nine|ten|to|too)\b)/gi,'walk-in').replace(/\bseat(?:er|ed|a)?\s+(?:a\s+|at\s+|the\s+)?walk-in\b/gi,'seat a walk-in').replace(/\bsit\s+(?:a\s+)?walk-in\b/gi,'seat a walk-in').replace(/\b(?:quitter|quieter|pew ta|puta|put the|push a)\s+walk-in\b/gi,'put a walk-in').replace(/^(\s*)(?:lock|clock)\s+table\b/i,'$1block table').replace(/^(\s*)(?:[Ss]id|[Ss]it|[Ss]eed|[Ss]ee)\s+(?=[A-Z][a-z]+\b.*\b(?:waitlist|wait list|waiting list)\b)/,'$1seat ').replace(/\b(table \S+ (?:needs|is needing|wants)) cleaning\b/gi,'$1 clearing').replace(/^(\s*)have many\b/i,'$1how many').replace(/^(\s*)(?:meet|need|reed|weed) the (orders|shift notes|messages|specials)\b/i,'$1read the $2'),n=n.replace(new RegExp(`\\btable(\\s+(?:number\\s+)?)(${a})\\b(?!\\s+(?:${b})\\b)`,'gi'),(t,n,s)=>`table${n}${p(s)}`).replace(new RegExp("\\btable(\\s+(?:number\\s+)?)(for|fore)\\b(?=\\s*(?:$|[.,!?]|\\b(?:please|now|is|has|needs|wants|on|at)\\b))",'gi'),(t,n,s)=>`table${n}${p(s)}`).replace(new RegExp(`\\btable(\\s+(?:number\\s+)?)((?:twenty|thirty)[ -](?:one|two|three|four|five|six|seven|eight|nine)|${s})\\b`,'gi'),(t,n,s)=>`table${n}${p(s)}`).replace(new RegExp(`\\b(walk-in(?:\\s+party)?\\s+(?:of|for)|party of|table for|of|for)\\s+(${o})\\b${w}`,'gi'),(t,n,s)=>`${n} ${p(s)}`).replace(new RegExp(`\\bwalk-in\\s+(${s}|\\d{1,2})\\b${w}`,'gi'),(t,n)=>`walk-in of ${p(n)}`).replace(new RegExp(`\\bwalk-in\\s+(${o})\\b(?=\\s*(?:$|[.,!?]|\\b(?:on|at|people|covers|guests|please|now)\\b))`,'gi'),(t,n)=>`walk-in of ${p(n)}`).replace(new RegExp(`\\b(${o})\\s+(covers|people|guests|adults)\\b`,'gi'),(t,n,s)=>`${p(n)} ${s}`);const c=n.match(new RegExp(`^\\s*(?:(?:put|seat|sit)\\s+)?(?:a\\s+)?(${b})\\s+(?:on|at|to|onto)\\s+table\\s+(\\w+)[.,!?]?(?:\\s+(?:please|now|thanks))?\\s*[.!?]?\\s*$`,'i'));c&&l(c[1])&&l(c[1])<=30&&(n=` seat a walk-in of ${p(c[1])} at table ${p(c[2])} `);return n.replace(/\s+/g,' ').trim()},e.walkInCovers=function(t){const n=` ${t.toLowerCase()} `,a=`(\\d{1,2}|${s})`,o=n.match(new RegExp(`\\bwalk-in(?:\\s+party)?\\s+(?:of|for)\\s+${a}\\b`))??n.match(new RegExp(`\\bwalk-in\\s+(?:at|a|of a|for a)\\s+${a}\\s+(?:at|on)\\s+table\\b`))??n.match(new RegExp(`\\b${a}\\s+walk-in`))??n.match(new RegExp(`\\b(?:party of|table for|for|of)\\s+${a}\\b(?!\\s*(?:am|pm|[:.]\\d|o.?clock))`))??n.match(new RegExp(`\\b${a}\\s*(?:covers|people|guests|adults|pax|persons|of us)\\b`)),b=l(o?.[1],!1);return b&&b>=1&&b<=30?b:void 0},e.tableSaid=function(t){const n=[...` ${t.toLowerCase()} `.matchAll(/\btable\s+(?:number\s+)?([a-z]?\d{1,3}[a-z]?)\b/g)];return n.length?n[n.length-1][1].toUpperCase():void 0},e.coversAnswer=function(t){const n=t.toLowerCase().replace(/[.,!?]/g,' '),a=n.match(new RegExp(`\\b(\\d{1,2}|${s})\\b`))??n.match(new RegExp(`^\\s*(?:just\\s+)?(${o})\\s*(?:people|of us|please)?\\s*$`)),b=l(a?.[1]);return b&&b>=1&&b<=30?b:void 0};const t={one:1,two:2,three:3,four:4,five:5,six:6,seven:7,eight:8,nine:9,ten:10,eleven:11,twelve:12,thirteen:13,fourteen:14,fifteen:15,sixteen:16,seventeen:17,eighteen:18,nineteen:19,twenty:20,thirty:30},n={to:2,too:2,tu:2,for:4,fore:4,ate:8,won:1,tree:3,free:3,sax:6,sex:6,fiver:5,nein:9,tin:10},s=Object.keys(t).join('|'),a='to|too|tu|ate|won|tree|free|sax|sex|fiver|nein|tin',o='to|too|tu|for|fore|ate|won',b=`\\d{1,2}|(?:twenty|thirty)[ -](?:one|two|three|four|five|six|seven|eight|nine)|${s}|${o}`;function l(s,a=!0){if(!s)return;const o=s.toLowerCase().trim().replace(/-/g,' ');if(/^\d+$/.test(o))return Number(o);const b=o.match(/^(twenty|thirty) (one|two|three|four|five|six|seven|eight|nine)$/);return b?t[b[1]]+t[b[2]]:t[o]??(a?n[o]:void 0)}const p=t=>String(l(t)??t),w='(?=\\s*(?:$|[.,!?]|\\bon\\b|\\bat\\b|\\bin\\b|\\bto\\b|\\btable\\b|\\bplease\\b|\\bnow\\b|\\bpeople\\b|\\bcovers?\\b|\\bguests?\\b))'},1495,[]); diff --git a/chef-app/admin.html b/chef-app/admin.html index 10f55037ac66ed594e9146436774f6a34305f6ec..e9e2aa6de7684351a834b1842d4dfa901e07ef9b 100644 --- a/chef-app/admin.html +++ b/chef-app/admin.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/chef-app/customer.html b/chef-app/customer.html index 10f55037ac66ed594e9146436774f6a34305f6ec..e9e2aa6de7684351a834b1842d4dfa901e07ef9b 100644 --- a/chef-app/customer.html +++ b/chef-app/customer.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/chef-app/customer/anchorage.html b/chef-app/customer/anchorage.html index 10f55037ac66ed594e9146436774f6a34305f6ec..e9e2aa6de7684351a834b1842d4dfa901e07ef9b 100644 --- a/chef-app/customer/anchorage.html +++ b/chef-app/customer/anchorage.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/chef-app/customer/anchorage/book.html b/chef-app/customer/anchorage/book.html index 10f55037ac66ed594e9146436774f6a34305f6ec..e9e2aa6de7684351a834b1842d4dfa901e07ef9b 100644 --- a/chef-app/customer/anchorage/book.html +++ b/chef-app/customer/anchorage/book.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/chef-app/customer/anchorage/feedback.html b/chef-app/customer/anchorage/feedback.html index 10f55037ac66ed594e9146436774f6a34305f6ec..e9e2aa6de7684351a834b1842d4dfa901e07ef9b 100644 --- a/chef-app/customer/anchorage/feedback.html +++ b/chef-app/customer/anchorage/feedback.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/chef-app/customer/anchorage/gift.html b/chef-app/customer/anchorage/gift.html index 10f55037ac66ed594e9146436774f6a34305f6ec..e9e2aa6de7684351a834b1842d4dfa901e07ef9b 100644 --- a/chef-app/customer/anchorage/gift.html +++ b/chef-app/customer/anchorage/gift.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/chef-app/customer/anchorage/lost.html b/chef-app/customer/anchorage/lost.html index 10f55037ac66ed594e9146436774f6a34305f6ec..e9e2aa6de7684351a834b1842d4dfa901e07ef9b 100644 --- a/chef-app/customer/anchorage/lost.html +++ b/chef-app/customer/anchorage/lost.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/chef-app/customer/anchorage/loyalty.html b/chef-app/customer/anchorage/loyalty.html index 10f55037ac66ed594e9146436774f6a34305f6ec..e9e2aa6de7684351a834b1842d4dfa901e07ef9b 100644 --- a/chef-app/customer/anchorage/loyalty.html +++ b/chef-app/customer/anchorage/loyalty.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/chef-app/customer/anchorage/merch.html b/chef-app/customer/anchorage/merch.html index 10f55037ac66ed594e9146436774f6a34305f6ec..e9e2aa6de7684351a834b1842d4dfa901e07ef9b 100644 --- a/chef-app/customer/anchorage/merch.html +++ b/chef-app/customer/anchorage/merch.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/chef-app/customer/anchorage/offers.html b/chef-app/customer/anchorage/offers.html index 10f55037ac66ed594e9146436774f6a34305f6ec..e9e2aa6de7684351a834b1842d4dfa901e07ef9b 100644 --- a/chef-app/customer/anchorage/offers.html +++ b/chef-app/customer/anchorage/offers.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/chef-app/customer/anchorage/refer.html b/chef-app/customer/anchorage/refer.html index 10f55037ac66ed594e9146436774f6a34305f6ec..e9e2aa6de7684351a834b1842d4dfa901e07ef9b 100644 --- a/chef-app/customer/anchorage/refer.html +++ b/chef-app/customer/anchorage/refer.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/chef-app/customer/anchorage/waitlist.html b/chef-app/customer/anchorage/waitlist.html index 10f55037ac66ed594e9146436774f6a34305f6ec..e9e2aa6de7684351a834b1842d4dfa901e07ef9b 100644 --- a/chef-app/customer/anchorage/waitlist.html +++ b/chef-app/customer/anchorage/waitlist.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/chef-app/customer/anchorage/whatson.html b/chef-app/customer/anchorage/whatson.html index 10f55037ac66ed594e9146436774f6a34305f6ec..e9e2aa6de7684351a834b1842d4dfa901e07ef9b 100644 --- a/chef-app/customer/anchorage/whatson.html +++ b/chef-app/customer/anchorage/whatson.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/chef-app/customer/basket.html b/chef-app/customer/basket.html index 10f55037ac66ed594e9146436774f6a34305f6ec..e9e2aa6de7684351a834b1842d4dfa901e07ef9b 100644 --- a/chef-app/customer/basket.html +++ b/chef-app/customer/basket.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/chef-app/customer/profile.html b/chef-app/customer/profile.html index 10f55037ac66ed594e9146436774f6a34305f6ec..e9e2aa6de7684351a834b1842d4dfa901e07ef9b 100644 --- a/chef-app/customer/profile.html +++ b/chef-app/customer/profile.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/chef-app/demo.html b/chef-app/demo.html index 10f55037ac66ed594e9146436774f6a34305f6ec..e9e2aa6de7684351a834b1842d4dfa901e07ef9b 100644 --- a/chef-app/demo.html +++ b/chef-app/demo.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/chef-app/display.html b/chef-app/display.html index 10f55037ac66ed594e9146436774f6a34305f6ec..e9e2aa6de7684351a834b1842d4dfa901e07ef9b 100644 --- a/chef-app/display.html +++ b/chef-app/display.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/chef-app/index.html b/chef-app/index.html index b5b08232764effdbeaea607c7c7709a3145e49f2..cfe5a8c97e7212a5273e3f443b9a1c72b0ad0f43 100644 --- a/chef-app/index.html +++ b/chef-app/index.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/chef-app/kitchen.html b/chef-app/kitchen.html index 10f55037ac66ed594e9146436774f6a34305f6ec..e9e2aa6de7684351a834b1842d4dfa901e07ef9b 100644 --- a/chef-app/kitchen.html +++ b/chef-app/kitchen.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/chef-app/owner.html b/chef-app/owner.html index 10f55037ac66ed594e9146436774f6a34305f6ec..e9e2aa6de7684351a834b1842d4dfa901e07ef9b 100644 --- a/chef-app/owner.html +++ b/chef-app/owner.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/chef-app/staff.html b/chef-app/staff.html index 10f55037ac66ed594e9146436774f6a34305f6ec..e9e2aa6de7684351a834b1842d4dfa901e07ef9b 100644 --- a/chef-app/staff.html +++ b/chef-app/staff.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/chef-app/sw.js b/chef-app/sw.js index 294d1ce58998b45ab517bc9acb33115a64f4a9d2..4c667c8912a4b3998fa50298b0432affe1a9738f 100644 --- a/chef-app/sw.js +++ b/chef-app/sw.js @@ -1,7 +1,7 @@ // Anchorage Head Chef service worker: precache the app shell so it opens offline after the first visit. -const V = "cc-chef-500b24e518"; +const V = "cc-chef-a2ffb3c585"; const BASE = "/chef-app/"; -const PRECACHE = ["/chef-app/apple-touch-icon.png", "/chef-app/assets/assets/brand/anchorage-hero.0450b828e4f9c1f4456240096598f6f5.png", "/chef-app/assets/assets/brand/anchorage.fea5ce2f6fd18bf2950aa21c0980ed8e.png", "/chef-app/assets/assets/recipes/fishsupper.1609c58319e1e8721f5c639049fb054e.jpg", "/chef-app/assets/assets/recipes/lobster.2fb3485c8e372972099259017358c1b8.jpg", "/chef-app/assets/assets/recipes/moules.a4f342fc7e7fb62c8a0b5c1678bbea3f.jpg", "/chef-app/assets/assets/recipes/skink.4ce7b7c676f9cdcd0a060eda46f5a00e.jpg", "/chef-app/assets/assets/recipes/stp.1061ced765efdcafff2554adc3fc7113.jpg", "/chef-app/assets/assets/specials/sample-chalkboard.e7b4e4450a8483d4219bc6a214158d8f.jpg", "/chef-app/assets/node_modules/@expo-google-fonts/poppins/400Regular/Poppins_400Regular.093ee89be9ede30383f39a899c485a82.ttf", "/chef-app/assets/node_modules/@expo-google-fonts/poppins/500Medium/Poppins_500Medium.bf59c687bc6d3a70204d3944082c5cc0.ttf", "/chef-app/assets/node_modules/@expo-google-fonts/poppins/600SemiBold/Poppins_600SemiBold.6f1520d107205975713ba09df778f93f.ttf", "/chef-app/assets/node_modules/@expo-google-fonts/poppins/700Bold/Poppins_700Bold.08c20a487911694291bd8c5de41315ad.ttf", "/chef-app/assets/node_modules/expo-router/assets/arrow_down.017bc6ba3fc25503e5eb5e53826d48a8.png", "/chef-app/assets/node_modules/expo-router/assets/error.d1ea1496f9057eb392d5bbf3732a61b7.png", "/chef-app/assets/node_modules/expo-router/assets/file.19eeb73b9593a38f8e9f418337fc7d10.png", "/chef-app/assets/node_modules/expo-router/assets/forward.d8b800c443b8972542883e0b9de2bdc6.png", "/chef-app/assets/node_modules/expo-router/assets/pkg.ab19f4cbc543357183a20571f68380a3.png", "/chef-app/assets/node_modules/expo-router/assets/react-navigation/elements/back-icon-mask.0a328cd9c1afd0afe8e3b1ec5165b1b4.png", "/chef-app/assets/node_modules/expo-router/assets/react-navigation/elements/back-icon.35ba0eaec5a4f5ed12ca16fabeae451d.png", "/chef-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55.png", "/chef-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@2x.png", "/chef-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@3x.png", "/chef-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@4x.png", "/chef-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7.png", "/chef-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@2x.png", "/chef-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@3x.png", "/chef-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@4x.png", "/chef-app/assets/node_modules/expo-router/assets/react-navigation/elements/search-icon.286d67d3f74808a60a78d3ebf1a5fb57.png", "/chef-app/assets/node_modules/expo-router/assets/sitemap.412dd9275b6b48ad28f5e3d81bb1f626.png", "/chef-app/assets/node_modules/expo-router/assets/unmatched.20e71bdf79e3a97bf55fd9e164041578.png", "/chef-app/brand-logo.png", "/chef-app/favicon.ico", "/chef-app/icon-192.png", "/chef-app/icon-512.png", "/chef-app/icon-maskable-192.png", "/chef-app/icon-maskable-512.png", "/chef-app/manifest.webmanifest", "/chef-app/index.html", "/chef-app/_expo/static/js/web/bundle.js?v=500b24e518e43e23c4f6a2616ccd539549f01a65a0e313cc4bb7c6eaf3da369c"]; +const PRECACHE = ["/chef-app/apple-touch-icon.png", "/chef-app/assets/assets/brand/anchorage-hero.0450b828e4f9c1f4456240096598f6f5.png", "/chef-app/assets/assets/brand/anchorage.fea5ce2f6fd18bf2950aa21c0980ed8e.png", "/chef-app/assets/assets/recipes/fishsupper.1609c58319e1e8721f5c639049fb054e.jpg", "/chef-app/assets/assets/recipes/lobster.2fb3485c8e372972099259017358c1b8.jpg", "/chef-app/assets/assets/recipes/moules.a4f342fc7e7fb62c8a0b5c1678bbea3f.jpg", "/chef-app/assets/assets/recipes/skink.4ce7b7c676f9cdcd0a060eda46f5a00e.jpg", "/chef-app/assets/assets/recipes/stp.1061ced765efdcafff2554adc3fc7113.jpg", "/chef-app/assets/assets/specials/sample-chalkboard.e7b4e4450a8483d4219bc6a214158d8f.jpg", "/chef-app/assets/node_modules/@expo-google-fonts/poppins/400Regular/Poppins_400Regular.093ee89be9ede30383f39a899c485a82.ttf", "/chef-app/assets/node_modules/@expo-google-fonts/poppins/500Medium/Poppins_500Medium.bf59c687bc6d3a70204d3944082c5cc0.ttf", "/chef-app/assets/node_modules/@expo-google-fonts/poppins/600SemiBold/Poppins_600SemiBold.6f1520d107205975713ba09df778f93f.ttf", "/chef-app/assets/node_modules/@expo-google-fonts/poppins/700Bold/Poppins_700Bold.08c20a487911694291bd8c5de41315ad.ttf", "/chef-app/assets/node_modules/expo-router/assets/arrow_down.017bc6ba3fc25503e5eb5e53826d48a8.png", "/chef-app/assets/node_modules/expo-router/assets/error.d1ea1496f9057eb392d5bbf3732a61b7.png", "/chef-app/assets/node_modules/expo-router/assets/file.19eeb73b9593a38f8e9f418337fc7d10.png", "/chef-app/assets/node_modules/expo-router/assets/forward.d8b800c443b8972542883e0b9de2bdc6.png", "/chef-app/assets/node_modules/expo-router/assets/pkg.ab19f4cbc543357183a20571f68380a3.png", "/chef-app/assets/node_modules/expo-router/assets/react-navigation/elements/back-icon-mask.0a328cd9c1afd0afe8e3b1ec5165b1b4.png", "/chef-app/assets/node_modules/expo-router/assets/react-navigation/elements/back-icon.35ba0eaec5a4f5ed12ca16fabeae451d.png", "/chef-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55.png", "/chef-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@2x.png", "/chef-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@3x.png", "/chef-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@4x.png", "/chef-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7.png", "/chef-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@2x.png", "/chef-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@3x.png", "/chef-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@4x.png", "/chef-app/assets/node_modules/expo-router/assets/react-navigation/elements/search-icon.286d67d3f74808a60a78d3ebf1a5fb57.png", "/chef-app/assets/node_modules/expo-router/assets/sitemap.412dd9275b6b48ad28f5e3d81bb1f626.png", "/chef-app/assets/node_modules/expo-router/assets/unmatched.20e71bdf79e3a97bf55fd9e164041578.png", "/chef-app/brand-logo.png", "/chef-app/favicon.ico", "/chef-app/icon-192.png", "/chef-app/icon-512.png", "/chef-app/icon-maskable-192.png", "/chef-app/icon-maskable-512.png", "/chef-app/manifest.webmanifest", "/chef-app/index.html", "/chef-app/_expo/static/js/web/bundle.js?v=a2ffb3c585c142e9d0fa0d59fe2791e26111aea461345eb3da9ef46f38241f14"]; // Hugging Face serves large files (fonts) through a redirect to its CDN. Browsers refuse to hand a *redirected* cached // response to a page, so store a plain copy instead (otherwise fonts, and so the app, fail to load offline). const plain = r => r.redirected ? r.blob().then(b => new Response(b, { status: 200, headers: { 'Content-Type': r.headers.get('Content-Type') || b.type || 'application/octet-stream' } })) : Promise.resolve(r); diff --git a/chef-app/team.html b/chef-app/team.html index 10f55037ac66ed594e9146436774f6a34305f6ec..e9e2aa6de7684351a834b1842d4dfa901e07ef9b 100644 --- a/chef-app/team.html +++ b/chef-app/team.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/customer-app/_expo/static/js/web/bundle.js b/customer-app/_expo/static/js/web/bundle.js index bf56b83ec94201c7e61f8f734338473da303c419..ab2c4f0c60774abeaee94ea66cb89fdbb829fe2b 100644 --- a/customer-app/_expo/static/js/web/bundle.js +++ b/customer-app/_expo/static/js/web/bundle.js @@ -921,7 +921,7 @@ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{v __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"ANCHORAGE_PAY",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"ANCHORAGE_KITCHEN",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"ANCHORAGE_KITCHEN_OLD",{enumerable:!0,get:function(){return u}}),Object.defineProperty(e,"restaurants",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"demoMenus",{enumerable:!0,get:function(){return l}});var t=r(d[0]);const n={slotMinutes:15,slotCap:3,bufferMins:5,leadMins:20,takeawayPaused:!1,bookingCoversPerSlot:20,bookingSlotMinutes:15,deposit:{...r(d[1]).DEPOSIT_DEFAULT},stampTarget:8,stampReward:'Free dessert',stampMinSpend:1e3,capacityPerHour:48,walkInShare:.35,turnMins:75,orderAtTable:!0},o={tipsFrequency:'fortnightly',tipsAnchorPayday:'2026-11-02',tipsEndsDaysBefore:1,wagePayDay:28,wageCutoffDay:23,weekendRule:'none'},s={0:['12:30','19:00'],1:null,2:null,3:['12:00','19:00'],4:['12:00','19:00'],5:['12:00','20:00'],6:['12:00','20:00']},u={0:['12:30','20:00'],1:null,2:null,3:['12:00','19:00'],4:['12:00','19:00'],5:['12:00','20:30'],6:['12:00','20:30']},c=[{id:'anchorage',name:'The Anchorage',tagline:'Harbourside seafood & Scottish produce',location:'Harbour View, Dunure, South Ayrshire',fictional:!1,phone:'01292 502826',website:'anchoragedunure.com',kitchenHours:s,hoursNote:'Kitchen (food) hours from Gordon, 30 Oct 2026: closed Mon\u2013Tue. The closing time is last food orders. Bar hours not set.',settings:{...n,orderAtTable:!1,pay:o,cashUpRecord:[...t.ANCHORAGE_CASH_UP],bookingCoversPerStart:15,bookingPartiesPerStart:4,onlinePartyMin:1,onlinePartyMax:8,bookingNoticeMins:15,autoAcceptUpTo:8},sections:[]}],l=[]},838,[839,841]); __d(function(g,_r,_i,_a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"TAKINGS_FIELDS",{enumerable:!0,get:function(){return t}}),Object.defineProperty(_e,"NO_SERVICE_SPLIT",{enumerable:!0,get:function(){return n}}),Object.defineProperty(_e,"TAKINGS_KEYS",{enumerable:!0,get:function(){return r}}),_e.withTakingsFields=function(e){e=e.filter(e=>!n.includes(e.key));const r=new Set(e.map(e=>e.key)),o=t.filter(e=>!r.has(e.key)).map(e=>({...e}));if(!o.length)return e;const a=e.findIndex(e=>'cash'===e.key),i=a<0?e.length:a+1;return[...e.slice(0,i),...o,...e.slice(i)]},Object.defineProperty(_e,"grossOf",{enumerable:!0,get:function(){return o}}),Object.defineProperty(_e,"ANCHORAGE_CASH_UP",{enumerable:!0,get:function(){return a}}),_e.cashFieldsForRecord=function(e,t){if(!t?.length)return e;const n=new Set,r=[];for(const o of t){const t=i[o],a=t?.key??`cu-${o.toLowerCase().replace(/[^a-z0-9]+/g,'-').replace(/^-|-$/g,'')||'figure'}`,l=e.find(e=>e.key===a);r.push({...l,...t??{kind:'money'},key:a,label:o}),n.add(a)}return[...r,...e.filter(e=>!n.has(e.key))]},Object.defineProperty(_e,"DEFAULT_CASHUP_FIELDS",{enumerable:!0,get:function(){return l}}),Object.defineProperty(_e,"DEFAULT_SALES_FIELDS",{enumerable:!0,get:function(){return u}}),_e.parseAmount=function(t,n="money"){if('number'===n){const e=t.replace(/[\xa3\s]/g,'');return/^\d{1,6}$/.test(e)?Number(e):null}return(0,e.parseMoneyInput)(t)},Object.defineProperty(_e,"isBlank",{enumerable:!0,get:function(){return s}}),Object.defineProperty(_e,"ymdUTC",{enumerable:!0,get:function(){return c}}),Object.defineProperty(_e,"addDaysYmd",{enumerable:!0,get:function(){return y}}),_e.weekStartOf=function(e){const t=(d(e).getUTCDay()+6)%7;return y(e,-t)},_e.combinedTips=function(e){const t='number'==typeof e.cashTips?e.cashTips:null,n='number'==typeof e.cardTips?e.cardTips:null;return null==t&&null==n?null:Math.round(100*((t??0)+(n??0)))/100},Object.defineProperty(_e,"takings",{enumerable:!0,get:function(){return f}}),Object.defineProperty(_e,"missing",{enumerable:!0,get:function(){return m}}),_e.dailySeries=function(e,t,n,r=f){const o=new Map(e.filter(e=>e.confirmedAt).map(e=>[e.date,e]));return Array.from({length:n},(e,a)=>{const i=y(t,a-n+1),l=o.get(i);return{date:i,value:l?r(l.vals):null}})},_e.weekCompare=function(e,t,n="net"){const r=t=>{const r=e.find(e=>e.weekStart===t&&e.confirmedAt),o=r?.vals[n];return'number'==typeof o?o:null},o=r(t),a=r(y(t,-7)),i=null!=o&&null!=a&&0!==a?Math.round((o-a)/a*1e3)/10:null;return{now:o,prev:a,change:i}},_e.tipsPot=function(e,t,n,r){const o=t.filter(e=>'payout'===e.kind&&e.throughDate).sort((e,t)=>e.at.localeCompare(t.at)),a=o[o.length-1],i=a?y(a.throughDate,1):n,l=e.filter(e=>e.date>=i&&e.date<=r).sort((e,t)=>e.date.localeCompare(t.date)),u=t.filter(e=>'correction'===e.kind&&e.forDate&&e.forDate>=i&&e.forDate<=r&&(!a||e.at>a.at)),s=Math.round(100*(l.reduce((e,t)=>e+t.total,0)+u.reduce((e,t)=>e+t.amount,0)))/100;return{from:i,total:Math.max(0,s),days:l,corrections:u,lastPayout:a??null,history:o.slice().reverse()}},_e.shareByHours=function(e,t,n){return e>0&&t>0&&n>0?Math.round(e*(t/n)*100)/100:0},_e.cashLocked=function(e,t=Date.now()){return!(!e.onServer||!e.confirmedAt)&&!(e.unlockedUntil&&Date.parse(e.unlockedUntil)>t)},_e.changedFields=function(e,t){const n=e??{},r=t??{},o=[],a=n.vals??{},i=r.vals??{};for(const e of new Set([...Object.keys(a),...Object.keys(i)]))JSON.stringify(a[e])!==JSON.stringify(i[e])&&o.push(e);JSON.stringify(n.categories??null)!==JSON.stringify(r.categories??null)&&(n.categories||r.categories)&&o.push('categories');JSON.stringify(n.photos??[])!==JSON.stringify(r.photos??[])&&e&&t&&o.push('photos');return o},Object.defineProperty(_e,"dayTakingsOf",{enumerable:!0,get:function(){return p}}),Object.defineProperty(_e,"daysInMonth",{enumerable:!0,get:function(){return k}}),_e.addMonths=b,Object.defineProperty(_e,"monthName",{enumerable:!0,get:function(){return O}}),Object.defineProperty(_e,"shortDay",{enumerable:!0,get:function(){return C}}),Object.defineProperty(_e,"longDay",{enumerable:!0,get:function(){return D}}),_e.poundsWhole=function(e){const t=e<0,n=String(Math.round(Math.abs(e))).replace(/\B(?=(\d{3})+(?!\d))/g,',');return`${t?'-':''}\xa3${n}`},_e.monthTakings=function(e,t,n,r){const o=new Map;for(const n of e){if(n.rid!==t)continue;const e=p(n);null!=e&&o.set(n.date,e)}const a=Number(n.slice(0,4)),i=Number(n.slice(5,7)),l=k(a,i),u=Array.from({length:l},(e,t)=>{const a=`${n}-${String(t+1).padStart(2,'0')}`,i=o.get(a),l=null!=i&&a<=r?'recorded':a>r?'future':a===r?'pending':'missing';return{date:a,day:t+1,value:'recorded'===l?i:null,state:l}}),s=u.filter(e=>'recorded'===e.state),c=Math.round(100*s.reduce((e,t)=>e+(t.value??0),0))/100,d=s.reduce((e,t)=>!e||t.value>e.value?{date:t.date,value:t.value}:e,null),y=r.slice(0,7)===n,f=n0?Math.round((c-T)/T*100):null;return{ym:n,month:O(n),days:u,total:c,recorded:s.length,current:y,past:f,best:d,vsPct:D}},Object.defineProperty(_e,"firstTakingsMonth",{enumerable:!0,get:function(){return P}}),_e.canSeeMonthTakings=function(e,t,n={}){return!n.inStaffApp&&'owner'===e&&(t?'owner'===t.role||!0===t.ownerAccess:!n.live)},_e.ownerHomeLayout=function(e,t,n=!1){return!n&&'owner'===e&&(!t||'owner'===t.role||!0===t.ownerAccess)};var e=_r(_d[0]);const t=[{key:'gross',label:'Gross takings',kind:'money',fixed:!0,optional:!0},{key:'food',label:'Food takings (optional)',kind:'money',fixed:!0,optional:!0},{key:'drink',label:'Drink takings (optional)',kind:'money',fixed:!0,optional:!0}],n=['lunchGross','dinnerGross'],r=t.map(e=>e.key);const o=e=>'number'==typeof e.gross?e.gross:null,a=['Z total','Card total','Cash total','Paid out','Card tips','Cash tips'],i={'Z total':{key:'zTotal',kind:'money'},'Card total':{key:'card',kind:'money'},'Cash total':{key:'cash',kind:'money'},'Paid out':{key:'paidOut',kind:'money',optional:!0},'Card tips':{key:'cardTips',kind:'money',fixed:!0},'Cash tips':{key:'cashTips',kind:'money',fixed:!0}};const l=[{key:'card',label:'Card takings',kind:'money'},{key:'cash',label:'Cash takings',kind:'money'},{key:'paidOut',label:'Paid out',kind:'money',fixed:!0,optional:!0},...t,{key:'float',label:'Float (tills)',kind:'money'},{key:'cashTips',label:'Cash tips total',kind:'money',fixed:!0},{key:'cardTips',label:'Card tips total',kind:'money',fixed:!0},{key:'overUnder',label:'Over / under (discrepancy)',kind:'money'},{key:'notes',label:'Notes',kind:'text'}],u=[{key:'gross',label:'Gross sales',kind:'money'},{key:'net',label:'Net sales',kind:'money',fixed:!0},{key:'vat',label:'VAT',kind:'money'},{key:'covers',label:'Covers',kind:'number'},{key:'discounts',label:'Discounts',kind:'money'},{key:'refunds',label:'Refunds',kind:'money'}];const s=e=>null==e||''===e,c=e=>e.toISOString().slice(0,10),d=e=>new Date(`${e}T12:00:00Z`),y=(e,t)=>{const n=d(e);return n.setUTCDate(n.getUTCDate()+t),c(n)};const f=e=>{const t='number'==typeof e.card?e.card:null,n='number'==typeof e.cash?e.cash:null;return null==t&&null==n?null:(t??0)+(n??0)},m=(e,t)=>e.filter(e=>'text'!==e.kind&&!e.optional&&s(t[e.key])).map(e=>e.key);const p=e=>e.confirmedAt?o(e.vals)??f(e.vals):null,k=(e,t)=>new Date(Date.UTC(e,t,0)).getUTCDate();function b(e,t){const n=Number(e.slice(0,4)),r=Number(e.slice(5,7))-1+t;return`${n+Math.floor(r/12)}-${String((r%12+12)%12+1).padStart(2,'0')}`}const h=['January','February','March','April','May','June','July','August','September','October','November','December'],S=['Sun','Mon','Tue','Wed','Thu','Fri','Sat'],T=['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'],O=e=>h[Number(e.slice(5,7))-1]??'',C=e=>{const t=d(e);return`${S[t.getUTCDay()]} ${t.getUTCDate()} ${h[t.getUTCMonth()].slice(0,3)}`},D=e=>{const t=d(e);return`${T[t.getUTCDay()]} ${t.getUTCDate()} ${h[t.getUTCMonth()]}`};const P=(e,t)=>e.filter(e=>e.rid===t&&null!=p(e)).map(e=>e.date.slice(0,7)).sort()[0]??null},839,[840]); __d(function(g,r,_i,_a,m,e,d){"use strict";function t(t,n){const i=!(!n?.allowMinus||!String(t??'').trim().startsWith('-'));let s=String(t??'').replace(/,/g,'.');s=s.replace(/[^\d.]/g,'');const l=s.indexOf('.');if(l>=0){s=s.slice(0,l+1)+s.slice(l+1).replace(/\./g,'');const[t,n=""]=s.split('.');s=t+'.'+n.slice(0,2)}return(i?'-':'')+s}Object.defineProperty(e,'__esModule',{value:!0}),e.sanitiseMoneyTyping=t,e.parseMoneyInput=function(n){const i=String(n??''),s=i.trim().startsWith('-'),l=i.trim().replace(/^\xa3/,'').replace(/\xa3/g,'').replace(/\s/g,'').replace(/^-/,'');if(l&&/[^\d.,]/.test(l))return null;const c=t(n);if(!c||'.'===c)return null;if(!/^\d+(\.\d{0,2})?$/.test(c))return null;const u=Math.round(100*Number(c))/100;return Number.isFinite(u)?s?-u:u:null},Object.defineProperty(e,"onMoneyChange",{enumerable:!0,get:function(){return n}});const n=n=>i=>n(t(i))},840,[]); -__d(function(g,r,i,a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"DEPOSIT_DEFAULT",{enumerable:!0,get:function(){return e}}),_e.depositOf=function(t){const n=t?.deposit;return n&&'object'==typeof n?{on:n.on??e.on,...!0===n.needsConfirmation?{needsConfirmation:!0}:{},perPersonPence:Number.isFinite(n.perPersonPence)?Math.max(0,Math.round(n.perPersonPence)):n.needsConfirmation?0:e.perPersonPence,fromParty:Number.isFinite(n.fromParty)?Math.max(1,Math.round(n.fromParty)):n.needsConfirmation?1:e.fromParty,refundable:'boolean'==typeof n.refundable?n.refundable:null,cutoffHours:Number.isFinite(n.cutoffHours)?Math.max(0,Math.round(n.cutoffHours)):null,policy:'string'==typeof n.policy?n.policy.slice(0,600):'',wixLinksOn:!0===n.wixLinksOn,wixLinkHours:Number.isFinite(n.wixLinkHours)?Math.max(1,Math.min(168,Math.round(n.wixLinkHours))):48}:{...e}},_e.childrenIn=t,Object.defineProperty(_e,"adultsIn",{enumerable:!0,get:function(){return n}}),_e.depositDue=o,_e.depositWords=function(e,d,u,p=0){if(e.needsConfirmation&&!e.on)return[e.policy.trim()||'Deposit policy awaiting venue confirmation.'];if(e.needsConfirmation)return['Table deposit policy not set yet. Ticketed event deposits are separate and are not a table policy.'];const l=o(e,d,p);if(!l)return[];const c=[t(d,p)?`A deposit of ${s(l)} (${s(e.perPersonPence)} for each of the ${n(d,p)} adults; children are free) is needed for ${e.fromParty} or more guests.`:`A deposit of ${s(l)} (${s(e.perPersonPence)} per adult; children are free) is needed for ${e.fromParty} or more guests.`];!0===e.refundable?c.push(e.cutoffHours?`Refundable if you cancel at least ${e.cutoffHours} hours before your booking.`:'Refundable if you cancel.'):!1===e.refundable?c.push('The deposit is not refundable.'):c.push(`Ask ${u} about refunds.`);e.policy.trim()&&c.push(e.policy.trim());return c.push(e.wixLinksOn?`${u} will send you a link to pay the deposit securely through website bookings.`:`No payment is taken in the app yet: ${u} will tell you how to pay the deposit.`),c},_e.waiverOf=d,_e.depositState=u,_e.waiverText=p,_e.canWaiveDeposit=function(e){if(['cancelled','finished','noshow','declined'].includes(e.status??''))return!1;const t=l(e);return'PAID'!==t&&'FULLY_REFUNDED'!==t&&'PARTIALLY_REFUNDED'!==t&&'FREE'!==t&&('paid'!==e.depositLink?.state&&('NOT_PAID'===t||'PARTIALLY_PAID'===t?!d(e):'due'===u(e)))},_e.wixPayStatus=l,_e.knownPaid=c,_e.fromWixOrder=f,_e.estimatedWix=b,_e.depositBadge=m,_e.canTickDeposit=function(e){if(d(e))return!1;const t=l(e);return'NOT_PAID'!==t&&'PAID'!==t&&'FULLY_REFUNDED'!==t&&'PARTIALLY_REFUNDED'!==t&&('paid'!==e.depositLink?.state&&'due'===u(e))},_e.canSendDepositLink=function(e,t){return!(!t.wixLinksOn||l(e)||d(e))&&(!e.walkIn&&!['cancelled','finished','noshow','declined'].includes(e.status??'')&&('due'===u(e)&&'paid'!==e.depositLink?.state))},_e.depositTerms=function(e){const t=[];!0===e.refundable?t.push(e.cutoffHours?`The deposit is refundable if you cancel at least ${e.cutoffHours} hours before.`:'The deposit is refundable if you cancel.'):!1===e.refundable&&t.push('The deposit is not refundable.');e.policy.trim()&&t.push(e.policy.trim());return t.join(' ')},_e.depositLinkMessage=function(e){const t=(e.name||'').trim().split(/\s+/)[0]||'there',[n,o,d]=e.date.split('-').map(Number),u=new Date(n,(o||1)-1,d||1).toLocaleDateString('en-GB',{weekday:'long',day:'numeric',month:'long'}),p=e.expiresAt?new Date(e.expiresAt).toLocaleString('en-GB',{timeZone:'Europe/London',weekday:'long',day:'numeric',month:'long',hour:'numeric',minute:'2-digit',hourCycle:'h12'}).replace(/\s?(am|pm)$/i,e=>e.trim().toLowerCase()):'',l=[`Hello ${t}, thank you for booking ${e.venue} for ${e.partySize} on ${u} at ${e.time.slice(0,5)}.`,`To hold your table, please pay the ${s(e.amountPence)} deposit here: ${e.url}`];p&&l.push(`The link works until ${p}.`);e.terms?.trim()&&l.push(e.terms.trim());return l.push(`Thank you, ${e.venue}`),l.join('\n')},_e.depositView=D,_e.depositShort=function(e){const t=D(e,!1);return t?t.a11y.split(',')[0]:null};const e={on:!0,perPersonPence:1e3,fromParty:6,refundable:null,cutoffHours:null,policy:''};function t(e,t){const n=Math.max(0,Math.round(Number(e)||0)),o=Math.round(Number(t)||0);return Math.max(0,Math.min(n,o))}const n=(e,n)=>Math.max(0,Math.round(Number(e)||0)-t(e,n));function o(e,t,o=0){return!e.on||e.perPersonPence<=0||t`\xa3${(e/100).toFixed(e%100?2:0)}`;function d(e){const t=e.depositWaived;return t&&'object'==typeof t&&'string'==typeof t.by&&t.by?t:null}function u(e){if('deposit'!==e.security)return'none';const t=e.depositDue??e.depositPaid??0;return t?(e.depositPaid??0)>=t?'paid':d(e)?'waived':'due':'none'}function p(e){const t=new Date(e.at),n=!Number.isNaN(t.getTime())?t.toLocaleString('en-GB',{timeZone:'Europe/London',day:'2-digit',month:'2-digit',hour:'2-digit',minute:'2-digit',hourCycle:'h23'}).replace(',',''):'';return`Waived by ${e.by}${n?`, ${n}`:''}${e.note?.trim()?` (${e.note.trim()})`:''}`}function l(e){const t=e.wix?.paymentStatus;return t&&['FREE','NOT_PAID','PAID','PARTIALLY_PAID','PARTIALLY_REFUNDED','FULLY_REFUNDED'].includes(t)?t:null}function c(e){return'paid'===e.depositLink?.state&&(e.depositLink.paidPence??0)>0?e.depositLink.paidPence:e.depositPaidBy&&'Wix'!==e.depositPaidBy&&(e.depositPaid??0)>0&&!e.wix?.depositEstimated||f(e)&&(e.depositPaid??0)>0?e.depositPaid:null}function f(e){return'wix-order'===e.wix?.amountSource||'wix-order'===e.depositSource}function b(e){if(f(e)||!e.wix?.depositEstimated&&'estimate'!==e.depositSource)return null;const t=e.depositPaid??0;if(t<=0)return null;const n=e.partySize??0;return{pence:t,perHead:e.wix?.perPersonPence??(n?Math.round(t/n):0),party:n}}function m(e,t=s){const n=l(e),o=c(e),p=d(e);if(p&&'PAID'!==n&&(!e.depositPaidBy||!o)&&'paid'!==e.depositLink?.state&&'paid'!==u(e))return{label:`Deposit waived \xb7 ${p.by}`,kind:'neutral'};if(n&&'FREE'!==n){if(e.depositPaidBy&&o)return{label:`Deposit paid \xb7 ${t(o)}`,kind:'gold'};if('PAID'===n){if(o)return{label:`Deposit paid \xb7 ${t(o)}`,kind:'gold'};const n=b(e);return n?{label:n.party&&n.perHead?`Deposit paid (about ${t(n.pence)}, ${n.party} \xd7 ${t(n.perHead)})`:`Deposit paid (about ${t(n.pence)})`,kind:'gold'}:{label:'Deposit paid on website bookings',kind:'gold'}}return'PARTIALLY_PAID'===n?{label:o&&(e.depositDue??0)>o?`Part paid on website bookings \xb7 ${t(o)} of ${t(e.depositDue)}`:'Part paid on website bookings',kind:'amber'}:'NOT_PAID'===n?{label:(e.depositDue??0)>0?`Deposit not paid \xb7 ${t(e.depositDue)} due`:'Deposit not paid',kind:'amber'}:'FULLY_REFUNDED'===n?{label:'Deposit refunded on website bookings',kind:'neutral'}:{label:'Deposit part refunded on website bookings',kind:'neutral'}}const f=u(e);if('none'===f)return null;const m=e.depositLink;return'paid'===m?.state?{label:o?`Deposit paid on website bookings \xb7 ${t(o)}`:'Deposit paid on website bookings',kind:'gold'}:'paid'===f?{label:o?`Deposit paid \xb7 ${t(o)}`:'Deposit paid',kind:'gold'}:'open'===m?.state?{label:`Deposit link sent \xb7 waiting \xb7 ${t(m.amountPence??e.depositDue??0)}`,kind:'amber'}:'expired'===m?.state?{label:'Deposit link ran out \xb7 send a new one',kind:'amber'}:{label:`Deposit due \xb7 ${t(e.depositDue??0)}`,kind:'amber'}}function D(e,t,n=s){const o=m(e,n);if(!o)return null;const u=l(e),c=o.label.startsWith('Deposit paid');if(o.label.startsWith('Deposit waived')){const n=d(e);return{label:t?o.label:'Deposit waived',kind:'neutral',a11y:p(n).replace(/^Waived/,'Deposit waived'),note:t?p(n):void 0,paid:!1}}if(!t)return c?{label:'\u2713 Deposit paid',kind:'gold',a11y:'Deposit paid',paid:c}:'PARTIALLY_PAID'===u?{label:'Deposit part paid',kind:'amber',a11y:'Deposit part paid',paid:c}:'FULLY_REFUNDED'===u||'PARTIALLY_REFUNDED'===u?{label:'Deposit refunded',kind:'neutral',a11y:'Deposit refunded',paid:c}:'NOT_PAID'===u?{label:'Deposit not paid',kind:'amber',a11y:'Deposit not paid yet',paid:c}:{label:'Deposit due',kind:'amber',a11y:'Deposit due, not paid yet',paid:c};const D='PAID'===u?b(e):null,y=D&&D.perHead?`Website bookings shows paid; amount worked out at ${n(D.perHead)} a head`:f(e)&&c?'Amount from the website bookings order':void 0,P=o.label.replace(/ \xb7 /g,', ').replace(/\xd7/g,'times').replace(/[()]/g,'')+(y?`. ${y}`:'');return{label:o.label,kind:o.kind,a11y:P,note:y,paid:c}}},841,[]); +__d(function(g,r,i,a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"DEPOSIT_DEFAULT",{enumerable:!0,get:function(){return e}}),_e.depositOf=function(t){const n=t?.deposit;return n&&'object'==typeof n?{on:n.on??e.on,...!0===n.needsConfirmation?{needsConfirmation:!0}:{},perPersonPence:Number.isFinite(n.perPersonPence)?Math.max(0,Math.round(n.perPersonPence)):n.needsConfirmation?0:e.perPersonPence,fromParty:Number.isFinite(n.fromParty)?Math.max(1,Math.round(n.fromParty)):n.needsConfirmation?1:e.fromParty,refundable:'boolean'==typeof n.refundable?n.refundable:null,cutoffHours:Number.isFinite(n.cutoffHours)?Math.max(0,Math.round(n.cutoffHours)):null,policy:'string'==typeof n.policy?n.policy.slice(0,600):'',wixLinksOn:!0===n.wixLinksOn,wixLinkHours:Number.isFinite(n.wixLinkHours)?Math.max(1,Math.min(168,Math.round(n.wixLinkHours))):48}:{...e}},_e.childrenIn=t,Object.defineProperty(_e,"adultsIn",{enumerable:!0,get:function(){return n}}),_e.depositDue=o,_e.depositWords=function(e,d,u,p=0){if(e.needsConfirmation&&!e.on)return[e.policy.trim()||'Deposit policy awaiting venue confirmation.'];if(e.needsConfirmation)return['Table deposit policy not set yet. Ticketed event deposits are separate and are not a table policy.'];const l=o(e,d,p);if(!l)return[];const c=[t(d,p)?`A deposit of ${s(l)} (${s(e.perPersonPence)} for each of the ${n(d,p)} adults; children don't count towards the ${e.fromParty} and don't pay) is needed for ${e.fromParty} or more adults.`:`A deposit of ${s(l)} (${s(e.perPersonPence)} per adult; children don't count towards the ${e.fromParty} and don't pay) is needed for ${e.fromParty} or more adults.`];!0===e.refundable?c.push(e.cutoffHours?`Refundable if you cancel at least ${e.cutoffHours} hours before your booking.`:'Refundable if you cancel.'):!1===e.refundable?c.push('The deposit is not refundable.'):c.push(`Ask ${u} about refunds.`);e.policy.trim()&&c.push(e.policy.trim());return c.push(e.wixLinksOn?`${u} will send you a link to pay the deposit securely through website bookings.`:`No payment is taken in the app yet: ${u} will tell you how to pay the deposit.`),c},_e.waiverOf=d,_e.depositState=u,_e.waiverText=p,_e.canWaiveDeposit=function(e){if(['cancelled','finished','noshow','declined'].includes(e.status??''))return!1;const t=l(e);return'PAID'!==t&&'FULLY_REFUNDED'!==t&&'PARTIALLY_REFUNDED'!==t&&'FREE'!==t&&('paid'!==e.depositLink?.state&&('NOT_PAID'===t||'PARTIALLY_PAID'===t?!d(e):'due'===u(e)))},_e.wixPayStatus=l,_e.knownPaid=c,_e.fromWixOrder=f,_e.estimatedWix=b,_e.depositBadge=m,_e.canTickDeposit=function(e){if(d(e))return!1;const t=l(e);return'NOT_PAID'!==t&&'PAID'!==t&&'FULLY_REFUNDED'!==t&&'PARTIALLY_REFUNDED'!==t&&('paid'!==e.depositLink?.state&&'due'===u(e))},_e.canSendDepositLink=function(e,t){return!(!t.wixLinksOn||l(e)||d(e))&&(!e.walkIn&&!['cancelled','finished','noshow','declined'].includes(e.status??'')&&('due'===u(e)&&'paid'!==e.depositLink?.state))},_e.depositTerms=function(e){const t=[];!0===e.refundable?t.push(e.cutoffHours?`The deposit is refundable if you cancel at least ${e.cutoffHours} hours before.`:'The deposit is refundable if you cancel.'):!1===e.refundable&&t.push('The deposit is not refundable.');e.policy.trim()&&t.push(e.policy.trim());return t.join(' ')},_e.depositLinkMessage=function(e){const t=(e.name||'').trim().split(/\s+/)[0]||'there',[n,o,d]=e.date.split('-').map(Number),u=new Date(n,(o||1)-1,d||1).toLocaleDateString('en-GB',{weekday:'long',day:'numeric',month:'long'}),p=e.expiresAt?new Date(e.expiresAt).toLocaleString('en-GB',{timeZone:'Europe/London',weekday:'long',day:'numeric',month:'long',hour:'numeric',minute:'2-digit',hourCycle:'h12'}).replace(/\s?(am|pm)$/i,e=>e.trim().toLowerCase()):'',l=[`Hello ${t}, thank you for booking ${e.venue} for ${e.partySize} on ${u} at ${e.time.slice(0,5)}.`,`To hold your table, please pay the ${s(e.amountPence)} deposit here: ${e.url}`];p&&l.push(`The link works until ${p}.`);e.terms?.trim()&&l.push(e.terms.trim());return l.push(`Thank you, ${e.venue}`),l.join('\n')},_e.depositView=y,_e.depositShort=function(e){const t=y(e,!1);return t?t.a11y.split(',')[0]:null};const e={on:!0,perPersonPence:1e3,fromParty:6,refundable:null,cutoffHours:null,policy:''};function t(e,t){const n=Math.max(0,Math.round(Number(e)||0)),o=Math.round(Number(t)||0);return Math.max(0,Math.min(n,o))}const n=(e,n)=>Math.max(0,Math.round(Number(e)||0)-t(e,n));function o(e,t,o=0){return!e.on||e.perPersonPence<=0||n(t,o)`\xa3${(e/100).toFixed(e%100?2:0)}`;function d(e){const t=e.depositWaived;return t&&'object'==typeof t&&'string'==typeof t.by&&t.by?t:null}function u(e){if('deposit'!==e.security)return'none';const t=e.depositDue??e.depositPaid??0;return t?(e.depositPaid??0)>=t?'paid':d(e)?'waived':'due':'none'}function p(e){const t=new Date(e.at),n=!Number.isNaN(t.getTime())?t.toLocaleString('en-GB',{timeZone:'Europe/London',day:'2-digit',month:'2-digit',hour:'2-digit',minute:'2-digit',hourCycle:'h23'}).replace(',',''):'';return`Waived by ${e.by}${n?`, ${n}`:''}${e.note?.trim()?` (${e.note.trim()})`:''}`}function l(e){const t=e.wix?.paymentStatus;return t&&['FREE','NOT_PAID','PAID','PARTIALLY_PAID','PARTIALLY_REFUNDED','FULLY_REFUNDED'].includes(t)?t:null}function c(e){return'paid'===e.depositLink?.state&&(e.depositLink.paidPence??0)>0?e.depositLink.paidPence:e.depositPaidBy&&'Wix'!==e.depositPaidBy&&(e.depositPaid??0)>0&&!e.wix?.depositEstimated||f(e)&&(e.depositPaid??0)>0?e.depositPaid:null}function f(e){return'wix-order'===e.wix?.amountSource||'wix-order'===e.depositSource}function b(e){if(f(e)||!e.wix?.depositEstimated&&'estimate'!==e.depositSource)return null;const t=e.depositPaid??0;if(t<=0)return null;const n=e.partySize??0;return{pence:t,perHead:e.wix?.perPersonPence??(n?Math.round(t/n):0),party:n}}function m(e,t=s){const n=l(e),o=c(e),p=d(e);if(p&&'PAID'!==n&&(!e.depositPaidBy||!o)&&'paid'!==e.depositLink?.state&&'paid'!==u(e))return{label:`Deposit waived \xb7 ${p.by}`,kind:'neutral'};if(n&&'FREE'!==n){if(e.depositPaidBy&&o)return{label:`Deposit paid \xb7 ${t(o)}`,kind:'gold'};if('PAID'===n){if(o)return{label:`Deposit paid \xb7 ${t(o)}`,kind:'gold'};const n=b(e);return n?{label:n.party&&n.perHead?`Deposit paid (about ${t(n.pence)}, ${n.party} \xd7 ${t(n.perHead)})`:`Deposit paid (about ${t(n.pence)})`,kind:'gold'}:{label:'Deposit paid on website bookings',kind:'gold'}}return'PARTIALLY_PAID'===n?{label:o&&(e.depositDue??0)>o?`Part paid on website bookings \xb7 ${t(o)} of ${t(e.depositDue)}`:'Part paid on website bookings',kind:'amber'}:'NOT_PAID'===n?{label:(e.depositDue??0)>0?`Deposit not paid \xb7 ${t(e.depositDue)} due`:'Deposit not paid',kind:'amber'}:'FULLY_REFUNDED'===n?{label:'Deposit refunded on website bookings',kind:'neutral'}:{label:'Deposit part refunded on website bookings',kind:'neutral'}}const f=u(e);if('none'===f)return null;const m=e.depositLink;return'paid'===m?.state?{label:o?`Deposit paid on website bookings \xb7 ${t(o)}`:'Deposit paid on website bookings',kind:'gold'}:'paid'===f?{label:o?`Deposit paid \xb7 ${t(o)}`:'Deposit paid',kind:'gold'}:'open'===m?.state?{label:`Deposit link sent \xb7 waiting \xb7 ${t(m.amountPence??e.depositDue??0)}`,kind:'amber'}:'expired'===m?.state?{label:'Deposit link ran out \xb7 send a new one',kind:'amber'}:{label:`Deposit due \xb7 ${t(e.depositDue??0)}`,kind:'amber'}}function y(e,t,n=s){const o=m(e,n);if(!o)return null;const u=l(e),c=o.label.startsWith('Deposit paid');if(o.label.startsWith('Deposit waived')){const n=d(e);return{label:t?o.label:'Deposit waived',kind:'neutral',a11y:p(n).replace(/^Waived/,'Deposit waived'),note:t?p(n):void 0,paid:!1}}if(!t)return c?{label:'\u2713 Deposit paid',kind:'gold',a11y:'Deposit paid',paid:c}:'PARTIALLY_PAID'===u?{label:'Deposit part paid',kind:'amber',a11y:'Deposit part paid',paid:c}:'FULLY_REFUNDED'===u||'PARTIALLY_REFUNDED'===u?{label:'Deposit refunded',kind:'neutral',a11y:'Deposit refunded',paid:c}:'NOT_PAID'===u?{label:'Deposit not paid',kind:'amber',a11y:'Deposit not paid yet',paid:c}:{label:'Deposit due',kind:'amber',a11y:'Deposit due, not paid yet',paid:c};const y='PAID'===u?b(e):null,D=y&&y.perHead?`Website bookings shows paid; amount worked out at ${n(y.perHead)} a head`:f(e)&&c?'Amount from the website bookings order':void 0,P=o.label.replace(/ \xb7 /g,', ').replace(/\xd7/g,'times').replace(/[()]/g,'')+(D?`. ${D}`:'');return{label:o.label,kind:o.kind,a11y:P,note:D,paid:c}}},841,[]); __d(function(_g,_r,_i,_a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"SHAPES",{enumerable:!0,get:function(){return a}}),Object.defineProperty(_e,"shapeLabel",{enumerable:!0,get:function(){return o}}),Object.defineProperty(_e,"tableLabel",{enumerable:!0,get:function(){return s}}),Object.defineProperty(_e,"tableNumber",{enumerable:!0,get:function(){return u}}),_e.numberClashes=function(e){const t=new Map;for(const n of e){const e=u(n);t.set(e,[...t.get(e)??[],{name:n.name,areaId:n.areaId}])}const n=new Set,r=[];for(const[e,a]of t){if(a.length<2)continue;const t=new Map;a.forEach(e=>t.set(e.areaId,[...t.get(e.areaId)??[],e.name]));for(const e of t.values())e.length>1&&e.forEach(e=>n.add(e));t.size>1&&r.push(e)}return{sameArea:n,acrossAreas:r}},Object.defineProperty(_e,"liveTableLabel",{enumerable:!0,get:function(){return l}}),Object.defineProperty(_e,"FIXTURES",{enumerable:!0,get:function(){return i}}),Object.defineProperty(_e,"PLAN_W",{enumerable:!0,get:function(){return c}}),Object.defineProperty(_e,"PLAN_H",{enumerable:!0,get:function(){return b}}),Object.defineProperty(_e,"GRID",{enumerable:!0,get:function(){return m}}),Object.defineProperty(_e,"snap",{enumerable:!0,get:function(){return f}}),Object.defineProperty(_e,"clamp",{enumerable:!0,get:function(){return h}}),Object.defineProperty(_e,"fid",{enumerable:!0,get:function(){return g}}),Object.defineProperty(_e,"slug",{enumerable:!0,get:function(){return w}}),_e.sizeFor=y,Object.defineProperty(_e,"minFor",{enumerable:!0,get:function(){return x}}),Object.defineProperty(_e,"numOf",{enumerable:!0,get:function(){return O}}),Object.defineProperty(_e,"byNumber",{enumerable:!0,get:function(){return P}}),_e.newTable=j,_e.autoArrange=M,_e.placeNew=S,_e.rotate90=function(e){const t=e.x+e.w/2,n=e.y+e.h/2;return{...e,w:e.h,h:e.w,x:h(f(t-e.h/2),0,c-e.h),y:h(f(n-e.w/2),0,b-e.w)}},_e.normalisePlan=function(e){return{...e,fixtures:e.fixtures??[],tables:e.tables.map(e=>{const t=e.shape;let n='booth'===t||'rect'===t?'rect':'round'===t?'round':'square',{w:r,h:a}=e;if('square'===n||'round'===n){const e=Math.max(r,a);r=e,a=e}if(90===e.rot||270===e.rot){const e=r;r=a,a=e}return'rect'===n&&r===a&&(n='square'),{...e,shape:n,w:r,h:a,rot:0}})}},Object.defineProperty(_e,"SECTION_COLOURS",{enumerable:!0,get:function(){return I}}),_e.buildPlan=k,_e.anchoragePlan=$,_e.starterPlan=function(){return k({areas:[{name:'Main room',tables:[[1,2],[2,4],[3,6],[4,4],[5,2],[6,6]],fixtures:[A(450,600)]}]},['SV'])},Object.defineProperty(_e,"TEMPLATES",{enumerable:!0,get:function(){return v}}),_e.parseTableList=function(e){const t=[],n=[];let r;for(const a of e.split(/\r?\n/)){const e=a.trim();if(!e)continue;if(!/\d/.test(e)){r=e.replace(/[:\-\u2013]+$/,'').trim()||r;continue}const o=e.match(/^(?:table|tbl|tab|t)?\s*(?:no\.?|number|#)?\s*([a-z]?\d+[a-z]?)\b[^\d]*?(\d+)/i);if(!o){n.push(e);continue}const s=parseInt(o[2],10);!s||s>30?n.push(e):t.push({area:r,name:o[1].toUpperCase(),seats:s})}return{items:t,skipped:n}},Object.defineProperty(_e,"planCounts",{enumerable:!0,get:function(){return C}}),Object.defineProperty(_e,"tableDogOk",{enumerable:!0,get:function(){return B}}),Object.defineProperty(_e,"dogTables",{enumerable:!0,get:function(){return L}}),Object.defineProperty(_e,"areaOfTable",{enumerable:!0,get:function(){return q}}),_e.bestTables=E,Object.defineProperty(_e,"isBestTable",{enumerable:!0,get:function(){return _}}),_e.withSeedBest=function(e,t){if('anchorage'!==e||!t?.areas?.some(e=>void 0===e.best))return t;const n=$();return{...t,areas:t.areas.map(e=>{if(void 0!==e.best)return e;const r=n.areas.find(t=>t.id===e.id||t.name===e.name),a=(r?.best??[]).filter(n=>t.tables.some(t=>t.name===n&&t.areaId===e.id));return a.length?{...e,best:a}:e})}};var e,t=_r(d[0]),n=_r(d[1]),r=(e=n)&&e.__esModule?e:{default:e};const a=[{id:'square',label:'Square'},{id:'rect',label:'Rectangle'},{id:'round',label:'Round'}],o=e=>'rect'===e?'Rectangle':'round'===e?'Round':'Square',s=e=>/\d/.test(e.name)?(0,t.plainTableNumber)(e.name):(0,t.plainTableNumber)(e.label?.trim()||e.name),u=s;const l=(e,t)=>u(e),i=[{id:'bar',label:'Bar',w:300,h:50},{id:'wall',label:'Wall',w:250,h:25},{id:'door',label:'Door',w:100,h:25},{id:'window',label:'Window',w:200,h:25}],c=1e3,b=625,m=25,f=e=>Math.round(e/m)*m,h=(e,t,n)=>Math.max(t,Math.min(n,e));let p=0;const g=e=>`${e}-${Date.now().toString(36)}${(p++).toString(36)}`,w=e=>e.toLowerCase().replace(/[^a-z0-9]+/g,'-').replace(/^-|-$/g,'')||'area';function y(e){return e<=2?{shape:'square',w:75,h:75}:e<=4?{shape:'square',w:100,h:100}:e<=6?{shape:'rect',w:150,h:100}:e<=8?{shape:'rect',w:200,h:100}:e<=10?{shape:'rect',w:250,h:100}:{shape:'rect',w:300,h:100}}const x=e=>e<=2?1:Math.max(2,Math.ceil(e/2)),O=e=>{const t=e.match(/\d+/);return t?parseInt(t[0],10):9999},P=(e,t)=>O(e.name)-O(t.name)||e.name.localeCompare(t.name);function j(e,t,n,r){const a=y(n);return{id:`t-${e}-${g('x').slice(2)}`,name:e,areaId:t,shape:a.shape,minSeats:x(n),maxSeats:n,x:0,y:0,w:a.w,h:a.h,rot:0,online:!0,sectionId:r}}function M(e,t=125,n=75){const r=[...e].sort(P);if(!r.length)return r;let a=75;const o=e=>{const t=[];let n=[],a=0;for(const o of r){const r=(n.length?e:0)+o.w;n.length&&a+r>850&&(t.push(n),n=[],a=0),n.push(o),a+=(n.length>1?e:0)+o.w}return n.length&&t.push(n),t};let s=o(a);const u=(e,t)=>e.reduce((e,t)=>e+Math.max(...t.map(e=>e.h)),0)+t*(e.length-1);for(;u(s,a)>b-t-n&&a>25;)a-=25,s=o(a);const l=u(s,a),i=b-t-n,p=s.length>1?Math.min(150,a+Math.max(0,Math.floor((i-l)/(s.length-1)/m)*m)):0,g=s.reduce((e,t)=>e+Math.max(...t.map(e=>e.h)),0)+p*(s.length-1);let w=f(t+Math.max(0,(i-g)/2));const y=[];for(const e of s){const t=Math.max(...e.map(e=>e.h)),n=e.reduce((e,t)=>e+t.w,0)+a*(e.length-1);let r=f((c-n)/2);for(const n of e)y.push({...n,x:h(r,0,c-n.w),y:h(f(w+(t-n.h)/2),0,b-n.h),rot:0}),r+=n.w+a;w+=t+p}return y}function S(e,t,n=[]){const r=[...e,...n].map(e=>({x:e.x,y:e.y,w:e.w,h:e.h})),a=[];for(const e of t){let t=null;for(let n=50;n<=b-e.h-25&&!t;n+=m)for(let a=50;a<=c-e.w-25&&!t;a+=m){const o=50;r.some(t=>at.x&&nt.y)||(t={x:a,y:n})}const n=t??{x:50,y:50},o={...e,x:n.x,y:n.y};r.push({x:o.x,y:o.y,w:o.w,h:o.h}),a.push(o)}return a}const I=['#CFA45F','#E2C489','#A88B5A','#8C6A3A','#FFB547','#D9B98A'];function k(e,t=[]){const n=[],r=[],a=[],o=[];e.areas.forEach((e,s)=>{const u=w(e.name),l=e.best?e.best.map(String).filter(t=>e.tables.some(([e])=>String(e)===t)):void 0;n.push({id:u,name:e.name,dogs:!!e.dogs,outdoor:!!e.outdoor,...e.label?{label:e.label}:{},...e.colour?{colour:e.colour}:{},...l?{best:l}:{}});const i=`s-${u}`;o.push({id:i,name:e.name,colour:e.colour??I[s%I.length],server:t[s]??''});const m=(e.fixtures??[]).map((e,t)=>({...e,id:`fx-${u}-${t}`,areaId:u}));a.push(...m);const f=m.some(e=>e.y<100&&('bar'===e.kind||e.w>=300))?150:100,p=e.tables.map(([e,t])=>({...j(String(e),u,t,i),id:`t-${e}`})),g=e.layout??{},y=p.filter(e=>g[e.name]).map(e=>{const t=g[e.name],n=t.shape??(t.w===t.h?'square':'rect'),r=h(Math.round(t.w),50,c),a=h(Math.round('rect'===n?t.h:t.w),50,b);return{...e,shape:n,w:r,h:a,x:h(Math.round(t.x),0,c-r),y:h(Math.round(t.y),0,b-a),...t.label?{label:t.label}:{}}}),x=p.filter(e=>!g[e.name]);y.length?r.push(...y,...S(y,x,m)):r.push(...M(p,f,75))});const s=new Set(r.map(e=>e.name)),u=(e.joins??[]).filter(e=>e.every(e=>s.has(e))).map(e=>({id:`j-${e.join('-')}`,tables:e}));return{areas:n,tables:r,joins:u,sections:o,fixtures:a}}const T=(e,t,n=0,r=25)=>({kind:'window',x:e,y:n,w:t,h:r}),A=(e,t,n=100,r=25)=>({kind:'door',x:e,y:t,w:n,h:r});function $(){const e=r.default;return k({areas:e.areas.map(e=>({name:e.name,dogs:!!e.dogFriendly,outdoor:!(!e.outdoor&&!e.weatherDependent),label:e.label,colour:e.colour,tables:e.tables.map(([e,t])=>[e,t]),layout:e.layout,fixtures:[],best:e.best?.map(String)})),joins:e.joins??[]},e.areas.map(e=>e.server??''))}const v=[{id:'anchorage',name:'The Anchorage',sub:'4 areas \xb7 29 tables \xb7 119 seats',make:$},{id:'cafe',name:'Small caf\xe9',sub:'1 room \xb7 8 tables \xb7 dogs welcome',make:()=>k({areas:[{name:'Caf\xe9',dogs:!0,tables:[[1,2],[2,2],[3,4],[4,4],[5,2],[6,4],[7,2],[8,6]],fixtures:[{kind:'bar',x:300,y:25,w:400,h:50},A(450,600)]}]})},{id:'pub',name:'Pub with garden',sub:'Bar, lounge and beer garden',make:()=>k({areas:[{name:'Bar',dogs:!0,tables:[[1,2],[2,4],[3,4],[4,2],[5,4],[6,6]],fixtures:[{kind:'bar',x:250,y:25,w:500,h:75}]},{name:'Lounge',tables:[[7,4],[8,4],[9,2],[10,6],[11,4],[12,2],[13,4],[14,8]],fixtures:[T(150,700)]},{name:'Beer garden',dogs:!0,outdoor:!0,tables:[[20,6],[21,6],[22,4],[23,4],[24,6],[25,6]]}]})},{id:'restaurant',name:'Restaurant and terrace',sub:'Dining room with an outdoor terrace',make:()=>k({areas:[{name:'Dining room',tables:[[1,2],[2,2],[3,4],[4,4],[5,4],[6,6],[7,2],[8,2],[9,4],[10,4],[11,6],[12,8]],fixtures:[T(100,800),A(450,600)]},{name:'Terrace',outdoor:!0,tables:[[20,2],[21,4],[22,4],[23,2]]}]})},{id:'blank',name:'Blank',sub:'One empty room to start from',make:()=>k({areas:[{name:'Main room',tables:[]}]})}];const C=(e,t)=>{const n=t?e.tables.filter(e=>e.areaId===t):e.tables;return{tables:n.length,seats:n.reduce((e,t)=>e+t.maxSeats,0)}},B=(e,t)=>void 0!==t.dogOk?t.dogOk:!!e.areas.find(e=>e.id===t.areaId)?.dogs,L=e=>new Set(e.tables.filter(t=>B(e,t)).map(e=>e.name)),q=(e,t)=>e.areas.find(n=>n.id===e.tables.find(e=>e.name===t)?.areaId);function E(e,t){return e.areas.filter(e=>!t||e.id===t).flatMap(t=>(t.best??[]).filter(n=>e.tables.some(e=>e.name===n&&e.areaId===t.id)))}const _=(e,t)=>E(e).includes(t)},842,[843,844]); __d(function(g,r,i,a,m,e,d){"use strict";function t(t){const n=String(t??'').trim(),l=n.match(/\d+/g);return 1===l?.length?l[0].replace(/^0+(?=\d)/,''):n}Object.defineProperty(e,'__esModule',{value:!0}),e.plainTableNumber=t,Object.defineProperty(e,"tableNumbers",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"tableListNumbers",{enumerable:!0,get:function(){return l}}),e.tableNumbersA11y=function(t){const l=n(t).split('+').filter(Boolean);return l.length?`${1===l.length?'Table':'Tables'} ${l.join(', ')}`:'No table'},e.withTableWord=function(t){const n=t.trim();return!n||/^tables?\b/i.test(n)||/^no table\b/i.test(n)?n:`Table ${n}`};const n=n=>String(n??'').split('+').map(t).filter(Boolean).join('+'),l=(t,l=" + ")=>t.map(n).filter(Boolean).join(l)},843,[]); __d(function(e,a,l,r,t,o,s){t.exports={venue:"The Anchorage",note:"From Gordon 28 Oct 2026; layout from Gordon's floor-plan photo 29 Oct 2026 (positions, sizes, shapes, labels scaled from the photo, one scale for all areas). Photo shows MT12 and no MT8: table 8 replaced by 12. Gordon confirmed 29 Oct: no table 8; MT11 and MT12 both exist, MT11 keeps 2 seats, MT12 = 2 seats. No tables 4 or 8. No joined tables: Gordon confirmed 29 Oct that DT1 and DT2 are not joined.",areas:[{name:"Public Bar",label:"Dog friendly area (Public Bar), Area 1",colour:"#CFA45F",server:"BR",dogFriendly:!0,tables:[[1,4],[2,4],[3,5],[5,2],[6,4]],layout:{1:{label:"DT1",shape:"rect",x:600,y:125,w:205,h:90},2:{label:"DT2",shape:"rect",x:395,y:130,w:100,h:190},3:{label:"DT3",shape:"rect",x:205,y:120,w:110,h:245},5:{label:"DT5",shape:"square",x:500,y:395,w:105,h:105},6:{label:"DT6",shape:"rect",x:195,y:395,w:205,h:110}},best:[1,3]},{name:"Main Restaurant",label:"Main restaurant (no pets)",colour:"#8EC5FF",server:"SV",dogFriendly:!1,tables:[[7,5],[9,7],[10,4],[11,2],[12,2],[13,4],[14,4],[15,4],[16,2]],layout:{7:{label:"MT7",shape:"rect",x:590,y:410,w:225,h:115},9:{label:"MT9",shape:"rect",x:560,y:105,w:260,h:110},10:{label:"MT10",shape:"square",x:430,y:400,w:130,h:130},11:{label:"MT11",shape:"rect",x:545,y:270,w:115,h:90},12:{label:"MT12",shape:"rect",x:400,y:270,w:120,h:95},13:{label:"MT13",shape:"rect",x:400,y:100,w:90,h:115},14:{label:"MT14",shape:"rect",x:185,y:420,w:230,h:100},15:{label:"MT15",shape:"rect",x:190,y:220,w:165,h:145},16:{label:"MT16",shape:"rect",x:185,y:105,w:125,h:80}},best:[7,9]},{name:"Sitooterie",label:"Sitooterie (fully covered conservatory, no pets)",colour:"#C79BE8",server:"DM",dogFriendly:!1,tables:[[17,2],[18,6],[19,4],[20,6],[21,4],[22,4],[23,4]],layout:{17:{label:"ST17",shape:"square",x:760,y:325,w:110,h:110},18:{label:"ST18",shape:"rect",x:605,y:135,w:270,h:115},19:{label:"ST19",shape:"rect",x:460,y:160,w:105,h:150},20:{label:"ST20",shape:"rect",x:135,y:125,w:265,h:120},21:{label:"ST21",shape:"rect",x:120,y:305,w:110,h:175},22:{label:"ST22",shape:"rect",x:255,y:310,w:115,h:175},23:{label:"ST23",shape:"rect",x:410,y:350,w:110,h:155}},best:[19,21]},{name:"Beer Garden",label:"Outdoor beer garden (weather permitting, no shelter, pets allowed)",colour:"#B08D57",server:"GD",dogFriendly:!0,outdoor:!0,weatherDependent:!0,tables:[[24,4],[25,4],[26,4],[27,6],[28,6],[29,4],[30,4],[31,4]],layout:{24:{label:"BGT24",shape:"round",x:740,y:70,w:130,h:130},25:{label:"BGT25",shape:"round",x:515,y:50,w:135,h:135},26:{label:"BGT26",shape:"round",x:310,y:50,w:135,h:135},27:{label:"BGT27",shape:"rect",x:560,y:235,w:280,h:115},28:{label:"BGT28",shape:"rect",x:245,y:235,w:270,h:110},29:{label:"BGT29",shape:"rect",x:210,y:365,w:190,h:60},30:{label:"BGT30",shape:"rect",x:180,y:445,w:190,h:55},31:{label:"BGT31",shape:"rect",x:130,y:520,w:215,h:60}},best:[27,28]}],photoScale:1.8,joins:[],bestNote:"Best tables per area from Gordon, 1 Nov 2026: Bar 1 and 3; Restaurant 7 and 9; Sitooterie 19 and 21; Outside (Beer Garden) 27 and 28. Shown as BEST for walk-ins and bookings when they fit; editable per area in the table plan."}},844,[]); @@ -1059,7 +1059,7 @@ __d(function(g,r,i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule' __d(function(g,r,i,a,_m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.setClockServer=function(t){s=t,c()},e.markClockUnsent=function(t){o.set(t,Date.now()),c()},e.markClockSent=function(t){o.delete(t)&&c()},e.clockNotSent=l,e.useClockNotSent=function(o){const[,c]=(0,t.useState)(0);return(0,t.useEffect)(()=>{const t=()=>c(t=>t+1);u.add(t);const o=n.mutationQueue.subscribe(t);return()=>{u.delete(t),o()}},[]),l(o)};var t=r(d[0]),n=r(d[1]);const o=new Map,u=new Set,c=()=>{for(const t of u)t()};let s=()=>!1;function l(t){if(!t)return!1;return n.mutationQueue.pending.some(n=>'attendance'===n.table&&n.rowKey===t)||o.has(t)&&s()}n.mutationQueue.onDone(t=>{'attendance'===t.table&&o.delete(t.rowKey)&&c()})},976,[17,977]); __d(function(g,_r,i,a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"MutationQueue",{enumerable:!0,get:function(){return l}}),Object.defineProperty(_e,"mutationQueue",{enumerable:!0,get:function(){return o}});var t=_r(d[0]),e=_r(d[1]),s=_r(d[2]);const n='queue:v1',r='queue:failed:v1',h=t=>`${t.table}|${t.venueId}|${t.rowKey}`;class l{items=[];failedItems=[];loaded=null;flushing=null;flushingSince=0;exec=null;listeners=new Set;onFailure=new Set;onSaved=new Set;retryTimer=null;waitTimer=null;backoffMs=2e3;now=()=>Date.now();constructor(){(0,t.onConnectivity)(t=>{t&&this.flush()})}setExecutor(t){this.exec=t}load(){return this.loaded||(this.loaded=(async()=>{const t=await e.kv.get(n,[]);this.items=[...t.map(t=>({...t,nextAt:void 0})),...this.items],this.failedItems=await e.kv.get(r,[]),this.emit()})()),this.loaded}get pending(){return this.items}get waiting(){return this.items.filter(t=>t.attempts>0)}get failed(){return this.failedItems}hasPending(t,e,s){return this.items.some(n=>n.table===t&&n.venueId===e&&n.rowKey===s)}async enqueue(t){await this.load();const s={...t,id:(0,e.uuid)(),createdAt:(new Date).toISOString(),attempts:0};return this.items.push(s),await this.persist(),this.flush(),s}nextReady(){const t=new Set,e=this.now();for(const s of this.items){const n=h(s);if(!t.has(n)){if(!(s.nextAt&&s.nextAt>e))return s;t.add(n)}}}remove(t){this.items=this.items.filter(e=>e!==t)}flush(){if(this.flushing&&Date.now()-this.flushingSince<6e4)return this.flushing;this.flushingSince=Date.now();let e=null;return e=(async()=>{for(await this.load();this.exec;){if(this.flushing&&this.flushing!==e)return;const n=this.nextReady();if(!n)break;if(!(0,t.isOnline)()){this.scheduleRetry();break}try{const t=await this.exec(n);this.remove(n),this.backoffMs=2e3,'conflict'===t?this.fail(n,'conflict','Row changed on the server (version conflict) or is not visible to you'):this.onSaved.forEach(t=>t(n))}catch(e){n.attempts+=1,n.lastError=String(e?.message??e);const r=e??{};n.lastErr={code:r.code?String(r.code):void 0,status:Number(r.status)||void 0,message:n.lastError.slice(0,300)};const h=(0,s.classifyWriteError)(e);if('network'===h){n.attempts-=1,(0,t.setOnline)(!1),this.scheduleRetry(),await this.persist();break}'retry'===h?n.nextAt=this.now()+(0,s.retryDelayMs)(n.attempts):(this.remove(n),this.fail(n,'rejected',n.lastError))}await this.persist()}this.flushing===e&&(this.flushing=null),this.scheduleWaiting()})(),this.flushing=e,e}retryNow(){for(const t of this.items)t.nextAt=void 0;return this.flush()}subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}onFailed(t){return this.onFailure.add(t),()=>{this.onFailure.delete(t)}}onDone(t){return this.onSaved.add(t),()=>{this.onSaved.delete(t)}}async clearFailed(){this.failedItems=[],await e.kv.set(r,[]),this.emit()}fail(t,s,n){const h={...t,lastError:n,failedAt:(new Date).toISOString(),reason:s};this.failedItems=[h,...this.failedItems].slice(0,100),e.kv.set(r,this.failedItems),this.onFailure.forEach(t=>t(h))}scheduleWaiting(){this.waitTimer&&(clearTimeout(this.waitTimer),this.waitTimer=null);const t=this.items.map(t=>t.nextAt??0).filter(t=>t>0);if(!t.length)return;const e=Math.max(500,Math.min(...t)-this.now());this.waitTimer=setTimeout(()=>{this.waitTimer=null,this.flush()},e)}scheduleRetry(){if(this.retryTimer)return;const e=this.backoffMs;this.backoffMs=Math.min(2*this.backoffMs,6e4),this.retryTimer=setTimeout(()=>{this.retryTimer=null,(0,t.setOnline)(!0),this.flush()},e)}async persist(){await e.kv.set(n,this.items),this.emit()}emit(){this.listeners.forEach(t=>t())}}const o=new l},977,[974,936,978]); __d(function(g,r,i,a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.classifyWriteError=function(o){if((0,e.isNetworkError)(o))return'network';const{code:n,status:c,msg:l}=t(o);return s(o)?'refused':/^(08|53|57|58)/.test(n)||['40001','40P01','55P03','23505','23503'].includes(n)||/^PGRST30[0-3]$/.test(n)||/jwt|token.*expired/i.test(l)||401===c||408===c||425===c||429===c||c>=500?'retry':409!==c||n?'refused':'retry'},Object.defineProperty(_e,"retryDelayMs",{enumerable:!0,get:function(){return o}}),_e.describeWrite=function(e){const t='rpc'===e.kind?(e.fn??'change').replace(/_/g,' '):n[e.table]??e.table.replace(/_/g,' ').replace(/s$/,''),s=e.values??{},o=s.guest_name??s.name??s.display_name??s.title??s.reason,c='string'==typeof o&&o.trim()?` for ${o.trim().slice(0,60)}`:'';return'delete'===e.kind?`deleting a ${t}${c}`:`the ${t}${c}`},_e.plainReason=function(e,o){const{code:n,status:c,msg:l}=t(e);if('refused'===o)return s(e)?'more than 20 deletes in 10 minutes from one sign-in are stopped to keep your data safe':'42501'===n||403===c||/row-level security|permission/i.test(l)?'your sign-in isn\u2019t allowed to change this':'conflict'===n?'it was changed or removed on another device first':/^(22|23)/.test(n)?'the shared system says some of the details aren\u2019t valid':'P0001'===n&&l?l.slice(0,140):l?`the shared system said: ${l.slice(0,120)}`:'the shared system refused it';return'23505'===n?'the shared system already has another copy of it':'23503'===n?'a related change has to save first':/^PGRST30/.test(n)||401===c||/jwt/i.test(l)?'your sign-in is being refreshed':'the shared system is busy'};var e=r(d[0]);const t=e=>{const t=e&&'object'==typeof e?e:{};return{msg:String(t.message??e??''),code:String(t.code??''),status:Number(t.status??0)||0,hint:String(t.hint??'')}},s=e=>{const s=t(e);return/delete guard/i.test(s.hint)||/too many .* deleted in 10 minutes/i.test(s.msg)};const o=e=>Math.min(5e3*Math.pow(3,Math.max(0,e-1)),3e5),n={bookings:'booking',walk_ins:'walk-in',blocks:'blocked time',sold_out_items:'sold-out mark',sold_out_links:'dish stock link',staff:'staff details',rota_shifts:'rota shift',stock_items:'stock item',stock_events:'stock count',stock_counts:'stock count',chat_messages:'chat message',recipe_cards:'recipe card',order_lists:'order list',order_list_items:'order list item',daily_task_ticks:'task tick',daily_tasks:'daily task',attendance:'clock in or out',cash_ups:'cash-up',table_plans:'table plan',guest_profiles:'guest profile',floor_live:'table status',venues:'venue settings',time_requests:'clock correction request',staff_leave:'time off',scheduled_notifications:'reminder',suppliers:'supplier',supplier_orders:'supplier order',takeaway_orders:'takeaway order'}},978,[974]); -__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"APP_VERSION",{enumerable:!0,get:function(){return t}});const t='v0.3.12.192'},979,[]); +__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"APP_VERSION",{enumerable:!0,get:function(){return t}});const t='v0.3.12.193'},979,[]); __d(function(g,_r,i,a,_m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"TableRepository",{enumerable:!0,get:function(){return c}}),e.executeMutation=async function(t){const s=(t,s)=>{throw Object.assign(t,{status:s})};if('rpc'===t.kind){const{error:n,status:r}=await u().rpc(t.fn,t.values??{});return n&&s(n,r),'ok'}const n=u().from(t.table);if('upsert'===t.kind||'insert'===t.kind){const{error:r,status:o}=await n.upsert(t.values??{},{onConflict:t.conflictKey??'id',ignoreDuplicates:'insert'===t.kind});if(r&&'stock_events'===t.table&&'23503'===r.code&&/undoes/i.test(String(r.message??''))&&t.values?.undoes){t.values={...t.values,undoes:null};const r=await n.upsert(t.values,{onConflict:t.conflictKey??'id',ignoreDuplicates:'insert'===t.kind});return r.error&&s(r.error,r.status),'ok'}return r&&s(r,o),'ok'}let r='update'===t.kind?n.update(t.values??{}):n.delete();for(const[s,n]of Object.entries(t.match??{}))r=r.eq(s,n);const{data:o,error:c,status:l}=await r.select();c&&s(c,l);return'update'!==t.kind||o&&0!==o.length?'ok':'conflict'};var t=_r(d[0]),s=_r(d[1]),n=_r(d[2]),r=_r(d[3]),o=_r(d[4]);const u=()=>(0,n.getSupabase)();class c{constructor(t,s={}){this.table=t,this.opts=s,this.keyOf=s.keyOf??(t=>String(t.id)),this.keyColumns=s.keyColumns??['id'],this.venueCol=s.venueColumn??'venue_id'}rows(t){return s.cache.rows(this.table,t)}get(t,n){return s.cache.get(this.table,t,n)}subscribe(t,n){return s.cache.subscribe(this.table,t,n)}hydrate(t){return s.cache.hydrate(this.table,t)}async refresh(n,r={}){const c=()=>{let t=u().from(this.table).select('*').eq(this.venueCol,n);return this.opts.orderBy&&(t=t.order(this.opts.orderBy.column,{ascending:this.opts.orderBy.ascending??!0})),r.filter&&(t=r.filter(t)),t},l='bookings'===this.table?await(0,t.readPages)(async(t,s)=>{const{data:n,error:r}=await c().order('id').range(t,s);if(r)throw r;return n??[]}):await(async()=>{const{data:t,error:s}=await c().limit(this.opts.limit??1e3);if(s)throw s;return t??[]})();return s.cache.replace(this.table,n,l.map(t=>[this.keyOf(t),t]),t=>o.mutationQueue.hasPending(this.table,n,t)),l}async create(t,n){const u={...1===this.keyColumns.length&&'id'===this.keyColumns[0]?{id:(0,r.uuid)()}:{},...n,[this.venueCol]:t},c=this.keyOf(u);return s.cache.put(this.table,t,c,u),await o.mutationQueue.enqueue({table:this.table,venueId:t,kind:'insert'===this.opts.writeMode?'insert':'upsert',rowKey:c,values:u,conflictKey:this.opts.conflictKey??'id'}),u}async update(t,n,r,u={}){const c=s.cache.get(this.table,t,n),l={...this.matchFor(n,c),...u,[this.venueCol]:t};s.cache.patch(this.table,t,n,{...r,updated_at:(new Date).toISOString()}),await o.mutationQueue.enqueue({table:this.table,venueId:t,kind:'update',rowKey:n,values:r,match:l})}async remove(t,n){const r=s.cache.get(this.table,t,n),u={...this.matchFor(n,r),[this.venueCol]:t};s.cache.remove(this.table,t,n),await o.mutationQueue.enqueue({table:this.table,venueId:t,kind:'delete',rowKey:n,match:u})}matchFor(t,s){if(1===this.keyColumns.length&&'id'===this.keyColumns[0])return{id:t};const n={};for(const t of this.keyColumns)n[t]=s?.[t];return n}}},980,[981,982,892,936,977]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.readPages=async function(t,n=1e3){const s=[];for(let c=0;;c+=n){const o=await t(c,c+n-1);if(s.push(...o),o.length`cache:${t}:${n}`;function f(t){let s=n.get(t);return s||(s=new Map,n.set(t,s)),s}function p(n){s.delete(n),c.get(n)?.forEach(t=>t());const u=o.get(n);u&&clearTimeout(u),o.set(n,setTimeout(()=>{o.delete(n),t.kv.set(n,Array.from(f(n).entries()))},250))}const w={async hydrate(n,s){const c=l(n,s);if(u.has(c))return;u.add(c);const o=await t.kv.get(c,[]),w=f(c);let h=0;for(const[t,n]of o)w.has(t)||(w.set(t,n),h++);h&&p(c)},rows(t,n){const c=l(t,n);let o=s.get(c);return o||(o=Array.from(f(c).values()),s.set(c,o)),o},get:(t,n,s)=>f(l(t,n)).get(s),put(t,n,s,c){f(l(t,n)).set(s,c),p(l(t,n))},patch(t,n,s,c){const o=f(l(t,n)),u=o.get(s);u&&(o.set(s,{...u,...c}),p(l(t,n)))},remove(t,n,s){f(l(t,n)).delete(s)&&p(l(t,n))},replace(t,s,c,o=()=>!1){const u=l(t,s),w=f(u),h=new Map(c);w.forEach((t,n)=>{o(n)&&h.set(n,t)}),n.set(u,h),p(u)},subscribe(t,n,s){const o=l(t,n);let u=c.get(o);return u||(u=new Set,c.set(o,u)),u.add(s),()=>{u?.delete(s)}},async clearVenue(o,f){for(const p of f){const f=l(p,o);n.delete(f),s.delete(f),u.delete(f),await t.kv.remove(f),c.get(f)?.forEach(t=>t())}}}},982,[936]); @@ -1174,7 +1174,7 @@ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{v __d(function(g,_r,i,a,_m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.guardBookingChange=w,_e.saveTablesReported=async function(e,t,n,o,s,u){if(!w(u,{b:t,tables:n}))return!1;const v=n.length?(0,h.notSavedWhat)({...t,name:o,table:n.join('+')}):`Taking the table off ${o}`;u(`Saving ${v}\u2026`);try{await(0,b.saveBookingTables)(e,t,n)}catch(e){const t=`${v} did not save: ${String(e?.message??e).slice(0,120)}`;return u(t),(0,l.announce)(t),!1}const y=await(0,c.waitForBookingSave)(t.id);if('saved'===y.state||'local'===y.state){const e=(0,r.savedWords)(o,t.partySize,n,s);return u(e),(0,l.announce)(e),!0}const k='waiting'===y.state?`${v}: not saved yet. It saves by itself when the connection is back; a red banner shows if it fails.`:`${v} did not save. ${f("why"in y?y.why:"the shared system did not take it")}. Tap the red banner to try again.`;return u(k),(0,l.announce)(k),!1},_e.reportBookingSave=async function(e,t,n,o){const s=await(0,c.waitForBookingSave)(e);if('saved'===s.state||'local'===s.state)return o(t),(0,l.announce)(t),!0;const r='waiting'===s.state?`${n}: not saved yet. It saves by itself when the connection is back; a red banner shows if it fails.`:`${n} did not save. ${f('why'in s?s.why:'the shared system did not take it')}. Tap the red banner to try again.`;return o(r),(0,l.announce)(r),!1},_e.BookingSaveBanner=function({rid:e,testID:r="booking-save-banner",margin:c}){const b=(0,h.useBookingSaves)(e=>e.notSaved),w=(0,s.useBookings)(e).filter(e=>b[e.id]).map(e=>void 0!==b[e.id].want?{...e,table:b[e.id].want||void 0}:e),{msg:S,retry:$}=k(),m=(0,t.useRef)(''),p=w.map(e=>(0,h.notSavedLine)(e)),B=w.map(e=>e.id).sort().join(',');if((0,t.useEffect)(()=>{B&&B!==m.current&&(0,l.announce)(1===w.length?p[0]:`${w.length} booking changes did not save. Tap the red banner to try again.`),m.current=B},[B]),!w.length)return null;const j=1===w.length?p[0]:`${w.length} booking changes did not save. Tap to try again.`;return(0,y.jsx)(n.default,{testID:r,accessibilityRole:"button",accessibilityLiveRegion:"assertive",accessibilityLabel:`${j}${w.length>1?` ${w.map(e=>(0,h.notSavedWhat)(e)).join('. ')}.`:''} ${f(b[w[0].id].why)}.`,onPress:$,style:{...c??{},alignSelf:'stretch',gap:4,padding:12,borderRadius:12,borderWidth:2,borderColor:u.colours.red,backgroundColor:'#3a1210',alignItems:'center'},children:(0,y.jsxs)(o.default,{accessibilityRole:"alert",style:{alignItems:'center',gap:4},children:[(0,y.jsx)(v.T,{testID:`${r}-title`,size:17,weight:"semibold",center:!0,colour:"#FFD2CC",children:j}),w.length>1?w.slice(0,6).map(e=>(0,y.jsx)(v.T,{testID:`${r}-line`,size:15,center:!0,colour:"#FFD2CC",children:(0,h.notSavedWhat)(e)},e.id)):null,(0,y.jsx)(v.T,{testID:`${r}-why`,size:14,center:!0,colour:"#FFB3AA",children:w.length>1?`${f(b[w[0].id].why)}${w.length>6?` \xb7 and ${w.length-6} more`:''}`:f(b[w[0].id].why)}),S?(0,y.jsx)(v.T,{testID:`${r}-msg`,size:14,center:!0,colour:u.colours.goldLight,children:S}):null]})})},_e.BookingNotSavedLine=function({b:e}){const t=(0,h.useBookingSaves)(t=>t.notSaved[e.id]),{msg:o,retry:s}=k();if(!t)return null;void 0!==t.want&&(e={...e,table:t.want||void 0});return(0,y.jsxs)(n.default,{testID:`booking-not-saved-${e.id}`,accessibilityRole:"button",accessibilityLiveRegion:"assertive",accessibilityLabel:`${(0,h.notSavedLine)(e)} ${f(t.why)}.`,onPress:s,style:{alignSelf:'stretch',padding:8,borderRadius:10,borderWidth:1.5,borderColor:u.colours.red,backgroundColor:'#3a1210',alignItems:'center'},children:[(0,y.jsx)(v.T,{size:15,weight:"semibold",center:!0,colour:"#FFD2CC",children:(0,h.notSavedLine)(e)}),o?(0,y.jsx)(v.T,{size:13,center:!0,colour:u.colours.goldLight,children:o}):null]})};var t=_r(d[0]),n=e(_r(d[1])),o=e(_r(d[2])),s=_r(d[3]),r=_r(d[4]),l=_r(d[5]),c=_r(d[6]),h=_r(d[7]),u=_r(d[8]),b=_r(d[9]),v=_r(d[10]),y=_r(d[11]);const f=e=>e.charAt(0).toUpperCase()+e.slice(1);function w(e,t){const n=(0,c.bookingSaveBlocker)();if(!n)return!0;t&&h.useBookingSaves.getState().mark({id:t.b.id,table:t.b.walkIn?'walk_ins':'bookings',why:n,...t.tables?{want:t.tables.join('+')}:{}});const o=`${t?(0,h.notSavedWhat)({...t.b,...t.tables?{table:t.tables.join('+')||void 0}:{}}):'This change'} did not save: ${n}.`;return e?.(o),(0,l.announce)(o),!1}function k(){const[e,n]=(0,t.useState)('');return{msg:e,retry:async()=>{n('Saving\u2026'),(0,l.announce)('Saving');const e=await(0,c.saveBookingsNow)(!0),t=e?`Not saved: ${e}.`:h.useBookingSaves.getState().count()?'Sent again. The banner clears when the shared system takes it.':'Nothing is left waiting. Check the plan and make the change again if it is not there.';n(t),(0,l.announce)(t)}}}},1091,[17,385,85,858,1092,1093,946,984,804,1089,777,8]); __d(function(_g,r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"byNum",{enumerable:!0,get:function(){return s}}),e.tableKey=o,e.toggleTable=function(t,n){return t.includes(n)?t.filter(t=>t!==n):a(o([...t,n]))},e.seatsOf=function(t,n){const a={};for(const s of n)a[s]=t.tables.find(t=>t.name===s)?.maxSeats??0;return{per:a,total:Object.values(a).reduce((t,n)=>t+n,0)}},e.seatLine=function(t,n){const a=Math.max(0,n-t);return{text:`${t} ${1===t?'seat':'seats'} for ${l(n)}${a?`: ${a} short`:''}`,short:a,fits:0===a&&t>0}},e.pickClashes=u,e.requestedFreeTable=function(t,n,a,s,l=90){const o={id:n.id??'new',status:'confirmed',...n};for(const n of t)if(a.includes(n)&&!u(o,[n],s,l).length)return n;return null},e.overCapacityAsk=function(n,s,l){const u=a(o(n));if(!u.length||s>=l)return null;const c=u.map(n=>(0,t.tableNumbers)(n));return`${1===c.length?`Table ${c[0]} seats`:`Tables ${c.slice(0,-1).join(', ')} and ${c[c.length-1]} seat`} ${s} \u2013 this booking is ${l}. Use it anyway?`},e.clashWords=function(n){return n.map(n=>`${(0,t.tableNumbers)(n.table)} has ${n.with.walkIn?'a walk-in':(n.with.name||'a booking').replace(' (example)','')} at ${n.with.time}`).join('. ')+(n.length?'.':'')},e.tablesWords=c,e.pickA11y=function(n,a,s,l){return`Table ${(0,t.tableNumbers)(n)}, ${a} ${1===a?'seat':'seats'}${s?', selected':''}${l?`, has ${l.walkIn?'a walk-in':l.name} at ${l.time}`:''}`},e.pickGroups=function(t){return t.areas.map(n=>({area:n.name,tables:t.tables.filter(t=>t.areaId===n.id).map(t=>({name:t.name,seats:t.maxSeats})).sort((t,n)=>s(t.name,n.name))})).filter(t=>t.tables.length)},e.savedWords=function(t,n,a,s){return a.length?`${t}, ${l(n)}: ${c(a)} (${s} seats).`:`${t}: table taken off.`},e.tableActions=function(t,n){const s=a(t.table);if(['cancelled','noshow'].includes(t.status))return[];const o=[s.length?{id:'assign',label:'Change table',a11y:`Change table for ${n}, ${l(t.partySize)}, now ${c(s).toLowerCase()}. You can pick several tables to join.`}:{id:'assign',label:'Assign table',a11y:`Assign table for ${n}, ${l(t.partySize)}. You can pick several tables to join.`}];s.length&&o.push({id:'clear',label:'Clear table',a11y:`Clear table for ${n}, take ${c(s).toLowerCase()} off this booking`});return o},e.dragTables=function(t,n,s){if(!s||'__none'===s||s===n)return null;const l=a(t);if(l.includes(s))return null;return o('__none'!==n&&l.includes(n)?l.map(t=>t===n?s:t):[s])};var t=r(d[0]),n=r(d[1]);const a=t=>t?t.split('+').map(t=>t.trim()).filter(Boolean):[],s=(t,n)=>t.localeCompare(n,'en-GB',{numeric:!0}),l=t=>`${t} ${1===t?'person':'people'}`;function o(t){return[...new Set(t.map(t=>String(t).trim()).filter(Boolean))].sort(s).join('+')}function u(t,l,u,c=90){if(!l.length)return[];const f={...t,table:o(l)},b=[];for(const s of u)if(s.id!==t.id&&s.date===t.date&&!['cancelled','noshow','finished'].includes(s.status)&&(0,n.startOf)(f)<(0,n.endOf)(s,c)&&(0,n.startOf)(s)<(0,n.endOf)(f,c))for(const t of a(s.table))l.includes(t)&&b.push({table:t,with:s});return b.sort((t,n)=>s(t.table,n.table))}function c(n){const s=a(o(n));return s.length?(0,t.tableListNumbers)(s):'No table'}},1092,[843,1074]); __d(function(g,r,i,a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.primeAnnouncer=function(){u()},_e.announce=function(t){const e=String(t??'').trim();if(!e)return;{const t=u();if(!t)return;const n=++o;return t.textContent='',void setTimeout(()=>{n===o&&(t.textContent=e)},80)}},Object.defineProperty(_e,"lastAnnounced",{enumerable:!0,get:function(){return c}});var t,e=r(d[0]);(t=e)&&t.__esModule;r(d[1]);let n=null,o=0;function u(){if('undefined'==typeof document||!document.body)return null;if(n&&document.body.contains(n))return n;const t=document.createElement('div');return t.id='cc-announcer',t.setAttribute('aria-live','assertive'),t.setAttribute('aria-atomic','true'),t.setAttribute('role','status'),t.setAttribute('data-testid','cc-announcer'),Object.assign(t.style,{position:'absolute',width:'1px',height:'1px',margin:'-1px',padding:'0',overflow:'hidden',clip:'rect(0 0 0 0)',whiteSpace:'nowrap',border:'0'}),document.body.appendChild(t),n=t,t}const c=()=>n?.textContent??''},1093,[264,219]); -__d(function(g,_r,_i,_a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"TABLES",{enumerable:!0,get:function(){return A}}),_e.useTableNames=R,_e.resetTableLive=W,_e.seatBookingNow=async function(e,t){await k.repo.bookings.setStatus(t.id,'seated'),W(e,t.table)},_e.finishBookingNow=async function(e,t){const s=(new Date).toISOString();await k.repo.bookings.update(t.id,(0,N.finishClearPatch)(s,t.table)),(0,v.tablesOf)(t.table).forEach(t=>v.useFloor.getState().setLive(e,t,{stage:void 0,dirty:!0}))},_e.useTableUse=E,Object.defineProperty(_e,"walkInLabel",{enumerable:!0,get:function(){return _}}),_e.TablePicker=H,_e.WalkInSheet=q,_e.AssignTableSheet=V,_e.undoNotice=Y,_e.NewBookingSheet=G,_e.useFrontDoor=function(e,t){const[s,o]=(0,c.useState)(!1),[l,a]=(0,c.useState)(!1),[i,n]=(0,c.useState)(null);return{openWalkIn:()=>o({}),openWalkInAt:e=>o({table:e}),openBooking:()=>a(!0),assignTable:e=>n({b:e}),combineTables:e=>n({b:e,combine:!0}),elements:(0,F.jsxs)(F.Fragment,{children:[s?(0,F.jsx)(q,{wide:t,initialTable:s.table,onClose:()=>o(!1),onSeated:Y}):null,l?(0,F.jsx)(G,{wide:t,date:e,onClose:()=>a(!1),onSaved:e=>(0,u.notify)({id:`booked:${Date.now()}`,testID:'booking-saved-toast',timeoutMs:5e3,icon:'\u2713',title:`Booked: ${e.name} \xb7 ${(0,w.niceDate)((0,w.parseYmd)(e.date))} at ${e.time}`})}):null,i?(0,F.jsx)(V,{booking:i.b,combine:i.combine,onClose:()=>n(null)}):null]})}};var t=_r(_d[0]),s=_r(_d[1]),o=_r(_d[2]),l=_r(_d[3]),a=_r(_d[4]),i=_r(_d[5]),n=_r(_d[6]),r=_r(_d[7]),d=_r(_d[8]),u=_r(_d[9]),c=_r(_d[10]),b=e(c),h=_r(_d[11]),p=e(_r(_d[12])),m=e(_r(_d[13])),f=_r(_d[14]),y=_r(_d[15]),k=_r(_d[16]),x=_r(_d[17]),j=_r(_d[18]),w=_r(_d[19]),S=_r(_d[20]),T=_r(_d[21]),C=_r(_d[22]),v=_r(_d[23]),D=_r(_d[24]),I=_r(_d[25]),$=_r(_d[26]),P=_r(_d[27]),O=_r(_d[28]),B=_r(_d[29]),z=_r(_d[30]),M=_r(_d[31]),N=_r(_d[32]),F=_r(_d[33]);const L=e=>(0,u.notify)({id:'booking-blocked',testID:'booking-blocked-toast',timeoutMs:9e3,icon:'\u26a0',title:e}),A=Array.from({length:12},(e,t)=>String(t+1));function R(e){const t=(0,v.usePlan)(e);return t.areas.flatMap(e=>t.tables.filter(t=>t.areaId===e.id).map(e=>e.name))}function W(e,t){(0,v.tablesOf)(t).forEach(t=>v.useFloor.getState().setLive(e,t,{stage:'seated',dirty:!1}))}function E(e,t){const s=(0,k.useBookings)(e),o=(0,k.useOrders)(e),l=R(e),a=(0,v.useFloor)(t=>t.live[e])??{},i=(0,v.usePlan)(e),n=(0,D.useBlocks)(e=>e.blocks),r=(0,w.ymd)(t),d=(0,D.closedAreasAt)(n,e,r,(0,w.hm)(t)),u={};for(const e of l)u[e]=a[e]?.blocked||d.has(`tbl:${e}`)?{busy:!0,label:'Blocked'}:d.has(i.tables.find(t=>t.name===e)?.areaId??'')?{busy:!0,label:'Closed'}:a[e]?.dirty?{busy:!0,label:'Needs clearing'}:{busy:!1,label:'Free'};for(const e of s)if(e.date===r&&e.table)for(const s of(0,v.tablesOf)(e.table))if(u[s])if('seated'===e.status)u[s]={busy:!0,label:`${e.walkIn?'Walk-in':`${e.name.slice(0,1)}.`} \xb7 ${e.partySize}`};else if('confirmed'===e.status&&!u[s].busy){const o=(0,w.minsBetween)(t,new Date(`${e.date}T${e.time}:00`));o>=-15&&o<=90&&(u[s]={...u[s],soon:`Booked ${e.time}`})}for(const e of o)'table'===e.type&&e.tableNo&&u[e.tableNo]&&!['closed','cancelled','collected'].includes(e.status)&&!u[e.tableNo].busy&&(u[e.tableNo]={busy:!0,label:'Open order'});return u}const _=e=>e.walkIn?`Walk-in \xb7 ${e.partySize}`:`${e.name} \xb7 ${e.partySize}`;function H({use:e,value:t,onPick:s,big:o,best:a,dense:i,bestSet:n,picked:r}){const d=Object.keys(e),[u,b]=(0,c.useState)(0),h=i?6:8,f=i?64:o?92:76,y=u?Math.max(3,Math.floor((u+h)/(f+h))):0,k=y?Math.floor((u-h*(y-1))/y):f,x=new Set(n??[]),j=a?(0,v.tablesOf)(a)[0]:null;return(0,F.jsx)(m.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:h},testID:"table-picker",onLayout:e=>b(Math.floor(e.nativeEvent.layout.width)),children:d.map(o=>{const a=e[o],n=t===o||!!r?.includes(o),d=x.has(o),u=j===o&&!n,c=a.busy?['Blocked','Needs clearing','Closed'].includes(a.label)?a.label:'In use':a.soon??'Free';return(0,F.jsxs)(p.default,{accessibilityRole:"button",testID:`pick-table-${o}`,accessibilityLabel:`Table ${(0,l.tableNumbers)(o)}${r?n?', picked':', not picked':''}, ${a.busy?`in use (${a.label})`:a.soon?`free, ${a.soon}`:'free'}${d?', best table':''}${u?', suggested for this party':''}`,accessibilityState:{selected:n,disabled:'Closed'===a.label},disabled:'Closed'===a.label,onPress:()=>s(o),style:{width:k,minHeight:i?58:64,borderRadius:12,borderWidth:n||u?2.5:1.5,paddingVertical:i?3:6,paddingHorizontal:4,alignItems:'center',justifyContent:'center',gap:2,borderColor:n||u?S.colours.gold:a.busy?S.colours.red:S.colours.ok,backgroundColor:n?S.colours.goldTint:a.busy?S.colours.redBg:S.colours.surface2,opacity:'Closed'!==a.label||n?1:.55},children:[(0,F.jsxs)(m.default,{style:{flexDirection:'row',alignItems:'center',gap:4},children:[(0,F.jsx)(C.T,{weight:"bold",size:22,colour:n?S.colours.goldLight:S.colours.text,children:(0,l.tableNumbers)(o)}),d?(0,F.jsx)(m.default,{testID:"best-table",style:{backgroundColor:S.colours.gold,borderRadius:5,paddingHorizontal:4,paddingVertical:1},children:(0,F.jsx)(C.T,{size:11,weight:"bold",colour:S.colours.onGold,children:"BEST"})}):null]}),(0,F.jsx)(C.T,{size:i?13:14,colour:a.busy?'#FFD9D4':a.soon?'#FFE2A8':'#E2C489',center:!0,numberOfLines:1,children:c})]},o)})})}const U=[1,2,3,4,5,6,7,8];function q({onClose:e,onSeated:a,wide:i,initialTable:n}){const{rid:r,r:d,now:u}=(0,y.useCtx)(15e3),x=E(r,u),[T,I]=(0,c.useState)(2),[$,P]=(0,c.useState)(!1),[O,B]=(0,c.useState)(n??null),z=(0,v.usePlan)(r),N=(0,k.useBookings)(r),A=(0,D.useBlocks)(e=>e.blocks),R=(0,D.closedAreasAt)(A,r,(0,w.ymd)(u),(0,w.hm)(u)),_=b.default.useMemo(()=>{const e=Object.fromEntries(Object.entries(x).map(([e,t])=>[e,{status:t.busy?'seated':'free'}]));return(0,j.suggestTable)(z,N.filter(e=>e.date===(0,w.ymd)(u)),e,T,u,(0,j.turnFor)(T,d.settings.turnMins),90,void 0,{closed:R})?.table??null},[z,N,x,T,R.size,u.getTime()]);(0,c.useEffect)(()=>{O&&(0,v.tablesOf)(O).some(e=>'Closed'===x[e]?.label)&&B(null)},[O,R.size]);const[q,V]=(0,c.useState)(!1),[Y,G]=(0,c.useState)(''),K=(e,t=String(e),s=()=>{P(!1),I(e)})=>{const o='9+'===t?$:!$&&T===e;return(0,F.jsx)(p.default,{accessibilityRole:"button",accessibilityLabel:'9+'===t?'Party of 9 or more':`Party of ${e}`,accessibilityState:{selected:o},onPress:s,style:{width:i?58:60,height:i?58:56,borderRadius:14,borderWidth:2,borderColor:S.colours.gold,alignItems:'center',justifyContent:'center',backgroundColor:o?S.colours.gold:'transparent'},children:(0,F.jsx)(C.T,{weight:"bold",size:22,colour:o?S.colours.onGold:S.colours.gold,children:t})},t)},Q=(0,F.jsx)(s.PartySizeInput,{value:T,onChange:I,min:9,max:o.MAX_PARTY,label:"Walk-in party size",testID:"walkin-party-size"}),X=(0,F.jsxs)(m.default,{style:{gap:8,width:i?256:void 0},children:[(0,F.jsx)(C.T,{weight:"semibold",children:"How many people?"}),(0,F.jsxs)(m.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:8},testID:"walkin-party",children:[U.map(e=>K(e)),K(9,'9+',()=>{P(!0),I(e=>e>=9?e:9)})]}),$?Q:null]}),[J,Z]=(0,c.useState)(!1),ee=async(t=O)=>{if(!J&&(0,M.guardBookingChange)(L)){Z(!0);try{const s=await k.repo.bookings.seatWalkIn(r,T,t??void 0,Y);W(r,t??void 0),a(s),e()}finally{Z(!1)}}},te=(0,F.jsxs)(m.default,{style:{gap:8,flex:i?1:void 0,minWidth:0},children:[(0,F.jsxs)(C.Row,{style:{justifyContent:'space-between'},children:[(0,F.jsxs)(C.T,{weight:"semibold",children:["Table ",(0,F.jsx)(C.T,{colour:S.colours.muted,size:14,children:"(optional)"})]}),O?(0,F.jsx)(C.Button,{small:!0,kind:"ghost",label:"Clear table",onPress:()=>B(null)}):null]}),(0,F.jsx)(H,{use:x,value:O,onPick:e=>{x[e]&&!x[e].busy?ee(e):B(O===e?null:e)},big:i,dense:i,best:_,bestSet:(0,h.bestTables)(z)}),(0,F.jsxs)(C.Muted,{children:["Tap a free table to seat them there",_&&!O?` (suggested for ${T}: ${(0,l.tableNumbers)(_)})`:'',", or Seat for no table yet. BEST marks the venue\u2019s best tables."]})]});return(0,F.jsxs)(C.Sheet,{visible:!0,onClose:e,title:`Walk-in \xb7 ${(0,w.hm)(u)}`,maxWidth:i?1100:void 0,testID:"walkin-sheet",children:[(0,F.jsx)(C.Button,{label:`Seat walk-in \xb7 ${T} ${1===T?'person':'people'}${O?` \xb7 ${(0,l.tableNumbers)(O)}`:''}`,disabled:J,onPress:()=>{ee()},testID:"seat-walkin",style:{minHeight:52}}),i?(0,F.jsxs)(C.Row,{gap:16,style:{alignItems:'flex-start'},children:[X,te]}):(0,F.jsxs)(F.Fragment,{children:[X,te]}),(0,F.jsxs)(C.Row,{gap:10,wrap:!0,style:{alignItems:'center'},children:[q?(0,F.jsx)(t.TextInput,{accessibilityLabel:"Walk-in note",placeholder:"Note (optional), e.g. high chair",placeholderTextColor:"#7D776C",value:Y,onChangeText:G,style:[C.styles.input,{flex:1,minWidth:220}],autoFocus:!0}):(0,F.jsx)(C.Button,{small:!0,kind:"ghost",label:"Add a note (optional)",onPress:()=>V(!0)}),(0,F.jsx)(m.default,{style:{flex:1,minWidth:220},children:(0,F.jsxs)(C.Muted,{children:["No name needed. Counts in today's covers.",'staff'!==f.APP_VARIANT?' Using website bookings too? Mark the table there as well.':'']})})]})]})}function V({booking:e,onClose:t,combine:s}){const{rid:o,r:a,now:i}=(0,y.useCtx)(15e3),n=E(o,i),r=(0,v.usePlan)(o),d=(0,k.useBookings)(o),u=(0,v.tablesOf)(e.table),p=b.default.useMemo(()=>Object.fromEntries(Object.entries(n).map(([e,t])=>[e,u.includes(e)?{busy:!1,label:'This party',soon:'This party'}:t])),[n,e.table]),f=b.default.useMemo(()=>{const t=Object.fromEntries(Object.entries(p).map(([e,t])=>[e,{status:t.busy?'seated':'free'}]));return(0,j.suggestTable)(r,d.filter(e=>e.date===(0,w.ymd)(i)),t,e.partySize,i,(0,j.turnFor)(e.partySize,a.settings.turnMins),90,e.id)?.table??null},[r,d,p,e.partySize,i.getTime()]),[x,T]=(0,c.useState)(!!s||u.length>1),[D,I]=(0,c.useState)(u),$=e=>r.tables.find(t=>t.name===e)?.maxSeats??0,P=D.reduce((e,t)=>e+$(t),0),O=D.length>0&&P{if(!(0,M.guardBookingChange)(L))return;const l=(0,v.joinTables)(s);await k.repo.bookings.assignTable(e.id,l);u.filter(e=>!s.includes(e)).forEach(t=>v.useFloor.getState().setLive(o,t,{stage:void 0,dirty:'seated'===e.status})),'seated'===e.status&&W(o,l),t()},z=x?(0,F.jsxs)(m.default,{style:{gap:8},testID:"assign-table-tip",children:[(0,F.jsx)(m.default,{accessibilityLiveRegion:"polite",children:(0,F.jsx)(C.T,{size:17,weight:"semibold",colour:S.colours.text,children:D.length?`${(0,v.tablesLabel)((0,v.joinTables)(D))} \xb7 ${P} seats for ${e.partySize} Covers`:'No tables picked yet'})}),O?(0,F.jsx)(m.default,{testID:"combine-short",children:(0,F.jsxs)(C.T,{size:15,weight:"semibold",colour:"#FFD9D4",children:["Not enough seats yet: ",e.partySize-P," more needed. Add another table."]})}):null,(0,F.jsx)(C.T,{size:15,colour:S.colours.text,children:"Tap each table to add or remove it, then tap Done. All of them show as taken until the party has finished."}),(0,F.jsxs)(C.Row,{gap:8,wrap:!0,children:[(0,F.jsx)(C.Button,{label:"Done",testID:"combine-done",disabled:!D.length,accessibilityLabel:D.length?`Done, save ${(0,v.tableCardLabel)((0,v.joinTables)(D))}`:'Done',onPress:()=>B(D)}),(0,F.jsx)(C.Button,{kind:"ghost",label:"Cancel",onPress:t})]})]}):(0,F.jsx)(m.default,{style:{gap:8},testID:"assign-table-tip",children:(0,F.jsx)(C.T,{size:15,colour:S.colours.text,children:"Red tables are in use right now; you can still pick one (e.g. joining a table). BEST marks the venue\u2019s best tables. Big party? Tap Combine tables."})});return(0,F.jsxs)(C.Sheet,{visible:!0,onClose:t,title:`${x?'Combine tables':'Assign table'} \xb7 ${_(e)}`,testID:"assign-table-sheet",footer:z,children:[f&&!x?(0,F.jsx)(m.default,{testID:"assign-suggested",children:(0,F.jsxs)(C.T,{size:16,weight:"semibold",colour:S.colours.goldLight,accessibilityLabel:`Suggested for ${e.partySize}: ${(0,v.tableCardLabel)(f)}`,children:["Suggested for ",e.partySize,": ",(0,l.tableNumbers)(f)]})}):null,x?null:(0,F.jsx)(C.Button,{kind:"secondary",label:"Combine tables",testID:"combine-start",accessibilityLabel:"Combine tables: pick several tables for this party",onPress:()=>T(!0)}),(0,F.jsx)(H,{use:p,best:x?null:f,bestSet:(0,h.bestTables)(r),picked:x?D:void 0,onPick:x?e=>I(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]):async e=>{await B([e])}})]})}function Y(e){(0,u.notify)({id:`walkin:${e.id}`,testID:'walkin-toast',timeoutMs:6e3,title:`${_(e)} seated \xb7 ${e.table?`${(0,l.tableNumbers)(e.table)}`:'table to assign'} (${e.ref})`,actions:[{label:'Undo',testID:'undo-walkin',onPress:()=>k.repo.bookings.undoWalkIn(e.id)},{label:'OK',kind:'ghost'}]})}function G({date:e,onClose:t,wide:s,onSaved:u}){const{rid:b,r:h,now:p,role:f,meId:N}=(0,y.useCtx)(6e4);(0,d.useBlurOutside)();const A=(0,w.ymd)(p),[R,W]=(0,c.useState)(ee.blocks),[H,U]=(0,c.useState)(!1),[q,V]=(0,c.useState)(''),[Y,G]=(0,c.useState)(2),[K,Q]=(0,c.useState)(0),X=Math.min(K,Math.max(0,Y-1)),[J,Z]=(0,c.useState)(null),[ee,te]=(0,c.useState)(''),[se,oe]=(0,c.useState)(''),[le,ae]=(0,c.useState)(''),[ie,ne]=(0,c.useState)('phone'),[re,de]=(0,c.useState)((0,$.emptyNeeds)()),ue=(0,$.needsMissing)(re),[ce,be]=(0,c.useState)(null),ge=(0,v.usePlan)(b),he=(0,B.dogSetUp)(ge),pe=!0===re.dog&&he,me=re.dog?re.dogs:0,fe=(0,w.parseYmd)(R),ye=(0,j.turnFor)(Y,h.settings.turnMins),ke=E.filter(e=>e.date===R),xe=e=>(0,j.freeTablesAt)(ge,ke,Y,new Date(`${R}${(0,l.tableNumbers)(e)}:00`),ye,h.settings.turnMins,{dog:!0,closed:(0,D.closedAreasAt)(_,b,R,e)}),je=pe&&J?xe(J):[];(0,c.useEffect)(()=>{be(null)},[pe,J,Y]);const we=(0,x.bookingSlots)(h,fe,e=>E.filter(t=>t.date===R&&t.time===e&&'cancelled'!==t.status&&!t.walkIn).reduce((e,t)=>e+t.partySize,0),Y,R===(0,w.ymd)(p)?p:(0,w.addMins)(fe,0),e=>E.filter(t=>t.date===R&&t.time===e&&'cancelled'!==t.status&&!t.walkIn).length),Se=(0,T.guestPhone)(se),[Te,Ce]=(0,c.useState)(!1),ve=J?we.find(e=>e.time===J):void 0,De=ve&&ve.left=2&&!!J&&(!$e||Te)&&(0,o.validParty)(Y)&&Se.ok&&(0,T.emailOk)(le)&&(!Pe||Oe&&H)&&(!pe||je.length>0)&&!Be,Me=re.wheelchair>0||re.stepFree;return(0,F.jsxs)(C.Sheet,{visible:!0,onClose:t,title:`New booking \xb7 ${(0,w.niceDate)(fe)}`,maxWidth:s?760:void 0,testID:"booking-sheet",children:[(0,F.jsx)($.FirstQuestions,{rid:b,value:re,onChange:de,party:Y,audience:"staff"}),re.dog&&!he?(0,F.jsx)(C.T,{size:13,colour:S.colours.amber,children:"Dog-friendly tables aren\u2019t marked yet. Managers \u203a Booking options \u203a Tables. Booking is allowed; check where the dog can sit."}):null,(0,F.jsx)(I.BookingDatePicker,{r:h,today:p,value:R,onChange:e=>{e!==R&&(W(e),Z(null),U(!1))}}),(0,F.jsxs)(C.Row,{gap:6,children:[(0,F.jsx)(C.Chip,{label:"Phone",selected:'phone'===ie,onPress:()=>ne('phone')}),(0,F.jsx)(C.Chip,{label:"In person",selected:'in-person'===ie,onPress:()=>ne('in-person')})]}),(0,F.jsx)(C.Field,{label:"Name",value:q,onChangeText:V,placeholder:"e.g. Reid",testID:"nb-name"}),(0,F.jsx)(C.Field,{label:"Mobile or phone number (needed)",value:se,onChangeText:oe,keyboardType:"phone-pad",placeholder:"e.g. 07700 900123",testID:"nb-phone"}),!Se.ok&&se?(0,F.jsx)(C.T,{size:13,colour:S.colours.amber,children:Se.error}):null,(0,F.jsx)(C.Field,{label:"Email (optional)",value:le,onChangeText:ae,keyboardType:"email-address",autoCapitalize:"none",placeholder:"For an email confirmation too",testID:"nb-email"}),(0,T.emailOk)(le)?null:(0,F.jsx)(C.T,{size:13,colour:S.colours.amber,children:"That email doesn\u2019t look quite right."}),(0,F.jsx)(n.AdultsChildren,{value:(0,r.peopleOf)(Y,X),onChange:e=>{G(e.partySize),Q(e.children),Ce(!1)},depositsOn:(0,i.depositOf)(h.settings).on&&(0,i.depositOf)(h.settings).perPersonPence>0,testID:"nb-people"}),(0,F.jsx)(C.Row,{wrap:!0,gap:6,children:we.map(e=>{const t=pe&&e.available&&!xe(e.time).length||!(0,$.dogTimeOk)(h,E,R,e.time,me);return(0,F.jsx)(C.Chip,{testID:`nb-slot-${e.time}`,label:e.time,sub:(0,D.blockAt)(_,b,R,e.time)?'Paused':t?'Dogs full':e.drinksOnly?'Drinks only':null!=e.partiesLeft&&e.partiesLeft<1||e.left<=0?'Full':`${e.left} left`,disabled:(e.past??!e.available)||t,selected:J===e.time,onPress:()=>{Z(e.time),U(!1),Ce(!1)}},e.time)})}),$e?(0,F.jsxs)(m.default,{testID:"nb-over-capacity",accessible:!0,accessibilityLiveRegion:"polite",style:{borderWidth:1.5,borderColor:S.colours.amber,backgroundColor:S.colours.amberBg,borderRadius:12,padding:10,gap:6},children:[De?(0,F.jsx)(C.T,{weight:"semibold",colour:S.colours.amber,children:(0,o.overCapacityNote)(Y,De.left,De.time)}):null,Ie?(0,F.jsx)(C.T,{weight:"semibold",colour:S.colours.amber,children:(0,o.overPartiesNote)(Ie.time,Ie.cap)}):null,(0,F.jsx)(C.Chip,{label:Te?'Booking over the limit: on':'Book anyway (over the limit)',selected:Te,onPress:()=>Ce(e=>!e),testID:"nb-over-ok"})]}):null,pe&&J?(0,F.jsxs)(m.default,{style:{gap:6},testID:"nb-dog-tables",children:[(0,F.jsxs)(C.T,{size:14,weight:"semibold",children:["Dog-friendly table ",(0,F.jsxs)(C.T,{size:13,colour:S.colours.muted,children:["(",ge.areas.filter(e=>e.dogs).map(e=>e.name).join(' or '),")"]})]}),je.length?(0,F.jsx)(C.Row,{wrap:!0,gap:6,children:je.slice(0,10).map((e,t)=>(0,F.jsx)(C.Chip,{label:`${(0,l.tableNumbers)(e.table)}`,sub:`${e.area} \xb7 ${e.seats}${0===t?' \xb7 best':''}${Me&&(0,B.accessibleSetUp)(ge)&&!(0,B.isAccessible)(ge,e.table)?' \xb7 not step-free':''}`,selected:(ce??je[0].table)===e.table,onPress:()=>be(e.table)},e.table))}):(0,F.jsxs)(C.T,{size:14,colour:S.colours.amber,children:["No dog-friendly table free for ",Y," at ",J,". Try another time."]})]}):null,Pe?(0,F.jsxs)(m.default,{testID:"nb-block-warning",style:{borderWidth:1.5,borderColor:S.colours.amber,backgroundColor:S.colours.amberBg,borderRadius:12,padding:10,gap:6},children:[(0,F.jsxs)(C.T,{weight:"semibold",colour:S.colours.amber,children:["Bookings are paused ",Pe.from,"\u2013",Pe.to,Pe.reason?` (${Pe.reason})`:'']}),Oe?(0,F.jsx)(C.Chip,{label:H?'Manager override on':'Override and book anyway',selected:H,onPress:()=>U(e=>!e)}):(0,F.jsx)(C.Muted,{children:"Ask a manager to override, or pick another time."})]}):null,we.length?null:(0,F.jsx)(m.default,{testID:"nb-closed",children:(0,F.jsxs)(C.T,{size:14,weight:"semibold",colour:S.colours.amber,children:["Closed on ",(0,w.niceDate)(fe)," (per the venue\u2019s opening hours). Pick another date."]})}),(0,F.jsx)($.MoreQuestions,{rid:b,r:h,value:re,onChange:de,party:Y,date:R,time:J,today:(0,w.ymd)(p),bookings:E,audience:"staff",showTables:!1!==h.settings.tableRequests}),Me&&!(0,B.accessibleSetUp)(ge)?(0,F.jsx)(C.T,{size:13,colour:S.colours.amber,children:"Step-free tables aren\u2019t marked yet (Managers \u203a Booking options \u203a Tables). Check the table works for a wheelchair."}):null,(0,F.jsx)(C.Field,{label:"Notes (optional)",value:ee,onChangeText:te,placeholder:P.NOTES_PLACEHOLDER,multiline:!0,numberOfLines:3,testID:"nb-notes"}),(0,i.depositDue)((0,i.depositOf)(h.settings),Y,X)?(0,F.jsxs)(C.Muted,{testID:"nb-deposit",children:["Deposit due: ",(0,a.gbp)((0,i.depositDue)((0,i.depositOf)(h.settings),Y,X))," (",(0,a.gbp)((0,i.depositOf)(h.settings).perPersonPence)," per adult for ",(0,i.depositOf)(h.settings).fromParty,"+",X?`; ${X} ${1===X?'child':'children'} free`:'; children free',"). Deposits are paid through website bookings or to you, never in CoverCharge: tick Deposit paid on the booking once the guest has paid."]}):null,(0,F.jsxs)(C.Muted,{children:["The guest gets a confirmation text",le.trim()?' and email':''," automatically (preview mode: shown in the Outbox, not sent)."]}),Be?(0,F.jsxs)(C.T,{size:14,colour:S.colours.amber,children:["We already have the most dogs we can look after at ",J,". Try another time: dogs are very welcome then."]}):null,(0,F.jsx)(C.Button,{label:ue.length?ue[0]:'Save booking',testID:"nb-save",disabled:!ze,onPress:()=>{if(R<(0,w.ymd)(p))return;if(!(0,M.guardBookingChange)(L))return;const e=(0,$.needsPatch)(re),s=re.tableReq.find(e=>!pe||je.some(t=>t.table===e)),o=pe?null:(0,z.requestedFreeTable)(re.tableReq,{date:R,time:J,partySize:Y},ge.tables.map(e=>e.name),ke,h.settings.turnMins);k.repo.bookings.create({restaurantId:b,customerId:null,name:q.trim(),partySize:Y,date:R,time:J,notes:ee.trim(),security:(0,i.depositDue)((0,i.depositOf)(h.settings),Y,X)?'deposit':'none',depositPaid:0,...X?{children:X}:{},...(0,i.depositDue)((0,i.depositOf)(h.settings),Y,X)?{depositDue:(0,i.depositDue)((0,i.depositOf)(h.settings),Y,X),depositPolicy:(0,i.depositWords)((0,i.depositOf)(h.settings),Y,h.name,X).join(' '),depositRefundable:(0,i.depositOf)(h.settings).refundable,depositCutoffHours:(0,i.depositOf)(h.settings).cutoffHours}:{},phone:Se.pretty,email:le.trim()||void 0,source:ie,...e,...we.find(e=>e.time===J)?.drinksOnly?{drinksOnly:!0}:{},allergies:e.allergies??[],...pe?{table:ce??s??je[0]?.table}:o?{table:o}:{}}).then(e=>(0,O.postNewBookingToKitchen)(e,N)).catch(()=>{}),u?.({date:R,time:J,name:q.trim()}),t()}})]})}},1094,[812,1095,1096,843,851,841,1097,1098,1099,1100,17,842,385,85,856,1055,858,1101,1074,863,804,848,777,996,993,1102,1103,1108,1076,1053,1092,1091,1109,8]); +__d(function(g,_r,_i,_a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"TABLES",{enumerable:!0,get:function(){return A}}),_e.useTableNames=R,_e.resetTableLive=W,_e.seatBookingNow=async function(e,t){await k.repo.bookings.setStatus(t.id,'seated'),W(e,t.table)},_e.finishBookingNow=async function(e,t){const s=(new Date).toISOString();await k.repo.bookings.update(t.id,(0,N.finishClearPatch)(s,t.table)),(0,v.tablesOf)(t.table).forEach(t=>v.useFloor.getState().setLive(e,t,{stage:void 0,dirty:!0}))},_e.useTableUse=E,Object.defineProperty(_e,"walkInLabel",{enumerable:!0,get:function(){return _}}),_e.TablePicker=H,_e.WalkInSheet=q,_e.AssignTableSheet=V,_e.undoNotice=Y,_e.NewBookingSheet=G,_e.useFrontDoor=function(e,t){const[s,o]=(0,c.useState)(!1),[l,a]=(0,c.useState)(!1),[i,n]=(0,c.useState)(null);return{openWalkIn:()=>o({}),openWalkInAt:e=>o({table:e}),openBooking:()=>a(!0),assignTable:e=>n({b:e}),combineTables:e=>n({b:e,combine:!0}),elements:(0,F.jsxs)(F.Fragment,{children:[s?(0,F.jsx)(q,{wide:t,initialTable:s.table,onClose:()=>o(!1),onSeated:Y}):null,l?(0,F.jsx)(G,{wide:t,date:e,onClose:()=>a(!1),onSaved:e=>(0,u.notify)({id:`booked:${Date.now()}`,testID:'booking-saved-toast',timeoutMs:5e3,icon:'\u2713',title:`Booked: ${e.name} \xb7 ${(0,w.niceDate)((0,w.parseYmd)(e.date))} at ${e.time}`})}):null,i?(0,F.jsx)(V,{booking:i.b,combine:i.combine,onClose:()=>n(null)}):null]})}};var t=_r(_d[0]),s=_r(_d[1]),o=_r(_d[2]),l=_r(_d[3]),a=_r(_d[4]),i=_r(_d[5]),n=_r(_d[6]),r=_r(_d[7]),d=_r(_d[8]),u=_r(_d[9]),c=_r(_d[10]),b=e(c),h=_r(_d[11]),p=e(_r(_d[12])),m=e(_r(_d[13])),f=_r(_d[14]),y=_r(_d[15]),k=_r(_d[16]),x=_r(_d[17]),j=_r(_d[18]),w=_r(_d[19]),S=_r(_d[20]),T=_r(_d[21]),C=_r(_d[22]),v=_r(_d[23]),D=_r(_d[24]),I=_r(_d[25]),$=_r(_d[26]),P=_r(_d[27]),O=_r(_d[28]),B=_r(_d[29]),z=_r(_d[30]),M=_r(_d[31]),N=_r(_d[32]),F=_r(_d[33]);const L=e=>(0,u.notify)({id:'booking-blocked',testID:'booking-blocked-toast',timeoutMs:9e3,icon:'\u26a0',title:e}),A=Array.from({length:12},(e,t)=>String(t+1));function R(e){const t=(0,v.usePlan)(e);return t.areas.flatMap(e=>t.tables.filter(t=>t.areaId===e.id).map(e=>e.name))}function W(e,t){(0,v.tablesOf)(t).forEach(t=>v.useFloor.getState().setLive(e,t,{stage:'seated',dirty:!1}))}function E(e,t){const s=(0,k.useBookings)(e),o=(0,k.useOrders)(e),l=R(e),a=(0,v.useFloor)(t=>t.live[e])??{},i=(0,v.usePlan)(e),n=(0,D.useBlocks)(e=>e.blocks),r=(0,w.ymd)(t),d=(0,D.closedAreasAt)(n,e,r,(0,w.hm)(t)),u={};for(const e of l)u[e]=a[e]?.blocked||d.has(`tbl:${e}`)?{busy:!0,label:'Blocked'}:d.has(i.tables.find(t=>t.name===e)?.areaId??'')?{busy:!0,label:'Closed'}:a[e]?.dirty?{busy:!0,label:'Needs clearing'}:{busy:!1,label:'Free'};for(const e of s)if(e.date===r&&e.table)for(const s of(0,v.tablesOf)(e.table))if(u[s])if('seated'===e.status)u[s]={busy:!0,label:`${e.walkIn?'Walk-in':`${e.name.slice(0,1)}.`} \xb7 ${e.partySize}`};else if('confirmed'===e.status&&!u[s].busy){const o=(0,w.minsBetween)(t,new Date(`${e.date}T${e.time}:00`));o>=-15&&o<=90&&(u[s]={...u[s],soon:`Booked ${e.time}`})}for(const e of o)'table'===e.type&&e.tableNo&&u[e.tableNo]&&!['closed','cancelled','collected'].includes(e.status)&&!u[e.tableNo].busy&&(u[e.tableNo]={busy:!0,label:'Open order'});return u}const _=e=>e.walkIn?`Walk-in \xb7 ${e.partySize}`:`${e.name} \xb7 ${e.partySize}`;function H({use:e,value:t,onPick:s,big:o,best:a,dense:i,bestSet:n,picked:r}){const d=Object.keys(e),[u,b]=(0,c.useState)(0),h=i?6:8,f=i?64:o?92:76,y=u?Math.max(3,Math.floor((u+h)/(f+h))):0,k=y?Math.floor((u-h*(y-1))/y):f,x=new Set(n??[]),j=a?(0,v.tablesOf)(a)[0]:null;return(0,F.jsx)(m.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:h},testID:"table-picker",onLayout:e=>b(Math.floor(e.nativeEvent.layout.width)),children:d.map(o=>{const a=e[o],n=t===o||!!r?.includes(o),d=x.has(o),u=j===o&&!n,c=a.busy?['Blocked','Needs clearing','Closed'].includes(a.label)?a.label:'In use':a.soon??'Free';return(0,F.jsxs)(p.default,{accessibilityRole:"button",testID:`pick-table-${o}`,accessibilityLabel:`Table ${(0,l.tableNumbers)(o)}${r?n?', picked':', not picked':''}, ${a.busy?`in use (${a.label})`:a.soon?`free, ${a.soon}`:'free'}${d?', best table':''}${u?', suggested for this party':''}`,accessibilityState:{selected:n,disabled:'Closed'===a.label},disabled:'Closed'===a.label,onPress:()=>s(o),style:{width:k,minHeight:i?58:64,borderRadius:12,borderWidth:n||u?2.5:1.5,paddingVertical:i?3:6,paddingHorizontal:4,alignItems:'center',justifyContent:'center',gap:2,borderColor:n||u?S.colours.gold:a.busy?S.colours.red:S.colours.ok,backgroundColor:n?S.colours.goldTint:a.busy?S.colours.redBg:S.colours.surface2,opacity:'Closed'!==a.label||n?1:.55},children:[(0,F.jsxs)(m.default,{style:{flexDirection:'row',alignItems:'center',gap:4},children:[(0,F.jsx)(C.T,{weight:"bold",size:22,colour:n?S.colours.goldLight:S.colours.text,children:(0,l.tableNumbers)(o)}),d?(0,F.jsx)(m.default,{testID:"best-table",style:{backgroundColor:S.colours.gold,borderRadius:5,paddingHorizontal:4,paddingVertical:1},children:(0,F.jsx)(C.T,{size:11,weight:"bold",colour:S.colours.onGold,children:"BEST"})}):null]}),(0,F.jsx)(C.T,{size:i?13:14,colour:a.busy?'#FFD9D4':a.soon?'#FFE2A8':'#E2C489',center:!0,numberOfLines:1,children:c})]},o)})})}const U=[1,2,3,4,5,6,7,8];function q({onClose:e,onSeated:a,wide:i,initialTable:n}){const{rid:r,r:d,now:u}=(0,y.useCtx)(15e3),x=E(r,u),[T,I]=(0,c.useState)(2),[$,P]=(0,c.useState)(!1),[O,B]=(0,c.useState)(n??null),z=(0,v.usePlan)(r),N=(0,k.useBookings)(r),A=(0,D.useBlocks)(e=>e.blocks),R=(0,D.closedAreasAt)(A,r,(0,w.ymd)(u),(0,w.hm)(u)),_=b.default.useMemo(()=>{const e=Object.fromEntries(Object.entries(x).map(([e,t])=>[e,{status:t.busy?'seated':'free'}]));return(0,j.suggestTable)(z,N.filter(e=>e.date===(0,w.ymd)(u)),e,T,u,(0,j.turnFor)(T,d.settings.turnMins),90,void 0,{closed:R})?.table??null},[z,N,x,T,R.size,u.getTime()]);(0,c.useEffect)(()=>{O&&(0,v.tablesOf)(O).some(e=>'Closed'===x[e]?.label)&&B(null)},[O,R.size]);const[q,V]=(0,c.useState)(!1),[Y,G]=(0,c.useState)(''),K=(e,t=String(e),s=()=>{P(!1),I(e)})=>{const o='9+'===t?$:!$&&T===e;return(0,F.jsx)(p.default,{accessibilityRole:"button",accessibilityLabel:'9+'===t?'Party of 9 or more':`Party of ${e}`,accessibilityState:{selected:o},onPress:s,style:{width:i?58:60,height:i?58:56,borderRadius:14,borderWidth:2,borderColor:S.colours.gold,alignItems:'center',justifyContent:'center',backgroundColor:o?S.colours.gold:'transparent'},children:(0,F.jsx)(C.T,{weight:"bold",size:22,colour:o?S.colours.onGold:S.colours.gold,children:t})},t)},Q=(0,F.jsx)(s.PartySizeInput,{value:T,onChange:I,min:9,max:o.MAX_PARTY,label:"Walk-in party size",testID:"walkin-party-size"}),X=(0,F.jsxs)(m.default,{style:{gap:8,width:i?256:void 0},children:[(0,F.jsx)(C.T,{weight:"semibold",children:"How many people?"}),(0,F.jsxs)(m.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:8},testID:"walkin-party",children:[U.map(e=>K(e)),K(9,'9+',()=>{P(!0),I(e=>e>=9?e:9)})]}),$?Q:null]}),[J,Z]=(0,c.useState)(!1),ee=async(t=O)=>{if(!J&&(0,M.guardBookingChange)(L)){Z(!0);try{const s=await k.repo.bookings.seatWalkIn(r,T,t??void 0,Y);W(r,t??void 0),a(s),e()}finally{Z(!1)}}},te=(0,F.jsxs)(m.default,{style:{gap:8,flex:i?1:void 0,minWidth:0},children:[(0,F.jsxs)(C.Row,{style:{justifyContent:'space-between'},children:[(0,F.jsxs)(C.T,{weight:"semibold",children:["Table ",(0,F.jsx)(C.T,{colour:S.colours.muted,size:14,children:"(optional)"})]}),O?(0,F.jsx)(C.Button,{small:!0,kind:"ghost",label:"Clear table",onPress:()=>B(null)}):null]}),(0,F.jsx)(H,{use:x,value:O,onPick:e=>{x[e]&&!x[e].busy?ee(e):B(O===e?null:e)},big:i,dense:i,best:_,bestSet:(0,h.bestTables)(z)}),(0,F.jsxs)(C.Muted,{children:["Tap a free table to seat them there",_&&!O?` (suggested for ${T}: ${(0,l.tableNumbers)(_)})`:'',", or Seat for no table yet. BEST marks the venue\u2019s best tables."]})]});return(0,F.jsxs)(C.Sheet,{visible:!0,onClose:e,title:`Walk-in \xb7 ${(0,w.hm)(u)}`,maxWidth:i?1100:void 0,testID:"walkin-sheet",children:[(0,F.jsx)(C.Button,{label:`Seat walk-in \xb7 ${T} ${1===T?'person':'people'}${O?` \xb7 ${(0,l.tableNumbers)(O)}`:''}`,disabled:J,onPress:()=>{ee()},testID:"seat-walkin",style:{minHeight:52}}),i?(0,F.jsxs)(C.Row,{gap:16,style:{alignItems:'flex-start'},children:[X,te]}):(0,F.jsxs)(F.Fragment,{children:[X,te]}),(0,F.jsxs)(C.Row,{gap:10,wrap:!0,style:{alignItems:'center'},children:[q?(0,F.jsx)(t.TextInput,{accessibilityLabel:"Walk-in note",placeholder:"Note (optional), e.g. high chair",placeholderTextColor:"#7D776C",value:Y,onChangeText:G,style:[C.styles.input,{flex:1,minWidth:220}],autoFocus:!0}):(0,F.jsx)(C.Button,{small:!0,kind:"ghost",label:"Add a note (optional)",onPress:()=>V(!0)}),(0,F.jsx)(m.default,{style:{flex:1,minWidth:220},children:(0,F.jsxs)(C.Muted,{children:["No name needed. Counts in today's covers.",'staff'!==f.APP_VARIANT?' Using website bookings too? Mark the table there as well.':'']})})]})]})}function V({booking:e,onClose:t,combine:s}){const{rid:o,r:a,now:i}=(0,y.useCtx)(15e3),n=E(o,i),r=(0,v.usePlan)(o),d=(0,k.useBookings)(o),u=(0,v.tablesOf)(e.table),p=b.default.useMemo(()=>Object.fromEntries(Object.entries(n).map(([e,t])=>[e,u.includes(e)?{busy:!1,label:'This party',soon:'This party'}:t])),[n,e.table]),f=b.default.useMemo(()=>{const t=Object.fromEntries(Object.entries(p).map(([e,t])=>[e,{status:t.busy?'seated':'free'}]));return(0,j.suggestTable)(r,d.filter(e=>e.date===(0,w.ymd)(i)),t,e.partySize,i,(0,j.turnFor)(e.partySize,a.settings.turnMins),90,e.id)?.table??null},[r,d,p,e.partySize,i.getTime()]),[x,T]=(0,c.useState)(!!s||u.length>1),[D,I]=(0,c.useState)(u),$=e=>r.tables.find(t=>t.name===e)?.maxSeats??0,P=D.reduce((e,t)=>e+$(t),0),O=D.length>0&&P{if(!(0,M.guardBookingChange)(L))return;const l=(0,v.joinTables)(s);await k.repo.bookings.assignTable(e.id,l);u.filter(e=>!s.includes(e)).forEach(t=>v.useFloor.getState().setLive(o,t,{stage:void 0,dirty:'seated'===e.status})),'seated'===e.status&&W(o,l),t()},z=x?(0,F.jsxs)(m.default,{style:{gap:8},testID:"assign-table-tip",children:[(0,F.jsx)(m.default,{accessibilityLiveRegion:"polite",children:(0,F.jsx)(C.T,{size:17,weight:"semibold",colour:S.colours.text,children:D.length?`${(0,v.tablesLabel)((0,v.joinTables)(D))} \xb7 ${P} seats for ${e.partySize} Covers`:'No tables picked yet'})}),O?(0,F.jsx)(m.default,{testID:"combine-short",children:(0,F.jsxs)(C.T,{size:15,weight:"semibold",colour:"#FFD9D4",children:["Not enough seats yet: ",e.partySize-P," more needed. Add another table."]})}):null,(0,F.jsx)(C.T,{size:15,colour:S.colours.text,children:"Tap each table to add or remove it, then tap Done. All of them show as taken until the party has finished."}),(0,F.jsxs)(C.Row,{gap:8,wrap:!0,children:[(0,F.jsx)(C.Button,{label:"Done",testID:"combine-done",disabled:!D.length,accessibilityLabel:D.length?`Done, save ${(0,v.tableCardLabel)((0,v.joinTables)(D))}`:'Done',onPress:()=>B(D)}),(0,F.jsx)(C.Button,{kind:"ghost",label:"Cancel",onPress:t})]})]}):(0,F.jsx)(m.default,{style:{gap:8},testID:"assign-table-tip",children:(0,F.jsx)(C.T,{size:15,colour:S.colours.text,children:"Red tables are in use right now; you can still pick one (e.g. joining a table). BEST marks the venue\u2019s best tables. Big party? Tap Combine tables."})});return(0,F.jsxs)(C.Sheet,{visible:!0,onClose:t,title:`${x?'Combine tables':'Assign table'} \xb7 ${_(e)}`,testID:"assign-table-sheet",footer:z,children:[f&&!x?(0,F.jsx)(m.default,{testID:"assign-suggested",children:(0,F.jsxs)(C.T,{size:16,weight:"semibold",colour:S.colours.goldLight,accessibilityLabel:`Suggested for ${e.partySize}: ${(0,v.tableCardLabel)(f)}`,children:["Suggested for ",e.partySize,": ",(0,l.tableNumbers)(f)]})}):null,x?null:(0,F.jsx)(C.Button,{kind:"secondary",label:"Combine tables",testID:"combine-start",accessibilityLabel:"Combine tables: pick several tables for this party",onPress:()=>T(!0)}),(0,F.jsx)(H,{use:p,best:x?null:f,bestSet:(0,h.bestTables)(r),picked:x?D:void 0,onPick:x?e=>I(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]):async e=>{await B([e])}})]})}function Y(e){(0,u.notify)({id:`walkin:${e.id}`,testID:'walkin-toast',timeoutMs:6e3,title:`${_(e)} seated \xb7 ${e.table?`${(0,l.tableNumbers)(e.table)}`:'table to assign'} (${e.ref})`,actions:[{label:'Undo',testID:'undo-walkin',onPress:()=>k.repo.bookings.undoWalkIn(e.id)},{label:'OK',kind:'ghost'}]})}function G({date:e,onClose:t,wide:s,onSaved:u}){const{rid:b,r:h,now:p,role:f,meId:N}=(0,y.useCtx)(6e4);(0,d.useBlurOutside)();const A=(0,w.ymd)(p),[R,W]=(0,c.useState)(ee.blocks),[H,U]=(0,c.useState)(!1),[q,V]=(0,c.useState)(''),[Y,G]=(0,c.useState)(2),[K,Q]=(0,c.useState)(0),X=Math.min(K,Math.max(0,Y-1)),[J,Z]=(0,c.useState)(null),[ee,te]=(0,c.useState)(''),[se,oe]=(0,c.useState)(''),[le,ae]=(0,c.useState)(''),[ie,ne]=(0,c.useState)('phone'),[re,de]=(0,c.useState)((0,$.emptyNeeds)()),ue=(0,$.needsMissing)(re),[ce,be]=(0,c.useState)(null),ge=(0,v.usePlan)(b),he=(0,B.dogSetUp)(ge),pe=!0===re.dog&&he,me=re.dog?re.dogs:0,fe=(0,w.parseYmd)(R),ye=(0,j.turnFor)(Y,h.settings.turnMins),ke=E.filter(e=>e.date===R),xe=e=>(0,j.freeTablesAt)(ge,ke,Y,new Date(`${R}${(0,l.tableNumbers)(e)}:00`),ye,h.settings.turnMins,{dog:!0,closed:(0,D.closedAreasAt)(_,b,R,e)}),je=pe&&J?xe(J):[];(0,c.useEffect)(()=>{be(null)},[pe,J,Y]);const we=(0,x.bookingSlots)(h,fe,e=>E.filter(t=>t.date===R&&t.time===e&&'cancelled'!==t.status&&!t.walkIn).reduce((e,t)=>e+t.partySize,0),Y,R===(0,w.ymd)(p)?p:(0,w.addMins)(fe,0),e=>E.filter(t=>t.date===R&&t.time===e&&'cancelled'!==t.status&&!t.walkIn).length),Se=(0,T.guestPhone)(se),[Te,Ce]=(0,c.useState)(!1),ve=J?we.find(e=>e.time===J):void 0,De=ve&&ve.left=2&&!!J&&(!$e||Te)&&(0,o.validParty)(Y)&&Se.ok&&(0,T.emailOk)(le)&&(!Pe||Oe&&H)&&(!pe||je.length>0)&&!Be,Me=re.wheelchair>0||re.stepFree;return(0,F.jsxs)(C.Sheet,{visible:!0,onClose:t,title:`New booking \xb7 ${(0,w.niceDate)(fe)}`,maxWidth:s?760:void 0,testID:"booking-sheet",children:[(0,F.jsx)($.FirstQuestions,{rid:b,value:re,onChange:de,party:Y,audience:"staff"}),re.dog&&!he?(0,F.jsx)(C.T,{size:13,colour:S.colours.amber,children:"Dog-friendly tables aren\u2019t marked yet. Managers \u203a Booking options \u203a Tables. Booking is allowed; check where the dog can sit."}):null,(0,F.jsx)(I.BookingDatePicker,{r:h,today:p,value:R,onChange:e=>{e!==R&&(W(e),Z(null),U(!1))}}),(0,F.jsxs)(C.Row,{gap:6,children:[(0,F.jsx)(C.Chip,{label:"Phone",selected:'phone'===ie,onPress:()=>ne('phone')}),(0,F.jsx)(C.Chip,{label:"In person",selected:'in-person'===ie,onPress:()=>ne('in-person')})]}),(0,F.jsx)(C.Field,{label:"Name",value:q,onChangeText:V,placeholder:"e.g. Reid",testID:"nb-name"}),(0,F.jsx)(C.Field,{label:"Mobile or phone number (needed)",value:se,onChangeText:oe,keyboardType:"phone-pad",placeholder:"e.g. 07700 900123",testID:"nb-phone"}),!Se.ok&&se?(0,F.jsx)(C.T,{size:13,colour:S.colours.amber,children:Se.error}):null,(0,F.jsx)(C.Field,{label:"Email (optional)",value:le,onChangeText:ae,keyboardType:"email-address",autoCapitalize:"none",placeholder:"For an email confirmation too",testID:"nb-email"}),(0,T.emailOk)(le)?null:(0,F.jsx)(C.T,{size:13,colour:S.colours.amber,children:"That email doesn\u2019t look quite right."}),(0,F.jsx)(n.AdultsChildren,{value:(0,r.peopleOf)(Y,X),onChange:e=>{G(e.partySize),Q(e.children),Ce(!1)},depositsOn:(0,i.depositOf)(h.settings).on&&(0,i.depositOf)(h.settings).perPersonPence>0,testID:"nb-people"}),(0,F.jsx)(C.Row,{wrap:!0,gap:6,children:we.map(e=>{const t=pe&&e.available&&!xe(e.time).length||!(0,$.dogTimeOk)(h,E,R,e.time,me);return(0,F.jsx)(C.Chip,{testID:`nb-slot-${e.time}`,label:e.time,sub:(0,D.blockAt)(_,b,R,e.time)?'Paused':t?'Dogs full':e.drinksOnly?'Drinks only':null!=e.partiesLeft&&e.partiesLeft<1||e.left<=0?'Full':`${e.left} left`,disabled:(e.past??!e.available)||t,selected:J===e.time,onPress:()=>{Z(e.time),U(!1),Ce(!1)}},e.time)})}),$e?(0,F.jsxs)(m.default,{testID:"nb-over-capacity",accessible:!0,accessibilityLiveRegion:"polite",style:{borderWidth:1.5,borderColor:S.colours.amber,backgroundColor:S.colours.amberBg,borderRadius:12,padding:10,gap:6},children:[De?(0,F.jsx)(C.T,{weight:"semibold",colour:S.colours.amber,children:(0,o.overCapacityNote)(Y,De.left,De.time)}):null,Ie?(0,F.jsx)(C.T,{weight:"semibold",colour:S.colours.amber,children:(0,o.overPartiesNote)(Ie.time,Ie.cap)}):null,(0,F.jsx)(C.Chip,{label:Te?'Booking over the limit: on':'Book anyway (over the limit)',selected:Te,onPress:()=>Ce(e=>!e),testID:"nb-over-ok"})]}):null,pe&&J?(0,F.jsxs)(m.default,{style:{gap:6},testID:"nb-dog-tables",children:[(0,F.jsxs)(C.T,{size:14,weight:"semibold",children:["Dog-friendly table ",(0,F.jsxs)(C.T,{size:13,colour:S.colours.muted,children:["(",ge.areas.filter(e=>e.dogs).map(e=>e.name).join(' or '),")"]})]}),je.length?(0,F.jsx)(C.Row,{wrap:!0,gap:6,children:je.slice(0,10).map((e,t)=>(0,F.jsx)(C.Chip,{label:`${(0,l.tableNumbers)(e.table)}`,sub:`${e.area} \xb7 ${e.seats}${0===t?' \xb7 best':''}${Me&&(0,B.accessibleSetUp)(ge)&&!(0,B.isAccessible)(ge,e.table)?' \xb7 not step-free':''}`,selected:(ce??je[0].table)===e.table,onPress:()=>be(e.table)},e.table))}):(0,F.jsxs)(C.T,{size:14,colour:S.colours.amber,children:["No dog-friendly table free for ",Y," at ",J,". Try another time."]})]}):null,Pe?(0,F.jsxs)(m.default,{testID:"nb-block-warning",style:{borderWidth:1.5,borderColor:S.colours.amber,backgroundColor:S.colours.amberBg,borderRadius:12,padding:10,gap:6},children:[(0,F.jsxs)(C.T,{weight:"semibold",colour:S.colours.amber,children:["Bookings are paused ",Pe.from,"\u2013",Pe.to,Pe.reason?` (${Pe.reason})`:'']}),Oe?(0,F.jsx)(C.Chip,{label:H?'Manager override on':'Override and book anyway',selected:H,onPress:()=>U(e=>!e)}):(0,F.jsx)(C.Muted,{children:"Ask a manager to override, or pick another time."})]}):null,we.length?null:(0,F.jsx)(m.default,{testID:"nb-closed",children:(0,F.jsxs)(C.T,{size:14,weight:"semibold",colour:S.colours.amber,children:["Closed on ",(0,w.niceDate)(fe)," (per the venue\u2019s opening hours). Pick another date."]})}),(0,F.jsx)($.MoreQuestions,{rid:b,r:h,value:re,onChange:de,party:Y,date:R,time:J,today:(0,w.ymd)(p),bookings:E,audience:"staff",showTables:!1!==h.settings.tableRequests}),Me&&!(0,B.accessibleSetUp)(ge)?(0,F.jsx)(C.T,{size:13,colour:S.colours.amber,children:"Step-free tables aren\u2019t marked yet (Managers \u203a Booking options \u203a Tables). Check the table works for a wheelchair."}):null,(0,F.jsx)(C.Field,{label:"Notes (optional)",value:ee,onChangeText:te,placeholder:P.NOTES_PLACEHOLDER,multiline:!0,numberOfLines:3,testID:"nb-notes"}),(0,i.depositDue)((0,i.depositOf)(h.settings),Y,X)?(0,F.jsxs)(C.Muted,{testID:"nb-deposit",children:["Deposit due: ",(0,a.gbp)((0,i.depositDue)((0,i.depositOf)(h.settings),Y,X))," (",(0,a.gbp)((0,i.depositOf)(h.settings).perPersonPence)," per adult for tables of ",(0,i.depositOf)(h.settings).fromParty,"+ adults",X?`; ${X} ${1===X?'child':'children'} free`:'; children free, and they do not count towards the number that needs a deposit',"). Staff can waive it. Deposits are paid through website bookings or to you, never in CoverCharge: tick Deposit paid on the booking once the guest has paid."]}):null,(0,F.jsxs)(C.Muted,{children:["The guest gets a confirmation text",le.trim()?' and email':''," automatically (preview mode: shown in the Outbox, not sent)."]}),Be?(0,F.jsxs)(C.T,{size:14,colour:S.colours.amber,children:["We already have the most dogs we can look after at ",J,". Try another time: dogs are very welcome then."]}):null,(0,F.jsx)(C.Button,{label:ue.length?ue[0]:'Save booking',testID:"nb-save",disabled:!ze,onPress:()=>{if(R<(0,w.ymd)(p))return;if(!(0,M.guardBookingChange)(L))return;const e=(0,$.needsPatch)(re),s=re.tableReq.find(e=>!pe||je.some(t=>t.table===e)),o=pe?null:(0,z.requestedFreeTable)(re.tableReq,{date:R,time:J,partySize:Y},ge.tables.map(e=>e.name),ke,h.settings.turnMins);k.repo.bookings.create({restaurantId:b,customerId:null,name:q.trim(),partySize:Y,date:R,time:J,notes:ee.trim(),security:(0,i.depositDue)((0,i.depositOf)(h.settings),Y,X)?'deposit':'none',depositPaid:0,...X?{children:X}:{},...(0,i.depositDue)((0,i.depositOf)(h.settings),Y,X)?{depositDue:(0,i.depositDue)((0,i.depositOf)(h.settings),Y,X),depositPolicy:(0,i.depositWords)((0,i.depositOf)(h.settings),Y,h.name,X).join(' '),depositRefundable:(0,i.depositOf)(h.settings).refundable,depositCutoffHours:(0,i.depositOf)(h.settings).cutoffHours}:{},phone:Se.pretty,email:le.trim()||void 0,source:ie,...e,...we.find(e=>e.time===J)?.drinksOnly?{drinksOnly:!0}:{},allergies:e.allergies??[],...pe?{table:ce??s??je[0]?.table}:o?{table:o}:{}}).then(e=>(0,O.postNewBookingToKitchen)(e,N)).catch(()=>{}),u?.({date:R,time:J,name:q.trim()}),t()}})]})}},1094,[812,1095,1096,843,851,841,1097,1098,1099,1100,17,842,385,85,856,1055,858,1101,1074,863,804,848,777,996,993,1102,1103,1108,1076,1053,1092,1091,1109,8]); __d(function(g,r,i,a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.PartySizeInput=function({value:e,onChange:p,min:b=s.MIN_PARTY,max:y=s.MAX_PARTY,label:f="Party size",testID:h="party-size"}){const[x,S]=(0,t.useState)(String(e));(0,t.useEffect)(()=>{S(String(e))},[e]);const T=e=>p((0,s.clampParty)(e,b,y)),$=(t,n,l)=>{const s=t<0?e<=b:e>=y;return(0,d.jsx)(o.default,{testID:`${h}-${t>0?'up':'down'}${10===Math.abs(t)?'10':''}`,accessibilityRole:"button",accessibilityLabel:l,accessibilityState:{disabled:s},disabled:s,onPress:()=>T(e+t),hitSlop:4,style:{minWidth:44,height:44,paddingHorizontal:8,borderRadius:22,borderWidth:1.5,borderColor:u.colours.gold,alignItems:'center',justifyContent:'center',opacity:s?.4:1},children:(0,d.jsx)(c.T,{size:10===Math.abs(t)?14:20,weight:"semibold",colour:u.colours.gold,center:!0,children:n})},t)};return(0,d.jsxs)(l.default,{testID:h,style:{flexDirection:'row',alignItems:'center',gap:6,flexWrap:'wrap',justifyContent:'center'},children:[y-b>=20?$(-10,'\u221210',"10 fewer people"):null,$(-1,'\u2212','One fewer person'),(0,d.jsx)(n.default,{testID:`${h}-input`,value:x,keyboardType:"number-pad",inputMode:"numeric",maxLength:3,selectTextOnFocus:!0,accessibilityLabel:`${f}, ${b} to ${y} people`,accessibilityValue:{min:b,max:y,now:e,text:`${e} ${1===e?'person':'people'}`},onChangeText:e=>{S(e.replace(/\D/g,'')),e.replace(/\D/g,'')&&T((0,s.partyFromText)(e,b,y))},onBlur:()=>{const e=(0,s.partyFromText)(x,b,y);S(String(e)),T(e)},returnKeyType:"done",blurOnSubmit:!0,onSubmitEditing:e=>{e?.target?.blur?.()},style:{width:64,height:44,borderRadius:10,borderWidth:1,borderColor:u.colours.border,color:u.colours.text,backgroundColor:u.colours.surface,textAlign:'center',fontSize:20,fontFamily:u.fonts.semibold}}),$(1,'+','One more person'),y-b>=20?$(10,'+10',"10 more people"):null]})};var t=r(_d[0]),o=e(r(_d[1])),n=e(r(_d[2])),l=e(r(_d[3])),s=r(_d[4]),u=r(_d[5]),c=r(_d[6]),d=r(_d[7])},1095,[17,385,395,85,1096,804,777,8]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"MAX_PARTY",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"MIN_PARTY",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"PARTY_RULE",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"validParty",{enumerable:!0,get:function(){return u}}),Object.defineProperty(e,"partyFromText",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"clampParty",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"overCapacityNote",{enumerable:!0,get:function(){return f}}),Object.defineProperty(e,"overPartiesNote",{enumerable:!0,get:function(){return b}});const t=100,n=1,o=`Bookings are for ${n} to ${t} people.`,u=o=>'number'==typeof o&&Number.isInteger(o)&&o>=n&&o<=t,c=(o,u=n,c=t)=>{const s=parseInt(String(o??'').replace(/\D/g,'').slice(0,4),10);return Math.max(u,Math.min(c,Number.isFinite(s)?s:u))},s=(o,u=n,c=t)=>Math.max(u,Math.min(c,Math.round(Number(o)||u))),f=(t,n,o)=>n<=0?`${o} is already full for booked Covers. Booking ${t} more goes over the venue\u2019s limit: check tables and staffing.`:`${t} is more than the ${n} Covers left at ${o}. Booking goes over the venue\u2019s limit by ${t-n}: check tables and staffing.`,b=(t,n)=>`${t} already has the most bookings we take at one start time (${n}). Booking another goes over the venue\u2019s limit: check tables and staffing.`},1096,[]); __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.AdultsChildren=function({value:e,onChange:t,depositsOn:h,testID:x="people"}){const p=e=>t((0,s.storedPeople)(e)),b=(0,s.totalLine)(e);return(0,o.jsxs)(l.default,{testID:x,style:{gap:8,alignItems:'center',width:'100%'},children:[(0,o.jsx)(u.T,{size:18,center:!0,weight:"semibold",children:"Adults"}),(0,o.jsx)(n.PartySizeInput,{value:e.adults,min:1,max:(0,s.maxAdults)(e.children),onChange:t=>p({adults:t,children:e.children}),label:"Adults",testID:`${x}-adults`}),(0,o.jsx)(u.T,{size:18,center:!0,weight:"semibold",children:"Children"}),(0,o.jsx)(n.PartySizeInput,{value:e.children,min:0,max:(0,s.maxKids)(e.adults),onChange:t=>p({adults:e.adults,children:t}),label:"Children",testID:`${x}-children`}),(0,o.jsx)(u.T,{size:18,center:!0,weight:"semibold",colour:c.colours.goldLight,testID:`${x}-total`,accessibilityLabel:b,children:b}),h?(0,o.jsx)(u.Muted,{center:!0,children:"Children never pay a deposit."}):null]})},r(d[0]);var e,t=r(d[1]),l=(e=t)&&e.__esModule?e:{default:e},s=r(d[2]),n=r(d[3]),u=r(d[4]),c=r(d[5]),o=r(d[6])},1097,[17,85,1098,1095,777,804,8]); @@ -1302,9 +1302,9 @@ __d(function(g,_r,i,_a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModu __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.useSafetyView=function(o){const l=(0,n.useSafety)(),c=(0,s.useOwner)(t=>t.site);return(0,t.useMemo)(()=>{if('chef'!==o)return{...l,points:l.points.filter(t=>!t.archived),allPoints:l.points};const t=l.points.filter(t=>(0,f.chefCanSee)(c,t)),n=t.filter(t=>!t.archived),s=new Set(l.points.filter(t=>!(0,f.chefCanSee)(c,t)).map(t=>t.id)),u=t=>(0,f.chefCanSee)(c,t)&&!s.has(t.pointId||'');return{...l,points:n,allPoints:t,entries:l.entries.filter(u),probes:l.probes.filter(u),diary:l.diary.filter(t=>u(t)&&(0,f.chefCanSee)(c,t.text)),weekly:l.weekly.filter(t=>(0,f.chefCanSee)(c,t.note))}},[l,c,o])};var t=r(d[0]),n=r(d[1]),s=r(d[2]),f=r(d[3])},1219,[17,1001,876,820]); __d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"BOTTOM_TABS_HEIGHT",{enumerable:!0,get:function(){return h}}),_e.BottomTabs=function({tabs:e,active:b,onPress:y,background:x,tablist:p}){const{width:j}=(0,s.default)(),v=j/Math.max(1,e.length),w=v>=60?11:10,I=v<56?20:22,[F,S]=(0,t.useState)({}),[H,_]=(0,t.useState)(0),M=H>0&&e.some(e=>(F[e.id]??0)>H-6),z={flexDirection:'row',flexWrap:'nowrap',alignItems:'stretch',borderTopWidth:1,borderColor:c.colours.border,backgroundColor:x};return(0,f.jsx)(l.default,{testID:"app-bottom-tabs",accessibilityRole:p?'tablist':void 0,style:z,children:e.map(t=>{const s=b===t.id,x=s?c.colours.gold:c.colours.muted;return(0,f.jsxs)(n.default,{onLayout:t===e[0]?e=>_(e.nativeEvent.layout.width):void 0,testID:`tab-${t.id}`,accessibilityRole:"tab",accessibilityState:{selected:s},accessibilityLabel:t.a11y??t.label,onPress:()=>y(t.id),style:{flexGrow:1,flexShrink:1,flexBasis:0,minWidth:44,minHeight:h,alignItems:'center',justifyContent:'center',paddingVertical:4,paddingHorizontal:1,gap:2},children:[(0,f.jsxs)(l.default,{style:{width:I,height:I,alignItems:'center',justifyContent:'center'},children:[(0,f.jsx)(u.Icon,{name:t.icon,size:I,colour:x}),t.badge?(0,f.jsx)(l.default,{testID:t.badge.testID,style:{position:'absolute',right:-10,top:-5,backgroundColor:t.badge.bg,borderRadius:8,minWidth:16,height:16,paddingHorizontal:3,alignItems:'center',justifyContent:'center'},children:(0,f.jsx)(o.default,{style:{fontFamily:c.fonts.bold,fontSize:10,lineHeight:12,color:t.badge.fg??'#FFFFFF'},children:t.badge.text})}):null]}),(0,f.jsx)(l.default,{pointerEvents:"none","aria-hidden":!0,importantForAccessibility:"no-hide-descendants",accessibilityElementsHidden:!0,style:{position:'absolute',left:0,top:0,width:0,height:0,overflow:'hidden',opacity:0},children:(0,f.jsx)(l.default,{style:{width:400,flexDirection:'row',alignItems:'flex-start'},children:(0,f.jsx)(o.default,{onLayout:e=>{const n=Math.ceil(e.nativeEvent.layout.width);S(e=>e[t.id]===n?e:{...e,[t.id]:n})},style:{fontFamily:c.fonts.semibold,fontSize:w,lineHeight:Math.round(1.3*w),flexShrink:0},children:t.short??t.label})})}),M?null:(0,f.jsx)(o.default,{numberOfLines:1,style:{fontFamily:s?c.fonts.semibold:c.fonts.regular,fontSize:w,lineHeight:Math.round(1.3*w),color:x,textAlign:'center',alignSelf:'center',maxWidth:'100%'},children:t.short??t.label})]},t.id)})})};var t=r(d[0]),n=e(r(d[1])),o=e(r(d[2])),l=e(r(d[3])),s=e(r(d[4])),c=r(d[5]),u=r(d[6]),f=r(d[7]);const h=56},1220,[17,385,329,85,409,804,1178,8]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return f}});var t=r(d[0]);r(d[1]);var n=r(d[2]),u=r(d[3]),c=r(d[4]);function f(){return(0,u.canShow)('chef')?(0,c.jsx)(n.ChefApp,{}):(0,c.jsx)(t.Redirect,{href:u.ENTRY[u.APP_VARIANT]})}},1221,[13,17,775,856,8]); -__d(function(g,_r,_i,_a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return A}});var e,t=_r(d[0]),o=_r(d[1]),n=_r(d[2]),s=_r(d[3]),l=_r(d[4]),i=_r(d[5]),a=_r(d[6]),r=_r(d[7]),u=(e=r)&&e.__esModule?e:{default:e},c=_r(d[8]),h=_r(d[9]),p=_r(d[10]),b=_r(d[11]),f=_r(d[12]),y=_r(d[13]),x=_r(d[14]),k=_r(d[15]),j=_r(d[16]),v=_r(d[17]),S=_r(d[18]),w=_r(d[19]),T=_r(d[20]),C=_r(d[21]),D=_r(d[22]),$=_r(d[23]),P=_r(d[24]),M=_r(d[25]),B=_r(d[26]),O=_r(d[27]);function A(){const{rid:e,date:r}=(0,s.useLocalSearchParams)(),A=(0,j.useRestaurant)(e),N=(0,j.useCustomer)(),z=(0,j.useBookings)(e),I=(0,j.useEvents)(e),R=(0,j.useNow)(6e4),[q]=(0,l.useState)(()=>(0,a.startForm)()),[F,L]=(0,l.useState)(''),[E,H]=(0,l.useState)(2),[W,_]=(0,l.useState)(0),Y=Math.min(W,Math.max(0,E-1)),[U,G]=(0,l.useState)(r??(0,k.ymd)(R)),[Q,V]=(0,l.useState)(null),[J,K]=(0,l.useState)(N.name),[X,Z]=(0,l.useState)(N.phone??''),[ee,te]=(0,l.useState)(N.email??''),[oe,ne]=(0,l.useState)(!1),[se,le]=(0,l.useState)(''),[ie,ae]=(0,l.useState)(!1),[re,de]=(0,l.useState)([]),[ue,ce]=(0,l.useState)(!1),he=[...N.allergies,...re.filter(e=>!N.allergies.some(t=>t.allergen===e)).map(e=>({allergen:e,severity:'allergy'}))],[me,ge]=(0,l.useState)(null),pe=(0,C.useBlocks)(e=>e.blocks);(0,v.usePublicDayStore)(e=>e.n);const be=e?(0,v.publicDay)(e,U):null,fe=be?[...be.bookings,...z.filter(e=>e.date!==U)]:z,ye=be?[...pe.filter(t=>t.rid!==e||t.date!==U),...be.blocks]:pe,xe=(0,D.usePlan)(e),[ke,je]=(0,l.useState)((0,P.emptyNeeds)()),ve=!0===ke.dog,Se=ve?ke.dogs:0;if(!A)return(0,O.jsx)(b.Screen,{title:"Not found",children:(0,O.jsx)(b.T,{children:"Restaurant not found."})});const we=A.settings,Te=(0,k.parseYmd)(U),Ce=(0,x.onlinePartyBounds)(A),De=(0,C.blocksOn)(ye,A.id,U),$e=fe.filter(e=>e.date===U),Pe=xe.areas.filter(e=>e.dogs),Me=(0,M.dogSetUp)(xe),Be=e=>(0,$.freeTablesAt)(xe,$e,E,new Date(`${U}${(0,t.tableNumbers)(e)}:00`),(0,$.turnFor)(E,we.turnMins),we.turnMins,{dog:!0,closed:(0,C.closedAreasAt)(ye,A.id,U,e)}),Oe=(0,x.bookingSlots)(A,Te,e=>fe.filter(t=>t.date===U&&t.time===e&&!['cancelled','noshow'].includes(t.status)).reduce((e,t)=>e+t.partySize,0),E,R,e=>fe.filter(t=>t.date===U&&t.time===e&&!['cancelled','noshow'].includes(t.status)).length).map(e=>{const t=(0,C.blockAt)(ye,A.id,U,e.time),o=ve&&Me&&e.available&&!t&&(!Be(e.time).length||!(0,P.dogTimeOk)(A,fe,U,e.time,Se));return{...e,blocked:!!t,noDog:o,available:e.available&&!t&&!o}}),Ae=Oe.some(e=>e.available),Ne=(0,c.depositOf)(we),ze=(0,c.depositDue)(Ne,E,Y),Ie=ze>0?'deposit':'none',Re=(0,c.depositWords)(Ne,E,A.name,Y),qe=I.filter(e=>e.date===U),Fe=(0,T.guestPhone)(X),Le=(0,T.emailOk)(ee),Ee=(0,P.needsMissing)(ke,N.allergies),He=!!Q&&ie&&!Ee.length&&J.trim().length>1&&Fe.ok&&Le,We=async()=>{const e=(0,P.needsPatch)(ke,N.allergies),t=ve&&Me?Be(Q).map(e=>e.table):[],o=ve?ke.tableReq.find(e=>t.includes(e))??t[0]:void 0,n=await j.repo.bookings.create({restaurantId:A.id,customerId:N.id,name:J,partySize:E,...Y?{children:Y}:{},date:U,time:Q,notes:se.trim(),security:Ie,depositPaid:0,...ze?{depositDue:ze,depositPolicy:Re.join(' '),depositRefundable:Ne.refundable,depositCutoffHours:Ne.cutoffHours}:{},phone:Fe.pretty,email:ee.trim()||void 0,source:'online',...e,...Oe.find(e=>e.time===Q)?.drinksOnly?{drinksOnly:!0}:{},allergies:e.allergies??he,...o?{table:o}:{}});(0,a.rememberGuard)(n.id,(0,a.guardFor)({...q,hp:F})),ge(n)},Ye=(0,j.useStore)(e=>me?e.bookings.find(e=>e.id===me.id)?.ref:void 0),Ue=e=>(0,w.waMeLink)(A.settings.whatsapp,(0,w.guestWhatsAppText)({name:e.name,ref:Ye??e.ref,date:e.date,time:e.time,partySize:e.partySize},A.name));if(me){const e='pending'===me.status;return(0,O.jsxs)(b.Screen,{title:e?'Booking request received':'Booking confirmed',subtitle:A.name,children:[(0,O.jsx)(b.Banner,{kind:e?'info':'success',title:`Reference ${Ye??me.ref}`,children:`${me.partySize} people \xb7 ${(0,k.niceDateYear)((0,k.parseYmd)(me.date))} at ${me.time}`}),e?(0,O.jsx)(b.Banner,{kind:"warn",title:"The team will confirm shortly",children:"For larger parties and special requests, a member of the team checks your booking first. Contact the venue if you need an update."}):null,(0,O.jsxs)(b.Card,{children:[(0,O.jsxs)(b.T,{children:["Name: ",me.name]}),(0,O.jsxs)(b.T,{children:["Mobile: ",me.phone]}),me.email?(0,O.jsxs)(b.T,{children:["Email: ",me.email]}):null,(0,O.jsxs)(b.T,{children:["Allergies shared with the restaurant: ",me.allergies.length?me.allergies.map(e=>`${(0,f.allergenLabel)(e.allergen)} (${(0,f.severityLabel)(e.severity)})`).join(', '):'none']}),me.notes?(0,O.jsxs)(b.T,{children:["Notes: ",me.notes]}):null,me.dog?(0,O.jsxs)(b.T,{children:["\ud83d\udc15 Dog coming too",me.table?` \xb7 dog-friendly table ${me.table}`:'']}):null,me.holds?.length?(0,O.jsxs)(b.T,{children:["Reserved: ",me.holds.map(e=>`${e.qty} \xd7 ${'item'===e.kind?(A.settings.reservables??M.ANCHORAGE_RESERVABLES).find(t=>t.id===e.id)?.name??'item':e.id}`).join(', ')," (the kitchen confirms it)"]}):null,me.tableReq?.length?(0,O.jsxs)(b.T,{children:["Table requested: ",me.tableReq.map(e=>`${(0,t.tableNumbers)(e)}`).join(' or ')," (not guaranteed, but we\u2019ll do our best)"]}):null,'deposit'===me.security&&me.depositDue?(0,O.jsxs)(b.T,{weight:"semibold",children:["Deposit due: ",(0,y.gbp)(me.depositDue),". ",A.name," will tell you how to pay it."]}):null,'deposit'===me.security&&me.depositPolicy?(0,O.jsx)(b.Muted,{children:me.depositPolicy}):null,(0,O.jsx)(b.Muted,{children:"Your booking details are shown above. If you need confirmation, contact the venue and quote your reference."}),(0,O.jsxs)(b.Muted,{children:["Need to change or cancel? Call ",A.phone," and quote ",Ye??me.ref,"."]})]}),Ue(me)?(0,O.jsxs)(u.default,{style:{gap:4},children:[(0,O.jsx)(b.Button,{kind:"secondary",label:"\ud83d\udcac Message us on WhatsApp",testID:"guest-whatsapp",onPress:()=>{const e=Ue(me);e&&(0,w.openWhatsApp)(e)}}),(0,O.jsx)(b.Muted,{size:13,children:"Opens WhatsApp with your booking details typed in. You can change the message before you send it."})]}):null,(0,O.jsx)(b.Button,{label:"Back to restaurant",onPress:()=>s.router.replace(`/customer/${A.id}`)})]})}return(0,O.jsxs)(b.Screen,{title:"Book a table",subtitle:A.name,footer:(0,O.jsx)(b.Button,{label:Ee.length?Ee[0]:E>(we.autoAcceptUpTo??7)?'Send booking request':'Confirm booking',disabled:!He,onPress:()=>We(),testID:"confirm-booking"}),children:[(0,O.jsx)(P.FirstQuestions,{rid:A.id,value:ke,onChange:e=>{e.dog===ke.dog&&e.dogs===ke.dogs||V(null),je(e)},party:E,audience:"guest",profile:N.allergies}),(0,O.jsxs)(b.Card,{children:[(0,O.jsxs)(u.default,{style:{gap:6,alignItems:'center'},children:[(0,O.jsx)(b.H2,{children:"Party size"}),(0,O.jsx)(o.PartySizeInput,{value:E,onChange:e=>{H(e),V(null)},min:Ce.min,max:Ce.max,label:"Party size",testID:"party-size"})]}),(0,O.jsx)(h.ChildrenCount,{guest:!0,party:E,value:Y,onChange:_,depositsOn:Ne.on&&Ne.perPersonPence>0,testID:"book-children"}),ze?(0,O.jsx)(b.Banner,{kind:"info",title:Y?`Deposit: ${(0,y.gbp)(ze)} for ${E-Y} adults (children free)`:`Deposit: ${(0,y.gbp)(ze)} for ${E} guests`,children:(0,O.jsx)(u.default,{style:{gap:4},children:Re.map(e=>(0,O.jsx)(b.T,{size:13,children:e},e))})}):Ne.on&&Ne.perPersonPence>0?(0,O.jsxs)(b.Muted,{children:["No deposit for fewer than ",Ne.fromParty," guests."]}):null,E>(we.autoAcceptUpTo??7)?(0,O.jsxs)(b.Muted,{children:["For ",E," people the team checks the booking first, then texts you to confirm."]}):null,ve&&Me?(0,O.jsxs)(b.Muted,{children:["Dogs are welcome in the ",Pe.map(e=>`${e.name}${e.outdoor?' (outdoors, weather permitting)':''}`).join(' and ')||'dog-friendly tables',". We\u2019ll only show times with a dog-friendly table",A.settings.maxDogsPerSlot?' and room for your dog':'',"."]}):null]}),(0,O.jsxs)(b.Card,{children:[(0,O.jsx)(b.H2,{children:"Date"}),(0,O.jsx)(B.CustomerDatePicker,{r:A,today:R,value:U,events:I,onChange:e=>{G(e),V(null)}}),qe.map(e=>(0,O.jsx)(b.Banner,{kind:"demo",title:e.title,children:e.description},e.id))]}),(0,O.jsxs)(b.Card,{children:[(0,O.jsx)(b.H2,{children:"Time"}),0===Oe.length?(0,O.jsx)(b.Muted,{children:"Closed on this day (per listed kitchen hours)."}):(0,O.jsx)(b.Row,{wrap:!0,gap:6,children:Oe.map(e=>(0,O.jsx)(b.Chip,{testID:`book-slot-${e.time}`,label:e.time,sub:e.available?e.drinksOnly?'Drinks only':void 0:e.blocked?'Unavailable':e.noDog?'No dog table':e.leftV(e.time)},e.time))}),De.length>0&&Oe.some(e=>e.blocked)?(0,O.jsx)(b.Banner,{kind:"info",title:Ae?'Some times aren\u2019t available online':'Online booking isn\u2019t available for this time',children:`We\u2019re not taking online bookings ${De.map(e=>`${e.from}\u2013${e.to}`).join(', ')} on ${(0,k.niceDate)(Te)}. Please give us a ring on ${A.phone??"the restaurant"} and we\u2019ll do our best to fit you in.`}):null,(()=>{const e=(0,n.lastFoodOn)(A,U);return e&&Oe.some(e=>e.drinksOnly)?(0,O.jsx)(b.Banner,{kind:"info",title:`Last food orders ${(0,n.fmt12)(e.time)}${'kitchen closes'!==e.reason?` (${e.reason})`:''}`,children:"Times marked \u201cDrinks only\u201d are after the kitchen\u2019s last food orders that day: you\u2019re welcome for drinks, but we can\u2019t serve food."}):null})(),ve&&Oe.some(e=>e.noDog)?(0,O.jsx)(b.Banner,{kind:"info",title:"Some times are full for dogs",children:`Times marked "No dog table" are full in the ${Pe.map(e=>e.name).join(' and ')}${A.settings.maxDogsPerSlot?' or already have the most dogs we can look after':''}${(0,C.closedAreasAt)(ye,A.id,U,Q??'12:00').size?', or the garden is closed for weather':''}. We\u2019d love to see you both, so please try one of the other times shown.`}):null,(0,O.jsx)(b.Muted,{children:(0,x.bookingLimitsHint)(A)})]}),(0,O.jsx)(P.MoreQuestions,{rid:A.id,r:A,value:ke,onChange:je,party:E,date:U,time:Q,today:(0,k.ymd)(R),bookings:fe,audience:"guest",showTables:!0}),(0,O.jsxs)(b.Card,{highlight:ie?void 0:S.colours.amber,children:[(0,O.jsx)(b.Field,{label:"Notes (optional)",value:se,onChangeText:le,placeholder:p.NOTES_PLACEHOLDER,multiline:!0,numberOfLines:3,testID:"book-notes"}),(0,O.jsx)(b.Toggle,{label:"I confirm the allergy information for this booking",value:ie,onChange:ae}),(0,O.jsx)(b.Muted,{children:"Table requests aren\u2019t guaranteed, but we\u2019ll do our best. Nothing here is charged now; reserved dishes are paid on the night."})]}),(0,O.jsxs)(b.Card,{children:[(0,O.jsx)(b.H2,{children:"Your details"}),(0,O.jsx)(b.Field,{label:"Name for the booking",value:J,onChangeText:K}),(0,O.jsx)(b.Field,{testID:"book-phone",label:"Mobile number (needed to book)",value:X,onChangeText:Z,onBlur:()=>ne(!0),keyboardType:"phone-pad",autoComplete:"tel",placeholder:"e.g. 07700 900123"}),Fe.ok||!oe&&!X?null:(0,O.jsx)(b.T,{size:13,colour:S.colours.amber,children:Fe.error}),(0,O.jsx)(b.Field,{testID:"book-email",label:"Email (optional)",value:ee,onChangeText:te,keyboardType:"email-address",autoCapitalize:"none",autoComplete:"email",placeholder:"you@example.com"}),Le?null:(0,O.jsx)(b.T,{size:13,colour:S.colours.amber,children:"That email doesn\u2019t look quite right. Check it, or leave it blank."}),(0,O.jsxs)(b.Muted,{children:["We\u2019ll text you a confirmation",ee.trim()?' and email it too':'',", with how to change or cancel. We only use your number for this booking."]})]}),(0,O.jsx)(i.Honeypot,{value:F,onChange:L})]})}},1222,[843,1095,861,13,17,1223,963,85,841,1224,1108,777,845,851,1101,863,858,946,804,1175,848,993,996,1074,1103,1053,1225,8]); +__d(function(g,_r,_i,_a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return A}});var e,t=_r(d[0]),o=_r(d[1]),n=_r(d[2]),s=_r(d[3]),a=_r(d[4]),l=_r(d[5]),i=_r(d[6]),r=_r(d[7]),u=(e=r)&&e.__esModule?e:{default:e},c=_r(d[8]),h=_r(d[9]),p=_r(d[10]),b=_r(d[11]),f=_r(d[12]),y=_r(d[13]),x=_r(d[14]),k=_r(d[15]),j=_r(d[16]),v=_r(d[17]),w=_r(d[18]),S=_r(d[19]),C=_r(d[20]),T=_r(d[21]),D=_r(d[22]),$=_r(d[23]),P=_r(d[24]),M=_r(d[25]),B=_r(d[26]),O=_r(d[27]);function A(){const{rid:e,date:r}=(0,s.useLocalSearchParams)(),A=(0,j.useRestaurant)(e),N=(0,j.useCustomer)(),z=(0,j.useBookings)(e),I=(0,j.useEvents)(e),R=(0,j.useNow)(6e4),[q]=(0,a.useState)(()=>(0,i.startForm)()),[F,L]=(0,a.useState)(''),[E,H]=(0,a.useState)(2),[W,_]=(0,a.useState)(0),Y=Math.min(W,Math.max(0,E-1)),[U,G]=(0,a.useState)(r??(0,k.ymd)(R)),[Q,V]=(0,a.useState)(null),[J,K]=(0,a.useState)(N.name),[X,Z]=(0,a.useState)(N.phone??''),[ee,te]=(0,a.useState)(N.email??''),[oe,ne]=(0,a.useState)(!1),[se,ae]=(0,a.useState)(''),[le,ie]=(0,a.useState)(!1),[re,de]=(0,a.useState)([]),[ue,ce]=(0,a.useState)(!1),he=[...N.allergies,...re.filter(e=>!N.allergies.some(t=>t.allergen===e)).map(e=>({allergen:e,severity:'allergy'}))],[me,ge]=(0,a.useState)(null),pe=(0,T.useBlocks)(e=>e.blocks);(0,v.usePublicDayStore)(e=>e.n);const be=e?(0,v.publicDay)(e,U):null,fe=be?[...be.bookings,...z.filter(e=>e.date!==U)]:z,ye=be?[...pe.filter(t=>t.rid!==e||t.date!==U),...be.blocks]:pe,xe=(0,D.usePlan)(e),[ke,je]=(0,a.useState)((0,P.emptyNeeds)()),ve=!0===ke.dog,we=ve?ke.dogs:0;if(!A)return(0,O.jsx)(b.Screen,{title:"Not found",children:(0,O.jsx)(b.T,{children:"Restaurant not found."})});const Se=A.settings,Ce=(0,k.parseYmd)(U),Te=(0,x.onlinePartyBounds)(A),De=(0,T.blocksOn)(ye,A.id,U),$e=fe.filter(e=>e.date===U),Pe=xe.areas.filter(e=>e.dogs),Me=(0,M.dogSetUp)(xe),Be=e=>(0,$.freeTablesAt)(xe,$e,E,new Date(`${U}${(0,t.tableNumbers)(e)}:00`),(0,$.turnFor)(E,Se.turnMins),Se.turnMins,{dog:!0,closed:(0,T.closedAreasAt)(ye,A.id,U,e)}),Oe=(0,x.bookingSlots)(A,Ce,e=>fe.filter(t=>t.date===U&&t.time===e&&!['cancelled','noshow'].includes(t.status)).reduce((e,t)=>e+t.partySize,0),E,R,e=>fe.filter(t=>t.date===U&&t.time===e&&!['cancelled','noshow'].includes(t.status)).length).map(e=>{const t=(0,T.blockAt)(ye,A.id,U,e.time),o=ve&&Me&&e.available&&!t&&(!Be(e.time).length||!(0,P.dogTimeOk)(A,fe,U,e.time,we));return{...e,blocked:!!t,noDog:o,available:e.available&&!t&&!o}}),Ae=Oe.some(e=>e.available),Ne=(0,c.depositOf)(Se),ze=(0,c.depositDue)(Ne,E,Y),Ie=ze>0?'deposit':'none',Re=(0,c.depositWords)(Ne,E,A.name,Y),qe=I.filter(e=>e.date===U),Fe=(0,C.guestPhone)(X),Le=(0,C.emailOk)(ee),Ee=(0,P.needsMissing)(ke,N.allergies),He=!!Q&&le&&!Ee.length&&J.trim().length>1&&Fe.ok&&Le,We=async()=>{const e=(0,P.needsPatch)(ke,N.allergies),t=ve&&Me?Be(Q).map(e=>e.table):[],o=ve?ke.tableReq.find(e=>t.includes(e))??t[0]:void 0,n=await j.repo.bookings.create({restaurantId:A.id,customerId:N.id,name:J,partySize:E,...Y?{children:Y}:{},date:U,time:Q,notes:se.trim(),security:Ie,depositPaid:0,...ze?{depositDue:ze,depositPolicy:Re.join(' '),depositRefundable:Ne.refundable,depositCutoffHours:Ne.cutoffHours}:{},phone:Fe.pretty,email:ee.trim()||void 0,source:'online',...e,...Oe.find(e=>e.time===Q)?.drinksOnly?{drinksOnly:!0}:{},allergies:e.allergies??he,...o?{table:o}:{}});(0,i.rememberGuard)(n.id,(0,i.guardFor)({...q,hp:F})),ge(n)},Ye=(0,j.useStore)(e=>me?e.bookings.find(e=>e.id===me.id)?.ref:void 0),Ue=e=>(0,S.waMeLink)(A.settings.whatsapp,(0,S.guestWhatsAppText)({name:e.name,ref:Ye??e.ref,date:e.date,time:e.time,partySize:e.partySize},A.name));if(me){const e='pending'===me.status;return(0,O.jsxs)(b.Screen,{title:e?'Booking request received':'Booking confirmed',subtitle:A.name,children:[(0,O.jsx)(b.Banner,{kind:e?'info':'success',title:`Reference ${Ye??me.ref}`,children:`${me.partySize} people \xb7 ${(0,k.niceDateYear)((0,k.parseYmd)(me.date))} at ${me.time}`}),e?(0,O.jsx)(b.Banner,{kind:"warn",title:"The team will confirm shortly",children:"For larger parties and special requests, a member of the team checks your booking first. Contact the venue if you need an update."}):null,(0,O.jsxs)(b.Card,{children:[(0,O.jsxs)(b.T,{children:["Name: ",me.name]}),(0,O.jsxs)(b.T,{children:["Mobile: ",me.phone]}),me.email?(0,O.jsxs)(b.T,{children:["Email: ",me.email]}):null,(0,O.jsxs)(b.T,{children:["Allergies shared with the restaurant: ",me.allergies.length?me.allergies.map(e=>`${(0,f.allergenLabel)(e.allergen)} (${(0,f.severityLabel)(e.severity)})`).join(', '):'none']}),me.notes?(0,O.jsxs)(b.T,{children:["Notes: ",me.notes]}):null,me.dog?(0,O.jsxs)(b.T,{children:["\ud83d\udc15 Dog coming too",me.table?` \xb7 dog-friendly table ${me.table}`:'']}):null,me.holds?.length?(0,O.jsxs)(b.T,{children:["Reserved: ",me.holds.map(e=>`${e.qty} \xd7 ${'item'===e.kind?(A.settings.reservables??M.ANCHORAGE_RESERVABLES).find(t=>t.id===e.id)?.name??'item':e.id}`).join(', ')," (the kitchen confirms it)"]}):null,me.tableReq?.length?(0,O.jsxs)(b.T,{children:["Table requested: ",me.tableReq.map(e=>`${(0,t.tableNumbers)(e)}`).join(' or ')," (not guaranteed, but we\u2019ll do our best)"]}):null,'deposit'===me.security&&me.depositDue?(0,O.jsxs)(b.T,{weight:"semibold",children:["Deposit due: ",(0,y.gbp)(me.depositDue),". ",A.name," will tell you how to pay it."]}):null,'deposit'===me.security&&me.depositPolicy?(0,O.jsx)(b.Muted,{children:me.depositPolicy}):null,(0,O.jsx)(b.Muted,{children:"Your booking details are shown above. If you need confirmation, contact the venue and quote your reference."}),(0,O.jsxs)(b.Muted,{children:["Need to change or cancel? Call ",A.phone," and quote ",Ye??me.ref,"."]})]}),Ue(me)?(0,O.jsxs)(u.default,{style:{gap:4},children:[(0,O.jsx)(b.Button,{kind:"secondary",label:"\ud83d\udcac Message us on WhatsApp",testID:"guest-whatsapp",onPress:()=>{const e=Ue(me);e&&(0,S.openWhatsApp)(e)}}),(0,O.jsx)(b.Muted,{size:13,children:"Opens WhatsApp with your booking details typed in. You can change the message before you send it."})]}):null,(0,O.jsx)(b.Button,{label:"Back to restaurant",onPress:()=>s.router.replace(`/customer/${A.id}`)})]})}return(0,O.jsxs)(b.Screen,{title:"Book a table",subtitle:A.name,footer:(0,O.jsx)(b.Button,{label:Ee.length?Ee[0]:E>(Se.autoAcceptUpTo??7)?'Send booking request':'Confirm booking',disabled:!He,onPress:()=>We(),testID:"confirm-booking"}),children:[(0,O.jsx)(P.FirstQuestions,{rid:A.id,value:ke,onChange:e=>{e.dog===ke.dog&&e.dogs===ke.dogs||V(null),je(e)},party:E,audience:"guest",profile:N.allergies}),(0,O.jsxs)(b.Card,{children:[(0,O.jsxs)(u.default,{style:{gap:6,alignItems:'center'},children:[(0,O.jsx)(b.H2,{children:"Party size"}),(0,O.jsx)(o.PartySizeInput,{value:E,onChange:e=>{H(e),V(null)},min:Te.min,max:Te.max,label:"Party size",testID:"party-size"})]}),(0,O.jsx)(h.ChildrenCount,{guest:!0,party:E,value:Y,onChange:_,depositsOn:Ne.on&&Ne.perPersonPence>0,testID:"book-children"}),ze?(0,O.jsx)(b.Banner,{kind:"info",title:Y?`Deposit: ${(0,y.gbp)(ze)} for ${E-Y} adults (children don't count towards the ${Ne.fromParty} and don't pay)`:`Deposit: ${(0,y.gbp)(ze)} for ${E} adults`,children:(0,O.jsx)(u.default,{style:{gap:4},children:Re.map(e=>(0,O.jsx)(b.T,{size:13,children:e},e))})}):Ne.on&&Ne.perPersonPence>0?(0,O.jsxs)(b.Muted,{children:["No deposit for fewer than ",Ne.fromParty," adults. Children don't count towards the ",Ne.fromParty," and don't pay, and staff can waive a deposit."]}):null,E>(Se.autoAcceptUpTo??7)?(0,O.jsxs)(b.Muted,{children:["For ",E," people the team checks the booking first, then texts you to confirm."]}):null,ve&&Me?(0,O.jsxs)(b.Muted,{children:["Dogs are welcome in the ",Pe.map(e=>`${e.name}${e.outdoor?' (outdoors, weather permitting)':''}`).join(' and ')||'dog-friendly tables',". We\u2019ll only show times with a dog-friendly table",A.settings.maxDogsPerSlot?' and room for your dog':'',"."]}):null]}),(0,O.jsxs)(b.Card,{children:[(0,O.jsx)(b.H2,{children:"Date"}),(0,O.jsx)(B.CustomerDatePicker,{r:A,today:R,value:U,events:I,onChange:e=>{G(e),V(null)}}),qe.map(e=>(0,O.jsx)(b.Banner,{kind:"demo",title:e.title,children:e.description},e.id))]}),(0,O.jsxs)(b.Card,{children:[(0,O.jsx)(b.H2,{children:"Time"}),0===Oe.length?(0,O.jsx)(b.Muted,{children:"Closed on this day (per listed kitchen hours)."}):(0,O.jsx)(b.Row,{wrap:!0,gap:6,children:Oe.map(e=>(0,O.jsx)(b.Chip,{testID:`book-slot-${e.time}`,label:e.time,sub:e.available?e.drinksOnly?'Drinks only':void 0:e.blocked?'Unavailable':e.noDog?'No dog table':e.leftV(e.time)},e.time))}),De.length>0&&Oe.some(e=>e.blocked)?(0,O.jsx)(b.Banner,{kind:"info",title:Ae?'Some times aren\u2019t available online':'Online booking isn\u2019t available for this time',children:`We\u2019re not taking online bookings ${De.map(e=>`${e.from}\u2013${e.to}`).join(', ')} on ${(0,k.niceDate)(Ce)}. Please give us a ring on ${A.phone??"the restaurant"} and we\u2019ll do our best to fit you in.`}):null,(()=>{const e=(0,n.lastFoodOn)(A,U);return e&&Oe.some(e=>e.drinksOnly)?(0,O.jsx)(b.Banner,{kind:"info",title:`Last food orders ${(0,n.fmt12)(e.time)}${'kitchen closes'!==e.reason?` (${e.reason})`:''}`,children:"Times marked \u201cDrinks only\u201d are after the kitchen\u2019s last food orders that day: you\u2019re welcome for drinks, but we can\u2019t serve food."}):null})(),ve&&Oe.some(e=>e.noDog)?(0,O.jsx)(b.Banner,{kind:"info",title:"Some times are full for dogs",children:`Times marked "No dog table" are full in the ${Pe.map(e=>e.name).join(' and ')}${A.settings.maxDogsPerSlot?' or already have the most dogs we can look after':''}${(0,T.closedAreasAt)(ye,A.id,U,Q??'12:00').size?', or the garden is closed for weather':''}. We\u2019d love to see you both, so please try one of the other times shown.`}):null,(0,O.jsx)(b.Muted,{children:(0,x.bookingLimitsHint)(A)})]}),(0,O.jsx)(P.MoreQuestions,{rid:A.id,r:A,value:ke,onChange:je,party:E,date:U,time:Q,today:(0,k.ymd)(R),bookings:fe,audience:"guest",showTables:!0}),(0,O.jsxs)(b.Card,{highlight:le?void 0:w.colours.amber,children:[(0,O.jsx)(b.Field,{label:"Notes (optional)",value:se,onChangeText:ae,placeholder:p.NOTES_PLACEHOLDER,multiline:!0,numberOfLines:3,testID:"book-notes"}),(0,O.jsx)(b.Toggle,{label:"I confirm the allergy information for this booking",value:le,onChange:ie}),(0,O.jsx)(b.Muted,{children:"Table requests aren\u2019t guaranteed, but we\u2019ll do our best. Nothing here is charged now; reserved dishes are paid on the night."})]}),(0,O.jsxs)(b.Card,{children:[(0,O.jsx)(b.H2,{children:"Your details"}),(0,O.jsx)(b.Field,{label:"Name for the booking",value:J,onChangeText:K}),(0,O.jsx)(b.Field,{testID:"book-phone",label:"Mobile number (needed to book)",value:X,onChangeText:Z,onBlur:()=>ne(!0),keyboardType:"phone-pad",autoComplete:"tel",placeholder:"e.g. 07700 900123"}),Fe.ok||!oe&&!X?null:(0,O.jsx)(b.T,{size:13,colour:w.colours.amber,children:Fe.error}),(0,O.jsx)(b.Field,{testID:"book-email",label:"Email (optional)",value:ee,onChangeText:te,keyboardType:"email-address",autoCapitalize:"none",autoComplete:"email",placeholder:"you@example.com"}),Le?null:(0,O.jsx)(b.T,{size:13,colour:w.colours.amber,children:"That email doesn\u2019t look quite right. Check it, or leave it blank."}),(0,O.jsxs)(b.Muted,{children:["We\u2019ll text you a confirmation",ee.trim()?' and email it too':'',", with how to change or cancel. We only use your number for this booking."]})]}),(0,O.jsx)(l.Honeypot,{value:F,onChange:L})]})}},1222,[843,1095,861,13,17,1223,963,85,841,1224,1108,777,845,851,1101,863,858,946,804,1175,848,993,996,1074,1103,1053,1225,8]); __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.Honeypot=function({value:t,onChange:n}){return(0,l.jsx)(o.default,{"aria-hidden":!0,pointerEvents:"none",style:{position:'absolute',left:-1e4,top:0,width:1,height:1,overflow:'hidden',opacity:0},children:(0,l.jsx)(e.TextInput,{testID:"hp-field",accessibilityLabel:"Leave this empty",value:t,onChangeText:n,tabIndex:-1,autoComplete:'off',name:'cc_extra_info','aria-hidden':!0})})};var e=r(d[0]);r(d[1]),r(d[2]);var t,n=r(d[3]),o=(t=n)&&t.__esModule?t:{default:t},l=r(d[4])},1223,[812,17,219,85,8]); -__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"maxChildren",{enumerable:!0,get:function(){return u}}),_e.ChildrenCount=function({party:e,value:t,onChange:o,depositsOn:h,testID:c="children-count",guest:p}){const f=u(e);if(f<1)return null;const x=Math.min(t,f);return(0,s.jsxs)(n.default,{style:{gap:6,alignItems:'center',width:'100%'},testID:c,children:[(0,s.jsx)(l.T,{size:17,weight:"semibold",center:!0,children:p?`How many of the ${e} are children?`:`Children in the ${e}`}),(0,s.jsx)(l.Stepper,{value:x,onChange:e=>o(Math.max(0,Math.min(f,e))),min:0,max:f,label:"children",testID:`${c}-stepper`,format:e=>e?String(e):'None'}),h?(0,s.jsx)(l.Muted,{center:!0,children:"Children never pay a deposit."}):null]})},r(d[0]);var e,t=r(d[1]),n=(e=t)&&e.__esModule?e:{default:e},l=r(d[2]),s=r(d[3]);const u=e=>Math.max(0,Math.round(Number(e)||0)-1)},1224,[17,85,777,8]); +__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"maxChildren",{enumerable:!0,get:function(){return o}}),_e.ChildrenCount=function({party:e,value:t,onChange:u,depositsOn:h,testID:c="children-count",guest:p}){const f=o(e);if(f<1)return null;const x=Math.min(t,f);return(0,s.jsxs)(n.default,{style:{gap:6,alignItems:'center',width:'100%'},testID:c,children:[(0,s.jsx)(l.T,{size:17,weight:"semibold",center:!0,children:p?`How many of the ${e} are children?`:`Children in the ${e}`}),(0,s.jsx)(l.Stepper,{value:x,onChange:e=>u(Math.max(0,Math.min(f,e))),min:0,max:f,label:"children",testID:`${c}-stepper`,format:e=>e?String(e):'None'}),h?(0,s.jsx)(l.Muted,{center:!0,children:"Children don't count towards the number that needs a deposit, and never pay."}):null]})},r(d[0]);var e,t=r(d[1]),n=(e=t)&&e.__esModule?e:{default:e},l=r(d[2]),s=r(d[3]);const o=e=>Math.max(0,Math.round(Number(e)||0)-1)},1224,[17,85,777,8]); __d(function(g,_r,_i,a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.CustomerDatePicker=function({r:e,today:m,value:D,events:x,onChange:f}){const p=(0,n.ymd)(m),j=(0,r.lastBookableDay)(p,e),[C,w]=(0,t.useState)(!1),[Y,k]=(0,t.useState)((0,i.slashDay)(D)),[I,P]=(0,t.useState)(D);I!==D&&(P(D),k((0,i.slashDay)(D)));const T=new Date(m);T.setHours(12,0,0,0);const $=Array.from({length:b},(e,t)=>{const s=new Date(T);return s.setDate(T.getDate()+t),s}).filter(e=>(0,n.ymd)(e)<=j),v=t=>!!(0,o.hoursFor)(e,t),F=(0,n.parseYmd)(D),[L,M]=(0,t.useState)(()=>({y:F.getFullYear(),m:F.getMonth()})),S=(new Date(L.y,L.m,1,12).getDay()+6)%7,R=new Date(L.y,L.m+1,0).getDate(),A=[...Array.from({length:S},()=>null),...Array.from({length:R},(e,t)=>new Date(L.y,L.m,t+1,12))];for(;A.length%7;)A.push(null);const z=(0,n.parseYmd)(j),W=L.y>m.getFullYear()||L.y===m.getFullYear()&&L.m>m.getMonth(),B=L.yM(({y:t,m:s})=>{const l=new Date(t,s+e,1);return{y:l.getFullYear(),m:l.getMonth()}}),_=Y===(0,i.slashDay)(D)?null:(0,r.typedBookDateProblem)(Y,p,e),O=e=>{f(e),w(!1)},G=(e,t)=>0===t?'Today':1===t?'Tomorrow':`${(0,n.dayShort)(e)} ${e.getDate()}`,N=$.some(e=>(0,n.ymd)(e)===D);return(0,h.jsxs)(l.default,{testID:"cust-date",style:{gap:10,alignItems:'center',width:'100%'},children:[(0,h.jsx)(l.default,{accessible:!0,accessibilityLiveRegion:"polite",testID:"cust-date-chosen",children:(0,h.jsx)(d.T,{center:!0,weight:"semibold",colour:c.colours.goldLight,children:`Booking for ${(0,n.niceDateYear)(F)}${v(F)?'':' (closed that day)'}`})}),(0,h.jsxs)(d.Row,{wrap:!0,gap:6,style:{justifyContent:'center'},children:[$.map((e,t)=>{const s=(0,n.ymd)(e),l=x.some(e=>e.date===s);return(0,h.jsx)(d.Chip,{testID:`cust-day-${s}`,label:G(e,t),sub:v(e)?l?'\u2605 event':void 0:'Closed',disabled:!v(e),selected:D===s,accessibilityLabel:`${(0,n.niceDate)(e)}${v(e)?l?', event':'':', closed'}`,onPress:()=>O(s)},s)}),N?null:(0,h.jsx)(d.Chip,{label:(0,n.niceDate)(F),sub:v(F)?void 0:'Closed',selected:!0,onPress:()=>w(!0),accessibilityLabel:`Chosen: ${(0,n.niceDateYear)(F)}. Opens the calendar`})]}),(0,h.jsxs)(l.default,{style:{width:'100%',maxWidth:360,gap:4},children:[(0,h.jsx)(d.Field,{label:"Any other date (DD/MM/YYYY)",testID:"cust-date-typed",value:Y,placeholder:"24/12/2026",keyboardType:"numbers-and-punctuation",maxLength:10,autoCapitalize:"none",autoCorrect:!1,style:{textAlign:'center'},accessibilityLabel:"Booking date, typed as day, month and four-digit year",onChangeText:t=>{const s=(0,i.slashDate)(t,Y);k(s);const l=(0,i.dayFromSlash)(s);l&&!(0,r.typedBookDateProblem)(s,p,e)&&f(l)}}),_&&Y.length>=10?(0,h.jsx)(d.T,{center:!0,size:15,colour:c.colours.amber,testID:"cust-date-problem",children:_}):null]}),(0,h.jsx)(d.Button,{kind:"secondary",label:C?'Hide calendar':'\ud83d\udcc5 Pick a date from a calendar',testID:"cust-date-cal",style:{minHeight:48},accessibilityLabel:C?'Hide the calendar':'Pick a date from a month calendar',onPress:()=>{C||M({y:F.getFullYear(),m:F.getMonth()}),w(!C)}}),C?(0,h.jsxs)(l.default,{testID:"cust-calendar",style:{borderWidth:1,borderColor:c.colours.border,borderRadius:14,padding:10,gap:6,backgroundColor:c.colours.surface2,width:'100%',maxWidth:420},children:[(0,h.jsx)(l.default,{style:{alignItems:'flex-end'},children:(0,h.jsx)(u.GoldClose,{label:"Close the calendar",testID:"cust-calendar-close",onPress:()=>w(!1),size:"sm"})}),(0,h.jsxs)(d.Row,{style:{justifyContent:'space-between',alignItems:'center'},children:[(0,h.jsx)(s.default,{accessibilityRole:"button",accessibilityLabel:"Previous month",accessibilityState:{disabled:!W},disabled:!W,onPress:()=>H(-1),style:{minWidth:48,minHeight:48,alignItems:'center',justifyContent:'center',opacity:W?1:.3},children:(0,h.jsx)(d.T,{size:22,colour:c.colours.gold,children:"\u2039"})}),(0,h.jsxs)(d.T,{center:!0,weight:"semibold",accessibilityRole:"header",children:[(0,n.monthLong)(L.m)," ",L.y]}),(0,h.jsx)(s.default,{accessibilityRole:"button",accessibilityLabel:"Next month",accessibilityState:{disabled:!B},disabled:!B,onPress:()=>H(1),style:{minWidth:48,minHeight:48,alignItems:'center',justifyContent:'center',opacity:B?1:.3},children:(0,h.jsx)(d.T,{size:22,colour:c.colours.gold,children:"\u203a"})})]}),(0,h.jsx)(l.default,{style:{flexDirection:'row'},importantForAccessibility:"no-hide-descendants",children:y.map(e=>(0,h.jsx)(d.T,{size:12,colour:c.colours.muted,center:!0,style:{flex:1},children:e},e))}),Array.from({length:A.length/7},(e,t)=>(0,h.jsx)(l.default,{style:{flexDirection:'row',gap:4},children:A.slice(7*t,7*t+7).map((e,t)=>{if(!e)return(0,h.jsx)(l.default,{style:{flex:1,height:44}},t);const o=(0,n.ymd)(e),i=oj,r=o===D,u=!v(e);return(0,h.jsx)(s.default,{testID:`cust-cal-${o}`,accessibilityRole:"button",accessibilityLabel:`${(0,n.niceDateYear)(e)}${i?', not bookable online':u?', closed':''}`,accessibilityState:{disabled:i||u,selected:r},disabled:i||u,onPress:()=>O(o),style:{flex:1,height:44,borderRadius:10,alignItems:'center',justifyContent:'center',borderWidth:o===p?1.5:0,borderColor:c.colours.gold,backgroundColor:r?c.colours.gold:'transparent',opacity:i?.3:1},children:(0,h.jsx)(d.T,{size:15,center:!0,weight:r?'bold':'regular',colour:r?c.colours.onGold:u?c.colours.muted:c.colours.text,style:u&&!i?{textDecorationLine:'line-through'}:void 0,children:e.getDate()})},t)})},t)),(0,h.jsxs)(d.Muted,{center:!0,children:["Crossed-out days: closed. ",(0,r.bookAheadUnlimited)(e)?`You can book up to ${(0,i.slashDay)(j)}.`:`Online booking is open up to ${(0,i.slashDay)(j)}.`]})]}):null]})};var t=_r(_d[0]),s=e(_r(_d[1])),l=e(_r(_d[2])),o=_r(_d[3]),n=_r(_d[4]),i=_r(_d[5]),r=_r(_d[6]),c=_r(_d[7]),d=_r(_d[8]),u=_r(_d[9]),h=_r(_d[10]);const y=['Mon','Tue','Wed','Thu','Fri','Sat','Sun'],b=14},1225,[17,385,85,862,863,1031,1226,804,777,779,8]); __d(function(g,_r,i,a,_m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"SERVER_MAX_DAYS_AHEAD",{enumerable:!0,get:function(){return n}}),e.bookAheadDays=r,Object.defineProperty(e,"bookAheadUnlimited",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"lastBookableDay",{enumerable:!0,get:function(){return u}}),e.typedBookDateProblem=function(n,r,o){const s=(n??'').trim();if(!s)return'Type a date as DD/MM/YYYY, for example 24/12/2026.';const l=(0,t.dayFromSlash)(s);if(!l)return'That isn\u2019t a date yet. Type it as DD/MM/YYYY, for example 24/12/2026.';if(lc){const[t,n,r]=c.split('-');return`Online booking is open up to ${r}/${n}/${t}. For later dates, please call us.`}return null};var t=_r(_d[0]);const n=366;function r(t){const r=Number(t?.settings?.onlineBookDaysAhead);return Number.isFinite(r)&&r>=1?Math.min(Math.round(r),n):n}const o=t=>r(t)>=n,s=(t,n)=>{const r=new Date(t+'T12:00:00Z');return r.setUTCDate(r.getUTCDate()+n),r.toISOString().slice(0,10)},u=(t,n)=>s(t,r(n))},1226,[1031]); __d(function(_g,_r,i,_a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return b}});var n=_r(_d[0]),t=_r(_d[1]),s=_r(_d[2]),a=e(_r(_d[3])),l=e(_r(_d[4])),r=_r(_d[5]),o=_r(_d[6]),d=_r(_d[7]),c=_r(_d[8]),u=_r(_d[9]),h=_r(_d[10]),g=_r(_d[11]),p=_r(_d[12]),f=_r(_d[13]);function b(){const{rid:e,did:b}=(0,t.useLocalSearchParams)(),j=(0,h.useRestaurant)(e),x=(0,h.useMenu)(e).find(e=>e.id===b),y=(0,h.useCustomer)(),m=(0,h.useRecipeCards)(e).find(e=>e.id===x?.recipeCardId),k=m?.signOff&&m.photo?(0,g.recipeCards)().photoSource(m.photo):null,v=(0,h.useStore)(e=>e.addLine),w=(0,n.useTakeawayMenu)(n=>n.byVenue[e]),S=(0,h.useStore)(n=>n.basket.restaurantId===e&&'table'===n.basket.mode),[C,B]=(0,s.useState)(()=>(x?.optionGroups??[]).filter(e=>e.required).map(e=>e.choices[0].id)),[$,I]=(0,s.useState)(1),[P,T]=(0,s.useState)(''),[L,O]=(0,s.useState)(!1),[D,A]=(0,s.useState)(!1),[M,R]=(0,s.useState)(!1),[q,_]=(0,s.useState)(!1),N=(0,s.useMemo)(()=>x?(0,c.effectiveAllergens)(x,C):{},[x,C]);if(!j||!x)return(0,f.jsx)(d.Screen,{title:"Not found",children:(0,f.jsx)(d.T,{children:"Dish not found."})});const G=(0,c.conflictsFor)(N,y.allergies),Y=(x.price??0)+(x.optionGroups??[]).flatMap(e=>e.choices).filter(e=>C.includes(e.id)).reduce((e,n)=>e+n.priceDelta,0),z=S||j.fictional?'on':(0,n.takeawayAvail)(x,w),F=x.soldOut||!x.signOff||null===x.price||'on'!==z,Q=(e,n)=>{const t=x.optionGroups.find(n=>n.id===e);B(e=>{const s=t.choices.map(e=>e.id);return t.multi?e.includes(n)?e.filter(e=>e!==n):[...e,n]:e.includes(n)&&!t.required?e.filter(e=>e!==n):[...e.filter(e=>!s.includes(e)),n]})},V=e=>{h.useStore.getState().basket.restaurantId!==j.id&&h.useStore.getState().startBasket(j.id,'takeaway'),v({itemId:x.id,qty:$,choiceIds:C,notes:P,override:e?{allergens:G.contains,at:(new Date).toISOString()}:void 0}),O(!1),_(!0)};return(0,f.jsxs)(d.Screen,{title:x.name,subtitle:j.name,right:(0,f.jsx)(o.BasketButton,{}),children:[k?(0,f.jsx)(a.default,{testID:"dish-photo",source:k,accessibilityLabel:`${x.name}${'example'===m?.origin?' (example photo)':''}`,style:{width:'100%',height:200,borderRadius:12},resizeMode:"cover"}):null,(0,f.jsxs)(d.Row,{wrap:!0,gap:6,children:[(0,f.jsx)(d.T,{weight:"bold",size:20,colour:p.colours.gold,children:null===x.price?x.priceNote:(0,u.gbp)(Y)}),x.dietary.map(e=>(0,f.jsx)(d.Badge,{kind:"ok",label:e},e))]}),(0,f.jsx)(d.T,{children:x.description}),G.contains.length?(0,f.jsx)(d.Banner,{kind:"danger",title:`Blocked: contains ${G.contains.map(c.allergenLabel).join(', ')}`,children:`You\u2019ve told us: ${y.allergies.filter(e=>G.contains.includes(e.allergen)).map(e=>`${(0,c.allergenLabel)(e.allergen)} \u2014 ${(0,c.severityLabel)(e.severity)}`).join('; ')}. This dish can\u2019t be added unless you deliberately override (for example, ordering for someone else).`}):null,G.may.length?(0,f.jsx)(d.Banner,{kind:"warn",title:`Warning: may contain ${G.may.map(c.allergenLabel).join(', ')}`,children:"Cross-contact is possible (e.g. shared fryer). Please speak to staff before ordering."}):null,(x.optionGroups??[]).map(e=>(0,f.jsxs)(d.Card,{children:[(0,f.jsxs)(d.T,{weight:"semibold",children:[e.name,e.required?' (required)':' (optional)']}),(0,f.jsx)(d.Row,{wrap:!0,gap:6,children:e.choices.map(n=>(0,f.jsx)(d.Chip,{label:n.label,sub:n.priceDelta?`+${(0,u.gbp)(n.priceDelta)}`:void 0,selected:C.includes(n.id),onPress:()=>Q(e.id,n.id)},n.id))})]},e.id)),(0,f.jsx)(d.Card,{children:(0,f.jsx)(r.AllergenPanel,{item:x,map:N,declared:y.allergies})}),j.fictional?null:(0,f.jsx)(d.AllergenNotice,{phone:j.phone}),(0,f.jsx)(d.Field,{label:"Notes for the kitchen (optional)",placeholder:"e.g. no gherkins",value:P,onChangeText:T}),(0,f.jsxs)(d.Row,{style:{justifyContent:'space-between'},children:[(0,f.jsx)(d.T,{weight:"semibold",children:"Quantity"}),(0,f.jsx)(d.Stepper,{value:$,onChange:I,label:"quantity"})]}),q?(0,f.jsx)(d.Banner,{kind:"success",title:"Added to basket",children:G.contains.length?'Allergy override recorded \u2014 the kitchen will see a large allergy alert.':'Carry on browsing or go to your basket.'}):null,F?(0,f.jsx)(d.Banner,{kind:"warn",children:x.soldOut||'sold-out'===z?'Sold out today.':'off'===z&&x.signOff&&null!==x.price?'This dish isn\u2019t on the takeaway menu. You can have it when you eat in.':x.signOff?'Price on the specials board \u2014 ask staff.':'Not available to order online until the head chef signs off its allergens.'}):G.contains.length?(0,f.jsxs)(l.default,{style:{gap:8},children:[(0,f.jsx)(d.Button,{kind:"secondary",label:"Choose something else",onPress:()=>t.router.back()}),(0,f.jsx)(d.Button,{kind:"danger",label:"Override and add anyway\u2026",onPress:()=>{A(!1),R(!1),O(!0)},testID:"override-open"})]}):(0,f.jsxs)(d.Row,{gap:8,children:[(0,f.jsx)(d.Button,{style:{flex:1},label:`Add ${$} to basket \xb7 ${(0,u.gbp)(Y*$)}`,onPress:()=>V(!1),testID:"add-to-basket"}),q?(0,f.jsx)(d.Button,{kind:"secondary",label:"Basket",onPress:()=>t.router.push('/customer/basket')}):null]}),(0,f.jsxs)(d.Sheet,{visible:L,onClose:()=>O(!1),title:"Allergy override",children:[(0,f.jsx)(d.Banner,{kind:"danger",title:`${x.name} contains ${G.contains.map(c.allergenLabel).join(', ')}`,children:`Your profile says: ${y.allergies.filter(e=>G.contains.includes(e.allergen)).map(e=>`${(0,c.allergenLabel)(e.allergen)} \u2014 ${(0,c.severityLabel)(e.severity)}`).join('; ')}.`}),(0,f.jsx)(d.Toggle,{label:"I understand this dish contains an allergen I have declared",value:D,onChange:A}),(0,f.jsx)(d.Toggle,{label:"It is for someone without this allergy, or I have spoken to staff",value:M,onChange:R}),(0,f.jsx)(d.Muted,{children:"The override is logged and shown to the kitchen as an allergy alert that must be acknowledged."}),(0,f.jsx)(d.Button,{kind:"danger",disabled:!D||!M,label:"Confirm override and add",onPress:()=>V(!0),testID:"override-confirm"})]})]})}},1227,[947,13,17,319,85,1228,1230,777,845,851,858,867,804,8]); diff --git a/customer-app/admin.html b/customer-app/admin.html index ffeace5fe3857a7f5bfee24820c21ae2d09574f7..1d5cc0df50f40d30a36fe5d375ebab03777c6908 100644 --- a/customer-app/admin.html +++ b/customer-app/admin.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/customer-app/customer.html b/customer-app/customer.html index ffeace5fe3857a7f5bfee24820c21ae2d09574f7..1d5cc0df50f40d30a36fe5d375ebab03777c6908 100644 --- a/customer-app/customer.html +++ b/customer-app/customer.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/customer-app/customer/anchorage.html b/customer-app/customer/anchorage.html index ffeace5fe3857a7f5bfee24820c21ae2d09574f7..1d5cc0df50f40d30a36fe5d375ebab03777c6908 100644 --- a/customer-app/customer/anchorage.html +++ b/customer-app/customer/anchorage.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/customer-app/customer/anchorage/book.html b/customer-app/customer/anchorage/book.html index ffeace5fe3857a7f5bfee24820c21ae2d09574f7..1d5cc0df50f40d30a36fe5d375ebab03777c6908 100644 --- a/customer-app/customer/anchorage/book.html +++ b/customer-app/customer/anchorage/book.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/customer-app/customer/anchorage/feedback.html b/customer-app/customer/anchorage/feedback.html index ffeace5fe3857a7f5bfee24820c21ae2d09574f7..1d5cc0df50f40d30a36fe5d375ebab03777c6908 100644 --- a/customer-app/customer/anchorage/feedback.html +++ b/customer-app/customer/anchorage/feedback.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/customer-app/customer/anchorage/gift.html b/customer-app/customer/anchorage/gift.html index ffeace5fe3857a7f5bfee24820c21ae2d09574f7..1d5cc0df50f40d30a36fe5d375ebab03777c6908 100644 --- a/customer-app/customer/anchorage/gift.html +++ b/customer-app/customer/anchorage/gift.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/customer-app/customer/anchorage/lost.html b/customer-app/customer/anchorage/lost.html index ffeace5fe3857a7f5bfee24820c21ae2d09574f7..1d5cc0df50f40d30a36fe5d375ebab03777c6908 100644 --- a/customer-app/customer/anchorage/lost.html +++ b/customer-app/customer/anchorage/lost.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/customer-app/customer/anchorage/loyalty.html b/customer-app/customer/anchorage/loyalty.html index ffeace5fe3857a7f5bfee24820c21ae2d09574f7..1d5cc0df50f40d30a36fe5d375ebab03777c6908 100644 --- a/customer-app/customer/anchorage/loyalty.html +++ b/customer-app/customer/anchorage/loyalty.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/customer-app/customer/anchorage/merch.html b/customer-app/customer/anchorage/merch.html index ffeace5fe3857a7f5bfee24820c21ae2d09574f7..1d5cc0df50f40d30a36fe5d375ebab03777c6908 100644 --- a/customer-app/customer/anchorage/merch.html +++ b/customer-app/customer/anchorage/merch.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/customer-app/customer/anchorage/offers.html b/customer-app/customer/anchorage/offers.html index ffeace5fe3857a7f5bfee24820c21ae2d09574f7..1d5cc0df50f40d30a36fe5d375ebab03777c6908 100644 --- a/customer-app/customer/anchorage/offers.html +++ b/customer-app/customer/anchorage/offers.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/customer-app/customer/anchorage/refer.html b/customer-app/customer/anchorage/refer.html index ffeace5fe3857a7f5bfee24820c21ae2d09574f7..1d5cc0df50f40d30a36fe5d375ebab03777c6908 100644 --- a/customer-app/customer/anchorage/refer.html +++ b/customer-app/customer/anchorage/refer.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/customer-app/customer/anchorage/waitlist.html b/customer-app/customer/anchorage/waitlist.html index ffeace5fe3857a7f5bfee24820c21ae2d09574f7..1d5cc0df50f40d30a36fe5d375ebab03777c6908 100644 --- a/customer-app/customer/anchorage/waitlist.html +++ b/customer-app/customer/anchorage/waitlist.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/customer-app/customer/anchorage/whatson.html b/customer-app/customer/anchorage/whatson.html index ffeace5fe3857a7f5bfee24820c21ae2d09574f7..1d5cc0df50f40d30a36fe5d375ebab03777c6908 100644 --- a/customer-app/customer/anchorage/whatson.html +++ b/customer-app/customer/anchorage/whatson.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/customer-app/customer/basket.html b/customer-app/customer/basket.html index ffeace5fe3857a7f5bfee24820c21ae2d09574f7..1d5cc0df50f40d30a36fe5d375ebab03777c6908 100644 --- a/customer-app/customer/basket.html +++ b/customer-app/customer/basket.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/customer-app/customer/profile.html b/customer-app/customer/profile.html index ffeace5fe3857a7f5bfee24820c21ae2d09574f7..1d5cc0df50f40d30a36fe5d375ebab03777c6908 100644 --- a/customer-app/customer/profile.html +++ b/customer-app/customer/profile.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/customer-app/demo.html b/customer-app/demo.html index ffeace5fe3857a7f5bfee24820c21ae2d09574f7..1d5cc0df50f40d30a36fe5d375ebab03777c6908 100644 --- a/customer-app/demo.html +++ b/customer-app/demo.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/customer-app/display.html b/customer-app/display.html index ffeace5fe3857a7f5bfee24820c21ae2d09574f7..1d5cc0df50f40d30a36fe5d375ebab03777c6908 100644 --- a/customer-app/display.html +++ b/customer-app/display.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/customer-app/index.html b/customer-app/index.html index 95ed8264d871bee613686e66e6ccb6d33c6682a8..39f2c7c4177d752ccd024b68e57ffd3b34645e39 100644 --- a/customer-app/index.html +++ b/customer-app/index.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/customer-app/kitchen.html b/customer-app/kitchen.html index ffeace5fe3857a7f5bfee24820c21ae2d09574f7..1d5cc0df50f40d30a36fe5d375ebab03777c6908 100644 --- a/customer-app/kitchen.html +++ b/customer-app/kitchen.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/customer-app/owner.html b/customer-app/owner.html index ffeace5fe3857a7f5bfee24820c21ae2d09574f7..1d5cc0df50f40d30a36fe5d375ebab03777c6908 100644 --- a/customer-app/owner.html +++ b/customer-app/owner.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/customer-app/staff.html b/customer-app/staff.html index ffeace5fe3857a7f5bfee24820c21ae2d09574f7..1d5cc0df50f40d30a36fe5d375ebab03777c6908 100644 --- a/customer-app/staff.html +++ b/customer-app/staff.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/customer-app/sw.js b/customer-app/sw.js index ce78f6a3475472130ae14d03945606b1530edcdb..181e00edf1827bc569009f3663772074db1aa47c 100644 --- a/customer-app/sw.js +++ b/customer-app/sw.js @@ -1,7 +1,7 @@ // Anchorage service worker: precache the app shell so it opens offline after the first visit. -const V = "cc-customer-2567020289"; +const V = "cc-customer-130d27d893"; const BASE = "/customer-app/"; -const PRECACHE = ["/customer-app/apple-touch-icon.png", "/customer-app/assets/assets/brand/anchorage-hero.0450b828e4f9c1f4456240096598f6f5.png", "/customer-app/assets/assets/brand/anchorage.fea5ce2f6fd18bf2950aa21c0980ed8e.png", "/customer-app/assets/assets/recipes/fishsupper.1609c58319e1e8721f5c639049fb054e.jpg", "/customer-app/assets/assets/recipes/lobster.2fb3485c8e372972099259017358c1b8.jpg", "/customer-app/assets/assets/recipes/moules.a4f342fc7e7fb62c8a0b5c1678bbea3f.jpg", "/customer-app/assets/assets/recipes/skink.4ce7b7c676f9cdcd0a060eda46f5a00e.jpg", "/customer-app/assets/assets/recipes/stp.1061ced765efdcafff2554adc3fc7113.jpg", "/customer-app/assets/assets/specials/sample-chalkboard.e7b4e4450a8483d4219bc6a214158d8f.jpg", "/customer-app/assets/node_modules/@expo-google-fonts/poppins/400Regular/Poppins_400Regular.093ee89be9ede30383f39a899c485a82.ttf", "/customer-app/assets/node_modules/@expo-google-fonts/poppins/500Medium/Poppins_500Medium.bf59c687bc6d3a70204d3944082c5cc0.ttf", "/customer-app/assets/node_modules/@expo-google-fonts/poppins/600SemiBold/Poppins_600SemiBold.6f1520d107205975713ba09df778f93f.ttf", "/customer-app/assets/node_modules/@expo-google-fonts/poppins/700Bold/Poppins_700Bold.08c20a487911694291bd8c5de41315ad.ttf", "/customer-app/assets/node_modules/expo-router/assets/arrow_down.017bc6ba3fc25503e5eb5e53826d48a8.png", "/customer-app/assets/node_modules/expo-router/assets/error.d1ea1496f9057eb392d5bbf3732a61b7.png", "/customer-app/assets/node_modules/expo-router/assets/file.19eeb73b9593a38f8e9f418337fc7d10.png", "/customer-app/assets/node_modules/expo-router/assets/forward.d8b800c443b8972542883e0b9de2bdc6.png", "/customer-app/assets/node_modules/expo-router/assets/pkg.ab19f4cbc543357183a20571f68380a3.png", "/customer-app/assets/node_modules/expo-router/assets/react-navigation/elements/back-icon-mask.0a328cd9c1afd0afe8e3b1ec5165b1b4.png", "/customer-app/assets/node_modules/expo-router/assets/react-navigation/elements/back-icon.35ba0eaec5a4f5ed12ca16fabeae451d.png", "/customer-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55.png", "/customer-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@2x.png", "/customer-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@3x.png", "/customer-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@4x.png", "/customer-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7.png", "/customer-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@2x.png", "/customer-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@3x.png", "/customer-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@4x.png", "/customer-app/assets/node_modules/expo-router/assets/react-navigation/elements/search-icon.286d67d3f74808a60a78d3ebf1a5fb57.png", "/customer-app/assets/node_modules/expo-router/assets/sitemap.412dd9275b6b48ad28f5e3d81bb1f626.png", "/customer-app/assets/node_modules/expo-router/assets/unmatched.20e71bdf79e3a97bf55fd9e164041578.png", "/customer-app/brand-logo.png", "/customer-app/favicon.ico", "/customer-app/icon-192.png", "/customer-app/icon-512.png", "/customer-app/icon-maskable-192.png", "/customer-app/icon-maskable-512.png", "/customer-app/manifest.webmanifest", "/customer-app/index.html", "/customer-app/_expo/static/js/web/bundle.js?v=2567020289b35540fd75a22cff9b61423890f30d0305a943e7923dc522c6877b"]; +const PRECACHE = ["/customer-app/apple-touch-icon.png", "/customer-app/assets/assets/brand/anchorage-hero.0450b828e4f9c1f4456240096598f6f5.png", "/customer-app/assets/assets/brand/anchorage.fea5ce2f6fd18bf2950aa21c0980ed8e.png", "/customer-app/assets/assets/recipes/fishsupper.1609c58319e1e8721f5c639049fb054e.jpg", "/customer-app/assets/assets/recipes/lobster.2fb3485c8e372972099259017358c1b8.jpg", "/customer-app/assets/assets/recipes/moules.a4f342fc7e7fb62c8a0b5c1678bbea3f.jpg", "/customer-app/assets/assets/recipes/skink.4ce7b7c676f9cdcd0a060eda46f5a00e.jpg", "/customer-app/assets/assets/recipes/stp.1061ced765efdcafff2554adc3fc7113.jpg", "/customer-app/assets/assets/specials/sample-chalkboard.e7b4e4450a8483d4219bc6a214158d8f.jpg", "/customer-app/assets/node_modules/@expo-google-fonts/poppins/400Regular/Poppins_400Regular.093ee89be9ede30383f39a899c485a82.ttf", "/customer-app/assets/node_modules/@expo-google-fonts/poppins/500Medium/Poppins_500Medium.bf59c687bc6d3a70204d3944082c5cc0.ttf", "/customer-app/assets/node_modules/@expo-google-fonts/poppins/600SemiBold/Poppins_600SemiBold.6f1520d107205975713ba09df778f93f.ttf", "/customer-app/assets/node_modules/@expo-google-fonts/poppins/700Bold/Poppins_700Bold.08c20a487911694291bd8c5de41315ad.ttf", "/customer-app/assets/node_modules/expo-router/assets/arrow_down.017bc6ba3fc25503e5eb5e53826d48a8.png", "/customer-app/assets/node_modules/expo-router/assets/error.d1ea1496f9057eb392d5bbf3732a61b7.png", "/customer-app/assets/node_modules/expo-router/assets/file.19eeb73b9593a38f8e9f418337fc7d10.png", "/customer-app/assets/node_modules/expo-router/assets/forward.d8b800c443b8972542883e0b9de2bdc6.png", "/customer-app/assets/node_modules/expo-router/assets/pkg.ab19f4cbc543357183a20571f68380a3.png", "/customer-app/assets/node_modules/expo-router/assets/react-navigation/elements/back-icon-mask.0a328cd9c1afd0afe8e3b1ec5165b1b4.png", "/customer-app/assets/node_modules/expo-router/assets/react-navigation/elements/back-icon.35ba0eaec5a4f5ed12ca16fabeae451d.png", "/customer-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55.png", "/customer-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@2x.png", "/customer-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@3x.png", "/customer-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@4x.png", "/customer-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7.png", "/customer-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@2x.png", "/customer-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@3x.png", "/customer-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@4x.png", "/customer-app/assets/node_modules/expo-router/assets/react-navigation/elements/search-icon.286d67d3f74808a60a78d3ebf1a5fb57.png", "/customer-app/assets/node_modules/expo-router/assets/sitemap.412dd9275b6b48ad28f5e3d81bb1f626.png", "/customer-app/assets/node_modules/expo-router/assets/unmatched.20e71bdf79e3a97bf55fd9e164041578.png", "/customer-app/brand-logo.png", "/customer-app/favicon.ico", "/customer-app/icon-192.png", "/customer-app/icon-512.png", "/customer-app/icon-maskable-192.png", "/customer-app/icon-maskable-512.png", "/customer-app/manifest.webmanifest", "/customer-app/index.html", "/customer-app/_expo/static/js/web/bundle.js?v=130d27d8931b8aa6c1ebcac095812f1b273684aaabe8e7bbfaeb59bb50f41d8f"]; // Hugging Face serves large files (fonts) through a redirect to its CDN. Browsers refuse to hand a *redirected* cached // response to a page, so store a plain copy instead (otherwise fonts, and so the app, fail to load offline). const plain = r => r.redirected ? r.blob().then(b => new Response(b, { status: 200, headers: { 'Content-Type': r.headers.get('Content-Type') || b.type || 'application/octet-stream' } })) : Promise.resolve(r); diff --git a/customer-app/team.html b/customer-app/team.html index ffeace5fe3857a7f5bfee24820c21ae2d09574f7..1d5cc0df50f40d30a36fe5d375ebab03777c6908 100644 --- a/customer-app/team.html +++ b/customer-app/team.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/display-app/_expo/static/js/web/bundle.js b/display-app/_expo/static/js/web/bundle.js index 3afd582bae09e9f3a9ac86b7f818d7d64374b677..03b71981ac379fe8aaacb79b592bf19b5e14d359 100644 --- a/display-app/_expo/static/js/web/bundle.js +++ b/display-app/_expo/static/js/web/bundle.js @@ -921,7 +921,7 @@ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{v __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"ANCHORAGE_PAY",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"ANCHORAGE_KITCHEN",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"ANCHORAGE_KITCHEN_OLD",{enumerable:!0,get:function(){return u}}),Object.defineProperty(e,"restaurants",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"demoMenus",{enumerable:!0,get:function(){return l}});var t=r(d[0]);const n={slotMinutes:15,slotCap:3,bufferMins:5,leadMins:20,takeawayPaused:!1,bookingCoversPerSlot:20,bookingSlotMinutes:15,deposit:{...r(d[1]).DEPOSIT_DEFAULT},stampTarget:8,stampReward:'Free dessert',stampMinSpend:1e3,capacityPerHour:48,walkInShare:.35,turnMins:75,orderAtTable:!0},o={tipsFrequency:'fortnightly',tipsAnchorPayday:'2026-11-02',tipsEndsDaysBefore:1,wagePayDay:28,wageCutoffDay:23,weekendRule:'none'},s={0:['12:30','19:00'],1:null,2:null,3:['12:00','19:00'],4:['12:00','19:00'],5:['12:00','20:00'],6:['12:00','20:00']},u={0:['12:30','20:00'],1:null,2:null,3:['12:00','19:00'],4:['12:00','19:00'],5:['12:00','20:30'],6:['12:00','20:30']},c=[{id:'anchorage',name:'The Anchorage',tagline:'Harbourside seafood & Scottish produce',location:'Harbour View, Dunure, South Ayrshire',fictional:!1,phone:'01292 502826',website:'anchoragedunure.com',kitchenHours:s,hoursNote:'Kitchen (food) hours from Gordon, 30 Oct 2026: closed Mon\u2013Tue. The closing time is last food orders. Bar hours not set.',settings:{...n,orderAtTable:!1,pay:o,cashUpRecord:[...t.ANCHORAGE_CASH_UP],bookingCoversPerStart:15,bookingPartiesPerStart:4,onlinePartyMin:1,onlinePartyMax:8,bookingNoticeMins:15,autoAcceptUpTo:8},sections:[]}],l=[]},838,[839,841]); __d(function(g,_r,_i,_a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"TAKINGS_FIELDS",{enumerable:!0,get:function(){return t}}),Object.defineProperty(_e,"NO_SERVICE_SPLIT",{enumerable:!0,get:function(){return n}}),Object.defineProperty(_e,"TAKINGS_KEYS",{enumerable:!0,get:function(){return r}}),_e.withTakingsFields=function(e){e=e.filter(e=>!n.includes(e.key));const r=new Set(e.map(e=>e.key)),o=t.filter(e=>!r.has(e.key)).map(e=>({...e}));if(!o.length)return e;const a=e.findIndex(e=>'cash'===e.key),i=a<0?e.length:a+1;return[...e.slice(0,i),...o,...e.slice(i)]},Object.defineProperty(_e,"grossOf",{enumerable:!0,get:function(){return o}}),Object.defineProperty(_e,"ANCHORAGE_CASH_UP",{enumerable:!0,get:function(){return a}}),_e.cashFieldsForRecord=function(e,t){if(!t?.length)return e;const n=new Set,r=[];for(const o of t){const t=i[o],a=t?.key??`cu-${o.toLowerCase().replace(/[^a-z0-9]+/g,'-').replace(/^-|-$/g,'')||'figure'}`,l=e.find(e=>e.key===a);r.push({...l,...t??{kind:'money'},key:a,label:o}),n.add(a)}return[...r,...e.filter(e=>!n.has(e.key))]},Object.defineProperty(_e,"DEFAULT_CASHUP_FIELDS",{enumerable:!0,get:function(){return l}}),Object.defineProperty(_e,"DEFAULT_SALES_FIELDS",{enumerable:!0,get:function(){return u}}),_e.parseAmount=function(t,n="money"){if('number'===n){const e=t.replace(/[\xa3\s]/g,'');return/^\d{1,6}$/.test(e)?Number(e):null}return(0,e.parseMoneyInput)(t)},Object.defineProperty(_e,"isBlank",{enumerable:!0,get:function(){return s}}),Object.defineProperty(_e,"ymdUTC",{enumerable:!0,get:function(){return c}}),Object.defineProperty(_e,"addDaysYmd",{enumerable:!0,get:function(){return y}}),_e.weekStartOf=function(e){const t=(d(e).getUTCDay()+6)%7;return y(e,-t)},_e.combinedTips=function(e){const t='number'==typeof e.cashTips?e.cashTips:null,n='number'==typeof e.cardTips?e.cardTips:null;return null==t&&null==n?null:Math.round(100*((t??0)+(n??0)))/100},Object.defineProperty(_e,"takings",{enumerable:!0,get:function(){return f}}),Object.defineProperty(_e,"missing",{enumerable:!0,get:function(){return m}}),_e.dailySeries=function(e,t,n,r=f){const o=new Map(e.filter(e=>e.confirmedAt).map(e=>[e.date,e]));return Array.from({length:n},(e,a)=>{const i=y(t,a-n+1),l=o.get(i);return{date:i,value:l?r(l.vals):null}})},_e.weekCompare=function(e,t,n="net"){const r=t=>{const r=e.find(e=>e.weekStart===t&&e.confirmedAt),o=r?.vals[n];return'number'==typeof o?o:null},o=r(t),a=r(y(t,-7)),i=null!=o&&null!=a&&0!==a?Math.round((o-a)/a*1e3)/10:null;return{now:o,prev:a,change:i}},_e.tipsPot=function(e,t,n,r){const o=t.filter(e=>'payout'===e.kind&&e.throughDate).sort((e,t)=>e.at.localeCompare(t.at)),a=o[o.length-1],i=a?y(a.throughDate,1):n,l=e.filter(e=>e.date>=i&&e.date<=r).sort((e,t)=>e.date.localeCompare(t.date)),u=t.filter(e=>'correction'===e.kind&&e.forDate&&e.forDate>=i&&e.forDate<=r&&(!a||e.at>a.at)),s=Math.round(100*(l.reduce((e,t)=>e+t.total,0)+u.reduce((e,t)=>e+t.amount,0)))/100;return{from:i,total:Math.max(0,s),days:l,corrections:u,lastPayout:a??null,history:o.slice().reverse()}},_e.shareByHours=function(e,t,n){return e>0&&t>0&&n>0?Math.round(e*(t/n)*100)/100:0},_e.cashLocked=function(e,t=Date.now()){return!(!e.onServer||!e.confirmedAt)&&!(e.unlockedUntil&&Date.parse(e.unlockedUntil)>t)},_e.changedFields=function(e,t){const n=e??{},r=t??{},o=[],a=n.vals??{},i=r.vals??{};for(const e of new Set([...Object.keys(a),...Object.keys(i)]))JSON.stringify(a[e])!==JSON.stringify(i[e])&&o.push(e);JSON.stringify(n.categories??null)!==JSON.stringify(r.categories??null)&&(n.categories||r.categories)&&o.push('categories');JSON.stringify(n.photos??[])!==JSON.stringify(r.photos??[])&&e&&t&&o.push('photos');return o},Object.defineProperty(_e,"dayTakingsOf",{enumerable:!0,get:function(){return p}}),Object.defineProperty(_e,"daysInMonth",{enumerable:!0,get:function(){return k}}),_e.addMonths=b,Object.defineProperty(_e,"monthName",{enumerable:!0,get:function(){return O}}),Object.defineProperty(_e,"shortDay",{enumerable:!0,get:function(){return C}}),Object.defineProperty(_e,"longDay",{enumerable:!0,get:function(){return D}}),_e.poundsWhole=function(e){const t=e<0,n=String(Math.round(Math.abs(e))).replace(/\B(?=(\d{3})+(?!\d))/g,',');return`${t?'-':''}\xa3${n}`},_e.monthTakings=function(e,t,n,r){const o=new Map;for(const n of e){if(n.rid!==t)continue;const e=p(n);null!=e&&o.set(n.date,e)}const a=Number(n.slice(0,4)),i=Number(n.slice(5,7)),l=k(a,i),u=Array.from({length:l},(e,t)=>{const a=`${n}-${String(t+1).padStart(2,'0')}`,i=o.get(a),l=null!=i&&a<=r?'recorded':a>r?'future':a===r?'pending':'missing';return{date:a,day:t+1,value:'recorded'===l?i:null,state:l}}),s=u.filter(e=>'recorded'===e.state),c=Math.round(100*s.reduce((e,t)=>e+(t.value??0),0))/100,d=s.reduce((e,t)=>!e||t.value>e.value?{date:t.date,value:t.value}:e,null),y=r.slice(0,7)===n,f=n0?Math.round((c-T)/T*100):null;return{ym:n,month:O(n),days:u,total:c,recorded:s.length,current:y,past:f,best:d,vsPct:D}},Object.defineProperty(_e,"firstTakingsMonth",{enumerable:!0,get:function(){return P}}),_e.canSeeMonthTakings=function(e,t,n={}){return!n.inStaffApp&&'owner'===e&&(t?'owner'===t.role||!0===t.ownerAccess:!n.live)},_e.ownerHomeLayout=function(e,t,n=!1){return!n&&'owner'===e&&(!t||'owner'===t.role||!0===t.ownerAccess)};var e=_r(_d[0]);const t=[{key:'gross',label:'Gross takings',kind:'money',fixed:!0,optional:!0},{key:'food',label:'Food takings (optional)',kind:'money',fixed:!0,optional:!0},{key:'drink',label:'Drink takings (optional)',kind:'money',fixed:!0,optional:!0}],n=['lunchGross','dinnerGross'],r=t.map(e=>e.key);const o=e=>'number'==typeof e.gross?e.gross:null,a=['Z total','Card total','Cash total','Paid out','Card tips','Cash tips'],i={'Z total':{key:'zTotal',kind:'money'},'Card total':{key:'card',kind:'money'},'Cash total':{key:'cash',kind:'money'},'Paid out':{key:'paidOut',kind:'money',optional:!0},'Card tips':{key:'cardTips',kind:'money',fixed:!0},'Cash tips':{key:'cashTips',kind:'money',fixed:!0}};const l=[{key:'card',label:'Card takings',kind:'money'},{key:'cash',label:'Cash takings',kind:'money'},{key:'paidOut',label:'Paid out',kind:'money',fixed:!0,optional:!0},...t,{key:'float',label:'Float (tills)',kind:'money'},{key:'cashTips',label:'Cash tips total',kind:'money',fixed:!0},{key:'cardTips',label:'Card tips total',kind:'money',fixed:!0},{key:'overUnder',label:'Over / under (discrepancy)',kind:'money'},{key:'notes',label:'Notes',kind:'text'}],u=[{key:'gross',label:'Gross sales',kind:'money'},{key:'net',label:'Net sales',kind:'money',fixed:!0},{key:'vat',label:'VAT',kind:'money'},{key:'covers',label:'Covers',kind:'number'},{key:'discounts',label:'Discounts',kind:'money'},{key:'refunds',label:'Refunds',kind:'money'}];const s=e=>null==e||''===e,c=e=>e.toISOString().slice(0,10),d=e=>new Date(`${e}T12:00:00Z`),y=(e,t)=>{const n=d(e);return n.setUTCDate(n.getUTCDate()+t),c(n)};const f=e=>{const t='number'==typeof e.card?e.card:null,n='number'==typeof e.cash?e.cash:null;return null==t&&null==n?null:(t??0)+(n??0)},m=(e,t)=>e.filter(e=>'text'!==e.kind&&!e.optional&&s(t[e.key])).map(e=>e.key);const p=e=>e.confirmedAt?o(e.vals)??f(e.vals):null,k=(e,t)=>new Date(Date.UTC(e,t,0)).getUTCDate();function b(e,t){const n=Number(e.slice(0,4)),r=Number(e.slice(5,7))-1+t;return`${n+Math.floor(r/12)}-${String((r%12+12)%12+1).padStart(2,'0')}`}const h=['January','February','March','April','May','June','July','August','September','October','November','December'],S=['Sun','Mon','Tue','Wed','Thu','Fri','Sat'],T=['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'],O=e=>h[Number(e.slice(5,7))-1]??'',C=e=>{const t=d(e);return`${S[t.getUTCDay()]} ${t.getUTCDate()} ${h[t.getUTCMonth()].slice(0,3)}`},D=e=>{const t=d(e);return`${T[t.getUTCDay()]} ${t.getUTCDate()} ${h[t.getUTCMonth()]}`};const P=(e,t)=>e.filter(e=>e.rid===t&&null!=p(e)).map(e=>e.date.slice(0,7)).sort()[0]??null},839,[840]); __d(function(g,r,_i,_a,m,e,d){"use strict";function t(t,n){const i=!(!n?.allowMinus||!String(t??'').trim().startsWith('-'));let s=String(t??'').replace(/,/g,'.');s=s.replace(/[^\d.]/g,'');const l=s.indexOf('.');if(l>=0){s=s.slice(0,l+1)+s.slice(l+1).replace(/\./g,'');const[t,n=""]=s.split('.');s=t+'.'+n.slice(0,2)}return(i?'-':'')+s}Object.defineProperty(e,'__esModule',{value:!0}),e.sanitiseMoneyTyping=t,e.parseMoneyInput=function(n){const i=String(n??''),s=i.trim().startsWith('-'),l=i.trim().replace(/^\xa3/,'').replace(/\xa3/g,'').replace(/\s/g,'').replace(/^-/,'');if(l&&/[^\d.,]/.test(l))return null;const c=t(n);if(!c||'.'===c)return null;if(!/^\d+(\.\d{0,2})?$/.test(c))return null;const u=Math.round(100*Number(c))/100;return Number.isFinite(u)?s?-u:u:null},Object.defineProperty(e,"onMoneyChange",{enumerable:!0,get:function(){return n}});const n=n=>i=>n(t(i))},840,[]); -__d(function(g,r,i,a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"DEPOSIT_DEFAULT",{enumerable:!0,get:function(){return e}}),_e.depositOf=function(t){const n=t?.deposit;return n&&'object'==typeof n?{on:n.on??e.on,...!0===n.needsConfirmation?{needsConfirmation:!0}:{},perPersonPence:Number.isFinite(n.perPersonPence)?Math.max(0,Math.round(n.perPersonPence)):n.needsConfirmation?0:e.perPersonPence,fromParty:Number.isFinite(n.fromParty)?Math.max(1,Math.round(n.fromParty)):n.needsConfirmation?1:e.fromParty,refundable:'boolean'==typeof n.refundable?n.refundable:null,cutoffHours:Number.isFinite(n.cutoffHours)?Math.max(0,Math.round(n.cutoffHours)):null,policy:'string'==typeof n.policy?n.policy.slice(0,600):'',wixLinksOn:!0===n.wixLinksOn,wixLinkHours:Number.isFinite(n.wixLinkHours)?Math.max(1,Math.min(168,Math.round(n.wixLinkHours))):48}:{...e}},_e.childrenIn=t,Object.defineProperty(_e,"adultsIn",{enumerable:!0,get:function(){return n}}),_e.depositDue=o,_e.depositWords=function(e,d,u,p=0){if(e.needsConfirmation&&!e.on)return[e.policy.trim()||'Deposit policy awaiting venue confirmation.'];if(e.needsConfirmation)return['Table deposit policy not set yet. Ticketed event deposits are separate and are not a table policy.'];const l=o(e,d,p);if(!l)return[];const c=[t(d,p)?`A deposit of ${s(l)} (${s(e.perPersonPence)} for each of the ${n(d,p)} adults; children are free) is needed for ${e.fromParty} or more guests.`:`A deposit of ${s(l)} (${s(e.perPersonPence)} per adult; children are free) is needed for ${e.fromParty} or more guests.`];!0===e.refundable?c.push(e.cutoffHours?`Refundable if you cancel at least ${e.cutoffHours} hours before your booking.`:'Refundable if you cancel.'):!1===e.refundable?c.push('The deposit is not refundable.'):c.push(`Ask ${u} about refunds.`);e.policy.trim()&&c.push(e.policy.trim());return c.push(e.wixLinksOn?`${u} will send you a link to pay the deposit securely through website bookings.`:`No payment is taken in the app yet: ${u} will tell you how to pay the deposit.`),c},_e.waiverOf=d,_e.depositState=u,_e.waiverText=p,_e.canWaiveDeposit=function(e){if(['cancelled','finished','noshow','declined'].includes(e.status??''))return!1;const t=l(e);return'PAID'!==t&&'FULLY_REFUNDED'!==t&&'PARTIALLY_REFUNDED'!==t&&'FREE'!==t&&('paid'!==e.depositLink?.state&&('NOT_PAID'===t||'PARTIALLY_PAID'===t?!d(e):'due'===u(e)))},_e.wixPayStatus=l,_e.knownPaid=c,_e.fromWixOrder=f,_e.estimatedWix=b,_e.depositBadge=m,_e.canTickDeposit=function(e){if(d(e))return!1;const t=l(e);return'NOT_PAID'!==t&&'PAID'!==t&&'FULLY_REFUNDED'!==t&&'PARTIALLY_REFUNDED'!==t&&('paid'!==e.depositLink?.state&&'due'===u(e))},_e.canSendDepositLink=function(e,t){return!(!t.wixLinksOn||l(e)||d(e))&&(!e.walkIn&&!['cancelled','finished','noshow','declined'].includes(e.status??'')&&('due'===u(e)&&'paid'!==e.depositLink?.state))},_e.depositTerms=function(e){const t=[];!0===e.refundable?t.push(e.cutoffHours?`The deposit is refundable if you cancel at least ${e.cutoffHours} hours before.`:'The deposit is refundable if you cancel.'):!1===e.refundable&&t.push('The deposit is not refundable.');e.policy.trim()&&t.push(e.policy.trim());return t.join(' ')},_e.depositLinkMessage=function(e){const t=(e.name||'').trim().split(/\s+/)[0]||'there',[n,o,d]=e.date.split('-').map(Number),u=new Date(n,(o||1)-1,d||1).toLocaleDateString('en-GB',{weekday:'long',day:'numeric',month:'long'}),p=e.expiresAt?new Date(e.expiresAt).toLocaleString('en-GB',{timeZone:'Europe/London',weekday:'long',day:'numeric',month:'long',hour:'numeric',minute:'2-digit',hourCycle:'h12'}).replace(/\s?(am|pm)$/i,e=>e.trim().toLowerCase()):'',l=[`Hello ${t}, thank you for booking ${e.venue} for ${e.partySize} on ${u} at ${e.time.slice(0,5)}.`,`To hold your table, please pay the ${s(e.amountPence)} deposit here: ${e.url}`];p&&l.push(`The link works until ${p}.`);e.terms?.trim()&&l.push(e.terms.trim());return l.push(`Thank you, ${e.venue}`),l.join('\n')},_e.depositView=D,_e.depositShort=function(e){const t=D(e,!1);return t?t.a11y.split(',')[0]:null};const e={on:!0,perPersonPence:1e3,fromParty:6,refundable:null,cutoffHours:null,policy:''};function t(e,t){const n=Math.max(0,Math.round(Number(e)||0)),o=Math.round(Number(t)||0);return Math.max(0,Math.min(n,o))}const n=(e,n)=>Math.max(0,Math.round(Number(e)||0)-t(e,n));function o(e,t,o=0){return!e.on||e.perPersonPence<=0||t`\xa3${(e/100).toFixed(e%100?2:0)}`;function d(e){const t=e.depositWaived;return t&&'object'==typeof t&&'string'==typeof t.by&&t.by?t:null}function u(e){if('deposit'!==e.security)return'none';const t=e.depositDue??e.depositPaid??0;return t?(e.depositPaid??0)>=t?'paid':d(e)?'waived':'due':'none'}function p(e){const t=new Date(e.at),n=!Number.isNaN(t.getTime())?t.toLocaleString('en-GB',{timeZone:'Europe/London',day:'2-digit',month:'2-digit',hour:'2-digit',minute:'2-digit',hourCycle:'h23'}).replace(',',''):'';return`Waived by ${e.by}${n?`, ${n}`:''}${e.note?.trim()?` (${e.note.trim()})`:''}`}function l(e){const t=e.wix?.paymentStatus;return t&&['FREE','NOT_PAID','PAID','PARTIALLY_PAID','PARTIALLY_REFUNDED','FULLY_REFUNDED'].includes(t)?t:null}function c(e){return'paid'===e.depositLink?.state&&(e.depositLink.paidPence??0)>0?e.depositLink.paidPence:e.depositPaidBy&&'Wix'!==e.depositPaidBy&&(e.depositPaid??0)>0&&!e.wix?.depositEstimated||f(e)&&(e.depositPaid??0)>0?e.depositPaid:null}function f(e){return'wix-order'===e.wix?.amountSource||'wix-order'===e.depositSource}function b(e){if(f(e)||!e.wix?.depositEstimated&&'estimate'!==e.depositSource)return null;const t=e.depositPaid??0;if(t<=0)return null;const n=e.partySize??0;return{pence:t,perHead:e.wix?.perPersonPence??(n?Math.round(t/n):0),party:n}}function m(e,t=s){const n=l(e),o=c(e),p=d(e);if(p&&'PAID'!==n&&(!e.depositPaidBy||!o)&&'paid'!==e.depositLink?.state&&'paid'!==u(e))return{label:`Deposit waived \xb7 ${p.by}`,kind:'neutral'};if(n&&'FREE'!==n){if(e.depositPaidBy&&o)return{label:`Deposit paid \xb7 ${t(o)}`,kind:'gold'};if('PAID'===n){if(o)return{label:`Deposit paid \xb7 ${t(o)}`,kind:'gold'};const n=b(e);return n?{label:n.party&&n.perHead?`Deposit paid (about ${t(n.pence)}, ${n.party} \xd7 ${t(n.perHead)})`:`Deposit paid (about ${t(n.pence)})`,kind:'gold'}:{label:'Deposit paid on website bookings',kind:'gold'}}return'PARTIALLY_PAID'===n?{label:o&&(e.depositDue??0)>o?`Part paid on website bookings \xb7 ${t(o)} of ${t(e.depositDue)}`:'Part paid on website bookings',kind:'amber'}:'NOT_PAID'===n?{label:(e.depositDue??0)>0?`Deposit not paid \xb7 ${t(e.depositDue)} due`:'Deposit not paid',kind:'amber'}:'FULLY_REFUNDED'===n?{label:'Deposit refunded on website bookings',kind:'neutral'}:{label:'Deposit part refunded on website bookings',kind:'neutral'}}const f=u(e);if('none'===f)return null;const m=e.depositLink;return'paid'===m?.state?{label:o?`Deposit paid on website bookings \xb7 ${t(o)}`:'Deposit paid on website bookings',kind:'gold'}:'paid'===f?{label:o?`Deposit paid \xb7 ${t(o)}`:'Deposit paid',kind:'gold'}:'open'===m?.state?{label:`Deposit link sent \xb7 waiting \xb7 ${t(m.amountPence??e.depositDue??0)}`,kind:'amber'}:'expired'===m?.state?{label:'Deposit link ran out \xb7 send a new one',kind:'amber'}:{label:`Deposit due \xb7 ${t(e.depositDue??0)}`,kind:'amber'}}function D(e,t,n=s){const o=m(e,n);if(!o)return null;const u=l(e),c=o.label.startsWith('Deposit paid');if(o.label.startsWith('Deposit waived')){const n=d(e);return{label:t?o.label:'Deposit waived',kind:'neutral',a11y:p(n).replace(/^Waived/,'Deposit waived'),note:t?p(n):void 0,paid:!1}}if(!t)return c?{label:'\u2713 Deposit paid',kind:'gold',a11y:'Deposit paid',paid:c}:'PARTIALLY_PAID'===u?{label:'Deposit part paid',kind:'amber',a11y:'Deposit part paid',paid:c}:'FULLY_REFUNDED'===u||'PARTIALLY_REFUNDED'===u?{label:'Deposit refunded',kind:'neutral',a11y:'Deposit refunded',paid:c}:'NOT_PAID'===u?{label:'Deposit not paid',kind:'amber',a11y:'Deposit not paid yet',paid:c}:{label:'Deposit due',kind:'amber',a11y:'Deposit due, not paid yet',paid:c};const D='PAID'===u?b(e):null,y=D&&D.perHead?`Website bookings shows paid; amount worked out at ${n(D.perHead)} a head`:f(e)&&c?'Amount from the website bookings order':void 0,P=o.label.replace(/ \xb7 /g,', ').replace(/\xd7/g,'times').replace(/[()]/g,'')+(y?`. ${y}`:'');return{label:o.label,kind:o.kind,a11y:P,note:y,paid:c}}},841,[]); +__d(function(g,r,i,a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"DEPOSIT_DEFAULT",{enumerable:!0,get:function(){return e}}),_e.depositOf=function(t){const n=t?.deposit;return n&&'object'==typeof n?{on:n.on??e.on,...!0===n.needsConfirmation?{needsConfirmation:!0}:{},perPersonPence:Number.isFinite(n.perPersonPence)?Math.max(0,Math.round(n.perPersonPence)):n.needsConfirmation?0:e.perPersonPence,fromParty:Number.isFinite(n.fromParty)?Math.max(1,Math.round(n.fromParty)):n.needsConfirmation?1:e.fromParty,refundable:'boolean'==typeof n.refundable?n.refundable:null,cutoffHours:Number.isFinite(n.cutoffHours)?Math.max(0,Math.round(n.cutoffHours)):null,policy:'string'==typeof n.policy?n.policy.slice(0,600):'',wixLinksOn:!0===n.wixLinksOn,wixLinkHours:Number.isFinite(n.wixLinkHours)?Math.max(1,Math.min(168,Math.round(n.wixLinkHours))):48}:{...e}},_e.childrenIn=t,Object.defineProperty(_e,"adultsIn",{enumerable:!0,get:function(){return n}}),_e.depositDue=o,_e.depositWords=function(e,d,u,p=0){if(e.needsConfirmation&&!e.on)return[e.policy.trim()||'Deposit policy awaiting venue confirmation.'];if(e.needsConfirmation)return['Table deposit policy not set yet. Ticketed event deposits are separate and are not a table policy.'];const l=o(e,d,p);if(!l)return[];const c=[t(d,p)?`A deposit of ${s(l)} (${s(e.perPersonPence)} for each of the ${n(d,p)} adults; children don't count towards the ${e.fromParty} and don't pay) is needed for ${e.fromParty} or more adults.`:`A deposit of ${s(l)} (${s(e.perPersonPence)} per adult; children don't count towards the ${e.fromParty} and don't pay) is needed for ${e.fromParty} or more adults.`];!0===e.refundable?c.push(e.cutoffHours?`Refundable if you cancel at least ${e.cutoffHours} hours before your booking.`:'Refundable if you cancel.'):!1===e.refundable?c.push('The deposit is not refundable.'):c.push(`Ask ${u} about refunds.`);e.policy.trim()&&c.push(e.policy.trim());return c.push(e.wixLinksOn?`${u} will send you a link to pay the deposit securely through website bookings.`:`No payment is taken in the app yet: ${u} will tell you how to pay the deposit.`),c},_e.waiverOf=d,_e.depositState=u,_e.waiverText=p,_e.canWaiveDeposit=function(e){if(['cancelled','finished','noshow','declined'].includes(e.status??''))return!1;const t=l(e);return'PAID'!==t&&'FULLY_REFUNDED'!==t&&'PARTIALLY_REFUNDED'!==t&&'FREE'!==t&&('paid'!==e.depositLink?.state&&('NOT_PAID'===t||'PARTIALLY_PAID'===t?!d(e):'due'===u(e)))},_e.wixPayStatus=l,_e.knownPaid=c,_e.fromWixOrder=f,_e.estimatedWix=b,_e.depositBadge=m,_e.canTickDeposit=function(e){if(d(e))return!1;const t=l(e);return'NOT_PAID'!==t&&'PAID'!==t&&'FULLY_REFUNDED'!==t&&'PARTIALLY_REFUNDED'!==t&&('paid'!==e.depositLink?.state&&'due'===u(e))},_e.canSendDepositLink=function(e,t){return!(!t.wixLinksOn||l(e)||d(e))&&(!e.walkIn&&!['cancelled','finished','noshow','declined'].includes(e.status??'')&&('due'===u(e)&&'paid'!==e.depositLink?.state))},_e.depositTerms=function(e){const t=[];!0===e.refundable?t.push(e.cutoffHours?`The deposit is refundable if you cancel at least ${e.cutoffHours} hours before.`:'The deposit is refundable if you cancel.'):!1===e.refundable&&t.push('The deposit is not refundable.');e.policy.trim()&&t.push(e.policy.trim());return t.join(' ')},_e.depositLinkMessage=function(e){const t=(e.name||'').trim().split(/\s+/)[0]||'there',[n,o,d]=e.date.split('-').map(Number),u=new Date(n,(o||1)-1,d||1).toLocaleDateString('en-GB',{weekday:'long',day:'numeric',month:'long'}),p=e.expiresAt?new Date(e.expiresAt).toLocaleString('en-GB',{timeZone:'Europe/London',weekday:'long',day:'numeric',month:'long',hour:'numeric',minute:'2-digit',hourCycle:'h12'}).replace(/\s?(am|pm)$/i,e=>e.trim().toLowerCase()):'',l=[`Hello ${t}, thank you for booking ${e.venue} for ${e.partySize} on ${u} at ${e.time.slice(0,5)}.`,`To hold your table, please pay the ${s(e.amountPence)} deposit here: ${e.url}`];p&&l.push(`The link works until ${p}.`);e.terms?.trim()&&l.push(e.terms.trim());return l.push(`Thank you, ${e.venue}`),l.join('\n')},_e.depositView=y,_e.depositShort=function(e){const t=y(e,!1);return t?t.a11y.split(',')[0]:null};const e={on:!0,perPersonPence:1e3,fromParty:6,refundable:null,cutoffHours:null,policy:''};function t(e,t){const n=Math.max(0,Math.round(Number(e)||0)),o=Math.round(Number(t)||0);return Math.max(0,Math.min(n,o))}const n=(e,n)=>Math.max(0,Math.round(Number(e)||0)-t(e,n));function o(e,t,o=0){return!e.on||e.perPersonPence<=0||n(t,o)`\xa3${(e/100).toFixed(e%100?2:0)}`;function d(e){const t=e.depositWaived;return t&&'object'==typeof t&&'string'==typeof t.by&&t.by?t:null}function u(e){if('deposit'!==e.security)return'none';const t=e.depositDue??e.depositPaid??0;return t?(e.depositPaid??0)>=t?'paid':d(e)?'waived':'due':'none'}function p(e){const t=new Date(e.at),n=!Number.isNaN(t.getTime())?t.toLocaleString('en-GB',{timeZone:'Europe/London',day:'2-digit',month:'2-digit',hour:'2-digit',minute:'2-digit',hourCycle:'h23'}).replace(',',''):'';return`Waived by ${e.by}${n?`, ${n}`:''}${e.note?.trim()?` (${e.note.trim()})`:''}`}function l(e){const t=e.wix?.paymentStatus;return t&&['FREE','NOT_PAID','PAID','PARTIALLY_PAID','PARTIALLY_REFUNDED','FULLY_REFUNDED'].includes(t)?t:null}function c(e){return'paid'===e.depositLink?.state&&(e.depositLink.paidPence??0)>0?e.depositLink.paidPence:e.depositPaidBy&&'Wix'!==e.depositPaidBy&&(e.depositPaid??0)>0&&!e.wix?.depositEstimated||f(e)&&(e.depositPaid??0)>0?e.depositPaid:null}function f(e){return'wix-order'===e.wix?.amountSource||'wix-order'===e.depositSource}function b(e){if(f(e)||!e.wix?.depositEstimated&&'estimate'!==e.depositSource)return null;const t=e.depositPaid??0;if(t<=0)return null;const n=e.partySize??0;return{pence:t,perHead:e.wix?.perPersonPence??(n?Math.round(t/n):0),party:n}}function m(e,t=s){const n=l(e),o=c(e),p=d(e);if(p&&'PAID'!==n&&(!e.depositPaidBy||!o)&&'paid'!==e.depositLink?.state&&'paid'!==u(e))return{label:`Deposit waived \xb7 ${p.by}`,kind:'neutral'};if(n&&'FREE'!==n){if(e.depositPaidBy&&o)return{label:`Deposit paid \xb7 ${t(o)}`,kind:'gold'};if('PAID'===n){if(o)return{label:`Deposit paid \xb7 ${t(o)}`,kind:'gold'};const n=b(e);return n?{label:n.party&&n.perHead?`Deposit paid (about ${t(n.pence)}, ${n.party} \xd7 ${t(n.perHead)})`:`Deposit paid (about ${t(n.pence)})`,kind:'gold'}:{label:'Deposit paid on website bookings',kind:'gold'}}return'PARTIALLY_PAID'===n?{label:o&&(e.depositDue??0)>o?`Part paid on website bookings \xb7 ${t(o)} of ${t(e.depositDue)}`:'Part paid on website bookings',kind:'amber'}:'NOT_PAID'===n?{label:(e.depositDue??0)>0?`Deposit not paid \xb7 ${t(e.depositDue)} due`:'Deposit not paid',kind:'amber'}:'FULLY_REFUNDED'===n?{label:'Deposit refunded on website bookings',kind:'neutral'}:{label:'Deposit part refunded on website bookings',kind:'neutral'}}const f=u(e);if('none'===f)return null;const m=e.depositLink;return'paid'===m?.state?{label:o?`Deposit paid on website bookings \xb7 ${t(o)}`:'Deposit paid on website bookings',kind:'gold'}:'paid'===f?{label:o?`Deposit paid \xb7 ${t(o)}`:'Deposit paid',kind:'gold'}:'open'===m?.state?{label:`Deposit link sent \xb7 waiting \xb7 ${t(m.amountPence??e.depositDue??0)}`,kind:'amber'}:'expired'===m?.state?{label:'Deposit link ran out \xb7 send a new one',kind:'amber'}:{label:`Deposit due \xb7 ${t(e.depositDue??0)}`,kind:'amber'}}function y(e,t,n=s){const o=m(e,n);if(!o)return null;const u=l(e),c=o.label.startsWith('Deposit paid');if(o.label.startsWith('Deposit waived')){const n=d(e);return{label:t?o.label:'Deposit waived',kind:'neutral',a11y:p(n).replace(/^Waived/,'Deposit waived'),note:t?p(n):void 0,paid:!1}}if(!t)return c?{label:'\u2713 Deposit paid',kind:'gold',a11y:'Deposit paid',paid:c}:'PARTIALLY_PAID'===u?{label:'Deposit part paid',kind:'amber',a11y:'Deposit part paid',paid:c}:'FULLY_REFUNDED'===u||'PARTIALLY_REFUNDED'===u?{label:'Deposit refunded',kind:'neutral',a11y:'Deposit refunded',paid:c}:'NOT_PAID'===u?{label:'Deposit not paid',kind:'amber',a11y:'Deposit not paid yet',paid:c}:{label:'Deposit due',kind:'amber',a11y:'Deposit due, not paid yet',paid:c};const y='PAID'===u?b(e):null,D=y&&y.perHead?`Website bookings shows paid; amount worked out at ${n(y.perHead)} a head`:f(e)&&c?'Amount from the website bookings order':void 0,P=o.label.replace(/ \xb7 /g,', ').replace(/\xd7/g,'times').replace(/[()]/g,'')+(D?`. ${D}`:'');return{label:o.label,kind:o.kind,a11y:P,note:D,paid:c}}},841,[]); __d(function(_g,_r,_i,_a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"SHAPES",{enumerable:!0,get:function(){return a}}),Object.defineProperty(_e,"shapeLabel",{enumerable:!0,get:function(){return o}}),Object.defineProperty(_e,"tableLabel",{enumerable:!0,get:function(){return s}}),Object.defineProperty(_e,"tableNumber",{enumerable:!0,get:function(){return u}}),_e.numberClashes=function(e){const t=new Map;for(const n of e){const e=u(n);t.set(e,[...t.get(e)??[],{name:n.name,areaId:n.areaId}])}const n=new Set,r=[];for(const[e,a]of t){if(a.length<2)continue;const t=new Map;a.forEach(e=>t.set(e.areaId,[...t.get(e.areaId)??[],e.name]));for(const e of t.values())e.length>1&&e.forEach(e=>n.add(e));t.size>1&&r.push(e)}return{sameArea:n,acrossAreas:r}},Object.defineProperty(_e,"liveTableLabel",{enumerable:!0,get:function(){return l}}),Object.defineProperty(_e,"FIXTURES",{enumerable:!0,get:function(){return i}}),Object.defineProperty(_e,"PLAN_W",{enumerable:!0,get:function(){return c}}),Object.defineProperty(_e,"PLAN_H",{enumerable:!0,get:function(){return b}}),Object.defineProperty(_e,"GRID",{enumerable:!0,get:function(){return m}}),Object.defineProperty(_e,"snap",{enumerable:!0,get:function(){return f}}),Object.defineProperty(_e,"clamp",{enumerable:!0,get:function(){return h}}),Object.defineProperty(_e,"fid",{enumerable:!0,get:function(){return g}}),Object.defineProperty(_e,"slug",{enumerable:!0,get:function(){return w}}),_e.sizeFor=y,Object.defineProperty(_e,"minFor",{enumerable:!0,get:function(){return x}}),Object.defineProperty(_e,"numOf",{enumerable:!0,get:function(){return O}}),Object.defineProperty(_e,"byNumber",{enumerable:!0,get:function(){return P}}),_e.newTable=j,_e.autoArrange=M,_e.placeNew=S,_e.rotate90=function(e){const t=e.x+e.w/2,n=e.y+e.h/2;return{...e,w:e.h,h:e.w,x:h(f(t-e.h/2),0,c-e.h),y:h(f(n-e.w/2),0,b-e.w)}},_e.normalisePlan=function(e){return{...e,fixtures:e.fixtures??[],tables:e.tables.map(e=>{const t=e.shape;let n='booth'===t||'rect'===t?'rect':'round'===t?'round':'square',{w:r,h:a}=e;if('square'===n||'round'===n){const e=Math.max(r,a);r=e,a=e}if(90===e.rot||270===e.rot){const e=r;r=a,a=e}return'rect'===n&&r===a&&(n='square'),{...e,shape:n,w:r,h:a,rot:0}})}},Object.defineProperty(_e,"SECTION_COLOURS",{enumerable:!0,get:function(){return I}}),_e.buildPlan=k,_e.anchoragePlan=$,_e.starterPlan=function(){return k({areas:[{name:'Main room',tables:[[1,2],[2,4],[3,6],[4,4],[5,2],[6,6]],fixtures:[A(450,600)]}]},['SV'])},Object.defineProperty(_e,"TEMPLATES",{enumerable:!0,get:function(){return v}}),_e.parseTableList=function(e){const t=[],n=[];let r;for(const a of e.split(/\r?\n/)){const e=a.trim();if(!e)continue;if(!/\d/.test(e)){r=e.replace(/[:\-\u2013]+$/,'').trim()||r;continue}const o=e.match(/^(?:table|tbl|tab|t)?\s*(?:no\.?|number|#)?\s*([a-z]?\d+[a-z]?)\b[^\d]*?(\d+)/i);if(!o){n.push(e);continue}const s=parseInt(o[2],10);!s||s>30?n.push(e):t.push({area:r,name:o[1].toUpperCase(),seats:s})}return{items:t,skipped:n}},Object.defineProperty(_e,"planCounts",{enumerable:!0,get:function(){return C}}),Object.defineProperty(_e,"tableDogOk",{enumerable:!0,get:function(){return B}}),Object.defineProperty(_e,"dogTables",{enumerable:!0,get:function(){return L}}),Object.defineProperty(_e,"areaOfTable",{enumerable:!0,get:function(){return q}}),_e.bestTables=E,Object.defineProperty(_e,"isBestTable",{enumerable:!0,get:function(){return _}}),_e.withSeedBest=function(e,t){if('anchorage'!==e||!t?.areas?.some(e=>void 0===e.best))return t;const n=$();return{...t,areas:t.areas.map(e=>{if(void 0!==e.best)return e;const r=n.areas.find(t=>t.id===e.id||t.name===e.name),a=(r?.best??[]).filter(n=>t.tables.some(t=>t.name===n&&t.areaId===e.id));return a.length?{...e,best:a}:e})}};var e,t=_r(d[0]),n=_r(d[1]),r=(e=n)&&e.__esModule?e:{default:e};const a=[{id:'square',label:'Square'},{id:'rect',label:'Rectangle'},{id:'round',label:'Round'}],o=e=>'rect'===e?'Rectangle':'round'===e?'Round':'Square',s=e=>/\d/.test(e.name)?(0,t.plainTableNumber)(e.name):(0,t.plainTableNumber)(e.label?.trim()||e.name),u=s;const l=(e,t)=>u(e),i=[{id:'bar',label:'Bar',w:300,h:50},{id:'wall',label:'Wall',w:250,h:25},{id:'door',label:'Door',w:100,h:25},{id:'window',label:'Window',w:200,h:25}],c=1e3,b=625,m=25,f=e=>Math.round(e/m)*m,h=(e,t,n)=>Math.max(t,Math.min(n,e));let p=0;const g=e=>`${e}-${Date.now().toString(36)}${(p++).toString(36)}`,w=e=>e.toLowerCase().replace(/[^a-z0-9]+/g,'-').replace(/^-|-$/g,'')||'area';function y(e){return e<=2?{shape:'square',w:75,h:75}:e<=4?{shape:'square',w:100,h:100}:e<=6?{shape:'rect',w:150,h:100}:e<=8?{shape:'rect',w:200,h:100}:e<=10?{shape:'rect',w:250,h:100}:{shape:'rect',w:300,h:100}}const x=e=>e<=2?1:Math.max(2,Math.ceil(e/2)),O=e=>{const t=e.match(/\d+/);return t?parseInt(t[0],10):9999},P=(e,t)=>O(e.name)-O(t.name)||e.name.localeCompare(t.name);function j(e,t,n,r){const a=y(n);return{id:`t-${e}-${g('x').slice(2)}`,name:e,areaId:t,shape:a.shape,minSeats:x(n),maxSeats:n,x:0,y:0,w:a.w,h:a.h,rot:0,online:!0,sectionId:r}}function M(e,t=125,n=75){const r=[...e].sort(P);if(!r.length)return r;let a=75;const o=e=>{const t=[];let n=[],a=0;for(const o of r){const r=(n.length?e:0)+o.w;n.length&&a+r>850&&(t.push(n),n=[],a=0),n.push(o),a+=(n.length>1?e:0)+o.w}return n.length&&t.push(n),t};let s=o(a);const u=(e,t)=>e.reduce((e,t)=>e+Math.max(...t.map(e=>e.h)),0)+t*(e.length-1);for(;u(s,a)>b-t-n&&a>25;)a-=25,s=o(a);const l=u(s,a),i=b-t-n,p=s.length>1?Math.min(150,a+Math.max(0,Math.floor((i-l)/(s.length-1)/m)*m)):0,g=s.reduce((e,t)=>e+Math.max(...t.map(e=>e.h)),0)+p*(s.length-1);let w=f(t+Math.max(0,(i-g)/2));const y=[];for(const e of s){const t=Math.max(...e.map(e=>e.h)),n=e.reduce((e,t)=>e+t.w,0)+a*(e.length-1);let r=f((c-n)/2);for(const n of e)y.push({...n,x:h(r,0,c-n.w),y:h(f(w+(t-n.h)/2),0,b-n.h),rot:0}),r+=n.w+a;w+=t+p}return y}function S(e,t,n=[]){const r=[...e,...n].map(e=>({x:e.x,y:e.y,w:e.w,h:e.h})),a=[];for(const e of t){let t=null;for(let n=50;n<=b-e.h-25&&!t;n+=m)for(let a=50;a<=c-e.w-25&&!t;a+=m){const o=50;r.some(t=>at.x&&nt.y)||(t={x:a,y:n})}const n=t??{x:50,y:50},o={...e,x:n.x,y:n.y};r.push({x:o.x,y:o.y,w:o.w,h:o.h}),a.push(o)}return a}const I=['#CFA45F','#E2C489','#A88B5A','#8C6A3A','#FFB547','#D9B98A'];function k(e,t=[]){const n=[],r=[],a=[],o=[];e.areas.forEach((e,s)=>{const u=w(e.name),l=e.best?e.best.map(String).filter(t=>e.tables.some(([e])=>String(e)===t)):void 0;n.push({id:u,name:e.name,dogs:!!e.dogs,outdoor:!!e.outdoor,...e.label?{label:e.label}:{},...e.colour?{colour:e.colour}:{},...l?{best:l}:{}});const i=`s-${u}`;o.push({id:i,name:e.name,colour:e.colour??I[s%I.length],server:t[s]??''});const m=(e.fixtures??[]).map((e,t)=>({...e,id:`fx-${u}-${t}`,areaId:u}));a.push(...m);const f=m.some(e=>e.y<100&&('bar'===e.kind||e.w>=300))?150:100,p=e.tables.map(([e,t])=>({...j(String(e),u,t,i),id:`t-${e}`})),g=e.layout??{},y=p.filter(e=>g[e.name]).map(e=>{const t=g[e.name],n=t.shape??(t.w===t.h?'square':'rect'),r=h(Math.round(t.w),50,c),a=h(Math.round('rect'===n?t.h:t.w),50,b);return{...e,shape:n,w:r,h:a,x:h(Math.round(t.x),0,c-r),y:h(Math.round(t.y),0,b-a),...t.label?{label:t.label}:{}}}),x=p.filter(e=>!g[e.name]);y.length?r.push(...y,...S(y,x,m)):r.push(...M(p,f,75))});const s=new Set(r.map(e=>e.name)),u=(e.joins??[]).filter(e=>e.every(e=>s.has(e))).map(e=>({id:`j-${e.join('-')}`,tables:e}));return{areas:n,tables:r,joins:u,sections:o,fixtures:a}}const T=(e,t,n=0,r=25)=>({kind:'window',x:e,y:n,w:t,h:r}),A=(e,t,n=100,r=25)=>({kind:'door',x:e,y:t,w:n,h:r});function $(){const e=r.default;return k({areas:e.areas.map(e=>({name:e.name,dogs:!!e.dogFriendly,outdoor:!(!e.outdoor&&!e.weatherDependent),label:e.label,colour:e.colour,tables:e.tables.map(([e,t])=>[e,t]),layout:e.layout,fixtures:[],best:e.best?.map(String)})),joins:e.joins??[]},e.areas.map(e=>e.server??''))}const v=[{id:'anchorage',name:'The Anchorage',sub:'4 areas \xb7 29 tables \xb7 119 seats',make:$},{id:'cafe',name:'Small caf\xe9',sub:'1 room \xb7 8 tables \xb7 dogs welcome',make:()=>k({areas:[{name:'Caf\xe9',dogs:!0,tables:[[1,2],[2,2],[3,4],[4,4],[5,2],[6,4],[7,2],[8,6]],fixtures:[{kind:'bar',x:300,y:25,w:400,h:50},A(450,600)]}]})},{id:'pub',name:'Pub with garden',sub:'Bar, lounge and beer garden',make:()=>k({areas:[{name:'Bar',dogs:!0,tables:[[1,2],[2,4],[3,4],[4,2],[5,4],[6,6]],fixtures:[{kind:'bar',x:250,y:25,w:500,h:75}]},{name:'Lounge',tables:[[7,4],[8,4],[9,2],[10,6],[11,4],[12,2],[13,4],[14,8]],fixtures:[T(150,700)]},{name:'Beer garden',dogs:!0,outdoor:!0,tables:[[20,6],[21,6],[22,4],[23,4],[24,6],[25,6]]}]})},{id:'restaurant',name:'Restaurant and terrace',sub:'Dining room with an outdoor terrace',make:()=>k({areas:[{name:'Dining room',tables:[[1,2],[2,2],[3,4],[4,4],[5,4],[6,6],[7,2],[8,2],[9,4],[10,4],[11,6],[12,8]],fixtures:[T(100,800),A(450,600)]},{name:'Terrace',outdoor:!0,tables:[[20,2],[21,4],[22,4],[23,2]]}]})},{id:'blank',name:'Blank',sub:'One empty room to start from',make:()=>k({areas:[{name:'Main room',tables:[]}]})}];const C=(e,t)=>{const n=t?e.tables.filter(e=>e.areaId===t):e.tables;return{tables:n.length,seats:n.reduce((e,t)=>e+t.maxSeats,0)}},B=(e,t)=>void 0!==t.dogOk?t.dogOk:!!e.areas.find(e=>e.id===t.areaId)?.dogs,L=e=>new Set(e.tables.filter(t=>B(e,t)).map(e=>e.name)),q=(e,t)=>e.areas.find(n=>n.id===e.tables.find(e=>e.name===t)?.areaId);function E(e,t){return e.areas.filter(e=>!t||e.id===t).flatMap(t=>(t.best??[]).filter(n=>e.tables.some(e=>e.name===n&&e.areaId===t.id)))}const _=(e,t)=>E(e).includes(t)},842,[843,844]); __d(function(g,r,i,a,m,e,d){"use strict";function t(t){const n=String(t??'').trim(),l=n.match(/\d+/g);return 1===l?.length?l[0].replace(/^0+(?=\d)/,''):n}Object.defineProperty(e,'__esModule',{value:!0}),e.plainTableNumber=t,Object.defineProperty(e,"tableNumbers",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"tableListNumbers",{enumerable:!0,get:function(){return l}}),e.tableNumbersA11y=function(t){const l=n(t).split('+').filter(Boolean);return l.length?`${1===l.length?'Table':'Tables'} ${l.join(', ')}`:'No table'},e.withTableWord=function(t){const n=t.trim();return!n||/^tables?\b/i.test(n)||/^no table\b/i.test(n)?n:`Table ${n}`};const n=n=>String(n??'').split('+').map(t).filter(Boolean).join('+'),l=(t,l=" + ")=>t.map(n).filter(Boolean).join(l)},843,[]); __d(function(e,a,l,r,t,o,s){t.exports={venue:"The Anchorage",note:"From Gordon 28 Oct 2026; layout from Gordon's floor-plan photo 29 Oct 2026 (positions, sizes, shapes, labels scaled from the photo, one scale for all areas). Photo shows MT12 and no MT8: table 8 replaced by 12. Gordon confirmed 29 Oct: no table 8; MT11 and MT12 both exist, MT11 keeps 2 seats, MT12 = 2 seats. No tables 4 or 8. No joined tables: Gordon confirmed 29 Oct that DT1 and DT2 are not joined.",areas:[{name:"Public Bar",label:"Dog friendly area (Public Bar), Area 1",colour:"#CFA45F",server:"BR",dogFriendly:!0,tables:[[1,4],[2,4],[3,5],[5,2],[6,4]],layout:{1:{label:"DT1",shape:"rect",x:600,y:125,w:205,h:90},2:{label:"DT2",shape:"rect",x:395,y:130,w:100,h:190},3:{label:"DT3",shape:"rect",x:205,y:120,w:110,h:245},5:{label:"DT5",shape:"square",x:500,y:395,w:105,h:105},6:{label:"DT6",shape:"rect",x:195,y:395,w:205,h:110}},best:[1,3]},{name:"Main Restaurant",label:"Main restaurant (no pets)",colour:"#8EC5FF",server:"SV",dogFriendly:!1,tables:[[7,5],[9,7],[10,4],[11,2],[12,2],[13,4],[14,4],[15,4],[16,2]],layout:{7:{label:"MT7",shape:"rect",x:590,y:410,w:225,h:115},9:{label:"MT9",shape:"rect",x:560,y:105,w:260,h:110},10:{label:"MT10",shape:"square",x:430,y:400,w:130,h:130},11:{label:"MT11",shape:"rect",x:545,y:270,w:115,h:90},12:{label:"MT12",shape:"rect",x:400,y:270,w:120,h:95},13:{label:"MT13",shape:"rect",x:400,y:100,w:90,h:115},14:{label:"MT14",shape:"rect",x:185,y:420,w:230,h:100},15:{label:"MT15",shape:"rect",x:190,y:220,w:165,h:145},16:{label:"MT16",shape:"rect",x:185,y:105,w:125,h:80}},best:[7,9]},{name:"Sitooterie",label:"Sitooterie (fully covered conservatory, no pets)",colour:"#C79BE8",server:"DM",dogFriendly:!1,tables:[[17,2],[18,6],[19,4],[20,6],[21,4],[22,4],[23,4]],layout:{17:{label:"ST17",shape:"square",x:760,y:325,w:110,h:110},18:{label:"ST18",shape:"rect",x:605,y:135,w:270,h:115},19:{label:"ST19",shape:"rect",x:460,y:160,w:105,h:150},20:{label:"ST20",shape:"rect",x:135,y:125,w:265,h:120},21:{label:"ST21",shape:"rect",x:120,y:305,w:110,h:175},22:{label:"ST22",shape:"rect",x:255,y:310,w:115,h:175},23:{label:"ST23",shape:"rect",x:410,y:350,w:110,h:155}},best:[19,21]},{name:"Beer Garden",label:"Outdoor beer garden (weather permitting, no shelter, pets allowed)",colour:"#B08D57",server:"GD",dogFriendly:!0,outdoor:!0,weatherDependent:!0,tables:[[24,4],[25,4],[26,4],[27,6],[28,6],[29,4],[30,4],[31,4]],layout:{24:{label:"BGT24",shape:"round",x:740,y:70,w:130,h:130},25:{label:"BGT25",shape:"round",x:515,y:50,w:135,h:135},26:{label:"BGT26",shape:"round",x:310,y:50,w:135,h:135},27:{label:"BGT27",shape:"rect",x:560,y:235,w:280,h:115},28:{label:"BGT28",shape:"rect",x:245,y:235,w:270,h:110},29:{label:"BGT29",shape:"rect",x:210,y:365,w:190,h:60},30:{label:"BGT30",shape:"rect",x:180,y:445,w:190,h:55},31:{label:"BGT31",shape:"rect",x:130,y:520,w:215,h:60}},best:[27,28]}],photoScale:1.8,joins:[],bestNote:"Best tables per area from Gordon, 1 Nov 2026: Bar 1 and 3; Restaurant 7 and 9; Sitooterie 19 and 21; Outside (Beer Garden) 27 and 28. Shown as BEST for walk-ins and bookings when they fit; editable per area in the table plan."}},844,[]); @@ -1059,7 +1059,7 @@ __d(function(g,r,i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule' __d(function(g,r,i,a,_m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.setClockServer=function(t){s=t,c()},e.markClockUnsent=function(t){o.set(t,Date.now()),c()},e.markClockSent=function(t){o.delete(t)&&c()},e.clockNotSent=l,e.useClockNotSent=function(o){const[,c]=(0,t.useState)(0);return(0,t.useEffect)(()=>{const t=()=>c(t=>t+1);u.add(t);const o=n.mutationQueue.subscribe(t);return()=>{u.delete(t),o()}},[]),l(o)};var t=r(d[0]),n=r(d[1]);const o=new Map,u=new Set,c=()=>{for(const t of u)t()};let s=()=>!1;function l(t){if(!t)return!1;return n.mutationQueue.pending.some(n=>'attendance'===n.table&&n.rowKey===t)||o.has(t)&&s()}n.mutationQueue.onDone(t=>{'attendance'===t.table&&o.delete(t.rowKey)&&c()})},976,[17,977]); __d(function(g,_r,i,a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"MutationQueue",{enumerable:!0,get:function(){return l}}),Object.defineProperty(_e,"mutationQueue",{enumerable:!0,get:function(){return o}});var t=_r(d[0]),e=_r(d[1]),s=_r(d[2]);const n='queue:v1',r='queue:failed:v1',h=t=>`${t.table}|${t.venueId}|${t.rowKey}`;class l{items=[];failedItems=[];loaded=null;flushing=null;flushingSince=0;exec=null;listeners=new Set;onFailure=new Set;onSaved=new Set;retryTimer=null;waitTimer=null;backoffMs=2e3;now=()=>Date.now();constructor(){(0,t.onConnectivity)(t=>{t&&this.flush()})}setExecutor(t){this.exec=t}load(){return this.loaded||(this.loaded=(async()=>{const t=await e.kv.get(n,[]);this.items=[...t.map(t=>({...t,nextAt:void 0})),...this.items],this.failedItems=await e.kv.get(r,[]),this.emit()})()),this.loaded}get pending(){return this.items}get waiting(){return this.items.filter(t=>t.attempts>0)}get failed(){return this.failedItems}hasPending(t,e,s){return this.items.some(n=>n.table===t&&n.venueId===e&&n.rowKey===s)}async enqueue(t){await this.load();const s={...t,id:(0,e.uuid)(),createdAt:(new Date).toISOString(),attempts:0};return this.items.push(s),await this.persist(),this.flush(),s}nextReady(){const t=new Set,e=this.now();for(const s of this.items){const n=h(s);if(!t.has(n)){if(!(s.nextAt&&s.nextAt>e))return s;t.add(n)}}}remove(t){this.items=this.items.filter(e=>e!==t)}flush(){if(this.flushing&&Date.now()-this.flushingSince<6e4)return this.flushing;this.flushingSince=Date.now();let e=null;return e=(async()=>{for(await this.load();this.exec;){if(this.flushing&&this.flushing!==e)return;const n=this.nextReady();if(!n)break;if(!(0,t.isOnline)()){this.scheduleRetry();break}try{const t=await this.exec(n);this.remove(n),this.backoffMs=2e3,'conflict'===t?this.fail(n,'conflict','Row changed on the server (version conflict) or is not visible to you'):this.onSaved.forEach(t=>t(n))}catch(e){n.attempts+=1,n.lastError=String(e?.message??e);const r=e??{};n.lastErr={code:r.code?String(r.code):void 0,status:Number(r.status)||void 0,message:n.lastError.slice(0,300)};const h=(0,s.classifyWriteError)(e);if('network'===h){n.attempts-=1,(0,t.setOnline)(!1),this.scheduleRetry(),await this.persist();break}'retry'===h?n.nextAt=this.now()+(0,s.retryDelayMs)(n.attempts):(this.remove(n),this.fail(n,'rejected',n.lastError))}await this.persist()}this.flushing===e&&(this.flushing=null),this.scheduleWaiting()})(),this.flushing=e,e}retryNow(){for(const t of this.items)t.nextAt=void 0;return this.flush()}subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}onFailed(t){return this.onFailure.add(t),()=>{this.onFailure.delete(t)}}onDone(t){return this.onSaved.add(t),()=>{this.onSaved.delete(t)}}async clearFailed(){this.failedItems=[],await e.kv.set(r,[]),this.emit()}fail(t,s,n){const h={...t,lastError:n,failedAt:(new Date).toISOString(),reason:s};this.failedItems=[h,...this.failedItems].slice(0,100),e.kv.set(r,this.failedItems),this.onFailure.forEach(t=>t(h))}scheduleWaiting(){this.waitTimer&&(clearTimeout(this.waitTimer),this.waitTimer=null);const t=this.items.map(t=>t.nextAt??0).filter(t=>t>0);if(!t.length)return;const e=Math.max(500,Math.min(...t)-this.now());this.waitTimer=setTimeout(()=>{this.waitTimer=null,this.flush()},e)}scheduleRetry(){if(this.retryTimer)return;const e=this.backoffMs;this.backoffMs=Math.min(2*this.backoffMs,6e4),this.retryTimer=setTimeout(()=>{this.retryTimer=null,(0,t.setOnline)(!0),this.flush()},e)}async persist(){await e.kv.set(n,this.items),this.emit()}emit(){this.listeners.forEach(t=>t())}}const o=new l},977,[974,936,978]); __d(function(g,r,i,a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.classifyWriteError=function(o){if((0,e.isNetworkError)(o))return'network';const{code:n,status:c,msg:l}=t(o);return s(o)?'refused':/^(08|53|57|58)/.test(n)||['40001','40P01','55P03','23505','23503'].includes(n)||/^PGRST30[0-3]$/.test(n)||/jwt|token.*expired/i.test(l)||401===c||408===c||425===c||429===c||c>=500?'retry':409!==c||n?'refused':'retry'},Object.defineProperty(_e,"retryDelayMs",{enumerable:!0,get:function(){return o}}),_e.describeWrite=function(e){const t='rpc'===e.kind?(e.fn??'change').replace(/_/g,' '):n[e.table]??e.table.replace(/_/g,' ').replace(/s$/,''),s=e.values??{},o=s.guest_name??s.name??s.display_name??s.title??s.reason,c='string'==typeof o&&o.trim()?` for ${o.trim().slice(0,60)}`:'';return'delete'===e.kind?`deleting a ${t}${c}`:`the ${t}${c}`},_e.plainReason=function(e,o){const{code:n,status:c,msg:l}=t(e);if('refused'===o)return s(e)?'more than 20 deletes in 10 minutes from one sign-in are stopped to keep your data safe':'42501'===n||403===c||/row-level security|permission/i.test(l)?'your sign-in isn\u2019t allowed to change this':'conflict'===n?'it was changed or removed on another device first':/^(22|23)/.test(n)?'the shared system says some of the details aren\u2019t valid':'P0001'===n&&l?l.slice(0,140):l?`the shared system said: ${l.slice(0,120)}`:'the shared system refused it';return'23505'===n?'the shared system already has another copy of it':'23503'===n?'a related change has to save first':/^PGRST30/.test(n)||401===c||/jwt/i.test(l)?'your sign-in is being refreshed':'the shared system is busy'};var e=r(d[0]);const t=e=>{const t=e&&'object'==typeof e?e:{};return{msg:String(t.message??e??''),code:String(t.code??''),status:Number(t.status??0)||0,hint:String(t.hint??'')}},s=e=>{const s=t(e);return/delete guard/i.test(s.hint)||/too many .* deleted in 10 minutes/i.test(s.msg)};const o=e=>Math.min(5e3*Math.pow(3,Math.max(0,e-1)),3e5),n={bookings:'booking',walk_ins:'walk-in',blocks:'blocked time',sold_out_items:'sold-out mark',sold_out_links:'dish stock link',staff:'staff details',rota_shifts:'rota shift',stock_items:'stock item',stock_events:'stock count',stock_counts:'stock count',chat_messages:'chat message',recipe_cards:'recipe card',order_lists:'order list',order_list_items:'order list item',daily_task_ticks:'task tick',daily_tasks:'daily task',attendance:'clock in or out',cash_ups:'cash-up',table_plans:'table plan',guest_profiles:'guest profile',floor_live:'table status',venues:'venue settings',time_requests:'clock correction request',staff_leave:'time off',scheduled_notifications:'reminder',suppliers:'supplier',supplier_orders:'supplier order',takeaway_orders:'takeaway order'}},978,[974]); -__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"APP_VERSION",{enumerable:!0,get:function(){return t}});const t='v0.3.12.192'},979,[]); +__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"APP_VERSION",{enumerable:!0,get:function(){return t}});const t='v0.3.12.193'},979,[]); __d(function(g,_r,i,a,_m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"TableRepository",{enumerable:!0,get:function(){return c}}),e.executeMutation=async function(t){const s=(t,s)=>{throw Object.assign(t,{status:s})};if('rpc'===t.kind){const{error:n,status:r}=await u().rpc(t.fn,t.values??{});return n&&s(n,r),'ok'}const n=u().from(t.table);if('upsert'===t.kind||'insert'===t.kind){const{error:r,status:o}=await n.upsert(t.values??{},{onConflict:t.conflictKey??'id',ignoreDuplicates:'insert'===t.kind});if(r&&'stock_events'===t.table&&'23503'===r.code&&/undoes/i.test(String(r.message??''))&&t.values?.undoes){t.values={...t.values,undoes:null};const r=await n.upsert(t.values,{onConflict:t.conflictKey??'id',ignoreDuplicates:'insert'===t.kind});return r.error&&s(r.error,r.status),'ok'}return r&&s(r,o),'ok'}let r='update'===t.kind?n.update(t.values??{}):n.delete();for(const[s,n]of Object.entries(t.match??{}))r=r.eq(s,n);const{data:o,error:c,status:l}=await r.select();c&&s(c,l);return'update'!==t.kind||o&&0!==o.length?'ok':'conflict'};var t=_r(d[0]),s=_r(d[1]),n=_r(d[2]),r=_r(d[3]),o=_r(d[4]);const u=()=>(0,n.getSupabase)();class c{constructor(t,s={}){this.table=t,this.opts=s,this.keyOf=s.keyOf??(t=>String(t.id)),this.keyColumns=s.keyColumns??['id'],this.venueCol=s.venueColumn??'venue_id'}rows(t){return s.cache.rows(this.table,t)}get(t,n){return s.cache.get(this.table,t,n)}subscribe(t,n){return s.cache.subscribe(this.table,t,n)}hydrate(t){return s.cache.hydrate(this.table,t)}async refresh(n,r={}){const c=()=>{let t=u().from(this.table).select('*').eq(this.venueCol,n);return this.opts.orderBy&&(t=t.order(this.opts.orderBy.column,{ascending:this.opts.orderBy.ascending??!0})),r.filter&&(t=r.filter(t)),t},l='bookings'===this.table?await(0,t.readPages)(async(t,s)=>{const{data:n,error:r}=await c().order('id').range(t,s);if(r)throw r;return n??[]}):await(async()=>{const{data:t,error:s}=await c().limit(this.opts.limit??1e3);if(s)throw s;return t??[]})();return s.cache.replace(this.table,n,l.map(t=>[this.keyOf(t),t]),t=>o.mutationQueue.hasPending(this.table,n,t)),l}async create(t,n){const u={...1===this.keyColumns.length&&'id'===this.keyColumns[0]?{id:(0,r.uuid)()}:{},...n,[this.venueCol]:t},c=this.keyOf(u);return s.cache.put(this.table,t,c,u),await o.mutationQueue.enqueue({table:this.table,venueId:t,kind:'insert'===this.opts.writeMode?'insert':'upsert',rowKey:c,values:u,conflictKey:this.opts.conflictKey??'id'}),u}async update(t,n,r,u={}){const c=s.cache.get(this.table,t,n),l={...this.matchFor(n,c),...u,[this.venueCol]:t};s.cache.patch(this.table,t,n,{...r,updated_at:(new Date).toISOString()}),await o.mutationQueue.enqueue({table:this.table,venueId:t,kind:'update',rowKey:n,values:r,match:l})}async remove(t,n){const r=s.cache.get(this.table,t,n),u={...this.matchFor(n,r),[this.venueCol]:t};s.cache.remove(this.table,t,n),await o.mutationQueue.enqueue({table:this.table,venueId:t,kind:'delete',rowKey:n,match:u})}matchFor(t,s){if(1===this.keyColumns.length&&'id'===this.keyColumns[0])return{id:t};const n={};for(const t of this.keyColumns)n[t]=s?.[t];return n}}},980,[981,982,892,936,977]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.readPages=async function(t,n=1e3){const s=[];for(let c=0;;c+=n){const o=await t(c,c+n-1);if(s.push(...o),o.length`cache:${t}:${n}`;function f(t){let s=n.get(t);return s||(s=new Map,n.set(t,s)),s}function p(n){s.delete(n),c.get(n)?.forEach(t=>t());const u=o.get(n);u&&clearTimeout(u),o.set(n,setTimeout(()=>{o.delete(n),t.kv.set(n,Array.from(f(n).entries()))},250))}const w={async hydrate(n,s){const c=l(n,s);if(u.has(c))return;u.add(c);const o=await t.kv.get(c,[]),w=f(c);let h=0;for(const[t,n]of o)w.has(t)||(w.set(t,n),h++);h&&p(c)},rows(t,n){const c=l(t,n);let o=s.get(c);return o||(o=Array.from(f(c).values()),s.set(c,o)),o},get:(t,n,s)=>f(l(t,n)).get(s),put(t,n,s,c){f(l(t,n)).set(s,c),p(l(t,n))},patch(t,n,s,c){const o=f(l(t,n)),u=o.get(s);u&&(o.set(s,{...u,...c}),p(l(t,n)))},remove(t,n,s){f(l(t,n)).delete(s)&&p(l(t,n))},replace(t,s,c,o=()=>!1){const u=l(t,s),w=f(u),h=new Map(c);w.forEach((t,n)=>{o(n)&&h.set(n,t)}),n.set(u,h),p(u)},subscribe(t,n,s){const o=l(t,n);let u=c.get(o);return u||(u=new Set,c.set(o,u)),u.add(s),()=>{u?.delete(s)}},async clearVenue(o,f){for(const p of f){const f=l(p,o);n.delete(f),s.delete(f),u.delete(f),await t.kv.remove(f),c.get(f)?.forEach(t=>t())}}}},982,[936]); @@ -1174,7 +1174,7 @@ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{v __d(function(g,_r,i,a,_m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.guardBookingChange=w,_e.saveTablesReported=async function(e,t,n,o,s,u){if(!w(u,{b:t,tables:n}))return!1;const v=n.length?(0,h.notSavedWhat)({...t,name:o,table:n.join('+')}):`Taking the table off ${o}`;u(`Saving ${v}\u2026`);try{await(0,b.saveBookingTables)(e,t,n)}catch(e){const t=`${v} did not save: ${String(e?.message??e).slice(0,120)}`;return u(t),(0,l.announce)(t),!1}const y=await(0,c.waitForBookingSave)(t.id);if('saved'===y.state||'local'===y.state){const e=(0,r.savedWords)(o,t.partySize,n,s);return u(e),(0,l.announce)(e),!0}const k='waiting'===y.state?`${v}: not saved yet. It saves by itself when the connection is back; a red banner shows if it fails.`:`${v} did not save. ${f("why"in y?y.why:"the shared system did not take it")}. Tap the red banner to try again.`;return u(k),(0,l.announce)(k),!1},_e.reportBookingSave=async function(e,t,n,o){const s=await(0,c.waitForBookingSave)(e);if('saved'===s.state||'local'===s.state)return o(t),(0,l.announce)(t),!0;const r='waiting'===s.state?`${n}: not saved yet. It saves by itself when the connection is back; a red banner shows if it fails.`:`${n} did not save. ${f('why'in s?s.why:'the shared system did not take it')}. Tap the red banner to try again.`;return o(r),(0,l.announce)(r),!1},_e.BookingSaveBanner=function({rid:e,testID:r="booking-save-banner",margin:c}){const b=(0,h.useBookingSaves)(e=>e.notSaved),w=(0,s.useBookings)(e).filter(e=>b[e.id]).map(e=>void 0!==b[e.id].want?{...e,table:b[e.id].want||void 0}:e),{msg:S,retry:$}=k(),m=(0,t.useRef)(''),p=w.map(e=>(0,h.notSavedLine)(e)),B=w.map(e=>e.id).sort().join(',');if((0,t.useEffect)(()=>{B&&B!==m.current&&(0,l.announce)(1===w.length?p[0]:`${w.length} booking changes did not save. Tap the red banner to try again.`),m.current=B},[B]),!w.length)return null;const j=1===w.length?p[0]:`${w.length} booking changes did not save. Tap to try again.`;return(0,y.jsx)(n.default,{testID:r,accessibilityRole:"button",accessibilityLiveRegion:"assertive",accessibilityLabel:`${j}${w.length>1?` ${w.map(e=>(0,h.notSavedWhat)(e)).join('. ')}.`:''} ${f(b[w[0].id].why)}.`,onPress:$,style:{...c??{},alignSelf:'stretch',gap:4,padding:12,borderRadius:12,borderWidth:2,borderColor:u.colours.red,backgroundColor:'#3a1210',alignItems:'center'},children:(0,y.jsxs)(o.default,{accessibilityRole:"alert",style:{alignItems:'center',gap:4},children:[(0,y.jsx)(v.T,{testID:`${r}-title`,size:17,weight:"semibold",center:!0,colour:"#FFD2CC",children:j}),w.length>1?w.slice(0,6).map(e=>(0,y.jsx)(v.T,{testID:`${r}-line`,size:15,center:!0,colour:"#FFD2CC",children:(0,h.notSavedWhat)(e)},e.id)):null,(0,y.jsx)(v.T,{testID:`${r}-why`,size:14,center:!0,colour:"#FFB3AA",children:w.length>1?`${f(b[w[0].id].why)}${w.length>6?` \xb7 and ${w.length-6} more`:''}`:f(b[w[0].id].why)}),S?(0,y.jsx)(v.T,{testID:`${r}-msg`,size:14,center:!0,colour:u.colours.goldLight,children:S}):null]})})},_e.BookingNotSavedLine=function({b:e}){const t=(0,h.useBookingSaves)(t=>t.notSaved[e.id]),{msg:o,retry:s}=k();if(!t)return null;void 0!==t.want&&(e={...e,table:t.want||void 0});return(0,y.jsxs)(n.default,{testID:`booking-not-saved-${e.id}`,accessibilityRole:"button",accessibilityLiveRegion:"assertive",accessibilityLabel:`${(0,h.notSavedLine)(e)} ${f(t.why)}.`,onPress:s,style:{alignSelf:'stretch',padding:8,borderRadius:10,borderWidth:1.5,borderColor:u.colours.red,backgroundColor:'#3a1210',alignItems:'center'},children:[(0,y.jsx)(v.T,{size:15,weight:"semibold",center:!0,colour:"#FFD2CC",children:(0,h.notSavedLine)(e)}),o?(0,y.jsx)(v.T,{size:13,center:!0,colour:u.colours.goldLight,children:o}):null]})};var t=_r(d[0]),n=e(_r(d[1])),o=e(_r(d[2])),s=_r(d[3]),r=_r(d[4]),l=_r(d[5]),c=_r(d[6]),h=_r(d[7]),u=_r(d[8]),b=_r(d[9]),v=_r(d[10]),y=_r(d[11]);const f=e=>e.charAt(0).toUpperCase()+e.slice(1);function w(e,t){const n=(0,c.bookingSaveBlocker)();if(!n)return!0;t&&h.useBookingSaves.getState().mark({id:t.b.id,table:t.b.walkIn?'walk_ins':'bookings',why:n,...t.tables?{want:t.tables.join('+')}:{}});const o=`${t?(0,h.notSavedWhat)({...t.b,...t.tables?{table:t.tables.join('+')||void 0}:{}}):'This change'} did not save: ${n}.`;return e?.(o),(0,l.announce)(o),!1}function k(){const[e,n]=(0,t.useState)('');return{msg:e,retry:async()=>{n('Saving\u2026'),(0,l.announce)('Saving');const e=await(0,c.saveBookingsNow)(!0),t=e?`Not saved: ${e}.`:h.useBookingSaves.getState().count()?'Sent again. The banner clears when the shared system takes it.':'Nothing is left waiting. Check the plan and make the change again if it is not there.';n(t),(0,l.announce)(t)}}}},1091,[17,385,85,858,1092,1093,946,984,804,1089,777,8]); __d(function(_g,r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"byNum",{enumerable:!0,get:function(){return s}}),e.tableKey=o,e.toggleTable=function(t,n){return t.includes(n)?t.filter(t=>t!==n):a(o([...t,n]))},e.seatsOf=function(t,n){const a={};for(const s of n)a[s]=t.tables.find(t=>t.name===s)?.maxSeats??0;return{per:a,total:Object.values(a).reduce((t,n)=>t+n,0)}},e.seatLine=function(t,n){const a=Math.max(0,n-t);return{text:`${t} ${1===t?'seat':'seats'} for ${l(n)}${a?`: ${a} short`:''}`,short:a,fits:0===a&&t>0}},e.pickClashes=u,e.requestedFreeTable=function(t,n,a,s,l=90){const o={id:n.id??'new',status:'confirmed',...n};for(const n of t)if(a.includes(n)&&!u(o,[n],s,l).length)return n;return null},e.overCapacityAsk=function(n,s,l){const u=a(o(n));if(!u.length||s>=l)return null;const c=u.map(n=>(0,t.tableNumbers)(n));return`${1===c.length?`Table ${c[0]} seats`:`Tables ${c.slice(0,-1).join(', ')} and ${c[c.length-1]} seat`} ${s} \u2013 this booking is ${l}. Use it anyway?`},e.clashWords=function(n){return n.map(n=>`${(0,t.tableNumbers)(n.table)} has ${n.with.walkIn?'a walk-in':(n.with.name||'a booking').replace(' (example)','')} at ${n.with.time}`).join('. ')+(n.length?'.':'')},e.tablesWords=c,e.pickA11y=function(n,a,s,l){return`Table ${(0,t.tableNumbers)(n)}, ${a} ${1===a?'seat':'seats'}${s?', selected':''}${l?`, has ${l.walkIn?'a walk-in':l.name} at ${l.time}`:''}`},e.pickGroups=function(t){return t.areas.map(n=>({area:n.name,tables:t.tables.filter(t=>t.areaId===n.id).map(t=>({name:t.name,seats:t.maxSeats})).sort((t,n)=>s(t.name,n.name))})).filter(t=>t.tables.length)},e.savedWords=function(t,n,a,s){return a.length?`${t}, ${l(n)}: ${c(a)} (${s} seats).`:`${t}: table taken off.`},e.tableActions=function(t,n){const s=a(t.table);if(['cancelled','noshow'].includes(t.status))return[];const o=[s.length?{id:'assign',label:'Change table',a11y:`Change table for ${n}, ${l(t.partySize)}, now ${c(s).toLowerCase()}. You can pick several tables to join.`}:{id:'assign',label:'Assign table',a11y:`Assign table for ${n}, ${l(t.partySize)}. You can pick several tables to join.`}];s.length&&o.push({id:'clear',label:'Clear table',a11y:`Clear table for ${n}, take ${c(s).toLowerCase()} off this booking`});return o},e.dragTables=function(t,n,s){if(!s||'__none'===s||s===n)return null;const l=a(t);if(l.includes(s))return null;return o('__none'!==n&&l.includes(n)?l.map(t=>t===n?s:t):[s])};var t=r(d[0]),n=r(d[1]);const a=t=>t?t.split('+').map(t=>t.trim()).filter(Boolean):[],s=(t,n)=>t.localeCompare(n,'en-GB',{numeric:!0}),l=t=>`${t} ${1===t?'person':'people'}`;function o(t){return[...new Set(t.map(t=>String(t).trim()).filter(Boolean))].sort(s).join('+')}function u(t,l,u,c=90){if(!l.length)return[];const f={...t,table:o(l)},b=[];for(const s of u)if(s.id!==t.id&&s.date===t.date&&!['cancelled','noshow','finished'].includes(s.status)&&(0,n.startOf)(f)<(0,n.endOf)(s,c)&&(0,n.startOf)(s)<(0,n.endOf)(f,c))for(const t of a(s.table))l.includes(t)&&b.push({table:t,with:s});return b.sort((t,n)=>s(t.table,n.table))}function c(n){const s=a(o(n));return s.length?(0,t.tableListNumbers)(s):'No table'}},1092,[843,1074]); __d(function(g,r,i,a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.primeAnnouncer=function(){u()},_e.announce=function(t){const e=String(t??'').trim();if(!e)return;{const t=u();if(!t)return;const n=++o;return t.textContent='',void setTimeout(()=>{n===o&&(t.textContent=e)},80)}},Object.defineProperty(_e,"lastAnnounced",{enumerable:!0,get:function(){return c}});var t,e=r(d[0]);(t=e)&&t.__esModule;r(d[1]);let n=null,o=0;function u(){if('undefined'==typeof document||!document.body)return null;if(n&&document.body.contains(n))return n;const t=document.createElement('div');return t.id='cc-announcer',t.setAttribute('aria-live','assertive'),t.setAttribute('aria-atomic','true'),t.setAttribute('role','status'),t.setAttribute('data-testid','cc-announcer'),Object.assign(t.style,{position:'absolute',width:'1px',height:'1px',margin:'-1px',padding:'0',overflow:'hidden',clip:'rect(0 0 0 0)',whiteSpace:'nowrap',border:'0'}),document.body.appendChild(t),n=t,t}const c=()=>n?.textContent??''},1093,[264,219]); -__d(function(g,_r,_i,_a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"TABLES",{enumerable:!0,get:function(){return A}}),_e.useTableNames=R,_e.resetTableLive=W,_e.seatBookingNow=async function(e,t){await k.repo.bookings.setStatus(t.id,'seated'),W(e,t.table)},_e.finishBookingNow=async function(e,t){const s=(new Date).toISOString();await k.repo.bookings.update(t.id,(0,N.finishClearPatch)(s,t.table)),(0,v.tablesOf)(t.table).forEach(t=>v.useFloor.getState().setLive(e,t,{stage:void 0,dirty:!0}))},_e.useTableUse=E,Object.defineProperty(_e,"walkInLabel",{enumerable:!0,get:function(){return _}}),_e.TablePicker=H,_e.WalkInSheet=q,_e.AssignTableSheet=V,_e.undoNotice=Y,_e.NewBookingSheet=G,_e.useFrontDoor=function(e,t){const[s,o]=(0,c.useState)(!1),[l,a]=(0,c.useState)(!1),[i,n]=(0,c.useState)(null);return{openWalkIn:()=>o({}),openWalkInAt:e=>o({table:e}),openBooking:()=>a(!0),assignTable:e=>n({b:e}),combineTables:e=>n({b:e,combine:!0}),elements:(0,F.jsxs)(F.Fragment,{children:[s?(0,F.jsx)(q,{wide:t,initialTable:s.table,onClose:()=>o(!1),onSeated:Y}):null,l?(0,F.jsx)(G,{wide:t,date:e,onClose:()=>a(!1),onSaved:e=>(0,u.notify)({id:`booked:${Date.now()}`,testID:'booking-saved-toast',timeoutMs:5e3,icon:'\u2713',title:`Booked: ${e.name} \xb7 ${(0,w.niceDate)((0,w.parseYmd)(e.date))} at ${e.time}`})}):null,i?(0,F.jsx)(V,{booking:i.b,combine:i.combine,onClose:()=>n(null)}):null]})}};var t=_r(_d[0]),s=_r(_d[1]),o=_r(_d[2]),l=_r(_d[3]),a=_r(_d[4]),i=_r(_d[5]),n=_r(_d[6]),r=_r(_d[7]),d=_r(_d[8]),u=_r(_d[9]),c=_r(_d[10]),b=e(c),h=_r(_d[11]),p=e(_r(_d[12])),m=e(_r(_d[13])),f=_r(_d[14]),y=_r(_d[15]),k=_r(_d[16]),x=_r(_d[17]),j=_r(_d[18]),w=_r(_d[19]),S=_r(_d[20]),T=_r(_d[21]),C=_r(_d[22]),v=_r(_d[23]),D=_r(_d[24]),I=_r(_d[25]),$=_r(_d[26]),P=_r(_d[27]),O=_r(_d[28]),B=_r(_d[29]),z=_r(_d[30]),M=_r(_d[31]),N=_r(_d[32]),F=_r(_d[33]);const L=e=>(0,u.notify)({id:'booking-blocked',testID:'booking-blocked-toast',timeoutMs:9e3,icon:'\u26a0',title:e}),A=Array.from({length:12},(e,t)=>String(t+1));function R(e){const t=(0,v.usePlan)(e);return t.areas.flatMap(e=>t.tables.filter(t=>t.areaId===e.id).map(e=>e.name))}function W(e,t){(0,v.tablesOf)(t).forEach(t=>v.useFloor.getState().setLive(e,t,{stage:'seated',dirty:!1}))}function E(e,t){const s=(0,k.useBookings)(e),o=(0,k.useOrders)(e),l=R(e),a=(0,v.useFloor)(t=>t.live[e])??{},i=(0,v.usePlan)(e),n=(0,D.useBlocks)(e=>e.blocks),r=(0,w.ymd)(t),d=(0,D.closedAreasAt)(n,e,r,(0,w.hm)(t)),u={};for(const e of l)u[e]=a[e]?.blocked||d.has(`tbl:${e}`)?{busy:!0,label:'Blocked'}:d.has(i.tables.find(t=>t.name===e)?.areaId??'')?{busy:!0,label:'Closed'}:a[e]?.dirty?{busy:!0,label:'Needs clearing'}:{busy:!1,label:'Free'};for(const e of s)if(e.date===r&&e.table)for(const s of(0,v.tablesOf)(e.table))if(u[s])if('seated'===e.status)u[s]={busy:!0,label:`${e.walkIn?'Walk-in':`${e.name.slice(0,1)}.`} \xb7 ${e.partySize}`};else if('confirmed'===e.status&&!u[s].busy){const o=(0,w.minsBetween)(t,new Date(`${e.date}T${e.time}:00`));o>=-15&&o<=90&&(u[s]={...u[s],soon:`Booked ${e.time}`})}for(const e of o)'table'===e.type&&e.tableNo&&u[e.tableNo]&&!['closed','cancelled','collected'].includes(e.status)&&!u[e.tableNo].busy&&(u[e.tableNo]={busy:!0,label:'Open order'});return u}const _=e=>e.walkIn?`Walk-in \xb7 ${e.partySize}`:`${e.name} \xb7 ${e.partySize}`;function H({use:e,value:t,onPick:s,big:o,best:a,dense:i,bestSet:n,picked:r}){const d=Object.keys(e),[u,b]=(0,c.useState)(0),h=i?6:8,f=i?64:o?92:76,y=u?Math.max(3,Math.floor((u+h)/(f+h))):0,k=y?Math.floor((u-h*(y-1))/y):f,x=new Set(n??[]),j=a?(0,v.tablesOf)(a)[0]:null;return(0,F.jsx)(m.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:h},testID:"table-picker",onLayout:e=>b(Math.floor(e.nativeEvent.layout.width)),children:d.map(o=>{const a=e[o],n=t===o||!!r?.includes(o),d=x.has(o),u=j===o&&!n,c=a.busy?['Blocked','Needs clearing','Closed'].includes(a.label)?a.label:'In use':a.soon??'Free';return(0,F.jsxs)(p.default,{accessibilityRole:"button",testID:`pick-table-${o}`,accessibilityLabel:`Table ${(0,l.tableNumbers)(o)}${r?n?', picked':', not picked':''}, ${a.busy?`in use (${a.label})`:a.soon?`free, ${a.soon}`:'free'}${d?', best table':''}${u?', suggested for this party':''}`,accessibilityState:{selected:n,disabled:'Closed'===a.label},disabled:'Closed'===a.label,onPress:()=>s(o),style:{width:k,minHeight:i?58:64,borderRadius:12,borderWidth:n||u?2.5:1.5,paddingVertical:i?3:6,paddingHorizontal:4,alignItems:'center',justifyContent:'center',gap:2,borderColor:n||u?S.colours.gold:a.busy?S.colours.red:S.colours.ok,backgroundColor:n?S.colours.goldTint:a.busy?S.colours.redBg:S.colours.surface2,opacity:'Closed'!==a.label||n?1:.55},children:[(0,F.jsxs)(m.default,{style:{flexDirection:'row',alignItems:'center',gap:4},children:[(0,F.jsx)(C.T,{weight:"bold",size:22,colour:n?S.colours.goldLight:S.colours.text,children:(0,l.tableNumbers)(o)}),d?(0,F.jsx)(m.default,{testID:"best-table",style:{backgroundColor:S.colours.gold,borderRadius:5,paddingHorizontal:4,paddingVertical:1},children:(0,F.jsx)(C.T,{size:11,weight:"bold",colour:S.colours.onGold,children:"BEST"})}):null]}),(0,F.jsx)(C.T,{size:i?13:14,colour:a.busy?'#FFD9D4':a.soon?'#FFE2A8':'#E2C489',center:!0,numberOfLines:1,children:c})]},o)})})}const U=[1,2,3,4,5,6,7,8];function q({onClose:e,onSeated:a,wide:i,initialTable:n}){const{rid:r,r:d,now:u}=(0,y.useCtx)(15e3),x=E(r,u),[T,I]=(0,c.useState)(2),[$,P]=(0,c.useState)(!1),[O,B]=(0,c.useState)(n??null),z=(0,v.usePlan)(r),N=(0,k.useBookings)(r),A=(0,D.useBlocks)(e=>e.blocks),R=(0,D.closedAreasAt)(A,r,(0,w.ymd)(u),(0,w.hm)(u)),_=b.default.useMemo(()=>{const e=Object.fromEntries(Object.entries(x).map(([e,t])=>[e,{status:t.busy?'seated':'free'}]));return(0,j.suggestTable)(z,N.filter(e=>e.date===(0,w.ymd)(u)),e,T,u,(0,j.turnFor)(T,d.settings.turnMins),90,void 0,{closed:R})?.table??null},[z,N,x,T,R.size,u.getTime()]);(0,c.useEffect)(()=>{O&&(0,v.tablesOf)(O).some(e=>'Closed'===x[e]?.label)&&B(null)},[O,R.size]);const[q,V]=(0,c.useState)(!1),[Y,G]=(0,c.useState)(''),K=(e,t=String(e),s=()=>{P(!1),I(e)})=>{const o='9+'===t?$:!$&&T===e;return(0,F.jsx)(p.default,{accessibilityRole:"button",accessibilityLabel:'9+'===t?'Party of 9 or more':`Party of ${e}`,accessibilityState:{selected:o},onPress:s,style:{width:i?58:60,height:i?58:56,borderRadius:14,borderWidth:2,borderColor:S.colours.gold,alignItems:'center',justifyContent:'center',backgroundColor:o?S.colours.gold:'transparent'},children:(0,F.jsx)(C.T,{weight:"bold",size:22,colour:o?S.colours.onGold:S.colours.gold,children:t})},t)},Q=(0,F.jsx)(s.PartySizeInput,{value:T,onChange:I,min:9,max:o.MAX_PARTY,label:"Walk-in party size",testID:"walkin-party-size"}),X=(0,F.jsxs)(m.default,{style:{gap:8,width:i?256:void 0},children:[(0,F.jsx)(C.T,{weight:"semibold",children:"How many people?"}),(0,F.jsxs)(m.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:8},testID:"walkin-party",children:[U.map(e=>K(e)),K(9,'9+',()=>{P(!0),I(e=>e>=9?e:9)})]}),$?Q:null]}),[J,Z]=(0,c.useState)(!1),ee=async(t=O)=>{if(!J&&(0,M.guardBookingChange)(L)){Z(!0);try{const s=await k.repo.bookings.seatWalkIn(r,T,t??void 0,Y);W(r,t??void 0),a(s),e()}finally{Z(!1)}}},te=(0,F.jsxs)(m.default,{style:{gap:8,flex:i?1:void 0,minWidth:0},children:[(0,F.jsxs)(C.Row,{style:{justifyContent:'space-between'},children:[(0,F.jsxs)(C.T,{weight:"semibold",children:["Table ",(0,F.jsx)(C.T,{colour:S.colours.muted,size:14,children:"(optional)"})]}),O?(0,F.jsx)(C.Button,{small:!0,kind:"ghost",label:"Clear table",onPress:()=>B(null)}):null]}),(0,F.jsx)(H,{use:x,value:O,onPick:e=>{x[e]&&!x[e].busy?ee(e):B(O===e?null:e)},big:i,dense:i,best:_,bestSet:(0,h.bestTables)(z)}),(0,F.jsxs)(C.Muted,{children:["Tap a free table to seat them there",_&&!O?` (suggested for ${T}: ${(0,l.tableNumbers)(_)})`:'',", or Seat for no table yet. BEST marks the venue\u2019s best tables."]})]});return(0,F.jsxs)(C.Sheet,{visible:!0,onClose:e,title:`Walk-in \xb7 ${(0,w.hm)(u)}`,maxWidth:i?1100:void 0,testID:"walkin-sheet",children:[(0,F.jsx)(C.Button,{label:`Seat walk-in \xb7 ${T} ${1===T?'person':'people'}${O?` \xb7 ${(0,l.tableNumbers)(O)}`:''}`,disabled:J,onPress:()=>{ee()},testID:"seat-walkin",style:{minHeight:52}}),i?(0,F.jsxs)(C.Row,{gap:16,style:{alignItems:'flex-start'},children:[X,te]}):(0,F.jsxs)(F.Fragment,{children:[X,te]}),(0,F.jsxs)(C.Row,{gap:10,wrap:!0,style:{alignItems:'center'},children:[q?(0,F.jsx)(t.TextInput,{accessibilityLabel:"Walk-in note",placeholder:"Note (optional), e.g. high chair",placeholderTextColor:"#7D776C",value:Y,onChangeText:G,style:[C.styles.input,{flex:1,minWidth:220}],autoFocus:!0}):(0,F.jsx)(C.Button,{small:!0,kind:"ghost",label:"Add a note (optional)",onPress:()=>V(!0)}),(0,F.jsx)(m.default,{style:{flex:1,minWidth:220},children:(0,F.jsxs)(C.Muted,{children:["No name needed. Counts in today's covers.",'staff'!==f.APP_VARIANT?' Using website bookings too? Mark the table there as well.':'']})})]})]})}function V({booking:e,onClose:t,combine:s}){const{rid:o,r:a,now:i}=(0,y.useCtx)(15e3),n=E(o,i),r=(0,v.usePlan)(o),d=(0,k.useBookings)(o),u=(0,v.tablesOf)(e.table),p=b.default.useMemo(()=>Object.fromEntries(Object.entries(n).map(([e,t])=>[e,u.includes(e)?{busy:!1,label:'This party',soon:'This party'}:t])),[n,e.table]),f=b.default.useMemo(()=>{const t=Object.fromEntries(Object.entries(p).map(([e,t])=>[e,{status:t.busy?'seated':'free'}]));return(0,j.suggestTable)(r,d.filter(e=>e.date===(0,w.ymd)(i)),t,e.partySize,i,(0,j.turnFor)(e.partySize,a.settings.turnMins),90,e.id)?.table??null},[r,d,p,e.partySize,i.getTime()]),[x,T]=(0,c.useState)(!!s||u.length>1),[D,I]=(0,c.useState)(u),$=e=>r.tables.find(t=>t.name===e)?.maxSeats??0,P=D.reduce((e,t)=>e+$(t),0),O=D.length>0&&P{if(!(0,M.guardBookingChange)(L))return;const l=(0,v.joinTables)(s);await k.repo.bookings.assignTable(e.id,l);u.filter(e=>!s.includes(e)).forEach(t=>v.useFloor.getState().setLive(o,t,{stage:void 0,dirty:'seated'===e.status})),'seated'===e.status&&W(o,l),t()},z=x?(0,F.jsxs)(m.default,{style:{gap:8},testID:"assign-table-tip",children:[(0,F.jsx)(m.default,{accessibilityLiveRegion:"polite",children:(0,F.jsx)(C.T,{size:17,weight:"semibold",colour:S.colours.text,children:D.length?`${(0,v.tablesLabel)((0,v.joinTables)(D))} \xb7 ${P} seats for ${e.partySize} Covers`:'No tables picked yet'})}),O?(0,F.jsx)(m.default,{testID:"combine-short",children:(0,F.jsxs)(C.T,{size:15,weight:"semibold",colour:"#FFD9D4",children:["Not enough seats yet: ",e.partySize-P," more needed. Add another table."]})}):null,(0,F.jsx)(C.T,{size:15,colour:S.colours.text,children:"Tap each table to add or remove it, then tap Done. All of them show as taken until the party has finished."}),(0,F.jsxs)(C.Row,{gap:8,wrap:!0,children:[(0,F.jsx)(C.Button,{label:"Done",testID:"combine-done",disabled:!D.length,accessibilityLabel:D.length?`Done, save ${(0,v.tableCardLabel)((0,v.joinTables)(D))}`:'Done',onPress:()=>B(D)}),(0,F.jsx)(C.Button,{kind:"ghost",label:"Cancel",onPress:t})]})]}):(0,F.jsx)(m.default,{style:{gap:8},testID:"assign-table-tip",children:(0,F.jsx)(C.T,{size:15,colour:S.colours.text,children:"Red tables are in use right now; you can still pick one (e.g. joining a table). BEST marks the venue\u2019s best tables. Big party? Tap Combine tables."})});return(0,F.jsxs)(C.Sheet,{visible:!0,onClose:t,title:`${x?'Combine tables':'Assign table'} \xb7 ${_(e)}`,testID:"assign-table-sheet",footer:z,children:[f&&!x?(0,F.jsx)(m.default,{testID:"assign-suggested",children:(0,F.jsxs)(C.T,{size:16,weight:"semibold",colour:S.colours.goldLight,accessibilityLabel:`Suggested for ${e.partySize}: ${(0,v.tableCardLabel)(f)}`,children:["Suggested for ",e.partySize,": ",(0,l.tableNumbers)(f)]})}):null,x?null:(0,F.jsx)(C.Button,{kind:"secondary",label:"Combine tables",testID:"combine-start",accessibilityLabel:"Combine tables: pick several tables for this party",onPress:()=>T(!0)}),(0,F.jsx)(H,{use:p,best:x?null:f,bestSet:(0,h.bestTables)(r),picked:x?D:void 0,onPick:x?e=>I(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]):async e=>{await B([e])}})]})}function Y(e){(0,u.notify)({id:`walkin:${e.id}`,testID:'walkin-toast',timeoutMs:6e3,title:`${_(e)} seated \xb7 ${e.table?`${(0,l.tableNumbers)(e.table)}`:'table to assign'} (${e.ref})`,actions:[{label:'Undo',testID:'undo-walkin',onPress:()=>k.repo.bookings.undoWalkIn(e.id)},{label:'OK',kind:'ghost'}]})}function G({date:e,onClose:t,wide:s,onSaved:u}){const{rid:b,r:h,now:p,role:f,meId:N}=(0,y.useCtx)(6e4);(0,d.useBlurOutside)();const A=(0,w.ymd)(p),[R,W]=(0,c.useState)(ee.blocks),[H,U]=(0,c.useState)(!1),[q,V]=(0,c.useState)(''),[Y,G]=(0,c.useState)(2),[K,Q]=(0,c.useState)(0),X=Math.min(K,Math.max(0,Y-1)),[J,Z]=(0,c.useState)(null),[ee,te]=(0,c.useState)(''),[se,oe]=(0,c.useState)(''),[le,ae]=(0,c.useState)(''),[ie,ne]=(0,c.useState)('phone'),[re,de]=(0,c.useState)((0,$.emptyNeeds)()),ue=(0,$.needsMissing)(re),[ce,be]=(0,c.useState)(null),ge=(0,v.usePlan)(b),he=(0,B.dogSetUp)(ge),pe=!0===re.dog&&he,me=re.dog?re.dogs:0,fe=(0,w.parseYmd)(R),ye=(0,j.turnFor)(Y,h.settings.turnMins),ke=E.filter(e=>e.date===R),xe=e=>(0,j.freeTablesAt)(ge,ke,Y,new Date(`${R}${(0,l.tableNumbers)(e)}:00`),ye,h.settings.turnMins,{dog:!0,closed:(0,D.closedAreasAt)(_,b,R,e)}),je=pe&&J?xe(J):[];(0,c.useEffect)(()=>{be(null)},[pe,J,Y]);const we=(0,x.bookingSlots)(h,fe,e=>E.filter(t=>t.date===R&&t.time===e&&'cancelled'!==t.status&&!t.walkIn).reduce((e,t)=>e+t.partySize,0),Y,R===(0,w.ymd)(p)?p:(0,w.addMins)(fe,0),e=>E.filter(t=>t.date===R&&t.time===e&&'cancelled'!==t.status&&!t.walkIn).length),Se=(0,T.guestPhone)(se),[Te,Ce]=(0,c.useState)(!1),ve=J?we.find(e=>e.time===J):void 0,De=ve&&ve.left=2&&!!J&&(!$e||Te)&&(0,o.validParty)(Y)&&Se.ok&&(0,T.emailOk)(le)&&(!Pe||Oe&&H)&&(!pe||je.length>0)&&!Be,Me=re.wheelchair>0||re.stepFree;return(0,F.jsxs)(C.Sheet,{visible:!0,onClose:t,title:`New booking \xb7 ${(0,w.niceDate)(fe)}`,maxWidth:s?760:void 0,testID:"booking-sheet",children:[(0,F.jsx)($.FirstQuestions,{rid:b,value:re,onChange:de,party:Y,audience:"staff"}),re.dog&&!he?(0,F.jsx)(C.T,{size:13,colour:S.colours.amber,children:"Dog-friendly tables aren\u2019t marked yet. Managers \u203a Booking options \u203a Tables. Booking is allowed; check where the dog can sit."}):null,(0,F.jsx)(I.BookingDatePicker,{r:h,today:p,value:R,onChange:e=>{e!==R&&(W(e),Z(null),U(!1))}}),(0,F.jsxs)(C.Row,{gap:6,children:[(0,F.jsx)(C.Chip,{label:"Phone",selected:'phone'===ie,onPress:()=>ne('phone')}),(0,F.jsx)(C.Chip,{label:"In person",selected:'in-person'===ie,onPress:()=>ne('in-person')})]}),(0,F.jsx)(C.Field,{label:"Name",value:q,onChangeText:V,placeholder:"e.g. Reid",testID:"nb-name"}),(0,F.jsx)(C.Field,{label:"Mobile or phone number (needed)",value:se,onChangeText:oe,keyboardType:"phone-pad",placeholder:"e.g. 07700 900123",testID:"nb-phone"}),!Se.ok&&se?(0,F.jsx)(C.T,{size:13,colour:S.colours.amber,children:Se.error}):null,(0,F.jsx)(C.Field,{label:"Email (optional)",value:le,onChangeText:ae,keyboardType:"email-address",autoCapitalize:"none",placeholder:"For an email confirmation too",testID:"nb-email"}),(0,T.emailOk)(le)?null:(0,F.jsx)(C.T,{size:13,colour:S.colours.amber,children:"That email doesn\u2019t look quite right."}),(0,F.jsx)(n.AdultsChildren,{value:(0,r.peopleOf)(Y,X),onChange:e=>{G(e.partySize),Q(e.children),Ce(!1)},depositsOn:(0,i.depositOf)(h.settings).on&&(0,i.depositOf)(h.settings).perPersonPence>0,testID:"nb-people"}),(0,F.jsx)(C.Row,{wrap:!0,gap:6,children:we.map(e=>{const t=pe&&e.available&&!xe(e.time).length||!(0,$.dogTimeOk)(h,E,R,e.time,me);return(0,F.jsx)(C.Chip,{testID:`nb-slot-${e.time}`,label:e.time,sub:(0,D.blockAt)(_,b,R,e.time)?'Paused':t?'Dogs full':e.drinksOnly?'Drinks only':null!=e.partiesLeft&&e.partiesLeft<1||e.left<=0?'Full':`${e.left} left`,disabled:(e.past??!e.available)||t,selected:J===e.time,onPress:()=>{Z(e.time),U(!1),Ce(!1)}},e.time)})}),$e?(0,F.jsxs)(m.default,{testID:"nb-over-capacity",accessible:!0,accessibilityLiveRegion:"polite",style:{borderWidth:1.5,borderColor:S.colours.amber,backgroundColor:S.colours.amberBg,borderRadius:12,padding:10,gap:6},children:[De?(0,F.jsx)(C.T,{weight:"semibold",colour:S.colours.amber,children:(0,o.overCapacityNote)(Y,De.left,De.time)}):null,Ie?(0,F.jsx)(C.T,{weight:"semibold",colour:S.colours.amber,children:(0,o.overPartiesNote)(Ie.time,Ie.cap)}):null,(0,F.jsx)(C.Chip,{label:Te?'Booking over the limit: on':'Book anyway (over the limit)',selected:Te,onPress:()=>Ce(e=>!e),testID:"nb-over-ok"})]}):null,pe&&J?(0,F.jsxs)(m.default,{style:{gap:6},testID:"nb-dog-tables",children:[(0,F.jsxs)(C.T,{size:14,weight:"semibold",children:["Dog-friendly table ",(0,F.jsxs)(C.T,{size:13,colour:S.colours.muted,children:["(",ge.areas.filter(e=>e.dogs).map(e=>e.name).join(' or '),")"]})]}),je.length?(0,F.jsx)(C.Row,{wrap:!0,gap:6,children:je.slice(0,10).map((e,t)=>(0,F.jsx)(C.Chip,{label:`${(0,l.tableNumbers)(e.table)}`,sub:`${e.area} \xb7 ${e.seats}${0===t?' \xb7 best':''}${Me&&(0,B.accessibleSetUp)(ge)&&!(0,B.isAccessible)(ge,e.table)?' \xb7 not step-free':''}`,selected:(ce??je[0].table)===e.table,onPress:()=>be(e.table)},e.table))}):(0,F.jsxs)(C.T,{size:14,colour:S.colours.amber,children:["No dog-friendly table free for ",Y," at ",J,". Try another time."]})]}):null,Pe?(0,F.jsxs)(m.default,{testID:"nb-block-warning",style:{borderWidth:1.5,borderColor:S.colours.amber,backgroundColor:S.colours.amberBg,borderRadius:12,padding:10,gap:6},children:[(0,F.jsxs)(C.T,{weight:"semibold",colour:S.colours.amber,children:["Bookings are paused ",Pe.from,"\u2013",Pe.to,Pe.reason?` (${Pe.reason})`:'']}),Oe?(0,F.jsx)(C.Chip,{label:H?'Manager override on':'Override and book anyway',selected:H,onPress:()=>U(e=>!e)}):(0,F.jsx)(C.Muted,{children:"Ask a manager to override, or pick another time."})]}):null,we.length?null:(0,F.jsx)(m.default,{testID:"nb-closed",children:(0,F.jsxs)(C.T,{size:14,weight:"semibold",colour:S.colours.amber,children:["Closed on ",(0,w.niceDate)(fe)," (per the venue\u2019s opening hours). Pick another date."]})}),(0,F.jsx)($.MoreQuestions,{rid:b,r:h,value:re,onChange:de,party:Y,date:R,time:J,today:(0,w.ymd)(p),bookings:E,audience:"staff",showTables:!1!==h.settings.tableRequests}),Me&&!(0,B.accessibleSetUp)(ge)?(0,F.jsx)(C.T,{size:13,colour:S.colours.amber,children:"Step-free tables aren\u2019t marked yet (Managers \u203a Booking options \u203a Tables). Check the table works for a wheelchair."}):null,(0,F.jsx)(C.Field,{label:"Notes (optional)",value:ee,onChangeText:te,placeholder:P.NOTES_PLACEHOLDER,multiline:!0,numberOfLines:3,testID:"nb-notes"}),(0,i.depositDue)((0,i.depositOf)(h.settings),Y,X)?(0,F.jsxs)(C.Muted,{testID:"nb-deposit",children:["Deposit due: ",(0,a.gbp)((0,i.depositDue)((0,i.depositOf)(h.settings),Y,X))," (",(0,a.gbp)((0,i.depositOf)(h.settings).perPersonPence)," per adult for ",(0,i.depositOf)(h.settings).fromParty,"+",X?`; ${X} ${1===X?'child':'children'} free`:'; children free',"). Deposits are paid through website bookings or to you, never in CoverCharge: tick Deposit paid on the booking once the guest has paid."]}):null,(0,F.jsxs)(C.Muted,{children:["The guest gets a confirmation text",le.trim()?' and email':''," automatically (preview mode: shown in the Outbox, not sent)."]}),Be?(0,F.jsxs)(C.T,{size:14,colour:S.colours.amber,children:["We already have the most dogs we can look after at ",J,". Try another time: dogs are very welcome then."]}):null,(0,F.jsx)(C.Button,{label:ue.length?ue[0]:'Save booking',testID:"nb-save",disabled:!ze,onPress:()=>{if(R<(0,w.ymd)(p))return;if(!(0,M.guardBookingChange)(L))return;const e=(0,$.needsPatch)(re),s=re.tableReq.find(e=>!pe||je.some(t=>t.table===e)),o=pe?null:(0,z.requestedFreeTable)(re.tableReq,{date:R,time:J,partySize:Y},ge.tables.map(e=>e.name),ke,h.settings.turnMins);k.repo.bookings.create({restaurantId:b,customerId:null,name:q.trim(),partySize:Y,date:R,time:J,notes:ee.trim(),security:(0,i.depositDue)((0,i.depositOf)(h.settings),Y,X)?'deposit':'none',depositPaid:0,...X?{children:X}:{},...(0,i.depositDue)((0,i.depositOf)(h.settings),Y,X)?{depositDue:(0,i.depositDue)((0,i.depositOf)(h.settings),Y,X),depositPolicy:(0,i.depositWords)((0,i.depositOf)(h.settings),Y,h.name,X).join(' '),depositRefundable:(0,i.depositOf)(h.settings).refundable,depositCutoffHours:(0,i.depositOf)(h.settings).cutoffHours}:{},phone:Se.pretty,email:le.trim()||void 0,source:ie,...e,...we.find(e=>e.time===J)?.drinksOnly?{drinksOnly:!0}:{},allergies:e.allergies??[],...pe?{table:ce??s??je[0]?.table}:o?{table:o}:{}}).then(e=>(0,O.postNewBookingToKitchen)(e,N)).catch(()=>{}),u?.({date:R,time:J,name:q.trim()}),t()}})]})}},1094,[812,1095,1096,843,851,841,1097,1098,1099,1100,17,842,385,85,856,1055,858,1101,1074,863,804,848,777,996,993,1102,1103,1108,1076,1053,1092,1091,1109,8]); +__d(function(g,_r,_i,_a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"TABLES",{enumerable:!0,get:function(){return A}}),_e.useTableNames=R,_e.resetTableLive=W,_e.seatBookingNow=async function(e,t){await k.repo.bookings.setStatus(t.id,'seated'),W(e,t.table)},_e.finishBookingNow=async function(e,t){const s=(new Date).toISOString();await k.repo.bookings.update(t.id,(0,N.finishClearPatch)(s,t.table)),(0,v.tablesOf)(t.table).forEach(t=>v.useFloor.getState().setLive(e,t,{stage:void 0,dirty:!0}))},_e.useTableUse=E,Object.defineProperty(_e,"walkInLabel",{enumerable:!0,get:function(){return _}}),_e.TablePicker=H,_e.WalkInSheet=q,_e.AssignTableSheet=V,_e.undoNotice=Y,_e.NewBookingSheet=G,_e.useFrontDoor=function(e,t){const[s,o]=(0,c.useState)(!1),[l,a]=(0,c.useState)(!1),[i,n]=(0,c.useState)(null);return{openWalkIn:()=>o({}),openWalkInAt:e=>o({table:e}),openBooking:()=>a(!0),assignTable:e=>n({b:e}),combineTables:e=>n({b:e,combine:!0}),elements:(0,F.jsxs)(F.Fragment,{children:[s?(0,F.jsx)(q,{wide:t,initialTable:s.table,onClose:()=>o(!1),onSeated:Y}):null,l?(0,F.jsx)(G,{wide:t,date:e,onClose:()=>a(!1),onSaved:e=>(0,u.notify)({id:`booked:${Date.now()}`,testID:'booking-saved-toast',timeoutMs:5e3,icon:'\u2713',title:`Booked: ${e.name} \xb7 ${(0,w.niceDate)((0,w.parseYmd)(e.date))} at ${e.time}`})}):null,i?(0,F.jsx)(V,{booking:i.b,combine:i.combine,onClose:()=>n(null)}):null]})}};var t=_r(_d[0]),s=_r(_d[1]),o=_r(_d[2]),l=_r(_d[3]),a=_r(_d[4]),i=_r(_d[5]),n=_r(_d[6]),r=_r(_d[7]),d=_r(_d[8]),u=_r(_d[9]),c=_r(_d[10]),b=e(c),h=_r(_d[11]),p=e(_r(_d[12])),m=e(_r(_d[13])),f=_r(_d[14]),y=_r(_d[15]),k=_r(_d[16]),x=_r(_d[17]),j=_r(_d[18]),w=_r(_d[19]),S=_r(_d[20]),T=_r(_d[21]),C=_r(_d[22]),v=_r(_d[23]),D=_r(_d[24]),I=_r(_d[25]),$=_r(_d[26]),P=_r(_d[27]),O=_r(_d[28]),B=_r(_d[29]),z=_r(_d[30]),M=_r(_d[31]),N=_r(_d[32]),F=_r(_d[33]);const L=e=>(0,u.notify)({id:'booking-blocked',testID:'booking-blocked-toast',timeoutMs:9e3,icon:'\u26a0',title:e}),A=Array.from({length:12},(e,t)=>String(t+1));function R(e){const t=(0,v.usePlan)(e);return t.areas.flatMap(e=>t.tables.filter(t=>t.areaId===e.id).map(e=>e.name))}function W(e,t){(0,v.tablesOf)(t).forEach(t=>v.useFloor.getState().setLive(e,t,{stage:'seated',dirty:!1}))}function E(e,t){const s=(0,k.useBookings)(e),o=(0,k.useOrders)(e),l=R(e),a=(0,v.useFloor)(t=>t.live[e])??{},i=(0,v.usePlan)(e),n=(0,D.useBlocks)(e=>e.blocks),r=(0,w.ymd)(t),d=(0,D.closedAreasAt)(n,e,r,(0,w.hm)(t)),u={};for(const e of l)u[e]=a[e]?.blocked||d.has(`tbl:${e}`)?{busy:!0,label:'Blocked'}:d.has(i.tables.find(t=>t.name===e)?.areaId??'')?{busy:!0,label:'Closed'}:a[e]?.dirty?{busy:!0,label:'Needs clearing'}:{busy:!1,label:'Free'};for(const e of s)if(e.date===r&&e.table)for(const s of(0,v.tablesOf)(e.table))if(u[s])if('seated'===e.status)u[s]={busy:!0,label:`${e.walkIn?'Walk-in':`${e.name.slice(0,1)}.`} \xb7 ${e.partySize}`};else if('confirmed'===e.status&&!u[s].busy){const o=(0,w.minsBetween)(t,new Date(`${e.date}T${e.time}:00`));o>=-15&&o<=90&&(u[s]={...u[s],soon:`Booked ${e.time}`})}for(const e of o)'table'===e.type&&e.tableNo&&u[e.tableNo]&&!['closed','cancelled','collected'].includes(e.status)&&!u[e.tableNo].busy&&(u[e.tableNo]={busy:!0,label:'Open order'});return u}const _=e=>e.walkIn?`Walk-in \xb7 ${e.partySize}`:`${e.name} \xb7 ${e.partySize}`;function H({use:e,value:t,onPick:s,big:o,best:a,dense:i,bestSet:n,picked:r}){const d=Object.keys(e),[u,b]=(0,c.useState)(0),h=i?6:8,f=i?64:o?92:76,y=u?Math.max(3,Math.floor((u+h)/(f+h))):0,k=y?Math.floor((u-h*(y-1))/y):f,x=new Set(n??[]),j=a?(0,v.tablesOf)(a)[0]:null;return(0,F.jsx)(m.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:h},testID:"table-picker",onLayout:e=>b(Math.floor(e.nativeEvent.layout.width)),children:d.map(o=>{const a=e[o],n=t===o||!!r?.includes(o),d=x.has(o),u=j===o&&!n,c=a.busy?['Blocked','Needs clearing','Closed'].includes(a.label)?a.label:'In use':a.soon??'Free';return(0,F.jsxs)(p.default,{accessibilityRole:"button",testID:`pick-table-${o}`,accessibilityLabel:`Table ${(0,l.tableNumbers)(o)}${r?n?', picked':', not picked':''}, ${a.busy?`in use (${a.label})`:a.soon?`free, ${a.soon}`:'free'}${d?', best table':''}${u?', suggested for this party':''}`,accessibilityState:{selected:n,disabled:'Closed'===a.label},disabled:'Closed'===a.label,onPress:()=>s(o),style:{width:k,minHeight:i?58:64,borderRadius:12,borderWidth:n||u?2.5:1.5,paddingVertical:i?3:6,paddingHorizontal:4,alignItems:'center',justifyContent:'center',gap:2,borderColor:n||u?S.colours.gold:a.busy?S.colours.red:S.colours.ok,backgroundColor:n?S.colours.goldTint:a.busy?S.colours.redBg:S.colours.surface2,opacity:'Closed'!==a.label||n?1:.55},children:[(0,F.jsxs)(m.default,{style:{flexDirection:'row',alignItems:'center',gap:4},children:[(0,F.jsx)(C.T,{weight:"bold",size:22,colour:n?S.colours.goldLight:S.colours.text,children:(0,l.tableNumbers)(o)}),d?(0,F.jsx)(m.default,{testID:"best-table",style:{backgroundColor:S.colours.gold,borderRadius:5,paddingHorizontal:4,paddingVertical:1},children:(0,F.jsx)(C.T,{size:11,weight:"bold",colour:S.colours.onGold,children:"BEST"})}):null]}),(0,F.jsx)(C.T,{size:i?13:14,colour:a.busy?'#FFD9D4':a.soon?'#FFE2A8':'#E2C489',center:!0,numberOfLines:1,children:c})]},o)})})}const U=[1,2,3,4,5,6,7,8];function q({onClose:e,onSeated:a,wide:i,initialTable:n}){const{rid:r,r:d,now:u}=(0,y.useCtx)(15e3),x=E(r,u),[T,I]=(0,c.useState)(2),[$,P]=(0,c.useState)(!1),[O,B]=(0,c.useState)(n??null),z=(0,v.usePlan)(r),N=(0,k.useBookings)(r),A=(0,D.useBlocks)(e=>e.blocks),R=(0,D.closedAreasAt)(A,r,(0,w.ymd)(u),(0,w.hm)(u)),_=b.default.useMemo(()=>{const e=Object.fromEntries(Object.entries(x).map(([e,t])=>[e,{status:t.busy?'seated':'free'}]));return(0,j.suggestTable)(z,N.filter(e=>e.date===(0,w.ymd)(u)),e,T,u,(0,j.turnFor)(T,d.settings.turnMins),90,void 0,{closed:R})?.table??null},[z,N,x,T,R.size,u.getTime()]);(0,c.useEffect)(()=>{O&&(0,v.tablesOf)(O).some(e=>'Closed'===x[e]?.label)&&B(null)},[O,R.size]);const[q,V]=(0,c.useState)(!1),[Y,G]=(0,c.useState)(''),K=(e,t=String(e),s=()=>{P(!1),I(e)})=>{const o='9+'===t?$:!$&&T===e;return(0,F.jsx)(p.default,{accessibilityRole:"button",accessibilityLabel:'9+'===t?'Party of 9 or more':`Party of ${e}`,accessibilityState:{selected:o},onPress:s,style:{width:i?58:60,height:i?58:56,borderRadius:14,borderWidth:2,borderColor:S.colours.gold,alignItems:'center',justifyContent:'center',backgroundColor:o?S.colours.gold:'transparent'},children:(0,F.jsx)(C.T,{weight:"bold",size:22,colour:o?S.colours.onGold:S.colours.gold,children:t})},t)},Q=(0,F.jsx)(s.PartySizeInput,{value:T,onChange:I,min:9,max:o.MAX_PARTY,label:"Walk-in party size",testID:"walkin-party-size"}),X=(0,F.jsxs)(m.default,{style:{gap:8,width:i?256:void 0},children:[(0,F.jsx)(C.T,{weight:"semibold",children:"How many people?"}),(0,F.jsxs)(m.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:8},testID:"walkin-party",children:[U.map(e=>K(e)),K(9,'9+',()=>{P(!0),I(e=>e>=9?e:9)})]}),$?Q:null]}),[J,Z]=(0,c.useState)(!1),ee=async(t=O)=>{if(!J&&(0,M.guardBookingChange)(L)){Z(!0);try{const s=await k.repo.bookings.seatWalkIn(r,T,t??void 0,Y);W(r,t??void 0),a(s),e()}finally{Z(!1)}}},te=(0,F.jsxs)(m.default,{style:{gap:8,flex:i?1:void 0,minWidth:0},children:[(0,F.jsxs)(C.Row,{style:{justifyContent:'space-between'},children:[(0,F.jsxs)(C.T,{weight:"semibold",children:["Table ",(0,F.jsx)(C.T,{colour:S.colours.muted,size:14,children:"(optional)"})]}),O?(0,F.jsx)(C.Button,{small:!0,kind:"ghost",label:"Clear table",onPress:()=>B(null)}):null]}),(0,F.jsx)(H,{use:x,value:O,onPick:e=>{x[e]&&!x[e].busy?ee(e):B(O===e?null:e)},big:i,dense:i,best:_,bestSet:(0,h.bestTables)(z)}),(0,F.jsxs)(C.Muted,{children:["Tap a free table to seat them there",_&&!O?` (suggested for ${T}: ${(0,l.tableNumbers)(_)})`:'',", or Seat for no table yet. BEST marks the venue\u2019s best tables."]})]});return(0,F.jsxs)(C.Sheet,{visible:!0,onClose:e,title:`Walk-in \xb7 ${(0,w.hm)(u)}`,maxWidth:i?1100:void 0,testID:"walkin-sheet",children:[(0,F.jsx)(C.Button,{label:`Seat walk-in \xb7 ${T} ${1===T?'person':'people'}${O?` \xb7 ${(0,l.tableNumbers)(O)}`:''}`,disabled:J,onPress:()=>{ee()},testID:"seat-walkin",style:{minHeight:52}}),i?(0,F.jsxs)(C.Row,{gap:16,style:{alignItems:'flex-start'},children:[X,te]}):(0,F.jsxs)(F.Fragment,{children:[X,te]}),(0,F.jsxs)(C.Row,{gap:10,wrap:!0,style:{alignItems:'center'},children:[q?(0,F.jsx)(t.TextInput,{accessibilityLabel:"Walk-in note",placeholder:"Note (optional), e.g. high chair",placeholderTextColor:"#7D776C",value:Y,onChangeText:G,style:[C.styles.input,{flex:1,minWidth:220}],autoFocus:!0}):(0,F.jsx)(C.Button,{small:!0,kind:"ghost",label:"Add a note (optional)",onPress:()=>V(!0)}),(0,F.jsx)(m.default,{style:{flex:1,minWidth:220},children:(0,F.jsxs)(C.Muted,{children:["No name needed. Counts in today's covers.",'staff'!==f.APP_VARIANT?' Using website bookings too? Mark the table there as well.':'']})})]})]})}function V({booking:e,onClose:t,combine:s}){const{rid:o,r:a,now:i}=(0,y.useCtx)(15e3),n=E(o,i),r=(0,v.usePlan)(o),d=(0,k.useBookings)(o),u=(0,v.tablesOf)(e.table),p=b.default.useMemo(()=>Object.fromEntries(Object.entries(n).map(([e,t])=>[e,u.includes(e)?{busy:!1,label:'This party',soon:'This party'}:t])),[n,e.table]),f=b.default.useMemo(()=>{const t=Object.fromEntries(Object.entries(p).map(([e,t])=>[e,{status:t.busy?'seated':'free'}]));return(0,j.suggestTable)(r,d.filter(e=>e.date===(0,w.ymd)(i)),t,e.partySize,i,(0,j.turnFor)(e.partySize,a.settings.turnMins),90,e.id)?.table??null},[r,d,p,e.partySize,i.getTime()]),[x,T]=(0,c.useState)(!!s||u.length>1),[D,I]=(0,c.useState)(u),$=e=>r.tables.find(t=>t.name===e)?.maxSeats??0,P=D.reduce((e,t)=>e+$(t),0),O=D.length>0&&P{if(!(0,M.guardBookingChange)(L))return;const l=(0,v.joinTables)(s);await k.repo.bookings.assignTable(e.id,l);u.filter(e=>!s.includes(e)).forEach(t=>v.useFloor.getState().setLive(o,t,{stage:void 0,dirty:'seated'===e.status})),'seated'===e.status&&W(o,l),t()},z=x?(0,F.jsxs)(m.default,{style:{gap:8},testID:"assign-table-tip",children:[(0,F.jsx)(m.default,{accessibilityLiveRegion:"polite",children:(0,F.jsx)(C.T,{size:17,weight:"semibold",colour:S.colours.text,children:D.length?`${(0,v.tablesLabel)((0,v.joinTables)(D))} \xb7 ${P} seats for ${e.partySize} Covers`:'No tables picked yet'})}),O?(0,F.jsx)(m.default,{testID:"combine-short",children:(0,F.jsxs)(C.T,{size:15,weight:"semibold",colour:"#FFD9D4",children:["Not enough seats yet: ",e.partySize-P," more needed. Add another table."]})}):null,(0,F.jsx)(C.T,{size:15,colour:S.colours.text,children:"Tap each table to add or remove it, then tap Done. All of them show as taken until the party has finished."}),(0,F.jsxs)(C.Row,{gap:8,wrap:!0,children:[(0,F.jsx)(C.Button,{label:"Done",testID:"combine-done",disabled:!D.length,accessibilityLabel:D.length?`Done, save ${(0,v.tableCardLabel)((0,v.joinTables)(D))}`:'Done',onPress:()=>B(D)}),(0,F.jsx)(C.Button,{kind:"ghost",label:"Cancel",onPress:t})]})]}):(0,F.jsx)(m.default,{style:{gap:8},testID:"assign-table-tip",children:(0,F.jsx)(C.T,{size:15,colour:S.colours.text,children:"Red tables are in use right now; you can still pick one (e.g. joining a table). BEST marks the venue\u2019s best tables. Big party? Tap Combine tables."})});return(0,F.jsxs)(C.Sheet,{visible:!0,onClose:t,title:`${x?'Combine tables':'Assign table'} \xb7 ${_(e)}`,testID:"assign-table-sheet",footer:z,children:[f&&!x?(0,F.jsx)(m.default,{testID:"assign-suggested",children:(0,F.jsxs)(C.T,{size:16,weight:"semibold",colour:S.colours.goldLight,accessibilityLabel:`Suggested for ${e.partySize}: ${(0,v.tableCardLabel)(f)}`,children:["Suggested for ",e.partySize,": ",(0,l.tableNumbers)(f)]})}):null,x?null:(0,F.jsx)(C.Button,{kind:"secondary",label:"Combine tables",testID:"combine-start",accessibilityLabel:"Combine tables: pick several tables for this party",onPress:()=>T(!0)}),(0,F.jsx)(H,{use:p,best:x?null:f,bestSet:(0,h.bestTables)(r),picked:x?D:void 0,onPick:x?e=>I(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]):async e=>{await B([e])}})]})}function Y(e){(0,u.notify)({id:`walkin:${e.id}`,testID:'walkin-toast',timeoutMs:6e3,title:`${_(e)} seated \xb7 ${e.table?`${(0,l.tableNumbers)(e.table)}`:'table to assign'} (${e.ref})`,actions:[{label:'Undo',testID:'undo-walkin',onPress:()=>k.repo.bookings.undoWalkIn(e.id)},{label:'OK',kind:'ghost'}]})}function G({date:e,onClose:t,wide:s,onSaved:u}){const{rid:b,r:h,now:p,role:f,meId:N}=(0,y.useCtx)(6e4);(0,d.useBlurOutside)();const A=(0,w.ymd)(p),[R,W]=(0,c.useState)(ee.blocks),[H,U]=(0,c.useState)(!1),[q,V]=(0,c.useState)(''),[Y,G]=(0,c.useState)(2),[K,Q]=(0,c.useState)(0),X=Math.min(K,Math.max(0,Y-1)),[J,Z]=(0,c.useState)(null),[ee,te]=(0,c.useState)(''),[se,oe]=(0,c.useState)(''),[le,ae]=(0,c.useState)(''),[ie,ne]=(0,c.useState)('phone'),[re,de]=(0,c.useState)((0,$.emptyNeeds)()),ue=(0,$.needsMissing)(re),[ce,be]=(0,c.useState)(null),ge=(0,v.usePlan)(b),he=(0,B.dogSetUp)(ge),pe=!0===re.dog&&he,me=re.dog?re.dogs:0,fe=(0,w.parseYmd)(R),ye=(0,j.turnFor)(Y,h.settings.turnMins),ke=E.filter(e=>e.date===R),xe=e=>(0,j.freeTablesAt)(ge,ke,Y,new Date(`${R}${(0,l.tableNumbers)(e)}:00`),ye,h.settings.turnMins,{dog:!0,closed:(0,D.closedAreasAt)(_,b,R,e)}),je=pe&&J?xe(J):[];(0,c.useEffect)(()=>{be(null)},[pe,J,Y]);const we=(0,x.bookingSlots)(h,fe,e=>E.filter(t=>t.date===R&&t.time===e&&'cancelled'!==t.status&&!t.walkIn).reduce((e,t)=>e+t.partySize,0),Y,R===(0,w.ymd)(p)?p:(0,w.addMins)(fe,0),e=>E.filter(t=>t.date===R&&t.time===e&&'cancelled'!==t.status&&!t.walkIn).length),Se=(0,T.guestPhone)(se),[Te,Ce]=(0,c.useState)(!1),ve=J?we.find(e=>e.time===J):void 0,De=ve&&ve.left=2&&!!J&&(!$e||Te)&&(0,o.validParty)(Y)&&Se.ok&&(0,T.emailOk)(le)&&(!Pe||Oe&&H)&&(!pe||je.length>0)&&!Be,Me=re.wheelchair>0||re.stepFree;return(0,F.jsxs)(C.Sheet,{visible:!0,onClose:t,title:`New booking \xb7 ${(0,w.niceDate)(fe)}`,maxWidth:s?760:void 0,testID:"booking-sheet",children:[(0,F.jsx)($.FirstQuestions,{rid:b,value:re,onChange:de,party:Y,audience:"staff"}),re.dog&&!he?(0,F.jsx)(C.T,{size:13,colour:S.colours.amber,children:"Dog-friendly tables aren\u2019t marked yet. Managers \u203a Booking options \u203a Tables. Booking is allowed; check where the dog can sit."}):null,(0,F.jsx)(I.BookingDatePicker,{r:h,today:p,value:R,onChange:e=>{e!==R&&(W(e),Z(null),U(!1))}}),(0,F.jsxs)(C.Row,{gap:6,children:[(0,F.jsx)(C.Chip,{label:"Phone",selected:'phone'===ie,onPress:()=>ne('phone')}),(0,F.jsx)(C.Chip,{label:"In person",selected:'in-person'===ie,onPress:()=>ne('in-person')})]}),(0,F.jsx)(C.Field,{label:"Name",value:q,onChangeText:V,placeholder:"e.g. Reid",testID:"nb-name"}),(0,F.jsx)(C.Field,{label:"Mobile or phone number (needed)",value:se,onChangeText:oe,keyboardType:"phone-pad",placeholder:"e.g. 07700 900123",testID:"nb-phone"}),!Se.ok&&se?(0,F.jsx)(C.T,{size:13,colour:S.colours.amber,children:Se.error}):null,(0,F.jsx)(C.Field,{label:"Email (optional)",value:le,onChangeText:ae,keyboardType:"email-address",autoCapitalize:"none",placeholder:"For an email confirmation too",testID:"nb-email"}),(0,T.emailOk)(le)?null:(0,F.jsx)(C.T,{size:13,colour:S.colours.amber,children:"That email doesn\u2019t look quite right."}),(0,F.jsx)(n.AdultsChildren,{value:(0,r.peopleOf)(Y,X),onChange:e=>{G(e.partySize),Q(e.children),Ce(!1)},depositsOn:(0,i.depositOf)(h.settings).on&&(0,i.depositOf)(h.settings).perPersonPence>0,testID:"nb-people"}),(0,F.jsx)(C.Row,{wrap:!0,gap:6,children:we.map(e=>{const t=pe&&e.available&&!xe(e.time).length||!(0,$.dogTimeOk)(h,E,R,e.time,me);return(0,F.jsx)(C.Chip,{testID:`nb-slot-${e.time}`,label:e.time,sub:(0,D.blockAt)(_,b,R,e.time)?'Paused':t?'Dogs full':e.drinksOnly?'Drinks only':null!=e.partiesLeft&&e.partiesLeft<1||e.left<=0?'Full':`${e.left} left`,disabled:(e.past??!e.available)||t,selected:J===e.time,onPress:()=>{Z(e.time),U(!1),Ce(!1)}},e.time)})}),$e?(0,F.jsxs)(m.default,{testID:"nb-over-capacity",accessible:!0,accessibilityLiveRegion:"polite",style:{borderWidth:1.5,borderColor:S.colours.amber,backgroundColor:S.colours.amberBg,borderRadius:12,padding:10,gap:6},children:[De?(0,F.jsx)(C.T,{weight:"semibold",colour:S.colours.amber,children:(0,o.overCapacityNote)(Y,De.left,De.time)}):null,Ie?(0,F.jsx)(C.T,{weight:"semibold",colour:S.colours.amber,children:(0,o.overPartiesNote)(Ie.time,Ie.cap)}):null,(0,F.jsx)(C.Chip,{label:Te?'Booking over the limit: on':'Book anyway (over the limit)',selected:Te,onPress:()=>Ce(e=>!e),testID:"nb-over-ok"})]}):null,pe&&J?(0,F.jsxs)(m.default,{style:{gap:6},testID:"nb-dog-tables",children:[(0,F.jsxs)(C.T,{size:14,weight:"semibold",children:["Dog-friendly table ",(0,F.jsxs)(C.T,{size:13,colour:S.colours.muted,children:["(",ge.areas.filter(e=>e.dogs).map(e=>e.name).join(' or '),")"]})]}),je.length?(0,F.jsx)(C.Row,{wrap:!0,gap:6,children:je.slice(0,10).map((e,t)=>(0,F.jsx)(C.Chip,{label:`${(0,l.tableNumbers)(e.table)}`,sub:`${e.area} \xb7 ${e.seats}${0===t?' \xb7 best':''}${Me&&(0,B.accessibleSetUp)(ge)&&!(0,B.isAccessible)(ge,e.table)?' \xb7 not step-free':''}`,selected:(ce??je[0].table)===e.table,onPress:()=>be(e.table)},e.table))}):(0,F.jsxs)(C.T,{size:14,colour:S.colours.amber,children:["No dog-friendly table free for ",Y," at ",J,". Try another time."]})]}):null,Pe?(0,F.jsxs)(m.default,{testID:"nb-block-warning",style:{borderWidth:1.5,borderColor:S.colours.amber,backgroundColor:S.colours.amberBg,borderRadius:12,padding:10,gap:6},children:[(0,F.jsxs)(C.T,{weight:"semibold",colour:S.colours.amber,children:["Bookings are paused ",Pe.from,"\u2013",Pe.to,Pe.reason?` (${Pe.reason})`:'']}),Oe?(0,F.jsx)(C.Chip,{label:H?'Manager override on':'Override and book anyway',selected:H,onPress:()=>U(e=>!e)}):(0,F.jsx)(C.Muted,{children:"Ask a manager to override, or pick another time."})]}):null,we.length?null:(0,F.jsx)(m.default,{testID:"nb-closed",children:(0,F.jsxs)(C.T,{size:14,weight:"semibold",colour:S.colours.amber,children:["Closed on ",(0,w.niceDate)(fe)," (per the venue\u2019s opening hours). Pick another date."]})}),(0,F.jsx)($.MoreQuestions,{rid:b,r:h,value:re,onChange:de,party:Y,date:R,time:J,today:(0,w.ymd)(p),bookings:E,audience:"staff",showTables:!1!==h.settings.tableRequests}),Me&&!(0,B.accessibleSetUp)(ge)?(0,F.jsx)(C.T,{size:13,colour:S.colours.amber,children:"Step-free tables aren\u2019t marked yet (Managers \u203a Booking options \u203a Tables). Check the table works for a wheelchair."}):null,(0,F.jsx)(C.Field,{label:"Notes (optional)",value:ee,onChangeText:te,placeholder:P.NOTES_PLACEHOLDER,multiline:!0,numberOfLines:3,testID:"nb-notes"}),(0,i.depositDue)((0,i.depositOf)(h.settings),Y,X)?(0,F.jsxs)(C.Muted,{testID:"nb-deposit",children:["Deposit due: ",(0,a.gbp)((0,i.depositDue)((0,i.depositOf)(h.settings),Y,X))," (",(0,a.gbp)((0,i.depositOf)(h.settings).perPersonPence)," per adult for tables of ",(0,i.depositOf)(h.settings).fromParty,"+ adults",X?`; ${X} ${1===X?'child':'children'} free`:'; children free, and they do not count towards the number that needs a deposit',"). Staff can waive it. Deposits are paid through website bookings or to you, never in CoverCharge: tick Deposit paid on the booking once the guest has paid."]}):null,(0,F.jsxs)(C.Muted,{children:["The guest gets a confirmation text",le.trim()?' and email':''," automatically (preview mode: shown in the Outbox, not sent)."]}),Be?(0,F.jsxs)(C.T,{size:14,colour:S.colours.amber,children:["We already have the most dogs we can look after at ",J,". Try another time: dogs are very welcome then."]}):null,(0,F.jsx)(C.Button,{label:ue.length?ue[0]:'Save booking',testID:"nb-save",disabled:!ze,onPress:()=>{if(R<(0,w.ymd)(p))return;if(!(0,M.guardBookingChange)(L))return;const e=(0,$.needsPatch)(re),s=re.tableReq.find(e=>!pe||je.some(t=>t.table===e)),o=pe?null:(0,z.requestedFreeTable)(re.tableReq,{date:R,time:J,partySize:Y},ge.tables.map(e=>e.name),ke,h.settings.turnMins);k.repo.bookings.create({restaurantId:b,customerId:null,name:q.trim(),partySize:Y,date:R,time:J,notes:ee.trim(),security:(0,i.depositDue)((0,i.depositOf)(h.settings),Y,X)?'deposit':'none',depositPaid:0,...X?{children:X}:{},...(0,i.depositDue)((0,i.depositOf)(h.settings),Y,X)?{depositDue:(0,i.depositDue)((0,i.depositOf)(h.settings),Y,X),depositPolicy:(0,i.depositWords)((0,i.depositOf)(h.settings),Y,h.name,X).join(' '),depositRefundable:(0,i.depositOf)(h.settings).refundable,depositCutoffHours:(0,i.depositOf)(h.settings).cutoffHours}:{},phone:Se.pretty,email:le.trim()||void 0,source:ie,...e,...we.find(e=>e.time===J)?.drinksOnly?{drinksOnly:!0}:{},allergies:e.allergies??[],...pe?{table:ce??s??je[0]?.table}:o?{table:o}:{}}).then(e=>(0,O.postNewBookingToKitchen)(e,N)).catch(()=>{}),u?.({date:R,time:J,name:q.trim()}),t()}})]})}},1094,[812,1095,1096,843,851,841,1097,1098,1099,1100,17,842,385,85,856,1055,858,1101,1074,863,804,848,777,996,993,1102,1103,1108,1076,1053,1092,1091,1109,8]); __d(function(g,r,i,a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.PartySizeInput=function({value:e,onChange:p,min:b=s.MIN_PARTY,max:y=s.MAX_PARTY,label:f="Party size",testID:h="party-size"}){const[x,S]=(0,t.useState)(String(e));(0,t.useEffect)(()=>{S(String(e))},[e]);const T=e=>p((0,s.clampParty)(e,b,y)),$=(t,n,l)=>{const s=t<0?e<=b:e>=y;return(0,d.jsx)(o.default,{testID:`${h}-${t>0?'up':'down'}${10===Math.abs(t)?'10':''}`,accessibilityRole:"button",accessibilityLabel:l,accessibilityState:{disabled:s},disabled:s,onPress:()=>T(e+t),hitSlop:4,style:{minWidth:44,height:44,paddingHorizontal:8,borderRadius:22,borderWidth:1.5,borderColor:u.colours.gold,alignItems:'center',justifyContent:'center',opacity:s?.4:1},children:(0,d.jsx)(c.T,{size:10===Math.abs(t)?14:20,weight:"semibold",colour:u.colours.gold,center:!0,children:n})},t)};return(0,d.jsxs)(l.default,{testID:h,style:{flexDirection:'row',alignItems:'center',gap:6,flexWrap:'wrap',justifyContent:'center'},children:[y-b>=20?$(-10,'\u221210',"10 fewer people"):null,$(-1,'\u2212','One fewer person'),(0,d.jsx)(n.default,{testID:`${h}-input`,value:x,keyboardType:"number-pad",inputMode:"numeric",maxLength:3,selectTextOnFocus:!0,accessibilityLabel:`${f}, ${b} to ${y} people`,accessibilityValue:{min:b,max:y,now:e,text:`${e} ${1===e?'person':'people'}`},onChangeText:e=>{S(e.replace(/\D/g,'')),e.replace(/\D/g,'')&&T((0,s.partyFromText)(e,b,y))},onBlur:()=>{const e=(0,s.partyFromText)(x,b,y);S(String(e)),T(e)},returnKeyType:"done",blurOnSubmit:!0,onSubmitEditing:e=>{e?.target?.blur?.()},style:{width:64,height:44,borderRadius:10,borderWidth:1,borderColor:u.colours.border,color:u.colours.text,backgroundColor:u.colours.surface,textAlign:'center',fontSize:20,fontFamily:u.fonts.semibold}}),$(1,'+','One more person'),y-b>=20?$(10,'+10',"10 more people"):null]})};var t=r(_d[0]),o=e(r(_d[1])),n=e(r(_d[2])),l=e(r(_d[3])),s=r(_d[4]),u=r(_d[5]),c=r(_d[6]),d=r(_d[7])},1095,[17,385,395,85,1096,804,777,8]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"MAX_PARTY",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"MIN_PARTY",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"PARTY_RULE",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"validParty",{enumerable:!0,get:function(){return u}}),Object.defineProperty(e,"partyFromText",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"clampParty",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"overCapacityNote",{enumerable:!0,get:function(){return f}}),Object.defineProperty(e,"overPartiesNote",{enumerable:!0,get:function(){return b}});const t=100,n=1,o=`Bookings are for ${n} to ${t} people.`,u=o=>'number'==typeof o&&Number.isInteger(o)&&o>=n&&o<=t,c=(o,u=n,c=t)=>{const s=parseInt(String(o??'').replace(/\D/g,'').slice(0,4),10);return Math.max(u,Math.min(c,Number.isFinite(s)?s:u))},s=(o,u=n,c=t)=>Math.max(u,Math.min(c,Math.round(Number(o)||u))),f=(t,n,o)=>n<=0?`${o} is already full for booked Covers. Booking ${t} more goes over the venue\u2019s limit: check tables and staffing.`:`${t} is more than the ${n} Covers left at ${o}. Booking goes over the venue\u2019s limit by ${t-n}: check tables and staffing.`,b=(t,n)=>`${t} already has the most bookings we take at one start time (${n}). Booking another goes over the venue\u2019s limit: check tables and staffing.`},1096,[]); __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.AdultsChildren=function({value:e,onChange:t,depositsOn:h,testID:x="people"}){const p=e=>t((0,s.storedPeople)(e)),b=(0,s.totalLine)(e);return(0,o.jsxs)(l.default,{testID:x,style:{gap:8,alignItems:'center',width:'100%'},children:[(0,o.jsx)(u.T,{size:18,center:!0,weight:"semibold",children:"Adults"}),(0,o.jsx)(n.PartySizeInput,{value:e.adults,min:1,max:(0,s.maxAdults)(e.children),onChange:t=>p({adults:t,children:e.children}),label:"Adults",testID:`${x}-adults`}),(0,o.jsx)(u.T,{size:18,center:!0,weight:"semibold",children:"Children"}),(0,o.jsx)(n.PartySizeInput,{value:e.children,min:0,max:(0,s.maxKids)(e.adults),onChange:t=>p({adults:e.adults,children:t}),label:"Children",testID:`${x}-children`}),(0,o.jsx)(u.T,{size:18,center:!0,weight:"semibold",colour:c.colours.goldLight,testID:`${x}-total`,accessibilityLabel:b,children:b}),h?(0,o.jsx)(u.Muted,{center:!0,children:"Children never pay a deposit."}):null]})},r(d[0]);var e,t=r(d[1]),l=(e=t)&&e.__esModule?e:{default:e},s=r(d[2]),n=r(d[3]),u=r(d[4]),c=r(d[5]),o=r(d[6])},1097,[17,85,1098,1095,777,804,8]); @@ -1302,9 +1302,9 @@ __d(function(g,_r,i,_a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModu __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.useSafetyView=function(o){const l=(0,n.useSafety)(),c=(0,s.useOwner)(t=>t.site);return(0,t.useMemo)(()=>{if('chef'!==o)return{...l,points:l.points.filter(t=>!t.archived),allPoints:l.points};const t=l.points.filter(t=>(0,f.chefCanSee)(c,t)),n=t.filter(t=>!t.archived),s=new Set(l.points.filter(t=>!(0,f.chefCanSee)(c,t)).map(t=>t.id)),u=t=>(0,f.chefCanSee)(c,t)&&!s.has(t.pointId||'');return{...l,points:n,allPoints:t,entries:l.entries.filter(u),probes:l.probes.filter(u),diary:l.diary.filter(t=>u(t)&&(0,f.chefCanSee)(c,t.text)),weekly:l.weekly.filter(t=>(0,f.chefCanSee)(c,t.note))}},[l,c,o])};var t=r(d[0]),n=r(d[1]),s=r(d[2]),f=r(d[3])},1219,[17,1001,876,820]); __d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"BOTTOM_TABS_HEIGHT",{enumerable:!0,get:function(){return h}}),_e.BottomTabs=function({tabs:e,active:b,onPress:y,background:x,tablist:p}){const{width:j}=(0,s.default)(),v=j/Math.max(1,e.length),w=v>=60?11:10,I=v<56?20:22,[F,S]=(0,t.useState)({}),[H,_]=(0,t.useState)(0),M=H>0&&e.some(e=>(F[e.id]??0)>H-6),z={flexDirection:'row',flexWrap:'nowrap',alignItems:'stretch',borderTopWidth:1,borderColor:c.colours.border,backgroundColor:x};return(0,f.jsx)(l.default,{testID:"app-bottom-tabs",accessibilityRole:p?'tablist':void 0,style:z,children:e.map(t=>{const s=b===t.id,x=s?c.colours.gold:c.colours.muted;return(0,f.jsxs)(n.default,{onLayout:t===e[0]?e=>_(e.nativeEvent.layout.width):void 0,testID:`tab-${t.id}`,accessibilityRole:"tab",accessibilityState:{selected:s},accessibilityLabel:t.a11y??t.label,onPress:()=>y(t.id),style:{flexGrow:1,flexShrink:1,flexBasis:0,minWidth:44,minHeight:h,alignItems:'center',justifyContent:'center',paddingVertical:4,paddingHorizontal:1,gap:2},children:[(0,f.jsxs)(l.default,{style:{width:I,height:I,alignItems:'center',justifyContent:'center'},children:[(0,f.jsx)(u.Icon,{name:t.icon,size:I,colour:x}),t.badge?(0,f.jsx)(l.default,{testID:t.badge.testID,style:{position:'absolute',right:-10,top:-5,backgroundColor:t.badge.bg,borderRadius:8,minWidth:16,height:16,paddingHorizontal:3,alignItems:'center',justifyContent:'center'},children:(0,f.jsx)(o.default,{style:{fontFamily:c.fonts.bold,fontSize:10,lineHeight:12,color:t.badge.fg??'#FFFFFF'},children:t.badge.text})}):null]}),(0,f.jsx)(l.default,{pointerEvents:"none","aria-hidden":!0,importantForAccessibility:"no-hide-descendants",accessibilityElementsHidden:!0,style:{position:'absolute',left:0,top:0,width:0,height:0,overflow:'hidden',opacity:0},children:(0,f.jsx)(l.default,{style:{width:400,flexDirection:'row',alignItems:'flex-start'},children:(0,f.jsx)(o.default,{onLayout:e=>{const n=Math.ceil(e.nativeEvent.layout.width);S(e=>e[t.id]===n?e:{...e,[t.id]:n})},style:{fontFamily:c.fonts.semibold,fontSize:w,lineHeight:Math.round(1.3*w),flexShrink:0},children:t.short??t.label})})}),M?null:(0,f.jsx)(o.default,{numberOfLines:1,style:{fontFamily:s?c.fonts.semibold:c.fonts.regular,fontSize:w,lineHeight:Math.round(1.3*w),color:x,textAlign:'center',alignSelf:'center',maxWidth:'100%'},children:t.short??t.label})]},t.id)})})};var t=r(d[0]),n=e(r(d[1])),o=e(r(d[2])),l=e(r(d[3])),s=e(r(d[4])),c=r(d[5]),u=r(d[6]),f=r(d[7]);const h=56},1220,[17,385,329,85,409,804,1178,8]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return f}});var t=r(d[0]);r(d[1]);var n=r(d[2]),u=r(d[3]),c=r(d[4]);function f(){return(0,u.canShow)('chef')?(0,c.jsx)(n.ChefApp,{}):(0,c.jsx)(t.Redirect,{href:u.ENTRY[u.APP_VARIANT]})}},1221,[13,17,775,856,8]); -__d(function(g,_r,_i,_a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return A}});var e,t=_r(d[0]),o=_r(d[1]),n=_r(d[2]),s=_r(d[3]),l=_r(d[4]),i=_r(d[5]),a=_r(d[6]),r=_r(d[7]),u=(e=r)&&e.__esModule?e:{default:e},c=_r(d[8]),h=_r(d[9]),p=_r(d[10]),b=_r(d[11]),f=_r(d[12]),y=_r(d[13]),x=_r(d[14]),k=_r(d[15]),j=_r(d[16]),v=_r(d[17]),S=_r(d[18]),w=_r(d[19]),T=_r(d[20]),C=_r(d[21]),D=_r(d[22]),$=_r(d[23]),P=_r(d[24]),M=_r(d[25]),B=_r(d[26]),O=_r(d[27]);function A(){const{rid:e,date:r}=(0,s.useLocalSearchParams)(),A=(0,j.useRestaurant)(e),N=(0,j.useCustomer)(),z=(0,j.useBookings)(e),I=(0,j.useEvents)(e),R=(0,j.useNow)(6e4),[q]=(0,l.useState)(()=>(0,a.startForm)()),[F,L]=(0,l.useState)(''),[E,H]=(0,l.useState)(2),[W,_]=(0,l.useState)(0),Y=Math.min(W,Math.max(0,E-1)),[U,G]=(0,l.useState)(r??(0,k.ymd)(R)),[Q,V]=(0,l.useState)(null),[J,K]=(0,l.useState)(N.name),[X,Z]=(0,l.useState)(N.phone??''),[ee,te]=(0,l.useState)(N.email??''),[oe,ne]=(0,l.useState)(!1),[se,le]=(0,l.useState)(''),[ie,ae]=(0,l.useState)(!1),[re,de]=(0,l.useState)([]),[ue,ce]=(0,l.useState)(!1),he=[...N.allergies,...re.filter(e=>!N.allergies.some(t=>t.allergen===e)).map(e=>({allergen:e,severity:'allergy'}))],[me,ge]=(0,l.useState)(null),pe=(0,C.useBlocks)(e=>e.blocks);(0,v.usePublicDayStore)(e=>e.n);const be=e?(0,v.publicDay)(e,U):null,fe=be?[...be.bookings,...z.filter(e=>e.date!==U)]:z,ye=be?[...pe.filter(t=>t.rid!==e||t.date!==U),...be.blocks]:pe,xe=(0,D.usePlan)(e),[ke,je]=(0,l.useState)((0,P.emptyNeeds)()),ve=!0===ke.dog,Se=ve?ke.dogs:0;if(!A)return(0,O.jsx)(b.Screen,{title:"Not found",children:(0,O.jsx)(b.T,{children:"Restaurant not found."})});const we=A.settings,Te=(0,k.parseYmd)(U),Ce=(0,x.onlinePartyBounds)(A),De=(0,C.blocksOn)(ye,A.id,U),$e=fe.filter(e=>e.date===U),Pe=xe.areas.filter(e=>e.dogs),Me=(0,M.dogSetUp)(xe),Be=e=>(0,$.freeTablesAt)(xe,$e,E,new Date(`${U}${(0,t.tableNumbers)(e)}:00`),(0,$.turnFor)(E,we.turnMins),we.turnMins,{dog:!0,closed:(0,C.closedAreasAt)(ye,A.id,U,e)}),Oe=(0,x.bookingSlots)(A,Te,e=>fe.filter(t=>t.date===U&&t.time===e&&!['cancelled','noshow'].includes(t.status)).reduce((e,t)=>e+t.partySize,0),E,R,e=>fe.filter(t=>t.date===U&&t.time===e&&!['cancelled','noshow'].includes(t.status)).length).map(e=>{const t=(0,C.blockAt)(ye,A.id,U,e.time),o=ve&&Me&&e.available&&!t&&(!Be(e.time).length||!(0,P.dogTimeOk)(A,fe,U,e.time,Se));return{...e,blocked:!!t,noDog:o,available:e.available&&!t&&!o}}),Ae=Oe.some(e=>e.available),Ne=(0,c.depositOf)(we),ze=(0,c.depositDue)(Ne,E,Y),Ie=ze>0?'deposit':'none',Re=(0,c.depositWords)(Ne,E,A.name,Y),qe=I.filter(e=>e.date===U),Fe=(0,T.guestPhone)(X),Le=(0,T.emailOk)(ee),Ee=(0,P.needsMissing)(ke,N.allergies),He=!!Q&&ie&&!Ee.length&&J.trim().length>1&&Fe.ok&&Le,We=async()=>{const e=(0,P.needsPatch)(ke,N.allergies),t=ve&&Me?Be(Q).map(e=>e.table):[],o=ve?ke.tableReq.find(e=>t.includes(e))??t[0]:void 0,n=await j.repo.bookings.create({restaurantId:A.id,customerId:N.id,name:J,partySize:E,...Y?{children:Y}:{},date:U,time:Q,notes:se.trim(),security:Ie,depositPaid:0,...ze?{depositDue:ze,depositPolicy:Re.join(' '),depositRefundable:Ne.refundable,depositCutoffHours:Ne.cutoffHours}:{},phone:Fe.pretty,email:ee.trim()||void 0,source:'online',...e,...Oe.find(e=>e.time===Q)?.drinksOnly?{drinksOnly:!0}:{},allergies:e.allergies??he,...o?{table:o}:{}});(0,a.rememberGuard)(n.id,(0,a.guardFor)({...q,hp:F})),ge(n)},Ye=(0,j.useStore)(e=>me?e.bookings.find(e=>e.id===me.id)?.ref:void 0),Ue=e=>(0,w.waMeLink)(A.settings.whatsapp,(0,w.guestWhatsAppText)({name:e.name,ref:Ye??e.ref,date:e.date,time:e.time,partySize:e.partySize},A.name));if(me){const e='pending'===me.status;return(0,O.jsxs)(b.Screen,{title:e?'Booking request received':'Booking confirmed',subtitle:A.name,children:[(0,O.jsx)(b.Banner,{kind:e?'info':'success',title:`Reference ${Ye??me.ref}`,children:`${me.partySize} people \xb7 ${(0,k.niceDateYear)((0,k.parseYmd)(me.date))} at ${me.time}`}),e?(0,O.jsx)(b.Banner,{kind:"warn",title:"The team will confirm shortly",children:"For larger parties and special requests, a member of the team checks your booking first. Contact the venue if you need an update."}):null,(0,O.jsxs)(b.Card,{children:[(0,O.jsxs)(b.T,{children:["Name: ",me.name]}),(0,O.jsxs)(b.T,{children:["Mobile: ",me.phone]}),me.email?(0,O.jsxs)(b.T,{children:["Email: ",me.email]}):null,(0,O.jsxs)(b.T,{children:["Allergies shared with the restaurant: ",me.allergies.length?me.allergies.map(e=>`${(0,f.allergenLabel)(e.allergen)} (${(0,f.severityLabel)(e.severity)})`).join(', '):'none']}),me.notes?(0,O.jsxs)(b.T,{children:["Notes: ",me.notes]}):null,me.dog?(0,O.jsxs)(b.T,{children:["\ud83d\udc15 Dog coming too",me.table?` \xb7 dog-friendly table ${me.table}`:'']}):null,me.holds?.length?(0,O.jsxs)(b.T,{children:["Reserved: ",me.holds.map(e=>`${e.qty} \xd7 ${'item'===e.kind?(A.settings.reservables??M.ANCHORAGE_RESERVABLES).find(t=>t.id===e.id)?.name??'item':e.id}`).join(', ')," (the kitchen confirms it)"]}):null,me.tableReq?.length?(0,O.jsxs)(b.T,{children:["Table requested: ",me.tableReq.map(e=>`${(0,t.tableNumbers)(e)}`).join(' or ')," (not guaranteed, but we\u2019ll do our best)"]}):null,'deposit'===me.security&&me.depositDue?(0,O.jsxs)(b.T,{weight:"semibold",children:["Deposit due: ",(0,y.gbp)(me.depositDue),". ",A.name," will tell you how to pay it."]}):null,'deposit'===me.security&&me.depositPolicy?(0,O.jsx)(b.Muted,{children:me.depositPolicy}):null,(0,O.jsx)(b.Muted,{children:"Your booking details are shown above. If you need confirmation, contact the venue and quote your reference."}),(0,O.jsxs)(b.Muted,{children:["Need to change or cancel? Call ",A.phone," and quote ",Ye??me.ref,"."]})]}),Ue(me)?(0,O.jsxs)(u.default,{style:{gap:4},children:[(0,O.jsx)(b.Button,{kind:"secondary",label:"\ud83d\udcac Message us on WhatsApp",testID:"guest-whatsapp",onPress:()=>{const e=Ue(me);e&&(0,w.openWhatsApp)(e)}}),(0,O.jsx)(b.Muted,{size:13,children:"Opens WhatsApp with your booking details typed in. You can change the message before you send it."})]}):null,(0,O.jsx)(b.Button,{label:"Back to restaurant",onPress:()=>s.router.replace(`/customer/${A.id}`)})]})}return(0,O.jsxs)(b.Screen,{title:"Book a table",subtitle:A.name,footer:(0,O.jsx)(b.Button,{label:Ee.length?Ee[0]:E>(we.autoAcceptUpTo??7)?'Send booking request':'Confirm booking',disabled:!He,onPress:()=>We(),testID:"confirm-booking"}),children:[(0,O.jsx)(P.FirstQuestions,{rid:A.id,value:ke,onChange:e=>{e.dog===ke.dog&&e.dogs===ke.dogs||V(null),je(e)},party:E,audience:"guest",profile:N.allergies}),(0,O.jsxs)(b.Card,{children:[(0,O.jsxs)(u.default,{style:{gap:6,alignItems:'center'},children:[(0,O.jsx)(b.H2,{children:"Party size"}),(0,O.jsx)(o.PartySizeInput,{value:E,onChange:e=>{H(e),V(null)},min:Ce.min,max:Ce.max,label:"Party size",testID:"party-size"})]}),(0,O.jsx)(h.ChildrenCount,{guest:!0,party:E,value:Y,onChange:_,depositsOn:Ne.on&&Ne.perPersonPence>0,testID:"book-children"}),ze?(0,O.jsx)(b.Banner,{kind:"info",title:Y?`Deposit: ${(0,y.gbp)(ze)} for ${E-Y} adults (children free)`:`Deposit: ${(0,y.gbp)(ze)} for ${E} guests`,children:(0,O.jsx)(u.default,{style:{gap:4},children:Re.map(e=>(0,O.jsx)(b.T,{size:13,children:e},e))})}):Ne.on&&Ne.perPersonPence>0?(0,O.jsxs)(b.Muted,{children:["No deposit for fewer than ",Ne.fromParty," guests."]}):null,E>(we.autoAcceptUpTo??7)?(0,O.jsxs)(b.Muted,{children:["For ",E," people the team checks the booking first, then texts you to confirm."]}):null,ve&&Me?(0,O.jsxs)(b.Muted,{children:["Dogs are welcome in the ",Pe.map(e=>`${e.name}${e.outdoor?' (outdoors, weather permitting)':''}`).join(' and ')||'dog-friendly tables',". We\u2019ll only show times with a dog-friendly table",A.settings.maxDogsPerSlot?' and room for your dog':'',"."]}):null]}),(0,O.jsxs)(b.Card,{children:[(0,O.jsx)(b.H2,{children:"Date"}),(0,O.jsx)(B.CustomerDatePicker,{r:A,today:R,value:U,events:I,onChange:e=>{G(e),V(null)}}),qe.map(e=>(0,O.jsx)(b.Banner,{kind:"demo",title:e.title,children:e.description},e.id))]}),(0,O.jsxs)(b.Card,{children:[(0,O.jsx)(b.H2,{children:"Time"}),0===Oe.length?(0,O.jsx)(b.Muted,{children:"Closed on this day (per listed kitchen hours)."}):(0,O.jsx)(b.Row,{wrap:!0,gap:6,children:Oe.map(e=>(0,O.jsx)(b.Chip,{testID:`book-slot-${e.time}`,label:e.time,sub:e.available?e.drinksOnly?'Drinks only':void 0:e.blocked?'Unavailable':e.noDog?'No dog table':e.leftV(e.time)},e.time))}),De.length>0&&Oe.some(e=>e.blocked)?(0,O.jsx)(b.Banner,{kind:"info",title:Ae?'Some times aren\u2019t available online':'Online booking isn\u2019t available for this time',children:`We\u2019re not taking online bookings ${De.map(e=>`${e.from}\u2013${e.to}`).join(', ')} on ${(0,k.niceDate)(Te)}. Please give us a ring on ${A.phone??"the restaurant"} and we\u2019ll do our best to fit you in.`}):null,(()=>{const e=(0,n.lastFoodOn)(A,U);return e&&Oe.some(e=>e.drinksOnly)?(0,O.jsx)(b.Banner,{kind:"info",title:`Last food orders ${(0,n.fmt12)(e.time)}${'kitchen closes'!==e.reason?` (${e.reason})`:''}`,children:"Times marked \u201cDrinks only\u201d are after the kitchen\u2019s last food orders that day: you\u2019re welcome for drinks, but we can\u2019t serve food."}):null})(),ve&&Oe.some(e=>e.noDog)?(0,O.jsx)(b.Banner,{kind:"info",title:"Some times are full for dogs",children:`Times marked "No dog table" are full in the ${Pe.map(e=>e.name).join(' and ')}${A.settings.maxDogsPerSlot?' or already have the most dogs we can look after':''}${(0,C.closedAreasAt)(ye,A.id,U,Q??'12:00').size?', or the garden is closed for weather':''}. We\u2019d love to see you both, so please try one of the other times shown.`}):null,(0,O.jsx)(b.Muted,{children:(0,x.bookingLimitsHint)(A)})]}),(0,O.jsx)(P.MoreQuestions,{rid:A.id,r:A,value:ke,onChange:je,party:E,date:U,time:Q,today:(0,k.ymd)(R),bookings:fe,audience:"guest",showTables:!0}),(0,O.jsxs)(b.Card,{highlight:ie?void 0:S.colours.amber,children:[(0,O.jsx)(b.Field,{label:"Notes (optional)",value:se,onChangeText:le,placeholder:p.NOTES_PLACEHOLDER,multiline:!0,numberOfLines:3,testID:"book-notes"}),(0,O.jsx)(b.Toggle,{label:"I confirm the allergy information for this booking",value:ie,onChange:ae}),(0,O.jsx)(b.Muted,{children:"Table requests aren\u2019t guaranteed, but we\u2019ll do our best. Nothing here is charged now; reserved dishes are paid on the night."})]}),(0,O.jsxs)(b.Card,{children:[(0,O.jsx)(b.H2,{children:"Your details"}),(0,O.jsx)(b.Field,{label:"Name for the booking",value:J,onChangeText:K}),(0,O.jsx)(b.Field,{testID:"book-phone",label:"Mobile number (needed to book)",value:X,onChangeText:Z,onBlur:()=>ne(!0),keyboardType:"phone-pad",autoComplete:"tel",placeholder:"e.g. 07700 900123"}),Fe.ok||!oe&&!X?null:(0,O.jsx)(b.T,{size:13,colour:S.colours.amber,children:Fe.error}),(0,O.jsx)(b.Field,{testID:"book-email",label:"Email (optional)",value:ee,onChangeText:te,keyboardType:"email-address",autoCapitalize:"none",autoComplete:"email",placeholder:"you@example.com"}),Le?null:(0,O.jsx)(b.T,{size:13,colour:S.colours.amber,children:"That email doesn\u2019t look quite right. Check it, or leave it blank."}),(0,O.jsxs)(b.Muted,{children:["We\u2019ll text you a confirmation",ee.trim()?' and email it too':'',", with how to change or cancel. We only use your number for this booking."]})]}),(0,O.jsx)(i.Honeypot,{value:F,onChange:L})]})}},1222,[843,1095,861,13,17,1223,963,85,841,1224,1108,777,845,851,1101,863,858,946,804,1175,848,993,996,1074,1103,1053,1225,8]); +__d(function(g,_r,_i,_a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return A}});var e,t=_r(d[0]),o=_r(d[1]),n=_r(d[2]),s=_r(d[3]),a=_r(d[4]),l=_r(d[5]),i=_r(d[6]),r=_r(d[7]),u=(e=r)&&e.__esModule?e:{default:e},c=_r(d[8]),h=_r(d[9]),p=_r(d[10]),b=_r(d[11]),f=_r(d[12]),y=_r(d[13]),x=_r(d[14]),k=_r(d[15]),j=_r(d[16]),v=_r(d[17]),w=_r(d[18]),S=_r(d[19]),C=_r(d[20]),T=_r(d[21]),D=_r(d[22]),$=_r(d[23]),P=_r(d[24]),M=_r(d[25]),B=_r(d[26]),O=_r(d[27]);function A(){const{rid:e,date:r}=(0,s.useLocalSearchParams)(),A=(0,j.useRestaurant)(e),N=(0,j.useCustomer)(),z=(0,j.useBookings)(e),I=(0,j.useEvents)(e),R=(0,j.useNow)(6e4),[q]=(0,a.useState)(()=>(0,i.startForm)()),[F,L]=(0,a.useState)(''),[E,H]=(0,a.useState)(2),[W,_]=(0,a.useState)(0),Y=Math.min(W,Math.max(0,E-1)),[U,G]=(0,a.useState)(r??(0,k.ymd)(R)),[Q,V]=(0,a.useState)(null),[J,K]=(0,a.useState)(N.name),[X,Z]=(0,a.useState)(N.phone??''),[ee,te]=(0,a.useState)(N.email??''),[oe,ne]=(0,a.useState)(!1),[se,ae]=(0,a.useState)(''),[le,ie]=(0,a.useState)(!1),[re,de]=(0,a.useState)([]),[ue,ce]=(0,a.useState)(!1),he=[...N.allergies,...re.filter(e=>!N.allergies.some(t=>t.allergen===e)).map(e=>({allergen:e,severity:'allergy'}))],[me,ge]=(0,a.useState)(null),pe=(0,T.useBlocks)(e=>e.blocks);(0,v.usePublicDayStore)(e=>e.n);const be=e?(0,v.publicDay)(e,U):null,fe=be?[...be.bookings,...z.filter(e=>e.date!==U)]:z,ye=be?[...pe.filter(t=>t.rid!==e||t.date!==U),...be.blocks]:pe,xe=(0,D.usePlan)(e),[ke,je]=(0,a.useState)((0,P.emptyNeeds)()),ve=!0===ke.dog,we=ve?ke.dogs:0;if(!A)return(0,O.jsx)(b.Screen,{title:"Not found",children:(0,O.jsx)(b.T,{children:"Restaurant not found."})});const Se=A.settings,Ce=(0,k.parseYmd)(U),Te=(0,x.onlinePartyBounds)(A),De=(0,T.blocksOn)(ye,A.id,U),$e=fe.filter(e=>e.date===U),Pe=xe.areas.filter(e=>e.dogs),Me=(0,M.dogSetUp)(xe),Be=e=>(0,$.freeTablesAt)(xe,$e,E,new Date(`${U}${(0,t.tableNumbers)(e)}:00`),(0,$.turnFor)(E,Se.turnMins),Se.turnMins,{dog:!0,closed:(0,T.closedAreasAt)(ye,A.id,U,e)}),Oe=(0,x.bookingSlots)(A,Ce,e=>fe.filter(t=>t.date===U&&t.time===e&&!['cancelled','noshow'].includes(t.status)).reduce((e,t)=>e+t.partySize,0),E,R,e=>fe.filter(t=>t.date===U&&t.time===e&&!['cancelled','noshow'].includes(t.status)).length).map(e=>{const t=(0,T.blockAt)(ye,A.id,U,e.time),o=ve&&Me&&e.available&&!t&&(!Be(e.time).length||!(0,P.dogTimeOk)(A,fe,U,e.time,we));return{...e,blocked:!!t,noDog:o,available:e.available&&!t&&!o}}),Ae=Oe.some(e=>e.available),Ne=(0,c.depositOf)(Se),ze=(0,c.depositDue)(Ne,E,Y),Ie=ze>0?'deposit':'none',Re=(0,c.depositWords)(Ne,E,A.name,Y),qe=I.filter(e=>e.date===U),Fe=(0,C.guestPhone)(X),Le=(0,C.emailOk)(ee),Ee=(0,P.needsMissing)(ke,N.allergies),He=!!Q&&le&&!Ee.length&&J.trim().length>1&&Fe.ok&&Le,We=async()=>{const e=(0,P.needsPatch)(ke,N.allergies),t=ve&&Me?Be(Q).map(e=>e.table):[],o=ve?ke.tableReq.find(e=>t.includes(e))??t[0]:void 0,n=await j.repo.bookings.create({restaurantId:A.id,customerId:N.id,name:J,partySize:E,...Y?{children:Y}:{},date:U,time:Q,notes:se.trim(),security:Ie,depositPaid:0,...ze?{depositDue:ze,depositPolicy:Re.join(' '),depositRefundable:Ne.refundable,depositCutoffHours:Ne.cutoffHours}:{},phone:Fe.pretty,email:ee.trim()||void 0,source:'online',...e,...Oe.find(e=>e.time===Q)?.drinksOnly?{drinksOnly:!0}:{},allergies:e.allergies??he,...o?{table:o}:{}});(0,i.rememberGuard)(n.id,(0,i.guardFor)({...q,hp:F})),ge(n)},Ye=(0,j.useStore)(e=>me?e.bookings.find(e=>e.id===me.id)?.ref:void 0),Ue=e=>(0,S.waMeLink)(A.settings.whatsapp,(0,S.guestWhatsAppText)({name:e.name,ref:Ye??e.ref,date:e.date,time:e.time,partySize:e.partySize},A.name));if(me){const e='pending'===me.status;return(0,O.jsxs)(b.Screen,{title:e?'Booking request received':'Booking confirmed',subtitle:A.name,children:[(0,O.jsx)(b.Banner,{kind:e?'info':'success',title:`Reference ${Ye??me.ref}`,children:`${me.partySize} people \xb7 ${(0,k.niceDateYear)((0,k.parseYmd)(me.date))} at ${me.time}`}),e?(0,O.jsx)(b.Banner,{kind:"warn",title:"The team will confirm shortly",children:"For larger parties and special requests, a member of the team checks your booking first. Contact the venue if you need an update."}):null,(0,O.jsxs)(b.Card,{children:[(0,O.jsxs)(b.T,{children:["Name: ",me.name]}),(0,O.jsxs)(b.T,{children:["Mobile: ",me.phone]}),me.email?(0,O.jsxs)(b.T,{children:["Email: ",me.email]}):null,(0,O.jsxs)(b.T,{children:["Allergies shared with the restaurant: ",me.allergies.length?me.allergies.map(e=>`${(0,f.allergenLabel)(e.allergen)} (${(0,f.severityLabel)(e.severity)})`).join(', '):'none']}),me.notes?(0,O.jsxs)(b.T,{children:["Notes: ",me.notes]}):null,me.dog?(0,O.jsxs)(b.T,{children:["\ud83d\udc15 Dog coming too",me.table?` \xb7 dog-friendly table ${me.table}`:'']}):null,me.holds?.length?(0,O.jsxs)(b.T,{children:["Reserved: ",me.holds.map(e=>`${e.qty} \xd7 ${'item'===e.kind?(A.settings.reservables??M.ANCHORAGE_RESERVABLES).find(t=>t.id===e.id)?.name??'item':e.id}`).join(', ')," (the kitchen confirms it)"]}):null,me.tableReq?.length?(0,O.jsxs)(b.T,{children:["Table requested: ",me.tableReq.map(e=>`${(0,t.tableNumbers)(e)}`).join(' or ')," (not guaranteed, but we\u2019ll do our best)"]}):null,'deposit'===me.security&&me.depositDue?(0,O.jsxs)(b.T,{weight:"semibold",children:["Deposit due: ",(0,y.gbp)(me.depositDue),". ",A.name," will tell you how to pay it."]}):null,'deposit'===me.security&&me.depositPolicy?(0,O.jsx)(b.Muted,{children:me.depositPolicy}):null,(0,O.jsx)(b.Muted,{children:"Your booking details are shown above. If you need confirmation, contact the venue and quote your reference."}),(0,O.jsxs)(b.Muted,{children:["Need to change or cancel? Call ",A.phone," and quote ",Ye??me.ref,"."]})]}),Ue(me)?(0,O.jsxs)(u.default,{style:{gap:4},children:[(0,O.jsx)(b.Button,{kind:"secondary",label:"\ud83d\udcac Message us on WhatsApp",testID:"guest-whatsapp",onPress:()=>{const e=Ue(me);e&&(0,S.openWhatsApp)(e)}}),(0,O.jsx)(b.Muted,{size:13,children:"Opens WhatsApp with your booking details typed in. You can change the message before you send it."})]}):null,(0,O.jsx)(b.Button,{label:"Back to restaurant",onPress:()=>s.router.replace(`/customer/${A.id}`)})]})}return(0,O.jsxs)(b.Screen,{title:"Book a table",subtitle:A.name,footer:(0,O.jsx)(b.Button,{label:Ee.length?Ee[0]:E>(Se.autoAcceptUpTo??7)?'Send booking request':'Confirm booking',disabled:!He,onPress:()=>We(),testID:"confirm-booking"}),children:[(0,O.jsx)(P.FirstQuestions,{rid:A.id,value:ke,onChange:e=>{e.dog===ke.dog&&e.dogs===ke.dogs||V(null),je(e)},party:E,audience:"guest",profile:N.allergies}),(0,O.jsxs)(b.Card,{children:[(0,O.jsxs)(u.default,{style:{gap:6,alignItems:'center'},children:[(0,O.jsx)(b.H2,{children:"Party size"}),(0,O.jsx)(o.PartySizeInput,{value:E,onChange:e=>{H(e),V(null)},min:Te.min,max:Te.max,label:"Party size",testID:"party-size"})]}),(0,O.jsx)(h.ChildrenCount,{guest:!0,party:E,value:Y,onChange:_,depositsOn:Ne.on&&Ne.perPersonPence>0,testID:"book-children"}),ze?(0,O.jsx)(b.Banner,{kind:"info",title:Y?`Deposit: ${(0,y.gbp)(ze)} for ${E-Y} adults (children don't count towards the ${Ne.fromParty} and don't pay)`:`Deposit: ${(0,y.gbp)(ze)} for ${E} adults`,children:(0,O.jsx)(u.default,{style:{gap:4},children:Re.map(e=>(0,O.jsx)(b.T,{size:13,children:e},e))})}):Ne.on&&Ne.perPersonPence>0?(0,O.jsxs)(b.Muted,{children:["No deposit for fewer than ",Ne.fromParty," adults. Children don't count towards the ",Ne.fromParty," and don't pay, and staff can waive a deposit."]}):null,E>(Se.autoAcceptUpTo??7)?(0,O.jsxs)(b.Muted,{children:["For ",E," people the team checks the booking first, then texts you to confirm."]}):null,ve&&Me?(0,O.jsxs)(b.Muted,{children:["Dogs are welcome in the ",Pe.map(e=>`${e.name}${e.outdoor?' (outdoors, weather permitting)':''}`).join(' and ')||'dog-friendly tables',". We\u2019ll only show times with a dog-friendly table",A.settings.maxDogsPerSlot?' and room for your dog':'',"."]}):null]}),(0,O.jsxs)(b.Card,{children:[(0,O.jsx)(b.H2,{children:"Date"}),(0,O.jsx)(B.CustomerDatePicker,{r:A,today:R,value:U,events:I,onChange:e=>{G(e),V(null)}}),qe.map(e=>(0,O.jsx)(b.Banner,{kind:"demo",title:e.title,children:e.description},e.id))]}),(0,O.jsxs)(b.Card,{children:[(0,O.jsx)(b.H2,{children:"Time"}),0===Oe.length?(0,O.jsx)(b.Muted,{children:"Closed on this day (per listed kitchen hours)."}):(0,O.jsx)(b.Row,{wrap:!0,gap:6,children:Oe.map(e=>(0,O.jsx)(b.Chip,{testID:`book-slot-${e.time}`,label:e.time,sub:e.available?e.drinksOnly?'Drinks only':void 0:e.blocked?'Unavailable':e.noDog?'No dog table':e.leftV(e.time)},e.time))}),De.length>0&&Oe.some(e=>e.blocked)?(0,O.jsx)(b.Banner,{kind:"info",title:Ae?'Some times aren\u2019t available online':'Online booking isn\u2019t available for this time',children:`We\u2019re not taking online bookings ${De.map(e=>`${e.from}\u2013${e.to}`).join(', ')} on ${(0,k.niceDate)(Ce)}. Please give us a ring on ${A.phone??"the restaurant"} and we\u2019ll do our best to fit you in.`}):null,(()=>{const e=(0,n.lastFoodOn)(A,U);return e&&Oe.some(e=>e.drinksOnly)?(0,O.jsx)(b.Banner,{kind:"info",title:`Last food orders ${(0,n.fmt12)(e.time)}${'kitchen closes'!==e.reason?` (${e.reason})`:''}`,children:"Times marked \u201cDrinks only\u201d are after the kitchen\u2019s last food orders that day: you\u2019re welcome for drinks, but we can\u2019t serve food."}):null})(),ve&&Oe.some(e=>e.noDog)?(0,O.jsx)(b.Banner,{kind:"info",title:"Some times are full for dogs",children:`Times marked "No dog table" are full in the ${Pe.map(e=>e.name).join(' and ')}${A.settings.maxDogsPerSlot?' or already have the most dogs we can look after':''}${(0,T.closedAreasAt)(ye,A.id,U,Q??'12:00').size?', or the garden is closed for weather':''}. We\u2019d love to see you both, so please try one of the other times shown.`}):null,(0,O.jsx)(b.Muted,{children:(0,x.bookingLimitsHint)(A)})]}),(0,O.jsx)(P.MoreQuestions,{rid:A.id,r:A,value:ke,onChange:je,party:E,date:U,time:Q,today:(0,k.ymd)(R),bookings:fe,audience:"guest",showTables:!0}),(0,O.jsxs)(b.Card,{highlight:le?void 0:w.colours.amber,children:[(0,O.jsx)(b.Field,{label:"Notes (optional)",value:se,onChangeText:ae,placeholder:p.NOTES_PLACEHOLDER,multiline:!0,numberOfLines:3,testID:"book-notes"}),(0,O.jsx)(b.Toggle,{label:"I confirm the allergy information for this booking",value:le,onChange:ie}),(0,O.jsx)(b.Muted,{children:"Table requests aren\u2019t guaranteed, but we\u2019ll do our best. Nothing here is charged now; reserved dishes are paid on the night."})]}),(0,O.jsxs)(b.Card,{children:[(0,O.jsx)(b.H2,{children:"Your details"}),(0,O.jsx)(b.Field,{label:"Name for the booking",value:J,onChangeText:K}),(0,O.jsx)(b.Field,{testID:"book-phone",label:"Mobile number (needed to book)",value:X,onChangeText:Z,onBlur:()=>ne(!0),keyboardType:"phone-pad",autoComplete:"tel",placeholder:"e.g. 07700 900123"}),Fe.ok||!oe&&!X?null:(0,O.jsx)(b.T,{size:13,colour:w.colours.amber,children:Fe.error}),(0,O.jsx)(b.Field,{testID:"book-email",label:"Email (optional)",value:ee,onChangeText:te,keyboardType:"email-address",autoCapitalize:"none",autoComplete:"email",placeholder:"you@example.com"}),Le?null:(0,O.jsx)(b.T,{size:13,colour:w.colours.amber,children:"That email doesn\u2019t look quite right. Check it, or leave it blank."}),(0,O.jsxs)(b.Muted,{children:["We\u2019ll text you a confirmation",ee.trim()?' and email it too':'',", with how to change or cancel. We only use your number for this booking."]})]}),(0,O.jsx)(l.Honeypot,{value:F,onChange:L})]})}},1222,[843,1095,861,13,17,1223,963,85,841,1224,1108,777,845,851,1101,863,858,946,804,1175,848,993,996,1074,1103,1053,1225,8]); __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.Honeypot=function({value:t,onChange:n}){return(0,l.jsx)(o.default,{"aria-hidden":!0,pointerEvents:"none",style:{position:'absolute',left:-1e4,top:0,width:1,height:1,overflow:'hidden',opacity:0},children:(0,l.jsx)(e.TextInput,{testID:"hp-field",accessibilityLabel:"Leave this empty",value:t,onChangeText:n,tabIndex:-1,autoComplete:'off',name:'cc_extra_info','aria-hidden':!0})})};var e=r(d[0]);r(d[1]),r(d[2]);var t,n=r(d[3]),o=(t=n)&&t.__esModule?t:{default:t},l=r(d[4])},1223,[812,17,219,85,8]); -__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"maxChildren",{enumerable:!0,get:function(){return u}}),_e.ChildrenCount=function({party:e,value:t,onChange:o,depositsOn:h,testID:c="children-count",guest:p}){const f=u(e);if(f<1)return null;const x=Math.min(t,f);return(0,s.jsxs)(n.default,{style:{gap:6,alignItems:'center',width:'100%'},testID:c,children:[(0,s.jsx)(l.T,{size:17,weight:"semibold",center:!0,children:p?`How many of the ${e} are children?`:`Children in the ${e}`}),(0,s.jsx)(l.Stepper,{value:x,onChange:e=>o(Math.max(0,Math.min(f,e))),min:0,max:f,label:"children",testID:`${c}-stepper`,format:e=>e?String(e):'None'}),h?(0,s.jsx)(l.Muted,{center:!0,children:"Children never pay a deposit."}):null]})},r(d[0]);var e,t=r(d[1]),n=(e=t)&&e.__esModule?e:{default:e},l=r(d[2]),s=r(d[3]);const u=e=>Math.max(0,Math.round(Number(e)||0)-1)},1224,[17,85,777,8]); +__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"maxChildren",{enumerable:!0,get:function(){return o}}),_e.ChildrenCount=function({party:e,value:t,onChange:u,depositsOn:h,testID:c="children-count",guest:p}){const f=o(e);if(f<1)return null;const x=Math.min(t,f);return(0,s.jsxs)(n.default,{style:{gap:6,alignItems:'center',width:'100%'},testID:c,children:[(0,s.jsx)(l.T,{size:17,weight:"semibold",center:!0,children:p?`How many of the ${e} are children?`:`Children in the ${e}`}),(0,s.jsx)(l.Stepper,{value:x,onChange:e=>u(Math.max(0,Math.min(f,e))),min:0,max:f,label:"children",testID:`${c}-stepper`,format:e=>e?String(e):'None'}),h?(0,s.jsx)(l.Muted,{center:!0,children:"Children don't count towards the number that needs a deposit, and never pay."}):null]})},r(d[0]);var e,t=r(d[1]),n=(e=t)&&e.__esModule?e:{default:e},l=r(d[2]),s=r(d[3]);const o=e=>Math.max(0,Math.round(Number(e)||0)-1)},1224,[17,85,777,8]); __d(function(g,_r,_i,a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.CustomerDatePicker=function({r:e,today:m,value:D,events:x,onChange:f}){const p=(0,n.ymd)(m),j=(0,r.lastBookableDay)(p,e),[C,w]=(0,t.useState)(!1),[Y,k]=(0,t.useState)((0,i.slashDay)(D)),[I,P]=(0,t.useState)(D);I!==D&&(P(D),k((0,i.slashDay)(D)));const T=new Date(m);T.setHours(12,0,0,0);const $=Array.from({length:b},(e,t)=>{const s=new Date(T);return s.setDate(T.getDate()+t),s}).filter(e=>(0,n.ymd)(e)<=j),v=t=>!!(0,o.hoursFor)(e,t),F=(0,n.parseYmd)(D),[L,M]=(0,t.useState)(()=>({y:F.getFullYear(),m:F.getMonth()})),S=(new Date(L.y,L.m,1,12).getDay()+6)%7,R=new Date(L.y,L.m+1,0).getDate(),A=[...Array.from({length:S},()=>null),...Array.from({length:R},(e,t)=>new Date(L.y,L.m,t+1,12))];for(;A.length%7;)A.push(null);const z=(0,n.parseYmd)(j),W=L.y>m.getFullYear()||L.y===m.getFullYear()&&L.m>m.getMonth(),B=L.yM(({y:t,m:s})=>{const l=new Date(t,s+e,1);return{y:l.getFullYear(),m:l.getMonth()}}),_=Y===(0,i.slashDay)(D)?null:(0,r.typedBookDateProblem)(Y,p,e),O=e=>{f(e),w(!1)},G=(e,t)=>0===t?'Today':1===t?'Tomorrow':`${(0,n.dayShort)(e)} ${e.getDate()}`,N=$.some(e=>(0,n.ymd)(e)===D);return(0,h.jsxs)(l.default,{testID:"cust-date",style:{gap:10,alignItems:'center',width:'100%'},children:[(0,h.jsx)(l.default,{accessible:!0,accessibilityLiveRegion:"polite",testID:"cust-date-chosen",children:(0,h.jsx)(d.T,{center:!0,weight:"semibold",colour:c.colours.goldLight,children:`Booking for ${(0,n.niceDateYear)(F)}${v(F)?'':' (closed that day)'}`})}),(0,h.jsxs)(d.Row,{wrap:!0,gap:6,style:{justifyContent:'center'},children:[$.map((e,t)=>{const s=(0,n.ymd)(e),l=x.some(e=>e.date===s);return(0,h.jsx)(d.Chip,{testID:`cust-day-${s}`,label:G(e,t),sub:v(e)?l?'\u2605 event':void 0:'Closed',disabled:!v(e),selected:D===s,accessibilityLabel:`${(0,n.niceDate)(e)}${v(e)?l?', event':'':', closed'}`,onPress:()=>O(s)},s)}),N?null:(0,h.jsx)(d.Chip,{label:(0,n.niceDate)(F),sub:v(F)?void 0:'Closed',selected:!0,onPress:()=>w(!0),accessibilityLabel:`Chosen: ${(0,n.niceDateYear)(F)}. Opens the calendar`})]}),(0,h.jsxs)(l.default,{style:{width:'100%',maxWidth:360,gap:4},children:[(0,h.jsx)(d.Field,{label:"Any other date (DD/MM/YYYY)",testID:"cust-date-typed",value:Y,placeholder:"24/12/2026",keyboardType:"numbers-and-punctuation",maxLength:10,autoCapitalize:"none",autoCorrect:!1,style:{textAlign:'center'},accessibilityLabel:"Booking date, typed as day, month and four-digit year",onChangeText:t=>{const s=(0,i.slashDate)(t,Y);k(s);const l=(0,i.dayFromSlash)(s);l&&!(0,r.typedBookDateProblem)(s,p,e)&&f(l)}}),_&&Y.length>=10?(0,h.jsx)(d.T,{center:!0,size:15,colour:c.colours.amber,testID:"cust-date-problem",children:_}):null]}),(0,h.jsx)(d.Button,{kind:"secondary",label:C?'Hide calendar':'\ud83d\udcc5 Pick a date from a calendar',testID:"cust-date-cal",style:{minHeight:48},accessibilityLabel:C?'Hide the calendar':'Pick a date from a month calendar',onPress:()=>{C||M({y:F.getFullYear(),m:F.getMonth()}),w(!C)}}),C?(0,h.jsxs)(l.default,{testID:"cust-calendar",style:{borderWidth:1,borderColor:c.colours.border,borderRadius:14,padding:10,gap:6,backgroundColor:c.colours.surface2,width:'100%',maxWidth:420},children:[(0,h.jsx)(l.default,{style:{alignItems:'flex-end'},children:(0,h.jsx)(u.GoldClose,{label:"Close the calendar",testID:"cust-calendar-close",onPress:()=>w(!1),size:"sm"})}),(0,h.jsxs)(d.Row,{style:{justifyContent:'space-between',alignItems:'center'},children:[(0,h.jsx)(s.default,{accessibilityRole:"button",accessibilityLabel:"Previous month",accessibilityState:{disabled:!W},disabled:!W,onPress:()=>H(-1),style:{minWidth:48,minHeight:48,alignItems:'center',justifyContent:'center',opacity:W?1:.3},children:(0,h.jsx)(d.T,{size:22,colour:c.colours.gold,children:"\u2039"})}),(0,h.jsxs)(d.T,{center:!0,weight:"semibold",accessibilityRole:"header",children:[(0,n.monthLong)(L.m)," ",L.y]}),(0,h.jsx)(s.default,{accessibilityRole:"button",accessibilityLabel:"Next month",accessibilityState:{disabled:!B},disabled:!B,onPress:()=>H(1),style:{minWidth:48,minHeight:48,alignItems:'center',justifyContent:'center',opacity:B?1:.3},children:(0,h.jsx)(d.T,{size:22,colour:c.colours.gold,children:"\u203a"})})]}),(0,h.jsx)(l.default,{style:{flexDirection:'row'},importantForAccessibility:"no-hide-descendants",children:y.map(e=>(0,h.jsx)(d.T,{size:12,colour:c.colours.muted,center:!0,style:{flex:1},children:e},e))}),Array.from({length:A.length/7},(e,t)=>(0,h.jsx)(l.default,{style:{flexDirection:'row',gap:4},children:A.slice(7*t,7*t+7).map((e,t)=>{if(!e)return(0,h.jsx)(l.default,{style:{flex:1,height:44}},t);const o=(0,n.ymd)(e),i=oj,r=o===D,u=!v(e);return(0,h.jsx)(s.default,{testID:`cust-cal-${o}`,accessibilityRole:"button",accessibilityLabel:`${(0,n.niceDateYear)(e)}${i?', not bookable online':u?', closed':''}`,accessibilityState:{disabled:i||u,selected:r},disabled:i||u,onPress:()=>O(o),style:{flex:1,height:44,borderRadius:10,alignItems:'center',justifyContent:'center',borderWidth:o===p?1.5:0,borderColor:c.colours.gold,backgroundColor:r?c.colours.gold:'transparent',opacity:i?.3:1},children:(0,h.jsx)(d.T,{size:15,center:!0,weight:r?'bold':'regular',colour:r?c.colours.onGold:u?c.colours.muted:c.colours.text,style:u&&!i?{textDecorationLine:'line-through'}:void 0,children:e.getDate()})},t)})},t)),(0,h.jsxs)(d.Muted,{center:!0,children:["Crossed-out days: closed. ",(0,r.bookAheadUnlimited)(e)?`You can book up to ${(0,i.slashDay)(j)}.`:`Online booking is open up to ${(0,i.slashDay)(j)}.`]})]}):null]})};var t=_r(_d[0]),s=e(_r(_d[1])),l=e(_r(_d[2])),o=_r(_d[3]),n=_r(_d[4]),i=_r(_d[5]),r=_r(_d[6]),c=_r(_d[7]),d=_r(_d[8]),u=_r(_d[9]),h=_r(_d[10]);const y=['Mon','Tue','Wed','Thu','Fri','Sat','Sun'],b=14},1225,[17,385,85,862,863,1031,1226,804,777,779,8]); __d(function(g,_r,i,a,_m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"SERVER_MAX_DAYS_AHEAD",{enumerable:!0,get:function(){return n}}),e.bookAheadDays=r,Object.defineProperty(e,"bookAheadUnlimited",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"lastBookableDay",{enumerable:!0,get:function(){return u}}),e.typedBookDateProblem=function(n,r,o){const s=(n??'').trim();if(!s)return'Type a date as DD/MM/YYYY, for example 24/12/2026.';const l=(0,t.dayFromSlash)(s);if(!l)return'That isn\u2019t a date yet. Type it as DD/MM/YYYY, for example 24/12/2026.';if(lc){const[t,n,r]=c.split('-');return`Online booking is open up to ${r}/${n}/${t}. For later dates, please call us.`}return null};var t=_r(_d[0]);const n=366;function r(t){const r=Number(t?.settings?.onlineBookDaysAhead);return Number.isFinite(r)&&r>=1?Math.min(Math.round(r),n):n}const o=t=>r(t)>=n,s=(t,n)=>{const r=new Date(t+'T12:00:00Z');return r.setUTCDate(r.getUTCDate()+n),r.toISOString().slice(0,10)},u=(t,n)=>s(t,r(n))},1226,[1031]); __d(function(_g,_r,i,_a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return b}});var n=_r(_d[0]),t=_r(_d[1]),s=_r(_d[2]),a=e(_r(_d[3])),l=e(_r(_d[4])),r=_r(_d[5]),o=_r(_d[6]),d=_r(_d[7]),c=_r(_d[8]),u=_r(_d[9]),h=_r(_d[10]),g=_r(_d[11]),p=_r(_d[12]),f=_r(_d[13]);function b(){const{rid:e,did:b}=(0,t.useLocalSearchParams)(),j=(0,h.useRestaurant)(e),x=(0,h.useMenu)(e).find(e=>e.id===b),y=(0,h.useCustomer)(),m=(0,h.useRecipeCards)(e).find(e=>e.id===x?.recipeCardId),k=m?.signOff&&m.photo?(0,g.recipeCards)().photoSource(m.photo):null,v=(0,h.useStore)(e=>e.addLine),w=(0,n.useTakeawayMenu)(n=>n.byVenue[e]),S=(0,h.useStore)(n=>n.basket.restaurantId===e&&'table'===n.basket.mode),[C,B]=(0,s.useState)(()=>(x?.optionGroups??[]).filter(e=>e.required).map(e=>e.choices[0].id)),[$,I]=(0,s.useState)(1),[P,T]=(0,s.useState)(''),[L,O]=(0,s.useState)(!1),[D,A]=(0,s.useState)(!1),[M,R]=(0,s.useState)(!1),[q,_]=(0,s.useState)(!1),N=(0,s.useMemo)(()=>x?(0,c.effectiveAllergens)(x,C):{},[x,C]);if(!j||!x)return(0,f.jsx)(d.Screen,{title:"Not found",children:(0,f.jsx)(d.T,{children:"Dish not found."})});const G=(0,c.conflictsFor)(N,y.allergies),Y=(x.price??0)+(x.optionGroups??[]).flatMap(e=>e.choices).filter(e=>C.includes(e.id)).reduce((e,n)=>e+n.priceDelta,0),z=S||j.fictional?'on':(0,n.takeawayAvail)(x,w),F=x.soldOut||!x.signOff||null===x.price||'on'!==z,Q=(e,n)=>{const t=x.optionGroups.find(n=>n.id===e);B(e=>{const s=t.choices.map(e=>e.id);return t.multi?e.includes(n)?e.filter(e=>e!==n):[...e,n]:e.includes(n)&&!t.required?e.filter(e=>e!==n):[...e.filter(e=>!s.includes(e)),n]})},V=e=>{h.useStore.getState().basket.restaurantId!==j.id&&h.useStore.getState().startBasket(j.id,'takeaway'),v({itemId:x.id,qty:$,choiceIds:C,notes:P,override:e?{allergens:G.contains,at:(new Date).toISOString()}:void 0}),O(!1),_(!0)};return(0,f.jsxs)(d.Screen,{title:x.name,subtitle:j.name,right:(0,f.jsx)(o.BasketButton,{}),children:[k?(0,f.jsx)(a.default,{testID:"dish-photo",source:k,accessibilityLabel:`${x.name}${'example'===m?.origin?' (example photo)':''}`,style:{width:'100%',height:200,borderRadius:12},resizeMode:"cover"}):null,(0,f.jsxs)(d.Row,{wrap:!0,gap:6,children:[(0,f.jsx)(d.T,{weight:"bold",size:20,colour:p.colours.gold,children:null===x.price?x.priceNote:(0,u.gbp)(Y)}),x.dietary.map(e=>(0,f.jsx)(d.Badge,{kind:"ok",label:e},e))]}),(0,f.jsx)(d.T,{children:x.description}),G.contains.length?(0,f.jsx)(d.Banner,{kind:"danger",title:`Blocked: contains ${G.contains.map(c.allergenLabel).join(', ')}`,children:`You\u2019ve told us: ${y.allergies.filter(e=>G.contains.includes(e.allergen)).map(e=>`${(0,c.allergenLabel)(e.allergen)} \u2014 ${(0,c.severityLabel)(e.severity)}`).join('; ')}. This dish can\u2019t be added unless you deliberately override (for example, ordering for someone else).`}):null,G.may.length?(0,f.jsx)(d.Banner,{kind:"warn",title:`Warning: may contain ${G.may.map(c.allergenLabel).join(', ')}`,children:"Cross-contact is possible (e.g. shared fryer). Please speak to staff before ordering."}):null,(x.optionGroups??[]).map(e=>(0,f.jsxs)(d.Card,{children:[(0,f.jsxs)(d.T,{weight:"semibold",children:[e.name,e.required?' (required)':' (optional)']}),(0,f.jsx)(d.Row,{wrap:!0,gap:6,children:e.choices.map(n=>(0,f.jsx)(d.Chip,{label:n.label,sub:n.priceDelta?`+${(0,u.gbp)(n.priceDelta)}`:void 0,selected:C.includes(n.id),onPress:()=>Q(e.id,n.id)},n.id))})]},e.id)),(0,f.jsx)(d.Card,{children:(0,f.jsx)(r.AllergenPanel,{item:x,map:N,declared:y.allergies})}),j.fictional?null:(0,f.jsx)(d.AllergenNotice,{phone:j.phone}),(0,f.jsx)(d.Field,{label:"Notes for the kitchen (optional)",placeholder:"e.g. no gherkins",value:P,onChangeText:T}),(0,f.jsxs)(d.Row,{style:{justifyContent:'space-between'},children:[(0,f.jsx)(d.T,{weight:"semibold",children:"Quantity"}),(0,f.jsx)(d.Stepper,{value:$,onChange:I,label:"quantity"})]}),q?(0,f.jsx)(d.Banner,{kind:"success",title:"Added to basket",children:G.contains.length?'Allergy override recorded \u2014 the kitchen will see a large allergy alert.':'Carry on browsing or go to your basket.'}):null,F?(0,f.jsx)(d.Banner,{kind:"warn",children:x.soldOut||'sold-out'===z?'Sold out today.':'off'===z&&x.signOff&&null!==x.price?'This dish isn\u2019t on the takeaway menu. You can have it when you eat in.':x.signOff?'Price on the specials board \u2014 ask staff.':'Not available to order online until the head chef signs off its allergens.'}):G.contains.length?(0,f.jsxs)(l.default,{style:{gap:8},children:[(0,f.jsx)(d.Button,{kind:"secondary",label:"Choose something else",onPress:()=>t.router.back()}),(0,f.jsx)(d.Button,{kind:"danger",label:"Override and add anyway\u2026",onPress:()=>{A(!1),R(!1),O(!0)},testID:"override-open"})]}):(0,f.jsxs)(d.Row,{gap:8,children:[(0,f.jsx)(d.Button,{style:{flex:1},label:`Add ${$} to basket \xb7 ${(0,u.gbp)(Y*$)}`,onPress:()=>V(!1),testID:"add-to-basket"}),q?(0,f.jsx)(d.Button,{kind:"secondary",label:"Basket",onPress:()=>t.router.push('/customer/basket')}):null]}),(0,f.jsxs)(d.Sheet,{visible:L,onClose:()=>O(!1),title:"Allergy override",children:[(0,f.jsx)(d.Banner,{kind:"danger",title:`${x.name} contains ${G.contains.map(c.allergenLabel).join(', ')}`,children:`Your profile says: ${y.allergies.filter(e=>G.contains.includes(e.allergen)).map(e=>`${(0,c.allergenLabel)(e.allergen)} \u2014 ${(0,c.severityLabel)(e.severity)}`).join('; ')}.`}),(0,f.jsx)(d.Toggle,{label:"I understand this dish contains an allergen I have declared",value:D,onChange:A}),(0,f.jsx)(d.Toggle,{label:"It is for someone without this allergy, or I have spoken to staff",value:M,onChange:R}),(0,f.jsx)(d.Muted,{children:"The override is logged and shown to the kitchen as an allergy alert that must be acknowledged."}),(0,f.jsx)(d.Button,{kind:"danger",disabled:!D||!M,label:"Confirm override and add",onPress:()=>V(!0),testID:"override-confirm"})]})]})}},1227,[947,13,17,319,85,1228,1230,777,845,851,858,867,804,8]); @@ -1561,7 +1561,7 @@ __d(function(_g,_r,_i,_a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esMo __d(function(g,r,i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"DRAFT_LABEL",{enumerable:!0,get:function(){return o}}),Object.defineProperty(_e,"useDrafts",{enumerable:!0,get:function(){return p}});var e,t=r(_d[0]),s=(e=t)&&e.__esModule?e:{default:e},n=r(_d[1]),d=r(_d[2]);const o={booking:'Booking',shopping:'Shopping list',offer:'Offer',event:'Event',special:'Special',message:'Message',payment:'Payment',other:'Request'},p=(0,n.create)()((0,d.persist)((e,t)=>({drafts:[],add:t=>{const s={...t,id:`dr-${Date.now().toString(36)}${Math.random().toString(36).slice(2,6)}`,at:(new Date).toISOString(),status:'draft'};return e(e=>({drafts:[s,...e.drafts].slice(0,300)})),s},addToList:(s,n,d,o,p)=>{const f=t().drafts.find(e=>e.rid===s&&'shopping'===e.kind&&e.supplier===n&&'draft'===e.status);if(f){const t={...f,lines:[...f.lines,...d]};return e(e=>({drafts:e.drafts.map(e=>e.id===f.id?t:e)})),t}return t().add({rid:s,kind:'shopping',supplier:n,title:'Supplier shopping list',lines:d,by:o,app:p})},decide:(t,s,n)=>e(e=>({drafts:e.drafts.map(e=>e.id===t?{...e,status:s,decidedBy:n,decidedAt:(new Date).toISOString()}:e)}))}),{name:'covercharge-drafts-v1',version:1,storage:(0,d.createJSONStorage)(()=>s.default)}))},1478,[824,831,834]); __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"useShiftNotes",{enumerable:!0,get:function(){return c}});var e,t=r(d[0]),n=(e=t)&&e.__esModule?e:{default:e},s=r(d[1]),o=r(d[2]);const c=(0,s.create)()((0,o.persist)(e=>({notes:[],add:t=>e(e=>({notes:[Object.assign({},t,{id:'sn-'+Date.now().toString(36),at:(new Date).toISOString()}),...e.notes].slice(0,300)})),setDone:(t,n)=>e(e=>({notes:e.notes.map(e=>e.id===t?Object.assign({},e,{done:n}):e)}))}),{name:'covercharge-shiftnotes-v1',version:1,storage:(0,o.createJSONStorage)(()=>n.default)}))},1479,[824,831,834]); __d(function(g,_r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"useCoach",{enumerable:!0,get:function(){return p}}),_e.findTarget=b,_e.CoachHost=function(){const{target:e,hint:s,nonce:x}=p(),[y,w]=(0,o.useState)(null),v=(0,o.useRef)(new n.default.Value(0)).current;if((0,o.useEffect)(()=>{n.default.loop(n.default.timing(v,{toValue:1,duration:1300,easing:l.default.out(l.default.quad),useNativeDriver:!1})).start()},[]),(0,o.useEffect)(()=>{if(w(null),!s||!e)return;let t=0,o=null,n=!1;const l=()=>{if(o=o&&o.isConnected?o:b(e),o){n||(o.scrollIntoView?.({block:'center',behavior:'smooth'}),n=!0);const e=o.getBoundingClientRect();w({x:e.left,y:e.top,w:e.width,h:e.height,vw:window.innerWidth,vh:window.innerHeight})}else++t>40&&w(null)},r=setInterval(l,150);l();const u=setTimeout(()=>p.getState().clear(),2e4);return()=>{clearInterval(r),clearTimeout(u)}},[x]),!s)return null;const C='fixed',R=!y||y.y+y.h+110p.getState().clear(),style:{alignSelf:'flex-end',backgroundColor:(0,t.soutersSurface)('#1A1408'),borderRadius:10,paddingHorizontal:14,paddingVertical:6},children:(0,h.jsx)(c.T,{colour:f.colours.gold,weight:"semibold",children:"Got it"})})]})})]})};var t=_r(d[0]),o=_r(d[1]),n=e(_r(d[2])),l=e(_r(d[3]));_r(d[4]);var r=e(_r(d[5])),u=e(_r(d[6])),s=_r(d[7]),c=_r(d[8]),f=_r(d[9]),h=_r(d[10]);const p=(0,s.create)(e=>({target:null,hint:null,nonce:0,show:(t,o)=>e(e=>({target:t??null,hint:o,nonce:e.nonce+1})),clear:()=>e({target:null,hint:null})}));function b(e){if('undefined'==typeof document)return null;const t=e=>e&&e.getClientRects().length?e:null;if(e.testID){const o=Array.from(document.querySelectorAll(`[data-testid="${e.testID}"]`)).map(t).find(Boolean);if(o)return o}if(e.label){const o=Array.from(document.querySelectorAll(`[aria-label="${e.label}"]`)).map(t).find(Boolean);if(o)return o}if(e.text){const o=e.text.toLowerCase(),n=Array.from(document.querySelectorAll('[role="button"], button, a')).filter(e=>(e.textContent??'').trim().toLowerCase().includes(o)).map(t).find(Boolean);if(n)return n}return null}},1480,[813,17,266,347,219,385,85,831,777,804,8]); -__d(function(g,r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"HELP_TOPICS",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"HELP",{enumerable:!0,get:function(){return a}}),Object.defineProperty(e,"helpById",{enumerable:!0,get:function(){return o}});const t=['Bookings','Walk-ins','Table plan','Rota','Hours & pay','Tips','Team','Suppliers','Stock','Recipe cards','Displays','Settings','Accounts'],a=[{id:'new-booking',kind:'guide',topic:'Bookings',title:'Take a phone booking',keywords:['booking','reservation','book','table','phone','covers','reserve'],body:'Add a booking for a guest who calls or walks up to ask. The app only offers times that are really free.',steps:['Open Bookings (or tap New booking on Today).','Pick the date, time and number of covers.','Add the guest\u2019s name and phone, plus any allergies or notes.','Tap Save. The booking appears on the timeline and the floor plan.'],showMe:{tab:'bookings',target:{testID:'add-booking'},hint:'Tap New booking to start a booking.'}},{id:'move-booking',kind:'faq',topic:'Bookings',title:'How do I move a booking to another table or time?',keywords:['move','change','reschedule','table','booking','swap'],body:'Open the booking from Bookings or the timeline and tap Edit, or drag it to another table on the Display. Guests are not messaged unless you choose to.',showMe:{tab:'bookings',target:{testID:'add-booking'},hint:'Your bookings list is here. Tap a booking to change it.'}},{id:'walk-in',kind:'guide',topic:'Walk-ins',title:'Seat a walk-in',keywords:['walk-in','walkin','walk in','seat','no booking','covers','party'],body:'Record guests who arrive without a booking so the floor plan and covers stay right.',steps:['On the Display (the venue tablet), tap Walk-in. On a phone, say \u201cadd a walk-in for 2\u201d to the Assistant.','Choose the number of covers.','Pick a free table (the best fit is suggested).','Tap Seat. The table shows as seated.'],actions:['add_walkin']},{id:'table-plan',kind:'guide',topic:'Table plan',title:'Edit the table plan',keywords:['table plan','floor plan','layout','tables','move tables','designer','areas','seats'],body:'Drag tables into place, set seats, join tables and add areas such as Terrace or Garden.',steps:['Go to More \u203a Table plan.','Tap Open the designer.','Drag tables, or tap one to change its name and seats.','Tap Save. Displays and bookings use the new plan straight away.'],showMe:{tab:'more',page:'tableplan',target:{testID:'open-designer'},hint:'Open the designer to move tables.'}},{id:'rota',kind:'guide',topic:'Rota',title:'Build and publish the rota',keywords:['rota','shift','schedule','week','publish','staff hours','add shift'],body:'Plan the week, then publish it so staff see their shifts in the Staff app.',steps:['Go to More \u203a Rota.','Tap a person\u2019s day to add a shift (presets: lunch, dinner, double).','New shifts are drafts with a dashed amber border.','Tap Publish when the week is ready. Staff see only published shifts.'],showMe:{tab:'more',page:'rota',target:{testID:'rota-publish'},hint:'Tap a day to add a shift, then Publish here.'},actions:['add_rota_shift','publish_rota']},{id:'rota-copy',kind:'faq',topic:'Rota',title:'Can I copy last week\u2019s rota?',keywords:['copy','last week','repeat','rota','duplicate'],body:'Yes. On the Rota tap Copy last week. The shifts come over as drafts so you can tweak them before publishing.',showMe:{tab:'more',page:'rota',target:{testID:'rota-copy'},hint:'Copy last week\u2019s shifts as drafts.'}},{id:'sign-off',kind:'guide',topic:'Hours & pay',title:'Sign off hours',keywords:['sign off','signoff','confirm hours','approve','timesheet','clock','pending'],body:'Only confirmed hours count for pay and tips. Check clocked times against the rota and confirm them.',steps:['Go to More \u203a Sign off hours.','Flagged days (late, missing clock-out, long breaks) are at the top.','Tap a row to fix a time; give a short reason.','Tap Confirm all unflagged, then deal with the rest.'],showMe:{tab:'more',page:'signoff',target:{testID:'confirm-unflagged'},hint:'Confirm all the days that look right in one tap.'}},{id:'payroll-hours',kind:'guide',topic:'Hours & pay',title:'Export hours for payroll',keywords:['payroll','export','hours','spreadsheet','csv','excel','accountant','copy','print'],body:'Get each person\u2019s confirmed hours for a pay period into your spreadsheet or to your accountant.',steps:['Go to More \u203a Payroll hours.','Pick the pay period (or a tips fortnight, or a custom range).','Check the pending banner: sign those off first if you can.','Tap Copy for spreadsheet and paste into Excel or Google Sheets, or download a CSV, or print.'],showMe:{tab:'more',page:'hours',target:{testID:'copy-tsv'},hint:'Copy, then paste straight into your spreadsheet.'}},{id:'pay-dates',kind:'faq',topic:'Hours & pay',title:'How do I set our pay dates?',keywords:['pay day','payday','pay dates','cut-off','wages','monthly','fortnightly'],body:'Settings \u203a Pay & tips: set when tips are paid and how often, the wage pay day and the cut-off. Payroll hours and Tips day use these dates.',showMe:{tab:'more',page:'paysettings',target:{testID:'save-pay'},hint:'Change the dates above, then Save.'}},{id:'tips-day',kind:'guide',topic:'Tips',title:'Share out tips on tips day',keywords:['tips','tronc','gratuity','share','split','tips day','service charge'],body:'Enter the tips total and it\u2019s shared by confirmed hours for the fortnight, to the penny.',steps:['Go to More \u203a Tips day (the right fortnight is picked for you).','Type the total tips.','Check anyone with pending hours; sign them off first if you can.','Copy or download the split for payroll.'],showMe:{tab:'more',page:'tipsday',target:{testID:'tips-total'},hint:'Type the tips total here.'}},{id:'invites',kind:'guide',topic:'Team',title:'Invite staff to the app',keywords:['invite','link','staff app','new starter','sign in','add staff','team member'],body:'Each person gets their own sign-in link. You choose when and how to share it.',steps:['Go to Settings \u203a Invite links.','Tap Make invite link next to the person.','Share the link yourself (text or WhatsApp). The app never sends it for you.','They tap it once and the Staff app remembers them.'],showMe:{tab:'more',page:'setup-invites',target:{text:'Make invite link'},hint:'Make a personal link, then share it yourself.'}},{id:'suppliers',kind:'guide',topic:'Suppliers',title:'Suppliers and order sheets',keywords:['supplier','order','order sheet','delivery','cut-off','fish','veg','dairy'],body:'Keep supplier contacts, order days and cut-offs together, and log what you ordered.',steps:['Go to More \u203a Suppliers to add or edit a supplier.','Use Supplier order sheets for the items you usually order.','Tap Log an order after you place it by phone or email.'],showMe:{tab:'more',page:'ordersheets',target:{testID:'sheet-add'},hint:'Add an order sheet for a supplier.'}},{id:'display-glance',kind:'guide',topic:'Display',title:'Today at a glance (Display)',keywords:['glance','today','covers by hour','breaks','on now','next','cut-off','cutoff','order times','display bar'],body:'The bar under the Display header shows today in one line: covers by hour (booked in solid gold, the walk-in estimate dashed), quiet times for breaks, who is on now and next, today\u2019s supplier order cut-offs with a countdown (amber under 30 minutes) and one tip. Cut-offs come from Scheduled notifications.'},{id:'sold-out',kind:'guide',topic:'Menu',title:'Sold out dishes',keywords:['sold out','run out','ran out','none left','back on','86','eighty six','display strip'],body:'When a dish runs out, mark it sold out so every member of staff knows. It\u2019s a reminder for staff: CoverCharge doesn\u2019t link up to your till, so it doesn\u2019t change the till. Sold out dishes show in a slim strip along the bottom of the Display within seconds, and in the Sold out list in Front of House, Managers and Head Chef. They clear by themselves when the kitchen closes (or the next morning, or only when you tap Back on: Settings \u203a Advanced \u203a Sold out reminders).',steps:['Open the Sold out list (Managers: More \u203a Sold out; Front of House: Me \u203a Sold out; Head Chef: Kitchen \u203a Live tickets \u203a Sold out).','Tap Mark sold out next to the dish.','When it\u2019s back, tap Back on.'],showMe:{tab:'more',page:'soldout',target:{testID:'soldout-search'},hint:'Find the dish, then tap Mark sold out.'}},{id:'shellfish',kind:'guide',topic:'Stock',title:'Live shellfish (and other) counts',keywords:['shellfish','lobster','crab','oysters','count','stock','tracked','sold out','86'],body:'Counters for things you sell by the unit, like lobster or crab. They show on the Display and warn when low.',steps:['Go to Settings \u203a Tracked stock.','Tap Add an item to track; set the name, icon and low warning.','Staff update the count from the small lobster and crab chip at the top of the Display, or in the app.'],showMe:{tab:'more',page:'trackedstock',target:{text:'Add an item to track'},hint:'Add something to count, like lobster.'}},{id:'recipe-cards',kind:'guide',topic:'Recipe cards',title:'Recipe cards',keywords:['recipe','card','dish','ingredients','method','allergens','spec'],body:'Photo, ingredients, method and allergens for each dish; the head chef signs them off and staff can read them.',steps:['Go to More \u203a Recipe cards.','Search for a dish or add a new one.','Fill in ingredients (allergens are suggested) and the method.','Send for head chef sign-off.'],showMe:{tab:'more',page:'recipecards',target:{testID:'card-search'},hint:'Search your recipe cards here.'}},{id:'display-pair',kind:'guide',topic:'Displays',title:'Pair a display or tablet',keywords:['display','tablet','pair','screen','code','front of house','kitchen screen'],body:'Connect a tablet to your venue with a one-time code. You can switch any display off from here.',steps:['Open the Display app on the tablet.','In Managers go to Settings \u203a Displays and tap Make a pairing code.','Type the code on the tablet. It joins your venue straight away.'],showMe:{tab:'more',page:'displays',target:{text:'Make a pairing code'},hint:'Make a one-time code for the tablet.'}},{id:'settings-hours',kind:'faq',topic:'Settings',title:'How do I change our opening hours?',keywords:['opening hours','hours','closed','open','kitchen hours','times'],body:'Settings \u203a Opening hours. Guests see these on your booking and order pages; bookings outside them are turned away.',showMe:{tab:'more',page:'setup-hours',hint:'Set each day\u2019s opening and closing time here.'}},{id:'replay-setup',kind:'faq',topic:'Settings',title:'Can I see the welcome walkthrough again?',keywords:['welcome','setup','walkthrough','onboarding','checklist','questionnaire'],body:'Yes: Settings \u203a Setup checklist \u203a Replay welcome. Everything is pre-filled from your questionnaire.',showMe:{tab:'more',page:'setupchecklist',target:{testID:'replay-welcome'},hint:'Replay the welcome walkthrough.'}},{id:'connected-accounts',kind:'guide',topic:'Accounts',title:'Connect your email, website and socials',keywords:['connect','account','gmail','outlook','wix','facebook','instagram','square','xero','quickbooks','login'],body:'Settings \u203a Connected accounts: tap a logo, save the account to your list, and use Connect with\u2026 to sign in on that service\u2019s own page (rolling out service by service; it shows Coming soon until then). CoverCharge never sees your password that way, and you can remove an account any time.',steps:['Go to Settings \u203a Connected accounts.','Tap the service\u2019s logo.','Tap Connect with\u2026 and sign in on their page.','To stop, tap Remove.'],showMe:{tab:'more',page:'connections',target:{testID:'conn-tile-gmail'},hint:'Tap a logo to connect that account.'}},{id:'supplier-portals',kind:'guide',topic:'Suppliers',title:'Order from your suppliers',keywords:['bidfood','booker','wholesale','cash and carry','order online','supplier login','account number','customer number'],body:'Settings \u203a Connected accounts \u203a Suppliers. Add supplier links for this venue, with an account number if you like. Open ordering and Log in open the supplier\u2019s own website, where you sign in; CoverCharge never keeps the password.',steps:['Go to Settings \u203a Connected accounts.','Scroll to Suppliers.','Tap Add against a supplier (account number optional).','Tap Open ordering or Log in whenever you need them.','To stop, tap Remove and confirm.'],showMe:{tab:'more',page:'connections',target:{testID:'portal-bidfood'},hint:'Your supplier ordering websites live here.'}},{id:'support',kind:'faq',topic:'Settings',title:'How do I get help from a person?',keywords:['support','help','contact','person','problem','broken','stuck'],body:'Support is free for life. Message the CoverCharge team from Settings \u203a Help, or email us, and we\u2019ll reply. We help by message and email.'},{id:'assistant-safe',kind:'faq',topic:'Settings',title:'Can the Assistant send or pay for things by itself?',keywords:['assistant','safe','confirm','send','pay','delete','ai'],body:'No. The Assistant and the voice helper show you exactly what they will do and wait for you to tap Confirm (or say yes). Anything that would send a message, order from a supplier or pay is only saved as a draft in Drafts for approval; nothing goes out by itself.'},{id:'restaurant-dashboard',kind:'guide',topic:'Bookings',title:'Restaurant dashboard',keywords:['restaurant dashboard','tables','timeline','guests','covers','joined tables'],body:'In Managers, tap Restaurant dashboard on Home, or More > Run the day > Restaurant dashboard. It is the same live table plan, Timeline, guest list, deposits, dogs, joined tables, Covers, covers-through-the-day chart and block bookings as the Display. Use the day arrows and Back to today. Assign or join tables on any day; seat, finish, no-show and cancel walk-in actions apply today. You can also say \u201copen Restaurant dashboard\u201d. The helper replies in text only.',showMe:{tab:'more',page:'serviceboard',target:{testID:'restaurant-dashboard-close'},hint:'Restaurant dashboard is open. Pick a day, or tap Back to Managers to close.'}},{id:'voice-helper',kind:'guide',topic:'Settings',title:'Use the hold-to-talk voice button',keywords:['voice','talk','speak','microphone','mic','hold','walkie','button','hands free','gloves'],body:'Hold the big gold button, say what you need, then let go. It logs fridge and freezer temperatures, answers allergen questions, marks dishes sold out, checks tables, adds to the waitlist, reads orders and covers, and drafts bookings, offers, events and supplier lists. The helper replies in text only, never aloud. Changes are shown in text first with Confirm and Cancel buttons: tap Confirm or say yes. Tap the button to type instead (in Managers this also opens the Assistant). It sits at the top right of the header in Managers, Head Chef, the Staff app (the full voice assistant, with no money, tips or HR) and on the Display (no money, tips or HR). Until the voice assistant\u2019s server is switched on, anything new says \u201cVoice assistant is switching on soon\u201d. Fair usage: 1,000 voice tasks a month per venue.',steps:['Hold the gold microphone button (the first time, allow the microphone).','Speak, for example \u201cprep fridge 3 degrees\u201d.','Let go to send.','If it reads something back, tap Confirm or hold again and say \u201cyes\u201d.','The button stays at the top right so it never covers the screen.'],showMe:{tab:'more',page:'voice',hint:'Turn the voice button on or off for each role here.'}},{id:'voice-drafts',kind:'faq',topic:'Settings',title:'Where do voice bookings and shopping lists go?',keywords:['drafts','approve','approval','shopping list','booker list','bidfood list','draft booking','offer','event'],body:'To Settings \u203a Drafts for approval. Bookings, supplier lists, offers, events and specials made by voice wait there for an owner or manager. Approving marks it approved and opens the right screen; you still place the order or confirm the booking yourself.',showMe:{tab:'more',page:'drafts',hint:'Drafts from the voice helper wait here.'}},{id:'voice-temps',kind:'guide',topic:'Settings',title:'Log fridge and freezer temperatures by voice',keywords:['temperature','fridge','freezer','haccp','food safety','eho','log temps','probe'],body:'Hold the voice button and say the unit and the number, for example \u201cprep fridge 3, freezer minus 19\u201d. Fridges should be 5\xb0C or colder and freezers -18\xb0C or colder; anything outside is flagged. Everything is in the Food safety log with who and when, ready to export or print for the EHO.',showMe:{tab:'more',page:'haccp',hint:'Every voice reading appears in the food safety log.'}},{id:'voice-fair-usage',kind:'faq',topic:'Settings',title:'Is there a limit on voice tasks?',keywords:['voice','limit','allowance','fair usage','fair use','how many','tasks','month','plan'],body:'Fair usage: 1,000 voice tasks a month per venue. It is one allowance shared by all of the venue\u2019s apps and devices, and it resets on the 1st. Each request counts once, spoken or typed; saying \u201cyes\u201d to confirm does not count again. You will see a note at 80%. If the venue reaches 1,000, the voice helper pauses until the 1st, except food safety and temperature logging, which always works. The owner can contact CoverCharge if you need more. See the count in Plan & billing or Settings \u203a Voice helper.',showMe:{tab:'more',page:'voice',hint:'This month\u2019s voice task count is shown here.'}},{id:'adv-bookings',kind:'guide',topic:'Settings',title:'Booking questions: allergies, dogs, access, vegan',keywords:['advanced','allergen','dog','dogs','cap','wheelchair','access','vegan','vegetarian','table request','settings'],body:'Choose what guests are asked when they book. Allergies are always asked first, in red, and staff tick \u201cAllergens seen\u201d. The others can be switched off.',steps:['Open More \u203a Settings \u203a Advanced.','In Bookings, tick or untick each question.','Use the dog stepper to cap dogs per booking time (No limit = only the dog-friendly tables).','Mark dog-friendly and step-free tables on the Table plan.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-bookings'},hint:'Booking questions are here.'}},{id:'adv-table-times',kind:'guide',topic:'Settings',title:'How long tables stay (table times)',keywords:['advanced','dwell','table time','turn','how long','next table free','minutes'],body:'Usual table times by party size: 90 min for 1\u20132 covers, 105 for 3\u20135, 2 hours for 6\u201319 and 3 hours for 20 or more. The app fine-tunes them from how long your tables really stay, and uses them for \u201cNext table free\u201d.',steps:['Open More \u203a Settings \u203a Advanced \u203a Table times.','Tap \u2212 or + to change a band by 5 minutes.','Untick \u201cFine-tune\u201d to use your numbers exactly.','Reset to default puts the four bands back.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-times'},hint:'Table times are here.'}},{id:'adv-reservable',kind:'guide',topic:'Settings',title:'Seafood platter, crab and lobster reservations',keywords:['advanced','platter','seafood','crab','lobster','reserve','price'],body:'Guests can reserve the Seafood Platter (1 crab + 1 lobster, \xa3160) or a crab or lobster with their booking. Reserved ones come off the Display count with a \u201cReserved\u201d line, the kitchen is told, and the Head Chef taps OK.',steps:['Open More \u203a Settings \u203a Advanced \u203a Reservable items.','Tick what guests can reserve and set the price.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-reserve'},hint:'Reservable items are here.'}},{id:'adv-events',kind:'guide',topic:'Settings',title:'Regular events like Open Mic Night',keywords:['advanced','open mic night','music night','event','regular','monthly','promote','busier','last food'],body:'Add events that repeat, e.g. Open Mic Night on the last Sunday of every month from 8pm with last food orders at 7pm. They show in Forecast key dates with a Promote button and on Today, and \u201cExpect busier\u201d raises the forecast.',steps:['Open More \u203a Settings \u203a Advanced \u203a Regular events.','Tap Add a regular event (or Edit).','Pick how it repeats and the day, add a start time and last food orders if needed.','Tap Save event.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-events'},hint:'Regular events are here.'}},{id:'adv-hours',kind:'guide',topic:'Settings',title:'Kitchen hours, seasons and special days',keywords:['advanced','hours','kitchen','season','winter','summer','special day','closed','last food orders','cutoff'],body:'Kitchen (food) hours decide which booking times are offered; the closing time is last food orders. Keep Winter and Summer hours, each with the date it starts every year, and the app switches by itself. Add special days for one-off changes.',steps:['Open More \u203a Settings \u203a Advanced \u203a Kitchen hours.','Tap Set Summer hours, fill in each day and the start date (e.g. 04-01 for 1 April).','Set the Winter start date too.','Use Add a special day for closures or late nights.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-hours'},hint:'Kitchen hours and seasons are here.'}},{id:'adv-home',kind:'faq',topic:'Settings',title:'Covers counter, Next table free and takeaway on home screens',keywords:['advanced','covers counter','takeaway','next table free','home','display','flip'],body:'Turn the COVERS counter and the \u201cNext table free\u201d card on or off, and choose whether takeaway figures show on home screens (off at the Anchorage). Takeaway order alerts always work. The flap click sound is set on each Display.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-home'},hint:'Display and home options are here.'}},{id:'adv-holidays',kind:'faq',topic:'Settings',title:'Why don\u2019t bank holidays say \u201c(substitute day)\u201d?',keywords:['advanced','holiday','substitute','bank holiday'],body:'The date already shows when a holiday moves, so the extra words are hidden. Tick \u201cShow full gov.uk names\u201d in Settings \u203a Advanced \u203a Holiday names to bring them back.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-holidays'},hint:'Holiday names are here.'}},{id:'adv-blocks',kind:'guide',topic:'Settings',title:'Lunch and dinner times for Block now',keywords:['block','lunch','dinner','service','wix','advanced','pause'],body:'Settings \u203a Advanced \u203a Block bookings sets when Lunch and Dinner run, for the Block now buttons and Spend per head. At The Anchorage, blocks also close those times on website bookings, and blocks made on the website show in CoverCharge. Website bookings can only close the whole venue, not one area or some tables.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-blocks'},hint:'Block bookings settings are here.'}},{id:'blocks-screen',kind:'guide',topic:'Bookings',title:'Block bookings: today, a future date, an area or some tables',keywords:['block','blocks','pause','close','closed','stop bookings','private','repeat','future'],body:'Tap Block bookings on the home screen. Block now pauses bookings today (Rest of today, Next hour, Lunch, Dinner, or a From\u2013To). Add a block closes a future date or range, the whole day or set times, the whole venue, one area or some tables, once or every week or on the last weekday of the month. Every future block is listed by month with Edit and Remove; removing asks first and is logged. Bookings already made are kept, and you are told how many.',showMe:{tab:'more',page:'blocks',target:{testID:'blocks-screen'},hint:'Block bookings is here.'}},{id:'spend-per-head',kind:'guide',topic:'Money',title:'Spend per head',keywords:['spend per head','sph','average spend','takings','covers','gross'],body:'Spend per head is Gross takings \xf7 Covers, by day, by week and for lunch and dinner. Enter the gross on the cash up (Enter the cash up, Upload a spreadsheet, or Enter takings). Covers are seated and finished bookings and walk-ins; no-shows and cancellations are left out. A day with no takings shows \u201cNo takings entered\u201d, never \xa30.',showMe:{tab:'more',page:'spendhead',target:{testID:'sph-screen'},hint:'Spend per head is here.'}},{id:'cashup-photo',kind:'guide',topic:'Money',title:'Enter the cash up, or upload a spreadsheet',keywords:['cash up','paid out','spreadsheet','csv','excel','xlsx','sheet','gross','card','cash','tips','takings','drawer'],body:'In Cash up & sales tap Enter the cash up and type the figures (Z total, card, cash, paid outs, tips, and gross if you have it). In Paid out, add a line for each amount taken from the till \u2014 for example lobsters or supermarket shopping \u2014 with the amount, an optional note, and your name. The paid-out total comes off the expected cash in the drawer. Check every figure, then tap Confirm and save. Bigger venues can tap Upload a spreadsheet (CSV or Excel): match the columns, check the preview (dates already saved are flagged), then confirm. Nothing is saved before you confirm, and every save is logged. You can export cash ups as a spreadsheet from Recent cash ups.',showMe:{tab:'more',page:'cashup',target:{testID:'cashup-by-hand'},hint:'Start the cash up here.'}},{id:'adv-giftqr',kind:'guide',topic:'Settings',title:'Buy a gift card on the Display',keywords:['gift','gift card','voucher','qr','display','wix','advanced'],body:'Switch on \u201cShow Buy a gift card on the Display\u201d in Settings \u203a Advanced \u203a Gift cards on the Display, and save your gift card page address. The Display has a Gift vouchers button: it opens the list of website vouchers (search, use by dates, Mark as used), with Show the buy QR code at the bottom. Guests buy on your website.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-giftqr'},hint:'Gift cards on the Display are here.'}},{id:'adv-whatsapp',kind:'guide',topic:'Settings',title:'WhatsApp buttons (tap to chat)',keywords:['whatsapp','wa.me','message','chat','guest','mobile','number','advanced'],body:'Put the venue\u2019s WhatsApp number in Settings \u203a Advanced \u203a WhatsApp, e.g. 01292 500123 or +44 7700 900123. Guests then see \u201cMessage us on WhatsApp\u201d on their booking confirmation, with their booking details typed in. Staff and managers see \u201cWhatsApp guest\u201d on bookings with a mobile number, with a confirmation typed in that you can change. Nothing is ever sent for you: WhatsApp opens and you tap Send yourself. Leave the number blank and every WhatsApp button stays hidden. Reset to default clears the number.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-whatsapp'},hint:'The WhatsApp number is here.'}},{id:'adv-reminders',kind:'guide',topic:'Settings',title:'Staff reminders: breaks and \u201cchairs up\u201d',keywords:['reminder','reminders','break','breaks','chairs','closing','6 hours','law','snooze','later','done','advanced'],body:'Reminders slide up for staff who are on shift right now (clocked in, or on the rota at that time) in the Staff and Head Chef apps, while the app is open. Break reminders: if the rota shift has a break time, the reminder comes at that time; if not, it comes 4 hours after they clock in (or after the shift starts). If they still haven\u2019t started a break it comes once more 30 minutes later, and again at 6 hours, because UK law says a shift over 6 hours needs a 20-minute break. \u201cStart break\u201d starts their break; \u201cLater\u201d hides it for 15 minutes. You can change these times. Venue reminders, such as \u201cTime to put the chairs up on the tables\u201d (Friday and Sunday, 21:00), have wording, days, a time (UK) and who sees them: everyone on shift, front of house or kitchen. Pause, edit or delete any of them, or add your own. Once anyone taps Done it goes for everyone that day, and the Reminders screen shows who did it. Reset to default brings back the standard break times and \u201cchairs up\u201d; your own reminders stay. Phones with the app closed don\u2019t get reminders yet.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-reminders'},hint:'Reminders are here.'}},{id:'adv-notifications',kind:'guide',topic:'Settings',title:'Scheduled notifications (e.g. the Mills milk order)',keywords:['notification','notifications','push','phone','milk','mills','pieroni','pieronis','veg','olsen','rota upload','scheduled','advanced'],body:'Settings \u203a Advanced \u203a Notifications lists reminders that go to named people at a set UK time, such as \u201cMills milk order\u201d for the Head Chef and Gordon. Each has a title, a message, the days, a time (you can set a different time on some days, e.g. 20:55 on Fridays), who gets it (tick people or pick a group like Everyone on shift) and how it is sent. In the app it is the gold slider with Done and Later; Done is logged with the name and time, and Later hides it for 15 minutes. Urgent notices (like the 6-hour break) always come first and only one shows at a time. Phone notifications: each person taps \u201cTurn on phone notifications\u201d on their own phone (iPhone: add the app to the Home Screen first, iOS 16.4 or later). Nothing goes to phones until an owner or manager switches \u201cSend to phones\u201d on. The Display never gets these. Reset to default restores the configured rules.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-notifications'},hint:'Notifications are here.'}},{id:'adv-order-lists',kind:'guide',topic:'Settings',title:'Order lists (Alsons, Cash and carry)',keywords:['order list','orders','alsons','drinks','cash and carry','trip','shopping','logo','carry over','advanced'],body:'Order lists collect what you need from a supplier. A running list (Alsons drinks) fills up until you order; a trip list (Cash and carry) is for a shopping day, Friday by default, which you can change for each trip. Add an item with a quantity and unit and an optional note; the app records who added it and when. Adding something already on the list offers to add to the quantity instead. On the day, tick Got or Ordered, or mark Missing / not in stock. Finish order saves it to History (date and who) and asks whether to carry over anything not got. Removing an item can be undone. Settings \u203a Advanced \u203a Order lists: add, rename or archive lists, the default trip day, and \u201cLet all staff add items\u201d (on: staff can add and see lists; only managers and the Head Chef tick, remove or finish). Each list can have a logo (take a photo or choose one) or shows its initials, and a phone number to tap to call (never called for you).',showMe:{tab:'more',page:'advanced',target:{testID:'adv-orderlists'},hint:'Order list settings are here.'}},{id:'adv-clock-area',kind:'guide',topic:'Settings',title:'Clock-in area, forgotten breaks and off-rota arrivals',keywords:['clock','clock in','geofence','location','area','radius','break','forgot','rota','visiting','override','advanced'],body:'Clock in, clock out, start break and end break only work at the venue once the centre is set. Stand in the middle of the venue and tap \u201cUse my current location\u201d, then choose how far (at least 50 m, 100 m to start). Phones are not exact, so up to 50 m of the phone\u2019s own accuracy is allowed on top. Each clock record keeps the reading, its accuracy and whether it was inside. If location is off or blocked, the app says how to allow it. Managers can record it for someone from Clock in / out \u203a Record it for someone, with a reason that is logged. Until the centre is set nobody is blocked and managers see a warning. Rota and pay screens are never blocked. Forgotten breaks: if no break was recorded, Clock out asks \u201cDid you take a break? If so, how long?\u201d; a length you pick is saved as a break marked \u201cadded at clock-out\u201d, which managers see and can edit in Hours. Not on the rota: if someone is at the venue, not clocked in and not on the rota, the Staff and Head Chef apps ask \u201cDo you want to sign in?\u201d. Yes clocks them in, marked off-rota, and managers get a notice; \u201cNo, just visiting\u201d stops asking for the day. This only checks while the app is open; web apps can\u2019t watch location in the background.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-clockarea'},hint:'Clock-in area settings are here.'}},{id:'adv-tablegrid',kind:'guide',topic:'Table plan',title:'Table plan grid and Tidy up (Advanced)',keywords:['grid','snap','line up','align','tidy','guides','spacing','restore','table plan','option','alt'],body:'Tables snap to the grid when you drag them, and gold guides show when an edge or centre lines up with another table. A small number shows when the gaps either side are even. Hold Alt (Option on a Mac) to move freely. Tidy up lines every table up on the grid and evens out the rows; only positions change. The old positions are kept, so one tap puts them back.',steps:['Go to Settings \u203a Advanced.','Find Table plan grid.','Turn snapping on or off, pick a grid size, or tap Tidy up the whole plan.','Changed your mind? Tap Put the tables back where they were.']},{id:'adv-printers',kind:'guide',topic:'Orders',title:'Kitchen ticket printers (Advanced)',keywords:['print','printer','printing','ticket','kitchen ticket','docket','receipt','epson','star','bluetooth','reprint','takeaway'],body:'Print a kitchen ticket by itself for every takeaway order, as soon as it comes in or when it is accepted. The ticket has the order number, collection time, name, every dish with its options and notes, allergies in white-on-black, and paid or not paid. Works with Epson (TM-m30, TM-T20, TM-T88), Star WebPRNT, most other network receipt printers (port 9100) and Bluetooth printers from the tablet app. If a ticket does not print, an amber warning shows and the order stays on screen.',steps:['Go to Settings \u203a Advanced.','Find Printers.','Tap Add a printer by IP address or Find printers on this Wi-Fi, choose the type and tap Test print.','Turn on Print a kitchen ticket for every takeaway order.']},{id:'adv-deposits',kind:'guide',topic:'Bookings',title:'Deposits (Advanced)',keywords:['deposit','deposits','per person','per adult','children','waive','waived','regular','party size','refund','refundable','cut off','policy','paid','due'],body:'Ask bigger tables for a deposit: set the amount per adult (children never pay: a table of 8 with 3 children pays for 5), the smallest party that pays one, whether it is refundable and up to how many hours before, and the words guests see. No card is saved in CoverCharge. Deposits are paid through website bookings: website bookings show Deposit paid on website bookings, Part paid on website bookings or Deposit not paid by themselves. For phone and walk-in bookings, staff tick Deposit paid once the guest has paid you, or (once switched on) press Send deposit link to send a website bookings pay link by text, WhatsApp or email. Refunds are done in Website bookings \u203a Orders. Deposit amounts are shown on bookings in Managers, Display and Staff. Other financial and HR information remains restricted.',steps:['Go to Settings \u203a Advanced.','Find Deposits.','Turn deposits on or off, and set the amount, party size, refund terms and the words guests see.','On a booking, tap Mark deposit paid once the guest has paid.','To let a regular off, tap Waive deposit on the booking (or in Edit booking), add why if you like, and tap Yes, waive it. Your name is saved with it.']},{id:'adv-loyalty',kind:'guide',topic:'Guests',title:'Loyalty: stamp card, offers & bring a friend (Advanced)',keywords:['loyalty','stamp','stamps','card','reward','offer','offers','referral','friend','expiry'],body:'The stamp card, offers and bring-a-friend are saved on the server, so every phone and tablet shows the same card. Set how many stamps earn a reward, what the reward is, when stamps or rewards run out, and how often one guest can get a stamp. Stamps only come from staff, or from a code or QR staff make, and each reward can be used once. Guests join with their agreement recorded, and a manager can remove a guest and their details.',steps:['Go to Settings \u203a Advanced.','Find Loyalty.','Turn the stamp card on, write the reward and tap Save loyalty settings.','Add offers with their dates, and turn bring-a-friend on if you want it.']},{id:'adv-table-order',kind:'guide',topic:'Guests',title:'Order at the table (Advanced)',keywords:['order at table','qr','qr code','scan','table','phone','accept','last orders','print','pdf','pay at bar'],body:'Guests scan the small QR card on their table (Managers \u203a Table QR codes prints them, 20 to a page), see your menu with allergens, and send an order. It lands in Front of House and on the kitchen screen within seconds. Prices, sold-out dishes and hours are checked on the server, so a phone can\u2019t change them. Staff accept the first order from each new phone (you can turn this off). Guests pay at the bar or with their server; paying by card from the phone is coming later.',steps:['Go to Settings \u203a Advanced.','Find Order at the table.','Turn it on, pick the areas or tables, set the hours and tap Save order at the table.','Tap Make codes, pick Stickers 50 \xd7 50 mm or Stand cards 50 \xd7 70 mm, then Print all QR cards (PDF) and put each code on its table.']},{id:'adv-soldout',kind:'guide',topic:'Menu',title:'Sold out reminders (Advanced)',keywords:['sold out','86','clear','end of service','next morning','back on','advanced','display strip','automatic','counts','lobster','crab'],body:'Choose when sold out dishes go back on by themselves: when the kitchen closes (from your Kitchen hours), the next morning (pick the time), or only when someone taps Back on. \u201cMark dishes sold out from the counts\u201d (on unless you turn it off) marks every dish that uses a counted item, like lobster or crab, when the count runs out, and puts it back on when the count is back up. Sold out is a reminder for staff on the Display and in the staff apps; it doesn\u2019t change your till.',steps:['Go to Settings \u203a Advanced.','Find Sold out reminders.','Pick when they clear, and turn marking from the counts on or off.']},{id:'sold-out-auto',kind:'guide',topic:'Menu',title:'Sold out from the counts (lobster, crab\u2026)',keywords:['sold out','automatic','auto','counts','shellfish','lobster','crab','platter','link','uses','none left'],body:'When a counted item runs out, or drops below what a dish needs, every dish that uses it is marked sold out by itself, with the reason: \u201cDeluxe Seafood Platter (no lobster or crab)\u201d. When the count is back up (a delivery or a recount), those dishes go back on by themselves. Dishes marked by hand are left alone. CoverCharge works out what each dish uses from its recipe card, its description (\u201cone whole lobster\u201d) or its name; you can change it for any dish. If you tap Back on while the count is still short, the dish stays on until the count changes.',steps:['Open the Sold out list.','Under Dishes linked to the counts, tap Change next to a dish.','Set how many of each item one portion uses (0 = not linked), then tap Save. Back to automatic undoes it.'],showMe:{tab:'more',page:'soldout',target:{testID:'soldout-links'},hint:'Tap Change next to a dish to set what it uses.'}},{id:'adv-forecast',kind:'guide',topic:'Forecasts',title:'Forecast history and "Not enough history yet"',keywords:['forecast','not enough history','history','estimate','example figures','labour','sales','walk-ins','advanced'],body:'Forecasts are built only from your own bookings, seated walk-ins, takeaway orders and cash-ups. Until CoverCharge has enough of your history (2 weeks to start with; change it in Settings \u203a Advanced \u203a Forecast history) you see \u2018Not enough history yet\u2019, what is already booked and your real labour cost from the rota, with no sales forecast or labour %. No history is invented for a live venue.',steps:['Go to Settings \u203a Advanced.','Find Forecast history.','Pick how many weeks are needed.']},{id:'adv-checkout',kind:'guide',topic:'Team',title:'Shift check-out, question board and team morale',keywords:['check out','checkout','morale','mood','staffing','overstaffed','survey','anonymous','question board','vote','shout out','wellbeing','advanced'],body:'When someone clocks out, they get a quick card: team morale from Low to High, and whether there was enough staff for the customers. They can also post a question for the board or shout out a teammate, or tap Skip. Nothing shows at clock in. Answers are anonymous: no name or staff number is saved, and each phone can answer a shift once. Team morale (Managers app \u203a More \u203a Team morale) shows a day only once 3 or more people have answered, next to that day\u2019s covers. Change the wording or switch parts off here.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-checkout'},hint:'Check-out and board settings are here.'}},{id:'hr-board',kind:'guide',topic:'Team',title:'The anonymous question board',keywords:['question board','board','anonymous','vote','yes no','reply','hide','moderation','log'],body:'Anyone on the team can post a question and vote it up, or vote Yes or No. No names are shown or saved. Owners and managers can reply (shown as \u201cReply from the managers\u201d) and hide offensive posts with a reason. Every hide, unhide and reply is in the Moderation log.',showMe:{tab:'more',page:'board',hint:'The question board.'}},{id:'adv-tasks',kind:'guide',topic:'Team',title:'Daily tasks',keywords:['tasks','daily tasks','checklist','duties','jobs','to do','my tasks','library','head chef'],body:'Give each person a short list of daily tasks: open Staff & roles, tap Daily tasks on their card, then pick from the venue\u2019s task library or type a new one. Use the arrows to reorder, \u2715 to remove (with Undo) and Days to limit a task to certain days. They see \u201cMy tasks today\u201d on their home screen and tick each one off while on shift; each tick records who and when, and you see \u201c2 of 5 done today\u201d on their card. Lists start fresh every day. Owners and managers can change anyone\u2019s list, including the Head Chef\u2019s. The Head Chef can change the lists of kitchen staff (chefs, commis and KPs) from Kitchen \u203a Kitchen team tasks, but not their own and not front of house. The task library is in Settings \u203a Advanced \u203a Tasks.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-tasks'},hint:'The task library is here.'}},{id:'adv-cashup',kind:'guide',topic:'Money',title:'Cash up and weekly sales',keywords:['cash up','cashup','takings','float','till','sales report','weekly sales','pos','printout','photo','graphs','charts'],body:'At the end of the night open Cash up & sales and tap Enter the cash up. Type each figure; boxes left blank stay blank (never counted as zero) and are highlighted in amber. Add any cash paid out of the till (lobsters, supermarket shopping, and the like) in the Paid out section: each line has what it was for, the amount, an optional note and who entered it. The total reduces the expected cash in the drawer. Nothing is saved until you tap Confirm and save. Do the same with the weekly sales report from the till (several pages is fine). The graphs show daily takings, tips, weekly net sales against the week before and sales by category. Owners and managers can enter and change cash ups; the Head Chef can see the graphs if they are allowed to see takings. Change the boxes to match your sheet in Settings \u203a Advanced \u203a Cash up; Cash tips total and Card tips total are always kept.',showMe:{tab:'more',page:'cashup',target:{testID:'cashup-by-hand'},hint:'Start the cash up here.'}},{id:'adv-tips',kind:'guide',topic:'Money',title:'Today\u2019s tips and the Tips pot',keywords:['tips','today tips','tips pot','pot','payout','tip pay','correction','coins'],body:'When a cash up with Cash tips total and Card tips total is confirmed, the team\u2019s combined tips for that day show as Today\u2019s tips in every staff app and on the Display, with a short notice. The Tips pot adds up confirmed daily tips since the last payout (fortnightly tip pay). After paying the tips, an owner or manager taps Mark payout done on the Tips pot card: the pot goes back to \xa30.00 and the old pot is kept in Past pots. Use Correct an entry to add or take off an amount for a day; a reason is required and every correction is logged with your name. Only the team total is ever shown, never anyone\u2019s share. Hide either card in Settings \u203a Advanced \u203a Tips.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-tips'},hint:'Show or hide the tips cards here.'}},{id:'manager-access',kind:'guide',topic:'Team',title:'Manager access',keywords:['manager access','manager','access','role','promote','front of house','head chef','owner'],body:'In Staff & roles each person has a Manager access switch. On: they use the Manager app (rota, bookings, staff, hours, settings, plus their own clock in, rota and pay). Off: they use the Front of House app, or the Head Chef app for the Head Chef. Owners can switch anyone except owners; managers can switch anyone except themselves and owners. The last owner can never be removed. You confirm each change; it is logged with who and when (Access changes). Job titles are free text and don\u2019t change.',showMe:{tab:'more',page:'staff',target:{testID:'access-tip'},hint:'Manager access switches are on each person.'}},{id:'next-table-free',kind:'faq',topic:'Walk-ins',title:'When is the next table free?',keywords:['next table','free','wait','walk-in','quote','full'],body:'When you\u2019re full, Today and the Display show \u201cNext table free about 19:40 (T6, 4 seats)\u201d with \u201clikely\u201d or \u201cmaybe\u201d, and how long a walk-in for 2 or 4 would wait. Tap Bill requested or Table finished on the plan and it updates. You can also ask the Assistant \u201cwhen\u2019s the next table free?\u201d.'},{id:'time-travel',kind:'faq',topic:'Today',title:'Look at another day (time travel)',keywords:['yesterday','tomorrow','next week','past','future','day','time travel'],body:'On Today, tap \u2039 or \u203a beside the date to step a day back or forward. You\u2019ll see that day\u2019s kitchen hours, events, covers (booked, or how it went), platters and each booking\u2019s allergens and needs. It\u2019s read-only and nothing changes live service. Tap Today to come back. The Display goes back to today by itself after 2 minutes. Staff can look 7 days back and 14 days ahead.'},{id:'sign-in-links',kind:'guide',topic:'Team',title:'Personal sign-in links',keywords:['link','invite','sign in','new link','expired','already used','phone','login'],body:'Each personal link works on one phone only and lasts 5 days, so nobody else can sign in as that person. The same phone can open it again, in any of the apps. If someone gets a new phone, or their link has expired, open Staff & roles, tap New sign-in link on their entry, then Copy link and send it to them yourself. The app never sends it. Owners can make links for anyone; managers for anyone except owners. Their old unused link stops working; phones already signed in stay signed in.',showMe:{tab:'more',page:'staff',target:{testID:'access-tip'},hint:'New sign-in link is on each person.'}},{id:'pins-security',kind:'faq',topic:'Team',title:'PINs for the Display',keywords:['pin','display pin','clock in','wake pin','2580','manager pin','locked'],body:'Staff PINs for clocking in at the Display are 4 to 8 digits. Managers and owners need 6 to 8 digits, because their PIN can add temp staff. Easy PINs such as 1111 or 1234 are refused. Five wrong tries locks that person for 15 minutes; 20 wrong tries on one Display stops it for 15 minutes. The Display wake PIN (Settings \u203a Display) is 6 to 8 digits and is kept only as a scrambled hash. If it still says 2580, change it.'},{id:'cash-up-lock',kind:'faq',topic:'Money',title:'Correcting a signed-off cash up',keywords:['cash up','locked','unlock','correct','mistake','history','audit','sales report'],body:'Once a cash up or weekly sales report is confirmed and saved, it is locked so the figures can\u2019t change quietly. An owner taps Unlock to correct on it, says why, and has 30 minutes to fix it. History on each one shows who signed it off, changed or unlocked it, and when.'},{id:'wipe-device',kind:'faq',topic:'Settings',title:'Sign out and wipe a shared tablet or phone',keywords:['wipe','sign out','shared','tablet','leaver','lost','reset device'],body:'Tap the sync badge (bottom left), or go to Settings \u203a Display, and choose Sign out and wipe this device. It signs out and removes everything CoverCharge keeps on that device: sign-ins, pairing, saved screens and changes not sent yet. The venue\u2019s shared data is not touched. On the Display you type the wake PIN first.'}],o=t=>a.find(a=>a.id===t)},1481,[]); +__d(function(g,r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"HELP_TOPICS",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"HELP",{enumerable:!0,get:function(){return a}}),Object.defineProperty(e,"helpById",{enumerable:!0,get:function(){return o}});const t=['Bookings','Walk-ins','Table plan','Rota','Hours & pay','Tips','Team','Suppliers','Stock','Recipe cards','Displays','Settings','Accounts'],a=[{id:'new-booking',kind:'guide',topic:'Bookings',title:'Take a phone booking',keywords:['booking','reservation','book','table','phone','covers','reserve'],body:'Add a booking for a guest who calls or walks up to ask. The app only offers times that are really free.',steps:['Open Bookings (or tap New booking on Today).','Pick the date, time and number of covers.','Add the guest\u2019s name and phone, plus any allergies or notes.','Tap Save. The booking appears on the timeline and the floor plan.'],showMe:{tab:'bookings',target:{testID:'add-booking'},hint:'Tap New booking to start a booking.'}},{id:'move-booking',kind:'faq',topic:'Bookings',title:'How do I move a booking to another table or time?',keywords:['move','change','reschedule','table','booking','swap'],body:'Open the booking from Bookings or the timeline and tap Edit, or drag it to another table on the Display. Guests are not messaged unless you choose to.',showMe:{tab:'bookings',target:{testID:'add-booking'},hint:'Your bookings list is here. Tap a booking to change it.'}},{id:'walk-in',kind:'guide',topic:'Walk-ins',title:'Seat a walk-in',keywords:['walk-in','walkin','walk in','seat','no booking','covers','party'],body:'Record guests who arrive without a booking so the floor plan and covers stay right.',steps:['On the Display (the venue tablet), tap Walk-in. On a phone, say \u201cadd a walk-in for 2\u201d to the Assistant.','Choose the number of covers.','Pick a free table (the best fit is suggested).','Tap Seat. The table shows as seated.'],actions:['add_walkin']},{id:'table-plan',kind:'guide',topic:'Table plan',title:'Edit the table plan',keywords:['table plan','floor plan','layout','tables','move tables','designer','areas','seats'],body:'Drag tables into place, set seats, join tables and add areas such as Terrace or Garden.',steps:['Go to More \u203a Table plan.','Tap Open the designer.','Drag tables, or tap one to change its name and seats.','Tap Save. Displays and bookings use the new plan straight away.'],showMe:{tab:'more',page:'tableplan',target:{testID:'open-designer'},hint:'Open the designer to move tables.'}},{id:'rota',kind:'guide',topic:'Rota',title:'Build and publish the rota',keywords:['rota','shift','schedule','week','publish','staff hours','add shift'],body:'Plan the week, then publish it so staff see their shifts in the Staff app.',steps:['Go to More \u203a Rota.','Tap a person\u2019s day to add a shift (presets: lunch, dinner, double).','New shifts are drafts with a dashed amber border.','Tap Publish when the week is ready. Staff see only published shifts.'],showMe:{tab:'more',page:'rota',target:{testID:'rota-publish'},hint:'Tap a day to add a shift, then Publish here.'},actions:['add_rota_shift','publish_rota']},{id:'rota-copy',kind:'faq',topic:'Rota',title:'Can I copy last week\u2019s rota?',keywords:['copy','last week','repeat','rota','duplicate'],body:'Yes. On the Rota tap Copy last week. The shifts come over as drafts so you can tweak them before publishing.',showMe:{tab:'more',page:'rota',target:{testID:'rota-copy'},hint:'Copy last week\u2019s shifts as drafts.'}},{id:'sign-off',kind:'guide',topic:'Hours & pay',title:'Sign off hours',keywords:['sign off','signoff','confirm hours','approve','timesheet','clock','pending'],body:'Only confirmed hours count for pay and tips. Check clocked times against the rota and confirm them.',steps:['Go to More \u203a Sign off hours.','Flagged days (late, missing clock-out, long breaks) are at the top.','Tap a row to fix a time; give a short reason.','Tap Confirm all unflagged, then deal with the rest.'],showMe:{tab:'more',page:'signoff',target:{testID:'confirm-unflagged'},hint:'Confirm all the days that look right in one tap.'}},{id:'payroll-hours',kind:'guide',topic:'Hours & pay',title:'Export hours for payroll',keywords:['payroll','export','hours','spreadsheet','csv','excel','accountant','copy','print'],body:'Get each person\u2019s confirmed hours for a pay period into your spreadsheet or to your accountant.',steps:['Go to More \u203a Payroll hours.','Pick the pay period (or a tips fortnight, or a custom range).','Check the pending banner: sign those off first if you can.','Tap Copy for spreadsheet and paste into Excel or Google Sheets, or download a CSV, or print.'],showMe:{tab:'more',page:'hours',target:{testID:'copy-tsv'},hint:'Copy, then paste straight into your spreadsheet.'}},{id:'pay-dates',kind:'faq',topic:'Hours & pay',title:'How do I set our pay dates?',keywords:['pay day','payday','pay dates','cut-off','wages','monthly','fortnightly'],body:'Settings \u203a Pay & tips: set when tips are paid and how often, the wage pay day and the cut-off. Payroll hours and Tips day use these dates.',showMe:{tab:'more',page:'paysettings',target:{testID:'save-pay'},hint:'Change the dates above, then Save.'}},{id:'tips-day',kind:'guide',topic:'Tips',title:'Share out tips on tips day',keywords:['tips','tronc','gratuity','share','split','tips day','service charge'],body:'Enter the tips total and it\u2019s shared by confirmed hours for the fortnight, to the penny.',steps:['Go to More \u203a Tips day (the right fortnight is picked for you).','Type the total tips.','Check anyone with pending hours; sign them off first if you can.','Copy or download the split for payroll.'],showMe:{tab:'more',page:'tipsday',target:{testID:'tips-total'},hint:'Type the tips total here.'}},{id:'invites',kind:'guide',topic:'Team',title:'Invite staff to the app',keywords:['invite','link','staff app','new starter','sign in','add staff','team member'],body:'Each person gets their own sign-in link. You choose when and how to share it.',steps:['Go to Settings \u203a Invite links.','Tap Make invite link next to the person.','Share the link yourself (text or WhatsApp). The app never sends it for you.','They tap it once and the Staff app remembers them.'],showMe:{tab:'more',page:'setup-invites',target:{text:'Make invite link'},hint:'Make a personal link, then share it yourself.'}},{id:'suppliers',kind:'guide',topic:'Suppliers',title:'Suppliers and order sheets',keywords:['supplier','order','order sheet','delivery','cut-off','fish','veg','dairy'],body:'Keep supplier contacts, order days and cut-offs together, and log what you ordered.',steps:['Go to More \u203a Suppliers to add or edit a supplier.','Use Supplier order sheets for the items you usually order.','Tap Log an order after you place it by phone or email.'],showMe:{tab:'more',page:'ordersheets',target:{testID:'sheet-add'},hint:'Add an order sheet for a supplier.'}},{id:'display-glance',kind:'guide',topic:'Display',title:'Today at a glance (Display)',keywords:['glance','today','covers by hour','breaks','on now','next','cut-off','cutoff','order times','display bar'],body:'The bar under the Display header shows today in one line: covers by hour (booked in solid gold, the walk-in estimate dashed), quiet times for breaks, who is on now and next, today\u2019s supplier order cut-offs with a countdown (amber under 30 minutes) and one tip. Cut-offs come from Scheduled notifications.'},{id:'sold-out',kind:'guide',topic:'Menu',title:'Sold out dishes',keywords:['sold out','run out','ran out','none left','back on','86','eighty six','display strip'],body:'When a dish runs out, mark it sold out so every member of staff knows. It\u2019s a reminder for staff: CoverCharge doesn\u2019t link up to your till, so it doesn\u2019t change the till. Sold out dishes show in a slim strip along the bottom of the Display within seconds, and in the Sold out list in Front of House, Managers and Head Chef. They clear by themselves when the kitchen closes (or the next morning, or only when you tap Back on: Settings \u203a Advanced \u203a Sold out reminders).',steps:['Open the Sold out list (Managers: More \u203a Sold out; Front of House: Me \u203a Sold out; Head Chef: Kitchen \u203a Live tickets \u203a Sold out).','Tap Mark sold out next to the dish.','When it\u2019s back, tap Back on.'],showMe:{tab:'more',page:'soldout',target:{testID:'soldout-search'},hint:'Find the dish, then tap Mark sold out.'}},{id:'shellfish',kind:'guide',topic:'Stock',title:'Live shellfish (and other) counts',keywords:['shellfish','lobster','crab','oysters','count','stock','tracked','sold out','86'],body:'Counters for things you sell by the unit, like lobster or crab. They show on the Display and warn when low.',steps:['Go to Settings \u203a Tracked stock.','Tap Add an item to track; set the name, icon and low warning.','Staff update the count from the small lobster and crab chip at the top of the Display, or in the app.'],showMe:{tab:'more',page:'trackedstock',target:{text:'Add an item to track'},hint:'Add something to count, like lobster.'}},{id:'recipe-cards',kind:'guide',topic:'Recipe cards',title:'Recipe cards',keywords:['recipe','card','dish','ingredients','method','allergens','spec'],body:'Photo, ingredients, method and allergens for each dish; the head chef signs them off and staff can read them.',steps:['Go to More \u203a Recipe cards.','Search for a dish or add a new one.','Fill in ingredients (allergens are suggested) and the method.','Send for head chef sign-off.'],showMe:{tab:'more',page:'recipecards',target:{testID:'card-search'},hint:'Search your recipe cards here.'}},{id:'display-pair',kind:'guide',topic:'Displays',title:'Pair a display or tablet',keywords:['display','tablet','pair','screen','code','front of house','kitchen screen'],body:'Connect a tablet to your venue with a one-time code. You can switch any display off from here.',steps:['Open the Display app on the tablet.','In Managers go to Settings \u203a Displays and tap Make a pairing code.','Type the code on the tablet. It joins your venue straight away.'],showMe:{tab:'more',page:'displays',target:{text:'Make a pairing code'},hint:'Make a one-time code for the tablet.'}},{id:'settings-hours',kind:'faq',topic:'Settings',title:'How do I change our opening hours?',keywords:['opening hours','hours','closed','open','kitchen hours','times'],body:'Settings \u203a Opening hours. Guests see these on your booking and order pages; bookings outside them are turned away.',showMe:{tab:'more',page:'setup-hours',hint:'Set each day\u2019s opening and closing time here.'}},{id:'replay-setup',kind:'faq',topic:'Settings',title:'Can I see the welcome walkthrough again?',keywords:['welcome','setup','walkthrough','onboarding','checklist','questionnaire'],body:'Yes: Settings \u203a Setup checklist \u203a Replay welcome. Everything is pre-filled from your questionnaire.',showMe:{tab:'more',page:'setupchecklist',target:{testID:'replay-welcome'},hint:'Replay the welcome walkthrough.'}},{id:'connected-accounts',kind:'guide',topic:'Accounts',title:'Connect your email, website and socials',keywords:['connect','account','gmail','outlook','wix','facebook','instagram','square','xero','quickbooks','login'],body:'Settings \u203a Connected accounts: tap a logo, save the account to your list, and use Connect with\u2026 to sign in on that service\u2019s own page (rolling out service by service; it shows Coming soon until then). CoverCharge never sees your password that way, and you can remove an account any time.',steps:['Go to Settings \u203a Connected accounts.','Tap the service\u2019s logo.','Tap Connect with\u2026 and sign in on their page.','To stop, tap Remove.'],showMe:{tab:'more',page:'connections',target:{testID:'conn-tile-gmail'},hint:'Tap a logo to connect that account.'}},{id:'supplier-portals',kind:'guide',topic:'Suppliers',title:'Order from your suppliers',keywords:['bidfood','booker','wholesale','cash and carry','order online','supplier login','account number','customer number'],body:'Settings \u203a Connected accounts \u203a Suppliers. Add supplier links for this venue, with an account number if you like. Open ordering and Log in open the supplier\u2019s own website, where you sign in; CoverCharge never keeps the password.',steps:['Go to Settings \u203a Connected accounts.','Scroll to Suppliers.','Tap Add against a supplier (account number optional).','Tap Open ordering or Log in whenever you need them.','To stop, tap Remove and confirm.'],showMe:{tab:'more',page:'connections',target:{testID:'portal-bidfood'},hint:'Your supplier ordering websites live here.'}},{id:'support',kind:'faq',topic:'Settings',title:'How do I get help from a person?',keywords:['support','help','contact','person','problem','broken','stuck'],body:'Support is free for life. Message the CoverCharge team from Settings \u203a Help, or email us, and we\u2019ll reply. We help by message and email.'},{id:'assistant-safe',kind:'faq',topic:'Settings',title:'Can the Assistant send or pay for things by itself?',keywords:['assistant','safe','confirm','send','pay','delete','ai'],body:'No. The Assistant and the voice helper show you exactly what they will do and wait for you to tap Confirm (or say yes). Anything that would send a message, order from a supplier or pay is only saved as a draft in Drafts for approval; nothing goes out by itself.'},{id:'restaurant-dashboard',kind:'guide',topic:'Bookings',title:'Restaurant dashboard',keywords:['restaurant dashboard','tables','timeline','guests','covers','joined tables'],body:'In Managers, tap Restaurant dashboard on Home, or More > Run the day > Restaurant dashboard. It is the same live table plan, Timeline, guest list, deposits, dogs, joined tables, Covers, covers-through-the-day chart and block bookings as the Display. Use the day arrows and Back to today. Assign or join tables on any day; seat, finish, no-show and cancel walk-in actions apply today. You can also say \u201copen Restaurant dashboard\u201d. The helper replies in text only.',showMe:{tab:'more',page:'serviceboard',target:{testID:'restaurant-dashboard-close'},hint:'Restaurant dashboard is open. Pick a day, or tap Back to Managers to close.'}},{id:'voice-helper',kind:'guide',topic:'Settings',title:'Use the hold-to-talk voice button',keywords:['voice','talk','speak','microphone','mic','hold','walkie','button','hands free','gloves'],body:'Hold the big gold button, say what you need, then let go. It logs fridge and freezer temperatures, answers allergen questions, marks dishes sold out, checks tables, adds to the waitlist, reads orders and covers, and drafts bookings, offers, events and supplier lists. The helper replies in text only, never aloud. Changes are shown in text first with Confirm and Cancel buttons: tap Confirm or say yes. Tap the button to type instead (in Managers this also opens the Assistant). It sits at the top right of the header in Managers, Head Chef, the Staff app (the full voice assistant, with no money, tips or HR) and on the Display (no money, tips or HR). Until the voice assistant\u2019s server is switched on, anything new says \u201cVoice assistant is switching on soon\u201d. Fair usage: 1,000 voice tasks a month per venue.',steps:['Hold the gold microphone button (the first time, allow the microphone).','Speak, for example \u201cprep fridge 3 degrees\u201d.','Let go to send.','If it reads something back, tap Confirm or hold again and say \u201cyes\u201d.','The button stays at the top right so it never covers the screen.'],showMe:{tab:'more',page:'voice',hint:'Turn the voice button on or off for each role here.'}},{id:'voice-drafts',kind:'faq',topic:'Settings',title:'Where do voice bookings and shopping lists go?',keywords:['drafts','approve','approval','shopping list','booker list','bidfood list','draft booking','offer','event'],body:'To Settings \u203a Drafts for approval. Bookings, supplier lists, offers, events and specials made by voice wait there for an owner or manager. Approving marks it approved and opens the right screen; you still place the order or confirm the booking yourself.',showMe:{tab:'more',page:'drafts',hint:'Drafts from the voice helper wait here.'}},{id:'voice-temps',kind:'guide',topic:'Settings',title:'Log fridge and freezer temperatures by voice',keywords:['temperature','fridge','freezer','haccp','food safety','eho','log temps','probe'],body:'Hold the voice button and say the unit and the number, for example \u201cprep fridge 3, freezer minus 19\u201d. Fridges should be 5\xb0C or colder and freezers -18\xb0C or colder; anything outside is flagged. Everything is in the Food safety log with who and when, ready to export or print for the EHO.',showMe:{tab:'more',page:'haccp',hint:'Every voice reading appears in the food safety log.'}},{id:'voice-fair-usage',kind:'faq',topic:'Settings',title:'Is there a limit on voice tasks?',keywords:['voice','limit','allowance','fair usage','fair use','how many','tasks','month','plan'],body:'Fair usage: 1,000 voice tasks a month per venue. It is one allowance shared by all of the venue\u2019s apps and devices, and it resets on the 1st. Each request counts once, spoken or typed; saying \u201cyes\u201d to confirm does not count again. You will see a note at 80%. If the venue reaches 1,000, the voice helper pauses until the 1st, except food safety and temperature logging, which always works. The owner can contact CoverCharge if you need more. See the count in Plan & billing or Settings \u203a Voice helper.',showMe:{tab:'more',page:'voice',hint:'This month\u2019s voice task count is shown here.'}},{id:'adv-bookings',kind:'guide',topic:'Settings',title:'Booking questions: allergies, dogs, access, vegan',keywords:['advanced','allergen','dog','dogs','cap','wheelchair','access','vegan','vegetarian','table request','settings'],body:'Choose what guests are asked when they book. Allergies are always asked first, in red, and staff tick \u201cAllergens seen\u201d. The others can be switched off.',steps:['Open More \u203a Settings \u203a Advanced.','In Bookings, tick or untick each question.','Use the dog stepper to cap dogs per booking time (No limit = only the dog-friendly tables).','Mark dog-friendly and step-free tables on the Table plan.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-bookings'},hint:'Booking questions are here.'}},{id:'adv-table-times',kind:'guide',topic:'Settings',title:'How long tables stay (table times)',keywords:['advanced','dwell','table time','turn','how long','next table free','minutes'],body:'Usual table times by party size: 90 min for 1\u20132 covers, 105 for 3\u20135, 2 hours for 6\u201319 and 3 hours for 20 or more. The app fine-tunes them from how long your tables really stay, and uses them for \u201cNext table free\u201d.',steps:['Open More \u203a Settings \u203a Advanced \u203a Table times.','Tap \u2212 or + to change a band by 5 minutes.','Untick \u201cFine-tune\u201d to use your numbers exactly.','Reset to default puts the four bands back.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-times'},hint:'Table times are here.'}},{id:'adv-reservable',kind:'guide',topic:'Settings',title:'Seafood platter, crab and lobster reservations',keywords:['advanced','platter','seafood','crab','lobster','reserve','price'],body:'Guests can reserve the Seafood Platter (1 crab + 1 lobster, \xa3160) or a crab or lobster with their booking. Reserved ones come off the Display count with a \u201cReserved\u201d line, the kitchen is told, and the Head Chef taps OK.',steps:['Open More \u203a Settings \u203a Advanced \u203a Reservable items.','Tick what guests can reserve and set the price.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-reserve'},hint:'Reservable items are here.'}},{id:'adv-events',kind:'guide',topic:'Settings',title:'Regular events like Open Mic Night',keywords:['advanced','open mic night','music night','event','regular','monthly','promote','busier','last food'],body:'Add events that repeat, e.g. Open Mic Night on the last Sunday of every month from 8pm with last food orders at 7pm. They show in Forecast key dates with a Promote button and on Today, and \u201cExpect busier\u201d raises the forecast.',steps:['Open More \u203a Settings \u203a Advanced \u203a Regular events.','Tap Add a regular event (or Edit).','Pick how it repeats and the day, add a start time and last food orders if needed.','Tap Save event.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-events'},hint:'Regular events are here.'}},{id:'adv-hours',kind:'guide',topic:'Settings',title:'Kitchen hours, seasons and special days',keywords:['advanced','hours','kitchen','season','winter','summer','special day','closed','last food orders','cutoff'],body:'Kitchen (food) hours decide which booking times are offered; the closing time is last food orders. Keep Winter and Summer hours, each with the date it starts every year, and the app switches by itself. Add special days for one-off changes.',steps:['Open More \u203a Settings \u203a Advanced \u203a Kitchen hours.','Tap Set Summer hours, fill in each day and the start date (e.g. 04-01 for 1 April).','Set the Winter start date too.','Use Add a special day for closures or late nights.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-hours'},hint:'Kitchen hours and seasons are here.'}},{id:'adv-home',kind:'faq',topic:'Settings',title:'Covers counter, Next table free and takeaway on home screens',keywords:['advanced','covers counter','takeaway','next table free','home','display','flip'],body:'Turn the COVERS counter and the \u201cNext table free\u201d card on or off, and choose whether takeaway figures show on home screens (off at the Anchorage). Takeaway order alerts always work. The flap click sound is set on each Display.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-home'},hint:'Display and home options are here.'}},{id:'adv-holidays',kind:'faq',topic:'Settings',title:'Why don\u2019t bank holidays say \u201c(substitute day)\u201d?',keywords:['advanced','holiday','substitute','bank holiday'],body:'The date already shows when a holiday moves, so the extra words are hidden. Tick \u201cShow full gov.uk names\u201d in Settings \u203a Advanced \u203a Holiday names to bring them back.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-holidays'},hint:'Holiday names are here.'}},{id:'adv-blocks',kind:'guide',topic:'Settings',title:'Lunch and dinner times for Block now',keywords:['block','lunch','dinner','service','wix','advanced','pause'],body:'Settings \u203a Advanced \u203a Block bookings sets when Lunch and Dinner run, for the Block now buttons and Spend per head. At The Anchorage, blocks also close those times on website bookings, and blocks made on the website show in CoverCharge. Website bookings can only close the whole venue, not one area or some tables.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-blocks'},hint:'Block bookings settings are here.'}},{id:'blocks-screen',kind:'guide',topic:'Bookings',title:'Block bookings: today, a future date, an area or some tables',keywords:['block','blocks','pause','close','closed','stop bookings','private','repeat','future'],body:'Tap Block bookings on the home screen. Block now pauses bookings today (Rest of today, Next hour, Lunch, Dinner, or a From\u2013To). Add a block closes a future date or range, the whole day or set times, the whole venue, one area or some tables, once or every week or on the last weekday of the month. Every future block is listed by month with Edit and Remove; removing asks first and is logged. Bookings already made are kept, and you are told how many.',showMe:{tab:'more',page:'blocks',target:{testID:'blocks-screen'},hint:'Block bookings is here.'}},{id:'spend-per-head',kind:'guide',topic:'Money',title:'Spend per head',keywords:['spend per head','sph','average spend','takings','covers','gross'],body:'Spend per head is Gross takings \xf7 Covers, by day, by week and for lunch and dinner. Enter the gross on the cash up (Enter the cash up, Upload a spreadsheet, or Enter takings). Covers are seated and finished bookings and walk-ins; no-shows and cancellations are left out. A day with no takings shows \u201cNo takings entered\u201d, never \xa30.',showMe:{tab:'more',page:'spendhead',target:{testID:'sph-screen'},hint:'Spend per head is here.'}},{id:'cashup-photo',kind:'guide',topic:'Money',title:'Enter the cash up, or upload a spreadsheet',keywords:['cash up','paid out','spreadsheet','csv','excel','xlsx','sheet','gross','card','cash','tips','takings','drawer'],body:'In Cash up & sales tap Enter the cash up and type the figures (Z total, card, cash, paid outs, tips, and gross if you have it). In Paid out, add a line for each amount taken from the till \u2014 for example lobsters or supermarket shopping \u2014 with the amount, an optional note, and your name. The paid-out total comes off the expected cash in the drawer. Check every figure, then tap Confirm and save. Bigger venues can tap Upload a spreadsheet (CSV or Excel): match the columns, check the preview (dates already saved are flagged), then confirm. Nothing is saved before you confirm, and every save is logged. You can export cash ups as a spreadsheet from Recent cash ups.',showMe:{tab:'more',page:'cashup',target:{testID:'cashup-by-hand'},hint:'Start the cash up here.'}},{id:'adv-giftqr',kind:'guide',topic:'Settings',title:'Buy a gift card on the Display',keywords:['gift','gift card','voucher','qr','display','wix','advanced'],body:'Switch on \u201cShow Buy a gift card on the Display\u201d in Settings \u203a Advanced \u203a Gift cards on the Display, and save your gift card page address. The Display has a Gift vouchers button: it opens the list of website vouchers (search, use by dates, Mark as used), with Show the buy QR code at the bottom. Guests buy on your website.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-giftqr'},hint:'Gift cards on the Display are here.'}},{id:'adv-whatsapp',kind:'guide',topic:'Settings',title:'WhatsApp buttons (tap to chat)',keywords:['whatsapp','wa.me','message','chat','guest','mobile','number','advanced'],body:'Put the venue\u2019s WhatsApp number in Settings \u203a Advanced \u203a WhatsApp, e.g. 01292 500123 or +44 7700 900123. Guests then see \u201cMessage us on WhatsApp\u201d on their booking confirmation, with their booking details typed in. Staff and managers see \u201cWhatsApp guest\u201d on bookings with a mobile number, with a confirmation typed in that you can change. Nothing is ever sent for you: WhatsApp opens and you tap Send yourself. Leave the number blank and every WhatsApp button stays hidden. Reset to default clears the number.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-whatsapp'},hint:'The WhatsApp number is here.'}},{id:'adv-reminders',kind:'guide',topic:'Settings',title:'Staff reminders: breaks and \u201cchairs up\u201d',keywords:['reminder','reminders','break','breaks','chairs','closing','6 hours','law','snooze','later','done','advanced'],body:'Reminders slide up for staff who are on shift right now (clocked in, or on the rota at that time) in the Staff and Head Chef apps, while the app is open. Break reminders: if the rota shift has a break time, the reminder comes at that time; if not, it comes 4 hours after they clock in (or after the shift starts). If they still haven\u2019t started a break it comes once more 30 minutes later, and again at 6 hours, because UK law says a shift over 6 hours needs a 20-minute break. \u201cStart break\u201d starts their break; \u201cLater\u201d hides it for 15 minutes. You can change these times. Venue reminders, such as \u201cTime to put the chairs up on the tables\u201d (Friday and Sunday, 21:00), have wording, days, a time (UK) and who sees them: everyone on shift, front of house or kitchen. Pause, edit or delete any of them, or add your own. Once anyone taps Done it goes for everyone that day, and the Reminders screen shows who did it. Reset to default brings back the standard break times and \u201cchairs up\u201d; your own reminders stay. Phones with the app closed don\u2019t get reminders yet.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-reminders'},hint:'Reminders are here.'}},{id:'adv-notifications',kind:'guide',topic:'Settings',title:'Scheduled notifications (e.g. the Mills milk order)',keywords:['notification','notifications','push','phone','milk','mills','pieroni','pieronis','veg','olsen','rota upload','scheduled','advanced'],body:'Settings \u203a Advanced \u203a Notifications lists reminders that go to named people at a set UK time, such as \u201cMills milk order\u201d for the Head Chef and Gordon. Each has a title, a message, the days, a time (you can set a different time on some days, e.g. 20:55 on Fridays), who gets it (tick people or pick a group like Everyone on shift) and how it is sent. In the app it is the gold slider with Done and Later; Done is logged with the name and time, and Later hides it for 15 minutes. Urgent notices (like the 6-hour break) always come first and only one shows at a time. Phone notifications: each person taps \u201cTurn on phone notifications\u201d on their own phone (iPhone: add the app to the Home Screen first, iOS 16.4 or later). Nothing goes to phones until an owner or manager switches \u201cSend to phones\u201d on. The Display never gets these. Reset to default restores the configured rules.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-notifications'},hint:'Notifications are here.'}},{id:'adv-order-lists',kind:'guide',topic:'Settings',title:'Order lists (Alsons, Cash and carry)',keywords:['order list','orders','alsons','drinks','cash and carry','trip','shopping','logo','carry over','advanced'],body:'Order lists collect what you need from a supplier. A running list (Alsons drinks) fills up until you order; a trip list (Cash and carry) is for a shopping day, Friday by default, which you can change for each trip. Add an item with a quantity and unit and an optional note; the app records who added it and when. Adding something already on the list offers to add to the quantity instead. On the day, tick Got or Ordered, or mark Missing / not in stock. Finish order saves it to History (date and who) and asks whether to carry over anything not got. Removing an item can be undone. Settings \u203a Advanced \u203a Order lists: add, rename or archive lists, the default trip day, and \u201cLet all staff add items\u201d (on: staff can add and see lists; only managers and the Head Chef tick, remove or finish). Each list can have a logo (take a photo or choose one) or shows its initials, and a phone number to tap to call (never called for you).',showMe:{tab:'more',page:'advanced',target:{testID:'adv-orderlists'},hint:'Order list settings are here.'}},{id:'adv-clock-area',kind:'guide',topic:'Settings',title:'Clock-in area, forgotten breaks and off-rota arrivals',keywords:['clock','clock in','geofence','location','area','radius','break','forgot','rota','visiting','override','advanced'],body:'Clock in, clock out, start break and end break only work at the venue once the centre is set. Stand in the middle of the venue and tap \u201cUse my current location\u201d, then choose how far (at least 50 m, 100 m to start). Phones are not exact, so up to 50 m of the phone\u2019s own accuracy is allowed on top. Each clock record keeps the reading, its accuracy and whether it was inside. If location is off or blocked, the app says how to allow it. Managers can record it for someone from Clock in / out \u203a Record it for someone, with a reason that is logged. Until the centre is set nobody is blocked and managers see a warning. Rota and pay screens are never blocked. Forgotten breaks: if no break was recorded, Clock out asks \u201cDid you take a break? If so, how long?\u201d; a length you pick is saved as a break marked \u201cadded at clock-out\u201d, which managers see and can edit in Hours. Not on the rota: if someone is at the venue, not clocked in and not on the rota, the Staff and Head Chef apps ask \u201cDo you want to sign in?\u201d. Yes clocks them in, marked off-rota, and managers get a notice; \u201cNo, just visiting\u201d stops asking for the day. This only checks while the app is open; web apps can\u2019t watch location in the background.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-clockarea'},hint:'Clock-in area settings are here.'}},{id:'adv-tablegrid',kind:'guide',topic:'Table plan',title:'Table plan grid and Tidy up (Advanced)',keywords:['grid','snap','line up','align','tidy','guides','spacing','restore','table plan','option','alt'],body:'Tables snap to the grid when you drag them, and gold guides show when an edge or centre lines up with another table. A small number shows when the gaps either side are even. Hold Alt (Option on a Mac) to move freely. Tidy up lines every table up on the grid and evens out the rows; only positions change. The old positions are kept, so one tap puts them back.',steps:['Go to Settings \u203a Advanced.','Find Table plan grid.','Turn snapping on or off, pick a grid size, or tap Tidy up the whole plan.','Changed your mind? Tap Put the tables back where they were.']},{id:'adv-printers',kind:'guide',topic:'Orders',title:'Kitchen ticket printers (Advanced)',keywords:['print','printer','printing','ticket','kitchen ticket','docket','receipt','epson','star','bluetooth','reprint','takeaway'],body:'Print a kitchen ticket by itself for every takeaway order, as soon as it comes in or when it is accepted. The ticket has the order number, collection time, name, every dish with its options and notes, allergies in white-on-black, and paid or not paid. Works with Epson (TM-m30, TM-T20, TM-T88), Star WebPRNT, most other network receipt printers (port 9100) and Bluetooth printers from the tablet app. If a ticket does not print, an amber warning shows and the order stays on screen.',steps:['Go to Settings \u203a Advanced.','Find Printers.','Tap Add a printer by IP address or Find printers on this Wi-Fi, choose the type and tap Test print.','Turn on Print a kitchen ticket for every takeaway order.']},{id:'adv-deposits',kind:'guide',topic:'Bookings',title:'Deposits (Advanced)',keywords:['deposit','deposits','per person','per adult','children','waive','waived','regular','party size','refund','refundable','cut off','policy','paid','due'],body:'Ask bigger tables for a deposit: set the amount per adult (children never pay and do not count towards the number that needs one: a table of 8 with 3 children pays nothing; a table of 6 adults, or 7 with 1 child, pays for 6), the smallest number of adults that pays one (6 or more adults at The Anchorage), whether it is refundable and up to how many hours before, and the words guests see. Staff can waive a deposit. No card is saved in CoverCharge. Deposits are paid through website bookings: website bookings show Deposit paid on website bookings, Part paid on website bookings or Deposit not paid by themselves. For phone and walk-in bookings, staff tick Deposit paid once the guest has paid you, or (once switched on) press Send deposit link to send a website bookings pay link by text, WhatsApp or email. Refunds are done in Website bookings \u203a Orders. Deposit amounts are shown on bookings in Managers, Display and Staff. Other financial and HR information remains restricted.',steps:['Go to Settings \u203a Advanced.','Find Deposits.','Turn deposits on or off, and set the amount, party size, refund terms and the words guests see.','On a booking, tap Mark deposit paid once the guest has paid.','To let a regular off, tap Waive deposit on the booking (or in Edit booking), add why if you like, and tap Yes, waive it. Your name is saved with it.']},{id:'adv-loyalty',kind:'guide',topic:'Guests',title:'Loyalty: stamp card, offers & bring a friend (Advanced)',keywords:['loyalty','stamp','stamps','card','reward','offer','offers','referral','friend','expiry'],body:'The stamp card, offers and bring-a-friend are saved on the server, so every phone and tablet shows the same card. Set how many stamps earn a reward, what the reward is, when stamps or rewards run out, and how often one guest can get a stamp. Stamps only come from staff, or from a code or QR staff make, and each reward can be used once. Guests join with their agreement recorded, and a manager can remove a guest and their details.',steps:['Go to Settings \u203a Advanced.','Find Loyalty.','Turn the stamp card on, write the reward and tap Save loyalty settings.','Add offers with their dates, and turn bring-a-friend on if you want it.']},{id:'adv-table-order',kind:'guide',topic:'Guests',title:'Order at the table (Advanced)',keywords:['order at table','qr','qr code','scan','table','phone','accept','last orders','print','pdf','pay at bar'],body:'Guests scan the small QR card on their table (Managers \u203a Table QR codes prints them, 20 to a page), see your menu with allergens, and send an order. It lands in Front of House and on the kitchen screen within seconds. Prices, sold-out dishes and hours are checked on the server, so a phone can\u2019t change them. Staff accept the first order from each new phone (you can turn this off). Guests pay at the bar or with their server; paying by card from the phone is coming later.',steps:['Go to Settings \u203a Advanced.','Find Order at the table.','Turn it on, pick the areas or tables, set the hours and tap Save order at the table.','Tap Make codes, pick Stickers 50 \xd7 50 mm or Stand cards 50 \xd7 70 mm, then Print all QR cards (PDF) and put each code on its table.']},{id:'adv-soldout',kind:'guide',topic:'Menu',title:'Sold out reminders (Advanced)',keywords:['sold out','86','clear','end of service','next morning','back on','advanced','display strip','automatic','counts','lobster','crab'],body:'Choose when sold out dishes go back on by themselves: when the kitchen closes (from your Kitchen hours), the next morning (pick the time), or only when someone taps Back on. \u201cMark dishes sold out from the counts\u201d (on unless you turn it off) marks every dish that uses a counted item, like lobster or crab, when the count runs out, and puts it back on when the count is back up. Sold out is a reminder for staff on the Display and in the staff apps; it doesn\u2019t change your till.',steps:['Go to Settings \u203a Advanced.','Find Sold out reminders.','Pick when they clear, and turn marking from the counts on or off.']},{id:'sold-out-auto',kind:'guide',topic:'Menu',title:'Sold out from the counts (lobster, crab\u2026)',keywords:['sold out','automatic','auto','counts','shellfish','lobster','crab','platter','link','uses','none left'],body:'When a counted item runs out, or drops below what a dish needs, every dish that uses it is marked sold out by itself, with the reason: \u201cDeluxe Seafood Platter (no lobster or crab)\u201d. When the count is back up (a delivery or a recount), those dishes go back on by themselves. Dishes marked by hand are left alone. CoverCharge works out what each dish uses from its recipe card, its description (\u201cone whole lobster\u201d) or its name; you can change it for any dish. If you tap Back on while the count is still short, the dish stays on until the count changes.',steps:['Open the Sold out list.','Under Dishes linked to the counts, tap Change next to a dish.','Set how many of each item one portion uses (0 = not linked), then tap Save. Back to automatic undoes it.'],showMe:{tab:'more',page:'soldout',target:{testID:'soldout-links'},hint:'Tap Change next to a dish to set what it uses.'}},{id:'adv-forecast',kind:'guide',topic:'Forecasts',title:'Forecast history and "Not enough history yet"',keywords:['forecast','not enough history','history','estimate','example figures','labour','sales','walk-ins','advanced'],body:'Forecasts are built only from your own bookings, seated walk-ins, takeaway orders and cash-ups. Until CoverCharge has enough of your history (2 weeks to start with; change it in Settings \u203a Advanced \u203a Forecast history) you see \u2018Not enough history yet\u2019, what is already booked and your real labour cost from the rota, with no sales forecast or labour %. No history is invented for a live venue.',steps:['Go to Settings \u203a Advanced.','Find Forecast history.','Pick how many weeks are needed.']},{id:'adv-checkout',kind:'guide',topic:'Team',title:'Shift check-out, question board and team morale',keywords:['check out','checkout','morale','mood','staffing','overstaffed','survey','anonymous','question board','vote','shout out','wellbeing','advanced'],body:'When someone clocks out, they get a quick card: team morale from Low to High, and whether there was enough staff for the customers. They can also post a question for the board or shout out a teammate, or tap Skip. Nothing shows at clock in. Answers are anonymous: no name or staff number is saved, and each phone can answer a shift once. Team morale (Managers app \u203a More \u203a Team morale) shows a day only once 3 or more people have answered, next to that day\u2019s covers. Change the wording or switch parts off here.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-checkout'},hint:'Check-out and board settings are here.'}},{id:'hr-board',kind:'guide',topic:'Team',title:'The anonymous question board',keywords:['question board','board','anonymous','vote','yes no','reply','hide','moderation','log'],body:'Anyone on the team can post a question and vote it up, or vote Yes or No. No names are shown or saved. Owners and managers can reply (shown as \u201cReply from the managers\u201d) and hide offensive posts with a reason. Every hide, unhide and reply is in the Moderation log.',showMe:{tab:'more',page:'board',hint:'The question board.'}},{id:'adv-tasks',kind:'guide',topic:'Team',title:'Daily tasks',keywords:['tasks','daily tasks','checklist','duties','jobs','to do','my tasks','library','head chef'],body:'Give each person a short list of daily tasks: open Staff & roles, tap Daily tasks on their card, then pick from the venue\u2019s task library or type a new one. Use the arrows to reorder, \u2715 to remove (with Undo) and Days to limit a task to certain days. They see \u201cMy tasks today\u201d on their home screen and tick each one off while on shift; each tick records who and when, and you see \u201c2 of 5 done today\u201d on their card. Lists start fresh every day. Owners and managers can change anyone\u2019s list, including the Head Chef\u2019s. The Head Chef can change the lists of kitchen staff (chefs, commis and KPs) from Kitchen \u203a Kitchen team tasks, but not their own and not front of house. The task library is in Settings \u203a Advanced \u203a Tasks.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-tasks'},hint:'The task library is here.'}},{id:'adv-cashup',kind:'guide',topic:'Money',title:'Cash up and weekly sales',keywords:['cash up','cashup','takings','float','till','sales report','weekly sales','pos','printout','photo','graphs','charts'],body:'At the end of the night open Cash up & sales and tap Enter the cash up. Type each figure; boxes left blank stay blank (never counted as zero) and are highlighted in amber. Add any cash paid out of the till (lobsters, supermarket shopping, and the like) in the Paid out section: each line has what it was for, the amount, an optional note and who entered it. The total reduces the expected cash in the drawer. Nothing is saved until you tap Confirm and save. Do the same with the weekly sales report from the till (several pages is fine). The graphs show daily takings, tips, weekly net sales against the week before and sales by category. Owners and managers can enter and change cash ups; the Head Chef can see the graphs if they are allowed to see takings. Change the boxes to match your sheet in Settings \u203a Advanced \u203a Cash up; Cash tips total and Card tips total are always kept.',showMe:{tab:'more',page:'cashup',target:{testID:'cashup-by-hand'},hint:'Start the cash up here.'}},{id:'adv-tips',kind:'guide',topic:'Money',title:'Today\u2019s tips and the Tips pot',keywords:['tips','today tips','tips pot','pot','payout','tip pay','correction','coins'],body:'When a cash up with Cash tips total and Card tips total is confirmed, the team\u2019s combined tips for that day show as Today\u2019s tips in every staff app and on the Display, with a short notice. The Tips pot adds up confirmed daily tips since the last payout (fortnightly tip pay). After paying the tips, an owner or manager taps Mark payout done on the Tips pot card: the pot goes back to \xa30.00 and the old pot is kept in Past pots. Use Correct an entry to add or take off an amount for a day; a reason is required and every correction is logged with your name. Only the team total is ever shown, never anyone\u2019s share. Hide either card in Settings \u203a Advanced \u203a Tips.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-tips'},hint:'Show or hide the tips cards here.'}},{id:'manager-access',kind:'guide',topic:'Team',title:'Manager access',keywords:['manager access','manager','access','role','promote','front of house','head chef','owner'],body:'In Staff & roles each person has a Manager access switch. On: they use the Manager app (rota, bookings, staff, hours, settings, plus their own clock in, rota and pay). Off: they use the Front of House app, or the Head Chef app for the Head Chef. Owners can switch anyone except owners; managers can switch anyone except themselves and owners. The last owner can never be removed. You confirm each change; it is logged with who and when (Access changes). Job titles are free text and don\u2019t change.',showMe:{tab:'more',page:'staff',target:{testID:'access-tip'},hint:'Manager access switches are on each person.'}},{id:'next-table-free',kind:'faq',topic:'Walk-ins',title:'When is the next table free?',keywords:['next table','free','wait','walk-in','quote','full'],body:'When you\u2019re full, Today and the Display show \u201cNext table free about 19:40 (T6, 4 seats)\u201d with \u201clikely\u201d or \u201cmaybe\u201d, and how long a walk-in for 2 or 4 would wait. Tap Bill requested or Table finished on the plan and it updates. You can also ask the Assistant \u201cwhen\u2019s the next table free?\u201d.'},{id:'time-travel',kind:'faq',topic:'Today',title:'Look at another day (time travel)',keywords:['yesterday','tomorrow','next week','past','future','day','time travel'],body:'On Today, tap \u2039 or \u203a beside the date to step a day back or forward. You\u2019ll see that day\u2019s kitchen hours, events, covers (booked, or how it went), platters and each booking\u2019s allergens and needs. It\u2019s read-only and nothing changes live service. Tap Today to come back. The Display goes back to today by itself after 2 minutes. Staff can look 7 days back and 14 days ahead.'},{id:'sign-in-links',kind:'guide',topic:'Team',title:'Personal sign-in links',keywords:['link','invite','sign in','new link','expired','already used','phone','login'],body:'Each personal link works on one phone only and lasts 5 days, so nobody else can sign in as that person. The same phone can open it again, in any of the apps. If someone gets a new phone, or their link has expired, open Staff & roles, tap New sign-in link on their entry, then Copy link and send it to them yourself. The app never sends it. Owners can make links for anyone; managers for anyone except owners. Their old unused link stops working; phones already signed in stay signed in.',showMe:{tab:'more',page:'staff',target:{testID:'access-tip'},hint:'New sign-in link is on each person.'}},{id:'pins-security',kind:'faq',topic:'Team',title:'PINs for the Display',keywords:['pin','display pin','clock in','wake pin','2580','manager pin','locked'],body:'Staff PINs for clocking in at the Display are 4 to 8 digits. Managers and owners need 6 to 8 digits, because their PIN can add temp staff. Easy PINs such as 1111 or 1234 are refused. Five wrong tries locks that person for 15 minutes; 20 wrong tries on one Display stops it for 15 minutes. The Display wake PIN (Settings \u203a Display) is 6 to 8 digits and is kept only as a scrambled hash. If it still says 2580, change it.'},{id:'cash-up-lock',kind:'faq',topic:'Money',title:'Correcting a signed-off cash up',keywords:['cash up','locked','unlock','correct','mistake','history','audit','sales report'],body:'Once a cash up or weekly sales report is confirmed and saved, it is locked so the figures can\u2019t change quietly. An owner taps Unlock to correct on it, says why, and has 30 minutes to fix it. History on each one shows who signed it off, changed or unlocked it, and when.'},{id:'wipe-device',kind:'faq',topic:'Settings',title:'Sign out and wipe a shared tablet or phone',keywords:['wipe','sign out','shared','tablet','leaver','lost','reset device'],body:'Tap the sync badge (bottom left), or go to Settings \u203a Display, and choose Sign out and wipe this device. It signs out and removes everything CoverCharge keeps on that device: sign-ins, pairing, saved screens and changes not sent yet. The venue\u2019s shared data is not touched. On the Display you type the wake PIN first.'}],o=t=>a.find(a=>a.id===t)},1481,[]); __d(function(g,r,_i,_a,m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"tokens",{enumerable:!0,get:function(){return o}}),e.lev=l,e.searchHelp=function(n,l,i=8){const h=o(l);if(!h.length)return[];const a=t(l);return n.map(n=>{const l=o(n.title),i=o(n.keywords.join(' ')),c=o(`${n.body} ${(n.steps??[]).join(' ')}`);let f=3*s(h,l)+2.5*s(h,i)+.8*s(h,c);return n.keywords.some(n=>a.includes(t(n))&&t(n).length>3)&&(f+=2),t(n.title).includes(a)&&a.length>3&&(f+=3),{a:n,score:f/Math.sqrt(h.length)}}).filter(t=>t.score>=1.2).sort((t,n)=>n.score-t.score).slice(0,i)};const t=t=>t.toLowerCase().replace(/[\u2019']/g,'').replace(/[^a-z0-9\xa3 ]+/g,' ').replace(/\s+/g,' ').trim(),n=new Set(['how','do','i','a','an','the','to','can','my','our','we','is','it','of','for','in','on','and','what','where','please','me','you','with']),o=o=>t(o).split(' ').filter(t=>t&&!n.has(t));function l(t,n,o=2){if(Math.abs(t.length-n.length)>o)return o+1;let l=Array.from({length:n.length+1},(t,n)=>n);for(let i=1;i<=t.length;i++){const s=[i];let h=i;for(let o=1;o<=n.length;o++)s[o]=Math.min(l[o]+1,s[o-1]+1,l[o-1]+(t[i-1]===n[o-1]?0:1)),h=Math.min(h,s[o]);if(h>o)return o+1;l=s}return l[n.length]}function i(t,n){if(t===n)return 1;if(t.length>=3&&n.startsWith(t))return.8;if(n.length>=4&&t.startsWith(n))return.7;if(t.length>=4){if(l(t,n,t.length>=7?2:1)<=(t.length>=7?2:1))return.6}return 0}function s(t,n){let o=0;for(const l of t){let t=0;for(const o of n)if(t=Math.max(t,i(l,o)),1===t)break;o+=t}return o}},1482,[]); __d(function(g,r,_i,_a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"STAFF_VOICE_ACTIONS",{enumerable:!0,get:function(){return x}}),Object.defineProperty(_e,"STAFF_ALLOWED",{enumerable:!0,get:function(){return C}});var e=r(_d[0]),t=r(_d[1]),a=r(_d[2]),s=r(_d[3]),o=r(_d[4]),n=r(_d[5]),i=r(_d[6]);const h=()=>{try{return(0,e.nowFrom)(e.useStore.getState().clock)}catch{return new Date}},c=e=>String(e).padStart(2,'0'),d=e=>e.getFullYear()+'-'+c(e.getMonth()+1)+'-'+c(e.getDate()),l=e=>{const t=new Date(e);return c(t.getHours())+':'+c(t.getMinutes())},u=e=>{const t=(Math.round(60*e)%1440+1440)%1440;return c(Math.floor(t/60))+':'+c(t%60)},m=(e,t)=>{if(e===t)return'today';const[a,s,o]=e.split('-').map(Number),n=new Date(a,s-1,o),i=new Date(h());return i.setDate(i.getDate()+1),e===d(i)?'tomorrow':n.toLocaleDateString('en-GB',{weekday:'long',day:'numeric',month:'long'})},p=(e,t)=>t.test(e),f=e=>(e??'').replace(' (example)',''),b=e=>t.useOwner.getState().staff.find(t=>t.id===e.whoId),k=['staff'],w=[['kitchen',/\bkitchen\b/],['foh',/\b(front of house|foh|floor|bar)\b/],['managers',/\bmanagers?\b/],['all',/\b(all staff|everyone|whole team|team|group)\b/]],y={all:'the Team chat',kitchen:'Kitchen',foh:'Front of house',managers:'Managers'};function S(e,t){return'all'===e||(0,n.inChannel)(e,t)}function v(e,a){const s=e.toLowerCase().match(/\b(?:message|pm|private message|dm|text|tell)\s+([a-z' -]+?)(?:\s*[:,]|\s+(?:that|saying|to say)\b)/),o=(s?.[1]??'').trim();if(o&&!/^(the )?(team|everyone|kitchen|front of house|managers|group|all staff)$/.test(o))return t.useOwner.getState().staff.filter(e=>e.active&&e.id!==a.whoId).find(e=>(0,t.staffCalled)({name:f(e.name),nickname:e.nickname},o))}const x=[{id:'post_kitchen_chat',apps:['owner','chef'],title:'Post in the Kitchen chat',risk:'change',description:'Post a message in the pinned Kitchen chat (owners, managers, head chefs and kitchen staff).',params:[{name:'text',type:'string',required:!0,description:'The message'}],keywords:['kitchen chat'],match:e=>p(e,/\bkitchen (chat|group|channel)\b/)&&!p(e,/\b(read|any|unread|latest)\b/)?7:0,parse:e=>{const t=e.replace(/^.*?\bkitchen (?:chat|group|channel)\b\s*(?:[:,-]|\bthat\b|\bsaying\b)?\s*/i,'').trim();return{text:t.charAt(0).toUpperCase()+t.slice(1)}},preview:e=>'Post in the Kitchen chat: \u201c'+e.text+'\u201d?',run:(e,a)=>!e.text||String(e.text).length<2?'What should the message say?':(t.useOwner.getState().chatSend({ch:'kitchen',from:String(a.whoId??'system'),text:String(e.text),at:h().toISOString()}),'Posted in the Kitchen chat.')},{id:'post_team_chat',apps:k,title:'Post to the team chat or message one person',risk:'change',description:'Post a message in the team chat (All staff, Kitchen or Front of house), or a private message to one person. Read back first; posted only after Confirm.',params:[{name:'text',type:'string',required:!0,description:'The message'},{name:'ch',type:'string',required:!0,description:'Channel id or dm id'},{name:'to',type:'string',description:'Name of the person, for a private message'}],keywords:['team chat','group chat','message'],match:e=>p(e,/\b(message|pm|dm|text|tell|post|send|let)\b/)&&p(e,/\b(chat|team|everyone|group|kitchen|front of house|managers|know|:)|\b(message|pm|dm|text)\s+[a-z]+\s*[:,]/)&&!p(e,/\b(read|any|unread|what did|latest|last)\b.*\b(messages?|chat)\b/)?5:0,parse:(e,t)=>{const a=t,s=e.toLowerCase(),o=v(e,a),n=e.replace(/^.*?(?:[:]|\b(?:saying|that|to say)\b)\s*/i,'').replace(/^\s*(?:(?:post|send|put|write)\s+(?:in|on|to)\s+(?:the\s+)?(?:team|group|kitchen|front of house|all staff)?\s*chat\s*)/i,'').trim(),i=n&&n!==e?n:e.replace(/^\s*(?:tell|message|post to|let)\s+(?:the\s+)?(?:team|everyone|group chat|team chat|kitchen|front of house)\s*(?:know\s*)?(?:that\s*)?/i,'').trim();if(o)return{text:i.charAt(0).toUpperCase()+i.slice(1),ch:'dm:'+[String(a.whoId),o.id].sort().join(':'),to:f(o.name)};const h=w.find(([,e])=>e.test(s))?.[0]??'all';return{text:i.charAt(0).toUpperCase()+i.slice(1),ch:h}},preview:e=>e.to?'Private message to '+e.to+': \u201c'+e.text+'\u201d. Send it?':'Post in '+(y[String(e.ch)]??'the team chat')+': \u201c'+e.text+'\u201d?',run:(e,a)=>{const s=String(e.ch),o=b(a);return!e.text||String(e.text).length<2?'What should the message say?':s.startsWith('dm:')||S(s,o)?(t.useOwner.getState().chatSend({ch:s,from:String(a.whoId??'system'),text:String(e.text),at:h().toISOString()}),e.to?'Sent to '+e.to+'.':'Posted in '+(y[s]??'the team chat')+'.'):'You can\u2019t post in '+(y[s]??s)+'. Try the Team chat.'}},{id:'read_chat',apps:k,title:'Read out chat messages',risk:'look',description:'Read out unread messages (team chat and private messages), or the latest ones.',params:[],keywords:['messages','chat'],match:e=>p(e,/\b(read|any|unread|new|what did|latest|last|check)\b.*\b(messages?|chats?|pms?)\b|\bwhat.?s (been said|in the chat)\b/)?6:0,preview:()=>'Read out chat messages',run:(e,a)=>{const s=t.useOwner.getState(),o=b(a),n=String(a.whoId??''),i=s.chat.filter(e=>{return!e.removed&&e.text&&((t=e.ch).startsWith('dm:')?t.split(':').slice(1).includes(n):o?'all'===t||S(t,o):'all'===t);var t}).sort((e,t)=>e.at.localeCompare(t.at)),h=i.filter(e=>e.from!==n&&!e.seenBy.includes(n)),c=(h.length?h:i.filter(e=>'system'!==e.from)).slice(-5),d=e=>'system'===e.from?'CoverCharge':f(s.staff.find(t=>t.id===e.from)?.name??'Someone');return c.length?(h.length?h.length+' unread. ':'No unread messages. The latest: ')+c.map(e=>{return d(e)+' '+(((t=e.ch).startsWith('dm:')?'privately':'in '+(y[t]??t))+' at ')+l(e.at)+': '+e.text;var t}).join('. '):'No messages yet.'}},{id:'my_shift',apps:k,title:'My next shift or rota',risk:'look',description:'Your next published shift, or your shifts this week.',params:[],keywords:['shift','rota'],match:e=>p(e,/\b(my|next|when am i|am i (on|working|in)|when do i (start|work|finish))\b/)&&p(e,/\b(shifts?|rota|working|on|in|start|finish)\b/)&&!p(e,/\b(break|clock)/)?5:0,preview:()=>'Your shifts',run:(e,a)=>{const s=a.today,o=t.useOwner.getState().shifts.filter(e=>e.staffId===a.whoId&&e.published&&e.date>=s).sort((e,t)=>e.date.localeCompare(t.date)||e.start-t.start);if(!o.length)return'You have no published shifts coming up. Your manager publishes the rota in the app.';const n=h(),i=n.getHours()+n.getMinutes()/60,c=o.find(e=>e.date>s||e.end>i)??o[0],d=o.filter(e=>e!==c).slice(0,4);return'Your next shift: '+m(c.date,s)+', '+u(c.start)+' to '+u(c.end)+(c.note?' ('+c.note+')':'')+'.'+(d.length?' Then '+d.map(e=>m(e.date,s)+' '+u(e.start)+'\u2013'+u(e.end)).join(', ')+'.':'')}},{id:'clock_status',apps:k,title:'Am I clocked in?',risk:'look',description:'Whether you are clocked in, since when, and a reminder to clock in or out on the Clock tab.',params:[],keywords:['clock'],match:e=>p(e,/\b(clock(ed)?|clocking)\b/)?6:0,preview:()=>'Clock status',run:(e,a)=>{const s=t.useOwner.getState(),o=h(),n=(0,t.openShiftOf)(s.attendance,String(a.whoId),o),c=a.today,d=o.getHours()+o.getMinutes()/60,m=(0,i.workingShifts)(s.shifts,s.leave).find(e=>e.staffId===a.whoId&&e.published&&e.date===c);return n?'You\u2019re clocked in since '+l(n.in)+'.'+(m?' Your shift ends at '+u(m.end)+'.':'')+' Remember to clock out on the Clock tab when you finish.':m&&m.end>d?'You\u2019re not clocked in. Your shift today is '+u(m.start)+' to '+u(m.end)+'. Clock in on the Clock tab when you start.':'You\u2019re not clocked in.'+(m?'':' You have no shift today.')+' Use the Clock tab to clock in or out.'}},{id:'my_break',apps:k,title:'My break',risk:'look',description:'Whether you are on a break, and how long your breaks have been today.',params:[],keywords:['break'],match:e=>p(e,/\bbreaks?\b/)?6:0,preview:()=>'Your break',run:(e,a)=>{const s=t.useOwner.getState(),o=h(),n=(0,t.openShiftOf)(s.attendance,String(a.whoId),o);if(!n)return'You\u2019re not clocked in, so there\u2019s no break to show. Breaks are started and ended on the Clock tab.';const i=(0,t.loggedBreakMins)(n,o);if((0,t.isOnBreak)(n)){const e=n.breaks.find(e=>!e.end);return'You\u2019re on a break since '+l(e.start)+'. Breaks today: '+i+' minutes. Tap End break on the Clock tab when you\u2019re back.'}return i?'You\u2019ve had '+i+' minutes of break today. Start a break on the Clock tab.':'No break taken yet today. Start one on the Clock tab.'}},{id:'todays_specials',apps:k,title:'Today\u2019s specials',risk:'look',description:'Read out today\u2019s specials board.',params:[],keywords:['specials'],match:e=>p(e,/\bspecials?\b/)&&!p(e,/\b(draft|add|new|make)\b/)?6:0,preview:()=>'Today\u2019s specials',run:(e,t)=>{const o=a.useSpecials.getState().current[t.rid]?.items??[];return o.length?'Today\u2019s specials: '+o.map(e=>e.name+(null!=e.price?', '+(0,s.gbp)(e.price):'')).join('; ')+'.':'There are no specials on the board today.'}},{id:'sold_out_list',apps:k,title:'What\u2019s sold out',risk:'look',description:'List dishes that are sold out right now.',params:[],keywords:['sold out','86'],match:e=>p(e,/\b(sold out|86(ed)?|run out|off the menu|unavailable)\b/)?6:0,preview:()=>'What\u2019s sold out',run:(e,t)=>{const a=(0,o.dishesFor)(t.rid).filter(e=>e.soldOut).map(e=>e.name);return a.length?'Sold out: '+a.join(', ')+'.':'Nothing is sold out right now.'}}],C=new Set(['log_check','allergen_info','next_table_free',...x.filter(e=>e.apps?.includes('staff')).map(e=>e.id)])},1483,[816,876,956,851,1477,1015,1069]); __d(function(g,r,i,_a,_m2,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"NUM_WORDS",{enumerable:!0,get:function(){return s}}),e.numberOf=l,e.normaliseHeard=function(t){let n=` ${t.replace(/[\u2019\u2018]/g,"'").replace(/\s+/g,' ').trim()} `;n=n.replace(/\bwalk[\s-]?ins?\b/gi,'walk-in').replace(/\bwalking\b(?=\s+(?:of|for|in|on|at|party|\d|one|two|three|four|five|six|seven|eight|nine|ten|to|too)\b)/gi,'walk-in').replace(/\bseat(?:er|ed|a)?\s+(?:a\s+|at\s+|the\s+)?walk-in\b/gi,'seat a walk-in').replace(/\bsit\s+(?:a\s+)?walk-in\b/gi,'seat a walk-in').replace(/\b(?:quitter|quieter|pew ta|puta|put the|push a)\s+walk-in\b/gi,'put a walk-in').replace(/^(\s*)(?:lock|clock)\s+table\b/i,'$1block table').replace(/^(\s*)(?:[Ss]id|[Ss]it|[Ss]eed|[Ss]ee)\s+(?=[A-Z][a-z]+\b.*\b(?:waitlist|wait list|waiting list)\b)/,'$1seat ').replace(/\b(table \S+ (?:needs|is needing|wants)) cleaning\b/gi,'$1 clearing').replace(/^(\s*)have many\b/i,'$1how many').replace(/^(\s*)(?:meet|need|reed|weed) the (orders|shift notes|messages|specials)\b/i,'$1read the $2'),n=n.replace(new RegExp(`\\btable(\\s+(?:number\\s+)?)(${a})\\b(?!\\s+(?:${b})\\b)`,'gi'),(t,n,s)=>`table${n}${p(s)}`).replace(new RegExp("\\btable(\\s+(?:number\\s+)?)(for|fore)\\b(?=\\s*(?:$|[.,!?]|\\b(?:please|now|is|has|needs|wants|on|at)\\b))",'gi'),(t,n,s)=>`table${n}${p(s)}`).replace(new RegExp(`\\btable(\\s+(?:number\\s+)?)((?:twenty|thirty)[ -](?:one|two|three|four|five|six|seven|eight|nine)|${s})\\b`,'gi'),(t,n,s)=>`table${n}${p(s)}`).replace(new RegExp(`\\b(walk-in(?:\\s+party)?\\s+(?:of|for)|party of|table for|of|for)\\s+(${o})\\b${w}`,'gi'),(t,n,s)=>`${n} ${p(s)}`).replace(new RegExp(`\\bwalk-in\\s+(${s}|\\d{1,2})\\b${w}`,'gi'),(t,n)=>`walk-in of ${p(n)}`).replace(new RegExp(`\\bwalk-in\\s+(${o})\\b(?=\\s*(?:$|[.,!?]|\\b(?:on|at|people|covers|guests|please|now)\\b))`,'gi'),(t,n)=>`walk-in of ${p(n)}`).replace(new RegExp(`\\b(${o})\\s+(covers|people|guests|adults)\\b`,'gi'),(t,n,s)=>`${p(n)} ${s}`);const c=n.match(new RegExp(`^\\s*(?:(?:put|seat|sit)\\s+)?(?:a\\s+)?(${b})\\s+(?:on|at|to|onto)\\s+table\\s+(\\w+)[.,!?]?(?:\\s+(?:please|now|thanks))?\\s*[.!?]?\\s*$`,'i'));c&&l(c[1])&&l(c[1])<=30&&(n=` seat a walk-in of ${p(c[1])} at table ${p(c[2])} `);return n.replace(/\s+/g,' ').trim()},e.walkInCovers=function(t){const n=` ${t.toLowerCase()} `,a=`(\\d{1,2}|${s})`,o=n.match(new RegExp(`\\bwalk-in(?:\\s+party)?\\s+(?:of|for)\\s+${a}\\b`))??n.match(new RegExp(`\\bwalk-in\\s+(?:at|a|of a|for a)\\s+${a}\\s+(?:at|on)\\s+table\\b`))??n.match(new RegExp(`\\b${a}\\s+walk-in`))??n.match(new RegExp(`\\b(?:party of|table for|for|of)\\s+${a}\\b(?!\\s*(?:am|pm|[:.]\\d|o.?clock))`))??n.match(new RegExp(`\\b${a}\\s*(?:covers|people|guests|adults|pax|persons|of us)\\b`)),b=l(o?.[1],!1);return b&&b>=1&&b<=30?b:void 0},e.tableSaid=function(t){const n=[...` ${t.toLowerCase()} `.matchAll(/\btable\s+(?:number\s+)?([a-z]?\d{1,3}[a-z]?)\b/g)];return n.length?n[n.length-1][1].toUpperCase():void 0},e.coversAnswer=function(t){const n=t.toLowerCase().replace(/[.,!?]/g,' '),a=n.match(new RegExp(`\\b(\\d{1,2}|${s})\\b`))??n.match(new RegExp(`^\\s*(?:just\\s+)?(${o})\\s*(?:people|of us|please)?\\s*$`)),b=l(a?.[1]);return b&&b>=1&&b<=30?b:void 0};const t={one:1,two:2,three:3,four:4,five:5,six:6,seven:7,eight:8,nine:9,ten:10,eleven:11,twelve:12,thirteen:13,fourteen:14,fifteen:15,sixteen:16,seventeen:17,eighteen:18,nineteen:19,twenty:20,thirty:30},n={to:2,too:2,tu:2,for:4,fore:4,ate:8,won:1,tree:3,free:3,sax:6,sex:6,fiver:5,nein:9,tin:10},s=Object.keys(t).join('|'),a='to|too|tu|ate|won|tree|free|sax|sex|fiver|nein|tin',o='to|too|tu|for|fore|ate|won',b=`\\d{1,2}|(?:twenty|thirty)[ -](?:one|two|three|four|five|six|seven|eight|nine)|${s}|${o}`;function l(s,a=!0){if(!s)return;const o=s.toLowerCase().trim().replace(/-/g,' ');if(/^\d+$/.test(o))return Number(o);const b=o.match(/^(twenty|thirty) (one|two|three|four|five|six|seven|eight|nine)$/);return b?t[b[1]]+t[b[2]]:t[o]??(a?n[o]:void 0)}const p=t=>String(l(t)??t),w='(?=\\s*(?:$|[.,!?]|\\bon\\b|\\bat\\b|\\bin\\b|\\bto\\b|\\btable\\b|\\bplease\\b|\\bnow\\b|\\bpeople\\b|\\bcovers?\\b|\\bguests?\\b))'},1484,[]); diff --git a/display-app/admin.html b/display-app/admin.html index 48ef07d3f9212dea8c3e21a620790317a5f08647..41bac86d5511322c4951492c50f3d3d393a18683 100644 --- a/display-app/admin.html +++ b/display-app/admin.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/display-app/customer.html b/display-app/customer.html index 48ef07d3f9212dea8c3e21a620790317a5f08647..41bac86d5511322c4951492c50f3d3d393a18683 100644 --- a/display-app/customer.html +++ b/display-app/customer.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/display-app/customer/anchorage.html b/display-app/customer/anchorage.html index 48ef07d3f9212dea8c3e21a620790317a5f08647..41bac86d5511322c4951492c50f3d3d393a18683 100644 --- a/display-app/customer/anchorage.html +++ b/display-app/customer/anchorage.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/display-app/customer/anchorage/book.html b/display-app/customer/anchorage/book.html index 48ef07d3f9212dea8c3e21a620790317a5f08647..41bac86d5511322c4951492c50f3d3d393a18683 100644 --- a/display-app/customer/anchorage/book.html +++ b/display-app/customer/anchorage/book.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/display-app/customer/anchorage/feedback.html b/display-app/customer/anchorage/feedback.html index 48ef07d3f9212dea8c3e21a620790317a5f08647..41bac86d5511322c4951492c50f3d3d393a18683 100644 --- a/display-app/customer/anchorage/feedback.html +++ b/display-app/customer/anchorage/feedback.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/display-app/customer/anchorage/gift.html b/display-app/customer/anchorage/gift.html index 48ef07d3f9212dea8c3e21a620790317a5f08647..41bac86d5511322c4951492c50f3d3d393a18683 100644 --- a/display-app/customer/anchorage/gift.html +++ b/display-app/customer/anchorage/gift.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/display-app/customer/anchorage/lost.html b/display-app/customer/anchorage/lost.html index 48ef07d3f9212dea8c3e21a620790317a5f08647..41bac86d5511322c4951492c50f3d3d393a18683 100644 --- a/display-app/customer/anchorage/lost.html +++ b/display-app/customer/anchorage/lost.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/display-app/customer/anchorage/loyalty.html b/display-app/customer/anchorage/loyalty.html index 48ef07d3f9212dea8c3e21a620790317a5f08647..41bac86d5511322c4951492c50f3d3d393a18683 100644 --- a/display-app/customer/anchorage/loyalty.html +++ b/display-app/customer/anchorage/loyalty.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/display-app/customer/anchorage/merch.html b/display-app/customer/anchorage/merch.html index 48ef07d3f9212dea8c3e21a620790317a5f08647..41bac86d5511322c4951492c50f3d3d393a18683 100644 --- a/display-app/customer/anchorage/merch.html +++ b/display-app/customer/anchorage/merch.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/display-app/customer/anchorage/offers.html b/display-app/customer/anchorage/offers.html index 48ef07d3f9212dea8c3e21a620790317a5f08647..41bac86d5511322c4951492c50f3d3d393a18683 100644 --- a/display-app/customer/anchorage/offers.html +++ b/display-app/customer/anchorage/offers.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/display-app/customer/anchorage/refer.html b/display-app/customer/anchorage/refer.html index 48ef07d3f9212dea8c3e21a620790317a5f08647..41bac86d5511322c4951492c50f3d3d393a18683 100644 --- a/display-app/customer/anchorage/refer.html +++ b/display-app/customer/anchorage/refer.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/display-app/customer/anchorage/waitlist.html b/display-app/customer/anchorage/waitlist.html index 48ef07d3f9212dea8c3e21a620790317a5f08647..41bac86d5511322c4951492c50f3d3d393a18683 100644 --- a/display-app/customer/anchorage/waitlist.html +++ b/display-app/customer/anchorage/waitlist.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/display-app/customer/anchorage/whatson.html b/display-app/customer/anchorage/whatson.html index 48ef07d3f9212dea8c3e21a620790317a5f08647..41bac86d5511322c4951492c50f3d3d393a18683 100644 --- a/display-app/customer/anchorage/whatson.html +++ b/display-app/customer/anchorage/whatson.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/display-app/customer/basket.html b/display-app/customer/basket.html index 48ef07d3f9212dea8c3e21a620790317a5f08647..41bac86d5511322c4951492c50f3d3d393a18683 100644 --- a/display-app/customer/basket.html +++ b/display-app/customer/basket.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/display-app/customer/profile.html b/display-app/customer/profile.html index 48ef07d3f9212dea8c3e21a620790317a5f08647..41bac86d5511322c4951492c50f3d3d393a18683 100644 --- a/display-app/customer/profile.html +++ b/display-app/customer/profile.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/display-app/demo.html b/display-app/demo.html index 48ef07d3f9212dea8c3e21a620790317a5f08647..41bac86d5511322c4951492c50f3d3d393a18683 100644 --- a/display-app/demo.html +++ b/display-app/demo.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/display-app/display.html b/display-app/display.html index 48ef07d3f9212dea8c3e21a620790317a5f08647..41bac86d5511322c4951492c50f3d3d393a18683 100644 --- a/display-app/display.html +++ b/display-app/display.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/display-app/index.html b/display-app/index.html index 40fcc6509ba9311b4a351e3f401a07e8b59bc8a3..adb9fd43f17dc88924652ba545ac8bceeb4a87c5 100644 --- a/display-app/index.html +++ b/display-app/index.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/display-app/kitchen.html b/display-app/kitchen.html index 48ef07d3f9212dea8c3e21a620790317a5f08647..41bac86d5511322c4951492c50f3d3d393a18683 100644 --- a/display-app/kitchen.html +++ b/display-app/kitchen.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/display-app/owner.html b/display-app/owner.html index 48ef07d3f9212dea8c3e21a620790317a5f08647..41bac86d5511322c4951492c50f3d3d393a18683 100644 --- a/display-app/owner.html +++ b/display-app/owner.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/display-app/staff.html b/display-app/staff.html index 48ef07d3f9212dea8c3e21a620790317a5f08647..41bac86d5511322c4951492c50f3d3d393a18683 100644 --- a/display-app/staff.html +++ b/display-app/staff.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/display-app/sw.js b/display-app/sw.js index 017497f688112a664b6f524b3e8ae95fa5f2c71f..8c3fa9b186be36d47f7b3b77faa38f02f5a517a1 100644 --- a/display-app/sw.js +++ b/display-app/sw.js @@ -1,7 +1,7 @@ // Anchorage Display service worker: precache the app shell so it opens offline after the first visit. -const V = "cc-display-dbb4773d92"; +const V = "cc-display-3ca129429d"; const BASE = "/display-app/"; -const PRECACHE = ["/display-app/apple-touch-icon.png", "/display-app/assets/assets/brand/anchorage-hero.0450b828e4f9c1f4456240096598f6f5.png", "/display-app/assets/assets/brand/anchorage.fea5ce2f6fd18bf2950aa21c0980ed8e.png", "/display-app/assets/assets/recipes/fishsupper.1609c58319e1e8721f5c639049fb054e.jpg", "/display-app/assets/assets/recipes/lobster.2fb3485c8e372972099259017358c1b8.jpg", "/display-app/assets/assets/recipes/moules.a4f342fc7e7fb62c8a0b5c1678bbea3f.jpg", "/display-app/assets/assets/recipes/skink.4ce7b7c676f9cdcd0a060eda46f5a00e.jpg", "/display-app/assets/assets/recipes/stp.1061ced765efdcafff2554adc3fc7113.jpg", "/display-app/assets/assets/specials/sample-chalkboard.e7b4e4450a8483d4219bc6a214158d8f.jpg", "/display-app/assets/node_modules/@expo-google-fonts/poppins/400Regular/Poppins_400Regular.093ee89be9ede30383f39a899c485a82.ttf", "/display-app/assets/node_modules/@expo-google-fonts/poppins/500Medium/Poppins_500Medium.bf59c687bc6d3a70204d3944082c5cc0.ttf", "/display-app/assets/node_modules/@expo-google-fonts/poppins/600SemiBold/Poppins_600SemiBold.6f1520d107205975713ba09df778f93f.ttf", "/display-app/assets/node_modules/@expo-google-fonts/poppins/700Bold/Poppins_700Bold.08c20a487911694291bd8c5de41315ad.ttf", "/display-app/assets/node_modules/expo-router/assets/arrow_down.017bc6ba3fc25503e5eb5e53826d48a8.png", "/display-app/assets/node_modules/expo-router/assets/error.d1ea1496f9057eb392d5bbf3732a61b7.png", "/display-app/assets/node_modules/expo-router/assets/file.19eeb73b9593a38f8e9f418337fc7d10.png", "/display-app/assets/node_modules/expo-router/assets/forward.d8b800c443b8972542883e0b9de2bdc6.png", "/display-app/assets/node_modules/expo-router/assets/pkg.ab19f4cbc543357183a20571f68380a3.png", "/display-app/assets/node_modules/expo-router/assets/react-navigation/elements/back-icon-mask.0a328cd9c1afd0afe8e3b1ec5165b1b4.png", "/display-app/assets/node_modules/expo-router/assets/react-navigation/elements/back-icon.35ba0eaec5a4f5ed12ca16fabeae451d.png", "/display-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55.png", "/display-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@2x.png", "/display-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@3x.png", "/display-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@4x.png", "/display-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7.png", "/display-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@2x.png", "/display-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@3x.png", "/display-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@4x.png", "/display-app/assets/node_modules/expo-router/assets/react-navigation/elements/search-icon.286d67d3f74808a60a78d3ebf1a5fb57.png", "/display-app/assets/node_modules/expo-router/assets/sitemap.412dd9275b6b48ad28f5e3d81bb1f626.png", "/display-app/assets/node_modules/expo-router/assets/unmatched.20e71bdf79e3a97bf55fd9e164041578.png", "/display-app/brand-logo.png", "/display-app/favicon.ico", "/display-app/icon-192.png", "/display-app/icon-512.png", "/display-app/icon-maskable-192.png", "/display-app/icon-maskable-512.png", "/display-app/manifest.webmanifest", "/display-app/index.html", "/display-app/_expo/static/js/web/bundle.js?v=dbb4773d92e2421e1ac79bb8e57d252c956b22c3e09653bf2cf16c27e674a983"]; +const PRECACHE = ["/display-app/apple-touch-icon.png", "/display-app/assets/assets/brand/anchorage-hero.0450b828e4f9c1f4456240096598f6f5.png", "/display-app/assets/assets/brand/anchorage.fea5ce2f6fd18bf2950aa21c0980ed8e.png", "/display-app/assets/assets/recipes/fishsupper.1609c58319e1e8721f5c639049fb054e.jpg", "/display-app/assets/assets/recipes/lobster.2fb3485c8e372972099259017358c1b8.jpg", "/display-app/assets/assets/recipes/moules.a4f342fc7e7fb62c8a0b5c1678bbea3f.jpg", "/display-app/assets/assets/recipes/skink.4ce7b7c676f9cdcd0a060eda46f5a00e.jpg", "/display-app/assets/assets/recipes/stp.1061ced765efdcafff2554adc3fc7113.jpg", "/display-app/assets/assets/specials/sample-chalkboard.e7b4e4450a8483d4219bc6a214158d8f.jpg", "/display-app/assets/node_modules/@expo-google-fonts/poppins/400Regular/Poppins_400Regular.093ee89be9ede30383f39a899c485a82.ttf", "/display-app/assets/node_modules/@expo-google-fonts/poppins/500Medium/Poppins_500Medium.bf59c687bc6d3a70204d3944082c5cc0.ttf", "/display-app/assets/node_modules/@expo-google-fonts/poppins/600SemiBold/Poppins_600SemiBold.6f1520d107205975713ba09df778f93f.ttf", "/display-app/assets/node_modules/@expo-google-fonts/poppins/700Bold/Poppins_700Bold.08c20a487911694291bd8c5de41315ad.ttf", "/display-app/assets/node_modules/expo-router/assets/arrow_down.017bc6ba3fc25503e5eb5e53826d48a8.png", "/display-app/assets/node_modules/expo-router/assets/error.d1ea1496f9057eb392d5bbf3732a61b7.png", "/display-app/assets/node_modules/expo-router/assets/file.19eeb73b9593a38f8e9f418337fc7d10.png", "/display-app/assets/node_modules/expo-router/assets/forward.d8b800c443b8972542883e0b9de2bdc6.png", "/display-app/assets/node_modules/expo-router/assets/pkg.ab19f4cbc543357183a20571f68380a3.png", "/display-app/assets/node_modules/expo-router/assets/react-navigation/elements/back-icon-mask.0a328cd9c1afd0afe8e3b1ec5165b1b4.png", "/display-app/assets/node_modules/expo-router/assets/react-navigation/elements/back-icon.35ba0eaec5a4f5ed12ca16fabeae451d.png", "/display-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55.png", "/display-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@2x.png", "/display-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@3x.png", "/display-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@4x.png", "/display-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7.png", "/display-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@2x.png", "/display-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@3x.png", "/display-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@4x.png", "/display-app/assets/node_modules/expo-router/assets/react-navigation/elements/search-icon.286d67d3f74808a60a78d3ebf1a5fb57.png", "/display-app/assets/node_modules/expo-router/assets/sitemap.412dd9275b6b48ad28f5e3d81bb1f626.png", "/display-app/assets/node_modules/expo-router/assets/unmatched.20e71bdf79e3a97bf55fd9e164041578.png", "/display-app/brand-logo.png", "/display-app/favicon.ico", "/display-app/icon-192.png", "/display-app/icon-512.png", "/display-app/icon-maskable-192.png", "/display-app/icon-maskable-512.png", "/display-app/manifest.webmanifest", "/display-app/index.html", "/display-app/_expo/static/js/web/bundle.js?v=3ca129429d945d0c4e0c8d43e91e9b0ebe9dfecfc75d603a85553ce90171f02f"]; // Hugging Face serves large files (fonts) through a redirect to its CDN. Browsers refuse to hand a *redirected* cached // response to a page, so store a plain copy instead (otherwise fonts, and so the app, fail to load offline). const plain = r => r.redirected ? r.blob().then(b => new Response(b, { status: 200, headers: { 'Content-Type': r.headers.get('Content-Type') || b.type || 'application/octet-stream' } })) : Promise.resolve(r); diff --git a/display-app/team.html b/display-app/team.html index 48ef07d3f9212dea8c3e21a620790317a5f08647..41bac86d5511322c4951492c50f3d3d393a18683 100644 --- a/display-app/team.html +++ b/display-app/team.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/index.html b/index.html index 9721dc81440704ae0bb82002bc488e0ff67bb936..541bbcc96569865c664da1e3e7eb48492a3539a9 100644 --- a/index.html +++ b/index.html @@ -3,7 +3,7 @@ -Cover Charge: try the apps (v0.3.12.192) +Cover Charge: try the apps (v0.3.12.193) @@ -63,7 +63,7 @@ footer{margin-top:28px;color:var(--muted);font-size:.8rem;text-align:center} Cover Charge logo

covercharge

All in one restaurant booking app

-

Cover Charge: try the apps (v0.3.12.192)

+

Cover Charge: try the apps (v0.3.12.193)

The Anchorage, Harbour View, Dunure

@@ -129,7 +129,7 @@ footer{margin-top:28px;color:var(--muted);font-size:.8rem;text-align:center}
-

Cover Charge v0.3.12.192

+

Cover Charge v0.3.12.193

diff --git a/owner-app/_expo/static/js/web/bundle.js b/owner-app/_expo/static/js/web/bundle.js index 07c1ddf226a4d6329cd608ca3bf1cbc112c4cf7c..19250865376496903bfc31a156c5b6a2db67f969 100644 --- a/owner-app/_expo/static/js/web/bundle.js +++ b/owner-app/_expo/static/js/web/bundle.js @@ -921,7 +921,7 @@ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{v __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"ANCHORAGE_PAY",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"ANCHORAGE_KITCHEN",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"ANCHORAGE_KITCHEN_OLD",{enumerable:!0,get:function(){return u}}),Object.defineProperty(e,"restaurants",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"demoMenus",{enumerable:!0,get:function(){return l}});var t=r(d[0]);const n={slotMinutes:15,slotCap:3,bufferMins:5,leadMins:20,takeawayPaused:!1,bookingCoversPerSlot:20,bookingSlotMinutes:15,deposit:{...r(d[1]).DEPOSIT_DEFAULT},stampTarget:8,stampReward:'Free dessert',stampMinSpend:1e3,capacityPerHour:48,walkInShare:.35,turnMins:75,orderAtTable:!0},o={tipsFrequency:'fortnightly',tipsAnchorPayday:'2026-11-02',tipsEndsDaysBefore:1,wagePayDay:28,wageCutoffDay:23,weekendRule:'none'},s={0:['12:30','19:00'],1:null,2:null,3:['12:00','19:00'],4:['12:00','19:00'],5:['12:00','20:00'],6:['12:00','20:00']},u={0:['12:30','20:00'],1:null,2:null,3:['12:00','19:00'],4:['12:00','19:00'],5:['12:00','20:30'],6:['12:00','20:30']},c=[{id:'anchorage',name:'The Anchorage',tagline:'Harbourside seafood & Scottish produce',location:'Harbour View, Dunure, South Ayrshire',fictional:!1,phone:'01292 502826',website:'anchoragedunure.com',kitchenHours:s,hoursNote:'Kitchen (food) hours from Gordon, 30 Oct 2026: closed Mon\u2013Tue. The closing time is last food orders. Bar hours not set.',settings:{...n,orderAtTable:!1,pay:o,cashUpRecord:[...t.ANCHORAGE_CASH_UP],bookingCoversPerStart:15,bookingPartiesPerStart:4,onlinePartyMin:1,onlinePartyMax:8,bookingNoticeMins:15,autoAcceptUpTo:8},sections:[]}],l=[]},838,[839,841]); __d(function(g,_r,_i,_a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"TAKINGS_FIELDS",{enumerable:!0,get:function(){return t}}),Object.defineProperty(_e,"NO_SERVICE_SPLIT",{enumerable:!0,get:function(){return n}}),Object.defineProperty(_e,"TAKINGS_KEYS",{enumerable:!0,get:function(){return r}}),_e.withTakingsFields=function(e){e=e.filter(e=>!n.includes(e.key));const r=new Set(e.map(e=>e.key)),o=t.filter(e=>!r.has(e.key)).map(e=>({...e}));if(!o.length)return e;const a=e.findIndex(e=>'cash'===e.key),i=a<0?e.length:a+1;return[...e.slice(0,i),...o,...e.slice(i)]},Object.defineProperty(_e,"grossOf",{enumerable:!0,get:function(){return o}}),Object.defineProperty(_e,"ANCHORAGE_CASH_UP",{enumerable:!0,get:function(){return a}}),_e.cashFieldsForRecord=function(e,t){if(!t?.length)return e;const n=new Set,r=[];for(const o of t){const t=i[o],a=t?.key??`cu-${o.toLowerCase().replace(/[^a-z0-9]+/g,'-').replace(/^-|-$/g,'')||'figure'}`,l=e.find(e=>e.key===a);r.push({...l,...t??{kind:'money'},key:a,label:o}),n.add(a)}return[...r,...e.filter(e=>!n.has(e.key))]},Object.defineProperty(_e,"DEFAULT_CASHUP_FIELDS",{enumerable:!0,get:function(){return l}}),Object.defineProperty(_e,"DEFAULT_SALES_FIELDS",{enumerable:!0,get:function(){return u}}),_e.parseAmount=function(t,n="money"){if('number'===n){const e=t.replace(/[\xa3\s]/g,'');return/^\d{1,6}$/.test(e)?Number(e):null}return(0,e.parseMoneyInput)(t)},Object.defineProperty(_e,"isBlank",{enumerable:!0,get:function(){return s}}),Object.defineProperty(_e,"ymdUTC",{enumerable:!0,get:function(){return c}}),Object.defineProperty(_e,"addDaysYmd",{enumerable:!0,get:function(){return y}}),_e.weekStartOf=function(e){const t=(d(e).getUTCDay()+6)%7;return y(e,-t)},_e.combinedTips=function(e){const t='number'==typeof e.cashTips?e.cashTips:null,n='number'==typeof e.cardTips?e.cardTips:null;return null==t&&null==n?null:Math.round(100*((t??0)+(n??0)))/100},Object.defineProperty(_e,"takings",{enumerable:!0,get:function(){return f}}),Object.defineProperty(_e,"missing",{enumerable:!0,get:function(){return m}}),_e.dailySeries=function(e,t,n,r=f){const o=new Map(e.filter(e=>e.confirmedAt).map(e=>[e.date,e]));return Array.from({length:n},(e,a)=>{const i=y(t,a-n+1),l=o.get(i);return{date:i,value:l?r(l.vals):null}})},_e.weekCompare=function(e,t,n="net"){const r=t=>{const r=e.find(e=>e.weekStart===t&&e.confirmedAt),o=r?.vals[n];return'number'==typeof o?o:null},o=r(t),a=r(y(t,-7)),i=null!=o&&null!=a&&0!==a?Math.round((o-a)/a*1e3)/10:null;return{now:o,prev:a,change:i}},_e.tipsPot=function(e,t,n,r){const o=t.filter(e=>'payout'===e.kind&&e.throughDate).sort((e,t)=>e.at.localeCompare(t.at)),a=o[o.length-1],i=a?y(a.throughDate,1):n,l=e.filter(e=>e.date>=i&&e.date<=r).sort((e,t)=>e.date.localeCompare(t.date)),u=t.filter(e=>'correction'===e.kind&&e.forDate&&e.forDate>=i&&e.forDate<=r&&(!a||e.at>a.at)),s=Math.round(100*(l.reduce((e,t)=>e+t.total,0)+u.reduce((e,t)=>e+t.amount,0)))/100;return{from:i,total:Math.max(0,s),days:l,corrections:u,lastPayout:a??null,history:o.slice().reverse()}},_e.shareByHours=function(e,t,n){return e>0&&t>0&&n>0?Math.round(e*(t/n)*100)/100:0},_e.cashLocked=function(e,t=Date.now()){return!(!e.onServer||!e.confirmedAt)&&!(e.unlockedUntil&&Date.parse(e.unlockedUntil)>t)},_e.changedFields=function(e,t){const n=e??{},r=t??{},o=[],a=n.vals??{},i=r.vals??{};for(const e of new Set([...Object.keys(a),...Object.keys(i)]))JSON.stringify(a[e])!==JSON.stringify(i[e])&&o.push(e);JSON.stringify(n.categories??null)!==JSON.stringify(r.categories??null)&&(n.categories||r.categories)&&o.push('categories');JSON.stringify(n.photos??[])!==JSON.stringify(r.photos??[])&&e&&t&&o.push('photos');return o},Object.defineProperty(_e,"dayTakingsOf",{enumerable:!0,get:function(){return p}}),Object.defineProperty(_e,"daysInMonth",{enumerable:!0,get:function(){return k}}),_e.addMonths=b,Object.defineProperty(_e,"monthName",{enumerable:!0,get:function(){return O}}),Object.defineProperty(_e,"shortDay",{enumerable:!0,get:function(){return C}}),Object.defineProperty(_e,"longDay",{enumerable:!0,get:function(){return D}}),_e.poundsWhole=function(e){const t=e<0,n=String(Math.round(Math.abs(e))).replace(/\B(?=(\d{3})+(?!\d))/g,',');return`${t?'-':''}\xa3${n}`},_e.monthTakings=function(e,t,n,r){const o=new Map;for(const n of e){if(n.rid!==t)continue;const e=p(n);null!=e&&o.set(n.date,e)}const a=Number(n.slice(0,4)),i=Number(n.slice(5,7)),l=k(a,i),u=Array.from({length:l},(e,t)=>{const a=`${n}-${String(t+1).padStart(2,'0')}`,i=o.get(a),l=null!=i&&a<=r?'recorded':a>r?'future':a===r?'pending':'missing';return{date:a,day:t+1,value:'recorded'===l?i:null,state:l}}),s=u.filter(e=>'recorded'===e.state),c=Math.round(100*s.reduce((e,t)=>e+(t.value??0),0))/100,d=s.reduce((e,t)=>!e||t.value>e.value?{date:t.date,value:t.value}:e,null),y=r.slice(0,7)===n,f=n0?Math.round((c-T)/T*100):null;return{ym:n,month:O(n),days:u,total:c,recorded:s.length,current:y,past:f,best:d,vsPct:D}},Object.defineProperty(_e,"firstTakingsMonth",{enumerable:!0,get:function(){return P}}),_e.canSeeMonthTakings=function(e,t,n={}){return!n.inStaffApp&&'owner'===e&&(t?'owner'===t.role||!0===t.ownerAccess:!n.live)},_e.ownerHomeLayout=function(e,t,n=!1){return!n&&'owner'===e&&(!t||'owner'===t.role||!0===t.ownerAccess)};var e=_r(_d[0]);const t=[{key:'gross',label:'Gross takings',kind:'money',fixed:!0,optional:!0},{key:'food',label:'Food takings (optional)',kind:'money',fixed:!0,optional:!0},{key:'drink',label:'Drink takings (optional)',kind:'money',fixed:!0,optional:!0}],n=['lunchGross','dinnerGross'],r=t.map(e=>e.key);const o=e=>'number'==typeof e.gross?e.gross:null,a=['Z total','Card total','Cash total','Paid out','Card tips','Cash tips'],i={'Z total':{key:'zTotal',kind:'money'},'Card total':{key:'card',kind:'money'},'Cash total':{key:'cash',kind:'money'},'Paid out':{key:'paidOut',kind:'money',optional:!0},'Card tips':{key:'cardTips',kind:'money',fixed:!0},'Cash tips':{key:'cashTips',kind:'money',fixed:!0}};const l=[{key:'card',label:'Card takings',kind:'money'},{key:'cash',label:'Cash takings',kind:'money'},{key:'paidOut',label:'Paid out',kind:'money',fixed:!0,optional:!0},...t,{key:'float',label:'Float (tills)',kind:'money'},{key:'cashTips',label:'Cash tips total',kind:'money',fixed:!0},{key:'cardTips',label:'Card tips total',kind:'money',fixed:!0},{key:'overUnder',label:'Over / under (discrepancy)',kind:'money'},{key:'notes',label:'Notes',kind:'text'}],u=[{key:'gross',label:'Gross sales',kind:'money'},{key:'net',label:'Net sales',kind:'money',fixed:!0},{key:'vat',label:'VAT',kind:'money'},{key:'covers',label:'Covers',kind:'number'},{key:'discounts',label:'Discounts',kind:'money'},{key:'refunds',label:'Refunds',kind:'money'}];const s=e=>null==e||''===e,c=e=>e.toISOString().slice(0,10),d=e=>new Date(`${e}T12:00:00Z`),y=(e,t)=>{const n=d(e);return n.setUTCDate(n.getUTCDate()+t),c(n)};const f=e=>{const t='number'==typeof e.card?e.card:null,n='number'==typeof e.cash?e.cash:null;return null==t&&null==n?null:(t??0)+(n??0)},m=(e,t)=>e.filter(e=>'text'!==e.kind&&!e.optional&&s(t[e.key])).map(e=>e.key);const p=e=>e.confirmedAt?o(e.vals)??f(e.vals):null,k=(e,t)=>new Date(Date.UTC(e,t,0)).getUTCDate();function b(e,t){const n=Number(e.slice(0,4)),r=Number(e.slice(5,7))-1+t;return`${n+Math.floor(r/12)}-${String((r%12+12)%12+1).padStart(2,'0')}`}const h=['January','February','March','April','May','June','July','August','September','October','November','December'],S=['Sun','Mon','Tue','Wed','Thu','Fri','Sat'],T=['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'],O=e=>h[Number(e.slice(5,7))-1]??'',C=e=>{const t=d(e);return`${S[t.getUTCDay()]} ${t.getUTCDate()} ${h[t.getUTCMonth()].slice(0,3)}`},D=e=>{const t=d(e);return`${T[t.getUTCDay()]} ${t.getUTCDate()} ${h[t.getUTCMonth()]}`};const P=(e,t)=>e.filter(e=>e.rid===t&&null!=p(e)).map(e=>e.date.slice(0,7)).sort()[0]??null},839,[840]); __d(function(g,r,_i,_a,m,e,d){"use strict";function t(t,n){const i=!(!n?.allowMinus||!String(t??'').trim().startsWith('-'));let s=String(t??'').replace(/,/g,'.');s=s.replace(/[^\d.]/g,'');const l=s.indexOf('.');if(l>=0){s=s.slice(0,l+1)+s.slice(l+1).replace(/\./g,'');const[t,n=""]=s.split('.');s=t+'.'+n.slice(0,2)}return(i?'-':'')+s}Object.defineProperty(e,'__esModule',{value:!0}),e.sanitiseMoneyTyping=t,e.parseMoneyInput=function(n){const i=String(n??''),s=i.trim().startsWith('-'),l=i.trim().replace(/^\xa3/,'').replace(/\xa3/g,'').replace(/\s/g,'').replace(/^-/,'');if(l&&/[^\d.,]/.test(l))return null;const c=t(n);if(!c||'.'===c)return null;if(!/^\d+(\.\d{0,2})?$/.test(c))return null;const u=Math.round(100*Number(c))/100;return Number.isFinite(u)?s?-u:u:null},Object.defineProperty(e,"onMoneyChange",{enumerable:!0,get:function(){return n}});const n=n=>i=>n(t(i))},840,[]); -__d(function(g,r,i,a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"DEPOSIT_DEFAULT",{enumerable:!0,get:function(){return e}}),_e.depositOf=function(t){const n=t?.deposit;return n&&'object'==typeof n?{on:n.on??e.on,...!0===n.needsConfirmation?{needsConfirmation:!0}:{},perPersonPence:Number.isFinite(n.perPersonPence)?Math.max(0,Math.round(n.perPersonPence)):n.needsConfirmation?0:e.perPersonPence,fromParty:Number.isFinite(n.fromParty)?Math.max(1,Math.round(n.fromParty)):n.needsConfirmation?1:e.fromParty,refundable:'boolean'==typeof n.refundable?n.refundable:null,cutoffHours:Number.isFinite(n.cutoffHours)?Math.max(0,Math.round(n.cutoffHours)):null,policy:'string'==typeof n.policy?n.policy.slice(0,600):'',wixLinksOn:!0===n.wixLinksOn,wixLinkHours:Number.isFinite(n.wixLinkHours)?Math.max(1,Math.min(168,Math.round(n.wixLinkHours))):48}:{...e}},_e.childrenIn=t,Object.defineProperty(_e,"adultsIn",{enumerable:!0,get:function(){return n}}),_e.depositDue=o,_e.depositWords=function(e,d,u,p=0){if(e.needsConfirmation&&!e.on)return[e.policy.trim()||'Deposit policy awaiting venue confirmation.'];if(e.needsConfirmation)return['Table deposit policy not set yet. Ticketed event deposits are separate and are not a table policy.'];const l=o(e,d,p);if(!l)return[];const c=[t(d,p)?`A deposit of ${s(l)} (${s(e.perPersonPence)} for each of the ${n(d,p)} adults; children are free) is needed for ${e.fromParty} or more guests.`:`A deposit of ${s(l)} (${s(e.perPersonPence)} per adult; children are free) is needed for ${e.fromParty} or more guests.`];!0===e.refundable?c.push(e.cutoffHours?`Refundable if you cancel at least ${e.cutoffHours} hours before your booking.`:'Refundable if you cancel.'):!1===e.refundable?c.push('The deposit is not refundable.'):c.push(`Ask ${u} about refunds.`);e.policy.trim()&&c.push(e.policy.trim());return c.push(e.wixLinksOn?`${u} will send you a link to pay the deposit securely through website bookings.`:`No payment is taken in the app yet: ${u} will tell you how to pay the deposit.`),c},_e.waiverOf=d,_e.depositState=u,_e.waiverText=p,_e.canWaiveDeposit=function(e){if(['cancelled','finished','noshow','declined'].includes(e.status??''))return!1;const t=l(e);return'PAID'!==t&&'FULLY_REFUNDED'!==t&&'PARTIALLY_REFUNDED'!==t&&'FREE'!==t&&('paid'!==e.depositLink?.state&&('NOT_PAID'===t||'PARTIALLY_PAID'===t?!d(e):'due'===u(e)))},_e.wixPayStatus=l,_e.knownPaid=c,_e.fromWixOrder=f,_e.estimatedWix=b,_e.depositBadge=m,_e.canTickDeposit=function(e){if(d(e))return!1;const t=l(e);return'NOT_PAID'!==t&&'PAID'!==t&&'FULLY_REFUNDED'!==t&&'PARTIALLY_REFUNDED'!==t&&('paid'!==e.depositLink?.state&&'due'===u(e))},_e.canSendDepositLink=function(e,t){return!(!t.wixLinksOn||l(e)||d(e))&&(!e.walkIn&&!['cancelled','finished','noshow','declined'].includes(e.status??'')&&('due'===u(e)&&'paid'!==e.depositLink?.state))},_e.depositTerms=function(e){const t=[];!0===e.refundable?t.push(e.cutoffHours?`The deposit is refundable if you cancel at least ${e.cutoffHours} hours before.`:'The deposit is refundable if you cancel.'):!1===e.refundable&&t.push('The deposit is not refundable.');e.policy.trim()&&t.push(e.policy.trim());return t.join(' ')},_e.depositLinkMessage=function(e){const t=(e.name||'').trim().split(/\s+/)[0]||'there',[n,o,d]=e.date.split('-').map(Number),u=new Date(n,(o||1)-1,d||1).toLocaleDateString('en-GB',{weekday:'long',day:'numeric',month:'long'}),p=e.expiresAt?new Date(e.expiresAt).toLocaleString('en-GB',{timeZone:'Europe/London',weekday:'long',day:'numeric',month:'long',hour:'numeric',minute:'2-digit',hourCycle:'h12'}).replace(/\s?(am|pm)$/i,e=>e.trim().toLowerCase()):'',l=[`Hello ${t}, thank you for booking ${e.venue} for ${e.partySize} on ${u} at ${e.time.slice(0,5)}.`,`To hold your table, please pay the ${s(e.amountPence)} deposit here: ${e.url}`];p&&l.push(`The link works until ${p}.`);e.terms?.trim()&&l.push(e.terms.trim());return l.push(`Thank you, ${e.venue}`),l.join('\n')},_e.depositView=D,_e.depositShort=function(e){const t=D(e,!1);return t?t.a11y.split(',')[0]:null};const e={on:!0,perPersonPence:1e3,fromParty:6,refundable:null,cutoffHours:null,policy:''};function t(e,t){const n=Math.max(0,Math.round(Number(e)||0)),o=Math.round(Number(t)||0);return Math.max(0,Math.min(n,o))}const n=(e,n)=>Math.max(0,Math.round(Number(e)||0)-t(e,n));function o(e,t,o=0){return!e.on||e.perPersonPence<=0||t`\xa3${(e/100).toFixed(e%100?2:0)}`;function d(e){const t=e.depositWaived;return t&&'object'==typeof t&&'string'==typeof t.by&&t.by?t:null}function u(e){if('deposit'!==e.security)return'none';const t=e.depositDue??e.depositPaid??0;return t?(e.depositPaid??0)>=t?'paid':d(e)?'waived':'due':'none'}function p(e){const t=new Date(e.at),n=!Number.isNaN(t.getTime())?t.toLocaleString('en-GB',{timeZone:'Europe/London',day:'2-digit',month:'2-digit',hour:'2-digit',minute:'2-digit',hourCycle:'h23'}).replace(',',''):'';return`Waived by ${e.by}${n?`, ${n}`:''}${e.note?.trim()?` (${e.note.trim()})`:''}`}function l(e){const t=e.wix?.paymentStatus;return t&&['FREE','NOT_PAID','PAID','PARTIALLY_PAID','PARTIALLY_REFUNDED','FULLY_REFUNDED'].includes(t)?t:null}function c(e){return'paid'===e.depositLink?.state&&(e.depositLink.paidPence??0)>0?e.depositLink.paidPence:e.depositPaidBy&&'Wix'!==e.depositPaidBy&&(e.depositPaid??0)>0&&!e.wix?.depositEstimated||f(e)&&(e.depositPaid??0)>0?e.depositPaid:null}function f(e){return'wix-order'===e.wix?.amountSource||'wix-order'===e.depositSource}function b(e){if(f(e)||!e.wix?.depositEstimated&&'estimate'!==e.depositSource)return null;const t=e.depositPaid??0;if(t<=0)return null;const n=e.partySize??0;return{pence:t,perHead:e.wix?.perPersonPence??(n?Math.round(t/n):0),party:n}}function m(e,t=s){const n=l(e),o=c(e),p=d(e);if(p&&'PAID'!==n&&(!e.depositPaidBy||!o)&&'paid'!==e.depositLink?.state&&'paid'!==u(e))return{label:`Deposit waived \xb7 ${p.by}`,kind:'neutral'};if(n&&'FREE'!==n){if(e.depositPaidBy&&o)return{label:`Deposit paid \xb7 ${t(o)}`,kind:'gold'};if('PAID'===n){if(o)return{label:`Deposit paid \xb7 ${t(o)}`,kind:'gold'};const n=b(e);return n?{label:n.party&&n.perHead?`Deposit paid (about ${t(n.pence)}, ${n.party} \xd7 ${t(n.perHead)})`:`Deposit paid (about ${t(n.pence)})`,kind:'gold'}:{label:'Deposit paid on website bookings',kind:'gold'}}return'PARTIALLY_PAID'===n?{label:o&&(e.depositDue??0)>o?`Part paid on website bookings \xb7 ${t(o)} of ${t(e.depositDue)}`:'Part paid on website bookings',kind:'amber'}:'NOT_PAID'===n?{label:(e.depositDue??0)>0?`Deposit not paid \xb7 ${t(e.depositDue)} due`:'Deposit not paid',kind:'amber'}:'FULLY_REFUNDED'===n?{label:'Deposit refunded on website bookings',kind:'neutral'}:{label:'Deposit part refunded on website bookings',kind:'neutral'}}const f=u(e);if('none'===f)return null;const m=e.depositLink;return'paid'===m?.state?{label:o?`Deposit paid on website bookings \xb7 ${t(o)}`:'Deposit paid on website bookings',kind:'gold'}:'paid'===f?{label:o?`Deposit paid \xb7 ${t(o)}`:'Deposit paid',kind:'gold'}:'open'===m?.state?{label:`Deposit link sent \xb7 waiting \xb7 ${t(m.amountPence??e.depositDue??0)}`,kind:'amber'}:'expired'===m?.state?{label:'Deposit link ran out \xb7 send a new one',kind:'amber'}:{label:`Deposit due \xb7 ${t(e.depositDue??0)}`,kind:'amber'}}function D(e,t,n=s){const o=m(e,n);if(!o)return null;const u=l(e),c=o.label.startsWith('Deposit paid');if(o.label.startsWith('Deposit waived')){const n=d(e);return{label:t?o.label:'Deposit waived',kind:'neutral',a11y:p(n).replace(/^Waived/,'Deposit waived'),note:t?p(n):void 0,paid:!1}}if(!t)return c?{label:'\u2713 Deposit paid',kind:'gold',a11y:'Deposit paid',paid:c}:'PARTIALLY_PAID'===u?{label:'Deposit part paid',kind:'amber',a11y:'Deposit part paid',paid:c}:'FULLY_REFUNDED'===u||'PARTIALLY_REFUNDED'===u?{label:'Deposit refunded',kind:'neutral',a11y:'Deposit refunded',paid:c}:'NOT_PAID'===u?{label:'Deposit not paid',kind:'amber',a11y:'Deposit not paid yet',paid:c}:{label:'Deposit due',kind:'amber',a11y:'Deposit due, not paid yet',paid:c};const D='PAID'===u?b(e):null,y=D&&D.perHead?`Website bookings shows paid; amount worked out at ${n(D.perHead)} a head`:f(e)&&c?'Amount from the website bookings order':void 0,P=o.label.replace(/ \xb7 /g,', ').replace(/\xd7/g,'times').replace(/[()]/g,'')+(y?`. ${y}`:'');return{label:o.label,kind:o.kind,a11y:P,note:y,paid:c}}},841,[]); +__d(function(g,r,i,a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"DEPOSIT_DEFAULT",{enumerable:!0,get:function(){return e}}),_e.depositOf=function(t){const n=t?.deposit;return n&&'object'==typeof n?{on:n.on??e.on,...!0===n.needsConfirmation?{needsConfirmation:!0}:{},perPersonPence:Number.isFinite(n.perPersonPence)?Math.max(0,Math.round(n.perPersonPence)):n.needsConfirmation?0:e.perPersonPence,fromParty:Number.isFinite(n.fromParty)?Math.max(1,Math.round(n.fromParty)):n.needsConfirmation?1:e.fromParty,refundable:'boolean'==typeof n.refundable?n.refundable:null,cutoffHours:Number.isFinite(n.cutoffHours)?Math.max(0,Math.round(n.cutoffHours)):null,policy:'string'==typeof n.policy?n.policy.slice(0,600):'',wixLinksOn:!0===n.wixLinksOn,wixLinkHours:Number.isFinite(n.wixLinkHours)?Math.max(1,Math.min(168,Math.round(n.wixLinkHours))):48}:{...e}},_e.childrenIn=t,Object.defineProperty(_e,"adultsIn",{enumerable:!0,get:function(){return n}}),_e.depositDue=o,_e.depositWords=function(e,d,u,p=0){if(e.needsConfirmation&&!e.on)return[e.policy.trim()||'Deposit policy awaiting venue confirmation.'];if(e.needsConfirmation)return['Table deposit policy not set yet. Ticketed event deposits are separate and are not a table policy.'];const l=o(e,d,p);if(!l)return[];const c=[t(d,p)?`A deposit of ${s(l)} (${s(e.perPersonPence)} for each of the ${n(d,p)} adults; children don't count towards the ${e.fromParty} and don't pay) is needed for ${e.fromParty} or more adults.`:`A deposit of ${s(l)} (${s(e.perPersonPence)} per adult; children don't count towards the ${e.fromParty} and don't pay) is needed for ${e.fromParty} or more adults.`];!0===e.refundable?c.push(e.cutoffHours?`Refundable if you cancel at least ${e.cutoffHours} hours before your booking.`:'Refundable if you cancel.'):!1===e.refundable?c.push('The deposit is not refundable.'):c.push(`Ask ${u} about refunds.`);e.policy.trim()&&c.push(e.policy.trim());return c.push(e.wixLinksOn?`${u} will send you a link to pay the deposit securely through website bookings.`:`No payment is taken in the app yet: ${u} will tell you how to pay the deposit.`),c},_e.waiverOf=d,_e.depositState=u,_e.waiverText=p,_e.canWaiveDeposit=function(e){if(['cancelled','finished','noshow','declined'].includes(e.status??''))return!1;const t=l(e);return'PAID'!==t&&'FULLY_REFUNDED'!==t&&'PARTIALLY_REFUNDED'!==t&&'FREE'!==t&&('paid'!==e.depositLink?.state&&('NOT_PAID'===t||'PARTIALLY_PAID'===t?!d(e):'due'===u(e)))},_e.wixPayStatus=l,_e.knownPaid=c,_e.fromWixOrder=f,_e.estimatedWix=b,_e.depositBadge=m,_e.canTickDeposit=function(e){if(d(e))return!1;const t=l(e);return'NOT_PAID'!==t&&'PAID'!==t&&'FULLY_REFUNDED'!==t&&'PARTIALLY_REFUNDED'!==t&&('paid'!==e.depositLink?.state&&'due'===u(e))},_e.canSendDepositLink=function(e,t){return!(!t.wixLinksOn||l(e)||d(e))&&(!e.walkIn&&!['cancelled','finished','noshow','declined'].includes(e.status??'')&&('due'===u(e)&&'paid'!==e.depositLink?.state))},_e.depositTerms=function(e){const t=[];!0===e.refundable?t.push(e.cutoffHours?`The deposit is refundable if you cancel at least ${e.cutoffHours} hours before.`:'The deposit is refundable if you cancel.'):!1===e.refundable&&t.push('The deposit is not refundable.');e.policy.trim()&&t.push(e.policy.trim());return t.join(' ')},_e.depositLinkMessage=function(e){const t=(e.name||'').trim().split(/\s+/)[0]||'there',[n,o,d]=e.date.split('-').map(Number),u=new Date(n,(o||1)-1,d||1).toLocaleDateString('en-GB',{weekday:'long',day:'numeric',month:'long'}),p=e.expiresAt?new Date(e.expiresAt).toLocaleString('en-GB',{timeZone:'Europe/London',weekday:'long',day:'numeric',month:'long',hour:'numeric',minute:'2-digit',hourCycle:'h12'}).replace(/\s?(am|pm)$/i,e=>e.trim().toLowerCase()):'',l=[`Hello ${t}, thank you for booking ${e.venue} for ${e.partySize} on ${u} at ${e.time.slice(0,5)}.`,`To hold your table, please pay the ${s(e.amountPence)} deposit here: ${e.url}`];p&&l.push(`The link works until ${p}.`);e.terms?.trim()&&l.push(e.terms.trim());return l.push(`Thank you, ${e.venue}`),l.join('\n')},_e.depositView=y,_e.depositShort=function(e){const t=y(e,!1);return t?t.a11y.split(',')[0]:null};const e={on:!0,perPersonPence:1e3,fromParty:6,refundable:null,cutoffHours:null,policy:''};function t(e,t){const n=Math.max(0,Math.round(Number(e)||0)),o=Math.round(Number(t)||0);return Math.max(0,Math.min(n,o))}const n=(e,n)=>Math.max(0,Math.round(Number(e)||0)-t(e,n));function o(e,t,o=0){return!e.on||e.perPersonPence<=0||n(t,o)`\xa3${(e/100).toFixed(e%100?2:0)}`;function d(e){const t=e.depositWaived;return t&&'object'==typeof t&&'string'==typeof t.by&&t.by?t:null}function u(e){if('deposit'!==e.security)return'none';const t=e.depositDue??e.depositPaid??0;return t?(e.depositPaid??0)>=t?'paid':d(e)?'waived':'due':'none'}function p(e){const t=new Date(e.at),n=!Number.isNaN(t.getTime())?t.toLocaleString('en-GB',{timeZone:'Europe/London',day:'2-digit',month:'2-digit',hour:'2-digit',minute:'2-digit',hourCycle:'h23'}).replace(',',''):'';return`Waived by ${e.by}${n?`, ${n}`:''}${e.note?.trim()?` (${e.note.trim()})`:''}`}function l(e){const t=e.wix?.paymentStatus;return t&&['FREE','NOT_PAID','PAID','PARTIALLY_PAID','PARTIALLY_REFUNDED','FULLY_REFUNDED'].includes(t)?t:null}function c(e){return'paid'===e.depositLink?.state&&(e.depositLink.paidPence??0)>0?e.depositLink.paidPence:e.depositPaidBy&&'Wix'!==e.depositPaidBy&&(e.depositPaid??0)>0&&!e.wix?.depositEstimated||f(e)&&(e.depositPaid??0)>0?e.depositPaid:null}function f(e){return'wix-order'===e.wix?.amountSource||'wix-order'===e.depositSource}function b(e){if(f(e)||!e.wix?.depositEstimated&&'estimate'!==e.depositSource)return null;const t=e.depositPaid??0;if(t<=0)return null;const n=e.partySize??0;return{pence:t,perHead:e.wix?.perPersonPence??(n?Math.round(t/n):0),party:n}}function m(e,t=s){const n=l(e),o=c(e),p=d(e);if(p&&'PAID'!==n&&(!e.depositPaidBy||!o)&&'paid'!==e.depositLink?.state&&'paid'!==u(e))return{label:`Deposit waived \xb7 ${p.by}`,kind:'neutral'};if(n&&'FREE'!==n){if(e.depositPaidBy&&o)return{label:`Deposit paid \xb7 ${t(o)}`,kind:'gold'};if('PAID'===n){if(o)return{label:`Deposit paid \xb7 ${t(o)}`,kind:'gold'};const n=b(e);return n?{label:n.party&&n.perHead?`Deposit paid (about ${t(n.pence)}, ${n.party} \xd7 ${t(n.perHead)})`:`Deposit paid (about ${t(n.pence)})`,kind:'gold'}:{label:'Deposit paid on website bookings',kind:'gold'}}return'PARTIALLY_PAID'===n?{label:o&&(e.depositDue??0)>o?`Part paid on website bookings \xb7 ${t(o)} of ${t(e.depositDue)}`:'Part paid on website bookings',kind:'amber'}:'NOT_PAID'===n?{label:(e.depositDue??0)>0?`Deposit not paid \xb7 ${t(e.depositDue)} due`:'Deposit not paid',kind:'amber'}:'FULLY_REFUNDED'===n?{label:'Deposit refunded on website bookings',kind:'neutral'}:{label:'Deposit part refunded on website bookings',kind:'neutral'}}const f=u(e);if('none'===f)return null;const m=e.depositLink;return'paid'===m?.state?{label:o?`Deposit paid on website bookings \xb7 ${t(o)}`:'Deposit paid on website bookings',kind:'gold'}:'paid'===f?{label:o?`Deposit paid \xb7 ${t(o)}`:'Deposit paid',kind:'gold'}:'open'===m?.state?{label:`Deposit link sent \xb7 waiting \xb7 ${t(m.amountPence??e.depositDue??0)}`,kind:'amber'}:'expired'===m?.state?{label:'Deposit link ran out \xb7 send a new one',kind:'amber'}:{label:`Deposit due \xb7 ${t(e.depositDue??0)}`,kind:'amber'}}function y(e,t,n=s){const o=m(e,n);if(!o)return null;const u=l(e),c=o.label.startsWith('Deposit paid');if(o.label.startsWith('Deposit waived')){const n=d(e);return{label:t?o.label:'Deposit waived',kind:'neutral',a11y:p(n).replace(/^Waived/,'Deposit waived'),note:t?p(n):void 0,paid:!1}}if(!t)return c?{label:'\u2713 Deposit paid',kind:'gold',a11y:'Deposit paid',paid:c}:'PARTIALLY_PAID'===u?{label:'Deposit part paid',kind:'amber',a11y:'Deposit part paid',paid:c}:'FULLY_REFUNDED'===u||'PARTIALLY_REFUNDED'===u?{label:'Deposit refunded',kind:'neutral',a11y:'Deposit refunded',paid:c}:'NOT_PAID'===u?{label:'Deposit not paid',kind:'amber',a11y:'Deposit not paid yet',paid:c}:{label:'Deposit due',kind:'amber',a11y:'Deposit due, not paid yet',paid:c};const y='PAID'===u?b(e):null,D=y&&y.perHead?`Website bookings shows paid; amount worked out at ${n(y.perHead)} a head`:f(e)&&c?'Amount from the website bookings order':void 0,P=o.label.replace(/ \xb7 /g,', ').replace(/\xd7/g,'times').replace(/[()]/g,'')+(D?`. ${D}`:'');return{label:o.label,kind:o.kind,a11y:P,note:D,paid:c}}},841,[]); __d(function(_g,_r,_i,_a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"SHAPES",{enumerable:!0,get:function(){return a}}),Object.defineProperty(_e,"shapeLabel",{enumerable:!0,get:function(){return o}}),Object.defineProperty(_e,"tableLabel",{enumerable:!0,get:function(){return s}}),Object.defineProperty(_e,"tableNumber",{enumerable:!0,get:function(){return u}}),_e.numberClashes=function(e){const t=new Map;for(const n of e){const e=u(n);t.set(e,[...t.get(e)??[],{name:n.name,areaId:n.areaId}])}const n=new Set,r=[];for(const[e,a]of t){if(a.length<2)continue;const t=new Map;a.forEach(e=>t.set(e.areaId,[...t.get(e.areaId)??[],e.name]));for(const e of t.values())e.length>1&&e.forEach(e=>n.add(e));t.size>1&&r.push(e)}return{sameArea:n,acrossAreas:r}},Object.defineProperty(_e,"liveTableLabel",{enumerable:!0,get:function(){return l}}),Object.defineProperty(_e,"FIXTURES",{enumerable:!0,get:function(){return i}}),Object.defineProperty(_e,"PLAN_W",{enumerable:!0,get:function(){return c}}),Object.defineProperty(_e,"PLAN_H",{enumerable:!0,get:function(){return b}}),Object.defineProperty(_e,"GRID",{enumerable:!0,get:function(){return m}}),Object.defineProperty(_e,"snap",{enumerable:!0,get:function(){return f}}),Object.defineProperty(_e,"clamp",{enumerable:!0,get:function(){return h}}),Object.defineProperty(_e,"fid",{enumerable:!0,get:function(){return g}}),Object.defineProperty(_e,"slug",{enumerable:!0,get:function(){return w}}),_e.sizeFor=y,Object.defineProperty(_e,"minFor",{enumerable:!0,get:function(){return x}}),Object.defineProperty(_e,"numOf",{enumerable:!0,get:function(){return O}}),Object.defineProperty(_e,"byNumber",{enumerable:!0,get:function(){return P}}),_e.newTable=j,_e.autoArrange=M,_e.placeNew=S,_e.rotate90=function(e){const t=e.x+e.w/2,n=e.y+e.h/2;return{...e,w:e.h,h:e.w,x:h(f(t-e.h/2),0,c-e.h),y:h(f(n-e.w/2),0,b-e.w)}},_e.normalisePlan=function(e){return{...e,fixtures:e.fixtures??[],tables:e.tables.map(e=>{const t=e.shape;let n='booth'===t||'rect'===t?'rect':'round'===t?'round':'square',{w:r,h:a}=e;if('square'===n||'round'===n){const e=Math.max(r,a);r=e,a=e}if(90===e.rot||270===e.rot){const e=r;r=a,a=e}return'rect'===n&&r===a&&(n='square'),{...e,shape:n,w:r,h:a,rot:0}})}},Object.defineProperty(_e,"SECTION_COLOURS",{enumerable:!0,get:function(){return I}}),_e.buildPlan=k,_e.anchoragePlan=$,_e.starterPlan=function(){return k({areas:[{name:'Main room',tables:[[1,2],[2,4],[3,6],[4,4],[5,2],[6,6]],fixtures:[A(450,600)]}]},['SV'])},Object.defineProperty(_e,"TEMPLATES",{enumerable:!0,get:function(){return v}}),_e.parseTableList=function(e){const t=[],n=[];let r;for(const a of e.split(/\r?\n/)){const e=a.trim();if(!e)continue;if(!/\d/.test(e)){r=e.replace(/[:\-\u2013]+$/,'').trim()||r;continue}const o=e.match(/^(?:table|tbl|tab|t)?\s*(?:no\.?|number|#)?\s*([a-z]?\d+[a-z]?)\b[^\d]*?(\d+)/i);if(!o){n.push(e);continue}const s=parseInt(o[2],10);!s||s>30?n.push(e):t.push({area:r,name:o[1].toUpperCase(),seats:s})}return{items:t,skipped:n}},Object.defineProperty(_e,"planCounts",{enumerable:!0,get:function(){return C}}),Object.defineProperty(_e,"tableDogOk",{enumerable:!0,get:function(){return B}}),Object.defineProperty(_e,"dogTables",{enumerable:!0,get:function(){return L}}),Object.defineProperty(_e,"areaOfTable",{enumerable:!0,get:function(){return q}}),_e.bestTables=E,Object.defineProperty(_e,"isBestTable",{enumerable:!0,get:function(){return _}}),_e.withSeedBest=function(e,t){if('anchorage'!==e||!t?.areas?.some(e=>void 0===e.best))return t;const n=$();return{...t,areas:t.areas.map(e=>{if(void 0!==e.best)return e;const r=n.areas.find(t=>t.id===e.id||t.name===e.name),a=(r?.best??[]).filter(n=>t.tables.some(t=>t.name===n&&t.areaId===e.id));return a.length?{...e,best:a}:e})}};var e,t=_r(d[0]),n=_r(d[1]),r=(e=n)&&e.__esModule?e:{default:e};const a=[{id:'square',label:'Square'},{id:'rect',label:'Rectangle'},{id:'round',label:'Round'}],o=e=>'rect'===e?'Rectangle':'round'===e?'Round':'Square',s=e=>/\d/.test(e.name)?(0,t.plainTableNumber)(e.name):(0,t.plainTableNumber)(e.label?.trim()||e.name),u=s;const l=(e,t)=>u(e),i=[{id:'bar',label:'Bar',w:300,h:50},{id:'wall',label:'Wall',w:250,h:25},{id:'door',label:'Door',w:100,h:25},{id:'window',label:'Window',w:200,h:25}],c=1e3,b=625,m=25,f=e=>Math.round(e/m)*m,h=(e,t,n)=>Math.max(t,Math.min(n,e));let p=0;const g=e=>`${e}-${Date.now().toString(36)}${(p++).toString(36)}`,w=e=>e.toLowerCase().replace(/[^a-z0-9]+/g,'-').replace(/^-|-$/g,'')||'area';function y(e){return e<=2?{shape:'square',w:75,h:75}:e<=4?{shape:'square',w:100,h:100}:e<=6?{shape:'rect',w:150,h:100}:e<=8?{shape:'rect',w:200,h:100}:e<=10?{shape:'rect',w:250,h:100}:{shape:'rect',w:300,h:100}}const x=e=>e<=2?1:Math.max(2,Math.ceil(e/2)),O=e=>{const t=e.match(/\d+/);return t?parseInt(t[0],10):9999},P=(e,t)=>O(e.name)-O(t.name)||e.name.localeCompare(t.name);function j(e,t,n,r){const a=y(n);return{id:`t-${e}-${g('x').slice(2)}`,name:e,areaId:t,shape:a.shape,minSeats:x(n),maxSeats:n,x:0,y:0,w:a.w,h:a.h,rot:0,online:!0,sectionId:r}}function M(e,t=125,n=75){const r=[...e].sort(P);if(!r.length)return r;let a=75;const o=e=>{const t=[];let n=[],a=0;for(const o of r){const r=(n.length?e:0)+o.w;n.length&&a+r>850&&(t.push(n),n=[],a=0),n.push(o),a+=(n.length>1?e:0)+o.w}return n.length&&t.push(n),t};let s=o(a);const u=(e,t)=>e.reduce((e,t)=>e+Math.max(...t.map(e=>e.h)),0)+t*(e.length-1);for(;u(s,a)>b-t-n&&a>25;)a-=25,s=o(a);const l=u(s,a),i=b-t-n,p=s.length>1?Math.min(150,a+Math.max(0,Math.floor((i-l)/(s.length-1)/m)*m)):0,g=s.reduce((e,t)=>e+Math.max(...t.map(e=>e.h)),0)+p*(s.length-1);let w=f(t+Math.max(0,(i-g)/2));const y=[];for(const e of s){const t=Math.max(...e.map(e=>e.h)),n=e.reduce((e,t)=>e+t.w,0)+a*(e.length-1);let r=f((c-n)/2);for(const n of e)y.push({...n,x:h(r,0,c-n.w),y:h(f(w+(t-n.h)/2),0,b-n.h),rot:0}),r+=n.w+a;w+=t+p}return y}function S(e,t,n=[]){const r=[...e,...n].map(e=>({x:e.x,y:e.y,w:e.w,h:e.h})),a=[];for(const e of t){let t=null;for(let n=50;n<=b-e.h-25&&!t;n+=m)for(let a=50;a<=c-e.w-25&&!t;a+=m){const o=50;r.some(t=>at.x&&nt.y)||(t={x:a,y:n})}const n=t??{x:50,y:50},o={...e,x:n.x,y:n.y};r.push({x:o.x,y:o.y,w:o.w,h:o.h}),a.push(o)}return a}const I=['#CFA45F','#E2C489','#A88B5A','#8C6A3A','#FFB547','#D9B98A'];function k(e,t=[]){const n=[],r=[],a=[],o=[];e.areas.forEach((e,s)=>{const u=w(e.name),l=e.best?e.best.map(String).filter(t=>e.tables.some(([e])=>String(e)===t)):void 0;n.push({id:u,name:e.name,dogs:!!e.dogs,outdoor:!!e.outdoor,...e.label?{label:e.label}:{},...e.colour?{colour:e.colour}:{},...l?{best:l}:{}});const i=`s-${u}`;o.push({id:i,name:e.name,colour:e.colour??I[s%I.length],server:t[s]??''});const m=(e.fixtures??[]).map((e,t)=>({...e,id:`fx-${u}-${t}`,areaId:u}));a.push(...m);const f=m.some(e=>e.y<100&&('bar'===e.kind||e.w>=300))?150:100,p=e.tables.map(([e,t])=>({...j(String(e),u,t,i),id:`t-${e}`})),g=e.layout??{},y=p.filter(e=>g[e.name]).map(e=>{const t=g[e.name],n=t.shape??(t.w===t.h?'square':'rect'),r=h(Math.round(t.w),50,c),a=h(Math.round('rect'===n?t.h:t.w),50,b);return{...e,shape:n,w:r,h:a,x:h(Math.round(t.x),0,c-r),y:h(Math.round(t.y),0,b-a),...t.label?{label:t.label}:{}}}),x=p.filter(e=>!g[e.name]);y.length?r.push(...y,...S(y,x,m)):r.push(...M(p,f,75))});const s=new Set(r.map(e=>e.name)),u=(e.joins??[]).filter(e=>e.every(e=>s.has(e))).map(e=>({id:`j-${e.join('-')}`,tables:e}));return{areas:n,tables:r,joins:u,sections:o,fixtures:a}}const T=(e,t,n=0,r=25)=>({kind:'window',x:e,y:n,w:t,h:r}),A=(e,t,n=100,r=25)=>({kind:'door',x:e,y:t,w:n,h:r});function $(){const e=r.default;return k({areas:e.areas.map(e=>({name:e.name,dogs:!!e.dogFriendly,outdoor:!(!e.outdoor&&!e.weatherDependent),label:e.label,colour:e.colour,tables:e.tables.map(([e,t])=>[e,t]),layout:e.layout,fixtures:[],best:e.best?.map(String)})),joins:e.joins??[]},e.areas.map(e=>e.server??''))}const v=[{id:'anchorage',name:'The Anchorage',sub:'4 areas \xb7 29 tables \xb7 119 seats',make:$},{id:'cafe',name:'Small caf\xe9',sub:'1 room \xb7 8 tables \xb7 dogs welcome',make:()=>k({areas:[{name:'Caf\xe9',dogs:!0,tables:[[1,2],[2,2],[3,4],[4,4],[5,2],[6,4],[7,2],[8,6]],fixtures:[{kind:'bar',x:300,y:25,w:400,h:50},A(450,600)]}]})},{id:'pub',name:'Pub with garden',sub:'Bar, lounge and beer garden',make:()=>k({areas:[{name:'Bar',dogs:!0,tables:[[1,2],[2,4],[3,4],[4,2],[5,4],[6,6]],fixtures:[{kind:'bar',x:250,y:25,w:500,h:75}]},{name:'Lounge',tables:[[7,4],[8,4],[9,2],[10,6],[11,4],[12,2],[13,4],[14,8]],fixtures:[T(150,700)]},{name:'Beer garden',dogs:!0,outdoor:!0,tables:[[20,6],[21,6],[22,4],[23,4],[24,6],[25,6]]}]})},{id:'restaurant',name:'Restaurant and terrace',sub:'Dining room with an outdoor terrace',make:()=>k({areas:[{name:'Dining room',tables:[[1,2],[2,2],[3,4],[4,4],[5,4],[6,6],[7,2],[8,2],[9,4],[10,4],[11,6],[12,8]],fixtures:[T(100,800),A(450,600)]},{name:'Terrace',outdoor:!0,tables:[[20,2],[21,4],[22,4],[23,2]]}]})},{id:'blank',name:'Blank',sub:'One empty room to start from',make:()=>k({areas:[{name:'Main room',tables:[]}]})}];const C=(e,t)=>{const n=t?e.tables.filter(e=>e.areaId===t):e.tables;return{tables:n.length,seats:n.reduce((e,t)=>e+t.maxSeats,0)}},B=(e,t)=>void 0!==t.dogOk?t.dogOk:!!e.areas.find(e=>e.id===t.areaId)?.dogs,L=e=>new Set(e.tables.filter(t=>B(e,t)).map(e=>e.name)),q=(e,t)=>e.areas.find(n=>n.id===e.tables.find(e=>e.name===t)?.areaId);function E(e,t){return e.areas.filter(e=>!t||e.id===t).flatMap(t=>(t.best??[]).filter(n=>e.tables.some(e=>e.name===n&&e.areaId===t.id)))}const _=(e,t)=>E(e).includes(t)},842,[843,844]); __d(function(g,r,i,a,m,e,d){"use strict";function t(t){const n=String(t??'').trim(),l=n.match(/\d+/g);return 1===l?.length?l[0].replace(/^0+(?=\d)/,''):n}Object.defineProperty(e,'__esModule',{value:!0}),e.plainTableNumber=t,Object.defineProperty(e,"tableNumbers",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"tableListNumbers",{enumerable:!0,get:function(){return l}}),e.tableNumbersA11y=function(t){const l=n(t).split('+').filter(Boolean);return l.length?`${1===l.length?'Table':'Tables'} ${l.join(', ')}`:'No table'},e.withTableWord=function(t){const n=t.trim();return!n||/^tables?\b/i.test(n)||/^no table\b/i.test(n)?n:`Table ${n}`};const n=n=>String(n??'').split('+').map(t).filter(Boolean).join('+'),l=(t,l=" + ")=>t.map(n).filter(Boolean).join(l)},843,[]); __d(function(e,a,l,r,t,o,s){t.exports={venue:"The Anchorage",note:"From Gordon 28 Oct 2026; layout from Gordon's floor-plan photo 29 Oct 2026 (positions, sizes, shapes, labels scaled from the photo, one scale for all areas). Photo shows MT12 and no MT8: table 8 replaced by 12. Gordon confirmed 29 Oct: no table 8; MT11 and MT12 both exist, MT11 keeps 2 seats, MT12 = 2 seats. No tables 4 or 8. No joined tables: Gordon confirmed 29 Oct that DT1 and DT2 are not joined.",areas:[{name:"Public Bar",label:"Dog friendly area (Public Bar), Area 1",colour:"#CFA45F",server:"BR",dogFriendly:!0,tables:[[1,4],[2,4],[3,5],[5,2],[6,4]],layout:{1:{label:"DT1",shape:"rect",x:600,y:125,w:205,h:90},2:{label:"DT2",shape:"rect",x:395,y:130,w:100,h:190},3:{label:"DT3",shape:"rect",x:205,y:120,w:110,h:245},5:{label:"DT5",shape:"square",x:500,y:395,w:105,h:105},6:{label:"DT6",shape:"rect",x:195,y:395,w:205,h:110}},best:[1,3]},{name:"Main Restaurant",label:"Main restaurant (no pets)",colour:"#8EC5FF",server:"SV",dogFriendly:!1,tables:[[7,5],[9,7],[10,4],[11,2],[12,2],[13,4],[14,4],[15,4],[16,2]],layout:{7:{label:"MT7",shape:"rect",x:590,y:410,w:225,h:115},9:{label:"MT9",shape:"rect",x:560,y:105,w:260,h:110},10:{label:"MT10",shape:"square",x:430,y:400,w:130,h:130},11:{label:"MT11",shape:"rect",x:545,y:270,w:115,h:90},12:{label:"MT12",shape:"rect",x:400,y:270,w:120,h:95},13:{label:"MT13",shape:"rect",x:400,y:100,w:90,h:115},14:{label:"MT14",shape:"rect",x:185,y:420,w:230,h:100},15:{label:"MT15",shape:"rect",x:190,y:220,w:165,h:145},16:{label:"MT16",shape:"rect",x:185,y:105,w:125,h:80}},best:[7,9]},{name:"Sitooterie",label:"Sitooterie (fully covered conservatory, no pets)",colour:"#C79BE8",server:"DM",dogFriendly:!1,tables:[[17,2],[18,6],[19,4],[20,6],[21,4],[22,4],[23,4]],layout:{17:{label:"ST17",shape:"square",x:760,y:325,w:110,h:110},18:{label:"ST18",shape:"rect",x:605,y:135,w:270,h:115},19:{label:"ST19",shape:"rect",x:460,y:160,w:105,h:150},20:{label:"ST20",shape:"rect",x:135,y:125,w:265,h:120},21:{label:"ST21",shape:"rect",x:120,y:305,w:110,h:175},22:{label:"ST22",shape:"rect",x:255,y:310,w:115,h:175},23:{label:"ST23",shape:"rect",x:410,y:350,w:110,h:155}},best:[19,21]},{name:"Beer Garden",label:"Outdoor beer garden (weather permitting, no shelter, pets allowed)",colour:"#B08D57",server:"GD",dogFriendly:!0,outdoor:!0,weatherDependent:!0,tables:[[24,4],[25,4],[26,4],[27,6],[28,6],[29,4],[30,4],[31,4]],layout:{24:{label:"BGT24",shape:"round",x:740,y:70,w:130,h:130},25:{label:"BGT25",shape:"round",x:515,y:50,w:135,h:135},26:{label:"BGT26",shape:"round",x:310,y:50,w:135,h:135},27:{label:"BGT27",shape:"rect",x:560,y:235,w:280,h:115},28:{label:"BGT28",shape:"rect",x:245,y:235,w:270,h:110},29:{label:"BGT29",shape:"rect",x:210,y:365,w:190,h:60},30:{label:"BGT30",shape:"rect",x:180,y:445,w:190,h:55},31:{label:"BGT31",shape:"rect",x:130,y:520,w:215,h:60}},best:[27,28]}],photoScale:1.8,joins:[],bestNote:"Best tables per area from Gordon, 1 Nov 2026: Bar 1 and 3; Restaurant 7 and 9; Sitooterie 19 and 21; Outside (Beer Garden) 27 and 28. Shown as BEST for walk-ins and bookings when they fit; editable per area in the table plan."}},844,[]); @@ -1059,7 +1059,7 @@ __d(function(g,r,i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule' __d(function(g,r,i,a,_m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.setClockServer=function(t){s=t,c()},e.markClockUnsent=function(t){o.set(t,Date.now()),c()},e.markClockSent=function(t){o.delete(t)&&c()},e.clockNotSent=l,e.useClockNotSent=function(o){const[,c]=(0,t.useState)(0);return(0,t.useEffect)(()=>{const t=()=>c(t=>t+1);u.add(t);const o=n.mutationQueue.subscribe(t);return()=>{u.delete(t),o()}},[]),l(o)};var t=r(d[0]),n=r(d[1]);const o=new Map,u=new Set,c=()=>{for(const t of u)t()};let s=()=>!1;function l(t){if(!t)return!1;return n.mutationQueue.pending.some(n=>'attendance'===n.table&&n.rowKey===t)||o.has(t)&&s()}n.mutationQueue.onDone(t=>{'attendance'===t.table&&o.delete(t.rowKey)&&c()})},976,[17,977]); __d(function(g,_r,i,a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"MutationQueue",{enumerable:!0,get:function(){return l}}),Object.defineProperty(_e,"mutationQueue",{enumerable:!0,get:function(){return o}});var t=_r(d[0]),e=_r(d[1]),s=_r(d[2]);const n='queue:v1',r='queue:failed:v1',h=t=>`${t.table}|${t.venueId}|${t.rowKey}`;class l{items=[];failedItems=[];loaded=null;flushing=null;flushingSince=0;exec=null;listeners=new Set;onFailure=new Set;onSaved=new Set;retryTimer=null;waitTimer=null;backoffMs=2e3;now=()=>Date.now();constructor(){(0,t.onConnectivity)(t=>{t&&this.flush()})}setExecutor(t){this.exec=t}load(){return this.loaded||(this.loaded=(async()=>{const t=await e.kv.get(n,[]);this.items=[...t.map(t=>({...t,nextAt:void 0})),...this.items],this.failedItems=await e.kv.get(r,[]),this.emit()})()),this.loaded}get pending(){return this.items}get waiting(){return this.items.filter(t=>t.attempts>0)}get failed(){return this.failedItems}hasPending(t,e,s){return this.items.some(n=>n.table===t&&n.venueId===e&&n.rowKey===s)}async enqueue(t){await this.load();const s={...t,id:(0,e.uuid)(),createdAt:(new Date).toISOString(),attempts:0};return this.items.push(s),await this.persist(),this.flush(),s}nextReady(){const t=new Set,e=this.now();for(const s of this.items){const n=h(s);if(!t.has(n)){if(!(s.nextAt&&s.nextAt>e))return s;t.add(n)}}}remove(t){this.items=this.items.filter(e=>e!==t)}flush(){if(this.flushing&&Date.now()-this.flushingSince<6e4)return this.flushing;this.flushingSince=Date.now();let e=null;return e=(async()=>{for(await this.load();this.exec;){if(this.flushing&&this.flushing!==e)return;const n=this.nextReady();if(!n)break;if(!(0,t.isOnline)()){this.scheduleRetry();break}try{const t=await this.exec(n);this.remove(n),this.backoffMs=2e3,'conflict'===t?this.fail(n,'conflict','Row changed on the server (version conflict) or is not visible to you'):this.onSaved.forEach(t=>t(n))}catch(e){n.attempts+=1,n.lastError=String(e?.message??e);const r=e??{};n.lastErr={code:r.code?String(r.code):void 0,status:Number(r.status)||void 0,message:n.lastError.slice(0,300)};const h=(0,s.classifyWriteError)(e);if('network'===h){n.attempts-=1,(0,t.setOnline)(!1),this.scheduleRetry(),await this.persist();break}'retry'===h?n.nextAt=this.now()+(0,s.retryDelayMs)(n.attempts):(this.remove(n),this.fail(n,'rejected',n.lastError))}await this.persist()}this.flushing===e&&(this.flushing=null),this.scheduleWaiting()})(),this.flushing=e,e}retryNow(){for(const t of this.items)t.nextAt=void 0;return this.flush()}subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}onFailed(t){return this.onFailure.add(t),()=>{this.onFailure.delete(t)}}onDone(t){return this.onSaved.add(t),()=>{this.onSaved.delete(t)}}async clearFailed(){this.failedItems=[],await e.kv.set(r,[]),this.emit()}fail(t,s,n){const h={...t,lastError:n,failedAt:(new Date).toISOString(),reason:s};this.failedItems=[h,...this.failedItems].slice(0,100),e.kv.set(r,this.failedItems),this.onFailure.forEach(t=>t(h))}scheduleWaiting(){this.waitTimer&&(clearTimeout(this.waitTimer),this.waitTimer=null);const t=this.items.map(t=>t.nextAt??0).filter(t=>t>0);if(!t.length)return;const e=Math.max(500,Math.min(...t)-this.now());this.waitTimer=setTimeout(()=>{this.waitTimer=null,this.flush()},e)}scheduleRetry(){if(this.retryTimer)return;const e=this.backoffMs;this.backoffMs=Math.min(2*this.backoffMs,6e4),this.retryTimer=setTimeout(()=>{this.retryTimer=null,(0,t.setOnline)(!0),this.flush()},e)}async persist(){await e.kv.set(n,this.items),this.emit()}emit(){this.listeners.forEach(t=>t())}}const o=new l},977,[974,936,978]); __d(function(g,r,i,a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.classifyWriteError=function(o){if((0,e.isNetworkError)(o))return'network';const{code:n,status:c,msg:l}=t(o);return s(o)?'refused':/^(08|53|57|58)/.test(n)||['40001','40P01','55P03','23505','23503'].includes(n)||/^PGRST30[0-3]$/.test(n)||/jwt|token.*expired/i.test(l)||401===c||408===c||425===c||429===c||c>=500?'retry':409!==c||n?'refused':'retry'},Object.defineProperty(_e,"retryDelayMs",{enumerable:!0,get:function(){return o}}),_e.describeWrite=function(e){const t='rpc'===e.kind?(e.fn??'change').replace(/_/g,' '):n[e.table]??e.table.replace(/_/g,' ').replace(/s$/,''),s=e.values??{},o=s.guest_name??s.name??s.display_name??s.title??s.reason,c='string'==typeof o&&o.trim()?` for ${o.trim().slice(0,60)}`:'';return'delete'===e.kind?`deleting a ${t}${c}`:`the ${t}${c}`},_e.plainReason=function(e,o){const{code:n,status:c,msg:l}=t(e);if('refused'===o)return s(e)?'more than 20 deletes in 10 minutes from one sign-in are stopped to keep your data safe':'42501'===n||403===c||/row-level security|permission/i.test(l)?'your sign-in isn\u2019t allowed to change this':'conflict'===n?'it was changed or removed on another device first':/^(22|23)/.test(n)?'the shared system says some of the details aren\u2019t valid':'P0001'===n&&l?l.slice(0,140):l?`the shared system said: ${l.slice(0,120)}`:'the shared system refused it';return'23505'===n?'the shared system already has another copy of it':'23503'===n?'a related change has to save first':/^PGRST30/.test(n)||401===c||/jwt/i.test(l)?'your sign-in is being refreshed':'the shared system is busy'};var e=r(d[0]);const t=e=>{const t=e&&'object'==typeof e?e:{};return{msg:String(t.message??e??''),code:String(t.code??''),status:Number(t.status??0)||0,hint:String(t.hint??'')}},s=e=>{const s=t(e);return/delete guard/i.test(s.hint)||/too many .* deleted in 10 minutes/i.test(s.msg)};const o=e=>Math.min(5e3*Math.pow(3,Math.max(0,e-1)),3e5),n={bookings:'booking',walk_ins:'walk-in',blocks:'blocked time',sold_out_items:'sold-out mark',sold_out_links:'dish stock link',staff:'staff details',rota_shifts:'rota shift',stock_items:'stock item',stock_events:'stock count',stock_counts:'stock count',chat_messages:'chat message',recipe_cards:'recipe card',order_lists:'order list',order_list_items:'order list item',daily_task_ticks:'task tick',daily_tasks:'daily task',attendance:'clock in or out',cash_ups:'cash-up',table_plans:'table plan',guest_profiles:'guest profile',floor_live:'table status',venues:'venue settings',time_requests:'clock correction request',staff_leave:'time off',scheduled_notifications:'reminder',suppliers:'supplier',supplier_orders:'supplier order',takeaway_orders:'takeaway order'}},978,[974]); -__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"APP_VERSION",{enumerable:!0,get:function(){return t}});const t='v0.3.12.192'},979,[]); +__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"APP_VERSION",{enumerable:!0,get:function(){return t}});const t='v0.3.12.193'},979,[]); __d(function(g,_r,i,a,_m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"TableRepository",{enumerable:!0,get:function(){return c}}),e.executeMutation=async function(t){const s=(t,s)=>{throw Object.assign(t,{status:s})};if('rpc'===t.kind){const{error:n,status:r}=await u().rpc(t.fn,t.values??{});return n&&s(n,r),'ok'}const n=u().from(t.table);if('upsert'===t.kind||'insert'===t.kind){const{error:r,status:o}=await n.upsert(t.values??{},{onConflict:t.conflictKey??'id',ignoreDuplicates:'insert'===t.kind});if(r&&'stock_events'===t.table&&'23503'===r.code&&/undoes/i.test(String(r.message??''))&&t.values?.undoes){t.values={...t.values,undoes:null};const r=await n.upsert(t.values,{onConflict:t.conflictKey??'id',ignoreDuplicates:'insert'===t.kind});return r.error&&s(r.error,r.status),'ok'}return r&&s(r,o),'ok'}let r='update'===t.kind?n.update(t.values??{}):n.delete();for(const[s,n]of Object.entries(t.match??{}))r=r.eq(s,n);const{data:o,error:c,status:l}=await r.select();c&&s(c,l);return'update'!==t.kind||o&&0!==o.length?'ok':'conflict'};var t=_r(d[0]),s=_r(d[1]),n=_r(d[2]),r=_r(d[3]),o=_r(d[4]);const u=()=>(0,n.getSupabase)();class c{constructor(t,s={}){this.table=t,this.opts=s,this.keyOf=s.keyOf??(t=>String(t.id)),this.keyColumns=s.keyColumns??['id'],this.venueCol=s.venueColumn??'venue_id'}rows(t){return s.cache.rows(this.table,t)}get(t,n){return s.cache.get(this.table,t,n)}subscribe(t,n){return s.cache.subscribe(this.table,t,n)}hydrate(t){return s.cache.hydrate(this.table,t)}async refresh(n,r={}){const c=()=>{let t=u().from(this.table).select('*').eq(this.venueCol,n);return this.opts.orderBy&&(t=t.order(this.opts.orderBy.column,{ascending:this.opts.orderBy.ascending??!0})),r.filter&&(t=r.filter(t)),t},l='bookings'===this.table?await(0,t.readPages)(async(t,s)=>{const{data:n,error:r}=await c().order('id').range(t,s);if(r)throw r;return n??[]}):await(async()=>{const{data:t,error:s}=await c().limit(this.opts.limit??1e3);if(s)throw s;return t??[]})();return s.cache.replace(this.table,n,l.map(t=>[this.keyOf(t),t]),t=>o.mutationQueue.hasPending(this.table,n,t)),l}async create(t,n){const u={...1===this.keyColumns.length&&'id'===this.keyColumns[0]?{id:(0,r.uuid)()}:{},...n,[this.venueCol]:t},c=this.keyOf(u);return s.cache.put(this.table,t,c,u),await o.mutationQueue.enqueue({table:this.table,venueId:t,kind:'insert'===this.opts.writeMode?'insert':'upsert',rowKey:c,values:u,conflictKey:this.opts.conflictKey??'id'}),u}async update(t,n,r,u={}){const c=s.cache.get(this.table,t,n),l={...this.matchFor(n,c),...u,[this.venueCol]:t};s.cache.patch(this.table,t,n,{...r,updated_at:(new Date).toISOString()}),await o.mutationQueue.enqueue({table:this.table,venueId:t,kind:'update',rowKey:n,values:r,match:l})}async remove(t,n){const r=s.cache.get(this.table,t,n),u={...this.matchFor(n,r),[this.venueCol]:t};s.cache.remove(this.table,t,n),await o.mutationQueue.enqueue({table:this.table,venueId:t,kind:'delete',rowKey:n,match:u})}matchFor(t,s){if(1===this.keyColumns.length&&'id'===this.keyColumns[0])return{id:t};const n={};for(const t of this.keyColumns)n[t]=s?.[t];return n}}},980,[981,982,892,936,977]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.readPages=async function(t,n=1e3){const s=[];for(let c=0;;c+=n){const o=await t(c,c+n-1);if(s.push(...o),o.length`cache:${t}:${n}`;function f(t){let s=n.get(t);return s||(s=new Map,n.set(t,s)),s}function p(n){s.delete(n),c.get(n)?.forEach(t=>t());const u=o.get(n);u&&clearTimeout(u),o.set(n,setTimeout(()=>{o.delete(n),t.kv.set(n,Array.from(f(n).entries()))},250))}const w={async hydrate(n,s){const c=l(n,s);if(u.has(c))return;u.add(c);const o=await t.kv.get(c,[]),w=f(c);let h=0;for(const[t,n]of o)w.has(t)||(w.set(t,n),h++);h&&p(c)},rows(t,n){const c=l(t,n);let o=s.get(c);return o||(o=Array.from(f(c).values()),s.set(c,o)),o},get:(t,n,s)=>f(l(t,n)).get(s),put(t,n,s,c){f(l(t,n)).set(s,c),p(l(t,n))},patch(t,n,s,c){const o=f(l(t,n)),u=o.get(s);u&&(o.set(s,{...u,...c}),p(l(t,n)))},remove(t,n,s){f(l(t,n)).delete(s)&&p(l(t,n))},replace(t,s,c,o=()=>!1){const u=l(t,s),w=f(u),h=new Map(c);w.forEach((t,n)=>{o(n)&&h.set(n,t)}),n.set(u,h),p(u)},subscribe(t,n,s){const o=l(t,n);let u=c.get(o);return u||(u=new Set,c.set(o,u)),u.add(s),()=>{u?.delete(s)}},async clearVenue(o,f){for(const p of f){const f=l(p,o);n.delete(f),s.delete(f),u.delete(f),await t.kv.remove(f),c.get(f)?.forEach(t=>t())}}}},982,[936]); @@ -1174,7 +1174,7 @@ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{v __d(function(g,_r,i,a,_m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.guardBookingChange=w,_e.saveTablesReported=async function(e,t,n,o,s,u){if(!w(u,{b:t,tables:n}))return!1;const v=n.length?(0,h.notSavedWhat)({...t,name:o,table:n.join('+')}):`Taking the table off ${o}`;u(`Saving ${v}\u2026`);try{await(0,b.saveBookingTables)(e,t,n)}catch(e){const t=`${v} did not save: ${String(e?.message??e).slice(0,120)}`;return u(t),(0,l.announce)(t),!1}const y=await(0,c.waitForBookingSave)(t.id);if('saved'===y.state||'local'===y.state){const e=(0,r.savedWords)(o,t.partySize,n,s);return u(e),(0,l.announce)(e),!0}const k='waiting'===y.state?`${v}: not saved yet. It saves by itself when the connection is back; a red banner shows if it fails.`:`${v} did not save. ${f("why"in y?y.why:"the shared system did not take it")}. Tap the red banner to try again.`;return u(k),(0,l.announce)(k),!1},_e.reportBookingSave=async function(e,t,n,o){const s=await(0,c.waitForBookingSave)(e);if('saved'===s.state||'local'===s.state)return o(t),(0,l.announce)(t),!0;const r='waiting'===s.state?`${n}: not saved yet. It saves by itself when the connection is back; a red banner shows if it fails.`:`${n} did not save. ${f('why'in s?s.why:'the shared system did not take it')}. Tap the red banner to try again.`;return o(r),(0,l.announce)(r),!1},_e.BookingSaveBanner=function({rid:e,testID:r="booking-save-banner",margin:c}){const b=(0,h.useBookingSaves)(e=>e.notSaved),w=(0,s.useBookings)(e).filter(e=>b[e.id]).map(e=>void 0!==b[e.id].want?{...e,table:b[e.id].want||void 0}:e),{msg:S,retry:$}=k(),m=(0,t.useRef)(''),p=w.map(e=>(0,h.notSavedLine)(e)),B=w.map(e=>e.id).sort().join(',');if((0,t.useEffect)(()=>{B&&B!==m.current&&(0,l.announce)(1===w.length?p[0]:`${w.length} booking changes did not save. Tap the red banner to try again.`),m.current=B},[B]),!w.length)return null;const j=1===w.length?p[0]:`${w.length} booking changes did not save. Tap to try again.`;return(0,y.jsx)(n.default,{testID:r,accessibilityRole:"button",accessibilityLiveRegion:"assertive",accessibilityLabel:`${j}${w.length>1?` ${w.map(e=>(0,h.notSavedWhat)(e)).join('. ')}.`:''} ${f(b[w[0].id].why)}.`,onPress:$,style:{...c??{},alignSelf:'stretch',gap:4,padding:12,borderRadius:12,borderWidth:2,borderColor:u.colours.red,backgroundColor:'#3a1210',alignItems:'center'},children:(0,y.jsxs)(o.default,{accessibilityRole:"alert",style:{alignItems:'center',gap:4},children:[(0,y.jsx)(v.T,{testID:`${r}-title`,size:17,weight:"semibold",center:!0,colour:"#FFD2CC",children:j}),w.length>1?w.slice(0,6).map(e=>(0,y.jsx)(v.T,{testID:`${r}-line`,size:15,center:!0,colour:"#FFD2CC",children:(0,h.notSavedWhat)(e)},e.id)):null,(0,y.jsx)(v.T,{testID:`${r}-why`,size:14,center:!0,colour:"#FFB3AA",children:w.length>1?`${f(b[w[0].id].why)}${w.length>6?` \xb7 and ${w.length-6} more`:''}`:f(b[w[0].id].why)}),S?(0,y.jsx)(v.T,{testID:`${r}-msg`,size:14,center:!0,colour:u.colours.goldLight,children:S}):null]})})},_e.BookingNotSavedLine=function({b:e}){const t=(0,h.useBookingSaves)(t=>t.notSaved[e.id]),{msg:o,retry:s}=k();if(!t)return null;void 0!==t.want&&(e={...e,table:t.want||void 0});return(0,y.jsxs)(n.default,{testID:`booking-not-saved-${e.id}`,accessibilityRole:"button",accessibilityLiveRegion:"assertive",accessibilityLabel:`${(0,h.notSavedLine)(e)} ${f(t.why)}.`,onPress:s,style:{alignSelf:'stretch',padding:8,borderRadius:10,borderWidth:1.5,borderColor:u.colours.red,backgroundColor:'#3a1210',alignItems:'center'},children:[(0,y.jsx)(v.T,{size:15,weight:"semibold",center:!0,colour:"#FFD2CC",children:(0,h.notSavedLine)(e)}),o?(0,y.jsx)(v.T,{size:13,center:!0,colour:u.colours.goldLight,children:o}):null]})};var t=_r(d[0]),n=e(_r(d[1])),o=e(_r(d[2])),s=_r(d[3]),r=_r(d[4]),l=_r(d[5]),c=_r(d[6]),h=_r(d[7]),u=_r(d[8]),b=_r(d[9]),v=_r(d[10]),y=_r(d[11]);const f=e=>e.charAt(0).toUpperCase()+e.slice(1);function w(e,t){const n=(0,c.bookingSaveBlocker)();if(!n)return!0;t&&h.useBookingSaves.getState().mark({id:t.b.id,table:t.b.walkIn?'walk_ins':'bookings',why:n,...t.tables?{want:t.tables.join('+')}:{}});const o=`${t?(0,h.notSavedWhat)({...t.b,...t.tables?{table:t.tables.join('+')||void 0}:{}}):'This change'} did not save: ${n}.`;return e?.(o),(0,l.announce)(o),!1}function k(){const[e,n]=(0,t.useState)('');return{msg:e,retry:async()=>{n('Saving\u2026'),(0,l.announce)('Saving');const e=await(0,c.saveBookingsNow)(!0),t=e?`Not saved: ${e}.`:h.useBookingSaves.getState().count()?'Sent again. The banner clears when the shared system takes it.':'Nothing is left waiting. Check the plan and make the change again if it is not there.';n(t),(0,l.announce)(t)}}}},1091,[17,385,85,858,1092,1093,946,984,804,1089,777,8]); __d(function(_g,r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"byNum",{enumerable:!0,get:function(){return s}}),e.tableKey=o,e.toggleTable=function(t,n){return t.includes(n)?t.filter(t=>t!==n):a(o([...t,n]))},e.seatsOf=function(t,n){const a={};for(const s of n)a[s]=t.tables.find(t=>t.name===s)?.maxSeats??0;return{per:a,total:Object.values(a).reduce((t,n)=>t+n,0)}},e.seatLine=function(t,n){const a=Math.max(0,n-t);return{text:`${t} ${1===t?'seat':'seats'} for ${l(n)}${a?`: ${a} short`:''}`,short:a,fits:0===a&&t>0}},e.pickClashes=u,e.requestedFreeTable=function(t,n,a,s,l=90){const o={id:n.id??'new',status:'confirmed',...n};for(const n of t)if(a.includes(n)&&!u(o,[n],s,l).length)return n;return null},e.overCapacityAsk=function(n,s,l){const u=a(o(n));if(!u.length||s>=l)return null;const c=u.map(n=>(0,t.tableNumbers)(n));return`${1===c.length?`Table ${c[0]} seats`:`Tables ${c.slice(0,-1).join(', ')} and ${c[c.length-1]} seat`} ${s} \u2013 this booking is ${l}. Use it anyway?`},e.clashWords=function(n){return n.map(n=>`${(0,t.tableNumbers)(n.table)} has ${n.with.walkIn?'a walk-in':(n.with.name||'a booking').replace(' (example)','')} at ${n.with.time}`).join('. ')+(n.length?'.':'')},e.tablesWords=c,e.pickA11y=function(n,a,s,l){return`Table ${(0,t.tableNumbers)(n)}, ${a} ${1===a?'seat':'seats'}${s?', selected':''}${l?`, has ${l.walkIn?'a walk-in':l.name} at ${l.time}`:''}`},e.pickGroups=function(t){return t.areas.map(n=>({area:n.name,tables:t.tables.filter(t=>t.areaId===n.id).map(t=>({name:t.name,seats:t.maxSeats})).sort((t,n)=>s(t.name,n.name))})).filter(t=>t.tables.length)},e.savedWords=function(t,n,a,s){return a.length?`${t}, ${l(n)}: ${c(a)} (${s} seats).`:`${t}: table taken off.`},e.tableActions=function(t,n){const s=a(t.table);if(['cancelled','noshow'].includes(t.status))return[];const o=[s.length?{id:'assign',label:'Change table',a11y:`Change table for ${n}, ${l(t.partySize)}, now ${c(s).toLowerCase()}. You can pick several tables to join.`}:{id:'assign',label:'Assign table',a11y:`Assign table for ${n}, ${l(t.partySize)}. You can pick several tables to join.`}];s.length&&o.push({id:'clear',label:'Clear table',a11y:`Clear table for ${n}, take ${c(s).toLowerCase()} off this booking`});return o},e.dragTables=function(t,n,s){if(!s||'__none'===s||s===n)return null;const l=a(t);if(l.includes(s))return null;return o('__none'!==n&&l.includes(n)?l.map(t=>t===n?s:t):[s])};var t=r(d[0]),n=r(d[1]);const a=t=>t?t.split('+').map(t=>t.trim()).filter(Boolean):[],s=(t,n)=>t.localeCompare(n,'en-GB',{numeric:!0}),l=t=>`${t} ${1===t?'person':'people'}`;function o(t){return[...new Set(t.map(t=>String(t).trim()).filter(Boolean))].sort(s).join('+')}function u(t,l,u,c=90){if(!l.length)return[];const f={...t,table:o(l)},b=[];for(const s of u)if(s.id!==t.id&&s.date===t.date&&!['cancelled','noshow','finished'].includes(s.status)&&(0,n.startOf)(f)<(0,n.endOf)(s,c)&&(0,n.startOf)(s)<(0,n.endOf)(f,c))for(const t of a(s.table))l.includes(t)&&b.push({table:t,with:s});return b.sort((t,n)=>s(t.table,n.table))}function c(n){const s=a(o(n));return s.length?(0,t.tableListNumbers)(s):'No table'}},1092,[843,1074]); __d(function(g,r,i,a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.primeAnnouncer=function(){u()},_e.announce=function(t){const e=String(t??'').trim();if(!e)return;{const t=u();if(!t)return;const n=++o;return t.textContent='',void setTimeout(()=>{n===o&&(t.textContent=e)},80)}},Object.defineProperty(_e,"lastAnnounced",{enumerable:!0,get:function(){return c}});var t,e=r(d[0]);(t=e)&&t.__esModule;r(d[1]);let n=null,o=0;function u(){if('undefined'==typeof document||!document.body)return null;if(n&&document.body.contains(n))return n;const t=document.createElement('div');return t.id='cc-announcer',t.setAttribute('aria-live','assertive'),t.setAttribute('aria-atomic','true'),t.setAttribute('role','status'),t.setAttribute('data-testid','cc-announcer'),Object.assign(t.style,{position:'absolute',width:'1px',height:'1px',margin:'-1px',padding:'0',overflow:'hidden',clip:'rect(0 0 0 0)',whiteSpace:'nowrap',border:'0'}),document.body.appendChild(t),n=t,t}const c=()=>n?.textContent??''},1093,[264,219]); -__d(function(g,_r,_i,_a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"TABLES",{enumerable:!0,get:function(){return A}}),_e.useTableNames=R,_e.resetTableLive=W,_e.seatBookingNow=async function(e,t){await k.repo.bookings.setStatus(t.id,'seated'),W(e,t.table)},_e.finishBookingNow=async function(e,t){const s=(new Date).toISOString();await k.repo.bookings.update(t.id,(0,N.finishClearPatch)(s,t.table)),(0,v.tablesOf)(t.table).forEach(t=>v.useFloor.getState().setLive(e,t,{stage:void 0,dirty:!0}))},_e.useTableUse=E,Object.defineProperty(_e,"walkInLabel",{enumerable:!0,get:function(){return _}}),_e.TablePicker=H,_e.WalkInSheet=q,_e.AssignTableSheet=V,_e.undoNotice=Y,_e.NewBookingSheet=G,_e.useFrontDoor=function(e,t){const[s,o]=(0,c.useState)(!1),[l,a]=(0,c.useState)(!1),[i,n]=(0,c.useState)(null);return{openWalkIn:()=>o({}),openWalkInAt:e=>o({table:e}),openBooking:()=>a(!0),assignTable:e=>n({b:e}),combineTables:e=>n({b:e,combine:!0}),elements:(0,F.jsxs)(F.Fragment,{children:[s?(0,F.jsx)(q,{wide:t,initialTable:s.table,onClose:()=>o(!1),onSeated:Y}):null,l?(0,F.jsx)(G,{wide:t,date:e,onClose:()=>a(!1),onSaved:e=>(0,u.notify)({id:`booked:${Date.now()}`,testID:'booking-saved-toast',timeoutMs:5e3,icon:'\u2713',title:`Booked: ${e.name} \xb7 ${(0,w.niceDate)((0,w.parseYmd)(e.date))} at ${e.time}`})}):null,i?(0,F.jsx)(V,{booking:i.b,combine:i.combine,onClose:()=>n(null)}):null]})}};var t=_r(_d[0]),s=_r(_d[1]),o=_r(_d[2]),l=_r(_d[3]),a=_r(_d[4]),i=_r(_d[5]),n=_r(_d[6]),r=_r(_d[7]),d=_r(_d[8]),u=_r(_d[9]),c=_r(_d[10]),b=e(c),h=_r(_d[11]),p=e(_r(_d[12])),m=e(_r(_d[13])),f=_r(_d[14]),y=_r(_d[15]),k=_r(_d[16]),x=_r(_d[17]),j=_r(_d[18]),w=_r(_d[19]),S=_r(_d[20]),T=_r(_d[21]),C=_r(_d[22]),v=_r(_d[23]),D=_r(_d[24]),I=_r(_d[25]),$=_r(_d[26]),P=_r(_d[27]),O=_r(_d[28]),B=_r(_d[29]),z=_r(_d[30]),M=_r(_d[31]),N=_r(_d[32]),F=_r(_d[33]);const L=e=>(0,u.notify)({id:'booking-blocked',testID:'booking-blocked-toast',timeoutMs:9e3,icon:'\u26a0',title:e}),A=Array.from({length:12},(e,t)=>String(t+1));function R(e){const t=(0,v.usePlan)(e);return t.areas.flatMap(e=>t.tables.filter(t=>t.areaId===e.id).map(e=>e.name))}function W(e,t){(0,v.tablesOf)(t).forEach(t=>v.useFloor.getState().setLive(e,t,{stage:'seated',dirty:!1}))}function E(e,t){const s=(0,k.useBookings)(e),o=(0,k.useOrders)(e),l=R(e),a=(0,v.useFloor)(t=>t.live[e])??{},i=(0,v.usePlan)(e),n=(0,D.useBlocks)(e=>e.blocks),r=(0,w.ymd)(t),d=(0,D.closedAreasAt)(n,e,r,(0,w.hm)(t)),u={};for(const e of l)u[e]=a[e]?.blocked||d.has(`tbl:${e}`)?{busy:!0,label:'Blocked'}:d.has(i.tables.find(t=>t.name===e)?.areaId??'')?{busy:!0,label:'Closed'}:a[e]?.dirty?{busy:!0,label:'Needs clearing'}:{busy:!1,label:'Free'};for(const e of s)if(e.date===r&&e.table)for(const s of(0,v.tablesOf)(e.table))if(u[s])if('seated'===e.status)u[s]={busy:!0,label:`${e.walkIn?'Walk-in':`${e.name.slice(0,1)}.`} \xb7 ${e.partySize}`};else if('confirmed'===e.status&&!u[s].busy){const o=(0,w.minsBetween)(t,new Date(`${e.date}T${e.time}:00`));o>=-15&&o<=90&&(u[s]={...u[s],soon:`Booked ${e.time}`})}for(const e of o)'table'===e.type&&e.tableNo&&u[e.tableNo]&&!['closed','cancelled','collected'].includes(e.status)&&!u[e.tableNo].busy&&(u[e.tableNo]={busy:!0,label:'Open order'});return u}const _=e=>e.walkIn?`Walk-in \xb7 ${e.partySize}`:`${e.name} \xb7 ${e.partySize}`;function H({use:e,value:t,onPick:s,big:o,best:a,dense:i,bestSet:n,picked:r}){const d=Object.keys(e),[u,b]=(0,c.useState)(0),h=i?6:8,f=i?64:o?92:76,y=u?Math.max(3,Math.floor((u+h)/(f+h))):0,k=y?Math.floor((u-h*(y-1))/y):f,x=new Set(n??[]),j=a?(0,v.tablesOf)(a)[0]:null;return(0,F.jsx)(m.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:h},testID:"table-picker",onLayout:e=>b(Math.floor(e.nativeEvent.layout.width)),children:d.map(o=>{const a=e[o],n=t===o||!!r?.includes(o),d=x.has(o),u=j===o&&!n,c=a.busy?['Blocked','Needs clearing','Closed'].includes(a.label)?a.label:'In use':a.soon??'Free';return(0,F.jsxs)(p.default,{accessibilityRole:"button",testID:`pick-table-${o}`,accessibilityLabel:`Table ${(0,l.tableNumbers)(o)}${r?n?', picked':', not picked':''}, ${a.busy?`in use (${a.label})`:a.soon?`free, ${a.soon}`:'free'}${d?', best table':''}${u?', suggested for this party':''}`,accessibilityState:{selected:n,disabled:'Closed'===a.label},disabled:'Closed'===a.label,onPress:()=>s(o),style:{width:k,minHeight:i?58:64,borderRadius:12,borderWidth:n||u?2.5:1.5,paddingVertical:i?3:6,paddingHorizontal:4,alignItems:'center',justifyContent:'center',gap:2,borderColor:n||u?S.colours.gold:a.busy?S.colours.red:S.colours.ok,backgroundColor:n?S.colours.goldTint:a.busy?S.colours.redBg:S.colours.surface2,opacity:'Closed'!==a.label||n?1:.55},children:[(0,F.jsxs)(m.default,{style:{flexDirection:'row',alignItems:'center',gap:4},children:[(0,F.jsx)(C.T,{weight:"bold",size:22,colour:n?S.colours.goldLight:S.colours.text,children:(0,l.tableNumbers)(o)}),d?(0,F.jsx)(m.default,{testID:"best-table",style:{backgroundColor:S.colours.gold,borderRadius:5,paddingHorizontal:4,paddingVertical:1},children:(0,F.jsx)(C.T,{size:11,weight:"bold",colour:S.colours.onGold,children:"BEST"})}):null]}),(0,F.jsx)(C.T,{size:i?13:14,colour:a.busy?'#FFD9D4':a.soon?'#FFE2A8':'#E2C489',center:!0,numberOfLines:1,children:c})]},o)})})}const U=[1,2,3,4,5,6,7,8];function q({onClose:e,onSeated:a,wide:i,initialTable:n}){const{rid:r,r:d,now:u}=(0,y.useCtx)(15e3),x=E(r,u),[T,I]=(0,c.useState)(2),[$,P]=(0,c.useState)(!1),[O,B]=(0,c.useState)(n??null),z=(0,v.usePlan)(r),N=(0,k.useBookings)(r),A=(0,D.useBlocks)(e=>e.blocks),R=(0,D.closedAreasAt)(A,r,(0,w.ymd)(u),(0,w.hm)(u)),_=b.default.useMemo(()=>{const e=Object.fromEntries(Object.entries(x).map(([e,t])=>[e,{status:t.busy?'seated':'free'}]));return(0,j.suggestTable)(z,N.filter(e=>e.date===(0,w.ymd)(u)),e,T,u,(0,j.turnFor)(T,d.settings.turnMins),90,void 0,{closed:R})?.table??null},[z,N,x,T,R.size,u.getTime()]);(0,c.useEffect)(()=>{O&&(0,v.tablesOf)(O).some(e=>'Closed'===x[e]?.label)&&B(null)},[O,R.size]);const[q,V]=(0,c.useState)(!1),[Y,G]=(0,c.useState)(''),K=(e,t=String(e),s=()=>{P(!1),I(e)})=>{const o='9+'===t?$:!$&&T===e;return(0,F.jsx)(p.default,{accessibilityRole:"button",accessibilityLabel:'9+'===t?'Party of 9 or more':`Party of ${e}`,accessibilityState:{selected:o},onPress:s,style:{width:i?58:60,height:i?58:56,borderRadius:14,borderWidth:2,borderColor:S.colours.gold,alignItems:'center',justifyContent:'center',backgroundColor:o?S.colours.gold:'transparent'},children:(0,F.jsx)(C.T,{weight:"bold",size:22,colour:o?S.colours.onGold:S.colours.gold,children:t})},t)},Q=(0,F.jsx)(s.PartySizeInput,{value:T,onChange:I,min:9,max:o.MAX_PARTY,label:"Walk-in party size",testID:"walkin-party-size"}),X=(0,F.jsxs)(m.default,{style:{gap:8,width:i?256:void 0},children:[(0,F.jsx)(C.T,{weight:"semibold",children:"How many people?"}),(0,F.jsxs)(m.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:8},testID:"walkin-party",children:[U.map(e=>K(e)),K(9,'9+',()=>{P(!0),I(e=>e>=9?e:9)})]}),$?Q:null]}),[J,Z]=(0,c.useState)(!1),ee=async(t=O)=>{if(!J&&(0,M.guardBookingChange)(L)){Z(!0);try{const s=await k.repo.bookings.seatWalkIn(r,T,t??void 0,Y);W(r,t??void 0),a(s),e()}finally{Z(!1)}}},te=(0,F.jsxs)(m.default,{style:{gap:8,flex:i?1:void 0,minWidth:0},children:[(0,F.jsxs)(C.Row,{style:{justifyContent:'space-between'},children:[(0,F.jsxs)(C.T,{weight:"semibold",children:["Table ",(0,F.jsx)(C.T,{colour:S.colours.muted,size:14,children:"(optional)"})]}),O?(0,F.jsx)(C.Button,{small:!0,kind:"ghost",label:"Clear table",onPress:()=>B(null)}):null]}),(0,F.jsx)(H,{use:x,value:O,onPick:e=>{x[e]&&!x[e].busy?ee(e):B(O===e?null:e)},big:i,dense:i,best:_,bestSet:(0,h.bestTables)(z)}),(0,F.jsxs)(C.Muted,{children:["Tap a free table to seat them there",_&&!O?` (suggested for ${T}: ${(0,l.tableNumbers)(_)})`:'',", or Seat for no table yet. BEST marks the venue\u2019s best tables."]})]});return(0,F.jsxs)(C.Sheet,{visible:!0,onClose:e,title:`Walk-in \xb7 ${(0,w.hm)(u)}`,maxWidth:i?1100:void 0,testID:"walkin-sheet",children:[(0,F.jsx)(C.Button,{label:`Seat walk-in \xb7 ${T} ${1===T?'person':'people'}${O?` \xb7 ${(0,l.tableNumbers)(O)}`:''}`,disabled:J,onPress:()=>{ee()},testID:"seat-walkin",style:{minHeight:52}}),i?(0,F.jsxs)(C.Row,{gap:16,style:{alignItems:'flex-start'},children:[X,te]}):(0,F.jsxs)(F.Fragment,{children:[X,te]}),(0,F.jsxs)(C.Row,{gap:10,wrap:!0,style:{alignItems:'center'},children:[q?(0,F.jsx)(t.TextInput,{accessibilityLabel:"Walk-in note",placeholder:"Note (optional), e.g. high chair",placeholderTextColor:"#7D776C",value:Y,onChangeText:G,style:[C.styles.input,{flex:1,minWidth:220}],autoFocus:!0}):(0,F.jsx)(C.Button,{small:!0,kind:"ghost",label:"Add a note (optional)",onPress:()=>V(!0)}),(0,F.jsx)(m.default,{style:{flex:1,minWidth:220},children:(0,F.jsxs)(C.Muted,{children:["No name needed. Counts in today's covers.",'staff'!==f.APP_VARIANT?' Using website bookings too? Mark the table there as well.':'']})})]})]})}function V({booking:e,onClose:t,combine:s}){const{rid:o,r:a,now:i}=(0,y.useCtx)(15e3),n=E(o,i),r=(0,v.usePlan)(o),d=(0,k.useBookings)(o),u=(0,v.tablesOf)(e.table),p=b.default.useMemo(()=>Object.fromEntries(Object.entries(n).map(([e,t])=>[e,u.includes(e)?{busy:!1,label:'This party',soon:'This party'}:t])),[n,e.table]),f=b.default.useMemo(()=>{const t=Object.fromEntries(Object.entries(p).map(([e,t])=>[e,{status:t.busy?'seated':'free'}]));return(0,j.suggestTable)(r,d.filter(e=>e.date===(0,w.ymd)(i)),t,e.partySize,i,(0,j.turnFor)(e.partySize,a.settings.turnMins),90,e.id)?.table??null},[r,d,p,e.partySize,i.getTime()]),[x,T]=(0,c.useState)(!!s||u.length>1),[D,I]=(0,c.useState)(u),$=e=>r.tables.find(t=>t.name===e)?.maxSeats??0,P=D.reduce((e,t)=>e+$(t),0),O=D.length>0&&P{if(!(0,M.guardBookingChange)(L))return;const l=(0,v.joinTables)(s);await k.repo.bookings.assignTable(e.id,l);u.filter(e=>!s.includes(e)).forEach(t=>v.useFloor.getState().setLive(o,t,{stage:void 0,dirty:'seated'===e.status})),'seated'===e.status&&W(o,l),t()},z=x?(0,F.jsxs)(m.default,{style:{gap:8},testID:"assign-table-tip",children:[(0,F.jsx)(m.default,{accessibilityLiveRegion:"polite",children:(0,F.jsx)(C.T,{size:17,weight:"semibold",colour:S.colours.text,children:D.length?`${(0,v.tablesLabel)((0,v.joinTables)(D))} \xb7 ${P} seats for ${e.partySize} Covers`:'No tables picked yet'})}),O?(0,F.jsx)(m.default,{testID:"combine-short",children:(0,F.jsxs)(C.T,{size:15,weight:"semibold",colour:"#FFD9D4",children:["Not enough seats yet: ",e.partySize-P," more needed. Add another table."]})}):null,(0,F.jsx)(C.T,{size:15,colour:S.colours.text,children:"Tap each table to add or remove it, then tap Done. All of them show as taken until the party has finished."}),(0,F.jsxs)(C.Row,{gap:8,wrap:!0,children:[(0,F.jsx)(C.Button,{label:"Done",testID:"combine-done",disabled:!D.length,accessibilityLabel:D.length?`Done, save ${(0,v.tableCardLabel)((0,v.joinTables)(D))}`:'Done',onPress:()=>B(D)}),(0,F.jsx)(C.Button,{kind:"ghost",label:"Cancel",onPress:t})]})]}):(0,F.jsx)(m.default,{style:{gap:8},testID:"assign-table-tip",children:(0,F.jsx)(C.T,{size:15,colour:S.colours.text,children:"Red tables are in use right now; you can still pick one (e.g. joining a table). BEST marks the venue\u2019s best tables. Big party? Tap Combine tables."})});return(0,F.jsxs)(C.Sheet,{visible:!0,onClose:t,title:`${x?'Combine tables':'Assign table'} \xb7 ${_(e)}`,testID:"assign-table-sheet",footer:z,children:[f&&!x?(0,F.jsx)(m.default,{testID:"assign-suggested",children:(0,F.jsxs)(C.T,{size:16,weight:"semibold",colour:S.colours.goldLight,accessibilityLabel:`Suggested for ${e.partySize}: ${(0,v.tableCardLabel)(f)}`,children:["Suggested for ",e.partySize,": ",(0,l.tableNumbers)(f)]})}):null,x?null:(0,F.jsx)(C.Button,{kind:"secondary",label:"Combine tables",testID:"combine-start",accessibilityLabel:"Combine tables: pick several tables for this party",onPress:()=>T(!0)}),(0,F.jsx)(H,{use:p,best:x?null:f,bestSet:(0,h.bestTables)(r),picked:x?D:void 0,onPick:x?e=>I(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]):async e=>{await B([e])}})]})}function Y(e){(0,u.notify)({id:`walkin:${e.id}`,testID:'walkin-toast',timeoutMs:6e3,title:`${_(e)} seated \xb7 ${e.table?`${(0,l.tableNumbers)(e.table)}`:'table to assign'} (${e.ref})`,actions:[{label:'Undo',testID:'undo-walkin',onPress:()=>k.repo.bookings.undoWalkIn(e.id)},{label:'OK',kind:'ghost'}]})}function G({date:e,onClose:t,wide:s,onSaved:u}){const{rid:b,r:h,now:p,role:f,meId:N}=(0,y.useCtx)(6e4);(0,d.useBlurOutside)();const A=(0,w.ymd)(p),[R,W]=(0,c.useState)(ee.blocks),[H,U]=(0,c.useState)(!1),[q,V]=(0,c.useState)(''),[Y,G]=(0,c.useState)(2),[K,Q]=(0,c.useState)(0),X=Math.min(K,Math.max(0,Y-1)),[J,Z]=(0,c.useState)(null),[ee,te]=(0,c.useState)(''),[se,oe]=(0,c.useState)(''),[le,ae]=(0,c.useState)(''),[ie,ne]=(0,c.useState)('phone'),[re,de]=(0,c.useState)((0,$.emptyNeeds)()),ue=(0,$.needsMissing)(re),[ce,be]=(0,c.useState)(null),ge=(0,v.usePlan)(b),he=(0,B.dogSetUp)(ge),pe=!0===re.dog&&he,me=re.dog?re.dogs:0,fe=(0,w.parseYmd)(R),ye=(0,j.turnFor)(Y,h.settings.turnMins),ke=E.filter(e=>e.date===R),xe=e=>(0,j.freeTablesAt)(ge,ke,Y,new Date(`${R}${(0,l.tableNumbers)(e)}:00`),ye,h.settings.turnMins,{dog:!0,closed:(0,D.closedAreasAt)(_,b,R,e)}),je=pe&&J?xe(J):[];(0,c.useEffect)(()=>{be(null)},[pe,J,Y]);const we=(0,x.bookingSlots)(h,fe,e=>E.filter(t=>t.date===R&&t.time===e&&'cancelled'!==t.status&&!t.walkIn).reduce((e,t)=>e+t.partySize,0),Y,R===(0,w.ymd)(p)?p:(0,w.addMins)(fe,0),e=>E.filter(t=>t.date===R&&t.time===e&&'cancelled'!==t.status&&!t.walkIn).length),Se=(0,T.guestPhone)(se),[Te,Ce]=(0,c.useState)(!1),ve=J?we.find(e=>e.time===J):void 0,De=ve&&ve.left=2&&!!J&&(!$e||Te)&&(0,o.validParty)(Y)&&Se.ok&&(0,T.emailOk)(le)&&(!Pe||Oe&&H)&&(!pe||je.length>0)&&!Be,Me=re.wheelchair>0||re.stepFree;return(0,F.jsxs)(C.Sheet,{visible:!0,onClose:t,title:`New booking \xb7 ${(0,w.niceDate)(fe)}`,maxWidth:s?760:void 0,testID:"booking-sheet",children:[(0,F.jsx)($.FirstQuestions,{rid:b,value:re,onChange:de,party:Y,audience:"staff"}),re.dog&&!he?(0,F.jsx)(C.T,{size:13,colour:S.colours.amber,children:"Dog-friendly tables aren\u2019t marked yet. Managers \u203a Booking options \u203a Tables. Booking is allowed; check where the dog can sit."}):null,(0,F.jsx)(I.BookingDatePicker,{r:h,today:p,value:R,onChange:e=>{e!==R&&(W(e),Z(null),U(!1))}}),(0,F.jsxs)(C.Row,{gap:6,children:[(0,F.jsx)(C.Chip,{label:"Phone",selected:'phone'===ie,onPress:()=>ne('phone')}),(0,F.jsx)(C.Chip,{label:"In person",selected:'in-person'===ie,onPress:()=>ne('in-person')})]}),(0,F.jsx)(C.Field,{label:"Name",value:q,onChangeText:V,placeholder:"e.g. Reid",testID:"nb-name"}),(0,F.jsx)(C.Field,{label:"Mobile or phone number (needed)",value:se,onChangeText:oe,keyboardType:"phone-pad",placeholder:"e.g. 07700 900123",testID:"nb-phone"}),!Se.ok&&se?(0,F.jsx)(C.T,{size:13,colour:S.colours.amber,children:Se.error}):null,(0,F.jsx)(C.Field,{label:"Email (optional)",value:le,onChangeText:ae,keyboardType:"email-address",autoCapitalize:"none",placeholder:"For an email confirmation too",testID:"nb-email"}),(0,T.emailOk)(le)?null:(0,F.jsx)(C.T,{size:13,colour:S.colours.amber,children:"That email doesn\u2019t look quite right."}),(0,F.jsx)(n.AdultsChildren,{value:(0,r.peopleOf)(Y,X),onChange:e=>{G(e.partySize),Q(e.children),Ce(!1)},depositsOn:(0,i.depositOf)(h.settings).on&&(0,i.depositOf)(h.settings).perPersonPence>0,testID:"nb-people"}),(0,F.jsx)(C.Row,{wrap:!0,gap:6,children:we.map(e=>{const t=pe&&e.available&&!xe(e.time).length||!(0,$.dogTimeOk)(h,E,R,e.time,me);return(0,F.jsx)(C.Chip,{testID:`nb-slot-${e.time}`,label:e.time,sub:(0,D.blockAt)(_,b,R,e.time)?'Paused':t?'Dogs full':e.drinksOnly?'Drinks only':null!=e.partiesLeft&&e.partiesLeft<1||e.left<=0?'Full':`${e.left} left`,disabled:(e.past??!e.available)||t,selected:J===e.time,onPress:()=>{Z(e.time),U(!1),Ce(!1)}},e.time)})}),$e?(0,F.jsxs)(m.default,{testID:"nb-over-capacity",accessible:!0,accessibilityLiveRegion:"polite",style:{borderWidth:1.5,borderColor:S.colours.amber,backgroundColor:S.colours.amberBg,borderRadius:12,padding:10,gap:6},children:[De?(0,F.jsx)(C.T,{weight:"semibold",colour:S.colours.amber,children:(0,o.overCapacityNote)(Y,De.left,De.time)}):null,Ie?(0,F.jsx)(C.T,{weight:"semibold",colour:S.colours.amber,children:(0,o.overPartiesNote)(Ie.time,Ie.cap)}):null,(0,F.jsx)(C.Chip,{label:Te?'Booking over the limit: on':'Book anyway (over the limit)',selected:Te,onPress:()=>Ce(e=>!e),testID:"nb-over-ok"})]}):null,pe&&J?(0,F.jsxs)(m.default,{style:{gap:6},testID:"nb-dog-tables",children:[(0,F.jsxs)(C.T,{size:14,weight:"semibold",children:["Dog-friendly table ",(0,F.jsxs)(C.T,{size:13,colour:S.colours.muted,children:["(",ge.areas.filter(e=>e.dogs).map(e=>e.name).join(' or '),")"]})]}),je.length?(0,F.jsx)(C.Row,{wrap:!0,gap:6,children:je.slice(0,10).map((e,t)=>(0,F.jsx)(C.Chip,{label:`${(0,l.tableNumbers)(e.table)}`,sub:`${e.area} \xb7 ${e.seats}${0===t?' \xb7 best':''}${Me&&(0,B.accessibleSetUp)(ge)&&!(0,B.isAccessible)(ge,e.table)?' \xb7 not step-free':''}`,selected:(ce??je[0].table)===e.table,onPress:()=>be(e.table)},e.table))}):(0,F.jsxs)(C.T,{size:14,colour:S.colours.amber,children:["No dog-friendly table free for ",Y," at ",J,". Try another time."]})]}):null,Pe?(0,F.jsxs)(m.default,{testID:"nb-block-warning",style:{borderWidth:1.5,borderColor:S.colours.amber,backgroundColor:S.colours.amberBg,borderRadius:12,padding:10,gap:6},children:[(0,F.jsxs)(C.T,{weight:"semibold",colour:S.colours.amber,children:["Bookings are paused ",Pe.from,"\u2013",Pe.to,Pe.reason?` (${Pe.reason})`:'']}),Oe?(0,F.jsx)(C.Chip,{label:H?'Manager override on':'Override and book anyway',selected:H,onPress:()=>U(e=>!e)}):(0,F.jsx)(C.Muted,{children:"Ask a manager to override, or pick another time."})]}):null,we.length?null:(0,F.jsx)(m.default,{testID:"nb-closed",children:(0,F.jsxs)(C.T,{size:14,weight:"semibold",colour:S.colours.amber,children:["Closed on ",(0,w.niceDate)(fe)," (per the venue\u2019s opening hours). Pick another date."]})}),(0,F.jsx)($.MoreQuestions,{rid:b,r:h,value:re,onChange:de,party:Y,date:R,time:J,today:(0,w.ymd)(p),bookings:E,audience:"staff",showTables:!1!==h.settings.tableRequests}),Me&&!(0,B.accessibleSetUp)(ge)?(0,F.jsx)(C.T,{size:13,colour:S.colours.amber,children:"Step-free tables aren\u2019t marked yet (Managers \u203a Booking options \u203a Tables). Check the table works for a wheelchair."}):null,(0,F.jsx)(C.Field,{label:"Notes (optional)",value:ee,onChangeText:te,placeholder:P.NOTES_PLACEHOLDER,multiline:!0,numberOfLines:3,testID:"nb-notes"}),(0,i.depositDue)((0,i.depositOf)(h.settings),Y,X)?(0,F.jsxs)(C.Muted,{testID:"nb-deposit",children:["Deposit due: ",(0,a.gbp)((0,i.depositDue)((0,i.depositOf)(h.settings),Y,X))," (",(0,a.gbp)((0,i.depositOf)(h.settings).perPersonPence)," per adult for ",(0,i.depositOf)(h.settings).fromParty,"+",X?`; ${X} ${1===X?'child':'children'} free`:'; children free',"). Deposits are paid through website bookings or to you, never in CoverCharge: tick Deposit paid on the booking once the guest has paid."]}):null,(0,F.jsxs)(C.Muted,{children:["The guest gets a confirmation text",le.trim()?' and email':''," automatically (preview mode: shown in the Outbox, not sent)."]}),Be?(0,F.jsxs)(C.T,{size:14,colour:S.colours.amber,children:["We already have the most dogs we can look after at ",J,". Try another time: dogs are very welcome then."]}):null,(0,F.jsx)(C.Button,{label:ue.length?ue[0]:'Save booking',testID:"nb-save",disabled:!ze,onPress:()=>{if(R<(0,w.ymd)(p))return;if(!(0,M.guardBookingChange)(L))return;const e=(0,$.needsPatch)(re),s=re.tableReq.find(e=>!pe||je.some(t=>t.table===e)),o=pe?null:(0,z.requestedFreeTable)(re.tableReq,{date:R,time:J,partySize:Y},ge.tables.map(e=>e.name),ke,h.settings.turnMins);k.repo.bookings.create({restaurantId:b,customerId:null,name:q.trim(),partySize:Y,date:R,time:J,notes:ee.trim(),security:(0,i.depositDue)((0,i.depositOf)(h.settings),Y,X)?'deposit':'none',depositPaid:0,...X?{children:X}:{},...(0,i.depositDue)((0,i.depositOf)(h.settings),Y,X)?{depositDue:(0,i.depositDue)((0,i.depositOf)(h.settings),Y,X),depositPolicy:(0,i.depositWords)((0,i.depositOf)(h.settings),Y,h.name,X).join(' '),depositRefundable:(0,i.depositOf)(h.settings).refundable,depositCutoffHours:(0,i.depositOf)(h.settings).cutoffHours}:{},phone:Se.pretty,email:le.trim()||void 0,source:ie,...e,...we.find(e=>e.time===J)?.drinksOnly?{drinksOnly:!0}:{},allergies:e.allergies??[],...pe?{table:ce??s??je[0]?.table}:o?{table:o}:{}}).then(e=>(0,O.postNewBookingToKitchen)(e,N)).catch(()=>{}),u?.({date:R,time:J,name:q.trim()}),t()}})]})}},1094,[812,1095,1096,843,851,841,1097,1098,1099,1100,17,842,385,85,856,1055,858,1101,1074,863,804,848,777,996,993,1102,1103,1108,1076,1053,1092,1091,1109,8]); +__d(function(g,_r,_i,_a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"TABLES",{enumerable:!0,get:function(){return A}}),_e.useTableNames=R,_e.resetTableLive=W,_e.seatBookingNow=async function(e,t){await k.repo.bookings.setStatus(t.id,'seated'),W(e,t.table)},_e.finishBookingNow=async function(e,t){const s=(new Date).toISOString();await k.repo.bookings.update(t.id,(0,N.finishClearPatch)(s,t.table)),(0,v.tablesOf)(t.table).forEach(t=>v.useFloor.getState().setLive(e,t,{stage:void 0,dirty:!0}))},_e.useTableUse=E,Object.defineProperty(_e,"walkInLabel",{enumerable:!0,get:function(){return _}}),_e.TablePicker=H,_e.WalkInSheet=q,_e.AssignTableSheet=V,_e.undoNotice=Y,_e.NewBookingSheet=G,_e.useFrontDoor=function(e,t){const[s,o]=(0,c.useState)(!1),[l,a]=(0,c.useState)(!1),[i,n]=(0,c.useState)(null);return{openWalkIn:()=>o({}),openWalkInAt:e=>o({table:e}),openBooking:()=>a(!0),assignTable:e=>n({b:e}),combineTables:e=>n({b:e,combine:!0}),elements:(0,F.jsxs)(F.Fragment,{children:[s?(0,F.jsx)(q,{wide:t,initialTable:s.table,onClose:()=>o(!1),onSeated:Y}):null,l?(0,F.jsx)(G,{wide:t,date:e,onClose:()=>a(!1),onSaved:e=>(0,u.notify)({id:`booked:${Date.now()}`,testID:'booking-saved-toast',timeoutMs:5e3,icon:'\u2713',title:`Booked: ${e.name} \xb7 ${(0,w.niceDate)((0,w.parseYmd)(e.date))} at ${e.time}`})}):null,i?(0,F.jsx)(V,{booking:i.b,combine:i.combine,onClose:()=>n(null)}):null]})}};var t=_r(_d[0]),s=_r(_d[1]),o=_r(_d[2]),l=_r(_d[3]),a=_r(_d[4]),i=_r(_d[5]),n=_r(_d[6]),r=_r(_d[7]),d=_r(_d[8]),u=_r(_d[9]),c=_r(_d[10]),b=e(c),h=_r(_d[11]),p=e(_r(_d[12])),m=e(_r(_d[13])),f=_r(_d[14]),y=_r(_d[15]),k=_r(_d[16]),x=_r(_d[17]),j=_r(_d[18]),w=_r(_d[19]),S=_r(_d[20]),T=_r(_d[21]),C=_r(_d[22]),v=_r(_d[23]),D=_r(_d[24]),I=_r(_d[25]),$=_r(_d[26]),P=_r(_d[27]),O=_r(_d[28]),B=_r(_d[29]),z=_r(_d[30]),M=_r(_d[31]),N=_r(_d[32]),F=_r(_d[33]);const L=e=>(0,u.notify)({id:'booking-blocked',testID:'booking-blocked-toast',timeoutMs:9e3,icon:'\u26a0',title:e}),A=Array.from({length:12},(e,t)=>String(t+1));function R(e){const t=(0,v.usePlan)(e);return t.areas.flatMap(e=>t.tables.filter(t=>t.areaId===e.id).map(e=>e.name))}function W(e,t){(0,v.tablesOf)(t).forEach(t=>v.useFloor.getState().setLive(e,t,{stage:'seated',dirty:!1}))}function E(e,t){const s=(0,k.useBookings)(e),o=(0,k.useOrders)(e),l=R(e),a=(0,v.useFloor)(t=>t.live[e])??{},i=(0,v.usePlan)(e),n=(0,D.useBlocks)(e=>e.blocks),r=(0,w.ymd)(t),d=(0,D.closedAreasAt)(n,e,r,(0,w.hm)(t)),u={};for(const e of l)u[e]=a[e]?.blocked||d.has(`tbl:${e}`)?{busy:!0,label:'Blocked'}:d.has(i.tables.find(t=>t.name===e)?.areaId??'')?{busy:!0,label:'Closed'}:a[e]?.dirty?{busy:!0,label:'Needs clearing'}:{busy:!1,label:'Free'};for(const e of s)if(e.date===r&&e.table)for(const s of(0,v.tablesOf)(e.table))if(u[s])if('seated'===e.status)u[s]={busy:!0,label:`${e.walkIn?'Walk-in':`${e.name.slice(0,1)}.`} \xb7 ${e.partySize}`};else if('confirmed'===e.status&&!u[s].busy){const o=(0,w.minsBetween)(t,new Date(`${e.date}T${e.time}:00`));o>=-15&&o<=90&&(u[s]={...u[s],soon:`Booked ${e.time}`})}for(const e of o)'table'===e.type&&e.tableNo&&u[e.tableNo]&&!['closed','cancelled','collected'].includes(e.status)&&!u[e.tableNo].busy&&(u[e.tableNo]={busy:!0,label:'Open order'});return u}const _=e=>e.walkIn?`Walk-in \xb7 ${e.partySize}`:`${e.name} \xb7 ${e.partySize}`;function H({use:e,value:t,onPick:s,big:o,best:a,dense:i,bestSet:n,picked:r}){const d=Object.keys(e),[u,b]=(0,c.useState)(0),h=i?6:8,f=i?64:o?92:76,y=u?Math.max(3,Math.floor((u+h)/(f+h))):0,k=y?Math.floor((u-h*(y-1))/y):f,x=new Set(n??[]),j=a?(0,v.tablesOf)(a)[0]:null;return(0,F.jsx)(m.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:h},testID:"table-picker",onLayout:e=>b(Math.floor(e.nativeEvent.layout.width)),children:d.map(o=>{const a=e[o],n=t===o||!!r?.includes(o),d=x.has(o),u=j===o&&!n,c=a.busy?['Blocked','Needs clearing','Closed'].includes(a.label)?a.label:'In use':a.soon??'Free';return(0,F.jsxs)(p.default,{accessibilityRole:"button",testID:`pick-table-${o}`,accessibilityLabel:`Table ${(0,l.tableNumbers)(o)}${r?n?', picked':', not picked':''}, ${a.busy?`in use (${a.label})`:a.soon?`free, ${a.soon}`:'free'}${d?', best table':''}${u?', suggested for this party':''}`,accessibilityState:{selected:n,disabled:'Closed'===a.label},disabled:'Closed'===a.label,onPress:()=>s(o),style:{width:k,minHeight:i?58:64,borderRadius:12,borderWidth:n||u?2.5:1.5,paddingVertical:i?3:6,paddingHorizontal:4,alignItems:'center',justifyContent:'center',gap:2,borderColor:n||u?S.colours.gold:a.busy?S.colours.red:S.colours.ok,backgroundColor:n?S.colours.goldTint:a.busy?S.colours.redBg:S.colours.surface2,opacity:'Closed'!==a.label||n?1:.55},children:[(0,F.jsxs)(m.default,{style:{flexDirection:'row',alignItems:'center',gap:4},children:[(0,F.jsx)(C.T,{weight:"bold",size:22,colour:n?S.colours.goldLight:S.colours.text,children:(0,l.tableNumbers)(o)}),d?(0,F.jsx)(m.default,{testID:"best-table",style:{backgroundColor:S.colours.gold,borderRadius:5,paddingHorizontal:4,paddingVertical:1},children:(0,F.jsx)(C.T,{size:11,weight:"bold",colour:S.colours.onGold,children:"BEST"})}):null]}),(0,F.jsx)(C.T,{size:i?13:14,colour:a.busy?'#FFD9D4':a.soon?'#FFE2A8':'#E2C489',center:!0,numberOfLines:1,children:c})]},o)})})}const U=[1,2,3,4,5,6,7,8];function q({onClose:e,onSeated:a,wide:i,initialTable:n}){const{rid:r,r:d,now:u}=(0,y.useCtx)(15e3),x=E(r,u),[T,I]=(0,c.useState)(2),[$,P]=(0,c.useState)(!1),[O,B]=(0,c.useState)(n??null),z=(0,v.usePlan)(r),N=(0,k.useBookings)(r),A=(0,D.useBlocks)(e=>e.blocks),R=(0,D.closedAreasAt)(A,r,(0,w.ymd)(u),(0,w.hm)(u)),_=b.default.useMemo(()=>{const e=Object.fromEntries(Object.entries(x).map(([e,t])=>[e,{status:t.busy?'seated':'free'}]));return(0,j.suggestTable)(z,N.filter(e=>e.date===(0,w.ymd)(u)),e,T,u,(0,j.turnFor)(T,d.settings.turnMins),90,void 0,{closed:R})?.table??null},[z,N,x,T,R.size,u.getTime()]);(0,c.useEffect)(()=>{O&&(0,v.tablesOf)(O).some(e=>'Closed'===x[e]?.label)&&B(null)},[O,R.size]);const[q,V]=(0,c.useState)(!1),[Y,G]=(0,c.useState)(''),K=(e,t=String(e),s=()=>{P(!1),I(e)})=>{const o='9+'===t?$:!$&&T===e;return(0,F.jsx)(p.default,{accessibilityRole:"button",accessibilityLabel:'9+'===t?'Party of 9 or more':`Party of ${e}`,accessibilityState:{selected:o},onPress:s,style:{width:i?58:60,height:i?58:56,borderRadius:14,borderWidth:2,borderColor:S.colours.gold,alignItems:'center',justifyContent:'center',backgroundColor:o?S.colours.gold:'transparent'},children:(0,F.jsx)(C.T,{weight:"bold",size:22,colour:o?S.colours.onGold:S.colours.gold,children:t})},t)},Q=(0,F.jsx)(s.PartySizeInput,{value:T,onChange:I,min:9,max:o.MAX_PARTY,label:"Walk-in party size",testID:"walkin-party-size"}),X=(0,F.jsxs)(m.default,{style:{gap:8,width:i?256:void 0},children:[(0,F.jsx)(C.T,{weight:"semibold",children:"How many people?"}),(0,F.jsxs)(m.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:8},testID:"walkin-party",children:[U.map(e=>K(e)),K(9,'9+',()=>{P(!0),I(e=>e>=9?e:9)})]}),$?Q:null]}),[J,Z]=(0,c.useState)(!1),ee=async(t=O)=>{if(!J&&(0,M.guardBookingChange)(L)){Z(!0);try{const s=await k.repo.bookings.seatWalkIn(r,T,t??void 0,Y);W(r,t??void 0),a(s),e()}finally{Z(!1)}}},te=(0,F.jsxs)(m.default,{style:{gap:8,flex:i?1:void 0,minWidth:0},children:[(0,F.jsxs)(C.Row,{style:{justifyContent:'space-between'},children:[(0,F.jsxs)(C.T,{weight:"semibold",children:["Table ",(0,F.jsx)(C.T,{colour:S.colours.muted,size:14,children:"(optional)"})]}),O?(0,F.jsx)(C.Button,{small:!0,kind:"ghost",label:"Clear table",onPress:()=>B(null)}):null]}),(0,F.jsx)(H,{use:x,value:O,onPick:e=>{x[e]&&!x[e].busy?ee(e):B(O===e?null:e)},big:i,dense:i,best:_,bestSet:(0,h.bestTables)(z)}),(0,F.jsxs)(C.Muted,{children:["Tap a free table to seat them there",_&&!O?` (suggested for ${T}: ${(0,l.tableNumbers)(_)})`:'',", or Seat for no table yet. BEST marks the venue\u2019s best tables."]})]});return(0,F.jsxs)(C.Sheet,{visible:!0,onClose:e,title:`Walk-in \xb7 ${(0,w.hm)(u)}`,maxWidth:i?1100:void 0,testID:"walkin-sheet",children:[(0,F.jsx)(C.Button,{label:`Seat walk-in \xb7 ${T} ${1===T?'person':'people'}${O?` \xb7 ${(0,l.tableNumbers)(O)}`:''}`,disabled:J,onPress:()=>{ee()},testID:"seat-walkin",style:{minHeight:52}}),i?(0,F.jsxs)(C.Row,{gap:16,style:{alignItems:'flex-start'},children:[X,te]}):(0,F.jsxs)(F.Fragment,{children:[X,te]}),(0,F.jsxs)(C.Row,{gap:10,wrap:!0,style:{alignItems:'center'},children:[q?(0,F.jsx)(t.TextInput,{accessibilityLabel:"Walk-in note",placeholder:"Note (optional), e.g. high chair",placeholderTextColor:"#7D776C",value:Y,onChangeText:G,style:[C.styles.input,{flex:1,minWidth:220}],autoFocus:!0}):(0,F.jsx)(C.Button,{small:!0,kind:"ghost",label:"Add a note (optional)",onPress:()=>V(!0)}),(0,F.jsx)(m.default,{style:{flex:1,minWidth:220},children:(0,F.jsxs)(C.Muted,{children:["No name needed. Counts in today's covers.",'staff'!==f.APP_VARIANT?' Using website bookings too? Mark the table there as well.':'']})})]})]})}function V({booking:e,onClose:t,combine:s}){const{rid:o,r:a,now:i}=(0,y.useCtx)(15e3),n=E(o,i),r=(0,v.usePlan)(o),d=(0,k.useBookings)(o),u=(0,v.tablesOf)(e.table),p=b.default.useMemo(()=>Object.fromEntries(Object.entries(n).map(([e,t])=>[e,u.includes(e)?{busy:!1,label:'This party',soon:'This party'}:t])),[n,e.table]),f=b.default.useMemo(()=>{const t=Object.fromEntries(Object.entries(p).map(([e,t])=>[e,{status:t.busy?'seated':'free'}]));return(0,j.suggestTable)(r,d.filter(e=>e.date===(0,w.ymd)(i)),t,e.partySize,i,(0,j.turnFor)(e.partySize,a.settings.turnMins),90,e.id)?.table??null},[r,d,p,e.partySize,i.getTime()]),[x,T]=(0,c.useState)(!!s||u.length>1),[D,I]=(0,c.useState)(u),$=e=>r.tables.find(t=>t.name===e)?.maxSeats??0,P=D.reduce((e,t)=>e+$(t),0),O=D.length>0&&P{if(!(0,M.guardBookingChange)(L))return;const l=(0,v.joinTables)(s);await k.repo.bookings.assignTable(e.id,l);u.filter(e=>!s.includes(e)).forEach(t=>v.useFloor.getState().setLive(o,t,{stage:void 0,dirty:'seated'===e.status})),'seated'===e.status&&W(o,l),t()},z=x?(0,F.jsxs)(m.default,{style:{gap:8},testID:"assign-table-tip",children:[(0,F.jsx)(m.default,{accessibilityLiveRegion:"polite",children:(0,F.jsx)(C.T,{size:17,weight:"semibold",colour:S.colours.text,children:D.length?`${(0,v.tablesLabel)((0,v.joinTables)(D))} \xb7 ${P} seats for ${e.partySize} Covers`:'No tables picked yet'})}),O?(0,F.jsx)(m.default,{testID:"combine-short",children:(0,F.jsxs)(C.T,{size:15,weight:"semibold",colour:"#FFD9D4",children:["Not enough seats yet: ",e.partySize-P," more needed. Add another table."]})}):null,(0,F.jsx)(C.T,{size:15,colour:S.colours.text,children:"Tap each table to add or remove it, then tap Done. All of them show as taken until the party has finished."}),(0,F.jsxs)(C.Row,{gap:8,wrap:!0,children:[(0,F.jsx)(C.Button,{label:"Done",testID:"combine-done",disabled:!D.length,accessibilityLabel:D.length?`Done, save ${(0,v.tableCardLabel)((0,v.joinTables)(D))}`:'Done',onPress:()=>B(D)}),(0,F.jsx)(C.Button,{kind:"ghost",label:"Cancel",onPress:t})]})]}):(0,F.jsx)(m.default,{style:{gap:8},testID:"assign-table-tip",children:(0,F.jsx)(C.T,{size:15,colour:S.colours.text,children:"Red tables are in use right now; you can still pick one (e.g. joining a table). BEST marks the venue\u2019s best tables. Big party? Tap Combine tables."})});return(0,F.jsxs)(C.Sheet,{visible:!0,onClose:t,title:`${x?'Combine tables':'Assign table'} \xb7 ${_(e)}`,testID:"assign-table-sheet",footer:z,children:[f&&!x?(0,F.jsx)(m.default,{testID:"assign-suggested",children:(0,F.jsxs)(C.T,{size:16,weight:"semibold",colour:S.colours.goldLight,accessibilityLabel:`Suggested for ${e.partySize}: ${(0,v.tableCardLabel)(f)}`,children:["Suggested for ",e.partySize,": ",(0,l.tableNumbers)(f)]})}):null,x?null:(0,F.jsx)(C.Button,{kind:"secondary",label:"Combine tables",testID:"combine-start",accessibilityLabel:"Combine tables: pick several tables for this party",onPress:()=>T(!0)}),(0,F.jsx)(H,{use:p,best:x?null:f,bestSet:(0,h.bestTables)(r),picked:x?D:void 0,onPick:x?e=>I(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]):async e=>{await B([e])}})]})}function Y(e){(0,u.notify)({id:`walkin:${e.id}`,testID:'walkin-toast',timeoutMs:6e3,title:`${_(e)} seated \xb7 ${e.table?`${(0,l.tableNumbers)(e.table)}`:'table to assign'} (${e.ref})`,actions:[{label:'Undo',testID:'undo-walkin',onPress:()=>k.repo.bookings.undoWalkIn(e.id)},{label:'OK',kind:'ghost'}]})}function G({date:e,onClose:t,wide:s,onSaved:u}){const{rid:b,r:h,now:p,role:f,meId:N}=(0,y.useCtx)(6e4);(0,d.useBlurOutside)();const A=(0,w.ymd)(p),[R,W]=(0,c.useState)(ee.blocks),[H,U]=(0,c.useState)(!1),[q,V]=(0,c.useState)(''),[Y,G]=(0,c.useState)(2),[K,Q]=(0,c.useState)(0),X=Math.min(K,Math.max(0,Y-1)),[J,Z]=(0,c.useState)(null),[ee,te]=(0,c.useState)(''),[se,oe]=(0,c.useState)(''),[le,ae]=(0,c.useState)(''),[ie,ne]=(0,c.useState)('phone'),[re,de]=(0,c.useState)((0,$.emptyNeeds)()),ue=(0,$.needsMissing)(re),[ce,be]=(0,c.useState)(null),ge=(0,v.usePlan)(b),he=(0,B.dogSetUp)(ge),pe=!0===re.dog&&he,me=re.dog?re.dogs:0,fe=(0,w.parseYmd)(R),ye=(0,j.turnFor)(Y,h.settings.turnMins),ke=E.filter(e=>e.date===R),xe=e=>(0,j.freeTablesAt)(ge,ke,Y,new Date(`${R}${(0,l.tableNumbers)(e)}:00`),ye,h.settings.turnMins,{dog:!0,closed:(0,D.closedAreasAt)(_,b,R,e)}),je=pe&&J?xe(J):[];(0,c.useEffect)(()=>{be(null)},[pe,J,Y]);const we=(0,x.bookingSlots)(h,fe,e=>E.filter(t=>t.date===R&&t.time===e&&'cancelled'!==t.status&&!t.walkIn).reduce((e,t)=>e+t.partySize,0),Y,R===(0,w.ymd)(p)?p:(0,w.addMins)(fe,0),e=>E.filter(t=>t.date===R&&t.time===e&&'cancelled'!==t.status&&!t.walkIn).length),Se=(0,T.guestPhone)(se),[Te,Ce]=(0,c.useState)(!1),ve=J?we.find(e=>e.time===J):void 0,De=ve&&ve.left=2&&!!J&&(!$e||Te)&&(0,o.validParty)(Y)&&Se.ok&&(0,T.emailOk)(le)&&(!Pe||Oe&&H)&&(!pe||je.length>0)&&!Be,Me=re.wheelchair>0||re.stepFree;return(0,F.jsxs)(C.Sheet,{visible:!0,onClose:t,title:`New booking \xb7 ${(0,w.niceDate)(fe)}`,maxWidth:s?760:void 0,testID:"booking-sheet",children:[(0,F.jsx)($.FirstQuestions,{rid:b,value:re,onChange:de,party:Y,audience:"staff"}),re.dog&&!he?(0,F.jsx)(C.T,{size:13,colour:S.colours.amber,children:"Dog-friendly tables aren\u2019t marked yet. Managers \u203a Booking options \u203a Tables. Booking is allowed; check where the dog can sit."}):null,(0,F.jsx)(I.BookingDatePicker,{r:h,today:p,value:R,onChange:e=>{e!==R&&(W(e),Z(null),U(!1))}}),(0,F.jsxs)(C.Row,{gap:6,children:[(0,F.jsx)(C.Chip,{label:"Phone",selected:'phone'===ie,onPress:()=>ne('phone')}),(0,F.jsx)(C.Chip,{label:"In person",selected:'in-person'===ie,onPress:()=>ne('in-person')})]}),(0,F.jsx)(C.Field,{label:"Name",value:q,onChangeText:V,placeholder:"e.g. Reid",testID:"nb-name"}),(0,F.jsx)(C.Field,{label:"Mobile or phone number (needed)",value:se,onChangeText:oe,keyboardType:"phone-pad",placeholder:"e.g. 07700 900123",testID:"nb-phone"}),!Se.ok&&se?(0,F.jsx)(C.T,{size:13,colour:S.colours.amber,children:Se.error}):null,(0,F.jsx)(C.Field,{label:"Email (optional)",value:le,onChangeText:ae,keyboardType:"email-address",autoCapitalize:"none",placeholder:"For an email confirmation too",testID:"nb-email"}),(0,T.emailOk)(le)?null:(0,F.jsx)(C.T,{size:13,colour:S.colours.amber,children:"That email doesn\u2019t look quite right."}),(0,F.jsx)(n.AdultsChildren,{value:(0,r.peopleOf)(Y,X),onChange:e=>{G(e.partySize),Q(e.children),Ce(!1)},depositsOn:(0,i.depositOf)(h.settings).on&&(0,i.depositOf)(h.settings).perPersonPence>0,testID:"nb-people"}),(0,F.jsx)(C.Row,{wrap:!0,gap:6,children:we.map(e=>{const t=pe&&e.available&&!xe(e.time).length||!(0,$.dogTimeOk)(h,E,R,e.time,me);return(0,F.jsx)(C.Chip,{testID:`nb-slot-${e.time}`,label:e.time,sub:(0,D.blockAt)(_,b,R,e.time)?'Paused':t?'Dogs full':e.drinksOnly?'Drinks only':null!=e.partiesLeft&&e.partiesLeft<1||e.left<=0?'Full':`${e.left} left`,disabled:(e.past??!e.available)||t,selected:J===e.time,onPress:()=>{Z(e.time),U(!1),Ce(!1)}},e.time)})}),$e?(0,F.jsxs)(m.default,{testID:"nb-over-capacity",accessible:!0,accessibilityLiveRegion:"polite",style:{borderWidth:1.5,borderColor:S.colours.amber,backgroundColor:S.colours.amberBg,borderRadius:12,padding:10,gap:6},children:[De?(0,F.jsx)(C.T,{weight:"semibold",colour:S.colours.amber,children:(0,o.overCapacityNote)(Y,De.left,De.time)}):null,Ie?(0,F.jsx)(C.T,{weight:"semibold",colour:S.colours.amber,children:(0,o.overPartiesNote)(Ie.time,Ie.cap)}):null,(0,F.jsx)(C.Chip,{label:Te?'Booking over the limit: on':'Book anyway (over the limit)',selected:Te,onPress:()=>Ce(e=>!e),testID:"nb-over-ok"})]}):null,pe&&J?(0,F.jsxs)(m.default,{style:{gap:6},testID:"nb-dog-tables",children:[(0,F.jsxs)(C.T,{size:14,weight:"semibold",children:["Dog-friendly table ",(0,F.jsxs)(C.T,{size:13,colour:S.colours.muted,children:["(",ge.areas.filter(e=>e.dogs).map(e=>e.name).join(' or '),")"]})]}),je.length?(0,F.jsx)(C.Row,{wrap:!0,gap:6,children:je.slice(0,10).map((e,t)=>(0,F.jsx)(C.Chip,{label:`${(0,l.tableNumbers)(e.table)}`,sub:`${e.area} \xb7 ${e.seats}${0===t?' \xb7 best':''}${Me&&(0,B.accessibleSetUp)(ge)&&!(0,B.isAccessible)(ge,e.table)?' \xb7 not step-free':''}`,selected:(ce??je[0].table)===e.table,onPress:()=>be(e.table)},e.table))}):(0,F.jsxs)(C.T,{size:14,colour:S.colours.amber,children:["No dog-friendly table free for ",Y," at ",J,". Try another time."]})]}):null,Pe?(0,F.jsxs)(m.default,{testID:"nb-block-warning",style:{borderWidth:1.5,borderColor:S.colours.amber,backgroundColor:S.colours.amberBg,borderRadius:12,padding:10,gap:6},children:[(0,F.jsxs)(C.T,{weight:"semibold",colour:S.colours.amber,children:["Bookings are paused ",Pe.from,"\u2013",Pe.to,Pe.reason?` (${Pe.reason})`:'']}),Oe?(0,F.jsx)(C.Chip,{label:H?'Manager override on':'Override and book anyway',selected:H,onPress:()=>U(e=>!e)}):(0,F.jsx)(C.Muted,{children:"Ask a manager to override, or pick another time."})]}):null,we.length?null:(0,F.jsx)(m.default,{testID:"nb-closed",children:(0,F.jsxs)(C.T,{size:14,weight:"semibold",colour:S.colours.amber,children:["Closed on ",(0,w.niceDate)(fe)," (per the venue\u2019s opening hours). Pick another date."]})}),(0,F.jsx)($.MoreQuestions,{rid:b,r:h,value:re,onChange:de,party:Y,date:R,time:J,today:(0,w.ymd)(p),bookings:E,audience:"staff",showTables:!1!==h.settings.tableRequests}),Me&&!(0,B.accessibleSetUp)(ge)?(0,F.jsx)(C.T,{size:13,colour:S.colours.amber,children:"Step-free tables aren\u2019t marked yet (Managers \u203a Booking options \u203a Tables). Check the table works for a wheelchair."}):null,(0,F.jsx)(C.Field,{label:"Notes (optional)",value:ee,onChangeText:te,placeholder:P.NOTES_PLACEHOLDER,multiline:!0,numberOfLines:3,testID:"nb-notes"}),(0,i.depositDue)((0,i.depositOf)(h.settings),Y,X)?(0,F.jsxs)(C.Muted,{testID:"nb-deposit",children:["Deposit due: ",(0,a.gbp)((0,i.depositDue)((0,i.depositOf)(h.settings),Y,X))," (",(0,a.gbp)((0,i.depositOf)(h.settings).perPersonPence)," per adult for tables of ",(0,i.depositOf)(h.settings).fromParty,"+ adults",X?`; ${X} ${1===X?'child':'children'} free`:'; children free, and they do not count towards the number that needs a deposit',"). Staff can waive it. Deposits are paid through website bookings or to you, never in CoverCharge: tick Deposit paid on the booking once the guest has paid."]}):null,(0,F.jsxs)(C.Muted,{children:["The guest gets a confirmation text",le.trim()?' and email':''," automatically (preview mode: shown in the Outbox, not sent)."]}),Be?(0,F.jsxs)(C.T,{size:14,colour:S.colours.amber,children:["We already have the most dogs we can look after at ",J,". Try another time: dogs are very welcome then."]}):null,(0,F.jsx)(C.Button,{label:ue.length?ue[0]:'Save booking',testID:"nb-save",disabled:!ze,onPress:()=>{if(R<(0,w.ymd)(p))return;if(!(0,M.guardBookingChange)(L))return;const e=(0,$.needsPatch)(re),s=re.tableReq.find(e=>!pe||je.some(t=>t.table===e)),o=pe?null:(0,z.requestedFreeTable)(re.tableReq,{date:R,time:J,partySize:Y},ge.tables.map(e=>e.name),ke,h.settings.turnMins);k.repo.bookings.create({restaurantId:b,customerId:null,name:q.trim(),partySize:Y,date:R,time:J,notes:ee.trim(),security:(0,i.depositDue)((0,i.depositOf)(h.settings),Y,X)?'deposit':'none',depositPaid:0,...X?{children:X}:{},...(0,i.depositDue)((0,i.depositOf)(h.settings),Y,X)?{depositDue:(0,i.depositDue)((0,i.depositOf)(h.settings),Y,X),depositPolicy:(0,i.depositWords)((0,i.depositOf)(h.settings),Y,h.name,X).join(' '),depositRefundable:(0,i.depositOf)(h.settings).refundable,depositCutoffHours:(0,i.depositOf)(h.settings).cutoffHours}:{},phone:Se.pretty,email:le.trim()||void 0,source:ie,...e,...we.find(e=>e.time===J)?.drinksOnly?{drinksOnly:!0}:{},allergies:e.allergies??[],...pe?{table:ce??s??je[0]?.table}:o?{table:o}:{}}).then(e=>(0,O.postNewBookingToKitchen)(e,N)).catch(()=>{}),u?.({date:R,time:J,name:q.trim()}),t()}})]})}},1094,[812,1095,1096,843,851,841,1097,1098,1099,1100,17,842,385,85,856,1055,858,1101,1074,863,804,848,777,996,993,1102,1103,1108,1076,1053,1092,1091,1109,8]); __d(function(g,r,i,a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.PartySizeInput=function({value:e,onChange:p,min:b=s.MIN_PARTY,max:y=s.MAX_PARTY,label:f="Party size",testID:h="party-size"}){const[x,S]=(0,t.useState)(String(e));(0,t.useEffect)(()=>{S(String(e))},[e]);const T=e=>p((0,s.clampParty)(e,b,y)),$=(t,n,l)=>{const s=t<0?e<=b:e>=y;return(0,d.jsx)(o.default,{testID:`${h}-${t>0?'up':'down'}${10===Math.abs(t)?'10':''}`,accessibilityRole:"button",accessibilityLabel:l,accessibilityState:{disabled:s},disabled:s,onPress:()=>T(e+t),hitSlop:4,style:{minWidth:44,height:44,paddingHorizontal:8,borderRadius:22,borderWidth:1.5,borderColor:u.colours.gold,alignItems:'center',justifyContent:'center',opacity:s?.4:1},children:(0,d.jsx)(c.T,{size:10===Math.abs(t)?14:20,weight:"semibold",colour:u.colours.gold,center:!0,children:n})},t)};return(0,d.jsxs)(l.default,{testID:h,style:{flexDirection:'row',alignItems:'center',gap:6,flexWrap:'wrap',justifyContent:'center'},children:[y-b>=20?$(-10,'\u221210',"10 fewer people"):null,$(-1,'\u2212','One fewer person'),(0,d.jsx)(n.default,{testID:`${h}-input`,value:x,keyboardType:"number-pad",inputMode:"numeric",maxLength:3,selectTextOnFocus:!0,accessibilityLabel:`${f}, ${b} to ${y} people`,accessibilityValue:{min:b,max:y,now:e,text:`${e} ${1===e?'person':'people'}`},onChangeText:e=>{S(e.replace(/\D/g,'')),e.replace(/\D/g,'')&&T((0,s.partyFromText)(e,b,y))},onBlur:()=>{const e=(0,s.partyFromText)(x,b,y);S(String(e)),T(e)},returnKeyType:"done",blurOnSubmit:!0,onSubmitEditing:e=>{e?.target?.blur?.()},style:{width:64,height:44,borderRadius:10,borderWidth:1,borderColor:u.colours.border,color:u.colours.text,backgroundColor:u.colours.surface,textAlign:'center',fontSize:20,fontFamily:u.fonts.semibold}}),$(1,'+','One more person'),y-b>=20?$(10,'+10',"10 more people"):null]})};var t=r(_d[0]),o=e(r(_d[1])),n=e(r(_d[2])),l=e(r(_d[3])),s=r(_d[4]),u=r(_d[5]),c=r(_d[6]),d=r(_d[7])},1095,[17,385,395,85,1096,804,777,8]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"MAX_PARTY",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"MIN_PARTY",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"PARTY_RULE",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"validParty",{enumerable:!0,get:function(){return u}}),Object.defineProperty(e,"partyFromText",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"clampParty",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"overCapacityNote",{enumerable:!0,get:function(){return f}}),Object.defineProperty(e,"overPartiesNote",{enumerable:!0,get:function(){return b}});const t=100,n=1,o=`Bookings are for ${n} to ${t} people.`,u=o=>'number'==typeof o&&Number.isInteger(o)&&o>=n&&o<=t,c=(o,u=n,c=t)=>{const s=parseInt(String(o??'').replace(/\D/g,'').slice(0,4),10);return Math.max(u,Math.min(c,Number.isFinite(s)?s:u))},s=(o,u=n,c=t)=>Math.max(u,Math.min(c,Math.round(Number(o)||u))),f=(t,n,o)=>n<=0?`${o} is already full for booked Covers. Booking ${t} more goes over the venue\u2019s limit: check tables and staffing.`:`${t} is more than the ${n} Covers left at ${o}. Booking goes over the venue\u2019s limit by ${t-n}: check tables and staffing.`,b=(t,n)=>`${t} already has the most bookings we take at one start time (${n}). Booking another goes over the venue\u2019s limit: check tables and staffing.`},1096,[]); __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.AdultsChildren=function({value:e,onChange:t,depositsOn:h,testID:x="people"}){const p=e=>t((0,s.storedPeople)(e)),b=(0,s.totalLine)(e);return(0,o.jsxs)(l.default,{testID:x,style:{gap:8,alignItems:'center',width:'100%'},children:[(0,o.jsx)(u.T,{size:18,center:!0,weight:"semibold",children:"Adults"}),(0,o.jsx)(n.PartySizeInput,{value:e.adults,min:1,max:(0,s.maxAdults)(e.children),onChange:t=>p({adults:t,children:e.children}),label:"Adults",testID:`${x}-adults`}),(0,o.jsx)(u.T,{size:18,center:!0,weight:"semibold",children:"Children"}),(0,o.jsx)(n.PartySizeInput,{value:e.children,min:0,max:(0,s.maxKids)(e.adults),onChange:t=>p({adults:e.adults,children:t}),label:"Children",testID:`${x}-children`}),(0,o.jsx)(u.T,{size:18,center:!0,weight:"semibold",colour:c.colours.goldLight,testID:`${x}-total`,accessibilityLabel:b,children:b}),h?(0,o.jsx)(u.Muted,{center:!0,children:"Children never pay a deposit."}):null]})},r(d[0]);var e,t=r(d[1]),l=(e=t)&&e.__esModule?e:{default:e},s=r(d[2]),n=r(d[3]),u=r(d[4]),c=r(d[5]),o=r(d[6])},1097,[17,85,1098,1095,777,804,8]); @@ -1318,9 +1318,9 @@ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{v __d(function(g,_r,i,_a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"useChefAssistant",{enumerable:!0,get:function(){return I}}),Object.defineProperty(_e,"CHEF_PROMPTS",{enumerable:!0,get:function(){return P}}),_e.ChefAssistantButton=function({compact:e}){return e?(0,S.jsx)(u.default,{testID:"chef-assistant-open",accessibilityRole:"button",accessibilityLabel:"Assistant",onPress:()=>I.getState().setOpen(!0),style:{borderRadius:12,backgroundColor:w.colours.accentBg,borderWidth:1,borderColor:w.colours.accentBorder,paddingVertical:6,paddingHorizontal:12,minHeight:36,justifyContent:'center'},children:(0,S.jsx)(m.T,{weight:"semibold",colour:w.colours.goldLight,size:13,children:"\u2726 Assistant"})}):(0,S.jsx)(d.ActionTile,{primary:!0,testID:"chef-assistant-open",icon:"sparkle",label:"Assistant",sub:"Recipe card, order, allergens, GP, temps",accessibilityLabel:"Assistant",onPress:()=>I.getState().setOpen(!0)})},_e.ChefAssistantSheet=function({go:e}){const l=I(e=>e.open),d=()=>I.getState().setOpen(!1),{rid:f,me:W,menu:L,k:B,c:F}=(0,$.useChef)(3e4),G=(0,T.useSuggestions)(),E=(0,r.useSafetyView)('chef').points,[M,H]=(0,o.useState)([]),[N,_]=(0,o.useState)(''),[V,K]=(0,o.useState)(!1),[Y,q]=(0,o.useState)(!1),Q=(0,o.useRef)(null),U=(0,o.useRef)(null);if((0,o.useEffect)(()=>{setTimeout(()=>Q.current?.scrollToEnd?.({animated:!0}),50)},[M.length]),!l)return null;const J=(e,t=!1)=>H(n=>[...n,{id:R(),from:'bot',text:e,demo:t}]),X=e=>H(t=>[...t,{id:R(),from:'bot',plan:e,state:'open'}]),Z=L.filter(e=>!e.name.includes('(example)')||!0),ee=(t,n)=>{const r=A(t);if(!(0,s.chefCanSee)(f,t))return void J('That check is managed in the Managers app.');if(/\b(send|email|text|pay|delete|remove|order now|place the order)\b/.test(r)&&!/\b(build|draft|make|prepare)\b/.test(r))return void J('I can\u2019t send, pay for or delete anything. I can prepare it for you to check and do yourself, for example \u201cbuild the fish order\u201d.');const o=(0,y.parseQuick)(t,E).filter(e=>e.point&&(0,y.isTempKind)(e.point.kind));if(o.length&&(/\b(fridge|freezer|walk ?in|core|probe|cool|hot|deliver|degree|temp)/.test(r)||o.some(e=>null!=e.value))){const t=o.filter(e=>null!=e.value),r=o.filter(e=>null==e.value);if(r.length&&J(`I didn\u2019t hear a temperature for ${r.map(e=>e.point.name).join(', ')}. Say or type the reading, for example \u201c${r[0].point.name} 4 degrees\u201d. I never fill one in.`),!t.length)return;const s=t.filter(e=>!(0,y.inRange)(e.point,e.value));return void X({title:`Log ${1===t.length?'a reading':`${t.length} readings`} in the food safety log`,detail:t.map(e=>`${e.point.name}: ${e.value}\xb0C (${(0,y.limitText)(e.point)})${(0,y.inRange)(e.point,e.value)?'':' \xb7 OUT OF RANGE'}`).join('\n')+`\nSigned ${(0,y.initialsOf)(W)} \xb7 ${n?'voice':'typed'}`,warn:s.length?`${s.map(e=>e.point.name).join(', ')} out of range: you\u2019ll need to add the corrective action in the food safety log.`:void 0,confirm:'Log it',run:()=>{const r=(new Date).toISOString();return v.useSafety.getState().addEntries(t.map(e=>({pointId:e.point.id,name:e.point.name,kind:e.point.kind,at:r,by:W.replace(' (example)',''),byId:$.CHEF_ID,app:'chef',value:e.value,ok:(0,y.inRange)(e.point,e.value),source:n?'voice':'typed',initials:(0,y.initialsOf)(W)}))),s.length&&setTimeout(()=>e('haccp'),600),`Logged ${t.map(e=>`${e.point.name} ${e.value}\xb0C`).join(', ')}.${s.length?' Opening the food safety log for the corrective action.':''}`}})}if(/\b(fridge|freezer|temp|temperature|degrees)\b/.test(r))return void J('Which unit, and what does it read? For example \u201cprep fridge 4 degrees\u201d or \u201cfreezer minus 19\u201d. I only log the number you give me.');if(/allergen|allerg|contain|gluten|nut|dairy|milk|shellfish|crustacean|coeliac/.test(r)){const e=D(t,Z,e=>e.name);if(!e)return void J('Which dish? For example \u201callergens in the fish and chips\u201d.');const n=(0,j.recipeCards)().byMenuItem(e.id),r=e=>b.ALLERGENS.find(t=>t.id===e)?.label??e,s=Object.entries(e.allergens??{}).filter(([,e])=>'contains'===e).map(([e])=>r(e)),a=Object.entries(e.allergens??{}).filter(([,e])=>'may'===e).map(([e])=>r(e));return void J(`${e.name}: ${s.length?`contains ${s.join(', ')}`:'no allergens recorded as \u201ccontains\u201d'}${a.length?`; may contain ${a.join(', ')}`:''}. ${n?n.signOff?`From the signed-off recipe card (${n.signOff.by}).`:'The recipe card is awaiting your sign-off, so check it before telling a guest.':'There\u2019s no recipe card for it yet.'} Always check the card and the ingredients with the guest.`)}if(/\bgp\b|gross profit|margin|price for|what price|cost of|costing/.test(r)){const e=D(t,F,e=>e.item.name),n=Number((t.toLowerCase().match(/(\d{2})\s*(?:%|percent|per cent)/)??[])[1])||B.targetGp;if(!e)return void J(`Which dish? I can cost the dishes that have a recipe in GP & costing (${F.length} do). For example \u201cGP on the haddock\u201d.`);const r=(0,C.priceForTarget)(e.cost,n);return void J(`${e.item.name}: food cost ${(0,x.gbp)(e.cost)}, sells at ${(0,x.gbp)(e.priceInc)} (inc VAT) = ${e.gp.toFixed(1)}% GP. For ${n}% GP it would need ${(0,x.gbp)(r)} inc VAT. Prices are changed by a manager; I haven\u2019t changed anything.`)}if(/\border|supplier|delivery|par\b|restock/.test(r)){const n=D(t,G,e=>`${e.s.name} ${e.s.category??''}`)??(1===G.length?G[0]:void 0);return n?void X({title:`Build an order for ${n.s.name}`,detail:(n.lines.length?n.lines.map(e=>`${e.i.name}: ${(0,a.fishQtyText)(f,e.i,e.qty)}`).join('\n')+`\nAbout ${(0,x.gbp)(n.total)} at the latest prices.`:'Nothing is below par for this supplier yet.')+'\nI\u2019ll open it in Ordering for you to check, change and place yourself. Nothing is sent.',confirm:'Open the order',run:()=>(setTimeout(()=>{d(),e('orders',n.s.id)},400),`Opening the ${n.s.name} order. You check it and place it yourself.`)}):void J(G.length?`Which supplier? ${G.map(e=>e.s.name).join(', ')}.`:'Nothing is below par and no supplier orders today.')}if(/recipe|card|new dish|write up|spec/.test(r)){const n=t.replace(/^.*?(?:recipe card|card|recipe|dish|spec)\s*(?:for|of)?\s*/i,'').replace(/[.?!]+$/,'').trim();if(!n||n.length<3)return void J('What\u2019s the dish called? For example \u201cdraft a recipe card for crab linguine\u201d.');const r=n.replace(/^the\s+/i,'').replace(/^./,e=>e.toUpperCase()).slice(0,60),s=(0,j.recipeCards)().list(f).find(e=>A(e.dish)===A(r));return s?(J(`There\u2019s already a card for ${s.dish}. Opening Recipe cards.`),void setTimeout(()=>{d(),e('recipes')},600)):void X({title:`Draft a recipe card: ${r}`,detail:'A new card, awaiting your sign-off, with the dish name and section filled in. You add the ingredients, method, allergens, photo and price, then sign it off. It isn\u2019t shown to guests until you do.',confirm:'Make the draft',run:async()=>(await(0,j.recipeCards)().create(f,{dish:r,section:'Specials',price:null,ingredients:[],steps:[]},{name:W,role:'head-chef'}),setTimeout(()=>{d(),e('recipes')},500),`Draft card for ${r} saved, awaiting sign-off. Opening Recipe cards.`)})}const l='I can help with: drafting a recipe card, building a supplier order, a dish\u2019s allergens, GP pricing, and logging a temperature you read out. Try one of the suggestions.';(0,k.askServer)('chef',t,[]).then(e=>J('text'===e.kind?e.text:l)).catch(()=>J(l))},te=(e,t=!1)=>{const n=e.trim();if(n){_(''),H(e=>[...e,{id:R(),from:'you',text:n}]);try{ee(n,t)}catch(e){J(`Sorry, that didn\u2019t work: ${e.message}`)}}},ne=async e=>{if(e.plan){H(t=>t.map(t=>t.id===e.id?{...t,state:'done'}:t));try{J(String(await e.plan.run()))}catch(e){J(`Couldn\u2019t do that: ${e.message}`)}}},ie=e=>{H(t=>t.map(t=>t.id===e.id?{...t,state:'cancelled'}:t)),J('Cancelled. Nothing was changed.')},re=()=>{te(N,Y),q(!1)};return(0,S.jsx)(c.default,{visible:!0,transparent:!0,animationType:"fade",onRequestClose:d,children:(0,S.jsx)(p.default,{style:[m.styles.overlay,{justifyContent:'flex-end',padding:0}],children:(0,S.jsxs)(p.default,{testID:"chef-assistant",style:{backgroundColor:w.colours.surface,borderTopLeftRadius:18,borderTopRightRadius:18,borderWidth:1,borderColor:w.colours.border,width:'100%',maxWidth:640,alignSelf:'center',maxHeight:'92%',minHeight:'70%',padding:14,gap:10},children:[(0,S.jsxs)(m.Row,{style:{justifyContent:'space-between'},children:[(0,S.jsx)(m.T,{size:20,weight:"semibold",children:"\u2726 Kitchen Assistant"}),(0,S.jsx)(n.GoldClose,{testID:"chef-assistant-close",onPress:d,style:{marginRight:-6}})]}),(0,S.jsx)(p.default,{testID:"chef-assistant-demo",children:(0,S.jsx)(m.Badge,{kind:"amber",label:O})}),(0,S.jsxs)(h.default,{ref:Q,style:{flex:1},contentContainerStyle:{gap:10,paddingBottom:6},keyboardShouldPersistTaps:"handled",children:[0===M.length?(0,S.jsxs)(p.default,{style:{gap:8},children:[(0,S.jsxs)(m.T,{children:["Hi ",W.split(' ')[0],". Type or tap \ud83c\udfa4 and say what you need. I\u2019ll show you what I\u2019m about to do and wait for you to confirm. I never send, pay or delete."]}),P.map(e=>(0,S.jsx)(u.default,{accessibilityRole:"button",onPress:()=>te(e),style:{borderWidth:1,borderColor:w.colours.border,borderRadius:12,paddingVertical:9,paddingHorizontal:12,backgroundColor:w.colours.surface2},children:(0,S.jsx)(m.T,{size:14,children:e})},e))]}):null,M.map(e=>'you'===e.from?(0,S.jsx)(p.default,{style:{alignSelf:'flex-end',maxWidth:'85%',backgroundColor:'#3A2F12',borderRadius:14,padding:10},children:(0,S.jsx)(m.T,{children:e.text})},e.id):e.plan?(0,S.jsxs)(p.default,{testID:"chef-confirm-card",style:{borderWidth:1.5,borderColor:'open'===e.state?w.colours.gold:w.colours.border,borderRadius:14,padding:12,gap:8,backgroundColor:w.colours.surface2},children:[(0,S.jsx)(m.T,{weight:"semibold",children:e.plan.title}),(0,S.jsx)(m.T,{size:14,colour:w.colours.muted,children:e.plan.detail}),e.plan.warn?(0,S.jsxs)(m.T,{size:13,colour:w.colours.amber,children:["\u26a0 ",e.plan.warn]}):null,'open'===e.state?(0,S.jsxs)(m.Row,{gap:8,children:[(0,S.jsx)(m.Button,{small:!0,testID:"chef-confirm",label:e.plan.confirm,onPress:()=>ne(e)}),(0,S.jsx)(m.Button,{small:!0,kind:"ghost",label:"Cancel",onPress:()=>ie(e)})]}):(0,S.jsx)(m.Badge,{kind:'done'===e.state?'ok':'neutral',label:'done'===e.state?'Confirmed':'Cancelled: nothing done'}),'open'===e.state?(0,S.jsxs)(m.Muted,{children:["Nothing happens until you tap ",e.plan.confirm,"."]}):null]},e.id):(0,S.jsx)(p.default,{testID:"chef-assistant-reply",style:{alignSelf:'flex-start',maxWidth:'92%',backgroundColor:w.colours.surface2,borderRadius:14,padding:10},children:(0,S.jsx)(m.T,{children:e.text})},e.id))]}),(0,S.jsxs)(m.Row,{gap:8,children:[(0,S.jsx)(t.TextInput,{testID:"chef-assistant-input",accessibilityLabel:"Ask the Assistant",placeholder:"Type a kitchen task\u2026",placeholderTextColor:"#7D776C",value:N,onChangeText:e=>{_(e),e||q(!1)},onSubmitEditing:re,returnKeyType:"send",style:[m.styles.input,{flex:1,minWidth:0,width:40}]}),(0,S.jsx)(u.default,{testID:"chef-assistant-mic",accessibilityRole:"button",accessibilityLabel:V?'Stop listening':'Speak',onPress:()=>{const e=z();if(e)if(V)U.current?.stop?.();else try{const t=new e;U.current=t,t.lang='en-GB',t.interimResults=!1,t.maxAlternatives=1,t.onresult=e=>{const t=e.results?.[0]?.[0]?.transcript;t&&(_(t),q(!0))},t.onend=()=>K(!1),t.onerror=()=>{K(!1),J('Sorry, I didn\u2019t catch that. You can type instead.')},K(!0),t.start()}catch{K(!1),J('Voice input isn\u2019t available here. Please type instead.')}else J('Voice input isn\u2019t available in this browser. Please type instead.')},style:{width:48,height:48,borderRadius:24,borderWidth:1.5,borderColor:w.colours.gold,alignItems:'center',justifyContent:'center',backgroundColor:V?w.colours.gold:'transparent'},children:(0,S.jsx)(m.T,{size:20,children:"\ud83c\udfa4"})}),(0,S.jsx)(m.Button,{label:"Send",disabled:!N.trim(),onPress:re})]}),(0,S.jsx)(m.Muted,{center:!0,children:"Every action waits for your Confirm \xb7 nothing is sent, paid or deleted"})]})})})};var t=_r(_d[0]),n=_r(_d[1]),r=_r(_d[2]),s=_r(_d[3]),a=_r(_d[4]),o=_r(_d[5]),l=_r(_d[6]),d=_r(_d[7]),c=e(_r(_d[8]));_r(_d[9]);var u=e(_r(_d[10])),h=e(_r(_d[11])),p=e(_r(_d[12])),f=_r(_d[13]),m=_r(_d[14]),b=_r(_d[15]),y=_r(_d[16]),x=_r(_d[17]),j=_r(_d[18]),v=_r(_d[19]),w=_r(_d[20]),$=_r(_d[21]),C=_r(_d[22]),T=_r(_d[23]),k=_r(_d[24]),S=_r(_d[25]);const I=(0,f.create)(e=>({open:!1,setOpen:t=>e({open:t})})),R=()=>Math.random().toString(36).slice(2,9),P=['Draft a recipe card for crab linguine','Build the fish order','What allergens are in the fish and chips?','What price gives 70% GP on the lobster?','Walk-in fridge 3.5 degrees'],O='The secure AI server: not set up yet',A=e=>e.toLowerCase().replace(/[^a-z0-9 ]/g,' ').replace(/\s+/g,' ').trim(),W=new Set(['the','and','with','for','our','house','served','side','of','in','on','from']);function D(e,t,n){const r=` ${A(e)} `;let s,a=0;for(const e of t){const t=A(n(e).replace(/\(example\)/i,'')).split(' ').filter(e=>e.length>2&&!W.has(e)),o=t.filter(e=>r.includes(` ${e} `)||r.includes(` ${e}s `)).length,l=t.length?o/t.length+.01*o:0;o&&l>a&&(s=e,a=l)}return s}function z(){return'undefined'==typeof window?null:(0,l.speechRecognizer)()}},1235,[812,779,1207,820,943,17,890,1183,378,219,385,278,85,831,777,845,1002,851,867,1001,804,1140,1135,1163,891,8]); __d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"BOTTOM_TABS_HEIGHT",{enumerable:!0,get:function(){return h}}),_e.BottomTabs=function({tabs:e,active:b,onPress:y,background:x,tablist:p}){const{width:j}=(0,s.default)(),v=j/Math.max(1,e.length),w=v>=60?11:10,I=v<56?20:22,[F,S]=(0,t.useState)({}),[H,_]=(0,t.useState)(0),M=H>0&&e.some(e=>(F[e.id]??0)>H-6),z={flexDirection:'row',flexWrap:'nowrap',alignItems:'stretch',borderTopWidth:1,borderColor:c.colours.border,backgroundColor:x};return(0,f.jsx)(l.default,{testID:"app-bottom-tabs",accessibilityRole:p?'tablist':void 0,style:z,children:e.map(t=>{const s=b===t.id,x=s?c.colours.gold:c.colours.muted;return(0,f.jsxs)(n.default,{onLayout:t===e[0]?e=>_(e.nativeEvent.layout.width):void 0,testID:`tab-${t.id}`,accessibilityRole:"tab",accessibilityState:{selected:s},accessibilityLabel:t.a11y??t.label,onPress:()=>y(t.id),style:{flexGrow:1,flexShrink:1,flexBasis:0,minWidth:44,minHeight:h,alignItems:'center',justifyContent:'center',paddingVertical:4,paddingHorizontal:1,gap:2},children:[(0,f.jsxs)(l.default,{style:{width:I,height:I,alignItems:'center',justifyContent:'center'},children:[(0,f.jsx)(u.Icon,{name:t.icon,size:I,colour:x}),t.badge?(0,f.jsx)(l.default,{testID:t.badge.testID,style:{position:'absolute',right:-10,top:-5,backgroundColor:t.badge.bg,borderRadius:8,minWidth:16,height:16,paddingHorizontal:3,alignItems:'center',justifyContent:'center'},children:(0,f.jsx)(o.default,{style:{fontFamily:c.fonts.bold,fontSize:10,lineHeight:12,color:t.badge.fg??'#FFFFFF'},children:t.badge.text})}):null]}),(0,f.jsx)(l.default,{pointerEvents:"none","aria-hidden":!0,importantForAccessibility:"no-hide-descendants",accessibilityElementsHidden:!0,style:{position:'absolute',left:0,top:0,width:0,height:0,overflow:'hidden',opacity:0},children:(0,f.jsx)(l.default,{style:{width:400,flexDirection:'row',alignItems:'flex-start'},children:(0,f.jsx)(o.default,{onLayout:e=>{const n=Math.ceil(e.nativeEvent.layout.width);S(e=>e[t.id]===n?e:{...e,[t.id]:n})},style:{fontFamily:c.fonts.semibold,fontSize:w,lineHeight:Math.round(1.3*w),flexShrink:0},children:t.short??t.label})})}),M?null:(0,f.jsx)(o.default,{numberOfLines:1,style:{fontFamily:s?c.fonts.semibold:c.fonts.regular,fontSize:w,lineHeight:Math.round(1.3*w),color:x,textAlign:'center',alignSelf:'center',maxWidth:'100%'},children:t.short??t.label})]},t.id)})})};var t=r(d[0]),n=e(r(d[1])),o=e(r(d[2])),l=e(r(d[3])),s=e(r(d[4])),c=r(d[5]),u=r(d[6]),f=r(d[7]);const h=56},1236,[17,385,329,85,409,804,1184,8]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return f}});var t=r(d[0]);r(d[1]);var n=r(d[2]),u=r(d[3]),c=r(d[4]);function f(){return(0,u.canShow)('chef')?(0,c.jsx)(n.ChefApp,{}):(0,c.jsx)(t.Redirect,{href:u.ENTRY[u.APP_VARIANT]})}},1237,[13,17,775,856,8]); -__d(function(g,_r,_i,_a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return A}});var e,t=_r(d[0]),o=_r(d[1]),n=_r(d[2]),s=_r(d[3]),l=_r(d[4]),i=_r(d[5]),a=_r(d[6]),r=_r(d[7]),u=(e=r)&&e.__esModule?e:{default:e},c=_r(d[8]),h=_r(d[9]),p=_r(d[10]),b=_r(d[11]),f=_r(d[12]),y=_r(d[13]),x=_r(d[14]),k=_r(d[15]),j=_r(d[16]),v=_r(d[17]),S=_r(d[18]),w=_r(d[19]),T=_r(d[20]),C=_r(d[21]),D=_r(d[22]),$=_r(d[23]),P=_r(d[24]),M=_r(d[25]),B=_r(d[26]),O=_r(d[27]);function A(){const{rid:e,date:r}=(0,s.useLocalSearchParams)(),A=(0,j.useRestaurant)(e),N=(0,j.useCustomer)(),z=(0,j.useBookings)(e),I=(0,j.useEvents)(e),R=(0,j.useNow)(6e4),[q]=(0,l.useState)(()=>(0,a.startForm)()),[F,L]=(0,l.useState)(''),[E,H]=(0,l.useState)(2),[W,_]=(0,l.useState)(0),Y=Math.min(W,Math.max(0,E-1)),[U,G]=(0,l.useState)(r??(0,k.ymd)(R)),[Q,V]=(0,l.useState)(null),[J,K]=(0,l.useState)(N.name),[X,Z]=(0,l.useState)(N.phone??''),[ee,te]=(0,l.useState)(N.email??''),[oe,ne]=(0,l.useState)(!1),[se,le]=(0,l.useState)(''),[ie,ae]=(0,l.useState)(!1),[re,de]=(0,l.useState)([]),[ue,ce]=(0,l.useState)(!1),he=[...N.allergies,...re.filter(e=>!N.allergies.some(t=>t.allergen===e)).map(e=>({allergen:e,severity:'allergy'}))],[me,ge]=(0,l.useState)(null),pe=(0,C.useBlocks)(e=>e.blocks);(0,v.usePublicDayStore)(e=>e.n);const be=e?(0,v.publicDay)(e,U):null,fe=be?[...be.bookings,...z.filter(e=>e.date!==U)]:z,ye=be?[...pe.filter(t=>t.rid!==e||t.date!==U),...be.blocks]:pe,xe=(0,D.usePlan)(e),[ke,je]=(0,l.useState)((0,P.emptyNeeds)()),ve=!0===ke.dog,Se=ve?ke.dogs:0;if(!A)return(0,O.jsx)(b.Screen,{title:"Not found",children:(0,O.jsx)(b.T,{children:"Restaurant not found."})});const we=A.settings,Te=(0,k.parseYmd)(U),Ce=(0,x.onlinePartyBounds)(A),De=(0,C.blocksOn)(ye,A.id,U),$e=fe.filter(e=>e.date===U),Pe=xe.areas.filter(e=>e.dogs),Me=(0,M.dogSetUp)(xe),Be=e=>(0,$.freeTablesAt)(xe,$e,E,new Date(`${U}${(0,t.tableNumbers)(e)}:00`),(0,$.turnFor)(E,we.turnMins),we.turnMins,{dog:!0,closed:(0,C.closedAreasAt)(ye,A.id,U,e)}),Oe=(0,x.bookingSlots)(A,Te,e=>fe.filter(t=>t.date===U&&t.time===e&&!['cancelled','noshow'].includes(t.status)).reduce((e,t)=>e+t.partySize,0),E,R,e=>fe.filter(t=>t.date===U&&t.time===e&&!['cancelled','noshow'].includes(t.status)).length).map(e=>{const t=(0,C.blockAt)(ye,A.id,U,e.time),o=ve&&Me&&e.available&&!t&&(!Be(e.time).length||!(0,P.dogTimeOk)(A,fe,U,e.time,Se));return{...e,blocked:!!t,noDog:o,available:e.available&&!t&&!o}}),Ae=Oe.some(e=>e.available),Ne=(0,c.depositOf)(we),ze=(0,c.depositDue)(Ne,E,Y),Ie=ze>0?'deposit':'none',Re=(0,c.depositWords)(Ne,E,A.name,Y),qe=I.filter(e=>e.date===U),Fe=(0,T.guestPhone)(X),Le=(0,T.emailOk)(ee),Ee=(0,P.needsMissing)(ke,N.allergies),He=!!Q&&ie&&!Ee.length&&J.trim().length>1&&Fe.ok&&Le,We=async()=>{const e=(0,P.needsPatch)(ke,N.allergies),t=ve&&Me?Be(Q).map(e=>e.table):[],o=ve?ke.tableReq.find(e=>t.includes(e))??t[0]:void 0,n=await j.repo.bookings.create({restaurantId:A.id,customerId:N.id,name:J,partySize:E,...Y?{children:Y}:{},date:U,time:Q,notes:se.trim(),security:Ie,depositPaid:0,...ze?{depositDue:ze,depositPolicy:Re.join(' '),depositRefundable:Ne.refundable,depositCutoffHours:Ne.cutoffHours}:{},phone:Fe.pretty,email:ee.trim()||void 0,source:'online',...e,...Oe.find(e=>e.time===Q)?.drinksOnly?{drinksOnly:!0}:{},allergies:e.allergies??he,...o?{table:o}:{}});(0,a.rememberGuard)(n.id,(0,a.guardFor)({...q,hp:F})),ge(n)},Ye=(0,j.useStore)(e=>me?e.bookings.find(e=>e.id===me.id)?.ref:void 0),Ue=e=>(0,w.waMeLink)(A.settings.whatsapp,(0,w.guestWhatsAppText)({name:e.name,ref:Ye??e.ref,date:e.date,time:e.time,partySize:e.partySize},A.name));if(me){const e='pending'===me.status;return(0,O.jsxs)(b.Screen,{title:e?'Booking request received':'Booking confirmed',subtitle:A.name,children:[(0,O.jsx)(b.Banner,{kind:e?'info':'success',title:`Reference ${Ye??me.ref}`,children:`${me.partySize} people \xb7 ${(0,k.niceDateYear)((0,k.parseYmd)(me.date))} at ${me.time}`}),e?(0,O.jsx)(b.Banner,{kind:"warn",title:"The team will confirm shortly",children:"For larger parties and special requests, a member of the team checks your booking first. Contact the venue if you need an update."}):null,(0,O.jsxs)(b.Card,{children:[(0,O.jsxs)(b.T,{children:["Name: ",me.name]}),(0,O.jsxs)(b.T,{children:["Mobile: ",me.phone]}),me.email?(0,O.jsxs)(b.T,{children:["Email: ",me.email]}):null,(0,O.jsxs)(b.T,{children:["Allergies shared with the restaurant: ",me.allergies.length?me.allergies.map(e=>`${(0,f.allergenLabel)(e.allergen)} (${(0,f.severityLabel)(e.severity)})`).join(', '):'none']}),me.notes?(0,O.jsxs)(b.T,{children:["Notes: ",me.notes]}):null,me.dog?(0,O.jsxs)(b.T,{children:["\ud83d\udc15 Dog coming too",me.table?` \xb7 dog-friendly table ${me.table}`:'']}):null,me.holds?.length?(0,O.jsxs)(b.T,{children:["Reserved: ",me.holds.map(e=>`${e.qty} \xd7 ${'item'===e.kind?(A.settings.reservables??M.ANCHORAGE_RESERVABLES).find(t=>t.id===e.id)?.name??'item':e.id}`).join(', ')," (the kitchen confirms it)"]}):null,me.tableReq?.length?(0,O.jsxs)(b.T,{children:["Table requested: ",me.tableReq.map(e=>`${(0,t.tableNumbers)(e)}`).join(' or ')," (not guaranteed, but we\u2019ll do our best)"]}):null,'deposit'===me.security&&me.depositDue?(0,O.jsxs)(b.T,{weight:"semibold",children:["Deposit due: ",(0,y.gbp)(me.depositDue),". ",A.name," will tell you how to pay it."]}):null,'deposit'===me.security&&me.depositPolicy?(0,O.jsx)(b.Muted,{children:me.depositPolicy}):null,(0,O.jsx)(b.Muted,{children:"Your booking details are shown above. If you need confirmation, contact the venue and quote your reference."}),(0,O.jsxs)(b.Muted,{children:["Need to change or cancel? Call ",A.phone," and quote ",Ye??me.ref,"."]})]}),Ue(me)?(0,O.jsxs)(u.default,{style:{gap:4},children:[(0,O.jsx)(b.Button,{kind:"secondary",label:"\ud83d\udcac Message us on WhatsApp",testID:"guest-whatsapp",onPress:()=>{const e=Ue(me);e&&(0,w.openWhatsApp)(e)}}),(0,O.jsx)(b.Muted,{size:13,children:"Opens WhatsApp with your booking details typed in. You can change the message before you send it."})]}):null,(0,O.jsx)(b.Button,{label:"Back to restaurant",onPress:()=>s.router.replace(`/customer/${A.id}`)})]})}return(0,O.jsxs)(b.Screen,{title:"Book a table",subtitle:A.name,footer:(0,O.jsx)(b.Button,{label:Ee.length?Ee[0]:E>(we.autoAcceptUpTo??7)?'Send booking request':'Confirm booking',disabled:!He,onPress:()=>We(),testID:"confirm-booking"}),children:[(0,O.jsx)(P.FirstQuestions,{rid:A.id,value:ke,onChange:e=>{e.dog===ke.dog&&e.dogs===ke.dogs||V(null),je(e)},party:E,audience:"guest",profile:N.allergies}),(0,O.jsxs)(b.Card,{children:[(0,O.jsxs)(u.default,{style:{gap:6,alignItems:'center'},children:[(0,O.jsx)(b.H2,{children:"Party size"}),(0,O.jsx)(o.PartySizeInput,{value:E,onChange:e=>{H(e),V(null)},min:Ce.min,max:Ce.max,label:"Party size",testID:"party-size"})]}),(0,O.jsx)(h.ChildrenCount,{guest:!0,party:E,value:Y,onChange:_,depositsOn:Ne.on&&Ne.perPersonPence>0,testID:"book-children"}),ze?(0,O.jsx)(b.Banner,{kind:"info",title:Y?`Deposit: ${(0,y.gbp)(ze)} for ${E-Y} adults (children free)`:`Deposit: ${(0,y.gbp)(ze)} for ${E} guests`,children:(0,O.jsx)(u.default,{style:{gap:4},children:Re.map(e=>(0,O.jsx)(b.T,{size:13,children:e},e))})}):Ne.on&&Ne.perPersonPence>0?(0,O.jsxs)(b.Muted,{children:["No deposit for fewer than ",Ne.fromParty," guests."]}):null,E>(we.autoAcceptUpTo??7)?(0,O.jsxs)(b.Muted,{children:["For ",E," people the team checks the booking first, then texts you to confirm."]}):null,ve&&Me?(0,O.jsxs)(b.Muted,{children:["Dogs are welcome in the ",Pe.map(e=>`${e.name}${e.outdoor?' (outdoors, weather permitting)':''}`).join(' and ')||'dog-friendly tables',". We\u2019ll only show times with a dog-friendly table",A.settings.maxDogsPerSlot?' and room for your dog':'',"."]}):null]}),(0,O.jsxs)(b.Card,{children:[(0,O.jsx)(b.H2,{children:"Date"}),(0,O.jsx)(B.CustomerDatePicker,{r:A,today:R,value:U,events:I,onChange:e=>{G(e),V(null)}}),qe.map(e=>(0,O.jsx)(b.Banner,{kind:"demo",title:e.title,children:e.description},e.id))]}),(0,O.jsxs)(b.Card,{children:[(0,O.jsx)(b.H2,{children:"Time"}),0===Oe.length?(0,O.jsx)(b.Muted,{children:"Closed on this day (per listed kitchen hours)."}):(0,O.jsx)(b.Row,{wrap:!0,gap:6,children:Oe.map(e=>(0,O.jsx)(b.Chip,{testID:`book-slot-${e.time}`,label:e.time,sub:e.available?e.drinksOnly?'Drinks only':void 0:e.blocked?'Unavailable':e.noDog?'No dog table':e.leftV(e.time)},e.time))}),De.length>0&&Oe.some(e=>e.blocked)?(0,O.jsx)(b.Banner,{kind:"info",title:Ae?'Some times aren\u2019t available online':'Online booking isn\u2019t available for this time',children:`We\u2019re not taking online bookings ${De.map(e=>`${e.from}\u2013${e.to}`).join(', ')} on ${(0,k.niceDate)(Te)}. Please give us a ring on ${A.phone??"the restaurant"} and we\u2019ll do our best to fit you in.`}):null,(()=>{const e=(0,n.lastFoodOn)(A,U);return e&&Oe.some(e=>e.drinksOnly)?(0,O.jsx)(b.Banner,{kind:"info",title:`Last food orders ${(0,n.fmt12)(e.time)}${'kitchen closes'!==e.reason?` (${e.reason})`:''}`,children:"Times marked \u201cDrinks only\u201d are after the kitchen\u2019s last food orders that day: you\u2019re welcome for drinks, but we can\u2019t serve food."}):null})(),ve&&Oe.some(e=>e.noDog)?(0,O.jsx)(b.Banner,{kind:"info",title:"Some times are full for dogs",children:`Times marked "No dog table" are full in the ${Pe.map(e=>e.name).join(' and ')}${A.settings.maxDogsPerSlot?' or already have the most dogs we can look after':''}${(0,C.closedAreasAt)(ye,A.id,U,Q??'12:00').size?', or the garden is closed for weather':''}. We\u2019d love to see you both, so please try one of the other times shown.`}):null,(0,O.jsx)(b.Muted,{children:(0,x.bookingLimitsHint)(A)})]}),(0,O.jsx)(P.MoreQuestions,{rid:A.id,r:A,value:ke,onChange:je,party:E,date:U,time:Q,today:(0,k.ymd)(R),bookings:fe,audience:"guest",showTables:!0}),(0,O.jsxs)(b.Card,{highlight:ie?void 0:S.colours.amber,children:[(0,O.jsx)(b.Field,{label:"Notes (optional)",value:se,onChangeText:le,placeholder:p.NOTES_PLACEHOLDER,multiline:!0,numberOfLines:3,testID:"book-notes"}),(0,O.jsx)(b.Toggle,{label:"I confirm the allergy information for this booking",value:ie,onChange:ae}),(0,O.jsx)(b.Muted,{children:"Table requests aren\u2019t guaranteed, but we\u2019ll do our best. Nothing here is charged now; reserved dishes are paid on the night."})]}),(0,O.jsxs)(b.Card,{children:[(0,O.jsx)(b.H2,{children:"Your details"}),(0,O.jsx)(b.Field,{label:"Name for the booking",value:J,onChangeText:K}),(0,O.jsx)(b.Field,{testID:"book-phone",label:"Mobile number (needed to book)",value:X,onChangeText:Z,onBlur:()=>ne(!0),keyboardType:"phone-pad",autoComplete:"tel",placeholder:"e.g. 07700 900123"}),Fe.ok||!oe&&!X?null:(0,O.jsx)(b.T,{size:13,colour:S.colours.amber,children:Fe.error}),(0,O.jsx)(b.Field,{testID:"book-email",label:"Email (optional)",value:ee,onChangeText:te,keyboardType:"email-address",autoCapitalize:"none",autoComplete:"email",placeholder:"you@example.com"}),Le?null:(0,O.jsx)(b.T,{size:13,colour:S.colours.amber,children:"That email doesn\u2019t look quite right. Check it, or leave it blank."}),(0,O.jsxs)(b.Muted,{children:["We\u2019ll text you a confirmation",ee.trim()?' and email it too':'',", with how to change or cancel. We only use your number for this booking."]})]}),(0,O.jsx)(i.Honeypot,{value:F,onChange:L})]})}},1238,[843,1095,861,13,17,1239,963,85,841,1240,1108,777,845,851,1101,863,858,946,804,1181,848,993,996,1074,1103,1053,1241,8]); +__d(function(g,_r,_i,_a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return A}});var e,t=_r(d[0]),o=_r(d[1]),n=_r(d[2]),s=_r(d[3]),a=_r(d[4]),l=_r(d[5]),i=_r(d[6]),r=_r(d[7]),u=(e=r)&&e.__esModule?e:{default:e},c=_r(d[8]),h=_r(d[9]),p=_r(d[10]),b=_r(d[11]),f=_r(d[12]),y=_r(d[13]),x=_r(d[14]),k=_r(d[15]),j=_r(d[16]),v=_r(d[17]),w=_r(d[18]),S=_r(d[19]),C=_r(d[20]),T=_r(d[21]),D=_r(d[22]),$=_r(d[23]),P=_r(d[24]),M=_r(d[25]),B=_r(d[26]),O=_r(d[27]);function A(){const{rid:e,date:r}=(0,s.useLocalSearchParams)(),A=(0,j.useRestaurant)(e),N=(0,j.useCustomer)(),z=(0,j.useBookings)(e),I=(0,j.useEvents)(e),R=(0,j.useNow)(6e4),[q]=(0,a.useState)(()=>(0,i.startForm)()),[F,L]=(0,a.useState)(''),[E,H]=(0,a.useState)(2),[W,_]=(0,a.useState)(0),Y=Math.min(W,Math.max(0,E-1)),[U,G]=(0,a.useState)(r??(0,k.ymd)(R)),[Q,V]=(0,a.useState)(null),[J,K]=(0,a.useState)(N.name),[X,Z]=(0,a.useState)(N.phone??''),[ee,te]=(0,a.useState)(N.email??''),[oe,ne]=(0,a.useState)(!1),[se,ae]=(0,a.useState)(''),[le,ie]=(0,a.useState)(!1),[re,de]=(0,a.useState)([]),[ue,ce]=(0,a.useState)(!1),he=[...N.allergies,...re.filter(e=>!N.allergies.some(t=>t.allergen===e)).map(e=>({allergen:e,severity:'allergy'}))],[me,ge]=(0,a.useState)(null),pe=(0,T.useBlocks)(e=>e.blocks);(0,v.usePublicDayStore)(e=>e.n);const be=e?(0,v.publicDay)(e,U):null,fe=be?[...be.bookings,...z.filter(e=>e.date!==U)]:z,ye=be?[...pe.filter(t=>t.rid!==e||t.date!==U),...be.blocks]:pe,xe=(0,D.usePlan)(e),[ke,je]=(0,a.useState)((0,P.emptyNeeds)()),ve=!0===ke.dog,we=ve?ke.dogs:0;if(!A)return(0,O.jsx)(b.Screen,{title:"Not found",children:(0,O.jsx)(b.T,{children:"Restaurant not found."})});const Se=A.settings,Ce=(0,k.parseYmd)(U),Te=(0,x.onlinePartyBounds)(A),De=(0,T.blocksOn)(ye,A.id,U),$e=fe.filter(e=>e.date===U),Pe=xe.areas.filter(e=>e.dogs),Me=(0,M.dogSetUp)(xe),Be=e=>(0,$.freeTablesAt)(xe,$e,E,new Date(`${U}${(0,t.tableNumbers)(e)}:00`),(0,$.turnFor)(E,Se.turnMins),Se.turnMins,{dog:!0,closed:(0,T.closedAreasAt)(ye,A.id,U,e)}),Oe=(0,x.bookingSlots)(A,Ce,e=>fe.filter(t=>t.date===U&&t.time===e&&!['cancelled','noshow'].includes(t.status)).reduce((e,t)=>e+t.partySize,0),E,R,e=>fe.filter(t=>t.date===U&&t.time===e&&!['cancelled','noshow'].includes(t.status)).length).map(e=>{const t=(0,T.blockAt)(ye,A.id,U,e.time),o=ve&&Me&&e.available&&!t&&(!Be(e.time).length||!(0,P.dogTimeOk)(A,fe,U,e.time,we));return{...e,blocked:!!t,noDog:o,available:e.available&&!t&&!o}}),Ae=Oe.some(e=>e.available),Ne=(0,c.depositOf)(Se),ze=(0,c.depositDue)(Ne,E,Y),Ie=ze>0?'deposit':'none',Re=(0,c.depositWords)(Ne,E,A.name,Y),qe=I.filter(e=>e.date===U),Fe=(0,C.guestPhone)(X),Le=(0,C.emailOk)(ee),Ee=(0,P.needsMissing)(ke,N.allergies),He=!!Q&&le&&!Ee.length&&J.trim().length>1&&Fe.ok&&Le,We=async()=>{const e=(0,P.needsPatch)(ke,N.allergies),t=ve&&Me?Be(Q).map(e=>e.table):[],o=ve?ke.tableReq.find(e=>t.includes(e))??t[0]:void 0,n=await j.repo.bookings.create({restaurantId:A.id,customerId:N.id,name:J,partySize:E,...Y?{children:Y}:{},date:U,time:Q,notes:se.trim(),security:Ie,depositPaid:0,...ze?{depositDue:ze,depositPolicy:Re.join(' '),depositRefundable:Ne.refundable,depositCutoffHours:Ne.cutoffHours}:{},phone:Fe.pretty,email:ee.trim()||void 0,source:'online',...e,...Oe.find(e=>e.time===Q)?.drinksOnly?{drinksOnly:!0}:{},allergies:e.allergies??he,...o?{table:o}:{}});(0,i.rememberGuard)(n.id,(0,i.guardFor)({...q,hp:F})),ge(n)},Ye=(0,j.useStore)(e=>me?e.bookings.find(e=>e.id===me.id)?.ref:void 0),Ue=e=>(0,S.waMeLink)(A.settings.whatsapp,(0,S.guestWhatsAppText)({name:e.name,ref:Ye??e.ref,date:e.date,time:e.time,partySize:e.partySize},A.name));if(me){const e='pending'===me.status;return(0,O.jsxs)(b.Screen,{title:e?'Booking request received':'Booking confirmed',subtitle:A.name,children:[(0,O.jsx)(b.Banner,{kind:e?'info':'success',title:`Reference ${Ye??me.ref}`,children:`${me.partySize} people \xb7 ${(0,k.niceDateYear)((0,k.parseYmd)(me.date))} at ${me.time}`}),e?(0,O.jsx)(b.Banner,{kind:"warn",title:"The team will confirm shortly",children:"For larger parties and special requests, a member of the team checks your booking first. Contact the venue if you need an update."}):null,(0,O.jsxs)(b.Card,{children:[(0,O.jsxs)(b.T,{children:["Name: ",me.name]}),(0,O.jsxs)(b.T,{children:["Mobile: ",me.phone]}),me.email?(0,O.jsxs)(b.T,{children:["Email: ",me.email]}):null,(0,O.jsxs)(b.T,{children:["Allergies shared with the restaurant: ",me.allergies.length?me.allergies.map(e=>`${(0,f.allergenLabel)(e.allergen)} (${(0,f.severityLabel)(e.severity)})`).join(', '):'none']}),me.notes?(0,O.jsxs)(b.T,{children:["Notes: ",me.notes]}):null,me.dog?(0,O.jsxs)(b.T,{children:["\ud83d\udc15 Dog coming too",me.table?` \xb7 dog-friendly table ${me.table}`:'']}):null,me.holds?.length?(0,O.jsxs)(b.T,{children:["Reserved: ",me.holds.map(e=>`${e.qty} \xd7 ${'item'===e.kind?(A.settings.reservables??M.ANCHORAGE_RESERVABLES).find(t=>t.id===e.id)?.name??'item':e.id}`).join(', ')," (the kitchen confirms it)"]}):null,me.tableReq?.length?(0,O.jsxs)(b.T,{children:["Table requested: ",me.tableReq.map(e=>`${(0,t.tableNumbers)(e)}`).join(' or ')," (not guaranteed, but we\u2019ll do our best)"]}):null,'deposit'===me.security&&me.depositDue?(0,O.jsxs)(b.T,{weight:"semibold",children:["Deposit due: ",(0,y.gbp)(me.depositDue),". ",A.name," will tell you how to pay it."]}):null,'deposit'===me.security&&me.depositPolicy?(0,O.jsx)(b.Muted,{children:me.depositPolicy}):null,(0,O.jsx)(b.Muted,{children:"Your booking details are shown above. If you need confirmation, contact the venue and quote your reference."}),(0,O.jsxs)(b.Muted,{children:["Need to change or cancel? Call ",A.phone," and quote ",Ye??me.ref,"."]})]}),Ue(me)?(0,O.jsxs)(u.default,{style:{gap:4},children:[(0,O.jsx)(b.Button,{kind:"secondary",label:"\ud83d\udcac Message us on WhatsApp",testID:"guest-whatsapp",onPress:()=>{const e=Ue(me);e&&(0,S.openWhatsApp)(e)}}),(0,O.jsx)(b.Muted,{size:13,children:"Opens WhatsApp with your booking details typed in. You can change the message before you send it."})]}):null,(0,O.jsx)(b.Button,{label:"Back to restaurant",onPress:()=>s.router.replace(`/customer/${A.id}`)})]})}return(0,O.jsxs)(b.Screen,{title:"Book a table",subtitle:A.name,footer:(0,O.jsx)(b.Button,{label:Ee.length?Ee[0]:E>(Se.autoAcceptUpTo??7)?'Send booking request':'Confirm booking',disabled:!He,onPress:()=>We(),testID:"confirm-booking"}),children:[(0,O.jsx)(P.FirstQuestions,{rid:A.id,value:ke,onChange:e=>{e.dog===ke.dog&&e.dogs===ke.dogs||V(null),je(e)},party:E,audience:"guest",profile:N.allergies}),(0,O.jsxs)(b.Card,{children:[(0,O.jsxs)(u.default,{style:{gap:6,alignItems:'center'},children:[(0,O.jsx)(b.H2,{children:"Party size"}),(0,O.jsx)(o.PartySizeInput,{value:E,onChange:e=>{H(e),V(null)},min:Te.min,max:Te.max,label:"Party size",testID:"party-size"})]}),(0,O.jsx)(h.ChildrenCount,{guest:!0,party:E,value:Y,onChange:_,depositsOn:Ne.on&&Ne.perPersonPence>0,testID:"book-children"}),ze?(0,O.jsx)(b.Banner,{kind:"info",title:Y?`Deposit: ${(0,y.gbp)(ze)} for ${E-Y} adults (children don't count towards the ${Ne.fromParty} and don't pay)`:`Deposit: ${(0,y.gbp)(ze)} for ${E} adults`,children:(0,O.jsx)(u.default,{style:{gap:4},children:Re.map(e=>(0,O.jsx)(b.T,{size:13,children:e},e))})}):Ne.on&&Ne.perPersonPence>0?(0,O.jsxs)(b.Muted,{children:["No deposit for fewer than ",Ne.fromParty," adults. Children don't count towards the ",Ne.fromParty," and don't pay, and staff can waive a deposit."]}):null,E>(Se.autoAcceptUpTo??7)?(0,O.jsxs)(b.Muted,{children:["For ",E," people the team checks the booking first, then texts you to confirm."]}):null,ve&&Me?(0,O.jsxs)(b.Muted,{children:["Dogs are welcome in the ",Pe.map(e=>`${e.name}${e.outdoor?' (outdoors, weather permitting)':''}`).join(' and ')||'dog-friendly tables',". We\u2019ll only show times with a dog-friendly table",A.settings.maxDogsPerSlot?' and room for your dog':'',"."]}):null]}),(0,O.jsxs)(b.Card,{children:[(0,O.jsx)(b.H2,{children:"Date"}),(0,O.jsx)(B.CustomerDatePicker,{r:A,today:R,value:U,events:I,onChange:e=>{G(e),V(null)}}),qe.map(e=>(0,O.jsx)(b.Banner,{kind:"demo",title:e.title,children:e.description},e.id))]}),(0,O.jsxs)(b.Card,{children:[(0,O.jsx)(b.H2,{children:"Time"}),0===Oe.length?(0,O.jsx)(b.Muted,{children:"Closed on this day (per listed kitchen hours)."}):(0,O.jsx)(b.Row,{wrap:!0,gap:6,children:Oe.map(e=>(0,O.jsx)(b.Chip,{testID:`book-slot-${e.time}`,label:e.time,sub:e.available?e.drinksOnly?'Drinks only':void 0:e.blocked?'Unavailable':e.noDog?'No dog table':e.leftV(e.time)},e.time))}),De.length>0&&Oe.some(e=>e.blocked)?(0,O.jsx)(b.Banner,{kind:"info",title:Ae?'Some times aren\u2019t available online':'Online booking isn\u2019t available for this time',children:`We\u2019re not taking online bookings ${De.map(e=>`${e.from}\u2013${e.to}`).join(', ')} on ${(0,k.niceDate)(Ce)}. Please give us a ring on ${A.phone??"the restaurant"} and we\u2019ll do our best to fit you in.`}):null,(()=>{const e=(0,n.lastFoodOn)(A,U);return e&&Oe.some(e=>e.drinksOnly)?(0,O.jsx)(b.Banner,{kind:"info",title:`Last food orders ${(0,n.fmt12)(e.time)}${'kitchen closes'!==e.reason?` (${e.reason})`:''}`,children:"Times marked \u201cDrinks only\u201d are after the kitchen\u2019s last food orders that day: you\u2019re welcome for drinks, but we can\u2019t serve food."}):null})(),ve&&Oe.some(e=>e.noDog)?(0,O.jsx)(b.Banner,{kind:"info",title:"Some times are full for dogs",children:`Times marked "No dog table" are full in the ${Pe.map(e=>e.name).join(' and ')}${A.settings.maxDogsPerSlot?' or already have the most dogs we can look after':''}${(0,T.closedAreasAt)(ye,A.id,U,Q??'12:00').size?', or the garden is closed for weather':''}. We\u2019d love to see you both, so please try one of the other times shown.`}):null,(0,O.jsx)(b.Muted,{children:(0,x.bookingLimitsHint)(A)})]}),(0,O.jsx)(P.MoreQuestions,{rid:A.id,r:A,value:ke,onChange:je,party:E,date:U,time:Q,today:(0,k.ymd)(R),bookings:fe,audience:"guest",showTables:!0}),(0,O.jsxs)(b.Card,{highlight:le?void 0:w.colours.amber,children:[(0,O.jsx)(b.Field,{label:"Notes (optional)",value:se,onChangeText:ae,placeholder:p.NOTES_PLACEHOLDER,multiline:!0,numberOfLines:3,testID:"book-notes"}),(0,O.jsx)(b.Toggle,{label:"I confirm the allergy information for this booking",value:le,onChange:ie}),(0,O.jsx)(b.Muted,{children:"Table requests aren\u2019t guaranteed, but we\u2019ll do our best. Nothing here is charged now; reserved dishes are paid on the night."})]}),(0,O.jsxs)(b.Card,{children:[(0,O.jsx)(b.H2,{children:"Your details"}),(0,O.jsx)(b.Field,{label:"Name for the booking",value:J,onChangeText:K}),(0,O.jsx)(b.Field,{testID:"book-phone",label:"Mobile number (needed to book)",value:X,onChangeText:Z,onBlur:()=>ne(!0),keyboardType:"phone-pad",autoComplete:"tel",placeholder:"e.g. 07700 900123"}),Fe.ok||!oe&&!X?null:(0,O.jsx)(b.T,{size:13,colour:w.colours.amber,children:Fe.error}),(0,O.jsx)(b.Field,{testID:"book-email",label:"Email (optional)",value:ee,onChangeText:te,keyboardType:"email-address",autoCapitalize:"none",autoComplete:"email",placeholder:"you@example.com"}),Le?null:(0,O.jsx)(b.T,{size:13,colour:w.colours.amber,children:"That email doesn\u2019t look quite right. Check it, or leave it blank."}),(0,O.jsxs)(b.Muted,{children:["We\u2019ll text you a confirmation",ee.trim()?' and email it too':'',", with how to change or cancel. We only use your number for this booking."]})]}),(0,O.jsx)(l.Honeypot,{value:F,onChange:L})]})}},1238,[843,1095,861,13,17,1239,963,85,841,1240,1108,777,845,851,1101,863,858,946,804,1181,848,993,996,1074,1103,1053,1241,8]); __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.Honeypot=function({value:t,onChange:n}){return(0,l.jsx)(o.default,{"aria-hidden":!0,pointerEvents:"none",style:{position:'absolute',left:-1e4,top:0,width:1,height:1,overflow:'hidden',opacity:0},children:(0,l.jsx)(e.TextInput,{testID:"hp-field",accessibilityLabel:"Leave this empty",value:t,onChangeText:n,tabIndex:-1,autoComplete:'off',name:'cc_extra_info','aria-hidden':!0})})};var e=r(d[0]);r(d[1]),r(d[2]);var t,n=r(d[3]),o=(t=n)&&t.__esModule?t:{default:t},l=r(d[4])},1239,[812,17,219,85,8]); -__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"maxChildren",{enumerable:!0,get:function(){return u}}),_e.ChildrenCount=function({party:e,value:t,onChange:o,depositsOn:h,testID:c="children-count",guest:p}){const f=u(e);if(f<1)return null;const x=Math.min(t,f);return(0,s.jsxs)(n.default,{style:{gap:6,alignItems:'center',width:'100%'},testID:c,children:[(0,s.jsx)(l.T,{size:17,weight:"semibold",center:!0,children:p?`How many of the ${e} are children?`:`Children in the ${e}`}),(0,s.jsx)(l.Stepper,{value:x,onChange:e=>o(Math.max(0,Math.min(f,e))),min:0,max:f,label:"children",testID:`${c}-stepper`,format:e=>e?String(e):'None'}),h?(0,s.jsx)(l.Muted,{center:!0,children:"Children never pay a deposit."}):null]})},r(d[0]);var e,t=r(d[1]),n=(e=t)&&e.__esModule?e:{default:e},l=r(d[2]),s=r(d[3]);const u=e=>Math.max(0,Math.round(Number(e)||0)-1)},1240,[17,85,777,8]); +__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"maxChildren",{enumerable:!0,get:function(){return o}}),_e.ChildrenCount=function({party:e,value:t,onChange:u,depositsOn:h,testID:c="children-count",guest:p}){const f=o(e);if(f<1)return null;const x=Math.min(t,f);return(0,s.jsxs)(n.default,{style:{gap:6,alignItems:'center',width:'100%'},testID:c,children:[(0,s.jsx)(l.T,{size:17,weight:"semibold",center:!0,children:p?`How many of the ${e} are children?`:`Children in the ${e}`}),(0,s.jsx)(l.Stepper,{value:x,onChange:e=>u(Math.max(0,Math.min(f,e))),min:0,max:f,label:"children",testID:`${c}-stepper`,format:e=>e?String(e):'None'}),h?(0,s.jsx)(l.Muted,{center:!0,children:"Children don't count towards the number that needs a deposit, and never pay."}):null]})},r(d[0]);var e,t=r(d[1]),n=(e=t)&&e.__esModule?e:{default:e},l=r(d[2]),s=r(d[3]);const o=e=>Math.max(0,Math.round(Number(e)||0)-1)},1240,[17,85,777,8]); __d(function(g,_r,_i,a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.CustomerDatePicker=function({r:e,today:m,value:D,events:x,onChange:f}){const p=(0,n.ymd)(m),j=(0,r.lastBookableDay)(p,e),[C,w]=(0,t.useState)(!1),[Y,k]=(0,t.useState)((0,i.slashDay)(D)),[I,P]=(0,t.useState)(D);I!==D&&(P(D),k((0,i.slashDay)(D)));const T=new Date(m);T.setHours(12,0,0,0);const $=Array.from({length:b},(e,t)=>{const s=new Date(T);return s.setDate(T.getDate()+t),s}).filter(e=>(0,n.ymd)(e)<=j),v=t=>!!(0,o.hoursFor)(e,t),F=(0,n.parseYmd)(D),[L,M]=(0,t.useState)(()=>({y:F.getFullYear(),m:F.getMonth()})),S=(new Date(L.y,L.m,1,12).getDay()+6)%7,R=new Date(L.y,L.m+1,0).getDate(),A=[...Array.from({length:S},()=>null),...Array.from({length:R},(e,t)=>new Date(L.y,L.m,t+1,12))];for(;A.length%7;)A.push(null);const z=(0,n.parseYmd)(j),W=L.y>m.getFullYear()||L.y===m.getFullYear()&&L.m>m.getMonth(),B=L.yM(({y:t,m:s})=>{const l=new Date(t,s+e,1);return{y:l.getFullYear(),m:l.getMonth()}}),_=Y===(0,i.slashDay)(D)?null:(0,r.typedBookDateProblem)(Y,p,e),O=e=>{f(e),w(!1)},G=(e,t)=>0===t?'Today':1===t?'Tomorrow':`${(0,n.dayShort)(e)} ${e.getDate()}`,N=$.some(e=>(0,n.ymd)(e)===D);return(0,h.jsxs)(l.default,{testID:"cust-date",style:{gap:10,alignItems:'center',width:'100%'},children:[(0,h.jsx)(l.default,{accessible:!0,accessibilityLiveRegion:"polite",testID:"cust-date-chosen",children:(0,h.jsx)(d.T,{center:!0,weight:"semibold",colour:c.colours.goldLight,children:`Booking for ${(0,n.niceDateYear)(F)}${v(F)?'':' (closed that day)'}`})}),(0,h.jsxs)(d.Row,{wrap:!0,gap:6,style:{justifyContent:'center'},children:[$.map((e,t)=>{const s=(0,n.ymd)(e),l=x.some(e=>e.date===s);return(0,h.jsx)(d.Chip,{testID:`cust-day-${s}`,label:G(e,t),sub:v(e)?l?'\u2605 event':void 0:'Closed',disabled:!v(e),selected:D===s,accessibilityLabel:`${(0,n.niceDate)(e)}${v(e)?l?', event':'':', closed'}`,onPress:()=>O(s)},s)}),N?null:(0,h.jsx)(d.Chip,{label:(0,n.niceDate)(F),sub:v(F)?void 0:'Closed',selected:!0,onPress:()=>w(!0),accessibilityLabel:`Chosen: ${(0,n.niceDateYear)(F)}. Opens the calendar`})]}),(0,h.jsxs)(l.default,{style:{width:'100%',maxWidth:360,gap:4},children:[(0,h.jsx)(d.Field,{label:"Any other date (DD/MM/YYYY)",testID:"cust-date-typed",value:Y,placeholder:"24/12/2026",keyboardType:"numbers-and-punctuation",maxLength:10,autoCapitalize:"none",autoCorrect:!1,style:{textAlign:'center'},accessibilityLabel:"Booking date, typed as day, month and four-digit year",onChangeText:t=>{const s=(0,i.slashDate)(t,Y);k(s);const l=(0,i.dayFromSlash)(s);l&&!(0,r.typedBookDateProblem)(s,p,e)&&f(l)}}),_&&Y.length>=10?(0,h.jsx)(d.T,{center:!0,size:15,colour:c.colours.amber,testID:"cust-date-problem",children:_}):null]}),(0,h.jsx)(d.Button,{kind:"secondary",label:C?'Hide calendar':'\ud83d\udcc5 Pick a date from a calendar',testID:"cust-date-cal",style:{minHeight:48},accessibilityLabel:C?'Hide the calendar':'Pick a date from a month calendar',onPress:()=>{C||M({y:F.getFullYear(),m:F.getMonth()}),w(!C)}}),C?(0,h.jsxs)(l.default,{testID:"cust-calendar",style:{borderWidth:1,borderColor:c.colours.border,borderRadius:14,padding:10,gap:6,backgroundColor:c.colours.surface2,width:'100%',maxWidth:420},children:[(0,h.jsx)(l.default,{style:{alignItems:'flex-end'},children:(0,h.jsx)(u.GoldClose,{label:"Close the calendar",testID:"cust-calendar-close",onPress:()=>w(!1),size:"sm"})}),(0,h.jsxs)(d.Row,{style:{justifyContent:'space-between',alignItems:'center'},children:[(0,h.jsx)(s.default,{accessibilityRole:"button",accessibilityLabel:"Previous month",accessibilityState:{disabled:!W},disabled:!W,onPress:()=>H(-1),style:{minWidth:48,minHeight:48,alignItems:'center',justifyContent:'center',opacity:W?1:.3},children:(0,h.jsx)(d.T,{size:22,colour:c.colours.gold,children:"\u2039"})}),(0,h.jsxs)(d.T,{center:!0,weight:"semibold",accessibilityRole:"header",children:[(0,n.monthLong)(L.m)," ",L.y]}),(0,h.jsx)(s.default,{accessibilityRole:"button",accessibilityLabel:"Next month",accessibilityState:{disabled:!B},disabled:!B,onPress:()=>H(1),style:{minWidth:48,minHeight:48,alignItems:'center',justifyContent:'center',opacity:B?1:.3},children:(0,h.jsx)(d.T,{size:22,colour:c.colours.gold,children:"\u203a"})})]}),(0,h.jsx)(l.default,{style:{flexDirection:'row'},importantForAccessibility:"no-hide-descendants",children:y.map(e=>(0,h.jsx)(d.T,{size:12,colour:c.colours.muted,center:!0,style:{flex:1},children:e},e))}),Array.from({length:A.length/7},(e,t)=>(0,h.jsx)(l.default,{style:{flexDirection:'row',gap:4},children:A.slice(7*t,7*t+7).map((e,t)=>{if(!e)return(0,h.jsx)(l.default,{style:{flex:1,height:44}},t);const o=(0,n.ymd)(e),i=oj,r=o===D,u=!v(e);return(0,h.jsx)(s.default,{testID:`cust-cal-${o}`,accessibilityRole:"button",accessibilityLabel:`${(0,n.niceDateYear)(e)}${i?', not bookable online':u?', closed':''}`,accessibilityState:{disabled:i||u,selected:r},disabled:i||u,onPress:()=>O(o),style:{flex:1,height:44,borderRadius:10,alignItems:'center',justifyContent:'center',borderWidth:o===p?1.5:0,borderColor:c.colours.gold,backgroundColor:r?c.colours.gold:'transparent',opacity:i?.3:1},children:(0,h.jsx)(d.T,{size:15,center:!0,weight:r?'bold':'regular',colour:r?c.colours.onGold:u?c.colours.muted:c.colours.text,style:u&&!i?{textDecorationLine:'line-through'}:void 0,children:e.getDate()})},t)})},t)),(0,h.jsxs)(d.Muted,{center:!0,children:["Crossed-out days: closed. ",(0,r.bookAheadUnlimited)(e)?`You can book up to ${(0,i.slashDay)(j)}.`:`Online booking is open up to ${(0,i.slashDay)(j)}.`]})]}):null]})};var t=_r(_d[0]),s=e(_r(_d[1])),l=e(_r(_d[2])),o=_r(_d[3]),n=_r(_d[4]),i=_r(_d[5]),r=_r(_d[6]),c=_r(_d[7]),d=_r(_d[8]),u=_r(_d[9]),h=_r(_d[10]);const y=['Mon','Tue','Wed','Thu','Fri','Sat','Sun'],b=14},1241,[17,385,85,862,863,1031,1242,804,777,779,8]); __d(function(g,_r,i,a,_m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"SERVER_MAX_DAYS_AHEAD",{enumerable:!0,get:function(){return n}}),e.bookAheadDays=r,Object.defineProperty(e,"bookAheadUnlimited",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"lastBookableDay",{enumerable:!0,get:function(){return u}}),e.typedBookDateProblem=function(n,r,o){const s=(n??'').trim();if(!s)return'Type a date as DD/MM/YYYY, for example 24/12/2026.';const l=(0,t.dayFromSlash)(s);if(!l)return'That isn\u2019t a date yet. Type it as DD/MM/YYYY, for example 24/12/2026.';if(lc){const[t,n,r]=c.split('-');return`Online booking is open up to ${r}/${n}/${t}. For later dates, please call us.`}return null};var t=_r(_d[0]);const n=366;function r(t){const r=Number(t?.settings?.onlineBookDaysAhead);return Number.isFinite(r)&&r>=1?Math.min(Math.round(r),n):n}const o=t=>r(t)>=n,s=(t,n)=>{const r=new Date(t+'T12:00:00Z');return r.setUTCDate(r.getUTCDate()+n),r.toISOString().slice(0,10)},u=(t,n)=>s(t,r(n))},1242,[1031]); __d(function(_g,_r,i,_a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return b}});var n=_r(_d[0]),t=_r(_d[1]),s=_r(_d[2]),a=e(_r(_d[3])),l=e(_r(_d[4])),r=_r(_d[5]),o=_r(_d[6]),d=_r(_d[7]),c=_r(_d[8]),u=_r(_d[9]),h=_r(_d[10]),g=_r(_d[11]),p=_r(_d[12]),f=_r(_d[13]);function b(){const{rid:e,did:b}=(0,t.useLocalSearchParams)(),j=(0,h.useRestaurant)(e),x=(0,h.useMenu)(e).find(e=>e.id===b),y=(0,h.useCustomer)(),m=(0,h.useRecipeCards)(e).find(e=>e.id===x?.recipeCardId),k=m?.signOff&&m.photo?(0,g.recipeCards)().photoSource(m.photo):null,v=(0,h.useStore)(e=>e.addLine),w=(0,n.useTakeawayMenu)(n=>n.byVenue[e]),S=(0,h.useStore)(n=>n.basket.restaurantId===e&&'table'===n.basket.mode),[C,B]=(0,s.useState)(()=>(x?.optionGroups??[]).filter(e=>e.required).map(e=>e.choices[0].id)),[$,I]=(0,s.useState)(1),[P,T]=(0,s.useState)(''),[L,O]=(0,s.useState)(!1),[D,A]=(0,s.useState)(!1),[M,R]=(0,s.useState)(!1),[q,_]=(0,s.useState)(!1),N=(0,s.useMemo)(()=>x?(0,c.effectiveAllergens)(x,C):{},[x,C]);if(!j||!x)return(0,f.jsx)(d.Screen,{title:"Not found",children:(0,f.jsx)(d.T,{children:"Dish not found."})});const G=(0,c.conflictsFor)(N,y.allergies),Y=(x.price??0)+(x.optionGroups??[]).flatMap(e=>e.choices).filter(e=>C.includes(e.id)).reduce((e,n)=>e+n.priceDelta,0),z=S||j.fictional?'on':(0,n.takeawayAvail)(x,w),F=x.soldOut||!x.signOff||null===x.price||'on'!==z,Q=(e,n)=>{const t=x.optionGroups.find(n=>n.id===e);B(e=>{const s=t.choices.map(e=>e.id);return t.multi?e.includes(n)?e.filter(e=>e!==n):[...e,n]:e.includes(n)&&!t.required?e.filter(e=>e!==n):[...e.filter(e=>!s.includes(e)),n]})},V=e=>{h.useStore.getState().basket.restaurantId!==j.id&&h.useStore.getState().startBasket(j.id,'takeaway'),v({itemId:x.id,qty:$,choiceIds:C,notes:P,override:e?{allergens:G.contains,at:(new Date).toISOString()}:void 0}),O(!1),_(!0)};return(0,f.jsxs)(d.Screen,{title:x.name,subtitle:j.name,right:(0,f.jsx)(o.BasketButton,{}),children:[k?(0,f.jsx)(a.default,{testID:"dish-photo",source:k,accessibilityLabel:`${x.name}${'example'===m?.origin?' (example photo)':''}`,style:{width:'100%',height:200,borderRadius:12},resizeMode:"cover"}):null,(0,f.jsxs)(d.Row,{wrap:!0,gap:6,children:[(0,f.jsx)(d.T,{weight:"bold",size:20,colour:p.colours.gold,children:null===x.price?x.priceNote:(0,u.gbp)(Y)}),x.dietary.map(e=>(0,f.jsx)(d.Badge,{kind:"ok",label:e},e))]}),(0,f.jsx)(d.T,{children:x.description}),G.contains.length?(0,f.jsx)(d.Banner,{kind:"danger",title:`Blocked: contains ${G.contains.map(c.allergenLabel).join(', ')}`,children:`You\u2019ve told us: ${y.allergies.filter(e=>G.contains.includes(e.allergen)).map(e=>`${(0,c.allergenLabel)(e.allergen)} \u2014 ${(0,c.severityLabel)(e.severity)}`).join('; ')}. This dish can\u2019t be added unless you deliberately override (for example, ordering for someone else).`}):null,G.may.length?(0,f.jsx)(d.Banner,{kind:"warn",title:`Warning: may contain ${G.may.map(c.allergenLabel).join(', ')}`,children:"Cross-contact is possible (e.g. shared fryer). Please speak to staff before ordering."}):null,(x.optionGroups??[]).map(e=>(0,f.jsxs)(d.Card,{children:[(0,f.jsxs)(d.T,{weight:"semibold",children:[e.name,e.required?' (required)':' (optional)']}),(0,f.jsx)(d.Row,{wrap:!0,gap:6,children:e.choices.map(n=>(0,f.jsx)(d.Chip,{label:n.label,sub:n.priceDelta?`+${(0,u.gbp)(n.priceDelta)}`:void 0,selected:C.includes(n.id),onPress:()=>Q(e.id,n.id)},n.id))})]},e.id)),(0,f.jsx)(d.Card,{children:(0,f.jsx)(r.AllergenPanel,{item:x,map:N,declared:y.allergies})}),j.fictional?null:(0,f.jsx)(d.AllergenNotice,{phone:j.phone}),(0,f.jsx)(d.Field,{label:"Notes for the kitchen (optional)",placeholder:"e.g. no gherkins",value:P,onChangeText:T}),(0,f.jsxs)(d.Row,{style:{justifyContent:'space-between'},children:[(0,f.jsx)(d.T,{weight:"semibold",children:"Quantity"}),(0,f.jsx)(d.Stepper,{value:$,onChange:I,label:"quantity"})]}),q?(0,f.jsx)(d.Banner,{kind:"success",title:"Added to basket",children:G.contains.length?'Allergy override recorded \u2014 the kitchen will see a large allergy alert.':'Carry on browsing or go to your basket.'}):null,F?(0,f.jsx)(d.Banner,{kind:"warn",children:x.soldOut||'sold-out'===z?'Sold out today.':'off'===z&&x.signOff&&null!==x.price?'This dish isn\u2019t on the takeaway menu. You can have it when you eat in.':x.signOff?'Price on the specials board \u2014 ask staff.':'Not available to order online until the head chef signs off its allergens.'}):G.contains.length?(0,f.jsxs)(l.default,{style:{gap:8},children:[(0,f.jsx)(d.Button,{kind:"secondary",label:"Choose something else",onPress:()=>t.router.back()}),(0,f.jsx)(d.Button,{kind:"danger",label:"Override and add anyway\u2026",onPress:()=>{A(!1),R(!1),O(!0)},testID:"override-open"})]}):(0,f.jsxs)(d.Row,{gap:8,children:[(0,f.jsx)(d.Button,{style:{flex:1},label:`Add ${$} to basket \xb7 ${(0,u.gbp)(Y*$)}`,onPress:()=>V(!1),testID:"add-to-basket"}),q?(0,f.jsx)(d.Button,{kind:"secondary",label:"Basket",onPress:()=>t.router.push('/customer/basket')}):null]}),(0,f.jsxs)(d.Sheet,{visible:L,onClose:()=>O(!1),title:"Allergy override",children:[(0,f.jsx)(d.Banner,{kind:"danger",title:`${x.name} contains ${G.contains.map(c.allergenLabel).join(', ')}`,children:`Your profile says: ${y.allergies.filter(e=>G.contains.includes(e.allergen)).map(e=>`${(0,c.allergenLabel)(e.allergen)} \u2014 ${(0,c.severityLabel)(e.severity)}`).join('; ')}.`}),(0,f.jsx)(d.Toggle,{label:"I understand this dish contains an allergen I have declared",value:D,onChange:A}),(0,f.jsx)(d.Toggle,{label:"It is for someone without this allergy, or I have spoken to staff",value:M,onChange:R}),(0,f.jsx)(d.Muted,{children:"The override is logged and shown to the kitchen as an allergy alert that must be acknowledged."}),(0,f.jsx)(d.Button,{kind:"danger",disabled:!D||!M,label:"Confirm override and add",onPress:()=>V(!0),testID:"override-confirm"})]})]})}},1243,[947,13,17,319,85,1216,1244,777,845,851,858,867,804,8]); @@ -1498,7 +1498,7 @@ __d(function(g,_r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule? __d(function(g,r,i,a,_m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"DESKTOP_EXPIRED",{enumerable:!0,get:function(){return n}}),e.handoverCodeFrom=function(n){const t=(n||'').trim();if(!t)return null;const o=t.match(/[#&]ccchrome=([A-Za-z0-9_-]{24,64})(?:&|\s|$)/);if(o)return o[1];if(/[/#?=]/.test(t))return null;const c=t.replace(/\s+/g,'');return/^[A-Za-z0-9_-]{24,64}$/.test(c)?c:null},e.desktopLinkFor=function(n,t){try{const o=new URL(n),c=o.pathname.match(/^(.*?\/)(?:owner|staff|chef|display|customer|car)-app\/|^(.*?\/)owner-desktop\//),s=c?c[1]??c[2]:o.pathname.replace(/[^/]*$/,'');return`${o.origin}${s}owner-desktop/index.html#ccchrome=${t}`}catch{return null}},Object.defineProperty(e,"codeGroups",{enumerable:!0,get:function(){return t}}),e.desktopRefusal=function(t){return/no longer active/i.test(t)?'This person is no longer active in CoverCharge. Ask the other owner.':/expired|Chrome link|already been used/i.test(t)?n:t};const n='That sign-in link has run out or has already been used. On your phone, open More, then Use on a computer, and make a new one.';const t=n=>(n.match(/.{1,4}/g)??[]).join(' ')},1415,[]); __d(function(g,_r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.LaunchWelcome=function({p:e,onDone:t}){(0,r.useEffect)(()=>{if(!O||document.getElementById('cc-launch-css'))return;const e=document.createElement('style');e.id='cc-launch-css',e.textContent=I,document.head.appendChild(e)},[]),(0,r.useEffect)(()=>{if(O)return document.documentElement.classList.add('cc-welcome'),()=>document.documentElement.classList.remove('cc-welcome')},[]);const[o,k]=(0,r.useState)(P()?0:3),[E,_]=(0,r.useState)('main'),[Y,F]=(0,r.useState)(''),[H,M]=(0,r.useState)(0);(0,r.useEffect)(()=>{if(o<=0)return;const e=setTimeout(()=>k(e=>e-1),300);return()=>clearTimeout(e)},[o]);const B=(0,f.useAvatars)(t=>!!t.photos[e.id]),K=(0,b.useStore)(e=>e.restaurants[0]?.name??'Your venue').toUpperCase(),V=(0,x.useOwner)(t=>t.hourly[e.id]),G=(0,x.useOwner)(t=>t.staff.find(t=>t.id===e.id)),$=(0,y.useSync)(e=>e.mode),q='live'===$||'offline'===$,J=G?.salaried||e.salaried?'Salaried':null!=V?`\xa3${(V/100).toFixed(2)} an hour${G?.noTax?' \xb7 no-tax code':''}`:'connecting'===$?'Loading\u2026':'Ask your manager',Q='staff'!==e.app&&'staff'!==p.APP_VARIANT?(0,v.appUrl)('staff'):null,X=`AN-${String(j.ROSTER.findIndex(t=>t.id===e.id)+1).padStart(2,'0')}`,Z=p.IS_OWNER_DESKTOP?'CoverCharge for desktop':v.APP_NAME['staff'===p.APP_VARIANT?'staff':e.app],ee=L['staff'===p.APP_VARIANT&&'staff'!==e.app?'Staff':e.level]??L.Staff;return(0,C.jsxs)(h.default,{testID:"invite-welcome",style:[u.default.absoluteFill,{backgroundColor:(0,n.soutersSurface)('#000'),zIndex:1e3}],children:[(0,C.jsxs)(h.default,{...R('space'),pointerEvents:"none",children:[(0,C.jsx)(h.default,{...R('stars1')}),(0,C.jsx)(h.default,{...R('stars2')})]}),o>0?(0,C.jsxs)(l.default,{testID:"invite-countdown",accessibilityLabel:"Skip intro",onPress:()=>k(0),style:{flex:1,alignItems:'center',justifyContent:'center',gap:10},children:[(0,C.jsxs)(D,{colour:w.colours.muted,children:[K," \xb7 COVER CHARGE"]}),(0,C.jsx)(h.default,{...R('count'),children:(0,C.jsx)(T.T,{size:120,weight:"bold",colour:A,children:o})},o),(0,C.jsx)(D,{children:"GETTING YOU ON BOARD"})]}):'selfie'===E?(0,C.jsx)(W,{p:e,onClose:e=>{_('main'),e?(F('Avatar saved. Looking good!'),M(e=>e+1)):F('')}}):(0,C.jsxs)(c.default,{contentContainerStyle:{padding:22,paddingTop:34,gap:18,alignItems:'center',maxWidth:520,width:'100%',alignSelf:'center',paddingBottom:56},children:[(0,C.jsxs)(h.default,{...R('rise1'),style:{alignItems:'center',gap:2},children:[(0,C.jsxs)(D,{children:[K," \xb7 ",Z.toUpperCase()]}),(0,C.jsx)(T.T,{size:20,colour:w.colours.muted,center:!0,style:{marginTop:10},children:"Welcome aboard,"}),(0,C.jsx)(T.T,{size:42,weight:"bold",center:!0,style:{lineHeight:50},children:e.name})]}),(0,C.jsxs)(h.default,{...R('reveal'),style:{marginVertical:8},children:[(0,C.jsx)(h.default,{...R('orbit'),pointerEvents:"none"}),(0,C.jsx)(h.default,{...R('halo'),children:(0,C.jsx)(S.StaffAvatar,{id:e.id,size:156})})]},H),Y?(0,C.jsx)(T.T,{size:16,weight:"semibold",colour:w.colours.ok,center:!0,children:Y}):null,(0,C.jsx)(h.default,{...R('rise2'),style:{alignSelf:'stretch'},children:(0,C.jsxs)(h.default,{testID:"invite-crew-card",...R('card'),style:{borderRadius:20,borderWidth:1,borderColor:'rgba(207,164,95,0.55)',overflow:'hidden',padding:18,gap:12},children:[(0,C.jsx)(h.default,{...R('sheen'),pointerEvents:"none"}),(0,C.jsxs)(h.default,{style:{flexDirection:'row',justifyContent:'space-between',alignItems:'center'},children:[(0,C.jsx)(D,{children:"CREW ID"}),(0,C.jsx)(T.T,{size:15,weight:"semibold",colour:w.colours.muted,style:{letterSpacing:1.5},children:X})]}),(0,C.jsx)(h.default,{style:{height:2,backgroundColor:A,opacity:.7,borderRadius:1}}),(0,C.jsx)(N,{k:"NAME",v:e.name}),(0,C.jsx)(N,{k:"ROLE",v:(0,v.levelJob)(e.level,e.job)}),(0,C.jsx)(N,{k:"APP",v:Z}),'owner'!==e.role?(0,C.jsx)(h.default,{testID:"invite-pay",children:(0,C.jsx)(N,{k:"PAY",v:J})}):null,(0,C.jsx)(N,{k:"ACCESS",v:'Owner'===e.level?'Everything':'Manager'===e.level?'Manager':'Supervisor'===e.level?'Supervisor':'Head Chef'===e.level?'Kitchen lead':'Team member'}),(0,C.jsxs)(h.default,{style:{flexDirection:'row',alignItems:'center',gap:8},children:[(0,C.jsx)(h.default,{...R('blink'),style:{width:10,height:10,borderRadius:5,backgroundColor:w.colours.ok}}),(0,C.jsx)(T.T,{size:15,colour:w.colours.ok,children:p.IS_OWNER_DESKTOP?'Signed in on this computer':'Signed in on this phone'})]})]})}),(0,C.jsxs)(h.default,{...R('rise3'),style:{alignSelf:'stretch',gap:10},children:[(0,C.jsx)(D,{children:"WHAT YOU CAN DO"}),ee.map(e=>(0,C.jsxs)(h.default,{style:{flexDirection:'row',gap:12,alignItems:'flex-start'},children:[(0,C.jsx)(T.T,{size:16,colour:A,children:"\u25c6"}),(0,C.jsx)(T.T,{size:16,style:{flex:1},children:e})]},e))]}),O?(0,C.jsxs)(h.default,{testID:"invite-avatar-offer",...R('rise4'),style:{alignSelf:'stretch',gap:12,borderRadius:20,padding:18,borderWidth:1,borderColor:'rgba(255,255,255,0.14)',backgroundColor:'rgba(255,255,255,0.03)'},children:[(0,C.jsx)(D,{children:"YOUR AVATAR \xb7 OPTIONAL"}),(0,C.jsx)(T.T,{size:16,children:B?'You made your own avatar from a photo.':'Keep this one, choose an original icon, or make your own from a photo.'}),(0,C.jsx)(z,{kind:"ghost",label:B?'Choose another avatar':'Choose my avatar',testID:"invite-avatar-make",onPress:()=>{F(''),_('selfie')}}),(0,C.jsxs)(T.T,{size:15,colour:w.colours.muted,children:["Your photo stays on this ",p.IS_OWNER_DESKTOP?'computer':'phone',". It\u2019s turned into your avatar here; only the finished avatar is shared with your team."]})]}):null,(0,C.jsx)(h.default,{style:{alignSelf:'stretch',gap:10,marginTop:4},children:(0,C.jsx)(z,{label:B?'Get started':'Skip, keep this one and get started',testID:"invite-get-started",onPress:t})}),(0,s.inPhoneApp)()?null:(0,C.jsxs)(h.default,{style:{alignSelf:'stretch',gap:6,borderRadius:16,padding:16,borderWidth:1,borderColor:'rgba(255,255,255,0.12)'},children:[(0,C.jsx)(T.T,{size:16,weight:"semibold",colour:A,children:"Tip: add it to your Home screen"}),(0,C.jsxs)(T.T,{size:15,children:[U()," It then opens like a normal app and remembers you."]})]}),Q?(0,C.jsx)(l.default,{accessibilityRole:"link",onPress:()=>{O&&window.location.assign(Q)},children:(0,C.jsx)(T.T,{size:15,colour:A,center:!0,children:"Also open CoverCharge for Staff (your clock-in, rota and pay) \u203a"})}):null,(0,C.jsx)(T.T,{size:14,colour:w.colours.muted,center:!0,children:q?'Connected: bookings, orders and stock are shared live with the rest of the team. Your pay is only visible to you and your managers.':'Connecting\u2026 if there\u2019s no signal, what you enter is kept on this phone and shared once you\u2019re back online.'})]})]})};var t=_r(d[0]),n=_r(d[1]),r=_r(d[2]),s=_r(d[3]),o=e(_r(d[4]));_r(d[5]);var l=e(_r(d[6])),c=e(_r(d[7])),u=e(_r(d[8])),h=e(_r(d[9])),p=_r(d[10]),f=_r(d[11]),x=_r(d[12]),b=_r(d[13]),y=_r(d[14]),v=_r(d[15]),j=_r(d[16]),k=_r(d[17]),w=_r(d[18]),S=_r(d[19]),T=_r(d[20]),C=_r(d[21]);const A=w.colours.gold,I="\n[data-cc=\"space\"]{position:absolute;top:0;left:0;right:0;bottom:0;overflow:hidden;background:radial-gradient(ellipse at 50% 115%,#2a1f0c 0%,#0a0805 38%,#000 70%)}\n[data-cc=\"stars1\"],[data-cc=\"stars2\"]{position:absolute;top:-50%;left:-50%;width:200%;height:200%;will-change:transform}\n[data-cc=\"stars1\"]{background-image:radial-gradient(1.2px 1.2px at 23px 41px,#fff,transparent),radial-gradient(1px 1px at 97px 13px,#fff9,transparent),radial-gradient(1.4px 1.4px at 151px 120px,#f5e6c8,transparent),radial-gradient(1px 1px at 61px 163px,#fffa,transparent),radial-gradient(1.2px 1.2px at 183px 77px,#fff8,transparent);background-size:211px 199px;animation:cc-drift 90s linear infinite;opacity:.75}\n[data-cc=\"stars2\"]{background-image:radial-gradient(2px 2px at 40px 60px,#CFA45F,transparent),radial-gradient(1.6px 1.6px at 250px 210px,#fff,transparent),radial-gradient(1.8px 1.8px at 330px 40px,#fffc,transparent);background-size:397px 367px;animation:cc-drift2 60s linear infinite,cc-twinkle 3.2s ease-in-out infinite alternate;opacity:.8}\n@keyframes cc-drift{to{transform:translate3d(-211px,199px,0)}}\n@keyframes cc-drift2{to{transform:translate3d(-397px,367px,0)}}\n@keyframes cc-twinkle{from{opacity:.45}to{opacity:.95}}\n[data-cc=\"count\"]{animation:cc-count .32s cubic-bezier(.2,.8,.2,1) both}\n@keyframes cc-count{from{opacity:0;transform:scale(1.9)}to{opacity:1;transform:scale(1)}}\n[data-cc=\"reveal\"]{animation:cc-reveal .75s cubic-bezier(.2,.9,.25,1.25) both}\n@keyframes cc-reveal{0%{opacity:0;transform:scale(.35) rotate(-12deg)}100%{opacity:1;transform:scale(1) rotate(0)}}\n[data-cc=\"halo\"]{border-radius:999px;box-shadow:0 0 0 2px rgba(207,164,95,.85),0 0 38px 6px rgba(207,164,95,.35);animation:cc-glow 2.6s ease-in-out infinite}\n@keyframes cc-glow{0%,100%{box-shadow:0 0 0 2px rgba(207,164,95,.85),0 0 30px 4px rgba(207,164,95,.28)}50%{box-shadow:0 0 0 2px rgba(207,164,95,1),0 0 52px 10px rgba(207,164,95,.5)}}\n[data-cc=\"orbit\"]{position:absolute;top:-14px;left:-14px;right:-14px;bottom:-14px;border-radius:999px;border:1px dashed rgba(207,164,95,.45);animation:cc-spin 14s linear infinite}\n@keyframes cc-spin{to{transform:rotate(360deg)}}\n[data-cc=\"rise1\"],[data-cc=\"rise2\"],[data-cc=\"rise3\"],[data-cc=\"rise4\"]{animation:cc-rise .5s cubic-bezier(.2,.8,.2,1) both}\n[data-cc=\"rise2\"]{animation-delay:.12s}[data-cc=\"rise3\"]{animation-delay:.24s}[data-cc=\"rise4\"]{animation-delay:.36s}\n@keyframes cc-rise{from{opacity:0;transform:translate3d(0,18px,0)}to{opacity:1;transform:none}}\n[data-cc=\"btn\"]{transition:transform .12s ease,box-shadow .2s ease,filter .2s ease;cursor:pointer}\n[data-cc=\"btn\"]:hover{filter:brightness(1.08)}\n[data-cc=\"btnp\"]{transition:transform .12s ease,box-shadow .2s ease;cursor:pointer;box-shadow:0 0 0 1px rgba(207,164,95,.9),0 8px 30px rgba(207,164,95,.35)}\n[data-cc=\"btnp\"]:hover{box-shadow:0 0 0 1px #CFA45F,0 8px 44px rgba(207,164,95,.6)}\n[data-cc=\"card\"]{background:linear-gradient(135deg,rgba(255,255,255,.07),rgba(255,255,255,.02));backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px)}\n[data-cc=\"sheen\"]{position:absolute;top:0;bottom:0;width:40%;left:-60%;background:linear-gradient(100deg,transparent,rgba(255,255,255,.10),transparent);animation:cc-sheen 3.8s ease-in-out 1s infinite}\n@keyframes cc-sheen{0%{left:-60%}35%,100%{left:130%}}\n[data-cc=\"scan\"]{position:absolute;left:0;right:0;height:4px;background:linear-gradient(90deg,transparent,#CFA45F,#fff,#CFA45F,transparent);box-shadow:0 0 18px 4px rgba(207,164,95,.75);animation:cc-scan .9s ease-in-out infinite alternate}\n@keyframes cc-scan{from{top:2%}to{top:96%}}\n[data-cc=\"grid\"]{position:absolute;top:0;left:0;right:0;bottom:0;background-image:linear-gradient(rgba(207,164,95,.18) 1px,transparent 1px),linear-gradient(90deg,rgba(207,164,95,.18) 1px,transparent 1px);background-size:22px 22px}\n[data-cc=\"blink\"]{animation:cc-blink 1s steps(2,start) infinite}\n@keyframes cc-blink{to{visibility:hidden}}\nhtml.cc-welcome #cc-install-hint{display:none !important}\n@media (prefers-reduced-motion: reduce){[data-cc]{animation:none !important;transition:none !important}}\n",R=e=>({dataSet:{cc:e}}),O='undefined'!=typeof document,P=()=>O&&'function'==typeof window.matchMedia&&window.matchMedia('(prefers-reduced-motion: reduce)').matches,E=()=>{try{O&&navigator.vibrate?.(12)}catch{}};function z({label:e,onPress:t,kind:n="primary",testID:r,disabled:s}){const o='primary'===n;return(0,C.jsx)(l.default,{testID:r,accessibilityRole:"button",accessibilityLabel:e,disabled:s,onPress:()=>{E(),t()},...R(o&&!s?'btnp':'btn'),style:({pressed:e})=>[{alignSelf:'stretch',minHeight:56,borderRadius:28,alignItems:'center',justifyContent:'center',paddingHorizontal:20,backgroundColor:o?A:'rgba(255,255,255,0.04)',borderWidth:o?0:1.5,borderColor:A,opacity:s?.45:1,transform:[{scale:e?.96:1}]}],children:(0,C.jsx)(T.T,{size:18,weight:"semibold",colour:o?'#0B0B0B':A,center:!0,children:e})})}const D=({children:e,colour:t=A})=>(0,C.jsx)(T.T,{size:14,weight:"semibold",colour:t,style:{letterSpacing:2.2},children:e}),L={Owner:['Takings, sales, labour cost and payroll','Bookings (Tables and Covers), orders, the rota and team chat','Every setting, plus the Assistant for quick answers'],Manager:['Run service: orders, bookings (Tables and Covers) and the waitlist','The rota, timesheets and team pay rates','Your own clock-in and pay in the Staff app'],Supervisor:['Run service: orders, bookings (Tables and Covers) and the waitlist','The rota, timesheets and team pay rates','Your own clock-in and pay in the Staff app'],'Head Chef':['Stock, costings, prep, ordering and the specials board','Food safety checks, allergens and live tickets','Your own clock-in, rota and pay in the Staff app'],Staff:['Clock in and out, see your rota, swap shifts, ask for time off','Team chat, food safety checks and the accident book','Your own hours, pay and tips (only yours)']};function U(){const e=O?navigator.userAgent:'';return/iPhone|iPad|iPod/.test(e)?'In Safari, tap Share (the square with an arrow), then Add to Home Screen.':/SamsungBrowser/.test(e)?'Tap the menu, then Add page to, then Home screen.':'In Chrome, tap \u22ee then Add to Home screen (or Install app).'}const N=({k:e,v:t})=>(0,C.jsxs)(h.default,{style:{flexDirection:'row',gap:12,alignItems:'baseline'},children:[(0,C.jsx)(T.T,{size:14,weight:"semibold",colour:w.colours.muted,numberOfLines:1,style:{width:74,letterSpacing:1.2},children:e}),(0,C.jsx)(T.T,{size:18,weight:"semibold",style:{flex:1},children:t})]});function W({p:e,onClose:s}){const[u,x]=(0,r.useState)('choose'),[b,y]=(0,r.useState)(null),[v,j]=(0,r.useState)(null),[I,O]=(0,r.useState)(!1),[L,U]=(0,r.useState)(''),N=(0,r.useRef)(null);(0,r.useEffect)(()=>()=>{N.current&&URL.revokeObjectURL(N.current)},[]);const W=async e=>{U('');const t=await(0,k.pickPhoto)(e);if(!t)return;N.current&&URL.revokeObjectURL(N.current);const n=URL.createObjectURL(t);N.current=n,y(n),O(!1),x('scan');const r=Date.now();try{const e=await(0,k.styliseOnDevice)(t),n=P()?0:Math.max(0,1300-(Date.now()-r));setTimeout(()=>{j(e),x('reveal'),E()},n)}catch{U("That photo couldn't be opened. Try another one (JPEG or PNG)."),x('choose')}},_=({children:e})=>(0,C.jsx)(h.default,{style:{width:236,height:236,borderRadius:118,overflow:'hidden',borderWidth:2,borderColor:A,alignItems:'center',justifyContent:'center',backgroundColor:(0,n.soutersSurface)('#050505')},children:e});return(0,C.jsxs)(c.default,{testID:"invite-avatar-step",contentContainerStyle:{padding:22,paddingTop:34,gap:18,alignItems:'center',maxWidth:520,width:'100%',alignSelf:'center',paddingBottom:56},children:[(0,C.jsx)(D,{children:"MAKE YOUR AVATAR"}),(0,C.jsx)(T.T,{size:28,weight:"bold",center:!0,children:'choose'===u?'Choose your look':'scan'===u?'Scanning\u2026':`Looking good, ${e.name}`}),'choose'===u?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(h.default,{...R('reveal'),children:(0,C.jsx)(h.default,{...R('halo'),children:(0,C.jsxs)(_,{children:[(0,C.jsx)(h.default,{style:{opacity:.55},children:(0,C.jsx)(S.StaffAvatar,{id:e.id,size:200,ring:!1})}),(0,C.jsx)(h.default,{...R('grid'),pointerEvents:"none"})]})})}),(0,C.jsxs)(T.T,{size:16,center:!0,colour:w.colours.muted,children:["Take a selfie or pick a photo. ",p.IS_OWNER_DESKTOP?'This computer turns it into a space-age avatar. The photo never leaves this computer and isn\u2019t kept.':'Your phone turns it into a space-age avatar. The photo never leaves this phone and isn\u2019t kept.']}),(0,C.jsx)(z,{label:"Take a selfie",testID:"avatar-selfie",onPress:()=>W(!0)}),(0,C.jsx)(z,{kind:"ghost",label:"Upload a photo",testID:"avatar-upload",onPress:()=>W(!1)}),(0,C.jsx)(h.default,{style:{width:'100%',minWidth:0},children:(0,C.jsx)(t.AvatarOptions,{onSelect:t=>{f.useAvatars.getState().setOwn(e.id,e.id,t.dataUrl,e.name)?s(!0):U('Could not save your avatar. Try again.')}})})]}):'scan'===u?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(h.default,{...R('halo'),children:(0,C.jsxs)(_,{children:[b?(0,C.jsx)(o.default,{source:{uri:b},style:{width:236,height:236},accessibilityLabel:"Your photo"}):null,(0,C.jsx)(h.default,{...R('grid'),pointerEvents:"none"}),(0,C.jsx)(h.default,{...R('scan'),pointerEvents:"none"})]})}),(0,C.jsx)(D,{colour:w.colours.muted,children:"MAKING YOUR AVATAR ON THIS PHONE"})]}):(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(h.default,{...R('reveal'),children:(0,C.jsx)(h.default,{...R('halo'),children:v?(0,C.jsx)(o.default,{testID:"avatar-result",source:{uri:v},style:{width:220,height:220,borderRadius:110},accessibilityLabel:"Your new avatar"}):null})}),(0,C.jsxs)(l.default,{accessibilityRole:"checkbox",accessibilityState:{checked:I},accessibilityLabel:"I agree to use this avatar",testID:"avatar-consent",onPress:()=>{E(),O(!I)},style:{alignSelf:'stretch',flexDirection:'row',gap:12,alignItems:'flex-start',padding:14,borderRadius:16,borderWidth:1.5,borderColor:I?A:'rgba(255,255,255,0.2)'},children:[(0,C.jsx)(h.default,{style:{width:28,height:28,borderRadius:8,borderWidth:2,borderColor:A,backgroundColor:I?A:'transparent',alignItems:'center',justifyContent:'center'},children:I?(0,C.jsx)(T.T,{size:17,weight:"bold",colour:"#111",children:"\u2713"}):null}),(0,C.jsx)(T.T,{size:15,style:{flex:1},children:"I\u2019m happy for this avatar, made from my photo, to be shown to my team in CoverCharge. Only the finished avatar is shared; my photo isn\u2019t uploaded or kept, and a manager can reset my avatar."})]}),(0,C.jsx)(z,{label:"Use this avatar",testID:"avatar-save",disabled:!I,onPress:()=>{if(!v)return;f.useAvatars.getState().setOwn(e.id,e.id,v,e.name)?(N.current&&URL.revokeObjectURL(N.current),N.current=null,s(!0)):U("Couldn't save the avatar. Please try again.")}}),(0,C.jsx)(z,{kind:"ghost",label:"Try another photo",onPress:()=>{j(null),x('choose')}})]}),L?(0,C.jsx)(T.T,{size:15,colour:w.colours.red,center:!0,children:L}):null,'scan'!==u?(0,C.jsx)(l.default,{testID:"invite-avatar-done",accessibilityRole:"button",onPress:()=>{E(),s(!1)},style:({pressed:e})=>({padding:12,transform:[{scale:e?.96:1}]}),children:(0,C.jsx)(T.T,{size:17,weight:"semibold",colour:w.colours.text,children:"Skip, keep this one"})}):null]})}},1416,[888,813,17,1067,319,219,385,278,24,85,856,885,876,816,946,966,878,776,804,884,777,8]); __d(function(g,_r,_i,_a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.Dashboard=function({go:e,ownerHome:a=!1}){const{rid:n,r:x,now:F,role:le,me:ae,today:ne}=(0,A.useCtx)(5e3),ie=(0,p.useOrders)(n),re=(0,p.useBookings)(n),de=(0,p.useWaitlist)(n),ue=(0,p.useEvents)(n),ge=(0,p.useRatings)(n),ye=(0,j.useOwner)(e=>e.staff),xe=(0,j.useOwner)(e=>(0,j.liveAttendance)(e.attendance)),me=(0,j.useOwner)(e=>e.shifts),be=(0,M.useRealHistory)(n,F),fe=(0,l.useMemo)(()=>(0,s.forecastToday)(x,re,ie,ue,F,be??void 0),[x,re,ie,ue,be,F.getTime()/6e4|0]),pe=(0,S.useExamples)(),je=(0,N.useCashUp)(e=>e.cashUps),ke=re.filter(e=>e.date===ne),we=ie.filter(B.LIVE),$e=de.filter(e=>'waiting'===e.status||'notified'===e.status),ve=(0,C.seatedCoversOn)(re,ne),Ie=(0,se.coversSplit)(ke,ne),Ce=we.filter(e=>(0,_.chainNeedsAction)(e,re)),De=ke.filter(e=>['confirmed','seated'].includes(e.status)&&(0,_.bookingNeedsAction)(e,we)),Te=we.flatMap(e=>(0,v.readinessFor)(e,x,F).map(t=>({...t,order:e}))).filter(e=>'due'===e.state||'overdue'===e.state),Be=fe.nextHour,Ae=(0,B.busyLevel)(Be?.coversHigh??0,fe.busy.busy),Le=(0,B.restOfDayLevel)(fe,x),Me=ie.filter(e=>e.paid>0&&!!e.createdAt&&(0,I.ymd)(new Date(e.createdAt))===ne).reduce((e,t)=>e+t.paid,0),Se=(0,R.tradingDay)(F),Ne=pe?(0,L.revenueHistory)(x,F,7).filter(e=>e.date.getDay()===F.getDay()).pop():void 0,Pe=pe?{today:186e3+Me,last:Ne?{date:(0,I.ymd)(Ne.date),pence:Ne.total}:null,online:0,show:!0}:(0,O.takingsToday)(je,n,Se,Me),Fe=j.CAN.takings(le)&&(!(0,H.isLive)()||(0,H.can)('takings.view')),We=(0,l.useMemo)(()=>(0,L.insights)(x,re,ie,ue,ge,F,ve),[x.id,re.length,ge.length,ve]),He=((0,A.weekday)(F),(0,k.openWorkingRows)(xe,ne)),Re=(0,J.useFrontDoor)(ne),Oe=(0,u.useBookingWrite)(),ze=(0,w.useOutstanding)(),Ee=(0,i.useTravelDay)('owner',ne),Ge=(0,A.useSignedIn)(),Ue=(0,A.useInStaffApp)(),qe=(0,P.canSeeMonthTakings)(le,Ge,{inStaffApp:Ue,live:(0,H.isLive)()}),Ye=(0,W.homeSetupNagsHidden)(n),Ke=(0,j.useOwner)(e=>e.socialPosts.reduce((e,t)=>e+('awaiting approval'===t.status?1:0),0)),[Ve,Qe]=(0,l.useState)(!1),[Xe,Ze]=(0,l.useState)(!1),Je=ae.replace(' (example)',''),et=j.CAN.manage(le)?(0,oe.jsx)(f.Button,{testID:"home-restaurant-dashboard",label:"Restaurant dashboard",accessibilityLabel:"Restaurant dashboard, everything on the Display: any day, table plan, Timeline, guests, Covers and actions",onPress:()=>e('more','serviceboard'),style:{minHeight:56}}):null;return Ee?(0,oe.jsxs)(b.default,{style:{gap:12},children:[et,(0,oe.jsx)(i.DayBar,{app:"owner",today:ne}),(0,oe.jsx)(i.DayView,{rid:n,day:Ee,today:ne,app:"owner"})]}):(0,oe.jsxs)(b.default,{style:{gap:12},testID:a?'owner-home':'managers-home',children:[et,(0,oe.jsx)(i.DayBar,{app:"owner",today:ne}),(0,oe.jsx)(K.WhoBar,{}),Ge&&'owner'!==Ge.role?(0,oe.jsx)(V.MyShiftCard,{go:e}):null,Ge?(0,oe.jsx)(Q.MyTasksToday,{rid:n,staffId:Ge.id,name:Ge.name,onShift:(0,Z.shiftNow)(Ge.id,Date.now()).on}):null,'staff'!==le?(0,oe.jsx)(X.TodaysTipsCard,{rid:n,today:ne}):null,'staff'!==le?(0,oe.jsx)(X.TipsPotCard,{rid:n,today:ne}):null,j.CAN.manage(le)?(0,oe.jsx)(b.default,{testID:"home-business-insights-wrap",style:{alignItems:'center',width:'100%'},children:(0,oe.jsx)(f.Button,{testID:"home-business-insights",label:"Business insights",accessibilityLabel:"Business insights, stats and percentages from your bookings and cash ups",onPress:()=>e('more','bizinsights'),style:{minHeight:56,width:'100%'}})}):null,(0,oe.jsx)(he,{split:Ie}),(0,oe.jsx)(ee.BlocksBanner,{rid:n,now:F,by:ae}),(0,oe.jsx)(y.KitchenSignoffs,{rid:n,today:ne,by:ae,app:"owner",canConfirm:j.CAN.manage(le)}),j.CAN.manage(le)&&!Ye?(0,oe.jsx)(q.SetupCard,{go:e}):null,j.CAN.manage(le)&&!Ye?(0,oe.jsx)(o.SeasonsTodo,{go:e}):null,(0,oe.jsx)(r.LastFoodBanner,{rid:n,now:F}),(0,oe.jsx)(d.NextTableFreeCard,{rid:n,now:F}),j.CAN.manage(le)?(0,oe.jsx)(f.Button,{testID:"home-blocks",label:"Block bookings",accessibilityLabel:"Block bookings: block now, add a block, see future blocks",accessibilityHint:Oe.hint,disabled:!Oe.ok,onPress:()=>e('more','blocks')}):null,(0,oe.jsx)(f.Button,{testID:"home-add-soldout",label:"Add sold out",accessibilityLabel:"Add sold out, mark a dish sold out or put it back on",onPress:()=>Qe(!0),style:{minHeight:56}}),(0,oe.jsxs)(b.default,{testID:"front-door-bar",dataSet:{centre:'buttons'},style:{flexDirection:'row',flexWrap:'wrap',gap:8,justifyContent:'center'},children:[(0,oe.jsx)(c.QuietButton,{label:"New booking",onPress:Re.openBooking,testID:"home-booking",disabled:!Oe.ok,accessibilityHint:Oe.hint}),j.CAN.manage(le)?(0,oe.jsx)(ee.CloseGardenButton,{quiet:!0,short:!0,rid:n,r:x,now:F,by:ae}):null]}),Re.elements,j.CAN.manage(le)?(0,oe.jsx)(Y.PaydaysCard,{go:e}):null,(0,oe.jsx)(E.FadeIn,{children:(0,oe.jsxs)(f.Card,{highlight:T.colours.gold,style:{alignItems:'center'},children:[(0,oe.jsxs)(f.T,{weight:"semibold",colour:T.colours.gold,center:!0,accessibilityRole:"header",children:["Next hour",Be?` \xb7 ${(0,A.fmtH)(Be.hour)}\u2013${(0,A.fmtH)(Be.hour+1)}`:'']}),fe.example?(0,oe.jsx)(M.ExampleBadge,{}):fe.enough?(0,oe.jsx)(f.Badge,{kind:"amber",label:"ESTIMATE"}):(0,oe.jsx)(f.Badge,{kind:"neutral",label:"BOOKED ONLY"}),(0,oe.jsx)(E.Gauge,{pct:Be?Ae.pct:0,label:Be?Ae.label:fe.open?'Kitchen closing':'Closed today',sub:Be&&!fe.enough?`${Be.booked} booked${Be.walkIns?` + ${Be.walkIns} walk-ins seated`:''} \xb7 not enough history for a forecast yet`:Be?`Estimated ${(0,s.coversRange)(Be.coversLow,Be.coversHigh)} \xb7 Busy at ${fe.busy.busy} Covers an hour \xb7 ${Be.booked} booked + about ${Be.walkIns} walk-ins${(0,h.showTakeaway)(x)?` \xb7 about ${Be.takeaway} takeaway`:''}`:'No forecast for the next hour'}),(0,oe.jsxs)(f.Row,{wrap:!0,gap:6,style:{justifyContent:'center'},children:[fe.enough?(0,oe.jsx)(f.Badge,{kind:"gold",label:`Rest of today: ${Le.level.label}${Le.peak?`, peak ${(0,A.fmtH)(Le.peak.hour)}`:''}`}):null,fe.enough?(0,oe.jsx)(f.Badge,{kind:"neutral",label:`${(0,s.coversRange)(fe.restOfDay.low,fe.restOfDay.high)}${(0,h.showTakeaway)(x)?` \xb7 about ${fe.restOfDay.takeaway} takeaways`:''}`}):(0,oe.jsx)(f.Badge,{kind:"neutral",label:`Booked so far: ${fe.restOfDay.booked} Covers`})]}),fe.flags.length?(0,oe.jsxs)(f.Muted,{center:!0,children:["Calendar: ",fe.flags.join(', ')]}):null,j.CAN.forecasts(le)?(0,oe.jsx)(f.Button,{small:!0,kind:"ghost",label:"Open forecasts \u2192",onPress:()=>e('forecast')}):null]})}),(0,oe.jsxs)(f.Row,{wrap:!0,gap:10,children:[(0,h.showTakeaway)(x)||we.length?(0,oe.jsx)(E.FadeIn,{delay:200,style:{flexGrow:1,flexBasis:150},children:(0,oe.jsx)(B.Tile,{label:"Live orders",value:"",accent:we.some(e=>'new'===e.status)?T.colours.red:void 0,onPress:()=>e('orders'),sub:(0,D.orderAtTableOn)(x)?`${we.filter(e=>'takeaway'===e.type).length} takeaway \xb7 ${we.filter(e=>'table'===e.type).length} table`:`${we.filter(e=>'takeaway'===e.type).length} takeaway`,children:(0,oe.jsx)(E.CountUp,{value:we.length})})}):null,$e.length>0?(0,oe.jsx)(E.FadeIn,{delay:260,style:{flexGrow:1,flexBasis:150},children:(0,oe.jsx)(B.Tile,{label:"Waitlist",value:"",onPress:()=>e('bookings','waitlist'),sub:`${$e.reduce((e,t)=>e+t.partySize,0)} Covers waiting`,children:(0,oe.jsx)(E.CountUp,{value:$e.length})})}):null,Fe&&Pe.show?(0,oe.jsx)(E.FadeIn,{delay:320,style:{flexGrow:1,flexBasis:150},children:(0,oe.jsx)(z.TakingsTodayCard,{t:Pe,example:pe,onPress:()=>e('more','analytics')})}):null,(0,oe.jsx)(E.FadeIn,{delay:380,style:{flexGrow:1,flexBasis:150},children:(0,oe.jsx)(B.Tile,{label:"Allergy alerts",value:"",accent:Ce.length+De.length?T.colours.red:T.colours.ok,sub:"Need a sign-off",children:(0,oe.jsx)(E.CountUp,{value:Ce.length+De.length,colour:Ce.length+De.length?T.colours.red:T.colours.ok})})})]}),Ce.length+De.length+Te.length?(0,oe.jsx)(B.SectionHead,{title:"Needs action now"}):null,Ce.map(e=>(0,oe.jsxs)(B.AlertBox,{colour:T.colours.red,title:`ALLERGY \xb7 ${e.ref} ${'table'===e.type?`${(0,t.tableNumbers)(e.tableNo)}`:'takeaway'}`,children:[(0,oe.jsx)(f.T,{size:14,children:e.allergies.map(e=>`${(0,$.allergenLabel)(e.allergen)} (${(0,$.severityLabel)(e.severity)})`).join('; ')}),(0,oe.jsx)(U.AllergyChain,{o:e,me:ae,compact:!0})]},e.id)),De.map(e=>(0,oe.jsxs)(B.AlertBox,{colour:T.colours.red,title:`ALLERGY \xb7 booking ${e.time} ${e.name} (${e.partySize})`,children:[(0,oe.jsx)(f.T,{size:14,children:e.allergies.map(e=>`${(0,$.allergenLabel)(e.allergen)} (${(0,$.severityLabel)(e.severity)})`).join('; ')}),(0,oe.jsx)(U.BookingAllergyChain,{b:e,me:ae})]},e.id)),Te.map(t=>(0,oe.jsxs)(B.AlertBox,{colour:'overdue'===t.state?T.colours.red:T.colours.amber,title:`${'cook'===t.stage?'START COOKING':'bag'===t.stage?'BAG IT':'READY'} \xb7 ${t.order.ref} pickup ${(0,I.hm)(new Date(t.order.slotTime))}${'overdue'===t.state?' \xb7 OVERDUE':''}`,children:[(0,oe.jsx)(f.T,{size:14,children:t.detail}),(0,oe.jsx)(f.Button,{small:!0,kind:"secondary",label:"Open orders",onPress:()=>e('orders')})]},t.id)),j.CAN.manage(le)&&(ze.days.length||ze.requests)?(0,oe.jsxs)(B.AlertBox,{colour:T.colours.amber,title:`HOURS \xb7 ${ze.days.length?`${ze.days.length} earlier day${ze.days.length>1?'s':''} to sign off`:''}${ze.days.length&&ze.requests?' \xb7 ':''}${ze.requests?`${ze.requests} correction request${ze.requests>1?'s':''}`:''}`,children:[(0,oe.jsx)(f.T,{size:14,children:"Hours only count for pay once a manager confirms them."}),(0,oe.jsx)(f.Button,{small:!0,kind:"secondary",label:"Sign off hours",testID:"nudge-signoff",onPress:()=>e('more','signoff')})]}):null,Ke&&j.CAN.publishSocial(le)?(0,oe.jsxs)(B.AlertBox,{colour:T.colours.amber,title:`SOCIAL \xb7 ${Ke} post${Ke>1?'s':''} awaiting approval`,children:[(0,oe.jsx)(f.T,{size:14,children:"Drafted by staff. Review and approve before anything goes out. Posting: not set up yet."}),(0,oe.jsx)(f.Button,{small:!0,kind:"secondary",label:"Review posts",onPress:()=>e('more','social')})]}):null,(0,oe.jsx)(B.SectionHead,{title:"Quick actions"}),(0,oe.jsxs)(m.default,{accessibilityRole:"button",accessibilityLabel:"Post to social",onPress:()=>e('more','social'),style:({pressed:e})=>({borderRadius:16,borderWidth:1.5,borderColor:T.colours.gold,backgroundColor:e?T.colours.goldTint:T.colours.surface,padding:12,flexDirection:'row',alignItems:'center',gap:10}),children:[(0,oe.jsxs)(f.Row,{gap:4,children:[(0,oe.jsx)(G.Mark,{p:"facebook"}),(0,oe.jsx)(G.Mark,{p:"instagram"}),(0,oe.jsx)(G.Mark,{p:"tiktok"}),(0,oe.jsx)(G.Mark,{p:"youtube"})]}),(0,oe.jsxs)(b.default,{style:{flex:1},children:[(0,oe.jsx)(f.T,{weight:"bold",children:"Post to social"}),(0,oe.jsx)(f.Muted,{children:"Facebook + Instagram, TikTok + YouTube: not set up yet"})]}),(0,oe.jsx)(f.T,{colour:T.colours.gold,size:20,children:"\u203a"})]}),(0,oe.jsx)(G.QuickLinksSection,{go:e,heading:e=>(0,oe.jsx)(B.SectionHead,{title:e})}),(0,oe.jsx)(B.SectionHead,{title:"Who\u2019s on now",right:(0,oe.jsx)(f.Badge,{kind:"ok",label:`${He.length} clocked in`})}),(0,oe.jsxs)(f.Card,{children:[0===He.length?(0,oe.jsx)(f.Muted,{children:"Nobody clocked in yet."}):null,He.map(e=>{const t=ye.find(t=>t.id===e.staffId),s=(0,j.shiftOf)(me,e.staffId,ne),o=new Date(e.in),l=!!s&&o.getHours()+o.getMinutes()/60-s.start>.08333333333333333;return(0,oe.jsxs)(f.Row,{style:{justifyContent:'space-between'},children:[(0,oe.jsxs)(b.default,{style:{flex:1},children:[(0,oe.jsx)(f.T,{weight:"semibold",children:t?.name??e.staffId}),(0,oe.jsxs)(f.Muted,{children:[t?.job," \xb7 in ",(0,I.hm)(o),s?` \xb7 shift ${(0,A.fmtH)(s.start)}\u2013${(0,A.fmtH)(s.end)}`:' \xb7 unscheduled']})]}),l?(0,oe.jsx)(f.Badge,{kind:"amber",label:"Late"}):(0,oe.jsx)(f.Badge,{kind:"ok",label:"On site"})]},e.id)}),j.CAN.manage(le)?(0,oe.jsx)(f.Button,{small:!0,kind:"ghost",label:"Rota & timesheets \u2192",onPress:()=>e('more','rota')}):(0,oe.jsx)(f.Button,{small:!0,kind:"secondary",label:"Clock in / out",onPress:()=>e('more','clock')})]}),'staff'!==le?(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(B.SectionHead,{title:"Insights",sub:pe?'AI-style suggestions from your bookings, orders, stock and calendar (example figures)':'From your own bookings, reviews and calendar'}),We.slice(0,4).map((t,s)=>(0,oe.jsx)(E.FadeIn,{delay:100+90*s,children:(0,oe.jsxs)(f.Card,{style:{borderLeftWidth:4,borderLeftColor:{gold:T.colours.gold,red:T.colours.red,amber:T.colours.amber,ok:T.colours.ok,blue:T.colours.blue}[t.tone]},children:[(0,oe.jsxs)(f.T,{weight:"semibold",children:[t.icon," ",t.title]}),(0,oe.jsx)(f.Muted,{children:t.body}),t.action?(0,oe.jsx)(f.Button,{small:!0,kind:"ghost",label:`${t.action.label} \u2192`,onPress:()=>e(t.action.tab,t.action.sub??null),style:{alignSelf:'flex-start'}}):null]})},t.id)),(0,oe.jsx)(f.Button,{small:!0,kind:"secondary",label:"All insights",onPress:()=>e('more','insights')})]}):null,qe?(0,oe.jsx)(f.Button,{testID:"home-takings-button",kind:Xe?'secondary':'primary',label:Xe?'Hide takings':'Takings',accessibilityLabel:Xe?'Hide takings':'Takings: this month by day, from confirmed cash ups',onPress:()=>Ze(e=>!e),style:{minHeight:56}}):null,qe&&Xe?(0,oe.jsx)(E.FadeIn,{children:(0,oe.jsx)(ce,{rid:n,today:ne})}):null,(0,oe.jsx)(te.SoldOutSheet,{visible:Ve,onClose:()=>Qe(!1),rid:n,by:Je,hideLinks:!0,testID:"home-soldout-sheet"})]})},_e.monthAxisDays=de,_e.MonthTakingsCard=ce,_e.WalkInSplitCard=he;var t=_r(_d[0]),s=_r(_d[1]),o=_r(_d[2]),l=_r(_d[3]),a=_r(_d[4]),n=e(a),i=_r(_d[5]),r=_r(_d[6]),d=_r(_d[7]),c=_r(_d[8]),u=_r(_d[9]),h=_r(_d[10]),y=_r(_d[11]),x=e(_r(_d[12])),m=e(_r(_d[13])),b=e(_r(_d[14])),f=_r(_d[15]),p=_r(_d[16]),j=_r(_d[17]),k=_r(_d[18]),w=_r(_d[19]),$=_r(_d[20]),v=_r(_d[21]),I=_r(_d[22]),C=_r(_d[23]),D=_r(_d[24]),T=_r(_d[25]),B=_r(_d[26]),A=_r(_d[27]),L=_r(_d[28]),M=_r(_d[29]),S=_r(_d[30]),N=_r(_d[31]),P=_r(_d[32]),F=_r(_d[33]),W=_r(_d[34]),H=_r(_d[35]),R=_r(_d[36]),O=_r(_d[37]),z=_r(_d[38]),E=_r(_d[39]),G=_r(_d[40]),U=_r(_d[41]),_=_r(_d[42]),q=_r(_d[43]),Y=_r(_d[44]),K=_r(_d[45]),V=_r(_d[46]),Q=_r(_d[47]),X=_r(_d[48]),Z=_r(_d[49]),J=_r(_d[50]),ee=_r(_d[51]),te=_r(_d[52]),se=_r(_d[53]),oe=_r(_d[54]);const le=18,ae=18,ne=150,ie=34;function re(e){if(!e.length)return'';if(1===e.length)return`M${e[0].x.toFixed(1)},${e[0].y.toFixed(1)}`;const t=e.length,s=[],o=[];for(let o=0;o9){const n=3/Math.sqrt(a);o[e]=n*t*s[e],o[e+1]=n*l*s[e]}}let l=`M${e[0].x.toFixed(1)},${e[0].y.toFixed(1)}`;for(let s=0;sle+(t-1)/Math.max(1,e-1)*s,l=[1,5,10,15,20,25].filter(t=>t=36)&&a.push(e);for(;a.length&&o(e)-o(a[a.length-1])<36;)a.pop();return[...a,e]}function ce({rid:e,today:t}){const s=(0,N.useCashUp)(e=>e.cashUps),[o,i]=(0,l.useState)(t.slice(0,7)),[r,d]=(0,l.useState)(0),[c,u]=(0,l.useState)(null),h=(0,l.useMemo)(()=>(0,P.monthTakings)(s,e,o,t),[s,e,o,t]),y=(0,l.useMemo)(()=>(0,P.firstTakingsMonth)(s,e),[s,e]),p=!!y&&yle+(e-1)/Math.max(1,k-1)*w,C=e=>$-e/v*128,D=[];h.days.forEach((e,t)=>{if('recorded'!==e.state)return;const s={x:I(e.day),y:C(e.value)};t&&'recorded'===h.days[t-1].state?D[D.length-1].push(s):D.push([s])});const B=h.days.filter(e=>'future'!==e.state),A=[...h.days].reverse().find(e=>'recorded'===e.state),L=h.days.find(e=>e.date===c&&'future'!==e.state)??(h.current?h.days.find(e=>e.date===t):void 0)??A??B[B.length-1],M=e=>{const t=B.findIndex(e=>e.date===L?.date),s=B[Math.max(0,Math.min(B.length-1,t+e))];s&&(u(s.date),x.default.announceForAccessibility?.(S(s)))},S=e=>`${(0,P.longDay)(e.date)}, ${'recorded'===e.state?(0,P.poundsWhole)(e.value):'pending'===e.state?'not cashed up yet':'no cash up'}`,W=h.current?`so far in ${h.month}`:`in ${h.month} ${o.slice(0,4)}`,H=null==h.vsPct?null:`vs ${h.current?'same point last month':(0,P.monthName)((0,P.addMonths)(o,-1))} ${h.vsPct>0?'+':''}${h.vsPct}%`,R=h.recorded?`Takings ${h.current?'this month':`${h.month} ${o.slice(0,4)}`}. ${(0,P.poundsWhole)(h.total)} ${W}, from ${h.recorded} cash up${1===h.recorded?'':'s'}. Best day ${(0,P.longDay)(h.best.date)}, ${(0,P.poundsWhole)(h.best.value)}.${H?` ${H.replace('+','up ').replace(/ -(\d)/,' down $1')}.`:''}`:`Takings ${h.current?'this month':`${h.month} ${o.slice(0,4)}`}. No cash-ups yet${h.current?' this month':''}.`,O=r?de(k,r):[],z=(e,t,s,l,a)=>(0,oe.jsx)(m.default,{testID:a,accessibilityRole:"button",accessibilityLabel:t,accessibilityState:{disabled:!s},disabled:!s,onPress:()=>{i((0,P.addMonths)(o,l)),u(null)},style:({pressed:e})=>({minWidth:48,minHeight:48,alignItems:'center',justifyContent:'center',borderRadius:24,opacity:s?e?.6:1:.25}),children:(0,oe.jsx)(f.T,{size:24,colour:T.colours.gold,center:!0,children:e})});return(0,oe.jsx)(f.Card,{highlight:T.colours.gold,style:{alignItems:'center',gap:6},children:(0,oe.jsxs)(b.default,{testID:"home-month-takings",style:{width:'100%',alignItems:'center',gap:6,minWidth:0},children:[(0,oe.jsxs)(f.T,{weight:"semibold",colour:T.colours.gold,center:!0,accessibilityRole:"header",children:["Takings ",h.current?'this month':'by month']}),p||j?(0,oe.jsxs)(b.default,{style:{flexDirection:'row',alignItems:'center',justifyContent:'center',gap:4,width:'100%'},children:[z('\u2039',`Previous month, ${(0,P.monthName)((0,P.addMonths)(o,-1))}`,p,-1,'mt-prev'),(0,oe.jsxs)(f.T,{center:!0,colour:T.colours.goldLight,style:{flexShrink:1},testID:"mt-month",children:[h.month," ",o.slice(0,4)]}),z('\u203a',`Next month, ${(0,P.monthName)((0,P.addMonths)(o,1))}`,j,1,'mt-next')]}):null,(0,oe.jsx)(b.default,{accessible:!0,accessibilityLabel:R,testID:"mt-summary",style:{alignItems:'center',width:'100%',gap:2},children:h.recorded?(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(f.T,{size:38,weight:"bold",colour:T.colours.gold,center:!0,testID:"mt-total",children:(0,P.poundsWhole)(h.total)}),(0,oe.jsx)(f.T,{center:!0,colour:T.colours.goldLight,children:W}),(0,oe.jsxs)(f.Muted,{center:!0,testID:"mt-best",children:["Best day: ",(0,P.shortDay)(h.best.date)," \xb7 ",(0,P.poundsWhole)(h.best.value)]}),H?(0,oe.jsx)(f.Muted,{center:!0,testID:"mt-vs",children:H}):null]}):(0,oe.jsx)(f.Muted,{center:!0,testID:"mt-empty",children:h.current?'No cash-ups yet this month.':`No cash-ups in ${h.month}.`})}),(0,oe.jsxs)(b.default,{style:{width:'100%',minWidth:0},children:[(0,oe.jsxs)(b.default,{testID:"mt-plot",onLayout:e=>d(e.nativeEvent.layout.width),style:{height:ne,width:'100%',overflow:'visible'},children:[r?(0,oe.jsxs)(n.default,{width:r,height:ne,accessibilityElementsHidden:!0,importantForAccessibility:"no-hide-descendants",children:[(0,oe.jsx)(a.Defs,{children:(0,oe.jsxs)(a.LinearGradient,{id:"mtFill",x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,oe.jsx)(a.Stop,{offset:"0",stopColor:"#3A2F1E",stopOpacity:1}),(0,oe.jsx)(a.Stop,{offset:"1",stopColor:"#3A2F1E",stopOpacity:.35})]})}),(0,oe.jsx)(a.Line,{x1:le,y1:$,x2:r-ae,y2:$,stroke:T.colours.hairline,strokeWidth:1}),D.filter(e=>e.length>1).map((e,t)=>(0,oe.jsx)(a.Path,{d:`${re(e)} L${e[e.length-1].x.toFixed(1)},142 L${e[0].x.toFixed(1)},142 Z`,fill:"url(#mtFill)",stroke:"none"},`a${t}`)),D.filter(e=>e.length>1).map((e,t)=>(0,oe.jsx)(a.Path,{d:re(e),stroke:T.colours.gold,strokeWidth:2.5,fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},`l${t}`)),D.filter(e=>1===e.length).map((e,t)=>(0,oe.jsx)(a.Circle,{cx:e[0].x,cy:e[0].y,r:3,fill:T.colours.gold},`s${t}`)),h.days.filter(e=>'missing'===e.state).map(e=>(0,oe.jsx)(a.Circle,{cx:I(e.day),cy:$,r:2,fill:"none",stroke:T.colours.muted,strokeWidth:1},e.date)),L&&'recorded'===L.state?(0,oe.jsx)(a.Line,{x1:I(L.day),y1:10,x2:I(L.day),y2:$,stroke:T.colours.goldMuted,strokeWidth:1,strokeDasharray:"3,3"}):null,h.current?(()=>{const e=h.days.find(e=>e.date===t);return(0,oe.jsx)(a.Circle,{cx:I(e.day),cy:'recorded'===e.state?C(e.value):$,r:4.5,fill:T.colours.gold,stroke:T.colours.surface,strokeWidth:1.5})})():null,L&&'recorded'===L.state&&L.date!==t?(0,oe.jsx)(a.Circle,{cx:I(L.day),cy:C(L.value),r:5,fill:T.colours.surface,stroke:T.colours.gold,strokeWidth:2}):null]}):null,r?B.map(e=>(0,oe.jsx)(m.default,{testID:`mt-day-${e.day}`,accessibilityRole:"button",accessibilityLabel:S(e),accessibilityState:{selected:L?.date===e.date},onPress:()=>u(e.date),style:{position:'absolute',top:0,height:ne,left:I(e.day)-w/Math.max(1,k-1)/2,width:w/Math.max(1,k-1)}},e.date)):null]}),(0,oe.jsx)(b.default,{testID:"mt-axis",style:{height:F.AXIS_BAND+6,minHeight:F.AXIS_BAND+6,width:'100%',position:'relative',overflow:'visible'},accessibilityElementsHidden:!0,importantForAccessibility:"no-hide-descendants",children:O.map(e=>(0,oe.jsx)(f.T,{size:F.AXIS_FONT,colour:T.colours.muted,style:{position:'absolute',left:I(e)-17,width:ie,top:0,textAlign:'center'},children:String(e)},e))})]}),L&&B.length?(0,oe.jsxs)(b.default,{style:{flexDirection:'row',alignItems:'center',justifyContent:'center',width:'100%',gap:4},children:[(0,oe.jsx)(m.default,{testID:"mt-day-prev",accessibilityRole:"button",accessibilityLabel:"Previous day",disabled:B[0]?.date===L.date,onPress:()=>M(-1),style:({pressed:e})=>({minWidth:48,minHeight:48,alignItems:'center',justifyContent:'center',opacity:B[0]?.date===L.date?.25:e?.6:1}),children:(0,oe.jsx)(f.T,{size:20,colour:T.colours.gold,center:!0,children:"\u2039"})}),(0,oe.jsxs)(b.default,{testID:"mt-readout",accessible:!0,accessibilityLiveRegion:"polite",accessibilityLabel:S(L),style:{flexShrink:1,minWidth:0,alignItems:'center',paddingVertical:4},children:[(0,oe.jsx)(f.Muted,{center:!0,children:L.date===t?`Today \xb7 ${(0,P.shortDay)(L.date)}`:(0,P.shortDay)(L.date)}),(0,oe.jsx)(f.T,{center:!0,size:20,weight:"semibold",colour:'recorded'===L.state?T.colours.goldLight:T.colours.muted,children:'recorded'===L.state?(0,P.poundsWhole)(L.value):'pending'===L.state?'Not cashed up yet':'No cash-up'})]}),(0,oe.jsx)(m.default,{testID:"mt-day-next",accessibilityRole:"button",accessibilityLabel:"Next day",disabled:B[B.length-1]?.date===L.date,onPress:()=>M(1),style:({pressed:e})=>({minWidth:48,minHeight:48,alignItems:'center',justifyContent:'center',opacity:B[B.length-1]?.date===L.date?.25:e?.6:1}),children:(0,oe.jsx)(f.T,{size:20,colour:T.colours.gold,center:!0,children:"\u203a"})})]}):null,(0,oe.jsx)(f.Muted,{center:!0,size:13,children:"From confirmed cash ups: gross takings, or card + cash. \u25cb = no cash up that day."})]})})}const ue='#3A2F1E';function he({split:e}){return(0,oe.jsx)(f.Card,{style:{alignItems:'center',gap:8},children:(0,oe.jsxs)(b.default,{testID:"home-covers-split",accessible:!0,accessibilityLabel:`Walk-ins and bookings today. ${e.a11y}`,style:{width:'100%',alignItems:'center',gap:8},children:[(0,oe.jsx)(f.T,{weight:"semibold",colour:T.colours.gold,center:!0,children:"Walk-ins and bookings today"}),e.empty?(0,oe.jsx)(f.Muted,{center:!0,children:"No Covers yet"}):(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsxs)(b.default,{style:{flexDirection:'row',flexWrap:'wrap',justifyContent:'center',gap:18,width:'100%'},children:[(0,oe.jsxs)(b.default,{style:{alignItems:'center',minWidth:120},children:[(0,oe.jsx)(f.T,{size:26,weight:"bold",colour:T.colours.gold,center:!0,testID:"split-walkin-pct",children:`${e.walkInPct}%`}),(0,oe.jsx)(f.T,{size:14,colour:T.colours.goldLight,center:!0,children:`Walk-ins \xb7 ${e.walkIns} Covers`})]}),(0,oe.jsxs)(b.default,{style:{alignItems:'center',minWidth:120},children:[(0,oe.jsx)(f.T,{size:26,weight:"bold",center:!0,testID:"split-booked-pct",children:`${e.bookingPct}%`}),(0,oe.jsx)(f.T,{size:14,colour:T.colours.muted,center:!0,children:`Booked \xb7 ${e.bookings} Covers`})]})]}),(0,oe.jsxs)(b.default,{style:{width:'100%',maxWidth:420,height:10,borderRadius:5,overflow:'hidden',flexDirection:'row',backgroundColor:ue,borderWidth:1,borderColor:T.colours.gold},children:[(0,oe.jsx)(b.default,{style:{width:`${e.walkInPct}%`,backgroundColor:T.colours.gold}}),(0,oe.jsx)(b.default,{style:{flex:1,backgroundColor:ue}})]})]})]})})}},1417,[843,1137,1418,17,780,1179,1072,1073,1410,1330,861,1076,264,385,85,777,858,876,1204,1187,845,1154,863,1053,866,804,1178,1055,1136,1141,1142,1006,839,1146,886,946,961,1428,1429,1145,1430,1156,853,1433,1182,1202,1201,1029,1030,1064,1094,1384,1149,1329,8]); -__d(function(_g,_r,_i,_a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.AdvancedSettings=function({go:e}){const{r:x,rid:P,today:O,me:z}=(0,R.useCtx)(6e4),V=z.replace(" (example)",""),J=x.settings,X=e=>v.useStore.getState().updateSettings(P,e),[ee,te]=(0,m.useState)(()=>(0,h.takeAdvancedPrefill)()),[oe,ae]=(0,m.useState)(null),ne=e=>{if(e.onReset)return e.onReset(),void ae(`${e.title}: back to the defaults.`);X(Object.fromEntries(e.reset.map(e=>[e,void 0]))),ae(`${e.title}: back to the defaults.`)},le=(0,M.useBookings)(P),re=(0,W.jsxs)(y.default,{style:{gap:8},children:[(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(j.T,{style:{flex:1},children:"Ask about allergies first (in red)"}),(0,W.jsx)(j.Badge,{kind:"red",label:"ALWAYS ON"})]}),(0,W.jsx)(j.Muted,{size:13,children:"Food safety: every booking answers this before anything else, and staff tick \u201cAllergens seen\u201d."}),(0,W.jsx)(j.Toggle,{label:"Ask if they\u2019re bringing a dog",value:(0,T.dogQuestionOn)(x),onChange:e=>X({dogQuestion:e})}),(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(j.T,{style:{flex:1},children:"Most dogs per booking time"}),(0,W.jsx)(K,{label:"dogs per time",step:1,min:0,max:20,value:J.maxDogsPerSlot??0,unit:e=>e?`${e} dog${1===e?'':'s'}`:'No limit',onChange:e=>X({maxDogsPerSlot:e||void 0})})]}),(0,W.jsx)(j.Toggle,{label:"Ask about wheelchair or step-free access",value:(0,T.accessQuestionOn)(x),onChange:e=>X({accessQuestion:e})}),(0,W.jsx)(j.Toggle,{label:"Vegan and vegetarian ticks (optional for guests)",value:(0,T.dietQuestionOn)(x),onChange:e=>X({dietQuestion:e})}),(0,W.jsx)(j.Toggle,{label:"Let guests ask for a table (shown as \u2018not guaranteed\u2019)",value:!1!==J.tableRequests,onChange:e=>X({tableRequests:e})}),(0,W.jsx)(j.Muted,{size:13,children:"Dog-friendly and step-free tables are marked on the table plan."}),e?(0,W.jsx)(j.Button,{small:!0,kind:"ghost",label:"Mark tables on the Table plan \u203a",onPress:()=>e('more','tableplan')}):null]}),ie=(0,T.dwellBands)(x),de=(e,s)=>X({dwellBands:ie.map((t,o)=>o===e?{...t,mins:s}:t)}),he=(0,W.jsxs)(y.default,{style:{gap:8},children:[(0,W.jsx)(j.Muted,{size:13,children:"How long a table usually stays, by party size. Used for \u201cNext table free\u201d and for spacing bookings on a table."}),ie.map((e,s)=>{const t=(0,T.dwellFor)(x,9999===e.upTo?20:e.upTo,le);return(0,W.jsxs)(y.default,{style:{gap:2},children:[(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(j.T,{style:{flex:1},children:(0,T.bandLabel)(ie,s)}),(0,W.jsx)(K,{label:`table time for ${(0,T.bandLabel)(ie,s)}`,min:30,max:360,value:e.mins,unit:Q,onChange:e=>de(s,e)})]}),t.learned&&t.mins!==e.mins?(0,W.jsxs)(j.Muted,{size:12,children:["From your last ",t.samples," tables: about ",Q(t.mins)," (used for estimates)"]}):null]},s)}),(0,W.jsx)(j.Toggle,{label:"Fine-tune from how long tables really stay",value:!1!==J.dwellLearn,onChange:e=>X({dwellLearn:e})}),(0,W.jsx)(j.Muted,{size:13,children:"Defaults: 90 min for 1\u20132 Covers, 105 min for 3\u20135, 2 hours for 6\u201319, 3 hours for 20 or more."})]}),ue=J.reservables??(0,S.reservablesOf)(x),ce=J.reservables??('anchorage'===P?ue:[]),pe=(e,s)=>X({reservables:ce.map(t=>t.id===e?{...t,...s}:t)}),ge=(0,W.jsxs)(y.default,{style:{gap:8},children:[ce.length?ce.map(e=>(0,W.jsxs)(y.default,{style:{gap:4},children:[(0,W.jsx)(j.Toggle,{label:`${e.name} can be reserved`,value:e.active,onChange:s=>pe(e.id,{active:s})}),(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(j.Muted,{children:"Price"}),(0,W.jsx)(K,{label:`${e.name} price`,min:5,max:1e3,value:Math.round(e.price/100),unit:e=>`\xa3${e}`,onChange:s=>pe(e.id,{price:100*s})})]}),(0,W.jsxs)(j.Muted,{size:12,children:["Uses: ",e.uses.map(e=>`${e.qty} ${e.key}`).join(' + ')," from the counted stock. Held from the Display count and shown as \u201cReserved\u201d."]})]},e.id)):(0,W.jsx)(j.Muted,{children:"No reservable dishes yet."}),(0,W.jsx)(j.Toggle,{label:"Guests can reserve a crab or lobster on its own",value:!1!==J.reserveStock,onChange:e=>X({reserveStock:e})}),(0,W.jsx)(j.Muted,{size:13,children:"The kitchen is told about each reservation and the Head Chef taps OK."})]}),be=(0,T.regularEventsOf)(x),[me,xe]=(0,m.useState)(null),fe=e=>X({regularEvents:e}),ye=me?me.name.trim()?me.time&&!H.test(me.time)?'Start time looks wrong (use 20:00).':me.lastFood&&!H.test(me.lastFood)?'Last food orders looks wrong (use 19:00).':'once'!==me.rule.kind||_.test(me.rule.date)?'':'Date looks wrong (use 2026-12-31).':'Give it a name.':'',je=(0,W.jsxs)(y.default,{style:{gap:8},children:[be.map(e=>(0,W.jsxs)(j.Card,{children:[(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(j.T,{weight:"semibold",style:{flex:1},children:e.name}),e.busier?(0,W.jsx)(j.Badge,{kind:"gold",label:"BUSIER"}):null,e.active?null:(0,W.jsx)(j.Badge,{kind:"neutral",label:"OFF"})]}),(0,W.jsxs)(j.Muted,{children:[(0,T.ruleText)(e.rule),e.time?` \xb7 from ${e.time}`:'',e.lastFood?` \xb7 last food orders ${e.lastFood}`:'']}),e.active?(0,W.jsxs)(j.Muted,{size:12,children:["Next: ",(0,T.nextOccurrence)(e,O)??'\u2014']}):null,(0,W.jsxs)(j.Row,{gap:6,children:[(0,W.jsx)(j.Button,{small:!0,kind:"secondary",label:"Edit",testID:`event-edit-${e.id}`,onPress:()=>xe({...e})}),(0,W.jsx)(j.Button,{small:!0,kind:"ghost",label:"Remove",onPress:()=>fe(be.filter(s=>s.id!==e.id))})]})]},e.id)),me?(0,W.jsxs)(j.Card,{highlight:D.colours.gold,children:[(0,W.jsxs)(j.Row,{gap:8,style:{flexWrap:'wrap'},children:[(0,W.jsx)(j.Muted,{children:"Name"}),(0,W.jsx)(q,{label:"Event name",width:220,value:me.name,onChange:e=>xe({...me,name:e}),placeholder:"Open Mic Night"})]}),(0,W.jsx)(j.Muted,{children:"Repeats"}),(0,W.jsxs)(j.Row,{wrap:!0,gap:6,children:[(0,W.jsx)(j.Chip,{label:"Last \u2026 of the month",selected:'last'===me.rule.kind,onPress:()=>xe({...me,rule:{kind:'last',weekday:'weekday'in me.rule?me.rule.weekday:0}})}),(0,W.jsx)(j.Chip,{label:"Every week",selected:'weekly'===me.rule.kind,onPress:()=>xe({...me,rule:{kind:'weekly',weekday:'weekday'in me.rule?me.rule.weekday:0}})}),(0,W.jsx)(j.Chip,{label:"One-off date",selected:'once'===me.rule.kind,onPress:()=>xe({...me,rule:{kind:'once',date:O}})})]}),'weekday'in me.rule?(0,W.jsx)(j.Row,{wrap:!0,gap:6,children:Y.map(e=>(0,W.jsx)(j.Chip,{label:G[e],selected:me.rule.weekday===e,onPress:()=>xe({...me,rule:{...me.rule,weekday:e}})},e))}):(0,W.jsxs)(j.Row,{gap:8,children:[(0,W.jsx)(j.Muted,{children:"Date (DD/MM/YYYY)"}),(0,W.jsx)(q,{label:"Event date",width:130,value:(0,t.slashDay)(me.rule.date),onChange:e=>{const s=(0,t.slashDate)(e,(0,t.slashDay)(me.rule.date));xe({...me,rule:{kind:'once',date:(0,t.dayFromSlash)(s)??s}})},placeholder:"31/12/2026"})]}),(0,W.jsxs)(j.Row,{gap:8,style:{flexWrap:'wrap'},children:[(0,W.jsx)(j.Muted,{children:"Starts (optional)"}),(0,W.jsx)(q,{label:"Start time",value:me.time??'',onChange:e=>xe({...me,time:e||void 0}),placeholder:"20:00",bad:!!me.time&&!H.test(me.time)})]}),(0,W.jsxs)(j.Row,{gap:8,style:{flexWrap:'wrap'},children:[(0,W.jsx)(j.Muted,{children:"Last food orders (optional)"}),(0,W.jsx)(q,{label:"Last food orders",value:me.lastFood??'',onChange:e=>xe({...me,lastFood:e||void 0}),placeholder:"19:00",bad:!!me.lastFood&&!H.test(me.lastFood)})]}),(0,W.jsxs)(j.Row,{gap:8,style:{flexWrap:'wrap'},children:[(0,W.jsx)(j.Muted,{children:"Notes"}),(0,W.jsx)(q,{label:"Notes",width:240,value:me.notes??'',onChange:e=>xe({...me,notes:e||void 0}),placeholder:"Live music from 8pm"})]}),(0,W.jsx)(j.Toggle,{label:"Expect busier (raises the forecast)",value:me.busier,onChange:e=>xe({...me,busier:e})}),(0,W.jsx)(j.Toggle,{label:"On",value:me.active,onChange:e=>xe({...me,active:e})}),ye?(0,W.jsx)(j.T,{size:13,colour:D.colours.red,children:ye}):null,(0,W.jsxs)(j.Row,{gap:6,children:[(0,W.jsx)(j.Button,{small:!0,label:"Save event",disabled:!!ye,testID:"event-save",onPress:()=>{const e={...me,name:me.name.trim()};fe(be.some(s=>s.id===e.id)?be.map(s=>s.id===e.id?e:s):[...be,e]),xe(null),ae(`Saved ${e.name}.`)}}),(0,W.jsx)(j.Button,{small:!0,kind:"ghost",label:"Cancel",onPress:()=>xe(null)})]})]}):(0,W.jsx)(j.Button,{small:!0,kind:"secondary",label:"\uff0b Add a regular event",testID:"event-add",onPress:()=>xe({id:`ev-${Date.now().toString(36)}`,name:'',rule:{kind:'last',weekday:0},busier:!0,active:!0})}),(0,W.jsx)(j.Muted,{size:13,children:"Events show in Forecast key dates (with a Promote button), on the Today date bar, and lift the forecast when \u201cExpect busier\u201d is on."})]}),we=(0,C.hourSetsOf)(x),ke=(0,C.seasonOn)(x,new Date),[ve,Ce]=(0,m.useState)(null),[Se,Te]=(0,m.useState)(null),De=J.hourOverrides??[],Re=ve?ve.start&&!U.test(ve.start)?'Start date looks wrong (use day and month as MM-DD, e.g. 04-01 for 1 April).':ve.hours&&Object.values(ve.hours).some(e=>e&&(!H.test(e[0])||!H.test(e[1])||e[0]>=e[1]))?'Check the times: use 12:00 and 19:00, and closing must be after opening.':'':'',Me=Object.values(J.lastFoodByDay??{}).some(e=>e&&!H.test(e)),Le=[];we.some(e=>!e.hours)&&Le.push(`${we.filter(e=>!e.hours).map(e=>e.name).join(' and ')} kitchen hours`);we.filter(e=>e.hours).length>=1&&we.length>1&&we.some(e=>!e.start)&&Le.push('the date each season starts');const Pe=(0,W.jsxs)(y.default,{style:{gap:8},children:[(0,W.jsx)(j.Muted,{size:13,children:"Kitchen (food) hours, not bar hours. The closing time is last food orders. Dining bookings are only offered inside these hours."}),Le.length?(0,W.jsxs)(j.Banner,{kind:"warn",title:"To finish setting up",children:["Please add ",Le.join(' and '),". Until then the app uses ",ke?.name??'your weekly'," hours all year."]}):null,ke?(0,W.jsxs)(j.T,{colour:D.colours.goldLight,children:["In use today: ",ke.name]}):null,we.map(e=>(0,W.jsxs)(j.Card,{children:[(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(j.T,{weight:"semibold",children:e.name}),ke?.id===e.id?(0,W.jsx)(j.Badge,{kind:"gold",label:"IN USE"}):e.hours?null:(0,W.jsx)(j.Badge,{kind:"amber",label:"NOT SET"})]}),(0,W.jsx)(j.Muted,{children:e.start?`Starts every year on ${e.start}`:'Start date: not set yet'}),e.hours?(0,W.jsx)(j.Muted,{size:13,children:Y.map(s=>`${G[s]} ${e.hours[s]?`${e.hours[s][0]}\u2013${e.hours[s][1]}`:'closed'}`).join(' \xb7 ')}):(0,W.jsx)(j.Muted,{size:13,children:"No hours yet."}),(0,W.jsx)(j.Button,{small:!0,kind:"secondary",label:e.hours?'Edit':`Set ${e.name} hours`,testID:`season-edit-${e.id}`,onPress:()=>Ce({...e,hours:e.hours?{...e.hours}:{...we.find(e=>e.hours)?.hours??x.kitchenHours}})})]},e.id)),ve?(0,W.jsxs)(j.Card,{highlight:D.colours.gold,children:[(0,W.jsxs)(j.T,{weight:"semibold",children:[ve.name," hours"]}),(0,W.jsxs)(j.Row,{gap:8,style:{flexWrap:'wrap'},children:[(0,W.jsx)(j.Muted,{children:"Starts every year on (MM-DD)"}),(0,W.jsx)(q,{label:"Season start date",value:ve.start??'',onChange:e=>Ce({...ve,start:e||void 0}),placeholder:"04-01",bad:!!ve.start&&!U.test(ve.start)})]}),Y.map(e=>{const s=ve.hours?.[e]??null,t=s=>Ce({...ve,hours:{...ve.hours,[e]:s}});return(0,W.jsxs)(j.Row,{gap:6,style:{flexWrap:'wrap'},children:[(0,W.jsx)(j.T,{style:{width:44},children:G[e]}),(0,W.jsx)(j.Chip,{label:s?'Open':'Closed',selected:!!s,onPress:()=>t(s?null:['12:00','19:00'])}),s?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(q,{label:`${T.DAYS[e]} opens`,value:s[0],width:74,onChange:e=>t([e,s[1]]),bad:!H.test(s[0])}),(0,W.jsx)(j.Muted,{children:"to"}),(0,W.jsx)(q,{label:`${T.DAYS[e]} last food orders`,value:s[1],width:74,onChange:e=>t([s[0],e]),bad:!H.test(s[1])||s[0]>=s[1]})]}):null]},e)}),Re?(0,W.jsx)(j.T,{size:13,colour:D.colours.red,children:Re}):null,(0,W.jsxs)(j.Row,{gap:6,children:[(0,W.jsx)(j.Button,{small:!0,label:"Save hours",disabled:!!Re,testID:"season-save",onPress:()=>{var e;e=we.map(e=>e.id===ve.id?ve:e),X({hourSets:e}),Ce(null),ae(`Saved ${ve.name} hours.`)}}),(0,W.jsx)(j.Button,{small:!0,kind:"ghost",label:"Cancel",onPress:()=>Ce(null)})]})]}):null,(0,W.jsx)(j.T,{weight:"semibold",style:{marginTop:6},children:"Special days"}),(0,W.jsx)(j.Muted,{size:13,children:"One-off changes, e.g. closed for a private party or open late on Hogmanay."}),De.map(e=>(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsxs)(j.T,{style:{flex:1},children:[e.date,": ",e.hours?`${e.hours[0]}\u2013${e.hours[1]}`:'kitchen closed',e.note?` \xb7 ${e.note}`:'']}),(0,W.jsx)(j.Button,{small:!0,kind:"ghost",label:"Remove",onPress:()=>X({hourOverrides:De.filter(s=>s.date!==e.date)})})]},e.date)),Se?(0,W.jsxs)(j.Card,{highlight:D.colours.gold,children:[(0,W.jsxs)(j.Row,{gap:8,children:[(0,W.jsx)(j.Muted,{children:"Date (DD/MM/YYYY)"}),(0,W.jsx)(q,{label:"Special day date",width:130,value:(0,t.slashDay)(Se.date),onChange:e=>{const s=(0,t.slashDate)(e,(0,t.slashDay)(Se.date));Te({...Se,date:(0,t.dayFromSlash)(s)??s})},placeholder:"31/12/2026",bad:!_.test(Se.date)})]}),(0,W.jsxs)(j.Row,{gap:6,style:{flexWrap:'wrap'},children:[(0,W.jsx)(j.Chip,{label:Se.hours?'Open':'Closed',selected:!!Se.hours,onPress:()=>Te({...Se,hours:Se.hours?null:['12:00','19:00']})}),Se.hours?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(q,{label:"Opens",width:74,value:Se.hours[0],onChange:e=>Te({...Se,hours:[e,Se.hours[1]]})}),(0,W.jsx)(j.Muted,{children:"to"}),(0,W.jsx)(q,{label:"Last food orders",width:74,value:Se.hours[1],onChange:e=>Te({...Se,hours:[Se.hours[0],e]})})]}):null]}),(0,W.jsxs)(j.Row,{gap:8,children:[(0,W.jsx)(j.Muted,{children:"Note"}),(0,W.jsx)(q,{label:"Note",width:220,value:Se.note??'',onChange:e=>Te({...Se,note:e||void 0}),placeholder:"Private party"})]}),(()=>{const e=_.test(Se.date)?Se.hours&&(!H.test(Se.hours[0])||!H.test(Se.hours[1])||Se.hours[0]>=Se.hours[1])?'Check the times.':'':'Date looks wrong (use 2026-12-31).';return(0,W.jsxs)(W.Fragment,{children:[e?(0,W.jsx)(j.T,{size:13,colour:D.colours.red,children:e}):null,(0,W.jsxs)(j.Row,{gap:6,children:[(0,W.jsx)(j.Button,{small:!0,label:"Save special day",disabled:!!e,onPress:()=>{X({hourOverrides:[...De.filter(e=>e.date!==Se.date),Se].sort((e,s)=>e.date.localeCompare(s.date))}),Te(null)}}),(0,W.jsx)(j.Button,{small:!0,kind:"ghost",label:"Cancel",onPress:()=>Te(null)})]})]})})()]}):(0,W.jsx)(j.Button,{small:!0,kind:"secondary",label:"\uff0b Add a special day",testID:"override-add",onPress:()=>Te({date:O,hours:null})}),(0,W.jsx)(j.T,{weight:"semibold",style:{marginTop:6},children:"Earlier last food orders (optional)"}),(0,W.jsx)(j.Muted,{size:13,children:"Leave blank to use the kitchen closing time. Regular events can set their own (Open Mic Night: 7pm)."}),(0,W.jsx)(j.Row,{wrap:!0,gap:8,children:Y.map(e=>(0,W.jsxs)(y.default,{style:{gap:2},children:[(0,W.jsx)(j.Muted,{size:12,children:G[e]}),(0,W.jsx)(q,{label:`${T.DAYS[e]} last food orders`,width:74,value:J.lastFoodByDay?.[e]??'',placeholder:"\u2014",bad:!!J.lastFoodByDay?.[e]&&!H.test(J.lastFoodByDay[e]),onChange:s=>X({lastFoodByDay:{...J.lastFoodByDay??{},[e]:s||void 0}})})]},e))}),Me?(0,W.jsx)(j.T,{size:13,colour:D.colours.red,children:"Use times like 19:00 (blank = kitchen close)."}):null,(0,W.jsx)(j.Muted,{children:"After last food orders, booking times are\u2026"}),(0,W.jsxs)(j.Row,{gap:6,children:[(0,W.jsx)(j.Chip,{label:"Offered for drinks only",selected:'drinks'===(0,T.afterLastFood)(x),onPress:()=>X({afterLastFood:'drinks'})}),(0,W.jsx)(j.Chip,{label:"Not offered",selected:'block'===(0,T.afterLastFood)(x),onPress:()=>X({afterLastFood:'block'})})]})]}),Oe=(0,W.jsxs)(y.default,{style:{gap:8},children:[(0,W.jsx)(j.Toggle,{label:"COVERS counter on Today (done / to come / total)",value:(0,T.coversCounterOn)(x),onChange:e=>X({coversCounter:e})}),(0,W.jsx)(j.Toggle,{label:"\u2018Next table free\u2019 when you\u2019re full",value:(0,T.nextTableOn)(x),onChange:e=>X({nextTableFree:e})}),(0,W.jsx)(j.Toggle,{label:"Show takeaway on home screens",value:(0,T.showTakeaway)(x),onChange:e=>X({showTakeaway:e})}),(0,W.jsx)(j.Muted,{size:13,children:"Takeaway order alerts always work. With this off, takeaway figures sit in a collapsed Takeaway section."}),(0,W.jsx)(j.Muted,{size:13,children:"The flap click sound is set on each Display (Display settings), off by default."})]}),ze=(0,W.jsxs)(y.default,{style:{gap:8},children:[(0,W.jsx)(j.Toggle,{label:"Show full gov.uk names, e.g. \u2018(substitute day)\u2019",value:!!J.holidayFullNames,onChange:e=>X({holidayFullNames:e})}),(0,W.jsx)(j.Muted,{size:13,children:"Off: \u201cChristmas Day\u201d shows on its date without \u201c(substitute day)\u201d."})]}),[Ie,$e]=(0,m.useState)(null),Ae=Ie??J.whatsapp??'',Be=!Ae.trim()||!!(0,L.waNumber)(Ae),Fe=(0,W.jsxs)(y.default,{style:{gap:8},children:[(0,W.jsx)(j.T,{children:"The venue\u2019s WhatsApp number"}),(0,W.jsxs)(j.Row,{gap:8,wrap:!0,children:[(0,W.jsx)(q,{label:"Venue WhatsApp number",testID:"adv-whatsapp-number",width:220,value:Ae,placeholder:"e.g. 01292 500123 or +44 7\u2026",bad:!Be,onChange:e=>{$e(e),e.trim()?(0,L.waNumber)(e)&&X({whatsapp:e.trim()}):X({whatsapp:void 0})}}),Ae.trim()&&Be?(0,W.jsx)(j.Badge,{kind:"gold",label:`wa.me/${(0,L.waNumber)(Ae)}`}):null]}),Be?null:(0,W.jsx)(j.T,{size:13,colour:D.colours.red,children:"That doesn\u2019t look like a phone number. Use the full number, e.g. 01292 500123 or +44 7700 900123."}),(0,W.jsx)(j.Muted,{size:13,children:"With a number here, guests see \u201cMessage us on WhatsApp\u201d on their booking confirmation, and staff and managers see \u201cWhatsApp guest\u201d on bookings that have a mobile number. Blank: all WhatsApp buttons stay hidden."}),(0,W.jsx)(j.Muted,{size:13,children:"Tip: nothing is ever sent for you. The button opens WhatsApp with a message typed in, and the person taps Send themselves."})]}),Ee=(0,N.soldOutSettingsOf)(J.soldOut),Ne=(0,W.jsxs)(y.default,{style:{gap:8},children:[(0,W.jsx)(j.Toggle,{testID:"adv-soldout-auto",label:"Mark dishes sold out from the counts",value:Ee.auto,onChange:e=>X({soldOut:{...Ee,auto:e}}),a11y:"Mark dishes sold out from the live counts"}),(0,W.jsx)(j.Muted,{size:13,children:Ee.auto?'On: when a count (lobster, crab\u2026) runs out or drops below what a dish needs, every dish that uses it is marked sold out, with the reason, e.g. \u201cDeluxe Seafood Platter (no lobster)\u201d. It goes back on when the count is back up. Dishes marked by hand are left alone. Change which dishes use what in any Sold out list.':'Off: dishes are only marked sold out by hand. Dishes marked from the counts go back on.'}),(0,W.jsx)(j.T,{children:"Clear sold out dishes by themselves"}),(0,W.jsx)(j.Row,{wrap:!0,gap:8,children:['close','morning','manual'].map(e=>(0,W.jsx)(j.Chip,{testID:`adv-soldout-${e}`,label:N.SOLD_OUT_CLEAR_LABEL[e],selected:Ee.clear===e,onPress:()=>X({soldOut:{...Ee,clear:e}})},e))}),'manual'!==Ee.clear?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(j.T,{children:"Next morning means"}),(0,W.jsx)(j.Row,{wrap:!0,gap:8,children:['04:00','05:00','06:00','08:00'].map(e=>(0,W.jsx)(j.Chip,{label:e,selected:Ee.morningAt===e,onPress:()=>X({soldOut:{...Ee,morningAt:e}})},e))})]}):null,(0,W.jsx)(j.Muted,{size:13,children:'close'===Ee.clear?'Dishes go back on at the kitchen\u2019s closing time that day (from Kitchen hours). Marked after closing: the next morning.':'morning'===Ee.clear?`Dishes go back on at ${Ee.morningAt} the next morning.`:'Dishes stay sold out until someone taps Back on.'}),(0,W.jsx)(j.Muted,{size:13,children:"Tip: Sold out is a reminder for staff. It shows on the Display\u2019s slim strip and in every staff app\u2019s Sold out list. CoverCharge doesn\u2019t link up to your till, so it doesn\u2019t change the till."})]}),We=(0,s.venueBusy)(x,le,new Date),He=(0,E.clampWeeks)(J.forecastMinWeeks),Ue=(0,W.jsxs)(y.default,{style:{gap:8},children:[(0,W.jsxs)(y.default,{testID:"busy-level-setting",style:{alignItems:'center',gap:12},accessible:!0,accessibilityLabel:We.words,children:[(0,W.jsx)(j.T,{center:!0,size:20,weight:"semibold",children:We.words}),(0,W.jsx)(j.Stepper,{testID:"busy-covers-hour",label:"Busy level in Covers an hour",value:J.busyCoversPerHour??30,min:1,max:200,onChange:e=>X({busyCoversPerHour:e,busyLearning:!1})}),(0,W.jsx)(j.Muted,{children:"Learning starts from your chosen level; enabling it starts a fresh history period, so older trading patterns do not immediately replace your choice."}),(0,W.jsx)(j.Toggle,{label:"Learn the busy level from our real history",value:!1!==J.busyLearning,onChange:e=>X({busyLearning:e,busyLearningSince:(new Date).toISOString().slice(0,10)})}),(0,W.jsx)(j.T,{center:!0,size:16,children:"Steady starts at half the busy level. Busy starts at the busy level. Hourly forecasts use the upper end of their range."}),(0,W.jsx)(j.T,{center:!0,size:16,children:"Learning needs at least 4 weeks, 16 trading days and 40 recorded hours. It uses the 85th percentile of recorded hourly arrivals over the last 8 weeks, including walk-ins, excluding cancellations and no-shows. Changing the number keeps your override until learning is switched on again."}),We.enough?null:(0,W.jsx)(j.T,{center:!0,size:16,children:"Not enough real hourly history to learn yet. Using the starting or owner-set level."})]}),(0,W.jsx)(j.T,{children:"History needed before forecasts show"}),(0,W.jsx)(j.Row,{wrap:!0,gap:8,children:[1,2,3,4,6,8].map(e=>(0,W.jsx)(j.Chip,{testID:`adv-forecast-weeks-${e}`,label:1===e?'1 week':`${e} weeks`,selected:He===e,onPress:()=>X({forecastMinWeeks:e})},e))}),(0,W.jsx)(j.Muted,{size:13,children:`Forecasts, expected walk-ins and labour vs sales start once CoverCharge has ${1===He?'1 week':`${He} weeks`} of your bookings (and cash-ups for sales). Until then you see what is booked and your real labour cost, never invented figures.`}),(0,W.jsx)(j.Muted,{size:13,children:"Tip: 2 weeks is a sensible start. More weeks give steadier forecasts but take longer to begin."}),(0,W.jsx)(l.ForecastDaySettings,{r:x,set:X})]}),Ye=(0,w.depositOf)(J),Ge=e=>X({deposit:{...Ye,...e}}),qe=o.IS_GREENSIDE?(0,W.jsx)(a.GreensideCashOnly,{}):(0,W.jsxs)(y.default,{style:{gap:8},children:[(0,W.jsx)(j.Toggle,{testID:"adv-deposit-on",label:"Ask bigger tables for a deposit",value:Ye.on,onChange:e=>Ge({on:e})}),(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(j.T,{children:"Amount per adult"}),(0,W.jsx)(j.Stepper,{testID:"adv-deposit-amount",value:Ye.perPersonPence/100,min:0,max:100,format:e=>`\xa3${e}`,onChange:e=>Ge({perPersonPence:100*e}),label:"deposit per person"})]}),(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(j.T,{children:"From a party of"}),(0,W.jsx)(j.Stepper,{testID:"adv-deposit-party",value:Ye.fromParty,min:1,max:30,onChange:e=>Ge({fromParty:e}),label:"deposit from party size"})]}),(0,W.jsx)(j.T,{children:"Refundable?"}),(0,W.jsxs)(j.Row,{wrap:!0,gap:8,children:[(0,W.jsx)(j.Chip,{testID:"adv-deposit-ref-yes",label:"Yes",selected:!0===Ye.refundable,onPress:()=>Ge({refundable:!0})}),(0,W.jsx)(j.Chip,{testID:"adv-deposit-ref-no",label:"No",selected:!1===Ye.refundable,onPress:()=>Ge({refundable:!1,cutoffHours:null})}),(0,W.jsx)(j.Chip,{testID:"adv-deposit-ref-unset",label:"Not set yet",selected:null===Ye.refundable,onPress:()=>Ge({refundable:null,cutoffHours:null})})]}),!0===Ye.refundable?(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(j.T,{children:"Refunded if cancelled this many hours before"}),(0,W.jsx)(j.Stepper,{testID:"adv-deposit-cutoff",value:Ye.cutoffHours??0,min:0,max:168,step:6,format:e=>e?`${e} h`:'Any time',onChange:e=>Ge({cutoffHours:e||null}),label:"refund cut-off hours"})]}):null,(0,W.jsx)(j.T,{children:"Words guests see (optional)"}),(0,W.jsx)(n.TextInput,{accessibilityLabel:"Deposit policy shown to guests",testID:"adv-deposit-policy",value:Ye.policy,multiline:!0,onChangeText:e=>Ge({policy:e.slice(0,600)}),placeholder:"e.g. The deposit comes off your bill on the night.",placeholderTextColor:D.colours.muted,style:{minHeight:70,borderRadius:10,borderWidth:1,borderColor:D.colours.hairline,backgroundColor:D.colours.surface2,color:D.colours.text,padding:10,fontSize:15}}),(0,W.jsx)(j.Muted,{size:13,children:Ye.on&&Ye.perPersonPence>0?`Guests booking for ${Ye.fromParty} or more see: \u201c${(0,w.depositWords)(Ye,Ye.fromParty,x.name).join(' ')}\u201d`:'Off: no booking asks for a deposit.'}),(0,W.jsx)(j.Toggle,{testID:"adv-deposit-wixlinks",label:"Send website bookings deposit links for phone and walk-in bookings",a11y:"Send website bookings deposit links for phone and walk-in bookings",value:!!Ye.wixLinksOn,onChange:e=>Ge({wixLinksOn:e})}),Ye.wixLinksOn?(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(j.T,{children:"Link works for"}),(0,W.jsx)(j.Stepper,{testID:"adv-deposit-linkhours",value:Ye.wixLinkHours??48,min:6,max:168,step:6,format:e=>`${e} hours`,onChange:e=>Ge({wixLinkHours:e}),label:"hours a deposit link works"})]}):null,(0,W.jsx)(j.Muted,{size:13,children:Ye.wixLinksOn?'On here, but website bookings deposit links also need the server switch, which stays off until the first \xa31 test is approved. Until then the button says so and nothing goes to website bookings.':'Off: no deposit links. Bookings work as before.'}),(0,W.jsx)(j.Muted,{size:13,children:"Tip: deposits are paid through website bookings, never in CoverCharge, and no card is saved. Guests who book on your website pay there, and the booking shows Deposit paid on website bookings by itself. For phone and walk-in bookings, tick Deposit paid once the guest has paid you, or send a website bookings deposit link. Refunds are done in Website bookings \u203a Orders. Deposit amounts are shown on bookings in Managers, Display and Staff. This does not grant access to other financial or HR information."})]}),Ke=(0,W.jsx)(k.LoyaltySettingsPanel,{}),Qe=(0,W.jsx)(se,{rid:P}),Ve=[{id:'bookings',title:'Bookings',words:'allergen allergy dog dogs cap limit access wheelchair step-free vegan vegetarian veg table request',reset:['dogQuestion','maxDogsPerSlot','accessQuestion','dietQuestion','tableRequests'],body:re,help:'adv-bookings'},{id:'times',title:'Table times',words:'dwell table time turn how long minutes party size next table free',reset:['dwellBands','dwellLearn'],body:he,help:'adv-table-times'},{id:'reserve',title:'Reservable items',words:'platter seafood crab lobster reserve price stock',reset:['reservables','reserveStock'],body:ge,help:'adv-reservable'},{id:'events',title:'Regular events',words:'open mic night music night event repeat monthly weekly promote busier forecast last food',reset:['regularEvents'],body:je,help:'adv-events'},{id:'hours',title:'Kitchen hours & last food orders',words:'hours kitchen season winter summer open close closed special day last food orders cutoff drinks',reset:['hourSets','hourOverrides','lastFoodByDay','afterLastFood'],body:Pe,help:'adv-hours'},{id:'home',title:'Display & home',words:'covers counter flip sound takeaway next table free home display',reset:['coversCounter','nextTableFree','showTakeaway'],body:Oe,help:'adv-home'},{id:'deposits',title:'Deposits',words:'deposit deposits per person party size refund refundable cut off policy paid due booking money wix link pay link online',reset:['deposit'],body:qe,help:'adv-deposits'},{id:'loyalty',title:'Loyalty: stamp card, offers & bring a friend',words:'loyalty stamp stamps card reward rewards offer offers referral refer friend bring expiry',reset:[],body:Ke,help:'adv-loyalty',noReset:!0},{id:'tableorder',title:'Order at the table',words:'order at table qr code scan phone guest menu tables areas accept first order last orders kitchen cut off print sheet pdf pay bar till',reset:[],body:o.IS_GREENSIDE?(0,W.jsx)(a.GreensideCashOnly,{}):(0,W.jsx)(r.TableOrderSettings,{rid:P,me:V}),help:'adv-table-order',noReset:!0},{id:'whatsapp',title:'WhatsApp',words:'whatsapp wa.me message chat guest phone mobile number tap',reset:['whatsapp'],body:Fe,help:'adv-whatsapp'},{id:'reminders',title:'Reminders',words:'reminder reminders break breaks chairs tables close closing shift staff nudge 6 hours law snooze later done',reset:[],body:Qe,help:'adv-reminders',onReset:()=>Z(P)},{id:'notifications',title:'Notifications',words:'notification notifications push phone scheduled order milk mills pieroni pieronis fish veg olsen rota upload remind time send',reset:[],body:(0,W.jsx)(B.NotificationsSettings,{rid:P}),help:'adv-notifications',onReset:()=>F.useNotifs.getState().resetSeeds(P)},{id:'orderlists',title:'Order lists',words:'order list lists alsons drinks cash carry trip shopping supplier logo staff add',reset:[],body:(0,W.jsx)(B.OrderListsSettings,{rid:P}),help:'adv-order-lists',onReset:()=>(0,B.resetOrderLists)(P)},{id:'tasks',title:'Tasks',words:'daily tasks library jobs checklist duties to do todo',reset:[],body:(0,W.jsx)(c.TaskLibrarySettings,{rid:P}),help:'adv-tasks',onReset:()=>b.useDailyTasks.getState().resetLibrary(P)},{id:'cashup',title:'Cash up',words:'cash up sheet takings till float card cash tips weekly sales report pos printout figures fields vat covers',reset:[],body:(0,W.jsx)(p.CashUpSettings,{rid:P}),help:'adv-cashup',onReset:()=>g.useCashUp.getState().resetFields(P)},{id:'tips',title:'Tips',words:'tips pot today tips show hide staff apps payout correction',reset:[],body:(0,W.jsx)(p.TipsSettings,{rid:P}),help:'adv-tips',onReset:()=>g.useCashUp.getState().setShow(P,{showToday:!0,showPot:!0})},{id:'clockarea',title:'Clock-in area',words:'clock in out geofence location area radius gps break forgot forgotten rota visiting map',reset:[],body:(0,W.jsx)(B.ClockAreaSettings,{rid:P,me:V}),help:'adv-clock-area',onReset:()=>(0,B.resetClockArea)(P,V)},{id:'checkout',title:'Shift check-out & question board',words:'check out checkout morale mood staffing staff enough overstaffed survey anonymous question board vote shout out shoutout wellbeing hr wording',reset:['hr'],body:(0,W.jsx)(u.HrSettingsCard,{rid:P}),help:'adv-checkout'},{id:'forecast',title:'Forecast history',words:'forecast history weeks estimate walk-ins opening hours minimum covers floor saturday sunday labour sales example figures not enough history',reset:['forecastMinWeeks'],body:Ue,help:'adv-forecast'},{id:'soldout',title:'Sold out reminders',words:'sold out 86 eighty six run out ran out back on clear end of service morning display strip auto automatic counts shellfish lobster crab platter link uses',reset:['soldOut'],body:Ne,help:'adv-soldout'},{id:'tablegrid',title:'Table plan grid',words:'table plan grid snap line up align tidy tables floor layout guides spacing restore',reset:[],body:(0,W.jsx)(I.GridSettings,{rid:P,me:V}),help:'adv-tablegrid',onReset:()=>{const e=A.useFloor.getState().settings[P];A.useFloor.getState().setSettings(P,{...A.DEFAULT_SETTINGS,...e??{},gridSnap:!0,gridSize:25})}},{id:'printers',title:'Printers',words:'print printer printers printing ticket tickets kitchen ticket docket receipt epson star bluetooth wifi reprint takeaway auto front of house copies',reset:[],body:(0,W.jsx)($.PrintersSettings,{rid:P,go:e}),help:'adv-printers',onReset:()=>{const e=A.useFloor.getState().settings[P];e&&A.useFloor.getState().setSettings(P,{...e,printing:void 0})}},{id:'blocks',title:'Block bookings: lunch, dinner and website bookings',words:'block blocks blocked pause close lunch dinner service times wix website online push',reset:[],noReset:!0,body:(0,W.jsx)(d.BlockSettings,{rid:P}),help:'adv-blocks'},{id:'giftqr',title:'Gift cards on the Display',words:'gift card cards voucher qr code display buy sell wix website page link',reset:[],noReset:!0,body:(0,W.jsx)(i.GiftQrSettings,{rid:P}),help:'adv-giftqr'},{id:'holidays',title:'Holiday names',words:'bank holiday substitute day names',reset:['holidayFullNames'],body:ze,help:'adv-holidays'}],Ze=ee.trim().toLowerCase(),Je=(0,m.useMemo)(()=>Ve.filter(e=>!Ze||`${e.title} ${e.words}`.toLowerCase().includes(Ze)),[Ze,Ve]);return(0,W.jsxs)(y.default,{style:{gap:12},testID:"advanced-settings",children:[(0,W.jsx)(j.Muted,{children:"Owners and managers only. Changes are shared with your team\u2019s devices."}),(0,W.jsx)(n.TextInput,{accessibilityLabel:"Search settings",testID:"advanced-search",value:ee,onChangeText:te,placeholder:"Search, e.g. dogs, Open Mic Night, hours",placeholderTextColor:D.colours.muted,style:{minHeight:46,borderRadius:12,borderWidth:1,borderColor:D.colours.accentBorder,backgroundColor:D.colours.surface2,color:D.colours.text,paddingHorizontal:12,fontSize:16}}),oe?(0,W.jsx)(j.Banner,{kind:"success",title:oe}):null,Je.length?null:(0,W.jsxs)(j.Muted,{children:["No settings match \u201c",ee,"\u201d."]}),Je.map(s=>(0,W.jsx)(j.Card,{children:(0,W.jsxs)(y.default,{testID:`adv-${s.id}`,style:{gap:10},children:[(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(j.T,{size:17,weight:"semibold",colour:D.colours.gold,children:s.title}),e?(0,W.jsx)(f.default,{accessibilityRole:"button",accessibilityLabel:`Help: ${s.title}`,onPress:()=>e('more','help'),hitSlop:8,style:{minHeight:44,minWidth:44,justifyContent:'center'},children:(0,W.jsx)(j.T,{colour:D.colours.muted,children:"? Help"})}):null]}),s.body,s.noReset?null:(0,W.jsx)(j.Row,{style:{justifyContent:'flex-end'},children:(0,W.jsx)(j.Button,{small:!0,kind:"ghost",label:"Reset to default",testID:`reset-${s.id}`,onPress:()=>ne(s)})})]})},s.id))]})},Object.defineProperty(_e,"ADVANCED_DEFAULTS",{enumerable:!0,get:function(){return V}}),_e.SeasonsTodo=function({go:e}){const{r:s}=(0,R.useCtx)(6e4),t=(0,C.hourSetsOf)(s),o=[],a=t.filter(e=>!e.hours).map(e=>e.name);a.length&&o.push(`${a.join(' and ')} kitchen hours`);t.length>1&&t.some(e=>!e.start)&&o.push('the date each season starts');return o.length?(0,W.jsx)(j.Card,{onPress:()=>e('more','advanced'),highlight:D.colours.gold,children:(0,W.jsxs)(y.default,{testID:"seasons-todo",style:{gap:4},children:[(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(j.T,{weight:"semibold",colour:D.colours.gold,children:"Setup checklist: kitchen hours"}),(0,W.jsx)(j.T,{colour:D.colours.muted,children:"\u203a"})]}),(0,W.jsxs)(j.Muted,{size:13,children:["Please add ",o.join(' and ')," (Settings \u203a Advanced \u203a Kitchen hours). Until then the app uses the Winter hours all year."]})]})}):null};var s=_r(_d[0]),t=_r(_d[1]),o=_r(_d[2]),a=_r(_d[3]),n=_r(_d[4]),l=_r(_d[5]),r=_r(_d[6]),i=_r(_d[7]),d=_r(_d[8]),h=_r(_d[9]),u=_r(_d[10]),c=_r(_d[11]),p=_r(_d[12]),g=_r(_d[13]),b=_r(_d[14]),m=_r(_d[15]),x=e(m),f=e(_r(_d[16])),y=e(_r(_d[17])),j=_r(_d[18]),w=_r(_d[19]),k=_r(_d[20]),v=_r(_d[21]),C=_r(_d[22]),S=_r(_d[23]),T=_r(_d[24]),D=_r(_d[25]),R=_r(_d[26]),M=_r(_d[27]),L=_r(_d[28]),P=_r(_d[29]),O=_r(_d[30]),z=_r(_d[31]),I=_r(_d[32]),$=_r(_d[33]),A=_r(_d[34]),B=_r(_d[35]),F=_r(_d[36]),E=_r(_d[37]),N=_r(_d[38]),W=_r(_d[39]);const H=/^([01]\d|2[0-3]):[0-5]\d$/,U=/^(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/,_=/^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/,Y=[1,2,3,4,5,6,0],G=['Sun','Mon','Tue','Wed','Thu','Fri','Sat'];function q({value:e,onChange:s,placeholder:t,label:o,width:a=90,bad:l,testID:r}){return(0,W.jsx)(n.TextInput,{accessibilityLabel:o,testID:r,value:e,onChangeText:s,placeholder:t,placeholderTextColor:D.colours.muted,style:{width:a,minHeight:44,borderRadius:10,borderWidth:1,borderColor:l?D.colours.red:D.colours.hairline,backgroundColor:D.colours.surface2,color:D.colours.text,paddingHorizontal:10,fontSize:15}})}function K({value:e,onChange:s,min:t,max:o,unit:a,label:n,step:l=5}){const r=(a,l)=>(0,W.jsx)(f.default,{accessibilityRole:"button",accessibilityLabel:`${l<0?'Less':'More'}: ${n}`,onPress:()=>s(Math.min(o,Math.max(t,e+l))),style:{width:44,height:44,borderRadius:10,borderWidth:1,borderColor:D.colours.accentBorder,alignItems:'center',justifyContent:'center'},children:(0,W.jsx)(j.T,{size:20,colour:D.colours.gold,children:a})});return(0,W.jsxs)(j.Row,{gap:8,children:[r('\u2212',-l),(0,W.jsx)(j.T,{weight:"semibold",style:{minWidth:76,textAlign:'center'},children:a(e)}),r('+',l)]})}const Q=e=>e%60?`${Math.floor(e/60)}h ${e%60}m`:`${e/60} hour${60===e?'':'s'}`;const V={DEFAULT_DWELL:T.DEFAULT_DWELL,ANCHORAGE_SEASONS:C.ANCHORAGE_SEASONS};function Z(e){const s=P.useReminders.getState();s.ensure(e),s.resetRules(e),s.resetReminder((0,P.chairsId)(e))}const J=[1,2,3,4,5,6,0],X=e=>`${7===e.days.length?'Every day':J.filter(s=>e.days.includes(s)).map(e=>O.DAY_NAMES[e]).join(', ')||'No days'} at ${e.time} (UK time) \xb7 ${O.AUDIENCE_LABEL[e.audience]}`;function ee({init:e,onSave:s,onCancel:t}){const[o,a]=(0,m.useState)(e.text),[l,r]=(0,m.useState)(e.days),[i,d]=(0,m.useState)(e.time),[h,u]=(0,m.useState)(e.audience),c=o.trim().length>1&&l.length>0&&(0,O.validTime)(i);return(0,W.jsxs)(y.default,{testID:"reminder-editor",style:{gap:8,borderWidth:1,borderColor:D.colours.accentBorder,borderRadius:12,padding:10},children:[(0,W.jsx)(j.T,{weight:"semibold",children:"What it says"}),(0,W.jsx)(n.TextInput,{accessibilityLabel:"Reminder wording",testID:"reminder-text",value:o,onChangeText:a,maxLength:120,placeholder:"e.g. Time to put the chairs up on the tables",placeholderTextColor:D.colours.muted,style:{minHeight:44,borderRadius:10,borderWidth:1,borderColor:D.colours.hairline,backgroundColor:D.colours.surface2,color:D.colours.text,paddingHorizontal:10,fontSize:15}}),(0,W.jsx)(j.T,{weight:"semibold",children:"Days"}),(0,W.jsx)(j.Row,{wrap:!0,gap:6,children:J.map(e=>(0,W.jsx)(j.Chip,{label:O.DAY_NAMES[e],selected:l.includes(e),onPress:()=>r(l.includes(e)?l.filter(s=>s!==e):[...l,e])},e))}),(0,W.jsxs)(j.Row,{gap:8,children:[(0,W.jsx)(j.T,{weight:"semibold",children:"Time (UK)"}),(0,W.jsx)(q,{label:"Reminder time",testID:"reminder-time",value:i,onChange:d,placeholder:"21:00",bad:!(0,O.validTime)(i)})]}),(0,W.jsx)(j.T,{weight:"semibold",children:"Who sees it"}),(0,W.jsx)(j.Row,{wrap:!0,gap:6,children:['all','foh','kitchen'].map(e=>(0,W.jsx)(j.Chip,{label:O.AUDIENCE_LABEL[e],selected:h===e,onPress:()=>u(e)},e))}),c?null:(0,W.jsx)(j.Muted,{size:13,children:"Add the wording, at least one day and a time like 21:00."}),(0,W.jsxs)(j.Row,{gap:8,style:{justifyContent:'flex-end'},children:[(0,W.jsx)(j.Button,{small:!0,kind:"ghost",label:"Cancel",onPress:t}),(0,W.jsx)(j.Button,{small:!0,label:"Save reminder",testID:"reminder-save",disabled:!c,onPress:()=>s({text:o.trim(),days:[...l].sort(),time:i,audience:h})})]})]})}function se({rid:e}){x.default.useEffect(()=>{P.useReminders.getState().ensure(e)},[e]);const s=(0,P.useReminders)(e=>e.reminders),t=s.filter(s=>s.rid===e&&!s.removed),o=(0,P.useReminders)(s=>s.rules[e]),a=(0,O.clampRules)(o??O.DEFAULT_BREAK_RULES),n=(0,P.useReminders)(e=>e.done).filter(s=>s.rid===e).slice(0,5),l=(0,z.useOwner)(e=>e.staff),r=P.useReminders.getState(),[i,d]=(0,m.useState)(null),[h,u]=(0,m.useState)(null),c=s=>r.setRules(e,s);return(0,W.jsxs)(y.default,{style:{gap:10},testID:"reminders-settings",children:[(0,W.jsx)(j.Muted,{size:13,children:"Reminders slide up on the phones of staff who are on shift right now (clocked in, or on the rota at that time), in the Staff and Head Chef apps, while the app is open."}),(0,W.jsx)(j.T,{weight:"semibold",children:"Break reminders"}),(0,W.jsx)(j.Toggle,{label:"Remind staff to take their break",value:a.on,onChange:e=>c({on:e})}),(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},wrap:!0,children:[(0,W.jsx)(j.T,{center:!0,style:{width:'100%'},children:"First reminder, if the rota has no break time"}),(0,W.jsx)(K,{label:"first break reminder",step:15,min:30,max:O.LEGAL_LIMIT_MINS,value:a.afterMins,unit:e=>`${Q(e)} in`,onChange:e=>c({afterMins:e})})]}),(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},wrap:!0,children:[(0,W.jsx)(j.T,{style:{flex:1},children:"Remind once more after"}),(0,W.jsx)(K,{label:"second break reminder",step:5,min:5,max:120,value:a.repeatMins,unit:e=>`${e} min`,onChange:e=>c({repeatMins:e})})]}),(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},wrap:!0,children:[(0,W.jsx)(j.T,{style:{flex:1},children:"\u2018Later\u2019 hides it for"}),(0,W.jsx)(K,{label:"snooze",step:5,min:5,max:60,value:a.snoozeMins,unit:e=>`${e} min`,onChange:e=>c({snoozeMins:e})})]}),(0,W.jsxs)(j.Muted,{size:13,children:["How it works: if the shift on the rota has a break time, the reminder comes at that time. If not, it comes ",Q(a.afterMins)," after they clock in (or after the shift starts, if they haven\u2019t clocked in). If they still haven\u2019t started a break, it comes once more ",a.repeatMins," minutes later, and again at 6 hours. Nobody works more than 6 hours without a reminder: UK law says a shift over 6 hours needs a 20-minute break. \u2018Start break\u2019 starts their break, the same as on the clock screen."]}),(0,W.jsx)(j.T,{weight:"semibold",style:{marginTop:6},children:"Venue reminders"}),t.map(e=>(0,W.jsx)(y.default,{testID:`reminder-${e.builtIn??e.id}`,style:{gap:6,borderBottomWidth:1,borderColor:D.colours.hairline,paddingBottom:8},children:i===e.id?(0,W.jsx)(ee,{init:e,onCancel:()=>d(null),onSave:s=>{r.update(e.id,s),d(null)}}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},gap:8,children:[(0,W.jsx)(j.T,{weight:"semibold",style:{flex:1},children:e.text}),e.paused?(0,W.jsx)(j.Badge,{kind:"amber",label:"PAUSED"}):null]}),(0,W.jsx)(j.Muted,{size:13,children:X(e)}),h===e.id?(0,W.jsxs)(j.Row,{gap:8,wrap:!0,children:[(0,W.jsx)(j.T,{size:14,style:{flex:1},children:"Delete this reminder?"}),(0,W.jsx)(j.Button,{small:!0,kind:"danger",label:"Yes, delete it",onPress:()=>{r.remove(e.id),u(null)}}),(0,W.jsx)(j.Button,{small:!0,kind:"ghost",label:"Keep it",onPress:()=>u(null)})]}):(0,W.jsxs)(j.Row,{gap:8,wrap:!0,children:[(0,W.jsx)(j.Button,{small:!0,kind:"secondary",label:"Edit",testID:"reminder-edit",onPress:()=>d(e.id)}),(0,W.jsx)(j.Button,{small:!0,kind:"secondary",label:e.paused?'Resume':'Pause',onPress:()=>r.update(e.id,{paused:!e.paused})}),(0,W.jsx)(j.Button,{small:!0,kind:"ghost",label:"Delete",onPress:()=>u(e.id)})]})]})},e.id)),t.length?null:(0,W.jsx)(j.Muted,{children:"No venue reminders. Add one below, or Reset to default to bring back \u201cchairs up\u201d."}),'new'===i?(0,W.jsx)(ee,{init:{text:'',days:[5,6],time:'21:00',audience:'all'},onCancel:()=>d(null),onSave:s=>{r.add(e,s),d(null)}}):(0,W.jsx)(j.Button,{small:!0,kind:"secondary",label:"\uff0b Add a reminder",testID:"reminder-add",onPress:()=>d('new')}),n.length?(0,W.jsxs)(y.default,{style:{gap:2},children:[(0,W.jsx)(j.T,{weight:"semibold",children:"Recently done"}),n.map(e=>(0,W.jsxs)(j.Muted,{size:13,children:[new Date(e.at).toLocaleString('en-GB',{weekday:'short',day:'numeric',month:'short',hour:'2-digit',minute:'2-digit',timeZone:'Europe/London'})," \xb7 ",(l.find(s=>s.id===e.staffRef)?.name??e.staffName).replace(' (example)','')," \xb7 ",s.find(s=>s.id===e.reminderId)?.text??'Reminder']},e.id))]}):null,(0,W.jsxs)(j.Muted,{size:13,children:["Tip: once anyone taps Done, the reminder goes away for everyone that day, and you can see who did it here. \u2018Later\u2019 hides it on that phone for ",a.snoozeMins," minutes. Reset to default puts back the break times and \u201cchairs up\u201d (",(0,O.defaultChairs)('x',e).days.map(e=>O.DAY_NAMES[e]).join(' and '),", 21:00); your own reminders stay."]}),(0,W.jsx)(j.Muted,{size:13,children:"Reminders show while the app is open. Phones with the app closed don\u2019t get them yet."})]})}},1418,[1051,1031,805,1405,812,1419,1420,1422,1423,1424,1197,1029,1030,1006,1012,17,385,85,777,841,1425,816,862,1053,861,804,1055,858,1181,972,973,876,1426,1379,996,1427,1003,1139,939,8]); +__d(function(_g,_r,_i,_a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.AdvancedSettings=function({go:e}){const{r:x,rid:P,today:O,me:I}=(0,R.useCtx)(6e4),V=I.replace(" (example)",""),J=x.settings,X=e=>v.useStore.getState().updateSettings(P,e),[ee,te]=(0,m.useState)(()=>(0,h.takeAdvancedPrefill)()),[oe,ae]=(0,m.useState)(null),ne=e=>{if(e.onReset)return e.onReset(),void ae(`${e.title}: back to the defaults.`);X(Object.fromEntries(e.reset.map(e=>[e,void 0]))),ae(`${e.title}: back to the defaults.`)},le=(0,M.useBookings)(P),re=(0,W.jsxs)(y.default,{style:{gap:8},children:[(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(j.T,{style:{flex:1},children:"Ask about allergies first (in red)"}),(0,W.jsx)(j.Badge,{kind:"red",label:"ALWAYS ON"})]}),(0,W.jsx)(j.Muted,{size:13,children:"Food safety: every booking answers this before anything else, and staff tick \u201cAllergens seen\u201d."}),(0,W.jsx)(j.Toggle,{label:"Ask if they\u2019re bringing a dog",value:(0,T.dogQuestionOn)(x),onChange:e=>X({dogQuestion:e})}),(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(j.T,{style:{flex:1},children:"Most dogs per booking time"}),(0,W.jsx)(K,{label:"dogs per time",step:1,min:0,max:20,value:J.maxDogsPerSlot??0,unit:e=>e?`${e} dog${1===e?'':'s'}`:'No limit',onChange:e=>X({maxDogsPerSlot:e||void 0})})]}),(0,W.jsx)(j.Toggle,{label:"Ask about wheelchair or step-free access",value:(0,T.accessQuestionOn)(x),onChange:e=>X({accessQuestion:e})}),(0,W.jsx)(j.Toggle,{label:"Vegan and vegetarian ticks (optional for guests)",value:(0,T.dietQuestionOn)(x),onChange:e=>X({dietQuestion:e})}),(0,W.jsx)(j.Toggle,{label:"Let guests ask for a table (shown as \u2018not guaranteed\u2019)",value:!1!==J.tableRequests,onChange:e=>X({tableRequests:e})}),(0,W.jsx)(j.Muted,{size:13,children:"Dog-friendly and step-free tables are marked on the table plan."}),e?(0,W.jsx)(j.Button,{small:!0,kind:"ghost",label:"Mark tables on the Table plan \u203a",onPress:()=>e('more','tableplan')}):null]}),ie=(0,T.dwellBands)(x),de=(e,s)=>X({dwellBands:ie.map((t,o)=>o===e?{...t,mins:s}:t)}),he=(0,W.jsxs)(y.default,{style:{gap:8},children:[(0,W.jsx)(j.Muted,{size:13,children:"How long a table usually stays, by party size. Used for \u201cNext table free\u201d and for spacing bookings on a table."}),ie.map((e,s)=>{const t=(0,T.dwellFor)(x,9999===e.upTo?20:e.upTo,le);return(0,W.jsxs)(y.default,{style:{gap:2},children:[(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(j.T,{style:{flex:1},children:(0,T.bandLabel)(ie,s)}),(0,W.jsx)(K,{label:`table time for ${(0,T.bandLabel)(ie,s)}`,min:30,max:360,value:e.mins,unit:Q,onChange:e=>de(s,e)})]}),t.learned&&t.mins!==e.mins?(0,W.jsxs)(j.Muted,{size:12,children:["From your last ",t.samples," tables: about ",Q(t.mins)," (used for estimates)"]}):null]},s)}),(0,W.jsx)(j.Toggle,{label:"Fine-tune from how long tables really stay",value:!1!==J.dwellLearn,onChange:e=>X({dwellLearn:e})}),(0,W.jsx)(j.Muted,{size:13,children:"Defaults: 90 min for 1\u20132 Covers, 105 min for 3\u20135, 2 hours for 6\u201319, 3 hours for 20 or more."})]}),ue=J.reservables??(0,S.reservablesOf)(x),ce=J.reservables??('anchorage'===P?ue:[]),pe=(e,s)=>X({reservables:ce.map(t=>t.id===e?{...t,...s}:t)}),ge=(0,W.jsxs)(y.default,{style:{gap:8},children:[ce.length?ce.map(e=>(0,W.jsxs)(y.default,{style:{gap:4},children:[(0,W.jsx)(j.Toggle,{label:`${e.name} can be reserved`,value:e.active,onChange:s=>pe(e.id,{active:s})}),(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(j.Muted,{children:"Price"}),(0,W.jsx)(K,{label:`${e.name} price`,min:5,max:1e3,value:Math.round(e.price/100),unit:e=>`\xa3${e}`,onChange:s=>pe(e.id,{price:100*s})})]}),(0,W.jsxs)(j.Muted,{size:12,children:["Uses: ",e.uses.map(e=>`${e.qty} ${e.key}`).join(' + ')," from the counted stock. Held from the Display count and shown as \u201cReserved\u201d."]})]},e.id)):(0,W.jsx)(j.Muted,{children:"No reservable dishes yet."}),(0,W.jsx)(j.Toggle,{label:"Guests can reserve a crab or lobster on its own",value:!1!==J.reserveStock,onChange:e=>X({reserveStock:e})}),(0,W.jsx)(j.Muted,{size:13,children:"The kitchen is told about each reservation and the Head Chef taps OK."})]}),be=(0,T.regularEventsOf)(x),[me,xe]=(0,m.useState)(null),fe=e=>X({regularEvents:e}),ye=me?me.name.trim()?me.time&&!H.test(me.time)?'Start time looks wrong (use 20:00).':me.lastFood&&!H.test(me.lastFood)?'Last food orders looks wrong (use 19:00).':'once'!==me.rule.kind||_.test(me.rule.date)?'':'Date looks wrong (use 2026-12-31).':'Give it a name.':'',je=(0,W.jsxs)(y.default,{style:{gap:8},children:[be.map(e=>(0,W.jsxs)(j.Card,{children:[(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(j.T,{weight:"semibold",style:{flex:1},children:e.name}),e.busier?(0,W.jsx)(j.Badge,{kind:"gold",label:"BUSIER"}):null,e.active?null:(0,W.jsx)(j.Badge,{kind:"neutral",label:"OFF"})]}),(0,W.jsxs)(j.Muted,{children:[(0,T.ruleText)(e.rule),e.time?` \xb7 from ${e.time}`:'',e.lastFood?` \xb7 last food orders ${e.lastFood}`:'']}),e.active?(0,W.jsxs)(j.Muted,{size:12,children:["Next: ",(0,T.nextOccurrence)(e,O)??'\u2014']}):null,(0,W.jsxs)(j.Row,{gap:6,children:[(0,W.jsx)(j.Button,{small:!0,kind:"secondary",label:"Edit",testID:`event-edit-${e.id}`,onPress:()=>xe({...e})}),(0,W.jsx)(j.Button,{small:!0,kind:"ghost",label:"Remove",onPress:()=>fe(be.filter(s=>s.id!==e.id))})]})]},e.id)),me?(0,W.jsxs)(j.Card,{highlight:D.colours.gold,children:[(0,W.jsxs)(j.Row,{gap:8,style:{flexWrap:'wrap'},children:[(0,W.jsx)(j.Muted,{children:"Name"}),(0,W.jsx)(q,{label:"Event name",width:220,value:me.name,onChange:e=>xe({...me,name:e}),placeholder:"Open Mic Night"})]}),(0,W.jsx)(j.Muted,{children:"Repeats"}),(0,W.jsxs)(j.Row,{wrap:!0,gap:6,children:[(0,W.jsx)(j.Chip,{label:"Last \u2026 of the month",selected:'last'===me.rule.kind,onPress:()=>xe({...me,rule:{kind:'last',weekday:'weekday'in me.rule?me.rule.weekday:0}})}),(0,W.jsx)(j.Chip,{label:"Every week",selected:'weekly'===me.rule.kind,onPress:()=>xe({...me,rule:{kind:'weekly',weekday:'weekday'in me.rule?me.rule.weekday:0}})}),(0,W.jsx)(j.Chip,{label:"One-off date",selected:'once'===me.rule.kind,onPress:()=>xe({...me,rule:{kind:'once',date:O}})})]}),'weekday'in me.rule?(0,W.jsx)(j.Row,{wrap:!0,gap:6,children:Y.map(e=>(0,W.jsx)(j.Chip,{label:G[e],selected:me.rule.weekday===e,onPress:()=>xe({...me,rule:{...me.rule,weekday:e}})},e))}):(0,W.jsxs)(j.Row,{gap:8,children:[(0,W.jsx)(j.Muted,{children:"Date (DD/MM/YYYY)"}),(0,W.jsx)(q,{label:"Event date",width:130,value:(0,t.slashDay)(me.rule.date),onChange:e=>{const s=(0,t.slashDate)(e,(0,t.slashDay)(me.rule.date));xe({...me,rule:{kind:'once',date:(0,t.dayFromSlash)(s)??s}})},placeholder:"31/12/2026"})]}),(0,W.jsxs)(j.Row,{gap:8,style:{flexWrap:'wrap'},children:[(0,W.jsx)(j.Muted,{children:"Starts (optional)"}),(0,W.jsx)(q,{label:"Start time",value:me.time??'',onChange:e=>xe({...me,time:e||void 0}),placeholder:"20:00",bad:!!me.time&&!H.test(me.time)})]}),(0,W.jsxs)(j.Row,{gap:8,style:{flexWrap:'wrap'},children:[(0,W.jsx)(j.Muted,{children:"Last food orders (optional)"}),(0,W.jsx)(q,{label:"Last food orders",value:me.lastFood??'',onChange:e=>xe({...me,lastFood:e||void 0}),placeholder:"19:00",bad:!!me.lastFood&&!H.test(me.lastFood)})]}),(0,W.jsxs)(j.Row,{gap:8,style:{flexWrap:'wrap'},children:[(0,W.jsx)(j.Muted,{children:"Notes"}),(0,W.jsx)(q,{label:"Notes",width:240,value:me.notes??'',onChange:e=>xe({...me,notes:e||void 0}),placeholder:"Live music from 8pm"})]}),(0,W.jsx)(j.Toggle,{label:"Expect busier (raises the forecast)",value:me.busier,onChange:e=>xe({...me,busier:e})}),(0,W.jsx)(j.Toggle,{label:"On",value:me.active,onChange:e=>xe({...me,active:e})}),ye?(0,W.jsx)(j.T,{size:13,colour:D.colours.red,children:ye}):null,(0,W.jsxs)(j.Row,{gap:6,children:[(0,W.jsx)(j.Button,{small:!0,label:"Save event",disabled:!!ye,testID:"event-save",onPress:()=>{const e={...me,name:me.name.trim()};fe(be.some(s=>s.id===e.id)?be.map(s=>s.id===e.id?e:s):[...be,e]),xe(null),ae(`Saved ${e.name}.`)}}),(0,W.jsx)(j.Button,{small:!0,kind:"ghost",label:"Cancel",onPress:()=>xe(null)})]})]}):(0,W.jsx)(j.Button,{small:!0,kind:"secondary",label:"\uff0b Add a regular event",testID:"event-add",onPress:()=>xe({id:`ev-${Date.now().toString(36)}`,name:'',rule:{kind:'last',weekday:0},busier:!0,active:!0})}),(0,W.jsx)(j.Muted,{size:13,children:"Events show in Forecast key dates (with a Promote button), on the Today date bar, and lift the forecast when \u201cExpect busier\u201d is on."})]}),we=(0,C.hourSetsOf)(x),ke=(0,C.seasonOn)(x,new Date),[ve,Ce]=(0,m.useState)(null),[Se,Te]=(0,m.useState)(null),De=J.hourOverrides??[],Re=ve?ve.start&&!U.test(ve.start)?'Start date looks wrong (use day and month as MM-DD, e.g. 04-01 for 1 April).':ve.hours&&Object.values(ve.hours).some(e=>e&&(!H.test(e[0])||!H.test(e[1])||e[0]>=e[1]))?'Check the times: use 12:00 and 19:00, and closing must be after opening.':'':'',Me=Object.values(J.lastFoodByDay??{}).some(e=>e&&!H.test(e)),Le=[];we.some(e=>!e.hours)&&Le.push(`${we.filter(e=>!e.hours).map(e=>e.name).join(' and ')} kitchen hours`);we.filter(e=>e.hours).length>=1&&we.length>1&&we.some(e=>!e.start)&&Le.push('the date each season starts');const Pe=(0,W.jsxs)(y.default,{style:{gap:8},children:[(0,W.jsx)(j.Muted,{size:13,children:"Kitchen (food) hours, not bar hours. The closing time is last food orders. Dining bookings are only offered inside these hours."}),Le.length?(0,W.jsxs)(j.Banner,{kind:"warn",title:"To finish setting up",children:["Please add ",Le.join(' and '),". Until then the app uses ",ke?.name??'your weekly'," hours all year."]}):null,ke?(0,W.jsxs)(j.T,{colour:D.colours.goldLight,children:["In use today: ",ke.name]}):null,we.map(e=>(0,W.jsxs)(j.Card,{children:[(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(j.T,{weight:"semibold",children:e.name}),ke?.id===e.id?(0,W.jsx)(j.Badge,{kind:"gold",label:"IN USE"}):e.hours?null:(0,W.jsx)(j.Badge,{kind:"amber",label:"NOT SET"})]}),(0,W.jsx)(j.Muted,{children:e.start?`Starts every year on ${e.start}`:'Start date: not set yet'}),e.hours?(0,W.jsx)(j.Muted,{size:13,children:Y.map(s=>`${G[s]} ${e.hours[s]?`${e.hours[s][0]}\u2013${e.hours[s][1]}`:'closed'}`).join(' \xb7 ')}):(0,W.jsx)(j.Muted,{size:13,children:"No hours yet."}),(0,W.jsx)(j.Button,{small:!0,kind:"secondary",label:e.hours?'Edit':`Set ${e.name} hours`,testID:`season-edit-${e.id}`,onPress:()=>Ce({...e,hours:e.hours?{...e.hours}:{...we.find(e=>e.hours)?.hours??x.kitchenHours}})})]},e.id)),ve?(0,W.jsxs)(j.Card,{highlight:D.colours.gold,children:[(0,W.jsxs)(j.T,{weight:"semibold",children:[ve.name," hours"]}),(0,W.jsxs)(j.Row,{gap:8,style:{flexWrap:'wrap'},children:[(0,W.jsx)(j.Muted,{children:"Starts every year on (MM-DD)"}),(0,W.jsx)(q,{label:"Season start date",value:ve.start??'',onChange:e=>Ce({...ve,start:e||void 0}),placeholder:"04-01",bad:!!ve.start&&!U.test(ve.start)})]}),Y.map(e=>{const s=ve.hours?.[e]??null,t=s=>Ce({...ve,hours:{...ve.hours,[e]:s}});return(0,W.jsxs)(j.Row,{gap:6,style:{flexWrap:'wrap'},children:[(0,W.jsx)(j.T,{style:{width:44},children:G[e]}),(0,W.jsx)(j.Chip,{label:s?'Open':'Closed',selected:!!s,onPress:()=>t(s?null:['12:00','19:00'])}),s?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(q,{label:`${T.DAYS[e]} opens`,value:s[0],width:74,onChange:e=>t([e,s[1]]),bad:!H.test(s[0])}),(0,W.jsx)(j.Muted,{children:"to"}),(0,W.jsx)(q,{label:`${T.DAYS[e]} last food orders`,value:s[1],width:74,onChange:e=>t([s[0],e]),bad:!H.test(s[1])||s[0]>=s[1]})]}):null]},e)}),Re?(0,W.jsx)(j.T,{size:13,colour:D.colours.red,children:Re}):null,(0,W.jsxs)(j.Row,{gap:6,children:[(0,W.jsx)(j.Button,{small:!0,label:"Save hours",disabled:!!Re,testID:"season-save",onPress:()=>{var e;e=we.map(e=>e.id===ve.id?ve:e),X({hourSets:e}),Ce(null),ae(`Saved ${ve.name} hours.`)}}),(0,W.jsx)(j.Button,{small:!0,kind:"ghost",label:"Cancel",onPress:()=>Ce(null)})]})]}):null,(0,W.jsx)(j.T,{weight:"semibold",style:{marginTop:6},children:"Special days"}),(0,W.jsx)(j.Muted,{size:13,children:"One-off changes, e.g. closed for a private party or open late on Hogmanay."}),De.map(e=>(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsxs)(j.T,{style:{flex:1},children:[e.date,": ",e.hours?`${e.hours[0]}\u2013${e.hours[1]}`:'kitchen closed',e.note?` \xb7 ${e.note}`:'']}),(0,W.jsx)(j.Button,{small:!0,kind:"ghost",label:"Remove",onPress:()=>X({hourOverrides:De.filter(s=>s.date!==e.date)})})]},e.date)),Se?(0,W.jsxs)(j.Card,{highlight:D.colours.gold,children:[(0,W.jsxs)(j.Row,{gap:8,children:[(0,W.jsx)(j.Muted,{children:"Date (DD/MM/YYYY)"}),(0,W.jsx)(q,{label:"Special day date",width:130,value:(0,t.slashDay)(Se.date),onChange:e=>{const s=(0,t.slashDate)(e,(0,t.slashDay)(Se.date));Te({...Se,date:(0,t.dayFromSlash)(s)??s})},placeholder:"31/12/2026",bad:!_.test(Se.date)})]}),(0,W.jsxs)(j.Row,{gap:6,style:{flexWrap:'wrap'},children:[(0,W.jsx)(j.Chip,{label:Se.hours?'Open':'Closed',selected:!!Se.hours,onPress:()=>Te({...Se,hours:Se.hours?null:['12:00','19:00']})}),Se.hours?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(q,{label:"Opens",width:74,value:Se.hours[0],onChange:e=>Te({...Se,hours:[e,Se.hours[1]]})}),(0,W.jsx)(j.Muted,{children:"to"}),(0,W.jsx)(q,{label:"Last food orders",width:74,value:Se.hours[1],onChange:e=>Te({...Se,hours:[Se.hours[0],e]})})]}):null]}),(0,W.jsxs)(j.Row,{gap:8,children:[(0,W.jsx)(j.Muted,{children:"Note"}),(0,W.jsx)(q,{label:"Note",width:220,value:Se.note??'',onChange:e=>Te({...Se,note:e||void 0}),placeholder:"Private party"})]}),(()=>{const e=_.test(Se.date)?Se.hours&&(!H.test(Se.hours[0])||!H.test(Se.hours[1])||Se.hours[0]>=Se.hours[1])?'Check the times.':'':'Date looks wrong (use 2026-12-31).';return(0,W.jsxs)(W.Fragment,{children:[e?(0,W.jsx)(j.T,{size:13,colour:D.colours.red,children:e}):null,(0,W.jsxs)(j.Row,{gap:6,children:[(0,W.jsx)(j.Button,{small:!0,label:"Save special day",disabled:!!e,onPress:()=>{X({hourOverrides:[...De.filter(e=>e.date!==Se.date),Se].sort((e,s)=>e.date.localeCompare(s.date))}),Te(null)}}),(0,W.jsx)(j.Button,{small:!0,kind:"ghost",label:"Cancel",onPress:()=>Te(null)})]})]})})()]}):(0,W.jsx)(j.Button,{small:!0,kind:"secondary",label:"\uff0b Add a special day",testID:"override-add",onPress:()=>Te({date:O,hours:null})}),(0,W.jsx)(j.T,{weight:"semibold",style:{marginTop:6},children:"Earlier last food orders (optional)"}),(0,W.jsx)(j.Muted,{size:13,children:"Leave blank to use the kitchen closing time. Regular events can set their own (Open Mic Night: 7pm)."}),(0,W.jsx)(j.Row,{wrap:!0,gap:8,children:Y.map(e=>(0,W.jsxs)(y.default,{style:{gap:2},children:[(0,W.jsx)(j.Muted,{size:12,children:G[e]}),(0,W.jsx)(q,{label:`${T.DAYS[e]} last food orders`,width:74,value:J.lastFoodByDay?.[e]??'',placeholder:"\u2014",bad:!!J.lastFoodByDay?.[e]&&!H.test(J.lastFoodByDay[e]),onChange:s=>X({lastFoodByDay:{...J.lastFoodByDay??{},[e]:s||void 0}})})]},e))}),Me?(0,W.jsx)(j.T,{size:13,colour:D.colours.red,children:"Use times like 19:00 (blank = kitchen close)."}):null,(0,W.jsx)(j.Muted,{children:"After last food orders, booking times are\u2026"}),(0,W.jsxs)(j.Row,{gap:6,children:[(0,W.jsx)(j.Chip,{label:"Offered for drinks only",selected:'drinks'===(0,T.afterLastFood)(x),onPress:()=>X({afterLastFood:'drinks'})}),(0,W.jsx)(j.Chip,{label:"Not offered",selected:'block'===(0,T.afterLastFood)(x),onPress:()=>X({afterLastFood:'block'})})]})]}),Oe=(0,W.jsxs)(y.default,{style:{gap:8},children:[(0,W.jsx)(j.Toggle,{label:"COVERS counter on Today (done / to come / total)",value:(0,T.coversCounterOn)(x),onChange:e=>X({coversCounter:e})}),(0,W.jsx)(j.Toggle,{label:"\u2018Next table free\u2019 when you\u2019re full",value:(0,T.nextTableOn)(x),onChange:e=>X({nextTableFree:e})}),(0,W.jsx)(j.Toggle,{label:"Show takeaway on home screens",value:(0,T.showTakeaway)(x),onChange:e=>X({showTakeaway:e})}),(0,W.jsx)(j.Muted,{size:13,children:"Takeaway order alerts always work. With this off, takeaway figures sit in a collapsed Takeaway section."}),(0,W.jsx)(j.Muted,{size:13,children:"The flap click sound is set on each Display (Display settings), off by default."})]}),Ie=(0,W.jsxs)(y.default,{style:{gap:8},children:[(0,W.jsx)(j.Toggle,{label:"Show full gov.uk names, e.g. \u2018(substitute day)\u2019",value:!!J.holidayFullNames,onChange:e=>X({holidayFullNames:e})}),(0,W.jsx)(j.Muted,{size:13,children:"Off: \u201cChristmas Day\u201d shows on its date without \u201c(substitute day)\u201d."})]}),[ze,$e]=(0,m.useState)(null),Ae=ze??J.whatsapp??'',Be=!Ae.trim()||!!(0,L.waNumber)(Ae),Fe=(0,W.jsxs)(y.default,{style:{gap:8},children:[(0,W.jsx)(j.T,{children:"The venue\u2019s WhatsApp number"}),(0,W.jsxs)(j.Row,{gap:8,wrap:!0,children:[(0,W.jsx)(q,{label:"Venue WhatsApp number",testID:"adv-whatsapp-number",width:220,value:Ae,placeholder:"e.g. 01292 500123 or +44 7\u2026",bad:!Be,onChange:e=>{$e(e),e.trim()?(0,L.waNumber)(e)&&X({whatsapp:e.trim()}):X({whatsapp:void 0})}}),Ae.trim()&&Be?(0,W.jsx)(j.Badge,{kind:"gold",label:`wa.me/${(0,L.waNumber)(Ae)}`}):null]}),Be?null:(0,W.jsx)(j.T,{size:13,colour:D.colours.red,children:"That doesn\u2019t look like a phone number. Use the full number, e.g. 01292 500123 or +44 7700 900123."}),(0,W.jsx)(j.Muted,{size:13,children:"With a number here, guests see \u201cMessage us on WhatsApp\u201d on their booking confirmation, and staff and managers see \u201cWhatsApp guest\u201d on bookings that have a mobile number. Blank: all WhatsApp buttons stay hidden."}),(0,W.jsx)(j.Muted,{size:13,children:"Tip: nothing is ever sent for you. The button opens WhatsApp with a message typed in, and the person taps Send themselves."})]}),Ee=(0,N.soldOutSettingsOf)(J.soldOut),Ne=(0,W.jsxs)(y.default,{style:{gap:8},children:[(0,W.jsx)(j.Toggle,{testID:"adv-soldout-auto",label:"Mark dishes sold out from the counts",value:Ee.auto,onChange:e=>X({soldOut:{...Ee,auto:e}}),a11y:"Mark dishes sold out from the live counts"}),(0,W.jsx)(j.Muted,{size:13,children:Ee.auto?'On: when a count (lobster, crab\u2026) runs out or drops below what a dish needs, every dish that uses it is marked sold out, with the reason, e.g. \u201cDeluxe Seafood Platter (no lobster)\u201d. It goes back on when the count is back up. Dishes marked by hand are left alone. Change which dishes use what in any Sold out list.':'Off: dishes are only marked sold out by hand. Dishes marked from the counts go back on.'}),(0,W.jsx)(j.T,{children:"Clear sold out dishes by themselves"}),(0,W.jsx)(j.Row,{wrap:!0,gap:8,children:['close','morning','manual'].map(e=>(0,W.jsx)(j.Chip,{testID:`adv-soldout-${e}`,label:N.SOLD_OUT_CLEAR_LABEL[e],selected:Ee.clear===e,onPress:()=>X({soldOut:{...Ee,clear:e}})},e))}),'manual'!==Ee.clear?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(j.T,{children:"Next morning means"}),(0,W.jsx)(j.Row,{wrap:!0,gap:8,children:['04:00','05:00','06:00','08:00'].map(e=>(0,W.jsx)(j.Chip,{label:e,selected:Ee.morningAt===e,onPress:()=>X({soldOut:{...Ee,morningAt:e}})},e))})]}):null,(0,W.jsx)(j.Muted,{size:13,children:'close'===Ee.clear?'Dishes go back on at the kitchen\u2019s closing time that day (from Kitchen hours). Marked after closing: the next morning.':'morning'===Ee.clear?`Dishes go back on at ${Ee.morningAt} the next morning.`:'Dishes stay sold out until someone taps Back on.'}),(0,W.jsx)(j.Muted,{size:13,children:"Tip: Sold out is a reminder for staff. It shows on the Display\u2019s slim strip and in every staff app\u2019s Sold out list. CoverCharge doesn\u2019t link up to your till, so it doesn\u2019t change the till."})]}),We=(0,s.venueBusy)(x,le,new Date),He=(0,E.clampWeeks)(J.forecastMinWeeks),Ue=(0,W.jsxs)(y.default,{style:{gap:8},children:[(0,W.jsxs)(y.default,{testID:"busy-level-setting",style:{alignItems:'center',gap:12},accessible:!0,accessibilityLabel:We.words,children:[(0,W.jsx)(j.T,{center:!0,size:20,weight:"semibold",children:We.words}),(0,W.jsx)(j.Stepper,{testID:"busy-covers-hour",label:"Busy level in Covers an hour",value:J.busyCoversPerHour??30,min:1,max:200,onChange:e=>X({busyCoversPerHour:e,busyLearning:!1})}),(0,W.jsx)(j.Muted,{children:"Learning starts from your chosen level; enabling it starts a fresh history period, so older trading patterns do not immediately replace your choice."}),(0,W.jsx)(j.Toggle,{label:"Learn the busy level from our real history",value:!1!==J.busyLearning,onChange:e=>X({busyLearning:e,busyLearningSince:(new Date).toISOString().slice(0,10)})}),(0,W.jsx)(j.T,{center:!0,size:16,children:"Steady starts at half the busy level. Busy starts at the busy level. Hourly forecasts use the upper end of their range."}),(0,W.jsx)(j.T,{center:!0,size:16,children:"Learning needs at least 4 weeks, 16 trading days and 40 recorded hours. It uses the 85th percentile of recorded hourly arrivals over the last 8 weeks, including walk-ins, excluding cancellations and no-shows. Changing the number keeps your override until learning is switched on again."}),We.enough?null:(0,W.jsx)(j.T,{center:!0,size:16,children:"Not enough real hourly history to learn yet. Using the starting or owner-set level."})]}),(0,W.jsx)(j.T,{children:"History needed before forecasts show"}),(0,W.jsx)(j.Row,{wrap:!0,gap:8,children:[1,2,3,4,6,8].map(e=>(0,W.jsx)(j.Chip,{testID:`adv-forecast-weeks-${e}`,label:1===e?'1 week':`${e} weeks`,selected:He===e,onPress:()=>X({forecastMinWeeks:e})},e))}),(0,W.jsx)(j.Muted,{size:13,children:`Forecasts, expected walk-ins and labour vs sales start once CoverCharge has ${1===He?'1 week':`${He} weeks`} of your bookings (and cash-ups for sales). Until then you see what is booked and your real labour cost, never invented figures.`}),(0,W.jsx)(j.Muted,{size:13,children:"Tip: 2 weeks is a sensible start. More weeks give steadier forecasts but take longer to begin."}),(0,W.jsx)(l.ForecastDaySettings,{r:x,set:X})]}),Ye=(0,w.depositOf)(J),Ge=e=>X({deposit:{...Ye,...e}}),qe=o.IS_GREENSIDE?(0,W.jsx)(a.GreensideCashOnly,{}):(0,W.jsxs)(y.default,{style:{gap:8},children:[(0,W.jsx)(j.Toggle,{testID:"adv-deposit-on",label:"Ask bigger tables for a deposit",value:Ye.on,onChange:e=>Ge({on:e})}),(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(j.T,{children:"Amount per adult"}),(0,W.jsx)(j.Stepper,{testID:"adv-deposit-amount",value:Ye.perPersonPence/100,min:0,max:100,format:e=>`\xa3${e}`,onChange:e=>Ge({perPersonPence:100*e}),label:"deposit per person"})]}),(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(j.T,{children:"From this many adults"}),(0,W.jsx)(j.Stepper,{testID:"adv-deposit-party",value:Ye.fromParty,min:1,max:30,onChange:e=>Ge({fromParty:e}),label:"deposit from this many adults"})]}),(0,W.jsx)(j.T,{children:"Refundable?"}),(0,W.jsxs)(j.Row,{wrap:!0,gap:8,children:[(0,W.jsx)(j.Chip,{testID:"adv-deposit-ref-yes",label:"Yes",selected:!0===Ye.refundable,onPress:()=>Ge({refundable:!0})}),(0,W.jsx)(j.Chip,{testID:"adv-deposit-ref-no",label:"No",selected:!1===Ye.refundable,onPress:()=>Ge({refundable:!1,cutoffHours:null})}),(0,W.jsx)(j.Chip,{testID:"adv-deposit-ref-unset",label:"Not set yet",selected:null===Ye.refundable,onPress:()=>Ge({refundable:null,cutoffHours:null})})]}),!0===Ye.refundable?(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(j.T,{children:"Refunded if cancelled this many hours before"}),(0,W.jsx)(j.Stepper,{testID:"adv-deposit-cutoff",value:Ye.cutoffHours??0,min:0,max:168,step:6,format:e=>e?`${e} h`:'Any time',onChange:e=>Ge({cutoffHours:e||null}),label:"refund cut-off hours"})]}):null,(0,W.jsx)(j.T,{children:"Words guests see (optional)"}),(0,W.jsx)(n.TextInput,{accessibilityLabel:"Deposit policy shown to guests",testID:"adv-deposit-policy",value:Ye.policy,multiline:!0,onChangeText:e=>Ge({policy:e.slice(0,600)}),placeholder:"e.g. The deposit comes off your bill on the night.",placeholderTextColor:D.colours.muted,style:{minHeight:70,borderRadius:10,borderWidth:1,borderColor:D.colours.hairline,backgroundColor:D.colours.surface2,color:D.colours.text,padding:10,fontSize:15}}),(0,W.jsx)(j.Muted,{size:13,children:Ye.on&&Ye.perPersonPence>0?`Guests booking for ${Ye.fromParty} or more adults see: \u201c${(0,w.depositWords)(Ye,Ye.fromParty,x.name).join(' ')}\u201d`:'Off: no booking asks for a deposit.'}),(0,W.jsx)(j.Toggle,{testID:"adv-deposit-wixlinks",label:"Send website bookings deposit links for phone and walk-in bookings",a11y:"Send website bookings deposit links for phone and walk-in bookings",value:!!Ye.wixLinksOn,onChange:e=>Ge({wixLinksOn:e})}),Ye.wixLinksOn?(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(j.T,{children:"Link works for"}),(0,W.jsx)(j.Stepper,{testID:"adv-deposit-linkhours",value:Ye.wixLinkHours??48,min:6,max:168,step:6,format:e=>`${e} hours`,onChange:e=>Ge({wixLinkHours:e}),label:"hours a deposit link works"})]}):null,(0,W.jsx)(j.Muted,{size:13,children:Ye.wixLinksOn?'On here, but website bookings deposit links also need the server switch, which stays off until the first \xa31 test is approved. Until then the button says so and nothing goes to website bookings.':'Off: no deposit links. Bookings work as before.'}),(0,W.jsx)(j.Muted,{size:13,children:"Tip: deposits are paid through website bookings, never in CoverCharge, and no card is saved. Guests who book on your website pay there, and the booking shows Deposit paid on website bookings by itself. For phone and walk-in bookings, tick Deposit paid once the guest has paid you, or send a website bookings deposit link. Refunds are done in Website bookings \u203a Orders. Deposit amounts are shown on bookings in Managers, Display and Staff. This does not grant access to other financial or HR information."})]}),Ke=(0,W.jsx)(k.LoyaltySettingsPanel,{}),Qe=(0,W.jsx)(se,{rid:P}),Ve=[{id:'bookings',title:'Bookings',words:'allergen allergy dog dogs cap limit access wheelchair step-free vegan vegetarian veg table request',reset:['dogQuestion','maxDogsPerSlot','accessQuestion','dietQuestion','tableRequests'],body:re,help:'adv-bookings'},{id:'times',title:'Table times',words:'dwell table time turn how long minutes party size next table free',reset:['dwellBands','dwellLearn'],body:he,help:'adv-table-times'},{id:'reserve',title:'Reservable items',words:'platter seafood crab lobster reserve price stock',reset:['reservables','reserveStock'],body:ge,help:'adv-reservable'},{id:'events',title:'Regular events',words:'open mic night music night event repeat monthly weekly promote busier forecast last food',reset:['regularEvents'],body:je,help:'adv-events'},{id:'hours',title:'Kitchen hours & last food orders',words:'hours kitchen season winter summer open close closed special day last food orders cutoff drinks',reset:['hourSets','hourOverrides','lastFoodByDay','afterLastFood'],body:Pe,help:'adv-hours'},{id:'home',title:'Display & home',words:'covers counter flip sound takeaway next table free home display',reset:['coversCounter','nextTableFree','showTakeaway'],body:Oe,help:'adv-home'},{id:'deposits',title:'Deposits',words:'deposit deposits per person party size refund refundable cut off policy paid due booking money wix link pay link online',reset:['deposit'],body:qe,help:'adv-deposits'},{id:'loyalty',title:'Loyalty: stamp card, offers & bring a friend',words:'loyalty stamp stamps card reward rewards offer offers referral refer friend bring expiry',reset:[],body:Ke,help:'adv-loyalty',noReset:!0},{id:'tableorder',title:'Order at the table',words:'order at table qr code scan phone guest menu tables areas accept first order last orders kitchen cut off print sheet pdf pay bar till',reset:[],body:o.IS_GREENSIDE?(0,W.jsx)(a.GreensideCashOnly,{}):(0,W.jsx)(r.TableOrderSettings,{rid:P,me:V}),help:'adv-table-order',noReset:!0},{id:'whatsapp',title:'WhatsApp',words:'whatsapp wa.me message chat guest phone mobile number tap',reset:['whatsapp'],body:Fe,help:'adv-whatsapp'},{id:'reminders',title:'Reminders',words:'reminder reminders break breaks chairs tables close closing shift staff nudge 6 hours law snooze later done',reset:[],body:Qe,help:'adv-reminders',onReset:()=>Z(P)},{id:'notifications',title:'Notifications',words:'notification notifications push phone scheduled order milk mills pieroni pieronis fish veg olsen rota upload remind time send',reset:[],body:(0,W.jsx)(B.NotificationsSettings,{rid:P}),help:'adv-notifications',onReset:()=>F.useNotifs.getState().resetSeeds(P)},{id:'orderlists',title:'Order lists',words:'order list lists alsons drinks cash carry trip shopping supplier logo staff add',reset:[],body:(0,W.jsx)(B.OrderListsSettings,{rid:P}),help:'adv-order-lists',onReset:()=>(0,B.resetOrderLists)(P)},{id:'tasks',title:'Tasks',words:'daily tasks library jobs checklist duties to do todo',reset:[],body:(0,W.jsx)(c.TaskLibrarySettings,{rid:P}),help:'adv-tasks',onReset:()=>b.useDailyTasks.getState().resetLibrary(P)},{id:'cashup',title:'Cash up',words:'cash up sheet takings till float card cash tips weekly sales report pos printout figures fields vat covers',reset:[],body:(0,W.jsx)(p.CashUpSettings,{rid:P}),help:'adv-cashup',onReset:()=>g.useCashUp.getState().resetFields(P)},{id:'tips',title:'Tips',words:'tips pot today tips show hide staff apps payout correction',reset:[],body:(0,W.jsx)(p.TipsSettings,{rid:P}),help:'adv-tips',onReset:()=>g.useCashUp.getState().setShow(P,{showToday:!0,showPot:!0})},{id:'clockarea',title:'Clock-in area',words:'clock in out geofence location area radius gps break forgot forgotten rota visiting map',reset:[],body:(0,W.jsx)(B.ClockAreaSettings,{rid:P,me:V}),help:'adv-clock-area',onReset:()=>(0,B.resetClockArea)(P,V)},{id:'checkout',title:'Shift check-out & question board',words:'check out checkout morale mood staffing staff enough overstaffed survey anonymous question board vote shout out shoutout wellbeing hr wording',reset:['hr'],body:(0,W.jsx)(u.HrSettingsCard,{rid:P}),help:'adv-checkout'},{id:'forecast',title:'Forecast history',words:'forecast history weeks estimate walk-ins opening hours minimum covers floor saturday sunday labour sales example figures not enough history',reset:['forecastMinWeeks'],body:Ue,help:'adv-forecast'},{id:'soldout',title:'Sold out reminders',words:'sold out 86 eighty six run out ran out back on clear end of service morning display strip auto automatic counts shellfish lobster crab platter link uses',reset:['soldOut'],body:Ne,help:'adv-soldout'},{id:'tablegrid',title:'Table plan grid',words:'table plan grid snap line up align tidy tables floor layout guides spacing restore',reset:[],body:(0,W.jsx)(z.GridSettings,{rid:P,me:V}),help:'adv-tablegrid',onReset:()=>{const e=A.useFloor.getState().settings[P];A.useFloor.getState().setSettings(P,{...A.DEFAULT_SETTINGS,...e??{},gridSnap:!0,gridSize:25})}},{id:'printers',title:'Printers',words:'print printer printers printing ticket tickets kitchen ticket docket receipt epson star bluetooth wifi reprint takeaway auto front of house copies',reset:[],body:(0,W.jsx)($.PrintersSettings,{rid:P,go:e}),help:'adv-printers',onReset:()=>{const e=A.useFloor.getState().settings[P];e&&A.useFloor.getState().setSettings(P,{...e,printing:void 0})}},{id:'blocks',title:'Block bookings: lunch, dinner and website bookings',words:'block blocks blocked pause close lunch dinner service times wix website online push',reset:[],noReset:!0,body:(0,W.jsx)(d.BlockSettings,{rid:P}),help:'adv-blocks'},{id:'giftqr',title:'Gift cards on the Display',words:'gift card cards voucher qr code display buy sell wix website page link',reset:[],noReset:!0,body:(0,W.jsx)(i.GiftQrSettings,{rid:P}),help:'adv-giftqr'},{id:'holidays',title:'Holiday names',words:'bank holiday substitute day names',reset:['holidayFullNames'],body:Ie,help:'adv-holidays'}],Ze=ee.trim().toLowerCase(),Je=(0,m.useMemo)(()=>Ve.filter(e=>!Ze||`${e.title} ${e.words}`.toLowerCase().includes(Ze)),[Ze,Ve]);return(0,W.jsxs)(y.default,{style:{gap:12},testID:"advanced-settings",children:[(0,W.jsx)(j.Muted,{children:"Owners and managers only. Changes are shared with your team\u2019s devices."}),(0,W.jsx)(n.TextInput,{accessibilityLabel:"Search settings",testID:"advanced-search",value:ee,onChangeText:te,placeholder:"Search, e.g. dogs, Open Mic Night, hours",placeholderTextColor:D.colours.muted,style:{minHeight:46,borderRadius:12,borderWidth:1,borderColor:D.colours.accentBorder,backgroundColor:D.colours.surface2,color:D.colours.text,paddingHorizontal:12,fontSize:16}}),oe?(0,W.jsx)(j.Banner,{kind:"success",title:oe}):null,Je.length?null:(0,W.jsxs)(j.Muted,{children:["No settings match \u201c",ee,"\u201d."]}),Je.map(s=>(0,W.jsx)(j.Card,{children:(0,W.jsxs)(y.default,{testID:`adv-${s.id}`,style:{gap:10},children:[(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(j.T,{size:17,weight:"semibold",colour:D.colours.gold,children:s.title}),e?(0,W.jsx)(f.default,{accessibilityRole:"button",accessibilityLabel:`Help: ${s.title}`,onPress:()=>e('more','help'),hitSlop:8,style:{minHeight:44,minWidth:44,justifyContent:'center'},children:(0,W.jsx)(j.T,{colour:D.colours.muted,children:"? Help"})}):null]}),s.body,s.noReset?null:(0,W.jsx)(j.Row,{style:{justifyContent:'flex-end'},children:(0,W.jsx)(j.Button,{small:!0,kind:"ghost",label:"Reset to default",testID:`reset-${s.id}`,onPress:()=>ne(s)})})]})},s.id))]})},Object.defineProperty(_e,"ADVANCED_DEFAULTS",{enumerable:!0,get:function(){return V}}),_e.SeasonsTodo=function({go:e}){const{r:s}=(0,R.useCtx)(6e4),t=(0,C.hourSetsOf)(s),o=[],a=t.filter(e=>!e.hours).map(e=>e.name);a.length&&o.push(`${a.join(' and ')} kitchen hours`);t.length>1&&t.some(e=>!e.start)&&o.push('the date each season starts');return o.length?(0,W.jsx)(j.Card,{onPress:()=>e('more','advanced'),highlight:D.colours.gold,children:(0,W.jsxs)(y.default,{testID:"seasons-todo",style:{gap:4},children:[(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(j.T,{weight:"semibold",colour:D.colours.gold,children:"Setup checklist: kitchen hours"}),(0,W.jsx)(j.T,{colour:D.colours.muted,children:"\u203a"})]}),(0,W.jsxs)(j.Muted,{size:13,children:["Please add ",o.join(' and ')," (Settings \u203a Advanced \u203a Kitchen hours). Until then the app uses the Winter hours all year."]})]})}):null};var s=_r(_d[0]),t=_r(_d[1]),o=_r(_d[2]),a=_r(_d[3]),n=_r(_d[4]),l=_r(_d[5]),r=_r(_d[6]),i=_r(_d[7]),d=_r(_d[8]),h=_r(_d[9]),u=_r(_d[10]),c=_r(_d[11]),p=_r(_d[12]),g=_r(_d[13]),b=_r(_d[14]),m=_r(_d[15]),x=e(m),f=e(_r(_d[16])),y=e(_r(_d[17])),j=_r(_d[18]),w=_r(_d[19]),k=_r(_d[20]),v=_r(_d[21]),C=_r(_d[22]),S=_r(_d[23]),T=_r(_d[24]),D=_r(_d[25]),R=_r(_d[26]),M=_r(_d[27]),L=_r(_d[28]),P=_r(_d[29]),O=_r(_d[30]),I=_r(_d[31]),z=_r(_d[32]),$=_r(_d[33]),A=_r(_d[34]),B=_r(_d[35]),F=_r(_d[36]),E=_r(_d[37]),N=_r(_d[38]),W=_r(_d[39]);const H=/^([01]\d|2[0-3]):[0-5]\d$/,U=/^(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/,_=/^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/,Y=[1,2,3,4,5,6,0],G=['Sun','Mon','Tue','Wed','Thu','Fri','Sat'];function q({value:e,onChange:s,placeholder:t,label:o,width:a=90,bad:l,testID:r}){return(0,W.jsx)(n.TextInput,{accessibilityLabel:o,testID:r,value:e,onChangeText:s,placeholder:t,placeholderTextColor:D.colours.muted,style:{width:a,minHeight:44,borderRadius:10,borderWidth:1,borderColor:l?D.colours.red:D.colours.hairline,backgroundColor:D.colours.surface2,color:D.colours.text,paddingHorizontal:10,fontSize:15}})}function K({value:e,onChange:s,min:t,max:o,unit:a,label:n,step:l=5}){const r=(a,l)=>(0,W.jsx)(f.default,{accessibilityRole:"button",accessibilityLabel:`${l<0?'Less':'More'}: ${n}`,onPress:()=>s(Math.min(o,Math.max(t,e+l))),style:{width:44,height:44,borderRadius:10,borderWidth:1,borderColor:D.colours.accentBorder,alignItems:'center',justifyContent:'center'},children:(0,W.jsx)(j.T,{size:20,colour:D.colours.gold,children:a})});return(0,W.jsxs)(j.Row,{gap:8,children:[r('\u2212',-l),(0,W.jsx)(j.T,{weight:"semibold",style:{minWidth:76,textAlign:'center'},children:a(e)}),r('+',l)]})}const Q=e=>e%60?`${Math.floor(e/60)}h ${e%60}m`:`${e/60} hour${60===e?'':'s'}`;const V={DEFAULT_DWELL:T.DEFAULT_DWELL,ANCHORAGE_SEASONS:C.ANCHORAGE_SEASONS};function Z(e){const s=P.useReminders.getState();s.ensure(e),s.resetRules(e),s.resetReminder((0,P.chairsId)(e))}const J=[1,2,3,4,5,6,0],X=e=>`${7===e.days.length?'Every day':J.filter(s=>e.days.includes(s)).map(e=>O.DAY_NAMES[e]).join(', ')||'No days'} at ${e.time} (UK time) \xb7 ${O.AUDIENCE_LABEL[e.audience]}`;function ee({init:e,onSave:s,onCancel:t}){const[o,a]=(0,m.useState)(e.text),[l,r]=(0,m.useState)(e.days),[i,d]=(0,m.useState)(e.time),[h,u]=(0,m.useState)(e.audience),c=o.trim().length>1&&l.length>0&&(0,O.validTime)(i);return(0,W.jsxs)(y.default,{testID:"reminder-editor",style:{gap:8,borderWidth:1,borderColor:D.colours.accentBorder,borderRadius:12,padding:10},children:[(0,W.jsx)(j.T,{weight:"semibold",children:"What it says"}),(0,W.jsx)(n.TextInput,{accessibilityLabel:"Reminder wording",testID:"reminder-text",value:o,onChangeText:a,maxLength:120,placeholder:"e.g. Time to put the chairs up on the tables",placeholderTextColor:D.colours.muted,style:{minHeight:44,borderRadius:10,borderWidth:1,borderColor:D.colours.hairline,backgroundColor:D.colours.surface2,color:D.colours.text,paddingHorizontal:10,fontSize:15}}),(0,W.jsx)(j.T,{weight:"semibold",children:"Days"}),(0,W.jsx)(j.Row,{wrap:!0,gap:6,children:J.map(e=>(0,W.jsx)(j.Chip,{label:O.DAY_NAMES[e],selected:l.includes(e),onPress:()=>r(l.includes(e)?l.filter(s=>s!==e):[...l,e])},e))}),(0,W.jsxs)(j.Row,{gap:8,children:[(0,W.jsx)(j.T,{weight:"semibold",children:"Time (UK)"}),(0,W.jsx)(q,{label:"Reminder time",testID:"reminder-time",value:i,onChange:d,placeholder:"21:00",bad:!(0,O.validTime)(i)})]}),(0,W.jsx)(j.T,{weight:"semibold",children:"Who sees it"}),(0,W.jsx)(j.Row,{wrap:!0,gap:6,children:['all','foh','kitchen'].map(e=>(0,W.jsx)(j.Chip,{label:O.AUDIENCE_LABEL[e],selected:h===e,onPress:()=>u(e)},e))}),c?null:(0,W.jsx)(j.Muted,{size:13,children:"Add the wording, at least one day and a time like 21:00."}),(0,W.jsxs)(j.Row,{gap:8,style:{justifyContent:'flex-end'},children:[(0,W.jsx)(j.Button,{small:!0,kind:"ghost",label:"Cancel",onPress:t}),(0,W.jsx)(j.Button,{small:!0,label:"Save reminder",testID:"reminder-save",disabled:!c,onPress:()=>s({text:o.trim(),days:[...l].sort(),time:i,audience:h})})]})]})}function se({rid:e}){x.default.useEffect(()=>{P.useReminders.getState().ensure(e)},[e]);const s=(0,P.useReminders)(e=>e.reminders),t=s.filter(s=>s.rid===e&&!s.removed),o=(0,P.useReminders)(s=>s.rules[e]),a=(0,O.clampRules)(o??O.DEFAULT_BREAK_RULES),n=(0,P.useReminders)(e=>e.done).filter(s=>s.rid===e).slice(0,5),l=(0,I.useOwner)(e=>e.staff),r=P.useReminders.getState(),[i,d]=(0,m.useState)(null),[h,u]=(0,m.useState)(null),c=s=>r.setRules(e,s);return(0,W.jsxs)(y.default,{style:{gap:10},testID:"reminders-settings",children:[(0,W.jsx)(j.Muted,{size:13,children:"Reminders slide up on the phones of staff who are on shift right now (clocked in, or on the rota at that time), in the Staff and Head Chef apps, while the app is open."}),(0,W.jsx)(j.T,{weight:"semibold",children:"Break reminders"}),(0,W.jsx)(j.Toggle,{label:"Remind staff to take their break",value:a.on,onChange:e=>c({on:e})}),(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},wrap:!0,children:[(0,W.jsx)(j.T,{center:!0,style:{width:'100%'},children:"First reminder, if the rota has no break time"}),(0,W.jsx)(K,{label:"first break reminder",step:15,min:30,max:O.LEGAL_LIMIT_MINS,value:a.afterMins,unit:e=>`${Q(e)} in`,onChange:e=>c({afterMins:e})})]}),(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},wrap:!0,children:[(0,W.jsx)(j.T,{style:{flex:1},children:"Remind once more after"}),(0,W.jsx)(K,{label:"second break reminder",step:5,min:5,max:120,value:a.repeatMins,unit:e=>`${e} min`,onChange:e=>c({repeatMins:e})})]}),(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},wrap:!0,children:[(0,W.jsx)(j.T,{style:{flex:1},children:"\u2018Later\u2019 hides it for"}),(0,W.jsx)(K,{label:"snooze",step:5,min:5,max:60,value:a.snoozeMins,unit:e=>`${e} min`,onChange:e=>c({snoozeMins:e})})]}),(0,W.jsxs)(j.Muted,{size:13,children:["How it works: if the shift on the rota has a break time, the reminder comes at that time. If not, it comes ",Q(a.afterMins)," after they clock in (or after the shift starts, if they haven\u2019t clocked in). If they still haven\u2019t started a break, it comes once more ",a.repeatMins," minutes later, and again at 6 hours. Nobody works more than 6 hours without a reminder: UK law says a shift over 6 hours needs a 20-minute break. \u2018Start break\u2019 starts their break, the same as on the clock screen."]}),(0,W.jsx)(j.T,{weight:"semibold",style:{marginTop:6},children:"Venue reminders"}),t.map(e=>(0,W.jsx)(y.default,{testID:`reminder-${e.builtIn??e.id}`,style:{gap:6,borderBottomWidth:1,borderColor:D.colours.hairline,paddingBottom:8},children:i===e.id?(0,W.jsx)(ee,{init:e,onCancel:()=>d(null),onSave:s=>{r.update(e.id,s),d(null)}}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},gap:8,children:[(0,W.jsx)(j.T,{weight:"semibold",style:{flex:1},children:e.text}),e.paused?(0,W.jsx)(j.Badge,{kind:"amber",label:"PAUSED"}):null]}),(0,W.jsx)(j.Muted,{size:13,children:X(e)}),h===e.id?(0,W.jsxs)(j.Row,{gap:8,wrap:!0,children:[(0,W.jsx)(j.T,{size:14,style:{flex:1},children:"Delete this reminder?"}),(0,W.jsx)(j.Button,{small:!0,kind:"danger",label:"Yes, delete it",onPress:()=>{r.remove(e.id),u(null)}}),(0,W.jsx)(j.Button,{small:!0,kind:"ghost",label:"Keep it",onPress:()=>u(null)})]}):(0,W.jsxs)(j.Row,{gap:8,wrap:!0,children:[(0,W.jsx)(j.Button,{small:!0,kind:"secondary",label:"Edit",testID:"reminder-edit",onPress:()=>d(e.id)}),(0,W.jsx)(j.Button,{small:!0,kind:"secondary",label:e.paused?'Resume':'Pause',onPress:()=>r.update(e.id,{paused:!e.paused})}),(0,W.jsx)(j.Button,{small:!0,kind:"ghost",label:"Delete",onPress:()=>u(e.id)})]})]})},e.id)),t.length?null:(0,W.jsx)(j.Muted,{children:"No venue reminders. Add one below, or Reset to default to bring back \u201cchairs up\u201d."}),'new'===i?(0,W.jsx)(ee,{init:{text:'',days:[5,6],time:'21:00',audience:'all'},onCancel:()=>d(null),onSave:s=>{r.add(e,s),d(null)}}):(0,W.jsx)(j.Button,{small:!0,kind:"secondary",label:"\uff0b Add a reminder",testID:"reminder-add",onPress:()=>d('new')}),n.length?(0,W.jsxs)(y.default,{style:{gap:2},children:[(0,W.jsx)(j.T,{weight:"semibold",children:"Recently done"}),n.map(e=>(0,W.jsxs)(j.Muted,{size:13,children:[new Date(e.at).toLocaleString('en-GB',{weekday:'short',day:'numeric',month:'short',hour:'2-digit',minute:'2-digit',timeZone:'Europe/London'})," \xb7 ",(l.find(s=>s.id===e.staffRef)?.name??e.staffName).replace(' (example)','')," \xb7 ",s.find(s=>s.id===e.reminderId)?.text??'Reminder']},e.id))]}):null,(0,W.jsxs)(j.Muted,{size:13,children:["Tip: once anyone taps Done, the reminder goes away for everyone that day, and you can see who did it here. \u2018Later\u2019 hides it on that phone for ",a.snoozeMins," minutes. Reset to default puts back the break times and \u201cchairs up\u201d (",(0,O.defaultChairs)('x',e).days.map(e=>O.DAY_NAMES[e]).join(' and '),", 21:00); your own reminders stay."]}),(0,W.jsx)(j.Muted,{size:13,children:"Reminders show while the app is open. Phones with the app closed don\u2019t get them yet."})]})}},1418,[1051,1031,805,1405,812,1419,1420,1422,1423,1424,1197,1029,1030,1006,1012,17,385,85,777,841,1425,816,862,1053,861,804,1055,858,1181,972,973,876,1426,1379,996,1427,1003,1139,939,8]); __d(function(g,_r,_i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.ForecastDaySettings=function({r:t,set:s}){const c=(0,o.forecastHoursOf)(t),y=(0,o.minCoversOf)(t),v=t.settings.minCoversNote??('anchorage'!==t.id||t.settings.minCoversByDay?void 0:o.MIN_COVERS_NOTE),x=(e,t,n)=>{const i=c[e]??['12:00','22:00'],o=0===t?[n,i[1]]:[i[0],n];h(o[0])&&h(o[1])&&s({forecastHours:{...c,[e]:o}})},f=(e,t)=>{const n=''===t.trim()?null:Math.max(0,Math.min(999,Math.round(Number(t)||0)));s({minCoversByDay:{...y,[e]:n||null},minCoversNote:void 0})};return(0,u.jsxs)(n.default,{style:{gap:8},testID:"forecast-day-settings",children:[(0,u.jsx)(i.T,{children:"Opening hours shown on the forecast"}),(0,u.jsx)(i.Muted,{size:13,children:"The hours your bar or dining room is open, so the forecast covers the whole day, not just kitchen hours. Any hour with a booking always shows."}),d.map(t=>(0,u.jsxs)(i.Row,{gap:8,style:{alignItems:'center'},children:[(0,u.jsx)(i.T,{center:!0,size:15,style:{width:'100%'},children:r.DAYS[t]}),c[t]?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(e.TextInput,{testID:`fc-open-${t}`,accessibilityLabel:`${r.DAYS[t]} opens`,defaultValue:c[t][0],onEndEditing:e=>x(t,0,e.nativeEvent.text),onBlur:e=>x(t,0,e?.target?.value??c[t][0]),style:[i.styles.input,{width:90,minHeight:44}]}),(0,u.jsx)(i.T,{size:15,children:"to"}),(0,u.jsx)(e.TextInput,{testID:`fc-close-${t}`,accessibilityLabel:`${r.DAYS[t]} closes`,defaultValue:c[t][1],onEndEditing:e=>x(t,1,e.nativeEvent.text),onBlur:e=>x(t,1,e?.target?.value??c[t][1]),style:[i.styles.input,{width:90,minHeight:44}]})]}):(0,u.jsx)(i.Muted,{children:"Kitchen hours"})]},`h${t}`)),(0,u.jsx)(i.T,{style:{marginTop:8},children:"Usual minimum Covers"}),(0,u.jsx)(i.Muted,{size:13,children:"The fewest Covers you always do on that day. The forecast never shows less. Leave blank if you have no usual minimum."}),d.map(t=>(0,u.jsxs)(i.Row,{gap:8,style:{alignItems:'center'},children:[(0,u.jsx)(i.T,{center:!0,size:15,style:{width:'100%'},children:r.DAYS[t]}),(0,u.jsx)(e.TextInput,{testID:`fc-min-${t}`,accessibilityLabel:`${r.DAYS[t]} usual minimum Covers`,keyboardType:"number-pad",defaultValue:y[t]?String(y[t]):'',placeholder:"Blank",placeholderTextColor:"#7D776C",onEndEditing:e=>f(t,e.nativeEvent.text),onBlur:e=>f(t,e?.target?.value??''),style:[i.styles.input,{width:90,minHeight:44}]}),(0,u.jsx)(i.Muted,{children:"Covers"})]},`m${t}`)),v?(0,u.jsxs)(i.T,{size:13,colour:l.colours.goldLight,children:["Set from ",v,"."]}):null,(0,u.jsx)(i.Muted,{size:13,children:"Tip: use a number you are sure of, such as the quietest Saturday in the last few months."})]})};var e=_r(_d[0]);_r(_d[1]);var t,s=_r(_d[2]),n=(t=s)&&t.__esModule?t:{default:t},i=_r(_d[3]),o=_r(_d[4]),r=_r(_d[5]),l=_r(_d[6]),u=_r(_d[7]);const d=[1,2,3,4,5,6,0],h=e=>/^([01]\d|2[0-3]):[0-5]\d$/.test(e)},1419,[812,17,85,777,1137,861,804,8]); __d(function(g,_r,i,_a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.TableOrderSettings=function({rid:s,me:a}){const k=(0,r.useRestaurant)(s),v=(0,o.usePlan)(s),T=(0,h.staffServer)(),R=!T||(0,b.can)('venue.settings'),[C,S]=(0,t.useState)({...c.TABLE_ORDER_DEFAULT}),[N,P]=(0,t.useState)([]),[$,D]=(0,t.useState)(null),[M,Q]=(0,t.useState)(!1),[O,B]=(0,t.useState)(!1),[A,I]=(0,t.useState)(null),[_,L]=(0,t.useState)(null),[F,E]=(0,t.useState)('sticker'),G=(0,t.useCallback)(async()=>{if(T)try{S(await(0,u.loadTableSettings)()),B(!1),(0,b.can)('venue.settings')&&(P(await(0,u.listTableCodes)()),I(await(0,u.tableReadiness)().catch(()=>null)))}catch(e){D({kind:'danger',t:`Couldn't load: ${e.message}`})}},[T]);(0,t.useEffect)(()=>(G(),T?(0,u.watchTableSettings)(()=>{O||G()}):void 0),[G]);const z=e=>{S(t=>({...t,...e})),B(!0),D(null)},W=v.tables.map(e=>e.name).filter(c.isTableNo).sort((e,t)=>Number(e)-Number(t)),H=C.tables??W,U=e=>z({tables:H.includes(e)?H.filter(t=>t!==e):[...H,e].sort((e,t)=>Number(e)-Number(t))}),Y=e=>v.tables.filter(t=>t.areaId===e).map(e=>e.name).filter(c.isTableNo),q=e=>{const t=Y(e);return t.length>0&&t.every(e=>H.includes(e))},J=e=>{const t=Y(e),s=q(e);z({tables:s?H.filter(e=>!t.includes(e)):[...new Set([...H,...t])].sort((e,t)=>Number(e)-Number(t))})},K=async()=>{Q(!0);try{const e=C.tables&&C.tables.length===W.length&&W.every(e=>C.tables.includes(e))?null:C.tables;T&&await(0,u.saveTableSettings)({...C,tables:e},a),r.useStore.getState().updateSettings(s,{orderAtTable:C.on}),B(!1),D({kind:'success',t:C.on?'Saved. Guests can order from the tables you picked.':'Saved. Order at the table is off.'})}catch(e){D({kind:'danger',t:`Not saved: ${e.message}`})}Q(!1)},V=async()=>{Q(!0);try{const e=await(0,u.makeTableCodes)(H);P(await(0,u.listTableCodes)()),D({kind:'success',t:e.made?`Made ${e.made} new QR code${e.made>1?'s':''}.`:'Every table you picked already has a code.'})}catch(e){D({kind:'danger',t:e.message})}Q(!1)},X=async t=>{Q(!0),L(null);try{await(0,u.renewTableCode)(t),P(await(0,u.listTableCodes)()),D({kind:'warn',t:`Table ${(0,e.tableNumbers)(t)} has a new code. The old QR on that table has stopped working, so print this one and swap it.`})}catch(e){D({kind:'danger',t:e.message})}Q(!1)},Z=e=>{const t=N.filter(t=>e?t.table===e:H.includes(t.table)),s=(0,p.printQrSheet)(k?.name??'Our venue',t.map(e=>({table:e.table,link:(0,c.tableLink)(w(),e.token)})),{logo:`${w()}/customer-app/brand-logo.png`,size:F});D(s?{kind:'success',t:'QR sheet opened. Choose "Save as PDF" or your printer.'}:{kind:'warn',t:'Printing works from the web app on a computer or tablet.'})};return T?(0,f.jsxs)(n.default,{style:{gap:10},testID:"table-order-settings",children:[(0,f.jsx)(l.Muted,{center:!0,children:"Tip: start with a few tables and keep \"Staff accept the first order\" on. Guests pay at the bar or with their server, and the kitchen gets the order like any other ticket."}),A&&A.priced>0&&A.signedz({on:e}),disabled:!R,testID:"tos-on"}),(0,f.jsx)(l.Toggle,{label:"Staff accept the first order from each new phone",value:C.staffAccept,onChange:e=>z({staffAccept:e}),disabled:!R}),(0,f.jsx)(l.Muted,{children:"On is safer: someone sat at the table can't be told apart from someone who photographed the QR. After staff accept one order, that phone's next orders go straight to the kitchen for 12 hours."}),(0,f.jsx)(l.T,{weight:"semibold",children:"Which areas and tables"}),(0,f.jsx)(l.Row,{wrap:!0,gap:6,children:v.areas.filter(e=>Y(e.id).length).map(e=>(0,f.jsx)(l.Chip,{label:e.name,selected:q(e.id),onPress:R?()=>J(e.id):void 0},e.id))}),(0,f.jsx)(l.Row,{wrap:!0,gap:6,children:W.map(t=>(0,f.jsx)(l.Chip,{label:`${(0,e.tableNumbers)(t)}`,selected:H.includes(t),onPress:R?()=>U(t):void 0},t))}),(0,f.jsxs)(l.Muted,{children:[C.tables?`${H.length} of ${W.length} tables`:'All tables',"."]}),(0,f.jsx)(l.T,{weight:"semibold",children:"Hours"}),(0,f.jsxs)(l.Row,{style:{justifyContent:'space-between'},children:[(0,f.jsx)(l.T,{children:"Opens at"}),(0,f.jsx)(l.Stepper,{label:"Opens at",value:j(C.openFrom),min:-15,max:1425,step:15,format:y,onChange:e=>R&&z({openFrom:x(e)})})]}),(0,f.jsxs)(l.Row,{style:{justifyContent:'space-between'},children:[(0,f.jsx)(l.T,{children:"Last orders (kitchen cut-off)"}),(0,f.jsx)(l.Stepper,{label:"Last orders",value:j(C.lastOrders),min:-15,max:1425,step:15,format:y,onChange:e=>R&&z({lastOrders:x(e)})})]}),(0,f.jsx)(l.Muted,{children:(0,c.hoursWords)(C)}),(0,f.jsx)(l.Field,{label:"Note guests see above the menu (optional)",value:C.guestTip,onChangeText:e=>z({guestTip:e.slice(0,160)}),editable:R,placeholder:"e.g. Drinks are ordered at the bar."}),R?(0,f.jsx)(l.Button,{label:M?'Saving\u2026':'Save order at the table',disabled:M||!O,onPress:()=>{K()},testID:"tos-save"}):null,$?(0,f.jsx)(l.Banner,{kind:$.kind,children:$.t}):null,R?(0,f.jsxs)(l.Card,{children:[(0,f.jsxs)(l.Row,{style:{justifyContent:'space-between'},children:[(0,f.jsx)(l.T,{weight:"semibold",children:"QR codes"}),(0,f.jsx)(l.Badge,{kind:"gold",label:`${N.length} made`})]}),(0,f.jsx)(l.Muted,{children:"Each table gets its own code. A guest can only order with the code that's on the table."}),(0,f.jsx)(l.T,{center:!0,size:13,weight:"semibold",children:"Card size"}),(0,f.jsx)(n.default,{testID:"tos-card-size",children:(0,f.jsx)(l.Row,{gap:6,wrap:!0,style:{justifyContent:'center'},children:Object.keys(p.QR_CARD).map(e=>(0,f.jsx)(l.Chip,{label:p.QR_CARD[e].label,selected:F===e,onPress:()=>E(e)},e))})}),(0,f.jsxs)(l.Muted,{center:!0,children:['sticker'===F?'For stickers and small QR table stands: 20 to a page, QR 30 mm.':'For table stand cards (about 2 \xd7 3 in): 16 to a page, QR 34 mm, with the short link.'," Print at 100% (actual size), then cut along the dashed lines."]}),(0,f.jsxs)(l.Row,{gap:8,wrap:!0,style:{justifyContent:'center'},children:[(0,f.jsx)(l.Button,{small:!0,label:"Make codes for the tables picked",disabled:M,onPress:()=>{V()}}),(0,f.jsx)(l.Button,{small:!0,kind:"secondary",label:"Print all QR cards",disabled:!N.length,onPress:()=>Z(),testID:"tos-print"})]}),N.map(t=>(0,f.jsxs)(l.Row,{style:{justifyContent:'space-between'},children:[(0,f.jsxs)(l.T,{children:["Table ",(0,e.tableNumbers)(t.table),H.includes(t.table)?'':' (not taking orders)']}),(0,f.jsxs)(l.Row,{gap:6,children:[(0,f.jsx)(l.Button,{small:!0,kind:"secondary",label:"Reprint",accessibilityLabel:`Reprint the QR for table ${t.table}`,disabled:M,onPress:()=>Z(t.table),testID:`tos-reprint-${t.table}`}),(0,f.jsx)(l.Button,{small:!0,kind:"ghost",label:"New code",accessibilityLabel:`New code for table ${t.table}`,disabled:M,onPress:()=>L(t.table),testID:`tos-renew-${t.table}`})]})]},t.table)),(0,f.jsx)(l.Muted,{children:"Lost or copied QR? Make a new code for that table; the old one stops working."})]}):null,(0,f.jsxs)(l.Card,{children:[(0,f.jsx)(l.T,{center:!0,weight:"semibold",children:"Paying"}),(0,f.jsx)(l.Muted,{center:!0,children:"Guests pay at the bar or with their server. Paying by card from the phone is coming later; no card details are asked for."})]}),_?(0,f.jsxs)(l.Sheet,{visible:!0,onClose:()=>L(null),title:`New code for table ${(0,e.tableNumbers)(_)}?`,maxWidth:520,testID:"tos-renew-confirm",children:[(0,f.jsxs)(l.T,{center:!0,children:["The QR code on table ",(0,e.tableNumbers)(_)," stops working straight away. Guests who scan the old one are told to ask a member of staff."]}),(0,f.jsx)(l.Muted,{center:!0,children:"Print the new one and swap it on the table."}),(0,f.jsx)(l.Button,{label:"Yes, make a new code",onPress:()=>{X(_)},testID:"tos-renew-yes"}),(0,f.jsx)(l.Button,{kind:"secondary",label:"Cancel",onPress:()=>L(null)})]}):null]}):(0,f.jsx)(l.Banner,{kind:"demo",title:"Needs the venue connection",children:"Order at the table runs on the server, so it works once this app is connected to your venue. Nothing here is sent anywhere."})};var e=_r(d[0]),t=_r(d[1]);_r(d[2]);var s,a=_r(d[3]),n=(s=a)&&s.__esModule?s:{default:s},l=_r(d[4]),r=_r(d[5]),o=_r(d[6]),c=_r(d[7]),h=_r(d[8]),b=_r(d[9]),u=_r(d[10]),p=_r(d[11]),f=_r(d[12]);const w=()=>'undefined'!=typeof window&&/^https:/.test(window.location.origin)?window.location.origin:"https://covercharge-apps.static.hf.space",j=e=>e?60*Number(e.slice(0,2))+Number(e.slice(3,5)):-15,x=e=>e<0?null:(0,c.hm)(e),y=e=>e<0?'Not set':(0,c.hm)(e)},1420,[843,17,219,85,777,858,996,1150,1253,946,1324,1421,8]); __d(function(g,_r,_i,a,_m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.qrSvg=n,Object.defineProperty(e,"QR_CARD",{enumerable:!0,get:function(){return r}}),e.qrSheetHtml=s,e.printQrSheet=function(t,o,i={}){if('undefined'==typeof window||!window.open)return!1;const n=window.open('','_blank');return!!n&&(n.document.write(s(t,o,i)),n.document.close(),n.focus(),setTimeout(()=>{try{n.print()}catch{}},800),!0)};var t=_r(_d[0]);const o=_r(_d[1]),i=t=>t.replace(/[&<>"']/g,t=>({'&':'&','<':'<','>':'>','"':'"',"'":'''}[t]));function n(t,i=220){const n=o.create(t,{errorCorrectionLevel:'M'}).modules,r=n.size,s=r+8;let l='';for(let t=0;t`}const r={sticker:{w:50,h:50,qr:30,cols:4,rows:5,label:'Stickers 50 \xd7 50 mm'},stand:{w:50,h:70,qr:34,cols:4,rows:4,label:'Stand cards 50 \xd7 70 mm'}};function s(o,s,l={}){const d=l.size??'sticker',c=r[d],m='stand'===d,h=l.logo?``:'',f=o=>`
${h}
${i((0,t.tableNumbersA11y)(o.table))}
${n(o.link,240)}
Scan to order
${m?`
Pay at the bar or with your server
${i(o.link.replace(/^https?:\/\//,''))}
`:''}
`,p=c.cols*c.rows,u=[];for(let t=0;t${s.slice(t,t+p).map(f).join('')}`);return`${i(o)} table QR codes \xb7 ${c.label}

${i(o)} \xb7 ${c.label} \xb7 cut along the dashed lines \xb7 print at 100% (actual size, not "fit to page")

${u.join('')}`}},1421,[843,1275]); @@ -1591,7 +1591,7 @@ __d(function(g,_r,_i,_a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModu __d(function(g,_r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.deviceKind=o,e.deviceSyncLine=function(r,c){const l=Date.parse(r.seen_at),u=r.last_synced_at?Date.parse(r.last_synced_at):0,$=c-l>18e4,h=!u||l-u>6e4,p=!$&&!h,_=`${t[r.app]??r.app}${r.who?` \xb7 ${r.who}`:''} \xb7 ${o(r.user_agent)}`,f=$?`Not reporting since ${n(r.seen_at)} (${s(c-l)})${u?`, last synced ${n(r.last_synced_at)}`:''}`:h?`Out of sync${u?` since ${n(r.last_synced_at)}`:''}, reconnecting`:`In sync \xb7 last synced ${n(r.last_synced_at)} (${s(c-u)})`,y=[r.version??'','SUBSCRIBED'===r.realtime?'live channel on':`live channel ${String(r.realtime??'off').toLowerCase()}`];r.pending&&y.push(`${r.pending} change${1===r.pending?'':'s'} waiting`);r.failed&&y.push(`${r.failed} not saved`);return{ok:p,title:_,state:f,detail:y.filter(Boolean).join(' \xb7 ')}};const t={owner:'Managers',staff:'Staff',chef:'Chef',display:'Display',car:'Car'},n=t=>new Date(t).toLocaleTimeString('en-GB',{hour:'2-digit',minute:'2-digit',timeZone:'Europe/London'}),s=t=>t<9e4?`${Math.max(0,Math.round(t/1e3))} s ago`:t<54e5?`${Math.round(t/6e4)} min ago`:`${Math.round(t/36e5)} h ago`;function o(t){const n=t??'';return/CoverChargeTablet|TB\d|Tablet/i.test(n)?'tablet':/iPhone/i.test(n)?'iPhone':/iPad/i.test(n)?'iPad':/Android/i.test(n)?'Android':/Tesla/i.test(n)?'car':/Mac OS X|Windows|Linux/i.test(n)?'computer':'device'}},1508,[]); __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.TableQrPage=function(){const{rid:e,me:t}=(0,h.useCtx)(6e4),b=t.replace(' (example)','');return(0,u.jsxs)(s.default,{style:{gap:14,width:'100%',maxWidth:760,alignSelf:'center'},testID:"table-qr-page",children:[(0,u.jsx)(l.T,{center:!0,size:22,weight:"semibold",colour:o.colours.gold,accessibilityRole:"header",children:"Table QR codes"}),(0,u.jsx)(l.Muted,{center:!0,children:"Guests scan the code on their table, see the menu and send their order to the kitchen. They pay at the bar or with their server."}),(0,u.jsx)(c.TableOrderSettings,{rid:e,me:b}),(0,u.jsx)(l.T,{center:!0,size:20,weight:"semibold",colour:o.colours.gold,accessibilityRole:"header",children:"Orders from the tables"}),(0,u.jsx)(n.StaffTableOrders,{rid:e,me:b})]})},r(d[0]);var e,t=r(d[1]),s=(e=t)&&e.__esModule?e:{default:e},l=r(d[2]),o=r(d[3]),c=r(d[4]),n=r(d[5]),h=r(d[6]),u=r(d[7])},1509,[17,85,777,804,1420,1498,1055,8]); __d(function(g,_r,_i,_a,_m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.showMe=j,_e.HelpPage=function({go:e}){const[s,a]=(0,n.useState)(''),[r,h]=(0,n.useState)(null),[p,m]=(0,n.useState)(null),j=(0,n.useMemo)(()=>s.trim()?(0,u.searchHelp)(c.HELP,s,10).map(e=>e.a):c.HELP.filter(e=>!r||e.topic===r),[s,r]);return(0,f.jsxs)(o.default,{style:{gap:10},testID:"help-page",children:[(0,f.jsxs)(o.default,{style:[i.styles.input,{flexDirection:'row',alignItems:'center',gap:8,paddingVertical:4}],children:[(0,f.jsx)(i.T,{colour:x.colours.muted,children:"\ud83d\udd0d"}),(0,f.jsx)(t.TextInput,{testID:"help-search",value:s,onChangeText:a,placeholder:"Search help",placeholderTextColor:"#7D776C",accessibilityLabel:"Search help",style:{flex:1,minWidth:0,width:0,boxSizing:'border-box',color:x.colours.text,paddingVertical:8,fontSize:16,outlineStyle:'none'}}),s?(0,f.jsx)(l.GoldClose,{testID:"help-search-clear",size:"sm",label:"Clear search",onPress:()=>a('')}):null]}),(0,f.jsx)(b,{go:e}),s?(0,f.jsx)(i.Muted,{children:j.length?`${j.length} result${1===j.length?'':'s'} for \u201c${s.trim()}\u201d`:`Nothing for \u201c${s.trim()}\u201d. Try other words, or ask the Assistant above.`}):(0,f.jsx)(i.Row,{wrap:!0,gap:6,children:[null,...c.HELP_TOPICS].map(e=>(0,f.jsx)(i.Chip,{label:e??'All',selected:r===e,onPress:()=>h(e)},e??'all'))}),j.map((t,l)=>(0,f.jsx)(y,{a:t,go:e,open:p===t.id||!!s&&0===l&&null===p,onToggle:()=>m(p===t.id?'':t.id)},t.id)),(0,f.jsxs)(i.Card,{style:{alignItems:'center'},children:[(0,f.jsx)(i.T,{center:!0,weight:"semibold",colour:x.colours.gold,children:"Chat with CoverCharge support"}),(0,f.jsx)(i.Muted,{center:!0,children:"Send a message to the CoverCharge team. Nobody replies automatically."}),(0,f.jsx)(i.Button,{label:"Open the chat",accessibilityLabel:"Open the chat with CoverCharge support",onPress:()=>e('more','support')})]})]})},_e.AskAssistant=b;var t=_r(d[0]),s=_r(d[1]),l=_r(d[2]),n=_r(d[3]),a=e(_r(d[4])),o=e(_r(d[5])),i=_r(d[6]),r=_r(d[7]),h=_r(d[8]),c=_r(d[9]),u=_r(d[10]),p=_r(d[11]),x=_r(d[12]),m=_r(d[13]),f=_r(d[14]);function j(e,t){e.showMe&&(t(e.showMe.tab,e.showMe.page??null),setTimeout(()=>h.useCoach.getState().show(e.showMe.target,e.showMe.hint),300))}function y({a:e,go:t,open:s,onToggle:l}){return(0,f.jsx)(o.default,{testID:`help-${e.id}`,children:(0,f.jsxs)(i.Card,{children:[(0,f.jsx)(a.default,{accessibilityRole:"button",onPress:l,children:(0,f.jsxs)(i.Row,{style:{justifyContent:'space-between'},gap:8,children:[(0,f.jsxs)(o.default,{style:{flex:1},children:[(0,f.jsx)(i.T,{weight:"semibold",children:e.title}),(0,f.jsxs)(i.Row,{gap:6,children:[(0,f.jsx)(i.Badge,{kind:'guide'===e.kind?'gold':'neutral',label:'guide'===e.kind?'Step by step':'FAQ'}),(0,f.jsx)(i.Muted,{size:12,children:e.topic})]})]}),(0,f.jsx)(i.T,{colour:x.colours.muted,children:s?'\u25be':'\u203a'})]})}),s?(0,f.jsxs)(o.default,{style:{gap:6},children:[(0,f.jsx)(i.Muted,{children:e.body}),e.steps?.map((e,t)=>(0,f.jsxs)(i.Row,{gap:8,style:{alignItems:'flex-start'},children:[(0,f.jsx)(o.default,{style:{width:22,height:22,borderRadius:11,backgroundColor:x.colours.gold,alignItems:'center',justifyContent:'center'},children:(0,f.jsx)(i.T,{size:12,weight:"bold",colour:"#1A1408",children:t+1})}),(0,f.jsx)(i.T,{style:{flex:1},children:e})]},t))]}):null,e.showMe?(0,f.jsx)(i.Row,{wrap:!0,gap:6,children:(0,f.jsx)(i.Button,{small:!0,kind:"success",label:"Show me",testID:`showme-${e.id}`,onPress:()=>j(e,t)})}):null]})})}function b({go:e}){const{rid:t,today:s}=(0,m.useCtx)(6e4),l={rid:t,today:s,go:(t,s)=>e(t,s??null)},[a,r]=(0,n.useState)(''),[h,u]=(0,n.useState)(null),[y,b]=(0,n.useState)(null),k=async()=>{const e=a.trim();if(!e)return;b(null),u(null);const t=(0,p.matchIntent)(e,s);if('action'!==t.kind)'help'!==t.kind?b({text:'Sorry, I didn\u2019t follow that. Try \u201cadd a walk-in for 4 at table 7\u201d, \u201cput Ellie on Friday 5 till 11\u201d, or ask \u201chow do I export hours?\u201d.',kind:'note'}):b({text:'Here\u2019s what I found. Tap Show me and I\u2019ll point to it.',kind:'note',help:t.ids});else{if(!(0,p.needsConfirm)(t.action.risk)){const e=await(0,p.runAction)(t.action.id,t.params,l);return void b({text:'done'===e.status?e.message:e.message??'',kind:'done'})}u({action:t.action,params:{...w(t.action,s),...t.params},asked:e})}};return(0,f.jsx)(o.default,{testID:"ask-assistant",children:(0,f.jsxs)(i.Card,{highlight:x.colours.gold,children:[(0,f.jsxs)(i.Row,{gap:8,children:[(0,f.jsx)(o.default,{style:{width:28,height:28,borderRadius:14,backgroundColor:x.colours.gold,alignItems:'center',justifyContent:'center'},children:(0,f.jsx)(i.T,{weight:"bold",colour:"#1A1408",children:"\u2726"})}),(0,f.jsx)(i.T,{weight:"semibold",style:{flex:1},children:"Ask the Assistant"})]}),(0,f.jsxs)(o.default,{testID:"help-assistant-stack",style:{gap:8,width:'100%',minWidth:0},children:[(0,f.jsx)(i.Field,{label:"Ask or tell it what to do",testID:"assistant-input",value:a,onChangeText:r,placeholder:"Ask in plain words",onSubmitEditing:k,returnKeyType:"send",style:{width:'100%',minWidth:0,boxSizing:'border-box'}}),(0,f.jsx)(i.Button,{label:"Ask",testID:"assistant-ask",disabled:!a.trim(),onPress:k,style:{width:'100%',minWidth:0,minHeight:52}})]}),(0,f.jsx)(i.Row,{wrap:!0,gap:6,children:['Add a walk-in for 4 at table 7','Put a shift on Friday 5 till 11','How do I export hours for payroll?','Pay out the tips'].map(e=>(0,f.jsx)(i.Chip,{label:e,onPress:()=>r(e)},e))}),h?(0,f.jsx)(C,{p:h,today:s,onChange:e=>u({...h,params:e}),onConfirm:async()=>{if(!h)return;const e=await(0,p.runAction)(h.action.id,h.params,l,!0);u(null),r(''),b('done'===e.status?{text:e.message,kind:'done'}:'demo_only'===e.status?{text:e.message,kind:'demo'}:{text:e.message??'Couldn\u2019t do that.',kind:'error'})},onCancel:()=>{u(null),b({text:'Cancelled. Nothing was changed.',kind:'note'})}}):null,y?(0,f.jsxs)(o.default,{style:{gap:6},testID:"assistant-reply",children:[(0,f.jsx)(i.Banner,{kind:'done'===y.kind?'success':'error'===y.kind?'warn':'demo'===y.kind?'demo':'info',title:y.text}),y.help?.map(t=>{const s=(0,c.helpById)(t);return(0,f.jsxs)(i.Row,{gap:6,style:{justifyContent:'space-between'},children:[(0,f.jsx)(i.T,{style:{flex:1},children:s.title}),s.showMe?(0,f.jsx)(i.Button,{small:!0,kind:"success",label:"Show me",onPress:()=>j(s,e)}):null]},t)})]}):null,(0,f.jsx)(i.Muted,{size:12,children:"It shows you what it will do and waits for your tap. It never sends, pays or deletes anything."})]})})}function w(e,t){return'add_rota_shift'===e.id?{date:t,start:17,end:23}:'add_walkin'===e.id?{covers:2}:{}}function C({p:e,today:t,onChange:l,onConfirm:n,onCancel:a}){const h=(0,r.useOwner)(e=>e.staff).filter(e=>e.active),c=(0,p.demoOnly)(e.action.risk),u=(t,s)=>l({...e.params,[t]:s}),m=e.action,j=e.params,y=m.params.every(e=>!e.required||void 0!==j[e.name]&&''!==j[e.name]);return(0,f.jsxs)(o.default,{testID:"assistant-confirm",style:{borderWidth:2,borderColor:c?x.colours.red:x.colours.ok,borderRadius:14,padding:12,gap:8,backgroundColor:c?'#2a1010':x.colours.okBg},children:[(0,f.jsxs)(i.Row,{gap:6,children:[(0,f.jsx)(i.Badge,{kind:c?'red':'ok',label:p.RISK_LABEL[m.risk]}),(0,f.jsx)(i.T,{weight:"semibold",style:{flex:1},children:m.title})]}),m.form&&'add_walkin'===m.id?(0,f.jsxs)(i.Row,{gap:6,children:[(0,f.jsx)(o.default,{style:{flex:1},children:(0,f.jsx)(i.Field,{label:"Covers",value:void 0===j.covers?'':String(j.covers),onChangeText:e=>u('covers',e.replace(/\D/g,'')?Number(e.replace(/\D/g,'')):void 0),keyboardType:"number-pad"})}),(0,f.jsx)(o.default,{style:{flex:1},children:(0,f.jsx)(i.Field,{label:"Table (optional)",value:void 0===j.table?'':String(j.table),onChangeText:e=>u('table',e.trim()?e.trim().toUpperCase():void 0)})})]}):null,m.form&&'add_rota_shift'===m.id?(0,f.jsxs)(o.default,{style:{gap:6},children:[(0,f.jsx)(i.Muted,{size:12,children:"Who"}),(0,f.jsx)(i.Row,{wrap:!0,gap:6,children:h.slice(0,14).map(e=>(0,f.jsx)(i.Chip,{label:e.name.replace(' (example)','').split(' ')[0],selected:j.staffId===e.id,onPress:()=>u('staffId',e.id)},e.id))}),(0,f.jsxs)(i.Row,{gap:6,children:[(0,f.jsx)(o.default,{style:{flex:1.3},children:(0,f.jsx)(i.Field,{label:"Date (DD/MM/YYYY)",...(0,s.slashBox)(String(j.date??t),e=>u('date',e)),placeholder:"20/11/2026",keyboardType:"numbers-and-punctuation",maxLength:10})}),(0,f.jsx)(o.default,{style:{flex:1},children:(0,f.jsx)(i.Field,{label:"Start (24h)",value:String(j.start??''),onChangeText:e=>u('start',''===e?void 0:Number(e)),keyboardType:"decimal-pad"})}),(0,f.jsx)(o.default,{style:{flex:1},children:(0,f.jsx)(i.Field,{label:"End (24h)",value:String(j.end??''),onChangeText:e=>u('end',''===e?void 0:Number(e)),keyboardType:"decimal-pad"})})]})]}):null,(0,f.jsx)(i.T,{children:y?m.preview(j,{rid:'',today:t,go:()=>{}}):'Fill in the missing details above.'}),c?(0,f.jsx)(i.Muted,{children:"This Assistant does not send, pay or delete. Confirm only shows what would happen."}):(0,f.jsx)(i.Muted,{children:"Nothing happens until you tap Confirm."}),(0,f.jsxs)(i.Row,{gap:8,children:[(0,f.jsx)(i.Button,{kind:c?'danger':'success',label:c?'Confirm (nothing is sent)':'Confirm',testID:"assistant-confirm-yes",disabled:!y,onPress:n,style:{flex:1}}),(0,f.jsx)(i.Button,{kind:"ghost",label:"Cancel",onPress:a,style:{flex:1}})]})]})}},1510,[812,1031,779,17,385,85,777,876,1458,1511,1512,1513,804,1055,8]); -__d(function(g,r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"HELP_TOPICS",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"HELP",{enumerable:!0,get:function(){return a}}),Object.defineProperty(e,"helpById",{enumerable:!0,get:function(){return o}});const t=['Bookings','Walk-ins','Table plan','Rota','Hours & pay','Tips','Team','Suppliers','Stock','Recipe cards','Displays','Settings','Accounts'],a=[{id:'new-booking',kind:'guide',topic:'Bookings',title:'Take a phone booking',keywords:['booking','reservation','book','table','phone','covers','reserve'],body:'Add a booking for a guest who calls or walks up to ask. The app only offers times that are really free.',steps:['Open Bookings (or tap New booking on Today).','Pick the date, time and number of covers.','Add the guest\u2019s name and phone, plus any allergies or notes.','Tap Save. The booking appears on the timeline and the floor plan.'],showMe:{tab:'bookings',target:{testID:'add-booking'},hint:'Tap New booking to start a booking.'}},{id:'move-booking',kind:'faq',topic:'Bookings',title:'How do I move a booking to another table or time?',keywords:['move','change','reschedule','table','booking','swap'],body:'Open the booking from Bookings or the timeline and tap Edit, or drag it to another table on the Display. Guests are not messaged unless you choose to.',showMe:{tab:'bookings',target:{testID:'add-booking'},hint:'Your bookings list is here. Tap a booking to change it.'}},{id:'walk-in',kind:'guide',topic:'Walk-ins',title:'Seat a walk-in',keywords:['walk-in','walkin','walk in','seat','no booking','covers','party'],body:'Record guests who arrive without a booking so the floor plan and covers stay right.',steps:['On the Display (the venue tablet), tap Walk-in. On a phone, say \u201cadd a walk-in for 2\u201d to the Assistant.','Choose the number of covers.','Pick a free table (the best fit is suggested).','Tap Seat. The table shows as seated.'],actions:['add_walkin']},{id:'table-plan',kind:'guide',topic:'Table plan',title:'Edit the table plan',keywords:['table plan','floor plan','layout','tables','move tables','designer','areas','seats'],body:'Drag tables into place, set seats, join tables and add areas such as Terrace or Garden.',steps:['Go to More \u203a Table plan.','Tap Open the designer.','Drag tables, or tap one to change its name and seats.','Tap Save. Displays and bookings use the new plan straight away.'],showMe:{tab:'more',page:'tableplan',target:{testID:'open-designer'},hint:'Open the designer to move tables.'}},{id:'rota',kind:'guide',topic:'Rota',title:'Build and publish the rota',keywords:['rota','shift','schedule','week','publish','staff hours','add shift'],body:'Plan the week, then publish it so staff see their shifts in the Staff app.',steps:['Go to More \u203a Rota.','Tap a person\u2019s day to add a shift (presets: lunch, dinner, double).','New shifts are drafts with a dashed amber border.','Tap Publish when the week is ready. Staff see only published shifts.'],showMe:{tab:'more',page:'rota',target:{testID:'rota-publish'},hint:'Tap a day to add a shift, then Publish here.'},actions:['add_rota_shift','publish_rota']},{id:'rota-copy',kind:'faq',topic:'Rota',title:'Can I copy last week\u2019s rota?',keywords:['copy','last week','repeat','rota','duplicate'],body:'Yes. On the Rota tap Copy last week. The shifts come over as drafts so you can tweak them before publishing.',showMe:{tab:'more',page:'rota',target:{testID:'rota-copy'},hint:'Copy last week\u2019s shifts as drafts.'}},{id:'sign-off',kind:'guide',topic:'Hours & pay',title:'Sign off hours',keywords:['sign off','signoff','confirm hours','approve','timesheet','clock','pending'],body:'Only confirmed hours count for pay and tips. Check clocked times against the rota and confirm them.',steps:['Go to More \u203a Sign off hours.','Flagged days (late, missing clock-out, long breaks) are at the top.','Tap a row to fix a time; give a short reason.','Tap Confirm all unflagged, then deal with the rest.'],showMe:{tab:'more',page:'signoff',target:{testID:'confirm-unflagged'},hint:'Confirm all the days that look right in one tap.'}},{id:'payroll-hours',kind:'guide',topic:'Hours & pay',title:'Export hours for payroll',keywords:['payroll','export','hours','spreadsheet','csv','excel','accountant','copy','print'],body:'Get each person\u2019s confirmed hours for a pay period into your spreadsheet or to your accountant.',steps:['Go to More \u203a Payroll hours.','Pick the pay period (or a tips fortnight, or a custom range).','Check the pending banner: sign those off first if you can.','Tap Copy for spreadsheet and paste into Excel or Google Sheets, or download a CSV, or print.'],showMe:{tab:'more',page:'hours',target:{testID:'copy-tsv'},hint:'Copy, then paste straight into your spreadsheet.'}},{id:'pay-dates',kind:'faq',topic:'Hours & pay',title:'How do I set our pay dates?',keywords:['pay day','payday','pay dates','cut-off','wages','monthly','fortnightly'],body:'Settings \u203a Pay & tips: set when tips are paid and how often, the wage pay day and the cut-off. Payroll hours and Tips day use these dates.',showMe:{tab:'more',page:'paysettings',target:{testID:'save-pay'},hint:'Change the dates above, then Save.'}},{id:'tips-day',kind:'guide',topic:'Tips',title:'Share out tips on tips day',keywords:['tips','tronc','gratuity','share','split','tips day','service charge'],body:'Enter the tips total and it\u2019s shared by confirmed hours for the fortnight, to the penny.',steps:['Go to More \u203a Tips day (the right fortnight is picked for you).','Type the total tips.','Check anyone with pending hours; sign them off first if you can.','Copy or download the split for payroll.'],showMe:{tab:'more',page:'tipsday',target:{testID:'tips-total'},hint:'Type the tips total here.'}},{id:'invites',kind:'guide',topic:'Team',title:'Invite staff to the app',keywords:['invite','link','staff app','new starter','sign in','add staff','team member'],body:'Each person gets their own sign-in link. You choose when and how to share it.',steps:['Go to Settings \u203a Invite links.','Tap Make invite link next to the person.','Share the link yourself (text or WhatsApp). The app never sends it for you.','They tap it once and the Staff app remembers them.'],showMe:{tab:'more',page:'setup-invites',target:{text:'Make invite link'},hint:'Make a personal link, then share it yourself.'}},{id:'suppliers',kind:'guide',topic:'Suppliers',title:'Suppliers and order sheets',keywords:['supplier','order','order sheet','delivery','cut-off','fish','veg','dairy'],body:'Keep supplier contacts, order days and cut-offs together, and log what you ordered.',steps:['Go to More \u203a Suppliers to add or edit a supplier.','Use Supplier order sheets for the items you usually order.','Tap Log an order after you place it by phone or email.'],showMe:{tab:'more',page:'ordersheets',target:{testID:'sheet-add'},hint:'Add an order sheet for a supplier.'}},{id:'display-glance',kind:'guide',topic:'Display',title:'Today at a glance (Display)',keywords:['glance','today','covers by hour','breaks','on now','next','cut-off','cutoff','order times','display bar'],body:'The bar under the Display header shows today in one line: covers by hour (booked in solid gold, the walk-in estimate dashed), quiet times for breaks, who is on now and next, today\u2019s supplier order cut-offs with a countdown (amber under 30 minutes) and one tip. Cut-offs come from Scheduled notifications.'},{id:'sold-out',kind:'guide',topic:'Menu',title:'Sold out dishes',keywords:['sold out','run out','ran out','none left','back on','86','eighty six','display strip'],body:'When a dish runs out, mark it sold out so every member of staff knows. It\u2019s a reminder for staff: CoverCharge doesn\u2019t link up to your till, so it doesn\u2019t change the till. Sold out dishes show in a slim strip along the bottom of the Display within seconds, and in the Sold out list in Front of House, Managers and Head Chef. They clear by themselves when the kitchen closes (or the next morning, or only when you tap Back on: Settings \u203a Advanced \u203a Sold out reminders).',steps:['Open the Sold out list (Managers: More \u203a Sold out; Front of House: Me \u203a Sold out; Head Chef: Kitchen \u203a Live tickets \u203a Sold out).','Tap Mark sold out next to the dish.','When it\u2019s back, tap Back on.'],showMe:{tab:'more',page:'soldout',target:{testID:'soldout-search'},hint:'Find the dish, then tap Mark sold out.'}},{id:'shellfish',kind:'guide',topic:'Stock',title:'Live shellfish (and other) counts',keywords:['shellfish','lobster','crab','oysters','count','stock','tracked','sold out','86'],body:'Counters for things you sell by the unit, like lobster or crab. They show on the Display and warn when low.',steps:['Go to Settings \u203a Tracked stock.','Tap Add an item to track; set the name, icon and low warning.','Staff update the count from the small lobster and crab chip at the top of the Display, or in the app.'],showMe:{tab:'more',page:'trackedstock',target:{text:'Add an item to track'},hint:'Add something to count, like lobster.'}},{id:'recipe-cards',kind:'guide',topic:'Recipe cards',title:'Recipe cards',keywords:['recipe','card','dish','ingredients','method','allergens','spec'],body:'Photo, ingredients, method and allergens for each dish; the head chef signs them off and staff can read them.',steps:['Go to More \u203a Recipe cards.','Search for a dish or add a new one.','Fill in ingredients (allergens are suggested) and the method.','Send for head chef sign-off.'],showMe:{tab:'more',page:'recipecards',target:{testID:'card-search'},hint:'Search your recipe cards here.'}},{id:'display-pair',kind:'guide',topic:'Displays',title:'Pair a display or tablet',keywords:['display','tablet','pair','screen','code','front of house','kitchen screen'],body:'Connect a tablet to your venue with a one-time code. You can switch any display off from here.',steps:['Open the Display app on the tablet.','In Managers go to Settings \u203a Displays and tap Make a pairing code.','Type the code on the tablet. It joins your venue straight away.'],showMe:{tab:'more',page:'displays',target:{text:'Make a pairing code'},hint:'Make a one-time code for the tablet.'}},{id:'settings-hours',kind:'faq',topic:'Settings',title:'How do I change our opening hours?',keywords:['opening hours','hours','closed','open','kitchen hours','times'],body:'Settings \u203a Opening hours. Guests see these on your booking and order pages; bookings outside them are turned away.',showMe:{tab:'more',page:'setup-hours',hint:'Set each day\u2019s opening and closing time here.'}},{id:'replay-setup',kind:'faq',topic:'Settings',title:'Can I see the welcome walkthrough again?',keywords:['welcome','setup','walkthrough','onboarding','checklist','questionnaire'],body:'Yes: Settings \u203a Setup checklist \u203a Replay welcome. Everything is pre-filled from your questionnaire.',showMe:{tab:'more',page:'setupchecklist',target:{testID:'replay-welcome'},hint:'Replay the welcome walkthrough.'}},{id:'connected-accounts',kind:'guide',topic:'Accounts',title:'Connect your email, website and socials',keywords:['connect','account','gmail','outlook','wix','facebook','instagram','square','xero','quickbooks','login'],body:'Settings \u203a Connected accounts: tap a logo, save the account to your list, and use Connect with\u2026 to sign in on that service\u2019s own page (rolling out service by service; it shows Coming soon until then). CoverCharge never sees your password that way, and you can remove an account any time.',steps:['Go to Settings \u203a Connected accounts.','Tap the service\u2019s logo.','Tap Connect with\u2026 and sign in on their page.','To stop, tap Remove.'],showMe:{tab:'more',page:'connections',target:{testID:'conn-tile-gmail'},hint:'Tap a logo to connect that account.'}},{id:'supplier-portals',kind:'guide',topic:'Suppliers',title:'Order from your suppliers',keywords:['bidfood','booker','wholesale','cash and carry','order online','supplier login','account number','customer number'],body:'Settings \u203a Connected accounts \u203a Suppliers. Add supplier links for this venue, with an account number if you like. Open ordering and Log in open the supplier\u2019s own website, where you sign in; CoverCharge never keeps the password.',steps:['Go to Settings \u203a Connected accounts.','Scroll to Suppliers.','Tap Add against a supplier (account number optional).','Tap Open ordering or Log in whenever you need them.','To stop, tap Remove and confirm.'],showMe:{tab:'more',page:'connections',target:{testID:'portal-bidfood'},hint:'Your supplier ordering websites live here.'}},{id:'support',kind:'faq',topic:'Settings',title:'How do I get help from a person?',keywords:['support','help','contact','person','problem','broken','stuck'],body:'Support is free for life. Message the CoverCharge team from Settings \u203a Help, or email us, and we\u2019ll reply. We help by message and email.'},{id:'assistant-safe',kind:'faq',topic:'Settings',title:'Can the Assistant send or pay for things by itself?',keywords:['assistant','safe','confirm','send','pay','delete','ai'],body:'No. The Assistant and the voice helper show you exactly what they will do and wait for you to tap Confirm (or say yes). Anything that would send a message, order from a supplier or pay is only saved as a draft in Drafts for approval; nothing goes out by itself.'},{id:'restaurant-dashboard',kind:'guide',topic:'Bookings',title:'Restaurant dashboard',keywords:['restaurant dashboard','tables','timeline','guests','covers','joined tables'],body:'In Managers, tap Restaurant dashboard on Home, or More > Run the day > Restaurant dashboard. It is the same live table plan, Timeline, guest list, deposits, dogs, joined tables, Covers, covers-through-the-day chart and block bookings as the Display. Use the day arrows and Back to today. Assign or join tables on any day; seat, finish, no-show and cancel walk-in actions apply today. You can also say \u201copen Restaurant dashboard\u201d. The helper replies in text only.',showMe:{tab:'more',page:'serviceboard',target:{testID:'restaurant-dashboard-close'},hint:'Restaurant dashboard is open. Pick a day, or tap Back to Managers to close.'}},{id:'voice-helper',kind:'guide',topic:'Settings',title:'Use the hold-to-talk voice button',keywords:['voice','talk','speak','microphone','mic','hold','walkie','button','hands free','gloves'],body:'Hold the big gold button, say what you need, then let go. It logs fridge and freezer temperatures, answers allergen questions, marks dishes sold out, checks tables, adds to the waitlist, reads orders and covers, and drafts bookings, offers, events and supplier lists. The helper replies in text only, never aloud. Changes are shown in text first with Confirm and Cancel buttons: tap Confirm or say yes. Tap the button to type instead (in Managers this also opens the Assistant). It sits at the top right of the header in Managers, Head Chef, the Staff app (the full voice assistant, with no money, tips or HR) and on the Display (no money, tips or HR). Until the voice assistant\u2019s server is switched on, anything new says \u201cVoice assistant is switching on soon\u201d. Fair usage: 1,000 voice tasks a month per venue.',steps:['Hold the gold microphone button (the first time, allow the microphone).','Speak, for example \u201cprep fridge 3 degrees\u201d.','Let go to send.','If it reads something back, tap Confirm or hold again and say \u201cyes\u201d.','The button stays at the top right so it never covers the screen.'],showMe:{tab:'more',page:'voice',hint:'Turn the voice button on or off for each role here.'}},{id:'voice-drafts',kind:'faq',topic:'Settings',title:'Where do voice bookings and shopping lists go?',keywords:['drafts','approve','approval','shopping list','booker list','bidfood list','draft booking','offer','event'],body:'To Settings \u203a Drafts for approval. Bookings, supplier lists, offers, events and specials made by voice wait there for an owner or manager. Approving marks it approved and opens the right screen; you still place the order or confirm the booking yourself.',showMe:{tab:'more',page:'drafts',hint:'Drafts from the voice helper wait here.'}},{id:'voice-temps',kind:'guide',topic:'Settings',title:'Log fridge and freezer temperatures by voice',keywords:['temperature','fridge','freezer','haccp','food safety','eho','log temps','probe'],body:'Hold the voice button and say the unit and the number, for example \u201cprep fridge 3, freezer minus 19\u201d. Fridges should be 5\xb0C or colder and freezers -18\xb0C or colder; anything outside is flagged. Everything is in the Food safety log with who and when, ready to export or print for the EHO.',showMe:{tab:'more',page:'haccp',hint:'Every voice reading appears in the food safety log.'}},{id:'voice-fair-usage',kind:'faq',topic:'Settings',title:'Is there a limit on voice tasks?',keywords:['voice','limit','allowance','fair usage','fair use','how many','tasks','month','plan'],body:'Fair usage: 1,000 voice tasks a month per venue. It is one allowance shared by all of the venue\u2019s apps and devices, and it resets on the 1st. Each request counts once, spoken or typed; saying \u201cyes\u201d to confirm does not count again. You will see a note at 80%. If the venue reaches 1,000, the voice helper pauses until the 1st, except food safety and temperature logging, which always works. The owner can contact CoverCharge if you need more. See the count in Plan & billing or Settings \u203a Voice helper.',showMe:{tab:'more',page:'voice',hint:'This month\u2019s voice task count is shown here.'}},{id:'adv-bookings',kind:'guide',topic:'Settings',title:'Booking questions: allergies, dogs, access, vegan',keywords:['advanced','allergen','dog','dogs','cap','wheelchair','access','vegan','vegetarian','table request','settings'],body:'Choose what guests are asked when they book. Allergies are always asked first, in red, and staff tick \u201cAllergens seen\u201d. The others can be switched off.',steps:['Open More \u203a Settings \u203a Advanced.','In Bookings, tick or untick each question.','Use the dog stepper to cap dogs per booking time (No limit = only the dog-friendly tables).','Mark dog-friendly and step-free tables on the Table plan.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-bookings'},hint:'Booking questions are here.'}},{id:'adv-table-times',kind:'guide',topic:'Settings',title:'How long tables stay (table times)',keywords:['advanced','dwell','table time','turn','how long','next table free','minutes'],body:'Usual table times by party size: 90 min for 1\u20132 covers, 105 for 3\u20135, 2 hours for 6\u201319 and 3 hours for 20 or more. The app fine-tunes them from how long your tables really stay, and uses them for \u201cNext table free\u201d.',steps:['Open More \u203a Settings \u203a Advanced \u203a Table times.','Tap \u2212 or + to change a band by 5 minutes.','Untick \u201cFine-tune\u201d to use your numbers exactly.','Reset to default puts the four bands back.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-times'},hint:'Table times are here.'}},{id:'adv-reservable',kind:'guide',topic:'Settings',title:'Seafood platter, crab and lobster reservations',keywords:['advanced','platter','seafood','crab','lobster','reserve','price'],body:'Guests can reserve the Seafood Platter (1 crab + 1 lobster, \xa3160) or a crab or lobster with their booking. Reserved ones come off the Display count with a \u201cReserved\u201d line, the kitchen is told, and the Head Chef taps OK.',steps:['Open More \u203a Settings \u203a Advanced \u203a Reservable items.','Tick what guests can reserve and set the price.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-reserve'},hint:'Reservable items are here.'}},{id:'adv-events',kind:'guide',topic:'Settings',title:'Regular events like Open Mic Night',keywords:['advanced','open mic night','music night','event','regular','monthly','promote','busier','last food'],body:'Add events that repeat, e.g. Open Mic Night on the last Sunday of every month from 8pm with last food orders at 7pm. They show in Forecast key dates with a Promote button and on Today, and \u201cExpect busier\u201d raises the forecast.',steps:['Open More \u203a Settings \u203a Advanced \u203a Regular events.','Tap Add a regular event (or Edit).','Pick how it repeats and the day, add a start time and last food orders if needed.','Tap Save event.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-events'},hint:'Regular events are here.'}},{id:'adv-hours',kind:'guide',topic:'Settings',title:'Kitchen hours, seasons and special days',keywords:['advanced','hours','kitchen','season','winter','summer','special day','closed','last food orders','cutoff'],body:'Kitchen (food) hours decide which booking times are offered; the closing time is last food orders. Keep Winter and Summer hours, each with the date it starts every year, and the app switches by itself. Add special days for one-off changes.',steps:['Open More \u203a Settings \u203a Advanced \u203a Kitchen hours.','Tap Set Summer hours, fill in each day and the start date (e.g. 04-01 for 1 April).','Set the Winter start date too.','Use Add a special day for closures or late nights.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-hours'},hint:'Kitchen hours and seasons are here.'}},{id:'adv-home',kind:'faq',topic:'Settings',title:'Covers counter, Next table free and takeaway on home screens',keywords:['advanced','covers counter','takeaway','next table free','home','display','flip'],body:'Turn the COVERS counter and the \u201cNext table free\u201d card on or off, and choose whether takeaway figures show on home screens (off at the Anchorage). Takeaway order alerts always work. The flap click sound is set on each Display.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-home'},hint:'Display and home options are here.'}},{id:'adv-holidays',kind:'faq',topic:'Settings',title:'Why don\u2019t bank holidays say \u201c(substitute day)\u201d?',keywords:['advanced','holiday','substitute','bank holiday'],body:'The date already shows when a holiday moves, so the extra words are hidden. Tick \u201cShow full gov.uk names\u201d in Settings \u203a Advanced \u203a Holiday names to bring them back.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-holidays'},hint:'Holiday names are here.'}},{id:'adv-blocks',kind:'guide',topic:'Settings',title:'Lunch and dinner times for Block now',keywords:['block','lunch','dinner','service','wix','advanced','pause'],body:'Settings \u203a Advanced \u203a Block bookings sets when Lunch and Dinner run, for the Block now buttons and Spend per head. At The Anchorage, blocks also close those times on website bookings, and blocks made on the website show in CoverCharge. Website bookings can only close the whole venue, not one area or some tables.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-blocks'},hint:'Block bookings settings are here.'}},{id:'blocks-screen',kind:'guide',topic:'Bookings',title:'Block bookings: today, a future date, an area or some tables',keywords:['block','blocks','pause','close','closed','stop bookings','private','repeat','future'],body:'Tap Block bookings on the home screen. Block now pauses bookings today (Rest of today, Next hour, Lunch, Dinner, or a From\u2013To). Add a block closes a future date or range, the whole day or set times, the whole venue, one area or some tables, once or every week or on the last weekday of the month. Every future block is listed by month with Edit and Remove; removing asks first and is logged. Bookings already made are kept, and you are told how many.',showMe:{tab:'more',page:'blocks',target:{testID:'blocks-screen'},hint:'Block bookings is here.'}},{id:'spend-per-head',kind:'guide',topic:'Money',title:'Spend per head',keywords:['spend per head','sph','average spend','takings','covers','gross'],body:'Spend per head is Gross takings \xf7 Covers, by day, by week and for lunch and dinner. Enter the gross on the cash up (Enter the cash up, Upload a spreadsheet, or Enter takings). Covers are seated and finished bookings and walk-ins; no-shows and cancellations are left out. A day with no takings shows \u201cNo takings entered\u201d, never \xa30.',showMe:{tab:'more',page:'spendhead',target:{testID:'sph-screen'},hint:'Spend per head is here.'}},{id:'cashup-photo',kind:'guide',topic:'Money',title:'Enter the cash up, or upload a spreadsheet',keywords:['cash up','paid out','spreadsheet','csv','excel','xlsx','sheet','gross','card','cash','tips','takings','drawer'],body:'In Cash up & sales tap Enter the cash up and type the figures (Z total, card, cash, paid outs, tips, and gross if you have it). In Paid out, add a line for each amount taken from the till \u2014 for example lobsters or supermarket shopping \u2014 with the amount, an optional note, and your name. The paid-out total comes off the expected cash in the drawer. Check every figure, then tap Confirm and save. Bigger venues can tap Upload a spreadsheet (CSV or Excel): match the columns, check the preview (dates already saved are flagged), then confirm. Nothing is saved before you confirm, and every save is logged. You can export cash ups as a spreadsheet from Recent cash ups.',showMe:{tab:'more',page:'cashup',target:{testID:'cashup-by-hand'},hint:'Start the cash up here.'}},{id:'adv-giftqr',kind:'guide',topic:'Settings',title:'Buy a gift card on the Display',keywords:['gift','gift card','voucher','qr','display','wix','advanced'],body:'Switch on \u201cShow Buy a gift card on the Display\u201d in Settings \u203a Advanced \u203a Gift cards on the Display, and save your gift card page address. The Display has a Gift vouchers button: it opens the list of website vouchers (search, use by dates, Mark as used), with Show the buy QR code at the bottom. Guests buy on your website.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-giftqr'},hint:'Gift cards on the Display are here.'}},{id:'adv-whatsapp',kind:'guide',topic:'Settings',title:'WhatsApp buttons (tap to chat)',keywords:['whatsapp','wa.me','message','chat','guest','mobile','number','advanced'],body:'Put the venue\u2019s WhatsApp number in Settings \u203a Advanced \u203a WhatsApp, e.g. 01292 500123 or +44 7700 900123. Guests then see \u201cMessage us on WhatsApp\u201d on their booking confirmation, with their booking details typed in. Staff and managers see \u201cWhatsApp guest\u201d on bookings with a mobile number, with a confirmation typed in that you can change. Nothing is ever sent for you: WhatsApp opens and you tap Send yourself. Leave the number blank and every WhatsApp button stays hidden. Reset to default clears the number.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-whatsapp'},hint:'The WhatsApp number is here.'}},{id:'adv-reminders',kind:'guide',topic:'Settings',title:'Staff reminders: breaks and \u201cchairs up\u201d',keywords:['reminder','reminders','break','breaks','chairs','closing','6 hours','law','snooze','later','done','advanced'],body:'Reminders slide up for staff who are on shift right now (clocked in, or on the rota at that time) in the Staff and Head Chef apps, while the app is open. Break reminders: if the rota shift has a break time, the reminder comes at that time; if not, it comes 4 hours after they clock in (or after the shift starts). If they still haven\u2019t started a break it comes once more 30 minutes later, and again at 6 hours, because UK law says a shift over 6 hours needs a 20-minute break. \u201cStart break\u201d starts their break; \u201cLater\u201d hides it for 15 minutes. You can change these times. Venue reminders, such as \u201cTime to put the chairs up on the tables\u201d (Friday and Sunday, 21:00), have wording, days, a time (UK) and who sees them: everyone on shift, front of house or kitchen. Pause, edit or delete any of them, or add your own. Once anyone taps Done it goes for everyone that day, and the Reminders screen shows who did it. Reset to default brings back the standard break times and \u201cchairs up\u201d; your own reminders stay. Phones with the app closed don\u2019t get reminders yet.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-reminders'},hint:'Reminders are here.'}},{id:'adv-notifications',kind:'guide',topic:'Settings',title:'Scheduled notifications (e.g. the Mills milk order)',keywords:['notification','notifications','push','phone','milk','mills','pieroni','pieronis','veg','olsen','rota upload','scheduled','advanced'],body:'Settings \u203a Advanced \u203a Notifications lists reminders that go to named people at a set UK time, such as \u201cMills milk order\u201d for the Head Chef and Gordon. Each has a title, a message, the days, a time (you can set a different time on some days, e.g. 20:55 on Fridays), who gets it (tick people or pick a group like Everyone on shift) and how it is sent. In the app it is the gold slider with Done and Later; Done is logged with the name and time, and Later hides it for 15 minutes. Urgent notices (like the 6-hour break) always come first and only one shows at a time. Phone notifications: each person taps \u201cTurn on phone notifications\u201d on their own phone (iPhone: add the app to the Home Screen first, iOS 16.4 or later). Nothing goes to phones until an owner or manager switches \u201cSend to phones\u201d on. The Display never gets these. Reset to default restores the configured rules.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-notifications'},hint:'Notifications are here.'}},{id:'adv-order-lists',kind:'guide',topic:'Settings',title:'Order lists (Alsons, Cash and carry)',keywords:['order list','orders','alsons','drinks','cash and carry','trip','shopping','logo','carry over','advanced'],body:'Order lists collect what you need from a supplier. A running list (Alsons drinks) fills up until you order; a trip list (Cash and carry) is for a shopping day, Friday by default, which you can change for each trip. Add an item with a quantity and unit and an optional note; the app records who added it and when. Adding something already on the list offers to add to the quantity instead. On the day, tick Got or Ordered, or mark Missing / not in stock. Finish order saves it to History (date and who) and asks whether to carry over anything not got. Removing an item can be undone. Settings \u203a Advanced \u203a Order lists: add, rename or archive lists, the default trip day, and \u201cLet all staff add items\u201d (on: staff can add and see lists; only managers and the Head Chef tick, remove or finish). Each list can have a logo (take a photo or choose one) or shows its initials, and a phone number to tap to call (never called for you).',showMe:{tab:'more',page:'advanced',target:{testID:'adv-orderlists'},hint:'Order list settings are here.'}},{id:'adv-clock-area',kind:'guide',topic:'Settings',title:'Clock-in area, forgotten breaks and off-rota arrivals',keywords:['clock','clock in','geofence','location','area','radius','break','forgot','rota','visiting','override','advanced'],body:'Clock in, clock out, start break and end break only work at the venue once the centre is set. Stand in the middle of the venue and tap \u201cUse my current location\u201d, then choose how far (at least 50 m, 100 m to start). Phones are not exact, so up to 50 m of the phone\u2019s own accuracy is allowed on top. Each clock record keeps the reading, its accuracy and whether it was inside. If location is off or blocked, the app says how to allow it. Managers can record it for someone from Clock in / out \u203a Record it for someone, with a reason that is logged. Until the centre is set nobody is blocked and managers see a warning. Rota and pay screens are never blocked. Forgotten breaks: if no break was recorded, Clock out asks \u201cDid you take a break? If so, how long?\u201d; a length you pick is saved as a break marked \u201cadded at clock-out\u201d, which managers see and can edit in Hours. Not on the rota: if someone is at the venue, not clocked in and not on the rota, the Staff and Head Chef apps ask \u201cDo you want to sign in?\u201d. Yes clocks them in, marked off-rota, and managers get a notice; \u201cNo, just visiting\u201d stops asking for the day. This only checks while the app is open; web apps can\u2019t watch location in the background.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-clockarea'},hint:'Clock-in area settings are here.'}},{id:'adv-tablegrid',kind:'guide',topic:'Table plan',title:'Table plan grid and Tidy up (Advanced)',keywords:['grid','snap','line up','align','tidy','guides','spacing','restore','table plan','option','alt'],body:'Tables snap to the grid when you drag them, and gold guides show when an edge or centre lines up with another table. A small number shows when the gaps either side are even. Hold Alt (Option on a Mac) to move freely. Tidy up lines every table up on the grid and evens out the rows; only positions change. The old positions are kept, so one tap puts them back.',steps:['Go to Settings \u203a Advanced.','Find Table plan grid.','Turn snapping on or off, pick a grid size, or tap Tidy up the whole plan.','Changed your mind? Tap Put the tables back where they were.']},{id:'adv-printers',kind:'guide',topic:'Orders',title:'Kitchen ticket printers (Advanced)',keywords:['print','printer','printing','ticket','kitchen ticket','docket','receipt','epson','star','bluetooth','reprint','takeaway'],body:'Print a kitchen ticket by itself for every takeaway order, as soon as it comes in or when it is accepted. The ticket has the order number, collection time, name, every dish with its options and notes, allergies in white-on-black, and paid or not paid. Works with Epson (TM-m30, TM-T20, TM-T88), Star WebPRNT, most other network receipt printers (port 9100) and Bluetooth printers from the tablet app. If a ticket does not print, an amber warning shows and the order stays on screen.',steps:['Go to Settings \u203a Advanced.','Find Printers.','Tap Add a printer by IP address or Find printers on this Wi-Fi, choose the type and tap Test print.','Turn on Print a kitchen ticket for every takeaway order.']},{id:'adv-deposits',kind:'guide',topic:'Bookings',title:'Deposits (Advanced)',keywords:['deposit','deposits','per person','per adult','children','waive','waived','regular','party size','refund','refundable','cut off','policy','paid','due'],body:'Ask bigger tables for a deposit: set the amount per adult (children never pay: a table of 8 with 3 children pays for 5), the smallest party that pays one, whether it is refundable and up to how many hours before, and the words guests see. No card is saved in CoverCharge. Deposits are paid through website bookings: website bookings show Deposit paid on website bookings, Part paid on website bookings or Deposit not paid by themselves. For phone and walk-in bookings, staff tick Deposit paid once the guest has paid you, or (once switched on) press Send deposit link to send a website bookings pay link by text, WhatsApp or email. Refunds are done in Website bookings \u203a Orders. Deposit amounts are shown on bookings in Managers, Display and Staff. Other financial and HR information remains restricted.',steps:['Go to Settings \u203a Advanced.','Find Deposits.','Turn deposits on or off, and set the amount, party size, refund terms and the words guests see.','On a booking, tap Mark deposit paid once the guest has paid.','To let a regular off, tap Waive deposit on the booking (or in Edit booking), add why if you like, and tap Yes, waive it. Your name is saved with it.']},{id:'adv-loyalty',kind:'guide',topic:'Guests',title:'Loyalty: stamp card, offers & bring a friend (Advanced)',keywords:['loyalty','stamp','stamps','card','reward','offer','offers','referral','friend','expiry'],body:'The stamp card, offers and bring-a-friend are saved on the server, so every phone and tablet shows the same card. Set how many stamps earn a reward, what the reward is, when stamps or rewards run out, and how often one guest can get a stamp. Stamps only come from staff, or from a code or QR staff make, and each reward can be used once. Guests join with their agreement recorded, and a manager can remove a guest and their details.',steps:['Go to Settings \u203a Advanced.','Find Loyalty.','Turn the stamp card on, write the reward and tap Save loyalty settings.','Add offers with their dates, and turn bring-a-friend on if you want it.']},{id:'adv-table-order',kind:'guide',topic:'Guests',title:'Order at the table (Advanced)',keywords:['order at table','qr','qr code','scan','table','phone','accept','last orders','print','pdf','pay at bar'],body:'Guests scan the small QR card on their table (Managers \u203a Table QR codes prints them, 20 to a page), see your menu with allergens, and send an order. It lands in Front of House and on the kitchen screen within seconds. Prices, sold-out dishes and hours are checked on the server, so a phone can\u2019t change them. Staff accept the first order from each new phone (you can turn this off). Guests pay at the bar or with their server; paying by card from the phone is coming later.',steps:['Go to Settings \u203a Advanced.','Find Order at the table.','Turn it on, pick the areas or tables, set the hours and tap Save order at the table.','Tap Make codes, pick Stickers 50 \xd7 50 mm or Stand cards 50 \xd7 70 mm, then Print all QR cards (PDF) and put each code on its table.']},{id:'adv-soldout',kind:'guide',topic:'Menu',title:'Sold out reminders (Advanced)',keywords:['sold out','86','clear','end of service','next morning','back on','advanced','display strip','automatic','counts','lobster','crab'],body:'Choose when sold out dishes go back on by themselves: when the kitchen closes (from your Kitchen hours), the next morning (pick the time), or only when someone taps Back on. \u201cMark dishes sold out from the counts\u201d (on unless you turn it off) marks every dish that uses a counted item, like lobster or crab, when the count runs out, and puts it back on when the count is back up. Sold out is a reminder for staff on the Display and in the staff apps; it doesn\u2019t change your till.',steps:['Go to Settings \u203a Advanced.','Find Sold out reminders.','Pick when they clear, and turn marking from the counts on or off.']},{id:'sold-out-auto',kind:'guide',topic:'Menu',title:'Sold out from the counts (lobster, crab\u2026)',keywords:['sold out','automatic','auto','counts','shellfish','lobster','crab','platter','link','uses','none left'],body:'When a counted item runs out, or drops below what a dish needs, every dish that uses it is marked sold out by itself, with the reason: \u201cDeluxe Seafood Platter (no lobster or crab)\u201d. When the count is back up (a delivery or a recount), those dishes go back on by themselves. Dishes marked by hand are left alone. CoverCharge works out what each dish uses from its recipe card, its description (\u201cone whole lobster\u201d) or its name; you can change it for any dish. If you tap Back on while the count is still short, the dish stays on until the count changes.',steps:['Open the Sold out list.','Under Dishes linked to the counts, tap Change next to a dish.','Set how many of each item one portion uses (0 = not linked), then tap Save. Back to automatic undoes it.'],showMe:{tab:'more',page:'soldout',target:{testID:'soldout-links'},hint:'Tap Change next to a dish to set what it uses.'}},{id:'adv-forecast',kind:'guide',topic:'Forecasts',title:'Forecast history and "Not enough history yet"',keywords:['forecast','not enough history','history','estimate','example figures','labour','sales','walk-ins','advanced'],body:'Forecasts are built only from your own bookings, seated walk-ins, takeaway orders and cash-ups. Until CoverCharge has enough of your history (2 weeks to start with; change it in Settings \u203a Advanced \u203a Forecast history) you see \u2018Not enough history yet\u2019, what is already booked and your real labour cost from the rota, with no sales forecast or labour %. No history is invented for a live venue.',steps:['Go to Settings \u203a Advanced.','Find Forecast history.','Pick how many weeks are needed.']},{id:'adv-checkout',kind:'guide',topic:'Team',title:'Shift check-out, question board and team morale',keywords:['check out','checkout','morale','mood','staffing','overstaffed','survey','anonymous','question board','vote','shout out','wellbeing','advanced'],body:'When someone clocks out, they get a quick card: team morale from Low to High, and whether there was enough staff for the customers. They can also post a question for the board or shout out a teammate, or tap Skip. Nothing shows at clock in. Answers are anonymous: no name or staff number is saved, and each phone can answer a shift once. Team morale (Managers app \u203a More \u203a Team morale) shows a day only once 3 or more people have answered, next to that day\u2019s covers. Change the wording or switch parts off here.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-checkout'},hint:'Check-out and board settings are here.'}},{id:'hr-board',kind:'guide',topic:'Team',title:'The anonymous question board',keywords:['question board','board','anonymous','vote','yes no','reply','hide','moderation','log'],body:'Anyone on the team can post a question and vote it up, or vote Yes or No. No names are shown or saved. Owners and managers can reply (shown as \u201cReply from the managers\u201d) and hide offensive posts with a reason. Every hide, unhide and reply is in the Moderation log.',showMe:{tab:'more',page:'board',hint:'The question board.'}},{id:'adv-tasks',kind:'guide',topic:'Team',title:'Daily tasks',keywords:['tasks','daily tasks','checklist','duties','jobs','to do','my tasks','library','head chef'],body:'Give each person a short list of daily tasks: open Staff & roles, tap Daily tasks on their card, then pick from the venue\u2019s task library or type a new one. Use the arrows to reorder, \u2715 to remove (with Undo) and Days to limit a task to certain days. They see \u201cMy tasks today\u201d on their home screen and tick each one off while on shift; each tick records who and when, and you see \u201c2 of 5 done today\u201d on their card. Lists start fresh every day. Owners and managers can change anyone\u2019s list, including the Head Chef\u2019s. The Head Chef can change the lists of kitchen staff (chefs, commis and KPs) from Kitchen \u203a Kitchen team tasks, but not their own and not front of house. The task library is in Settings \u203a Advanced \u203a Tasks.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-tasks'},hint:'The task library is here.'}},{id:'adv-cashup',kind:'guide',topic:'Money',title:'Cash up and weekly sales',keywords:['cash up','cashup','takings','float','till','sales report','weekly sales','pos','printout','photo','graphs','charts'],body:'At the end of the night open Cash up & sales and tap Enter the cash up. Type each figure; boxes left blank stay blank (never counted as zero) and are highlighted in amber. Add any cash paid out of the till (lobsters, supermarket shopping, and the like) in the Paid out section: each line has what it was for, the amount, an optional note and who entered it. The total reduces the expected cash in the drawer. Nothing is saved until you tap Confirm and save. Do the same with the weekly sales report from the till (several pages is fine). The graphs show daily takings, tips, weekly net sales against the week before and sales by category. Owners and managers can enter and change cash ups; the Head Chef can see the graphs if they are allowed to see takings. Change the boxes to match your sheet in Settings \u203a Advanced \u203a Cash up; Cash tips total and Card tips total are always kept.',showMe:{tab:'more',page:'cashup',target:{testID:'cashup-by-hand'},hint:'Start the cash up here.'}},{id:'adv-tips',kind:'guide',topic:'Money',title:'Today\u2019s tips and the Tips pot',keywords:['tips','today tips','tips pot','pot','payout','tip pay','correction','coins'],body:'When a cash up with Cash tips total and Card tips total is confirmed, the team\u2019s combined tips for that day show as Today\u2019s tips in every staff app and on the Display, with a short notice. The Tips pot adds up confirmed daily tips since the last payout (fortnightly tip pay). After paying the tips, an owner or manager taps Mark payout done on the Tips pot card: the pot goes back to \xa30.00 and the old pot is kept in Past pots. Use Correct an entry to add or take off an amount for a day; a reason is required and every correction is logged with your name. Only the team total is ever shown, never anyone\u2019s share. Hide either card in Settings \u203a Advanced \u203a Tips.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-tips'},hint:'Show or hide the tips cards here.'}},{id:'manager-access',kind:'guide',topic:'Team',title:'Manager access',keywords:['manager access','manager','access','role','promote','front of house','head chef','owner'],body:'In Staff & roles each person has a Manager access switch. On: they use the Manager app (rota, bookings, staff, hours, settings, plus their own clock in, rota and pay). Off: they use the Front of House app, or the Head Chef app for the Head Chef. Owners can switch anyone except owners; managers can switch anyone except themselves and owners. The last owner can never be removed. You confirm each change; it is logged with who and when (Access changes). Job titles are free text and don\u2019t change.',showMe:{tab:'more',page:'staff',target:{testID:'access-tip'},hint:'Manager access switches are on each person.'}},{id:'next-table-free',kind:'faq',topic:'Walk-ins',title:'When is the next table free?',keywords:['next table','free','wait','walk-in','quote','full'],body:'When you\u2019re full, Today and the Display show \u201cNext table free about 19:40 (T6, 4 seats)\u201d with \u201clikely\u201d or \u201cmaybe\u201d, and how long a walk-in for 2 or 4 would wait. Tap Bill requested or Table finished on the plan and it updates. You can also ask the Assistant \u201cwhen\u2019s the next table free?\u201d.'},{id:'time-travel',kind:'faq',topic:'Today',title:'Look at another day (time travel)',keywords:['yesterday','tomorrow','next week','past','future','day','time travel'],body:'On Today, tap \u2039 or \u203a beside the date to step a day back or forward. You\u2019ll see that day\u2019s kitchen hours, events, covers (booked, or how it went), platters and each booking\u2019s allergens and needs. It\u2019s read-only and nothing changes live service. Tap Today to come back. The Display goes back to today by itself after 2 minutes. Staff can look 7 days back and 14 days ahead.'},{id:'sign-in-links',kind:'guide',topic:'Team',title:'Personal sign-in links',keywords:['link','invite','sign in','new link','expired','already used','phone','login'],body:'Each personal link works on one phone only and lasts 5 days, so nobody else can sign in as that person. The same phone can open it again, in any of the apps. If someone gets a new phone, or their link has expired, open Staff & roles, tap New sign-in link on their entry, then Copy link and send it to them yourself. The app never sends it. Owners can make links for anyone; managers for anyone except owners. Their old unused link stops working; phones already signed in stay signed in.',showMe:{tab:'more',page:'staff',target:{testID:'access-tip'},hint:'New sign-in link is on each person.'}},{id:'pins-security',kind:'faq',topic:'Team',title:'PINs for the Display',keywords:['pin','display pin','clock in','wake pin','2580','manager pin','locked'],body:'Staff PINs for clocking in at the Display are 4 to 8 digits. Managers and owners need 6 to 8 digits, because their PIN can add temp staff. Easy PINs such as 1111 or 1234 are refused. Five wrong tries locks that person for 15 minutes; 20 wrong tries on one Display stops it for 15 minutes. The Display wake PIN (Settings \u203a Display) is 6 to 8 digits and is kept only as a scrambled hash. If it still says 2580, change it.'},{id:'cash-up-lock',kind:'faq',topic:'Money',title:'Correcting a signed-off cash up',keywords:['cash up','locked','unlock','correct','mistake','history','audit','sales report'],body:'Once a cash up or weekly sales report is confirmed and saved, it is locked so the figures can\u2019t change quietly. An owner taps Unlock to correct on it, says why, and has 30 minutes to fix it. History on each one shows who signed it off, changed or unlocked it, and when.'},{id:'wipe-device',kind:'faq',topic:'Settings',title:'Sign out and wipe a shared tablet or phone',keywords:['wipe','sign out','shared','tablet','leaver','lost','reset device'],body:'Tap the sync badge (bottom left), or go to Settings \u203a Display, and choose Sign out and wipe this device. It signs out and removes everything CoverCharge keeps on that device: sign-ins, pairing, saved screens and changes not sent yet. The venue\u2019s shared data is not touched. On the Display you type the wake PIN first.'}],o=t=>a.find(a=>a.id===t)},1511,[]); +__d(function(g,r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"HELP_TOPICS",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"HELP",{enumerable:!0,get:function(){return a}}),Object.defineProperty(e,"helpById",{enumerable:!0,get:function(){return o}});const t=['Bookings','Walk-ins','Table plan','Rota','Hours & pay','Tips','Team','Suppliers','Stock','Recipe cards','Displays','Settings','Accounts'],a=[{id:'new-booking',kind:'guide',topic:'Bookings',title:'Take a phone booking',keywords:['booking','reservation','book','table','phone','covers','reserve'],body:'Add a booking for a guest who calls or walks up to ask. The app only offers times that are really free.',steps:['Open Bookings (or tap New booking on Today).','Pick the date, time and number of covers.','Add the guest\u2019s name and phone, plus any allergies or notes.','Tap Save. The booking appears on the timeline and the floor plan.'],showMe:{tab:'bookings',target:{testID:'add-booking'},hint:'Tap New booking to start a booking.'}},{id:'move-booking',kind:'faq',topic:'Bookings',title:'How do I move a booking to another table or time?',keywords:['move','change','reschedule','table','booking','swap'],body:'Open the booking from Bookings or the timeline and tap Edit, or drag it to another table on the Display. Guests are not messaged unless you choose to.',showMe:{tab:'bookings',target:{testID:'add-booking'},hint:'Your bookings list is here. Tap a booking to change it.'}},{id:'walk-in',kind:'guide',topic:'Walk-ins',title:'Seat a walk-in',keywords:['walk-in','walkin','walk in','seat','no booking','covers','party'],body:'Record guests who arrive without a booking so the floor plan and covers stay right.',steps:['On the Display (the venue tablet), tap Walk-in. On a phone, say \u201cadd a walk-in for 2\u201d to the Assistant.','Choose the number of covers.','Pick a free table (the best fit is suggested).','Tap Seat. The table shows as seated.'],actions:['add_walkin']},{id:'table-plan',kind:'guide',topic:'Table plan',title:'Edit the table plan',keywords:['table plan','floor plan','layout','tables','move tables','designer','areas','seats'],body:'Drag tables into place, set seats, join tables and add areas such as Terrace or Garden.',steps:['Go to More \u203a Table plan.','Tap Open the designer.','Drag tables, or tap one to change its name and seats.','Tap Save. Displays and bookings use the new plan straight away.'],showMe:{tab:'more',page:'tableplan',target:{testID:'open-designer'},hint:'Open the designer to move tables.'}},{id:'rota',kind:'guide',topic:'Rota',title:'Build and publish the rota',keywords:['rota','shift','schedule','week','publish','staff hours','add shift'],body:'Plan the week, then publish it so staff see their shifts in the Staff app.',steps:['Go to More \u203a Rota.','Tap a person\u2019s day to add a shift (presets: lunch, dinner, double).','New shifts are drafts with a dashed amber border.','Tap Publish when the week is ready. Staff see only published shifts.'],showMe:{tab:'more',page:'rota',target:{testID:'rota-publish'},hint:'Tap a day to add a shift, then Publish here.'},actions:['add_rota_shift','publish_rota']},{id:'rota-copy',kind:'faq',topic:'Rota',title:'Can I copy last week\u2019s rota?',keywords:['copy','last week','repeat','rota','duplicate'],body:'Yes. On the Rota tap Copy last week. The shifts come over as drafts so you can tweak them before publishing.',showMe:{tab:'more',page:'rota',target:{testID:'rota-copy'},hint:'Copy last week\u2019s shifts as drafts.'}},{id:'sign-off',kind:'guide',topic:'Hours & pay',title:'Sign off hours',keywords:['sign off','signoff','confirm hours','approve','timesheet','clock','pending'],body:'Only confirmed hours count for pay and tips. Check clocked times against the rota and confirm them.',steps:['Go to More \u203a Sign off hours.','Flagged days (late, missing clock-out, long breaks) are at the top.','Tap a row to fix a time; give a short reason.','Tap Confirm all unflagged, then deal with the rest.'],showMe:{tab:'more',page:'signoff',target:{testID:'confirm-unflagged'},hint:'Confirm all the days that look right in one tap.'}},{id:'payroll-hours',kind:'guide',topic:'Hours & pay',title:'Export hours for payroll',keywords:['payroll','export','hours','spreadsheet','csv','excel','accountant','copy','print'],body:'Get each person\u2019s confirmed hours for a pay period into your spreadsheet or to your accountant.',steps:['Go to More \u203a Payroll hours.','Pick the pay period (or a tips fortnight, or a custom range).','Check the pending banner: sign those off first if you can.','Tap Copy for spreadsheet and paste into Excel or Google Sheets, or download a CSV, or print.'],showMe:{tab:'more',page:'hours',target:{testID:'copy-tsv'},hint:'Copy, then paste straight into your spreadsheet.'}},{id:'pay-dates',kind:'faq',topic:'Hours & pay',title:'How do I set our pay dates?',keywords:['pay day','payday','pay dates','cut-off','wages','monthly','fortnightly'],body:'Settings \u203a Pay & tips: set when tips are paid and how often, the wage pay day and the cut-off. Payroll hours and Tips day use these dates.',showMe:{tab:'more',page:'paysettings',target:{testID:'save-pay'},hint:'Change the dates above, then Save.'}},{id:'tips-day',kind:'guide',topic:'Tips',title:'Share out tips on tips day',keywords:['tips','tronc','gratuity','share','split','tips day','service charge'],body:'Enter the tips total and it\u2019s shared by confirmed hours for the fortnight, to the penny.',steps:['Go to More \u203a Tips day (the right fortnight is picked for you).','Type the total tips.','Check anyone with pending hours; sign them off first if you can.','Copy or download the split for payroll.'],showMe:{tab:'more',page:'tipsday',target:{testID:'tips-total'},hint:'Type the tips total here.'}},{id:'invites',kind:'guide',topic:'Team',title:'Invite staff to the app',keywords:['invite','link','staff app','new starter','sign in','add staff','team member'],body:'Each person gets their own sign-in link. You choose when and how to share it.',steps:['Go to Settings \u203a Invite links.','Tap Make invite link next to the person.','Share the link yourself (text or WhatsApp). The app never sends it for you.','They tap it once and the Staff app remembers them.'],showMe:{tab:'more',page:'setup-invites',target:{text:'Make invite link'},hint:'Make a personal link, then share it yourself.'}},{id:'suppliers',kind:'guide',topic:'Suppliers',title:'Suppliers and order sheets',keywords:['supplier','order','order sheet','delivery','cut-off','fish','veg','dairy'],body:'Keep supplier contacts, order days and cut-offs together, and log what you ordered.',steps:['Go to More \u203a Suppliers to add or edit a supplier.','Use Supplier order sheets for the items you usually order.','Tap Log an order after you place it by phone or email.'],showMe:{tab:'more',page:'ordersheets',target:{testID:'sheet-add'},hint:'Add an order sheet for a supplier.'}},{id:'display-glance',kind:'guide',topic:'Display',title:'Today at a glance (Display)',keywords:['glance','today','covers by hour','breaks','on now','next','cut-off','cutoff','order times','display bar'],body:'The bar under the Display header shows today in one line: covers by hour (booked in solid gold, the walk-in estimate dashed), quiet times for breaks, who is on now and next, today\u2019s supplier order cut-offs with a countdown (amber under 30 minutes) and one tip. Cut-offs come from Scheduled notifications.'},{id:'sold-out',kind:'guide',topic:'Menu',title:'Sold out dishes',keywords:['sold out','run out','ran out','none left','back on','86','eighty six','display strip'],body:'When a dish runs out, mark it sold out so every member of staff knows. It\u2019s a reminder for staff: CoverCharge doesn\u2019t link up to your till, so it doesn\u2019t change the till. Sold out dishes show in a slim strip along the bottom of the Display within seconds, and in the Sold out list in Front of House, Managers and Head Chef. They clear by themselves when the kitchen closes (or the next morning, or only when you tap Back on: Settings \u203a Advanced \u203a Sold out reminders).',steps:['Open the Sold out list (Managers: More \u203a Sold out; Front of House: Me \u203a Sold out; Head Chef: Kitchen \u203a Live tickets \u203a Sold out).','Tap Mark sold out next to the dish.','When it\u2019s back, tap Back on.'],showMe:{tab:'more',page:'soldout',target:{testID:'soldout-search'},hint:'Find the dish, then tap Mark sold out.'}},{id:'shellfish',kind:'guide',topic:'Stock',title:'Live shellfish (and other) counts',keywords:['shellfish','lobster','crab','oysters','count','stock','tracked','sold out','86'],body:'Counters for things you sell by the unit, like lobster or crab. They show on the Display and warn when low.',steps:['Go to Settings \u203a Tracked stock.','Tap Add an item to track; set the name, icon and low warning.','Staff update the count from the small lobster and crab chip at the top of the Display, or in the app.'],showMe:{tab:'more',page:'trackedstock',target:{text:'Add an item to track'},hint:'Add something to count, like lobster.'}},{id:'recipe-cards',kind:'guide',topic:'Recipe cards',title:'Recipe cards',keywords:['recipe','card','dish','ingredients','method','allergens','spec'],body:'Photo, ingredients, method and allergens for each dish; the head chef signs them off and staff can read them.',steps:['Go to More \u203a Recipe cards.','Search for a dish or add a new one.','Fill in ingredients (allergens are suggested) and the method.','Send for head chef sign-off.'],showMe:{tab:'more',page:'recipecards',target:{testID:'card-search'},hint:'Search your recipe cards here.'}},{id:'display-pair',kind:'guide',topic:'Displays',title:'Pair a display or tablet',keywords:['display','tablet','pair','screen','code','front of house','kitchen screen'],body:'Connect a tablet to your venue with a one-time code. You can switch any display off from here.',steps:['Open the Display app on the tablet.','In Managers go to Settings \u203a Displays and tap Make a pairing code.','Type the code on the tablet. It joins your venue straight away.'],showMe:{tab:'more',page:'displays',target:{text:'Make a pairing code'},hint:'Make a one-time code for the tablet.'}},{id:'settings-hours',kind:'faq',topic:'Settings',title:'How do I change our opening hours?',keywords:['opening hours','hours','closed','open','kitchen hours','times'],body:'Settings \u203a Opening hours. Guests see these on your booking and order pages; bookings outside them are turned away.',showMe:{tab:'more',page:'setup-hours',hint:'Set each day\u2019s opening and closing time here.'}},{id:'replay-setup',kind:'faq',topic:'Settings',title:'Can I see the welcome walkthrough again?',keywords:['welcome','setup','walkthrough','onboarding','checklist','questionnaire'],body:'Yes: Settings \u203a Setup checklist \u203a Replay welcome. Everything is pre-filled from your questionnaire.',showMe:{tab:'more',page:'setupchecklist',target:{testID:'replay-welcome'},hint:'Replay the welcome walkthrough.'}},{id:'connected-accounts',kind:'guide',topic:'Accounts',title:'Connect your email, website and socials',keywords:['connect','account','gmail','outlook','wix','facebook','instagram','square','xero','quickbooks','login'],body:'Settings \u203a Connected accounts: tap a logo, save the account to your list, and use Connect with\u2026 to sign in on that service\u2019s own page (rolling out service by service; it shows Coming soon until then). CoverCharge never sees your password that way, and you can remove an account any time.',steps:['Go to Settings \u203a Connected accounts.','Tap the service\u2019s logo.','Tap Connect with\u2026 and sign in on their page.','To stop, tap Remove.'],showMe:{tab:'more',page:'connections',target:{testID:'conn-tile-gmail'},hint:'Tap a logo to connect that account.'}},{id:'supplier-portals',kind:'guide',topic:'Suppliers',title:'Order from your suppliers',keywords:['bidfood','booker','wholesale','cash and carry','order online','supplier login','account number','customer number'],body:'Settings \u203a Connected accounts \u203a Suppliers. Add supplier links for this venue, with an account number if you like. Open ordering and Log in open the supplier\u2019s own website, where you sign in; CoverCharge never keeps the password.',steps:['Go to Settings \u203a Connected accounts.','Scroll to Suppliers.','Tap Add against a supplier (account number optional).','Tap Open ordering or Log in whenever you need them.','To stop, tap Remove and confirm.'],showMe:{tab:'more',page:'connections',target:{testID:'portal-bidfood'},hint:'Your supplier ordering websites live here.'}},{id:'support',kind:'faq',topic:'Settings',title:'How do I get help from a person?',keywords:['support','help','contact','person','problem','broken','stuck'],body:'Support is free for life. Message the CoverCharge team from Settings \u203a Help, or email us, and we\u2019ll reply. We help by message and email.'},{id:'assistant-safe',kind:'faq',topic:'Settings',title:'Can the Assistant send or pay for things by itself?',keywords:['assistant','safe','confirm','send','pay','delete','ai'],body:'No. The Assistant and the voice helper show you exactly what they will do and wait for you to tap Confirm (or say yes). Anything that would send a message, order from a supplier or pay is only saved as a draft in Drafts for approval; nothing goes out by itself.'},{id:'restaurant-dashboard',kind:'guide',topic:'Bookings',title:'Restaurant dashboard',keywords:['restaurant dashboard','tables','timeline','guests','covers','joined tables'],body:'In Managers, tap Restaurant dashboard on Home, or More > Run the day > Restaurant dashboard. It is the same live table plan, Timeline, guest list, deposits, dogs, joined tables, Covers, covers-through-the-day chart and block bookings as the Display. Use the day arrows and Back to today. Assign or join tables on any day; seat, finish, no-show and cancel walk-in actions apply today. You can also say \u201copen Restaurant dashboard\u201d. The helper replies in text only.',showMe:{tab:'more',page:'serviceboard',target:{testID:'restaurant-dashboard-close'},hint:'Restaurant dashboard is open. Pick a day, or tap Back to Managers to close.'}},{id:'voice-helper',kind:'guide',topic:'Settings',title:'Use the hold-to-talk voice button',keywords:['voice','talk','speak','microphone','mic','hold','walkie','button','hands free','gloves'],body:'Hold the big gold button, say what you need, then let go. It logs fridge and freezer temperatures, answers allergen questions, marks dishes sold out, checks tables, adds to the waitlist, reads orders and covers, and drafts bookings, offers, events and supplier lists. The helper replies in text only, never aloud. Changes are shown in text first with Confirm and Cancel buttons: tap Confirm or say yes. Tap the button to type instead (in Managers this also opens the Assistant). It sits at the top right of the header in Managers, Head Chef, the Staff app (the full voice assistant, with no money, tips or HR) and on the Display (no money, tips or HR). Until the voice assistant\u2019s server is switched on, anything new says \u201cVoice assistant is switching on soon\u201d. Fair usage: 1,000 voice tasks a month per venue.',steps:['Hold the gold microphone button (the first time, allow the microphone).','Speak, for example \u201cprep fridge 3 degrees\u201d.','Let go to send.','If it reads something back, tap Confirm or hold again and say \u201cyes\u201d.','The button stays at the top right so it never covers the screen.'],showMe:{tab:'more',page:'voice',hint:'Turn the voice button on or off for each role here.'}},{id:'voice-drafts',kind:'faq',topic:'Settings',title:'Where do voice bookings and shopping lists go?',keywords:['drafts','approve','approval','shopping list','booker list','bidfood list','draft booking','offer','event'],body:'To Settings \u203a Drafts for approval. Bookings, supplier lists, offers, events and specials made by voice wait there for an owner or manager. Approving marks it approved and opens the right screen; you still place the order or confirm the booking yourself.',showMe:{tab:'more',page:'drafts',hint:'Drafts from the voice helper wait here.'}},{id:'voice-temps',kind:'guide',topic:'Settings',title:'Log fridge and freezer temperatures by voice',keywords:['temperature','fridge','freezer','haccp','food safety','eho','log temps','probe'],body:'Hold the voice button and say the unit and the number, for example \u201cprep fridge 3, freezer minus 19\u201d. Fridges should be 5\xb0C or colder and freezers -18\xb0C or colder; anything outside is flagged. Everything is in the Food safety log with who and when, ready to export or print for the EHO.',showMe:{tab:'more',page:'haccp',hint:'Every voice reading appears in the food safety log.'}},{id:'voice-fair-usage',kind:'faq',topic:'Settings',title:'Is there a limit on voice tasks?',keywords:['voice','limit','allowance','fair usage','fair use','how many','tasks','month','plan'],body:'Fair usage: 1,000 voice tasks a month per venue. It is one allowance shared by all of the venue\u2019s apps and devices, and it resets on the 1st. Each request counts once, spoken or typed; saying \u201cyes\u201d to confirm does not count again. You will see a note at 80%. If the venue reaches 1,000, the voice helper pauses until the 1st, except food safety and temperature logging, which always works. The owner can contact CoverCharge if you need more. See the count in Plan & billing or Settings \u203a Voice helper.',showMe:{tab:'more',page:'voice',hint:'This month\u2019s voice task count is shown here.'}},{id:'adv-bookings',kind:'guide',topic:'Settings',title:'Booking questions: allergies, dogs, access, vegan',keywords:['advanced','allergen','dog','dogs','cap','wheelchair','access','vegan','vegetarian','table request','settings'],body:'Choose what guests are asked when they book. Allergies are always asked first, in red, and staff tick \u201cAllergens seen\u201d. The others can be switched off.',steps:['Open More \u203a Settings \u203a Advanced.','In Bookings, tick or untick each question.','Use the dog stepper to cap dogs per booking time (No limit = only the dog-friendly tables).','Mark dog-friendly and step-free tables on the Table plan.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-bookings'},hint:'Booking questions are here.'}},{id:'adv-table-times',kind:'guide',topic:'Settings',title:'How long tables stay (table times)',keywords:['advanced','dwell','table time','turn','how long','next table free','minutes'],body:'Usual table times by party size: 90 min for 1\u20132 covers, 105 for 3\u20135, 2 hours for 6\u201319 and 3 hours for 20 or more. The app fine-tunes them from how long your tables really stay, and uses them for \u201cNext table free\u201d.',steps:['Open More \u203a Settings \u203a Advanced \u203a Table times.','Tap \u2212 or + to change a band by 5 minutes.','Untick \u201cFine-tune\u201d to use your numbers exactly.','Reset to default puts the four bands back.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-times'},hint:'Table times are here.'}},{id:'adv-reservable',kind:'guide',topic:'Settings',title:'Seafood platter, crab and lobster reservations',keywords:['advanced','platter','seafood','crab','lobster','reserve','price'],body:'Guests can reserve the Seafood Platter (1 crab + 1 lobster, \xa3160) or a crab or lobster with their booking. Reserved ones come off the Display count with a \u201cReserved\u201d line, the kitchen is told, and the Head Chef taps OK.',steps:['Open More \u203a Settings \u203a Advanced \u203a Reservable items.','Tick what guests can reserve and set the price.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-reserve'},hint:'Reservable items are here.'}},{id:'adv-events',kind:'guide',topic:'Settings',title:'Regular events like Open Mic Night',keywords:['advanced','open mic night','music night','event','regular','monthly','promote','busier','last food'],body:'Add events that repeat, e.g. Open Mic Night on the last Sunday of every month from 8pm with last food orders at 7pm. They show in Forecast key dates with a Promote button and on Today, and \u201cExpect busier\u201d raises the forecast.',steps:['Open More \u203a Settings \u203a Advanced \u203a Regular events.','Tap Add a regular event (or Edit).','Pick how it repeats and the day, add a start time and last food orders if needed.','Tap Save event.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-events'},hint:'Regular events are here.'}},{id:'adv-hours',kind:'guide',topic:'Settings',title:'Kitchen hours, seasons and special days',keywords:['advanced','hours','kitchen','season','winter','summer','special day','closed','last food orders','cutoff'],body:'Kitchen (food) hours decide which booking times are offered; the closing time is last food orders. Keep Winter and Summer hours, each with the date it starts every year, and the app switches by itself. Add special days for one-off changes.',steps:['Open More \u203a Settings \u203a Advanced \u203a Kitchen hours.','Tap Set Summer hours, fill in each day and the start date (e.g. 04-01 for 1 April).','Set the Winter start date too.','Use Add a special day for closures or late nights.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-hours'},hint:'Kitchen hours and seasons are here.'}},{id:'adv-home',kind:'faq',topic:'Settings',title:'Covers counter, Next table free and takeaway on home screens',keywords:['advanced','covers counter','takeaway','next table free','home','display','flip'],body:'Turn the COVERS counter and the \u201cNext table free\u201d card on or off, and choose whether takeaway figures show on home screens (off at the Anchorage). Takeaway order alerts always work. The flap click sound is set on each Display.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-home'},hint:'Display and home options are here.'}},{id:'adv-holidays',kind:'faq',topic:'Settings',title:'Why don\u2019t bank holidays say \u201c(substitute day)\u201d?',keywords:['advanced','holiday','substitute','bank holiday'],body:'The date already shows when a holiday moves, so the extra words are hidden. Tick \u201cShow full gov.uk names\u201d in Settings \u203a Advanced \u203a Holiday names to bring them back.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-holidays'},hint:'Holiday names are here.'}},{id:'adv-blocks',kind:'guide',topic:'Settings',title:'Lunch and dinner times for Block now',keywords:['block','lunch','dinner','service','wix','advanced','pause'],body:'Settings \u203a Advanced \u203a Block bookings sets when Lunch and Dinner run, for the Block now buttons and Spend per head. At The Anchorage, blocks also close those times on website bookings, and blocks made on the website show in CoverCharge. Website bookings can only close the whole venue, not one area or some tables.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-blocks'},hint:'Block bookings settings are here.'}},{id:'blocks-screen',kind:'guide',topic:'Bookings',title:'Block bookings: today, a future date, an area or some tables',keywords:['block','blocks','pause','close','closed','stop bookings','private','repeat','future'],body:'Tap Block bookings on the home screen. Block now pauses bookings today (Rest of today, Next hour, Lunch, Dinner, or a From\u2013To). Add a block closes a future date or range, the whole day or set times, the whole venue, one area or some tables, once or every week or on the last weekday of the month. Every future block is listed by month with Edit and Remove; removing asks first and is logged. Bookings already made are kept, and you are told how many.',showMe:{tab:'more',page:'blocks',target:{testID:'blocks-screen'},hint:'Block bookings is here.'}},{id:'spend-per-head',kind:'guide',topic:'Money',title:'Spend per head',keywords:['spend per head','sph','average spend','takings','covers','gross'],body:'Spend per head is Gross takings \xf7 Covers, by day, by week and for lunch and dinner. Enter the gross on the cash up (Enter the cash up, Upload a spreadsheet, or Enter takings). Covers are seated and finished bookings and walk-ins; no-shows and cancellations are left out. A day with no takings shows \u201cNo takings entered\u201d, never \xa30.',showMe:{tab:'more',page:'spendhead',target:{testID:'sph-screen'},hint:'Spend per head is here.'}},{id:'cashup-photo',kind:'guide',topic:'Money',title:'Enter the cash up, or upload a spreadsheet',keywords:['cash up','paid out','spreadsheet','csv','excel','xlsx','sheet','gross','card','cash','tips','takings','drawer'],body:'In Cash up & sales tap Enter the cash up and type the figures (Z total, card, cash, paid outs, tips, and gross if you have it). In Paid out, add a line for each amount taken from the till \u2014 for example lobsters or supermarket shopping \u2014 with the amount, an optional note, and your name. The paid-out total comes off the expected cash in the drawer. Check every figure, then tap Confirm and save. Bigger venues can tap Upload a spreadsheet (CSV or Excel): match the columns, check the preview (dates already saved are flagged), then confirm. Nothing is saved before you confirm, and every save is logged. You can export cash ups as a spreadsheet from Recent cash ups.',showMe:{tab:'more',page:'cashup',target:{testID:'cashup-by-hand'},hint:'Start the cash up here.'}},{id:'adv-giftqr',kind:'guide',topic:'Settings',title:'Buy a gift card on the Display',keywords:['gift','gift card','voucher','qr','display','wix','advanced'],body:'Switch on \u201cShow Buy a gift card on the Display\u201d in Settings \u203a Advanced \u203a Gift cards on the Display, and save your gift card page address. The Display has a Gift vouchers button: it opens the list of website vouchers (search, use by dates, Mark as used), with Show the buy QR code at the bottom. Guests buy on your website.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-giftqr'},hint:'Gift cards on the Display are here.'}},{id:'adv-whatsapp',kind:'guide',topic:'Settings',title:'WhatsApp buttons (tap to chat)',keywords:['whatsapp','wa.me','message','chat','guest','mobile','number','advanced'],body:'Put the venue\u2019s WhatsApp number in Settings \u203a Advanced \u203a WhatsApp, e.g. 01292 500123 or +44 7700 900123. Guests then see \u201cMessage us on WhatsApp\u201d on their booking confirmation, with their booking details typed in. Staff and managers see \u201cWhatsApp guest\u201d on bookings with a mobile number, with a confirmation typed in that you can change. Nothing is ever sent for you: WhatsApp opens and you tap Send yourself. Leave the number blank and every WhatsApp button stays hidden. Reset to default clears the number.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-whatsapp'},hint:'The WhatsApp number is here.'}},{id:'adv-reminders',kind:'guide',topic:'Settings',title:'Staff reminders: breaks and \u201cchairs up\u201d',keywords:['reminder','reminders','break','breaks','chairs','closing','6 hours','law','snooze','later','done','advanced'],body:'Reminders slide up for staff who are on shift right now (clocked in, or on the rota at that time) in the Staff and Head Chef apps, while the app is open. Break reminders: if the rota shift has a break time, the reminder comes at that time; if not, it comes 4 hours after they clock in (or after the shift starts). If they still haven\u2019t started a break it comes once more 30 minutes later, and again at 6 hours, because UK law says a shift over 6 hours needs a 20-minute break. \u201cStart break\u201d starts their break; \u201cLater\u201d hides it for 15 minutes. You can change these times. Venue reminders, such as \u201cTime to put the chairs up on the tables\u201d (Friday and Sunday, 21:00), have wording, days, a time (UK) and who sees them: everyone on shift, front of house or kitchen. Pause, edit or delete any of them, or add your own. Once anyone taps Done it goes for everyone that day, and the Reminders screen shows who did it. Reset to default brings back the standard break times and \u201cchairs up\u201d; your own reminders stay. Phones with the app closed don\u2019t get reminders yet.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-reminders'},hint:'Reminders are here.'}},{id:'adv-notifications',kind:'guide',topic:'Settings',title:'Scheduled notifications (e.g. the Mills milk order)',keywords:['notification','notifications','push','phone','milk','mills','pieroni','pieronis','veg','olsen','rota upload','scheduled','advanced'],body:'Settings \u203a Advanced \u203a Notifications lists reminders that go to named people at a set UK time, such as \u201cMills milk order\u201d for the Head Chef and Gordon. Each has a title, a message, the days, a time (you can set a different time on some days, e.g. 20:55 on Fridays), who gets it (tick people or pick a group like Everyone on shift) and how it is sent. In the app it is the gold slider with Done and Later; Done is logged with the name and time, and Later hides it for 15 minutes. Urgent notices (like the 6-hour break) always come first and only one shows at a time. Phone notifications: each person taps \u201cTurn on phone notifications\u201d on their own phone (iPhone: add the app to the Home Screen first, iOS 16.4 or later). Nothing goes to phones until an owner or manager switches \u201cSend to phones\u201d on. The Display never gets these. Reset to default restores the configured rules.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-notifications'},hint:'Notifications are here.'}},{id:'adv-order-lists',kind:'guide',topic:'Settings',title:'Order lists (Alsons, Cash and carry)',keywords:['order list','orders','alsons','drinks','cash and carry','trip','shopping','logo','carry over','advanced'],body:'Order lists collect what you need from a supplier. A running list (Alsons drinks) fills up until you order; a trip list (Cash and carry) is for a shopping day, Friday by default, which you can change for each trip. Add an item with a quantity and unit and an optional note; the app records who added it and when. Adding something already on the list offers to add to the quantity instead. On the day, tick Got or Ordered, or mark Missing / not in stock. Finish order saves it to History (date and who) and asks whether to carry over anything not got. Removing an item can be undone. Settings \u203a Advanced \u203a Order lists: add, rename or archive lists, the default trip day, and \u201cLet all staff add items\u201d (on: staff can add and see lists; only managers and the Head Chef tick, remove or finish). Each list can have a logo (take a photo or choose one) or shows its initials, and a phone number to tap to call (never called for you).',showMe:{tab:'more',page:'advanced',target:{testID:'adv-orderlists'},hint:'Order list settings are here.'}},{id:'adv-clock-area',kind:'guide',topic:'Settings',title:'Clock-in area, forgotten breaks and off-rota arrivals',keywords:['clock','clock in','geofence','location','area','radius','break','forgot','rota','visiting','override','advanced'],body:'Clock in, clock out, start break and end break only work at the venue once the centre is set. Stand in the middle of the venue and tap \u201cUse my current location\u201d, then choose how far (at least 50 m, 100 m to start). Phones are not exact, so up to 50 m of the phone\u2019s own accuracy is allowed on top. Each clock record keeps the reading, its accuracy and whether it was inside. If location is off or blocked, the app says how to allow it. Managers can record it for someone from Clock in / out \u203a Record it for someone, with a reason that is logged. Until the centre is set nobody is blocked and managers see a warning. Rota and pay screens are never blocked. Forgotten breaks: if no break was recorded, Clock out asks \u201cDid you take a break? If so, how long?\u201d; a length you pick is saved as a break marked \u201cadded at clock-out\u201d, which managers see and can edit in Hours. Not on the rota: if someone is at the venue, not clocked in and not on the rota, the Staff and Head Chef apps ask \u201cDo you want to sign in?\u201d. Yes clocks them in, marked off-rota, and managers get a notice; \u201cNo, just visiting\u201d stops asking for the day. This only checks while the app is open; web apps can\u2019t watch location in the background.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-clockarea'},hint:'Clock-in area settings are here.'}},{id:'adv-tablegrid',kind:'guide',topic:'Table plan',title:'Table plan grid and Tidy up (Advanced)',keywords:['grid','snap','line up','align','tidy','guides','spacing','restore','table plan','option','alt'],body:'Tables snap to the grid when you drag them, and gold guides show when an edge or centre lines up with another table. A small number shows when the gaps either side are even. Hold Alt (Option on a Mac) to move freely. Tidy up lines every table up on the grid and evens out the rows; only positions change. The old positions are kept, so one tap puts them back.',steps:['Go to Settings \u203a Advanced.','Find Table plan grid.','Turn snapping on or off, pick a grid size, or tap Tidy up the whole plan.','Changed your mind? Tap Put the tables back where they were.']},{id:'adv-printers',kind:'guide',topic:'Orders',title:'Kitchen ticket printers (Advanced)',keywords:['print','printer','printing','ticket','kitchen ticket','docket','receipt','epson','star','bluetooth','reprint','takeaway'],body:'Print a kitchen ticket by itself for every takeaway order, as soon as it comes in or when it is accepted. The ticket has the order number, collection time, name, every dish with its options and notes, allergies in white-on-black, and paid or not paid. Works with Epson (TM-m30, TM-T20, TM-T88), Star WebPRNT, most other network receipt printers (port 9100) and Bluetooth printers from the tablet app. If a ticket does not print, an amber warning shows and the order stays on screen.',steps:['Go to Settings \u203a Advanced.','Find Printers.','Tap Add a printer by IP address or Find printers on this Wi-Fi, choose the type and tap Test print.','Turn on Print a kitchen ticket for every takeaway order.']},{id:'adv-deposits',kind:'guide',topic:'Bookings',title:'Deposits (Advanced)',keywords:['deposit','deposits','per person','per adult','children','waive','waived','regular','party size','refund','refundable','cut off','policy','paid','due'],body:'Ask bigger tables for a deposit: set the amount per adult (children never pay and do not count towards the number that needs one: a table of 8 with 3 children pays nothing; a table of 6 adults, or 7 with 1 child, pays for 6), the smallest number of adults that pays one (6 or more adults at The Anchorage), whether it is refundable and up to how many hours before, and the words guests see. Staff can waive a deposit. No card is saved in CoverCharge. Deposits are paid through website bookings: website bookings show Deposit paid on website bookings, Part paid on website bookings or Deposit not paid by themselves. For phone and walk-in bookings, staff tick Deposit paid once the guest has paid you, or (once switched on) press Send deposit link to send a website bookings pay link by text, WhatsApp or email. Refunds are done in Website bookings \u203a Orders. Deposit amounts are shown on bookings in Managers, Display and Staff. Other financial and HR information remains restricted.',steps:['Go to Settings \u203a Advanced.','Find Deposits.','Turn deposits on or off, and set the amount, party size, refund terms and the words guests see.','On a booking, tap Mark deposit paid once the guest has paid.','To let a regular off, tap Waive deposit on the booking (or in Edit booking), add why if you like, and tap Yes, waive it. Your name is saved with it.']},{id:'adv-loyalty',kind:'guide',topic:'Guests',title:'Loyalty: stamp card, offers & bring a friend (Advanced)',keywords:['loyalty','stamp','stamps','card','reward','offer','offers','referral','friend','expiry'],body:'The stamp card, offers and bring-a-friend are saved on the server, so every phone and tablet shows the same card. Set how many stamps earn a reward, what the reward is, when stamps or rewards run out, and how often one guest can get a stamp. Stamps only come from staff, or from a code or QR staff make, and each reward can be used once. Guests join with their agreement recorded, and a manager can remove a guest and their details.',steps:['Go to Settings \u203a Advanced.','Find Loyalty.','Turn the stamp card on, write the reward and tap Save loyalty settings.','Add offers with their dates, and turn bring-a-friend on if you want it.']},{id:'adv-table-order',kind:'guide',topic:'Guests',title:'Order at the table (Advanced)',keywords:['order at table','qr','qr code','scan','table','phone','accept','last orders','print','pdf','pay at bar'],body:'Guests scan the small QR card on their table (Managers \u203a Table QR codes prints them, 20 to a page), see your menu with allergens, and send an order. It lands in Front of House and on the kitchen screen within seconds. Prices, sold-out dishes and hours are checked on the server, so a phone can\u2019t change them. Staff accept the first order from each new phone (you can turn this off). Guests pay at the bar or with their server; paying by card from the phone is coming later.',steps:['Go to Settings \u203a Advanced.','Find Order at the table.','Turn it on, pick the areas or tables, set the hours and tap Save order at the table.','Tap Make codes, pick Stickers 50 \xd7 50 mm or Stand cards 50 \xd7 70 mm, then Print all QR cards (PDF) and put each code on its table.']},{id:'adv-soldout',kind:'guide',topic:'Menu',title:'Sold out reminders (Advanced)',keywords:['sold out','86','clear','end of service','next morning','back on','advanced','display strip','automatic','counts','lobster','crab'],body:'Choose when sold out dishes go back on by themselves: when the kitchen closes (from your Kitchen hours), the next morning (pick the time), or only when someone taps Back on. \u201cMark dishes sold out from the counts\u201d (on unless you turn it off) marks every dish that uses a counted item, like lobster or crab, when the count runs out, and puts it back on when the count is back up. Sold out is a reminder for staff on the Display and in the staff apps; it doesn\u2019t change your till.',steps:['Go to Settings \u203a Advanced.','Find Sold out reminders.','Pick when they clear, and turn marking from the counts on or off.']},{id:'sold-out-auto',kind:'guide',topic:'Menu',title:'Sold out from the counts (lobster, crab\u2026)',keywords:['sold out','automatic','auto','counts','shellfish','lobster','crab','platter','link','uses','none left'],body:'When a counted item runs out, or drops below what a dish needs, every dish that uses it is marked sold out by itself, with the reason: \u201cDeluxe Seafood Platter (no lobster or crab)\u201d. When the count is back up (a delivery or a recount), those dishes go back on by themselves. Dishes marked by hand are left alone. CoverCharge works out what each dish uses from its recipe card, its description (\u201cone whole lobster\u201d) or its name; you can change it for any dish. If you tap Back on while the count is still short, the dish stays on until the count changes.',steps:['Open the Sold out list.','Under Dishes linked to the counts, tap Change next to a dish.','Set how many of each item one portion uses (0 = not linked), then tap Save. Back to automatic undoes it.'],showMe:{tab:'more',page:'soldout',target:{testID:'soldout-links'},hint:'Tap Change next to a dish to set what it uses.'}},{id:'adv-forecast',kind:'guide',topic:'Forecasts',title:'Forecast history and "Not enough history yet"',keywords:['forecast','not enough history','history','estimate','example figures','labour','sales','walk-ins','advanced'],body:'Forecasts are built only from your own bookings, seated walk-ins, takeaway orders and cash-ups. Until CoverCharge has enough of your history (2 weeks to start with; change it in Settings \u203a Advanced \u203a Forecast history) you see \u2018Not enough history yet\u2019, what is already booked and your real labour cost from the rota, with no sales forecast or labour %. No history is invented for a live venue.',steps:['Go to Settings \u203a Advanced.','Find Forecast history.','Pick how many weeks are needed.']},{id:'adv-checkout',kind:'guide',topic:'Team',title:'Shift check-out, question board and team morale',keywords:['check out','checkout','morale','mood','staffing','overstaffed','survey','anonymous','question board','vote','shout out','wellbeing','advanced'],body:'When someone clocks out, they get a quick card: team morale from Low to High, and whether there was enough staff for the customers. They can also post a question for the board or shout out a teammate, or tap Skip. Nothing shows at clock in. Answers are anonymous: no name or staff number is saved, and each phone can answer a shift once. Team morale (Managers app \u203a More \u203a Team morale) shows a day only once 3 or more people have answered, next to that day\u2019s covers. Change the wording or switch parts off here.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-checkout'},hint:'Check-out and board settings are here.'}},{id:'hr-board',kind:'guide',topic:'Team',title:'The anonymous question board',keywords:['question board','board','anonymous','vote','yes no','reply','hide','moderation','log'],body:'Anyone on the team can post a question and vote it up, or vote Yes or No. No names are shown or saved. Owners and managers can reply (shown as \u201cReply from the managers\u201d) and hide offensive posts with a reason. Every hide, unhide and reply is in the Moderation log.',showMe:{tab:'more',page:'board',hint:'The question board.'}},{id:'adv-tasks',kind:'guide',topic:'Team',title:'Daily tasks',keywords:['tasks','daily tasks','checklist','duties','jobs','to do','my tasks','library','head chef'],body:'Give each person a short list of daily tasks: open Staff & roles, tap Daily tasks on their card, then pick from the venue\u2019s task library or type a new one. Use the arrows to reorder, \u2715 to remove (with Undo) and Days to limit a task to certain days. They see \u201cMy tasks today\u201d on their home screen and tick each one off while on shift; each tick records who and when, and you see \u201c2 of 5 done today\u201d on their card. Lists start fresh every day. Owners and managers can change anyone\u2019s list, including the Head Chef\u2019s. The Head Chef can change the lists of kitchen staff (chefs, commis and KPs) from Kitchen \u203a Kitchen team tasks, but not their own and not front of house. The task library is in Settings \u203a Advanced \u203a Tasks.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-tasks'},hint:'The task library is here.'}},{id:'adv-cashup',kind:'guide',topic:'Money',title:'Cash up and weekly sales',keywords:['cash up','cashup','takings','float','till','sales report','weekly sales','pos','printout','photo','graphs','charts'],body:'At the end of the night open Cash up & sales and tap Enter the cash up. Type each figure; boxes left blank stay blank (never counted as zero) and are highlighted in amber. Add any cash paid out of the till (lobsters, supermarket shopping, and the like) in the Paid out section: each line has what it was for, the amount, an optional note and who entered it. The total reduces the expected cash in the drawer. Nothing is saved until you tap Confirm and save. Do the same with the weekly sales report from the till (several pages is fine). The graphs show daily takings, tips, weekly net sales against the week before and sales by category. Owners and managers can enter and change cash ups; the Head Chef can see the graphs if they are allowed to see takings. Change the boxes to match your sheet in Settings \u203a Advanced \u203a Cash up; Cash tips total and Card tips total are always kept.',showMe:{tab:'more',page:'cashup',target:{testID:'cashup-by-hand'},hint:'Start the cash up here.'}},{id:'adv-tips',kind:'guide',topic:'Money',title:'Today\u2019s tips and the Tips pot',keywords:['tips','today tips','tips pot','pot','payout','tip pay','correction','coins'],body:'When a cash up with Cash tips total and Card tips total is confirmed, the team\u2019s combined tips for that day show as Today\u2019s tips in every staff app and on the Display, with a short notice. The Tips pot adds up confirmed daily tips since the last payout (fortnightly tip pay). After paying the tips, an owner or manager taps Mark payout done on the Tips pot card: the pot goes back to \xa30.00 and the old pot is kept in Past pots. Use Correct an entry to add or take off an amount for a day; a reason is required and every correction is logged with your name. Only the team total is ever shown, never anyone\u2019s share. Hide either card in Settings \u203a Advanced \u203a Tips.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-tips'},hint:'Show or hide the tips cards here.'}},{id:'manager-access',kind:'guide',topic:'Team',title:'Manager access',keywords:['manager access','manager','access','role','promote','front of house','head chef','owner'],body:'In Staff & roles each person has a Manager access switch. On: they use the Manager app (rota, bookings, staff, hours, settings, plus their own clock in, rota and pay). Off: they use the Front of House app, or the Head Chef app for the Head Chef. Owners can switch anyone except owners; managers can switch anyone except themselves and owners. The last owner can never be removed. You confirm each change; it is logged with who and when (Access changes). Job titles are free text and don\u2019t change.',showMe:{tab:'more',page:'staff',target:{testID:'access-tip'},hint:'Manager access switches are on each person.'}},{id:'next-table-free',kind:'faq',topic:'Walk-ins',title:'When is the next table free?',keywords:['next table','free','wait','walk-in','quote','full'],body:'When you\u2019re full, Today and the Display show \u201cNext table free about 19:40 (T6, 4 seats)\u201d with \u201clikely\u201d or \u201cmaybe\u201d, and how long a walk-in for 2 or 4 would wait. Tap Bill requested or Table finished on the plan and it updates. You can also ask the Assistant \u201cwhen\u2019s the next table free?\u201d.'},{id:'time-travel',kind:'faq',topic:'Today',title:'Look at another day (time travel)',keywords:['yesterday','tomorrow','next week','past','future','day','time travel'],body:'On Today, tap \u2039 or \u203a beside the date to step a day back or forward. You\u2019ll see that day\u2019s kitchen hours, events, covers (booked, or how it went), platters and each booking\u2019s allergens and needs. It\u2019s read-only and nothing changes live service. Tap Today to come back. The Display goes back to today by itself after 2 minutes. Staff can look 7 days back and 14 days ahead.'},{id:'sign-in-links',kind:'guide',topic:'Team',title:'Personal sign-in links',keywords:['link','invite','sign in','new link','expired','already used','phone','login'],body:'Each personal link works on one phone only and lasts 5 days, so nobody else can sign in as that person. The same phone can open it again, in any of the apps. If someone gets a new phone, or their link has expired, open Staff & roles, tap New sign-in link on their entry, then Copy link and send it to them yourself. The app never sends it. Owners can make links for anyone; managers for anyone except owners. Their old unused link stops working; phones already signed in stay signed in.',showMe:{tab:'more',page:'staff',target:{testID:'access-tip'},hint:'New sign-in link is on each person.'}},{id:'pins-security',kind:'faq',topic:'Team',title:'PINs for the Display',keywords:['pin','display pin','clock in','wake pin','2580','manager pin','locked'],body:'Staff PINs for clocking in at the Display are 4 to 8 digits. Managers and owners need 6 to 8 digits, because their PIN can add temp staff. Easy PINs such as 1111 or 1234 are refused. Five wrong tries locks that person for 15 minutes; 20 wrong tries on one Display stops it for 15 minutes. The Display wake PIN (Settings \u203a Display) is 6 to 8 digits and is kept only as a scrambled hash. If it still says 2580, change it.'},{id:'cash-up-lock',kind:'faq',topic:'Money',title:'Correcting a signed-off cash up',keywords:['cash up','locked','unlock','correct','mistake','history','audit','sales report'],body:'Once a cash up or weekly sales report is confirmed and saved, it is locked so the figures can\u2019t change quietly. An owner taps Unlock to correct on it, says why, and has 30 minutes to fix it. History on each one shows who signed it off, changed or unlocked it, and when.'},{id:'wipe-device',kind:'faq',topic:'Settings',title:'Sign out and wipe a shared tablet or phone',keywords:['wipe','sign out','shared','tablet','leaver','lost','reset device'],body:'Tap the sync badge (bottom left), or go to Settings \u203a Display, and choose Sign out and wipe this device. It signs out and removes everything CoverCharge keeps on that device: sign-ins, pairing, saved screens and changes not sent yet. The venue\u2019s shared data is not touched. On the Display you type the wake PIN first.'}],o=t=>a.find(a=>a.id===t)},1511,[]); __d(function(g,r,_i,_a,m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"tokens",{enumerable:!0,get:function(){return o}}),e.lev=l,e.searchHelp=function(n,l,i=8){const h=o(l);if(!h.length)return[];const a=t(l);return n.map(n=>{const l=o(n.title),i=o(n.keywords.join(' ')),c=o(`${n.body} ${(n.steps??[]).join(' ')}`);let f=3*s(h,l)+2.5*s(h,i)+.8*s(h,c);return n.keywords.some(n=>a.includes(t(n))&&t(n).length>3)&&(f+=2),t(n.title).includes(a)&&a.length>3&&(f+=3),{a:n,score:f/Math.sqrt(h.length)}}).filter(t=>t.score>=1.2).sort((t,n)=>n.score-t.score).slice(0,i)};const t=t=>t.toLowerCase().replace(/[\u2019']/g,'').replace(/[^a-z0-9\xa3 ]+/g,' ').replace(/\s+/g,' ').trim(),n=new Set(['how','do','i','a','an','the','to','can','my','our','we','is','it','of','for','in','on','and','what','where','please','me','you','with']),o=o=>t(o).split(' ').filter(t=>t&&!n.has(t));function l(t,n,o=2){if(Math.abs(t.length-n.length)>o)return o+1;let l=Array.from({length:n.length+1},(t,n)=>n);for(let i=1;i<=t.length;i++){const s=[i];let h=i;for(let o=1;o<=n.length;o++)s[o]=Math.min(l[o]+1,s[o-1]+1,l[o-1]+(t[i-1]===n[o-1]?0:1)),h=Math.min(h,s[o]);if(h>o)return o+1;l=s}return l[n.length]}function i(t,n){if(t===n)return 1;if(t.length>=3&&n.startsWith(t))return.8;if(n.length>=4&&t.startsWith(n))return.7;if(t.length>=4){if(l(t,n,t.length>=7?2:1)<=(t.length>=7?2:1))return.6}return 0}function s(t,n){let o=0;for(const l of t){let t=0;for(const o of n)if(t=Math.max(t,i(l,o)),1===t)break;o+=t}return o}},1512,[]); __d(function(g,_r,_i,_a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"staffMay",{enumerable:!0,get:function(){return w}}),_e.noMoney=k,Object.defineProperty(_e,"hasMoney",{enumerable:!0,get:function(){return v}}),Object.defineProperty(_e,"moneySafe",{enumerable:!0,get:function(){return S}}),Object.defineProperty(_e,"RISK_LABEL",{enumerable:!0,get:function(){return $}}),Object.defineProperty(_e,"needsConfirm",{enumerable:!0,get:function(){return O}}),Object.defineProperty(_e,"demoOnly",{enumerable:!0,get:function(){return I}}),Object.defineProperty(_e,"PAGES",{enumerable:!0,get:function(){return P}}),Object.defineProperty(_e,"tableName",{enumerable:!0,get:function(){return T}}),Object.defineProperty(_e,"ACTIONS",{enumerable:!0,get:function(){return j}}),Object.defineProperty(_e,"actionById",{enumerable:!0,get:function(){return D}}),_e.toolSpecs=function(){const e=e=>({type:'integer'===e.type?'integer':'string',description:e.description,...e.enum?{enum:e.enum}:{}});return j.map(t=>({type:'function',function:{name:t.id,description:`${t.description} [${$[t.risk]}${O(t.risk)?'; the app asks the manager to confirm':''}]`,parameters:{type:'object',properties:Object.fromEntries(t.params.map(t=>[t.name,e(t)])),required:t.params.filter(e=>e.required).map(e=>e.name)}}}))},_e.runAction=async function(e,t,a,s=!1){const r=D(e);if(!r)return{status:'error',message:`Unknown action ${e}`};if(m.BOOKING_CHANGE_ACTIONS.has(e)&&!(0,b.currentCanChangeBookings)())return{status:'error',message:m.BOOKING_VIEW_ONLY};if(('staff'===a.app||'staff'===a.role)&&!w(r))return{status:'error',message:'That isn\u2019t available in the Staff app. Ask a manager.'};if(r.apps&&a.app&&!r.apps.includes(a.app))return{status:'error',message:'That isn\u2019t available in this app.'};const n=r.params.filter(e=>e.required&&(void 0===t[e.name]||''===t[e.name])).map(e=>e.name);if(n.length)return{status:'error',message:`Missing ${n.join(', ')}`};if(O(r.risk)&&!s)return{status:'needs_confirmation',preview:r.preview(t,a),risk:r.risk};if(I(r.risk)){const e=String(await r.run(t,a));return'send'===r.risk||'pay'===r.risk?(u.useDrafts.getState().add({rid:a.rid,kind:'pay'===r.risk?'payment':'message',title:r.title,lines:[r.preview(t,a)],by:a.who??'Assistant',app:a.app??'owner'}),{status:'demo_only',message:`${e} Saved as a draft for the owner to approve.`}):{status:'demo_only',message:e}}try{const e=String(await r.run(t,a));return{status:'done',message:S(a.app,a.role)?k(e):e}}catch(e){return{status:'error',message:e.message}}},_e.extract=Y,_e.matchIntent=function(e,t,a={}){const s=` ${(e=(0,h.normaliseHeard)(e)).toLowerCase()} `,r=(0,l.tokens)(e),n=/\b(how|where|what|why|can i|help)\b/.test(s);let i=null;const o=a.app??'owner';for(const e of j){if('show_me'===e.id||'open_screen'===e.id)continue;if(e.apps&&!e.apps.includes(o))continue;if('staff'===o&&!w(e))continue;let t=0;if(e.match)t=e.match(s);else for(const a of e.keywords)s.includes(a)&&(t+=a.includes(' ')?2:1);'add_rota_shift'!==e.id||s.includes('shift')||s.includes('rota')||(t=0),'add_walkin'!==e.id||/walk|seat|arriv/.test(s)||(t=0),t>(i?.s??0)&&(i={a:e,s:t})}if(i&&i.s>=1&&(!n||'look'===i.a.risk||i.s>=3))return{kind:'action',action:i.a,params:i.a.parse?i.a.parse(e,{rid:a.rid??'',today:t,app:o,whoId:a.whoId}):Y(e,t),score:i.s};if('owner'!==o){const t=(0,l.searchHelp)(p.HELP,e,3);return t.length?{kind:'help',ids:t.map(e=>e.a.id)}:{kind:'none'}}const d=s.match(/\b(?:open|show|go to|take me to)\s+(.+?)\s*$/);if(d){const e=P.find(e=>e.words.some(e=>d[1].includes(e)));if(e)return{kind:'action',action:D('open_screen'),params:{screen:e.title},score:2}}const u=(0,l.searchHelp)(p.HELP,e,3);return u.length?{kind:'help',ids:u.map(e=>e.a.id)}:(r.length,{kind:'none'})};var e=_r(_d[0]),t=_r(_d[1]),a=_r(_d[2]),s=_r(_d[3]),r=_r(_d[4]),n=_r(_d[5]),i=_r(_d[6]),o=_r(_d[7]),d=_r(_d[8]),p=_r(_d[9]),l=_r(_d[10]),u=_r(_d[11]),c=_r(_d[12]),f=_r(_d[13]),h=_r(_d[14]),m=_r(_d[15]),b=_r(_d[16]);const w=e=>!e.apps||e.apps.includes('staff'),y=/\xa3|\btips?\b|\btronc\b|\btakings\b|\bwages?\b|\bsalar(y|ies)\b|\bpay(slip|roll)?\b|\bsales\b|\brevenue\b|\bdisciplinar|\bsick(ness)? (leave|pay)\b/i;function k(e){const t=e.split(/(?<=[.!?])\s+/).filter(e=>!y.test(e));return t.length?t.join(' '):'That isn\u2019t shown here. Ask a manager in the Managers app.'}const v=e=>y.test(e),S=(e,t)=>'display'===e||'staff'===e||'staff'===t,$={look:'Looks something up',navigate:'Opens a screen',change:'Changes something in the app',draft:'Saves a DRAFT for the owner to approve (nothing is sent or bought)',send:'SENDS to someone',pay:'PAYS money',delete:'DELETES something'},O=e=>'change'===e||'draft'===e||'send'===e||'pay'===e||'delete'===e,I=e=>'send'===e||'pay'===e||'delete'===e,_=e=>(n.useOwner.getState().staff.find(t=>t.id===e)?.name??'someone').replace(' (example)',''),N=e=>{const[t,a,s]=e.split('-').map(Number);return new Date(t,a-1,s).toLocaleDateString('en-GB',{weekday:'short',day:'numeric',month:'short'})},C=e=>{const t=(Math.round(60*e)%1440+1440)%1440;return`${String(Math.floor(t/60)).padStart(2,'0')}:${String(t%60).padStart(2,'0')}`},P=[{page:'lookback',tab:'more',title:'Look back',words:['look back','booking history']},{page:'serviceboard',tab:'more',title:'Restaurant dashboard',words:['restaurant dashboard','dashboard']},{page:'',tab:'bookings',title:'Bookings',words:['bookings','reservations','diary']},{page:'',tab:'orders',title:'Orders',words:['orders','takeaway','tickets']},{page:'rota',tab:'more',title:'Rota',words:['rota','shifts','schedule']},{page:'signoff',tab:'more',title:'Sign off hours',words:['sign off','signoff','approve hours']},{page:'hours',tab:'more',title:'Payroll hours',words:['payroll hours','payroll','hours export']},{page:'tipsday',tab:'more',title:'Tips day',words:['tips day','tips','tronc']},{page:'tableplan',tab:'more',title:'Table plan',words:['table plan','floor plan','layout']},{page:'suppliers',tab:'more',title:'Suppliers',words:['suppliers','supplier']},{page:'recipecards',tab:'more',title:'Recipe cards',words:['recipe cards','recipes']},{page:'displays',tab:'more',title:'Displays',words:['displays','tablets','pairing']},{page:'paysettings',tab:'more',title:'Pay & tips settings',words:['pay settings','pay dates','payday']},{page:'connections',tab:'more',title:'Connected accounts',words:['connected accounts','connections','accounts']},{page:'help',tab:'more',title:'Help & tutorials',words:['help','tutorials']}],A=['owner'],M=['zero','one','two','three','four','five','six','seven','eight','nine','ten','eleven','twelve','thirteen','fourteen','fifteen','sixteen','seventeen','eighteen','nineteen','twenty'],T=e=>{const t=String(e??'').replace(/^table\s+/i,'').trim(),a=M.indexOf(t.toLowerCase());return a>0?String(a):t};function E(e,t){if(!e||null==t||''===t)return'';const s=T(t),r=o.useFloor.getState().live[e]??{},n=Object.keys(r).find(e=>e.toLowerCase()===s.toLowerCase()||e.toLowerCase()===`t${s}`.toLowerCase()),i=n?r[n]:void 0;return i?i.blocked?`. ${(0,a.tableNumbers)(s)} is marked blocked`:i.dirty?`. ${(0,a.tableNumbers)(s)} still needs clearing`:i.stage?`. ${(0,a.tableNumbers)(s)} already has people seated`:'':''}const j=[...e.HISTORY_VOICE_ACTIONS,{id:'open_screen',apps:A,title:'Open a screen',description:'Navigate to a screen of the Managers app.',risk:'navigate',params:[{name:'screen',type:'string',required:!0,description:'Screen to open',enum:P.map(e=>e.title)}],keywords:['open','go to','take me','show','where is'],preview:e=>`Open ${e.screen}`,run:(e,t)=>{const a=P.find(t=>t.title===e.screen);return a?(t.go(a.tab,a.page||null),`Opened ${a.title}.`):'I couldn\u2019t find that screen.'}},{id:'show_me',apps:A,title:'Show me how',description:'Open the screen for a help guide and highlight the control to tap.',risk:'navigate',params:[{name:'guide',type:'string',required:!0,description:'Help article id',enum:p.HELP.filter(e=>e.showMe).map(e=>e.id)}],keywords:['how do i','how to','show me','where do i','help'],preview:e=>`Show me: ${(0,p.helpById)(String(e.guide))?.title??''}`,run:(e,t)=>{const a=(0,p.helpById)(String(e.guide));return a?.showMe?(t.go(a.showMe.tab,a.showMe.page??null),setTimeout(()=>d.useCoach.getState().show(a.showMe.target,a.showMe.hint),250),`Here\u2019s where: ${a.showMe.hint}`):'No guide for that.'}},{id:'add_walkin',title:'Add a walk-in',description:'Seat a walk-in party now, optionally at a table.',risk:'change',form:!0,params:[{name:'covers',type:'integer',required:!0,description:'Number of covers (1\u2013100)'},{name:'table',type:'string',description:'Table name, if known'}],keywords:['walk-in','walkin','walk in','seat','just arrived','no booking'],match:e=>/\bwalk-in\b/.test(e)&&!/\b(fridges?|freezers?|cold room|degrees|temps?|temperatures?|probe|minus|how long|wait|waiting|waitlist|how many|undo|remove|cancel)\b/.test(e)||/\b(seat|sit)\b/.test(e)&&/\b(just arrived|no booking)\b/.test(e)?9:/\b(just arrived|no booking)\b/.test(e)?3:/\b(seat|sit)\b/.test(e)?1:0,parse:e=>{const t={},a=(0,h.walkInCovers)(e);a&&(t.covers=a);const s=(0,h.tableSaid)(e);return s&&(t.table=s),t},preview:(e,t)=>`Seat a walk-in of ${e.covers} cover${1===Number(e.covers)?'':'s'}${e.table?` at table ${T(e.table)}`:' (table to assign)'}${E(t?.rid,e.table)}`,run:async(e,a)=>{const s=Number(e.covers);return(0,t.validParty)(s)?(await i.repo.bookings.seatWalkIn(a.rid,s,e.table?T(e.table):void 0,'Added by Assistant'),`Done: walk-in of ${s} seated${e.table?` at table ${T(e.table)}`:''}. It\u2019s in Bookings now.`):`${t.PARTY_RULE} Say for example \u201cwalk-in of 2 at table 4\u201d.`}},{id:'add_rota_shift',apps:A,title:'Add a rota shift',description:'Add a DRAFT shift for one person (staff see it only after the week is published).',risk:'change',form:!0,params:[{name:'staffId',type:'string',required:!0,description:'Staff member id'},{name:'date',type:'date',required:!0,description:'YYYY-MM-DD'},{name:'start',type:'time',required:!0,description:'Start hour, e.g. 17 or 17.5'},{name:'end',type:'time',required:!0,description:'End hour, e.g. 23'}],keywords:['shift','rota','put','add','schedule','on'],preview:e=>`Add a draft shift: ${_(e.staffId)}, ${e.date?N(String(e.date)):'?'}, ${C(Number(e.start))}\u2013${C(Number(e.end))}`,run:e=>{const t=Number(e.start),a=Number(e.end);if(!(e.staffId&&e.date&&a>t))return'That shift isn\u2019t complete.';const s=(0,n.leaveOn)(n.useOwner.getState().leave,String(e.staffId),String(e.date));return s?`${_(e.staffId)} has time off then (${N(s.from)} to ${N(s.to)}). Add the shift on the Rota yourself if they\u2019ve agreed to work.`:(n.useOwner.getState().addShift({staffId:String(e.staffId),date:String(e.date),start:t,end:a}),`Done: draft shift for ${_(e.staffId)} on ${N(String(e.date))} (${(0,n.weekdayOf)(String(e.date))>=0?'publish the week when ready':''}).`)}},{id:'publish_rota',apps:A,title:'Publish the rota',description:'Make the week\u2019s draft shifts visible to staff (they\u2019re told in the app).',risk:'send',params:[],keywords:['publish','send rota','release rota'],preview:()=>'Publish this week\u2019s rota so staff are notified in the Staff app',run:()=>'Nothing was published or sent. Open the Rota and tap Publish yourself when you\u2019re ready.'},{id:'message_staff',apps:A,title:'Message the team',description:'Post a message to staff chat.',risk:'send',params:[{name:'text',type:'string',required:!0,description:'Message'}],keywords:['message','tell the team','text staff','announce'],preview:e=>`Send to All staff: \u201c${e.text??''}\u201d`,run:()=>'Nothing was sent.'},{id:'pay_tips',apps:A,title:'Pay out tips',description:'Pay each person their tips share.',risk:'pay',params:[],keywords:['pay tips','pay out','transfer','pay staff'],preview:()=>'Pay out this fortnight\u2019s tips',run:()=>'CoverCharge never moves money. Use Tips day to work out the split, then pay through your payroll.'},{id:'remove_shift',apps:A,title:'Remove a shift',description:'Delete a rota shift.',risk:'delete',params:[{name:'staffId',type:'string',description:'Staff member id'},{name:'date',type:'date',description:'YYYY-MM-DD'}],keywords:['remove shift','delete shift','cancel shift','take off'],preview:e=>`Delete ${_(e.staffId)}\u2019s shift${e.date?` on ${N(String(e.date))}`:''}`,run:()=>'Nothing was deleted. Open the Rota and tap the shift to remove it yourself.'},...c.VOICE_ACTIONS,...f.STAFF_VOICE_ACTIONS,...s.OPS_VOICE_ACTIONS,...r.GAP_VOICE_ACTIONS],D=e=>j.find(t=>t.id===e);const L={one:1,two:2,three:3,four:4,five:5,six:6,seven:7,eight:8,nine:9,ten:10,eleven:11,twelve:12},x=['monday','tuesday','wednesday','thursday','friday','saturday','sunday'];function R(e){const t=e.match(/^(\d{1,2})(?::(\d{2}))?\s*(am|pm)?$/);if(!t)return null;let a=Number(t[1]);const s=Number(t[2]??0);return'pm'===t[3]&&a<12&&(a+=12),'am'===t[3]&&12===a&&(a=0),!t[3]&&a>=1&&a<=7&&(a+=12),a>24||s>59?null:a+s/60}function Y(e,t){const a=` ${e.toLowerCase().replace(/\u2019/g,"'")} `,s={},r=a.match(/(?:for|of|party of|x)\s+(\d{1,2}|one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve)\b/)??a.match(/\b(\d{1,2})\s*(?:covers|people|guests|pax|persons)\b/);r&&(s.covers=L[r[1]]??Number(r[1]));const i=a.match(/\btable\s+([a-z]?\d{1,3}[a-z]?)\b/);i&&(s.table=i[1].toUpperCase()),/\btomorrow\b/.test(a)?s.date=(0,n.addDays)(t,1):/\btoday\b|\btonight\b/.test(a)&&(s.date=t);const o=a.match(/\b(\d{1,2})\/(\d{1,2})(?:\/(\d{2,4}))?\b/);if(o){const e=o[3]?2===o[3].length?2e3+Number(o[3]):Number(o[3]):Number(t.slice(0,4));s.date=`${e}-${o[2].padStart(2,'0')}-${o[1].padStart(2,'0')}`}const d=x.findIndex(e=>a.includes(` ${e}`)||a.includes(` ${e.slice(0,3)} `));if(!s.date&&d>=0){const e=(0,n.weekdayOf)(t);s.date=(0,n.addDays)(t,(d-e+7)%7||7)}const p=a.match(/(\d{1,2}(?::\d{2})?\s*(?:am|pm)?)\s*(?:-|\u2013|to|till|until)\s*(\d{1,2}(?::\d{2})?\s*(?:am|pm)?)/);if(p){const e=R(p[1].trim()),t=R(p[2].trim());null!==e&&null!==t&&(s.start=e,s.end=t<=e?t+12:t)}const l=n.useOwner.getState().staff.filter(e=>e.active).find(e=>(0,n.staffCalls)(e).some(e=>e.length>2&&/^[a-z' -]+$/.test(e)&&new RegExp(`\\b${e}\\b`).test(a)));return l&&(s.staffId=l.id),s}},1513,[1514,1096,843,1515,1516,876,858,996,1458,1511,1512,1518,1517,1520,1521,994,995]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"HISTORY_VOICE_ACTIONS",{enumerable:!0,get:function(){return t}});var o=r(d[0]);const t=[{id:'look_back_bookings',title:'Look back at bookings',apps:['owner'],risk:'look',description:'Read booking times, party sizes, recorded tables and Booked covers for one exact past date. Incomplete supplementary previous booking system history; text only.',params:[{name:'date',type:'date',required:!0,description:'Exact past date YYYY-MM-DD, with explicitly supplied four-digit year'}],keywords:['look back','booked covers','historical bookings'],match:o=>/\b(open|go to)\s+(?:the\s+)?look back\b/.test(o)&&!/\b\d{4}\b/.test(o)?0:/\b(look back|booked covers|historical bookings)\b/.test(o)||/\b(bookings|reservations|covers)\b/.test(o)&&/\b\d{4}\b/.test(o)&&!/\b(add|create|new|book a|reserve|move|change|cancel)\b/.test(o)?10:0,parse:(t,s)=>({date:(0,o.exactHistoryDate)(t,s.today)}),preview:o=>`Look up Booked covers and bookings for ${o.date??'an exact past date'}`,run:async(t,s)=>{const n=(0,o.exactHistoryDate)(String(t.date??''),s.today);if(!n)return'Give an exact past date with day, month and four-digit year, for example 5 November 2025.';const{lookupBookingDay:c}=await r(d[2])(d[1],d.paths);return(0,o.bookingDayText)(await c(s.rid,n))}}]},1514,[1062,1061,1021]); diff --git a/owner-app/admin.html b/owner-app/admin.html index 6147dcaa8029a13b83ebe122383e8cb13f7c4ae0..68d3d961b8f889501af7c0c36a856ff5439e3974 100644 --- a/owner-app/admin.html +++ b/owner-app/admin.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/owner-app/customer.html b/owner-app/customer.html index 6147dcaa8029a13b83ebe122383e8cb13f7c4ae0..68d3d961b8f889501af7c0c36a856ff5439e3974 100644 --- a/owner-app/customer.html +++ b/owner-app/customer.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/owner-app/customer/anchorage.html b/owner-app/customer/anchorage.html index 6147dcaa8029a13b83ebe122383e8cb13f7c4ae0..68d3d961b8f889501af7c0c36a856ff5439e3974 100644 --- a/owner-app/customer/anchorage.html +++ b/owner-app/customer/anchorage.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/owner-app/customer/anchorage/book.html b/owner-app/customer/anchorage/book.html index 6147dcaa8029a13b83ebe122383e8cb13f7c4ae0..68d3d961b8f889501af7c0c36a856ff5439e3974 100644 --- a/owner-app/customer/anchorage/book.html +++ b/owner-app/customer/anchorage/book.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/owner-app/customer/anchorage/feedback.html b/owner-app/customer/anchorage/feedback.html index 6147dcaa8029a13b83ebe122383e8cb13f7c4ae0..68d3d961b8f889501af7c0c36a856ff5439e3974 100644 --- a/owner-app/customer/anchorage/feedback.html +++ b/owner-app/customer/anchorage/feedback.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/owner-app/customer/anchorage/gift.html b/owner-app/customer/anchorage/gift.html index 6147dcaa8029a13b83ebe122383e8cb13f7c4ae0..68d3d961b8f889501af7c0c36a856ff5439e3974 100644 --- a/owner-app/customer/anchorage/gift.html +++ b/owner-app/customer/anchorage/gift.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/owner-app/customer/anchorage/lost.html b/owner-app/customer/anchorage/lost.html index 6147dcaa8029a13b83ebe122383e8cb13f7c4ae0..68d3d961b8f889501af7c0c36a856ff5439e3974 100644 --- a/owner-app/customer/anchorage/lost.html +++ b/owner-app/customer/anchorage/lost.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/owner-app/customer/anchorage/loyalty.html b/owner-app/customer/anchorage/loyalty.html index 6147dcaa8029a13b83ebe122383e8cb13f7c4ae0..68d3d961b8f889501af7c0c36a856ff5439e3974 100644 --- a/owner-app/customer/anchorage/loyalty.html +++ b/owner-app/customer/anchorage/loyalty.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/owner-app/customer/anchorage/merch.html b/owner-app/customer/anchorage/merch.html index 6147dcaa8029a13b83ebe122383e8cb13f7c4ae0..68d3d961b8f889501af7c0c36a856ff5439e3974 100644 --- a/owner-app/customer/anchorage/merch.html +++ b/owner-app/customer/anchorage/merch.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/owner-app/customer/anchorage/offers.html b/owner-app/customer/anchorage/offers.html index 6147dcaa8029a13b83ebe122383e8cb13f7c4ae0..68d3d961b8f889501af7c0c36a856ff5439e3974 100644 --- a/owner-app/customer/anchorage/offers.html +++ b/owner-app/customer/anchorage/offers.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/owner-app/customer/anchorage/refer.html b/owner-app/customer/anchorage/refer.html index 6147dcaa8029a13b83ebe122383e8cb13f7c4ae0..68d3d961b8f889501af7c0c36a856ff5439e3974 100644 --- a/owner-app/customer/anchorage/refer.html +++ b/owner-app/customer/anchorage/refer.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/owner-app/customer/anchorage/waitlist.html b/owner-app/customer/anchorage/waitlist.html index 6147dcaa8029a13b83ebe122383e8cb13f7c4ae0..68d3d961b8f889501af7c0c36a856ff5439e3974 100644 --- a/owner-app/customer/anchorage/waitlist.html +++ b/owner-app/customer/anchorage/waitlist.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/owner-app/customer/anchorage/whatson.html b/owner-app/customer/anchorage/whatson.html index 6147dcaa8029a13b83ebe122383e8cb13f7c4ae0..68d3d961b8f889501af7c0c36a856ff5439e3974 100644 --- a/owner-app/customer/anchorage/whatson.html +++ b/owner-app/customer/anchorage/whatson.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/owner-app/customer/basket.html b/owner-app/customer/basket.html index 6147dcaa8029a13b83ebe122383e8cb13f7c4ae0..68d3d961b8f889501af7c0c36a856ff5439e3974 100644 --- a/owner-app/customer/basket.html +++ b/owner-app/customer/basket.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/owner-app/customer/profile.html b/owner-app/customer/profile.html index 6147dcaa8029a13b83ebe122383e8cb13f7c4ae0..68d3d961b8f889501af7c0c36a856ff5439e3974 100644 --- a/owner-app/customer/profile.html +++ b/owner-app/customer/profile.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/owner-app/demo.html b/owner-app/demo.html index 6147dcaa8029a13b83ebe122383e8cb13f7c4ae0..68d3d961b8f889501af7c0c36a856ff5439e3974 100644 --- a/owner-app/demo.html +++ b/owner-app/demo.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/owner-app/display.html b/owner-app/display.html index 6147dcaa8029a13b83ebe122383e8cb13f7c4ae0..68d3d961b8f889501af7c0c36a856ff5439e3974 100644 --- a/owner-app/display.html +++ b/owner-app/display.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/owner-app/index.html b/owner-app/index.html index df8856c0b4c69ad16957f6459cb2217e91910d0c..07e4397aeb045a12a736539c0d4f8ed54d0e1d0c 100644 --- a/owner-app/index.html +++ b/owner-app/index.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/owner-app/kitchen.html b/owner-app/kitchen.html index 6147dcaa8029a13b83ebe122383e8cb13f7c4ae0..68d3d961b8f889501af7c0c36a856ff5439e3974 100644 --- a/owner-app/kitchen.html +++ b/owner-app/kitchen.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/owner-app/owner.html b/owner-app/owner.html index 6147dcaa8029a13b83ebe122383e8cb13f7c4ae0..68d3d961b8f889501af7c0c36a856ff5439e3974 100644 --- a/owner-app/owner.html +++ b/owner-app/owner.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/owner-app/staff.html b/owner-app/staff.html index 6147dcaa8029a13b83ebe122383e8cb13f7c4ae0..68d3d961b8f889501af7c0c36a856ff5439e3974 100644 --- a/owner-app/staff.html +++ b/owner-app/staff.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/owner-app/sw.js b/owner-app/sw.js index c130ec3a65f38e96cd2666c1dfbad1e0a28e84a5..3dfa9a39058fbb7b6027651578e8a6eb92050a2e 100644 --- a/owner-app/sw.js +++ b/owner-app/sw.js @@ -1,7 +1,7 @@ // Anchorage Manager service worker: precache the app shell so it opens offline after the first visit. -const V = "cc-owner-f47503eb08"; +const V = "cc-owner-6784095b81"; const BASE = "/owner-app/"; -const PRECACHE = ["/owner-app/apple-touch-icon.png", "/owner-app/assets/assets/brand/anchorage-hero.0450b828e4f9c1f4456240096598f6f5.png", "/owner-app/assets/assets/brand/anchorage.fea5ce2f6fd18bf2950aa21c0980ed8e.png", "/owner-app/assets/assets/recipes/fishsupper.1609c58319e1e8721f5c639049fb054e.jpg", "/owner-app/assets/assets/recipes/lobster.2fb3485c8e372972099259017358c1b8.jpg", "/owner-app/assets/assets/recipes/moules.a4f342fc7e7fb62c8a0b5c1678bbea3f.jpg", "/owner-app/assets/assets/recipes/skink.4ce7b7c676f9cdcd0a060eda46f5a00e.jpg", "/owner-app/assets/assets/recipes/stp.1061ced765efdcafff2554adc3fc7113.jpg", "/owner-app/assets/assets/specials/sample-chalkboard.e7b4e4450a8483d4219bc6a214158d8f.jpg", "/owner-app/assets/node_modules/@expo-google-fonts/poppins/400Regular/Poppins_400Regular.093ee89be9ede30383f39a899c485a82.ttf", "/owner-app/assets/node_modules/@expo-google-fonts/poppins/500Medium/Poppins_500Medium.bf59c687bc6d3a70204d3944082c5cc0.ttf", "/owner-app/assets/node_modules/@expo-google-fonts/poppins/600SemiBold/Poppins_600SemiBold.6f1520d107205975713ba09df778f93f.ttf", "/owner-app/assets/node_modules/@expo-google-fonts/poppins/700Bold/Poppins_700Bold.08c20a487911694291bd8c5de41315ad.ttf", "/owner-app/assets/node_modules/expo-router/assets/arrow_down.017bc6ba3fc25503e5eb5e53826d48a8.png", "/owner-app/assets/node_modules/expo-router/assets/error.d1ea1496f9057eb392d5bbf3732a61b7.png", "/owner-app/assets/node_modules/expo-router/assets/file.19eeb73b9593a38f8e9f418337fc7d10.png", "/owner-app/assets/node_modules/expo-router/assets/forward.d8b800c443b8972542883e0b9de2bdc6.png", "/owner-app/assets/node_modules/expo-router/assets/pkg.ab19f4cbc543357183a20571f68380a3.png", "/owner-app/assets/node_modules/expo-router/assets/react-navigation/elements/back-icon-mask.0a328cd9c1afd0afe8e3b1ec5165b1b4.png", "/owner-app/assets/node_modules/expo-router/assets/react-navigation/elements/back-icon.35ba0eaec5a4f5ed12ca16fabeae451d.png", "/owner-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55.png", "/owner-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@2x.png", "/owner-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@3x.png", "/owner-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@4x.png", "/owner-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7.png", "/owner-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@2x.png", "/owner-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@3x.png", "/owner-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@4x.png", "/owner-app/assets/node_modules/expo-router/assets/react-navigation/elements/search-icon.286d67d3f74808a60a78d3ebf1a5fb57.png", "/owner-app/assets/node_modules/expo-router/assets/sitemap.412dd9275b6b48ad28f5e3d81bb1f626.png", "/owner-app/assets/node_modules/expo-router/assets/unmatched.20e71bdf79e3a97bf55fd9e164041578.png", "/owner-app/brand-logo.png", "/owner-app/favicon.ico", "/owner-app/icon-192.png", "/owner-app/icon-512.png", "/owner-app/icon-maskable-192.png", "/owner-app/icon-maskable-512.png", "/owner-app/manifest.webmanifest", "/owner-app/index.html", "/owner-app/_expo/static/js/web/bundle.js?v=f47503eb08a07481453341615072d82596222a9d673735a4a4baa24296bf8869"]; +const PRECACHE = ["/owner-app/apple-touch-icon.png", "/owner-app/assets/assets/brand/anchorage-hero.0450b828e4f9c1f4456240096598f6f5.png", "/owner-app/assets/assets/brand/anchorage.fea5ce2f6fd18bf2950aa21c0980ed8e.png", "/owner-app/assets/assets/recipes/fishsupper.1609c58319e1e8721f5c639049fb054e.jpg", "/owner-app/assets/assets/recipes/lobster.2fb3485c8e372972099259017358c1b8.jpg", "/owner-app/assets/assets/recipes/moules.a4f342fc7e7fb62c8a0b5c1678bbea3f.jpg", "/owner-app/assets/assets/recipes/skink.4ce7b7c676f9cdcd0a060eda46f5a00e.jpg", "/owner-app/assets/assets/recipes/stp.1061ced765efdcafff2554adc3fc7113.jpg", "/owner-app/assets/assets/specials/sample-chalkboard.e7b4e4450a8483d4219bc6a214158d8f.jpg", "/owner-app/assets/node_modules/@expo-google-fonts/poppins/400Regular/Poppins_400Regular.093ee89be9ede30383f39a899c485a82.ttf", "/owner-app/assets/node_modules/@expo-google-fonts/poppins/500Medium/Poppins_500Medium.bf59c687bc6d3a70204d3944082c5cc0.ttf", "/owner-app/assets/node_modules/@expo-google-fonts/poppins/600SemiBold/Poppins_600SemiBold.6f1520d107205975713ba09df778f93f.ttf", "/owner-app/assets/node_modules/@expo-google-fonts/poppins/700Bold/Poppins_700Bold.08c20a487911694291bd8c5de41315ad.ttf", "/owner-app/assets/node_modules/expo-router/assets/arrow_down.017bc6ba3fc25503e5eb5e53826d48a8.png", "/owner-app/assets/node_modules/expo-router/assets/error.d1ea1496f9057eb392d5bbf3732a61b7.png", "/owner-app/assets/node_modules/expo-router/assets/file.19eeb73b9593a38f8e9f418337fc7d10.png", "/owner-app/assets/node_modules/expo-router/assets/forward.d8b800c443b8972542883e0b9de2bdc6.png", "/owner-app/assets/node_modules/expo-router/assets/pkg.ab19f4cbc543357183a20571f68380a3.png", "/owner-app/assets/node_modules/expo-router/assets/react-navigation/elements/back-icon-mask.0a328cd9c1afd0afe8e3b1ec5165b1b4.png", "/owner-app/assets/node_modules/expo-router/assets/react-navigation/elements/back-icon.35ba0eaec5a4f5ed12ca16fabeae451d.png", "/owner-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55.png", "/owner-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@2x.png", "/owner-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@3x.png", "/owner-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@4x.png", "/owner-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7.png", "/owner-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@2x.png", "/owner-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@3x.png", "/owner-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@4x.png", "/owner-app/assets/node_modules/expo-router/assets/react-navigation/elements/search-icon.286d67d3f74808a60a78d3ebf1a5fb57.png", "/owner-app/assets/node_modules/expo-router/assets/sitemap.412dd9275b6b48ad28f5e3d81bb1f626.png", "/owner-app/assets/node_modules/expo-router/assets/unmatched.20e71bdf79e3a97bf55fd9e164041578.png", "/owner-app/brand-logo.png", "/owner-app/favicon.ico", "/owner-app/icon-192.png", "/owner-app/icon-512.png", "/owner-app/icon-maskable-192.png", "/owner-app/icon-maskable-512.png", "/owner-app/manifest.webmanifest", "/owner-app/index.html", "/owner-app/_expo/static/js/web/bundle.js?v=6784095b8184e4ccd6fefec68caa53a4a9e2b9713d32b98fb28b151118ef6723"]; // Hugging Face serves large files (fonts) through a redirect to its CDN. Browsers refuse to hand a *redirected* cached // response to a page, so store a plain copy instead (otherwise fonts, and so the app, fail to load offline). const plain = r => r.redirected ? r.blob().then(b => new Response(b, { status: 200, headers: { 'Content-Type': r.headers.get('Content-Type') || b.type || 'application/octet-stream' } })) : Promise.resolve(r); diff --git a/owner-app/team.html b/owner-app/team.html index 6147dcaa8029a13b83ebe122383e8cb13f7c4ae0..68d3d961b8f889501af7c0c36a856ff5439e3974 100644 --- a/owner-app/team.html +++ b/owner-app/team.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/owner-desktop/_expo/static/js/web/bundle.js b/owner-desktop/_expo/static/js/web/bundle.js index 1fbd705e07dfdecf3b628d5a1699e41d0ce4cc1b..cd69c003053e774c54c31aa3df091197988e74e6 100644 --- a/owner-desktop/_expo/static/js/web/bundle.js +++ b/owner-desktop/_expo/static/js/web/bundle.js @@ -921,7 +921,7 @@ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{v __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"ANCHORAGE_PAY",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"ANCHORAGE_KITCHEN",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"ANCHORAGE_KITCHEN_OLD",{enumerable:!0,get:function(){return u}}),Object.defineProperty(e,"restaurants",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"demoMenus",{enumerable:!0,get:function(){return l}});var t=r(d[0]);const n={slotMinutes:15,slotCap:3,bufferMins:5,leadMins:20,takeawayPaused:!1,bookingCoversPerSlot:20,bookingSlotMinutes:15,deposit:{...r(d[1]).DEPOSIT_DEFAULT},stampTarget:8,stampReward:'Free dessert',stampMinSpend:1e3,capacityPerHour:48,walkInShare:.35,turnMins:75,orderAtTable:!0},o={tipsFrequency:'fortnightly',tipsAnchorPayday:'2026-11-02',tipsEndsDaysBefore:1,wagePayDay:28,wageCutoffDay:23,weekendRule:'none'},s={0:['12:30','19:00'],1:null,2:null,3:['12:00','19:00'],4:['12:00','19:00'],5:['12:00','20:00'],6:['12:00','20:00']},u={0:['12:30','20:00'],1:null,2:null,3:['12:00','19:00'],4:['12:00','19:00'],5:['12:00','20:30'],6:['12:00','20:30']},c=[{id:'anchorage',name:'The Anchorage',tagline:'Harbourside seafood & Scottish produce',location:'Harbour View, Dunure, South Ayrshire',fictional:!1,phone:'01292 502826',website:'anchoragedunure.com',kitchenHours:s,hoursNote:'Kitchen (food) hours from Gordon, 30 Oct 2026: closed Mon\u2013Tue. The closing time is last food orders. Bar hours not set.',settings:{...n,orderAtTable:!1,pay:o,cashUpRecord:[...t.ANCHORAGE_CASH_UP],bookingCoversPerStart:15,bookingPartiesPerStart:4,onlinePartyMin:1,onlinePartyMax:8,bookingNoticeMins:15,autoAcceptUpTo:8},sections:[]}],l=[]},838,[839,841]); __d(function(g,_r,_i,_a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"TAKINGS_FIELDS",{enumerable:!0,get:function(){return t}}),Object.defineProperty(_e,"NO_SERVICE_SPLIT",{enumerable:!0,get:function(){return n}}),Object.defineProperty(_e,"TAKINGS_KEYS",{enumerable:!0,get:function(){return r}}),_e.withTakingsFields=function(e){e=e.filter(e=>!n.includes(e.key));const r=new Set(e.map(e=>e.key)),o=t.filter(e=>!r.has(e.key)).map(e=>({...e}));if(!o.length)return e;const a=e.findIndex(e=>'cash'===e.key),i=a<0?e.length:a+1;return[...e.slice(0,i),...o,...e.slice(i)]},Object.defineProperty(_e,"grossOf",{enumerable:!0,get:function(){return o}}),Object.defineProperty(_e,"ANCHORAGE_CASH_UP",{enumerable:!0,get:function(){return a}}),_e.cashFieldsForRecord=function(e,t){if(!t?.length)return e;const n=new Set,r=[];for(const o of t){const t=i[o],a=t?.key??`cu-${o.toLowerCase().replace(/[^a-z0-9]+/g,'-').replace(/^-|-$/g,'')||'figure'}`,l=e.find(e=>e.key===a);r.push({...l,...t??{kind:'money'},key:a,label:o}),n.add(a)}return[...r,...e.filter(e=>!n.has(e.key))]},Object.defineProperty(_e,"DEFAULT_CASHUP_FIELDS",{enumerable:!0,get:function(){return l}}),Object.defineProperty(_e,"DEFAULT_SALES_FIELDS",{enumerable:!0,get:function(){return u}}),_e.parseAmount=function(t,n="money"){if('number'===n){const e=t.replace(/[\xa3\s]/g,'');return/^\d{1,6}$/.test(e)?Number(e):null}return(0,e.parseMoneyInput)(t)},Object.defineProperty(_e,"isBlank",{enumerable:!0,get:function(){return s}}),Object.defineProperty(_e,"ymdUTC",{enumerable:!0,get:function(){return c}}),Object.defineProperty(_e,"addDaysYmd",{enumerable:!0,get:function(){return y}}),_e.weekStartOf=function(e){const t=(d(e).getUTCDay()+6)%7;return y(e,-t)},_e.combinedTips=function(e){const t='number'==typeof e.cashTips?e.cashTips:null,n='number'==typeof e.cardTips?e.cardTips:null;return null==t&&null==n?null:Math.round(100*((t??0)+(n??0)))/100},Object.defineProperty(_e,"takings",{enumerable:!0,get:function(){return f}}),Object.defineProperty(_e,"missing",{enumerable:!0,get:function(){return m}}),_e.dailySeries=function(e,t,n,r=f){const o=new Map(e.filter(e=>e.confirmedAt).map(e=>[e.date,e]));return Array.from({length:n},(e,a)=>{const i=y(t,a-n+1),l=o.get(i);return{date:i,value:l?r(l.vals):null}})},_e.weekCompare=function(e,t,n="net"){const r=t=>{const r=e.find(e=>e.weekStart===t&&e.confirmedAt),o=r?.vals[n];return'number'==typeof o?o:null},o=r(t),a=r(y(t,-7)),i=null!=o&&null!=a&&0!==a?Math.round((o-a)/a*1e3)/10:null;return{now:o,prev:a,change:i}},_e.tipsPot=function(e,t,n,r){const o=t.filter(e=>'payout'===e.kind&&e.throughDate).sort((e,t)=>e.at.localeCompare(t.at)),a=o[o.length-1],i=a?y(a.throughDate,1):n,l=e.filter(e=>e.date>=i&&e.date<=r).sort((e,t)=>e.date.localeCompare(t.date)),u=t.filter(e=>'correction'===e.kind&&e.forDate&&e.forDate>=i&&e.forDate<=r&&(!a||e.at>a.at)),s=Math.round(100*(l.reduce((e,t)=>e+t.total,0)+u.reduce((e,t)=>e+t.amount,0)))/100;return{from:i,total:Math.max(0,s),days:l,corrections:u,lastPayout:a??null,history:o.slice().reverse()}},_e.shareByHours=function(e,t,n){return e>0&&t>0&&n>0?Math.round(e*(t/n)*100)/100:0},_e.cashLocked=function(e,t=Date.now()){return!(!e.onServer||!e.confirmedAt)&&!(e.unlockedUntil&&Date.parse(e.unlockedUntil)>t)},_e.changedFields=function(e,t){const n=e??{},r=t??{},o=[],a=n.vals??{},i=r.vals??{};for(const e of new Set([...Object.keys(a),...Object.keys(i)]))JSON.stringify(a[e])!==JSON.stringify(i[e])&&o.push(e);JSON.stringify(n.categories??null)!==JSON.stringify(r.categories??null)&&(n.categories||r.categories)&&o.push('categories');JSON.stringify(n.photos??[])!==JSON.stringify(r.photos??[])&&e&&t&&o.push('photos');return o},Object.defineProperty(_e,"dayTakingsOf",{enumerable:!0,get:function(){return p}}),Object.defineProperty(_e,"daysInMonth",{enumerable:!0,get:function(){return k}}),_e.addMonths=b,Object.defineProperty(_e,"monthName",{enumerable:!0,get:function(){return O}}),Object.defineProperty(_e,"shortDay",{enumerable:!0,get:function(){return C}}),Object.defineProperty(_e,"longDay",{enumerable:!0,get:function(){return D}}),_e.poundsWhole=function(e){const t=e<0,n=String(Math.round(Math.abs(e))).replace(/\B(?=(\d{3})+(?!\d))/g,',');return`${t?'-':''}\xa3${n}`},_e.monthTakings=function(e,t,n,r){const o=new Map;for(const n of e){if(n.rid!==t)continue;const e=p(n);null!=e&&o.set(n.date,e)}const a=Number(n.slice(0,4)),i=Number(n.slice(5,7)),l=k(a,i),u=Array.from({length:l},(e,t)=>{const a=`${n}-${String(t+1).padStart(2,'0')}`,i=o.get(a),l=null!=i&&a<=r?'recorded':a>r?'future':a===r?'pending':'missing';return{date:a,day:t+1,value:'recorded'===l?i:null,state:l}}),s=u.filter(e=>'recorded'===e.state),c=Math.round(100*s.reduce((e,t)=>e+(t.value??0),0))/100,d=s.reduce((e,t)=>!e||t.value>e.value?{date:t.date,value:t.value}:e,null),y=r.slice(0,7)===n,f=n0?Math.round((c-T)/T*100):null;return{ym:n,month:O(n),days:u,total:c,recorded:s.length,current:y,past:f,best:d,vsPct:D}},Object.defineProperty(_e,"firstTakingsMonth",{enumerable:!0,get:function(){return P}}),_e.canSeeMonthTakings=function(e,t,n={}){return!n.inStaffApp&&'owner'===e&&(t?'owner'===t.role||!0===t.ownerAccess:!n.live)},_e.ownerHomeLayout=function(e,t,n=!1){return!n&&'owner'===e&&(!t||'owner'===t.role||!0===t.ownerAccess)};var e=_r(_d[0]);const t=[{key:'gross',label:'Gross takings',kind:'money',fixed:!0,optional:!0},{key:'food',label:'Food takings (optional)',kind:'money',fixed:!0,optional:!0},{key:'drink',label:'Drink takings (optional)',kind:'money',fixed:!0,optional:!0}],n=['lunchGross','dinnerGross'],r=t.map(e=>e.key);const o=e=>'number'==typeof e.gross?e.gross:null,a=['Z total','Card total','Cash total','Paid out','Card tips','Cash tips'],i={'Z total':{key:'zTotal',kind:'money'},'Card total':{key:'card',kind:'money'},'Cash total':{key:'cash',kind:'money'},'Paid out':{key:'paidOut',kind:'money',optional:!0},'Card tips':{key:'cardTips',kind:'money',fixed:!0},'Cash tips':{key:'cashTips',kind:'money',fixed:!0}};const l=[{key:'card',label:'Card takings',kind:'money'},{key:'cash',label:'Cash takings',kind:'money'},{key:'paidOut',label:'Paid out',kind:'money',fixed:!0,optional:!0},...t,{key:'float',label:'Float (tills)',kind:'money'},{key:'cashTips',label:'Cash tips total',kind:'money',fixed:!0},{key:'cardTips',label:'Card tips total',kind:'money',fixed:!0},{key:'overUnder',label:'Over / under (discrepancy)',kind:'money'},{key:'notes',label:'Notes',kind:'text'}],u=[{key:'gross',label:'Gross sales',kind:'money'},{key:'net',label:'Net sales',kind:'money',fixed:!0},{key:'vat',label:'VAT',kind:'money'},{key:'covers',label:'Covers',kind:'number'},{key:'discounts',label:'Discounts',kind:'money'},{key:'refunds',label:'Refunds',kind:'money'}];const s=e=>null==e||''===e,c=e=>e.toISOString().slice(0,10),d=e=>new Date(`${e}T12:00:00Z`),y=(e,t)=>{const n=d(e);return n.setUTCDate(n.getUTCDate()+t),c(n)};const f=e=>{const t='number'==typeof e.card?e.card:null,n='number'==typeof e.cash?e.cash:null;return null==t&&null==n?null:(t??0)+(n??0)},m=(e,t)=>e.filter(e=>'text'!==e.kind&&!e.optional&&s(t[e.key])).map(e=>e.key);const p=e=>e.confirmedAt?o(e.vals)??f(e.vals):null,k=(e,t)=>new Date(Date.UTC(e,t,0)).getUTCDate();function b(e,t){const n=Number(e.slice(0,4)),r=Number(e.slice(5,7))-1+t;return`${n+Math.floor(r/12)}-${String((r%12+12)%12+1).padStart(2,'0')}`}const h=['January','February','March','April','May','June','July','August','September','October','November','December'],S=['Sun','Mon','Tue','Wed','Thu','Fri','Sat'],T=['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'],O=e=>h[Number(e.slice(5,7))-1]??'',C=e=>{const t=d(e);return`${S[t.getUTCDay()]} ${t.getUTCDate()} ${h[t.getUTCMonth()].slice(0,3)}`},D=e=>{const t=d(e);return`${T[t.getUTCDay()]} ${t.getUTCDate()} ${h[t.getUTCMonth()]}`};const P=(e,t)=>e.filter(e=>e.rid===t&&null!=p(e)).map(e=>e.date.slice(0,7)).sort()[0]??null},839,[840]); __d(function(g,r,_i,_a,m,e,d){"use strict";function t(t,n){const i=!(!n?.allowMinus||!String(t??'').trim().startsWith('-'));let s=String(t??'').replace(/,/g,'.');s=s.replace(/[^\d.]/g,'');const l=s.indexOf('.');if(l>=0){s=s.slice(0,l+1)+s.slice(l+1).replace(/\./g,'');const[t,n=""]=s.split('.');s=t+'.'+n.slice(0,2)}return(i?'-':'')+s}Object.defineProperty(e,'__esModule',{value:!0}),e.sanitiseMoneyTyping=t,e.parseMoneyInput=function(n){const i=String(n??''),s=i.trim().startsWith('-'),l=i.trim().replace(/^\xa3/,'').replace(/\xa3/g,'').replace(/\s/g,'').replace(/^-/,'');if(l&&/[^\d.,]/.test(l))return null;const c=t(n);if(!c||'.'===c)return null;if(!/^\d+(\.\d{0,2})?$/.test(c))return null;const u=Math.round(100*Number(c))/100;return Number.isFinite(u)?s?-u:u:null},Object.defineProperty(e,"onMoneyChange",{enumerable:!0,get:function(){return n}});const n=n=>i=>n(t(i))},840,[]); -__d(function(g,r,i,a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"DEPOSIT_DEFAULT",{enumerable:!0,get:function(){return e}}),_e.depositOf=function(t){const n=t?.deposit;return n&&'object'==typeof n?{on:n.on??e.on,...!0===n.needsConfirmation?{needsConfirmation:!0}:{},perPersonPence:Number.isFinite(n.perPersonPence)?Math.max(0,Math.round(n.perPersonPence)):n.needsConfirmation?0:e.perPersonPence,fromParty:Number.isFinite(n.fromParty)?Math.max(1,Math.round(n.fromParty)):n.needsConfirmation?1:e.fromParty,refundable:'boolean'==typeof n.refundable?n.refundable:null,cutoffHours:Number.isFinite(n.cutoffHours)?Math.max(0,Math.round(n.cutoffHours)):null,policy:'string'==typeof n.policy?n.policy.slice(0,600):'',wixLinksOn:!0===n.wixLinksOn,wixLinkHours:Number.isFinite(n.wixLinkHours)?Math.max(1,Math.min(168,Math.round(n.wixLinkHours))):48}:{...e}},_e.childrenIn=t,Object.defineProperty(_e,"adultsIn",{enumerable:!0,get:function(){return n}}),_e.depositDue=o,_e.depositWords=function(e,d,u,p=0){if(e.needsConfirmation&&!e.on)return[e.policy.trim()||'Deposit policy awaiting venue confirmation.'];if(e.needsConfirmation)return['Table deposit policy not set yet. Ticketed event deposits are separate and are not a table policy.'];const l=o(e,d,p);if(!l)return[];const c=[t(d,p)?`A deposit of ${s(l)} (${s(e.perPersonPence)} for each of the ${n(d,p)} adults; children are free) is needed for ${e.fromParty} or more guests.`:`A deposit of ${s(l)} (${s(e.perPersonPence)} per adult; children are free) is needed for ${e.fromParty} or more guests.`];!0===e.refundable?c.push(e.cutoffHours?`Refundable if you cancel at least ${e.cutoffHours} hours before your booking.`:'Refundable if you cancel.'):!1===e.refundable?c.push('The deposit is not refundable.'):c.push(`Ask ${u} about refunds.`);e.policy.trim()&&c.push(e.policy.trim());return c.push(e.wixLinksOn?`${u} will send you a link to pay the deposit securely through website bookings.`:`No payment is taken in the app yet: ${u} will tell you how to pay the deposit.`),c},_e.waiverOf=d,_e.depositState=u,_e.waiverText=p,_e.canWaiveDeposit=function(e){if(['cancelled','finished','noshow','declined'].includes(e.status??''))return!1;const t=l(e);return'PAID'!==t&&'FULLY_REFUNDED'!==t&&'PARTIALLY_REFUNDED'!==t&&'FREE'!==t&&('paid'!==e.depositLink?.state&&('NOT_PAID'===t||'PARTIALLY_PAID'===t?!d(e):'due'===u(e)))},_e.wixPayStatus=l,_e.knownPaid=c,_e.fromWixOrder=f,_e.estimatedWix=b,_e.depositBadge=m,_e.canTickDeposit=function(e){if(d(e))return!1;const t=l(e);return'NOT_PAID'!==t&&'PAID'!==t&&'FULLY_REFUNDED'!==t&&'PARTIALLY_REFUNDED'!==t&&('paid'!==e.depositLink?.state&&'due'===u(e))},_e.canSendDepositLink=function(e,t){return!(!t.wixLinksOn||l(e)||d(e))&&(!e.walkIn&&!['cancelled','finished','noshow','declined'].includes(e.status??'')&&('due'===u(e)&&'paid'!==e.depositLink?.state))},_e.depositTerms=function(e){const t=[];!0===e.refundable?t.push(e.cutoffHours?`The deposit is refundable if you cancel at least ${e.cutoffHours} hours before.`:'The deposit is refundable if you cancel.'):!1===e.refundable&&t.push('The deposit is not refundable.');e.policy.trim()&&t.push(e.policy.trim());return t.join(' ')},_e.depositLinkMessage=function(e){const t=(e.name||'').trim().split(/\s+/)[0]||'there',[n,o,d]=e.date.split('-').map(Number),u=new Date(n,(o||1)-1,d||1).toLocaleDateString('en-GB',{weekday:'long',day:'numeric',month:'long'}),p=e.expiresAt?new Date(e.expiresAt).toLocaleString('en-GB',{timeZone:'Europe/London',weekday:'long',day:'numeric',month:'long',hour:'numeric',minute:'2-digit',hourCycle:'h12'}).replace(/\s?(am|pm)$/i,e=>e.trim().toLowerCase()):'',l=[`Hello ${t}, thank you for booking ${e.venue} for ${e.partySize} on ${u} at ${e.time.slice(0,5)}.`,`To hold your table, please pay the ${s(e.amountPence)} deposit here: ${e.url}`];p&&l.push(`The link works until ${p}.`);e.terms?.trim()&&l.push(e.terms.trim());return l.push(`Thank you, ${e.venue}`),l.join('\n')},_e.depositView=D,_e.depositShort=function(e){const t=D(e,!1);return t?t.a11y.split(',')[0]:null};const e={on:!0,perPersonPence:1e3,fromParty:6,refundable:null,cutoffHours:null,policy:''};function t(e,t){const n=Math.max(0,Math.round(Number(e)||0)),o=Math.round(Number(t)||0);return Math.max(0,Math.min(n,o))}const n=(e,n)=>Math.max(0,Math.round(Number(e)||0)-t(e,n));function o(e,t,o=0){return!e.on||e.perPersonPence<=0||t`\xa3${(e/100).toFixed(e%100?2:0)}`;function d(e){const t=e.depositWaived;return t&&'object'==typeof t&&'string'==typeof t.by&&t.by?t:null}function u(e){if('deposit'!==e.security)return'none';const t=e.depositDue??e.depositPaid??0;return t?(e.depositPaid??0)>=t?'paid':d(e)?'waived':'due':'none'}function p(e){const t=new Date(e.at),n=!Number.isNaN(t.getTime())?t.toLocaleString('en-GB',{timeZone:'Europe/London',day:'2-digit',month:'2-digit',hour:'2-digit',minute:'2-digit',hourCycle:'h23'}).replace(',',''):'';return`Waived by ${e.by}${n?`, ${n}`:''}${e.note?.trim()?` (${e.note.trim()})`:''}`}function l(e){const t=e.wix?.paymentStatus;return t&&['FREE','NOT_PAID','PAID','PARTIALLY_PAID','PARTIALLY_REFUNDED','FULLY_REFUNDED'].includes(t)?t:null}function c(e){return'paid'===e.depositLink?.state&&(e.depositLink.paidPence??0)>0?e.depositLink.paidPence:e.depositPaidBy&&'Wix'!==e.depositPaidBy&&(e.depositPaid??0)>0&&!e.wix?.depositEstimated||f(e)&&(e.depositPaid??0)>0?e.depositPaid:null}function f(e){return'wix-order'===e.wix?.amountSource||'wix-order'===e.depositSource}function b(e){if(f(e)||!e.wix?.depositEstimated&&'estimate'!==e.depositSource)return null;const t=e.depositPaid??0;if(t<=0)return null;const n=e.partySize??0;return{pence:t,perHead:e.wix?.perPersonPence??(n?Math.round(t/n):0),party:n}}function m(e,t=s){const n=l(e),o=c(e),p=d(e);if(p&&'PAID'!==n&&(!e.depositPaidBy||!o)&&'paid'!==e.depositLink?.state&&'paid'!==u(e))return{label:`Deposit waived \xb7 ${p.by}`,kind:'neutral'};if(n&&'FREE'!==n){if(e.depositPaidBy&&o)return{label:`Deposit paid \xb7 ${t(o)}`,kind:'gold'};if('PAID'===n){if(o)return{label:`Deposit paid \xb7 ${t(o)}`,kind:'gold'};const n=b(e);return n?{label:n.party&&n.perHead?`Deposit paid (about ${t(n.pence)}, ${n.party} \xd7 ${t(n.perHead)})`:`Deposit paid (about ${t(n.pence)})`,kind:'gold'}:{label:'Deposit paid on website bookings',kind:'gold'}}return'PARTIALLY_PAID'===n?{label:o&&(e.depositDue??0)>o?`Part paid on website bookings \xb7 ${t(o)} of ${t(e.depositDue)}`:'Part paid on website bookings',kind:'amber'}:'NOT_PAID'===n?{label:(e.depositDue??0)>0?`Deposit not paid \xb7 ${t(e.depositDue)} due`:'Deposit not paid',kind:'amber'}:'FULLY_REFUNDED'===n?{label:'Deposit refunded on website bookings',kind:'neutral'}:{label:'Deposit part refunded on website bookings',kind:'neutral'}}const f=u(e);if('none'===f)return null;const m=e.depositLink;return'paid'===m?.state?{label:o?`Deposit paid on website bookings \xb7 ${t(o)}`:'Deposit paid on website bookings',kind:'gold'}:'paid'===f?{label:o?`Deposit paid \xb7 ${t(o)}`:'Deposit paid',kind:'gold'}:'open'===m?.state?{label:`Deposit link sent \xb7 waiting \xb7 ${t(m.amountPence??e.depositDue??0)}`,kind:'amber'}:'expired'===m?.state?{label:'Deposit link ran out \xb7 send a new one',kind:'amber'}:{label:`Deposit due \xb7 ${t(e.depositDue??0)}`,kind:'amber'}}function D(e,t,n=s){const o=m(e,n);if(!o)return null;const u=l(e),c=o.label.startsWith('Deposit paid');if(o.label.startsWith('Deposit waived')){const n=d(e);return{label:t?o.label:'Deposit waived',kind:'neutral',a11y:p(n).replace(/^Waived/,'Deposit waived'),note:t?p(n):void 0,paid:!1}}if(!t)return c?{label:'\u2713 Deposit paid',kind:'gold',a11y:'Deposit paid',paid:c}:'PARTIALLY_PAID'===u?{label:'Deposit part paid',kind:'amber',a11y:'Deposit part paid',paid:c}:'FULLY_REFUNDED'===u||'PARTIALLY_REFUNDED'===u?{label:'Deposit refunded',kind:'neutral',a11y:'Deposit refunded',paid:c}:'NOT_PAID'===u?{label:'Deposit not paid',kind:'amber',a11y:'Deposit not paid yet',paid:c}:{label:'Deposit due',kind:'amber',a11y:'Deposit due, not paid yet',paid:c};const D='PAID'===u?b(e):null,y=D&&D.perHead?`Website bookings shows paid; amount worked out at ${n(D.perHead)} a head`:f(e)&&c?'Amount from the website bookings order':void 0,P=o.label.replace(/ \xb7 /g,', ').replace(/\xd7/g,'times').replace(/[()]/g,'')+(y?`. ${y}`:'');return{label:o.label,kind:o.kind,a11y:P,note:y,paid:c}}},841,[]); +__d(function(g,r,i,a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"DEPOSIT_DEFAULT",{enumerable:!0,get:function(){return e}}),_e.depositOf=function(t){const n=t?.deposit;return n&&'object'==typeof n?{on:n.on??e.on,...!0===n.needsConfirmation?{needsConfirmation:!0}:{},perPersonPence:Number.isFinite(n.perPersonPence)?Math.max(0,Math.round(n.perPersonPence)):n.needsConfirmation?0:e.perPersonPence,fromParty:Number.isFinite(n.fromParty)?Math.max(1,Math.round(n.fromParty)):n.needsConfirmation?1:e.fromParty,refundable:'boolean'==typeof n.refundable?n.refundable:null,cutoffHours:Number.isFinite(n.cutoffHours)?Math.max(0,Math.round(n.cutoffHours)):null,policy:'string'==typeof n.policy?n.policy.slice(0,600):'',wixLinksOn:!0===n.wixLinksOn,wixLinkHours:Number.isFinite(n.wixLinkHours)?Math.max(1,Math.min(168,Math.round(n.wixLinkHours))):48}:{...e}},_e.childrenIn=t,Object.defineProperty(_e,"adultsIn",{enumerable:!0,get:function(){return n}}),_e.depositDue=o,_e.depositWords=function(e,d,u,p=0){if(e.needsConfirmation&&!e.on)return[e.policy.trim()||'Deposit policy awaiting venue confirmation.'];if(e.needsConfirmation)return['Table deposit policy not set yet. Ticketed event deposits are separate and are not a table policy.'];const l=o(e,d,p);if(!l)return[];const c=[t(d,p)?`A deposit of ${s(l)} (${s(e.perPersonPence)} for each of the ${n(d,p)} adults; children don't count towards the ${e.fromParty} and don't pay) is needed for ${e.fromParty} or more adults.`:`A deposit of ${s(l)} (${s(e.perPersonPence)} per adult; children don't count towards the ${e.fromParty} and don't pay) is needed for ${e.fromParty} or more adults.`];!0===e.refundable?c.push(e.cutoffHours?`Refundable if you cancel at least ${e.cutoffHours} hours before your booking.`:'Refundable if you cancel.'):!1===e.refundable?c.push('The deposit is not refundable.'):c.push(`Ask ${u} about refunds.`);e.policy.trim()&&c.push(e.policy.trim());return c.push(e.wixLinksOn?`${u} will send you a link to pay the deposit securely through website bookings.`:`No payment is taken in the app yet: ${u} will tell you how to pay the deposit.`),c},_e.waiverOf=d,_e.depositState=u,_e.waiverText=p,_e.canWaiveDeposit=function(e){if(['cancelled','finished','noshow','declined'].includes(e.status??''))return!1;const t=l(e);return'PAID'!==t&&'FULLY_REFUNDED'!==t&&'PARTIALLY_REFUNDED'!==t&&'FREE'!==t&&('paid'!==e.depositLink?.state&&('NOT_PAID'===t||'PARTIALLY_PAID'===t?!d(e):'due'===u(e)))},_e.wixPayStatus=l,_e.knownPaid=c,_e.fromWixOrder=f,_e.estimatedWix=b,_e.depositBadge=m,_e.canTickDeposit=function(e){if(d(e))return!1;const t=l(e);return'NOT_PAID'!==t&&'PAID'!==t&&'FULLY_REFUNDED'!==t&&'PARTIALLY_REFUNDED'!==t&&('paid'!==e.depositLink?.state&&'due'===u(e))},_e.canSendDepositLink=function(e,t){return!(!t.wixLinksOn||l(e)||d(e))&&(!e.walkIn&&!['cancelled','finished','noshow','declined'].includes(e.status??'')&&('due'===u(e)&&'paid'!==e.depositLink?.state))},_e.depositTerms=function(e){const t=[];!0===e.refundable?t.push(e.cutoffHours?`The deposit is refundable if you cancel at least ${e.cutoffHours} hours before.`:'The deposit is refundable if you cancel.'):!1===e.refundable&&t.push('The deposit is not refundable.');e.policy.trim()&&t.push(e.policy.trim());return t.join(' ')},_e.depositLinkMessage=function(e){const t=(e.name||'').trim().split(/\s+/)[0]||'there',[n,o,d]=e.date.split('-').map(Number),u=new Date(n,(o||1)-1,d||1).toLocaleDateString('en-GB',{weekday:'long',day:'numeric',month:'long'}),p=e.expiresAt?new Date(e.expiresAt).toLocaleString('en-GB',{timeZone:'Europe/London',weekday:'long',day:'numeric',month:'long',hour:'numeric',minute:'2-digit',hourCycle:'h12'}).replace(/\s?(am|pm)$/i,e=>e.trim().toLowerCase()):'',l=[`Hello ${t}, thank you for booking ${e.venue} for ${e.partySize} on ${u} at ${e.time.slice(0,5)}.`,`To hold your table, please pay the ${s(e.amountPence)} deposit here: ${e.url}`];p&&l.push(`The link works until ${p}.`);e.terms?.trim()&&l.push(e.terms.trim());return l.push(`Thank you, ${e.venue}`),l.join('\n')},_e.depositView=y,_e.depositShort=function(e){const t=y(e,!1);return t?t.a11y.split(',')[0]:null};const e={on:!0,perPersonPence:1e3,fromParty:6,refundable:null,cutoffHours:null,policy:''};function t(e,t){const n=Math.max(0,Math.round(Number(e)||0)),o=Math.round(Number(t)||0);return Math.max(0,Math.min(n,o))}const n=(e,n)=>Math.max(0,Math.round(Number(e)||0)-t(e,n));function o(e,t,o=0){return!e.on||e.perPersonPence<=0||n(t,o)`\xa3${(e/100).toFixed(e%100?2:0)}`;function d(e){const t=e.depositWaived;return t&&'object'==typeof t&&'string'==typeof t.by&&t.by?t:null}function u(e){if('deposit'!==e.security)return'none';const t=e.depositDue??e.depositPaid??0;return t?(e.depositPaid??0)>=t?'paid':d(e)?'waived':'due':'none'}function p(e){const t=new Date(e.at),n=!Number.isNaN(t.getTime())?t.toLocaleString('en-GB',{timeZone:'Europe/London',day:'2-digit',month:'2-digit',hour:'2-digit',minute:'2-digit',hourCycle:'h23'}).replace(',',''):'';return`Waived by ${e.by}${n?`, ${n}`:''}${e.note?.trim()?` (${e.note.trim()})`:''}`}function l(e){const t=e.wix?.paymentStatus;return t&&['FREE','NOT_PAID','PAID','PARTIALLY_PAID','PARTIALLY_REFUNDED','FULLY_REFUNDED'].includes(t)?t:null}function c(e){return'paid'===e.depositLink?.state&&(e.depositLink.paidPence??0)>0?e.depositLink.paidPence:e.depositPaidBy&&'Wix'!==e.depositPaidBy&&(e.depositPaid??0)>0&&!e.wix?.depositEstimated||f(e)&&(e.depositPaid??0)>0?e.depositPaid:null}function f(e){return'wix-order'===e.wix?.amountSource||'wix-order'===e.depositSource}function b(e){if(f(e)||!e.wix?.depositEstimated&&'estimate'!==e.depositSource)return null;const t=e.depositPaid??0;if(t<=0)return null;const n=e.partySize??0;return{pence:t,perHead:e.wix?.perPersonPence??(n?Math.round(t/n):0),party:n}}function m(e,t=s){const n=l(e),o=c(e),p=d(e);if(p&&'PAID'!==n&&(!e.depositPaidBy||!o)&&'paid'!==e.depositLink?.state&&'paid'!==u(e))return{label:`Deposit waived \xb7 ${p.by}`,kind:'neutral'};if(n&&'FREE'!==n){if(e.depositPaidBy&&o)return{label:`Deposit paid \xb7 ${t(o)}`,kind:'gold'};if('PAID'===n){if(o)return{label:`Deposit paid \xb7 ${t(o)}`,kind:'gold'};const n=b(e);return n?{label:n.party&&n.perHead?`Deposit paid (about ${t(n.pence)}, ${n.party} \xd7 ${t(n.perHead)})`:`Deposit paid (about ${t(n.pence)})`,kind:'gold'}:{label:'Deposit paid on website bookings',kind:'gold'}}return'PARTIALLY_PAID'===n?{label:o&&(e.depositDue??0)>o?`Part paid on website bookings \xb7 ${t(o)} of ${t(e.depositDue)}`:'Part paid on website bookings',kind:'amber'}:'NOT_PAID'===n?{label:(e.depositDue??0)>0?`Deposit not paid \xb7 ${t(e.depositDue)} due`:'Deposit not paid',kind:'amber'}:'FULLY_REFUNDED'===n?{label:'Deposit refunded on website bookings',kind:'neutral'}:{label:'Deposit part refunded on website bookings',kind:'neutral'}}const f=u(e);if('none'===f)return null;const m=e.depositLink;return'paid'===m?.state?{label:o?`Deposit paid on website bookings \xb7 ${t(o)}`:'Deposit paid on website bookings',kind:'gold'}:'paid'===f?{label:o?`Deposit paid \xb7 ${t(o)}`:'Deposit paid',kind:'gold'}:'open'===m?.state?{label:`Deposit link sent \xb7 waiting \xb7 ${t(m.amountPence??e.depositDue??0)}`,kind:'amber'}:'expired'===m?.state?{label:'Deposit link ran out \xb7 send a new one',kind:'amber'}:{label:`Deposit due \xb7 ${t(e.depositDue??0)}`,kind:'amber'}}function y(e,t,n=s){const o=m(e,n);if(!o)return null;const u=l(e),c=o.label.startsWith('Deposit paid');if(o.label.startsWith('Deposit waived')){const n=d(e);return{label:t?o.label:'Deposit waived',kind:'neutral',a11y:p(n).replace(/^Waived/,'Deposit waived'),note:t?p(n):void 0,paid:!1}}if(!t)return c?{label:'\u2713 Deposit paid',kind:'gold',a11y:'Deposit paid',paid:c}:'PARTIALLY_PAID'===u?{label:'Deposit part paid',kind:'amber',a11y:'Deposit part paid',paid:c}:'FULLY_REFUNDED'===u||'PARTIALLY_REFUNDED'===u?{label:'Deposit refunded',kind:'neutral',a11y:'Deposit refunded',paid:c}:'NOT_PAID'===u?{label:'Deposit not paid',kind:'amber',a11y:'Deposit not paid yet',paid:c}:{label:'Deposit due',kind:'amber',a11y:'Deposit due, not paid yet',paid:c};const y='PAID'===u?b(e):null,D=y&&y.perHead?`Website bookings shows paid; amount worked out at ${n(y.perHead)} a head`:f(e)&&c?'Amount from the website bookings order':void 0,P=o.label.replace(/ \xb7 /g,', ').replace(/\xd7/g,'times').replace(/[()]/g,'')+(D?`. ${D}`:'');return{label:o.label,kind:o.kind,a11y:P,note:D,paid:c}}},841,[]); __d(function(_g,_r,_i,_a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"SHAPES",{enumerable:!0,get:function(){return a}}),Object.defineProperty(_e,"shapeLabel",{enumerable:!0,get:function(){return o}}),Object.defineProperty(_e,"tableLabel",{enumerable:!0,get:function(){return s}}),Object.defineProperty(_e,"tableNumber",{enumerable:!0,get:function(){return u}}),_e.numberClashes=function(e){const t=new Map;for(const n of e){const e=u(n);t.set(e,[...t.get(e)??[],{name:n.name,areaId:n.areaId}])}const n=new Set,r=[];for(const[e,a]of t){if(a.length<2)continue;const t=new Map;a.forEach(e=>t.set(e.areaId,[...t.get(e.areaId)??[],e.name]));for(const e of t.values())e.length>1&&e.forEach(e=>n.add(e));t.size>1&&r.push(e)}return{sameArea:n,acrossAreas:r}},Object.defineProperty(_e,"liveTableLabel",{enumerable:!0,get:function(){return l}}),Object.defineProperty(_e,"FIXTURES",{enumerable:!0,get:function(){return i}}),Object.defineProperty(_e,"PLAN_W",{enumerable:!0,get:function(){return c}}),Object.defineProperty(_e,"PLAN_H",{enumerable:!0,get:function(){return b}}),Object.defineProperty(_e,"GRID",{enumerable:!0,get:function(){return m}}),Object.defineProperty(_e,"snap",{enumerable:!0,get:function(){return f}}),Object.defineProperty(_e,"clamp",{enumerable:!0,get:function(){return h}}),Object.defineProperty(_e,"fid",{enumerable:!0,get:function(){return g}}),Object.defineProperty(_e,"slug",{enumerable:!0,get:function(){return w}}),_e.sizeFor=y,Object.defineProperty(_e,"minFor",{enumerable:!0,get:function(){return x}}),Object.defineProperty(_e,"numOf",{enumerable:!0,get:function(){return O}}),Object.defineProperty(_e,"byNumber",{enumerable:!0,get:function(){return P}}),_e.newTable=j,_e.autoArrange=M,_e.placeNew=S,_e.rotate90=function(e){const t=e.x+e.w/2,n=e.y+e.h/2;return{...e,w:e.h,h:e.w,x:h(f(t-e.h/2),0,c-e.h),y:h(f(n-e.w/2),0,b-e.w)}},_e.normalisePlan=function(e){return{...e,fixtures:e.fixtures??[],tables:e.tables.map(e=>{const t=e.shape;let n='booth'===t||'rect'===t?'rect':'round'===t?'round':'square',{w:r,h:a}=e;if('square'===n||'round'===n){const e=Math.max(r,a);r=e,a=e}if(90===e.rot||270===e.rot){const e=r;r=a,a=e}return'rect'===n&&r===a&&(n='square'),{...e,shape:n,w:r,h:a,rot:0}})}},Object.defineProperty(_e,"SECTION_COLOURS",{enumerable:!0,get:function(){return I}}),_e.buildPlan=k,_e.anchoragePlan=$,_e.starterPlan=function(){return k({areas:[{name:'Main room',tables:[[1,2],[2,4],[3,6],[4,4],[5,2],[6,6]],fixtures:[A(450,600)]}]},['SV'])},Object.defineProperty(_e,"TEMPLATES",{enumerable:!0,get:function(){return v}}),_e.parseTableList=function(e){const t=[],n=[];let r;for(const a of e.split(/\r?\n/)){const e=a.trim();if(!e)continue;if(!/\d/.test(e)){r=e.replace(/[:\-\u2013]+$/,'').trim()||r;continue}const o=e.match(/^(?:table|tbl|tab|t)?\s*(?:no\.?|number|#)?\s*([a-z]?\d+[a-z]?)\b[^\d]*?(\d+)/i);if(!o){n.push(e);continue}const s=parseInt(o[2],10);!s||s>30?n.push(e):t.push({area:r,name:o[1].toUpperCase(),seats:s})}return{items:t,skipped:n}},Object.defineProperty(_e,"planCounts",{enumerable:!0,get:function(){return C}}),Object.defineProperty(_e,"tableDogOk",{enumerable:!0,get:function(){return B}}),Object.defineProperty(_e,"dogTables",{enumerable:!0,get:function(){return L}}),Object.defineProperty(_e,"areaOfTable",{enumerable:!0,get:function(){return q}}),_e.bestTables=E,Object.defineProperty(_e,"isBestTable",{enumerable:!0,get:function(){return _}}),_e.withSeedBest=function(e,t){if('anchorage'!==e||!t?.areas?.some(e=>void 0===e.best))return t;const n=$();return{...t,areas:t.areas.map(e=>{if(void 0!==e.best)return e;const r=n.areas.find(t=>t.id===e.id||t.name===e.name),a=(r?.best??[]).filter(n=>t.tables.some(t=>t.name===n&&t.areaId===e.id));return a.length?{...e,best:a}:e})}};var e,t=_r(d[0]),n=_r(d[1]),r=(e=n)&&e.__esModule?e:{default:e};const a=[{id:'square',label:'Square'},{id:'rect',label:'Rectangle'},{id:'round',label:'Round'}],o=e=>'rect'===e?'Rectangle':'round'===e?'Round':'Square',s=e=>/\d/.test(e.name)?(0,t.plainTableNumber)(e.name):(0,t.plainTableNumber)(e.label?.trim()||e.name),u=s;const l=(e,t)=>u(e),i=[{id:'bar',label:'Bar',w:300,h:50},{id:'wall',label:'Wall',w:250,h:25},{id:'door',label:'Door',w:100,h:25},{id:'window',label:'Window',w:200,h:25}],c=1e3,b=625,m=25,f=e=>Math.round(e/m)*m,h=(e,t,n)=>Math.max(t,Math.min(n,e));let p=0;const g=e=>`${e}-${Date.now().toString(36)}${(p++).toString(36)}`,w=e=>e.toLowerCase().replace(/[^a-z0-9]+/g,'-').replace(/^-|-$/g,'')||'area';function y(e){return e<=2?{shape:'square',w:75,h:75}:e<=4?{shape:'square',w:100,h:100}:e<=6?{shape:'rect',w:150,h:100}:e<=8?{shape:'rect',w:200,h:100}:e<=10?{shape:'rect',w:250,h:100}:{shape:'rect',w:300,h:100}}const x=e=>e<=2?1:Math.max(2,Math.ceil(e/2)),O=e=>{const t=e.match(/\d+/);return t?parseInt(t[0],10):9999},P=(e,t)=>O(e.name)-O(t.name)||e.name.localeCompare(t.name);function j(e,t,n,r){const a=y(n);return{id:`t-${e}-${g('x').slice(2)}`,name:e,areaId:t,shape:a.shape,minSeats:x(n),maxSeats:n,x:0,y:0,w:a.w,h:a.h,rot:0,online:!0,sectionId:r}}function M(e,t=125,n=75){const r=[...e].sort(P);if(!r.length)return r;let a=75;const o=e=>{const t=[];let n=[],a=0;for(const o of r){const r=(n.length?e:0)+o.w;n.length&&a+r>850&&(t.push(n),n=[],a=0),n.push(o),a+=(n.length>1?e:0)+o.w}return n.length&&t.push(n),t};let s=o(a);const u=(e,t)=>e.reduce((e,t)=>e+Math.max(...t.map(e=>e.h)),0)+t*(e.length-1);for(;u(s,a)>b-t-n&&a>25;)a-=25,s=o(a);const l=u(s,a),i=b-t-n,p=s.length>1?Math.min(150,a+Math.max(0,Math.floor((i-l)/(s.length-1)/m)*m)):0,g=s.reduce((e,t)=>e+Math.max(...t.map(e=>e.h)),0)+p*(s.length-1);let w=f(t+Math.max(0,(i-g)/2));const y=[];for(const e of s){const t=Math.max(...e.map(e=>e.h)),n=e.reduce((e,t)=>e+t.w,0)+a*(e.length-1);let r=f((c-n)/2);for(const n of e)y.push({...n,x:h(r,0,c-n.w),y:h(f(w+(t-n.h)/2),0,b-n.h),rot:0}),r+=n.w+a;w+=t+p}return y}function S(e,t,n=[]){const r=[...e,...n].map(e=>({x:e.x,y:e.y,w:e.w,h:e.h})),a=[];for(const e of t){let t=null;for(let n=50;n<=b-e.h-25&&!t;n+=m)for(let a=50;a<=c-e.w-25&&!t;a+=m){const o=50;r.some(t=>at.x&&nt.y)||(t={x:a,y:n})}const n=t??{x:50,y:50},o={...e,x:n.x,y:n.y};r.push({x:o.x,y:o.y,w:o.w,h:o.h}),a.push(o)}return a}const I=['#CFA45F','#E2C489','#A88B5A','#8C6A3A','#FFB547','#D9B98A'];function k(e,t=[]){const n=[],r=[],a=[],o=[];e.areas.forEach((e,s)=>{const u=w(e.name),l=e.best?e.best.map(String).filter(t=>e.tables.some(([e])=>String(e)===t)):void 0;n.push({id:u,name:e.name,dogs:!!e.dogs,outdoor:!!e.outdoor,...e.label?{label:e.label}:{},...e.colour?{colour:e.colour}:{},...l?{best:l}:{}});const i=`s-${u}`;o.push({id:i,name:e.name,colour:e.colour??I[s%I.length],server:t[s]??''});const m=(e.fixtures??[]).map((e,t)=>({...e,id:`fx-${u}-${t}`,areaId:u}));a.push(...m);const f=m.some(e=>e.y<100&&('bar'===e.kind||e.w>=300))?150:100,p=e.tables.map(([e,t])=>({...j(String(e),u,t,i),id:`t-${e}`})),g=e.layout??{},y=p.filter(e=>g[e.name]).map(e=>{const t=g[e.name],n=t.shape??(t.w===t.h?'square':'rect'),r=h(Math.round(t.w),50,c),a=h(Math.round('rect'===n?t.h:t.w),50,b);return{...e,shape:n,w:r,h:a,x:h(Math.round(t.x),0,c-r),y:h(Math.round(t.y),0,b-a),...t.label?{label:t.label}:{}}}),x=p.filter(e=>!g[e.name]);y.length?r.push(...y,...S(y,x,m)):r.push(...M(p,f,75))});const s=new Set(r.map(e=>e.name)),u=(e.joins??[]).filter(e=>e.every(e=>s.has(e))).map(e=>({id:`j-${e.join('-')}`,tables:e}));return{areas:n,tables:r,joins:u,sections:o,fixtures:a}}const T=(e,t,n=0,r=25)=>({kind:'window',x:e,y:n,w:t,h:r}),A=(e,t,n=100,r=25)=>({kind:'door',x:e,y:t,w:n,h:r});function $(){const e=r.default;return k({areas:e.areas.map(e=>({name:e.name,dogs:!!e.dogFriendly,outdoor:!(!e.outdoor&&!e.weatherDependent),label:e.label,colour:e.colour,tables:e.tables.map(([e,t])=>[e,t]),layout:e.layout,fixtures:[],best:e.best?.map(String)})),joins:e.joins??[]},e.areas.map(e=>e.server??''))}const v=[{id:'anchorage',name:'The Anchorage',sub:'4 areas \xb7 29 tables \xb7 119 seats',make:$},{id:'cafe',name:'Small caf\xe9',sub:'1 room \xb7 8 tables \xb7 dogs welcome',make:()=>k({areas:[{name:'Caf\xe9',dogs:!0,tables:[[1,2],[2,2],[3,4],[4,4],[5,2],[6,4],[7,2],[8,6]],fixtures:[{kind:'bar',x:300,y:25,w:400,h:50},A(450,600)]}]})},{id:'pub',name:'Pub with garden',sub:'Bar, lounge and beer garden',make:()=>k({areas:[{name:'Bar',dogs:!0,tables:[[1,2],[2,4],[3,4],[4,2],[5,4],[6,6]],fixtures:[{kind:'bar',x:250,y:25,w:500,h:75}]},{name:'Lounge',tables:[[7,4],[8,4],[9,2],[10,6],[11,4],[12,2],[13,4],[14,8]],fixtures:[T(150,700)]},{name:'Beer garden',dogs:!0,outdoor:!0,tables:[[20,6],[21,6],[22,4],[23,4],[24,6],[25,6]]}]})},{id:'restaurant',name:'Restaurant and terrace',sub:'Dining room with an outdoor terrace',make:()=>k({areas:[{name:'Dining room',tables:[[1,2],[2,2],[3,4],[4,4],[5,4],[6,6],[7,2],[8,2],[9,4],[10,4],[11,6],[12,8]],fixtures:[T(100,800),A(450,600)]},{name:'Terrace',outdoor:!0,tables:[[20,2],[21,4],[22,4],[23,2]]}]})},{id:'blank',name:'Blank',sub:'One empty room to start from',make:()=>k({areas:[{name:'Main room',tables:[]}]})}];const C=(e,t)=>{const n=t?e.tables.filter(e=>e.areaId===t):e.tables;return{tables:n.length,seats:n.reduce((e,t)=>e+t.maxSeats,0)}},B=(e,t)=>void 0!==t.dogOk?t.dogOk:!!e.areas.find(e=>e.id===t.areaId)?.dogs,L=e=>new Set(e.tables.filter(t=>B(e,t)).map(e=>e.name)),q=(e,t)=>e.areas.find(n=>n.id===e.tables.find(e=>e.name===t)?.areaId);function E(e,t){return e.areas.filter(e=>!t||e.id===t).flatMap(t=>(t.best??[]).filter(n=>e.tables.some(e=>e.name===n&&e.areaId===t.id)))}const _=(e,t)=>E(e).includes(t)},842,[843,844]); __d(function(g,r,i,a,m,e,d){"use strict";function t(t){const n=String(t??'').trim(),l=n.match(/\d+/g);return 1===l?.length?l[0].replace(/^0+(?=\d)/,''):n}Object.defineProperty(e,'__esModule',{value:!0}),e.plainTableNumber=t,Object.defineProperty(e,"tableNumbers",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"tableListNumbers",{enumerable:!0,get:function(){return l}}),e.tableNumbersA11y=function(t){const l=n(t).split('+').filter(Boolean);return l.length?`${1===l.length?'Table':'Tables'} ${l.join(', ')}`:'No table'},e.withTableWord=function(t){const n=t.trim();return!n||/^tables?\b/i.test(n)||/^no table\b/i.test(n)?n:`Table ${n}`};const n=n=>String(n??'').split('+').map(t).filter(Boolean).join('+'),l=(t,l=" + ")=>t.map(n).filter(Boolean).join(l)},843,[]); __d(function(e,a,l,r,t,o,s){t.exports={venue:"The Anchorage",note:"From Gordon 28 Oct 2026; layout from Gordon's floor-plan photo 29 Oct 2026 (positions, sizes, shapes, labels scaled from the photo, one scale for all areas). Photo shows MT12 and no MT8: table 8 replaced by 12. Gordon confirmed 29 Oct: no table 8; MT11 and MT12 both exist, MT11 keeps 2 seats, MT12 = 2 seats. No tables 4 or 8. No joined tables: Gordon confirmed 29 Oct that DT1 and DT2 are not joined.",areas:[{name:"Public Bar",label:"Dog friendly area (Public Bar), Area 1",colour:"#CFA45F",server:"BR",dogFriendly:!0,tables:[[1,4],[2,4],[3,5],[5,2],[6,4]],layout:{1:{label:"DT1",shape:"rect",x:600,y:125,w:205,h:90},2:{label:"DT2",shape:"rect",x:395,y:130,w:100,h:190},3:{label:"DT3",shape:"rect",x:205,y:120,w:110,h:245},5:{label:"DT5",shape:"square",x:500,y:395,w:105,h:105},6:{label:"DT6",shape:"rect",x:195,y:395,w:205,h:110}},best:[1,3]},{name:"Main Restaurant",label:"Main restaurant (no pets)",colour:"#8EC5FF",server:"SV",dogFriendly:!1,tables:[[7,5],[9,7],[10,4],[11,2],[12,2],[13,4],[14,4],[15,4],[16,2]],layout:{7:{label:"MT7",shape:"rect",x:590,y:410,w:225,h:115},9:{label:"MT9",shape:"rect",x:560,y:105,w:260,h:110},10:{label:"MT10",shape:"square",x:430,y:400,w:130,h:130},11:{label:"MT11",shape:"rect",x:545,y:270,w:115,h:90},12:{label:"MT12",shape:"rect",x:400,y:270,w:120,h:95},13:{label:"MT13",shape:"rect",x:400,y:100,w:90,h:115},14:{label:"MT14",shape:"rect",x:185,y:420,w:230,h:100},15:{label:"MT15",shape:"rect",x:190,y:220,w:165,h:145},16:{label:"MT16",shape:"rect",x:185,y:105,w:125,h:80}},best:[7,9]},{name:"Sitooterie",label:"Sitooterie (fully covered conservatory, no pets)",colour:"#C79BE8",server:"DM",dogFriendly:!1,tables:[[17,2],[18,6],[19,4],[20,6],[21,4],[22,4],[23,4]],layout:{17:{label:"ST17",shape:"square",x:760,y:325,w:110,h:110},18:{label:"ST18",shape:"rect",x:605,y:135,w:270,h:115},19:{label:"ST19",shape:"rect",x:460,y:160,w:105,h:150},20:{label:"ST20",shape:"rect",x:135,y:125,w:265,h:120},21:{label:"ST21",shape:"rect",x:120,y:305,w:110,h:175},22:{label:"ST22",shape:"rect",x:255,y:310,w:115,h:175},23:{label:"ST23",shape:"rect",x:410,y:350,w:110,h:155}},best:[19,21]},{name:"Beer Garden",label:"Outdoor beer garden (weather permitting, no shelter, pets allowed)",colour:"#B08D57",server:"GD",dogFriendly:!0,outdoor:!0,weatherDependent:!0,tables:[[24,4],[25,4],[26,4],[27,6],[28,6],[29,4],[30,4],[31,4]],layout:{24:{label:"BGT24",shape:"round",x:740,y:70,w:130,h:130},25:{label:"BGT25",shape:"round",x:515,y:50,w:135,h:135},26:{label:"BGT26",shape:"round",x:310,y:50,w:135,h:135},27:{label:"BGT27",shape:"rect",x:560,y:235,w:280,h:115},28:{label:"BGT28",shape:"rect",x:245,y:235,w:270,h:110},29:{label:"BGT29",shape:"rect",x:210,y:365,w:190,h:60},30:{label:"BGT30",shape:"rect",x:180,y:445,w:190,h:55},31:{label:"BGT31",shape:"rect",x:130,y:520,w:215,h:60}},best:[27,28]}],photoScale:1.8,joins:[],bestNote:"Best tables per area from Gordon, 1 Nov 2026: Bar 1 and 3; Restaurant 7 and 9; Sitooterie 19 and 21; Outside (Beer Garden) 27 and 28. Shown as BEST for walk-ins and bookings when they fit; editable per area in the table plan."}},844,[]); @@ -1059,7 +1059,7 @@ __d(function(g,r,i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule' __d(function(g,r,i,a,_m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.setClockServer=function(t){s=t,c()},e.markClockUnsent=function(t){o.set(t,Date.now()),c()},e.markClockSent=function(t){o.delete(t)&&c()},e.clockNotSent=l,e.useClockNotSent=function(o){const[,c]=(0,t.useState)(0);return(0,t.useEffect)(()=>{const t=()=>c(t=>t+1);u.add(t);const o=n.mutationQueue.subscribe(t);return()=>{u.delete(t),o()}},[]),l(o)};var t=r(d[0]),n=r(d[1]);const o=new Map,u=new Set,c=()=>{for(const t of u)t()};let s=()=>!1;function l(t){if(!t)return!1;return n.mutationQueue.pending.some(n=>'attendance'===n.table&&n.rowKey===t)||o.has(t)&&s()}n.mutationQueue.onDone(t=>{'attendance'===t.table&&o.delete(t.rowKey)&&c()})},976,[17,977]); __d(function(g,_r,i,a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"MutationQueue",{enumerable:!0,get:function(){return l}}),Object.defineProperty(_e,"mutationQueue",{enumerable:!0,get:function(){return o}});var t=_r(d[0]),e=_r(d[1]),s=_r(d[2]);const n='queue:v1',r='queue:failed:v1',h=t=>`${t.table}|${t.venueId}|${t.rowKey}`;class l{items=[];failedItems=[];loaded=null;flushing=null;flushingSince=0;exec=null;listeners=new Set;onFailure=new Set;onSaved=new Set;retryTimer=null;waitTimer=null;backoffMs=2e3;now=()=>Date.now();constructor(){(0,t.onConnectivity)(t=>{t&&this.flush()})}setExecutor(t){this.exec=t}load(){return this.loaded||(this.loaded=(async()=>{const t=await e.kv.get(n,[]);this.items=[...t.map(t=>({...t,nextAt:void 0})),...this.items],this.failedItems=await e.kv.get(r,[]),this.emit()})()),this.loaded}get pending(){return this.items}get waiting(){return this.items.filter(t=>t.attempts>0)}get failed(){return this.failedItems}hasPending(t,e,s){return this.items.some(n=>n.table===t&&n.venueId===e&&n.rowKey===s)}async enqueue(t){await this.load();const s={...t,id:(0,e.uuid)(),createdAt:(new Date).toISOString(),attempts:0};return this.items.push(s),await this.persist(),this.flush(),s}nextReady(){const t=new Set,e=this.now();for(const s of this.items){const n=h(s);if(!t.has(n)){if(!(s.nextAt&&s.nextAt>e))return s;t.add(n)}}}remove(t){this.items=this.items.filter(e=>e!==t)}flush(){if(this.flushing&&Date.now()-this.flushingSince<6e4)return this.flushing;this.flushingSince=Date.now();let e=null;return e=(async()=>{for(await this.load();this.exec;){if(this.flushing&&this.flushing!==e)return;const n=this.nextReady();if(!n)break;if(!(0,t.isOnline)()){this.scheduleRetry();break}try{const t=await this.exec(n);this.remove(n),this.backoffMs=2e3,'conflict'===t?this.fail(n,'conflict','Row changed on the server (version conflict) or is not visible to you'):this.onSaved.forEach(t=>t(n))}catch(e){n.attempts+=1,n.lastError=String(e?.message??e);const r=e??{};n.lastErr={code:r.code?String(r.code):void 0,status:Number(r.status)||void 0,message:n.lastError.slice(0,300)};const h=(0,s.classifyWriteError)(e);if('network'===h){n.attempts-=1,(0,t.setOnline)(!1),this.scheduleRetry(),await this.persist();break}'retry'===h?n.nextAt=this.now()+(0,s.retryDelayMs)(n.attempts):(this.remove(n),this.fail(n,'rejected',n.lastError))}await this.persist()}this.flushing===e&&(this.flushing=null),this.scheduleWaiting()})(),this.flushing=e,e}retryNow(){for(const t of this.items)t.nextAt=void 0;return this.flush()}subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}onFailed(t){return this.onFailure.add(t),()=>{this.onFailure.delete(t)}}onDone(t){return this.onSaved.add(t),()=>{this.onSaved.delete(t)}}async clearFailed(){this.failedItems=[],await e.kv.set(r,[]),this.emit()}fail(t,s,n){const h={...t,lastError:n,failedAt:(new Date).toISOString(),reason:s};this.failedItems=[h,...this.failedItems].slice(0,100),e.kv.set(r,this.failedItems),this.onFailure.forEach(t=>t(h))}scheduleWaiting(){this.waitTimer&&(clearTimeout(this.waitTimer),this.waitTimer=null);const t=this.items.map(t=>t.nextAt??0).filter(t=>t>0);if(!t.length)return;const e=Math.max(500,Math.min(...t)-this.now());this.waitTimer=setTimeout(()=>{this.waitTimer=null,this.flush()},e)}scheduleRetry(){if(this.retryTimer)return;const e=this.backoffMs;this.backoffMs=Math.min(2*this.backoffMs,6e4),this.retryTimer=setTimeout(()=>{this.retryTimer=null,(0,t.setOnline)(!0),this.flush()},e)}async persist(){await e.kv.set(n,this.items),this.emit()}emit(){this.listeners.forEach(t=>t())}}const o=new l},977,[974,936,978]); __d(function(g,r,i,a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.classifyWriteError=function(o){if((0,e.isNetworkError)(o))return'network';const{code:n,status:c,msg:l}=t(o);return s(o)?'refused':/^(08|53|57|58)/.test(n)||['40001','40P01','55P03','23505','23503'].includes(n)||/^PGRST30[0-3]$/.test(n)||/jwt|token.*expired/i.test(l)||401===c||408===c||425===c||429===c||c>=500?'retry':409!==c||n?'refused':'retry'},Object.defineProperty(_e,"retryDelayMs",{enumerable:!0,get:function(){return o}}),_e.describeWrite=function(e){const t='rpc'===e.kind?(e.fn??'change').replace(/_/g,' '):n[e.table]??e.table.replace(/_/g,' ').replace(/s$/,''),s=e.values??{},o=s.guest_name??s.name??s.display_name??s.title??s.reason,c='string'==typeof o&&o.trim()?` for ${o.trim().slice(0,60)}`:'';return'delete'===e.kind?`deleting a ${t}${c}`:`the ${t}${c}`},_e.plainReason=function(e,o){const{code:n,status:c,msg:l}=t(e);if('refused'===o)return s(e)?'more than 20 deletes in 10 minutes from one sign-in are stopped to keep your data safe':'42501'===n||403===c||/row-level security|permission/i.test(l)?'your sign-in isn\u2019t allowed to change this':'conflict'===n?'it was changed or removed on another device first':/^(22|23)/.test(n)?'the shared system says some of the details aren\u2019t valid':'P0001'===n&&l?l.slice(0,140):l?`the shared system said: ${l.slice(0,120)}`:'the shared system refused it';return'23505'===n?'the shared system already has another copy of it':'23503'===n?'a related change has to save first':/^PGRST30/.test(n)||401===c||/jwt/i.test(l)?'your sign-in is being refreshed':'the shared system is busy'};var e=r(d[0]);const t=e=>{const t=e&&'object'==typeof e?e:{};return{msg:String(t.message??e??''),code:String(t.code??''),status:Number(t.status??0)||0,hint:String(t.hint??'')}},s=e=>{const s=t(e);return/delete guard/i.test(s.hint)||/too many .* deleted in 10 minutes/i.test(s.msg)};const o=e=>Math.min(5e3*Math.pow(3,Math.max(0,e-1)),3e5),n={bookings:'booking',walk_ins:'walk-in',blocks:'blocked time',sold_out_items:'sold-out mark',sold_out_links:'dish stock link',staff:'staff details',rota_shifts:'rota shift',stock_items:'stock item',stock_events:'stock count',stock_counts:'stock count',chat_messages:'chat message',recipe_cards:'recipe card',order_lists:'order list',order_list_items:'order list item',daily_task_ticks:'task tick',daily_tasks:'daily task',attendance:'clock in or out',cash_ups:'cash-up',table_plans:'table plan',guest_profiles:'guest profile',floor_live:'table status',venues:'venue settings',time_requests:'clock correction request',staff_leave:'time off',scheduled_notifications:'reminder',suppliers:'supplier',supplier_orders:'supplier order',takeaway_orders:'takeaway order'}},978,[974]); -__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"APP_VERSION",{enumerable:!0,get:function(){return t}});const t='v0.3.12.192'},979,[]); +__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"APP_VERSION",{enumerable:!0,get:function(){return t}});const t='v0.3.12.193'},979,[]); __d(function(g,_r,i,a,_m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"TableRepository",{enumerable:!0,get:function(){return c}}),e.executeMutation=async function(t){const s=(t,s)=>{throw Object.assign(t,{status:s})};if('rpc'===t.kind){const{error:n,status:r}=await u().rpc(t.fn,t.values??{});return n&&s(n,r),'ok'}const n=u().from(t.table);if('upsert'===t.kind||'insert'===t.kind){const{error:r,status:o}=await n.upsert(t.values??{},{onConflict:t.conflictKey??'id',ignoreDuplicates:'insert'===t.kind});if(r&&'stock_events'===t.table&&'23503'===r.code&&/undoes/i.test(String(r.message??''))&&t.values?.undoes){t.values={...t.values,undoes:null};const r=await n.upsert(t.values,{onConflict:t.conflictKey??'id',ignoreDuplicates:'insert'===t.kind});return r.error&&s(r.error,r.status),'ok'}return r&&s(r,o),'ok'}let r='update'===t.kind?n.update(t.values??{}):n.delete();for(const[s,n]of Object.entries(t.match??{}))r=r.eq(s,n);const{data:o,error:c,status:l}=await r.select();c&&s(c,l);return'update'!==t.kind||o&&0!==o.length?'ok':'conflict'};var t=_r(d[0]),s=_r(d[1]),n=_r(d[2]),r=_r(d[3]),o=_r(d[4]);const u=()=>(0,n.getSupabase)();class c{constructor(t,s={}){this.table=t,this.opts=s,this.keyOf=s.keyOf??(t=>String(t.id)),this.keyColumns=s.keyColumns??['id'],this.venueCol=s.venueColumn??'venue_id'}rows(t){return s.cache.rows(this.table,t)}get(t,n){return s.cache.get(this.table,t,n)}subscribe(t,n){return s.cache.subscribe(this.table,t,n)}hydrate(t){return s.cache.hydrate(this.table,t)}async refresh(n,r={}){const c=()=>{let t=u().from(this.table).select('*').eq(this.venueCol,n);return this.opts.orderBy&&(t=t.order(this.opts.orderBy.column,{ascending:this.opts.orderBy.ascending??!0})),r.filter&&(t=r.filter(t)),t},l='bookings'===this.table?await(0,t.readPages)(async(t,s)=>{const{data:n,error:r}=await c().order('id').range(t,s);if(r)throw r;return n??[]}):await(async()=>{const{data:t,error:s}=await c().limit(this.opts.limit??1e3);if(s)throw s;return t??[]})();return s.cache.replace(this.table,n,l.map(t=>[this.keyOf(t),t]),t=>o.mutationQueue.hasPending(this.table,n,t)),l}async create(t,n){const u={...1===this.keyColumns.length&&'id'===this.keyColumns[0]?{id:(0,r.uuid)()}:{},...n,[this.venueCol]:t},c=this.keyOf(u);return s.cache.put(this.table,t,c,u),await o.mutationQueue.enqueue({table:this.table,venueId:t,kind:'insert'===this.opts.writeMode?'insert':'upsert',rowKey:c,values:u,conflictKey:this.opts.conflictKey??'id'}),u}async update(t,n,r,u={}){const c=s.cache.get(this.table,t,n),l={...this.matchFor(n,c),...u,[this.venueCol]:t};s.cache.patch(this.table,t,n,{...r,updated_at:(new Date).toISOString()}),await o.mutationQueue.enqueue({table:this.table,venueId:t,kind:'update',rowKey:n,values:r,match:l})}async remove(t,n){const r=s.cache.get(this.table,t,n),u={...this.matchFor(n,r),[this.venueCol]:t};s.cache.remove(this.table,t,n),await o.mutationQueue.enqueue({table:this.table,venueId:t,kind:'delete',rowKey:n,match:u})}matchFor(t,s){if(1===this.keyColumns.length&&'id'===this.keyColumns[0])return{id:t};const n={};for(const t of this.keyColumns)n[t]=s?.[t];return n}}},980,[981,982,892,936,977]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.readPages=async function(t,n=1e3){const s=[];for(let c=0;;c+=n){const o=await t(c,c+n-1);if(s.push(...o),o.length`cache:${t}:${n}`;function f(t){let s=n.get(t);return s||(s=new Map,n.set(t,s)),s}function p(n){s.delete(n),c.get(n)?.forEach(t=>t());const u=o.get(n);u&&clearTimeout(u),o.set(n,setTimeout(()=>{o.delete(n),t.kv.set(n,Array.from(f(n).entries()))},250))}const w={async hydrate(n,s){const c=l(n,s);if(u.has(c))return;u.add(c);const o=await t.kv.get(c,[]),w=f(c);let h=0;for(const[t,n]of o)w.has(t)||(w.set(t,n),h++);h&&p(c)},rows(t,n){const c=l(t,n);let o=s.get(c);return o||(o=Array.from(f(c).values()),s.set(c,o)),o},get:(t,n,s)=>f(l(t,n)).get(s),put(t,n,s,c){f(l(t,n)).set(s,c),p(l(t,n))},patch(t,n,s,c){const o=f(l(t,n)),u=o.get(s);u&&(o.set(s,{...u,...c}),p(l(t,n)))},remove(t,n,s){f(l(t,n)).delete(s)&&p(l(t,n))},replace(t,s,c,o=()=>!1){const u=l(t,s),w=f(u),h=new Map(c);w.forEach((t,n)=>{o(n)&&h.set(n,t)}),n.set(u,h),p(u)},subscribe(t,n,s){const o=l(t,n);let u=c.get(o);return u||(u=new Set,c.set(o,u)),u.add(s),()=>{u?.delete(s)}},async clearVenue(o,f){for(const p of f){const f=l(p,o);n.delete(f),s.delete(f),u.delete(f),await t.kv.remove(f),c.get(f)?.forEach(t=>t())}}}},982,[936]); @@ -1174,7 +1174,7 @@ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{v __d(function(g,_r,i,a,_m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.guardBookingChange=w,_e.saveTablesReported=async function(e,t,n,o,s,u){if(!w(u,{b:t,tables:n}))return!1;const v=n.length?(0,h.notSavedWhat)({...t,name:o,table:n.join('+')}):`Taking the table off ${o}`;u(`Saving ${v}\u2026`);try{await(0,b.saveBookingTables)(e,t,n)}catch(e){const t=`${v} did not save: ${String(e?.message??e).slice(0,120)}`;return u(t),(0,l.announce)(t),!1}const y=await(0,c.waitForBookingSave)(t.id);if('saved'===y.state||'local'===y.state){const e=(0,r.savedWords)(o,t.partySize,n,s);return u(e),(0,l.announce)(e),!0}const k='waiting'===y.state?`${v}: not saved yet. It saves by itself when the connection is back; a red banner shows if it fails.`:`${v} did not save. ${f("why"in y?y.why:"the shared system did not take it")}. Tap the red banner to try again.`;return u(k),(0,l.announce)(k),!1},_e.reportBookingSave=async function(e,t,n,o){const s=await(0,c.waitForBookingSave)(e);if('saved'===s.state||'local'===s.state)return o(t),(0,l.announce)(t),!0;const r='waiting'===s.state?`${n}: not saved yet. It saves by itself when the connection is back; a red banner shows if it fails.`:`${n} did not save. ${f('why'in s?s.why:'the shared system did not take it')}. Tap the red banner to try again.`;return o(r),(0,l.announce)(r),!1},_e.BookingSaveBanner=function({rid:e,testID:r="booking-save-banner",margin:c}){const b=(0,h.useBookingSaves)(e=>e.notSaved),w=(0,s.useBookings)(e).filter(e=>b[e.id]).map(e=>void 0!==b[e.id].want?{...e,table:b[e.id].want||void 0}:e),{msg:S,retry:$}=k(),m=(0,t.useRef)(''),p=w.map(e=>(0,h.notSavedLine)(e)),B=w.map(e=>e.id).sort().join(',');if((0,t.useEffect)(()=>{B&&B!==m.current&&(0,l.announce)(1===w.length?p[0]:`${w.length} booking changes did not save. Tap the red banner to try again.`),m.current=B},[B]),!w.length)return null;const j=1===w.length?p[0]:`${w.length} booking changes did not save. Tap to try again.`;return(0,y.jsx)(n.default,{testID:r,accessibilityRole:"button",accessibilityLiveRegion:"assertive",accessibilityLabel:`${j}${w.length>1?` ${w.map(e=>(0,h.notSavedWhat)(e)).join('. ')}.`:''} ${f(b[w[0].id].why)}.`,onPress:$,style:{...c??{},alignSelf:'stretch',gap:4,padding:12,borderRadius:12,borderWidth:2,borderColor:u.colours.red,backgroundColor:'#3a1210',alignItems:'center'},children:(0,y.jsxs)(o.default,{accessibilityRole:"alert",style:{alignItems:'center',gap:4},children:[(0,y.jsx)(v.T,{testID:`${r}-title`,size:17,weight:"semibold",center:!0,colour:"#FFD2CC",children:j}),w.length>1?w.slice(0,6).map(e=>(0,y.jsx)(v.T,{testID:`${r}-line`,size:15,center:!0,colour:"#FFD2CC",children:(0,h.notSavedWhat)(e)},e.id)):null,(0,y.jsx)(v.T,{testID:`${r}-why`,size:14,center:!0,colour:"#FFB3AA",children:w.length>1?`${f(b[w[0].id].why)}${w.length>6?` \xb7 and ${w.length-6} more`:''}`:f(b[w[0].id].why)}),S?(0,y.jsx)(v.T,{testID:`${r}-msg`,size:14,center:!0,colour:u.colours.goldLight,children:S}):null]})})},_e.BookingNotSavedLine=function({b:e}){const t=(0,h.useBookingSaves)(t=>t.notSaved[e.id]),{msg:o,retry:s}=k();if(!t)return null;void 0!==t.want&&(e={...e,table:t.want||void 0});return(0,y.jsxs)(n.default,{testID:`booking-not-saved-${e.id}`,accessibilityRole:"button",accessibilityLiveRegion:"assertive",accessibilityLabel:`${(0,h.notSavedLine)(e)} ${f(t.why)}.`,onPress:s,style:{alignSelf:'stretch',padding:8,borderRadius:10,borderWidth:1.5,borderColor:u.colours.red,backgroundColor:'#3a1210',alignItems:'center'},children:[(0,y.jsx)(v.T,{size:15,weight:"semibold",center:!0,colour:"#FFD2CC",children:(0,h.notSavedLine)(e)}),o?(0,y.jsx)(v.T,{size:13,center:!0,colour:u.colours.goldLight,children:o}):null]})};var t=_r(d[0]),n=e(_r(d[1])),o=e(_r(d[2])),s=_r(d[3]),r=_r(d[4]),l=_r(d[5]),c=_r(d[6]),h=_r(d[7]),u=_r(d[8]),b=_r(d[9]),v=_r(d[10]),y=_r(d[11]);const f=e=>e.charAt(0).toUpperCase()+e.slice(1);function w(e,t){const n=(0,c.bookingSaveBlocker)();if(!n)return!0;t&&h.useBookingSaves.getState().mark({id:t.b.id,table:t.b.walkIn?'walk_ins':'bookings',why:n,...t.tables?{want:t.tables.join('+')}:{}});const o=`${t?(0,h.notSavedWhat)({...t.b,...t.tables?{table:t.tables.join('+')||void 0}:{}}):'This change'} did not save: ${n}.`;return e?.(o),(0,l.announce)(o),!1}function k(){const[e,n]=(0,t.useState)('');return{msg:e,retry:async()=>{n('Saving\u2026'),(0,l.announce)('Saving');const e=await(0,c.saveBookingsNow)(!0),t=e?`Not saved: ${e}.`:h.useBookingSaves.getState().count()?'Sent again. The banner clears when the shared system takes it.':'Nothing is left waiting. Check the plan and make the change again if it is not there.';n(t),(0,l.announce)(t)}}}},1091,[17,385,85,858,1092,1093,946,984,804,1089,777,8]); __d(function(_g,r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"byNum",{enumerable:!0,get:function(){return s}}),e.tableKey=o,e.toggleTable=function(t,n){return t.includes(n)?t.filter(t=>t!==n):a(o([...t,n]))},e.seatsOf=function(t,n){const a={};for(const s of n)a[s]=t.tables.find(t=>t.name===s)?.maxSeats??0;return{per:a,total:Object.values(a).reduce((t,n)=>t+n,0)}},e.seatLine=function(t,n){const a=Math.max(0,n-t);return{text:`${t} ${1===t?'seat':'seats'} for ${l(n)}${a?`: ${a} short`:''}`,short:a,fits:0===a&&t>0}},e.pickClashes=u,e.requestedFreeTable=function(t,n,a,s,l=90){const o={id:n.id??'new',status:'confirmed',...n};for(const n of t)if(a.includes(n)&&!u(o,[n],s,l).length)return n;return null},e.overCapacityAsk=function(n,s,l){const u=a(o(n));if(!u.length||s>=l)return null;const c=u.map(n=>(0,t.tableNumbers)(n));return`${1===c.length?`Table ${c[0]} seats`:`Tables ${c.slice(0,-1).join(', ')} and ${c[c.length-1]} seat`} ${s} \u2013 this booking is ${l}. Use it anyway?`},e.clashWords=function(n){return n.map(n=>`${(0,t.tableNumbers)(n.table)} has ${n.with.walkIn?'a walk-in':(n.with.name||'a booking').replace(' (example)','')} at ${n.with.time}`).join('. ')+(n.length?'.':'')},e.tablesWords=c,e.pickA11y=function(n,a,s,l){return`Table ${(0,t.tableNumbers)(n)}, ${a} ${1===a?'seat':'seats'}${s?', selected':''}${l?`, has ${l.walkIn?'a walk-in':l.name} at ${l.time}`:''}`},e.pickGroups=function(t){return t.areas.map(n=>({area:n.name,tables:t.tables.filter(t=>t.areaId===n.id).map(t=>({name:t.name,seats:t.maxSeats})).sort((t,n)=>s(t.name,n.name))})).filter(t=>t.tables.length)},e.savedWords=function(t,n,a,s){return a.length?`${t}, ${l(n)}: ${c(a)} (${s} seats).`:`${t}: table taken off.`},e.tableActions=function(t,n){const s=a(t.table);if(['cancelled','noshow'].includes(t.status))return[];const o=[s.length?{id:'assign',label:'Change table',a11y:`Change table for ${n}, ${l(t.partySize)}, now ${c(s).toLowerCase()}. You can pick several tables to join.`}:{id:'assign',label:'Assign table',a11y:`Assign table for ${n}, ${l(t.partySize)}. You can pick several tables to join.`}];s.length&&o.push({id:'clear',label:'Clear table',a11y:`Clear table for ${n}, take ${c(s).toLowerCase()} off this booking`});return o},e.dragTables=function(t,n,s){if(!s||'__none'===s||s===n)return null;const l=a(t);if(l.includes(s))return null;return o('__none'!==n&&l.includes(n)?l.map(t=>t===n?s:t):[s])};var t=r(d[0]),n=r(d[1]);const a=t=>t?t.split('+').map(t=>t.trim()).filter(Boolean):[],s=(t,n)=>t.localeCompare(n,'en-GB',{numeric:!0}),l=t=>`${t} ${1===t?'person':'people'}`;function o(t){return[...new Set(t.map(t=>String(t).trim()).filter(Boolean))].sort(s).join('+')}function u(t,l,u,c=90){if(!l.length)return[];const f={...t,table:o(l)},b=[];for(const s of u)if(s.id!==t.id&&s.date===t.date&&!['cancelled','noshow','finished'].includes(s.status)&&(0,n.startOf)(f)<(0,n.endOf)(s,c)&&(0,n.startOf)(s)<(0,n.endOf)(f,c))for(const t of a(s.table))l.includes(t)&&b.push({table:t,with:s});return b.sort((t,n)=>s(t.table,n.table))}function c(n){const s=a(o(n));return s.length?(0,t.tableListNumbers)(s):'No table'}},1092,[843,1074]); __d(function(g,r,i,a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.primeAnnouncer=function(){u()},_e.announce=function(t){const e=String(t??'').trim();if(!e)return;{const t=u();if(!t)return;const n=++o;return t.textContent='',void setTimeout(()=>{n===o&&(t.textContent=e)},80)}},Object.defineProperty(_e,"lastAnnounced",{enumerable:!0,get:function(){return c}});var t,e=r(d[0]);(t=e)&&t.__esModule;r(d[1]);let n=null,o=0;function u(){if('undefined'==typeof document||!document.body)return null;if(n&&document.body.contains(n))return n;const t=document.createElement('div');return t.id='cc-announcer',t.setAttribute('aria-live','assertive'),t.setAttribute('aria-atomic','true'),t.setAttribute('role','status'),t.setAttribute('data-testid','cc-announcer'),Object.assign(t.style,{position:'absolute',width:'1px',height:'1px',margin:'-1px',padding:'0',overflow:'hidden',clip:'rect(0 0 0 0)',whiteSpace:'nowrap',border:'0'}),document.body.appendChild(t),n=t,t}const c=()=>n?.textContent??''},1093,[264,219]); -__d(function(g,_r,_i,_a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"TABLES",{enumerable:!0,get:function(){return A}}),_e.useTableNames=R,_e.resetTableLive=W,_e.seatBookingNow=async function(e,t){await k.repo.bookings.setStatus(t.id,'seated'),W(e,t.table)},_e.finishBookingNow=async function(e,t){const s=(new Date).toISOString();await k.repo.bookings.update(t.id,(0,N.finishClearPatch)(s,t.table)),(0,v.tablesOf)(t.table).forEach(t=>v.useFloor.getState().setLive(e,t,{stage:void 0,dirty:!0}))},_e.useTableUse=E,Object.defineProperty(_e,"walkInLabel",{enumerable:!0,get:function(){return _}}),_e.TablePicker=H,_e.WalkInSheet=q,_e.AssignTableSheet=V,_e.undoNotice=Y,_e.NewBookingSheet=G,_e.useFrontDoor=function(e,t){const[s,o]=(0,c.useState)(!1),[l,a]=(0,c.useState)(!1),[i,n]=(0,c.useState)(null);return{openWalkIn:()=>o({}),openWalkInAt:e=>o({table:e}),openBooking:()=>a(!0),assignTable:e=>n({b:e}),combineTables:e=>n({b:e,combine:!0}),elements:(0,F.jsxs)(F.Fragment,{children:[s?(0,F.jsx)(q,{wide:t,initialTable:s.table,onClose:()=>o(!1),onSeated:Y}):null,l?(0,F.jsx)(G,{wide:t,date:e,onClose:()=>a(!1),onSaved:e=>(0,u.notify)({id:`booked:${Date.now()}`,testID:'booking-saved-toast',timeoutMs:5e3,icon:'\u2713',title:`Booked: ${e.name} \xb7 ${(0,w.niceDate)((0,w.parseYmd)(e.date))} at ${e.time}`})}):null,i?(0,F.jsx)(V,{booking:i.b,combine:i.combine,onClose:()=>n(null)}):null]})}};var t=_r(_d[0]),s=_r(_d[1]),o=_r(_d[2]),l=_r(_d[3]),a=_r(_d[4]),i=_r(_d[5]),n=_r(_d[6]),r=_r(_d[7]),d=_r(_d[8]),u=_r(_d[9]),c=_r(_d[10]),b=e(c),h=_r(_d[11]),p=e(_r(_d[12])),m=e(_r(_d[13])),f=_r(_d[14]),y=_r(_d[15]),k=_r(_d[16]),x=_r(_d[17]),j=_r(_d[18]),w=_r(_d[19]),S=_r(_d[20]),T=_r(_d[21]),C=_r(_d[22]),v=_r(_d[23]),D=_r(_d[24]),I=_r(_d[25]),$=_r(_d[26]),P=_r(_d[27]),O=_r(_d[28]),B=_r(_d[29]),z=_r(_d[30]),M=_r(_d[31]),N=_r(_d[32]),F=_r(_d[33]);const L=e=>(0,u.notify)({id:'booking-blocked',testID:'booking-blocked-toast',timeoutMs:9e3,icon:'\u26a0',title:e}),A=Array.from({length:12},(e,t)=>String(t+1));function R(e){const t=(0,v.usePlan)(e);return t.areas.flatMap(e=>t.tables.filter(t=>t.areaId===e.id).map(e=>e.name))}function W(e,t){(0,v.tablesOf)(t).forEach(t=>v.useFloor.getState().setLive(e,t,{stage:'seated',dirty:!1}))}function E(e,t){const s=(0,k.useBookings)(e),o=(0,k.useOrders)(e),l=R(e),a=(0,v.useFloor)(t=>t.live[e])??{},i=(0,v.usePlan)(e),n=(0,D.useBlocks)(e=>e.blocks),r=(0,w.ymd)(t),d=(0,D.closedAreasAt)(n,e,r,(0,w.hm)(t)),u={};for(const e of l)u[e]=a[e]?.blocked||d.has(`tbl:${e}`)?{busy:!0,label:'Blocked'}:d.has(i.tables.find(t=>t.name===e)?.areaId??'')?{busy:!0,label:'Closed'}:a[e]?.dirty?{busy:!0,label:'Needs clearing'}:{busy:!1,label:'Free'};for(const e of s)if(e.date===r&&e.table)for(const s of(0,v.tablesOf)(e.table))if(u[s])if('seated'===e.status)u[s]={busy:!0,label:`${e.walkIn?'Walk-in':`${e.name.slice(0,1)}.`} \xb7 ${e.partySize}`};else if('confirmed'===e.status&&!u[s].busy){const o=(0,w.minsBetween)(t,new Date(`${e.date}T${e.time}:00`));o>=-15&&o<=90&&(u[s]={...u[s],soon:`Booked ${e.time}`})}for(const e of o)'table'===e.type&&e.tableNo&&u[e.tableNo]&&!['closed','cancelled','collected'].includes(e.status)&&!u[e.tableNo].busy&&(u[e.tableNo]={busy:!0,label:'Open order'});return u}const _=e=>e.walkIn?`Walk-in \xb7 ${e.partySize}`:`${e.name} \xb7 ${e.partySize}`;function H({use:e,value:t,onPick:s,big:o,best:a,dense:i,bestSet:n,picked:r}){const d=Object.keys(e),[u,b]=(0,c.useState)(0),h=i?6:8,f=i?64:o?92:76,y=u?Math.max(3,Math.floor((u+h)/(f+h))):0,k=y?Math.floor((u-h*(y-1))/y):f,x=new Set(n??[]),j=a?(0,v.tablesOf)(a)[0]:null;return(0,F.jsx)(m.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:h},testID:"table-picker",onLayout:e=>b(Math.floor(e.nativeEvent.layout.width)),children:d.map(o=>{const a=e[o],n=t===o||!!r?.includes(o),d=x.has(o),u=j===o&&!n,c=a.busy?['Blocked','Needs clearing','Closed'].includes(a.label)?a.label:'In use':a.soon??'Free';return(0,F.jsxs)(p.default,{accessibilityRole:"button",testID:`pick-table-${o}`,accessibilityLabel:`Table ${(0,l.tableNumbers)(o)}${r?n?', picked':', not picked':''}, ${a.busy?`in use (${a.label})`:a.soon?`free, ${a.soon}`:'free'}${d?', best table':''}${u?', suggested for this party':''}`,accessibilityState:{selected:n,disabled:'Closed'===a.label},disabled:'Closed'===a.label,onPress:()=>s(o),style:{width:k,minHeight:i?58:64,borderRadius:12,borderWidth:n||u?2.5:1.5,paddingVertical:i?3:6,paddingHorizontal:4,alignItems:'center',justifyContent:'center',gap:2,borderColor:n||u?S.colours.gold:a.busy?S.colours.red:S.colours.ok,backgroundColor:n?S.colours.goldTint:a.busy?S.colours.redBg:S.colours.surface2,opacity:'Closed'!==a.label||n?1:.55},children:[(0,F.jsxs)(m.default,{style:{flexDirection:'row',alignItems:'center',gap:4},children:[(0,F.jsx)(C.T,{weight:"bold",size:22,colour:n?S.colours.goldLight:S.colours.text,children:(0,l.tableNumbers)(o)}),d?(0,F.jsx)(m.default,{testID:"best-table",style:{backgroundColor:S.colours.gold,borderRadius:5,paddingHorizontal:4,paddingVertical:1},children:(0,F.jsx)(C.T,{size:11,weight:"bold",colour:S.colours.onGold,children:"BEST"})}):null]}),(0,F.jsx)(C.T,{size:i?13:14,colour:a.busy?'#FFD9D4':a.soon?'#FFE2A8':'#E2C489',center:!0,numberOfLines:1,children:c})]},o)})})}const U=[1,2,3,4,5,6,7,8];function q({onClose:e,onSeated:a,wide:i,initialTable:n}){const{rid:r,r:d,now:u}=(0,y.useCtx)(15e3),x=E(r,u),[T,I]=(0,c.useState)(2),[$,P]=(0,c.useState)(!1),[O,B]=(0,c.useState)(n??null),z=(0,v.usePlan)(r),N=(0,k.useBookings)(r),A=(0,D.useBlocks)(e=>e.blocks),R=(0,D.closedAreasAt)(A,r,(0,w.ymd)(u),(0,w.hm)(u)),_=b.default.useMemo(()=>{const e=Object.fromEntries(Object.entries(x).map(([e,t])=>[e,{status:t.busy?'seated':'free'}]));return(0,j.suggestTable)(z,N.filter(e=>e.date===(0,w.ymd)(u)),e,T,u,(0,j.turnFor)(T,d.settings.turnMins),90,void 0,{closed:R})?.table??null},[z,N,x,T,R.size,u.getTime()]);(0,c.useEffect)(()=>{O&&(0,v.tablesOf)(O).some(e=>'Closed'===x[e]?.label)&&B(null)},[O,R.size]);const[q,V]=(0,c.useState)(!1),[Y,G]=(0,c.useState)(''),K=(e,t=String(e),s=()=>{P(!1),I(e)})=>{const o='9+'===t?$:!$&&T===e;return(0,F.jsx)(p.default,{accessibilityRole:"button",accessibilityLabel:'9+'===t?'Party of 9 or more':`Party of ${e}`,accessibilityState:{selected:o},onPress:s,style:{width:i?58:60,height:i?58:56,borderRadius:14,borderWidth:2,borderColor:S.colours.gold,alignItems:'center',justifyContent:'center',backgroundColor:o?S.colours.gold:'transparent'},children:(0,F.jsx)(C.T,{weight:"bold",size:22,colour:o?S.colours.onGold:S.colours.gold,children:t})},t)},Q=(0,F.jsx)(s.PartySizeInput,{value:T,onChange:I,min:9,max:o.MAX_PARTY,label:"Walk-in party size",testID:"walkin-party-size"}),X=(0,F.jsxs)(m.default,{style:{gap:8,width:i?256:void 0},children:[(0,F.jsx)(C.T,{weight:"semibold",children:"How many people?"}),(0,F.jsxs)(m.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:8},testID:"walkin-party",children:[U.map(e=>K(e)),K(9,'9+',()=>{P(!0),I(e=>e>=9?e:9)})]}),$?Q:null]}),[J,Z]=(0,c.useState)(!1),ee=async(t=O)=>{if(!J&&(0,M.guardBookingChange)(L)){Z(!0);try{const s=await k.repo.bookings.seatWalkIn(r,T,t??void 0,Y);W(r,t??void 0),a(s),e()}finally{Z(!1)}}},te=(0,F.jsxs)(m.default,{style:{gap:8,flex:i?1:void 0,minWidth:0},children:[(0,F.jsxs)(C.Row,{style:{justifyContent:'space-between'},children:[(0,F.jsxs)(C.T,{weight:"semibold",children:["Table ",(0,F.jsx)(C.T,{colour:S.colours.muted,size:14,children:"(optional)"})]}),O?(0,F.jsx)(C.Button,{small:!0,kind:"ghost",label:"Clear table",onPress:()=>B(null)}):null]}),(0,F.jsx)(H,{use:x,value:O,onPick:e=>{x[e]&&!x[e].busy?ee(e):B(O===e?null:e)},big:i,dense:i,best:_,bestSet:(0,h.bestTables)(z)}),(0,F.jsxs)(C.Muted,{children:["Tap a free table to seat them there",_&&!O?` (suggested for ${T}: ${(0,l.tableNumbers)(_)})`:'',", or Seat for no table yet. BEST marks the venue\u2019s best tables."]})]});return(0,F.jsxs)(C.Sheet,{visible:!0,onClose:e,title:`Walk-in \xb7 ${(0,w.hm)(u)}`,maxWidth:i?1100:void 0,testID:"walkin-sheet",children:[(0,F.jsx)(C.Button,{label:`Seat walk-in \xb7 ${T} ${1===T?'person':'people'}${O?` \xb7 ${(0,l.tableNumbers)(O)}`:''}`,disabled:J,onPress:()=>{ee()},testID:"seat-walkin",style:{minHeight:52}}),i?(0,F.jsxs)(C.Row,{gap:16,style:{alignItems:'flex-start'},children:[X,te]}):(0,F.jsxs)(F.Fragment,{children:[X,te]}),(0,F.jsxs)(C.Row,{gap:10,wrap:!0,style:{alignItems:'center'},children:[q?(0,F.jsx)(t.TextInput,{accessibilityLabel:"Walk-in note",placeholder:"Note (optional), e.g. high chair",placeholderTextColor:"#7D776C",value:Y,onChangeText:G,style:[C.styles.input,{flex:1,minWidth:220}],autoFocus:!0}):(0,F.jsx)(C.Button,{small:!0,kind:"ghost",label:"Add a note (optional)",onPress:()=>V(!0)}),(0,F.jsx)(m.default,{style:{flex:1,minWidth:220},children:(0,F.jsxs)(C.Muted,{children:["No name needed. Counts in today's covers.",'staff'!==f.APP_VARIANT?' Using website bookings too? Mark the table there as well.':'']})})]})]})}function V({booking:e,onClose:t,combine:s}){const{rid:o,r:a,now:i}=(0,y.useCtx)(15e3),n=E(o,i),r=(0,v.usePlan)(o),d=(0,k.useBookings)(o),u=(0,v.tablesOf)(e.table),p=b.default.useMemo(()=>Object.fromEntries(Object.entries(n).map(([e,t])=>[e,u.includes(e)?{busy:!1,label:'This party',soon:'This party'}:t])),[n,e.table]),f=b.default.useMemo(()=>{const t=Object.fromEntries(Object.entries(p).map(([e,t])=>[e,{status:t.busy?'seated':'free'}]));return(0,j.suggestTable)(r,d.filter(e=>e.date===(0,w.ymd)(i)),t,e.partySize,i,(0,j.turnFor)(e.partySize,a.settings.turnMins),90,e.id)?.table??null},[r,d,p,e.partySize,i.getTime()]),[x,T]=(0,c.useState)(!!s||u.length>1),[D,I]=(0,c.useState)(u),$=e=>r.tables.find(t=>t.name===e)?.maxSeats??0,P=D.reduce((e,t)=>e+$(t),0),O=D.length>0&&P{if(!(0,M.guardBookingChange)(L))return;const l=(0,v.joinTables)(s);await k.repo.bookings.assignTable(e.id,l);u.filter(e=>!s.includes(e)).forEach(t=>v.useFloor.getState().setLive(o,t,{stage:void 0,dirty:'seated'===e.status})),'seated'===e.status&&W(o,l),t()},z=x?(0,F.jsxs)(m.default,{style:{gap:8},testID:"assign-table-tip",children:[(0,F.jsx)(m.default,{accessibilityLiveRegion:"polite",children:(0,F.jsx)(C.T,{size:17,weight:"semibold",colour:S.colours.text,children:D.length?`${(0,v.tablesLabel)((0,v.joinTables)(D))} \xb7 ${P} seats for ${e.partySize} Covers`:'No tables picked yet'})}),O?(0,F.jsx)(m.default,{testID:"combine-short",children:(0,F.jsxs)(C.T,{size:15,weight:"semibold",colour:"#FFD9D4",children:["Not enough seats yet: ",e.partySize-P," more needed. Add another table."]})}):null,(0,F.jsx)(C.T,{size:15,colour:S.colours.text,children:"Tap each table to add or remove it, then tap Done. All of them show as taken until the party has finished."}),(0,F.jsxs)(C.Row,{gap:8,wrap:!0,children:[(0,F.jsx)(C.Button,{label:"Done",testID:"combine-done",disabled:!D.length,accessibilityLabel:D.length?`Done, save ${(0,v.tableCardLabel)((0,v.joinTables)(D))}`:'Done',onPress:()=>B(D)}),(0,F.jsx)(C.Button,{kind:"ghost",label:"Cancel",onPress:t})]})]}):(0,F.jsx)(m.default,{style:{gap:8},testID:"assign-table-tip",children:(0,F.jsx)(C.T,{size:15,colour:S.colours.text,children:"Red tables are in use right now; you can still pick one (e.g. joining a table). BEST marks the venue\u2019s best tables. Big party? Tap Combine tables."})});return(0,F.jsxs)(C.Sheet,{visible:!0,onClose:t,title:`${x?'Combine tables':'Assign table'} \xb7 ${_(e)}`,testID:"assign-table-sheet",footer:z,children:[f&&!x?(0,F.jsx)(m.default,{testID:"assign-suggested",children:(0,F.jsxs)(C.T,{size:16,weight:"semibold",colour:S.colours.goldLight,accessibilityLabel:`Suggested for ${e.partySize}: ${(0,v.tableCardLabel)(f)}`,children:["Suggested for ",e.partySize,": ",(0,l.tableNumbers)(f)]})}):null,x?null:(0,F.jsx)(C.Button,{kind:"secondary",label:"Combine tables",testID:"combine-start",accessibilityLabel:"Combine tables: pick several tables for this party",onPress:()=>T(!0)}),(0,F.jsx)(H,{use:p,best:x?null:f,bestSet:(0,h.bestTables)(r),picked:x?D:void 0,onPick:x?e=>I(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]):async e=>{await B([e])}})]})}function Y(e){(0,u.notify)({id:`walkin:${e.id}`,testID:'walkin-toast',timeoutMs:6e3,title:`${_(e)} seated \xb7 ${e.table?`${(0,l.tableNumbers)(e.table)}`:'table to assign'} (${e.ref})`,actions:[{label:'Undo',testID:'undo-walkin',onPress:()=>k.repo.bookings.undoWalkIn(e.id)},{label:'OK',kind:'ghost'}]})}function G({date:e,onClose:t,wide:s,onSaved:u}){const{rid:b,r:h,now:p,role:f,meId:N}=(0,y.useCtx)(6e4);(0,d.useBlurOutside)();const A=(0,w.ymd)(p),[R,W]=(0,c.useState)(ee.blocks),[H,U]=(0,c.useState)(!1),[q,V]=(0,c.useState)(''),[Y,G]=(0,c.useState)(2),[K,Q]=(0,c.useState)(0),X=Math.min(K,Math.max(0,Y-1)),[J,Z]=(0,c.useState)(null),[ee,te]=(0,c.useState)(''),[se,oe]=(0,c.useState)(''),[le,ae]=(0,c.useState)(''),[ie,ne]=(0,c.useState)('phone'),[re,de]=(0,c.useState)((0,$.emptyNeeds)()),ue=(0,$.needsMissing)(re),[ce,be]=(0,c.useState)(null),ge=(0,v.usePlan)(b),he=(0,B.dogSetUp)(ge),pe=!0===re.dog&&he,me=re.dog?re.dogs:0,fe=(0,w.parseYmd)(R),ye=(0,j.turnFor)(Y,h.settings.turnMins),ke=E.filter(e=>e.date===R),xe=e=>(0,j.freeTablesAt)(ge,ke,Y,new Date(`${R}${(0,l.tableNumbers)(e)}:00`),ye,h.settings.turnMins,{dog:!0,closed:(0,D.closedAreasAt)(_,b,R,e)}),je=pe&&J?xe(J):[];(0,c.useEffect)(()=>{be(null)},[pe,J,Y]);const we=(0,x.bookingSlots)(h,fe,e=>E.filter(t=>t.date===R&&t.time===e&&'cancelled'!==t.status&&!t.walkIn).reduce((e,t)=>e+t.partySize,0),Y,R===(0,w.ymd)(p)?p:(0,w.addMins)(fe,0),e=>E.filter(t=>t.date===R&&t.time===e&&'cancelled'!==t.status&&!t.walkIn).length),Se=(0,T.guestPhone)(se),[Te,Ce]=(0,c.useState)(!1),ve=J?we.find(e=>e.time===J):void 0,De=ve&&ve.left=2&&!!J&&(!$e||Te)&&(0,o.validParty)(Y)&&Se.ok&&(0,T.emailOk)(le)&&(!Pe||Oe&&H)&&(!pe||je.length>0)&&!Be,Me=re.wheelchair>0||re.stepFree;return(0,F.jsxs)(C.Sheet,{visible:!0,onClose:t,title:`New booking \xb7 ${(0,w.niceDate)(fe)}`,maxWidth:s?760:void 0,testID:"booking-sheet",children:[(0,F.jsx)($.FirstQuestions,{rid:b,value:re,onChange:de,party:Y,audience:"staff"}),re.dog&&!he?(0,F.jsx)(C.T,{size:13,colour:S.colours.amber,children:"Dog-friendly tables aren\u2019t marked yet. Managers \u203a Booking options \u203a Tables. Booking is allowed; check where the dog can sit."}):null,(0,F.jsx)(I.BookingDatePicker,{r:h,today:p,value:R,onChange:e=>{e!==R&&(W(e),Z(null),U(!1))}}),(0,F.jsxs)(C.Row,{gap:6,children:[(0,F.jsx)(C.Chip,{label:"Phone",selected:'phone'===ie,onPress:()=>ne('phone')}),(0,F.jsx)(C.Chip,{label:"In person",selected:'in-person'===ie,onPress:()=>ne('in-person')})]}),(0,F.jsx)(C.Field,{label:"Name",value:q,onChangeText:V,placeholder:"e.g. Reid",testID:"nb-name"}),(0,F.jsx)(C.Field,{label:"Mobile or phone number (needed)",value:se,onChangeText:oe,keyboardType:"phone-pad",placeholder:"e.g. 07700 900123",testID:"nb-phone"}),!Se.ok&&se?(0,F.jsx)(C.T,{size:13,colour:S.colours.amber,children:Se.error}):null,(0,F.jsx)(C.Field,{label:"Email (optional)",value:le,onChangeText:ae,keyboardType:"email-address",autoCapitalize:"none",placeholder:"For an email confirmation too",testID:"nb-email"}),(0,T.emailOk)(le)?null:(0,F.jsx)(C.T,{size:13,colour:S.colours.amber,children:"That email doesn\u2019t look quite right."}),(0,F.jsx)(n.AdultsChildren,{value:(0,r.peopleOf)(Y,X),onChange:e=>{G(e.partySize),Q(e.children),Ce(!1)},depositsOn:(0,i.depositOf)(h.settings).on&&(0,i.depositOf)(h.settings).perPersonPence>0,testID:"nb-people"}),(0,F.jsx)(C.Row,{wrap:!0,gap:6,children:we.map(e=>{const t=pe&&e.available&&!xe(e.time).length||!(0,$.dogTimeOk)(h,E,R,e.time,me);return(0,F.jsx)(C.Chip,{testID:`nb-slot-${e.time}`,label:e.time,sub:(0,D.blockAt)(_,b,R,e.time)?'Paused':t?'Dogs full':e.drinksOnly?'Drinks only':null!=e.partiesLeft&&e.partiesLeft<1||e.left<=0?'Full':`${e.left} left`,disabled:(e.past??!e.available)||t,selected:J===e.time,onPress:()=>{Z(e.time),U(!1),Ce(!1)}},e.time)})}),$e?(0,F.jsxs)(m.default,{testID:"nb-over-capacity",accessible:!0,accessibilityLiveRegion:"polite",style:{borderWidth:1.5,borderColor:S.colours.amber,backgroundColor:S.colours.amberBg,borderRadius:12,padding:10,gap:6},children:[De?(0,F.jsx)(C.T,{weight:"semibold",colour:S.colours.amber,children:(0,o.overCapacityNote)(Y,De.left,De.time)}):null,Ie?(0,F.jsx)(C.T,{weight:"semibold",colour:S.colours.amber,children:(0,o.overPartiesNote)(Ie.time,Ie.cap)}):null,(0,F.jsx)(C.Chip,{label:Te?'Booking over the limit: on':'Book anyway (over the limit)',selected:Te,onPress:()=>Ce(e=>!e),testID:"nb-over-ok"})]}):null,pe&&J?(0,F.jsxs)(m.default,{style:{gap:6},testID:"nb-dog-tables",children:[(0,F.jsxs)(C.T,{size:14,weight:"semibold",children:["Dog-friendly table ",(0,F.jsxs)(C.T,{size:13,colour:S.colours.muted,children:["(",ge.areas.filter(e=>e.dogs).map(e=>e.name).join(' or '),")"]})]}),je.length?(0,F.jsx)(C.Row,{wrap:!0,gap:6,children:je.slice(0,10).map((e,t)=>(0,F.jsx)(C.Chip,{label:`${(0,l.tableNumbers)(e.table)}`,sub:`${e.area} \xb7 ${e.seats}${0===t?' \xb7 best':''}${Me&&(0,B.accessibleSetUp)(ge)&&!(0,B.isAccessible)(ge,e.table)?' \xb7 not step-free':''}`,selected:(ce??je[0].table)===e.table,onPress:()=>be(e.table)},e.table))}):(0,F.jsxs)(C.T,{size:14,colour:S.colours.amber,children:["No dog-friendly table free for ",Y," at ",J,". Try another time."]})]}):null,Pe?(0,F.jsxs)(m.default,{testID:"nb-block-warning",style:{borderWidth:1.5,borderColor:S.colours.amber,backgroundColor:S.colours.amberBg,borderRadius:12,padding:10,gap:6},children:[(0,F.jsxs)(C.T,{weight:"semibold",colour:S.colours.amber,children:["Bookings are paused ",Pe.from,"\u2013",Pe.to,Pe.reason?` (${Pe.reason})`:'']}),Oe?(0,F.jsx)(C.Chip,{label:H?'Manager override on':'Override and book anyway',selected:H,onPress:()=>U(e=>!e)}):(0,F.jsx)(C.Muted,{children:"Ask a manager to override, or pick another time."})]}):null,we.length?null:(0,F.jsx)(m.default,{testID:"nb-closed",children:(0,F.jsxs)(C.T,{size:14,weight:"semibold",colour:S.colours.amber,children:["Closed on ",(0,w.niceDate)(fe)," (per the venue\u2019s opening hours). Pick another date."]})}),(0,F.jsx)($.MoreQuestions,{rid:b,r:h,value:re,onChange:de,party:Y,date:R,time:J,today:(0,w.ymd)(p),bookings:E,audience:"staff",showTables:!1!==h.settings.tableRequests}),Me&&!(0,B.accessibleSetUp)(ge)?(0,F.jsx)(C.T,{size:13,colour:S.colours.amber,children:"Step-free tables aren\u2019t marked yet (Managers \u203a Booking options \u203a Tables). Check the table works for a wheelchair."}):null,(0,F.jsx)(C.Field,{label:"Notes (optional)",value:ee,onChangeText:te,placeholder:P.NOTES_PLACEHOLDER,multiline:!0,numberOfLines:3,testID:"nb-notes"}),(0,i.depositDue)((0,i.depositOf)(h.settings),Y,X)?(0,F.jsxs)(C.Muted,{testID:"nb-deposit",children:["Deposit due: ",(0,a.gbp)((0,i.depositDue)((0,i.depositOf)(h.settings),Y,X))," (",(0,a.gbp)((0,i.depositOf)(h.settings).perPersonPence)," per adult for ",(0,i.depositOf)(h.settings).fromParty,"+",X?`; ${X} ${1===X?'child':'children'} free`:'; children free',"). Deposits are paid through website bookings or to you, never in CoverCharge: tick Deposit paid on the booking once the guest has paid."]}):null,(0,F.jsxs)(C.Muted,{children:["The guest gets a confirmation text",le.trim()?' and email':''," automatically (preview mode: shown in the Outbox, not sent)."]}),Be?(0,F.jsxs)(C.T,{size:14,colour:S.colours.amber,children:["We already have the most dogs we can look after at ",J,". Try another time: dogs are very welcome then."]}):null,(0,F.jsx)(C.Button,{label:ue.length?ue[0]:'Save booking',testID:"nb-save",disabled:!ze,onPress:()=>{if(R<(0,w.ymd)(p))return;if(!(0,M.guardBookingChange)(L))return;const e=(0,$.needsPatch)(re),s=re.tableReq.find(e=>!pe||je.some(t=>t.table===e)),o=pe?null:(0,z.requestedFreeTable)(re.tableReq,{date:R,time:J,partySize:Y},ge.tables.map(e=>e.name),ke,h.settings.turnMins);k.repo.bookings.create({restaurantId:b,customerId:null,name:q.trim(),partySize:Y,date:R,time:J,notes:ee.trim(),security:(0,i.depositDue)((0,i.depositOf)(h.settings),Y,X)?'deposit':'none',depositPaid:0,...X?{children:X}:{},...(0,i.depositDue)((0,i.depositOf)(h.settings),Y,X)?{depositDue:(0,i.depositDue)((0,i.depositOf)(h.settings),Y,X),depositPolicy:(0,i.depositWords)((0,i.depositOf)(h.settings),Y,h.name,X).join(' '),depositRefundable:(0,i.depositOf)(h.settings).refundable,depositCutoffHours:(0,i.depositOf)(h.settings).cutoffHours}:{},phone:Se.pretty,email:le.trim()||void 0,source:ie,...e,...we.find(e=>e.time===J)?.drinksOnly?{drinksOnly:!0}:{},allergies:e.allergies??[],...pe?{table:ce??s??je[0]?.table}:o?{table:o}:{}}).then(e=>(0,O.postNewBookingToKitchen)(e,N)).catch(()=>{}),u?.({date:R,time:J,name:q.trim()}),t()}})]})}},1094,[812,1095,1096,843,851,841,1097,1098,1099,1100,17,842,385,85,856,1055,858,1101,1074,863,804,848,777,996,993,1102,1103,1108,1076,1053,1092,1091,1109,8]); +__d(function(g,_r,_i,_a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"TABLES",{enumerable:!0,get:function(){return A}}),_e.useTableNames=R,_e.resetTableLive=W,_e.seatBookingNow=async function(e,t){await k.repo.bookings.setStatus(t.id,'seated'),W(e,t.table)},_e.finishBookingNow=async function(e,t){const s=(new Date).toISOString();await k.repo.bookings.update(t.id,(0,N.finishClearPatch)(s,t.table)),(0,v.tablesOf)(t.table).forEach(t=>v.useFloor.getState().setLive(e,t,{stage:void 0,dirty:!0}))},_e.useTableUse=E,Object.defineProperty(_e,"walkInLabel",{enumerable:!0,get:function(){return _}}),_e.TablePicker=H,_e.WalkInSheet=q,_e.AssignTableSheet=V,_e.undoNotice=Y,_e.NewBookingSheet=G,_e.useFrontDoor=function(e,t){const[s,o]=(0,c.useState)(!1),[l,a]=(0,c.useState)(!1),[i,n]=(0,c.useState)(null);return{openWalkIn:()=>o({}),openWalkInAt:e=>o({table:e}),openBooking:()=>a(!0),assignTable:e=>n({b:e}),combineTables:e=>n({b:e,combine:!0}),elements:(0,F.jsxs)(F.Fragment,{children:[s?(0,F.jsx)(q,{wide:t,initialTable:s.table,onClose:()=>o(!1),onSeated:Y}):null,l?(0,F.jsx)(G,{wide:t,date:e,onClose:()=>a(!1),onSaved:e=>(0,u.notify)({id:`booked:${Date.now()}`,testID:'booking-saved-toast',timeoutMs:5e3,icon:'\u2713',title:`Booked: ${e.name} \xb7 ${(0,w.niceDate)((0,w.parseYmd)(e.date))} at ${e.time}`})}):null,i?(0,F.jsx)(V,{booking:i.b,combine:i.combine,onClose:()=>n(null)}):null]})}};var t=_r(_d[0]),s=_r(_d[1]),o=_r(_d[2]),l=_r(_d[3]),a=_r(_d[4]),i=_r(_d[5]),n=_r(_d[6]),r=_r(_d[7]),d=_r(_d[8]),u=_r(_d[9]),c=_r(_d[10]),b=e(c),h=_r(_d[11]),p=e(_r(_d[12])),m=e(_r(_d[13])),f=_r(_d[14]),y=_r(_d[15]),k=_r(_d[16]),x=_r(_d[17]),j=_r(_d[18]),w=_r(_d[19]),S=_r(_d[20]),T=_r(_d[21]),C=_r(_d[22]),v=_r(_d[23]),D=_r(_d[24]),I=_r(_d[25]),$=_r(_d[26]),P=_r(_d[27]),O=_r(_d[28]),B=_r(_d[29]),z=_r(_d[30]),M=_r(_d[31]),N=_r(_d[32]),F=_r(_d[33]);const L=e=>(0,u.notify)({id:'booking-blocked',testID:'booking-blocked-toast',timeoutMs:9e3,icon:'\u26a0',title:e}),A=Array.from({length:12},(e,t)=>String(t+1));function R(e){const t=(0,v.usePlan)(e);return t.areas.flatMap(e=>t.tables.filter(t=>t.areaId===e.id).map(e=>e.name))}function W(e,t){(0,v.tablesOf)(t).forEach(t=>v.useFloor.getState().setLive(e,t,{stage:'seated',dirty:!1}))}function E(e,t){const s=(0,k.useBookings)(e),o=(0,k.useOrders)(e),l=R(e),a=(0,v.useFloor)(t=>t.live[e])??{},i=(0,v.usePlan)(e),n=(0,D.useBlocks)(e=>e.blocks),r=(0,w.ymd)(t),d=(0,D.closedAreasAt)(n,e,r,(0,w.hm)(t)),u={};for(const e of l)u[e]=a[e]?.blocked||d.has(`tbl:${e}`)?{busy:!0,label:'Blocked'}:d.has(i.tables.find(t=>t.name===e)?.areaId??'')?{busy:!0,label:'Closed'}:a[e]?.dirty?{busy:!0,label:'Needs clearing'}:{busy:!1,label:'Free'};for(const e of s)if(e.date===r&&e.table)for(const s of(0,v.tablesOf)(e.table))if(u[s])if('seated'===e.status)u[s]={busy:!0,label:`${e.walkIn?'Walk-in':`${e.name.slice(0,1)}.`} \xb7 ${e.partySize}`};else if('confirmed'===e.status&&!u[s].busy){const o=(0,w.minsBetween)(t,new Date(`${e.date}T${e.time}:00`));o>=-15&&o<=90&&(u[s]={...u[s],soon:`Booked ${e.time}`})}for(const e of o)'table'===e.type&&e.tableNo&&u[e.tableNo]&&!['closed','cancelled','collected'].includes(e.status)&&!u[e.tableNo].busy&&(u[e.tableNo]={busy:!0,label:'Open order'});return u}const _=e=>e.walkIn?`Walk-in \xb7 ${e.partySize}`:`${e.name} \xb7 ${e.partySize}`;function H({use:e,value:t,onPick:s,big:o,best:a,dense:i,bestSet:n,picked:r}){const d=Object.keys(e),[u,b]=(0,c.useState)(0),h=i?6:8,f=i?64:o?92:76,y=u?Math.max(3,Math.floor((u+h)/(f+h))):0,k=y?Math.floor((u-h*(y-1))/y):f,x=new Set(n??[]),j=a?(0,v.tablesOf)(a)[0]:null;return(0,F.jsx)(m.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:h},testID:"table-picker",onLayout:e=>b(Math.floor(e.nativeEvent.layout.width)),children:d.map(o=>{const a=e[o],n=t===o||!!r?.includes(o),d=x.has(o),u=j===o&&!n,c=a.busy?['Blocked','Needs clearing','Closed'].includes(a.label)?a.label:'In use':a.soon??'Free';return(0,F.jsxs)(p.default,{accessibilityRole:"button",testID:`pick-table-${o}`,accessibilityLabel:`Table ${(0,l.tableNumbers)(o)}${r?n?', picked':', not picked':''}, ${a.busy?`in use (${a.label})`:a.soon?`free, ${a.soon}`:'free'}${d?', best table':''}${u?', suggested for this party':''}`,accessibilityState:{selected:n,disabled:'Closed'===a.label},disabled:'Closed'===a.label,onPress:()=>s(o),style:{width:k,minHeight:i?58:64,borderRadius:12,borderWidth:n||u?2.5:1.5,paddingVertical:i?3:6,paddingHorizontal:4,alignItems:'center',justifyContent:'center',gap:2,borderColor:n||u?S.colours.gold:a.busy?S.colours.red:S.colours.ok,backgroundColor:n?S.colours.goldTint:a.busy?S.colours.redBg:S.colours.surface2,opacity:'Closed'!==a.label||n?1:.55},children:[(0,F.jsxs)(m.default,{style:{flexDirection:'row',alignItems:'center',gap:4},children:[(0,F.jsx)(C.T,{weight:"bold",size:22,colour:n?S.colours.goldLight:S.colours.text,children:(0,l.tableNumbers)(o)}),d?(0,F.jsx)(m.default,{testID:"best-table",style:{backgroundColor:S.colours.gold,borderRadius:5,paddingHorizontal:4,paddingVertical:1},children:(0,F.jsx)(C.T,{size:11,weight:"bold",colour:S.colours.onGold,children:"BEST"})}):null]}),(0,F.jsx)(C.T,{size:i?13:14,colour:a.busy?'#FFD9D4':a.soon?'#FFE2A8':'#E2C489',center:!0,numberOfLines:1,children:c})]},o)})})}const U=[1,2,3,4,5,6,7,8];function q({onClose:e,onSeated:a,wide:i,initialTable:n}){const{rid:r,r:d,now:u}=(0,y.useCtx)(15e3),x=E(r,u),[T,I]=(0,c.useState)(2),[$,P]=(0,c.useState)(!1),[O,B]=(0,c.useState)(n??null),z=(0,v.usePlan)(r),N=(0,k.useBookings)(r),A=(0,D.useBlocks)(e=>e.blocks),R=(0,D.closedAreasAt)(A,r,(0,w.ymd)(u),(0,w.hm)(u)),_=b.default.useMemo(()=>{const e=Object.fromEntries(Object.entries(x).map(([e,t])=>[e,{status:t.busy?'seated':'free'}]));return(0,j.suggestTable)(z,N.filter(e=>e.date===(0,w.ymd)(u)),e,T,u,(0,j.turnFor)(T,d.settings.turnMins),90,void 0,{closed:R})?.table??null},[z,N,x,T,R.size,u.getTime()]);(0,c.useEffect)(()=>{O&&(0,v.tablesOf)(O).some(e=>'Closed'===x[e]?.label)&&B(null)},[O,R.size]);const[q,V]=(0,c.useState)(!1),[Y,G]=(0,c.useState)(''),K=(e,t=String(e),s=()=>{P(!1),I(e)})=>{const o='9+'===t?$:!$&&T===e;return(0,F.jsx)(p.default,{accessibilityRole:"button",accessibilityLabel:'9+'===t?'Party of 9 or more':`Party of ${e}`,accessibilityState:{selected:o},onPress:s,style:{width:i?58:60,height:i?58:56,borderRadius:14,borderWidth:2,borderColor:S.colours.gold,alignItems:'center',justifyContent:'center',backgroundColor:o?S.colours.gold:'transparent'},children:(0,F.jsx)(C.T,{weight:"bold",size:22,colour:o?S.colours.onGold:S.colours.gold,children:t})},t)},Q=(0,F.jsx)(s.PartySizeInput,{value:T,onChange:I,min:9,max:o.MAX_PARTY,label:"Walk-in party size",testID:"walkin-party-size"}),X=(0,F.jsxs)(m.default,{style:{gap:8,width:i?256:void 0},children:[(0,F.jsx)(C.T,{weight:"semibold",children:"How many people?"}),(0,F.jsxs)(m.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:8},testID:"walkin-party",children:[U.map(e=>K(e)),K(9,'9+',()=>{P(!0),I(e=>e>=9?e:9)})]}),$?Q:null]}),[J,Z]=(0,c.useState)(!1),ee=async(t=O)=>{if(!J&&(0,M.guardBookingChange)(L)){Z(!0);try{const s=await k.repo.bookings.seatWalkIn(r,T,t??void 0,Y);W(r,t??void 0),a(s),e()}finally{Z(!1)}}},te=(0,F.jsxs)(m.default,{style:{gap:8,flex:i?1:void 0,minWidth:0},children:[(0,F.jsxs)(C.Row,{style:{justifyContent:'space-between'},children:[(0,F.jsxs)(C.T,{weight:"semibold",children:["Table ",(0,F.jsx)(C.T,{colour:S.colours.muted,size:14,children:"(optional)"})]}),O?(0,F.jsx)(C.Button,{small:!0,kind:"ghost",label:"Clear table",onPress:()=>B(null)}):null]}),(0,F.jsx)(H,{use:x,value:O,onPick:e=>{x[e]&&!x[e].busy?ee(e):B(O===e?null:e)},big:i,dense:i,best:_,bestSet:(0,h.bestTables)(z)}),(0,F.jsxs)(C.Muted,{children:["Tap a free table to seat them there",_&&!O?` (suggested for ${T}: ${(0,l.tableNumbers)(_)})`:'',", or Seat for no table yet. BEST marks the venue\u2019s best tables."]})]});return(0,F.jsxs)(C.Sheet,{visible:!0,onClose:e,title:`Walk-in \xb7 ${(0,w.hm)(u)}`,maxWidth:i?1100:void 0,testID:"walkin-sheet",children:[(0,F.jsx)(C.Button,{label:`Seat walk-in \xb7 ${T} ${1===T?'person':'people'}${O?` \xb7 ${(0,l.tableNumbers)(O)}`:''}`,disabled:J,onPress:()=>{ee()},testID:"seat-walkin",style:{minHeight:52}}),i?(0,F.jsxs)(C.Row,{gap:16,style:{alignItems:'flex-start'},children:[X,te]}):(0,F.jsxs)(F.Fragment,{children:[X,te]}),(0,F.jsxs)(C.Row,{gap:10,wrap:!0,style:{alignItems:'center'},children:[q?(0,F.jsx)(t.TextInput,{accessibilityLabel:"Walk-in note",placeholder:"Note (optional), e.g. high chair",placeholderTextColor:"#7D776C",value:Y,onChangeText:G,style:[C.styles.input,{flex:1,minWidth:220}],autoFocus:!0}):(0,F.jsx)(C.Button,{small:!0,kind:"ghost",label:"Add a note (optional)",onPress:()=>V(!0)}),(0,F.jsx)(m.default,{style:{flex:1,minWidth:220},children:(0,F.jsxs)(C.Muted,{children:["No name needed. Counts in today's covers.",'staff'!==f.APP_VARIANT?' Using website bookings too? Mark the table there as well.':'']})})]})]})}function V({booking:e,onClose:t,combine:s}){const{rid:o,r:a,now:i}=(0,y.useCtx)(15e3),n=E(o,i),r=(0,v.usePlan)(o),d=(0,k.useBookings)(o),u=(0,v.tablesOf)(e.table),p=b.default.useMemo(()=>Object.fromEntries(Object.entries(n).map(([e,t])=>[e,u.includes(e)?{busy:!1,label:'This party',soon:'This party'}:t])),[n,e.table]),f=b.default.useMemo(()=>{const t=Object.fromEntries(Object.entries(p).map(([e,t])=>[e,{status:t.busy?'seated':'free'}]));return(0,j.suggestTable)(r,d.filter(e=>e.date===(0,w.ymd)(i)),t,e.partySize,i,(0,j.turnFor)(e.partySize,a.settings.turnMins),90,e.id)?.table??null},[r,d,p,e.partySize,i.getTime()]),[x,T]=(0,c.useState)(!!s||u.length>1),[D,I]=(0,c.useState)(u),$=e=>r.tables.find(t=>t.name===e)?.maxSeats??0,P=D.reduce((e,t)=>e+$(t),0),O=D.length>0&&P{if(!(0,M.guardBookingChange)(L))return;const l=(0,v.joinTables)(s);await k.repo.bookings.assignTable(e.id,l);u.filter(e=>!s.includes(e)).forEach(t=>v.useFloor.getState().setLive(o,t,{stage:void 0,dirty:'seated'===e.status})),'seated'===e.status&&W(o,l),t()},z=x?(0,F.jsxs)(m.default,{style:{gap:8},testID:"assign-table-tip",children:[(0,F.jsx)(m.default,{accessibilityLiveRegion:"polite",children:(0,F.jsx)(C.T,{size:17,weight:"semibold",colour:S.colours.text,children:D.length?`${(0,v.tablesLabel)((0,v.joinTables)(D))} \xb7 ${P} seats for ${e.partySize} Covers`:'No tables picked yet'})}),O?(0,F.jsx)(m.default,{testID:"combine-short",children:(0,F.jsxs)(C.T,{size:15,weight:"semibold",colour:"#FFD9D4",children:["Not enough seats yet: ",e.partySize-P," more needed. Add another table."]})}):null,(0,F.jsx)(C.T,{size:15,colour:S.colours.text,children:"Tap each table to add or remove it, then tap Done. All of them show as taken until the party has finished."}),(0,F.jsxs)(C.Row,{gap:8,wrap:!0,children:[(0,F.jsx)(C.Button,{label:"Done",testID:"combine-done",disabled:!D.length,accessibilityLabel:D.length?`Done, save ${(0,v.tableCardLabel)((0,v.joinTables)(D))}`:'Done',onPress:()=>B(D)}),(0,F.jsx)(C.Button,{kind:"ghost",label:"Cancel",onPress:t})]})]}):(0,F.jsx)(m.default,{style:{gap:8},testID:"assign-table-tip",children:(0,F.jsx)(C.T,{size:15,colour:S.colours.text,children:"Red tables are in use right now; you can still pick one (e.g. joining a table). BEST marks the venue\u2019s best tables. Big party? Tap Combine tables."})});return(0,F.jsxs)(C.Sheet,{visible:!0,onClose:t,title:`${x?'Combine tables':'Assign table'} \xb7 ${_(e)}`,testID:"assign-table-sheet",footer:z,children:[f&&!x?(0,F.jsx)(m.default,{testID:"assign-suggested",children:(0,F.jsxs)(C.T,{size:16,weight:"semibold",colour:S.colours.goldLight,accessibilityLabel:`Suggested for ${e.partySize}: ${(0,v.tableCardLabel)(f)}`,children:["Suggested for ",e.partySize,": ",(0,l.tableNumbers)(f)]})}):null,x?null:(0,F.jsx)(C.Button,{kind:"secondary",label:"Combine tables",testID:"combine-start",accessibilityLabel:"Combine tables: pick several tables for this party",onPress:()=>T(!0)}),(0,F.jsx)(H,{use:p,best:x?null:f,bestSet:(0,h.bestTables)(r),picked:x?D:void 0,onPick:x?e=>I(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]):async e=>{await B([e])}})]})}function Y(e){(0,u.notify)({id:`walkin:${e.id}`,testID:'walkin-toast',timeoutMs:6e3,title:`${_(e)} seated \xb7 ${e.table?`${(0,l.tableNumbers)(e.table)}`:'table to assign'} (${e.ref})`,actions:[{label:'Undo',testID:'undo-walkin',onPress:()=>k.repo.bookings.undoWalkIn(e.id)},{label:'OK',kind:'ghost'}]})}function G({date:e,onClose:t,wide:s,onSaved:u}){const{rid:b,r:h,now:p,role:f,meId:N}=(0,y.useCtx)(6e4);(0,d.useBlurOutside)();const A=(0,w.ymd)(p),[R,W]=(0,c.useState)(ee.blocks),[H,U]=(0,c.useState)(!1),[q,V]=(0,c.useState)(''),[Y,G]=(0,c.useState)(2),[K,Q]=(0,c.useState)(0),X=Math.min(K,Math.max(0,Y-1)),[J,Z]=(0,c.useState)(null),[ee,te]=(0,c.useState)(''),[se,oe]=(0,c.useState)(''),[le,ae]=(0,c.useState)(''),[ie,ne]=(0,c.useState)('phone'),[re,de]=(0,c.useState)((0,$.emptyNeeds)()),ue=(0,$.needsMissing)(re),[ce,be]=(0,c.useState)(null),ge=(0,v.usePlan)(b),he=(0,B.dogSetUp)(ge),pe=!0===re.dog&&he,me=re.dog?re.dogs:0,fe=(0,w.parseYmd)(R),ye=(0,j.turnFor)(Y,h.settings.turnMins),ke=E.filter(e=>e.date===R),xe=e=>(0,j.freeTablesAt)(ge,ke,Y,new Date(`${R}${(0,l.tableNumbers)(e)}:00`),ye,h.settings.turnMins,{dog:!0,closed:(0,D.closedAreasAt)(_,b,R,e)}),je=pe&&J?xe(J):[];(0,c.useEffect)(()=>{be(null)},[pe,J,Y]);const we=(0,x.bookingSlots)(h,fe,e=>E.filter(t=>t.date===R&&t.time===e&&'cancelled'!==t.status&&!t.walkIn).reduce((e,t)=>e+t.partySize,0),Y,R===(0,w.ymd)(p)?p:(0,w.addMins)(fe,0),e=>E.filter(t=>t.date===R&&t.time===e&&'cancelled'!==t.status&&!t.walkIn).length),Se=(0,T.guestPhone)(se),[Te,Ce]=(0,c.useState)(!1),ve=J?we.find(e=>e.time===J):void 0,De=ve&&ve.left=2&&!!J&&(!$e||Te)&&(0,o.validParty)(Y)&&Se.ok&&(0,T.emailOk)(le)&&(!Pe||Oe&&H)&&(!pe||je.length>0)&&!Be,Me=re.wheelchair>0||re.stepFree;return(0,F.jsxs)(C.Sheet,{visible:!0,onClose:t,title:`New booking \xb7 ${(0,w.niceDate)(fe)}`,maxWidth:s?760:void 0,testID:"booking-sheet",children:[(0,F.jsx)($.FirstQuestions,{rid:b,value:re,onChange:de,party:Y,audience:"staff"}),re.dog&&!he?(0,F.jsx)(C.T,{size:13,colour:S.colours.amber,children:"Dog-friendly tables aren\u2019t marked yet. Managers \u203a Booking options \u203a Tables. Booking is allowed; check where the dog can sit."}):null,(0,F.jsx)(I.BookingDatePicker,{r:h,today:p,value:R,onChange:e=>{e!==R&&(W(e),Z(null),U(!1))}}),(0,F.jsxs)(C.Row,{gap:6,children:[(0,F.jsx)(C.Chip,{label:"Phone",selected:'phone'===ie,onPress:()=>ne('phone')}),(0,F.jsx)(C.Chip,{label:"In person",selected:'in-person'===ie,onPress:()=>ne('in-person')})]}),(0,F.jsx)(C.Field,{label:"Name",value:q,onChangeText:V,placeholder:"e.g. Reid",testID:"nb-name"}),(0,F.jsx)(C.Field,{label:"Mobile or phone number (needed)",value:se,onChangeText:oe,keyboardType:"phone-pad",placeholder:"e.g. 07700 900123",testID:"nb-phone"}),!Se.ok&&se?(0,F.jsx)(C.T,{size:13,colour:S.colours.amber,children:Se.error}):null,(0,F.jsx)(C.Field,{label:"Email (optional)",value:le,onChangeText:ae,keyboardType:"email-address",autoCapitalize:"none",placeholder:"For an email confirmation too",testID:"nb-email"}),(0,T.emailOk)(le)?null:(0,F.jsx)(C.T,{size:13,colour:S.colours.amber,children:"That email doesn\u2019t look quite right."}),(0,F.jsx)(n.AdultsChildren,{value:(0,r.peopleOf)(Y,X),onChange:e=>{G(e.partySize),Q(e.children),Ce(!1)},depositsOn:(0,i.depositOf)(h.settings).on&&(0,i.depositOf)(h.settings).perPersonPence>0,testID:"nb-people"}),(0,F.jsx)(C.Row,{wrap:!0,gap:6,children:we.map(e=>{const t=pe&&e.available&&!xe(e.time).length||!(0,$.dogTimeOk)(h,E,R,e.time,me);return(0,F.jsx)(C.Chip,{testID:`nb-slot-${e.time}`,label:e.time,sub:(0,D.blockAt)(_,b,R,e.time)?'Paused':t?'Dogs full':e.drinksOnly?'Drinks only':null!=e.partiesLeft&&e.partiesLeft<1||e.left<=0?'Full':`${e.left} left`,disabled:(e.past??!e.available)||t,selected:J===e.time,onPress:()=>{Z(e.time),U(!1),Ce(!1)}},e.time)})}),$e?(0,F.jsxs)(m.default,{testID:"nb-over-capacity",accessible:!0,accessibilityLiveRegion:"polite",style:{borderWidth:1.5,borderColor:S.colours.amber,backgroundColor:S.colours.amberBg,borderRadius:12,padding:10,gap:6},children:[De?(0,F.jsx)(C.T,{weight:"semibold",colour:S.colours.amber,children:(0,o.overCapacityNote)(Y,De.left,De.time)}):null,Ie?(0,F.jsx)(C.T,{weight:"semibold",colour:S.colours.amber,children:(0,o.overPartiesNote)(Ie.time,Ie.cap)}):null,(0,F.jsx)(C.Chip,{label:Te?'Booking over the limit: on':'Book anyway (over the limit)',selected:Te,onPress:()=>Ce(e=>!e),testID:"nb-over-ok"})]}):null,pe&&J?(0,F.jsxs)(m.default,{style:{gap:6},testID:"nb-dog-tables",children:[(0,F.jsxs)(C.T,{size:14,weight:"semibold",children:["Dog-friendly table ",(0,F.jsxs)(C.T,{size:13,colour:S.colours.muted,children:["(",ge.areas.filter(e=>e.dogs).map(e=>e.name).join(' or '),")"]})]}),je.length?(0,F.jsx)(C.Row,{wrap:!0,gap:6,children:je.slice(0,10).map((e,t)=>(0,F.jsx)(C.Chip,{label:`${(0,l.tableNumbers)(e.table)}`,sub:`${e.area} \xb7 ${e.seats}${0===t?' \xb7 best':''}${Me&&(0,B.accessibleSetUp)(ge)&&!(0,B.isAccessible)(ge,e.table)?' \xb7 not step-free':''}`,selected:(ce??je[0].table)===e.table,onPress:()=>be(e.table)},e.table))}):(0,F.jsxs)(C.T,{size:14,colour:S.colours.amber,children:["No dog-friendly table free for ",Y," at ",J,". Try another time."]})]}):null,Pe?(0,F.jsxs)(m.default,{testID:"nb-block-warning",style:{borderWidth:1.5,borderColor:S.colours.amber,backgroundColor:S.colours.amberBg,borderRadius:12,padding:10,gap:6},children:[(0,F.jsxs)(C.T,{weight:"semibold",colour:S.colours.amber,children:["Bookings are paused ",Pe.from,"\u2013",Pe.to,Pe.reason?` (${Pe.reason})`:'']}),Oe?(0,F.jsx)(C.Chip,{label:H?'Manager override on':'Override and book anyway',selected:H,onPress:()=>U(e=>!e)}):(0,F.jsx)(C.Muted,{children:"Ask a manager to override, or pick another time."})]}):null,we.length?null:(0,F.jsx)(m.default,{testID:"nb-closed",children:(0,F.jsxs)(C.T,{size:14,weight:"semibold",colour:S.colours.amber,children:["Closed on ",(0,w.niceDate)(fe)," (per the venue\u2019s opening hours). Pick another date."]})}),(0,F.jsx)($.MoreQuestions,{rid:b,r:h,value:re,onChange:de,party:Y,date:R,time:J,today:(0,w.ymd)(p),bookings:E,audience:"staff",showTables:!1!==h.settings.tableRequests}),Me&&!(0,B.accessibleSetUp)(ge)?(0,F.jsx)(C.T,{size:13,colour:S.colours.amber,children:"Step-free tables aren\u2019t marked yet (Managers \u203a Booking options \u203a Tables). Check the table works for a wheelchair."}):null,(0,F.jsx)(C.Field,{label:"Notes (optional)",value:ee,onChangeText:te,placeholder:P.NOTES_PLACEHOLDER,multiline:!0,numberOfLines:3,testID:"nb-notes"}),(0,i.depositDue)((0,i.depositOf)(h.settings),Y,X)?(0,F.jsxs)(C.Muted,{testID:"nb-deposit",children:["Deposit due: ",(0,a.gbp)((0,i.depositDue)((0,i.depositOf)(h.settings),Y,X))," (",(0,a.gbp)((0,i.depositOf)(h.settings).perPersonPence)," per adult for tables of ",(0,i.depositOf)(h.settings).fromParty,"+ adults",X?`; ${X} ${1===X?'child':'children'} free`:'; children free, and they do not count towards the number that needs a deposit',"). Staff can waive it. Deposits are paid through website bookings or to you, never in CoverCharge: tick Deposit paid on the booking once the guest has paid."]}):null,(0,F.jsxs)(C.Muted,{children:["The guest gets a confirmation text",le.trim()?' and email':''," automatically (preview mode: shown in the Outbox, not sent)."]}),Be?(0,F.jsxs)(C.T,{size:14,colour:S.colours.amber,children:["We already have the most dogs we can look after at ",J,". Try another time: dogs are very welcome then."]}):null,(0,F.jsx)(C.Button,{label:ue.length?ue[0]:'Save booking',testID:"nb-save",disabled:!ze,onPress:()=>{if(R<(0,w.ymd)(p))return;if(!(0,M.guardBookingChange)(L))return;const e=(0,$.needsPatch)(re),s=re.tableReq.find(e=>!pe||je.some(t=>t.table===e)),o=pe?null:(0,z.requestedFreeTable)(re.tableReq,{date:R,time:J,partySize:Y},ge.tables.map(e=>e.name),ke,h.settings.turnMins);k.repo.bookings.create({restaurantId:b,customerId:null,name:q.trim(),partySize:Y,date:R,time:J,notes:ee.trim(),security:(0,i.depositDue)((0,i.depositOf)(h.settings),Y,X)?'deposit':'none',depositPaid:0,...X?{children:X}:{},...(0,i.depositDue)((0,i.depositOf)(h.settings),Y,X)?{depositDue:(0,i.depositDue)((0,i.depositOf)(h.settings),Y,X),depositPolicy:(0,i.depositWords)((0,i.depositOf)(h.settings),Y,h.name,X).join(' '),depositRefundable:(0,i.depositOf)(h.settings).refundable,depositCutoffHours:(0,i.depositOf)(h.settings).cutoffHours}:{},phone:Se.pretty,email:le.trim()||void 0,source:ie,...e,...we.find(e=>e.time===J)?.drinksOnly?{drinksOnly:!0}:{},allergies:e.allergies??[],...pe?{table:ce??s??je[0]?.table}:o?{table:o}:{}}).then(e=>(0,O.postNewBookingToKitchen)(e,N)).catch(()=>{}),u?.({date:R,time:J,name:q.trim()}),t()}})]})}},1094,[812,1095,1096,843,851,841,1097,1098,1099,1100,17,842,385,85,856,1055,858,1101,1074,863,804,848,777,996,993,1102,1103,1108,1076,1053,1092,1091,1109,8]); __d(function(g,r,i,a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.PartySizeInput=function({value:e,onChange:p,min:b=s.MIN_PARTY,max:y=s.MAX_PARTY,label:f="Party size",testID:h="party-size"}){const[x,S]=(0,t.useState)(String(e));(0,t.useEffect)(()=>{S(String(e))},[e]);const T=e=>p((0,s.clampParty)(e,b,y)),$=(t,n,l)=>{const s=t<0?e<=b:e>=y;return(0,d.jsx)(o.default,{testID:`${h}-${t>0?'up':'down'}${10===Math.abs(t)?'10':''}`,accessibilityRole:"button",accessibilityLabel:l,accessibilityState:{disabled:s},disabled:s,onPress:()=>T(e+t),hitSlop:4,style:{minWidth:44,height:44,paddingHorizontal:8,borderRadius:22,borderWidth:1.5,borderColor:u.colours.gold,alignItems:'center',justifyContent:'center',opacity:s?.4:1},children:(0,d.jsx)(c.T,{size:10===Math.abs(t)?14:20,weight:"semibold",colour:u.colours.gold,center:!0,children:n})},t)};return(0,d.jsxs)(l.default,{testID:h,style:{flexDirection:'row',alignItems:'center',gap:6,flexWrap:'wrap',justifyContent:'center'},children:[y-b>=20?$(-10,'\u221210',"10 fewer people"):null,$(-1,'\u2212','One fewer person'),(0,d.jsx)(n.default,{testID:`${h}-input`,value:x,keyboardType:"number-pad",inputMode:"numeric",maxLength:3,selectTextOnFocus:!0,accessibilityLabel:`${f}, ${b} to ${y} people`,accessibilityValue:{min:b,max:y,now:e,text:`${e} ${1===e?'person':'people'}`},onChangeText:e=>{S(e.replace(/\D/g,'')),e.replace(/\D/g,'')&&T((0,s.partyFromText)(e,b,y))},onBlur:()=>{const e=(0,s.partyFromText)(x,b,y);S(String(e)),T(e)},returnKeyType:"done",blurOnSubmit:!0,onSubmitEditing:e=>{e?.target?.blur?.()},style:{width:64,height:44,borderRadius:10,borderWidth:1,borderColor:u.colours.border,color:u.colours.text,backgroundColor:u.colours.surface,textAlign:'center',fontSize:20,fontFamily:u.fonts.semibold}}),$(1,'+','One more person'),y-b>=20?$(10,'+10',"10 more people"):null]})};var t=r(_d[0]),o=e(r(_d[1])),n=e(r(_d[2])),l=e(r(_d[3])),s=r(_d[4]),u=r(_d[5]),c=r(_d[6]),d=r(_d[7])},1095,[17,385,395,85,1096,804,777,8]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"MAX_PARTY",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"MIN_PARTY",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"PARTY_RULE",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"validParty",{enumerable:!0,get:function(){return u}}),Object.defineProperty(e,"partyFromText",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"clampParty",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"overCapacityNote",{enumerable:!0,get:function(){return f}}),Object.defineProperty(e,"overPartiesNote",{enumerable:!0,get:function(){return b}});const t=100,n=1,o=`Bookings are for ${n} to ${t} people.`,u=o=>'number'==typeof o&&Number.isInteger(o)&&o>=n&&o<=t,c=(o,u=n,c=t)=>{const s=parseInt(String(o??'').replace(/\D/g,'').slice(0,4),10);return Math.max(u,Math.min(c,Number.isFinite(s)?s:u))},s=(o,u=n,c=t)=>Math.max(u,Math.min(c,Math.round(Number(o)||u))),f=(t,n,o)=>n<=0?`${o} is already full for booked Covers. Booking ${t} more goes over the venue\u2019s limit: check tables and staffing.`:`${t} is more than the ${n} Covers left at ${o}. Booking goes over the venue\u2019s limit by ${t-n}: check tables and staffing.`,b=(t,n)=>`${t} already has the most bookings we take at one start time (${n}). Booking another goes over the venue\u2019s limit: check tables and staffing.`},1096,[]); __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.AdultsChildren=function({value:e,onChange:t,depositsOn:h,testID:x="people"}){const p=e=>t((0,s.storedPeople)(e)),b=(0,s.totalLine)(e);return(0,o.jsxs)(l.default,{testID:x,style:{gap:8,alignItems:'center',width:'100%'},children:[(0,o.jsx)(u.T,{size:18,center:!0,weight:"semibold",children:"Adults"}),(0,o.jsx)(n.PartySizeInput,{value:e.adults,min:1,max:(0,s.maxAdults)(e.children),onChange:t=>p({adults:t,children:e.children}),label:"Adults",testID:`${x}-adults`}),(0,o.jsx)(u.T,{size:18,center:!0,weight:"semibold",children:"Children"}),(0,o.jsx)(n.PartySizeInput,{value:e.children,min:0,max:(0,s.maxKids)(e.adults),onChange:t=>p({adults:e.adults,children:t}),label:"Children",testID:`${x}-children`}),(0,o.jsx)(u.T,{size:18,center:!0,weight:"semibold",colour:c.colours.goldLight,testID:`${x}-total`,accessibilityLabel:b,children:b}),h?(0,o.jsx)(u.Muted,{center:!0,children:"Children never pay a deposit."}):null]})},r(d[0]);var e,t=r(d[1]),l=(e=t)&&e.__esModule?e:{default:e},s=r(d[2]),n=r(d[3]),u=r(d[4]),c=r(d[5]),o=r(d[6])},1097,[17,85,1098,1095,777,804,8]); @@ -1318,9 +1318,9 @@ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{v __d(function(g,_r,i,_a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"useChefAssistant",{enumerable:!0,get:function(){return I}}),Object.defineProperty(_e,"CHEF_PROMPTS",{enumerable:!0,get:function(){return P}}),_e.ChefAssistantButton=function({compact:e}){return e?(0,S.jsx)(u.default,{testID:"chef-assistant-open",accessibilityRole:"button",accessibilityLabel:"Assistant",onPress:()=>I.getState().setOpen(!0),style:{borderRadius:12,backgroundColor:w.colours.accentBg,borderWidth:1,borderColor:w.colours.accentBorder,paddingVertical:6,paddingHorizontal:12,minHeight:36,justifyContent:'center'},children:(0,S.jsx)(m.T,{weight:"semibold",colour:w.colours.goldLight,size:13,children:"\u2726 Assistant"})}):(0,S.jsx)(d.ActionTile,{primary:!0,testID:"chef-assistant-open",icon:"sparkle",label:"Assistant",sub:"Recipe card, order, allergens, GP, temps",accessibilityLabel:"Assistant",onPress:()=>I.getState().setOpen(!0)})},_e.ChefAssistantSheet=function({go:e}){const l=I(e=>e.open),d=()=>I.getState().setOpen(!1),{rid:f,me:W,menu:L,k:B,c:F}=(0,$.useChef)(3e4),G=(0,T.useSuggestions)(),E=(0,r.useSafetyView)('chef').points,[M,H]=(0,o.useState)([]),[N,_]=(0,o.useState)(''),[V,K]=(0,o.useState)(!1),[Y,q]=(0,o.useState)(!1),Q=(0,o.useRef)(null),U=(0,o.useRef)(null);if((0,o.useEffect)(()=>{setTimeout(()=>Q.current?.scrollToEnd?.({animated:!0}),50)},[M.length]),!l)return null;const J=(e,t=!1)=>H(n=>[...n,{id:R(),from:'bot',text:e,demo:t}]),X=e=>H(t=>[...t,{id:R(),from:'bot',plan:e,state:'open'}]),Z=L.filter(e=>!e.name.includes('(example)')||!0),ee=(t,n)=>{const r=A(t);if(!(0,s.chefCanSee)(f,t))return void J('That check is managed in the Managers app.');if(/\b(send|email|text|pay|delete|remove|order now|place the order)\b/.test(r)&&!/\b(build|draft|make|prepare)\b/.test(r))return void J('I can\u2019t send, pay for or delete anything. I can prepare it for you to check and do yourself, for example \u201cbuild the fish order\u201d.');const o=(0,y.parseQuick)(t,E).filter(e=>e.point&&(0,y.isTempKind)(e.point.kind));if(o.length&&(/\b(fridge|freezer|walk ?in|core|probe|cool|hot|deliver|degree|temp)/.test(r)||o.some(e=>null!=e.value))){const t=o.filter(e=>null!=e.value),r=o.filter(e=>null==e.value);if(r.length&&J(`I didn\u2019t hear a temperature for ${r.map(e=>e.point.name).join(', ')}. Say or type the reading, for example \u201c${r[0].point.name} 4 degrees\u201d. I never fill one in.`),!t.length)return;const s=t.filter(e=>!(0,y.inRange)(e.point,e.value));return void X({title:`Log ${1===t.length?'a reading':`${t.length} readings`} in the food safety log`,detail:t.map(e=>`${e.point.name}: ${e.value}\xb0C (${(0,y.limitText)(e.point)})${(0,y.inRange)(e.point,e.value)?'':' \xb7 OUT OF RANGE'}`).join('\n')+`\nSigned ${(0,y.initialsOf)(W)} \xb7 ${n?'voice':'typed'}`,warn:s.length?`${s.map(e=>e.point.name).join(', ')} out of range: you\u2019ll need to add the corrective action in the food safety log.`:void 0,confirm:'Log it',run:()=>{const r=(new Date).toISOString();return v.useSafety.getState().addEntries(t.map(e=>({pointId:e.point.id,name:e.point.name,kind:e.point.kind,at:r,by:W.replace(' (example)',''),byId:$.CHEF_ID,app:'chef',value:e.value,ok:(0,y.inRange)(e.point,e.value),source:n?'voice':'typed',initials:(0,y.initialsOf)(W)}))),s.length&&setTimeout(()=>e('haccp'),600),`Logged ${t.map(e=>`${e.point.name} ${e.value}\xb0C`).join(', ')}.${s.length?' Opening the food safety log for the corrective action.':''}`}})}if(/\b(fridge|freezer|temp|temperature|degrees)\b/.test(r))return void J('Which unit, and what does it read? For example \u201cprep fridge 4 degrees\u201d or \u201cfreezer minus 19\u201d. I only log the number you give me.');if(/allergen|allerg|contain|gluten|nut|dairy|milk|shellfish|crustacean|coeliac/.test(r)){const e=D(t,Z,e=>e.name);if(!e)return void J('Which dish? For example \u201callergens in the fish and chips\u201d.');const n=(0,j.recipeCards)().byMenuItem(e.id),r=e=>b.ALLERGENS.find(t=>t.id===e)?.label??e,s=Object.entries(e.allergens??{}).filter(([,e])=>'contains'===e).map(([e])=>r(e)),a=Object.entries(e.allergens??{}).filter(([,e])=>'may'===e).map(([e])=>r(e));return void J(`${e.name}: ${s.length?`contains ${s.join(', ')}`:'no allergens recorded as \u201ccontains\u201d'}${a.length?`; may contain ${a.join(', ')}`:''}. ${n?n.signOff?`From the signed-off recipe card (${n.signOff.by}).`:'The recipe card is awaiting your sign-off, so check it before telling a guest.':'There\u2019s no recipe card for it yet.'} Always check the card and the ingredients with the guest.`)}if(/\bgp\b|gross profit|margin|price for|what price|cost of|costing/.test(r)){const e=D(t,F,e=>e.item.name),n=Number((t.toLowerCase().match(/(\d{2})\s*(?:%|percent|per cent)/)??[])[1])||B.targetGp;if(!e)return void J(`Which dish? I can cost the dishes that have a recipe in GP & costing (${F.length} do). For example \u201cGP on the haddock\u201d.`);const r=(0,C.priceForTarget)(e.cost,n);return void J(`${e.item.name}: food cost ${(0,x.gbp)(e.cost)}, sells at ${(0,x.gbp)(e.priceInc)} (inc VAT) = ${e.gp.toFixed(1)}% GP. For ${n}% GP it would need ${(0,x.gbp)(r)} inc VAT. Prices are changed by a manager; I haven\u2019t changed anything.`)}if(/\border|supplier|delivery|par\b|restock/.test(r)){const n=D(t,G,e=>`${e.s.name} ${e.s.category??''}`)??(1===G.length?G[0]:void 0);return n?void X({title:`Build an order for ${n.s.name}`,detail:(n.lines.length?n.lines.map(e=>`${e.i.name}: ${(0,a.fishQtyText)(f,e.i,e.qty)}`).join('\n')+`\nAbout ${(0,x.gbp)(n.total)} at the latest prices.`:'Nothing is below par for this supplier yet.')+'\nI\u2019ll open it in Ordering for you to check, change and place yourself. Nothing is sent.',confirm:'Open the order',run:()=>(setTimeout(()=>{d(),e('orders',n.s.id)},400),`Opening the ${n.s.name} order. You check it and place it yourself.`)}):void J(G.length?`Which supplier? ${G.map(e=>e.s.name).join(', ')}.`:'Nothing is below par and no supplier orders today.')}if(/recipe|card|new dish|write up|spec/.test(r)){const n=t.replace(/^.*?(?:recipe card|card|recipe|dish|spec)\s*(?:for|of)?\s*/i,'').replace(/[.?!]+$/,'').trim();if(!n||n.length<3)return void J('What\u2019s the dish called? For example \u201cdraft a recipe card for crab linguine\u201d.');const r=n.replace(/^the\s+/i,'').replace(/^./,e=>e.toUpperCase()).slice(0,60),s=(0,j.recipeCards)().list(f).find(e=>A(e.dish)===A(r));return s?(J(`There\u2019s already a card for ${s.dish}. Opening Recipe cards.`),void setTimeout(()=>{d(),e('recipes')},600)):void X({title:`Draft a recipe card: ${r}`,detail:'A new card, awaiting your sign-off, with the dish name and section filled in. You add the ingredients, method, allergens, photo and price, then sign it off. It isn\u2019t shown to guests until you do.',confirm:'Make the draft',run:async()=>(await(0,j.recipeCards)().create(f,{dish:r,section:'Specials',price:null,ingredients:[],steps:[]},{name:W,role:'head-chef'}),setTimeout(()=>{d(),e('recipes')},500),`Draft card for ${r} saved, awaiting sign-off. Opening Recipe cards.`)})}const l='I can help with: drafting a recipe card, building a supplier order, a dish\u2019s allergens, GP pricing, and logging a temperature you read out. Try one of the suggestions.';(0,k.askServer)('chef',t,[]).then(e=>J('text'===e.kind?e.text:l)).catch(()=>J(l))},te=(e,t=!1)=>{const n=e.trim();if(n){_(''),H(e=>[...e,{id:R(),from:'you',text:n}]);try{ee(n,t)}catch(e){J(`Sorry, that didn\u2019t work: ${e.message}`)}}},ne=async e=>{if(e.plan){H(t=>t.map(t=>t.id===e.id?{...t,state:'done'}:t));try{J(String(await e.plan.run()))}catch(e){J(`Couldn\u2019t do that: ${e.message}`)}}},ie=e=>{H(t=>t.map(t=>t.id===e.id?{...t,state:'cancelled'}:t)),J('Cancelled. Nothing was changed.')},re=()=>{te(N,Y),q(!1)};return(0,S.jsx)(c.default,{visible:!0,transparent:!0,animationType:"fade",onRequestClose:d,children:(0,S.jsx)(p.default,{style:[m.styles.overlay,{justifyContent:'flex-end',padding:0}],children:(0,S.jsxs)(p.default,{testID:"chef-assistant",style:{backgroundColor:w.colours.surface,borderTopLeftRadius:18,borderTopRightRadius:18,borderWidth:1,borderColor:w.colours.border,width:'100%',maxWidth:640,alignSelf:'center',maxHeight:'92%',minHeight:'70%',padding:14,gap:10},children:[(0,S.jsxs)(m.Row,{style:{justifyContent:'space-between'},children:[(0,S.jsx)(m.T,{size:20,weight:"semibold",children:"\u2726 Kitchen Assistant"}),(0,S.jsx)(n.GoldClose,{testID:"chef-assistant-close",onPress:d,style:{marginRight:-6}})]}),(0,S.jsx)(p.default,{testID:"chef-assistant-demo",children:(0,S.jsx)(m.Badge,{kind:"amber",label:O})}),(0,S.jsxs)(h.default,{ref:Q,style:{flex:1},contentContainerStyle:{gap:10,paddingBottom:6},keyboardShouldPersistTaps:"handled",children:[0===M.length?(0,S.jsxs)(p.default,{style:{gap:8},children:[(0,S.jsxs)(m.T,{children:["Hi ",W.split(' ')[0],". Type or tap \ud83c\udfa4 and say what you need. I\u2019ll show you what I\u2019m about to do and wait for you to confirm. I never send, pay or delete."]}),P.map(e=>(0,S.jsx)(u.default,{accessibilityRole:"button",onPress:()=>te(e),style:{borderWidth:1,borderColor:w.colours.border,borderRadius:12,paddingVertical:9,paddingHorizontal:12,backgroundColor:w.colours.surface2},children:(0,S.jsx)(m.T,{size:14,children:e})},e))]}):null,M.map(e=>'you'===e.from?(0,S.jsx)(p.default,{style:{alignSelf:'flex-end',maxWidth:'85%',backgroundColor:'#3A2F12',borderRadius:14,padding:10},children:(0,S.jsx)(m.T,{children:e.text})},e.id):e.plan?(0,S.jsxs)(p.default,{testID:"chef-confirm-card",style:{borderWidth:1.5,borderColor:'open'===e.state?w.colours.gold:w.colours.border,borderRadius:14,padding:12,gap:8,backgroundColor:w.colours.surface2},children:[(0,S.jsx)(m.T,{weight:"semibold",children:e.plan.title}),(0,S.jsx)(m.T,{size:14,colour:w.colours.muted,children:e.plan.detail}),e.plan.warn?(0,S.jsxs)(m.T,{size:13,colour:w.colours.amber,children:["\u26a0 ",e.plan.warn]}):null,'open'===e.state?(0,S.jsxs)(m.Row,{gap:8,children:[(0,S.jsx)(m.Button,{small:!0,testID:"chef-confirm",label:e.plan.confirm,onPress:()=>ne(e)}),(0,S.jsx)(m.Button,{small:!0,kind:"ghost",label:"Cancel",onPress:()=>ie(e)})]}):(0,S.jsx)(m.Badge,{kind:'done'===e.state?'ok':'neutral',label:'done'===e.state?'Confirmed':'Cancelled: nothing done'}),'open'===e.state?(0,S.jsxs)(m.Muted,{children:["Nothing happens until you tap ",e.plan.confirm,"."]}):null]},e.id):(0,S.jsx)(p.default,{testID:"chef-assistant-reply",style:{alignSelf:'flex-start',maxWidth:'92%',backgroundColor:w.colours.surface2,borderRadius:14,padding:10},children:(0,S.jsx)(m.T,{children:e.text})},e.id))]}),(0,S.jsxs)(m.Row,{gap:8,children:[(0,S.jsx)(t.TextInput,{testID:"chef-assistant-input",accessibilityLabel:"Ask the Assistant",placeholder:"Type a kitchen task\u2026",placeholderTextColor:"#7D776C",value:N,onChangeText:e=>{_(e),e||q(!1)},onSubmitEditing:re,returnKeyType:"send",style:[m.styles.input,{flex:1,minWidth:0,width:40}]}),(0,S.jsx)(u.default,{testID:"chef-assistant-mic",accessibilityRole:"button",accessibilityLabel:V?'Stop listening':'Speak',onPress:()=>{const e=z();if(e)if(V)U.current?.stop?.();else try{const t=new e;U.current=t,t.lang='en-GB',t.interimResults=!1,t.maxAlternatives=1,t.onresult=e=>{const t=e.results?.[0]?.[0]?.transcript;t&&(_(t),q(!0))},t.onend=()=>K(!1),t.onerror=()=>{K(!1),J('Sorry, I didn\u2019t catch that. You can type instead.')},K(!0),t.start()}catch{K(!1),J('Voice input isn\u2019t available here. Please type instead.')}else J('Voice input isn\u2019t available in this browser. Please type instead.')},style:{width:48,height:48,borderRadius:24,borderWidth:1.5,borderColor:w.colours.gold,alignItems:'center',justifyContent:'center',backgroundColor:V?w.colours.gold:'transparent'},children:(0,S.jsx)(m.T,{size:20,children:"\ud83c\udfa4"})}),(0,S.jsx)(m.Button,{label:"Send",disabled:!N.trim(),onPress:re})]}),(0,S.jsx)(m.Muted,{center:!0,children:"Every action waits for your Confirm \xb7 nothing is sent, paid or deleted"})]})})})};var t=_r(_d[0]),n=_r(_d[1]),r=_r(_d[2]),s=_r(_d[3]),a=_r(_d[4]),o=_r(_d[5]),l=_r(_d[6]),d=_r(_d[7]),c=e(_r(_d[8]));_r(_d[9]);var u=e(_r(_d[10])),h=e(_r(_d[11])),p=e(_r(_d[12])),f=_r(_d[13]),m=_r(_d[14]),b=_r(_d[15]),y=_r(_d[16]),x=_r(_d[17]),j=_r(_d[18]),v=_r(_d[19]),w=_r(_d[20]),$=_r(_d[21]),C=_r(_d[22]),T=_r(_d[23]),k=_r(_d[24]),S=_r(_d[25]);const I=(0,f.create)(e=>({open:!1,setOpen:t=>e({open:t})})),R=()=>Math.random().toString(36).slice(2,9),P=['Draft a recipe card for crab linguine','Build the fish order','What allergens are in the fish and chips?','What price gives 70% GP on the lobster?','Walk-in fridge 3.5 degrees'],O='The secure AI server: not set up yet',A=e=>e.toLowerCase().replace(/[^a-z0-9 ]/g,' ').replace(/\s+/g,' ').trim(),W=new Set(['the','and','with','for','our','house','served','side','of','in','on','from']);function D(e,t,n){const r=` ${A(e)} `;let s,a=0;for(const e of t){const t=A(n(e).replace(/\(example\)/i,'')).split(' ').filter(e=>e.length>2&&!W.has(e)),o=t.filter(e=>r.includes(` ${e} `)||r.includes(` ${e}s `)).length,l=t.length?o/t.length+.01*o:0;o&&l>a&&(s=e,a=l)}return s}function z(){return'undefined'==typeof window?null:(0,l.speechRecognizer)()}},1235,[812,779,1207,820,943,17,890,1183,378,219,385,278,85,831,777,845,1002,851,867,1001,804,1140,1135,1163,891,8]); __d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"BOTTOM_TABS_HEIGHT",{enumerable:!0,get:function(){return h}}),_e.BottomTabs=function({tabs:e,active:b,onPress:y,background:x,tablist:p}){const{width:j}=(0,s.default)(),v=j/Math.max(1,e.length),w=v>=60?11:10,I=v<56?20:22,[F,S]=(0,t.useState)({}),[H,_]=(0,t.useState)(0),M=H>0&&e.some(e=>(F[e.id]??0)>H-6),z={flexDirection:'row',flexWrap:'nowrap',alignItems:'stretch',borderTopWidth:1,borderColor:c.colours.border,backgroundColor:x};return(0,f.jsx)(l.default,{testID:"app-bottom-tabs",accessibilityRole:p?'tablist':void 0,style:z,children:e.map(t=>{const s=b===t.id,x=s?c.colours.gold:c.colours.muted;return(0,f.jsxs)(n.default,{onLayout:t===e[0]?e=>_(e.nativeEvent.layout.width):void 0,testID:`tab-${t.id}`,accessibilityRole:"tab",accessibilityState:{selected:s},accessibilityLabel:t.a11y??t.label,onPress:()=>y(t.id),style:{flexGrow:1,flexShrink:1,flexBasis:0,minWidth:44,minHeight:h,alignItems:'center',justifyContent:'center',paddingVertical:4,paddingHorizontal:1,gap:2},children:[(0,f.jsxs)(l.default,{style:{width:I,height:I,alignItems:'center',justifyContent:'center'},children:[(0,f.jsx)(u.Icon,{name:t.icon,size:I,colour:x}),t.badge?(0,f.jsx)(l.default,{testID:t.badge.testID,style:{position:'absolute',right:-10,top:-5,backgroundColor:t.badge.bg,borderRadius:8,minWidth:16,height:16,paddingHorizontal:3,alignItems:'center',justifyContent:'center'},children:(0,f.jsx)(o.default,{style:{fontFamily:c.fonts.bold,fontSize:10,lineHeight:12,color:t.badge.fg??'#FFFFFF'},children:t.badge.text})}):null]}),(0,f.jsx)(l.default,{pointerEvents:"none","aria-hidden":!0,importantForAccessibility:"no-hide-descendants",accessibilityElementsHidden:!0,style:{position:'absolute',left:0,top:0,width:0,height:0,overflow:'hidden',opacity:0},children:(0,f.jsx)(l.default,{style:{width:400,flexDirection:'row',alignItems:'flex-start'},children:(0,f.jsx)(o.default,{onLayout:e=>{const n=Math.ceil(e.nativeEvent.layout.width);S(e=>e[t.id]===n?e:{...e,[t.id]:n})},style:{fontFamily:c.fonts.semibold,fontSize:w,lineHeight:Math.round(1.3*w),flexShrink:0},children:t.short??t.label})})}),M?null:(0,f.jsx)(o.default,{numberOfLines:1,style:{fontFamily:s?c.fonts.semibold:c.fonts.regular,fontSize:w,lineHeight:Math.round(1.3*w),color:x,textAlign:'center',alignSelf:'center',maxWidth:'100%'},children:t.short??t.label})]},t.id)})})};var t=r(d[0]),n=e(r(d[1])),o=e(r(d[2])),l=e(r(d[3])),s=e(r(d[4])),c=r(d[5]),u=r(d[6]),f=r(d[7]);const h=56},1236,[17,385,329,85,409,804,1184,8]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return f}});var t=r(d[0]);r(d[1]);var n=r(d[2]),u=r(d[3]),c=r(d[4]);function f(){return(0,u.canShow)('chef')?(0,c.jsx)(n.ChefApp,{}):(0,c.jsx)(t.Redirect,{href:u.ENTRY[u.APP_VARIANT]})}},1237,[13,17,775,856,8]); -__d(function(g,_r,_i,_a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return A}});var e,t=_r(d[0]),o=_r(d[1]),n=_r(d[2]),s=_r(d[3]),l=_r(d[4]),i=_r(d[5]),a=_r(d[6]),r=_r(d[7]),u=(e=r)&&e.__esModule?e:{default:e},c=_r(d[8]),h=_r(d[9]),p=_r(d[10]),b=_r(d[11]),f=_r(d[12]),y=_r(d[13]),x=_r(d[14]),k=_r(d[15]),j=_r(d[16]),v=_r(d[17]),S=_r(d[18]),w=_r(d[19]),T=_r(d[20]),C=_r(d[21]),D=_r(d[22]),$=_r(d[23]),P=_r(d[24]),M=_r(d[25]),B=_r(d[26]),O=_r(d[27]);function A(){const{rid:e,date:r}=(0,s.useLocalSearchParams)(),A=(0,j.useRestaurant)(e),N=(0,j.useCustomer)(),z=(0,j.useBookings)(e),I=(0,j.useEvents)(e),R=(0,j.useNow)(6e4),[q]=(0,l.useState)(()=>(0,a.startForm)()),[F,L]=(0,l.useState)(''),[E,H]=(0,l.useState)(2),[W,_]=(0,l.useState)(0),Y=Math.min(W,Math.max(0,E-1)),[U,G]=(0,l.useState)(r??(0,k.ymd)(R)),[Q,V]=(0,l.useState)(null),[J,K]=(0,l.useState)(N.name),[X,Z]=(0,l.useState)(N.phone??''),[ee,te]=(0,l.useState)(N.email??''),[oe,ne]=(0,l.useState)(!1),[se,le]=(0,l.useState)(''),[ie,ae]=(0,l.useState)(!1),[re,de]=(0,l.useState)([]),[ue,ce]=(0,l.useState)(!1),he=[...N.allergies,...re.filter(e=>!N.allergies.some(t=>t.allergen===e)).map(e=>({allergen:e,severity:'allergy'}))],[me,ge]=(0,l.useState)(null),pe=(0,C.useBlocks)(e=>e.blocks);(0,v.usePublicDayStore)(e=>e.n);const be=e?(0,v.publicDay)(e,U):null,fe=be?[...be.bookings,...z.filter(e=>e.date!==U)]:z,ye=be?[...pe.filter(t=>t.rid!==e||t.date!==U),...be.blocks]:pe,xe=(0,D.usePlan)(e),[ke,je]=(0,l.useState)((0,P.emptyNeeds)()),ve=!0===ke.dog,Se=ve?ke.dogs:0;if(!A)return(0,O.jsx)(b.Screen,{title:"Not found",children:(0,O.jsx)(b.T,{children:"Restaurant not found."})});const we=A.settings,Te=(0,k.parseYmd)(U),Ce=(0,x.onlinePartyBounds)(A),De=(0,C.blocksOn)(ye,A.id,U),$e=fe.filter(e=>e.date===U),Pe=xe.areas.filter(e=>e.dogs),Me=(0,M.dogSetUp)(xe),Be=e=>(0,$.freeTablesAt)(xe,$e,E,new Date(`${U}${(0,t.tableNumbers)(e)}:00`),(0,$.turnFor)(E,we.turnMins),we.turnMins,{dog:!0,closed:(0,C.closedAreasAt)(ye,A.id,U,e)}),Oe=(0,x.bookingSlots)(A,Te,e=>fe.filter(t=>t.date===U&&t.time===e&&!['cancelled','noshow'].includes(t.status)).reduce((e,t)=>e+t.partySize,0),E,R,e=>fe.filter(t=>t.date===U&&t.time===e&&!['cancelled','noshow'].includes(t.status)).length).map(e=>{const t=(0,C.blockAt)(ye,A.id,U,e.time),o=ve&&Me&&e.available&&!t&&(!Be(e.time).length||!(0,P.dogTimeOk)(A,fe,U,e.time,Se));return{...e,blocked:!!t,noDog:o,available:e.available&&!t&&!o}}),Ae=Oe.some(e=>e.available),Ne=(0,c.depositOf)(we),ze=(0,c.depositDue)(Ne,E,Y),Ie=ze>0?'deposit':'none',Re=(0,c.depositWords)(Ne,E,A.name,Y),qe=I.filter(e=>e.date===U),Fe=(0,T.guestPhone)(X),Le=(0,T.emailOk)(ee),Ee=(0,P.needsMissing)(ke,N.allergies),He=!!Q&&ie&&!Ee.length&&J.trim().length>1&&Fe.ok&&Le,We=async()=>{const e=(0,P.needsPatch)(ke,N.allergies),t=ve&&Me?Be(Q).map(e=>e.table):[],o=ve?ke.tableReq.find(e=>t.includes(e))??t[0]:void 0,n=await j.repo.bookings.create({restaurantId:A.id,customerId:N.id,name:J,partySize:E,...Y?{children:Y}:{},date:U,time:Q,notes:se.trim(),security:Ie,depositPaid:0,...ze?{depositDue:ze,depositPolicy:Re.join(' '),depositRefundable:Ne.refundable,depositCutoffHours:Ne.cutoffHours}:{},phone:Fe.pretty,email:ee.trim()||void 0,source:'online',...e,...Oe.find(e=>e.time===Q)?.drinksOnly?{drinksOnly:!0}:{},allergies:e.allergies??he,...o?{table:o}:{}});(0,a.rememberGuard)(n.id,(0,a.guardFor)({...q,hp:F})),ge(n)},Ye=(0,j.useStore)(e=>me?e.bookings.find(e=>e.id===me.id)?.ref:void 0),Ue=e=>(0,w.waMeLink)(A.settings.whatsapp,(0,w.guestWhatsAppText)({name:e.name,ref:Ye??e.ref,date:e.date,time:e.time,partySize:e.partySize},A.name));if(me){const e='pending'===me.status;return(0,O.jsxs)(b.Screen,{title:e?'Booking request received':'Booking confirmed',subtitle:A.name,children:[(0,O.jsx)(b.Banner,{kind:e?'info':'success',title:`Reference ${Ye??me.ref}`,children:`${me.partySize} people \xb7 ${(0,k.niceDateYear)((0,k.parseYmd)(me.date))} at ${me.time}`}),e?(0,O.jsx)(b.Banner,{kind:"warn",title:"The team will confirm shortly",children:"For larger parties and special requests, a member of the team checks your booking first. Contact the venue if you need an update."}):null,(0,O.jsxs)(b.Card,{children:[(0,O.jsxs)(b.T,{children:["Name: ",me.name]}),(0,O.jsxs)(b.T,{children:["Mobile: ",me.phone]}),me.email?(0,O.jsxs)(b.T,{children:["Email: ",me.email]}):null,(0,O.jsxs)(b.T,{children:["Allergies shared with the restaurant: ",me.allergies.length?me.allergies.map(e=>`${(0,f.allergenLabel)(e.allergen)} (${(0,f.severityLabel)(e.severity)})`).join(', '):'none']}),me.notes?(0,O.jsxs)(b.T,{children:["Notes: ",me.notes]}):null,me.dog?(0,O.jsxs)(b.T,{children:["\ud83d\udc15 Dog coming too",me.table?` \xb7 dog-friendly table ${me.table}`:'']}):null,me.holds?.length?(0,O.jsxs)(b.T,{children:["Reserved: ",me.holds.map(e=>`${e.qty} \xd7 ${'item'===e.kind?(A.settings.reservables??M.ANCHORAGE_RESERVABLES).find(t=>t.id===e.id)?.name??'item':e.id}`).join(', ')," (the kitchen confirms it)"]}):null,me.tableReq?.length?(0,O.jsxs)(b.T,{children:["Table requested: ",me.tableReq.map(e=>`${(0,t.tableNumbers)(e)}`).join(' or ')," (not guaranteed, but we\u2019ll do our best)"]}):null,'deposit'===me.security&&me.depositDue?(0,O.jsxs)(b.T,{weight:"semibold",children:["Deposit due: ",(0,y.gbp)(me.depositDue),". ",A.name," will tell you how to pay it."]}):null,'deposit'===me.security&&me.depositPolicy?(0,O.jsx)(b.Muted,{children:me.depositPolicy}):null,(0,O.jsx)(b.Muted,{children:"Your booking details are shown above. If you need confirmation, contact the venue and quote your reference."}),(0,O.jsxs)(b.Muted,{children:["Need to change or cancel? Call ",A.phone," and quote ",Ye??me.ref,"."]})]}),Ue(me)?(0,O.jsxs)(u.default,{style:{gap:4},children:[(0,O.jsx)(b.Button,{kind:"secondary",label:"\ud83d\udcac Message us on WhatsApp",testID:"guest-whatsapp",onPress:()=>{const e=Ue(me);e&&(0,w.openWhatsApp)(e)}}),(0,O.jsx)(b.Muted,{size:13,children:"Opens WhatsApp with your booking details typed in. You can change the message before you send it."})]}):null,(0,O.jsx)(b.Button,{label:"Back to restaurant",onPress:()=>s.router.replace(`/customer/${A.id}`)})]})}return(0,O.jsxs)(b.Screen,{title:"Book a table",subtitle:A.name,footer:(0,O.jsx)(b.Button,{label:Ee.length?Ee[0]:E>(we.autoAcceptUpTo??7)?'Send booking request':'Confirm booking',disabled:!He,onPress:()=>We(),testID:"confirm-booking"}),children:[(0,O.jsx)(P.FirstQuestions,{rid:A.id,value:ke,onChange:e=>{e.dog===ke.dog&&e.dogs===ke.dogs||V(null),je(e)},party:E,audience:"guest",profile:N.allergies}),(0,O.jsxs)(b.Card,{children:[(0,O.jsxs)(u.default,{style:{gap:6,alignItems:'center'},children:[(0,O.jsx)(b.H2,{children:"Party size"}),(0,O.jsx)(o.PartySizeInput,{value:E,onChange:e=>{H(e),V(null)},min:Ce.min,max:Ce.max,label:"Party size",testID:"party-size"})]}),(0,O.jsx)(h.ChildrenCount,{guest:!0,party:E,value:Y,onChange:_,depositsOn:Ne.on&&Ne.perPersonPence>0,testID:"book-children"}),ze?(0,O.jsx)(b.Banner,{kind:"info",title:Y?`Deposit: ${(0,y.gbp)(ze)} for ${E-Y} adults (children free)`:`Deposit: ${(0,y.gbp)(ze)} for ${E} guests`,children:(0,O.jsx)(u.default,{style:{gap:4},children:Re.map(e=>(0,O.jsx)(b.T,{size:13,children:e},e))})}):Ne.on&&Ne.perPersonPence>0?(0,O.jsxs)(b.Muted,{children:["No deposit for fewer than ",Ne.fromParty," guests."]}):null,E>(we.autoAcceptUpTo??7)?(0,O.jsxs)(b.Muted,{children:["For ",E," people the team checks the booking first, then texts you to confirm."]}):null,ve&&Me?(0,O.jsxs)(b.Muted,{children:["Dogs are welcome in the ",Pe.map(e=>`${e.name}${e.outdoor?' (outdoors, weather permitting)':''}`).join(' and ')||'dog-friendly tables',". We\u2019ll only show times with a dog-friendly table",A.settings.maxDogsPerSlot?' and room for your dog':'',"."]}):null]}),(0,O.jsxs)(b.Card,{children:[(0,O.jsx)(b.H2,{children:"Date"}),(0,O.jsx)(B.CustomerDatePicker,{r:A,today:R,value:U,events:I,onChange:e=>{G(e),V(null)}}),qe.map(e=>(0,O.jsx)(b.Banner,{kind:"demo",title:e.title,children:e.description},e.id))]}),(0,O.jsxs)(b.Card,{children:[(0,O.jsx)(b.H2,{children:"Time"}),0===Oe.length?(0,O.jsx)(b.Muted,{children:"Closed on this day (per listed kitchen hours)."}):(0,O.jsx)(b.Row,{wrap:!0,gap:6,children:Oe.map(e=>(0,O.jsx)(b.Chip,{testID:`book-slot-${e.time}`,label:e.time,sub:e.available?e.drinksOnly?'Drinks only':void 0:e.blocked?'Unavailable':e.noDog?'No dog table':e.leftV(e.time)},e.time))}),De.length>0&&Oe.some(e=>e.blocked)?(0,O.jsx)(b.Banner,{kind:"info",title:Ae?'Some times aren\u2019t available online':'Online booking isn\u2019t available for this time',children:`We\u2019re not taking online bookings ${De.map(e=>`${e.from}\u2013${e.to}`).join(', ')} on ${(0,k.niceDate)(Te)}. Please give us a ring on ${A.phone??"the restaurant"} and we\u2019ll do our best to fit you in.`}):null,(()=>{const e=(0,n.lastFoodOn)(A,U);return e&&Oe.some(e=>e.drinksOnly)?(0,O.jsx)(b.Banner,{kind:"info",title:`Last food orders ${(0,n.fmt12)(e.time)}${'kitchen closes'!==e.reason?` (${e.reason})`:''}`,children:"Times marked \u201cDrinks only\u201d are after the kitchen\u2019s last food orders that day: you\u2019re welcome for drinks, but we can\u2019t serve food."}):null})(),ve&&Oe.some(e=>e.noDog)?(0,O.jsx)(b.Banner,{kind:"info",title:"Some times are full for dogs",children:`Times marked "No dog table" are full in the ${Pe.map(e=>e.name).join(' and ')}${A.settings.maxDogsPerSlot?' or already have the most dogs we can look after':''}${(0,C.closedAreasAt)(ye,A.id,U,Q??'12:00').size?', or the garden is closed for weather':''}. We\u2019d love to see you both, so please try one of the other times shown.`}):null,(0,O.jsx)(b.Muted,{children:(0,x.bookingLimitsHint)(A)})]}),(0,O.jsx)(P.MoreQuestions,{rid:A.id,r:A,value:ke,onChange:je,party:E,date:U,time:Q,today:(0,k.ymd)(R),bookings:fe,audience:"guest",showTables:!0}),(0,O.jsxs)(b.Card,{highlight:ie?void 0:S.colours.amber,children:[(0,O.jsx)(b.Field,{label:"Notes (optional)",value:se,onChangeText:le,placeholder:p.NOTES_PLACEHOLDER,multiline:!0,numberOfLines:3,testID:"book-notes"}),(0,O.jsx)(b.Toggle,{label:"I confirm the allergy information for this booking",value:ie,onChange:ae}),(0,O.jsx)(b.Muted,{children:"Table requests aren\u2019t guaranteed, but we\u2019ll do our best. Nothing here is charged now; reserved dishes are paid on the night."})]}),(0,O.jsxs)(b.Card,{children:[(0,O.jsx)(b.H2,{children:"Your details"}),(0,O.jsx)(b.Field,{label:"Name for the booking",value:J,onChangeText:K}),(0,O.jsx)(b.Field,{testID:"book-phone",label:"Mobile number (needed to book)",value:X,onChangeText:Z,onBlur:()=>ne(!0),keyboardType:"phone-pad",autoComplete:"tel",placeholder:"e.g. 07700 900123"}),Fe.ok||!oe&&!X?null:(0,O.jsx)(b.T,{size:13,colour:S.colours.amber,children:Fe.error}),(0,O.jsx)(b.Field,{testID:"book-email",label:"Email (optional)",value:ee,onChangeText:te,keyboardType:"email-address",autoCapitalize:"none",autoComplete:"email",placeholder:"you@example.com"}),Le?null:(0,O.jsx)(b.T,{size:13,colour:S.colours.amber,children:"That email doesn\u2019t look quite right. Check it, or leave it blank."}),(0,O.jsxs)(b.Muted,{children:["We\u2019ll text you a confirmation",ee.trim()?' and email it too':'',", with how to change or cancel. We only use your number for this booking."]})]}),(0,O.jsx)(i.Honeypot,{value:F,onChange:L})]})}},1238,[843,1095,861,13,17,1239,963,85,841,1240,1108,777,845,851,1101,863,858,946,804,1181,848,993,996,1074,1103,1053,1241,8]); +__d(function(g,_r,_i,_a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return A}});var e,t=_r(d[0]),o=_r(d[1]),n=_r(d[2]),s=_r(d[3]),a=_r(d[4]),l=_r(d[5]),i=_r(d[6]),r=_r(d[7]),u=(e=r)&&e.__esModule?e:{default:e},c=_r(d[8]),h=_r(d[9]),p=_r(d[10]),b=_r(d[11]),f=_r(d[12]),y=_r(d[13]),x=_r(d[14]),k=_r(d[15]),j=_r(d[16]),v=_r(d[17]),w=_r(d[18]),S=_r(d[19]),C=_r(d[20]),T=_r(d[21]),D=_r(d[22]),$=_r(d[23]),P=_r(d[24]),M=_r(d[25]),B=_r(d[26]),O=_r(d[27]);function A(){const{rid:e,date:r}=(0,s.useLocalSearchParams)(),A=(0,j.useRestaurant)(e),N=(0,j.useCustomer)(),z=(0,j.useBookings)(e),I=(0,j.useEvents)(e),R=(0,j.useNow)(6e4),[q]=(0,a.useState)(()=>(0,i.startForm)()),[F,L]=(0,a.useState)(''),[E,H]=(0,a.useState)(2),[W,_]=(0,a.useState)(0),Y=Math.min(W,Math.max(0,E-1)),[U,G]=(0,a.useState)(r??(0,k.ymd)(R)),[Q,V]=(0,a.useState)(null),[J,K]=(0,a.useState)(N.name),[X,Z]=(0,a.useState)(N.phone??''),[ee,te]=(0,a.useState)(N.email??''),[oe,ne]=(0,a.useState)(!1),[se,ae]=(0,a.useState)(''),[le,ie]=(0,a.useState)(!1),[re,de]=(0,a.useState)([]),[ue,ce]=(0,a.useState)(!1),he=[...N.allergies,...re.filter(e=>!N.allergies.some(t=>t.allergen===e)).map(e=>({allergen:e,severity:'allergy'}))],[me,ge]=(0,a.useState)(null),pe=(0,T.useBlocks)(e=>e.blocks);(0,v.usePublicDayStore)(e=>e.n);const be=e?(0,v.publicDay)(e,U):null,fe=be?[...be.bookings,...z.filter(e=>e.date!==U)]:z,ye=be?[...pe.filter(t=>t.rid!==e||t.date!==U),...be.blocks]:pe,xe=(0,D.usePlan)(e),[ke,je]=(0,a.useState)((0,P.emptyNeeds)()),ve=!0===ke.dog,we=ve?ke.dogs:0;if(!A)return(0,O.jsx)(b.Screen,{title:"Not found",children:(0,O.jsx)(b.T,{children:"Restaurant not found."})});const Se=A.settings,Ce=(0,k.parseYmd)(U),Te=(0,x.onlinePartyBounds)(A),De=(0,T.blocksOn)(ye,A.id,U),$e=fe.filter(e=>e.date===U),Pe=xe.areas.filter(e=>e.dogs),Me=(0,M.dogSetUp)(xe),Be=e=>(0,$.freeTablesAt)(xe,$e,E,new Date(`${U}${(0,t.tableNumbers)(e)}:00`),(0,$.turnFor)(E,Se.turnMins),Se.turnMins,{dog:!0,closed:(0,T.closedAreasAt)(ye,A.id,U,e)}),Oe=(0,x.bookingSlots)(A,Ce,e=>fe.filter(t=>t.date===U&&t.time===e&&!['cancelled','noshow'].includes(t.status)).reduce((e,t)=>e+t.partySize,0),E,R,e=>fe.filter(t=>t.date===U&&t.time===e&&!['cancelled','noshow'].includes(t.status)).length).map(e=>{const t=(0,T.blockAt)(ye,A.id,U,e.time),o=ve&&Me&&e.available&&!t&&(!Be(e.time).length||!(0,P.dogTimeOk)(A,fe,U,e.time,we));return{...e,blocked:!!t,noDog:o,available:e.available&&!t&&!o}}),Ae=Oe.some(e=>e.available),Ne=(0,c.depositOf)(Se),ze=(0,c.depositDue)(Ne,E,Y),Ie=ze>0?'deposit':'none',Re=(0,c.depositWords)(Ne,E,A.name,Y),qe=I.filter(e=>e.date===U),Fe=(0,C.guestPhone)(X),Le=(0,C.emailOk)(ee),Ee=(0,P.needsMissing)(ke,N.allergies),He=!!Q&&le&&!Ee.length&&J.trim().length>1&&Fe.ok&&Le,We=async()=>{const e=(0,P.needsPatch)(ke,N.allergies),t=ve&&Me?Be(Q).map(e=>e.table):[],o=ve?ke.tableReq.find(e=>t.includes(e))??t[0]:void 0,n=await j.repo.bookings.create({restaurantId:A.id,customerId:N.id,name:J,partySize:E,...Y?{children:Y}:{},date:U,time:Q,notes:se.trim(),security:Ie,depositPaid:0,...ze?{depositDue:ze,depositPolicy:Re.join(' '),depositRefundable:Ne.refundable,depositCutoffHours:Ne.cutoffHours}:{},phone:Fe.pretty,email:ee.trim()||void 0,source:'online',...e,...Oe.find(e=>e.time===Q)?.drinksOnly?{drinksOnly:!0}:{},allergies:e.allergies??he,...o?{table:o}:{}});(0,i.rememberGuard)(n.id,(0,i.guardFor)({...q,hp:F})),ge(n)},Ye=(0,j.useStore)(e=>me?e.bookings.find(e=>e.id===me.id)?.ref:void 0),Ue=e=>(0,S.waMeLink)(A.settings.whatsapp,(0,S.guestWhatsAppText)({name:e.name,ref:Ye??e.ref,date:e.date,time:e.time,partySize:e.partySize},A.name));if(me){const e='pending'===me.status;return(0,O.jsxs)(b.Screen,{title:e?'Booking request received':'Booking confirmed',subtitle:A.name,children:[(0,O.jsx)(b.Banner,{kind:e?'info':'success',title:`Reference ${Ye??me.ref}`,children:`${me.partySize} people \xb7 ${(0,k.niceDateYear)((0,k.parseYmd)(me.date))} at ${me.time}`}),e?(0,O.jsx)(b.Banner,{kind:"warn",title:"The team will confirm shortly",children:"For larger parties and special requests, a member of the team checks your booking first. Contact the venue if you need an update."}):null,(0,O.jsxs)(b.Card,{children:[(0,O.jsxs)(b.T,{children:["Name: ",me.name]}),(0,O.jsxs)(b.T,{children:["Mobile: ",me.phone]}),me.email?(0,O.jsxs)(b.T,{children:["Email: ",me.email]}):null,(0,O.jsxs)(b.T,{children:["Allergies shared with the restaurant: ",me.allergies.length?me.allergies.map(e=>`${(0,f.allergenLabel)(e.allergen)} (${(0,f.severityLabel)(e.severity)})`).join(', '):'none']}),me.notes?(0,O.jsxs)(b.T,{children:["Notes: ",me.notes]}):null,me.dog?(0,O.jsxs)(b.T,{children:["\ud83d\udc15 Dog coming too",me.table?` \xb7 dog-friendly table ${me.table}`:'']}):null,me.holds?.length?(0,O.jsxs)(b.T,{children:["Reserved: ",me.holds.map(e=>`${e.qty} \xd7 ${'item'===e.kind?(A.settings.reservables??M.ANCHORAGE_RESERVABLES).find(t=>t.id===e.id)?.name??'item':e.id}`).join(', ')," (the kitchen confirms it)"]}):null,me.tableReq?.length?(0,O.jsxs)(b.T,{children:["Table requested: ",me.tableReq.map(e=>`${(0,t.tableNumbers)(e)}`).join(' or ')," (not guaranteed, but we\u2019ll do our best)"]}):null,'deposit'===me.security&&me.depositDue?(0,O.jsxs)(b.T,{weight:"semibold",children:["Deposit due: ",(0,y.gbp)(me.depositDue),". ",A.name," will tell you how to pay it."]}):null,'deposit'===me.security&&me.depositPolicy?(0,O.jsx)(b.Muted,{children:me.depositPolicy}):null,(0,O.jsx)(b.Muted,{children:"Your booking details are shown above. If you need confirmation, contact the venue and quote your reference."}),(0,O.jsxs)(b.Muted,{children:["Need to change or cancel? Call ",A.phone," and quote ",Ye??me.ref,"."]})]}),Ue(me)?(0,O.jsxs)(u.default,{style:{gap:4},children:[(0,O.jsx)(b.Button,{kind:"secondary",label:"\ud83d\udcac Message us on WhatsApp",testID:"guest-whatsapp",onPress:()=>{const e=Ue(me);e&&(0,S.openWhatsApp)(e)}}),(0,O.jsx)(b.Muted,{size:13,children:"Opens WhatsApp with your booking details typed in. You can change the message before you send it."})]}):null,(0,O.jsx)(b.Button,{label:"Back to restaurant",onPress:()=>s.router.replace(`/customer/${A.id}`)})]})}return(0,O.jsxs)(b.Screen,{title:"Book a table",subtitle:A.name,footer:(0,O.jsx)(b.Button,{label:Ee.length?Ee[0]:E>(Se.autoAcceptUpTo??7)?'Send booking request':'Confirm booking',disabled:!He,onPress:()=>We(),testID:"confirm-booking"}),children:[(0,O.jsx)(P.FirstQuestions,{rid:A.id,value:ke,onChange:e=>{e.dog===ke.dog&&e.dogs===ke.dogs||V(null),je(e)},party:E,audience:"guest",profile:N.allergies}),(0,O.jsxs)(b.Card,{children:[(0,O.jsxs)(u.default,{style:{gap:6,alignItems:'center'},children:[(0,O.jsx)(b.H2,{children:"Party size"}),(0,O.jsx)(o.PartySizeInput,{value:E,onChange:e=>{H(e),V(null)},min:Te.min,max:Te.max,label:"Party size",testID:"party-size"})]}),(0,O.jsx)(h.ChildrenCount,{guest:!0,party:E,value:Y,onChange:_,depositsOn:Ne.on&&Ne.perPersonPence>0,testID:"book-children"}),ze?(0,O.jsx)(b.Banner,{kind:"info",title:Y?`Deposit: ${(0,y.gbp)(ze)} for ${E-Y} adults (children don't count towards the ${Ne.fromParty} and don't pay)`:`Deposit: ${(0,y.gbp)(ze)} for ${E} adults`,children:(0,O.jsx)(u.default,{style:{gap:4},children:Re.map(e=>(0,O.jsx)(b.T,{size:13,children:e},e))})}):Ne.on&&Ne.perPersonPence>0?(0,O.jsxs)(b.Muted,{children:["No deposit for fewer than ",Ne.fromParty," adults. Children don't count towards the ",Ne.fromParty," and don't pay, and staff can waive a deposit."]}):null,E>(Se.autoAcceptUpTo??7)?(0,O.jsxs)(b.Muted,{children:["For ",E," people the team checks the booking first, then texts you to confirm."]}):null,ve&&Me?(0,O.jsxs)(b.Muted,{children:["Dogs are welcome in the ",Pe.map(e=>`${e.name}${e.outdoor?' (outdoors, weather permitting)':''}`).join(' and ')||'dog-friendly tables',". We\u2019ll only show times with a dog-friendly table",A.settings.maxDogsPerSlot?' and room for your dog':'',"."]}):null]}),(0,O.jsxs)(b.Card,{children:[(0,O.jsx)(b.H2,{children:"Date"}),(0,O.jsx)(B.CustomerDatePicker,{r:A,today:R,value:U,events:I,onChange:e=>{G(e),V(null)}}),qe.map(e=>(0,O.jsx)(b.Banner,{kind:"demo",title:e.title,children:e.description},e.id))]}),(0,O.jsxs)(b.Card,{children:[(0,O.jsx)(b.H2,{children:"Time"}),0===Oe.length?(0,O.jsx)(b.Muted,{children:"Closed on this day (per listed kitchen hours)."}):(0,O.jsx)(b.Row,{wrap:!0,gap:6,children:Oe.map(e=>(0,O.jsx)(b.Chip,{testID:`book-slot-${e.time}`,label:e.time,sub:e.available?e.drinksOnly?'Drinks only':void 0:e.blocked?'Unavailable':e.noDog?'No dog table':e.leftV(e.time)},e.time))}),De.length>0&&Oe.some(e=>e.blocked)?(0,O.jsx)(b.Banner,{kind:"info",title:Ae?'Some times aren\u2019t available online':'Online booking isn\u2019t available for this time',children:`We\u2019re not taking online bookings ${De.map(e=>`${e.from}\u2013${e.to}`).join(', ')} on ${(0,k.niceDate)(Ce)}. Please give us a ring on ${A.phone??"the restaurant"} and we\u2019ll do our best to fit you in.`}):null,(()=>{const e=(0,n.lastFoodOn)(A,U);return e&&Oe.some(e=>e.drinksOnly)?(0,O.jsx)(b.Banner,{kind:"info",title:`Last food orders ${(0,n.fmt12)(e.time)}${'kitchen closes'!==e.reason?` (${e.reason})`:''}`,children:"Times marked \u201cDrinks only\u201d are after the kitchen\u2019s last food orders that day: you\u2019re welcome for drinks, but we can\u2019t serve food."}):null})(),ve&&Oe.some(e=>e.noDog)?(0,O.jsx)(b.Banner,{kind:"info",title:"Some times are full for dogs",children:`Times marked "No dog table" are full in the ${Pe.map(e=>e.name).join(' and ')}${A.settings.maxDogsPerSlot?' or already have the most dogs we can look after':''}${(0,T.closedAreasAt)(ye,A.id,U,Q??'12:00').size?', or the garden is closed for weather':''}. We\u2019d love to see you both, so please try one of the other times shown.`}):null,(0,O.jsx)(b.Muted,{children:(0,x.bookingLimitsHint)(A)})]}),(0,O.jsx)(P.MoreQuestions,{rid:A.id,r:A,value:ke,onChange:je,party:E,date:U,time:Q,today:(0,k.ymd)(R),bookings:fe,audience:"guest",showTables:!0}),(0,O.jsxs)(b.Card,{highlight:le?void 0:w.colours.amber,children:[(0,O.jsx)(b.Field,{label:"Notes (optional)",value:se,onChangeText:ae,placeholder:p.NOTES_PLACEHOLDER,multiline:!0,numberOfLines:3,testID:"book-notes"}),(0,O.jsx)(b.Toggle,{label:"I confirm the allergy information for this booking",value:le,onChange:ie}),(0,O.jsx)(b.Muted,{children:"Table requests aren\u2019t guaranteed, but we\u2019ll do our best. Nothing here is charged now; reserved dishes are paid on the night."})]}),(0,O.jsxs)(b.Card,{children:[(0,O.jsx)(b.H2,{children:"Your details"}),(0,O.jsx)(b.Field,{label:"Name for the booking",value:J,onChangeText:K}),(0,O.jsx)(b.Field,{testID:"book-phone",label:"Mobile number (needed to book)",value:X,onChangeText:Z,onBlur:()=>ne(!0),keyboardType:"phone-pad",autoComplete:"tel",placeholder:"e.g. 07700 900123"}),Fe.ok||!oe&&!X?null:(0,O.jsx)(b.T,{size:13,colour:w.colours.amber,children:Fe.error}),(0,O.jsx)(b.Field,{testID:"book-email",label:"Email (optional)",value:ee,onChangeText:te,keyboardType:"email-address",autoCapitalize:"none",autoComplete:"email",placeholder:"you@example.com"}),Le?null:(0,O.jsx)(b.T,{size:13,colour:w.colours.amber,children:"That email doesn\u2019t look quite right. Check it, or leave it blank."}),(0,O.jsxs)(b.Muted,{children:["We\u2019ll text you a confirmation",ee.trim()?' and email it too':'',", with how to change or cancel. We only use your number for this booking."]})]}),(0,O.jsx)(l.Honeypot,{value:F,onChange:L})]})}},1238,[843,1095,861,13,17,1239,963,85,841,1240,1108,777,845,851,1101,863,858,946,804,1181,848,993,996,1074,1103,1053,1241,8]); __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.Honeypot=function({value:t,onChange:n}){return(0,l.jsx)(o.default,{"aria-hidden":!0,pointerEvents:"none",style:{position:'absolute',left:-1e4,top:0,width:1,height:1,overflow:'hidden',opacity:0},children:(0,l.jsx)(e.TextInput,{testID:"hp-field",accessibilityLabel:"Leave this empty",value:t,onChangeText:n,tabIndex:-1,autoComplete:'off',name:'cc_extra_info','aria-hidden':!0})})};var e=r(d[0]);r(d[1]),r(d[2]);var t,n=r(d[3]),o=(t=n)&&t.__esModule?t:{default:t},l=r(d[4])},1239,[812,17,219,85,8]); -__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"maxChildren",{enumerable:!0,get:function(){return u}}),_e.ChildrenCount=function({party:e,value:t,onChange:o,depositsOn:h,testID:c="children-count",guest:p}){const f=u(e);if(f<1)return null;const x=Math.min(t,f);return(0,s.jsxs)(n.default,{style:{gap:6,alignItems:'center',width:'100%'},testID:c,children:[(0,s.jsx)(l.T,{size:17,weight:"semibold",center:!0,children:p?`How many of the ${e} are children?`:`Children in the ${e}`}),(0,s.jsx)(l.Stepper,{value:x,onChange:e=>o(Math.max(0,Math.min(f,e))),min:0,max:f,label:"children",testID:`${c}-stepper`,format:e=>e?String(e):'None'}),h?(0,s.jsx)(l.Muted,{center:!0,children:"Children never pay a deposit."}):null]})},r(d[0]);var e,t=r(d[1]),n=(e=t)&&e.__esModule?e:{default:e},l=r(d[2]),s=r(d[3]);const u=e=>Math.max(0,Math.round(Number(e)||0)-1)},1240,[17,85,777,8]); +__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"maxChildren",{enumerable:!0,get:function(){return o}}),_e.ChildrenCount=function({party:e,value:t,onChange:u,depositsOn:h,testID:c="children-count",guest:p}){const f=o(e);if(f<1)return null;const x=Math.min(t,f);return(0,s.jsxs)(n.default,{style:{gap:6,alignItems:'center',width:'100%'},testID:c,children:[(0,s.jsx)(l.T,{size:17,weight:"semibold",center:!0,children:p?`How many of the ${e} are children?`:`Children in the ${e}`}),(0,s.jsx)(l.Stepper,{value:x,onChange:e=>u(Math.max(0,Math.min(f,e))),min:0,max:f,label:"children",testID:`${c}-stepper`,format:e=>e?String(e):'None'}),h?(0,s.jsx)(l.Muted,{center:!0,children:"Children don't count towards the number that needs a deposit, and never pay."}):null]})},r(d[0]);var e,t=r(d[1]),n=(e=t)&&e.__esModule?e:{default:e},l=r(d[2]),s=r(d[3]);const o=e=>Math.max(0,Math.round(Number(e)||0)-1)},1240,[17,85,777,8]); __d(function(g,_r,_i,a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.CustomerDatePicker=function({r:e,today:m,value:D,events:x,onChange:f}){const p=(0,n.ymd)(m),j=(0,r.lastBookableDay)(p,e),[C,w]=(0,t.useState)(!1),[Y,k]=(0,t.useState)((0,i.slashDay)(D)),[I,P]=(0,t.useState)(D);I!==D&&(P(D),k((0,i.slashDay)(D)));const T=new Date(m);T.setHours(12,0,0,0);const $=Array.from({length:b},(e,t)=>{const s=new Date(T);return s.setDate(T.getDate()+t),s}).filter(e=>(0,n.ymd)(e)<=j),v=t=>!!(0,o.hoursFor)(e,t),F=(0,n.parseYmd)(D),[L,M]=(0,t.useState)(()=>({y:F.getFullYear(),m:F.getMonth()})),S=(new Date(L.y,L.m,1,12).getDay()+6)%7,R=new Date(L.y,L.m+1,0).getDate(),A=[...Array.from({length:S},()=>null),...Array.from({length:R},(e,t)=>new Date(L.y,L.m,t+1,12))];for(;A.length%7;)A.push(null);const z=(0,n.parseYmd)(j),W=L.y>m.getFullYear()||L.y===m.getFullYear()&&L.m>m.getMonth(),B=L.yM(({y:t,m:s})=>{const l=new Date(t,s+e,1);return{y:l.getFullYear(),m:l.getMonth()}}),_=Y===(0,i.slashDay)(D)?null:(0,r.typedBookDateProblem)(Y,p,e),O=e=>{f(e),w(!1)},G=(e,t)=>0===t?'Today':1===t?'Tomorrow':`${(0,n.dayShort)(e)} ${e.getDate()}`,N=$.some(e=>(0,n.ymd)(e)===D);return(0,h.jsxs)(l.default,{testID:"cust-date",style:{gap:10,alignItems:'center',width:'100%'},children:[(0,h.jsx)(l.default,{accessible:!0,accessibilityLiveRegion:"polite",testID:"cust-date-chosen",children:(0,h.jsx)(d.T,{center:!0,weight:"semibold",colour:c.colours.goldLight,children:`Booking for ${(0,n.niceDateYear)(F)}${v(F)?'':' (closed that day)'}`})}),(0,h.jsxs)(d.Row,{wrap:!0,gap:6,style:{justifyContent:'center'},children:[$.map((e,t)=>{const s=(0,n.ymd)(e),l=x.some(e=>e.date===s);return(0,h.jsx)(d.Chip,{testID:`cust-day-${s}`,label:G(e,t),sub:v(e)?l?'\u2605 event':void 0:'Closed',disabled:!v(e),selected:D===s,accessibilityLabel:`${(0,n.niceDate)(e)}${v(e)?l?', event':'':', closed'}`,onPress:()=>O(s)},s)}),N?null:(0,h.jsx)(d.Chip,{label:(0,n.niceDate)(F),sub:v(F)?void 0:'Closed',selected:!0,onPress:()=>w(!0),accessibilityLabel:`Chosen: ${(0,n.niceDateYear)(F)}. Opens the calendar`})]}),(0,h.jsxs)(l.default,{style:{width:'100%',maxWidth:360,gap:4},children:[(0,h.jsx)(d.Field,{label:"Any other date (DD/MM/YYYY)",testID:"cust-date-typed",value:Y,placeholder:"24/12/2026",keyboardType:"numbers-and-punctuation",maxLength:10,autoCapitalize:"none",autoCorrect:!1,style:{textAlign:'center'},accessibilityLabel:"Booking date, typed as day, month and four-digit year",onChangeText:t=>{const s=(0,i.slashDate)(t,Y);k(s);const l=(0,i.dayFromSlash)(s);l&&!(0,r.typedBookDateProblem)(s,p,e)&&f(l)}}),_&&Y.length>=10?(0,h.jsx)(d.T,{center:!0,size:15,colour:c.colours.amber,testID:"cust-date-problem",children:_}):null]}),(0,h.jsx)(d.Button,{kind:"secondary",label:C?'Hide calendar':'\ud83d\udcc5 Pick a date from a calendar',testID:"cust-date-cal",style:{minHeight:48},accessibilityLabel:C?'Hide the calendar':'Pick a date from a month calendar',onPress:()=>{C||M({y:F.getFullYear(),m:F.getMonth()}),w(!C)}}),C?(0,h.jsxs)(l.default,{testID:"cust-calendar",style:{borderWidth:1,borderColor:c.colours.border,borderRadius:14,padding:10,gap:6,backgroundColor:c.colours.surface2,width:'100%',maxWidth:420},children:[(0,h.jsx)(l.default,{style:{alignItems:'flex-end'},children:(0,h.jsx)(u.GoldClose,{label:"Close the calendar",testID:"cust-calendar-close",onPress:()=>w(!1),size:"sm"})}),(0,h.jsxs)(d.Row,{style:{justifyContent:'space-between',alignItems:'center'},children:[(0,h.jsx)(s.default,{accessibilityRole:"button",accessibilityLabel:"Previous month",accessibilityState:{disabled:!W},disabled:!W,onPress:()=>H(-1),style:{minWidth:48,minHeight:48,alignItems:'center',justifyContent:'center',opacity:W?1:.3},children:(0,h.jsx)(d.T,{size:22,colour:c.colours.gold,children:"\u2039"})}),(0,h.jsxs)(d.T,{center:!0,weight:"semibold",accessibilityRole:"header",children:[(0,n.monthLong)(L.m)," ",L.y]}),(0,h.jsx)(s.default,{accessibilityRole:"button",accessibilityLabel:"Next month",accessibilityState:{disabled:!B},disabled:!B,onPress:()=>H(1),style:{minWidth:48,minHeight:48,alignItems:'center',justifyContent:'center',opacity:B?1:.3},children:(0,h.jsx)(d.T,{size:22,colour:c.colours.gold,children:"\u203a"})})]}),(0,h.jsx)(l.default,{style:{flexDirection:'row'},importantForAccessibility:"no-hide-descendants",children:y.map(e=>(0,h.jsx)(d.T,{size:12,colour:c.colours.muted,center:!0,style:{flex:1},children:e},e))}),Array.from({length:A.length/7},(e,t)=>(0,h.jsx)(l.default,{style:{flexDirection:'row',gap:4},children:A.slice(7*t,7*t+7).map((e,t)=>{if(!e)return(0,h.jsx)(l.default,{style:{flex:1,height:44}},t);const o=(0,n.ymd)(e),i=oj,r=o===D,u=!v(e);return(0,h.jsx)(s.default,{testID:`cust-cal-${o}`,accessibilityRole:"button",accessibilityLabel:`${(0,n.niceDateYear)(e)}${i?', not bookable online':u?', closed':''}`,accessibilityState:{disabled:i||u,selected:r},disabled:i||u,onPress:()=>O(o),style:{flex:1,height:44,borderRadius:10,alignItems:'center',justifyContent:'center',borderWidth:o===p?1.5:0,borderColor:c.colours.gold,backgroundColor:r?c.colours.gold:'transparent',opacity:i?.3:1},children:(0,h.jsx)(d.T,{size:15,center:!0,weight:r?'bold':'regular',colour:r?c.colours.onGold:u?c.colours.muted:c.colours.text,style:u&&!i?{textDecorationLine:'line-through'}:void 0,children:e.getDate()})},t)})},t)),(0,h.jsxs)(d.Muted,{center:!0,children:["Crossed-out days: closed. ",(0,r.bookAheadUnlimited)(e)?`You can book up to ${(0,i.slashDay)(j)}.`:`Online booking is open up to ${(0,i.slashDay)(j)}.`]})]}):null]})};var t=_r(_d[0]),s=e(_r(_d[1])),l=e(_r(_d[2])),o=_r(_d[3]),n=_r(_d[4]),i=_r(_d[5]),r=_r(_d[6]),c=_r(_d[7]),d=_r(_d[8]),u=_r(_d[9]),h=_r(_d[10]);const y=['Mon','Tue','Wed','Thu','Fri','Sat','Sun'],b=14},1241,[17,385,85,862,863,1031,1242,804,777,779,8]); __d(function(g,_r,i,a,_m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"SERVER_MAX_DAYS_AHEAD",{enumerable:!0,get:function(){return n}}),e.bookAheadDays=r,Object.defineProperty(e,"bookAheadUnlimited",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"lastBookableDay",{enumerable:!0,get:function(){return u}}),e.typedBookDateProblem=function(n,r,o){const s=(n??'').trim();if(!s)return'Type a date as DD/MM/YYYY, for example 24/12/2026.';const l=(0,t.dayFromSlash)(s);if(!l)return'That isn\u2019t a date yet. Type it as DD/MM/YYYY, for example 24/12/2026.';if(lc){const[t,n,r]=c.split('-');return`Online booking is open up to ${r}/${n}/${t}. For later dates, please call us.`}return null};var t=_r(_d[0]);const n=366;function r(t){const r=Number(t?.settings?.onlineBookDaysAhead);return Number.isFinite(r)&&r>=1?Math.min(Math.round(r),n):n}const o=t=>r(t)>=n,s=(t,n)=>{const r=new Date(t+'T12:00:00Z');return r.setUTCDate(r.getUTCDate()+n),r.toISOString().slice(0,10)},u=(t,n)=>s(t,r(n))},1242,[1031]); __d(function(_g,_r,i,_a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return b}});var n=_r(_d[0]),t=_r(_d[1]),s=_r(_d[2]),a=e(_r(_d[3])),l=e(_r(_d[4])),r=_r(_d[5]),o=_r(_d[6]),d=_r(_d[7]),c=_r(_d[8]),u=_r(_d[9]),h=_r(_d[10]),g=_r(_d[11]),p=_r(_d[12]),f=_r(_d[13]);function b(){const{rid:e,did:b}=(0,t.useLocalSearchParams)(),j=(0,h.useRestaurant)(e),x=(0,h.useMenu)(e).find(e=>e.id===b),y=(0,h.useCustomer)(),m=(0,h.useRecipeCards)(e).find(e=>e.id===x?.recipeCardId),k=m?.signOff&&m.photo?(0,g.recipeCards)().photoSource(m.photo):null,v=(0,h.useStore)(e=>e.addLine),w=(0,n.useTakeawayMenu)(n=>n.byVenue[e]),S=(0,h.useStore)(n=>n.basket.restaurantId===e&&'table'===n.basket.mode),[C,B]=(0,s.useState)(()=>(x?.optionGroups??[]).filter(e=>e.required).map(e=>e.choices[0].id)),[$,I]=(0,s.useState)(1),[P,T]=(0,s.useState)(''),[L,O]=(0,s.useState)(!1),[D,A]=(0,s.useState)(!1),[M,R]=(0,s.useState)(!1),[q,_]=(0,s.useState)(!1),N=(0,s.useMemo)(()=>x?(0,c.effectiveAllergens)(x,C):{},[x,C]);if(!j||!x)return(0,f.jsx)(d.Screen,{title:"Not found",children:(0,f.jsx)(d.T,{children:"Dish not found."})});const G=(0,c.conflictsFor)(N,y.allergies),Y=(x.price??0)+(x.optionGroups??[]).flatMap(e=>e.choices).filter(e=>C.includes(e.id)).reduce((e,n)=>e+n.priceDelta,0),z=S||j.fictional?'on':(0,n.takeawayAvail)(x,w),F=x.soldOut||!x.signOff||null===x.price||'on'!==z,Q=(e,n)=>{const t=x.optionGroups.find(n=>n.id===e);B(e=>{const s=t.choices.map(e=>e.id);return t.multi?e.includes(n)?e.filter(e=>e!==n):[...e,n]:e.includes(n)&&!t.required?e.filter(e=>e!==n):[...e.filter(e=>!s.includes(e)),n]})},V=e=>{h.useStore.getState().basket.restaurantId!==j.id&&h.useStore.getState().startBasket(j.id,'takeaway'),v({itemId:x.id,qty:$,choiceIds:C,notes:P,override:e?{allergens:G.contains,at:(new Date).toISOString()}:void 0}),O(!1),_(!0)};return(0,f.jsxs)(d.Screen,{title:x.name,subtitle:j.name,right:(0,f.jsx)(o.BasketButton,{}),children:[k?(0,f.jsx)(a.default,{testID:"dish-photo",source:k,accessibilityLabel:`${x.name}${'example'===m?.origin?' (example photo)':''}`,style:{width:'100%',height:200,borderRadius:12},resizeMode:"cover"}):null,(0,f.jsxs)(d.Row,{wrap:!0,gap:6,children:[(0,f.jsx)(d.T,{weight:"bold",size:20,colour:p.colours.gold,children:null===x.price?x.priceNote:(0,u.gbp)(Y)}),x.dietary.map(e=>(0,f.jsx)(d.Badge,{kind:"ok",label:e},e))]}),(0,f.jsx)(d.T,{children:x.description}),G.contains.length?(0,f.jsx)(d.Banner,{kind:"danger",title:`Blocked: contains ${G.contains.map(c.allergenLabel).join(', ')}`,children:`You\u2019ve told us: ${y.allergies.filter(e=>G.contains.includes(e.allergen)).map(e=>`${(0,c.allergenLabel)(e.allergen)} \u2014 ${(0,c.severityLabel)(e.severity)}`).join('; ')}. This dish can\u2019t be added unless you deliberately override (for example, ordering for someone else).`}):null,G.may.length?(0,f.jsx)(d.Banner,{kind:"warn",title:`Warning: may contain ${G.may.map(c.allergenLabel).join(', ')}`,children:"Cross-contact is possible (e.g. shared fryer). Please speak to staff before ordering."}):null,(x.optionGroups??[]).map(e=>(0,f.jsxs)(d.Card,{children:[(0,f.jsxs)(d.T,{weight:"semibold",children:[e.name,e.required?' (required)':' (optional)']}),(0,f.jsx)(d.Row,{wrap:!0,gap:6,children:e.choices.map(n=>(0,f.jsx)(d.Chip,{label:n.label,sub:n.priceDelta?`+${(0,u.gbp)(n.priceDelta)}`:void 0,selected:C.includes(n.id),onPress:()=>Q(e.id,n.id)},n.id))})]},e.id)),(0,f.jsx)(d.Card,{children:(0,f.jsx)(r.AllergenPanel,{item:x,map:N,declared:y.allergies})}),j.fictional?null:(0,f.jsx)(d.AllergenNotice,{phone:j.phone}),(0,f.jsx)(d.Field,{label:"Notes for the kitchen (optional)",placeholder:"e.g. no gherkins",value:P,onChangeText:T}),(0,f.jsxs)(d.Row,{style:{justifyContent:'space-between'},children:[(0,f.jsx)(d.T,{weight:"semibold",children:"Quantity"}),(0,f.jsx)(d.Stepper,{value:$,onChange:I,label:"quantity"})]}),q?(0,f.jsx)(d.Banner,{kind:"success",title:"Added to basket",children:G.contains.length?'Allergy override recorded \u2014 the kitchen will see a large allergy alert.':'Carry on browsing or go to your basket.'}):null,F?(0,f.jsx)(d.Banner,{kind:"warn",children:x.soldOut||'sold-out'===z?'Sold out today.':'off'===z&&x.signOff&&null!==x.price?'This dish isn\u2019t on the takeaway menu. You can have it when you eat in.':x.signOff?'Price on the specials board \u2014 ask staff.':'Not available to order online until the head chef signs off its allergens.'}):G.contains.length?(0,f.jsxs)(l.default,{style:{gap:8},children:[(0,f.jsx)(d.Button,{kind:"secondary",label:"Choose something else",onPress:()=>t.router.back()}),(0,f.jsx)(d.Button,{kind:"danger",label:"Override and add anyway\u2026",onPress:()=>{A(!1),R(!1),O(!0)},testID:"override-open"})]}):(0,f.jsxs)(d.Row,{gap:8,children:[(0,f.jsx)(d.Button,{style:{flex:1},label:`Add ${$} to basket \xb7 ${(0,u.gbp)(Y*$)}`,onPress:()=>V(!1),testID:"add-to-basket"}),q?(0,f.jsx)(d.Button,{kind:"secondary",label:"Basket",onPress:()=>t.router.push('/customer/basket')}):null]}),(0,f.jsxs)(d.Sheet,{visible:L,onClose:()=>O(!1),title:"Allergy override",children:[(0,f.jsx)(d.Banner,{kind:"danger",title:`${x.name} contains ${G.contains.map(c.allergenLabel).join(', ')}`,children:`Your profile says: ${y.allergies.filter(e=>G.contains.includes(e.allergen)).map(e=>`${(0,c.allergenLabel)(e.allergen)} \u2014 ${(0,c.severityLabel)(e.severity)}`).join('; ')}.`}),(0,f.jsx)(d.Toggle,{label:"I understand this dish contains an allergen I have declared",value:D,onChange:A}),(0,f.jsx)(d.Toggle,{label:"It is for someone without this allergy, or I have spoken to staff",value:M,onChange:R}),(0,f.jsx)(d.Muted,{children:"The override is logged and shown to the kitchen as an allergy alert that must be acknowledged."}),(0,f.jsx)(d.Button,{kind:"danger",disabled:!D||!M,label:"Confirm override and add",onPress:()=>V(!0),testID:"override-confirm"})]})]})}},1243,[947,13,17,319,85,1216,1244,777,845,851,858,867,804,8]); @@ -1498,7 +1498,7 @@ __d(function(g,_r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule? __d(function(g,r,i,a,_m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"DESKTOP_EXPIRED",{enumerable:!0,get:function(){return n}}),e.handoverCodeFrom=function(n){const t=(n||'').trim();if(!t)return null;const o=t.match(/[#&]ccchrome=([A-Za-z0-9_-]{24,64})(?:&|\s|$)/);if(o)return o[1];if(/[/#?=]/.test(t))return null;const c=t.replace(/\s+/g,'');return/^[A-Za-z0-9_-]{24,64}$/.test(c)?c:null},e.desktopLinkFor=function(n,t){try{const o=new URL(n),c=o.pathname.match(/^(.*?\/)(?:owner|staff|chef|display|customer|car)-app\/|^(.*?\/)owner-desktop\//),s=c?c[1]??c[2]:o.pathname.replace(/[^/]*$/,'');return`${o.origin}${s}owner-desktop/index.html#ccchrome=${t}`}catch{return null}},Object.defineProperty(e,"codeGroups",{enumerable:!0,get:function(){return t}}),e.desktopRefusal=function(t){return/no longer active/i.test(t)?'This person is no longer active in CoverCharge. Ask the other owner.':/expired|Chrome link|already been used/i.test(t)?n:t};const n='That sign-in link has run out or has already been used. On your phone, open More, then Use on a computer, and make a new one.';const t=n=>(n.match(/.{1,4}/g)??[]).join(' ')},1415,[]); __d(function(g,_r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.LaunchWelcome=function({p:e,onDone:t}){(0,r.useEffect)(()=>{if(!O||document.getElementById('cc-launch-css'))return;const e=document.createElement('style');e.id='cc-launch-css',e.textContent=I,document.head.appendChild(e)},[]),(0,r.useEffect)(()=>{if(O)return document.documentElement.classList.add('cc-welcome'),()=>document.documentElement.classList.remove('cc-welcome')},[]);const[o,k]=(0,r.useState)(P()?0:3),[E,_]=(0,r.useState)('main'),[Y,F]=(0,r.useState)(''),[H,M]=(0,r.useState)(0);(0,r.useEffect)(()=>{if(o<=0)return;const e=setTimeout(()=>k(e=>e-1),300);return()=>clearTimeout(e)},[o]);const B=(0,f.useAvatars)(t=>!!t.photos[e.id]),K=(0,b.useStore)(e=>e.restaurants[0]?.name??'Your venue').toUpperCase(),V=(0,x.useOwner)(t=>t.hourly[e.id]),G=(0,x.useOwner)(t=>t.staff.find(t=>t.id===e.id)),$=(0,y.useSync)(e=>e.mode),q='live'===$||'offline'===$,J=G?.salaried||e.salaried?'Salaried':null!=V?`\xa3${(V/100).toFixed(2)} an hour${G?.noTax?' \xb7 no-tax code':''}`:'connecting'===$?'Loading\u2026':'Ask your manager',Q='staff'!==e.app&&'staff'!==p.APP_VARIANT?(0,v.appUrl)('staff'):null,X=`AN-${String(j.ROSTER.findIndex(t=>t.id===e.id)+1).padStart(2,'0')}`,Z=p.IS_OWNER_DESKTOP?'CoverCharge for desktop':v.APP_NAME['staff'===p.APP_VARIANT?'staff':e.app],ee=L['staff'===p.APP_VARIANT&&'staff'!==e.app?'Staff':e.level]??L.Staff;return(0,C.jsxs)(h.default,{testID:"invite-welcome",style:[u.default.absoluteFill,{backgroundColor:(0,n.soutersSurface)('#000'),zIndex:1e3}],children:[(0,C.jsxs)(h.default,{...R('space'),pointerEvents:"none",children:[(0,C.jsx)(h.default,{...R('stars1')}),(0,C.jsx)(h.default,{...R('stars2')})]}),o>0?(0,C.jsxs)(l.default,{testID:"invite-countdown",accessibilityLabel:"Skip intro",onPress:()=>k(0),style:{flex:1,alignItems:'center',justifyContent:'center',gap:10},children:[(0,C.jsxs)(D,{colour:w.colours.muted,children:[K," \xb7 COVER CHARGE"]}),(0,C.jsx)(h.default,{...R('count'),children:(0,C.jsx)(T.T,{size:120,weight:"bold",colour:A,children:o})},o),(0,C.jsx)(D,{children:"GETTING YOU ON BOARD"})]}):'selfie'===E?(0,C.jsx)(W,{p:e,onClose:e=>{_('main'),e?(F('Avatar saved. Looking good!'),M(e=>e+1)):F('')}}):(0,C.jsxs)(c.default,{contentContainerStyle:{padding:22,paddingTop:34,gap:18,alignItems:'center',maxWidth:520,width:'100%',alignSelf:'center',paddingBottom:56},children:[(0,C.jsxs)(h.default,{...R('rise1'),style:{alignItems:'center',gap:2},children:[(0,C.jsxs)(D,{children:[K," \xb7 ",Z.toUpperCase()]}),(0,C.jsx)(T.T,{size:20,colour:w.colours.muted,center:!0,style:{marginTop:10},children:"Welcome aboard,"}),(0,C.jsx)(T.T,{size:42,weight:"bold",center:!0,style:{lineHeight:50},children:e.name})]}),(0,C.jsxs)(h.default,{...R('reveal'),style:{marginVertical:8},children:[(0,C.jsx)(h.default,{...R('orbit'),pointerEvents:"none"}),(0,C.jsx)(h.default,{...R('halo'),children:(0,C.jsx)(S.StaffAvatar,{id:e.id,size:156})})]},H),Y?(0,C.jsx)(T.T,{size:16,weight:"semibold",colour:w.colours.ok,center:!0,children:Y}):null,(0,C.jsx)(h.default,{...R('rise2'),style:{alignSelf:'stretch'},children:(0,C.jsxs)(h.default,{testID:"invite-crew-card",...R('card'),style:{borderRadius:20,borderWidth:1,borderColor:'rgba(207,164,95,0.55)',overflow:'hidden',padding:18,gap:12},children:[(0,C.jsx)(h.default,{...R('sheen'),pointerEvents:"none"}),(0,C.jsxs)(h.default,{style:{flexDirection:'row',justifyContent:'space-between',alignItems:'center'},children:[(0,C.jsx)(D,{children:"CREW ID"}),(0,C.jsx)(T.T,{size:15,weight:"semibold",colour:w.colours.muted,style:{letterSpacing:1.5},children:X})]}),(0,C.jsx)(h.default,{style:{height:2,backgroundColor:A,opacity:.7,borderRadius:1}}),(0,C.jsx)(N,{k:"NAME",v:e.name}),(0,C.jsx)(N,{k:"ROLE",v:(0,v.levelJob)(e.level,e.job)}),(0,C.jsx)(N,{k:"APP",v:Z}),'owner'!==e.role?(0,C.jsx)(h.default,{testID:"invite-pay",children:(0,C.jsx)(N,{k:"PAY",v:J})}):null,(0,C.jsx)(N,{k:"ACCESS",v:'Owner'===e.level?'Everything':'Manager'===e.level?'Manager':'Supervisor'===e.level?'Supervisor':'Head Chef'===e.level?'Kitchen lead':'Team member'}),(0,C.jsxs)(h.default,{style:{flexDirection:'row',alignItems:'center',gap:8},children:[(0,C.jsx)(h.default,{...R('blink'),style:{width:10,height:10,borderRadius:5,backgroundColor:w.colours.ok}}),(0,C.jsx)(T.T,{size:15,colour:w.colours.ok,children:p.IS_OWNER_DESKTOP?'Signed in on this computer':'Signed in on this phone'})]})]})}),(0,C.jsxs)(h.default,{...R('rise3'),style:{alignSelf:'stretch',gap:10},children:[(0,C.jsx)(D,{children:"WHAT YOU CAN DO"}),ee.map(e=>(0,C.jsxs)(h.default,{style:{flexDirection:'row',gap:12,alignItems:'flex-start'},children:[(0,C.jsx)(T.T,{size:16,colour:A,children:"\u25c6"}),(0,C.jsx)(T.T,{size:16,style:{flex:1},children:e})]},e))]}),O?(0,C.jsxs)(h.default,{testID:"invite-avatar-offer",...R('rise4'),style:{alignSelf:'stretch',gap:12,borderRadius:20,padding:18,borderWidth:1,borderColor:'rgba(255,255,255,0.14)',backgroundColor:'rgba(255,255,255,0.03)'},children:[(0,C.jsx)(D,{children:"YOUR AVATAR \xb7 OPTIONAL"}),(0,C.jsx)(T.T,{size:16,children:B?'You made your own avatar from a photo.':'Keep this one, choose an original icon, or make your own from a photo.'}),(0,C.jsx)(z,{kind:"ghost",label:B?'Choose another avatar':'Choose my avatar',testID:"invite-avatar-make",onPress:()=>{F(''),_('selfie')}}),(0,C.jsxs)(T.T,{size:15,colour:w.colours.muted,children:["Your photo stays on this ",p.IS_OWNER_DESKTOP?'computer':'phone',". It\u2019s turned into your avatar here; only the finished avatar is shared with your team."]})]}):null,(0,C.jsx)(h.default,{style:{alignSelf:'stretch',gap:10,marginTop:4},children:(0,C.jsx)(z,{label:B?'Get started':'Skip, keep this one and get started',testID:"invite-get-started",onPress:t})}),(0,s.inPhoneApp)()?null:(0,C.jsxs)(h.default,{style:{alignSelf:'stretch',gap:6,borderRadius:16,padding:16,borderWidth:1,borderColor:'rgba(255,255,255,0.12)'},children:[(0,C.jsx)(T.T,{size:16,weight:"semibold",colour:A,children:"Tip: add it to your Home screen"}),(0,C.jsxs)(T.T,{size:15,children:[U()," It then opens like a normal app and remembers you."]})]}),Q?(0,C.jsx)(l.default,{accessibilityRole:"link",onPress:()=>{O&&window.location.assign(Q)},children:(0,C.jsx)(T.T,{size:15,colour:A,center:!0,children:"Also open CoverCharge for Staff (your clock-in, rota and pay) \u203a"})}):null,(0,C.jsx)(T.T,{size:14,colour:w.colours.muted,center:!0,children:q?'Connected: bookings, orders and stock are shared live with the rest of the team. Your pay is only visible to you and your managers.':'Connecting\u2026 if there\u2019s no signal, what you enter is kept on this phone and shared once you\u2019re back online.'})]})]})};var t=_r(d[0]),n=_r(d[1]),r=_r(d[2]),s=_r(d[3]),o=e(_r(d[4]));_r(d[5]);var l=e(_r(d[6])),c=e(_r(d[7])),u=e(_r(d[8])),h=e(_r(d[9])),p=_r(d[10]),f=_r(d[11]),x=_r(d[12]),b=_r(d[13]),y=_r(d[14]),v=_r(d[15]),j=_r(d[16]),k=_r(d[17]),w=_r(d[18]),S=_r(d[19]),T=_r(d[20]),C=_r(d[21]);const A=w.colours.gold,I="\n[data-cc=\"space\"]{position:absolute;top:0;left:0;right:0;bottom:0;overflow:hidden;background:radial-gradient(ellipse at 50% 115%,#2a1f0c 0%,#0a0805 38%,#000 70%)}\n[data-cc=\"stars1\"],[data-cc=\"stars2\"]{position:absolute;top:-50%;left:-50%;width:200%;height:200%;will-change:transform}\n[data-cc=\"stars1\"]{background-image:radial-gradient(1.2px 1.2px at 23px 41px,#fff,transparent),radial-gradient(1px 1px at 97px 13px,#fff9,transparent),radial-gradient(1.4px 1.4px at 151px 120px,#f5e6c8,transparent),radial-gradient(1px 1px at 61px 163px,#fffa,transparent),radial-gradient(1.2px 1.2px at 183px 77px,#fff8,transparent);background-size:211px 199px;animation:cc-drift 90s linear infinite;opacity:.75}\n[data-cc=\"stars2\"]{background-image:radial-gradient(2px 2px at 40px 60px,#CFA45F,transparent),radial-gradient(1.6px 1.6px at 250px 210px,#fff,transparent),radial-gradient(1.8px 1.8px at 330px 40px,#fffc,transparent);background-size:397px 367px;animation:cc-drift2 60s linear infinite,cc-twinkle 3.2s ease-in-out infinite alternate;opacity:.8}\n@keyframes cc-drift{to{transform:translate3d(-211px,199px,0)}}\n@keyframes cc-drift2{to{transform:translate3d(-397px,367px,0)}}\n@keyframes cc-twinkle{from{opacity:.45}to{opacity:.95}}\n[data-cc=\"count\"]{animation:cc-count .32s cubic-bezier(.2,.8,.2,1) both}\n@keyframes cc-count{from{opacity:0;transform:scale(1.9)}to{opacity:1;transform:scale(1)}}\n[data-cc=\"reveal\"]{animation:cc-reveal .75s cubic-bezier(.2,.9,.25,1.25) both}\n@keyframes cc-reveal{0%{opacity:0;transform:scale(.35) rotate(-12deg)}100%{opacity:1;transform:scale(1) rotate(0)}}\n[data-cc=\"halo\"]{border-radius:999px;box-shadow:0 0 0 2px rgba(207,164,95,.85),0 0 38px 6px rgba(207,164,95,.35);animation:cc-glow 2.6s ease-in-out infinite}\n@keyframes cc-glow{0%,100%{box-shadow:0 0 0 2px rgba(207,164,95,.85),0 0 30px 4px rgba(207,164,95,.28)}50%{box-shadow:0 0 0 2px rgba(207,164,95,1),0 0 52px 10px rgba(207,164,95,.5)}}\n[data-cc=\"orbit\"]{position:absolute;top:-14px;left:-14px;right:-14px;bottom:-14px;border-radius:999px;border:1px dashed rgba(207,164,95,.45);animation:cc-spin 14s linear infinite}\n@keyframes cc-spin{to{transform:rotate(360deg)}}\n[data-cc=\"rise1\"],[data-cc=\"rise2\"],[data-cc=\"rise3\"],[data-cc=\"rise4\"]{animation:cc-rise .5s cubic-bezier(.2,.8,.2,1) both}\n[data-cc=\"rise2\"]{animation-delay:.12s}[data-cc=\"rise3\"]{animation-delay:.24s}[data-cc=\"rise4\"]{animation-delay:.36s}\n@keyframes cc-rise{from{opacity:0;transform:translate3d(0,18px,0)}to{opacity:1;transform:none}}\n[data-cc=\"btn\"]{transition:transform .12s ease,box-shadow .2s ease,filter .2s ease;cursor:pointer}\n[data-cc=\"btn\"]:hover{filter:brightness(1.08)}\n[data-cc=\"btnp\"]{transition:transform .12s ease,box-shadow .2s ease;cursor:pointer;box-shadow:0 0 0 1px rgba(207,164,95,.9),0 8px 30px rgba(207,164,95,.35)}\n[data-cc=\"btnp\"]:hover{box-shadow:0 0 0 1px #CFA45F,0 8px 44px rgba(207,164,95,.6)}\n[data-cc=\"card\"]{background:linear-gradient(135deg,rgba(255,255,255,.07),rgba(255,255,255,.02));backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px)}\n[data-cc=\"sheen\"]{position:absolute;top:0;bottom:0;width:40%;left:-60%;background:linear-gradient(100deg,transparent,rgba(255,255,255,.10),transparent);animation:cc-sheen 3.8s ease-in-out 1s infinite}\n@keyframes cc-sheen{0%{left:-60%}35%,100%{left:130%}}\n[data-cc=\"scan\"]{position:absolute;left:0;right:0;height:4px;background:linear-gradient(90deg,transparent,#CFA45F,#fff,#CFA45F,transparent);box-shadow:0 0 18px 4px rgba(207,164,95,.75);animation:cc-scan .9s ease-in-out infinite alternate}\n@keyframes cc-scan{from{top:2%}to{top:96%}}\n[data-cc=\"grid\"]{position:absolute;top:0;left:0;right:0;bottom:0;background-image:linear-gradient(rgba(207,164,95,.18) 1px,transparent 1px),linear-gradient(90deg,rgba(207,164,95,.18) 1px,transparent 1px);background-size:22px 22px}\n[data-cc=\"blink\"]{animation:cc-blink 1s steps(2,start) infinite}\n@keyframes cc-blink{to{visibility:hidden}}\nhtml.cc-welcome #cc-install-hint{display:none !important}\n@media (prefers-reduced-motion: reduce){[data-cc]{animation:none !important;transition:none !important}}\n",R=e=>({dataSet:{cc:e}}),O='undefined'!=typeof document,P=()=>O&&'function'==typeof window.matchMedia&&window.matchMedia('(prefers-reduced-motion: reduce)').matches,E=()=>{try{O&&navigator.vibrate?.(12)}catch{}};function z({label:e,onPress:t,kind:n="primary",testID:r,disabled:s}){const o='primary'===n;return(0,C.jsx)(l.default,{testID:r,accessibilityRole:"button",accessibilityLabel:e,disabled:s,onPress:()=>{E(),t()},...R(o&&!s?'btnp':'btn'),style:({pressed:e})=>[{alignSelf:'stretch',minHeight:56,borderRadius:28,alignItems:'center',justifyContent:'center',paddingHorizontal:20,backgroundColor:o?A:'rgba(255,255,255,0.04)',borderWidth:o?0:1.5,borderColor:A,opacity:s?.45:1,transform:[{scale:e?.96:1}]}],children:(0,C.jsx)(T.T,{size:18,weight:"semibold",colour:o?'#0B0B0B':A,center:!0,children:e})})}const D=({children:e,colour:t=A})=>(0,C.jsx)(T.T,{size:14,weight:"semibold",colour:t,style:{letterSpacing:2.2},children:e}),L={Owner:['Takings, sales, labour cost and payroll','Bookings (Tables and Covers), orders, the rota and team chat','Every setting, plus the Assistant for quick answers'],Manager:['Run service: orders, bookings (Tables and Covers) and the waitlist','The rota, timesheets and team pay rates','Your own clock-in and pay in the Staff app'],Supervisor:['Run service: orders, bookings (Tables and Covers) and the waitlist','The rota, timesheets and team pay rates','Your own clock-in and pay in the Staff app'],'Head Chef':['Stock, costings, prep, ordering and the specials board','Food safety checks, allergens and live tickets','Your own clock-in, rota and pay in the Staff app'],Staff:['Clock in and out, see your rota, swap shifts, ask for time off','Team chat, food safety checks and the accident book','Your own hours, pay and tips (only yours)']};function U(){const e=O?navigator.userAgent:'';return/iPhone|iPad|iPod/.test(e)?'In Safari, tap Share (the square with an arrow), then Add to Home Screen.':/SamsungBrowser/.test(e)?'Tap the menu, then Add page to, then Home screen.':'In Chrome, tap \u22ee then Add to Home screen (or Install app).'}const N=({k:e,v:t})=>(0,C.jsxs)(h.default,{style:{flexDirection:'row',gap:12,alignItems:'baseline'},children:[(0,C.jsx)(T.T,{size:14,weight:"semibold",colour:w.colours.muted,numberOfLines:1,style:{width:74,letterSpacing:1.2},children:e}),(0,C.jsx)(T.T,{size:18,weight:"semibold",style:{flex:1},children:t})]});function W({p:e,onClose:s}){const[u,x]=(0,r.useState)('choose'),[b,y]=(0,r.useState)(null),[v,j]=(0,r.useState)(null),[I,O]=(0,r.useState)(!1),[L,U]=(0,r.useState)(''),N=(0,r.useRef)(null);(0,r.useEffect)(()=>()=>{N.current&&URL.revokeObjectURL(N.current)},[]);const W=async e=>{U('');const t=await(0,k.pickPhoto)(e);if(!t)return;N.current&&URL.revokeObjectURL(N.current);const n=URL.createObjectURL(t);N.current=n,y(n),O(!1),x('scan');const r=Date.now();try{const e=await(0,k.styliseOnDevice)(t),n=P()?0:Math.max(0,1300-(Date.now()-r));setTimeout(()=>{j(e),x('reveal'),E()},n)}catch{U("That photo couldn't be opened. Try another one (JPEG or PNG)."),x('choose')}},_=({children:e})=>(0,C.jsx)(h.default,{style:{width:236,height:236,borderRadius:118,overflow:'hidden',borderWidth:2,borderColor:A,alignItems:'center',justifyContent:'center',backgroundColor:(0,n.soutersSurface)('#050505')},children:e});return(0,C.jsxs)(c.default,{testID:"invite-avatar-step",contentContainerStyle:{padding:22,paddingTop:34,gap:18,alignItems:'center',maxWidth:520,width:'100%',alignSelf:'center',paddingBottom:56},children:[(0,C.jsx)(D,{children:"MAKE YOUR AVATAR"}),(0,C.jsx)(T.T,{size:28,weight:"bold",center:!0,children:'choose'===u?'Choose your look':'scan'===u?'Scanning\u2026':`Looking good, ${e.name}`}),'choose'===u?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(h.default,{...R('reveal'),children:(0,C.jsx)(h.default,{...R('halo'),children:(0,C.jsxs)(_,{children:[(0,C.jsx)(h.default,{style:{opacity:.55},children:(0,C.jsx)(S.StaffAvatar,{id:e.id,size:200,ring:!1})}),(0,C.jsx)(h.default,{...R('grid'),pointerEvents:"none"})]})})}),(0,C.jsxs)(T.T,{size:16,center:!0,colour:w.colours.muted,children:["Take a selfie or pick a photo. ",p.IS_OWNER_DESKTOP?'This computer turns it into a space-age avatar. The photo never leaves this computer and isn\u2019t kept.':'Your phone turns it into a space-age avatar. The photo never leaves this phone and isn\u2019t kept.']}),(0,C.jsx)(z,{label:"Take a selfie",testID:"avatar-selfie",onPress:()=>W(!0)}),(0,C.jsx)(z,{kind:"ghost",label:"Upload a photo",testID:"avatar-upload",onPress:()=>W(!1)}),(0,C.jsx)(h.default,{style:{width:'100%',minWidth:0},children:(0,C.jsx)(t.AvatarOptions,{onSelect:t=>{f.useAvatars.getState().setOwn(e.id,e.id,t.dataUrl,e.name)?s(!0):U('Could not save your avatar. Try again.')}})})]}):'scan'===u?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(h.default,{...R('halo'),children:(0,C.jsxs)(_,{children:[b?(0,C.jsx)(o.default,{source:{uri:b},style:{width:236,height:236},accessibilityLabel:"Your photo"}):null,(0,C.jsx)(h.default,{...R('grid'),pointerEvents:"none"}),(0,C.jsx)(h.default,{...R('scan'),pointerEvents:"none"})]})}),(0,C.jsx)(D,{colour:w.colours.muted,children:"MAKING YOUR AVATAR ON THIS PHONE"})]}):(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(h.default,{...R('reveal'),children:(0,C.jsx)(h.default,{...R('halo'),children:v?(0,C.jsx)(o.default,{testID:"avatar-result",source:{uri:v},style:{width:220,height:220,borderRadius:110},accessibilityLabel:"Your new avatar"}):null})}),(0,C.jsxs)(l.default,{accessibilityRole:"checkbox",accessibilityState:{checked:I},accessibilityLabel:"I agree to use this avatar",testID:"avatar-consent",onPress:()=>{E(),O(!I)},style:{alignSelf:'stretch',flexDirection:'row',gap:12,alignItems:'flex-start',padding:14,borderRadius:16,borderWidth:1.5,borderColor:I?A:'rgba(255,255,255,0.2)'},children:[(0,C.jsx)(h.default,{style:{width:28,height:28,borderRadius:8,borderWidth:2,borderColor:A,backgroundColor:I?A:'transparent',alignItems:'center',justifyContent:'center'},children:I?(0,C.jsx)(T.T,{size:17,weight:"bold",colour:"#111",children:"\u2713"}):null}),(0,C.jsx)(T.T,{size:15,style:{flex:1},children:"I\u2019m happy for this avatar, made from my photo, to be shown to my team in CoverCharge. Only the finished avatar is shared; my photo isn\u2019t uploaded or kept, and a manager can reset my avatar."})]}),(0,C.jsx)(z,{label:"Use this avatar",testID:"avatar-save",disabled:!I,onPress:()=>{if(!v)return;f.useAvatars.getState().setOwn(e.id,e.id,v,e.name)?(N.current&&URL.revokeObjectURL(N.current),N.current=null,s(!0)):U("Couldn't save the avatar. Please try again.")}}),(0,C.jsx)(z,{kind:"ghost",label:"Try another photo",onPress:()=>{j(null),x('choose')}})]}),L?(0,C.jsx)(T.T,{size:15,colour:w.colours.red,center:!0,children:L}):null,'scan'!==u?(0,C.jsx)(l.default,{testID:"invite-avatar-done",accessibilityRole:"button",onPress:()=>{E(),s(!1)},style:({pressed:e})=>({padding:12,transform:[{scale:e?.96:1}]}),children:(0,C.jsx)(T.T,{size:17,weight:"semibold",colour:w.colours.text,children:"Skip, keep this one"})}):null]})}},1416,[888,813,17,1067,319,219,385,278,24,85,856,885,876,816,946,966,878,776,804,884,777,8]); __d(function(g,_r,_i,_a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.Dashboard=function({go:e,ownerHome:a=!1}){const{rid:n,r:x,now:F,role:le,me:ae,today:ne}=(0,A.useCtx)(5e3),ie=(0,p.useOrders)(n),re=(0,p.useBookings)(n),de=(0,p.useWaitlist)(n),ue=(0,p.useEvents)(n),ge=(0,p.useRatings)(n),ye=(0,j.useOwner)(e=>e.staff),xe=(0,j.useOwner)(e=>(0,j.liveAttendance)(e.attendance)),me=(0,j.useOwner)(e=>e.shifts),be=(0,M.useRealHistory)(n,F),fe=(0,l.useMemo)(()=>(0,s.forecastToday)(x,re,ie,ue,F,be??void 0),[x,re,ie,ue,be,F.getTime()/6e4|0]),pe=(0,S.useExamples)(),je=(0,N.useCashUp)(e=>e.cashUps),ke=re.filter(e=>e.date===ne),we=ie.filter(B.LIVE),$e=de.filter(e=>'waiting'===e.status||'notified'===e.status),ve=(0,C.seatedCoversOn)(re,ne),Ie=(0,se.coversSplit)(ke,ne),Ce=we.filter(e=>(0,_.chainNeedsAction)(e,re)),De=ke.filter(e=>['confirmed','seated'].includes(e.status)&&(0,_.bookingNeedsAction)(e,we)),Te=we.flatMap(e=>(0,v.readinessFor)(e,x,F).map(t=>({...t,order:e}))).filter(e=>'due'===e.state||'overdue'===e.state),Be=fe.nextHour,Ae=(0,B.busyLevel)(Be?.coversHigh??0,fe.busy.busy),Le=(0,B.restOfDayLevel)(fe,x),Me=ie.filter(e=>e.paid>0&&!!e.createdAt&&(0,I.ymd)(new Date(e.createdAt))===ne).reduce((e,t)=>e+t.paid,0),Se=(0,R.tradingDay)(F),Ne=pe?(0,L.revenueHistory)(x,F,7).filter(e=>e.date.getDay()===F.getDay()).pop():void 0,Pe=pe?{today:186e3+Me,last:Ne?{date:(0,I.ymd)(Ne.date),pence:Ne.total}:null,online:0,show:!0}:(0,O.takingsToday)(je,n,Se,Me),Fe=j.CAN.takings(le)&&(!(0,H.isLive)()||(0,H.can)('takings.view')),We=(0,l.useMemo)(()=>(0,L.insights)(x,re,ie,ue,ge,F,ve),[x.id,re.length,ge.length,ve]),He=((0,A.weekday)(F),(0,k.openWorkingRows)(xe,ne)),Re=(0,J.useFrontDoor)(ne),Oe=(0,u.useBookingWrite)(),ze=(0,w.useOutstanding)(),Ee=(0,i.useTravelDay)('owner',ne),Ge=(0,A.useSignedIn)(),Ue=(0,A.useInStaffApp)(),qe=(0,P.canSeeMonthTakings)(le,Ge,{inStaffApp:Ue,live:(0,H.isLive)()}),Ye=(0,W.homeSetupNagsHidden)(n),Ke=(0,j.useOwner)(e=>e.socialPosts.reduce((e,t)=>e+('awaiting approval'===t.status?1:0),0)),[Ve,Qe]=(0,l.useState)(!1),[Xe,Ze]=(0,l.useState)(!1),Je=ae.replace(' (example)',''),et=j.CAN.manage(le)?(0,oe.jsx)(f.Button,{testID:"home-restaurant-dashboard",label:"Restaurant dashboard",accessibilityLabel:"Restaurant dashboard, everything on the Display: any day, table plan, Timeline, guests, Covers and actions",onPress:()=>e('more','serviceboard'),style:{minHeight:56}}):null;return Ee?(0,oe.jsxs)(b.default,{style:{gap:12},children:[et,(0,oe.jsx)(i.DayBar,{app:"owner",today:ne}),(0,oe.jsx)(i.DayView,{rid:n,day:Ee,today:ne,app:"owner"})]}):(0,oe.jsxs)(b.default,{style:{gap:12},testID:a?'owner-home':'managers-home',children:[et,(0,oe.jsx)(i.DayBar,{app:"owner",today:ne}),(0,oe.jsx)(K.WhoBar,{}),Ge&&'owner'!==Ge.role?(0,oe.jsx)(V.MyShiftCard,{go:e}):null,Ge?(0,oe.jsx)(Q.MyTasksToday,{rid:n,staffId:Ge.id,name:Ge.name,onShift:(0,Z.shiftNow)(Ge.id,Date.now()).on}):null,'staff'!==le?(0,oe.jsx)(X.TodaysTipsCard,{rid:n,today:ne}):null,'staff'!==le?(0,oe.jsx)(X.TipsPotCard,{rid:n,today:ne}):null,j.CAN.manage(le)?(0,oe.jsx)(b.default,{testID:"home-business-insights-wrap",style:{alignItems:'center',width:'100%'},children:(0,oe.jsx)(f.Button,{testID:"home-business-insights",label:"Business insights",accessibilityLabel:"Business insights, stats and percentages from your bookings and cash ups",onPress:()=>e('more','bizinsights'),style:{minHeight:56,width:'100%'}})}):null,(0,oe.jsx)(he,{split:Ie}),(0,oe.jsx)(ee.BlocksBanner,{rid:n,now:F,by:ae}),(0,oe.jsx)(y.KitchenSignoffs,{rid:n,today:ne,by:ae,app:"owner",canConfirm:j.CAN.manage(le)}),j.CAN.manage(le)&&!Ye?(0,oe.jsx)(q.SetupCard,{go:e}):null,j.CAN.manage(le)&&!Ye?(0,oe.jsx)(o.SeasonsTodo,{go:e}):null,(0,oe.jsx)(r.LastFoodBanner,{rid:n,now:F}),(0,oe.jsx)(d.NextTableFreeCard,{rid:n,now:F}),j.CAN.manage(le)?(0,oe.jsx)(f.Button,{testID:"home-blocks",label:"Block bookings",accessibilityLabel:"Block bookings: block now, add a block, see future blocks",accessibilityHint:Oe.hint,disabled:!Oe.ok,onPress:()=>e('more','blocks')}):null,(0,oe.jsx)(f.Button,{testID:"home-add-soldout",label:"Add sold out",accessibilityLabel:"Add sold out, mark a dish sold out or put it back on",onPress:()=>Qe(!0),style:{minHeight:56}}),(0,oe.jsxs)(b.default,{testID:"front-door-bar",dataSet:{centre:'buttons'},style:{flexDirection:'row',flexWrap:'wrap',gap:8,justifyContent:'center'},children:[(0,oe.jsx)(c.QuietButton,{label:"New booking",onPress:Re.openBooking,testID:"home-booking",disabled:!Oe.ok,accessibilityHint:Oe.hint}),j.CAN.manage(le)?(0,oe.jsx)(ee.CloseGardenButton,{quiet:!0,short:!0,rid:n,r:x,now:F,by:ae}):null]}),Re.elements,j.CAN.manage(le)?(0,oe.jsx)(Y.PaydaysCard,{go:e}):null,(0,oe.jsx)(E.FadeIn,{children:(0,oe.jsxs)(f.Card,{highlight:T.colours.gold,style:{alignItems:'center'},children:[(0,oe.jsxs)(f.T,{weight:"semibold",colour:T.colours.gold,center:!0,accessibilityRole:"header",children:["Next hour",Be?` \xb7 ${(0,A.fmtH)(Be.hour)}\u2013${(0,A.fmtH)(Be.hour+1)}`:'']}),fe.example?(0,oe.jsx)(M.ExampleBadge,{}):fe.enough?(0,oe.jsx)(f.Badge,{kind:"amber",label:"ESTIMATE"}):(0,oe.jsx)(f.Badge,{kind:"neutral",label:"BOOKED ONLY"}),(0,oe.jsx)(E.Gauge,{pct:Be?Ae.pct:0,label:Be?Ae.label:fe.open?'Kitchen closing':'Closed today',sub:Be&&!fe.enough?`${Be.booked} booked${Be.walkIns?` + ${Be.walkIns} walk-ins seated`:''} \xb7 not enough history for a forecast yet`:Be?`Estimated ${(0,s.coversRange)(Be.coversLow,Be.coversHigh)} \xb7 Busy at ${fe.busy.busy} Covers an hour \xb7 ${Be.booked} booked + about ${Be.walkIns} walk-ins${(0,h.showTakeaway)(x)?` \xb7 about ${Be.takeaway} takeaway`:''}`:'No forecast for the next hour'}),(0,oe.jsxs)(f.Row,{wrap:!0,gap:6,style:{justifyContent:'center'},children:[fe.enough?(0,oe.jsx)(f.Badge,{kind:"gold",label:`Rest of today: ${Le.level.label}${Le.peak?`, peak ${(0,A.fmtH)(Le.peak.hour)}`:''}`}):null,fe.enough?(0,oe.jsx)(f.Badge,{kind:"neutral",label:`${(0,s.coversRange)(fe.restOfDay.low,fe.restOfDay.high)}${(0,h.showTakeaway)(x)?` \xb7 about ${fe.restOfDay.takeaway} takeaways`:''}`}):(0,oe.jsx)(f.Badge,{kind:"neutral",label:`Booked so far: ${fe.restOfDay.booked} Covers`})]}),fe.flags.length?(0,oe.jsxs)(f.Muted,{center:!0,children:["Calendar: ",fe.flags.join(', ')]}):null,j.CAN.forecasts(le)?(0,oe.jsx)(f.Button,{small:!0,kind:"ghost",label:"Open forecasts \u2192",onPress:()=>e('forecast')}):null]})}),(0,oe.jsxs)(f.Row,{wrap:!0,gap:10,children:[(0,h.showTakeaway)(x)||we.length?(0,oe.jsx)(E.FadeIn,{delay:200,style:{flexGrow:1,flexBasis:150},children:(0,oe.jsx)(B.Tile,{label:"Live orders",value:"",accent:we.some(e=>'new'===e.status)?T.colours.red:void 0,onPress:()=>e('orders'),sub:(0,D.orderAtTableOn)(x)?`${we.filter(e=>'takeaway'===e.type).length} takeaway \xb7 ${we.filter(e=>'table'===e.type).length} table`:`${we.filter(e=>'takeaway'===e.type).length} takeaway`,children:(0,oe.jsx)(E.CountUp,{value:we.length})})}):null,$e.length>0?(0,oe.jsx)(E.FadeIn,{delay:260,style:{flexGrow:1,flexBasis:150},children:(0,oe.jsx)(B.Tile,{label:"Waitlist",value:"",onPress:()=>e('bookings','waitlist'),sub:`${$e.reduce((e,t)=>e+t.partySize,0)} Covers waiting`,children:(0,oe.jsx)(E.CountUp,{value:$e.length})})}):null,Fe&&Pe.show?(0,oe.jsx)(E.FadeIn,{delay:320,style:{flexGrow:1,flexBasis:150},children:(0,oe.jsx)(z.TakingsTodayCard,{t:Pe,example:pe,onPress:()=>e('more','analytics')})}):null,(0,oe.jsx)(E.FadeIn,{delay:380,style:{flexGrow:1,flexBasis:150},children:(0,oe.jsx)(B.Tile,{label:"Allergy alerts",value:"",accent:Ce.length+De.length?T.colours.red:T.colours.ok,sub:"Need a sign-off",children:(0,oe.jsx)(E.CountUp,{value:Ce.length+De.length,colour:Ce.length+De.length?T.colours.red:T.colours.ok})})})]}),Ce.length+De.length+Te.length?(0,oe.jsx)(B.SectionHead,{title:"Needs action now"}):null,Ce.map(e=>(0,oe.jsxs)(B.AlertBox,{colour:T.colours.red,title:`ALLERGY \xb7 ${e.ref} ${'table'===e.type?`${(0,t.tableNumbers)(e.tableNo)}`:'takeaway'}`,children:[(0,oe.jsx)(f.T,{size:14,children:e.allergies.map(e=>`${(0,$.allergenLabel)(e.allergen)} (${(0,$.severityLabel)(e.severity)})`).join('; ')}),(0,oe.jsx)(U.AllergyChain,{o:e,me:ae,compact:!0})]},e.id)),De.map(e=>(0,oe.jsxs)(B.AlertBox,{colour:T.colours.red,title:`ALLERGY \xb7 booking ${e.time} ${e.name} (${e.partySize})`,children:[(0,oe.jsx)(f.T,{size:14,children:e.allergies.map(e=>`${(0,$.allergenLabel)(e.allergen)} (${(0,$.severityLabel)(e.severity)})`).join('; ')}),(0,oe.jsx)(U.BookingAllergyChain,{b:e,me:ae})]},e.id)),Te.map(t=>(0,oe.jsxs)(B.AlertBox,{colour:'overdue'===t.state?T.colours.red:T.colours.amber,title:`${'cook'===t.stage?'START COOKING':'bag'===t.stage?'BAG IT':'READY'} \xb7 ${t.order.ref} pickup ${(0,I.hm)(new Date(t.order.slotTime))}${'overdue'===t.state?' \xb7 OVERDUE':''}`,children:[(0,oe.jsx)(f.T,{size:14,children:t.detail}),(0,oe.jsx)(f.Button,{small:!0,kind:"secondary",label:"Open orders",onPress:()=>e('orders')})]},t.id)),j.CAN.manage(le)&&(ze.days.length||ze.requests)?(0,oe.jsxs)(B.AlertBox,{colour:T.colours.amber,title:`HOURS \xb7 ${ze.days.length?`${ze.days.length} earlier day${ze.days.length>1?'s':''} to sign off`:''}${ze.days.length&&ze.requests?' \xb7 ':''}${ze.requests?`${ze.requests} correction request${ze.requests>1?'s':''}`:''}`,children:[(0,oe.jsx)(f.T,{size:14,children:"Hours only count for pay once a manager confirms them."}),(0,oe.jsx)(f.Button,{small:!0,kind:"secondary",label:"Sign off hours",testID:"nudge-signoff",onPress:()=>e('more','signoff')})]}):null,Ke&&j.CAN.publishSocial(le)?(0,oe.jsxs)(B.AlertBox,{colour:T.colours.amber,title:`SOCIAL \xb7 ${Ke} post${Ke>1?'s':''} awaiting approval`,children:[(0,oe.jsx)(f.T,{size:14,children:"Drafted by staff. Review and approve before anything goes out. Posting: not set up yet."}),(0,oe.jsx)(f.Button,{small:!0,kind:"secondary",label:"Review posts",onPress:()=>e('more','social')})]}):null,(0,oe.jsx)(B.SectionHead,{title:"Quick actions"}),(0,oe.jsxs)(m.default,{accessibilityRole:"button",accessibilityLabel:"Post to social",onPress:()=>e('more','social'),style:({pressed:e})=>({borderRadius:16,borderWidth:1.5,borderColor:T.colours.gold,backgroundColor:e?T.colours.goldTint:T.colours.surface,padding:12,flexDirection:'row',alignItems:'center',gap:10}),children:[(0,oe.jsxs)(f.Row,{gap:4,children:[(0,oe.jsx)(G.Mark,{p:"facebook"}),(0,oe.jsx)(G.Mark,{p:"instagram"}),(0,oe.jsx)(G.Mark,{p:"tiktok"}),(0,oe.jsx)(G.Mark,{p:"youtube"})]}),(0,oe.jsxs)(b.default,{style:{flex:1},children:[(0,oe.jsx)(f.T,{weight:"bold",children:"Post to social"}),(0,oe.jsx)(f.Muted,{children:"Facebook + Instagram, TikTok + YouTube: not set up yet"})]}),(0,oe.jsx)(f.T,{colour:T.colours.gold,size:20,children:"\u203a"})]}),(0,oe.jsx)(G.QuickLinksSection,{go:e,heading:e=>(0,oe.jsx)(B.SectionHead,{title:e})}),(0,oe.jsx)(B.SectionHead,{title:"Who\u2019s on now",right:(0,oe.jsx)(f.Badge,{kind:"ok",label:`${He.length} clocked in`})}),(0,oe.jsxs)(f.Card,{children:[0===He.length?(0,oe.jsx)(f.Muted,{children:"Nobody clocked in yet."}):null,He.map(e=>{const t=ye.find(t=>t.id===e.staffId),s=(0,j.shiftOf)(me,e.staffId,ne),o=new Date(e.in),l=!!s&&o.getHours()+o.getMinutes()/60-s.start>.08333333333333333;return(0,oe.jsxs)(f.Row,{style:{justifyContent:'space-between'},children:[(0,oe.jsxs)(b.default,{style:{flex:1},children:[(0,oe.jsx)(f.T,{weight:"semibold",children:t?.name??e.staffId}),(0,oe.jsxs)(f.Muted,{children:[t?.job," \xb7 in ",(0,I.hm)(o),s?` \xb7 shift ${(0,A.fmtH)(s.start)}\u2013${(0,A.fmtH)(s.end)}`:' \xb7 unscheduled']})]}),l?(0,oe.jsx)(f.Badge,{kind:"amber",label:"Late"}):(0,oe.jsx)(f.Badge,{kind:"ok",label:"On site"})]},e.id)}),j.CAN.manage(le)?(0,oe.jsx)(f.Button,{small:!0,kind:"ghost",label:"Rota & timesheets \u2192",onPress:()=>e('more','rota')}):(0,oe.jsx)(f.Button,{small:!0,kind:"secondary",label:"Clock in / out",onPress:()=>e('more','clock')})]}),'staff'!==le?(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(B.SectionHead,{title:"Insights",sub:pe?'AI-style suggestions from your bookings, orders, stock and calendar (example figures)':'From your own bookings, reviews and calendar'}),We.slice(0,4).map((t,s)=>(0,oe.jsx)(E.FadeIn,{delay:100+90*s,children:(0,oe.jsxs)(f.Card,{style:{borderLeftWidth:4,borderLeftColor:{gold:T.colours.gold,red:T.colours.red,amber:T.colours.amber,ok:T.colours.ok,blue:T.colours.blue}[t.tone]},children:[(0,oe.jsxs)(f.T,{weight:"semibold",children:[t.icon," ",t.title]}),(0,oe.jsx)(f.Muted,{children:t.body}),t.action?(0,oe.jsx)(f.Button,{small:!0,kind:"ghost",label:`${t.action.label} \u2192`,onPress:()=>e(t.action.tab,t.action.sub??null),style:{alignSelf:'flex-start'}}):null]})},t.id)),(0,oe.jsx)(f.Button,{small:!0,kind:"secondary",label:"All insights",onPress:()=>e('more','insights')})]}):null,qe?(0,oe.jsx)(f.Button,{testID:"home-takings-button",kind:Xe?'secondary':'primary',label:Xe?'Hide takings':'Takings',accessibilityLabel:Xe?'Hide takings':'Takings: this month by day, from confirmed cash ups',onPress:()=>Ze(e=>!e),style:{minHeight:56}}):null,qe&&Xe?(0,oe.jsx)(E.FadeIn,{children:(0,oe.jsx)(ce,{rid:n,today:ne})}):null,(0,oe.jsx)(te.SoldOutSheet,{visible:Ve,onClose:()=>Qe(!1),rid:n,by:Je,hideLinks:!0,testID:"home-soldout-sheet"})]})},_e.monthAxisDays=de,_e.MonthTakingsCard=ce,_e.WalkInSplitCard=he;var t=_r(_d[0]),s=_r(_d[1]),o=_r(_d[2]),l=_r(_d[3]),a=_r(_d[4]),n=e(a),i=_r(_d[5]),r=_r(_d[6]),d=_r(_d[7]),c=_r(_d[8]),u=_r(_d[9]),h=_r(_d[10]),y=_r(_d[11]),x=e(_r(_d[12])),m=e(_r(_d[13])),b=e(_r(_d[14])),f=_r(_d[15]),p=_r(_d[16]),j=_r(_d[17]),k=_r(_d[18]),w=_r(_d[19]),$=_r(_d[20]),v=_r(_d[21]),I=_r(_d[22]),C=_r(_d[23]),D=_r(_d[24]),T=_r(_d[25]),B=_r(_d[26]),A=_r(_d[27]),L=_r(_d[28]),M=_r(_d[29]),S=_r(_d[30]),N=_r(_d[31]),P=_r(_d[32]),F=_r(_d[33]),W=_r(_d[34]),H=_r(_d[35]),R=_r(_d[36]),O=_r(_d[37]),z=_r(_d[38]),E=_r(_d[39]),G=_r(_d[40]),U=_r(_d[41]),_=_r(_d[42]),q=_r(_d[43]),Y=_r(_d[44]),K=_r(_d[45]),V=_r(_d[46]),Q=_r(_d[47]),X=_r(_d[48]),Z=_r(_d[49]),J=_r(_d[50]),ee=_r(_d[51]),te=_r(_d[52]),se=_r(_d[53]),oe=_r(_d[54]);const le=18,ae=18,ne=150,ie=34;function re(e){if(!e.length)return'';if(1===e.length)return`M${e[0].x.toFixed(1)},${e[0].y.toFixed(1)}`;const t=e.length,s=[],o=[];for(let o=0;o9){const n=3/Math.sqrt(a);o[e]=n*t*s[e],o[e+1]=n*l*s[e]}}let l=`M${e[0].x.toFixed(1)},${e[0].y.toFixed(1)}`;for(let s=0;sle+(t-1)/Math.max(1,e-1)*s,l=[1,5,10,15,20,25].filter(t=>t=36)&&a.push(e);for(;a.length&&o(e)-o(a[a.length-1])<36;)a.pop();return[...a,e]}function ce({rid:e,today:t}){const s=(0,N.useCashUp)(e=>e.cashUps),[o,i]=(0,l.useState)(t.slice(0,7)),[r,d]=(0,l.useState)(0),[c,u]=(0,l.useState)(null),h=(0,l.useMemo)(()=>(0,P.monthTakings)(s,e,o,t),[s,e,o,t]),y=(0,l.useMemo)(()=>(0,P.firstTakingsMonth)(s,e),[s,e]),p=!!y&&yle+(e-1)/Math.max(1,k-1)*w,C=e=>$-e/v*128,D=[];h.days.forEach((e,t)=>{if('recorded'!==e.state)return;const s={x:I(e.day),y:C(e.value)};t&&'recorded'===h.days[t-1].state?D[D.length-1].push(s):D.push([s])});const B=h.days.filter(e=>'future'!==e.state),A=[...h.days].reverse().find(e=>'recorded'===e.state),L=h.days.find(e=>e.date===c&&'future'!==e.state)??(h.current?h.days.find(e=>e.date===t):void 0)??A??B[B.length-1],M=e=>{const t=B.findIndex(e=>e.date===L?.date),s=B[Math.max(0,Math.min(B.length-1,t+e))];s&&(u(s.date),x.default.announceForAccessibility?.(S(s)))},S=e=>`${(0,P.longDay)(e.date)}, ${'recorded'===e.state?(0,P.poundsWhole)(e.value):'pending'===e.state?'not cashed up yet':'no cash up'}`,W=h.current?`so far in ${h.month}`:`in ${h.month} ${o.slice(0,4)}`,H=null==h.vsPct?null:`vs ${h.current?'same point last month':(0,P.monthName)((0,P.addMonths)(o,-1))} ${h.vsPct>0?'+':''}${h.vsPct}%`,R=h.recorded?`Takings ${h.current?'this month':`${h.month} ${o.slice(0,4)}`}. ${(0,P.poundsWhole)(h.total)} ${W}, from ${h.recorded} cash up${1===h.recorded?'':'s'}. Best day ${(0,P.longDay)(h.best.date)}, ${(0,P.poundsWhole)(h.best.value)}.${H?` ${H.replace('+','up ').replace(/ -(\d)/,' down $1')}.`:''}`:`Takings ${h.current?'this month':`${h.month} ${o.slice(0,4)}`}. No cash-ups yet${h.current?' this month':''}.`,O=r?de(k,r):[],z=(e,t,s,l,a)=>(0,oe.jsx)(m.default,{testID:a,accessibilityRole:"button",accessibilityLabel:t,accessibilityState:{disabled:!s},disabled:!s,onPress:()=>{i((0,P.addMonths)(o,l)),u(null)},style:({pressed:e})=>({minWidth:48,minHeight:48,alignItems:'center',justifyContent:'center',borderRadius:24,opacity:s?e?.6:1:.25}),children:(0,oe.jsx)(f.T,{size:24,colour:T.colours.gold,center:!0,children:e})});return(0,oe.jsx)(f.Card,{highlight:T.colours.gold,style:{alignItems:'center',gap:6},children:(0,oe.jsxs)(b.default,{testID:"home-month-takings",style:{width:'100%',alignItems:'center',gap:6,minWidth:0},children:[(0,oe.jsxs)(f.T,{weight:"semibold",colour:T.colours.gold,center:!0,accessibilityRole:"header",children:["Takings ",h.current?'this month':'by month']}),p||j?(0,oe.jsxs)(b.default,{style:{flexDirection:'row',alignItems:'center',justifyContent:'center',gap:4,width:'100%'},children:[z('\u2039',`Previous month, ${(0,P.monthName)((0,P.addMonths)(o,-1))}`,p,-1,'mt-prev'),(0,oe.jsxs)(f.T,{center:!0,colour:T.colours.goldLight,style:{flexShrink:1},testID:"mt-month",children:[h.month," ",o.slice(0,4)]}),z('\u203a',`Next month, ${(0,P.monthName)((0,P.addMonths)(o,1))}`,j,1,'mt-next')]}):null,(0,oe.jsx)(b.default,{accessible:!0,accessibilityLabel:R,testID:"mt-summary",style:{alignItems:'center',width:'100%',gap:2},children:h.recorded?(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(f.T,{size:38,weight:"bold",colour:T.colours.gold,center:!0,testID:"mt-total",children:(0,P.poundsWhole)(h.total)}),(0,oe.jsx)(f.T,{center:!0,colour:T.colours.goldLight,children:W}),(0,oe.jsxs)(f.Muted,{center:!0,testID:"mt-best",children:["Best day: ",(0,P.shortDay)(h.best.date)," \xb7 ",(0,P.poundsWhole)(h.best.value)]}),H?(0,oe.jsx)(f.Muted,{center:!0,testID:"mt-vs",children:H}):null]}):(0,oe.jsx)(f.Muted,{center:!0,testID:"mt-empty",children:h.current?'No cash-ups yet this month.':`No cash-ups in ${h.month}.`})}),(0,oe.jsxs)(b.default,{style:{width:'100%',minWidth:0},children:[(0,oe.jsxs)(b.default,{testID:"mt-plot",onLayout:e=>d(e.nativeEvent.layout.width),style:{height:ne,width:'100%',overflow:'visible'},children:[r?(0,oe.jsxs)(n.default,{width:r,height:ne,accessibilityElementsHidden:!0,importantForAccessibility:"no-hide-descendants",children:[(0,oe.jsx)(a.Defs,{children:(0,oe.jsxs)(a.LinearGradient,{id:"mtFill",x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,oe.jsx)(a.Stop,{offset:"0",stopColor:"#3A2F1E",stopOpacity:1}),(0,oe.jsx)(a.Stop,{offset:"1",stopColor:"#3A2F1E",stopOpacity:.35})]})}),(0,oe.jsx)(a.Line,{x1:le,y1:$,x2:r-ae,y2:$,stroke:T.colours.hairline,strokeWidth:1}),D.filter(e=>e.length>1).map((e,t)=>(0,oe.jsx)(a.Path,{d:`${re(e)} L${e[e.length-1].x.toFixed(1)},142 L${e[0].x.toFixed(1)},142 Z`,fill:"url(#mtFill)",stroke:"none"},`a${t}`)),D.filter(e=>e.length>1).map((e,t)=>(0,oe.jsx)(a.Path,{d:re(e),stroke:T.colours.gold,strokeWidth:2.5,fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},`l${t}`)),D.filter(e=>1===e.length).map((e,t)=>(0,oe.jsx)(a.Circle,{cx:e[0].x,cy:e[0].y,r:3,fill:T.colours.gold},`s${t}`)),h.days.filter(e=>'missing'===e.state).map(e=>(0,oe.jsx)(a.Circle,{cx:I(e.day),cy:$,r:2,fill:"none",stroke:T.colours.muted,strokeWidth:1},e.date)),L&&'recorded'===L.state?(0,oe.jsx)(a.Line,{x1:I(L.day),y1:10,x2:I(L.day),y2:$,stroke:T.colours.goldMuted,strokeWidth:1,strokeDasharray:"3,3"}):null,h.current?(()=>{const e=h.days.find(e=>e.date===t);return(0,oe.jsx)(a.Circle,{cx:I(e.day),cy:'recorded'===e.state?C(e.value):$,r:4.5,fill:T.colours.gold,stroke:T.colours.surface,strokeWidth:1.5})})():null,L&&'recorded'===L.state&&L.date!==t?(0,oe.jsx)(a.Circle,{cx:I(L.day),cy:C(L.value),r:5,fill:T.colours.surface,stroke:T.colours.gold,strokeWidth:2}):null]}):null,r?B.map(e=>(0,oe.jsx)(m.default,{testID:`mt-day-${e.day}`,accessibilityRole:"button",accessibilityLabel:S(e),accessibilityState:{selected:L?.date===e.date},onPress:()=>u(e.date),style:{position:'absolute',top:0,height:ne,left:I(e.day)-w/Math.max(1,k-1)/2,width:w/Math.max(1,k-1)}},e.date)):null]}),(0,oe.jsx)(b.default,{testID:"mt-axis",style:{height:F.AXIS_BAND+6,minHeight:F.AXIS_BAND+6,width:'100%',position:'relative',overflow:'visible'},accessibilityElementsHidden:!0,importantForAccessibility:"no-hide-descendants",children:O.map(e=>(0,oe.jsx)(f.T,{size:F.AXIS_FONT,colour:T.colours.muted,style:{position:'absolute',left:I(e)-17,width:ie,top:0,textAlign:'center'},children:String(e)},e))})]}),L&&B.length?(0,oe.jsxs)(b.default,{style:{flexDirection:'row',alignItems:'center',justifyContent:'center',width:'100%',gap:4},children:[(0,oe.jsx)(m.default,{testID:"mt-day-prev",accessibilityRole:"button",accessibilityLabel:"Previous day",disabled:B[0]?.date===L.date,onPress:()=>M(-1),style:({pressed:e})=>({minWidth:48,minHeight:48,alignItems:'center',justifyContent:'center',opacity:B[0]?.date===L.date?.25:e?.6:1}),children:(0,oe.jsx)(f.T,{size:20,colour:T.colours.gold,center:!0,children:"\u2039"})}),(0,oe.jsxs)(b.default,{testID:"mt-readout",accessible:!0,accessibilityLiveRegion:"polite",accessibilityLabel:S(L),style:{flexShrink:1,minWidth:0,alignItems:'center',paddingVertical:4},children:[(0,oe.jsx)(f.Muted,{center:!0,children:L.date===t?`Today \xb7 ${(0,P.shortDay)(L.date)}`:(0,P.shortDay)(L.date)}),(0,oe.jsx)(f.T,{center:!0,size:20,weight:"semibold",colour:'recorded'===L.state?T.colours.goldLight:T.colours.muted,children:'recorded'===L.state?(0,P.poundsWhole)(L.value):'pending'===L.state?'Not cashed up yet':'No cash-up'})]}),(0,oe.jsx)(m.default,{testID:"mt-day-next",accessibilityRole:"button",accessibilityLabel:"Next day",disabled:B[B.length-1]?.date===L.date,onPress:()=>M(1),style:({pressed:e})=>({minWidth:48,minHeight:48,alignItems:'center',justifyContent:'center',opacity:B[B.length-1]?.date===L.date?.25:e?.6:1}),children:(0,oe.jsx)(f.T,{size:20,colour:T.colours.gold,center:!0,children:"\u203a"})})]}):null,(0,oe.jsx)(f.Muted,{center:!0,size:13,children:"From confirmed cash ups: gross takings, or card + cash. \u25cb = no cash up that day."})]})})}const ue='#3A2F1E';function he({split:e}){return(0,oe.jsx)(f.Card,{style:{alignItems:'center',gap:8},children:(0,oe.jsxs)(b.default,{testID:"home-covers-split",accessible:!0,accessibilityLabel:`Walk-ins and bookings today. ${e.a11y}`,style:{width:'100%',alignItems:'center',gap:8},children:[(0,oe.jsx)(f.T,{weight:"semibold",colour:T.colours.gold,center:!0,children:"Walk-ins and bookings today"}),e.empty?(0,oe.jsx)(f.Muted,{center:!0,children:"No Covers yet"}):(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsxs)(b.default,{style:{flexDirection:'row',flexWrap:'wrap',justifyContent:'center',gap:18,width:'100%'},children:[(0,oe.jsxs)(b.default,{style:{alignItems:'center',minWidth:120},children:[(0,oe.jsx)(f.T,{size:26,weight:"bold",colour:T.colours.gold,center:!0,testID:"split-walkin-pct",children:`${e.walkInPct}%`}),(0,oe.jsx)(f.T,{size:14,colour:T.colours.goldLight,center:!0,children:`Walk-ins \xb7 ${e.walkIns} Covers`})]}),(0,oe.jsxs)(b.default,{style:{alignItems:'center',minWidth:120},children:[(0,oe.jsx)(f.T,{size:26,weight:"bold",center:!0,testID:"split-booked-pct",children:`${e.bookingPct}%`}),(0,oe.jsx)(f.T,{size:14,colour:T.colours.muted,center:!0,children:`Booked \xb7 ${e.bookings} Covers`})]})]}),(0,oe.jsxs)(b.default,{style:{width:'100%',maxWidth:420,height:10,borderRadius:5,overflow:'hidden',flexDirection:'row',backgroundColor:ue,borderWidth:1,borderColor:T.colours.gold},children:[(0,oe.jsx)(b.default,{style:{width:`${e.walkInPct}%`,backgroundColor:T.colours.gold}}),(0,oe.jsx)(b.default,{style:{flex:1,backgroundColor:ue}})]})]})]})})}},1417,[843,1137,1418,17,780,1179,1072,1073,1410,1330,861,1076,264,385,85,777,858,876,1204,1187,845,1154,863,1053,866,804,1178,1055,1136,1141,1142,1006,839,1146,886,946,961,1428,1429,1145,1430,1156,853,1433,1182,1202,1201,1029,1030,1064,1094,1384,1149,1329,8]); -__d(function(_g,_r,_i,_a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.AdvancedSettings=function({go:e}){const{r:x,rid:P,today:O,me:z}=(0,R.useCtx)(6e4),V=z.replace(" (example)",""),J=x.settings,X=e=>v.useStore.getState().updateSettings(P,e),[ee,te]=(0,m.useState)(()=>(0,h.takeAdvancedPrefill)()),[oe,ae]=(0,m.useState)(null),ne=e=>{if(e.onReset)return e.onReset(),void ae(`${e.title}: back to the defaults.`);X(Object.fromEntries(e.reset.map(e=>[e,void 0]))),ae(`${e.title}: back to the defaults.`)},le=(0,M.useBookings)(P),re=(0,W.jsxs)(y.default,{style:{gap:8},children:[(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(j.T,{style:{flex:1},children:"Ask about allergies first (in red)"}),(0,W.jsx)(j.Badge,{kind:"red",label:"ALWAYS ON"})]}),(0,W.jsx)(j.Muted,{size:13,children:"Food safety: every booking answers this before anything else, and staff tick \u201cAllergens seen\u201d."}),(0,W.jsx)(j.Toggle,{label:"Ask if they\u2019re bringing a dog",value:(0,T.dogQuestionOn)(x),onChange:e=>X({dogQuestion:e})}),(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(j.T,{style:{flex:1},children:"Most dogs per booking time"}),(0,W.jsx)(K,{label:"dogs per time",step:1,min:0,max:20,value:J.maxDogsPerSlot??0,unit:e=>e?`${e} dog${1===e?'':'s'}`:'No limit',onChange:e=>X({maxDogsPerSlot:e||void 0})})]}),(0,W.jsx)(j.Toggle,{label:"Ask about wheelchair or step-free access",value:(0,T.accessQuestionOn)(x),onChange:e=>X({accessQuestion:e})}),(0,W.jsx)(j.Toggle,{label:"Vegan and vegetarian ticks (optional for guests)",value:(0,T.dietQuestionOn)(x),onChange:e=>X({dietQuestion:e})}),(0,W.jsx)(j.Toggle,{label:"Let guests ask for a table (shown as \u2018not guaranteed\u2019)",value:!1!==J.tableRequests,onChange:e=>X({tableRequests:e})}),(0,W.jsx)(j.Muted,{size:13,children:"Dog-friendly and step-free tables are marked on the table plan."}),e?(0,W.jsx)(j.Button,{small:!0,kind:"ghost",label:"Mark tables on the Table plan \u203a",onPress:()=>e('more','tableplan')}):null]}),ie=(0,T.dwellBands)(x),de=(e,s)=>X({dwellBands:ie.map((t,o)=>o===e?{...t,mins:s}:t)}),he=(0,W.jsxs)(y.default,{style:{gap:8},children:[(0,W.jsx)(j.Muted,{size:13,children:"How long a table usually stays, by party size. Used for \u201cNext table free\u201d and for spacing bookings on a table."}),ie.map((e,s)=>{const t=(0,T.dwellFor)(x,9999===e.upTo?20:e.upTo,le);return(0,W.jsxs)(y.default,{style:{gap:2},children:[(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(j.T,{style:{flex:1},children:(0,T.bandLabel)(ie,s)}),(0,W.jsx)(K,{label:`table time for ${(0,T.bandLabel)(ie,s)}`,min:30,max:360,value:e.mins,unit:Q,onChange:e=>de(s,e)})]}),t.learned&&t.mins!==e.mins?(0,W.jsxs)(j.Muted,{size:12,children:["From your last ",t.samples," tables: about ",Q(t.mins)," (used for estimates)"]}):null]},s)}),(0,W.jsx)(j.Toggle,{label:"Fine-tune from how long tables really stay",value:!1!==J.dwellLearn,onChange:e=>X({dwellLearn:e})}),(0,W.jsx)(j.Muted,{size:13,children:"Defaults: 90 min for 1\u20132 Covers, 105 min for 3\u20135, 2 hours for 6\u201319, 3 hours for 20 or more."})]}),ue=J.reservables??(0,S.reservablesOf)(x),ce=J.reservables??('anchorage'===P?ue:[]),pe=(e,s)=>X({reservables:ce.map(t=>t.id===e?{...t,...s}:t)}),ge=(0,W.jsxs)(y.default,{style:{gap:8},children:[ce.length?ce.map(e=>(0,W.jsxs)(y.default,{style:{gap:4},children:[(0,W.jsx)(j.Toggle,{label:`${e.name} can be reserved`,value:e.active,onChange:s=>pe(e.id,{active:s})}),(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(j.Muted,{children:"Price"}),(0,W.jsx)(K,{label:`${e.name} price`,min:5,max:1e3,value:Math.round(e.price/100),unit:e=>`\xa3${e}`,onChange:s=>pe(e.id,{price:100*s})})]}),(0,W.jsxs)(j.Muted,{size:12,children:["Uses: ",e.uses.map(e=>`${e.qty} ${e.key}`).join(' + ')," from the counted stock. Held from the Display count and shown as \u201cReserved\u201d."]})]},e.id)):(0,W.jsx)(j.Muted,{children:"No reservable dishes yet."}),(0,W.jsx)(j.Toggle,{label:"Guests can reserve a crab or lobster on its own",value:!1!==J.reserveStock,onChange:e=>X({reserveStock:e})}),(0,W.jsx)(j.Muted,{size:13,children:"The kitchen is told about each reservation and the Head Chef taps OK."})]}),be=(0,T.regularEventsOf)(x),[me,xe]=(0,m.useState)(null),fe=e=>X({regularEvents:e}),ye=me?me.name.trim()?me.time&&!H.test(me.time)?'Start time looks wrong (use 20:00).':me.lastFood&&!H.test(me.lastFood)?'Last food orders looks wrong (use 19:00).':'once'!==me.rule.kind||_.test(me.rule.date)?'':'Date looks wrong (use 2026-12-31).':'Give it a name.':'',je=(0,W.jsxs)(y.default,{style:{gap:8},children:[be.map(e=>(0,W.jsxs)(j.Card,{children:[(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(j.T,{weight:"semibold",style:{flex:1},children:e.name}),e.busier?(0,W.jsx)(j.Badge,{kind:"gold",label:"BUSIER"}):null,e.active?null:(0,W.jsx)(j.Badge,{kind:"neutral",label:"OFF"})]}),(0,W.jsxs)(j.Muted,{children:[(0,T.ruleText)(e.rule),e.time?` \xb7 from ${e.time}`:'',e.lastFood?` \xb7 last food orders ${e.lastFood}`:'']}),e.active?(0,W.jsxs)(j.Muted,{size:12,children:["Next: ",(0,T.nextOccurrence)(e,O)??'\u2014']}):null,(0,W.jsxs)(j.Row,{gap:6,children:[(0,W.jsx)(j.Button,{small:!0,kind:"secondary",label:"Edit",testID:`event-edit-${e.id}`,onPress:()=>xe({...e})}),(0,W.jsx)(j.Button,{small:!0,kind:"ghost",label:"Remove",onPress:()=>fe(be.filter(s=>s.id!==e.id))})]})]},e.id)),me?(0,W.jsxs)(j.Card,{highlight:D.colours.gold,children:[(0,W.jsxs)(j.Row,{gap:8,style:{flexWrap:'wrap'},children:[(0,W.jsx)(j.Muted,{children:"Name"}),(0,W.jsx)(q,{label:"Event name",width:220,value:me.name,onChange:e=>xe({...me,name:e}),placeholder:"Open Mic Night"})]}),(0,W.jsx)(j.Muted,{children:"Repeats"}),(0,W.jsxs)(j.Row,{wrap:!0,gap:6,children:[(0,W.jsx)(j.Chip,{label:"Last \u2026 of the month",selected:'last'===me.rule.kind,onPress:()=>xe({...me,rule:{kind:'last',weekday:'weekday'in me.rule?me.rule.weekday:0}})}),(0,W.jsx)(j.Chip,{label:"Every week",selected:'weekly'===me.rule.kind,onPress:()=>xe({...me,rule:{kind:'weekly',weekday:'weekday'in me.rule?me.rule.weekday:0}})}),(0,W.jsx)(j.Chip,{label:"One-off date",selected:'once'===me.rule.kind,onPress:()=>xe({...me,rule:{kind:'once',date:O}})})]}),'weekday'in me.rule?(0,W.jsx)(j.Row,{wrap:!0,gap:6,children:Y.map(e=>(0,W.jsx)(j.Chip,{label:G[e],selected:me.rule.weekday===e,onPress:()=>xe({...me,rule:{...me.rule,weekday:e}})},e))}):(0,W.jsxs)(j.Row,{gap:8,children:[(0,W.jsx)(j.Muted,{children:"Date (DD/MM/YYYY)"}),(0,W.jsx)(q,{label:"Event date",width:130,value:(0,t.slashDay)(me.rule.date),onChange:e=>{const s=(0,t.slashDate)(e,(0,t.slashDay)(me.rule.date));xe({...me,rule:{kind:'once',date:(0,t.dayFromSlash)(s)??s}})},placeholder:"31/12/2026"})]}),(0,W.jsxs)(j.Row,{gap:8,style:{flexWrap:'wrap'},children:[(0,W.jsx)(j.Muted,{children:"Starts (optional)"}),(0,W.jsx)(q,{label:"Start time",value:me.time??'',onChange:e=>xe({...me,time:e||void 0}),placeholder:"20:00",bad:!!me.time&&!H.test(me.time)})]}),(0,W.jsxs)(j.Row,{gap:8,style:{flexWrap:'wrap'},children:[(0,W.jsx)(j.Muted,{children:"Last food orders (optional)"}),(0,W.jsx)(q,{label:"Last food orders",value:me.lastFood??'',onChange:e=>xe({...me,lastFood:e||void 0}),placeholder:"19:00",bad:!!me.lastFood&&!H.test(me.lastFood)})]}),(0,W.jsxs)(j.Row,{gap:8,style:{flexWrap:'wrap'},children:[(0,W.jsx)(j.Muted,{children:"Notes"}),(0,W.jsx)(q,{label:"Notes",width:240,value:me.notes??'',onChange:e=>xe({...me,notes:e||void 0}),placeholder:"Live music from 8pm"})]}),(0,W.jsx)(j.Toggle,{label:"Expect busier (raises the forecast)",value:me.busier,onChange:e=>xe({...me,busier:e})}),(0,W.jsx)(j.Toggle,{label:"On",value:me.active,onChange:e=>xe({...me,active:e})}),ye?(0,W.jsx)(j.T,{size:13,colour:D.colours.red,children:ye}):null,(0,W.jsxs)(j.Row,{gap:6,children:[(0,W.jsx)(j.Button,{small:!0,label:"Save event",disabled:!!ye,testID:"event-save",onPress:()=>{const e={...me,name:me.name.trim()};fe(be.some(s=>s.id===e.id)?be.map(s=>s.id===e.id?e:s):[...be,e]),xe(null),ae(`Saved ${e.name}.`)}}),(0,W.jsx)(j.Button,{small:!0,kind:"ghost",label:"Cancel",onPress:()=>xe(null)})]})]}):(0,W.jsx)(j.Button,{small:!0,kind:"secondary",label:"\uff0b Add a regular event",testID:"event-add",onPress:()=>xe({id:`ev-${Date.now().toString(36)}`,name:'',rule:{kind:'last',weekday:0},busier:!0,active:!0})}),(0,W.jsx)(j.Muted,{size:13,children:"Events show in Forecast key dates (with a Promote button), on the Today date bar, and lift the forecast when \u201cExpect busier\u201d is on."})]}),we=(0,C.hourSetsOf)(x),ke=(0,C.seasonOn)(x,new Date),[ve,Ce]=(0,m.useState)(null),[Se,Te]=(0,m.useState)(null),De=J.hourOverrides??[],Re=ve?ve.start&&!U.test(ve.start)?'Start date looks wrong (use day and month as MM-DD, e.g. 04-01 for 1 April).':ve.hours&&Object.values(ve.hours).some(e=>e&&(!H.test(e[0])||!H.test(e[1])||e[0]>=e[1]))?'Check the times: use 12:00 and 19:00, and closing must be after opening.':'':'',Me=Object.values(J.lastFoodByDay??{}).some(e=>e&&!H.test(e)),Le=[];we.some(e=>!e.hours)&&Le.push(`${we.filter(e=>!e.hours).map(e=>e.name).join(' and ')} kitchen hours`);we.filter(e=>e.hours).length>=1&&we.length>1&&we.some(e=>!e.start)&&Le.push('the date each season starts');const Pe=(0,W.jsxs)(y.default,{style:{gap:8},children:[(0,W.jsx)(j.Muted,{size:13,children:"Kitchen (food) hours, not bar hours. The closing time is last food orders. Dining bookings are only offered inside these hours."}),Le.length?(0,W.jsxs)(j.Banner,{kind:"warn",title:"To finish setting up",children:["Please add ",Le.join(' and '),". Until then the app uses ",ke?.name??'your weekly'," hours all year."]}):null,ke?(0,W.jsxs)(j.T,{colour:D.colours.goldLight,children:["In use today: ",ke.name]}):null,we.map(e=>(0,W.jsxs)(j.Card,{children:[(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(j.T,{weight:"semibold",children:e.name}),ke?.id===e.id?(0,W.jsx)(j.Badge,{kind:"gold",label:"IN USE"}):e.hours?null:(0,W.jsx)(j.Badge,{kind:"amber",label:"NOT SET"})]}),(0,W.jsx)(j.Muted,{children:e.start?`Starts every year on ${e.start}`:'Start date: not set yet'}),e.hours?(0,W.jsx)(j.Muted,{size:13,children:Y.map(s=>`${G[s]} ${e.hours[s]?`${e.hours[s][0]}\u2013${e.hours[s][1]}`:'closed'}`).join(' \xb7 ')}):(0,W.jsx)(j.Muted,{size:13,children:"No hours yet."}),(0,W.jsx)(j.Button,{small:!0,kind:"secondary",label:e.hours?'Edit':`Set ${e.name} hours`,testID:`season-edit-${e.id}`,onPress:()=>Ce({...e,hours:e.hours?{...e.hours}:{...we.find(e=>e.hours)?.hours??x.kitchenHours}})})]},e.id)),ve?(0,W.jsxs)(j.Card,{highlight:D.colours.gold,children:[(0,W.jsxs)(j.T,{weight:"semibold",children:[ve.name," hours"]}),(0,W.jsxs)(j.Row,{gap:8,style:{flexWrap:'wrap'},children:[(0,W.jsx)(j.Muted,{children:"Starts every year on (MM-DD)"}),(0,W.jsx)(q,{label:"Season start date",value:ve.start??'',onChange:e=>Ce({...ve,start:e||void 0}),placeholder:"04-01",bad:!!ve.start&&!U.test(ve.start)})]}),Y.map(e=>{const s=ve.hours?.[e]??null,t=s=>Ce({...ve,hours:{...ve.hours,[e]:s}});return(0,W.jsxs)(j.Row,{gap:6,style:{flexWrap:'wrap'},children:[(0,W.jsx)(j.T,{style:{width:44},children:G[e]}),(0,W.jsx)(j.Chip,{label:s?'Open':'Closed',selected:!!s,onPress:()=>t(s?null:['12:00','19:00'])}),s?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(q,{label:`${T.DAYS[e]} opens`,value:s[0],width:74,onChange:e=>t([e,s[1]]),bad:!H.test(s[0])}),(0,W.jsx)(j.Muted,{children:"to"}),(0,W.jsx)(q,{label:`${T.DAYS[e]} last food orders`,value:s[1],width:74,onChange:e=>t([s[0],e]),bad:!H.test(s[1])||s[0]>=s[1]})]}):null]},e)}),Re?(0,W.jsx)(j.T,{size:13,colour:D.colours.red,children:Re}):null,(0,W.jsxs)(j.Row,{gap:6,children:[(0,W.jsx)(j.Button,{small:!0,label:"Save hours",disabled:!!Re,testID:"season-save",onPress:()=>{var e;e=we.map(e=>e.id===ve.id?ve:e),X({hourSets:e}),Ce(null),ae(`Saved ${ve.name} hours.`)}}),(0,W.jsx)(j.Button,{small:!0,kind:"ghost",label:"Cancel",onPress:()=>Ce(null)})]})]}):null,(0,W.jsx)(j.T,{weight:"semibold",style:{marginTop:6},children:"Special days"}),(0,W.jsx)(j.Muted,{size:13,children:"One-off changes, e.g. closed for a private party or open late on Hogmanay."}),De.map(e=>(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsxs)(j.T,{style:{flex:1},children:[e.date,": ",e.hours?`${e.hours[0]}\u2013${e.hours[1]}`:'kitchen closed',e.note?` \xb7 ${e.note}`:'']}),(0,W.jsx)(j.Button,{small:!0,kind:"ghost",label:"Remove",onPress:()=>X({hourOverrides:De.filter(s=>s.date!==e.date)})})]},e.date)),Se?(0,W.jsxs)(j.Card,{highlight:D.colours.gold,children:[(0,W.jsxs)(j.Row,{gap:8,children:[(0,W.jsx)(j.Muted,{children:"Date (DD/MM/YYYY)"}),(0,W.jsx)(q,{label:"Special day date",width:130,value:(0,t.slashDay)(Se.date),onChange:e=>{const s=(0,t.slashDate)(e,(0,t.slashDay)(Se.date));Te({...Se,date:(0,t.dayFromSlash)(s)??s})},placeholder:"31/12/2026",bad:!_.test(Se.date)})]}),(0,W.jsxs)(j.Row,{gap:6,style:{flexWrap:'wrap'},children:[(0,W.jsx)(j.Chip,{label:Se.hours?'Open':'Closed',selected:!!Se.hours,onPress:()=>Te({...Se,hours:Se.hours?null:['12:00','19:00']})}),Se.hours?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(q,{label:"Opens",width:74,value:Se.hours[0],onChange:e=>Te({...Se,hours:[e,Se.hours[1]]})}),(0,W.jsx)(j.Muted,{children:"to"}),(0,W.jsx)(q,{label:"Last food orders",width:74,value:Se.hours[1],onChange:e=>Te({...Se,hours:[Se.hours[0],e]})})]}):null]}),(0,W.jsxs)(j.Row,{gap:8,children:[(0,W.jsx)(j.Muted,{children:"Note"}),(0,W.jsx)(q,{label:"Note",width:220,value:Se.note??'',onChange:e=>Te({...Se,note:e||void 0}),placeholder:"Private party"})]}),(()=>{const e=_.test(Se.date)?Se.hours&&(!H.test(Se.hours[0])||!H.test(Se.hours[1])||Se.hours[0]>=Se.hours[1])?'Check the times.':'':'Date looks wrong (use 2026-12-31).';return(0,W.jsxs)(W.Fragment,{children:[e?(0,W.jsx)(j.T,{size:13,colour:D.colours.red,children:e}):null,(0,W.jsxs)(j.Row,{gap:6,children:[(0,W.jsx)(j.Button,{small:!0,label:"Save special day",disabled:!!e,onPress:()=>{X({hourOverrides:[...De.filter(e=>e.date!==Se.date),Se].sort((e,s)=>e.date.localeCompare(s.date))}),Te(null)}}),(0,W.jsx)(j.Button,{small:!0,kind:"ghost",label:"Cancel",onPress:()=>Te(null)})]})]})})()]}):(0,W.jsx)(j.Button,{small:!0,kind:"secondary",label:"\uff0b Add a special day",testID:"override-add",onPress:()=>Te({date:O,hours:null})}),(0,W.jsx)(j.T,{weight:"semibold",style:{marginTop:6},children:"Earlier last food orders (optional)"}),(0,W.jsx)(j.Muted,{size:13,children:"Leave blank to use the kitchen closing time. Regular events can set their own (Open Mic Night: 7pm)."}),(0,W.jsx)(j.Row,{wrap:!0,gap:8,children:Y.map(e=>(0,W.jsxs)(y.default,{style:{gap:2},children:[(0,W.jsx)(j.Muted,{size:12,children:G[e]}),(0,W.jsx)(q,{label:`${T.DAYS[e]} last food orders`,width:74,value:J.lastFoodByDay?.[e]??'',placeholder:"\u2014",bad:!!J.lastFoodByDay?.[e]&&!H.test(J.lastFoodByDay[e]),onChange:s=>X({lastFoodByDay:{...J.lastFoodByDay??{},[e]:s||void 0}})})]},e))}),Me?(0,W.jsx)(j.T,{size:13,colour:D.colours.red,children:"Use times like 19:00 (blank = kitchen close)."}):null,(0,W.jsx)(j.Muted,{children:"After last food orders, booking times are\u2026"}),(0,W.jsxs)(j.Row,{gap:6,children:[(0,W.jsx)(j.Chip,{label:"Offered for drinks only",selected:'drinks'===(0,T.afterLastFood)(x),onPress:()=>X({afterLastFood:'drinks'})}),(0,W.jsx)(j.Chip,{label:"Not offered",selected:'block'===(0,T.afterLastFood)(x),onPress:()=>X({afterLastFood:'block'})})]})]}),Oe=(0,W.jsxs)(y.default,{style:{gap:8},children:[(0,W.jsx)(j.Toggle,{label:"COVERS counter on Today (done / to come / total)",value:(0,T.coversCounterOn)(x),onChange:e=>X({coversCounter:e})}),(0,W.jsx)(j.Toggle,{label:"\u2018Next table free\u2019 when you\u2019re full",value:(0,T.nextTableOn)(x),onChange:e=>X({nextTableFree:e})}),(0,W.jsx)(j.Toggle,{label:"Show takeaway on home screens",value:(0,T.showTakeaway)(x),onChange:e=>X({showTakeaway:e})}),(0,W.jsx)(j.Muted,{size:13,children:"Takeaway order alerts always work. With this off, takeaway figures sit in a collapsed Takeaway section."}),(0,W.jsx)(j.Muted,{size:13,children:"The flap click sound is set on each Display (Display settings), off by default."})]}),ze=(0,W.jsxs)(y.default,{style:{gap:8},children:[(0,W.jsx)(j.Toggle,{label:"Show full gov.uk names, e.g. \u2018(substitute day)\u2019",value:!!J.holidayFullNames,onChange:e=>X({holidayFullNames:e})}),(0,W.jsx)(j.Muted,{size:13,children:"Off: \u201cChristmas Day\u201d shows on its date without \u201c(substitute day)\u201d."})]}),[Ie,$e]=(0,m.useState)(null),Ae=Ie??J.whatsapp??'',Be=!Ae.trim()||!!(0,L.waNumber)(Ae),Fe=(0,W.jsxs)(y.default,{style:{gap:8},children:[(0,W.jsx)(j.T,{children:"The venue\u2019s WhatsApp number"}),(0,W.jsxs)(j.Row,{gap:8,wrap:!0,children:[(0,W.jsx)(q,{label:"Venue WhatsApp number",testID:"adv-whatsapp-number",width:220,value:Ae,placeholder:"e.g. 01292 500123 or +44 7\u2026",bad:!Be,onChange:e=>{$e(e),e.trim()?(0,L.waNumber)(e)&&X({whatsapp:e.trim()}):X({whatsapp:void 0})}}),Ae.trim()&&Be?(0,W.jsx)(j.Badge,{kind:"gold",label:`wa.me/${(0,L.waNumber)(Ae)}`}):null]}),Be?null:(0,W.jsx)(j.T,{size:13,colour:D.colours.red,children:"That doesn\u2019t look like a phone number. Use the full number, e.g. 01292 500123 or +44 7700 900123."}),(0,W.jsx)(j.Muted,{size:13,children:"With a number here, guests see \u201cMessage us on WhatsApp\u201d on their booking confirmation, and staff and managers see \u201cWhatsApp guest\u201d on bookings that have a mobile number. Blank: all WhatsApp buttons stay hidden."}),(0,W.jsx)(j.Muted,{size:13,children:"Tip: nothing is ever sent for you. The button opens WhatsApp with a message typed in, and the person taps Send themselves."})]}),Ee=(0,N.soldOutSettingsOf)(J.soldOut),Ne=(0,W.jsxs)(y.default,{style:{gap:8},children:[(0,W.jsx)(j.Toggle,{testID:"adv-soldout-auto",label:"Mark dishes sold out from the counts",value:Ee.auto,onChange:e=>X({soldOut:{...Ee,auto:e}}),a11y:"Mark dishes sold out from the live counts"}),(0,W.jsx)(j.Muted,{size:13,children:Ee.auto?'On: when a count (lobster, crab\u2026) runs out or drops below what a dish needs, every dish that uses it is marked sold out, with the reason, e.g. \u201cDeluxe Seafood Platter (no lobster)\u201d. It goes back on when the count is back up. Dishes marked by hand are left alone. Change which dishes use what in any Sold out list.':'Off: dishes are only marked sold out by hand. Dishes marked from the counts go back on.'}),(0,W.jsx)(j.T,{children:"Clear sold out dishes by themselves"}),(0,W.jsx)(j.Row,{wrap:!0,gap:8,children:['close','morning','manual'].map(e=>(0,W.jsx)(j.Chip,{testID:`adv-soldout-${e}`,label:N.SOLD_OUT_CLEAR_LABEL[e],selected:Ee.clear===e,onPress:()=>X({soldOut:{...Ee,clear:e}})},e))}),'manual'!==Ee.clear?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(j.T,{children:"Next morning means"}),(0,W.jsx)(j.Row,{wrap:!0,gap:8,children:['04:00','05:00','06:00','08:00'].map(e=>(0,W.jsx)(j.Chip,{label:e,selected:Ee.morningAt===e,onPress:()=>X({soldOut:{...Ee,morningAt:e}})},e))})]}):null,(0,W.jsx)(j.Muted,{size:13,children:'close'===Ee.clear?'Dishes go back on at the kitchen\u2019s closing time that day (from Kitchen hours). Marked after closing: the next morning.':'morning'===Ee.clear?`Dishes go back on at ${Ee.morningAt} the next morning.`:'Dishes stay sold out until someone taps Back on.'}),(0,W.jsx)(j.Muted,{size:13,children:"Tip: Sold out is a reminder for staff. It shows on the Display\u2019s slim strip and in every staff app\u2019s Sold out list. CoverCharge doesn\u2019t link up to your till, so it doesn\u2019t change the till."})]}),We=(0,s.venueBusy)(x,le,new Date),He=(0,E.clampWeeks)(J.forecastMinWeeks),Ue=(0,W.jsxs)(y.default,{style:{gap:8},children:[(0,W.jsxs)(y.default,{testID:"busy-level-setting",style:{alignItems:'center',gap:12},accessible:!0,accessibilityLabel:We.words,children:[(0,W.jsx)(j.T,{center:!0,size:20,weight:"semibold",children:We.words}),(0,W.jsx)(j.Stepper,{testID:"busy-covers-hour",label:"Busy level in Covers an hour",value:J.busyCoversPerHour??30,min:1,max:200,onChange:e=>X({busyCoversPerHour:e,busyLearning:!1})}),(0,W.jsx)(j.Muted,{children:"Learning starts from your chosen level; enabling it starts a fresh history period, so older trading patterns do not immediately replace your choice."}),(0,W.jsx)(j.Toggle,{label:"Learn the busy level from our real history",value:!1!==J.busyLearning,onChange:e=>X({busyLearning:e,busyLearningSince:(new Date).toISOString().slice(0,10)})}),(0,W.jsx)(j.T,{center:!0,size:16,children:"Steady starts at half the busy level. Busy starts at the busy level. Hourly forecasts use the upper end of their range."}),(0,W.jsx)(j.T,{center:!0,size:16,children:"Learning needs at least 4 weeks, 16 trading days and 40 recorded hours. It uses the 85th percentile of recorded hourly arrivals over the last 8 weeks, including walk-ins, excluding cancellations and no-shows. Changing the number keeps your override until learning is switched on again."}),We.enough?null:(0,W.jsx)(j.T,{center:!0,size:16,children:"Not enough real hourly history to learn yet. Using the starting or owner-set level."})]}),(0,W.jsx)(j.T,{children:"History needed before forecasts show"}),(0,W.jsx)(j.Row,{wrap:!0,gap:8,children:[1,2,3,4,6,8].map(e=>(0,W.jsx)(j.Chip,{testID:`adv-forecast-weeks-${e}`,label:1===e?'1 week':`${e} weeks`,selected:He===e,onPress:()=>X({forecastMinWeeks:e})},e))}),(0,W.jsx)(j.Muted,{size:13,children:`Forecasts, expected walk-ins and labour vs sales start once CoverCharge has ${1===He?'1 week':`${He} weeks`} of your bookings (and cash-ups for sales). Until then you see what is booked and your real labour cost, never invented figures.`}),(0,W.jsx)(j.Muted,{size:13,children:"Tip: 2 weeks is a sensible start. More weeks give steadier forecasts but take longer to begin."}),(0,W.jsx)(l.ForecastDaySettings,{r:x,set:X})]}),Ye=(0,w.depositOf)(J),Ge=e=>X({deposit:{...Ye,...e}}),qe=o.IS_GREENSIDE?(0,W.jsx)(a.GreensideCashOnly,{}):(0,W.jsxs)(y.default,{style:{gap:8},children:[(0,W.jsx)(j.Toggle,{testID:"adv-deposit-on",label:"Ask bigger tables for a deposit",value:Ye.on,onChange:e=>Ge({on:e})}),(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(j.T,{children:"Amount per adult"}),(0,W.jsx)(j.Stepper,{testID:"adv-deposit-amount",value:Ye.perPersonPence/100,min:0,max:100,format:e=>`\xa3${e}`,onChange:e=>Ge({perPersonPence:100*e}),label:"deposit per person"})]}),(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(j.T,{children:"From a party of"}),(0,W.jsx)(j.Stepper,{testID:"adv-deposit-party",value:Ye.fromParty,min:1,max:30,onChange:e=>Ge({fromParty:e}),label:"deposit from party size"})]}),(0,W.jsx)(j.T,{children:"Refundable?"}),(0,W.jsxs)(j.Row,{wrap:!0,gap:8,children:[(0,W.jsx)(j.Chip,{testID:"adv-deposit-ref-yes",label:"Yes",selected:!0===Ye.refundable,onPress:()=>Ge({refundable:!0})}),(0,W.jsx)(j.Chip,{testID:"adv-deposit-ref-no",label:"No",selected:!1===Ye.refundable,onPress:()=>Ge({refundable:!1,cutoffHours:null})}),(0,W.jsx)(j.Chip,{testID:"adv-deposit-ref-unset",label:"Not set yet",selected:null===Ye.refundable,onPress:()=>Ge({refundable:null,cutoffHours:null})})]}),!0===Ye.refundable?(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(j.T,{children:"Refunded if cancelled this many hours before"}),(0,W.jsx)(j.Stepper,{testID:"adv-deposit-cutoff",value:Ye.cutoffHours??0,min:0,max:168,step:6,format:e=>e?`${e} h`:'Any time',onChange:e=>Ge({cutoffHours:e||null}),label:"refund cut-off hours"})]}):null,(0,W.jsx)(j.T,{children:"Words guests see (optional)"}),(0,W.jsx)(n.TextInput,{accessibilityLabel:"Deposit policy shown to guests",testID:"adv-deposit-policy",value:Ye.policy,multiline:!0,onChangeText:e=>Ge({policy:e.slice(0,600)}),placeholder:"e.g. The deposit comes off your bill on the night.",placeholderTextColor:D.colours.muted,style:{minHeight:70,borderRadius:10,borderWidth:1,borderColor:D.colours.hairline,backgroundColor:D.colours.surface2,color:D.colours.text,padding:10,fontSize:15}}),(0,W.jsx)(j.Muted,{size:13,children:Ye.on&&Ye.perPersonPence>0?`Guests booking for ${Ye.fromParty} or more see: \u201c${(0,w.depositWords)(Ye,Ye.fromParty,x.name).join(' ')}\u201d`:'Off: no booking asks for a deposit.'}),(0,W.jsx)(j.Toggle,{testID:"adv-deposit-wixlinks",label:"Send website bookings deposit links for phone and walk-in bookings",a11y:"Send website bookings deposit links for phone and walk-in bookings",value:!!Ye.wixLinksOn,onChange:e=>Ge({wixLinksOn:e})}),Ye.wixLinksOn?(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(j.T,{children:"Link works for"}),(0,W.jsx)(j.Stepper,{testID:"adv-deposit-linkhours",value:Ye.wixLinkHours??48,min:6,max:168,step:6,format:e=>`${e} hours`,onChange:e=>Ge({wixLinkHours:e}),label:"hours a deposit link works"})]}):null,(0,W.jsx)(j.Muted,{size:13,children:Ye.wixLinksOn?'On here, but website bookings deposit links also need the server switch, which stays off until the first \xa31 test is approved. Until then the button says so and nothing goes to website bookings.':'Off: no deposit links. Bookings work as before.'}),(0,W.jsx)(j.Muted,{size:13,children:"Tip: deposits are paid through website bookings, never in CoverCharge, and no card is saved. Guests who book on your website pay there, and the booking shows Deposit paid on website bookings by itself. For phone and walk-in bookings, tick Deposit paid once the guest has paid you, or send a website bookings deposit link. Refunds are done in Website bookings \u203a Orders. Deposit amounts are shown on bookings in Managers, Display and Staff. This does not grant access to other financial or HR information."})]}),Ke=(0,W.jsx)(k.LoyaltySettingsPanel,{}),Qe=(0,W.jsx)(se,{rid:P}),Ve=[{id:'bookings',title:'Bookings',words:'allergen allergy dog dogs cap limit access wheelchair step-free vegan vegetarian veg table request',reset:['dogQuestion','maxDogsPerSlot','accessQuestion','dietQuestion','tableRequests'],body:re,help:'adv-bookings'},{id:'times',title:'Table times',words:'dwell table time turn how long minutes party size next table free',reset:['dwellBands','dwellLearn'],body:he,help:'adv-table-times'},{id:'reserve',title:'Reservable items',words:'platter seafood crab lobster reserve price stock',reset:['reservables','reserveStock'],body:ge,help:'adv-reservable'},{id:'events',title:'Regular events',words:'open mic night music night event repeat monthly weekly promote busier forecast last food',reset:['regularEvents'],body:je,help:'adv-events'},{id:'hours',title:'Kitchen hours & last food orders',words:'hours kitchen season winter summer open close closed special day last food orders cutoff drinks',reset:['hourSets','hourOverrides','lastFoodByDay','afterLastFood'],body:Pe,help:'adv-hours'},{id:'home',title:'Display & home',words:'covers counter flip sound takeaway next table free home display',reset:['coversCounter','nextTableFree','showTakeaway'],body:Oe,help:'adv-home'},{id:'deposits',title:'Deposits',words:'deposit deposits per person party size refund refundable cut off policy paid due booking money wix link pay link online',reset:['deposit'],body:qe,help:'adv-deposits'},{id:'loyalty',title:'Loyalty: stamp card, offers & bring a friend',words:'loyalty stamp stamps card reward rewards offer offers referral refer friend bring expiry',reset:[],body:Ke,help:'adv-loyalty',noReset:!0},{id:'tableorder',title:'Order at the table',words:'order at table qr code scan phone guest menu tables areas accept first order last orders kitchen cut off print sheet pdf pay bar till',reset:[],body:o.IS_GREENSIDE?(0,W.jsx)(a.GreensideCashOnly,{}):(0,W.jsx)(r.TableOrderSettings,{rid:P,me:V}),help:'adv-table-order',noReset:!0},{id:'whatsapp',title:'WhatsApp',words:'whatsapp wa.me message chat guest phone mobile number tap',reset:['whatsapp'],body:Fe,help:'adv-whatsapp'},{id:'reminders',title:'Reminders',words:'reminder reminders break breaks chairs tables close closing shift staff nudge 6 hours law snooze later done',reset:[],body:Qe,help:'adv-reminders',onReset:()=>Z(P)},{id:'notifications',title:'Notifications',words:'notification notifications push phone scheduled order milk mills pieroni pieronis fish veg olsen rota upload remind time send',reset:[],body:(0,W.jsx)(B.NotificationsSettings,{rid:P}),help:'adv-notifications',onReset:()=>F.useNotifs.getState().resetSeeds(P)},{id:'orderlists',title:'Order lists',words:'order list lists alsons drinks cash carry trip shopping supplier logo staff add',reset:[],body:(0,W.jsx)(B.OrderListsSettings,{rid:P}),help:'adv-order-lists',onReset:()=>(0,B.resetOrderLists)(P)},{id:'tasks',title:'Tasks',words:'daily tasks library jobs checklist duties to do todo',reset:[],body:(0,W.jsx)(c.TaskLibrarySettings,{rid:P}),help:'adv-tasks',onReset:()=>b.useDailyTasks.getState().resetLibrary(P)},{id:'cashup',title:'Cash up',words:'cash up sheet takings till float card cash tips weekly sales report pos printout figures fields vat covers',reset:[],body:(0,W.jsx)(p.CashUpSettings,{rid:P}),help:'adv-cashup',onReset:()=>g.useCashUp.getState().resetFields(P)},{id:'tips',title:'Tips',words:'tips pot today tips show hide staff apps payout correction',reset:[],body:(0,W.jsx)(p.TipsSettings,{rid:P}),help:'adv-tips',onReset:()=>g.useCashUp.getState().setShow(P,{showToday:!0,showPot:!0})},{id:'clockarea',title:'Clock-in area',words:'clock in out geofence location area radius gps break forgot forgotten rota visiting map',reset:[],body:(0,W.jsx)(B.ClockAreaSettings,{rid:P,me:V}),help:'adv-clock-area',onReset:()=>(0,B.resetClockArea)(P,V)},{id:'checkout',title:'Shift check-out & question board',words:'check out checkout morale mood staffing staff enough overstaffed survey anonymous question board vote shout out shoutout wellbeing hr wording',reset:['hr'],body:(0,W.jsx)(u.HrSettingsCard,{rid:P}),help:'adv-checkout'},{id:'forecast',title:'Forecast history',words:'forecast history weeks estimate walk-ins opening hours minimum covers floor saturday sunday labour sales example figures not enough history',reset:['forecastMinWeeks'],body:Ue,help:'adv-forecast'},{id:'soldout',title:'Sold out reminders',words:'sold out 86 eighty six run out ran out back on clear end of service morning display strip auto automatic counts shellfish lobster crab platter link uses',reset:['soldOut'],body:Ne,help:'adv-soldout'},{id:'tablegrid',title:'Table plan grid',words:'table plan grid snap line up align tidy tables floor layout guides spacing restore',reset:[],body:(0,W.jsx)(I.GridSettings,{rid:P,me:V}),help:'adv-tablegrid',onReset:()=>{const e=A.useFloor.getState().settings[P];A.useFloor.getState().setSettings(P,{...A.DEFAULT_SETTINGS,...e??{},gridSnap:!0,gridSize:25})}},{id:'printers',title:'Printers',words:'print printer printers printing ticket tickets kitchen ticket docket receipt epson star bluetooth wifi reprint takeaway auto front of house copies',reset:[],body:(0,W.jsx)($.PrintersSettings,{rid:P,go:e}),help:'adv-printers',onReset:()=>{const e=A.useFloor.getState().settings[P];e&&A.useFloor.getState().setSettings(P,{...e,printing:void 0})}},{id:'blocks',title:'Block bookings: lunch, dinner and website bookings',words:'block blocks blocked pause close lunch dinner service times wix website online push',reset:[],noReset:!0,body:(0,W.jsx)(d.BlockSettings,{rid:P}),help:'adv-blocks'},{id:'giftqr',title:'Gift cards on the Display',words:'gift card cards voucher qr code display buy sell wix website page link',reset:[],noReset:!0,body:(0,W.jsx)(i.GiftQrSettings,{rid:P}),help:'adv-giftqr'},{id:'holidays',title:'Holiday names',words:'bank holiday substitute day names',reset:['holidayFullNames'],body:ze,help:'adv-holidays'}],Ze=ee.trim().toLowerCase(),Je=(0,m.useMemo)(()=>Ve.filter(e=>!Ze||`${e.title} ${e.words}`.toLowerCase().includes(Ze)),[Ze,Ve]);return(0,W.jsxs)(y.default,{style:{gap:12},testID:"advanced-settings",children:[(0,W.jsx)(j.Muted,{children:"Owners and managers only. Changes are shared with your team\u2019s devices."}),(0,W.jsx)(n.TextInput,{accessibilityLabel:"Search settings",testID:"advanced-search",value:ee,onChangeText:te,placeholder:"Search, e.g. dogs, Open Mic Night, hours",placeholderTextColor:D.colours.muted,style:{minHeight:46,borderRadius:12,borderWidth:1,borderColor:D.colours.accentBorder,backgroundColor:D.colours.surface2,color:D.colours.text,paddingHorizontal:12,fontSize:16}}),oe?(0,W.jsx)(j.Banner,{kind:"success",title:oe}):null,Je.length?null:(0,W.jsxs)(j.Muted,{children:["No settings match \u201c",ee,"\u201d."]}),Je.map(s=>(0,W.jsx)(j.Card,{children:(0,W.jsxs)(y.default,{testID:`adv-${s.id}`,style:{gap:10},children:[(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(j.T,{size:17,weight:"semibold",colour:D.colours.gold,children:s.title}),e?(0,W.jsx)(f.default,{accessibilityRole:"button",accessibilityLabel:`Help: ${s.title}`,onPress:()=>e('more','help'),hitSlop:8,style:{minHeight:44,minWidth:44,justifyContent:'center'},children:(0,W.jsx)(j.T,{colour:D.colours.muted,children:"? Help"})}):null]}),s.body,s.noReset?null:(0,W.jsx)(j.Row,{style:{justifyContent:'flex-end'},children:(0,W.jsx)(j.Button,{small:!0,kind:"ghost",label:"Reset to default",testID:`reset-${s.id}`,onPress:()=>ne(s)})})]})},s.id))]})},Object.defineProperty(_e,"ADVANCED_DEFAULTS",{enumerable:!0,get:function(){return V}}),_e.SeasonsTodo=function({go:e}){const{r:s}=(0,R.useCtx)(6e4),t=(0,C.hourSetsOf)(s),o=[],a=t.filter(e=>!e.hours).map(e=>e.name);a.length&&o.push(`${a.join(' and ')} kitchen hours`);t.length>1&&t.some(e=>!e.start)&&o.push('the date each season starts');return o.length?(0,W.jsx)(j.Card,{onPress:()=>e('more','advanced'),highlight:D.colours.gold,children:(0,W.jsxs)(y.default,{testID:"seasons-todo",style:{gap:4},children:[(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(j.T,{weight:"semibold",colour:D.colours.gold,children:"Setup checklist: kitchen hours"}),(0,W.jsx)(j.T,{colour:D.colours.muted,children:"\u203a"})]}),(0,W.jsxs)(j.Muted,{size:13,children:["Please add ",o.join(' and ')," (Settings \u203a Advanced \u203a Kitchen hours). Until then the app uses the Winter hours all year."]})]})}):null};var s=_r(_d[0]),t=_r(_d[1]),o=_r(_d[2]),a=_r(_d[3]),n=_r(_d[4]),l=_r(_d[5]),r=_r(_d[6]),i=_r(_d[7]),d=_r(_d[8]),h=_r(_d[9]),u=_r(_d[10]),c=_r(_d[11]),p=_r(_d[12]),g=_r(_d[13]),b=_r(_d[14]),m=_r(_d[15]),x=e(m),f=e(_r(_d[16])),y=e(_r(_d[17])),j=_r(_d[18]),w=_r(_d[19]),k=_r(_d[20]),v=_r(_d[21]),C=_r(_d[22]),S=_r(_d[23]),T=_r(_d[24]),D=_r(_d[25]),R=_r(_d[26]),M=_r(_d[27]),L=_r(_d[28]),P=_r(_d[29]),O=_r(_d[30]),z=_r(_d[31]),I=_r(_d[32]),$=_r(_d[33]),A=_r(_d[34]),B=_r(_d[35]),F=_r(_d[36]),E=_r(_d[37]),N=_r(_d[38]),W=_r(_d[39]);const H=/^([01]\d|2[0-3]):[0-5]\d$/,U=/^(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/,_=/^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/,Y=[1,2,3,4,5,6,0],G=['Sun','Mon','Tue','Wed','Thu','Fri','Sat'];function q({value:e,onChange:s,placeholder:t,label:o,width:a=90,bad:l,testID:r}){return(0,W.jsx)(n.TextInput,{accessibilityLabel:o,testID:r,value:e,onChangeText:s,placeholder:t,placeholderTextColor:D.colours.muted,style:{width:a,minHeight:44,borderRadius:10,borderWidth:1,borderColor:l?D.colours.red:D.colours.hairline,backgroundColor:D.colours.surface2,color:D.colours.text,paddingHorizontal:10,fontSize:15}})}function K({value:e,onChange:s,min:t,max:o,unit:a,label:n,step:l=5}){const r=(a,l)=>(0,W.jsx)(f.default,{accessibilityRole:"button",accessibilityLabel:`${l<0?'Less':'More'}: ${n}`,onPress:()=>s(Math.min(o,Math.max(t,e+l))),style:{width:44,height:44,borderRadius:10,borderWidth:1,borderColor:D.colours.accentBorder,alignItems:'center',justifyContent:'center'},children:(0,W.jsx)(j.T,{size:20,colour:D.colours.gold,children:a})});return(0,W.jsxs)(j.Row,{gap:8,children:[r('\u2212',-l),(0,W.jsx)(j.T,{weight:"semibold",style:{minWidth:76,textAlign:'center'},children:a(e)}),r('+',l)]})}const Q=e=>e%60?`${Math.floor(e/60)}h ${e%60}m`:`${e/60} hour${60===e?'':'s'}`;const V={DEFAULT_DWELL:T.DEFAULT_DWELL,ANCHORAGE_SEASONS:C.ANCHORAGE_SEASONS};function Z(e){const s=P.useReminders.getState();s.ensure(e),s.resetRules(e),s.resetReminder((0,P.chairsId)(e))}const J=[1,2,3,4,5,6,0],X=e=>`${7===e.days.length?'Every day':J.filter(s=>e.days.includes(s)).map(e=>O.DAY_NAMES[e]).join(', ')||'No days'} at ${e.time} (UK time) \xb7 ${O.AUDIENCE_LABEL[e.audience]}`;function ee({init:e,onSave:s,onCancel:t}){const[o,a]=(0,m.useState)(e.text),[l,r]=(0,m.useState)(e.days),[i,d]=(0,m.useState)(e.time),[h,u]=(0,m.useState)(e.audience),c=o.trim().length>1&&l.length>0&&(0,O.validTime)(i);return(0,W.jsxs)(y.default,{testID:"reminder-editor",style:{gap:8,borderWidth:1,borderColor:D.colours.accentBorder,borderRadius:12,padding:10},children:[(0,W.jsx)(j.T,{weight:"semibold",children:"What it says"}),(0,W.jsx)(n.TextInput,{accessibilityLabel:"Reminder wording",testID:"reminder-text",value:o,onChangeText:a,maxLength:120,placeholder:"e.g. Time to put the chairs up on the tables",placeholderTextColor:D.colours.muted,style:{minHeight:44,borderRadius:10,borderWidth:1,borderColor:D.colours.hairline,backgroundColor:D.colours.surface2,color:D.colours.text,paddingHorizontal:10,fontSize:15}}),(0,W.jsx)(j.T,{weight:"semibold",children:"Days"}),(0,W.jsx)(j.Row,{wrap:!0,gap:6,children:J.map(e=>(0,W.jsx)(j.Chip,{label:O.DAY_NAMES[e],selected:l.includes(e),onPress:()=>r(l.includes(e)?l.filter(s=>s!==e):[...l,e])},e))}),(0,W.jsxs)(j.Row,{gap:8,children:[(0,W.jsx)(j.T,{weight:"semibold",children:"Time (UK)"}),(0,W.jsx)(q,{label:"Reminder time",testID:"reminder-time",value:i,onChange:d,placeholder:"21:00",bad:!(0,O.validTime)(i)})]}),(0,W.jsx)(j.T,{weight:"semibold",children:"Who sees it"}),(0,W.jsx)(j.Row,{wrap:!0,gap:6,children:['all','foh','kitchen'].map(e=>(0,W.jsx)(j.Chip,{label:O.AUDIENCE_LABEL[e],selected:h===e,onPress:()=>u(e)},e))}),c?null:(0,W.jsx)(j.Muted,{size:13,children:"Add the wording, at least one day and a time like 21:00."}),(0,W.jsxs)(j.Row,{gap:8,style:{justifyContent:'flex-end'},children:[(0,W.jsx)(j.Button,{small:!0,kind:"ghost",label:"Cancel",onPress:t}),(0,W.jsx)(j.Button,{small:!0,label:"Save reminder",testID:"reminder-save",disabled:!c,onPress:()=>s({text:o.trim(),days:[...l].sort(),time:i,audience:h})})]})]})}function se({rid:e}){x.default.useEffect(()=>{P.useReminders.getState().ensure(e)},[e]);const s=(0,P.useReminders)(e=>e.reminders),t=s.filter(s=>s.rid===e&&!s.removed),o=(0,P.useReminders)(s=>s.rules[e]),a=(0,O.clampRules)(o??O.DEFAULT_BREAK_RULES),n=(0,P.useReminders)(e=>e.done).filter(s=>s.rid===e).slice(0,5),l=(0,z.useOwner)(e=>e.staff),r=P.useReminders.getState(),[i,d]=(0,m.useState)(null),[h,u]=(0,m.useState)(null),c=s=>r.setRules(e,s);return(0,W.jsxs)(y.default,{style:{gap:10},testID:"reminders-settings",children:[(0,W.jsx)(j.Muted,{size:13,children:"Reminders slide up on the phones of staff who are on shift right now (clocked in, or on the rota at that time), in the Staff and Head Chef apps, while the app is open."}),(0,W.jsx)(j.T,{weight:"semibold",children:"Break reminders"}),(0,W.jsx)(j.Toggle,{label:"Remind staff to take their break",value:a.on,onChange:e=>c({on:e})}),(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},wrap:!0,children:[(0,W.jsx)(j.T,{center:!0,style:{width:'100%'},children:"First reminder, if the rota has no break time"}),(0,W.jsx)(K,{label:"first break reminder",step:15,min:30,max:O.LEGAL_LIMIT_MINS,value:a.afterMins,unit:e=>`${Q(e)} in`,onChange:e=>c({afterMins:e})})]}),(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},wrap:!0,children:[(0,W.jsx)(j.T,{style:{flex:1},children:"Remind once more after"}),(0,W.jsx)(K,{label:"second break reminder",step:5,min:5,max:120,value:a.repeatMins,unit:e=>`${e} min`,onChange:e=>c({repeatMins:e})})]}),(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},wrap:!0,children:[(0,W.jsx)(j.T,{style:{flex:1},children:"\u2018Later\u2019 hides it for"}),(0,W.jsx)(K,{label:"snooze",step:5,min:5,max:60,value:a.snoozeMins,unit:e=>`${e} min`,onChange:e=>c({snoozeMins:e})})]}),(0,W.jsxs)(j.Muted,{size:13,children:["How it works: if the shift on the rota has a break time, the reminder comes at that time. If not, it comes ",Q(a.afterMins)," after they clock in (or after the shift starts, if they haven\u2019t clocked in). If they still haven\u2019t started a break, it comes once more ",a.repeatMins," minutes later, and again at 6 hours. Nobody works more than 6 hours without a reminder: UK law says a shift over 6 hours needs a 20-minute break. \u2018Start break\u2019 starts their break, the same as on the clock screen."]}),(0,W.jsx)(j.T,{weight:"semibold",style:{marginTop:6},children:"Venue reminders"}),t.map(e=>(0,W.jsx)(y.default,{testID:`reminder-${e.builtIn??e.id}`,style:{gap:6,borderBottomWidth:1,borderColor:D.colours.hairline,paddingBottom:8},children:i===e.id?(0,W.jsx)(ee,{init:e,onCancel:()=>d(null),onSave:s=>{r.update(e.id,s),d(null)}}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},gap:8,children:[(0,W.jsx)(j.T,{weight:"semibold",style:{flex:1},children:e.text}),e.paused?(0,W.jsx)(j.Badge,{kind:"amber",label:"PAUSED"}):null]}),(0,W.jsx)(j.Muted,{size:13,children:X(e)}),h===e.id?(0,W.jsxs)(j.Row,{gap:8,wrap:!0,children:[(0,W.jsx)(j.T,{size:14,style:{flex:1},children:"Delete this reminder?"}),(0,W.jsx)(j.Button,{small:!0,kind:"danger",label:"Yes, delete it",onPress:()=>{r.remove(e.id),u(null)}}),(0,W.jsx)(j.Button,{small:!0,kind:"ghost",label:"Keep it",onPress:()=>u(null)})]}):(0,W.jsxs)(j.Row,{gap:8,wrap:!0,children:[(0,W.jsx)(j.Button,{small:!0,kind:"secondary",label:"Edit",testID:"reminder-edit",onPress:()=>d(e.id)}),(0,W.jsx)(j.Button,{small:!0,kind:"secondary",label:e.paused?'Resume':'Pause',onPress:()=>r.update(e.id,{paused:!e.paused})}),(0,W.jsx)(j.Button,{small:!0,kind:"ghost",label:"Delete",onPress:()=>u(e.id)})]})]})},e.id)),t.length?null:(0,W.jsx)(j.Muted,{children:"No venue reminders. Add one below, or Reset to default to bring back \u201cchairs up\u201d."}),'new'===i?(0,W.jsx)(ee,{init:{text:'',days:[5,6],time:'21:00',audience:'all'},onCancel:()=>d(null),onSave:s=>{r.add(e,s),d(null)}}):(0,W.jsx)(j.Button,{small:!0,kind:"secondary",label:"\uff0b Add a reminder",testID:"reminder-add",onPress:()=>d('new')}),n.length?(0,W.jsxs)(y.default,{style:{gap:2},children:[(0,W.jsx)(j.T,{weight:"semibold",children:"Recently done"}),n.map(e=>(0,W.jsxs)(j.Muted,{size:13,children:[new Date(e.at).toLocaleString('en-GB',{weekday:'short',day:'numeric',month:'short',hour:'2-digit',minute:'2-digit',timeZone:'Europe/London'})," \xb7 ",(l.find(s=>s.id===e.staffRef)?.name??e.staffName).replace(' (example)','')," \xb7 ",s.find(s=>s.id===e.reminderId)?.text??'Reminder']},e.id))]}):null,(0,W.jsxs)(j.Muted,{size:13,children:["Tip: once anyone taps Done, the reminder goes away for everyone that day, and you can see who did it here. \u2018Later\u2019 hides it on that phone for ",a.snoozeMins," minutes. Reset to default puts back the break times and \u201cchairs up\u201d (",(0,O.defaultChairs)('x',e).days.map(e=>O.DAY_NAMES[e]).join(' and '),", 21:00); your own reminders stay."]}),(0,W.jsx)(j.Muted,{size:13,children:"Reminders show while the app is open. Phones with the app closed don\u2019t get them yet."})]})}},1418,[1051,1031,805,1405,812,1419,1420,1422,1423,1424,1197,1029,1030,1006,1012,17,385,85,777,841,1425,816,862,1053,861,804,1055,858,1181,972,973,876,1426,1379,996,1427,1003,1139,939,8]); +__d(function(_g,_r,_i,_a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.AdvancedSettings=function({go:e}){const{r:x,rid:P,today:O,me:I}=(0,R.useCtx)(6e4),V=I.replace(" (example)",""),J=x.settings,X=e=>v.useStore.getState().updateSettings(P,e),[ee,te]=(0,m.useState)(()=>(0,h.takeAdvancedPrefill)()),[oe,ae]=(0,m.useState)(null),ne=e=>{if(e.onReset)return e.onReset(),void ae(`${e.title}: back to the defaults.`);X(Object.fromEntries(e.reset.map(e=>[e,void 0]))),ae(`${e.title}: back to the defaults.`)},le=(0,M.useBookings)(P),re=(0,W.jsxs)(y.default,{style:{gap:8},children:[(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(j.T,{style:{flex:1},children:"Ask about allergies first (in red)"}),(0,W.jsx)(j.Badge,{kind:"red",label:"ALWAYS ON"})]}),(0,W.jsx)(j.Muted,{size:13,children:"Food safety: every booking answers this before anything else, and staff tick \u201cAllergens seen\u201d."}),(0,W.jsx)(j.Toggle,{label:"Ask if they\u2019re bringing a dog",value:(0,T.dogQuestionOn)(x),onChange:e=>X({dogQuestion:e})}),(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(j.T,{style:{flex:1},children:"Most dogs per booking time"}),(0,W.jsx)(K,{label:"dogs per time",step:1,min:0,max:20,value:J.maxDogsPerSlot??0,unit:e=>e?`${e} dog${1===e?'':'s'}`:'No limit',onChange:e=>X({maxDogsPerSlot:e||void 0})})]}),(0,W.jsx)(j.Toggle,{label:"Ask about wheelchair or step-free access",value:(0,T.accessQuestionOn)(x),onChange:e=>X({accessQuestion:e})}),(0,W.jsx)(j.Toggle,{label:"Vegan and vegetarian ticks (optional for guests)",value:(0,T.dietQuestionOn)(x),onChange:e=>X({dietQuestion:e})}),(0,W.jsx)(j.Toggle,{label:"Let guests ask for a table (shown as \u2018not guaranteed\u2019)",value:!1!==J.tableRequests,onChange:e=>X({tableRequests:e})}),(0,W.jsx)(j.Muted,{size:13,children:"Dog-friendly and step-free tables are marked on the table plan."}),e?(0,W.jsx)(j.Button,{small:!0,kind:"ghost",label:"Mark tables on the Table plan \u203a",onPress:()=>e('more','tableplan')}):null]}),ie=(0,T.dwellBands)(x),de=(e,s)=>X({dwellBands:ie.map((t,o)=>o===e?{...t,mins:s}:t)}),he=(0,W.jsxs)(y.default,{style:{gap:8},children:[(0,W.jsx)(j.Muted,{size:13,children:"How long a table usually stays, by party size. Used for \u201cNext table free\u201d and for spacing bookings on a table."}),ie.map((e,s)=>{const t=(0,T.dwellFor)(x,9999===e.upTo?20:e.upTo,le);return(0,W.jsxs)(y.default,{style:{gap:2},children:[(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(j.T,{style:{flex:1},children:(0,T.bandLabel)(ie,s)}),(0,W.jsx)(K,{label:`table time for ${(0,T.bandLabel)(ie,s)}`,min:30,max:360,value:e.mins,unit:Q,onChange:e=>de(s,e)})]}),t.learned&&t.mins!==e.mins?(0,W.jsxs)(j.Muted,{size:12,children:["From your last ",t.samples," tables: about ",Q(t.mins)," (used for estimates)"]}):null]},s)}),(0,W.jsx)(j.Toggle,{label:"Fine-tune from how long tables really stay",value:!1!==J.dwellLearn,onChange:e=>X({dwellLearn:e})}),(0,W.jsx)(j.Muted,{size:13,children:"Defaults: 90 min for 1\u20132 Covers, 105 min for 3\u20135, 2 hours for 6\u201319, 3 hours for 20 or more."})]}),ue=J.reservables??(0,S.reservablesOf)(x),ce=J.reservables??('anchorage'===P?ue:[]),pe=(e,s)=>X({reservables:ce.map(t=>t.id===e?{...t,...s}:t)}),ge=(0,W.jsxs)(y.default,{style:{gap:8},children:[ce.length?ce.map(e=>(0,W.jsxs)(y.default,{style:{gap:4},children:[(0,W.jsx)(j.Toggle,{label:`${e.name} can be reserved`,value:e.active,onChange:s=>pe(e.id,{active:s})}),(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(j.Muted,{children:"Price"}),(0,W.jsx)(K,{label:`${e.name} price`,min:5,max:1e3,value:Math.round(e.price/100),unit:e=>`\xa3${e}`,onChange:s=>pe(e.id,{price:100*s})})]}),(0,W.jsxs)(j.Muted,{size:12,children:["Uses: ",e.uses.map(e=>`${e.qty} ${e.key}`).join(' + ')," from the counted stock. Held from the Display count and shown as \u201cReserved\u201d."]})]},e.id)):(0,W.jsx)(j.Muted,{children:"No reservable dishes yet."}),(0,W.jsx)(j.Toggle,{label:"Guests can reserve a crab or lobster on its own",value:!1!==J.reserveStock,onChange:e=>X({reserveStock:e})}),(0,W.jsx)(j.Muted,{size:13,children:"The kitchen is told about each reservation and the Head Chef taps OK."})]}),be=(0,T.regularEventsOf)(x),[me,xe]=(0,m.useState)(null),fe=e=>X({regularEvents:e}),ye=me?me.name.trim()?me.time&&!H.test(me.time)?'Start time looks wrong (use 20:00).':me.lastFood&&!H.test(me.lastFood)?'Last food orders looks wrong (use 19:00).':'once'!==me.rule.kind||_.test(me.rule.date)?'':'Date looks wrong (use 2026-12-31).':'Give it a name.':'',je=(0,W.jsxs)(y.default,{style:{gap:8},children:[be.map(e=>(0,W.jsxs)(j.Card,{children:[(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(j.T,{weight:"semibold",style:{flex:1},children:e.name}),e.busier?(0,W.jsx)(j.Badge,{kind:"gold",label:"BUSIER"}):null,e.active?null:(0,W.jsx)(j.Badge,{kind:"neutral",label:"OFF"})]}),(0,W.jsxs)(j.Muted,{children:[(0,T.ruleText)(e.rule),e.time?` \xb7 from ${e.time}`:'',e.lastFood?` \xb7 last food orders ${e.lastFood}`:'']}),e.active?(0,W.jsxs)(j.Muted,{size:12,children:["Next: ",(0,T.nextOccurrence)(e,O)??'\u2014']}):null,(0,W.jsxs)(j.Row,{gap:6,children:[(0,W.jsx)(j.Button,{small:!0,kind:"secondary",label:"Edit",testID:`event-edit-${e.id}`,onPress:()=>xe({...e})}),(0,W.jsx)(j.Button,{small:!0,kind:"ghost",label:"Remove",onPress:()=>fe(be.filter(s=>s.id!==e.id))})]})]},e.id)),me?(0,W.jsxs)(j.Card,{highlight:D.colours.gold,children:[(0,W.jsxs)(j.Row,{gap:8,style:{flexWrap:'wrap'},children:[(0,W.jsx)(j.Muted,{children:"Name"}),(0,W.jsx)(q,{label:"Event name",width:220,value:me.name,onChange:e=>xe({...me,name:e}),placeholder:"Open Mic Night"})]}),(0,W.jsx)(j.Muted,{children:"Repeats"}),(0,W.jsxs)(j.Row,{wrap:!0,gap:6,children:[(0,W.jsx)(j.Chip,{label:"Last \u2026 of the month",selected:'last'===me.rule.kind,onPress:()=>xe({...me,rule:{kind:'last',weekday:'weekday'in me.rule?me.rule.weekday:0}})}),(0,W.jsx)(j.Chip,{label:"Every week",selected:'weekly'===me.rule.kind,onPress:()=>xe({...me,rule:{kind:'weekly',weekday:'weekday'in me.rule?me.rule.weekday:0}})}),(0,W.jsx)(j.Chip,{label:"One-off date",selected:'once'===me.rule.kind,onPress:()=>xe({...me,rule:{kind:'once',date:O}})})]}),'weekday'in me.rule?(0,W.jsx)(j.Row,{wrap:!0,gap:6,children:Y.map(e=>(0,W.jsx)(j.Chip,{label:G[e],selected:me.rule.weekday===e,onPress:()=>xe({...me,rule:{...me.rule,weekday:e}})},e))}):(0,W.jsxs)(j.Row,{gap:8,children:[(0,W.jsx)(j.Muted,{children:"Date (DD/MM/YYYY)"}),(0,W.jsx)(q,{label:"Event date",width:130,value:(0,t.slashDay)(me.rule.date),onChange:e=>{const s=(0,t.slashDate)(e,(0,t.slashDay)(me.rule.date));xe({...me,rule:{kind:'once',date:(0,t.dayFromSlash)(s)??s}})},placeholder:"31/12/2026"})]}),(0,W.jsxs)(j.Row,{gap:8,style:{flexWrap:'wrap'},children:[(0,W.jsx)(j.Muted,{children:"Starts (optional)"}),(0,W.jsx)(q,{label:"Start time",value:me.time??'',onChange:e=>xe({...me,time:e||void 0}),placeholder:"20:00",bad:!!me.time&&!H.test(me.time)})]}),(0,W.jsxs)(j.Row,{gap:8,style:{flexWrap:'wrap'},children:[(0,W.jsx)(j.Muted,{children:"Last food orders (optional)"}),(0,W.jsx)(q,{label:"Last food orders",value:me.lastFood??'',onChange:e=>xe({...me,lastFood:e||void 0}),placeholder:"19:00",bad:!!me.lastFood&&!H.test(me.lastFood)})]}),(0,W.jsxs)(j.Row,{gap:8,style:{flexWrap:'wrap'},children:[(0,W.jsx)(j.Muted,{children:"Notes"}),(0,W.jsx)(q,{label:"Notes",width:240,value:me.notes??'',onChange:e=>xe({...me,notes:e||void 0}),placeholder:"Live music from 8pm"})]}),(0,W.jsx)(j.Toggle,{label:"Expect busier (raises the forecast)",value:me.busier,onChange:e=>xe({...me,busier:e})}),(0,W.jsx)(j.Toggle,{label:"On",value:me.active,onChange:e=>xe({...me,active:e})}),ye?(0,W.jsx)(j.T,{size:13,colour:D.colours.red,children:ye}):null,(0,W.jsxs)(j.Row,{gap:6,children:[(0,W.jsx)(j.Button,{small:!0,label:"Save event",disabled:!!ye,testID:"event-save",onPress:()=>{const e={...me,name:me.name.trim()};fe(be.some(s=>s.id===e.id)?be.map(s=>s.id===e.id?e:s):[...be,e]),xe(null),ae(`Saved ${e.name}.`)}}),(0,W.jsx)(j.Button,{small:!0,kind:"ghost",label:"Cancel",onPress:()=>xe(null)})]})]}):(0,W.jsx)(j.Button,{small:!0,kind:"secondary",label:"\uff0b Add a regular event",testID:"event-add",onPress:()=>xe({id:`ev-${Date.now().toString(36)}`,name:'',rule:{kind:'last',weekday:0},busier:!0,active:!0})}),(0,W.jsx)(j.Muted,{size:13,children:"Events show in Forecast key dates (with a Promote button), on the Today date bar, and lift the forecast when \u201cExpect busier\u201d is on."})]}),we=(0,C.hourSetsOf)(x),ke=(0,C.seasonOn)(x,new Date),[ve,Ce]=(0,m.useState)(null),[Se,Te]=(0,m.useState)(null),De=J.hourOverrides??[],Re=ve?ve.start&&!U.test(ve.start)?'Start date looks wrong (use day and month as MM-DD, e.g. 04-01 for 1 April).':ve.hours&&Object.values(ve.hours).some(e=>e&&(!H.test(e[0])||!H.test(e[1])||e[0]>=e[1]))?'Check the times: use 12:00 and 19:00, and closing must be after opening.':'':'',Me=Object.values(J.lastFoodByDay??{}).some(e=>e&&!H.test(e)),Le=[];we.some(e=>!e.hours)&&Le.push(`${we.filter(e=>!e.hours).map(e=>e.name).join(' and ')} kitchen hours`);we.filter(e=>e.hours).length>=1&&we.length>1&&we.some(e=>!e.start)&&Le.push('the date each season starts');const Pe=(0,W.jsxs)(y.default,{style:{gap:8},children:[(0,W.jsx)(j.Muted,{size:13,children:"Kitchen (food) hours, not bar hours. The closing time is last food orders. Dining bookings are only offered inside these hours."}),Le.length?(0,W.jsxs)(j.Banner,{kind:"warn",title:"To finish setting up",children:["Please add ",Le.join(' and '),". Until then the app uses ",ke?.name??'your weekly'," hours all year."]}):null,ke?(0,W.jsxs)(j.T,{colour:D.colours.goldLight,children:["In use today: ",ke.name]}):null,we.map(e=>(0,W.jsxs)(j.Card,{children:[(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(j.T,{weight:"semibold",children:e.name}),ke?.id===e.id?(0,W.jsx)(j.Badge,{kind:"gold",label:"IN USE"}):e.hours?null:(0,W.jsx)(j.Badge,{kind:"amber",label:"NOT SET"})]}),(0,W.jsx)(j.Muted,{children:e.start?`Starts every year on ${e.start}`:'Start date: not set yet'}),e.hours?(0,W.jsx)(j.Muted,{size:13,children:Y.map(s=>`${G[s]} ${e.hours[s]?`${e.hours[s][0]}\u2013${e.hours[s][1]}`:'closed'}`).join(' \xb7 ')}):(0,W.jsx)(j.Muted,{size:13,children:"No hours yet."}),(0,W.jsx)(j.Button,{small:!0,kind:"secondary",label:e.hours?'Edit':`Set ${e.name} hours`,testID:`season-edit-${e.id}`,onPress:()=>Ce({...e,hours:e.hours?{...e.hours}:{...we.find(e=>e.hours)?.hours??x.kitchenHours}})})]},e.id)),ve?(0,W.jsxs)(j.Card,{highlight:D.colours.gold,children:[(0,W.jsxs)(j.T,{weight:"semibold",children:[ve.name," hours"]}),(0,W.jsxs)(j.Row,{gap:8,style:{flexWrap:'wrap'},children:[(0,W.jsx)(j.Muted,{children:"Starts every year on (MM-DD)"}),(0,W.jsx)(q,{label:"Season start date",value:ve.start??'',onChange:e=>Ce({...ve,start:e||void 0}),placeholder:"04-01",bad:!!ve.start&&!U.test(ve.start)})]}),Y.map(e=>{const s=ve.hours?.[e]??null,t=s=>Ce({...ve,hours:{...ve.hours,[e]:s}});return(0,W.jsxs)(j.Row,{gap:6,style:{flexWrap:'wrap'},children:[(0,W.jsx)(j.T,{style:{width:44},children:G[e]}),(0,W.jsx)(j.Chip,{label:s?'Open':'Closed',selected:!!s,onPress:()=>t(s?null:['12:00','19:00'])}),s?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(q,{label:`${T.DAYS[e]} opens`,value:s[0],width:74,onChange:e=>t([e,s[1]]),bad:!H.test(s[0])}),(0,W.jsx)(j.Muted,{children:"to"}),(0,W.jsx)(q,{label:`${T.DAYS[e]} last food orders`,value:s[1],width:74,onChange:e=>t([s[0],e]),bad:!H.test(s[1])||s[0]>=s[1]})]}):null]},e)}),Re?(0,W.jsx)(j.T,{size:13,colour:D.colours.red,children:Re}):null,(0,W.jsxs)(j.Row,{gap:6,children:[(0,W.jsx)(j.Button,{small:!0,label:"Save hours",disabled:!!Re,testID:"season-save",onPress:()=>{var e;e=we.map(e=>e.id===ve.id?ve:e),X({hourSets:e}),Ce(null),ae(`Saved ${ve.name} hours.`)}}),(0,W.jsx)(j.Button,{small:!0,kind:"ghost",label:"Cancel",onPress:()=>Ce(null)})]})]}):null,(0,W.jsx)(j.T,{weight:"semibold",style:{marginTop:6},children:"Special days"}),(0,W.jsx)(j.Muted,{size:13,children:"One-off changes, e.g. closed for a private party or open late on Hogmanay."}),De.map(e=>(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsxs)(j.T,{style:{flex:1},children:[e.date,": ",e.hours?`${e.hours[0]}\u2013${e.hours[1]}`:'kitchen closed',e.note?` \xb7 ${e.note}`:'']}),(0,W.jsx)(j.Button,{small:!0,kind:"ghost",label:"Remove",onPress:()=>X({hourOverrides:De.filter(s=>s.date!==e.date)})})]},e.date)),Se?(0,W.jsxs)(j.Card,{highlight:D.colours.gold,children:[(0,W.jsxs)(j.Row,{gap:8,children:[(0,W.jsx)(j.Muted,{children:"Date (DD/MM/YYYY)"}),(0,W.jsx)(q,{label:"Special day date",width:130,value:(0,t.slashDay)(Se.date),onChange:e=>{const s=(0,t.slashDate)(e,(0,t.slashDay)(Se.date));Te({...Se,date:(0,t.dayFromSlash)(s)??s})},placeholder:"31/12/2026",bad:!_.test(Se.date)})]}),(0,W.jsxs)(j.Row,{gap:6,style:{flexWrap:'wrap'},children:[(0,W.jsx)(j.Chip,{label:Se.hours?'Open':'Closed',selected:!!Se.hours,onPress:()=>Te({...Se,hours:Se.hours?null:['12:00','19:00']})}),Se.hours?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(q,{label:"Opens",width:74,value:Se.hours[0],onChange:e=>Te({...Se,hours:[e,Se.hours[1]]})}),(0,W.jsx)(j.Muted,{children:"to"}),(0,W.jsx)(q,{label:"Last food orders",width:74,value:Se.hours[1],onChange:e=>Te({...Se,hours:[Se.hours[0],e]})})]}):null]}),(0,W.jsxs)(j.Row,{gap:8,children:[(0,W.jsx)(j.Muted,{children:"Note"}),(0,W.jsx)(q,{label:"Note",width:220,value:Se.note??'',onChange:e=>Te({...Se,note:e||void 0}),placeholder:"Private party"})]}),(()=>{const e=_.test(Se.date)?Se.hours&&(!H.test(Se.hours[0])||!H.test(Se.hours[1])||Se.hours[0]>=Se.hours[1])?'Check the times.':'':'Date looks wrong (use 2026-12-31).';return(0,W.jsxs)(W.Fragment,{children:[e?(0,W.jsx)(j.T,{size:13,colour:D.colours.red,children:e}):null,(0,W.jsxs)(j.Row,{gap:6,children:[(0,W.jsx)(j.Button,{small:!0,label:"Save special day",disabled:!!e,onPress:()=>{X({hourOverrides:[...De.filter(e=>e.date!==Se.date),Se].sort((e,s)=>e.date.localeCompare(s.date))}),Te(null)}}),(0,W.jsx)(j.Button,{small:!0,kind:"ghost",label:"Cancel",onPress:()=>Te(null)})]})]})})()]}):(0,W.jsx)(j.Button,{small:!0,kind:"secondary",label:"\uff0b Add a special day",testID:"override-add",onPress:()=>Te({date:O,hours:null})}),(0,W.jsx)(j.T,{weight:"semibold",style:{marginTop:6},children:"Earlier last food orders (optional)"}),(0,W.jsx)(j.Muted,{size:13,children:"Leave blank to use the kitchen closing time. Regular events can set their own (Open Mic Night: 7pm)."}),(0,W.jsx)(j.Row,{wrap:!0,gap:8,children:Y.map(e=>(0,W.jsxs)(y.default,{style:{gap:2},children:[(0,W.jsx)(j.Muted,{size:12,children:G[e]}),(0,W.jsx)(q,{label:`${T.DAYS[e]} last food orders`,width:74,value:J.lastFoodByDay?.[e]??'',placeholder:"\u2014",bad:!!J.lastFoodByDay?.[e]&&!H.test(J.lastFoodByDay[e]),onChange:s=>X({lastFoodByDay:{...J.lastFoodByDay??{},[e]:s||void 0}})})]},e))}),Me?(0,W.jsx)(j.T,{size:13,colour:D.colours.red,children:"Use times like 19:00 (blank = kitchen close)."}):null,(0,W.jsx)(j.Muted,{children:"After last food orders, booking times are\u2026"}),(0,W.jsxs)(j.Row,{gap:6,children:[(0,W.jsx)(j.Chip,{label:"Offered for drinks only",selected:'drinks'===(0,T.afterLastFood)(x),onPress:()=>X({afterLastFood:'drinks'})}),(0,W.jsx)(j.Chip,{label:"Not offered",selected:'block'===(0,T.afterLastFood)(x),onPress:()=>X({afterLastFood:'block'})})]})]}),Oe=(0,W.jsxs)(y.default,{style:{gap:8},children:[(0,W.jsx)(j.Toggle,{label:"COVERS counter on Today (done / to come / total)",value:(0,T.coversCounterOn)(x),onChange:e=>X({coversCounter:e})}),(0,W.jsx)(j.Toggle,{label:"\u2018Next table free\u2019 when you\u2019re full",value:(0,T.nextTableOn)(x),onChange:e=>X({nextTableFree:e})}),(0,W.jsx)(j.Toggle,{label:"Show takeaway on home screens",value:(0,T.showTakeaway)(x),onChange:e=>X({showTakeaway:e})}),(0,W.jsx)(j.Muted,{size:13,children:"Takeaway order alerts always work. With this off, takeaway figures sit in a collapsed Takeaway section."}),(0,W.jsx)(j.Muted,{size:13,children:"The flap click sound is set on each Display (Display settings), off by default."})]}),Ie=(0,W.jsxs)(y.default,{style:{gap:8},children:[(0,W.jsx)(j.Toggle,{label:"Show full gov.uk names, e.g. \u2018(substitute day)\u2019",value:!!J.holidayFullNames,onChange:e=>X({holidayFullNames:e})}),(0,W.jsx)(j.Muted,{size:13,children:"Off: \u201cChristmas Day\u201d shows on its date without \u201c(substitute day)\u201d."})]}),[ze,$e]=(0,m.useState)(null),Ae=ze??J.whatsapp??'',Be=!Ae.trim()||!!(0,L.waNumber)(Ae),Fe=(0,W.jsxs)(y.default,{style:{gap:8},children:[(0,W.jsx)(j.T,{children:"The venue\u2019s WhatsApp number"}),(0,W.jsxs)(j.Row,{gap:8,wrap:!0,children:[(0,W.jsx)(q,{label:"Venue WhatsApp number",testID:"adv-whatsapp-number",width:220,value:Ae,placeholder:"e.g. 01292 500123 or +44 7\u2026",bad:!Be,onChange:e=>{$e(e),e.trim()?(0,L.waNumber)(e)&&X({whatsapp:e.trim()}):X({whatsapp:void 0})}}),Ae.trim()&&Be?(0,W.jsx)(j.Badge,{kind:"gold",label:`wa.me/${(0,L.waNumber)(Ae)}`}):null]}),Be?null:(0,W.jsx)(j.T,{size:13,colour:D.colours.red,children:"That doesn\u2019t look like a phone number. Use the full number, e.g. 01292 500123 or +44 7700 900123."}),(0,W.jsx)(j.Muted,{size:13,children:"With a number here, guests see \u201cMessage us on WhatsApp\u201d on their booking confirmation, and staff and managers see \u201cWhatsApp guest\u201d on bookings that have a mobile number. Blank: all WhatsApp buttons stay hidden."}),(0,W.jsx)(j.Muted,{size:13,children:"Tip: nothing is ever sent for you. The button opens WhatsApp with a message typed in, and the person taps Send themselves."})]}),Ee=(0,N.soldOutSettingsOf)(J.soldOut),Ne=(0,W.jsxs)(y.default,{style:{gap:8},children:[(0,W.jsx)(j.Toggle,{testID:"adv-soldout-auto",label:"Mark dishes sold out from the counts",value:Ee.auto,onChange:e=>X({soldOut:{...Ee,auto:e}}),a11y:"Mark dishes sold out from the live counts"}),(0,W.jsx)(j.Muted,{size:13,children:Ee.auto?'On: when a count (lobster, crab\u2026) runs out or drops below what a dish needs, every dish that uses it is marked sold out, with the reason, e.g. \u201cDeluxe Seafood Platter (no lobster)\u201d. It goes back on when the count is back up. Dishes marked by hand are left alone. Change which dishes use what in any Sold out list.':'Off: dishes are only marked sold out by hand. Dishes marked from the counts go back on.'}),(0,W.jsx)(j.T,{children:"Clear sold out dishes by themselves"}),(0,W.jsx)(j.Row,{wrap:!0,gap:8,children:['close','morning','manual'].map(e=>(0,W.jsx)(j.Chip,{testID:`adv-soldout-${e}`,label:N.SOLD_OUT_CLEAR_LABEL[e],selected:Ee.clear===e,onPress:()=>X({soldOut:{...Ee,clear:e}})},e))}),'manual'!==Ee.clear?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(j.T,{children:"Next morning means"}),(0,W.jsx)(j.Row,{wrap:!0,gap:8,children:['04:00','05:00','06:00','08:00'].map(e=>(0,W.jsx)(j.Chip,{label:e,selected:Ee.morningAt===e,onPress:()=>X({soldOut:{...Ee,morningAt:e}})},e))})]}):null,(0,W.jsx)(j.Muted,{size:13,children:'close'===Ee.clear?'Dishes go back on at the kitchen\u2019s closing time that day (from Kitchen hours). Marked after closing: the next morning.':'morning'===Ee.clear?`Dishes go back on at ${Ee.morningAt} the next morning.`:'Dishes stay sold out until someone taps Back on.'}),(0,W.jsx)(j.Muted,{size:13,children:"Tip: Sold out is a reminder for staff. It shows on the Display\u2019s slim strip and in every staff app\u2019s Sold out list. CoverCharge doesn\u2019t link up to your till, so it doesn\u2019t change the till."})]}),We=(0,s.venueBusy)(x,le,new Date),He=(0,E.clampWeeks)(J.forecastMinWeeks),Ue=(0,W.jsxs)(y.default,{style:{gap:8},children:[(0,W.jsxs)(y.default,{testID:"busy-level-setting",style:{alignItems:'center',gap:12},accessible:!0,accessibilityLabel:We.words,children:[(0,W.jsx)(j.T,{center:!0,size:20,weight:"semibold",children:We.words}),(0,W.jsx)(j.Stepper,{testID:"busy-covers-hour",label:"Busy level in Covers an hour",value:J.busyCoversPerHour??30,min:1,max:200,onChange:e=>X({busyCoversPerHour:e,busyLearning:!1})}),(0,W.jsx)(j.Muted,{children:"Learning starts from your chosen level; enabling it starts a fresh history period, so older trading patterns do not immediately replace your choice."}),(0,W.jsx)(j.Toggle,{label:"Learn the busy level from our real history",value:!1!==J.busyLearning,onChange:e=>X({busyLearning:e,busyLearningSince:(new Date).toISOString().slice(0,10)})}),(0,W.jsx)(j.T,{center:!0,size:16,children:"Steady starts at half the busy level. Busy starts at the busy level. Hourly forecasts use the upper end of their range."}),(0,W.jsx)(j.T,{center:!0,size:16,children:"Learning needs at least 4 weeks, 16 trading days and 40 recorded hours. It uses the 85th percentile of recorded hourly arrivals over the last 8 weeks, including walk-ins, excluding cancellations and no-shows. Changing the number keeps your override until learning is switched on again."}),We.enough?null:(0,W.jsx)(j.T,{center:!0,size:16,children:"Not enough real hourly history to learn yet. Using the starting or owner-set level."})]}),(0,W.jsx)(j.T,{children:"History needed before forecasts show"}),(0,W.jsx)(j.Row,{wrap:!0,gap:8,children:[1,2,3,4,6,8].map(e=>(0,W.jsx)(j.Chip,{testID:`adv-forecast-weeks-${e}`,label:1===e?'1 week':`${e} weeks`,selected:He===e,onPress:()=>X({forecastMinWeeks:e})},e))}),(0,W.jsx)(j.Muted,{size:13,children:`Forecasts, expected walk-ins and labour vs sales start once CoverCharge has ${1===He?'1 week':`${He} weeks`} of your bookings (and cash-ups for sales). Until then you see what is booked and your real labour cost, never invented figures.`}),(0,W.jsx)(j.Muted,{size:13,children:"Tip: 2 weeks is a sensible start. More weeks give steadier forecasts but take longer to begin."}),(0,W.jsx)(l.ForecastDaySettings,{r:x,set:X})]}),Ye=(0,w.depositOf)(J),Ge=e=>X({deposit:{...Ye,...e}}),qe=o.IS_GREENSIDE?(0,W.jsx)(a.GreensideCashOnly,{}):(0,W.jsxs)(y.default,{style:{gap:8},children:[(0,W.jsx)(j.Toggle,{testID:"adv-deposit-on",label:"Ask bigger tables for a deposit",value:Ye.on,onChange:e=>Ge({on:e})}),(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(j.T,{children:"Amount per adult"}),(0,W.jsx)(j.Stepper,{testID:"adv-deposit-amount",value:Ye.perPersonPence/100,min:0,max:100,format:e=>`\xa3${e}`,onChange:e=>Ge({perPersonPence:100*e}),label:"deposit per person"})]}),(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(j.T,{children:"From this many adults"}),(0,W.jsx)(j.Stepper,{testID:"adv-deposit-party",value:Ye.fromParty,min:1,max:30,onChange:e=>Ge({fromParty:e}),label:"deposit from this many adults"})]}),(0,W.jsx)(j.T,{children:"Refundable?"}),(0,W.jsxs)(j.Row,{wrap:!0,gap:8,children:[(0,W.jsx)(j.Chip,{testID:"adv-deposit-ref-yes",label:"Yes",selected:!0===Ye.refundable,onPress:()=>Ge({refundable:!0})}),(0,W.jsx)(j.Chip,{testID:"adv-deposit-ref-no",label:"No",selected:!1===Ye.refundable,onPress:()=>Ge({refundable:!1,cutoffHours:null})}),(0,W.jsx)(j.Chip,{testID:"adv-deposit-ref-unset",label:"Not set yet",selected:null===Ye.refundable,onPress:()=>Ge({refundable:null,cutoffHours:null})})]}),!0===Ye.refundable?(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(j.T,{children:"Refunded if cancelled this many hours before"}),(0,W.jsx)(j.Stepper,{testID:"adv-deposit-cutoff",value:Ye.cutoffHours??0,min:0,max:168,step:6,format:e=>e?`${e} h`:'Any time',onChange:e=>Ge({cutoffHours:e||null}),label:"refund cut-off hours"})]}):null,(0,W.jsx)(j.T,{children:"Words guests see (optional)"}),(0,W.jsx)(n.TextInput,{accessibilityLabel:"Deposit policy shown to guests",testID:"adv-deposit-policy",value:Ye.policy,multiline:!0,onChangeText:e=>Ge({policy:e.slice(0,600)}),placeholder:"e.g. The deposit comes off your bill on the night.",placeholderTextColor:D.colours.muted,style:{minHeight:70,borderRadius:10,borderWidth:1,borderColor:D.colours.hairline,backgroundColor:D.colours.surface2,color:D.colours.text,padding:10,fontSize:15}}),(0,W.jsx)(j.Muted,{size:13,children:Ye.on&&Ye.perPersonPence>0?`Guests booking for ${Ye.fromParty} or more adults see: \u201c${(0,w.depositWords)(Ye,Ye.fromParty,x.name).join(' ')}\u201d`:'Off: no booking asks for a deposit.'}),(0,W.jsx)(j.Toggle,{testID:"adv-deposit-wixlinks",label:"Send website bookings deposit links for phone and walk-in bookings",a11y:"Send website bookings deposit links for phone and walk-in bookings",value:!!Ye.wixLinksOn,onChange:e=>Ge({wixLinksOn:e})}),Ye.wixLinksOn?(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(j.T,{children:"Link works for"}),(0,W.jsx)(j.Stepper,{testID:"adv-deposit-linkhours",value:Ye.wixLinkHours??48,min:6,max:168,step:6,format:e=>`${e} hours`,onChange:e=>Ge({wixLinkHours:e}),label:"hours a deposit link works"})]}):null,(0,W.jsx)(j.Muted,{size:13,children:Ye.wixLinksOn?'On here, but website bookings deposit links also need the server switch, which stays off until the first \xa31 test is approved. Until then the button says so and nothing goes to website bookings.':'Off: no deposit links. Bookings work as before.'}),(0,W.jsx)(j.Muted,{size:13,children:"Tip: deposits are paid through website bookings, never in CoverCharge, and no card is saved. Guests who book on your website pay there, and the booking shows Deposit paid on website bookings by itself. For phone and walk-in bookings, tick Deposit paid once the guest has paid you, or send a website bookings deposit link. Refunds are done in Website bookings \u203a Orders. Deposit amounts are shown on bookings in Managers, Display and Staff. This does not grant access to other financial or HR information."})]}),Ke=(0,W.jsx)(k.LoyaltySettingsPanel,{}),Qe=(0,W.jsx)(se,{rid:P}),Ve=[{id:'bookings',title:'Bookings',words:'allergen allergy dog dogs cap limit access wheelchair step-free vegan vegetarian veg table request',reset:['dogQuestion','maxDogsPerSlot','accessQuestion','dietQuestion','tableRequests'],body:re,help:'adv-bookings'},{id:'times',title:'Table times',words:'dwell table time turn how long minutes party size next table free',reset:['dwellBands','dwellLearn'],body:he,help:'adv-table-times'},{id:'reserve',title:'Reservable items',words:'platter seafood crab lobster reserve price stock',reset:['reservables','reserveStock'],body:ge,help:'adv-reservable'},{id:'events',title:'Regular events',words:'open mic night music night event repeat monthly weekly promote busier forecast last food',reset:['regularEvents'],body:je,help:'adv-events'},{id:'hours',title:'Kitchen hours & last food orders',words:'hours kitchen season winter summer open close closed special day last food orders cutoff drinks',reset:['hourSets','hourOverrides','lastFoodByDay','afterLastFood'],body:Pe,help:'adv-hours'},{id:'home',title:'Display & home',words:'covers counter flip sound takeaway next table free home display',reset:['coversCounter','nextTableFree','showTakeaway'],body:Oe,help:'adv-home'},{id:'deposits',title:'Deposits',words:'deposit deposits per person party size refund refundable cut off policy paid due booking money wix link pay link online',reset:['deposit'],body:qe,help:'adv-deposits'},{id:'loyalty',title:'Loyalty: stamp card, offers & bring a friend',words:'loyalty stamp stamps card reward rewards offer offers referral refer friend bring expiry',reset:[],body:Ke,help:'adv-loyalty',noReset:!0},{id:'tableorder',title:'Order at the table',words:'order at table qr code scan phone guest menu tables areas accept first order last orders kitchen cut off print sheet pdf pay bar till',reset:[],body:o.IS_GREENSIDE?(0,W.jsx)(a.GreensideCashOnly,{}):(0,W.jsx)(r.TableOrderSettings,{rid:P,me:V}),help:'adv-table-order',noReset:!0},{id:'whatsapp',title:'WhatsApp',words:'whatsapp wa.me message chat guest phone mobile number tap',reset:['whatsapp'],body:Fe,help:'adv-whatsapp'},{id:'reminders',title:'Reminders',words:'reminder reminders break breaks chairs tables close closing shift staff nudge 6 hours law snooze later done',reset:[],body:Qe,help:'adv-reminders',onReset:()=>Z(P)},{id:'notifications',title:'Notifications',words:'notification notifications push phone scheduled order milk mills pieroni pieronis fish veg olsen rota upload remind time send',reset:[],body:(0,W.jsx)(B.NotificationsSettings,{rid:P}),help:'adv-notifications',onReset:()=>F.useNotifs.getState().resetSeeds(P)},{id:'orderlists',title:'Order lists',words:'order list lists alsons drinks cash carry trip shopping supplier logo staff add',reset:[],body:(0,W.jsx)(B.OrderListsSettings,{rid:P}),help:'adv-order-lists',onReset:()=>(0,B.resetOrderLists)(P)},{id:'tasks',title:'Tasks',words:'daily tasks library jobs checklist duties to do todo',reset:[],body:(0,W.jsx)(c.TaskLibrarySettings,{rid:P}),help:'adv-tasks',onReset:()=>b.useDailyTasks.getState().resetLibrary(P)},{id:'cashup',title:'Cash up',words:'cash up sheet takings till float card cash tips weekly sales report pos printout figures fields vat covers',reset:[],body:(0,W.jsx)(p.CashUpSettings,{rid:P}),help:'adv-cashup',onReset:()=>g.useCashUp.getState().resetFields(P)},{id:'tips',title:'Tips',words:'tips pot today tips show hide staff apps payout correction',reset:[],body:(0,W.jsx)(p.TipsSettings,{rid:P}),help:'adv-tips',onReset:()=>g.useCashUp.getState().setShow(P,{showToday:!0,showPot:!0})},{id:'clockarea',title:'Clock-in area',words:'clock in out geofence location area radius gps break forgot forgotten rota visiting map',reset:[],body:(0,W.jsx)(B.ClockAreaSettings,{rid:P,me:V}),help:'adv-clock-area',onReset:()=>(0,B.resetClockArea)(P,V)},{id:'checkout',title:'Shift check-out & question board',words:'check out checkout morale mood staffing staff enough overstaffed survey anonymous question board vote shout out shoutout wellbeing hr wording',reset:['hr'],body:(0,W.jsx)(u.HrSettingsCard,{rid:P}),help:'adv-checkout'},{id:'forecast',title:'Forecast history',words:'forecast history weeks estimate walk-ins opening hours minimum covers floor saturday sunday labour sales example figures not enough history',reset:['forecastMinWeeks'],body:Ue,help:'adv-forecast'},{id:'soldout',title:'Sold out reminders',words:'sold out 86 eighty six run out ran out back on clear end of service morning display strip auto automatic counts shellfish lobster crab platter link uses',reset:['soldOut'],body:Ne,help:'adv-soldout'},{id:'tablegrid',title:'Table plan grid',words:'table plan grid snap line up align tidy tables floor layout guides spacing restore',reset:[],body:(0,W.jsx)(z.GridSettings,{rid:P,me:V}),help:'adv-tablegrid',onReset:()=>{const e=A.useFloor.getState().settings[P];A.useFloor.getState().setSettings(P,{...A.DEFAULT_SETTINGS,...e??{},gridSnap:!0,gridSize:25})}},{id:'printers',title:'Printers',words:'print printer printers printing ticket tickets kitchen ticket docket receipt epson star bluetooth wifi reprint takeaway auto front of house copies',reset:[],body:(0,W.jsx)($.PrintersSettings,{rid:P,go:e}),help:'adv-printers',onReset:()=>{const e=A.useFloor.getState().settings[P];e&&A.useFloor.getState().setSettings(P,{...e,printing:void 0})}},{id:'blocks',title:'Block bookings: lunch, dinner and website bookings',words:'block blocks blocked pause close lunch dinner service times wix website online push',reset:[],noReset:!0,body:(0,W.jsx)(d.BlockSettings,{rid:P}),help:'adv-blocks'},{id:'giftqr',title:'Gift cards on the Display',words:'gift card cards voucher qr code display buy sell wix website page link',reset:[],noReset:!0,body:(0,W.jsx)(i.GiftQrSettings,{rid:P}),help:'adv-giftqr'},{id:'holidays',title:'Holiday names',words:'bank holiday substitute day names',reset:['holidayFullNames'],body:Ie,help:'adv-holidays'}],Ze=ee.trim().toLowerCase(),Je=(0,m.useMemo)(()=>Ve.filter(e=>!Ze||`${e.title} ${e.words}`.toLowerCase().includes(Ze)),[Ze,Ve]);return(0,W.jsxs)(y.default,{style:{gap:12},testID:"advanced-settings",children:[(0,W.jsx)(j.Muted,{children:"Owners and managers only. Changes are shared with your team\u2019s devices."}),(0,W.jsx)(n.TextInput,{accessibilityLabel:"Search settings",testID:"advanced-search",value:ee,onChangeText:te,placeholder:"Search, e.g. dogs, Open Mic Night, hours",placeholderTextColor:D.colours.muted,style:{minHeight:46,borderRadius:12,borderWidth:1,borderColor:D.colours.accentBorder,backgroundColor:D.colours.surface2,color:D.colours.text,paddingHorizontal:12,fontSize:16}}),oe?(0,W.jsx)(j.Banner,{kind:"success",title:oe}):null,Je.length?null:(0,W.jsxs)(j.Muted,{children:["No settings match \u201c",ee,"\u201d."]}),Je.map(s=>(0,W.jsx)(j.Card,{children:(0,W.jsxs)(y.default,{testID:`adv-${s.id}`,style:{gap:10},children:[(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(j.T,{size:17,weight:"semibold",colour:D.colours.gold,children:s.title}),e?(0,W.jsx)(f.default,{accessibilityRole:"button",accessibilityLabel:`Help: ${s.title}`,onPress:()=>e('more','help'),hitSlop:8,style:{minHeight:44,minWidth:44,justifyContent:'center'},children:(0,W.jsx)(j.T,{colour:D.colours.muted,children:"? Help"})}):null]}),s.body,s.noReset?null:(0,W.jsx)(j.Row,{style:{justifyContent:'flex-end'},children:(0,W.jsx)(j.Button,{small:!0,kind:"ghost",label:"Reset to default",testID:`reset-${s.id}`,onPress:()=>ne(s)})})]})},s.id))]})},Object.defineProperty(_e,"ADVANCED_DEFAULTS",{enumerable:!0,get:function(){return V}}),_e.SeasonsTodo=function({go:e}){const{r:s}=(0,R.useCtx)(6e4),t=(0,C.hourSetsOf)(s),o=[],a=t.filter(e=>!e.hours).map(e=>e.name);a.length&&o.push(`${a.join(' and ')} kitchen hours`);t.length>1&&t.some(e=>!e.start)&&o.push('the date each season starts');return o.length?(0,W.jsx)(j.Card,{onPress:()=>e('more','advanced'),highlight:D.colours.gold,children:(0,W.jsxs)(y.default,{testID:"seasons-todo",style:{gap:4},children:[(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},children:[(0,W.jsx)(j.T,{weight:"semibold",colour:D.colours.gold,children:"Setup checklist: kitchen hours"}),(0,W.jsx)(j.T,{colour:D.colours.muted,children:"\u203a"})]}),(0,W.jsxs)(j.Muted,{size:13,children:["Please add ",o.join(' and ')," (Settings \u203a Advanced \u203a Kitchen hours). Until then the app uses the Winter hours all year."]})]})}):null};var s=_r(_d[0]),t=_r(_d[1]),o=_r(_d[2]),a=_r(_d[3]),n=_r(_d[4]),l=_r(_d[5]),r=_r(_d[6]),i=_r(_d[7]),d=_r(_d[8]),h=_r(_d[9]),u=_r(_d[10]),c=_r(_d[11]),p=_r(_d[12]),g=_r(_d[13]),b=_r(_d[14]),m=_r(_d[15]),x=e(m),f=e(_r(_d[16])),y=e(_r(_d[17])),j=_r(_d[18]),w=_r(_d[19]),k=_r(_d[20]),v=_r(_d[21]),C=_r(_d[22]),S=_r(_d[23]),T=_r(_d[24]),D=_r(_d[25]),R=_r(_d[26]),M=_r(_d[27]),L=_r(_d[28]),P=_r(_d[29]),O=_r(_d[30]),I=_r(_d[31]),z=_r(_d[32]),$=_r(_d[33]),A=_r(_d[34]),B=_r(_d[35]),F=_r(_d[36]),E=_r(_d[37]),N=_r(_d[38]),W=_r(_d[39]);const H=/^([01]\d|2[0-3]):[0-5]\d$/,U=/^(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/,_=/^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/,Y=[1,2,3,4,5,6,0],G=['Sun','Mon','Tue','Wed','Thu','Fri','Sat'];function q({value:e,onChange:s,placeholder:t,label:o,width:a=90,bad:l,testID:r}){return(0,W.jsx)(n.TextInput,{accessibilityLabel:o,testID:r,value:e,onChangeText:s,placeholder:t,placeholderTextColor:D.colours.muted,style:{width:a,minHeight:44,borderRadius:10,borderWidth:1,borderColor:l?D.colours.red:D.colours.hairline,backgroundColor:D.colours.surface2,color:D.colours.text,paddingHorizontal:10,fontSize:15}})}function K({value:e,onChange:s,min:t,max:o,unit:a,label:n,step:l=5}){const r=(a,l)=>(0,W.jsx)(f.default,{accessibilityRole:"button",accessibilityLabel:`${l<0?'Less':'More'}: ${n}`,onPress:()=>s(Math.min(o,Math.max(t,e+l))),style:{width:44,height:44,borderRadius:10,borderWidth:1,borderColor:D.colours.accentBorder,alignItems:'center',justifyContent:'center'},children:(0,W.jsx)(j.T,{size:20,colour:D.colours.gold,children:a})});return(0,W.jsxs)(j.Row,{gap:8,children:[r('\u2212',-l),(0,W.jsx)(j.T,{weight:"semibold",style:{minWidth:76,textAlign:'center'},children:a(e)}),r('+',l)]})}const Q=e=>e%60?`${Math.floor(e/60)}h ${e%60}m`:`${e/60} hour${60===e?'':'s'}`;const V={DEFAULT_DWELL:T.DEFAULT_DWELL,ANCHORAGE_SEASONS:C.ANCHORAGE_SEASONS};function Z(e){const s=P.useReminders.getState();s.ensure(e),s.resetRules(e),s.resetReminder((0,P.chairsId)(e))}const J=[1,2,3,4,5,6,0],X=e=>`${7===e.days.length?'Every day':J.filter(s=>e.days.includes(s)).map(e=>O.DAY_NAMES[e]).join(', ')||'No days'} at ${e.time} (UK time) \xb7 ${O.AUDIENCE_LABEL[e.audience]}`;function ee({init:e,onSave:s,onCancel:t}){const[o,a]=(0,m.useState)(e.text),[l,r]=(0,m.useState)(e.days),[i,d]=(0,m.useState)(e.time),[h,u]=(0,m.useState)(e.audience),c=o.trim().length>1&&l.length>0&&(0,O.validTime)(i);return(0,W.jsxs)(y.default,{testID:"reminder-editor",style:{gap:8,borderWidth:1,borderColor:D.colours.accentBorder,borderRadius:12,padding:10},children:[(0,W.jsx)(j.T,{weight:"semibold",children:"What it says"}),(0,W.jsx)(n.TextInput,{accessibilityLabel:"Reminder wording",testID:"reminder-text",value:o,onChangeText:a,maxLength:120,placeholder:"e.g. Time to put the chairs up on the tables",placeholderTextColor:D.colours.muted,style:{minHeight:44,borderRadius:10,borderWidth:1,borderColor:D.colours.hairline,backgroundColor:D.colours.surface2,color:D.colours.text,paddingHorizontal:10,fontSize:15}}),(0,W.jsx)(j.T,{weight:"semibold",children:"Days"}),(0,W.jsx)(j.Row,{wrap:!0,gap:6,children:J.map(e=>(0,W.jsx)(j.Chip,{label:O.DAY_NAMES[e],selected:l.includes(e),onPress:()=>r(l.includes(e)?l.filter(s=>s!==e):[...l,e])},e))}),(0,W.jsxs)(j.Row,{gap:8,children:[(0,W.jsx)(j.T,{weight:"semibold",children:"Time (UK)"}),(0,W.jsx)(q,{label:"Reminder time",testID:"reminder-time",value:i,onChange:d,placeholder:"21:00",bad:!(0,O.validTime)(i)})]}),(0,W.jsx)(j.T,{weight:"semibold",children:"Who sees it"}),(0,W.jsx)(j.Row,{wrap:!0,gap:6,children:['all','foh','kitchen'].map(e=>(0,W.jsx)(j.Chip,{label:O.AUDIENCE_LABEL[e],selected:h===e,onPress:()=>u(e)},e))}),c?null:(0,W.jsx)(j.Muted,{size:13,children:"Add the wording, at least one day and a time like 21:00."}),(0,W.jsxs)(j.Row,{gap:8,style:{justifyContent:'flex-end'},children:[(0,W.jsx)(j.Button,{small:!0,kind:"ghost",label:"Cancel",onPress:t}),(0,W.jsx)(j.Button,{small:!0,label:"Save reminder",testID:"reminder-save",disabled:!c,onPress:()=>s({text:o.trim(),days:[...l].sort(),time:i,audience:h})})]})]})}function se({rid:e}){x.default.useEffect(()=>{P.useReminders.getState().ensure(e)},[e]);const s=(0,P.useReminders)(e=>e.reminders),t=s.filter(s=>s.rid===e&&!s.removed),o=(0,P.useReminders)(s=>s.rules[e]),a=(0,O.clampRules)(o??O.DEFAULT_BREAK_RULES),n=(0,P.useReminders)(e=>e.done).filter(s=>s.rid===e).slice(0,5),l=(0,I.useOwner)(e=>e.staff),r=P.useReminders.getState(),[i,d]=(0,m.useState)(null),[h,u]=(0,m.useState)(null),c=s=>r.setRules(e,s);return(0,W.jsxs)(y.default,{style:{gap:10},testID:"reminders-settings",children:[(0,W.jsx)(j.Muted,{size:13,children:"Reminders slide up on the phones of staff who are on shift right now (clocked in, or on the rota at that time), in the Staff and Head Chef apps, while the app is open."}),(0,W.jsx)(j.T,{weight:"semibold",children:"Break reminders"}),(0,W.jsx)(j.Toggle,{label:"Remind staff to take their break",value:a.on,onChange:e=>c({on:e})}),(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},wrap:!0,children:[(0,W.jsx)(j.T,{center:!0,style:{width:'100%'},children:"First reminder, if the rota has no break time"}),(0,W.jsx)(K,{label:"first break reminder",step:15,min:30,max:O.LEGAL_LIMIT_MINS,value:a.afterMins,unit:e=>`${Q(e)} in`,onChange:e=>c({afterMins:e})})]}),(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},wrap:!0,children:[(0,W.jsx)(j.T,{style:{flex:1},children:"Remind once more after"}),(0,W.jsx)(K,{label:"second break reminder",step:5,min:5,max:120,value:a.repeatMins,unit:e=>`${e} min`,onChange:e=>c({repeatMins:e})})]}),(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},wrap:!0,children:[(0,W.jsx)(j.T,{style:{flex:1},children:"\u2018Later\u2019 hides it for"}),(0,W.jsx)(K,{label:"snooze",step:5,min:5,max:60,value:a.snoozeMins,unit:e=>`${e} min`,onChange:e=>c({snoozeMins:e})})]}),(0,W.jsxs)(j.Muted,{size:13,children:["How it works: if the shift on the rota has a break time, the reminder comes at that time. If not, it comes ",Q(a.afterMins)," after they clock in (or after the shift starts, if they haven\u2019t clocked in). If they still haven\u2019t started a break, it comes once more ",a.repeatMins," minutes later, and again at 6 hours. Nobody works more than 6 hours without a reminder: UK law says a shift over 6 hours needs a 20-minute break. \u2018Start break\u2019 starts their break, the same as on the clock screen."]}),(0,W.jsx)(j.T,{weight:"semibold",style:{marginTop:6},children:"Venue reminders"}),t.map(e=>(0,W.jsx)(y.default,{testID:`reminder-${e.builtIn??e.id}`,style:{gap:6,borderBottomWidth:1,borderColor:D.colours.hairline,paddingBottom:8},children:i===e.id?(0,W.jsx)(ee,{init:e,onCancel:()=>d(null),onSave:s=>{r.update(e.id,s),d(null)}}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(j.Row,{style:{justifyContent:'space-between'},gap:8,children:[(0,W.jsx)(j.T,{weight:"semibold",style:{flex:1},children:e.text}),e.paused?(0,W.jsx)(j.Badge,{kind:"amber",label:"PAUSED"}):null]}),(0,W.jsx)(j.Muted,{size:13,children:X(e)}),h===e.id?(0,W.jsxs)(j.Row,{gap:8,wrap:!0,children:[(0,W.jsx)(j.T,{size:14,style:{flex:1},children:"Delete this reminder?"}),(0,W.jsx)(j.Button,{small:!0,kind:"danger",label:"Yes, delete it",onPress:()=>{r.remove(e.id),u(null)}}),(0,W.jsx)(j.Button,{small:!0,kind:"ghost",label:"Keep it",onPress:()=>u(null)})]}):(0,W.jsxs)(j.Row,{gap:8,wrap:!0,children:[(0,W.jsx)(j.Button,{small:!0,kind:"secondary",label:"Edit",testID:"reminder-edit",onPress:()=>d(e.id)}),(0,W.jsx)(j.Button,{small:!0,kind:"secondary",label:e.paused?'Resume':'Pause',onPress:()=>r.update(e.id,{paused:!e.paused})}),(0,W.jsx)(j.Button,{small:!0,kind:"ghost",label:"Delete",onPress:()=>u(e.id)})]})]})},e.id)),t.length?null:(0,W.jsx)(j.Muted,{children:"No venue reminders. Add one below, or Reset to default to bring back \u201cchairs up\u201d."}),'new'===i?(0,W.jsx)(ee,{init:{text:'',days:[5,6],time:'21:00',audience:'all'},onCancel:()=>d(null),onSave:s=>{r.add(e,s),d(null)}}):(0,W.jsx)(j.Button,{small:!0,kind:"secondary",label:"\uff0b Add a reminder",testID:"reminder-add",onPress:()=>d('new')}),n.length?(0,W.jsxs)(y.default,{style:{gap:2},children:[(0,W.jsx)(j.T,{weight:"semibold",children:"Recently done"}),n.map(e=>(0,W.jsxs)(j.Muted,{size:13,children:[new Date(e.at).toLocaleString('en-GB',{weekday:'short',day:'numeric',month:'short',hour:'2-digit',minute:'2-digit',timeZone:'Europe/London'})," \xb7 ",(l.find(s=>s.id===e.staffRef)?.name??e.staffName).replace(' (example)','')," \xb7 ",s.find(s=>s.id===e.reminderId)?.text??'Reminder']},e.id))]}):null,(0,W.jsxs)(j.Muted,{size:13,children:["Tip: once anyone taps Done, the reminder goes away for everyone that day, and you can see who did it here. \u2018Later\u2019 hides it on that phone for ",a.snoozeMins," minutes. Reset to default puts back the break times and \u201cchairs up\u201d (",(0,O.defaultChairs)('x',e).days.map(e=>O.DAY_NAMES[e]).join(' and '),", 21:00); your own reminders stay."]}),(0,W.jsx)(j.Muted,{size:13,children:"Reminders show while the app is open. Phones with the app closed don\u2019t get them yet."})]})}},1418,[1051,1031,805,1405,812,1419,1420,1422,1423,1424,1197,1029,1030,1006,1012,17,385,85,777,841,1425,816,862,1053,861,804,1055,858,1181,972,973,876,1426,1379,996,1427,1003,1139,939,8]); __d(function(g,_r,_i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.ForecastDaySettings=function({r:t,set:s}){const c=(0,o.forecastHoursOf)(t),y=(0,o.minCoversOf)(t),v=t.settings.minCoversNote??('anchorage'!==t.id||t.settings.minCoversByDay?void 0:o.MIN_COVERS_NOTE),x=(e,t,n)=>{const i=c[e]??['12:00','22:00'],o=0===t?[n,i[1]]:[i[0],n];h(o[0])&&h(o[1])&&s({forecastHours:{...c,[e]:o}})},f=(e,t)=>{const n=''===t.trim()?null:Math.max(0,Math.min(999,Math.round(Number(t)||0)));s({minCoversByDay:{...y,[e]:n||null},minCoversNote:void 0})};return(0,u.jsxs)(n.default,{style:{gap:8},testID:"forecast-day-settings",children:[(0,u.jsx)(i.T,{children:"Opening hours shown on the forecast"}),(0,u.jsx)(i.Muted,{size:13,children:"The hours your bar or dining room is open, so the forecast covers the whole day, not just kitchen hours. Any hour with a booking always shows."}),d.map(t=>(0,u.jsxs)(i.Row,{gap:8,style:{alignItems:'center'},children:[(0,u.jsx)(i.T,{center:!0,size:15,style:{width:'100%'},children:r.DAYS[t]}),c[t]?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(e.TextInput,{testID:`fc-open-${t}`,accessibilityLabel:`${r.DAYS[t]} opens`,defaultValue:c[t][0],onEndEditing:e=>x(t,0,e.nativeEvent.text),onBlur:e=>x(t,0,e?.target?.value??c[t][0]),style:[i.styles.input,{width:90,minHeight:44}]}),(0,u.jsx)(i.T,{size:15,children:"to"}),(0,u.jsx)(e.TextInput,{testID:`fc-close-${t}`,accessibilityLabel:`${r.DAYS[t]} closes`,defaultValue:c[t][1],onEndEditing:e=>x(t,1,e.nativeEvent.text),onBlur:e=>x(t,1,e?.target?.value??c[t][1]),style:[i.styles.input,{width:90,minHeight:44}]})]}):(0,u.jsx)(i.Muted,{children:"Kitchen hours"})]},`h${t}`)),(0,u.jsx)(i.T,{style:{marginTop:8},children:"Usual minimum Covers"}),(0,u.jsx)(i.Muted,{size:13,children:"The fewest Covers you always do on that day. The forecast never shows less. Leave blank if you have no usual minimum."}),d.map(t=>(0,u.jsxs)(i.Row,{gap:8,style:{alignItems:'center'},children:[(0,u.jsx)(i.T,{center:!0,size:15,style:{width:'100%'},children:r.DAYS[t]}),(0,u.jsx)(e.TextInput,{testID:`fc-min-${t}`,accessibilityLabel:`${r.DAYS[t]} usual minimum Covers`,keyboardType:"number-pad",defaultValue:y[t]?String(y[t]):'',placeholder:"Blank",placeholderTextColor:"#7D776C",onEndEditing:e=>f(t,e.nativeEvent.text),onBlur:e=>f(t,e?.target?.value??''),style:[i.styles.input,{width:90,minHeight:44}]}),(0,u.jsx)(i.Muted,{children:"Covers"})]},`m${t}`)),v?(0,u.jsxs)(i.T,{size:13,colour:l.colours.goldLight,children:["Set from ",v,"."]}):null,(0,u.jsx)(i.Muted,{size:13,children:"Tip: use a number you are sure of, such as the quietest Saturday in the last few months."})]})};var e=_r(_d[0]);_r(_d[1]);var t,s=_r(_d[2]),n=(t=s)&&t.__esModule?t:{default:t},i=_r(_d[3]),o=_r(_d[4]),r=_r(_d[5]),l=_r(_d[6]),u=_r(_d[7]);const d=[1,2,3,4,5,6,0],h=e=>/^([01]\d|2[0-3]):[0-5]\d$/.test(e)},1419,[812,17,85,777,1137,861,804,8]); __d(function(g,_r,i,_a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.TableOrderSettings=function({rid:s,me:a}){const k=(0,r.useRestaurant)(s),v=(0,o.usePlan)(s),T=(0,h.staffServer)(),R=!T||(0,b.can)('venue.settings'),[C,S]=(0,t.useState)({...c.TABLE_ORDER_DEFAULT}),[N,P]=(0,t.useState)([]),[$,D]=(0,t.useState)(null),[M,Q]=(0,t.useState)(!1),[O,B]=(0,t.useState)(!1),[A,I]=(0,t.useState)(null),[_,L]=(0,t.useState)(null),[F,E]=(0,t.useState)('sticker'),G=(0,t.useCallback)(async()=>{if(T)try{S(await(0,u.loadTableSettings)()),B(!1),(0,b.can)('venue.settings')&&(P(await(0,u.listTableCodes)()),I(await(0,u.tableReadiness)().catch(()=>null)))}catch(e){D({kind:'danger',t:`Couldn't load: ${e.message}`})}},[T]);(0,t.useEffect)(()=>(G(),T?(0,u.watchTableSettings)(()=>{O||G()}):void 0),[G]);const z=e=>{S(t=>({...t,...e})),B(!0),D(null)},W=v.tables.map(e=>e.name).filter(c.isTableNo).sort((e,t)=>Number(e)-Number(t)),H=C.tables??W,U=e=>z({tables:H.includes(e)?H.filter(t=>t!==e):[...H,e].sort((e,t)=>Number(e)-Number(t))}),Y=e=>v.tables.filter(t=>t.areaId===e).map(e=>e.name).filter(c.isTableNo),q=e=>{const t=Y(e);return t.length>0&&t.every(e=>H.includes(e))},J=e=>{const t=Y(e),s=q(e);z({tables:s?H.filter(e=>!t.includes(e)):[...new Set([...H,...t])].sort((e,t)=>Number(e)-Number(t))})},K=async()=>{Q(!0);try{const e=C.tables&&C.tables.length===W.length&&W.every(e=>C.tables.includes(e))?null:C.tables;T&&await(0,u.saveTableSettings)({...C,tables:e},a),r.useStore.getState().updateSettings(s,{orderAtTable:C.on}),B(!1),D({kind:'success',t:C.on?'Saved. Guests can order from the tables you picked.':'Saved. Order at the table is off.'})}catch(e){D({kind:'danger',t:`Not saved: ${e.message}`})}Q(!1)},V=async()=>{Q(!0);try{const e=await(0,u.makeTableCodes)(H);P(await(0,u.listTableCodes)()),D({kind:'success',t:e.made?`Made ${e.made} new QR code${e.made>1?'s':''}.`:'Every table you picked already has a code.'})}catch(e){D({kind:'danger',t:e.message})}Q(!1)},X=async t=>{Q(!0),L(null);try{await(0,u.renewTableCode)(t),P(await(0,u.listTableCodes)()),D({kind:'warn',t:`Table ${(0,e.tableNumbers)(t)} has a new code. The old QR on that table has stopped working, so print this one and swap it.`})}catch(e){D({kind:'danger',t:e.message})}Q(!1)},Z=e=>{const t=N.filter(t=>e?t.table===e:H.includes(t.table)),s=(0,p.printQrSheet)(k?.name??'Our venue',t.map(e=>({table:e.table,link:(0,c.tableLink)(w(),e.token)})),{logo:`${w()}/customer-app/brand-logo.png`,size:F});D(s?{kind:'success',t:'QR sheet opened. Choose "Save as PDF" or your printer.'}:{kind:'warn',t:'Printing works from the web app on a computer or tablet.'})};return T?(0,f.jsxs)(n.default,{style:{gap:10},testID:"table-order-settings",children:[(0,f.jsx)(l.Muted,{center:!0,children:"Tip: start with a few tables and keep \"Staff accept the first order\" on. Guests pay at the bar or with their server, and the kitchen gets the order like any other ticket."}),A&&A.priced>0&&A.signedz({on:e}),disabled:!R,testID:"tos-on"}),(0,f.jsx)(l.Toggle,{label:"Staff accept the first order from each new phone",value:C.staffAccept,onChange:e=>z({staffAccept:e}),disabled:!R}),(0,f.jsx)(l.Muted,{children:"On is safer: someone sat at the table can't be told apart from someone who photographed the QR. After staff accept one order, that phone's next orders go straight to the kitchen for 12 hours."}),(0,f.jsx)(l.T,{weight:"semibold",children:"Which areas and tables"}),(0,f.jsx)(l.Row,{wrap:!0,gap:6,children:v.areas.filter(e=>Y(e.id).length).map(e=>(0,f.jsx)(l.Chip,{label:e.name,selected:q(e.id),onPress:R?()=>J(e.id):void 0},e.id))}),(0,f.jsx)(l.Row,{wrap:!0,gap:6,children:W.map(t=>(0,f.jsx)(l.Chip,{label:`${(0,e.tableNumbers)(t)}`,selected:H.includes(t),onPress:R?()=>U(t):void 0},t))}),(0,f.jsxs)(l.Muted,{children:[C.tables?`${H.length} of ${W.length} tables`:'All tables',"."]}),(0,f.jsx)(l.T,{weight:"semibold",children:"Hours"}),(0,f.jsxs)(l.Row,{style:{justifyContent:'space-between'},children:[(0,f.jsx)(l.T,{children:"Opens at"}),(0,f.jsx)(l.Stepper,{label:"Opens at",value:j(C.openFrom),min:-15,max:1425,step:15,format:y,onChange:e=>R&&z({openFrom:x(e)})})]}),(0,f.jsxs)(l.Row,{style:{justifyContent:'space-between'},children:[(0,f.jsx)(l.T,{children:"Last orders (kitchen cut-off)"}),(0,f.jsx)(l.Stepper,{label:"Last orders",value:j(C.lastOrders),min:-15,max:1425,step:15,format:y,onChange:e=>R&&z({lastOrders:x(e)})})]}),(0,f.jsx)(l.Muted,{children:(0,c.hoursWords)(C)}),(0,f.jsx)(l.Field,{label:"Note guests see above the menu (optional)",value:C.guestTip,onChangeText:e=>z({guestTip:e.slice(0,160)}),editable:R,placeholder:"e.g. Drinks are ordered at the bar."}),R?(0,f.jsx)(l.Button,{label:M?'Saving\u2026':'Save order at the table',disabled:M||!O,onPress:()=>{K()},testID:"tos-save"}):null,$?(0,f.jsx)(l.Banner,{kind:$.kind,children:$.t}):null,R?(0,f.jsxs)(l.Card,{children:[(0,f.jsxs)(l.Row,{style:{justifyContent:'space-between'},children:[(0,f.jsx)(l.T,{weight:"semibold",children:"QR codes"}),(0,f.jsx)(l.Badge,{kind:"gold",label:`${N.length} made`})]}),(0,f.jsx)(l.Muted,{children:"Each table gets its own code. A guest can only order with the code that's on the table."}),(0,f.jsx)(l.T,{center:!0,size:13,weight:"semibold",children:"Card size"}),(0,f.jsx)(n.default,{testID:"tos-card-size",children:(0,f.jsx)(l.Row,{gap:6,wrap:!0,style:{justifyContent:'center'},children:Object.keys(p.QR_CARD).map(e=>(0,f.jsx)(l.Chip,{label:p.QR_CARD[e].label,selected:F===e,onPress:()=>E(e)},e))})}),(0,f.jsxs)(l.Muted,{center:!0,children:['sticker'===F?'For stickers and small QR table stands: 20 to a page, QR 30 mm.':'For table stand cards (about 2 \xd7 3 in): 16 to a page, QR 34 mm, with the short link.'," Print at 100% (actual size), then cut along the dashed lines."]}),(0,f.jsxs)(l.Row,{gap:8,wrap:!0,style:{justifyContent:'center'},children:[(0,f.jsx)(l.Button,{small:!0,label:"Make codes for the tables picked",disabled:M,onPress:()=>{V()}}),(0,f.jsx)(l.Button,{small:!0,kind:"secondary",label:"Print all QR cards",disabled:!N.length,onPress:()=>Z(),testID:"tos-print"})]}),N.map(t=>(0,f.jsxs)(l.Row,{style:{justifyContent:'space-between'},children:[(0,f.jsxs)(l.T,{children:["Table ",(0,e.tableNumbers)(t.table),H.includes(t.table)?'':' (not taking orders)']}),(0,f.jsxs)(l.Row,{gap:6,children:[(0,f.jsx)(l.Button,{small:!0,kind:"secondary",label:"Reprint",accessibilityLabel:`Reprint the QR for table ${t.table}`,disabled:M,onPress:()=>Z(t.table),testID:`tos-reprint-${t.table}`}),(0,f.jsx)(l.Button,{small:!0,kind:"ghost",label:"New code",accessibilityLabel:`New code for table ${t.table}`,disabled:M,onPress:()=>L(t.table),testID:`tos-renew-${t.table}`})]})]},t.table)),(0,f.jsx)(l.Muted,{children:"Lost or copied QR? Make a new code for that table; the old one stops working."})]}):null,(0,f.jsxs)(l.Card,{children:[(0,f.jsx)(l.T,{center:!0,weight:"semibold",children:"Paying"}),(0,f.jsx)(l.Muted,{center:!0,children:"Guests pay at the bar or with their server. Paying by card from the phone is coming later; no card details are asked for."})]}),_?(0,f.jsxs)(l.Sheet,{visible:!0,onClose:()=>L(null),title:`New code for table ${(0,e.tableNumbers)(_)}?`,maxWidth:520,testID:"tos-renew-confirm",children:[(0,f.jsxs)(l.T,{center:!0,children:["The QR code on table ",(0,e.tableNumbers)(_)," stops working straight away. Guests who scan the old one are told to ask a member of staff."]}),(0,f.jsx)(l.Muted,{center:!0,children:"Print the new one and swap it on the table."}),(0,f.jsx)(l.Button,{label:"Yes, make a new code",onPress:()=>{X(_)},testID:"tos-renew-yes"}),(0,f.jsx)(l.Button,{kind:"secondary",label:"Cancel",onPress:()=>L(null)})]}):null]}):(0,f.jsx)(l.Banner,{kind:"demo",title:"Needs the venue connection",children:"Order at the table runs on the server, so it works once this app is connected to your venue. Nothing here is sent anywhere."})};var e=_r(d[0]),t=_r(d[1]);_r(d[2]);var s,a=_r(d[3]),n=(s=a)&&s.__esModule?s:{default:s},l=_r(d[4]),r=_r(d[5]),o=_r(d[6]),c=_r(d[7]),h=_r(d[8]),b=_r(d[9]),u=_r(d[10]),p=_r(d[11]),f=_r(d[12]);const w=()=>'undefined'!=typeof window&&/^https:/.test(window.location.origin)?window.location.origin:"https://covercharge-apps.static.hf.space",j=e=>e?60*Number(e.slice(0,2))+Number(e.slice(3,5)):-15,x=e=>e<0?null:(0,c.hm)(e),y=e=>e<0?'Not set':(0,c.hm)(e)},1420,[843,17,219,85,777,858,996,1150,1253,946,1324,1421,8]); __d(function(g,_r,_i,a,_m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.qrSvg=n,Object.defineProperty(e,"QR_CARD",{enumerable:!0,get:function(){return r}}),e.qrSheetHtml=s,e.printQrSheet=function(t,o,i={}){if('undefined'==typeof window||!window.open)return!1;const n=window.open('','_blank');return!!n&&(n.document.write(s(t,o,i)),n.document.close(),n.focus(),setTimeout(()=>{try{n.print()}catch{}},800),!0)};var t=_r(_d[0]);const o=_r(_d[1]),i=t=>t.replace(/[&<>"']/g,t=>({'&':'&','<':'<','>':'>','"':'"',"'":'''}[t]));function n(t,i=220){const n=o.create(t,{errorCorrectionLevel:'M'}).modules,r=n.size,s=r+8;let l='';for(let t=0;t`}const r={sticker:{w:50,h:50,qr:30,cols:4,rows:5,label:'Stickers 50 \xd7 50 mm'},stand:{w:50,h:70,qr:34,cols:4,rows:4,label:'Stand cards 50 \xd7 70 mm'}};function s(o,s,l={}){const d=l.size??'sticker',c=r[d],m='stand'===d,h=l.logo?``:'',f=o=>`
${h}
${i((0,t.tableNumbersA11y)(o.table))}
${n(o.link,240)}
Scan to order
${m?`
Pay at the bar or with your server
${i(o.link.replace(/^https?:\/\//,''))}
`:''}
`,p=c.cols*c.rows,u=[];for(let t=0;t${s.slice(t,t+p).map(f).join('')}`);return`${i(o)} table QR codes \xb7 ${c.label}

${i(o)} \xb7 ${c.label} \xb7 cut along the dashed lines \xb7 print at 100% (actual size, not "fit to page")

${u.join('')}`}},1421,[843,1275]); @@ -1591,7 +1591,7 @@ __d(function(g,_r,_i,_a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModu __d(function(g,_r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.deviceKind=o,e.deviceSyncLine=function(r,c){const l=Date.parse(r.seen_at),u=r.last_synced_at?Date.parse(r.last_synced_at):0,$=c-l>18e4,h=!u||l-u>6e4,p=!$&&!h,_=`${t[r.app]??r.app}${r.who?` \xb7 ${r.who}`:''} \xb7 ${o(r.user_agent)}`,f=$?`Not reporting since ${n(r.seen_at)} (${s(c-l)})${u?`, last synced ${n(r.last_synced_at)}`:''}`:h?`Out of sync${u?` since ${n(r.last_synced_at)}`:''}, reconnecting`:`In sync \xb7 last synced ${n(r.last_synced_at)} (${s(c-u)})`,y=[r.version??'','SUBSCRIBED'===r.realtime?'live channel on':`live channel ${String(r.realtime??'off').toLowerCase()}`];r.pending&&y.push(`${r.pending} change${1===r.pending?'':'s'} waiting`);r.failed&&y.push(`${r.failed} not saved`);return{ok:p,title:_,state:f,detail:y.filter(Boolean).join(' \xb7 ')}};const t={owner:'Managers',staff:'Staff',chef:'Chef',display:'Display',car:'Car'},n=t=>new Date(t).toLocaleTimeString('en-GB',{hour:'2-digit',minute:'2-digit',timeZone:'Europe/London'}),s=t=>t<9e4?`${Math.max(0,Math.round(t/1e3))} s ago`:t<54e5?`${Math.round(t/6e4)} min ago`:`${Math.round(t/36e5)} h ago`;function o(t){const n=t??'';return/CoverChargeTablet|TB\d|Tablet/i.test(n)?'tablet':/iPhone/i.test(n)?'iPhone':/iPad/i.test(n)?'iPad':/Android/i.test(n)?'Android':/Tesla/i.test(n)?'car':/Mac OS X|Windows|Linux/i.test(n)?'computer':'device'}},1508,[]); __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.TableQrPage=function(){const{rid:e,me:t}=(0,h.useCtx)(6e4),b=t.replace(' (example)','');return(0,u.jsxs)(s.default,{style:{gap:14,width:'100%',maxWidth:760,alignSelf:'center'},testID:"table-qr-page",children:[(0,u.jsx)(l.T,{center:!0,size:22,weight:"semibold",colour:o.colours.gold,accessibilityRole:"header",children:"Table QR codes"}),(0,u.jsx)(l.Muted,{center:!0,children:"Guests scan the code on their table, see the menu and send their order to the kitchen. They pay at the bar or with their server."}),(0,u.jsx)(c.TableOrderSettings,{rid:e,me:b}),(0,u.jsx)(l.T,{center:!0,size:20,weight:"semibold",colour:o.colours.gold,accessibilityRole:"header",children:"Orders from the tables"}),(0,u.jsx)(n.StaffTableOrders,{rid:e,me:b})]})},r(d[0]);var e,t=r(d[1]),s=(e=t)&&e.__esModule?e:{default:e},l=r(d[2]),o=r(d[3]),c=r(d[4]),n=r(d[5]),h=r(d[6]),u=r(d[7])},1509,[17,85,777,804,1420,1498,1055,8]); __d(function(g,_r,_i,_a,_m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.showMe=j,_e.HelpPage=function({go:e}){const[s,a]=(0,n.useState)(''),[r,h]=(0,n.useState)(null),[p,m]=(0,n.useState)(null),j=(0,n.useMemo)(()=>s.trim()?(0,u.searchHelp)(c.HELP,s,10).map(e=>e.a):c.HELP.filter(e=>!r||e.topic===r),[s,r]);return(0,f.jsxs)(o.default,{style:{gap:10},testID:"help-page",children:[(0,f.jsxs)(o.default,{style:[i.styles.input,{flexDirection:'row',alignItems:'center',gap:8,paddingVertical:4}],children:[(0,f.jsx)(i.T,{colour:x.colours.muted,children:"\ud83d\udd0d"}),(0,f.jsx)(t.TextInput,{testID:"help-search",value:s,onChangeText:a,placeholder:"Search help",placeholderTextColor:"#7D776C",accessibilityLabel:"Search help",style:{flex:1,minWidth:0,width:0,boxSizing:'border-box',color:x.colours.text,paddingVertical:8,fontSize:16,outlineStyle:'none'}}),s?(0,f.jsx)(l.GoldClose,{testID:"help-search-clear",size:"sm",label:"Clear search",onPress:()=>a('')}):null]}),(0,f.jsx)(b,{go:e}),s?(0,f.jsx)(i.Muted,{children:j.length?`${j.length} result${1===j.length?'':'s'} for \u201c${s.trim()}\u201d`:`Nothing for \u201c${s.trim()}\u201d. Try other words, or ask the Assistant above.`}):(0,f.jsx)(i.Row,{wrap:!0,gap:6,children:[null,...c.HELP_TOPICS].map(e=>(0,f.jsx)(i.Chip,{label:e??'All',selected:r===e,onPress:()=>h(e)},e??'all'))}),j.map((t,l)=>(0,f.jsx)(y,{a:t,go:e,open:p===t.id||!!s&&0===l&&null===p,onToggle:()=>m(p===t.id?'':t.id)},t.id)),(0,f.jsxs)(i.Card,{style:{alignItems:'center'},children:[(0,f.jsx)(i.T,{center:!0,weight:"semibold",colour:x.colours.gold,children:"Chat with CoverCharge support"}),(0,f.jsx)(i.Muted,{center:!0,children:"Send a message to the CoverCharge team. Nobody replies automatically."}),(0,f.jsx)(i.Button,{label:"Open the chat",accessibilityLabel:"Open the chat with CoverCharge support",onPress:()=>e('more','support')})]})]})},_e.AskAssistant=b;var t=_r(d[0]),s=_r(d[1]),l=_r(d[2]),n=_r(d[3]),a=e(_r(d[4])),o=e(_r(d[5])),i=_r(d[6]),r=_r(d[7]),h=_r(d[8]),c=_r(d[9]),u=_r(d[10]),p=_r(d[11]),x=_r(d[12]),m=_r(d[13]),f=_r(d[14]);function j(e,t){e.showMe&&(t(e.showMe.tab,e.showMe.page??null),setTimeout(()=>h.useCoach.getState().show(e.showMe.target,e.showMe.hint),300))}function y({a:e,go:t,open:s,onToggle:l}){return(0,f.jsx)(o.default,{testID:`help-${e.id}`,children:(0,f.jsxs)(i.Card,{children:[(0,f.jsx)(a.default,{accessibilityRole:"button",onPress:l,children:(0,f.jsxs)(i.Row,{style:{justifyContent:'space-between'},gap:8,children:[(0,f.jsxs)(o.default,{style:{flex:1},children:[(0,f.jsx)(i.T,{weight:"semibold",children:e.title}),(0,f.jsxs)(i.Row,{gap:6,children:[(0,f.jsx)(i.Badge,{kind:'guide'===e.kind?'gold':'neutral',label:'guide'===e.kind?'Step by step':'FAQ'}),(0,f.jsx)(i.Muted,{size:12,children:e.topic})]})]}),(0,f.jsx)(i.T,{colour:x.colours.muted,children:s?'\u25be':'\u203a'})]})}),s?(0,f.jsxs)(o.default,{style:{gap:6},children:[(0,f.jsx)(i.Muted,{children:e.body}),e.steps?.map((e,t)=>(0,f.jsxs)(i.Row,{gap:8,style:{alignItems:'flex-start'},children:[(0,f.jsx)(o.default,{style:{width:22,height:22,borderRadius:11,backgroundColor:x.colours.gold,alignItems:'center',justifyContent:'center'},children:(0,f.jsx)(i.T,{size:12,weight:"bold",colour:"#1A1408",children:t+1})}),(0,f.jsx)(i.T,{style:{flex:1},children:e})]},t))]}):null,e.showMe?(0,f.jsx)(i.Row,{wrap:!0,gap:6,children:(0,f.jsx)(i.Button,{small:!0,kind:"success",label:"Show me",testID:`showme-${e.id}`,onPress:()=>j(e,t)})}):null]})})}function b({go:e}){const{rid:t,today:s}=(0,m.useCtx)(6e4),l={rid:t,today:s,go:(t,s)=>e(t,s??null)},[a,r]=(0,n.useState)(''),[h,u]=(0,n.useState)(null),[y,b]=(0,n.useState)(null),k=async()=>{const e=a.trim();if(!e)return;b(null),u(null);const t=(0,p.matchIntent)(e,s);if('action'!==t.kind)'help'!==t.kind?b({text:'Sorry, I didn\u2019t follow that. Try \u201cadd a walk-in for 4 at table 7\u201d, \u201cput Ellie on Friday 5 till 11\u201d, or ask \u201chow do I export hours?\u201d.',kind:'note'}):b({text:'Here\u2019s what I found. Tap Show me and I\u2019ll point to it.',kind:'note',help:t.ids});else{if(!(0,p.needsConfirm)(t.action.risk)){const e=await(0,p.runAction)(t.action.id,t.params,l);return void b({text:'done'===e.status?e.message:e.message??'',kind:'done'})}u({action:t.action,params:{...w(t.action,s),...t.params},asked:e})}};return(0,f.jsx)(o.default,{testID:"ask-assistant",children:(0,f.jsxs)(i.Card,{highlight:x.colours.gold,children:[(0,f.jsxs)(i.Row,{gap:8,children:[(0,f.jsx)(o.default,{style:{width:28,height:28,borderRadius:14,backgroundColor:x.colours.gold,alignItems:'center',justifyContent:'center'},children:(0,f.jsx)(i.T,{weight:"bold",colour:"#1A1408",children:"\u2726"})}),(0,f.jsx)(i.T,{weight:"semibold",style:{flex:1},children:"Ask the Assistant"})]}),(0,f.jsxs)(o.default,{testID:"help-assistant-stack",style:{gap:8,width:'100%',minWidth:0},children:[(0,f.jsx)(i.Field,{label:"Ask or tell it what to do",testID:"assistant-input",value:a,onChangeText:r,placeholder:"Ask in plain words",onSubmitEditing:k,returnKeyType:"send",style:{width:'100%',minWidth:0,boxSizing:'border-box'}}),(0,f.jsx)(i.Button,{label:"Ask",testID:"assistant-ask",disabled:!a.trim(),onPress:k,style:{width:'100%',minWidth:0,minHeight:52}})]}),(0,f.jsx)(i.Row,{wrap:!0,gap:6,children:['Add a walk-in for 4 at table 7','Put a shift on Friday 5 till 11','How do I export hours for payroll?','Pay out the tips'].map(e=>(0,f.jsx)(i.Chip,{label:e,onPress:()=>r(e)},e))}),h?(0,f.jsx)(C,{p:h,today:s,onChange:e=>u({...h,params:e}),onConfirm:async()=>{if(!h)return;const e=await(0,p.runAction)(h.action.id,h.params,l,!0);u(null),r(''),b('done'===e.status?{text:e.message,kind:'done'}:'demo_only'===e.status?{text:e.message,kind:'demo'}:{text:e.message??'Couldn\u2019t do that.',kind:'error'})},onCancel:()=>{u(null),b({text:'Cancelled. Nothing was changed.',kind:'note'})}}):null,y?(0,f.jsxs)(o.default,{style:{gap:6},testID:"assistant-reply",children:[(0,f.jsx)(i.Banner,{kind:'done'===y.kind?'success':'error'===y.kind?'warn':'demo'===y.kind?'demo':'info',title:y.text}),y.help?.map(t=>{const s=(0,c.helpById)(t);return(0,f.jsxs)(i.Row,{gap:6,style:{justifyContent:'space-between'},children:[(0,f.jsx)(i.T,{style:{flex:1},children:s.title}),s.showMe?(0,f.jsx)(i.Button,{small:!0,kind:"success",label:"Show me",onPress:()=>j(s,e)}):null]},t)})]}):null,(0,f.jsx)(i.Muted,{size:12,children:"It shows you what it will do and waits for your tap. It never sends, pays or deletes anything."})]})})}function w(e,t){return'add_rota_shift'===e.id?{date:t,start:17,end:23}:'add_walkin'===e.id?{covers:2}:{}}function C({p:e,today:t,onChange:l,onConfirm:n,onCancel:a}){const h=(0,r.useOwner)(e=>e.staff).filter(e=>e.active),c=(0,p.demoOnly)(e.action.risk),u=(t,s)=>l({...e.params,[t]:s}),m=e.action,j=e.params,y=m.params.every(e=>!e.required||void 0!==j[e.name]&&''!==j[e.name]);return(0,f.jsxs)(o.default,{testID:"assistant-confirm",style:{borderWidth:2,borderColor:c?x.colours.red:x.colours.ok,borderRadius:14,padding:12,gap:8,backgroundColor:c?'#2a1010':x.colours.okBg},children:[(0,f.jsxs)(i.Row,{gap:6,children:[(0,f.jsx)(i.Badge,{kind:c?'red':'ok',label:p.RISK_LABEL[m.risk]}),(0,f.jsx)(i.T,{weight:"semibold",style:{flex:1},children:m.title})]}),m.form&&'add_walkin'===m.id?(0,f.jsxs)(i.Row,{gap:6,children:[(0,f.jsx)(o.default,{style:{flex:1},children:(0,f.jsx)(i.Field,{label:"Covers",value:void 0===j.covers?'':String(j.covers),onChangeText:e=>u('covers',e.replace(/\D/g,'')?Number(e.replace(/\D/g,'')):void 0),keyboardType:"number-pad"})}),(0,f.jsx)(o.default,{style:{flex:1},children:(0,f.jsx)(i.Field,{label:"Table (optional)",value:void 0===j.table?'':String(j.table),onChangeText:e=>u('table',e.trim()?e.trim().toUpperCase():void 0)})})]}):null,m.form&&'add_rota_shift'===m.id?(0,f.jsxs)(o.default,{style:{gap:6},children:[(0,f.jsx)(i.Muted,{size:12,children:"Who"}),(0,f.jsx)(i.Row,{wrap:!0,gap:6,children:h.slice(0,14).map(e=>(0,f.jsx)(i.Chip,{label:e.name.replace(' (example)','').split(' ')[0],selected:j.staffId===e.id,onPress:()=>u('staffId',e.id)},e.id))}),(0,f.jsxs)(i.Row,{gap:6,children:[(0,f.jsx)(o.default,{style:{flex:1.3},children:(0,f.jsx)(i.Field,{label:"Date (DD/MM/YYYY)",...(0,s.slashBox)(String(j.date??t),e=>u('date',e)),placeholder:"20/11/2026",keyboardType:"numbers-and-punctuation",maxLength:10})}),(0,f.jsx)(o.default,{style:{flex:1},children:(0,f.jsx)(i.Field,{label:"Start (24h)",value:String(j.start??''),onChangeText:e=>u('start',''===e?void 0:Number(e)),keyboardType:"decimal-pad"})}),(0,f.jsx)(o.default,{style:{flex:1},children:(0,f.jsx)(i.Field,{label:"End (24h)",value:String(j.end??''),onChangeText:e=>u('end',''===e?void 0:Number(e)),keyboardType:"decimal-pad"})})]})]}):null,(0,f.jsx)(i.T,{children:y?m.preview(j,{rid:'',today:t,go:()=>{}}):'Fill in the missing details above.'}),c?(0,f.jsx)(i.Muted,{children:"This Assistant does not send, pay or delete. Confirm only shows what would happen."}):(0,f.jsx)(i.Muted,{children:"Nothing happens until you tap Confirm."}),(0,f.jsxs)(i.Row,{gap:8,children:[(0,f.jsx)(i.Button,{kind:c?'danger':'success',label:c?'Confirm (nothing is sent)':'Confirm',testID:"assistant-confirm-yes",disabled:!y,onPress:n,style:{flex:1}}),(0,f.jsx)(i.Button,{kind:"ghost",label:"Cancel",onPress:a,style:{flex:1}})]})]})}},1510,[812,1031,779,17,385,85,777,876,1458,1511,1512,1513,804,1055,8]); -__d(function(g,r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"HELP_TOPICS",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"HELP",{enumerable:!0,get:function(){return a}}),Object.defineProperty(e,"helpById",{enumerable:!0,get:function(){return o}});const t=['Bookings','Walk-ins','Table plan','Rota','Hours & pay','Tips','Team','Suppliers','Stock','Recipe cards','Displays','Settings','Accounts'],a=[{id:'new-booking',kind:'guide',topic:'Bookings',title:'Take a phone booking',keywords:['booking','reservation','book','table','phone','covers','reserve'],body:'Add a booking for a guest who calls or walks up to ask. The app only offers times that are really free.',steps:['Open Bookings (or tap New booking on Today).','Pick the date, time and number of covers.','Add the guest\u2019s name and phone, plus any allergies or notes.','Tap Save. The booking appears on the timeline and the floor plan.'],showMe:{tab:'bookings',target:{testID:'add-booking'},hint:'Tap New booking to start a booking.'}},{id:'move-booking',kind:'faq',topic:'Bookings',title:'How do I move a booking to another table or time?',keywords:['move','change','reschedule','table','booking','swap'],body:'Open the booking from Bookings or the timeline and tap Edit, or drag it to another table on the Display. Guests are not messaged unless you choose to.',showMe:{tab:'bookings',target:{testID:'add-booking'},hint:'Your bookings list is here. Tap a booking to change it.'}},{id:'walk-in',kind:'guide',topic:'Walk-ins',title:'Seat a walk-in',keywords:['walk-in','walkin','walk in','seat','no booking','covers','party'],body:'Record guests who arrive without a booking so the floor plan and covers stay right.',steps:['On the Display (the venue tablet), tap Walk-in. On a phone, say \u201cadd a walk-in for 2\u201d to the Assistant.','Choose the number of covers.','Pick a free table (the best fit is suggested).','Tap Seat. The table shows as seated.'],actions:['add_walkin']},{id:'table-plan',kind:'guide',topic:'Table plan',title:'Edit the table plan',keywords:['table plan','floor plan','layout','tables','move tables','designer','areas','seats'],body:'Drag tables into place, set seats, join tables and add areas such as Terrace or Garden.',steps:['Go to More \u203a Table plan.','Tap Open the designer.','Drag tables, or tap one to change its name and seats.','Tap Save. Displays and bookings use the new plan straight away.'],showMe:{tab:'more',page:'tableplan',target:{testID:'open-designer'},hint:'Open the designer to move tables.'}},{id:'rota',kind:'guide',topic:'Rota',title:'Build and publish the rota',keywords:['rota','shift','schedule','week','publish','staff hours','add shift'],body:'Plan the week, then publish it so staff see their shifts in the Staff app.',steps:['Go to More \u203a Rota.','Tap a person\u2019s day to add a shift (presets: lunch, dinner, double).','New shifts are drafts with a dashed amber border.','Tap Publish when the week is ready. Staff see only published shifts.'],showMe:{tab:'more',page:'rota',target:{testID:'rota-publish'},hint:'Tap a day to add a shift, then Publish here.'},actions:['add_rota_shift','publish_rota']},{id:'rota-copy',kind:'faq',topic:'Rota',title:'Can I copy last week\u2019s rota?',keywords:['copy','last week','repeat','rota','duplicate'],body:'Yes. On the Rota tap Copy last week. The shifts come over as drafts so you can tweak them before publishing.',showMe:{tab:'more',page:'rota',target:{testID:'rota-copy'},hint:'Copy last week\u2019s shifts as drafts.'}},{id:'sign-off',kind:'guide',topic:'Hours & pay',title:'Sign off hours',keywords:['sign off','signoff','confirm hours','approve','timesheet','clock','pending'],body:'Only confirmed hours count for pay and tips. Check clocked times against the rota and confirm them.',steps:['Go to More \u203a Sign off hours.','Flagged days (late, missing clock-out, long breaks) are at the top.','Tap a row to fix a time; give a short reason.','Tap Confirm all unflagged, then deal with the rest.'],showMe:{tab:'more',page:'signoff',target:{testID:'confirm-unflagged'},hint:'Confirm all the days that look right in one tap.'}},{id:'payroll-hours',kind:'guide',topic:'Hours & pay',title:'Export hours for payroll',keywords:['payroll','export','hours','spreadsheet','csv','excel','accountant','copy','print'],body:'Get each person\u2019s confirmed hours for a pay period into your spreadsheet or to your accountant.',steps:['Go to More \u203a Payroll hours.','Pick the pay period (or a tips fortnight, or a custom range).','Check the pending banner: sign those off first if you can.','Tap Copy for spreadsheet and paste into Excel or Google Sheets, or download a CSV, or print.'],showMe:{tab:'more',page:'hours',target:{testID:'copy-tsv'},hint:'Copy, then paste straight into your spreadsheet.'}},{id:'pay-dates',kind:'faq',topic:'Hours & pay',title:'How do I set our pay dates?',keywords:['pay day','payday','pay dates','cut-off','wages','monthly','fortnightly'],body:'Settings \u203a Pay & tips: set when tips are paid and how often, the wage pay day and the cut-off. Payroll hours and Tips day use these dates.',showMe:{tab:'more',page:'paysettings',target:{testID:'save-pay'},hint:'Change the dates above, then Save.'}},{id:'tips-day',kind:'guide',topic:'Tips',title:'Share out tips on tips day',keywords:['tips','tronc','gratuity','share','split','tips day','service charge'],body:'Enter the tips total and it\u2019s shared by confirmed hours for the fortnight, to the penny.',steps:['Go to More \u203a Tips day (the right fortnight is picked for you).','Type the total tips.','Check anyone with pending hours; sign them off first if you can.','Copy or download the split for payroll.'],showMe:{tab:'more',page:'tipsday',target:{testID:'tips-total'},hint:'Type the tips total here.'}},{id:'invites',kind:'guide',topic:'Team',title:'Invite staff to the app',keywords:['invite','link','staff app','new starter','sign in','add staff','team member'],body:'Each person gets their own sign-in link. You choose when and how to share it.',steps:['Go to Settings \u203a Invite links.','Tap Make invite link next to the person.','Share the link yourself (text or WhatsApp). The app never sends it for you.','They tap it once and the Staff app remembers them.'],showMe:{tab:'more',page:'setup-invites',target:{text:'Make invite link'},hint:'Make a personal link, then share it yourself.'}},{id:'suppliers',kind:'guide',topic:'Suppliers',title:'Suppliers and order sheets',keywords:['supplier','order','order sheet','delivery','cut-off','fish','veg','dairy'],body:'Keep supplier contacts, order days and cut-offs together, and log what you ordered.',steps:['Go to More \u203a Suppliers to add or edit a supplier.','Use Supplier order sheets for the items you usually order.','Tap Log an order after you place it by phone or email.'],showMe:{tab:'more',page:'ordersheets',target:{testID:'sheet-add'},hint:'Add an order sheet for a supplier.'}},{id:'display-glance',kind:'guide',topic:'Display',title:'Today at a glance (Display)',keywords:['glance','today','covers by hour','breaks','on now','next','cut-off','cutoff','order times','display bar'],body:'The bar under the Display header shows today in one line: covers by hour (booked in solid gold, the walk-in estimate dashed), quiet times for breaks, who is on now and next, today\u2019s supplier order cut-offs with a countdown (amber under 30 minutes) and one tip. Cut-offs come from Scheduled notifications.'},{id:'sold-out',kind:'guide',topic:'Menu',title:'Sold out dishes',keywords:['sold out','run out','ran out','none left','back on','86','eighty six','display strip'],body:'When a dish runs out, mark it sold out so every member of staff knows. It\u2019s a reminder for staff: CoverCharge doesn\u2019t link up to your till, so it doesn\u2019t change the till. Sold out dishes show in a slim strip along the bottom of the Display within seconds, and in the Sold out list in Front of House, Managers and Head Chef. They clear by themselves when the kitchen closes (or the next morning, or only when you tap Back on: Settings \u203a Advanced \u203a Sold out reminders).',steps:['Open the Sold out list (Managers: More \u203a Sold out; Front of House: Me \u203a Sold out; Head Chef: Kitchen \u203a Live tickets \u203a Sold out).','Tap Mark sold out next to the dish.','When it\u2019s back, tap Back on.'],showMe:{tab:'more',page:'soldout',target:{testID:'soldout-search'},hint:'Find the dish, then tap Mark sold out.'}},{id:'shellfish',kind:'guide',topic:'Stock',title:'Live shellfish (and other) counts',keywords:['shellfish','lobster','crab','oysters','count','stock','tracked','sold out','86'],body:'Counters for things you sell by the unit, like lobster or crab. They show on the Display and warn when low.',steps:['Go to Settings \u203a Tracked stock.','Tap Add an item to track; set the name, icon and low warning.','Staff update the count from the small lobster and crab chip at the top of the Display, or in the app.'],showMe:{tab:'more',page:'trackedstock',target:{text:'Add an item to track'},hint:'Add something to count, like lobster.'}},{id:'recipe-cards',kind:'guide',topic:'Recipe cards',title:'Recipe cards',keywords:['recipe','card','dish','ingredients','method','allergens','spec'],body:'Photo, ingredients, method and allergens for each dish; the head chef signs them off and staff can read them.',steps:['Go to More \u203a Recipe cards.','Search for a dish or add a new one.','Fill in ingredients (allergens are suggested) and the method.','Send for head chef sign-off.'],showMe:{tab:'more',page:'recipecards',target:{testID:'card-search'},hint:'Search your recipe cards here.'}},{id:'display-pair',kind:'guide',topic:'Displays',title:'Pair a display or tablet',keywords:['display','tablet','pair','screen','code','front of house','kitchen screen'],body:'Connect a tablet to your venue with a one-time code. You can switch any display off from here.',steps:['Open the Display app on the tablet.','In Managers go to Settings \u203a Displays and tap Make a pairing code.','Type the code on the tablet. It joins your venue straight away.'],showMe:{tab:'more',page:'displays',target:{text:'Make a pairing code'},hint:'Make a one-time code for the tablet.'}},{id:'settings-hours',kind:'faq',topic:'Settings',title:'How do I change our opening hours?',keywords:['opening hours','hours','closed','open','kitchen hours','times'],body:'Settings \u203a Opening hours. Guests see these on your booking and order pages; bookings outside them are turned away.',showMe:{tab:'more',page:'setup-hours',hint:'Set each day\u2019s opening and closing time here.'}},{id:'replay-setup',kind:'faq',topic:'Settings',title:'Can I see the welcome walkthrough again?',keywords:['welcome','setup','walkthrough','onboarding','checklist','questionnaire'],body:'Yes: Settings \u203a Setup checklist \u203a Replay welcome. Everything is pre-filled from your questionnaire.',showMe:{tab:'more',page:'setupchecklist',target:{testID:'replay-welcome'},hint:'Replay the welcome walkthrough.'}},{id:'connected-accounts',kind:'guide',topic:'Accounts',title:'Connect your email, website and socials',keywords:['connect','account','gmail','outlook','wix','facebook','instagram','square','xero','quickbooks','login'],body:'Settings \u203a Connected accounts: tap a logo, save the account to your list, and use Connect with\u2026 to sign in on that service\u2019s own page (rolling out service by service; it shows Coming soon until then). CoverCharge never sees your password that way, and you can remove an account any time.',steps:['Go to Settings \u203a Connected accounts.','Tap the service\u2019s logo.','Tap Connect with\u2026 and sign in on their page.','To stop, tap Remove.'],showMe:{tab:'more',page:'connections',target:{testID:'conn-tile-gmail'},hint:'Tap a logo to connect that account.'}},{id:'supplier-portals',kind:'guide',topic:'Suppliers',title:'Order from your suppliers',keywords:['bidfood','booker','wholesale','cash and carry','order online','supplier login','account number','customer number'],body:'Settings \u203a Connected accounts \u203a Suppliers. Add supplier links for this venue, with an account number if you like. Open ordering and Log in open the supplier\u2019s own website, where you sign in; CoverCharge never keeps the password.',steps:['Go to Settings \u203a Connected accounts.','Scroll to Suppliers.','Tap Add against a supplier (account number optional).','Tap Open ordering or Log in whenever you need them.','To stop, tap Remove and confirm.'],showMe:{tab:'more',page:'connections',target:{testID:'portal-bidfood'},hint:'Your supplier ordering websites live here.'}},{id:'support',kind:'faq',topic:'Settings',title:'How do I get help from a person?',keywords:['support','help','contact','person','problem','broken','stuck'],body:'Support is free for life. Message the CoverCharge team from Settings \u203a Help, or email us, and we\u2019ll reply. We help by message and email.'},{id:'assistant-safe',kind:'faq',topic:'Settings',title:'Can the Assistant send or pay for things by itself?',keywords:['assistant','safe','confirm','send','pay','delete','ai'],body:'No. The Assistant and the voice helper show you exactly what they will do and wait for you to tap Confirm (or say yes). Anything that would send a message, order from a supplier or pay is only saved as a draft in Drafts for approval; nothing goes out by itself.'},{id:'restaurant-dashboard',kind:'guide',topic:'Bookings',title:'Restaurant dashboard',keywords:['restaurant dashboard','tables','timeline','guests','covers','joined tables'],body:'In Managers, tap Restaurant dashboard on Home, or More > Run the day > Restaurant dashboard. It is the same live table plan, Timeline, guest list, deposits, dogs, joined tables, Covers, covers-through-the-day chart and block bookings as the Display. Use the day arrows and Back to today. Assign or join tables on any day; seat, finish, no-show and cancel walk-in actions apply today. You can also say \u201copen Restaurant dashboard\u201d. The helper replies in text only.',showMe:{tab:'more',page:'serviceboard',target:{testID:'restaurant-dashboard-close'},hint:'Restaurant dashboard is open. Pick a day, or tap Back to Managers to close.'}},{id:'voice-helper',kind:'guide',topic:'Settings',title:'Use the hold-to-talk voice button',keywords:['voice','talk','speak','microphone','mic','hold','walkie','button','hands free','gloves'],body:'Hold the big gold button, say what you need, then let go. It logs fridge and freezer temperatures, answers allergen questions, marks dishes sold out, checks tables, adds to the waitlist, reads orders and covers, and drafts bookings, offers, events and supplier lists. The helper replies in text only, never aloud. Changes are shown in text first with Confirm and Cancel buttons: tap Confirm or say yes. Tap the button to type instead (in Managers this also opens the Assistant). It sits at the top right of the header in Managers, Head Chef, the Staff app (the full voice assistant, with no money, tips or HR) and on the Display (no money, tips or HR). Until the voice assistant\u2019s server is switched on, anything new says \u201cVoice assistant is switching on soon\u201d. Fair usage: 1,000 voice tasks a month per venue.',steps:['Hold the gold microphone button (the first time, allow the microphone).','Speak, for example \u201cprep fridge 3 degrees\u201d.','Let go to send.','If it reads something back, tap Confirm or hold again and say \u201cyes\u201d.','The button stays at the top right so it never covers the screen.'],showMe:{tab:'more',page:'voice',hint:'Turn the voice button on or off for each role here.'}},{id:'voice-drafts',kind:'faq',topic:'Settings',title:'Where do voice bookings and shopping lists go?',keywords:['drafts','approve','approval','shopping list','booker list','bidfood list','draft booking','offer','event'],body:'To Settings \u203a Drafts for approval. Bookings, supplier lists, offers, events and specials made by voice wait there for an owner or manager. Approving marks it approved and opens the right screen; you still place the order or confirm the booking yourself.',showMe:{tab:'more',page:'drafts',hint:'Drafts from the voice helper wait here.'}},{id:'voice-temps',kind:'guide',topic:'Settings',title:'Log fridge and freezer temperatures by voice',keywords:['temperature','fridge','freezer','haccp','food safety','eho','log temps','probe'],body:'Hold the voice button and say the unit and the number, for example \u201cprep fridge 3, freezer minus 19\u201d. Fridges should be 5\xb0C or colder and freezers -18\xb0C or colder; anything outside is flagged. Everything is in the Food safety log with who and when, ready to export or print for the EHO.',showMe:{tab:'more',page:'haccp',hint:'Every voice reading appears in the food safety log.'}},{id:'voice-fair-usage',kind:'faq',topic:'Settings',title:'Is there a limit on voice tasks?',keywords:['voice','limit','allowance','fair usage','fair use','how many','tasks','month','plan'],body:'Fair usage: 1,000 voice tasks a month per venue. It is one allowance shared by all of the venue\u2019s apps and devices, and it resets on the 1st. Each request counts once, spoken or typed; saying \u201cyes\u201d to confirm does not count again. You will see a note at 80%. If the venue reaches 1,000, the voice helper pauses until the 1st, except food safety and temperature logging, which always works. The owner can contact CoverCharge if you need more. See the count in Plan & billing or Settings \u203a Voice helper.',showMe:{tab:'more',page:'voice',hint:'This month\u2019s voice task count is shown here.'}},{id:'adv-bookings',kind:'guide',topic:'Settings',title:'Booking questions: allergies, dogs, access, vegan',keywords:['advanced','allergen','dog','dogs','cap','wheelchair','access','vegan','vegetarian','table request','settings'],body:'Choose what guests are asked when they book. Allergies are always asked first, in red, and staff tick \u201cAllergens seen\u201d. The others can be switched off.',steps:['Open More \u203a Settings \u203a Advanced.','In Bookings, tick or untick each question.','Use the dog stepper to cap dogs per booking time (No limit = only the dog-friendly tables).','Mark dog-friendly and step-free tables on the Table plan.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-bookings'},hint:'Booking questions are here.'}},{id:'adv-table-times',kind:'guide',topic:'Settings',title:'How long tables stay (table times)',keywords:['advanced','dwell','table time','turn','how long','next table free','minutes'],body:'Usual table times by party size: 90 min for 1\u20132 covers, 105 for 3\u20135, 2 hours for 6\u201319 and 3 hours for 20 or more. The app fine-tunes them from how long your tables really stay, and uses them for \u201cNext table free\u201d.',steps:['Open More \u203a Settings \u203a Advanced \u203a Table times.','Tap \u2212 or + to change a band by 5 minutes.','Untick \u201cFine-tune\u201d to use your numbers exactly.','Reset to default puts the four bands back.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-times'},hint:'Table times are here.'}},{id:'adv-reservable',kind:'guide',topic:'Settings',title:'Seafood platter, crab and lobster reservations',keywords:['advanced','platter','seafood','crab','lobster','reserve','price'],body:'Guests can reserve the Seafood Platter (1 crab + 1 lobster, \xa3160) or a crab or lobster with their booking. Reserved ones come off the Display count with a \u201cReserved\u201d line, the kitchen is told, and the Head Chef taps OK.',steps:['Open More \u203a Settings \u203a Advanced \u203a Reservable items.','Tick what guests can reserve and set the price.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-reserve'},hint:'Reservable items are here.'}},{id:'adv-events',kind:'guide',topic:'Settings',title:'Regular events like Open Mic Night',keywords:['advanced','open mic night','music night','event','regular','monthly','promote','busier','last food'],body:'Add events that repeat, e.g. Open Mic Night on the last Sunday of every month from 8pm with last food orders at 7pm. They show in Forecast key dates with a Promote button and on Today, and \u201cExpect busier\u201d raises the forecast.',steps:['Open More \u203a Settings \u203a Advanced \u203a Regular events.','Tap Add a regular event (or Edit).','Pick how it repeats and the day, add a start time and last food orders if needed.','Tap Save event.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-events'},hint:'Regular events are here.'}},{id:'adv-hours',kind:'guide',topic:'Settings',title:'Kitchen hours, seasons and special days',keywords:['advanced','hours','kitchen','season','winter','summer','special day','closed','last food orders','cutoff'],body:'Kitchen (food) hours decide which booking times are offered; the closing time is last food orders. Keep Winter and Summer hours, each with the date it starts every year, and the app switches by itself. Add special days for one-off changes.',steps:['Open More \u203a Settings \u203a Advanced \u203a Kitchen hours.','Tap Set Summer hours, fill in each day and the start date (e.g. 04-01 for 1 April).','Set the Winter start date too.','Use Add a special day for closures or late nights.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-hours'},hint:'Kitchen hours and seasons are here.'}},{id:'adv-home',kind:'faq',topic:'Settings',title:'Covers counter, Next table free and takeaway on home screens',keywords:['advanced','covers counter','takeaway','next table free','home','display','flip'],body:'Turn the COVERS counter and the \u201cNext table free\u201d card on or off, and choose whether takeaway figures show on home screens (off at the Anchorage). Takeaway order alerts always work. The flap click sound is set on each Display.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-home'},hint:'Display and home options are here.'}},{id:'adv-holidays',kind:'faq',topic:'Settings',title:'Why don\u2019t bank holidays say \u201c(substitute day)\u201d?',keywords:['advanced','holiday','substitute','bank holiday'],body:'The date already shows when a holiday moves, so the extra words are hidden. Tick \u201cShow full gov.uk names\u201d in Settings \u203a Advanced \u203a Holiday names to bring them back.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-holidays'},hint:'Holiday names are here.'}},{id:'adv-blocks',kind:'guide',topic:'Settings',title:'Lunch and dinner times for Block now',keywords:['block','lunch','dinner','service','wix','advanced','pause'],body:'Settings \u203a Advanced \u203a Block bookings sets when Lunch and Dinner run, for the Block now buttons and Spend per head. At The Anchorage, blocks also close those times on website bookings, and blocks made on the website show in CoverCharge. Website bookings can only close the whole venue, not one area or some tables.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-blocks'},hint:'Block bookings settings are here.'}},{id:'blocks-screen',kind:'guide',topic:'Bookings',title:'Block bookings: today, a future date, an area or some tables',keywords:['block','blocks','pause','close','closed','stop bookings','private','repeat','future'],body:'Tap Block bookings on the home screen. Block now pauses bookings today (Rest of today, Next hour, Lunch, Dinner, or a From\u2013To). Add a block closes a future date or range, the whole day or set times, the whole venue, one area or some tables, once or every week or on the last weekday of the month. Every future block is listed by month with Edit and Remove; removing asks first and is logged. Bookings already made are kept, and you are told how many.',showMe:{tab:'more',page:'blocks',target:{testID:'blocks-screen'},hint:'Block bookings is here.'}},{id:'spend-per-head',kind:'guide',topic:'Money',title:'Spend per head',keywords:['spend per head','sph','average spend','takings','covers','gross'],body:'Spend per head is Gross takings \xf7 Covers, by day, by week and for lunch and dinner. Enter the gross on the cash up (Enter the cash up, Upload a spreadsheet, or Enter takings). Covers are seated and finished bookings and walk-ins; no-shows and cancellations are left out. A day with no takings shows \u201cNo takings entered\u201d, never \xa30.',showMe:{tab:'more',page:'spendhead',target:{testID:'sph-screen'},hint:'Spend per head is here.'}},{id:'cashup-photo',kind:'guide',topic:'Money',title:'Enter the cash up, or upload a spreadsheet',keywords:['cash up','paid out','spreadsheet','csv','excel','xlsx','sheet','gross','card','cash','tips','takings','drawer'],body:'In Cash up & sales tap Enter the cash up and type the figures (Z total, card, cash, paid outs, tips, and gross if you have it). In Paid out, add a line for each amount taken from the till \u2014 for example lobsters or supermarket shopping \u2014 with the amount, an optional note, and your name. The paid-out total comes off the expected cash in the drawer. Check every figure, then tap Confirm and save. Bigger venues can tap Upload a spreadsheet (CSV or Excel): match the columns, check the preview (dates already saved are flagged), then confirm. Nothing is saved before you confirm, and every save is logged. You can export cash ups as a spreadsheet from Recent cash ups.',showMe:{tab:'more',page:'cashup',target:{testID:'cashup-by-hand'},hint:'Start the cash up here.'}},{id:'adv-giftqr',kind:'guide',topic:'Settings',title:'Buy a gift card on the Display',keywords:['gift','gift card','voucher','qr','display','wix','advanced'],body:'Switch on \u201cShow Buy a gift card on the Display\u201d in Settings \u203a Advanced \u203a Gift cards on the Display, and save your gift card page address. The Display has a Gift vouchers button: it opens the list of website vouchers (search, use by dates, Mark as used), with Show the buy QR code at the bottom. Guests buy on your website.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-giftqr'},hint:'Gift cards on the Display are here.'}},{id:'adv-whatsapp',kind:'guide',topic:'Settings',title:'WhatsApp buttons (tap to chat)',keywords:['whatsapp','wa.me','message','chat','guest','mobile','number','advanced'],body:'Put the venue\u2019s WhatsApp number in Settings \u203a Advanced \u203a WhatsApp, e.g. 01292 500123 or +44 7700 900123. Guests then see \u201cMessage us on WhatsApp\u201d on their booking confirmation, with their booking details typed in. Staff and managers see \u201cWhatsApp guest\u201d on bookings with a mobile number, with a confirmation typed in that you can change. Nothing is ever sent for you: WhatsApp opens and you tap Send yourself. Leave the number blank and every WhatsApp button stays hidden. Reset to default clears the number.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-whatsapp'},hint:'The WhatsApp number is here.'}},{id:'adv-reminders',kind:'guide',topic:'Settings',title:'Staff reminders: breaks and \u201cchairs up\u201d',keywords:['reminder','reminders','break','breaks','chairs','closing','6 hours','law','snooze','later','done','advanced'],body:'Reminders slide up for staff who are on shift right now (clocked in, or on the rota at that time) in the Staff and Head Chef apps, while the app is open. Break reminders: if the rota shift has a break time, the reminder comes at that time; if not, it comes 4 hours after they clock in (or after the shift starts). If they still haven\u2019t started a break it comes once more 30 minutes later, and again at 6 hours, because UK law says a shift over 6 hours needs a 20-minute break. \u201cStart break\u201d starts their break; \u201cLater\u201d hides it for 15 minutes. You can change these times. Venue reminders, such as \u201cTime to put the chairs up on the tables\u201d (Friday and Sunday, 21:00), have wording, days, a time (UK) and who sees them: everyone on shift, front of house or kitchen. Pause, edit or delete any of them, or add your own. Once anyone taps Done it goes for everyone that day, and the Reminders screen shows who did it. Reset to default brings back the standard break times and \u201cchairs up\u201d; your own reminders stay. Phones with the app closed don\u2019t get reminders yet.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-reminders'},hint:'Reminders are here.'}},{id:'adv-notifications',kind:'guide',topic:'Settings',title:'Scheduled notifications (e.g. the Mills milk order)',keywords:['notification','notifications','push','phone','milk','mills','pieroni','pieronis','veg','olsen','rota upload','scheduled','advanced'],body:'Settings \u203a Advanced \u203a Notifications lists reminders that go to named people at a set UK time, such as \u201cMills milk order\u201d for the Head Chef and Gordon. Each has a title, a message, the days, a time (you can set a different time on some days, e.g. 20:55 on Fridays), who gets it (tick people or pick a group like Everyone on shift) and how it is sent. In the app it is the gold slider with Done and Later; Done is logged with the name and time, and Later hides it for 15 minutes. Urgent notices (like the 6-hour break) always come first and only one shows at a time. Phone notifications: each person taps \u201cTurn on phone notifications\u201d on their own phone (iPhone: add the app to the Home Screen first, iOS 16.4 or later). Nothing goes to phones until an owner or manager switches \u201cSend to phones\u201d on. The Display never gets these. Reset to default restores the configured rules.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-notifications'},hint:'Notifications are here.'}},{id:'adv-order-lists',kind:'guide',topic:'Settings',title:'Order lists (Alsons, Cash and carry)',keywords:['order list','orders','alsons','drinks','cash and carry','trip','shopping','logo','carry over','advanced'],body:'Order lists collect what you need from a supplier. A running list (Alsons drinks) fills up until you order; a trip list (Cash and carry) is for a shopping day, Friday by default, which you can change for each trip. Add an item with a quantity and unit and an optional note; the app records who added it and when. Adding something already on the list offers to add to the quantity instead. On the day, tick Got or Ordered, or mark Missing / not in stock. Finish order saves it to History (date and who) and asks whether to carry over anything not got. Removing an item can be undone. Settings \u203a Advanced \u203a Order lists: add, rename or archive lists, the default trip day, and \u201cLet all staff add items\u201d (on: staff can add and see lists; only managers and the Head Chef tick, remove or finish). Each list can have a logo (take a photo or choose one) or shows its initials, and a phone number to tap to call (never called for you).',showMe:{tab:'more',page:'advanced',target:{testID:'adv-orderlists'},hint:'Order list settings are here.'}},{id:'adv-clock-area',kind:'guide',topic:'Settings',title:'Clock-in area, forgotten breaks and off-rota arrivals',keywords:['clock','clock in','geofence','location','area','radius','break','forgot','rota','visiting','override','advanced'],body:'Clock in, clock out, start break and end break only work at the venue once the centre is set. Stand in the middle of the venue and tap \u201cUse my current location\u201d, then choose how far (at least 50 m, 100 m to start). Phones are not exact, so up to 50 m of the phone\u2019s own accuracy is allowed on top. Each clock record keeps the reading, its accuracy and whether it was inside. If location is off or blocked, the app says how to allow it. Managers can record it for someone from Clock in / out \u203a Record it for someone, with a reason that is logged. Until the centre is set nobody is blocked and managers see a warning. Rota and pay screens are never blocked. Forgotten breaks: if no break was recorded, Clock out asks \u201cDid you take a break? If so, how long?\u201d; a length you pick is saved as a break marked \u201cadded at clock-out\u201d, which managers see and can edit in Hours. Not on the rota: if someone is at the venue, not clocked in and not on the rota, the Staff and Head Chef apps ask \u201cDo you want to sign in?\u201d. Yes clocks them in, marked off-rota, and managers get a notice; \u201cNo, just visiting\u201d stops asking for the day. This only checks while the app is open; web apps can\u2019t watch location in the background.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-clockarea'},hint:'Clock-in area settings are here.'}},{id:'adv-tablegrid',kind:'guide',topic:'Table plan',title:'Table plan grid and Tidy up (Advanced)',keywords:['grid','snap','line up','align','tidy','guides','spacing','restore','table plan','option','alt'],body:'Tables snap to the grid when you drag them, and gold guides show when an edge or centre lines up with another table. A small number shows when the gaps either side are even. Hold Alt (Option on a Mac) to move freely. Tidy up lines every table up on the grid and evens out the rows; only positions change. The old positions are kept, so one tap puts them back.',steps:['Go to Settings \u203a Advanced.','Find Table plan grid.','Turn snapping on or off, pick a grid size, or tap Tidy up the whole plan.','Changed your mind? Tap Put the tables back where they were.']},{id:'adv-printers',kind:'guide',topic:'Orders',title:'Kitchen ticket printers (Advanced)',keywords:['print','printer','printing','ticket','kitchen ticket','docket','receipt','epson','star','bluetooth','reprint','takeaway'],body:'Print a kitchen ticket by itself for every takeaway order, as soon as it comes in or when it is accepted. The ticket has the order number, collection time, name, every dish with its options and notes, allergies in white-on-black, and paid or not paid. Works with Epson (TM-m30, TM-T20, TM-T88), Star WebPRNT, most other network receipt printers (port 9100) and Bluetooth printers from the tablet app. If a ticket does not print, an amber warning shows and the order stays on screen.',steps:['Go to Settings \u203a Advanced.','Find Printers.','Tap Add a printer by IP address or Find printers on this Wi-Fi, choose the type and tap Test print.','Turn on Print a kitchen ticket for every takeaway order.']},{id:'adv-deposits',kind:'guide',topic:'Bookings',title:'Deposits (Advanced)',keywords:['deposit','deposits','per person','per adult','children','waive','waived','regular','party size','refund','refundable','cut off','policy','paid','due'],body:'Ask bigger tables for a deposit: set the amount per adult (children never pay: a table of 8 with 3 children pays for 5), the smallest party that pays one, whether it is refundable and up to how many hours before, and the words guests see. No card is saved in CoverCharge. Deposits are paid through website bookings: website bookings show Deposit paid on website bookings, Part paid on website bookings or Deposit not paid by themselves. For phone and walk-in bookings, staff tick Deposit paid once the guest has paid you, or (once switched on) press Send deposit link to send a website bookings pay link by text, WhatsApp or email. Refunds are done in Website bookings \u203a Orders. Deposit amounts are shown on bookings in Managers, Display and Staff. Other financial and HR information remains restricted.',steps:['Go to Settings \u203a Advanced.','Find Deposits.','Turn deposits on or off, and set the amount, party size, refund terms and the words guests see.','On a booking, tap Mark deposit paid once the guest has paid.','To let a regular off, tap Waive deposit on the booking (or in Edit booking), add why if you like, and tap Yes, waive it. Your name is saved with it.']},{id:'adv-loyalty',kind:'guide',topic:'Guests',title:'Loyalty: stamp card, offers & bring a friend (Advanced)',keywords:['loyalty','stamp','stamps','card','reward','offer','offers','referral','friend','expiry'],body:'The stamp card, offers and bring-a-friend are saved on the server, so every phone and tablet shows the same card. Set how many stamps earn a reward, what the reward is, when stamps or rewards run out, and how often one guest can get a stamp. Stamps only come from staff, or from a code or QR staff make, and each reward can be used once. Guests join with their agreement recorded, and a manager can remove a guest and their details.',steps:['Go to Settings \u203a Advanced.','Find Loyalty.','Turn the stamp card on, write the reward and tap Save loyalty settings.','Add offers with their dates, and turn bring-a-friend on if you want it.']},{id:'adv-table-order',kind:'guide',topic:'Guests',title:'Order at the table (Advanced)',keywords:['order at table','qr','qr code','scan','table','phone','accept','last orders','print','pdf','pay at bar'],body:'Guests scan the small QR card on their table (Managers \u203a Table QR codes prints them, 20 to a page), see your menu with allergens, and send an order. It lands in Front of House and on the kitchen screen within seconds. Prices, sold-out dishes and hours are checked on the server, so a phone can\u2019t change them. Staff accept the first order from each new phone (you can turn this off). Guests pay at the bar or with their server; paying by card from the phone is coming later.',steps:['Go to Settings \u203a Advanced.','Find Order at the table.','Turn it on, pick the areas or tables, set the hours and tap Save order at the table.','Tap Make codes, pick Stickers 50 \xd7 50 mm or Stand cards 50 \xd7 70 mm, then Print all QR cards (PDF) and put each code on its table.']},{id:'adv-soldout',kind:'guide',topic:'Menu',title:'Sold out reminders (Advanced)',keywords:['sold out','86','clear','end of service','next morning','back on','advanced','display strip','automatic','counts','lobster','crab'],body:'Choose when sold out dishes go back on by themselves: when the kitchen closes (from your Kitchen hours), the next morning (pick the time), or only when someone taps Back on. \u201cMark dishes sold out from the counts\u201d (on unless you turn it off) marks every dish that uses a counted item, like lobster or crab, when the count runs out, and puts it back on when the count is back up. Sold out is a reminder for staff on the Display and in the staff apps; it doesn\u2019t change your till.',steps:['Go to Settings \u203a Advanced.','Find Sold out reminders.','Pick when they clear, and turn marking from the counts on or off.']},{id:'sold-out-auto',kind:'guide',topic:'Menu',title:'Sold out from the counts (lobster, crab\u2026)',keywords:['sold out','automatic','auto','counts','shellfish','lobster','crab','platter','link','uses','none left'],body:'When a counted item runs out, or drops below what a dish needs, every dish that uses it is marked sold out by itself, with the reason: \u201cDeluxe Seafood Platter (no lobster or crab)\u201d. When the count is back up (a delivery or a recount), those dishes go back on by themselves. Dishes marked by hand are left alone. CoverCharge works out what each dish uses from its recipe card, its description (\u201cone whole lobster\u201d) or its name; you can change it for any dish. If you tap Back on while the count is still short, the dish stays on until the count changes.',steps:['Open the Sold out list.','Under Dishes linked to the counts, tap Change next to a dish.','Set how many of each item one portion uses (0 = not linked), then tap Save. Back to automatic undoes it.'],showMe:{tab:'more',page:'soldout',target:{testID:'soldout-links'},hint:'Tap Change next to a dish to set what it uses.'}},{id:'adv-forecast',kind:'guide',topic:'Forecasts',title:'Forecast history and "Not enough history yet"',keywords:['forecast','not enough history','history','estimate','example figures','labour','sales','walk-ins','advanced'],body:'Forecasts are built only from your own bookings, seated walk-ins, takeaway orders and cash-ups. Until CoverCharge has enough of your history (2 weeks to start with; change it in Settings \u203a Advanced \u203a Forecast history) you see \u2018Not enough history yet\u2019, what is already booked and your real labour cost from the rota, with no sales forecast or labour %. No history is invented for a live venue.',steps:['Go to Settings \u203a Advanced.','Find Forecast history.','Pick how many weeks are needed.']},{id:'adv-checkout',kind:'guide',topic:'Team',title:'Shift check-out, question board and team morale',keywords:['check out','checkout','morale','mood','staffing','overstaffed','survey','anonymous','question board','vote','shout out','wellbeing','advanced'],body:'When someone clocks out, they get a quick card: team morale from Low to High, and whether there was enough staff for the customers. They can also post a question for the board or shout out a teammate, or tap Skip. Nothing shows at clock in. Answers are anonymous: no name or staff number is saved, and each phone can answer a shift once. Team morale (Managers app \u203a More \u203a Team morale) shows a day only once 3 or more people have answered, next to that day\u2019s covers. Change the wording or switch parts off here.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-checkout'},hint:'Check-out and board settings are here.'}},{id:'hr-board',kind:'guide',topic:'Team',title:'The anonymous question board',keywords:['question board','board','anonymous','vote','yes no','reply','hide','moderation','log'],body:'Anyone on the team can post a question and vote it up, or vote Yes or No. No names are shown or saved. Owners and managers can reply (shown as \u201cReply from the managers\u201d) and hide offensive posts with a reason. Every hide, unhide and reply is in the Moderation log.',showMe:{tab:'more',page:'board',hint:'The question board.'}},{id:'adv-tasks',kind:'guide',topic:'Team',title:'Daily tasks',keywords:['tasks','daily tasks','checklist','duties','jobs','to do','my tasks','library','head chef'],body:'Give each person a short list of daily tasks: open Staff & roles, tap Daily tasks on their card, then pick from the venue\u2019s task library or type a new one. Use the arrows to reorder, \u2715 to remove (with Undo) and Days to limit a task to certain days. They see \u201cMy tasks today\u201d on their home screen and tick each one off while on shift; each tick records who and when, and you see \u201c2 of 5 done today\u201d on their card. Lists start fresh every day. Owners and managers can change anyone\u2019s list, including the Head Chef\u2019s. The Head Chef can change the lists of kitchen staff (chefs, commis and KPs) from Kitchen \u203a Kitchen team tasks, but not their own and not front of house. The task library is in Settings \u203a Advanced \u203a Tasks.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-tasks'},hint:'The task library is here.'}},{id:'adv-cashup',kind:'guide',topic:'Money',title:'Cash up and weekly sales',keywords:['cash up','cashup','takings','float','till','sales report','weekly sales','pos','printout','photo','graphs','charts'],body:'At the end of the night open Cash up & sales and tap Enter the cash up. Type each figure; boxes left blank stay blank (never counted as zero) and are highlighted in amber. Add any cash paid out of the till (lobsters, supermarket shopping, and the like) in the Paid out section: each line has what it was for, the amount, an optional note and who entered it. The total reduces the expected cash in the drawer. Nothing is saved until you tap Confirm and save. Do the same with the weekly sales report from the till (several pages is fine). The graphs show daily takings, tips, weekly net sales against the week before and sales by category. Owners and managers can enter and change cash ups; the Head Chef can see the graphs if they are allowed to see takings. Change the boxes to match your sheet in Settings \u203a Advanced \u203a Cash up; Cash tips total and Card tips total are always kept.',showMe:{tab:'more',page:'cashup',target:{testID:'cashup-by-hand'},hint:'Start the cash up here.'}},{id:'adv-tips',kind:'guide',topic:'Money',title:'Today\u2019s tips and the Tips pot',keywords:['tips','today tips','tips pot','pot','payout','tip pay','correction','coins'],body:'When a cash up with Cash tips total and Card tips total is confirmed, the team\u2019s combined tips for that day show as Today\u2019s tips in every staff app and on the Display, with a short notice. The Tips pot adds up confirmed daily tips since the last payout (fortnightly tip pay). After paying the tips, an owner or manager taps Mark payout done on the Tips pot card: the pot goes back to \xa30.00 and the old pot is kept in Past pots. Use Correct an entry to add or take off an amount for a day; a reason is required and every correction is logged with your name. Only the team total is ever shown, never anyone\u2019s share. Hide either card in Settings \u203a Advanced \u203a Tips.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-tips'},hint:'Show or hide the tips cards here.'}},{id:'manager-access',kind:'guide',topic:'Team',title:'Manager access',keywords:['manager access','manager','access','role','promote','front of house','head chef','owner'],body:'In Staff & roles each person has a Manager access switch. On: they use the Manager app (rota, bookings, staff, hours, settings, plus their own clock in, rota and pay). Off: they use the Front of House app, or the Head Chef app for the Head Chef. Owners can switch anyone except owners; managers can switch anyone except themselves and owners. The last owner can never be removed. You confirm each change; it is logged with who and when (Access changes). Job titles are free text and don\u2019t change.',showMe:{tab:'more',page:'staff',target:{testID:'access-tip'},hint:'Manager access switches are on each person.'}},{id:'next-table-free',kind:'faq',topic:'Walk-ins',title:'When is the next table free?',keywords:['next table','free','wait','walk-in','quote','full'],body:'When you\u2019re full, Today and the Display show \u201cNext table free about 19:40 (T6, 4 seats)\u201d with \u201clikely\u201d or \u201cmaybe\u201d, and how long a walk-in for 2 or 4 would wait. Tap Bill requested or Table finished on the plan and it updates. You can also ask the Assistant \u201cwhen\u2019s the next table free?\u201d.'},{id:'time-travel',kind:'faq',topic:'Today',title:'Look at another day (time travel)',keywords:['yesterday','tomorrow','next week','past','future','day','time travel'],body:'On Today, tap \u2039 or \u203a beside the date to step a day back or forward. You\u2019ll see that day\u2019s kitchen hours, events, covers (booked, or how it went), platters and each booking\u2019s allergens and needs. It\u2019s read-only and nothing changes live service. Tap Today to come back. The Display goes back to today by itself after 2 minutes. Staff can look 7 days back and 14 days ahead.'},{id:'sign-in-links',kind:'guide',topic:'Team',title:'Personal sign-in links',keywords:['link','invite','sign in','new link','expired','already used','phone','login'],body:'Each personal link works on one phone only and lasts 5 days, so nobody else can sign in as that person. The same phone can open it again, in any of the apps. If someone gets a new phone, or their link has expired, open Staff & roles, tap New sign-in link on their entry, then Copy link and send it to them yourself. The app never sends it. Owners can make links for anyone; managers for anyone except owners. Their old unused link stops working; phones already signed in stay signed in.',showMe:{tab:'more',page:'staff',target:{testID:'access-tip'},hint:'New sign-in link is on each person.'}},{id:'pins-security',kind:'faq',topic:'Team',title:'PINs for the Display',keywords:['pin','display pin','clock in','wake pin','2580','manager pin','locked'],body:'Staff PINs for clocking in at the Display are 4 to 8 digits. Managers and owners need 6 to 8 digits, because their PIN can add temp staff. Easy PINs such as 1111 or 1234 are refused. Five wrong tries locks that person for 15 minutes; 20 wrong tries on one Display stops it for 15 minutes. The Display wake PIN (Settings \u203a Display) is 6 to 8 digits and is kept only as a scrambled hash. If it still says 2580, change it.'},{id:'cash-up-lock',kind:'faq',topic:'Money',title:'Correcting a signed-off cash up',keywords:['cash up','locked','unlock','correct','mistake','history','audit','sales report'],body:'Once a cash up or weekly sales report is confirmed and saved, it is locked so the figures can\u2019t change quietly. An owner taps Unlock to correct on it, says why, and has 30 minutes to fix it. History on each one shows who signed it off, changed or unlocked it, and when.'},{id:'wipe-device',kind:'faq',topic:'Settings',title:'Sign out and wipe a shared tablet or phone',keywords:['wipe','sign out','shared','tablet','leaver','lost','reset device'],body:'Tap the sync badge (bottom left), or go to Settings \u203a Display, and choose Sign out and wipe this device. It signs out and removes everything CoverCharge keeps on that device: sign-ins, pairing, saved screens and changes not sent yet. The venue\u2019s shared data is not touched. On the Display you type the wake PIN first.'}],o=t=>a.find(a=>a.id===t)},1511,[]); +__d(function(g,r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"HELP_TOPICS",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"HELP",{enumerable:!0,get:function(){return a}}),Object.defineProperty(e,"helpById",{enumerable:!0,get:function(){return o}});const t=['Bookings','Walk-ins','Table plan','Rota','Hours & pay','Tips','Team','Suppliers','Stock','Recipe cards','Displays','Settings','Accounts'],a=[{id:'new-booking',kind:'guide',topic:'Bookings',title:'Take a phone booking',keywords:['booking','reservation','book','table','phone','covers','reserve'],body:'Add a booking for a guest who calls or walks up to ask. The app only offers times that are really free.',steps:['Open Bookings (or tap New booking on Today).','Pick the date, time and number of covers.','Add the guest\u2019s name and phone, plus any allergies or notes.','Tap Save. The booking appears on the timeline and the floor plan.'],showMe:{tab:'bookings',target:{testID:'add-booking'},hint:'Tap New booking to start a booking.'}},{id:'move-booking',kind:'faq',topic:'Bookings',title:'How do I move a booking to another table or time?',keywords:['move','change','reschedule','table','booking','swap'],body:'Open the booking from Bookings or the timeline and tap Edit, or drag it to another table on the Display. Guests are not messaged unless you choose to.',showMe:{tab:'bookings',target:{testID:'add-booking'},hint:'Your bookings list is here. Tap a booking to change it.'}},{id:'walk-in',kind:'guide',topic:'Walk-ins',title:'Seat a walk-in',keywords:['walk-in','walkin','walk in','seat','no booking','covers','party'],body:'Record guests who arrive without a booking so the floor plan and covers stay right.',steps:['On the Display (the venue tablet), tap Walk-in. On a phone, say \u201cadd a walk-in for 2\u201d to the Assistant.','Choose the number of covers.','Pick a free table (the best fit is suggested).','Tap Seat. The table shows as seated.'],actions:['add_walkin']},{id:'table-plan',kind:'guide',topic:'Table plan',title:'Edit the table plan',keywords:['table plan','floor plan','layout','tables','move tables','designer','areas','seats'],body:'Drag tables into place, set seats, join tables and add areas such as Terrace or Garden.',steps:['Go to More \u203a Table plan.','Tap Open the designer.','Drag tables, or tap one to change its name and seats.','Tap Save. Displays and bookings use the new plan straight away.'],showMe:{tab:'more',page:'tableplan',target:{testID:'open-designer'},hint:'Open the designer to move tables.'}},{id:'rota',kind:'guide',topic:'Rota',title:'Build and publish the rota',keywords:['rota','shift','schedule','week','publish','staff hours','add shift'],body:'Plan the week, then publish it so staff see their shifts in the Staff app.',steps:['Go to More \u203a Rota.','Tap a person\u2019s day to add a shift (presets: lunch, dinner, double).','New shifts are drafts with a dashed amber border.','Tap Publish when the week is ready. Staff see only published shifts.'],showMe:{tab:'more',page:'rota',target:{testID:'rota-publish'},hint:'Tap a day to add a shift, then Publish here.'},actions:['add_rota_shift','publish_rota']},{id:'rota-copy',kind:'faq',topic:'Rota',title:'Can I copy last week\u2019s rota?',keywords:['copy','last week','repeat','rota','duplicate'],body:'Yes. On the Rota tap Copy last week. The shifts come over as drafts so you can tweak them before publishing.',showMe:{tab:'more',page:'rota',target:{testID:'rota-copy'},hint:'Copy last week\u2019s shifts as drafts.'}},{id:'sign-off',kind:'guide',topic:'Hours & pay',title:'Sign off hours',keywords:['sign off','signoff','confirm hours','approve','timesheet','clock','pending'],body:'Only confirmed hours count for pay and tips. Check clocked times against the rota and confirm them.',steps:['Go to More \u203a Sign off hours.','Flagged days (late, missing clock-out, long breaks) are at the top.','Tap a row to fix a time; give a short reason.','Tap Confirm all unflagged, then deal with the rest.'],showMe:{tab:'more',page:'signoff',target:{testID:'confirm-unflagged'},hint:'Confirm all the days that look right in one tap.'}},{id:'payroll-hours',kind:'guide',topic:'Hours & pay',title:'Export hours for payroll',keywords:['payroll','export','hours','spreadsheet','csv','excel','accountant','copy','print'],body:'Get each person\u2019s confirmed hours for a pay period into your spreadsheet or to your accountant.',steps:['Go to More \u203a Payroll hours.','Pick the pay period (or a tips fortnight, or a custom range).','Check the pending banner: sign those off first if you can.','Tap Copy for spreadsheet and paste into Excel or Google Sheets, or download a CSV, or print.'],showMe:{tab:'more',page:'hours',target:{testID:'copy-tsv'},hint:'Copy, then paste straight into your spreadsheet.'}},{id:'pay-dates',kind:'faq',topic:'Hours & pay',title:'How do I set our pay dates?',keywords:['pay day','payday','pay dates','cut-off','wages','monthly','fortnightly'],body:'Settings \u203a Pay & tips: set when tips are paid and how often, the wage pay day and the cut-off. Payroll hours and Tips day use these dates.',showMe:{tab:'more',page:'paysettings',target:{testID:'save-pay'},hint:'Change the dates above, then Save.'}},{id:'tips-day',kind:'guide',topic:'Tips',title:'Share out tips on tips day',keywords:['tips','tronc','gratuity','share','split','tips day','service charge'],body:'Enter the tips total and it\u2019s shared by confirmed hours for the fortnight, to the penny.',steps:['Go to More \u203a Tips day (the right fortnight is picked for you).','Type the total tips.','Check anyone with pending hours; sign them off first if you can.','Copy or download the split for payroll.'],showMe:{tab:'more',page:'tipsday',target:{testID:'tips-total'},hint:'Type the tips total here.'}},{id:'invites',kind:'guide',topic:'Team',title:'Invite staff to the app',keywords:['invite','link','staff app','new starter','sign in','add staff','team member'],body:'Each person gets their own sign-in link. You choose when and how to share it.',steps:['Go to Settings \u203a Invite links.','Tap Make invite link next to the person.','Share the link yourself (text or WhatsApp). The app never sends it for you.','They tap it once and the Staff app remembers them.'],showMe:{tab:'more',page:'setup-invites',target:{text:'Make invite link'},hint:'Make a personal link, then share it yourself.'}},{id:'suppliers',kind:'guide',topic:'Suppliers',title:'Suppliers and order sheets',keywords:['supplier','order','order sheet','delivery','cut-off','fish','veg','dairy'],body:'Keep supplier contacts, order days and cut-offs together, and log what you ordered.',steps:['Go to More \u203a Suppliers to add or edit a supplier.','Use Supplier order sheets for the items you usually order.','Tap Log an order after you place it by phone or email.'],showMe:{tab:'more',page:'ordersheets',target:{testID:'sheet-add'},hint:'Add an order sheet for a supplier.'}},{id:'display-glance',kind:'guide',topic:'Display',title:'Today at a glance (Display)',keywords:['glance','today','covers by hour','breaks','on now','next','cut-off','cutoff','order times','display bar'],body:'The bar under the Display header shows today in one line: covers by hour (booked in solid gold, the walk-in estimate dashed), quiet times for breaks, who is on now and next, today\u2019s supplier order cut-offs with a countdown (amber under 30 minutes) and one tip. Cut-offs come from Scheduled notifications.'},{id:'sold-out',kind:'guide',topic:'Menu',title:'Sold out dishes',keywords:['sold out','run out','ran out','none left','back on','86','eighty six','display strip'],body:'When a dish runs out, mark it sold out so every member of staff knows. It\u2019s a reminder for staff: CoverCharge doesn\u2019t link up to your till, so it doesn\u2019t change the till. Sold out dishes show in a slim strip along the bottom of the Display within seconds, and in the Sold out list in Front of House, Managers and Head Chef. They clear by themselves when the kitchen closes (or the next morning, or only when you tap Back on: Settings \u203a Advanced \u203a Sold out reminders).',steps:['Open the Sold out list (Managers: More \u203a Sold out; Front of House: Me \u203a Sold out; Head Chef: Kitchen \u203a Live tickets \u203a Sold out).','Tap Mark sold out next to the dish.','When it\u2019s back, tap Back on.'],showMe:{tab:'more',page:'soldout',target:{testID:'soldout-search'},hint:'Find the dish, then tap Mark sold out.'}},{id:'shellfish',kind:'guide',topic:'Stock',title:'Live shellfish (and other) counts',keywords:['shellfish','lobster','crab','oysters','count','stock','tracked','sold out','86'],body:'Counters for things you sell by the unit, like lobster or crab. They show on the Display and warn when low.',steps:['Go to Settings \u203a Tracked stock.','Tap Add an item to track; set the name, icon and low warning.','Staff update the count from the small lobster and crab chip at the top of the Display, or in the app.'],showMe:{tab:'more',page:'trackedstock',target:{text:'Add an item to track'},hint:'Add something to count, like lobster.'}},{id:'recipe-cards',kind:'guide',topic:'Recipe cards',title:'Recipe cards',keywords:['recipe','card','dish','ingredients','method','allergens','spec'],body:'Photo, ingredients, method and allergens for each dish; the head chef signs them off and staff can read them.',steps:['Go to More \u203a Recipe cards.','Search for a dish or add a new one.','Fill in ingredients (allergens are suggested) and the method.','Send for head chef sign-off.'],showMe:{tab:'more',page:'recipecards',target:{testID:'card-search'},hint:'Search your recipe cards here.'}},{id:'display-pair',kind:'guide',topic:'Displays',title:'Pair a display or tablet',keywords:['display','tablet','pair','screen','code','front of house','kitchen screen'],body:'Connect a tablet to your venue with a one-time code. You can switch any display off from here.',steps:['Open the Display app on the tablet.','In Managers go to Settings \u203a Displays and tap Make a pairing code.','Type the code on the tablet. It joins your venue straight away.'],showMe:{tab:'more',page:'displays',target:{text:'Make a pairing code'},hint:'Make a one-time code for the tablet.'}},{id:'settings-hours',kind:'faq',topic:'Settings',title:'How do I change our opening hours?',keywords:['opening hours','hours','closed','open','kitchen hours','times'],body:'Settings \u203a Opening hours. Guests see these on your booking and order pages; bookings outside them are turned away.',showMe:{tab:'more',page:'setup-hours',hint:'Set each day\u2019s opening and closing time here.'}},{id:'replay-setup',kind:'faq',topic:'Settings',title:'Can I see the welcome walkthrough again?',keywords:['welcome','setup','walkthrough','onboarding','checklist','questionnaire'],body:'Yes: Settings \u203a Setup checklist \u203a Replay welcome. Everything is pre-filled from your questionnaire.',showMe:{tab:'more',page:'setupchecklist',target:{testID:'replay-welcome'},hint:'Replay the welcome walkthrough.'}},{id:'connected-accounts',kind:'guide',topic:'Accounts',title:'Connect your email, website and socials',keywords:['connect','account','gmail','outlook','wix','facebook','instagram','square','xero','quickbooks','login'],body:'Settings \u203a Connected accounts: tap a logo, save the account to your list, and use Connect with\u2026 to sign in on that service\u2019s own page (rolling out service by service; it shows Coming soon until then). CoverCharge never sees your password that way, and you can remove an account any time.',steps:['Go to Settings \u203a Connected accounts.','Tap the service\u2019s logo.','Tap Connect with\u2026 and sign in on their page.','To stop, tap Remove.'],showMe:{tab:'more',page:'connections',target:{testID:'conn-tile-gmail'},hint:'Tap a logo to connect that account.'}},{id:'supplier-portals',kind:'guide',topic:'Suppliers',title:'Order from your suppliers',keywords:['bidfood','booker','wholesale','cash and carry','order online','supplier login','account number','customer number'],body:'Settings \u203a Connected accounts \u203a Suppliers. Add supplier links for this venue, with an account number if you like. Open ordering and Log in open the supplier\u2019s own website, where you sign in; CoverCharge never keeps the password.',steps:['Go to Settings \u203a Connected accounts.','Scroll to Suppliers.','Tap Add against a supplier (account number optional).','Tap Open ordering or Log in whenever you need them.','To stop, tap Remove and confirm.'],showMe:{tab:'more',page:'connections',target:{testID:'portal-bidfood'},hint:'Your supplier ordering websites live here.'}},{id:'support',kind:'faq',topic:'Settings',title:'How do I get help from a person?',keywords:['support','help','contact','person','problem','broken','stuck'],body:'Support is free for life. Message the CoverCharge team from Settings \u203a Help, or email us, and we\u2019ll reply. We help by message and email.'},{id:'assistant-safe',kind:'faq',topic:'Settings',title:'Can the Assistant send or pay for things by itself?',keywords:['assistant','safe','confirm','send','pay','delete','ai'],body:'No. The Assistant and the voice helper show you exactly what they will do and wait for you to tap Confirm (or say yes). Anything that would send a message, order from a supplier or pay is only saved as a draft in Drafts for approval; nothing goes out by itself.'},{id:'restaurant-dashboard',kind:'guide',topic:'Bookings',title:'Restaurant dashboard',keywords:['restaurant dashboard','tables','timeline','guests','covers','joined tables'],body:'In Managers, tap Restaurant dashboard on Home, or More > Run the day > Restaurant dashboard. It is the same live table plan, Timeline, guest list, deposits, dogs, joined tables, Covers, covers-through-the-day chart and block bookings as the Display. Use the day arrows and Back to today. Assign or join tables on any day; seat, finish, no-show and cancel walk-in actions apply today. You can also say \u201copen Restaurant dashboard\u201d. The helper replies in text only.',showMe:{tab:'more',page:'serviceboard',target:{testID:'restaurant-dashboard-close'},hint:'Restaurant dashboard is open. Pick a day, or tap Back to Managers to close.'}},{id:'voice-helper',kind:'guide',topic:'Settings',title:'Use the hold-to-talk voice button',keywords:['voice','talk','speak','microphone','mic','hold','walkie','button','hands free','gloves'],body:'Hold the big gold button, say what you need, then let go. It logs fridge and freezer temperatures, answers allergen questions, marks dishes sold out, checks tables, adds to the waitlist, reads orders and covers, and drafts bookings, offers, events and supplier lists. The helper replies in text only, never aloud. Changes are shown in text first with Confirm and Cancel buttons: tap Confirm or say yes. Tap the button to type instead (in Managers this also opens the Assistant). It sits at the top right of the header in Managers, Head Chef, the Staff app (the full voice assistant, with no money, tips or HR) and on the Display (no money, tips or HR). Until the voice assistant\u2019s server is switched on, anything new says \u201cVoice assistant is switching on soon\u201d. Fair usage: 1,000 voice tasks a month per venue.',steps:['Hold the gold microphone button (the first time, allow the microphone).','Speak, for example \u201cprep fridge 3 degrees\u201d.','Let go to send.','If it reads something back, tap Confirm or hold again and say \u201cyes\u201d.','The button stays at the top right so it never covers the screen.'],showMe:{tab:'more',page:'voice',hint:'Turn the voice button on or off for each role here.'}},{id:'voice-drafts',kind:'faq',topic:'Settings',title:'Where do voice bookings and shopping lists go?',keywords:['drafts','approve','approval','shopping list','booker list','bidfood list','draft booking','offer','event'],body:'To Settings \u203a Drafts for approval. Bookings, supplier lists, offers, events and specials made by voice wait there for an owner or manager. Approving marks it approved and opens the right screen; you still place the order or confirm the booking yourself.',showMe:{tab:'more',page:'drafts',hint:'Drafts from the voice helper wait here.'}},{id:'voice-temps',kind:'guide',topic:'Settings',title:'Log fridge and freezer temperatures by voice',keywords:['temperature','fridge','freezer','haccp','food safety','eho','log temps','probe'],body:'Hold the voice button and say the unit and the number, for example \u201cprep fridge 3, freezer minus 19\u201d. Fridges should be 5\xb0C or colder and freezers -18\xb0C or colder; anything outside is flagged. Everything is in the Food safety log with who and when, ready to export or print for the EHO.',showMe:{tab:'more',page:'haccp',hint:'Every voice reading appears in the food safety log.'}},{id:'voice-fair-usage',kind:'faq',topic:'Settings',title:'Is there a limit on voice tasks?',keywords:['voice','limit','allowance','fair usage','fair use','how many','tasks','month','plan'],body:'Fair usage: 1,000 voice tasks a month per venue. It is one allowance shared by all of the venue\u2019s apps and devices, and it resets on the 1st. Each request counts once, spoken or typed; saying \u201cyes\u201d to confirm does not count again. You will see a note at 80%. If the venue reaches 1,000, the voice helper pauses until the 1st, except food safety and temperature logging, which always works. The owner can contact CoverCharge if you need more. See the count in Plan & billing or Settings \u203a Voice helper.',showMe:{tab:'more',page:'voice',hint:'This month\u2019s voice task count is shown here.'}},{id:'adv-bookings',kind:'guide',topic:'Settings',title:'Booking questions: allergies, dogs, access, vegan',keywords:['advanced','allergen','dog','dogs','cap','wheelchair','access','vegan','vegetarian','table request','settings'],body:'Choose what guests are asked when they book. Allergies are always asked first, in red, and staff tick \u201cAllergens seen\u201d. The others can be switched off.',steps:['Open More \u203a Settings \u203a Advanced.','In Bookings, tick or untick each question.','Use the dog stepper to cap dogs per booking time (No limit = only the dog-friendly tables).','Mark dog-friendly and step-free tables on the Table plan.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-bookings'},hint:'Booking questions are here.'}},{id:'adv-table-times',kind:'guide',topic:'Settings',title:'How long tables stay (table times)',keywords:['advanced','dwell','table time','turn','how long','next table free','minutes'],body:'Usual table times by party size: 90 min for 1\u20132 covers, 105 for 3\u20135, 2 hours for 6\u201319 and 3 hours for 20 or more. The app fine-tunes them from how long your tables really stay, and uses them for \u201cNext table free\u201d.',steps:['Open More \u203a Settings \u203a Advanced \u203a Table times.','Tap \u2212 or + to change a band by 5 minutes.','Untick \u201cFine-tune\u201d to use your numbers exactly.','Reset to default puts the four bands back.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-times'},hint:'Table times are here.'}},{id:'adv-reservable',kind:'guide',topic:'Settings',title:'Seafood platter, crab and lobster reservations',keywords:['advanced','platter','seafood','crab','lobster','reserve','price'],body:'Guests can reserve the Seafood Platter (1 crab + 1 lobster, \xa3160) or a crab or lobster with their booking. Reserved ones come off the Display count with a \u201cReserved\u201d line, the kitchen is told, and the Head Chef taps OK.',steps:['Open More \u203a Settings \u203a Advanced \u203a Reservable items.','Tick what guests can reserve and set the price.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-reserve'},hint:'Reservable items are here.'}},{id:'adv-events',kind:'guide',topic:'Settings',title:'Regular events like Open Mic Night',keywords:['advanced','open mic night','music night','event','regular','monthly','promote','busier','last food'],body:'Add events that repeat, e.g. Open Mic Night on the last Sunday of every month from 8pm with last food orders at 7pm. They show in Forecast key dates with a Promote button and on Today, and \u201cExpect busier\u201d raises the forecast.',steps:['Open More \u203a Settings \u203a Advanced \u203a Regular events.','Tap Add a regular event (or Edit).','Pick how it repeats and the day, add a start time and last food orders if needed.','Tap Save event.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-events'},hint:'Regular events are here.'}},{id:'adv-hours',kind:'guide',topic:'Settings',title:'Kitchen hours, seasons and special days',keywords:['advanced','hours','kitchen','season','winter','summer','special day','closed','last food orders','cutoff'],body:'Kitchen (food) hours decide which booking times are offered; the closing time is last food orders. Keep Winter and Summer hours, each with the date it starts every year, and the app switches by itself. Add special days for one-off changes.',steps:['Open More \u203a Settings \u203a Advanced \u203a Kitchen hours.','Tap Set Summer hours, fill in each day and the start date (e.g. 04-01 for 1 April).','Set the Winter start date too.','Use Add a special day for closures or late nights.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-hours'},hint:'Kitchen hours and seasons are here.'}},{id:'adv-home',kind:'faq',topic:'Settings',title:'Covers counter, Next table free and takeaway on home screens',keywords:['advanced','covers counter','takeaway','next table free','home','display','flip'],body:'Turn the COVERS counter and the \u201cNext table free\u201d card on or off, and choose whether takeaway figures show on home screens (off at the Anchorage). Takeaway order alerts always work. The flap click sound is set on each Display.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-home'},hint:'Display and home options are here.'}},{id:'adv-holidays',kind:'faq',topic:'Settings',title:'Why don\u2019t bank holidays say \u201c(substitute day)\u201d?',keywords:['advanced','holiday','substitute','bank holiday'],body:'The date already shows when a holiday moves, so the extra words are hidden. Tick \u201cShow full gov.uk names\u201d in Settings \u203a Advanced \u203a Holiday names to bring them back.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-holidays'},hint:'Holiday names are here.'}},{id:'adv-blocks',kind:'guide',topic:'Settings',title:'Lunch and dinner times for Block now',keywords:['block','lunch','dinner','service','wix','advanced','pause'],body:'Settings \u203a Advanced \u203a Block bookings sets when Lunch and Dinner run, for the Block now buttons and Spend per head. At The Anchorage, blocks also close those times on website bookings, and blocks made on the website show in CoverCharge. Website bookings can only close the whole venue, not one area or some tables.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-blocks'},hint:'Block bookings settings are here.'}},{id:'blocks-screen',kind:'guide',topic:'Bookings',title:'Block bookings: today, a future date, an area or some tables',keywords:['block','blocks','pause','close','closed','stop bookings','private','repeat','future'],body:'Tap Block bookings on the home screen. Block now pauses bookings today (Rest of today, Next hour, Lunch, Dinner, or a From\u2013To). Add a block closes a future date or range, the whole day or set times, the whole venue, one area or some tables, once or every week or on the last weekday of the month. Every future block is listed by month with Edit and Remove; removing asks first and is logged. Bookings already made are kept, and you are told how many.',showMe:{tab:'more',page:'blocks',target:{testID:'blocks-screen'},hint:'Block bookings is here.'}},{id:'spend-per-head',kind:'guide',topic:'Money',title:'Spend per head',keywords:['spend per head','sph','average spend','takings','covers','gross'],body:'Spend per head is Gross takings \xf7 Covers, by day, by week and for lunch and dinner. Enter the gross on the cash up (Enter the cash up, Upload a spreadsheet, or Enter takings). Covers are seated and finished bookings and walk-ins; no-shows and cancellations are left out. A day with no takings shows \u201cNo takings entered\u201d, never \xa30.',showMe:{tab:'more',page:'spendhead',target:{testID:'sph-screen'},hint:'Spend per head is here.'}},{id:'cashup-photo',kind:'guide',topic:'Money',title:'Enter the cash up, or upload a spreadsheet',keywords:['cash up','paid out','spreadsheet','csv','excel','xlsx','sheet','gross','card','cash','tips','takings','drawer'],body:'In Cash up & sales tap Enter the cash up and type the figures (Z total, card, cash, paid outs, tips, and gross if you have it). In Paid out, add a line for each amount taken from the till \u2014 for example lobsters or supermarket shopping \u2014 with the amount, an optional note, and your name. The paid-out total comes off the expected cash in the drawer. Check every figure, then tap Confirm and save. Bigger venues can tap Upload a spreadsheet (CSV or Excel): match the columns, check the preview (dates already saved are flagged), then confirm. Nothing is saved before you confirm, and every save is logged. You can export cash ups as a spreadsheet from Recent cash ups.',showMe:{tab:'more',page:'cashup',target:{testID:'cashup-by-hand'},hint:'Start the cash up here.'}},{id:'adv-giftqr',kind:'guide',topic:'Settings',title:'Buy a gift card on the Display',keywords:['gift','gift card','voucher','qr','display','wix','advanced'],body:'Switch on \u201cShow Buy a gift card on the Display\u201d in Settings \u203a Advanced \u203a Gift cards on the Display, and save your gift card page address. The Display has a Gift vouchers button: it opens the list of website vouchers (search, use by dates, Mark as used), with Show the buy QR code at the bottom. Guests buy on your website.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-giftqr'},hint:'Gift cards on the Display are here.'}},{id:'adv-whatsapp',kind:'guide',topic:'Settings',title:'WhatsApp buttons (tap to chat)',keywords:['whatsapp','wa.me','message','chat','guest','mobile','number','advanced'],body:'Put the venue\u2019s WhatsApp number in Settings \u203a Advanced \u203a WhatsApp, e.g. 01292 500123 or +44 7700 900123. Guests then see \u201cMessage us on WhatsApp\u201d on their booking confirmation, with their booking details typed in. Staff and managers see \u201cWhatsApp guest\u201d on bookings with a mobile number, with a confirmation typed in that you can change. Nothing is ever sent for you: WhatsApp opens and you tap Send yourself. Leave the number blank and every WhatsApp button stays hidden. Reset to default clears the number.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-whatsapp'},hint:'The WhatsApp number is here.'}},{id:'adv-reminders',kind:'guide',topic:'Settings',title:'Staff reminders: breaks and \u201cchairs up\u201d',keywords:['reminder','reminders','break','breaks','chairs','closing','6 hours','law','snooze','later','done','advanced'],body:'Reminders slide up for staff who are on shift right now (clocked in, or on the rota at that time) in the Staff and Head Chef apps, while the app is open. Break reminders: if the rota shift has a break time, the reminder comes at that time; if not, it comes 4 hours after they clock in (or after the shift starts). If they still haven\u2019t started a break it comes once more 30 minutes later, and again at 6 hours, because UK law says a shift over 6 hours needs a 20-minute break. \u201cStart break\u201d starts their break; \u201cLater\u201d hides it for 15 minutes. You can change these times. Venue reminders, such as \u201cTime to put the chairs up on the tables\u201d (Friday and Sunday, 21:00), have wording, days, a time (UK) and who sees them: everyone on shift, front of house or kitchen. Pause, edit or delete any of them, or add your own. Once anyone taps Done it goes for everyone that day, and the Reminders screen shows who did it. Reset to default brings back the standard break times and \u201cchairs up\u201d; your own reminders stay. Phones with the app closed don\u2019t get reminders yet.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-reminders'},hint:'Reminders are here.'}},{id:'adv-notifications',kind:'guide',topic:'Settings',title:'Scheduled notifications (e.g. the Mills milk order)',keywords:['notification','notifications','push','phone','milk','mills','pieroni','pieronis','veg','olsen','rota upload','scheduled','advanced'],body:'Settings \u203a Advanced \u203a Notifications lists reminders that go to named people at a set UK time, such as \u201cMills milk order\u201d for the Head Chef and Gordon. Each has a title, a message, the days, a time (you can set a different time on some days, e.g. 20:55 on Fridays), who gets it (tick people or pick a group like Everyone on shift) and how it is sent. In the app it is the gold slider with Done and Later; Done is logged with the name and time, and Later hides it for 15 minutes. Urgent notices (like the 6-hour break) always come first and only one shows at a time. Phone notifications: each person taps \u201cTurn on phone notifications\u201d on their own phone (iPhone: add the app to the Home Screen first, iOS 16.4 or later). Nothing goes to phones until an owner or manager switches \u201cSend to phones\u201d on. The Display never gets these. Reset to default restores the configured rules.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-notifications'},hint:'Notifications are here.'}},{id:'adv-order-lists',kind:'guide',topic:'Settings',title:'Order lists (Alsons, Cash and carry)',keywords:['order list','orders','alsons','drinks','cash and carry','trip','shopping','logo','carry over','advanced'],body:'Order lists collect what you need from a supplier. A running list (Alsons drinks) fills up until you order; a trip list (Cash and carry) is for a shopping day, Friday by default, which you can change for each trip. Add an item with a quantity and unit and an optional note; the app records who added it and when. Adding something already on the list offers to add to the quantity instead. On the day, tick Got or Ordered, or mark Missing / not in stock. Finish order saves it to History (date and who) and asks whether to carry over anything not got. Removing an item can be undone. Settings \u203a Advanced \u203a Order lists: add, rename or archive lists, the default trip day, and \u201cLet all staff add items\u201d (on: staff can add and see lists; only managers and the Head Chef tick, remove or finish). Each list can have a logo (take a photo or choose one) or shows its initials, and a phone number to tap to call (never called for you).',showMe:{tab:'more',page:'advanced',target:{testID:'adv-orderlists'},hint:'Order list settings are here.'}},{id:'adv-clock-area',kind:'guide',topic:'Settings',title:'Clock-in area, forgotten breaks and off-rota arrivals',keywords:['clock','clock in','geofence','location','area','radius','break','forgot','rota','visiting','override','advanced'],body:'Clock in, clock out, start break and end break only work at the venue once the centre is set. Stand in the middle of the venue and tap \u201cUse my current location\u201d, then choose how far (at least 50 m, 100 m to start). Phones are not exact, so up to 50 m of the phone\u2019s own accuracy is allowed on top. Each clock record keeps the reading, its accuracy and whether it was inside. If location is off or blocked, the app says how to allow it. Managers can record it for someone from Clock in / out \u203a Record it for someone, with a reason that is logged. Until the centre is set nobody is blocked and managers see a warning. Rota and pay screens are never blocked. Forgotten breaks: if no break was recorded, Clock out asks \u201cDid you take a break? If so, how long?\u201d; a length you pick is saved as a break marked \u201cadded at clock-out\u201d, which managers see and can edit in Hours. Not on the rota: if someone is at the venue, not clocked in and not on the rota, the Staff and Head Chef apps ask \u201cDo you want to sign in?\u201d. Yes clocks them in, marked off-rota, and managers get a notice; \u201cNo, just visiting\u201d stops asking for the day. This only checks while the app is open; web apps can\u2019t watch location in the background.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-clockarea'},hint:'Clock-in area settings are here.'}},{id:'adv-tablegrid',kind:'guide',topic:'Table plan',title:'Table plan grid and Tidy up (Advanced)',keywords:['grid','snap','line up','align','tidy','guides','spacing','restore','table plan','option','alt'],body:'Tables snap to the grid when you drag them, and gold guides show when an edge or centre lines up with another table. A small number shows when the gaps either side are even. Hold Alt (Option on a Mac) to move freely. Tidy up lines every table up on the grid and evens out the rows; only positions change. The old positions are kept, so one tap puts them back.',steps:['Go to Settings \u203a Advanced.','Find Table plan grid.','Turn snapping on or off, pick a grid size, or tap Tidy up the whole plan.','Changed your mind? Tap Put the tables back where they were.']},{id:'adv-printers',kind:'guide',topic:'Orders',title:'Kitchen ticket printers (Advanced)',keywords:['print','printer','printing','ticket','kitchen ticket','docket','receipt','epson','star','bluetooth','reprint','takeaway'],body:'Print a kitchen ticket by itself for every takeaway order, as soon as it comes in or when it is accepted. The ticket has the order number, collection time, name, every dish with its options and notes, allergies in white-on-black, and paid or not paid. Works with Epson (TM-m30, TM-T20, TM-T88), Star WebPRNT, most other network receipt printers (port 9100) and Bluetooth printers from the tablet app. If a ticket does not print, an amber warning shows and the order stays on screen.',steps:['Go to Settings \u203a Advanced.','Find Printers.','Tap Add a printer by IP address or Find printers on this Wi-Fi, choose the type and tap Test print.','Turn on Print a kitchen ticket for every takeaway order.']},{id:'adv-deposits',kind:'guide',topic:'Bookings',title:'Deposits (Advanced)',keywords:['deposit','deposits','per person','per adult','children','waive','waived','regular','party size','refund','refundable','cut off','policy','paid','due'],body:'Ask bigger tables for a deposit: set the amount per adult (children never pay and do not count towards the number that needs one: a table of 8 with 3 children pays nothing; a table of 6 adults, or 7 with 1 child, pays for 6), the smallest number of adults that pays one (6 or more adults at The Anchorage), whether it is refundable and up to how many hours before, and the words guests see. Staff can waive a deposit. No card is saved in CoverCharge. Deposits are paid through website bookings: website bookings show Deposit paid on website bookings, Part paid on website bookings or Deposit not paid by themselves. For phone and walk-in bookings, staff tick Deposit paid once the guest has paid you, or (once switched on) press Send deposit link to send a website bookings pay link by text, WhatsApp or email. Refunds are done in Website bookings \u203a Orders. Deposit amounts are shown on bookings in Managers, Display and Staff. Other financial and HR information remains restricted.',steps:['Go to Settings \u203a Advanced.','Find Deposits.','Turn deposits on or off, and set the amount, party size, refund terms and the words guests see.','On a booking, tap Mark deposit paid once the guest has paid.','To let a regular off, tap Waive deposit on the booking (or in Edit booking), add why if you like, and tap Yes, waive it. Your name is saved with it.']},{id:'adv-loyalty',kind:'guide',topic:'Guests',title:'Loyalty: stamp card, offers & bring a friend (Advanced)',keywords:['loyalty','stamp','stamps','card','reward','offer','offers','referral','friend','expiry'],body:'The stamp card, offers and bring-a-friend are saved on the server, so every phone and tablet shows the same card. Set how many stamps earn a reward, what the reward is, when stamps or rewards run out, and how often one guest can get a stamp. Stamps only come from staff, or from a code or QR staff make, and each reward can be used once. Guests join with their agreement recorded, and a manager can remove a guest and their details.',steps:['Go to Settings \u203a Advanced.','Find Loyalty.','Turn the stamp card on, write the reward and tap Save loyalty settings.','Add offers with their dates, and turn bring-a-friend on if you want it.']},{id:'adv-table-order',kind:'guide',topic:'Guests',title:'Order at the table (Advanced)',keywords:['order at table','qr','qr code','scan','table','phone','accept','last orders','print','pdf','pay at bar'],body:'Guests scan the small QR card on their table (Managers \u203a Table QR codes prints them, 20 to a page), see your menu with allergens, and send an order. It lands in Front of House and on the kitchen screen within seconds. Prices, sold-out dishes and hours are checked on the server, so a phone can\u2019t change them. Staff accept the first order from each new phone (you can turn this off). Guests pay at the bar or with their server; paying by card from the phone is coming later.',steps:['Go to Settings \u203a Advanced.','Find Order at the table.','Turn it on, pick the areas or tables, set the hours and tap Save order at the table.','Tap Make codes, pick Stickers 50 \xd7 50 mm or Stand cards 50 \xd7 70 mm, then Print all QR cards (PDF) and put each code on its table.']},{id:'adv-soldout',kind:'guide',topic:'Menu',title:'Sold out reminders (Advanced)',keywords:['sold out','86','clear','end of service','next morning','back on','advanced','display strip','automatic','counts','lobster','crab'],body:'Choose when sold out dishes go back on by themselves: when the kitchen closes (from your Kitchen hours), the next morning (pick the time), or only when someone taps Back on. \u201cMark dishes sold out from the counts\u201d (on unless you turn it off) marks every dish that uses a counted item, like lobster or crab, when the count runs out, and puts it back on when the count is back up. Sold out is a reminder for staff on the Display and in the staff apps; it doesn\u2019t change your till.',steps:['Go to Settings \u203a Advanced.','Find Sold out reminders.','Pick when they clear, and turn marking from the counts on or off.']},{id:'sold-out-auto',kind:'guide',topic:'Menu',title:'Sold out from the counts (lobster, crab\u2026)',keywords:['sold out','automatic','auto','counts','shellfish','lobster','crab','platter','link','uses','none left'],body:'When a counted item runs out, or drops below what a dish needs, every dish that uses it is marked sold out by itself, with the reason: \u201cDeluxe Seafood Platter (no lobster or crab)\u201d. When the count is back up (a delivery or a recount), those dishes go back on by themselves. Dishes marked by hand are left alone. CoverCharge works out what each dish uses from its recipe card, its description (\u201cone whole lobster\u201d) or its name; you can change it for any dish. If you tap Back on while the count is still short, the dish stays on until the count changes.',steps:['Open the Sold out list.','Under Dishes linked to the counts, tap Change next to a dish.','Set how many of each item one portion uses (0 = not linked), then tap Save. Back to automatic undoes it.'],showMe:{tab:'more',page:'soldout',target:{testID:'soldout-links'},hint:'Tap Change next to a dish to set what it uses.'}},{id:'adv-forecast',kind:'guide',topic:'Forecasts',title:'Forecast history and "Not enough history yet"',keywords:['forecast','not enough history','history','estimate','example figures','labour','sales','walk-ins','advanced'],body:'Forecasts are built only from your own bookings, seated walk-ins, takeaway orders and cash-ups. Until CoverCharge has enough of your history (2 weeks to start with; change it in Settings \u203a Advanced \u203a Forecast history) you see \u2018Not enough history yet\u2019, what is already booked and your real labour cost from the rota, with no sales forecast or labour %. No history is invented for a live venue.',steps:['Go to Settings \u203a Advanced.','Find Forecast history.','Pick how many weeks are needed.']},{id:'adv-checkout',kind:'guide',topic:'Team',title:'Shift check-out, question board and team morale',keywords:['check out','checkout','morale','mood','staffing','overstaffed','survey','anonymous','question board','vote','shout out','wellbeing','advanced'],body:'When someone clocks out, they get a quick card: team morale from Low to High, and whether there was enough staff for the customers. They can also post a question for the board or shout out a teammate, or tap Skip. Nothing shows at clock in. Answers are anonymous: no name or staff number is saved, and each phone can answer a shift once. Team morale (Managers app \u203a More \u203a Team morale) shows a day only once 3 or more people have answered, next to that day\u2019s covers. Change the wording or switch parts off here.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-checkout'},hint:'Check-out and board settings are here.'}},{id:'hr-board',kind:'guide',topic:'Team',title:'The anonymous question board',keywords:['question board','board','anonymous','vote','yes no','reply','hide','moderation','log'],body:'Anyone on the team can post a question and vote it up, or vote Yes or No. No names are shown or saved. Owners and managers can reply (shown as \u201cReply from the managers\u201d) and hide offensive posts with a reason. Every hide, unhide and reply is in the Moderation log.',showMe:{tab:'more',page:'board',hint:'The question board.'}},{id:'adv-tasks',kind:'guide',topic:'Team',title:'Daily tasks',keywords:['tasks','daily tasks','checklist','duties','jobs','to do','my tasks','library','head chef'],body:'Give each person a short list of daily tasks: open Staff & roles, tap Daily tasks on their card, then pick from the venue\u2019s task library or type a new one. Use the arrows to reorder, \u2715 to remove (with Undo) and Days to limit a task to certain days. They see \u201cMy tasks today\u201d on their home screen and tick each one off while on shift; each tick records who and when, and you see \u201c2 of 5 done today\u201d on their card. Lists start fresh every day. Owners and managers can change anyone\u2019s list, including the Head Chef\u2019s. The Head Chef can change the lists of kitchen staff (chefs, commis and KPs) from Kitchen \u203a Kitchen team tasks, but not their own and not front of house. The task library is in Settings \u203a Advanced \u203a Tasks.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-tasks'},hint:'The task library is here.'}},{id:'adv-cashup',kind:'guide',topic:'Money',title:'Cash up and weekly sales',keywords:['cash up','cashup','takings','float','till','sales report','weekly sales','pos','printout','photo','graphs','charts'],body:'At the end of the night open Cash up & sales and tap Enter the cash up. Type each figure; boxes left blank stay blank (never counted as zero) and are highlighted in amber. Add any cash paid out of the till (lobsters, supermarket shopping, and the like) in the Paid out section: each line has what it was for, the amount, an optional note and who entered it. The total reduces the expected cash in the drawer. Nothing is saved until you tap Confirm and save. Do the same with the weekly sales report from the till (several pages is fine). The graphs show daily takings, tips, weekly net sales against the week before and sales by category. Owners and managers can enter and change cash ups; the Head Chef can see the graphs if they are allowed to see takings. Change the boxes to match your sheet in Settings \u203a Advanced \u203a Cash up; Cash tips total and Card tips total are always kept.',showMe:{tab:'more',page:'cashup',target:{testID:'cashup-by-hand'},hint:'Start the cash up here.'}},{id:'adv-tips',kind:'guide',topic:'Money',title:'Today\u2019s tips and the Tips pot',keywords:['tips','today tips','tips pot','pot','payout','tip pay','correction','coins'],body:'When a cash up with Cash tips total and Card tips total is confirmed, the team\u2019s combined tips for that day show as Today\u2019s tips in every staff app and on the Display, with a short notice. The Tips pot adds up confirmed daily tips since the last payout (fortnightly tip pay). After paying the tips, an owner or manager taps Mark payout done on the Tips pot card: the pot goes back to \xa30.00 and the old pot is kept in Past pots. Use Correct an entry to add or take off an amount for a day; a reason is required and every correction is logged with your name. Only the team total is ever shown, never anyone\u2019s share. Hide either card in Settings \u203a Advanced \u203a Tips.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-tips'},hint:'Show or hide the tips cards here.'}},{id:'manager-access',kind:'guide',topic:'Team',title:'Manager access',keywords:['manager access','manager','access','role','promote','front of house','head chef','owner'],body:'In Staff & roles each person has a Manager access switch. On: they use the Manager app (rota, bookings, staff, hours, settings, plus their own clock in, rota and pay). Off: they use the Front of House app, or the Head Chef app for the Head Chef. Owners can switch anyone except owners; managers can switch anyone except themselves and owners. The last owner can never be removed. You confirm each change; it is logged with who and when (Access changes). Job titles are free text and don\u2019t change.',showMe:{tab:'more',page:'staff',target:{testID:'access-tip'},hint:'Manager access switches are on each person.'}},{id:'next-table-free',kind:'faq',topic:'Walk-ins',title:'When is the next table free?',keywords:['next table','free','wait','walk-in','quote','full'],body:'When you\u2019re full, Today and the Display show \u201cNext table free about 19:40 (T6, 4 seats)\u201d with \u201clikely\u201d or \u201cmaybe\u201d, and how long a walk-in for 2 or 4 would wait. Tap Bill requested or Table finished on the plan and it updates. You can also ask the Assistant \u201cwhen\u2019s the next table free?\u201d.'},{id:'time-travel',kind:'faq',topic:'Today',title:'Look at another day (time travel)',keywords:['yesterday','tomorrow','next week','past','future','day','time travel'],body:'On Today, tap \u2039 or \u203a beside the date to step a day back or forward. You\u2019ll see that day\u2019s kitchen hours, events, covers (booked, or how it went), platters and each booking\u2019s allergens and needs. It\u2019s read-only and nothing changes live service. Tap Today to come back. The Display goes back to today by itself after 2 minutes. Staff can look 7 days back and 14 days ahead.'},{id:'sign-in-links',kind:'guide',topic:'Team',title:'Personal sign-in links',keywords:['link','invite','sign in','new link','expired','already used','phone','login'],body:'Each personal link works on one phone only and lasts 5 days, so nobody else can sign in as that person. The same phone can open it again, in any of the apps. If someone gets a new phone, or their link has expired, open Staff & roles, tap New sign-in link on their entry, then Copy link and send it to them yourself. The app never sends it. Owners can make links for anyone; managers for anyone except owners. Their old unused link stops working; phones already signed in stay signed in.',showMe:{tab:'more',page:'staff',target:{testID:'access-tip'},hint:'New sign-in link is on each person.'}},{id:'pins-security',kind:'faq',topic:'Team',title:'PINs for the Display',keywords:['pin','display pin','clock in','wake pin','2580','manager pin','locked'],body:'Staff PINs for clocking in at the Display are 4 to 8 digits. Managers and owners need 6 to 8 digits, because their PIN can add temp staff. Easy PINs such as 1111 or 1234 are refused. Five wrong tries locks that person for 15 minutes; 20 wrong tries on one Display stops it for 15 minutes. The Display wake PIN (Settings \u203a Display) is 6 to 8 digits and is kept only as a scrambled hash. If it still says 2580, change it.'},{id:'cash-up-lock',kind:'faq',topic:'Money',title:'Correcting a signed-off cash up',keywords:['cash up','locked','unlock','correct','mistake','history','audit','sales report'],body:'Once a cash up or weekly sales report is confirmed and saved, it is locked so the figures can\u2019t change quietly. An owner taps Unlock to correct on it, says why, and has 30 minutes to fix it. History on each one shows who signed it off, changed or unlocked it, and when.'},{id:'wipe-device',kind:'faq',topic:'Settings',title:'Sign out and wipe a shared tablet or phone',keywords:['wipe','sign out','shared','tablet','leaver','lost','reset device'],body:'Tap the sync badge (bottom left), or go to Settings \u203a Display, and choose Sign out and wipe this device. It signs out and removes everything CoverCharge keeps on that device: sign-ins, pairing, saved screens and changes not sent yet. The venue\u2019s shared data is not touched. On the Display you type the wake PIN first.'}],o=t=>a.find(a=>a.id===t)},1511,[]); __d(function(g,r,_i,_a,m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"tokens",{enumerable:!0,get:function(){return o}}),e.lev=l,e.searchHelp=function(n,l,i=8){const h=o(l);if(!h.length)return[];const a=t(l);return n.map(n=>{const l=o(n.title),i=o(n.keywords.join(' ')),c=o(`${n.body} ${(n.steps??[]).join(' ')}`);let f=3*s(h,l)+2.5*s(h,i)+.8*s(h,c);return n.keywords.some(n=>a.includes(t(n))&&t(n).length>3)&&(f+=2),t(n.title).includes(a)&&a.length>3&&(f+=3),{a:n,score:f/Math.sqrt(h.length)}}).filter(t=>t.score>=1.2).sort((t,n)=>n.score-t.score).slice(0,i)};const t=t=>t.toLowerCase().replace(/[\u2019']/g,'').replace(/[^a-z0-9\xa3 ]+/g,' ').replace(/\s+/g,' ').trim(),n=new Set(['how','do','i','a','an','the','to','can','my','our','we','is','it','of','for','in','on','and','what','where','please','me','you','with']),o=o=>t(o).split(' ').filter(t=>t&&!n.has(t));function l(t,n,o=2){if(Math.abs(t.length-n.length)>o)return o+1;let l=Array.from({length:n.length+1},(t,n)=>n);for(let i=1;i<=t.length;i++){const s=[i];let h=i;for(let o=1;o<=n.length;o++)s[o]=Math.min(l[o]+1,s[o-1]+1,l[o-1]+(t[i-1]===n[o-1]?0:1)),h=Math.min(h,s[o]);if(h>o)return o+1;l=s}return l[n.length]}function i(t,n){if(t===n)return 1;if(t.length>=3&&n.startsWith(t))return.8;if(n.length>=4&&t.startsWith(n))return.7;if(t.length>=4){if(l(t,n,t.length>=7?2:1)<=(t.length>=7?2:1))return.6}return 0}function s(t,n){let o=0;for(const l of t){let t=0;for(const o of n)if(t=Math.max(t,i(l,o)),1===t)break;o+=t}return o}},1512,[]); __d(function(g,_r,_i,_a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"staffMay",{enumerable:!0,get:function(){return w}}),_e.noMoney=k,Object.defineProperty(_e,"hasMoney",{enumerable:!0,get:function(){return v}}),Object.defineProperty(_e,"moneySafe",{enumerable:!0,get:function(){return S}}),Object.defineProperty(_e,"RISK_LABEL",{enumerable:!0,get:function(){return $}}),Object.defineProperty(_e,"needsConfirm",{enumerable:!0,get:function(){return O}}),Object.defineProperty(_e,"demoOnly",{enumerable:!0,get:function(){return I}}),Object.defineProperty(_e,"PAGES",{enumerable:!0,get:function(){return P}}),Object.defineProperty(_e,"tableName",{enumerable:!0,get:function(){return T}}),Object.defineProperty(_e,"ACTIONS",{enumerable:!0,get:function(){return j}}),Object.defineProperty(_e,"actionById",{enumerable:!0,get:function(){return D}}),_e.toolSpecs=function(){const e=e=>({type:'integer'===e.type?'integer':'string',description:e.description,...e.enum?{enum:e.enum}:{}});return j.map(t=>({type:'function',function:{name:t.id,description:`${t.description} [${$[t.risk]}${O(t.risk)?'; the app asks the manager to confirm':''}]`,parameters:{type:'object',properties:Object.fromEntries(t.params.map(t=>[t.name,e(t)])),required:t.params.filter(e=>e.required).map(e=>e.name)}}}))},_e.runAction=async function(e,t,a,s=!1){const r=D(e);if(!r)return{status:'error',message:`Unknown action ${e}`};if(m.BOOKING_CHANGE_ACTIONS.has(e)&&!(0,b.currentCanChangeBookings)())return{status:'error',message:m.BOOKING_VIEW_ONLY};if(('staff'===a.app||'staff'===a.role)&&!w(r))return{status:'error',message:'That isn\u2019t available in the Staff app. Ask a manager.'};if(r.apps&&a.app&&!r.apps.includes(a.app))return{status:'error',message:'That isn\u2019t available in this app.'};const n=r.params.filter(e=>e.required&&(void 0===t[e.name]||''===t[e.name])).map(e=>e.name);if(n.length)return{status:'error',message:`Missing ${n.join(', ')}`};if(O(r.risk)&&!s)return{status:'needs_confirmation',preview:r.preview(t,a),risk:r.risk};if(I(r.risk)){const e=String(await r.run(t,a));return'send'===r.risk||'pay'===r.risk?(u.useDrafts.getState().add({rid:a.rid,kind:'pay'===r.risk?'payment':'message',title:r.title,lines:[r.preview(t,a)],by:a.who??'Assistant',app:a.app??'owner'}),{status:'demo_only',message:`${e} Saved as a draft for the owner to approve.`}):{status:'demo_only',message:e}}try{const e=String(await r.run(t,a));return{status:'done',message:S(a.app,a.role)?k(e):e}}catch(e){return{status:'error',message:e.message}}},_e.extract=Y,_e.matchIntent=function(e,t,a={}){const s=` ${(e=(0,h.normaliseHeard)(e)).toLowerCase()} `,r=(0,l.tokens)(e),n=/\b(how|where|what|why|can i|help)\b/.test(s);let i=null;const o=a.app??'owner';for(const e of j){if('show_me'===e.id||'open_screen'===e.id)continue;if(e.apps&&!e.apps.includes(o))continue;if('staff'===o&&!w(e))continue;let t=0;if(e.match)t=e.match(s);else for(const a of e.keywords)s.includes(a)&&(t+=a.includes(' ')?2:1);'add_rota_shift'!==e.id||s.includes('shift')||s.includes('rota')||(t=0),'add_walkin'!==e.id||/walk|seat|arriv/.test(s)||(t=0),t>(i?.s??0)&&(i={a:e,s:t})}if(i&&i.s>=1&&(!n||'look'===i.a.risk||i.s>=3))return{kind:'action',action:i.a,params:i.a.parse?i.a.parse(e,{rid:a.rid??'',today:t,app:o,whoId:a.whoId}):Y(e,t),score:i.s};if('owner'!==o){const t=(0,l.searchHelp)(p.HELP,e,3);return t.length?{kind:'help',ids:t.map(e=>e.a.id)}:{kind:'none'}}const d=s.match(/\b(?:open|show|go to|take me to)\s+(.+?)\s*$/);if(d){const e=P.find(e=>e.words.some(e=>d[1].includes(e)));if(e)return{kind:'action',action:D('open_screen'),params:{screen:e.title},score:2}}const u=(0,l.searchHelp)(p.HELP,e,3);return u.length?{kind:'help',ids:u.map(e=>e.a.id)}:(r.length,{kind:'none'})};var e=_r(_d[0]),t=_r(_d[1]),a=_r(_d[2]),s=_r(_d[3]),r=_r(_d[4]),n=_r(_d[5]),i=_r(_d[6]),o=_r(_d[7]),d=_r(_d[8]),p=_r(_d[9]),l=_r(_d[10]),u=_r(_d[11]),c=_r(_d[12]),f=_r(_d[13]),h=_r(_d[14]),m=_r(_d[15]),b=_r(_d[16]);const w=e=>!e.apps||e.apps.includes('staff'),y=/\xa3|\btips?\b|\btronc\b|\btakings\b|\bwages?\b|\bsalar(y|ies)\b|\bpay(slip|roll)?\b|\bsales\b|\brevenue\b|\bdisciplinar|\bsick(ness)? (leave|pay)\b/i;function k(e){const t=e.split(/(?<=[.!?])\s+/).filter(e=>!y.test(e));return t.length?t.join(' '):'That isn\u2019t shown here. Ask a manager in the Managers app.'}const v=e=>y.test(e),S=(e,t)=>'display'===e||'staff'===e||'staff'===t,$={look:'Looks something up',navigate:'Opens a screen',change:'Changes something in the app',draft:'Saves a DRAFT for the owner to approve (nothing is sent or bought)',send:'SENDS to someone',pay:'PAYS money',delete:'DELETES something'},O=e=>'change'===e||'draft'===e||'send'===e||'pay'===e||'delete'===e,I=e=>'send'===e||'pay'===e||'delete'===e,_=e=>(n.useOwner.getState().staff.find(t=>t.id===e)?.name??'someone').replace(' (example)',''),N=e=>{const[t,a,s]=e.split('-').map(Number);return new Date(t,a-1,s).toLocaleDateString('en-GB',{weekday:'short',day:'numeric',month:'short'})},C=e=>{const t=(Math.round(60*e)%1440+1440)%1440;return`${String(Math.floor(t/60)).padStart(2,'0')}:${String(t%60).padStart(2,'0')}`},P=[{page:'lookback',tab:'more',title:'Look back',words:['look back','booking history']},{page:'serviceboard',tab:'more',title:'Restaurant dashboard',words:['restaurant dashboard','dashboard']},{page:'',tab:'bookings',title:'Bookings',words:['bookings','reservations','diary']},{page:'',tab:'orders',title:'Orders',words:['orders','takeaway','tickets']},{page:'rota',tab:'more',title:'Rota',words:['rota','shifts','schedule']},{page:'signoff',tab:'more',title:'Sign off hours',words:['sign off','signoff','approve hours']},{page:'hours',tab:'more',title:'Payroll hours',words:['payroll hours','payroll','hours export']},{page:'tipsday',tab:'more',title:'Tips day',words:['tips day','tips','tronc']},{page:'tableplan',tab:'more',title:'Table plan',words:['table plan','floor plan','layout']},{page:'suppliers',tab:'more',title:'Suppliers',words:['suppliers','supplier']},{page:'recipecards',tab:'more',title:'Recipe cards',words:['recipe cards','recipes']},{page:'displays',tab:'more',title:'Displays',words:['displays','tablets','pairing']},{page:'paysettings',tab:'more',title:'Pay & tips settings',words:['pay settings','pay dates','payday']},{page:'connections',tab:'more',title:'Connected accounts',words:['connected accounts','connections','accounts']},{page:'help',tab:'more',title:'Help & tutorials',words:['help','tutorials']}],A=['owner'],M=['zero','one','two','three','four','five','six','seven','eight','nine','ten','eleven','twelve','thirteen','fourteen','fifteen','sixteen','seventeen','eighteen','nineteen','twenty'],T=e=>{const t=String(e??'').replace(/^table\s+/i,'').trim(),a=M.indexOf(t.toLowerCase());return a>0?String(a):t};function E(e,t){if(!e||null==t||''===t)return'';const s=T(t),r=o.useFloor.getState().live[e]??{},n=Object.keys(r).find(e=>e.toLowerCase()===s.toLowerCase()||e.toLowerCase()===`t${s}`.toLowerCase()),i=n?r[n]:void 0;return i?i.blocked?`. ${(0,a.tableNumbers)(s)} is marked blocked`:i.dirty?`. ${(0,a.tableNumbers)(s)} still needs clearing`:i.stage?`. ${(0,a.tableNumbers)(s)} already has people seated`:'':''}const j=[...e.HISTORY_VOICE_ACTIONS,{id:'open_screen',apps:A,title:'Open a screen',description:'Navigate to a screen of the Managers app.',risk:'navigate',params:[{name:'screen',type:'string',required:!0,description:'Screen to open',enum:P.map(e=>e.title)}],keywords:['open','go to','take me','show','where is'],preview:e=>`Open ${e.screen}`,run:(e,t)=>{const a=P.find(t=>t.title===e.screen);return a?(t.go(a.tab,a.page||null),`Opened ${a.title}.`):'I couldn\u2019t find that screen.'}},{id:'show_me',apps:A,title:'Show me how',description:'Open the screen for a help guide and highlight the control to tap.',risk:'navigate',params:[{name:'guide',type:'string',required:!0,description:'Help article id',enum:p.HELP.filter(e=>e.showMe).map(e=>e.id)}],keywords:['how do i','how to','show me','where do i','help'],preview:e=>`Show me: ${(0,p.helpById)(String(e.guide))?.title??''}`,run:(e,t)=>{const a=(0,p.helpById)(String(e.guide));return a?.showMe?(t.go(a.showMe.tab,a.showMe.page??null),setTimeout(()=>d.useCoach.getState().show(a.showMe.target,a.showMe.hint),250),`Here\u2019s where: ${a.showMe.hint}`):'No guide for that.'}},{id:'add_walkin',title:'Add a walk-in',description:'Seat a walk-in party now, optionally at a table.',risk:'change',form:!0,params:[{name:'covers',type:'integer',required:!0,description:'Number of covers (1\u2013100)'},{name:'table',type:'string',description:'Table name, if known'}],keywords:['walk-in','walkin','walk in','seat','just arrived','no booking'],match:e=>/\bwalk-in\b/.test(e)&&!/\b(fridges?|freezers?|cold room|degrees|temps?|temperatures?|probe|minus|how long|wait|waiting|waitlist|how many|undo|remove|cancel)\b/.test(e)||/\b(seat|sit)\b/.test(e)&&/\b(just arrived|no booking)\b/.test(e)?9:/\b(just arrived|no booking)\b/.test(e)?3:/\b(seat|sit)\b/.test(e)?1:0,parse:e=>{const t={},a=(0,h.walkInCovers)(e);a&&(t.covers=a);const s=(0,h.tableSaid)(e);return s&&(t.table=s),t},preview:(e,t)=>`Seat a walk-in of ${e.covers} cover${1===Number(e.covers)?'':'s'}${e.table?` at table ${T(e.table)}`:' (table to assign)'}${E(t?.rid,e.table)}`,run:async(e,a)=>{const s=Number(e.covers);return(0,t.validParty)(s)?(await i.repo.bookings.seatWalkIn(a.rid,s,e.table?T(e.table):void 0,'Added by Assistant'),`Done: walk-in of ${s} seated${e.table?` at table ${T(e.table)}`:''}. It\u2019s in Bookings now.`):`${t.PARTY_RULE} Say for example \u201cwalk-in of 2 at table 4\u201d.`}},{id:'add_rota_shift',apps:A,title:'Add a rota shift',description:'Add a DRAFT shift for one person (staff see it only after the week is published).',risk:'change',form:!0,params:[{name:'staffId',type:'string',required:!0,description:'Staff member id'},{name:'date',type:'date',required:!0,description:'YYYY-MM-DD'},{name:'start',type:'time',required:!0,description:'Start hour, e.g. 17 or 17.5'},{name:'end',type:'time',required:!0,description:'End hour, e.g. 23'}],keywords:['shift','rota','put','add','schedule','on'],preview:e=>`Add a draft shift: ${_(e.staffId)}, ${e.date?N(String(e.date)):'?'}, ${C(Number(e.start))}\u2013${C(Number(e.end))}`,run:e=>{const t=Number(e.start),a=Number(e.end);if(!(e.staffId&&e.date&&a>t))return'That shift isn\u2019t complete.';const s=(0,n.leaveOn)(n.useOwner.getState().leave,String(e.staffId),String(e.date));return s?`${_(e.staffId)} has time off then (${N(s.from)} to ${N(s.to)}). Add the shift on the Rota yourself if they\u2019ve agreed to work.`:(n.useOwner.getState().addShift({staffId:String(e.staffId),date:String(e.date),start:t,end:a}),`Done: draft shift for ${_(e.staffId)} on ${N(String(e.date))} (${(0,n.weekdayOf)(String(e.date))>=0?'publish the week when ready':''}).`)}},{id:'publish_rota',apps:A,title:'Publish the rota',description:'Make the week\u2019s draft shifts visible to staff (they\u2019re told in the app).',risk:'send',params:[],keywords:['publish','send rota','release rota'],preview:()=>'Publish this week\u2019s rota so staff are notified in the Staff app',run:()=>'Nothing was published or sent. Open the Rota and tap Publish yourself when you\u2019re ready.'},{id:'message_staff',apps:A,title:'Message the team',description:'Post a message to staff chat.',risk:'send',params:[{name:'text',type:'string',required:!0,description:'Message'}],keywords:['message','tell the team','text staff','announce'],preview:e=>`Send to All staff: \u201c${e.text??''}\u201d`,run:()=>'Nothing was sent.'},{id:'pay_tips',apps:A,title:'Pay out tips',description:'Pay each person their tips share.',risk:'pay',params:[],keywords:['pay tips','pay out','transfer','pay staff'],preview:()=>'Pay out this fortnight\u2019s tips',run:()=>'CoverCharge never moves money. Use Tips day to work out the split, then pay through your payroll.'},{id:'remove_shift',apps:A,title:'Remove a shift',description:'Delete a rota shift.',risk:'delete',params:[{name:'staffId',type:'string',description:'Staff member id'},{name:'date',type:'date',description:'YYYY-MM-DD'}],keywords:['remove shift','delete shift','cancel shift','take off'],preview:e=>`Delete ${_(e.staffId)}\u2019s shift${e.date?` on ${N(String(e.date))}`:''}`,run:()=>'Nothing was deleted. Open the Rota and tap the shift to remove it yourself.'},...c.VOICE_ACTIONS,...f.STAFF_VOICE_ACTIONS,...s.OPS_VOICE_ACTIONS,...r.GAP_VOICE_ACTIONS],D=e=>j.find(t=>t.id===e);const L={one:1,two:2,three:3,four:4,five:5,six:6,seven:7,eight:8,nine:9,ten:10,eleven:11,twelve:12},x=['monday','tuesday','wednesday','thursday','friday','saturday','sunday'];function R(e){const t=e.match(/^(\d{1,2})(?::(\d{2}))?\s*(am|pm)?$/);if(!t)return null;let a=Number(t[1]);const s=Number(t[2]??0);return'pm'===t[3]&&a<12&&(a+=12),'am'===t[3]&&12===a&&(a=0),!t[3]&&a>=1&&a<=7&&(a+=12),a>24||s>59?null:a+s/60}function Y(e,t){const a=` ${e.toLowerCase().replace(/\u2019/g,"'")} `,s={},r=a.match(/(?:for|of|party of|x)\s+(\d{1,2}|one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve)\b/)??a.match(/\b(\d{1,2})\s*(?:covers|people|guests|pax|persons)\b/);r&&(s.covers=L[r[1]]??Number(r[1]));const i=a.match(/\btable\s+([a-z]?\d{1,3}[a-z]?)\b/);i&&(s.table=i[1].toUpperCase()),/\btomorrow\b/.test(a)?s.date=(0,n.addDays)(t,1):/\btoday\b|\btonight\b/.test(a)&&(s.date=t);const o=a.match(/\b(\d{1,2})\/(\d{1,2})(?:\/(\d{2,4}))?\b/);if(o){const e=o[3]?2===o[3].length?2e3+Number(o[3]):Number(o[3]):Number(t.slice(0,4));s.date=`${e}-${o[2].padStart(2,'0')}-${o[1].padStart(2,'0')}`}const d=x.findIndex(e=>a.includes(` ${e}`)||a.includes(` ${e.slice(0,3)} `));if(!s.date&&d>=0){const e=(0,n.weekdayOf)(t);s.date=(0,n.addDays)(t,(d-e+7)%7||7)}const p=a.match(/(\d{1,2}(?::\d{2})?\s*(?:am|pm)?)\s*(?:-|\u2013|to|till|until)\s*(\d{1,2}(?::\d{2})?\s*(?:am|pm)?)/);if(p){const e=R(p[1].trim()),t=R(p[2].trim());null!==e&&null!==t&&(s.start=e,s.end=t<=e?t+12:t)}const l=n.useOwner.getState().staff.filter(e=>e.active).find(e=>(0,n.staffCalls)(e).some(e=>e.length>2&&/^[a-z' -]+$/.test(e)&&new RegExp(`\\b${e}\\b`).test(a)));return l&&(s.staffId=l.id),s}},1513,[1514,1096,843,1515,1516,876,858,996,1458,1511,1512,1518,1517,1520,1521,994,995]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"HISTORY_VOICE_ACTIONS",{enumerable:!0,get:function(){return t}});var o=r(d[0]);const t=[{id:'look_back_bookings',title:'Look back at bookings',apps:['owner'],risk:'look',description:'Read booking times, party sizes, recorded tables and Booked covers for one exact past date. Incomplete supplementary previous booking system history; text only.',params:[{name:'date',type:'date',required:!0,description:'Exact past date YYYY-MM-DD, with explicitly supplied four-digit year'}],keywords:['look back','booked covers','historical bookings'],match:o=>/\b(open|go to)\s+(?:the\s+)?look back\b/.test(o)&&!/\b\d{4}\b/.test(o)?0:/\b(look back|booked covers|historical bookings)\b/.test(o)||/\b(bookings|reservations|covers)\b/.test(o)&&/\b\d{4}\b/.test(o)&&!/\b(add|create|new|book a|reserve|move|change|cancel)\b/.test(o)?10:0,parse:(t,s)=>({date:(0,o.exactHistoryDate)(t,s.today)}),preview:o=>`Look up Booked covers and bookings for ${o.date??'an exact past date'}`,run:async(t,s)=>{const n=(0,o.exactHistoryDate)(String(t.date??''),s.today);if(!n)return'Give an exact past date with day, month and four-digit year, for example 5 November 2025.';const{lookupBookingDay:c}=await r(d[2])(d[1],d.paths);return(0,o.bookingDayText)(await c(s.rid,n))}}]},1514,[1062,1061,1021]); diff --git a/owner-desktop/index.html b/owner-desktop/index.html index a1991bc15bd7de090bca8feda3e79f75b2295acc..16a311e306c97416d4beab328c87d34d83c6be75 100644 --- a/owner-desktop/index.html +++ b/owner-desktop/index.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/owner-desktop/owner.html b/owner-desktop/owner.html index e4cd17e0247fb2eac7ca819746146da0888b704c..bb371d543ad87baba943ef874c6fd9676f73294d 100644 --- a/owner-desktop/owner.html +++ b/owner-desktop/owner.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/owner-desktop/sw.js b/owner-desktop/sw.js index 33a4e3d95d3fb33f95214985c2096405acd03481..7eb9e6962d861deb4d7f0f73b0d44c3dfbda49fc 100644 --- a/owner-desktop/sw.js +++ b/owner-desktop/sw.js @@ -1,7 +1,7 @@ // Anchorage owners desktop service worker: precache the app shell so it opens offline after the first visit. -const V = "cc-desk-c2c66d15b9"; +const V = "cc-desk-27786728e1"; const BASE = "/owner-desktop/"; -const PRECACHE = ["/owner-desktop/assets/assets/brand/anchorage-hero.0450b828e4f9c1f4456240096598f6f5.png", "/owner-desktop/assets/assets/brand/anchorage.fea5ce2f6fd18bf2950aa21c0980ed8e.png", "/owner-desktop/assets/assets/recipes/fishsupper.1609c58319e1e8721f5c639049fb054e.jpg", "/owner-desktop/assets/assets/recipes/lobster.2fb3485c8e372972099259017358c1b8.jpg", "/owner-desktop/assets/assets/recipes/moules.a4f342fc7e7fb62c8a0b5c1678bbea3f.jpg", "/owner-desktop/assets/assets/recipes/skink.4ce7b7c676f9cdcd0a060eda46f5a00e.jpg", "/owner-desktop/assets/assets/recipes/stp.1061ced765efdcafff2554adc3fc7113.jpg", "/owner-desktop/assets/assets/specials/sample-chalkboard.e7b4e4450a8483d4219bc6a214158d8f.jpg", "/owner-desktop/assets/node_modules/@expo-google-fonts/poppins/400Regular/Poppins_400Regular.093ee89be9ede30383f39a899c485a82.ttf", "/owner-desktop/assets/node_modules/@expo-google-fonts/poppins/500Medium/Poppins_500Medium.bf59c687bc6d3a70204d3944082c5cc0.ttf", "/owner-desktop/assets/node_modules/@expo-google-fonts/poppins/600SemiBold/Poppins_600SemiBold.6f1520d107205975713ba09df778f93f.ttf", "/owner-desktop/assets/node_modules/@expo-google-fonts/poppins/700Bold/Poppins_700Bold.08c20a487911694291bd8c5de41315ad.ttf", "/owner-desktop/assets/node_modules/expo-router/assets/arrow_down.017bc6ba3fc25503e5eb5e53826d48a8.png", "/owner-desktop/assets/node_modules/expo-router/assets/error.d1ea1496f9057eb392d5bbf3732a61b7.png", "/owner-desktop/assets/node_modules/expo-router/assets/file.19eeb73b9593a38f8e9f418337fc7d10.png", "/owner-desktop/assets/node_modules/expo-router/assets/forward.d8b800c443b8972542883e0b9de2bdc6.png", "/owner-desktop/assets/node_modules/expo-router/assets/pkg.ab19f4cbc543357183a20571f68380a3.png", "/owner-desktop/assets/node_modules/expo-router/assets/react-navigation/elements/back-icon-mask.0a328cd9c1afd0afe8e3b1ec5165b1b4.png", "/owner-desktop/assets/node_modules/expo-router/assets/react-navigation/elements/back-icon.35ba0eaec5a4f5ed12ca16fabeae451d.png", "/owner-desktop/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55.png", "/owner-desktop/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@2x.png", "/owner-desktop/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@3x.png", "/owner-desktop/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@4x.png", "/owner-desktop/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7.png", "/owner-desktop/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@2x.png", "/owner-desktop/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@3x.png", "/owner-desktop/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@4x.png", "/owner-desktop/assets/node_modules/expo-router/assets/react-navigation/elements/search-icon.286d67d3f74808a60a78d3ebf1a5fb57.png", "/owner-desktop/assets/node_modules/expo-router/assets/sitemap.412dd9275b6b48ad28f5e3d81bb1f626.png", "/owner-desktop/assets/node_modules/expo-router/assets/unmatched.20e71bdf79e3a97bf55fd9e164041578.png", "/owner-desktop/favicon.ico", "/owner-desktop/index.html", "/owner-desktop/_expo/static/js/web/bundle.js?v=c2c66d15b94a16774866c0e117d4a920441a130786773dfd83d73832321e3f46"]; +const PRECACHE = ["/owner-desktop/assets/assets/brand/anchorage-hero.0450b828e4f9c1f4456240096598f6f5.png", "/owner-desktop/assets/assets/brand/anchorage.fea5ce2f6fd18bf2950aa21c0980ed8e.png", "/owner-desktop/assets/assets/recipes/fishsupper.1609c58319e1e8721f5c639049fb054e.jpg", "/owner-desktop/assets/assets/recipes/lobster.2fb3485c8e372972099259017358c1b8.jpg", "/owner-desktop/assets/assets/recipes/moules.a4f342fc7e7fb62c8a0b5c1678bbea3f.jpg", "/owner-desktop/assets/assets/recipes/skink.4ce7b7c676f9cdcd0a060eda46f5a00e.jpg", "/owner-desktop/assets/assets/recipes/stp.1061ced765efdcafff2554adc3fc7113.jpg", "/owner-desktop/assets/assets/specials/sample-chalkboard.e7b4e4450a8483d4219bc6a214158d8f.jpg", "/owner-desktop/assets/node_modules/@expo-google-fonts/poppins/400Regular/Poppins_400Regular.093ee89be9ede30383f39a899c485a82.ttf", "/owner-desktop/assets/node_modules/@expo-google-fonts/poppins/500Medium/Poppins_500Medium.bf59c687bc6d3a70204d3944082c5cc0.ttf", "/owner-desktop/assets/node_modules/@expo-google-fonts/poppins/600SemiBold/Poppins_600SemiBold.6f1520d107205975713ba09df778f93f.ttf", "/owner-desktop/assets/node_modules/@expo-google-fonts/poppins/700Bold/Poppins_700Bold.08c20a487911694291bd8c5de41315ad.ttf", "/owner-desktop/assets/node_modules/expo-router/assets/arrow_down.017bc6ba3fc25503e5eb5e53826d48a8.png", "/owner-desktop/assets/node_modules/expo-router/assets/error.d1ea1496f9057eb392d5bbf3732a61b7.png", "/owner-desktop/assets/node_modules/expo-router/assets/file.19eeb73b9593a38f8e9f418337fc7d10.png", "/owner-desktop/assets/node_modules/expo-router/assets/forward.d8b800c443b8972542883e0b9de2bdc6.png", "/owner-desktop/assets/node_modules/expo-router/assets/pkg.ab19f4cbc543357183a20571f68380a3.png", "/owner-desktop/assets/node_modules/expo-router/assets/react-navigation/elements/back-icon-mask.0a328cd9c1afd0afe8e3b1ec5165b1b4.png", "/owner-desktop/assets/node_modules/expo-router/assets/react-navigation/elements/back-icon.35ba0eaec5a4f5ed12ca16fabeae451d.png", "/owner-desktop/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55.png", "/owner-desktop/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@2x.png", "/owner-desktop/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@3x.png", "/owner-desktop/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@4x.png", "/owner-desktop/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7.png", "/owner-desktop/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@2x.png", "/owner-desktop/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@3x.png", "/owner-desktop/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@4x.png", "/owner-desktop/assets/node_modules/expo-router/assets/react-navigation/elements/search-icon.286d67d3f74808a60a78d3ebf1a5fb57.png", "/owner-desktop/assets/node_modules/expo-router/assets/sitemap.412dd9275b6b48ad28f5e3d81bb1f626.png", "/owner-desktop/assets/node_modules/expo-router/assets/unmatched.20e71bdf79e3a97bf55fd9e164041578.png", "/owner-desktop/favicon.ico", "/owner-desktop/index.html", "/owner-desktop/_expo/static/js/web/bundle.js?v=27786728e186161177782c564c87ffe9f06f2e3faaaed621ccce2be64f1c6978"]; // Hugging Face serves large files (fonts) through a redirect to its CDN. Browsers refuse to hand a *redirected* cached // response to a page, so store a plain copy instead (otherwise fonts, and so the app, fail to load offline). const plain = r => r.redirected ? r.blob().then(b => new Response(b, { status: 200, headers: { 'Content-Type': r.headers.get('Content-Type') || b.type || 'application/octet-stream' } })) : Promise.resolve(r); diff --git a/staff-app/_expo/static/js/web/bundle.js b/staff-app/_expo/static/js/web/bundle.js index 2aba66e1bb5161f38bca408500e8dd2e6b5d2915..7df1b923b6ae60244f291bac985abac77f19aa5c 100644 --- a/staff-app/_expo/static/js/web/bundle.js +++ b/staff-app/_expo/static/js/web/bundle.js @@ -921,7 +921,7 @@ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{v __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"ANCHORAGE_PAY",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"ANCHORAGE_KITCHEN",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"ANCHORAGE_KITCHEN_OLD",{enumerable:!0,get:function(){return u}}),Object.defineProperty(e,"restaurants",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"demoMenus",{enumerable:!0,get:function(){return l}});var t=r(d[0]);const n={slotMinutes:15,slotCap:3,bufferMins:5,leadMins:20,takeawayPaused:!1,bookingCoversPerSlot:20,bookingSlotMinutes:15,deposit:{...r(d[1]).DEPOSIT_DEFAULT},stampTarget:8,stampReward:'Free dessert',stampMinSpend:1e3,capacityPerHour:48,walkInShare:.35,turnMins:75,orderAtTable:!0},o={tipsFrequency:'fortnightly',tipsAnchorPayday:'2026-11-02',tipsEndsDaysBefore:1,wagePayDay:28,wageCutoffDay:23,weekendRule:'none'},s={0:['12:30','19:00'],1:null,2:null,3:['12:00','19:00'],4:['12:00','19:00'],5:['12:00','20:00'],6:['12:00','20:00']},u={0:['12:30','20:00'],1:null,2:null,3:['12:00','19:00'],4:['12:00','19:00'],5:['12:00','20:30'],6:['12:00','20:30']},c=[{id:'anchorage',name:'The Anchorage',tagline:'Harbourside seafood & Scottish produce',location:'Harbour View, Dunure, South Ayrshire',fictional:!1,phone:'01292 502826',website:'anchoragedunure.com',kitchenHours:s,hoursNote:'Kitchen (food) hours from Gordon, 30 Oct 2026: closed Mon\u2013Tue. The closing time is last food orders. Bar hours not set.',settings:{...n,orderAtTable:!1,pay:o,cashUpRecord:[...t.ANCHORAGE_CASH_UP],bookingCoversPerStart:15,bookingPartiesPerStart:4,onlinePartyMin:1,onlinePartyMax:8,bookingNoticeMins:15,autoAcceptUpTo:8},sections:[]}],l=[]},838,[839,841]); __d(function(g,_r,_i,_a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"TAKINGS_FIELDS",{enumerable:!0,get:function(){return t}}),Object.defineProperty(_e,"NO_SERVICE_SPLIT",{enumerable:!0,get:function(){return n}}),Object.defineProperty(_e,"TAKINGS_KEYS",{enumerable:!0,get:function(){return r}}),_e.withTakingsFields=function(e){e=e.filter(e=>!n.includes(e.key));const r=new Set(e.map(e=>e.key)),o=t.filter(e=>!r.has(e.key)).map(e=>({...e}));if(!o.length)return e;const a=e.findIndex(e=>'cash'===e.key),i=a<0?e.length:a+1;return[...e.slice(0,i),...o,...e.slice(i)]},Object.defineProperty(_e,"grossOf",{enumerable:!0,get:function(){return o}}),Object.defineProperty(_e,"ANCHORAGE_CASH_UP",{enumerable:!0,get:function(){return a}}),_e.cashFieldsForRecord=function(e,t){if(!t?.length)return e;const n=new Set,r=[];for(const o of t){const t=i[o],a=t?.key??`cu-${o.toLowerCase().replace(/[^a-z0-9]+/g,'-').replace(/^-|-$/g,'')||'figure'}`,l=e.find(e=>e.key===a);r.push({...l,...t??{kind:'money'},key:a,label:o}),n.add(a)}return[...r,...e.filter(e=>!n.has(e.key))]},Object.defineProperty(_e,"DEFAULT_CASHUP_FIELDS",{enumerable:!0,get:function(){return l}}),Object.defineProperty(_e,"DEFAULT_SALES_FIELDS",{enumerable:!0,get:function(){return u}}),_e.parseAmount=function(t,n="money"){if('number'===n){const e=t.replace(/[\xa3\s]/g,'');return/^\d{1,6}$/.test(e)?Number(e):null}return(0,e.parseMoneyInput)(t)},Object.defineProperty(_e,"isBlank",{enumerable:!0,get:function(){return s}}),Object.defineProperty(_e,"ymdUTC",{enumerable:!0,get:function(){return c}}),Object.defineProperty(_e,"addDaysYmd",{enumerable:!0,get:function(){return y}}),_e.weekStartOf=function(e){const t=(d(e).getUTCDay()+6)%7;return y(e,-t)},_e.combinedTips=function(e){const t='number'==typeof e.cashTips?e.cashTips:null,n='number'==typeof e.cardTips?e.cardTips:null;return null==t&&null==n?null:Math.round(100*((t??0)+(n??0)))/100},Object.defineProperty(_e,"takings",{enumerable:!0,get:function(){return f}}),Object.defineProperty(_e,"missing",{enumerable:!0,get:function(){return m}}),_e.dailySeries=function(e,t,n,r=f){const o=new Map(e.filter(e=>e.confirmedAt).map(e=>[e.date,e]));return Array.from({length:n},(e,a)=>{const i=y(t,a-n+1),l=o.get(i);return{date:i,value:l?r(l.vals):null}})},_e.weekCompare=function(e,t,n="net"){const r=t=>{const r=e.find(e=>e.weekStart===t&&e.confirmedAt),o=r?.vals[n];return'number'==typeof o?o:null},o=r(t),a=r(y(t,-7)),i=null!=o&&null!=a&&0!==a?Math.round((o-a)/a*1e3)/10:null;return{now:o,prev:a,change:i}},_e.tipsPot=function(e,t,n,r){const o=t.filter(e=>'payout'===e.kind&&e.throughDate).sort((e,t)=>e.at.localeCompare(t.at)),a=o[o.length-1],i=a?y(a.throughDate,1):n,l=e.filter(e=>e.date>=i&&e.date<=r).sort((e,t)=>e.date.localeCompare(t.date)),u=t.filter(e=>'correction'===e.kind&&e.forDate&&e.forDate>=i&&e.forDate<=r&&(!a||e.at>a.at)),s=Math.round(100*(l.reduce((e,t)=>e+t.total,0)+u.reduce((e,t)=>e+t.amount,0)))/100;return{from:i,total:Math.max(0,s),days:l,corrections:u,lastPayout:a??null,history:o.slice().reverse()}},_e.shareByHours=function(e,t,n){return e>0&&t>0&&n>0?Math.round(e*(t/n)*100)/100:0},_e.cashLocked=function(e,t=Date.now()){return!(!e.onServer||!e.confirmedAt)&&!(e.unlockedUntil&&Date.parse(e.unlockedUntil)>t)},_e.changedFields=function(e,t){const n=e??{},r=t??{},o=[],a=n.vals??{},i=r.vals??{};for(const e of new Set([...Object.keys(a),...Object.keys(i)]))JSON.stringify(a[e])!==JSON.stringify(i[e])&&o.push(e);JSON.stringify(n.categories??null)!==JSON.stringify(r.categories??null)&&(n.categories||r.categories)&&o.push('categories');JSON.stringify(n.photos??[])!==JSON.stringify(r.photos??[])&&e&&t&&o.push('photos');return o},Object.defineProperty(_e,"dayTakingsOf",{enumerable:!0,get:function(){return p}}),Object.defineProperty(_e,"daysInMonth",{enumerable:!0,get:function(){return k}}),_e.addMonths=b,Object.defineProperty(_e,"monthName",{enumerable:!0,get:function(){return O}}),Object.defineProperty(_e,"shortDay",{enumerable:!0,get:function(){return C}}),Object.defineProperty(_e,"longDay",{enumerable:!0,get:function(){return D}}),_e.poundsWhole=function(e){const t=e<0,n=String(Math.round(Math.abs(e))).replace(/\B(?=(\d{3})+(?!\d))/g,',');return`${t?'-':''}\xa3${n}`},_e.monthTakings=function(e,t,n,r){const o=new Map;for(const n of e){if(n.rid!==t)continue;const e=p(n);null!=e&&o.set(n.date,e)}const a=Number(n.slice(0,4)),i=Number(n.slice(5,7)),l=k(a,i),u=Array.from({length:l},(e,t)=>{const a=`${n}-${String(t+1).padStart(2,'0')}`,i=o.get(a),l=null!=i&&a<=r?'recorded':a>r?'future':a===r?'pending':'missing';return{date:a,day:t+1,value:'recorded'===l?i:null,state:l}}),s=u.filter(e=>'recorded'===e.state),c=Math.round(100*s.reduce((e,t)=>e+(t.value??0),0))/100,d=s.reduce((e,t)=>!e||t.value>e.value?{date:t.date,value:t.value}:e,null),y=r.slice(0,7)===n,f=n0?Math.round((c-T)/T*100):null;return{ym:n,month:O(n),days:u,total:c,recorded:s.length,current:y,past:f,best:d,vsPct:D}},Object.defineProperty(_e,"firstTakingsMonth",{enumerable:!0,get:function(){return P}}),_e.canSeeMonthTakings=function(e,t,n={}){return!n.inStaffApp&&'owner'===e&&(t?'owner'===t.role||!0===t.ownerAccess:!n.live)},_e.ownerHomeLayout=function(e,t,n=!1){return!n&&'owner'===e&&(!t||'owner'===t.role||!0===t.ownerAccess)};var e=_r(_d[0]);const t=[{key:'gross',label:'Gross takings',kind:'money',fixed:!0,optional:!0},{key:'food',label:'Food takings (optional)',kind:'money',fixed:!0,optional:!0},{key:'drink',label:'Drink takings (optional)',kind:'money',fixed:!0,optional:!0}],n=['lunchGross','dinnerGross'],r=t.map(e=>e.key);const o=e=>'number'==typeof e.gross?e.gross:null,a=['Z total','Card total','Cash total','Paid out','Card tips','Cash tips'],i={'Z total':{key:'zTotal',kind:'money'},'Card total':{key:'card',kind:'money'},'Cash total':{key:'cash',kind:'money'},'Paid out':{key:'paidOut',kind:'money',optional:!0},'Card tips':{key:'cardTips',kind:'money',fixed:!0},'Cash tips':{key:'cashTips',kind:'money',fixed:!0}};const l=[{key:'card',label:'Card takings',kind:'money'},{key:'cash',label:'Cash takings',kind:'money'},{key:'paidOut',label:'Paid out',kind:'money',fixed:!0,optional:!0},...t,{key:'float',label:'Float (tills)',kind:'money'},{key:'cashTips',label:'Cash tips total',kind:'money',fixed:!0},{key:'cardTips',label:'Card tips total',kind:'money',fixed:!0},{key:'overUnder',label:'Over / under (discrepancy)',kind:'money'},{key:'notes',label:'Notes',kind:'text'}],u=[{key:'gross',label:'Gross sales',kind:'money'},{key:'net',label:'Net sales',kind:'money',fixed:!0},{key:'vat',label:'VAT',kind:'money'},{key:'covers',label:'Covers',kind:'number'},{key:'discounts',label:'Discounts',kind:'money'},{key:'refunds',label:'Refunds',kind:'money'}];const s=e=>null==e||''===e,c=e=>e.toISOString().slice(0,10),d=e=>new Date(`${e}T12:00:00Z`),y=(e,t)=>{const n=d(e);return n.setUTCDate(n.getUTCDate()+t),c(n)};const f=e=>{const t='number'==typeof e.card?e.card:null,n='number'==typeof e.cash?e.cash:null;return null==t&&null==n?null:(t??0)+(n??0)},m=(e,t)=>e.filter(e=>'text'!==e.kind&&!e.optional&&s(t[e.key])).map(e=>e.key);const p=e=>e.confirmedAt?o(e.vals)??f(e.vals):null,k=(e,t)=>new Date(Date.UTC(e,t,0)).getUTCDate();function b(e,t){const n=Number(e.slice(0,4)),r=Number(e.slice(5,7))-1+t;return`${n+Math.floor(r/12)}-${String((r%12+12)%12+1).padStart(2,'0')}`}const h=['January','February','March','April','May','June','July','August','September','October','November','December'],S=['Sun','Mon','Tue','Wed','Thu','Fri','Sat'],T=['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'],O=e=>h[Number(e.slice(5,7))-1]??'',C=e=>{const t=d(e);return`${S[t.getUTCDay()]} ${t.getUTCDate()} ${h[t.getUTCMonth()].slice(0,3)}`},D=e=>{const t=d(e);return`${T[t.getUTCDay()]} ${t.getUTCDate()} ${h[t.getUTCMonth()]}`};const P=(e,t)=>e.filter(e=>e.rid===t&&null!=p(e)).map(e=>e.date.slice(0,7)).sort()[0]??null},839,[840]); __d(function(g,r,_i,_a,m,e,d){"use strict";function t(t,n){const i=!(!n?.allowMinus||!String(t??'').trim().startsWith('-'));let s=String(t??'').replace(/,/g,'.');s=s.replace(/[^\d.]/g,'');const l=s.indexOf('.');if(l>=0){s=s.slice(0,l+1)+s.slice(l+1).replace(/\./g,'');const[t,n=""]=s.split('.');s=t+'.'+n.slice(0,2)}return(i?'-':'')+s}Object.defineProperty(e,'__esModule',{value:!0}),e.sanitiseMoneyTyping=t,e.parseMoneyInput=function(n){const i=String(n??''),s=i.trim().startsWith('-'),l=i.trim().replace(/^\xa3/,'').replace(/\xa3/g,'').replace(/\s/g,'').replace(/^-/,'');if(l&&/[^\d.,]/.test(l))return null;const c=t(n);if(!c||'.'===c)return null;if(!/^\d+(\.\d{0,2})?$/.test(c))return null;const u=Math.round(100*Number(c))/100;return Number.isFinite(u)?s?-u:u:null},Object.defineProperty(e,"onMoneyChange",{enumerable:!0,get:function(){return n}});const n=n=>i=>n(t(i))},840,[]); -__d(function(g,r,i,a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"DEPOSIT_DEFAULT",{enumerable:!0,get:function(){return e}}),_e.depositOf=function(t){const n=t?.deposit;return n&&'object'==typeof n?{on:n.on??e.on,...!0===n.needsConfirmation?{needsConfirmation:!0}:{},perPersonPence:Number.isFinite(n.perPersonPence)?Math.max(0,Math.round(n.perPersonPence)):n.needsConfirmation?0:e.perPersonPence,fromParty:Number.isFinite(n.fromParty)?Math.max(1,Math.round(n.fromParty)):n.needsConfirmation?1:e.fromParty,refundable:'boolean'==typeof n.refundable?n.refundable:null,cutoffHours:Number.isFinite(n.cutoffHours)?Math.max(0,Math.round(n.cutoffHours)):null,policy:'string'==typeof n.policy?n.policy.slice(0,600):'',wixLinksOn:!0===n.wixLinksOn,wixLinkHours:Number.isFinite(n.wixLinkHours)?Math.max(1,Math.min(168,Math.round(n.wixLinkHours))):48}:{...e}},_e.childrenIn=t,Object.defineProperty(_e,"adultsIn",{enumerable:!0,get:function(){return n}}),_e.depositDue=o,_e.depositWords=function(e,d,u,p=0){if(e.needsConfirmation&&!e.on)return[e.policy.trim()||'Deposit policy awaiting venue confirmation.'];if(e.needsConfirmation)return['Table deposit policy not set yet. Ticketed event deposits are separate and are not a table policy.'];const l=o(e,d,p);if(!l)return[];const c=[t(d,p)?`A deposit of ${s(l)} (${s(e.perPersonPence)} for each of the ${n(d,p)} adults; children are free) is needed for ${e.fromParty} or more guests.`:`A deposit of ${s(l)} (${s(e.perPersonPence)} per adult; children are free) is needed for ${e.fromParty} or more guests.`];!0===e.refundable?c.push(e.cutoffHours?`Refundable if you cancel at least ${e.cutoffHours} hours before your booking.`:'Refundable if you cancel.'):!1===e.refundable?c.push('The deposit is not refundable.'):c.push(`Ask ${u} about refunds.`);e.policy.trim()&&c.push(e.policy.trim());return c.push(e.wixLinksOn?`${u} will send you a link to pay the deposit securely through website bookings.`:`No payment is taken in the app yet: ${u} will tell you how to pay the deposit.`),c},_e.waiverOf=d,_e.depositState=u,_e.waiverText=p,_e.canWaiveDeposit=function(e){if(['cancelled','finished','noshow','declined'].includes(e.status??''))return!1;const t=l(e);return'PAID'!==t&&'FULLY_REFUNDED'!==t&&'PARTIALLY_REFUNDED'!==t&&'FREE'!==t&&('paid'!==e.depositLink?.state&&('NOT_PAID'===t||'PARTIALLY_PAID'===t?!d(e):'due'===u(e)))},_e.wixPayStatus=l,_e.knownPaid=c,_e.fromWixOrder=f,_e.estimatedWix=b,_e.depositBadge=m,_e.canTickDeposit=function(e){if(d(e))return!1;const t=l(e);return'NOT_PAID'!==t&&'PAID'!==t&&'FULLY_REFUNDED'!==t&&'PARTIALLY_REFUNDED'!==t&&('paid'!==e.depositLink?.state&&'due'===u(e))},_e.canSendDepositLink=function(e,t){return!(!t.wixLinksOn||l(e)||d(e))&&(!e.walkIn&&!['cancelled','finished','noshow','declined'].includes(e.status??'')&&('due'===u(e)&&'paid'!==e.depositLink?.state))},_e.depositTerms=function(e){const t=[];!0===e.refundable?t.push(e.cutoffHours?`The deposit is refundable if you cancel at least ${e.cutoffHours} hours before.`:'The deposit is refundable if you cancel.'):!1===e.refundable&&t.push('The deposit is not refundable.');e.policy.trim()&&t.push(e.policy.trim());return t.join(' ')},_e.depositLinkMessage=function(e){const t=(e.name||'').trim().split(/\s+/)[0]||'there',[n,o,d]=e.date.split('-').map(Number),u=new Date(n,(o||1)-1,d||1).toLocaleDateString('en-GB',{weekday:'long',day:'numeric',month:'long'}),p=e.expiresAt?new Date(e.expiresAt).toLocaleString('en-GB',{timeZone:'Europe/London',weekday:'long',day:'numeric',month:'long',hour:'numeric',minute:'2-digit',hourCycle:'h12'}).replace(/\s?(am|pm)$/i,e=>e.trim().toLowerCase()):'',l=[`Hello ${t}, thank you for booking ${e.venue} for ${e.partySize} on ${u} at ${e.time.slice(0,5)}.`,`To hold your table, please pay the ${s(e.amountPence)} deposit here: ${e.url}`];p&&l.push(`The link works until ${p}.`);e.terms?.trim()&&l.push(e.terms.trim());return l.push(`Thank you, ${e.venue}`),l.join('\n')},_e.depositView=D,_e.depositShort=function(e){const t=D(e,!1);return t?t.a11y.split(',')[0]:null};const e={on:!0,perPersonPence:1e3,fromParty:6,refundable:null,cutoffHours:null,policy:''};function t(e,t){const n=Math.max(0,Math.round(Number(e)||0)),o=Math.round(Number(t)||0);return Math.max(0,Math.min(n,o))}const n=(e,n)=>Math.max(0,Math.round(Number(e)||0)-t(e,n));function o(e,t,o=0){return!e.on||e.perPersonPence<=0||t`\xa3${(e/100).toFixed(e%100?2:0)}`;function d(e){const t=e.depositWaived;return t&&'object'==typeof t&&'string'==typeof t.by&&t.by?t:null}function u(e){if('deposit'!==e.security)return'none';const t=e.depositDue??e.depositPaid??0;return t?(e.depositPaid??0)>=t?'paid':d(e)?'waived':'due':'none'}function p(e){const t=new Date(e.at),n=!Number.isNaN(t.getTime())?t.toLocaleString('en-GB',{timeZone:'Europe/London',day:'2-digit',month:'2-digit',hour:'2-digit',minute:'2-digit',hourCycle:'h23'}).replace(',',''):'';return`Waived by ${e.by}${n?`, ${n}`:''}${e.note?.trim()?` (${e.note.trim()})`:''}`}function l(e){const t=e.wix?.paymentStatus;return t&&['FREE','NOT_PAID','PAID','PARTIALLY_PAID','PARTIALLY_REFUNDED','FULLY_REFUNDED'].includes(t)?t:null}function c(e){return'paid'===e.depositLink?.state&&(e.depositLink.paidPence??0)>0?e.depositLink.paidPence:e.depositPaidBy&&'Wix'!==e.depositPaidBy&&(e.depositPaid??0)>0&&!e.wix?.depositEstimated||f(e)&&(e.depositPaid??0)>0?e.depositPaid:null}function f(e){return'wix-order'===e.wix?.amountSource||'wix-order'===e.depositSource}function b(e){if(f(e)||!e.wix?.depositEstimated&&'estimate'!==e.depositSource)return null;const t=e.depositPaid??0;if(t<=0)return null;const n=e.partySize??0;return{pence:t,perHead:e.wix?.perPersonPence??(n?Math.round(t/n):0),party:n}}function m(e,t=s){const n=l(e),o=c(e),p=d(e);if(p&&'PAID'!==n&&(!e.depositPaidBy||!o)&&'paid'!==e.depositLink?.state&&'paid'!==u(e))return{label:`Deposit waived \xb7 ${p.by}`,kind:'neutral'};if(n&&'FREE'!==n){if(e.depositPaidBy&&o)return{label:`Deposit paid \xb7 ${t(o)}`,kind:'gold'};if('PAID'===n){if(o)return{label:`Deposit paid \xb7 ${t(o)}`,kind:'gold'};const n=b(e);return n?{label:n.party&&n.perHead?`Deposit paid (about ${t(n.pence)}, ${n.party} \xd7 ${t(n.perHead)})`:`Deposit paid (about ${t(n.pence)})`,kind:'gold'}:{label:'Deposit paid on website bookings',kind:'gold'}}return'PARTIALLY_PAID'===n?{label:o&&(e.depositDue??0)>o?`Part paid on website bookings \xb7 ${t(o)} of ${t(e.depositDue)}`:'Part paid on website bookings',kind:'amber'}:'NOT_PAID'===n?{label:(e.depositDue??0)>0?`Deposit not paid \xb7 ${t(e.depositDue)} due`:'Deposit not paid',kind:'amber'}:'FULLY_REFUNDED'===n?{label:'Deposit refunded on website bookings',kind:'neutral'}:{label:'Deposit part refunded on website bookings',kind:'neutral'}}const f=u(e);if('none'===f)return null;const m=e.depositLink;return'paid'===m?.state?{label:o?`Deposit paid on website bookings \xb7 ${t(o)}`:'Deposit paid on website bookings',kind:'gold'}:'paid'===f?{label:o?`Deposit paid \xb7 ${t(o)}`:'Deposit paid',kind:'gold'}:'open'===m?.state?{label:`Deposit link sent \xb7 waiting \xb7 ${t(m.amountPence??e.depositDue??0)}`,kind:'amber'}:'expired'===m?.state?{label:'Deposit link ran out \xb7 send a new one',kind:'amber'}:{label:`Deposit due \xb7 ${t(e.depositDue??0)}`,kind:'amber'}}function D(e,t,n=s){const o=m(e,n);if(!o)return null;const u=l(e),c=o.label.startsWith('Deposit paid');if(o.label.startsWith('Deposit waived')){const n=d(e);return{label:t?o.label:'Deposit waived',kind:'neutral',a11y:p(n).replace(/^Waived/,'Deposit waived'),note:t?p(n):void 0,paid:!1}}if(!t)return c?{label:'\u2713 Deposit paid',kind:'gold',a11y:'Deposit paid',paid:c}:'PARTIALLY_PAID'===u?{label:'Deposit part paid',kind:'amber',a11y:'Deposit part paid',paid:c}:'FULLY_REFUNDED'===u||'PARTIALLY_REFUNDED'===u?{label:'Deposit refunded',kind:'neutral',a11y:'Deposit refunded',paid:c}:'NOT_PAID'===u?{label:'Deposit not paid',kind:'amber',a11y:'Deposit not paid yet',paid:c}:{label:'Deposit due',kind:'amber',a11y:'Deposit due, not paid yet',paid:c};const D='PAID'===u?b(e):null,y=D&&D.perHead?`Website bookings shows paid; amount worked out at ${n(D.perHead)} a head`:f(e)&&c?'Amount from the website bookings order':void 0,P=o.label.replace(/ \xb7 /g,', ').replace(/\xd7/g,'times').replace(/[()]/g,'')+(y?`. ${y}`:'');return{label:o.label,kind:o.kind,a11y:P,note:y,paid:c}}},841,[]); +__d(function(g,r,i,a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"DEPOSIT_DEFAULT",{enumerable:!0,get:function(){return e}}),_e.depositOf=function(t){const n=t?.deposit;return n&&'object'==typeof n?{on:n.on??e.on,...!0===n.needsConfirmation?{needsConfirmation:!0}:{},perPersonPence:Number.isFinite(n.perPersonPence)?Math.max(0,Math.round(n.perPersonPence)):n.needsConfirmation?0:e.perPersonPence,fromParty:Number.isFinite(n.fromParty)?Math.max(1,Math.round(n.fromParty)):n.needsConfirmation?1:e.fromParty,refundable:'boolean'==typeof n.refundable?n.refundable:null,cutoffHours:Number.isFinite(n.cutoffHours)?Math.max(0,Math.round(n.cutoffHours)):null,policy:'string'==typeof n.policy?n.policy.slice(0,600):'',wixLinksOn:!0===n.wixLinksOn,wixLinkHours:Number.isFinite(n.wixLinkHours)?Math.max(1,Math.min(168,Math.round(n.wixLinkHours))):48}:{...e}},_e.childrenIn=t,Object.defineProperty(_e,"adultsIn",{enumerable:!0,get:function(){return n}}),_e.depositDue=o,_e.depositWords=function(e,d,u,p=0){if(e.needsConfirmation&&!e.on)return[e.policy.trim()||'Deposit policy awaiting venue confirmation.'];if(e.needsConfirmation)return['Table deposit policy not set yet. Ticketed event deposits are separate and are not a table policy.'];const l=o(e,d,p);if(!l)return[];const c=[t(d,p)?`A deposit of ${s(l)} (${s(e.perPersonPence)} for each of the ${n(d,p)} adults; children don't count towards the ${e.fromParty} and don't pay) is needed for ${e.fromParty} or more adults.`:`A deposit of ${s(l)} (${s(e.perPersonPence)} per adult; children don't count towards the ${e.fromParty} and don't pay) is needed for ${e.fromParty} or more adults.`];!0===e.refundable?c.push(e.cutoffHours?`Refundable if you cancel at least ${e.cutoffHours} hours before your booking.`:'Refundable if you cancel.'):!1===e.refundable?c.push('The deposit is not refundable.'):c.push(`Ask ${u} about refunds.`);e.policy.trim()&&c.push(e.policy.trim());return c.push(e.wixLinksOn?`${u} will send you a link to pay the deposit securely through website bookings.`:`No payment is taken in the app yet: ${u} will tell you how to pay the deposit.`),c},_e.waiverOf=d,_e.depositState=u,_e.waiverText=p,_e.canWaiveDeposit=function(e){if(['cancelled','finished','noshow','declined'].includes(e.status??''))return!1;const t=l(e);return'PAID'!==t&&'FULLY_REFUNDED'!==t&&'PARTIALLY_REFUNDED'!==t&&'FREE'!==t&&('paid'!==e.depositLink?.state&&('NOT_PAID'===t||'PARTIALLY_PAID'===t?!d(e):'due'===u(e)))},_e.wixPayStatus=l,_e.knownPaid=c,_e.fromWixOrder=f,_e.estimatedWix=b,_e.depositBadge=m,_e.canTickDeposit=function(e){if(d(e))return!1;const t=l(e);return'NOT_PAID'!==t&&'PAID'!==t&&'FULLY_REFUNDED'!==t&&'PARTIALLY_REFUNDED'!==t&&('paid'!==e.depositLink?.state&&'due'===u(e))},_e.canSendDepositLink=function(e,t){return!(!t.wixLinksOn||l(e)||d(e))&&(!e.walkIn&&!['cancelled','finished','noshow','declined'].includes(e.status??'')&&('due'===u(e)&&'paid'!==e.depositLink?.state))},_e.depositTerms=function(e){const t=[];!0===e.refundable?t.push(e.cutoffHours?`The deposit is refundable if you cancel at least ${e.cutoffHours} hours before.`:'The deposit is refundable if you cancel.'):!1===e.refundable&&t.push('The deposit is not refundable.');e.policy.trim()&&t.push(e.policy.trim());return t.join(' ')},_e.depositLinkMessage=function(e){const t=(e.name||'').trim().split(/\s+/)[0]||'there',[n,o,d]=e.date.split('-').map(Number),u=new Date(n,(o||1)-1,d||1).toLocaleDateString('en-GB',{weekday:'long',day:'numeric',month:'long'}),p=e.expiresAt?new Date(e.expiresAt).toLocaleString('en-GB',{timeZone:'Europe/London',weekday:'long',day:'numeric',month:'long',hour:'numeric',minute:'2-digit',hourCycle:'h12'}).replace(/\s?(am|pm)$/i,e=>e.trim().toLowerCase()):'',l=[`Hello ${t}, thank you for booking ${e.venue} for ${e.partySize} on ${u} at ${e.time.slice(0,5)}.`,`To hold your table, please pay the ${s(e.amountPence)} deposit here: ${e.url}`];p&&l.push(`The link works until ${p}.`);e.terms?.trim()&&l.push(e.terms.trim());return l.push(`Thank you, ${e.venue}`),l.join('\n')},_e.depositView=y,_e.depositShort=function(e){const t=y(e,!1);return t?t.a11y.split(',')[0]:null};const e={on:!0,perPersonPence:1e3,fromParty:6,refundable:null,cutoffHours:null,policy:''};function t(e,t){const n=Math.max(0,Math.round(Number(e)||0)),o=Math.round(Number(t)||0);return Math.max(0,Math.min(n,o))}const n=(e,n)=>Math.max(0,Math.round(Number(e)||0)-t(e,n));function o(e,t,o=0){return!e.on||e.perPersonPence<=0||n(t,o)`\xa3${(e/100).toFixed(e%100?2:0)}`;function d(e){const t=e.depositWaived;return t&&'object'==typeof t&&'string'==typeof t.by&&t.by?t:null}function u(e){if('deposit'!==e.security)return'none';const t=e.depositDue??e.depositPaid??0;return t?(e.depositPaid??0)>=t?'paid':d(e)?'waived':'due':'none'}function p(e){const t=new Date(e.at),n=!Number.isNaN(t.getTime())?t.toLocaleString('en-GB',{timeZone:'Europe/London',day:'2-digit',month:'2-digit',hour:'2-digit',minute:'2-digit',hourCycle:'h23'}).replace(',',''):'';return`Waived by ${e.by}${n?`, ${n}`:''}${e.note?.trim()?` (${e.note.trim()})`:''}`}function l(e){const t=e.wix?.paymentStatus;return t&&['FREE','NOT_PAID','PAID','PARTIALLY_PAID','PARTIALLY_REFUNDED','FULLY_REFUNDED'].includes(t)?t:null}function c(e){return'paid'===e.depositLink?.state&&(e.depositLink.paidPence??0)>0?e.depositLink.paidPence:e.depositPaidBy&&'Wix'!==e.depositPaidBy&&(e.depositPaid??0)>0&&!e.wix?.depositEstimated||f(e)&&(e.depositPaid??0)>0?e.depositPaid:null}function f(e){return'wix-order'===e.wix?.amountSource||'wix-order'===e.depositSource}function b(e){if(f(e)||!e.wix?.depositEstimated&&'estimate'!==e.depositSource)return null;const t=e.depositPaid??0;if(t<=0)return null;const n=e.partySize??0;return{pence:t,perHead:e.wix?.perPersonPence??(n?Math.round(t/n):0),party:n}}function m(e,t=s){const n=l(e),o=c(e),p=d(e);if(p&&'PAID'!==n&&(!e.depositPaidBy||!o)&&'paid'!==e.depositLink?.state&&'paid'!==u(e))return{label:`Deposit waived \xb7 ${p.by}`,kind:'neutral'};if(n&&'FREE'!==n){if(e.depositPaidBy&&o)return{label:`Deposit paid \xb7 ${t(o)}`,kind:'gold'};if('PAID'===n){if(o)return{label:`Deposit paid \xb7 ${t(o)}`,kind:'gold'};const n=b(e);return n?{label:n.party&&n.perHead?`Deposit paid (about ${t(n.pence)}, ${n.party} \xd7 ${t(n.perHead)})`:`Deposit paid (about ${t(n.pence)})`,kind:'gold'}:{label:'Deposit paid on website bookings',kind:'gold'}}return'PARTIALLY_PAID'===n?{label:o&&(e.depositDue??0)>o?`Part paid on website bookings \xb7 ${t(o)} of ${t(e.depositDue)}`:'Part paid on website bookings',kind:'amber'}:'NOT_PAID'===n?{label:(e.depositDue??0)>0?`Deposit not paid \xb7 ${t(e.depositDue)} due`:'Deposit not paid',kind:'amber'}:'FULLY_REFUNDED'===n?{label:'Deposit refunded on website bookings',kind:'neutral'}:{label:'Deposit part refunded on website bookings',kind:'neutral'}}const f=u(e);if('none'===f)return null;const m=e.depositLink;return'paid'===m?.state?{label:o?`Deposit paid on website bookings \xb7 ${t(o)}`:'Deposit paid on website bookings',kind:'gold'}:'paid'===f?{label:o?`Deposit paid \xb7 ${t(o)}`:'Deposit paid',kind:'gold'}:'open'===m?.state?{label:`Deposit link sent \xb7 waiting \xb7 ${t(m.amountPence??e.depositDue??0)}`,kind:'amber'}:'expired'===m?.state?{label:'Deposit link ran out \xb7 send a new one',kind:'amber'}:{label:`Deposit due \xb7 ${t(e.depositDue??0)}`,kind:'amber'}}function y(e,t,n=s){const o=m(e,n);if(!o)return null;const u=l(e),c=o.label.startsWith('Deposit paid');if(o.label.startsWith('Deposit waived')){const n=d(e);return{label:t?o.label:'Deposit waived',kind:'neutral',a11y:p(n).replace(/^Waived/,'Deposit waived'),note:t?p(n):void 0,paid:!1}}if(!t)return c?{label:'\u2713 Deposit paid',kind:'gold',a11y:'Deposit paid',paid:c}:'PARTIALLY_PAID'===u?{label:'Deposit part paid',kind:'amber',a11y:'Deposit part paid',paid:c}:'FULLY_REFUNDED'===u||'PARTIALLY_REFUNDED'===u?{label:'Deposit refunded',kind:'neutral',a11y:'Deposit refunded',paid:c}:'NOT_PAID'===u?{label:'Deposit not paid',kind:'amber',a11y:'Deposit not paid yet',paid:c}:{label:'Deposit due',kind:'amber',a11y:'Deposit due, not paid yet',paid:c};const y='PAID'===u?b(e):null,D=y&&y.perHead?`Website bookings shows paid; amount worked out at ${n(y.perHead)} a head`:f(e)&&c?'Amount from the website bookings order':void 0,P=o.label.replace(/ \xb7 /g,', ').replace(/\xd7/g,'times').replace(/[()]/g,'')+(D?`. ${D}`:'');return{label:o.label,kind:o.kind,a11y:P,note:D,paid:c}}},841,[]); __d(function(_g,_r,_i,_a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"SHAPES",{enumerable:!0,get:function(){return a}}),Object.defineProperty(_e,"shapeLabel",{enumerable:!0,get:function(){return o}}),Object.defineProperty(_e,"tableLabel",{enumerable:!0,get:function(){return s}}),Object.defineProperty(_e,"tableNumber",{enumerable:!0,get:function(){return u}}),_e.numberClashes=function(e){const t=new Map;for(const n of e){const e=u(n);t.set(e,[...t.get(e)??[],{name:n.name,areaId:n.areaId}])}const n=new Set,r=[];for(const[e,a]of t){if(a.length<2)continue;const t=new Map;a.forEach(e=>t.set(e.areaId,[...t.get(e.areaId)??[],e.name]));for(const e of t.values())e.length>1&&e.forEach(e=>n.add(e));t.size>1&&r.push(e)}return{sameArea:n,acrossAreas:r}},Object.defineProperty(_e,"liveTableLabel",{enumerable:!0,get:function(){return l}}),Object.defineProperty(_e,"FIXTURES",{enumerable:!0,get:function(){return i}}),Object.defineProperty(_e,"PLAN_W",{enumerable:!0,get:function(){return c}}),Object.defineProperty(_e,"PLAN_H",{enumerable:!0,get:function(){return b}}),Object.defineProperty(_e,"GRID",{enumerable:!0,get:function(){return m}}),Object.defineProperty(_e,"snap",{enumerable:!0,get:function(){return f}}),Object.defineProperty(_e,"clamp",{enumerable:!0,get:function(){return h}}),Object.defineProperty(_e,"fid",{enumerable:!0,get:function(){return g}}),Object.defineProperty(_e,"slug",{enumerable:!0,get:function(){return w}}),_e.sizeFor=y,Object.defineProperty(_e,"minFor",{enumerable:!0,get:function(){return x}}),Object.defineProperty(_e,"numOf",{enumerable:!0,get:function(){return O}}),Object.defineProperty(_e,"byNumber",{enumerable:!0,get:function(){return P}}),_e.newTable=j,_e.autoArrange=M,_e.placeNew=S,_e.rotate90=function(e){const t=e.x+e.w/2,n=e.y+e.h/2;return{...e,w:e.h,h:e.w,x:h(f(t-e.h/2),0,c-e.h),y:h(f(n-e.w/2),0,b-e.w)}},_e.normalisePlan=function(e){return{...e,fixtures:e.fixtures??[],tables:e.tables.map(e=>{const t=e.shape;let n='booth'===t||'rect'===t?'rect':'round'===t?'round':'square',{w:r,h:a}=e;if('square'===n||'round'===n){const e=Math.max(r,a);r=e,a=e}if(90===e.rot||270===e.rot){const e=r;r=a,a=e}return'rect'===n&&r===a&&(n='square'),{...e,shape:n,w:r,h:a,rot:0}})}},Object.defineProperty(_e,"SECTION_COLOURS",{enumerable:!0,get:function(){return I}}),_e.buildPlan=k,_e.anchoragePlan=$,_e.starterPlan=function(){return k({areas:[{name:'Main room',tables:[[1,2],[2,4],[3,6],[4,4],[5,2],[6,6]],fixtures:[A(450,600)]}]},['SV'])},Object.defineProperty(_e,"TEMPLATES",{enumerable:!0,get:function(){return v}}),_e.parseTableList=function(e){const t=[],n=[];let r;for(const a of e.split(/\r?\n/)){const e=a.trim();if(!e)continue;if(!/\d/.test(e)){r=e.replace(/[:\-\u2013]+$/,'').trim()||r;continue}const o=e.match(/^(?:table|tbl|tab|t)?\s*(?:no\.?|number|#)?\s*([a-z]?\d+[a-z]?)\b[^\d]*?(\d+)/i);if(!o){n.push(e);continue}const s=parseInt(o[2],10);!s||s>30?n.push(e):t.push({area:r,name:o[1].toUpperCase(),seats:s})}return{items:t,skipped:n}},Object.defineProperty(_e,"planCounts",{enumerable:!0,get:function(){return C}}),Object.defineProperty(_e,"tableDogOk",{enumerable:!0,get:function(){return B}}),Object.defineProperty(_e,"dogTables",{enumerable:!0,get:function(){return L}}),Object.defineProperty(_e,"areaOfTable",{enumerable:!0,get:function(){return q}}),_e.bestTables=E,Object.defineProperty(_e,"isBestTable",{enumerable:!0,get:function(){return _}}),_e.withSeedBest=function(e,t){if('anchorage'!==e||!t?.areas?.some(e=>void 0===e.best))return t;const n=$();return{...t,areas:t.areas.map(e=>{if(void 0!==e.best)return e;const r=n.areas.find(t=>t.id===e.id||t.name===e.name),a=(r?.best??[]).filter(n=>t.tables.some(t=>t.name===n&&t.areaId===e.id));return a.length?{...e,best:a}:e})}};var e,t=_r(d[0]),n=_r(d[1]),r=(e=n)&&e.__esModule?e:{default:e};const a=[{id:'square',label:'Square'},{id:'rect',label:'Rectangle'},{id:'round',label:'Round'}],o=e=>'rect'===e?'Rectangle':'round'===e?'Round':'Square',s=e=>/\d/.test(e.name)?(0,t.plainTableNumber)(e.name):(0,t.plainTableNumber)(e.label?.trim()||e.name),u=s;const l=(e,t)=>u(e),i=[{id:'bar',label:'Bar',w:300,h:50},{id:'wall',label:'Wall',w:250,h:25},{id:'door',label:'Door',w:100,h:25},{id:'window',label:'Window',w:200,h:25}],c=1e3,b=625,m=25,f=e=>Math.round(e/m)*m,h=(e,t,n)=>Math.max(t,Math.min(n,e));let p=0;const g=e=>`${e}-${Date.now().toString(36)}${(p++).toString(36)}`,w=e=>e.toLowerCase().replace(/[^a-z0-9]+/g,'-').replace(/^-|-$/g,'')||'area';function y(e){return e<=2?{shape:'square',w:75,h:75}:e<=4?{shape:'square',w:100,h:100}:e<=6?{shape:'rect',w:150,h:100}:e<=8?{shape:'rect',w:200,h:100}:e<=10?{shape:'rect',w:250,h:100}:{shape:'rect',w:300,h:100}}const x=e=>e<=2?1:Math.max(2,Math.ceil(e/2)),O=e=>{const t=e.match(/\d+/);return t?parseInt(t[0],10):9999},P=(e,t)=>O(e.name)-O(t.name)||e.name.localeCompare(t.name);function j(e,t,n,r){const a=y(n);return{id:`t-${e}-${g('x').slice(2)}`,name:e,areaId:t,shape:a.shape,minSeats:x(n),maxSeats:n,x:0,y:0,w:a.w,h:a.h,rot:0,online:!0,sectionId:r}}function M(e,t=125,n=75){const r=[...e].sort(P);if(!r.length)return r;let a=75;const o=e=>{const t=[];let n=[],a=0;for(const o of r){const r=(n.length?e:0)+o.w;n.length&&a+r>850&&(t.push(n),n=[],a=0),n.push(o),a+=(n.length>1?e:0)+o.w}return n.length&&t.push(n),t};let s=o(a);const u=(e,t)=>e.reduce((e,t)=>e+Math.max(...t.map(e=>e.h)),0)+t*(e.length-1);for(;u(s,a)>b-t-n&&a>25;)a-=25,s=o(a);const l=u(s,a),i=b-t-n,p=s.length>1?Math.min(150,a+Math.max(0,Math.floor((i-l)/(s.length-1)/m)*m)):0,g=s.reduce((e,t)=>e+Math.max(...t.map(e=>e.h)),0)+p*(s.length-1);let w=f(t+Math.max(0,(i-g)/2));const y=[];for(const e of s){const t=Math.max(...e.map(e=>e.h)),n=e.reduce((e,t)=>e+t.w,0)+a*(e.length-1);let r=f((c-n)/2);for(const n of e)y.push({...n,x:h(r,0,c-n.w),y:h(f(w+(t-n.h)/2),0,b-n.h),rot:0}),r+=n.w+a;w+=t+p}return y}function S(e,t,n=[]){const r=[...e,...n].map(e=>({x:e.x,y:e.y,w:e.w,h:e.h})),a=[];for(const e of t){let t=null;for(let n=50;n<=b-e.h-25&&!t;n+=m)for(let a=50;a<=c-e.w-25&&!t;a+=m){const o=50;r.some(t=>at.x&&nt.y)||(t={x:a,y:n})}const n=t??{x:50,y:50},o={...e,x:n.x,y:n.y};r.push({x:o.x,y:o.y,w:o.w,h:o.h}),a.push(o)}return a}const I=['#CFA45F','#E2C489','#A88B5A','#8C6A3A','#FFB547','#D9B98A'];function k(e,t=[]){const n=[],r=[],a=[],o=[];e.areas.forEach((e,s)=>{const u=w(e.name),l=e.best?e.best.map(String).filter(t=>e.tables.some(([e])=>String(e)===t)):void 0;n.push({id:u,name:e.name,dogs:!!e.dogs,outdoor:!!e.outdoor,...e.label?{label:e.label}:{},...e.colour?{colour:e.colour}:{},...l?{best:l}:{}});const i=`s-${u}`;o.push({id:i,name:e.name,colour:e.colour??I[s%I.length],server:t[s]??''});const m=(e.fixtures??[]).map((e,t)=>({...e,id:`fx-${u}-${t}`,areaId:u}));a.push(...m);const f=m.some(e=>e.y<100&&('bar'===e.kind||e.w>=300))?150:100,p=e.tables.map(([e,t])=>({...j(String(e),u,t,i),id:`t-${e}`})),g=e.layout??{},y=p.filter(e=>g[e.name]).map(e=>{const t=g[e.name],n=t.shape??(t.w===t.h?'square':'rect'),r=h(Math.round(t.w),50,c),a=h(Math.round('rect'===n?t.h:t.w),50,b);return{...e,shape:n,w:r,h:a,x:h(Math.round(t.x),0,c-r),y:h(Math.round(t.y),0,b-a),...t.label?{label:t.label}:{}}}),x=p.filter(e=>!g[e.name]);y.length?r.push(...y,...S(y,x,m)):r.push(...M(p,f,75))});const s=new Set(r.map(e=>e.name)),u=(e.joins??[]).filter(e=>e.every(e=>s.has(e))).map(e=>({id:`j-${e.join('-')}`,tables:e}));return{areas:n,tables:r,joins:u,sections:o,fixtures:a}}const T=(e,t,n=0,r=25)=>({kind:'window',x:e,y:n,w:t,h:r}),A=(e,t,n=100,r=25)=>({kind:'door',x:e,y:t,w:n,h:r});function $(){const e=r.default;return k({areas:e.areas.map(e=>({name:e.name,dogs:!!e.dogFriendly,outdoor:!(!e.outdoor&&!e.weatherDependent),label:e.label,colour:e.colour,tables:e.tables.map(([e,t])=>[e,t]),layout:e.layout,fixtures:[],best:e.best?.map(String)})),joins:e.joins??[]},e.areas.map(e=>e.server??''))}const v=[{id:'anchorage',name:'The Anchorage',sub:'4 areas \xb7 29 tables \xb7 119 seats',make:$},{id:'cafe',name:'Small caf\xe9',sub:'1 room \xb7 8 tables \xb7 dogs welcome',make:()=>k({areas:[{name:'Caf\xe9',dogs:!0,tables:[[1,2],[2,2],[3,4],[4,4],[5,2],[6,4],[7,2],[8,6]],fixtures:[{kind:'bar',x:300,y:25,w:400,h:50},A(450,600)]}]})},{id:'pub',name:'Pub with garden',sub:'Bar, lounge and beer garden',make:()=>k({areas:[{name:'Bar',dogs:!0,tables:[[1,2],[2,4],[3,4],[4,2],[5,4],[6,6]],fixtures:[{kind:'bar',x:250,y:25,w:500,h:75}]},{name:'Lounge',tables:[[7,4],[8,4],[9,2],[10,6],[11,4],[12,2],[13,4],[14,8]],fixtures:[T(150,700)]},{name:'Beer garden',dogs:!0,outdoor:!0,tables:[[20,6],[21,6],[22,4],[23,4],[24,6],[25,6]]}]})},{id:'restaurant',name:'Restaurant and terrace',sub:'Dining room with an outdoor terrace',make:()=>k({areas:[{name:'Dining room',tables:[[1,2],[2,2],[3,4],[4,4],[5,4],[6,6],[7,2],[8,2],[9,4],[10,4],[11,6],[12,8]],fixtures:[T(100,800),A(450,600)]},{name:'Terrace',outdoor:!0,tables:[[20,2],[21,4],[22,4],[23,2]]}]})},{id:'blank',name:'Blank',sub:'One empty room to start from',make:()=>k({areas:[{name:'Main room',tables:[]}]})}];const C=(e,t)=>{const n=t?e.tables.filter(e=>e.areaId===t):e.tables;return{tables:n.length,seats:n.reduce((e,t)=>e+t.maxSeats,0)}},B=(e,t)=>void 0!==t.dogOk?t.dogOk:!!e.areas.find(e=>e.id===t.areaId)?.dogs,L=e=>new Set(e.tables.filter(t=>B(e,t)).map(e=>e.name)),q=(e,t)=>e.areas.find(n=>n.id===e.tables.find(e=>e.name===t)?.areaId);function E(e,t){return e.areas.filter(e=>!t||e.id===t).flatMap(t=>(t.best??[]).filter(n=>e.tables.some(e=>e.name===n&&e.areaId===t.id)))}const _=(e,t)=>E(e).includes(t)},842,[843,844]); __d(function(g,r,i,a,m,e,d){"use strict";function t(t){const n=String(t??'').trim(),l=n.match(/\d+/g);return 1===l?.length?l[0].replace(/^0+(?=\d)/,''):n}Object.defineProperty(e,'__esModule',{value:!0}),e.plainTableNumber=t,Object.defineProperty(e,"tableNumbers",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"tableListNumbers",{enumerable:!0,get:function(){return l}}),e.tableNumbersA11y=function(t){const l=n(t).split('+').filter(Boolean);return l.length?`${1===l.length?'Table':'Tables'} ${l.join(', ')}`:'No table'},e.withTableWord=function(t){const n=t.trim();return!n||/^tables?\b/i.test(n)||/^no table\b/i.test(n)?n:`Table ${n}`};const n=n=>String(n??'').split('+').map(t).filter(Boolean).join('+'),l=(t,l=" + ")=>t.map(n).filter(Boolean).join(l)},843,[]); __d(function(e,a,l,r,t,o,s){t.exports={venue:"The Anchorage",note:"From Gordon 28 Oct 2026; layout from Gordon's floor-plan photo 29 Oct 2026 (positions, sizes, shapes, labels scaled from the photo, one scale for all areas). Photo shows MT12 and no MT8: table 8 replaced by 12. Gordon confirmed 29 Oct: no table 8; MT11 and MT12 both exist, MT11 keeps 2 seats, MT12 = 2 seats. No tables 4 or 8. No joined tables: Gordon confirmed 29 Oct that DT1 and DT2 are not joined.",areas:[{name:"Public Bar",label:"Dog friendly area (Public Bar), Area 1",colour:"#CFA45F",server:"BR",dogFriendly:!0,tables:[[1,4],[2,4],[3,5],[5,2],[6,4]],layout:{1:{label:"DT1",shape:"rect",x:600,y:125,w:205,h:90},2:{label:"DT2",shape:"rect",x:395,y:130,w:100,h:190},3:{label:"DT3",shape:"rect",x:205,y:120,w:110,h:245},5:{label:"DT5",shape:"square",x:500,y:395,w:105,h:105},6:{label:"DT6",shape:"rect",x:195,y:395,w:205,h:110}},best:[1,3]},{name:"Main Restaurant",label:"Main restaurant (no pets)",colour:"#8EC5FF",server:"SV",dogFriendly:!1,tables:[[7,5],[9,7],[10,4],[11,2],[12,2],[13,4],[14,4],[15,4],[16,2]],layout:{7:{label:"MT7",shape:"rect",x:590,y:410,w:225,h:115},9:{label:"MT9",shape:"rect",x:560,y:105,w:260,h:110},10:{label:"MT10",shape:"square",x:430,y:400,w:130,h:130},11:{label:"MT11",shape:"rect",x:545,y:270,w:115,h:90},12:{label:"MT12",shape:"rect",x:400,y:270,w:120,h:95},13:{label:"MT13",shape:"rect",x:400,y:100,w:90,h:115},14:{label:"MT14",shape:"rect",x:185,y:420,w:230,h:100},15:{label:"MT15",shape:"rect",x:190,y:220,w:165,h:145},16:{label:"MT16",shape:"rect",x:185,y:105,w:125,h:80}},best:[7,9]},{name:"Sitooterie",label:"Sitooterie (fully covered conservatory, no pets)",colour:"#C79BE8",server:"DM",dogFriendly:!1,tables:[[17,2],[18,6],[19,4],[20,6],[21,4],[22,4],[23,4]],layout:{17:{label:"ST17",shape:"square",x:760,y:325,w:110,h:110},18:{label:"ST18",shape:"rect",x:605,y:135,w:270,h:115},19:{label:"ST19",shape:"rect",x:460,y:160,w:105,h:150},20:{label:"ST20",shape:"rect",x:135,y:125,w:265,h:120},21:{label:"ST21",shape:"rect",x:120,y:305,w:110,h:175},22:{label:"ST22",shape:"rect",x:255,y:310,w:115,h:175},23:{label:"ST23",shape:"rect",x:410,y:350,w:110,h:155}},best:[19,21]},{name:"Beer Garden",label:"Outdoor beer garden (weather permitting, no shelter, pets allowed)",colour:"#B08D57",server:"GD",dogFriendly:!0,outdoor:!0,weatherDependent:!0,tables:[[24,4],[25,4],[26,4],[27,6],[28,6],[29,4],[30,4],[31,4]],layout:{24:{label:"BGT24",shape:"round",x:740,y:70,w:130,h:130},25:{label:"BGT25",shape:"round",x:515,y:50,w:135,h:135},26:{label:"BGT26",shape:"round",x:310,y:50,w:135,h:135},27:{label:"BGT27",shape:"rect",x:560,y:235,w:280,h:115},28:{label:"BGT28",shape:"rect",x:245,y:235,w:270,h:110},29:{label:"BGT29",shape:"rect",x:210,y:365,w:190,h:60},30:{label:"BGT30",shape:"rect",x:180,y:445,w:190,h:55},31:{label:"BGT31",shape:"rect",x:130,y:520,w:215,h:60}},best:[27,28]}],photoScale:1.8,joins:[],bestNote:"Best tables per area from Gordon, 1 Nov 2026: Bar 1 and 3; Restaurant 7 and 9; Sitooterie 19 and 21; Outside (Beer Garden) 27 and 28. Shown as BEST for walk-ins and bookings when they fit; editable per area in the table plan."}},844,[]); @@ -1059,7 +1059,7 @@ __d(function(g,r,i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule' __d(function(g,r,i,a,_m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.setClockServer=function(t){s=t,c()},e.markClockUnsent=function(t){o.set(t,Date.now()),c()},e.markClockSent=function(t){o.delete(t)&&c()},e.clockNotSent=l,e.useClockNotSent=function(o){const[,c]=(0,t.useState)(0);return(0,t.useEffect)(()=>{const t=()=>c(t=>t+1);u.add(t);const o=n.mutationQueue.subscribe(t);return()=>{u.delete(t),o()}},[]),l(o)};var t=r(d[0]),n=r(d[1]);const o=new Map,u=new Set,c=()=>{for(const t of u)t()};let s=()=>!1;function l(t){if(!t)return!1;return n.mutationQueue.pending.some(n=>'attendance'===n.table&&n.rowKey===t)||o.has(t)&&s()}n.mutationQueue.onDone(t=>{'attendance'===t.table&&o.delete(t.rowKey)&&c()})},976,[17,977]); __d(function(g,_r,i,a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"MutationQueue",{enumerable:!0,get:function(){return l}}),Object.defineProperty(_e,"mutationQueue",{enumerable:!0,get:function(){return o}});var t=_r(d[0]),e=_r(d[1]),s=_r(d[2]);const n='queue:v1',r='queue:failed:v1',h=t=>`${t.table}|${t.venueId}|${t.rowKey}`;class l{items=[];failedItems=[];loaded=null;flushing=null;flushingSince=0;exec=null;listeners=new Set;onFailure=new Set;onSaved=new Set;retryTimer=null;waitTimer=null;backoffMs=2e3;now=()=>Date.now();constructor(){(0,t.onConnectivity)(t=>{t&&this.flush()})}setExecutor(t){this.exec=t}load(){return this.loaded||(this.loaded=(async()=>{const t=await e.kv.get(n,[]);this.items=[...t.map(t=>({...t,nextAt:void 0})),...this.items],this.failedItems=await e.kv.get(r,[]),this.emit()})()),this.loaded}get pending(){return this.items}get waiting(){return this.items.filter(t=>t.attempts>0)}get failed(){return this.failedItems}hasPending(t,e,s){return this.items.some(n=>n.table===t&&n.venueId===e&&n.rowKey===s)}async enqueue(t){await this.load();const s={...t,id:(0,e.uuid)(),createdAt:(new Date).toISOString(),attempts:0};return this.items.push(s),await this.persist(),this.flush(),s}nextReady(){const t=new Set,e=this.now();for(const s of this.items){const n=h(s);if(!t.has(n)){if(!(s.nextAt&&s.nextAt>e))return s;t.add(n)}}}remove(t){this.items=this.items.filter(e=>e!==t)}flush(){if(this.flushing&&Date.now()-this.flushingSince<6e4)return this.flushing;this.flushingSince=Date.now();let e=null;return e=(async()=>{for(await this.load();this.exec;){if(this.flushing&&this.flushing!==e)return;const n=this.nextReady();if(!n)break;if(!(0,t.isOnline)()){this.scheduleRetry();break}try{const t=await this.exec(n);this.remove(n),this.backoffMs=2e3,'conflict'===t?this.fail(n,'conflict','Row changed on the server (version conflict) or is not visible to you'):this.onSaved.forEach(t=>t(n))}catch(e){n.attempts+=1,n.lastError=String(e?.message??e);const r=e??{};n.lastErr={code:r.code?String(r.code):void 0,status:Number(r.status)||void 0,message:n.lastError.slice(0,300)};const h=(0,s.classifyWriteError)(e);if('network'===h){n.attempts-=1,(0,t.setOnline)(!1),this.scheduleRetry(),await this.persist();break}'retry'===h?n.nextAt=this.now()+(0,s.retryDelayMs)(n.attempts):(this.remove(n),this.fail(n,'rejected',n.lastError))}await this.persist()}this.flushing===e&&(this.flushing=null),this.scheduleWaiting()})(),this.flushing=e,e}retryNow(){for(const t of this.items)t.nextAt=void 0;return this.flush()}subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}onFailed(t){return this.onFailure.add(t),()=>{this.onFailure.delete(t)}}onDone(t){return this.onSaved.add(t),()=>{this.onSaved.delete(t)}}async clearFailed(){this.failedItems=[],await e.kv.set(r,[]),this.emit()}fail(t,s,n){const h={...t,lastError:n,failedAt:(new Date).toISOString(),reason:s};this.failedItems=[h,...this.failedItems].slice(0,100),e.kv.set(r,this.failedItems),this.onFailure.forEach(t=>t(h))}scheduleWaiting(){this.waitTimer&&(clearTimeout(this.waitTimer),this.waitTimer=null);const t=this.items.map(t=>t.nextAt??0).filter(t=>t>0);if(!t.length)return;const e=Math.max(500,Math.min(...t)-this.now());this.waitTimer=setTimeout(()=>{this.waitTimer=null,this.flush()},e)}scheduleRetry(){if(this.retryTimer)return;const e=this.backoffMs;this.backoffMs=Math.min(2*this.backoffMs,6e4),this.retryTimer=setTimeout(()=>{this.retryTimer=null,(0,t.setOnline)(!0),this.flush()},e)}async persist(){await e.kv.set(n,this.items),this.emit()}emit(){this.listeners.forEach(t=>t())}}const o=new l},977,[974,936,978]); __d(function(g,r,i,a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.classifyWriteError=function(o){if((0,e.isNetworkError)(o))return'network';const{code:n,status:c,msg:l}=t(o);return s(o)?'refused':/^(08|53|57|58)/.test(n)||['40001','40P01','55P03','23505','23503'].includes(n)||/^PGRST30[0-3]$/.test(n)||/jwt|token.*expired/i.test(l)||401===c||408===c||425===c||429===c||c>=500?'retry':409!==c||n?'refused':'retry'},Object.defineProperty(_e,"retryDelayMs",{enumerable:!0,get:function(){return o}}),_e.describeWrite=function(e){const t='rpc'===e.kind?(e.fn??'change').replace(/_/g,' '):n[e.table]??e.table.replace(/_/g,' ').replace(/s$/,''),s=e.values??{},o=s.guest_name??s.name??s.display_name??s.title??s.reason,c='string'==typeof o&&o.trim()?` for ${o.trim().slice(0,60)}`:'';return'delete'===e.kind?`deleting a ${t}${c}`:`the ${t}${c}`},_e.plainReason=function(e,o){const{code:n,status:c,msg:l}=t(e);if('refused'===o)return s(e)?'more than 20 deletes in 10 minutes from one sign-in are stopped to keep your data safe':'42501'===n||403===c||/row-level security|permission/i.test(l)?'your sign-in isn\u2019t allowed to change this':'conflict'===n?'it was changed or removed on another device first':/^(22|23)/.test(n)?'the shared system says some of the details aren\u2019t valid':'P0001'===n&&l?l.slice(0,140):l?`the shared system said: ${l.slice(0,120)}`:'the shared system refused it';return'23505'===n?'the shared system already has another copy of it':'23503'===n?'a related change has to save first':/^PGRST30/.test(n)||401===c||/jwt/i.test(l)?'your sign-in is being refreshed':'the shared system is busy'};var e=r(d[0]);const t=e=>{const t=e&&'object'==typeof e?e:{};return{msg:String(t.message??e??''),code:String(t.code??''),status:Number(t.status??0)||0,hint:String(t.hint??'')}},s=e=>{const s=t(e);return/delete guard/i.test(s.hint)||/too many .* deleted in 10 minutes/i.test(s.msg)};const o=e=>Math.min(5e3*Math.pow(3,Math.max(0,e-1)),3e5),n={bookings:'booking',walk_ins:'walk-in',blocks:'blocked time',sold_out_items:'sold-out mark',sold_out_links:'dish stock link',staff:'staff details',rota_shifts:'rota shift',stock_items:'stock item',stock_events:'stock count',stock_counts:'stock count',chat_messages:'chat message',recipe_cards:'recipe card',order_lists:'order list',order_list_items:'order list item',daily_task_ticks:'task tick',daily_tasks:'daily task',attendance:'clock in or out',cash_ups:'cash-up',table_plans:'table plan',guest_profiles:'guest profile',floor_live:'table status',venues:'venue settings',time_requests:'clock correction request',staff_leave:'time off',scheduled_notifications:'reminder',suppliers:'supplier',supplier_orders:'supplier order',takeaway_orders:'takeaway order'}},978,[974]); -__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"APP_VERSION",{enumerable:!0,get:function(){return t}});const t='v0.3.12.192'},979,[]); +__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"APP_VERSION",{enumerable:!0,get:function(){return t}});const t='v0.3.12.193'},979,[]); __d(function(g,_r,i,a,_m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"TableRepository",{enumerable:!0,get:function(){return c}}),e.executeMutation=async function(t){const s=(t,s)=>{throw Object.assign(t,{status:s})};if('rpc'===t.kind){const{error:n,status:r}=await u().rpc(t.fn,t.values??{});return n&&s(n,r),'ok'}const n=u().from(t.table);if('upsert'===t.kind||'insert'===t.kind){const{error:r,status:o}=await n.upsert(t.values??{},{onConflict:t.conflictKey??'id',ignoreDuplicates:'insert'===t.kind});if(r&&'stock_events'===t.table&&'23503'===r.code&&/undoes/i.test(String(r.message??''))&&t.values?.undoes){t.values={...t.values,undoes:null};const r=await n.upsert(t.values,{onConflict:t.conflictKey??'id',ignoreDuplicates:'insert'===t.kind});return r.error&&s(r.error,r.status),'ok'}return r&&s(r,o),'ok'}let r='update'===t.kind?n.update(t.values??{}):n.delete();for(const[s,n]of Object.entries(t.match??{}))r=r.eq(s,n);const{data:o,error:c,status:l}=await r.select();c&&s(c,l);return'update'!==t.kind||o&&0!==o.length?'ok':'conflict'};var t=_r(d[0]),s=_r(d[1]),n=_r(d[2]),r=_r(d[3]),o=_r(d[4]);const u=()=>(0,n.getSupabase)();class c{constructor(t,s={}){this.table=t,this.opts=s,this.keyOf=s.keyOf??(t=>String(t.id)),this.keyColumns=s.keyColumns??['id'],this.venueCol=s.venueColumn??'venue_id'}rows(t){return s.cache.rows(this.table,t)}get(t,n){return s.cache.get(this.table,t,n)}subscribe(t,n){return s.cache.subscribe(this.table,t,n)}hydrate(t){return s.cache.hydrate(this.table,t)}async refresh(n,r={}){const c=()=>{let t=u().from(this.table).select('*').eq(this.venueCol,n);return this.opts.orderBy&&(t=t.order(this.opts.orderBy.column,{ascending:this.opts.orderBy.ascending??!0})),r.filter&&(t=r.filter(t)),t},l='bookings'===this.table?await(0,t.readPages)(async(t,s)=>{const{data:n,error:r}=await c().order('id').range(t,s);if(r)throw r;return n??[]}):await(async()=>{const{data:t,error:s}=await c().limit(this.opts.limit??1e3);if(s)throw s;return t??[]})();return s.cache.replace(this.table,n,l.map(t=>[this.keyOf(t),t]),t=>o.mutationQueue.hasPending(this.table,n,t)),l}async create(t,n){const u={...1===this.keyColumns.length&&'id'===this.keyColumns[0]?{id:(0,r.uuid)()}:{},...n,[this.venueCol]:t},c=this.keyOf(u);return s.cache.put(this.table,t,c,u),await o.mutationQueue.enqueue({table:this.table,venueId:t,kind:'insert'===this.opts.writeMode?'insert':'upsert',rowKey:c,values:u,conflictKey:this.opts.conflictKey??'id'}),u}async update(t,n,r,u={}){const c=s.cache.get(this.table,t,n),l={...this.matchFor(n,c),...u,[this.venueCol]:t};s.cache.patch(this.table,t,n,{...r,updated_at:(new Date).toISOString()}),await o.mutationQueue.enqueue({table:this.table,venueId:t,kind:'update',rowKey:n,values:r,match:l})}async remove(t,n){const r=s.cache.get(this.table,t,n),u={...this.matchFor(n,r),[this.venueCol]:t};s.cache.remove(this.table,t,n),await o.mutationQueue.enqueue({table:this.table,venueId:t,kind:'delete',rowKey:n,match:u})}matchFor(t,s){if(1===this.keyColumns.length&&'id'===this.keyColumns[0])return{id:t};const n={};for(const t of this.keyColumns)n[t]=s?.[t];return n}}},980,[981,982,892,936,977]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.readPages=async function(t,n=1e3){const s=[];for(let c=0;;c+=n){const o=await t(c,c+n-1);if(s.push(...o),o.length`cache:${t}:${n}`;function f(t){let s=n.get(t);return s||(s=new Map,n.set(t,s)),s}function p(n){s.delete(n),c.get(n)?.forEach(t=>t());const u=o.get(n);u&&clearTimeout(u),o.set(n,setTimeout(()=>{o.delete(n),t.kv.set(n,Array.from(f(n).entries()))},250))}const w={async hydrate(n,s){const c=l(n,s);if(u.has(c))return;u.add(c);const o=await t.kv.get(c,[]),w=f(c);let h=0;for(const[t,n]of o)w.has(t)||(w.set(t,n),h++);h&&p(c)},rows(t,n){const c=l(t,n);let o=s.get(c);return o||(o=Array.from(f(c).values()),s.set(c,o)),o},get:(t,n,s)=>f(l(t,n)).get(s),put(t,n,s,c){f(l(t,n)).set(s,c),p(l(t,n))},patch(t,n,s,c){const o=f(l(t,n)),u=o.get(s);u&&(o.set(s,{...u,...c}),p(l(t,n)))},remove(t,n,s){f(l(t,n)).delete(s)&&p(l(t,n))},replace(t,s,c,o=()=>!1){const u=l(t,s),w=f(u),h=new Map(c);w.forEach((t,n)=>{o(n)&&h.set(n,t)}),n.set(u,h),p(u)},subscribe(t,n,s){const o=l(t,n);let u=c.get(o);return u||(u=new Set,c.set(o,u)),u.add(s),()=>{u?.delete(s)}},async clearVenue(o,f){for(const p of f){const f=l(p,o);n.delete(f),s.delete(f),u.delete(f),await t.kv.remove(f),c.get(f)?.forEach(t=>t())}}}},982,[936]); @@ -1174,7 +1174,7 @@ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{v __d(function(g,_r,i,a,_m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.guardBookingChange=w,_e.saveTablesReported=async function(e,t,n,o,s,u){if(!w(u,{b:t,tables:n}))return!1;const v=n.length?(0,h.notSavedWhat)({...t,name:o,table:n.join('+')}):`Taking the table off ${o}`;u(`Saving ${v}\u2026`);try{await(0,b.saveBookingTables)(e,t,n)}catch(e){const t=`${v} did not save: ${String(e?.message??e).slice(0,120)}`;return u(t),(0,l.announce)(t),!1}const y=await(0,c.waitForBookingSave)(t.id);if('saved'===y.state||'local'===y.state){const e=(0,r.savedWords)(o,t.partySize,n,s);return u(e),(0,l.announce)(e),!0}const k='waiting'===y.state?`${v}: not saved yet. It saves by itself when the connection is back; a red banner shows if it fails.`:`${v} did not save. ${f("why"in y?y.why:"the shared system did not take it")}. Tap the red banner to try again.`;return u(k),(0,l.announce)(k),!1},_e.reportBookingSave=async function(e,t,n,o){const s=await(0,c.waitForBookingSave)(e);if('saved'===s.state||'local'===s.state)return o(t),(0,l.announce)(t),!0;const r='waiting'===s.state?`${n}: not saved yet. It saves by itself when the connection is back; a red banner shows if it fails.`:`${n} did not save. ${f('why'in s?s.why:'the shared system did not take it')}. Tap the red banner to try again.`;return o(r),(0,l.announce)(r),!1},_e.BookingSaveBanner=function({rid:e,testID:r="booking-save-banner",margin:c}){const b=(0,h.useBookingSaves)(e=>e.notSaved),w=(0,s.useBookings)(e).filter(e=>b[e.id]).map(e=>void 0!==b[e.id].want?{...e,table:b[e.id].want||void 0}:e),{msg:S,retry:$}=k(),m=(0,t.useRef)(''),p=w.map(e=>(0,h.notSavedLine)(e)),B=w.map(e=>e.id).sort().join(',');if((0,t.useEffect)(()=>{B&&B!==m.current&&(0,l.announce)(1===w.length?p[0]:`${w.length} booking changes did not save. Tap the red banner to try again.`),m.current=B},[B]),!w.length)return null;const j=1===w.length?p[0]:`${w.length} booking changes did not save. Tap to try again.`;return(0,y.jsx)(n.default,{testID:r,accessibilityRole:"button",accessibilityLiveRegion:"assertive",accessibilityLabel:`${j}${w.length>1?` ${w.map(e=>(0,h.notSavedWhat)(e)).join('. ')}.`:''} ${f(b[w[0].id].why)}.`,onPress:$,style:{...c??{},alignSelf:'stretch',gap:4,padding:12,borderRadius:12,borderWidth:2,borderColor:u.colours.red,backgroundColor:'#3a1210',alignItems:'center'},children:(0,y.jsxs)(o.default,{accessibilityRole:"alert",style:{alignItems:'center',gap:4},children:[(0,y.jsx)(v.T,{testID:`${r}-title`,size:17,weight:"semibold",center:!0,colour:"#FFD2CC",children:j}),w.length>1?w.slice(0,6).map(e=>(0,y.jsx)(v.T,{testID:`${r}-line`,size:15,center:!0,colour:"#FFD2CC",children:(0,h.notSavedWhat)(e)},e.id)):null,(0,y.jsx)(v.T,{testID:`${r}-why`,size:14,center:!0,colour:"#FFB3AA",children:w.length>1?`${f(b[w[0].id].why)}${w.length>6?` \xb7 and ${w.length-6} more`:''}`:f(b[w[0].id].why)}),S?(0,y.jsx)(v.T,{testID:`${r}-msg`,size:14,center:!0,colour:u.colours.goldLight,children:S}):null]})})},_e.BookingNotSavedLine=function({b:e}){const t=(0,h.useBookingSaves)(t=>t.notSaved[e.id]),{msg:o,retry:s}=k();if(!t)return null;void 0!==t.want&&(e={...e,table:t.want||void 0});return(0,y.jsxs)(n.default,{testID:`booking-not-saved-${e.id}`,accessibilityRole:"button",accessibilityLiveRegion:"assertive",accessibilityLabel:`${(0,h.notSavedLine)(e)} ${f(t.why)}.`,onPress:s,style:{alignSelf:'stretch',padding:8,borderRadius:10,borderWidth:1.5,borderColor:u.colours.red,backgroundColor:'#3a1210',alignItems:'center'},children:[(0,y.jsx)(v.T,{size:15,weight:"semibold",center:!0,colour:"#FFD2CC",children:(0,h.notSavedLine)(e)}),o?(0,y.jsx)(v.T,{size:13,center:!0,colour:u.colours.goldLight,children:o}):null]})};var t=_r(d[0]),n=e(_r(d[1])),o=e(_r(d[2])),s=_r(d[3]),r=_r(d[4]),l=_r(d[5]),c=_r(d[6]),h=_r(d[7]),u=_r(d[8]),b=_r(d[9]),v=_r(d[10]),y=_r(d[11]);const f=e=>e.charAt(0).toUpperCase()+e.slice(1);function w(e,t){const n=(0,c.bookingSaveBlocker)();if(!n)return!0;t&&h.useBookingSaves.getState().mark({id:t.b.id,table:t.b.walkIn?'walk_ins':'bookings',why:n,...t.tables?{want:t.tables.join('+')}:{}});const o=`${t?(0,h.notSavedWhat)({...t.b,...t.tables?{table:t.tables.join('+')||void 0}:{}}):'This change'} did not save: ${n}.`;return e?.(o),(0,l.announce)(o),!1}function k(){const[e,n]=(0,t.useState)('');return{msg:e,retry:async()=>{n('Saving\u2026'),(0,l.announce)('Saving');const e=await(0,c.saveBookingsNow)(!0),t=e?`Not saved: ${e}.`:h.useBookingSaves.getState().count()?'Sent again. The banner clears when the shared system takes it.':'Nothing is left waiting. Check the plan and make the change again if it is not there.';n(t),(0,l.announce)(t)}}}},1091,[17,385,85,858,1092,1093,946,984,804,1089,777,8]); __d(function(_g,r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"byNum",{enumerable:!0,get:function(){return s}}),e.tableKey=o,e.toggleTable=function(t,n){return t.includes(n)?t.filter(t=>t!==n):a(o([...t,n]))},e.seatsOf=function(t,n){const a={};for(const s of n)a[s]=t.tables.find(t=>t.name===s)?.maxSeats??0;return{per:a,total:Object.values(a).reduce((t,n)=>t+n,0)}},e.seatLine=function(t,n){const a=Math.max(0,n-t);return{text:`${t} ${1===t?'seat':'seats'} for ${l(n)}${a?`: ${a} short`:''}`,short:a,fits:0===a&&t>0}},e.pickClashes=u,e.requestedFreeTable=function(t,n,a,s,l=90){const o={id:n.id??'new',status:'confirmed',...n};for(const n of t)if(a.includes(n)&&!u(o,[n],s,l).length)return n;return null},e.overCapacityAsk=function(n,s,l){const u=a(o(n));if(!u.length||s>=l)return null;const c=u.map(n=>(0,t.tableNumbers)(n));return`${1===c.length?`Table ${c[0]} seats`:`Tables ${c.slice(0,-1).join(', ')} and ${c[c.length-1]} seat`} ${s} \u2013 this booking is ${l}. Use it anyway?`},e.clashWords=function(n){return n.map(n=>`${(0,t.tableNumbers)(n.table)} has ${n.with.walkIn?'a walk-in':(n.with.name||'a booking').replace(' (example)','')} at ${n.with.time}`).join('. ')+(n.length?'.':'')},e.tablesWords=c,e.pickA11y=function(n,a,s,l){return`Table ${(0,t.tableNumbers)(n)}, ${a} ${1===a?'seat':'seats'}${s?', selected':''}${l?`, has ${l.walkIn?'a walk-in':l.name} at ${l.time}`:''}`},e.pickGroups=function(t){return t.areas.map(n=>({area:n.name,tables:t.tables.filter(t=>t.areaId===n.id).map(t=>({name:t.name,seats:t.maxSeats})).sort((t,n)=>s(t.name,n.name))})).filter(t=>t.tables.length)},e.savedWords=function(t,n,a,s){return a.length?`${t}, ${l(n)}: ${c(a)} (${s} seats).`:`${t}: table taken off.`},e.tableActions=function(t,n){const s=a(t.table);if(['cancelled','noshow'].includes(t.status))return[];const o=[s.length?{id:'assign',label:'Change table',a11y:`Change table for ${n}, ${l(t.partySize)}, now ${c(s).toLowerCase()}. You can pick several tables to join.`}:{id:'assign',label:'Assign table',a11y:`Assign table for ${n}, ${l(t.partySize)}. You can pick several tables to join.`}];s.length&&o.push({id:'clear',label:'Clear table',a11y:`Clear table for ${n}, take ${c(s).toLowerCase()} off this booking`});return o},e.dragTables=function(t,n,s){if(!s||'__none'===s||s===n)return null;const l=a(t);if(l.includes(s))return null;return o('__none'!==n&&l.includes(n)?l.map(t=>t===n?s:t):[s])};var t=r(d[0]),n=r(d[1]);const a=t=>t?t.split('+').map(t=>t.trim()).filter(Boolean):[],s=(t,n)=>t.localeCompare(n,'en-GB',{numeric:!0}),l=t=>`${t} ${1===t?'person':'people'}`;function o(t){return[...new Set(t.map(t=>String(t).trim()).filter(Boolean))].sort(s).join('+')}function u(t,l,u,c=90){if(!l.length)return[];const f={...t,table:o(l)},b=[];for(const s of u)if(s.id!==t.id&&s.date===t.date&&!['cancelled','noshow','finished'].includes(s.status)&&(0,n.startOf)(f)<(0,n.endOf)(s,c)&&(0,n.startOf)(s)<(0,n.endOf)(f,c))for(const t of a(s.table))l.includes(t)&&b.push({table:t,with:s});return b.sort((t,n)=>s(t.table,n.table))}function c(n){const s=a(o(n));return s.length?(0,t.tableListNumbers)(s):'No table'}},1092,[843,1074]); __d(function(g,r,i,a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.primeAnnouncer=function(){u()},_e.announce=function(t){const e=String(t??'').trim();if(!e)return;{const t=u();if(!t)return;const n=++o;return t.textContent='',void setTimeout(()=>{n===o&&(t.textContent=e)},80)}},Object.defineProperty(_e,"lastAnnounced",{enumerable:!0,get:function(){return c}});var t,e=r(d[0]);(t=e)&&t.__esModule;r(d[1]);let n=null,o=0;function u(){if('undefined'==typeof document||!document.body)return null;if(n&&document.body.contains(n))return n;const t=document.createElement('div');return t.id='cc-announcer',t.setAttribute('aria-live','assertive'),t.setAttribute('aria-atomic','true'),t.setAttribute('role','status'),t.setAttribute('data-testid','cc-announcer'),Object.assign(t.style,{position:'absolute',width:'1px',height:'1px',margin:'-1px',padding:'0',overflow:'hidden',clip:'rect(0 0 0 0)',whiteSpace:'nowrap',border:'0'}),document.body.appendChild(t),n=t,t}const c=()=>n?.textContent??''},1093,[264,219]); -__d(function(g,_r,_i,_a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"TABLES",{enumerable:!0,get:function(){return A}}),_e.useTableNames=R,_e.resetTableLive=W,_e.seatBookingNow=async function(e,t){await k.repo.bookings.setStatus(t.id,'seated'),W(e,t.table)},_e.finishBookingNow=async function(e,t){const s=(new Date).toISOString();await k.repo.bookings.update(t.id,(0,N.finishClearPatch)(s,t.table)),(0,v.tablesOf)(t.table).forEach(t=>v.useFloor.getState().setLive(e,t,{stage:void 0,dirty:!0}))},_e.useTableUse=E,Object.defineProperty(_e,"walkInLabel",{enumerable:!0,get:function(){return _}}),_e.TablePicker=H,_e.WalkInSheet=q,_e.AssignTableSheet=V,_e.undoNotice=Y,_e.NewBookingSheet=G,_e.useFrontDoor=function(e,t){const[s,o]=(0,c.useState)(!1),[l,a]=(0,c.useState)(!1),[i,n]=(0,c.useState)(null);return{openWalkIn:()=>o({}),openWalkInAt:e=>o({table:e}),openBooking:()=>a(!0),assignTable:e=>n({b:e}),combineTables:e=>n({b:e,combine:!0}),elements:(0,F.jsxs)(F.Fragment,{children:[s?(0,F.jsx)(q,{wide:t,initialTable:s.table,onClose:()=>o(!1),onSeated:Y}):null,l?(0,F.jsx)(G,{wide:t,date:e,onClose:()=>a(!1),onSaved:e=>(0,u.notify)({id:`booked:${Date.now()}`,testID:'booking-saved-toast',timeoutMs:5e3,icon:'\u2713',title:`Booked: ${e.name} \xb7 ${(0,w.niceDate)((0,w.parseYmd)(e.date))} at ${e.time}`})}):null,i?(0,F.jsx)(V,{booking:i.b,combine:i.combine,onClose:()=>n(null)}):null]})}};var t=_r(_d[0]),s=_r(_d[1]),o=_r(_d[2]),l=_r(_d[3]),a=_r(_d[4]),i=_r(_d[5]),n=_r(_d[6]),r=_r(_d[7]),d=_r(_d[8]),u=_r(_d[9]),c=_r(_d[10]),b=e(c),h=_r(_d[11]),p=e(_r(_d[12])),m=e(_r(_d[13])),f=_r(_d[14]),y=_r(_d[15]),k=_r(_d[16]),x=_r(_d[17]),j=_r(_d[18]),w=_r(_d[19]),S=_r(_d[20]),T=_r(_d[21]),C=_r(_d[22]),v=_r(_d[23]),D=_r(_d[24]),I=_r(_d[25]),$=_r(_d[26]),P=_r(_d[27]),O=_r(_d[28]),B=_r(_d[29]),z=_r(_d[30]),M=_r(_d[31]),N=_r(_d[32]),F=_r(_d[33]);const L=e=>(0,u.notify)({id:'booking-blocked',testID:'booking-blocked-toast',timeoutMs:9e3,icon:'\u26a0',title:e}),A=Array.from({length:12},(e,t)=>String(t+1));function R(e){const t=(0,v.usePlan)(e);return t.areas.flatMap(e=>t.tables.filter(t=>t.areaId===e.id).map(e=>e.name))}function W(e,t){(0,v.tablesOf)(t).forEach(t=>v.useFloor.getState().setLive(e,t,{stage:'seated',dirty:!1}))}function E(e,t){const s=(0,k.useBookings)(e),o=(0,k.useOrders)(e),l=R(e),a=(0,v.useFloor)(t=>t.live[e])??{},i=(0,v.usePlan)(e),n=(0,D.useBlocks)(e=>e.blocks),r=(0,w.ymd)(t),d=(0,D.closedAreasAt)(n,e,r,(0,w.hm)(t)),u={};for(const e of l)u[e]=a[e]?.blocked||d.has(`tbl:${e}`)?{busy:!0,label:'Blocked'}:d.has(i.tables.find(t=>t.name===e)?.areaId??'')?{busy:!0,label:'Closed'}:a[e]?.dirty?{busy:!0,label:'Needs clearing'}:{busy:!1,label:'Free'};for(const e of s)if(e.date===r&&e.table)for(const s of(0,v.tablesOf)(e.table))if(u[s])if('seated'===e.status)u[s]={busy:!0,label:`${e.walkIn?'Walk-in':`${e.name.slice(0,1)}.`} \xb7 ${e.partySize}`};else if('confirmed'===e.status&&!u[s].busy){const o=(0,w.minsBetween)(t,new Date(`${e.date}T${e.time}:00`));o>=-15&&o<=90&&(u[s]={...u[s],soon:`Booked ${e.time}`})}for(const e of o)'table'===e.type&&e.tableNo&&u[e.tableNo]&&!['closed','cancelled','collected'].includes(e.status)&&!u[e.tableNo].busy&&(u[e.tableNo]={busy:!0,label:'Open order'});return u}const _=e=>e.walkIn?`Walk-in \xb7 ${e.partySize}`:`${e.name} \xb7 ${e.partySize}`;function H({use:e,value:t,onPick:s,big:o,best:a,dense:i,bestSet:n,picked:r}){const d=Object.keys(e),[u,b]=(0,c.useState)(0),h=i?6:8,f=i?64:o?92:76,y=u?Math.max(3,Math.floor((u+h)/(f+h))):0,k=y?Math.floor((u-h*(y-1))/y):f,x=new Set(n??[]),j=a?(0,v.tablesOf)(a)[0]:null;return(0,F.jsx)(m.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:h},testID:"table-picker",onLayout:e=>b(Math.floor(e.nativeEvent.layout.width)),children:d.map(o=>{const a=e[o],n=t===o||!!r?.includes(o),d=x.has(o),u=j===o&&!n,c=a.busy?['Blocked','Needs clearing','Closed'].includes(a.label)?a.label:'In use':a.soon??'Free';return(0,F.jsxs)(p.default,{accessibilityRole:"button",testID:`pick-table-${o}`,accessibilityLabel:`Table ${(0,l.tableNumbers)(o)}${r?n?', picked':', not picked':''}, ${a.busy?`in use (${a.label})`:a.soon?`free, ${a.soon}`:'free'}${d?', best table':''}${u?', suggested for this party':''}`,accessibilityState:{selected:n,disabled:'Closed'===a.label},disabled:'Closed'===a.label,onPress:()=>s(o),style:{width:k,minHeight:i?58:64,borderRadius:12,borderWidth:n||u?2.5:1.5,paddingVertical:i?3:6,paddingHorizontal:4,alignItems:'center',justifyContent:'center',gap:2,borderColor:n||u?S.colours.gold:a.busy?S.colours.red:S.colours.ok,backgroundColor:n?S.colours.goldTint:a.busy?S.colours.redBg:S.colours.surface2,opacity:'Closed'!==a.label||n?1:.55},children:[(0,F.jsxs)(m.default,{style:{flexDirection:'row',alignItems:'center',gap:4},children:[(0,F.jsx)(C.T,{weight:"bold",size:22,colour:n?S.colours.goldLight:S.colours.text,children:(0,l.tableNumbers)(o)}),d?(0,F.jsx)(m.default,{testID:"best-table",style:{backgroundColor:S.colours.gold,borderRadius:5,paddingHorizontal:4,paddingVertical:1},children:(0,F.jsx)(C.T,{size:11,weight:"bold",colour:S.colours.onGold,children:"BEST"})}):null]}),(0,F.jsx)(C.T,{size:i?13:14,colour:a.busy?'#FFD9D4':a.soon?'#FFE2A8':'#E2C489',center:!0,numberOfLines:1,children:c})]},o)})})}const U=[1,2,3,4,5,6,7,8];function q({onClose:e,onSeated:a,wide:i,initialTable:n}){const{rid:r,r:d,now:u}=(0,y.useCtx)(15e3),x=E(r,u),[T,I]=(0,c.useState)(2),[$,P]=(0,c.useState)(!1),[O,B]=(0,c.useState)(n??null),z=(0,v.usePlan)(r),N=(0,k.useBookings)(r),A=(0,D.useBlocks)(e=>e.blocks),R=(0,D.closedAreasAt)(A,r,(0,w.ymd)(u),(0,w.hm)(u)),_=b.default.useMemo(()=>{const e=Object.fromEntries(Object.entries(x).map(([e,t])=>[e,{status:t.busy?'seated':'free'}]));return(0,j.suggestTable)(z,N.filter(e=>e.date===(0,w.ymd)(u)),e,T,u,(0,j.turnFor)(T,d.settings.turnMins),90,void 0,{closed:R})?.table??null},[z,N,x,T,R.size,u.getTime()]);(0,c.useEffect)(()=>{O&&(0,v.tablesOf)(O).some(e=>'Closed'===x[e]?.label)&&B(null)},[O,R.size]);const[q,V]=(0,c.useState)(!1),[Y,G]=(0,c.useState)(''),K=(e,t=String(e),s=()=>{P(!1),I(e)})=>{const o='9+'===t?$:!$&&T===e;return(0,F.jsx)(p.default,{accessibilityRole:"button",accessibilityLabel:'9+'===t?'Party of 9 or more':`Party of ${e}`,accessibilityState:{selected:o},onPress:s,style:{width:i?58:60,height:i?58:56,borderRadius:14,borderWidth:2,borderColor:S.colours.gold,alignItems:'center',justifyContent:'center',backgroundColor:o?S.colours.gold:'transparent'},children:(0,F.jsx)(C.T,{weight:"bold",size:22,colour:o?S.colours.onGold:S.colours.gold,children:t})},t)},Q=(0,F.jsx)(s.PartySizeInput,{value:T,onChange:I,min:9,max:o.MAX_PARTY,label:"Walk-in party size",testID:"walkin-party-size"}),X=(0,F.jsxs)(m.default,{style:{gap:8,width:i?256:void 0},children:[(0,F.jsx)(C.T,{weight:"semibold",children:"How many people?"}),(0,F.jsxs)(m.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:8},testID:"walkin-party",children:[U.map(e=>K(e)),K(9,'9+',()=>{P(!0),I(e=>e>=9?e:9)})]}),$?Q:null]}),[J,Z]=(0,c.useState)(!1),ee=async(t=O)=>{if(!J&&(0,M.guardBookingChange)(L)){Z(!0);try{const s=await k.repo.bookings.seatWalkIn(r,T,t??void 0,Y);W(r,t??void 0),a(s),e()}finally{Z(!1)}}},te=(0,F.jsxs)(m.default,{style:{gap:8,flex:i?1:void 0,minWidth:0},children:[(0,F.jsxs)(C.Row,{style:{justifyContent:'space-between'},children:[(0,F.jsxs)(C.T,{weight:"semibold",children:["Table ",(0,F.jsx)(C.T,{colour:S.colours.muted,size:14,children:"(optional)"})]}),O?(0,F.jsx)(C.Button,{small:!0,kind:"ghost",label:"Clear table",onPress:()=>B(null)}):null]}),(0,F.jsx)(H,{use:x,value:O,onPick:e=>{x[e]&&!x[e].busy?ee(e):B(O===e?null:e)},big:i,dense:i,best:_,bestSet:(0,h.bestTables)(z)}),(0,F.jsxs)(C.Muted,{children:["Tap a free table to seat them there",_&&!O?` (suggested for ${T}: ${(0,l.tableNumbers)(_)})`:'',", or Seat for no table yet. BEST marks the venue\u2019s best tables."]})]});return(0,F.jsxs)(C.Sheet,{visible:!0,onClose:e,title:`Walk-in \xb7 ${(0,w.hm)(u)}`,maxWidth:i?1100:void 0,testID:"walkin-sheet",children:[(0,F.jsx)(C.Button,{label:`Seat walk-in \xb7 ${T} ${1===T?'person':'people'}${O?` \xb7 ${(0,l.tableNumbers)(O)}`:''}`,disabled:J,onPress:()=>{ee()},testID:"seat-walkin",style:{minHeight:52}}),i?(0,F.jsxs)(C.Row,{gap:16,style:{alignItems:'flex-start'},children:[X,te]}):(0,F.jsxs)(F.Fragment,{children:[X,te]}),(0,F.jsxs)(C.Row,{gap:10,wrap:!0,style:{alignItems:'center'},children:[q?(0,F.jsx)(t.TextInput,{accessibilityLabel:"Walk-in note",placeholder:"Note (optional), e.g. high chair",placeholderTextColor:"#7D776C",value:Y,onChangeText:G,style:[C.styles.input,{flex:1,minWidth:220}],autoFocus:!0}):(0,F.jsx)(C.Button,{small:!0,kind:"ghost",label:"Add a note (optional)",onPress:()=>V(!0)}),(0,F.jsx)(m.default,{style:{flex:1,minWidth:220},children:(0,F.jsxs)(C.Muted,{children:["No name needed. Counts in today's covers.",'staff'!==f.APP_VARIANT?' Using website bookings too? Mark the table there as well.':'']})})]})]})}function V({booking:e,onClose:t,combine:s}){const{rid:o,r:a,now:i}=(0,y.useCtx)(15e3),n=E(o,i),r=(0,v.usePlan)(o),d=(0,k.useBookings)(o),u=(0,v.tablesOf)(e.table),p=b.default.useMemo(()=>Object.fromEntries(Object.entries(n).map(([e,t])=>[e,u.includes(e)?{busy:!1,label:'This party',soon:'This party'}:t])),[n,e.table]),f=b.default.useMemo(()=>{const t=Object.fromEntries(Object.entries(p).map(([e,t])=>[e,{status:t.busy?'seated':'free'}]));return(0,j.suggestTable)(r,d.filter(e=>e.date===(0,w.ymd)(i)),t,e.partySize,i,(0,j.turnFor)(e.partySize,a.settings.turnMins),90,e.id)?.table??null},[r,d,p,e.partySize,i.getTime()]),[x,T]=(0,c.useState)(!!s||u.length>1),[D,I]=(0,c.useState)(u),$=e=>r.tables.find(t=>t.name===e)?.maxSeats??0,P=D.reduce((e,t)=>e+$(t),0),O=D.length>0&&P{if(!(0,M.guardBookingChange)(L))return;const l=(0,v.joinTables)(s);await k.repo.bookings.assignTable(e.id,l);u.filter(e=>!s.includes(e)).forEach(t=>v.useFloor.getState().setLive(o,t,{stage:void 0,dirty:'seated'===e.status})),'seated'===e.status&&W(o,l),t()},z=x?(0,F.jsxs)(m.default,{style:{gap:8},testID:"assign-table-tip",children:[(0,F.jsx)(m.default,{accessibilityLiveRegion:"polite",children:(0,F.jsx)(C.T,{size:17,weight:"semibold",colour:S.colours.text,children:D.length?`${(0,v.tablesLabel)((0,v.joinTables)(D))} \xb7 ${P} seats for ${e.partySize} Covers`:'No tables picked yet'})}),O?(0,F.jsx)(m.default,{testID:"combine-short",children:(0,F.jsxs)(C.T,{size:15,weight:"semibold",colour:"#FFD9D4",children:["Not enough seats yet: ",e.partySize-P," more needed. Add another table."]})}):null,(0,F.jsx)(C.T,{size:15,colour:S.colours.text,children:"Tap each table to add or remove it, then tap Done. All of them show as taken until the party has finished."}),(0,F.jsxs)(C.Row,{gap:8,wrap:!0,children:[(0,F.jsx)(C.Button,{label:"Done",testID:"combine-done",disabled:!D.length,accessibilityLabel:D.length?`Done, save ${(0,v.tableCardLabel)((0,v.joinTables)(D))}`:'Done',onPress:()=>B(D)}),(0,F.jsx)(C.Button,{kind:"ghost",label:"Cancel",onPress:t})]})]}):(0,F.jsx)(m.default,{style:{gap:8},testID:"assign-table-tip",children:(0,F.jsx)(C.T,{size:15,colour:S.colours.text,children:"Red tables are in use right now; you can still pick one (e.g. joining a table). BEST marks the venue\u2019s best tables. Big party? Tap Combine tables."})});return(0,F.jsxs)(C.Sheet,{visible:!0,onClose:t,title:`${x?'Combine tables':'Assign table'} \xb7 ${_(e)}`,testID:"assign-table-sheet",footer:z,children:[f&&!x?(0,F.jsx)(m.default,{testID:"assign-suggested",children:(0,F.jsxs)(C.T,{size:16,weight:"semibold",colour:S.colours.goldLight,accessibilityLabel:`Suggested for ${e.partySize}: ${(0,v.tableCardLabel)(f)}`,children:["Suggested for ",e.partySize,": ",(0,l.tableNumbers)(f)]})}):null,x?null:(0,F.jsx)(C.Button,{kind:"secondary",label:"Combine tables",testID:"combine-start",accessibilityLabel:"Combine tables: pick several tables for this party",onPress:()=>T(!0)}),(0,F.jsx)(H,{use:p,best:x?null:f,bestSet:(0,h.bestTables)(r),picked:x?D:void 0,onPick:x?e=>I(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]):async e=>{await B([e])}})]})}function Y(e){(0,u.notify)({id:`walkin:${e.id}`,testID:'walkin-toast',timeoutMs:6e3,title:`${_(e)} seated \xb7 ${e.table?`${(0,l.tableNumbers)(e.table)}`:'table to assign'} (${e.ref})`,actions:[{label:'Undo',testID:'undo-walkin',onPress:()=>k.repo.bookings.undoWalkIn(e.id)},{label:'OK',kind:'ghost'}]})}function G({date:e,onClose:t,wide:s,onSaved:u}){const{rid:b,r:h,now:p,role:f,meId:N}=(0,y.useCtx)(6e4);(0,d.useBlurOutside)();const A=(0,w.ymd)(p),[R,W]=(0,c.useState)(ee.blocks),[H,U]=(0,c.useState)(!1),[q,V]=(0,c.useState)(''),[Y,G]=(0,c.useState)(2),[K,Q]=(0,c.useState)(0),X=Math.min(K,Math.max(0,Y-1)),[J,Z]=(0,c.useState)(null),[ee,te]=(0,c.useState)(''),[se,oe]=(0,c.useState)(''),[le,ae]=(0,c.useState)(''),[ie,ne]=(0,c.useState)('phone'),[re,de]=(0,c.useState)((0,$.emptyNeeds)()),ue=(0,$.needsMissing)(re),[ce,be]=(0,c.useState)(null),ge=(0,v.usePlan)(b),he=(0,B.dogSetUp)(ge),pe=!0===re.dog&&he,me=re.dog?re.dogs:0,fe=(0,w.parseYmd)(R),ye=(0,j.turnFor)(Y,h.settings.turnMins),ke=E.filter(e=>e.date===R),xe=e=>(0,j.freeTablesAt)(ge,ke,Y,new Date(`${R}${(0,l.tableNumbers)(e)}:00`),ye,h.settings.turnMins,{dog:!0,closed:(0,D.closedAreasAt)(_,b,R,e)}),je=pe&&J?xe(J):[];(0,c.useEffect)(()=>{be(null)},[pe,J,Y]);const we=(0,x.bookingSlots)(h,fe,e=>E.filter(t=>t.date===R&&t.time===e&&'cancelled'!==t.status&&!t.walkIn).reduce((e,t)=>e+t.partySize,0),Y,R===(0,w.ymd)(p)?p:(0,w.addMins)(fe,0),e=>E.filter(t=>t.date===R&&t.time===e&&'cancelled'!==t.status&&!t.walkIn).length),Se=(0,T.guestPhone)(se),[Te,Ce]=(0,c.useState)(!1),ve=J?we.find(e=>e.time===J):void 0,De=ve&&ve.left=2&&!!J&&(!$e||Te)&&(0,o.validParty)(Y)&&Se.ok&&(0,T.emailOk)(le)&&(!Pe||Oe&&H)&&(!pe||je.length>0)&&!Be,Me=re.wheelchair>0||re.stepFree;return(0,F.jsxs)(C.Sheet,{visible:!0,onClose:t,title:`New booking \xb7 ${(0,w.niceDate)(fe)}`,maxWidth:s?760:void 0,testID:"booking-sheet",children:[(0,F.jsx)($.FirstQuestions,{rid:b,value:re,onChange:de,party:Y,audience:"staff"}),re.dog&&!he?(0,F.jsx)(C.T,{size:13,colour:S.colours.amber,children:"Dog-friendly tables aren\u2019t marked yet. Managers \u203a Booking options \u203a Tables. Booking is allowed; check where the dog can sit."}):null,(0,F.jsx)(I.BookingDatePicker,{r:h,today:p,value:R,onChange:e=>{e!==R&&(W(e),Z(null),U(!1))}}),(0,F.jsxs)(C.Row,{gap:6,children:[(0,F.jsx)(C.Chip,{label:"Phone",selected:'phone'===ie,onPress:()=>ne('phone')}),(0,F.jsx)(C.Chip,{label:"In person",selected:'in-person'===ie,onPress:()=>ne('in-person')})]}),(0,F.jsx)(C.Field,{label:"Name",value:q,onChangeText:V,placeholder:"e.g. Reid",testID:"nb-name"}),(0,F.jsx)(C.Field,{label:"Mobile or phone number (needed)",value:se,onChangeText:oe,keyboardType:"phone-pad",placeholder:"e.g. 07700 900123",testID:"nb-phone"}),!Se.ok&&se?(0,F.jsx)(C.T,{size:13,colour:S.colours.amber,children:Se.error}):null,(0,F.jsx)(C.Field,{label:"Email (optional)",value:le,onChangeText:ae,keyboardType:"email-address",autoCapitalize:"none",placeholder:"For an email confirmation too",testID:"nb-email"}),(0,T.emailOk)(le)?null:(0,F.jsx)(C.T,{size:13,colour:S.colours.amber,children:"That email doesn\u2019t look quite right."}),(0,F.jsx)(n.AdultsChildren,{value:(0,r.peopleOf)(Y,X),onChange:e=>{G(e.partySize),Q(e.children),Ce(!1)},depositsOn:(0,i.depositOf)(h.settings).on&&(0,i.depositOf)(h.settings).perPersonPence>0,testID:"nb-people"}),(0,F.jsx)(C.Row,{wrap:!0,gap:6,children:we.map(e=>{const t=pe&&e.available&&!xe(e.time).length||!(0,$.dogTimeOk)(h,E,R,e.time,me);return(0,F.jsx)(C.Chip,{testID:`nb-slot-${e.time}`,label:e.time,sub:(0,D.blockAt)(_,b,R,e.time)?'Paused':t?'Dogs full':e.drinksOnly?'Drinks only':null!=e.partiesLeft&&e.partiesLeft<1||e.left<=0?'Full':`${e.left} left`,disabled:(e.past??!e.available)||t,selected:J===e.time,onPress:()=>{Z(e.time),U(!1),Ce(!1)}},e.time)})}),$e?(0,F.jsxs)(m.default,{testID:"nb-over-capacity",accessible:!0,accessibilityLiveRegion:"polite",style:{borderWidth:1.5,borderColor:S.colours.amber,backgroundColor:S.colours.amberBg,borderRadius:12,padding:10,gap:6},children:[De?(0,F.jsx)(C.T,{weight:"semibold",colour:S.colours.amber,children:(0,o.overCapacityNote)(Y,De.left,De.time)}):null,Ie?(0,F.jsx)(C.T,{weight:"semibold",colour:S.colours.amber,children:(0,o.overPartiesNote)(Ie.time,Ie.cap)}):null,(0,F.jsx)(C.Chip,{label:Te?'Booking over the limit: on':'Book anyway (over the limit)',selected:Te,onPress:()=>Ce(e=>!e),testID:"nb-over-ok"})]}):null,pe&&J?(0,F.jsxs)(m.default,{style:{gap:6},testID:"nb-dog-tables",children:[(0,F.jsxs)(C.T,{size:14,weight:"semibold",children:["Dog-friendly table ",(0,F.jsxs)(C.T,{size:13,colour:S.colours.muted,children:["(",ge.areas.filter(e=>e.dogs).map(e=>e.name).join(' or '),")"]})]}),je.length?(0,F.jsx)(C.Row,{wrap:!0,gap:6,children:je.slice(0,10).map((e,t)=>(0,F.jsx)(C.Chip,{label:`${(0,l.tableNumbers)(e.table)}`,sub:`${e.area} \xb7 ${e.seats}${0===t?' \xb7 best':''}${Me&&(0,B.accessibleSetUp)(ge)&&!(0,B.isAccessible)(ge,e.table)?' \xb7 not step-free':''}`,selected:(ce??je[0].table)===e.table,onPress:()=>be(e.table)},e.table))}):(0,F.jsxs)(C.T,{size:14,colour:S.colours.amber,children:["No dog-friendly table free for ",Y," at ",J,". Try another time."]})]}):null,Pe?(0,F.jsxs)(m.default,{testID:"nb-block-warning",style:{borderWidth:1.5,borderColor:S.colours.amber,backgroundColor:S.colours.amberBg,borderRadius:12,padding:10,gap:6},children:[(0,F.jsxs)(C.T,{weight:"semibold",colour:S.colours.amber,children:["Bookings are paused ",Pe.from,"\u2013",Pe.to,Pe.reason?` (${Pe.reason})`:'']}),Oe?(0,F.jsx)(C.Chip,{label:H?'Manager override on':'Override and book anyway',selected:H,onPress:()=>U(e=>!e)}):(0,F.jsx)(C.Muted,{children:"Ask a manager to override, or pick another time."})]}):null,we.length?null:(0,F.jsx)(m.default,{testID:"nb-closed",children:(0,F.jsxs)(C.T,{size:14,weight:"semibold",colour:S.colours.amber,children:["Closed on ",(0,w.niceDate)(fe)," (per the venue\u2019s opening hours). Pick another date."]})}),(0,F.jsx)($.MoreQuestions,{rid:b,r:h,value:re,onChange:de,party:Y,date:R,time:J,today:(0,w.ymd)(p),bookings:E,audience:"staff",showTables:!1!==h.settings.tableRequests}),Me&&!(0,B.accessibleSetUp)(ge)?(0,F.jsx)(C.T,{size:13,colour:S.colours.amber,children:"Step-free tables aren\u2019t marked yet (Managers \u203a Booking options \u203a Tables). Check the table works for a wheelchair."}):null,(0,F.jsx)(C.Field,{label:"Notes (optional)",value:ee,onChangeText:te,placeholder:P.NOTES_PLACEHOLDER,multiline:!0,numberOfLines:3,testID:"nb-notes"}),(0,i.depositDue)((0,i.depositOf)(h.settings),Y,X)?(0,F.jsxs)(C.Muted,{testID:"nb-deposit",children:["Deposit due: ",(0,a.gbp)((0,i.depositDue)((0,i.depositOf)(h.settings),Y,X))," (",(0,a.gbp)((0,i.depositOf)(h.settings).perPersonPence)," per adult for ",(0,i.depositOf)(h.settings).fromParty,"+",X?`; ${X} ${1===X?'child':'children'} free`:'; children free',"). Deposits are paid through website bookings or to you, never in CoverCharge: tick Deposit paid on the booking once the guest has paid."]}):null,(0,F.jsxs)(C.Muted,{children:["The guest gets a confirmation text",le.trim()?' and email':''," automatically (preview mode: shown in the Outbox, not sent)."]}),Be?(0,F.jsxs)(C.T,{size:14,colour:S.colours.amber,children:["We already have the most dogs we can look after at ",J,". Try another time: dogs are very welcome then."]}):null,(0,F.jsx)(C.Button,{label:ue.length?ue[0]:'Save booking',testID:"nb-save",disabled:!ze,onPress:()=>{if(R<(0,w.ymd)(p))return;if(!(0,M.guardBookingChange)(L))return;const e=(0,$.needsPatch)(re),s=re.tableReq.find(e=>!pe||je.some(t=>t.table===e)),o=pe?null:(0,z.requestedFreeTable)(re.tableReq,{date:R,time:J,partySize:Y},ge.tables.map(e=>e.name),ke,h.settings.turnMins);k.repo.bookings.create({restaurantId:b,customerId:null,name:q.trim(),partySize:Y,date:R,time:J,notes:ee.trim(),security:(0,i.depositDue)((0,i.depositOf)(h.settings),Y,X)?'deposit':'none',depositPaid:0,...X?{children:X}:{},...(0,i.depositDue)((0,i.depositOf)(h.settings),Y,X)?{depositDue:(0,i.depositDue)((0,i.depositOf)(h.settings),Y,X),depositPolicy:(0,i.depositWords)((0,i.depositOf)(h.settings),Y,h.name,X).join(' '),depositRefundable:(0,i.depositOf)(h.settings).refundable,depositCutoffHours:(0,i.depositOf)(h.settings).cutoffHours}:{},phone:Se.pretty,email:le.trim()||void 0,source:ie,...e,...we.find(e=>e.time===J)?.drinksOnly?{drinksOnly:!0}:{},allergies:e.allergies??[],...pe?{table:ce??s??je[0]?.table}:o?{table:o}:{}}).then(e=>(0,O.postNewBookingToKitchen)(e,N)).catch(()=>{}),u?.({date:R,time:J,name:q.trim()}),t()}})]})}},1094,[812,1095,1096,843,851,841,1097,1098,1099,1100,17,842,385,85,856,1055,858,1101,1074,863,804,848,777,996,993,1102,1103,1108,1076,1053,1092,1091,1109,8]); +__d(function(g,_r,_i,_a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"TABLES",{enumerable:!0,get:function(){return A}}),_e.useTableNames=R,_e.resetTableLive=W,_e.seatBookingNow=async function(e,t){await k.repo.bookings.setStatus(t.id,'seated'),W(e,t.table)},_e.finishBookingNow=async function(e,t){const s=(new Date).toISOString();await k.repo.bookings.update(t.id,(0,N.finishClearPatch)(s,t.table)),(0,v.tablesOf)(t.table).forEach(t=>v.useFloor.getState().setLive(e,t,{stage:void 0,dirty:!0}))},_e.useTableUse=E,Object.defineProperty(_e,"walkInLabel",{enumerable:!0,get:function(){return _}}),_e.TablePicker=H,_e.WalkInSheet=q,_e.AssignTableSheet=V,_e.undoNotice=Y,_e.NewBookingSheet=G,_e.useFrontDoor=function(e,t){const[s,o]=(0,c.useState)(!1),[l,a]=(0,c.useState)(!1),[i,n]=(0,c.useState)(null);return{openWalkIn:()=>o({}),openWalkInAt:e=>o({table:e}),openBooking:()=>a(!0),assignTable:e=>n({b:e}),combineTables:e=>n({b:e,combine:!0}),elements:(0,F.jsxs)(F.Fragment,{children:[s?(0,F.jsx)(q,{wide:t,initialTable:s.table,onClose:()=>o(!1),onSeated:Y}):null,l?(0,F.jsx)(G,{wide:t,date:e,onClose:()=>a(!1),onSaved:e=>(0,u.notify)({id:`booked:${Date.now()}`,testID:'booking-saved-toast',timeoutMs:5e3,icon:'\u2713',title:`Booked: ${e.name} \xb7 ${(0,w.niceDate)((0,w.parseYmd)(e.date))} at ${e.time}`})}):null,i?(0,F.jsx)(V,{booking:i.b,combine:i.combine,onClose:()=>n(null)}):null]})}};var t=_r(_d[0]),s=_r(_d[1]),o=_r(_d[2]),l=_r(_d[3]),a=_r(_d[4]),i=_r(_d[5]),n=_r(_d[6]),r=_r(_d[7]),d=_r(_d[8]),u=_r(_d[9]),c=_r(_d[10]),b=e(c),h=_r(_d[11]),p=e(_r(_d[12])),m=e(_r(_d[13])),f=_r(_d[14]),y=_r(_d[15]),k=_r(_d[16]),x=_r(_d[17]),j=_r(_d[18]),w=_r(_d[19]),S=_r(_d[20]),T=_r(_d[21]),C=_r(_d[22]),v=_r(_d[23]),D=_r(_d[24]),I=_r(_d[25]),$=_r(_d[26]),P=_r(_d[27]),O=_r(_d[28]),B=_r(_d[29]),z=_r(_d[30]),M=_r(_d[31]),N=_r(_d[32]),F=_r(_d[33]);const L=e=>(0,u.notify)({id:'booking-blocked',testID:'booking-blocked-toast',timeoutMs:9e3,icon:'\u26a0',title:e}),A=Array.from({length:12},(e,t)=>String(t+1));function R(e){const t=(0,v.usePlan)(e);return t.areas.flatMap(e=>t.tables.filter(t=>t.areaId===e.id).map(e=>e.name))}function W(e,t){(0,v.tablesOf)(t).forEach(t=>v.useFloor.getState().setLive(e,t,{stage:'seated',dirty:!1}))}function E(e,t){const s=(0,k.useBookings)(e),o=(0,k.useOrders)(e),l=R(e),a=(0,v.useFloor)(t=>t.live[e])??{},i=(0,v.usePlan)(e),n=(0,D.useBlocks)(e=>e.blocks),r=(0,w.ymd)(t),d=(0,D.closedAreasAt)(n,e,r,(0,w.hm)(t)),u={};for(const e of l)u[e]=a[e]?.blocked||d.has(`tbl:${e}`)?{busy:!0,label:'Blocked'}:d.has(i.tables.find(t=>t.name===e)?.areaId??'')?{busy:!0,label:'Closed'}:a[e]?.dirty?{busy:!0,label:'Needs clearing'}:{busy:!1,label:'Free'};for(const e of s)if(e.date===r&&e.table)for(const s of(0,v.tablesOf)(e.table))if(u[s])if('seated'===e.status)u[s]={busy:!0,label:`${e.walkIn?'Walk-in':`${e.name.slice(0,1)}.`} \xb7 ${e.partySize}`};else if('confirmed'===e.status&&!u[s].busy){const o=(0,w.minsBetween)(t,new Date(`${e.date}T${e.time}:00`));o>=-15&&o<=90&&(u[s]={...u[s],soon:`Booked ${e.time}`})}for(const e of o)'table'===e.type&&e.tableNo&&u[e.tableNo]&&!['closed','cancelled','collected'].includes(e.status)&&!u[e.tableNo].busy&&(u[e.tableNo]={busy:!0,label:'Open order'});return u}const _=e=>e.walkIn?`Walk-in \xb7 ${e.partySize}`:`${e.name} \xb7 ${e.partySize}`;function H({use:e,value:t,onPick:s,big:o,best:a,dense:i,bestSet:n,picked:r}){const d=Object.keys(e),[u,b]=(0,c.useState)(0),h=i?6:8,f=i?64:o?92:76,y=u?Math.max(3,Math.floor((u+h)/(f+h))):0,k=y?Math.floor((u-h*(y-1))/y):f,x=new Set(n??[]),j=a?(0,v.tablesOf)(a)[0]:null;return(0,F.jsx)(m.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:h},testID:"table-picker",onLayout:e=>b(Math.floor(e.nativeEvent.layout.width)),children:d.map(o=>{const a=e[o],n=t===o||!!r?.includes(o),d=x.has(o),u=j===o&&!n,c=a.busy?['Blocked','Needs clearing','Closed'].includes(a.label)?a.label:'In use':a.soon??'Free';return(0,F.jsxs)(p.default,{accessibilityRole:"button",testID:`pick-table-${o}`,accessibilityLabel:`Table ${(0,l.tableNumbers)(o)}${r?n?', picked':', not picked':''}, ${a.busy?`in use (${a.label})`:a.soon?`free, ${a.soon}`:'free'}${d?', best table':''}${u?', suggested for this party':''}`,accessibilityState:{selected:n,disabled:'Closed'===a.label},disabled:'Closed'===a.label,onPress:()=>s(o),style:{width:k,minHeight:i?58:64,borderRadius:12,borderWidth:n||u?2.5:1.5,paddingVertical:i?3:6,paddingHorizontal:4,alignItems:'center',justifyContent:'center',gap:2,borderColor:n||u?S.colours.gold:a.busy?S.colours.red:S.colours.ok,backgroundColor:n?S.colours.goldTint:a.busy?S.colours.redBg:S.colours.surface2,opacity:'Closed'!==a.label||n?1:.55},children:[(0,F.jsxs)(m.default,{style:{flexDirection:'row',alignItems:'center',gap:4},children:[(0,F.jsx)(C.T,{weight:"bold",size:22,colour:n?S.colours.goldLight:S.colours.text,children:(0,l.tableNumbers)(o)}),d?(0,F.jsx)(m.default,{testID:"best-table",style:{backgroundColor:S.colours.gold,borderRadius:5,paddingHorizontal:4,paddingVertical:1},children:(0,F.jsx)(C.T,{size:11,weight:"bold",colour:S.colours.onGold,children:"BEST"})}):null]}),(0,F.jsx)(C.T,{size:i?13:14,colour:a.busy?'#FFD9D4':a.soon?'#FFE2A8':'#E2C489',center:!0,numberOfLines:1,children:c})]},o)})})}const U=[1,2,3,4,5,6,7,8];function q({onClose:e,onSeated:a,wide:i,initialTable:n}){const{rid:r,r:d,now:u}=(0,y.useCtx)(15e3),x=E(r,u),[T,I]=(0,c.useState)(2),[$,P]=(0,c.useState)(!1),[O,B]=(0,c.useState)(n??null),z=(0,v.usePlan)(r),N=(0,k.useBookings)(r),A=(0,D.useBlocks)(e=>e.blocks),R=(0,D.closedAreasAt)(A,r,(0,w.ymd)(u),(0,w.hm)(u)),_=b.default.useMemo(()=>{const e=Object.fromEntries(Object.entries(x).map(([e,t])=>[e,{status:t.busy?'seated':'free'}]));return(0,j.suggestTable)(z,N.filter(e=>e.date===(0,w.ymd)(u)),e,T,u,(0,j.turnFor)(T,d.settings.turnMins),90,void 0,{closed:R})?.table??null},[z,N,x,T,R.size,u.getTime()]);(0,c.useEffect)(()=>{O&&(0,v.tablesOf)(O).some(e=>'Closed'===x[e]?.label)&&B(null)},[O,R.size]);const[q,V]=(0,c.useState)(!1),[Y,G]=(0,c.useState)(''),K=(e,t=String(e),s=()=>{P(!1),I(e)})=>{const o='9+'===t?$:!$&&T===e;return(0,F.jsx)(p.default,{accessibilityRole:"button",accessibilityLabel:'9+'===t?'Party of 9 or more':`Party of ${e}`,accessibilityState:{selected:o},onPress:s,style:{width:i?58:60,height:i?58:56,borderRadius:14,borderWidth:2,borderColor:S.colours.gold,alignItems:'center',justifyContent:'center',backgroundColor:o?S.colours.gold:'transparent'},children:(0,F.jsx)(C.T,{weight:"bold",size:22,colour:o?S.colours.onGold:S.colours.gold,children:t})},t)},Q=(0,F.jsx)(s.PartySizeInput,{value:T,onChange:I,min:9,max:o.MAX_PARTY,label:"Walk-in party size",testID:"walkin-party-size"}),X=(0,F.jsxs)(m.default,{style:{gap:8,width:i?256:void 0},children:[(0,F.jsx)(C.T,{weight:"semibold",children:"How many people?"}),(0,F.jsxs)(m.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:8},testID:"walkin-party",children:[U.map(e=>K(e)),K(9,'9+',()=>{P(!0),I(e=>e>=9?e:9)})]}),$?Q:null]}),[J,Z]=(0,c.useState)(!1),ee=async(t=O)=>{if(!J&&(0,M.guardBookingChange)(L)){Z(!0);try{const s=await k.repo.bookings.seatWalkIn(r,T,t??void 0,Y);W(r,t??void 0),a(s),e()}finally{Z(!1)}}},te=(0,F.jsxs)(m.default,{style:{gap:8,flex:i?1:void 0,minWidth:0},children:[(0,F.jsxs)(C.Row,{style:{justifyContent:'space-between'},children:[(0,F.jsxs)(C.T,{weight:"semibold",children:["Table ",(0,F.jsx)(C.T,{colour:S.colours.muted,size:14,children:"(optional)"})]}),O?(0,F.jsx)(C.Button,{small:!0,kind:"ghost",label:"Clear table",onPress:()=>B(null)}):null]}),(0,F.jsx)(H,{use:x,value:O,onPick:e=>{x[e]&&!x[e].busy?ee(e):B(O===e?null:e)},big:i,dense:i,best:_,bestSet:(0,h.bestTables)(z)}),(0,F.jsxs)(C.Muted,{children:["Tap a free table to seat them there",_&&!O?` (suggested for ${T}: ${(0,l.tableNumbers)(_)})`:'',", or Seat for no table yet. BEST marks the venue\u2019s best tables."]})]});return(0,F.jsxs)(C.Sheet,{visible:!0,onClose:e,title:`Walk-in \xb7 ${(0,w.hm)(u)}`,maxWidth:i?1100:void 0,testID:"walkin-sheet",children:[(0,F.jsx)(C.Button,{label:`Seat walk-in \xb7 ${T} ${1===T?'person':'people'}${O?` \xb7 ${(0,l.tableNumbers)(O)}`:''}`,disabled:J,onPress:()=>{ee()},testID:"seat-walkin",style:{minHeight:52}}),i?(0,F.jsxs)(C.Row,{gap:16,style:{alignItems:'flex-start'},children:[X,te]}):(0,F.jsxs)(F.Fragment,{children:[X,te]}),(0,F.jsxs)(C.Row,{gap:10,wrap:!0,style:{alignItems:'center'},children:[q?(0,F.jsx)(t.TextInput,{accessibilityLabel:"Walk-in note",placeholder:"Note (optional), e.g. high chair",placeholderTextColor:"#7D776C",value:Y,onChangeText:G,style:[C.styles.input,{flex:1,minWidth:220}],autoFocus:!0}):(0,F.jsx)(C.Button,{small:!0,kind:"ghost",label:"Add a note (optional)",onPress:()=>V(!0)}),(0,F.jsx)(m.default,{style:{flex:1,minWidth:220},children:(0,F.jsxs)(C.Muted,{children:["No name needed. Counts in today's covers.",'staff'!==f.APP_VARIANT?' Using website bookings too? Mark the table there as well.':'']})})]})]})}function V({booking:e,onClose:t,combine:s}){const{rid:o,r:a,now:i}=(0,y.useCtx)(15e3),n=E(o,i),r=(0,v.usePlan)(o),d=(0,k.useBookings)(o),u=(0,v.tablesOf)(e.table),p=b.default.useMemo(()=>Object.fromEntries(Object.entries(n).map(([e,t])=>[e,u.includes(e)?{busy:!1,label:'This party',soon:'This party'}:t])),[n,e.table]),f=b.default.useMemo(()=>{const t=Object.fromEntries(Object.entries(p).map(([e,t])=>[e,{status:t.busy?'seated':'free'}]));return(0,j.suggestTable)(r,d.filter(e=>e.date===(0,w.ymd)(i)),t,e.partySize,i,(0,j.turnFor)(e.partySize,a.settings.turnMins),90,e.id)?.table??null},[r,d,p,e.partySize,i.getTime()]),[x,T]=(0,c.useState)(!!s||u.length>1),[D,I]=(0,c.useState)(u),$=e=>r.tables.find(t=>t.name===e)?.maxSeats??0,P=D.reduce((e,t)=>e+$(t),0),O=D.length>0&&P{if(!(0,M.guardBookingChange)(L))return;const l=(0,v.joinTables)(s);await k.repo.bookings.assignTable(e.id,l);u.filter(e=>!s.includes(e)).forEach(t=>v.useFloor.getState().setLive(o,t,{stage:void 0,dirty:'seated'===e.status})),'seated'===e.status&&W(o,l),t()},z=x?(0,F.jsxs)(m.default,{style:{gap:8},testID:"assign-table-tip",children:[(0,F.jsx)(m.default,{accessibilityLiveRegion:"polite",children:(0,F.jsx)(C.T,{size:17,weight:"semibold",colour:S.colours.text,children:D.length?`${(0,v.tablesLabel)((0,v.joinTables)(D))} \xb7 ${P} seats for ${e.partySize} Covers`:'No tables picked yet'})}),O?(0,F.jsx)(m.default,{testID:"combine-short",children:(0,F.jsxs)(C.T,{size:15,weight:"semibold",colour:"#FFD9D4",children:["Not enough seats yet: ",e.partySize-P," more needed. Add another table."]})}):null,(0,F.jsx)(C.T,{size:15,colour:S.colours.text,children:"Tap each table to add or remove it, then tap Done. All of them show as taken until the party has finished."}),(0,F.jsxs)(C.Row,{gap:8,wrap:!0,children:[(0,F.jsx)(C.Button,{label:"Done",testID:"combine-done",disabled:!D.length,accessibilityLabel:D.length?`Done, save ${(0,v.tableCardLabel)((0,v.joinTables)(D))}`:'Done',onPress:()=>B(D)}),(0,F.jsx)(C.Button,{kind:"ghost",label:"Cancel",onPress:t})]})]}):(0,F.jsx)(m.default,{style:{gap:8},testID:"assign-table-tip",children:(0,F.jsx)(C.T,{size:15,colour:S.colours.text,children:"Red tables are in use right now; you can still pick one (e.g. joining a table). BEST marks the venue\u2019s best tables. Big party? Tap Combine tables."})});return(0,F.jsxs)(C.Sheet,{visible:!0,onClose:t,title:`${x?'Combine tables':'Assign table'} \xb7 ${_(e)}`,testID:"assign-table-sheet",footer:z,children:[f&&!x?(0,F.jsx)(m.default,{testID:"assign-suggested",children:(0,F.jsxs)(C.T,{size:16,weight:"semibold",colour:S.colours.goldLight,accessibilityLabel:`Suggested for ${e.partySize}: ${(0,v.tableCardLabel)(f)}`,children:["Suggested for ",e.partySize,": ",(0,l.tableNumbers)(f)]})}):null,x?null:(0,F.jsx)(C.Button,{kind:"secondary",label:"Combine tables",testID:"combine-start",accessibilityLabel:"Combine tables: pick several tables for this party",onPress:()=>T(!0)}),(0,F.jsx)(H,{use:p,best:x?null:f,bestSet:(0,h.bestTables)(r),picked:x?D:void 0,onPick:x?e=>I(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]):async e=>{await B([e])}})]})}function Y(e){(0,u.notify)({id:`walkin:${e.id}`,testID:'walkin-toast',timeoutMs:6e3,title:`${_(e)} seated \xb7 ${e.table?`${(0,l.tableNumbers)(e.table)}`:'table to assign'} (${e.ref})`,actions:[{label:'Undo',testID:'undo-walkin',onPress:()=>k.repo.bookings.undoWalkIn(e.id)},{label:'OK',kind:'ghost'}]})}function G({date:e,onClose:t,wide:s,onSaved:u}){const{rid:b,r:h,now:p,role:f,meId:N}=(0,y.useCtx)(6e4);(0,d.useBlurOutside)();const A=(0,w.ymd)(p),[R,W]=(0,c.useState)(ee.blocks),[H,U]=(0,c.useState)(!1),[q,V]=(0,c.useState)(''),[Y,G]=(0,c.useState)(2),[K,Q]=(0,c.useState)(0),X=Math.min(K,Math.max(0,Y-1)),[J,Z]=(0,c.useState)(null),[ee,te]=(0,c.useState)(''),[se,oe]=(0,c.useState)(''),[le,ae]=(0,c.useState)(''),[ie,ne]=(0,c.useState)('phone'),[re,de]=(0,c.useState)((0,$.emptyNeeds)()),ue=(0,$.needsMissing)(re),[ce,be]=(0,c.useState)(null),ge=(0,v.usePlan)(b),he=(0,B.dogSetUp)(ge),pe=!0===re.dog&&he,me=re.dog?re.dogs:0,fe=(0,w.parseYmd)(R),ye=(0,j.turnFor)(Y,h.settings.turnMins),ke=E.filter(e=>e.date===R),xe=e=>(0,j.freeTablesAt)(ge,ke,Y,new Date(`${R}${(0,l.tableNumbers)(e)}:00`),ye,h.settings.turnMins,{dog:!0,closed:(0,D.closedAreasAt)(_,b,R,e)}),je=pe&&J?xe(J):[];(0,c.useEffect)(()=>{be(null)},[pe,J,Y]);const we=(0,x.bookingSlots)(h,fe,e=>E.filter(t=>t.date===R&&t.time===e&&'cancelled'!==t.status&&!t.walkIn).reduce((e,t)=>e+t.partySize,0),Y,R===(0,w.ymd)(p)?p:(0,w.addMins)(fe,0),e=>E.filter(t=>t.date===R&&t.time===e&&'cancelled'!==t.status&&!t.walkIn).length),Se=(0,T.guestPhone)(se),[Te,Ce]=(0,c.useState)(!1),ve=J?we.find(e=>e.time===J):void 0,De=ve&&ve.left=2&&!!J&&(!$e||Te)&&(0,o.validParty)(Y)&&Se.ok&&(0,T.emailOk)(le)&&(!Pe||Oe&&H)&&(!pe||je.length>0)&&!Be,Me=re.wheelchair>0||re.stepFree;return(0,F.jsxs)(C.Sheet,{visible:!0,onClose:t,title:`New booking \xb7 ${(0,w.niceDate)(fe)}`,maxWidth:s?760:void 0,testID:"booking-sheet",children:[(0,F.jsx)($.FirstQuestions,{rid:b,value:re,onChange:de,party:Y,audience:"staff"}),re.dog&&!he?(0,F.jsx)(C.T,{size:13,colour:S.colours.amber,children:"Dog-friendly tables aren\u2019t marked yet. Managers \u203a Booking options \u203a Tables. Booking is allowed; check where the dog can sit."}):null,(0,F.jsx)(I.BookingDatePicker,{r:h,today:p,value:R,onChange:e=>{e!==R&&(W(e),Z(null),U(!1))}}),(0,F.jsxs)(C.Row,{gap:6,children:[(0,F.jsx)(C.Chip,{label:"Phone",selected:'phone'===ie,onPress:()=>ne('phone')}),(0,F.jsx)(C.Chip,{label:"In person",selected:'in-person'===ie,onPress:()=>ne('in-person')})]}),(0,F.jsx)(C.Field,{label:"Name",value:q,onChangeText:V,placeholder:"e.g. Reid",testID:"nb-name"}),(0,F.jsx)(C.Field,{label:"Mobile or phone number (needed)",value:se,onChangeText:oe,keyboardType:"phone-pad",placeholder:"e.g. 07700 900123",testID:"nb-phone"}),!Se.ok&&se?(0,F.jsx)(C.T,{size:13,colour:S.colours.amber,children:Se.error}):null,(0,F.jsx)(C.Field,{label:"Email (optional)",value:le,onChangeText:ae,keyboardType:"email-address",autoCapitalize:"none",placeholder:"For an email confirmation too",testID:"nb-email"}),(0,T.emailOk)(le)?null:(0,F.jsx)(C.T,{size:13,colour:S.colours.amber,children:"That email doesn\u2019t look quite right."}),(0,F.jsx)(n.AdultsChildren,{value:(0,r.peopleOf)(Y,X),onChange:e=>{G(e.partySize),Q(e.children),Ce(!1)},depositsOn:(0,i.depositOf)(h.settings).on&&(0,i.depositOf)(h.settings).perPersonPence>0,testID:"nb-people"}),(0,F.jsx)(C.Row,{wrap:!0,gap:6,children:we.map(e=>{const t=pe&&e.available&&!xe(e.time).length||!(0,$.dogTimeOk)(h,E,R,e.time,me);return(0,F.jsx)(C.Chip,{testID:`nb-slot-${e.time}`,label:e.time,sub:(0,D.blockAt)(_,b,R,e.time)?'Paused':t?'Dogs full':e.drinksOnly?'Drinks only':null!=e.partiesLeft&&e.partiesLeft<1||e.left<=0?'Full':`${e.left} left`,disabled:(e.past??!e.available)||t,selected:J===e.time,onPress:()=>{Z(e.time),U(!1),Ce(!1)}},e.time)})}),$e?(0,F.jsxs)(m.default,{testID:"nb-over-capacity",accessible:!0,accessibilityLiveRegion:"polite",style:{borderWidth:1.5,borderColor:S.colours.amber,backgroundColor:S.colours.amberBg,borderRadius:12,padding:10,gap:6},children:[De?(0,F.jsx)(C.T,{weight:"semibold",colour:S.colours.amber,children:(0,o.overCapacityNote)(Y,De.left,De.time)}):null,Ie?(0,F.jsx)(C.T,{weight:"semibold",colour:S.colours.amber,children:(0,o.overPartiesNote)(Ie.time,Ie.cap)}):null,(0,F.jsx)(C.Chip,{label:Te?'Booking over the limit: on':'Book anyway (over the limit)',selected:Te,onPress:()=>Ce(e=>!e),testID:"nb-over-ok"})]}):null,pe&&J?(0,F.jsxs)(m.default,{style:{gap:6},testID:"nb-dog-tables",children:[(0,F.jsxs)(C.T,{size:14,weight:"semibold",children:["Dog-friendly table ",(0,F.jsxs)(C.T,{size:13,colour:S.colours.muted,children:["(",ge.areas.filter(e=>e.dogs).map(e=>e.name).join(' or '),")"]})]}),je.length?(0,F.jsx)(C.Row,{wrap:!0,gap:6,children:je.slice(0,10).map((e,t)=>(0,F.jsx)(C.Chip,{label:`${(0,l.tableNumbers)(e.table)}`,sub:`${e.area} \xb7 ${e.seats}${0===t?' \xb7 best':''}${Me&&(0,B.accessibleSetUp)(ge)&&!(0,B.isAccessible)(ge,e.table)?' \xb7 not step-free':''}`,selected:(ce??je[0].table)===e.table,onPress:()=>be(e.table)},e.table))}):(0,F.jsxs)(C.T,{size:14,colour:S.colours.amber,children:["No dog-friendly table free for ",Y," at ",J,". Try another time."]})]}):null,Pe?(0,F.jsxs)(m.default,{testID:"nb-block-warning",style:{borderWidth:1.5,borderColor:S.colours.amber,backgroundColor:S.colours.amberBg,borderRadius:12,padding:10,gap:6},children:[(0,F.jsxs)(C.T,{weight:"semibold",colour:S.colours.amber,children:["Bookings are paused ",Pe.from,"\u2013",Pe.to,Pe.reason?` (${Pe.reason})`:'']}),Oe?(0,F.jsx)(C.Chip,{label:H?'Manager override on':'Override and book anyway',selected:H,onPress:()=>U(e=>!e)}):(0,F.jsx)(C.Muted,{children:"Ask a manager to override, or pick another time."})]}):null,we.length?null:(0,F.jsx)(m.default,{testID:"nb-closed",children:(0,F.jsxs)(C.T,{size:14,weight:"semibold",colour:S.colours.amber,children:["Closed on ",(0,w.niceDate)(fe)," (per the venue\u2019s opening hours). Pick another date."]})}),(0,F.jsx)($.MoreQuestions,{rid:b,r:h,value:re,onChange:de,party:Y,date:R,time:J,today:(0,w.ymd)(p),bookings:E,audience:"staff",showTables:!1!==h.settings.tableRequests}),Me&&!(0,B.accessibleSetUp)(ge)?(0,F.jsx)(C.T,{size:13,colour:S.colours.amber,children:"Step-free tables aren\u2019t marked yet (Managers \u203a Booking options \u203a Tables). Check the table works for a wheelchair."}):null,(0,F.jsx)(C.Field,{label:"Notes (optional)",value:ee,onChangeText:te,placeholder:P.NOTES_PLACEHOLDER,multiline:!0,numberOfLines:3,testID:"nb-notes"}),(0,i.depositDue)((0,i.depositOf)(h.settings),Y,X)?(0,F.jsxs)(C.Muted,{testID:"nb-deposit",children:["Deposit due: ",(0,a.gbp)((0,i.depositDue)((0,i.depositOf)(h.settings),Y,X))," (",(0,a.gbp)((0,i.depositOf)(h.settings).perPersonPence)," per adult for tables of ",(0,i.depositOf)(h.settings).fromParty,"+ adults",X?`; ${X} ${1===X?'child':'children'} free`:'; children free, and they do not count towards the number that needs a deposit',"). Staff can waive it. Deposits are paid through website bookings or to you, never in CoverCharge: tick Deposit paid on the booking once the guest has paid."]}):null,(0,F.jsxs)(C.Muted,{children:["The guest gets a confirmation text",le.trim()?' and email':''," automatically (preview mode: shown in the Outbox, not sent)."]}),Be?(0,F.jsxs)(C.T,{size:14,colour:S.colours.amber,children:["We already have the most dogs we can look after at ",J,". Try another time: dogs are very welcome then."]}):null,(0,F.jsx)(C.Button,{label:ue.length?ue[0]:'Save booking',testID:"nb-save",disabled:!ze,onPress:()=>{if(R<(0,w.ymd)(p))return;if(!(0,M.guardBookingChange)(L))return;const e=(0,$.needsPatch)(re),s=re.tableReq.find(e=>!pe||je.some(t=>t.table===e)),o=pe?null:(0,z.requestedFreeTable)(re.tableReq,{date:R,time:J,partySize:Y},ge.tables.map(e=>e.name),ke,h.settings.turnMins);k.repo.bookings.create({restaurantId:b,customerId:null,name:q.trim(),partySize:Y,date:R,time:J,notes:ee.trim(),security:(0,i.depositDue)((0,i.depositOf)(h.settings),Y,X)?'deposit':'none',depositPaid:0,...X?{children:X}:{},...(0,i.depositDue)((0,i.depositOf)(h.settings),Y,X)?{depositDue:(0,i.depositDue)((0,i.depositOf)(h.settings),Y,X),depositPolicy:(0,i.depositWords)((0,i.depositOf)(h.settings),Y,h.name,X).join(' '),depositRefundable:(0,i.depositOf)(h.settings).refundable,depositCutoffHours:(0,i.depositOf)(h.settings).cutoffHours}:{},phone:Se.pretty,email:le.trim()||void 0,source:ie,...e,...we.find(e=>e.time===J)?.drinksOnly?{drinksOnly:!0}:{},allergies:e.allergies??[],...pe?{table:ce??s??je[0]?.table}:o?{table:o}:{}}).then(e=>(0,O.postNewBookingToKitchen)(e,N)).catch(()=>{}),u?.({date:R,time:J,name:q.trim()}),t()}})]})}},1094,[812,1095,1096,843,851,841,1097,1098,1099,1100,17,842,385,85,856,1055,858,1101,1074,863,804,848,777,996,993,1102,1103,1108,1076,1053,1092,1091,1109,8]); __d(function(g,r,i,a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.PartySizeInput=function({value:e,onChange:p,min:b=s.MIN_PARTY,max:y=s.MAX_PARTY,label:f="Party size",testID:h="party-size"}){const[x,S]=(0,t.useState)(String(e));(0,t.useEffect)(()=>{S(String(e))},[e]);const T=e=>p((0,s.clampParty)(e,b,y)),$=(t,n,l)=>{const s=t<0?e<=b:e>=y;return(0,d.jsx)(o.default,{testID:`${h}-${t>0?'up':'down'}${10===Math.abs(t)?'10':''}`,accessibilityRole:"button",accessibilityLabel:l,accessibilityState:{disabled:s},disabled:s,onPress:()=>T(e+t),hitSlop:4,style:{minWidth:44,height:44,paddingHorizontal:8,borderRadius:22,borderWidth:1.5,borderColor:u.colours.gold,alignItems:'center',justifyContent:'center',opacity:s?.4:1},children:(0,d.jsx)(c.T,{size:10===Math.abs(t)?14:20,weight:"semibold",colour:u.colours.gold,center:!0,children:n})},t)};return(0,d.jsxs)(l.default,{testID:h,style:{flexDirection:'row',alignItems:'center',gap:6,flexWrap:'wrap',justifyContent:'center'},children:[y-b>=20?$(-10,'\u221210',"10 fewer people"):null,$(-1,'\u2212','One fewer person'),(0,d.jsx)(n.default,{testID:`${h}-input`,value:x,keyboardType:"number-pad",inputMode:"numeric",maxLength:3,selectTextOnFocus:!0,accessibilityLabel:`${f}, ${b} to ${y} people`,accessibilityValue:{min:b,max:y,now:e,text:`${e} ${1===e?'person':'people'}`},onChangeText:e=>{S(e.replace(/\D/g,'')),e.replace(/\D/g,'')&&T((0,s.partyFromText)(e,b,y))},onBlur:()=>{const e=(0,s.partyFromText)(x,b,y);S(String(e)),T(e)},returnKeyType:"done",blurOnSubmit:!0,onSubmitEditing:e=>{e?.target?.blur?.()},style:{width:64,height:44,borderRadius:10,borderWidth:1,borderColor:u.colours.border,color:u.colours.text,backgroundColor:u.colours.surface,textAlign:'center',fontSize:20,fontFamily:u.fonts.semibold}}),$(1,'+','One more person'),y-b>=20?$(10,'+10',"10 more people"):null]})};var t=r(_d[0]),o=e(r(_d[1])),n=e(r(_d[2])),l=e(r(_d[3])),s=r(_d[4]),u=r(_d[5]),c=r(_d[6]),d=r(_d[7])},1095,[17,385,395,85,1096,804,777,8]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"MAX_PARTY",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"MIN_PARTY",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"PARTY_RULE",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"validParty",{enumerable:!0,get:function(){return u}}),Object.defineProperty(e,"partyFromText",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"clampParty",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"overCapacityNote",{enumerable:!0,get:function(){return f}}),Object.defineProperty(e,"overPartiesNote",{enumerable:!0,get:function(){return b}});const t=100,n=1,o=`Bookings are for ${n} to ${t} people.`,u=o=>'number'==typeof o&&Number.isInteger(o)&&o>=n&&o<=t,c=(o,u=n,c=t)=>{const s=parseInt(String(o??'').replace(/\D/g,'').slice(0,4),10);return Math.max(u,Math.min(c,Number.isFinite(s)?s:u))},s=(o,u=n,c=t)=>Math.max(u,Math.min(c,Math.round(Number(o)||u))),f=(t,n,o)=>n<=0?`${o} is already full for booked Covers. Booking ${t} more goes over the venue\u2019s limit: check tables and staffing.`:`${t} is more than the ${n} Covers left at ${o}. Booking goes over the venue\u2019s limit by ${t-n}: check tables and staffing.`,b=(t,n)=>`${t} already has the most bookings we take at one start time (${n}). Booking another goes over the venue\u2019s limit: check tables and staffing.`},1096,[]); __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.AdultsChildren=function({value:e,onChange:t,depositsOn:h,testID:x="people"}){const p=e=>t((0,s.storedPeople)(e)),b=(0,s.totalLine)(e);return(0,o.jsxs)(l.default,{testID:x,style:{gap:8,alignItems:'center',width:'100%'},children:[(0,o.jsx)(u.T,{size:18,center:!0,weight:"semibold",children:"Adults"}),(0,o.jsx)(n.PartySizeInput,{value:e.adults,min:1,max:(0,s.maxAdults)(e.children),onChange:t=>p({adults:t,children:e.children}),label:"Adults",testID:`${x}-adults`}),(0,o.jsx)(u.T,{size:18,center:!0,weight:"semibold",children:"Children"}),(0,o.jsx)(n.PartySizeInput,{value:e.children,min:0,max:(0,s.maxKids)(e.adults),onChange:t=>p({adults:e.adults,children:t}),label:"Children",testID:`${x}-children`}),(0,o.jsx)(u.T,{size:18,center:!0,weight:"semibold",colour:c.colours.goldLight,testID:`${x}-total`,accessibilityLabel:b,children:b}),h?(0,o.jsx)(u.Muted,{center:!0,children:"Children never pay a deposit."}):null]})},r(d[0]);var e,t=r(d[1]),l=(e=t)&&e.__esModule?e:{default:e},s=r(d[2]),n=r(d[3]),u=r(d[4]),c=r(d[5]),o=r(d[6])},1097,[17,85,1098,1095,777,804,8]); @@ -1308,9 +1308,9 @@ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{v __d(function(g,_r,i,_a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"useChefAssistant",{enumerable:!0,get:function(){return I}}),Object.defineProperty(_e,"CHEF_PROMPTS",{enumerable:!0,get:function(){return P}}),_e.ChefAssistantButton=function({compact:e}){return e?(0,S.jsx)(u.default,{testID:"chef-assistant-open",accessibilityRole:"button",accessibilityLabel:"Assistant",onPress:()=>I.getState().setOpen(!0),style:{borderRadius:12,backgroundColor:w.colours.accentBg,borderWidth:1,borderColor:w.colours.accentBorder,paddingVertical:6,paddingHorizontal:12,minHeight:36,justifyContent:'center'},children:(0,S.jsx)(m.T,{weight:"semibold",colour:w.colours.goldLight,size:13,children:"\u2726 Assistant"})}):(0,S.jsx)(d.ActionTile,{primary:!0,testID:"chef-assistant-open",icon:"sparkle",label:"Assistant",sub:"Recipe card, order, allergens, GP, temps",accessibilityLabel:"Assistant",onPress:()=>I.getState().setOpen(!0)})},_e.ChefAssistantSheet=function({go:e}){const l=I(e=>e.open),d=()=>I.getState().setOpen(!1),{rid:f,me:W,menu:L,k:B,c:F}=(0,$.useChef)(3e4),G=(0,T.useSuggestions)(),E=(0,r.useSafetyView)('chef').points,[M,H]=(0,o.useState)([]),[N,_]=(0,o.useState)(''),[V,K]=(0,o.useState)(!1),[Y,q]=(0,o.useState)(!1),Q=(0,o.useRef)(null),U=(0,o.useRef)(null);if((0,o.useEffect)(()=>{setTimeout(()=>Q.current?.scrollToEnd?.({animated:!0}),50)},[M.length]),!l)return null;const J=(e,t=!1)=>H(n=>[...n,{id:R(),from:'bot',text:e,demo:t}]),X=e=>H(t=>[...t,{id:R(),from:'bot',plan:e,state:'open'}]),Z=L.filter(e=>!e.name.includes('(example)')||!0),ee=(t,n)=>{const r=A(t);if(!(0,s.chefCanSee)(f,t))return void J('That check is managed in the Managers app.');if(/\b(send|email|text|pay|delete|remove|order now|place the order)\b/.test(r)&&!/\b(build|draft|make|prepare)\b/.test(r))return void J('I can\u2019t send, pay for or delete anything. I can prepare it for you to check and do yourself, for example \u201cbuild the fish order\u201d.');const o=(0,y.parseQuick)(t,E).filter(e=>e.point&&(0,y.isTempKind)(e.point.kind));if(o.length&&(/\b(fridge|freezer|walk ?in|core|probe|cool|hot|deliver|degree|temp)/.test(r)||o.some(e=>null!=e.value))){const t=o.filter(e=>null!=e.value),r=o.filter(e=>null==e.value);if(r.length&&J(`I didn\u2019t hear a temperature for ${r.map(e=>e.point.name).join(', ')}. Say or type the reading, for example \u201c${r[0].point.name} 4 degrees\u201d. I never fill one in.`),!t.length)return;const s=t.filter(e=>!(0,y.inRange)(e.point,e.value));return void X({title:`Log ${1===t.length?'a reading':`${t.length} readings`} in the food safety log`,detail:t.map(e=>`${e.point.name}: ${e.value}\xb0C (${(0,y.limitText)(e.point)})${(0,y.inRange)(e.point,e.value)?'':' \xb7 OUT OF RANGE'}`).join('\n')+`\nSigned ${(0,y.initialsOf)(W)} \xb7 ${n?'voice':'typed'}`,warn:s.length?`${s.map(e=>e.point.name).join(', ')} out of range: you\u2019ll need to add the corrective action in the food safety log.`:void 0,confirm:'Log it',run:()=>{const r=(new Date).toISOString();return v.useSafety.getState().addEntries(t.map(e=>({pointId:e.point.id,name:e.point.name,kind:e.point.kind,at:r,by:W.replace(' (example)',''),byId:$.CHEF_ID,app:'chef',value:e.value,ok:(0,y.inRange)(e.point,e.value),source:n?'voice':'typed',initials:(0,y.initialsOf)(W)}))),s.length&&setTimeout(()=>e('haccp'),600),`Logged ${t.map(e=>`${e.point.name} ${e.value}\xb0C`).join(', ')}.${s.length?' Opening the food safety log for the corrective action.':''}`}})}if(/\b(fridge|freezer|temp|temperature|degrees)\b/.test(r))return void J('Which unit, and what does it read? For example \u201cprep fridge 4 degrees\u201d or \u201cfreezer minus 19\u201d. I only log the number you give me.');if(/allergen|allerg|contain|gluten|nut|dairy|milk|shellfish|crustacean|coeliac/.test(r)){const e=D(t,Z,e=>e.name);if(!e)return void J('Which dish? For example \u201callergens in the fish and chips\u201d.');const n=(0,j.recipeCards)().byMenuItem(e.id),r=e=>b.ALLERGENS.find(t=>t.id===e)?.label??e,s=Object.entries(e.allergens??{}).filter(([,e])=>'contains'===e).map(([e])=>r(e)),a=Object.entries(e.allergens??{}).filter(([,e])=>'may'===e).map(([e])=>r(e));return void J(`${e.name}: ${s.length?`contains ${s.join(', ')}`:'no allergens recorded as \u201ccontains\u201d'}${a.length?`; may contain ${a.join(', ')}`:''}. ${n?n.signOff?`From the signed-off recipe card (${n.signOff.by}).`:'The recipe card is awaiting your sign-off, so check it before telling a guest.':'There\u2019s no recipe card for it yet.'} Always check the card and the ingredients with the guest.`)}if(/\bgp\b|gross profit|margin|price for|what price|cost of|costing/.test(r)){const e=D(t,F,e=>e.item.name),n=Number((t.toLowerCase().match(/(\d{2})\s*(?:%|percent|per cent)/)??[])[1])||B.targetGp;if(!e)return void J(`Which dish? I can cost the dishes that have a recipe in GP & costing (${F.length} do). For example \u201cGP on the haddock\u201d.`);const r=(0,C.priceForTarget)(e.cost,n);return void J(`${e.item.name}: food cost ${(0,x.gbp)(e.cost)}, sells at ${(0,x.gbp)(e.priceInc)} (inc VAT) = ${e.gp.toFixed(1)}% GP. For ${n}% GP it would need ${(0,x.gbp)(r)} inc VAT. Prices are changed by a manager; I haven\u2019t changed anything.`)}if(/\border|supplier|delivery|par\b|restock/.test(r)){const n=D(t,G,e=>`${e.s.name} ${e.s.category??''}`)??(1===G.length?G[0]:void 0);return n?void X({title:`Build an order for ${n.s.name}`,detail:(n.lines.length?n.lines.map(e=>`${e.i.name}: ${(0,a.fishQtyText)(f,e.i,e.qty)}`).join('\n')+`\nAbout ${(0,x.gbp)(n.total)} at the latest prices.`:'Nothing is below par for this supplier yet.')+'\nI\u2019ll open it in Ordering for you to check, change and place yourself. Nothing is sent.',confirm:'Open the order',run:()=>(setTimeout(()=>{d(),e('orders',n.s.id)},400),`Opening the ${n.s.name} order. You check it and place it yourself.`)}):void J(G.length?`Which supplier? ${G.map(e=>e.s.name).join(', ')}.`:'Nothing is below par and no supplier orders today.')}if(/recipe|card|new dish|write up|spec/.test(r)){const n=t.replace(/^.*?(?:recipe card|card|recipe|dish|spec)\s*(?:for|of)?\s*/i,'').replace(/[.?!]+$/,'').trim();if(!n||n.length<3)return void J('What\u2019s the dish called? For example \u201cdraft a recipe card for crab linguine\u201d.');const r=n.replace(/^the\s+/i,'').replace(/^./,e=>e.toUpperCase()).slice(0,60),s=(0,j.recipeCards)().list(f).find(e=>A(e.dish)===A(r));return s?(J(`There\u2019s already a card for ${s.dish}. Opening Recipe cards.`),void setTimeout(()=>{d(),e('recipes')},600)):void X({title:`Draft a recipe card: ${r}`,detail:'A new card, awaiting your sign-off, with the dish name and section filled in. You add the ingredients, method, allergens, photo and price, then sign it off. It isn\u2019t shown to guests until you do.',confirm:'Make the draft',run:async()=>(await(0,j.recipeCards)().create(f,{dish:r,section:'Specials',price:null,ingredients:[],steps:[]},{name:W,role:'head-chef'}),setTimeout(()=>{d(),e('recipes')},500),`Draft card for ${r} saved, awaiting sign-off. Opening Recipe cards.`)})}const l='I can help with: drafting a recipe card, building a supplier order, a dish\u2019s allergens, GP pricing, and logging a temperature you read out. Try one of the suggestions.';(0,k.askServer)('chef',t,[]).then(e=>J('text'===e.kind?e.text:l)).catch(()=>J(l))},te=(e,t=!1)=>{const n=e.trim();if(n){_(''),H(e=>[...e,{id:R(),from:'you',text:n}]);try{ee(n,t)}catch(e){J(`Sorry, that didn\u2019t work: ${e.message}`)}}},ne=async e=>{if(e.plan){H(t=>t.map(t=>t.id===e.id?{...t,state:'done'}:t));try{J(String(await e.plan.run()))}catch(e){J(`Couldn\u2019t do that: ${e.message}`)}}},ie=e=>{H(t=>t.map(t=>t.id===e.id?{...t,state:'cancelled'}:t)),J('Cancelled. Nothing was changed.')},re=()=>{te(N,Y),q(!1)};return(0,S.jsx)(c.default,{visible:!0,transparent:!0,animationType:"fade",onRequestClose:d,children:(0,S.jsx)(p.default,{style:[m.styles.overlay,{justifyContent:'flex-end',padding:0}],children:(0,S.jsxs)(p.default,{testID:"chef-assistant",style:{backgroundColor:w.colours.surface,borderTopLeftRadius:18,borderTopRightRadius:18,borderWidth:1,borderColor:w.colours.border,width:'100%',maxWidth:640,alignSelf:'center',maxHeight:'92%',minHeight:'70%',padding:14,gap:10},children:[(0,S.jsxs)(m.Row,{style:{justifyContent:'space-between'},children:[(0,S.jsx)(m.T,{size:20,weight:"semibold",children:"\u2726 Kitchen Assistant"}),(0,S.jsx)(n.GoldClose,{testID:"chef-assistant-close",onPress:d,style:{marginRight:-6}})]}),(0,S.jsx)(p.default,{testID:"chef-assistant-demo",children:(0,S.jsx)(m.Badge,{kind:"amber",label:O})}),(0,S.jsxs)(h.default,{ref:Q,style:{flex:1},contentContainerStyle:{gap:10,paddingBottom:6},keyboardShouldPersistTaps:"handled",children:[0===M.length?(0,S.jsxs)(p.default,{style:{gap:8},children:[(0,S.jsxs)(m.T,{children:["Hi ",W.split(' ')[0],". Type or tap \ud83c\udfa4 and say what you need. I\u2019ll show you what I\u2019m about to do and wait for you to confirm. I never send, pay or delete."]}),P.map(e=>(0,S.jsx)(u.default,{accessibilityRole:"button",onPress:()=>te(e),style:{borderWidth:1,borderColor:w.colours.border,borderRadius:12,paddingVertical:9,paddingHorizontal:12,backgroundColor:w.colours.surface2},children:(0,S.jsx)(m.T,{size:14,children:e})},e))]}):null,M.map(e=>'you'===e.from?(0,S.jsx)(p.default,{style:{alignSelf:'flex-end',maxWidth:'85%',backgroundColor:'#3A2F12',borderRadius:14,padding:10},children:(0,S.jsx)(m.T,{children:e.text})},e.id):e.plan?(0,S.jsxs)(p.default,{testID:"chef-confirm-card",style:{borderWidth:1.5,borderColor:'open'===e.state?w.colours.gold:w.colours.border,borderRadius:14,padding:12,gap:8,backgroundColor:w.colours.surface2},children:[(0,S.jsx)(m.T,{weight:"semibold",children:e.plan.title}),(0,S.jsx)(m.T,{size:14,colour:w.colours.muted,children:e.plan.detail}),e.plan.warn?(0,S.jsxs)(m.T,{size:13,colour:w.colours.amber,children:["\u26a0 ",e.plan.warn]}):null,'open'===e.state?(0,S.jsxs)(m.Row,{gap:8,children:[(0,S.jsx)(m.Button,{small:!0,testID:"chef-confirm",label:e.plan.confirm,onPress:()=>ne(e)}),(0,S.jsx)(m.Button,{small:!0,kind:"ghost",label:"Cancel",onPress:()=>ie(e)})]}):(0,S.jsx)(m.Badge,{kind:'done'===e.state?'ok':'neutral',label:'done'===e.state?'Confirmed':'Cancelled: nothing done'}),'open'===e.state?(0,S.jsxs)(m.Muted,{children:["Nothing happens until you tap ",e.plan.confirm,"."]}):null]},e.id):(0,S.jsx)(p.default,{testID:"chef-assistant-reply",style:{alignSelf:'flex-start',maxWidth:'92%',backgroundColor:w.colours.surface2,borderRadius:14,padding:10},children:(0,S.jsx)(m.T,{children:e.text})},e.id))]}),(0,S.jsxs)(m.Row,{gap:8,children:[(0,S.jsx)(t.TextInput,{testID:"chef-assistant-input",accessibilityLabel:"Ask the Assistant",placeholder:"Type a kitchen task\u2026",placeholderTextColor:"#7D776C",value:N,onChangeText:e=>{_(e),e||q(!1)},onSubmitEditing:re,returnKeyType:"send",style:[m.styles.input,{flex:1,minWidth:0,width:40}]}),(0,S.jsx)(u.default,{testID:"chef-assistant-mic",accessibilityRole:"button",accessibilityLabel:V?'Stop listening':'Speak',onPress:()=>{const e=z();if(e)if(V)U.current?.stop?.();else try{const t=new e;U.current=t,t.lang='en-GB',t.interimResults=!1,t.maxAlternatives=1,t.onresult=e=>{const t=e.results?.[0]?.[0]?.transcript;t&&(_(t),q(!0))},t.onend=()=>K(!1),t.onerror=()=>{K(!1),J('Sorry, I didn\u2019t catch that. You can type instead.')},K(!0),t.start()}catch{K(!1),J('Voice input isn\u2019t available here. Please type instead.')}else J('Voice input isn\u2019t available in this browser. Please type instead.')},style:{width:48,height:48,borderRadius:24,borderWidth:1.5,borderColor:w.colours.gold,alignItems:'center',justifyContent:'center',backgroundColor:V?w.colours.gold:'transparent'},children:(0,S.jsx)(m.T,{size:20,children:"\ud83c\udfa4"})}),(0,S.jsx)(m.Button,{label:"Send",disabled:!N.trim(),onPress:re})]}),(0,S.jsx)(m.Muted,{center:!0,children:"Every action waits for your Confirm \xb7 nothing is sent, paid or deleted"})]})})})};var t=_r(_d[0]),n=_r(_d[1]),r=_r(_d[2]),s=_r(_d[3]),a=_r(_d[4]),o=_r(_d[5]),l=_r(_d[6]),d=_r(_d[7]),c=e(_r(_d[8]));_r(_d[9]);var u=e(_r(_d[10])),h=e(_r(_d[11])),p=e(_r(_d[12])),f=_r(_d[13]),m=_r(_d[14]),b=_r(_d[15]),y=_r(_d[16]),x=_r(_d[17]),j=_r(_d[18]),v=_r(_d[19]),w=_r(_d[20]),$=_r(_d[21]),C=_r(_d[22]),T=_r(_d[23]),k=_r(_d[24]),S=_r(_d[25]);const I=(0,f.create)(e=>({open:!1,setOpen:t=>e({open:t})})),R=()=>Math.random().toString(36).slice(2,9),P=['Draft a recipe card for crab linguine','Build the fish order','What allergens are in the fish and chips?','What price gives 70% GP on the lobster?','Walk-in fridge 3.5 degrees'],O='The secure AI server: not set up yet',A=e=>e.toLowerCase().replace(/[^a-z0-9 ]/g,' ').replace(/\s+/g,' ').trim(),W=new Set(['the','and','with','for','our','house','served','side','of','in','on','from']);function D(e,t,n){const r=` ${A(e)} `;let s,a=0;for(const e of t){const t=A(n(e).replace(/\(example\)/i,'')).split(' ').filter(e=>e.length>2&&!W.has(e)),o=t.filter(e=>r.includes(` ${e} `)||r.includes(` ${e}s `)).length,l=t.length?o/t.length+.01*o:0;o&&l>a&&(s=e,a=l)}return s}function z(){return'undefined'==typeof window?null:(0,l.speechRecognizer)()}},1225,[812,779,1201,820,943,17,890,1177,378,219,385,278,85,831,777,845,1002,851,867,1001,804,1140,1135,1163,891,8]); __d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"BOTTOM_TABS_HEIGHT",{enumerable:!0,get:function(){return h}}),_e.BottomTabs=function({tabs:e,active:b,onPress:y,background:x,tablist:p}){const{width:j}=(0,s.default)(),v=j/Math.max(1,e.length),w=v>=60?11:10,I=v<56?20:22,[F,S]=(0,t.useState)({}),[H,_]=(0,t.useState)(0),M=H>0&&e.some(e=>(F[e.id]??0)>H-6),z={flexDirection:'row',flexWrap:'nowrap',alignItems:'stretch',borderTopWidth:1,borderColor:c.colours.border,backgroundColor:x};return(0,f.jsx)(l.default,{testID:"app-bottom-tabs",accessibilityRole:p?'tablist':void 0,style:z,children:e.map(t=>{const s=b===t.id,x=s?c.colours.gold:c.colours.muted;return(0,f.jsxs)(n.default,{onLayout:t===e[0]?e=>_(e.nativeEvent.layout.width):void 0,testID:`tab-${t.id}`,accessibilityRole:"tab",accessibilityState:{selected:s},accessibilityLabel:t.a11y??t.label,onPress:()=>y(t.id),style:{flexGrow:1,flexShrink:1,flexBasis:0,minWidth:44,minHeight:h,alignItems:'center',justifyContent:'center',paddingVertical:4,paddingHorizontal:1,gap:2},children:[(0,f.jsxs)(l.default,{style:{width:I,height:I,alignItems:'center',justifyContent:'center'},children:[(0,f.jsx)(u.Icon,{name:t.icon,size:I,colour:x}),t.badge?(0,f.jsx)(l.default,{testID:t.badge.testID,style:{position:'absolute',right:-10,top:-5,backgroundColor:t.badge.bg,borderRadius:8,minWidth:16,height:16,paddingHorizontal:3,alignItems:'center',justifyContent:'center'},children:(0,f.jsx)(o.default,{style:{fontFamily:c.fonts.bold,fontSize:10,lineHeight:12,color:t.badge.fg??'#FFFFFF'},children:t.badge.text})}):null]}),(0,f.jsx)(l.default,{pointerEvents:"none","aria-hidden":!0,importantForAccessibility:"no-hide-descendants",accessibilityElementsHidden:!0,style:{position:'absolute',left:0,top:0,width:0,height:0,overflow:'hidden',opacity:0},children:(0,f.jsx)(l.default,{style:{width:400,flexDirection:'row',alignItems:'flex-start'},children:(0,f.jsx)(o.default,{onLayout:e=>{const n=Math.ceil(e.nativeEvent.layout.width);S(e=>e[t.id]===n?e:{...e,[t.id]:n})},style:{fontFamily:c.fonts.semibold,fontSize:w,lineHeight:Math.round(1.3*w),flexShrink:0},children:t.short??t.label})})}),M?null:(0,f.jsx)(o.default,{numberOfLines:1,style:{fontFamily:s?c.fonts.semibold:c.fonts.regular,fontSize:w,lineHeight:Math.round(1.3*w),color:x,textAlign:'center',alignSelf:'center',maxWidth:'100%'},children:t.short??t.label})]},t.id)})})};var t=r(d[0]),n=e(r(d[1])),o=e(r(d[2])),l=e(r(d[3])),s=e(r(d[4])),c=r(d[5]),u=r(d[6]),f=r(d[7]);const h=56},1226,[17,385,329,85,409,804,1178,8]); __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return f}});var t=r(d[0]);r(d[1]);var n=r(d[2]),u=r(d[3]),c=r(d[4]);function f(){return(0,u.canShow)('chef')?(0,c.jsx)(n.ChefApp,{}):(0,c.jsx)(t.Redirect,{href:u.ENTRY[u.APP_VARIANT]})}},1227,[13,17,775,856,8]); -__d(function(g,_r,_i,_a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return A}});var e,t=_r(d[0]),o=_r(d[1]),n=_r(d[2]),s=_r(d[3]),l=_r(d[4]),i=_r(d[5]),a=_r(d[6]),r=_r(d[7]),u=(e=r)&&e.__esModule?e:{default:e},c=_r(d[8]),h=_r(d[9]),p=_r(d[10]),b=_r(d[11]),f=_r(d[12]),y=_r(d[13]),x=_r(d[14]),k=_r(d[15]),j=_r(d[16]),v=_r(d[17]),S=_r(d[18]),w=_r(d[19]),T=_r(d[20]),C=_r(d[21]),D=_r(d[22]),$=_r(d[23]),P=_r(d[24]),M=_r(d[25]),B=_r(d[26]),O=_r(d[27]);function A(){const{rid:e,date:r}=(0,s.useLocalSearchParams)(),A=(0,j.useRestaurant)(e),N=(0,j.useCustomer)(),z=(0,j.useBookings)(e),I=(0,j.useEvents)(e),R=(0,j.useNow)(6e4),[q]=(0,l.useState)(()=>(0,a.startForm)()),[F,L]=(0,l.useState)(''),[E,H]=(0,l.useState)(2),[W,_]=(0,l.useState)(0),Y=Math.min(W,Math.max(0,E-1)),[U,G]=(0,l.useState)(r??(0,k.ymd)(R)),[Q,V]=(0,l.useState)(null),[J,K]=(0,l.useState)(N.name),[X,Z]=(0,l.useState)(N.phone??''),[ee,te]=(0,l.useState)(N.email??''),[oe,ne]=(0,l.useState)(!1),[se,le]=(0,l.useState)(''),[ie,ae]=(0,l.useState)(!1),[re,de]=(0,l.useState)([]),[ue,ce]=(0,l.useState)(!1),he=[...N.allergies,...re.filter(e=>!N.allergies.some(t=>t.allergen===e)).map(e=>({allergen:e,severity:'allergy'}))],[me,ge]=(0,l.useState)(null),pe=(0,C.useBlocks)(e=>e.blocks);(0,v.usePublicDayStore)(e=>e.n);const be=e?(0,v.publicDay)(e,U):null,fe=be?[...be.bookings,...z.filter(e=>e.date!==U)]:z,ye=be?[...pe.filter(t=>t.rid!==e||t.date!==U),...be.blocks]:pe,xe=(0,D.usePlan)(e),[ke,je]=(0,l.useState)((0,P.emptyNeeds)()),ve=!0===ke.dog,Se=ve?ke.dogs:0;if(!A)return(0,O.jsx)(b.Screen,{title:"Not found",children:(0,O.jsx)(b.T,{children:"Restaurant not found."})});const we=A.settings,Te=(0,k.parseYmd)(U),Ce=(0,x.onlinePartyBounds)(A),De=(0,C.blocksOn)(ye,A.id,U),$e=fe.filter(e=>e.date===U),Pe=xe.areas.filter(e=>e.dogs),Me=(0,M.dogSetUp)(xe),Be=e=>(0,$.freeTablesAt)(xe,$e,E,new Date(`${U}${(0,t.tableNumbers)(e)}:00`),(0,$.turnFor)(E,we.turnMins),we.turnMins,{dog:!0,closed:(0,C.closedAreasAt)(ye,A.id,U,e)}),Oe=(0,x.bookingSlots)(A,Te,e=>fe.filter(t=>t.date===U&&t.time===e&&!['cancelled','noshow'].includes(t.status)).reduce((e,t)=>e+t.partySize,0),E,R,e=>fe.filter(t=>t.date===U&&t.time===e&&!['cancelled','noshow'].includes(t.status)).length).map(e=>{const t=(0,C.blockAt)(ye,A.id,U,e.time),o=ve&&Me&&e.available&&!t&&(!Be(e.time).length||!(0,P.dogTimeOk)(A,fe,U,e.time,Se));return{...e,blocked:!!t,noDog:o,available:e.available&&!t&&!o}}),Ae=Oe.some(e=>e.available),Ne=(0,c.depositOf)(we),ze=(0,c.depositDue)(Ne,E,Y),Ie=ze>0?'deposit':'none',Re=(0,c.depositWords)(Ne,E,A.name,Y),qe=I.filter(e=>e.date===U),Fe=(0,T.guestPhone)(X),Le=(0,T.emailOk)(ee),Ee=(0,P.needsMissing)(ke,N.allergies),He=!!Q&&ie&&!Ee.length&&J.trim().length>1&&Fe.ok&&Le,We=async()=>{const e=(0,P.needsPatch)(ke,N.allergies),t=ve&&Me?Be(Q).map(e=>e.table):[],o=ve?ke.tableReq.find(e=>t.includes(e))??t[0]:void 0,n=await j.repo.bookings.create({restaurantId:A.id,customerId:N.id,name:J,partySize:E,...Y?{children:Y}:{},date:U,time:Q,notes:se.trim(),security:Ie,depositPaid:0,...ze?{depositDue:ze,depositPolicy:Re.join(' '),depositRefundable:Ne.refundable,depositCutoffHours:Ne.cutoffHours}:{},phone:Fe.pretty,email:ee.trim()||void 0,source:'online',...e,...Oe.find(e=>e.time===Q)?.drinksOnly?{drinksOnly:!0}:{},allergies:e.allergies??he,...o?{table:o}:{}});(0,a.rememberGuard)(n.id,(0,a.guardFor)({...q,hp:F})),ge(n)},Ye=(0,j.useStore)(e=>me?e.bookings.find(e=>e.id===me.id)?.ref:void 0),Ue=e=>(0,w.waMeLink)(A.settings.whatsapp,(0,w.guestWhatsAppText)({name:e.name,ref:Ye??e.ref,date:e.date,time:e.time,partySize:e.partySize},A.name));if(me){const e='pending'===me.status;return(0,O.jsxs)(b.Screen,{title:e?'Booking request received':'Booking confirmed',subtitle:A.name,children:[(0,O.jsx)(b.Banner,{kind:e?'info':'success',title:`Reference ${Ye??me.ref}`,children:`${me.partySize} people \xb7 ${(0,k.niceDateYear)((0,k.parseYmd)(me.date))} at ${me.time}`}),e?(0,O.jsx)(b.Banner,{kind:"warn",title:"The team will confirm shortly",children:"For larger parties and special requests, a member of the team checks your booking first. Contact the venue if you need an update."}):null,(0,O.jsxs)(b.Card,{children:[(0,O.jsxs)(b.T,{children:["Name: ",me.name]}),(0,O.jsxs)(b.T,{children:["Mobile: ",me.phone]}),me.email?(0,O.jsxs)(b.T,{children:["Email: ",me.email]}):null,(0,O.jsxs)(b.T,{children:["Allergies shared with the restaurant: ",me.allergies.length?me.allergies.map(e=>`${(0,f.allergenLabel)(e.allergen)} (${(0,f.severityLabel)(e.severity)})`).join(', '):'none']}),me.notes?(0,O.jsxs)(b.T,{children:["Notes: ",me.notes]}):null,me.dog?(0,O.jsxs)(b.T,{children:["\ud83d\udc15 Dog coming too",me.table?` \xb7 dog-friendly table ${me.table}`:'']}):null,me.holds?.length?(0,O.jsxs)(b.T,{children:["Reserved: ",me.holds.map(e=>`${e.qty} \xd7 ${'item'===e.kind?(A.settings.reservables??M.ANCHORAGE_RESERVABLES).find(t=>t.id===e.id)?.name??'item':e.id}`).join(', ')," (the kitchen confirms it)"]}):null,me.tableReq?.length?(0,O.jsxs)(b.T,{children:["Table requested: ",me.tableReq.map(e=>`${(0,t.tableNumbers)(e)}`).join(' or ')," (not guaranteed, but we\u2019ll do our best)"]}):null,'deposit'===me.security&&me.depositDue?(0,O.jsxs)(b.T,{weight:"semibold",children:["Deposit due: ",(0,y.gbp)(me.depositDue),". ",A.name," will tell you how to pay it."]}):null,'deposit'===me.security&&me.depositPolicy?(0,O.jsx)(b.Muted,{children:me.depositPolicy}):null,(0,O.jsx)(b.Muted,{children:"Your booking details are shown above. If you need confirmation, contact the venue and quote your reference."}),(0,O.jsxs)(b.Muted,{children:["Need to change or cancel? Call ",A.phone," and quote ",Ye??me.ref,"."]})]}),Ue(me)?(0,O.jsxs)(u.default,{style:{gap:4},children:[(0,O.jsx)(b.Button,{kind:"secondary",label:"\ud83d\udcac Message us on WhatsApp",testID:"guest-whatsapp",onPress:()=>{const e=Ue(me);e&&(0,w.openWhatsApp)(e)}}),(0,O.jsx)(b.Muted,{size:13,children:"Opens WhatsApp with your booking details typed in. You can change the message before you send it."})]}):null,(0,O.jsx)(b.Button,{label:"Back to restaurant",onPress:()=>s.router.replace(`/customer/${A.id}`)})]})}return(0,O.jsxs)(b.Screen,{title:"Book a table",subtitle:A.name,footer:(0,O.jsx)(b.Button,{label:Ee.length?Ee[0]:E>(we.autoAcceptUpTo??7)?'Send booking request':'Confirm booking',disabled:!He,onPress:()=>We(),testID:"confirm-booking"}),children:[(0,O.jsx)(P.FirstQuestions,{rid:A.id,value:ke,onChange:e=>{e.dog===ke.dog&&e.dogs===ke.dogs||V(null),je(e)},party:E,audience:"guest",profile:N.allergies}),(0,O.jsxs)(b.Card,{children:[(0,O.jsxs)(u.default,{style:{gap:6,alignItems:'center'},children:[(0,O.jsx)(b.H2,{children:"Party size"}),(0,O.jsx)(o.PartySizeInput,{value:E,onChange:e=>{H(e),V(null)},min:Ce.min,max:Ce.max,label:"Party size",testID:"party-size"})]}),(0,O.jsx)(h.ChildrenCount,{guest:!0,party:E,value:Y,onChange:_,depositsOn:Ne.on&&Ne.perPersonPence>0,testID:"book-children"}),ze?(0,O.jsx)(b.Banner,{kind:"info",title:Y?`Deposit: ${(0,y.gbp)(ze)} for ${E-Y} adults (children free)`:`Deposit: ${(0,y.gbp)(ze)} for ${E} guests`,children:(0,O.jsx)(u.default,{style:{gap:4},children:Re.map(e=>(0,O.jsx)(b.T,{size:13,children:e},e))})}):Ne.on&&Ne.perPersonPence>0?(0,O.jsxs)(b.Muted,{children:["No deposit for fewer than ",Ne.fromParty," guests."]}):null,E>(we.autoAcceptUpTo??7)?(0,O.jsxs)(b.Muted,{children:["For ",E," people the team checks the booking first, then texts you to confirm."]}):null,ve&&Me?(0,O.jsxs)(b.Muted,{children:["Dogs are welcome in the ",Pe.map(e=>`${e.name}${e.outdoor?' (outdoors, weather permitting)':''}`).join(' and ')||'dog-friendly tables',". We\u2019ll only show times with a dog-friendly table",A.settings.maxDogsPerSlot?' and room for your dog':'',"."]}):null]}),(0,O.jsxs)(b.Card,{children:[(0,O.jsx)(b.H2,{children:"Date"}),(0,O.jsx)(B.CustomerDatePicker,{r:A,today:R,value:U,events:I,onChange:e=>{G(e),V(null)}}),qe.map(e=>(0,O.jsx)(b.Banner,{kind:"demo",title:e.title,children:e.description},e.id))]}),(0,O.jsxs)(b.Card,{children:[(0,O.jsx)(b.H2,{children:"Time"}),0===Oe.length?(0,O.jsx)(b.Muted,{children:"Closed on this day (per listed kitchen hours)."}):(0,O.jsx)(b.Row,{wrap:!0,gap:6,children:Oe.map(e=>(0,O.jsx)(b.Chip,{testID:`book-slot-${e.time}`,label:e.time,sub:e.available?e.drinksOnly?'Drinks only':void 0:e.blocked?'Unavailable':e.noDog?'No dog table':e.leftV(e.time)},e.time))}),De.length>0&&Oe.some(e=>e.blocked)?(0,O.jsx)(b.Banner,{kind:"info",title:Ae?'Some times aren\u2019t available online':'Online booking isn\u2019t available for this time',children:`We\u2019re not taking online bookings ${De.map(e=>`${e.from}\u2013${e.to}`).join(', ')} on ${(0,k.niceDate)(Te)}. Please give us a ring on ${A.phone??"the restaurant"} and we\u2019ll do our best to fit you in.`}):null,(()=>{const e=(0,n.lastFoodOn)(A,U);return e&&Oe.some(e=>e.drinksOnly)?(0,O.jsx)(b.Banner,{kind:"info",title:`Last food orders ${(0,n.fmt12)(e.time)}${'kitchen closes'!==e.reason?` (${e.reason})`:''}`,children:"Times marked \u201cDrinks only\u201d are after the kitchen\u2019s last food orders that day: you\u2019re welcome for drinks, but we can\u2019t serve food."}):null})(),ve&&Oe.some(e=>e.noDog)?(0,O.jsx)(b.Banner,{kind:"info",title:"Some times are full for dogs",children:`Times marked "No dog table" are full in the ${Pe.map(e=>e.name).join(' and ')}${A.settings.maxDogsPerSlot?' or already have the most dogs we can look after':''}${(0,C.closedAreasAt)(ye,A.id,U,Q??'12:00').size?', or the garden is closed for weather':''}. We\u2019d love to see you both, so please try one of the other times shown.`}):null,(0,O.jsx)(b.Muted,{children:(0,x.bookingLimitsHint)(A)})]}),(0,O.jsx)(P.MoreQuestions,{rid:A.id,r:A,value:ke,onChange:je,party:E,date:U,time:Q,today:(0,k.ymd)(R),bookings:fe,audience:"guest",showTables:!0}),(0,O.jsxs)(b.Card,{highlight:ie?void 0:S.colours.amber,children:[(0,O.jsx)(b.Field,{label:"Notes (optional)",value:se,onChangeText:le,placeholder:p.NOTES_PLACEHOLDER,multiline:!0,numberOfLines:3,testID:"book-notes"}),(0,O.jsx)(b.Toggle,{label:"I confirm the allergy information for this booking",value:ie,onChange:ae}),(0,O.jsx)(b.Muted,{children:"Table requests aren\u2019t guaranteed, but we\u2019ll do our best. Nothing here is charged now; reserved dishes are paid on the night."})]}),(0,O.jsxs)(b.Card,{children:[(0,O.jsx)(b.H2,{children:"Your details"}),(0,O.jsx)(b.Field,{label:"Name for the booking",value:J,onChangeText:K}),(0,O.jsx)(b.Field,{testID:"book-phone",label:"Mobile number (needed to book)",value:X,onChangeText:Z,onBlur:()=>ne(!0),keyboardType:"phone-pad",autoComplete:"tel",placeholder:"e.g. 07700 900123"}),Fe.ok||!oe&&!X?null:(0,O.jsx)(b.T,{size:13,colour:S.colours.amber,children:Fe.error}),(0,O.jsx)(b.Field,{testID:"book-email",label:"Email (optional)",value:ee,onChangeText:te,keyboardType:"email-address",autoCapitalize:"none",autoComplete:"email",placeholder:"you@example.com"}),Le?null:(0,O.jsx)(b.T,{size:13,colour:S.colours.amber,children:"That email doesn\u2019t look quite right. Check it, or leave it blank."}),(0,O.jsxs)(b.Muted,{children:["We\u2019ll text you a confirmation",ee.trim()?' and email it too':'',", with how to change or cancel. We only use your number for this booking."]})]}),(0,O.jsx)(i.Honeypot,{value:F,onChange:L})]})}},1228,[843,1095,861,13,17,1229,963,85,841,1230,1108,777,845,851,1101,863,858,946,804,1175,848,993,996,1074,1103,1053,1231,8]); +__d(function(g,_r,_i,_a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return A}});var e,t=_r(d[0]),o=_r(d[1]),n=_r(d[2]),s=_r(d[3]),a=_r(d[4]),l=_r(d[5]),i=_r(d[6]),r=_r(d[7]),u=(e=r)&&e.__esModule?e:{default:e},c=_r(d[8]),h=_r(d[9]),p=_r(d[10]),b=_r(d[11]),f=_r(d[12]),y=_r(d[13]),x=_r(d[14]),k=_r(d[15]),j=_r(d[16]),v=_r(d[17]),w=_r(d[18]),S=_r(d[19]),C=_r(d[20]),T=_r(d[21]),D=_r(d[22]),$=_r(d[23]),P=_r(d[24]),M=_r(d[25]),B=_r(d[26]),O=_r(d[27]);function A(){const{rid:e,date:r}=(0,s.useLocalSearchParams)(),A=(0,j.useRestaurant)(e),N=(0,j.useCustomer)(),z=(0,j.useBookings)(e),I=(0,j.useEvents)(e),R=(0,j.useNow)(6e4),[q]=(0,a.useState)(()=>(0,i.startForm)()),[F,L]=(0,a.useState)(''),[E,H]=(0,a.useState)(2),[W,_]=(0,a.useState)(0),Y=Math.min(W,Math.max(0,E-1)),[U,G]=(0,a.useState)(r??(0,k.ymd)(R)),[Q,V]=(0,a.useState)(null),[J,K]=(0,a.useState)(N.name),[X,Z]=(0,a.useState)(N.phone??''),[ee,te]=(0,a.useState)(N.email??''),[oe,ne]=(0,a.useState)(!1),[se,ae]=(0,a.useState)(''),[le,ie]=(0,a.useState)(!1),[re,de]=(0,a.useState)([]),[ue,ce]=(0,a.useState)(!1),he=[...N.allergies,...re.filter(e=>!N.allergies.some(t=>t.allergen===e)).map(e=>({allergen:e,severity:'allergy'}))],[me,ge]=(0,a.useState)(null),pe=(0,T.useBlocks)(e=>e.blocks);(0,v.usePublicDayStore)(e=>e.n);const be=e?(0,v.publicDay)(e,U):null,fe=be?[...be.bookings,...z.filter(e=>e.date!==U)]:z,ye=be?[...pe.filter(t=>t.rid!==e||t.date!==U),...be.blocks]:pe,xe=(0,D.usePlan)(e),[ke,je]=(0,a.useState)((0,P.emptyNeeds)()),ve=!0===ke.dog,we=ve?ke.dogs:0;if(!A)return(0,O.jsx)(b.Screen,{title:"Not found",children:(0,O.jsx)(b.T,{children:"Restaurant not found."})});const Se=A.settings,Ce=(0,k.parseYmd)(U),Te=(0,x.onlinePartyBounds)(A),De=(0,T.blocksOn)(ye,A.id,U),$e=fe.filter(e=>e.date===U),Pe=xe.areas.filter(e=>e.dogs),Me=(0,M.dogSetUp)(xe),Be=e=>(0,$.freeTablesAt)(xe,$e,E,new Date(`${U}${(0,t.tableNumbers)(e)}:00`),(0,$.turnFor)(E,Se.turnMins),Se.turnMins,{dog:!0,closed:(0,T.closedAreasAt)(ye,A.id,U,e)}),Oe=(0,x.bookingSlots)(A,Ce,e=>fe.filter(t=>t.date===U&&t.time===e&&!['cancelled','noshow'].includes(t.status)).reduce((e,t)=>e+t.partySize,0),E,R,e=>fe.filter(t=>t.date===U&&t.time===e&&!['cancelled','noshow'].includes(t.status)).length).map(e=>{const t=(0,T.blockAt)(ye,A.id,U,e.time),o=ve&&Me&&e.available&&!t&&(!Be(e.time).length||!(0,P.dogTimeOk)(A,fe,U,e.time,we));return{...e,blocked:!!t,noDog:o,available:e.available&&!t&&!o}}),Ae=Oe.some(e=>e.available),Ne=(0,c.depositOf)(Se),ze=(0,c.depositDue)(Ne,E,Y),Ie=ze>0?'deposit':'none',Re=(0,c.depositWords)(Ne,E,A.name,Y),qe=I.filter(e=>e.date===U),Fe=(0,C.guestPhone)(X),Le=(0,C.emailOk)(ee),Ee=(0,P.needsMissing)(ke,N.allergies),He=!!Q&&le&&!Ee.length&&J.trim().length>1&&Fe.ok&&Le,We=async()=>{const e=(0,P.needsPatch)(ke,N.allergies),t=ve&&Me?Be(Q).map(e=>e.table):[],o=ve?ke.tableReq.find(e=>t.includes(e))??t[0]:void 0,n=await j.repo.bookings.create({restaurantId:A.id,customerId:N.id,name:J,partySize:E,...Y?{children:Y}:{},date:U,time:Q,notes:se.trim(),security:Ie,depositPaid:0,...ze?{depositDue:ze,depositPolicy:Re.join(' '),depositRefundable:Ne.refundable,depositCutoffHours:Ne.cutoffHours}:{},phone:Fe.pretty,email:ee.trim()||void 0,source:'online',...e,...Oe.find(e=>e.time===Q)?.drinksOnly?{drinksOnly:!0}:{},allergies:e.allergies??he,...o?{table:o}:{}});(0,i.rememberGuard)(n.id,(0,i.guardFor)({...q,hp:F})),ge(n)},Ye=(0,j.useStore)(e=>me?e.bookings.find(e=>e.id===me.id)?.ref:void 0),Ue=e=>(0,S.waMeLink)(A.settings.whatsapp,(0,S.guestWhatsAppText)({name:e.name,ref:Ye??e.ref,date:e.date,time:e.time,partySize:e.partySize},A.name));if(me){const e='pending'===me.status;return(0,O.jsxs)(b.Screen,{title:e?'Booking request received':'Booking confirmed',subtitle:A.name,children:[(0,O.jsx)(b.Banner,{kind:e?'info':'success',title:`Reference ${Ye??me.ref}`,children:`${me.partySize} people \xb7 ${(0,k.niceDateYear)((0,k.parseYmd)(me.date))} at ${me.time}`}),e?(0,O.jsx)(b.Banner,{kind:"warn",title:"The team will confirm shortly",children:"For larger parties and special requests, a member of the team checks your booking first. Contact the venue if you need an update."}):null,(0,O.jsxs)(b.Card,{children:[(0,O.jsxs)(b.T,{children:["Name: ",me.name]}),(0,O.jsxs)(b.T,{children:["Mobile: ",me.phone]}),me.email?(0,O.jsxs)(b.T,{children:["Email: ",me.email]}):null,(0,O.jsxs)(b.T,{children:["Allergies shared with the restaurant: ",me.allergies.length?me.allergies.map(e=>`${(0,f.allergenLabel)(e.allergen)} (${(0,f.severityLabel)(e.severity)})`).join(', '):'none']}),me.notes?(0,O.jsxs)(b.T,{children:["Notes: ",me.notes]}):null,me.dog?(0,O.jsxs)(b.T,{children:["\ud83d\udc15 Dog coming too",me.table?` \xb7 dog-friendly table ${me.table}`:'']}):null,me.holds?.length?(0,O.jsxs)(b.T,{children:["Reserved: ",me.holds.map(e=>`${e.qty} \xd7 ${'item'===e.kind?(A.settings.reservables??M.ANCHORAGE_RESERVABLES).find(t=>t.id===e.id)?.name??'item':e.id}`).join(', ')," (the kitchen confirms it)"]}):null,me.tableReq?.length?(0,O.jsxs)(b.T,{children:["Table requested: ",me.tableReq.map(e=>`${(0,t.tableNumbers)(e)}`).join(' or ')," (not guaranteed, but we\u2019ll do our best)"]}):null,'deposit'===me.security&&me.depositDue?(0,O.jsxs)(b.T,{weight:"semibold",children:["Deposit due: ",(0,y.gbp)(me.depositDue),". ",A.name," will tell you how to pay it."]}):null,'deposit'===me.security&&me.depositPolicy?(0,O.jsx)(b.Muted,{children:me.depositPolicy}):null,(0,O.jsx)(b.Muted,{children:"Your booking details are shown above. If you need confirmation, contact the venue and quote your reference."}),(0,O.jsxs)(b.Muted,{children:["Need to change or cancel? Call ",A.phone," and quote ",Ye??me.ref,"."]})]}),Ue(me)?(0,O.jsxs)(u.default,{style:{gap:4},children:[(0,O.jsx)(b.Button,{kind:"secondary",label:"\ud83d\udcac Message us on WhatsApp",testID:"guest-whatsapp",onPress:()=>{const e=Ue(me);e&&(0,S.openWhatsApp)(e)}}),(0,O.jsx)(b.Muted,{size:13,children:"Opens WhatsApp with your booking details typed in. You can change the message before you send it."})]}):null,(0,O.jsx)(b.Button,{label:"Back to restaurant",onPress:()=>s.router.replace(`/customer/${A.id}`)})]})}return(0,O.jsxs)(b.Screen,{title:"Book a table",subtitle:A.name,footer:(0,O.jsx)(b.Button,{label:Ee.length?Ee[0]:E>(Se.autoAcceptUpTo??7)?'Send booking request':'Confirm booking',disabled:!He,onPress:()=>We(),testID:"confirm-booking"}),children:[(0,O.jsx)(P.FirstQuestions,{rid:A.id,value:ke,onChange:e=>{e.dog===ke.dog&&e.dogs===ke.dogs||V(null),je(e)},party:E,audience:"guest",profile:N.allergies}),(0,O.jsxs)(b.Card,{children:[(0,O.jsxs)(u.default,{style:{gap:6,alignItems:'center'},children:[(0,O.jsx)(b.H2,{children:"Party size"}),(0,O.jsx)(o.PartySizeInput,{value:E,onChange:e=>{H(e),V(null)},min:Te.min,max:Te.max,label:"Party size",testID:"party-size"})]}),(0,O.jsx)(h.ChildrenCount,{guest:!0,party:E,value:Y,onChange:_,depositsOn:Ne.on&&Ne.perPersonPence>0,testID:"book-children"}),ze?(0,O.jsx)(b.Banner,{kind:"info",title:Y?`Deposit: ${(0,y.gbp)(ze)} for ${E-Y} adults (children don't count towards the ${Ne.fromParty} and don't pay)`:`Deposit: ${(0,y.gbp)(ze)} for ${E} adults`,children:(0,O.jsx)(u.default,{style:{gap:4},children:Re.map(e=>(0,O.jsx)(b.T,{size:13,children:e},e))})}):Ne.on&&Ne.perPersonPence>0?(0,O.jsxs)(b.Muted,{children:["No deposit for fewer than ",Ne.fromParty," adults. Children don't count towards the ",Ne.fromParty," and don't pay, and staff can waive a deposit."]}):null,E>(Se.autoAcceptUpTo??7)?(0,O.jsxs)(b.Muted,{children:["For ",E," people the team checks the booking first, then texts you to confirm."]}):null,ve&&Me?(0,O.jsxs)(b.Muted,{children:["Dogs are welcome in the ",Pe.map(e=>`${e.name}${e.outdoor?' (outdoors, weather permitting)':''}`).join(' and ')||'dog-friendly tables',". We\u2019ll only show times with a dog-friendly table",A.settings.maxDogsPerSlot?' and room for your dog':'',"."]}):null]}),(0,O.jsxs)(b.Card,{children:[(0,O.jsx)(b.H2,{children:"Date"}),(0,O.jsx)(B.CustomerDatePicker,{r:A,today:R,value:U,events:I,onChange:e=>{G(e),V(null)}}),qe.map(e=>(0,O.jsx)(b.Banner,{kind:"demo",title:e.title,children:e.description},e.id))]}),(0,O.jsxs)(b.Card,{children:[(0,O.jsx)(b.H2,{children:"Time"}),0===Oe.length?(0,O.jsx)(b.Muted,{children:"Closed on this day (per listed kitchen hours)."}):(0,O.jsx)(b.Row,{wrap:!0,gap:6,children:Oe.map(e=>(0,O.jsx)(b.Chip,{testID:`book-slot-${e.time}`,label:e.time,sub:e.available?e.drinksOnly?'Drinks only':void 0:e.blocked?'Unavailable':e.noDog?'No dog table':e.leftV(e.time)},e.time))}),De.length>0&&Oe.some(e=>e.blocked)?(0,O.jsx)(b.Banner,{kind:"info",title:Ae?'Some times aren\u2019t available online':'Online booking isn\u2019t available for this time',children:`We\u2019re not taking online bookings ${De.map(e=>`${e.from}\u2013${e.to}`).join(', ')} on ${(0,k.niceDate)(Ce)}. Please give us a ring on ${A.phone??"the restaurant"} and we\u2019ll do our best to fit you in.`}):null,(()=>{const e=(0,n.lastFoodOn)(A,U);return e&&Oe.some(e=>e.drinksOnly)?(0,O.jsx)(b.Banner,{kind:"info",title:`Last food orders ${(0,n.fmt12)(e.time)}${'kitchen closes'!==e.reason?` (${e.reason})`:''}`,children:"Times marked \u201cDrinks only\u201d are after the kitchen\u2019s last food orders that day: you\u2019re welcome for drinks, but we can\u2019t serve food."}):null})(),ve&&Oe.some(e=>e.noDog)?(0,O.jsx)(b.Banner,{kind:"info",title:"Some times are full for dogs",children:`Times marked "No dog table" are full in the ${Pe.map(e=>e.name).join(' and ')}${A.settings.maxDogsPerSlot?' or already have the most dogs we can look after':''}${(0,T.closedAreasAt)(ye,A.id,U,Q??'12:00').size?', or the garden is closed for weather':''}. We\u2019d love to see you both, so please try one of the other times shown.`}):null,(0,O.jsx)(b.Muted,{children:(0,x.bookingLimitsHint)(A)})]}),(0,O.jsx)(P.MoreQuestions,{rid:A.id,r:A,value:ke,onChange:je,party:E,date:U,time:Q,today:(0,k.ymd)(R),bookings:fe,audience:"guest",showTables:!0}),(0,O.jsxs)(b.Card,{highlight:le?void 0:w.colours.amber,children:[(0,O.jsx)(b.Field,{label:"Notes (optional)",value:se,onChangeText:ae,placeholder:p.NOTES_PLACEHOLDER,multiline:!0,numberOfLines:3,testID:"book-notes"}),(0,O.jsx)(b.Toggle,{label:"I confirm the allergy information for this booking",value:le,onChange:ie}),(0,O.jsx)(b.Muted,{children:"Table requests aren\u2019t guaranteed, but we\u2019ll do our best. Nothing here is charged now; reserved dishes are paid on the night."})]}),(0,O.jsxs)(b.Card,{children:[(0,O.jsx)(b.H2,{children:"Your details"}),(0,O.jsx)(b.Field,{label:"Name for the booking",value:J,onChangeText:K}),(0,O.jsx)(b.Field,{testID:"book-phone",label:"Mobile number (needed to book)",value:X,onChangeText:Z,onBlur:()=>ne(!0),keyboardType:"phone-pad",autoComplete:"tel",placeholder:"e.g. 07700 900123"}),Fe.ok||!oe&&!X?null:(0,O.jsx)(b.T,{size:13,colour:w.colours.amber,children:Fe.error}),(0,O.jsx)(b.Field,{testID:"book-email",label:"Email (optional)",value:ee,onChangeText:te,keyboardType:"email-address",autoCapitalize:"none",autoComplete:"email",placeholder:"you@example.com"}),Le?null:(0,O.jsx)(b.T,{size:13,colour:w.colours.amber,children:"That email doesn\u2019t look quite right. Check it, or leave it blank."}),(0,O.jsxs)(b.Muted,{children:["We\u2019ll text you a confirmation",ee.trim()?' and email it too':'',", with how to change or cancel. We only use your number for this booking."]})]}),(0,O.jsx)(l.Honeypot,{value:F,onChange:L})]})}},1228,[843,1095,861,13,17,1229,963,85,841,1230,1108,777,845,851,1101,863,858,946,804,1175,848,993,996,1074,1103,1053,1231,8]); __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.Honeypot=function({value:t,onChange:n}){return(0,l.jsx)(o.default,{"aria-hidden":!0,pointerEvents:"none",style:{position:'absolute',left:-1e4,top:0,width:1,height:1,overflow:'hidden',opacity:0},children:(0,l.jsx)(e.TextInput,{testID:"hp-field",accessibilityLabel:"Leave this empty",value:t,onChangeText:n,tabIndex:-1,autoComplete:'off',name:'cc_extra_info','aria-hidden':!0})})};var e=r(d[0]);r(d[1]),r(d[2]);var t,n=r(d[3]),o=(t=n)&&t.__esModule?t:{default:t},l=r(d[4])},1229,[812,17,219,85,8]); -__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"maxChildren",{enumerable:!0,get:function(){return u}}),_e.ChildrenCount=function({party:e,value:t,onChange:o,depositsOn:h,testID:c="children-count",guest:p}){const f=u(e);if(f<1)return null;const x=Math.min(t,f);return(0,s.jsxs)(n.default,{style:{gap:6,alignItems:'center',width:'100%'},testID:c,children:[(0,s.jsx)(l.T,{size:17,weight:"semibold",center:!0,children:p?`How many of the ${e} are children?`:`Children in the ${e}`}),(0,s.jsx)(l.Stepper,{value:x,onChange:e=>o(Math.max(0,Math.min(f,e))),min:0,max:f,label:"children",testID:`${c}-stepper`,format:e=>e?String(e):'None'}),h?(0,s.jsx)(l.Muted,{center:!0,children:"Children never pay a deposit."}):null]})},r(d[0]);var e,t=r(d[1]),n=(e=t)&&e.__esModule?e:{default:e},l=r(d[2]),s=r(d[3]);const u=e=>Math.max(0,Math.round(Number(e)||0)-1)},1230,[17,85,777,8]); +__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"maxChildren",{enumerable:!0,get:function(){return o}}),_e.ChildrenCount=function({party:e,value:t,onChange:u,depositsOn:h,testID:c="children-count",guest:p}){const f=o(e);if(f<1)return null;const x=Math.min(t,f);return(0,s.jsxs)(n.default,{style:{gap:6,alignItems:'center',width:'100%'},testID:c,children:[(0,s.jsx)(l.T,{size:17,weight:"semibold",center:!0,children:p?`How many of the ${e} are children?`:`Children in the ${e}`}),(0,s.jsx)(l.Stepper,{value:x,onChange:e=>u(Math.max(0,Math.min(f,e))),min:0,max:f,label:"children",testID:`${c}-stepper`,format:e=>e?String(e):'None'}),h?(0,s.jsx)(l.Muted,{center:!0,children:"Children don't count towards the number that needs a deposit, and never pay."}):null]})},r(d[0]);var e,t=r(d[1]),n=(e=t)&&e.__esModule?e:{default:e},l=r(d[2]),s=r(d[3]);const o=e=>Math.max(0,Math.round(Number(e)||0)-1)},1230,[17,85,777,8]); __d(function(g,_r,_i,a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.CustomerDatePicker=function({r:e,today:m,value:D,events:x,onChange:f}){const p=(0,n.ymd)(m),j=(0,r.lastBookableDay)(p,e),[C,w]=(0,t.useState)(!1),[Y,k]=(0,t.useState)((0,i.slashDay)(D)),[I,P]=(0,t.useState)(D);I!==D&&(P(D),k((0,i.slashDay)(D)));const T=new Date(m);T.setHours(12,0,0,0);const $=Array.from({length:b},(e,t)=>{const s=new Date(T);return s.setDate(T.getDate()+t),s}).filter(e=>(0,n.ymd)(e)<=j),v=t=>!!(0,o.hoursFor)(e,t),F=(0,n.parseYmd)(D),[L,M]=(0,t.useState)(()=>({y:F.getFullYear(),m:F.getMonth()})),S=(new Date(L.y,L.m,1,12).getDay()+6)%7,R=new Date(L.y,L.m+1,0).getDate(),A=[...Array.from({length:S},()=>null),...Array.from({length:R},(e,t)=>new Date(L.y,L.m,t+1,12))];for(;A.length%7;)A.push(null);const z=(0,n.parseYmd)(j),W=L.y>m.getFullYear()||L.y===m.getFullYear()&&L.m>m.getMonth(),B=L.yM(({y:t,m:s})=>{const l=new Date(t,s+e,1);return{y:l.getFullYear(),m:l.getMonth()}}),_=Y===(0,i.slashDay)(D)?null:(0,r.typedBookDateProblem)(Y,p,e),O=e=>{f(e),w(!1)},G=(e,t)=>0===t?'Today':1===t?'Tomorrow':`${(0,n.dayShort)(e)} ${e.getDate()}`,N=$.some(e=>(0,n.ymd)(e)===D);return(0,h.jsxs)(l.default,{testID:"cust-date",style:{gap:10,alignItems:'center',width:'100%'},children:[(0,h.jsx)(l.default,{accessible:!0,accessibilityLiveRegion:"polite",testID:"cust-date-chosen",children:(0,h.jsx)(d.T,{center:!0,weight:"semibold",colour:c.colours.goldLight,children:`Booking for ${(0,n.niceDateYear)(F)}${v(F)?'':' (closed that day)'}`})}),(0,h.jsxs)(d.Row,{wrap:!0,gap:6,style:{justifyContent:'center'},children:[$.map((e,t)=>{const s=(0,n.ymd)(e),l=x.some(e=>e.date===s);return(0,h.jsx)(d.Chip,{testID:`cust-day-${s}`,label:G(e,t),sub:v(e)?l?'\u2605 event':void 0:'Closed',disabled:!v(e),selected:D===s,accessibilityLabel:`${(0,n.niceDate)(e)}${v(e)?l?', event':'':', closed'}`,onPress:()=>O(s)},s)}),N?null:(0,h.jsx)(d.Chip,{label:(0,n.niceDate)(F),sub:v(F)?void 0:'Closed',selected:!0,onPress:()=>w(!0),accessibilityLabel:`Chosen: ${(0,n.niceDateYear)(F)}. Opens the calendar`})]}),(0,h.jsxs)(l.default,{style:{width:'100%',maxWidth:360,gap:4},children:[(0,h.jsx)(d.Field,{label:"Any other date (DD/MM/YYYY)",testID:"cust-date-typed",value:Y,placeholder:"24/12/2026",keyboardType:"numbers-and-punctuation",maxLength:10,autoCapitalize:"none",autoCorrect:!1,style:{textAlign:'center'},accessibilityLabel:"Booking date, typed as day, month and four-digit year",onChangeText:t=>{const s=(0,i.slashDate)(t,Y);k(s);const l=(0,i.dayFromSlash)(s);l&&!(0,r.typedBookDateProblem)(s,p,e)&&f(l)}}),_&&Y.length>=10?(0,h.jsx)(d.T,{center:!0,size:15,colour:c.colours.amber,testID:"cust-date-problem",children:_}):null]}),(0,h.jsx)(d.Button,{kind:"secondary",label:C?'Hide calendar':'\ud83d\udcc5 Pick a date from a calendar',testID:"cust-date-cal",style:{minHeight:48},accessibilityLabel:C?'Hide the calendar':'Pick a date from a month calendar',onPress:()=>{C||M({y:F.getFullYear(),m:F.getMonth()}),w(!C)}}),C?(0,h.jsxs)(l.default,{testID:"cust-calendar",style:{borderWidth:1,borderColor:c.colours.border,borderRadius:14,padding:10,gap:6,backgroundColor:c.colours.surface2,width:'100%',maxWidth:420},children:[(0,h.jsx)(l.default,{style:{alignItems:'flex-end'},children:(0,h.jsx)(u.GoldClose,{label:"Close the calendar",testID:"cust-calendar-close",onPress:()=>w(!1),size:"sm"})}),(0,h.jsxs)(d.Row,{style:{justifyContent:'space-between',alignItems:'center'},children:[(0,h.jsx)(s.default,{accessibilityRole:"button",accessibilityLabel:"Previous month",accessibilityState:{disabled:!W},disabled:!W,onPress:()=>H(-1),style:{minWidth:48,minHeight:48,alignItems:'center',justifyContent:'center',opacity:W?1:.3},children:(0,h.jsx)(d.T,{size:22,colour:c.colours.gold,children:"\u2039"})}),(0,h.jsxs)(d.T,{center:!0,weight:"semibold",accessibilityRole:"header",children:[(0,n.monthLong)(L.m)," ",L.y]}),(0,h.jsx)(s.default,{accessibilityRole:"button",accessibilityLabel:"Next month",accessibilityState:{disabled:!B},disabled:!B,onPress:()=>H(1),style:{minWidth:48,minHeight:48,alignItems:'center',justifyContent:'center',opacity:B?1:.3},children:(0,h.jsx)(d.T,{size:22,colour:c.colours.gold,children:"\u203a"})})]}),(0,h.jsx)(l.default,{style:{flexDirection:'row'},importantForAccessibility:"no-hide-descendants",children:y.map(e=>(0,h.jsx)(d.T,{size:12,colour:c.colours.muted,center:!0,style:{flex:1},children:e},e))}),Array.from({length:A.length/7},(e,t)=>(0,h.jsx)(l.default,{style:{flexDirection:'row',gap:4},children:A.slice(7*t,7*t+7).map((e,t)=>{if(!e)return(0,h.jsx)(l.default,{style:{flex:1,height:44}},t);const o=(0,n.ymd)(e),i=oj,r=o===D,u=!v(e);return(0,h.jsx)(s.default,{testID:`cust-cal-${o}`,accessibilityRole:"button",accessibilityLabel:`${(0,n.niceDateYear)(e)}${i?', not bookable online':u?', closed':''}`,accessibilityState:{disabled:i||u,selected:r},disabled:i||u,onPress:()=>O(o),style:{flex:1,height:44,borderRadius:10,alignItems:'center',justifyContent:'center',borderWidth:o===p?1.5:0,borderColor:c.colours.gold,backgroundColor:r?c.colours.gold:'transparent',opacity:i?.3:1},children:(0,h.jsx)(d.T,{size:15,center:!0,weight:r?'bold':'regular',colour:r?c.colours.onGold:u?c.colours.muted:c.colours.text,style:u&&!i?{textDecorationLine:'line-through'}:void 0,children:e.getDate()})},t)})},t)),(0,h.jsxs)(d.Muted,{center:!0,children:["Crossed-out days: closed. ",(0,r.bookAheadUnlimited)(e)?`You can book up to ${(0,i.slashDay)(j)}.`:`Online booking is open up to ${(0,i.slashDay)(j)}.`]})]}):null]})};var t=_r(_d[0]),s=e(_r(_d[1])),l=e(_r(_d[2])),o=_r(_d[3]),n=_r(_d[4]),i=_r(_d[5]),r=_r(_d[6]),c=_r(_d[7]),d=_r(_d[8]),u=_r(_d[9]),h=_r(_d[10]);const y=['Mon','Tue','Wed','Thu','Fri','Sat','Sun'],b=14},1231,[17,385,85,862,863,1031,1232,804,777,779,8]); __d(function(g,_r,i,a,_m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"SERVER_MAX_DAYS_AHEAD",{enumerable:!0,get:function(){return n}}),e.bookAheadDays=r,Object.defineProperty(e,"bookAheadUnlimited",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"lastBookableDay",{enumerable:!0,get:function(){return u}}),e.typedBookDateProblem=function(n,r,o){const s=(n??'').trim();if(!s)return'Type a date as DD/MM/YYYY, for example 24/12/2026.';const l=(0,t.dayFromSlash)(s);if(!l)return'That isn\u2019t a date yet. Type it as DD/MM/YYYY, for example 24/12/2026.';if(lc){const[t,n,r]=c.split('-');return`Online booking is open up to ${r}/${n}/${t}. For later dates, please call us.`}return null};var t=_r(_d[0]);const n=366;function r(t){const r=Number(t?.settings?.onlineBookDaysAhead);return Number.isFinite(r)&&r>=1?Math.min(Math.round(r),n):n}const o=t=>r(t)>=n,s=(t,n)=>{const r=new Date(t+'T12:00:00Z');return r.setUTCDate(r.getUTCDate()+n),r.toISOString().slice(0,10)},u=(t,n)=>s(t,r(n))},1232,[1031]); __d(function(_g,_r,i,_a,_m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return b}});var n=_r(_d[0]),t=_r(_d[1]),s=_r(_d[2]),a=e(_r(_d[3])),l=e(_r(_d[4])),r=_r(_d[5]),o=_r(_d[6]),d=_r(_d[7]),c=_r(_d[8]),u=_r(_d[9]),h=_r(_d[10]),g=_r(_d[11]),p=_r(_d[12]),f=_r(_d[13]);function b(){const{rid:e,did:b}=(0,t.useLocalSearchParams)(),j=(0,h.useRestaurant)(e),x=(0,h.useMenu)(e).find(e=>e.id===b),y=(0,h.useCustomer)(),m=(0,h.useRecipeCards)(e).find(e=>e.id===x?.recipeCardId),k=m?.signOff&&m.photo?(0,g.recipeCards)().photoSource(m.photo):null,v=(0,h.useStore)(e=>e.addLine),w=(0,n.useTakeawayMenu)(n=>n.byVenue[e]),S=(0,h.useStore)(n=>n.basket.restaurantId===e&&'table'===n.basket.mode),[C,B]=(0,s.useState)(()=>(x?.optionGroups??[]).filter(e=>e.required).map(e=>e.choices[0].id)),[$,I]=(0,s.useState)(1),[P,T]=(0,s.useState)(''),[L,O]=(0,s.useState)(!1),[D,A]=(0,s.useState)(!1),[M,R]=(0,s.useState)(!1),[q,_]=(0,s.useState)(!1),N=(0,s.useMemo)(()=>x?(0,c.effectiveAllergens)(x,C):{},[x,C]);if(!j||!x)return(0,f.jsx)(d.Screen,{title:"Not found",children:(0,f.jsx)(d.T,{children:"Dish not found."})});const G=(0,c.conflictsFor)(N,y.allergies),Y=(x.price??0)+(x.optionGroups??[]).flatMap(e=>e.choices).filter(e=>C.includes(e.id)).reduce((e,n)=>e+n.priceDelta,0),z=S||j.fictional?'on':(0,n.takeawayAvail)(x,w),F=x.soldOut||!x.signOff||null===x.price||'on'!==z,Q=(e,n)=>{const t=x.optionGroups.find(n=>n.id===e);B(e=>{const s=t.choices.map(e=>e.id);return t.multi?e.includes(n)?e.filter(e=>e!==n):[...e,n]:e.includes(n)&&!t.required?e.filter(e=>e!==n):[...e.filter(e=>!s.includes(e)),n]})},V=e=>{h.useStore.getState().basket.restaurantId!==j.id&&h.useStore.getState().startBasket(j.id,'takeaway'),v({itemId:x.id,qty:$,choiceIds:C,notes:P,override:e?{allergens:G.contains,at:(new Date).toISOString()}:void 0}),O(!1),_(!0)};return(0,f.jsxs)(d.Screen,{title:x.name,subtitle:j.name,right:(0,f.jsx)(o.BasketButton,{}),children:[k?(0,f.jsx)(a.default,{testID:"dish-photo",source:k,accessibilityLabel:`${x.name}${'example'===m?.origin?' (example photo)':''}`,style:{width:'100%',height:200,borderRadius:12},resizeMode:"cover"}):null,(0,f.jsxs)(d.Row,{wrap:!0,gap:6,children:[(0,f.jsx)(d.T,{weight:"bold",size:20,colour:p.colours.gold,children:null===x.price?x.priceNote:(0,u.gbp)(Y)}),x.dietary.map(e=>(0,f.jsx)(d.Badge,{kind:"ok",label:e},e))]}),(0,f.jsx)(d.T,{children:x.description}),G.contains.length?(0,f.jsx)(d.Banner,{kind:"danger",title:`Blocked: contains ${G.contains.map(c.allergenLabel).join(', ')}`,children:`You\u2019ve told us: ${y.allergies.filter(e=>G.contains.includes(e.allergen)).map(e=>`${(0,c.allergenLabel)(e.allergen)} \u2014 ${(0,c.severityLabel)(e.severity)}`).join('; ')}. This dish can\u2019t be added unless you deliberately override (for example, ordering for someone else).`}):null,G.may.length?(0,f.jsx)(d.Banner,{kind:"warn",title:`Warning: may contain ${G.may.map(c.allergenLabel).join(', ')}`,children:"Cross-contact is possible (e.g. shared fryer). Please speak to staff before ordering."}):null,(x.optionGroups??[]).map(e=>(0,f.jsxs)(d.Card,{children:[(0,f.jsxs)(d.T,{weight:"semibold",children:[e.name,e.required?' (required)':' (optional)']}),(0,f.jsx)(d.Row,{wrap:!0,gap:6,children:e.choices.map(n=>(0,f.jsx)(d.Chip,{label:n.label,sub:n.priceDelta?`+${(0,u.gbp)(n.priceDelta)}`:void 0,selected:C.includes(n.id),onPress:()=>Q(e.id,n.id)},n.id))})]},e.id)),(0,f.jsx)(d.Card,{children:(0,f.jsx)(r.AllergenPanel,{item:x,map:N,declared:y.allergies})}),j.fictional?null:(0,f.jsx)(d.AllergenNotice,{phone:j.phone}),(0,f.jsx)(d.Field,{label:"Notes for the kitchen (optional)",placeholder:"e.g. no gherkins",value:P,onChangeText:T}),(0,f.jsxs)(d.Row,{style:{justifyContent:'space-between'},children:[(0,f.jsx)(d.T,{weight:"semibold",children:"Quantity"}),(0,f.jsx)(d.Stepper,{value:$,onChange:I,label:"quantity"})]}),q?(0,f.jsx)(d.Banner,{kind:"success",title:"Added to basket",children:G.contains.length?'Allergy override recorded \u2014 the kitchen will see a large allergy alert.':'Carry on browsing or go to your basket.'}):null,F?(0,f.jsx)(d.Banner,{kind:"warn",children:x.soldOut||'sold-out'===z?'Sold out today.':'off'===z&&x.signOff&&null!==x.price?'This dish isn\u2019t on the takeaway menu. You can have it when you eat in.':x.signOff?'Price on the specials board \u2014 ask staff.':'Not available to order online until the head chef signs off its allergens.'}):G.contains.length?(0,f.jsxs)(l.default,{style:{gap:8},children:[(0,f.jsx)(d.Button,{kind:"secondary",label:"Choose something else",onPress:()=>t.router.back()}),(0,f.jsx)(d.Button,{kind:"danger",label:"Override and add anyway\u2026",onPress:()=>{A(!1),R(!1),O(!0)},testID:"override-open"})]}):(0,f.jsxs)(d.Row,{gap:8,children:[(0,f.jsx)(d.Button,{style:{flex:1},label:`Add ${$} to basket \xb7 ${(0,u.gbp)(Y*$)}`,onPress:()=>V(!1),testID:"add-to-basket"}),q?(0,f.jsx)(d.Button,{kind:"secondary",label:"Basket",onPress:()=>t.router.push('/customer/basket')}):null]}),(0,f.jsxs)(d.Sheet,{visible:L,onClose:()=>O(!1),title:"Allergy override",children:[(0,f.jsx)(d.Banner,{kind:"danger",title:`${x.name} contains ${G.contains.map(c.allergenLabel).join(', ')}`,children:`Your profile says: ${y.allergies.filter(e=>G.contains.includes(e.allergen)).map(e=>`${(0,c.allergenLabel)(e.allergen)} \u2014 ${(0,c.severityLabel)(e.severity)}`).join('; ')}.`}),(0,f.jsx)(d.Toggle,{label:"I understand this dish contains an allergen I have declared",value:D,onChange:A}),(0,f.jsx)(d.Toggle,{label:"It is for someone without this allergy, or I have spoken to staff",value:M,onChange:R}),(0,f.jsx)(d.Muted,{children:"The override is logged and shown to the kitchen as an allergy alert that must be acknowledged."}),(0,f.jsx)(d.Button,{kind:"danger",disabled:!D||!M,label:"Confirm override and add",onPress:()=>V(!0),testID:"override-confirm"})]})]})}},1233,[947,13,17,319,85,1234,1236,777,845,851,858,867,804,8]); @@ -1566,7 +1566,7 @@ __d(function(_g,_r,_i,_a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esMo __d(function(g,r,i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"DRAFT_LABEL",{enumerable:!0,get:function(){return o}}),Object.defineProperty(_e,"useDrafts",{enumerable:!0,get:function(){return p}});var e,t=r(_d[0]),s=(e=t)&&e.__esModule?e:{default:e},n=r(_d[1]),d=r(_d[2]);const o={booking:'Booking',shopping:'Shopping list',offer:'Offer',event:'Event',special:'Special',message:'Message',payment:'Payment',other:'Request'},p=(0,n.create)()((0,d.persist)((e,t)=>({drafts:[],add:t=>{const s={...t,id:`dr-${Date.now().toString(36)}${Math.random().toString(36).slice(2,6)}`,at:(new Date).toISOString(),status:'draft'};return e(e=>({drafts:[s,...e.drafts].slice(0,300)})),s},addToList:(s,n,d,o,p)=>{const f=t().drafts.find(e=>e.rid===s&&'shopping'===e.kind&&e.supplier===n&&'draft'===e.status);if(f){const t={...f,lines:[...f.lines,...d]};return e(e=>({drafts:e.drafts.map(e=>e.id===f.id?t:e)})),t}return t().add({rid:s,kind:'shopping',supplier:n,title:'Supplier shopping list',lines:d,by:o,app:p})},decide:(t,s,n)=>e(e=>({drafts:e.drafts.map(e=>e.id===t?{...e,status:s,decidedBy:n,decidedAt:(new Date).toISOString()}:e)}))}),{name:'covercharge-drafts-v1',version:1,storage:(0,d.createJSONStorage)(()=>s.default)}))},1483,[824,831,834]); __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"useShiftNotes",{enumerable:!0,get:function(){return c}});var e,t=r(d[0]),n=(e=t)&&e.__esModule?e:{default:e},s=r(d[1]),o=r(d[2]);const c=(0,s.create)()((0,o.persist)(e=>({notes:[],add:t=>e(e=>({notes:[Object.assign({},t,{id:'sn-'+Date.now().toString(36),at:(new Date).toISOString()}),...e.notes].slice(0,300)})),setDone:(t,n)=>e(e=>({notes:e.notes.map(e=>e.id===t?Object.assign({},e,{done:n}):e)}))}),{name:'covercharge-shiftnotes-v1',version:1,storage:(0,o.createJSONStorage)(()=>n.default)}))},1484,[824,831,834]); __d(function(g,_r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"useCoach",{enumerable:!0,get:function(){return p}}),_e.findTarget=b,_e.CoachHost=function(){const{target:e,hint:s,nonce:x}=p(),[y,w]=(0,o.useState)(null),v=(0,o.useRef)(new n.default.Value(0)).current;if((0,o.useEffect)(()=>{n.default.loop(n.default.timing(v,{toValue:1,duration:1300,easing:l.default.out(l.default.quad),useNativeDriver:!1})).start()},[]),(0,o.useEffect)(()=>{if(w(null),!s||!e)return;let t=0,o=null,n=!1;const l=()=>{if(o=o&&o.isConnected?o:b(e),o){n||(o.scrollIntoView?.({block:'center',behavior:'smooth'}),n=!0);const e=o.getBoundingClientRect();w({x:e.left,y:e.top,w:e.width,h:e.height,vw:window.innerWidth,vh:window.innerHeight})}else++t>40&&w(null)},r=setInterval(l,150);l();const u=setTimeout(()=>p.getState().clear(),2e4);return()=>{clearInterval(r),clearTimeout(u)}},[x]),!s)return null;const C='fixed',R=!y||y.y+y.h+110p.getState().clear(),style:{alignSelf:'flex-end',backgroundColor:(0,t.soutersSurface)('#1A1408'),borderRadius:10,paddingHorizontal:14,paddingVertical:6},children:(0,h.jsx)(c.T,{colour:f.colours.gold,weight:"semibold",children:"Got it"})})]})})]})};var t=_r(d[0]),o=_r(d[1]),n=e(_r(d[2])),l=e(_r(d[3]));_r(d[4]);var r=e(_r(d[5])),u=e(_r(d[6])),s=_r(d[7]),c=_r(d[8]),f=_r(d[9]),h=_r(d[10]);const p=(0,s.create)(e=>({target:null,hint:null,nonce:0,show:(t,o)=>e(e=>({target:t??null,hint:o,nonce:e.nonce+1})),clear:()=>e({target:null,hint:null})}));function b(e){if('undefined'==typeof document)return null;const t=e=>e&&e.getClientRects().length?e:null;if(e.testID){const o=Array.from(document.querySelectorAll(`[data-testid="${e.testID}"]`)).map(t).find(Boolean);if(o)return o}if(e.label){const o=Array.from(document.querySelectorAll(`[aria-label="${e.label}"]`)).map(t).find(Boolean);if(o)return o}if(e.text){const o=e.text.toLowerCase(),n=Array.from(document.querySelectorAll('[role="button"], button, a')).filter(e=>(e.textContent??'').trim().toLowerCase().includes(o)).map(t).find(Boolean);if(n)return n}return null}},1485,[813,17,266,347,219,385,85,831,777,804,8]); -__d(function(g,r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"HELP_TOPICS",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"HELP",{enumerable:!0,get:function(){return a}}),Object.defineProperty(e,"helpById",{enumerable:!0,get:function(){return o}});const t=['Bookings','Walk-ins','Table plan','Rota','Hours & pay','Tips','Team','Suppliers','Stock','Recipe cards','Displays','Settings','Accounts'],a=[{id:'new-booking',kind:'guide',topic:'Bookings',title:'Take a phone booking',keywords:['booking','reservation','book','table','phone','covers','reserve'],body:'Add a booking for a guest who calls or walks up to ask. The app only offers times that are really free.',steps:['Open Bookings (or tap New booking on Today).','Pick the date, time and number of covers.','Add the guest\u2019s name and phone, plus any allergies or notes.','Tap Save. The booking appears on the timeline and the floor plan.'],showMe:{tab:'bookings',target:{testID:'add-booking'},hint:'Tap New booking to start a booking.'}},{id:'move-booking',kind:'faq',topic:'Bookings',title:'How do I move a booking to another table or time?',keywords:['move','change','reschedule','table','booking','swap'],body:'Open the booking from Bookings or the timeline and tap Edit, or drag it to another table on the Display. Guests are not messaged unless you choose to.',showMe:{tab:'bookings',target:{testID:'add-booking'},hint:'Your bookings list is here. Tap a booking to change it.'}},{id:'walk-in',kind:'guide',topic:'Walk-ins',title:'Seat a walk-in',keywords:['walk-in','walkin','walk in','seat','no booking','covers','party'],body:'Record guests who arrive without a booking so the floor plan and covers stay right.',steps:['On the Display (the venue tablet), tap Walk-in. On a phone, say \u201cadd a walk-in for 2\u201d to the Assistant.','Choose the number of covers.','Pick a free table (the best fit is suggested).','Tap Seat. The table shows as seated.'],actions:['add_walkin']},{id:'table-plan',kind:'guide',topic:'Table plan',title:'Edit the table plan',keywords:['table plan','floor plan','layout','tables','move tables','designer','areas','seats'],body:'Drag tables into place, set seats, join tables and add areas such as Terrace or Garden.',steps:['Go to More \u203a Table plan.','Tap Open the designer.','Drag tables, or tap one to change its name and seats.','Tap Save. Displays and bookings use the new plan straight away.'],showMe:{tab:'more',page:'tableplan',target:{testID:'open-designer'},hint:'Open the designer to move tables.'}},{id:'rota',kind:'guide',topic:'Rota',title:'Build and publish the rota',keywords:['rota','shift','schedule','week','publish','staff hours','add shift'],body:'Plan the week, then publish it so staff see their shifts in the Staff app.',steps:['Go to More \u203a Rota.','Tap a person\u2019s day to add a shift (presets: lunch, dinner, double).','New shifts are drafts with a dashed amber border.','Tap Publish when the week is ready. Staff see only published shifts.'],showMe:{tab:'more',page:'rota',target:{testID:'rota-publish'},hint:'Tap a day to add a shift, then Publish here.'},actions:['add_rota_shift','publish_rota']},{id:'rota-copy',kind:'faq',topic:'Rota',title:'Can I copy last week\u2019s rota?',keywords:['copy','last week','repeat','rota','duplicate'],body:'Yes. On the Rota tap Copy last week. The shifts come over as drafts so you can tweak them before publishing.',showMe:{tab:'more',page:'rota',target:{testID:'rota-copy'},hint:'Copy last week\u2019s shifts as drafts.'}},{id:'sign-off',kind:'guide',topic:'Hours & pay',title:'Sign off hours',keywords:['sign off','signoff','confirm hours','approve','timesheet','clock','pending'],body:'Only confirmed hours count for pay and tips. Check clocked times against the rota and confirm them.',steps:['Go to More \u203a Sign off hours.','Flagged days (late, missing clock-out, long breaks) are at the top.','Tap a row to fix a time; give a short reason.','Tap Confirm all unflagged, then deal with the rest.'],showMe:{tab:'more',page:'signoff',target:{testID:'confirm-unflagged'},hint:'Confirm all the days that look right in one tap.'}},{id:'payroll-hours',kind:'guide',topic:'Hours & pay',title:'Export hours for payroll',keywords:['payroll','export','hours','spreadsheet','csv','excel','accountant','copy','print'],body:'Get each person\u2019s confirmed hours for a pay period into your spreadsheet or to your accountant.',steps:['Go to More \u203a Payroll hours.','Pick the pay period (or a tips fortnight, or a custom range).','Check the pending banner: sign those off first if you can.','Tap Copy for spreadsheet and paste into Excel or Google Sheets, or download a CSV, or print.'],showMe:{tab:'more',page:'hours',target:{testID:'copy-tsv'},hint:'Copy, then paste straight into your spreadsheet.'}},{id:'pay-dates',kind:'faq',topic:'Hours & pay',title:'How do I set our pay dates?',keywords:['pay day','payday','pay dates','cut-off','wages','monthly','fortnightly'],body:'Settings \u203a Pay & tips: set when tips are paid and how often, the wage pay day and the cut-off. Payroll hours and Tips day use these dates.',showMe:{tab:'more',page:'paysettings',target:{testID:'save-pay'},hint:'Change the dates above, then Save.'}},{id:'tips-day',kind:'guide',topic:'Tips',title:'Share out tips on tips day',keywords:['tips','tronc','gratuity','share','split','tips day','service charge'],body:'Enter the tips total and it\u2019s shared by confirmed hours for the fortnight, to the penny.',steps:['Go to More \u203a Tips day (the right fortnight is picked for you).','Type the total tips.','Check anyone with pending hours; sign them off first if you can.','Copy or download the split for payroll.'],showMe:{tab:'more',page:'tipsday',target:{testID:'tips-total'},hint:'Type the tips total here.'}},{id:'invites',kind:'guide',topic:'Team',title:'Invite staff to the app',keywords:['invite','link','staff app','new starter','sign in','add staff','team member'],body:'Each person gets their own sign-in link. You choose when and how to share it.',steps:['Go to Settings \u203a Invite links.','Tap Make invite link next to the person.','Share the link yourself (text or WhatsApp). The app never sends it for you.','They tap it once and the Staff app remembers them.'],showMe:{tab:'more',page:'setup-invites',target:{text:'Make invite link'},hint:'Make a personal link, then share it yourself.'}},{id:'suppliers',kind:'guide',topic:'Suppliers',title:'Suppliers and order sheets',keywords:['supplier','order','order sheet','delivery','cut-off','fish','veg','dairy'],body:'Keep supplier contacts, order days and cut-offs together, and log what you ordered.',steps:['Go to More \u203a Suppliers to add or edit a supplier.','Use Supplier order sheets for the items you usually order.','Tap Log an order after you place it by phone or email.'],showMe:{tab:'more',page:'ordersheets',target:{testID:'sheet-add'},hint:'Add an order sheet for a supplier.'}},{id:'display-glance',kind:'guide',topic:'Display',title:'Today at a glance (Display)',keywords:['glance','today','covers by hour','breaks','on now','next','cut-off','cutoff','order times','display bar'],body:'The bar under the Display header shows today in one line: covers by hour (booked in solid gold, the walk-in estimate dashed), quiet times for breaks, who is on now and next, today\u2019s supplier order cut-offs with a countdown (amber under 30 minutes) and one tip. Cut-offs come from Scheduled notifications.'},{id:'sold-out',kind:'guide',topic:'Menu',title:'Sold out dishes',keywords:['sold out','run out','ran out','none left','back on','86','eighty six','display strip'],body:'When a dish runs out, mark it sold out so every member of staff knows. It\u2019s a reminder for staff: CoverCharge doesn\u2019t link up to your till, so it doesn\u2019t change the till. Sold out dishes show in a slim strip along the bottom of the Display within seconds, and in the Sold out list in Front of House, Managers and Head Chef. They clear by themselves when the kitchen closes (or the next morning, or only when you tap Back on: Settings \u203a Advanced \u203a Sold out reminders).',steps:['Open the Sold out list (Managers: More \u203a Sold out; Front of House: Me \u203a Sold out; Head Chef: Kitchen \u203a Live tickets \u203a Sold out).','Tap Mark sold out next to the dish.','When it\u2019s back, tap Back on.'],showMe:{tab:'more',page:'soldout',target:{testID:'soldout-search'},hint:'Find the dish, then tap Mark sold out.'}},{id:'shellfish',kind:'guide',topic:'Stock',title:'Live shellfish (and other) counts',keywords:['shellfish','lobster','crab','oysters','count','stock','tracked','sold out','86'],body:'Counters for things you sell by the unit, like lobster or crab. They show on the Display and warn when low.',steps:['Go to Settings \u203a Tracked stock.','Tap Add an item to track; set the name, icon and low warning.','Staff update the count from the small lobster and crab chip at the top of the Display, or in the app.'],showMe:{tab:'more',page:'trackedstock',target:{text:'Add an item to track'},hint:'Add something to count, like lobster.'}},{id:'recipe-cards',kind:'guide',topic:'Recipe cards',title:'Recipe cards',keywords:['recipe','card','dish','ingredients','method','allergens','spec'],body:'Photo, ingredients, method and allergens for each dish; the head chef signs them off and staff can read them.',steps:['Go to More \u203a Recipe cards.','Search for a dish or add a new one.','Fill in ingredients (allergens are suggested) and the method.','Send for head chef sign-off.'],showMe:{tab:'more',page:'recipecards',target:{testID:'card-search'},hint:'Search your recipe cards here.'}},{id:'display-pair',kind:'guide',topic:'Displays',title:'Pair a display or tablet',keywords:['display','tablet','pair','screen','code','front of house','kitchen screen'],body:'Connect a tablet to your venue with a one-time code. You can switch any display off from here.',steps:['Open the Display app on the tablet.','In Managers go to Settings \u203a Displays and tap Make a pairing code.','Type the code on the tablet. It joins your venue straight away.'],showMe:{tab:'more',page:'displays',target:{text:'Make a pairing code'},hint:'Make a one-time code for the tablet.'}},{id:'settings-hours',kind:'faq',topic:'Settings',title:'How do I change our opening hours?',keywords:['opening hours','hours','closed','open','kitchen hours','times'],body:'Settings \u203a Opening hours. Guests see these on your booking and order pages; bookings outside them are turned away.',showMe:{tab:'more',page:'setup-hours',hint:'Set each day\u2019s opening and closing time here.'}},{id:'replay-setup',kind:'faq',topic:'Settings',title:'Can I see the welcome walkthrough again?',keywords:['welcome','setup','walkthrough','onboarding','checklist','questionnaire'],body:'Yes: Settings \u203a Setup checklist \u203a Replay welcome. Everything is pre-filled from your questionnaire.',showMe:{tab:'more',page:'setupchecklist',target:{testID:'replay-welcome'},hint:'Replay the welcome walkthrough.'}},{id:'connected-accounts',kind:'guide',topic:'Accounts',title:'Connect your email, website and socials',keywords:['connect','account','gmail','outlook','wix','facebook','instagram','square','xero','quickbooks','login'],body:'Settings \u203a Connected accounts: tap a logo, save the account to your list, and use Connect with\u2026 to sign in on that service\u2019s own page (rolling out service by service; it shows Coming soon until then). CoverCharge never sees your password that way, and you can remove an account any time.',steps:['Go to Settings \u203a Connected accounts.','Tap the service\u2019s logo.','Tap Connect with\u2026 and sign in on their page.','To stop, tap Remove.'],showMe:{tab:'more',page:'connections',target:{testID:'conn-tile-gmail'},hint:'Tap a logo to connect that account.'}},{id:'supplier-portals',kind:'guide',topic:'Suppliers',title:'Order from your suppliers',keywords:['bidfood','booker','wholesale','cash and carry','order online','supplier login','account number','customer number'],body:'Settings \u203a Connected accounts \u203a Suppliers. Add supplier links for this venue, with an account number if you like. Open ordering and Log in open the supplier\u2019s own website, where you sign in; CoverCharge never keeps the password.',steps:['Go to Settings \u203a Connected accounts.','Scroll to Suppliers.','Tap Add against a supplier (account number optional).','Tap Open ordering or Log in whenever you need them.','To stop, tap Remove and confirm.'],showMe:{tab:'more',page:'connections',target:{testID:'portal-bidfood'},hint:'Your supplier ordering websites live here.'}},{id:'support',kind:'faq',topic:'Settings',title:'How do I get help from a person?',keywords:['support','help','contact','person','problem','broken','stuck'],body:'Support is free for life. Message the CoverCharge team from Settings \u203a Help, or email us, and we\u2019ll reply. We help by message and email.'},{id:'assistant-safe',kind:'faq',topic:'Settings',title:'Can the Assistant send or pay for things by itself?',keywords:['assistant','safe','confirm','send','pay','delete','ai'],body:'No. The Assistant and the voice helper show you exactly what they will do and wait for you to tap Confirm (or say yes). Anything that would send a message, order from a supplier or pay is only saved as a draft in Drafts for approval; nothing goes out by itself.'},{id:'restaurant-dashboard',kind:'guide',topic:'Bookings',title:'Restaurant dashboard',keywords:['restaurant dashboard','tables','timeline','guests','covers','joined tables'],body:'In Managers, tap Restaurant dashboard on Home, or More > Run the day > Restaurant dashboard. It is the same live table plan, Timeline, guest list, deposits, dogs, joined tables, Covers, covers-through-the-day chart and block bookings as the Display. Use the day arrows and Back to today. Assign or join tables on any day; seat, finish, no-show and cancel walk-in actions apply today. You can also say \u201copen Restaurant dashboard\u201d. The helper replies in text only.',showMe:{tab:'more',page:'serviceboard',target:{testID:'restaurant-dashboard-close'},hint:'Restaurant dashboard is open. Pick a day, or tap Back to Managers to close.'}},{id:'voice-helper',kind:'guide',topic:'Settings',title:'Use the hold-to-talk voice button',keywords:['voice','talk','speak','microphone','mic','hold','walkie','button','hands free','gloves'],body:'Hold the big gold button, say what you need, then let go. It logs fridge and freezer temperatures, answers allergen questions, marks dishes sold out, checks tables, adds to the waitlist, reads orders and covers, and drafts bookings, offers, events and supplier lists. The helper replies in text only, never aloud. Changes are shown in text first with Confirm and Cancel buttons: tap Confirm or say yes. Tap the button to type instead (in Managers this also opens the Assistant). It sits at the top right of the header in Managers, Head Chef, the Staff app (the full voice assistant, with no money, tips or HR) and on the Display (no money, tips or HR). Until the voice assistant\u2019s server is switched on, anything new says \u201cVoice assistant is switching on soon\u201d. Fair usage: 1,000 voice tasks a month per venue.',steps:['Hold the gold microphone button (the first time, allow the microphone).','Speak, for example \u201cprep fridge 3 degrees\u201d.','Let go to send.','If it reads something back, tap Confirm or hold again and say \u201cyes\u201d.','The button stays at the top right so it never covers the screen.'],showMe:{tab:'more',page:'voice',hint:'Turn the voice button on or off for each role here.'}},{id:'voice-drafts',kind:'faq',topic:'Settings',title:'Where do voice bookings and shopping lists go?',keywords:['drafts','approve','approval','shopping list','booker list','bidfood list','draft booking','offer','event'],body:'To Settings \u203a Drafts for approval. Bookings, supplier lists, offers, events and specials made by voice wait there for an owner or manager. Approving marks it approved and opens the right screen; you still place the order or confirm the booking yourself.',showMe:{tab:'more',page:'drafts',hint:'Drafts from the voice helper wait here.'}},{id:'voice-temps',kind:'guide',topic:'Settings',title:'Log fridge and freezer temperatures by voice',keywords:['temperature','fridge','freezer','haccp','food safety','eho','log temps','probe'],body:'Hold the voice button and say the unit and the number, for example \u201cprep fridge 3, freezer minus 19\u201d. Fridges should be 5\xb0C or colder and freezers -18\xb0C or colder; anything outside is flagged. Everything is in the Food safety log with who and when, ready to export or print for the EHO.',showMe:{tab:'more',page:'haccp',hint:'Every voice reading appears in the food safety log.'}},{id:'voice-fair-usage',kind:'faq',topic:'Settings',title:'Is there a limit on voice tasks?',keywords:['voice','limit','allowance','fair usage','fair use','how many','tasks','month','plan'],body:'Fair usage: 1,000 voice tasks a month per venue. It is one allowance shared by all of the venue\u2019s apps and devices, and it resets on the 1st. Each request counts once, spoken or typed; saying \u201cyes\u201d to confirm does not count again. You will see a note at 80%. If the venue reaches 1,000, the voice helper pauses until the 1st, except food safety and temperature logging, which always works. The owner can contact CoverCharge if you need more. See the count in Plan & billing or Settings \u203a Voice helper.',showMe:{tab:'more',page:'voice',hint:'This month\u2019s voice task count is shown here.'}},{id:'adv-bookings',kind:'guide',topic:'Settings',title:'Booking questions: allergies, dogs, access, vegan',keywords:['advanced','allergen','dog','dogs','cap','wheelchair','access','vegan','vegetarian','table request','settings'],body:'Choose what guests are asked when they book. Allergies are always asked first, in red, and staff tick \u201cAllergens seen\u201d. The others can be switched off.',steps:['Open More \u203a Settings \u203a Advanced.','In Bookings, tick or untick each question.','Use the dog stepper to cap dogs per booking time (No limit = only the dog-friendly tables).','Mark dog-friendly and step-free tables on the Table plan.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-bookings'},hint:'Booking questions are here.'}},{id:'adv-table-times',kind:'guide',topic:'Settings',title:'How long tables stay (table times)',keywords:['advanced','dwell','table time','turn','how long','next table free','minutes'],body:'Usual table times by party size: 90 min for 1\u20132 covers, 105 for 3\u20135, 2 hours for 6\u201319 and 3 hours for 20 or more. The app fine-tunes them from how long your tables really stay, and uses them for \u201cNext table free\u201d.',steps:['Open More \u203a Settings \u203a Advanced \u203a Table times.','Tap \u2212 or + to change a band by 5 minutes.','Untick \u201cFine-tune\u201d to use your numbers exactly.','Reset to default puts the four bands back.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-times'},hint:'Table times are here.'}},{id:'adv-reservable',kind:'guide',topic:'Settings',title:'Seafood platter, crab and lobster reservations',keywords:['advanced','platter','seafood','crab','lobster','reserve','price'],body:'Guests can reserve the Seafood Platter (1 crab + 1 lobster, \xa3160) or a crab or lobster with their booking. Reserved ones come off the Display count with a \u201cReserved\u201d line, the kitchen is told, and the Head Chef taps OK.',steps:['Open More \u203a Settings \u203a Advanced \u203a Reservable items.','Tick what guests can reserve and set the price.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-reserve'},hint:'Reservable items are here.'}},{id:'adv-events',kind:'guide',topic:'Settings',title:'Regular events like Open Mic Night',keywords:['advanced','open mic night','music night','event','regular','monthly','promote','busier','last food'],body:'Add events that repeat, e.g. Open Mic Night on the last Sunday of every month from 8pm with last food orders at 7pm. They show in Forecast key dates with a Promote button and on Today, and \u201cExpect busier\u201d raises the forecast.',steps:['Open More \u203a Settings \u203a Advanced \u203a Regular events.','Tap Add a regular event (or Edit).','Pick how it repeats and the day, add a start time and last food orders if needed.','Tap Save event.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-events'},hint:'Regular events are here.'}},{id:'adv-hours',kind:'guide',topic:'Settings',title:'Kitchen hours, seasons and special days',keywords:['advanced','hours','kitchen','season','winter','summer','special day','closed','last food orders','cutoff'],body:'Kitchen (food) hours decide which booking times are offered; the closing time is last food orders. Keep Winter and Summer hours, each with the date it starts every year, and the app switches by itself. Add special days for one-off changes.',steps:['Open More \u203a Settings \u203a Advanced \u203a Kitchen hours.','Tap Set Summer hours, fill in each day and the start date (e.g. 04-01 for 1 April).','Set the Winter start date too.','Use Add a special day for closures or late nights.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-hours'},hint:'Kitchen hours and seasons are here.'}},{id:'adv-home',kind:'faq',topic:'Settings',title:'Covers counter, Next table free and takeaway on home screens',keywords:['advanced','covers counter','takeaway','next table free','home','display','flip'],body:'Turn the COVERS counter and the \u201cNext table free\u201d card on or off, and choose whether takeaway figures show on home screens (off at the Anchorage). Takeaway order alerts always work. The flap click sound is set on each Display.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-home'},hint:'Display and home options are here.'}},{id:'adv-holidays',kind:'faq',topic:'Settings',title:'Why don\u2019t bank holidays say \u201c(substitute day)\u201d?',keywords:['advanced','holiday','substitute','bank holiday'],body:'The date already shows when a holiday moves, so the extra words are hidden. Tick \u201cShow full gov.uk names\u201d in Settings \u203a Advanced \u203a Holiday names to bring them back.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-holidays'},hint:'Holiday names are here.'}},{id:'adv-blocks',kind:'guide',topic:'Settings',title:'Lunch and dinner times for Block now',keywords:['block','lunch','dinner','service','wix','advanced','pause'],body:'Settings \u203a Advanced \u203a Block bookings sets when Lunch and Dinner run, for the Block now buttons and Spend per head. At The Anchorage, blocks also close those times on website bookings, and blocks made on the website show in CoverCharge. Website bookings can only close the whole venue, not one area or some tables.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-blocks'},hint:'Block bookings settings are here.'}},{id:'blocks-screen',kind:'guide',topic:'Bookings',title:'Block bookings: today, a future date, an area or some tables',keywords:['block','blocks','pause','close','closed','stop bookings','private','repeat','future'],body:'Tap Block bookings on the home screen. Block now pauses bookings today (Rest of today, Next hour, Lunch, Dinner, or a From\u2013To). Add a block closes a future date or range, the whole day or set times, the whole venue, one area or some tables, once or every week or on the last weekday of the month. Every future block is listed by month with Edit and Remove; removing asks first and is logged. Bookings already made are kept, and you are told how many.',showMe:{tab:'more',page:'blocks',target:{testID:'blocks-screen'},hint:'Block bookings is here.'}},{id:'spend-per-head',kind:'guide',topic:'Money',title:'Spend per head',keywords:['spend per head','sph','average spend','takings','covers','gross'],body:'Spend per head is Gross takings \xf7 Covers, by day, by week and for lunch and dinner. Enter the gross on the cash up (Enter the cash up, Upload a spreadsheet, or Enter takings). Covers are seated and finished bookings and walk-ins; no-shows and cancellations are left out. A day with no takings shows \u201cNo takings entered\u201d, never \xa30.',showMe:{tab:'more',page:'spendhead',target:{testID:'sph-screen'},hint:'Spend per head is here.'}},{id:'cashup-photo',kind:'guide',topic:'Money',title:'Enter the cash up, or upload a spreadsheet',keywords:['cash up','paid out','spreadsheet','csv','excel','xlsx','sheet','gross','card','cash','tips','takings','drawer'],body:'In Cash up & sales tap Enter the cash up and type the figures (Z total, card, cash, paid outs, tips, and gross if you have it). In Paid out, add a line for each amount taken from the till \u2014 for example lobsters or supermarket shopping \u2014 with the amount, an optional note, and your name. The paid-out total comes off the expected cash in the drawer. Check every figure, then tap Confirm and save. Bigger venues can tap Upload a spreadsheet (CSV or Excel): match the columns, check the preview (dates already saved are flagged), then confirm. Nothing is saved before you confirm, and every save is logged. You can export cash ups as a spreadsheet from Recent cash ups.',showMe:{tab:'more',page:'cashup',target:{testID:'cashup-by-hand'},hint:'Start the cash up here.'}},{id:'adv-giftqr',kind:'guide',topic:'Settings',title:'Buy a gift card on the Display',keywords:['gift','gift card','voucher','qr','display','wix','advanced'],body:'Switch on \u201cShow Buy a gift card on the Display\u201d in Settings \u203a Advanced \u203a Gift cards on the Display, and save your gift card page address. The Display has a Gift vouchers button: it opens the list of website vouchers (search, use by dates, Mark as used), with Show the buy QR code at the bottom. Guests buy on your website.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-giftqr'},hint:'Gift cards on the Display are here.'}},{id:'adv-whatsapp',kind:'guide',topic:'Settings',title:'WhatsApp buttons (tap to chat)',keywords:['whatsapp','wa.me','message','chat','guest','mobile','number','advanced'],body:'Put the venue\u2019s WhatsApp number in Settings \u203a Advanced \u203a WhatsApp, e.g. 01292 500123 or +44 7700 900123. Guests then see \u201cMessage us on WhatsApp\u201d on their booking confirmation, with their booking details typed in. Staff and managers see \u201cWhatsApp guest\u201d on bookings with a mobile number, with a confirmation typed in that you can change. Nothing is ever sent for you: WhatsApp opens and you tap Send yourself. Leave the number blank and every WhatsApp button stays hidden. Reset to default clears the number.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-whatsapp'},hint:'The WhatsApp number is here.'}},{id:'adv-reminders',kind:'guide',topic:'Settings',title:'Staff reminders: breaks and \u201cchairs up\u201d',keywords:['reminder','reminders','break','breaks','chairs','closing','6 hours','law','snooze','later','done','advanced'],body:'Reminders slide up for staff who are on shift right now (clocked in, or on the rota at that time) in the Staff and Head Chef apps, while the app is open. Break reminders: if the rota shift has a break time, the reminder comes at that time; if not, it comes 4 hours after they clock in (or after the shift starts). If they still haven\u2019t started a break it comes once more 30 minutes later, and again at 6 hours, because UK law says a shift over 6 hours needs a 20-minute break. \u201cStart break\u201d starts their break; \u201cLater\u201d hides it for 15 minutes. You can change these times. Venue reminders, such as \u201cTime to put the chairs up on the tables\u201d (Friday and Sunday, 21:00), have wording, days, a time (UK) and who sees them: everyone on shift, front of house or kitchen. Pause, edit or delete any of them, or add your own. Once anyone taps Done it goes for everyone that day, and the Reminders screen shows who did it. Reset to default brings back the standard break times and \u201cchairs up\u201d; your own reminders stay. Phones with the app closed don\u2019t get reminders yet.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-reminders'},hint:'Reminders are here.'}},{id:'adv-notifications',kind:'guide',topic:'Settings',title:'Scheduled notifications (e.g. the Mills milk order)',keywords:['notification','notifications','push','phone','milk','mills','pieroni','pieronis','veg','olsen','rota upload','scheduled','advanced'],body:'Settings \u203a Advanced \u203a Notifications lists reminders that go to named people at a set UK time, such as \u201cMills milk order\u201d for the Head Chef and Gordon. Each has a title, a message, the days, a time (you can set a different time on some days, e.g. 20:55 on Fridays), who gets it (tick people or pick a group like Everyone on shift) and how it is sent. In the app it is the gold slider with Done and Later; Done is logged with the name and time, and Later hides it for 15 minutes. Urgent notices (like the 6-hour break) always come first and only one shows at a time. Phone notifications: each person taps \u201cTurn on phone notifications\u201d on their own phone (iPhone: add the app to the Home Screen first, iOS 16.4 or later). Nothing goes to phones until an owner or manager switches \u201cSend to phones\u201d on. The Display never gets these. Reset to default restores the configured rules.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-notifications'},hint:'Notifications are here.'}},{id:'adv-order-lists',kind:'guide',topic:'Settings',title:'Order lists (Alsons, Cash and carry)',keywords:['order list','orders','alsons','drinks','cash and carry','trip','shopping','logo','carry over','advanced'],body:'Order lists collect what you need from a supplier. A running list (Alsons drinks) fills up until you order; a trip list (Cash and carry) is for a shopping day, Friday by default, which you can change for each trip. Add an item with a quantity and unit and an optional note; the app records who added it and when. Adding something already on the list offers to add to the quantity instead. On the day, tick Got or Ordered, or mark Missing / not in stock. Finish order saves it to History (date and who) and asks whether to carry over anything not got. Removing an item can be undone. Settings \u203a Advanced \u203a Order lists: add, rename or archive lists, the default trip day, and \u201cLet all staff add items\u201d (on: staff can add and see lists; only managers and the Head Chef tick, remove or finish). Each list can have a logo (take a photo or choose one) or shows its initials, and a phone number to tap to call (never called for you).',showMe:{tab:'more',page:'advanced',target:{testID:'adv-orderlists'},hint:'Order list settings are here.'}},{id:'adv-clock-area',kind:'guide',topic:'Settings',title:'Clock-in area, forgotten breaks and off-rota arrivals',keywords:['clock','clock in','geofence','location','area','radius','break','forgot','rota','visiting','override','advanced'],body:'Clock in, clock out, start break and end break only work at the venue once the centre is set. Stand in the middle of the venue and tap \u201cUse my current location\u201d, then choose how far (at least 50 m, 100 m to start). Phones are not exact, so up to 50 m of the phone\u2019s own accuracy is allowed on top. Each clock record keeps the reading, its accuracy and whether it was inside. If location is off or blocked, the app says how to allow it. Managers can record it for someone from Clock in / out \u203a Record it for someone, with a reason that is logged. Until the centre is set nobody is blocked and managers see a warning. Rota and pay screens are never blocked. Forgotten breaks: if no break was recorded, Clock out asks \u201cDid you take a break? If so, how long?\u201d; a length you pick is saved as a break marked \u201cadded at clock-out\u201d, which managers see and can edit in Hours. Not on the rota: if someone is at the venue, not clocked in and not on the rota, the Staff and Head Chef apps ask \u201cDo you want to sign in?\u201d. Yes clocks them in, marked off-rota, and managers get a notice; \u201cNo, just visiting\u201d stops asking for the day. This only checks while the app is open; web apps can\u2019t watch location in the background.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-clockarea'},hint:'Clock-in area settings are here.'}},{id:'adv-tablegrid',kind:'guide',topic:'Table plan',title:'Table plan grid and Tidy up (Advanced)',keywords:['grid','snap','line up','align','tidy','guides','spacing','restore','table plan','option','alt'],body:'Tables snap to the grid when you drag them, and gold guides show when an edge or centre lines up with another table. A small number shows when the gaps either side are even. Hold Alt (Option on a Mac) to move freely. Tidy up lines every table up on the grid and evens out the rows; only positions change. The old positions are kept, so one tap puts them back.',steps:['Go to Settings \u203a Advanced.','Find Table plan grid.','Turn snapping on or off, pick a grid size, or tap Tidy up the whole plan.','Changed your mind? Tap Put the tables back where they were.']},{id:'adv-printers',kind:'guide',topic:'Orders',title:'Kitchen ticket printers (Advanced)',keywords:['print','printer','printing','ticket','kitchen ticket','docket','receipt','epson','star','bluetooth','reprint','takeaway'],body:'Print a kitchen ticket by itself for every takeaway order, as soon as it comes in or when it is accepted. The ticket has the order number, collection time, name, every dish with its options and notes, allergies in white-on-black, and paid or not paid. Works with Epson (TM-m30, TM-T20, TM-T88), Star WebPRNT, most other network receipt printers (port 9100) and Bluetooth printers from the tablet app. If a ticket does not print, an amber warning shows and the order stays on screen.',steps:['Go to Settings \u203a Advanced.','Find Printers.','Tap Add a printer by IP address or Find printers on this Wi-Fi, choose the type and tap Test print.','Turn on Print a kitchen ticket for every takeaway order.']},{id:'adv-deposits',kind:'guide',topic:'Bookings',title:'Deposits (Advanced)',keywords:['deposit','deposits','per person','per adult','children','waive','waived','regular','party size','refund','refundable','cut off','policy','paid','due'],body:'Ask bigger tables for a deposit: set the amount per adult (children never pay: a table of 8 with 3 children pays for 5), the smallest party that pays one, whether it is refundable and up to how many hours before, and the words guests see. No card is saved in CoverCharge. Deposits are paid through website bookings: website bookings show Deposit paid on website bookings, Part paid on website bookings or Deposit not paid by themselves. For phone and walk-in bookings, staff tick Deposit paid once the guest has paid you, or (once switched on) press Send deposit link to send a website bookings pay link by text, WhatsApp or email. Refunds are done in Website bookings \u203a Orders. Deposit amounts are shown on bookings in Managers, Display and Staff. Other financial and HR information remains restricted.',steps:['Go to Settings \u203a Advanced.','Find Deposits.','Turn deposits on or off, and set the amount, party size, refund terms and the words guests see.','On a booking, tap Mark deposit paid once the guest has paid.','To let a regular off, tap Waive deposit on the booking (or in Edit booking), add why if you like, and tap Yes, waive it. Your name is saved with it.']},{id:'adv-loyalty',kind:'guide',topic:'Guests',title:'Loyalty: stamp card, offers & bring a friend (Advanced)',keywords:['loyalty','stamp','stamps','card','reward','offer','offers','referral','friend','expiry'],body:'The stamp card, offers and bring-a-friend are saved on the server, so every phone and tablet shows the same card. Set how many stamps earn a reward, what the reward is, when stamps or rewards run out, and how often one guest can get a stamp. Stamps only come from staff, or from a code or QR staff make, and each reward can be used once. Guests join with their agreement recorded, and a manager can remove a guest and their details.',steps:['Go to Settings \u203a Advanced.','Find Loyalty.','Turn the stamp card on, write the reward and tap Save loyalty settings.','Add offers with their dates, and turn bring-a-friend on if you want it.']},{id:'adv-table-order',kind:'guide',topic:'Guests',title:'Order at the table (Advanced)',keywords:['order at table','qr','qr code','scan','table','phone','accept','last orders','print','pdf','pay at bar'],body:'Guests scan the small QR card on their table (Managers \u203a Table QR codes prints them, 20 to a page), see your menu with allergens, and send an order. It lands in Front of House and on the kitchen screen within seconds. Prices, sold-out dishes and hours are checked on the server, so a phone can\u2019t change them. Staff accept the first order from each new phone (you can turn this off). Guests pay at the bar or with their server; paying by card from the phone is coming later.',steps:['Go to Settings \u203a Advanced.','Find Order at the table.','Turn it on, pick the areas or tables, set the hours and tap Save order at the table.','Tap Make codes, pick Stickers 50 \xd7 50 mm or Stand cards 50 \xd7 70 mm, then Print all QR cards (PDF) and put each code on its table.']},{id:'adv-soldout',kind:'guide',topic:'Menu',title:'Sold out reminders (Advanced)',keywords:['sold out','86','clear','end of service','next morning','back on','advanced','display strip','automatic','counts','lobster','crab'],body:'Choose when sold out dishes go back on by themselves: when the kitchen closes (from your Kitchen hours), the next morning (pick the time), or only when someone taps Back on. \u201cMark dishes sold out from the counts\u201d (on unless you turn it off) marks every dish that uses a counted item, like lobster or crab, when the count runs out, and puts it back on when the count is back up. Sold out is a reminder for staff on the Display and in the staff apps; it doesn\u2019t change your till.',steps:['Go to Settings \u203a Advanced.','Find Sold out reminders.','Pick when they clear, and turn marking from the counts on or off.']},{id:'sold-out-auto',kind:'guide',topic:'Menu',title:'Sold out from the counts (lobster, crab\u2026)',keywords:['sold out','automatic','auto','counts','shellfish','lobster','crab','platter','link','uses','none left'],body:'When a counted item runs out, or drops below what a dish needs, every dish that uses it is marked sold out by itself, with the reason: \u201cDeluxe Seafood Platter (no lobster or crab)\u201d. When the count is back up (a delivery or a recount), those dishes go back on by themselves. Dishes marked by hand are left alone. CoverCharge works out what each dish uses from its recipe card, its description (\u201cone whole lobster\u201d) or its name; you can change it for any dish. If you tap Back on while the count is still short, the dish stays on until the count changes.',steps:['Open the Sold out list.','Under Dishes linked to the counts, tap Change next to a dish.','Set how many of each item one portion uses (0 = not linked), then tap Save. Back to automatic undoes it.'],showMe:{tab:'more',page:'soldout',target:{testID:'soldout-links'},hint:'Tap Change next to a dish to set what it uses.'}},{id:'adv-forecast',kind:'guide',topic:'Forecasts',title:'Forecast history and "Not enough history yet"',keywords:['forecast','not enough history','history','estimate','example figures','labour','sales','walk-ins','advanced'],body:'Forecasts are built only from your own bookings, seated walk-ins, takeaway orders and cash-ups. Until CoverCharge has enough of your history (2 weeks to start with; change it in Settings \u203a Advanced \u203a Forecast history) you see \u2018Not enough history yet\u2019, what is already booked and your real labour cost from the rota, with no sales forecast or labour %. No history is invented for a live venue.',steps:['Go to Settings \u203a Advanced.','Find Forecast history.','Pick how many weeks are needed.']},{id:'adv-checkout',kind:'guide',topic:'Team',title:'Shift check-out, question board and team morale',keywords:['check out','checkout','morale','mood','staffing','overstaffed','survey','anonymous','question board','vote','shout out','wellbeing','advanced'],body:'When someone clocks out, they get a quick card: team morale from Low to High, and whether there was enough staff for the customers. They can also post a question for the board or shout out a teammate, or tap Skip. Nothing shows at clock in. Answers are anonymous: no name or staff number is saved, and each phone can answer a shift once. Team morale (Managers app \u203a More \u203a Team morale) shows a day only once 3 or more people have answered, next to that day\u2019s covers. Change the wording or switch parts off here.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-checkout'},hint:'Check-out and board settings are here.'}},{id:'hr-board',kind:'guide',topic:'Team',title:'The anonymous question board',keywords:['question board','board','anonymous','vote','yes no','reply','hide','moderation','log'],body:'Anyone on the team can post a question and vote it up, or vote Yes or No. No names are shown or saved. Owners and managers can reply (shown as \u201cReply from the managers\u201d) and hide offensive posts with a reason. Every hide, unhide and reply is in the Moderation log.',showMe:{tab:'more',page:'board',hint:'The question board.'}},{id:'adv-tasks',kind:'guide',topic:'Team',title:'Daily tasks',keywords:['tasks','daily tasks','checklist','duties','jobs','to do','my tasks','library','head chef'],body:'Give each person a short list of daily tasks: open Staff & roles, tap Daily tasks on their card, then pick from the venue\u2019s task library or type a new one. Use the arrows to reorder, \u2715 to remove (with Undo) and Days to limit a task to certain days. They see \u201cMy tasks today\u201d on their home screen and tick each one off while on shift; each tick records who and when, and you see \u201c2 of 5 done today\u201d on their card. Lists start fresh every day. Owners and managers can change anyone\u2019s list, including the Head Chef\u2019s. The Head Chef can change the lists of kitchen staff (chefs, commis and KPs) from Kitchen \u203a Kitchen team tasks, but not their own and not front of house. The task library is in Settings \u203a Advanced \u203a Tasks.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-tasks'},hint:'The task library is here.'}},{id:'adv-cashup',kind:'guide',topic:'Money',title:'Cash up and weekly sales',keywords:['cash up','cashup','takings','float','till','sales report','weekly sales','pos','printout','photo','graphs','charts'],body:'At the end of the night open Cash up & sales and tap Enter the cash up. Type each figure; boxes left blank stay blank (never counted as zero) and are highlighted in amber. Add any cash paid out of the till (lobsters, supermarket shopping, and the like) in the Paid out section: each line has what it was for, the amount, an optional note and who entered it. The total reduces the expected cash in the drawer. Nothing is saved until you tap Confirm and save. Do the same with the weekly sales report from the till (several pages is fine). The graphs show daily takings, tips, weekly net sales against the week before and sales by category. Owners and managers can enter and change cash ups; the Head Chef can see the graphs if they are allowed to see takings. Change the boxes to match your sheet in Settings \u203a Advanced \u203a Cash up; Cash tips total and Card tips total are always kept.',showMe:{tab:'more',page:'cashup',target:{testID:'cashup-by-hand'},hint:'Start the cash up here.'}},{id:'adv-tips',kind:'guide',topic:'Money',title:'Today\u2019s tips and the Tips pot',keywords:['tips','today tips','tips pot','pot','payout','tip pay','correction','coins'],body:'When a cash up with Cash tips total and Card tips total is confirmed, the team\u2019s combined tips for that day show as Today\u2019s tips in every staff app and on the Display, with a short notice. The Tips pot adds up confirmed daily tips since the last payout (fortnightly tip pay). After paying the tips, an owner or manager taps Mark payout done on the Tips pot card: the pot goes back to \xa30.00 and the old pot is kept in Past pots. Use Correct an entry to add or take off an amount for a day; a reason is required and every correction is logged with your name. Only the team total is ever shown, never anyone\u2019s share. Hide either card in Settings \u203a Advanced \u203a Tips.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-tips'},hint:'Show or hide the tips cards here.'}},{id:'manager-access',kind:'guide',topic:'Team',title:'Manager access',keywords:['manager access','manager','access','role','promote','front of house','head chef','owner'],body:'In Staff & roles each person has a Manager access switch. On: they use the Manager app (rota, bookings, staff, hours, settings, plus their own clock in, rota and pay). Off: they use the Front of House app, or the Head Chef app for the Head Chef. Owners can switch anyone except owners; managers can switch anyone except themselves and owners. The last owner can never be removed. You confirm each change; it is logged with who and when (Access changes). Job titles are free text and don\u2019t change.',showMe:{tab:'more',page:'staff',target:{testID:'access-tip'},hint:'Manager access switches are on each person.'}},{id:'next-table-free',kind:'faq',topic:'Walk-ins',title:'When is the next table free?',keywords:['next table','free','wait','walk-in','quote','full'],body:'When you\u2019re full, Today and the Display show \u201cNext table free about 19:40 (T6, 4 seats)\u201d with \u201clikely\u201d or \u201cmaybe\u201d, and how long a walk-in for 2 or 4 would wait. Tap Bill requested or Table finished on the plan and it updates. You can also ask the Assistant \u201cwhen\u2019s the next table free?\u201d.'},{id:'time-travel',kind:'faq',topic:'Today',title:'Look at another day (time travel)',keywords:['yesterday','tomorrow','next week','past','future','day','time travel'],body:'On Today, tap \u2039 or \u203a beside the date to step a day back or forward. You\u2019ll see that day\u2019s kitchen hours, events, covers (booked, or how it went), platters and each booking\u2019s allergens and needs. It\u2019s read-only and nothing changes live service. Tap Today to come back. The Display goes back to today by itself after 2 minutes. Staff can look 7 days back and 14 days ahead.'},{id:'sign-in-links',kind:'guide',topic:'Team',title:'Personal sign-in links',keywords:['link','invite','sign in','new link','expired','already used','phone','login'],body:'Each personal link works on one phone only and lasts 5 days, so nobody else can sign in as that person. The same phone can open it again, in any of the apps. If someone gets a new phone, or their link has expired, open Staff & roles, tap New sign-in link on their entry, then Copy link and send it to them yourself. The app never sends it. Owners can make links for anyone; managers for anyone except owners. Their old unused link stops working; phones already signed in stay signed in.',showMe:{tab:'more',page:'staff',target:{testID:'access-tip'},hint:'New sign-in link is on each person.'}},{id:'pins-security',kind:'faq',topic:'Team',title:'PINs for the Display',keywords:['pin','display pin','clock in','wake pin','2580','manager pin','locked'],body:'Staff PINs for clocking in at the Display are 4 to 8 digits. Managers and owners need 6 to 8 digits, because their PIN can add temp staff. Easy PINs such as 1111 or 1234 are refused. Five wrong tries locks that person for 15 minutes; 20 wrong tries on one Display stops it for 15 minutes. The Display wake PIN (Settings \u203a Display) is 6 to 8 digits and is kept only as a scrambled hash. If it still says 2580, change it.'},{id:'cash-up-lock',kind:'faq',topic:'Money',title:'Correcting a signed-off cash up',keywords:['cash up','locked','unlock','correct','mistake','history','audit','sales report'],body:'Once a cash up or weekly sales report is confirmed and saved, it is locked so the figures can\u2019t change quietly. An owner taps Unlock to correct on it, says why, and has 30 minutes to fix it. History on each one shows who signed it off, changed or unlocked it, and when.'},{id:'wipe-device',kind:'faq',topic:'Settings',title:'Sign out and wipe a shared tablet or phone',keywords:['wipe','sign out','shared','tablet','leaver','lost','reset device'],body:'Tap the sync badge (bottom left), or go to Settings \u203a Display, and choose Sign out and wipe this device. It signs out and removes everything CoverCharge keeps on that device: sign-ins, pairing, saved screens and changes not sent yet. The venue\u2019s shared data is not touched. On the Display you type the wake PIN first.'}],o=t=>a.find(a=>a.id===t)},1486,[]); +__d(function(g,r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"HELP_TOPICS",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"HELP",{enumerable:!0,get:function(){return a}}),Object.defineProperty(e,"helpById",{enumerable:!0,get:function(){return o}});const t=['Bookings','Walk-ins','Table plan','Rota','Hours & pay','Tips','Team','Suppliers','Stock','Recipe cards','Displays','Settings','Accounts'],a=[{id:'new-booking',kind:'guide',topic:'Bookings',title:'Take a phone booking',keywords:['booking','reservation','book','table','phone','covers','reserve'],body:'Add a booking for a guest who calls or walks up to ask. The app only offers times that are really free.',steps:['Open Bookings (or tap New booking on Today).','Pick the date, time and number of covers.','Add the guest\u2019s name and phone, plus any allergies or notes.','Tap Save. The booking appears on the timeline and the floor plan.'],showMe:{tab:'bookings',target:{testID:'add-booking'},hint:'Tap New booking to start a booking.'}},{id:'move-booking',kind:'faq',topic:'Bookings',title:'How do I move a booking to another table or time?',keywords:['move','change','reschedule','table','booking','swap'],body:'Open the booking from Bookings or the timeline and tap Edit, or drag it to another table on the Display. Guests are not messaged unless you choose to.',showMe:{tab:'bookings',target:{testID:'add-booking'},hint:'Your bookings list is here. Tap a booking to change it.'}},{id:'walk-in',kind:'guide',topic:'Walk-ins',title:'Seat a walk-in',keywords:['walk-in','walkin','walk in','seat','no booking','covers','party'],body:'Record guests who arrive without a booking so the floor plan and covers stay right.',steps:['On the Display (the venue tablet), tap Walk-in. On a phone, say \u201cadd a walk-in for 2\u201d to the Assistant.','Choose the number of covers.','Pick a free table (the best fit is suggested).','Tap Seat. The table shows as seated.'],actions:['add_walkin']},{id:'table-plan',kind:'guide',topic:'Table plan',title:'Edit the table plan',keywords:['table plan','floor plan','layout','tables','move tables','designer','areas','seats'],body:'Drag tables into place, set seats, join tables and add areas such as Terrace or Garden.',steps:['Go to More \u203a Table plan.','Tap Open the designer.','Drag tables, or tap one to change its name and seats.','Tap Save. Displays and bookings use the new plan straight away.'],showMe:{tab:'more',page:'tableplan',target:{testID:'open-designer'},hint:'Open the designer to move tables.'}},{id:'rota',kind:'guide',topic:'Rota',title:'Build and publish the rota',keywords:['rota','shift','schedule','week','publish','staff hours','add shift'],body:'Plan the week, then publish it so staff see their shifts in the Staff app.',steps:['Go to More \u203a Rota.','Tap a person\u2019s day to add a shift (presets: lunch, dinner, double).','New shifts are drafts with a dashed amber border.','Tap Publish when the week is ready. Staff see only published shifts.'],showMe:{tab:'more',page:'rota',target:{testID:'rota-publish'},hint:'Tap a day to add a shift, then Publish here.'},actions:['add_rota_shift','publish_rota']},{id:'rota-copy',kind:'faq',topic:'Rota',title:'Can I copy last week\u2019s rota?',keywords:['copy','last week','repeat','rota','duplicate'],body:'Yes. On the Rota tap Copy last week. The shifts come over as drafts so you can tweak them before publishing.',showMe:{tab:'more',page:'rota',target:{testID:'rota-copy'},hint:'Copy last week\u2019s shifts as drafts.'}},{id:'sign-off',kind:'guide',topic:'Hours & pay',title:'Sign off hours',keywords:['sign off','signoff','confirm hours','approve','timesheet','clock','pending'],body:'Only confirmed hours count for pay and tips. Check clocked times against the rota and confirm them.',steps:['Go to More \u203a Sign off hours.','Flagged days (late, missing clock-out, long breaks) are at the top.','Tap a row to fix a time; give a short reason.','Tap Confirm all unflagged, then deal with the rest.'],showMe:{tab:'more',page:'signoff',target:{testID:'confirm-unflagged'},hint:'Confirm all the days that look right in one tap.'}},{id:'payroll-hours',kind:'guide',topic:'Hours & pay',title:'Export hours for payroll',keywords:['payroll','export','hours','spreadsheet','csv','excel','accountant','copy','print'],body:'Get each person\u2019s confirmed hours for a pay period into your spreadsheet or to your accountant.',steps:['Go to More \u203a Payroll hours.','Pick the pay period (or a tips fortnight, or a custom range).','Check the pending banner: sign those off first if you can.','Tap Copy for spreadsheet and paste into Excel or Google Sheets, or download a CSV, or print.'],showMe:{tab:'more',page:'hours',target:{testID:'copy-tsv'},hint:'Copy, then paste straight into your spreadsheet.'}},{id:'pay-dates',kind:'faq',topic:'Hours & pay',title:'How do I set our pay dates?',keywords:['pay day','payday','pay dates','cut-off','wages','monthly','fortnightly'],body:'Settings \u203a Pay & tips: set when tips are paid and how often, the wage pay day and the cut-off. Payroll hours and Tips day use these dates.',showMe:{tab:'more',page:'paysettings',target:{testID:'save-pay'},hint:'Change the dates above, then Save.'}},{id:'tips-day',kind:'guide',topic:'Tips',title:'Share out tips on tips day',keywords:['tips','tronc','gratuity','share','split','tips day','service charge'],body:'Enter the tips total and it\u2019s shared by confirmed hours for the fortnight, to the penny.',steps:['Go to More \u203a Tips day (the right fortnight is picked for you).','Type the total tips.','Check anyone with pending hours; sign them off first if you can.','Copy or download the split for payroll.'],showMe:{tab:'more',page:'tipsday',target:{testID:'tips-total'},hint:'Type the tips total here.'}},{id:'invites',kind:'guide',topic:'Team',title:'Invite staff to the app',keywords:['invite','link','staff app','new starter','sign in','add staff','team member'],body:'Each person gets their own sign-in link. You choose when and how to share it.',steps:['Go to Settings \u203a Invite links.','Tap Make invite link next to the person.','Share the link yourself (text or WhatsApp). The app never sends it for you.','They tap it once and the Staff app remembers them.'],showMe:{tab:'more',page:'setup-invites',target:{text:'Make invite link'},hint:'Make a personal link, then share it yourself.'}},{id:'suppliers',kind:'guide',topic:'Suppliers',title:'Suppliers and order sheets',keywords:['supplier','order','order sheet','delivery','cut-off','fish','veg','dairy'],body:'Keep supplier contacts, order days and cut-offs together, and log what you ordered.',steps:['Go to More \u203a Suppliers to add or edit a supplier.','Use Supplier order sheets for the items you usually order.','Tap Log an order after you place it by phone or email.'],showMe:{tab:'more',page:'ordersheets',target:{testID:'sheet-add'},hint:'Add an order sheet for a supplier.'}},{id:'display-glance',kind:'guide',topic:'Display',title:'Today at a glance (Display)',keywords:['glance','today','covers by hour','breaks','on now','next','cut-off','cutoff','order times','display bar'],body:'The bar under the Display header shows today in one line: covers by hour (booked in solid gold, the walk-in estimate dashed), quiet times for breaks, who is on now and next, today\u2019s supplier order cut-offs with a countdown (amber under 30 minutes) and one tip. Cut-offs come from Scheduled notifications.'},{id:'sold-out',kind:'guide',topic:'Menu',title:'Sold out dishes',keywords:['sold out','run out','ran out','none left','back on','86','eighty six','display strip'],body:'When a dish runs out, mark it sold out so every member of staff knows. It\u2019s a reminder for staff: CoverCharge doesn\u2019t link up to your till, so it doesn\u2019t change the till. Sold out dishes show in a slim strip along the bottom of the Display within seconds, and in the Sold out list in Front of House, Managers and Head Chef. They clear by themselves when the kitchen closes (or the next morning, or only when you tap Back on: Settings \u203a Advanced \u203a Sold out reminders).',steps:['Open the Sold out list (Managers: More \u203a Sold out; Front of House: Me \u203a Sold out; Head Chef: Kitchen \u203a Live tickets \u203a Sold out).','Tap Mark sold out next to the dish.','When it\u2019s back, tap Back on.'],showMe:{tab:'more',page:'soldout',target:{testID:'soldout-search'},hint:'Find the dish, then tap Mark sold out.'}},{id:'shellfish',kind:'guide',topic:'Stock',title:'Live shellfish (and other) counts',keywords:['shellfish','lobster','crab','oysters','count','stock','tracked','sold out','86'],body:'Counters for things you sell by the unit, like lobster or crab. They show on the Display and warn when low.',steps:['Go to Settings \u203a Tracked stock.','Tap Add an item to track; set the name, icon and low warning.','Staff update the count from the small lobster and crab chip at the top of the Display, or in the app.'],showMe:{tab:'more',page:'trackedstock',target:{text:'Add an item to track'},hint:'Add something to count, like lobster.'}},{id:'recipe-cards',kind:'guide',topic:'Recipe cards',title:'Recipe cards',keywords:['recipe','card','dish','ingredients','method','allergens','spec'],body:'Photo, ingredients, method and allergens for each dish; the head chef signs them off and staff can read them.',steps:['Go to More \u203a Recipe cards.','Search for a dish or add a new one.','Fill in ingredients (allergens are suggested) and the method.','Send for head chef sign-off.'],showMe:{tab:'more',page:'recipecards',target:{testID:'card-search'},hint:'Search your recipe cards here.'}},{id:'display-pair',kind:'guide',topic:'Displays',title:'Pair a display or tablet',keywords:['display','tablet','pair','screen','code','front of house','kitchen screen'],body:'Connect a tablet to your venue with a one-time code. You can switch any display off from here.',steps:['Open the Display app on the tablet.','In Managers go to Settings \u203a Displays and tap Make a pairing code.','Type the code on the tablet. It joins your venue straight away.'],showMe:{tab:'more',page:'displays',target:{text:'Make a pairing code'},hint:'Make a one-time code for the tablet.'}},{id:'settings-hours',kind:'faq',topic:'Settings',title:'How do I change our opening hours?',keywords:['opening hours','hours','closed','open','kitchen hours','times'],body:'Settings \u203a Opening hours. Guests see these on your booking and order pages; bookings outside them are turned away.',showMe:{tab:'more',page:'setup-hours',hint:'Set each day\u2019s opening and closing time here.'}},{id:'replay-setup',kind:'faq',topic:'Settings',title:'Can I see the welcome walkthrough again?',keywords:['welcome','setup','walkthrough','onboarding','checklist','questionnaire'],body:'Yes: Settings \u203a Setup checklist \u203a Replay welcome. Everything is pre-filled from your questionnaire.',showMe:{tab:'more',page:'setupchecklist',target:{testID:'replay-welcome'},hint:'Replay the welcome walkthrough.'}},{id:'connected-accounts',kind:'guide',topic:'Accounts',title:'Connect your email, website and socials',keywords:['connect','account','gmail','outlook','wix','facebook','instagram','square','xero','quickbooks','login'],body:'Settings \u203a Connected accounts: tap a logo, save the account to your list, and use Connect with\u2026 to sign in on that service\u2019s own page (rolling out service by service; it shows Coming soon until then). CoverCharge never sees your password that way, and you can remove an account any time.',steps:['Go to Settings \u203a Connected accounts.','Tap the service\u2019s logo.','Tap Connect with\u2026 and sign in on their page.','To stop, tap Remove.'],showMe:{tab:'more',page:'connections',target:{testID:'conn-tile-gmail'},hint:'Tap a logo to connect that account.'}},{id:'supplier-portals',kind:'guide',topic:'Suppliers',title:'Order from your suppliers',keywords:['bidfood','booker','wholesale','cash and carry','order online','supplier login','account number','customer number'],body:'Settings \u203a Connected accounts \u203a Suppliers. Add supplier links for this venue, with an account number if you like. Open ordering and Log in open the supplier\u2019s own website, where you sign in; CoverCharge never keeps the password.',steps:['Go to Settings \u203a Connected accounts.','Scroll to Suppliers.','Tap Add against a supplier (account number optional).','Tap Open ordering or Log in whenever you need them.','To stop, tap Remove and confirm.'],showMe:{tab:'more',page:'connections',target:{testID:'portal-bidfood'},hint:'Your supplier ordering websites live here.'}},{id:'support',kind:'faq',topic:'Settings',title:'How do I get help from a person?',keywords:['support','help','contact','person','problem','broken','stuck'],body:'Support is free for life. Message the CoverCharge team from Settings \u203a Help, or email us, and we\u2019ll reply. We help by message and email.'},{id:'assistant-safe',kind:'faq',topic:'Settings',title:'Can the Assistant send or pay for things by itself?',keywords:['assistant','safe','confirm','send','pay','delete','ai'],body:'No. The Assistant and the voice helper show you exactly what they will do and wait for you to tap Confirm (or say yes). Anything that would send a message, order from a supplier or pay is only saved as a draft in Drafts for approval; nothing goes out by itself.'},{id:'restaurant-dashboard',kind:'guide',topic:'Bookings',title:'Restaurant dashboard',keywords:['restaurant dashboard','tables','timeline','guests','covers','joined tables'],body:'In Managers, tap Restaurant dashboard on Home, or More > Run the day > Restaurant dashboard. It is the same live table plan, Timeline, guest list, deposits, dogs, joined tables, Covers, covers-through-the-day chart and block bookings as the Display. Use the day arrows and Back to today. Assign or join tables on any day; seat, finish, no-show and cancel walk-in actions apply today. You can also say \u201copen Restaurant dashboard\u201d. The helper replies in text only.',showMe:{tab:'more',page:'serviceboard',target:{testID:'restaurant-dashboard-close'},hint:'Restaurant dashboard is open. Pick a day, or tap Back to Managers to close.'}},{id:'voice-helper',kind:'guide',topic:'Settings',title:'Use the hold-to-talk voice button',keywords:['voice','talk','speak','microphone','mic','hold','walkie','button','hands free','gloves'],body:'Hold the big gold button, say what you need, then let go. It logs fridge and freezer temperatures, answers allergen questions, marks dishes sold out, checks tables, adds to the waitlist, reads orders and covers, and drafts bookings, offers, events and supplier lists. The helper replies in text only, never aloud. Changes are shown in text first with Confirm and Cancel buttons: tap Confirm or say yes. Tap the button to type instead (in Managers this also opens the Assistant). It sits at the top right of the header in Managers, Head Chef, the Staff app (the full voice assistant, with no money, tips or HR) and on the Display (no money, tips or HR). Until the voice assistant\u2019s server is switched on, anything new says \u201cVoice assistant is switching on soon\u201d. Fair usage: 1,000 voice tasks a month per venue.',steps:['Hold the gold microphone button (the first time, allow the microphone).','Speak, for example \u201cprep fridge 3 degrees\u201d.','Let go to send.','If it reads something back, tap Confirm or hold again and say \u201cyes\u201d.','The button stays at the top right so it never covers the screen.'],showMe:{tab:'more',page:'voice',hint:'Turn the voice button on or off for each role here.'}},{id:'voice-drafts',kind:'faq',topic:'Settings',title:'Where do voice bookings and shopping lists go?',keywords:['drafts','approve','approval','shopping list','booker list','bidfood list','draft booking','offer','event'],body:'To Settings \u203a Drafts for approval. Bookings, supplier lists, offers, events and specials made by voice wait there for an owner or manager. Approving marks it approved and opens the right screen; you still place the order or confirm the booking yourself.',showMe:{tab:'more',page:'drafts',hint:'Drafts from the voice helper wait here.'}},{id:'voice-temps',kind:'guide',topic:'Settings',title:'Log fridge and freezer temperatures by voice',keywords:['temperature','fridge','freezer','haccp','food safety','eho','log temps','probe'],body:'Hold the voice button and say the unit and the number, for example \u201cprep fridge 3, freezer minus 19\u201d. Fridges should be 5\xb0C or colder and freezers -18\xb0C or colder; anything outside is flagged. Everything is in the Food safety log with who and when, ready to export or print for the EHO.',showMe:{tab:'more',page:'haccp',hint:'Every voice reading appears in the food safety log.'}},{id:'voice-fair-usage',kind:'faq',topic:'Settings',title:'Is there a limit on voice tasks?',keywords:['voice','limit','allowance','fair usage','fair use','how many','tasks','month','plan'],body:'Fair usage: 1,000 voice tasks a month per venue. It is one allowance shared by all of the venue\u2019s apps and devices, and it resets on the 1st. Each request counts once, spoken or typed; saying \u201cyes\u201d to confirm does not count again. You will see a note at 80%. If the venue reaches 1,000, the voice helper pauses until the 1st, except food safety and temperature logging, which always works. The owner can contact CoverCharge if you need more. See the count in Plan & billing or Settings \u203a Voice helper.',showMe:{tab:'more',page:'voice',hint:'This month\u2019s voice task count is shown here.'}},{id:'adv-bookings',kind:'guide',topic:'Settings',title:'Booking questions: allergies, dogs, access, vegan',keywords:['advanced','allergen','dog','dogs','cap','wheelchair','access','vegan','vegetarian','table request','settings'],body:'Choose what guests are asked when they book. Allergies are always asked first, in red, and staff tick \u201cAllergens seen\u201d. The others can be switched off.',steps:['Open More \u203a Settings \u203a Advanced.','In Bookings, tick or untick each question.','Use the dog stepper to cap dogs per booking time (No limit = only the dog-friendly tables).','Mark dog-friendly and step-free tables on the Table plan.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-bookings'},hint:'Booking questions are here.'}},{id:'adv-table-times',kind:'guide',topic:'Settings',title:'How long tables stay (table times)',keywords:['advanced','dwell','table time','turn','how long','next table free','minutes'],body:'Usual table times by party size: 90 min for 1\u20132 covers, 105 for 3\u20135, 2 hours for 6\u201319 and 3 hours for 20 or more. The app fine-tunes them from how long your tables really stay, and uses them for \u201cNext table free\u201d.',steps:['Open More \u203a Settings \u203a Advanced \u203a Table times.','Tap \u2212 or + to change a band by 5 minutes.','Untick \u201cFine-tune\u201d to use your numbers exactly.','Reset to default puts the four bands back.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-times'},hint:'Table times are here.'}},{id:'adv-reservable',kind:'guide',topic:'Settings',title:'Seafood platter, crab and lobster reservations',keywords:['advanced','platter','seafood','crab','lobster','reserve','price'],body:'Guests can reserve the Seafood Platter (1 crab + 1 lobster, \xa3160) or a crab or lobster with their booking. Reserved ones come off the Display count with a \u201cReserved\u201d line, the kitchen is told, and the Head Chef taps OK.',steps:['Open More \u203a Settings \u203a Advanced \u203a Reservable items.','Tick what guests can reserve and set the price.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-reserve'},hint:'Reservable items are here.'}},{id:'adv-events',kind:'guide',topic:'Settings',title:'Regular events like Open Mic Night',keywords:['advanced','open mic night','music night','event','regular','monthly','promote','busier','last food'],body:'Add events that repeat, e.g. Open Mic Night on the last Sunday of every month from 8pm with last food orders at 7pm. They show in Forecast key dates with a Promote button and on Today, and \u201cExpect busier\u201d raises the forecast.',steps:['Open More \u203a Settings \u203a Advanced \u203a Regular events.','Tap Add a regular event (or Edit).','Pick how it repeats and the day, add a start time and last food orders if needed.','Tap Save event.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-events'},hint:'Regular events are here.'}},{id:'adv-hours',kind:'guide',topic:'Settings',title:'Kitchen hours, seasons and special days',keywords:['advanced','hours','kitchen','season','winter','summer','special day','closed','last food orders','cutoff'],body:'Kitchen (food) hours decide which booking times are offered; the closing time is last food orders. Keep Winter and Summer hours, each with the date it starts every year, and the app switches by itself. Add special days for one-off changes.',steps:['Open More \u203a Settings \u203a Advanced \u203a Kitchen hours.','Tap Set Summer hours, fill in each day and the start date (e.g. 04-01 for 1 April).','Set the Winter start date too.','Use Add a special day for closures or late nights.'],showMe:{tab:'more',page:'advanced',target:{testID:'adv-hours'},hint:'Kitchen hours and seasons are here.'}},{id:'adv-home',kind:'faq',topic:'Settings',title:'Covers counter, Next table free and takeaway on home screens',keywords:['advanced','covers counter','takeaway','next table free','home','display','flip'],body:'Turn the COVERS counter and the \u201cNext table free\u201d card on or off, and choose whether takeaway figures show on home screens (off at the Anchorage). Takeaway order alerts always work. The flap click sound is set on each Display.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-home'},hint:'Display and home options are here.'}},{id:'adv-holidays',kind:'faq',topic:'Settings',title:'Why don\u2019t bank holidays say \u201c(substitute day)\u201d?',keywords:['advanced','holiday','substitute','bank holiday'],body:'The date already shows when a holiday moves, so the extra words are hidden. Tick \u201cShow full gov.uk names\u201d in Settings \u203a Advanced \u203a Holiday names to bring them back.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-holidays'},hint:'Holiday names are here.'}},{id:'adv-blocks',kind:'guide',topic:'Settings',title:'Lunch and dinner times for Block now',keywords:['block','lunch','dinner','service','wix','advanced','pause'],body:'Settings \u203a Advanced \u203a Block bookings sets when Lunch and Dinner run, for the Block now buttons and Spend per head. At The Anchorage, blocks also close those times on website bookings, and blocks made on the website show in CoverCharge. Website bookings can only close the whole venue, not one area or some tables.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-blocks'},hint:'Block bookings settings are here.'}},{id:'blocks-screen',kind:'guide',topic:'Bookings',title:'Block bookings: today, a future date, an area or some tables',keywords:['block','blocks','pause','close','closed','stop bookings','private','repeat','future'],body:'Tap Block bookings on the home screen. Block now pauses bookings today (Rest of today, Next hour, Lunch, Dinner, or a From\u2013To). Add a block closes a future date or range, the whole day or set times, the whole venue, one area or some tables, once or every week or on the last weekday of the month. Every future block is listed by month with Edit and Remove; removing asks first and is logged. Bookings already made are kept, and you are told how many.',showMe:{tab:'more',page:'blocks',target:{testID:'blocks-screen'},hint:'Block bookings is here.'}},{id:'spend-per-head',kind:'guide',topic:'Money',title:'Spend per head',keywords:['spend per head','sph','average spend','takings','covers','gross'],body:'Spend per head is Gross takings \xf7 Covers, by day, by week and for lunch and dinner. Enter the gross on the cash up (Enter the cash up, Upload a spreadsheet, or Enter takings). Covers are seated and finished bookings and walk-ins; no-shows and cancellations are left out. A day with no takings shows \u201cNo takings entered\u201d, never \xa30.',showMe:{tab:'more',page:'spendhead',target:{testID:'sph-screen'},hint:'Spend per head is here.'}},{id:'cashup-photo',kind:'guide',topic:'Money',title:'Enter the cash up, or upload a spreadsheet',keywords:['cash up','paid out','spreadsheet','csv','excel','xlsx','sheet','gross','card','cash','tips','takings','drawer'],body:'In Cash up & sales tap Enter the cash up and type the figures (Z total, card, cash, paid outs, tips, and gross if you have it). In Paid out, add a line for each amount taken from the till \u2014 for example lobsters or supermarket shopping \u2014 with the amount, an optional note, and your name. The paid-out total comes off the expected cash in the drawer. Check every figure, then tap Confirm and save. Bigger venues can tap Upload a spreadsheet (CSV or Excel): match the columns, check the preview (dates already saved are flagged), then confirm. Nothing is saved before you confirm, and every save is logged. You can export cash ups as a spreadsheet from Recent cash ups.',showMe:{tab:'more',page:'cashup',target:{testID:'cashup-by-hand'},hint:'Start the cash up here.'}},{id:'adv-giftqr',kind:'guide',topic:'Settings',title:'Buy a gift card on the Display',keywords:['gift','gift card','voucher','qr','display','wix','advanced'],body:'Switch on \u201cShow Buy a gift card on the Display\u201d in Settings \u203a Advanced \u203a Gift cards on the Display, and save your gift card page address. The Display has a Gift vouchers button: it opens the list of website vouchers (search, use by dates, Mark as used), with Show the buy QR code at the bottom. Guests buy on your website.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-giftqr'},hint:'Gift cards on the Display are here.'}},{id:'adv-whatsapp',kind:'guide',topic:'Settings',title:'WhatsApp buttons (tap to chat)',keywords:['whatsapp','wa.me','message','chat','guest','mobile','number','advanced'],body:'Put the venue\u2019s WhatsApp number in Settings \u203a Advanced \u203a WhatsApp, e.g. 01292 500123 or +44 7700 900123. Guests then see \u201cMessage us on WhatsApp\u201d on their booking confirmation, with their booking details typed in. Staff and managers see \u201cWhatsApp guest\u201d on bookings with a mobile number, with a confirmation typed in that you can change. Nothing is ever sent for you: WhatsApp opens and you tap Send yourself. Leave the number blank and every WhatsApp button stays hidden. Reset to default clears the number.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-whatsapp'},hint:'The WhatsApp number is here.'}},{id:'adv-reminders',kind:'guide',topic:'Settings',title:'Staff reminders: breaks and \u201cchairs up\u201d',keywords:['reminder','reminders','break','breaks','chairs','closing','6 hours','law','snooze','later','done','advanced'],body:'Reminders slide up for staff who are on shift right now (clocked in, or on the rota at that time) in the Staff and Head Chef apps, while the app is open. Break reminders: if the rota shift has a break time, the reminder comes at that time; if not, it comes 4 hours after they clock in (or after the shift starts). If they still haven\u2019t started a break it comes once more 30 minutes later, and again at 6 hours, because UK law says a shift over 6 hours needs a 20-minute break. \u201cStart break\u201d starts their break; \u201cLater\u201d hides it for 15 minutes. You can change these times. Venue reminders, such as \u201cTime to put the chairs up on the tables\u201d (Friday and Sunday, 21:00), have wording, days, a time (UK) and who sees them: everyone on shift, front of house or kitchen. Pause, edit or delete any of them, or add your own. Once anyone taps Done it goes for everyone that day, and the Reminders screen shows who did it. Reset to default brings back the standard break times and \u201cchairs up\u201d; your own reminders stay. Phones with the app closed don\u2019t get reminders yet.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-reminders'},hint:'Reminders are here.'}},{id:'adv-notifications',kind:'guide',topic:'Settings',title:'Scheduled notifications (e.g. the Mills milk order)',keywords:['notification','notifications','push','phone','milk','mills','pieroni','pieronis','veg','olsen','rota upload','scheduled','advanced'],body:'Settings \u203a Advanced \u203a Notifications lists reminders that go to named people at a set UK time, such as \u201cMills milk order\u201d for the Head Chef and Gordon. Each has a title, a message, the days, a time (you can set a different time on some days, e.g. 20:55 on Fridays), who gets it (tick people or pick a group like Everyone on shift) and how it is sent. In the app it is the gold slider with Done and Later; Done is logged with the name and time, and Later hides it for 15 minutes. Urgent notices (like the 6-hour break) always come first and only one shows at a time. Phone notifications: each person taps \u201cTurn on phone notifications\u201d on their own phone (iPhone: add the app to the Home Screen first, iOS 16.4 or later). Nothing goes to phones until an owner or manager switches \u201cSend to phones\u201d on. The Display never gets these. Reset to default restores the configured rules.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-notifications'},hint:'Notifications are here.'}},{id:'adv-order-lists',kind:'guide',topic:'Settings',title:'Order lists (Alsons, Cash and carry)',keywords:['order list','orders','alsons','drinks','cash and carry','trip','shopping','logo','carry over','advanced'],body:'Order lists collect what you need from a supplier. A running list (Alsons drinks) fills up until you order; a trip list (Cash and carry) is for a shopping day, Friday by default, which you can change for each trip. Add an item with a quantity and unit and an optional note; the app records who added it and when. Adding something already on the list offers to add to the quantity instead. On the day, tick Got or Ordered, or mark Missing / not in stock. Finish order saves it to History (date and who) and asks whether to carry over anything not got. Removing an item can be undone. Settings \u203a Advanced \u203a Order lists: add, rename or archive lists, the default trip day, and \u201cLet all staff add items\u201d (on: staff can add and see lists; only managers and the Head Chef tick, remove or finish). Each list can have a logo (take a photo or choose one) or shows its initials, and a phone number to tap to call (never called for you).',showMe:{tab:'more',page:'advanced',target:{testID:'adv-orderlists'},hint:'Order list settings are here.'}},{id:'adv-clock-area',kind:'guide',topic:'Settings',title:'Clock-in area, forgotten breaks and off-rota arrivals',keywords:['clock','clock in','geofence','location','area','radius','break','forgot','rota','visiting','override','advanced'],body:'Clock in, clock out, start break and end break only work at the venue once the centre is set. Stand in the middle of the venue and tap \u201cUse my current location\u201d, then choose how far (at least 50 m, 100 m to start). Phones are not exact, so up to 50 m of the phone\u2019s own accuracy is allowed on top. Each clock record keeps the reading, its accuracy and whether it was inside. If location is off or blocked, the app says how to allow it. Managers can record it for someone from Clock in / out \u203a Record it for someone, with a reason that is logged. Until the centre is set nobody is blocked and managers see a warning. Rota and pay screens are never blocked. Forgotten breaks: if no break was recorded, Clock out asks \u201cDid you take a break? If so, how long?\u201d; a length you pick is saved as a break marked \u201cadded at clock-out\u201d, which managers see and can edit in Hours. Not on the rota: if someone is at the venue, not clocked in and not on the rota, the Staff and Head Chef apps ask \u201cDo you want to sign in?\u201d. Yes clocks them in, marked off-rota, and managers get a notice; \u201cNo, just visiting\u201d stops asking for the day. This only checks while the app is open; web apps can\u2019t watch location in the background.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-clockarea'},hint:'Clock-in area settings are here.'}},{id:'adv-tablegrid',kind:'guide',topic:'Table plan',title:'Table plan grid and Tidy up (Advanced)',keywords:['grid','snap','line up','align','tidy','guides','spacing','restore','table plan','option','alt'],body:'Tables snap to the grid when you drag them, and gold guides show when an edge or centre lines up with another table. A small number shows when the gaps either side are even. Hold Alt (Option on a Mac) to move freely. Tidy up lines every table up on the grid and evens out the rows; only positions change. The old positions are kept, so one tap puts them back.',steps:['Go to Settings \u203a Advanced.','Find Table plan grid.','Turn snapping on or off, pick a grid size, or tap Tidy up the whole plan.','Changed your mind? Tap Put the tables back where they were.']},{id:'adv-printers',kind:'guide',topic:'Orders',title:'Kitchen ticket printers (Advanced)',keywords:['print','printer','printing','ticket','kitchen ticket','docket','receipt','epson','star','bluetooth','reprint','takeaway'],body:'Print a kitchen ticket by itself for every takeaway order, as soon as it comes in or when it is accepted. The ticket has the order number, collection time, name, every dish with its options and notes, allergies in white-on-black, and paid or not paid. Works with Epson (TM-m30, TM-T20, TM-T88), Star WebPRNT, most other network receipt printers (port 9100) and Bluetooth printers from the tablet app. If a ticket does not print, an amber warning shows and the order stays on screen.',steps:['Go to Settings \u203a Advanced.','Find Printers.','Tap Add a printer by IP address or Find printers on this Wi-Fi, choose the type and tap Test print.','Turn on Print a kitchen ticket for every takeaway order.']},{id:'adv-deposits',kind:'guide',topic:'Bookings',title:'Deposits (Advanced)',keywords:['deposit','deposits','per person','per adult','children','waive','waived','regular','party size','refund','refundable','cut off','policy','paid','due'],body:'Ask bigger tables for a deposit: set the amount per adult (children never pay and do not count towards the number that needs one: a table of 8 with 3 children pays nothing; a table of 6 adults, or 7 with 1 child, pays for 6), the smallest number of adults that pays one (6 or more adults at The Anchorage), whether it is refundable and up to how many hours before, and the words guests see. Staff can waive a deposit. No card is saved in CoverCharge. Deposits are paid through website bookings: website bookings show Deposit paid on website bookings, Part paid on website bookings or Deposit not paid by themselves. For phone and walk-in bookings, staff tick Deposit paid once the guest has paid you, or (once switched on) press Send deposit link to send a website bookings pay link by text, WhatsApp or email. Refunds are done in Website bookings \u203a Orders. Deposit amounts are shown on bookings in Managers, Display and Staff. Other financial and HR information remains restricted.',steps:['Go to Settings \u203a Advanced.','Find Deposits.','Turn deposits on or off, and set the amount, party size, refund terms and the words guests see.','On a booking, tap Mark deposit paid once the guest has paid.','To let a regular off, tap Waive deposit on the booking (or in Edit booking), add why if you like, and tap Yes, waive it. Your name is saved with it.']},{id:'adv-loyalty',kind:'guide',topic:'Guests',title:'Loyalty: stamp card, offers & bring a friend (Advanced)',keywords:['loyalty','stamp','stamps','card','reward','offer','offers','referral','friend','expiry'],body:'The stamp card, offers and bring-a-friend are saved on the server, so every phone and tablet shows the same card. Set how many stamps earn a reward, what the reward is, when stamps or rewards run out, and how often one guest can get a stamp. Stamps only come from staff, or from a code or QR staff make, and each reward can be used once. Guests join with their agreement recorded, and a manager can remove a guest and their details.',steps:['Go to Settings \u203a Advanced.','Find Loyalty.','Turn the stamp card on, write the reward and tap Save loyalty settings.','Add offers with their dates, and turn bring-a-friend on if you want it.']},{id:'adv-table-order',kind:'guide',topic:'Guests',title:'Order at the table (Advanced)',keywords:['order at table','qr','qr code','scan','table','phone','accept','last orders','print','pdf','pay at bar'],body:'Guests scan the small QR card on their table (Managers \u203a Table QR codes prints them, 20 to a page), see your menu with allergens, and send an order. It lands in Front of House and on the kitchen screen within seconds. Prices, sold-out dishes and hours are checked on the server, so a phone can\u2019t change them. Staff accept the first order from each new phone (you can turn this off). Guests pay at the bar or with their server; paying by card from the phone is coming later.',steps:['Go to Settings \u203a Advanced.','Find Order at the table.','Turn it on, pick the areas or tables, set the hours and tap Save order at the table.','Tap Make codes, pick Stickers 50 \xd7 50 mm or Stand cards 50 \xd7 70 mm, then Print all QR cards (PDF) and put each code on its table.']},{id:'adv-soldout',kind:'guide',topic:'Menu',title:'Sold out reminders (Advanced)',keywords:['sold out','86','clear','end of service','next morning','back on','advanced','display strip','automatic','counts','lobster','crab'],body:'Choose when sold out dishes go back on by themselves: when the kitchen closes (from your Kitchen hours), the next morning (pick the time), or only when someone taps Back on. \u201cMark dishes sold out from the counts\u201d (on unless you turn it off) marks every dish that uses a counted item, like lobster or crab, when the count runs out, and puts it back on when the count is back up. Sold out is a reminder for staff on the Display and in the staff apps; it doesn\u2019t change your till.',steps:['Go to Settings \u203a Advanced.','Find Sold out reminders.','Pick when they clear, and turn marking from the counts on or off.']},{id:'sold-out-auto',kind:'guide',topic:'Menu',title:'Sold out from the counts (lobster, crab\u2026)',keywords:['sold out','automatic','auto','counts','shellfish','lobster','crab','platter','link','uses','none left'],body:'When a counted item runs out, or drops below what a dish needs, every dish that uses it is marked sold out by itself, with the reason: \u201cDeluxe Seafood Platter (no lobster or crab)\u201d. When the count is back up (a delivery or a recount), those dishes go back on by themselves. Dishes marked by hand are left alone. CoverCharge works out what each dish uses from its recipe card, its description (\u201cone whole lobster\u201d) or its name; you can change it for any dish. If you tap Back on while the count is still short, the dish stays on until the count changes.',steps:['Open the Sold out list.','Under Dishes linked to the counts, tap Change next to a dish.','Set how many of each item one portion uses (0 = not linked), then tap Save. Back to automatic undoes it.'],showMe:{tab:'more',page:'soldout',target:{testID:'soldout-links'},hint:'Tap Change next to a dish to set what it uses.'}},{id:'adv-forecast',kind:'guide',topic:'Forecasts',title:'Forecast history and "Not enough history yet"',keywords:['forecast','not enough history','history','estimate','example figures','labour','sales','walk-ins','advanced'],body:'Forecasts are built only from your own bookings, seated walk-ins, takeaway orders and cash-ups. Until CoverCharge has enough of your history (2 weeks to start with; change it in Settings \u203a Advanced \u203a Forecast history) you see \u2018Not enough history yet\u2019, what is already booked and your real labour cost from the rota, with no sales forecast or labour %. No history is invented for a live venue.',steps:['Go to Settings \u203a Advanced.','Find Forecast history.','Pick how many weeks are needed.']},{id:'adv-checkout',kind:'guide',topic:'Team',title:'Shift check-out, question board and team morale',keywords:['check out','checkout','morale','mood','staffing','overstaffed','survey','anonymous','question board','vote','shout out','wellbeing','advanced'],body:'When someone clocks out, they get a quick card: team morale from Low to High, and whether there was enough staff for the customers. They can also post a question for the board or shout out a teammate, or tap Skip. Nothing shows at clock in. Answers are anonymous: no name or staff number is saved, and each phone can answer a shift once. Team morale (Managers app \u203a More \u203a Team morale) shows a day only once 3 or more people have answered, next to that day\u2019s covers. Change the wording or switch parts off here.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-checkout'},hint:'Check-out and board settings are here.'}},{id:'hr-board',kind:'guide',topic:'Team',title:'The anonymous question board',keywords:['question board','board','anonymous','vote','yes no','reply','hide','moderation','log'],body:'Anyone on the team can post a question and vote it up, or vote Yes or No. No names are shown or saved. Owners and managers can reply (shown as \u201cReply from the managers\u201d) and hide offensive posts with a reason. Every hide, unhide and reply is in the Moderation log.',showMe:{tab:'more',page:'board',hint:'The question board.'}},{id:'adv-tasks',kind:'guide',topic:'Team',title:'Daily tasks',keywords:['tasks','daily tasks','checklist','duties','jobs','to do','my tasks','library','head chef'],body:'Give each person a short list of daily tasks: open Staff & roles, tap Daily tasks on their card, then pick from the venue\u2019s task library or type a new one. Use the arrows to reorder, \u2715 to remove (with Undo) and Days to limit a task to certain days. They see \u201cMy tasks today\u201d on their home screen and tick each one off while on shift; each tick records who and when, and you see \u201c2 of 5 done today\u201d on their card. Lists start fresh every day. Owners and managers can change anyone\u2019s list, including the Head Chef\u2019s. The Head Chef can change the lists of kitchen staff (chefs, commis and KPs) from Kitchen \u203a Kitchen team tasks, but not their own and not front of house. The task library is in Settings \u203a Advanced \u203a Tasks.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-tasks'},hint:'The task library is here.'}},{id:'adv-cashup',kind:'guide',topic:'Money',title:'Cash up and weekly sales',keywords:['cash up','cashup','takings','float','till','sales report','weekly sales','pos','printout','photo','graphs','charts'],body:'At the end of the night open Cash up & sales and tap Enter the cash up. Type each figure; boxes left blank stay blank (never counted as zero) and are highlighted in amber. Add any cash paid out of the till (lobsters, supermarket shopping, and the like) in the Paid out section: each line has what it was for, the amount, an optional note and who entered it. The total reduces the expected cash in the drawer. Nothing is saved until you tap Confirm and save. Do the same with the weekly sales report from the till (several pages is fine). The graphs show daily takings, tips, weekly net sales against the week before and sales by category. Owners and managers can enter and change cash ups; the Head Chef can see the graphs if they are allowed to see takings. Change the boxes to match your sheet in Settings \u203a Advanced \u203a Cash up; Cash tips total and Card tips total are always kept.',showMe:{tab:'more',page:'cashup',target:{testID:'cashup-by-hand'},hint:'Start the cash up here.'}},{id:'adv-tips',kind:'guide',topic:'Money',title:'Today\u2019s tips and the Tips pot',keywords:['tips','today tips','tips pot','pot','payout','tip pay','correction','coins'],body:'When a cash up with Cash tips total and Card tips total is confirmed, the team\u2019s combined tips for that day show as Today\u2019s tips in every staff app and on the Display, with a short notice. The Tips pot adds up confirmed daily tips since the last payout (fortnightly tip pay). After paying the tips, an owner or manager taps Mark payout done on the Tips pot card: the pot goes back to \xa30.00 and the old pot is kept in Past pots. Use Correct an entry to add or take off an amount for a day; a reason is required and every correction is logged with your name. Only the team total is ever shown, never anyone\u2019s share. Hide either card in Settings \u203a Advanced \u203a Tips.',showMe:{tab:'more',page:'advanced',target:{testID:'adv-tips'},hint:'Show or hide the tips cards here.'}},{id:'manager-access',kind:'guide',topic:'Team',title:'Manager access',keywords:['manager access','manager','access','role','promote','front of house','head chef','owner'],body:'In Staff & roles each person has a Manager access switch. On: they use the Manager app (rota, bookings, staff, hours, settings, plus their own clock in, rota and pay). Off: they use the Front of House app, or the Head Chef app for the Head Chef. Owners can switch anyone except owners; managers can switch anyone except themselves and owners. The last owner can never be removed. You confirm each change; it is logged with who and when (Access changes). Job titles are free text and don\u2019t change.',showMe:{tab:'more',page:'staff',target:{testID:'access-tip'},hint:'Manager access switches are on each person.'}},{id:'next-table-free',kind:'faq',topic:'Walk-ins',title:'When is the next table free?',keywords:['next table','free','wait','walk-in','quote','full'],body:'When you\u2019re full, Today and the Display show \u201cNext table free about 19:40 (T6, 4 seats)\u201d with \u201clikely\u201d or \u201cmaybe\u201d, and how long a walk-in for 2 or 4 would wait. Tap Bill requested or Table finished on the plan and it updates. You can also ask the Assistant \u201cwhen\u2019s the next table free?\u201d.'},{id:'time-travel',kind:'faq',topic:'Today',title:'Look at another day (time travel)',keywords:['yesterday','tomorrow','next week','past','future','day','time travel'],body:'On Today, tap \u2039 or \u203a beside the date to step a day back or forward. You\u2019ll see that day\u2019s kitchen hours, events, covers (booked, or how it went), platters and each booking\u2019s allergens and needs. It\u2019s read-only and nothing changes live service. Tap Today to come back. The Display goes back to today by itself after 2 minutes. Staff can look 7 days back and 14 days ahead.'},{id:'sign-in-links',kind:'guide',topic:'Team',title:'Personal sign-in links',keywords:['link','invite','sign in','new link','expired','already used','phone','login'],body:'Each personal link works on one phone only and lasts 5 days, so nobody else can sign in as that person. The same phone can open it again, in any of the apps. If someone gets a new phone, or their link has expired, open Staff & roles, tap New sign-in link on their entry, then Copy link and send it to them yourself. The app never sends it. Owners can make links for anyone; managers for anyone except owners. Their old unused link stops working; phones already signed in stay signed in.',showMe:{tab:'more',page:'staff',target:{testID:'access-tip'},hint:'New sign-in link is on each person.'}},{id:'pins-security',kind:'faq',topic:'Team',title:'PINs for the Display',keywords:['pin','display pin','clock in','wake pin','2580','manager pin','locked'],body:'Staff PINs for clocking in at the Display are 4 to 8 digits. Managers and owners need 6 to 8 digits, because their PIN can add temp staff. Easy PINs such as 1111 or 1234 are refused. Five wrong tries locks that person for 15 minutes; 20 wrong tries on one Display stops it for 15 minutes. The Display wake PIN (Settings \u203a Display) is 6 to 8 digits and is kept only as a scrambled hash. If it still says 2580, change it.'},{id:'cash-up-lock',kind:'faq',topic:'Money',title:'Correcting a signed-off cash up',keywords:['cash up','locked','unlock','correct','mistake','history','audit','sales report'],body:'Once a cash up or weekly sales report is confirmed and saved, it is locked so the figures can\u2019t change quietly. An owner taps Unlock to correct on it, says why, and has 30 minutes to fix it. History on each one shows who signed it off, changed or unlocked it, and when.'},{id:'wipe-device',kind:'faq',topic:'Settings',title:'Sign out and wipe a shared tablet or phone',keywords:['wipe','sign out','shared','tablet','leaver','lost','reset device'],body:'Tap the sync badge (bottom left), or go to Settings \u203a Display, and choose Sign out and wipe this device. It signs out and removes everything CoverCharge keeps on that device: sign-ins, pairing, saved screens and changes not sent yet. The venue\u2019s shared data is not touched. On the Display you type the wake PIN first.'}],o=t=>a.find(a=>a.id===t)},1486,[]); __d(function(g,r,_i,_a,m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"tokens",{enumerable:!0,get:function(){return o}}),e.lev=l,e.searchHelp=function(n,l,i=8){const h=o(l);if(!h.length)return[];const a=t(l);return n.map(n=>{const l=o(n.title),i=o(n.keywords.join(' ')),c=o(`${n.body} ${(n.steps??[]).join(' ')}`);let f=3*s(h,l)+2.5*s(h,i)+.8*s(h,c);return n.keywords.some(n=>a.includes(t(n))&&t(n).length>3)&&(f+=2),t(n.title).includes(a)&&a.length>3&&(f+=3),{a:n,score:f/Math.sqrt(h.length)}}).filter(t=>t.score>=1.2).sort((t,n)=>n.score-t.score).slice(0,i)};const t=t=>t.toLowerCase().replace(/[\u2019']/g,'').replace(/[^a-z0-9\xa3 ]+/g,' ').replace(/\s+/g,' ').trim(),n=new Set(['how','do','i','a','an','the','to','can','my','our','we','is','it','of','for','in','on','and','what','where','please','me','you','with']),o=o=>t(o).split(' ').filter(t=>t&&!n.has(t));function l(t,n,o=2){if(Math.abs(t.length-n.length)>o)return o+1;let l=Array.from({length:n.length+1},(t,n)=>n);for(let i=1;i<=t.length;i++){const s=[i];let h=i;for(let o=1;o<=n.length;o++)s[o]=Math.min(l[o]+1,s[o-1]+1,l[o-1]+(t[i-1]===n[o-1]?0:1)),h=Math.min(h,s[o]);if(h>o)return o+1;l=s}return l[n.length]}function i(t,n){if(t===n)return 1;if(t.length>=3&&n.startsWith(t))return.8;if(n.length>=4&&t.startsWith(n))return.7;if(t.length>=4){if(l(t,n,t.length>=7?2:1)<=(t.length>=7?2:1))return.6}return 0}function s(t,n){let o=0;for(const l of t){let t=0;for(const o of n)if(t=Math.max(t,i(l,o)),1===t)break;o+=t}return o}},1487,[]); __d(function(g,r,_i,_a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"STAFF_VOICE_ACTIONS",{enumerable:!0,get:function(){return x}}),Object.defineProperty(_e,"STAFF_ALLOWED",{enumerable:!0,get:function(){return C}});var e=r(_d[0]),t=r(_d[1]),a=r(_d[2]),s=r(_d[3]),o=r(_d[4]),n=r(_d[5]),i=r(_d[6]);const h=()=>{try{return(0,e.nowFrom)(e.useStore.getState().clock)}catch{return new Date}},c=e=>String(e).padStart(2,'0'),d=e=>e.getFullYear()+'-'+c(e.getMonth()+1)+'-'+c(e.getDate()),l=e=>{const t=new Date(e);return c(t.getHours())+':'+c(t.getMinutes())},u=e=>{const t=(Math.round(60*e)%1440+1440)%1440;return c(Math.floor(t/60))+':'+c(t%60)},m=(e,t)=>{if(e===t)return'today';const[a,s,o]=e.split('-').map(Number),n=new Date(a,s-1,o),i=new Date(h());return i.setDate(i.getDate()+1),e===d(i)?'tomorrow':n.toLocaleDateString('en-GB',{weekday:'long',day:'numeric',month:'long'})},p=(e,t)=>t.test(e),f=e=>(e??'').replace(' (example)',''),b=e=>t.useOwner.getState().staff.find(t=>t.id===e.whoId),k=['staff'],w=[['kitchen',/\bkitchen\b/],['foh',/\b(front of house|foh|floor|bar)\b/],['managers',/\bmanagers?\b/],['all',/\b(all staff|everyone|whole team|team|group)\b/]],y={all:'the Team chat',kitchen:'Kitchen',foh:'Front of house',managers:'Managers'};function S(e,t){return'all'===e||(0,n.inChannel)(e,t)}function v(e,a){const s=e.toLowerCase().match(/\b(?:message|pm|private message|dm|text|tell)\s+([a-z' -]+?)(?:\s*[:,]|\s+(?:that|saying|to say)\b)/),o=(s?.[1]??'').trim();if(o&&!/^(the )?(team|everyone|kitchen|front of house|managers|group|all staff)$/.test(o))return t.useOwner.getState().staff.filter(e=>e.active&&e.id!==a.whoId).find(e=>(0,t.staffCalled)({name:f(e.name),nickname:e.nickname},o))}const x=[{id:'post_kitchen_chat',apps:['owner','chef'],title:'Post in the Kitchen chat',risk:'change',description:'Post a message in the pinned Kitchen chat (owners, managers, head chefs and kitchen staff).',params:[{name:'text',type:'string',required:!0,description:'The message'}],keywords:['kitchen chat'],match:e=>p(e,/\bkitchen (chat|group|channel)\b/)&&!p(e,/\b(read|any|unread|latest)\b/)?7:0,parse:e=>{const t=e.replace(/^.*?\bkitchen (?:chat|group|channel)\b\s*(?:[:,-]|\bthat\b|\bsaying\b)?\s*/i,'').trim();return{text:t.charAt(0).toUpperCase()+t.slice(1)}},preview:e=>'Post in the Kitchen chat: \u201c'+e.text+'\u201d?',run:(e,a)=>!e.text||String(e.text).length<2?'What should the message say?':(t.useOwner.getState().chatSend({ch:'kitchen',from:String(a.whoId??'system'),text:String(e.text),at:h().toISOString()}),'Posted in the Kitchen chat.')},{id:'post_team_chat',apps:k,title:'Post to the team chat or message one person',risk:'change',description:'Post a message in the team chat (All staff, Kitchen or Front of house), or a private message to one person. Read back first; posted only after Confirm.',params:[{name:'text',type:'string',required:!0,description:'The message'},{name:'ch',type:'string',required:!0,description:'Channel id or dm id'},{name:'to',type:'string',description:'Name of the person, for a private message'}],keywords:['team chat','group chat','message'],match:e=>p(e,/\b(message|pm|dm|text|tell|post|send|let)\b/)&&p(e,/\b(chat|team|everyone|group|kitchen|front of house|managers|know|:)|\b(message|pm|dm|text)\s+[a-z]+\s*[:,]/)&&!p(e,/\b(read|any|unread|what did|latest|last)\b.*\b(messages?|chat)\b/)?5:0,parse:(e,t)=>{const a=t,s=e.toLowerCase(),o=v(e,a),n=e.replace(/^.*?(?:[:]|\b(?:saying|that|to say)\b)\s*/i,'').replace(/^\s*(?:(?:post|send|put|write)\s+(?:in|on|to)\s+(?:the\s+)?(?:team|group|kitchen|front of house|all staff)?\s*chat\s*)/i,'').trim(),i=n&&n!==e?n:e.replace(/^\s*(?:tell|message|post to|let)\s+(?:the\s+)?(?:team|everyone|group chat|team chat|kitchen|front of house)\s*(?:know\s*)?(?:that\s*)?/i,'').trim();if(o)return{text:i.charAt(0).toUpperCase()+i.slice(1),ch:'dm:'+[String(a.whoId),o.id].sort().join(':'),to:f(o.name)};const h=w.find(([,e])=>e.test(s))?.[0]??'all';return{text:i.charAt(0).toUpperCase()+i.slice(1),ch:h}},preview:e=>e.to?'Private message to '+e.to+': \u201c'+e.text+'\u201d. Send it?':'Post in '+(y[String(e.ch)]??'the team chat')+': \u201c'+e.text+'\u201d?',run:(e,a)=>{const s=String(e.ch),o=b(a);return!e.text||String(e.text).length<2?'What should the message say?':s.startsWith('dm:')||S(s,o)?(t.useOwner.getState().chatSend({ch:s,from:String(a.whoId??'system'),text:String(e.text),at:h().toISOString()}),e.to?'Sent to '+e.to+'.':'Posted in '+(y[s]??'the team chat')+'.'):'You can\u2019t post in '+(y[s]??s)+'. Try the Team chat.'}},{id:'read_chat',apps:k,title:'Read out chat messages',risk:'look',description:'Read out unread messages (team chat and private messages), or the latest ones.',params:[],keywords:['messages','chat'],match:e=>p(e,/\b(read|any|unread|new|what did|latest|last|check)\b.*\b(messages?|chats?|pms?)\b|\bwhat.?s (been said|in the chat)\b/)?6:0,preview:()=>'Read out chat messages',run:(e,a)=>{const s=t.useOwner.getState(),o=b(a),n=String(a.whoId??''),i=s.chat.filter(e=>{return!e.removed&&e.text&&((t=e.ch).startsWith('dm:')?t.split(':').slice(1).includes(n):o?'all'===t||S(t,o):'all'===t);var t}).sort((e,t)=>e.at.localeCompare(t.at)),h=i.filter(e=>e.from!==n&&!e.seenBy.includes(n)),c=(h.length?h:i.filter(e=>'system'!==e.from)).slice(-5),d=e=>'system'===e.from?'CoverCharge':f(s.staff.find(t=>t.id===e.from)?.name??'Someone');return c.length?(h.length?h.length+' unread. ':'No unread messages. The latest: ')+c.map(e=>{return d(e)+' '+(((t=e.ch).startsWith('dm:')?'privately':'in '+(y[t]??t))+' at ')+l(e.at)+': '+e.text;var t}).join('. '):'No messages yet.'}},{id:'my_shift',apps:k,title:'My next shift or rota',risk:'look',description:'Your next published shift, or your shifts this week.',params:[],keywords:['shift','rota'],match:e=>p(e,/\b(my|next|when am i|am i (on|working|in)|when do i (start|work|finish))\b/)&&p(e,/\b(shifts?|rota|working|on|in|start|finish)\b/)&&!p(e,/\b(break|clock)/)?5:0,preview:()=>'Your shifts',run:(e,a)=>{const s=a.today,o=t.useOwner.getState().shifts.filter(e=>e.staffId===a.whoId&&e.published&&e.date>=s).sort((e,t)=>e.date.localeCompare(t.date)||e.start-t.start);if(!o.length)return'You have no published shifts coming up. Your manager publishes the rota in the app.';const n=h(),i=n.getHours()+n.getMinutes()/60,c=o.find(e=>e.date>s||e.end>i)??o[0],d=o.filter(e=>e!==c).slice(0,4);return'Your next shift: '+m(c.date,s)+', '+u(c.start)+' to '+u(c.end)+(c.note?' ('+c.note+')':'')+'.'+(d.length?' Then '+d.map(e=>m(e.date,s)+' '+u(e.start)+'\u2013'+u(e.end)).join(', ')+'.':'')}},{id:'clock_status',apps:k,title:'Am I clocked in?',risk:'look',description:'Whether you are clocked in, since when, and a reminder to clock in or out on the Clock tab.',params:[],keywords:['clock'],match:e=>p(e,/\b(clock(ed)?|clocking)\b/)?6:0,preview:()=>'Clock status',run:(e,a)=>{const s=t.useOwner.getState(),o=h(),n=(0,t.openShiftOf)(s.attendance,String(a.whoId),o),c=a.today,d=o.getHours()+o.getMinutes()/60,m=(0,i.workingShifts)(s.shifts,s.leave).find(e=>e.staffId===a.whoId&&e.published&&e.date===c);return n?'You\u2019re clocked in since '+l(n.in)+'.'+(m?' Your shift ends at '+u(m.end)+'.':'')+' Remember to clock out on the Clock tab when you finish.':m&&m.end>d?'You\u2019re not clocked in. Your shift today is '+u(m.start)+' to '+u(m.end)+'. Clock in on the Clock tab when you start.':'You\u2019re not clocked in.'+(m?'':' You have no shift today.')+' Use the Clock tab to clock in or out.'}},{id:'my_break',apps:k,title:'My break',risk:'look',description:'Whether you are on a break, and how long your breaks have been today.',params:[],keywords:['break'],match:e=>p(e,/\bbreaks?\b/)?6:0,preview:()=>'Your break',run:(e,a)=>{const s=t.useOwner.getState(),o=h(),n=(0,t.openShiftOf)(s.attendance,String(a.whoId),o);if(!n)return'You\u2019re not clocked in, so there\u2019s no break to show. Breaks are started and ended on the Clock tab.';const i=(0,t.loggedBreakMins)(n,o);if((0,t.isOnBreak)(n)){const e=n.breaks.find(e=>!e.end);return'You\u2019re on a break since '+l(e.start)+'. Breaks today: '+i+' minutes. Tap End break on the Clock tab when you\u2019re back.'}return i?'You\u2019ve had '+i+' minutes of break today. Start a break on the Clock tab.':'No break taken yet today. Start one on the Clock tab.'}},{id:'todays_specials',apps:k,title:'Today\u2019s specials',risk:'look',description:'Read out today\u2019s specials board.',params:[],keywords:['specials'],match:e=>p(e,/\bspecials?\b/)&&!p(e,/\b(draft|add|new|make)\b/)?6:0,preview:()=>'Today\u2019s specials',run:(e,t)=>{const o=a.useSpecials.getState().current[t.rid]?.items??[];return o.length?'Today\u2019s specials: '+o.map(e=>e.name+(null!=e.price?', '+(0,s.gbp)(e.price):'')).join('; ')+'.':'There are no specials on the board today.'}},{id:'sold_out_list',apps:k,title:'What\u2019s sold out',risk:'look',description:'List dishes that are sold out right now.',params:[],keywords:['sold out','86'],match:e=>p(e,/\b(sold out|86(ed)?|run out|off the menu|unavailable)\b/)?6:0,preview:()=>'What\u2019s sold out',run:(e,t)=>{const a=(0,o.dishesFor)(t.rid).filter(e=>e.soldOut).map(e=>e.name);return a.length?'Sold out: '+a.join(', ')+'.':'Nothing is sold out right now.'}}],C=new Set(['log_check','allergen_info','next_table_free',...x.filter(e=>e.apps?.includes('staff')).map(e=>e.id)])},1488,[816,876,956,851,1482,1015,1069]); __d(function(g,r,i,_a,_m2,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"NUM_WORDS",{enumerable:!0,get:function(){return s}}),e.numberOf=l,e.normaliseHeard=function(t){let n=` ${t.replace(/[\u2019\u2018]/g,"'").replace(/\s+/g,' ').trim()} `;n=n.replace(/\bwalk[\s-]?ins?\b/gi,'walk-in').replace(/\bwalking\b(?=\s+(?:of|for|in|on|at|party|\d|one|two|three|four|five|six|seven|eight|nine|ten|to|too)\b)/gi,'walk-in').replace(/\bseat(?:er|ed|a)?\s+(?:a\s+|at\s+|the\s+)?walk-in\b/gi,'seat a walk-in').replace(/\bsit\s+(?:a\s+)?walk-in\b/gi,'seat a walk-in').replace(/\b(?:quitter|quieter|pew ta|puta|put the|push a)\s+walk-in\b/gi,'put a walk-in').replace(/^(\s*)(?:lock|clock)\s+table\b/i,'$1block table').replace(/^(\s*)(?:[Ss]id|[Ss]it|[Ss]eed|[Ss]ee)\s+(?=[A-Z][a-z]+\b.*\b(?:waitlist|wait list|waiting list)\b)/,'$1seat ').replace(/\b(table \S+ (?:needs|is needing|wants)) cleaning\b/gi,'$1 clearing').replace(/^(\s*)have many\b/i,'$1how many').replace(/^(\s*)(?:meet|need|reed|weed) the (orders|shift notes|messages|specials)\b/i,'$1read the $2'),n=n.replace(new RegExp(`\\btable(\\s+(?:number\\s+)?)(${a})\\b(?!\\s+(?:${b})\\b)`,'gi'),(t,n,s)=>`table${n}${p(s)}`).replace(new RegExp("\\btable(\\s+(?:number\\s+)?)(for|fore)\\b(?=\\s*(?:$|[.,!?]|\\b(?:please|now|is|has|needs|wants|on|at)\\b))",'gi'),(t,n,s)=>`table${n}${p(s)}`).replace(new RegExp(`\\btable(\\s+(?:number\\s+)?)((?:twenty|thirty)[ -](?:one|two|three|four|five|six|seven|eight|nine)|${s})\\b`,'gi'),(t,n,s)=>`table${n}${p(s)}`).replace(new RegExp(`\\b(walk-in(?:\\s+party)?\\s+(?:of|for)|party of|table for|of|for)\\s+(${o})\\b${w}`,'gi'),(t,n,s)=>`${n} ${p(s)}`).replace(new RegExp(`\\bwalk-in\\s+(${s}|\\d{1,2})\\b${w}`,'gi'),(t,n)=>`walk-in of ${p(n)}`).replace(new RegExp(`\\bwalk-in\\s+(${o})\\b(?=\\s*(?:$|[.,!?]|\\b(?:on|at|people|covers|guests|please|now)\\b))`,'gi'),(t,n)=>`walk-in of ${p(n)}`).replace(new RegExp(`\\b(${o})\\s+(covers|people|guests|adults)\\b`,'gi'),(t,n,s)=>`${p(n)} ${s}`);const c=n.match(new RegExp(`^\\s*(?:(?:put|seat|sit)\\s+)?(?:a\\s+)?(${b})\\s+(?:on|at|to|onto)\\s+table\\s+(\\w+)[.,!?]?(?:\\s+(?:please|now|thanks))?\\s*[.!?]?\\s*$`,'i'));c&&l(c[1])&&l(c[1])<=30&&(n=` seat a walk-in of ${p(c[1])} at table ${p(c[2])} `);return n.replace(/\s+/g,' ').trim()},e.walkInCovers=function(t){const n=` ${t.toLowerCase()} `,a=`(\\d{1,2}|${s})`,o=n.match(new RegExp(`\\bwalk-in(?:\\s+party)?\\s+(?:of|for)\\s+${a}\\b`))??n.match(new RegExp(`\\bwalk-in\\s+(?:at|a|of a|for a)\\s+${a}\\s+(?:at|on)\\s+table\\b`))??n.match(new RegExp(`\\b${a}\\s+walk-in`))??n.match(new RegExp(`\\b(?:party of|table for|for|of)\\s+${a}\\b(?!\\s*(?:am|pm|[:.]\\d|o.?clock))`))??n.match(new RegExp(`\\b${a}\\s*(?:covers|people|guests|adults|pax|persons|of us)\\b`)),b=l(o?.[1],!1);return b&&b>=1&&b<=30?b:void 0},e.tableSaid=function(t){const n=[...` ${t.toLowerCase()} `.matchAll(/\btable\s+(?:number\s+)?([a-z]?\d{1,3}[a-z]?)\b/g)];return n.length?n[n.length-1][1].toUpperCase():void 0},e.coversAnswer=function(t){const n=t.toLowerCase().replace(/[.,!?]/g,' '),a=n.match(new RegExp(`\\b(\\d{1,2}|${s})\\b`))??n.match(new RegExp(`^\\s*(?:just\\s+)?(${o})\\s*(?:people|of us|please)?\\s*$`)),b=l(a?.[1]);return b&&b>=1&&b<=30?b:void 0};const t={one:1,two:2,three:3,four:4,five:5,six:6,seven:7,eight:8,nine:9,ten:10,eleven:11,twelve:12,thirteen:13,fourteen:14,fifteen:15,sixteen:16,seventeen:17,eighteen:18,nineteen:19,twenty:20,thirty:30},n={to:2,too:2,tu:2,for:4,fore:4,ate:8,won:1,tree:3,free:3,sax:6,sex:6,fiver:5,nein:9,tin:10},s=Object.keys(t).join('|'),a='to|too|tu|ate|won|tree|free|sax|sex|fiver|nein|tin',o='to|too|tu|for|fore|ate|won',b=`\\d{1,2}|(?:twenty|thirty)[ -](?:one|two|three|four|five|six|seven|eight|nine)|${s}|${o}`;function l(s,a=!0){if(!s)return;const o=s.toLowerCase().trim().replace(/-/g,' ');if(/^\d+$/.test(o))return Number(o);const b=o.match(/^(twenty|thirty) (one|two|three|four|five|six|seven|eight|nine)$/);return b?t[b[1]]+t[b[2]]:t[o]??(a?n[o]:void 0)}const p=t=>String(l(t)??t),w='(?=\\s*(?:$|[.,!?]|\\bon\\b|\\bat\\b|\\bin\\b|\\bto\\b|\\btable\\b|\\bplease\\b|\\bnow\\b|\\bpeople\\b|\\bcovers?\\b|\\bguests?\\b))'},1489,[]); diff --git a/staff-app/admin.html b/staff-app/admin.html index c593333911bda5b8b839492f0d1268525be51507..0ec7575966bc9721ac0cf492e2f11df46237e36f 100644 --- a/staff-app/admin.html +++ b/staff-app/admin.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/staff-app/customer.html b/staff-app/customer.html index c593333911bda5b8b839492f0d1268525be51507..0ec7575966bc9721ac0cf492e2f11df46237e36f 100644 --- a/staff-app/customer.html +++ b/staff-app/customer.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/staff-app/customer/anchorage.html b/staff-app/customer/anchorage.html index c593333911bda5b8b839492f0d1268525be51507..0ec7575966bc9721ac0cf492e2f11df46237e36f 100644 --- a/staff-app/customer/anchorage.html +++ b/staff-app/customer/anchorage.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/staff-app/customer/anchorage/book.html b/staff-app/customer/anchorage/book.html index c593333911bda5b8b839492f0d1268525be51507..0ec7575966bc9721ac0cf492e2f11df46237e36f 100644 --- a/staff-app/customer/anchorage/book.html +++ b/staff-app/customer/anchorage/book.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/staff-app/customer/anchorage/feedback.html b/staff-app/customer/anchorage/feedback.html index c593333911bda5b8b839492f0d1268525be51507..0ec7575966bc9721ac0cf492e2f11df46237e36f 100644 --- a/staff-app/customer/anchorage/feedback.html +++ b/staff-app/customer/anchorage/feedback.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/staff-app/customer/anchorage/gift.html b/staff-app/customer/anchorage/gift.html index c593333911bda5b8b839492f0d1268525be51507..0ec7575966bc9721ac0cf492e2f11df46237e36f 100644 --- a/staff-app/customer/anchorage/gift.html +++ b/staff-app/customer/anchorage/gift.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/staff-app/customer/anchorage/lost.html b/staff-app/customer/anchorage/lost.html index c593333911bda5b8b839492f0d1268525be51507..0ec7575966bc9721ac0cf492e2f11df46237e36f 100644 --- a/staff-app/customer/anchorage/lost.html +++ b/staff-app/customer/anchorage/lost.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/staff-app/customer/anchorage/loyalty.html b/staff-app/customer/anchorage/loyalty.html index c593333911bda5b8b839492f0d1268525be51507..0ec7575966bc9721ac0cf492e2f11df46237e36f 100644 --- a/staff-app/customer/anchorage/loyalty.html +++ b/staff-app/customer/anchorage/loyalty.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/staff-app/customer/anchorage/merch.html b/staff-app/customer/anchorage/merch.html index c593333911bda5b8b839492f0d1268525be51507..0ec7575966bc9721ac0cf492e2f11df46237e36f 100644 --- a/staff-app/customer/anchorage/merch.html +++ b/staff-app/customer/anchorage/merch.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/staff-app/customer/anchorage/offers.html b/staff-app/customer/anchorage/offers.html index c593333911bda5b8b839492f0d1268525be51507..0ec7575966bc9721ac0cf492e2f11df46237e36f 100644 --- a/staff-app/customer/anchorage/offers.html +++ b/staff-app/customer/anchorage/offers.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/staff-app/customer/anchorage/refer.html b/staff-app/customer/anchorage/refer.html index c593333911bda5b8b839492f0d1268525be51507..0ec7575966bc9721ac0cf492e2f11df46237e36f 100644 --- a/staff-app/customer/anchorage/refer.html +++ b/staff-app/customer/anchorage/refer.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/staff-app/customer/anchorage/waitlist.html b/staff-app/customer/anchorage/waitlist.html index c593333911bda5b8b839492f0d1268525be51507..0ec7575966bc9721ac0cf492e2f11df46237e36f 100644 --- a/staff-app/customer/anchorage/waitlist.html +++ b/staff-app/customer/anchorage/waitlist.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/staff-app/customer/anchorage/whatson.html b/staff-app/customer/anchorage/whatson.html index c593333911bda5b8b839492f0d1268525be51507..0ec7575966bc9721ac0cf492e2f11df46237e36f 100644 --- a/staff-app/customer/anchorage/whatson.html +++ b/staff-app/customer/anchorage/whatson.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/staff-app/customer/basket.html b/staff-app/customer/basket.html index c593333911bda5b8b839492f0d1268525be51507..0ec7575966bc9721ac0cf492e2f11df46237e36f 100644 --- a/staff-app/customer/basket.html +++ b/staff-app/customer/basket.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/staff-app/customer/profile.html b/staff-app/customer/profile.html index c593333911bda5b8b839492f0d1268525be51507..0ec7575966bc9721ac0cf492e2f11df46237e36f 100644 --- a/staff-app/customer/profile.html +++ b/staff-app/customer/profile.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/staff-app/demo.html b/staff-app/demo.html index c593333911bda5b8b839492f0d1268525be51507..0ec7575966bc9721ac0cf492e2f11df46237e36f 100644 --- a/staff-app/demo.html +++ b/staff-app/demo.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/staff-app/display.html b/staff-app/display.html index c593333911bda5b8b839492f0d1268525be51507..0ec7575966bc9721ac0cf492e2f11df46237e36f 100644 --- a/staff-app/display.html +++ b/staff-app/display.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/staff-app/index.html b/staff-app/index.html index 8111a6573fb53f7682e4c0db4b8688ff2dcea211..4a9359ebc1ebe23b6e5cbe4426de4f269ae2ddc5 100644 --- a/staff-app/index.html +++ b/staff-app/index.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/staff-app/kitchen.html b/staff-app/kitchen.html index c593333911bda5b8b839492f0d1268525be51507..0ec7575966bc9721ac0cf492e2f11df46237e36f 100644 --- a/staff-app/kitchen.html +++ b/staff-app/kitchen.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/staff-app/owner.html b/staff-app/owner.html index c593333911bda5b8b839492f0d1268525be51507..0ec7575966bc9721ac0cf492e2f11df46237e36f 100644 --- a/staff-app/owner.html +++ b/staff-app/owner.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/staff-app/staff.html b/staff-app/staff.html index c593333911bda5b8b839492f0d1268525be51507..0ec7575966bc9721ac0cf492e2f11df46237e36f 100644 --- a/staff-app/staff.html +++ b/staff-app/staff.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - + diff --git a/staff-app/sw.js b/staff-app/sw.js index 1eb613862f135e0d3ee34641e427f86237ea7d41..2d9d95f523eac53c67744a78371cbfa59ca300cb 100644 --- a/staff-app/sw.js +++ b/staff-app/sw.js @@ -1,7 +1,7 @@ // Anchorage Staff service worker: precache the app shell so it opens offline after the first visit. -const V = "cc-staff-7a1e90249d"; +const V = "cc-staff-77c2d3cfd5"; const BASE = "/staff-app/"; -const PRECACHE = ["/staff-app/apple-touch-icon.png", "/staff-app/assets/assets/brand/anchorage-hero.0450b828e4f9c1f4456240096598f6f5.png", "/staff-app/assets/assets/brand/anchorage.fea5ce2f6fd18bf2950aa21c0980ed8e.png", "/staff-app/assets/assets/recipes/fishsupper.1609c58319e1e8721f5c639049fb054e.jpg", "/staff-app/assets/assets/recipes/lobster.2fb3485c8e372972099259017358c1b8.jpg", "/staff-app/assets/assets/recipes/moules.a4f342fc7e7fb62c8a0b5c1678bbea3f.jpg", "/staff-app/assets/assets/recipes/skink.4ce7b7c676f9cdcd0a060eda46f5a00e.jpg", "/staff-app/assets/assets/recipes/stp.1061ced765efdcafff2554adc3fc7113.jpg", "/staff-app/assets/assets/specials/sample-chalkboard.e7b4e4450a8483d4219bc6a214158d8f.jpg", "/staff-app/assets/node_modules/@expo-google-fonts/poppins/400Regular/Poppins_400Regular.093ee89be9ede30383f39a899c485a82.ttf", "/staff-app/assets/node_modules/@expo-google-fonts/poppins/500Medium/Poppins_500Medium.bf59c687bc6d3a70204d3944082c5cc0.ttf", "/staff-app/assets/node_modules/@expo-google-fonts/poppins/600SemiBold/Poppins_600SemiBold.6f1520d107205975713ba09df778f93f.ttf", "/staff-app/assets/node_modules/@expo-google-fonts/poppins/700Bold/Poppins_700Bold.08c20a487911694291bd8c5de41315ad.ttf", "/staff-app/assets/node_modules/expo-router/assets/arrow_down.017bc6ba3fc25503e5eb5e53826d48a8.png", "/staff-app/assets/node_modules/expo-router/assets/error.d1ea1496f9057eb392d5bbf3732a61b7.png", "/staff-app/assets/node_modules/expo-router/assets/file.19eeb73b9593a38f8e9f418337fc7d10.png", "/staff-app/assets/node_modules/expo-router/assets/forward.d8b800c443b8972542883e0b9de2bdc6.png", "/staff-app/assets/node_modules/expo-router/assets/pkg.ab19f4cbc543357183a20571f68380a3.png", "/staff-app/assets/node_modules/expo-router/assets/react-navigation/elements/back-icon-mask.0a328cd9c1afd0afe8e3b1ec5165b1b4.png", "/staff-app/assets/node_modules/expo-router/assets/react-navigation/elements/back-icon.35ba0eaec5a4f5ed12ca16fabeae451d.png", "/staff-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55.png", "/staff-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@2x.png", "/staff-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@3x.png", "/staff-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@4x.png", "/staff-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7.png", "/staff-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@2x.png", "/staff-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@3x.png", "/staff-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@4x.png", "/staff-app/assets/node_modules/expo-router/assets/react-navigation/elements/search-icon.286d67d3f74808a60a78d3ebf1a5fb57.png", "/staff-app/assets/node_modules/expo-router/assets/sitemap.412dd9275b6b48ad28f5e3d81bb1f626.png", "/staff-app/assets/node_modules/expo-router/assets/unmatched.20e71bdf79e3a97bf55fd9e164041578.png", "/staff-app/brand-logo.png", "/staff-app/favicon.ico", "/staff-app/icon-192.png", "/staff-app/icon-512.png", "/staff-app/icon-maskable-192.png", "/staff-app/icon-maskable-512.png", "/staff-app/manifest.webmanifest", "/staff-app/index.html", "/staff-app/_expo/static/js/web/bundle.js?v=7a1e90249de2182c2902ec0dbef7100dd8cfe7dc1729223678a9e390f5750918"]; +const PRECACHE = ["/staff-app/apple-touch-icon.png", "/staff-app/assets/assets/brand/anchorage-hero.0450b828e4f9c1f4456240096598f6f5.png", "/staff-app/assets/assets/brand/anchorage.fea5ce2f6fd18bf2950aa21c0980ed8e.png", "/staff-app/assets/assets/recipes/fishsupper.1609c58319e1e8721f5c639049fb054e.jpg", "/staff-app/assets/assets/recipes/lobster.2fb3485c8e372972099259017358c1b8.jpg", "/staff-app/assets/assets/recipes/moules.a4f342fc7e7fb62c8a0b5c1678bbea3f.jpg", "/staff-app/assets/assets/recipes/skink.4ce7b7c676f9cdcd0a060eda46f5a00e.jpg", "/staff-app/assets/assets/recipes/stp.1061ced765efdcafff2554adc3fc7113.jpg", "/staff-app/assets/assets/specials/sample-chalkboard.e7b4e4450a8483d4219bc6a214158d8f.jpg", "/staff-app/assets/node_modules/@expo-google-fonts/poppins/400Regular/Poppins_400Regular.093ee89be9ede30383f39a899c485a82.ttf", "/staff-app/assets/node_modules/@expo-google-fonts/poppins/500Medium/Poppins_500Medium.bf59c687bc6d3a70204d3944082c5cc0.ttf", "/staff-app/assets/node_modules/@expo-google-fonts/poppins/600SemiBold/Poppins_600SemiBold.6f1520d107205975713ba09df778f93f.ttf", "/staff-app/assets/node_modules/@expo-google-fonts/poppins/700Bold/Poppins_700Bold.08c20a487911694291bd8c5de41315ad.ttf", "/staff-app/assets/node_modules/expo-router/assets/arrow_down.017bc6ba3fc25503e5eb5e53826d48a8.png", "/staff-app/assets/node_modules/expo-router/assets/error.d1ea1496f9057eb392d5bbf3732a61b7.png", "/staff-app/assets/node_modules/expo-router/assets/file.19eeb73b9593a38f8e9f418337fc7d10.png", "/staff-app/assets/node_modules/expo-router/assets/forward.d8b800c443b8972542883e0b9de2bdc6.png", "/staff-app/assets/node_modules/expo-router/assets/pkg.ab19f4cbc543357183a20571f68380a3.png", "/staff-app/assets/node_modules/expo-router/assets/react-navigation/elements/back-icon-mask.0a328cd9c1afd0afe8e3b1ec5165b1b4.png", "/staff-app/assets/node_modules/expo-router/assets/react-navigation/elements/back-icon.35ba0eaec5a4f5ed12ca16fabeae451d.png", "/staff-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55.png", "/staff-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@2x.png", "/staff-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@3x.png", "/staff-app/assets/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@4x.png", "/staff-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7.png", "/staff-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@2x.png", "/staff-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@3x.png", "/staff-app/assets/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@4x.png", "/staff-app/assets/node_modules/expo-router/assets/react-navigation/elements/search-icon.286d67d3f74808a60a78d3ebf1a5fb57.png", "/staff-app/assets/node_modules/expo-router/assets/sitemap.412dd9275b6b48ad28f5e3d81bb1f626.png", "/staff-app/assets/node_modules/expo-router/assets/unmatched.20e71bdf79e3a97bf55fd9e164041578.png", "/staff-app/brand-logo.png", "/staff-app/favicon.ico", "/staff-app/icon-192.png", "/staff-app/icon-512.png", "/staff-app/icon-maskable-192.png", "/staff-app/icon-maskable-512.png", "/staff-app/manifest.webmanifest", "/staff-app/index.html", "/staff-app/_expo/static/js/web/bundle.js?v=77c2d3cfd5fd94ee1228de2e1412dbd6be7c098d148be9e853827b23e30e437e"]; // Hugging Face serves large files (fonts) through a redirect to its CDN. Browsers refuse to hand a *redirected* cached // response to a page, so store a plain copy instead (otherwise fonts, and so the app, fail to load offline). const plain = r => r.redirected ? r.blob().then(b => new Response(b, { status: 200, headers: { 'Content-Type': r.headers.get('Content-Type') || b.type || 'application/octet-stream' } })) : Promise.resolve(r); diff --git a/staff-app/team.html b/staff-app/team.html index c593333911bda5b8b839492f0d1268525be51507..0ec7575966bc9721ac0cf492e2f11df46237e36f 100644 --- a/staff-app/team.html +++ b/staff-app/team.html @@ -96,5 +96,5 @@ function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdat }, 1000); })(); - +