
/* /web_tour/static/src/tour_pointer/tour_pointer.js */
odoo.define('@web_tour/tour_pointer/tour_pointer',['@odoo/owl','@web/core/position/position_hook','@web/core/utils/hooks'],function(require){'use strict';let __exports={};const{Component,useEffect,useRef,useState}=require("@odoo/owl");const{usePosition}=require("@web/core/position/position_hook");const{useBus,useService}=require("@web/core/utils/hooks");const TourPointer=__exports.TourPointer=class TourPointer extends Component{static props={pointerState:{type:Object,shape:{anchor:{type:HTMLElement,optional:true},content:{type:String,optional:true},isOpen:{type:Boolean,optional:true},isVisible:{type:Boolean,optional:true},isZone:{type:Boolean,optional:true},onClick:{type:[Function,{value:null}],optional:true},onMouseEnter:{type:[Function,{value:null}],optional:true},onMouseLeave:{type:[Function,{value:null}],optional:true},position:{type:[{value:"left"},{value:"right"},{value:"top"},{value:"bottom"},],optional:true,},rev:{type:Number,optional:true},},},bounce:{type:Boolean,optional:true},};static defaultProps={bounce:true,};static template="web_tour.TourPointer";static width=28;static height=28;setup(){const positionOptions={margin:6,onPositioned:(pointer,position)=>{const popperRect=pointer.getBoundingClientRect();const{top,left,direction}=position;if(direction==="top"){pointer.style.bottom=`${window.innerHeight - top - popperRect.height}px`;pointer.style.removeProperty("top");}else if(direction==="left"){pointer.style.right=`${window.innerWidth - left - popperRect.width}px`;pointer.style.removeProperty("left");}},};Object.defineProperty(positionOptions,"position",{get:()=>this.position,enumerable:true,});const position=usePosition("pointer",()=>this.props.pointerState.anchor,positionOptions);const rootRef=useRef("pointer");const zoneRef=useRef("zone");let dimensions=null;let lastMeasuredContent=null;let lastOpenState=this.isOpen;let lastAnchor;let[anchorX,anchorY]=[0,0];useEffect(()=>{const{el:pointer}=rootRef;const{el:zone}=zoneRef;if(pointer){const hasContentChanged=lastMeasuredContent!==this.content;const hasOpenStateChanged=lastOpenState!==this.isOpen;lastOpenState=this.isOpen;if(this.props.pointerState.isZone){const{anchor}=this.props.pointerState;let offsetLeft=0;let offsetTop=0;if(document!==anchor.ownerDocument){const iframe=[...document.querySelectorAll("iframe")].filter((e)=>e.contentDocument===anchor.ownerDocument)[0];offsetLeft=iframe.getBoundingClientRect().left;offsetTop=iframe.getBoundingClientRect().top;}
const{left,top,width,height}=anchor.getBoundingClientRect();zone.style.minWidth=width+"px";zone.style.minHeight=height+"px";zone.style.left=left+offsetLeft+"px";zone.style.top=top+offsetTop+"px";}
if(hasContentChanged){lastMeasuredContent=this.content;pointer.style.removeProperty("width");pointer.style.removeProperty("height");dimensions=pointer.getBoundingClientRect();}
if(hasContentChanged||hasOpenStateChanged){const[width,height]=this.isOpen?[dimensions.width,dimensions.height]:[this.constructor.width,this.constructor.height];if(this.isOpen){pointer.style.removeProperty("transition");}else{pointer.style.setProperty("transition","none");}
pointer.style.setProperty("width",`${width}px`);pointer.style.setProperty("height",`${height}px`);}
if(!this.isOpen){const{anchor}=this.props.pointerState;if(anchor===lastAnchor){const{x,y,width}=anchor.getBoundingClientRect();const[lastAnchorX,lastAnchorY]=[anchorX,anchorY];[anchorX,anchorY]=[x,y];const delta=Math.sqrt(Math.pow(x-lastAnchorX,2)+Math.pow(y-lastAnchorY,2));if(delta<1){position.lock();return;}
const wouldOverflow=window.innerWidth-x-width/2<dimensions?.width;pointer.classList.toggle("o_expand_left",wouldOverflow);}
lastAnchor=anchor;pointer.style.bottom="";pointer.style.right="";position.unlock();}}else{lastMeasuredContent=null;lastOpenState=false;lastAnchor=null;dimensions=null;}});this.state=useState({triggerBelow:false});const uiService=useService("ui");const onActiveElementChanged=()=>{const activeEl=uiService.activeElement;const pointerAnchor=this.props.pointerState.anchor;if(pointerAnchor){this.state.triggerBelow=!activeEl.contains(pointerAnchor);}};useBus(uiService.bus,"active-element-changed",onActiveElementChanged);}
get isVisible(){return this.props.pointerState.isVisible&&!this.state.triggerBelow;}
get content(){return this.props.pointerState.content||"";}
get isOpen(){return this.props.pointerState.isOpen&&this.content;}
get position(){return this.props.pointerState.position||"top";}}
return __exports;});;

/* /web_tour/static/src/tour_service/tour_automatic.js */
odoo.define('@web_tour/tour_service/tour_automatic',['@odoo/hoot-dom','@web/../lib/hoot-dom/helpers/events','@web/core/browser/browser','@web/core/macro','@web/core/transition','@web_tour/tour_service/tour_state','@web_tour/tour_service/tour_step_automatic'],function(require){'use strict';let __exports={};const hootDom=require("@odoo/hoot-dom");const{enableEventLogs,setupEventActions}=require("@web/../lib/hoot-dom/helpers/events");const{browser}=require("@web/core/browser/browser");const{Macro}=require("@web/core/macro");const{config:transitionConfig}=require("@web/core/transition");const{tourState}=require("@web_tour/tour_service/tour_state");const{TourStepAutomatic}=require("@web_tour/tour_service/tour_step_automatic");const TourAutomatic=__exports.TourAutomatic=class TourAutomatic{mode="auto";allowUnload=false;constructor(data){Object.assign(this,data);this.steps=this.steps.map((step,index)=>new TourStepAutomatic(step,this,index));this.config=tourState.getCurrentConfig()||{};}
get currentIndex(){return tourState.getCurrentIndex();}
get currentStep(){return this.steps[this.currentIndex];}
get debugMode(){return this.config.debug!==false;}
start(){setupEventActions(document.createElement("div"),{allowSubmit:true});enableEventLogs(this.debugMode);const{delayToCheckUndeterminisms,stepDelay}=this.config;const macroSteps=this.steps.filter((step)=>step.index>=this.currentIndex).flatMap((step)=>[{action:async()=>{if(this.debugMode){console.groupCollapsed(step.describeMe);console.log(step.stringify);if(step.break){debugger;}}else{console.log(step.describeMe);}
await new Promise((resolve)=>requestAnimationFrame(resolve));if(stepDelay>0){await hootDom.delay(stepDelay);}},},{trigger:step.trigger?()=>step.findTrigger():null,timeout:step.pause&&this.debugMode?9999999:step.timeout||this.timeout||10000,action:async(trigger)=>{if(delayToCheckUndeterminisms>0){await step.checkForUndeterminisms(trigger,delayToCheckUndeterminisms);}
if(!step.skipped&&step.expectUnloadPage){this.allowUnload=true;setTimeout(()=>{const message=`
                                    The key { expectUnloadPage } is defined but page has not been unloaded within 20000 ms.
                                    You probably don't need it.
                                `.replace(/^\s+/gm,"");this.throwError(message);},20000);}
await step.doAction();if(this.debugMode){console.log(trigger);if(step.skipped){console.log("This step has been skipped");}else{console.log("This step has run successfully");}
console.groupEnd();if(step.pause){await this.pause();}}
tourState.setCurrentIndex(step.index+1);if(this.allowUnload){return"StopTheMacro!";}},},]);const end=()=>{delete window[hootNameSpace];transitionConfig.disabled=false;tourState.clear();window.addEventListener("error",(ev)=>{ev.preventDefault();ev.stopImmediatePropagation();},true);window.addEventListener("unhandledrejection",(ev)=>{ev.preventDefault();ev.stopImmediatePropagation();},true);};this.macro=new Macro({name:this.name,steps:macroSteps,onError:(error)=>{if(error.type==="Timeout"){this.throwError(...this.currentStep.describeWhyIFailed,error.message);}else{this.throwError(error.message);}
end();},onComplete:()=>{browser.console.log("tour succeeded");const succeeded=`║ TOUR ${this.name} SUCCEEDED ║`;const msg=[succeeded];msg.unshift("╔"+"═".repeat(succeeded.length-2)+"╗");msg.push("╚"+"═".repeat(succeeded.length-2)+"╝");browser.console.log(`\n\n${msg.join("\n")}\n`);end();},});if(this.debugMode&&this.currentIndex===0){debugger;}
transitionConfig.disabled=true;const hootNameSpace=hootDom.exposeHelpers(hootDom);console.debug(`Hoot DOM helpers available from \`window.${hootNameSpace}\``);this.macro.start();}
get describeWhereIFailed(){const offset=3;const start=Math.max(this.currentIndex-offset,0);const end=Math.min(this.currentIndex+offset,this.steps.length-1);const result=[];for(let i=start;i<=end;i++){const step=this.steps[i];const stepString=step.stringify;const text=[stepString];if(i===this.currentIndex){const line="-".repeat(10);const failing_step=`${line} FAILED: ${step.describeMe} ${line}`;text.unshift(failing_step);text.push("-".repeat(failing_step.length));}
result.push(...text);}
return result.join("\n");}
throwError(...args){console.groupEnd();tourState.setCurrentTourOnError();browser.console.error([`FAILED: ${this.currentStep.describeMe}.`,...args].join("\n"));browser.console.dir(this.describeWhereIFailed);if(this.debugMode){debugger;}}
async pause(){const styles=["background: black; color: white; font-size: 14px","background: black; color: orange; font-size: 14px",];console.log(`%cTour is paused. Use %cplay()%c to continue.`,styles[0],styles[1],styles[0]);await new Promise((resolve)=>{window.play=()=>{resolve();delete window.play;};});}}
return __exports;});;

/* /web_tour/static/src/tour_service/tour_helpers.js */
odoo.define('@web_tour/tour_service/tour_helpers',['@odoo/hoot-dom','@web/core/macro'],function(require){'use strict';let __exports={};const hoot=require("@odoo/hoot-dom");const{waitForStable}=require("@web/core/macro");const TourHelpers=__exports.TourHelpers=class TourHelpers{constructor(anchor){this.anchor=anchor;this.delay=20;}
async check(selector){const element=this._get_action_element(selector);await hoot.check(element);}
async clear(selector){const element=this._get_action_element(selector);await hoot.click(element);await hoot.clear();}
async click(selector){const element=this._get_action_element(selector);await hoot.click(element,{interactive:false});}
async dblclick(selector){const element=this._get_action_element(selector);await hoot.dblclick(element);}
async drag_and_drop(selector,options){if(typeof options!=="object"){options={position:"top",relative:true};}
const dragEffectDelay=async()=>{await hoot.animationFrame();await hoot.delay(this.delay);};const element=this.anchor;const{drop,moveTo}=await hoot.drag(element);await dragEffectDelay();await hoot.hover(element,{position:{top:20,left:20,},relative:true,});await dragEffectDelay();const target=await hoot.waitFor(selector,{visible:true,timeout:1000,});await moveTo(target,options);await dragEffectDelay();await drop();await dragEffectDelay();}
async edit(text,selector){const element=this._get_action_element(selector);await hoot.click(element);await hoot.edit(text);}
async editor(text,selector){const element=this._get_action_element(selector);const InEditor=Boolean(element.closest(".odoo-editor-editable"));if(!InEditor){throw new Error("run 'editor' always on an element in an editor");}
await hoot.click(element);this._set_range(element,"start");await hoot.keyDown("_");element.textContent=text;await hoot.manuallyDispatchProgrammaticEvent(element,"input");this._set_range(element,"stop");await hoot.keyUp("_");await hoot.manuallyDispatchProgrammaticEvent(element,"change");}
async fill(value,selector){const element=this._get_action_element(selector);await hoot.click(element);await hoot.fill(value);}
async hover(selector){const element=this._get_action_element(selector);await hoot.hover(element);}
async range(value,selector){const element=this._get_action_element(selector);await hoot.click(element);await hoot.setInputRange(element,value);}
async press(...args){await hoot.press(args.flatMap((arg)=>typeof arg==="string"&&arg.split("+")));}
async select(value,selector){const element=this._get_action_element(selector);await hoot.click(element);await hoot.select(value,{target:element});}
async selectByIndex(index,selector){const element=this._get_action_element(selector);await hoot.click(element);const value=hoot.queryValue(`option:eq(${index})`,{root:element});if(value){await hoot.select(value,{target:element});await hoot.manuallyDispatchProgrammaticEvent(element,"input");}}
async selectByLabel(contains,selector){const element=this._get_action_element(selector);await hoot.click(element);const values=hoot.queryAllValues(`option:contains(${contains})`,{root:element});await hoot.select(values,{target:element});}
async uncheck(selector){const element=this._get_action_element(selector);await hoot.uncheck(element);}
async goToUrl(url){const linkEl=document.createElement("a");linkEl.href=url;await waitForStable();await hoot.click(linkEl);}
_get_action_element(selector){if(typeof selector==="string"&&selector.length){const nodes=hoot.queryAll(selector);return nodes.find(hoot.isVisible)||nodes.at(0);}else if(typeof selector==="object"&&Boolean(selector?.nodeType)){return selector;}
return this.anchor;}
_set_range(element,start_or_stop){function _node_length(node){if(node.nodeType===Node.TEXT_NODE){return node.nodeValue.length;}else{return node.childNodes.length;}}
const selection=element.ownerDocument.getSelection();selection.removeAllRanges();const range=new Range();let node=element;let length=0;if(start_or_stop==="start"){while(node.firstChild){node=node.firstChild;}}else{while(node.lastChild){node=node.lastChild;}
length=_node_length(node);}
range.setStart(node,length);range.setEnd(node,length);selection.addRange(range);}}
return __exports;});;

/* /web_tour/static/src/tour_service/tour_interactive.js */
odoo.define('@web_tour/tour_service/tour_interactive',['@web_tour/tour_service/tour_state','@web/core/utils/timing','@web_tour/tour_service/tour_utils','@odoo/hoot-dom','@web/core/ui/ui_service','@web_tour/tour_service/tour_step','@web/core/macro'],function(require){'use strict';let __exports={};const{tourState}=require("@web_tour/tour_service/tour_state");const{debounce}=require("@web/core/utils/timing");const{getScrollParent}=require("@web_tour/tour_service/tour_utils");const hoot=require("@odoo/hoot-dom");const{utils}=require("@web/core/ui/ui_service");const{TourStep}=require("@web_tour/tour_service/tour_step");const{MacroMutationObserver}=require("@web/core/macro");const TourInteractive=__exports.TourInteractive=class TourInteractive{mode="manual";currentAction;currentActionIndex;anchorEls=[];removeListeners=()=>{};constructor(data){Object.assign(this,data);this.steps=this.steps.map((step)=>new TourStep(step,this));this.actions=this.steps.flatMap((s)=>this.getSubActions(s));this.isBusy=false;}
start(env,pointer,onTourEnd){env.bus.addEventListener("ACTION_MANAGER:UPDATE",()=>(this.isBusy=true));env.bus.addEventListener("ACTION_MANAGER:UI-UPDATED",()=>(this.isBusy=false));this.pointer=pointer;this.debouncedToggleOpen=debounce(this.pointer.showContent,50,true);this.onTourEnd=onTourEnd;this.observer=new MacroMutationObserver(()=>this._onMutation());this.observer.observe(document.body);this.currentActionIndex=tourState.getCurrentIndex();this.play();}
backward(){let tempIndex=this.currentActionIndex;let tempAction,tempAnchors=[];while(!tempAnchors.length&&tempIndex>=0){tempIndex--;tempAction=this.actions.at(tempIndex);if(!tempAction.step.active||tempAction.event==="warn"){continue;}
tempAnchors=tempAction&&this.findTriggers(tempAction.anchor);}
if(tempIndex>=0){this.currentActionIndex=tempIndex;this.play();}}
findTriggers(anchor){if(!anchor){anchor=this.currentAction.anchor;}
return anchor.split(/,\s*(?![^(]*\))/).map((part)=>hoot.queryFirst(part,{visible:true})).filter((el)=>!!el).map((el)=>this.getAnchorEl(el,this.currentAction.event)).filter((el)=>!!el);}
play(){this.removeListeners();if(this.currentActionIndex===this.actions.length){this.observer.disconnect();this.onTourEnd();return;}
this.currentAction=this.actions.at(this.currentActionIndex);if(!this.currentAction.step.active||this.currentAction.event==="warn"){if(this.currentAction.event==="warn"){console.warn(`Step '${this.currentAction.anchor}' ignored.`);}
this.currentActionIndex++;this.play();return;}
console.log(this.currentAction.event,this.currentAction.anchor);tourState.setCurrentIndex(this.currentActionIndex);this.anchorEls=this.findTriggers();this.setActionListeners();this.updatePointer();}
updatePointer(){if(this.anchorEls.length){this.pointer.pointTo(this.anchorEls[0],this.currentAction.pointerInfo,this.currentAction.event==="drop");this.pointer.setState({onMouseEnter:()=>this.debouncedToggleOpen(true),onMouseLeave:()=>this.debouncedToggleOpen(false),});}}
setActionListeners(){const cleanups=this.anchorEls.flatMap((anchorEl,index)=>{const toListen={anchorEl,consumeEvents:this.getConsumeEventType(anchorEl,this.currentAction.event),onConsume:()=>{this.pointer.hide();this.currentActionIndex++;this.play();},onError:()=>{if(this.currentAction.event==="drop"){this.pointer.hide();this.currentActionIndex--;this.play();}},};if(index===0){return this.setupListeners({...toListen,onMouseEnter:()=>this.pointer.showContent(true),onMouseLeave:()=>this.pointer.showContent(false),onScroll:()=>this.updatePointer(),});}else{return this.setupListeners({...toListen,onScroll:()=>{},});}});this.removeListeners=()=>{this.anchorEls=[];while(cleanups.length){cleanups.pop()();}};}
setupListeners({anchorEl,consumeEvents,onMouseEnter,onMouseLeave,onScroll,onConsume,onError=()=>{},}){consumeEvents=consumeEvents.map((c)=>({target:c.target,type:c.name,listener:function(ev){if(!c.conditional||c.conditional(ev)){onConsume();}else{onError();}},}));for(const consume of consumeEvents){consume.target.addEventListener(consume.type,consume.listener,true);}
anchorEl.addEventListener("mouseenter",onMouseEnter);anchorEl.addEventListener("mouseleave",onMouseLeave);const cleanups=[()=>{for(const consume of consumeEvents){consume.target.removeEventListener(consume.type,consume.listener,true);}
anchorEl.removeEventListener("mouseenter",onMouseEnter);anchorEl.removeEventListener("mouseleave",onMouseLeave);},];const scrollEl=getScrollParent(anchorEl);if(scrollEl){const debouncedOnScroll=debounce(onScroll,50);scrollEl.addEventListener("scroll",debouncedOnScroll);cleanups.push(()=>scrollEl.removeEventListener("scroll",debouncedOnScroll));}
return cleanups;}
getSubActions(step){const actions=[];if(!step.run||typeof step.run==="function"){actions.push({step,event:"warn",anchor:step.trigger,});return actions;}
for(const todo of step.run.split("&&")){const m=String(todo).trim().match(/^(?<action>\w*) *\(? *(?<arguments>.*?)\)?$/);let action=m.groups?.action;const anchor=m.groups?.arguments||step.trigger;const pointerInfo={content:step.content,tooltipPosition:step.tooltipPosition,};if(action==="drag_and_drop"){actions.push({step,event:"drag",anchor:step.trigger,pointerInfo,});action="drop";}
actions.push({step,event:action,anchor:action==="edit"?step.trigger:anchor,pointerInfo,});}
return actions;}
getConsumeEventType(element,runCommand){const consumeEvents=[];if(runCommand==="click"){consumeEvents.push({name:"click",target:element,});if(element.querySelector(".o-autocomplete--input")){consumeEvents.push({name:"keydown",target:element.querySelector(".o-autocomplete--input"),conditional:(ev)=>["Tab","Enter"].includes(ev.key)&&ev.target.parentElement.querySelector(".o-autocomplete--dropdown-item .ui-state-active"),});}
if(element.closest(".o-autocomplete--dropdown-menu")){consumeEvents.push({name:"keydown",target:element.closest(".o-autocomplete").querySelector("input"),conditional:(ev)=>["Tab","Enter"].includes(ev.key),});}
if(element.tagName==="BUTTON"){consumeEvents.push({name:"keydown",target:element,conditional:(ev)=>ev.key==="Enter",});if(element.closest(".input-group")){for(const inputEl of element.parentElement.querySelectorAll("input")){consumeEvents.push({name:"keydown",target:inputEl,conditional:(ev)=>ev.key==="Enter",});}}}}
if(["fill","edit"].includes(runCommand)){if(utils.isSmall()&&element.closest(".o_field_widget")?.matches(".o_field_many2one, .o_field_many2many")){consumeEvents.push({name:"click",target:element,});}else{consumeEvents.push({name:"input",target:element,});if(element.classList.contains("o-autocomplete--input")){consumeEvents.push({name:"keydown",target:element,conditional:(ev)=>{if(["Tab","Enter"].includes(ev.key)&&ev.target.parentElement.querySelector(".o-autocomplete--dropdown-item .ui-state-active")){const nextStep=this.actions.at(this.currentActionIndex+1);if(this.findTriggers(nextStep.anchor).at(0)?.closest(".o-autocomplete--dropdown-item")){this.currentActionIndex++;}
return true;}},});consumeEvents.push({name:"click",target:element.ownerDocument,conditional:(ev)=>{if(ev.target.closest(".o-autocomplete--dropdown-item")){const nextStep=this.actions.at(this.currentActionIndex+1);if(this.findTriggers(nextStep.anchor).at(0)?.closest(".o-autocomplete--dropdown-item")){this.currentActionIndex++;}
return true;}},});}}}
if(runCommand==="drag"){consumeEvents.push({name:"pointerdown",target:element,});}
if(runCommand==="drop"){consumeEvents.push({name:"pointerup",target:element.ownerDocument,conditional:(ev)=>element.ownerDocument.elementsFromPoint(ev.clientX,ev.clientY).includes(element),});consumeEvents.push({name:"drop",target:element.ownerDocument,conditional:(ev)=>element.ownerDocument.elementsFromPoint(ev.clientX,ev.clientY).includes(element),});}
return consumeEvents;}
getAnchorEl(el,consumeEvent){if(consumeEvent==="drag"){return el.closest(".ui-draggable, .o_draggable, .o_we_draggable, .o-draggable, [draggable='true']");}
if(consumeEvent==="input"&&!["textarea","input"].includes(el.tagName.toLowerCase())){return el.closest("[contenteditable='true']");}
if(consumeEvent==="sort"){return el.closest(".ui-sortable, .o_sortable");}
return el;}
_onMutation(){if(this.currentAction){const tempAnchors=this.findTriggers();if(tempAnchors.length&&(tempAnchors.some((a)=>!this.anchorEls.includes(a))||this.anchorEls.some((a)=>!tempAnchors.includes(a)))){this.removeListeners();this.anchorEls=tempAnchors;this.setActionListeners();}else if(!tempAnchors.length&&this.anchorEls.length){this.pointer.hide();if(!hoot.queryFirst(".o_home_menu",{visible:true})&&!hoot.queryFirst(".dropdown-item.o_loading",{visible:true})&&!this.isBusy){this.backward();}
return;}
this.updatePointer();}}}
return __exports;});;

/* /web_tour/static/src/tour_service/tour_pointer_state.js */
odoo.define('@web_tour/tour_service/tour_pointer_state',['@odoo/owl','@web/core/l10n/translation','@web_tour/tour_pointer/tour_pointer','@web_tour/tour_service/tour_utils'],function(require){'use strict';let __exports={};const{reactive}=require("@odoo/owl");const{_t}=require("@web/core/l10n/translation");const{TourPointer}=require("@web_tour/tour_pointer/tour_pointer");const{getScrollParent}=require("@web_tour/tour_service/tour_utils");class Intersection{constructor(){this.currentTarget=null;this.rootBounds=null;this._targetPosition="unknown";this._observer=new IntersectionObserver((observations)=>this._handleObservations(observations));}
_handleObservations(observations){if(observations.length<1){return;}
const observation=observations[observations.length-1];this.rootBounds=observation.rootBounds;if(this.rootBounds&&this.currentTarget){if(observation.isIntersecting){this._targetPosition="in";}else{const scrollParentElement=getScrollParent(this.currentTarget)||document.documentElement;const targetBounds=this.currentTarget.getBoundingClientRect();if(targetBounds.bottom>scrollParentElement.clientHeight){this._targetPosition="out-below";}else if(targetBounds.top<0){this._targetPosition="out-above";}else if(targetBounds.left<0){this._targetPosition="out-left";}else if(targetBounds.right>scrollParentElement.clientWidth){this._targetPosition="out-right";}}}else{this._targetPosition="unknown";}}
get targetPosition(){if(!this.rootBounds){return this.currentTarget?"in":"unknown";}else{return this._targetPosition;}}
setTarget(newTarget){if(this.currentTarget!==newTarget){if(this.currentTarget){this._observer.unobserve(this.currentTarget);}
if(newTarget){this._observer.observe(newTarget);}
this.currentTarget=newTarget;}}
stop(){this._observer.disconnect();}}
__exports.createPointerState=createPointerState;function createPointerState(){const setState=(newState)=>{Object.assign(state,newState);};const pointTo=(anchor,step,isZone)=>{intersection.setTarget(anchor);if(anchor){let{tooltipPosition,content}=step;switch(intersection.targetPosition){case"unknown":{break;}
case"in":{if(document.body.contains(floatingAnchor)){floatingAnchor.remove();}
setState({anchor,content,isZone,onClick:null,position:tooltipPosition,isVisible:true,});break;}
default:{const onClick=()=>{anchor.scrollIntoView({behavior:"smooth",block:"nearest"});hide();};const scrollParent=getScrollParent(anchor);if(!scrollParent){setState({anchor,content,isZone,onClick:null,position:tooltipPosition,isVisible:true,});return;}
let{x,y,width,height}=scrollParent.getBoundingClientRect();const iframeEl=scrollParent.ownerDocument.defaultView.frameElement;if(iframeEl){const iframeOffset=iframeEl.getBoundingClientRect();x+=iframeOffset.x;y+=iframeOffset.y;}
if(intersection.targetPosition==="out-below"){tooltipPosition="top";content=_t("Scroll down to reach the next step.");floatingAnchor.style.top=`${y + height - TourPointer.height}px`;floatingAnchor.style.left=`${x + width / 2}px`;}else if(intersection.targetPosition==="out-above"){tooltipPosition="bottom";content=_t("Scroll up to reach the next step.");floatingAnchor.style.top=`${y + TourPointer.height}px`;floatingAnchor.style.left=`${x + width / 2}px`;}
if(intersection.targetPosition==="out-left"){tooltipPosition="right";content=_t("Scroll left to reach the next step.");floatingAnchor.style.top=`${y + height / 2}px`;floatingAnchor.style.left=`${x + TourPointer.width}px`;}else if(intersection.targetPosition==="out-right"){tooltipPosition="left";content=_t("Scroll right to reach the next step.");floatingAnchor.style.top=`${y + height / 2}px`;floatingAnchor.style.left=`${x + width - TourPointer.width}px`;}
if(!document.contains(floatingAnchor)){document.body.appendChild(floatingAnchor);}
setState({anchor:floatingAnchor,content,onClick,position:tooltipPosition,isZone,isVisible:true,});}}}else{hide();}};function hide(){setState({content:"",isVisible:false,isOpen:false});}
function showContent(isOpen){setState({isOpen});}
function destroy(){intersection.stop();if(document.body.contains(floatingAnchor)){floatingAnchor.remove();}}
const state=reactive({});const intersection=new Intersection();const floatingAnchor=document.createElement("div");floatingAnchor.className="position-fixed";return{state,setState,showContent,pointTo,hide,destroy};}
return __exports;});;

/* /web_tour/static/src/tour_service/tour_recorder/tour_recorder.js */
odoo.define('@web_tour/tour_service/tour_recorder/tour_recorder',['@web/core/utils/hooks','@web/core/dropdown/dropdown','@web/core/dropdown/dropdown_item','@web/core/browser/browser','@odoo/hoot-dom','@odoo/owl','@web/core/l10n/translation','@web/core/orm_service','@web_tour/tour_service/tour_recorder/tour_recorder_state'],function(require){'use strict';let __exports={};const{useService}=require("@web/core/utils/hooks");const{Dropdown}=require("@web/core/dropdown/dropdown");const{DropdownItem}=require("@web/core/dropdown/dropdown_item");const{browser}=require("@web/core/browser/browser");const{queryAll,queryFirst,queryOne}=require("@odoo/hoot-dom");const{Component,useState,useExternalListener}=require("@odoo/owl");const{_t}=require("@web/core/l10n/translation");const{x2ManyCommands}=require("@web/core/orm_service");const{tourRecorderState}=require("@web_tour/tour_service/tour_recorder/tour_recorder_state");const TOUR_RECORDER_ACTIVE_LOCAL_STORAGE_KEY=__exports.TOUR_RECORDER_ACTIVE_LOCAL_STORAGE_KEY="tour_recorder_active";const PRECISE_IDENTIFIERS=["data-menu-xmlid","name","contenteditable"];const ODOO_CLASS_REGEX=/^oe?(-|_)[\w-]+$/;const VALIDATING_KEYS=["Enter","Tab"];const getShortestSelector=(paths)=>{paths.reverse();let filteredPath=[];let hasOdooClass=false;for(let currentElem=paths.pop();(currentElem&&queryAll(filteredPath.join(" > ")).length!==1)||!hasOdooClass;currentElem=paths.pop()){if(currentElem.parentElement.contentEditable==="true"){continue;}
let currentPredicate=currentElem.tagName.toLowerCase();const odooClass=[...currentElem.classList].find((c)=>c.match(ODOO_CLASS_REGEX));if(odooClass){currentPredicate=`.${odooClass}`;hasOdooClass=true;}
if(["BUTTON","A"].includes(currentElem.tagName)){filteredPath=[];}
for(const identifier of PRECISE_IDENTIFIERS){const identifierValue=currentElem.getAttribute(identifier);if(identifierValue){currentPredicate+=`[${identifier}='${CSS.escape(identifierValue)}']`;}}
const siblingNodes=queryAll(":scope > "+currentPredicate,{root:currentElem.parentElement,});if(siblingNodes.length>1){currentPredicate+=`:nth-child(${
                [...currentElem.parentElement.children].indexOf(currentElem) + 1
            })`;}
filteredPath.unshift(currentPredicate);}
if(filteredPath.length>2){return reducePath(filteredPath);}
return filteredPath.join(" > ");};const reducePath=(paths)=>{const numberOfElement=paths.length-2;let currentElement="";let hasReduced=false;let path=paths.shift();for(let i=0;i<numberOfElement;i++){currentElement=paths.shift();if(queryAll(`${path} ${paths.join(" > ")}`).length===1){hasReduced=true;}else{path+=`${hasReduced ? " " : " > "}${currentElement}`;hasReduced=false;}}
path+=`${hasReduced ? " " : " > "}${paths.shift()}`;return path;};const TourRecorder=__exports.TourRecorder=class TourRecorder extends Component{static template="web_tour.TourRecorder";static components={Dropdown,DropdownItem};static props={onClose:{type:Function},};static defaultState={recording:false,url:"",editedElement:undefined,tourName:"",};setup(){this.originClickEvent=false;this.notification=useService("notification");this.orm=useService("orm");this.state=useState({...TourRecorder.defaultState,steps:[],});this.state.steps=tourRecorderState.getCurrentTourRecorder();this.state.recording=tourRecorderState.isRecording()==="1";useExternalListener(document,"pointerdown",this.setStartingEvent,{capture:true});useExternalListener(document,"pointerup",this.recordClickEvent,{capture:true});useExternalListener(document,"keydown",this.recordConfirmationKeyboardEvent,{capture:true,});useExternalListener(document,"keyup",this.recordKeyboardEvent,{capture:true});}
setStartingEvent(ev){if(!this.state.recording||ev.target.closest(".o_tour_recorder")){return;}
this.originClickEvent=ev.composedPath().filter((p)=>p instanceof Element);}
recordClickEvent(ev){if(!this.state.recording||ev.target.closest(".o_tour_recorder")){return;}
const pathElements=ev.composedPath().filter((p)=>p instanceof Element);this.addTourStep([...pathElements]);const lastStepInput=this.state.steps.at(-1);if(JSON.stringify(pathElements.map((e)=>e.tagName))!==JSON.stringify(this.originClickEvent.map((e)=>e.tagName))){lastStepInput.run=`drag_and_drop ${lastStepInput.trigger}`;lastStepInput.trigger=getShortestSelector(this.originClickEvent);}else{const lastStepInput=this.state.steps.at(-1);lastStepInput.run="click";}
tourRecorderState.setCurrentTourRecorder(this.state.steps);}
recordConfirmationKeyboardEvent(ev){if(!this.state.recording||!this.state.editedElement||ev.target.closest(".o_tour_recorder")){return;}
if([...this.state.editedElement.classList].includes("o-autocomplete--input")&&VALIDATING_KEYS.includes(ev.key)){const selectedRow=queryFirst(".ui-state-active",{root:this.state.editedElement.parentElement,});this.state.steps.push({trigger:`.o-autocomplete--dropdown-item > a:contains('${selectedRow.textContent}'), .fa-circle-o-notch`,run:"click",});this.state.editedElement=undefined;}
tourRecorderState.setCurrentTourRecorder(this.state.steps);}
recordKeyboardEvent(ev){if(!this.state.recording||VALIDATING_KEYS.includes(ev.key)||ev.target.closest(".o_tour_recorder")){return;}
if(!this.state.editedElement){if(ev.target.matches("input:not(:disabled), textarea:not(:disabled), [contenteditable=true]")){this.state.editedElement=ev.target;this.state.steps.push({trigger:getShortestSelector(ev.composedPath()),});}else{return;}}
if(!this.state.editedElement){return;}
const lastStep=this.state.steps.at(-1);if(this.state.editedElement.contentEditable==="true"){lastStep.run=`editor ${this.state.editedElement.textContent}`;}else{lastStep.run=`edit ${this.state.editedElement.value}`;}
tourRecorderState.setCurrentTourRecorder(this.state.steps);}
toggleRecording(){this.state.recording=!this.state.recording;tourRecorderState.setIsRecording(this.state.recording);this.state.editedElement=undefined;if(this.state.recording&&!this.state.url){this.state.url=browser.location.pathname+browser.location.search;}}
async saveTour(){const newTour={name:this.state.tourName.replaceAll(" ","_"),url:this.state.url,step_ids:this.state.steps.map((s)=>x2ManyCommands.create(undefined,s)),custom:true,};const result=await this.orm.create("web_tour.tour",[newTour]);if(result){this.notification.add(_t("Custom tour '%s' has been added.",newTour.name),{type:"success",});this.resetTourRecorderState();}else{this.notification.add(_t("Custom tour '%s' couldn't be saved!",newTour.name),{type:"danger",});}}
resetTourRecorderState(){Object.assign(this.state,{...TourRecorder.defaultState,steps:[]});tourRecorderState.clear();}
addTourStep(path){const shortestPath=getShortestSelector(path);const target=queryOne(shortestPath);this.state.editedElement=target.matches("input:not(:disabled), textarea:not(:disabled), [contenteditable=true]")&&target;this.state.steps.push({trigger:shortestPath,});}}
return __exports;});;

/* /web_tour/static/src/tour_service/tour_recorder/tour_recorder_state.js */
odoo.define('@web_tour/tour_service/tour_recorder/tour_recorder_state',['@web/core/browser/browser'],function(require){'use strict';let __exports={};const{browser}=require("@web/core/browser/browser");const CURRENT_TOUR_RECORDER_LOCAL_STORAGE="current_tour_recorder";const CURRENT_TOUR_RECORDER_RECORD_LOCAL_STORAGE="current_tour_recorder.record";const tourRecorderState=__exports.tourRecorderState={isRecording(){return browser.localStorage.getItem(CURRENT_TOUR_RECORDER_RECORD_LOCAL_STORAGE)||"0";},setIsRecording(isRecording){browser.localStorage.setItem(CURRENT_TOUR_RECORDER_RECORD_LOCAL_STORAGE,isRecording?"1":"0");},setCurrentTourRecorder(tour){tour=JSON.stringify(tour);browser.localStorage.setItem(CURRENT_TOUR_RECORDER_LOCAL_STORAGE,tour);},getCurrentTourRecorder(){const tour=browser.localStorage.getItem(CURRENT_TOUR_RECORDER_LOCAL_STORAGE)||"[]";return JSON.parse(tour);},clear(){browser.localStorage.removeItem(CURRENT_TOUR_RECORDER_LOCAL_STORAGE);browser.localStorage.removeItem(CURRENT_TOUR_RECORDER_RECORD_LOCAL_STORAGE);},};return __exports;});;

/* /web_tour/static/src/tour_service/tour_service.js */
odoo.define('@web_tour/tour_service/tour_service',['@odoo/owl','@web/core/browser/browser','@web/core/l10n/translation','@web/core/registry','@web/session','@web_tour/tour_pointer/tour_pointer','@web_tour/tour_service/tour_pointer_state','@web_tour/tour_service/tour_state','@web_tour/tour_service/tour_interactive','@web_tour/tour_service/tour_automatic','@web_tour/tour_service/tour_utils','@web_tour/tour_service/tour_recorder/tour_recorder','@web/core/utils/urls','@web_tour/tour_service/tour_recorder/tour_recorder_state'],function(require){'use strict';let __exports={};const{markup,whenReady,validate}=require("@odoo/owl");const{browser}=require("@web/core/browser/browser");const{_t}=require("@web/core/l10n/translation");const{registry}=require("@web/core/registry");const{session}=require("@web/session");const{TourPointer}=require("@web_tour/tour_pointer/tour_pointer");const{createPointerState}=require("@web_tour/tour_service/tour_pointer_state");const{tourState}=require("@web_tour/tour_service/tour_state");const{TourInteractive}=require("@web_tour/tour_service/tour_interactive");const{TourAutomatic}=require("@web_tour/tour_service/tour_automatic");const{callWithUnloadCheck}=require("@web_tour/tour_service/tour_utils");const{TOUR_RECORDER_ACTIVE_LOCAL_STORAGE_KEY,TourRecorder,}=require("@web_tour/tour_service/tour_recorder/tour_recorder");const{redirect}=require("@web/core/utils/urls");const{tourRecorderState}=require("@web_tour/tour_service/tour_recorder/tour_recorder_state");const StepSchema={id:{type:[String],optional:true},content:{type:[String,Object],optional:true},debugHelp:{type:String,optional:true},isActive:{type:Array,element:String,optional:true},run:{type:[String,Function,Boolean],optional:true},timeout:{optional:true,validate(value){return value>=0&&value<=60000;},},tooltipPosition:{optional:true,validate(value){return["top","bottom","left","right"].includes(value);},},trigger:{type:String},expectUnloadPage:{type:Boolean,optional:true},pause:{type:Boolean,optional:true},break:{type:Boolean,optional:true},};const TourSchema={name:{type:String,optional:true},steps:Function,url:{type:String,optional:true},wait_for:{type:[Function,Object],optional:true},};registry.category("web_tour.tours").addValidation(TourSchema);const userMenuRegistry=registry.category("user_menuitems");const tourService=__exports.tourService={dependencies:["orm","effect","overlay","localization"],start:async(env,{orm,effect,overlay})=>{await whenReady();let toursEnabled=session?.tour_enabled;const tourRegistry=registry.category("web_tour.tours");const pointer=createPointerState();pointer.stop=()=>{};userMenuRegistry.add("web_tour.tour_enabled",()=>({type:"switch",id:"web_tour.tour_enabled",description:_t("Onboarding"),callback:async()=>{tourState.clear();toursEnabled=await orm.call("res.users","switch_tour_enabled",[!toursEnabled]);browser.location.reload();},isChecked:toursEnabled,sequence:30,}));function getTourFromRegistry(tourName){if(!tourRegistry.contains(tourName)){return;}
const tour=tourRegistry.get(tourName);return{...tour,steps:tour.steps(),name:tourName,wait_for:tour.wait_for||Promise.resolve(),};}
async function getTourFromDB(tourName){const tour=await orm.call("web_tour.tour","get_tour_json_by_name",[tourName]);if(!tour){throw new Error(`Tour '${tourName}' is not found in the database.`);}
if(!tour.steps.length&&tourRegistry.contains(tour.name)){tour.steps=tourRegistry.get(tour.name).steps();}
return tour;}
function validateStep(step){try{validate(step,StepSchema);}catch(error){console.error(`Error in schema for TourStep ${JSON.stringify(step, null, 4)}\n${
                        error.message
                    }`);}}
async function startTour(tourName,options={}){pointer.stop();const tourFromRegistry=getTourFromRegistry(tourName);if(!tourFromRegistry&&!options.fromDB){return;}
const tour=options.fromDB?{name:tourName,url:options.url}:tourFromRegistry;if(!session.is_public&&!toursEnabled&&options.mode==="manual"){toursEnabled=await orm.call("res.users","switch_tour_enabled",[!toursEnabled]);}
let tourConfig={delayToCheckUndeterminisms:0,stepDelay:0,keepWatchBrowser:false,mode:"auto",showPointerDuration:0,debug:false,redirect:true,};tourConfig=Object.assign(tourConfig,options);tourState.setCurrentConfig(tourConfig);tourState.setCurrentTour(tour.name);tourState.setCurrentIndex(0);const willUnload=callWithUnloadCheck(()=>{if(tour.url&&tourConfig.startUrl!=tour.url&&tourConfig.redirect){redirect(tour.url);}});if(!willUnload){resumeTour();}}
async function resumeTour(){const tourName=tourState.getCurrentTour();const tourConfig=tourState.getCurrentConfig();let tour=getTourFromRegistry(tourName);if(tourConfig.fromDB){tour=await getTourFromDB(tourName);}
if(!tour){return;}
tour.steps.forEach((step)=>validateStep(step));pointer.stop=overlay.add(TourPointer,{pointerState:pointer.state,bounce:!(tourConfig.mode==="auto"&&tourConfig.keepWatchBrowser),},{sequence:1100,});if(tourConfig.mode==="auto"){new TourAutomatic(tour).start();}else{new TourInteractive(tour).start(env,pointer,async()=>{pointer.stop();tourState.clear();browser.console.log("tour succeeded");let message=tourConfig.rainbowManMessage||tour.rainbowManMessage;if(message){message=window.DOMPurify.sanitize(tourConfig.rainbowManMessage);effect.add({type:"rainbow_man",message:markup(message),});}
const nextTour=await orm.call("web_tour.tour","consume",[tour.name]);if(nextTour){startTour(nextTour.name,{mode:"manual",redirect:false,rainbowManMessage:nextTour.rainbowManMessage,});}});}}
function startTourRecorder(){if(!browser.localStorage.getItem(TOUR_RECORDER_ACTIVE_LOCAL_STORAGE_KEY)){const remove=overlay.add(TourRecorder,{onClose:()=>{remove();browser.localStorage.removeItem(TOUR_RECORDER_ACTIVE_LOCAL_STORAGE_KEY);tourRecorderState.clear();},},{sequence:99999});}
browser.localStorage.setItem(TOUR_RECORDER_ACTIVE_LOCAL_STORAGE_KEY,"1");}
if(!window.frameElement){const paramsTourName=new URLSearchParams(browser.location.search).get("tour");if(paramsTourName){startTour(paramsTourName,{mode:"manual",fromDB:true});}
if(tourState.getCurrentTour()){if(tourState.getCurrentConfig().mode==="auto"||toursEnabled){resumeTour();}else{tourState.clear();}}else if(session.current_tour){startTour(session.current_tour.name,{mode:"manual",redirect:false,rainbowManMessage:session.current_tour.rainbowManMessage,});}
if(browser.localStorage.getItem(TOUR_RECORDER_ACTIVE_LOCAL_STORAGE_KEY)&&!session.is_public){const remove=overlay.add(TourRecorder,{onClose:()=>{remove();browser.localStorage.removeItem(TOUR_RECORDER_ACTIVE_LOCAL_STORAGE_KEY);tourRecorderState.clear();},},{sequence:99999});}}
odoo.startTour=startTour;odoo.isTourReady=(tourName)=>getTourFromRegistry(tourName).wait_for.then(()=>true);return{startTour,startTourRecorder,};},};registry.category("services").add("tour_service",tourService);return __exports;});;

/* /web_tour/static/src/tour_service/tour_state.js */
odoo.define('@web_tour/tour_service/tour_state',['@web/core/browser/browser'],function(require){'use strict';let __exports={};const{browser}=require("@web/core/browser/browser");const CURRENT_TOUR_LOCAL_STORAGE="current_tour";const CURRENT_TOUR_CONFIG_LOCAL_STORAGE="current_tour.config";const CURRENT_TOUR_INDEX_LOCAL_STORAGE="current_tour.index";const CURRENT_TOUR_ON_ERROR_LOCAL_STORAGE="current_tour.on_error";const tourState=__exports.tourState={getCurrentTour(){return browser.localStorage.getItem(CURRENT_TOUR_LOCAL_STORAGE);},setCurrentTour(tourName){browser.localStorage.setItem(CURRENT_TOUR_LOCAL_STORAGE,tourName);},getCurrentIndex(){const index=browser.localStorage.getItem(CURRENT_TOUR_INDEX_LOCAL_STORAGE,"0");return parseInt(index,10);},setCurrentIndex(index){browser.localStorage.setItem(CURRENT_TOUR_INDEX_LOCAL_STORAGE,index.toString());},getCurrentConfig(){const config=browser.localStorage.getItem(CURRENT_TOUR_CONFIG_LOCAL_STORAGE,"{}");return JSON.parse(config);},setCurrentConfig(config){config=JSON.stringify(config);browser.localStorage.setItem(CURRENT_TOUR_CONFIG_LOCAL_STORAGE,config);},getCurrentTourOnError(){return browser.localStorage.getItem(CURRENT_TOUR_ON_ERROR_LOCAL_STORAGE);},setCurrentTourOnError(){browser.localStorage.setItem(CURRENT_TOUR_ON_ERROR_LOCAL_STORAGE,"1");},clear(){browser.localStorage.removeItem(CURRENT_TOUR_ON_ERROR_LOCAL_STORAGE);browser.localStorage.removeItem(CURRENT_TOUR_CONFIG_LOCAL_STORAGE);browser.localStorage.removeItem(CURRENT_TOUR_INDEX_LOCAL_STORAGE);browser.localStorage.removeItem(CURRENT_TOUR_LOCAL_STORAGE);},};return __exports;});;

/* /web_tour/static/src/tour_service/tour_step.js */
odoo.define('@web_tour/tour_service/tour_step',['@web/session','@web/core/ui/ui_service','@odoo/hoot-dom','@web/core/utils/objects'],function(require){'use strict';let __exports={};const{session}=require("@web/session");const{utils}=require("@web/core/ui/ui_service");const hoot=require("@odoo/hoot-dom");const{pick}=require("@web/core/utils/objects");const TourStep=__exports.TourStep=class TourStep{constructor(data,tour){Object.assign(this,data);this.tour=tour;}
get active(){this.checkHasTour();const mode=this.tour.mode;const isSmall=utils.isSmall();const standardKeyWords=["enterprise","community","mobile","desktop","auto","manual"];const isActiveArray=Array.isArray(this.isActive)?this.isActive:[];if(isActiveArray.length===0){return true;}
const selectors=isActiveArray.filter((key)=>!standardKeyWords.includes(key));if(selectors.length){for(const selector of selectors){const el=hoot.queryFirst(selector);if(!el){return false;}}}
const checkMode=isActiveArray.includes(mode)||(!isActiveArray.includes("manual")&&!isActiveArray.includes("auto"));const edition=(session.server_version_info||"").at(-1)==="e"?"enterprise":"community";const checkEdition=isActiveArray.includes(edition)||(!isActiveArray.includes("enterprise")&&!isActiveArray.includes("community"));const onlyForMobile=isActiveArray.includes("mobile")&&isSmall;const onlyForDesktop=isActiveArray.includes("desktop")&&!isSmall;const checkDevice=onlyForMobile||onlyForDesktop||(!isActiveArray.includes("mobile")&&!isActiveArray.includes("desktop"));return checkEdition&&checkDevice&&checkMode;}
checkHasTour(){if(!this.tour){throw new Error(`TourStep instance must have a tour`);}}
get describeMe(){this.checkHasTour();return(`[${this.index + 1}/${this.tour.steps.length}] Tour ${this.tour.name} → Step `+
(this.content?`${this.content} (trigger: ${this.trigger})`:this.trigger));}
get stringify(){return(JSON.stringify(pick(this,"isActive","content","trigger","run","tooltipPosition","timeout","expectUnloadPage"),(_key,value)=>{if(typeof value==="function"){return"[function]";}else{return value;}},2)+",");}}
return __exports;});;

/* /web_tour/static/src/tour_service/tour_step_automatic.js */
odoo.define('@web_tour/tour_service/tour_step_automatic',['@web_tour/tour_service/tour_state','@odoo/hoot-dom','@web_tour/tour_service/tour_utils','@web_tour/tour_service/tour_helpers','@web_tour/tour_service/tour_step','@web/core/utils/xml','@web/core/macro'],function(require){'use strict';let __exports={};const{tourState}=require("@web_tour/tour_service/tour_state");const hoot=require("@odoo/hoot-dom");const{callWithUnloadCheck,serializeChanges,serializeMutation}=require("@web_tour/tour_service/tour_utils");const{TourHelpers}=require("@web_tour/tour_service/tour_helpers");const{TourStep}=require("@web_tour/tour_service/tour_step");const{getTag}=require("@web/core/utils/xml");const{waitForStable}=require("@web/core/macro");const TourStepAutomatic=__exports.TourStepAutomatic=class TourStepAutomatic extends TourStep{skipped=false;error="";constructor(data,tour,index){super(data,tour);this.index=index;this.tourConfig=tourState.getCurrentConfig();}
async checkForUndeterminisms(initialElement,delay){if(delay<=0||!initialElement){return;}
const tagName=initialElement.tagName?.toLowerCase();if(["body","html"].includes(tagName)||!tagName){return;}
const snapshot=initialElement.cloneNode(true);const mutations=await waitForStable(initialElement,delay);let reason;if(!hoot.isVisible(initialElement)){reason=`Initial element is no longer visible`;}else if(!initialElement.isEqualNode(snapshot)){reason=`Initial element has changed:\n`+
JSON.stringify(serializeChanges(snapshot,initialElement),null,2);}else if(mutations.length){const changes=[...new Set(mutations.map(serializeMutation))];reason=`Initial element has mutated ${mutations.length} times:\n`+
JSON.stringify(changes,null,2);}
if(reason){throw new Error(`Potential non deterministic behavior found in ${delay}ms for trigger ${this.trigger}.\n${reason}`);}}
get describeWhyIFailed(){const errors=[];if(this.element){errors.push(`Element has been found.`);if(this.isUIBlocked){errors.push("BUT: DOM is blocked by UI.");}
if(!this.elementIsInModal){errors.push(`BUT: It is not allowed to do action on an element that's below a modal.`);}
if(!this.elementIsEnabled){errors.push(`BUT: Element is not enabled. TIP: You can use :enable to wait the element is enabled before doing action on it.`);}
if(!this.parentFrameIsReady){errors.push(`BUT: parent frame is not ready ([is-ready='false']).`);}}else{const checkElement=hoot.queryFirst(this.trigger);if(checkElement){errors.push(`Element has been found.`);errors.push(`BUT: Element is not visible. TIP: You can use :not(:visible) to force the search for an invisible element.`);}else{errors.push(`Element (${this.trigger}) has not been found.`);}}
return errors;}
async doAction(){if(this.skipped){return;}
return await callWithUnloadCheck(async()=>{const actionHelper=new TourHelpers(this.element);if(typeof this.run==="function"){await this.run.call({anchor:this.element},actionHelper);}else if(typeof this.run==="string"){for(const todo of this.run.split("&&")){const m=String(todo).trim().match(/^(?<action>\w*) *\(? *(?<arguments>.*?)\)?$/);await actionHelper[m.groups?.action](m.groups?.arguments);}}});}
findTrigger(){if(!this.active){this.skipped=true;return true;}
const visible=!/:(hidden|visible)\b/.test(this.trigger);this.element=hoot.queryFirst(this.trigger,{visible});if(this.element){return!this.isUIBlocked&&this.elementIsEnabled&&this.elementIsInModal&&this.parentFrameIsReady?this.element:false;}
return false;}
get isUIBlocked(){return(document.body.classList.contains("o_lazy_js_waiting")||document.body.classList.contains("o_ui_blocked")||document.querySelector(".o_blockUI")||document.querySelector(".o_is_blocked"));}
get parentFrameIsReady(){if(this.trigger.match(/\[is-ready=(true|false)\]/)){return true;}
const parentFrame=hoot.getParentFrame(this.element);return parentFrame&&parentFrame.hasAttribute("is-ready")?parentFrame.getAttribute("is-ready")==="true":true;}
get elementIsInModal(){if(this.hasAction){const overlays=hoot.queryFirst(".popover, .o-we-command, .o_notification");const modal=hoot.queryFirst(".modal:visible:not(.o_inactive_modal):last");if(modal&&!overlays&&!this.trigger.startsWith("body")){return(modal.contains(hoot.getParentFrame(this.element))||modal.contains(this.element));}}
return true;}
get elementIsEnabled(){const isTag=(array)=>array.includes(getTag(this.element,true));if(this.hasAction){if(isTag(["input","textarea"])){return hoot.isEditable(this.element);}else if(isTag(["button","select"])){return!this.element.disabled;}}
return true;}
get hasAction(){return["string","function"].includes(typeof this.run)&&!this.skipped;}}
return __exports;});;

/* /web_tour/static/src/tour_service/tour_utils.js */
odoo.define('@web_tour/tour_service/tour_utils',['@odoo/hoot-dom','@web/core/l10n/translation'],function(require){'use strict';let __exports={};const hoot=require("@odoo/hoot-dom");const{_t}=require("@web/core/l10n/translation");__exports.callWithUnloadCheck=callWithUnloadCheck;function callWithUnloadCheck(func,...args){let willUnload=false;const beforeunload=()=>(willUnload=true);window.addEventListener("beforeunload",beforeunload);const result=func(...args);if(result instanceof Promise){return result.then(()=>{window.removeEventListener("beforeunload",beforeunload);return willUnload;});}else{window.removeEventListener("beforeunload",beforeunload);return willUnload;}}
function formatValue(key,value,maxLength=200){if(!value){return"(empty)";}
return value.length>maxLength?value.slice(0,maxLength)+"...":value;}
function serializeNode(node){if(node.nodeType===Node.TEXT_NODE){return`"${node.nodeValue.trim()}"`;}
return node.outerHTML?formatValue("node",node.outerHTML,500):"[Unknown Node]";}
__exports.serializeChanges=serializeChanges;function serializeChanges(snapshot,current){const changes={node:serializeNode(current),};function pushChanges(key,obj){changes[key]=changes[key]||[];changes[key].push(obj);}
if(snapshot.textContent!==current.textContent){pushChanges("modifiedText",{before:snapshot.textContent,after:current.textContent});}
const oldChildren=[...snapshot.childNodes].filter((node)=>node.nodeType!==Node.TEXT_NODE);const newChildren=[...current.childNodes].filter((node)=>node.nodeType!==Node.TEXT_NODE);oldChildren.forEach((oldNode,index)=>{if(!newChildren[index]||!oldNode.isEqualNode(newChildren[index])){pushChanges("removedNodes",{oldNode:serializeNode(oldNode)});}});newChildren.forEach((newNode,index)=>{if(!oldChildren[index]||!newNode.isEqualNode(oldChildren[index])){pushChanges("addedNodes",{newNode:serializeNode(newNode)});}});const oldAttrNames=new Set([...snapshot.attributes].map((attr)=>attr.name));const newAttrNames=new Set([...current.attributes].map((attr)=>attr.name));new Set([...oldAttrNames,...newAttrNames]).forEach((attributeName)=>{const oldValue=snapshot.getAttribute(attributeName);const newValue=current.getAttribute(attributeName);const before=oldValue!==newValue||!newAttrNames.has(attributeName)?oldValue:null;const after=oldValue!==newValue||!oldAttrNames.has(attributeName)?newValue:null;if(before||after){pushChanges("modifiedAttributes",{attributeName,before,after});}});return changes;}
__exports.serializeMutation=serializeMutation;function serializeMutation(mutation){const{type,attributeName}=mutation;if(type==="attributes"&&attributeName){return`attribute: ${attributeName}`;}else{return type;}}
__exports.getScrollParent=getScrollParent;function getScrollParent(element){if(!element){return null;}
const overflowY=window.getComputedStyle(element).overflowY;const isScrollable=overflowY==="auto"||overflowY==="scroll"||(overflowY==="visible"&&element===element.ownerDocument.scrollingElement);if(isScrollable){return element;}else{return getScrollParent(element.parentNode);}}
const stepUtils=__exports.stepUtils={_getHelpMessage(functionName,...args){return`Generated by function tour utils ${functionName}(${args.join(", ")})`;},addDebugHelp(helpMessage,step){if(typeof step.debugHelp==="string"){step.debugHelp=step.debugHelp+"\n"+helpMessage;}else{step.debugHelp=helpMessage;}
return step;},showAppsMenuItem(){return{isActive:["auto","community","desktop"],trigger:".o_navbar_apps_menu button:enabled",tooltipPosition:"bottom",run:"click",};},toggleHomeMenu(){return[{isActive:[".o_main_navbar .o_menu_toggle"],trigger:".o_main_navbar .o_menu_toggle",content:_t("Click the top left corner to navigate across apps."),tooltipPosition:"bottom",run:"click",},{isActive:["mobile"],trigger:".o_sidebar_topbar a.btn-primary",tooltipPosition:"right",run:"click",},];},autoExpandMoreButtons(isActiveMobile=false){const isActive=["auto"];if(isActiveMobile){isActive.push("mobile");}
return{isActive,content:`autoExpandMoreButtons`,trigger:".o-form-buttonbox",run(){const more=hoot.queryFirst(".o-form-buttonbox .o_button_more");if(more){hoot.click(more);}},};},goToAppSteps(dataMenuXmlid,description){return[this.showAppsMenuItem(),{isActive:["community"],trigger:`.o_app[data-menu-xmlid="${dataMenuXmlid}"]`,content:description,tooltipPosition:"right",run:"click",},{isActive:["enterprise"],trigger:`.o_app[data-menu-xmlid="${dataMenuXmlid}"]`,content:description,tooltipPosition:"bottom",run:"click",},].map((step)=>this.addDebugHelp(this._getHelpMessage("goToApp",dataMenuXmlid,description),step));},statusbarButtonsSteps(innerTextButton,description,trigger){const steps=[];if(trigger){steps.push({isActive:["auto","mobile"],trigger,});}
steps.push({isActive:["auto","mobile"],trigger:".o_cp_action_menus",run:(actions)=>{const node=hoot.queryFirst(".o_cp_action_menus .fa-cog");if(node){hoot.click(node);}},},{trigger:`.o_statusbar_buttons button:enabled:contains('${innerTextButton}'), .dropdown-item button:enabled:contains('${innerTextButton}')`,content:description,tooltipPosition:"bottom",run:"click",});return steps.map((step)=>this.addDebugHelp(this._getHelpMessage("statusbarButtonsSteps",innerTextButton,description),step));},mobileKanbanSearchMany2X(modalTitle,valueSearched){return[{isActive:["mobile"],trigger:`.modal:not(.o_inactive_modal) .o_control_panel_navigation .btn .fa-search`,tooltipPosition:"bottom",run:"click",},{isActive:["mobile"],trigger:".o_searchview_input",tooltipPosition:"bottom",run:`edit ${valueSearched}`,},{isActive:["mobile"],trigger:".dropdown-menu.o_searchview_autocomplete",},{isActive:["mobile"],trigger:".o_searchview_input",tooltipPosition:"bottom",run:"press Enter",},{isActive:["mobile"],trigger:`.o_kanban_record:contains('${valueSearched}')`,tooltipPosition:"bottom",run:"click",},].map((step)=>this.addDebugHelp(this._getHelpMessage("mobileKanbanSearchMany2X",modalTitle,valueSearched),step));},saveForm(){return[{isActive:["auto"],content:"save form",trigger:".o_form_button_save:enabled",run:"click",},{content:"wait for save completion",trigger:".o_form_readonly, .o_form_saved",},];},discardForm(){return[{isActive:["auto"],content:"discard the form",trigger:".o_form_button_cancel",run:"click",},{content:"wait for cancellation to complete",trigger:".o_view_controller.o_list_view, .o_form_view > div > div > .o_form_readonly, .o_form_view > div > div > .o_form_saved",},];},waitIframeIsReady(){return{content:"Wait until the iframe is ready",trigger:`iframe[is-ready=true]:iframe html`,};},goToUrl(url){return{isActive:["auto"],content:`Navigate to ${url}`,trigger:"body",run:`goToUrl ${url}`,expectUnloadPage:true,};},};return __exports;});;

/* /web/static/tests/legacy/helpers/utils.js */
odoo.define('@web/../tests/legacy/helpers/utils',['@web/core/templates','@web/core/browser/browser','@web/core/browser/feature_detection','@web/core/network/download','@web/core/popover/popover','@web/core/utils/concurrency','@web/core/utils/patch','@web/core/utils/ui','@web/core/l10n/translation','@web/../tests/legacy/helpers/cleanup','@odoo/owl'],function(require){'use strict';let __exports={};const{getTemplate}=require("@web/core/templates");const{browser}=require("@web/core/browser/browser");const{isMacOS}=require("@web/core/browser/feature_detection");const{download}=require("@web/core/network/download");const{getPopoverForTarget}=require("@web/core/popover/popover");const{Deferred}=require("@web/core/utils/concurrency");const{patch}=require("@web/core/utils/patch");const{isVisible}=require("@web/core/utils/ui");const{_t}=require("@web/core/l10n/translation");const{registerCleanup}=require("@web/../tests/legacy/helpers/cleanup");const{App,onError,onMounted,onPatched,onRendered,onWillDestroy,onWillPatch,onWillRender,onWillStart,onWillUnmount,onWillUpdateProps,useComponent,}=require("@odoo/owl");__exports.patchDate=patchDate;function patchDate(year,month,day,hours,minutes,seconds,ms=0){var RealDate=window.Date;var actualDate=new RealDate();var fakeDate=new RealDate(year,month,day,hours,minutes,seconds,ms);if(!(luxon.Settings.defaultZone instanceof luxon.FixedOffsetZone)){throw new Error("luxon.Settings.defaultZone must be a FixedOffsetZone");}
const browserOffset=-fakeDate.getTimezoneOffset();const patchedOffset=luxon.Settings.defaultZone.offset();const offsetDiff=patchedOffset-browserOffset;const correctedMinutes=fakeDate.getMinutes()-offsetDiff;fakeDate.setMinutes(correctedMinutes);var timeInterval=actualDate.getTime()-fakeDate.getTime();window.Date=(function(NativeDate){function Date(Y,M,D,h,m,s,ms){var length=arguments.length;let date;if(arguments.length>0){date=length==1&&String(Y)===Y?new NativeDate(Date.parse(Y)):length>=7?new NativeDate(Y,M,D,h,m,s,ms):length>=6?new NativeDate(Y,M,D,h,m,s):length>=5?new NativeDate(Y,M,D,h,m):length>=4?new NativeDate(Y,M,D,h):length>=3?new NativeDate(Y,M,D):length>=2?new NativeDate(Y,M):length>=1?new NativeDate(Y):new NativeDate();date.constructor=Date;return date;}else{date=new NativeDate();var time=date.getTime();time-=timeInterval;date.setTime(time);return date;}}
for(var key in NativeDate){Date[key]=NativeDate[key];}
Date.now=function(){var date=new NativeDate();var time=date.getTime();time-=timeInterval;return time;};Date.UTC=NativeDate.UTC;Date.prototype=NativeDate.prototype;Date.prototype.constructor=Date;Date.parse=NativeDate.parse;return Date;})(Date);registerCleanup(()=>{window.Date=RealDate;});}
__exports.patchTimeZone=patchTimeZone;function patchTimeZone(offset){patchWithCleanup(luxon.Settings,{defaultZone:luxon.FixedOffsetZone.instance(offset)});}
__exports.patchWithCleanup=patchWithCleanup;function patchWithCleanup(obj,patchValue){const unpatch=patch(obj,patchValue);registerCleanup(()=>{unpatch();});}
__exports.getFixture=getFixture;function getFixture(){if(!window.QUnit){return document;}
if(QUnit.config.debug){return document.body;}else{return document.getElementById("qunit-fixture");}}
__exports.nextTick=nextTick;async function nextTick(){await new Promise((resolve)=>window.requestAnimationFrame(resolve));await new Promise((resolve)=>setTimeout(resolve));}
__exports.makeDeferred=makeDeferred;function makeDeferred(){return new Deferred();}
__exports.findElement=findElement;function findElement(el,selector){let target=el;if(selector){const els=el.querySelectorAll(selector);if(els.length===0){throw new Error(`No element found (selector: ${selector})`);}
if(els.length>1){throw new Error(`Found ${els.length} elements, instead of 1 (selector: ${selector})`);}
target=els[0];}
return target;}
const mapBubblingEvent=(args)=>({...args,bubbles:true});const mapNonBubblingEvent=(args)=>({...args,bubbles:false});const mapBubblingPointerEvent=(args={})=>({clientX:args.pageX,clientY:args.pageY,...args,bubbles:true,cancelable:true,view:window,});const mapNonBubblingPointerEvent=(args)=>({...mapBubblingPointerEvent(args),bubbles:false,cancelable:false,});const mapCancelableTouchEvent=(args={})=>({...args,bubbles:true,cancelable:true,composed:true,rotation:0.0,touches:args.touches?[...args.touches.map((e)=>new Touch(e))]:undefined,view:window,zoom:1.0,});const mapNonCancelableTouchEvent=(args)=>({...mapCancelableTouchEvent(args),cancelable:false,});const mapKeyboardEvent=(args)=>({...args,bubbles:true,cancelable:true,});const getEventConstructor=(eventType)=>{switch(eventType){case"auxclick":case"click":case"contextmenu":case"dblclick":case"mousedown":case"mouseup":case"mousemove":case"mouseover":case"mouseout":{return[MouseEvent,mapBubblingPointerEvent];}
case"mouseenter":case"mouseleave":{return[MouseEvent,mapNonBubblingPointerEvent];}
case"pointerdown":case"pointerup":case"pointermove":case"pointerover":case"pointerout":{return[PointerEvent,mapBubblingPointerEvent];}
case"pointerenter":case"pointerleave":{return[PointerEvent,mapNonBubblingPointerEvent];}
case"focusin":{return[FocusEvent,mapBubblingEvent];}
case"focus":case"blur":{return[FocusEvent,mapNonBubblingEvent];}
case"cut":case"copy":case"paste":{return[ClipboardEvent,mapBubblingEvent];}
case"keydown":case"keypress":case"keyup":{return[KeyboardEvent,mapKeyboardEvent];}
case"drag":case"dragend":case"dragenter":case"dragstart":case"dragleave":case"dragover":case"drop":{return[DragEvent,mapBubblingEvent];}
case"input":{return[InputEvent,mapBubblingEvent];}
case"compositionstart":case"compositionend":{return[CompositionEvent,mapBubblingEvent];}
case"scroll":{return[UIEvent,mapNonBubblingEvent];}
case"touchstart":case"touchend":case"touchmove":{return[TouchEvent,mapCancelableTouchEvent];}
case"touchcancel":{return[TouchEvent,mapNonCancelableTouchEvent];}
default:{return[Event,mapBubblingEvent];}}};__exports.triggerEvent=triggerEvent;function triggerEvent(el,selector,eventType,eventInit,options={}){const errors=[];const target=findElement(el,selector);if(typeof eventType!=="string"){errors.push("event type must be a string");}
if(!target){errors.push("cannot find target");}else if(!options.skipVisibilityCheck&&!isVisible(target)){errors.push("target is not visible");}
if(errors.length){throw new Error(`Cannot trigger event${eventType ? `"${eventType}"` : ""}${
                selector ? `(with selector"${selector}")` : ""
            }: ${errors.join(" and ")}`);}
const[Constructor,processParams]=getEventConstructor(eventType);const event=new Constructor(eventType,processParams(eventInit));target.dispatchEvent(event);if(window.QUnit&&QUnit.config.debug){const group=`%c[${event.type.toUpperCase()}]`;console.groupCollapsed(group,"color: #b52c9b");console.log(target,event);console.groupEnd(group,"color: #b52c9b");}
if(options.sync){return event;}else{return nextTick().then(()=>event);}}
__exports.triggerEvents=triggerEvents;function triggerEvents(el,selector,eventDefs,options={}){const events=[...eventDefs].map((eventDef)=>{const[eventType,eventInit]=Array.isArray(eventDef)?eventDef:[eventDef,{}];return triggerEvent(el,selector,eventType,eventInit,options);});if(options.sync){return events;}else{return nextTick().then(()=>events);}}
__exports.triggerScroll=triggerScroll;async function triggerScroll(target,coordinates={left:null,top:null},canPropagate=true){const isScrollable=(target.scrollHeight>target.clientHeight&&target.clientHeight>0)||(target.scrollWidth>target.clientWidth&&target.clientWidth>0);if(!isScrollable&&!canPropagate){return;}
if(isScrollable){const canScrollFrom={left:coordinates.left>target.scrollLeft?target.scrollLeft+target.clientWidth<target.scrollWidth:target.scrollLeft>0,top:coordinates.top>target.scrollTop?target.scrollTop+target.clientHeight<target.scrollHeight:target.scrollTop>0,};const scrollCoordinates={};Object.entries(coordinates).forEach(([key,value])=>{if(value!==null&&canScrollFrom[key]){scrollCoordinates[key]=value;delete coordinates[key];}});target.scrollTo(scrollCoordinates);await triggerEvent(target,null,"scroll");if(!canPropagate||!Object.entries(coordinates).length){return;}}
target.parentElement?triggerScroll(target.parentElement,coordinates):triggerEvent(window,null,"scroll");await nextTick();}
__exports.click=click;function click(el,selector,{mouseEventInit={},skipDisabledCheck=false,skipVisibilityCheck=false}={}){if(!skipDisabledCheck&&el.disabled){throw new Error("Can't click on a disabled button");}
return triggerEvents(el,selector,["pointerdown","mousedown","focus","focusin","pointerup","mouseup",["click",mouseEventInit],],{skipVisibilityCheck});}
__exports.clickCreate=clickCreate;function clickCreate(htmlElement){if(htmlElement.querySelectorAll(".o_control_panel_main_buttons .o_form_button_create").length){return click(htmlElement,".o_control_panel_main_buttons .o_form_button_create");}else if(htmlElement.querySelectorAll(".o_control_panel_main_buttons .o_list_button_create").length){return click(htmlElement,".o_control_panel_main_buttons .o_list_button_create");}else{throw new Error("No edit button found to be clicked.");}}
__exports.clickEdit=clickEdit;function clickEdit(htmlElement){if(htmlElement.querySelectorAll(".o_list_button_edit").length){return click(htmlElement,".o_list_button_edit");}else{throw new Error("No edit button found to be clicked.");}}
__exports.clickSave=clickSave;async function clickSave(htmlElement){if(htmlElement.querySelectorAll(".o_form_status_indicator").length){await mouseEnter(htmlElement,".o_form_status_indicator");}
if(htmlElement.querySelectorAll(".o_form_button_save").length){return click(htmlElement,".o_form_button_save");}
const listSaveButtons=htmlElement.querySelectorAll(".o_list_button_save");if(listSaveButtons.length){return listSaveButtons.length>=2?click(listSaveButtons[1]):click(listSaveButtons[0]);}else{throw new Error("No save button found to be clicked.");}}
__exports.clickDiscard=clickDiscard;async function clickDiscard(htmlElement){if(htmlElement.querySelectorAll(".o_form_status_indicator").length){await mouseEnter(htmlElement,".o_form_status_indicator");}
if(htmlElement.querySelectorAll(".o_form_button_cancel").length){return click(htmlElement,".o_form_button_cancel");}else if($(htmlElement).find(".o_list_button_discard:visible").length){return click($(htmlElement).find(".o_list_button_discard:visible").get(0));}else{throw new Error("No discard button found to be clicked.");}}
__exports.mouseEnter=mouseEnter;async function mouseEnter(el,selector,coordinates){const target=el.querySelector(selector)||el;const atPos=coordinates||{clientX:target.getBoundingClientRect().left+target.getBoundingClientRect().width/2,clientY:target.getBoundingClientRect().top+target.getBoundingClientRect().height/2,};return triggerEvents(target,null,["pointerenter","mouseenter"],atPos);}
__exports.mouseLeave=mouseLeave;async function mouseLeave(el,selector){const target=el.querySelector(selector)||el;return triggerEvents(target,null,["pointerleave","mouseleave"]);}
__exports.editInput=editInput;async function editInput(el,selector,value){const input=findElement(el,selector);if(!(input instanceof HTMLInputElement||input instanceof HTMLTextAreaElement)){throw new Error("Only 'input' and 'textarea' elements can be edited with 'editInput'.");}
if(!["text","textarea","email","search","color","number","file","tel"].includes(input.type)){throw new Error(`Type "${input.type}" not supported by 'editInput'.`);}
const eventOpts={};if(input.type==="file"){const files=Array.isArray(value)?value:[value];const dataTransfer=new DataTransfer();for(const file of files){if(!(file instanceof File)){throw new Error(`File input value should be one or several File objects.`);}
dataTransfer.items.add(file);}
input.files=dataTransfer.files;eventOpts.skipVisibilityCheck=true;}else{input.value=value;}
await triggerEvents(input,null,["input","change"],eventOpts);if(input.type==="file"){await nextTick();await nextTick();}}
__exports.editSelect=editSelect;function editSelect(el,selector,value){const select=findElement(el,selector);if(select.tagName!=="SELECT"){throw new Error("Only select tag can be edited with selectInput.");}
select.value=value;return triggerEvent(select,null,"change");}
__exports.editSelectMenu=editSelectMenu;async function editSelectMenu(el,selector,value){const dropdown=el.querySelector(selector);await click(dropdown.querySelector(".dropdown-toggle"));for(const item of Array.from(el.querySelectorAll(".o_select_menu_menu .dropdown-item"))){if(item.textContent===value){return click(item);}}}
__exports.triggerHotkey=triggerHotkey;async function triggerHotkey(hotkey,addOverlayModParts=false,eventAttrs={}){eventAttrs.key=hotkey.split("+").pop();if(/shift/i.test(hotkey)){eventAttrs.shiftKey=true;}
if(/control/i.test(hotkey)){if(isMacOS()){eventAttrs.metaKey=true;}else{eventAttrs.ctrlKey=true;}}
if(/alt/i.test(hotkey)||addOverlayModParts){if(isMacOS()){eventAttrs.ctrlKey=true;}else{eventAttrs.altKey=true;}}
if(!("bubbles"in eventAttrs)){eventAttrs.bubbles=true;}
const[keydownEvent,keyupEvent]=await triggerEvents(document.activeElement,null,[["keydown",eventAttrs],["keyup",eventAttrs],],{skipVisibilityCheck:true});return{keydownEvent,keyupEvent};}
__exports.mockDownload=mockDownload;function mockDownload(cb){patchWithCleanup(download,{_download:cb});}
const hushConsole=__exports.hushConsole=Object.create(null);for(const propName of Object.keys(window.console)){hushConsole[propName]=()=>{};}
__exports.mockSendBeacon=mockSendBeacon;function mockSendBeacon(mock){patchWithCleanup(navigator,{sendBeacon:(url,blob)=>{return mock(url,blob)!==false;},});}
__exports.mockTimeout=mockTimeout;function mockTimeout(){const timeouts=new Map();let currentTime=0;let id=1;patchWithCleanup(browser,{setTimeout(fn,delay=0){timeouts.set(id,{fn,scheduledFor:delay+currentTime,id});return id++;},clearTimeout(id){timeouts.delete(id);},});return{execRegisteredTimeouts(){for(const{fn}of timeouts.values()){fn();}
timeouts.clear();},async advanceTime(duration){await nextTick();currentTime+=duration;for(const{fn,scheduledFor,id}of timeouts.values()){if(scheduledFor<=currentTime){fn();timeouts.delete(id);}}
await nextTick();},};}
__exports.mockAnimationFrame=mockAnimationFrame;function mockAnimationFrame(){const callbacks=new Map();let currentTime=0;let id=1;patchWithCleanup(browser,{requestAnimationFrame(fn){callbacks.set(id,{fn,scheduledFor:16+currentTime,id});return id++;},cancelAnimationFrame(id){callbacks.delete(id);},performance:{now:()=>currentTime},});return{execRegisteredAnimationFrames(){for(const{fn}of callbacks.values()){fn(currentTime);}
callbacks.clear();},async advanceFrame(count=1){await nextTick();currentTime+=16*count;for(const{fn,scheduledFor,id}of callbacks.values()){if(scheduledFor<=currentTime){fn(currentTime);callbacks.delete(id);}}
await nextTick();},};}
__exports.mount=mount;async function mount(Comp,target,config={}){let{props,env}=config;env=env||{};const configuration={env,getTemplate,test:true,props,};if(env.services&&"localization"in env.services){configuration.translateFn=_t;}
const app=new App(Comp,configuration);registerCleanup(()=>app.destroy());return app.mount(target);}
__exports.destroy=destroy;function destroy(comp){comp.__owl__.app.destroy();}
__exports.findChildren=findChildren;function findChildren(comp,predicate=(e)=>e){const queue=[];[].unshift.apply(queue,Object.values(comp.__owl__.children));while(queue.length>0){const curNode=queue.pop();if(predicate(curNode)){return curNode;}
[].unshift.apply(queue,Object.values(curNode.component.__owl__.children));}}
__exports.useChild=useChild;function useChild(){const node=useComponent().__owl__;const setChild=()=>{const componentNode=Object.values(node.children)[0];node.component.child=componentNode.component;};onMounted(setChild);onPatched(setChild);}
__exports.useLogLifeCycle=useLogLifeCycle;function useLogLifeCycle(logFn,name=""){const component=useComponent();let loggedName=`${component.constructor.name}`;if(name){loggedName=`${component.constructor.name} ${name}`;}
onError(()=>{logFn(`onError ${loggedName}`);});onMounted(()=>{logFn(`onMounted ${loggedName}`);});onPatched(()=>{logFn(`onPatched ${loggedName}`);});onRendered(()=>{logFn(`onRendered ${loggedName}`);});onWillDestroy(()=>{logFn(`onWillDestroy ${loggedName}`);});onWillPatch(()=>{logFn(`onWillPatch ${loggedName}`);});onWillRender(()=>{logFn(`onWillRender ${loggedName}`);});onWillStart(()=>{logFn(`onWillStart ${loggedName}`);});onWillUnmount(()=>{logFn(`onWillUnmount ${loggedName}`);});onWillUpdateProps(()=>{logFn(`onWillUpdateProps ${loggedName}`);});}
function getDifferentParents(n1,n2){const parents=[n2];while(parents[0].parentNode){const parent=parents[0].parentNode;if(parent.contains(n1)){break;}
parents.unshift(parent);}
return parents;}
__exports.dragAndDrop=dragAndDrop;async function dragAndDrop(from,to,position){const{drop}=await drag(from);await drop(to,position);}
__exports.drag=drag;async function drag(from,pointerType="mouse"){const assertIsDragging=(fn,endDrag)=>{return{async[fn.name](...args){if(dragEndReason){throw new Error(`Cannot execute drag helper '${fn.name}': drag sequence has been ended by '${dragEndReason}'.`);}
await fn(...args);if(endDrag){dragEndReason=fn.name;}},}[fn.name];};const cancel=assertIsDragging(async function cancel(){await triggerEvent(window,null,"keydown",{key:"Escape"});},true);const drop=assertIsDragging(async function drop(to,position){if(to){await moveTo(to,position);}
await triggerEvent(target||source,null,"pointerup",targetPosition);},true);const getEl=(selector)=>selector instanceof Element?selector:fixture.querySelector(selector);const getTargetPosition=(position)=>{const tRect=target.getBoundingClientRect();const tPos={clientX:Math.floor(tRect.x),clientY:Math.floor(tRect.y),};if(position&&typeof position==="object"){tPos.clientX+=position.x||0;tPos.clientY+=position.y||0;}else{const positions=typeof position==="string"?position.split("-"):[];if(positions.includes("left")){tPos.clientX-=1;}else if(positions.includes("right")){tPos.clientX+=Math.ceil(tRect.width)+1;}else{tPos.clientX+=Math.floor(tRect.width/2);}
if(positions.includes("top")){tPos.clientY-=1;}else if(positions.includes("bottom")){tPos.clientY+=Math.ceil(tRect.height)+1;}else{tPos.clientY+=Math.floor(tRect.height/2);}}
return tPos;};const moveTo=assertIsDragging(async function moveTo(to,position){target=getEl(to);if(!target){return;}
targetPosition=getTargetPosition(position);await triggerEvent(source,null,"pointermove",{...targetPosition,button:-1});for(const parent of getDifferentParents(source,target)){triggerEvent(parent,null,"pointerenter",targetPosition);}
await nextTick();return dragHelpers;},false);const dragHelpers={cancel,drop,moveTo};const fixture=getFixture();const source=getEl(from instanceof Element?from:fixture.querySelector(from));const sourceRect=source.getBoundingClientRect();let dragEndReason=null;let target;let targetPosition;await triggerEvent(source,null,"pointerdown",{pointerType,clientX:sourceRect.x+sourceRect.width/2,clientY:sourceRect.y+sourceRect.height/2,});return dragHelpers;}
__exports.getDropdownMenu=getDropdownMenu;function getDropdownMenu(target,togglerSelector){if(!(target instanceof HTMLElement)){throw new Error(`getDropdownMenu: target is not an HTMLElement.`);}
let el=togglerSelector instanceof HTMLElement?togglerSelector:target.querySelector(togglerSelector);if(el&&!el.classList.contains("o-dropdown")){el=el.querySelector(".o-dropdown");}
if(!el){throw new Error(`getDropdownMenu: Could not find element "${togglerSelector}".`);}
return getPopoverForTarget(el);}
__exports.clickDropdown=clickDropdown;async function clickDropdown(target,fieldName){const dropdownInput=target.querySelector(`[name='${fieldName}'] .dropdown input`);dropdownInput.focus();await nextTick();await click(dropdownInput);}
__exports.clickOpenedDropdownItem=clickOpenedDropdownItem;async function clickOpenedDropdownItem(target,fieldName,itemContent){const dropdowns=target.querySelectorAll(`[name='${fieldName}'] .dropdown .dropdown-menu`);if(dropdowns.length===0){throw new Error(`No dropdown found for field ${fieldName}`);}else if(dropdowns.length>1){throw new Error(`Found ${dropdowns.length} dropdowns for field ${fieldName}`);}
const dropdownItems=dropdowns[0].querySelectorAll("li");const indexToClick=Array.from(dropdownItems).map((html)=>html.textContent).indexOf(itemContent);if(indexToClick===-1){throw new Error(`The element '${itemContent}' does not exist in the dropdown`);}
await click(dropdownItems[indexToClick]);}
__exports.selectDropdownItem=selectDropdownItem;async function selectDropdownItem(target,fieldName,itemContent){await clickDropdown(target,fieldName);await clickOpenedDropdownItem(target,fieldName,itemContent);}
__exports.getNodesTextContent=getNodesTextContent;function getNodesTextContent(nodes){return Array.from(nodes).map((n)=>n.textContent);}
__exports.clickOpenM2ODropdown=clickOpenM2ODropdown;async function clickOpenM2ODropdown(el,fieldName,selector){const m2oSelector=`${selector || ""} .o_field_many2one[name=${fieldName}] input`;const matches=el.querySelectorAll(m2oSelector);if(matches.length!==1){throw new Error(`cannot open m2o: selector ${selector} has been found ${matches.length} instead of 1`);}
await click(matches[0]);return matches[0];}
__exports.clickM2OHighlightedItem=clickM2OHighlightedItem;async function clickM2OHighlightedItem(el,fieldName,selector){const m2oSelector=`${selector || ""} .o_field_many2one[name=${fieldName}] input`;const matches=el.querySelectorAll(m2oSelector);if(matches.length!==1){throw new Error(`cannot open m2o: selector ${selector} has been found ${matches.length} instead of 1`);}
return click(matches[0].parentElement.querySelector("li"));}
__exports.addRow=addRow;async function addRow(target,selector){await click(target.querySelector(`${selector ? selector : ""} .o_field_x2many_list_row_add a`));}
__exports.removeRow=removeRow;async function removeRow(target,index){await click(target.querySelectorAll(".o_list_record_remove")[index]);}
return __exports;});odoo.define(`@web/../tests/helpers/utils`,['@web/../tests/legacy/helpers/utils'],function(require){return require('@web/../tests/legacy/helpers/utils');});;

/* /web/static/tests/legacy/helpers/cleanup.js */
odoo.define('@web/../tests/legacy/helpers/cleanup',[],function(require){'use strict';let __exports={};const cleanups=[];__exports.registerCleanup=registerCleanup;function registerCleanup(callback){cleanups.push(callback);}
if(window.QUnit){QUnit.on("OdooAfterTestHook",(info)=>{if(QUnit.config.debug){return;}
let cleanup;while((cleanup=cleanups.pop())){try{cleanup(info);}catch(error){console.error(error);}}});const validElements=[{tagName:"DIV",attr:"id",value:"qunit",keep:true},{tagName:"DIV",attr:"id",value:"qunit-fixture",keep:true},{tagName:"SCRIPT",attr:"id",value:""},{tagName:"DIV",attr:"class",value:"o_notification_manager"},{tagName:"DIV",attr:"class",value:"tooltip fade bs-tooltip-auto"},{tagName:"DIV",attr:"class",value:"tooltip fade bs-tooltip-auto show"},{tagName:"DIV",attr:"class",value:"tooltip tooltip-field-info fade bs-tooltip-auto"},{tagName:"DIV",attr:"class",value:"tooltip tooltip-field-info fade bs-tooltip-auto show",},{tagName:"DIV",attr:"class",value:"ui-helper-hidden-accessible"},{tagName:"UL",attr:"class",value:"ui-menu ui-widget ui-widget-content ui-autocomplete ui-front",},{tagName:"UL",attr:"class",value:"ui-menu ui-widget ui-widget-content ui-autocomplete dropdown-menu ui-front",},];QUnit.on("OdooAfterTestHook",function(info){if(QUnit.config.debug){return;}
const failed=info.testReport.getStatus()==="failed";const toRemove=[];for(const bodyChild of document.body.children){const tolerated=validElements.find((e)=>e.tagName===bodyChild.tagName&&bodyChild.getAttribute(e.attr)===e.value);if(!failed&&!tolerated){QUnit.pushFailure(`Body still contains undesirable elements:\n${bodyChild.outerHTML}`);}
if(!tolerated||!tolerated.keep){toRemove.push(bodyChild);}}
const qunitFixture=document.getElementById("qunit-fixture");if(qunitFixture.children.length){toRemove.push(...qunitFixture.children);}
for(const el of toRemove){el.remove();}
document.body.classList.remove("modal-open");});}
return __exports;});odoo.define(`@web/../tests/helpers/cleanup`,['@web/../tests/legacy/helpers/cleanup'],function(require){return require('@web/../tests/legacy/helpers/cleanup');});;

/* /barcodes/static/tests/helpers.js */
odoo.define('@barcodes/../tests/helpers',['@web/../tests/helpers/utils'],function(require){'use strict';let __exports={};const{triggerEvent}=require("@web/../tests/helpers/utils");__exports.simulateBarCode=simulateBarCode;function simulateBarCode(chars,target=document.body,selector=undefined){for(let char of chars){triggerEvent(target,selector,"keydown",{key:char,});}}
return __exports;});;

/* /point_of_sale/static/tests/tours/OrderWithLots_tour.js */
odoo.define('@point_of_sale/../tests/tours/OrderWithLots_tour',['@point_of_sale/../tests/tours/utils/product_screen_util','@point_of_sale/../tests/tours/utils/dialog_util','@point_of_sale/../tests/tours/utils/chrome_util','@point_of_sale/../tests/tours/utils/numpad_util','@web/core/registry'],function(require){'use strict';let __exports={};const ProductScreen=require("@point_of_sale/../tests/tours/utils/product_screen_util");const Dialog=require("@point_of_sale/../tests/tours/utils/dialog_util");const Chrome=require("@point_of_sale/../tests/tours/utils/chrome_util");const Numpad=require("@point_of_sale/../tests/tours/utils/numpad_util");const{registry}=require("@web/core/registry");registry.category("web_tour.tours").add("test_03_pos_with_lots",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),ProductScreen.clickDisplayedProduct("Monitor Stand"),ProductScreen.enterLotNumber("1"),ProductScreen.selectedOrderlineHas("Monitor Stand","1"),ProductScreen.clickReview(),{...ProductScreen.clickLine("Monitor Stand")[0],isActive:["mobile"]},Numpad.click("2"),{...ProductScreen.back(),isActive:["mobile"]},ProductScreen.totalAmountIs("6.38"),ProductScreen.clickDisplayedProduct("Monitor Stand"),ProductScreen.enterLotNumber("2"),ProductScreen.clickReview(),{...ProductScreen.clickLine("Monitor Stand")[0],isActive:["mobile"]},Numpad.click("3"),{...ProductScreen.back(),isActive:["mobile"]},ProductScreen.totalAmountIs("15.95"),ProductScreen.clickPriceList("min_quantity ordering"),ProductScreen.totalAmountIs("5.00"),ProductScreen.clickReview(),{...ProductScreen.clickLine("Monitor Stand")[0],isActive:["mobile"]},Numpad.click("⌫"),{...ProductScreen.back(),isActive:["mobile"]},ProductScreen.totalAmountIs("6.38"),ProductScreen.isShown(),].flat(),});return __exports;});;

/* /point_of_sale/static/tests/tours/acceptance_tour.js */
odoo.define('@point_of_sale/../tests/tours/acceptance_tour',['@point_of_sale/../tests/tours/utils/numpad_util','@web/core/registry','@point_of_sale/../tests/tours/utils/generic_components/order_widget_util','@point_of_sale/../tests/tours/utils/common','@point_of_sale/../tests/tours/utils/product_screen_util','@point_of_sale/../tests/tours/utils/payment_screen_util','@point_of_sale/../tests/tours/utils/chrome_util'],function(require){'use strict';let __exports={};const Numpad=require("@point_of_sale/../tests/tours/utils/numpad_util");const{registry}=require("@web/core/registry");const Order=require("@point_of_sale/../tests/tours/utils/generic_components/order_widget_util");const{inLeftSide,waitForLoading}=require("@point_of_sale/../tests/tours/utils/common");const ProductScreen=require("@point_of_sale/../tests/tours/utils/product_screen_util");const PaymentScreen=require("@point_of_sale/../tests/tours/utils/payment_screen_util");const Chrome=require("@point_of_sale/../tests/tours/utils/chrome_util");registry.category("web_tour.tours").add("pos_basic_order_01_multi_payment_and_change",{steps:()=>[waitForLoading(),Chrome.startPoS(),ProductScreen.clickDisplayedProduct("Desk Organizer",true,"1.0","5.10"),ProductScreen.clickDisplayedProduct("Desk Organizer",true,"2.0","10.20"),ProductScreen.clickPayButton(),PaymentScreen.clickPaymentMethod("Cash"),PaymentScreen.enterPaymentLineAmount("Cash","5",true,{amount:"5.0",remaining:"5.20",}),PaymentScreen.clickPaymentMethod("Bank",true,{amount:"5.2"}),PaymentScreen.enterPaymentLineAmount("Bank","6",true,{amount:"6.0",change:"0.80",}),ProductScreen.finishOrder(),].flat(),});registry.category("web_tour.tours").add("pos_basic_order_02_decimal_order_quantity",{steps:()=>[waitForLoading(),Chrome.startPoS(),ProductScreen.clickDisplayedProduct("Desk Organizer",true,"1.0"),inLeftSide([{...ProductScreen.clickLine("Desk Organizer")[0],isActive:["mobile"]},Numpad.click("."),...ProductScreen.selectedOrderlineHasDirect("Desk Organizer","0.0"),Numpad.click("9"),...ProductScreen.selectedOrderlineHasDirect("Desk Organizer","0.9"),Numpad.click("9"),...ProductScreen.selectedOrderlineHasDirect("Desk Organizer","0.99"),]),ProductScreen.clickPayButton(),PaymentScreen.clickPaymentMethod("Cash",true,{amount:"5.05"}),ProductScreen.finishOrder(),].flat(),});registry.category("web_tour.tours").add("pos_basic_order_03_tax_position",{steps:()=>[waitForLoading(),Chrome.startPoS(),ProductScreen.clickDisplayedProduct("Letter Tray",true,"1.0"),inLeftSide(...Order.hasTotal("5.28")),ProductScreen.clickFiscalPosition("FP-POS-2M",true),inLeftSide(...Order.hasTotal("5.52")),ProductScreen.closePos(),].flat(),});return __exports;});;

/* /point_of_sale/static/tests/tours/barcode_scanning_tour.js */
odoo.define('@point_of_sale/../tests/tours/barcode_scanning_tour',['@point_of_sale/../tests/tours/utils/product_screen_util','@point_of_sale/../tests/tours/utils/chrome_util','@point_of_sale/../tests/tours/utils/dialog_util','@web/core/registry','@point_of_sale/../tests/tours/utils/common'],function(require){'use strict';let __exports={};const ProductScreen=require("@point_of_sale/../tests/tours/utils/product_screen_util");const Chrome=require("@point_of_sale/../tests/tours/utils/chrome_util");const Dialog=require("@point_of_sale/../tests/tours/utils/dialog_util");const{registry}=require("@web/core/registry");const{scan_barcode}=require("@point_of_sale/../tests/tours/utils/common");registry.category("web_tour.tours").add("BarcodeScanningTour",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),scan_barcode("0123456789"),ProductScreen.selectedOrderlineHas("Monitor Stand"),scan_barcode("0123456789"),ProductScreen.selectedOrderlineHas("Monitor Stand",2),scan_barcode("2305000000004"),ProductScreen.selectedOrderlineHas("Magnetic Board",1,"0.00"),scan_barcode("2305000123451"),ProductScreen.selectedOrderlineHas("Magnetic Board",1,"123.45"),scan_barcode("2100005000000"),ProductScreen.selectedOrderlineHas("Wall Shelf Unit",0,"0.00"),scan_barcode("2100005080002"),ProductScreen.selectedOrderlineHas("Wall Shelf Unit",8),Chrome.endTour(),].flat(),});registry.category("web_tour.tours").add("BarcodeScanningProductPackagingTour",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),scan_barcode("12345601"),ProductScreen.selectedOrderlineHas("Packaging Product",1),scan_barcode("12345601"),ProductScreen.selectedOrderlineHas("Packaging Product",2),scan_barcode("12345610"),ProductScreen.selectedOrderlineHas("Packaging Product",12),scan_barcode("12345610"),ProductScreen.selectedOrderlineHas("Packaging Product",22),Chrome.endTour(),].flat(),});registry.category("web_tour.tours").add("GS1BarcodeScanningTour",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),scan_barcode("0108431673020125100000001"),ProductScreen.selectedOrderlineHas("Product 1"),scan_barcode("0108431673020125100000001"),ProductScreen.selectedOrderlineHas("Product 1",2),scan_barcode("0108431673020125305"),ProductScreen.selectedOrderlineHas("Product 1",7),scan_barcode("01084316730201253010"),ProductScreen.selectedOrderlineHas("Product 1",17),scan_barcode("08431673020126"),ProductScreen.selectedOrderlineHas("Product 2"),scan_barcode("08431673020126"),ProductScreen.selectedOrderlineHas("Product 2",2),scan_barcode("3760171283370"),ProductScreen.selectedOrderlineHas("Product 3"),scan_barcode("3760171283370"),ProductScreen.selectedOrderlineHas("Product 3",2),scan_barcode("0108431673020132"),ProductScreen.selectedOrderlineHas("Product 1",17+10),scan_barcode("0108431673020132305"),ProductScreen.selectedOrderlineHas("Product 1",27+5*10),Chrome.endTour(),].flat(),});registry.category("web_tour.tours").add("BarcodeScanPartnerTour",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),scan_barcode("0421234567890"),ProductScreen.customerIsSelected("John Doe"),Chrome.endTour(),].flat(),});return __exports;});;

/* /point_of_sale/static/tests/tours/chrome_tour.js */
odoo.define('@point_of_sale/../tests/tours/chrome_tour',['@point_of_sale/../tests/tours/utils/product_screen_util','@point_of_sale/../tests/tours/utils/receipt_screen_util','@point_of_sale/../tests/tours/utils/dialog_util','@point_of_sale/../tests/tours/utils/payment_screen_util','@point_of_sale/../tests/tours/utils/partner_list_util','@point_of_sale/../tests/tours/utils/ticket_screen_util','@point_of_sale/../tests/tours/utils/chrome_util','@point_of_sale/../tests/tours/utils/common','@web/core/registry','@point_of_sale/../tests/tours/utils/generic_components/order_widget_util'],function(require){'use strict';let __exports={};const ProductScreen=require("@point_of_sale/../tests/tours/utils/product_screen_util");const ReceiptScreen=require("@point_of_sale/../tests/tours/utils/receipt_screen_util");const Dialog=require("@point_of_sale/../tests/tours/utils/dialog_util");const PaymentScreen=require("@point_of_sale/../tests/tours/utils/payment_screen_util");const PartnerList=require("@point_of_sale/../tests/tours/utils/partner_list_util");const TicketScreen=require("@point_of_sale/../tests/tours/utils/ticket_screen_util");const Chrome=require("@point_of_sale/../tests/tours/utils/chrome_util");const Utils=require("@point_of_sale/../tests/tours/utils/common");const{registry}=require("@web/core/registry");const{inLeftSide,negateStep}=require("@point_of_sale/../tests/tours/utils/common");const Order=require("@point_of_sale/../tests/tours/utils/generic_components/order_widget_util");registry.category("web_tour.tours").add("ChromeTour",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),Chrome.clickMenuButton(),Chrome.clickMenuDropdownOption("Cash In/Out"),Chrome.fillTextArea(".cash-reason","MOBT"),Dialog.confirm(),Chrome.clickMenuButton(),ProductScreen.addOrderline("Desk Pad","1","2","2.0"),Chrome.clickMenuOption("Orders"),TicketScreen.checkStatus("-0001","Ongoing"),Chrome.createFloatingOrder(),ProductScreen.addOrderline("Monitor Stand","3","4","12.0"),ProductScreen.clickPayButton(),PaymentScreen.isShown(),Chrome.clickMenuOption("Orders"),TicketScreen.checkStatus("-0002","Payment"),Chrome.createFloatingOrder(),ProductScreen.addOrderline("Whiteboard Pen","5","6","30.0"),ProductScreen.clickPayButton(),PaymentScreen.clickPaymentMethod("Bank",true,{remaining:"0.0"}),PaymentScreen.validateButtonIsHighlighted(true),PaymentScreen.clickValidate(),ReceiptScreen.isShown(),Chrome.clickMenuOption("Orders"),TicketScreen.checkStatus("-0003","Receipt"),TicketScreen.selectOrder("-0001"),TicketScreen.loadSelectedOrder(),ProductScreen.productIsDisplayed("Desk Pad"),inLeftSide([...ProductScreen.clickLine("Desk Pad"),...ProductScreen.selectedOrderlineHasDirect("Desk Pad","1.0","2.0"),]),Chrome.clickMenuOption("Orders"),TicketScreen.selectOrder("-0002"),TicketScreen.loadSelectedOrder(),PaymentScreen.emptyPaymentlines("12.0"),PaymentScreen.validateButtonIsHighlighted(false),Chrome.clickMenuOption("Orders"),TicketScreen.selectOrder("-0003"),TicketScreen.loadSelectedOrder(),ReceiptScreen.totalAmountContains("30.0"),Chrome.clickMenuOption("Orders"),TicketScreen.selectOrder("-0001"),TicketScreen.loadSelectedOrder(),ProductScreen.isShown(),ProductScreen.clickPayButton(),PaymentScreen.clickPaymentMethod("Cash"),PaymentScreen.enterPaymentLineAmount("Cash","20",true,{change:"18.0"}),PaymentScreen.validateButtonIsHighlighted(true),PaymentScreen.clickValidate(),ReceiptScreen.totalAmountContains("2.0"),Chrome.clickMenuOption("Orders"),TicketScreen.checkStatus("-0001","Receipt"),TicketScreen.selectOrder("-0003"),TicketScreen.loadSelectedOrder(),ReceiptScreen.totalAmountContains("30.0"),ReceiptScreen.clickNextOrder(),ProductScreen.orderIsEmpty(),Chrome.clickMenuOption("Orders"),TicketScreen.deleteOrder("-0004"),TicketScreen.nthRowContains(2,"Payment"),TicketScreen.deleteOrder("-0002"),Dialog.confirm(),Chrome.createFloatingOrder(),ProductScreen.addOrderline("Whiteboard Pen","5","6"),ProductScreen.clickPartnerButton(),ProductScreen.clickCustomer("Partner Test 1"),ProductScreen.clickPayButton(),PaymentScreen.clickPaymentMethod("Bank"),PaymentScreen.clickInvoiceButton(),PaymentScreen.clickValidate(),ReceiptScreen.isShown(),].flat(),});registry.category("web_tour.tours").add("OrderModificationAfterValidationError",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),ProductScreen.clickDisplayedProduct("Test Product",true,"1.00"),ProductScreen.clickPayButton(),PaymentScreen.clickPaymentMethod("Bank",true,{remaining:"0.0"}),PaymentScreen.clickValidate(),Dialog.confirm(),PaymentScreen.clickBack(),{...ProductScreen.back(),isActive:["mobile"]},ProductScreen.isShown(),ProductScreen.clickDisplayedProduct("Test Product",true,"2.00"),].flat(),});registry.category("web_tour.tours").add("SearchMoreCustomer",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),ProductScreen.clickPartnerButton(),ProductScreen.inputCustomerSearchbar("1111"),Utils.selectButton("Search more"),ProductScreen.clickCustomer("BPartner"),ProductScreen.isShown(),].flat(),});registry.category("web_tour.tours").add("test_tracking_number_closing_session",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),ProductScreen.clickDisplayedProduct("Desk Organizer",true,"1.0"),ProductScreen.clickPayButton(),PaymentScreen.clickPaymentMethod("Bank"),PaymentScreen.clickValidate(),ReceiptScreen.clickNextOrder(),ProductScreen.isShown(),Chrome.clickMenuOption("Close Register"),{content:`Select button close register`,trigger:`button:contains(close register)`,run:"click",expectUnloadPage:true,},Chrome.startPoS(),Dialog.confirm("Open Register"),ProductScreen.clickDisplayedProduct("Desk Pad",true,"1.0"),ProductScreen.clickPayButton(),PaymentScreen.clickPaymentMethod("Bank"),PaymentScreen.clickValidate(),].flat(),});registry.category("web_tour.tours").add("test_zero_decimal_places_currency",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),ProductScreen.clickDisplayedProduct("Test Product",true,"1.00"),ProductScreen.clickPayButton(),PaymentScreen.clickPaymentMethod("Cash"),PaymentScreen.clickValidate(),ReceiptScreen.receiptIsThere(),ReceiptScreen.totalAmountContains("100"),].flat(),});registry.category("web_tour.tours").add("test_limited_categories",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),ProductScreen.clickSubcategory("Parent"),ProductScreen.productIsDisplayed("Product 1"),ProductScreen.productIsDisplayed("Product 2"),ProductScreen.clickSubcategory("Child 1"),ProductScreen.productIsDisplayed("Product 1"),ProductScreen.productIsDisplayed("Product 2").map(negateStep),ProductScreen.clickSubcategory("Child 2"),ProductScreen.productIsDisplayed("Product 1").map(negateStep),ProductScreen.productIsDisplayed("Product 2"),].flat(),});registry.category("web_tour.tours").add("CustomerNoteIsPresentAfterRefresh",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),ProductScreen.clickDisplayedProduct("Desk Organizer",true,"1.0","5.10"),inLeftSide([{...ProductScreen.clickLine("Desk Organizer")[0],isActive:["mobile"]},...ProductScreen.addCustomerNote("Test customer note"),...Order.hasLine({customerNote:"Test customer note",}),]),Utils.refresh(),inLeftSide([{...ProductScreen.clickLine("Desk Organizer")[0],isActive:["mobile"]},...Order.hasLine({customerNote:"Test customer note",}),]),].flat(),});registry.category("web_tour.tours").add("test_chrome_without_cash_move_permission",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),Chrome.isCashMoveButtonHidden(),].flat(),});registry.category("web_tour.tours").add("test_click_all_orders_keep_customer",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),ProductScreen.clickPartnerButton(),ProductScreen.clickCustomer("Partner Test 1"),ProductScreen.clickPartnerButton(),PartnerList.clickPartnerOptions("Partner Test 1"),{isActive:["auto"],trigger:"div.o_popover :contains('All Orders')",content:"Check the popover opened",run:"click",},TicketScreen.clickDiscard(),ProductScreen.isShown(),{content:"customer is selected",trigger:".product-screen .set-partner:contains('Partner Test 1')",},].flat(),});registry.category("web_tour.tours").add("test_ctrl_number_ignored",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),ProductScreen.addOrderline("Whiteboard Pen","1","6","6.0"),{trigger:"body",run:()=>{window.dispatchEvent(new KeyboardEvent("keyup",{key:"5",ctrlKey:true}));},},{trigger:"body",run:()=>new Promise((resolve)=>{setTimeout(resolve,300);}),},inLeftSide([{...ProductScreen.clickLine("Whiteboard Pen")[0],isActive:["mobile"]},...ProductScreen.selectedOrderlineHasDirect("Whiteboard Pen","1","6.0"),]),].flat(),});return __exports;});;

/* /point_of_sale/static/tests/tours/customer_display_tour.js */
odoo.define('@point_of_sale/../tests/tours/customer_display_tour',['@point_of_sale/../tests/tours/utils/generic_components/order_widget_util','@web/core/registry','@point_of_sale/../tests/tours/utils/common'],function(require){'use strict';let __exports={};const Order=require("@point_of_sale/../tests/tours/utils/generic_components/order_widget_util");const{registry}=require("@web/core/registry");const{run}=require("@point_of_sale/../tests/tours/utils/common");__exports.postMessage=postMessage;function postMessage(message,description=""){return run(()=>{window.customerDisplayChannel.postMessage(typeof message==="string"?JSON.parse(message):message);},`send message to customer display: ${description},  with value: ${message}`);}
__exports.amountIs=amountIs;function amountIs(method,amount){return{content:`Check that the ${method} amount is ${amount}`,trigger:`div.row:has(div:contains('${method}')):has(div:contains('${amount}'))`,};}
const ADD_PRODUCT='{"lines":[{"productName":"Letter Tray","price":"$ 2,972.75","qty":"1.00","unit":"Units","unitPrice":"$ 2,972.75","oldUnitPrice":"","customerNote":"","internalNote":"","comboParent":"","packLotLines":[],"price_without_discount":"$ 2,972.75","isSelected":false,"imageSrc":"/web/image/product.product/855/image_128"}],"finalized":false,"amount":"2,972.75","paymentLines":[],"change":0,"onlinePaymentData":{}}';const ADD_PRODUCT_SELECTED=__exports.ADD_PRODUCT_SELECTED='{"lines":[{"productName":"Letter Tray","price":"$ 2,972.75","qty":"1.00","unit":"Units","unitPrice":"$ 2,972.75","oldUnitPrice":"","customerNote":"","internalNote":"","comboParent":"","packLotLines":[],"price_without_discount":"$ 2,972.75","isSelected":true,"imageSrc":"/web/image/product.product/855/image_128"}],"finalized":false,"amount":"2,972.75","paymentLines":[],"change":0,"onlinePaymentData":{}}';const PAY_WITH_CASH='{"lines":[{"productName":"Letter Tray","price":"$ 2,972.75","qty":"1.00","unit":"Units","unitPrice":"$ 2,972.75","oldUnitPrice":"","customerNote":"","internalNote":"","comboParent":"","packLotLines":[],"price_without_discount":"$ 2,972.75","isSelected":true,"imageSrc":"/web/image/product.product/855/image_128"}],"finalized":false,"amount":"2,972.75","paymentLines":[{"name":"Cash","amount":"2,972.75"}],"change":0,"onlinePaymentData":{}}';const ORDER_IS_FINALIZED=__exports.ORDER_IS_FINALIZED='{"lines":[{"productName":"Letter Tray","price":"$ 2,972.75","qty":"1.00","unit":"Units","unitPrice":"$ 2,972.75","oldUnitPrice":"","customerNote":"","internalNote":"","comboParent":"","packLotLines":[],"price_without_discount":"$ 2,972.75","isSelected":false,"imageSrc":"/web/image/product.product/855/image_128"}],"finalized":true,"amount":"2,972.75","paymentLines":[{"name":"Cash","amount":"2,972.75"}],"change":0,"onlinePaymentData":{}}';const NEW_ORDER=__exports.NEW_ORDER='{"lines":[],"finalized":false,"amount":"0.00","paymentLines":[],"change":0,"onlinePaymentData":{}}';const QR_URL="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==";const PAY_WITH_CARD={lines:[{productName:"Letter Tray",price:"$ 2,972.75",qty:"1.00",unit:"Units",unitPrice:"$ 2,972.75",oldUnitPrice:"",customerNote:"",internalNote:"",comboParent:"",packLotLines:[],price_without_discount:"$ 2,972.75",isSelected:true,imageSrc:"/web/image/product.product/855/image_128",},],finalized:false,amount:"2,972.75",paymentLines:[{name:"CARD",amount:"2,972.75"}],change:0,onlinePaymentData:{},qrPaymentData:null,};const SEND_QR={lines:[{productName:"Letter Tray",price:"$ 2,972.75",qty:"1.00",unit:"Units",unitPrice:"$ 2,972.75",oldUnitPrice:"",customerNote:"",internalNote:"",comboParent:"",packLotLines:[],price_without_discount:"$ 2,972.75",isSelected:true,imageSrc:"/web/image/product.product/855/image_128",},],finalized:false,amount:"2,972.75",paymentLines:[{name:"CARD",amount:"2,972.75"}],change:0,onlinePaymentData:{},qrPaymentData:{amount:"$ 2,972.75",name:"CARD",qrCode:QR_URL,},};registry.category("web_tour.tours").add("CustomerDisplayTour",{steps:()=>[{trigger:"div:contains('Welcome.')",run:()=>{window.customerDisplayChannel=new BroadcastChannel("UPDATE_CUSTOMER_DISPLAY");postMessage(ADD_PRODUCT,"add product").run();},},Order.hasLine({productName:"Letter Tray",price:"2,972.75"}),{content:"An order line with `isSelected: false` should not have 'selected' class",trigger:".order-container .orderline:last-child:not(.selected)",},amountIs("Total","2,972.75"),postMessage(PAY_WITH_CASH,"pay with cash"),amountIs("Cash","2,972.75"),postMessage(ORDER_IS_FINALIZED,"order is finalized"),{content:"Check that we are now on the 'Thank you' screen",trigger:"div:contains('Thank you.')",},postMessage(NEW_ORDER,"new order"),{trigger:" div:contains('Welcome.')",},Order.doesNotHaveLine({}),amountIs("Total","0.00"),{trigger:"body",run:()=>postMessage(ADD_PRODUCT_SELECTED,"add products").run(),},{content:"An order line with `isSelected: true` should have 'selected' class",trigger:".order-container .orderline:last-child.selected",},].flat(),});registry.category("web_tour.tours").add("CustomerDisplayTourWithQr",{steps:()=>[{trigger:"div:contains('Welcome.')",run:()=>{window.customerDisplayChannel=new BroadcastChannel("UPDATE_CUSTOMER_DISPLAY");postMessage(ADD_PRODUCT,"add product").run();},},Order.hasLine({productName:"Letter Tray",price:"2,972.75"}),amountIs("Total","2,972.75"),postMessage(PAY_WITH_CARD,"pay with card"),postMessage(SEND_QR,"send qr code"),{trigger:"img[alt='QR Code']"},postMessage(PAY_WITH_CARD,"confirm payment"),postMessage(ORDER_IS_FINALIZED,"order is finalized"),{content:"Check that we are now on the 'Thank you' screen",trigger:"div:contains('Thank you.')",},].flat(),});return __exports;});;

/* /point_of_sale/static/tests/tours/fake_tours.js */
odoo.define('@point_of_sale/../tests/tours/fake_tours',['@web/core/registry','@point_of_sale/../tests/tours/utils/product_screen_util','@point_of_sale/../tests/tours/utils/payment_screen_util','@point_of_sale/../tests/tours/utils/receipt_screen_util'],function(require){'use strict';let __exports={};const{registry}=require("@web/core/registry");const ProductScreen=require("@point_of_sale/../tests/tours/utils/product_screen_util");const PaymentScreen=require("@point_of_sale/../tests/tours/utils/payment_screen_util");const ReceiptScreen=require("@point_of_sale/../tests/tours/utils/receipt_screen_util");registry.category("web_tour.tours").add("PoSFakeTourSimpleOrder",{steps:()=>[ProductScreen.clickDisplayedProduct("Desk Pad"),ProductScreen.clickPayButton(),PaymentScreen.clickPaymentMethod("Cash"),PaymentScreen.clickValidate(),ReceiptScreen.clickNextOrder(),].flat(),});return __exports;});;

/* /point_of_sale/static/tests/tours/fixed_price_negative_qty_tour.js */
odoo.define('@point_of_sale/../tests/tours/fixed_price_negative_qty_tour',['@point_of_sale/../tests/tours/utils/product_screen_util','@point_of_sale/../tests/tours/utils/payment_screen_util','@point_of_sale/../tests/tours/utils/dialog_util','@point_of_sale/../tests/tours/utils/receipt_screen_util','@web/core/registry','@point_of_sale/../tests/tours/utils/chrome_util','@point_of_sale/../tests/tours/utils/common','@point_of_sale/../tests/tours/utils/numpad_util'],function(require){'use strict';let __exports={};const ProductScreen=require("@point_of_sale/../tests/tours/utils/product_screen_util");const PaymentScreen=require("@point_of_sale/../tests/tours/utils/payment_screen_util");const Dialog=require("@point_of_sale/../tests/tours/utils/dialog_util");const ReceiptScreen=require("@point_of_sale/../tests/tours/utils/receipt_screen_util");const{registry}=require("@web/core/registry");const Chrome=require("@point_of_sale/../tests/tours/utils/chrome_util");const{inLeftSide}=require("@point_of_sale/../tests/tours/utils/common");const Numpad=require("@point_of_sale/../tests/tours/utils/numpad_util");registry.category("web_tour.tours").add("FixedTaxNegativeQty",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),ProductScreen.clickDisplayedProduct("Zero Amount Product",true,"1.0","1.0"),inLeftSide([{...ProductScreen.clickLine("Zero Amount Product","1.0")[0],isActive:["mobile"],},...["+/-"].map(Numpad.click),...ProductScreen.selectedOrderlineHasDirect("Zero Amount Product","-1.0","-1.0"),]),ProductScreen.clickPayButton(),PaymentScreen.clickPaymentMethod("Bank",true,{remaining:"0.00"}),PaymentScreen.clickValidate(),ReceiptScreen.receiptIsThere(),].flat(),});return __exports;});;

/* /point_of_sale/static/tests/tours/generic_tour.js */
odoo.define('@point_of_sale/../tests/tours/generic_tour',['@point_of_sale/../tests/tours/utils/chrome_util','@point_of_sale/../tests/tours/utils/dialog_util','@point_of_sale/../tests/tours/utils/product_screen_util','@point_of_sale/../tests/tours/utils/payment_screen_util','@point_of_sale/../tests/tours/utils/receipt_screen_util','@point_of_sale/../tests/tours/utils/generic_hooks','@web/core/registry'],function(require){'use strict';let __exports={};const Chrome=require("@point_of_sale/../tests/tours/utils/chrome_util");const Dialog=require("@point_of_sale/../tests/tours/utils/dialog_util");const ProductScreen=require("@point_of_sale/../tests/tours/utils/product_screen_util");const PaymentScreen=require("@point_of_sale/../tests/tours/utils/payment_screen_util");const ReceiptScreen=require("@point_of_sale/../tests/tours/utils/receipt_screen_util");const{GenericHooks}=require("@point_of_sale/../tests/tours/utils/generic_hooks");const{registry}=require("@web/core/registry");registry.category("web_tour.tours").add("generic_localization_tour",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),ProductScreen.clickPartnerButton(),ProductScreen.clickCustomer("AAAA Generic Partner"),ProductScreen.clickDisplayedProduct("Whiteboard Pen"),ProductScreen.clickDisplayedProduct("Wall Shelf Unit"),ProductScreen.clickPayButton(),PaymentScreen.clickPaymentMethod("Bank"),PaymentScreen.clickValidate(),GenericHooks.afterValidateHook(),{timeout:20000,content:"receipt screen is shown",trigger:".pos .receipt-screen",},ReceiptScreen.clickNextOrder(),ProductScreen.isShown(),Chrome.endTour(),].flat(),});return __exports;});;

/* /point_of_sale/static/tests/tours/payment_screen_tour.js */
odoo.define('@point_of_sale/../tests/tours/payment_screen_tour',['@point_of_sale/../tests/tours/utils/chrome_util','@point_of_sale/../tests/tours/utils/dialog_util','@point_of_sale/../tests/tours/utils/product_screen_util','@point_of_sale/../tests/tours/utils/payment_screen_util','@web/core/registry'],function(require){'use strict';let __exports={};const Chrome=require("@point_of_sale/../tests/tours/utils/chrome_util");const Dialog=require("@point_of_sale/../tests/tours/utils/dialog_util");const ProductScreen=require("@point_of_sale/../tests/tours/utils/product_screen_util");const PaymentScreen=require("@point_of_sale/../tests/tours/utils/payment_screen_util");const{registry}=require("@web/core/registry");registry.category("web_tour.tours").add("PaymentScreenTour",{steps:()=>[Chrome.startPoS(),ProductScreen.addOrderline("Letter Tray","10"),ProductScreen.clickPayButton(),PaymentScreen.emptyPaymentlines("52.8"),PaymentScreen.clickPaymentMethod("Cash"),PaymentScreen.enterPaymentLineAmount("Cash","11",true,{amount:"11.00",remaining:"41.8",}),PaymentScreen.validateButtonIsHighlighted(false),PaymentScreen.clickNumpad("⌫ ⌫"),PaymentScreen.fillPaymentLineAmountMobile("Cash","0"),PaymentScreen.selectedPaymentlineHas("Cash","0.00"),PaymentScreen.clickPaymentlineDelButton("Cash","0",true),PaymentScreen.emptyPaymentlines("52.8"),PaymentScreen.clickPaymentMethod("Bank",true,{remaining:"0.0"}),PaymentScreen.validateButtonIsHighlighted(true),PaymentScreen.clickPaymentlineDelButton("Bank","52.8"),PaymentScreen.clickPaymentMethod("Cash"),PaymentScreen.clickNumpad("+10"),PaymentScreen.fillPaymentLineAmountMobile("Cash","10"),PaymentScreen.remainingIs("42.8"),PaymentScreen.validateButtonIsHighlighted(false),PaymentScreen.clickNumpad("5"),PaymentScreen.fillPaymentLineAmountMobile("Cash","105"),PaymentScreen.changeIs("52.2"),PaymentScreen.validateButtonIsHighlighted(true),PaymentScreen.clickNumpad("+50"),PaymentScreen.fillPaymentLineAmountMobile("Cash","155"),PaymentScreen.changeIs("102.2"),PaymentScreen.validateButtonIsHighlighted(true),PaymentScreen.clickPaymentlineDelButton("Cash","155.0"),PaymentScreen.clickPaymentMethod("Cash"),PaymentScreen.clickNumpad("1"),PaymentScreen.fillPaymentLineAmountMobile("Cash","1"),PaymentScreen.remainingIs("51.8"),PaymentScreen.validateButtonIsHighlighted(false),PaymentScreen.clickPaymentMethod("Bank"),PaymentScreen.fillPaymentLineAmountMobile("Bank","5"),PaymentScreen.clickNumpad("5"),PaymentScreen.remainingIs("46.8"),PaymentScreen.validateButtonIsHighlighted(false),PaymentScreen.clickPaymentMethod("Bank",true,{remaining:"0.0"}),PaymentScreen.validateButtonIsHighlighted(true),].flat(),});registry.category("web_tour.tours").add("PaymentScreenTour2",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),ProductScreen.addOrderline("Letter Tray","1","10"),ProductScreen.clickPayButton(),{trigger:".payment-buttons button:contains('Ship Later')"},PaymentScreen.enterPaymentLineAmount("Bank","99"),Dialog.confirm(),PaymentScreen.remainingIs("0.0"),].flat(),});registry.category("web_tour.tours").add("PaymentScreenRoundingUp",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),ProductScreen.addOrderline("Product Test","1"),ProductScreen.clickPayButton(),PaymentScreen.totalIs("1.96"),PaymentScreen.clickPaymentMethod("Cash",true,{remaining:"0.0",amount:"2.00"}),Chrome.clickMenuOption("Orders"),Chrome.createFloatingOrder(),ProductScreen.addOrderline("Product Test","-"),ProductScreen.clickPayButton(),PaymentScreen.totalIs("-1.96"),PaymentScreen.clickPaymentMethod("Cash",true,{remaining:"0.0",amount:"-2.00"}),].flat(),});registry.category("web_tour.tours").add("PaymentScreenRoundingDown",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),ProductScreen.addOrderline("Product Test","1"),ProductScreen.clickPayButton(),PaymentScreen.totalIs("1.98"),PaymentScreen.clickPaymentMethod("Cash",true,{remaining:"0.0",amount:"1.95"}),Chrome.clickMenuOption("Orders"),Chrome.createFloatingOrder(),ProductScreen.addOrderline("Product Test","-"),ProductScreen.clickPayButton(),PaymentScreen.totalIs("-1.98"),PaymentScreen.clickPaymentMethod("Cash",true,{remaining:"0.0",amount:"-1.95"}),].flat(),});registry.category("web_tour.tours").add("PaymentScreenRoundingHalfUp",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),ProductScreen.addOrderline("Product Test 1.20","1"),ProductScreen.clickPayButton(),PaymentScreen.totalIs("1.20"),PaymentScreen.clickPaymentMethod("Cash",true,{remaining:"0.0",amount:"1.00"}),Chrome.clickMenuOption("Orders"),Chrome.createFloatingOrder(),ProductScreen.addOrderline("Product Test 1.25","1"),ProductScreen.clickPayButton(),PaymentScreen.totalIs("1.25"),PaymentScreen.clickPaymentMethod("Cash",true,{remaining:"0.0",amount:"1.50"}),Chrome.clickMenuOption("Orders"),Chrome.createFloatingOrder(),ProductScreen.addOrderline("Product Test 1.4","1"),ProductScreen.clickPayButton(),PaymentScreen.totalIs("1.4"),PaymentScreen.clickPaymentMethod("Cash",true,{remaining:"0.0",amount:"1.50"}),Chrome.clickMenuOption("Orders"),Chrome.createFloatingOrder(),ProductScreen.addOrderline("Product Test 1.20","1"),ProductScreen.clickPayButton(),PaymentScreen.totalIs("1.20"),PaymentScreen.clickPaymentMethod("Cash"),PaymentScreen.clickNumpad("2"),PaymentScreen.fillPaymentLineAmountMobile("Cash","2"),PaymentScreen.changeIs("1.0"),].flat(),});registry.category("web_tour.tours").add("PaymentScreenTotalDueWithOverPayment",{steps:()=>[Chrome.startPoS(),ProductScreen.addOrderline("Product Test","1"),ProductScreen.clickPayButton(),PaymentScreen.totalIs("1.98"),PaymentScreen.clickPaymentMethod("Cash"),PaymentScreen.enterPaymentLineAmount("Cash","5",true,{change:"3.05",}),].flat(),});registry.category("web_tour.tours").add("InvoiceShipLaterAccessRight",{steps:()=>[Chrome.startPoS(),ProductScreen.confirmOpeningPopup(),ProductScreen.clickHomeCategory(),ProductScreen.addOrderline("Whiteboard Pen","1"),ProductScreen.clickPartnerButton(),ProductScreen.clickCustomer("Acme Corporation"),ProductScreen.clickPayButton(),PaymentScreen.clickPaymentMethod("Cash"),PaymentScreen.clickShipLaterButton(),PaymentScreen.clickValidate(),].flat(),});registry.category("web_tour.tours").add("CashRoundingPayment",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),ProductScreen.addOrderline("Magnetic Board","1"),ProductScreen.clickPayButton(),PaymentScreen.totalIs("1.98"),PaymentScreen.clickPaymentMethod("Cash"),PaymentScreen.enterPaymentLineAmount("Cash","1.98"),PaymentScreen.clickValidate(),Dialog.is(),].flat(),});registry.category("web_tour.tours").add("PaymentScreenInvoiceOrder",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),ProductScreen.addOrderline("Product Test","1"),ProductScreen.clickPartnerButton(),ProductScreen.clickCustomer("Partner Test 1"),ProductScreen.clickPayButton(),PaymentScreen.clickPaymentMethod("Bank"),PaymentScreen.clickInvoiceButton(),PaymentScreen.clickValidate(),].flat(),});return __exports;});;

/* /point_of_sale/static/tests/tours/pos_cash_rounding_tour.js */
odoo.define('@point_of_sale/../tests/tours/pos_cash_rounding_tour',['@point_of_sale/../tests/tours/utils/chrome_util','@point_of_sale/../tests/tours/utils/dialog_util','@point_of_sale/../tests/tours/utils/product_screen_util','@point_of_sale/../tests/tours/utils/payment_screen_util','@point_of_sale/../tests/tours/utils/receipt_screen_util','@point_of_sale/../tests/tours/utils/ticket_screen_util','@web/core/registry'],function(require){'use strict';let __exports={};const Chrome=require("@point_of_sale/../tests/tours/utils/chrome_util");const Dialog=require("@point_of_sale/../tests/tours/utils/dialog_util");const ProductScreen=require("@point_of_sale/../tests/tours/utils/product_screen_util");const PaymentScreen=require("@point_of_sale/../tests/tours/utils/payment_screen_util");const ReceiptScreen=require("@point_of_sale/../tests/tours/utils/receipt_screen_util");const TicketScreen=require("@point_of_sale/../tests/tours/utils/ticket_screen_util");const{registry}=require("@web/core/registry");registry.category("web_tour.tours").add("test_cash_rounding_halfup_add_invoice_line_not_only_round_cash_method",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),ProductScreen.addOrderline("random_product","1"),ProductScreen.clickPartnerButton(),ProductScreen.clickCustomer("AAAAAA"),ProductScreen.clickPayButton(),PaymentScreen.totalIs("15.72"),PaymentScreen.clickPaymentMethod("Cash"),PaymentScreen.remainingIs("0.0"),PaymentScreen.clickInvoiceButton(),PaymentScreen.clickValidate(),ReceiptScreen.receiptAmountTotalIs("15.72"),ReceiptScreen.receiptRoundingAmountIs("-0.02"),ReceiptScreen.receiptToPayAmountIs("15.70"),ReceiptScreen.receiptChangeAmountIsNotThere(),ReceiptScreen.clickNextOrder(),Chrome.clickMenuOption("Orders"),TicketScreen.selectFilter("All active orders"),TicketScreen.selectFilter("Paid"),TicketScreen.selectOrder("-0001"),TicketScreen.confirmRefund(),ProductScreen.clickPayButton(),PaymentScreen.totalIs("-15.72"),PaymentScreen.clickPaymentMethod("Cash"),PaymentScreen.remainingIs("0.0"),PaymentScreen.clickInvoiceButton(),PaymentScreen.clickValidate(),ReceiptScreen.receiptAmountTotalIs("-15.72"),ReceiptScreen.receiptRoundingAmountIs("0.02"),ReceiptScreen.receiptToPayAmountIs("-15.70"),ReceiptScreen.receiptChangeAmountIsNotThere(),ReceiptScreen.clickNextOrder(),].flat(),});registry.category("web_tour.tours").add("test_cash_rounding_halfup_add_invoice_line_not_only_round_cash_method_pay_by_bank_and_cash",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),ProductScreen.addOrderline("random_product","1"),ProductScreen.clickPartnerButton(),ProductScreen.clickCustomer("AAAAAA"),ProductScreen.clickPayButton(),PaymentScreen.totalIs("15.72"),PaymentScreen.clickPaymentMethod("Bank"),PaymentScreen.clickNumpad(". 6 8"),PaymentScreen.fillPaymentLineAmountMobile("Bank","0.68"),PaymentScreen.remainingIs("15.04"),PaymentScreen.clickPaymentMethod("Cash"),PaymentScreen.remainingIs("0.0"),PaymentScreen.clickInvoiceButton(),PaymentScreen.clickValidate(),ReceiptScreen.receiptAmountTotalIs("15.72"),ReceiptScreen.receiptRoundingAmountIs("0.01"),ReceiptScreen.receiptToPayAmountIs("15.73"),ReceiptScreen.receiptChangeAmountIsNotThere(),ReceiptScreen.clickNextOrder(),Chrome.clickMenuOption("Orders"),TicketScreen.selectFilter("All active orders"),TicketScreen.selectFilter("Paid"),TicketScreen.selectOrder("-0001"),TicketScreen.confirmRefund(),ProductScreen.clickPayButton(),PaymentScreen.totalIs("-15.72"),PaymentScreen.clickPaymentMethod("Bank"),PaymentScreen.clickNumpad(". 6 8 +/-"),PaymentScreen.fillPaymentLineAmountMobile("Bank","-0.68"),PaymentScreen.remainingIs("-15.04"),PaymentScreen.clickPaymentMethod("Cash"),PaymentScreen.remainingIs("0.0"),PaymentScreen.clickInvoiceButton(),PaymentScreen.clickValidate(),ReceiptScreen.receiptAmountTotalIs("-15.72"),ReceiptScreen.receiptRoundingAmountIs("-0.01"),ReceiptScreen.receiptToPayAmountIs("-15.73"),ReceiptScreen.receiptChangeAmountIsNotThere(),ReceiptScreen.clickNextOrder(),].flat(),});registry.category("web_tour.tours").add("test_cash_rounding_down_add_invoice_line_not_only_round_cash_method_no_rounding_left",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),ProductScreen.addOrderline("random_product","1"),ProductScreen.clickPartnerButton(),ProductScreen.clickCustomer("AAAAAA"),ProductScreen.clickPayButton(),PaymentScreen.totalIs("15.72"),PaymentScreen.clickPaymentMethod("Bank"),PaymentScreen.clickNumpad(". 6 7"),PaymentScreen.fillPaymentLineAmountMobile("Bank","0.67"),PaymentScreen.remainingIs("15.05"),PaymentScreen.clickPaymentMethod("Cash"),PaymentScreen.remainingIs("0.0"),PaymentScreen.clickInvoiceButton(),PaymentScreen.clickValidate(),ReceiptScreen.receiptAmountTotalIs("15.72"),ReceiptScreen.receiptRoundingAmountIsNotThere(),ReceiptScreen.receiptToPayAmountIsNotThere(),ReceiptScreen.receiptChangeAmountIsNotThere(),ReceiptScreen.clickNextOrder(),Chrome.clickMenuOption("Orders"),TicketScreen.selectFilter("All active orders"),TicketScreen.selectFilter("Paid"),TicketScreen.selectOrder("-0001"),TicketScreen.confirmRefund(),ProductScreen.clickPayButton(),PaymentScreen.totalIs("-15.72"),PaymentScreen.clickPaymentMethod("Bank"),PaymentScreen.clickNumpad("+/- . 6 7"),PaymentScreen.fillPaymentLineAmountMobile("Bank","-0.67"),PaymentScreen.remainingIs("-15.05"),PaymentScreen.clickPaymentMethod("Cash"),PaymentScreen.remainingIs("0.0"),PaymentScreen.clickInvoiceButton(),PaymentScreen.clickValidate(),ReceiptScreen.receiptAmountTotalIs("-15.72"),ReceiptScreen.receiptRoundingAmountIsNotThere(),ReceiptScreen.receiptToPayAmountIsNotThere(),ReceiptScreen.receiptChangeAmountIsNotThere(),ReceiptScreen.clickNextOrder(),].flat(),});registry.category("web_tour.tours").add("test_cash_rounding_down_add_invoice_line_not_only_round_cash_method_with_residual_rounding",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),ProductScreen.addOrderline("random_product","1"),ProductScreen.clickPartnerButton(),ProductScreen.clickCustomer("AAAAAA"),ProductScreen.clickPayButton(),PaymentScreen.totalIs("15.72"),PaymentScreen.clickPaymentMethod("Bank"),PaymentScreen.clickNumpad(". 6 8"),PaymentScreen.fillPaymentLineAmountMobile("Bank","0.68"),PaymentScreen.remainingIs("15.04"),PaymentScreen.clickPaymentMethod("Cash"),PaymentScreen.remainingIs("0.0"),PaymentScreen.clickInvoiceButton(),PaymentScreen.clickValidate(),ReceiptScreen.receiptAmountTotalIs("15.72"),ReceiptScreen.receiptRoundingAmountIs("-0.04"),ReceiptScreen.receiptToPayAmountIs("15.68"),ReceiptScreen.receiptChangeAmountIsNotThere(),ReceiptScreen.clickNextOrder(),Chrome.clickMenuOption("Orders"),TicketScreen.selectFilter("All active orders"),TicketScreen.selectFilter("Paid"),TicketScreen.selectOrder("-0001"),TicketScreen.confirmRefund(),ProductScreen.clickPayButton(),PaymentScreen.totalIs("-15.72"),PaymentScreen.clickPaymentMethod("Bank"),PaymentScreen.clickNumpad("+/- . 6 8"),PaymentScreen.fillPaymentLineAmountMobile("Bank","-0.68"),PaymentScreen.remainingIs("-15.04"),PaymentScreen.clickPaymentMethod("Cash"),PaymentScreen.remainingIs("0.0"),PaymentScreen.clickInvoiceButton(),PaymentScreen.clickValidate(),ReceiptScreen.receiptAmountTotalIs("-15.72"),ReceiptScreen.receiptRoundingAmountIs("0.04"),ReceiptScreen.receiptToPayAmountIs("-15.68"),ReceiptScreen.receiptChangeAmountIsNotThere(),ReceiptScreen.clickNextOrder(),].flat(),});registry.category("web_tour.tours").add("test_cash_rounding_up_add_invoice_line_not_only_round_cash_method",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),ProductScreen.addOrderline("random_product","1"),ProductScreen.clickPartnerButton(),ProductScreen.clickCustomer("AAAAAA"),ProductScreen.clickPayButton(),PaymentScreen.totalIs("15.72"),PaymentScreen.clickPaymentMethod("Bank"),PaymentScreen.clickNumpad(". 6 4"),PaymentScreen.fillPaymentLineAmountMobile("Bank","0.64"),PaymentScreen.remainingIs("15.08"),PaymentScreen.clickPaymentMethod("Cash"),PaymentScreen.remainingIs("0.0"),PaymentScreen.clickInvoiceButton(),PaymentScreen.clickValidate(),ReceiptScreen.receiptAmountTotalIs("15.72"),ReceiptScreen.receiptRoundingAmountIs("0.02"),ReceiptScreen.receiptToPayAmountIs("15.74"),ReceiptScreen.receiptChangeAmountIsNotThere(),ReceiptScreen.clickNextOrder(),Chrome.clickMenuOption("Orders"),TicketScreen.selectFilter("All active orders"),TicketScreen.selectFilter("Paid"),TicketScreen.selectOrder("-0001"),TicketScreen.confirmRefund(),ProductScreen.clickPayButton(),PaymentScreen.totalIs("-15.72"),PaymentScreen.clickPaymentMethod("Bank"),PaymentScreen.clickNumpad("+/- . 6 4"),PaymentScreen.fillPaymentLineAmountMobile("Bank","-0.64"),PaymentScreen.remainingIs("-15.08"),PaymentScreen.clickPaymentMethod("Cash"),PaymentScreen.remainingIs("0.0"),PaymentScreen.clickInvoiceButton(),PaymentScreen.clickValidate(),ReceiptScreen.receiptAmountTotalIs("-15.72"),ReceiptScreen.receiptRoundingAmountIs("-0.02"),ReceiptScreen.receiptToPayAmountIs("-15.74"),ReceiptScreen.receiptChangeAmountIsNotThere(),ReceiptScreen.clickNextOrder(),].flat(),});registry.category("web_tour.tours").add("test_cash_rounding_halfup_add_invoice_line_only_round_cash_method",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),ProductScreen.addOrderline("random_product","1"),ProductScreen.clickPartnerButton(),ProductScreen.clickCustomer("AAAAAA"),ProductScreen.clickPayButton(),PaymentScreen.totalIs("15.72"),PaymentScreen.clickPaymentMethod("Cash"),PaymentScreen.remainingIs("0.0"),PaymentScreen.clickInvoiceButton(),PaymentScreen.clickValidate(),ReceiptScreen.receiptAmountTotalIs("15.72"),ReceiptScreen.receiptRoundingAmountIs("-0.02"),ReceiptScreen.receiptToPayAmountIs("15.70"),ReceiptScreen.receiptChangeAmountIsNotThere(),ReceiptScreen.clickNextOrder(),Chrome.clickMenuOption("Orders"),TicketScreen.selectFilter("All active orders"),TicketScreen.selectFilter("Paid"),TicketScreen.selectOrder("-0001"),TicketScreen.confirmRefund(),ProductScreen.clickPayButton(),PaymentScreen.totalIs("-15.72"),PaymentScreen.clickPaymentMethod("Cash"),PaymentScreen.remainingIs("0.0"),PaymentScreen.clickInvoiceButton(),PaymentScreen.clickValidate(),ReceiptScreen.receiptAmountTotalIs("-15.72"),ReceiptScreen.receiptRoundingAmountIs("0.02"),ReceiptScreen.receiptToPayAmountIs("-15.70"),ReceiptScreen.receiptChangeAmountIsNotThere(),ReceiptScreen.clickNextOrder(),].flat(),});registry.category("web_tour.tours").add("test_cash_rounding_halfup_add_invoice_line_only_round_cash_method_pay_by_bank_and_cash",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),ProductScreen.addOrderline("random_product","1"),ProductScreen.clickPartnerButton(),ProductScreen.clickCustomer("AAAAAA"),ProductScreen.clickPayButton(),PaymentScreen.totalIs("15.72"),PaymentScreen.clickPaymentMethod("Bank"),PaymentScreen.clickNumpad(". 6 8"),PaymentScreen.fillPaymentLineAmountMobile("Bank","0.68"),PaymentScreen.remainingIs("15.04"),PaymentScreen.clickPaymentMethod("Cash"),PaymentScreen.remainingIs("0.0"),PaymentScreen.clickInvoiceButton(),PaymentScreen.clickValidate(),ReceiptScreen.receiptAmountTotalIs("15.72"),ReceiptScreen.receiptRoundingAmountIs("0.01"),ReceiptScreen.receiptToPayAmountIs("15.73"),ReceiptScreen.receiptChangeAmountIsNotThere(),ReceiptScreen.clickNextOrder(),Chrome.clickMenuOption("Orders"),TicketScreen.selectFilter("All active orders"),TicketScreen.selectFilter("Paid"),TicketScreen.selectOrder("-0001"),TicketScreen.confirmRefund(),ProductScreen.clickPayButton(),PaymentScreen.totalIs("-15.72"),PaymentScreen.clickPaymentMethod("Bank"),PaymentScreen.clickNumpad("+/- . 6 8"),PaymentScreen.fillPaymentLineAmountMobile("Bank","-0.68"),PaymentScreen.remainingIs("-15.04"),PaymentScreen.clickPaymentMethod("Cash"),PaymentScreen.remainingIs("0.0"),PaymentScreen.clickInvoiceButton(),PaymentScreen.clickValidate(),ReceiptScreen.receiptAmountTotalIs("-15.72"),ReceiptScreen.receiptRoundingAmountIs("-0.01"),ReceiptScreen.receiptToPayAmountIs("-15.73"),ReceiptScreen.receiptChangeAmountIsNotThere(),ReceiptScreen.clickNextOrder(),].flat(),});registry.category("web_tour.tours").add("test_cash_rounding_halfup_biggest_tax_not_only_round_cash_method",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),ProductScreen.addOrderline("random_product","1"),ProductScreen.clickPartnerButton(),ProductScreen.clickCustomer("AAAAAA"),ProductScreen.clickPayButton(),PaymentScreen.totalIs("15.70"),PaymentScreen.clickPaymentMethod("Cash"),PaymentScreen.remainingIs("0.0"),PaymentScreen.clickInvoiceButton(),PaymentScreen.clickValidate(),ReceiptScreen.receiptAmountTotalIs("15.70"),ReceiptScreen.receiptToPayAmountIsNotThere(),ReceiptScreen.receiptChangeAmountIsNotThere(),ReceiptScreen.clickNextOrder(),Chrome.clickMenuOption("Orders"),TicketScreen.selectFilter("All active orders"),TicketScreen.selectFilter("Paid"),TicketScreen.selectOrder("-0001"),TicketScreen.confirmRefund(),ProductScreen.clickPayButton(),PaymentScreen.totalIs("-15.70"),PaymentScreen.clickPaymentMethod("Cash"),PaymentScreen.remainingIs("0.0"),PaymentScreen.clickInvoiceButton(),PaymentScreen.clickValidate(),ReceiptScreen.receiptAmountTotalIs("-15.70"),ReceiptScreen.receiptToPayAmountIsNotThere(),ReceiptScreen.receiptChangeAmountIsNotThere(),ReceiptScreen.clickNextOrder(),].flat(),});registry.category("web_tour.tours").add("test_cash_rounding_halfup_biggest_tax_not_only_round_cash_method_pay_by_bank_and_cash",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),ProductScreen.addOrderline("random_product","1"),ProductScreen.clickPartnerButton(),ProductScreen.clickCustomer("AAAAAA"),ProductScreen.clickPayButton(),PaymentScreen.totalIs("15.70"),PaymentScreen.clickPaymentMethod("Bank"),PaymentScreen.clickNumpad(". 6 7"),PaymentScreen.fillPaymentLineAmountMobile("Bank","0.67"),PaymentScreen.remainingIs("15.03"),PaymentScreen.clickPaymentMethod("Cash"),PaymentScreen.remainingIs("0.0"),PaymentScreen.clickInvoiceButton(),PaymentScreen.clickValidate(),ReceiptScreen.receiptAmountTotalIs("15.70"),ReceiptScreen.receiptRoundingAmountIs("0.02"),ReceiptScreen.receiptToPayAmountIs("15.72"),ReceiptScreen.receiptChangeAmountIsNotThere(),ReceiptScreen.clickNextOrder(),Chrome.clickMenuOption("Orders"),TicketScreen.selectFilter("All active orders"),TicketScreen.selectFilter("Paid"),TicketScreen.selectOrder("-0001"),TicketScreen.confirmRefund(),ProductScreen.clickPayButton(),PaymentScreen.totalIs("-15.70"),PaymentScreen.clickPaymentMethod("Bank"),PaymentScreen.clickNumpad("+/- . 6 7"),PaymentScreen.fillPaymentLineAmountMobile("Bank","-0.67"),PaymentScreen.remainingIs("-15.03"),PaymentScreen.clickPaymentMethod("Cash"),PaymentScreen.remainingIs("0.0"),PaymentScreen.clickInvoiceButton(),PaymentScreen.clickValidate(),ReceiptScreen.receiptAmountTotalIs("-15.70"),ReceiptScreen.receiptRoundingAmountIs("-0.02"),ReceiptScreen.receiptToPayAmountIs("-15.72"),ReceiptScreen.receiptChangeAmountIsNotThere(),ReceiptScreen.clickNextOrder(),].flat(),});registry.category("web_tour.tours").add("test_cash_rounding_halfup_biggest_tax_only_round_cash_method",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),ProductScreen.addOrderline("random_product","1"),ProductScreen.clickPartnerButton(),ProductScreen.clickCustomer("AAAAAA"),ProductScreen.clickPayButton(),PaymentScreen.totalIs("15.72"),PaymentScreen.clickPaymentMethod("Cash"),PaymentScreen.remainingIs("0.0"),PaymentScreen.clickInvoiceButton(),PaymentScreen.clickValidate(),ReceiptScreen.receiptAmountTotalIs("15.72"),ReceiptScreen.receiptRoundingAmountIs("-0.02"),ReceiptScreen.receiptToPayAmountIs("15.70"),ReceiptScreen.receiptChangeAmountIsNotThere(),ReceiptScreen.clickNextOrder(),Chrome.clickMenuOption("Orders"),TicketScreen.selectFilter("All active orders"),TicketScreen.selectFilter("Paid"),TicketScreen.selectOrder("-0001"),TicketScreen.confirmRefund(),ProductScreen.clickPayButton(),PaymentScreen.totalIs("-15.72"),PaymentScreen.clickPaymentMethod("Cash"),PaymentScreen.remainingIs("0.0"),PaymentScreen.clickInvoiceButton(),PaymentScreen.clickValidate(),ReceiptScreen.receiptAmountTotalIs("-15.72"),ReceiptScreen.receiptRoundingAmountIs("0.02"),ReceiptScreen.receiptToPayAmountIs("-15.70"),ReceiptScreen.receiptChangeAmountIsNotThere(),ReceiptScreen.clickNextOrder(),].flat(),});registry.category("web_tour.tours").add("test_cash_rounding_halfup_biggest_tax_only_round_cash_method_pay_by_bank_and_cash",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),ProductScreen.addOrderline("random_product","1"),ProductScreen.clickPartnerButton(),ProductScreen.clickCustomer("AAAAAA"),ProductScreen.clickPayButton(),PaymentScreen.totalIs("15.72"),PaymentScreen.clickPaymentMethod("Bank"),PaymentScreen.clickNumpad(". 6 8"),PaymentScreen.fillPaymentLineAmountMobile("Bank","0.68"),PaymentScreen.remainingIs("15.04"),PaymentScreen.clickPaymentMethod("Cash"),PaymentScreen.remainingIs("0.0"),PaymentScreen.clickInvoiceButton(),PaymentScreen.clickValidate(),ReceiptScreen.receiptAmountTotalIs("15.72"),ReceiptScreen.receiptRoundingAmountIs("0.01"),ReceiptScreen.receiptToPayAmountIs("15.73"),ReceiptScreen.receiptChangeAmountIsNotThere(),ReceiptScreen.clickNextOrder(),Chrome.clickMenuOption("Orders"),TicketScreen.selectFilter("All active orders"),TicketScreen.selectFilter("Paid"),TicketScreen.selectOrder("-0001"),TicketScreen.confirmRefund(),ProductScreen.clickPayButton(),PaymentScreen.totalIs("-15.72"),PaymentScreen.clickPaymentMethod("Bank"),PaymentScreen.clickNumpad("+/- . 6 8"),PaymentScreen.fillPaymentLineAmountMobile("Bank","-0.68"),PaymentScreen.remainingIs("-15.04"),PaymentScreen.clickPaymentMethod("Cash"),PaymentScreen.remainingIs("0.0"),PaymentScreen.clickInvoiceButton(),PaymentScreen.clickValidate(),ReceiptScreen.receiptAmountTotalIs("-15.72"),ReceiptScreen.receiptRoundingAmountIs("-0.01"),ReceiptScreen.receiptToPayAmountIs("-15.73"),ReceiptScreen.receiptChangeAmountIsNotThere(),ReceiptScreen.clickNextOrder(),].flat(),});registry.category("web_tour.tours").add("test_cash_rounding_with_change",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),ProductScreen.addOrderline("random_product","1"),ProductScreen.clickPartnerButton(),ProductScreen.clickCustomer("AAAAAA"),ProductScreen.clickPayButton(),PaymentScreen.totalIs("15.72"),PaymentScreen.clickPaymentMethod("Bank"),PaymentScreen.clickNumpad("2 0"),PaymentScreen.fillPaymentLineAmountMobile("Bank","20.00"),PaymentScreen.changeIs("4.30"),PaymentScreen.clickInvoiceButton(),PaymentScreen.clickValidate(),ReceiptScreen.receiptAmountTotalIs("15.72"),ReceiptScreen.receiptRoundingAmountIs("-0.02"),ReceiptScreen.receiptToPayAmountIs("15.70"),ReceiptScreen.receiptChangeAmountIs("4.30"),ReceiptScreen.clickNextOrder(),].flat(),});registry.category("web_tour.tours").add("test_cash_rounding_up_with_change",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),ProductScreen.addOrderline("product_a","1"),ProductScreen.addOrderline("product_b","2"),ProductScreen.clickPayButton(),PaymentScreen.totalIs("179"),PaymentScreen.clickPaymentMethod("Cash"),PaymentScreen.clickNumpad("2 0 0"),PaymentScreen.changeIs("21"),].flat(),});registry.category("web_tour.tours").add("test_cash_rounding_only_cash_method_with_change",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),ProductScreen.addOrderline("random_product","1"),ProductScreen.clickPartnerButton(),ProductScreen.clickCustomer("AAAAAA"),ProductScreen.clickPayButton(),PaymentScreen.totalIs("15.72"),PaymentScreen.clickPaymentMethod("Cash"),PaymentScreen.clickNumpad("+20"),PaymentScreen.fillPaymentLineAmountMobile("Cash","20.00"),PaymentScreen.changeIs("4.30"),PaymentScreen.clickInvoiceButton(),PaymentScreen.clickValidate(),ReceiptScreen.receiptAmountTotalIs("15.72"),ReceiptScreen.receiptRoundingAmountIs("-0.02"),ReceiptScreen.receiptToPayAmountIs("15.70"),ReceiptScreen.receiptChangeAmountIs("4.30"),ReceiptScreen.clickNextOrder(),].flat(),});return __exports;});;

/* /point_of_sale/static/tests/tours/pos_combo_tour.js */
odoo.define('@point_of_sale/../tests/tours/pos_combo_tour',['@point_of_sale/../tests/tours/utils/product_screen_util','@point_of_sale/../tests/tours/utils/payment_screen_util','@point_of_sale/../tests/tours/utils/receipt_screen_util','@point_of_sale/../tests/tours/utils/combo_popup_util','@point_of_sale/../tests/tours/utils/dialog_util','@point_of_sale/../tests/tours/utils/generic_components/order_widget_util','@point_of_sale/../tests/tours/utils/common','@point_of_sale/../tests/tours/utils/chrome_util','@web/core/registry','@point_of_sale/../tests/tours/utils/numpad_util'],function(require){'use strict';let __exports={};const ProductScreen=require("@point_of_sale/../tests/tours/utils/product_screen_util");const PaymentScreen=require("@point_of_sale/../tests/tours/utils/payment_screen_util");const ReceiptScreen=require("@point_of_sale/../tests/tours/utils/receipt_screen_util");const combo=require("@point_of_sale/../tests/tours/utils/combo_popup_util");const Dialog=require("@point_of_sale/../tests/tours/utils/dialog_util");const Order=require("@point_of_sale/../tests/tours/utils/generic_components/order_widget_util");const{inLeftSide,scan_barcode}=require("@point_of_sale/../tests/tours/utils/common");const Chrome=require("@point_of_sale/../tests/tours/utils/chrome_util");const{registry}=require("@web/core/registry");const Numpad=require("@point_of_sale/../tests/tours/utils/numpad_util");registry.category("web_tour.tours").add("ProductComboPriceTaxIncludedTour",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),scan_barcode("SuperCombo"),combo.isNotPresent("Combo Product 1 (archived)"),combo.select("Combo Product 3"),combo.isConfirmationButtonDisabled(),combo.select("Combo Product 9"),Dialog.is("Attribute selection"),Dialog.discard(),combo.select("Combo Product 5"),combo.select("Combo Product 7"),combo.isSelected("Combo Product 7"),combo.select("Combo Product 8"),combo.isSelected("Combo Product 8"),combo.isNotSelected("Combo Product 7"),Dialog.confirm(),inLeftSide([...ProductScreen.selectedOrderlineHasDirect("Office Combo"),...ProductScreen.clickLine("Combo Product 3"),...ProductScreen.selectedOrderlineHasDirect("Combo Product 3","1.0","13.43"),...ProductScreen.clickLine("Combo Product 5"),...ProductScreen.selectedOrderlineHasDirect("Combo Product 5","1.0","18.67"),...ProductScreen.clickLine("Combo Product 8"),...ProductScreen.selectedOrderlineHasDirect("Combo Product 8","1.0","30.00"),]),...ProductScreen.clickPartnerButton(),...ProductScreen.clickCustomer("Partner Test 1"),inLeftSide([...ProductScreen.clickLine("Combo Product 3"),Numpad.click("2"),...ProductScreen.selectedOrderlineHasDirect("Combo Product 3","2.0","26.86"),...ProductScreen.orderLineHas("Combo Product 5","2.0"),...ProductScreen.orderLineHas("Combo Product 8","2.0","60.00"),]),inLeftSide([{...ProductScreen.clickLine("Combo Product 3","2.0")[0],isActive:["mobile"],},Numpad.click("⌫"),Numpad.click("⌫"),...Order.doesNotHaveLine(),]),...ProductScreen.clickDisplayedProduct("Office Combo"),combo.select("Combo Product 3"),combo.select("Combo Product 5"),combo.select("Combo Product 8"),Dialog.confirm(),...ProductScreen.totalAmountIs("62.10"),...ProductScreen.clickPayButton(),...PaymentScreen.clickPaymentMethod("Bank"),...PaymentScreen.clickValidate(),...ReceiptScreen.isShown(),...ReceiptScreen.clickNextOrder(),...ProductScreen.clickDisplayedProduct("Office Combo"),combo.select("Combo Product 2"),combo.select("Combo Product 4"),combo.select("Combo Product 6"),Dialog.confirm(),...ProductScreen.totalAmountIs("59.17"),...inLeftSide(Order.hasTax("10.56")),].flat(),});registry.category("web_tour.tours").add("ProductComboPriceCheckTour",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),ProductScreen.clickDisplayedProduct("Desk Combo"),inLeftSide([...ProductScreen.selectedOrderlineHasDirect("Desk Combo"),...ProductScreen.orderLineHas("Desk Organizer","1.0","4.45"),...ProductScreen.orderLineHas("Desk Pad","1.0","1.59"),...ProductScreen.orderLineHas("Whiteboard Pen","1.0","0.96"),]),ProductScreen.totalAmountIs("7.00"),ProductScreen.clickPayButton(),PaymentScreen.clickPaymentMethod("Bank"),PaymentScreen.clickValidate(),ReceiptScreen.isShown(),].flat(),});registry.category("web_tour.tours").add("ProductComboChangeFP",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),ProductScreen.clickDisplayedProduct("Office Combo"),ProductScreen.checkProductExtraPrice("Combo Product 3","2"),combo.select("Combo Product 2"),combo.select("Combo Product 4"),combo.select("Combo Product 6"),Dialog.confirm(),inLeftSide([...ProductScreen.orderLineHas("Combo Product 2","1.0","8.33"),...ProductScreen.orderLineHas("Combo Product 4","1.0","16.67"),...ProductScreen.orderLineHas("Combo Product 6","1.0","25.00"),]),ProductScreen.totalAmountIs("50.00"),inLeftSide(Order.hasTax("4.55")),ProductScreen.clickFiscalPosition("test fp"),inLeftSide([...ProductScreen.orderLineHas("Combo Product 4","1.0","16.67"),...ProductScreen.orderLineHas("Combo Product 6","1.0","25.00"),...ProductScreen.orderLineHas("Combo Product 2","1.0","8.33"),]),ProductScreen.totalAmountIs("50.00"),inLeftSide(Order.hasTax("2.38")),ProductScreen.isShown(),].flat(),});registry.category("web_tour.tours").add("ProductComboChangePricelist",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),ProductScreen.clickDisplayedProduct("Office Combo"),combo.select("Combo Product 2"),combo.select("Combo Product 4"),combo.select("Combo Product 6"),Dialog.confirm(),inLeftSide([...ProductScreen.orderLineHas("Combo Product 2","1.0","6.67"),...ProductScreen.orderLineHas("Combo Product 4","1.0","14.66"),...ProductScreen.orderLineHas("Combo Product 6","1.0","26.00"),]),ProductScreen.totalAmountIs("47.33"),ProductScreen.clickPriceList("sale 10%"),inLeftSide([...ProductScreen.orderLineHas("Combo Product 2","1.0","6.00"),...ProductScreen.orderLineHas("Combo Product 4","1.0","13.20"),...ProductScreen.orderLineHas("Combo Product 6","1.0","23.40"),]),ProductScreen.totalAmountIs("42.60"),ProductScreen.isShown(),].flat(),});registry.category("web_tour.tours").add("test_combo_disallowLineQuantityChange",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),{content:"replace disallowLineQuantityChange to be true",trigger:"body",run:()=>{posmodel.disallowLineQuantityChange=()=>true;},},ProductScreen.clickDisplayedProduct("Office Combo"),combo.select("Combo Product 2"),combo.select("Combo Product 4"),combo.select("Combo Product 6"),Dialog.confirm(),inLeftSide([Numpad.click("⌫"),{content:"Click 0",trigger:".modal-content div.numpad button:not(:contains('+')):contains('0')",run:"click",},Chrome.confirmPopup(),Order.doesNotHaveLine(),].flat()),].flat(),});registry.category("web_tour.tours").add("test_combo_disallowLineQuantityChange_2",{steps:()=>[Chrome.startPoS(),{content:"replace disallowLineQuantityChange to be true",trigger:"body",run:()=>{posmodel.disallowLineQuantityChange=()=>true;},},ProductScreen.clickDisplayedProduct("Office Combo"),combo.select("Combo Product 2"),combo.select("Combo Product 4"),combo.select("Combo Product 6"),Dialog.confirm(),inLeftSide([Numpad.click("2"),{content:"Click 2",trigger:".modal-content div.numpad button:not(:contains('+')):contains('2')",run:"click",},Chrome.confirmPopup(),Order.hasLine({productName:"Combo Product 2",quantity:"2"}),Order.hasLine({productName:"Combo Product 4",quantity:"2"}),Order.hasLine({productName:"Combo Product 6",quantity:"2"}),Numpad.click("1"),{content:"Click 1",trigger:".modal-content div.numpad button:not(:contains('+')):contains('1')",run:"click",},Chrome.confirmPopup(),Order.hasLine({productName:"Combo Product 2",quantity:"1"}),Order.hasLine({productName:"Combo Product 4",quantity:"1"}),Order.hasLine({productName:"Combo Product 6",quantity:"1"}),].flat()),Order.hasTotal("47.33"),].flat(),});registry.category("web_tour.tours").add("test_combo_item_image_display",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),ProductScreen.clickDisplayedProduct("Office Combo"),combo.checkImgAndSelect("Combo Product 2",true),combo.checkImgAndSelect("Combo Product 4",true),combo.checkImgAndSelect("Combo Product 6",true),Dialog.confirm(),].flat(),});registry.category("web_tour.tours").add("test_combo_item_image_not_display",{steps:()=>[Chrome.startPoS(),ProductScreen.clickDisplayedProduct("Office Combo"),combo.checkImgAndSelect("Combo Product 2",false),combo.checkImgAndSelect("Combo Product 4",false),combo.checkImgAndSelect("Combo Product 6",false),Dialog.confirm(),].flat(),});return __exports;});;

/* /point_of_sale/static/tests/tours/pricelist_tour.js */
odoo.define('@point_of_sale/../tests/tours/pricelist_tour',['@web/core/registry','@point_of_sale/../tests/tours/utils/product_screen_util','@point_of_sale/../tests/tours/utils/numpad_util','@point_of_sale/../tests/tours/utils/generic_components/order_widget_util','@point_of_sale/../tests/tours/utils/dialog_util','@point_of_sale/../tests/tours/utils/pricelist_util','@point_of_sale/../tests/tours/utils/chrome_util'],function(require){'use strict';let __exports={};const{registry}=require("@web/core/registry");const ProductScreen=require("@point_of_sale/../tests/tours/utils/product_screen_util");const Numpad=require("@point_of_sale/../tests/tours/utils/numpad_util");const Order=require("@point_of_sale/../tests/tours/utils/generic_components/order_widget_util");const Dialog=require("@point_of_sale/../tests/tours/utils/dialog_util");const Pricelist=require("@point_of_sale/../tests/tours/utils/pricelist_util");const Chrome=require("@point_of_sale/../tests/tours/utils/chrome_util");registry.category("web_tour.tours").add("pos_pricelist",{steps:()=>[Chrome.startPoS(),Pricelist.setUp(),Pricelist.waitForUnitTest(),Dialog.confirm("Open Register"),ProductScreen.clickPriceList("Fixed",true,"Public Pricelist"),ProductScreen.clickPartnerButton(),ProductScreen.clickCustomer("Acme Corporation"),ProductScreen.clickPriceList("Public Pricelist",true),ProductScreen.clickPartnerButton(),ProductScreen.clickCustomer("Lumber Inc"),ProductScreen.clickPriceList("Public Pricelist",true),ProductScreen.clickDisplayedProduct("Wall Shelf",true,"1.0"),ProductScreen.clickPriceList("min_quantity ordering"),ProductScreen.clickReview(),{...ProductScreen.clickLine("Wall Shelf")[0],isActive:["mobile"]},Numpad.click("2"),...ProductScreen.selectedOrderlineHasDirect("Wall Shelf","2.0"),{...ProductScreen.back(),isActive:["mobile"]},...Order.hasTotal(`$ 2.00`),ProductScreen.clickDisplayedProduct("Small Shelf",true,"1.0"),ProductScreen.clickReview(),{...ProductScreen.clickLine("Small Shelf")[0],isActive:["mobile"]},Numpad.click("Price"),Numpad.isActive("Price"),Numpad.click("5"),...Order.hasLine({productName:"Small Shelf",price:"5.0",withClass:".selected"}),Numpad.click("Qty"),Numpad.isActive("Qty"),{...ProductScreen.back(),isActive:["mobile"]},ProductScreen.clickPriceList("Public Pricelist"),...Order.hasTotal(`$ 8.96`),ProductScreen.clickPriceList("min_quantity ordering"),ProductScreen.closePos(),].flat(),});return __exports;});;

/* /point_of_sale/static/tests/tours/product_configurator_tour.js */
odoo.define('@point_of_sale/../tests/tours/product_configurator_tour',['@point_of_sale/../tests/tours/utils/product_screen_util','@point_of_sale/../tests/tours/utils/dialog_util','@point_of_sale/../tests/tours/utils/chrome_util','@point_of_sale/../tests/tours/utils/product_configurator_util','@point_of_sale/../tests/tours/utils/combo_popup_util','@point_of_sale/../tests/tours/utils/common','@web/core/registry'],function(require){'use strict';let __exports={};const ProductScreen=require("@point_of_sale/../tests/tours/utils/product_screen_util");const Dialog=require("@point_of_sale/../tests/tours/utils/dialog_util");const Chrome=require("@point_of_sale/../tests/tours/utils/chrome_util");const ProductConfigurator=require("@point_of_sale/../tests/tours/utils/product_configurator_util");const combo=require("@point_of_sale/../tests/tours/utils/combo_popup_util");const{inLeftSide}=require("@point_of_sale/../tests/tours/utils/common");const{registry}=require("@web/core/registry");registry.category("web_tour.tours").add("ProductConfiguratorTour",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),ProductScreen.clickDisplayedProduct("Configurable Chair"),Dialog.cancel(),ProductScreen.orderIsEmpty(),ProductScreen.clickDisplayedProduct("Configurable Chair"),[{content:"Check that metal, leather chair variant is disabled",trigger:`.modal footer button.disabled`,},],ProductConfigurator.pickColor("Red"),ProductConfigurator.pickSelect("Metal"),ProductConfigurator.pickRadio("Other"),ProductConfigurator.fillCustomAttribute("Custom Fabric"),Dialog.confirm(),ProductScreen.selectedOrderlineHas("Configurable Chair (Fabrics: Other: Custom Fabric, Metal, Red)","1.0","11.0"),ProductScreen.clickDisplayedProduct("Configurable Chair"),ProductConfigurator.pickColor("Red"),ProductConfigurator.pickSelect("Metal"),ProductConfigurator.pickRadio("Other"),ProductConfigurator.fillCustomAttribute("Custom Fabric"),Dialog.confirm(),ProductScreen.selectedOrderlineHas("Configurable Chair (Fabrics: Other: Custom Fabric, Metal, Red)","2.0","22.0"),ProductScreen.clickDisplayedProduct("Configurable Chair"),ProductConfigurator.pickColor("Blue"),ProductConfigurator.pickSelect("Metal"),ProductConfigurator.pickRadio("Leather"),Dialog.confirm(),ProductScreen.selectedOrderlineHas("Configurable Chair (Leather, Metal, Blue)","1.0","10.0"),ProductScreen.clickDisplayedProduct("Configurable Chair"),ProductConfigurator.numberRadioOptions(2),Dialog.confirm(),Chrome.endTour(),].flat(),});registry.category("web_tour.tours").add("test_combo_variant_mix",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),ProductScreen.clickDisplayedProduct("Test Product Combo"),combo.select("Test Product (Large)"),Dialog.is("Attribute selection"),ProductConfigurator.pickRadio("Blue"),Dialog.confirm("Add"),Dialog.confirm(),inLeftSide([...ProductScreen.orderLineHas("Test Product (Large) (Blue)",1)]),].flat(),});return __exports;});;

/* /point_of_sale/static/tests/tours/product_screen_tour.js */
odoo.define('@point_of_sale/../tests/tours/product_screen_tour',['@point_of_sale/../tests/tours/utils/payment_screen_util','@point_of_sale/../tests/tours/utils/dialog_util','@point_of_sale/../tests/tours/utils/partner_list_util','@point_of_sale/../tests/tours/utils/product_screen_util','@point_of_sale/../tests/tours/utils/product_screen_partner_list_util','@point_of_sale/../tests/tours/utils/chrome_util','@point_of_sale/../tests/tours/utils/receipt_screen_util','@web/core/registry','@point_of_sale/../tests/tours/utils/generic_components/order_widget_util','@point_of_sale/../tests/tours/utils/common','@point_of_sale/../tests/tours/utils/product_configurator_util','@point_of_sale/../tests/tours/utils/numpad_util'],function(require){'use strict';let __exports={};const PaymentScreen=require("@point_of_sale/../tests/tours/utils/payment_screen_util");const Dialog=require("@point_of_sale/../tests/tours/utils/dialog_util");const PartnerList=require("@point_of_sale/../tests/tours/utils/partner_list_util");const ProductScreen=require("@point_of_sale/../tests/tours/utils/product_screen_util");const ProductScreenPartnerList=require("@point_of_sale/../tests/tours/utils/product_screen_partner_list_util");const Chrome=require("@point_of_sale/../tests/tours/utils/chrome_util");const ReceiptScreen=require("@point_of_sale/../tests/tours/utils/receipt_screen_util");const{registry}=require("@web/core/registry");const Order=require("@point_of_sale/../tests/tours/utils/generic_components/order_widget_util");const{back,inLeftSide,selectButton,scan_barcode,negateStep,}=require("@point_of_sale/../tests/tours/utils/common");const ProductConfiguratorPopup=require("@point_of_sale/../tests/tours/utils/product_configurator_util");const Numpad=require("@point_of_sale/../tests/tours/utils/numpad_util");registry.category("web_tour.tours").add("ProductScreenTour",{steps:()=>[Chrome.startPoS(),{trigger:".product-list",run:function(){const productList=document.querySelector(".product-list");if(productList.scrollWidth>document.documentElement.scrollWidth){throw new Error("Product list is overflowing");}},},ProductScreen.clickDisplayedProduct("Desk Organizer",true,"1.0","5.10"),ProductScreen.clickDisplayedProduct("Desk Organizer",true,"2.0","10.20"),ProductScreen.clickDisplayedProduct("Letter Tray",true,"1.0","5.28"),ProductScreen.clickDisplayedProduct("Desk Organizer",true,"3.0","15.30"),inLeftSide([...ProductScreen.clickLine("Letter Tray"),...ProductScreen.selectedOrderlineHasDirect("Letter Tray","1.0"),Numpad.click("⌫"),...ProductScreen.selectedOrderlineHasDirect("Letter Tray","0.0","0.0"),Numpad.click("⌫"),...ProductScreen.selectedOrderlineHasDirect("Desk Organizer","3.0","15.30"),Numpad.click("⌫"),...ProductScreen.selectedOrderlineHasDirect("Desk Organizer","0.0","0.0"),Numpad.click("1"),...ProductScreen.selectedOrderlineHasDirect("Desk Organizer","1.0","5.10"),Numpad.click("2"),...ProductScreen.selectedOrderlineHasDirect("Desk Organizer","12.0","61.2"),Numpad.click("3"),...ProductScreen.selectedOrderlineHasDirect("Desk Organizer","123.0","627.3"),...[".","5"].map(Numpad.click),...ProductScreen.selectedOrderlineHasDirect("Desk Organizer","123.5","629.85"),]),ProductScreen.productCardQtyIs("Desk Organizer","123.5"),inLeftSide([{...ProductScreen.clickLine("Desk Organizer","123.5")[0],isActive:["mobile"]},Numpad.click("Price"),Numpad.isActive("Price"),Numpad.click("1"),...ProductScreen.selectedOrderlineHasDirect("Desk Organizer","123.5","123.5"),...["1","."].map(Numpad.click),...ProductScreen.selectedOrderlineHasDirect("Desk Organizer","123.5","1,358.5"),Numpad.click("%"),Numpad.isActive("%"),...["5","."].map(Numpad.click),...ProductScreen.selectedOrderlineHasDirect("Desk Organizer","123.5","1,290.58"),Numpad.click("Qty"),Numpad.isActive("Qty"),...["⌫","⌫"].map(Numpad.click),...Order.doesNotHaveLine(),]),ProductScreen.clickSubcategory("Desk test"),ProductScreen.productIsDisplayed("Desk Pad"),ProductScreen.clickSubcategory("Misc test"),ProductScreen.productIsDisplayed("Whiteboard Pen"),ProductScreen.clickSubcategory("Chair test"),ProductScreen.productIsDisplayed("Letter Tray"),ProductScreen.clickSubcategory("Chair test"),ProductScreen.clickDisplayedProduct("Whiteboard Pen"),ProductScreen.clickDisplayedProduct("Wall Shelf Unit"),inLeftSide([...ProductScreen.clickLine("Whiteboard Pen"),Numpad.click("2"),...ProductScreen.selectedOrderlineHasDirect("Whiteboard Pen","2.0"),...ProductScreen.clickLine("Wall Shelf Unit"),Numpad.click("2"),...ProductScreen.selectedOrderlineHasDirect("Wall Shelf Unit","2.0"),Numpad.click("⌫"),...ProductScreen.selectedOrderlineHasDirect("Wall Shelf Unit","0.0"),Numpad.click("⌫"),...ProductScreen.selectedOrderlineHasDirect("Whiteboard Pen","2.0"),Numpad.click("⌫"),...ProductScreen.selectedOrderlineHasDirect("Whiteboard Pen","0.0"),Numpad.click("⌫"),...Order.doesNotHaveLine(),]),ProductScreen.clickDisplayedProduct("Whiteboard Pen"),ProductScreen.clickDisplayedProduct("Wall Shelf Unit"),ProductScreen.clickDisplayedProduct("Small Shelf"),ProductScreen.clickDisplayedProduct("Magnetic Board"),ProductScreen.clickDisplayedProduct("Monitor Stand"),inLeftSide([...ProductScreen.clickLine("Whiteboard Pen"),Numpad.click("⌫"),...ProductScreen.selectedOrderlineHasDirect("Whiteboard Pen","0.0"),Numpad.click("⌫"),...ProductScreen.selectedOrderlineHasDirect("Monitor Stand","1.0"),...ProductScreen.clickLine("Wall Shelf Unit"),Numpad.click("⌫"),...ProductScreen.selectedOrderlineHasDirect("Wall Shelf Unit","0.0"),Numpad.click("⌫"),...ProductScreen.selectedOrderlineHasDirect("Monitor Stand","1.0"),...ProductScreen.clickLine("Small Shelf"),Numpad.click("⌫"),...ProductScreen.selectedOrderlineHasDirect("Small Shelf","0.0"),Numpad.click("⌫"),...ProductScreen.selectedOrderlineHasDirect("Monitor Stand","1.0"),...ProductScreen.clickLine("Magnetic Board"),Numpad.click("⌫"),...ProductScreen.selectedOrderlineHasDirect("Magnetic Board","0.0"),Numpad.click("⌫"),...ProductScreen.selectedOrderlineHasDirect("Monitor Stand","1.0"),Numpad.click("⌫"),...ProductScreen.selectedOrderlineHasDirect("Monitor Stand","0.0"),Numpad.click("⌫"),...Order.doesNotHaveLine(),]),ProductScreen.clickDisplayedProduct("Desk Organizer",true,"1.0"),inLeftSide([{...ProductScreen.clickLine("Desk Organizer")[0],isActive:["mobile"]},...ProductScreen.addCustomerNote("Test customer note"),...Order.hasLine({productName:"Desk Organizer",quantity:"1.0",customerNote:"Test customer note",withClass:".selected",}),]),ProductScreen.isShown(),ProductScreen.clickReview(),ProductScreen.clickControlButton("Cancel Order"),Dialog.confirm(),{...ProductScreen.back(),isActive:["mobile"]},ProductScreen.orderIsEmpty(),].flat(),});registry.category("web_tour.tours").add("FloatingOrderTour",{steps:()=>[Chrome.startPoS(),ProductScreen.orderIsEmpty(),ProductScreen.clickDisplayedProduct("Desk Organizer",true,"1.0","5.10"),ProductScreen.clickDisplayedProduct("Desk Organizer",true,"2.0","10.20"),ProductScreen.productCardQtyIs("Desk Organizer","2.0"),Chrome.createFloatingOrder(),ProductScreen.clickDisplayedProduct("Letter Tray",true,"1.0","5.28"),ProductScreen.clickDisplayedProduct("Letter Tray",true,"2.0","10.56"),ProductScreen.selectFloatingOrder(0),ProductScreen.productCardQtyIs("Desk Organizer","2.0"),ProductScreen.isShown(),ProductScreen.selectFloatingOrder(1),ProductScreen.productCardQtyIs("Letter Tray","2.0"),inLeftSide([...ProductScreen.clickLine("Letter Tray","2.0"),...ProductScreen.clickControlButtonMore(),{trigger:"body",run:()=>{window.dispatchEvent(new KeyboardEvent("keyup",{key:"9"}));},},Dialog.cancel(),]),ProductScreen.isShown(),ProductScreen.productCardQtyIs("Letter Tray","2.0"),inLeftSide([...Order.hasLine({productName:"Letter Tray",quantity:"2.0",}),]),{trigger:"body",run:()=>{const bufferValue=posmodel.numberBuffer.get();if(bufferValue!=""){throw new Error(`Number buffer should be empty, but got ${bufferValue}`);}},},].flat(),});registry.category("web_tour.tours").add("test_reuse_empty_floating_order",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),ProductScreen.orderIsEmpty(),ProductScreen.checkFloatingOrderCount(1),ProductScreen.clickDisplayedProduct("Desk Organizer",true,"1.0","5.10"),Chrome.createFloatingOrder(),ProductScreen.checkFloatingOrderCount(2),ProductScreen.selectFloatingOrder(0),ProductScreen.clickPayButton(),PaymentScreen.clickPaymentMethod("Bank",true,{remaining:"0.00"}),PaymentScreen.clickValidate(),ReceiptScreen.isShown(),ReceiptScreen.clickNextOrder(),ProductScreen.checkFloatingOrderCount(1),].flat(),});registry.category("web_tour.tours").add("test_tax_control_button_visiblity",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),ProductScreen.clickReview(),ProductScreen.clickControlButtonMore(),negateStep(...ProductScreen.checkFiscalPositionButton()),].flat(),});registry.category("web_tour.tours").add("FiscalPositionNoTax",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),ProductScreen.clickDisplayedProduct("Test Product"),ProductScreen.totalAmountIs("100.00"),ProductScreen.clickFiscalPosition("No Tax"),ProductScreen.totalAmountIs("100.00"),ProductScreen.clickPayButton(),PaymentScreen.clickPaymentMethod("Bank",true,{remaining:"0.00"}),PaymentScreen.clickValidate(),ReceiptScreen.isShown(),Order.doesNotHaveLine({discount:""}),].flat(),});registry.category("web_tour.tours").add("FiscalPositionIncl",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),ProductScreen.clickDisplayedProduct("Test Product 1"),ProductScreen.totalAmountIs("100.00"),ProductScreen.clickFiscalPosition("Incl. to Incl."),ProductScreen.totalAmountIs("100.00"),ProductScreen.clickFiscalPosition("Incl. to Excl."),ProductScreen.totalAmountIs("110.00"),ProductScreen.clickPayButton(),PaymentScreen.clickPaymentMethod("Bank",true,{remaining:"0.00"}),PaymentScreen.clickValidate(),ReceiptScreen.isShown(),ReceiptScreen.clickNextOrder(),].flat(),});registry.category("web_tour.tours").add("FiscalPositionExcl",{steps:()=>[Chrome.startPoS(),ProductScreen.clickDisplayedProduct("Test Product 2"),ProductScreen.totalAmountIs("120.00"),ProductScreen.clickFiscalPosition("Excl. to Excl."),ProductScreen.totalAmountIs("110.00"),ProductScreen.clickFiscalPosition("Excl. to Incl."),ProductScreen.totalAmountIs("100.00"),ProductScreen.clickPayButton(),PaymentScreen.clickPaymentMethod("Bank",true,{remaining:"0.00"}),PaymentScreen.clickValidate(),].flat(),});registry.category("web_tour.tours").add("CashClosingDetails",{steps:()=>[Chrome.startPoS(),ProductScreen.enterOpeningAmount("0"),Dialog.confirm("Open Register"),ProductScreen.addOrderline("Desk Organizer","10"),ProductScreen.totalAmountIs("51.00"),ProductScreen.clickPayButton(),PaymentScreen.clickPaymentMethod("Cash"),PaymentScreen.remainingIs("0.0"),PaymentScreen.clickValidate(),Chrome.clickMenuOption("Close Register"),ProductScreen.closeWithCashAmount("50.0"),ProductScreen.cashDifferenceIs("-1.00"),Dialog.confirm("Close Register"),{trigger:".modal .btn-primary:contains(Proceed Anyway)",run:"click",expectUnloadPage:true,},{trigger:"button:contains(backend)",run:"click",expectUnloadPage:true,},{trigger:"body",expectUnloadPage:true,},ProductScreen.lastClosingCashIs("50.00"),].flat(),});registry.category("web_tour.tours").add("ShowTaxExcludedTour",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),ProductScreen.clickDisplayedProduct("Test Product",true,"1.0","100.0"),ProductScreen.totalAmountIs("110.0"),Chrome.endTour(),].flat(),});registry.category("web_tour.tours").add("limitedProductPricelistLoading",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),scan_barcode("0100100"),ProductScreen.selectedOrderlineHas("Test Product 1","1.0","80.0"),scan_barcode("0100201"),ProductScreen.selectedOrderlineHas("Test Product 2 (White)","1.0","100.0"),scan_barcode("0100202"),ProductScreen.selectedOrderlineHas("Test Product 2 (Red)","1.0","120.0"),scan_barcode("0100300"),ProductScreen.selectedOrderlineHas("Test Product 3","1.0","50.0"),Chrome.endTour(),].flat(),});registry.category("web_tour.tours").add("multiPricelistRulesTour",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),ProductScreen.clickDisplayedProduct("Test Product 1"),ProductScreen.selectedOrderlineHas("Test Product 1","1.0","200.0"),ProductScreen.clickDisplayedProduct("Test Product 1"),ProductScreen.selectedOrderlineHas("Test Product 1","2.0","200.0"),ProductScreen.clickDisplayedProduct("Test Product 1"),ProductScreen.selectedOrderlineHas("Test Product 1","3.0","150.0"),Chrome.endTour(),].flat(),});registry.category("web_tour.tours").add("MultiProductOptionsTour",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),ProductScreen.clickDisplayedProduct("Product A"),ProductConfiguratorPopup.isOptionShown("Value 1"),ProductConfiguratorPopup.isOptionShown("Value 2"),Dialog.confirm("Add"),Chrome.endTour(),].flat(),});registry.category("web_tour.tours").add("TranslateProductNameTour",{steps:()=>[Chrome.startPoS(),Dialog.confirm(),ProductScreen.clickDisplayedProduct("Testez le produit"),Chrome.endTour(),].flat(),});registry.category("web_tour.tours").add("DecimalCommaOrderlinePrice",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),ProductScreen.clickDisplayedProduct("Test Product"),inLeftSide([Numpad.click("5"),...ProductScreen.selectedOrderlineHasDirect("Test Product","5,00","7.267,65"),]),Chrome.endTour(),].flat(),});registry.category("web_tour.tours").add("SearchProducts",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),ProductScreen.searchProduct("chair"),ProductScreen.clickDisplayedProduct("Test chair 1"),ProductScreen.clickDisplayedProduct("Test CHAIR 2"),ProductScreen.clickDisplayedProduct("Test sofa"),ProductScreen.searchProduct("CHAIR"),ProductScreen.clickDisplayedProduct("Test chair 1"),ProductScreen.clickDisplayedProduct("Test CHAIR 2"),ProductScreen.clickDisplayedProduct("Test sofa"),ProductScreen.searchProduct("clémentine"),ProductScreen.clickDisplayedProduct("clémentine"),].flat(),});registry.category("web_tour.tours").add("CheckProductInformation",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),Chrome.clickMenuButton(),Chrome.clickMenuDropdownOption("Create Product"),Dialog.is({title:"New Product"}),Dialog.cancel(),ProductScreen.clickInfoProduct("product_a"),{trigger:".section-financials :contains('Margin')",},{trigger:".section-product-info-title:not(:contains('On hand:'))",},].flat(),});registry.category("web_tour.tours").add("PosCustomerAllFieldsDisplayed",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),ProductScreen.clickPartnerButton(),PartnerList.checkContactValues("John Doe","1 street of astreet","9898989899","0987654321","john@doe.com"),selectButton("Discard"),{isActive:["mobile"],...back(),},ProductScreenPartnerList.searchCustomerValueAndClear("John Doe"),ProductScreenPartnerList.searchCustomerValueAndClear("1 street of astreet"),ProductScreenPartnerList.searchCustomerValueAndClear("26432685463"),ProductScreenPartnerList.searchCustomerValueAndClear("Acity"),ProductScreenPartnerList.searchCustomerValueAndClear("United States"),ProductScreenPartnerList.searchCustomerValueAndClear("9898989899"),ProductScreenPartnerList.searchCustomerValueAndClear("0987654321"),ProductScreenPartnerList.searchCustomerValueAndClear("john@doe.com"),ProductScreen.clickPartnerButton(),{isActive:["mobile"],content:`Click search field`,trigger:`.fa-search.undefined`,run:`click`,},{content:`Search customer with "j%hn d%e"`,trigger:`.modal-dialog .input-group input`,run:`edit j%hn d%e`,},{content:`Check "John Doe" is shown`,trigger:`.partner-list .partner-info:nth-child(1):contains("John Doe")`,},].flat(),});registry.category("web_tour.tours").add("PosCategoriesOrder",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),{trigger:'.category-button:eq(0) > div span:contains("AAA")',},{trigger:'.category-button:eq(1) > div span:contains("AAB")',},{trigger:'.category-button:eq(2) > div span:contains("AAC")',},{trigger:'.category-button:eq(1) > div span:contains("AAB")',run:"click",},ProductScreen.productIsDisplayed("Product in AAB and AAX",0),{trigger:'.category-button:eq(2) > div span:contains("AAX")',},{trigger:'.category-button:eq(2) > div span:contains("AAX")',run:"click",},{trigger:'.category-button:eq(3) > div span:contains("AAY")',},].flat(),});registry.category("web_tour.tours").add("AutofillCashCount",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),ProductScreen.clickDisplayedProduct("Test Expensive"),ProductScreen.clickPayButton(),PaymentScreen.clickPaymentMethod("Cash"),PaymentScreen.clickValidate(),ReceiptScreen.clickNextOrder(),ProductScreen.isShown(),Chrome.clickMenuOption("Close Register"),{trigger:".fa-clone.btn-secondary",run:"click",},ProductScreen.cashDifferenceIs(0),].flat(),});registry.category("web_tour.tours").add("ProductSearchTour",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),ProductScreen.searchProduct("Test Product"),ProductScreen.productIsDisplayed("Apple").map(negateStep),ProductScreen.productIsDisplayed("Test Product 1"),ProductScreen.productIsDisplayed("Test Product 2"),ProductScreen.searchProduct("Apple"),ProductScreen.productIsDisplayed("Test Product 1").map(negateStep),ProductScreen.productIsDisplayed("Test Product 2").map(negateStep),ProductScreen.searchProduct("Test Produt"),ProductScreen.productIsDisplayed("Test Product 1").map(negateStep),ProductScreen.productIsDisplayed("Test Product 2").map(negateStep),ProductScreen.searchProduct("1234567890123"),ProductScreen.productIsDisplayed("Test Product 2").map(negateStep),ProductScreen.productIsDisplayed("Test Product 1"),ProductScreen.searchProduct("1234567890124"),ProductScreen.productIsDisplayed("Test Product 1").map(negateStep),ProductScreen.productIsDisplayed("Test Product 2"),ProductScreen.searchProduct("TESTPROD1"),ProductScreen.productIsDisplayed("Test Product 2").map(negateStep),ProductScreen.productIsDisplayed("Test Product 1"),ProductScreen.searchProduct("TESTPROD2"),ProductScreen.productIsDisplayed("Test Product 1").map(negateStep),ProductScreen.productIsDisplayed("Test Product 2"),].flat(),});registry.category("web_tour.tours").add("ProductCardUoMPrecision",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),ProductScreen.clickDisplayedProduct("Configurable Chair",false),ProductConfiguratorPopup.pickRadio("Leather"),Chrome.clickBtn("Add"),inLeftSide([Numpad.click("."),Numpad.click("1"),...Order.hasLine({productName:"Configurable Chair",quantity:"0.1",}),]),ProductScreen.clickDisplayedProduct("Configurable Chair",false),ProductConfiguratorPopup.pickRadio("wool"),Chrome.clickBtn("Add"),inLeftSide([Numpad.click("."),Numpad.click("7"),...Order.hasLine({productName:"Configurable Chair",quantity:"0.7",}),]),ProductScreen.productCardQtyIs("Configurable Chair","0.8"),{content:"Check the cart button if it shows the quantity in correct format/precision",isActive:["mobile"],trigger:".review-button:contains('0.8')",},].flat(),});registry.category("web_tour.tours").add("AddMultipleSerialsAtOnce",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),ProductScreen.clickDisplayedProduct("Product A"),ProductScreen.enterLotNumbers(["SN001","SN002","SN003"]),ProductScreen.selectedOrderlineHas("Product A","3.0"),ProductScreen.clickDisplayedProduct("Product A"),[{trigger:".fa-trash-o",run:"click",},],ProductScreen.enterLotNumbers(["SN005","SN006"]),ProductScreen.selectedOrderlineHas("Product A","4.0"),Chrome.endTour(),].flat(),});registry.category("web_tour.tours").add("test_draft_orders_not_syncing",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),ProductScreen.orderIsEmpty(),ProductScreen.clickDisplayedProduct("Desk Pad"),Chrome.createFloatingOrder(),ProductScreen.clickDisplayedProduct("Desk Pad"),ProductScreen.clickPayButton(),PaymentScreen.clickPaymentMethod("Bank"),PaymentScreen.clickValidate(),ReceiptScreen.isShown(),Chrome.endTour(),].flat(),});registry.category("web_tour.tours").add("test_one_attribute_value_scan_barcode",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),scan_barcode("1234567"),ProductScreen.selectedOrderlineHas("Product Test (Red)","1.0"),scan_barcode("1234568"),ProductScreen.selectedOrderlineHas("Product Test (Blue)","1.0"),Chrome.endTour(),].flat(),});registry.category("web_tour.tours").add("FiscalPositionTaxLabels",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),ProductScreen.clickDisplayedProduct("Test Product"),ProductScreen.totalAmountIs("100.00"),ProductScreen.clickFiscalPosition("Fiscal Position Test"),ProductScreen.totalAmountIs("100.00"),ProductScreen.clickPayButton(),PaymentScreen.clickPaymentMethod("Bank",true,{remaining:"0.00"}),PaymentScreen.clickValidate(),ReceiptScreen.isShown(),{content:"Make sure orderline tax label is correct",trigger:".orderline:contains('Tax Group 2')",},{content:"Make sure receipt tax label is correct and correspond to the orderline",trigger:".pos-receipt-taxes:contains('Tax Group 2')",},].flat(),});registry.category("web_tour.tours").add("test_barcode_search_attributes_preset",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),ProductScreen.searchProduct("12341357"),ProductScreen.clickDisplayedProduct("Product with Attributes"),{content:"Check that the product configurator is opened",trigger:".section-product-info-title:contains('Product with Attributes')",},Dialog.confirm("Add"),ProductScreen.selectedOrderlineHas("Product with Attributes (Value 1, Value 3, Value 5, Value 7)","1.0"),ProductScreen.searchProduct("987654321"),{content:"Wait for the product without attributes to be visible",trigger:'.product:contains("Product without Attributes")',},ProductScreen.clickDisplayedProduct("Product without Attributes"),ProductScreen.selectedOrderlineHas("Product without Attributes","1.0"),ProductScreen.searchProduct("12342468"),ProductScreen.clickDisplayedProduct("Product with Attributes"),{content:"Check that the product configurator is opened",trigger:".section-product-info-title:contains('Product with Attributes')",},Dialog.confirm("Add"),ProductScreen.selectedOrderlineHas("Product with Attributes (Value 2, Value 4, Value 6, Value 8)","1.0"),Chrome.endTour(),].flat(),});registry.category("web_tour.tours").add("test_pos_ui_round_globally",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),ProductScreen.clickDisplayedProduct("Test Product 1"),ProductScreen.clickDisplayedProduct("Test Product 2"),inLeftSide([...["+/-"].map(Numpad.click),...ProductScreen.selectedOrderlineHasDirect("Test Product 2","-1.0"),]),ProductScreen.totalAmountIs("7,771.01"),ProductScreen.clickPayButton(),PaymentScreen.clickPaymentMethod("Bank"),PaymentScreen.clickValidate(),ReceiptScreen.isShown(),Chrome.endTour(),].flat(),});registry.category("web_tour.tours").add("test_product_ref_displayed",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),ProductScreen.clickDisplayedProduct("Test name"),ProductScreen.clickInfoProduct("Test name"),{trigger:".modal .btn-secondary:contains(Edit)",run:"click",},{trigger:".modal .btn-primary:contains(Save)",run:"click",},ProductScreen.clickDisplayedProduct("Test name"),ProductScreen.selectedOrderlineHas("Test name","2.0"),Chrome.endTour(),].flat(),});registry.category("web_tour.tours").add("test_dynamic_product_price",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),ProductScreen.clickDisplayedProduct("Dynamic Product"),ProductConfiguratorPopup.pickRadio("Dynamic Value 1"),Chrome.clickBtn("Add"),ProductScreen.selectedOrderlineHas("Dynamic Product (Dynamic Value 1)","1.0","10.00"),ProductScreen.clickDisplayedProduct("Dynamic Product"),ProductConfiguratorPopup.pickRadio("Dynamic Value 2"),Chrome.clickBtn("Add"),ProductScreen.selectedOrderlineHas("Dynamic Product (Dynamic Value 2)","1.0","20.00"),Chrome.endTour(),].flat(),});registry.category("web_tour.tours").add("test_orderline_merge_with_higher_price_precision",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),ProductScreen.clickDisplayedProduct("High Precision Product"),ProductScreen.selectedOrderlineHas("High Precision Product","1.0","8.25"),ProductScreen.clickDisplayedProduct("High Precision Product"),ProductScreen.selectedOrderlineHas("High Precision Product","2.0","16.49"),Chrome.endTour(),].flat(),});return __exports;});;

/* /point_of_sale/static/tests/tours/receipt_screen_tour.js */
odoo.define('@point_of_sale/../tests/tours/receipt_screen_tour',['@point_of_sale/../tests/tours/utils/product_screen_util','@point_of_sale/../tests/tours/utils/receipt_screen_util','@point_of_sale/../tests/tours/utils/payment_screen_util','@point_of_sale/../tests/tours/utils/chrome_util','@point_of_sale/../tests/tours/utils/number_popup_util','@point_of_sale/../tests/tours/utils/generic_components/order_widget_util','@point_of_sale/../tests/tours/utils/dialog_util','@point_of_sale/../tests/tours/utils/numpad_util','@point_of_sale/../tests/tours/utils/product_configurator_util','@web/core/registry','@point_of_sale/../tests/tours/utils/common'],function(require){'use strict';let __exports={};const ProductScreen=require("@point_of_sale/../tests/tours/utils/product_screen_util");const ReceiptScreen=require("@point_of_sale/../tests/tours/utils/receipt_screen_util");const PaymentScreen=require("@point_of_sale/../tests/tours/utils/payment_screen_util");const Chrome=require("@point_of_sale/../tests/tours/utils/chrome_util");const NumberPopup=require("@point_of_sale/../tests/tours/utils/number_popup_util");const Order=require("@point_of_sale/../tests/tours/utils/generic_components/order_widget_util");const Dialog=require("@point_of_sale/../tests/tours/utils/dialog_util");const Numpad=require("@point_of_sale/../tests/tours/utils/numpad_util");const ProductConfigurator=require("@point_of_sale/../tests/tours/utils/product_configurator_util");const{registry}=require("@web/core/registry");const{run,inLeftSide}=require("@point_of_sale/../tests/tours/utils/common");registry.category("web_tour.tours").add("ReceiptScreenTour",{steps:()=>[Chrome.startPoS(),ProductScreen.addOrderline("Letter Tray","10","5"),ProductScreen.clickPartnerButton(),ProductScreen.clickCustomer("Partner Full"),ProductScreen.clickPayButton(),PaymentScreen.clickPaymentMethod("Bank"),PaymentScreen.validateButtonIsHighlighted(true),PaymentScreen.clickShipLaterButton(),PaymentScreen.shippingLaterHighlighted(),PaymentScreen.clickValidate(),ReceiptScreen.receiptIsThere(),ReceiptScreen.shippingDateExists(),ReceiptScreen.shippingDateIsToday(),ReceiptScreen.totalAmountContains("55.0"),ReceiptScreen.clickNextOrder(),ProductScreen.addOrderline("Desk Pad","6","5","30.0"),ProductScreen.addOrderline("Whiteboard Pen","6","6","36.0"),ProductScreen.addOrderline("Monitor Stand","6","1","6.0"),ProductScreen.clickPayButton(),PaymentScreen.clickPaymentMethod("Cash"),PaymentScreen.enterPaymentLineAmount("Cash","70",true,{remaining:"2.0"}),PaymentScreen.clickNumpad("0"),PaymentScreen.fillPaymentLineAmountMobile("Cash","700"),PaymentScreen.changeIs("628.0"),PaymentScreen.clickValidate(),ReceiptScreen.receiptIsThere(),ReceiptScreen.totalAmountContains("72.0"),ReceiptScreen.setEmail("test@receiptscreen.com"),ReceiptScreen.clickSend(),ReceiptScreen.emailIsSuccessful(),ReceiptScreen.clickNextOrder(),ProductScreen.addOrderline("Desk Pad","6","5"),ProductScreen.clickPayButton(),PaymentScreen.clickTipButton(),{content:"click numpad button: 1",trigger:".modal div.numpad button:contains(/^1/)",run:"click",},NumberPopup.isShown("1"),Dialog.confirm(),PaymentScreen.emptyPaymentlines("31.0"),PaymentScreen.clickPaymentMethod("Cash"),PaymentScreen.clickValidate(),ReceiptScreen.receiptIsThere(),ReceiptScreen.totalAmountContains(`$ 30.00 + $ 1.00 tip`),ReceiptScreen.clickNextOrder(),ProductScreen.addOrderline("Desk Pad","1","5"),inLeftSide([{...ProductScreen.clickLine("Desk Pad")[0],isActive:["mobile"]},...ProductScreen.addCustomerNote("Test customer note"),]),ProductScreen.clickPayButton(),PaymentScreen.clickPaymentMethod("Bank"),PaymentScreen.clickValidate(),Order.hasLine({customerNote:"Test customer note"}),ReceiptScreen.clickNextOrder(),ProductScreen.addOrderline("Desk Pad","1","20"),inLeftSide([{...ProductScreen.clickLine("Desk Pad")[0],isActive:["mobile"]},Numpad.click("%"),...ProductScreen.selectedOrderlineHasDirect("Desk Pad","1","20"),Numpad.click("5"),...ProductScreen.selectedOrderlineHasDirect("Desk Pad","1","19.0"),Numpad.click("."),]),ProductScreen.clickPayButton(),PaymentScreen.clickPaymentMethod("Bank"),PaymentScreen.clickValidate(),ReceiptScreen.receiptIsThere(),Order.hasLine({productName:"Desk Pad",priceNoDiscount:"20"}),ReceiptScreen.totalAmountContains("19.00"),ReceiptScreen.clickNextOrder(),].flat(),});registry.category("web_tour.tours").add("ReceiptScreenDiscountWithPricelistTour",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),ProductScreen.addOrderline("Test Product","1"),ProductScreen.clickPriceList("special_pricelist"),inLeftSide(Order.hasLine({productName:"Test Product",oldPrice:"7.0"})),ProductScreen.clickPayButton(),PaymentScreen.clickPaymentMethod("Cash"),PaymentScreen.clickValidate(),Order.hasLine({oldPrice:"7"}),ReceiptScreen.clickNextOrder(),ProductScreen.addOrderline("Test Product","1"),inLeftSide([{...ProductScreen.clickLine("Test Product")[0],isActive:["mobile"]},Numpad.click("Price"),Numpad.isActive("Price"),Numpad.click("9"),]),ProductScreen.clickPayButton(),PaymentScreen.clickPaymentMethod("Cash"),PaymentScreen.clickValidate(),ReceiptScreen.noDiscountAmount(),].flat(),});registry.category("web_tour.tours").add("OrderPaidInCash",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),ProductScreen.addOrderline("Desk Pad","5","5"),inLeftSide(ProductScreen.orderLineHas("Desk Pad","5")),ProductScreen.clickPayButton(),PaymentScreen.clickPaymentMethod("Cash"),PaymentScreen.validateButtonIsHighlighted(true),PaymentScreen.clickValidate(),ReceiptScreen.receiptIsThere(),ReceiptScreen.clickNextOrder(),ProductScreen.isShown(),Chrome.clickMenuOption("Close Register"),ProductScreen.closeWithCashAmount("25"),ProductScreen.cashDifferenceIs("0.00"),Dialog.confirm("Close Register"),{trigger:"button:contains(backend)",run:"click",expectUnloadPage:true,},{trigger:"body",expectUnloadPage:true,},ProductScreen.lastClosingCashIs("25.00"),].flat(),});registry.category("web_tour.tours").add("ReceiptTrackingMethodTour",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),ProductScreen.clickDisplayedProduct("Product A"),ProductScreen.enterLotNumber("123456789"),ProductScreen.clickPayButton(),PaymentScreen.clickPaymentMethod("Cash"),PaymentScreen.clickValidate(),ReceiptScreen.trackingMethodIsLot(),].flat(),});registry.category("web_tour.tours").add("test_auto_validate_force_done",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),ProductScreen.addOrderline("Whiteboard Pen","1"),ProductScreen.clickPayButton(),PaymentScreen.clickPaymentMethod("Cash"),{trigger:"body",run:()=>{posmodel.get_order().payment_ids[0].set_payment_status("force_done");},},{trigger:".send_force_done",run:"click",},ReceiptScreen.receiptIsThere(),].flat(),});registry.category("web_tour.tours").add("test_free_text_custom_attribute_on_receipt",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),ProductScreen.clickDisplayedProduct("Configurable Chair"),ProductConfigurator.pickRadio("Other"),ProductConfigurator.fillCustomAttribute("Custom Fabric"),Dialog.confirm(),ProductScreen.clickPayButton(),PaymentScreen.clickPaymentMethod("Bank"),PaymentScreen.clickValidate(),ReceiptScreen.receiptIsThere(),Order.hasLine({productName:"Configurable Chair (Fabrics: Other: Custom Fabric)",}),ReceiptScreen.clickNextOrder(),].flat(),});registry.category("web_tour.tours").add("test_receipt_screen_edit_payment_lines",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),ProductScreen.clickDisplayedProduct("Letter Tray"),ProductScreen.clickPayButton(),PaymentScreen.clickPaymentMethod("Bank"),PaymentScreen.clickValidate(),ReceiptScreen.receiptIsThere(),{trigger:".edit-order-payment",run:"click",},{trigger:'.nav-item > a:contains("Payments")',run:"click",},{content:"focus the amount input",trigger:"tr.o_data_row:first-child .o_data_cell[name=amount]",run:"click",},{content:"change amount from 5.28 to 4.28",trigger:"tr.o_data_row:first-child .o_data_cell[name=amount]",run:"edit 4.28",},{content:"add a new payment line",trigger:"a:contains(Add a line)",run:"click",},{isActive:["desktop"],trigger:"tr.o_data_row:nth-child(2) .o_data_cell[name=payment_method_id]",run:"edit Cash",},{isActive:["desktop"],trigger:".o-autocomplete--dropdown-menu",},{isActive:["desktop"],content:"select the cash payment method",trigger:".o-autocomplete--dropdown-item:contains('Cash')",run:"click",},{isActive:["mobile"],trigger:"tr.o_data_row:nth-child(2) .o_data_cell[name=payment_method_id] .o_input_dropdown input",run:"click",},{isActive:["mobile"],content:"select the cash payment method",trigger:".o_kanban_record:contains('Cash')",run:"click",},{content:"fill in the remaining amount, 1",trigger:"tr.o_data_row:nth-child(2) .o_data_cell[name=amount]",run:"edit 1",},{content:"save the edited payment lines",trigger:".o_form_button_save",run:"click",},{trigger:"body:not(:has(.modal))",},run(()=>{const paymentLines=document.querySelectorAll(".pos-receipt .paymentlines");if(paymentLines.length!==2){throw new Error(`Expected 2 paymentlines element, but found ${paymentLines.length}`);}},"There should be only two payment lines, the old edited one, and the new one"),{content:"The payment lines should have the correct payment method and amount",trigger:".pos-receipt .paymentlines:contains('Bank'):contains('4.28') ~ .paymentlines:contains('Cash'):contains('1.00')",},].flat(),});return __exports;});;

/* /point_of_sale/static/tests/tours/synchronization_tour.js */
odoo.define('@point_of_sale/../tests/tours/synchronization_tour',['@point_of_sale/../tests/tours/utils/product_screen_util','@point_of_sale/../tests/tours/utils/receipt_screen_util','@point_of_sale/../tests/tours/utils/payment_screen_util','@point_of_sale/../tests/tours/utils/chrome_util','@point_of_sale/../tests/tours/utils/dialog_util','@web/core/registry'],function(require){'use strict';let __exports={};const ProductScreen=require("@point_of_sale/../tests/tours/utils/product_screen_util");const ReceiptScreen=require("@point_of_sale/../tests/tours/utils/receipt_screen_util");const PaymentScreen=require("@point_of_sale/../tests/tours/utils/payment_screen_util");const Chrome=require("@point_of_sale/../tests/tours/utils/chrome_util");const Dialog=require("@point_of_sale/../tests/tours/utils/dialog_util");const{registry}=require("@web/core/registry");registry.category("web_tour.tours").add("test_sync_from_ui_one_by_one",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),{trigger:"body",content:"Create fake orders",run:async()=>{for(let i=0;i<5;i++){const product=posmodel.models["product.product"].find((el)=>el.attribute_line_ids.length==0);const order=posmodel.createNewOrder();await posmodel.addLineToOrder({product_id:product},order);posmodel.addPendingOrder([order.id]);}},},ProductScreen.clickDisplayedProduct("Desk Pad"),ProductScreen.clickPayButton(),PaymentScreen.clickPaymentMethod("Bank"),PaymentScreen.clickValidate(),ReceiptScreen.isShown(),].flat(),});return __exports;});;

/* /point_of_sale/static/tests/tours/ticket_screen_tour.js */
odoo.define('@point_of_sale/../tests/tours/ticket_screen_tour',['@point_of_sale/../tests/tours/utils/product_screen_util','@point_of_sale/../tests/tours/utils/numpad_util','@point_of_sale/../tests/tours/utils/receipt_screen_util','@point_of_sale/../tests/tours/utils/payment_screen_util','@point_of_sale/../tests/tours/utils/partner_list_util','@point_of_sale/../tests/tours/utils/ticket_screen_util','@point_of_sale/../tests/tours/utils/generic_components/order_widget_util','@point_of_sale/../tests/tours/utils/chrome_util','@point_of_sale/../tests/tours/utils/dialog_util','@point_of_sale/../tests/tours/utils/common','@web/core/registry'],function(require){'use strict';let __exports={};const ProductScreen=require("@point_of_sale/../tests/tours/utils/product_screen_util");const Numpad=require("@point_of_sale/../tests/tours/utils/numpad_util");const ReceiptScreen=require("@point_of_sale/../tests/tours/utils/receipt_screen_util");const PaymentScreen=require("@point_of_sale/../tests/tours/utils/payment_screen_util");const PartnerList=require("@point_of_sale/../tests/tours/utils/partner_list_util");const TicketScreen=require("@point_of_sale/../tests/tours/utils/ticket_screen_util");const Order=require("@point_of_sale/../tests/tours/utils/generic_components/order_widget_util");const Chrome=require("@point_of_sale/../tests/tours/utils/chrome_util");const Dialog=require("@point_of_sale/../tests/tours/utils/dialog_util");const{inLeftSide}=require("@point_of_sale/../tests/tours/utils/common");const{registry}=require("@web/core/registry");const Utils=require("@point_of_sale/../tests/tours/utils/common");registry.category("web_tour.tours").add("TicketScreenTour",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),Chrome.clickMenuOption("Orders"),Chrome.createFloatingOrder(),ProductScreen.addOrderline("Desk Pad","1","3"),Chrome.clickMenuOption("Orders"),TicketScreen.deleteOrder("-0002"),Dialog.confirm(),TicketScreen.clickDiscard(),ProductScreen.orderIsEmpty(),ProductScreen.addOrderline("Desk Pad","1","2"),Chrome.clickMenuOption("Orders"),TicketScreen.deleteOrder("-0001"),Dialog.confirm(),TicketScreen.clickDiscard(),Chrome.clickMenuOption("Orders"),TicketScreen.nthRowContains(2,"-0003"),TicketScreen.clickDiscard(),ProductScreen.addOrderline("Desk Pad","1","2"),ProductScreen.clickPartnerButton(),ProductScreen.clickCustomer("Partner Test 1"),Chrome.clickMenuOption("Orders"),TicketScreen.nthRowContains(2,"Partner Test 1",false),Chrome.createFloatingOrder(),ProductScreen.addOrderline("Desk Pad","1","3"),ProductScreen.clickPartnerButton(),ProductScreen.clickCustomer("Partner Test 2"),ProductScreen.clickPayButton(),PaymentScreen.isShown(),Chrome.clickMenuOption("Orders"),TicketScreen.nthRowContains(3,"Partner Test 2",false),Chrome.createFloatingOrder(),ProductScreen.addOrderline("Desk Pad","2","4"),ProductScreen.clickPayButton(),PaymentScreen.clickPaymentMethod("Bank"),PaymentScreen.clickValidate(),ReceiptScreen.isShown(),Chrome.clickMenuOption("Orders"),TicketScreen.nthRowContains(4,"Receipt"),TicketScreen.selectFilter("Receipt"),TicketScreen.nthRowContains(2,"Receipt"),TicketScreen.selectFilter("Payment"),TicketScreen.nthRowContains(2,"Payment"),TicketScreen.selectFilter("Ongoing"),TicketScreen.nthRowContains(2,"Ongoing"),TicketScreen.selectFilter("All active orders"),TicketScreen.nthRowContains(4,"Receipt"),TicketScreen.search("Receipt Number","-0005"),TicketScreen.nthRowContains(2,"Receipt"),TicketScreen.search("Customer","Partner Test 1"),TicketScreen.nthRowContains(2,"Partner Test 1",false),TicketScreen.search("Customer","Partner Test 2"),TicketScreen.nthRowContains(2,"Partner Test 2",false),TicketScreen.clickDiscard(),ReceiptScreen.isShown(),Chrome.clickMenuOption("Orders"),TicketScreen.selectFilter("Paid"),TicketScreen.nthRowContains(2,"-0005"),TicketScreen.selectOrder("-0005"),TicketScreen.selectFilter("Payment"),TicketScreen.selectOrder("-0004"),TicketScreen.loadSelectedOrder(),PaymentScreen.clickPaymentMethod("Cash"),PaymentScreen.clickValidate(),ReceiptScreen.isShown(),ReceiptScreen.clickNextOrder(),ProductScreen.isShown(),Chrome.clickMenuOption("Orders"),TicketScreen.selectFilter("Paid"),TicketScreen.nthRowContains(2,"Partner Test 2",false),TicketScreen.nthRowContains(3,"-0005"),TicketScreen.selectOrder("-0005"),inLeftSide(Order.hasLine()),TicketScreen.clickControlButton("Invoice"),Dialog.confirm(),PartnerList.clickPartner("Partner Test 3"),TicketScreen.invoicePrinted(),TicketScreen.back(),TicketScreen.filterIs("Paid"),TicketScreen.clickDiscard(),ProductScreen.isShown(),ProductScreen.orderIsEmpty(),...ProductScreen.clickRefund(),TicketScreen.filterIs("Paid"),TicketScreen.selectOrder("-0005"),inLeftSide([...Order.hasLine({productName:"Desk Pad",withClass:".selected"}),Numpad.click("3"),Dialog.confirm(),]),TicketScreen.clickDiscard(),{...ProductScreen.back(),isActive:["mobile"]},ProductScreen.isShown(),ProductScreen.orderIsEmpty(),...ProductScreen.clickRefund(),TicketScreen.selectOrder("-0005"),inLeftSide(Order.hasLine({productName:"Desk Pad",withClass:".selected"})),ProductScreen.clickNumpad("1"),TicketScreen.toRefundTextContains("To Refund: 1.00"),TicketScreen.confirmRefund(),{...ProductScreen.back(),isActive:["mobile"]},ProductScreen.isShown(),inLeftSide([...ProductScreen.clickLine("Desk Pad"),...ProductScreen.selectedOrderlineHasDirect("Desk Pad","-1.00"),Numpad.click("2"),Dialog.confirm(),...["+/-","3"].map(Numpad.click),Dialog.confirm(),...["+/-","2"].map(Numpad.click),...ProductScreen.selectedOrderlineHasDirect("Desk Pad","-2.00"),]),...ProductScreen.clickRefund(),TicketScreen.selectOrder("-0005"),TicketScreen.toRefundTextContains("Refunding 2.00"),TicketScreen.clickDiscard(),{...ProductScreen.back(),isActive:["mobile"]},ProductScreen.clickPayButton(),PaymentScreen.clickPaymentMethod("Bank"),PaymentScreen.clickValidate(),ReceiptScreen.isShown(),ReceiptScreen.clickNextOrder(),...ProductScreen.clickRefund(),TicketScreen.selectOrder("-0005"),TicketScreen.refundedNoteContains("2.00 Refunded"),].flat(),});registry.category("web_tour.tours").add("FiscalPositionNoTaxRefund",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),ProductScreen.clickDisplayedProduct("Product Test"),ProductScreen.totalAmountIs("100.00"),ProductScreen.clickFiscalPosition("No Tax"),ProductScreen.totalAmountIs("100.00"),ProductScreen.clickPayButton(),PaymentScreen.clickPaymentMethod("Bank",true,{remaining:"0.00"}),PaymentScreen.clickValidate(),ReceiptScreen.isShown(),ReceiptScreen.clickNextOrder(),...ProductScreen.clickRefund(),TicketScreen.selectOrder("-0001"),ProductScreen.clickNumpad("1"),TicketScreen.confirmRefund(),ProductScreen.isShown(),{...ProductScreen.back(),isActive:["mobile"]},ProductScreen.totalAmountIs("100.00"),ProductScreen.clickPayButton(),PaymentScreen.clickPaymentMethod("Bank"),PaymentScreen.clickValidate(),ReceiptScreen.isShown(),].flat(),});registry.category("web_tour.tours").add("LotRefundTour",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),ProductScreen.clickDisplayedProduct("Product A"),ProductScreen.enterLotNumber("123456789"),ProductScreen.selectedOrderlineHas("Product A","1.00"),ProductScreen.clickPayButton(),PaymentScreen.clickPaymentMethod("Bank"),PaymentScreen.clickValidate(),ReceiptScreen.isShown(),ReceiptScreen.clickNextOrder(),...ProductScreen.clickRefund(),TicketScreen.selectOrder("-0001"),ProductScreen.clickNumpad("1"),TicketScreen.toRefundTextContains("To Refund: 1.00"),TicketScreen.confirmRefund(),ProductScreen.isShown(),ProductScreen.clickLotIcon(),ProductScreen.checkFirstLotNumber("123456789"),].flat(),});registry.category("web_tour.tours").add("RefundFewQuantities",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),ProductScreen.clickDisplayedProduct("Sugar"),inLeftSide([...["0","."].map(Numpad.click),...ProductScreen.selectedOrderlineHasDirect("Sugar","0.00","0.00"),...["0","2"].map(Numpad.click),...ProductScreen.selectedOrderlineHasDirect("Sugar","0.02","0.06"),]),ProductScreen.clickPayButton(),PaymentScreen.clickPaymentMethod("Bank"),PaymentScreen.clickValidate(),ReceiptScreen.isShown(),ReceiptScreen.clickNextOrder(),...ProductScreen.clickRefund(),TicketScreen.selectOrder("-0001"),ProductScreen.clickNumpad("0","."),ProductScreen.clickNumpad("0","2"),TicketScreen.toRefundTextContains("To Refund: 0.02"),TicketScreen.confirmRefund(),ProductScreen.isShown(),Order.hasLine("Sugar","-0.02","-0.06"),].flat(),});registry.category("web_tour.tours").add("test_order_refund_flow",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),ProductScreen.addOrderline("Desk Pad","2","3"),ProductScreen.addOrderline("Letter Tray","3","2"),ProductScreen.clickPayButton(),PaymentScreen.clickPaymentMethod("Bank"),PaymentScreen.clickValidate(),ReceiptScreen.isShown(),ReceiptScreen.clickNextOrder(),ProductScreen.clickRefund(),TicketScreen.selectOrder("-0001"),ProductScreen.clickNumpad("1"),TicketScreen.toRefundTextContains("To Refund: 1.00"),TicketScreen.confirmRefund(),{...ProductScreen.back(),isActive:["mobile"]},ProductScreen.isShown(),inLeftSide([...Order.hasLine("Desk Pad","-1")]),Chrome.createFloatingOrder(),ProductScreen.clickRefund(),TicketScreen.selectOrder("-0001"),TicketScreen.toRefundTextContains("Refunding"),inLeftSide([...ProductScreen.clickLine("Letter Tray","3.0")]),ProductScreen.clickNumpad("1"),TicketScreen.toRefundTextContains("To Refund: 1.00"),TicketScreen.confirmRefund(),{...ProductScreen.back(),isActive:["mobile"]},ProductScreen.isShown(),inLeftSide([...Order.hasLine("Letter Tray","-1")]),ProductScreen.totalAmountIs("-2.20"),Chrome.clickMenuOption("Orders"),TicketScreen.deleteOrder("-0002"),Dialog.confirm(),TicketScreen.deleteOrder("-0003"),Dialog.confirm(),TicketScreen.selectFilter("Paid"),TicketScreen.selectOrder("-0001"),TicketScreen.noLinesToRefund(),].flat(),});registry.category("web_tour.tours").add("LotTour",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),ProductScreen.clickDisplayedProduct("Product A"),ProductScreen.enterLotNumber("1"),ProductScreen.selectedOrderlineHas("Product A","1.00"),inLeftSide([ProductScreen.clickLotIcon(),ProductScreen.enterLotNumber("2"),Order.hasLine({productName:"Product A",quantity:1.0,}),ProductScreen.clickLotIcon(),ProductScreen.enterLastLotNumber("1"),Order.hasLine({productName:"Product A",quantity:2.0,}),].flat()),ProductScreen.clickDisplayedProduct("Product A"),ProductScreen.enterLastLotNumber("3"),ProductScreen.selectedOrderlineHas("Product A","3.00"),inLeftSide({trigger:".info-list:contains('SN 3')",}),Chrome.createFloatingOrder(),ProductScreen.clickDisplayedProduct("Product A"),ProductScreen.enterLastLotNumber("3"),inLeftSide({trigger:".info-list:not(:contains('SN 3'))",}),ProductScreen.clickDisplayedProduct("Product B"),inLeftSide({trigger:".info-list:contains('Lot Number 1001')",}),].flat(),});registry.category("web_tour.tours").add("test_order_with_existing_serial",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),ProductScreen.clickDisplayedProduct("Serial Product"),ProductScreen.enterLotNumber("SN1"),ProductScreen.selectedOrderlineHas("Serial Product","1.00"),inLeftSide({trigger:".info-list:contains('SN SN1')",}),ProductScreen.clickDisplayedProduct("Serial Product"),ProductScreen.enterLastLotNumber("SN2"),ProductScreen.selectedOrderlineHas("Serial Product","2.00"),inLeftSide({trigger:".info-list:contains('SN SN2')",}),].flat(),});registry.category("web_tour.tours").add("test_serial_number_do_not_duplicate_after_refresh",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),ProductScreen.clickDisplayedProduct("Product A"),ProductScreen.enterLotNumber("1"),ProductScreen.selectedOrderlineHas("Product A","1.00"),Utils.refresh(),inLeftSide({content:`check serial number`,trigger:`.info-list`,run:()=>{const serialNumberCount=document.querySelectorAll("ul.info-list li:not(:first-child)").length;if(serialNumberCount!==1){throw new Error(`Expected 1 serial number, got ${serialNumberCount}`);}},}),].flat(),});return __exports;});;

/* /point_of_sale/static/tests/tours/utils/chrome_util.js */
odoo.define('@point_of_sale/../tests/tours/utils/chrome_util',['@point_of_sale/../tests/tours/utils/dialog_util','@point_of_sale/../tests/tours/utils/common','@odoo/hoot-dom'],function(require){'use strict';let __exports={};const Dialog=require("@point_of_sale/../tests/tours/utils/dialog_util");const{negate}=require("@point_of_sale/../tests/tours/utils/common");const{DateTime}=luxon;const{waitFor}=require("@odoo/hoot-dom");__exports.confirmPopup=confirmPopup;function confirmPopup(){return[Dialog.confirm()];}
__exports.clickMenuButton=clickMenuButton;function clickMenuButton(){return{content:"Click on the menu button",trigger:".pos-rightheader button:has(.fa-bars)",run:"click",};}
__exports.clickMenuOption=clickMenuOption;function clickMenuOption(name,options){return[clickMenuButton(),clickMenuDropdownOption(name,options)];}
__exports.clickMenuDropdownOption=clickMenuDropdownOption;function clickMenuDropdownOption(name,{expectUnloadPage=false}={}){return{content:`click on something in the burger menu`,trigger:`span.dropdown-item:contains(${name})`,run:"click",expectUnloadPage,};}
__exports.existMenuOption=existMenuOption;function existMenuOption(name){return[clickMenuButton(),{content:`check that ${name} exists in the burger menu`,trigger:`span.dropdown-item:contains(${name})`,},clickMenuButton(),];}
__exports.notExistMenuOption=notExistMenuOption;function notExistMenuOption(name){return[clickMenuButton(),{content:`check that ${name} doesn't exist in the burger menu`,trigger:negate(`span.dropdown-item:contains(${name})`),},];}
__exports.isCashMoveButtonHidden=isCashMoveButtonHidden;function isCashMoveButtonHidden(){return[clickMenuButton(),{trigger:"span.dropdown-item:not(:contains(Cash In/Out))",run:()=>{},},];}
__exports.endTour=endTour;function endTour(){return{content:"Last tour step that avoids error mentioned in commit 443c209",trigger:"body",};}
__exports.isSyncStatusConnected=isSyncStatusConnected;function isSyncStatusConnected(){return{trigger:negate(".oe_status",".pos-rightheader .status-buttons"),};}
__exports.clickPlanButton=clickPlanButton;function clickPlanButton(){return[{content:"go back to the floor screen",trigger:".pos-leftheader .back-button:not(.btn-primary)",run:"click",},...waitRequest(),];}
__exports.startPoS=startPoS;function startPoS(){return[{content:"Start PoS",trigger:".screen-login .btn.open-register-btn",run:"click",},];}
__exports.clickBtn=clickBtn;function clickBtn(name,{expectUnloadPage=false}={}){return{content:`Click on ${name}`,trigger:`body button:contains(${name})`,run:"click",expectUnloadPage,};}
__exports.hasBtn=hasBtn;function hasBtn(name){return{content:`Check button ${name} exist`,trigger:`body button:contains(${name})`,};}
__exports.fillTextArea=fillTextArea;function fillTextArea(target,value){return{content:`Fill text area with ${value}`,trigger:`textarea${target}`,run:`edit ${value}`,};}
__exports.createFloatingOrder=createFloatingOrder;function createFloatingOrder(){return{trigger:".pos-leftheader .list-plus-btn",run:"click"};}
__exports.waitRequest=waitRequest;function waitRequest(){return[{trigger:"body",content:"Wait loading is finished if it is shown",timeout:15000,async run(){let isLoading=false;try{isLoading=await waitFor("body:has(.fa-circle-o-notch)",{timeout:2000});}catch{}
if(isLoading){await waitFor("body:not(:has(.fa-circle-o-notch))",{timeout:10000});}},},];}
__exports.freezeDateTime=freezeDateTime;function freezeDateTime(millis){return[{trigger:"body",run:()=>{DateTime.now=()=>DateTime.fromMillis(millis);},},];}
__exports.isSynced=isSynced;function isSynced(){return{content:"Check if the request is proceeded",trigger:negate(".fa-spin",".status-buttons"),};}
__exports.storedOrderCount=storedOrderCount;function storedOrderCount(expectedCount){return{content:`Stored order count should be ${expectedCount}`,trigger:"body",run:()=>{const actualCount=posmodel.data.models["pos.order"].length;if(actualCount!==expectedCount){throw new Error(`Expected stored order count to be ${expectedCount}, but got ${actualCount}`);}},};}
return __exports;});;

/* /point_of_sale/static/tests/tours/utils/combo_popup_util.js */
odoo.define('@point_of_sale/../tests/tours/utils/combo_popup_util',['@point_of_sale/../tests/tours/utils/common'],function(require){'use strict';let __exports={};const{negate}=require("@point_of_sale/../tests/tours/utils/common");const productTrigger=(productName)=>`label.combo-item article.product:has(.product-name:contains("${productName}"))`;const isComboSelectedTrigger=(productName)=>`input:checked ~ ${productTrigger(productName)}`;const confirmationButtonTrigger=`footer button.confirm`;__exports.select=select;function select(productName){return{content:`Select combo item ${productName}`,trigger:`.modal ${productTrigger(productName)}`,run:"click",};}
__exports.isSelected=isSelected;function isSelected(productName){return{content:`Check that ${productName} is selected`,trigger:`.modal ${isComboSelectedTrigger(productName)}`,run:"click",};}
__exports.isNotSelected=isNotSelected;function isNotSelected(productName){return{content:`Check that ${productName} is not selected`,trigger:`.modal ${negate(isComboSelectedTrigger(productName), ".modal-body")}`,run:"click",};}
__exports.isConfirmationButtonDisabled=isConfirmationButtonDisabled;function isConfirmationButtonDisabled(){return{content:"try to click `confirm` without having made all the selections",trigger:`.modal ${confirmationButtonTrigger}[disabled]`,};}
__exports.checkImgAndSelect=checkImgAndSelect;function checkImgAndSelect(productName,checkImg=false){const productArticleSelector=productTrigger(productName);const withImg=`${productArticleSelector}:has(.product-img)`;const withoutImg=`${productArticleSelector}:not(:has(.product-img))`;const trigger=`.modal ${checkImg ? withImg : withoutImg}`;return{content:`Check image & select combo item ${productName}`,trigger:trigger,run:"click",};}
__exports.isNotPresent=isNotPresent;function isNotPresent(productName){return{content:`Check that ${productName} is not present in the combo options`,trigger:negate(productTrigger(productName),".modal"),};}
return __exports;});;

/* /point_of_sale/static/tests/tours/utils/common.js */
odoo.define('@point_of_sale/../tests/tours/utils/common',['@barcodes/../tests/helpers'],function(require){'use strict';let __exports={};const{simulateBarCode}=require("@barcodes/../tests/helpers");__exports.back=back;function back(){return{content:"go back to the products",trigger:".actionpad .back-button",run:"click",};}
__exports.inLeftSide=inLeftSide;function inLeftSide(steps){return[{isActive:["mobile"],content:"click review button",trigger:".btn-switchpane.review-button",run:"click",},...[steps].flat(),{...back(),isActive:["mobile"]},];}
__exports.negate=negate;function negate(selector,parent="body"){return`${parent}:not(:has(${selector}))`;}
__exports.negateStep=negateStep;function negateStep(step){return{...step,content:`Check that: ---${step.content}--- is not true`,trigger:negate(step.trigger),};}
__exports.run=run;function run(run,content="run function",expectUnloadPage=false){return{content,trigger:"body",run,expectUnloadPage};}
__exports.refresh=refresh;function refresh(){return run(()=>window.location.reload(),"refresh page",true);}
__exports.elementDoesNotExist=elementDoesNotExist;function elementDoesNotExist(selector){return{content:`Check that element "${selector}" don't exist.`,trigger:negate(selector),};}
__exports.waitForLoading=waitForLoading;function waitForLoading(){return[{content:"waiting for loading to finish",trigger:"body:not(:has(.loader))",},];}
__exports.selectButton=selectButton;function selectButton(name){return{content:`Select button ${name}`,trigger:`button:contains("${name}")`,run:"click",};}
__exports.scan_barcode=scan_barcode;function scan_barcode(barcode){return[{content:`PoS model scan barcode '${barcode}'`,trigger:"body",run:()=>simulateBarCode([...barcode,"Enter"]),},];}
return __exports;});;

/* /point_of_sale/static/tests/tours/utils/dialog_util.js */
odoo.define('@point_of_sale/../tests/tours/utils/dialog_util',['@point_of_sale/../tests/tours/utils/common'],function(require){'use strict';let __exports={};const{negate}=require("@point_of_sale/../tests/tours/utils/common");__exports.confirm=confirm;function confirm(confirmationText,button=".btn-primary"){let trigger=`.modal:not(.o_inactive_modal) .modal-footer ${button}`;if(confirmationText){trigger+=`:contains("${confirmationText}")`;}
return{content:"confirm dialog",trigger,run:"click",};}
__exports.cancel=cancel;function cancel(){return{content:"cancel dialog",trigger:`.modal .modal-header button[aria-label="Close"]`,run:"click",};}
__exports.discard=discard;function discard(){return{content:"discard dialog",trigger:`.modal .modal-footer button:contains("Discard")`,run:"click",};}
__exports.is=is;function is({title}={}){let trigger=".modal .modal-content";if(title){trigger+=` .modal-header:contains("${title}")`;}
return{content:"dialog is open",trigger,};}
__exports.isNot=isNot;function isNot(){return{content:"no dialog is open",trigger:negate(".modal-open"),};}
__exports.bodyIs=bodyIs;function bodyIs(body){return{content:"dialog is open",trigger:`.modal-body:contains(${body})`,};}
return __exports;});;

/* /point_of_sale/static/tests/tours/utils/generic_components/notification_util.js */
odoo.define('@point_of_sale/../tests/tours/utils/generic_components/notification_util',[],function(require){'use strict';let __exports={};__exports.has=has;function has(text,type){let trigger=`.o_notification:contains("${text}")`;if(type){trigger+=`:has(.o_notification_bar.bg-${type})`;}
return{content:`Check if there is a notification with text "${text}"`,trigger,};}
return __exports;});;

/* /point_of_sale/static/tests/tours/utils/generic_components/order_widget_util.js */
odoo.define('@point_of_sale/../tests/tours/utils/generic_components/order_widget_util',['@point_of_sale/../tests/tours/utils/common'],function(require){'use strict';let __exports={};const{negate}=require("@point_of_sale/../tests/tours/utils/common");__exports.hasLine=hasLine;function hasLine({withClass="",withoutClass="",run=()=>{},productName,quantity,price,customerNote,internalNote,comboParent,discount,oldPrice,priceNoDiscount,}={}){let trigger=`.order-container .orderline${withClass}`;if(withoutClass){trigger+=`:not(${withoutClass})`;}
if(productName){trigger+=`:has(.product-name:contains("${productName}"))`;}
if(quantity){trigger+=`:has(.qty:contains("${quantity}"))`;}
if(price){trigger+=`:has(.price:contains("${price}"))`;}
if(customerNote){trigger+=`:has(.info-list .customer-note:contains("${customerNote}"))`;}
if(internalNote){trigger+=`:has(.info-list .internal-note:contains("${internalNote}"))`;}
if(comboParent){trigger+=`:has(.info-list .combo-parent-name:contains("${comboParent}"))`;}
if(discount||discount===""){trigger+=`:has(.info-list .discount.em:contains("${discount}"))`;}
if(oldPrice){trigger+=`:has(.info-list .price-per-unit s:contains("${oldPrice}"))`;}
if(priceNoDiscount){trigger+=`:has(.info-list:contains("${priceNoDiscount}"))`;}
const args=JSON.stringify(arguments[0]);return[{content:`Check orderline with attributes: ${args}`,trigger,run:typeof run==="string"?run:()=>run(trigger),},];}
__exports.doesNotHaveLine=doesNotHaveLine;function doesNotHaveLine(options={}){const step=hasLine(options)[0];return[{...step,trigger:negate(step.trigger)}];}
__exports.hasTotal=hasTotal;function hasTotal(amount){return[{isActive:["desktop"],content:`order total amount is '${amount}'`,trigger:`.product-screen .order-summary .total:contains("${amount}")`,},{isActive:["mobile"],content:`order total amount is '${amount}'`,trigger:`.product-screen .order-summary .total:contains("${amount}"):not(:visible)`,},];}
__exports.hasTax=hasTax;function hasTax(amount){return{content:`order total tax is '${amount}'`,trigger:`.order-summary .tax:contains("${amount}")`,};}
__exports.hasNoTax=hasNoTax;function hasNoTax(){return{content:"order has not tax",trigger:".order-summary",run:function(){if(document.querySelector(".tax-info")){throw new Error("A tax has been found in the order screen.");}},};}
return __exports;});;

/* /point_of_sale/static/tests/tours/utils/generic_hooks.js */
odoo.define('@point_of_sale/../tests/tours/utils/generic_hooks',[],function(require){'use strict';let __exports={};const GenericHooks=__exports.GenericHooks=class GenericHooks{static afterValidateHook(){return[];}}
return __exports;});;

/* /point_of_sale/static/tests/tours/utils/number_popup_util.js */
odoo.define('@point_of_sale/../tests/tours/utils/number_popup_util',['@point_of_sale/../tests/tours/utils/numpad_util'],function(require){'use strict';let __exports={};const Numpad=require("@point_of_sale/../tests/tours/utils/numpad_util");__exports.enterValue=enterValue;function enterValue(keys){return Numpad.enterValue(keys).map((step)=>({...step,trigger:`.modal ${step.trigger}`,}));}
__exports.isShown=isShown;function isShown(val=""){return[{content:`input shown is '${val}'`,trigger:`.modal .value:contains("${val}")`,},];}
return __exports;});;

/* /point_of_sale/static/tests/tours/utils/numpad_util.js */
odoo.define('@point_of_sale/../tests/tours/utils/numpad_util',['@odoo/hoot-dom'],function(require){'use strict';let __exports={};const{queryAll}=require("@odoo/hoot-dom");const buttonTriger=(buttonValue)=>`div.numpad button[value="${buttonValue}"]`;const click=__exports.click=(buttonValue)=>({content:`click numpad button: ${buttonValue}`,trigger:buttonTriger(buttonValue),run:()=>{queryAll(buttonTriger(buttonValue)).filter((el)=>el.innerText===buttonValue).at(0)?.click();},});const enterValue=__exports.enterValue=(keys)=>keys.split("").map((key)=>click(key));const isActive=__exports.isActive=(buttonValue)=>({content:`check if --${buttonValue}-- mode is activated`,trigger:`${buttonTriger(buttonValue)}.active`,});const isVisible=__exports.isVisible=()=>({content:"check if numpad is visible",trigger:"div.numpad:visible",});return __exports;});;

/* /point_of_sale/static/tests/tours/utils/partner_list_util.js */
odoo.define('@point_of_sale/../tests/tours/utils/partner_list_util',[],function(require){'use strict';let __exports={};__exports.clickPartner=clickPartner;function clickPartner(name="",{expectUnloadPage=false}={}){return{content:`click partner '${name}' from partner list screen`,trigger:`.modal .partner-list b:contains(${name})`,run:"click",expectUnloadPage,};}
__exports.clickPartnerOptions=clickPartnerOptions;function clickPartnerOptions(name){return{content:`click partner from partner list screen`,trigger:`.partner-info:contains("${name}") button.dropdown`,run:"click",};}
__exports.checkDropDownItemText=checkDropDownItemText;function checkDropDownItemText(text){return{content:`check for dropdown item containing text`,trigger:`.o-dropdown-item:contains("${text}")`,};}
__exports.clickDropDownItem=clickDropDownItem;function clickDropDownItem(text){return{content:`click for dropdown item containing text`,trigger:`.o-dropdown-item:contains("${text}")`,run:"click",};}
__exports.checkContactValues=checkContactValues;function checkContactValues(name,address="",phone="",mobile="",email=""){const steps=[{content:`Check partner "${name}" from partner list screen`,trigger:`.partner-list .partner-info:contains("${name}")`,},{content:`Check address "${address}" for partner "${name}"`,trigger:`.partner-list .partner-info:contains("${name}") .partner-line-adress:contains("${address}")`,},];if(phone){steps.push({content:`Check phone number "${phone}" for partner "${name}"`,trigger:`.partner-list .partner-info:contains("${name}") .partner-line-email:contains("${phone}")`,});}
if(mobile){steps.push({content:`Check mobile number "${mobile}" for partner "${name}"`,trigger:`.partner-list .partner-info:contains("${name}") .partner-line-email:contains("${mobile}")`,});}
if(email){steps.push({content:`Check email address "${email}" for partner "${name}"`,trigger:`.partner-list .partner-info:contains("${name}") .partner-line-email .email-field:contains("${email}")`,});}
return steps;}
__exports.searchCustomerValue=searchCustomerValue;function searchCustomerValue(val){return[{isActive:["mobile"],content:`Click search field`,trigger:`.fa-search.undefined`,run:`click`,},{content:`Search customer with "${val}"`,trigger:`.modal-dialog .input-group input`,run:`edit ${val}`,},{content:`Click on search more if present`,trigger:`.search-more-button > button, .partner-list .partner-info:nth-child(1):contains("${val}")`,run:function(){this.anchor.click();},},{content:`Check "${val}" is shown`,trigger:`.partner-list .partner-info:nth-child(1):contains("${val}")`,},];}
return __exports;});;

/* /point_of_sale/static/tests/tours/utils/payment_screen_util.js */
odoo.define('@point_of_sale/../tests/tours/utils/payment_screen_util',['@point_of_sale/../tests/tours/utils/numpad_util','@point_of_sale/../tests/tours/utils/dialog_util','@point_of_sale/../tests/tours/utils/partner_list_util','@point_of_sale/../tests/tours/utils/number_popup_util'],function(require){'use strict';let __exports={};const Numpad=require("@point_of_sale/../tests/tours/utils/numpad_util");const Dialog=require("@point_of_sale/../tests/tours/utils/dialog_util");const PartnerList=require("@point_of_sale/../tests/tours/utils/partner_list_util");const NumberPopup=require("@point_of_sale/../tests/tours/utils/number_popup_util");__exports.clickPaymentMethod=clickPaymentMethod;function clickPaymentMethod(name,isCheckNeeded=false,options={}){const{remaining=null,change=null,amount=null}=options;const step=[{content:`click '${name}' payment method`,trigger:`.paymentmethods .button.paymentmethod .payment-name:contains("${name}")`,run:"click",},];if(isCheckNeeded){if(remaining){step.push(...remainingIs(remaining));}
if(change){step.push(...changeIs(change));}
if(amount){step.push(...selectedPaymentlineHas(name,amount));}}
return step;}
__exports.clickPaymentlineDelButton=clickPaymentlineDelButton;function clickPaymentlineDelButton(name,amount,mobile=false){return[{content:`delete ${name} paymentline with ${amount} amount`,trigger:`.paymentlines .paymentline .payment-infos:contains("${name}"):has(.payment-amount:contains("${amount}")) ~ .delete-button`,run:"click",},];}
__exports.clickPaymentline=clickPaymentline;function clickPaymentline(name,amount){return[{content:`click ${name} paymentline with ${amount} amount`,trigger:`.paymentlines .paymentline .payment-infos:contains("${name}"):has(.payment-amount:contains("${amount}"))`,run:"click",},];}
__exports.clickInvoiceButton=clickInvoiceButton;function clickInvoiceButton(){return[{content:"click invoice button",trigger:".payment-buttons .js_invoice",run:"click",},];}
__exports.clickValidate=clickValidate;function clickValidate(){return[{content:"validate payment",trigger:`.payment-screen button.validation-button.next`,run:"click",},];}
__exports.clickNumpad=clickNumpad;function clickNumpad(keys){return keys.split(" ").map((key)=>({...Numpad.click(key),isActive:["desktop"]}));}
__exports.clickBack=clickBack;function clickBack(){return[{content:"click back button",trigger:".back-button",run:"click",},];}
__exports.clickBackToProductScreen=clickBackToProductScreen;function clickBackToProductScreen(){return[{content:"click back to product screen",trigger:".payment-screen .back-button",run:"click",},];}
__exports.clickTipButton=clickTipButton;function clickTipButton(){return[{trigger:".payment-screen .button:contains('Tip')",run:"click",},];}
__exports.enterPaymentLineAmount=enterPaymentLineAmount;function enterPaymentLineAmount(lineName,keys,isCheckNeeded=false,options={}){const{remaining=null,change=null,amount=null}=options;const step=[...clickNumpad(keys.split("").join(" ")),...fillPaymentLineAmountMobile(lineName,keys),];if(isCheckNeeded){if(remaining){step.push(...remainingIs(remaining));}
if(change){step.push(...changeIs(change));}
if(amount){step.push(...selectedPaymentlineHas(lineName,amount));}}
return step;}
__exports.fillPaymentLineAmountMobile=fillPaymentLineAmountMobile;function fillPaymentLineAmountMobile(lineName,keys){return[{isActive:["mobile"],content:"click payment line",trigger:`.paymentlines .paymentline .payment-infos:contains("${lineName}")`,run:"click",},...NumberPopup.enterValue(keys).map((step)=>({...step,isActive:["mobile"],run:"click",})),{...Dialog.confirm(),isActive:["mobile"],run:"click",},];}
__exports.isShown=isShown;function isShown(){return[{content:"payment screen is shown",trigger:".pos .payment-screen",},];}
__exports.changeIs=changeIs;function changeIs(amount){return[{content:`change is ${amount}`,trigger:`.payment-status-change .amount:contains("${amount}")`,},];}
__exports.isInvoiceOptionSelected=isInvoiceOptionSelected;function isInvoiceOptionSelected(){return[{content:"Invoice option is selected",trigger:".payment-buttons .js_invoice.highlight",},];}
__exports.remainingIs=remainingIs;function remainingIs(amount){return[{content:`remaining amount is ${amount}`,trigger:`.payment-status-remaining .amount:contains("${amount}")`,},];}
__exports.validateButtonIsHighlighted=validateButtonIsHighlighted;function validateButtonIsHighlighted(isHighlighted=true){return[{isActive:["desktop"],content:`validate button is ${isHighlighted ? "highlighted" : "not highlighted"}`,trigger:isHighlighted?`.payment-screen button.validation-button.next.highlight`:`.payment-screen button.validation-button.next:not(:has(.highlight))`,},];}
__exports.emptyPaymentlines=emptyPaymentlines;function emptyPaymentlines(amountToPay){return[{content:`there are no paymentlines`,trigger:`.paymentlines-empty`,},{content:`amount to pay is '${amountToPay}'`,trigger:`.paymentlines-empty .total:contains("${amountToPay}")`,},];}
__exports.selectedPaymentlineHas=selectedPaymentlineHas;function selectedPaymentlineHas(paymentMethodName,amount){return[{content:`line paid via '${paymentMethodName}' is selected`,trigger:`.paymentlines .paymentline.selected .payment-name:contains("${paymentMethodName}")`,},{content:`amount tendered in the line is '${amount}'`,trigger:`.paymentlines .paymentline.selected .payment-amount:contains("${amount}")`,},];}
__exports.totalIs=totalIs;function totalIs(amount){return[{content:`total is ${amount}`,trigger:`.total:contains("${amount}")`,},];}
__exports.pay=pay;function pay(method,amount){const steps=[];steps.push(...clickPaymentMethod(method));for(const char of amount.split("")){steps.push(...clickNumpad(char));}
steps.push(...validateButtonIsHighlighted());steps.push(...clickValidate());return steps;}
__exports.isInvoiceButtonChecked=isInvoiceButtonChecked;function isInvoiceButtonChecked(){return[{content:"check invoice button is checked",trigger:".js_invoice.highlight",},];}
__exports.clickShipLaterButton=clickShipLaterButton;function clickShipLaterButton(){return[{content:"click ship later button",trigger:".button:contains('Ship Later')",run:"click",},{content:"click confirm button",trigger:".btn:contains('Confirm')",run:"click",},];}
__exports.clickPartnerButton=clickPartnerButton;function clickPartnerButton(){return[{content:"click customer button",trigger:"button.partner-button",run:"click",},{content:"partner screen is shown",trigger:`${PartnerList.clickPartner().trigger}`,},];}
__exports.clickCustomer=clickCustomer;function clickCustomer(name){return[PartnerList.clickPartner(name)];}
__exports.shippingLaterHighlighted=shippingLaterHighlighted;function shippingLaterHighlighted(){return{content:"Shipping later button is highlighted",trigger:".button:contains('Ship Later').highlight",};}
__exports.isInvoiceButtonUnchecked=isInvoiceButtonUnchecked;function isInvoiceButtonUnchecked(){return[{content:"check invoice button is not highlighted",trigger:".js_invoice:not(.highlight)",},];}
return __exports;});;

/* /point_of_sale/static/tests/tours/utils/pricelist_util.js */
odoo.define('@point_of_sale/../tests/tours/utils/pricelist_util',['@web/core/utils/numbers'],function(require){'use strict';let __exports={};const{roundDecimals:round_di}=require("@web/core/utils/numbers");function assert(condition,message){if(!condition){throw message||"Assertion failed";}}
function assertProductPrice(product,pricelist_name,quantity,expected_price){return function(){var pricelist=posmodel.data.models["product.pricelist"].find((pricelist)=>pricelist.name===pricelist_name);var frontend_price=product.get_price(pricelist,quantity);const dp=posmodel.data.models["decimal.precision"].find((dp)=>dp.name==="Product Price");frontend_price=round_di(frontend_price,dp.digits);var diff=Math.abs(expected_price-frontend_price);assert(diff<0.001,JSON.stringify({product:product.id,product_display_name:product.display_name,pricelist_name:pricelist_name,quantity:quantity,})+" DOESN'T MATCH -> "+
expected_price+" != "+
frontend_price);return Promise.resolve();};}
__exports.setUp=setUp;function setUp(){return[{content:"waiting for loading to finish",trigger:"body:not(:has(.pos-loader))",run:function(){var product_wall_shelf=posmodel.data.models["product.product"].getAll().find((p)=>p.display_name==="Wall Shelf Unit");var product_small_shelf=posmodel.data.models["product.product"].getAll().find((p)=>p.display_name==="Small Shelf");var product_magnetic_board=posmodel.data.models["product.product"].getAll().find((p)=>p.display_name==="Magnetic Board");var product_monitor_stand=posmodel.data.models["product.product"].getAll().find((p)=>p.display_name==="Monitor Stand");var product_desk_pad=posmodel.data.models["product.product"].getAll().find((p)=>p.display_name==="Desk Pad");var product_letter_tray=posmodel.data.models["product.product"].getAll().find((p)=>p.display_name==="Letter Tray");assertProductPrice(product_letter_tray,"Public Pricelist",0,4.8)().then(assertProductPrice(product_letter_tray,"Public Pricelist",1,4.8)).then(assertProductPrice(product_letter_tray,"Fixed",1,1)).then(assertProductPrice(product_wall_shelf,"Fixed",1,2)).then(assertProductPrice(product_small_shelf,"Fixed",1,13.95)).then(assertProductPrice(product_wall_shelf,"Percentage",1,0)).then(assertProductPrice(product_small_shelf,"Percentage",1,0.03)).then(assertProductPrice(product_magnetic_board,"Percentage",1,1.98)).then(assertProductPrice(product_wall_shelf,"Formula",1,6.86)).then(assertProductPrice(product_small_shelf,"Formula",1,2.99)).then(assertProductPrice(product_magnetic_board,"Formula",1,11.98)).then(assertProductPrice(product_monitor_stand,"Formula",1,8.19)).then(assertProductPrice(product_desk_pad,"Formula",1,6.98)).then(assertProductPrice(product_wall_shelf,"min_quantity ordering",1,2)).then(assertProductPrice(product_wall_shelf,"min_quantity ordering",2,1)).then(assertProductPrice(product_letter_tray,"Category vs no category",1,2)).then(assertProductPrice(product_letter_tray,"Category",1,2)).then(assertProductPrice(product_wall_shelf,"Product template",1,1)).then(assertProductPrice(product_wall_shelf,"Dates",1,2)).then(assertProductPrice(product_small_shelf,"Pricelist base rounding",1,13.95)).then(function(){document.querySelector(".pos").classList.add("done-testing");});},},];}
__exports.waitForUnitTest=waitForUnitTest;function waitForUnitTest(){return[{content:"wait for unit tests to finish",trigger:".pos.done-testing",},];}
return __exports;});;

/* /point_of_sale/static/tests/tours/utils/product_configurator_util.js */
odoo.define('@point_of_sale/../tests/tours/utils/product_configurator_util',[],function(require){'use strict';let __exports={};__exports.pickRadio=pickRadio;function pickRadio(name){return[{content:`picking radio attribute with name ${name}`,trigger:`.modal .attribute-name-cell:contains('${name}') input`,run:"click",},];}
__exports.pickSelect=pickSelect;function pickSelect(name){return[{content:`picking select attribute with name ${name}`,trigger:`.modal .configurator_select:has(option:contains('${name}'))`,run:`select ${name}`,},];}
__exports.pickColor=pickColor;function pickColor(name){return[{content:`picking color attribute with name ${name}`,trigger:`.modal .configurator_color[data-color='${name}']`,run:"click",},];}
__exports.fillCustomAttribute=fillCustomAttribute;function fillCustomAttribute(value){return[{content:`filling custom attribute with value ${value}`,trigger:`.modal .custom_value`,run:`edit ${value}`,},];}
__exports.numberRadioOptions=numberRadioOptions;function numberRadioOptions(number){return[{trigger:`.attribute-name-cell`,run:()=>{const radio_options=document.querySelectorAll(".attribute-name-cell").length;if(radio_options!==number){throw new Error(`Expected ${number} radio options, got ${radio_options}`);}},},];}
__exports.isOptionShown=isOptionShown;function isOptionShown(option){return[{content:`option ${option} is shown`,trigger:`.form-check-label:contains('${option}')`,},];}
return __exports;});;

/* /point_of_sale/static/tests/tours/utils/product_screen_partner_list_util.js */
odoo.define('@point_of_sale/../tests/tours/utils/product_screen_partner_list_util',['@point_of_sale/../tests/tours/utils/partner_list_util','@point_of_sale/../tests/tours/utils/product_screen_util','@point_of_sale/../tests/tours/utils/common'],function(require){'use strict';let __exports={};const PartnerList=require("@point_of_sale/../tests/tours/utils/partner_list_util");const ProductScreen=require("@point_of_sale/../tests/tours/utils/product_screen_util");const{back,selectButton}=require("@point_of_sale/../tests/tours/utils/common");__exports.searchCustomerValueAndClear=searchCustomerValueAndClear;function searchCustomerValueAndClear(val){return[ProductScreen.clickPartnerButton(),PartnerList.searchCustomerValue(val),selectButton("Discard"),{isActive:["mobile"],...back(),},].flat();}
return __exports;});;

/* /point_of_sale/static/tests/tours/utils/product_screen_util.js */
odoo.define('@point_of_sale/../tests/tours/utils/product_screen_util',['@point_of_sale/../tests/tours/utils/numpad_util','@point_of_sale/../tests/tours/utils/generic_components/order_widget_util','@point_of_sale/../tests/tours/utils/common','@point_of_sale/../tests/tours/utils/partner_list_util','@point_of_sale/../tests/tours/utils/text_input_popup_util','@point_of_sale/../tests/tours/utils/dialog_util','@point_of_sale/../tests/tours/utils/chrome_util','@point_of_sale/../tests/tours/utils/payment_screen_util'],function(require){'use strict';let __exports={};const Numpad=require("@point_of_sale/../tests/tours/utils/numpad_util");const Order=require("@point_of_sale/../tests/tours/utils/generic_components/order_widget_util");const{back:utilsBack,inLeftSide}=require("@point_of_sale/../tests/tours/utils/common");const PartnerList=require("@point_of_sale/../tests/tours/utils/partner_list_util");const TextInputPopup=require("@point_of_sale/../tests/tours/utils/text_input_popup_util");const Dialog=require("@point_of_sale/../tests/tours/utils/dialog_util");const Chrome=require("@point_of_sale/../tests/tours/utils/chrome_util");const PaymentScreen=require("@point_of_sale/../tests/tours/utils/payment_screen_util");__exports.clickLine=clickLine;function clickLine(productName,quantity="1.0"){return[...Order.hasLine({withoutClass:".selected",run:"click",productName,quantity,}),...Order.hasLine({withClass:".selected",productName,quantity}),].flat();}
__exports.clickReview=clickReview;function clickReview(){return{isActive:["mobile"],content:"click review button",trigger:".btn-switchpane.review-button",run:"click",};}
__exports.selectFloatingOrder=selectFloatingOrder;function selectFloatingOrder(index){return[{isActive:["mobile"],trigger:".fa-caret-down",run:"click",},{trigger:`.list-container-items .btn:eq(${index})`,run:"click",},];}
__exports.checkFloatingOrderCount=checkFloatingOrderCount;function checkFloatingOrderCount(expectedCount){return[{isActive:["mobile"],trigger:".fa-caret-down",run:"click",},{content:`check there are ${expectedCount} floating order`,trigger:".list-container-items .btn",run:()=>{const btns=document.querySelectorAll(".list-container-items .btn");if(btns.length!==expectedCount){throw new Error(`Expected ${expectedCount} floating order buttons, found ${btns.length}`);}},},{isActive:["mobile"],trigger:".modal-header .oi-arrow-left",run:"click",},];}
__exports.clickDisplayedProduct=clickDisplayedProduct;function clickDisplayedProduct(name,isCheckNeed=false,nextQuantity=null,nextPrice=null){const step=[{content:`click product '${name}'`,trigger:`article.product .product-content .product-name:contains("${name}")`,run:"click",},];if(isCheckNeed){step.push(...selectedOrderlineHas(name,nextQuantity,nextPrice));}
if(isCheckNeed&&nextQuantity){step.push(...productCardQtyIs(name,nextQuantity));}
return step;}
__exports.clickInfoProduct=clickInfoProduct;function clickInfoProduct(name){return[{content:`click product '${name}'`,trigger:`article.product:contains("${name}") .product-information-tag`,run:"click",},];}
__exports.clickOrderline=clickOrderline;function clickOrderline(productName,quantity="1.0"){return[...clickLine(productName,quantity),{content:"Check the product page",trigger:".product-list",},];}
__exports.clickSubcategory=clickSubcategory;function clickSubcategory(name){return[{content:`selecting '${name}' subcategory`,trigger:`.product-screen .rightpane .category-button:contains("${name}")`,run:"click",},{isActive:["desktop"],content:`'${name}' subcategory selected`,trigger:`button.category-button:contains("${name}")`,},];}
__exports.clickNumpad=clickNumpad;function clickNumpad(...keys){return inLeftSide(keys.map(Numpad.click));}
__exports.clickPayButton=clickPayButton;function clickPayButton(shouldCheck=true){const steps=[{isActive:["desktop"],content:"click pay button",trigger:".product-screen .pay-order-button",run:"click",},{isActive:["mobile"],content:"click pay button",trigger:".btn-switchpane:contains('Pay')",run:"click",},];if(shouldCheck){steps.push({content:"now in payment screen",trigger:".pos-content .payment-screen",});}
return steps;}
__exports.clickPartnerButton=clickPartnerButton;function clickPartnerButton(){return[clickReview(),{content:"click customer button",trigger:".product-screen .set-partner",run:"click",},{content:"partner screen is shown",trigger:`${PartnerList.clickPartner().trigger}`,},];}
__exports.clickCustomer=clickCustomer;function clickCustomer(name){return[PartnerList.clickPartner(name),{...back(),isActive:["mobile"]}];}
__exports.customerIsSelected=customerIsSelected;function customerIsSelected(name){return[clickReview(),{content:`customer '${name}' is selected`,trigger:`.product-screen .set-partner:contains("${name}")`,},];}
__exports.inputCustomerSearchbar=inputCustomerSearchbar;function inputCustomerSearchbar(value){return[{isActive:["mobile"],content:"click more button",trigger:".modal-header .fa-search",run:"click",},{trigger:".modal-header .input-group input",run:"edit "+value,},{trigger:".modal-header .input-group input",run:function(){document.querySelector(".modal-header .input-group input").dispatchEvent(new KeyboardEvent("keyup",{key:""}));},},];}
__exports.clickRefund=clickRefund;function clickRefund(){return[clickReview(),...clickControlButton("Refund")];}
__exports.controlButtonTrigger=controlButtonTrigger;function controlButtonTrigger(name=""){return`.control-buttons button:contains("${name}")`;}
__exports.clickControlButton=clickControlButton;function clickControlButton(name){return[...clickControlButtonMore(),{content:`click ${name} button`,trigger:controlButtonTrigger(name),run:"click",},];}
__exports.clickCloseButton=clickCloseButton;function clickCloseButton(){return[{trigger:`.btn-close`,run:"click",},];}
__exports.clickControlButtonMore=clickControlButtonMore;function clickControlButtonMore(){return[{isActive:["mobile"],content:"click Actions button",trigger:".mobile-more-button",run:"click",},{isActive:["desktop"],content:"click Actions button",trigger:controlButtonTrigger("Actions"),run:"click",},];}
__exports.clickInternalNoteButton=clickInternalNoteButton;function clickInternalNoteButton(){return[{isActive:["mobile"],content:"click Actions button",trigger:".mobile-more-button",run:"click",},{isActive:["mobile"],trigger:controlButtonTrigger("Kitchen Note"),run:"click",},{isActive:["desktop"],content:"click Internal Note button",trigger:controlButtonTrigger("Kitchen Note"),run:"click",},];}
__exports.clickPriceList=clickPriceList;function clickPriceList(name,isCheckNeedSelectedBeforeClick=false,nameToCheck=null){const step=[...clickControlButtonMore(),{trigger:".o_pricelist_button",run:"click",},];if(isCheckNeedSelectedBeforeClick){const triggerName=nameToCheck||name;step.push({content:`verify pricelist ${triggerName} is set and selected`,trigger:`.selection-item.selected:contains('${triggerName}')`,});}
step.push({content:`select price list '${name}'`,trigger:`.selection-item:contains("${name}")`,run:"click",});return inLeftSide(step);}
__exports.enterOpeningAmount=enterOpeningAmount;function enterOpeningAmount(amount){return[{content:"enter opening amount",trigger:".cash-input-sub-section input",run:"edit "+amount,},];}
__exports.clickFiscalPosition=clickFiscalPosition;function clickFiscalPosition(name,checkIsNeeded=false){const step=[clickReview(),...clickControlButtonMore(),{content:"click fiscal position button",trigger:".o_fiscal_position_button",run:"click",},{content:"fiscal position screen is shown",trigger:`.selection-item:contains("${name}")`,run:"click",},];if(checkIsNeeded){step.push(...clickControlButtonMore(),{content:"the fiscal position "+name+" has been set to the order",trigger:`.o_fiscal_position_button:contains("${name}")`,},{content:"cancel dialog",trigger:".modal .modal-header button[aria-label='Close']",run:"click",});}
return[...step,{...back(),isActive:["mobile"]}];}
__exports.checkFiscalPosition=checkFiscalPosition;function checkFiscalPosition(name){return[clickReview(),...clickControlButtonMore(),{content:`check fiscal position '${name}' is selected`,trigger:`.o_fiscal_position_button:contains("${name}")`,run:()=>{},},Dialog.cancel(),];}
__exports.checkFiscalPositionButton=checkFiscalPositionButton;function checkFiscalPositionButton(){return[{content:"click fiscal position button",trigger:".o_fiscal_position_button",},];}
__exports.closeWithCashAmount=closeWithCashAmount;function closeWithCashAmount(val){return[{trigger:".modal .close-pos-popup .cash-input input",run:`edit ${val}`,},];}
__exports.clickCloseSession=clickCloseSession;function clickCloseSession(){return[{trigger:"footer .button:contains('Close Session')",},];}
__exports.back=back;function back(){return utilsBack();}
__exports.clickLotIcon=clickLotIcon;function clickLotIcon(){return[{content:"click lot icon",trigger:".line-lot-icon",run:"click",},];}
__exports.enterLotNumber=enterLotNumber;function enterLotNumber(number){return[{content:"enter lot number",trigger:".list-line-input:first",run:"edit "+number,},Dialog.confirm(),];}
__exports.enterLastLotNumber=enterLastLotNumber;function enterLastLotNumber(number){return[{content:"enter lot number",trigger:".edit-list-inputs .input-group:last-child input",run:"edit "+number,},Dialog.confirm(),];}
__exports.enterLotNumbers=enterLotNumbers;function enterLotNumbers(numbers){return numbers.map((number)=>[{content:"enter lot number",trigger:".list-line-input:last()",run:"edit "+number,},{content:"Press Enter",trigger:".list-line-input:last()",run:"press Enter",},]).flat().concat([{content:"click validate lot number",trigger:".modal-content button:contains(Ok)",run:"click",},]);}
__exports.isShown=isShown;function isShown(){return[{content:"product screen is shown",trigger:".product-screen",},];}
__exports.selectedOrderlineHas=selectedOrderlineHas;function selectedOrderlineHas(productName,quantity,price){return inLeftSide(Order.hasLine({withClass:".selected",productName,quantity,price,}));}
__exports.selectedOrderlineHasDirect=selectedOrderlineHasDirect;function selectedOrderlineHasDirect(productName,quantity,price){return Order.hasLine({withClass:".selected",productName,quantity,price,});}
__exports.orderLineHas=orderLineHas;function orderLineHas(productName,quantity,price){return Order.hasLine({productName,quantity,price,});}
__exports.orderIsEmpty=orderIsEmpty;function orderIsEmpty(){return inLeftSide(Order.doesNotHaveLine());}
__exports.productIsDisplayed=productIsDisplayed;function productIsDisplayed(name,position=-1){return[{content:`'${name}' should be displayed`,trigger:`.product-list ${
                position > -1 ? `article:eq(${position})` : ""
            } .product-name:contains("${name}")`,},];}
__exports.searchProduct=searchProduct;function searchProduct(string){return[{isActive:["mobile"],content:`Click search field`,trigger:`.fa-search`,run:`click`,},{content:"Search for a product using the search bar",trigger:".pos-rightheader .form-control > input",run:`edit ${string}`,},];}
__exports.totalAmountIs=totalAmountIs;function totalAmountIs(amount){return inLeftSide(...Order.hasTotal(amount));}
__exports.modeIsActive=modeIsActive;function modeIsActive(mode){return inLeftSide(Numpad.isActive(mode));}
__exports.cashDifferenceIs=cashDifferenceIs;function cashDifferenceIs(val){return[{trigger:`.payment-methods-overview .cash-difference:contains(${val})`,},];}
__exports.productCardQtyIs=productCardQtyIs;function productCardQtyIs(productName,qty){qty=`${Number.parseFloat(Number.parseFloat(qty).toFixed(2))}`;return[{content:`'${productName}' should have '${qty}' quantity`,trigger:`article.product .product-content:has(.product-name:contains("${productName}")):has(.product-cart-qty:contains("${qty}"))`,},];}
__exports.lastClosingCashIs=lastClosingCashIs;function lastClosingCashIs(val){return[{trigger:`[name=last_session_closing_cash]:contains(${val})`,},];}
__exports.checkFirstLotNumber=checkFirstLotNumber;function checkFirstLotNumber(number){return[{content:"Check lot number",trigger:`.popup-input:value(${number})`,},];}
__exports.addOrderline=addOrderline;function addOrderline(productName,quantity=1,unitPrice,expectedTotal){const initialStep=clickDisplayedProduct(productName);const res=[];const mapKey=(key)=>{if(key==="-"){return"+/-";}
return key;};const numpadWrite=(val)=>val.toString().split("").flatMap((key)=>Numpad.click(mapKey(key)));res.push(...selectedOrderlineHasDirect(productName,"1.00"));if(unitPrice){res.push(...[Numpad.click("Price"),Numpad.isActive("Price"),numpadWrite(unitPrice),Numpad.click("Qty"),Numpad.isActive("Qty"),].flat());}
if(quantity.toString()!=="1"){res.push(...numpadWrite(quantity));}
res.push(...selectedOrderlineHasDirect(productName,quantity,expectedTotal));return[initialStep,inLeftSide(res)].flat();}
__exports.addCustomerNote=addCustomerNote;function addCustomerNote(note){return[clickControlButton("Customer Note"),TextInputPopup.inputText(note),Dialog.confirm(),].flat();}
__exports.addInternalNote=addInternalNote;function addInternalNote(note){return inLeftSide([clickInternalNoteButton(),TextInputPopup.inputText(note),Dialog.confirm()].flat());}
__exports.checkOrderlinesNumber=checkOrderlinesNumber;function checkOrderlinesNumber(number){return[{content:`check orderlines number`,trigger:`.order-container .orderline`,run:()=>{const orderline_amount=document.querySelectorAll(".order-container .orderline").length;if(orderline_amount!==number){throw new Error(`Expected ${number} orderlines, got ${orderline_amount}`);}},},];}
__exports.closePos=closePos;function closePos(){return[...Chrome.clickMenuOption("Close Register"),{content:"close the Point of Sale frontend",trigger:".close-pos-popup .button:contains('Discard')",},];}
__exports.finishOrder=finishOrder;function finishOrder(){return[...PaymentScreen.clickValidate(),Chrome.isSyncStatusConnected(),{isActive:["desktop"],content:"click Next Order",trigger:".receipt-screen .button.next.highlight:visible",run:"click",},{isActive:["mobile"],content:"Click Next Order",trigger:".receipt-screen .btn-switchpane.validation-button.highlight[name='done']",run:"click",},{content:"check if we left the receipt screen",trigger:".pos-content div:not(:has(.receipt-screen))",},];}
__exports.checkTaxAmount=checkTaxAmount;function checkTaxAmount(amount){return{trigger:`.tax:contains(${amount})`,};}
__exports.checkProductExtraPrice=checkProductExtraPrice;function checkProductExtraPrice(productName,extraAmount){return{content:`'${productName}' should have '${extraAmount}' extra price`,trigger:`article.product:has(.product-name:contains("${productName}")):has(.price-extra:contains("${extraAmount}"))`,};}
__exports.addDiscount=addDiscount;function addDiscount(discount){return[Numpad.click("%"),Numpad.isActive("%"),discount.toString().split("").flatMap((key)=>Numpad.click(key)),].flat();}
return __exports;});;

/* /point_of_sale/static/tests/tours/utils/receipt_screen_util.js */
odoo.define('@point_of_sale/../tests/tours/utils/receipt_screen_util',[],function(require){'use strict';let __exports={};__exports.clickNextOrder=clickNextOrder;function clickNextOrder(){return[{isActive:["desktop"],content:"go to next screen",trigger:".receipt-screen .button.next.highlight[name='done']",run:"click",},{isActive:["mobile"],content:"go to next screen",trigger:".receipt-screen .btn-switchpane.validation-button.highlight[name='done']",run:"click",},];}
__exports.clickContinueOrder=clickContinueOrder;function clickContinueOrder(){return[{content:"go to next screen",trigger:".receipt-screen .button.next.highlight[name='resume']",run:"click",},];}
__exports.setEmail=setEmail;function setEmail(email){return[{trigger:".receipt-screen .send-receipt-email-input",run:`edit ${email}`,},];}
__exports.clickSend=clickSend;function clickSend(){return[{run:"click",trigger:`.receipt-screen button i.fa-paper-plane`,},];}
__exports.clickBack=clickBack;function clickBack(){return[{trigger:".receipt-screen .button.back",run:"click",},];}
__exports.isShown=isShown;function isShown(){return[{content:"receipt screen is shown",trigger:".pos .receipt-screen",},];}
__exports.receiptIsThere=receiptIsThere;function receiptIsThere(){return[{content:"there should be the receipt",trigger:".receipt-screen .pos-receipt",},];}
__exports.totalAmountContains=totalAmountContains;function totalAmountContains(value){return[{isActive:["desktop"],trigger:`.receipt-screen .o_payment_successful:contains("${value}")`,},{isActive:["mobile"],trigger:`.receipt-screen`,},];}
__exports.receiptAmountTotalIs=receiptAmountTotalIs;function receiptAmountTotalIs(value){return[{isActive:["desktop"],trigger:`.receipt-screen .receipt-total:contains("${value}")`,},{isActive:["mobile"],trigger:`.receipt-screen`,},];}
__exports.receiptRoundingAmountIs=receiptRoundingAmountIs;function receiptRoundingAmountIs(value){return[{isActive:["desktop"],trigger:`.receipt-screen .receipt-rounding:contains("${value}")`,},];}
__exports.receiptRoundingAmountIsNotThere=receiptRoundingAmountIsNotThere;function receiptRoundingAmountIsNotThere(){return[{isActive:["desktop"],trigger:".receipt-screen",run:function(){if(document.querySelector(".receipt-rounding")){throw new Error("A rounding amount has been found in receipt.");}},},];}
__exports.receiptToPayAmountIs=receiptToPayAmountIs;function receiptToPayAmountIs(value){return[{isActive:["desktop"],trigger:`.receipt-screen .receipt-to-pay:contains("${value}")`,},];}
__exports.receiptToPayAmountIsNotThere=receiptToPayAmountIsNotThere;function receiptToPayAmountIsNotThere(){return[{isActive:["desktop"],trigger:".receipt-screen",run:function(){if(document.querySelector(".receipt-to-pay")){throw new Error("An amount to pay has been found in receipt.");}},},];}
__exports.receiptChangeAmountIs=receiptChangeAmountIs;function receiptChangeAmountIs(value){return[{isActive:["desktop"],trigger:`.receipt-screen .receipt-change:contains("${value}")`,},];}
__exports.receiptChangeAmountIsNotThere=receiptChangeAmountIsNotThere;function receiptChangeAmountIsNotThere(){return[{isActive:["desktop"],trigger:".receipt-screen",run:function(){if(document.querySelector(".receipt-change")){throw new Error("An change amount has been found in receipt.");}},},];}
__exports.emailIsSuccessful=emailIsSuccessful;function emailIsSuccessful(){return[{trigger:`.receipt-screen .notice .text-success`,},];}
__exports.trackingMethodIsLot=trackingMethodIsLot;function trackingMethodIsLot(){return[{content:`tracking method is Lot`,trigger:`li:contains("Lot Number")`,},];}
__exports.noDiscountAmount=noDiscountAmount;function noDiscountAmount(){return[{trigger:`.pos-receipt:not(:contains("Discounts"))`,run:()=>{},},];}
__exports.shippingDateExists=shippingDateExists;function shippingDateExists(){return[{content:"Shipping date must be printed",trigger:".pos-receipt-order-data:contains('Expected delivery:')",run:"click",},];}
__exports.shippingDateIsToday=shippingDateIsToday;function shippingDateIsToday(){const expectedDelivery=new Date().toLocaleDateString("en-US",{year:"numeric",month:"2-digit",day:"2-digit",});return[{content:"Shipping date must be today",trigger:`.pos-receipt-order-data:contains('Expected delivery:') > div:contains('${expectedDelivery}')`,},];}
__exports.cashierNameExists=cashierNameExists;function cashierNameExists(name){return[{content:`Cashier ${name} exists on the receipt`,trigger:`.pos-receipt-contact .cashier:contains(Served by):contains(${name})`,},];}
return __exports;});;

/* /point_of_sale/static/tests/tours/utils/selection_popup_util.js */
odoo.define('@point_of_sale/../tests/tours/utils/selection_popup_util',[],function(require){'use strict';let __exports={};__exports.has=has;function has(item,{run=()=>{}}={}){return[{content:`selection popup has '${item}'`,trigger:`.selection-item:contains("${item}")`,run,},];}
return __exports;});;

/* /point_of_sale/static/tests/tours/utils/text_input_popup_util.js */
odoo.define('@point_of_sale/../tests/tours/utils/text_input_popup_util',[],function(require){'use strict';let __exports={};__exports.inputText=inputText;function inputText(val){return{content:`input text '${val}'`,trigger:`.modal:not(.o_inactive_modal) textarea`,run:`edit ${val}`,};}
return __exports;});;

/* /point_of_sale/static/tests/tours/utils/ticket_screen_util.js */
odoo.define('@point_of_sale/../tests/tours/utils/ticket_screen_util',['@point_of_sale/../tests/tours/utils/product_screen_util','@point_of_sale/../tests/tours/utils/common','@point_of_sale/../tests/tours/utils/chrome_util'],function(require){'use strict';let __exports={};const ProductScreen=require("@point_of_sale/../tests/tours/utils/product_screen_util");const{inLeftSide}=require("@point_of_sale/../tests/tours/utils/common");const{isSyncStatusConnected}=require("@point_of_sale/../tests/tours/utils/chrome_util");__exports.clickDiscard=clickDiscard;function clickDiscard(){return{content:"go back",trigger:".ticket-screen button.discard",run:"click",};}
__exports.selectOrder=selectOrder;function selectOrder(orderName){return[{trigger:`.ticket-screen .order-row > .col:contains("${orderName}")`,run:"click",},];}
__exports.selectOrderByPrice=selectOrderByPrice;function selectOrderByPrice(price){return[{trigger:`.ticket-screen .order-row > .col:contains("${price}")`,run:"click",},];}
__exports.doubleClickOrder=doubleClickOrder;function doubleClickOrder(orderName){return[{trigger:`.ticket-screen .order-row > .col:nth-child(2):contains("${orderName}")`,run:"dblclick",},];}
__exports.loadSelectedOrder=loadSelectedOrder;function loadSelectedOrder(){return[ProductScreen.clickReview(),{trigger:".ticket-screen .pads .button.validation.load-order-button",run:"click",},];}
__exports.deleteOrder=deleteOrder;function deleteOrder(orderName){return[{isActive:["mobile"],trigger:`.ticket-screen .order-row > .col:contains("${orderName}")`,run:"click",},{isActive:["mobile"],trigger:`.ticket-screen .order-row:has(.col:contains("${orderName}")) .delete-button`,run:"click",},{isActive:["desktop"],trigger:`.ticket-screen .orders > .order-row > .col:contains("${orderName}") ~ .col[name="delete"]`,run:"click",},];}
__exports.selectFilter=selectFilter;function selectFilter(name){return[{trigger:`.pos-search-bar .filter`,run:"click",},{trigger:`.pos-search-bar .filter ul`,},{trigger:`.pos-search-bar .filter ul li:contains("${name}")`,run:"click",},];}
__exports.search=search;function search(field,searchWord){return[{trigger:".pos-search-bar input",run:`edit ${searchWord}`,},{trigger:`.pos-search-bar .search ul li:contains("${field}")`,run:"click",},];}
__exports.settleTips=settleTips;function settleTips(){return[{trigger:".ticket-screen .buttons .settle-tips",run:"click",},isSyncStatusConnected(),];}
__exports.clickControlButton=clickControlButton;function clickControlButton(name){return[ProductScreen.clickReview(),{trigger:`.ticket-screen ${ProductScreen.controlButtonTrigger(name)}`,run:"click",},];}
__exports.confirmRefund=confirmRefund;function confirmRefund(){return[ProductScreen.clickReview(),{trigger:".ticket-screen .btn-primary.pay-order-button",run:"click",},];}
__exports.checkStatus=checkStatus;function checkStatus(orderName,status){return[{isActive:["desktop"],trigger:`.ticket-screen .order-row > .col:contains("${orderName}") ~ .col:nth-child(7):contains(${status})`,},{isActive:["mobile"],trigger:`.ticket-screen .order-row > .col:contains("${orderName}") ~ .col:nth-child(2):contains(${status})`,},];}
__exports.nthRowContains=nthRowContains;function nthRowContains(n,string,viewMode){return[{isActive:[viewMode?"mobile":"desktop"],trigger:`.ticket-screen .orders > .order-row:nth-child(${n}):contains("${string}")`,},];}
__exports.contains=contains;function contains(string){return[{trigger:`.ticket-screen .orders:contains("${string}")`,},];}
__exports.noNewTicketButton=noNewTicketButton;function noNewTicketButton(){return[{trigger:".ticket-screen .controls .buttons:nth-child(1):has(.discard)",},];}
__exports.filterIs=filterIs;function filterIs(name){return[{trigger:`.ticket-screen .pos-search-bar .filter span:contains("${name}")`,},];}
__exports.invoicePrinted=invoicePrinted;function invoicePrinted(){return[{trigger:ProductScreen.controlButtonTrigger("Reprint Invoice"),},];}
__exports.toRefundTextContains=toRefundTextContains;function toRefundTextContains(text){return inLeftSide({trigger:`.ticket-screen .to-refund-highlight:contains("${text}")`,});}
__exports.refundedNoteContains=refundedNoteContains;function refundedNoteContains(text){return inLeftSide({trigger:`.ticket-screen .refund-note:contains("${text}")`,});}
__exports.noLinesToRefund=noLinesToRefund;function noLinesToRefund(){return inLeftSide({content:"No lines are marked for to refund or refunding",trigger:".ticket-screen:not(:has(.to-refund-highlight))",});}
__exports.tipContains=tipContains;function tipContains(amount){return[{trigger:`.ticket-screen .tip-cell:contains("${amount}")`,},];}
__exports.receiptTotalIs=receiptTotalIs;function receiptTotalIs(amount){return[{trigger:`.receipt-screen .pos-receipt-amount:contains("${amount}")`,},];}
__exports.receiptChangeIs=receiptChangeIs;function receiptChangeIs(amount){return[{trigger:`.receipt-screen .receipt-change:contains("${amount}")`,},];}
__exports.back=back;function back(){return{isActive:["mobile"],trigger:".back-button",run:"click",};}
__exports.nthColumnContains=nthColumnContains;function nthColumnContains(nRow,nCol,string){return[{trigger:`.ticket-screen .order-row:nth-last-child(${nRow}) > .col:nth-child(${nCol}):contains("${string}")`,},];}
__exports.noOrderIsThere=noOrderIsThere;function noOrderIsThere(){return{content:"No orders should be visible on the Ticket Screen",trigger:".ticket-screen:not(:has(.order-row))",};}
return __exports;});;

/* /pos_restaurant/static/tests/tours/control_buttons_tour.js */
odoo.define('@pos_restaurant/../tests/tours/control_buttons_tour',['@point_of_sale/../tests/tours/utils/text_input_popup_util','@point_of_sale/../tests/tours/utils/dialog_util','@point_of_sale/../tests/tours/utils/number_popup_util','@pos_restaurant/../tests/tours/utils/floor_screen_util','@point_of_sale/../tests/tours/utils/product_screen_util','@pos_restaurant/../tests/tours/utils/product_screen_util','@pos_restaurant/../tests/tours/utils/split_bill_screen_util','@point_of_sale/../tests/tours/utils/generic_components/order_widget_util','@point_of_sale/../tests/tours/utils/chrome_util','@pos_restaurant/../tests/tours/utils/chrome','@web/core/registry'],function(require){'use strict';let __exports={};const TextInputPopup=require("@point_of_sale/../tests/tours/utils/text_input_popup_util");const Dialog=require("@point_of_sale/../tests/tours/utils/dialog_util");const NumberPopup=require("@point_of_sale/../tests/tours/utils/number_popup_util");const FloorScreen=require("@pos_restaurant/../tests/tours/utils/floor_screen_util");const ProductScreenPos=require("@point_of_sale/../tests/tours/utils/product_screen_util");const ProductScreenResto=require("@pos_restaurant/../tests/tours/utils/product_screen_util");const ProductScreen={...ProductScreenPos,...ProductScreenResto};const SplitBillScreen=require("@pos_restaurant/../tests/tours/utils/split_bill_screen_util");const Order=require("@point_of_sale/../tests/tours/utils/generic_components/order_widget_util");const ChromePos=require("@point_of_sale/../tests/tours/utils/chrome_util");const ChromeRestaurant=require("@pos_restaurant/../tests/tours/utils/chrome");const Chrome={...ChromePos,...ChromeRestaurant};const{registry}=require("@web/core/registry");registry.category("web_tour.tours").add("ControlButtonsTour",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),FloorScreen.clickTable("2"),Chrome.activeTableOrOrderIs("2"),ProductScreen.addOrderline("Water","5","2","10.0"),Chrome.clickPlanButton(),FloorScreen.clickTable("4"),Chrome.activeTableOrOrderIs("4"),ProductScreen.addOrderline("Minute Maid","3","2","6.0"),ProductScreen.clickDisplayedProduct("Coca-Cola"),ProductScreen.selectedOrderlineHas("Coca-Cola","1"),ProductScreen.clickControlButton("Transfer"),FloorScreen.clickTable("2"),Chrome.activeTableOrOrderIs("2"),Order.hasLine({productName:"Water",quantity:"5"}),Order.hasLine({productName:"Minute Maid",quantity:"3"}),Order.hasLine({productName:"Coca-Cola",quantity:"1"}),ProductScreen.clickControlButton("Split"),SplitBillScreen.clickBack(),ProductScreen.clickLine("Water","5.0"),ProductScreen.clickInternalNoteButton(),TextInputPopup.inputText("test note"),Dialog.confirm(),Order.hasLine({productName:"Water",quantity:"5",price:"10.0",internalNote:"test note",withClass:".selected",}),Chrome.clickPlanButton(),FloorScreen.clickTable("5"),ProductScreen.addOrderline("Water","5","2","10.0"),ProductScreen.clickReview(),ProductScreen.clickControlButton("Cancel Order"),Dialog.confirm(),FloorScreen.clickTable("5"),ProductScreen.orderIsEmpty(),Chrome.clickPlanButton(),FloorScreen.clickTable("2"),Order.hasLine({productName:"Water",quantity:"5",price:"10.0",internalNote:"test note",}),ProductScreen.addOrderline("Water","8","1","8.0"),ProductScreen.clickControlButton("Bill"),Dialog.is({title:"Bill Printing"}),Dialog.cancel(),ProductScreen.clickControlButton("Guests"),{content:`click numpad button: 1`,trigger:".modal div.numpad button:text(1)",run:"click",},{content:`click numpad button: 5`,trigger:".modal div.numpad button:text(5)",run:"click",},NumberPopup.isShown("15"),Dialog.confirm(),ProductScreen.guestNumberIs("15"),{content:`click guests 15 button`,trigger:`.modal .control-buttons button:contains(15Guests)`,run:"click",},{content:`click numpad button: 5`,trigger:".modal div.numpad button:text(5)",run:"click",},NumberPopup.isShown("5"),Dialog.confirm(),ProductScreen.guestNumberIs("5"),].flat(),});return __exports;});;

/* /pos_restaurant/static/tests/tours/fake_tours.js */
odoo.define('@pos_restaurant/../tests/tours/fake_tours',['@web/core/registry','@point_of_sale/../tests/tours/utils/product_screen_util','@pos_restaurant/../tests/tours/utils/product_screen_util','@pos_restaurant/../tests/tours/utils/floor_screen_util','@point_of_sale/../tests/tours/utils/chrome_util','@pos_restaurant/../tests/tours/utils/chrome','@point_of_sale/../tests/tours/utils/payment_screen_util','@point_of_sale/../tests/tours/utils/receipt_screen_util'],function(require){'use strict';let __exports={};const{registry}=require("@web/core/registry");const ProductScreenPos=require("@point_of_sale/../tests/tours/utils/product_screen_util");const ProductScreenResto=require("@pos_restaurant/../tests/tours/utils/product_screen_util");const FloorScreen=require("@pos_restaurant/../tests/tours/utils/floor_screen_util");const ChromePos=require("@point_of_sale/../tests/tours/utils/chrome_util");const ChromeRestaurant=require("@pos_restaurant/../tests/tours/utils/chrome");const PaymentScreen=require("@point_of_sale/../tests/tours/utils/payment_screen_util");const ReceiptScreen=require("@point_of_sale/../tests/tours/utils/receipt_screen_util");const Chrome={...ChromePos,...ChromeRestaurant};const ProductScreen={...ProductScreenPos,...ProductScreenResto};const getRandomTable=()=>{const tables=posmodel.currentFloor.table_ids;return tables[Math.floor(Math.random()*tables.length)].table_number;};const getRandomTableWithOrder=()=>{const tables=posmodel.currentFloor.table_ids.filter((table)=>table["<-pos.order.table_id"].length>0);return tables[Math.floor(Math.random()*tables.length)].table_number;};const getRandomProduct=()=>{const products=posmodel.models["product.product"].filter((p)=>!p.isConfigurable()&&!p.isCombo()&&!p.isTracked()&&p.id!==posmodel.config.tip_product_id?.id&&!posmodel.session._pos_special_products_ids?.includes(p.id));return products[Math.floor(Math.random()*products.length)].name;};registry.category("web_tour.tours").add("PoSFakeTourRestaurant",{steps:()=>[FloorScreen.clickTable(getRandomTable()),ProductScreen.clickDisplayedProduct(getRandomProduct()),ProductScreen.clickDisplayedProduct(getRandomProduct()),ProductScreen.clickDisplayedProduct(getRandomProduct()),Chrome.clickPlanButton(),FloorScreen.clickTable(getRandomTable()),ProductScreen.clickDisplayedProduct(getRandomProduct()),ProductScreen.clickDisplayedProduct(getRandomProduct()),ProductScreen.clickDisplayedProduct(getRandomProduct()),ProductScreen.clickPayButton(),PaymentScreen.clickPaymentMethod("Cash"),PaymentScreen.clickValidate(),ReceiptScreen.clickNextOrder(),].flat(),});registry.category("web_tour.tours").add("PoSFakeTourTransferOrder",{steps:()=>[FloorScreen.clickTable(getRandomTableWithOrder()),ProductScreen.clickControlButton("Transfer"),FloorScreen.clickTable(getRandomTable()),ProductScreen.clickDisplayedProduct(getRandomProduct()),Chrome.clickPlanButton(),].flat(),});return __exports;});;

/* /pos_restaurant/static/tests/tours/floor_screen_tour.js */
odoo.define('@pos_restaurant/../tests/tours/floor_screen_tour',['@pos_restaurant/../tests/tours/utils/floor_screen_util','@point_of_sale/../tests/tours/utils/dialog_util','@point_of_sale/../tests/tours/utils/number_popup_util','@point_of_sale/../tests/tours/utils/chrome_util','@pos_restaurant/../tests/tours/utils/chrome','@point_of_sale/../tests/tours/utils/product_screen_util','@pos_restaurant/../tests/tours/utils/product_screen_util','@point_of_sale/../tests/tours/utils/common','@point_of_sale/../tests/tours/utils/payment_screen_util','@point_of_sale/../tests/tours/utils/receipt_screen_util','@web/core/registry'],function(require){'use strict';let __exports={};const FloorScreen=require("@pos_restaurant/../tests/tours/utils/floor_screen_util");const Dialog=require("@point_of_sale/../tests/tours/utils/dialog_util");const NumberPopup=require("@point_of_sale/../tests/tours/utils/number_popup_util");const ChromePos=require("@point_of_sale/../tests/tours/utils/chrome_util");const ChromeRestaurant=require("@pos_restaurant/../tests/tours/utils/chrome");const Chrome={...ChromePos,...ChromeRestaurant};const ProductScreenPos=require("@point_of_sale/../tests/tours/utils/product_screen_util");const ProductScreenResto=require("@pos_restaurant/../tests/tours/utils/product_screen_util");const Utils=require("@point_of_sale/../tests/tours/utils/common");const PaymentScreen=require("@point_of_sale/../tests/tours/utils/payment_screen_util");const ReceiptScreen=require("@point_of_sale/../tests/tours/utils/receipt_screen_util");const ProductScreen={...ProductScreenPos,...ProductScreenResto};const{registry}=require("@web/core/registry");const{inLeftSide}=require("@point_of_sale/../tests/tours/utils/common");registry.category("web_tour.tours").add("FloorScreenTour",{steps:()=>[Chrome.startPoS(),FloorScreen.selectedFloorIs("Main Floor"),FloorScreen.hasTable("2"),FloorScreen.hasTable("4"),FloorScreen.hasTable("5"),FloorScreen.clickFloor("Second Floor"),FloorScreen.hasTable("3"),FloorScreen.hasTable("1"),Chrome.clickMenuOption("Edit Plan"),FloorScreen.clickTable("3"),FloorScreen.selectedTableIs("3"),FloorScreen.clickTable("1"),FloorScreen.selectedTableIs("1"),FloorScreen.clickFloor("Main Floor"),FloorScreen.clickEditButton("Clone"),FloorScreen.selectedFloorIs("Main Floor (copy)"),FloorScreen.hasTable("2"),FloorScreen.hasTable("4"),FloorScreen.hasTable("5"),Utils.refresh(),Chrome.clickMenuOption("Edit Plan"),FloorScreen.clickFloor("Main Floor (copy)"),FloorScreen.hasTable("2"),FloorScreen.hasTable("4"),FloorScreen.hasTable("5"),FloorScreen.clickEditButton("Delete"),Dialog.confirm(),Utils.refresh(),Chrome.clickMenuOption("Edit Plan"),Utils.elementDoesNotExist(".floor-selector .button-floor:contains('Main Floor (copy)')"),FloorScreen.clickFloor("Main Floor"),{trigger:`.edit-buttons i[aria-label="Add Table"]`,run:"click",},FloorScreen.selectedTableIs("1"),FloorScreen.clickEditButton("Rename"),NumberPopup.enterValue("100"),NumberPopup.isShown("100"),Dialog.confirm(),FloorScreen.selectedTableIs("100"),FloorScreen.clickEditButton("Clone"),FloorScreen.selectedTableIs("1"),FloorScreen.clickEditButton("Rename"),NumberPopup.enterValue("1111"),NumberPopup.isShown("1111"),Dialog.confirm(),FloorScreen.selectedTableIs("1111"),FloorScreen.clickFloor("Second Floor"),FloorScreen.hasTable("3"),FloorScreen.hasTable("1"),FloorScreen.clickTable("1"),FloorScreen.selectedTableIs("1"),FloorScreen.ctrlClickTable("3"),FloorScreen.selectedTableIs("3"),FloorScreen.clickEditButton("Clone"),FloorScreen.selectedTableIs("2"),FloorScreen.selectedTableIs("4"),FloorScreen.clickEditButton("Delete"),Dialog.confirm(),FloorScreen.clickFloor("Main Floor"),FloorScreen.hasTable("2"),FloorScreen.hasTable("4"),FloorScreen.hasTable("5"),FloorScreen.hasTable("100"),FloorScreen.hasTable("1111"),FloorScreen.clickTable("1111"),FloorScreen.selectedTableIs("1111"),FloorScreen.clickEditButton("Delete"),Dialog.confirm(),FloorScreen.clickTable("4"),FloorScreen.selectedTableIs("4"),FloorScreen.clickEditButton("Seats"),NumberPopup.enterValue("⌫9"),NumberPopup.enterValue("9"),NumberPopup.isShown("9"),Dialog.confirm(),FloorScreen.table({name:"4"}),FloorScreen.selectedTableIs("4"),FloorScreen.clickEditButton("Seats"),NumberPopup.enterValue("15"),NumberPopup.isShown("15"),Dialog.confirm(),FloorScreen.table({name:"4"}),FloorScreen.clickEditButton("Make Round"),FloorScreen.clickSaveEditButton(),FloorScreen.table({name:"4",withoutClass:".selected"}),FloorScreen.clickTable("4"),ProductScreen.isShown(),Chrome.clickPlanButton(),FloorScreen.clickFloor("Second Floor"),FloorScreen.hasTable("3"),FloorScreen.clickTable("3"),ProductScreen.isShown(),Chrome.clickPlanButton(),FloorScreen.selectedFloorIs("Second Floor"),FloorScreen.clickFloor("Main Floor"),FloorScreen.clickTable("4"),ProductScreen.clickDisplayedProduct("Coca-Cola"),Chrome.clickPlanButton(),FloorScreen.isShown(),FloorScreen.linkTables("5","4"),FloorScreen.isChildTable("5"),Utils.refresh(),FloorScreen.isChildTable("5"),FloorScreen.clickTable("5"),Chrome.isTabActive("4 & 5"),inLeftSide(ProductScreen.orderLineHas("Coca-Cola","1.0")),Chrome.clickPlanButton(),FloorScreen.isShown(),FloorScreen.goTo("5"),Chrome.isTabActive("4 & 5"),inLeftSide(ProductScreen.orderLineHas("Coca-Cola","1.0")),ProductScreen.clickPayButton(),PaymentScreen.clickPaymentMethod("Cash"),PaymentScreen.clickValidate(),ReceiptScreen.clickNextOrder(),Utils.negateStep(FloorScreen.isChildTable("5")),FloorScreen.linkTables("5","4"),{content:"Drag table 5 to the bottom of the screen to unlink it",trigger:FloorScreen.table({name:"5"}).trigger,async run(helpers){await helpers.drag_and_drop(`div.floor-map`,{position:{bottom:0,},relative:true,});},},Utils.negateStep(FloorScreen.isChildTable("5")),].flat(),});return __exports;});;

/* /pos_restaurant/static/tests/tours/pos_restaurant_tour.js */
odoo.define('@pos_restaurant/../tests/tours/pos_restaurant_tour',['@pos_restaurant/../tests/tours/utils/bill_screen_util','@point_of_sale/../tests/tours/utils/payment_screen_util','@point_of_sale/../tests/tours/utils/combo_popup_util','@point_of_sale/../tests/tours/utils/dialog_util','@point_of_sale/../tests/tours/utils/receipt_screen_util','@point_of_sale/../tests/tours/utils/chrome_util','@pos_restaurant/../tests/tours/utils/chrome','@pos_restaurant/../tests/tours/utils/floor_screen_util','@point_of_sale/../tests/tours/utils/product_screen_util','@pos_restaurant/../tests/tours/utils/product_screen_util','@point_of_sale/../tests/tours/utils/generic_components/order_widget_util','@point_of_sale/../tests/tours/utils/ticket_screen_util','@point_of_sale/../tests/tours/utils/common','@web/core/registry','@point_of_sale/../tests/tours/utils/numpad_util','@odoo/hoot-dom','@point_of_sale/../tests/tours/utils/text_input_popup_util'],function(require){'use strict';let __exports={};const BillScreen=require("@pos_restaurant/../tests/tours/utils/bill_screen_util");const PaymentScreen=require("@point_of_sale/../tests/tours/utils/payment_screen_util");const combo=require("@point_of_sale/../tests/tours/utils/combo_popup_util");const Dialog=require("@point_of_sale/../tests/tours/utils/dialog_util");const ReceiptScreen=require("@point_of_sale/../tests/tours/utils/receipt_screen_util");const ChromePos=require("@point_of_sale/../tests/tours/utils/chrome_util");const ChromeRestaurant=require("@pos_restaurant/../tests/tours/utils/chrome");const Chrome={...ChromePos,...ChromeRestaurant};const FloorScreen=require("@pos_restaurant/../tests/tours/utils/floor_screen_util");const ProductScreenPos=require("@point_of_sale/../tests/tours/utils/product_screen_util");const ProductScreenResto=require("@pos_restaurant/../tests/tours/utils/product_screen_util");const Order=require("@point_of_sale/../tests/tours/utils/generic_components/order_widget_util");const TicketScreen=require("@point_of_sale/../tests/tours/utils/ticket_screen_util");const{inLeftSide,negateStep,waitForLoading,refresh,}=require("@point_of_sale/../tests/tours/utils/common");const{registry}=require("@web/core/registry");const Numpad=require("@point_of_sale/../tests/tours/utils/numpad_util");const{delay}=require("@odoo/hoot-dom");const TextInputPopup=require("@point_of_sale/../tests/tours/utils/text_input_popup_util");const ProductScreen={...ProductScreenPos,...ProductScreenResto};function checkOrderChanges(expected_changes){return[{content:`Check order changes with expected changes ${JSON.stringify(
                expected_changes
            )}`,trigger:".pos",run:function(){const orderChanges=window.posmodel.getOrderChanges();const orderChangesKeys=Object.keys(orderChanges.orderlines);const orderChangesNbr=orderChangesKeys.length;if(expected_changes.length!==orderChangesNbr){console.error(`Was expecting ${expected_changes.length} order changes, got ${orderChangesNbr}`);}
for(const expected_change of expected_changes){const order_change_line=orderChangesKeys.find((key)=>{const change=orderChanges.orderlines[key];return(change.name===expected_change.name&&change.quantity===expected_change.quantity);});if(order_change_line===undefined){console.error(`Was expecting product "${expected_change.name}" with quantity ${
                                expected_change.quantity
                            } as order change, inside ${JSON.stringify(orderChanges.orderlines)}`);}}},},];}
registry.category("web_tour.tours").add("pos_restaurant_sync",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),Chrome.createFloatingOrder(),ProductScreen.clickControlButton("Switch to Takeaway"),ProductScreen.clickControlButton("Switch to Dine in"),ProductScreen.clickDisplayedProduct("Coca-Cola"),ProductScreen.clickDisplayedProduct("Coca-Cola"),ProductScreen.clickDisplayedProduct("Coca-Cola"),Chrome.clickPlanButton(),Chrome.activeTableOrOrderIs("Table"),FloorScreen.clickTable("5"),ProductScreen.orderBtnIsPresent(),Chrome.isTabActive("5"),ProductScreen.clickDisplayedProduct("Coca-Cola",true),inLeftSide(Order.hasLine({productName:"Coca-Cola",run:"dblclick"})),ProductScreen.clickDisplayedProduct("Water",true),ProductScreen.orderlineIsToOrder("Water"),ProductScreen.orderlineIsToSkip("Coca-Cola"),checkOrderChanges([{name:"Water",quantity:1}]),ProductScreen.clickOrderButton(),{...Dialog.confirm(),content:"acknowledge printing error ( because we don't have printer in the test. )",},ProductScreen.orderlinesHaveNoChange(),checkOrderChanges([]),ProductScreen.totalAmountIs("4.40"),Chrome.clickPlanButton(),FloorScreen.clickTable("2"),ProductScreen.clickDisplayedProduct("Coca-Cola",true),ProductScreen.clickDisplayedProduct("Minute Maid",true),ProductScreen.totalAmountIs("4.40"),checkOrderChanges([{name:"Coca-Cola",quantity:1},{name:"Minute Maid",quantity:1},]),ProductScreen.clickPayButton(),PaymentScreen.clickPaymentMethod("Cash"),PaymentScreen.clickValidate(),ReceiptScreen.clickNextOrder(),Chrome.activeTableOrOrderIs("Table"),FloorScreen.orderCountSyncedInTableIs("5","1"),FloorScreen.clickTable("4"),ProductScreen.orderBtnIsPresent(),ProductScreen.clickDisplayedProduct("Desk Organizer",false),{...Dialog.confirm(),content:"validate the variant dialog (with default values)",},ProductScreen.selectedOrderlineHas("Desk Organizer"),checkOrderChanges([{name:"Desk Organizer (Leather, S)",quantity:1}]),ProductScreen.clickOrderButton(),{...Dialog.confirm(),content:"acknowledge printing error ( because we don't have printer in the test. )",},ProductScreen.orderlinesHaveNoChange(),checkOrderChanges([]),ProductScreen.totalAmountIs("5.87"),ProductScreen.clickPayButton(),PaymentScreen.clickPaymentMethod("Bank"),PaymentScreen.clickValidate(),ReceiptScreen.clickNextOrder(),FloorScreen.orderCountSyncedInTableIs("5","1"),FloorScreen.clickTable("5"),ProductScreen.totalAmountIs("4.40"),Chrome.clickPlanButton(),FloorScreen.clickTable("2"),ProductScreen.clickDisplayedProduct("Coca-Cola",true),ProductScreen.clickDisplayedProduct("Minute Maid",true),Chrome.clickPlanButton(),FloorScreen.orderCountSyncedInTableIs("5","1"),Chrome.clickMenuOption("Orders"),TicketScreen.deleteOrder("Main Floor/2"),Dialog.confirm(),Chrome.isSyncStatusConnected(),TicketScreen.selectOrder("Main Floor/5"),TicketScreen.loadSelectedOrder(),ProductScreen.isShown(),Chrome.clickPlanButton(),FloorScreen.clickTable("2"),ProductScreen.orderIsEmpty(),].flat(),});registry.category("web_tour.tours").add("pos_restaurant_sync_second_login",{steps:()=>[Chrome.startPoS(),FloorScreen.clickTable("5"),ProductScreen.totalAmountIs("4.40"),ProductScreen.clickControlButton("Transfer"),{trigger:".table:contains(4)",async run(helpers){await delay(500);await helpers.click();},},Chrome.activeTableOrOrderIs("4"),ProductScreen.totalAmountIs("4.40"),ProductScreen.clickDisplayedProduct("Water"),ProductScreen.totalAmountIs("6.60"),ProductScreen.clickNumpad("1"),ProductScreen.totalAmountIs("4.40"),ProductScreen.clickPayButton(),PaymentScreen.clickPaymentMethod("Cash"),PaymentScreen.clickValidate(),ReceiptScreen.clickNextOrder(),{trigger:".table:contains(2)",async run(helpers){await delay(500);await helpers.click();},},Chrome.activeTableOrOrderIs("2"),ProductScreen.isShown(),ProductScreen.orderIsEmpty(),ProductScreen.clickControlButton("Transfer"),{trigger:".table:contains(4)",async run(helpers){await delay(500);await helpers.click();},},Chrome.activeTableOrOrderIs("4"),ProductScreen.clickDisplayedProduct("Coca-Cola"),ProductScreen.totalAmountIs("2.20"),Chrome.clickPlanButton(),FloorScreen.orderCountSyncedInTableIs("4","1"),].flat(),});registry.category("web_tour.tours").add("SaveLastPreparationChangesTour",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),FloorScreen.clickTable("5"),ProductScreen.clickDisplayedProduct("Coca-Cola",true,"1.0"),ProductScreen.orderlineIsToOrder("Coca-Cola"),ProductScreen.clickOrderButton(),Chrome.waitRequest(),ProductScreen.orderlinesHaveNoChange(),Order.hasLine({productName:"Coca-Cola",quantity:1,withClass:":eq(0)",}),Chrome.clickPlanButton(),FloorScreen.hasTable("2"),FloorScreen.hasTable("4"),FloorScreen.hasTable("5"),].flat(),});const billScreenQRCodeData=[{content:"Unique code is shown",trigger:".pos-receipt .unique-code",},{content:"Portal url is shown",trigger:".pos-receipt .portal-url",},];registry.category("web_tour.tours").add("BillScreenTour",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),FloorScreen.clickTable("5"),ProductScreen.clickDisplayedProduct("Coca-Cola"),ProductScreen.clickControlButton("Bill"),billScreenQRCodeData.map(negateStep),BillScreen.closeBillPopup(),ProductScreen.clickPayButton(),PaymentScreen.clickPaymentMethod("Bank"),PaymentScreen.clickValidate(),...billScreenQRCodeData,].flat(),});registry.category("web_tour.tours").add("OrderTrackingTour",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),FloorScreen.clickTable("5"),ProductScreen.clickDisplayedProduct("Coca-Cola"),ProductScreen.clickDisplayedProduct("Coca-Cola",true,"2.0"),Chrome.clickPlanButton(),FloorScreen.clickTable("5"),inLeftSide([...ProductScreen.clickLine("Coca-Cola","2.0"),...ProductScreen.selectedOrderlineHasDirect("Coca-Cola","2.0"),...["⌫","1"].map(Numpad.click),...ProductScreen.selectedOrderlineHasDirect("Coca-Cola","1.0"),]),ProductScreen.clickPayButton(),PaymentScreen.clickPaymentMethod("Bank"),PaymentScreen.clickValidate(),ReceiptScreen.isShown(),].flat(),});registry.category("web_tour.tours").add("CategLabelCheck",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),FloorScreen.clickTable("5"),ProductScreen.clickDisplayedProduct("Test Multi Category Product"),ProductScreen.OrderButtonNotContain("Drinks"),].flat(),});registry.category("web_tour.tours").add("OrderChange",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),FloorScreen.clickTable("5"),ProductScreen.clickDisplayedProduct("Coca-Cola",true,"1.0"),ProductScreen.clickOrderButton(),{...Dialog.confirm(),content:"acknowledge printing error ( because we don't have printer in the test. )",},ProductScreen.orderlinesHaveNoChange(),ProductScreen.clickPayButton(),PaymentScreen.clickPaymentMethod("Cash"),PaymentScreen.clickNumpad("+10"),PaymentScreen.clickValidate(),ReceiptScreen.isShown(),TicketScreen.receiptChangeIs("7.80"),].flat(),});registry.category("web_tour.tours").add("CrmTeamTour",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),FloorScreen.clickTable("5"),ProductScreen.clickDisplayedProduct("Coca-Cola"),Chrome.clickPlanButton(),FloorScreen.clickTable("5"),Chrome.clickPlanButton(),].flat(),});registry.category("web_tour.tours").add("PoSPaymentSyncTour1",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),FloorScreen.clickTable("5"),ProductScreen.clickDisplayedProduct("Coca-Cola"),ProductScreen.totalAmountIs("2.20"),ProductScreen.clickPayButton(),PaymentScreen.emptyPaymentlines("2.20"),PaymentScreen.clickPaymentMethod("Bank"),PaymentScreen.clickBackToProductScreen(),ProductScreen.isShown(),ProductScreen.clickOrderButton(),ProductScreen.orderlinesHaveNoChange(),Chrome.clickPlanButton(),].flat(),});registry.category("web_tour.tours").add("PoSPaymentSyncTour2",{steps:()=>[Chrome.startPoS(),FloorScreen.clickTable("5"),PaymentScreen.isShown(),PaymentScreen.clickBackToProductScreen(),ProductScreen.isShown(),ProductScreen.clickDisplayedProduct("Coca-Cola"),ProductScreen.totalAmountIs("4.40"),ProductScreen.clickPayButton(),PaymentScreen.clickPaymentlineDelButton("Bank","2.20"),PaymentScreen.emptyPaymentlines("4.40"),PaymentScreen.clickPaymentMethod("Bank"),PaymentScreen.clickBackToProductScreen(),ProductScreen.isShown(),ProductScreen.clickOrderButton(),ProductScreen.orderlinesHaveNoChange(),Chrome.clickPlanButton(),].flat(),});registry.category("web_tour.tours").add("PoSPaymentSyncTour3",{steps:()=>[Chrome.startPoS(),FloorScreen.clickTable("5"),PaymentScreen.isShown(),PaymentScreen.clickBackToProductScreen(),ProductScreen.isShown(),ProductScreen.clickDisplayedProduct("Coca-Cola"),ProductScreen.totalAmountIs("6.60"),ProductScreen.clickPayButton(),PaymentScreen.remainingIs("2.2"),PaymentScreen.clickPaymentMethod("Bank"),PaymentScreen.clickBackToProductScreen(),ProductScreen.isShown(),ProductScreen.clickOrderButton(),ProductScreen.orderlinesHaveNoChange(),Chrome.clickPlanButton(),].flat(),});registry.category("web_tour.tours").add("PreparationPrinterContent",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),FloorScreen.clickTable("5"),ProductScreen.clickDisplayedProduct("Product Test"),Chrome.freezeDateTime(1739370000000),Dialog.confirm("Add"),ProductScreen.totalAmountIs("10"),{content:"Check if order preparation contains always Variant",trigger:"body",run:async()=>{const order=posmodel.get_order();const data=posmodel.getOrderChanges();const changes=Object.values(data.orderlines);const printed=await posmodel.getRenderedReceipt(order,"New",changes);if(!printed.innerHTML.includes("Product Test (Value 1)")){throw new Error("Product Test (Value 1) not found in printed receipt");}
const receiptHeader=printed.querySelector(".receipt-header");if(!receiptHeader.innerHTML.includes("14:20")){throw new Error("Expected timestamp '14:20' not found in the printed receipt header");}},},].flat(),});registry.category("web_tour.tours").add("ComboSortedPreparationReceiptTour",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),FloorScreen.clickTable("5"),ProductScreen.clickDisplayedProduct("Office Combo"),combo.select("Combo Product 2"),combo.select("Combo Product 4"),combo.select("Combo Product 6"),Dialog.confirm(),ProductScreen.clickDisplayedProduct("Office Combo"),combo.select("Combo Product 1"),combo.select("Combo Product 5"),combo.select("Combo Product 8"),Dialog.confirm(),{content:"Check if order preparation has product correctly ordered",trigger:"body",run:async()=>{const order=posmodel.get_order();const data=posmodel.getOrderChanges();const changes=Object.values(data.orderlines);const printed=await posmodel.getRenderedReceipt(order,"New",changes);const orderLines=[...printed.querySelectorAll(".orderline")];const orderLinesInnerText=orderLines.map((orderLine)=>orderLine.innerText);const expectedOrderLines=["Office Combo","Combo Product 2","Combo Product 4","Combo Product 6","Office Combo","Combo Product 1","Combo Product 5","Combo Product 8",];for(let i=0;i<orderLinesInnerText.length;i++){if(!orderLinesInnerText[i].includes(expectedOrderLines[i])){throw new Error("Order line mismatch");}}},},ProductScreen.totalAmountIs("95.00"),ProductScreen.clickPayButton(),].flat(),});registry.category("web_tour.tours").add("TableTransferPreparationChange1",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),FloorScreen.clickTable("5"),ProductScreen.clickDisplayedProduct("Product Test"),ProductScreen.clickOrderButton(),Dialog.confirm(),ProductScreen.orderlinesHaveNoChange("Product Test"),Chrome.clickPlanButton(),FloorScreen.clickTable("4"),ProductScreen.clickDisplayedProduct("Product Test"),ProductScreen.clickOrderButton(),Dialog.confirm(),ProductScreen.orderlinesHaveNoChange("Product Test"),ProductScreen.clickControlButton("Transfer"),FloorScreen.clickTable("5"),ProductScreen.orderlinesHaveNoChange("Product Test"),ProductScreen.orderLineHas("Product Test","2"),ProductScreen.clickPayButton(),PaymentScreen.clickPaymentMethod("Cash"),PaymentScreen.clickValidate(),].flat(),});registry.category("web_tour.tours").add("TableTransferPreparationChange2",{steps:()=>[Chrome.startPoS(),FloorScreen.clickTable("5"),ProductScreen.clickDisplayedProduct("Product Test"),ProductScreen.orderlineIsToOrder("Product Test"),Chrome.clickPlanButton(),FloorScreen.clickTable("4"),ProductScreen.clickDisplayedProduct("Product Test"),ProductScreen.clickOrderButton(),Dialog.confirm(),ProductScreen.orderlinesHaveNoChange("Product Test"),ProductScreen.clickControlButton("Transfer"),FloorScreen.clickTable("5"),ProductScreen.orderlineIsToOrder("Product Test"),ProductScreen.orderLineHas("Product Test","2"),ProductScreen.clickPayButton(),PaymentScreen.clickPaymentMethod("Cash"),PaymentScreen.clickValidate(),Chrome.clickPlanButton(),].flat(),});registry.category("web_tour.tours").add("TableTransferPreparationChange3",{steps:()=>[Chrome.startPoS(),FloorScreen.clickTable("5"),ProductScreen.clickDisplayedProduct("Product Test"),ProductScreen.clickOrderButton(),Dialog.confirm(),ProductScreen.clickControlButton("Transfer"),FloorScreen.clickTable("4"),ProductScreen.orderlinesHaveNoChange("Product Test"),ProductScreen.orderLineHas("Product Test","1"),ProductScreen.clickPayButton(),PaymentScreen.clickPaymentMethod("Cash"),PaymentScreen.clickValidate(),Chrome.clickPlanButton(),].flat(),});registry.category("web_tour.tours").add("TableTransferPreparationChange4",{steps:()=>[Chrome.startPoS(),FloorScreen.clickTable("5"),ProductScreen.clickDisplayedProduct("Product Test"),ProductScreen.orderlineIsToOrder("Product Test"),Chrome.clickPlanButton(),FloorScreen.clickTable("4"),ProductScreen.clickDisplayedProduct("Product Test"),ProductScreen.orderlineIsToOrder("Product Test"),ProductScreen.clickControlButton("Transfer"),FloorScreen.hasTable("5"),FloorScreen.clickTable("5"),ProductScreen.orderLineHas("Product Test","2"),ProductScreen.orderlineIsToOrder("Product Test"),ProductScreen.clickPayButton(),PaymentScreen.clickPaymentMethod("Cash"),PaymentScreen.clickValidate(),Chrome.clickPlanButton(),FloorScreen.clickTable("4"),ProductScreen.orderIsEmpty(),].flat(),});registry.category("web_tour.tours").add("TableTransferPreparationChange5",{steps:()=>[Chrome.startPoS(),FloorScreen.clickTable("5"),ProductScreen.clickDisplayedProduct("Product Test"),ProductScreen.orderLineHas("Product Test","1"),ProductScreen.clickOrderButton(),Dialog.confirm(),ProductScreen.orderlinesHaveNoChange("Product Test"),Chrome.clickPlanButton(),FloorScreen.clickTable("4"),ProductScreen.clickDisplayedProduct("Product Test"),ProductScreen.orderLineHas("Product Test","1"),ProductScreen.orderlineIsToOrder("Product Test"),ProductScreen.clickControlButton("Transfer"),FloorScreen.clickTable("5"),ProductScreen.orderlineIsToOrder("Product Test"),ProductScreen.orderLineHas("Product Test","2"),ProductScreen.clickPayButton(),PaymentScreen.clickPaymentMethod("Cash"),PaymentScreen.clickValidate(),Chrome.clickPlanButton(),].flat(),});registry.category("web_tour.tours").add("TableTransferPreparationChange6",{steps:()=>[Chrome.startPoS(),FloorScreen.clickTable("5"),ProductScreen.clickDisplayedProduct("Product Test"),ProductScreen.clickControlButton("Transfer"),FloorScreen.clickTable("4"),ProductScreen.orderlineIsToOrder("Product Test"),ProductScreen.orderLineHas("Product Test","1"),].flat(),});registry.category("web_tour.tours").add("MultiPreparationPrinter",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),FloorScreen.clickTable("5"),ProductScreen.clickDisplayedProduct("Product 1"),ProductScreen.clickOrderButton(),Dialog.bodyIs("Failed in printing Detailed Receipt changes of the order"),Dialog.confirm(),].flat(),});registry.category("web_tour.tours").add("LeaveResidualOrder",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),FloorScreen.clickTable("5"),ProductScreen.clickDisplayedProduct("Coca-Cola"),ProductScreen.totalAmountIs("2.20"),ProductScreen.clickPayButton(),PaymentScreen.clickPaymentMethod("Bank"),PaymentScreen.clickValidate(),ReceiptScreen.clickNextOrder(),FloorScreen.clickTable("5"),ProductScreen.clickDisplayedProduct("Coca-Cola"),Chrome.clickPlanButton(),FloorScreen.hasTable("2"),FloorScreen.hasTable("4"),FloorScreen.hasTable("5"),].flat(),});registry.category("web_tour.tours").add("FinishResidualOrder",{steps:()=>[Chrome.startPoS(),FloorScreen.orderCountSyncedInTableIs("5","1"),FloorScreen.clickTable("5"),Order.hasLine({productName:"Coca-Cola",quantity:1,withClass:":eq(0)",}),ProductScreen.totalAmountIs("2.20"),ProductScreen.clickPayButton(),PaymentScreen.clickPaymentMethod("Bank"),PaymentScreen.clickValidate(),ReceiptScreen.clickNextOrder(),].flat(),});registry.category("web_tour.tours").add("test_combo_preparation_receipt_layout",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),FloorScreen.clickTable("5"),ProductScreen.clickDisplayedProduct("Office Combo"),combo.select("Combo Product 2"),combo.select("Combo Product 4"),combo.select("Combo Product 6"),Dialog.confirm(),{trigger:".actionpad .submit-order.highlight.btn-primary",},{content:"Check if order preparation has product correctly ordered",trigger:"body",run:async()=>{const order=posmodel.get_order();const data=posmodel.getOrderChanges();const changes=Object.values(data.orderlines);const printed=await posmodel.getRenderedReceipt(order,"New",changes);const comboItemLines=[...printed.querySelectorAll(".orderline.mx-5")].map((el)=>el.innerText);const expectedComboItemLines=["1 Combo Product 2","1 Combo Product 4","1 Combo Product 6",];if(comboItemLines.length!==expectedComboItemLines.length||!comboItemLines.every((line,index)=>line.includes(expectedComboItemLines[index]))){throw new Error("Order line mismatch");}},},].flat(),});registry.category("web_tour.tours").add("test_book_and_release_table",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),FloorScreen.clickTable("5"),ProductScreen.bookOrReleaseTable(),FloorScreen.isShown(),waitForLoading(),{content:"Check if order has a server ID",trigger:"body",run:()=>{const order=posmodel.models["pos.order"].getFirst();if(typeof order.id!=="number"){throw new Error("Order does not have a valid server ID");}},},FloorScreen.clickTable("5"),ProductScreen.bookOrReleaseTable(),waitForLoading(),].flat(),});registry.category("web_tour.tours").add("test_combo_synchronisation",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),FloorScreen.clickTable("5"),ProductScreen.clickDisplayedProduct("Office Combo"),combo.select("Combo Product 2"),combo.select("Combo Product 4"),combo.select("Combo Product 6"),Dialog.confirm(),Chrome.clickPlanButton(),FloorScreen.clickTable("5"),ProductScreen.clickPartnerButton(),ProductScreen.clickCustomer("A"),Chrome.clickPlanButton(),FloorScreen.hasTable("5"),FloorScreen.clickTable("5"),{content:"Check if there still has combo lines",trigger:".orderline-combo",},].flat(),});registry.category("web_tour.tours").add("test_reload_order_line_removed",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),FloorScreen.clickTable("5"),ProductScreen.clickDisplayedProduct("Coca-Cola"),Chrome.clickPlanButton(),FloorScreen.clickTable("5"),inLeftSide([...ProductScreen.clickLine("Coca-Cola"),Numpad.click("⌫"),Numpad.click("⌫"),...Order.doesNotHaveLine(),]),refresh(),FloorScreen.clickTable("5"),inLeftSide(Order.hasLine({productName:"Coca-Cola",quantity:1})),].flat(),});registry.category("web_tour.tours").add("test_combo_children_qty_updated_with_note",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),FloorScreen.clickTable("5"),ProductScreen.clickDisplayedProduct("Office Combo"),combo.select("Combo Product 2"),combo.select("Combo Product 4"),combo.select("Combo Product 6"),Dialog.confirm(),ProductScreen.clickOrderButton(),ProductScreen.clickNumpad("3"),ProductScreen.clickInternalNoteButton(),TextInputPopup.inputText("test note"),Dialog.confirm(),combo.select("Combo Product 2"),combo.select("Combo Product 4"),combo.select("Combo Product 6"),Dialog.confirm(),Order.doesNotHaveLine({productName:"Office Combo",quantity:1,internalNote:"test note",}),Order.hasLine({productName:"Combo Product 2",quantity:1}),Order.hasLine({productName:"Combo Product 4",quantity:1}),Order.hasLine({productName:"Combo Product 6",quantity:1}),Order.hasLine({productName:"Office Combo",quantity:2,internalNote:"test note",}),Order.hasLine({productName:"Combo Product 2",quantity:2}),Order.hasLine({productName:"Combo Product 4",quantity:2}),Order.hasLine({productName:"Combo Product 6",quantity:2}),].flat(),});return __exports;});;

/* /pos_restaurant/static/tests/tours/refund_tour.js */
odoo.define('@pos_restaurant/../tests/tours/refund_tour',['@point_of_sale/../tests/tours/utils/product_screen_util','@pos_restaurant/../tests/tours/utils/product_screen_util','@point_of_sale/../tests/tours/utils/dialog_util','@point_of_sale/../tests/tours/utils/payment_screen_util','@point_of_sale/../tests/tours/utils/receipt_screen_util','@pos_restaurant/../tests/tours/utils/floor_screen_util','@point_of_sale/../tests/tours/utils/ticket_screen_util','@point_of_sale/../tests/tours/utils/chrome_util','@point_of_sale/../tests/tours/utils/generic_components/order_widget_util','@web/core/registry','@point_of_sale/../tests/tours/utils/common'],function(require){'use strict';let __exports={};const ProductScreenPos=require("@point_of_sale/../tests/tours/utils/product_screen_util");const ProductScreenResto=require("@pos_restaurant/../tests/tours/utils/product_screen_util");const ProductScreen={...ProductScreenPos,...ProductScreenResto};const Dialog=require("@point_of_sale/../tests/tours/utils/dialog_util");const PaymentScreen=require("@point_of_sale/../tests/tours/utils/payment_screen_util");const ReceiptScreen=require("@point_of_sale/../tests/tours/utils/receipt_screen_util");const FloorScreen=require("@pos_restaurant/../tests/tours/utils/floor_screen_util");const TicketScreen=require("@point_of_sale/../tests/tours/utils/ticket_screen_util");const Chrome=require("@point_of_sale/../tests/tours/utils/chrome_util");const Order=require("@point_of_sale/../tests/tours/utils/generic_components/order_widget_util");const{registry}=require("@web/core/registry");const{inLeftSide}=require("@point_of_sale/../tests/tours/utils/common");registry.category("web_tour.tours").add("RefundStayCurrentTableTour",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),FloorScreen.clickTable("2"),ProductScreen.clickDisplayedProduct("Coca-Cola",true,"1.0"),ProductScreen.clickDisplayedProduct("Coca-Cola",true,"2.0"),ProductScreen.clickDisplayedProduct("Water",true,"1.0"),ProductScreen.totalAmountIs("6.60"),ProductScreen.clickPayButton(),PaymentScreen.clickPaymentMethod("Cash"),PaymentScreen.clickValidate(),ReceiptScreen.clickNextOrder(),FloorScreen.clickTable("4"),ProductScreen.orderIsEmpty(),...ProductScreen.clickRefund(),TicketScreen.selectOrder("-0001"),Order.hasLine({productName:"Coca-Cola",}),ProductScreen.clickNumpad("2"),TicketScreen.toRefundTextContains("To Refund: 2.00"),TicketScreen.confirmRefund(),ProductScreen.isShown(),inLeftSide(ProductScreen.orderLineHas("Coca-Cola")),ProductScreen.totalAmountIs("-4.40"),].flat(),});registry.category("web_tour.tours").add("RefundQtyTour",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),FloorScreen.clickTable("2"),ProductScreen.clickDisplayedProduct("Coca-Cola",true,"1.0"),ProductScreen.clickDisplayedProduct("Coca-Cola",true,"2.0"),ProductScreen.clickDisplayedProduct("Water",true,"1.0"),ProductScreen.totalAmountIs("6.60"),ProductScreen.clickPayButton(),PaymentScreen.clickPaymentMethod("Cash"),PaymentScreen.clickValidate(),ReceiptScreen.clickNextOrder(),Chrome.clickMenuOption("Orders"),TicketScreen.selectFilter("Paid"),TicketScreen.selectOrder("-0001"),Order.hasLine({productName:"Coca-Cola",}),ProductScreen.clickNumpad("2"),TicketScreen.toRefundTextContains("To Refund: 2.00"),TicketScreen.confirmRefund(),ProductScreen.isShown(),inLeftSide(ProductScreen.orderLineHas("Coca-Cola")),ProductScreen.totalAmountIs("-4.40"),ProductScreen.clickPayButton(),PaymentScreen.clickPaymentMethod("Cash"),PaymentScreen.clickValidate(),ReceiptScreen.clickNextOrder(),Chrome.clickMenuOption("Orders"),TicketScreen.selectFilter("Paid"),TicketScreen.selectOrder("-0001"),TicketScreen.refundedNoteContains("2.00 Refunded"),].flat(),});return __exports;});;

/* /pos_restaurant/static/tests/tours/split_bill_screen_tour.js */
odoo.define('@pos_restaurant/../tests/tours/split_bill_screen_tour',['@point_of_sale/../tests/tours/utils/payment_screen_util','@point_of_sale/../tests/tours/utils/dialog_util','@point_of_sale/../tests/tours/utils/receipt_screen_util','@point_of_sale/../tests/tours/utils/chrome_util','@pos_restaurant/../tests/tours/utils/chrome','@pos_restaurant/../tests/tours/utils/floor_screen_util','@point_of_sale/../tests/tours/utils/generic_components/order_widget_util','@point_of_sale/../tests/tours/utils/product_screen_util','@pos_restaurant/../tests/tours/utils/product_screen_util','@pos_restaurant/../tests/tours/utils/split_bill_screen_util','@point_of_sale/../tests/tours/utils/ticket_screen_util','@point_of_sale/../tests/tours/utils/combo_popup_util','@web/core/registry'],function(require){'use strict';let __exports={};const PaymentScreen=require("@point_of_sale/../tests/tours/utils/payment_screen_util");const Dialog=require("@point_of_sale/../tests/tours/utils/dialog_util");const ReceiptScreen=require("@point_of_sale/../tests/tours/utils/receipt_screen_util");const ChromePos=require("@point_of_sale/../tests/tours/utils/chrome_util");const ChromeRestaurant=require("@pos_restaurant/../tests/tours/utils/chrome");const Chrome={...ChromePos,...ChromeRestaurant};const FloorScreen=require("@pos_restaurant/../tests/tours/utils/floor_screen_util");const Order=require("@point_of_sale/../tests/tours/utils/generic_components/order_widget_util");const ProductScreenPos=require("@point_of_sale/../tests/tours/utils/product_screen_util");const ProductScreenResto=require("@pos_restaurant/../tests/tours/utils/product_screen_util");const ProductScreen={...ProductScreenPos,...ProductScreenResto};const SplitBillScreen=require("@pos_restaurant/../tests/tours/utils/split_bill_screen_util");const TicketScreen=require("@point_of_sale/../tests/tours/utils/ticket_screen_util");const combo=require("@point_of_sale/../tests/tours/utils/combo_popup_util");const{registry}=require("@web/core/registry");registry.category("web_tour.tours").add("SplitBillScreenTour",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),FloorScreen.clickTable("2"),ProductScreen.addOrderline("Water","5","2","10.0"),ProductScreen.addOrderline("Minute Maid","3","2","6.0"),ProductScreen.addOrderline("Coca-Cola","1","2","2.0"),ProductScreen.clickControlButton("Split"),SplitBillScreen.orderlineHas("Water","5","0"),SplitBillScreen.orderlineHas("Minute Maid","3","0"),SplitBillScreen.orderlineHas("Coca-Cola","1","0"),SplitBillScreen.clickOrderline("Water"),SplitBillScreen.orderlineHas("Water","5","1"),SplitBillScreen.clickOrderline("Water"),SplitBillScreen.clickOrderline("Water"),SplitBillScreen.orderlineHas("Water","5","3"),SplitBillScreen.subtotalIs("6.0"),SplitBillScreen.clickOrderline("Coca-Cola"),SplitBillScreen.orderlineHas("Coca-Cola","1","1"),SplitBillScreen.subtotalIs("8.0"),SplitBillScreen.clickPay(),Chrome.activeTableOrOrderIs("2B"),ProductScreen.totalAmountIs("8.0"),ProductScreen.clickOrderline("Water","3.0"),ProductScreen.clickOrderline("Coca-Cola","1.0"),Chrome.clickMenuOption("Orders"),TicketScreen.selectOrder("-0001"),TicketScreen.loadSelectedOrder(),ProductScreen.isShown(),ProductScreen.clickOrderline("Water","2.0"),ProductScreen.clickOrderline("Minute Maid","3.0"),Chrome.clickPlanButton(),FloorScreen.clickTable("2"),ProductScreen.clickControlButton("Split"),SplitBillScreen.clickOrderline("Water"),SplitBillScreen.orderlineHas("Water","2","1"),SplitBillScreen.subtotalIs("2.0"),SplitBillScreen.clickOrderline("Minute Maid"),SplitBillScreen.orderlineHas("Minute Maid","3","1"),SplitBillScreen.subtotalIs("4.0"),SplitBillScreen.clickPay(),Chrome.activeTableOrOrderIs("2C"),Chrome.clickMenuOption("Orders"),TicketScreen.selectOrder("-0001"),TicketScreen.loadSelectedOrder(),ProductScreen.isShown(),ProductScreen.clickOrderline("Water","1.0"),ProductScreen.clickOrderline("Minute Maid","2.0"),].flat(),});registry.category("web_tour.tours").add("SplitBillScreenTour2",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),FloorScreen.clickTable("2"),ProductScreen.addOrderline("Water","1","2.0"),ProductScreen.addOrderline("Minute Maid","1","2.0"),ProductScreen.addOrderline("Coca-Cola","1","2.0"),Chrome.clickPlanButton(),FloorScreen.clickTable("2"),Chrome.isSynced(),ProductScreen.clickControlButton("Split"),SplitBillScreen.clickOrderline("Water"),SplitBillScreen.orderlineHas("Water","1","1"),SplitBillScreen.clickOrderline("Coca-Cola"),SplitBillScreen.orderlineHas("Coca-Cola","1","1"),SplitBillScreen.clickPay(),PaymentScreen.clickBack(),Chrome.clickMenuOption("Orders"),TicketScreen.selectOrder("-0002"),TicketScreen.loadSelectedOrder(),Order.hasLine({productName:"Coca-Cola",quantity:"1.0"}),Order.hasLine({productName:"Water",quantity:"1.0"}),ProductScreen.totalAmountIs("4.00"),Chrome.clickMenuOption("Orders"),TicketScreen.selectOrder("-0001"),TicketScreen.loadSelectedOrder(),Order.hasLine({productName:"Minute Maid",quantity:"1.0"}),ProductScreen.totalAmountIs("2.00"),].flat(),});registry.category("web_tour.tours").add("SplitBillScreenTour3",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),FloorScreen.clickTable("2"),ProductScreen.addOrderline("Water","2","2","4.00"),ProductScreen.clickControlButton("Split"),SplitBillScreen.orderlineHas("Water","2","0"),SplitBillScreen.clickOrderline("Water"),SplitBillScreen.orderlineHas("Water","2","1"),SplitBillScreen.subtotalIs("2.0"),SplitBillScreen.clickPay(),ProductScreen.totalAmountIs("2.0"),ProductScreen.clickPayButton(),PaymentScreen.clickPaymentMethod("Bank"),PaymentScreen.clickValidate(),ReceiptScreen.clickContinueOrder(),ProductScreen.isShown(),ProductScreen.orderLineHas("Water","1.0"),ProductScreen.clickPayButton(),PaymentScreen.clickPaymentMethod("Bank"),PaymentScreen.clickValidate(),ReceiptScreen.clickNextOrder(),].flat(),});registry.category("web_tour.tours").add("SplitBillScreenTour4ProductCombo",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),FloorScreen.clickTable("2"),ProductScreen.clickDisplayedProduct("Office Combo"),combo.select("Combo Product 3"),combo.select("Combo Product 5"),combo.select("Combo Product 8"),Dialog.confirm(),...ProductScreen.clickDisplayedProduct("Office Combo"),combo.select("Combo Product 2"),combo.select("Combo Product 4"),combo.select("Combo Product 7"),Dialog.confirm(),ProductScreen.clickOrderline("Combo Product 2"),ProductScreen.clickNumpad("2"),ProductScreen.selectedOrderlineHas("Combo Product 2","2"),ProductScreen.addOrderline("Water","1"),ProductScreen.addOrderline("Minute Maid","1"),ProductScreen.clickControlButton("Split"),SplitBillScreen.clickOrderline("Water"),SplitBillScreen.clickOrderline("Combo Product 3"),SplitBillScreen.clickOrderline("Combo Product 2"),SplitBillScreen.orderlineHas("Water","1","1"),SplitBillScreen.orderlineHas("Office Combo","1","1"),SplitBillScreen.orderlineHas("Combo Product 3","1","1"),SplitBillScreen.orderlineHas("Combo Product 5","1","1"),SplitBillScreen.orderlineHas("Combo Product 8","1","1"),SplitBillScreen.orderlineHas("Office Combo","2","1"),SplitBillScreen.orderlineHas("Combo Product 2","2","0"),SplitBillScreen.orderlineHas("Combo Product 4","2","0"),SplitBillScreen.orderlineHas("Combo Product 7","2","0"),...SplitBillScreen.subtotalIs("97.14"),...SplitBillScreen.clickPay(),ProductScreen.totalAmountIs("97.13"),ProductScreen.clickPayButton(),...PaymentScreen.clickPaymentMethod("Bank"),...PaymentScreen.clickValidate(),...ReceiptScreen.clickContinueOrder(),...ProductScreen.isShown(),...ProductScreen.orderLineHas("Minute Maid","1.0"),...ProductScreen.clickOrderline("Office Combo"),...ProductScreen.clickOrderline("Combo Product 2"),...ProductScreen.selectedOrderlineHas("Combo Product 2","1.0","6.67","Office Combo"),...ProductScreen.clickOrderline("Combo Product 4"),...ProductScreen.selectedOrderlineHas("Combo Product 4","1.0","14.66","Office Combo"),...ProductScreen.clickOrderline("Combo Product 7"),...ProductScreen.selectedOrderlineHas("Combo Product 7","1.0","22.00","Office Combo"),...ProductScreen.totalAmountIs("45.53"),].flat(),});return __exports;});;

/* /pos_restaurant/static/tests/tours/ticket_screen_tour.js */
odoo.define('@pos_restaurant/../tests/tours/ticket_screen_tour',['@point_of_sale/../tests/tours/utils/product_screen_util','@pos_restaurant/../tests/tours/utils/product_screen_util','@point_of_sale/../tests/tours/utils/dialog_util','@pos_restaurant/../tests/tours/utils/floor_screen_util','@point_of_sale/../tests/tours/utils/ticket_screen_util','@point_of_sale/../tests/tours/utils/chrome_util','@web/core/registry','@pos_restaurant/../tests/tours/utils/devices_synchronization'],function(require){'use strict';let __exports={};const ProductScreenPos=require("@point_of_sale/../tests/tours/utils/product_screen_util");const ProductScreenResto=require("@pos_restaurant/../tests/tours/utils/product_screen_util");const ProductScreen={...ProductScreenPos,...ProductScreenResto};const Dialog=require("@point_of_sale/../tests/tours/utils/dialog_util");const FloorScreen=require("@pos_restaurant/../tests/tours/utils/floor_screen_util");const TicketScreen=require("@point_of_sale/../tests/tours/utils/ticket_screen_util");const Chrome=require("@point_of_sale/../tests/tours/utils/chrome_util");const{registry}=require("@web/core/registry");const DeviceSynchronization=require("@pos_restaurant/../tests/tours/utils/devices_synchronization");registry.category("web_tour.tours").add("PosResTicketScreenTour",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),Chrome.clickMenuOption("Orders"),TicketScreen.noNewTicketButton(),TicketScreen.clickDiscard(),FloorScreen.clickTable("5"),ProductScreen.addOrderline("Minute Maid","1","3"),ProductScreen.totalAmountIs("3.0"),Chrome.clickPlanButton(),FloorScreen.orderCountSyncedInTableIs("5","1"),Chrome.clickMenuOption("Orders"),TicketScreen.deleteOrder("-0001"),Dialog.confirm(),Chrome.clickPlanButton(),FloorScreen.isShown(),FloorScreen.clickTable("5"),ProductScreen.orderIsEmpty(),].flat(),});registry.category("web_tour.tours").add("OrderNumberConflictTour",{steps:()=>[Chrome.startPoS(),FloorScreen.clickTable("3"),ProductScreen.isShown(),ProductScreen.addOrderline("Coca-Cola","1","3"),Chrome.clickPlanButton(),Chrome.clickMenuOption("Orders"),TicketScreen.nthColumnContains(1,2,"Order"),TicketScreen.nthColumnContains(1,3,"1"),TicketScreen.nthColumnContains(2,2,"Self-Order"),TicketScreen.nthColumnContains(2,3,"S"),TicketScreen.nthColumnContains(2,3,"1"),].flat(),});registry.category("web_tour.tours").add("test_cancel_order_from_ui",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),FloorScreen.clickTable("5"),ProductScreen.isShown(),ProductScreen.addOrderline("Coca-Cola","1","3"),Chrome.clickPlanButton(),Chrome.isSynced(),FloorScreen.isShown(),FloorScreen.clickTable("5"),ProductScreen.clickReview(),ProductScreen.clickControlButton("Cancel Order"),Dialog.confirm(),FloorScreen.isShown(),Chrome.clickMenuOption("Orders"),TicketScreen.noOrderIsThere(),TicketScreen.selectFilter("Paid"),TicketScreen.noOrderIsThere(),Chrome.storedOrderCount(0),].flat(),});registry.category("web_tour.tours").add("OrderSynchronisationTour",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),DeviceSynchronization.createNewOrderOnTable("4",[["Coca-Cola",50],["Water",30],]),FloorScreen.clickTable("4"),ProductScreen.orderLineHas("Coca-Cola","50.0"),DeviceSynchronization.markOrderAsPaid(),ProductScreen.isShown(),Chrome.clickMenuOption("Orders"),TicketScreen.selectFilter("Paid"),TicketScreen.checkStatus("device_sync","Paid"),TicketScreen.selectOrder("device_sync"),TicketScreen.confirmRefund(),].flat(),});return __exports;});;

/* /pos_restaurant/static/tests/tours/tip_screen_tour.js */
odoo.define('@pos_restaurant/../tests/tours/tip_screen_tour',['@point_of_sale/../tests/tours/utils/product_screen_util','@pos_restaurant/../tests/tours/utils/product_screen_util','@point_of_sale/../tests/tours/utils/dialog_util','@point_of_sale/../tests/tours/utils/payment_screen_util','@point_of_sale/../tests/tours/utils/receipt_screen_util','@pos_restaurant/../tests/tours/utils/floor_screen_util','@point_of_sale/../tests/tours/utils/ticket_screen_util','@pos_restaurant/../tests/tours/utils/tip_screen_util','@point_of_sale/../tests/tours/utils/number_popup_util','@point_of_sale/../tests/tours/utils/chrome_util','@web/core/registry'],function(require){'use strict';let __exports={};const ProductScreenPos=require("@point_of_sale/../tests/tours/utils/product_screen_util");const ProductScreenResto=require("@pos_restaurant/../tests/tours/utils/product_screen_util");const ProductScreen={...ProductScreenPos,...ProductScreenResto};const Dialog=require("@point_of_sale/../tests/tours/utils/dialog_util");const PaymentScreen=require("@point_of_sale/../tests/tours/utils/payment_screen_util");const ReceiptScreen=require("@point_of_sale/../tests/tours/utils/receipt_screen_util");const FloorScreen=require("@pos_restaurant/../tests/tours/utils/floor_screen_util");const TicketScreen=require("@point_of_sale/../tests/tours/utils/ticket_screen_util");const TipScreen=require("@pos_restaurant/../tests/tours/utils/tip_screen_util");const NumberPopup=require("@point_of_sale/../tests/tours/utils/number_popup_util");const Chrome=require("@point_of_sale/../tests/tours/utils/chrome_util");const{registry}=require("@web/core/registry");registry.category("web_tour.tours").add("PosResTipScreenTour",{steps:()=>[Chrome.startPoS(),Dialog.confirm("Open Register"),FloorScreen.clickTable("2"),ProductScreen.addOrderline("Minute Maid","1","2"),ProductScreen.totalAmountIs("2.0"),Chrome.clickPlanButton(),FloorScreen.orderCountSyncedInTableIs("2","1"),FloorScreen.clickTable("2"),ProductScreen.totalAmountIs("2.0"),ProductScreen.clickPayButton(),PaymentScreen.clickPaymentMethod("Bank"),PaymentScreen.clickPaymentMethod("Bank"),PaymentScreen.clickValidate(),TipScreen.isShown(),Chrome.clickPlanButton(),FloorScreen.clickTable("4"),ProductScreen.addOrderline("Coca-Cola","2","2"),ProductScreen.totalAmountIs("4.0"),Chrome.clickPlanButton(),Chrome.clickMenuOption("Orders"),{trigger:`.ticket-screen .orders > .order-row:contains(Tipping):contains($ 2.00)`,},Chrome.clickPlanButton(),FloorScreen.clickTable("5"),ProductScreen.addOrderline("Minute Maid","3","2"),ProductScreen.totalAmountIs("6.0"),ProductScreen.clickPayButton(),PaymentScreen.clickPaymentMethod("Bank"),PaymentScreen.clickValidate(),TipScreen.isShown(),Chrome.clickPlanButton(),Chrome.createFloatingOrder(),ProductScreen.addOrderline("Coca-Cola","4","2"),ProductScreen.totalAmountIs("8.0"),ProductScreen.clickControlButton("Guests"),NumberPopup.enterValue("2"),NumberPopup.isShown("2"),Dialog.confirm(),ProductScreen.guestNumberIs("2"),ProductScreen.clickCloseButton(),Chrome.clickPlanButton(),Chrome.clickMenuOption("Orders"),{trigger:`.ticket-screen .orders > .order-row:contains(Tipping):contains($ 6.00)`,},TicketScreen.selectOrderByPrice("2.0"),TicketScreen.loadSelectedOrder(),TipScreen.isShown(),TipScreen.totalAmountIs("2.0"),TipScreen.percentAmountIs("15%","0.30"),TipScreen.percentAmountIs("20%","0.40"),TipScreen.percentAmountIs("25%","0.50"),TipScreen.clickPercentTip("20%"),TipScreen.inputAmountIs("0.40"),Chrome.clickPlanButton(),FloorScreen.isShown(),Chrome.clickMenuOption("Orders"),TicketScreen.selectOrderByPrice("6.0"),TicketScreen.loadSelectedOrder(),TipScreen.isShown(),TipScreen.totalAmountIs("6.0"),TipScreen.percentAmountIs("15%","0.90"),TipScreen.percentAmountIs("20%","1.20"),TipScreen.percentAmountIs("25%","1.50"),TipScreen.clickPercentTip("25%"),TipScreen.inputAmountIs("1.50"),Chrome.clickPlanButton(),FloorScreen.isShown(),Chrome.clickMenuOption("Orders"),TicketScreen.selectOrderByPrice("8.0"),TicketScreen.loadSelectedOrder(),ProductScreen.isShown(),ProductScreen.totalAmountIs("8.0"),ProductScreen.guestNumberIs("2"),ProductScreen.clickCloseButton(),ProductScreen.clickPayButton(),PaymentScreen.clickPaymentMethod("Bank"),PaymentScreen.clickValidate(),TipScreen.isShown(),TipScreen.totalAmountIs("8.0"),TipScreen.percentAmountIs("15%","1.20"),TipScreen.percentAmountIs("20%","1.60"),TipScreen.percentAmountIs("25%","2.00"),TipScreen.setCustomTip("1.00"),TipScreen.inputAmountIs("1.00"),Chrome.clickPlanButton(),FloorScreen.isShown(),Chrome.clickMenuOption("Orders"),TicketScreen.selectFilter("Tipping"),TicketScreen.tipContains("1.00"),TicketScreen.settleTips(),TicketScreen.selectFilter("All active orders"),{trigger:`.ticket-screen .orders > .order-row:contains(Ongoing):contains($ 4.00)`,},TicketScreen.selectOrderByPrice("4.0"),TicketScreen.loadSelectedOrder(),ProductScreen.isShown(),ProductScreen.clickPayButton(),PaymentScreen.clickTipButton(),NumberPopup.enterValue("1"),NumberPopup.isShown("1"),Dialog.confirm(),PaymentScreen.emptyPaymentlines("5.0"),PaymentScreen.clickPaymentMethod("Cash"),PaymentScreen.clickValidate(),ReceiptScreen.isShown(),ReceiptScreen.clickNextOrder(),FloorScreen.clickTable("2"),ProductScreen.addOrderline("Minute Maid","3","2"),ProductScreen.totalAmountIs("6.0"),ProductScreen.clickPayButton(),PaymentScreen.clickPaymentMethod("Bank"),PaymentScreen.clickValidate(),TipScreen.isShown(),TipScreen.clickSettle(),ReceiptScreen.isShown(),ReceiptScreen.clickNextOrder(),FloorScreen.isShown(),].flat(),});return __exports;});;

/* /pos_restaurant/static/tests/tours/utils/bill_screen_util.js */
odoo.define('@pos_restaurant/../tests/tours/utils/bill_screen_util',[],function(require){'use strict';let __exports={};__exports.closeBillPopup=closeBillPopup;function closeBillPopup(){return[{content:`Close bill popup`,trigger:`.btn-close`,run:"click",},];}
__exports.isShown=isShown;function isShown(){return[{content:"Bill screen is shown",trigger:'.receipt-screen h2:contains("Bill Printing")',},];}
return __exports;});;

/* /pos_restaurant/static/tests/tours/utils/chrome.js */
odoo.define('@pos_restaurant/../tests/tours/utils/chrome',[],function(require){'use strict';let __exports={};__exports.isTabActive=isTabActive;function isTabActive(tabText){return[{content:"Check if the active tab contains the text"+tabText,trigger:`.navbar-menu .btn-primary:contains(${tabText})`,},];}
__exports.activeTableOrOrderIs=activeTableOrOrderIs;function activeTableOrOrderIs(label){return{trigger:`.table-free-order-label:contains("${label}")`,};}
return __exports;});;

/* /pos_restaurant/static/tests/tours/utils/devices_synchronization.js */
odoo.define('@pos_restaurant/../tests/tours/utils/devices_synchronization',[],function(require){'use strict';let __exports={};const getData=({lineProductName,productName,partnerName}={})=>{const order=posmodel.models["pos.order"].find((o)=>o.pos_reference==="device_sync");let partner=null;if(partnerName){partner=posmodel.models["res.partner"].find((p)=>p.name===partnerName);}
let line=null;if(lineProductName){line=order.lines.find((l)=>l.product_id.display_name===lineProductName);}
let product=null;if(productName){product=posmodel.models["product.product"].find((p)=>p.display_name===productName);}
return{order,line,product,partner};};const notify=async(orderIds=[])=>{const recordIds={};if(orderIds.lenght){recordIds["pos.order"]=orderIds;}
const orm=posmodel.env.services.orm;await orm.call("pos.config","notify_synchronisation",[posmodel.config.id,posmodel.session.id,999,recordIds,]);};const getLineData=(product,order,quantity)=>({name:product.display_name,order_id:order.id,product_id:product.id,price_unit:product.lst_price,price_subtotal:product.lst_price*quantity,price_subtotal_incl:product.lst_price*quantity,discount:0,qty:quantity,});const writeOnOrder=async(order,data)=>{const sec=new Date(order.write_date).getMilliseconds()+1010;const timeout=Math.ceil(sec-new Date().getMilliseconds(),0);await new Promise((res)=>setTimeout(res,timeout));const orm=posmodel.env.services.orm;await orm.write("pos.order",[order.id],data);await notify([order.id]);};__exports.markOrderAsPaid=markOrderAsPaid;function markOrderAsPaid(){return[{trigger:"body",run:async()=>{const{order}=getData({});await writeOnOrder(order,{state:"paid",amount_paid:order.amount_total,amount_return:0,amount_tax:0,amount_total:0,});},},];}
__exports.createNewOrderOnTable=createNewOrderOnTable;function createNewOrderOnTable(tableName,productTuple){return[{trigger:"body",run:async()=>{const orm=posmodel.env.services.orm;const prices={amount_paid:0,amount_return:0,amount_tax:0,amount_total:0,};const lines=productTuple.map(([productName,quantity])=>{const product=posmodel.models["product.product"].find((p)=>p.display_name===productName);const lineData=getLineData(product,false,quantity);prices.amount_paid+=lineData.price_subtotal;prices.amount_return+=lineData.price_subtotal;return[0,0,{...lineData,price_subtotal:lineData.price_subtotal,price_subtotal_incl:lineData.price_subtotal_incl,},];});const table=posmodel.models["restaurant.table"].find((t)=>t.table_number===parseInt(tableName));const[orderId]=await orm.create("pos.order",[{...prices,pos_reference:`device_sync`,config_id:posmodel.config.id,session_id:posmodel.session.id,table_id:table.id,lines,},]);await notify([orderId]);},},];}
return __exports;});;

/* /pos_restaurant/static/tests/tours/utils/floor_screen_util.js */
odoo.define('@pos_restaurant/../tests/tours/utils/floor_screen_util',['@odoo/hoot-dom','@point_of_sale/../tests/tours/utils/number_popup_util','@point_of_sale/../tests/tours/utils/dialog_util','@web_tour/tour_service/tour_helpers','@web/core/utils/patch'],function(require){'use strict';let __exports={};const{queryOne}=require("@odoo/hoot-dom");const NumberPopup=require("@point_of_sale/../tests/tours/utils/number_popup_util");const Dialog=require("@point_of_sale/../tests/tours/utils/dialog_util");__exports.table=table;function table({name,withClass="",withoutClass,run=()=>{},numOfSeats}){let trigger=`.floor-map .table${withClass}`;if(withoutClass){trigger+=`:not(${withoutClass})`;}
if(name){trigger+=`:has(.label:contains("${name}"))`;}
return{content:`Check table with attributes: ${JSON.stringify(arguments[0])}`,trigger,run:typeof run==="string"?run:()=>run(trigger),};}
const clickTable=__exports.clickTable=(name)=>table({name,run:"click"});const hasTable=__exports.hasTable=(name)=>table({name});const selectedTableIs=__exports.selectedTableIs=(name)=>table({name,withClass:".selected"});const ctrlClickTable=__exports.ctrlClickTable=(name)=>table({name,run:(trigger)=>{queryOne(trigger).dispatchEvent(new MouseEvent("click",{bubbles:true,ctrlKey:true}));},});__exports.clickFloor=clickFloor;function clickFloor(name){return[{content:`click '${name}' floor`,trigger:`.floor-selector .button-floor:contains("${name}")`,run:"click",},];}
__exports.clickEditButton=clickEditButton;function clickEditButton(button){return[{content:"add table",trigger:`.edit-buttons i[aria-label="${button}"]`,run:"click",},];}
__exports.clickSaveEditButton=clickSaveEditButton;function clickSaveEditButton(){return[{content:"add table",trigger:'.edit-buttons button:contains("Save")',run:"click",},];}
__exports.goTo=goTo;function goTo(name){return[{content:`click on Go To button`,trigger:`.navbar-menu .btn:contains("Table")`,run:"click",},...NumberPopup.enterValue(name),Dialog.confirm(),];}
__exports.selectedFloorIs=selectedFloorIs;function selectedFloorIs(name){return[{content:`selected floor is '${name}'`,trigger:`.button-floor.active:contains("${name}")`,},];}
__exports.orderCountSyncedInTableIs=orderCountSyncedInTableIs;function orderCountSyncedInTableIs(table,count){return[{trigger:`.floor-map .table:has(.label:contains("${table}")):has(.order-count:contains("${count}"))`,},];}
__exports.isShown=isShown;function isShown(){return[{trigger:".floor-map",},];}
__exports.linkTables=linkTables;function linkTables(child,parent){return{content:`Drag table ${child} onto table ${parent} in order to link them`,trigger:table({name:child}).trigger,async run(helpers){helpers.delay=500;await helpers.drag_multiple_and_then_drop([table({name:parent}).trigger,{position:"top",relative:true,},],[table({name:parent}).trigger,{position:"center",relative:true,},]);},};}
__exports.isChildTable=isChildTable;function isChildTable(child){return{content:`Verify that table ${child} is a child table`,trigger:table({name:child}).trigger+` .info.opacity-25`,};}
const{TourHelpers}=require("@web_tour/tour_service/tour_helpers");const{patch}=require("@web/core/utils/patch");const hoot=require("@odoo/hoot-dom");patch(TourHelpers.prototype,{async drag_multiple_and_then_drop(...drags){const dragEffectDelay=async()=>{console.log(this.delay);await new Promise((resolve)=>requestAnimationFrame(resolve));await new Promise((resolve)=>setTimeout(resolve,this.delay));};const element=this.anchor;const{drop,moveTo}=await hoot.drag(element);await dragEffectDelay();await hoot.hover(element,{position:{top:20,left:20,},relative:true,});await dragEffectDelay();for(const[selector,options]of drags){console.log("Selector",selector,options);const target=await hoot.waitFor(selector,{visible:true,timeout:500,});await moveTo(target,options);await dragEffectDelay();}
await drop();await dragEffectDelay();},});return __exports;});;

/* /pos_restaurant/static/tests/tours/utils/product_screen_util.js */
odoo.define('@pos_restaurant/../tests/tours/utils/product_screen_util',['@point_of_sale/../tests/tours/utils/generic_components/order_widget_util','@point_of_sale/../tests/tours/utils/product_screen_util'],function(require){'use strict';let __exports={};const Order=require("@point_of_sale/../tests/tours/utils/generic_components/order_widget_util");const ProductScreen=require("@point_of_sale/../tests/tours/utils/product_screen_util");__exports.clickOrderButton=clickOrderButton;function clickOrderButton(){return[{content:"click order button",trigger:".actionpad .submit-order",run:"click",},];}
__exports.orderlinesHaveNoChange=orderlinesHaveNoChange;function orderlinesHaveNoChange(){return Order.doesNotHaveLine({withClass:".has-change"});}
__exports.orderlineIsToOrder=orderlineIsToOrder;function orderlineIsToOrder(name){return Order.hasLine({productName:name,withClass:".orderline.has-change",});}
__exports.orderlineIsToSkip=orderlineIsToSkip;function orderlineIsToSkip(name){return Order.hasLine({withClass:".orderline.skip-change",productName:name,});}
__exports.guestNumberIs=guestNumberIs;function guestNumberIs(num){return[...ProductScreen.clickControlButtonMore(),{content:`guest number is ${num}`,trigger:ProductScreen.controlButtonTrigger("Guests")+`:contains(${num})`,},];}
__exports.orderBtnIsPresent=orderBtnIsPresent;function orderBtnIsPresent(){return[{content:"Order button is here",trigger:".actionpad .button.submit-order",},];}
__exports.OrderButtonNotContain=OrderButtonNotContain;function OrderButtonNotContain(data){const steps=[{isActive:["desktop"],content:"check order button not contain data",trigger:`.product-screen .submit-order:not(:contains("${data}"))`,run:function(){},},];return steps;}
__exports.bookOrReleaseTable=bookOrReleaseTable;function bookOrReleaseTable(){return[{content:"click book or release table button",trigger:".table-booking button",run:"click",},];}
return __exports;});;

/* /pos_restaurant/static/tests/tours/utils/split_bill_screen_util.js */
odoo.define('@pos_restaurant/../tests/tours/utils/split_bill_screen_util',['@point_of_sale/../tests/tours/utils/generic_components/order_widget_util'],function(require){'use strict';let __exports={};const Order=require("@point_of_sale/../tests/tours/utils/generic_components/order_widget_util");__exports.clickOrderline=clickOrderline;function clickOrderline(productName){return Order.hasLine({productName,run:"click"});}
__exports.clickBack=clickBack;function clickBack(){return[{content:"click back button",trigger:`.splitbill-screen .button.back`,run:"click",},];}
__exports.clickPay=clickPay;function clickPay(){return[{content:"click pay button",trigger:`.splitbill-screen .pay-button .button`,run:"click",},];}
__exports.orderlineHas=orderlineHas;function orderlineHas(name,totalQuantity,splitQuantity){return Order.hasLine({productName:name,quantity:splitQuantity!=0?`${splitQuantity} / ${totalQuantity}`:totalQuantity,});}
__exports.subtotalIs=subtotalIs;function subtotalIs(amount){return[{content:`total amount of split is '${amount}'`,trigger:`.splitbill-screen .order-info .subtotal:contains("${amount}")`,run:"click",},];}
return __exports;});;

/* /pos_restaurant/static/tests/tours/utils/tip_screen_util.js */
odoo.define('@pos_restaurant/../tests/tours/utils/tip_screen_util',[],function(require){'use strict';let __exports={};__exports.clickPercentTip=clickPercentTip;function clickPercentTip(percent){return[{trigger:`.tip-screen .percentage:contains("${percent}")`,run:"click",},];}
__exports.setCustomTip=setCustomTip;function setCustomTip(amount){return[{trigger:`.tip-screen .custom-amount-form input`,run:`edit ${amount}`,},];}
__exports.clickSettle=clickSettle;function clickSettle(){return[{trigger:`.button.highlight.next`,run:"click",},];}
__exports.isShown=isShown;function isShown(){return[{trigger:".pos .tip-screen",},];}
__exports.totalAmountIs=totalAmountIs;function totalAmountIs(amount){return[{trigger:`.tip-screen .total-amount:contains("${amount}")`,},];}
__exports.percentAmountIs=percentAmountIs;function percentAmountIs(percent,amount){return[{trigger:`.tip-screen .percentage:contains("${percent}") ~ .amount:contains("${amount}")`,},];}
__exports.inputAmountIs=inputAmountIs;function inputAmountIs(amount){return[{trigger:`.tip-screen .custom-amount-form input[data-amount="${amount}"]`,},];}
return __exports;});

                    /*******************************************
                    *  Templates                               *
                    *******************************************/

                    odoo.define("point_of_sale.assets_debug.bundle.xml", ["@web/core/templates"], function(require) {
                        "use strict";
                        const { checkPrimaryTemplateParents, registerTemplate, registerTemplateExtension } = require("@web/core/templates");
                        /* point_of_sale.assets_debug */
                        registerTemplate("web_tour.TourPointer", `/web_tour/static/src/tour_pointer/tour_pointer.xml`, `<t t-name="web_tour.TourPointer" xml:space="preserve">
        <div t-if="this.isVisible" t-ref="pointer" t-attf-class="                 o_tour_pointer                 o_{{ position }}                 {{ isOpen ? 'o_open' : (props.bounce ? 'o_bouncing' : '') }}                 {{ props.pointerState.onClick ? 'cursor-pointer' : '' }}             " t-attf-style="                 --TourPointer__width: {{ constructor.width }}px;                 --TourPointer__height: {{ constructor.height }}px;             " t-on-mouseenter="props.pointerState.onMouseEnter or (() =&gt; {})" t-on-mouseleave="props.pointerState.onMouseLeave or (() =&gt; {})" t-on-click="props.pointerState.onClick or (() =&gt; {})">
            <div class="o_tour_pointer_tip position-absolute"/>
            <div class="o_tour_pointer_content rounded overflow-hidden px-3 py-2 w-100 h-100 position-relative" t-att-class="{ 'invisible': !isOpen }">
                <t t-out="content"/>
            </div>
        </div>
        <div class="o_tour_dropzone position-fixed pe-none" t-if="props.pointerState.isVisible and props.pointerState.isZone" t-ref="zone" style="border: 3px dashed #714b67;"/>
    </t>
`);
registerTemplate("web_tour.TourRecorder", `/web_tour/static/src/tour_service/tour_recorder/tour_recorder.xml`, `<t t-name="web_tour.TourRecorder" xml:space="preserve">
    <div class="d-flex position-fixed bottom-0 start-0 bg-primary o_tour_recorder">
        <div t-ref="tour_recorder" class="d-flex">
            <button class="o_button_record btn btn-primary rounded-0" t-on-click.prevent.stop="toggleRecording">
                <span class="px-2 me-1 rounded-circle" t-att-class="state.recording ? 'bg-danger': 'bg-secondary'" role="status" aria-hidden="true"/>
                Record
                <span class="fst-italic fw-lighter" t-if="state.editedElement"> (recording keyboard)</span>
            </button>
            <Dropdown position="'top-end'">
                <button class="o_button_steps btn btn-primary rounded-0">
                    Steps <span class="badge rounded-pill bg-danger"><t t-esc="state.steps.length"/></span>
                </button>
                <t t-set-slot="content">
                    <div class="o_tour_recorder p-2">
                        <h4>Steps:</h4>
                        <table class="table table-striped">
                            <thead>
                                <tr>
                                    <td>n°</td>
                                    <td>trigger</td>
                                    <td/>
                                </tr>
                            </thead>
                            <tbody>
                                <t t-foreach="state.steps" t-as="step" t-key="step_index">
                                    <tr class="o_tour_step" t-att-class="step.triggerNotUnique ? 'text-danger' : ''">
                                        <td><t t-esc="step_index + 1"/>.</td>
                                        <td class="o_tour_step_trigger">
                                            <t t-esc="step.trigger"/>
                                            <span t-if="step.run and step.run != 'click'" class="fst-italic fw-lighter"><br/>(run: <t t-esc="step.run"/>) </span>
                                        </td>
                                        <td><button class="o_button_delete_step btn btn-link text-danger fa fa-trash mx-1" t-on-click.prevent.stop="() =&gt; state.steps.splice(step_index, 1)"/></td>
                                    </tr>
                                </t>
                            </tbody>
                        </table>
                    </div>
                </t>
            </Dropdown>
            <Dropdown t-if="state.steps.length" position="'top-end'">
                <button class="o_button_save btn btn-primary px-1 rounded-0">
                    <i class="fa fa-floppy-o"/>
                </button>
                <t t-set-slot="content">
                    <div class="o_tour_recorder p-1" style="min-width: 30vw;">
                        <form class="p-1" t-on-submit.prevent="saveTour">
                            <label for="name" class="o_form_label my-1">Name:</label><br/>
                            <input t-att-value="state.tourName" t-on-change="(ev) =&gt; state.tourName = ev.target.value" class="o_input" placeholder="name_of_the_tour" type="text" name="name"/>
                            <label for="url" class="o_form_label my-1">Url:</label><br/>
                            <input t-att-value="state.url" t-on-change="(ev) =&gt; state.url = ev.target.value" class="o_input" type="text" name="url"/>
                            <button class="o_button_save_confirm btn btn-primary mt-3">Save</button>
                        </form>
                    </div>
                </t>
            </Dropdown>
            <button t-if="state.steps.length" class="btn btn-primary px-1" t-on-click="resetTourRecorderState"><i class="fa fa-undo"/></button>
            <button class="btn btn-primary position-absolute bottom-0 start-100 rounded-0 border-1 o_tour_recorder_close_button" t-on-click.prevent.stop="() =&gt; props.onClose()"><i class="fa fa-close"/></button>
        </div>
    </div>
</t>
`);
                    });
