@tabres/react 1.0.52 → 1.0.53

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/dist/index.esm.js +1 -1
  2. package/dist/index.esm.js.map +1 -1
  3. package/dist/index.js +1 -1
  4. package/dist/index.js.map +1 -1
  5. package/dist/models/index.d.ts +1 -0
  6. package/dist/models/index.esm.js.map +1 -1
  7. package/dist/models/index.js.map +1 -1
  8. package/dist/models/models/index.d.ts +1 -0
  9. package/dist/models/modules/addon/models.d.ts +3 -2
  10. package/dist/models/modules/branch/models.d.ts +2 -1
  11. package/dist/models/modules/category/models.d.ts +2 -1
  12. package/dist/models/modules/localization/models.d.ts +10 -0
  13. package/dist/models/modules/localization/utils.d.ts +22 -0
  14. package/dist/models/modules/menu/models.d.ts +3 -2
  15. package/dist/models/modules/order/models.d.ts +2 -1
  16. package/dist/models/modules/product/models.d.ts +3 -2
  17. package/dist/models/modules/product/utils.d.ts +1 -1
  18. package/dist/modules/addon/models.d.ts +3 -2
  19. package/dist/modules/addon/utils.d.ts +8 -3
  20. package/dist/modules/branch/models.d.ts +2 -1
  21. package/dist/modules/category/models.d.ts +2 -1
  22. package/dist/modules/localization/index.d.ts +2 -0
  23. package/dist/modules/localization/models.d.ts +10 -0
  24. package/dist/modules/localization/utils.d.ts +22 -0
  25. package/dist/modules/localization/utils.test.d.ts +1 -0
  26. package/dist/modules/menu/models.d.ts +3 -2
  27. package/dist/modules/order/models.d.ts +2 -1
  28. package/dist/modules/product/models.d.ts +3 -2
  29. package/dist/modules/product/utils.d.ts +1 -1
  30. package/dist/utils/index.d.ts +1 -0
  31. package/dist/utils/index.esm.js +1 -1
  32. package/dist/utils/index.esm.js.map +1 -1
  33. package/dist/utils/index.js +1 -1
  34. package/dist/utils/index.js.map +1 -1
  35. package/dist/utils/models/index.d.ts +1 -0
  36. package/dist/utils/modules/addon/models.d.ts +3 -2
  37. package/dist/utils/modules/addon/utils.d.ts +8 -3
  38. package/dist/utils/modules/branch/models.d.ts +2 -1
  39. package/dist/utils/modules/category/models.d.ts +2 -1
  40. package/dist/utils/modules/localization/models.d.ts +10 -0
  41. package/dist/utils/modules/localization/utils.d.ts +22 -0
  42. package/dist/utils/modules/menu/models.d.ts +3 -2
  43. package/dist/utils/modules/order/models.d.ts +2 -1
  44. package/dist/utils/modules/product/models.d.ts +3 -2
  45. package/dist/utils/modules/product/utils.d.ts +1 -1
  46. package/dist/utils/utils/index.d.ts +1 -0
  47. package/package.json +1 -1
@@ -1,5 +1,6 @@
1
1
  import * as customerModels from "../customer/models";
2
2
  import * as productModels from "../product/models";
