@tabres/react 1.0.48 → 1.0.50

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.
@@ -14,3 +14,4 @@ export declare const SUPPORTED_COUNTRIES: {
14
14
  export declare const DOMAIN = "tabres.com";
15
15
  export declare const DEFAULT_HOSTNAME = "tabres.com";
16
16
  export declare const IMAGE_BASE_URL = "https://images.tabres.com";
17
+ export declare const VIDEO_BASE_URL = "https://videos.tabres.com";
@@ -14,3 +14,4 @@ export declare const SUPPORTED_COUNTRIES: {
14
14
  export declare const DOMAIN = "tabres.com";
15
15
  export declare const DEFAULT_HOSTNAME = "tabres.com";
16
16
  export declare const IMAGE_BASE_URL = "https://images.tabres.com";
17
+ export declare const VIDEO_BASE_URL = "https://videos.tabres.com";
@@ -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,P;!function(e){e.LIST="list",e.GRID="grid"}(c||(c={})),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},R=(E,a,n)=>{const o=d(E);return e(o,a,n)},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)};var D;!function(e){e.SINGLE="SINGLE",e.MULTIPLE="MULTIPLE"}(D||(D={}));const N=(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===D.SINGLE?[i]:i||[];for(const e of l){const E=(r||[]).find(({id:E})=>E===e);E&&(a+=d(E))}}return a},w=({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=N(E,i);return e((s+t)*a,o,n)},m=(e,E)=>{var a;return(null===(a=null==e?void 0:e.translations)||void 0===a?void 0:a[E])||{}},C=(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))||{}},U=(e,E)=>{var a;return(null===(a=null==e?void 0:e.title)||void 0===a?void 0:a[E])||""},L=(e,E)=>((null==e?void 0:e.addons)||[]).find(({id:e})=>e===E)||{},M=e=>{switch(e){case P.WEIGHT:return" / kg";case P.VOLUME:return" / l";default:return""}},V=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,W,B,G,k,p;"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"}(W||(W={})),function(e){e.PENDING="PENDING",e.PREPARING="PREPARING",e.READY="READY",e.SERVED="SERVED"}(B||(B={})),function(e){e.CASH="CASH",e.CARD="CARD",e.WALLET="WALLET",e.TERMINAL="TERMINAL"}(G||(G={})),function(e){e.CART="CART",e.DETAILS="DETAILS",e.COMPLETED="COMPLETED"}(k||(k={})),G.CASH,k.CART,k.DETAILS,k.COMPLETED,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"}(p||(p={}));const v=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)},q=(E,a,n)=>{const o=v(E);return e(o,a,n)},Y=(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},f=e=>{switch(e){case W.COMPLETED:return _;case W.DELIVERED:return t;case W.OUT_FOR_DELIVERY:return s;case W.PREPARING:return l;case W.CONFIRMED:return i;case W.PENDING:default:return r}},b=(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}}),h=(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},y=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)},F=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}`}:{})},K=(e,E)=>!e||e<=0||!E||E<=0?0:Math.round(e*E)/100,Q=e=>e.toFixed(2),j=e=>{switch(e){case"customer":return p.ADDRESS_IS_EMPTY;case"tableId":return p.TABLE_NOT_SELECTED;case"items":return p.EMPTY_ITEMS;case"branchId":return p.BRANCH_NOT_SELECTED;default:return p.FIELD_REQUIRED_ERROR}};var $,Z;!function(e){e.PHONE="PHONE",e.OTP="OTP",e.EMAIL="EMAIL"}($||($={})),function(e){e.HOME="HOME",e.WORK="WORK",e.TRAVEL="TRAVEL"}(Z||(Z={}));const x=e=>`${e.countryCode}${e.phoneNumber}`.replaceAll("+",""),z=(e,E)=>{const a={},{email:o,otp:r}=e||{};switch(E){case $.OTP:o&&n(o)||(a.email="Invalid Email Address"),r&&6===r.length||(a.otp="Invalid OTP");break;case $.EMAIL:o&&n(o)||(a.email="Invalid Email Address")}return a},J=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},X=e=>(e||[]).filter(Boolean).join(", "),ee=(e,E,a)=>[e,[E,a].filter(Boolean).join("/")].filter(Boolean).join(" ");var Ee,ae;!function(e){e.UPLOAD_VIDEO="UPLOAD_VIDEO"}(Ee||(Ee={})),function(e){e.ALPHA="ALPHA",e.BETA="BETA",e.ALL="ALL"}(ae||(ae={}));const ne={[ae.ALPHA]:[Ee.UPLOAD_VIDEO],[ae.BETA]:[],[ae.ALL]:[]},oe=(e,E)=>{if("1"===o(e))return!0;return(E===ae.ALPHA?[ae.ALPHA,ae.BETA,ae.ALL]:E===ae.BETA?[ae.BETA,ae.ALL]:[ae.ALL]).some(E=>{var a;return null===(a=ne[E])||void 0===a?void 0:a.includes(e)})},re="tabres.com",ie="https://images.tabres.com",le={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,le[a])(n)}const te=(e,E)=>{const a=E||"en";return"localhost:3000"===e?{url:`http://localhost:3000/${a}`,domain:re}:{url:`https://${re}/${a}`,domain:re}},_e=(e,E)=>`https://app.tabres.com/auth/register?lang=${e}&utm_source=${E}`,Se=e=>e?e.includes("base64")||e.startsWith("https://")?e:`${ie}/${e}`:"",Ae=e=>e?e.includes("base64")||e.startsWith("https://")?e:`${ie}/${e}`:"https://images.tabres.com/no-photo-128.webp",Oe=e=>e?e.includes("base64")||e.startsWith("https://")?e:`${ie}/${e}`:"https://images.tabres.com/tabres-doodle.webp",Te="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",ce=(e,E,a)=>Te.charAt(e>>2)+Te.charAt((3&e)<<4|E>>4)+Te.charAt((15&E)<<2|a>>6)+Te.charAt(63&a),Pe=(e,E,a)=>`data:image/gif;base64,R0lGODlhAQABAPAA${ce(0,e,E)+ce(a,255,255)}/yH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==`,de=e=>e?e.includes("base64")||e.startsWith("https://")?e:`${ie}/${e}`:"",Re=(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 P=e=>Math.round(255*e).toString(16).padStart(2,"0");return`#${P(O)}${P(T)}${P(c)}`},Ie=(e,E)=>{var a;return(null===(a=null==e?void 0:e.name)||void 0===a?void 0:a[E])||""},ue=(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)?"":Ie(r,n)},De=(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 Ne,we;!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"}(Ne||(Ne={})),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"}(we||(we={}));const me=e=>{switch(e){case we.OWNER:return[Ne.ALL];case we.GENERAL_MANAGER:return[Ne.VIEW_BUSINESS,Ne.UPDATE_BUSINESS,Ne.VIEW_ORDERS,Ne.UPDATE_ORDER,Ne.CREATE_ORDER,Ne.VIEW_QR_MENU,Ne.VIEW_QR_CODES,Ne.VIEW_MENU,Ne.VIEW_MENU_ITEMS,Ne.UPDATE_MENU_ITEM,Ne.CREATE_MENU_ITEM,Ne.DELETE_MENU_ITEM,Ne.VIEW_CATEGORIES,Ne.UPDATE_CATEGORY,Ne.CREATE_CATEGORY,Ne.DELETE_CATEGORY,Ne.VIEW_ADDONS,Ne.UPDATE_ADDON,Ne.CREATE_ADDON,Ne.DELETE_ADDON,Ne.VIEW_TABLES,Ne.UPDATE_TABLE,Ne.CREATE_TABLE,Ne.DELETE_TABLE,Ne.VIEW_BRANCHES,Ne.UPDATE_BRANCH,Ne.CREATE_BRANCH,Ne.DELETE_BRANCH,Ne.VIEW_EMPLOYEES,Ne.UPDATE_EMPLOYEE,Ne.CREATE_EMPLOYEE,Ne.DELETE_EMPLOYEE,Ne.VIEW_ANALYTICS,Ne.VIEW_SALES_REPORTS,Ne.VIEW_SUBSCRIPTION,Ne.CREATE_QR_CODE,Ne.DELETE_QR_CODE,Ne.AI_ASSISTANT];case we.BRANCH_MANAGER:return[Ne.VIEW_BUSINESS,Ne.VIEW_ORDERS,Ne.UPDATE_ORDER,Ne.CREATE_ORDER,Ne.VIEW_QR_MENU,Ne.VIEW_QR_CODES,Ne.VIEW_MENU,Ne.VIEW_MENU_ITEMS,Ne.UPDATE_MENU_ITEM,Ne.CREATE_MENU_ITEM,Ne.DELETE_MENU_ITEM,Ne.VIEW_CATEGORIES,Ne.UPDATE_CATEGORY,Ne.CREATE_CATEGORY,Ne.DELETE_CATEGORY,Ne.VIEW_ADDONS,Ne.UPDATE_ADDON,Ne.CREATE_ADDON,Ne.DELETE_ADDON,Ne.VIEW_TABLES,Ne.UPDATE_TABLE,Ne.CREATE_TABLE,Ne.DELETE_TABLE,Ne.VIEW_EMPLOYEES,Ne.UPDATE_EMPLOYEE,Ne.VIEW_ANALYTICS,Ne.VIEW_SALES_REPORTS,Ne.CREATE_QR_CODE,Ne.DELETE_QR_CODE,Ne.AI_ASSISTANT];case we.CHEF:return[Ne.VIEW_MENU,Ne.VIEW_MENU_ITEMS,Ne.UPDATE_MENU_ITEM,Ne.VIEW_CATEGORIES,Ne.UPDATE_CATEGORY,Ne.VIEW_ADDONS,Ne.UPDATE_ADDON,Ne.VIEW_ORDERS,Ne.UPDATE_ORDER];case we.SOUS_CHEF:return[Ne.VIEW_MENU,Ne.VIEW_MENU_ITEMS,Ne.VIEW_CATEGORIES,Ne.VIEW_ADDONS,Ne.VIEW_ORDERS,Ne.UPDATE_ORDER];case we.PASTRY_CHEF:return[Ne.VIEW_MENU,Ne.VIEW_MENU_ITEMS,Ne.UPDATE_MENU_ITEM,Ne.VIEW_ORDERS,Ne.UPDATE_ORDER];case we.LINE_COOK:case we.PREP_COOK:case we.KITCHEN_ASSISTANT:return[Ne.VIEW_MENU,Ne.VIEW_MENU_ITEMS,Ne.VIEW_ORDERS,Ne.UPDATE_ORDER];case we.HEAD_WAITER:return[Ne.VIEW_ORDERS,Ne.CREATE_ORDER,Ne.UPDATE_ORDER,Ne.VIEW_TABLES,Ne.UPDATE_TABLE_STATUS,Ne.VIEW_MENU,Ne.VIEW_MENU_ITEMS,Ne.VIEW_CATEGORIES,Ne.VIEW_ADDONS,Ne.VIEW_QR_MENU,Ne.VIEW_QR_CODES];case we.WAITER:return[Ne.VIEW_ORDERS,Ne.CREATE_ORDER,Ne.UPDATE_ORDER,Ne.VIEW_TABLES,Ne.UPDATE_TABLE_STATUS,Ne.VIEW_MENU,Ne.VIEW_MENU_ITEMS,Ne.VIEW_CATEGORIES,Ne.VIEW_ADDONS];case we.RUNNER:return[Ne.VIEW_ORDERS,Ne.UPDATE_ORDER];case we.BARISTA:case we.BARTENDER:case we.SOMMELIER:case we.ROOM_SERVICE_STAFF:return[Ne.VIEW_MENU,Ne.VIEW_MENU_ITEMS,Ne.VIEW_ORDERS,Ne.CREATE_ORDER,Ne.UPDATE_ORDER];case we.ACCOUNTANT:return[Ne.VIEW_ANALYTICS,Ne.VIEW_SALES_REPORTS,Ne.VIEW_SUBSCRIPTION];case we.DELIVERY_DRIVER:return[Ne.VIEW_ORDERS,Ne.UPDATE_ORDER];case we.INVENTORY_MANAGER:return[Ne.VIEW_CATEGORIES,Ne.UPDATE_CATEGORY,Ne.CREATE_CATEGORY,Ne.DELETE_CATEGORY,Ne.VIEW_ADDONS,Ne.UPDATE_ADDON,Ne.CREATE_ADDON,Ne.DELETE_ADDON,Ne.VIEW_MENU,Ne.VIEW_MENU_ITEMS,Ne.UPDATE_MENU_ITEM,Ne.CREATE_MENU_ITEM,Ne.DELETE_MENU_ITEM,Ne.VIEW_PURCHASES,Ne.CREATE_PURCHASE,Ne.UPDATE_PURCHASE,Ne.DELETE_PURCHASE,Ne.VIEW_INVENTORY,Ne.VIEW_INVENTORY_PRODUCTS,Ne.CREATE_INVENTORY_PRODUCT,Ne.UPDATE_INVENTORY_PRODUCT,Ne.DELETE_INVENTORY_PRODUCT,Ne.VIEW_PURCHASE_DETAIL,Ne.VIEW_BRANCH_BALANCE,Ne.UPDATE_PRODUCT_INGREDIENTS,Ne.DELETE_PRODUCT_INGREDIENTS];case we.PURCHASING_MANAGER:return[Ne.VIEW_MENU,Ne.VIEW_MENU_ITEMS,Ne.VIEW_CATEGORIES,Ne.CREATE_CATEGORY,Ne.UPDATE_CATEGORY,Ne.VIEW_ADDONS,Ne.CREATE_ADDON,Ne.UPDATE_ADDON];case we.WAREHOUSE_STAFF:return[Ne.VIEW_CATEGORIES,Ne.VIEW_ADDONS,Ne.VIEW_MENU,Ne.VIEW_MENU_ITEMS];default:return[]}},Ce=(e,a)=>!!E(e)||!E(a)&&(!!a.includes(Ne.ALL)||e.some(e=>a.includes(e))),Ue={yes:0,own_risk:1,requires_integration:2,no:3,restricted:4},Le=["no","restricted"],Me=["requires_integration","own_risk"],Ve=[{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=Ve[e.trim().toUpperCase()])&&void 0!==E?E:null},We=(e,E)=>{const a=[ge(e),ge(E)].filter(e=>null!==e);return 0===a.length?null:a.reduce((e,E)=>Ue[E]>Ue[e]?E:e)},Be=e=>null!==e&&Le.includes(e),Ge=e=>null!==e&&Me.includes(e);export{Re as adjustLightness,F as buildGuestContactRequest,b as buildSelectedAddonsPayload,K as calculateTipAmount,ee as formatAddressLine,X as formatCityLine,Q as formatTipAmount,Y as generateOrderItemsId,A as getAddonOptionTranslation,T as getAddonTitle,S as getAddonTranslation,N as getAllSelectedOptionsListingPrice,te as getBaseUrl,Ie as getCategoryName,ue as getCategoryNameById,Oe as getCoverPhotoSource,h as getDefaultOrderType,Ce as getHasUserPermission,Se as getImageSource,oe as getIsFeatureActive,Ae as getLogoImageSource,u as getOptionListingPrice,O as getOptionTitles,j as getOrderErrorMessages,q as getOrderItemListingPrice,v as getOrderItemListingRawPrice,me as getPermissionsByRole,ge as getPosAllowance,M as getPriceSuffix,L as getProductAddon,R as getProductListingPrice,w as getProductOrderPrice,V as getProductSellUnitShortCuts,m as getProductTranslation,C as getProductVariant,U as getProductVariantTranslation,_e as getRegisterUrl,H as getSelectedAddonsFromOrderItems,f as getStatusIcon,d as getUnitListingPrice,I as getVariantListingPrice,de as getVideoSource,Be as isBlockingAllowance,y as isValidPreviewResponse,Ge as isWarningAllowance,De as prepareCategoryAndProductMap,x as preparePhoneNumber,We as resolvePosAllowance,Pe as rgbDataURL,J as validateAddressForm,z 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 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,d;!function(e){e.LIST="list",e.GRID="grid"}(c||(c={})),function(e){e.PIECE="PIECE",e.WEIGHT="WEIGHT",e.VOLUME="VOLUME"}(d||(d={}));const P=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},R=(E,a,n)=>{const o=P(E);return e(o,a,n)},I=(E,a,n)=>{const o=P(E);return e(o,a,n)},u=(E,a,n)=>{const o=P(E);return e(o,a,n)};var D;!function(e){e.SINGLE="SINGLE",e.MULTIPLE="MULTIPLE"}(D||(D={}));const N=(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===D.SINGLE?[i]:i||[];for(const e of l){const E=(r||[]).find(({id:E})=>E===e);E&&(a+=P(E))}}return a},w=({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=P(r?l:E),t=N(E,i);return e((s+t)*a,o,n)},m=(e,E)=>{var a;return(null===(a=null==e?void 0:e.translations)||void 0===a?void 0:a[E])||{}},C=(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))||{}},U=(e,E)=>{var a;return(null===(a=null==e?void 0:e.title)||void 0===a?void 0:a[E])||""},L=(e,E)=>((null==e?void 0:e.addons)||[]).find(({id:e})=>e===E)||{},M=e=>{switch(e){case d.WEIGHT:return" / kg";case d.VOLUME:return" / l";default:return""}},V=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 g,W,B,G,k,p;"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"}(W||(W={})),function(e){e.PENDING="PENDING",e.PREPARING="PREPARING",e.READY="READY",e.SERVED="SERVED"}(B||(B={})),function(e){e.CASH="CASH",e.CARD="CARD",e.WALLET="WALLET",e.TERMINAL="TERMINAL"}(G||(G={})),function(e){e.CART="CART",e.DETAILS="DETAILS",e.COMPLETED="COMPLETED"}(k||(k={})),G.CASH,k.CART,k.DETAILS,k.COMPLETED,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"}(p||(p={}));const v=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)},q=(E,a,n)=>{const o=v(E);return e(o,a,n)},Y=(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},b=e=>{switch(e){case W.COMPLETED:return _;case W.DELIVERED:return t;case W.OUT_FOR_DELIVERY:return s;case W.PREPARING:return l;case W.CONFIRMED:return i;case W.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}}),h=(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},y=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)},F=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}`}:{})},K=(e,E)=>!e||e<=0||!E||E<=0?0:Math.round(e*E)/100,Q=e=>e.toFixed(2),j=e=>{switch(e){case"customer":return p.ADDRESS_IS_EMPTY;case"tableId":return p.TABLE_NOT_SELECTED;case"items":return p.EMPTY_ITEMS;case"branchId":return p.BRANCH_NOT_SELECTED;default:return p.FIELD_REQUIRED_ERROR}};var $,Z;!function(e){e.PHONE="PHONE",e.OTP="OTP",e.EMAIL="EMAIL"}($||($={})),function(e){e.HOME="HOME",e.WORK="WORK",e.TRAVEL="TRAVEL"}(Z||(Z={}));const x=e=>`${e.countryCode}${e.phoneNumber}`.replaceAll("+",""),z=(e,E)=>{const a={},{email:o,otp:r}=e||{};switch(E){case $.OTP:o&&n(o)||(a.email="Invalid Email Address"),r&&6===r.length||(a.otp="Invalid OTP");break;case $.EMAIL:o&&n(o)||(a.email="Invalid Email Address")}return a},J=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},X=e=>(e||[]).filter(Boolean).join(", "),ee=(e,E,a)=>[e,[E,a].filter(Boolean).join("/")].filter(Boolean).join(" ");var Ee,ae;!function(e){e.UPLOAD_VIDEO="UPLOAD_VIDEO"}(Ee||(Ee={})),function(e){e.ALPHA="ALPHA",e.BETA="BETA",e.ALL="ALL"}(ae||(ae={}));const ne={[ae.ALPHA]:[Ee.UPLOAD_VIDEO],[ae.BETA]:[],[ae.ALL]:[]},oe=(e,E)=>{if("1"===o(e))return!0;return(E===ae.ALPHA?[ae.ALPHA,ae.BETA,ae.ALL]:E===ae.BETA?[ae.BETA,ae.ALL]:[ae.ALL]).some(E=>{var a;return null===(a=ne[E])||void 0===a?void 0:a.includes(e)})},re="tabres.com",ie="https://images.tabres.com",le={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,le[a])(n)}const te=(e,E)=>{const a=E||"en";return"localhost:3000"===e?{url:`http://localhost:3000/${a}`,domain:re}:{url:`https://${re}/${a}`,domain:re}},_e=(e,E)=>`https://app.tabres.com/auth/register?lang=${e}&utm_source=${E}`,Se=e=>e?e.includes("base64")||e.startsWith("https://")?e:`${ie}/${e}`:"",Ae=e=>e?e.includes("base64")||e.startsWith("https://")?e:`${ie}/${e}`:"https://images.tabres.com/no-photo-128.webp",Oe=e=>e?e.includes("base64")||e.startsWith("https://")?e:`${ie}/${e}`:"https://images.tabres.com/tabres-doodle.webp",Te="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",ce=(e,E,a)=>Te.charAt(e>>2)+Te.charAt((3&e)<<4|E>>4)+Te.charAt((15&E)<<2|a>>6)+Te.charAt(63&a),de=(e,E,a)=>`data:image/gif;base64,R0lGODlhAQABAPAA${ce(0,e,E)+ce(a,255,255)}/yH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==`,Pe=e=>e?e.includes("base64")||e.startsWith("https://")?e:`https://videos.tabres.com/${e}`:"",Re=(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 d=e=>Math.round(255*e).toString(16).padStart(2,"0");return`#${d(O)}${d(T)}${d(c)}`},Ie=(e,E)=>{var a;return(null===(a=null==e?void 0:e.name)||void 0===a?void 0:a[E])||""},ue=(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)?"":Ie(r,n)},De=(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 Ne,we;!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"}(Ne||(Ne={})),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"}(we||(we={}));const me=e=>{switch(e){case we.OWNER:return[Ne.ALL];case we.GENERAL_MANAGER:return[Ne.VIEW_BUSINESS,Ne.UPDATE_BUSINESS,Ne.VIEW_ORDERS,Ne.UPDATE_ORDER,Ne.CREATE_ORDER,Ne.VIEW_QR_MENU,Ne.VIEW_QR_CODES,Ne.VIEW_MENU,Ne.VIEW_MENU_ITEMS,Ne.UPDATE_MENU_ITEM,Ne.CREATE_MENU_ITEM,Ne.DELETE_MENU_ITEM,Ne.VIEW_CATEGORIES,Ne.UPDATE_CATEGORY,Ne.CREATE_CATEGORY,Ne.DELETE_CATEGORY,Ne.VIEW_ADDONS,Ne.UPDATE_ADDON,Ne.CREATE_ADDON,Ne.DELETE_ADDON,Ne.VIEW_TABLES,Ne.UPDATE_TABLE,Ne.CREATE_TABLE,Ne.DELETE_TABLE,Ne.VIEW_BRANCHES,Ne.UPDATE_BRANCH,Ne.CREATE_BRANCH,Ne.DELETE_BRANCH,Ne.VIEW_EMPLOYEES,Ne.UPDATE_EMPLOYEE,Ne.CREATE_EMPLOYEE,Ne.DELETE_EMPLOYEE,Ne.VIEW_ANALYTICS,Ne.VIEW_SALES_REPORTS,Ne.VIEW_SUBSCRIPTION,Ne.CREATE_QR_CODE,Ne.DELETE_QR_CODE,Ne.AI_ASSISTANT];case we.BRANCH_MANAGER:return[Ne.VIEW_BUSINESS,Ne.VIEW_ORDERS,Ne.UPDATE_ORDER,Ne.CREATE_ORDER,Ne.VIEW_QR_MENU,Ne.VIEW_QR_CODES,Ne.VIEW_MENU,Ne.VIEW_MENU_ITEMS,Ne.UPDATE_MENU_ITEM,Ne.CREATE_MENU_ITEM,Ne.DELETE_MENU_ITEM,Ne.VIEW_CATEGORIES,Ne.UPDATE_CATEGORY,Ne.CREATE_CATEGORY,Ne.DELETE_CATEGORY,Ne.VIEW_ADDONS,Ne.UPDATE_ADDON,Ne.CREATE_ADDON,Ne.DELETE_ADDON,Ne.VIEW_TABLES,Ne.UPDATE_TABLE,Ne.CREATE_TABLE,Ne.DELETE_TABLE,Ne.VIEW_EMPLOYEES,Ne.UPDATE_EMPLOYEE,Ne.VIEW_ANALYTICS,Ne.VIEW_SALES_REPORTS,Ne.CREATE_QR_CODE,Ne.DELETE_QR_CODE,Ne.AI_ASSISTANT];case we.CHEF:return[Ne.VIEW_MENU,Ne.VIEW_MENU_ITEMS,Ne.UPDATE_MENU_ITEM,Ne.VIEW_CATEGORIES,Ne.UPDATE_CATEGORY,Ne.VIEW_ADDONS,Ne.UPDATE_ADDON,Ne.VIEW_ORDERS,Ne.UPDATE_ORDER];case we.SOUS_CHEF:return[Ne.VIEW_MENU,Ne.VIEW_MENU_ITEMS,Ne.VIEW_CATEGORIES,Ne.VIEW_ADDONS,Ne.VIEW_ORDERS,Ne.UPDATE_ORDER];case we.PASTRY_CHEF:return[Ne.VIEW_MENU,Ne.VIEW_MENU_ITEMS,Ne.UPDATE_MENU_ITEM,Ne.VIEW_ORDERS,Ne.UPDATE_ORDER];case we.LINE_COOK:case we.PREP_COOK:case we.KITCHEN_ASSISTANT:return[Ne.VIEW_MENU,Ne.VIEW_MENU_ITEMS,Ne.VIEW_ORDERS,Ne.UPDATE_ORDER];case we.HEAD_WAITER:return[Ne.VIEW_ORDERS,Ne.CREATE_ORDER,Ne.UPDATE_ORDER,Ne.VIEW_TABLES,Ne.UPDATE_TABLE_STATUS,Ne.VIEW_MENU,Ne.VIEW_MENU_ITEMS,Ne.VIEW_CATEGORIES,Ne.VIEW_ADDONS,Ne.VIEW_QR_MENU,Ne.VIEW_QR_CODES];case we.WAITER:return[Ne.VIEW_ORDERS,Ne.CREATE_ORDER,Ne.UPDATE_ORDER,Ne.VIEW_TABLES,Ne.UPDATE_TABLE_STATUS,Ne.VIEW_MENU,Ne.VIEW_MENU_ITEMS,Ne.VIEW_CATEGORIES,Ne.VIEW_ADDONS];case we.RUNNER:return[Ne.VIEW_ORDERS,Ne.UPDATE_ORDER];case we.BARISTA:case we.BARTENDER:case we.SOMMELIER:case we.ROOM_SERVICE_STAFF:return[Ne.VIEW_MENU,Ne.VIEW_MENU_ITEMS,Ne.VIEW_ORDERS,Ne.CREATE_ORDER,Ne.UPDATE_ORDER];case we.ACCOUNTANT:return[Ne.VIEW_ANALYTICS,Ne.VIEW_SALES_REPORTS,Ne.VIEW_SUBSCRIPTION];case we.DELIVERY_DRIVER:return[Ne.VIEW_ORDERS,Ne.UPDATE_ORDER];case we.INVENTORY_MANAGER:return[Ne.VIEW_CATEGORIES,Ne.UPDATE_CATEGORY,Ne.CREATE_CATEGORY,Ne.DELETE_CATEGORY,Ne.VIEW_ADDONS,Ne.UPDATE_ADDON,Ne.CREATE_ADDON,Ne.DELETE_ADDON,Ne.VIEW_MENU,Ne.VIEW_MENU_ITEMS,Ne.UPDATE_MENU_ITEM,Ne.CREATE_MENU_ITEM,Ne.DELETE_MENU_ITEM,Ne.VIEW_PURCHASES,Ne.CREATE_PURCHASE,Ne.UPDATE_PURCHASE,Ne.DELETE_PURCHASE,Ne.VIEW_INVENTORY,Ne.VIEW_INVENTORY_PRODUCTS,Ne.CREATE_INVENTORY_PRODUCT,Ne.UPDATE_INVENTORY_PRODUCT,Ne.DELETE_INVENTORY_PRODUCT,Ne.VIEW_PURCHASE_DETAIL,Ne.VIEW_BRANCH_BALANCE,Ne.UPDATE_PRODUCT_INGREDIENTS,Ne.DELETE_PRODUCT_INGREDIENTS];case we.PURCHASING_MANAGER:return[Ne.VIEW_MENU,Ne.VIEW_MENU_ITEMS,Ne.VIEW_CATEGORIES,Ne.CREATE_CATEGORY,Ne.UPDATE_CATEGORY,Ne.VIEW_ADDONS,Ne.CREATE_ADDON,Ne.UPDATE_ADDON];case we.WAREHOUSE_STAFF:return[Ne.VIEW_CATEGORIES,Ne.VIEW_ADDONS,Ne.VIEW_MENU,Ne.VIEW_MENU_ITEMS];default:return[]}},Ce=(e,a)=>!!E(e)||!E(a)&&(!!a.includes(Ne.ALL)||e.some(e=>a.includes(e))),Ue={yes:0,own_risk:1,requires_integration:2,no:3,restricted:4},Le=["no","restricted"],Me=["requires_integration","own_risk"],Ve=[{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=Ve[e.trim().toUpperCase()])&&void 0!==E?E:null},We=(e,E)=>{const a=[ge(e),ge(E)].filter(e=>null!==e);return 0===a.length?null:a.reduce((e,E)=>Ue[E]>Ue[e]?E:e)},Be=e=>null!==e&&Le.includes(e),Ge=e=>null!==e&&Me.includes(e);export{Re as adjustLightness,F as buildGuestContactRequest,f as buildSelectedAddonsPayload,K as calculateTipAmount,ee as formatAddressLine,X as formatCityLine,Q as formatTipAmount,Y as generateOrderItemsId,A as getAddonOptionTranslation,T as getAddonTitle,S as getAddonTranslation,N as getAllSelectedOptionsListingPrice,te as getBaseUrl,Ie as getCategoryName,ue as getCategoryNameById,Oe as getCoverPhotoSource,h as getDefaultOrderType,Ce as getHasUserPermission,Se as getImageSource,oe as getIsFeatureActive,Ae as getLogoImageSource,u as getOptionListingPrice,O as getOptionTitles,j as getOrderErrorMessages,q as getOrderItemListingPrice,v as getOrderItemListingRawPrice,me as getPermissionsByRole,ge as getPosAllowance,M as getPriceSuffix,L as getProductAddon,R as getProductListingPrice,w as getProductOrderPrice,V as getProductSellUnitShortCuts,m as getProductTranslation,C as getProductVariant,U as getProductVariantTranslation,_e as getRegisterUrl,H as getSelectedAddonsFromOrderItems,b as getStatusIcon,P as getUnitListingPrice,I as getVariantListingPrice,Pe as getVideoSource,Be as isBlockingAllowance,y as isValidPreviewResponse,Ge as isWarningAllowance,De as prepareCategoryAndProductMap,x as preparePhoneNumber,We as resolvePosAllowance,de as rgbDataURL,J as validateAddressForm,z as validateForm,se as validatePhoneNumber};
2
2
  //# sourceMappingURL=index.esm.js.map