diff --git a/CHECKSUMS.txt b/CHECKSUMS.txt
new file mode 100644
index 0000000000000000000000000000000000000000..5a33de604ae36acba89b525d0d193c2463429ab8
--- /dev/null
+++ b/CHECKSUMS.txt
@@ -0,0 +1,23 @@
+Cover Charge prototype v0.1.5: web apps only. No APKs were built for v0.1.2, v0.1.3, v0.1.4 or v0.1.5.
+SHA-256 of each web app's start page, service worker, manifest and logo:
+
+bf8e4606058aa5baab587e2237e744abbe4d257cb309efc6ecdc2f41d91c4874 owner-app/index.html
+a1e9e50f94328def90fd4968c6f41d91c23a89b1f82175a46f6d2eceeb463815 owner-app/sw.js
+f55e319dbc2c60a4fdc484584098bc3c80b780d7ee8b8df280c30a673f94e69d owner-app/manifest.webmanifest
+cc3dd9b8a359ba6c3f28d625c27cc6a01a46233311c2a5f5c8aaf09e91be8239 owner-app/brand-logo.png
+894fdfceecbecbcc4c20b086a8695b38dd17c7388fae84ea97f480b0981aef61 staff-app/index.html
+b52321b56e4acfe2ffaf0d54b82b5638d656e18d5a48cd0971fa0878e8d1d5bf staff-app/sw.js
+18923b63d620744c81e8ae77204858313f0e3c54683b0c68a4ef6417975b92e3 staff-app/manifest.webmanifest
+cc3dd9b8a359ba6c3f28d625c27cc6a01a46233311c2a5f5c8aaf09e91be8239 staff-app/brand-logo.png
+30e807a345a3cdc33df495488715f3f2085dd401c75476966bcb1c0ff3f390c6 customer-app/index.html
+fdd89c576e124511accea5895ca567c1fdaba5d57d12089625fb2fe1a42eeeab customer-app/sw.js
+559816eba2698515c255da3cb9240a338f5bf8f5a4826a64e332cf51d5522e09 customer-app/manifest.webmanifest
+cc3dd9b8a359ba6c3f28d625c27cc6a01a46233311c2a5f5c8aaf09e91be8239 customer-app/brand-logo.png
+1eb73aab3e53691a6fbfda81c1aa2fbf3a238dd051c24a3f391bd0f2e5d87ff9 display-app/index.html
+0a825fd815da365b61c83a29935b32d93178155456282566919bf90b0f5e8e2c display-app/sw.js
+8212811f397e23840df0b7ecb6a753ce5532c9383d6fdcad71b2deea30665077 display-app/manifest.webmanifest
+cc3dd9b8a359ba6c3f28d625c27cc6a01a46233311c2a5f5c8aaf09e91be8239 display-app/brand-logo.png
+23131f966b85ccbf541080bde186c146e4c8a4b0d54c78fcb86928ba6e931181 chef-app/index.html
+0a2adf18f6c162485b6cd23c43c312d3df414c04db5ee2922a5ec572bb7ccc09 chef-app/sw.js
+7aa962371046330167f56dd74180ed58cba417770e3e4bae9ec8289b1837c461 chef-app/manifest.webmanifest
+cc3dd9b8a359ba6c3f28d625c27cc6a01a46233311c2a5f5c8aaf09e91be8239 chef-app/brand-logo.png
diff --git a/HOW-TO-INSTALL.txt b/HOW-TO-INSTALL.txt
new file mode 100644
index 0000000000000000000000000000000000000000..67ed108ae3175279ace54cfe966e3f3d766938c3
--- /dev/null
+++ b/HOW-TO-INSTALL.txt
@@ -0,0 +1,42 @@
+Cover Charge prototype apps, v0.1.5 (web apps)
+Pilot restaurant: The Anchorage, Harbour View, Dunure
+
+These are test versions with made-up demo data. No real payments, messages, social posts or location tracking happen.
+They are web apps: open them in the browser, then add them to the Home screen so they open like a normal app.
+They work on Android (Chrome, or Huawei Browser on phones without Google Play), iPhone and iPad.
+
+WHERE TO FIND THEM
+Download page: https://covercharge-apps.static.hf.space/
+- The Anchorage (customer app): https://covercharge-apps.static.hf.space/customer-app/index.html
+- Staff: https://covercharge-apps.static.hf.space/staff-app/index.html
+- Display: https://covercharge-apps.static.hf.space/display-app/index.html
+- Head Chef: https://covercharge-apps.static.hf.space/chef-app/index.html
+- Managers: https://covercharge-apps.static.hf.space/owner-app/index.html
+Apps already added to a Home screen from the old address keep working there; for new phones use the links above.
+
+THE FIVE APPS (links on the download page)
+Cover Charge for Managers: for the owner, GM and managers. Dashboard, forecasts, orders, bookings, menu and app content, rotas, timesheets, tips, payroll, suppliers, loyalty, marketing, social posting (demo), branding and quick links.
+Cover Charge for Staff: for staff phones. Clock in and out (with break question), rota, swaps and leave, staff chat, my hours and pay, my tips.
+Cover Charge: the customer app, what guests see. Takeaway, order at table, bookings, waitlist, stamp card, gift cards, allergens, offers, what's on, feedback.
+Cover Charge for Display: for a tablet in the restaurant, held sideways. Live bookings, orders, kitchen tickets, allergy and takeaway alerts, who's on, forecast.
+Cover Charge for Head Chef: stock and deliveries, recipe costing and GP, menu engineering, waste, ordering, prep lists, allergens, kitchen compliance, kitchen rota and chat.
+
+ADD TO HOME SCREEN
+Android, Chrome: tap "Open app", open the menu (the three dots), tap "Add to home screen" or "Install app", then "Install".
+Android, Huawei Browser: tap "Open app", open the menu, tap "Add to" > "Home screen" (on some versions "Add page to" > "Home screen" or "Desktop"), then "Add".
+No icon appears? On Huawei phones open Settings > Apps > Huawei Browser (or Chrome) > Permissions and allow "Create shortcuts" / "Create desktop shortcuts", then try again.
+On phones without Google Play, Chrome shows "Add to home screen" rather than "Install"; both work. Built-in browsers inside other apps don't offer it: open the link in Chrome or Huawei Browser first.
+iPhone or iPad, Safari: tap "Open app", tap Share (the square with an arrow), then "Add to Home Screen", then "Add".
+
+The icons show The Anchorage logo. Open each app from its new icon. After the first visit it also opens without a signal.
+All five can be added to the same phone side by side. On one phone they share the same demo data.
+
+TIPS
+- Cover Charge for Managers: More > Branding sets your logo and accent colour for all five apps.
+- Cover Charge for Managers: More > Your apps has an Open button and a Copy link button for each of the five apps (each opens in a new tab).
+- Home screen icons are labelled The Anchorage (customers), Managers · Anchorage, Staff · Anchorage, Display · Anchorage and Head Chef · Anchorage.
+- Cover Charge for Managers: tap the role pill at the top to preview what staff see. More > All features gives a guided tour.
+- Cover Charge for Display: best on a tablet held sideways.
+- To remove one: long-press its icon > Remove (Android) or Remove App (iPhone).
+
+These are prototypes. Please report anything that looks wrong, with a screenshot if you can.
diff --git a/README.md b/README.md
index 8f1d202f7951f00df59156ecb507478142094969..c3d4248bd18605d65d78b570d2904137b587a70c 100644
--- a/README.md
+++ b/README.md
@@ -1,10 +1,17 @@
---
-title: Apps
-emoji: 🦀
-colorFrom: blue
-colorTo: indigo
+title: CoverCharge apps
+emoji: 🍽️
+colorFrom: yellow
+colorTo: gray
sdk: static
+app_file: index.html
pinned: false
+short_description: Cover Charge prototype, five web apps, demo data
---
-Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
+# Cover Charge apps (prototype v0.1.5)
+
+Web apps (PWAs) for The Anchorage, Harbour View, Dunure: Managers, Staff, the customer app, Display and Head Chef.
+Each one opens in the browser and can be added to the Home screen (Chrome, Huawei Browser, Safari).
+
+Prototype only: demo data, no real payments, messages or social posts.
diff --git a/assets/Poppins-OFL.txt b/assets/Poppins-OFL.txt
new file mode 100644
index 0000000000000000000000000000000000000000..76df3b565672e3248a5715339d092d4cb6c75019
--- /dev/null
+++ b/assets/Poppins-OFL.txt
@@ -0,0 +1,93 @@
+Copyright 2020 The Poppins Project Authors (https://github.com/itfoundry/Poppins)
+
+This Font Software is licensed under the SIL Open Font License, Version 1.1.
+This license is copied below, and is also available with a FAQ at:
+http://scripts.sil.org/OFL
+
+
+-----------------------------------------------------------
+SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
+-----------------------------------------------------------
+
+PREAMBLE
+The goals of the Open Font License (OFL) are to stimulate worldwide
+development of collaborative font projects, to support the font creation
+efforts of academic and linguistic communities, and to provide a free and
+open framework in which fonts may be shared and improved in partnership
+with others.
+
+The OFL allows the licensed fonts to be used, studied, modified and
+redistributed freely as long as they are not sold by themselves. The
+fonts, including any derivative works, can be bundled, embedded,
+redistributed and/or sold with any software provided that any reserved
+names are not used by derivative works. The fonts and derivatives,
+however, cannot be released under any other type of license. The
+requirement for fonts to remain under this license does not apply
+to any document created using the fonts or their derivatives.
+
+DEFINITIONS
+"Font Software" refers to the set of files released by the Copyright
+Holder(s) under this license and clearly marked as such. This may
+include source files, build scripts and documentation.
+
+"Reserved Font Name" refers to any names specified as such after the
+copyright statement(s).
+
+"Original Version" refers to the collection of Font Software components as
+distributed by the Copyright Holder(s).
+
+"Modified Version" refers to any derivative made by adding to, deleting,
+or substituting -- in part or in whole -- any of the components of the
+Original Version, by changing formats or by porting the Font Software to a
+new environment.
+
+"Author" refers to any designer, engineer, programmer, technical
+writer or other person who contributed to the Font Software.
+
+PERMISSION & CONDITIONS
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of the Font Software, to use, study, copy, merge, embed, modify,
+redistribute, and sell modified and unmodified copies of the Font
+Software, subject to the following conditions:
+
+1) Neither the Font Software nor any of its individual components,
+in Original or Modified Versions, may be sold by itself.
+
+2) Original or Modified Versions of the Font Software may be bundled,
+redistributed and/or sold with any software, provided that each copy
+contains the above copyright notice and this license. These can be
+included either as stand-alone text files, human-readable headers or
+in the appropriate machine-readable metadata fields within text or
+binary files as long as those fields can be easily viewed by the user.
+
+3) No Modified Version of the Font Software may use the Reserved Font
+Name(s) unless explicit written permission is granted by the corresponding
+Copyright Holder. This restriction only applies to the primary font name as
+presented to the users.
+
+4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
+Software shall not be used to promote, endorse or advertise any
+Modified Version, except to acknowledge the contribution(s) of the
+Copyright Holder(s) and the Author(s) or with their explicit written
+permission.
+
+5) The Font Software, modified or unmodified, in part or in whole,
+must be distributed entirely under this license, and must not be
+distributed under any other license. The requirement for fonts to
+remain under this license does not apply to any document created
+using the Font Software.
+
+TERMINATION
+This license becomes null and void if any of the above conditions are
+not met.
+
+DISCLAIMER
+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
+DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
+OTHER DEALINGS IN THE FONT SOFTWARE.
diff --git a/assets/Poppins_400Regular.ttf b/assets/Poppins_400Regular.ttf
new file mode 100644
index 0000000000000000000000000000000000000000..9d6366e199b9abeb268629513f12b69cbc6edd8b
--- /dev/null
+++ b/assets/Poppins_400Regular.ttf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:707fdc5c8bab57a90061c6a8ed7b70d5ffb82fc810e994e79f90bace890c255a
+size 158240
diff --git a/assets/Poppins_600SemiBold.ttf b/assets/Poppins_600SemiBold.ttf
new file mode 100644
index 0000000000000000000000000000000000000000..1610c6423a4a34725dfcbc647c2e967f25b520d4
--- /dev/null
+++ b/assets/Poppins_600SemiBold.ttf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:248c0244b350ec68880996aa6be6d7796274b49992d5fcbbefe251906aa4ea36
+size 155232
diff --git a/assets/Poppins_700Bold.ttf b/assets/Poppins_700Bold.ttf
new file mode 100644
index 0000000000000000000000000000000000000000..acce884bab965ba94f76a09a0c0e29ea1808d396
--- /dev/null
+++ b/assets/Poppins_700Bold.ttf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:7219547ee25334cbac0fe4b3acf0bf631e48ebb622c71af038edaaa652c60875
+size 153944
diff --git a/assets/apple-touch-icon.png b/assets/apple-touch-icon.png
new file mode 100644
index 0000000000000000000000000000000000000000..c97c3a8231a3ed2ac30544e04f3a5e9b61a7384c
Binary files /dev/null and b/assets/apple-touch-icon.png differ
diff --git a/assets/icon-192.png b/assets/icon-192.png
new file mode 100644
index 0000000000000000000000000000000000000000..00edb646c240ff8e43523966ae77729ad4ccb7ee
Binary files /dev/null and b/assets/icon-192.png differ
diff --git a/assets/icon-512.png b/assets/icon-512.png
new file mode 100644
index 0000000000000000000000000000000000000000..eb54a2b179fef1196001e90088b6467b98012312
Binary files /dev/null and b/assets/icon-512.png differ
diff --git a/assets/logo-256.png b/assets/logo-256.png
new file mode 100644
index 0000000000000000000000000000000000000000..0ddc23bb47f45001d100516cc2790b4f36b01a5e
Binary files /dev/null and b/assets/logo-256.png differ
diff --git a/chef-app/_expo/static/js/web/+not-found-da8ea3ec55bebb0779db542f35c6adf9.js b/chef-app/_expo/static/js/web/+not-found-da8ea3ec55bebb0779db542f35c6adf9.js
new file mode 100644
index 0000000000000000000000000000000000000000..40315ebd5b8ec2886eaf5bd493a19d355837e850
--- /dev/null
+++ b/chef-app/_expo/static/js/web/+not-found-da8ea3ec55bebb0779db542f35c6adf9.js
@@ -0,0 +1 @@
+__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 c}});var t=r(d[0]);r(d[1]);var n=r(d[2]),u=r(d[3]);function c(){return(0,u.jsx)(t.Redirect,{href:n.ENTRY[n.APP_VARIANT]})}},782,[785,12,787,6]);
\ No newline at end of file
diff --git a/chef-app/_expo/static/js/web/[did]-91eaf603d23bc2b2b79e4e95467ef972.js b/chef-app/_expo/static/js/web/[did]-91eaf603d23bc2b2b79e4e95467ef972.js
new file mode 100644
index 0000000000000000000000000000000000000000..12ec5e8d94ffcf3754f4bc7412a7e6bb8bdcbe8d
--- /dev/null
+++ b/chef-app/_expo/static/js/web/[did]-91eaf603d23bc2b2b79e4e95467ef972.js
@@ -0,0 +1 @@
+__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 p}});var e,n=_r(_d[0]),t=_r(_d[1]),l=_r(_d[2]),s=(e=l)&&e.__esModule?e:{default:e},a=_r(_d[3]),r=_r(_d[4]),o=_r(_d[5]),d=_r(_d[6]),c=_r(_d[7]),u=_r(_d[8]),g=_r(_d[9]),h=_r(_d[10]);function p(){const{rid:e,did:l}=(0,n.useLocalSearchParams)(),p=(0,u.useRestaurant)(e),f=(0,u.useMenu)(e).find(e=>e.id===l),b=(0,u.useCustomer)(),j=(0,u.useStore)(e=>e.addLine),[x,m]=(0,t.useState)(()=>(f?.optionGroups??[]).filter(e=>e.required).map(e=>e.choices[0].id)),[y,k]=(0,t.useState)(1),[v,w]=(0,t.useState)(''),[S,B]=(0,t.useState)(!1),[C,$]=(0,t.useState)(!1),[P,I]=(0,t.useState)(!1),[T,L]=(0,t.useState)(!1),D=(0,t.useMemo)(()=>f?(0,d.effectiveAllergens)(f,x):{},[f,x]);if(!p||!f)return(0,h.jsx)(o.Screen,{title:"Not found",children:(0,h.jsx)(o.T,{children:"Dish not found."})});const O=(0,d.conflictsFor)(D,b.allergies),A=(f.price??0)+(f.optionGroups??[]).flatMap(e=>e.choices).filter(e=>x.includes(e.id)).reduce((e,n)=>e+n.priceDelta,0),q=f.soldOut||!f.signOff||null===f.price,M=(e,n)=>{const t=f.optionGroups.find(n=>n.id===e);m(e=>{const l=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=>!l.includes(e)),n]})},_=e=>{u.useStore.getState().basket.restaurantId!==p.id&&u.useStore.getState().startBasket(p.id,'takeaway'),j({itemId:f.id,qty:y,choiceIds:x,notes:v,override:e?{allergens:O.contains,at:(new Date).toISOString()}:void 0}),B(!1),L(!0)};return(0,h.jsxs)(o.Screen,{title:f.name,subtitle:p.name,right:(0,h.jsx)(r.BasketButton,{}),children:[(0,h.jsxs)(o.Row,{wrap:!0,gap:6,children:[(0,h.jsx)(o.T,{weight:"bold",size:20,colour:g.colours.gold,children:null===f.price?f.priceNote:(0,c.gbp)(A)}),f.dietary.map(e=>(0,h.jsx)(o.Badge,{kind:"green",label:e},e))]}),(0,h.jsx)(o.T,{children:f.description}),O.contains.length?(0,h.jsx)(o.Banner,{kind:"danger",title:`Blocked: contains ${O.contains.map(d.allergenLabel).join(', ')}`,children:`You\u2019ve told us: ${b.allergies.filter(e=>O.contains.includes(e.allergen)).map(e=>`${(0,d.allergenLabel)(e.allergen)} \u2014 ${(0,d.severityLabel)(e.severity)}`).join('; ')}. This dish can\u2019t be added unless you deliberately override (for example, ordering for someone else).`}):null,O.may.length?(0,h.jsx)(o.Banner,{kind:"warn",title:`Warning: may contain ${O.may.map(d.allergenLabel).join(', ')}`,children:"Cross-contact is possible (e.g. shared fryer). Please speak to staff before ordering."}):null,(f.optionGroups??[]).map(e=>(0,h.jsxs)(o.Card,{children:[(0,h.jsxs)(o.T,{weight:"semibold",children:[e.name,e.required?' (required)':' (optional)']}),(0,h.jsx)(o.Row,{wrap:!0,gap:6,children:e.choices.map(n=>(0,h.jsx)(o.Chip,{label:n.label,sub:n.priceDelta?`+${(0,c.gbp)(n.priceDelta)}`:void 0,selected:x.includes(n.id),onPress:()=>M(e.id,n.id)},n.id))})]},e.id)),(0,h.jsx)(o.Card,{children:(0,h.jsx)(a.AllergenPanel,{item:f,map:D,declared:b.allergies})}),p.fictional?null:(0,h.jsx)(o.ExampleAllergenNotice,{}),(0,h.jsx)(o.Field,{label:"Notes for the kitchen (optional)",placeholder:"e.g. no gherkins",value:v,onChangeText:w}),(0,h.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,h.jsx)(o.T,{weight:"semibold",children:"Quantity"}),(0,h.jsx)(o.Stepper,{value:y,onChange:k,label:"quantity"})]}),T?(0,h.jsx)(o.Banner,{kind:"success",title:"Added to basket",children:O.contains.length?'Allergy override recorded \u2014 the kitchen will see a large allergy alert.':'Carry on browsing or go to your basket.'}):null,q?(0,h.jsx)(o.Banner,{kind:"warn",children:f.soldOut?'Sold out today.':f.signOff?'Price on the specials board \u2014 ask staff.':'Not available to order online until the head chef signs off its allergens.'}):O.contains.length?(0,h.jsxs)(s.default,{style:{gap:8},children:[(0,h.jsx)(o.Button,{kind:"secondary",label:"Choose something else",onPress:()=>n.router.back()}),(0,h.jsx)(o.Button,{kind:"danger",label:"Override and add anyway\u2026",onPress:()=>{$(!1),I(!1),B(!0)},testID:"override-open"})]}):(0,h.jsxs)(o.Row,{gap:8,children:[(0,h.jsx)(o.Button,{style:{flex:1},label:`Add ${y} to basket \xb7 ${(0,c.gbp)(A*y)}`,onPress:()=>_(!1),testID:"add-to-basket"}),T?(0,h.jsx)(o.Button,{kind:"secondary",label:"Basket",onPress:()=>n.router.push('/customer/basket')}):null]}),(0,h.jsxs)(o.Sheet,{visible:S,onClose:()=>B(!1),title:"Allergy override",children:[(0,h.jsx)(o.Banner,{kind:"danger",title:`${f.name} contains ${O.contains.map(d.allergenLabel).join(', ')}`,children:`Your profile says: ${b.allergies.filter(e=>O.contains.includes(e.allergen)).map(e=>`${(0,d.allergenLabel)(e.allergen)} \u2014 ${(0,d.severityLabel)(e.severity)}`).join('; ')}.`}),(0,h.jsx)(o.Toggle,{label:"I understand this dish contains an allergen I have declared",value:C,onChange:$}),(0,h.jsx)(o.Toggle,{label:"It is for someone without this allergy, or I have spoken to staff",value:P,onChange:I}),(0,h.jsx)(o.Muted,{children:"The override is logged and shown to the kitchen as an allergy alert that must be acknowledged."}),(0,h.jsx)(o.Button,{kind:"danger",disabled:!C||!P,label:"Confirm override and add",onPress:()=>_(!0),testID:"override-confirm"})]})]})}},760,[785,12,109,798,799,790,791,793,796,797,6]);
\ No newline at end of file
diff --git a/chef-app/_expo/static/js/web/[n]-e07421962f3951aaf0f9cdf16bfbce72.js b/chef-app/_expo/static/js/web/[n]-e07421962f3951aaf0f9cdf16bfbce72.js
new file mode 100644
index 0000000000000000000000000000000000000000..572b0a2a9dd1e104bbbc71d5ef383567fda701b5
--- /dev/null
+++ b/chef-app/_expo/static/js/web/[n]-e07421962f3951aaf0f9cdf16bfbce72.js
@@ -0,0 +1 @@
+__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 c}});var t=_r(d[0]),r=_r(d[1]),n=_r(d[2]),u=_r(d[3]);function c(){const{n:c,r:s}=(0,t.useLocalSearchParams)(),o=(0,n.useStore)(t=>t.startBasket),[f,l]=(0,r.useState)(!1),b=s??'anchorage';return(0,r.useEffect)(()=>{o(b,'table',String(c)),l(!0)},[b,c]),f?(0,u.jsx)(t.Redirect,{href:`/customer/${b}`}):null}},776,[785,12,796,6]);
\ No newline at end of file
diff --git a/chef-app/_expo/static/js/web/[oid]-a911bc47304589ae845932228484acd1.js b/chef-app/_expo/static/js/web/[oid]-a911bc47304589ae845932228484acd1.js
new file mode 100644
index 0000000000000000000000000000000000000000..a29217de0dd24d1e29cd8b24b6393228dc0a93d7
--- /dev/null
+++ b/chef-app/_expo/static/js/web/[oid]-a911bc47304589ae845932228484acd1.js
@@ -0,0 +1 @@
+__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 w}});var e,t=_r(d[0]),l=_r(d[1]),s=_r(d[2]),r=(e=s)&&e.__esModule?e:{default:e},n=_r(d[3]),o=_r(d[4]),i=_r(d[5]),c=_r(d[6]),u=_r(d[7]),h=_r(d[8]),p=_r(d[9]),b=_r(d[10]),y=_r(d[11]);const j=[['new','Placed'],['acknowledged','Accepted'],['preparing','Cooking'],['ready','Ready to collect'],['collected','Collected']],x=[['new','Sent'],['acknowledged','Accepted'],['preparing','Cooking'],['served','Food out'],['closed','Paid']];function w(){const{oid:e}=(0,t.useLocalSearchParams)(),s=(0,p.useOrder)(e),w=(0,p.useRestaurant)(s?.restaurantId),[f,T]=(0,l.useState)(0),[C,k]=(0,l.useState)(''),[S,v]=(0,l.useState)(!1),[P,M]=(0,l.useState)(!1),[$,A]=(0,l.useState)(1),[R,I]=(0,l.useState)(0),[O,B]=(0,l.useState)(s?.split?.ways??1);if(!s||!w)return(0,y.jsx)(i.Screen,{title:"Order",children:(0,y.jsx)(i.T,{children:"Order not found."})});const N='takeaway'===s.type?j:x,H=Math.max(0,N.findIndex(([e])=>e===s.status)),_=Math.round(s.subtotal*R/100),D='table'===s.type?s.subtotal+(s.split?s.tip:_):s.total,F=D-s.paid,q=s.split?.ways??O,L=s.split?.paidShares??0,W=Math.ceil(D/q),Y='collected'===s.status||'closed'===s.status;return(0,y.jsxs)(i.Screen,{title:`Order ${s.ref}`,subtitle:`${w.name} \xb7 ${'table'===s.type?`Table ${s.tableNo}`:`Collection at ${s.slotTime?(0,h.hm)(new Date(s.slotTime)):'\u2014'}`}`,children:['takeaway'===s.type?(0,y.jsx)(i.Banner,{kind:"success",title:'ready'===s.status?'Your order is ready!':'Order placed and paid (demo)',children:'ready'===s.status?'Head to the bar and give your order number. Staff will check allergies with you at handover.':`Show order number ${s.ref} at the bar when you arrive.`}):null,(0,y.jsxs)(i.Card,{children:[(0,y.jsx)(i.H2,{children:"Status"}),N.map(([e,t],l)=>(0,y.jsxs)(i.Row,{gap:10,children:[(0,y.jsx)(r.default,{style:{width:22,height:22,borderRadius:11,backgroundColor:l<=H?b.colours.gold:b.colours.surface2,borderWidth:1,borderColor:b.colours.gold}}),(0,y.jsx)(i.T,{weight:l===H?'semibold':'regular',colour:l<=H?b.colours.text:b.colours.muted,children:t})]},e)),s.allergyAck?(0,y.jsxs)(i.Muted,{children:["Allergy alert acknowledged by kitchen (",s.allergyAck.by,", ",(0,h.hm)(new Date(s.allergyAck.at)),")"]}):s.allergies.length?(0,y.jsx)(i.Muted,{children:"Waiting for the kitchen to acknowledge your allergies\u2026"}):null,'takeaway'!==s.type||Y?null:(0,y.jsxs)(i.Row,{gap:8,children:[(0,y.jsx)(i.Button,{small:!0,kind:'on-my-way'===s.customerSignal?'primary':'secondary',label:"On my way",onPress:()=>p.repo.orders.customerSignal(s.id,'on-my-way')}),(0,y.jsx)(i.Button,{small:!0,kind:'here'===s.customerSignal?'primary':'secondary',label:"I\u2019m here",onPress:()=>p.repo.orders.customerSignal(s.id,'here')})]})]}),(0,y.jsxs)(i.Card,{children:[(0,y.jsx)(i.H2,{children:"Items"}),s.lines.map((e,t)=>(0,y.jsxs)(r.default,{children:[(0,y.jsxs)(i.Row,{style:{justifyContent:'space-between'},children:[(0,y.jsxs)(i.T,{style:{flex:1},children:[e.qty,"\xd7 ",e.name]}),(0,y.jsx)(i.T,{children:(0,u.gbp)(e.unitPrice*e.qty)})]}),e.choices.length?(0,y.jsx)(i.Muted,{children:e.choices.join(' \xb7 ')}):null,e.overridden?(0,y.jsx)(i.Badge,{kind:"red",label:`Allergy override: ${e.contains.map(c.allergenLabel).join(', ')}`}):null]},t)),(0,y.jsxs)(i.Row,{style:{justifyContent:'space-between'},children:[(0,y.jsx)(i.Muted,{children:"Subtotal"}),(0,y.jsx)(i.T,{children:(0,u.gbp)(s.subtotal)})]}),s.giftCardApplied?(0,y.jsxs)(i.Row,{style:{justifyContent:'space-between'},children:[(0,y.jsx)(i.Muted,{children:"Of which gift card"}),(0,y.jsxs)(i.T,{colour:b.colours.green,children:["\u2212",(0,u.gbp)(s.giftCardApplied)]})]}):null,s.tip?(0,y.jsxs)(i.Row,{style:{justifyContent:'space-between'},children:[(0,y.jsx)(i.Muted,{children:"Tip"}),(0,y.jsx)(i.T,{children:(0,u.gbp)(s.tip)})]}):null,(0,y.jsxs)(i.Row,{style:{justifyContent:'space-between'},children:[(0,y.jsx)(i.T,{weight:"semibold",children:"Paid (demo)"}),(0,y.jsx)(i.T,{weight:"semibold",colour:b.colours.gold,children:(0,u.gbp)(s.paid)})]})]}),'table'===s.type&&'closed'!==s.status&&'cancelled'!==s.status?(0,y.jsxs)(i.Card,{highlight:b.colours.gold,children:[(0,y.jsxs)(i.H2,{children:["Your bill \u2014 Table ",s.tableNo]}),s.split?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(i.T,{children:["Total ",(0,u.gbp)(D)," \xb7 split ",q," way",q>1?'s':''," \xb7 ",(0,u.gbp)(W)," each"]}),(0,y.jsxs)(i.T,{children:["Shares paid: ",L," of ",q," \xb7 remaining ",(0,u.gbp)(F)]}),q>1?(0,y.jsxs)(i.Row,{style:{justifyContent:'space-between'},children:[(0,y.jsx)(i.T,{children:"Shares to pay now"}),(0,y.jsx)(i.Stepper,{value:$,onChange:A,min:1,max:q-L,label:"shares"})]}):null,(0,y.jsx)(i.Button,{label:`Pay ${q>1?`${$} share${$>1?'s':''}`:'bill'} \xb7 ${(0,u.gbp)(Math.min(F,W*$))}`,onPress:()=>M(!0),testID:"pay-bill"})]}):(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(i.T,{weight:"semibold",children:"Add a tip?"}),(0,y.jsx)(i.Row,{wrap:!0,children:[0,10,12.5,15].map(e=>(0,y.jsx)(i.Chip,{label:e?`${e}%`:'No tip',selected:R===e,onPress:()=>I(e)},e))}),(0,y.jsx)(i.Muted,{children:"Tips go to staff under the restaurant\u2019s tipping policy (Employment (Allocation of Tips) Act 2023)."}),(0,y.jsxs)(i.Row,{style:{justifyContent:'space-between'},children:[(0,y.jsx)(i.T,{weight:"semibold",children:"Split evenly between"}),(0,y.jsx)(i.Stepper,{value:O,onChange:B,min:1,max:8,label:"people"})]}),(0,y.jsxs)(i.T,{children:["Total ",(0,u.gbp)(s.subtotal+_),O>1?` \xb7 ${(0,u.gbp)(Math.ceil((s.subtotal+_)/O))} each`:'']}),(0,y.jsx)(i.Button,{label:"Get the bill",onPress:()=>p.repo.orders.setSplit(s.id,O,_),testID:"get-bill"})]})]}):null,!Y||s.rated||S?null:(0,y.jsxs)(i.Card,{highlight:b.colours.gold,children:[(0,y.jsx)(i.H2,{children:"How was everything?"}),(0,y.jsxs)(i.Muted,{children:["One tap \u2014 this goes privately to ",w.name," only, never published."]}),(0,y.jsx)(o.Stars,{value:f,onChange:T}),f?(0,y.jsx)(i.Field,{label:"Anything to add? (optional)",value:C,onChangeText:k}):null,(0,y.jsx)(i.Button,{label:"Send feedback",disabled:!f,onPress:()=>{p.repo.feedback.add({restaurantId:w.id,orderId:s.id,customerId:s.customerId,customerName:s.customerName,stars:f,comment:C,context:'table'===s.type?`Table ${s.tableNo}`:`Takeaway ${s.ref}`}),v(!0)},testID:"send-rating"})]}),S||s.rated?(0,y.jsx)(i.Banner,{kind:"success",children:"Thanks \u2014 your feedback went privately to the restaurant."}):null,Y?(0,y.jsx)(i.Button,{kind:"secondary",label:"View stamp card",onPress:()=>t.router.push(`/customer/${w.id}/loyalty`)}):null,(0,y.jsx)(n.MockPay,{visible:P,onClose:()=>M(!1),amount:Math.min(F,W*$),restaurantId:w.id,title:`Pay \u2014 Table ${s.tableNo}`,onPaid:e=>{p.repo.orders.payTable(s.id,{shares:$,giftCardCode:e.giftCardCode}),M(!1),A(1)}})]})}},773,[785,12,109,789,800,790,791,793,795,796,797,6]);
\ No newline at end of file
diff --git a/chef-app/_expo/static/js/web/[section]-11e4dec81ff7b7cd85a190186e1ec965.js b/chef-app/_expo/static/js/web/[section]-11e4dec81ff7b7cd85a190186e1ec965.js
new file mode 100644
index 0000000000000000000000000000000000000000..ec6ccbb17780aa1f41f2d060f7f15589120da71d
--- /dev/null
+++ b/chef-app/_expo/static/js/web/[section]-11e4dec81ff7b7cd85a190186e1ec965.js
@@ -0,0 +1 @@
+__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 s}});var t=r(d[0]);r(d[1]);var n=r(d[2]),c=r(d[3]),o=r(d[4]),f=r(d[5]);function s(){const{section:s}=(0,t.useLocalSearchParams)();return(0,c.canShow)('chef')?s&&(0,o.chefSectionAllowed)(String(s))?(0,f.jsx)(n.ChefApp,{section:String(s)},String(s)):(0,f.jsx)(t.Redirect,{href:"/kitchen"}):(0,f.jsx)(t.Redirect,{href:c.ENTRY[c.APP_VARIANT]})}},757,[785,12,786,787,788,6]);
\ No newline at end of file
diff --git a/chef-app/_expo/static/js/web/__common-f05de040c69ff0916eb219342bde7a88.js b/chef-app/_expo/static/js/web/__common-f05de040c69ff0916eb219342bde7a88.js
new file mode 100644
index 0000000000000000000000000000000000000000..ad48de99a94a80ae0e45c776a195a5b0c11ea0b3
--- /dev/null
+++ b/chef-app/_expo/static/js/web/__common-f05de040c69ff0916eb219342bde7a88.js
@@ -0,0 +1,101 @@
+__d(function(g,r,i,a,m,e,d){"use strict";function t(t,n){return Object.keys(t).forEach(function(c){"default"===c||Object.prototype.hasOwnProperty.call(n,c)||Object.defineProperty(n,c,{enumerable:!0,get:function(){return t[c]}})}),t}Object.defineProperty(e,"__esModule",{value:!0}),r(d[0]),t(r(d[1]),e),t(r(d[2]),e),t(r(d[3]),e),t(r(d[4]),e)},785,[899,900,910,911,913]);
+__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.ChefApp=function({section:e}={}){const{r:c,rid:p,me:T,now:C}=(0,b.useChef)(3e4),$=e?P[e]:void 0,[R,G]=(0,s.useState)($?.tab??'home'),[W,B]=(0,s.useState)($?.k??null),[L,O]=(0,s.useState)($?.stock??'levels'),[H,z]=(0,s.useState)($?.gp??'dishes'),A=(0,s.useRef)(null);(0,s.useEffect)(()=>{(0,h.ensureAttendance)((new Date).toISOString().slice(0,10),C)},[]);const I=(0,s.useCallback)((e,s=null)=>{G(e),B(s),A.current?.scrollTo({y:0,animated:!1})},[]);(0,s.useEffect)(()=>{const e=t.default.addEventListener('hardwareBackPress',()=>W?(B(null),!0):'home'!==R&&(G('home'),!0));return()=>e.remove()},[R,W]);const M=W?v.find(e=>e.id===W):null,_=M?M.title:{home:'Today in the kitchen',stock:'Stock',gp:'GP & costing',orders:'Ordering',kitchen:'Kitchen'}[R];return(0,y.jsxs)(i.SafeAreaView,{style:{flex:1,backgroundColor:u.colours.bg},edges:['top','bottom'],children:[(0,y.jsxs)(r.default,{style:{paddingHorizontal:14,paddingTop:8,paddingBottom:8,borderBottomWidth:1,borderColor:u.colours.border,gap:2},children:[(0,y.jsx)(n.PoweredBy,{}),(0,y.jsxs)(d.Row,{children:[(0,y.jsx)(n.RestaurantLogo,{rid:p}),(0,y.jsxs)(r.default,{style:{flex:1},children:[(0,y.jsx)(d.T,{weight:"semibold",size:17,numberOfLines:1,children:c.name}),(0,y.jsxs)(d.T,{size:12,colour:u.colours.gold,numberOfLines:1,children:["Head Chef \xb7 ",T.replace(' (example)','')]})]})]})]}),(0,y.jsxs)(o.default,{ref:A,contentContainerStyle:{padding:14,paddingBottom:30,gap:12,width:'100%',maxWidth:760,alignSelf:'center'},keyboardShouldPersistTaps:"handled",children:[(0,y.jsxs)(d.Row,{style:{justifyContent:'space-between'},children:[M?(0,y.jsx)(l.default,{accessibilityRole:"button",accessibilityLabel:"Back",onPress:()=>B(null),hitSlop:10,children:(0,y.jsx)(d.T,{size:15,colour:u.colours.gold,children:"\u2039 Kitchen"})}):null,(0,y.jsx)(d.T,{size:22,weight:"bold",style:{flex:1,textAlign:M?'right':'left'},children:_})]}),'home'===R?(0,y.jsx)(S,{go:(e,s)=>{'stock'===e&&s&&O(s),'gp'===e&&s&&z(s),I(e,'kitchen'===e?s??null:null)}}):null,'stock'===R?(0,y.jsx)(j.StockScreen,{initial:L},L):null,'gp'===R?(0,y.jsx)(f.GpScreen,{initial:H},H):null,'orders'===R?(0,y.jsx)(x.OrdersScreen,{}):null,'kitchen'!==R||M?null:(0,y.jsxs)(r.default,{style:{gap:10},children:[(0,y.jsx)(r.default,{style:{borderRadius:14,borderWidth:1,borderColor:u.colours.border,backgroundColor:u.colours.surface,overflow:'hidden'},children:v.map((e,s)=>(0,y.jsx)(l.default,{accessibilityRole:"button",accessibilityLabel:e.title,onPress:()=>B(e.id),style:({pressed:e})=>({padding:12,borderTopWidth:s?1:0,borderColor:u.colours.border,backgroundColor:e?'#1d1a14':'transparent'}),children:(0,y.jsxs)(d.Row,{style:{justifyContent:'space-between'},children:[(0,y.jsxs)(r.default,{style:{flex:1},children:[(0,y.jsx)(d.T,{weight:"medium",children:e.title}),(0,y.jsx)(d.Muted,{children:e.sub})]}),(0,y.jsx)(d.T,{colour:u.colours.muted,children:"\u203a"})]})},e.id))}),(0,y.jsx)(d.Muted,{children:"Head Chef sees kitchen, stock, food costs and GP. Payroll, wages and the restaurant's billing stay in Cover Charge for Managers."}),(0,y.jsx)(d.Muted,{center:!0,children:"Head Chef app \xb7 prototype v0.1.5 \xb7 demo data on this device only"})]}),'prep'===W?(0,y.jsx)(k.PrepScreen,{}):null,'live'===W?(0,y.jsx)(k.TeamScreen,{}):null,'waste'===W?(0,y.jsx)(k.WasteScreen,{}):null,'allergens'===W?(0,y.jsx)(k.AllergenScreen,{}):null,'compliance'===W?(0,y.jsx)(k.ComplianceScreen,{}):null]}),(0,y.jsx)(r.default,{accessibilityRole:"tablist",style:{flexDirection:'row',borderTopWidth:1,borderColor:u.colours.border,backgroundColor:u.colours.surface},children:w.map(e=>{const s=R===e.id;return(0,y.jsxs)(l.default,{accessibilityRole:"tab",accessibilityState:{selected:s},accessibilityLabel:e.label,onPress:()=>I(e.id),style:{flex:1,alignItems:'center',paddingVertical:8,minHeight:52},children:[(0,y.jsx)(d.T,{size:18,colour:s?u.colours.gold:u.colours.muted,children:e.icon}),(0,y.jsx)(d.T,{size:11,weight:s?'semibold':'regular',colour:s?u.colours.gold:u.colours.muted,children:e.label})]},e.id)})})]})};var s=_r(_d[0]),t=e(_r(_d[1])),l=e(_r(_d[2])),o=e(_r(_d[3])),r=e(_r(_d[4])),i=_r(_d[5]),n=_r(_d[6]),d=_r(_d[7]),c=_r(_d[8]),u=_r(_d[9]),h=_r(_d[10]),p=_r(_d[11]),b=_r(_d[12]),f=_r(_d[13]),k=_r(_d[14]),x=_r(_d[15]),j=_r(_d[16]),y=_r(_d[17]);const w=[{id:'home',label:'Home',icon:'\u2302'},{id:'stock',label:'Stock',icon:'\u25a4'},{id:'gp',label:'GP',icon:'%'},{id:'orders',label:'Orders',icon:'\u270e'},{id:'kitchen',label:'Kitchen',icon:'\u2668'}],v=[{id:'prep',title:'Prep list',sub:'From the forecast and bookings, tick off as you go'},{id:'live',title:'Live tickets, 86 & team',sub:'Orders, readiness alerts, sold out, who\u2019s on, rota, kitchen chat'},{id:'waste',title:'Waste log',sub:'Item, quantity, reason and cost; weekly total and % of sales'},{id:'allergens',title:'Allergens',sub:'14-allergen matrix from recipe cards, sign-off and audit log'},{id:'compliance',title:'Kitchen compliance',sub:'Fridge, freezer, cooking and cooling temps; cleaning; daily checks'}],P={stock:{tab:'stock',stock:'levels'},'stock-take':{tab:'stock',stock:'take'},deliveries:{tab:'stock',stock:'deliveries'},gp:{tab:'gp',gp:'dishes'},'price-changes':{tab:'gp',gp:'changes'},'gp-week':{tab:'gp',gp:'week'},'menu-engineering':{tab:'gp',gp:'engineering'},orders:{tab:'orders'},prep:{tab:'kitchen',k:'prep'},live:{tab:'kitchen',k:'live'},waste:{tab:'kitchen',k:'waste'},allergens:{tab:'kitchen',k:'allergens'},compliance:{tab:'kitchen',k:'compliance'}};function S({go:e}){const{k:s,c:t,menu:o}=(0,b.useChef)(3e4),i=(0,b.useWeek)(),{covers:n,label:h}=(0,b.useForecast)(),f=(0,x.useSuggestions)(),k=s.ingredients.filter(e=>e.onHand<=0||(0,b.isLow)(e.onHand,e.par)),j=f.filter(e=>e.ordersToday&&!e.placedToday),w=(0,p.priceImpacts)(o,s.recipes,s.ingredients,s.targetGp).filter(e=>e.dropped.length),v=s.deliveries.filter(e=>'expected'===e.status),P=t.filter(e=>e.below);return(0,y.jsxs)(r.default,{style:{gap:12},testID:"chef-dashboard",children:[(0,y.jsxs)(d.Row,{wrap:!0,gap:10,children:[(0,y.jsx)(b.Tile,{testID:"tile-gp",label:"GP this week vs target",value:(0,b.pct1)(i.theo),sub:`Target ${s.targetGp}% \xb7 actual ${(0,b.pct1)(i.actual)}`,tone:i.theoe('gp','week')}),(0,y.jsx)(b.Tile,{label:"Stock value",value:(0,c.gbp)((0,b.stockValue)(s.ingredients)),sub:"At cost",onPress:()=>e('stock','levels')}),(0,y.jsx)(b.Tile,{label:"Items low or out",value:`${k.length}`,sub:k.slice(0,3).map(e=>e.name).join(', '),tone:k.some(e=>e.onHand<=0)?'red':k.length?'amber':'green',onPress:()=>e('stock','levels')}),(0,y.jsx)(b.Tile,{label:"Waste this week",value:(0,c.gbp)(i.wasteWeek),sub:i.sales?`${(0,b.pct1)(i.wasteWeek/i.sales*100)} of food sales`:'',onPress:()=>e('kitchen','waste')}),(0,y.jsx)(b.Tile,{label:"Covers forecast today",value:`${n}`,sub:h,onPress:()=>e('kitchen','prep')}),(0,y.jsx)(b.Tile,{label:"Orders due today",value:`${j.length}`,sub:j.map(e=>`${e.s.name.replace(/^(Example|Sample) /,'')} by ${e.s.cutoff}`).join(' \xb7 ')||'None',tone:j.some(e=>e.cutPassed)?'red':j.length?'amber':'green',onPress:()=>e('orders')})]}),w.map(e=>(0,y.jsxs)(d.Banner,{kind:"danger",title:`${e.ing.name} ${e.pct>0?'+':''}${e.pct.toFixed(0)}%: ${e.dropped.length} dish${1===e.dropped.length?'':'es'} drop below target`,children:[e.dropped.map(e=>e.item.name).join(', '),". Open GP \u203a Price changes."]},e.ing.id)),v.length?(0,y.jsx)(l.default,{accessibilityRole:"button",onPress:()=>e('stock','deliveries'),children:(0,y.jsx)(d.Banner,{kind:"info",title:`${v.length} deliver${1===v.length?'y':'ies'} to check in today`,children:"Count in against the order, flag shorts and price changes."})}):null,P.length?(0,y.jsx)(l.default,{accessibilityRole:"button",onPress:()=>e('gp','dishes'),children:(0,y.jsxs)(d.Banner,{kind:"warn",title:`${P.length} dishes below ${s.targetGp}% GP`,children:[P.slice(0,4).map(e=>e.item.name).join(', '),P.length>4?'\u2026':'']})}):null,(0,y.jsx)(d.Row,{wrap:!0,gap:8,children:[['Prep list','prep'],['Live tickets & 86','live'],['Temperatures','compliance'],['Allergens','allergens']].map(([s,t])=>(0,y.jsx)(l.default,{accessibilityRole:"button",accessibilityLabel:s,onPress:()=>e('kitchen',t),style:{flexGrow:1,flexBasis:140,padding:12,borderRadius:12,borderWidth:1.5,borderColor:u.colours.gold,backgroundColor:u.colours.surface},children:(0,y.jsxs)(d.T,{weight:"semibold",children:[s," \u203a"]})},t))}),(0,y.jsx)(d.Badge,{kind:"neutral",label:"Demo data \xb7 nothing is ordered or sent"})]})}},786,[12,215,245,133,109,271,844,790,793,797,848,941,942,944,945,946,947,6]);
+__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"APP_VARIANT",{enumerable:!0,get:function(){return c}}),Object.defineProperty(_e,"ENTRY",{enumerable:!0,get:function(){return u}}),_e.isAllowedPath=function(e,t=c){return'/'===e||''===e||s[t].test(e)},_e.canShow=function(e,t=c){return t===e||'owner'===t&&'customer'===e};var e,t=r(d[0]),n=(e=t)&&e.__esModule?e:{default:e};const o=n.default.expoConfig?.extra?.appVariant??void 0??'owner',c=['owner','staff','customer','display','chef'].includes(o)?o:'owner',u={owner:'/owner',staff:'/team',customer:'/customer/anchorage',display:'/display',chef:'/kitchen'},s={owner:/^\/(owner|customer|table)(\/|$)/,customer:/^\/(customer|table)(\/|$)/,staff:/^\/team(\/|$)/,display:/^\/display(\/|$)/,chef:/^\/kitchen(\/|$)/}},787,[390]);
+__d(function(g,r,i,_a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"PERMISSIONS",{enumerable:!0,get:function(){return e}}),Object.defineProperty(_e,"can",{enumerable:!0,get:function(){return t}}),Object.defineProperty(_e,"CHEF_SECTIONS",{enumerable:!0,get:function(){return n}}),Object.defineProperty(_e,"chefSectionAllowed",{enumerable:!0,get:function(){return a}}),Object.defineProperty(_e,"rotaView",{enumerable:!0,get:function(){return s}}),Object.defineProperty(_e,"chatView",{enumerable:!0,get:function(){return l}}),Object.defineProperty(_e,"ticketView",{enumerable:!0,get:function(){return c}}),Object.defineProperty(_e,"supplierView",{enumerable:!0,get:function(){return o}}),Object.defineProperty(_e,"auditView",{enumerable:!0,get:function(){return f}});const e={owner:'all',manager:'all',staff:new Set(['rota-shifts','tickets','eighty-six','allergens']),chef:new Set(['stock','costing','gp','waste','dish-sales','prep','ordering','allergens','compliance','rota-shifts','kitchen-chat','tickets','eighty-six'])},t=(t,n)=>{const a=e[t];return'all'===a||a.has(n)},n={stock:'stock','stock-take':'stock',deliveries:'stock',gp:'gp','price-changes':'gp','gp-week':'gp','menu-engineering':'dish-sales',orders:'ordering',prep:'prep',live:'tickets',waste:'waste',allergens:'allergens',compliance:'compliance'},a=e=>e in n&&t('chef',n[e]),s=(e,n,a)=>t(e,'staff-personal')?{staff:n,shifts:a}:{staff:n.filter(e=>e.active).map(e=>({id:e.id,name:e.name,job:e.job})),shifts:a.map(({id:e,staffId:t,day:n,start:a,end:s})=>({id:e,staffId:t,day:n,start:a,end:s}))},l=(e,t)=>'chef'===e?t.filter(e=>'kitchen'===e.ch&&!e.removed):t,c=(e,n)=>t(e,'customer-personal')?n:n.map(({id:e,ref:t,type:n,tableNo:a,slotTime:s,lines:l,status:c,allergies:o,allergyAck:f,readiness:u,createdAt:p,restaurantId:m,notes:b})=>({id:e,ref:t,type:n,tableNo:a,slotTime:s,lines:l,status:c,allergies:o,allergyAck:f,readiness:u,createdAt:p,restaurantId:m,notes:b})),o=(e,n)=>t(e,'supplier-email')?n:n.map(e=>({...e,email:''})),f=(e,n)=>t(e,'audit-all')?n:n.filter(e=>'menu'===e.kind&&/allergen|sign-off/i.test(e.text))},788,[]);
+__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.MockPay=function({visible:e,onClose:j,amount:p,restaurantId:b,allowGiftCard:m=!0,onPaid:x,title:f="Pay",allowSaveCardOnly:y}){const g=(0,t.useGiftCards)(b).filter(e=>e.balance>0),[w,C]=(0,s.useState)(),[P,v]=(0,s.useState)('Demo card \u2022\u2022\u2022\u2022 4242'),[T,M]=(0,s.useState)(!1),S=g.find(e=>e.code===w),_=S?Math.min(S.balance,p):0,R=p-_;return(0,h.jsxs)(u.Sheet,{visible:e,onClose:j,title:f,children:[(0,h.jsx)(u.DemoPaymentNotice,{}),m&&g.length>0?(0,h.jsxs)(o.default,{style:{gap:6},children:[(0,h.jsx)(u.T,{weight:"semibold",children:"Use a gift card"}),(0,h.jsxs)(u.Row,{wrap:!0,children:[(0,h.jsx)(u.Chip,{label:"None",selected:!w,onPress:()=>C(void 0)}),g.map(e=>(0,h.jsx)(u.Chip,{label:`${e.code.slice(0,8)}\u2026`,sub:`${(0,n.gbp)(e.balance)} left`,selected:w===e.code,onPress:()=>C(e.code)},e.id))]})]}):null,(0,h.jsx)(u.T,{weight:"semibold",children:"Payment method"}),(0,h.jsx)(u.Row,{wrap:!0,children:['Demo card \u2022\u2022\u2022\u2022 4242','Apple Pay (demo)','Google Pay (demo)'].map(e=>(0,h.jsx)(u.Chip,{label:e,selected:P===e,onPress:()=>v(e)},e))}),(0,h.jsxs)(o.default,{style:{gap:2},children:[(0,h.jsxs)(u.Row,{style:{justifyContent:'space-between'},children:[(0,h.jsx)(u.Muted,{children:"Amount"}),(0,h.jsx)(u.T,{children:(0,n.gbp)(p)})]}),_?(0,h.jsxs)(u.Row,{style:{justifyContent:'space-between'},children:[(0,h.jsx)(u.Muted,{children:"Gift card"}),(0,h.jsxs)(u.T,{colour:c.colours.green,children:["\u2212",(0,n.gbp)(_)]})]}):null,(0,h.jsxs)(u.Row,{style:{justifyContent:'space-between'},children:[(0,h.jsx)(u.T,{weight:"semibold",children:"To pay now"}),(0,h.jsx)(u.T,{weight:"bold",size:20,colour:c.colours.gold,children:(0,n.gbp)(R)})]})]}),y?(0,h.jsx)(u.Banner,{kind:"info",children:"A card is saved now (demo). It would only be charged under the stated no-show policy."}):null,T?(0,h.jsx)(l.default,{color:c.colours.gold}):(0,h.jsx)(u.Button,{label:y?'Save card (demo)':`Pay ${(0,n.gbp)(R)} \u2014 demo`,onPress:()=>{M(!0),setTimeout(()=>{M(!1),x({giftCardCode:w,giftApplied:_,method:P})},700)},testID:"mock-pay-confirm"})]})};var s=r(d[0]),l=e(r(d[1])),o=e(r(d[2])),t=r(d[3]),n=r(d[4]),c=r(d[5]),u=r(d[6]),h=r(d[7])},789,[12,228,109,796,793,797,790,6]);
+__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.T=F,Object.defineProperty(_e,"H1",{enumerable:!0,get:function(){return B}}),Object.defineProperty(_e,"H2",{enumerable:!0,get:function(){return k}}),Object.defineProperty(_e,"Muted",{enumerable:!0,get:function(){return w}}),_e.BrandBar=z,_e.Screen=function({children:e,title:o,subtitle:l,back:t=!0,right:n,maxWidth:c=640,footer:u,scroll:b=!0}){const h=(0,C.jsx)(f.default,{style:{width:'100%',maxWidth:c,alignSelf:'center',padding:16,gap:12},children:e});return(0,C.jsxs)(y.SafeAreaView,{style:{flex:1,backgroundColor:p.colours.bg},edges:['top','left','right'],children:[(0,C.jsx)(f.default,{style:{width:'100%',maxWidth:c,alignSelf:'center'},children:(0,C.jsx)(z,{title:o,subtitle:l,back:t,right:n})}),b?(0,C.jsx)(s.default,{contentContainerStyle:{paddingBottom:40},children:h}):(0,C.jsx)(f.default,{style:{flex:1},children:h}),u?(0,C.jsx)(f.default,{style:D.footer,children:(0,C.jsx)(f.default,{style:{width:'100%',maxWidth:c,alignSelf:'center'},children:u})}):null]})},_e.Button=function({label:e,onPress:o,kind:l="primary",disabled:t,small:s,style:c,accessibilityLabel:u,testID:b}){const h={primary:p.colours.gold,secondary:'transparent',danger:p.colours.redSolid,ghost:'transparent',success:'#2F7D45'}[l],f={primary:p.colours.onGold,secondary:p.colours.gold,danger:'#FFFFFF',ghost:p.colours.gold,success:'#FFFFFF'}[l];return(0,C.jsx)(n.default,{testID:b,accessibilityRole:"button",accessibilityLabel:u??e,accessibilityState:{disabled:!!t},disabled:t,onPress:o,style:({pressed:e})=>[D.btn,{backgroundColor:h,borderColor:'secondary'===l?p.colours.gold:'transparent',opacity:t?.4:e?.8:1},s&&{paddingVertical:7,paddingHorizontal:12,minHeight:36},c],children:(0,C.jsx)(F,{weight:"semibold",size:s?p.font.small:p.font.body,colour:f,center:!0,children:e})})},_e.Card=function({children:e,style:o,onPress:l,highlight:t}){const s=(0,C.jsx)(f.default,{style:[D.card,t?{borderColor:t,borderWidth:2}:null,o],children:e});return l?(0,C.jsx)(n.default,{accessibilityRole:"button",onPress:l,style:({pressed:e})=>({opacity:e?.85:1}),children:s}):s},_e.Badge=function({label:e,kind:o="neutral"}){const l={neutral:[p.colours.surface2,p.colours.muted,p.colours.border],gold:[p.colours.goldTint,p.colours.goldLight,p.colours.gold],red:[p.colours.redBg,'#FFD9D4',p.colours.red],amber:[p.colours.amberBg,'#FFE2A8',p.colours.amber],green:[p.colours.greenBg,'#CFF3D7',p.colours.green],blue:[p.colours.blueBg,'#D6E9FF',p.colours.blue]}[o];return(0,C.jsx)(f.default,{style:[D.badge,{backgroundColor:l[0],borderColor:l[2]}],children:(0,C.jsx)(F,{size:13,weight:"medium",colour:l[1],children:e})})},_e.Banner=P,Object.defineProperty(_e,"ExampleAllergenNotice",{enumerable:!0,get:function(){return R}}),Object.defineProperty(_e,"DemoPaymentNotice",{enumerable:!0,get:function(){return S}}),_e.Row=W,Object.defineProperty(_e,"Divider",{enumerable:!0,get:function(){return A}}),_e.Field=function({label:e,...o}){return(0,C.jsxs)(f.default,{style:{gap:4},children:[(0,C.jsx)(F,{size:p.font.small,weight:"medium",colour:p.colours.muted,children:e}),(0,C.jsx)(h.default,{accessibilityLabel:e,placeholderTextColor:"#7D776C",...o,style:[D.input,o.multiline&&{minHeight:70,textAlignVertical:'top'},o.style]})]})},_e.Chip=function({label:e,selected:o,onPress:l,disabled:t,sub:s}){return(0,C.jsxs)(n.default,{accessibilityRole:"button",accessibilityState:{selected:!!o,disabled:!!t},disabled:t,onPress:l,style:[D.chip,o&&{backgroundColor:p.colours.gold,borderColor:p.colours.gold},t&&{opacity:.35}],children:[(0,C.jsx)(F,{size:p.font.small,weight:"medium",colour:o?p.colours.onGold:p.colours.text,center:!0,children:e}),s?(0,C.jsx)(F,{size:12,colour:o?p.colours.onGold:p.colours.muted,center:!0,children:s}):null]})},_e.Toggle=function({value:e,onChange:o,label:l}){return(0,C.jsxs)(W,{style:{justifyContent:'space-between'},children:[(0,C.jsx)(F,{style:{flex:1},children:l}),(0,C.jsx)(u.default,{accessibilityLabel:l,value:e,onValueChange:o,trackColor:{true:p.colours.gold,false:'#444'},thumbColor:e?'#FFF6E0':'#BBB'})]})},_e.Stepper=function({value:e,onChange:o,min:l=1,max:t=20,label:s}){return(0,C.jsxs)(W,{gap:10,children:[(0,C.jsx)(n.default,{accessibilityLabel:`Decrease ${s??''}`,onPress:()=>o(Math.max(l,e-1)),style:D.stepBtn,children:(0,C.jsx)(F,{size:20,colour:p.colours.gold,children:"\u2212"})}),(0,C.jsx)(F,{weight:"semibold",size:p.font.large,style:{minWidth:28,textAlign:'center'},children:e}),(0,C.jsx)(n.default,{accessibilityLabel:`Increase ${s??''}`,onPress:()=>o(Math.min(t,e+1)),style:D.stepBtn,children:(0,C.jsx)(F,{size:20,colour:p.colours.gold,children:"+"})})]})},_e.Sheet=function({visible:e,onClose:o,title:l,children:c}){return(0,C.jsx)(t.default,{visible:e,transparent:!0,animationType:"fade",onRequestClose:o,children:(0,C.jsx)(f.default,{style:D.overlay,children:(0,C.jsxs)(f.default,{style:D.sheet,children:[(0,C.jsxs)(W,{style:{justifyContent:'space-between',marginBottom:8},children:[(0,C.jsx)(k,{style:{flex:1},children:l}),(0,C.jsx)(n.default,{accessibilityLabel:"Close",onPress:o,hitSlop:10,children:(0,C.jsx)(F,{size:22,colour:p.colours.muted,children:"\u2715"})})]}),(0,C.jsx)(s.default,{contentContainerStyle:{gap:12},children:c})]})})})},_e.SectionTitle=function({children:e}){return(0,C.jsx)(F,{weight:"semibold",size:p.font.small,colour:p.colours.gold,style:{textTransform:'uppercase',letterSpacing:1.5,marginTop:8},children:e})},Object.defineProperty(_e,"styles",{enumerable:!0,get:function(){return D}});var o=r(d[0]),l=e(r(d[1])),t=e(r(d[2])),n=e(r(d[3])),s=e(r(d[4])),c=e(r(d[5])),u=e(r(d[6])),b=e(r(d[7])),h=e(r(d[8])),f=e(r(d[9])),y=r(d[10]),p=r(d[11]),x=r(d[12]),j=r(d[13]),C=r(d[14]);function F({children:e,style:o,size:l=p.font.body,weight:t="regular",colour:n=p.colours.text,numberOfLines:s,center:c}){return(0,C.jsx)(b.default,{numberOfLines:s,style:[{fontFamily:p.fonts[t],fontSize:l,color:n,lineHeight:Math.round(1.4*l)},c&&{textAlign:'center'},o],children:e})}const B=e=>(0,C.jsx)(F,{size:p.font.title,weight:"semibold",...e}),k=e=>(0,C.jsx)(F,{size:p.font.large,weight:"semibold",...e}),w=e=>(0,C.jsx)(F,{colour:p.colours.muted,size:p.font.small,...e});function z({title:e,back:l=!0,right:t,subtitle:s}){return(0,C.jsxs)(f.default,{style:D.brandBar,children:[(0,C.jsxs)(f.default,{style:D.row,children:[l?(0,C.jsx)(n.default,{accessibilityRole:"button",accessibilityLabel:"Back",onPress:()=>o.router.canGoBack()?o.router.back():o.router.replace(x.ENTRY[x.APP_VARIANT]),style:D.backBtn,hitSlop:10,children:(0,C.jsx)(F,{size:22,colour:p.colours.gold,children:"\u2039"})}):null,(0,C.jsx)(n.default,{onPress:()=>o.router.push(x.ENTRY[x.APP_VARIANT]),accessibilityLabel:"Home",style:[D.row,{gap:8}],children:(0,C.jsx)(j.RestaurantBrand,{size:j.HEADER_LOGO})}),(0,C.jsx)(f.default,{style:{flex:1}}),t]}),e?(0,C.jsx)(B,{style:{marginTop:10},children:e}):null,s?(0,C.jsx)(w,{children:s}):null]})}function P({kind:e="info",title:o,children:t}){const n={info:[p.colours.blueBg,p.colours.blue,'#D6E9FF'],warn:[p.colours.amberBg,p.colours.amber,'#FFE2A8'],danger:[p.colours.redBg,p.colours.red,'#FFE3DF'],success:[p.colours.greenBg,p.colours.green,'#CFF3D7'],example:[p.colours.amberBg,p.colours.amber,'#FFE2A8'],demo:[p.colours.goldTint,p.colours.gold,p.colours.goldLight]}[e];return(0,C.jsxs)(f.default,{accessibilityRole:"alert",style:[D.banner,{backgroundColor:n[0],borderLeftColor:n[1]}],children:[o?(0,C.jsx)(F,{weight:"semibold",colour:n[2],children:o}):null,l.default.Children.toArray(t).every(e=>'string'==typeof e||'number'==typeof e)?(0,C.jsx)(F,{size:p.font.small,colour:n[2],children:t}):t]})}const R=()=>(0,C.jsx)(P,{kind:"example",title:"Example allergen data \u2014 not verified by the kitchen",children:"Allergen information in this prototype is illustrative only. Real data needs head chef sign-off. Always speak to staff about allergies."}),S=()=>(0,C.jsx)(P,{kind:"demo",title:"Demo, no real payment",children:"No card is charged and no payment provider is contacted."});function W({children:e,style:o,gap:l=8,wrap:t}){return(0,C.jsx)(f.default,{style:[D.row,{gap:l},t&&{flexWrap:'wrap'},o],children:e})}const A=()=>(0,C.jsx)(f.default,{style:{height:1,backgroundColor:p.colours.border,marginVertical:4}});const D=c.default.create({row:{flexDirection:'row',alignItems:'center'},brandBar:{paddingHorizontal:16,paddingTop:8,paddingBottom:8,borderBottomWidth:1,borderBottomColor:p.colours.border},backBtn:{paddingRight:10,paddingVertical:2},btn:{borderRadius:p.radius.m,paddingVertical:12,paddingHorizontal:18,borderWidth:1.5,alignItems:'center',justifyContent:'center',minHeight:48},card:{backgroundColor:p.colours.surface,borderRadius:p.radius.l,padding:14,borderWidth:1,borderColor:p.colours.border,gap:8},badge:{borderRadius:999,paddingHorizontal:9,paddingVertical:2,borderWidth:1,alignSelf:'flex-start'},banner:{borderRadius:p.radius.m,padding:12,borderLeftWidth:5,gap:2},input:{backgroundColor:p.colours.surface2,borderColor:p.colours.border,borderWidth:1,borderRadius:p.radius.m,paddingHorizontal:12,paddingVertical:10,color:p.colours.text,fontSize:p.font.body,fontFamily:p.fonts.regular},chip:{borderWidth:1,borderColor:p.colours.border,borderRadius:p.radius.m,paddingHorizontal:12,paddingVertical:8,backgroundColor:p.colours.surface2,minWidth:64},stepBtn:{width:40,height:40,borderRadius:20,borderWidth:1.5,borderColor:p.colours.gold,alignItems:'center',justifyContent:'center'},overlay:{flex:1,backgroundColor:'rgba(0,0,0,0.7)',justifyContent:'center',alignItems:'center',padding:16},sheet:{backgroundColor:p.colours.surface,borderRadius:p.radius.l,padding:18,width:'100%',maxWidth:520,maxHeight:'90%',borderWidth:1,borderColor:p.colours.gold},footer:{borderTopWidth:1,borderTopColor:p.colours.border,backgroundColor:p.colours.surface,padding:12}})},790,[785,12,238,245,133,28,253,188,255,109,271,797,787,844,6]);
+__d(function(_g,r,i,_a,m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"ALLERGENS",{enumerable:!0,get:function(){return l}}),Object.defineProperty(e,"allergenLabel",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"SEVERITIES",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"severityLabel",{enumerable:!0,get:function(){return s}}),e.effectiveAllergens=function(l,n=[]){const t={...l.allergens};for(const s of l.optionGroups??[])for(const l of s.choices)if(n.includes(l.id)&&l.allergens)for(const[n,s]of Object.entries(l.allergens))'contains'!==t[n]&&(t[n]=s);return t},e.conflictsFor=function(l,n){const t=[],s=[];for(const a of n)'contains'===l[a.allergen]?t.push(a.allergen):'may'===l[a.allergen]&&s.push(a.allergen);return{contains:t,may:s}},Object.defineProperty(e,"hasConflict",{enumerable:!0,get:function(){return a}});const l=[{id:'gluten',label:'Cereals containing gluten',short:'Gluten'},{id:'crustaceans',label:'Crustaceans',short:'Crustaceans'},{id:'molluscs',label:'Molluscs',short:'Molluscs'},{id:'eggs',label:'Eggs',short:'Eggs'},{id:'fish',label:'Fish',short:'Fish'},{id:'peanuts',label:'Peanuts',short:'Peanuts'},{id:'treenuts',label:'Tree nuts',short:'Tree nuts'},{id:'soya',label:'Soya',short:'Soya'},{id:'milk',label:'Milk',short:'Milk'},{id:'celery',label:'Celery',short:'Celery'},{id:'mustard',label:'Mustard',short:'Mustard'},{id:'sesame',label:'Sesame',short:'Sesame'},{id:'sulphites',label:'Sulphur dioxide / sulphites',short:'Sulphites'},{id:'lupin',label:'Lupin',short:'Lupin'}],n=n=>l.find(l=>l.id===n)?.short??n,t=[{id:'intolerance',label:'Intolerance'},{id:'allergy',label:'Allergy'},{id:'coeliac',label:'Coeliac disease'},{id:'anaphylaxis',label:'Severe \u2014 anaphylaxis risk'}],s=l=>t.find(n=>n.id===l)?.label??l;const a=l=>l.contains.length>0||l.may.length>0},791,[]);
+__d(function(g,_r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.hoursFor=function(n,o){const r=n.kitchenHours[o.getDay()];return r?{open:(0,t.atTime)(o,r[0]),close:(0,t.atTime)(o,r[1])}:null};var t=_r(d[0])},792,[795]);
+__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"gbp",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"pounds",{enumerable:!0,get:function(){return n}});const t=t=>`\xa3${(t/100).toFixed(2)}`,n=t=>Math.round(100*t)},793,[]);
+__d(function(g,_r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.takeawaySlots=function(s,o,l){const r=(0,t.hoursFor)(s,l);if(!r)return[];const u=s.settings.slotMinutes,c=(0,n.addMins)(l,s.settings.leadMins),f=[];for(let t=new Date(r.open);t<=r.close;t=(0,n.addMins)(t,u)){if(tn.restaurantId===s.id&&'takeaway'===n.type&&'cancelled'!==n.status&&n.slotTime&&new Date(n.slotTime).getTime()===t.getTime()).length;f.push({time:new Date(t),label:(0,n.hm)(t),taken:l,cap:s.settings.slotCap,full:l>=s.settings.slotCap})}return f},e.bookingSlots=function(s,o,l,r,u){const c=(0,t.hoursFor)(s,o);if(!c)return[];const f=[],p=(0,n.addMins)(c.close,-60);for(let t=new Date(c.open);t<=p;t=(0,n.addMins)(t,30)){const o=(0,n.hm)(t),c=s.settings.bookingCoversPerSlot-l(o),p=t.getTime()=r})}return f};var t=_r(d[0]),n=_r(d[1])},794,[792,795]);
+__d(function(g,r,i,_a,_m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"pad",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"ymd",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"hm",{enumerable:!0,get:function(){return u}}),Object.defineProperty(e,"parseYmd",{enumerable:!0,get:function(){return a}}),Object.defineProperty(e,"toMins",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"fromMins",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"atTime",{enumerable:!0,get:function(){return b}}),Object.defineProperty(e,"addMins",{enumerable:!0,get:function(){return d}}),Object.defineProperty(e,"dayShort",{enumerable:!0,get:function(){return p}}),Object.defineProperty(e,"dayLong",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"monthLong",{enumerable:!0,get:function(){return O}}),Object.defineProperty(e,"niceDate",{enumerable:!0,get:function(){return M}}),Object.defineProperty(e,"niceDateYear",{enumerable:!0,get:function(){return j}}),Object.defineProperty(e,"minsBetween",{enumerable:!0,get:function(){return P}});const t=t=>String(t).padStart(2,'0'),n=n=>`${n.getFullYear()}-${t(n.getMonth()+1)}-${t(n.getDate())}`,u=n=>`${t(n.getHours())}:${t(n.getMinutes())}`,a=t=>{const[n,u,a]=t.split('-').map(Number);return new Date(n,u-1,a)},o=t=>{const[n,u]=t.split(':').map(Number);return 60*n+u},c=n=>`${t(Math.floor(n/60))}:${t(n%60)}`,b=(t,n)=>{const u=new Date(t);return u.setHours(0,0,0,0),u.setMinutes(o(n)),u},d=(t,n)=>new Date(t.getTime()+6e4*n),y=['Sun','Mon','Tue','Wed','Thu','Fri','Sat'],f=['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'],m=['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'],l=['January','February','March','April','May','June','July','August','September','October','November','December'],p=t=>y[t.getDay()],s=t=>f[t.getDay()],O=t=>l[t],M=t=>`${y[t.getDay()]} ${t.getDate()} ${m[t.getMonth()]}`,j=t=>`${M(t)} ${t.getFullYear()}`,P=(t,n)=>Math.round((n.getTime()-t.getTime())/6e4)},795,[]);
+__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"repo",{enumerable:!0,get:function(){return o}});var t=r(d[0]),n=r(d[1]);Object.keys(n).forEach(function(t){'default'===t||Object.prototype.hasOwnProperty.call(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:function(){return n[t]}})});const o=t.localRepositories},796,[920,935]);
+__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"colours",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"fonts",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"font",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"radius",{enumerable:!0,get:function(){return u}});const t={bg:'#0B0B0B',surface:'#141414',surface2:'#1D1C1A',border:'#34302A',gold:'#CFA45F',goldLight:'#E2C489',goldTint:'#2A2216',text:'#F5F1E8',muted:'#B8B0A0',onGold:'#0B0B0B',red:'#FF6B5E',redBg:'#4A1310',redSolid:'#C62F22',amber:'#FFB547',amberBg:'#3F2C05',green:'#7BD88F',greenBg:'#12301A',blue:'#8EC5FF',blueBg:'#12263D'},n={regular:'Poppins_400Regular',medium:'Poppins_500Medium',semibold:'Poppins_600SemiBold',bold:'Poppins_700Bold'},o={small:14,body:16,large:18,title:22,hero:30},u={s:6,m:10,l:16}},797,[]);
+__d(function(g,r,i,_a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.AllergenPanel=function({item:e,map:l,declared:d}){return(0,t.jsxs)(n.default,{style:{gap:6},accessibilityLabel:"Allergen panel",children:[(0,t.jsxs)(o.Row,{style:{justifyContent:'space-between'},children:[(0,t.jsx)(o.T,{weight:"semibold",children:"Allergen panel (14 UK allergens)"}),(0,t.jsx)(o.Badge,{label:"EXAMPLE DATA",kind:"amber"})]}),(0,t.jsx)(n.default,{style:{flexDirection:'row',flexWrap:'wrap',gap:6},children:a.ALLERGENS.map(e=>{const c=l[e.id],u=d.find(l=>l.allergen===e.id),f='contains'===c?s.colours.redBg:'may'===c?s.colours.amberBg:s.colours.surface2,b='contains'===c?'#FFD9D4':'may'===c?'#FFE2A8':s.colours.muted;return(0,t.jsxs)(n.default,{style:{width:'48%',flexGrow:1,backgroundColor:f,borderRadius:8,padding:8,borderWidth:u?2:1,borderColor:u?s.colours.red:s.colours.border},children:[(0,t.jsx)(o.T,{size:14,weight:"medium",colour:c?b:s.colours.text,children:e.label}),(0,t.jsxs)(o.T,{size:13,colour:b,children:['contains'===c?'Contains':'may'===c?'May contain':'Not listed',u?` \xb7 YOUR ALLERGY (${(0,a.severityLabel)(u.severity)})`:'']})]},e.id)})}),e.allergenNotes?(0,t.jsxs)(o.Muted,{children:["Notes: ",e.allergenNotes]}):null,(0,t.jsx)(o.Muted,{children:e.signOff?`Sign-off: ${e.signOff.by}, ${e.signOff.at} (prototype placeholder \u2014 not a real kitchen sign-off)`:'Awaiting head chef allergen sign-off \u2014 not available to order online.'})]})},_e.AllergenChips=function({map:e,declared:l}){const n=Object.entries(e);return n.length?(0,t.jsx)(o.Row,{wrap:!0,gap:5,children:n.sort((e,l)=>e[1]===l[1]?0:'contains'===e[1]?-1:1).map(([e,n])=>{const s=l.some(l=>l.allergen===e);return(0,t.jsx)(o.Badge,{label:`${s?'\u26a0 ':''}${(0,a.allergenLabel)(e)}${'may'===n?' (may)':''}`,kind:s?'contains'===n?'red':'amber':'neutral'},e)})}):(0,t.jsx)(o.Muted,{children:"No listed allergens (example data)"})},r(_d[0]);var e,l=r(_d[1]),n=(e=l)&&e.__esModule?e:{default:e},a=r(_d[2]),s=r(_d[3]),o=r(_d[4]),t=r(_d[5])},798,[12,109,791,797,790,6]);
+__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.BasketButton=function(){const s=(0,l.useBasket)().lines.reduce((e,s)=>e+s.qty,0);return s?(0,c.jsx)(o.default,{accessibilityRole:"button",accessibilityLabel:`Basket, ${s} items`,onPress:()=>e.router.push('/customer/basket'),style:{backgroundColor:u.colours.gold,borderRadius:999,paddingHorizontal:12,paddingVertical:6},children:(0,c.jsxs)(n.T,{weight:"semibold",colour:u.colours.onGold,size:14,children:["Basket \xb7 ",s]})}):null};var e=r(d[0]);r(d[1]);var s,t=r(d[2]),o=(s=t)&&s.__esModule?s:{default:s},l=r(d[3]),u=r(d[4]),n=r(d[5]),c=r(d[6])},799,[785,12,245,796,797,790,6]);
+__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.Stars=function({value:e,onChange:s,size:n=36}){return(0,c.jsx)(t.Row,{gap:6,children:[1,2,3,4,5].map(u=>(0,c.jsx)(l.default,{disabled:!s,accessibilityRole:"button",accessibilityLabel:`${u} star${u>1?'s':''}`,onPress:()=>s?.(u),hitSlop:4,children:(0,c.jsx)(t.T,{size:n,colour:u<=e?o.colours.gold:'#555',children:"\u2605"})},u))})},r(d[0]);var e,s=r(d[1]),l=(e=s)&&e.__esModule?e:{default:e},o=r(d[2]),t=r(d[3]),c=r(d[4])},800,[12,245,797,790,6]);
+__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,"LAUNCHER_LINE",{enumerable:!0,get:function(){return u}}),_e.LauncherLine=function(){return(0,s.jsx)(l.default,{style:{borderTopWidth:1,borderColor:t.colours.border,paddingTop:10,marginTop:4},children:(0,s.jsx)(n.Muted,{center:!0,children:u})})},_e.HubTile=function({icon:e,label:u,sub:c,onPress:b,badge:h}){return(0,s.jsxs)(o.default,{accessibilityRole:"button",accessibilityLabel:u,onPress:b,style:({pressed:e})=>({flexBasis:'30%',flexGrow:1,maxWidth:'31.5%',minWidth:96,backgroundColor:e?'#1d1a14':t.colours.surface,borderRadius:14,borderWidth:1,borderColor:t.colours.border,padding:10,gap:2,alignItems:'center'}),children:[(0,s.jsx)(n.T,{size:22,children:e}),(0,s.jsx)(n.T,{size:13,weight:"semibold",center:!0,children:u}),c?(0,s.jsx)(n.T,{size:11,colour:t.colours.muted,center:!0,children:c}):null,h?(0,s.jsx)(l.default,{style:{position:'absolute',top:6,right:6,backgroundColor:t.colours.gold,borderRadius:8,paddingHorizontal:5},children:(0,s.jsx)(n.T,{size:10,weight:"bold",colour:t.colours.onGold,children:h})}):null]})},r(d[0]);var o=e(r(d[1])),l=e(r(d[2])),n=r(d[3]),t=r(d[4]),s=r(d[5]);const u='Prototype \xb7 demo data, no real payments'},801,[12,245,109,790,797,6]);
+__d(function(_g,_r,_i,_a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"SUPPLIER_CATS",{enumerable:!0,get:function(){return i}}),Object.defineProperty(_e,"NLW_PENCE",{enumerable:!0,get:function(){return o}}),Object.defineProperty(_e,"MAX_CUSTOM_LINKS",{enumerable:!0,get:function(){return n}}),Object.defineProperty(_e,"WIX_IDS",{enumerable:!0,get:function(){return d}}),Object.defineProperty(_e,"isWixLink",{enumerable:!0,get:function(){return c}}),Object.defineProperty(_e,"DEFAULT_QUICK_LINKS",{enumerable:!0,get:function(){return l}}),Object.defineProperty(_e,"useOwner",{enumerable:!0,get:function(){return f}}),Object.defineProperty(_e,"ROLE_LABEL",{enumerable:!0,get:function(){return h}}),Object.defineProperty(_e,"CAN",{enumerable:!0,get:function(){return g}});var e,t=_r(_d[0]),a=(e=t)&&e.__esModule?e:{default:e},s=_r(_d[1]),r=_r(_d[2]);const i=['Fish & seafood','Meat','Fruit & veg','Dairy','Dry goods','Drinks/brewery','Cleaning','Packaging','Equipment/maintenance'],o=1271,n=6,d=['ql-wix-view','ql-wix-edit'],c=e=>d.includes(e.id)||'Website (Wix)'===e.group,l=[{id:'ql-gmail',label:'Work email (Gmail)',url:'',icon:'\u2709\ufe0f',kind:'gmail',staff:!1,builtIn:!0},{id:'ql-wix-view',label:'View site',url:'https://www.anchoragedunure.com',icon:'\ud83c\udf10',kind:'link',group:'Website (Wix)',staff:!1,builtIn:!0},{id:'ql-wix-edit',label:'Edit site',url:'https://manage.wix.com',icon:'\u270f\ufe0f',kind:'link',group:'Website (Wix)',staff:!1,builtIn:!0}],p=e=>`${e}-${Math.random().toString(36).slice(2,8)}`,m=['#2A3B4C','#4A3A22','#26403A','#3E2A2A','#2E2E40'];const u=()=>({tronc:{method:'hours',points:{FOH:1,Bar:1,Kitchen:.8,KP:.6,Manager:1},includeManagers:!0,includeOwner:!1,custom:{},text:'The Anchorage tipping policy (template)\n\n1. 100% of tips paid by card and cash tips put in the tip jar go to staff. Nothing is deducted.\n2. Tips are pooled and shared by paid hours worked in each pay period (breaks excluded).\n3. The owner does not take a share. Managers share only for hours worked on the floor or in the kitchen.\n4. Tips are paid with wages, no later than the end of the month after the tip was paid.\n5. Tip records are kept for 3 years. Ask a manager for your records at any time.'},troncCash:{},troncHistory:[],troncLog:[],chat:[],chatMuted:{},referral:{giverReward:'Free dessert',friendReward:'\xa35 off first order',active:!0},referrals:[{id:'rf-1',referrer:'Fiona Campbell (example)',friend:'Ailsa Ross (example)',at:'2026-10-21',status:'rewarded'},{id:'rf-2',referrer:'Iain Fraser (example)',friend:'Neil Grant (example)',at:'2026-10-23',status:'first order'},{id:'rf-3',referrer:'Alex Morgan',friend:'Jamie (example)',at:'2026-10-25',status:'signed up'},{id:'rf-4',referrer:'Kirsty Hamilton (example)',friend:'Craig Reid (example)',at:'2026-10-26',status:'signed up'}],reminders:{h24:!0,h2:!0,confirmText:!0},coats:[{id:'ct-1',ticket:14,desc:'Black wool coat',at:'17:05',status:'in'},{id:'ct-2',ticket:15,desc:'Green Barbour jacket + umbrella',at:'17:20',status:'in'}],merch:[{id:'mc-1',name:'Anchorage tote bag',price:1200,stock:18,live:!0},{id:'mc-2',name:'House tartare sauce jar',price:650,stock:6,live:!0},{id:'mc-3',name:'Harbour View mug',price:1e3,stock:0,live:!1}],merchOrders:[{id:'mo-1',productId:'mc-2',qty:2,customer:'Morag (example)',at:'2026-10-26',status:'new'},{id:'mo-2',productId:'mc-1',qty:1,customer:'Callum (example)',at:'2026-10-24',status:'collected'}],marketingDraft:void 0,socialAccounts:{facebook:!0,instagram:!0,tiktok:!0,youtube:!0},socialPosts:[],socialDraft:void 0,quickLinks:l.map(e=>({...e})),workEmail:'',staff:[{id:'st-gordon',name:'Gordon Munro',role:'owner',job:'Owner / GM',active:!0},{id:'st-2',name:'Duty Manager (example)',role:'manager',job:'Front of house manager',active:!0},{id:'st-3',name:'Head Chef (example)',role:'staff',job:'Kitchen',active:!0},{id:'st-4',name:'Server (example)',role:'staff',job:'Front of house',active:!0},{id:'st-5',name:'Bar (example)',role:'staff',job:'Bar',active:!0}],previewRole:'owner',staffAs:'st-4',offers:[{id:'of-1',title:'Catch of the day: Dunure lobster (example)',body:'Half or whole, garlic butter or thermidor. Ask your server \u2014 board price.',kind:'special',live:!0},{id:'of-2',title:'Midweek fish supper deal (example)',body:'Two fish suppers for \xa330, Wed\u2013Thu takeaway.',kind:'offer',until:'2026-11-30',live:!0}],photos:[{id:'ph-1',caption:'Harbour view from the terrace (placeholder)',tone:m[0]},{id:'ph-2',caption:'Fish supper (placeholder)',tone:m[1]},{id:'ph-3',caption:'Dining room (placeholder)',tone:m[2]}],changeRequests:[{id:'cr-1',text:'Add the Christmas party menu page (example)',at:'2026-10-05',status:'done'},{id:'cr-2',text:'New header photo for the app (example)',at:'2026-10-19',status:'in progress'}],changesUsed:2,site:'anchorage',branding:{},checks:{},lost:[{id:'lp-1',item:'Navy umbrella',where:'Table 7',foundAt:'2026-10-24 19:40',foundBy:'Server (example)',status:'held'},{id:'lp-2',item:'Child\u2019s blue cardigan',where:'Terrace',foundAt:'2026-10-18 14:10',foundBy:'Bar (example)',status:'held'},{id:'lp-3',item:'Car keys (Ford)',where:'Bar',foundAt:'2026-10-11 21:05',foundBy:'Duty Manager (example)',status:'returned',contact:'Collected by owner'}],lostReports:[],campaigns:[{id:'cp-1',title:'Halloween weekend (example)',body:'Spooky specials all weekend at The Anchorage. Book now!',segment:'All opted-in',sendAt:'2026-10-29 10:00',status:'scheduled',reach:412},{id:'cp-2',title:'Fish supper Friday (example)',body:'2 fish suppers for \xa330 tonight, order ahead in the app.',segment:'Takeaway regulars',sendAt:'2026-10-23 15:00',status:'sent (demo)',reach:188}],shifts:Object.entries({'st-2':[[2,11,19.5],[4,15,23],[5,15,23],[6,11.5,20.5]],'st-3':[[2,10.5,19.5],[3,10.5,19.5],[4,10.5,21],[5,10.5,21],[6,11,20.5]],'st-4':[[3,11.5,19.5],[4,16,22],[5,16,22],[6,12,20.5]],'st-5':[[4,17,23],[5,17,23.5],[6,12,18]]}).flatMap(([e,t])=>t.map(([t,a,s])=>({id:`sh-${e}-${t}`,staffId:e,day:t,start:a,end:s}))),rotaPublished:void 0,leave:[{id:'lv-1',staffId:'st-4',from:'2026-11-09',to:'2026-11-13',reason:'Family holiday',status:'pending'},{id:'lv-2',staffId:'st-3',from:'2026-12-27',to:'2026-12-28',reason:'Christmas leave',status:'approved'}],swaps:[{id:'sw-1',shiftId:'sh-st-5-5',fromId:'st-5',toId:'st-4',kind:'swap',note:'Can we swap Saturday? (example)',status:'open'},{id:'sw-2',shiftId:'sh-st-4-6',fromId:'st-4',kind:'cover',note:'Need cover Sunday lunch (example)',status:'open'}],availability:{'st-4':[0,1],'st-5':[2]},attendance:[],attLog:[],geofence:{lat:55.4047,lng:-4.7606,radius:100},simLocation:'venue',consent:{'st-gordon':'2026-10-01T09:00:00Z','st-2':'2026-10-01T09:05:00Z','st-3':'2026-10-02T11:00:00Z'},hourly:{'st-gordon':0,'st-2':1500,'st-3':1650,'st-4':1275,'st-5':1275},payPeriod:'weekly',suppliers:[{id:'sup-1',name:'Example Fish Co.',category:'Fish & seafood',contact:'Alex Sample',phones:['01632 960001','07700 900001'],email:'orders@example.com',website:'https://example.com/fish',account:'ANC-0001',cutoff:'14:00',orderDays:[0,1,2,3,4],deliveryDays:[1,2,3,4,5],minOrder:7500,terms:'30 days',notes:'Day boat landings. Ask for the langoustine grade before ordering.',fav:!0,archived:!1},{id:'sup-2',name:'Example Butchers Ltd',category:'Meat',contact:'Sam Example',phones:['01632 960002'],email:'butcher@example.com',website:'https://example.com/meat',account:'ANC-0002',cutoff:'12:00',orderDays:[0,2,4],deliveryDays:[1,3,5],minOrder:5e3,terms:'14 days',notes:'Burger patties made to our spec (6 oz).',fav:!1,archived:!1},{id:'sup-3',name:'Sample Fruit & Veg',category:'Fruit & veg',contact:'Jo Placeholder',phones:['01632 960003'],email:'veg@example.com',website:'https://example.com/veg',account:'ANC-0003',cutoff:'20:00',orderDays:[0,1,2,3,4,5],deliveryDays:[1,2,3,4,5,6],minOrder:4e3,terms:'7 days',notes:'Chipping potatoes: ask for Maris Piper.',fav:!0,archived:!1},{id:'sup-4',name:'Sample Dairy Ltd',category:'Dairy',contact:'Chris Example',phones:['01632 960004'],email:'dairy@example.com',website:'https://example.com/dairy',account:'ANC-0004',cutoff:'16:00',orderDays:[0,3],deliveryDays:[1,4],minOrder:3e3,terms:'14 days',notes:'',fav:!1,archived:!1},{id:'sup-5',name:'Example Dry Goods Wholesale',category:'Dry goods',contact:'Pat Sample',phones:['01632 960005'],email:'drygoods@example.com',website:'https://example.com/drygoods',account:'ANC-0005',cutoff:'15:00',orderDays:[1],deliveryDays:[3],minOrder:15e3,terms:'30 days',notes:'Weekly order. Oil, flour, sauces, tins.',fav:!1,archived:!1},{id:'sup-6',name:'Sample Brewing Co.',category:'Drinks/brewery',contact:'Robin Example',phones:['01632 960006','07700 900006'],email:'trade@example.com',website:'https://example.com/brewery',account:'ANC-0006',cutoff:'11:00',orderDays:[2],deliveryDays:[4],minOrder:2e4,terms:'30 days',notes:'Cask returns collected on delivery.',fav:!0,archived:!1},{id:'sup-7',name:'Example Cleaning Supplies',category:'Cleaning',contact:'Lee Placeholder',phones:['01632 960007'],email:'clean@example.com',website:'https://example.com/cleaning',account:'ANC-0007',cutoff:'17:00',orderDays:[3],deliveryDays:[5],minOrder:6e3,terms:'30 days',notes:'',fav:!1,archived:!1},{id:'sup-8',name:'Sample Packaging Ltd',category:'Packaging',contact:'Morgan Sample',phones:['01632 960008'],email:'packaging@example.com',website:'https://example.com/packaging',account:'ANC-0008',cutoff:'13:00',orderDays:[0],deliveryDays:[2],minOrder:1e4,terms:'30 days',notes:'Compostable takeaway boxes and paper bags.',fav:!1,archived:!1},{id:'sup-9',name:'Example Kitchen Repairs',category:'Equipment/maintenance',contact:'Taylor Example',phones:['01632 960009','07700 900009'],email:'repairs@example.com',website:'https://example.com/repairs',account:'ANC-0009',cutoff:'',orderDays:[],deliveryDays:[],minOrder:0,terms:'On invoice',notes:'Fryer and fridge servicing. Emergency call-out line is the mobile.',fav:!1,archived:!1}],supplierOrders:[{id:'so-1',supplierId:'sup-1',date:'',items:'Haddock 40 portions, langoustines 4 kg',amount:21450,by:'Head Chef (example)',at:''},{id:'so-2',supplierId:'sup-6',date:'',items:'6 casks, 4 kegs',amount:64800,by:'Gordon Munro',at:''}],staffCanViewSuppliers:!1,readNotes:{},customerTags:{'cust-demo':['Allergy','Regular'],'cr-2':['VIP'],'cr-5':['Takeaway']}}),f=(0,s.create)()((0,r.persist)(e=>({...u(),setPreviewRole:t=>e({previewRole:t}),addStaff:(t,a,s)=>e(e=>{const r=p('st');return{staff:[...e.staff,{id:r,name:t,role:a,job:s,active:!0}],hourly:{...e.hourly,[r]:o}}}),saveSupplier:t=>e(e=>({suppliers:e.suppliers.some(e=>e.id===t.id)?e.suppliers.map(e=>e.id===t.id?t:e):[...e.suppliers,t]})),setRate:(t,a)=>e(e=>({hourly:{...e.hourly,[t]:Math.max(0,Math.round(a))}})),updateStaff:(t,a)=>e(e=>({staff:e.staff.map(e=>e.id===t?{...e,...a}:e)})),addOffer:t=>e(e=>({offers:[{...t,id:p('of')},...e.offers]})),updateOffer:(t,a)=>e(e=>({offers:e.offers.map(e=>e.id===t?{...e,...a}:e)})),addPhoto:t=>e(e=>({photos:[...e.photos,{id:p('ph'),caption:t,tone:m[e.photos.length%m.length]}]})),removePhoto:t=>e(e=>({photos:e.photos.filter(e=>e.id!==t)})),requestChange:(t,a)=>e(e=>e.changesUsed>=5?e:{changesUsed:e.changesUsed+1,changeRequests:[{id:p('cr'),text:t,at:a,status:'requested'},...e.changeRequests]}),setSite:t=>e({site:t}),setBranding:(t,a)=>e(e=>{const s={...e.branding};return a?s[t]={...s[t],...a}:delete s[t],{branding:s}}),setOwner:t=>e(t),addSocialPost:t=>e(e=>({socialPosts:[{...t,id:p('sp')},...e.socialPosts]})),setSocialPost:(t,a)=>e(e=>({socialPosts:e.socialPosts.map(e=>e.id===t?{...e,...a}:e)})),chatSend:t=>e(e=>({chat:[...e.chat,{...t,id:p('m'),reactions:{},seenBy:t.seenBy??('system'===t.from?[]:[t.from])}]})),chatReact:(t,a,s)=>e(e=>({chat:e.chat.map(e=>{if(e.id!==t)return e;const r=e.reactions[a]??[];return{...e,reactions:{...e.reactions,[a]:r.includes(s)?r.filter(e=>e!==s):[...r,s]}}})})),chatSeen:(t,a)=>e(e=>e.chat.some(e=>e.ch===t&&!e.seenBy.includes(a))?{chat:e.chat.map(e=>e.ch!==t||e.seenBy.includes(a)?e:{...e,seenBy:[...e.seenBy,a]})}:e),chatPatch:(t,a)=>e(e=>({chat:e.chat.map(e=>e.id===t?{...e,...a}:e)})),chatMute:(t,a)=>e(e=>{const s=e.chatMuted[t]??[];return{chatMuted:{...e.chatMuted,[t]:s.includes(a)?s.filter(e=>e!==a):[...s,a]}}}),sys:(t,a,s)=>e(e=>({chat:[...e.chat,{id:p('m'),ch:t,from:'system',text:a,at:s,reactions:{},seenBy:[]}]})),tick:(t,a,s,r)=>e(e=>({checks:{...e.checks,[t]:{by:a,at:s,value:r}}})),untick:t=>e(e=>{const a={...e.checks};return delete a[t],{checks:a}}),addLost:t=>e(e=>({lost:[{...t,id:p('lp'),status:'held'},...e.lost]})),setLost:(t,a)=>e(e=>({lost:e.lost.map(e=>e.id===t?{...e,...a}:e)})),addCampaign:t=>e(e=>({campaigns:[{...t,id:p('cp')},...e.campaigns]})),setCampaign:(t,a)=>e(e=>({campaigns:e.campaigns.map(e=>e.id===t?{...e,...a}:e)})),setShifts:t=>e({shifts:t}),addShift:t=>e(e=>({shifts:[...e.shifts,{...t,id:p('sh')}]})),removeShift:t=>e(e=>({shifts:e.shifts.filter(e=>e.id!==t)})),markRead:t=>e(e=>({readNotes:{...e.readNotes,...Object.fromEntries(t.map(e=>[e,!0]))}})),toggleTag:(t,a)=>e(e=>{const s=e.customerTags[t]??[];return{customerTags:{...e.customerTags,[t]:s.includes(a)?s.filter(e=>e!==a):[...s,a]}}}),publishRota:t=>e({rotaPublished:t}),addLeave:t=>e(e=>({leave:[{...t,id:p('lv'),status:'pending'},...e.leave]})),setLeave:(t,a)=>e(e=>({leave:e.leave.map(e=>e.id===t?{...e,status:a}:e)})),addSwap:t=>e(e=>({swaps:[{...t,id:p('sw'),status:'open'},...e.swaps]})),setSwap:(t,a)=>e(e=>{const s=e.swaps.find(e=>e.id===t);return{shifts:'approved'===a&&s?.toId?e.shifts.map(e=>e.id===s.shiftId?{...e,staffId:s.toId}:e):e.shifts,swaps:e.swaps.map(e=>e.id===t?{...e,status:a}:e)}}),toggleAvail:(t,a)=>e(e=>{const s=e.availability[t]??[];return{availability:{...e.availability,[t]:s.includes(a)?s.filter(e=>e!==a):[...s,a]}}}),clock:(t,a,s,r,i,o)=>e(e=>{const n=e.attendance.filter(e=>e.staffId===t&&e.in&&!e.out&&new Date(r).getTime()-new Date(e.in).getTime()<72e6).sort((e,t)=>t.in.localeCompare(e.in))[0];return'in'===s?n?e:{attendance:[...e.attendance,{id:p('at'),staffId:t,date:a,in:r,inSite:i}]}:n?{attendance:e.attendance.map(e=>e.id===n.id?{...e,out:r,outSite:i,breakMins:o??0}:e)}:e}),adjustClock:(t,a,s,r,i,o)=>e(e=>{const n=e.attendance.find(e=>e.id===t),d=e.staff.find(e=>e.id===n?.staffId),c=n?.[a]?new Date(n[a]).toTimeString().slice(0,5):'none';return{attendance:e.attendance.map(e=>e.id===t?{...e,[a]:s,adjusted:{by:r,at:o,reason:i}}:e),attLog:[{id:p('al'),at:o,text:`${r} changed ${d?.name??'staff'} clock-${a} from ${c} to ${new Date(s).toTimeString().slice(0,5)}: ${i}`},...e.attLog]}}),adjustBreak:(t,a,s,r,i)=>e(e=>{const o=e.attendance.find(e=>e.id===t),n=e.staff.find(e=>e.id===o?.staffId);return{attendance:e.attendance.map(e=>e.id===t?{...e,breakMins:a,adjusted:{by:s,at:i,reason:r}}:e),attLog:[{id:p('al'),at:i,text:`${s} changed ${n?.name??'staff'} break from ${o?.breakMins??0}m to ${a}m: ${r}`},...e.attLog]}}),setGeofence:t=>e(e=>({geofence:{...e.geofence,...t}})),setSimLocation:t=>e({simLocation:t}),giveConsent:(t,a)=>e(e=>({consent:{...e.consent,[t]:a}})),resetOwner:()=>e(u())}),{name:'covercharge-owner-v1',version:2,storage:(0,r.createJSONStorage)(()=>a.default),migrate:(e,t)=>(e&&t<2&&Array.isArray(e.quickLinks)&&(e.quickLinks=e.quickLinks.map(e=>d.includes(e.id)||'Website (Wix)'===e.group?{...e,staff:!1}:e)),e)})),h={owner:'Owner',manager:'Manager',staff:'Staff'},g={forecasts:e=>'staff'!==e,manage:e=>'staff'!==e,staffAdmin:e=>'owner'===e,billing:e=>'owner'===e,takings:e=>'staff'!==e,publishSocial:e=>'staff'!==e}},802,[921,927,930]);
+__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 n.default}});var e=r(d[0]);Object.keys(e).forEach(function(t){'default'===t||Object.prototype.hasOwnProperty.call(_e,t)||Object.defineProperty(_e,t,{enumerable:!0,get:function(){return e[t]}})});var t,n=(t=e)&&t.__esModule?t:{default:t}},838,[948]);
+__d(function(g,_r,i,_a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.forecastToday=function(a,r,s,n,u){const c=(0,t.hoursFor)(a,u),l=[],h=(0,o.ymd)(u);let y=1;for(const e of n.filter(e=>e.date===h&&(null===e.restaurantId||e.restaurantId===a.id)))l.push(e.title),y*='bank-holiday'===e.kind?1.25:'event'===e.kind?1.15:1.1;if(!c)return{open:!1,hours:[],restOfDay:{covers:0,low:0,high:0,takeaway:0,booked:0},flags:l,suggestions:['Kitchen closed today (per listed hours).'],multiplier:y};const p=e.EXAMPLE_HISTORY[a.id]??e.EXAMPLE_HISTORY.default,k=u.getDay(),v=c.open.getHours(),f=c.close.getMinutes()>0?c.close.getHours():c.close.getHours()-1,w=[];for(let e=v;e<=f;e++){const t=p.covers[k]?.[e]??0,n=p.takeaway[k]?.[e]??0,u=r.filter(t=>t.restaurantId===a.id&&t.date===h&&['confirmed','seated'].includes(t.status)&&Number(t.time.slice(0,2))===e).reduce((e,t)=>e+t.partySize,0),c=Math.round(t*a.settings.walkInShare*y),l=u+c,v=s.filter(t=>t.restaurantId===a.id&&'takeaway'===t.type&&'cancelled'!==t.status&&t.slotTime&&new Date(t.slotTime).getHours()===e&&(0,o.ymd)(new Date(t.slotTime))===h).length,f=Math.max(v,Math.round(n*y));w.push({hour:e,booked:u,walkIns:c,covers:l,coversLow:Math.round(.8*l),coversHigh:Math.round(1.2*l),takeawayPlaced:v,takeaway:f,historicalCovers:t})}const H=u.getHours()+(u.getMinutes()>=30?1:0),M=w.filter(e=>e.hour>=H),S=M[0],I=e=>M.reduce((t,o)=>t+e(o),0),T={covers:I(e=>e.covers),low:I(e=>e.coversLow),high:I(e=>e.coversHigh),takeaway:I(e=>e.takeaway),booked:I(e=>e.booked)},b=[],D=a.settings.capacityPerHour,$=M.reduce((e,t)=>!e||t.covers>e.covers?t:e,void 0);$&&$.covers>=.85*D&&b.push(`Dining room near capacity around ${String($.hour).padStart(2,'0')}:00 (~${$.covers} of ${D} covers) \u2014 consider pausing or capping takeaway slots then.`);const _=M.find(e=>e.historicalCovers>0&&e.covers>1.1*e.historicalCovers);_&&b.push(`Busier than a usual ${['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'][k]} from ${String(_.hour).padStart(2,'0')}:00 \u2014 consider one more on the floor.`);T.takeaway>=10&&b.push(`~${T.takeaway} takeaway orders expected \u2014 prep extra haddock and chips.`);b.length||b.push('Looks like a normal service \u2014 no action suggested.');return{open:!0,nextHour:S,hours:w,restOfDay:T,flags:l,suggestions:b,multiplier:y}};var e=_r(d[0]),t=_r(d[1]),o=_r(d[2])},839,[846,792,795]);
+__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.estimateWait=function(t,n,u){const o=Math.max(6,Math.round(n/6*u));return t*o}},840,[]);
+__d(function(_g,_r,i,_a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.nowFrom=c,_e.linesFromBasket=m,Object.defineProperty(_e,"useStore",{enumerable:!0,get:function(){return p}}),Object.defineProperty(_e,"DEMO_CUSTOMER_ID",{enumerable:!0,get:function(){return n.DEMO_CUSTOMER_ID}});var e,t=_r(d[0]),a=(e=t)&&e.__esModule?e:{default:e},r=_r(d[1]),s=_r(d[2]),n=_r(d[3]),o=_r(d[4]);const l=e=>`${e}-${Math.random().toString(36).slice(2,8)}${Date.now().toString(36).slice(-3)}`;function c(e){return'live'===e.mode?new Date:new Date(e.simStartMs+(Date.now()-e.anchorRealMs))}function u(){const e=(0,n.defaultSimStart)();return{clock:{mode:'simulated',simStartMs:e.getTime(),anchorRealMs:Date.now()},...(0,n.buildSeed)(e)}}function m(e,t,a){return e.lines.flatMap(e=>{const r=t.find(t=>t.id===e.itemId);if(!r)return[];const s=(r.optionGroups??[]).flatMap(t=>t.choices.filter(t=>e.choiceIds.includes(t.id))),n=(r.price??0)+s.reduce((e,t)=>e+t.priceDelta,0),l=(0,o.conflictsFor)((0,o.effectiveAllergens)(r,e.choiceIds),a);return[{itemId:r.id,name:r.name,qty:e.qty,unitPrice:n,choices:s.map(e=>e.label),notes:e.notes,contains:l.contains,may:l.may,overridden:!!e.override&&l.contains.every(t=>e.override.allergens.includes(t)),prepMins:r.prepMins}]})}const g=e=>{const t='ABCDEFGHJKLMNPQRSTUVWXYZ23456789',a=()=>Array.from({length:4},()=>t[Math.floor(32*Math.random())]).join('');return`${e}-${a()}-${a()}-${a()}`},p=(0,r.create)()((0,s.persist)((e,t)=>{const a=()=>c(t().clock),r=(t,r,s)=>e(e=>({audit:[{id:l('au'),restaurantId:t,at:a().toISOString(),kind:r,text:s},...e.audit].slice(0,300)})),s=(a,s,n)=>{if(!a||n<=0)return 0;const o=t().giftCards.find(e=>e.code===a&&e.restaurantId===s);if(!o||o.balance<=0)return 0;const l=Math.min(o.balance,n);return e(e=>({giftCards:e.giftCards.map(e=>e.id===o.id?{...e,balance:e.balance-l}:e)})),r(s,'giftcard',`Gift card ${a.slice(0,8)}\u2026 redeemed \xa3${(l/100).toFixed(2)} (balance \xa3${((o.balance-l)/100).toFixed(2)})`),l},p=e=>{const a=t().restaurants.find(t=>t.id===e.restaurantId);a&&e.customerId===t().customer.id&&e.subtotal>=a.settings.stampMinSpend&&t().addStamp(e.restaurantId,e.customerId,'takeaway'===e.type?'Takeaway (auto on collection)':'Table QR bill (auto on payment)')};return{...u(),resetDemo:()=>e(u()),setClockMode:t=>{const a=(0,n.defaultSimStart)();e({clock:{mode:t,simStartMs:a.getTime(),anchorRealMs:Date.now()}})},skipMinutes:t=>e(e=>({clock:{...e.clock,simStartMs:e.clock.simStartMs+6e4*t}})),updateCustomer:t=>e(e=>({customer:{...e.customer,...t}})),setAllergy:(t,a)=>e(e=>{const r=e.customer.allergies.filter(e=>e.allergen!==t);return{customer:{...e.customer,allergies:a?[...r,{allergen:t,severity:a}]:r}}}),startBasket:(t,a,r)=>e(e=>{const s=e.basket.restaurantId===t&&e.basket.mode===a&&e.basket.tableNo===r;return{basket:{restaurantId:t,mode:a,tableNo:r,lines:s?e.basket.lines:[]}}}),addLine:t=>e(e=>({basket:{...e.basket,lines:[...e.basket.lines,{...t,key:l('ln')}]}})),setLineQty:(t,a)=>e(e=>({basket:{...e.basket,lines:a<=0?e.basket.lines.filter(e=>e.key!==t):e.basket.lines.map(e=>e.key===t?{...e,qty:a}:e)}})),overrideLine:(t,r)=>e(e=>({basket:{...e.basket,lines:e.basket.lines.map(e=>e.key===t?{...e,override:{allergens:r,at:a().toISOString()}}:e)}})),clearBasket:()=>e(e=>({basket:{...e.basket,lines:[]}})),placeOrder:({slotTime:n,tip:o,giftCardCode:c,notes:u,paidNow:g})=>{const p=t(),f=p.basket,b=f.restaurantId,k=m(f,p.menu,p.customer.allergies),y=k.reduce((e,t)=>e+t.unitPrice*t.qty,0),$='table'===f.mode,I=$?p.counters.table+1:p.counters.order+1,S=g?s(c,b,y+o):0,w=y+o,h={id:l('ord'),ref:`${$?'Q':'T'}-${I}`,restaurantId:b,customerId:p.customer.id,customerName:p.customer.name,type:f.mode,tableNo:f.tableNo,slotTime:n,lines:k,subtotal:y,tip:o,giftCardApplied:S,giftCardCode:S?c:void 0,total:w,paid:g?w:0,status:'new',createdAt:a().toISOString(),allergies:p.customer.allergies,readiness:{},notes:u};e(e=>({orders:[h,...e.orders],basket:{...e.basket,lines:[]},counters:$?{...e.counters,table:I}:{...e.counters,order:I}}));const C=k.filter(e=>e.overridden);return r(b,'order',`Order ${h.ref} placed (${$?`Table ${f.tableNo}`:'takeaway'})${C.length?` \u2014 ALLERGY OVERRIDE on ${C.map(e=>e.name).join(', ')}`:''}`),h.allergies.length&&r(b,'allergy',`Allergies declared and confirmed by customer on ${h.ref}: ${h.allergies.map(e=>`${e.allergen} (${e.severity})`).join(', ')}`),h},setOrderStatus:(a,s,n)=>{const o=t().orders.find(e=>e.id===a);o&&(e(e=>({orders:e.orders.map(e=>e.id===a?{...e,status:s}:e)})),r(o.restaurantId,'order',`${o.ref} \u2192 ${s}${n?` by ${n}`:''}`),'collected'===s&&'takeaway'===o.type&&p(o))},ackOrderAllergy:(s,n)=>{const o=t().orders.find(e=>e.id===s);if(!o)return;const l={by:n,at:a().toISOString()};e(e=>({orders:e.orders.map(e=>e.id===s?{...e,allergyAck:l,status:'new'===e.status?'acknowledged':e.status}:e)})),r(o.restaurantId,'allergy',`Allergy alert on ${o.ref} acknowledged by ${n}`)},ackReadiness:(s,n,o)=>{const l=t().orders.find(e=>e.id===s);l&&(e(e=>({orders:e.orders.map(e=>e.id===s?{...e,readiness:{...e.readiness,[n]:{by:o,at:a().toISOString()}},status:'cook'===n&&['new','acknowledged'].includes(e.status)?'preparing':e.status}:e)})),r(l.restaurantId,'order',`${l.ref}: ${'cook'===n?'started cooking':'bagged'} (${o})`))},handoverCheck:(s,n)=>{const o=t().orders.find(e=>e.id===s);o&&(e(e=>({orders:e.orders.map(e=>e.id===s?{...e,handoverCheck:{by:n,at:a().toISOString()}}:e)})),r(o.restaurantId,'allergy',`Allergy check at handover/table for ${o.ref} confirmed with customer by ${n}`))},customerSignal:(t,a)=>e(e=>({orders:e.orders.map(e=>e.id===t?{...e,customerSignal:a}:e)})),setSplit:(t,a,r)=>e(e=>({orders:e.orders.map(e=>e.id===t?{...e,tip:r,total:e.subtotal+r,split:{ways:a,paidShares:e.split?.paidShares??0}}:e)})),payTable:(a,{shares:n,giftCardCode:o})=>{const l=t().orders.find(e=>e.id===a);if(!l)return;const c=l.split?.ways??1,u=Math.ceil(l.total/c),m=Math.min(c,(l.split?.paidShares??0)+n),g=m>=c,f=g?l.total-l.paid:Math.min(l.total-l.paid,u*n),b=s(o,l.restaurantId,f),k={...l,giftCardApplied:l.giftCardApplied+b,giftCardCode:b?o:l.giftCardCode,paid:l.paid+f,split:{ways:c,paidShares:m},status:g?'closed':l.status};e(e=>({orders:e.orders.map(e=>e.id===a?k:e)})),r(l.restaurantId,'order',`${l.ref} (Table ${l.tableNo}) ${g?'bill paid in full':`share ${m}/${c} paid`} (demo payment)`),g&&p(k)},createBooking:s=>{const n=t().counters.booking+1,o={...s,id:l('bk'),ref:`BK-${n}`,status:'confirmed',createdAt:a().toISOString()};return e(e=>({bookings:[...e.bookings,o],counters:{...e.counters,booking:n}})),r(o.restaurantId,'booking',`Booking ${o.ref}: ${o.name}, ${o.partySize} on ${o.date} ${o.time}${o.allergies.length?' \u2014 allergies declared':''}`),o},setBookingStatus:(a,s)=>{const n=t().bookings.find(e=>e.id===a);e(e=>({bookings:e.bookings.map(e=>e.id===a?{...e,status:s}:e)})),n&&r(n.restaurantId,'booking',`${n.ref} ${n.name} \u2192 ${s}`)},ackBookingAllergy:(s,n)=>{const o=t().bookings.find(e=>e.id===s);e(e=>({bookings:e.bookings.map(e=>e.id===s?{...e,allergyAck:{by:n,at:a().toISOString()}}:e)})),o&&r(o.restaurantId,'allergy',`Booking ${o.ref} allergy acknowledged by ${n}`)},joinWaitlist:(s,n,o,c)=>{const u=t().waitlist.filter(e=>e.restaurantId===s).reduce((e,t)=>Math.max(e,t.number),0)+1,m={id:l('wl'),restaurantId:s,number:u,name:n,partySize:o,joinedAt:a().toISOString(),status:'waiting',customerId:c};return e(e=>({waitlist:[...e.waitlist,m]})),r(s,'waitlist',`${n} (${o}) joined the waitlist as #${u}`),m},setWaitlistStatus:(a,s)=>{const n=t().waitlist.find(e=>e.id===a);e(e=>({waitlist:e.waitlist.map(e=>e.id===a?{...e,status:s}:e)})),n&&(r(n.restaurantId,'waitlist',`Waitlist #${n.number} ${n.name} \u2192 ${s}`),'seated'===s&&t().addWalkIn(n.restaurantId,n.partySize))},addWalkIn:(t,a)=>{e(e=>({walkIns:{...e.walkIns,[t]:(e.walkIns[t]??0)+a}})),r(t,'walkin',`Walk-in seated: ${a} cover(s)`)},addStamp:(s,n,o)=>{const l=t().restaurants.find(e=>e.id===s);l&&(e(e=>{const t=e.stampCards.find(e=>e.restaurantId===s&&e.customerId===n),r=t??{restaurantId:s,customerId:n,stamps:0,rewardsAvailable:0,history:[]};let c=r.stamps+1,u=r.rewardsAvailable;c>=l.settings.stampTarget&&(c=0,u+=1);const m={...r,stamps:c,rewardsAvailable:u,history:[{at:a().toISOString(),source:o},...r.history]};return{stampCards:t?e.stampCards.map(e=>e===t?m:e):[...e.stampCards,m]}}),r(s,'stamp',`Stamp added (${o})`))},redeemReward:(t,a)=>{e(e=>({stampCards:e.stampCards.map(e=>e.restaurantId===t&&e.customerId===a&&e.rewardsAvailable>0?{...e,rewardsAvailable:e.rewardsAvailable-1}:e)})),r(t,'stamp','Loyalty reward redeemed')},buyGiftCard:(s,n,o,c)=>{const u=s.slice(0,3).toUpperCase(),m={id:l('gc'),code:g(u),restaurantId:s,initial:n,balance:n,ownerId:t().customer.id,recipientName:o,message:c,createdAt:a().toISOString()};return e(e=>({giftCards:[m,...e.giftCards]})),r(s,'giftcard',`Gift card sold \xa3${(n/100).toFixed(2)} (demo payment)`),m},redeemGiftCard:(a,s,n)=>{const o=t().giftCards.find(e=>e.code.toUpperCase()===a.trim().toUpperCase());return!(!o||s<=0||s>o.balance)&&(e(e=>({giftCards:e.giftCards.map(e=>e.id===o.id?{...e,balance:e.balance-s}:e)})),r(o.restaurantId,'giftcard',`Gift card ${o.code} redeemed \xa3${(s/100).toFixed(2)} by ${n}`),!0)},honourLegacyCard:(t,s,n,o)=>{const c={id:l('gc'),code:s.trim().toUpperCase(),restaurantId:t,initial:n,balance:n,ownerId:'legacy',recipientName:'Legacy Wix gift card',message:`Honoured by ${o}`,createdAt:a().toISOString().slice(0,10),legacy:!0};return e(e=>({giftCards:[c,...e.giftCards]})),r(t,'giftcard',`Legacy Wix gift card ${c.code} honoured (\xa3${(n/100).toFixed(2)}) by ${o}`),c},addEvent:t=>e(e=>({events:[...e.events,{...t,id:l('ev')}]})),addRating:t=>{e(e=>({ratings:[{...t,id:l('rt'),createdAt:a().toISOString()},...e.ratings],orders:t.orderId?e.orders.map(e=>e.id===t.orderId?{...e,rated:!0}:e):e.orders})),r(t.restaurantId,'rating',`Private rating ${t.stars}/5 from ${t.customerName}`)},updateMenuItem:(a,s)=>{const n='allergens'in s||'description'in s||'optionGroups'in s;e(e=>({menu:e.menu.map(e=>e.id===a?{...e,...s,signOff:n?null:e.signOff}:e)}));const o=t().menu.find(e=>e.id===a);o&&r(o.restaurantId,'menu',`Menu: ${o.name} updated${n?' \u2014 allergen sign-off reset':''}`)},setSignOff:(s,n)=>{e(e=>({menu:e.menu.map(e=>e.id===s?{...e,signOff:n?{by:n,at:a().toISOString().slice(0,10)}:null}:e)}));const o=t().menu.find(e=>e.id===s);o&&r(o.restaurantId,'menu',`Allergen sign-off ${n?`given by ${n}`:'removed'}: ${o.name}`)},updateSettings:(t,a)=>{e(e=>({restaurants:e.restaurants.map(e=>e.id===t?{...e,settings:{...e.settings,...a}}:e)})),'takeawayPaused'in a&&r(t,'order',"Takeaway slots "+(a.takeawayPaused?'PAUSED':'resumed'))},addMenuItem:t=>{const a=l('m');return e(e=>({menu:[...e.menu,{...t,id:a}]})),r(t.restaurantId,'menu',`Menu: ${t.name} added (needs allergen sign-off)`),a},updateRestaurant:(t,a)=>{e(e=>({restaurants:e.restaurants.map(e=>e.id===t?{...e,...a}:e)})),r(t,'menu',`Restaurant info updated (${Object.keys(a).join(', ')})`)},placeManualOrder:({restaurantId:s,type:n,channel:c,customerName:u,tableNo:m,slotTime:g,lines:p,allergies:f,notes:b,by:k})=>{const y=t(),$=p.flatMap(({itemId:e,qty:t})=>{const a=y.menu.find(t=>t.id===e);if(!a||t<=0)return[];const r=(0,o.conflictsFor)((0,o.effectiveAllergens)(a),f);return[{itemId:e,name:a.name,qty:t,unitPrice:a.price??0,choices:[],notes:'',contains:r.contains,may:r.may,overridden:!1,prepMins:a.prepMins}]}),I=$.reduce((e,t)=>e+t.unitPrice*t.qty,0),S='table'===n,w=S?y.counters.table+1:y.counters.order+1,h={id:l('ord'),ref:`${S?'Q':'T'}-${w}`,restaurantId:s,customerId:`manual-${c}`,customerName:u||(S?`Table ${m}`:'Walk-in'),type:n,tableNo:m,slotTime:g,lines:$,subtotal:I,tip:0,giftCardApplied:0,total:I,paid:0,status:'new',createdAt:a().toISOString(),allergies:f,readiness:{},notes:b,channel:c};return e(e=>({orders:[h,...e.orders],counters:S?{...e.counters,table:w}:{...e.counters,order:w}})),r(s,'order',`Order ${h.ref} taken by ${k} (${'phone'===c?'phone':'walk-in'===c?'walk-in takeaway':`Table ${m}`})`),f.length&&r(s,'allergy',`Allergies recorded by ${k} on ${h.ref}: ${f.map(e=>`${e.allergen} (${e.severity})`).join(', ')}`),h},ackAlert:(t,r)=>e(e=>({alertAcks:{...e.alertAcks,[t]:{by:r,at:a().toISOString()}}}))}},{name:'covercharge-demo-v1',version:1,storage:(0,s.createJSONStorage)(()=>a.default)}))},841,[921,927,930,931,791]);
+__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"useShallow",{enumerable:!0,get:function(){return o}});var e,t=r(d[0]),u=(e=t)&&e.__esModule?e:{default:e},n=r(d[1]);function o(e){const t=u.default.useRef(void 0);return u=>{const o=e(u);return(0,n.shallow)(t.current,o)?t.current:t.current=o}}},842,[12,936]);
+__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,"BUILTIN_LOGOS",{enumerable:!0,get:function(){return f}}),Object.defineProperty(_e,"HERO_LOGOS",{enumerable:!0,get:function(){return h}}),Object.defineProperty(_e,"HEADER_LOGO",{enumerable:!0,get:function(){return y}}),Object.defineProperty(_e,"ACCENTS",{enumerable:!0,get:function(){return b}}),_e.useBrandRid=x,_e.useBrand=j,_e.PoweredBy=p,_e.RestaurantLogo=O,_e.RestaurantHero=function({rid:e,size:t=200,showPlace:l=!0}){const s=j(e),f=s.custom?s.logo:h[s.rid]??s.logo;return(0,u.jsxs)(o.default,{testID:"restaurant-hero",style:{alignItems:'center',gap:6},children:[f?(0,u.jsx)(n.default,{source:f,accessibilityLabel:`${s.name} logo`,style:{width:t,height:t,borderRadius:s.custom?t/2:0},resizeMode:"contain"}):(0,u.jsx)(O,{rid:s.rid,size:t}),(0,u.jsx)(r.default,{style:{fontFamily:c.fonts.semibold,fontSize:26,lineHeight:34,color:c.colours.text,textAlign:'center'},children:s.name}),l&&s.place?(0,u.jsx)(r.default,{style:{fontFamily:c.fonts.regular,fontSize:14,lineHeight:20,color:s.accent,textAlign:'center'},children:s.place}):null]})},_e.RestaurantBrand=function({rid:e,sub:t,size:n=y,nameSuffix:l}){const s=j(e);return(0,u.jsxs)(o.default,{style:{gap:2,flexShrink:1},children:[(0,u.jsx)(p,{}),(0,u.jsxs)(o.default,{style:{flexDirection:'row',alignItems:'center',gap:8},children:[(0,u.jsx)(O,{rid:s.rid,size:n}),(0,u.jsxs)(o.default,{style:{flexShrink:1},children:[(0,u.jsxs)(r.default,{numberOfLines:1,style:{fontFamily:c.fonts.semibold,fontSize:17,lineHeight:22,color:c.colours.text},children:[s.name,l??'']}),t?(0,u.jsx)(r.default,{numberOfLines:1,style:{fontFamily:c.fonts.regular,fontSize:12,lineHeight:16,color:s.accent},children:t}):null]})]})]})};var t=_r(d[0]);_r(d[1]);var n=e(_r(d[2])),r=e(_r(d[3])),o=e(_r(d[4])),l=_r(d[5]),s=_r(d[6]),c=_r(d[7]),u=_r(d[8]);const f={anchorage:_r(d[9]),saltmarsh:_r(d[10]),brae:_r(d[11])},h={anchorage:_r(d[12])},y=48,b=['#CFA45F','#D4AF61','#C9A24A','#E2C489','#F2EDE4','#5FA8CF','#7FB069','#D9774B'];function x(e){const n=(0,t.useGlobalSearchParams)(),r=(0,s.useOwner)(e=>e.site),o='string'==typeof n.rid?n.rid:void 0;return e??o??r??'anchorage'}function j(e){const t=x(e),n=(0,l.useStore)(e=>e.restaurants.find(e=>e.id===t)),r=(0,s.useOwner)(e=>e.branding[t]),o=r?.logoUri?{uri:r.logoUri}:f[t];return{rid:t,name:n?.name??'Restaurant',place:n?.location??'',logo:o,accent:r?.accent??c.colours.gold,custom:!!r?.logoUri}}function p({size:e=10}){return(0,u.jsxs)(r.default,{accessibilityLabel:"powered by CoverCharge",style:{fontFamily:c.fonts.regular,fontSize:e,lineHeight:Math.round(1.35*e),color:c.colours.muted},children:["powered by ",(0,u.jsx)(r.default,{style:{fontFamily:c.fonts.semibold,color:c.colours.text},children:"Cover"}),(0,u.jsx)(r.default,{style:{fontFamily:c.fonts.semibold,color:c.colours.gold},children:"Charge"})]})}function O({rid:e,size:t=y}){const l=j(e);if(l.logo)return(0,u.jsx)(n.default,{source:l.logo,accessibilityLabel:`${l.name} logo`,style:{width:t,height:t,borderRadius:l.custom?t/2:0},resizeMode:"contain"});const s=l.name.replace(/^The /,'').split(/\s+/).map(e=>e[0]).join('').slice(0,2).toUpperCase();return(0,u.jsx)(o.default,{accessibilityLabel:`${l.name} logo`,style:{width:t,height:t,borderRadius:t/2,borderWidth:2,borderColor:l.accent,alignItems:'center',justifyContent:'center'},children:(0,u.jsx)(r.default,{style:{fontFamily:c.fonts.bold,color:l.accent,fontSize:.36*t},children:s})})}},844,[785,12,178,188,109,796,802,797,6,937,938,939,940]);
+__d(function(g,_r,i,_a,m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.readinessFor=function(a,d,r){if('takeaway'!==a.type||!a.slotTime)return[];if(['collected','cancelled','closed'].includes(a.status))return[];const s=new Date(a.slotTime),n=d.settings.bufferMins,o=a.lines.map(a=>({name:a.name,qty:a.qty,at:(0,t.addMins)(s,-(a.prepMins+n))})),u=o.reduce((t,a)=>a.at{if(a)return'done';const d=r.getTime()-t.getTime();return d<0?'upcoming':d>3e5?'overdue':'due'},y=['ready','collected'].includes(a.status);return[{id:`${a.id}:cook`,orderId:a.id,stage:'cook',due:u,state:l(u,!!a.readiness.cook||y),detail:o.sort((t,a)=>t.at.getTime()-a.at.getTime()).map(t=>{return`${t.qty}\xd7 ${t.name} at ${a=t.at,`${String(a.getHours()).padStart(2,'0')}:${String(a.getMinutes()).padStart(2,'0')}`}`;var a}).join(' \xb7 ')},{id:`${a.id}:bag`,orderId:a.id,stage:'bag',due:c,state:l(c,!!a.readiness.bag||y),detail:'Bag, add sauces/drinks, check against ticket and allergy flags'},{id:`${a.id}:ready`,orderId:a.id,stage:'ready',due:s,state:l(s,y),detail:'Mark ready \u2014 sends the customer a "your order is ready" notification'}]};var t=_r(_d[0])},845,[795]);
+__d(function(g,r,i,a,m,e,_d){"use strict";function t(t,n){const o={};for(let c=0;c<7;c++){o[c]={};const u=n[c]??0;for(const[n,s]of Object.entries(t))o[c][Number(n)]=Math.round(s*u)}return o}Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"EXAMPLE_HISTORY",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"EXAMPLE_ACCURACY",{enumerable:!0,get:function(){return f}});const n={12:18,13:26,14:16,15:9,16:10,17:22,18:36,19:38,20:20},o={12:2,13:2,14:1,15:1,16:2,17:4,18:6,19:5,20:2},c={0:1.05,1:0,2:0,3:.6,4:.7,5:1,6:1.15},u={0:.6,1:.5,2:.5,3:.6,4:.7,5:.9,6:1},s={anchorage:{covers:t(n,c),takeaway:t(o,c)},default:{covers:t(n,u),takeaway:t(o,u)}},f='Example: last 4 weeks within \xb118% of actual covers'},846,[]);
+__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,"CHANNELS",{enumerable:!0,get:function(){return u}}),_e.inChannel=x,Object.defineProperty(_e,"dmId",{enumerable:!0,get:function(){return y}}),_e.autoPost=function(e,t){const s=new Date(globalThis.__ccNow??Date.now()).toISOString();(Array.isArray(e)?e:[e]).forEach(e=>l.useOwner.getState().sys(e,t,s))},_e.ensureChat=p,_e.useChatUnread=j,_e.Chat=function({go:e}){const{now:n,meId:b,role:w}=(0,c.useCtx)(3e4),C=(0,l.useOwner)(e=>e.staff),S=(0,l.useOwner)(e=>e.chat),R=(0,l.useOwner)(e=>e.chatMuted[b]??f),{by:O}=j(),[T,B]=(0,t.useState)(null),[M,L]=(0,t.useState)(!1),[P,A]=(0,t.useState)(!1);(0,t.useEffect)(()=>{p(n)},[]),(0,t.useEffect)(()=>{B(null)},[b]);const z=C.find(e=>e.id===b);if(T)return(0,h.jsx)(k,{ch:T,go:e,back:()=>B(null)});const D=Array.from(new Set(S.filter(e=>e.ch.startsWith('dm:')&&x(e.ch,z)).map(e=>e.ch))),I=({id:e,name:t,icon:n,avatar:l})=>{const c=(u=e,S.filter(e=>e.ch===u).sort((e,t)=>t.at.localeCompare(e.at))[0]);var u;const f=O[e]??0,b=R.includes(e);return(0,h.jsx)(s.default,{accessibilityRole:"button",accessibilityLabel:`Open ${t}`,onPress:()=>B(e),style:{padding:12,borderTopWidth:1,borderColor:d.colours.border},children:(0,h.jsxs)(i.Row,{children:[l?(0,h.jsx)(v,{s:l}):(0,h.jsx)(o.default,{style:{width:34,height:34,borderRadius:17,backgroundColor:'#222',alignItems:'center',justifyContent:'center'},children:(0,h.jsx)(i.T,{size:16,children:n})}),(0,h.jsxs)(o.default,{style:{flex:1},children:[(0,h.jsxs)(i.Row,{style:{justifyContent:'space-between'},children:[(0,h.jsxs)(i.T,{weight:f?'bold':'medium',children:[t,b?' \ud83d\udd15':'']}),c?(0,h.jsx)(i.Muted,{children:(0,a.hm)(new Date(c.at))}):null]}),(0,h.jsx)(i.Muted,{numberOfLines:1,children:c?c.removed?'Message removed':`${'system'===c.from?'Cover Charge':m(C.find(e=>e.id===c.from)?.name)}: ${c.text??'\ud83d\udcf7 Photo'}`:'No messages yet'})]}),f?(0,h.jsx)(o.default,{style:{backgroundColor:b?'#555':d.colours.red,borderRadius:10,minWidth:20,height:20,alignItems:'center',justifyContent:'center',paddingHorizontal:5},children:(0,h.jsx)(i.T,{size:11,weight:"bold",children:f})}):null]})})};return(0,h.jsxs)(o.default,{style:{gap:10},children:[(0,h.jsxs)(i.Row,{style:{justifyContent:'space-between'},children:[(0,h.jsxs)(i.Muted,{children:["Signed in as ",m(z?.name)," (",l.ROLE_LABEL[w],")"]}),(0,h.jsx)(i.Button,{small:!0,kind:"ghost",label:"Chat settings",onPress:()=>A(!0)})]}),(0,h.jsxs)(o.default,{style:{borderRadius:14,borderWidth:1,borderColor:d.colours.border,backgroundColor:d.colours.surface,overflow:'hidden'},children:[(0,h.jsx)(i.T,{size:12,weight:"semibold",colour:d.colours.gold,style:{padding:10},children:"CHANNELS"}),u.filter(e=>x(e.id,z)).map(e=>(0,h.jsx)(I,{id:e.id,name:e.name,icon:e.icon},e.id))]}),(0,h.jsxs)(o.default,{style:{borderRadius:14,borderWidth:1,borderColor:d.colours.border,backgroundColor:d.colours.surface,overflow:'hidden'},children:[(0,h.jsxs)(i.Row,{style:{justifyContent:'space-between',padding:10},children:[(0,h.jsx)(i.T,{size:12,weight:"semibold",colour:d.colours.gold,children:"DIRECT MESSAGES"}),(0,h.jsx)(i.Button,{small:!0,kind:"ghost",label:"+ New",onPress:()=>L(!0)})]}),D.map(e=>{const t=C.find(t=>t.id===e.split(':').slice(1).find(e=>e!==b));return(0,h.jsx)(I,{id:e,name:m(t?.name),avatar:t},e)}),D.length?null:(0,h.jsx)(i.Muted,{style:{padding:10},children:"No direct messages yet."})]}),'owner'===w?(0,h.jsx)(i.Muted,{children:"As owner you can view every channel and remove messages (tap a message). Direct messages are private to the two people in them."}):null,(0,h.jsx)(i.Sheet,{visible:M,onClose:()=>L(!1),title:"New direct message",children:C.filter(e=>e.active&&e.id!==b).map(e=>(0,h.jsx)(s.default,{accessibilityRole:"button",accessibilityLabel:`Message ${e.name}`,onPress:()=>{L(!1),B(y(b,e.id))},style:{paddingVertical:8},children:(0,h.jsxs)(i.Row,{children:[(0,h.jsx)(v,{s:e}),(0,h.jsxs)(o.default,{children:[(0,h.jsx)(i.T,{children:m(e.name)}),(0,h.jsxs)(i.Muted,{children:[l.ROLE_LABEL[e.role]," \xb7 ",e.job]})]})]})},e.id))}),(0,h.jsxs)(i.Sheet,{visible:P,onClose:()=>A(!1),title:"Chat settings",children:[(0,h.jsx)(i.Banner,{kind:"info",title:"Privacy",children:"Chat is for work. Managers and the owner can see messages in channels they belong to, and the owner can view and moderate all channels. Direct messages are only visible to the two people in them. Don't share customer card or health details beyond what's needed for service."}),(0,h.jsx)(i.T,{weight:"semibold",children:"Mute channels"}),u.filter(e=>x(e.id,z)).map(e=>(0,h.jsxs)(i.Row,{style:{justifyContent:'space-between'},children:[(0,h.jsxs)(i.T,{children:[e.icon," ",e.name]}),(0,h.jsx)(i.Toggle,{label:`Mute ${e.name}`,value:R.includes(e.id),onChange:()=>l.useOwner.getState().chatMute(b,e.id)})]},e.id)),(0,h.jsx)(i.Muted,{children:"Muted channels don't count towards the tab badge."})]})]})};var t=r(_d[0]),s=e(r(_d[1])),n=e(r(_d[2])),o=e(r(_d[3])),i=r(_d[4]),l=r(_d[5]),a=r(_d[6]),d=r(_d[7]),c=r(_d[8]),h=r(_d[9]);const u=[{id:'all',name:'All staff',icon:'\ud83d\udce3'},{id:'kitchen',name:'Kitchen',icon:'\ud83c\udf73'},{id:'foh',name:'Front of house',icon:'\ud83c\udf7d\ufe0f'},{id:'managers',name:'Managers',icon:'\ud83d\udd12'}],f=[],m=e=>(e??'').replace(' (example)',''),b=e=>!!e&&'staff'!==e.role;function x(e,t){return!!t&&(e.startsWith('dm:')?e.split(':').slice(1).includes(t.id):'owner'===t.role||('all'===e||('managers'===e?b(t):'kitchen'===e?b(t)||/kitchen|chef/i.test(t.job):'foh'===e&&(b(t)||/front|bar|server/i.test(t.job)))))}const y=(e,t)=>`dm:${[e,t].sort().join(':')}`;function p(e){const t=l.useOwner.getState();if(t.chat.length)return;const s=['st-gordon','st-2','st-3','st-4','st-5'],n=(n,o,i,l,a={})=>{return{id:`m-seed-${n}-${i}`,ch:n,from:o,text:l,at:(d=i,new Date(e.getTime()-6e4*d).toISOString()),reactions:{},seenBy:s.filter(e=>x(n,t.staff.find(t=>t.id===e))),...a};var d};l.useOwner.setState({chat:[n('all','st-2',1500,'Burns Night menu briefing Fri 4pm in the dining room. Tasting for everyone on shift \ud83e\udd43',{pinned:!0,reactions:{'\ud83d\udc4d':['st-3','st-4','st-5']}}),n('all','system',1440,'Rota for next week published',{seenBy:['st-gordon','st-2','st-3','st-4']}),n('all','system',300,'Shift swap: Bar \u2194 Server approved (Saturday)',{seenBy:['st-gordon','st-2','st-4']}),n('all','st-gordon',240,'Big Friday tonight, 9 bookings and the forecast says busy from 18:00. Thanks all \ud83d\udcaa',{reactions:{'\ud83d\udd25':['st-2','st-4'],'\ud83d\udc4d':['st-3']},seenBy:['st-gordon','st-2','st-3','st-4']}),n('kitchen','st-3',200,'Langoustine delivery in, 4kg. Lobster special is on the board.',{photo:{caption:'Delivery arrived',tone:'#26403A'}}),n('kitchen','system',45,'86: Haddock sold out',{seenBy:['st-3']}),n('kitchen','system',20,'Allergy alert table 6: peanuts',{seenBy:['st-3']}),n('kitchen','st-2',18,'Table 6 confirmed with the guest: peanut allergy, no other allergens. I\u2019ve acknowledged it on the order.',{seenBy:['st-2','st-3']}),n('foh','st-4',90,'Can someone restock the tartare tubs at the pass please?',{seenBy:['st-2','st-4','st-5']}),n('foh','st-5',85,'On it \ud83d\udc4d',{seenBy:['st-4','st-5']}),n('foh','st-2',12,'Reid party of 6 running 15 min late, hold table 7.',{seenBy:['st-2']}),n('managers','st-gordon',600,'Labour is 22% for Saturday. Let\u2019s add a server 18:00\u201321:00.',{seenBy:['st-gordon','st-2']}),n('managers','st-2',590,'Agreed, I\u2019ll ask on All staff.',{seenBy:['st-gordon','st-2']}),n(y('st-gordon','st-2'),'st-2',30,'Gordon, can I leave at 22:30 tonight? Bar will close up.',{seenBy:['st-2']}),n(y('st-4','st-5'),'st-5',60,'Swap still OK for Saturday?',{seenBy:['st-4','st-5']})]})}function j(){const{meId:e}=(0,c.useCtx)(3e4),s=(0,l.useOwner)(e=>e.chat),n=(0,l.useOwner)(e=>e.staff),o=(0,l.useOwner)(t=>t.chatMuted[e]??f),i=n.find(t=>t.id===e);return(0,t.useMemo)(()=>{const t={};return s.forEach(s=>{s.removed||s.from===e||s.seenBy.includes(e)||!x(s.ch,i)||(t[s.ch]=(t[s.ch]??0)+1)}),{by:t,total:Object.entries(t).filter(([e])=>!o.includes(e)).reduce((e,[,t])=>e+t,0)}},[s,e,o,i])}const w={owner:d.colours.gold,manager:d.colours.blue,staff:'#7a6f5c'};function v({s:e,size:t=34}){const s=e?m(e.name).split(' ').map(e=>e[0]).join('').slice(0,2).toUpperCase():'CC';return(0,h.jsx)(o.default,{style:{width:t,height:t,borderRadius:t/2,backgroundColor:e?w[e.role]:'#333',alignItems:'center',justifyContent:'center'},children:(0,h.jsx)(i.T,{size:.38*t,weight:"bold",colour:"#111",children:s})})}const C=[{caption:'Specials board',tone:'#4A3A22'},{caption:'Plating: Cullen skink',tone:'#3E2A2A'},{caption:'Delivery arrived',tone:'#26403A'},{caption:'Spillage by the bar',tone:'#2E2E40'}],S=['\ud83d\udc4d','\u2764\ufe0f','\ud83d\ude02','\u2705','\ud83d\udd25'];function k({ch:e,go:f,back:b}){const{now:y,meId:p,role:j}=(0,c.useCtx)(1e4),k=(0,l.useOwner)(e=>e.staff),R=(0,l.useOwner)(e=>e.chat),O=(0,l.useOwner)(e=>e.shifts),T=R.filter(t=>t.ch===e).sort((e,t)=>e.at.localeCompare(t.at)),[B,M]=(k.find(e=>e.id===p),(0,t.useState)('')),[L,P]=(0,t.useState)(null),[A,z]=(0,t.useState)(!1),[D,I]=(0,t.useState)(!1),$=e.startsWith('dm:')?e.split(':').slice(1).length:k.filter(t=>t.active&&x(e,t)).length;(0,t.useEffect)(()=>{l.useOwner.getState().chatSeen(e,p)},[e,p,T.length]);const E=t=>l.useOwner.getState().chatSend({ch:e,from:p,at:y.toISOString(),...t}),W=T.filter(e=>e.pinned&&!e.removed),N=e.startsWith('dm:')?m(k.find(t=>t.id===e.split(':').slice(1).find(e=>e!==p))?.name):u.find(t=>t.id===e)?.name,_=O.filter(e=>e.staffId===p);return(0,h.jsxs)(o.default,{style:{gap:8},children:[(0,h.jsxs)(i.Row,{style:{justifyContent:'space-between'},children:[(0,h.jsx)(s.default,{accessibilityRole:"button",accessibilityLabel:"Back to chats",onPress:b,hitSlop:10,children:(0,h.jsx)(i.T,{colour:d.colours.gold,children:"\u2039 Chats"})}),(0,h.jsx)(i.T,{weight:"semibold",children:N}),(0,h.jsxs)(i.Muted,{children:[$," members"]})]}),W.map(e=>(0,h.jsxs)(i.Card,{highlight:d.colours.gold,children:[(0,h.jsxs)(i.T,{size:12,colour:d.colours.gold,children:["\ud83d\udccc Pinned by ",m(k.find(t=>t.id===e.from)?.name)]}),(0,h.jsx)(i.T,{size:14,children:e.text})]},e.id)),T.map((t,n)=>{const c=k.find(e=>e.id===t.from),u=t.from===p,b=t.seenBy.filter(e=>e!==t.from).length,x=0===n||t.at.slice(0,10)!==T[n-1].at.slice(0,10);return'system'===t.from?(0,h.jsxs)(o.default,{style:{alignItems:'center',gap:2},children:[x?(0,h.jsx)(i.Muted,{children:(0,a.niceDate)(new Date(t.at))}):null,(0,h.jsx)(o.default,{style:{backgroundColor:'#1c1a14',borderRadius:10,paddingHorizontal:10,paddingVertical:5,borderWidth:1,borderColor:d.colours.border},children:(0,h.jsxs)(i.T,{size:13,colour:/Allergy|86/.test(t.text??'')?d.colours.amber:d.colours.muted,children:["\u2699\ufe0e Cover Charge \xb7 ",t.text," \xb7 ",(0,a.hm)(new Date(t.at))]})})]},t.id):(0,h.jsxs)(o.default,{style:{gap:2},children:[x?(0,h.jsx)(i.Muted,{center:!0,children:(0,a.niceDate)(new Date(t.at))}):null,(0,h.jsxs)(i.Row,{style:{alignItems:'flex-start',flexDirection:u?'row-reverse':'row'},children:[(0,h.jsx)(v,{s:c}),(0,h.jsxs)(s.default,{accessibilityRole:"button",accessibilityLabel:`Message from ${c?.name}`,onPress:()=>P(L===t.id?null:t.id),style:{maxWidth:'78%',backgroundColor:u?'#3a2f12':d.colours.surface,borderRadius:14,padding:9,borderWidth:1,borderColor:t.pinned?d.colours.gold:d.colours.border,gap:3},children:[(0,h.jsxs)(i.Row,{gap:6,children:[(0,h.jsx)(i.T,{size:12,weight:"semibold",colour:c?w[c.role]:d.colours.muted,children:m(c?.name)}),(0,h.jsxs)(i.T,{size:11,colour:d.colours.muted,children:[c?l.ROLE_LABEL[c.role]:''," \xb7 ",(0,a.hm)(new Date(t.at))]})]}),t.removed?(0,h.jsx)(i.T,{size:14,colour:d.colours.muted,children:"Message removed by the owner"}):(0,h.jsxs)(h.Fragment,{children:[t.photo?(0,h.jsx)(o.default,{style:{width:200,height:120,borderRadius:10,backgroundColor:t.photo.tone,justifyContent:'flex-end',padding:6},children:(0,h.jsxs)(i.T,{size:12,children:["\ud83d\udcf7 ",t.photo.caption," (example image)"]})}):null,t.text?(0,h.jsx)(i.T,{size:15,children:t.text}):null,'cover'===t.action?(0,h.jsx)(i.Button,{small:!0,kind:"secondary",label:"Open cover requests on the rota",onPress:()=>f('more','rota')}):null]}),Object.entries(t.reactions).filter(([,e])=>e.length).length?(0,h.jsx)(i.Row,{wrap:!0,gap:4,children:Object.entries(t.reactions).filter(([,e])=>e.length).map(([e,t])=>(0,h.jsx)(o.default,{style:{borderRadius:10,paddingHorizontal:6,backgroundColor:t.includes(p)?'#4a3c16':'#222'},children:(0,h.jsxs)(i.T,{size:12,children:[e," ",t.length]})},e))}):null,u?(0,h.jsx)(i.T,{size:11,colour:d.colours.muted,children:b?`Seen by ${b}`:'Sent'}):null]})]}),L!==t.id||t.removed?null:(0,h.jsxs)(i.Row,{wrap:!0,gap:6,style:{justifyContent:u?'flex-end':'flex-start',paddingLeft:u?0:40},children:[S.map(e=>(0,h.jsx)(s.default,{accessibilityLabel:`React ${e}`,onPress:()=>{l.useOwner.getState().chatReact(t.id,e,p),P(null)},style:{padding:4},children:(0,h.jsx)(i.T,{size:20,children:e})},e)),'staff'===j||e.startsWith('dm:')?null:(0,h.jsx)(i.Button,{small:!0,kind:"ghost",label:t.pinned?'Unpin':'Pin',onPress:()=>{l.useOwner.getState().chatPatch(t.id,{pinned:!t.pinned}),P(null)}}),'owner'!==j||u?null:(0,h.jsx)(i.Button,{small:!0,kind:"danger",label:"Remove",onPress:()=>{l.useOwner.getState().chatPatch(t.id,{removed:!0,pinned:!1}),P(null)}})]})]},t.id)}),(0,h.jsxs)(i.Row,{gap:6,children:[(0,h.jsx)(s.default,{accessibilityRole:"button",accessibilityLabel:"Send a photo",onPress:()=>z(!0),style:{padding:8},children:(0,h.jsx)(i.T,{size:20,children:"\ud83d\udcf7"})}),(0,h.jsx)(n.default,{accessibilityLabel:"Message",placeholder:`Message ${N}`,placeholderTextColor:"#7D776C",value:B,onChangeText:M,style:[i.styles.input,{flex:1}]}),(0,h.jsx)(i.Button,{small:!0,label:"Send",disabled:!B.trim(),onPress:()=>{E({text:B.trim()}),M('')}})]}),(0,h.jsx)(i.Row,{wrap:!0,gap:6,children:(0,h.jsx)(i.Button,{small:!0,kind:"secondary",label:"Ask for shift cover",onPress:()=>I(!0)})}),(0,h.jsx)(i.Muted,{center:!0,children:"Local demo: messages stay on this device. Nothing is sent."}),(0,h.jsx)(i.Sheet,{visible:A,onClose:()=>z(!1),title:"Send a photo (example images)",children:(0,h.jsx)(i.Row,{wrap:!0,gap:8,children:C.map(e=>(0,h.jsx)(s.default,{accessibilityRole:"button",accessibilityLabel:e.caption,onPress:()=>{E({photo:e}),z(!1)},style:{width:'47%',height:100,borderRadius:10,backgroundColor:e.tone,justifyContent:'flex-end',padding:6},children:(0,h.jsx)(i.T,{size:12,children:e.caption})},e.caption))})}),(0,h.jsxs)(i.Sheet,{visible:D,onClose:()=>I(!1),title:"Ask for shift cover",children:[_.length?null:(0,h.jsx)(i.Muted,{children:"You have no shifts on the rota this week."}),_.map(e=>(0,h.jsx)(i.Button,{kind:"secondary",label:`${c.DAY3[e.day]} ${(0,c.fmtH)(e.start)}\u2013${(0,c.fmtH)(e.end)}`,onPress:()=>{const t=`${c.DAY3[e.day]} ${(0,c.fmtH)(e.start)}\u2013${(0,c.fmtH)(e.end)}`;l.useOwner.getState().addSwap({shiftId:e.id,fromId:p,kind:'cover',note:`Cover asked in chat for ${t}`}),E({text:`Can anyone cover my ${t} shift? I\u2019ve added a cover request on the rota.`,action:'cover'}),I(!1)}},e.id)),(0,h.jsx)(i.Muted,{children:"Creates a cover request in Rota \u203a Swaps & leave for a manager to approve."})]})]})}},847,[12,245,255,109,790,802,795,797,848,6]);
+__d(function(g,_r,_i,_a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"StaffAppCtx",{enumerable:!0,get:function(){return o}}),Object.defineProperty(_e,"useInStaffApp",{enumerable:!0,get:function(){return u}}),_e.useCtx=function(u=1e4){const i=(0,e.useContext)(o),d=(0,n.useOwner)(e=>e.site),f=(0,n.useOwner)(e=>e.previewRole),c=(0,n.useOwner)(e=>e.staffAs),m=i||'staff'===r.APP_VARIANT?'staff':f,w=(0,n.useOwner)(e=>e.staff),h=(0,t.useRestaurant)(d),D=(0,t.useNow)(u),l=i&&c?c:s[m],p=w.find(e=>e.id===l)?.name??'Gordon Munro';return{rid:d,r:h,now:D,role:m,me:p,meId:l,today:(0,a.ymd)(D)}},Object.defineProperty(_e,"weekday",{enumerable:!0,get:function(){return i}}),Object.defineProperty(_e,"fmtH",{enumerable:!0,get:function(){return d}}),Object.defineProperty(_e,"DAY3",{enumerable:!0,get:function(){return f}}),_e.ensureAttendance=function(e,t){const r=n.useOwner.getState(),s=[],o=(e,t,n)=>{const a=new Date(e);return a.setHours(0,0,0,0),a.setMinutes(Math.round(60*t)+n),a.toISOString()};for(let e=42;e>=1;e--){const n=new Date(t);n.setDate(n.getDate()-e);const u=(0,a.ymd)(n);r.attendance.some(e=>e.date===u)||r.shifts.filter(e=>e.day===i(n)).forEach((e,t)=>{const a=e=>Math.round((7*u.charCodeAt(9)+13*t+e)%17-5),r=e.end-e.start,i='st-5'===e.staffId&&r>6?0:r>8?30:r>6?20:0;s.push({id:`at-${u}-${e.staffId}`,staffId:e.staffId,date:u,in:o(n,e.start,a(1)),out:o(n,e.end,a(2)),inSite:!0,outSite:!0,breakMins:i})})}!r.attendance.some(t=>t.date===e)&&t.getHours()>=11&&(s.push({id:'at-seed-3',staffId:'st-3',date:e,in:o(t,10,41),inSite:!0}),s.push({id:'at-seed-2',staffId:'st-2',date:e,in:o(t,14,57),inSite:!0}),t.getHours()>=16&&s.push({id:'at-seed-4',staffId:'st-4',date:e,in:o(t,16,6),inSite:!0}));s.length&&n.useOwner.setState({attendance:[...n.useOwner.getState().attendance,...s]})},_e.paidMins=function(e,t){if(!e.in)return{worked:0,brk:0,paid:0};const n=Math.max(0,Math.round(((e.out?new Date(e.out):t).getTime()-new Date(e.in).getTime())/6e4)),a=e.breakMins??0;return{worked:n,brk:a,paid:Math.max(0,n-a)}},Object.defineProperty(_e,"hmDur",{enumerable:!0,get:function(){return c}}),_e.payRange=function(e,t,n){const r=new Date(n);if(r.setHours(0,0,0,0),'monthly'===e){const e=new Date(r.getFullYear(),r.getMonth()+t,1),n=new Date(e.getFullYear(),e.getMonth()+1,0);return{s:e,e:n,key:`m-${(0,a.ymd)(e)}`}}const s='weekly'===e?7:14,o=new Date(r);o.setDate(r.getDate()-i(r));let u=new Date(o);if('fortnightly'===e){const e=new Date(2026,0,5);(Math.round((o.getTime()-e.getTime())/6048e5)%2+2)%2==1&&u.setDate(u.getDate()-7)}u.setDate(u.getDate()+t*s);const d=new Date(u);return d.setDate(u.getDate()+s-1),{s:u,e:d,key:`${e[0]}-${(0,a.ymd)(u)}`}};var e=_r(_d[0]),t=_r(_d[1]),n=_r(_d[2]),a=_r(_d[3]),r=_r(_d[4]);const s={owner:'st-gordon',manager:'st-2',staff:'st-4'},o=(0,e.createContext)(!1),u=()=>(0,e.useContext)(o);const i=e=>(e.getDay()+6)%7,d=e=>`${String(Math.floor(e)).padStart(2,'0')}:${String(Math.round(e%1*60)).padStart(2,'0')}`,f=['Mon','Tue','Wed','Thu','Fri','Sat','Sun'];const c=e=>`${Math.floor(e/60)}h ${String(e%60).padStart(2,'0')}m`},848,[12,796,802,795,787]);
+__d(function(g,_r,_i,a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"hash",{enumerable:!0,get:function(){return o}}),Object.defineProperty(_e,"CHANNELS",{enumerable:!0,get:function(){return n}}),_e.revenueHistory=function(e,n,r=28){const i=[];for(let s=r;s>=1;s--){const r=(0,t.addMins)(n,1440*-s),d=!!e.kitchenHours[r.getDay()],l=[1.05,0,0,.6,.7,1,1.2][r.getDay()]*('anchorage'===e.id?1:.6),u=n=>.85+.3*o((0,t.ymd)(r)+n+e.id),c=d?Math.round(24e4*l*u('d')):0,p=d?Math.round(95e3*l*u('t')):0,h=d?Math.round(52e3*l*u('q')):0;i.push({date:r,label:(0,t.niceDate)(r).slice(0,6),byChannel:{'Dine-in':c,Takeaway:p,'Table QR':h},total:c+p+h,covers:d?Math.round(150*l*u('c')):0})}return i},_e.dishStats=function(e){return e.filter(e=>null!=e.price).map(e=>{const t=Math.round(20+260*o(e.id+'s')),n=.24+.22*o(e.id+'c'),r=e.price??0,i=Math.round(r*(1-n));return{item:e,sold:t,revenue:t*r,costPct:n,margin:i,gp:i*t}})},_e.quadrant=function(e,t,o,n){return e>=o?t>=n?'Star':'Plough horse':t>=n?'Puzzle':'Dog'},Object.defineProperty(_e,"QUADRANT_TIP",{enumerable:!0,get:function(){return r}}),_e.crmCustomers=function(){return i.map((e,t)=>{const r=o(e+t);return{id:0===t?'cust-demo':`cr-${t}`,name:`${e} ${s[t]}${0===t?'':' (example)'}`,phone:`07700 900${String(100+7*t).slice(-3)}`,visits:1+Math.round(18*r),lastVisit:`${1+Math.round(27*r)} days ago`,spend:Math.round(3e3+6e4*r),allergies:0===t?['Crustaceans (anaphylaxis)','Mustard']:r>.8?['Gluten (coeliac)']:r<.1?['Peanuts']:[],stamps:0===t?5:Math.round(7*r),optIn:r>.25,channel:n[Math.floor(3*r)%3],birthday:r>.6?`${1+Math.round(27*r)} Nov`:void 0}})},Object.defineProperty(_e,"STOCK",{enumerable:!0,get:function(){return d}}),_e.insights=function(o,n,r,i,s,l,u){const c=[],p=new Date(l);p.setDate(p.getDate()+((6-p.getDay()+7)%7||7)),p.setHours(0,0,0,0);const h=(0,e.forecastToday)(o,n,r,i,p),m=Math.round(h.restOfDay.covers/Math.max(1,h.multiplier)),b=Math.max(35,Math.round(100*(h.multiplier-1))+35);c.push({id:'sat',icon:'\ud83d\udcc8',tone:'gold',title:`${(0,t.niceDate)(p)} forecast +${b}%: add 1 server 6\u20139pm`,body:`Example: ~${Math.round(m*(1+b/100))} covers expected vs ~${m} on a usual Saturday (bookings pace + Halloween weekend flag).`,action:{label:'Open rota',tab:'more',sub:'rota'}});const f=(0,e.forecastToday)(o,n,r,i,l),y=d[0],v=Math.ceil((f.restOfDay.covers+2*f.restOfDay.takeaway)*y.perCover);c.push({id:'haddock',icon:'\ud83d\udc1f',tone:'red',title:`Haddock low: ${y.onHand} portions left`,body:`Tonight\u2019s forecast needs ~${v}. Call the supplier before 18:00 or 86 the fish supper at ${y.onHand} sold.`,action:{label:'Prep list',tab:'more',sub:'prep'}});const M=i.find(e=>/Burns/.test(e.title));if(M){const e=Math.max(1,Math.round((new Date(M.date).getTime()-l.getTime())/6048e5));c.push({id:'burns',icon:'\ud83e\udd43',tone:'blue',title:`Burns Night in ${e} weeks: open bookings?`,body:'Last year\u2019s equivalent nights sold out ~3 weeks ahead (example). Publish the set menu and push to opted-in regulars.',action:{label:'Plan campaign',tab:'more',sub:'marketing'}})}const w=n.filter(e=>'noshow'===e.status).length;c.push({id:'noshow',icon:'\ud83e\ude91',tone:'amber',title:w?`${w} no-show today: deposits for 6+?`:'No-shows down 40% since card-on-file (example)',body:'Saved card is required from parties of 6. Consider deposits on Fri/Sat after 19:00.',action:{label:'Bookings',tab:'bookings'}});const k=s.filter(e=>e.stars<=2).length;k&&c.push({id:'reviews',icon:'\ud83d\udcac',tone:'red',title:`${k} low rating this week: cold chips at collection`,body:'Readiness alerts now time bagging 5 min before pickup. Reply to say thanks and invite them back.',action:{label:'Reviews',tab:'more',sub:'reviews'}});return c.push({id:'commission',icon:'\ud83d\udcb7',tone:'green',title:'You kept ~\xa31,240 in commission this month',body:'Example: \xa34,140 of direct takeaway orders that would have cost ~30% on delivery apps.',action:{label:'Analytics',tab:'more',sub:'analytics'}}),c.push({id:'covers',icon:'\ud83c\udf7d\ufe0f',tone:'gold',title:`${u} covers so far today`,body:'Lobster special is the top add-on tonight. Suggest it with the scallops (example).'}),c};var e=_r(_d[0]),t=_r(_d[1]);const o=e=>{let t=2166136261;for(let o=0;o>>0)/4294967295},n=['Dine-in','Takeaway','Table QR'];const r={Star:'Keep: high margin and popular. Feature it.','Plough horse':'Popular, low margin: nudge the price or trim the cost.',Puzzle:'High margin, few sales: promote it or rename it.',Dog:'Low margin, few sales: consider removing it.'},i=['Alex','Fiona','Iain','Morag','Callum','Eilidh','Ross','Kirsty','Euan','Shona','Hamish','Isla','Craig','Ailsa','Neil','Catriona'],s=['Morgan','Campbell','Fraser','McLeod','Kerr','Wallace','Boyd','Hamilton','Stewart','Murray','Paterson','Duncan','Gilmour','Reid','Ross','Grant'];const d=[{cat:'Fish & seafood',id:'haddock',name:'Haddock fillets',unit:'portions',onHand:8,perCover:.22,par:40},{cat:'Fruit & veg',id:'chips',name:'Chipping potatoes',unit:'kg',onHand:25,perCover:.18,par:40},{cat:'Fish & seafood',id:'langoustine',name:'Langoustines',unit:'kg',onHand:4,perCover:.03,par:6},{cat:'Fish & seafood',id:'mussels',name:'Mussels',unit:'kg',onHand:10,perCover:.05,par:12},{cat:'Fish & seafood',id:'scallops',name:'Scallops',unit:'portions',onHand:14,perCover:.06,par:20},{cat:'Meat',id:'beef',name:'Burger patties',unit:'each',onHand:30,perCover:.1,par:40},{cat:'Fruit & veg',id:'peas',name:'Garden peas',unit:'kg',onHand:6,perCover:.04,par:8},{cat:'Dairy',id:'tartare',name:'House tartare sauce',unit:'tubs',onHand:5,perCover:.05,par:10}]},865,[839,795]);
+__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},899,[]);
+__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),(function(t,n){for(var u in n)Object.defineProperty(t,u,{enumerable:!0,get:Object.getOwnPropertyDescriptor(n,u).get})})(e,{get Badge(){return x.Badge},get DarkTheme(){return y.DarkTheme},get DefaultTheme(){return _.DefaultTheme},get ErrorBoundary(){return v.ErrorBoundary},get ExperimentalStack(){return U.ExperimentalStack},get ExpoRoot(){return c.ExpoRoot},get Icon(){return x.Icon},get IsWithinNativeNavigator(){return B.IsWithinNativeNavigator},get Label(){return x.Label},get LocaleProvider(){return I.LocaleProvider},get NativeStackView(){return E.NativeStackView},get NavigationAwareActivity(){return R.NavigationAwareActivity},get Navigator(){return t.Navigator},get RouterActionHandling(){return C.RouterActionHandling},get Sitemap(){return b.Sitemap},get Slot(){return t.Slot},get SplashScreen(){return S},get StackRouter(){return C.StackRouter},get SuspenseFallback(){return f.SuspenseFallback},get TabRouter(){return C.TabRouter},get Tabs(){return M.Tabs},get ThemeProvider(){return T.ThemeProvider},get Unmatched(){return l.Unmatched},get VectorIcon(){return x.VectorIcon},get attachRouteState(){return C.attachRouteState},get createBaseStackProps(){return j.createBaseStackProps},get createBaseTabProps(){return D.createBaseTabProps},get createNativeStackProps(){return W.createNativeStackProps},get createStandardRouterNavigator(){return B.createStandardRouterNavigator},get enableLegacyHeaderAppearance(){return F.enableLegacyHeaderAppearance},get extendRouter(){return C.extendRouter},get extendRouterActions(){return C.extendRouterActions},get integrateWithRouter(){return B.integrateWithRouter},get isActionHandled(){return C.isActionHandled},get router(){return u.router},get unstable_PerformanceObserver(){return G.unstable_PerformanceObserver},get unstable_createStandardRouterNavigator(){return B.unstable_createStandardRouterNavigator},get unstable_enablePerformanceIntegration(){return G.unstable_enablePerformanceIntegration},get unstable_integrateWithRouter(){return B.unstable_integrateWithRouter},get unstable_performance(){return G.unstable_performance},get unstable_useIsNavigating(){return o.useIsNavigating},get unstable_useReconcileTabHistory(){return H.useReconcileTabHistory},get useCanGoBack(){return n.useCanGoBack},get useCurrentRouteInfo(){return n.useCurrentRouteInfo},get useFocusEffect(){return h.useFocusEffect},get useGlobalSearchParams(){return n.useGlobalSearchParams},get useIsFocused(){return N.useIsFocused},get useLoaderData(){return n.useLoaderData},get useLocalSearchParams(){return n.useLocalSearchParams},get useNavigation(){return P.useNavigation},get useNavigationContainerRef(){return n.useNavigationContainerRef},get usePathname(){return n.usePathname},get usePreventRemove(){return L.usePreventRemove},get useRootNavigation(){return n.useRootNavigation},get useRootNavigationState(){return n.useRootNavigationState},get useRoute(){return A.useRoute},get useRoutePath(){return O.useRoutePath},get useRouter(){return n.useRouter},get useScrollToTop(){return w.useScrollToTop},get useSegments(){return n.useSegments},get useSitemap(){return p.useSitemap},get useTheme(){return k.useTheme},get useUnstableGlobalHref(){return n.useUnstableGlobalHref},get withLayoutContext(){return s.withLayoutContext}});const t=r(d[0]),n=r(d[1]),u=r(d[2]),o=r(d[3]),s=r(d[4]),c=r(d[5]),l=r(d[6]),b=r(d[7]),p=r(d[8]),v=r(d[9]),f=r(d[10]),R=r(d[11]),S=q(r(d[12])),P=r(d[13]),h=r(d[14]),N=r(d[15]),y=r(d[16]),_=r(d[17]),T=r(d[18]),k=r(d[19]),I=r(d[20]),O=r(d[21]),w=r(d[22]),A=r(d[23]),L=r(d[24]),x=r(d[25]),B=r(d[26]),H=r(d[27]),j=r(d[28]),D=r(d[29]),W=r(d[30]),C=r(d[31]),E=r(d[32]),F=r(d[33]),G=r(d[34]),M=r(d[35]),U=r(d[36]);function V(t){if("function"!=typeof WeakMap)return null;var n=new WeakMap,u=new WeakMap;return(V=function(t){return t?u:n})(t)}function q(t,n){if(!n&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var u=V(n);if(u&&u.has(t))return u.get(t);var o={__proto__:null},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var c in t)if("default"!==c&&Object.prototype.hasOwnProperty.call(t,c)){var l=s?Object.getOwnPropertyDescriptor(t,c):null;l&&(l.get||l.set)?Object.defineProperty(o,c,l):o[c]=t[c]}return o.default=t,u&&u.set(t,o),o}},900,[676,401,494,901,694,14,748,739,742,902,646,644,649,515,519,524,463,465,429,430,903,470,471,460,458,506,693,639,707,904,706,340,685,690,360,905,908]);
+__d(function(g,r,i,a,m,e,d){"use strict";function n(){const t=r(d[0]);return n=function(){return t},t}Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"useIsNavigating",{enumerable:!0,get:function(){return u}});const t=r(d[1]);function u(){return(0,n().use)(t.NavigationPendingContext)}},901,[12,357]);
+__d(function(g,r,i,a,m,e,d){"use strict";function t(){const o=r(d[0]);return t=function(){return o},o}function o(){const t=r(d[1]);return o=function(){return t},t}function n(){const t=r(d[2]);return n=function(){return t},t}function l(){const t=r(d[3]);return l=function(){return t},t}Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"ErrorBoundary",{enumerable:!0,get:function(){return f}});r(d[4]);const s=r(d[5]),c=r(d[6]),u=r(d[7]);function h({error:o}){return(0,t().jsxs)(n().View,{style:{marginBottom:12,gap:4,flexWrap:'wrap'},children:[(0,t().jsx)(n().Text,{role:"heading","aria-level":1,style:y.title,children:"Something went wrong"}),(0,t().jsxs)(n().Text,{testID:"router_error_message",role:"heading","aria-level":2,style:y.errorMessage,children:["Error: ",o.message]})]})}function f({error:f,retry:x}){const w=(0,o().use)(s.BottomTabBarHeightContext)?n().View:l().SafeAreaView,S=f instanceof c.ReactServerError;return(0,t().jsx)(n().View,{style:y.container,children:(0,t().jsxs)(w,{style:{flex:1,gap:8,maxWidth:720,marginHorizontal:'auto'},children:[S?(0,t().jsx)(b,{error:f}):(0,t().jsx)(h,{error:f}),(0,t().jsx)(n().View,{style:{flex:1}}),!1,(0,t().jsx)(u.Pressable,{testID:"router_error_retry",onPress:x,children:({hovered:o,pressed:l})=>(0,t().jsx)(n().View,{style:[y.buttonInner,(o||l)&&{backgroundColor:'white'}],children:(0,t().jsx)(n().Text,{style:[y.buttonText,{color:o||l?'black':'white'}],children:"Retry"})})})]})})}const x={404:'NOT_FOUND',500:'INTERNAL_SERVER_ERROR',503:'SERVICE_UNAVAILABLE',504:'GATEWAY_TIMEOUT'};function b({error:o}){let l=String(o.statusCode);l+=': '+(x[o.statusCode]??'Server Error');const s=o.headers.get('cf-ray'),c=o.headers.get('Date');return(0,t().jsxs)(n().View,{style:{padding:12,gap:8},children:[(0,t().jsx)(n().Text,{selectable:!0,allowFontScaling:!0,style:{fontSize:n().Platform.select({web:24,default:16}),fontWeight:'bold',marginBottom:4,color:'white'},children:l}),(0,t().jsx)(n().ScrollView,{style:{borderColor:'rgba(255,255,255,0.5)',borderTopWidth:n().StyleSheet.hairlineWidth,borderBottomWidth:n().StyleSheet.hairlineWidth,maxHeight:150},contentContainerStyle:{paddingVertical:4},children:(0,t().jsx)(n().Text,{testID:"router_error_message",selectable:!0,allowFontScaling:!0,style:{color:'white'},children:o.message})}),(0,t().jsx)(w,{title:"Code",right:o.statusCode}),s&&(0,t().jsx)(w,{title:"ID",right:s}),c&&(0,t().jsx)(w,{title:"Date",right:c}),o.url&&(0,t().jsx)(n().Text,{selectable:!0,allowFontScaling:!0,style:{fontSize:14,opacity:.5,color:'white'},children:o.url})]})}function w({title:o,right:l}){const s={fontSize:16,color:'white'};return(0,t().jsxs)(n().View,{style:{flexDirection:'row',justifyContent:'space-between'},children:[(0,t().jsx)(n().Text,{selectable:!0,allowFontScaling:!0,style:s,children:o}),l&&(0,t().jsx)(n().Text,{selectable:!0,allowFontScaling:!0,style:[s,y.code],children:l})]})}const y=n().StyleSheet.create({container:{flex:1,backgroundColor:'black',padding:24,alignItems:'stretch',justifyContent:'center'},title:{color:'white',fontSize:n().Platform.select({web:32,default:24}),fontWeight:'bold'},buttonText:{fontSize:18,fontWeight:'bold',color:'black',...n().Platform.select({web:{transitionDuration:'100ms'}})},buttonInner:{...n().Platform.select({web:{transitionDuration:'100ms'}}),paddingVertical:12,paddingHorizontal:24,borderColor:'white',borderWidth:2,marginLeft:8,justifyContent:'center',alignItems:'center'},code:{fontFamily:n().Platform.select({default:'Courier',ios:'Courier New',android:'monospace'}),fontWeight:'500'},errorMessage:{color:'white',fontSize:16},subtitle:{color:'white',fontSize:14,marginBottom:12},link:{color:'rgba(255,255,255,0.4)',textDecorationStyle:'solid',textDecorationLine:'underline',fontSize:14,textAlign:'center'}})},902,[6,12,15,271,490,527,648,741]);
+__d(function(g,r,i,a,m,e,d){"use strict";function n(){const t=r(d[0]);return n=function(){return t},t}Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"LocaleProvider",{enumerable:!0,get:function(){return o}});const t=r(d[1]);function o({direction:o,children:c}){return(0,n().jsx)(t.LocaleDirContext.Provider,{value:o,children:c})}},903,[6,411]);
+__d(function(g,r,i,a,m,e,d){"use strict";function t({dispatch:t,isPreloaded:o,isRemovalPrevented:n,state:s}){return{isPreloaded:o,isRemovalPrevented:n,routeNames:s.routeNames,preload:o=>t({type:'PRELOAD',payload:{name:o}})}}Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"createBaseTabProps",{enumerable:!0,get:function(){return t}})},904,[]);
+__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),(function(t,o){for(var n in o)Object.defineProperty(t,n,{enumerable:!0,get:Object.getOwnPropertyDescriptor(o,n).get})})(e,{get BottomTabBar(){return n.BottomTabBar},get BottomTabBarHeightCallbackContext(){return n.BottomTabBarHeightCallbackContext},get BottomTabBarHeightContext(){return n.BottomTabBarHeightContext},get BottomTabView(){return n.BottomTabView},get SceneStyleInterpolators(){return u},get Tabs(){return n.default},get TransitionPresets(){return c},get TransitionSpecs(){return f},get createJSTabsProps(){return n.createJSTabsProps},get createStandardBottomTabNavigator(){return n.createStandardBottomTabNavigator},get default(){return s},get useBottomTabBarHeight(){return n.useBottomTabBarHeight}});const t=r(d[0]),o=r(d[1]),n=b(r(d[2])),u=b(r(d[3])),c=b(r(d[4])),f=b(r(d[5]));function l(t){if("function"!=typeof WeakMap)return null;var o=new WeakMap,n=new WeakMap;return(l=function(t){return t?n:o})(t)}function b(t,o){if(!o&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var n=l(o);if(n&&n.has(t))return n.get(t);var u={__proto__:null},c=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in t)if("default"!==f&&Object.prototype.hasOwnProperty.call(t,f)){var b=c?Object.getOwnPropertyDescriptor(t,f):null;b&&(b.get||b.set)?Object.defineProperty(u,f,b):u[f]=t[f]}return u.default=t,n&&n.set(t,u),u}n.default.Screen=o.Screen,n.default.Protected=t.Protected;const s=n.default},905,[700,701,906,528,529,530]);
+__d(function(g,r,i,a,m,e,d){"use strict";function t(){const n=r(d[0]);return t=function(){return n},n}function n(){const t=r(d[1]);return n=function(){return t},t}Object.defineProperty(e,"__esModule",{value:!0}),(function(t,n){for(var o in n)Object.defineProperty(t,o,{enumerable:!0,get:Object.getOwnPropertyDescriptor(n,o).get})})(e,{get createJSTabsProps(){return h},get default(){return y}});const o=r(d[2]),s=r(d[3]),c=r(d[4]),u=r(d[5]),p=r(d[6]),f=r(d[7]);var l,b;function h(t){const{dispatch:n,state:o}=t;return{...(0,f.createBaseTabProps)(t),popNestedStackToTop:t=>{const s=o.routes.find(n=>n.key===t)?.state;s?.key&&n({...c.StackActions.popToTop(),target:s.key})}}}l=r(d[8]),b=e,Object.keys(l).forEach(function(t){"default"===t||Object.prototype.hasOwnProperty.call(b,t)||Object.defineProperty(b,t,{enumerable:!0,get:function(){return l[t]}})});const y=(0,u.integrateWithRouter)(s.createStandardBottomTabNavigator,c.TabRouter,{activityDefaultThreshold:1,processDescriptors:p.appendMissingPlaceholderTabDescriptors,processState:p.appendMissingPlaceholderTabRoutes,createProps:h,processScreens:s=>s.map(s=>{if('function'!=typeof s.options&&void 0!==s.options?.href){const{href:c,...u}=s.options;if(u.tabBarButton)throw new Error('Cannot use `href` and `tabBarButton` together.');return null===c?{...s,options:{...u,hidden:!0}}:{...s,options:{...u,tabBarButton:s=>{const u='web'===n().Platform.OS?s.children:(0,t().jsx)(n().Pressable,{children:s.children});return(0,t().jsx)(o.Link,{...s,style:[{display:'flex'},s.style],href:c,asChild:'web'!==n().Platform.OS,children:u})}}}}return s})})},906,[6,15,490,634,409,693,907,904,527]);
+__d(function(g,r,i,a,m,e,d){"use strict";function t(t,n,o){const s=n.routeNames.filter(t=>!n.routes.some(n=>n.name===t));if(0===s.length)return t;const u=s.reduce((t,n)=>(t[n]=o({key:void 0,name:n}),t),{});return{...t,...u}}function n(t,n){if(!t.routeNames.some(n=>!t.routes.some(t=>t.name===n)))return t;const s=t.routes[t.index]?.key,u=t.routeNames.map(s=>{const u=t.routes.find(t=>t.name===s);return u||o(s,n)}),c=Math.max(0,u.findIndex(t=>t.key===s));return{...t,index:c,routes:u}}function o(t,n){const o=n[t];if(!o)throw new Error(`Could not find a descriptor for route "${t}". This is most likely a bug in expo-router. Please report it at https://github.com/expo/expo/issues.`);return{...o.route,key:t,name:t}}Object.defineProperty(e,"__esModule",{value:!0}),(function(t,n){for(var o in n)Object.defineProperty(t,o,{enumerable:!0,get:Object.getOwnPropertyDescriptor(n,o).get})})(e,{get appendMissingPlaceholderTabDescriptors(){return t},get appendMissingPlaceholderTabRoutes(){return n}})},907,[]);
+__d(function(g,r,i,a,m,e,d){"use strict";function t(){const n=r(d[0]);return t=function(){return n},n}Object.defineProperty(e,"__esModule",{value:!0}),(function(t,n){for(var u in n)Object.defineProperty(t,u,{enumerable:!0,get:Object.getOwnPropertyDescriptor(n,u).get})})(e,{get ExperimentalStack(){return c},get default(){return o}});const n=u(r(d[1]));function u(t){return t&&t.__esModule?t:{default:t}}const c=Object.assign(u=>(0,t().jsx)(n.default,{...u}),{Screen:n.default.Screen,Protected:n.default.Protected}),o=c},908,[6,909]);
+__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),(function(t,u){for(var n in u)Object.defineProperty(t,n,{enumerable:!0,get:Object.getOwnPropertyDescriptor(u,n).get})})(e,{get Stack(){return t.default},get default(){return l}});const t=c(r(d[0])),u=r(d[1]),n=r(d[2]);function c(t){return t&&t.__esModule?t:{default:t}}t.default.Screen=u.StackScreen,t.default.Header=u.StackHeader,t.default.Title=u.StackTitle,t.default.Toolbar=n.StackToolbar;const l=t.default},909,[677,710,715]);
+__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 t.default}});const t=o((n=r(d[0]),u=e,Object.keys(n).forEach(function(t){"default"===t||Object.prototype.hasOwnProperty.call(u,t)||Object.defineProperty(u,t,{enumerable:!0,get:function(){return n[t]}})}),n));var n,u;function o(t){return t&&t.__esModule?t:{default:t}}},910,[909]);
+__d(function(g,r,i,a,m,e,d){"use strict";var t,n;Object.defineProperty(e,"__esModule",{value:!0}),(function(t,n){for(var o in n)Object.defineProperty(t,o,{enumerable:!0,get:Object.getOwnPropertyDescriptor(n,o).get})})(e,{get useIsPreview(){return s.useIsPreview},get usePreventZoomTransitionDismissal(){return o.usePreventZoomTransitionDismissal}}),t=r(d[0]),n=e,Object.keys(t).forEach(function(o){"default"===o||Object.prototype.hasOwnProperty.call(n,o)||Object.defineProperty(n,o,{enumerable:!0,get:function(){return t[o]}})});const o=r(d[1]),s=r(d[2])},911,[490,912,403]);
+__d(function(g,r,i,a,m,e,d){"use strict";function n(n){}Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"usePreventZoomTransitionDismissal",{enumerable:!0,get:function(){return n}})},912,[]);
+__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"Color",{enumerable:!0,get:function(){return y}});r(d[0]);function t(t,n){return Object.keys(t).forEach(function(u){"default"===u||Object.prototype.hasOwnProperty.call(n,u)||Object.defineProperty(n,u,{enumerable:!0,get:function(){return t[u]}})}),t}t(r(d[1]),e),t(r(d[2]),e),t(r(d[3]),e),t(r(d[4]),e),t(r(d[5]),e);const n=new Proxy({},{get:(t,n)=>null}),u=new Proxy({},{get:(t,n)=>null}),o=new Proxy({},{get:(t,n)=>null}),l=new Proxy({},{get:(t,n)=>null}),c=new Proxy({get attr(){return u},get material(){return o},get dynamic(){return l}},{get:(t,n)=>n in t?t[n]:null}),y={get ios(){return n},get android(){return c}}},913,[914,915,916,917,918,919]);
+__d(function(g,r,i,a,m,e,d){"use strict";function t(t){return null}function n(t){return null}Object.defineProperty(e,"__esModule",{value:!0}),(function(t,n){for(var o in n)Object.defineProperty(t,o,{enumerable:!0,get:Object.getOwnPropertyDescriptor(n,o).get})})(e,{get Material3Color(){return n},get Material3DynamicColor(){return t}})},914,[]);
+__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},915,[]);
+__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},916,[]);
+__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},917,[]);
+__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},918,[]);
+__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},919,[]);
+__d(function(g,_r,i,_a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"localRepositories",{enumerable:!0,get:function(){return s}});var e=_r(d[0]);const a=()=>e.useStore.getState(),t=e=>Promise.resolve(e),s={customers:{update:async e=>a().updateCustomer(e),setAllergy:async(e,t)=>a().setAllergy(e,t)},menu:{updateItem:async(e,t)=>a().updateMenuItem(e,t),setSignOff:async(e,t)=>a().setSignOff(e,t)},orders:{placeFromBasket:e=>t(a().placeOrder(e)),setStatus:async(e,t,s)=>a().setOrderStatus(e,t,s),acknowledgeAllergy:async(e,t)=>a().ackOrderAllergy(e,t),acknowledgeReadiness:async(e,t,s)=>a().ackReadiness(e,t,s),recordHandoverCheck:async(e,t)=>a().handoverCheck(e,t),customerSignal:async(e,t)=>a().customerSignal(e,t),setSplit:async(e,t,s)=>a().setSplit(e,t,s),payTable:async(e,t)=>a().payTable(e,t)},bookings:{create:e=>t(a().createBooking(e)),setStatus:async(e,t)=>a().setBookingStatus(e,t),acknowledgeAllergy:async(e,t)=>a().ackBookingAllergy(e,t)},waitlist:{join:(e,s,n,r)=>t(a().joinWaitlist(e,s,n,r)),setStatus:async(e,t)=>a().setWaitlistStatus(e,t),addWalkIn:async(e,t)=>a().addWalkIn(e,t)},loyalty:{addStamp:async(e,t,s)=>a().addStamp(e,t,s),redeemReward:async(e,t)=>a().redeemReward(e,t)},giftCards:{purchase:(e,s,n,r)=>t(a().buyGiftCard(e,s,n,r))},calendar:{addEvent:async e=>a().addEvent(e)},feedback:{add:async e=>a().addRating(e)},restaurants:{updateSettings:async(e,t)=>a().updateSettings(e,t)},alerts:{acknowledge:async(e,t)=>a().ackAlert(e,t)}}},920,[841]);
+__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"useAsyncStorage",{enumerable:!0,get:function(){return n.useAsyncStorage}}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return o}});var e,t=r(d[0]),u=(e=t)&&e.__esModule?e:{default:e},n=r(d[1]),o=u.default},921,[922,926]);
+__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 i}});var e,t=r(d[0]);const o=((e=t)&&e.__esModule?e:{default:e}).default.bind({concatArrays:!0,ignoreUndefined:!0});function n(e,t){const n=window.localStorage.getItem(e);if(n){const l=JSON.parse(n),c=JSON.parse(t),s=JSON.stringify(o(l,c));window.localStorage.setItem(e,s)}else window.localStorage.setItem(e,t)}function l(e,t){return new Promise((o,n)=>{try{const n=e();t?.(null,n),o(n)}catch(e){t?.(e),n(e)}})}function c(e,t,o){return Promise.all(e).then(e=>{const n=o?.(e)??null;return t?.(null,n),Promise.resolve(n)},e=>(t?.(e),Promise.reject(e)))}const s={getItem:(e,t)=>l(()=>window.localStorage.getItem(e),t),setItem:(e,t,o)=>l(()=>window.localStorage.setItem(e,t),o),removeItem:(e,t)=>l(()=>window.localStorage.removeItem(e),t),mergeItem:(e,t,o)=>l(()=>n(e,t),o),clear:e=>l(()=>window.localStorage.clear(),e),getAllKeys:e=>l(()=>{const e=window.localStorage.length,t=[];for(let o=0;o{},multiGet:(e,t)=>c(e.map(e=>s.getItem(e)),t,t=>t.map((t,o)=>[e[o],t])),multiSet:(e,t)=>c(e.map(e=>s.setItem(e[0],e[1])),t),multiRemove:(e,t)=>c(e.map(e=>s.removeItem(e)),t),multiMerge:(e,t)=>c(e.map(e=>s.mergeItem(e[0],e[1])),t)};var i=s},922,[923]);
+__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 u}});var e,t=r(d[0]),u=((e=t)&&e.__esModule?e:{default:e}).default},923,[924]);
+__d(function(g,r,i,a,m,e,d){'use strict';const t=r(d[0]),{hasOwnProperty:n}=Object.prototype,{propertyIsEnumerable:o}=Object,c=(t,n,o)=>Object.defineProperty(t,n,{value:o,writable:!0,enumerable:!0,configurable:!0}),s=this,f={concatArrays:!1,ignoreUndefined:!1},l=t=>{const c=[];for(const o in t)n.call(t,o)&&c.push(o);if(Object.getOwnPropertySymbols){const n=Object.getOwnPropertySymbols(t);for(const s of n)o.call(t,s)&&c.push(s)}return c};function u(n){return Array.isArray(n)?y(n):t(n)?p(n):n}function y(t){const n=t.slice(0,0);return l(t).forEach(o=>{c(n,o,u(t[o]))}),n}function p(t){const n=null===Object.getPrototypeOf(t)?Object.create(null):{};return l(t).forEach(o=>{c(n,o,u(t[o]))}),n}const b=(t,n,o,s)=>(o.forEach(o=>{void 0===n[o]&&s.ignoreUndefined||(o in t&&t[o]!==Object.getPrototypeOf(t)?c(t,o,h(t[o],n[o],s)):c(t,o,u(n[o])))}),t),O=(t,o,s)=>{let f=t.slice(0,0),y=0;return[t,o].forEach(o=>{const p=[];for(let s=0;s!p.includes(t)),s)}),f};function h(n,o,c){return c.concatArrays&&Array.isArray(n)&&Array.isArray(o)?O(n,o,c):t(o)&&t(n)?b(n,o,l(o),c):u(o)}m.exports=function(...n){const o=h(u(f),this!==s&&this||{},f);let c={_:{}};for(const s of n)if(void 0!==s){if(!t(s))throw new TypeError('`'+s+'` is not an Option Object');c=h(c,{_:s},o)}return c._}},924,[925]);
+__d(function(g,r,i,a,m,e,d){'use strict';m.exports=t=>{if('[object Object]'!==Object.prototype.toString.call(t))return!1;const o=Object.getPrototypeOf(t);return null===o||o===Object.prototype}},925,[]);
+__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.useAsyncStorage=function(e){return{getItem:(...t)=>u.default.getItem(e,...t),setItem:(...t)=>u.default.setItem(e,...t),mergeItem:(...t)=>u.default.mergeItem(e,...t),removeItem:(...t)=>u.default.removeItem(e,...t)}};var e,t=r(d[0]),u=(e=t)&&e.__esModule?e:{default:e}},926,[922]);
+__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0});var t=r(d[0]);Object.keys(t).forEach(function(n){'default'===n||Object.prototype.hasOwnProperty.call(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[n]}})});var n=r(d[1]);Object.keys(n).forEach(function(t){'default'===t||Object.prototype.hasOwnProperty.call(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:function(){return n[t]}})})},927,[928,929]);
+__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"createStore",{enumerable:!0,get:function(){return n}});const t=t=>{let n;const c=new Set,o=(t,o)=>{const s="function"==typeof t?t(n):t;if(!Object.is(s,n)){const t=n;n=(null!=o?o:"object"!=typeof s||null===s)?s:Object.assign({},n,s),c.forEach(c=>c(n,t))}},s=()=>n,u={setState:o,getState:s,getInitialState:()=>l,subscribe:t=>(c.add(t),()=>c.delete(t))},l=n=t(o,s,u);return u},n=n=>n?t(n):t},928,[]);
+__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"create",{enumerable:!0,get:function(){return l}}),Object.defineProperty(_e,"useStore",{enumerable:!0,get:function(){return o}});var e,t=r(d[0]),n=(e=t)&&e.__esModule?e:{default:e},u=r(d[1]);const c=e=>e;function o(e,t=c){const u=n.default.useSyncExternalStore(e.subscribe,n.default.useCallback(()=>t(e.getState()),[e,t]),()=>t(e.getInitialState()));return n.default.useDebugValue(u),u}const s=e=>{const t=(0,u.createStore)(e),n=e=>o(t,e);return Object.assign(n,t),n},l=e=>e?s(e):s},929,[12,928]);
+__d(function(g,_r,i,_a3,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"combine",{enumerable:!0,get:function(){return f}}),Object.defineProperty(_e,"createJSONStorage",{enumerable:!0,get:function(){return y}}),Object.defineProperty(_e,"devtools",{enumerable:!0,get:function(){return u}}),Object.defineProperty(_e,"persist",{enumerable:!0,get:function(){return b}}),Object.defineProperty(_e,"redux",{enumerable:!0,get:function(){return e}}),Object.defineProperty(_e,"subscribeWithSelector",{enumerable:!0,get:function(){return p}}),Object.defineProperty(_e,"unstable_ssrSafe",{enumerable:!0,get:function(){return S}});const e=(e,t)=>(n,r,o)=>(o.dispatch=t=>(n(n=>e(n,t),!1,t),t),o.dispatchFromDevtools=!0,{dispatch:(...e)=>o.dispatch(...e),...t}),t=e=>!!e.dispatchFromDevtools&&"function"==typeof e.dispatch,n=new Map,r=e=>{const t=n.get(e);return t?Object.fromEntries(Object.entries(t.stores).map(([e,t])=>[e,t.getState()])):{}},o=(e,t,r)=>{if(void 0===e)return{type:"untracked",connection:t.connect(r)};const o=n.get(r.name);if(o)return{type:"tracked",store:e,...o};const s={connection:t.connect(r),stores:{}};return n.set(r.name,s),{type:"tracked",store:e,...s}},s=(e,t,r)=>{if(void 0===t)return;const o=n.get(e);(null==o?void 0:o.stores[t])===r&&(delete o.stores[t],0===Object.keys(o.stores).length&&n.delete(e))},a=/^at (?:new |async )?(.+?) \(/,l=/^([^@]+)@/;function c(e){var t,n,r;if(!e)return;const o=e.split("\n"),s=o.findIndex(e=>e.includes("api.setState"));if(s<0)return;const c=(null==(t=o[s+1])?void 0:t.trim())||"";return(null==(n=a.exec(c))?void 0:n[1])||(null==(r=l.exec(c))?void 0:r[1])}const u=(e,a={})=>(l,u,p)=>{const{enabled:f,anonymousActionType:y,store:h,...b}=a;let S;try{S=(null!=f?f:"production"!==(globalThis.__ExpoImportMetaRegistry.env?globalThis.__ExpoImportMetaRegistry.env.MODE:void 0))&&window.__REDUX_DEVTOOLS_EXTENSION__}catch(e){}if(!S)return e(l,u,p);const{connection:O,..._}=o(h,S,b);let w,E=!0;p.setState=(e,t,n)=>{const o=l(e,t);if(!E)return o;const s=void 0===n?{type:y||c((new Error).stack)||"anonymous"}:"string"==typeof n?{type:n}:n;return void 0===h?(null==O||O.send(s,u()),o):(null==O||O.send({...s,type:`${h}/${s.type}`},{...r(b.name),[h]:p.getState()}),o)},p.devtools={cleanup:()=>{null==w||w(),w=void 0,s(b.name,h,p),void 0!==h&&n.has(b.name)||!O||"function"!=typeof O.unsubscribe||O.unsubscribe()}};const I=(...e)=>{const t=E;E=!1,l(...e),E=t},j=e(p.setState,u,p);if("untracked"===_.type?null==O||O.init(j):(_.stores[_.store]=p,null==O||O.init(Object.fromEntries(Object.entries(_.stores).map(([e,t])=>[e,e===_.store?j:t.getState()])))),t(p)){let e=!1;const t=p.dispatch;p.dispatch=(...n)=>{"production"===(globalThis.__ExpoImportMetaRegistry.env?globalThis.__ExpoImportMetaRegistry.env.MODE:void 0)||"__setState"!==n[0].type||e||(console.warn('[zustand devtools middleware] "__setState" action type is reserved to set state from the devtools. Avoid using it.'),e=!0),t(...n)}}return w=O.subscribe(e=>{var n;const o="object"==typeof b.serialize?b.serialize.reviver:void 0;switch(e.type){case"ACTION":return"string"!=typeof e.payload?void console.error("[zustand devtools middleware] Unsupported action format"):v(e.payload,o,e=>{if("__setState"===e.type){if(void 0===h)return void I(e.state);1!==Object.keys(e.state).length&&console.error("\n [zustand devtools middleware] Unsupported __setState action format.\n When using 'store' option in devtools(), the 'state' should have only one key, which is a value of 'store' that was passed in devtools(),\n and value of this only key should be a state object. Example: { \"type\": \"__setState\", \"state\": { \"abc123Store\": { \"foo\": \"bar\" } } }\n ");const t=e.state[h];if(null==t)return;return void(JSON.stringify(p.getState())!==JSON.stringify(t)&&I(t))}t(p)&&p.dispatch(e)});case"DISPATCH":switch(e.payload.type){case"RESET":return I(j),void 0===h?null==O?void 0:O.init(p.getState()):null==O?void 0:O.init(r(b.name));case"COMMIT":return void 0===h?void(null==O||O.init(p.getState())):null==O?void 0:O.init(r(b.name));case"ROLLBACK":return v(e.state,o,e=>{if(void 0===h)return I(e),void(null==O||O.init(p.getState()));I(e[h]),null==O||O.init(r(b.name))});case"JUMP_TO_STATE":case"JUMP_TO_ACTION":return v(e.state,o,e=>{void 0!==h?JSON.stringify(p.getState())!==JSON.stringify(e[h])&&I(e[h]):I(e)});case"IMPORT_STATE":{const{nextLiftedState:t}=e.payload,r=null==(n=t.computedStates.slice(-1)[0])?void 0:n.state;if(!r)return;return I(void 0===h?r:r[h]),void(null==O||O.send(null,t))}case"PAUSE_RECORDING":return E=!E}return}}),j},v=(e,t,n)=>{let r;try{r=JSON.parse(e,t)}catch(e){console.error("[zustand devtools middleware] Could not parse the received json",e)}void 0!==r&&n(r)},p=e=>(t,n,r)=>{const o=r.subscribe;r.subscribe=(e,t,n)=>{let s=e;if(t){const o=(null==n?void 0:n.equalityFn)||Object.is;let a=e(r.getState());s=n=>{const r=e(n);if(!o(a,r)){const e=a;t(a=r,e)}},(null==n?void 0:n.fireImmediately)&&t(a,a)}return o(s)};return e(t,n,r)};function f(e,t){return(...n)=>Object.assign({},e,t(...n))}function y(e,t){let n;try{n=e()}catch(e){return}return{getItem:e=>{var r;const o=e=>null===e?null:JSON.parse(e,null==t?void 0:t.reviver),s=null!=(r=n.getItem(e))?r:null;return s instanceof Promise?s.then(o):o(s)},setItem:(e,r)=>n.setItem(e,JSON.stringify(r,null==t?void 0:t.replacer)),removeItem:e=>n.removeItem(e)}}const h=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then:e=>h(e)(n),catch(e){return this}}}catch(e){return{then(e){return this},catch:t=>h(t)(e)}}},b=(e,t)=>(n,r,o)=>{let s={storage:y(()=>window.localStorage),partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...t},a=!1,l=0;const c=new Set,u=new Set;let v=s.storage;if(!v)return e((...e)=>{console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`),n(...e)},r,o);const p=()=>{const e=s.partialize({...r()});return v.setItem(s.name,{state:e,version:s.version})},f=o.setState;o.setState=(...e)=>(f(...e),p());const b=e((...e)=>(n(...e),p()),r,o);let S;o.getInitialState=()=>b;const O=()=>{var e,t;if(!v)return;const o=++l;a=!1,c.forEach(e=>{var t;return e(null!=(t=r())?t:b)});const f=(null==(t=s.onRehydrateStorage)?void 0:t.call(s,null!=(e=r())?e:b))||void 0;return h(v.getItem.bind(v))(s.name).then(e=>{if(e){if("number"!=typeof e.version||e.version===s.version)return[!1,e.state];if(s.migrate){const t=s.migrate(e.state,e.version);return t instanceof Promise?t.then(e=>[!0,e]):[!0,t]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}return[!1,void 0]}).then(e=>{var t;if(o!==l)return;const[a,c]=e;return S=s.merge(c,null!=(t=r())?t:b),n(S,!0),a?p():void 0}).then(()=>{o===l&&(null==f||f(r(),void 0),S=r(),a=!0,u.forEach(e=>e(S)))}).catch(e=>{o===l&&(null==f||f(void 0,e))})};return o.persist={setOptions:e=>{s={...s,...e},e.storage&&(v=e.storage)},clearStorage:()=>{++l,null==v||v.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>O(),hasHydrated:()=>a,onHydrate:e=>(c.add(e),()=>{c.delete(e)}),onFinishHydration:e=>(u.add(e),()=>{u.delete(e)})},s.skipHydration||O(),S||b};function S(e,t="undefined"==typeof window){return(n,r,o)=>{if(!t)return e(n,r,o);const s=()=>{throw new Error("Cannot set state of Zustand store in SSR")};return o.setState=s,e(s,r,o)}}},930,[]);
+__d(function(g,_r,_i,a,m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"DEMO_CUSTOMER_ID",{enumerable:!0,get:function(){return s}}),e.defaultSimStart=function(t=new Date){const r=new Date(t),n=(5-r.getDay()+7)%7;return r.setDate(r.getDate()+n),r.setHours(17,30,0,0),r},e.buildSeed=function(o){const d=(0,i.ymd)(o),l=t=>t.toISOString(),c=n.restaurants.map(r=>'anchorage'===r.id?{...r,sections:t.ANCHORAGE_SECTIONS}:r),u={id:s,name:'Alex Morgan',email:'alex.demo@example.com',phone:'07700 900123',allergies:[{allergen:'crustaceans',severity:'anaphylaxis'},{allergen:'mustard',severity:'allergy'}],allergyConsent:!0,referralCode:'ALEX-7K2Q',marketingOptIn:{anchorage:!0}},p=(t,r,n,s,c={})=>({id:t,ref:`BK-${t.slice(-3).toUpperCase()}`,restaurantId:'anchorage',customerId:null,name:r,partySize:n,date:d,time:s,allergies:[],notes:'',status:'confirmed',security:n>=6?'saved-card':'none',depositPaid:0,createdAt:l((0,i.addMins)(o,-4320)),...c}),h=[p('bk-101','Campbell',2,'17:00',{table:'4',status:'seated'}),p('bk-102','Fraser',4,'17:30',{table:'7'}),p('bk-103','McLeod',2,'18:00',{table:'2',allergies:[{allergen:'gluten',severity:'coeliac'}],notes:'Anniversary'}),p('bk-104','Kerr',6,'18:00',{table:'10'}),p('bk-105','Wallace',3,'18:30',{table:'5'}),p('bk-106','Boyd',8,'19:00',{table:'11+12',allergies:[{allergen:'peanuts',severity:'anaphylaxis'}],notes:'Birthday \u2014 dog in party'}),p('bk-107','Hamilton',2,'19:00',{table:'3'}),p('bk-108','Stewart',4,'19:30',{table:'8'}),p('bk-109','Murray',2,'20:00',{table:'1'})],y=[{id:'wl-1',restaurantId:'anchorage',number:1,name:'Paterson',partySize:2,joinedAt:l((0,i.addMins)(o,-12)),status:'waiting'},{id:'wl-2',restaurantId:'anchorage',number:2,name:'Duncan',partySize:4,joinedAt:l((0,i.addMins)(o,-4)),status:'waiting'}],b=(0,i.atTime)(o,'17:45'),I=[{id:'ord-seed-1',ref:'T-1041',restaurantId:'anchorage',customerId:'cust-other',customerName:'R. Gilmour',type:'takeaway',slotTime:l(b),lines:[{itemId:'a-fishsupper',name:'Fish Supper',qty:2,unitPrice:1800,choices:['Beer-battered'],notes:'',contains:[],may:[],overridden:!1,prepMins:12},{itemId:'a-chips',name:'Triple-Cooked Chips (V)',qty:1,unitPrice:450,choices:[],notes:'Extra salt',contains:[],may:[],overridden:!1,prepMins:6}],subtotal:4050,tip:0,giftCardApplied:0,total:4050,paid:4050,status:'acknowledged',createdAt:l((0,i.addMins)(o,-50)),allergies:[],readiness:{}},{id:'ord-seed-2',ref:'Q-2017',restaurantId:'anchorage',customerId:'cust-other2',customerName:'Table 3 guest',type:'table',tableNo:'3',lines:[{itemId:'a-moules',name:'Moules Marini\xe8re',qty:1,unitPrice:2200,choices:['Main 500g with triple-cooked chips (\xa322.00)'],notes:'',contains:[],may:[],overridden:!1,prepMins:10},{itemId:'a-claymore',name:'The Claymore Burger',qty:1,unitPrice:1800,choices:[],notes:'No gherkins',contains:[],may:[],overridden:!1,prepMins:14}],subtotal:4e3,tip:0,giftCardApplied:0,total:4e3,paid:0,status:'preparing',createdAt:l((0,i.addMins)(o,-18)),allergies:[],readiness:{}}],k=[{restaurantId:'anchorage',customerId:s,stamps:5,rewardsAvailable:0,history:[{at:'2026-08-15',source:'Dine-in (staff scan)'},{at:'2026-08-29',source:'Takeaway'},{at:'2026-09-12',source:'Table QR bill'},{at:'2026-10-02',source:'Takeaway'},{at:'2026-10-16',source:'Referral \u2014 friend\u2019s first visit'}]},{restaurantId:'saltmarsh',customerId:s,stamps:2,rewardsAvailable:0,history:[{at:'2026-09-01',source:'Dine-in'},{at:'2026-10-01',source:'Dine-in'}]}],v=[{id:'gc-1',code:'ANC-G7QX-4M2P-9TRE',restaurantId:'anchorage',initial:5e3,balance:2500,ownerId:s,recipientName:'Alex',message:'Happy birthday! (example)',createdAt:'2026-09-20'},{id:'gc-2',code:'WIX-OLD-10-EXAMPLE',restaurantId:'anchorage',initial:1e3,balance:1e3,ownerId:'legacy',recipientName:'Legacy Wix voucher (example)',message:'',createdAt:'2026-06-01',legacy:!0}],x=[...r.SCOTTISH_BANK_HOLIDAYS.map((t,n)=>({id:`bh-${n}`,restaurantId:null,date:t.date,title:t.title+(t.notes?` (${t.notes.toLowerCase()})`:''),kind:'bank-holiday',description:'Scottish bank holiday',example:!1,source:r.BANK_HOLIDAY_SOURCE})),{id:'ev-halloween',restaurantId:'anchorage',date:(0,i.ymd)(new Date(o.getFullYear(),9,31)),title:'Halloween weekend (example)',kind:'event',description:'Example event \u2014 busy weekend flag for the forecast.',example:!0},{id:'ev-xmas-party',restaurantId:'anchorage',date:'2026-12-04',title:'Christmas party nights begin (example)',kind:'event',description:'Example: festive set menu, deposit required for parties of 8+.',example:!0},{id:'ev-hogmanay',restaurantId:null,date:'2026-12-31',title:'Hogmanay',kind:'occasion',description:'Key dining date.',example:!1},{id:'ev-burns',restaurantId:'anchorage',date:'2027-01-25',title:'Burns Night Supper (example)',kind:'event',description:'EXAMPLE event: haggis, neeps & tatties, address to the haggis, set menu \xa348pp. Booking opens via the app.',example:!0},{id:'ev-valentines',restaurantId:null,date:'2027-02-14',title:"Valentine's Day",kind:'occasion',description:'Key dining date.',example:!1},{id:'ev-mothering',restaurantId:null,date:'2027-03-07',title:'Mothering Sunday (UK)',kind:'occasion',description:'Key dining date.',example:!1},{id:'ev-live',restaurantId:'anchorage',date:'2026-11-14',title:'Live acoustic music (example)',kind:'event',description:'EXAMPLE: local folk duo from 7pm.',example:!0},{id:'ev-school-xmas',restaurantId:null,date:'2026-12-23',title:'South Ayrshire schools close for Christmas',kind:'school-holiday',description:'23 Dec 2026 \u2013 4 Jan 2027',example:!1},{id:'ev-salt-quiz',restaurantId:'saltmarsh',date:'2026-11-05',title:'Quiz night (fictional)',kind:'event',description:'Fictional demo restaurant event.',example:!0}];return{restaurants:c,menu:[...t.anchorageMenu,...n.demoMenus],customer:u,bookings:h,waitlist:y,orders:I,stampCards:k,giftCards:v,events:x,ratings:[{id:'rt-1',restaurantId:'anchorage',customerId:'cust-x1',customerName:'Fiona (example)',stars:5,comment:'Best fish supper on the coast, and the staff were brilliant with my son\u2019s nut allergy.',createdAt:l((0,i.addMins)(o,-1560)),context:'Takeaway T-1032'},{id:'rt-2',restaurantId:'anchorage',customerId:'cust-x2',customerName:'Iain (example)',stars:4,comment:'Lovely langoustines. Bit of a wait for a table at 7.',createdAt:l((0,i.addMins)(o,-3e3)),context:'Dine-in, Table 6'},{id:'rt-3',restaurantId:'anchorage',customerId:'cust-x3',customerName:'Morag (example)',stars:2,comment:'Chips were cold by the time we collected.',createdAt:l((0,i.addMins)(o,-4320)),context:'Takeaway T-1019'}],audit:[],alertAcks:{},walkIns:{anchorage:6},basket:{restaurantId:null,mode:'takeaway',lines:[]},counters:{order:1042,table:2018,booking:110}}};var t=_r(_d[0]),r=_r(_d[1]),n=_r(_d[2]),i=_r(_d[3]);const s='cust-demo'},931,[932,933,934,795]);
+__d(function(g,r,_i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"ANCHORAGE_SECTIONS",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"anchorageMenu",{enumerable:!0,get:function(){return l}});const i={by:'Example sign-off (demo)',at:'2026-10-26'},s=i=>({id:i,name:'Served with',required:!0,multi:!1,choices:[{id:`${i}-custard`,label:'Custard',priceDelta:0,allergens:{milk:'contains',eggs:'contains'}},{id:`${i}-icecream`,label:'Ice cream',priceDelta:0,allergens:{milk:'contains'}},{id:`${i}-cream`,label:'Cream',priceDelta:0,allergens:{milk:'contains'}},{id:`${i}-vegan`,label:'Vegan ice cream (ask server)',priceDelta:0,allergens:{soya:'may'}}]}),n=(i,s,n)=>({id:i,name:'Portion',required:!0,multi:!1,choices:[{id:`${i}-starter`,label:'Starter',priceDelta:0},{id:`${i}-main`,label:n,priceDelta:s}]}),t=[{id:'a-soup',section:'Starters',name:"Chef's Soup of the Day",description:'A heartwarming bowl of seasonal homemade soup, served with warm crusty bread and butter.',price:600,dietary:[],allergens:{gluten:'contains',milk:'contains',celery:'contains'},allergenNotes:'Recipe changes daily \u2014 check the day\u2019s soup.',prepMins:5},{id:'a-skink',section:'Starters',name:'Cullen Skink',description:'Traditional creamy soup made with locally smoked haddock, potatoes and leeks, served with warm crusty bread and butter.',price:900,dietary:[],allergens:{fish:'contains',milk:'contains',gluten:'contains',celery:'may'},prepMins:6},{id:'a-salmon',section:'Starters',name:'Scottish Smoked Salmon Roulade',description:'Delicate Scottish smoked salmon rolled with herb-infused cream cheese, served with garlic & herb crostini and dressed salad.',price:900,dietary:[],allergens:{fish:'contains',milk:'contains',gluten:'contains',mustard:'may',sulphites:'may'},prepMins:5},{id:'a-haggis',section:'Starters',name:'Haggis Bon Bons',description:'Crisp golden panko-fried haggis balls, finished with a velvety Scotch whisky sauce and caramelised apple gel.',price:800,dietary:[],allergens:{gluten:'contains',eggs:'contains',milk:'contains',celery:'contains',mustard:'may',sulphites:'may'},allergenNotes:'Shared fryer (example).',prepMins:8},{id:'a-crabcakes',section:'Starters',name:'Spiced Crab Cakes',description:'Golden crab cakes, delicately seasoned with herbs and spices, served with crisp seasonal salad and house-made Marie Rose sauce.',price:900,dietary:[],allergens:{crustaceans:'contains',gluten:'contains',eggs:'contains',mustard:'contains',fish:'may'},allergenNotes:'Shared fryer (example).',prepMins:8},{id:'a-tempura',section:'Starters',name:'Deluxe Mixed Tempura',description:"King prawns, chicken and lion's mane mushrooms in a light, crispy tempura batter, served with a dressed seasonal salad and house dipping sauce.",price:1e3,dietary:[],allergens:{crustaceans:'contains',gluten:'contains',soya:'contains',sesame:'may',eggs:'may'},allergenNotes:'Shared fryer (example).',prepMins:9,optionGroups:[n('tempura',900,'Main with triple-cooked chips (\xa319.00)')]},{id:'a-kingoyster',section:'Starters',name:"Pan-Seared King Oyster Mushroom 'Scallops' (VG)",description:"King oyster mushroom 'scallops' prepared with the chef's special recipe of the day. Ask your server or see our specials board for today's garnish and accompaniments.",price:1e3,dietary:['VG'],allergens:{soya:'may',sulphites:'may'},allergenNotes:'Garnish changes daily \u2014 sign-off needed for each version.',prepMins:10,special:!0,unsigned:!0,optionGroups:[n('kingoyster',800,'Main (\xa318.00)')]},{id:'a-fishsupper',section:'Mains',name:'Fish Supper',description:'Locally landed haddock, available beer-battered or breaded, served with buttered peas, triple-cooked chips and homemade tartare sauce.',price:1800,dietary:['GF option'],allergens:{fish:'contains',gluten:'contains',eggs:'contains',milk:'contains',mustard:'may',crustaceans:'may'},allergenNotes:'Shared fryer with seafood (example).',prepMins:12,optionGroups:[{id:'fs-coat',name:'Coating',required:!0,multi:!1,choices:[{id:'fs-batter',label:'Beer-battered',priceDelta:0},{id:'fs-bread',label:'Breaded',priceDelta:0}]}]},{id:'a-lionsmane',section:'Mains',name:"Southern Fried Lion's Mane Burger (VG)",description:"Crispy southern fried lion's mane mushroom, layered with vegan cheese and garlic aioli, served with triple-cooked chips and golden onion rings.",price:1800,dietary:['VG'],allergens:{gluten:'contains',soya:'contains',mustard:'may',sesame:'may'},prepMins:12},{id:'a-pie',section:'Mains',name:'Steak & Ale Pie',description:'Slow-braised beef in a rich ale jus beneath golden all-butter puff pastry, served with buttered seasonal vegetables.',price:1800,dietary:[],allergens:{gluten:'contains',milk:'contains',eggs:'contains',celery:'contains',sulphites:'contains'},prepMins:10,optionGroups:[{id:'pie-side',name:'Served with',required:!0,multi:!1,choices:[{id:'chips',label:'Triple-cooked chips',priceDelta:0},{id:'creamed',label:'Creamed potatoes',priceDelta:0,allergens:{milk:'contains'}}]}]},{id:'a-bananablossom',section:'Mains',name:"Beer-Battered Banana Blossom 'Fish' Goujons (VG)",description:'Crisp beer-battered banana blossom goujons, dusted with locally foraged truffle seaweed seasoning, served with triple-cooked chips, garden peas and vegan tartare sauce.',price:1700,dietary:['VG'],allergens:{gluten:'contains',soya:'may',mustard:'may',fish:'may'},allergenNotes:'Shared fryer with fish (example).',prepMins:11},{id:'a-chicken',section:'Mains',name:'Roasted Breast of Chicken',description:'Golden pan-roasted chicken breast, served with creamed potatoes, buttered seasonal greens, and a fragrant lemon & thyme bouillon.',price:1900,dietary:[],allergens:{milk:'contains',celery:'contains',sulphites:'may'},prepMins:16},{id:'a-maccheese',section:'Mains',name:'Macaroni Cheese (V)',description:'Rich mature Cheddar macaroni finished with a golden cheese glaze, served with two slices of garlic bread.',price:1700,dietary:['V'],allergens:{gluten:'contains',milk:'contains',mustard:'contains',eggs:'may'},prepMins:10},{id:'a-penne',section:'Mains',name:'Cajun Chicken & Chorizo Penne Pasta',description:'Tender Cajun-spiced chicken strips, mixed peppers, red onion and smoky chorizo, tossed in a bold, creamy Cajun sauce, served with two slices of garlic bread.',price:1700,dietary:[],allergens:{gluten:'contains',milk:'contains',celery:'may',sulphites:'may'},prepMins:11},{id:'a-caesar',section:'Mains',name:'Chicken Caesar Salad',description:'Tender pan-roasted chicken breast served on a bed of baby gem lettuce with golden garlic croutons, Parmesan and a classic Caesar dressing.',price:1800,dietary:[],allergens:{gluten:'contains',milk:'contains',eggs:'contains',fish:'contains',mustard:'contains'},allergenNotes:'Caesar dressing contains anchovy (example).',prepMins:12,optionGroups:[{id:'caesar-add',name:'Optional extras',required:!1,multi:!0,choices:[{id:'caesar-bacon',label:'Add smoked Ayrshire bacon',priceDelta:150}]}]},{id:'a-moules',section:'Mains',name:'Moules Marini\xe8re',description:'Fresh Scottish mussels, steamed to perfection in a rich, creamy white wine and garlic sauce.',price:1200,dietary:[],allergens:{molluscs:'contains',milk:'contains',sulphites:'contains',celery:'may'},prepMins:10,optionGroups:[n('moules',1e3,'Main 500g with triple-cooked chips (\xa322.00)')]},{id:'a-fillet',section:'From the Grill',name:'8oz Fillet Steak',description:'Prime 8oz fillet steak served with truffled woodland mushrooms, seasonal greens, golden onion rings and triple-cooked chips.',price:3800,dietary:[],allergens:{gluten:'contains',milk:'may',sulphites:'may'},prepMins:18,optionGroups:[{id:'steak-sauce',name:'Sauce',required:!1,multi:!1,choices:[{id:'sauce-pepper',label:'Peppercorn sauce',priceDelta:0,allergens:{milk:'contains',sulphites:'contains'}},{id:'sauce-garlic',label:'Garlic butter',priceDelta:0,allergens:{milk:'contains'}}]},{id:'steak-surf',name:'Surf & turf add-on',required:!1,multi:!1,choices:[{id:'surf-prawns',label:'Garlic prawns',priceDelta:800,allergens:{crustaceans:'contains',milk:'contains'}},{id:'surf-scallops',label:'Scottish West Coast scallops',priceDelta:1e3,allergens:{molluscs:'contains',milk:'contains'}}]}]},{id:'a-claymore',section:'From the Grill',name:'The Claymore Burger',description:'One juicy 6oz homemade Scottish beef burger in a brioche bun with baby gem lettuce, tomato and gherkins, topped with cheese, smoked Ayrshire bacon and onion rings. Served with triple-cooked chips.',price:1800,dietary:[],allergens:{gluten:'contains',milk:'contains',eggs:'contains',sesame:'may',mustard:'may',sulphites:'may'},prepMins:14,optionGroups:[{id:'claymore-add',name:'Optional extras',required:!1,multi:!0,choices:[{id:'claymore-haggis',label:'Add haggis and whisky sauce',priceDelta:150,allergens:{celery:'contains',gluten:'contains'}}]}]},{id:'a-langoustines',section:"Captain's Table",name:'Whole Scottish Grilled Langoustines',description:'Locally caught whole Scottish langoustines grilled in garlic butter, served with a vibrant side salad and burnt lemon.',price:1700,dietary:[],allergens:{crustaceans:'contains',milk:'contains'},prepMins:12,optionGroups:[n('lang',1200,'Main 500g with triple-cooked chips (\xa329.00)')]},{id:'a-scallops',section:"Captain's Table",name:'Pan-Seared West Coast Scallops',description:"Scottish West Coast scallops prepared to the chef's recipe of the day. Starter and main portions \u2014 see price on Specials Board.",price:null,priceNote:'See specials board',dietary:[],allergens:{molluscs:'contains',milk:'may'},prepMins:10,special:!0,unsigned:!0},{id:'a-lobster',section:"Captain's Table",name:'Grilled Dunure Lobster',description:'Fresh Dunure lobster, caught locally by "Kitty Fisher", finished in rich garlic butter and served with a vibrant side salad, triple-cooked chips and burnt lemon. When available.',price:3500,dietary:[],allergens:{crustaceans:'contains',milk:'contains'},prepMins:20,optionGroups:[{id:'lobster-size',name:'Size',required:!0,multi:!1,choices:[{id:'lob-half',label:'Half',priceDelta:0},{id:'lob-whole',label:'Whole (\xa365.00)',priceDelta:3e3}]}]},{id:'a-crab',section:"Captain's Table",name:'Grilled Dunure Crab',description:'Freshly landed Dunure brown crab, caught locally by "Kitty Fisher", finished in rich garlic butter and served with a vibrant side salad, triple-cooked chips and burnt lemon. When available.',price:4e3,dietary:[],allergens:{crustaceans:'contains',milk:'contains'},prepMins:20,soldOut:!0},{id:'a-smorgasbord',section:'Platters',name:'Seafood Smorgasbord (serves one)',description:"250g langoustines, 3 pan-seared West Coast scallops, 250g fresh mussels, 6 garlic prawns and a roll of Scottish smoked salmon, with dressed side salad and warm crusty bread.",price:5e3,dietary:[],allergens:{crustaceans:'contains',molluscs:'contains',fish:'contains',milk:'contains',gluten:'contains',sulphites:'contains'},prepMins:22},{id:'a-deluxe',section:'Platters',name:'Deluxe Seafood Platter (serves two)',description:'One whole Dunure lobster, one whole Dunure crab, 500g whole langoustines, 500g moules marini\xe8re, pan-seared scallops, Scottish smoked salmon and 6 garlic prawns, with two portions of chips, side salad and warm crusty bread.',price:16500,dietary:[],allergens:{crustaceans:'contains',molluscs:'contains',fish:'contains',milk:'contains',gluten:'contains',sulphites:'contains'},prepMins:30},{id:'a-onionrings',section:'Sides',name:'House Beer-Battered Onion Rings (V)',description:'Crisp house beer-battered onion rings, served golden and crunchy.',price:450,dietary:['V'],allergens:{gluten:'contains',fish:'may',crustaceans:'may'},allergenNotes:'Shared fryer (example).',prepMins:6},{id:'a-garlicbread',section:'Sides',name:'Garlic Bread (V)',description:'Warm toasted garlic bread, finished with garlic & parsley butter.',price:450,dietary:['V'],allergens:{gluten:'contains',milk:'contains'},prepMins:5,optionGroups:[{id:'gb-add',name:'Optional extras',required:!1,multi:!0,choices:[{id:'gb-cheese',label:'Add cheese',priceDelta:100}]}]},{id:'a-chips',section:'Sides',name:'Triple-Cooked Chips (V)',description:'Golden triple-cooked chips, lightly tossed in Maldon sea salt.',price:450,dietary:['V'],allergens:{gluten:'may',fish:'may',crustaceans:'may'},allergenNotes:'Shared fryer (example).',prepMins:6,optionGroups:[{id:'chips-add',name:'Optional extras',required:!1,multi:!0,choices:[{id:'chips-cajun',label:'Add Cajun seasoning',priceDelta:0,allergens:{celery:'may',mustard:'may'}}]}]},{id:'a-truffle',section:'Sides',name:'Parmesan & Truffle Fries (V)',description:'Crispy fries topped with finely grated parmesan and tossed in a winter truffle infused oil.',price:500,dietary:['V'],allergens:{milk:'contains',gluten:'may',fish:'may',crustaceans:'may'},allergenNotes:'Shared fryer (example).',prepMins:6},{id:'a-salad',section:'Sides',name:'Side Salad (VG)',description:'Seasonal mixed leaves with cucumber, red onion and mixed peppers, finished with a light vinaigrette.',price:450,dietary:['VG'],allergens:{mustard:'contains',sulphites:'contains'},prepMins:3},{id:'a-brulee',section:'Desserts',name:"Chef's Cr\xe8me Br\xfbl\xe9e of the Day (V)",description:"Smooth Madagascan custard with a delicately caramelised sugar crust. Ask your server or see our specials board for today's flavour.",price:800,dietary:['V'],allergens:{milk:'contains',eggs:'contains',treenuts:'may'},prepMins:4},{id:'a-crumble',section:'Desserts',name:'Seasonal Fruit Crumble (V)',description:'Slow-cooked seasonal fruit topped with a golden buttery crumble.',price:800,dietary:['V'],allergens:{gluten:'contains',milk:'contains',treenuts:'may'},prepMins:6,optionGroups:[s('crumble')]},{id:'a-stp',section:'Desserts',name:'Sticky Toffee Pudding (V)',description:'A rich, homemade steamed date pudding, drenched in our signature homemade butterscotch sauce.',price:800,dietary:['V'],allergens:{gluten:'contains',milk:'contains',eggs:'contains',sulphites:'may'},prepMins:5,optionGroups:[s('stp')]},{id:'a-cheesecake',section:'Desserts',name:'Cheesecake of the Day (V)',description:'A smooth, creamy cheesecake on a buttery biscuit base. Gluten-free and vegan options available.',price:800,dietary:['V'],allergens:{gluten:'contains',milk:'contains',eggs:'may',treenuts:'may'},prepMins:3,optionGroups:[s('cheesecake')]},{id:'a-affogato',section:'Desserts',name:'Affogato (V)',description:'Two scoops of creamy vanilla ice cream with a freshly brewed shot of Italian espresso poured over. Vegan options available.',price:800,dietary:['V'],allergens:{milk:'contains',eggs:'may'},prepMins:3},{id:'a-mini',section:'Mini Anchors (under 12s)',name:'Mini Anchors meal',description:'Under 12s only. Served with peas or beans. Includes a diluting juice drink & 2 scoops of ice cream. GF options available.',price:900,dietary:['GF option'],allergens:{gluten:'contains',milk:'contains'},prepMins:10,optionGroups:[{id:'mini-main',name:'Choose a meal',required:!0,multi:!1,choices:[{id:'mini-burger',label:'Cheeseburger & chips',priceDelta:0,allergens:{sesame:'may',eggs:'may'}},{id:'mini-fish',label:'Fish goujons & chips',priceDelta:0,allergens:{fish:'contains',eggs:'may'}},{id:'mini-mac',label:"Mac 'n' cheese & chips (V)",priceDelta:0,allergens:{mustard:'may'}},{id:'mini-chicken',label:'Chicken goujons & chips',priceDelta:0,allergens:{eggs:'may'}}]},{id:'mini-veg',name:'With',required:!0,multi:!1,choices:[{id:'mini-peas',label:'Peas',priceDelta:0},{id:'mini-beans',label:'Beans',priceDelta:0}]}]}],o=['Starters','Mains','From the Grill',"Captain's Table",'Platters','Sides','Desserts','Mini Anchors (under 12s)'],l=t.map(({unsigned:s,soldOut:n,...t})=>({...t,restaurantId:"anchorage",soldOut:!!n,signOff:s?null:i}))},932,[]);
+__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"SCOTTISH_BANK_HOLIDAYS",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"BANK_HOLIDAY_SOURCE",{enumerable:!0,get:function(){return n}});const t=[{date:"2026-11-30",title:"St Andrew\u2019s Day",notes:""},{date:"2026-12-25",title:"Christmas Day",notes:""},{date:"2026-12-28",title:"Boxing Day",notes:"Substitute day"},{date:"2027-01-01",title:"New Year\u2019s Day",notes:""},{date:"2027-01-04",title:"2nd January",notes:"Substitute day"},{date:"2027-03-26",title:"Good Friday",notes:""},{date:"2027-05-03",title:"Early May bank holiday",notes:""},{date:"2027-05-31",title:"Spring bank holiday",notes:""},{date:"2027-08-02",title:"Summer bank holiday",notes:""},{date:"2027-11-30",title:"St Andrew\u2019s Day",notes:""},{date:"2027-12-27",title:"Christmas Day",notes:"Substitute day"},{date:"2027-12-28",title:"Boxing Day",notes:"Substitute day"},{date:"2028-01-03",title:"New Year\u2019s Day",notes:"Substitute day"},{date:"2028-01-04",title:"2nd January",notes:"Substitute day"},{date:"2028-04-14",title:"Good Friday",notes:""},{date:"2028-05-01",title:"Early May bank holiday",notes:""},{date:"2028-05-29",title:"Spring bank holiday",notes:""},{date:"2028-08-07",title:"Summer bank holiday",notes:""},{date:"2028-11-30",title:"St Andrew\u2019s Day",notes:""},{date:"2028-12-25",title:"Christmas Day",notes:""},{date:"2028-12-26",title:"Boxing Day",notes:""}],n='gov.uk/bank-holidays.json (Scotland)'},933,[]);
+__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"restaurants",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"demoMenus",{enumerable:!0,get:function(){return l}});const t={slotMinutes:15,slotCap:3,bufferMins:5,leadMins:20,takeawayPaused:!1,bookingCoversPerSlot:16,savedCardFromParty:6,depositFromParty:10,depositPerHead:1e3,noShowFeePerHead:1500,stampTarget:8,stampReward:'Free dessert',stampMinSpend:1e3,capacityPerHour:48,walkInShare:.35,turnMins:75},s=[{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:{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']},hoursNote:'Kitchen hours from the website (Mon\u2013Tue not listed). Seasonal hours to be confirmed by the restaurant.',settings:{...t},sections:[]},{id:'saltmarsh',name:'Saltmarsh Kitchen',tagline:'FICTIONAL demo restaurant \u2014 shows multi-tenancy',location:'Port Ailsa (fictional town)',fictional:!0,kitchenHours:{0:['12:00','20:00'],1:['12:00','20:00'],2:['12:00','20:00'],3:['12:00','20:00'],4:['12:00','21:00'],5:['12:00','21:00'],6:['12:00','21:00']},settings:{...t,slotCap:4,stampTarget:6,stampReward:'Free side',capacityPerHour:30},sections:['Small plates','Mains','Puddings']},{id:'brae',name:'Brae Bakehouse',tagline:'FICTIONAL demo caf\xe9 \u2014 shows multi-tenancy',location:'Kilbrae (fictional village)',fictional:!0,kitchenHours:{0:['09:00','16:00'],1:['09:00','16:00'],2:['09:00','16:00'],3:['09:00','16:00'],4:['09:00','16:00'],5:['09:00','20:00'],6:['09:00','20:00']},settings:{...t,slotCap:5,slotMinutes:15,stampTarget:10,stampReward:'Free coffee & cake',capacityPerHour:24,bookingCoversPerSlot:10},sections:['Bakes','Lunch','Hot drinks']}],n={by:'Fictional demo',at:'2026-10-26'},o=(t,s,o,l,c,u,h,p,f=[])=>({id:s,restaurantId:t,section:o,name:l,description:c,price:u,allergens:h,prepMins:p,dietary:f,soldOut:!1,signOff:n}),l=[o('saltmarsh','s-beets','Small plates','Roast beetroot & whipped feta','Fictional dish for the demo.',750,{milk:'contains',treenuts:'may'},6,['V']),o('saltmarsh','s-squid','Small plates','Salt & pepper squid','Fictional dish for the demo.',850,{molluscs:'contains',gluten:'contains'},7),o('saltmarsh','s-hake','Mains','Pan-roast hake, mussel broth','Fictional dish for the demo.',1950,{fish:'contains',molluscs:'contains',milk:'contains',celery:'contains'},15),o('saltmarsh','s-risotto','Mains','Wild mushroom risotto','Fictional dish for the demo.',1600,{milk:'contains',celery:'contains',sulphites:'contains'},16,['V']),o('saltmarsh','s-cranachan','Puddings','Cranachan','Fictional dish for the demo.',700,{milk:'contains',gluten:'contains'},3,['V']),o('brae','b-scone','Bakes','Cheese scone','Fictional dish for the demo.',350,{gluten:'contains',milk:'contains',eggs:'contains'},2,['V']),o('brae','b-caramel','Bakes','Millionaire\u2019s shortbread','Fictional dish for the demo.',300,{gluten:'contains',milk:'contains',soya:'may'},1,['V']),o('brae','b-toastie','Lunch','Ham & mustard toastie','Fictional dish for the demo.',750,{gluten:'contains',milk:'contains',mustard:'contains'},6),o('brae','b-soup','Lunch','Lentil soup & bread','Fictional dish for the demo.',600,{gluten:'contains',celery:'contains'},4,['VG']),o('brae','b-flat','Hot drinks','Flat white','Fictional dish for the demo.',330,{milk:'contains'},2,['V'])]},934,[]);
+__d(function(_g,_r,i,_a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"useStore",{enumerable:!0,get:function(){return r.useStore}}),_e.useNow=function(t=1e4){const u=(0,r.useStore)(e=>e.clock),[,n]=(0,e.useState)(0);return(0,e.useEffect)(()=>{const e=setInterval(()=>n(e=>e+1),t);return()=>clearInterval(e)},[t]),(0,r.nowFrom)(u)},Object.defineProperty(_e,"useRestaurant",{enumerable:!0,get:function(){return u}}),Object.defineProperty(_e,"useMenu",{enumerable:!0,get:function(){return n}}),Object.defineProperty(_e,"useAllMenu",{enumerable:!0,get:function(){return s}}),Object.defineProperty(_e,"useCustomer",{enumerable:!0,get:function(){return o}}),Object.defineProperty(_e,"useBasket",{enumerable:!0,get:function(){return a}}),Object.defineProperty(_e,"useOrders",{enumerable:!0,get:function(){return l}}),Object.defineProperty(_e,"useOrder",{enumerable:!0,get:function(){return f}}),Object.defineProperty(_e,"useBookings",{enumerable:!0,get:function(){return c}}),Object.defineProperty(_e,"useWaitlist",{enumerable:!0,get:function(){return b}}),Object.defineProperty(_e,"useEvents",{enumerable:!0,get:function(){return S}}),Object.defineProperty(_e,"useStampCard",{enumerable:!0,get:function(){return m}}),Object.defineProperty(_e,"useGiftCards",{enumerable:!0,get:function(){return g}}),Object.defineProperty(_e,"useRatings",{enumerable:!0,get:function(){return p}}),Object.defineProperty(_e,"useAudit",{enumerable:!0,get:function(){return O}});var e=_r(d[0]),t=_r(d[1]),r=_r(d[2]);const u=e=>(0,r.useStore)(t=>t.restaurants.find(t=>t.id===e)),n=e=>(0,r.useStore)((0,t.useShallow)(t=>t.menu.filter(t=>t.restaurantId===e&&!t.hidden))),s=e=>(0,r.useStore)((0,t.useShallow)(t=>t.menu.filter(t=>t.restaurantId===e))),o=()=>(0,r.useStore)(e=>e.customer),a=()=>(0,r.useStore)(e=>e.basket),l=e=>(0,r.useStore)((0,t.useShallow)(t=>e?t.orders.filter(t=>t.restaurantId===e):t.orders)),f=e=>(0,r.useStore)(t=>t.orders.find(t=>t.id===e)),c=e=>(0,r.useStore)((0,t.useShallow)(t=>e?t.bookings.filter(t=>t.restaurantId===e):t.bookings)),b=e=>(0,r.useStore)((0,t.useShallow)(t=>t.waitlist.filter(t=>t.restaurantId===e))),S=e=>(0,r.useStore)((0,t.useShallow)(t=>t.events.filter(t=>null===t.restaurantId||t.restaurantId===e))),m=e=>(0,r.useStore)(t=>t.stampCards.find(r=>r.restaurantId===e&&r.customerId===t.customer.id)),g=e=>(0,r.useStore)((0,t.useShallow)(t=>t.giftCards.filter(r=>(!e||r.restaurantId===e)&&r.ownerId===t.customer.id))),p=e=>(0,r.useStore)((0,t.useShallow)(t=>t.ratings.filter(t=>t.restaurantId===e))),O=e=>(0,r.useStore)((0,t.useShallow)(t=>t.audit.filter(t=>t.restaurantId===e)))},935,[12,842,841]);
+__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"shallow",{enumerable:!0,get:function(){return c}});const t=t=>Symbol.iterator in t,n=t=>"entries"in t,o=(t,n)=>{const o=t instanceof Map?t:new Map(t.entries()),s=n instanceof Map?n:new Map(n.entries());if(o.size!==s.size)return!1;for(const[t,n]of o)if(!s.has(t)||!Object.is(n,s.get(t)))return!1;return!0},s=(t,n)=>{const o=t[Symbol.iterator](),s=n[Symbol.iterator]();let c=o.next(),u=s.next();for(;!c.done&&!u.done;){if(!Object.is(c.value,u.value))return!1;c=o.next(),u=s.next()}return!!c.done&&!!u.done};function c(c,u){return!!Object.is(c,u)||"object"==typeof c&&null!==c&&"object"==typeof u&&null!==u&&(Object.getPrototypeOf(c)===Object.getPrototypeOf(u)&&(t(c)&&t(u)?n(c)&&n(u)?o(c,u):s(c,u):o({entries:()=>Object.entries(c)},{entries:()=>Object.entries(u)})))}},936,[]);
+__d(function(g,r,i,a,m,e,d){"use strict";m.exports={uri:"/chef-app/assets/assets/brand/anchorage.fea5ce2f6fd18bf2950aa21c0980ed8e.png",width:512,height:512,toString(){return this.uri}}},937,[]);
+__d(function(g,r,i,a,m,e,d){"use strict";m.exports={uri:"/chef-app/assets/assets/brand/saltmarsh.84acbc30d810d7a1cd3bbeb7b62651e8.png",width:512,height:512,toString(){return this.uri}}},938,[]);
+__d(function(g,r,i,a,m,e,d){"use strict";m.exports={uri:"/chef-app/assets/assets/brand/brae.8de9e89ac30966c6669de990370d8e40.png",width:512,height:512,toString(){return this.uri}}},939,[]);
+__d(function(t,e,r,s,i,h,n){"use strict";i.exports={uri:"/chef-app/assets/assets/brand/anchorage-hero.0450b828e4f9c1f4456240096598f6f5.png",width:1024,height:1024,toString(){return this.uri}}},940,[]);
+__d(function(g,_r,_i,a,_m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"VAT",{enumerable:!0,get:function(){return r}}),Object.defineProperty(e,"exVat",{enumerable:!0,get:function(){return n}}),e.dishCost=i,Object.defineProperty(e,"gpPct",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"priceForTarget",{enumerable:!0,get:function(){return c}}),e.costings=function(r,c,s,u){const d=(0,t.dishStats)(r);return c.map(t=>{const c=r.find(r=>r.id===t.dishId);if(!c||null==c.price)return null;const p=i(t,s),l=n(c.price),f=o(p,c.price),b=d.find(t=>t.item.id===c.id)?.sold??0;return{item:c,recipe:t,cost:p,priceInc:c.price,priceEx:l,gp:f,cashGp:l-p,below:ft.prevCost&&t.prevCost!==t.cost).map(s=>{const u=(s.cost-(s.prevCost??s.cost))/(s.prevCost??1)*100,d=r.filter(t=>t.lines.some(t=>t.ing===s.id)).map(r=>{const u=t.find(t=>t.id===r.dishId);if(!u||null==u.price)return null;const d=o(i(r,n,{ing:s.id,cost:s.prevCost}),u.price),p=o(i(r,n),u.price);return{item:u,before:d,after:p,dropped:d>=c&&pt.dropped),below:d.filter(t=>t.below)}})},e.weekGp=function(t,r,n){const i=t.reduce((t,r)=>t+r.priceEx*r.soldWeek,0),o=t.reduce((t,r)=>t+r.cost*r.soldWeek,0),c=o+r+Math.max(0,n);return{sales:i,theoCost:o,actualCost:c,theo:i?(i-o)/i*100:0,actual:i?(i-c)/i*100:0}},Object.defineProperty(e,"fmtQty",{enumerable:!0,get:function(){return s}});var t=_r(_d[0]);const r=.2,n=t=>Math.round(t/1.2);function i(t,r,n){return Math.round(t.lines.reduce((t,i)=>{const o=r.find(t=>t.id===i.ing);return t+(n&&n.ing===i.ing?n.cost:o?.cost??0)*i.qty},0))}const o=(t,r)=>{const i=n(r);return i>0?(i-t)/i*100:0},c=(t,r)=>50*Math.ceil(t/(1-r/100)*1.2/50);const s=(t,r)=>`${Number.isInteger(t)?t:t.toFixed(t<1?3:2).replace(/0+$/,'').replace(/\.$/,'')} ${'each'===r?'':r}`.trim()},941,[865]);
+__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,"CHEF_ID",{enumerable:!0,get:function(){return h}}),_e.useChef=y,Object.defineProperty(_e,"isLow",{enumerable:!0,get:function(){return p}}),Object.defineProperty(_e,"stockValue",{enumerable:!0,get:function(){return w}}),Object.defineProperty(_e,"within7",{enumerable:!0,get:function(){return x}}),_e.useWeek=function(){const{k:e,c:r,now:o}=y(6e4),t=e.waste.filter(e=>x(e.at,o)).reduce((e,r)=>e+r.cost,0),s=e.stockTakes[0],n=s?s.lines.reduce((e,r)=>e+(r.expected-r.counted)*r.cost,0):0;return{...(0,l.weekGp)(r,t,n),wasteWeek:t,variance:Math.round(n)}},_e.useForecast=function(){const{r:e,rid:r,now:o}=y(6e4),s=(0,t.useBookings)(r),u=(0,t.useOrders)(r),i=(0,t.useEvents)(r),l=(0,n.forecastToday)(e,s,u,i,o),b=l.hours.reduce((e,r)=>e+r.covers,0),f=l.hours.reduce((e,r)=>e+r.historicalCovers,0),h=f?Math.round((b-f)/f*100):0,p=['Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday'][(0,c.weekday)(o)];return{f:l,covers:b,typical:f,pct:h,day:p,label:`${p} ${h>=0?'+':''}${h}%`}},_e.Tile=function({label:e,value:o,sub:t,tone:s,onPress:n,testID:c}){const l='red'===s?i.colours.red:'amber'===s?i.colours.amber:'green'===s?i.colours.green:i.colours.text;return(0,f.jsxs)(r.default,{testID:c,accessibilityRole:n?'button':void 0,accessibilityLabel:`${e}: ${o}`,onPress:n,style:({pressed:e})=>({flexGrow:1,flexBasis:150,minWidth:140,padding:12,borderRadius:14,borderWidth:1,borderColor:'red'===s?i.colours.red:i.colours.border,backgroundColor:e?'#1d1a14':i.colours.surface,gap:2}),children:[(0,f.jsx)(u.Muted,{children:e}),(0,f.jsx)(u.T,{size:22,weight:"bold",colour:l,children:o}),t?(0,f.jsx)(u.T,{size:12,colour:i.colours.muted,children:t}):null]})},_e.Seg=function({value:e,options:o,onChange:t}){return(0,f.jsx)(u.Row,{wrap:!0,gap:6,children:o.map(o=>(0,f.jsx)(r.default,{accessibilityRole:"tab",accessibilityState:{selected:e===o.id},accessibilityLabel:o.label,onPress:()=>t(o.id),style:{paddingHorizontal:12,paddingVertical:7,borderRadius:999,borderWidth:1,borderColor:e===o.id?i.colours.gold:i.colours.border,backgroundColor:e===o.id?i.colours.goldTint:'transparent'},children:(0,f.jsx)(u.T,{size:13,weight:e===o.id?'semibold':'regular',colour:e===o.id?i.colours.goldLight:i.colours.text,children:o.label})},o.id))})},_e.Bar=function({pct:e,colour:r=i.colours.gold}){return(0,f.jsx)(o.default,{style:{height:6,borderRadius:3,backgroundColor:i.colours.surface2,overflow:'hidden'},children:(0,f.jsx)(o.default,{style:{width:`${Math.max(0,Math.min(100,e))}%`,height:6,backgroundColor:r}})})},Object.defineProperty(_e,"pct1",{enumerable:!0,get:function(){return j}}),_r(d[0]);var r=e(_r(d[1])),o=e(_r(d[2])),t=_r(d[3]),s=_r(d[4]),n=_r(d[5]),u=_r(d[6]),i=_r(d[7]),c=_r(d[8]),l=_r(d[9]),b=_r(d[10]),f=_r(d[11]);const h='st-3';function y(e=3e4){const r=(0,s.useOwner)(e=>e.site),o=(0,t.useRestaurant)(r),n=(0,s.useOwner)(e=>e.staff),u=n.find(e=>e.id===h)?.name??'Head Chef',i=(0,t.useNow)(e),c=(0,t.useAllMenu)(r),f=(0,b.useKitchen)();return{rid:r,r:o,me:u,now:i,menu:c,k:f,c:(0,l.costings)(c,f.recipes,f.ingredients,f.targetGp)}}const p=(e,r)=>e>0&&e<.5*r,w=e=>Math.round(e.reduce((e,r)=>e+r.onHand*r.cost,0)),x=(e,r)=>r.getTime()-new Date(e).getTime()<6048e5;const j=e=>`${e.toFixed(1)}%`},942,[12,245,109,796,802,839,790,797,848,941,943,6]);
+__d(function(g,_r,_i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"SEED_INGREDIENTS",{enumerable:!0,get:function(){return r}}),Object.defineProperty(_e,"SEED_RECIPES",{enumerable:!0,get:function(){return l}}),Object.defineProperty(_e,"WASTE_REASONS",{enumerable:!0,get:function(){return p}}),Object.defineProperty(_e,"useKitchen",{enumerable:!0,get:function(){return b}});var e,t=_r(_d[0]),s=(e=t)&&e.__esModule?e:{default:e},i=_r(_d[1]),n=_r(_d[2]);const o=(e,t,s,i,n,o,r,d=[],l)=>({id:e,name:t,unit:s,cost:i,supplierId:n,par:o,onHand:r,allergens:d,prevCost:l}),r=[o('haddock','Haddock fillet','kg',1848,'sup-1',14,9.5,['fish'],1650),o('smk-haddock','Smoked haddock','kg',1500,'sup-1',4,3.2,['fish']),o('smk-salmon','Smoked salmon','kg',2800,'sup-1',3,1.1,['fish']),o('crab','White and brown crab meat','kg',3800,'sup-1',3,2.4,['crustaceans']),o('mussels','Rope mussels','kg',450,'sup-1',12,0,['molluscs']),o('langoustine','Langoustines','kg',2600,'sup-1',6,4.5,['crustaceans']),o('lobster','Lobster (whole)','each',1800,'sup-1',6,4,['crustaceans']),o('prawns','Prawns (cooked, peeled)','kg',1400,'sup-1',3,2.6,['crustaceans']),o('beef-fillet','Beef fillet','kg',4800,'sup-2',4,2.9),o('steak','Braising steak','kg',1200,'sup-2',8,6.2),o('patty','Burger patty 6 oz','each',160,'sup-2',40,18),o('chicken','Chicken breast','kg',950,'sup-2',10,7.5),o('chorizo','Chorizo','kg',1400,'sup-2',2,1.6,['sulphites']),o('haggis','Haggis','kg',900,'sup-2',4,3.5,['gluten','celery']),o('potatoes','Potatoes (chipping)','kg',90,'sup-3',75,40),o('onions','Onions','kg',110,'sup-3',15,11),o('leaves','Salad leaves','kg',700,'sup-3',3,.8),o('lemons','Lemons','each',25,'sup-3',60,44),o('milk','Whole milk','L',110,'sup-4',20,14,['milk']),o('cream','Double cream','L',380,'sup-4',12,9,['milk']),o('butter','Butter','kg',850,'sup-4',6,4.5,['milk']),o('cheddar','Mature cheddar','kg',900,'sup-4',5,3.8,['milk']),o('parmesan','Parmesan','kg',1800,'sup-4',2,1.4,['milk']),o('eggs','Free-range eggs','each',28,'sup-4',120,90,['eggs']),o('ice-cream','Vanilla ice cream','L',450,'sup-4',10,7,['milk','eggs']),o('flour','Plain flour','kg',90,'sup-5',16,12,['gluten']),o('batter','Beer batter mix','kg',220,'sup-5',12,3.5,['gluten']),o('pastry','Puff pastry','kg',450,'sup-5',6,4.2,['gluten','milk']),o('macaroni','Macaroni','kg',180,'sup-5',6,5,['gluten']),o('penne','Penne','kg',180,'sup-5',6,4.5,['gluten']),o('buns','Brioche buns','each',45,'sup-5',40,30,['gluten','eggs','milk','sesame']),o('baguette','Garlic baguette','each',90,'sup-5',24,16,['gluten','milk']),o('oil','Rapeseed oil (fryer)','L',200,'sup-5',60,32),o('sponge','Sticky toffee sponge (portion)','each',95,'sup-5',30,22,['gluten','eggs','milk']),o('truffle-oil','Truffle oil','L',3e3,'sup-5',1,.6)],d=(e,t,s)=>({dishId:e,yield:t,lines:s.map(([e,t])=>({ing:e,qty:t}))}),l=[d('a-fishsupper','1 portion (220 g fillet)',[['haddock',.22],['batter',.06],['potatoes',.35],['oil',.05],['lemons',1]]),d('a-skink','1 bowl',[['smk-haddock',.08],['potatoes',.1],['milk',.15],['cream',.05],['onions',.03],['butter',.01]]),d('a-salmon','1 plate',[['smk-salmon',.07],['cream',.03],['leaves',.02],['lemons',1]]),d('a-haggis','1 plate',[['haggis',.1],['flour',.02],['eggs',1],['oil',.03]]),d('a-crabcakes','2 cakes',[['crab',.08],['potatoes',.06],['flour',.02],['eggs',1],['leaves',.02]]),d('a-tempura','1 plate',[['haddock',.07],['prawns',.05],['onions',.05],['batter',.06],['oil',.04],['lemons',1]]),d('a-mini','Kids fish & chips + ice cream',[['haddock',.1],['potatoes',.2],['batter',.03],['oil',.03],['ice-cream',.05]]),d('a-pie','1 pie',[['steak',.22],['pastry',.08],['onions',.05],['potatoes',.3],['oil',.03]]),d('a-chicken','1 plate',[['chicken',.22],['potatoes',.25],['cream',.05],['butter',.02]]),d('a-maccheese','1 bowl',[['macaroni',.12],['cheddar',.08],['milk',.2],['butter',.02],['flour',.015]]),d('a-penne','1 bowl',[['penne',.12],['chicken',.15],['chorizo',.04],['cream',.08],['parmesan',.01]]),d('a-caesar','1 plate',[['chicken',.16],['leaves',.08],['parmesan',.015],['eggs',1],['baguette',.25]]),d('a-moules','1 pot',[['mussels',.5],['cream',.08],['onions',.03],['baguette',.5]]),d('a-fillet','8 oz steak',[['beef-fillet',.227],['potatoes',.35],['onions',.05],['oil',.05],['butter',.02]]),d('a-claymore','1 burger',[['patty',1],['buns',1],['cheddar',.03],['potatoes',.3],['onions',.06],['batter',.03],['oil',.05]]),d('a-langoustines','1 plate',[['langoustine',.35],['butter',.03],['baguette',.5],['leaves',.03],['lemons',1]]),d('a-lobster','1 lobster',[['lobster',1],['butter',.04],['potatoes',.3],['oil',.04],['leaves',.03],['lemons',1]]),d('a-smorgasbord','Serves one',[['langoustine',.3],['mussels',.3],['crab',.08],['prawns',.1],['smk-salmon',.06],['leaves',.05],['lemons',2]]),d('a-deluxe','Serves two',[['lobster',1],['langoustine',.5],['crab',.15],['mussels',.5],['prawns',.15],['smk-salmon',.1],['leaves',.1],['lemons',3],['baguette',1]]),d('a-chips','1 side',[['potatoes',.35],['oil',.05]]),d('a-onionrings','1 side',[['onions',.15],['batter',.06],['oil',.04]]),d('a-garlicbread','1 side',[['baguette',.5],['butter',.02]]),d('a-truffle','1 side',[['potatoes',.35],['oil',.05],['parmesan',.015],['truffle-oil',.005]]),d('a-salad','1 side',[['leaves',.06],['lemons',.5]]),d('a-stp','1 portion',[['sponge',1],['cream',.05],['butter',.02],['ice-cream',.08]])],p=['Out of date','Spoiled','Over-production','Dropped / burnt','Returned by customer','Prep trim'],c=(e,t=10)=>{const s=new Date;return s.setDate(s.getDate()-e),s.setHours(t,0,0,0),s.toISOString()},u=e=>`${e}-${Math.random().toString(36).slice(2,8)}`;function k(){return{ingredients:r.map(e=>({...e})),recipes:l,targetGp:70,deliveries:[{id:'dl-today-fish',supplierId:'sup-1',due:'today',status:'expected',lines:[{ing:'haddock',ordered:10,received:8,price:1848},{ing:'mussels',ordered:12,received:12,price:450},{ing:'langoustine',ordered:3,received:3,price:2750},{ing:'smk-salmon',ordered:2,received:2,price:2800}]},{id:'dl-today-veg',supplierId:'sup-3',due:'today',status:'expected',lines:[{ing:'potatoes',ordered:50,received:50,price:90},{ing:'leaves',ordered:3,received:2,price:700},{ing:'lemons',ordered:30,received:30,price:25}]}],stockTakes:[{id:'stk-1',at:c(7,22),by:'Head Chef (example)',lines:[{ing:'haddock',expected:6,counted:5.4,cost:1650},{ing:'potatoes',expected:30,counted:28,cost:90},{ing:'cream',expected:8,counted:8,cost:380},{ing:'beef-fillet',expected:3.2,counted:3,cost:4800}]}],waste:[{id:'w1',at:c(1,21),by:'Head Chef (example)',item:'Haddock fillet',ing:'haddock',qty:.6,unit:'kg',reason:'Over-production',cost:1109},{id:'w2',at:c(2,15),by:'Head Chef (example)',item:'Salad leaves',ing:'leaves',qty:.5,unit:'kg',reason:'Spoiled',cost:350},{id:'w3',at:c(3,20),by:'Head Chef (example)',item:'Fish supper',qty:1,unit:'portion',reason:'Dropped / burnt',cost:517},{id:'w4',at:c(4,11),by:'Head Chef (example)',item:'Double cream',ing:'cream',qty:1,unit:'L',reason:'Out of date',cost:380},{id:'w5',at:c(5,22),by:'Head Chef (example)',item:'Chips',ing:'potatoes',qty:3,unit:'kg',reason:'Over-production',cost:270}],orders:[{id:'po-1',supplierId:'sup-1',at:c(1,13),by:'Head Chef (example)',status:'placed (by phone)',lines:[{ing:'haddock',qty:10,cost:1848},{ing:'mussels',qty:12,cost:450},{ing:'langoustine',qty:3,cost:2600},{ing:'smk-salmon',qty:2,cost:2800}],total:30520},{id:'po-2',supplierId:'sup-3',at:c(1,18),by:'Head Chef (example)',status:'placed (on website)',lines:[{ing:'potatoes',qty:50,cost:90},{ing:'leaves',qty:3,cost:700},{ing:'lemons',qty:30,cost:25}],total:7350}],prepTicks:{},temps:[{id:'t1',at:c(0,9),by:'Head Chef (example)',kind:'fridge',unit:'Walk-in fridge',temp:3},{id:'t2',at:c(0,9),by:'Head Chef (example)',kind:'freezer',unit:'Chest freezer',temp:-20}]}}const b=(0,i.create)()((0,n.persist)(e=>({...k(),setTarget:t=>e({targetGp:Math.max(40,Math.min(90,Math.round(t)))}),setIngredient:(t,s)=>e(e=>({ingredients:e.ingredients.map(e=>e.id===t?{...e,...s}:e)})),setRecipeQty:(t,s,i)=>e(e=>({recipes:e.recipes.map(e=>e.dishId!==t?e:{...e,lines:i>0?e.lines.some(e=>e.ing===s)?e.lines.map(e=>e.ing===s?{...e,qty:i}:e):[...e.lines,{ing:s,qty:i}]:e.lines.filter(e=>e.ing!==s)})})),acceptDelivery:(t,s,i,n)=>e(e=>({deliveries:e.deliveries.map(e=>e.id===t?{...e,lines:s,status:'accepted',checkedBy:i,at:(new Date).toISOString(),note:n}:e),ingredients:e.ingredients.map(e=>{const t=s.find(t=>t.ing===e.id);return t?{...e,onHand:Math.round(100*(e.onHand+t.received))/100,...t.price!==e.cost?{prevCost:e.cost,cost:t.price}:{}}:e})})),saveStockTake:(t,s)=>e(e=>({stockTakes:[{id:u('stk'),at:(new Date).toISOString(),by:s,lines:Object.entries(t).map(([t,s])=>{const i=e.ingredients.find(e=>e.id===t);return{ing:t,expected:i.onHand,counted:s,cost:i.cost}})},...e.stockTakes],ingredients:e.ingredients.map(e=>e.id in t?{...e,onHand:t[e.id]}:e)})),addWaste:t=>e(e=>({waste:[{...t,id:u('w'),at:(new Date).toISOString()},...e.waste],ingredients:t.ing?e.ingredients.map(e=>e.id===t.ing?{...e,onHand:Math.max(0,Math.round(100*(e.onHand-t.qty))/100)}:e):e.ingredients})),addOrder:t=>{const s=u('po');return e(e=>({orders:[{...t,id:s,at:(new Date).toISOString()},...e.orders]})),s},setOrderStatus:(t,s)=>e(e=>({orders:e.orders.map(e=>e.id===t?{...e,status:s}:e)})),tickPrep:(t,s)=>e(e=>{const i={...e.prepTicks};return s?i[t]={by:s,at:(new Date).toISOString()}:delete i[t],{prepTicks:i}}),addTemp:t=>e(e=>({temps:[{...t,id:u('t'),at:(new Date).toISOString()},...e.temps]})),reset:()=>e(k())}),{name:'covercharge-kitchen-v1',version:1,storage:(0,n.createJSONStorage)(()=>s.default)}))},943,[921,927,930]);
+__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.GpScreen=function({initial:e="dishes"}){const[t,l]=(0,s.useState)(e),{k:c}=(0,d.useChef)(),o=(0,a.useKitchen)(e=>e.setTarget);return(0,h.jsxs)(i.default,{style:{gap:12},children:[(0,h.jsx)(n.Card,{children:(0,h.jsxs)(n.Row,{style:{justifyContent:'space-between'},children:[(0,h.jsxs)(i.default,{style:{flex:1},children:[(0,h.jsx)(n.T,{weight:"semibold",children:"Target GP"}),(0,h.jsx)(n.Muted,{children:"Dishes under target are flagged red."})]}),(0,h.jsx)(n.Button,{small:!0,kind:"secondary",label:"\u2212",accessibilityLabel:"Lower target",onPress:()=>o(c.targetGp-1)}),(0,h.jsxs)(n.T,{size:22,weight:"bold",colour:r.colours.gold,children:[c.targetGp,"%"]}),(0,h.jsx)(n.Button,{small:!0,kind:"secondary",label:"+",accessibilityLabel:"Raise target",onPress:()=>o(c.targetGp+1)})]})}),(0,h.jsx)(d.Seg,{value:t,onChange:l,options:[{id:'dishes',label:'Recipe cards & GP'},{id:'changes',label:'Price changes'},{id:'week',label:'Theoretical vs actual'},{id:'engineering',label:'Menu engineering'}]}),'dishes'===t?(0,h.jsx)(u,{}):'changes'===t?(0,h.jsx)(j,{}):'week'===t?(0,h.jsx)(b,{}):(0,h.jsx)(f,{})]})};var s=_r(_d[0]),t=e(_r(_d[1])),i=e(_r(_d[2])),n=_r(_d[3]),l=_r(_d[4]),r=_r(_d[5]),c=_r(_d[6]),o=_r(_d[7]),d=_r(_d[8]),a=_r(_d[9]),h=_r(_d[10]);function u(){const{c:e,k:t}=(0,d.useChef)(),[l,r]=(0,s.useState)(null),c=e.filter(e=>e.below),o=[...e].sort((e,s)=>e.gp-s.gp),a=e.find(e=>e.item.id===l);return(0,h.jsxs)(i.default,{style:{gap:10},children:[(0,h.jsx)(n.Muted,{children:"Menu prices include VAT (20%). GP is worked out on the price ex VAT: (price ex VAT \u2212 dish cost) \xf7 price ex VAT. VAT figures are for information only."}),c.length?(0,h.jsxs)(n.Banner,{kind:"danger",title:`${c.length} of ${e.length} dishes below ${t.targetGp}%`,children:[c.slice(0,6).map(e=>e.item.name).join(', '),c.length>6?'\u2026':'']}):(0,h.jsx)(n.Banner,{kind:"success",title:"All costed dishes on target"}),o.map(e=>(0,h.jsx)(p,{d:e,onPress:()=>r(e.item.id)},e.item.id)),(0,h.jsx)(n.Sheet,{visible:!!a,onClose:()=>r(null),title:a?.item.name??'',children:a?(0,h.jsx)(x,{d:a}):null})]})}function p({d:e,onPress:s}){return(0,h.jsxs)(t.default,{accessibilityRole:"button",accessibilityLabel:`${e.item.name}, GP ${e.gp.toFixed(1)} percent`,onPress:s,style:({pressed:s})=>({padding:12,borderRadius:12,borderWidth:1,borderColor:e.below?r.colours.red:r.colours.border,backgroundColor:s?'#1d1a14':e.below?r.colours.redBg:r.colours.surface,gap:2}),children:[(0,h.jsxs)(n.Row,{style:{justifyContent:'space-between'},children:[(0,h.jsx)(n.T,{weight:"medium",style:{flex:1},children:e.item.name}),(0,h.jsx)(n.T,{weight:"bold",colour:e.below?r.colours.red:r.colours.green,children:(0,d.pct1)(e.gp)})]}),(0,h.jsxs)(n.Muted,{children:["Cost ",(0,l.gbp)(e.cost)," \xb7 ",(0,l.gbp)(e.priceInc)," inc VAT (",(0,l.gbp)(e.priceEx)," ex) \xb7 cash GP ",(0,l.gbp)(e.cashGp)]}),e.below?(0,h.jsxs)(n.T,{size:12,colour:r.colours.red,children:["Below ",e.target,"%: price for target ",(0,l.gbp)((0,o.priceForTarget)(e.cost,e.target))," inc VAT"]}):null]})}function x({d:e}){const s=(0,a.useKitchen)(),t=s.recipes.find(s=>s.dishId===e.item.id);return(0,h.jsxs)(i.default,{style:{gap:8},children:[(0,h.jsxs)(n.Muted,{children:["Recipe card \xb7 ",t.yield]}),t.lines.map(t=>{const r=s.ingredients.find(e=>e.id===t.ing);if(!r)return null;const c='each'===r.unit?1:'kg'===r.unit&&t.qty<.1?.005:.01;return(0,h.jsxs)(n.Row,{style:{justifyContent:'space-between'},children:[(0,h.jsxs)(i.default,{style:{flex:1},children:[(0,h.jsx)(n.T,{size:14,children:r.name}),(0,h.jsxs)(n.Muted,{children:[(0,l.gbp)(r.cost)," per ",r.unit]})]}),(0,h.jsx)(n.Button,{small:!0,kind:"ghost",label:"\u2212",accessibilityLabel:`Less ${r.name}`,onPress:()=>s.setRecipeQty(e.item.id,t.ing,Math.max(0,Math.round(1e3*(t.qty-c))/1e3))}),(0,h.jsx)(n.T,{size:13,style:{width:64,textAlign:'center'},children:(0,o.fmtQty)(t.qty,r.unit)}),(0,h.jsx)(n.Button,{small:!0,kind:"ghost",label:"+",accessibilityLabel:`More ${r.name}`,onPress:()=>s.setRecipeQty(e.item.id,t.ing,Math.round(1e3*(t.qty+c))/1e3)}),(0,h.jsx)(n.T,{size:13,style:{width:60,textAlign:'right'},children:(0,l.gbp)(Math.round(r.cost*t.qty))})]},t.ing)}),(0,h.jsxs)(i.default,{style:{borderTopWidth:1,borderColor:r.colours.border,paddingTop:8,gap:4},children:[(0,h.jsxs)(n.Row,{style:{justifyContent:'space-between'},children:[(0,h.jsx)(n.T,{children:"Dish cost"}),(0,h.jsx)(n.T,{weight:"semibold",children:(0,l.gbp)(e.cost)})]}),(0,h.jsxs)(n.Row,{style:{justifyContent:'space-between'},children:[(0,h.jsx)(n.T,{children:"Selling price inc VAT"}),(0,h.jsx)(n.T,{children:(0,l.gbp)(e.priceInc)})]}),(0,h.jsxs)(n.Row,{style:{justifyContent:'space-between'},children:[(0,h.jsx)(n.Muted,{children:"VAT (20%, for info)"}),(0,h.jsx)(n.Muted,{children:(0,l.gbp)(e.priceInc-e.priceEx)})]}),(0,h.jsxs)(n.Row,{style:{justifyContent:'space-between'},children:[(0,h.jsx)(n.T,{children:"Price ex VAT"}),(0,h.jsx)(n.T,{children:(0,l.gbp)(e.priceEx)})]}),(0,h.jsxs)(n.Row,{style:{justifyContent:'space-between'},children:[(0,h.jsx)(n.T,{children:"Cash GP"}),(0,h.jsx)(n.T,{weight:"semibold",children:(0,l.gbp)(e.cashGp)})]}),(0,h.jsxs)(n.Row,{style:{justifyContent:'space-between'},children:[(0,h.jsx)(n.T,{children:"GP %"}),(0,h.jsx)(n.T,{weight:"bold",colour:e.below?r.colours.red:r.colours.green,children:(0,d.pct1)(e.gp)})]}),(0,h.jsxs)(n.Banner,{kind:e.below?'warn':'info',title:`Price that hits ${e.target}%: ${(0,l.gbp)((0,o.priceForTarget)(e.cost,e.target))} inc VAT`,children:["Or bring the dish cost down to ",(0,l.gbp)(Math.floor(e.priceEx*(1-e.target/100))),". Prices are changed in Cover Charge for Managers (Menu & allergens)."]})]})]})}function j(){const{menu:e,k:s}=(0,d.useChef)(),t=(0,o.priceImpacts)(e,s.recipes,s.ingredients,s.targetGp);return t.length?(0,h.jsx)(i.default,{style:{gap:10},children:t.map(e=>(0,h.jsxs)(n.Card,{highlight:e.dropped.length?r.colours.red:void 0,children:[(0,h.jsxs)(n.T,{weight:"semibold",children:[e.ing.name," ",e.pct>0?'+':'',e.pct.toFixed(0),"%: ",e.dropped.length," dish",1===e.dropped.length?'':'es'," drop below target"]}),(0,h.jsxs)(n.Muted,{children:[(0,l.gbp)(e.ing.prevCost??0)," \u2192 ",(0,l.gbp)(e.ing.cost)," per ",e.ing.unit]}),e.dishes.map(e=>(0,h.jsxs)(n.Row,{style:{justifyContent:'space-between'},children:[(0,h.jsx)(n.T,{size:14,style:{flex:1},children:e.item.name}),(0,h.jsxs)(n.T,{size:13,colour:r.colours.muted,children:[(0,d.pct1)(e.before)," \u2192 "]}),(0,h.jsx)(n.T,{size:13,weight:"semibold",colour:e.below?r.colours.red:r.colours.green,children:(0,d.pct1)(e.after)}),e.dropped?(0,h.jsx)(n.Badge,{kind:"red",label:"NOW BELOW"}):null]},e.item.id))]},e.ing.id))}):(0,h.jsx)(n.Muted,{children:"No ingredient price changes since the last deliveries."})}function b(){const{k:e}=(0,d.useChef)(),s=(0,d.useWeek)();return(0,h.jsxs)(i.default,{style:{gap:10},children:[(0,h.jsxs)(n.Row,{wrap:!0,gap:10,children:[(0,h.jsx)(d.Tile,{label:"Theoretical GP (recipes \xd7 sales)",value:(0,d.pct1)(s.theo),tone:s.theoe.soldWeek>0),t=s.reduce((e,s)=>e+s.soldWeek,0)/Math.max(1,s.length),r=s.reduce((e,s)=>e+s.cashGp,0)/Math.max(1,s.length),o={Star:[],'Plough horse':[],Puzzle:[],Dog:[]};return s.forEach(e=>o[(0,c.quadrant)(e.soldWeek,e.cashGp,t,r)].push(e)),(0,h.jsxs)(i.default,{style:{gap:10},children:[(0,h.jsx)(n.Muted,{children:"Popularity (sold per week) against cash GP per dish, using the live menu from Cover Charge for Managers. Example sales figures."}),Object.keys(o).map(e=>(0,h.jsxs)(n.Card,{children:[(0,h.jsxs)(n.Row,{style:{justifyContent:'space-between'},children:[(0,h.jsx)(n.T,{weight:"semibold",children:'Star'===e?'\u2b50 Stars':'Plough horse'===e?'\ud83d\udc0e Plough horses':'Puzzle'===e?'\ud83e\udde9 Puzzles':'\ud83d\udc15 Dogs'}),(0,h.jsx)(n.Badge,{kind:"gold",label:`${o[e].length}`})]}),(0,h.jsx)(n.Muted,{children:c.QUADRANT_TIP[e]}),o[e].map(e=>(0,h.jsxs)(n.Row,{style:{justifyContent:'space-between'},children:[(0,h.jsx)(n.T,{size:14,style:{flex:1},children:e.item.name}),(0,h.jsxs)(n.Muted,{children:[e.soldWeek,"/wk \xb7 ",(0,l.gbp)(e.cashGp)," \xb7 ",(0,d.pct1)(e.gp)]})]},e.item.id))]},e))]})}},944,[12,245,109,790,793,797,865,941,942,943,6]);
+__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.PrepScreen=function(){const{k:e,menu:t,me:i,now:n}=(0,j.useChef)(),{covers:a,label:d,typical:o}=(0,j.useForecast)(),c=(0,f.ymd)(n),u=(0,b.dishStats)(t).filter(t=>e.recipes.some(e=>e.dishId===t.item.id)&&!['Sides','Desserts'].includes(t.item.section)),h=u.reduce((e,t)=>e+t.sold,0)||1,p=u.map(e=>({id:e.item.id,name:e.item.name,qty:Math.ceil(.85*a*(e.sold/h)*1.1)})).filter(e=>e.qty>0).sort((e,t)=>t.qty-e.qty),x={};p.forEach(t=>e.recipes.find(e=>e.dishId===t.id)?.lines.forEach(e=>{x[e.ing]=(x[e.ing]??0)+e.qty*t.qty}));const C=[{id:'haddock',text:`Portion ${p.filter(e=>['a-fishsupper','a-mini','a-tempura'].includes(e.id)).reduce((e,t)=>e+t.qty,0)} haddock portions (fish supper, tempura, Mini Anchors)`},{id:'chips',text:`Peel, cut and blanch ${(0,y.fmtQty)(Math.ceil(2*(x.potatoes??0))/2,'kg')} chipping potatoes`},{id:'batter',text:`Make up ${(0,y.fmtQty)(Math.ceil(10*(x.batter??0))/10+.5,'kg')} beer batter`},{id:'leaves',text:`Wash and spin ${(0,y.fmtQty)(Math.ceil(10*(x.leaves??0))/10,'kg')} salad leaves`},{id:'mussels',text:`Clean and debeard ${(0,y.fmtQty)(Math.ceil(2*(x.mussels??0))/2,'kg')} mussels (discard any open that don't close)`},{id:'sauce',text:'Garlic butter, tartare and Marie Rose: check, make and date-label'}],T=(0,w.useKitchen)(e=>e.tickPrep),S=[...C.map(e=>({key:`${c}:task:${e.id}`,text:e.text})),...p.map(e=>({key:`${c}:dish:${e.id}`,text:`${e.qty} \xd7 ${e.name}`}))],M=S.filter(t=>e.prepTicks[t.key]).length;return(0,k.jsxs)(l.default,{style:{gap:10},children:[(0,k.jsxs)(r.Banner,{kind:"info",title:`${d}: ${a} covers forecast`,children:["A typical ",d.split(' ')[0]," is about ",o," covers. Portions below are scaled from the forecast, bookings and the usual dish mix, plus 10% cover."]}),(0,k.jsxs)(r.Row,{style:{justifyContent:'space-between'},children:[(0,k.jsx)(r.T,{weight:"semibold",children:"Prep list for today"}),(0,k.jsx)(r.Badge,{kind:M===S.length?'green':'gold',label:`${M}/${S.length} done`})]}),S.map((t,n)=>{const a=e.prepTicks[t.key];return(0,k.jsxs)(s.default,{accessibilityRole:"checkbox",accessibilityState:{checked:!!a},accessibilityLabel:t.text,onPress:()=>T(t.key,a?null:i),style:{flexDirection:'row',gap:10,alignItems:'center',padding:10,borderRadius:10,borderWidth:1,borderColor:a?m.colours.green:m.colours.border,backgroundColor:m.colours.surface,marginTop:n===C.length?8:0},children:[(0,k.jsx)(r.T,{size:18,colour:a?m.colours.green:m.colours.muted,children:a?'\u2611':'\u2610'}),(0,k.jsxs)(l.default,{style:{flex:1},children:[(0,k.jsx)(r.T,{size:14,style:a?{textDecorationLine:'line-through',color:m.colours.muted}:void 0,children:t.text}),a?(0,k.jsxs)(r.Muted,{children:[a.by," \xb7 ",new Date(a.at).toLocaleTimeString('en-GB',{hour:'2-digit',minute:'2-digit'})]}):null]})]},t.key)})]})},_e.WasteScreen=function(){const{k:e,me:s,now:a}=(0,j.useChef)(),d=(0,j.useWeek)(),o=(0,w.useKitchen)(e=>e.addWaste),[c,h]=(0,t.useState)(e.ingredients[0].id),[f,p]=(0,t.useState)(''),[x,b]=(0,t.useState)('Over-production'),C=e.ingredients.find(e=>e.id===c),T=Number(f.replace(',','.'))||0,S=e.waste.filter(e=>(0,j.within7)(e.at,a));return(0,k.jsxs)(l.default,{style:{gap:10},children:[(0,k.jsxs)(r.Row,{wrap:!0,gap:10,children:[(0,k.jsx)(j.Tile,{label:"Waste this week",value:(0,u.gbp)(d.wasteWeek),sub:`${S.length} entries`,tone:d.sales&&d.wasteWeek/d.sales>.02?'amber':'green'}),(0,k.jsx)(j.Tile,{label:"Waste as % of food sales",value:d.sales?(0,j.pct1)(d.wasteWeek/d.sales*100):'\u2014',sub:"Food sales ex VAT, example week"})]}),(0,k.jsxs)(r.Card,{children:[(0,k.jsx)(r.T,{weight:"semibold",children:"Log waste"}),(0,k.jsx)(i.default,{horizontal:!0,showsHorizontalScrollIndicator:!1,children:(0,k.jsx)(r.Row,{gap:6,children:e.ingredients.map(e=>(0,k.jsx)(r.Chip,{label:e.name,selected:e.id===c,onPress:()=>h(e.id)},e.id))})}),(0,k.jsxs)(r.Row,{gap:8,children:[(0,k.jsx)(n.default,{accessibilityLabel:"Waste quantity",keyboardType:"decimal-pad",value:f,onChangeText:p,placeholder:`qty (${C.unit})`,placeholderTextColor:m.colours.muted,style:{flex:1,borderWidth:1,borderColor:m.colours.border,borderRadius:8,padding:8,color:m.colours.text}}),(0,k.jsx)(r.T,{children:C.unit}),(0,k.jsx)(r.T,{weight:"semibold",colour:m.colours.gold,children:(0,u.gbp)(Math.round(T*C.cost))})]}),(0,k.jsx)(r.Row,{wrap:!0,gap:6,children:w.WASTE_REASONS.map(e=>(0,k.jsx)(r.Chip,{label:e,selected:e===x,onPress:()=>b(e)},e))}),(0,k.jsx)(r.Button,{label:"Add to waste log",disabled:T<=0,onPress:()=>{o({by:s,item:C.name,ing:C.id,qty:T,unit:C.unit,reason:x,cost:Math.round(T*C.cost)}),p('')}}),(0,k.jsx)(r.Muted,{children:"Logged waste also comes off stock."})]}),e.waste.slice(0,20).map(e=>(0,k.jsxs)(r.Row,{style:{justifyContent:'space-between',paddingVertical:2},children:[(0,k.jsxs)(l.default,{style:{flex:1},children:[(0,k.jsxs)(r.T,{size:14,children:[e.item," \xb7 ",(0,y.fmtQty)(e.qty,e.unit)]}),(0,k.jsxs)(r.Muted,{children:[e.reason," \xb7 ",new Date(e.at).toLocaleDateString('en-GB',{weekday:'short',day:'numeric',month:'short'})," \xb7 ",e.by]})]}),(0,k.jsx)(r.T,{size:14,children:(0,u.gbp)(e.cost)})]},e.id))]})},_e.AllergenScreen=function(){const{k:e,menu:t,me:s,rid:n}=(0,j.useChef)(),d=(0,a.useStore)(e=>e.updateMenuItem),u=(0,a.useStore)(e=>e.setSignOff),h=(0,o.auditView)('chef',(0,a.useAudit)(n)).slice(0,12),f=e.recipes.map(s=>{const i=t.find(e=>e.id===s.dishId);if(!i)return null;const n=new Set(s.lines.flatMap(t=>e.ingredients.find(e=>e.id===t.ing)?.allergens??[])),l=i.allergens,r=[...n].filter(e=>!l[e]);return{r:s,item:i,fromRecipe:n,onMenu:l,missing:r}}).filter(Boolean);return(0,k.jsxs)(l.default,{style:{gap:10},children:[(0,k.jsx)(r.Muted,{children:"The 14 allergens from each recipe card's ingredients (C = in the recipe). A red cell means the recipe contains it but the menu doesn't say so: apply it to the dish, then sign off. Menu-only entries (from sauces or garnishes not costed here) stay as they are."}),(0,k.jsx)(i.default,{horizontal:!0,children:(0,k.jsxs)(l.default,{children:[(0,k.jsxs)(r.Row,{gap:0,children:[(0,k.jsx)(l.default,{style:{width:150},children:(0,k.jsx)(r.Muted,{children:"Dish"})}),c.ALLERGENS.map(e=>(0,k.jsx)(l.default,{style:{width:34,alignItems:'center'},children:(0,k.jsx)(r.T,{size:10,colour:m.colours.muted,children:e.short})},e.id))]}),f.map(({item:e,fromRecipe:t,onMenu:s})=>(0,k.jsxs)(r.Row,{gap:0,style:{borderTopWidth:1,borderColor:m.colours.border,paddingVertical:4},children:[(0,k.jsx)(l.default,{style:{width:150},children:(0,k.jsx)(r.T,{size:12,numberOfLines:2,children:e.name})}),c.ALLERGENS.map(i=>{const n=t.has(i.id),a=s[i.id],d=n&&!a;return(0,k.jsx)(l.default,{accessibilityLabel:`${e.name} ${i.label}: ${n?'in recipe':''}${a?` menu ${a}`:''}`,style:{width:34,height:24,alignItems:'center',justifyContent:'center',backgroundColor:d?m.colours.redBg:'transparent'},children:(0,k.jsx)(r.T,{size:11,weight:n?'bold':'regular',colour:d?m.colours.red:n?m.colours.gold:a?m.colours.muted:'#444',children:n?'C':'contains'===a?'c':'may'===a?'m':'\xb7'})},i.id)})]},e.id))]})}),(0,k.jsx)(r.Muted,{children:"C recipe contains \xb7 c menu says contains \xb7 m menu says may contain"}),f.map(({item:e,missing:t,fromRecipe:i})=>(0,k.jsxs)(r.Card,{highlight:t.length?m.colours.red:void 0,children:[(0,k.jsxs)(r.Row,{style:{justifyContent:'space-between'},children:[(0,k.jsx)(r.T,{weight:"semibold",style:{flex:1},children:e.name}),e.signOff?(0,k.jsx)(r.Badge,{kind:"green",label:"SIGNED OFF"}):(0,k.jsx)(r.Badge,{kind:"amber",label:"NEEDS SIGN-OFF"})]}),(0,k.jsxs)(r.Muted,{children:["Recipe: ",[...i].map(e=>c.ALLERGENS.find(t=>t.id===e)?.label).join(', ')||'none of the 14',e.signOff?` \xb7 signed off by ${e.signOff.by} on ${e.signOff.at}`:'']}),t.length?(0,k.jsxs)(r.T,{size:13,colour:m.colours.red,children:["Missing on the menu: ",t.map(e=>c.ALLERGENS.find(t=>t.id===e)?.label).join(', ')]}):null,(0,k.jsxs)(r.Row,{wrap:!0,gap:8,children:[t.length?(0,k.jsx)(r.Button,{small:!0,label:"Apply recipe allergens to the dish",onPress:()=>{const s={...e.allergens};t.forEach(e=>{s[e]='contains'}),d(e.id,{allergens:s})}}):null,e.signOff?null:(0,k.jsx)(r.Button,{small:!0,kind:"success",label:"Sign off",disabled:t.length>0,onPress:()=>u(e.id,s)})]})]},e.id)),(0,k.jsxs)(r.Card,{children:[(0,k.jsx)(r.T,{weight:"semibold",children:"Audit log"}),h.length?h.map(e=>(0,k.jsxs)(r.Muted,{children:[new Date(e.at).toLocaleString('en-GB',{day:'numeric',month:'short',hour:'2-digit',minute:'2-digit'})," \xb7 ",e.text]},e.id)):(0,k.jsx)(r.Muted,{children:"No allergen changes yet."})]})]})},_e.ComplianceScreen=function(){const{k:e,me:i,now:a}=(0,j.useChef)(),o=(0,f.ymd)(a),c=(0,w.useKitchen)(e=>e.addTemp),u=(0,d.useOwner)(e=>e.checks),{tick:h,untick:p}=d.useOwner.getState(),[x,b]=(0,t.useState)('fridge'),y=C.find(e=>e.id===x),[M,R]=(0,t.useState)(y.units[0]),[$,v]=(0,t.useState)(''),O=Number($.replace(',','.')),B=$.trim()&&!Number.isNaN(O)?y.ok(O):null,D=e.temps.filter(e=>e.at.slice(0,10)===o),z=(e,t,n)=>{const a=u[e];return(0,k.jsxs)(s.default,{accessibilityRole:"checkbox",accessibilityState:{checked:!!a},accessibilityLabel:t,onPress:()=>a?p(e):h(e,i,(new Date).toISOString()),style:{flexDirection:'row',gap:10,alignItems:'center',paddingVertical:6},children:[(0,k.jsx)(r.T,{size:18,colour:a?m.colours.green:m.colours.muted,children:a?'\u2611':'\u2610'}),(0,k.jsxs)(l.default,{style:{flex:1},children:[(0,k.jsx)(r.T,{size:14,children:t}),(0,k.jsx)(r.Muted,{children:a?`${a.by} \xb7 ${new Date(a.at).toLocaleTimeString('en-GB',{hour:'2-digit',minute:'2-digit'})}`:n??''})]})]},e)};return(0,k.jsxs)(l.default,{style:{gap:10},children:[(0,k.jsxs)(r.Card,{children:[(0,k.jsx)(r.T,{weight:"semibold",children:"Record a temperature"}),(0,k.jsx)(r.Row,{wrap:!0,gap:6,children:C.map(e=>(0,k.jsx)(r.Chip,{label:e.label,selected:e.id===x,onPress:()=>{b(e.id),R(e.units[0])}},e.id))}),(0,k.jsx)(r.Row,{wrap:!0,gap:6,children:y.units.map(e=>(0,k.jsx)(r.Chip,{label:e,selected:e===M,onPress:()=>R(e)},e))}),(0,k.jsx)(r.Muted,{children:y.rule}),(0,k.jsxs)(r.Row,{gap:8,children:[(0,k.jsx)(n.default,{accessibilityLabel:"Temperature in degrees C",keyboardType:"numbers-and-punctuation",value:$,onChangeText:v,placeholder:"\xb0C",placeholderTextColor:m.colours.muted,style:{width:90,borderWidth:1,borderColor:m.colours.border,borderRadius:8,padding:8,color:m.colours.text}}),null===B?null:(0,k.jsx)(r.Badge,{kind:!0===B?'green':'warn'===B?'amber':'red',label:!0===B?'OK':'warn'===B?'CHECK':'OUT OF RANGE'}),(0,k.jsx)(r.Button,{small:!0,label:"Save",disabled:null===B,onPress:()=>{c({by:i,kind:x,unit:M,temp:O,note:!0===B?void 0:'Action needed'}),v('')}})]}),!1===B?(0,k.jsx)(r.Banner,{kind:"danger",title:"Out of range",children:"Record what you did (e.g. moved food, called the engineer, cooked longer) and re-check."}):null]}),(0,k.jsxs)(r.Card,{children:[(0,k.jsxs)(r.T,{weight:"semibold",children:["Today's readings (",D.length,")"]}),D.length?D.map(e=>{const t=C.find(t=>t.id===e.kind)?.ok(e.temp);return(0,k.jsxs)(r.Row,{style:{justifyContent:'space-between'},children:[(0,k.jsx)(r.T,{size:14,style:{flex:1},children:e.unit}),(0,k.jsx)(r.Muted,{children:new Date(e.at).toLocaleTimeString('en-GB',{hour:'2-digit',minute:'2-digit'})}),(0,k.jsxs)(r.T,{size:14,weight:"semibold",colour:!0===t?m.colours.green:'warn'===t?m.colours.amber:m.colours.red,children:[e.temp,"\xb0C"]})]},e.id)}):(0,k.jsx)(r.Muted,{children:"None yet today."})]}),(0,k.jsxs)(r.Card,{children:[(0,k.jsx)(r.T,{weight:"semibold",children:"Opening and closing checks"}),(0,k.jsx)(r.Muted,{children:"Day-to-day checks in the style of a CookSafe diary. Your own CookSafe manual is the record that counts."}),S.map(e=>z(`${o}:kc-${e.id}`,e.text))]}),(0,k.jsxs)(r.Card,{children:[(0,k.jsx)(r.T,{weight:"semibold",children:"Cleaning schedule"}),T.map(e=>z('Daily'===e.freq?`${o}:kcl-${e.id}`:`wk${Math.floor(a.getTime()/6048e5)}:kcl-${e.id}`,e.text,e.freq))]})]})},_e.TeamScreen=function(){const{rid:e,r:s,me:i,now:n,menu:r}=(0,j.useChef)(15e3),[a,d]=(0,t.useState)('live');return(0,k.jsxs)(l.default,{style:{gap:10},children:[(0,k.jsx)(j.Seg,{value:a,onChange:d,options:[{id:'live',label:'Live tickets'},{id:'86',label:'86 / sold out'},{id:'team',label:"Who's on & rota"},{id:'chat',label:'Kitchen chat'}]}),'live'===a?(0,k.jsx)(M,{}):'86'===a?(0,k.jsx)(R,{}):'team'===a?(0,k.jsx)($,{}):(0,k.jsx)(v,{}),void 0,void 0,void 0,void 0,void 0]})};var t=_r(_d[0]),s=e(_r(_d[1])),i=e(_r(_d[2])),n=e(_r(_d[3])),l=e(_r(_d[4])),r=_r(_d[5]),a=_r(_d[6]),d=_r(_d[7]),o=_r(_d[8]),c=_r(_d[9]),u=_r(_d[10]),h=_r(_d[11]),f=_r(_d[12]),m=_r(_d[13]),p=_r(_d[14]),x=_r(_d[15]),b=_r(_d[16]),y=_r(_d[17]),j=_r(_d[18]),w=_r(_d[19]),k=_r(_d[20]);const C=[{id:'fridge',label:'Fridge',units:['Walk-in fridge','Prep fridge','Bar fridge'],rule:'Target 5\xb0C or below (8\xb0C maximum)',ok:e=>e<=5||e<=8&&'warn'},{id:'freezer',label:'Freezer',units:['Chest freezer','Upright freezer'],rule:'Target \u221218\xb0C or below',ok:e=>e<=-18||e<=-15&&'warn'},{id:'cook',label:'Cooking (core)',units:['Fish','Chicken','Pie','Burger'],rule:'Core 75\xb0C or above',ok:e=>e>=75},{id:'reheat',label:'Reheating',units:['Soup','Skink','Sauce'],rule:'Core 82\xb0C or above (Scotland)',ok:e=>e>=82},{id:'hot hold',label:'Hot holding',units:['Bain-marie','Soup kettle'],rule:'63\xb0C or above',ok:e=>e>=63},{id:'cool',label:'Cooling',units:['Stock','Rice','Braise'],rule:'Below 8\xb0C, cooled as quickly as possible (aim for 90 minutes)',ok:e=>e<8||'warn'}],T=[{id:'surfaces',text:'Work surfaces and boards cleaned and sanitised',freq:'Daily'},{id:'fryers',text:'Fryers filtered, oil checked',freq:'Daily'},{id:'floors',text:'Floors and drains',freq:'Daily'},{id:'handwash',text:'Wash-hand basins stocked (soap, towels)',freq:'Daily'},{id:'fridges',text:'Fridges emptied and cleaned',freq:'Weekly'},{id:'extract',text:'Extraction canopy filters',freq:'Weekly'}],S=[{id:'open-temps',text:'Opening: fridge and freezer temperatures recorded',when:'Opening'},{id:'open-fit',text:'Opening: staff fit for work (no sickness or diarrhoea in 48 hours)',when:'Opening'},{id:'open-probe',text:'Opening: probe thermometer checked and wiped',when:'Opening'},{id:'close-label',text:'Closing: food covered, labelled and dated',when:'Closing'},{id:'close-dates',text:'Closing: anything past its use-by removed',when:'Closing'},{id:'close-clean',text:'Closing: cleaning schedule done',when:'Closing'}];function M(){const{rid:e,r:t,me:s,now:i}=(0,j.useChef)(15e3),n=(0,a.useOrders)(e).filter(e=>['new','acknowledged','preparing'].includes(e.status)),d=(0,o.ticketView)('chef',n),u=(0,a.useStore)(e=>e.setOrderStatus),f=(0,a.useStore)(e=>e.ackOrderAllergy),p=(0,a.useStore)(e=>e.ackReadiness),x=n.flatMap(e=>(0,h.readinessFor)(e,t,i)).filter(e=>'due'===e.state||'overdue'===e.state);return(0,k.jsxs)(l.default,{style:{gap:8},children:[x.length?(0,k.jsx)(r.Banner,{kind:"warn",title:`${x.length} readiness alert${x.length>1?'s':''}`,children:x.map(e=>e.detail).join(' \xb7 ')}):(0,k.jsx)(r.Muted,{children:"No readiness alerts right now."}),d.length?d.map(e=>(0,k.jsxs)(r.Card,{highlight:e.allergies.length&&!e.allergyAck?m.colours.red:void 0,children:[(0,k.jsxs)(r.Row,{style:{justifyContent:'space-between'},children:[(0,k.jsxs)(r.T,{weight:"semibold",children:['table'===e.type?`Table ${e.tableNo}`:`Takeaway ${e.slotTime?new Date(e.slotTime).toLocaleTimeString('en-GB',{hour:'2-digit',minute:'2-digit'}):''}`," \xb7 ",e.ref]}),(0,k.jsx)(r.Badge,{kind:'new'===e.status?'amber':'gold',label:e.status.toUpperCase()})]}),e.lines.map((e,t)=>(0,k.jsxs)(r.T,{size:14,children:[e.qty," \xd7 ",e.name]},t)),e.allergies.length?(0,k.jsxs)(r.T,{size:13,colour:m.colours.red,children:["\u26a0 Allergy: ",e.allergies.map(e=>`${c.ALLERGENS.find(t=>t.id===e.allergen)?.label} (${e.severity})`).join(', '),e.allergyAck?` \xb7 acknowledged by ${e.allergyAck.by}`:'']}):null,(0,k.jsxs)(r.Row,{wrap:!0,gap:8,children:[e.allergies.length&&!e.allergyAck?(0,k.jsx)(r.Button,{small:!0,kind:"danger",label:"Acknowledge allergy",onPress:()=>f(e.id,s)}):null,'preparing'!==e.status?(0,k.jsx)(r.Button,{small:!0,label:"Start",onPress:()=>{u(e.id,'preparing',s),'takeaway'===e.type&&p(e.id,'cook',s)}}):null,(0,k.jsx)(r.Button,{small:!0,kind:"success",label:"Ready",disabled:!!e.allergies.length&&!e.allergyAck,onPress:()=>u(e.id,'ready',s)})]})]},e.id)):(0,k.jsx)(r.Muted,{children:"No live tickets. New orders from the customer app and the Staff app show here."})]})}function R(){const{menu:e}=(0,j.useChef)(),t=(0,a.useStore)(e=>e.updateMenuItem),s=e.filter(e=>e.soldOut);return(0,k.jsxs)(l.default,{style:{gap:6},children:[(0,k.jsx)(r.Muted,{children:"Sold out items disappear from ordering in the customer app straight away and show as 86 in Staff and Managers."}),s.length?(0,k.jsx)(r.Banner,{kind:"warn",title:`86: ${s.length}`,children:s.map(e=>e.name).join(', ')}):null,e.filter(e=>!e.hidden).map(e=>(0,k.jsx)(r.Toggle,{label:`${e.soldOut?'86 \xb7 ':''}${e.name}`,value:e.soldOut,onChange:s=>{t(e.id,{soldOut:s}),d.useOwner.getState().chatSend({ch:'kitchen',from:'system',text:s?`86: ${e.name} sold out`:`Back on: ${e.name}`,at:(new Date).toISOString()})}},e.id))]})}function $(){const{now:e,today:t}={...(0,j.useChef)(6e4),today:(0,f.ymd)(new Date)},{staff:s,shifts:i}=(0,o.rotaView)('chef',(0,d.useOwner)(e=>e.staff),(0,d.useOwner)(e=>e.shifts)),n=(0,d.useOwner)(e=>e.attendance).filter(e=>e.date===t&&e.in&&!e.out),a=(0,x.weekday)(e),c=s.filter(e=>/kitchen|chef|kp/i.test(e.job+e.name));return(0,k.jsxs)(l.default,{style:{gap:10},children:[(0,k.jsxs)(r.Card,{children:[(0,k.jsx)(r.T,{weight:"semibold",children:"On now"}),n.length?n.map(e=>(0,k.jsxs)(r.Row,{style:{justifyContent:'space-between'},children:[(0,k.jsx)(r.T,{size:14,children:s.find(t=>t.id===e.staffId)?.name??e.staffId}),(0,k.jsxs)(r.Muted,{children:["since ",new Date(e.in).toLocaleTimeString('en-GB',{hour:'2-digit',minute:'2-digit'})]})]},e.id)):(0,k.jsx)(r.Muted,{children:"Nobody clocked in yet."})]}),(0,k.jsxs)(r.Card,{children:[(0,k.jsxs)(r.T,{weight:"semibold",children:["Today on the rota (",x.DAY3[a],")"]}),i.filter(e=>e.day===a).map(e=>(0,k.jsxs)(r.Row,{style:{justifyContent:'space-between'},children:[(0,k.jsx)(r.T,{size:14,children:s.find(t=>t.id===e.staffId)?.name}),(0,k.jsxs)(r.Muted,{children:[(0,x.fmtH)(e.start),"\u2013",(0,x.fmtH)(e.end)]})]},e.id))]}),(0,k.jsxs)(r.Card,{children:[(0,k.jsx)(r.T,{weight:"semibold",children:"Kitchen rota this week"}),c.map(e=>(0,k.jsxs)(l.default,{style:{gap:4},children:[(0,k.jsx)(r.T,{size:14,children:e.name}),(0,k.jsx)(r.Row,{wrap:!0,gap:4,children:x.DAY3.map((t,s)=>{const n=i.find(t=>t.staffId===e.id&&t.day===s);return(0,k.jsxs)(l.default,{style:{width:44,padding:4,borderRadius:6,backgroundColor:n?m.colours.goldTint:m.colours.surface2,alignItems:'center'},children:[(0,k.jsx)(r.T,{size:10,colour:m.colours.muted,children:t}),(0,k.jsx)(r.T,{size:10,children:n?`${(0,x.fmtH)(n.start).slice(0,2)}\u2013${(0,x.fmtH)(n.end).slice(0,2)}`:'off'})]},t)})})]},e.id)),(0,k.jsx)(r.Muted,{children:"Rota changes, swaps and leave are made in Cover Charge for Managers. This view shows shifts only."})]})]})}function v(){const{now:e}=(0,j.useChef)(15e3);(0,t.useEffect)(()=>{(0,p.ensureChat)(e)},[]);const s=(0,o.chatView)('chef',(0,d.useOwner)(e=>e.chat)),i=(0,o.rotaView)('chef',(0,d.useOwner)(e=>e.staff),[]).staff,a=(0,d.useOwner)(e=>e.chatSend),[c,u]=(0,t.useState)('');return(0,k.jsxs)(l.default,{style:{gap:8},children:[s.slice(-30).map(e=>(0,k.jsxs)(l.default,{style:{alignSelf:e.from===j.CHEF_ID?'flex-end':'flex-start',maxWidth:'85%',padding:8,borderRadius:10,backgroundColor:'system'===e.from?m.colours.surface2:e.from===j.CHEF_ID?m.colours.goldTint:m.colours.surface,borderWidth:1,borderColor:m.colours.border},children:[(0,k.jsxs)(r.T,{size:11,colour:m.colours.gold,children:['system'===e.from?'Cover Charge':i.find(t=>t.id===e.from)?.name??e.from," \xb7 ",new Date(e.at).toLocaleTimeString('en-GB',{hour:'2-digit',minute:'2-digit'})]}),(0,k.jsx)(r.T,{size:14,children:e.text??e.photo?.caption})]},e.id)),(0,k.jsxs)(r.Row,{gap:8,children:[(0,k.jsx)(n.default,{accessibilityLabel:"Message the kitchen",value:c,onChangeText:u,placeholder:"Message #kitchen",placeholderTextColor:m.colours.muted,style:{flex:1,borderWidth:1,borderColor:m.colours.border,borderRadius:10,padding:10,color:m.colours.text}}),(0,k.jsx)(r.Button,{small:!0,label:"Send",disabled:!c.trim(),onPress:()=>{a({ch:'kitchen',from:j.CHEF_ID,text:c.trim(),at:(new Date).toISOString()}),u('')}})]}),(0,k.jsx)(r.Muted,{children:"Kitchen channel, shared with Staff and Managers on this device (demo)."})]})}},945,[12,245,133,255,109,790,796,802,788,791,793,845,795,797,847,848,865,941,942,943,6]);
+__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.useSuggestions=x,_e.OrdersScreen=function(){const[e,s]=(0,t.useState)('suggested');return(0,m.jsxs)(n.default,{style:{gap:12},children:[(0,m.jsx)(p.Seg,{value:e,onChange:s,options:[{id:'suggested',label:'Suggested orders'},{id:'history',label:'Order history'}]}),'suggested'===e?(0,m.jsx)(j,{}):(0,m.jsx)(b,{})]})};var t=r(_d[0]),s=e(r(_d[1])),n=e(r(_d[2])),i=r(_d[3]),l=r(_d[4]),d=r(_d[5]),o=r(_d[6]),u=r(_d[7]),c=r(_d[8]),h=r(_d[9]),p=r(_d[10]),y=r(_d[11]),m=r(_d[12]);const f=(e,t)=>'kg'===t?Math.ceil(2*e)/2:Math.ceil(e);function x(){const{k:e,now:t}=(0,p.useChef)(6e4),{pct:s}=(0,p.useForecast)(),n=(0,d.supplierView)('chef',(0,l.useOwner)(e=>e.suppliers)).filter(e=>!e.archived),i=1+Math.max(0,s)/100;return n.map(s=>{const n=e.ingredients.filter(e=>e.supplierId===s.id).map(e=>({i:e,qty:f(Math.max(0,e.par*i-e.onHand),e.unit)})).filter(e=>e.qty>0),l=(0,c.weekday)(t),d=s.orderDays.includes(l),[o,u]=(s.cutoff||'23:59').split(':').map(Number),h=new Date(t);h.setHours(o,u,0,0);const p=e.orders.some(e=>e.supplierId===s.id&&new Date(e.at).toDateString()===t.toDateString()),y=[1,2,3,4,5,6,7].map(e=>(l+e)%7).find(e=>s.orderDays.includes(e));return{s:s,lines:n,ordersToday:d,cutPassed:t>h,placedToday:p,nextDay:y,total:Math.round(n.reduce((e,t)=>e+t.qty*t.i.cost,0))}}).filter(e=>e.lines.length||e.ordersToday)}function j(){const{me:e}=(0,p.useChef)(),{label:l,covers:d}=(0,p.useForecast)(),f=(0,y.useKitchen)(e=>e.addOrder),j=x(),[b,w]=(0,t.useState)({}),[$,C]=(0,t.useState)('');return(0,m.jsxs)(n.default,{style:{gap:10},children:[(0,m.jsxs)(i.Muted,{children:["Built from par levels and today's forecast (",d," covers, ",l," vs a typical day). Adjust, then call the supplier or use their ordering website. Nothing is sent by Cover Charge."]}),$?(0,m.jsx)(i.Banner,{kind:"success",title:"Saved to order history",children:$}):null,j.map(({s:t,lines:l,ordersToday:d,cutPassed:p,placedToday:y,nextDay:x,total:j})=>{const $=l.map(e=>({...e,q:b[`${t.id}:${e.i.id}`]??e.qty})),M=Math.round($.reduce((e,t)=>e+t.q*t.i.cost,0)),k=s=>{f({supplierId:t.id,by:e,status:s,lines:$.filter(e=>e.q>0).map(e=>({ing:e.i.id,qty:e.q,cost:e.i.cost})),total:M}),C(`${t.name}: ${(0,o.gbp)(M)} (${s}).`)};return(0,m.jsxs)(i.Card,{highlight:!d||y||p?void 0:u.colours.gold,children:[(0,m.jsxs)(i.Row,{style:{justifyContent:'space-between'},children:[(0,m.jsxs)(n.default,{style:{flex:1},children:[(0,m.jsx)(i.T,{weight:"semibold",children:t.name}),(0,m.jsxs)(i.Muted,{children:[t.category," \xb7 min order ",(0,o.gbp)(t.minOrder)]})]}),y?(0,m.jsx)(i.Badge,{kind:"green",label:"ORDERED TODAY"}):d?(0,m.jsx)(i.Badge,{kind:p?'red':'amber',label:p?`CUT-OFF ${t.cutoff} PASSED`:`ORDER BY ${t.cutoff}`}):(0,m.jsx)(i.Badge,{label:`NEXT ${null!=x?c.DAY3[x].toUpperCase():'\u2014'}`})]}),$.length?$.map(e=>(0,m.jsxs)(i.Row,{style:{justifyContent:'space-between'},children:[(0,m.jsxs)(n.default,{style:{flex:1},children:[(0,m.jsx)(i.T,{size:14,children:e.i.name}),(0,m.jsxs)(i.Muted,{children:["On hand ",(0,h.fmtQty)(e.i.onHand,e.i.unit)," \xb7 par ",(0,h.fmtQty)(e.i.par,e.i.unit)]})]}),(0,m.jsx)(i.Button,{small:!0,kind:"ghost",label:"\u2212",accessibilityLabel:`Less ${e.i.name}`,onPress:()=>w(s=>({...s,[`${t.id}:${e.i.id}`]:Math.max(0,e.q-('kg'===e.i.unit?.5:1))}))}),(0,m.jsx)(i.T,{size:13,style:{width:56,textAlign:'center'},children:(0,h.fmtQty)(e.q,e.i.unit)}),(0,m.jsx)(i.Button,{small:!0,kind:"ghost",label:"+",accessibilityLabel:`More ${e.i.name}`,onPress:()=>w(s=>({...s,[`${t.id}:${e.i.id}`]:e.q+('kg'===e.i.unit?.5:1)}))})]},e.i.id)):(0,m.jsx)(i.Muted,{children:"Everything is at par."}),$.length?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)(i.Row,{style:{justifyContent:'space-between'},children:[(0,m.jsxs)(i.T,{weight:"semibold",children:["Estimated ",(0,o.gbp)(M)]}),M{s.default.openURL(`tel:${t.phones[0].replace(/\s/g,'')}`).catch(()=>{}),k('placed (by phone)')}}):null,t.website?(0,m.jsx)(i.Button,{small:!0,kind:"secondary",label:"Open website",onPress:()=>{s.default.openURL(t.website).catch(()=>{}),k('placed (on website)')}}):null]})]}):null,void 0]},t.id)})]})}function b(){const{k:e}=(0,p.useChef)(),t=(0,l.useOwner)(e=>e.suppliers);return(0,m.jsx)(n.default,{style:{gap:8},children:e.orders.map(s=>(0,m.jsxs)(i.Card,{children:[(0,m.jsxs)(i.Row,{style:{justifyContent:'space-between'},children:[(0,m.jsx)(i.T,{weight:"semibold",style:{flex:1},children:t.find(e=>e.id===s.supplierId)?.name}),(0,m.jsx)(i.Badge,{kind:"neutral",label:s.status.toUpperCase()})]}),(0,m.jsxs)(i.Muted,{children:[new Date(s.at).toLocaleString('en-GB',{weekday:'short',day:'numeric',month:'short',hour:'2-digit',minute:'2-digit'})," \xb7 ",s.by,s.total?` \xb7 ${(0,o.gbp)(s.total)}`:'']}),s.lines.length?(0,m.jsx)(i.Muted,{children:s.lines.map(t=>{const s=e.ingredients.find(e=>e.id===t.ing);return`${(0,h.fmtQty)(t.qty,s?.unit??'')} ${s?.name??t.ing}`}).join(', ')}):null]},s.id))})}},946,[12,221,109,790,802,788,793,797,848,941,942,943,6]);
+__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.StockScreen=function({initial:e="levels"}){const[i,n]=(0,t.useState)(e);return(0,p.jsxs)(s.default,{style:{gap:12},children:[(0,p.jsx)(u.Seg,{value:i,onChange:n,options:[{id:'levels',label:'Stock levels'},{id:'take',label:'Stock take'},{id:'deliveries',label:'Deliveries in'}]}),'levels'===i?(0,p.jsx)(x,{}):'take'===i?(0,p.jsx)(b,{}):(0,p.jsx)(j,{})]})};var t=_r(_d[0]),i=e(_r(_d[1])),n=e(_r(_d[2])),s=e(_r(_d[3])),l=_r(_d[4]),d=_r(_d[5]),r=_r(_d[6]),o=_r(_d[7]),c=_r(_d[8]),u=_r(_d[9]),h=_r(_d[10]),p=_r(_d[11]);function x(){const{k:e}=(0,u.useChef)(),i=(0,d.useOwner)(e=>e.suppliers),[n,h]=(0,t.useState)('all'),x=e.ingredients.filter(e=>e.onHand<=0),b=e.ingredients.filter(e=>(0,u.isLow)(e.onHand,e.par)),j='alerts'===n?[...x,...b]:e.ingredients,f=i.filter(e=>j.some(t=>t.supplierId===e.id));return(0,p.jsxs)(s.default,{style:{gap:10},children:[(0,p.jsxs)(l.Row,{wrap:!0,gap:10,children:[(0,p.jsx)(u.Tile,{label:"Stock value (at cost)",value:(0,r.gbp)((0,u.stockValue)(e.ingredients)),sub:`${e.ingredients.length} ingredients`}),(0,p.jsx)(u.Tile,{label:"Low or out",value:`${b.length+x.length}`,sub:`${x.length} out \xb7 ${b.length} below half par`,tone:x.length?'red':b.length?'amber':'green',onPress:()=>h('alerts')})]}),x.length?(0,p.jsxs)(l.Banner,{kind:"danger",title:"Out of stock",children:[x.map(e=>e.name).join(', '),". 86 the dishes that need it in Kitchen \u203a Live & 86, or order now."]}):null,(0,p.jsx)(u.Seg,{value:n,onChange:h,options:[{id:'all',label:'All'},{id:'alerts',label:'Alerts only'}]}),f.map(e=>(0,p.jsxs)(l.Card,{children:[(0,p.jsxs)(l.T,{weight:"semibold",children:[e.category," \xb7 ",e.name]}),j.filter(t=>t.supplierId===e.id).map(e=>{const t=e.onHand<=0?'out':(0,u.isLow)(e.onHand,e.par)?'low':'ok';return(0,p.jsxs)(s.default,{style:{gap:4,paddingVertical:4},accessibilityLabel:`${e.name} ${(0,c.fmtQty)(e.onHand,e.unit)} of par ${(0,c.fmtQty)(e.par,e.unit)}`,children:[(0,p.jsxs)(l.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsx)(l.T,{style:{flex:1},children:e.name}),'out'===t?(0,p.jsx)(l.Badge,{kind:"red",label:"OUT"}):'low'===t?(0,p.jsx)(l.Badge,{kind:"amber",label:"LOW"}):null,(0,p.jsxs)(l.T,{size:13,colour:o.colours.muted,children:[(0,c.fmtQty)(e.onHand,e.unit)," / par ",(0,c.fmtQty)(e.par,e.unit)]})]}),(0,p.jsx)(u.Bar,{pct:e.onHand/e.par*100,colour:'out'===t?o.colours.red:'low'===t?o.colours.amber:o.colours.gold}),(0,p.jsxs)(l.Muted,{children:[(0,r.gbp)(e.cost)," per ",e.unit," \xb7 value ",(0,r.gbp)(Math.round(e.onHand*e.cost))]})]},e.id)})]},e.id))]})}function b(){const{k:e,me:i}=(0,u.useChef)(),d=(0,h.useKitchen)(e=>e.saveStockTake),[x,b]=(0,t.useState)({}),[j,f]=(0,t.useState)(''),v=e.ingredients.map(e=>{const t=x[e.id],i=void 0===t||''===t?void 0:Number(t.replace(',','.')),n=void 0===i||Number.isNaN(i)?void 0:i-e.onHand;return{i:e,counted:i,variance:n,cost:void 0===n?0:Math.round(n*e.cost)}}),y=v.filter(e=>void 0!==e.variance),k=y.reduce((e,t)=>e+t.cost,0);return(0,p.jsxs)(s.default,{style:{gap:10},children:[(0,p.jsx)(l.Muted,{children:"Count what's on the shelves. Expected = last count + deliveries \u2212 waste. Variance shows what's unexplained (portioning, theft, missed waste)."}),e.stockTakes[0]?(0,p.jsxs)(l.Muted,{children:["Last stock take ",new Date(e.stockTakes[0].at).toLocaleDateString('en-GB')," by ",e.stockTakes[0].by,": variance ",(0,r.gbp)(Math.round(e.stockTakes[0].lines.reduce((e,t)=>e+(t.counted-t.expected)*t.cost,0))),"."]}):null,(0,p.jsx)(l.Card,{children:v.map(({i:e,variance:t,cost:i})=>(0,p.jsxs)(l.Row,{style:{justifyContent:'space-between',paddingVertical:3},children:[(0,p.jsxs)(s.default,{style:{flex:1},children:[(0,p.jsx)(l.T,{size:14,children:e.name}),(0,p.jsxs)(l.Muted,{children:["Expected ",(0,c.fmtQty)(e.onHand,e.unit)]})]}),(0,p.jsx)(n.default,{accessibilityLabel:`Count ${e.name}`,keyboardType:"decimal-pad",placeholder:"count",placeholderTextColor:o.colours.muted,value:x[e.id]??'',onChangeText:t=>b(i=>({...i,[e.id]:t})),style:{width:72,borderWidth:1,borderColor:o.colours.border,borderRadius:8,paddingHorizontal:8,paddingVertical:6,color:o.colours.text,textAlign:'right'}}),(0,p.jsx)(s.default,{style:{width:86,alignItems:'flex-end'},children:void 0===t?(0,p.jsx)(l.Muted,{children:"\u2014"}):(0,p.jsxs)(l.T,{size:13,colour:Math.abs(t)<.001?o.colours.green:t<0?o.colours.red:o.colours.amber,children:[t>0?'+':'',(0,c.fmtQty)(Math.round(100*t)/100,e.unit),'\n',(0,r.gbp)(i)]})})]},e.id))}),(0,p.jsxs)(l.Banner,{kind:k<0?'warn':'info',title:`Variance so far: ${(0,r.gbp)(k)}`,children:[y.length," of ",e.ingredients.length," counted."]}),(0,p.jsx)(l.Button,{label:"Save stock take",disabled:!y.length,onPress:()=>{const e={};y.forEach(t=>{e[t.i.id]=t.counted}),d(e,i),b({}),f(`Saved: ${y.length} items, variance ${(0,r.gbp)(k)}. Stock levels updated.`)}}),j?(0,p.jsx)(l.Banner,{kind:"success",title:"Stock take saved",children:j}):null]})}function j(){const{k:e,me:n}=(0,u.useChef)(),r=(0,d.useOwner)(e=>e.suppliers),[c,h]=(0,t.useState)(e.deliveries.find(e=>'expected'===e.status)?.id??null);return(0,p.jsxs)(s.default,{style:{gap:10},children:[(0,p.jsx)(l.Muted,{children:"Check each delivery against the order: count it in, check the invoice price, flag shorts and price changes. Accepting adds it to stock and updates costs (and GP)."}),e.deliveries.map(e=>{const t=r.find(t=>t.id===e.supplierId);return(0,p.jsxs)(l.Card,{highlight:c===e.id?o.colours.gold:void 0,children:[(0,p.jsx)(i.default,{accessibilityRole:"button",accessibilityLabel:`Delivery from ${t?.name}`,onPress:()=>h(c===e.id?null:e.id),children:(0,p.jsxs)(l.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsxs)(s.default,{style:{flex:1},children:[(0,p.jsx)(l.T,{weight:"semibold",children:t?.name??'Supplier'}),(0,p.jsx)(l.Muted,{children:'expected'===e.status?`Due ${e.due} \xb7 ${e.lines.length} lines`:`Accepted by ${e.checkedBy} ${e.at?new Date(e.at).toLocaleTimeString('en-GB',{hour:'2-digit',minute:'2-digit'}):''}`})]}),(0,p.jsx)(l.Badge,{kind:'expected'===e.status?'amber':'green',label:'expected'===e.status?'TO CHECK':'ACCEPTED'})]})}),c===e.id?(0,p.jsx)(f,{id:e.id,me:n}):null]},e.id)})]})}function f({id:e,me:i}){const d=(0,h.useKitchen)(),u=d.deliveries.find(t=>t.id===e),[x,b]=(0,t.useState)(u.lines.map(e=>({...e}))),j=(e,t)=>b(i=>i.map(i=>i.ing===e?{...i,...t}:i)),f='expected'!==u.status,v=(0,t.useMemo)(()=>x.map(e=>{const t=d.ingredients.find(t=>t.id===e.ing),i=e.receivede.short>0),k=v.filter(e=>Math.abs(e.pct)>=.5),w=x.reduce((e,t)=>e+t.received*t.price,0);return(0,p.jsxs)(s.default,{style:{gap:8,marginTop:8},children:[v.map(({l:e,i:t,short:i,pct:d})=>(0,p.jsxs)(s.default,{style:{gap:4,borderTopWidth:1,borderColor:o.colours.border,paddingTop:6},children:[(0,p.jsxs)(l.Row,{style:{justifyContent:'space-between'},children:[(0,p.jsx)(l.T,{style:{flex:1},weight:"medium",children:t.name}),i?(0,p.jsx)(l.Badge,{kind:"red",label:`SHORT ${(0,c.fmtQty)(i,t.unit)}`}):null,Math.abs(d)>=.5?(0,p.jsx)(l.Badge,{kind:"amber",label:`PRICE ${d>0?'+':''}${d.toFixed(0)}%`}):null]}),(0,p.jsxs)(l.Row,{wrap:!0,gap:8,children:[(0,p.jsxs)(l.Muted,{children:["Ordered ",(0,c.fmtQty)(e.ordered,t.unit)]}),(0,p.jsxs)(l.Row,{gap:4,children:[(0,p.jsx)(l.Muted,{children:"Received"}),(0,p.jsx)(n.default,{editable:!f,accessibilityLabel:`Received ${t.name}`,keyboardType:"decimal-pad",value:String(e.received),onChangeText:t=>j(e.ing,{received:Number(t.replace(',','.'))||0}),style:{width:60,borderWidth:1,borderColor:o.colours.border,borderRadius:8,paddingHorizontal:6,paddingVertical:4,color:o.colours.text,textAlign:'right'}})]}),(0,p.jsxs)(l.Row,{gap:4,children:[(0,p.jsxs)(l.Muted,{children:["Invoice \xa3/",t.unit]}),(0,p.jsx)(n.default,{editable:!f,accessibilityLabel:`Invoice price ${t.name}`,keyboardType:"decimal-pad",value:(e.price/100).toFixed(2),onChangeText:t=>j(e.ing,{price:Math.round(100*(Number(t.replace(',','.'))||0))}),style:{width:70,borderWidth:1,borderColor:o.colours.border,borderRadius:8,paddingHorizontal:6,paddingVertical:4,color:o.colours.text,textAlign:'right'}})]})]}),(0,p.jsxs)(l.Muted,{children:["Last cost ",(0,r.gbp)(t.cost)," per ",t.unit]})]},e.ing)),(0,p.jsxs)(l.T,{weight:"semibold",children:["Invoice total ",(0,r.gbp)(Math.round(w))]}),y.length?(0,p.jsxs)(l.Banner,{kind:"warn",title:"Shorts to chase",children:[y.map(e=>`${e.i.name}: ${(0,c.fmtQty)(e.short,e.i.unit)} short`).join(' \xb7 '),". Ask the supplier for a credit note."]}):null,k.length?(0,p.jsxs)(l.Banner,{kind:"warn",title:"Price changes",children:[k.map(e=>`${e.i.name} ${e.pct>0?'+':''}${e.pct.toFixed(0)}%`).join(' \xb7 '),". Check GP \u203a Price changes once accepted."]}):null,f?(0,p.jsx)(l.Muted,{children:u.note?`Noted: ${u.note}.`:'No issues noted.'}):(0,p.jsx)(l.Button,{label:"Accept delivery into stock",testID:"accept-delivery",onPress:()=>d.acceptDelivery(e,x,i,[y.length?`${y.length} short`:'',k.length?`${k.length} price changes`:''].filter(Boolean).join(', '))})]})}},947,[12,245,255,109,790,802,793,797,941,942,943,6]);
+__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"inlineStyles",{enumerable:!0,get:function(){return n.inlineStyles}}),Object.defineProperty(_e,"loadLocalRawResource",{enumerable:!0,get:function(){return n.loadLocalRawResource}}),Object.defineProperty(_e,"LocalSvg",{enumerable:!0,get:function(){return n.LocalSvg}}),Object.defineProperty(_e,"SvgCss",{enumerable:!0,get:function(){return n.SvgCss}}),Object.defineProperty(_e,"SvgCssUri",{enumerable:!0,get:function(){return n.SvgCssUri}}),Object.defineProperty(_e,"SvgWithCss",{enumerable:!0,get:function(){return n.SvgWithCss}}),Object.defineProperty(_e,"SvgWithCssUri",{enumerable:!0,get:function(){return n.SvgWithCssUri}}),Object.defineProperty(_e,"WithLocalSvg",{enumerable:!0,get:function(){return n.WithLocalSvg}}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(_e,"camelCase",{enumerable:!0,get:function(){return e.camelCase}}),Object.defineProperty(_e,"fetchText",{enumerable:!0,get:function(){return t.fetchText}}),Object.defineProperty(_e,"parse",{enumerable:!0,get:function(){return e.parse}}),Object.defineProperty(_e,"SvgAst",{enumerable:!0,get:function(){return e.SvgAst}}),Object.defineProperty(_e,"SvgFromUri",{enumerable:!0,get:function(){return e.SvgFromUri}}),Object.defineProperty(_e,"SvgFromXml",{enumerable:!0,get:function(){return e.SvgFromXml}}),Object.defineProperty(_e,"SvgUri",{enumerable:!0,get:function(){return e.SvgUri}}),Object.defineProperty(_e,"SvgXml",{enumerable:!0,get:function(){return e.SvgXml}});var e=r(d[0]),t=r(d[1]),n=r(d[2]),u=r(d[3]);Object.keys(u).forEach(function(e){'default'===e||Object.prototype.hasOwnProperty.call(_e,e)||Object.defineProperty(_e,e,{enumerable:!0,get:function(){return u[e]}})});var o=r(d[4]);Object.keys(o).forEach(function(e){'default'===e||Object.prototype.hasOwnProperty.call(_e,e)||Object.defineProperty(_e,e,{enumerable:!0,get:function(){return o[e]}})});var c,f=(c=o)&&c.__esModule?c:{default:c}},948,[949,950,969,970,952]);
+__d(function(g,_r,_i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.SvgAst=c,_e.SvgXml=l,_e.SvgUri=function(r){const{onError:o=i,uri:s,onLoad:c,fallback:u}=r,[f,p]=(0,t.useState)(null),[d,h]=(0,t.useState)(!1);if((0,t.useEffect)(()=>{s?(0,n.fetchText)(s).then(t=>{p(t),d&&h(!1),c?.()}).catch(t=>{o(t),h(!0)}):p(null)},[o,s,c]),d)return u??null;return e.createElement(l,{xml:f,override:r,fallback:u})},Object.defineProperty(_e,"SvgFromXml",{enumerable:!0,get:function(){return u}}),Object.defineProperty(_e,"SvgFromUri",{enumerable:!0,get:function(){return f}}),Object.defineProperty(_e,"camelCase",{enumerable:!0,get:function(){return d}}),_e.getStyle=h,_e.astToReact=x,_e.parse=j,Object.defineProperty(_e,"tags",{enumerable:!0,get:function(){return r.tags}});var t=_r(_d[0]),e=(function(t){if(t&&t.__esModule)return t;var e={};return t&&Object.keys(t).forEach(function(n){if('default'!==n){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}}),e.default=t,e})(t),n=_r(_d[1]),r=_r(_d[2]);function o(){return o=Object.assign?Object.assign.bind():function(t){for(var e=1;enull!==o?j(o):null,[o]);return e.createElement(c,{ast:r,override:s||n})}catch(t){return r(t),l??null}}class u extends t.Component{state={ast:null};componentDidMount(){this.parse(this.props.xml)}componentDidUpdate(t){const{xml:e}=this.props;e!==t.xml&&this.parse(e)}parse(t){const{onError:e=i}=this.props;try{this.setState({ast:t?j(t):null})}catch(t){const n=t;e({...n,message:`[RNSVG] Couldn't parse SVG, reason: ${n.message}`})}}render(){const{props:t,state:{ast:n}}=this;return e.createElement(c,{ast:n,override:t.override||t})}}class f extends t.Component{state={xml:null};componentDidMount(){this.fetch(this.props.uri)}componentDidUpdate(t){const{uri:e}=this.props;e!==t.uri&&this.fetch(e)}async fetch(t){try{this.setState({xml:t?await(0,n.fetchText)(t):null})}catch(t){console.error(t)}}render(){const{props:t,state:{xml:n}}=this;return e.createElement(u,{xml:n,override:t,onError:t.onError})}}const p=(t,e)=>e.toUpperCase(),d=t=>t.replace(/[:-]([a-z])/g,p);function h(t){const e={},n=t.split(';').filter(t=>t.trim()),{length:r}=n;for(let t=0;tb(' ',t.length);function v(t,e){const n=t.split('\n'),r=n.length;let o=e,s=0;for(;s=t))break;o-=t}const c=t.slice(0,e).replace(/^\t+/,y),i=/(^|\n).*$/.exec(c),l=i&&i[0]||'',u=t.slice(e),f=/.*(\n|$)/.exec(u);return{line:s,column:o,snippet:`${l}${f&&f[0]}\n${b(' ',l.length)}^`}}const E=/[a-zA-Z0-9:_-]/,O=/
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+