3
+ import { LocalizedText } from "src/modules/localization/models";
3
4
  export declare enum OrderType {
4
5
  DINE_IN = "DINE_IN",
5
6
  PICK_UP = "PICK_UP",
@@ -178,7 +179,7 @@ export interface CalculatePreviewRequest {
178
179
  }
179
180
  export interface CalculatePreviewTax {
180
181
  branchTaxId: number;
181
- name: Record<string, string>;
182
+ name: LocalizedText;
182
183
  rate: number;
183
184
  type: "percentage" | "fixed";
184
185
  addToListingPrice: boolean;
@@ -1,4 +1,5 @@
1
1
  import { MenuAddon } from "../addon/models";
2
+ import { LocalizedText } from "src/modules/localization/models";
2
3
  export interface LocalizedContent {
3
4
  name: string;
4
5
  description: string;
@@ -13,7 +14,7 @@ export interface ProductVariant {
13
14
  */
14
15
  listingPrice: number;
15
16
  /** Title keyed by language code, e.g. { en: "Large", az: "Böyük" }. */
16
- title: Record<string, string>;
17
+ title: LocalizedText;
17
18
  productId?: number;
18
19
  remove?: boolean;
19
20
  }
@@ -65,7 +66,7 @@ export interface Product {
65
66
  export interface AllergenDetail {
66
67
  code: AllergenCode;
67
68
  /** Label keyed by language code, e.g. `{ en: "Gluten", az: "Qlüten" }`. */
68
- translations: Record<string, string>;
69
+ translations: LocalizedText;
69
70
  }
70
71
  /**
71
72
  * An allergen code as it comes off the wire. Deliberately open: the API owns
@@ -1,5 +1,5 @@
1
- import { AllergenCode, LocalizedContent, Product, ProductVariant, SellUnitType } from "./models";
2
1
  import { MenuAddon } from "src/modules/addon/models";
2
+ import { AllergenCode, LocalizedContent, Product, ProductVariant, SellUnitType } from "./models";
3
3
  export declare const getProductTranslation: (product: Pick<Product, "translations">, language: string) => LocalizedContent;
4
4
  export declare const getProductVariant: (product: Pick<Product, "variants">, variantId: number) => ProductVariant;
5
5
  export declare const getProductVariantTranslation: (variant: ProductVariant, language: string) => string;
@@ -6,5 +6,6 @@ export * from "../modules/feature/utils";
6
6
  export * from "../modules/view/utils";
7
7
  export * from "../modules/category/utils";
8
8
  export * from "../modules/menu/utils";
9
+ export * from "../modules/localization/utils";
9
10
  export * from "../modules/user/utils";
10
11
  export * from "../modules/pos/utils";
@@ -1,2 +1,2 @@
1
- import{priceFormatter as e,isEmpty as E,sortNumbers as a,checkIsValidEmail as n,getQueryParam as o}from"@sorocraft/js-utils";import{HourglassHalf as r,FileCheck as i,Chef as l,Delivery as s,BagCheck as t,Check as _}from"@sorocraft/ui/icons";const S=(e,E)=>{var a;return(null===(a=null==e?void 0:e.title)||void 0===a?void 0:a[E])||""},A=(e,E)=>{var a;return(null===(a=null==e?void 0:e.title)||void 0===a?void 0:a[E])||""},O=(e,E,a)=>{var n;if(Array.isArray(E))return(e||[]).filter(({id:e})=>E.includes(e)).map(({title:e})=>(null==e?void 0:e[a])||"").filter(Boolean).join(", ");{const o=(e||[]).find(({id:e})=>e===E);return(null===(n=null==o?void 0:o.title)||void 0===n?void 0:n[a])||""}},T=(e,E)=>{var a;return(null===(a=null==e?void 0:e.title)||void 0===a?void 0:a[E])||""};var c,R,P;!function(e){e.GLUTEN="GLUTEN",e.CRUSTACEANS="CRUSTACEANS",e.EGGS="EGGS",e.FISH="FISH",e.PEANUTS="PEANUTS",e.SOY="SOY",e.MILK="MILK",e.TREE_NUTS="TREE_NUTS",e.CELERY="CELERY",e.MUSTARD="MUSTARD",e.SESAME="SESAME",e.SULPHITES="SULPHITES",e.LUPIN="LUPIN",e.MOLLUSCS="MOLLUSCS",e.BUCKWHEAT="BUCKWHEAT"}(c||(c={})),function(e){e.LIST="list",e.GRID="grid"}(R||(R={})),function(e){e.PIECE="PIECE",e.WEIGHT="WEIGHT",e.VOLUME="VOLUME"}(P||(P={}));const d=e=>{var E,a;return null!==(a=null!==(E=null==e?void 0:e.listingPrice)&&void 0!==E?E:null==e?void 0:e.price)&&void 0!==a?a:0},I=(E,a,n)=>{const o=d(E);return e(o,a,n)},u=(E,a,n)=>{const o=d(E);return e(o,a,n)},D=(E,a,n)=>{const o=d(E);return e(o,a,n)};var N;!function(e){e.SINGLE="SINGLE",e.MULTIPLE="MULTIPLE"}(N||(N={}));const w=(e,E={})=>{let a=0;for(const n of(null==e?void 0:e.addons)||[]){const{id:e,selectType:o,options:r}=n;if(!Object.prototype.hasOwnProperty.call(E,e))continue;const i=E[e],l=o===N.SINGLE?[i]:i||[];for(const e of l){const E=(r||[]).find(({id:E})=>E===e);E&&(a+=d(E))}}return a},m=({product:E,quantity:a,language:n,currency:o,variantId:r,selectedAddons:i})=>{if(!E||0===Object.keys(E).length)return e(0,o,n);const l=r?(E.variants||[]).find(({id:e})=>e===r):void 0,s=d(r?l:E),t=w(E,i);return e((s+t)*a,o,n)},C=(e,E)=>{var a;return(null===(a=null==e?void 0:e.translations)||void 0===a?void 0:a[E])||{}},U=(e,E)=>{var a,n;return(null===(n=null===(a=null==e?void 0:e.variants)||void 0===a?void 0:a.find)||void 0===n?void 0:n.call(a,e=>e.id===E))||{}},L=(e,E)=>{var a;return(null===(a=null==e?void 0:e.title)||void 0===a?void 0:a[E])||""},M=(e,E)=>((null==e?void 0:e.addons)||[]).find(({id:e})=>e===E)||{},V=(e,E,a)=>a&&(null==e?void 0:e[a])||(null==e?void 0:e.en)||Object.values(e||{}).find(Boolean)||(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase().replace(/_/g," "))(E),g=(e,E)=>((null==e?void 0:e.allergenDetails)||[]).map(({code:e,translations:a})=>({code:e,label:V(a,e,E)})),W=e=>{switch(e){case P.WEIGHT:return" / kg";case P.VOLUME:return" / l";default:return""}},B=e=>{switch(e){case P.WEIGHT:return{"50gr":.05,"100gr":.1,"150gr":.15,"200gr":.2,"250gr":.25,"300gr":.3,"350gr":.35,"400gr":.4,"450gr":.45,"500gr":.5,"600gr":.6,"700gr":.7,"750gr":.75,"800gr":.8,"850gr":.85,"900gr":.9,"950gr":.95,"1kg":1,"2kg":2,"5kg":5,"10kg":10,"20kg":20};case P.VOLUME:return{"50ml":.05,"100ml":.1,"150ml":.15,"200ml":.2,"250ml":.25,"300ml":.3,"350ml":.35,"400ml":.4,"450ml":.45,"500ml":.5,"600ml":.6,"700ml":.7,"750ml":.75,"800ml":.8,"850ml":.85,"900ml":.9,"950ml":.95,"1l":1,"2l":2,"5l":5,"10l":10,"20l":20};default:return{}}};var G,k,H,p,v,Y;"function"==typeof SuppressedError&&SuppressedError,function(e){e.DINE_IN="DINE_IN",e.PICK_UP="PICK_UP",e.DELIVERY="DELIVERY"}(G||(G={})),function(e){e.DRAFT="DRAFT",e.PENDING="PENDING",e.CONFIRMED="CONFIRMED",e.PREPARING="PREPARING",e.READY="READY",e.OUT_FOR_DELIVERY="OUT_FOR_DELIVERY",e.DELIVERED="DELIVERED",e.COMPLETED="COMPLETED",e.CANCELLED="CANCELLED",e.FAILED="FAILED"}(k||(k={})),function(e){e.PENDING="PENDING",e.PREPARING="PREPARING",e.READY="READY",e.SERVED="SERVED"}(H||(H={})),function(e){e.CASH="CASH",e.CARD="CARD",e.BANK_TRANSFER="BANK_TRANSFER",e.MOBILE="MOBILE",e.QR="QR",e.VOUCHER="VOUCHER",e.COMP="COMP",e.MIXED="MIXED"}(p||(p={})),function(e){e.CART="CART",e.DETAILS="DETAILS",e.COMPLETED="COMPLETED"}(v||(v={})),p.CASH,v.CART,v.DETAILS,v.COMPLETED,p.CASH,p.CARD,p.BANK_TRANSFER,p.MOBILE,p.QR,p.VOUCHER,p.CASH,p.CARD,function(e){e.FIELD_REQUIRED_ERROR="This field is required",e.TABLE_NOT_SELECTED="Please select a table",e.ADDRESS_IS_EMPTY="Please enter an address",e.EMPTY_ITEMS="Please choose product",e.BRANCH_NOT_SELECTED="Please select a branch"}(Y||(Y={}));const q=e=>{var E,a;const{price:n,variant:o,addons:r,quantity:i}=e||{},l=null!==(a=null!==(E=null==o?void 0:o.price)&&void 0!==E?E:n)&&void 0!==a?a:0,s=(r||[]).reduce((e,E)=>e+((null==E?void 0:E.options)||[]).reduce((e,E)=>{var a;return e+(null!==(a=null==E?void 0:E.price)&&void 0!==a?a:0)},0),0);return(l+s)*(null!=i?i:1)},b=(E,a,n)=>{const o=q(E);return e(o,a,n)},f=(e,E,n)=>{if(!e)throw new Error("Product ID is required");let o=`${e}`;E&&(o+=`-${E}`);const r=Object.entries(n||{}).map(([e,E])=>{if(!e||!E)return null;const n=Array.isArray(E)?a(E).filter(Boolean).join("-"):`${E}`;return n?`${e}-${n}`:null}).filter(Boolean).join("-");return r&&(o+=`-${r}`),o},h=e=>{const E={};for(const{addonId:a,options:n=[]}of e.addons||[]){const e=n.map(({optionId:e})=>e);E[a]=1===e.length?e[0]:e}return E},y=e=>{switch(e){case k.COMPLETED:return _;case k.DELIVERED:return t;case k.OUT_FOR_DELIVERY:return s;case k.PREPARING:return l;case k.CONFIRMED:return i;case k.PENDING:default:return r}},F=(e=[],a={})=>Object.entries(a).map(([a,n])=>{const o=Number(a),r=Array.isArray(n)?n:[n],i=e.find(e=>e.id===o);if(E(i))return{addonId:o,options:[]};const l=(i.options||[]).filter(e=>r.includes(e.id)).map(e=>{var E;return{optionId:e.id,price:null!==(E=e.listingPrice)&&void 0!==E?E:e.price}});return{addonId:o,options:l}}),K=(e,E,a)=>{if(!e)return null;const{deliveryOrderEnabled:n,dineInOrderEnabled:o,pickupOrderEnabled:r}=e;return n&&a?G.DELIVERY:o&&E?G.DINE_IN:r&&E?G.PICK_UP:null},Q=e=>{if(!e||"object"!=typeof e)return!1;const E=e;return"number"==typeof E.totalPriceWithoutTax&&"number"==typeof E.totalPriceWithTax&&"number"==typeof E.totalPriceWithTaxAndFees&&"number"==typeof E.totalTax&&"number"==typeof E.deliveryFee&&"number"==typeof E.serviceFee&&Array.isArray(E.items)&&Array.isArray(E.taxes)},j=e=>{if(E(e))return;const a=Object.entries(e).filter(([,e])=>null!=e&&""!==e);if(0===a.length)return;const n=Object.fromEntries(a),{latitude:o,longitude:r,floor:i}=n,l=function(e,E){var a={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&E.indexOf(n)<0&&(a[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)E.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(a[n[o]]=e[n[o]])}return a}(n,["latitude","longitude","floor"]);return Object.assign(Object.assign(Object.assign(Object.assign({},l),null!=i?{floor:Number(i)}:{}),null!=o?{latitude:`${o}`}:{}),null!=r?{longitude:`${r}`}:{})},$=(e,E)=>!e||e<=0||!E||E<=0?0:Math.round(e*E)/100,Z=e=>e.toFixed(2),x=e=>{switch(e){case"customer":return Y.ADDRESS_IS_EMPTY;case"tableId":return Y.TABLE_NOT_SELECTED;case"items":return Y.EMPTY_ITEMS;case"branchId":return Y.BRANCH_NOT_SELECTED;default:return Y.FIELD_REQUIRED_ERROR}};var z,J;!function(e){e.PHONE="PHONE",e.OTP="OTP",e.EMAIL="EMAIL"}(z||(z={})),function(e){e.HOME="HOME",e.WORK="WORK",e.TRAVEL="TRAVEL"}(J||(J={}));const X=e=>`${e.countryCode}${e.phoneNumber}`.replaceAll("+",""),ee=(e,E)=>{const a={},{email:o,otp:r}=e||{};switch(E){case z.OTP:o&&n(o)||(a.email="Invalid Email Address"),r&&6===r.length||(a.otp="Invalid OTP");break;case z.EMAIL:o&&n(o)||(a.email="Invalid Email Address")}return a},Ee=e=>{const E={},{countryCode:a,cityName:n,street:o,houseNumber:r}=e||{};return a||(E.countryCode="COUNTRY_REQUIRED"),n||(E.cityName="CITY_REQUIRED"),o||(E.street="STREET_REQUIRED"),r||(E.houseNumber="STREET_NUMBER_REQUIRED"),E},ae=e=>(e||[]).filter(Boolean).join(", "),ne=(e,E,a)=>[e,[E,a].filter(Boolean).join("/")].filter(Boolean).join(" ");var oe,re;!function(e){e.UPLOAD_VIDEO="UPLOAD_VIDEO"}(oe||(oe={})),function(e){e.ALPHA="ALPHA",e.BETA="BETA",e.ALL="ALL"}(re||(re={}));const ie={[re.ALPHA]:[oe.UPLOAD_VIDEO],[re.BETA]:[],[re.ALL]:[]},le=(e,E)=>{if("1"===o(e))return!0;return(E===re.ALPHA?[re.ALPHA,re.BETA,re.ALL]:E===re.BETA?[re.BETA,re.ALL]:[re.ALL]).some(E=>{var a;return null===(a=ie[E])||void 0===a?void 0:a.includes(e)})},se="tabres.com",te="https://images.tabres.com",_e={994:e=>{const E=["50","51","10","55","99","70","77","60"];return new RegExp(`^(${E.join("|")})\\d{7}$`).test(e)?{isValid:!0}:{isValid:!1,error:`Azerbaijani numbers must be 9 digits and start with ${E.join(", ")}`}},31:e=>/^\d{9}$/.test(e)?{isValid:!0}:{isValid:!1,error:"Dutch numbers must be exactly 9 digits"}};function Se(e){if(!e)return{isValid:!1,error:"FIELD_REQUIRED"};const E=e.replace(/\D/g,""),a=E.startsWith("994")?"994":E.startsWith("31")?"31":null;if(!a)return{isValid:!1,error:"Unsupported country code"};const n=E.slice(a.length);return(0,_e[a])(n)}const Ae=(e,E)=>{const a=E||"en";return"localhost:3000"===e?{url:`http://localhost:3000/${a}`,domain:se}:{url:`https://${se}/${a}`,domain:se}},Oe=(e,E)=>`https://app.tabres.com/auth/register?lang=${e}&utm_source=${E}`,Te=e=>e?e.includes("base64")||e.startsWith("https://")?e:`${te}/${e}`:"",ce=e=>e?e.includes("base64")||e.startsWith("https://")?e:`${te}/${e}`:"https://images.tabres.com/no-photo-128.webp",Re=e=>e?e.includes("base64")||e.startsWith("https://")?e:`${te}/${e}`:"https://images.tabres.com/tabres-doodle.webp",Pe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",de=(e,E,a)=>Pe.charAt(e>>2)+Pe.charAt((3&e)<<4|E>>4)+Pe.charAt((15&E)<<2|a>>6)+Pe.charAt(63&a),Ie=(e,E,a)=>`data:image/gif;base64,R0lGODlhAQABAPAA${de(0,e,E)+de(a,255,255)}/yH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==`,ue=e=>e?e.includes("base64")||e.startsWith("https://")?e:`https://videos.tabres.com/${e}`:"",De=(e,E)=>{const a=parseInt(e.replace("#",""),16),n=(a>>16&255)/255,o=(a>>8&255)/255,r=(255&a)/255,i=Math.max(n,o,r),l=Math.min(n,o,r),s=(i+l)/2;let t=0,_=0;if(i!==l){const e=i-l;switch(_=s>.5?e/(2-i-l):e/(i+l),i){case n:t=(o-r)/e+(o<r?6:0);break;case o:t=(r-n)/e+2;break;case r:t=(n-o)/e+4}t/=6}const S=Math.max(0,Math.min(1,s+E/100)),A=(e,E,a)=>(a<0&&(a+=1),a>1&&(a-=1),a<1/6?e+6*(E-e)*a:a<.5?E:a<2/3?e+(E-e)*(2/3-a)*6:e);let O=S,T=S,c=S;if(0!==_){const e=S<.5?S*(1+_):S+_-S*_,E=2*S-e;O=A(E,e,t+1/3),T=A(E,e,t),c=A(E,e,t-1/3)}const R=e=>Math.round(255*e).toString(16).padStart(2,"0");return`#${R(O)}${R(T)}${R(c)}`},Ne=(e,E)=>{var a;return(null===(a=null==e?void 0:e.name)||void 0===a?void 0:a[E])||""},we=(e,a,n)=>{var o;const r=null===(o=null==a?void 0:a.find)||void 0===o?void 0:o.call(a,({id:E})=>E===e);return E(r)?"":Ne(r,n)},me=(e,E)=>{const a=E.reduce((e,E)=>{if(!E.visible)return e;const a=Number(E.categoryId);return e[a]||(e[a]=[]),e[a].push(E),e},{});return e.map(e=>Object.assign(Object.assign({},e),{products:a[Number(e.id)]||[]})).filter(e=>{var E;return(null===(E=null==e?void 0:e.products)||void 0===E?void 0:E.length)>0})};var Ce,Ue;!function(e){e.VIEW_BUSINESS="VIEW_BUSINESS",e.UPDATE_BUSINESS="UPDATE_BUSINESS",e.VIEW_BUSINESS_FINANCIALS="VIEW_BUSINESS_FINANCIALS",e.VIEW_ORDERS="VIEW_ORDERS",e.UPDATE_ORDER="UPDATE_ORDER",e.CREATE_ORDER="CREATE_ORDER",e.APPLY_DISCOUNT="APPLY_DISCOUNT",e.VIEW_QR_MENU="VIEW_QR_MENU",e.UPDATE_QR_MENU="UPDATE_QR_MENU",e.VIEW_MENU="VIEW_MENU",e.VIEW_MENU_ITEMS="VIEW_MENU_ITEMS",e.CREATE_MENU_ITEM="CREATE_MENU_ITEM",e.UPDATE_MENU_ITEM="UPDATE_MENU_ITEM",e.DELETE_MENU_ITEM="DELETE_MENU_ITEM",e.VIEW_CATEGORIES="VIEW_CATEGORIES",e.UPDATE_CATEGORY="UPDATE_CATEGORY",e.CREATE_CATEGORY="CREATE_CATEGORY",e.DELETE_CATEGORY="DELETE_CATEGORY",e.VIEW_ADDONS="VIEW_ADDONS",e.UPDATE_ADDON="UPDATE_ADDON",e.CREATE_ADDON="CREATE_ADDON",e.DELETE_ADDON="DELETE_ADDON",e.VIEW_TABLES="VIEW_TABLES",e.UPDATE_TABLE="UPDATE_TABLE",e.UPDATE_TABLE_STATUS="UPDATE_TABLE_STATUS",e.CREATE_TABLE="CREATE_TABLE",e.DELETE_TABLE="DELETE_TABLE",e.VIEW_BRANCHES="VIEW_BRANCHES",e.UPDATE_BRANCH="UPDATE_BRANCH",e.CREATE_BRANCH="CREATE_BRANCH",e.DELETE_BRANCH="DELETE_BRANCH",e.VIEW_EMPLOYEES="VIEW_EMPLOYEES",e.UPDATE_EMPLOYEE="UPDATE_EMPLOYEE",e.CREATE_EMPLOYEE="CREATE_EMPLOYEE",e.DELETE_EMPLOYEE="DELETE_EMPLOYEE",e.VIEW_ANALYTICS="VIEW_ANALYTICS",e.VIEW_SALES_REPORTS="VIEW_SALES_REPORTS",e.VIEW_SUBSCRIPTION="VIEW_SUBSCRIPTION",e.UPDATE_SUBSCRIPTION="UPDATE_SUBSCRIPTION",e.VIEW_QR_CODES="VIEW_QR_CODES",e.CREATE_QR_CODE="CREATE_QR_CODE",e.DELETE_QR_CODE="DELETE_QR_CODE",e.ALL="ALL",e.VIEW_INVENTORY="VIEW_INVENTORY",e.VIEW_PURCHASES="VIEW_PURCHASES",e.VIEW_PURCHASE_DETAIL="VIEW_PURCHASE_DETAIL",e.CREATE_PURCHASE="CREATE_PURCHASE",e.UPDATE_PURCHASE="UPDATE_PURCHASE",e.DELETE_PURCHASE="DELETE_PURCHASE",e.VIEW_INVENTORY_PRODUCTS="VIEW_INVENTORY_PRODUCTS",e.CREATE_INVENTORY_PRODUCT="CREATE_INVENTORY_PRODUCT",e.UPDATE_INVENTORY_PRODUCT="UPDATE_INVENTORY_PRODUCT",e.DELETE_INVENTORY_PRODUCT="DELETE_INVENTORY_PRODUCT",e.VIEW_BUSINESS_BALANCE="VIEW_BUSINESS_BALANCE",e.VIEW_BRANCH_BALANCE="VIEW_BRANCH_BALANCE",e.UPDATE_PRODUCT_INGREDIENTS="UPDATE_PRODUCT_INGREDIENTS",e.DELETE_PRODUCT_INGREDIENTS="DELETE_PRODUCT_INGREDIENTS",e.AI_ASSISTANT="AI_ASSISTANT",e.VIEW_PAYMENTS="VIEW_PAYMENTS",e.TAKE_PAYMENT="TAKE_PAYMENT",e.REFUND_PAYMENT="REFUND_PAYMENT",e.PAYMENT_COMP="COMP"}(Ce||(Ce={})),function(e){e.OWNER="OWNER",e.BRANCH_MANAGER="BRANCH_MANAGER",e.GENERAL_MANAGER="GENERAL_MANAGER",e.CHEF="CHEF",e.SOUS_CHEF="SOUS_CHEF",e.PASTRY_CHEF="PASTRY_CHEF",e.LINE_COOK="LINE_COOK",e.PREP_COOK="PREP_COOK",e.KITCHEN_ASSISTANT="KITCHEN_ASSISTANT",e.DISHWASHER="DISHWASHER",e.HEAD_WAITER="HEAD_WAITER",e.WAITER="WAITER",e.RUNNER="RUNNER",e.BARISTA="BARISTA",e.BARTENDER="BARTENDER",e.SOMMELIER="SOMMELIER",e.ACCOUNTANT="ACCOUNTANT",e.ROOM_SERVICE_STAFF="ROOM_SERVICE_STAFF",e.DELIVERY_DRIVER="DELIVERY_DRIVER",e.INVENTORY_MANAGER="INVENTORY_MANAGER",e.PURCHASING_MANAGER="PURCHASING_MANAGER",e.WAREHOUSE_STAFF="WAREHOUSE_STAFF",e.CASHIER="CASHIER"}(Ue||(Ue={}));const Le=e=>{switch(e){case Ue.OWNER:return[Ce.ALL];case Ue.GENERAL_MANAGER:return[Ce.VIEW_BUSINESS,Ce.UPDATE_BUSINESS,Ce.VIEW_ORDERS,Ce.UPDATE_ORDER,Ce.CREATE_ORDER,Ce.VIEW_QR_MENU,Ce.VIEW_QR_CODES,Ce.VIEW_MENU,Ce.VIEW_MENU_ITEMS,Ce.UPDATE_MENU_ITEM,Ce.CREATE_MENU_ITEM,Ce.DELETE_MENU_ITEM,Ce.VIEW_CATEGORIES,Ce.UPDATE_CATEGORY,Ce.CREATE_CATEGORY,Ce.DELETE_CATEGORY,Ce.VIEW_ADDONS,Ce.UPDATE_ADDON,Ce.CREATE_ADDON,Ce.DELETE_ADDON,Ce.VIEW_TABLES,Ce.UPDATE_TABLE,Ce.CREATE_TABLE,Ce.DELETE_TABLE,Ce.VIEW_BRANCHES,Ce.UPDATE_BRANCH,Ce.CREATE_BRANCH,Ce.DELETE_BRANCH,Ce.VIEW_EMPLOYEES,Ce.UPDATE_EMPLOYEE,Ce.CREATE_EMPLOYEE,Ce.DELETE_EMPLOYEE,Ce.VIEW_ANALYTICS,Ce.VIEW_SALES_REPORTS,Ce.VIEW_SUBSCRIPTION,Ce.CREATE_QR_CODE,Ce.DELETE_QR_CODE,Ce.AI_ASSISTANT];case Ue.BRANCH_MANAGER:return[Ce.VIEW_BUSINESS,Ce.VIEW_ORDERS,Ce.UPDATE_ORDER,Ce.CREATE_ORDER,Ce.VIEW_QR_MENU,Ce.VIEW_QR_CODES,Ce.VIEW_MENU,Ce.VIEW_MENU_ITEMS,Ce.UPDATE_MENU_ITEM,Ce.CREATE_MENU_ITEM,Ce.DELETE_MENU_ITEM,Ce.VIEW_CATEGORIES,Ce.UPDATE_CATEGORY,Ce.CREATE_CATEGORY,Ce.DELETE_CATEGORY,Ce.VIEW_ADDONS,Ce.UPDATE_ADDON,Ce.CREATE_ADDON,Ce.DELETE_ADDON,Ce.VIEW_TABLES,Ce.UPDATE_TABLE,Ce.CREATE_TABLE,Ce.DELETE_TABLE,Ce.VIEW_EMPLOYEES,Ce.UPDATE_EMPLOYEE,Ce.VIEW_ANALYTICS,Ce.VIEW_SALES_REPORTS,Ce.CREATE_QR_CODE,Ce.DELETE_QR_CODE,Ce.AI_ASSISTANT];case Ue.CHEF:return[Ce.VIEW_MENU,Ce.VIEW_MENU_ITEMS,Ce.UPDATE_MENU_ITEM,Ce.VIEW_CATEGORIES,Ce.UPDATE_CATEGORY,Ce.VIEW_ADDONS,Ce.UPDATE_ADDON,Ce.VIEW_ORDERS,Ce.UPDATE_ORDER];case Ue.SOUS_CHEF:return[Ce.VIEW_MENU,Ce.VIEW_MENU_ITEMS,Ce.VIEW_CATEGORIES,Ce.VIEW_ADDONS,Ce.VIEW_ORDERS,Ce.UPDATE_ORDER];case Ue.PASTRY_CHEF:return[Ce.VIEW_MENU,Ce.VIEW_MENU_ITEMS,Ce.UPDATE_MENU_ITEM,Ce.VIEW_ORDERS,Ce.UPDATE_ORDER];case Ue.LINE_COOK:case Ue.PREP_COOK:case Ue.KITCHEN_ASSISTANT:return[Ce.VIEW_MENU,Ce.VIEW_MENU_ITEMS,Ce.VIEW_ORDERS,Ce.UPDATE_ORDER];case Ue.HEAD_WAITER:return[Ce.VIEW_ORDERS,Ce.CREATE_ORDER,Ce.UPDATE_ORDER,Ce.VIEW_TABLES,Ce.UPDATE_TABLE_STATUS,Ce.VIEW_MENU,Ce.VIEW_MENU_ITEMS,Ce.VIEW_CATEGORIES,Ce.VIEW_ADDONS,Ce.VIEW_QR_MENU,Ce.VIEW_QR_CODES];case Ue.WAITER:return[Ce.VIEW_ORDERS,Ce.CREATE_ORDER,Ce.UPDATE_ORDER,Ce.VIEW_TABLES,Ce.UPDATE_TABLE_STATUS,Ce.VIEW_MENU,Ce.VIEW_MENU_ITEMS,Ce.VIEW_CATEGORIES,Ce.VIEW_ADDONS];case Ue.RUNNER:return[Ce.VIEW_ORDERS,Ce.UPDATE_ORDER];case Ue.BARISTA:case Ue.BARTENDER:case Ue.SOMMELIER:case Ue.ROOM_SERVICE_STAFF:return[Ce.VIEW_MENU,Ce.VIEW_MENU_ITEMS,Ce.VIEW_ORDERS,Ce.CREATE_ORDER,Ce.UPDATE_ORDER];case Ue.ACCOUNTANT:return[Ce.VIEW_ANALYTICS,Ce.VIEW_SALES_REPORTS,Ce.VIEW_SUBSCRIPTION];case Ue.DELIVERY_DRIVER:return[Ce.VIEW_ORDERS,Ce.UPDATE_ORDER];case Ue.INVENTORY_MANAGER:return[Ce.VIEW_CATEGORIES,Ce.UPDATE_CATEGORY,Ce.CREATE_CATEGORY,Ce.DELETE_CATEGORY,Ce.VIEW_ADDONS,Ce.UPDATE_ADDON,Ce.CREATE_ADDON,Ce.DELETE_ADDON,Ce.VIEW_MENU,Ce.VIEW_MENU_ITEMS,Ce.UPDATE_MENU_ITEM,Ce.CREATE_MENU_ITEM,Ce.DELETE_MENU_ITEM,Ce.VIEW_PURCHASES,Ce.CREATE_PURCHASE,Ce.UPDATE_PURCHASE,Ce.DELETE_PURCHASE,Ce.VIEW_INVENTORY,Ce.VIEW_INVENTORY_PRODUCTS,Ce.CREATE_INVENTORY_PRODUCT,Ce.UPDATE_INVENTORY_PRODUCT,Ce.DELETE_INVENTORY_PRODUCT,Ce.VIEW_PURCHASE_DETAIL,Ce.VIEW_BRANCH_BALANCE,Ce.UPDATE_PRODUCT_INGREDIENTS,Ce.DELETE_PRODUCT_INGREDIENTS];case Ue.PURCHASING_MANAGER:return[Ce.VIEW_MENU,Ce.VIEW_MENU_ITEMS,Ce.VIEW_CATEGORIES,Ce.CREATE_CATEGORY,Ce.UPDATE_CATEGORY,Ce.VIEW_ADDONS,Ce.CREATE_ADDON,Ce.UPDATE_ADDON];case Ue.WAREHOUSE_STAFF:return[Ce.VIEW_CATEGORIES,Ce.VIEW_ADDONS,Ce.VIEW_MENU,Ce.VIEW_MENU_ITEMS];default:return[]}},Me=(e,a)=>!!E(e)||!E(a)&&(!!a.includes(Ce.ALL)||e.some(e=>a.includes(e))),Ve={yes:0,own_risk:1,requires_integration:2,no:3,restricted:4},ge=["no","restricted"],We=["requires_integration","own_risk"],Be=[{name:"Afghanistan",code:"AF",allowsPOS:"own_risk"},{name:"Albania",code:"AL",allowsPOS:"requires_integration"},{name:"Algeria",code:"DZ",allowsPOS:"own_risk"},{name:"Andorra",code:"AD",allowsPOS:"own_risk"},{name:"Angola",code:"AO",allowsPOS:"no"},{name:"Antigua and Barbuda",code:"AG",allowsPOS:"own_risk"},{name:"Argentina",code:"AR",allowsPOS:"requires_integration"},{name:"Armenia",code:"AM",allowsPOS:"requires_integration"},{name:"Australia",code:"AU",allowsPOS:"own_risk"},{name:"Austria",code:"AT",allowsPOS:"requires_integration"},{name:"Azerbaijan",code:"AZ",allowsPOS:"requires_integration"},{name:"Bahamas",code:"BS",allowsPOS:"own_risk"},{name:"Bahrain",code:"BH",allowsPOS:"own_risk"},{name:"Bangladesh",code:"BD",allowsPOS:"requires_integration"},{name:"Barbados",code:"BB",allowsPOS:"own_risk"},{name:"Belarus",code:"BY",allowsPOS:"no"},{name:"Belgium",code:"BE",allowsPOS:"no"},{name:"Belize",code:"BZ",allowsPOS:"own_risk"},{name:"Benin",code:"BJ",allowsPOS:"requires_integration"},{name:"Bhutan",code:"BT",allowsPOS:"own_risk"},{name:"Bolivia",code:"BO",allowsPOS:"requires_integration"},{name:"Bosnia and Herzegovina",code:"BA",allowsPOS:"requires_integration"},{name:"Botswana",code:"BW",allowsPOS:"requires_integration"},{name:"Brazil",code:"BR",allowsPOS:"requires_integration"},{name:"Brunei",code:"BN",allowsPOS:"yes"},{name:"Bulgaria",code:"BG",allowsPOS:"no"},{name:"Burkina Faso",code:"BF",allowsPOS:"requires_integration"},{name:"Burundi",code:"BI",allowsPOS:"requires_integration"},{name:"Cabo Verde",code:"CV",allowsPOS:"no"},{name:"Cambodia",code:"KH",allowsPOS:"own_risk"},{name:"Cameroon",code:"CM",allowsPOS:"requires_integration"},{name:"Canada",code:"CA",allowsPOS:"requires_integration"},{name:"Central African Republic",code:"CF",allowsPOS:"own_risk"},{name:"Chad",code:"TD",allowsPOS:"own_risk"},{name:"Chile",code:"CL",allowsPOS:"requires_integration"},{name:"China",code:"CN",allowsPOS:"requires_integration"},{name:"Colombia",code:"CO",allowsPOS:"requires_integration"},{name:"Comoros",code:"KM",allowsPOS:"own_risk"},{name:"Congo (Republic of the)",code:"CG",allowsPOS:"own_risk"},{name:"Congo (Democratic Republic of the)",code:"CD",allowsPOS:"requires_integration"},{name:"Costa Rica",code:"CR",allowsPOS:"requires_integration"},{name:"Côte d'Ivoire",code:"CI",allowsPOS:"requires_integration"},{name:"Croatia",code:"HR",allowsPOS:"requires_integration"},{name:"Cuba",code:"CU",allowsPOS:"restricted"},{name:"Cyprus",code:"CY",allowsPOS:"requires_integration"},{name:"Czechia",code:"CZ",allowsPOS:"own_risk"},{name:"Denmark",code:"DK",allowsPOS:"own_risk"},{name:"Djibouti",code:"DJ",allowsPOS:"own_risk"},{name:"Dominica",code:"DM",allowsPOS:"own_risk"},{name:"Dominican Republic",code:"DO",allowsPOS:"requires_integration"},{name:"Ecuador",code:"EC",allowsPOS:"requires_integration"},{name:"Egypt",code:"EG",allowsPOS:"requires_integration"},{name:"El Salvador",code:"SV",allowsPOS:"requires_integration"},{name:"Equatorial Guinea",code:"GQ",allowsPOS:"own_risk"},{name:"Eritrea",code:"ER",allowsPOS:"own_risk"},{name:"Estonia",code:"EE",allowsPOS:"own_risk"},{name:"Eswatini",code:"SZ",allowsPOS:"own_risk"},{name:"Ethiopia",code:"ET",allowsPOS:"requires_integration"},{name:"Fiji",code:"FJ",allowsPOS:"requires_integration"},{name:"Finland",code:"FI",allowsPOS:"own_risk"},{name:"France",code:"FR",allowsPOS:"no"},{name:"Gabon",code:"GA",allowsPOS:"requires_integration"},{name:"Gambia",code:"GM",allowsPOS:"own_risk"},{name:"Georgia",code:"GE",allowsPOS:"requires_integration"},{name:"Germany",code:"DE",allowsPOS:"requires_integration"},{name:"Ghana",code:"GH",allowsPOS:"requires_integration"},{name:"Greece",code:"GR",allowsPOS:"requires_integration"},{name:"Grenada",code:"GD",allowsPOS:"own_risk"},{name:"Guatemala",code:"GT",allowsPOS:"requires_integration"},{name:"Guinea",code:"GN",allowsPOS:"own_risk"},{name:"Guinea-Bissau",code:"GW",allowsPOS:"own_risk"},{name:"Guyana",code:"GY",allowsPOS:"own_risk"},{name:"Haiti",code:"HT",allowsPOS:"own_risk"},{name:"Honduras",code:"HN",allowsPOS:"own_risk"},{name:"Hungary",code:"HU",allowsPOS:"requires_integration"},{name:"Iceland",code:"IS",allowsPOS:"own_risk"},{name:"India",code:"IN",allowsPOS:"own_risk"},{name:"Indonesia",code:"ID",allowsPOS:"requires_integration"},{name:"Iran",code:"IR",allowsPOS:"restricted"},{name:"Iraq",code:"IQ",allowsPOS:"own_risk"},{name:"Ireland",code:"IE",allowsPOS:"own_risk"},{name:"Israel",code:"IL",allowsPOS:"requires_integration"},{name:"Italy",code:"IT",allowsPOS:"requires_integration"},{name:"Jamaica",code:"JM",allowsPOS:"own_risk"},{name:"Japan",code:"JP",allowsPOS:"own_risk"},{name:"Jordan",code:"JO",allowsPOS:"requires_integration"},{name:"Kazakhstan",code:"KZ",allowsPOS:"requires_integration"},{name:"Kenya",code:"KE",allowsPOS:"requires_integration"},{name:"Kiribati",code:"KI",allowsPOS:"own_risk"},{name:"Kosovo",code:"XK",allowsPOS:"requires_integration"},{name:"Kuwait",code:"KW",allowsPOS:"yes"},{name:"Kyrgyzstan",code:"KG",allowsPOS:"requires_integration"},{name:"Laos",code:"LA",allowsPOS:"own_risk"},{name:"Latvia",code:"LV",allowsPOS:"requires_integration"},{name:"Lebanon",code:"LB",allowsPOS:"own_risk"},{name:"Lesotho",code:"LS",allowsPOS:"own_risk"},{name:"Liberia",code:"LR",allowsPOS:"own_risk"},{name:"Libya",code:"LY",allowsPOS:"yes"},{name:"Liechtenstein",code:"LI",allowsPOS:"own_risk"},{name:"Lithuania",code:"LT",allowsPOS:"requires_integration"},{name:"Luxembourg",code:"LU",allowsPOS:"own_risk"},{name:"Madagascar",code:"MG",allowsPOS:"requires_integration"},{name:"Malawi",code:"MW",allowsPOS:"requires_integration"},{name:"Malaysia",code:"MY",allowsPOS:"requires_integration"},{name:"Maldives",code:"MV",allowsPOS:"own_risk"},{name:"Mali",code:"ML",allowsPOS:"own_risk"},{name:"Malta",code:"MT",allowsPOS:"no"},{name:"Marshall Islands",code:"MH",allowsPOS:"own_risk"},{name:"Mauritania",code:"MR",allowsPOS:"own_risk"},{name:"Mauritius",code:"MU",allowsPOS:"requires_integration"},{name:"Mexico",code:"MX",allowsPOS:"requires_integration"},{name:"Micronesia",code:"FM",allowsPOS:"own_risk"},{name:"Moldova",code:"MD",allowsPOS:"requires_integration"},{name:"Monaco",code:"MC",allowsPOS:"no"},{name:"Mongolia",code:"MN",allowsPOS:"requires_integration"},{name:"Montenegro",code:"ME",allowsPOS:"requires_integration"},{name:"Morocco",code:"MA",allowsPOS:"requires_integration"},{name:"Mozambique",code:"MZ",allowsPOS:"requires_integration"},{name:"Myanmar",code:"MM",allowsPOS:"own_risk"},{name:"Namibia",code:"NA",allowsPOS:"own_risk"},{name:"Nauru",code:"NR",allowsPOS:"yes"},{name:"Nepal",code:"NP",allowsPOS:"no"},{name:"Netherlands",code:"NL",allowsPOS:"yes"},{name:"New Zealand",code:"NZ",allowsPOS:"own_risk"},{name:"Nicaragua",code:"NI",allowsPOS:"requires_integration"},{name:"Niger",code:"NE",allowsPOS:"requires_integration"},{name:"Nigeria",code:"NG",allowsPOS:"requires_integration"},{name:"Korea (North)",code:"KP",allowsPOS:"restricted"},{name:"North Macedonia",code:"MK",allowsPOS:"requires_integration"},{name:"Norway",code:"NO",allowsPOS:"no"},{name:"Oman",code:"OM",allowsPOS:"requires_integration"},{name:"Pakistan",code:"PK",allowsPOS:"requires_integration"},{name:"Palau",code:"PW",allowsPOS:"own_risk"},{name:"Palestine",code:"PS",allowsPOS:"own_risk"},{name:"Panama",code:"PA",allowsPOS:"requires_integration"},{name:"Papua New Guinea",code:"PG",allowsPOS:"own_risk"},{name:"Paraguay",code:"PY",allowsPOS:"requires_integration"},{name:"Peru",code:"PE",allowsPOS:"requires_integration"},{name:"Philippines",code:"PH",allowsPOS:"no"},{name:"Poland",code:"PL",allowsPOS:"requires_integration"},{name:"Portugal",code:"PT",allowsPOS:"no"},{name:"Qatar",code:"QA",allowsPOS:"yes"},{name:"Romania",code:"RO",allowsPOS:"requires_integration"},{name:"Russia",code:"RU",allowsPOS:"restricted"},{name:"Rwanda",code:"RW",allowsPOS:"requires_integration"},{name:"Saint Kitts and Nevis",code:"KN",allowsPOS:"own_risk"},{name:"Saint Lucia",code:"LC",allowsPOS:"own_risk"},{name:"Saint Vincent and the Grenadines",code:"VC",allowsPOS:"own_risk"},{name:"Samoa",code:"WS",allowsPOS:"own_risk"},{name:"San Marino",code:"SM",allowsPOS:"own_risk"},{name:"Sao Tome and Principe",code:"ST",allowsPOS:"own_risk"},{name:"Saudi Arabia",code:"SA",allowsPOS:"requires_integration"},{name:"Senegal",code:"SN",allowsPOS:"requires_integration"},{name:"Serbia",code:"RS",allowsPOS:"no"},{name:"Seychelles",code:"SC",allowsPOS:"own_risk"},{name:"Sierra Leone",code:"SL",allowsPOS:"requires_integration"},{name:"Singapore",code:"SG",allowsPOS:"own_risk"},{name:"Slovakia",code:"SK",allowsPOS:"requires_integration"},{name:"Slovenia",code:"SI",allowsPOS:"requires_integration"},{name:"Solomon Islands",code:"SB",allowsPOS:"own_risk"},{name:"Somalia",code:"SO",allowsPOS:"own_risk"},{name:"South Africa",code:"ZA",allowsPOS:"own_risk"},{name:"Korea (South)",code:"KR",allowsPOS:"requires_integration"},{name:"South Sudan",code:"SS",allowsPOS:"own_risk"},{name:"Spain",code:"ES",allowsPOS:"no"},{name:"Sri Lanka",code:"LK",allowsPOS:"own_risk"},{name:"Sudan",code:"SD",allowsPOS:"own_risk"},{name:"Suriname",code:"SR",allowsPOS:"own_risk"},{name:"Sweden",code:"SE",allowsPOS:"requires_integration"},{name:"Switzerland",code:"CH",allowsPOS:"own_risk"},{name:"Syria",code:"SY",allowsPOS:"own_risk"},{name:"Taiwan",code:"TW",allowsPOS:"requires_integration"},{name:"Tajikistan",code:"TJ",allowsPOS:"requires_integration"},{name:"Tanzania",code:"TZ",allowsPOS:"requires_integration"},{name:"Thailand",code:"TH",allowsPOS:"own_risk"},{name:"Timor-Leste",code:"TL",allowsPOS:"own_risk"},{name:"Togo",code:"TG",allowsPOS:"requires_integration"},{name:"Tonga",code:"TO",allowsPOS:"own_risk"},{name:"Trinidad and Tobago",code:"TT",allowsPOS:"own_risk"},{name:"Tunisia",code:"TN",allowsPOS:"requires_integration"},{name:"Turkey",code:"TR",allowsPOS:"requires_integration"},{name:"Turkmenistan",code:"TM",allowsPOS:"own_risk"},{name:"Tuvalu",code:"TV",allowsPOS:"own_risk"},{name:"Uganda",code:"UG",allowsPOS:"requires_integration"},{name:"Ukraine",code:"UA",allowsPOS:"requires_integration"},{name:"United Arab Emirates",code:"AE",allowsPOS:"own_risk"},{name:"United Kingdom",code:"GB",allowsPOS:"own_risk"},{name:"United States",code:"US",allowsPOS:"own_risk"},{name:"Uruguay",code:"UY",allowsPOS:"requires_integration"},{name:"Uzbekistan",code:"UZ",allowsPOS:"requires_integration"},{name:"Vanuatu",code:"VU",allowsPOS:"own_risk"},{name:"Vatican City",code:"VA",allowsPOS:"yes"},{name:"Venezuela",code:"VE",allowsPOS:"no"},{name:"Vietnam",code:"VN",allowsPOS:"requires_integration"},{name:"Yemen",code:"YE",allowsPOS:"own_risk"},{name:"Zambia",code:"ZM",allowsPOS:"requires_integration"},{name:"Zimbabwe",code:"ZW",allowsPOS:"requires_integration"}].reduce((e,E)=>(e[E.code]=E.allowsPOS,e),{}),Ge=e=>{var E;return e&&null!==(E=Be[e.trim().toUpperCase()])&&void 0!==E?E:null},ke=(e,E)=>{const a=[Ge(e),Ge(E)].filter(e=>null!==e);return 0===a.length?null:a.reduce((e,E)=>Ve[E]>Ve[e]?E:e)},He=e=>null!==e&&ge.includes(e),pe=e=>null!==e&&We.includes(e);export{De as adjustLightness,j as buildGuestContactRequest,F as buildSelectedAddonsPayload,$ as calculateTipAmount,ne as formatAddressLine,ae as formatCityLine,Z as formatTipAmount,f as generateOrderItemsId,A as getAddonOptionTranslation,T as getAddonTitle,S as getAddonTranslation,w as getAllSelectedOptionsListingPrice,Ae as getBaseUrl,Ne as getCategoryName,we as getCategoryNameById,Re as getCoverPhotoSource,K as getDefaultOrderType,Me as getHasUserPermission,Te as getImageSource,le as getIsFeatureActive,ce as getLogoImageSource,D as getOptionListingPrice,O as getOptionTitles,x as getOrderErrorMessages,b as getOrderItemListingPrice,q as getOrderItemListingRawPrice,Le as getPermissionsByRole,Ge as getPosAllowance,W as getPriceSuffix,M as getProductAddon,g as getProductAllergens,I as getProductListingPrice,m as getProductOrderPrice,B as getProductSellUnitShortCuts,C as getProductTranslation,U as getProductVariant,L as getProductVariantTranslation,Oe as getRegisterUrl,h as getSelectedAddonsFromOrderItems,y as getStatusIcon,d as getUnitListingPrice,u as getVariantListingPrice,ue as getVideoSource,He as isBlockingAllowance,Q as isValidPreviewResponse,pe as isWarningAllowance,me as prepareCategoryAndProductMap,X as preparePhoneNumber,ke as resolvePosAllowance,Ie as rgbDataURL,Ee as validateAddressForm,ee as validateForm,Se as validatePhoneNumber};
1
+ import{priceFormatter as e,isEmpty as E,sortNumbers as a,checkIsValidEmail as n,getQueryParam as o}from"@sorocraft/js-utils";import{HourglassHalf as r,FileCheck as i,Chef as s,Delivery as l,BagCheck as t,Check as _}from"@sorocraft/ui/icons";const S="en",A=(e,E)=>e?E&&e[E]?e[E]:e[S]?e[S]:Object.values(e).find(Boolean)||"":"",O=(e,E)=>{if(!e)return{};const a={};for(const n of((e,E)=>{const a=E&&E!==S?[E,S]:[S];return[...a,...Object.keys(e).filter(e=>!a.includes(e))]})(e,E)){const E=e[n];if(E)for(const e of Object.keys(E))!a[e]&&E[e]&&(a[e]=E[e])}return a},T=(e,E)=>A(null==e?void 0:e.title,E),c=(e,E,a)=>Array.isArray(E)?(e||[]).filter(({id:e})=>E.includes(e)).map(e=>T(e,a)).filter(Boolean).join(", "):T((e||[]).find(({id:e})=>e===E),a);var R,P,d;!function(e){e.GLUTEN="GLUTEN",e.CRUSTACEANS="CRUSTACEANS",e.EGGS="EGGS",e.FISH="FISH",e.PEANUTS="PEANUTS",e.SOY="SOY",e.MILK="MILK",e.TREE_NUTS="TREE_NUTS",e.CELERY="CELERY",e.MUSTARD="MUSTARD",e.SESAME="SESAME",e.SULPHITES="SULPHITES",e.LUPIN="LUPIN",e.MOLLUSCS="MOLLUSCS",e.BUCKWHEAT="BUCKWHEAT"}(R||(R={})),function(e){e.LIST="list",e.GRID="grid"}(P||(P={})),function(e){e.PIECE="PIECE",e.WEIGHT="WEIGHT",e.VOLUME="VOLUME"}(d||(d={}));const I=e=>{var E,a;return null!==(a=null!==(E=null==e?void 0:e.listingPrice)&&void 0!==E?E:null==e?void 0:e.price)&&void 0!==a?a:0},u=(E,a,n)=>{const o=I(E);return e(o,a,n)},D=(E,a,n)=>{const o=I(E);return e(o,a,n)},N=(E,a,n)=>{const o=I(E);return e(o,a,n)};var w;!function(e){e.SINGLE="SINGLE",e.MULTIPLE="MULTIPLE"}(w||(w={}));const m=(e,E={})=>{let a=0;for(const n of(null==e?void 0:e.addons)||[]){const{id:e,selectType:o,options:r}=n;if(!Object.prototype.hasOwnProperty.call(E,e))continue;const i=E[e],s=o===w.SINGLE?[i]:i||[];for(const e of s){const E=(r||[]).find(({id:E})=>E===e);E&&(a+=I(E))}}return a},C=({product:E,quantity:a,language:n,currency:o,variantId:r,selectedAddons:i})=>{if(!E||0===Object.keys(E).length)return e(0,o,n);const s=r?(E.variants||[]).find(({id:e})=>e===r):void 0,l=I(r?s:E),t=m(E,i);return e((l+t)*a,o,n)},U=(e,E)=>O(null==e?void 0:e.translations,E),L=(e,E)=>{var a,n;return(null===(n=null===(a=null==e?void 0:e.variants)||void 0===a?void 0:a.find)||void 0===n?void 0:n.call(a,e=>e.id===E))||{}},M=(e,E)=>A(null==e?void 0:e.title,E),V=(e,E)=>((null==e?void 0:e.addons)||[]).find(({id:e})=>e===E)||{},g=(e,E,a)=>A(e,a)||(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase().replace(/_/g," "))(E),W=(e,E)=>((null==e?void 0:e.allergenDetails)||[]).map(({code:e,translations:a})=>({code:e,label:g(a,e,E)})),B=e=>{switch(e){case d.WEIGHT:return" / kg";case d.VOLUME:return" / l";default:return""}},G=e=>{switch(e){case d.WEIGHT:return{"50gr":.05,"100gr":.1,"150gr":.15,"200gr":.2,"250gr":.25,"300gr":.3,"350gr":.35,"400gr":.4,"450gr":.45,"500gr":.5,"600gr":.6,"700gr":.7,"750gr":.75,"800gr":.8,"850gr":.85,"900gr":.9,"950gr":.95,"1kg":1,"2kg":2,"5kg":5,"10kg":10,"20kg":20};case d.VOLUME:return{"50ml":.05,"100ml":.1,"150ml":.15,"200ml":.2,"250ml":.25,"300ml":.3,"350ml":.35,"400ml":.4,"450ml":.45,"500ml":.5,"600ml":.6,"700ml":.7,"750ml":.75,"800ml":.8,"850ml":.85,"900ml":.9,"950ml":.95,"1l":1,"2l":2,"5l":5,"10l":10,"20l":20};default:return{}}};var k,H,p,f,Y,b;"function"==typeof SuppressedError&&SuppressedError,function(e){e.DINE_IN="DINE_IN",e.PICK_UP="PICK_UP",e.DELIVERY="DELIVERY"}(k||(k={})),function(e){e.DRAFT="DRAFT",e.PENDING="PENDING",e.CONFIRMED="CONFIRMED",e.PREPARING="PREPARING",e.READY="READY",e.OUT_FOR_DELIVERY="OUT_FOR_DELIVERY",e.DELIVERED="DELIVERED",e.COMPLETED="COMPLETED",e.CANCELLED="CANCELLED",e.FAILED="FAILED"}(H||(H={})),function(e){e.PENDING="PENDING",e.PREPARING="PREPARING",e.READY="READY",e.SERVED="SERVED"}(p||(p={})),function(e){e.CASH="CASH",e.CARD="CARD",e.BANK_TRANSFER="BANK_TRANSFER",e.MOBILE="MOBILE",e.QR="QR",e.VOUCHER="VOUCHER",e.COMP="COMP",e.MIXED="MIXED"}(f||(f={})),function(e){e.CART="CART",e.DETAILS="DETAILS",e.COMPLETED="COMPLETED"}(Y||(Y={})),f.CASH,Y.CART,Y.DETAILS,Y.COMPLETED,f.CASH,f.CARD,f.BANK_TRANSFER,f.MOBILE,f.QR,f.VOUCHER,f.CASH,f.CARD,function(e){e.FIELD_REQUIRED_ERROR="This field is required",e.TABLE_NOT_SELECTED="Please select a table",e.ADDRESS_IS_EMPTY="Please enter an address",e.EMPTY_ITEMS="Please choose product",e.BRANCH_NOT_SELECTED="Please select a branch"}(b||(b={}));const q=e=>{var E,a;const{price:n,variant:o,addons:r,quantity:i}=e||{},s=null!==(a=null!==(E=null==o?void 0:o.price)&&void 0!==E?E:n)&&void 0!==a?a:0,l=(r||[]).reduce((e,E)=>e+((null==E?void 0:E.options)||[]).reduce((e,E)=>{var a;return e+(null!==(a=null==E?void 0:E.price)&&void 0!==a?a:0)},0),0);return(s+l)*(null!=i?i:1)},h=(E,a,n)=>{const o=q(E);return e(o,a,n)},v=(e,E,n)=>{if(!e)throw new Error("Product ID is required");let o=`${e}`;E&&(o+=`-${E}`);const r=Object.entries(n||{}).map(([e,E])=>{if(!e||!E)return null;const n=Array.isArray(E)?a(E).filter(Boolean).join("-"):`${E}`;return n?`${e}-${n}`:null}).filter(Boolean).join("-");return r&&(o+=`-${r}`),o},y=e=>{const E={};for(const{addonId:a,options:n=[]}of e.addons||[]){const e=n.map(({optionId:e})=>e);E[a]=1===e.length?e[0]:e}return E},F=e=>{switch(e){case H.COMPLETED:return _;case H.DELIVERED:return t;case H.OUT_FOR_DELIVERY:return l;case H.PREPARING:return s;case H.CONFIRMED:return i;case H.PENDING:default:return r}},K=(e=[],a={})=>Object.entries(a).map(([a,n])=>{const o=Number(a),r=Array.isArray(n)?n:[n],i=e.find(e=>e.id===o);if(E(i))return{addonId:o,options:[]};const s=(i.options||[]).filter(e=>r.includes(e.id)).map(e=>{var E;return{optionId:e.id,price:null!==(E=e.listingPrice)&&void 0!==E?E:e.price}});return{addonId:o,options:s}}),Q=(e,E,a)=>{if(!e)return null;const{deliveryOrderEnabled:n,dineInOrderEnabled:o,pickupOrderEnabled:r}=e;return n&&a?k.DELIVERY:o&&E?k.DINE_IN:r&&E?k.PICK_UP:null},j=e=>{if(!e||"object"!=typeof e)return!1;const E=e;return"number"==typeof E.totalPriceWithoutTax&&"number"==typeof E.totalPriceWithTax&&"number"==typeof E.totalPriceWithTaxAndFees&&"number"==typeof E.totalTax&&"number"==typeof E.deliveryFee&&"number"==typeof E.serviceFee&&Array.isArray(E.items)&&Array.isArray(E.taxes)},$=e=>{if(E(e))return;const a=Object.entries(e).filter(([,e])=>null!=e&&""!==e);if(0===a.length)return;const n=Object.fromEntries(a),{latitude:o,longitude:r,floor:i}=n,s=function(e,E){var a={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&E.indexOf(n)<0&&(a[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)E.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(a[n[o]]=e[n[o]])}return a}(n,["latitude","longitude","floor"]);return Object.assign(Object.assign(Object.assign(Object.assign({},s),null!=i?{floor:Number(i)}:{}),null!=o?{latitude:`${o}`}:{}),null!=r?{longitude:`${r}`}:{})},Z=(e,E)=>!e||e<=0||!E||E<=0?0:Math.round(e*E)/100,x=e=>e.toFixed(2),z=e=>{switch(e){case"customer":return b.ADDRESS_IS_EMPTY;case"tableId":return b.TABLE_NOT_SELECTED;case"items":return b.EMPTY_ITEMS;case"branchId":return b.BRANCH_NOT_SELECTED;default:return b.FIELD_REQUIRED_ERROR}};var J,X;!function(e){e.PHONE="PHONE",e.OTP="OTP",e.EMAIL="EMAIL"}(J||(J={})),function(e){e.HOME="HOME",e.WORK="WORK",e.TRAVEL="TRAVEL"}(X||(X={}));const ee=e=>`${e.countryCode}${e.phoneNumber}`.replaceAll("+",""),Ee=(e,E)=>{const a={},{email:o,otp:r}=e||{};switch(E){case J.OTP:o&&n(o)||(a.email="Invalid Email Address"),r&&6===r.length||(a.otp="Invalid OTP");break;case J.EMAIL:o&&n(o)||(a.email="Invalid Email Address")}return a},ae=e=>{const E={},{countryCode:a,cityName:n,street:o,houseNumber:r}=e||{};return a||(E.countryCode="COUNTRY_REQUIRED"),n||(E.cityName="CITY_REQUIRED"),o||(E.street="STREET_REQUIRED"),r||(E.houseNumber="STREET_NUMBER_REQUIRED"),E},ne=e=>(e||[]).filter(Boolean).join(", "),oe=(e,E,a)=>[e,[E,a].filter(Boolean).join("/")].filter(Boolean).join(" ");var re,ie;!function(e){e.UPLOAD_VIDEO="UPLOAD_VIDEO"}(re||(re={})),function(e){e.ALPHA="ALPHA",e.BETA="BETA",e.ALL="ALL"}(ie||(ie={}));const se={[ie.ALPHA]:[re.UPLOAD_VIDEO],[ie.BETA]:[],[ie.ALL]:[]},le=(e,E)=>{if("1"===o(e))return!0;return(E===ie.ALPHA?[ie.ALPHA,ie.BETA,ie.ALL]:E===ie.BETA?[ie.BETA,ie.ALL]:[ie.ALL]).some(E=>{var a;return null===(a=se[E])||void 0===a?void 0:a.includes(e)})},te="tabres.com",_e="https://images.tabres.com",Se={994:e=>{const E=["50","51","10","55","99","70","77","60"];return new RegExp(`^(${E.join("|")})\\d{7}$`).test(e)?{isValid:!0}:{isValid:!1,error:`Azerbaijani numbers must be 9 digits and start with ${E.join(", ")}`}},31:e=>/^\d{9}$/.test(e)?{isValid:!0}:{isValid:!1,error:"Dutch numbers must be exactly 9 digits"}};function Ae(e){if(!e)return{isValid:!1,error:"FIELD_REQUIRED"};const E=e.replace(/\D/g,""),a=E.startsWith("994")?"994":E.startsWith("31")?"31":null;if(!a)return{isValid:!1,error:"Unsupported country code"};const n=E.slice(a.length);return(0,Se[a])(n)}const Oe=(e,E)=>{const a=E||"en";return"localhost:3000"===e?{url:`http://localhost:3000/${a}`,domain:te}:{url:`https://${te}/${a}`,domain:te}},Te=(e,E)=>`https://app.tabres.com/auth/register?lang=${e}&utm_source=${E}`,ce=e=>e?e.includes("base64")||e.startsWith("https://")?e:`${_e}/${e}`:"",Re=e=>e?e.includes("base64")||e.startsWith("https://")?e:`${_e}/${e}`:"https://images.tabres.com/no-photo-128.webp",Pe=e=>e?e.includes("base64")||e.startsWith("https://")?e:`${_e}/${e}`:"https://images.tabres.com/tabres-doodle.webp",de="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",Ie=(e,E,a)=>de.charAt(e>>2)+de.charAt((3&e)<<4|E>>4)+de.charAt((15&E)<<2|a>>6)+de.charAt(63&a),ue=(e,E,a)=>`data:image/gif;base64,R0lGODlhAQABAPAA${Ie(0,e,E)+Ie(a,255,255)}/yH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==`,De=e=>e?e.includes("base64")||e.startsWith("https://")?e:`https://videos.tabres.com/${e}`:"",Ne=(e,E)=>{const a=parseInt(e.replace("#",""),16),n=(a>>16&255)/255,o=(a>>8&255)/255,r=(255&a)/255,i=Math.max(n,o,r),s=Math.min(n,o,r),l=(i+s)/2;let t=0,_=0;if(i!==s){const e=i-s;switch(_=l>.5?e/(2-i-s):e/(i+s),i){case n:t=(o-r)/e+(o<r?6:0);break;case o:t=(r-n)/e+2;break;case r:t=(n-o)/e+4}t/=6}const S=Math.max(0,Math.min(1,l+E/100)),A=(e,E,a)=>(a<0&&(a+=1),a>1&&(a-=1),a<1/6?e+6*(E-e)*a:a<.5?E:a<2/3?e+(E-e)*(2/3-a)*6:e);let O=S,T=S,c=S;if(0!==_){const e=S<.5?S*(1+_):S+_-S*_,E=2*S-e;O=A(E,e,t+1/3),T=A(E,e,t),c=A(E,e,t-1/3)}const R=e=>Math.round(255*e).toString(16).padStart(2,"0");return`#${R(O)}${R(T)}${R(c)}`},we=(e,E)=>A(null==e?void 0:e.name,E),me=(e,a,n)=>{var o;const r=null===(o=null==a?void 0:a.find)||void 0===o?void 0:o.call(a,({id:E})=>E===e);return E(r)?"":we(r,n)},Ce=(e,E)=>{const a=E.reduce((e,E)=>{if(!E.visible)return e;const a=Number(E.categoryId);return e[a]||(e[a]=[]),e[a].push(E),e},{});return e.map(e=>Object.assign(Object.assign({},e),{products:a[Number(e.id)]||[]})).filter(e=>{var E;return(null===(E=null==e?void 0:e.products)||void 0===E?void 0:E.length)>0})};var Ue,Le;!function(e){e.VIEW_BUSINESS="VIEW_BUSINESS",e.UPDATE_BUSINESS="UPDATE_BUSINESS",e.VIEW_BUSINESS_FINANCIALS="VIEW_BUSINESS_FINANCIALS",e.VIEW_ORDERS="VIEW_ORDERS",e.UPDATE_ORDER="UPDATE_ORDER",e.CREATE_ORDER="CREATE_ORDER",e.APPLY_DISCOUNT="APPLY_DISCOUNT",e.VIEW_QR_MENU="VIEW_QR_MENU",e.UPDATE_QR_MENU="UPDATE_QR_MENU",e.VIEW_MENU="VIEW_MENU",e.VIEW_MENU_ITEMS="VIEW_MENU_ITEMS",e.CREATE_MENU_ITEM="CREATE_MENU_ITEM",e.UPDATE_MENU_ITEM="UPDATE_MENU_ITEM",e.DELETE_MENU_ITEM="DELETE_MENU_ITEM",e.VIEW_CATEGORIES="VIEW_CATEGORIES",e.UPDATE_CATEGORY="UPDATE_CATEGORY",e.CREATE_CATEGORY="CREATE_CATEGORY",e.DELETE_CATEGORY="DELETE_CATEGORY",e.VIEW_ADDONS="VIEW_ADDONS",e.UPDATE_ADDON="UPDATE_ADDON",e.CREATE_ADDON="CREATE_ADDON",e.DELETE_ADDON="DELETE_ADDON",e.VIEW_TABLES="VIEW_TABLES",e.UPDATE_TABLE="UPDATE_TABLE",e.UPDATE_TABLE_STATUS="UPDATE_TABLE_STATUS",e.CREATE_TABLE="CREATE_TABLE",e.DELETE_TABLE="DELETE_TABLE",e.VIEW_BRANCHES="VIEW_BRANCHES",e.UPDATE_BRANCH="UPDATE_BRANCH",e.CREATE_BRANCH="CREATE_BRANCH",e.DELETE_BRANCH="DELETE_BRANCH",e.VIEW_EMPLOYEES="VIEW_EMPLOYEES",e.UPDATE_EMPLOYEE="UPDATE_EMPLOYEE",e.CREATE_EMPLOYEE="CREATE_EMPLOYEE",e.DELETE_EMPLOYEE="DELETE_EMPLOYEE",e.VIEW_ANALYTICS="VIEW_ANALYTICS",e.VIEW_SALES_REPORTS="VIEW_SALES_REPORTS",e.VIEW_SUBSCRIPTION="VIEW_SUBSCRIPTION",e.UPDATE_SUBSCRIPTION="UPDATE_SUBSCRIPTION",e.VIEW_QR_CODES="VIEW_QR_CODES",e.CREATE_QR_CODE="CREATE_QR_CODE",e.DELETE_QR_CODE="DELETE_QR_CODE",e.ALL="ALL",e.VIEW_INVENTORY="VIEW_INVENTORY",e.VIEW_PURCHASES="VIEW_PURCHASES",e.VIEW_PURCHASE_DETAIL="VIEW_PURCHASE_DETAIL",e.CREATE_PURCHASE="CREATE_PURCHASE",e.UPDATE_PURCHASE="UPDATE_PURCHASE",e.DELETE_PURCHASE="DELETE_PURCHASE",e.VIEW_INVENTORY_PRODUCTS="VIEW_INVENTORY_PRODUCTS",e.CREATE_INVENTORY_PRODUCT="CREATE_INVENTORY_PRODUCT",e.UPDATE_INVENTORY_PRODUCT="UPDATE_INVENTORY_PRODUCT",e.DELETE_INVENTORY_PRODUCT="DELETE_INVENTORY_PRODUCT",e.VIEW_BUSINESS_BALANCE="VIEW_BUSINESS_BALANCE",e.VIEW_BRANCH_BALANCE="VIEW_BRANCH_BALANCE",e.UPDATE_PRODUCT_INGREDIENTS="UPDATE_PRODUCT_INGREDIENTS",e.DELETE_PRODUCT_INGREDIENTS="DELETE_PRODUCT_INGREDIENTS",e.AI_ASSISTANT="AI_ASSISTANT",e.VIEW_PAYMENTS="VIEW_PAYMENTS",e.TAKE_PAYMENT="TAKE_PAYMENT",e.REFUND_PAYMENT="REFUND_PAYMENT",e.PAYMENT_COMP="COMP"}(Ue||(Ue={})),function(e){e.OWNER="OWNER",e.BRANCH_MANAGER="BRANCH_MANAGER",e.GENERAL_MANAGER="GENERAL_MANAGER",e.CHEF="CHEF",e.SOUS_CHEF="SOUS_CHEF",e.PASTRY_CHEF="PASTRY_CHEF",e.LINE_COOK="LINE_COOK",e.PREP_COOK="PREP_COOK",e.KITCHEN_ASSISTANT="KITCHEN_ASSISTANT",e.DISHWASHER="DISHWASHER",e.HEAD_WAITER="HEAD_WAITER",e.WAITER="WAITER",e.RUNNER="RUNNER",e.BARISTA="BARISTA",e.BARTENDER="BARTENDER",e.SOMMELIER="SOMMELIER",e.ACCOUNTANT="ACCOUNTANT",e.ROOM_SERVICE_STAFF="ROOM_SERVICE_STAFF",e.DELIVERY_DRIVER="DELIVERY_DRIVER",e.INVENTORY_MANAGER="INVENTORY_MANAGER",e.PURCHASING_MANAGER="PURCHASING_MANAGER",e.WAREHOUSE_STAFF="WAREHOUSE_STAFF",e.CASHIER="CASHIER"}(Le||(Le={}));const Me=e=>{switch(e){case Le.OWNER:return[Ue.ALL];case Le.GENERAL_MANAGER:return[Ue.VIEW_BUSINESS,Ue.UPDATE_BUSINESS,Ue.VIEW_ORDERS,Ue.UPDATE_ORDER,Ue.CREATE_ORDER,Ue.VIEW_QR_MENU,Ue.VIEW_QR_CODES,Ue.VIEW_MENU,Ue.VIEW_MENU_ITEMS,Ue.UPDATE_MENU_ITEM,Ue.CREATE_MENU_ITEM,Ue.DELETE_MENU_ITEM,Ue.VIEW_CATEGORIES,Ue.UPDATE_CATEGORY,Ue.CREATE_CATEGORY,Ue.DELETE_CATEGORY,Ue.VIEW_ADDONS,Ue.UPDATE_ADDON,Ue.CREATE_ADDON,Ue.DELETE_ADDON,Ue.VIEW_TABLES,Ue.UPDATE_TABLE,Ue.CREATE_TABLE,Ue.DELETE_TABLE,Ue.VIEW_BRANCHES,Ue.UPDATE_BRANCH,Ue.CREATE_BRANCH,Ue.DELETE_BRANCH,Ue.VIEW_EMPLOYEES,Ue.UPDATE_EMPLOYEE,Ue.CREATE_EMPLOYEE,Ue.DELETE_EMPLOYEE,Ue.VIEW_ANALYTICS,Ue.VIEW_SALES_REPORTS,Ue.VIEW_SUBSCRIPTION,Ue.CREATE_QR_CODE,Ue.DELETE_QR_CODE,Ue.AI_ASSISTANT];case Le.BRANCH_MANAGER:return[Ue.VIEW_BUSINESS,Ue.VIEW_ORDERS,Ue.UPDATE_ORDER,Ue.CREATE_ORDER,Ue.VIEW_QR_MENU,Ue.VIEW_QR_CODES,Ue.VIEW_MENU,Ue.VIEW_MENU_ITEMS,Ue.UPDATE_MENU_ITEM,Ue.CREATE_MENU_ITEM,Ue.DELETE_MENU_ITEM,Ue.VIEW_CATEGORIES,Ue.UPDATE_CATEGORY,Ue.CREATE_CATEGORY,Ue.DELETE_CATEGORY,Ue.VIEW_ADDONS,Ue.UPDATE_ADDON,Ue.CREATE_ADDON,Ue.DELETE_ADDON,Ue.VIEW_TABLES,Ue.UPDATE_TABLE,Ue.CREATE_TABLE,Ue.DELETE_TABLE,Ue.VIEW_EMPLOYEES,Ue.UPDATE_EMPLOYEE,Ue.VIEW_ANALYTICS,Ue.VIEW_SALES_REPORTS,Ue.CREATE_QR_CODE,Ue.DELETE_QR_CODE,Ue.AI_ASSISTANT];case Le.CHEF:return[Ue.VIEW_MENU,Ue.VIEW_MENU_ITEMS,Ue.UPDATE_MENU_ITEM,Ue.VIEW_CATEGORIES,Ue.UPDATE_CATEGORY,Ue.VIEW_ADDONS,Ue.UPDATE_ADDON,Ue.VIEW_ORDERS,Ue.UPDATE_ORDER];case Le.SOUS_CHEF:return[Ue.VIEW_MENU,Ue.VIEW_MENU_ITEMS,Ue.VIEW_CATEGORIES,Ue.VIEW_ADDONS,Ue.VIEW_ORDERS,Ue.UPDATE_ORDER];case Le.PASTRY_CHEF:return[Ue.VIEW_MENU,Ue.VIEW_MENU_ITEMS,Ue.UPDATE_MENU_ITEM,Ue.VIEW_ORDERS,Ue.UPDATE_ORDER];case Le.LINE_COOK:case Le.PREP_COOK:case Le.KITCHEN_ASSISTANT:return[Ue.VIEW_MENU,Ue.VIEW_MENU_ITEMS,Ue.VIEW_ORDERS,Ue.UPDATE_ORDER];case Le.HEAD_WAITER:return[Ue.VIEW_ORDERS,Ue.CREATE_ORDER,Ue.UPDATE_ORDER,Ue.VIEW_TABLES,Ue.UPDATE_TABLE_STATUS,Ue.VIEW_MENU,Ue.VIEW_MENU_ITEMS,Ue.VIEW_CATEGORIES,Ue.VIEW_ADDONS,Ue.VIEW_QR_MENU,Ue.VIEW_QR_CODES];case Le.WAITER:return[Ue.VIEW_ORDERS,Ue.CREATE_ORDER,Ue.UPDATE_ORDER,Ue.VIEW_TABLES,Ue.UPDATE_TABLE_STATUS,Ue.VIEW_MENU,Ue.VIEW_MENU_ITEMS,Ue.VIEW_CATEGORIES,Ue.VIEW_ADDONS];case Le.RUNNER:return[Ue.VIEW_ORDERS,Ue.UPDATE_ORDER];case Le.BARISTA:case Le.BARTENDER:case Le.SOMMELIER:case Le.ROOM_SERVICE_STAFF:return[Ue.VIEW_MENU,Ue.VIEW_MENU_ITEMS,Ue.VIEW_ORDERS,Ue.CREATE_ORDER,Ue.UPDATE_ORDER];case Le.ACCOUNTANT:return[Ue.VIEW_ANALYTICS,Ue.VIEW_SALES_REPORTS,Ue.VIEW_SUBSCRIPTION];case Le.DELIVERY_DRIVER:return[Ue.VIEW_ORDERS,Ue.UPDATE_ORDER];case Le.INVENTORY_MANAGER:return[Ue.VIEW_CATEGORIES,Ue.UPDATE_CATEGORY,Ue.CREATE_CATEGORY,Ue.DELETE_CATEGORY,Ue.VIEW_ADDONS,Ue.UPDATE_ADDON,Ue.CREATE_ADDON,Ue.DELETE_ADDON,Ue.VIEW_MENU,Ue.VIEW_MENU_ITEMS,Ue.UPDATE_MENU_ITEM,Ue.CREATE_MENU_ITEM,Ue.DELETE_MENU_ITEM,Ue.VIEW_PURCHASES,Ue.CREATE_PURCHASE,Ue.UPDATE_PURCHASE,Ue.DELETE_PURCHASE,Ue.VIEW_INVENTORY,Ue.VIEW_INVENTORY_PRODUCTS,Ue.CREATE_INVENTORY_PRODUCT,Ue.UPDATE_INVENTORY_PRODUCT,Ue.DELETE_INVENTORY_PRODUCT,Ue.VIEW_PURCHASE_DETAIL,Ue.VIEW_BRANCH_BALANCE,Ue.UPDATE_PRODUCT_INGREDIENTS,Ue.DELETE_PRODUCT_INGREDIENTS];case Le.PURCHASING_MANAGER:return[Ue.VIEW_MENU,Ue.VIEW_MENU_ITEMS,Ue.VIEW_CATEGORIES,Ue.CREATE_CATEGORY,Ue.UPDATE_CATEGORY,Ue.VIEW_ADDONS,Ue.CREATE_ADDON,Ue.UPDATE_ADDON];case Le.WAREHOUSE_STAFF:return[Ue.VIEW_CATEGORIES,Ue.VIEW_ADDONS,Ue.VIEW_MENU,Ue.VIEW_MENU_ITEMS];default:return[]}},Ve=(e,a)=>!!E(e)||!E(a)&&(!!a.includes(Ue.ALL)||e.some(e=>a.includes(e))),ge={yes:0,own_risk:1,requires_integration:2,no:3,restricted:4},We=["no","restricted"],Be=["requires_integration","own_risk"],Ge=[{name:"Afghanistan",code:"AF",allowsPOS:"own_risk"},{name:"Albania",code:"AL",allowsPOS:"requires_integration"},{name:"Algeria",code:"DZ",allowsPOS:"own_risk"},{name:"Andorra",code:"AD",allowsPOS:"own_risk"},{name:"Angola",code:"AO",allowsPOS:"no"},{name:"Antigua and Barbuda",code:"AG",allowsPOS:"own_risk"},{name:"Argentina",code:"AR",allowsPOS:"requires_integration"},{name:"Armenia",code:"AM",allowsPOS:"requires_integration"},{name:"Australia",code:"AU",allowsPOS:"own_risk"},{name:"Austria",code:"AT",allowsPOS:"requires_integration"},{name:"Azerbaijan",code:"AZ",allowsPOS:"requires_integration"},{name:"Bahamas",code:"BS",allowsPOS:"own_risk"},{name:"Bahrain",code:"BH",allowsPOS:"own_risk"},{name:"Bangladesh",code:"BD",allowsPOS:"requires_integration"},{name:"Barbados",code:"BB",allowsPOS:"own_risk"},{name:"Belarus",code:"BY",allowsPOS:"no"},{name:"Belgium",code:"BE",allowsPOS:"no"},{name:"Belize",code:"BZ",allowsPOS:"own_risk"},{name:"Benin",code:"BJ",allowsPOS:"requires_integration"},{name:"Bhutan",code:"BT",allowsPOS:"own_risk"},{name:"Bolivia",code:"BO",allowsPOS:"requires_integration"},{name:"Bosnia and Herzegovina",code:"BA",allowsPOS:"requires_integration"},{name:"Botswana",code:"BW",allowsPOS:"requires_integration"},{name:"Brazil",code:"BR",allowsPOS:"requires_integration"},{name:"Brunei",code:"BN",allowsPOS:"yes"},{name:"Bulgaria",code:"BG",allowsPOS:"no"},{name:"Burkina Faso",code:"BF",allowsPOS:"requires_integration"},{name:"Burundi",code:"BI",allowsPOS:"requires_integration"},{name:"Cabo Verde",code:"CV",allowsPOS:"no"},{name:"Cambodia",code:"KH",allowsPOS:"own_risk"},{name:"Cameroon",code:"CM",allowsPOS:"requires_integration"},{name:"Canada",code:"CA",allowsPOS:"requires_integration"},{name:"Central African Republic",code:"CF",allowsPOS:"own_risk"},{name:"Chad",code:"TD",allowsPOS:"own_risk"},{name:"Chile",code:"CL",allowsPOS:"requires_integration"},{name:"China",code:"CN",allowsPOS:"requires_integration"},{name:"Colombia",code:"CO",allowsPOS:"requires_integration"},{name:"Comoros",code:"KM",allowsPOS:"own_risk"},{name:"Congo (Republic of the)",code:"CG",allowsPOS:"own_risk"},{name:"Congo (Democratic Republic of the)",code:"CD",allowsPOS:"requires_integration"},{name:"Costa Rica",code:"CR",allowsPOS:"requires_integration"},{name:"Côte d'Ivoire",code:"CI",allowsPOS:"requires_integration"},{name:"Croatia",code:"HR",allowsPOS:"requires_integration"},{name:"Cuba",code:"CU",allowsPOS:"restricted"},{name:"Cyprus",code:"CY",allowsPOS:"requires_integration"},{name:"Czechia",code:"CZ",allowsPOS:"own_risk"},{name:"Denmark",code:"DK",allowsPOS:"own_risk"},{name:"Djibouti",code:"DJ",allowsPOS:"own_risk"},{name:"Dominica",code:"DM",allowsPOS:"own_risk"},{name:"Dominican Republic",code:"DO",allowsPOS:"requires_integration"},{name:"Ecuador",code:"EC",allowsPOS:"requires_integration"},{name:"Egypt",code:"EG",allowsPOS:"requires_integration"},{name:"El Salvador",code:"SV",allowsPOS:"requires_integration"},{name:"Equatorial Guinea",code:"GQ",allowsPOS:"own_risk"},{name:"Eritrea",code:"ER",allowsPOS:"own_risk"},{name:"Estonia",code:"EE",allowsPOS:"own_risk"},{name:"Eswatini",code:"SZ",allowsPOS:"own_risk"},{name:"Ethiopia",code:"ET",allowsPOS:"requires_integration"},{name:"Fiji",code:"FJ",allowsPOS:"requires_integration"},{name:"Finland",code:"FI",allowsPOS:"own_risk"},{name:"France",code:"FR",allowsPOS:"no"},{name:"Gabon",code:"GA",allowsPOS:"requires_integration"},{name:"Gambia",code:"GM",allowsPOS:"own_risk"},{name:"Georgia",code:"GE",allowsPOS:"requires_integration"},{name:"Germany",code:"DE",allowsPOS:"requires_integration"},{name:"Ghana",code:"GH",allowsPOS:"requires_integration"},{name:"Greece",code:"GR",allowsPOS:"requires_integration"},{name:"Grenada",code:"GD",allowsPOS:"own_risk"},{name:"Guatemala",code:"GT",allowsPOS:"requires_integration"},{name:"Guinea",code:"GN",allowsPOS:"own_risk"},{name:"Guinea-Bissau",code:"GW",allowsPOS:"own_risk"},{name:"Guyana",code:"GY",allowsPOS:"own_risk"},{name:"Haiti",code:"HT",allowsPOS:"own_risk"},{name:"Honduras",code:"HN",allowsPOS:"own_risk"},{name:"Hungary",code:"HU",allowsPOS:"requires_integration"},{name:"Iceland",code:"IS",allowsPOS:"own_risk"},{name:"India",code:"IN",allowsPOS:"own_risk"},{name:"Indonesia",code:"ID",allowsPOS:"requires_integration"},{name:"Iran",code:"IR",allowsPOS:"restricted"},{name:"Iraq",code:"IQ",allowsPOS:"own_risk"},{name:"Ireland",code:"IE",allowsPOS:"own_risk"},{name:"Israel",code:"IL",allowsPOS:"requires_integration"},{name:"Italy",code:"IT",allowsPOS:"requires_integration"},{name:"Jamaica",code:"JM",allowsPOS:"own_risk"},{name:"Japan",code:"JP",allowsPOS:"own_risk"},{name:"Jordan",code:"JO",allowsPOS:"requires_integration"},{name:"Kazakhstan",code:"KZ",allowsPOS:"requires_integration"},{name:"Kenya",code:"KE",allowsPOS:"requires_integration"},{name:"Kiribati",code:"KI",allowsPOS:"own_risk"},{name:"Kosovo",code:"XK",allowsPOS:"requires_integration"},{name:"Kuwait",code:"KW",allowsPOS:"yes"},{name:"Kyrgyzstan",code:"KG",allowsPOS:"requires_integration"},{name:"Laos",code:"LA",allowsPOS:"own_risk"},{name:"Latvia",code:"LV",allowsPOS:"requires_integration"},{name:"Lebanon",code:"LB",allowsPOS:"own_risk"},{name:"Lesotho",code:"LS",allowsPOS:"own_risk"},{name:"Liberia",code:"LR",allowsPOS:"own_risk"},{name:"Libya",code:"LY",allowsPOS:"yes"},{name:"Liechtenstein",code:"LI",allowsPOS:"own_risk"},{name:"Lithuania",code:"LT",allowsPOS:"requires_integration"},{name:"Luxembourg",code:"LU",allowsPOS:"own_risk"},{name:"Madagascar",code:"MG",allowsPOS:"requires_integration"},{name:"Malawi",code:"MW",allowsPOS:"requires_integration"},{name:"Malaysia",code:"MY",allowsPOS:"requires_integration"},{name:"Maldives",code:"MV",allowsPOS:"own_risk"},{name:"Mali",code:"ML",allowsPOS:"own_risk"},{name:"Malta",code:"MT",allowsPOS:"no"},{name:"Marshall Islands",code:"MH",allowsPOS:"own_risk"},{name:"Mauritania",code:"MR",allowsPOS:"own_risk"},{name:"Mauritius",code:"MU",allowsPOS:"requires_integration"},{name:"Mexico",code:"MX",allowsPOS:"requires_integration"},{name:"Micronesia",code:"FM",allowsPOS:"own_risk"},{name:"Moldova",code:"MD",allowsPOS:"requires_integration"},{name:"Monaco",code:"MC",allowsPOS:"no"},{name:"Mongolia",code:"MN",allowsPOS:"requires_integration"},{name:"Montenegro",code:"ME",allowsPOS:"requires_integration"},{name:"Morocco",code:"MA",allowsPOS:"requires_integration"},{name:"Mozambique",code:"MZ",allowsPOS:"requires_integration"},{name:"Myanmar",code:"MM",allowsPOS:"own_risk"},{name:"Namibia",code:"NA",allowsPOS:"own_risk"},{name:"Nauru",code:"NR",allowsPOS:"yes"},{name:"Nepal",code:"NP",allowsPOS:"no"},{name:"Netherlands",code:"NL",allowsPOS:"yes"},{name:"New Zealand",code:"NZ",allowsPOS:"own_risk"},{name:"Nicaragua",code:"NI",allowsPOS:"requires_integration"},{name:"Niger",code:"NE",allowsPOS:"requires_integration"},{name:"Nigeria",code:"NG",allowsPOS:"requires_integration"},{name:"Korea (North)",code:"KP",allowsPOS:"restricted"},{name:"North Macedonia",code:"MK",allowsPOS:"requires_integration"},{name:"Norway",code:"NO",allowsPOS:"no"},{name:"Oman",code:"OM",allowsPOS:"requires_integration"},{name:"Pakistan",code:"PK",allowsPOS:"requires_integration"},{name:"Palau",code:"PW",allowsPOS:"own_risk"},{name:"Palestine",code:"PS",allowsPOS:"own_risk"},{name:"Panama",code:"PA",allowsPOS:"requires_integration"},{name:"Papua New Guinea",code:"PG",allowsPOS:"own_risk"},{name:"Paraguay",code:"PY",allowsPOS:"requires_integration"},{name:"Peru",code:"PE",allowsPOS:"requires_integration"},{name:"Philippines",code:"PH",allowsPOS:"no"},{name:"Poland",code:"PL",allowsPOS:"requires_integration"},{name:"Portugal",code:"PT",allowsPOS:"no"},{name:"Qatar",code:"QA",allowsPOS:"yes"},{name:"Romania",code:"RO",allowsPOS:"requires_integration"},{name:"Russia",code:"RU",allowsPOS:"restricted"},{name:"Rwanda",code:"RW",allowsPOS:"requires_integration"},{name:"Saint Kitts and Nevis",code:"KN",allowsPOS:"own_risk"},{name:"Saint Lucia",code:"LC",allowsPOS:"own_risk"},{name:"Saint Vincent and the Grenadines",code:"VC",allowsPOS:"own_risk"},{name:"Samoa",code:"WS",allowsPOS:"own_risk"},{name:"San Marino",code:"SM",allowsPOS:"own_risk"},{name:"Sao Tome and Principe",code:"ST",allowsPOS:"own_risk"},{name:"Saudi Arabia",code:"SA",allowsPOS:"requires_integration"},{name:"Senegal",code:"SN",allowsPOS:"requires_integration"},{name:"Serbia",code:"RS",allowsPOS:"no"},{name:"Seychelles",code:"SC",allowsPOS:"own_risk"},{name:"Sierra Leone",code:"SL",allowsPOS:"requires_integration"},{name:"Singapore",code:"SG",allowsPOS:"own_risk"},{name:"Slovakia",code:"SK",allowsPOS:"requires_integration"},{name:"Slovenia",code:"SI",allowsPOS:"requires_integration"},{name:"Solomon Islands",code:"SB",allowsPOS:"own_risk"},{name:"Somalia",code:"SO",allowsPOS:"own_risk"},{name:"South Africa",code:"ZA",allowsPOS:"own_risk"},{name:"Korea (South)",code:"KR",allowsPOS:"requires_integration"},{name:"South Sudan",code:"SS",allowsPOS:"own_risk"},{name:"Spain",code:"ES",allowsPOS:"no"},{name:"Sri Lanka",code:"LK",allowsPOS:"own_risk"},{name:"Sudan",code:"SD",allowsPOS:"own_risk"},{name:"Suriname",code:"SR",allowsPOS:"own_risk"},{name:"Sweden",code:"SE",allowsPOS:"requires_integration"},{name:"Switzerland",code:"CH",allowsPOS:"own_risk"},{name:"Syria",code:"SY",allowsPOS:"own_risk"},{name:"Taiwan",code:"TW",allowsPOS:"requires_integration"},{name:"Tajikistan",code:"TJ",allowsPOS:"requires_integration"},{name:"Tanzania",code:"TZ",allowsPOS:"requires_integration"},{name:"Thailand",code:"TH",allowsPOS:"own_risk"},{name:"Timor-Leste",code:"TL",allowsPOS:"own_risk"},{name:"Togo",code:"TG",allowsPOS:"requires_integration"},{name:"Tonga",code:"TO",allowsPOS:"own_risk"},{name:"Trinidad and Tobago",code:"TT",allowsPOS:"own_risk"},{name:"Tunisia",code:"TN",allowsPOS:"requires_integration"},{name:"Turkey",code:"TR",allowsPOS:"requires_integration"},{name:"Turkmenistan",code:"TM",allowsPOS:"own_risk"},{name:"Tuvalu",code:"TV",allowsPOS:"own_risk"},{name:"Uganda",code:"UG",allowsPOS:"requires_integration"},{name:"Ukraine",code:"UA",allowsPOS:"requires_integration"},{name:"United Arab Emirates",code:"AE",allowsPOS:"own_risk"},{name:"United Kingdom",code:"GB",allowsPOS:"own_risk"},{name:"United States",code:"US",allowsPOS:"own_risk"},{name:"Uruguay",code:"UY",allowsPOS:"requires_integration"},{name:"Uzbekistan",code:"UZ",allowsPOS:"requires_integration"},{name:"Vanuatu",code:"VU",allowsPOS:"own_risk"},{name:"Vatican City",code:"VA",allowsPOS:"yes"},{name:"Venezuela",code:"VE",allowsPOS:"no"},{name:"Vietnam",code:"VN",allowsPOS:"requires_integration"},{name:"Yemen",code:"YE",allowsPOS:"own_risk"},{name:"Zambia",code:"ZM",allowsPOS:"requires_integration"},{name:"Zimbabwe",code:"ZW",allowsPOS:"requires_integration"}].reduce((e,E)=>(e[E.code]=E.allowsPOS,e),{}),ke=e=>{var E;return e&&null!==(E=Ge[e.trim().toUpperCase()])&&void 0!==E?E:null},He=(e,E)=>{const a=[ke(e),ke(E)].filter(e=>null!==e);return 0===a.length?null:a.reduce((e,E)=>ge[E]>ge[e]?E:e)},pe=e=>null!==e&&We.includes(e),fe=e=>null!==e&&Be.includes(e);export{Ne as adjustLightness,$ as buildGuestContactRequest,K as buildSelectedAddonsPayload,Z as calculateTipAmount,oe as formatAddressLine,ne as formatCityLine,x as formatTipAmount,v as generateOrderItemsId,T as getAddonTitle,m as getAllSelectedOptionsListingPrice,Oe as getBaseUrl,we as getCategoryName,me as getCategoryNameById,Pe as getCoverPhotoSource,Q as getDefaultOrderType,Ve as getHasUserPermission,ce as getImageSource,le as getIsFeatureActive,O as getLocalizedContent,A as getLocalizedText,Re as getLogoImageSource,N as getOptionListingPrice,c as getOptionTitles,z as getOrderErrorMessages,h as getOrderItemListingPrice,q as getOrderItemListingRawPrice,Me as getPermissionsByRole,ke as getPosAllowance,B as getPriceSuffix,V as getProductAddon,W as getProductAllergens,u as getProductListingPrice,C as getProductOrderPrice,G as getProductSellUnitShortCuts,U as getProductTranslation,L as getProductVariant,M as getProductVariantTranslation,Te as getRegisterUrl,y as getSelectedAddonsFromOrderItems,F as getStatusIcon,I as getUnitListingPrice,D as getVariantListingPrice,De as getVideoSource,pe as isBlockingAllowance,j as isValidPreviewResponse,fe as isWarningAllowance,Ce as prepareCategoryAndProductMap,ee as preparePhoneNumber,He as resolvePosAllowance,ue as rgbDataURL,ae as validateAddressForm,Ee as validateForm,Ae as validatePhoneNumber};
2
2
  //# sourceMappingURL=index.esm.js.map