
/* /web/static/src/module_loader.js */
(function(odoo){"use strict";if(odoo.loader){return;}
class ModuleLoader{bus=new EventTarget();checkErrorProm=null;factories=new Map();failed=new Set();jobs=new Set();modules=new Map();constructor(root){this.root=root;const strDebug=new URLSearchParams(location.search).get("debug");this.debug=Boolean(strDebug&&strDebug!=="0");}
addJob(name){this.jobs.add(name);this.startModules();}
define(name,deps,factory,lazy=false){if(typeof name!=="string"){throw new Error(`Module name should be a string, got: ${String(name)}`);}
if(!Array.isArray(deps)){throw new Error(`Module dependencies should be a list of strings, got: ${String(deps)}`);}
if(typeof factory!=="function"){throw new Error(`Module factory should be a function, got: ${String(factory)}`);}
if(this.factories.has(name)){return;}
this.factories.set(name,{deps,fn:factory,ignoreMissingDeps:globalThis.__odooIgnoreMissingDependencies,});if(!lazy){this.addJob(name);this.checkErrorProm||=Promise.resolve().then(()=>{this.checkErrorProm=null;this.reportErrors(this.findErrors());});}}
findErrors(moduleNames){const findCycle=(currentModuleNames,visited)=>{for(const name of currentModuleNames||[]){if(visited.has(name)){const cycleModuleNames=[...visited,name];return cycleModuleNames.slice(cycleModuleNames.indexOf(name)).map((j)=>`"${j}"`).join(" => ");}
const cycle=findCycle(dependencyGraph[name],new Set(visited).add(name));if(cycle){return cycle;}}
return null;};moduleNames||=this.jobs;const dependencyGraph=Object.create(null);const missing=new Set();const unloaded=new Set();for(const moduleName of moduleNames){const{deps,ignoreMissingDeps}=this.factories.get(moduleName);dependencyGraph[moduleName]=deps;if(ignoreMissingDeps){continue;}
unloaded.add(moduleName);for(const dep of deps){if(!this.factories.has(dep)){missing.add(dep);}}}
const cycle=findCycle(moduleNames,new Set());const errors={};if(cycle){errors.cycle=cycle;}
if(this.failed.size){errors.failed=this.failed;}
if(missing.size){errors.missing=missing;}
if(unloaded.size){errors.unloaded=unloaded;}
return errors;}
findJob(){for(const job of this.jobs){if(this.factories.get(job).deps.every((dep)=>this.modules.has(dep))){return job;}}
return null;}
async reportErrors(errors){if(!Object.keys(errors).length){return;}
if(errors.failed){console.error("The following modules failed to load because of an error:",[...errors.failed,]);}
if(errors.missing){console.error("The following modules are needed by other modules but have not been defined, they may not be present in the correct asset bundle:",[...errors.missing]);}
if(errors.cycle){console.error("The following modules could not be loaded because they form a dependency cycle:",errors.cycle);}
if(errors.unloaded){console.error("The following modules could not be loaded because they have unmet dependencies, this is a secondary error which is likely caused by one of the above problems:",[...errors.unloaded]);}
const document=this.root?.ownerDocument||globalThis.document;if(document.readyState==="loading"){await new Promise((resolve)=>document.addEventListener("DOMContentLoaded",resolve));}
if(this.debug){const style=document.createElement("style");style.className="o_module_error_banner";style.textContent=`
                    body::before {
                        font-weight: bold;
                        content: "An error occurred while loading javascript modules, you may find more information in the devtools console";
                        position: fixed;
                        left: 0;
                        bottom: 0;
                        z-index: 100000000000;
                        background-color: #C00;
                        color: #DDD;
                    }
                `;document.head.appendChild(style);}}
startModules(){let job;while((job=this.findJob())){this.startModule(job);}}
startModule(name){const require=(dependency)=>this.modules.get(dependency);this.jobs.delete(name);const factory=this.factories.get(name);let module=null;try{module=factory.fn(require);}catch(error){this.failed.add(name);throw new Error(`Error while loading "${name}":\n${error}`);}
this.modules.set(name,module);this.bus.dispatchEvent(new CustomEvent("module-started",{detail:{moduleName:name,module},}));return module;}}
const loader=new ModuleLoader();odoo.define=loader.define.bind(loader);odoo.loader=loader;if(odoo.debug&&!loader.debug){odoo.debug="";}})((globalThis.odoo||={}));;

/* /web/static/src/session.js */
odoo.define('@web/session',[],function(require){'use strict';let __exports={};const session=__exports.session=odoo.__session_info__||{};delete odoo.__session_info__;return __exports;});;

/* /web/static/lib/owl/owl.js */
(function(exports){'use strict';function filterOutModifiersFromData(dataList){dataList=dataList.slice();const modifiers=[];let elm;while((elm=dataList[0])&&typeof elm==="string"){modifiers.push(dataList.shift());}
return{modifiers,data:dataList};}
const config={shouldNormalizeDom:true,mainEventHandler:(data,ev,currentTarget)=>{if(typeof data==="function"){data(ev);}
else if(Array.isArray(data)){data=filterOutModifiersFromData(data).data;data[0](data[1],ev);}
return false;},};class VToggler{constructor(key,child){this.key=key;this.child=child;}
mount(parent,afterNode){this.parentEl=parent;this.child.mount(parent,afterNode);}
moveBeforeDOMNode(node,parent){this.child.moveBeforeDOMNode(node,parent);}
moveBeforeVNode(other,afterNode){this.moveBeforeDOMNode((other&&other.firstNode())||afterNode);}
patch(other,withBeforeRemove){if(this===other){return;}
let child1=this.child;let child2=other.child;if(this.key===other.key){child1.patch(child2,withBeforeRemove);}
else{child2.mount(this.parentEl,child1.firstNode());if(withBeforeRemove){child1.beforeRemove();}
child1.remove();this.child=child2;this.key=other.key;}}
beforeRemove(){this.child.beforeRemove();}
remove(){this.child.remove();}
firstNode(){return this.child.firstNode();}
toString(){return this.child.toString();}}
function toggler(key,child){return new VToggler(key,child);}
class OwlError extends Error{}
const{setAttribute:elemSetAttribute,removeAttribute}=Element.prototype;const tokenList=DOMTokenList.prototype;const tokenListAdd=tokenList.add;const tokenListRemove=tokenList.remove;const isArray=Array.isArray;const{split,trim}=String.prototype;const wordRegexp=/\s+/;function setAttribute(key,value){switch(value){case false:case undefined:removeAttribute.call(this,key);break;case true:elemSetAttribute.call(this,key,"");break;default:elemSetAttribute.call(this,key,value);}}
function createAttrUpdater(attr){return function(value){setAttribute.call(this,attr,value);};}
function attrsSetter(attrs){if(isArray(attrs)){if(attrs[0]==="class"){setClass.call(this,attrs[1]);}
else{setAttribute.call(this,attrs[0],attrs[1]);}}
else{for(let k in attrs){if(k==="class"){setClass.call(this,attrs[k]);}
else{setAttribute.call(this,k,attrs[k]);}}}}
function attrsUpdater(attrs,oldAttrs){if(isArray(attrs)){const name=attrs[0];const val=attrs[1];if(name===oldAttrs[0]){if(val===oldAttrs[1]){return;}
if(name==="class"){updateClass.call(this,val,oldAttrs[1]);}
else{setAttribute.call(this,name,val);}}
else{removeAttribute.call(this,oldAttrs[0]);setAttribute.call(this,name,val);}}
else{for(let k in oldAttrs){if(!(k in attrs)){if(k==="class"){updateClass.call(this,"",oldAttrs[k]);}
else{removeAttribute.call(this,k);}}}
for(let k in attrs){const val=attrs[k];if(val!==oldAttrs[k]){if(k==="class"){updateClass.call(this,val,oldAttrs[k]);}
else{setAttribute.call(this,k,val);}}}}}
function toClassObj(expr){const result={};switch(typeof expr){case"string":const str=trim.call(expr);if(!str){return{};}
let words=split.call(str,wordRegexp);for(let i=0,l=words.length;i<l;i++){result[words[i]]=true;}
return result;case"object":for(let key in expr){const value=expr[key];if(value){key=trim.call(key);if(!key){continue;}
const words=split.call(key,wordRegexp);for(let word of words){result[word]=value;}}}
return result;case"undefined":return{};case"number":return{[expr]:true};default:return{[expr]:true};}}
function setClass(val){val=val===""?{}:toClassObj(val);const cl=this.classList;for(let c in val){tokenListAdd.call(cl,c);}}
function updateClass(val,oldVal){oldVal=oldVal===""?{}:toClassObj(oldVal);val=val===""?{}:toClassObj(val);const cl=this.classList;for(let c in oldVal){if(!(c in val)){tokenListRemove.call(cl,c);}}
for(let c in val){if(!(c in oldVal)){tokenListAdd.call(cl,c);}}}
function batched(callback){let scheduled=false;return async(...args)=>{if(!scheduled){scheduled=true;await Promise.resolve();scheduled=false;callback(...args);}};}
function inOwnerDocument(el){if(!el){return false;}
if(el.ownerDocument.contains(el)){return true;}
const rootNode=el.getRootNode();return rootNode instanceof ShadowRoot&&el.ownerDocument.contains(rootNode.host);}
function isAttachedToDocument(element,documentElement){let current=element;const shadowRoot=documentElement.defaultView.ShadowRoot;while(current){if(current===documentElement){return true;}
if(current.parentNode){current=current.parentNode;}
else if(current instanceof shadowRoot&&current.host){current=current.host;}
else{return false;}}
return false;}
function validateTarget(target){const document=target&&target.ownerDocument;if(document){if(!document.defaultView){throw new OwlError("Cannot mount a component: the target document is not attached to a window (defaultView is missing)");}
const HTMLElement=document.defaultView.HTMLElement;if(target instanceof HTMLElement||target instanceof ShadowRoot){if(!isAttachedToDocument(target,document)){throw new OwlError("Cannot mount a component on a detached dom node");}
return;}}
throw new OwlError("Cannot mount component: the target is not a valid DOM element");}
class EventBus extends EventTarget{trigger(name,payload){this.dispatchEvent(new CustomEvent(name,{detail:payload}));}}
function whenReady(fn){return new Promise(function(resolve){if(document.readyState!=="loading"){resolve(true);}
else{document.addEventListener("DOMContentLoaded",resolve,false);}}).then(fn||function(){});}
async function loadFile(url){const result=await fetch(url);if(!result.ok){throw new OwlError("Error while fetching xml templates");}
return await result.text();}
class Markup extends String{}
function htmlEscape(str){if(str instanceof Markup){return str;}
if(str===undefined){return markup("");}
if(typeof str==="number"){return markup(String(str));}
[["&","&amp;"],["<","&lt;"],[">","&gt;"],["'","&#x27;"],['"',"&quot;"],["`","&#x60;"],].forEach((pairs)=>{str=String(str).replace(new RegExp(pairs[0],"g"),pairs[1]);});return markup(str);}
function markup(valueOrStrings,...placeholders){if(!Array.isArray(valueOrStrings)){return new Markup(valueOrStrings);}
const strings=valueOrStrings;let acc="";let i=0;for(;i<placeholders.length;++i){acc+=strings[i]+htmlEscape(placeholders[i]);}
acc+=strings[i];return new Markup(acc);}
function createEventHandler(rawEvent){const eventName=rawEvent.split(".")[0];const capture=rawEvent.includes(".capture");if(rawEvent.includes(".synthetic")){return createSyntheticHandler(eventName,capture);}
else{return createElementHandler(eventName,capture);}}
let nextNativeEventId=1;function createElementHandler(evName,capture=false){let eventKey=`__event__${evName}_${nextNativeEventId++}`;if(capture){eventKey=`${eventKey}_capture`;}
function listener(ev){const currentTarget=ev.currentTarget;if(!currentTarget||!inOwnerDocument(currentTarget))
return;const data=currentTarget[eventKey];if(!data)
return;config.mainEventHandler(data,ev,currentTarget);}
function setup(data){this[eventKey]=data;this.addEventListener(evName,listener,{capture});}
function remove(){delete this[eventKey];this.removeEventListener(evName,listener,{capture});}
function update(data){this[eventKey]=data;}
return{setup,update,remove};}
let nextSyntheticEventId=1;function createSyntheticHandler(evName,capture=false){let eventKey=`__event__synthetic_${evName}`;if(capture){eventKey=`${eventKey}_capture`;}
setupSyntheticEvent(evName,eventKey,capture);const currentId=nextSyntheticEventId++;function setup(data){const _data=this[eventKey]||{};_data[currentId]=data;this[eventKey]=_data;}
function remove(){delete this[eventKey];}
return{setup,update:setup,remove};}
function nativeToSyntheticEvent(eventKey,event){let dom=event.target;while(dom!==null){const _data=dom[eventKey];if(_data){for(const data of Object.values(_data)){const stopped=config.mainEventHandler(data,event,dom);if(stopped)
return;}}
dom=dom.parentNode;}}
const CONFIGURED_SYNTHETIC_EVENTS={};function setupSyntheticEvent(evName,eventKey,capture=false){if(CONFIGURED_SYNTHETIC_EVENTS[eventKey]){return;}
document.addEventListener(evName,(event)=>nativeToSyntheticEvent(eventKey,event),{capture,});CONFIGURED_SYNTHETIC_EVENTS[eventKey]=true;}
const getDescriptor$3=(o,p)=>Object.getOwnPropertyDescriptor(o,p);const nodeProto$4=Node.prototype;const nodeInsertBefore$3=nodeProto$4.insertBefore;const nodeSetTextContent$1=getDescriptor$3(nodeProto$4,"textContent").set;const nodeRemoveChild$3=nodeProto$4.removeChild;class VMulti{constructor(children){this.children=children;}
mount(parent,afterNode){const children=this.children;const l=children.length;const anchors=new Array(l);for(let i=0;i<l;i++){let child=children[i];if(child){child.mount(parent,afterNode);}
else{const childAnchor=document.createTextNode("");anchors[i]=childAnchor;nodeInsertBefore$3.call(parent,childAnchor,afterNode);}}
this.anchors=anchors;this.parentEl=parent;}
moveBeforeDOMNode(node,parent=this.parentEl){this.parentEl=parent;const children=this.children;const anchors=this.anchors;for(let i=0,l=children.length;i<l;i++){let child=children[i];if(child){child.moveBeforeDOMNode(node,parent);}
else{const anchor=anchors[i];nodeInsertBefore$3.call(parent,anchor,node);}}}
moveBeforeVNode(other,afterNode){if(other){const next=other.children[0];afterNode=(next?next.firstNode():other.anchors[0])||null;}
const children=this.children;const parent=this.parentEl;const anchors=this.anchors;for(let i=0,l=children.length;i<l;i++){let child=children[i];if(child){child.moveBeforeVNode(null,afterNode);}
else{const anchor=anchors[i];nodeInsertBefore$3.call(parent,anchor,afterNode);}}}
patch(other,withBeforeRemove){if(this===other){return;}
const children1=this.children;const children2=other.children;const anchors=this.anchors;const parentEl=this.parentEl;for(let i=0,l=children1.length;i<l;i++){const vn1=children1[i];const vn2=children2[i];if(vn1){if(vn2){vn1.patch(vn2,withBeforeRemove);}
else{const afterNode=vn1.firstNode();const anchor=document.createTextNode("");anchors[i]=anchor;nodeInsertBefore$3.call(parentEl,anchor,afterNode);if(withBeforeRemove){vn1.beforeRemove();}
vn1.remove();children1[i]=undefined;}}
else if(vn2){children1[i]=vn2;const anchor=anchors[i];vn2.mount(parentEl,anchor);nodeRemoveChild$3.call(parentEl,anchor);}}}
beforeRemove(){const children=this.children;for(let i=0,l=children.length;i<l;i++){const child=children[i];if(child){child.beforeRemove();}}}
remove(){const parentEl=this.parentEl;if(this.isOnlyChild){nodeSetTextContent$1.call(parentEl,"");}
else{const children=this.children;const anchors=this.anchors;for(let i=0,l=children.length;i<l;i++){const child=children[i];if(child){child.remove();}
else{nodeRemoveChild$3.call(parentEl,anchors[i]);}}}}
firstNode(){const child=this.children[0];return child?child.firstNode():this.anchors[0];}
toString(){return this.children.map((c)=>(c?c.toString():"")).join("");}}
function multi(children){return new VMulti(children);}
const getDescriptor$2=(o,p)=>Object.getOwnPropertyDescriptor(o,p);const nodeProto$3=Node.prototype;const characterDataProto$1=CharacterData.prototype;const nodeInsertBefore$2=nodeProto$3.insertBefore;const characterDataSetData$1=getDescriptor$2(characterDataProto$1,"data").set;const nodeRemoveChild$2=nodeProto$3.removeChild;class VSimpleNode{constructor(text){this.text=text;}
mountNode(node,parent,afterNode){this.parentEl=parent;nodeInsertBefore$2.call(parent,node,afterNode);this.el=node;}
moveBeforeDOMNode(node,parent=this.parentEl){this.parentEl=parent;nodeInsertBefore$2.call(parent,this.el,node);}
moveBeforeVNode(other,afterNode){nodeInsertBefore$2.call(this.parentEl,this.el,other?other.el:afterNode);}
beforeRemove(){}
remove(){nodeRemoveChild$2.call(this.parentEl,this.el);}
firstNode(){return this.el;}
toString(){return this.text;}}
class VText$1 extends VSimpleNode{mount(parent,afterNode){this.mountNode(document.createTextNode(toText(this.text)),parent,afterNode);}
patch(other){const text2=other.text;if(this.text!==text2){characterDataSetData$1.call(this.el,toText(text2));this.text=text2;}}}
class VComment extends VSimpleNode{mount(parent,afterNode){this.mountNode(document.createComment(toText(this.text)),parent,afterNode);}
patch(){}}
function text(str){return new VText$1(str);}
function comment(str){return new VComment(str);}
function toText(value){switch(typeof value){case"string":return value;case"number":return String(value);case"boolean":return value?"true":"false";default:return value||"";}}
const getDescriptor$1=(o,p)=>Object.getOwnPropertyDescriptor(o,p);const nodeProto$2=Node.prototype;const elementProto=Element.prototype;const characterDataProto=CharacterData.prototype;const characterDataSetData=getDescriptor$1(characterDataProto,"data").set;const nodeGetFirstChild=getDescriptor$1(nodeProto$2,"firstChild").get;const nodeGetNextSibling=getDescriptor$1(nodeProto$2,"nextSibling").get;const NO_OP=()=>{};function makePropSetter(name){return function setProp(value){this[name]=value===0?0:value?value.valueOf():"";};}
const cache$1={};function createBlock(str){if(str in cache$1){return cache$1[str];}
const doc=new DOMParser().parseFromString(`<t>${str}</t>`,"text/xml");const node=doc.firstChild.firstChild;if(config.shouldNormalizeDom){normalizeNode(node);}
const tree=buildTree(node);const context=buildContext(tree);const template=tree.el;const Block=buildBlock(template,context);cache$1[str]=Block;return Block;}
function normalizeNode(node){if(node.nodeType===Node.TEXT_NODE){if(!/\S/.test(node.textContent)){node.remove();return;}}
if(node.nodeType===Node.ELEMENT_NODE){if(node.tagName==="pre"){return;}}
for(let i=node.childNodes.length-1;i>=0;--i){normalizeNode(node.childNodes.item(i));}}
function buildTree(node,parent=null,domParentTree=null){switch(node.nodeType){case Node.ELEMENT_NODE:{let currentNS=domParentTree&&domParentTree.currentNS;const tagName=node.tagName;let el=undefined;const info=[];if(tagName.startsWith("block-text-")){const index=parseInt(tagName.slice(11),10);info.push({type:"text",idx:index});el=document.createTextNode("");}
if(tagName.startsWith("block-child-")){if(!domParentTree.isRef){addRef(domParentTree);}
const index=parseInt(tagName.slice(12),10);info.push({type:"child",idx:index});el=document.createTextNode("");}
currentNS||(currentNS=node.namespaceURI);if(!el){el=currentNS?document.createElementNS(currentNS,tagName):document.createElement(tagName);}
if(el instanceof Element){if(!domParentTree){const fragment=document.createElement("template").content;fragment.appendChild(el);}
const attrs=node.attributes;for(let i=0;i<attrs.length;i++){const attrName=attrs[i].name;const attrValue=attrs[i].value;if(attrName.startsWith("block-handler-")){const idx=parseInt(attrName.slice(14),10);info.push({type:"handler",idx,event:attrValue,});}
else if(attrName.startsWith("block-attribute-")){const idx=parseInt(attrName.slice(16),10);info.push({type:"attribute",idx,name:attrValue,tag:tagName,});}
else if(attrName.startsWith("block-property-")){const idx=parseInt(attrName.slice(15),10);info.push({type:"property",idx,name:attrValue,tag:tagName,});}
else if(attrName==="block-attributes"){info.push({type:"attributes",idx:parseInt(attrValue,10),});}
else if(attrName==="block-ref"){info.push({type:"ref",idx:parseInt(attrValue,10),});}
else{el.setAttribute(attrs[i].name,attrValue);}}}
const tree={parent,firstChild:null,nextSibling:null,el,info,refN:0,currentNS,};if(node.firstChild){const childNode=node.childNodes[0];if(node.childNodes.length===1&&childNode.nodeType===Node.ELEMENT_NODE&&childNode.tagName.startsWith("block-child-")){const tagName=childNode.tagName;const index=parseInt(tagName.slice(12),10);info.push({idx:index,type:"child",isOnlyChild:true});}
else{tree.firstChild=buildTree(node.firstChild,tree,tree);el.appendChild(tree.firstChild.el);let curNode=node.firstChild;let curTree=tree.firstChild;while((curNode=curNode.nextSibling)){curTree.nextSibling=buildTree(curNode,curTree,tree);el.appendChild(curTree.nextSibling.el);curTree=curTree.nextSibling;}}}
if(tree.info.length){addRef(tree);}
return tree;}
case Node.TEXT_NODE:case Node.COMMENT_NODE:{const el=node.nodeType===Node.TEXT_NODE?document.createTextNode(node.textContent):document.createComment(node.textContent);return{parent:parent,firstChild:null,nextSibling:null,el,info:[],refN:0,currentNS:null,};}}
throw new OwlError("boom");}
function addRef(tree){tree.isRef=true;do{tree.refN++;}while((tree=tree.parent));}
function parentTree(tree){let parent=tree.parent;while(parent&&parent.nextSibling===tree){tree=parent;parent=parent.parent;}
return parent;}
function buildContext(tree,ctx,fromIdx){if(!ctx){const children=new Array(tree.info.filter((v)=>v.type==="child").length);ctx={collectors:[],locations:[],children,cbRefs:[],refN:tree.refN,refList:[]};fromIdx=0;}
if(tree.refN){const initialIdx=fromIdx;const isRef=tree.isRef;const firstChild=tree.firstChild?tree.firstChild.refN:0;const nextSibling=tree.nextSibling?tree.nextSibling.refN:0;if(isRef){for(let info of tree.info){info.refIdx=initialIdx;}
tree.refIdx=initialIdx;updateCtx(ctx,tree);fromIdx++;}
if(nextSibling){const idx=fromIdx+firstChild;ctx.collectors.push({idx,prevIdx:initialIdx,getVal:nodeGetNextSibling});buildContext(tree.nextSibling,ctx,idx);}
if(firstChild){ctx.collectors.push({idx:fromIdx,prevIdx:initialIdx,getVal:nodeGetFirstChild});buildContext(tree.firstChild,ctx,fromIdx);}}
return ctx;}
function updateCtx(ctx,tree){for(let info of tree.info){switch(info.type){case"text":ctx.locations.push({idx:info.idx,refIdx:info.refIdx,setData:setText,updateData:setText,});break;case"child":if(info.isOnlyChild){ctx.children[info.idx]={parentRefIdx:info.refIdx,isOnlyChild:true,};}
else{ctx.children[info.idx]={parentRefIdx:parentTree(tree).refIdx,afterRefIdx:info.refIdx,};}
break;case"property":{const refIdx=info.refIdx;const setProp=makePropSetter(info.name);ctx.locations.push({idx:info.idx,refIdx,setData:setProp,updateData:setProp,});break;}
case"attribute":{const refIdx=info.refIdx;let updater;let setter;if(info.name==="class"){setter=setClass;updater=updateClass;}
else{setter=createAttrUpdater(info.name);updater=setter;}
ctx.locations.push({idx:info.idx,refIdx,setData:setter,updateData:updater,});break;}
case"attributes":ctx.locations.push({idx:info.idx,refIdx:info.refIdx,setData:attrsSetter,updateData:attrsUpdater,});break;case"handler":{const{setup,update}=createEventHandler(info.event);ctx.locations.push({idx:info.idx,refIdx:info.refIdx,setData:setup,updateData:update,});break;}
case"ref":const index=ctx.cbRefs.push(info.idx)-1;ctx.locations.push({idx:info.idx,refIdx:info.refIdx,setData:makeRefSetter(index,ctx.refList),updateData:NO_OP,});}}}
function buildBlock(template,ctx){let B=createBlockClass(template,ctx);if(ctx.cbRefs.length){const cbRefs=ctx.cbRefs;const refList=ctx.refList;let cbRefsNumber=cbRefs.length;B=class extends B{mount(parent,afterNode){refList.push(new Array(cbRefsNumber));super.mount(parent,afterNode);for(let cbRef of refList.pop()){cbRef();}}
remove(){super.remove();for(let cbRef of cbRefs){let fn=this.data[cbRef];fn(null);}}};}
if(ctx.children.length){B=class extends B{constructor(data,children){super(data);this.children=children;}};B.prototype.beforeRemove=VMulti.prototype.beforeRemove;return(data,children=[])=>new B(data,children);}
return(data)=>new B(data);}
function createBlockClass(template,ctx){const{refN,collectors,children}=ctx;const colN=collectors.length;ctx.locations.sort((a,b)=>a.idx-b.idx);const locations=ctx.locations.map((loc)=>({refIdx:loc.refIdx,setData:loc.setData,updateData:loc.updateData,}));const locN=locations.length;const childN=children.length;const childrenLocs=children;const isDynamic=refN>0;const nodeCloneNode=nodeProto$2.cloneNode;const nodeInsertBefore=nodeProto$2.insertBefore;const elementRemove=elementProto.remove;class Block{constructor(data){this.data=data;}
beforeRemove(){}
remove(){elementRemove.call(this.el);}
firstNode(){return this.el;}
moveBeforeDOMNode(node,parent=this.parentEl){this.parentEl=parent;nodeInsertBefore.call(parent,this.el,node);}
moveBeforeVNode(other,afterNode){nodeInsertBefore.call(this.parentEl,this.el,other?other.el:afterNode);}
toString(){const div=document.createElement("div");this.mount(div,null);return div.innerHTML;}
mount(parent,afterNode){const el=nodeCloneNode.call(template,true);nodeInsertBefore.call(parent,el,afterNode);this.el=el;this.parentEl=parent;}
patch(other,withBeforeRemove){}}
if(isDynamic){Block.prototype.mount=function mount(parent,afterNode){const el=nodeCloneNode.call(template,true);const refs=new Array(refN);this.refs=refs;refs[0]=el;for(let i=0;i<colN;i++){const w=collectors[i];refs[w.idx]=w.getVal.call(refs[w.prevIdx]);}
if(locN){const data=this.data;for(let i=0;i<locN;i++){const loc=locations[i];loc.setData.call(refs[loc.refIdx],data[i]);}}
nodeInsertBefore.call(parent,el,afterNode);if(childN){const children=this.children;for(let i=0;i<childN;i++){const child=children[i];if(child){const loc=childrenLocs[i];const afterNode=loc.afterRefIdx?refs[loc.afterRefIdx]:null;child.isOnlyChild=loc.isOnlyChild;child.mount(refs[loc.parentRefIdx],afterNode);}}}
this.el=el;this.parentEl=parent;};Block.prototype.patch=function patch(other,withBeforeRemove){if(this===other){return;}
const refs=this.refs;if(locN){const data1=this.data;const data2=other.data;for(let i=0;i<locN;i++){const val1=data1[i];const val2=data2[i];if(val1!==val2){const loc=locations[i];loc.updateData.call(refs[loc.refIdx],val2,val1);}}
this.data=data2;}
if(childN){let children1=this.children;const children2=other.children;for(let i=0;i<childN;i++){const child1=children1[i];const child2=children2[i];if(child1){if(child2){child1.patch(child2,withBeforeRemove);}
else{if(withBeforeRemove){child1.beforeRemove();}
child1.remove();children1[i]=undefined;}}
else if(child2){const loc=childrenLocs[i];const afterNode=loc.afterRefIdx?refs[loc.afterRefIdx]:null;child2.mount(refs[loc.parentRefIdx],afterNode);children1[i]=child2;}}}};}
return Block;}
function setText(value){characterDataSetData.call(this,toText(value));}
function makeRefSetter(index,refs){return function setRef(fn){refs[refs.length-1][index]=()=>fn(this);};}
const getDescriptor=(o,p)=>Object.getOwnPropertyDescriptor(o,p);const nodeProto$1=Node.prototype;const nodeInsertBefore$1=nodeProto$1.insertBefore;const nodeAppendChild=nodeProto$1.appendChild;const nodeRemoveChild$1=nodeProto$1.removeChild;const nodeSetTextContent=getDescriptor(nodeProto$1,"textContent").set;class VList{constructor(children){this.children=children;}
mount(parent,afterNode){const children=this.children;const _anchor=document.createTextNode("");this.anchor=_anchor;nodeInsertBefore$1.call(parent,_anchor,afterNode);const l=children.length;if(l){const mount=children[0].mount;for(let i=0;i<l;i++){mount.call(children[i],parent,_anchor);}}
this.parentEl=parent;}
moveBeforeDOMNode(node,parent=this.parentEl){this.parentEl=parent;const children=this.children;for(let i=0,l=children.length;i<l;i++){children[i].moveBeforeDOMNode(node,parent);}
parent.insertBefore(this.anchor,node);}
moveBeforeVNode(other,afterNode){if(other){const next=other.children[0];afterNode=(next?next.firstNode():other.anchor)||null;}
const children=this.children;for(let i=0,l=children.length;i<l;i++){children[i].moveBeforeVNode(null,afterNode);}
this.parentEl.insertBefore(this.anchor,afterNode);}
patch(other,withBeforeRemove){if(this===other){return;}
const ch1=this.children;const ch2=other.children;if(ch2.length===0&&ch1.length===0){return;}
this.children=ch2;const proto=ch2[0]||ch1[0];const{mount:cMount,patch:cPatch,remove:cRemove,beforeRemove,moveBeforeVNode:cMoveBefore,firstNode:cFirstNode,}=proto;const _anchor=this.anchor;const isOnlyChild=this.isOnlyChild;const parent=this.parentEl;if(ch2.length===0&&isOnlyChild){if(withBeforeRemove){for(let i=0,l=ch1.length;i<l;i++){beforeRemove.call(ch1[i]);}}
nodeSetTextContent.call(parent,"");nodeAppendChild.call(parent,_anchor);return;}
let startIdx1=0;let startIdx2=0;let startVn1=ch1[0];let startVn2=ch2[0];let endIdx1=ch1.length-1;let endIdx2=ch2.length-1;let endVn1=ch1[endIdx1];let endVn2=ch2[endIdx2];let mapping=undefined;while(startIdx1<=endIdx1&&startIdx2<=endIdx2){if(startVn1===null){startVn1=ch1[++startIdx1];continue;}
if(endVn1===null){endVn1=ch1[--endIdx1];continue;}
let startKey1=startVn1.key;let startKey2=startVn2.key;if(startKey1===startKey2){cPatch.call(startVn1,startVn2,withBeforeRemove);ch2[startIdx2]=startVn1;startVn1=ch1[++startIdx1];startVn2=ch2[++startIdx2];continue;}
let endKey1=endVn1.key;let endKey2=endVn2.key;if(endKey1===endKey2){cPatch.call(endVn1,endVn2,withBeforeRemove);ch2[endIdx2]=endVn1;endVn1=ch1[--endIdx1];endVn2=ch2[--endIdx2];continue;}
if(startKey1===endKey2){cPatch.call(startVn1,endVn2,withBeforeRemove);ch2[endIdx2]=startVn1;const nextChild=ch2[endIdx2+1];cMoveBefore.call(startVn1,nextChild,_anchor);startVn1=ch1[++startIdx1];endVn2=ch2[--endIdx2];continue;}
if(endKey1===startKey2){cPatch.call(endVn1,startVn2,withBeforeRemove);ch2[startIdx2]=endVn1;const nextChild=ch1[startIdx1];cMoveBefore.call(endVn1,nextChild,_anchor);endVn1=ch1[--endIdx1];startVn2=ch2[++startIdx2];continue;}
mapping=mapping||createMapping(ch1,startIdx1,endIdx1);let idxInOld=mapping[startKey2];if(idxInOld===undefined){cMount.call(startVn2,parent,cFirstNode.call(startVn1)||null);}
else{const elmToMove=ch1[idxInOld];cMoveBefore.call(elmToMove,startVn1,null);cPatch.call(elmToMove,startVn2,withBeforeRemove);ch2[startIdx2]=elmToMove;ch1[idxInOld]=null;}
startVn2=ch2[++startIdx2];}
if(startIdx1<=endIdx1||startIdx2<=endIdx2){if(startIdx1>endIdx1){const nextChild=ch2[endIdx2+1];const anchor=nextChild?cFirstNode.call(nextChild)||null:_anchor;for(let i=startIdx2;i<=endIdx2;i++){cMount.call(ch2[i],parent,anchor);}}
else{for(let i=startIdx1;i<=endIdx1;i++){let ch=ch1[i];if(ch){if(withBeforeRemove){beforeRemove.call(ch);}
cRemove.call(ch);}}}}}
beforeRemove(){const children=this.children;const l=children.length;if(l){const beforeRemove=children[0].beforeRemove;for(let i=0;i<l;i++){beforeRemove.call(children[i]);}}}
remove(){const{parentEl,anchor}=this;if(this.isOnlyChild){nodeSetTextContent.call(parentEl,"");}
else{const children=this.children;const l=children.length;if(l){const remove=children[0].remove;for(let i=0;i<l;i++){remove.call(children[i]);}}
nodeRemoveChild$1.call(parentEl,anchor);}}
firstNode(){const child=this.children[0];return child?child.firstNode():undefined;}
toString(){return this.children.map((c)=>c.toString()).join("");}}
function list(children){return new VList(children);}
function createMapping(ch1,startIdx1,endIdx2){let mapping={};for(let i=startIdx1;i<=endIdx2;i++){mapping[ch1[i].key]=i;}
return mapping;}
const nodeProto=Node.prototype;const nodeInsertBefore=nodeProto.insertBefore;const nodeRemoveChild=nodeProto.removeChild;class VHtml{constructor(html){this.content=[];this.html=html;}
mount(parent,afterNode){this.parentEl=parent;const template=document.createElement("template");template.innerHTML=this.html;this.content=[...template.content.childNodes];for(let elem of this.content){nodeInsertBefore.call(parent,elem,afterNode);}
if(!this.content.length){const textNode=document.createTextNode("");this.content.push(textNode);nodeInsertBefore.call(parent,textNode,afterNode);}}
moveBeforeDOMNode(node,parent=this.parentEl){this.parentEl=parent;for(let elem of this.content){nodeInsertBefore.call(parent,elem,node);}}
moveBeforeVNode(other,afterNode){const target=other?other.content[0]:afterNode;this.moveBeforeDOMNode(target);}
patch(other){if(this===other){return;}
const html2=other.html;if(this.html!==html2){const parent=this.parentEl;const afterNode=this.content[0];const template=document.createElement("template");template.innerHTML=html2;const content=[...template.content.childNodes];for(let elem of content){nodeInsertBefore.call(parent,elem,afterNode);}
if(!content.length){const textNode=document.createTextNode("");content.push(textNode);nodeInsertBefore.call(parent,textNode,afterNode);}
this.remove();this.content=content;this.html=other.html;}}
beforeRemove(){}
remove(){const parent=this.parentEl;for(let elem of this.content){nodeRemoveChild.call(parent,elem);}}
firstNode(){return this.content[0];}
toString(){return this.html;}}
function html(str){return new VHtml(str);}
function createCatcher(eventsSpec){const n=Object.keys(eventsSpec).length;class VCatcher{constructor(child,handlers){this.handlerFns=[];this.afterNode=null;this.child=child;this.handlerData=handlers;}
mount(parent,afterNode){this.parentEl=parent;this.child.mount(parent,afterNode);this.afterNode=document.createTextNode("");parent.insertBefore(this.afterNode,afterNode);this.wrapHandlerData();for(let name in eventsSpec){const index=eventsSpec[name];const handler=createEventHandler(name);this.handlerFns[index]=handler;handler.setup.call(parent,this.handlerData[index]);}}
wrapHandlerData(){for(let i=0;i<n;i++){let handler=this.handlerData[i];let idx=handler.length-2;let origFn=handler[idx];const self=this;handler[idx]=function(ev){const target=ev.target;let currentNode=self.child.firstNode();const afterNode=self.afterNode;while(currentNode&&currentNode!==afterNode){if(currentNode.contains(target)){return origFn.call(this,ev);}
currentNode=currentNode.nextSibling;}};}}
moveBeforeDOMNode(node,parent=this.parentEl){this.parentEl=parent;this.child.moveBeforeDOMNode(node,parent);parent.insertBefore(this.afterNode,node);}
moveBeforeVNode(other,afterNode){if(other){afterNode=other.firstNode()||afterNode;}
this.child.moveBeforeVNode(other?other.child:null,afterNode);this.parentEl.insertBefore(this.afterNode,afterNode);}
patch(other,withBeforeRemove){if(this===other){return;}
this.handlerData=other.handlerData;this.wrapHandlerData();for(let i=0;i<n;i++){this.handlerFns[i].update.call(this.parentEl,this.handlerData[i]);}
this.child.patch(other.child,withBeforeRemove);}
beforeRemove(){this.child.beforeRemove();}
remove(){for(let i=0;i<n;i++){this.handlerFns[i].remove.call(this.parentEl);}
this.child.remove();this.afterNode.remove();}
firstNode(){return this.child.firstNode();}
toString(){return this.child.toString();}}
return function(child,handlers){return new VCatcher(child,handlers);};}
function mount$1(vnode,fixture,afterNode=null){vnode.mount(fixture,afterNode);}
function patch(vnode1,vnode2,withBeforeRemove=false){vnode1.patch(vnode2,withBeforeRemove);}
function remove(vnode,withBeforeRemove=false){if(withBeforeRemove){vnode.beforeRemove();}
vnode.remove();}
const fibersInError=new WeakMap();const nodeErrorHandlers=new WeakMap();function _handleError(node,error){if(!node){return false;}
const fiber=node.fiber;if(fiber){fibersInError.set(fiber,error);}
const errorHandlers=nodeErrorHandlers.get(node);if(errorHandlers){let handled=false;for(let i=errorHandlers.length-1;i>=0;i--){try{errorHandlers[i](error);handled=true;break;}
catch(e){error=e;}}
if(handled){return true;}}
return _handleError(node.parent,error);}
function handleError(params){let{error}=params;if(!(error instanceof OwlError)){error=Object.assign(new OwlError(`An error occured in the owl lifecycle (see this Error's "cause" property)`),{cause:error});}
const node="node"in params?params.node:params.fiber.node;const fiber="fiber"in params?params.fiber:node.fiber;if(fiber){let current=fiber;do{current.node.fiber=current;current=current.parent;}while(current);fibersInError.set(fiber.root,error);}
const handled=_handleError(node,error);if(!handled){console.warn(`[Owl] Unhandled error. Destroying the root component`);try{node.app.destroy();}
catch(e){console.error(e);}
throw error;}}
function makeChildFiber(node,parent){let current=node.fiber;if(current){cancelFibers(current.children);current.root=null;}
return new Fiber(node,parent);}
function makeRootFiber(node){let current=node.fiber;if(current){let root=current.root;root.locked=true;root.setCounter(root.counter+1-cancelFibers(current.children));root.locked=false;current.children=[];current.childrenMap={};current.bdom=null;if(fibersInError.has(current)){fibersInError.delete(current);fibersInError.delete(root);current.appliedToDom=false;if(current instanceof RootFiber){current.mounted=current instanceof MountFiber?[current]:[];}}
return current;}
const fiber=new RootFiber(node,null);if(node.willPatch.length){fiber.willPatch.push(fiber);}
if(node.patched.length){fiber.patched.push(fiber);}
return fiber;}
function throwOnRender(){throw new OwlError("Attempted to render cancelled fiber");}
function cancelFibers(fibers){let result=0;for(let fiber of fibers){let node=fiber.node;fiber.render=throwOnRender;if(node.status===0){node.cancel();}
node.fiber=null;if(fiber.bdom){node.forceNextRender=true;}
else{result++;}
result+=cancelFibers(fiber.children);}
return result;}
class Fiber{constructor(node,parent){this.bdom=null;this.children=[];this.appliedToDom=false;this.deep=false;this.childrenMap={};this.node=node;this.parent=parent;if(parent){this.deep=parent.deep;const root=parent.root;root.setCounter(root.counter+1);this.root=root;parent.children.push(this);}
else{this.root=this;}}
render(){let prev=this.root.node;let scheduler=prev.app.scheduler;let current=prev.parent;while(current){if(current.fiber){let root=current.fiber.root;if(root.counter===0&&prev.parentKey in current.fiber.childrenMap){current=root.node;}
else{scheduler.delayedRenders.push(this);return;}}
prev=current;current=current.parent;}
this._render();}
_render(){const node=this.node;const root=this.root;if(root){try{this.bdom=true;this.bdom=node.renderFn();}
catch(e){node.app.handleError({node,error:e});}
root.setCounter(root.counter-1);}}}
class RootFiber extends Fiber{constructor(){super(...arguments);this.counter=1;this.willPatch=[];this.patched=[];this.mounted=[];this.locked=false;}
complete(){const node=this.node;this.locked=true;let current=undefined;let mountedFibers=this.mounted;try{for(current of this.willPatch){let node=current.node;if(node.fiber===current){const component=node.component;for(let cb of node.willPatch){cb.call(component);}}}
current=undefined;node._patch();this.locked=false;while((current=mountedFibers.pop())){current=current;if(current.appliedToDom){for(let cb of current.node.mounted){cb();}}}
let patchedFibers=this.patched;while((current=patchedFibers.pop())){current=current;if(current.appliedToDom){for(let cb of current.node.patched){cb();}}}}
catch(e){for(let fiber of mountedFibers){fiber.node.willUnmount=[];}
this.locked=false;node.app.handleError({fiber:current||this,error:e});}}
setCounter(newValue){this.counter=newValue;if(newValue===0){this.node.app.scheduler.flush();}}}
class MountFiber extends RootFiber{constructor(node,target,options={}){super(node,null);this.target=target;this.position=options.position||"last-child";}
complete(){let current=this;try{const node=this.node;node.children=this.childrenMap;node.app.constructor.validateTarget(this.target);if(node.bdom){node.updateDom();}
else{node.bdom=this.bdom;if(this.position==="last-child"||this.target.childNodes.length===0){mount$1(node.bdom,this.target);}
else{const firstChild=this.target.childNodes[0];mount$1(node.bdom,this.target,firstChild);}}
node.fiber=null;node.status=1;this.appliedToDom=true;let mountedFibers=this.mounted;while((current=mountedFibers.pop())){if(current.appliedToDom){for(let cb of current.node.mounted){cb();}}}}
catch(e){this.node.app.handleError({fiber:current,error:e});}}}
const KEYCHANGES=Symbol("Key changes");const NO_CALLBACK=()=>{throw new Error("Called NO_CALLBACK. Owl is broken, please report this to the maintainers.");};const objectToString=Object.prototype.toString;const objectHasOwnProperty=Object.prototype.hasOwnProperty;const SUPPORTED_RAW_TYPES=["Object","Array","Set","Map","WeakMap"];const COLLECTION_RAW_TYPES=["Set","Map","WeakMap"];function rawType(obj){return objectToString.call(toRaw(obj)).slice(8,-1);}
function canBeMadeReactive(value){if(typeof value!=="object"){return false;}
return SUPPORTED_RAW_TYPES.includes(rawType(value));}
function possiblyReactive(val,cb){return canBeMadeReactive(val)?reactive(val,cb):val;}
const skipped=new WeakSet();function markRaw(value){skipped.add(value);return value;}
function toRaw(value){return targets.has(value)?targets.get(value):value;}
const targetToKeysToCallbacks=new WeakMap();function observeTargetKey(target,key,callback){if(callback===NO_CALLBACK){return;}
if(!targetToKeysToCallbacks.get(target)){targetToKeysToCallbacks.set(target,new Map());}
const keyToCallbacks=targetToKeysToCallbacks.get(target);if(!keyToCallbacks.get(key)){keyToCallbacks.set(key,new Set());}
keyToCallbacks.get(key).add(callback);if(!callbacksToTargets.has(callback)){callbacksToTargets.set(callback,new Set());}
callbacksToTargets.get(callback).add(target);}
function notifyReactives(target,key){const keyToCallbacks=targetToKeysToCallbacks.get(target);if(!keyToCallbacks){return;}
const callbacks=keyToCallbacks.get(key);if(!callbacks){return;}
for(const callback of[...callbacks]){clearReactivesForCallback(callback);callback();}}
const callbacksToTargets=new WeakMap();function clearReactivesForCallback(callback){const targetsToClear=callbacksToTargets.get(callback);if(!targetsToClear){return;}
for(const target of targetsToClear){const observedKeys=targetToKeysToCallbacks.get(target);if(!observedKeys){continue;}
for(const[key,callbacks]of observedKeys.entries()){callbacks.delete(callback);if(!callbacks.size){observedKeys.delete(key);}}}
targetsToClear.clear();}
function getSubscriptions(callback){const targets=callbacksToTargets.get(callback)||[];return[...targets].map((target)=>{const keysToCallbacks=targetToKeysToCallbacks.get(target);let keys=[];if(keysToCallbacks){for(const[key,cbs]of keysToCallbacks){if(cbs.has(callback)){keys.push(key);}}}
return{target,keys};});}
const targets=new WeakMap();const reactiveCache=new WeakMap();function reactive(target,callback=NO_CALLBACK){if(!canBeMadeReactive(target)){throw new OwlError(`Cannot make the given value reactive`);}
if(skipped.has(target)){return target;}
if(targets.has(target)){return reactive(targets.get(target),callback);}
if(!reactiveCache.has(target)){reactiveCache.set(target,new WeakMap());}
const reactivesForTarget=reactiveCache.get(target);if(!reactivesForTarget.has(callback)){const targetRawType=rawType(target);const handler=COLLECTION_RAW_TYPES.includes(targetRawType)?collectionsProxyHandler(target,callback,targetRawType):basicProxyHandler(callback);const proxy=new Proxy(target,handler);reactivesForTarget.set(callback,proxy);targets.set(proxy,target);}
return reactivesForTarget.get(callback);}
function basicProxyHandler(callback){return{get(target,key,receiver){const desc=Object.getOwnPropertyDescriptor(target,key);if(desc&&!desc.writable&&!desc.configurable){return Reflect.get(target,key,receiver);}
observeTargetKey(target,key,callback);return possiblyReactive(Reflect.get(target,key,receiver),callback);},set(target,key,value,receiver){const hadKey=objectHasOwnProperty.call(target,key);const originalValue=Reflect.get(target,key,receiver);const ret=Reflect.set(target,key,toRaw(value),receiver);if(!hadKey&&objectHasOwnProperty.call(target,key)){notifyReactives(target,KEYCHANGES);}
if(originalValue!==Reflect.get(target,key,receiver)||(key==="length"&&Array.isArray(target))){notifyReactives(target,key);}
return ret;},deleteProperty(target,key){const ret=Reflect.deleteProperty(target,key);notifyReactives(target,KEYCHANGES);notifyReactives(target,key);return ret;},ownKeys(target){observeTargetKey(target,KEYCHANGES,callback);return Reflect.ownKeys(target);},has(target,key){observeTargetKey(target,KEYCHANGES,callback);return Reflect.has(target,key);},};}
function makeKeyObserver(methodName,target,callback){return(key)=>{key=toRaw(key);observeTargetKey(target,key,callback);return possiblyReactive(target[methodName](key),callback);};}
function makeIteratorObserver(methodName,target,callback){return function*(){observeTargetKey(target,KEYCHANGES,callback);const keys=target.keys();for(const item of target[methodName]()){const key=keys.next().value;observeTargetKey(target,key,callback);yield possiblyReactive(item,callback);}};}
function makeForEachObserver(target,callback){return function forEach(forEachCb,thisArg){observeTargetKey(target,KEYCHANGES,callback);target.forEach(function(val,key,targetObj){observeTargetKey(target,key,callback);forEachCb.call(thisArg,possiblyReactive(val,callback),possiblyReactive(key,callback),possiblyReactive(targetObj,callback));},thisArg);};}
function delegateAndNotify(setterName,getterName,target){return(key,value)=>{key=toRaw(key);const hadKey=target.has(key);const originalValue=target[getterName](key);const ret=target[setterName](key,value);const hasKey=target.has(key);if(hadKey!==hasKey){notifyReactives(target,KEYCHANGES);}
if(originalValue!==target[getterName](key)){notifyReactives(target,key);}
return ret;};}
function makeClearNotifier(target){return()=>{const allKeys=[...target.keys()];target.clear();notifyReactives(target,KEYCHANGES);for(const key of allKeys){notifyReactives(target,key);}};}
const rawTypeToFuncHandlers={Set:(target,callback)=>({has:makeKeyObserver("has",target,callback),add:delegateAndNotify("add","has",target),delete:delegateAndNotify("delete","has",target),keys:makeIteratorObserver("keys",target,callback),values:makeIteratorObserver("values",target,callback),entries:makeIteratorObserver("entries",target,callback),[Symbol.iterator]:makeIteratorObserver(Symbol.iterator,target,callback),forEach:makeForEachObserver(target,callback),clear:makeClearNotifier(target),get size(){observeTargetKey(target,KEYCHANGES,callback);return target.size;},}),Map:(target,callback)=>({has:makeKeyObserver("has",target,callback),get:makeKeyObserver("get",target,callback),set:delegateAndNotify("set","get",target),delete:delegateAndNotify("delete","has",target),keys:makeIteratorObserver("keys",target,callback),values:makeIteratorObserver("values",target,callback),entries:makeIteratorObserver("entries",target,callback),[Symbol.iterator]:makeIteratorObserver(Symbol.iterator,target,callback),forEach:makeForEachObserver(target,callback),clear:makeClearNotifier(target),get size(){observeTargetKey(target,KEYCHANGES,callback);return target.size;},}),WeakMap:(target,callback)=>({has:makeKeyObserver("has",target,callback),get:makeKeyObserver("get",target,callback),set:delegateAndNotify("set","get",target),delete:delegateAndNotify("delete","has",target),}),};function collectionsProxyHandler(target,callback,targetRawType){const specialHandlers=rawTypeToFuncHandlers[targetRawType](target,callback);return Object.assign(basicProxyHandler(callback),{get(target,key){if(objectHasOwnProperty.call(specialHandlers,key)){return specialHandlers[key];}
observeTargetKey(target,key,callback);return possiblyReactive(target[key],callback);},});}
let currentNode=null;function saveCurrent(){let n=currentNode;return()=>{currentNode=n;};}
function getCurrent(){if(!currentNode){throw new OwlError("No active component (a hook function should only be called in 'setup')");}
return currentNode;}
function useComponent(){return currentNode.component;}
function applyDefaultProps(props,defaultProps){for(let propName in defaultProps){if(props[propName]===undefined){props[propName]=defaultProps[propName];}}}
const batchedRenderFunctions=new WeakMap();function useState(state){const node=getCurrent();let render=batchedRenderFunctions.get(node);if(!render){render=batched(node.render.bind(node,false));batchedRenderFunctions.set(node,render);node.willDestroy.push(clearReactivesForCallback.bind(null,render));}
return reactive(state,render);}
class ComponentNode{constructor(C,props,app,parent,parentKey){this.fiber=null;this.bdom=null;this.status=0;this.forceNextRender=false;this.nextProps=null;this.children=Object.create(null);this.refs={};this.willStart=[];this.willUpdateProps=[];this.willUnmount=[];this.mounted=[];this.willPatch=[];this.patched=[];this.willDestroy=[];currentNode=this;this.app=app;this.parent=parent;this.props=props;this.parentKey=parentKey;const defaultProps=C.defaultProps;props=Object.assign({},props);if(defaultProps){applyDefaultProps(props,defaultProps);}
const env=(parent&&parent.childEnv)||app.env;this.childEnv=env;for(const key in props){const prop=props[key];if(prop&&typeof prop==="object"&&targets.has(prop)){props[key]=useState(prop);}}
this.component=new C(props,env,this);const ctx=Object.assign(Object.create(this.component),{this:this.component});this.renderFn=app.getTemplate(C.template).bind(this.component,ctx,this);this.component.setup();currentNode=null;}
mountComponent(target,options){const fiber=new MountFiber(this,target,options);this.app.scheduler.addFiber(fiber);this.initiateRender(fiber);}
async initiateRender(fiber){this.fiber=fiber;if(this.mounted.length){fiber.root.mounted.push(fiber);}
const component=this.component;try{await Promise.all(this.willStart.map((f)=>f.call(component)));}
catch(e){this.app.handleError({node:this,error:e});return;}
if(this.status===0&&this.fiber===fiber){fiber.render();}}
async render(deep){if(this.status>=2){return;}
let current=this.fiber;if(current&&(current.root.locked||current.bdom===true)){await Promise.resolve();current=this.fiber;}
if(current){if(!current.bdom&&!fibersInError.has(current)){if(deep){current.deep=deep;}
return;}
deep=deep||current.deep;}
else if(!this.bdom){return;}
const fiber=makeRootFiber(this);fiber.deep=deep;this.fiber=fiber;this.app.scheduler.addFiber(fiber);await Promise.resolve();if(this.status>=2){return;}
if(this.fiber===fiber&&(current||!fiber.parent)){fiber.render();}}
cancel(){this._cancel();delete this.parent.children[this.parentKey];this.app.scheduler.scheduleDestroy(this);}
_cancel(){this.status=2;const children=this.children;for(let childKey in children){children[childKey]._cancel();}}
destroy(){let shouldRemove=this.status===1;this._destroy();if(shouldRemove){this.bdom.remove();}}
_destroy(){const component=this.component;if(this.status===1){for(let cb of this.willUnmount){cb.call(component);}}
for(let child of Object.values(this.children)){child._destroy();}
if(this.willDestroy.length){try{for(let cb of this.willDestroy){cb.call(component);}}
catch(e){this.app.handleError({error:e,node:this});}}
this.status=3;}
async updateAndRender(props,parentFiber){this.nextProps=props;props=Object.assign({},props);const fiber=makeChildFiber(this,parentFiber);this.fiber=fiber;const component=this.component;const defaultProps=component.constructor.defaultProps;if(defaultProps){applyDefaultProps(props,defaultProps);}
currentNode=this;for(const key in props){const prop=props[key];if(prop&&typeof prop==="object"&&targets.has(prop)){props[key]=useState(prop);}}
currentNode=null;const prom=Promise.all(this.willUpdateProps.map((f)=>f.call(component,props)));await prom;if(fiber!==this.fiber){return;}
component.props=props;fiber.render();const parentRoot=parentFiber.root;if(this.willPatch.length){parentRoot.willPatch.push(fiber);}
if(this.patched.length){parentRoot.patched.push(fiber);}}
updateDom(){if(!this.fiber){return;}
if(this.bdom===this.fiber.bdom){for(let k in this.children){const child=this.children[k];child.updateDom();}}
else{this.bdom.patch(this.fiber.bdom,false);this.fiber.appliedToDom=true;this.fiber=null;}}
setRef(name,el){if(el){this.refs[name]=el;}}
firstNode(){const bdom=this.bdom;return bdom?bdom.firstNode():undefined;}
mount(parent,anchor){const bdom=this.fiber.bdom;this.bdom=bdom;bdom.mount(parent,anchor);this.status=1;this.fiber.appliedToDom=true;this.children=this.fiber.childrenMap;this.fiber=null;}
moveBeforeDOMNode(node,parent){this.bdom.moveBeforeDOMNode(node,parent);}
moveBeforeVNode(other,afterNode){this.bdom.moveBeforeVNode(other?other.bdom:null,afterNode);}
patch(){if(this.fiber&&this.fiber.parent){this._patch();this.props=this.nextProps;}}
_patch(){let hasChildren=false;for(let _k in this.children){hasChildren=true;break;}
const fiber=this.fiber;this.children=fiber.childrenMap;this.bdom.patch(fiber.bdom,hasChildren);fiber.appliedToDom=true;this.fiber=null;}
beforeRemove(){this._destroy();}
remove(){this.bdom.remove();}
get name(){return this.component.constructor.name;}
get subscriptions(){const render=batchedRenderFunctions.get(this);return render?getSubscriptions(render):[];}}
const TIMEOUT=Symbol("timeout");const HOOK_TIMEOUT={onWillStart:3000,onWillUpdateProps:3000,};function wrapError(fn,hookName){const error=new OwlError();const timeoutError=new OwlError();const node=getCurrent();return(...args)=>{const onError=(cause)=>{error.cause=cause;error.message=cause instanceof Error?`The following error occurred in ${hookName}: "${cause.message}"`:`Something that is not an Error was thrown in ${hookName} (see this Error's "cause" property)`;throw error;};let result;try{result=fn(...args);}
catch(cause){onError(cause);}
if(!(result instanceof Promise)){return result;}
const timeout=HOOK_TIMEOUT[hookName];if(timeout){const fiber=node.fiber;Promise.race([result.catch(()=>{}),new Promise((resolve)=>setTimeout(()=>resolve(TIMEOUT),timeout)),]).then((res)=>{if(res===TIMEOUT&&node.fiber===fiber&&node.status<=2){timeoutError.message=`${hookName}'s promise hasn't resolved after ${timeout / 1000} seconds`;console.log(timeoutError);}});}
return result.catch(onError);};}
function onWillStart(fn){const node=getCurrent();const decorate=node.app.dev?wrapError:(fn)=>fn;node.willStart.push(decorate(fn.bind(node.component),"onWillStart"));}
function onWillUpdateProps(fn){const node=getCurrent();const decorate=node.app.dev?wrapError:(fn)=>fn;node.willUpdateProps.push(decorate(fn.bind(node.component),"onWillUpdateProps"));}
function onMounted(fn){const node=getCurrent();const decorate=node.app.dev?wrapError:(fn)=>fn;node.mounted.push(decorate(fn.bind(node.component),"onMounted"));}
function onWillPatch(fn){const node=getCurrent();const decorate=node.app.dev?wrapError:(fn)=>fn;node.willPatch.unshift(decorate(fn.bind(node.component),"onWillPatch"));}
function onPatched(fn){const node=getCurrent();const decorate=node.app.dev?wrapError:(fn)=>fn;node.patched.push(decorate(fn.bind(node.component),"onPatched"));}
function onWillUnmount(fn){const node=getCurrent();const decorate=node.app.dev?wrapError:(fn)=>fn;node.willUnmount.unshift(decorate(fn.bind(node.component),"onWillUnmount"));}
function onWillDestroy(fn){const node=getCurrent();const decorate=node.app.dev?wrapError:(fn)=>fn;node.willDestroy.push(decorate(fn.bind(node.component),"onWillDestroy"));}
function onWillRender(fn){const node=getCurrent();const renderFn=node.renderFn;const decorate=node.app.dev?wrapError:(fn)=>fn;fn=decorate(fn.bind(node.component),"onWillRender");node.renderFn=()=>{fn();return renderFn();};}
function onRendered(fn){const node=getCurrent();const renderFn=node.renderFn;const decorate=node.app.dev?wrapError:(fn)=>fn;fn=decorate(fn.bind(node.component),"onRendered");node.renderFn=()=>{const result=renderFn();fn();return result;};}
function onError(callback){const node=getCurrent();let handlers=nodeErrorHandlers.get(node);if(!handlers){handlers=[];nodeErrorHandlers.set(node,handlers);}
handlers.push(callback.bind(node.component));}
class Component{constructor(props,env,node){this.props=props;this.env=env;this.__owl__=node;}
setup(){}
render(deep=false){this.__owl__.render(deep===true);}}
Component.template="";const VText=text("").constructor;class VPortal extends VText{constructor(selector,content){super("");this.target=null;this.selector=selector;this.content=content;}
mount(parent,anchor){super.mount(parent,anchor);this.target=document.querySelector(this.selector);if(this.target){this.content.mount(this.target,null);}
else{this.content.mount(parent,anchor);}}
beforeRemove(){this.content.beforeRemove();}
remove(){if(this.content){super.remove();this.content.remove();this.content=null;}}
patch(other){super.patch(other);if(this.content){this.content.patch(other.content,true);}
else{this.content=other.content;this.content.mount(this.target,null);}}}
function portalTemplate(app,bdom,helpers){let{callSlot}=helpers;return function template(ctx,node,key=""){return new VPortal(ctx.props.target,callSlot(ctx,node,key,"default",false,null));};}
class Portal extends Component{setup(){const node=this.__owl__;onMounted(()=>{const portal=node.bdom;if(!portal.target){const target=document.querySelector(this.props.target);if(target){portal.content.moveBeforeDOMNode(target.firstChild,target);}
else{throw new OwlError("invalid portal target");}}});onWillUnmount(()=>{const portal=node.bdom;portal.remove();});}}
Portal.template="__portal__";Portal.props={target:{type:String,},slots:true,};const isUnionType=(t)=>Array.isArray(t);const isBaseType=(t)=>typeof t!=="object";const isValueType=(t)=>typeof t==="object"&&t&&"value"in t;function isOptional(t){return typeof t==="object"&&"optional"in t?t.optional||false:false;}
function describeType(type){return type==="*"||type===true?"value":type.name.toLowerCase();}
function describe(info){if(isBaseType(info)){return describeType(info);}
else if(isUnionType(info)){return info.map(describe).join(" or ");}
else if(isValueType(info)){return String(info.value);}
if("element"in info){return`list of ${describe({ type: info.element, optional: false })}s`;}
if("shape"in info){return`object`;}
return describe(info.type||"*");}
function toSchema(spec){return Object.fromEntries(spec.map((e)=>e.endsWith("?")?[e.slice(0,-1),{optional:true}]:[e,{type:"*",optional:false}]));}
function validate(obj,spec){let errors=validateSchema(obj,spec);if(errors.length){throw new OwlError("Invalid object: "+errors.join(", "));}}
function validateSchema(obj,schema){if(Array.isArray(schema)){schema=toSchema(schema);}
obj=toRaw(obj);let errors=[];for(let key in obj){if(key in schema){let result=validateType(key,obj[key],schema[key]);if(result){errors.push(result);}}
else if(!("*"in schema)){errors.push(`unknown key '${key}'`);}}
for(let key in schema){const spec=schema[key];if(key!=="*"&&!isOptional(spec)&&!(key in obj)){const isObj=typeof spec==="object"&&!Array.isArray(spec);const isAny=spec==="*"||(isObj&&"type"in spec?spec.type==="*":isObj);let detail=isAny?"":` (should be a ${describe(spec)})`;errors.push(`'${key}' is missing${detail}`);}}
return errors;}
function validateBaseType(key,value,type){if(typeof type==="function"){if(typeof value==="object"){if(!(value instanceof type)){return`'${key}' is not a ${describeType(type)}`;}}
else if(typeof value!==type.name.toLowerCase()){return`'${key}' is not a ${describeType(type)}`;}}
return null;}
function validateArrayType(key,value,descr){if(!Array.isArray(value)){return`'${key}' is not a list of ${describe(descr)}s`;}
for(let i=0;i<value.length;i++){const error=validateType(`${key}[${i}]`,value[i],descr);if(error){return error;}}
return null;}
function validateType(key,value,descr){if(value===undefined){return isOptional(descr)?null:`'${key}' is undefined (should be a ${describe(descr)})`;}
else if(isBaseType(descr)){return validateBaseType(key,value,descr);}
else if(isValueType(descr)){return value===descr.value?null:`'${key}' is not equal to '${descr.value}'`;}
else if(isUnionType(descr)){let validDescr=descr.find((p)=>!validateType(key,value,p));return validDescr?null:`'${key}' is not a ${describe(descr)}`;}
let result=null;if("element"in descr){result=validateArrayType(key,value,descr.element);}
else if("shape"in descr){if(typeof value!=="object"||Array.isArray(value)){result=`'${key}' is not an object`;}
else{const errors=validateSchema(value,descr.shape);if(errors.length){result=`'${key}' doesn't have the correct shape (${errors.join(", ")})`;}}}
else if("values"in descr){if(typeof value!=="object"||Array.isArray(value)){result=`'${key}' is not an object`;}
else{const errors=Object.entries(value).map(([key,value])=>validateType(key,value,descr.values)).filter(Boolean);if(errors.length){result=`some of the values in '${key}' are invalid (${errors.join(", ")})`;}}}
if("type"in descr&&!result){result=validateType(key,value,descr.type);}
if("validate"in descr&&!result){result=!descr.validate(value)?`'${key}' is not valid`:null;}
return result;}
const ObjectCreate=Object.create;function withDefault(value,defaultValue){return value===undefined||value===null||value===false?defaultValue:value;}
function callSlot(ctx,parent,key,name,dynamic,extra,defaultContent){key=key+"__slot_"+name;const slots=ctx.props.slots||{};const{__render,__ctx,__scope}=slots[name]||{};const slotScope=ObjectCreate(__ctx||{});if(__scope){slotScope[__scope]=extra;}
const slotBDom=__render?__render(slotScope,parent,key):null;if(defaultContent){let child1=undefined;let child2=undefined;if(slotBDom){child1=dynamic?toggler(name,slotBDom):slotBDom;}
else{child2=defaultContent(ctx,parent,key);}
return multi([child1,child2]);}
return slotBDom||text("");}
function capture(ctx){const result=ObjectCreate(ctx);for(let k in ctx){result[k]=ctx[k];}
return result;}
function withKey(elem,k){elem.key=k;return elem;}
function prepareList(collection){let keys;let values;if(Array.isArray(collection)){keys=collection;values=collection;}
else if(collection instanceof Map){keys=[...collection.keys()];values=[...collection.values()];}
else if(Symbol.iterator in Object(collection)){keys=[...collection];values=keys;}
else if(collection&&typeof collection==="object"){values=Object.values(collection);keys=Object.keys(collection);}
else{throw new OwlError(`Invalid loop expression: "${collection}" is not iterable`);}
const n=values.length;return[keys,values,n,new Array(n)];}
const isBoundary=Symbol("isBoundary");function setContextValue(ctx,key,value){const ctx0=ctx;while(!ctx.hasOwnProperty(key)&&!ctx.hasOwnProperty(isBoundary)){const newCtx=ctx.__proto__;if(!newCtx){ctx=ctx0;break;}
ctx=newCtx;}
ctx[key]=value;}
function toNumber(val){const n=parseFloat(val);return isNaN(n)?val:n;}
function shallowEqual(l1,l2){for(let i=0,l=l1.length;i<l;i++){if(l1[i]!==l2[i]){return false;}}
return true;}
class LazyValue{constructor(fn,ctx,component,node,key){this.fn=fn;this.ctx=capture(ctx);this.component=component;this.node=node;this.key=key;}
evaluate(){return this.fn.call(this.component,this.ctx,this.node,this.key);}
toString(){return this.evaluate().toString();}}
function safeOutput(value,defaultValue){if(value===undefined||value===null){return defaultValue?toggler("default",defaultValue):toggler("undefined",text(""));}
let safeKey;let block;switch(typeof value){case"object":if(value instanceof Markup){safeKey=`string_safe`;block=html(value);}
else if(value instanceof LazyValue){safeKey=`lazy_value`;block=value.evaluate();}
else if(value instanceof String){safeKey="string_unsafe";block=text(value);}
else{safeKey="block_safe";block=value;}
break;case"string":safeKey="string_unsafe";block=text(value);break;default:safeKey="string_unsafe";block=text(String(value));}
return toggler(safeKey,block);}
function validateProps(name,props,comp){const ComponentClass=typeof name!=="string"?name:comp.constructor.components[name];if(!ComponentClass){return;}
const schema=ComponentClass.props;if(!schema){if(comp.__owl__.app.warnIfNoStaticProps){console.warn(`Component '${ComponentClass.name}' does not have a static props description`);}
return;}
const defaultProps=ComponentClass.defaultProps;if(defaultProps){let isMandatory=(name)=>Array.isArray(schema)?schema.includes(name):name in schema&&!("*"in schema)&&!isOptional(schema[name]);for(let p in defaultProps){if(isMandatory(p)){throw new OwlError(`A default value cannot be defined for a mandatory prop (name: '${p}', component: ${ComponentClass.name})`);}}}
const errors=validateSchema(props,schema);if(errors.length){throw new OwlError(`Invalid props for component '${ComponentClass.name}': `+errors.join(", "));}}
function makeRefWrapper(node){let refNames=new Set();return(name,fn)=>{if(refNames.has(name)){throw new OwlError(`Cannot set the same ref more than once in the same component, ref "${name}" was set multiple times in ${node.name}`);}
refNames.add(name);return fn;};}
const helpers={withDefault,zero:Symbol("zero"),isBoundary,callSlot,capture,withKey,prepareList,setContextValue,shallowEqual,toNumber,validateProps,LazyValue,safeOutput,createCatcher,markRaw,OwlError,makeRefWrapper,};function parseXML(xml){const parser=new DOMParser();const doc=parser.parseFromString(xml,"text/xml");if(doc.getElementsByTagName("parsererror").length){let msg="Invalid XML in template.";const parsererrorText=doc.getElementsByTagName("parsererror")[0].textContent;if(parsererrorText){msg+="\nThe parser has produced the following error message:\n"+parsererrorText;const re=/\d+/g;const firstMatch=re.exec(parsererrorText);if(firstMatch){const lineNumber=Number(firstMatch[0]);const line=xml.split("\n")[lineNumber-1];const secondMatch=re.exec(parsererrorText);if(line&&secondMatch){const columnIndex=Number(secondMatch[0])-1;if(line[columnIndex]){msg+=`\nThe error might be located at xml line ${lineNumber} column ${columnIndex}\n`+`${line}\n${"-".repeat(columnIndex - 1)}^`;}}}}
throw new OwlError(msg);}
return doc;}
const bdom={text,createBlock,list,multi,html,toggler,comment};class TemplateSet{constructor(config={}){this.rawTemplates=Object.create(globalTemplates);this.templates={};this.Portal=Portal;this.dev=config.dev||false;this.translateFn=config.translateFn;this.translatableAttributes=config.translatableAttributes;if(config.templates){if(config.templates instanceof Document||typeof config.templates==="string"){this.addTemplates(config.templates);}
else{for(const name in config.templates){this.addTemplate(name,config.templates[name]);}}}
this.getRawTemplate=config.getTemplate;this.customDirectives=config.customDirectives||{};this.runtimeUtils={...helpers,__globals__:config.globalValues||{}};this.hasGlobalValues=Boolean(config.globalValues&&Object.keys(config.globalValues).length);}
static registerTemplate(name,fn){globalTemplates[name]=fn;}
addTemplate(name,template){if(name in this.rawTemplates){if(!this.dev){return;}
const rawTemplate=this.rawTemplates[name];const currentAsString=typeof rawTemplate==="string"?rawTemplate:rawTemplate instanceof Element?rawTemplate.outerHTML:rawTemplate.toString();const newAsString=typeof template==="string"?template:template.outerHTML;if(currentAsString===newAsString){return;}
throw new OwlError(`Template ${name} already defined with different content`);}
this.rawTemplates[name]=template;}
addTemplates(xml){if(!xml){return;}
xml=xml instanceof Document?xml:parseXML(xml);for(const template of xml.querySelectorAll("[t-name]")){const name=template.getAttribute("t-name");this.addTemplate(name,template);}}
getTemplate(name){var _a;if(!(name in this.templates)){const rawTemplate=((_a=this.getRawTemplate)===null||_a===void 0?void 0:_a.call(this,name))||this.rawTemplates[name];if(rawTemplate===undefined){let extraInfo="";try{const componentName=getCurrent().component.constructor.name;extraInfo=` (for component "${componentName}")`;}
catch{}
throw new OwlError(`Missing template: "${name}"${extraInfo}`);}
const isFn=typeof rawTemplate==="function"&&!(rawTemplate instanceof Element);const templateFn=isFn?rawTemplate:this._compileTemplate(name,rawTemplate);const templates=this.templates;this.templates[name]=function(context,parent){return templates[name].call(this,context,parent);};const template=templateFn(this,bdom,this.runtimeUtils);this.templates[name]=template;}
return this.templates[name];}
_compileTemplate(name,template){throw new OwlError(`Unable to compile a template. Please use owl full build instead`);}
callTemplate(owner,subTemplate,ctx,parent,key){const template=this.getTemplate(subTemplate);return toggler(subTemplate,template.call(owner,ctx,parent,key+subTemplate));}}
const globalTemplates={};function xml(...args){const name=`__template__${xml.nextId++}`;const value=String.raw(...args);globalTemplates[name]=value;return name;}
xml.nextId=1;TemplateSet.registerTemplate("__portal__",portalTemplate);const RESERVED_WORDS="true,false,NaN,null,undefined,debugger,console,window,in,instanceof,new,function,return,eval,void,Math,RegExp,Array,Object,Date,__globals__".split(",");const WORD_REPLACEMENT=Object.assign(Object.create(null),{and:"&&",or:"||",gt:">",gte:">=",lt:"<",lte:"<=",});const STATIC_TOKEN_MAP=Object.assign(Object.create(null),{"{":"LEFT_BRACE","}":"RIGHT_BRACE","[":"LEFT_BRACKET","]":"RIGHT_BRACKET",":":"COLON",",":"COMMA","(":"LEFT_PAREN",")":"RIGHT_PAREN",});const OPERATORS="...,.,===,==,+,!==,!=,!,||,&&,>=,>,<=,<,?,-,*,/,%,typeof ,=>,=,;,in ,new ,|,&,^,~".split(",");let tokenizeString=function(expr){let s=expr[0];let start=s;if(s!=="'"&&s!=='"'&&s!=="`"){return false;}
let i=1;let cur;while(expr[i]&&expr[i]!==start){cur=expr[i];s+=cur;if(cur==="\\"){i++;cur=expr[i];if(!cur){throw new OwlError("Invalid expression");}
s+=cur;}
i++;}
if(expr[i]!==start){throw new OwlError("Invalid expression");}
s+=start;if(start==="`"){return{type:"TEMPLATE_STRING",value:s,replace(replacer){return s.replace(/\$\{(.*?)\}/g,(match,group)=>{return"${"+replacer(group)+"}";});},};}
return{type:"VALUE",value:s};};let tokenizeNumber=function(expr){let s=expr[0];if(s&&s.match(/[0-9]/)){let i=1;while(expr[i]&&expr[i].match(/[0-9]|\./)){s+=expr[i];i++;}
return{type:"VALUE",value:s};}
else{return false;}};let tokenizeSymbol=function(expr){let s=expr[0];if(s&&s.match(/[a-zA-Z_\$]/)){let i=1;while(expr[i]&&expr[i].match(/\w/)){s+=expr[i];i++;}
if(s in WORD_REPLACEMENT){return{type:"OPERATOR",value:WORD_REPLACEMENT[s],size:s.length};}
return{type:"SYMBOL",value:s};}
else{return false;}};const tokenizeStatic=function(expr){const char=expr[0];if(char&&char in STATIC_TOKEN_MAP){return{type:STATIC_TOKEN_MAP[char],value:char};}
return false;};const tokenizeOperator=function(expr){for(let op of OPERATORS){if(expr.startsWith(op)){return{type:"OPERATOR",value:op};}}
return false;};const TOKENIZERS=[tokenizeString,tokenizeNumber,tokenizeOperator,tokenizeSymbol,tokenizeStatic,];function tokenize(expr){const result=[];let token=true;let error;let current=expr;try{while(token){current=current.trim();if(current){for(let tokenizer of TOKENIZERS){token=tokenizer(current);if(token){result.push(token);current=current.slice(token.size||token.value.length);break;}}}
else{token=false;}}}
catch(e){error=e;}
if(current.length||error){throw new OwlError(`Tokenizer error: could not tokenize \`${expr}\``);}
return result;}
const isLeftSeparator=(token)=>token&&(token.type==="LEFT_BRACE"||token.type==="COMMA");const isRightSeparator=(token)=>token&&(token.type==="RIGHT_BRACE"||token.type==="COMMA");function compileExprToArray(expr){const localVars=new Set();const tokens=tokenize(expr);let i=0;let stack=[];while(i<tokens.length){let token=tokens[i];let prevToken=tokens[i-1];let nextToken=tokens[i+1];let groupType=stack[stack.length-1];switch(token.type){case"LEFT_BRACE":case"LEFT_BRACKET":case"LEFT_PAREN":stack.push(token.type);break;case"RIGHT_BRACE":case"RIGHT_BRACKET":case"RIGHT_PAREN":stack.pop();}
let isVar=token.type==="SYMBOL"&&!RESERVED_WORDS.includes(token.value);if(token.type==="SYMBOL"&&!RESERVED_WORDS.includes(token.value)){if(prevToken){if(groupType==="LEFT_BRACE"&&isLeftSeparator(prevToken)&&isRightSeparator(nextToken)){tokens.splice(i+1,0,{type:"COLON",value:":"},{...token});nextToken=tokens[i+1];}
if(prevToken.type==="OPERATOR"&&prevToken.value==="."){isVar=false;}
else if(prevToken.type==="LEFT_BRACE"||prevToken.type==="COMMA"){if(nextToken&&nextToken.type==="COLON"){isVar=false;}}}}
if(token.type==="TEMPLATE_STRING"){token.value=token.replace((expr)=>compileExpr(expr));}
if(nextToken&&nextToken.type==="OPERATOR"&&nextToken.value==="=>"){if(token.type==="RIGHT_PAREN"){let j=i-1;while(j>0&&tokens[j].type!=="LEFT_PAREN"){if(tokens[j].type==="SYMBOL"&&tokens[j].originalValue){tokens[j].value=tokens[j].originalValue;localVars.add(tokens[j].value);}
j--;}}
else{localVars.add(token.value);}}
if(isVar){token.varName=token.value;if(!localVars.has(token.value)){token.originalValue=token.value;token.value=`ctx['${token.value}']`;}}
i++;}
for(const token of tokens){if(token.type==="SYMBOL"&&token.varName&&localVars.has(token.value)){token.originalValue=token.value;token.value=`_${token.value}`;token.isLocal=true;}}
return tokens;}
const paddedValues=new Map([["in "," in "]]);function compileExpr(expr){return compileExprToArray(expr).map((t)=>paddedValues.get(t.value)||t.value).join("");}
const INTERP_REGEXP=/\{\{.*?\}\}|\#\{.*?\}/g;function replaceDynamicParts(s,replacer){let matches=s.match(INTERP_REGEXP);if(matches&&matches[0].length===s.length){return`(${replacer(s.slice(2, matches[0][0] === "{" ? -2 : -1))})`;}
let r=s.replace(INTERP_REGEXP,(s)=>"${"+replacer(s.slice(2,s[0]==="{"?-2:-1))+"}");return"`"+r+"`";}
function interpolate(s){return replaceDynamicParts(s,compileExpr);}
const whitespaceRE=/\s+/g;const xmlDoc=document.implementation.createDocument(null,null,null);const MODS=new Set(["stop","capture","prevent","self","synthetic"]);let nextDataIds={};function generateId(prefix=""){nextDataIds[prefix]=(nextDataIds[prefix]||0)+1;return prefix+nextDataIds[prefix];}
function isProp(tag,key){switch(tag){case"input":return(key==="checked"||key==="indeterminate"||key==="value"||key==="readonly"||key==="readOnly"||key==="disabled");case"option":return key==="selected"||key==="disabled";case"textarea":return key==="value"||key==="readonly"||key==="readOnly"||key==="disabled";case"select":return key==="value"||key==="disabled";case"button":case"optgroup":return key==="disabled";}
return false;}
function toStringExpression(str){return`\`${str.replace(/\\/g, "\\\\").replace(/`/g,"\\`").replace(/\$\{/,"\\${")}\``;}
class BlockDescription{constructor(target,type){this.dynamicTagName=null;this.isRoot=false;this.hasDynamicChildren=false;this.children=[];this.data=[];this.childNumber=0;this.parentVar="";this.id=BlockDescription.nextBlockId++;this.varName="b"+this.id;this.blockName="block"+this.id;this.target=target;this.type=type;}
insertData(str,prefix="d"){const id=generateId(prefix);this.target.addLine(`let ${id} = ${str};`);return this.data.push(id)-1;}
insert(dom){if(this.currentDom){this.currentDom.appendChild(dom);}
else{this.dom=dom;}}
generateExpr(expr){if(this.type==="block"){const hasChildren=this.children.length;let params=this.data.length?`[${this.data.join(", ")}]`:hasChildren?"[]":"";if(hasChildren){params+=", ["+this.children.map((c)=>c.varName).join(", ")+"]";}
if(this.dynamicTagName){return`toggler(${this.dynamicTagName}, ${this.blockName}(${this.dynamicTagName})(${params}))`;}
return`${this.blockName}(${params})`;}
else if(this.type==="list"){return`list(c_block${this.id})`;}
return expr;}
asXmlString(){const t=xmlDoc.createElement("t");t.appendChild(this.dom);return t.innerHTML;}}
BlockDescription.nextBlockId=1;function createContext(parentCtx,params){return Object.assign({block:null,index:0,forceNewBlock:true,translate:parentCtx.translate,translationCtx:parentCtx.translationCtx,tKeyExpr:null,nameSpace:parentCtx.nameSpace,tModelSelectedExpr:parentCtx.tModelSelectedExpr,},params);}
class CodeTarget{constructor(name,on){this.indentLevel=0;this.loopLevel=0;this.code=[];this.hasRoot=false;this.hasCache=false;this.shouldProtectScope=false;this.hasRefWrapper=false;this.name=name;this.on=on||null;}
addLine(line,idx){const prefix=new Array(this.indentLevel+2).join("  ");if(idx===undefined){this.code.push(prefix+line);}
else{this.code.splice(idx,0,prefix+line);}}
generateCode(){let result=[];result.push(`function ${this.name}(ctx, node, key = "") {`);if(this.shouldProtectScope){result.push(`  ctx = Object.create(ctx);`);result.push(`  ctx[isBoundary] = 1`);}
if(this.hasRefWrapper){result.push(`  let refWrapper = makeRefWrapper(this.__owl__);`);}
if(this.hasCache){result.push(`  let cache = ctx.cache || {};`);result.push(`  let nextCache = ctx.cache = {};`);}
for(let line of this.code){result.push(line);}
if(!this.hasRoot){result.push(`return text('');`);}
result.push(`}`);return result.join("\n  ");}
currentKey(ctx){let key=this.loopLevel?`key${this.loopLevel}`:"key";if(ctx.tKeyExpr){key=`${ctx.tKeyExpr} + ${key}`;}
return key;}}
const TRANSLATABLE_ATTRS=["alt","aria-label","aria-placeholder","aria-roledescription","aria-valuetext","label","placeholder","title",];const translationRE=/^(\s*)([\s\S]+?)(\s*)$/;class CodeGenerator{constructor(ast,options){this.blocks=[];this.nextBlockId=1;this.isDebug=false;this.targets=[];this.target=new CodeTarget("template");this.translatableAttributes=TRANSLATABLE_ATTRS;this.staticDefs=[];this.slotNames=new Set();this.helpers=new Set();this.translateFn=options.translateFn||((s)=>s);if(options.translatableAttributes){const attrs=new Set(TRANSLATABLE_ATTRS);for(let attr of options.translatableAttributes){if(attr.startsWith("-")){attrs.delete(attr.slice(1));}
else{attrs.add(attr);}}
this.translatableAttributes=[...attrs];}
this.hasSafeContext=options.hasSafeContext||false;this.dev=options.dev||false;this.ast=ast;this.templateName=options.name;if(options.hasGlobalValues){this.helpers.add("__globals__");}}
generateCode(){const ast=this.ast;this.isDebug=ast.type===12;BlockDescription.nextBlockId=1;nextDataIds={};this.compileAST(ast,{block:null,index:0,forceNewBlock:false,isLast:true,translate:true,translationCtx:"",tKeyExpr:null,});let mainCode=[`  let { text, createBlock, list, multi, html, toggler, comment } = bdom;`];if(this.helpers.size){mainCode.push(`let { ${[...this.helpers].join(", ")} } = helpers;`);}
if(this.templateName){mainCode.push(`// Template name: "${this.templateName}"`);}
for(let{id,expr}of this.staticDefs){mainCode.push(`const ${id} = ${expr};`);}
if(this.blocks.length){mainCode.push(``);for(let block of this.blocks){if(block.dom){let xmlString=toStringExpression(block.asXmlString());if(block.dynamicTagName){xmlString=xmlString.replace(/^`<\w+/,`\`<\${tag || '${block.dom.nodeName}'}`);xmlString=xmlString.replace(/\w+>`$/,`\${tag || '${block.dom.nodeName}'}>\``);mainCode.push(`let ${block.blockName} = tag => createBlock(${xmlString});`);}
else{mainCode.push(`let ${block.blockName} = createBlock(${xmlString});`);}}}}
if(this.targets.length){for(let fn of this.targets){mainCode.push("");mainCode=mainCode.concat(fn.generateCode());}}
mainCode.push("");mainCode=mainCode.concat("return "+this.target.generateCode());const code=mainCode.join("\n  ");if(this.isDebug){const msg=`[Owl Debug]\n${code}`;console.log(msg);}
return code;}
compileInNewTarget(prefix,ast,ctx,on){const name=generateId(prefix);const initialTarget=this.target;const target=new CodeTarget(name,on);this.targets.push(target);this.target=target;this.compileAST(ast,createContext(ctx));this.target=initialTarget;return name;}
addLine(line,idx){this.target.addLine(line,idx);}
define(varName,expr){this.addLine(`const ${varName} = ${expr};`);}
insertAnchor(block,index=block.children.length){const tag=`block-child-${index}`;const anchor=xmlDoc.createElement(tag);block.insert(anchor);}
createBlock(parentBlock,type,ctx){const hasRoot=this.target.hasRoot;const block=new BlockDescription(this.target,type);if(!hasRoot){this.target.hasRoot=true;block.isRoot=true;}
if(parentBlock){parentBlock.children.push(block);if(parentBlock.type==="list"){block.parentVar=`c_block${parentBlock.id}`;}}
return block;}
insertBlock(expression,block,ctx){let blockExpr=block.generateExpr(expression);if(block.parentVar){let key=this.target.currentKey(ctx);this.helpers.add("withKey");this.addLine(`${block.parentVar}[${ctx.index}] = withKey(${blockExpr}, ${key});`);return;}
if(ctx.tKeyExpr){blockExpr=`toggler(${ctx.tKeyExpr}, ${blockExpr})`;}
if(block.isRoot){if(this.target.on){blockExpr=this.wrapWithEventCatcher(blockExpr,this.target.on);}
this.addLine(`return ${blockExpr};`);}
else{this.define(block.varName,blockExpr);}}
captureExpression(expr,forceCapture=false){if(!forceCapture&&!expr.includes("=>")){return compileExpr(expr);}
const tokens=compileExprToArray(expr);const mapping=new Map();return tokens.map((tok)=>{if(tok.varName&&!tok.isLocal){if(!mapping.has(tok.varName)){const varId=generateId("v");mapping.set(tok.varName,varId);this.define(varId,tok.value);}
tok.value=mapping.get(tok.varName);}
return tok.value;}).join("");}
translate(str,translationCtx){const match=translationRE.exec(str);return match[1]+this.translateFn(match[2],translationCtx)+match[3];}
compileAST(ast,ctx){switch(ast.type){case 1:return this.compileComment(ast,ctx);case 0:return this.compileText(ast,ctx);case 2:return this.compileTDomNode(ast,ctx);case 4:return this.compileTEsc(ast,ctx);case 8:return this.compileTOut(ast,ctx);case 5:return this.compileTIf(ast,ctx);case 9:return this.compileTForeach(ast,ctx);case 10:return this.compileTKey(ast,ctx);case 3:return this.compileMulti(ast,ctx);case 7:return this.compileTCall(ast,ctx);case 15:return this.compileTCallBlock(ast,ctx);case 6:return this.compileTSet(ast,ctx);case 11:return this.compileComponent(ast,ctx);case 12:return this.compileDebug(ast,ctx);case 13:return this.compileLog(ast,ctx);case 14:return this.compileTSlot(ast,ctx);case 16:return this.compileTTranslation(ast,ctx);case 17:return this.compileTTranslationContext(ast,ctx);case 18:return this.compileTPortal(ast,ctx);}}
compileDebug(ast,ctx){this.addLine(`debugger;`);if(ast.content){return this.compileAST(ast.content,ctx);}
return null;}
compileLog(ast,ctx){this.addLine(`console.log(${compileExpr(ast.expr)});`);if(ast.content){return this.compileAST(ast.content,ctx);}
return null;}
compileComment(ast,ctx){let{block,forceNewBlock}=ctx;const isNewBlock=!block||forceNewBlock;if(isNewBlock){block=this.createBlock(block,"comment",ctx);this.insertBlock(`comment(${toStringExpression(ast.value)})`,block,{...ctx,forceNewBlock:forceNewBlock&&!block,});}
else{const text=xmlDoc.createComment(ast.value);block.insert(text);}
return block.varName;}
compileText(ast,ctx){let{block,forceNewBlock}=ctx;let value=ast.value;if(value&&ctx.translate!==false){value=this.translate(value,ctx.translationCtx);}
if(!ctx.inPreTag){value=value.replace(whitespaceRE," ");}
if(!block||forceNewBlock){block=this.createBlock(block,"text",ctx);this.insertBlock(`text(${toStringExpression(value)})`,block,{...ctx,forceNewBlock:forceNewBlock&&!block,});}
else{const createFn=ast.type===0?xmlDoc.createTextNode:xmlDoc.createComment;block.insert(createFn.call(xmlDoc,value));}
return block.varName;}
generateHandlerCode(rawEvent,handler){const modifiers=rawEvent.split(".").slice(1).map((m)=>{if(!MODS.has(m)){throw new OwlError(`Unknown event modifier: '${m}'`);}
return`"${m}"`;});let modifiersCode="";if(modifiers.length){modifiersCode=`${modifiers.join(",")}, `;}
return`[${modifiersCode}${this.captureExpression(handler)}, ctx]`;}
compileTDomNode(ast,ctx){var _a;let{block,forceNewBlock}=ctx;const isNewBlock=!block||forceNewBlock||ast.dynamicTag!==null||ast.ns;let codeIdx=this.target.code.length;if(isNewBlock){if((ast.dynamicTag||ctx.tKeyExpr||ast.ns)&&ctx.block){this.insertAnchor(ctx.block);}
block=this.createBlock(block,"block",ctx);this.blocks.push(block);if(ast.dynamicTag){const tagExpr=generateId("tag");this.define(tagExpr,compileExpr(ast.dynamicTag));block.dynamicTagName=tagExpr;}}
const attrs={};for(let key in ast.attrs){let expr,attrName;if(key.startsWith("t-attf")){expr=interpolate(ast.attrs[key]);const idx=block.insertData(expr,"attr");attrName=key.slice(7);attrs["block-attribute-"+idx]=attrName;}
else if(key.startsWith("t-att")){attrName=key==="t-att"?null:key.slice(6);expr=compileExpr(ast.attrs[key]);if(attrName&&isProp(ast.tag,attrName)){if(attrName==="readonly"){attrName="readOnly";}
if(attrName==="value"){expr=`new String((${expr}) === 0 ? 0 : ((${expr}) || ""))`;}
else{expr=`new Boolean(${expr})`;}
const idx=block.insertData(expr,"prop");attrs[`block-property-${idx}`]=attrName;}
else{const idx=block.insertData(expr,"attr");if(key==="t-att"){attrs[`block-attributes`]=String(idx);}
else{attrs[`block-attribute-${idx}`]=attrName;}}}
else if(this.translatableAttributes.includes(key)){const attrTranslationCtx=((_a=ast.attrsTranslationCtx)===null||_a===void 0?void 0:_a[key])||ctx.translationCtx;attrs[key]=this.translateFn(ast.attrs[key],attrTranslationCtx);}
else{expr=`"${ast.attrs[key]}"`;attrName=key;attrs[key]=ast.attrs[key];}
if(attrName==="value"&&ctx.tModelSelectedExpr){let selectedId=block.insertData(`${ctx.tModelSelectedExpr} === ${expr}`,"attr");attrs[`block-attribute-${selectedId}`]="selected";}}
let tModelSelectedExpr;if(ast.model){const{hasDynamicChildren,baseExpr,expr,eventType,shouldNumberize,shouldTrim,targetAttr,specialInitTargetAttr,}=ast.model;const baseExpression=compileExpr(baseExpr);const bExprId=generateId("bExpr");this.define(bExprId,baseExpression);const expression=compileExpr(expr);const exprId=generateId("expr");this.define(exprId,expression);const fullExpression=`${bExprId}[${exprId}]`;let idx;if(specialInitTargetAttr){let targetExpr=targetAttr in attrs&&`'${attrs[targetAttr]}'`;if(!targetExpr&&ast.attrs){const dynamicTgExpr=ast.attrs[`t-att-${targetAttr}`];if(dynamicTgExpr){targetExpr=compileExpr(dynamicTgExpr);}}
idx=block.insertData(`${fullExpression} === ${targetExpr}`,"prop");attrs[`block-property-${idx}`]=specialInitTargetAttr;}
else if(hasDynamicChildren){const bValueId=generateId("bValue");tModelSelectedExpr=`${bValueId}`;this.define(tModelSelectedExpr,fullExpression);}
else{idx=block.insertData(`${fullExpression}`,"prop");attrs[`block-property-${idx}`]=targetAttr;}
this.helpers.add("toNumber");let valueCode=`ev.target.${targetAttr}`;valueCode=shouldTrim?`${valueCode}.trim()`:valueCode;valueCode=shouldNumberize?`toNumber(${valueCode})`:valueCode;const handler=`[(ev) => { ${fullExpression} = ${valueCode}; }]`;idx=block.insertData(handler,"hdlr");attrs[`block-handler-${idx}`]=eventType;}
for(let ev in ast.on){const name=this.generateHandlerCode(ev,ast.on[ev]);const idx=block.insertData(name,"hdlr");attrs[`block-handler-${idx}`]=ev;}
if(ast.ref){if(this.dev){this.helpers.add("makeRefWrapper");this.target.hasRefWrapper=true;}
const isDynamic=INTERP_REGEXP.test(ast.ref);let name=`\`${ast.ref}\``;if(isDynamic){name=replaceDynamicParts(ast.ref,(expr)=>this.captureExpression(expr,true));}
let setRefStr=`(el) => this.__owl__.setRef((${name}), el)`;if(this.dev){setRefStr=`refWrapper(${name}, ${setRefStr})`;}
const idx=block.insertData(setRefStr,"ref");attrs["block-ref"]=String(idx);}
const nameSpace=ast.ns||ctx.nameSpace;const dom=nameSpace?xmlDoc.createElementNS(nameSpace,ast.tag):xmlDoc.createElement(ast.tag);for(const[attr,val]of Object.entries(attrs)){if(!(attr==="class"&&val==="")){dom.setAttribute(attr,val);}}
block.insert(dom);if(ast.content.length){const initialDom=block.currentDom;block.currentDom=dom;const children=ast.content;for(let i=0;i<children.length;i++){const child=ast.content[i];const subCtx=createContext(ctx,{block,index:block.childNumber,forceNewBlock:false,isLast:ctx.isLast&&i===children.length-1,tKeyExpr:ctx.tKeyExpr,nameSpace,tModelSelectedExpr,inPreTag:ctx.inPreTag||ast.tag==="pre",});this.compileAST(child,subCtx);}
block.currentDom=initialDom;}
if(isNewBlock){this.insertBlock(`${block.blockName}(ddd)`,block,ctx);if(block.children.length&&block.hasDynamicChildren){const code=this.target.code;const children=block.children.slice();let current=children.shift();for(let i=codeIdx;i<code.length;i++){if(code[i].trimStart().startsWith(`const ${current.varName} `)){code[i]=code[i].replace(`const ${current.varName}`,current.varName);current=children.shift();if(!current)
break;}}
this.addLine(`let ${block.children.map((c) => c.varName).join(", ")};`,codeIdx);}}
return block.varName;}
compileTEsc(ast,ctx){let{block,forceNewBlock}=ctx;let expr;if(ast.expr==="0"){this.helpers.add("zero");expr=`ctx[zero]`;}
else{expr=compileExpr(ast.expr);if(ast.defaultValue){this.helpers.add("withDefault");expr=`withDefault(${expr}, ${toStringExpression(ast.defaultValue)})`;}}
if(!block||forceNewBlock){block=this.createBlock(block,"text",ctx);this.insertBlock(`text(${expr})`,block,{...ctx,forceNewBlock:forceNewBlock&&!block});}
else{const idx=block.insertData(expr,"txt");const text=xmlDoc.createElement(`block-text-${idx}`);block.insert(text);}
return block.varName;}
compileTOut(ast,ctx){let{block}=ctx;if(block){this.insertAnchor(block);}
block=this.createBlock(block,"html",ctx);let blockStr;if(ast.expr==="0"){this.helpers.add("zero");blockStr=`ctx[zero]`;}
else if(ast.body){let bodyValue=null;bodyValue=BlockDescription.nextBlockId;const subCtx=createContext(ctx);this.compileAST({type:3,content:ast.body},subCtx);this.helpers.add("safeOutput");blockStr=`safeOutput(${compileExpr(ast.expr)}, b${bodyValue})`;}
else{this.helpers.add("safeOutput");blockStr=`safeOutput(${compileExpr(ast.expr)})`;}
this.insertBlock(blockStr,block,ctx);return block.varName;}
compileTIfBranch(content,block,ctx){this.target.indentLevel++;let childN=block.children.length;this.compileAST(content,createContext(ctx,{block,index:ctx.index}));if(block.children.length>childN){this.insertAnchor(block,childN);}
this.target.indentLevel--;}
compileTIf(ast,ctx,nextNode){let{block,forceNewBlock}=ctx;const codeIdx=this.target.code.length;const isNewBlock=!block||(block.type!=="multi"&&forceNewBlock);if(block){block.hasDynamicChildren=true;}
if(!block||(block.type!=="multi"&&forceNewBlock)){block=this.createBlock(block,"multi",ctx);}
this.addLine(`if (${compileExpr(ast.condition)}) {`);this.compileTIfBranch(ast.content,block,ctx);if(ast.tElif){for(let clause of ast.tElif){this.addLine(`} else if (${compileExpr(clause.condition)}) {`);this.compileTIfBranch(clause.content,block,ctx);}}
if(ast.tElse){this.addLine(`} else {`);this.compileTIfBranch(ast.tElse,block,ctx);}
this.addLine("}");if(isNewBlock){if(block.children.length){const code=this.target.code;const children=block.children.slice();let current=children.shift();for(let i=codeIdx;i<code.length;i++){if(code[i].trimStart().startsWith(`const ${current.varName} `)){code[i]=code[i].replace(`const ${current.varName}`,current.varName);current=children.shift();if(!current)
break;}}
this.addLine(`let ${block.children.map((c) => c.varName).join(", ")};`,codeIdx);}
const args=block.children.map((c)=>c.varName).join(", ");this.insertBlock(`multi([${args}])`,block,ctx);}
return block.varName;}
compileTForeach(ast,ctx){let{block}=ctx;if(block){this.insertAnchor(block);}
block=this.createBlock(block,"list",ctx);this.target.loopLevel++;const loopVar=`i${this.target.loopLevel}`;this.addLine(`ctx = Object.create(ctx);`);const vals=`v_block${block.id}`;const keys=`k_block${block.id}`;const l=`l_block${block.id}`;const c=`c_block${block.id}`;this.helpers.add("prepareList");this.define(`[${keys}, ${vals}, ${l}, ${c}]`,`prepareList(${compileExpr(ast.collection)});`);if(this.dev){this.define(`keys${block.id}`,`new Set()`);}
this.addLine(`for (let ${loopVar} = 0; ${loopVar} < ${l}; ${loopVar}++) {`);this.target.indentLevel++;this.addLine(`ctx[\`${ast.elem}\`] = ${keys}[${loopVar}];`);if(!ast.hasNoFirst){this.addLine(`ctx[\`${ast.elem}_first\`] = ${loopVar} === 0;`);}
if(!ast.hasNoLast){this.addLine(`ctx[\`${ast.elem}_last\`] = ${loopVar} === ${keys}.length - 1;`);}
if(!ast.hasNoIndex){this.addLine(`ctx[\`${ast.elem}_index\`] = ${loopVar};`);}
if(!ast.hasNoValue){this.addLine(`ctx[\`${ast.elem}_value\`] = ${vals}[${loopVar}];`);}
this.define(`key${this.target.loopLevel}`,ast.key?compileExpr(ast.key):loopVar);if(this.dev){this.helpers.add("OwlError");this.addLine(`if (keys${block.id}.has(String(key${this.target.loopLevel}))) { throw new OwlError(\`Got duplicate key in t-foreach: \${key${this.target.loopLevel}}\`)}`);this.addLine(`keys${block.id}.add(String(key${this.target.loopLevel}));`);}
let id;if(ast.memo){this.target.hasCache=true;id=generateId();this.define(`memo${id}`,compileExpr(ast.memo));this.define(`vnode${id}`,`cache[key${this.target.loopLevel}];`);this.addLine(`if (vnode${id}) {`);this.target.indentLevel++;this.addLine(`if (shallowEqual(vnode${id}.memo, memo${id})) {`);this.target.indentLevel++;this.addLine(`${c}[${loopVar}] = vnode${id};`);this.addLine(`nextCache[key${this.target.loopLevel}] = vnode${id};`);this.addLine(`continue;`);this.target.indentLevel--;this.addLine("}");this.target.indentLevel--;this.addLine("}");}
const subCtx=createContext(ctx,{block,index:loopVar});this.compileAST(ast.body,subCtx);if(ast.memo){this.addLine(`nextCache[key${this.target.loopLevel}] = Object.assign(${c}[${loopVar}], {memo: memo${id}});`);}
this.target.indentLevel--;this.target.loopLevel--;this.addLine(`}`);if(!ctx.isLast){this.addLine(`ctx = ctx.__proto__;`);}
this.insertBlock("l",block,ctx);return block.varName;}
compileTKey(ast,ctx){const tKeyExpr=generateId("tKey_");this.define(tKeyExpr,compileExpr(ast.expr));ctx=createContext(ctx,{tKeyExpr,block:ctx.block,index:ctx.index,});return this.compileAST(ast.content,ctx);}
compileMulti(ast,ctx){let{block,forceNewBlock}=ctx;const isNewBlock=!block||forceNewBlock;let codeIdx=this.target.code.length;if(isNewBlock){const n=ast.content.filter((c)=>!c.hasNoRepresentation).length;let result=null;if(n<=1){for(let child of ast.content){const blockName=this.compileAST(child,ctx);result=result||blockName;}
return result;}
block=this.createBlock(block,"multi",ctx);}
let index=0;for(let i=0,l=ast.content.length;i<l;i++){const child=ast.content[i];const forceNewBlock=!child.hasNoRepresentation;const subCtx=createContext(ctx,{block,index,forceNewBlock,isLast:ctx.isLast&&i===l-1,});this.compileAST(child,subCtx);if(forceNewBlock){index++;}}
if(isNewBlock){if(block.hasDynamicChildren&&block.children.length){const code=this.target.code;const children=block.children.slice();let current=children.shift();for(let i=codeIdx;i<code.length;i++){if(code[i].trimStart().startsWith(`const ${current.varName} `)){code[i]=code[i].replace(`const ${current.varName}`,current.varName);current=children.shift();if(!current)
break;}}
this.addLine(`let ${block.children.map((c) => c.varName).join(", ")};`,codeIdx);}
const args=block.children.map((c)=>c.varName).join(", ");this.insertBlock(`multi([${args}])`,block,ctx);}
return block.varName;}
compileTCall(ast,ctx){let{block,forceNewBlock}=ctx;let ctxVar=ctx.ctxVar||"ctx";if(ast.context){ctxVar=generateId("ctx");this.addLine(`let ${ctxVar} = ${compileExpr(ast.context)};`);}
const isDynamic=INTERP_REGEXP.test(ast.name);const subTemplate=isDynamic?interpolate(ast.name):"`"+ast.name+"`";if(block&&!forceNewBlock){this.insertAnchor(block);}
block=this.createBlock(block,"multi",ctx);if(ast.body){this.addLine(`${ctxVar} = Object.create(${ctxVar});`);this.addLine(`${ctxVar}[isBoundary] = 1;`);this.helpers.add("isBoundary");const subCtx=createContext(ctx,{ctxVar});const bl=this.compileMulti({type:3,content:ast.body},subCtx);if(bl){this.helpers.add("zero");this.addLine(`${ctxVar}[zero] = ${bl};`);}}
const key=this.generateComponentKey();if(isDynamic){const templateVar=generateId("template");if(!this.staticDefs.find((d)=>d.id==="call")){this.staticDefs.push({id:"call",expr:`app.callTemplate.bind(app)`});}
this.define(templateVar,subTemplate);this.insertBlock(`call(this, ${templateVar}, ${ctxVar}, node, ${key})`,block,{...ctx,forceNewBlock:!block,});}
else{const id=generateId(`callTemplate_`);this.staticDefs.push({id,expr:`app.getTemplate(${subTemplate})`});this.insertBlock(`${id}.call(this, ${ctxVar}, node, ${key})`,block,{...ctx,forceNewBlock:!block,});}
if(ast.body&&!ctx.isLast){this.addLine(`${ctxVar} = ${ctxVar}.__proto__;`);}
return block.varName;}
compileTCallBlock(ast,ctx){let{block,forceNewBlock}=ctx;if(block){if(!forceNewBlock){this.insertAnchor(block);}}
block=this.createBlock(block,"multi",ctx);this.insertBlock(compileExpr(ast.name),block,{...ctx,forceNewBlock:!block});return block.varName;}
compileTSet(ast,ctx){this.target.shouldProtectScope=true;this.helpers.add("isBoundary").add("withDefault");const expr=ast.value?compileExpr(ast.value||""):"null";if(ast.body){this.helpers.add("LazyValue");const bodyAst={type:3,content:ast.body};const name=this.compileInNewTarget("value",bodyAst,ctx);let key=this.target.currentKey(ctx);let value=`new LazyValue(${name}, ctx, this, node, ${key})`;value=ast.value?(value?`withDefault(${expr}, ${value})`:expr):value;this.addLine(`ctx[\`${ast.name}\`] = ${value};`);}
else{let value;if(ast.defaultValue){const defaultValue=toStringExpression(ctx.translate?this.translate(ast.defaultValue,ctx.translationCtx):ast.defaultValue);if(ast.value){value=`withDefault(${expr}, ${defaultValue})`;}
else{value=defaultValue;}}
else{value=expr;}
this.helpers.add("setContextValue");this.addLine(`setContextValue(${ctx.ctxVar || "ctx"}, "${ast.name}", ${value});`);}
return null;}
generateComponentKey(currentKey="key"){const parts=[generateId("__")];for(let i=0;i<this.target.loopLevel;i++){parts.push(`\${key${i + 1}}`);}
return`${currentKey} + \`${parts.join("__")}\``;}
formatProp(name,value,attrsTranslationCtx,translationCtx){if(name.endsWith(".translate")){const attrTranslationCtx=(attrsTranslationCtx===null||attrsTranslationCtx===void 0?void 0:attrsTranslationCtx[name])||translationCtx;value=toStringExpression(this.translateFn(value,attrTranslationCtx));}
else{value=this.captureExpression(value);}
if(name.includes(".")){let[_name,suffix]=name.split(".");name=_name;switch(suffix){case"bind":value=`(${value}).bind(this)`;break;case"alike":case"translate":break;default:throw new OwlError(`Invalid prop suffix: ${suffix}`);}}
name=/^[a-z_]+$/i.test(name)?name:`'${name}'`;return`${name}: ${value || undefined}`;}
formatPropObject(obj,attrsTranslationCtx,translationCtx){return Object.entries(obj).map(([k,v])=>this.formatProp(k,v,attrsTranslationCtx,translationCtx));}
getPropString(props,dynProps){let propString=`{${props.join(",")}}`;if(dynProps){propString=`Object.assign({}, ${compileExpr(dynProps)}${props.length ? ", " + propString : ""})`;}
return propString;}
compileComponent(ast,ctx){let{block}=ctx;const hasSlotsProp="slots"in(ast.props||{});const props=ast.props?this.formatPropObject(ast.props,ast.propsTranslationCtx,ctx.translationCtx):[];let slotDef="";if(ast.slots){let ctxStr="ctx";if(this.target.loopLevel||!this.hasSafeContext){ctxStr=generateId("ctx");this.helpers.add("capture");this.define(ctxStr,`capture(ctx)`);}
let slotStr=[];for(let slotName in ast.slots){const slotAst=ast.slots[slotName];const params=[];if(slotAst.content){const name=this.compileInNewTarget("slot",slotAst.content,ctx,slotAst.on);params.push(`__render: ${name}.bind(this), __ctx: ${ctxStr}`);}
const scope=ast.slots[slotName].scope;if(scope){params.push(`__scope: "${scope}"`);}
if(ast.slots[slotName].attrs){params.push(...this.formatPropObject(ast.slots[slotName].attrs,ast.slots[slotName].attrsTranslationCtx,ctx.translationCtx));}
const slotInfo=`{${params.join(", ")}}`;slotStr.push(`'${slotName}': ${slotInfo}`);}
slotDef=`{${slotStr.join(", ")}}`;}
if(slotDef&&!(ast.dynamicProps||hasSlotsProp)){this.helpers.add("markRaw");props.push(`slots: markRaw(${slotDef})`);}
let propString=this.getPropString(props,ast.dynamicProps);let propVar;if((slotDef&&(ast.dynamicProps||hasSlotsProp))||this.dev){propVar=generateId("props");this.define(propVar,propString);propString=propVar;}
if(slotDef&&(ast.dynamicProps||hasSlotsProp)){this.helpers.add("markRaw");this.addLine(`${propVar}.slots = markRaw(Object.assign(${slotDef}, ${propVar}.slots))`);}
let expr;if(ast.isDynamic){expr=generateId("Comp");this.define(expr,compileExpr(ast.name));}
else{expr=`\`${ast.name}\``;}
if(this.dev){this.addLine(`helpers.validateProps(${expr}, ${propVar}, this);`);}
if(block&&(ctx.forceNewBlock===false||ctx.tKeyExpr)){this.insertAnchor(block);}
let keyArg=this.generateComponentKey();if(ctx.tKeyExpr){keyArg=`${ctx.tKeyExpr} + ${keyArg}`;}
let id=generateId("comp");const propList=[];for(let p in ast.props||{}){let[name,suffix]=p.split(".");if(!suffix){propList.push(`"${name}"`);}}
this.staticDefs.push({id,expr:`app.createComponent(${ast.isDynamic ? null : expr}, ${!ast.isDynamic}, ${!!ast.slots}, ${!!ast.dynamicProps}, [${propList}])`,});if(ast.isDynamic){keyArg=`(${expr}).name + ${keyArg}`;}
let blockExpr=`${id}(${propString}, ${keyArg}, node, this, ${ast.isDynamic ? expr : null})`;if(ast.isDynamic){blockExpr=`toggler(${expr}, ${blockExpr})`;}
if(ast.on){blockExpr=this.wrapWithEventCatcher(blockExpr,ast.on);}
block=this.createBlock(block,"multi",ctx);this.insertBlock(blockExpr,block,ctx);return block.varName;}
wrapWithEventCatcher(expr,on){this.helpers.add("createCatcher");let name=generateId("catcher");let spec={};let handlers=[];for(let ev in on){let handlerId=generateId("hdlr");let idx=handlers.push(handlerId)-1;spec[ev]=idx;const handler=this.generateHandlerCode(ev,on[ev]);this.define(handlerId,handler);}
this.staticDefs.push({id:name,expr:`createCatcher(${JSON.stringify(spec)})`});return`${name}(${expr}, [${handlers.join(",")}])`;}
compileTSlot(ast,ctx){this.helpers.add("callSlot");let{block}=ctx;let blockString;let slotName;let dynamic=false;let isMultiple=false;if(ast.name.match(INTERP_REGEXP)){dynamic=true;isMultiple=true;slotName=interpolate(ast.name);}
else{slotName="'"+ast.name+"'";isMultiple=isMultiple||this.slotNames.has(ast.name);this.slotNames.add(ast.name);}
const attrs={...ast.attrs};const dynProps=attrs["t-props"];delete attrs["t-props"];let key=this.target.loopLevel?`key${this.target.loopLevel}`:"key";if(isMultiple){key=this.generateComponentKey(key);}
const props=ast.attrs?this.formatPropObject(attrs,ast.attrsTranslationCtx,ctx.translationCtx):[];const scope=this.getPropString(props,dynProps);if(ast.defaultContent){const name=this.compileInNewTarget("defaultContent",ast.defaultContent,ctx);blockString=`callSlot(ctx, node, ${key}, ${slotName}, ${dynamic}, ${scope}, ${name}.bind(this))`;}
else{if(dynamic){let name=generateId("slot");this.define(name,slotName);blockString=`toggler(${name}, callSlot(ctx, node, ${key}, ${name}, ${dynamic}, ${scope}))`;}
else{blockString=`callSlot(ctx, node, ${key}, ${slotName}, ${dynamic}, ${scope})`;}}
if(ast.on){blockString=this.wrapWithEventCatcher(blockString,ast.on);}
if(block){this.insertAnchor(block);}
block=this.createBlock(block,"multi",ctx);this.insertBlock(blockString,block,{...ctx,forceNewBlock:false});return block.varName;}
compileTTranslation(ast,ctx){if(ast.content){return this.compileAST(ast.content,Object.assign({},ctx,{translate:false}));}
return null;}
compileTTranslationContext(ast,ctx){if(ast.content){return this.compileAST(ast.content,Object.assign({},ctx,{translationCtx:ast.translationCtx}));}
return null;}
compileTPortal(ast,ctx){if(!this.staticDefs.find((d)=>d.id==="Portal")){this.staticDefs.push({id:"Portal",expr:`app.Portal`});}
let{block}=ctx;const name=this.compileInNewTarget("slot",ast.content,ctx);let ctxStr="ctx";if(this.target.loopLevel||!this.hasSafeContext){ctxStr=generateId("ctx");this.helpers.add("capture");this.define(ctxStr,`capture(ctx)`);}
let id=generateId("comp");this.staticDefs.push({id,expr:`app.createComponent(null, false, true, false, false)`,});const target=compileExpr(ast.target);const key=this.generateComponentKey();const blockString=`${id}({target: ${target},slots: {'default': {__render: ${name}.bind(this), __ctx: ${ctxStr}}}}, ${key}, node, ctx, Portal)`;if(block){this.insertAnchor(block);}
block=this.createBlock(block,"multi",ctx);this.insertBlock(blockString,block,{...ctx,forceNewBlock:false});return block.varName;}}
const cache=new WeakMap();function parse(xml,customDir){const ctx={inPreTag:false,customDirectives:customDir,};if(typeof xml==="string"){const elem=parseXML(`<t>${xml}</t>`).firstChild;return _parse(elem,ctx);}
let ast=cache.get(xml);if(!ast){ast=_parse(xml.cloneNode(true),ctx);cache.set(xml,ast);}
return ast;}
function _parse(xml,ctx){normalizeXML(xml);return parseNode(xml,ctx)||{type:0,value:""};}
function parseNode(node,ctx){if(!(node instanceof Element)){return parseTextCommentNode(node,ctx);}
return(parseTCustom(node,ctx)||parseTDebugLog(node,ctx)||parseTForEach(node,ctx)||parseTIf(node,ctx)||parseTPortal(node,ctx)||parseTCall(node,ctx)||parseTCallBlock(node)||parseTTranslation(node,ctx)||parseTTranslationContext(node,ctx)||parseTKey(node,ctx)||parseTEscNode(node,ctx)||parseTOutNode(node,ctx)||parseTSlot(node,ctx)||parseComponent(node,ctx)||parseDOMNode(node,ctx)||parseTSetNode(node,ctx)||parseTNode(node,ctx));}
function parseTNode(node,ctx){if(node.tagName!=="t"){return null;}
return parseChildNodes(node,ctx);}
const lineBreakRE=/[\r\n]/;function parseTextCommentNode(node,ctx){if(node.nodeType===Node.TEXT_NODE){let value=node.textContent||"";if(!ctx.inPreTag&&lineBreakRE.test(value)&&!value.trim()){return null;}
return{type:0,value};}
else if(node.nodeType===Node.COMMENT_NODE){return{type:1,value:node.textContent||""};}
return null;}
function parseTCustom(node,ctx){if(!ctx.customDirectives){return null;}
const nodeAttrsNames=node.getAttributeNames();for(let attr of nodeAttrsNames){if(attr==="t-custom"||attr==="t-custom-"){throw new OwlError("Missing custom directive name with t-custom directive");}
if(attr.startsWith("t-custom-")){const directiveName=attr.split(".")[0].slice(9);const customDirective=ctx.customDirectives[directiveName];if(!customDirective){throw new OwlError(`Custom directive "${directiveName}" is not defined`);}
const value=node.getAttribute(attr);const modifiers=attr.split(".").slice(1);node.removeAttribute(attr);try{customDirective(node,value,modifiers);}
catch(error){throw new OwlError(`Custom directive "${directiveName}" throw the following error: ${error}`);}
return parseNode(node,ctx);}}
return null;}
function parseTDebugLog(node,ctx){if(node.hasAttribute("t-debug")){node.removeAttribute("t-debug");const content=parseNode(node,ctx);const ast={type:12,content,};if(content===null||content===void 0?void 0:content.hasNoRepresentation){ast.hasNoRepresentation=true;}
return ast;}
if(node.hasAttribute("t-log")){const expr=node.getAttribute("t-log");node.removeAttribute("t-log");const content=parseNode(node,ctx);const ast={type:13,expr,content,};if(content===null||content===void 0?void 0:content.hasNoRepresentation){ast.hasNoRepresentation=true;}
return ast;}
return null;}
const hasDotAtTheEnd=/\.[\w_]+\s*$/;const hasBracketsAtTheEnd=/\[[^\[]+\]\s*$/;const ROOT_SVG_TAGS=new Set(["svg","g","path"]);function parseDOMNode(node,ctx){const{tagName}=node;const dynamicTag=node.getAttribute("t-tag");node.removeAttribute("t-tag");if(tagName==="t"&&!dynamicTag){return null;}
if(tagName.startsWith("block-")){throw new OwlError(`Invalid tag name: '${tagName}'`);}
ctx=Object.assign({},ctx);if(tagName==="pre"){ctx.inPreTag=true;}
let ns=!ctx.nameSpace&&ROOT_SVG_TAGS.has(tagName)?"http://www.w3.org/2000/svg":null;const ref=node.getAttribute("t-ref");node.removeAttribute("t-ref");const nodeAttrsNames=node.getAttributeNames();let attrs=null;let attrsTranslationCtx=null;let on=null;let model=null;for(let attr of nodeAttrsNames){const value=node.getAttribute(attr);if(attr==="t-on"||attr==="t-on-"){throw new OwlError("Missing event name with t-on directive");}
if(attr.startsWith("t-on-")){on=on||{};on[attr.slice(5)]=value;}
else if(attr.startsWith("t-model")){if(!["input","select","textarea"].includes(tagName)){throw new OwlError("The t-model directive only works with <input>, <textarea> and <select>");}
let baseExpr,expr;if(hasDotAtTheEnd.test(value)){const index=value.lastIndexOf(".");baseExpr=value.slice(0,index);expr=`'${value.slice(index + 1)}'`;}
else if(hasBracketsAtTheEnd.test(value)){const index=value.lastIndexOf("[");baseExpr=value.slice(0,index);expr=value.slice(index+1,-1);}
else{throw new OwlError(`Invalid t-model expression: "${value}" (it should be assignable)`);}
const typeAttr=node.getAttribute("type");const isInput=tagName==="input";const isSelect=tagName==="select";const isCheckboxInput=isInput&&typeAttr==="checkbox";const isRadioInput=isInput&&typeAttr==="radio";const hasTrimMod=attr.includes(".trim");const hasLazyMod=hasTrimMod||attr.includes(".lazy");const hasNumberMod=attr.includes(".number");const eventType=isRadioInput?"click":isSelect||hasLazyMod?"change":"input";model={baseExpr,expr,targetAttr:isCheckboxInput?"checked":"value",specialInitTargetAttr:isRadioInput?"checked":null,eventType,hasDynamicChildren:false,shouldTrim:hasTrimMod,shouldNumberize:hasNumberMod,};if(isSelect){ctx=Object.assign({},ctx);ctx.tModelInfo=model;}}
else if(attr.startsWith("block-")){throw new OwlError(`Invalid attribute: '${attr}'`);}
else if(attr==="xmlns"){ns=value;}
else if(attr.startsWith("t-translation-context-")){const attrName=attr.slice(22);attrsTranslationCtx=attrsTranslationCtx||{};attrsTranslationCtx[attrName]=value;}
else if(attr!=="t-name"){if(attr.startsWith("t-")&&!attr.startsWith("t-att")){throw new OwlError(`Unknown QWeb directive: '${attr}'`);}
const tModel=ctx.tModelInfo;if(tModel&&["t-att-value","t-attf-value"].includes(attr)){tModel.hasDynamicChildren=true;}
attrs=attrs||{};attrs[attr]=value;}}
if(ns){ctx.nameSpace=ns;}
const children=parseChildren(node,ctx);return{type:2,tag:tagName,dynamicTag,attrs,attrsTranslationCtx,on,ref,content:children,model,ns,};}
function parseTEscNode(node,ctx){if(!node.hasAttribute("t-esc")){return null;}
const escValue=node.getAttribute("t-esc");node.removeAttribute("t-esc");const tesc={type:4,expr:escValue,defaultValue:node.textContent||"",};let ref=node.getAttribute("t-ref");node.removeAttribute("t-ref");const ast=parseNode(node,ctx);if(!ast){return tesc;}
if(ast.type===2){return{...ast,ref,content:[tesc],};}
return tesc;}
function parseTOutNode(node,ctx){if(!node.hasAttribute("t-out")&&!node.hasAttribute("t-raw")){return null;}
if(node.hasAttribute("t-raw")){console.warn(`t-raw has been deprecated in favor of t-out. If the value to render is not wrapped by the "markup" function, it will be escaped`);}
const expr=(node.getAttribute("t-out")||node.getAttribute("t-raw"));node.removeAttribute("t-out");node.removeAttribute("t-raw");const tOut={type:8,expr,body:null};const ref=node.getAttribute("t-ref");node.removeAttribute("t-ref");const ast=parseNode(node,ctx);if(!ast){return tOut;}
if(ast.type===2){tOut.body=ast.content.length?ast.content:null;return{...ast,ref,content:[tOut],};}
return tOut;}
function parseTForEach(node,ctx){if(!node.hasAttribute("t-foreach")){return null;}
const html=node.outerHTML;const collection=node.getAttribute("t-foreach");node.removeAttribute("t-foreach");const elem=node.getAttribute("t-as")||"";node.removeAttribute("t-as");const key=node.getAttribute("t-key");if(!key){throw new OwlError(`"Directive t-foreach should always be used with a t-key!" (expression: t-foreach="${collection}" t-as="${elem}")`);}
node.removeAttribute("t-key");const memo=node.getAttribute("t-memo")||"";node.removeAttribute("t-memo");const body=parseNode(node,ctx);if(!body){return null;}
const hasNoTCall=!html.includes("t-call");const hasNoFirst=hasNoTCall&&!html.includes(`${elem}_first`);const hasNoLast=hasNoTCall&&!html.includes(`${elem}_last`);const hasNoIndex=hasNoTCall&&!html.includes(`${elem}_index`);const hasNoValue=hasNoTCall&&!html.includes(`${elem}_value`);return{type:9,collection,elem,body,memo,key,hasNoFirst,hasNoLast,hasNoIndex,hasNoValue,};}
function parseTKey(node,ctx){if(!node.hasAttribute("t-key")){return null;}
const key=node.getAttribute("t-key");node.removeAttribute("t-key");const content=parseNode(node,ctx);if(!content){return null;}
const ast={type:10,expr:key,content,};if(content.hasNoRepresentation){ast.hasNoRepresentation=true;}
return ast;}
function parseTCall(node,ctx){if(!node.hasAttribute("t-call")){return null;}
const subTemplate=node.getAttribute("t-call");const context=node.getAttribute("t-call-context");node.removeAttribute("t-call");node.removeAttribute("t-call-context");if(node.tagName!=="t"){const ast=parseNode(node,ctx);const tcall={type:7,name:subTemplate,body:null,context};if(ast&&ast.type===2){ast.content=[tcall];return ast;}
if(ast&&ast.type===11){return{...ast,slots:{default:{content:tcall,scope:null,on:null,attrs:null,attrsTranslationCtx:null,},},};}}
const body=parseChildren(node,ctx);return{type:7,name:subTemplate,body:body.length?body:null,context,};}
function parseTCallBlock(node,ctx){if(!node.hasAttribute("t-call-block")){return null;}
const name=node.getAttribute("t-call-block");return{type:15,name,};}
function parseTIf(node,ctx){if(!node.hasAttribute("t-if")){return null;}
const condition=node.getAttribute("t-if");node.removeAttribute("t-if");const content=parseNode(node,ctx)||{type:0,value:""};let nextElement=node.nextElementSibling;const tElifs=[];while(nextElement&&nextElement.hasAttribute("t-elif")){const condition=nextElement.getAttribute("t-elif");nextElement.removeAttribute("t-elif");const tElif=parseNode(nextElement,ctx);const next=nextElement.nextElementSibling;nextElement.remove();nextElement=next;if(tElif){tElifs.push({condition,content:tElif});}}
let tElse=null;if(nextElement&&nextElement.hasAttribute("t-else")){nextElement.removeAttribute("t-else");tElse=parseNode(nextElement,ctx);nextElement.remove();}
return{type:5,condition,content,tElif:tElifs.length?tElifs:null,tElse,};}
function parseTSetNode(node,ctx){if(!node.hasAttribute("t-set")){return null;}
const name=node.getAttribute("t-set");const value=node.getAttribute("t-value")||null;const defaultValue=node.innerHTML===node.textContent?node.textContent||null:null;let body=null;if(node.textContent!==node.innerHTML){body=parseChildren(node,ctx);}
return{type:6,name,value,defaultValue,body,hasNoRepresentation:true};}
const directiveErrorMap=new Map([["t-ref","t-ref is no longer supported on components. Consider exposing only the public part of the component's API through a callback prop.",],["t-att","t-att makes no sense on component: props are already treated as expressions"],["t-attf","t-attf is not supported on components: use template strings for string interpolation in props",],]);function parseComponent(node,ctx){let name=node.tagName;const firstLetter=name[0];let isDynamic=node.hasAttribute("t-component");if(isDynamic&&name!=="t"){throw new OwlError(`Directive 't-component' can only be used on <t> nodes (used on a <${name}>)`);}
if(!(firstLetter===firstLetter.toUpperCase()||isDynamic)){return null;}
if(isDynamic){name=node.getAttribute("t-component");node.removeAttribute("t-component");}
const dynamicProps=node.getAttribute("t-props");node.removeAttribute("t-props");const defaultSlotScope=node.getAttribute("t-slot-scope");node.removeAttribute("t-slot-scope");let on=null;let props=null;let propsTranslationCtx=null;for(let name of node.getAttributeNames()){const value=node.getAttribute(name);if(name.startsWith("t-translation-context-")){const attrName=name.slice(22);propsTranslationCtx=propsTranslationCtx||{};propsTranslationCtx[attrName]=value;}
else if(name.startsWith("t-")){if(name.startsWith("t-on-")){on=on||{};on[name.slice(5)]=value;}
else{const message=directiveErrorMap.get(name.split("-").slice(0,2).join("-"));throw new OwlError(message||`unsupported directive on Component: ${name}`);}}
else{props=props||{};props[name]=value;}}
let slots=null;if(node.hasChildNodes()){const clone=node.cloneNode(true);const slotNodes=Array.from(clone.querySelectorAll("[t-set-slot]"));for(let slotNode of slotNodes){if(slotNode.tagName!=="t"){throw new OwlError(`Directive 't-set-slot' can only be used on <t> nodes (used on a <${slotNode.tagName}>)`);}
const name=slotNode.getAttribute("t-set-slot");let el=slotNode.parentElement;let isInSubComponent=false;while(el&&el!==clone){if(el.hasAttribute("t-component")||el.tagName[0]===el.tagName[0].toUpperCase()){isInSubComponent=true;break;}
el=el.parentElement;}
if(isInSubComponent||!el){continue;}
slotNode.removeAttribute("t-set-slot");slotNode.remove();const slotAst=parseNode(slotNode,ctx);let on=null;let attrs=null;let attrsTranslationCtx=null;let scope=null;for(let attributeName of slotNode.getAttributeNames()){const value=slotNode.getAttribute(attributeName);if(attributeName==="t-slot-scope"){scope=value;continue;}
else if(attributeName.startsWith("t-translation-context-")){const attrName=attributeName.slice(22);attrsTranslationCtx=attrsTranslationCtx||{};attrsTranslationCtx[attrName]=value;}
else if(attributeName.startsWith("t-on-")){on=on||{};on[attributeName.slice(5)]=value;}
else{attrs=attrs||{};attrs[attributeName]=value;}}
slots=slots||{};slots[name]={content:slotAst,on,attrs,attrsTranslationCtx,scope};}
const defaultContent=parseChildNodes(clone,ctx);slots=slots||{};if(defaultContent&&!slots.default){slots.default={content:defaultContent,on,attrs:null,attrsTranslationCtx:null,scope:defaultSlotScope,};}}
return{type:11,name,isDynamic,dynamicProps,props,propsTranslationCtx,slots,on,};}
function parseTSlot(node,ctx){if(!node.hasAttribute("t-slot")){return null;}
const name=node.getAttribute("t-slot");node.removeAttribute("t-slot");let attrs=null;let attrsTranslationCtx=null;let on=null;for(let attributeName of node.getAttributeNames()){const value=node.getAttribute(attributeName);if(attributeName.startsWith("t-on-")){on=on||{};on[attributeName.slice(5)]=value;}
else if(attributeName.startsWith("t-translation-context-")){const attrName=attributeName.slice(22);attrsTranslationCtx=attrsTranslationCtx||{};attrsTranslationCtx[attrName]=value;}
else{attrs=attrs||{};attrs[attributeName]=value;}}
return{type:14,name,attrs,attrsTranslationCtx,on,defaultContent:parseChildNodes(node,ctx),};}
function wrapInTTranslationAST(r){const ast={type:16,content:r};if(r===null||r===void 0?void 0:r.hasNoRepresentation){ast.hasNoRepresentation=true;}
return ast;}
function parseTTranslation(node,ctx){if(node.getAttribute("t-translation")!=="off"){return null;}
node.removeAttribute("t-translation");const result=parseNode(node,ctx);if((result===null||result===void 0?void 0:result.type)===3){const children=result.content.map(wrapInTTranslationAST);return makeASTMulti(children);}
return wrapInTTranslationAST(result);}
function wrapInTTranslationContextAST(r,translationCtx){const ast={type:17,content:r,translationCtx,};if(r===null||r===void 0?void 0:r.hasNoRepresentation){ast.hasNoRepresentation=true;}
return ast;}
function parseTTranslationContext(node,ctx){const translationCtx=node.getAttribute("t-translation-context");if(!translationCtx){return null;}
node.removeAttribute("t-translation-context");const result=parseNode(node,ctx);if((result===null||result===void 0?void 0:result.type)===3){const children=result.content.map((c)=>wrapInTTranslationContextAST(c,translationCtx));return makeASTMulti(children);}
return wrapInTTranslationContextAST(result,translationCtx);}
function parseTPortal(node,ctx){if(!node.hasAttribute("t-portal")){return null;}
const target=node.getAttribute("t-portal");node.removeAttribute("t-portal");const content=parseNode(node,ctx);if(!content){return{type:0,value:"",};}
return{type:18,target,content,};}
function parseChildren(node,ctx){const children=[];for(let child of node.childNodes){const childAst=parseNode(child,ctx);if(childAst){if(childAst.type===3){children.push(...childAst.content);}
else{children.push(childAst);}}}
return children;}
function makeASTMulti(children){const ast={type:3,content:children};if(children.every((c)=>c.hasNoRepresentation)){ast.hasNoRepresentation=true;}
return ast;}
function parseChildNodes(node,ctx){const children=parseChildren(node,ctx);switch(children.length){case 0:return null;case 1:return children[0];default:return makeASTMulti(children);}}
function normalizeTIf(el){let tbranch=el.querySelectorAll("[t-elif], [t-else]");for(let i=0,ilen=tbranch.length;i<ilen;i++){let node=tbranch[i];let prevElem=node.previousElementSibling;let pattr=(name)=>prevElem.getAttribute(name);let nattr=(name)=>+!!node.getAttribute(name);if(prevElem&&(pattr("t-if")||pattr("t-elif"))){if(pattr("t-foreach")){throw new OwlError("t-if cannot stay at the same level as t-foreach when using t-elif or t-else");}
if(["t-if","t-elif","t-else"].map(nattr).reduce(function(a,b){return a+b;})>1){throw new OwlError("Only one conditional branching directive is allowed per node");}
let textNode;while((textNode=node.previousSibling)!==prevElem){if(textNode.nodeValue.trim().length&&textNode.nodeType!==8){throw new OwlError("text is not allowed between branching directives");}
textNode.remove();}}
else{throw new OwlError("t-elif and t-else directives must be preceded by a t-if or t-elif directive");}}}
function normalizeTEscTOut(el){for(const d of["t-esc","t-out"]){const elements=[...el.querySelectorAll(`[${d}]`)].filter((el)=>el.tagName[0]===el.tagName[0].toUpperCase()||el.hasAttribute("t-component"));for(const el of elements){if(el.childNodes.length){throw new OwlError(`Cannot have ${d} on a component that already has content`);}
const value=el.getAttribute(d);el.removeAttribute(d);const t=el.ownerDocument.createElement("t");if(value!=null){t.setAttribute(d,value);}
el.appendChild(t);}}}
function normalizeXML(el){normalizeTIf(el);normalizeTEscTOut(el);}
function compile(template,options={hasGlobalValues:false,}){const ast=parse(template,options.customDirectives);const hasSafeContext=template instanceof Node?!(template instanceof Element)||template.querySelector("[t-set], [t-call]")===null:!template.includes("t-set")&&!template.includes("t-call");const codeGenerator=new CodeGenerator(ast,{...options,hasSafeContext});const code=codeGenerator.generateCode();try{return new Function("app, bdom, helpers",code);}
catch(originalError){const{name}=options;const nameStr=name?`template "${name}"`:"anonymous template";const err=new OwlError(`Failed to compile ${nameStr}: ${originalError.message}\n\ngenerated code:\nfunction(app, bdom, helpers) {\n${code}\n}`);err.cause=originalError;throw err;}}
const version="2.8.1";class Scheduler{constructor(){this.tasks=new Set();this.frame=0;this.delayedRenders=[];this.cancelledNodes=new Set();this.processing=false;this.requestAnimationFrame=Scheduler.requestAnimationFrame;}
addFiber(fiber){this.tasks.add(fiber.root);}
scheduleDestroy(node){this.cancelledNodes.add(node);if(this.frame===0){this.frame=this.requestAnimationFrame(()=>this.processTasks());}}
flush(){if(this.delayedRenders.length){let renders=this.delayedRenders;this.delayedRenders=[];for(let f of renders){if(f.root&&f.node.status!==3&&f.node.fiber===f){f.render();}}}
if(this.frame===0){this.frame=this.requestAnimationFrame(()=>this.processTasks());}}
processTasks(){if(this.processing){return;}
this.processing=true;this.frame=0;for(let node of this.cancelledNodes){node._destroy();}
this.cancelledNodes.clear();for(let task of this.tasks){this.processFiber(task);}
for(let task of this.tasks){if(task.node.status===3){this.tasks.delete(task);}}
this.processing=false;}
processFiber(fiber){if(fiber.root!==fiber){this.tasks.delete(fiber);return;}
const hasError=fibersInError.has(fiber);if(hasError&&fiber.counter!==0){this.tasks.delete(fiber);return;}
if(fiber.node.status===3){this.tasks.delete(fiber);return;}
if(fiber.counter===0){if(!hasError){fiber.complete();}
if(fiber.appliedToDom){this.tasks.delete(fiber);}}}}
Scheduler.requestAnimationFrame=window.requestAnimationFrame.bind(window);let hasBeenLogged=false;const apps=new Set();window.__OWL_DEVTOOLS__||(window.__OWL_DEVTOOLS__={apps,Fiber,RootFiber,toRaw,reactive});class App extends TemplateSet{constructor(Root,config={}){super(config);this.scheduler=new Scheduler();this.subRoots=new Set();this.root=null;this.name=config.name||"";this.Root=Root;apps.add(this);if(config.test){this.dev=true;}
this.warnIfNoStaticProps=config.warnIfNoStaticProps||false;if(this.dev&&!config.test&&!hasBeenLogged){console.info(`Owl is running in 'dev' mode.`);hasBeenLogged=true;}
const env=config.env||{};const descrs=Object.getOwnPropertyDescriptors(env);this.env=Object.freeze(Object.create(Object.getPrototypeOf(env),descrs));this.props=config.props||{};}
mount(target,options){const root=this.createRoot(this.Root,{props:this.props});this.root=root.node;this.subRoots.delete(root.node);return root.mount(target,options);}
createRoot(Root,config={}){const props=config.props||{};const env=this.env;if(config.env){this.env=config.env;}
const restore=saveCurrent();const node=this.makeNode(Root,props);restore();if(config.env){this.env=env;}
this.subRoots.add(node);return{node,mount:(target,options)=>{App.validateTarget(target);if(this.dev){validateProps(Root,props,{__owl__:{app:this}});}
const prom=this.mountNode(node,target,options);return prom;},destroy:()=>{this.subRoots.delete(node);node.destroy();this.scheduler.processTasks();},};}
makeNode(Component,props){return new ComponentNode(Component,props,this,null,null);}
mountNode(node,target,options){const promise=new Promise((resolve,reject)=>{let isResolved=false;node.mounted.push(()=>{resolve(node.component);isResolved=true;});let handlers=nodeErrorHandlers.get(node);if(!handlers){handlers=[];nodeErrorHandlers.set(node,handlers);}
handlers.unshift((e)=>{if(!isResolved){reject(e);}
throw e;});});node.mountComponent(target,options);return promise;}
destroy(){if(this.root){for(let subroot of this.subRoots){subroot.destroy();}
this.root.destroy();this.scheduler.processTasks();}
apps.delete(this);}
createComponent(name,isStatic,hasSlotsProp,hasDynamicPropList,propList){const isDynamic=!isStatic;let arePropsDifferent;const hasNoProp=propList.length===0;if(hasSlotsProp){arePropsDifferent=(_1,_2)=>true;}
else if(hasDynamicPropList){arePropsDifferent=function(props1,props2){for(let k in props1){if(props1[k]!==props2[k]){return true;}}
return Object.keys(props1).length!==Object.keys(props2).length;};}
else if(hasNoProp){arePropsDifferent=(_1,_2)=>false;}
else{arePropsDifferent=function(props1,props2){for(let p of propList){if(props1[p]!==props2[p]){return true;}}
return false;};}
const updateAndRender=ComponentNode.prototype.updateAndRender;const initiateRender=ComponentNode.prototype.initiateRender;return(props,key,ctx,parent,C)=>{let children=ctx.children;let node=children[key];if(isDynamic&&node&&node.component.constructor!==C){node=undefined;}
const parentFiber=ctx.fiber;if(node){if(arePropsDifferent(node.props,props)||parentFiber.deep||node.forceNextRender){node.forceNextRender=false;updateAndRender.call(node,props,parentFiber);}}
else{if(isStatic){const components=parent.constructor.components;if(!components){throw new OwlError(`Cannot find the definition of component "${name}", missing static components key in parent`);}
C=components[name];if(!C){throw new OwlError(`Cannot find the definition of component "${name}"`);}
else if(!(C.prototype instanceof Component)){throw new OwlError(`"${name}" is not a Component. It must inherit from the Component class`);}}
node=new ComponentNode(C,props,this,ctx,key);children[key]=node;initiateRender.call(node,new Fiber(node,parentFiber));}
parentFiber.childrenMap[key]=node;return node;};}
handleError(...args){return handleError(...args);}}
App.validateTarget=validateTarget;App.apps=apps;App.version=version;async function mount(C,target,config={}){return new App(C,config).mount(target,config);}
const mainEventHandler=(data,ev,currentTarget)=>{const{data:_data,modifiers}=filterOutModifiersFromData(data);data=_data;let stopped=false;if(modifiers.length){let selfMode=false;const isSelf=ev.target===currentTarget;for(const mod of modifiers){switch(mod){case"self":selfMode=true;if(isSelf){continue;}
else{return stopped;}
case"prevent":if((selfMode&&isSelf)||!selfMode)
ev.preventDefault();continue;case"stop":if((selfMode&&isSelf)||!selfMode)
ev.stopPropagation();stopped=true;continue;}}}
if(Object.hasOwnProperty.call(data,0)){const handler=data[0];if(typeof handler!=="function"){throw new OwlError(`Invalid handler (expected a function, received: '${handler}')`);}
let node=data[1]?data[1].__owl__:null;if(node?node.status===1:true){handler.call(node?node.component:null,ev);}}
return stopped;};function status(component){switch(component.__owl__.status){case 0:return"new";case 2:return"cancelled";case 1:return"mounted";case 3:return"destroyed";}}
function useRef(name){const node=getCurrent();const refs=node.refs;return{get el(){const el=refs[name];return inOwnerDocument(el)?el:null;},};}
function useEnv(){return getCurrent().component.env;}
function extendEnv(currentEnv,extension){const env=Object.create(currentEnv);const descrs=Object.getOwnPropertyDescriptors(extension);return Object.freeze(Object.defineProperties(env,descrs));}
function useSubEnv(envExtension){const node=getCurrent();node.component.env=extendEnv(node.component.env,envExtension);useChildSubEnv(envExtension);}
function useChildSubEnv(envExtension){const node=getCurrent();node.childEnv=extendEnv(node.childEnv,envExtension);}
function useEffect(effect,computeDependencies=()=>[NaN]){let cleanup;let dependencies;onMounted(()=>{dependencies=computeDependencies();cleanup=effect(...dependencies);});onPatched(()=>{const newDeps=computeDependencies();const shouldReapply=newDeps.some((val,i)=>val!==dependencies[i]);if(shouldReapply){dependencies=newDeps;if(cleanup){cleanup();}
cleanup=effect(...dependencies);}});onWillUnmount(()=>cleanup&&cleanup());}
function useExternalListener(target,eventName,handler,eventParams){const node=getCurrent();const boundHandler=handler.bind(node.component);onMounted(()=>target.addEventListener(eventName,boundHandler,eventParams));onWillUnmount(()=>target.removeEventListener(eventName,boundHandler,eventParams));}
config.shouldNormalizeDom=false;config.mainEventHandler=mainEventHandler;const blockDom={config,mount:mount$1,patch,remove,list,multi,text,toggler,createBlock,html,comment,};const __info__={version:App.version,};TemplateSet.prototype._compileTemplate=function _compileTemplate(name,template){return compile(template,{name,dev:this.dev,translateFn:this.translateFn,translatableAttributes:this.translatableAttributes,customDirectives:this.customDirectives,hasGlobalValues:this.hasGlobalValues,});};exports.App=App;exports.Component=Component;exports.EventBus=EventBus;exports.OwlError=OwlError;exports.__info__=__info__;exports.batched=batched;exports.blockDom=blockDom;exports.htmlEscape=htmlEscape;exports.loadFile=loadFile;exports.markRaw=markRaw;exports.markup=markup;exports.mount=mount;exports.onError=onError;exports.onMounted=onMounted;exports.onPatched=onPatched;exports.onRendered=onRendered;exports.onWillDestroy=onWillDestroy;exports.onWillPatch=onWillPatch;exports.onWillRender=onWillRender;exports.onWillStart=onWillStart;exports.onWillUnmount=onWillUnmount;exports.onWillUpdateProps=onWillUpdateProps;exports.reactive=reactive;exports.status=status;exports.toRaw=toRaw;exports.useChildSubEnv=useChildSubEnv;exports.useComponent=useComponent;exports.useEffect=useEffect;exports.useEnv=useEnv;exports.useExternalListener=useExternalListener;exports.useRef=useRef;exports.useState=useState;exports.useSubEnv=useSubEnv;exports.validate=validate;exports.validateType=validateType;exports.whenReady=whenReady;exports.xml=xml;Object.defineProperty(exports,'__esModule',{value:true});__info__.date='2025-09-23T07:17:45.055Z';__info__.hash='5211116';__info__.url='https://github.com/odoo/owl';})(this.owl=this.owl||{});;

/* /web/static/lib/owl/odoo_module.js */
odoo.define("@odoo/owl",[],function(){"use strict";return owl;});;

/* /web/static/lib/jquery/jquery.js */
(function(global,factory){"use strict";if(typeof module==="object"&&typeof module.exports==="object"){module.exports=global.document?factory(global,true):function(w){if(!w.document){throw new Error("jQuery requires a window with a document");}
return factory(w);};}else{factory(global);}})(typeof window!=="undefined"?window:this,function(window,noGlobal){"use strict";var arr=[];var getProto=Object.getPrototypeOf;var slice=arr.slice;var flat=arr.flat?function(array){return arr.flat.call(array);}:function(array){return arr.concat.apply([],array);};var push=arr.push;var indexOf=arr.indexOf;var class2type={};var toString=class2type.toString;var hasOwn=class2type.hasOwnProperty;var fnToString=hasOwn.toString;var ObjectFunctionString=fnToString.call(Object);var support={};var isFunction=function isFunction(obj){return typeof obj==="function"&&typeof obj.nodeType!=="number"&&typeof obj.item!=="function";};var isWindow=function isWindow(obj){return obj!=null&&obj===obj.window;};var document=window.document;var preservedScriptAttributes={type:true,src:true,nonce:true,noModule:true};function DOMEval(code,node,doc){doc=doc||document;var i,val,script=doc.createElement("script");script.text=code;if(node){for(i in preservedScriptAttributes){val=node[i]||node.getAttribute&&node.getAttribute(i);if(val){script.setAttribute(i,val);}}}
doc.head.appendChild(script).parentNode.removeChild(script);}
function toType(obj){if(obj==null){return obj+"";}
return typeof obj==="object"||typeof obj==="function"?class2type[toString.call(obj)]||"object":typeof obj;}
var
version="3.6.3",jQuery=function(selector,context){return new jQuery.fn.init(selector,context);};jQuery.fn=jQuery.prototype={jquery:version,constructor:jQuery,length:0,toArray:function(){return slice.call(this);},get:function(num){if(num==null){return slice.call(this);}
return num<0?this[num+this.length]:this[num];},pushStack:function(elems){var ret=jQuery.merge(this.constructor(),elems);ret.prevObject=this;return ret;},each:function(callback){return jQuery.each(this,callback);},map:function(callback){return this.pushStack(jQuery.map(this,function(elem,i){return callback.call(elem,i,elem);}));},slice:function(){return this.pushStack(slice.apply(this,arguments));},first:function(){return this.eq(0);},last:function(){return this.eq(-1);},even:function(){return this.pushStack(jQuery.grep(this,function(_elem,i){return(i+1)%2;}));},odd:function(){return this.pushStack(jQuery.grep(this,function(_elem,i){return i%2;}));},eq:function(i){var len=this.length,j=+i+(i<0?len:0);return this.pushStack(j>=0&&j<len?[this[j]]:[]);},end:function(){return this.prevObject||this.constructor();},push:push,sort:arr.sort,splice:arr.splice};jQuery.extend=jQuery.fn.extend=function(){var options,name,src,copy,copyIsArray,clone,target=arguments[0]||{},i=1,length=arguments.length,deep=false;if(typeof target==="boolean"){deep=target;target=arguments[i]||{};i++;}
if(typeof target!=="object"&&!isFunction(target)){target={};}
if(i===length){target=this;i--;}
for(;i<length;i++){if((options=arguments[i])!=null){for(name in options){copy=options[name];if(name==="__proto__"||target===copy){continue;}
if(deep&&copy&&(jQuery.isPlainObject(copy)||(copyIsArray=Array.isArray(copy)))){src=target[name];if(copyIsArray&&!Array.isArray(src)){clone=[];}else if(!copyIsArray&&!jQuery.isPlainObject(src)){clone={};}else{clone=src;}
copyIsArray=false;target[name]=jQuery.extend(deep,clone,copy);}else if(copy!==undefined){target[name]=copy;}}}}
return target;};jQuery.extend({expando:"jQuery"+(version+Math.random()).replace(/\D/g,""),isReady:true,error:function(msg){throw new Error(msg);},noop:function(){},isPlainObject:function(obj){var proto,Ctor;if(!obj||toString.call(obj)!=="[object Object]"){return false;}
proto=getProto(obj);if(!proto){return true;}
Ctor=hasOwn.call(proto,"constructor")&&proto.constructor;return typeof Ctor==="function"&&fnToString.call(Ctor)===ObjectFunctionString;},isEmptyObject:function(obj){var name;for(name in obj){return false;}
return true;},globalEval:function(code,options,doc){DOMEval(code,{nonce:options&&options.nonce},doc);},each:function(obj,callback){var length,i=0;if(isArrayLike(obj)){length=obj.length;for(;i<length;i++){if(callback.call(obj[i],i,obj[i])===false){break;}}}else{for(i in obj){if(callback.call(obj[i],i,obj[i])===false){break;}}}
return obj;},makeArray:function(arr,results){var ret=results||[];if(arr!=null){if(isArrayLike(Object(arr))){jQuery.merge(ret,typeof arr==="string"?[arr]:arr);}else{push.call(ret,arr);}}
return ret;},inArray:function(elem,arr,i){return arr==null?-1:indexOf.call(arr,elem,i);},merge:function(first,second){var len=+second.length,j=0,i=first.length;for(;j<len;j++){first[i++]=second[j];}
first.length=i;return first;},grep:function(elems,callback,invert){var callbackInverse,matches=[],i=0,length=elems.length,callbackExpect=!invert;for(;i<length;i++){callbackInverse=!callback(elems[i],i);if(callbackInverse!==callbackExpect){matches.push(elems[i]);}}
return matches;},map:function(elems,callback,arg){var length,value,i=0,ret=[];if(isArrayLike(elems)){length=elems.length;for(;i<length;i++){value=callback(elems[i],i,arg);if(value!=null){ret.push(value);}}}else{for(i in elems){value=callback(elems[i],i,arg);if(value!=null){ret.push(value);}}}
return flat(ret);},guid:1,support:support});if(typeof Symbol==="function"){jQuery.fn[Symbol.iterator]=arr[Symbol.iterator];}
jQuery.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(_i,name){class2type["[object "+name+"]"]=name.toLowerCase();});function isArrayLike(obj){var length=!!obj&&"length"in obj&&obj.length,type=toType(obj);if(isFunction(obj)||isWindow(obj)){return false;}
return type==="array"||length===0||typeof length==="number"&&length>0&&(length-1)in obj;}
var Sizzle=(function(window){var i,support,Expr,getText,isXML,tokenize,compile,select,outermostContext,sortInput,hasDuplicate,setDocument,document,docElem,documentIsHTML,rbuggyQSA,rbuggyMatches,matches,contains,expando="sizzle"+1*new Date(),preferredDoc=window.document,dirruns=0,done=0,classCache=createCache(),tokenCache=createCache(),compilerCache=createCache(),nonnativeSelectorCache=createCache(),sortOrder=function(a,b){if(a===b){hasDuplicate=true;}
return 0;},hasOwn=({}).hasOwnProperty,arr=[],pop=arr.pop,pushNative=arr.push,push=arr.push,slice=arr.slice,indexOf=function(list,elem){var i=0,len=list.length;for(;i<len;i++){if(list[i]===elem){return i;}}
return-1;},booleans="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|"+"ismap|loop|multiple|open|readonly|required|scoped",whitespace="[\\x20\\t\\r\\n\\f]",identifier="(?:\\\\[\\da-fA-F]{1,6}"+whitespace+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",attributes="\\["+whitespace+"*("+identifier+")(?:"+whitespace+"*([*^$|!~]?=)"+whitespace+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+identifier+"))|)"+
whitespace+"*\\]",pseudos=":("+identifier+")(?:\\(("+"('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|"+"((?:\\\\.|[^\\\\()[\\]]|"+attributes+")*)|"+".*"+")\\)|)",rwhitespace=new RegExp(whitespace+"+","g"),rtrim=new RegExp("^"+whitespace+"+|((?:^|[^\\\\])(?:\\\\.)*)"+
whitespace+"+$","g"),rcomma=new RegExp("^"+whitespace+"*,"+whitespace+"*"),rcombinators=new RegExp("^"+whitespace+"*([>+~]|"+whitespace+")"+whitespace+"*"),rdescend=new RegExp(whitespace+"|>"),rpseudo=new RegExp(pseudos),ridentifier=new RegExp("^"+identifier+"$"),matchExpr={"ID":new RegExp("^#("+identifier+")"),"CLASS":new RegExp("^\\.("+identifier+")"),"TAG":new RegExp("^("+identifier+"|[*])"),"ATTR":new RegExp("^"+attributes),"PSEUDO":new RegExp("^"+pseudos),"CHILD":new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+
whitespace+"*(even|odd|(([+-]|)(\\d*)n|)"+whitespace+"*(?:([+-]|)"+
whitespace+"*(\\d+)|))"+whitespace+"*\\)|)","i"),"bool":new RegExp("^(?:"+booleans+")$","i"),"needsContext":new RegExp("^"+whitespace+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+whitespace+"*((?:-\\d)?\\d*)"+whitespace+"*\\)|)(?=[^-]|$)","i")},rhtml=/HTML$/i,rinputs=/^(?:input|select|textarea|button)$/i,rheader=/^h\d$/i,rnative=/^[^{]+\{\s*\[native \w/,rquickExpr=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,rsibling=/[+~]/,runescape=new RegExp("\\\\[\\da-fA-F]{1,6}"+whitespace+"?|\\\\([^\\r\\n\\f])","g"),funescape=function(escape,nonHex){var high="0x"+escape.slice(1)-0x10000;return nonHex?nonHex:high<0?String.fromCharCode(high+0x10000):String.fromCharCode(high>>10|0xD800,high&0x3FF|0xDC00);},rcssescape=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,fcssescape=function(ch,asCodePoint){if(asCodePoint){if(ch==="\0"){return"\uFFFD";}
return ch.slice(0,-1)+"\\"+
ch.charCodeAt(ch.length-1).toString(16)+" ";}
return"\\"+ch;},unloadHandler=function(){setDocument();},inDisabledFieldset=addCombinator(function(elem){return elem.disabled===true&&elem.nodeName.toLowerCase()==="fieldset";},{dir:"parentNode",next:"legend"});try{push.apply((arr=slice.call(preferredDoc.childNodes)),preferredDoc.childNodes);arr[preferredDoc.childNodes.length].nodeType;}catch(e){push={apply:arr.length?function(target,els){pushNative.apply(target,slice.call(els));}:function(target,els){var j=target.length,i=0;while((target[j++]=els[i++])){}
target.length=j-1;}};}
function Sizzle(selector,context,results,seed){var m,i,elem,nid,match,groups,newSelector,newContext=context&&context.ownerDocument,nodeType=context?context.nodeType:9;results=results||[];if(typeof selector!=="string"||!selector||nodeType!==1&&nodeType!==9&&nodeType!==11){return results;}
if(!seed){setDocument(context);context=context||document;if(documentIsHTML){if(nodeType!==11&&(match=rquickExpr.exec(selector))){if((m=match[1])){if(nodeType===9){if((elem=context.getElementById(m))){if(elem.id===m){results.push(elem);return results;}}else{return results;}}else{if(newContext&&(elem=newContext.getElementById(m))&&contains(context,elem)&&elem.id===m){results.push(elem);return results;}}}else if(match[2]){push.apply(results,context.getElementsByTagName(selector));return results;}else if((m=match[3])&&support.getElementsByClassName&&context.getElementsByClassName){push.apply(results,context.getElementsByClassName(m));return results;}}
if(support.qsa&&!nonnativeSelectorCache[selector+" "]&&(!rbuggyQSA||!rbuggyQSA.test(selector))&&(nodeType!==1||context.nodeName.toLowerCase()!=="object")){newSelector=selector;newContext=context;if(nodeType===1&&(rdescend.test(selector)||rcombinators.test(selector))){newContext=rsibling.test(selector)&&testContext(context.parentNode)||context;if(newContext!==context||!support.scope){if((nid=context.getAttribute("id"))){nid=nid.replace(rcssescape,fcssescape);}else{context.setAttribute("id",(nid=expando));}}
groups=tokenize(selector);i=groups.length;while(i--){groups[i]=(nid?"#"+nid:":scope")+" "+
toSelector(groups[i]);}
newSelector=groups.join(",");}
try{if(support.cssSupportsSelector&&!CSS.supports("selector(:is("+newSelector+"))")){throw new Error();}
push.apply(results,newContext.querySelectorAll(newSelector));return results;}catch(qsaError){nonnativeSelectorCache(selector,true);}finally{if(nid===expando){context.removeAttribute("id");}}}}}
return select(selector.replace(rtrim,"$1"),context,results,seed);}
function createCache(){var keys=[];function cache(key,value){if(keys.push(key+" ")>Expr.cacheLength){delete cache[keys.shift()];}
return(cache[key+" "]=value);}
return cache;}
function markFunction(fn){fn[expando]=true;return fn;}
function assert(fn){var el=document.createElement("fieldset");try{return!!fn(el);}catch(e){return false;}finally{if(el.parentNode){el.parentNode.removeChild(el);}
el=null;}}
function addHandle(attrs,handler){var arr=attrs.split("|"),i=arr.length;while(i--){Expr.attrHandle[arr[i]]=handler;}}
function siblingCheck(a,b){var cur=b&&a,diff=cur&&a.nodeType===1&&b.nodeType===1&&a.sourceIndex-b.sourceIndex;if(diff){return diff;}
if(cur){while((cur=cur.nextSibling)){if(cur===b){return-1;}}}
return a?1:-1;}
function createInputPseudo(type){return function(elem){var name=elem.nodeName.toLowerCase();return name==="input"&&elem.type===type;};}
function createButtonPseudo(type){return function(elem){var name=elem.nodeName.toLowerCase();return(name==="input"||name==="button")&&elem.type===type;};}
function createDisabledPseudo(disabled){return function(elem){if("form"in elem){if(elem.parentNode&&elem.disabled===false){if("label"in elem){if("label"in elem.parentNode){return elem.parentNode.disabled===disabled;}else{return elem.disabled===disabled;}}
return elem.isDisabled===disabled||elem.isDisabled!==!disabled&&inDisabledFieldset(elem)===disabled;}
return elem.disabled===disabled;}else if("label"in elem){return elem.disabled===disabled;}
return false;};}
function createPositionalPseudo(fn){return markFunction(function(argument){argument=+argument;return markFunction(function(seed,matches){var j,matchIndexes=fn([],seed.length,argument),i=matchIndexes.length;while(i--){if(seed[(j=matchIndexes[i])]){seed[j]=!(matches[j]=seed[j]);}}});});}
function testContext(context){return context&&typeof context.getElementsByTagName!=="undefined"&&context;}
support=Sizzle.support={};isXML=Sizzle.isXML=function(elem){var namespace=elem&&elem.namespaceURI,docElem=elem&&(elem.ownerDocument||elem).documentElement;return!rhtml.test(namespace||docElem&&docElem.nodeName||"HTML");};setDocument=Sizzle.setDocument=function(node){var hasCompare,subWindow,doc=node?node.ownerDocument||node:preferredDoc;if(doc==document||doc.nodeType!==9||!doc.documentElement){return document;}
document=doc;docElem=document.documentElement;documentIsHTML=!isXML(document);if(preferredDoc!=document&&(subWindow=document.defaultView)&&subWindow.top!==subWindow){if(subWindow.addEventListener){subWindow.addEventListener("unload",unloadHandler,false);}else if(subWindow.attachEvent){subWindow.attachEvent("onunload",unloadHandler);}}
support.scope=assert(function(el){docElem.appendChild(el).appendChild(document.createElement("div"));return typeof el.querySelectorAll!=="undefined"&&!el.querySelectorAll(":scope fieldset div").length;});support.cssSupportsSelector=assert(function(){return CSS.supports("selector(*)")&&document.querySelectorAll(":is(:jqfake)")&&!CSS.supports("selector(:is(*,:jqfake))");});support.attributes=assert(function(el){el.className="i";return!el.getAttribute("className");});support.getElementsByTagName=assert(function(el){el.appendChild(document.createComment(""));return!el.getElementsByTagName("*").length;});support.getElementsByClassName=rnative.test(document.getElementsByClassName);support.getById=assert(function(el){docElem.appendChild(el).id=expando;return!document.getElementsByName||!document.getElementsByName(expando).length;});if(support.getById){Expr.filter["ID"]=function(id){var attrId=id.replace(runescape,funescape);return function(elem){return elem.getAttribute("id")===attrId;};};Expr.find["ID"]=function(id,context){if(typeof context.getElementById!=="undefined"&&documentIsHTML){var elem=context.getElementById(id);return elem?[elem]:[];}};}else{Expr.filter["ID"]=function(id){var attrId=id.replace(runescape,funescape);return function(elem){var node=typeof elem.getAttributeNode!=="undefined"&&elem.getAttributeNode("id");return node&&node.value===attrId;};};Expr.find["ID"]=function(id,context){if(typeof context.getElementById!=="undefined"&&documentIsHTML){var node,i,elems,elem=context.getElementById(id);if(elem){node=elem.getAttributeNode("id");if(node&&node.value===id){return[elem];}
elems=context.getElementsByName(id);i=0;while((elem=elems[i++])){node=elem.getAttributeNode("id");if(node&&node.value===id){return[elem];}}}
return[];}};}
Expr.find["TAG"]=support.getElementsByTagName?function(tag,context){if(typeof context.getElementsByTagName!=="undefined"){return context.getElementsByTagName(tag);}else if(support.qsa){return context.querySelectorAll(tag);}}:function(tag,context){var elem,tmp=[],i=0,results=context.getElementsByTagName(tag);if(tag==="*"){while((elem=results[i++])){if(elem.nodeType===1){tmp.push(elem);}}
return tmp;}
return results;};Expr.find["CLASS"]=support.getElementsByClassName&&function(className,context){if(typeof context.getElementsByClassName!=="undefined"&&documentIsHTML){return context.getElementsByClassName(className);}};rbuggyMatches=[];rbuggyQSA=[];if((support.qsa=rnative.test(document.querySelectorAll))){assert(function(el){var input;docElem.appendChild(el).innerHTML="<a id='"+expando+"'></a>"+"<select id='"+expando+"-\r\\' msallowcapture=''>"+"<option selected=''></option></select>";if(el.querySelectorAll("[msallowcapture^='']").length){rbuggyQSA.push("[*^$]="+whitespace+"*(?:''|\"\")");}
if(!el.querySelectorAll("[selected]").length){rbuggyQSA.push("\\["+whitespace+"*(?:value|"+booleans+")");}
if(!el.querySelectorAll("[id~="+expando+"-]").length){rbuggyQSA.push("~=");}
input=document.createElement("input");input.setAttribute("name","");el.appendChild(input);if(!el.querySelectorAll("[name='']").length){rbuggyQSA.push("\\["+whitespace+"*name"+whitespace+"*="+
whitespace+"*(?:''|\"\")");}
if(!el.querySelectorAll(":checked").length){rbuggyQSA.push(":checked");}
if(!el.querySelectorAll("a#"+expando+"+*").length){rbuggyQSA.push(".#.+[+~]");}});assert(function(el){el.innerHTML="<a href='' disabled='disabled'></a>"+"<select disabled='disabled'><option/></select>";var input=document.createElement("input");input.setAttribute("type","hidden");el.appendChild(input).setAttribute("name","D");if(el.querySelectorAll("[name=d]").length){rbuggyQSA.push("name"+whitespace+"*[*^$|!~]?=");}
if(el.querySelectorAll(":enabled").length!==2){rbuggyQSA.push(":enabled",":disabled");}
docElem.appendChild(el).disabled=true;if(el.querySelectorAll(":disabled").length!==2){rbuggyQSA.push(":enabled",":disabled");}});}
if((support.matchesSelector=rnative.test((matches=docElem.matches||docElem.webkitMatchesSelector||docElem.mozMatchesSelector||docElem.oMatchesSelector||docElem.msMatchesSelector)))){assert(function(el){support.disconnectedMatch=matches.call(el,"*");});}
if(!support.cssSupportsSelector){rbuggyQSA.push(":has");}
rbuggyQSA=rbuggyQSA.length&&new RegExp(rbuggyQSA.join("|"));rbuggyMatches=rbuggyMatches.length&&new RegExp(rbuggyMatches.join("|"));hasCompare=rnative.test(docElem.compareDocumentPosition);contains=hasCompare||rnative.test(docElem.contains)?function(a,b){var adown=a.nodeType===9&&a.documentElement||a,bup=b&&b.parentNode;return a===bup||!!(bup&&bup.nodeType===1&&(adown.contains?adown.contains(bup):a.compareDocumentPosition&&a.compareDocumentPosition(bup)&16));}:function(a,b){if(b){while((b=b.parentNode)){if(b===a){return true;}}}
return false;};sortOrder=hasCompare?function(a,b){if(a===b){hasDuplicate=true;return 0;}
var compare=!a.compareDocumentPosition-!b.compareDocumentPosition;if(compare){return compare;}
compare=(a.ownerDocument||a)==(b.ownerDocument||b)?a.compareDocumentPosition(b):1;if(compare&1||(!support.sortDetached&&b.compareDocumentPosition(a)===compare)){if(a==document||a.ownerDocument==preferredDoc&&contains(preferredDoc,a)){return-1;}
if(b==document||b.ownerDocument==preferredDoc&&contains(preferredDoc,b)){return 1;}
return sortInput?(indexOf(sortInput,a)-indexOf(sortInput,b)):0;}
return compare&4?-1:1;}:function(a,b){if(a===b){hasDuplicate=true;return 0;}
var cur,i=0,aup=a.parentNode,bup=b.parentNode,ap=[a],bp=[b];if(!aup||!bup){return a==document?-1:b==document?1:aup?-1:bup?1:sortInput?(indexOf(sortInput,a)-indexOf(sortInput,b)):0;}else if(aup===bup){return siblingCheck(a,b);}
cur=a;while((cur=cur.parentNode)){ap.unshift(cur);}
cur=b;while((cur=cur.parentNode)){bp.unshift(cur);}
while(ap[i]===bp[i]){i++;}
return i?siblingCheck(ap[i],bp[i]):ap[i]==preferredDoc?-1:bp[i]==preferredDoc?1:0;};return document;};Sizzle.matches=function(expr,elements){return Sizzle(expr,null,null,elements);};Sizzle.matchesSelector=function(elem,expr){setDocument(elem);if(support.matchesSelector&&documentIsHTML&&!nonnativeSelectorCache[expr+" "]&&(!rbuggyMatches||!rbuggyMatches.test(expr))&&(!rbuggyQSA||!rbuggyQSA.test(expr))){try{var ret=matches.call(elem,expr);if(ret||support.disconnectedMatch||elem.document&&elem.document.nodeType!==11){return ret;}}catch(e){nonnativeSelectorCache(expr,true);}}
return Sizzle(expr,document,null,[elem]).length>0;};Sizzle.contains=function(context,elem){if((context.ownerDocument||context)!=document){setDocument(context);}
return contains(context,elem);};Sizzle.attr=function(elem,name){if((elem.ownerDocument||elem)!=document){setDocument(elem);}
var fn=Expr.attrHandle[name.toLowerCase()],val=fn&&hasOwn.call(Expr.attrHandle,name.toLowerCase())?fn(elem,name,!documentIsHTML):undefined;return val!==undefined?val:support.attributes||!documentIsHTML?elem.getAttribute(name):(val=elem.getAttributeNode(name))&&val.specified?val.value:null;};Sizzle.escape=function(sel){return(sel+"").replace(rcssescape,fcssescape);};Sizzle.error=function(msg){throw new Error("Syntax error, unrecognized expression: "+msg);};Sizzle.uniqueSort=function(results){var elem,duplicates=[],j=0,i=0;hasDuplicate=!support.detectDuplicates;sortInput=!support.sortStable&&results.slice(0);results.sort(sortOrder);if(hasDuplicate){while((elem=results[i++])){if(elem===results[i]){j=duplicates.push(i);}}
while(j--){results.splice(duplicates[j],1);}}
sortInput=null;return results;};getText=Sizzle.getText=function(elem){var node,ret="",i=0,nodeType=elem.nodeType;if(!nodeType){while((node=elem[i++])){ret+=getText(node);}}else if(nodeType===1||nodeType===9||nodeType===11){if(typeof elem.textContent==="string"){return elem.textContent;}else{for(elem=elem.firstChild;elem;elem=elem.nextSibling){ret+=getText(elem);}}}else if(nodeType===3||nodeType===4){return elem.nodeValue;}
return ret;};Expr=Sizzle.selectors={cacheLength:50,createPseudo:markFunction,match:matchExpr,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:true}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:true},"~":{dir:"previousSibling"}},preFilter:{"ATTR":function(match){match[1]=match[1].replace(runescape,funescape);match[3]=(match[3]||match[4]||match[5]||"").replace(runescape,funescape);if(match[2]==="~="){match[3]=" "+match[3]+" ";}
return match.slice(0,4);},"CHILD":function(match){match[1]=match[1].toLowerCase();if(match[1].slice(0,3)==="nth"){if(!match[3]){Sizzle.error(match[0]);}
match[4]=+(match[4]?match[5]+(match[6]||1):2*(match[3]==="even"||match[3]==="odd"));match[5]=+((match[7]+match[8])||match[3]==="odd");}else if(match[3]){Sizzle.error(match[0]);}
return match;},"PSEUDO":function(match){var excess,unquoted=!match[6]&&match[2];if(matchExpr["CHILD"].test(match[0])){return null;}
if(match[3]){match[2]=match[4]||match[5]||"";}else if(unquoted&&rpseudo.test(unquoted)&&(excess=tokenize(unquoted,true))&&(excess=unquoted.indexOf(")",unquoted.length-excess)-unquoted.length)){match[0]=match[0].slice(0,excess);match[2]=unquoted.slice(0,excess);}
return match.slice(0,3);}},filter:{"TAG":function(nodeNameSelector){var nodeName=nodeNameSelector.replace(runescape,funescape).toLowerCase();return nodeNameSelector==="*"?function(){return true;}:function(elem){return elem.nodeName&&elem.nodeName.toLowerCase()===nodeName;};},"CLASS":function(className){var pattern=classCache[className+" "];return pattern||(pattern=new RegExp("(^|"+whitespace+")"+className+"("+whitespace+"|$)"))&&classCache(className,function(elem){return pattern.test(typeof elem.className==="string"&&elem.className||typeof elem.getAttribute!=="undefined"&&elem.getAttribute("class")||"");});},"ATTR":function(name,operator,check){return function(elem){var result=Sizzle.attr(elem,name);if(result==null){return operator==="!=";}
if(!operator){return true;}
result+="";return operator==="="?result===check:operator==="!="?result!==check:operator==="^="?check&&result.indexOf(check)===0:operator==="*="?check&&result.indexOf(check)>-1:operator==="$="?check&&result.slice(-check.length)===check:operator==="~="?(" "+result.replace(rwhitespace," ")+" ").indexOf(check)>-1:operator==="|="?result===check||result.slice(0,check.length+1)===check+"-":false;};},"CHILD":function(type,what,_argument,first,last){var simple=type.slice(0,3)!=="nth",forward=type.slice(-4)!=="last",ofType=what==="of-type";return first===1&&last===0?function(elem){return!!elem.parentNode;}:function(elem,_context,xml){var cache,uniqueCache,outerCache,node,nodeIndex,start,dir=simple!==forward?"nextSibling":"previousSibling",parent=elem.parentNode,name=ofType&&elem.nodeName.toLowerCase(),useCache=!xml&&!ofType,diff=false;if(parent){if(simple){while(dir){node=elem;while((node=node[dir])){if(ofType?node.nodeName.toLowerCase()===name:node.nodeType===1){return false;}}
start=dir=type==="only"&&!start&&"nextSibling";}
return true;}
start=[forward?parent.firstChild:parent.lastChild];if(forward&&useCache){node=parent;outerCache=node[expando]||(node[expando]={});uniqueCache=outerCache[node.uniqueID]||(outerCache[node.uniqueID]={});cache=uniqueCache[type]||[];nodeIndex=cache[0]===dirruns&&cache[1];diff=nodeIndex&&cache[2];node=nodeIndex&&parent.childNodes[nodeIndex];while((node=++nodeIndex&&node&&node[dir]||(diff=nodeIndex=0)||start.pop())){if(node.nodeType===1&&++diff&&node===elem){uniqueCache[type]=[dirruns,nodeIndex,diff];break;}}}else{if(useCache){node=elem;outerCache=node[expando]||(node[expando]={});uniqueCache=outerCache[node.uniqueID]||(outerCache[node.uniqueID]={});cache=uniqueCache[type]||[];nodeIndex=cache[0]===dirruns&&cache[1];diff=nodeIndex;}
if(diff===false){while((node=++nodeIndex&&node&&node[dir]||(diff=nodeIndex=0)||start.pop())){if((ofType?node.nodeName.toLowerCase()===name:node.nodeType===1)&&++diff){if(useCache){outerCache=node[expando]||(node[expando]={});uniqueCache=outerCache[node.uniqueID]||(outerCache[node.uniqueID]={});uniqueCache[type]=[dirruns,diff];}
if(node===elem){break;}}}}}
diff-=last;return diff===first||(diff%first===0&&diff/first>=0);}};},"PSEUDO":function(pseudo,argument){var args,fn=Expr.pseudos[pseudo]||Expr.setFilters[pseudo.toLowerCase()]||Sizzle.error("unsupported pseudo: "+pseudo);if(fn[expando]){return fn(argument);}
if(fn.length>1){args=[pseudo,pseudo,"",argument];return Expr.setFilters.hasOwnProperty(pseudo.toLowerCase())?markFunction(function(seed,matches){var idx,matched=fn(seed,argument),i=matched.length;while(i--){idx=indexOf(seed,matched[i]);seed[idx]=!(matches[idx]=matched[i]);}}):function(elem){return fn(elem,0,args);};}
return fn;}},pseudos:{"not":markFunction(function(selector){var input=[],results=[],matcher=compile(selector.replace(rtrim,"$1"));return matcher[expando]?markFunction(function(seed,matches,_context,xml){var elem,unmatched=matcher(seed,null,xml,[]),i=seed.length;while(i--){if((elem=unmatched[i])){seed[i]=!(matches[i]=elem);}}}):function(elem,_context,xml){input[0]=elem;matcher(input,null,xml,results);input[0]=null;return!results.pop();};}),"has":markFunction(function(selector){return function(elem){return Sizzle(selector,elem).length>0;};}),"contains":markFunction(function(text){text=text.replace(runescape,funescape);return function(elem){return(elem.textContent||getText(elem)).indexOf(text)>-1;};}),"lang":markFunction(function(lang){if(!ridentifier.test(lang||"")){Sizzle.error("unsupported lang: "+lang);}
lang=lang.replace(runescape,funescape).toLowerCase();return function(elem){var elemLang;do{if((elemLang=documentIsHTML?elem.lang:elem.getAttribute("xml:lang")||elem.getAttribute("lang"))){elemLang=elemLang.toLowerCase();return elemLang===lang||elemLang.indexOf(lang+"-")===0;}}while((elem=elem.parentNode)&&elem.nodeType===1);return false;};}),"target":function(elem){var hash=window.location&&window.location.hash;return hash&&hash.slice(1)===elem.id;},"root":function(elem){return elem===docElem;},"focus":function(elem){return elem===document.activeElement&&(!document.hasFocus||document.hasFocus())&&!!(elem.type||elem.href||~elem.tabIndex);},"enabled":createDisabledPseudo(false),"disabled":createDisabledPseudo(true),"checked":function(elem){var nodeName=elem.nodeName.toLowerCase();return(nodeName==="input"&&!!elem.checked)||(nodeName==="option"&&!!elem.selected);},"selected":function(elem){if(elem.parentNode){elem.parentNode.selectedIndex;}
return elem.selected===true;},"empty":function(elem){for(elem=elem.firstChild;elem;elem=elem.nextSibling){if(elem.nodeType<6){return false;}}
return true;},"parent":function(elem){return!Expr.pseudos["empty"](elem);},"header":function(elem){return rheader.test(elem.nodeName);},"input":function(elem){return rinputs.test(elem.nodeName);},"button":function(elem){var name=elem.nodeName.toLowerCase();return name==="input"&&elem.type==="button"||name==="button";},"text":function(elem){var attr;return elem.nodeName.toLowerCase()==="input"&&elem.type==="text"&&((attr=elem.getAttribute("type"))==null||attr.toLowerCase()==="text");},"first":createPositionalPseudo(function(){return[0];}),"last":createPositionalPseudo(function(_matchIndexes,length){return[length-1];}),"eq":createPositionalPseudo(function(_matchIndexes,length,argument){return[argument<0?argument+length:argument];}),"even":createPositionalPseudo(function(matchIndexes,length){var i=0;for(;i<length;i+=2){matchIndexes.push(i);}
return matchIndexes;}),"odd":createPositionalPseudo(function(matchIndexes,length){var i=1;for(;i<length;i+=2){matchIndexes.push(i);}
return matchIndexes;}),"lt":createPositionalPseudo(function(matchIndexes,length,argument){var i=argument<0?argument+length:argument>length?length:argument;for(;--i>=0;){matchIndexes.push(i);}
return matchIndexes;}),"gt":createPositionalPseudo(function(matchIndexes,length,argument){var i=argument<0?argument+length:argument;for(;++i<length;){matchIndexes.push(i);}
return matchIndexes;})}};Expr.pseudos["nth"]=Expr.pseudos["eq"];for(i in{radio:true,checkbox:true,file:true,password:true,image:true}){Expr.pseudos[i]=createInputPseudo(i);}
for(i in{submit:true,reset:true}){Expr.pseudos[i]=createButtonPseudo(i);}
function setFilters(){}
setFilters.prototype=Expr.filters=Expr.pseudos;Expr.setFilters=new setFilters();tokenize=Sizzle.tokenize=function(selector,parseOnly){var matched,match,tokens,type,soFar,groups,preFilters,cached=tokenCache[selector+" "];if(cached){return parseOnly?0:cached.slice(0);}
soFar=selector;groups=[];preFilters=Expr.preFilter;while(soFar){if(!matched||(match=rcomma.exec(soFar))){if(match){soFar=soFar.slice(match[0].length)||soFar;}
groups.push((tokens=[]));}
matched=false;if((match=rcombinators.exec(soFar))){matched=match.shift();tokens.push({value:matched,type:match[0].replace(rtrim," ")});soFar=soFar.slice(matched.length);}
for(type in Expr.filter){if((match=matchExpr[type].exec(soFar))&&(!preFilters[type]||(match=preFilters[type](match)))){matched=match.shift();tokens.push({value:matched,type:type,matches:match});soFar=soFar.slice(matched.length);}}
if(!matched){break;}}
return parseOnly?soFar.length:soFar?Sizzle.error(selector):tokenCache(selector,groups).slice(0);};function toSelector(tokens){var i=0,len=tokens.length,selector="";for(;i<len;i++){selector+=tokens[i].value;}
return selector;}
function addCombinator(matcher,combinator,base){var dir=combinator.dir,skip=combinator.next,key=skip||dir,checkNonElements=base&&key==="parentNode",doneName=done++;return combinator.first?function(elem,context,xml){while((elem=elem[dir])){if(elem.nodeType===1||checkNonElements){return matcher(elem,context,xml);}}
return false;}:function(elem,context,xml){var oldCache,uniqueCache,outerCache,newCache=[dirruns,doneName];if(xml){while((elem=elem[dir])){if(elem.nodeType===1||checkNonElements){if(matcher(elem,context,xml)){return true;}}}}else{while((elem=elem[dir])){if(elem.nodeType===1||checkNonElements){outerCache=elem[expando]||(elem[expando]={});uniqueCache=outerCache[elem.uniqueID]||(outerCache[elem.uniqueID]={});if(skip&&skip===elem.nodeName.toLowerCase()){elem=elem[dir]||elem;}else if((oldCache=uniqueCache[key])&&oldCache[0]===dirruns&&oldCache[1]===doneName){return(newCache[2]=oldCache[2]);}else{uniqueCache[key]=newCache;if((newCache[2]=matcher(elem,context,xml))){return true;}}}}}
return false;};}
function elementMatcher(matchers){return matchers.length>1?function(elem,context,xml){var i=matchers.length;while(i--){if(!matchers[i](elem,context,xml)){return false;}}
return true;}:matchers[0];}
function multipleContexts(selector,contexts,results){var i=0,len=contexts.length;for(;i<len;i++){Sizzle(selector,contexts[i],results);}
return results;}
function condense(unmatched,map,filter,context,xml){var elem,newUnmatched=[],i=0,len=unmatched.length,mapped=map!=null;for(;i<len;i++){if((elem=unmatched[i])){if(!filter||filter(elem,context,xml)){newUnmatched.push(elem);if(mapped){map.push(i);}}}}
return newUnmatched;}
function setMatcher(preFilter,selector,matcher,postFilter,postFinder,postSelector){if(postFilter&&!postFilter[expando]){postFilter=setMatcher(postFilter);}
if(postFinder&&!postFinder[expando]){postFinder=setMatcher(postFinder,postSelector);}
return markFunction(function(seed,results,context,xml){var temp,i,elem,preMap=[],postMap=[],preexisting=results.length,elems=seed||multipleContexts(selector||"*",context.nodeType?[context]:context,[]),matcherIn=preFilter&&(seed||!selector)?condense(elems,preMap,preFilter,context,xml):elems,matcherOut=matcher?postFinder||(seed?preFilter:preexisting||postFilter)?[]:results:matcherIn;if(matcher){matcher(matcherIn,matcherOut,context,xml);}
if(postFilter){temp=condense(matcherOut,postMap);postFilter(temp,[],context,xml);i=temp.length;while(i--){if((elem=temp[i])){matcherOut[postMap[i]]=!(matcherIn[postMap[i]]=elem);}}}
if(seed){if(postFinder||preFilter){if(postFinder){temp=[];i=matcherOut.length;while(i--){if((elem=matcherOut[i])){temp.push((matcherIn[i]=elem));}}
postFinder(null,(matcherOut=[]),temp,xml);}
i=matcherOut.length;while(i--){if((elem=matcherOut[i])&&(temp=postFinder?indexOf(seed,elem):preMap[i])>-1){seed[temp]=!(results[temp]=elem);}}}}else{matcherOut=condense(matcherOut===results?matcherOut.splice(preexisting,matcherOut.length):matcherOut);if(postFinder){postFinder(null,results,matcherOut,xml);}else{push.apply(results,matcherOut);}}});}
function matcherFromTokens(tokens){var checkContext,matcher,j,len=tokens.length,leadingRelative=Expr.relative[tokens[0].type],implicitRelative=leadingRelative||Expr.relative[" "],i=leadingRelative?1:0,matchContext=addCombinator(function(elem){return elem===checkContext;},implicitRelative,true),matchAnyContext=addCombinator(function(elem){return indexOf(checkContext,elem)>-1;},implicitRelative,true),matchers=[function(elem,context,xml){var ret=(!leadingRelative&&(xml||context!==outermostContext))||((checkContext=context).nodeType?matchContext(elem,context,xml):matchAnyContext(elem,context,xml));checkContext=null;return ret;}];for(;i<len;i++){if((matcher=Expr.relative[tokens[i].type])){matchers=[addCombinator(elementMatcher(matchers),matcher)];}else{matcher=Expr.filter[tokens[i].type].apply(null,tokens[i].matches);if(matcher[expando]){j=++i;for(;j<len;j++){if(Expr.relative[tokens[j].type]){break;}}
return setMatcher(i>1&&elementMatcher(matchers),i>1&&toSelector(tokens.slice(0,i-1).concat({value:tokens[i-2].type===" "?"*":""})).replace(rtrim,"$1"),matcher,i<j&&matcherFromTokens(tokens.slice(i,j)),j<len&&matcherFromTokens((tokens=tokens.slice(j))),j<len&&toSelector(tokens));}
matchers.push(matcher);}}
return elementMatcher(matchers);}
function matcherFromGroupMatchers(elementMatchers,setMatchers){var bySet=setMatchers.length>0,byElement=elementMatchers.length>0,superMatcher=function(seed,context,xml,results,outermost){var elem,j,matcher,matchedCount=0,i="0",unmatched=seed&&[],setMatched=[],contextBackup=outermostContext,elems=seed||byElement&&Expr.find["TAG"]("*",outermost),dirrunsUnique=(dirruns+=contextBackup==null?1:Math.random()||0.1),len=elems.length;if(outermost){outermostContext=context==document||context||outermost;}
for(;i!==len&&(elem=elems[i])!=null;i++){if(byElement&&elem){j=0;if(!context&&elem.ownerDocument!=document){setDocument(elem);xml=!documentIsHTML;}
while((matcher=elementMatchers[j++])){if(matcher(elem,context||document,xml)){results.push(elem);break;}}
if(outermost){dirruns=dirrunsUnique;}}
if(bySet){if((elem=!matcher&&elem)){matchedCount--;}
if(seed){unmatched.push(elem);}}}
matchedCount+=i;if(bySet&&i!==matchedCount){j=0;while((matcher=setMatchers[j++])){matcher(unmatched,setMatched,context,xml);}
if(seed){if(matchedCount>0){while(i--){if(!(unmatched[i]||setMatched[i])){setMatched[i]=pop.call(results);}}}
setMatched=condense(setMatched);}
push.apply(results,setMatched);if(outermost&&!seed&&setMatched.length>0&&(matchedCount+setMatchers.length)>1){Sizzle.uniqueSort(results);}}
if(outermost){dirruns=dirrunsUnique;outermostContext=contextBackup;}
return unmatched;};return bySet?markFunction(superMatcher):superMatcher;}
compile=Sizzle.compile=function(selector,match){var i,setMatchers=[],elementMatchers=[],cached=compilerCache[selector+" "];if(!cached){if(!match){match=tokenize(selector);}
i=match.length;while(i--){cached=matcherFromTokens(match[i]);if(cached[expando]){setMatchers.push(cached);}else{elementMatchers.push(cached);}}
cached=compilerCache(selector,matcherFromGroupMatchers(elementMatchers,setMatchers));cached.selector=selector;}
return cached;};select=Sizzle.select=function(selector,context,results,seed){var i,tokens,token,type,find,compiled=typeof selector==="function"&&selector,match=!seed&&tokenize((selector=compiled.selector||selector));results=results||[];if(match.length===1){tokens=match[0]=match[0].slice(0);if(tokens.length>2&&(token=tokens[0]).type==="ID"&&context.nodeType===9&&documentIsHTML&&Expr.relative[tokens[1].type]){context=(Expr.find["ID"](token.matches[0].replace(runescape,funescape),context)||[])[0];if(!context){return results;}else if(compiled){context=context.parentNode;}
selector=selector.slice(tokens.shift().value.length);}
i=matchExpr["needsContext"].test(selector)?0:tokens.length;while(i--){token=tokens[i];if(Expr.relative[(type=token.type)]){break;}
if((find=Expr.find[type])){if((seed=find(token.matches[0].replace(runescape,funescape),rsibling.test(tokens[0].type)&&testContext(context.parentNode)||context))){tokens.splice(i,1);selector=seed.length&&toSelector(tokens);if(!selector){push.apply(results,seed);return results;}
break;}}}}
(compiled||compile(selector,match))(seed,context,!documentIsHTML,results,!context||rsibling.test(selector)&&testContext(context.parentNode)||context);return results;};support.sortStable=expando.split("").sort(sortOrder).join("")===expando;support.detectDuplicates=!!hasDuplicate;setDocument();support.sortDetached=assert(function(el){return el.compareDocumentPosition(document.createElement("fieldset"))&1;});if(!assert(function(el){el.innerHTML="<a href='#'></a>";return el.firstChild.getAttribute("href")==="#";})){addHandle("type|href|height|width",function(elem,name,isXML){if(!isXML){return elem.getAttribute(name,name.toLowerCase()==="type"?1:2);}});}
if(!support.attributes||!assert(function(el){el.innerHTML="<input/>";el.firstChild.setAttribute("value","");return el.firstChild.getAttribute("value")==="";})){addHandle("value",function(elem,_name,isXML){if(!isXML&&elem.nodeName.toLowerCase()==="input"){return elem.defaultValue;}});}
if(!assert(function(el){return el.getAttribute("disabled")==null;})){addHandle(booleans,function(elem,name,isXML){var val;if(!isXML){return elem[name]===true?name.toLowerCase():(val=elem.getAttributeNode(name))&&val.specified?val.value:null;}});}
return Sizzle;})(window);jQuery.find=Sizzle;jQuery.expr=Sizzle.selectors;jQuery.expr[":"]=jQuery.expr.pseudos;jQuery.uniqueSort=jQuery.unique=Sizzle.uniqueSort;jQuery.text=Sizzle.getText;jQuery.isXMLDoc=Sizzle.isXML;jQuery.contains=Sizzle.contains;jQuery.escapeSelector=Sizzle.escape;var dir=function(elem,dir,until){var matched=[],truncate=until!==undefined;while((elem=elem[dir])&&elem.nodeType!==9){if(elem.nodeType===1){if(truncate&&jQuery(elem).is(until)){break;}
matched.push(elem);}}
return matched;};var siblings=function(n,elem){var matched=[];for(;n;n=n.nextSibling){if(n.nodeType===1&&n!==elem){matched.push(n);}}
return matched;};var rneedsContext=jQuery.expr.match.needsContext;function nodeName(elem,name){return elem.nodeName&&elem.nodeName.toLowerCase()===name.toLowerCase();}
var rsingleTag=(/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i);function winnow(elements,qualifier,not){if(isFunction(qualifier)){return jQuery.grep(elements,function(elem,i){return!!qualifier.call(elem,i,elem)!==not;});}
if(qualifier.nodeType){return jQuery.grep(elements,function(elem){return(elem===qualifier)!==not;});}
if(typeof qualifier!=="string"){return jQuery.grep(elements,function(elem){return(indexOf.call(qualifier,elem)>-1)!==not;});}
return jQuery.filter(qualifier,elements,not);}
jQuery.filter=function(expr,elems,not){var elem=elems[0];if(not){expr=":not("+expr+")";}
if(elems.length===1&&elem.nodeType===1){return jQuery.find.matchesSelector(elem,expr)?[elem]:[];}
return jQuery.find.matches(expr,jQuery.grep(elems,function(elem){return elem.nodeType===1;}));};jQuery.fn.extend({find:function(selector){var i,ret,len=this.length,self=this;if(typeof selector!=="string"){return this.pushStack(jQuery(selector).filter(function(){for(i=0;i<len;i++){if(jQuery.contains(self[i],this)){return true;}}}));}
ret=this.pushStack([]);for(i=0;i<len;i++){jQuery.find(selector,self[i],ret);}
return len>1?jQuery.uniqueSort(ret):ret;},filter:function(selector){return this.pushStack(winnow(this,selector||[],false));},not:function(selector){return this.pushStack(winnow(this,selector||[],true));},is:function(selector){return!!winnow(this,typeof selector==="string"&&rneedsContext.test(selector)?jQuery(selector):selector||[],false).length;}});var rootjQuery,rquickExpr=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,init=jQuery.fn.init=function(selector,context,root){var match,elem;if(!selector){return this;}
root=root||rootjQuery;if(typeof selector==="string"){if(selector[0]==="<"&&selector[selector.length-1]===">"&&selector.length>=3){match=[null,selector,null];}else{match=rquickExpr.exec(selector);}
if(match&&(match[1]||!context)){if(match[1]){context=context instanceof jQuery?context[0]:context;jQuery.merge(this,jQuery.parseHTML(match[1],context&&context.nodeType?context.ownerDocument||context:document,true));if(rsingleTag.test(match[1])&&jQuery.isPlainObject(context)){for(match in context){if(isFunction(this[match])){this[match](context[match]);}else{this.attr(match,context[match]);}}}
return this;}else{elem=document.getElementById(match[2]);if(elem){this[0]=elem;this.length=1;}
return this;}}else if(!context||context.jquery){return(context||root).find(selector);}else{return this.constructor(context).find(selector);}}else if(selector.nodeType){this[0]=selector;this.length=1;return this;}else if(isFunction(selector)){return root.ready!==undefined?root.ready(selector):selector(jQuery);}
return jQuery.makeArray(selector,this);};init.prototype=jQuery.fn;rootjQuery=jQuery(document);var rparentsprev=/^(?:parents|prev(?:Until|All))/,guaranteedUnique={children:true,contents:true,next:true,prev:true};jQuery.fn.extend({has:function(target){var targets=jQuery(target,this),l=targets.length;return this.filter(function(){var i=0;for(;i<l;i++){if(jQuery.contains(this,targets[i])){return true;}}});},closest:function(selectors,context){var cur,i=0,l=this.length,matched=[],targets=typeof selectors!=="string"&&jQuery(selectors);if(!rneedsContext.test(selectors)){for(;i<l;i++){for(cur=this[i];cur&&cur!==context;cur=cur.parentNode){if(cur.nodeType<11&&(targets?targets.index(cur)>-1:cur.nodeType===1&&jQuery.find.matchesSelector(cur,selectors))){matched.push(cur);break;}}}}
return this.pushStack(matched.length>1?jQuery.uniqueSort(matched):matched);},index:function(elem){if(!elem){return(this[0]&&this[0].parentNode)?this.first().prevAll().length:-1;}
if(typeof elem==="string"){return indexOf.call(jQuery(elem),this[0]);}
return indexOf.call(this,elem.jquery?elem[0]:elem);},add:function(selector,context){return this.pushStack(jQuery.uniqueSort(jQuery.merge(this.get(),jQuery(selector,context))));},addBack:function(selector){return this.add(selector==null?this.prevObject:this.prevObject.filter(selector));}});function sibling(cur,dir){while((cur=cur[dir])&&cur.nodeType!==1){}
return cur;}
jQuery.each({parent:function(elem){var parent=elem.parentNode;return parent&&parent.nodeType!==11?parent:null;},parents:function(elem){return dir(elem,"parentNode");},parentsUntil:function(elem,_i,until){return dir(elem,"parentNode",until);},next:function(elem){return sibling(elem,"nextSibling");},prev:function(elem){return sibling(elem,"previousSibling");},nextAll:function(elem){return dir(elem,"nextSibling");},prevAll:function(elem){return dir(elem,"previousSibling");},nextUntil:function(elem,_i,until){return dir(elem,"nextSibling",until);},prevUntil:function(elem,_i,until){return dir(elem,"previousSibling",until);},siblings:function(elem){return siblings((elem.parentNode||{}).firstChild,elem);},children:function(elem){return siblings(elem.firstChild);},contents:function(elem){if(elem.contentDocument!=null&&getProto(elem.contentDocument)){return elem.contentDocument;}
if(nodeName(elem,"template")){elem=elem.content||elem;}
return jQuery.merge([],elem.childNodes);}},function(name,fn){jQuery.fn[name]=function(until,selector){var matched=jQuery.map(this,fn,until);if(name.slice(-5)!=="Until"){selector=until;}
if(selector&&typeof selector==="string"){matched=jQuery.filter(selector,matched);}
if(this.length>1){if(!guaranteedUnique[name]){jQuery.uniqueSort(matched);}
if(rparentsprev.test(name)){matched.reverse();}}
return this.pushStack(matched);};});var rnothtmlwhite=(/[^\x20\t\r\n\f]+/g);function createOptions(options){var object={};jQuery.each(options.match(rnothtmlwhite)||[],function(_,flag){object[flag]=true;});return object;}
jQuery.Callbacks=function(options){options=typeof options==="string"?createOptions(options):jQuery.extend({},options);var
firing,memory,fired,locked,list=[],queue=[],firingIndex=-1,fire=function(){locked=locked||options.once;fired=firing=true;for(;queue.length;firingIndex=-1){memory=queue.shift();while(++firingIndex<list.length){if(list[firingIndex].apply(memory[0],memory[1])===false&&options.stopOnFalse){firingIndex=list.length;memory=false;}}}
if(!options.memory){memory=false;}
firing=false;if(locked){if(memory){list=[];}else{list="";}}},self={add:function(){if(list){if(memory&&!firing){firingIndex=list.length-1;queue.push(memory);}
(function add(args){jQuery.each(args,function(_,arg){if(isFunction(arg)){if(!options.unique||!self.has(arg)){list.push(arg);}}else if(arg&&arg.length&&toType(arg)!=="string"){add(arg);}});})(arguments);if(memory&&!firing){fire();}}
return this;},remove:function(){jQuery.each(arguments,function(_,arg){var index;while((index=jQuery.inArray(arg,list,index))>-1){list.splice(index,1);if(index<=firingIndex){firingIndex--;}}});return this;},has:function(fn){return fn?jQuery.inArray(fn,list)>-1:list.length>0;},empty:function(){if(list){list=[];}
return this;},disable:function(){locked=queue=[];list=memory="";return this;},disabled:function(){return!list;},lock:function(){locked=queue=[];if(!memory&&!firing){list=memory="";}
return this;},locked:function(){return!!locked;},fireWith:function(context,args){if(!locked){args=args||[];args=[context,args.slice?args.slice():args];queue.push(args);if(!firing){fire();}}
return this;},fire:function(){self.fireWith(this,arguments);return this;},fired:function(){return!!fired;}};return self;};function Identity(v){return v;}
function Thrower(ex){throw ex;}
function adoptValue(value,resolve,reject,noValue){var method;try{if(value&&isFunction((method=value.promise))){method.call(value).done(resolve).fail(reject);}else if(value&&isFunction((method=value.then))){method.call(value,resolve,reject);}else{resolve.apply(undefined,[value].slice(noValue));}}catch(value){reject.apply(undefined,[value]);}}
jQuery.extend({Deferred:function(func){var tuples=[["notify","progress",jQuery.Callbacks("memory"),jQuery.Callbacks("memory"),2],["resolve","done",jQuery.Callbacks("once memory"),jQuery.Callbacks("once memory"),0,"resolved"],["reject","fail",jQuery.Callbacks("once memory"),jQuery.Callbacks("once memory"),1,"rejected"]],state="pending",promise={state:function(){return state;},always:function(){deferred.done(arguments).fail(arguments);return this;},"catch":function(fn){return promise.then(null,fn);},pipe:function(){var fns=arguments;return jQuery.Deferred(function(newDefer){jQuery.each(tuples,function(_i,tuple){var fn=isFunction(fns[tuple[4]])&&fns[tuple[4]];deferred[tuple[1]](function(){var returned=fn&&fn.apply(this,arguments);if(returned&&isFunction(returned.promise)){returned.promise().progress(newDefer.notify).done(newDefer.resolve).fail(newDefer.reject);}else{newDefer[tuple[0]+"With"](this,fn?[returned]:arguments);}});});fns=null;}).promise();},then:function(onFulfilled,onRejected,onProgress){var maxDepth=0;function resolve(depth,deferred,handler,special){return function(){var that=this,args=arguments,mightThrow=function(){var returned,then;if(depth<maxDepth){return;}
returned=handler.apply(that,args);if(returned===deferred.promise()){throw new TypeError("Thenable self-resolution");}
then=returned&&(typeof returned==="object"||typeof returned==="function")&&returned.then;if(isFunction(then)){if(special){then.call(returned,resolve(maxDepth,deferred,Identity,special),resolve(maxDepth,deferred,Thrower,special));}else{maxDepth++;then.call(returned,resolve(maxDepth,deferred,Identity,special),resolve(maxDepth,deferred,Thrower,special),resolve(maxDepth,deferred,Identity,deferred.notifyWith));}}else{if(handler!==Identity){that=undefined;args=[returned];}
(special||deferred.resolveWith)(that,args);}},process=special?mightThrow:function(){try{mightThrow();}catch(e){if(jQuery.Deferred.exceptionHook){jQuery.Deferred.exceptionHook(e,process.stackTrace);}
if(depth+1>=maxDepth){if(handler!==Thrower){that=undefined;args=[e];}
deferred.rejectWith(that,args);}}};if(depth){process();}else{if(jQuery.Deferred.getStackHook){process.stackTrace=jQuery.Deferred.getStackHook();}
window.setTimeout(process);}};}
return jQuery.Deferred(function(newDefer){tuples[0][3].add(resolve(0,newDefer,isFunction(onProgress)?onProgress:Identity,newDefer.notifyWith));tuples[1][3].add(resolve(0,newDefer,isFunction(onFulfilled)?onFulfilled:Identity));tuples[2][3].add(resolve(0,newDefer,isFunction(onRejected)?onRejected:Thrower));}).promise();},promise:function(obj){return obj!=null?jQuery.extend(obj,promise):promise;}},deferred={};jQuery.each(tuples,function(i,tuple){var list=tuple[2],stateString=tuple[5];promise[tuple[1]]=list.add;if(stateString){list.add(function(){state=stateString;},tuples[3-i][2].disable,tuples[3-i][3].disable,tuples[0][2].lock,tuples[0][3].lock);}
list.add(tuple[3].fire);deferred[tuple[0]]=function(){deferred[tuple[0]+"With"](this===deferred?undefined:this,arguments);return this;};deferred[tuple[0]+"With"]=list.fireWith;});promise.promise(deferred);if(func){func.call(deferred,deferred);}
return deferred;},when:function(singleValue){var
remaining=arguments.length,i=remaining,resolveContexts=Array(i),resolveValues=slice.call(arguments),primary=jQuery.Deferred(),updateFunc=function(i){return function(value){resolveContexts[i]=this;resolveValues[i]=arguments.length>1?slice.call(arguments):value;if(!(--remaining)){primary.resolveWith(resolveContexts,resolveValues);}};};if(remaining<=1){adoptValue(singleValue,primary.done(updateFunc(i)).resolve,primary.reject,!remaining);if(primary.state()==="pending"||isFunction(resolveValues[i]&&resolveValues[i].then)){return primary.then();}}
while(i--){adoptValue(resolveValues[i],updateFunc(i),primary.reject);}
return primary.promise();}});var rerrorNames=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;jQuery.Deferred.exceptionHook=function(error,stack){if(window.console&&window.console.warn&&error&&rerrorNames.test(error.name)){window.console.warn("jQuery.Deferred exception: "+error.message,error.stack,stack);}};jQuery.readyException=function(error){window.setTimeout(function(){throw error;});};var readyList=jQuery.Deferred();jQuery.fn.ready=function(fn){readyList.then(fn).catch(function(error){jQuery.readyException(error);});return this;};jQuery.extend({isReady:false,readyWait:1,ready:function(wait){if(wait===true?--jQuery.readyWait:jQuery.isReady){return;}
jQuery.isReady=true;if(wait!==true&&--jQuery.readyWait>0){return;}
readyList.resolveWith(document,[jQuery]);}});jQuery.ready.then=readyList.then;function completed(){document.removeEventListener("DOMContentLoaded",completed);window.removeEventListener("load",completed);jQuery.ready();}
if(document.readyState==="complete"||(document.readyState!=="loading"&&!document.documentElement.doScroll)){window.setTimeout(jQuery.ready);}else{document.addEventListener("DOMContentLoaded",completed);window.addEventListener("load",completed);}
var access=function(elems,fn,key,value,chainable,emptyGet,raw){var i=0,len=elems.length,bulk=key==null;if(toType(key)==="object"){chainable=true;for(i in key){access(elems,fn,i,key[i],true,emptyGet,raw);}}else if(value!==undefined){chainable=true;if(!isFunction(value)){raw=true;}
if(bulk){if(raw){fn.call(elems,value);fn=null;}else{bulk=fn;fn=function(elem,_key,value){return bulk.call(jQuery(elem),value);};}}
if(fn){for(;i<len;i++){fn(elems[i],key,raw?value:value.call(elems[i],i,fn(elems[i],key)));}}}
if(chainable){return elems;}
if(bulk){return fn.call(elems);}
return len?fn(elems[0],key):emptyGet;};var rmsPrefix=/^-ms-/,rdashAlpha=/-([a-z])/g;function fcamelCase(_all,letter){return letter.toUpperCase();}
function camelCase(string){return string.replace(rmsPrefix,"ms-").replace(rdashAlpha,fcamelCase);}
var acceptData=function(owner){return owner.nodeType===1||owner.nodeType===9||!(+owner.nodeType);};function Data(){this.expando=jQuery.expando+Data.uid++;}
Data.uid=1;Data.prototype={cache:function(owner){var value=owner[this.expando];if(!value){value={};if(acceptData(owner)){if(owner.nodeType){owner[this.expando]=value;}else{Object.defineProperty(owner,this.expando,{value:value,configurable:true});}}}
return value;},set:function(owner,data,value){var prop,cache=this.cache(owner);if(typeof data==="string"){cache[camelCase(data)]=value;}else{for(prop in data){cache[camelCase(prop)]=data[prop];}}
return cache;},get:function(owner,key){return key===undefined?this.cache(owner):owner[this.expando]&&owner[this.expando][camelCase(key)];},access:function(owner,key,value){if(key===undefined||((key&&typeof key==="string")&&value===undefined)){return this.get(owner,key);}
this.set(owner,key,value);return value!==undefined?value:key;},remove:function(owner,key){var i,cache=owner[this.expando];if(cache===undefined){return;}
if(key!==undefined){if(Array.isArray(key)){key=key.map(camelCase);}else{key=camelCase(key);key=key in cache?[key]:(key.match(rnothtmlwhite)||[]);}
i=key.length;while(i--){delete cache[key[i]];}}
if(key===undefined||jQuery.isEmptyObject(cache)){if(owner.nodeType){owner[this.expando]=undefined;}else{delete owner[this.expando];}}},hasData:function(owner){var cache=owner[this.expando];return cache!==undefined&&!jQuery.isEmptyObject(cache);}};var dataPriv=new Data();var dataUser=new Data();var rbrace=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,rmultiDash=/[A-Z]/g;function getData(data){if(data==="true"){return true;}
if(data==="false"){return false;}
if(data==="null"){return null;}
if(data===+data+""){return+data;}
if(rbrace.test(data)){return JSON.parse(data);}
return data;}
function dataAttr(elem,key,data){var name;if(data===undefined&&elem.nodeType===1){name="data-"+key.replace(rmultiDash,"-$&").toLowerCase();data=elem.getAttribute(name);if(typeof data==="string"){try{data=getData(data);}catch(e){}
dataUser.set(elem,key,data);}else{data=undefined;}}
return data;}
jQuery.extend({hasData:function(elem){return dataUser.hasData(elem)||dataPriv.hasData(elem);},data:function(elem,name,data){return dataUser.access(elem,name,data);},removeData:function(elem,name){dataUser.remove(elem,name);},_data:function(elem,name,data){return dataPriv.access(elem,name,data);},_removeData:function(elem,name){dataPriv.remove(elem,name);}});jQuery.fn.extend({data:function(key,value){var i,name,data,elem=this[0],attrs=elem&&elem.attributes;if(key===undefined){if(this.length){data=dataUser.get(elem);if(elem.nodeType===1&&!dataPriv.get(elem,"hasDataAttrs")){i=attrs.length;while(i--){if(attrs[i]){name=attrs[i].name;if(name.indexOf("data-")===0){name=camelCase(name.slice(5));dataAttr(elem,name,data[name]);}}}
dataPriv.set(elem,"hasDataAttrs",true);}}
return data;}
if(typeof key==="object"){return this.each(function(){dataUser.set(this,key);});}
return access(this,function(value){var data;if(elem&&value===undefined){data=dataUser.get(elem,key);if(data!==undefined){return data;}
data=dataAttr(elem,key);if(data!==undefined){return data;}
return;}
this.each(function(){dataUser.set(this,key,value);});},null,value,arguments.length>1,null,true);},removeData:function(key){return this.each(function(){dataUser.remove(this,key);});}});jQuery.extend({queue:function(elem,type,data){var queue;if(elem){type=(type||"fx")+"queue";queue=dataPriv.get(elem,type);if(data){if(!queue||Array.isArray(data)){queue=dataPriv.access(elem,type,jQuery.makeArray(data));}else{queue.push(data);}}
return queue||[];}},dequeue:function(elem,type){type=type||"fx";var queue=jQuery.queue(elem,type),startLength=queue.length,fn=queue.shift(),hooks=jQuery._queueHooks(elem,type),next=function(){jQuery.dequeue(elem,type);};if(fn==="inprogress"){fn=queue.shift();startLength--;}
if(fn){if(type==="fx"){queue.unshift("inprogress");}
delete hooks.stop;fn.call(elem,next,hooks);}
if(!startLength&&hooks){hooks.empty.fire();}},_queueHooks:function(elem,type){var key=type+"queueHooks";return dataPriv.get(elem,key)||dataPriv.access(elem,key,{empty:jQuery.Callbacks("once memory").add(function(){dataPriv.remove(elem,[type+"queue",key]);})});}});jQuery.fn.extend({queue:function(type,data){var setter=2;if(typeof type!=="string"){data=type;type="fx";setter--;}
if(arguments.length<setter){return jQuery.queue(this[0],type);}
return data===undefined?this:this.each(function(){var queue=jQuery.queue(this,type,data);jQuery._queueHooks(this,type);if(type==="fx"&&queue[0]!=="inprogress"){jQuery.dequeue(this,type);}});},dequeue:function(type){return this.each(function(){jQuery.dequeue(this,type);});},clearQueue:function(type){return this.queue(type||"fx",[]);},promise:function(type,obj){var tmp,count=1,defer=jQuery.Deferred(),elements=this,i=this.length,resolve=function(){if(!(--count)){defer.resolveWith(elements,[elements]);}};if(typeof type!=="string"){obj=type;type=undefined;}
type=type||"fx";while(i--){tmp=dataPriv.get(elements[i],type+"queueHooks");if(tmp&&tmp.empty){count++;tmp.empty.add(resolve);}}
resolve();return defer.promise(obj);}});var pnum=(/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/).source;var rcssNum=new RegExp("^(?:([+-])=|)("+pnum+")([a-z%]*)$","i");var cssExpand=["Top","Right","Bottom","Left"];var documentElement=document.documentElement;var isAttached=function(elem){return jQuery.contains(elem.ownerDocument,elem);},composed={composed:true};if(documentElement.getRootNode){isAttached=function(elem){return jQuery.contains(elem.ownerDocument,elem)||elem.getRootNode(composed)===elem.ownerDocument;};}
var isHiddenWithinTree=function(elem,el){elem=el||elem;return elem.style.display==="none"||elem.style.display===""&&isAttached(elem)&&jQuery.css(elem,"display")==="none";};function adjustCSS(elem,prop,valueParts,tween){var adjusted,scale,maxIterations=20,currentValue=tween?function(){return tween.cur();}:function(){return jQuery.css(elem,prop,"");},initial=currentValue(),unit=valueParts&&valueParts[3]||(jQuery.cssNumber[prop]?"":"px"),initialInUnit=elem.nodeType&&(jQuery.cssNumber[prop]||unit!=="px"&&+initial)&&rcssNum.exec(jQuery.css(elem,prop));if(initialInUnit&&initialInUnit[3]!==unit){initial=initial/2;unit=unit||initialInUnit[3];initialInUnit=+initial||1;while(maxIterations--){jQuery.style(elem,prop,initialInUnit+unit);if((1-scale)*(1-(scale=currentValue()/initial||0.5))<=0){maxIterations=0;}
initialInUnit=initialInUnit/scale;}
initialInUnit=initialInUnit*2;jQuery.style(elem,prop,initialInUnit+unit);valueParts=valueParts||[];}
if(valueParts){initialInUnit=+initialInUnit||+initial||0;adjusted=valueParts[1]?initialInUnit+(valueParts[1]+1)*valueParts[2]:+valueParts[2];if(tween){tween.unit=unit;tween.start=initialInUnit;tween.end=adjusted;}}
return adjusted;}
var defaultDisplayMap={};function getDefaultDisplay(elem){var temp,doc=elem.ownerDocument,nodeName=elem.nodeName,display=defaultDisplayMap[nodeName];if(display){return display;}
temp=doc.body.appendChild(doc.createElement(nodeName));display=jQuery.css(temp,"display");temp.parentNode.removeChild(temp);if(display==="none"){display="block";}
defaultDisplayMap[nodeName]=display;return display;}
function showHide(elements,show){var display,elem,values=[],index=0,length=elements.length;for(;index<length;index++){elem=elements[index];if(!elem.style){continue;}
display=elem.style.display;if(show){if(display==="none"){values[index]=dataPriv.get(elem,"display")||null;if(!values[index]){elem.style.display="";}}
if(elem.style.display===""&&isHiddenWithinTree(elem)){values[index]=getDefaultDisplay(elem);}}else{if(display!=="none"){values[index]="none";dataPriv.set(elem,"display",display);}}}
for(index=0;index<length;index++){if(values[index]!=null){elements[index].style.display=values[index];}}
return elements;}
jQuery.fn.extend({show:function(){return showHide(this,true);},hide:function(){return showHide(this);},toggle:function(state){if(typeof state==="boolean"){return state?this.show():this.hide();}
return this.each(function(){if(isHiddenWithinTree(this)){jQuery(this).show();}else{jQuery(this).hide();}});}});var rcheckableType=(/^(?:checkbox|radio)$/i);var rtagName=(/<([a-z][^\/\0>\x20\t\r\n\f]*)/i);var rscriptType=(/^$|^module$|\/(?:java|ecma)script/i);(function(){var fragment=document.createDocumentFragment(),div=fragment.appendChild(document.createElement("div")),input=document.createElement("input");input.setAttribute("type","radio");input.setAttribute("checked","checked");input.setAttribute("name","t");div.appendChild(input);support.checkClone=div.cloneNode(true).cloneNode(true).lastChild.checked;div.innerHTML="<textarea>x</textarea>";support.noCloneChecked=!!div.cloneNode(true).lastChild.defaultValue;div.innerHTML="<option></option>";support.option=!!div.lastChild;})();var wrapMap={thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};wrapMap.tbody=wrapMap.tfoot=wrapMap.colgroup=wrapMap.caption=wrapMap.thead;wrapMap.th=wrapMap.td;if(!support.option){wrapMap.optgroup=wrapMap.option=[1,"<select multiple='multiple'>","</select>"];}
function getAll(context,tag){var ret;if(typeof context.getElementsByTagName!=="undefined"){ret=context.getElementsByTagName(tag||"*");}else if(typeof context.querySelectorAll!=="undefined"){ret=context.querySelectorAll(tag||"*");}else{ret=[];}
if(tag===undefined||tag&&nodeName(context,tag)){return jQuery.merge([context],ret);}
return ret;}
function setGlobalEval(elems,refElements){var i=0,l=elems.length;for(;i<l;i++){dataPriv.set(elems[i],"globalEval",!refElements||dataPriv.get(refElements[i],"globalEval"));}}
var rhtml=/<|&#?\w+;/;function buildFragment(elems,context,scripts,selection,ignored){var elem,tmp,tag,wrap,attached,j,fragment=context.createDocumentFragment(),nodes=[],i=0,l=elems.length;for(;i<l;i++){elem=elems[i];if(elem||elem===0){if(toType(elem)==="object"){jQuery.merge(nodes,elem.nodeType?[elem]:elem);}else if(!rhtml.test(elem)){nodes.push(context.createTextNode(elem));}else{tmp=tmp||fragment.appendChild(context.createElement("div"));tag=(rtagName.exec(elem)||["",""])[1].toLowerCase();wrap=wrapMap[tag]||wrapMap._default;tmp.innerHTML=wrap[1]+jQuery.htmlPrefilter(elem)+wrap[2];j=wrap[0];while(j--){tmp=tmp.lastChild;}
jQuery.merge(nodes,tmp.childNodes);tmp=fragment.firstChild;tmp.textContent="";}}}
fragment.textContent="";i=0;while((elem=nodes[i++])){if(selection&&jQuery.inArray(elem,selection)>-1){if(ignored){ignored.push(elem);}
continue;}
attached=isAttached(elem);tmp=getAll(fragment.appendChild(elem),"script");if(attached){setGlobalEval(tmp);}
if(scripts){j=0;while((elem=tmp[j++])){if(rscriptType.test(elem.type||"")){scripts.push(elem);}}}}
return fragment;}
var rtypenamespace=/^([^.]*)(?:\.(.+)|)/;function returnTrue(){return true;}
function returnFalse(){return false;}
function expectSync(elem,type){return(elem===safeActiveElement())===(type==="focus");}
function safeActiveElement(){try{return document.activeElement;}catch(err){}}
function on(elem,types,selector,data,fn,one){var origFn,type;if(typeof types==="object"){if(typeof selector!=="string"){data=data||selector;selector=undefined;}
for(type in types){on(elem,type,selector,data,types[type],one);}
return elem;}
if(data==null&&fn==null){fn=selector;data=selector=undefined;}else if(fn==null){if(typeof selector==="string"){fn=data;data=undefined;}else{fn=data;data=selector;selector=undefined;}}
if(fn===false){fn=returnFalse;}else if(!fn){return elem;}
if(one===1){origFn=fn;fn=function(event){jQuery().off(event);return origFn.apply(this,arguments);};fn.guid=origFn.guid||(origFn.guid=jQuery.guid++);}
return elem.each(function(){jQuery.event.add(this,types,fn,data,selector);});}
jQuery.event={global:{},add:function(elem,types,handler,data,selector){var handleObjIn,eventHandle,tmp,events,t,handleObj,special,handlers,type,namespaces,origType,elemData=dataPriv.get(elem);if(!acceptData(elem)){return;}
if(handler.handler){handleObjIn=handler;handler=handleObjIn.handler;selector=handleObjIn.selector;}
if(selector){jQuery.find.matchesSelector(documentElement,selector);}
if(!handler.guid){handler.guid=jQuery.guid++;}
if(!(events=elemData.events)){events=elemData.events=Object.create(null);}
if(!(eventHandle=elemData.handle)){eventHandle=elemData.handle=function(e){return typeof jQuery!=="undefined"&&jQuery.event.triggered!==e.type?jQuery.event.dispatch.apply(elem,arguments):undefined;};}
types=(types||"").match(rnothtmlwhite)||[""];t=types.length;while(t--){tmp=rtypenamespace.exec(types[t])||[];type=origType=tmp[1];namespaces=(tmp[2]||"").split(".").sort();if(!type){continue;}
special=jQuery.event.special[type]||{};type=(selector?special.delegateType:special.bindType)||type;special=jQuery.event.special[type]||{};handleObj=jQuery.extend({type:type,origType:origType,data:data,handler:handler,guid:handler.guid,selector:selector,needsContext:selector&&jQuery.expr.match.needsContext.test(selector),namespace:namespaces.join(".")},handleObjIn);if(!(handlers=events[type])){handlers=events[type]=[];handlers.delegateCount=0;if(!special.setup||special.setup.call(elem,data,namespaces,eventHandle)===false){if(elem.addEventListener){elem.addEventListener(type,eventHandle);}}}
if(special.add){special.add.call(elem,handleObj);if(!handleObj.handler.guid){handleObj.handler.guid=handler.guid;}}
if(selector){handlers.splice(handlers.delegateCount++,0,handleObj);}else{handlers.push(handleObj);}
jQuery.event.global[type]=true;}},remove:function(elem,types,handler,selector,mappedTypes){var j,origCount,tmp,events,t,handleObj,special,handlers,type,namespaces,origType,elemData=dataPriv.hasData(elem)&&dataPriv.get(elem);if(!elemData||!(events=elemData.events)){return;}
types=(types||"").match(rnothtmlwhite)||[""];t=types.length;while(t--){tmp=rtypenamespace.exec(types[t])||[];type=origType=tmp[1];namespaces=(tmp[2]||"").split(".").sort();if(!type){for(type in events){jQuery.event.remove(elem,type+types[t],handler,selector,true);}
continue;}
special=jQuery.event.special[type]||{};type=(selector?special.delegateType:special.bindType)||type;handlers=events[type]||[];tmp=tmp[2]&&new RegExp("(^|\\.)"+namespaces.join("\\.(?:.*\\.|)")+"(\\.|$)");origCount=j=handlers.length;while(j--){handleObj=handlers[j];if((mappedTypes||origType===handleObj.origType)&&(!handler||handler.guid===handleObj.guid)&&(!tmp||tmp.test(handleObj.namespace))&&(!selector||selector===handleObj.selector||selector==="**"&&handleObj.selector)){handlers.splice(j,1);if(handleObj.selector){handlers.delegateCount--;}
if(special.remove){special.remove.call(elem,handleObj);}}}
if(origCount&&!handlers.length){if(!special.teardown||special.teardown.call(elem,namespaces,elemData.handle)===false){jQuery.removeEvent(elem,type,elemData.handle);}
delete events[type];}}
if(jQuery.isEmptyObject(events)){dataPriv.remove(elem,"handle events");}},dispatch:function(nativeEvent){var i,j,ret,matched,handleObj,handlerQueue,args=new Array(arguments.length),event=jQuery.event.fix(nativeEvent),handlers=(dataPriv.get(this,"events")||Object.create(null))[event.type]||[],special=jQuery.event.special[event.type]||{};args[0]=event;for(i=1;i<arguments.length;i++){args[i]=arguments[i];}
event.delegateTarget=this;if(special.preDispatch&&special.preDispatch.call(this,event)===false){return;}
handlerQueue=jQuery.event.handlers.call(this,event,handlers);i=0;while((matched=handlerQueue[i++])&&!event.isPropagationStopped()){event.currentTarget=matched.elem;j=0;while((handleObj=matched.handlers[j++])&&!event.isImmediatePropagationStopped()){if(!event.rnamespace||handleObj.namespace===false||event.rnamespace.test(handleObj.namespace)){event.handleObj=handleObj;event.data=handleObj.data;ret=((jQuery.event.special[handleObj.origType]||{}).handle||handleObj.handler).apply(matched.elem,args);if(ret!==undefined){if((event.result=ret)===false){event.preventDefault();event.stopPropagation();}}}}}
if(special.postDispatch){special.postDispatch.call(this,event);}
return event.result;},handlers:function(event,handlers){var i,handleObj,sel,matchedHandlers,matchedSelectors,handlerQueue=[],delegateCount=handlers.delegateCount,cur=event.target;if(delegateCount&&cur.nodeType&&!(event.type==="click"&&event.button>=1)){for(;cur!==this;cur=cur.parentNode||this){if(cur.nodeType===1&&!(event.type==="click"&&cur.disabled===true)){matchedHandlers=[];matchedSelectors={};for(i=0;i<delegateCount;i++){handleObj=handlers[i];sel=handleObj.selector+" ";if(matchedSelectors[sel]===undefined){matchedSelectors[sel]=handleObj.needsContext?jQuery(sel,this).index(cur)>-1:jQuery.find(sel,this,null,[cur]).length;}
if(matchedSelectors[sel]){matchedHandlers.push(handleObj);}}
if(matchedHandlers.length){handlerQueue.push({elem:cur,handlers:matchedHandlers});}}}}
cur=this;if(delegateCount<handlers.length){handlerQueue.push({elem:cur,handlers:handlers.slice(delegateCount)});}
return handlerQueue;},addProp:function(name,hook){Object.defineProperty(jQuery.Event.prototype,name,{enumerable:true,configurable:true,get:isFunction(hook)?function(){if(this.originalEvent){return hook(this.originalEvent);}}:function(){if(this.originalEvent){return this.originalEvent[name];}},set:function(value){Object.defineProperty(this,name,{enumerable:true,configurable:true,writable:true,value:value});}});},fix:function(originalEvent){return originalEvent[jQuery.expando]?originalEvent:new jQuery.Event(originalEvent);},special:{load:{noBubble:true},click:{setup:function(data){var el=this||data;if(rcheckableType.test(el.type)&&el.click&&nodeName(el,"input")){leverageNative(el,"click",returnTrue);}
return false;},trigger:function(data){var el=this||data;if(rcheckableType.test(el.type)&&el.click&&nodeName(el,"input")){leverageNative(el,"click");}
return true;},_default:function(event){var target=event.target;return rcheckableType.test(target.type)&&target.click&&nodeName(target,"input")&&dataPriv.get(target,"click")||nodeName(target,"a");}},beforeunload:{postDispatch:function(event){if(event.result!==undefined&&event.originalEvent){event.originalEvent.returnValue=event.result;}}}}};function leverageNative(el,type,expectSync){if(!expectSync){if(dataPriv.get(el,type)===undefined){jQuery.event.add(el,type,returnTrue);}
return;}
dataPriv.set(el,type,false);jQuery.event.add(el,type,{namespace:false,handler:function(event){var notAsync,result,saved=dataPriv.get(this,type);if((event.isTrigger&1)&&this[type]){if(!saved.length){saved=slice.call(arguments);dataPriv.set(this,type,saved);notAsync=expectSync(this,type);this[type]();result=dataPriv.get(this,type);if(saved!==result||notAsync){dataPriv.set(this,type,false);}else{result={};}
if(saved!==result){event.stopImmediatePropagation();event.preventDefault();return result&&result.value;}}else if((jQuery.event.special[type]||{}).delegateType){event.stopPropagation();}}else if(saved.length){dataPriv.set(this,type,{value:jQuery.event.trigger(jQuery.extend(saved[0],jQuery.Event.prototype),saved.slice(1),this)});event.stopImmediatePropagation();}}});}
jQuery.removeEvent=function(elem,type,handle){if(elem.removeEventListener){elem.removeEventListener(type,handle);}};jQuery.Event=function(src,props){if(!(this instanceof jQuery.Event)){return new jQuery.Event(src,props);}
if(src&&src.type){this.originalEvent=src;this.type=src.type;this.isDefaultPrevented=src.defaultPrevented||src.defaultPrevented===undefined&&src.returnValue===false?returnTrue:returnFalse;this.target=(src.target&&src.target.nodeType===3)?src.target.parentNode:src.target;this.currentTarget=src.currentTarget;this.relatedTarget=src.relatedTarget;}else{this.type=src;}
if(props){jQuery.extend(this,props);}
this.timeStamp=src&&src.timeStamp||Date.now();this[jQuery.expando]=true;};jQuery.Event.prototype={constructor:jQuery.Event,isDefaultPrevented:returnFalse,isPropagationStopped:returnFalse,isImmediatePropagationStopped:returnFalse,isSimulated:false,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=returnTrue;if(e&&!this.isSimulated){e.preventDefault();}},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=returnTrue;if(e&&!this.isSimulated){e.stopPropagation();}},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=returnTrue;if(e&&!this.isSimulated){e.stopImmediatePropagation();}
this.stopPropagation();}};jQuery.each({altKey:true,bubbles:true,cancelable:true,changedTouches:true,ctrlKey:true,detail:true,eventPhase:true,metaKey:true,pageX:true,pageY:true,shiftKey:true,view:true,"char":true,code:true,charCode:true,key:true,keyCode:true,button:true,buttons:true,clientX:true,clientY:true,offsetX:true,offsetY:true,pointerId:true,pointerType:true,screenX:true,screenY:true,targetTouches:true,toElement:true,touches:true,which:true},jQuery.event.addProp);jQuery.each({focus:"focusin",blur:"focusout"},function(type,delegateType){jQuery.event.special[type]={setup:function(){leverageNative(this,type,expectSync);return false;},trigger:function(){leverageNative(this,type);return true;},_default:function(event){return dataPriv.get(event.target,type);},delegateType:delegateType};});jQuery.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(orig,fix){jQuery.event.special[orig]={delegateType:fix,bindType:fix,handle:function(event){var ret,target=this,related=event.relatedTarget,handleObj=event.handleObj;if(!related||(related!==target&&!jQuery.contains(target,related))){event.type=handleObj.origType;ret=handleObj.handler.apply(this,arguments);event.type=fix;}
return ret;}};});jQuery.fn.extend({on:function(types,selector,data,fn){return on(this,types,selector,data,fn);},one:function(types,selector,data,fn){return on(this,types,selector,data,fn,1);},off:function(types,selector,fn){var handleObj,type;if(types&&types.preventDefault&&types.handleObj){handleObj=types.handleObj;jQuery(types.delegateTarget).off(handleObj.namespace?handleObj.origType+"."+handleObj.namespace:handleObj.origType,handleObj.selector,handleObj.handler);return this;}
if(typeof types==="object"){for(type in types){this.off(type,selector,types[type]);}
return this;}
if(selector===false||typeof selector==="function"){fn=selector;selector=undefined;}
if(fn===false){fn=returnFalse;}
return this.each(function(){jQuery.event.remove(this,types,fn,selector);});}});var
rnoInnerhtml=/<script|<style|<link/i,rchecked=/checked\s*(?:[^=]|=\s*.checked.)/i,rcleanScript=/^\s*<!\[CDATA\[|\]\]>\s*$/g;function manipulationTarget(elem,content){if(nodeName(elem,"table")&&nodeName(content.nodeType!==11?content:content.firstChild,"tr")){return jQuery(elem).children("tbody")[0]||elem;}
return elem;}
function disableScript(elem){elem.type=(elem.getAttribute("type")!==null)+"/"+elem.type;return elem;}
function restoreScript(elem){if((elem.type||"").slice(0,5)==="true/"){elem.type=elem.type.slice(5);}else{elem.removeAttribute("type");}
return elem;}
function cloneCopyEvent(src,dest){var i,l,type,pdataOld,udataOld,udataCur,events;if(dest.nodeType!==1){return;}
if(dataPriv.hasData(src)){pdataOld=dataPriv.get(src);events=pdataOld.events;if(events){dataPriv.remove(dest,"handle events");for(type in events){for(i=0,l=events[type].length;i<l;i++){jQuery.event.add(dest,type,events[type][i]);}}}}
if(dataUser.hasData(src)){udataOld=dataUser.access(src);udataCur=jQuery.extend({},udataOld);dataUser.set(dest,udataCur);}}
function fixInput(src,dest){var nodeName=dest.nodeName.toLowerCase();if(nodeName==="input"&&rcheckableType.test(src.type)){dest.checked=src.checked;}else if(nodeName==="input"||nodeName==="textarea"){dest.defaultValue=src.defaultValue;}}
function domManip(collection,args,callback,ignored){args=flat(args);var fragment,first,scripts,hasScripts,node,doc,i=0,l=collection.length,iNoClone=l-1,value=args[0],valueIsFunction=isFunction(value);if(valueIsFunction||(l>1&&typeof value==="string"&&!support.checkClone&&rchecked.test(value))){return collection.each(function(index){var self=collection.eq(index);if(valueIsFunction){args[0]=value.call(this,index,self.html());}
domManip(self,args,callback,ignored);});}
if(l){fragment=buildFragment(args,collection[0].ownerDocument,false,collection,ignored);first=fragment.firstChild;if(fragment.childNodes.length===1){fragment=first;}
if(first||ignored){scripts=jQuery.map(getAll(fragment,"script"),disableScript);hasScripts=scripts.length;for(;i<l;i++){node=fragment;if(i!==iNoClone){node=jQuery.clone(node,true,true);if(hasScripts){jQuery.merge(scripts,getAll(node,"script"));}}
callback.call(collection[i],node,i);}
if(hasScripts){doc=scripts[scripts.length-1].ownerDocument;jQuery.map(scripts,restoreScript);for(i=0;i<hasScripts;i++){node=scripts[i];if(rscriptType.test(node.type||"")&&!dataPriv.access(node,"globalEval")&&jQuery.contains(doc,node)){if(node.src&&(node.type||"").toLowerCase()!=="module"){if(jQuery._evalUrl&&!node.noModule){jQuery._evalUrl(node.src,{nonce:node.nonce||node.getAttribute("nonce")},doc);}}else{DOMEval(node.textContent.replace(rcleanScript,""),node,doc);}}}}}}
return collection;}
function remove(elem,selector,keepData){var node,nodes=selector?jQuery.filter(selector,elem):elem,i=0;for(;(node=nodes[i])!=null;i++){if(!keepData&&node.nodeType===1){jQuery.cleanData(getAll(node));}
if(node.parentNode){if(keepData&&isAttached(node)){setGlobalEval(getAll(node,"script"));}
node.parentNode.removeChild(node);}}
return elem;}
jQuery.extend({htmlPrefilter:function(html){return html;},clone:function(elem,dataAndEvents,deepDataAndEvents){var i,l,srcElements,destElements,clone=elem.cloneNode(true),inPage=isAttached(elem);if(!support.noCloneChecked&&(elem.nodeType===1||elem.nodeType===11)&&!jQuery.isXMLDoc(elem)){destElements=getAll(clone);srcElements=getAll(elem);for(i=0,l=srcElements.length;i<l;i++){fixInput(srcElements[i],destElements[i]);}}
if(dataAndEvents){if(deepDataAndEvents){srcElements=srcElements||getAll(elem);destElements=destElements||getAll(clone);for(i=0,l=srcElements.length;i<l;i++){cloneCopyEvent(srcElements[i],destElements[i]);}}else{cloneCopyEvent(elem,clone);}}
destElements=getAll(clone,"script");if(destElements.length>0){setGlobalEval(destElements,!inPage&&getAll(elem,"script"));}
return clone;},cleanData:function(elems){var data,elem,type,special=jQuery.event.special,i=0;for(;(elem=elems[i])!==undefined;i++){if(acceptData(elem)){if((data=elem[dataPriv.expando])){if(data.events){for(type in data.events){if(special[type]){jQuery.event.remove(elem,type);}else{jQuery.removeEvent(elem,type,data.handle);}}}
elem[dataPriv.expando]=undefined;}
if(elem[dataUser.expando]){elem[dataUser.expando]=undefined;}}}}});jQuery.fn.extend({detach:function(selector){return remove(this,selector,true);},remove:function(selector){return remove(this,selector);},text:function(value){return access(this,function(value){return value===undefined?jQuery.text(this):this.empty().each(function(){if(this.nodeType===1||this.nodeType===11||this.nodeType===9){this.textContent=value;}});},null,value,arguments.length);},append:function(){return domManip(this,arguments,function(elem){if(this.nodeType===1||this.nodeType===11||this.nodeType===9){var target=manipulationTarget(this,elem);target.appendChild(elem);}});},prepend:function(){return domManip(this,arguments,function(elem){if(this.nodeType===1||this.nodeType===11||this.nodeType===9){var target=manipulationTarget(this,elem);target.insertBefore(elem,target.firstChild);}});},before:function(){return domManip(this,arguments,function(elem){if(this.parentNode){this.parentNode.insertBefore(elem,this);}});},after:function(){return domManip(this,arguments,function(elem){if(this.parentNode){this.parentNode.insertBefore(elem,this.nextSibling);}});},empty:function(){var elem,i=0;for(;(elem=this[i])!=null;i++){if(elem.nodeType===1){jQuery.cleanData(getAll(elem,false));elem.textContent="";}}
return this;},clone:function(dataAndEvents,deepDataAndEvents){dataAndEvents=dataAndEvents==null?false:dataAndEvents;deepDataAndEvents=deepDataAndEvents==null?dataAndEvents:deepDataAndEvents;return this.map(function(){return jQuery.clone(this,dataAndEvents,deepDataAndEvents);});},html:function(value){return access(this,function(value){var elem=this[0]||{},i=0,l=this.length;if(value===undefined&&elem.nodeType===1){return elem.innerHTML;}
if(typeof value==="string"&&!rnoInnerhtml.test(value)&&!wrapMap[(rtagName.exec(value)||["",""])[1].toLowerCase()]){value=jQuery.htmlPrefilter(value);try{for(;i<l;i++){elem=this[i]||{};if(elem.nodeType===1){jQuery.cleanData(getAll(elem,false));elem.innerHTML=value;}}
elem=0;}catch(e){}}
if(elem){this.empty().append(value);}},null,value,arguments.length);},replaceWith:function(){var ignored=[];return domManip(this,arguments,function(elem){var parent=this.parentNode;if(jQuery.inArray(this,ignored)<0){jQuery.cleanData(getAll(this));if(parent){parent.replaceChild(elem,this);}}},ignored);}});jQuery.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(name,original){jQuery.fn[name]=function(selector){var elems,ret=[],insert=jQuery(selector),last=insert.length-1,i=0;for(;i<=last;i++){elems=i===last?this:this.clone(true);jQuery(insert[i])[original](elems);push.apply(ret,elems.get());}
return this.pushStack(ret);};});var rnumnonpx=new RegExp("^("+pnum+")(?!px)[a-z%]+$","i");var rcustomProp=/^--/;var getStyles=function(elem){var view=elem.ownerDocument.defaultView;if(!view||!view.opener){view=window;}
return view.getComputedStyle(elem);};var swap=function(elem,options,callback){var ret,name,old={};for(name in options){old[name]=elem.style[name];elem.style[name]=options[name];}
ret=callback.call(elem);for(name in options){elem.style[name]=old[name];}
return ret;};var rboxStyle=new RegExp(cssExpand.join("|"),"i");var whitespace="[\\x20\\t\\r\\n\\f]";var rtrimCSS=new RegExp("^"+whitespace+"+|((?:^|[^\\\\])(?:\\\\.)*)"+whitespace+"+$","g");(function(){function computeStyleTests(){if(!div){return;}
container.style.cssText="position:absolute;left:-11111px;width:60px;"+"margin-top:1px;padding:0;border:0";div.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;"+"margin:auto;border:1px;padding:1px;"+"width:60%;top:1%";documentElement.appendChild(container).appendChild(div);var divStyle=window.getComputedStyle(div);pixelPositionVal=divStyle.top!=="1%";reliableMarginLeftVal=roundPixelMeasures(divStyle.marginLeft)===12;div.style.right="60%";pixelBoxStylesVal=roundPixelMeasures(divStyle.right)===36;boxSizingReliableVal=roundPixelMeasures(divStyle.width)===36;div.style.position="absolute";scrollboxSizeVal=roundPixelMeasures(div.offsetWidth/3)===12;documentElement.removeChild(container);div=null;}
function roundPixelMeasures(measure){return Math.round(parseFloat(measure));}
var pixelPositionVal,boxSizingReliableVal,scrollboxSizeVal,pixelBoxStylesVal,reliableTrDimensionsVal,reliableMarginLeftVal,container=document.createElement("div"),div=document.createElement("div");if(!div.style){return;}
div.style.backgroundClip="content-box";div.cloneNode(true).style.backgroundClip="";support.clearCloneStyle=div.style.backgroundClip==="content-box";jQuery.extend(support,{boxSizingReliable:function(){computeStyleTests();return boxSizingReliableVal;},pixelBoxStyles:function(){computeStyleTests();return pixelBoxStylesVal;},pixelPosition:function(){computeStyleTests();return pixelPositionVal;},reliableMarginLeft:function(){computeStyleTests();return reliableMarginLeftVal;},scrollboxSize:function(){computeStyleTests();return scrollboxSizeVal;},reliableTrDimensions:function(){var table,tr,trChild,trStyle;if(reliableTrDimensionsVal==null){table=document.createElement("table");tr=document.createElement("tr");trChild=document.createElement("div");table.style.cssText="position:absolute;left:-11111px;border-collapse:separate";tr.style.cssText="border:1px solid";tr.style.height="1px";trChild.style.height="9px";trChild.style.display="block";documentElement.appendChild(table).appendChild(tr).appendChild(trChild);trStyle=window.getComputedStyle(tr);reliableTrDimensionsVal=(parseInt(trStyle.height,10)+
parseInt(trStyle.borderTopWidth,10)+
parseInt(trStyle.borderBottomWidth,10))===tr.offsetHeight;documentElement.removeChild(table);}
return reliableTrDimensionsVal;}});})();function curCSS(elem,name,computed){var width,minWidth,maxWidth,ret,isCustomProp=rcustomProp.test(name),style=elem.style;computed=computed||getStyles(elem);if(computed){ret=computed.getPropertyValue(name)||computed[name];if(isCustomProp&&ret){ret=ret.replace(rtrimCSS,"$1")||undefined;}
if(ret===""&&!isAttached(elem)){ret=jQuery.style(elem,name);}
if(!support.pixelBoxStyles()&&rnumnonpx.test(ret)&&rboxStyle.test(name)){width=style.width;minWidth=style.minWidth;maxWidth=style.maxWidth;style.minWidth=style.maxWidth=style.width=ret;ret=computed.width;style.width=width;style.minWidth=minWidth;style.maxWidth=maxWidth;}}
return ret!==undefined?ret+"":ret;}
function addGetHookIf(conditionFn,hookFn){return{get:function(){if(conditionFn()){delete this.get;return;}
return(this.get=hookFn).apply(this,arguments);}};}
var cssPrefixes=["Webkit","Moz","ms"],emptyStyle=document.createElement("div").style,vendorProps={};function vendorPropName(name){var capName=name[0].toUpperCase()+name.slice(1),i=cssPrefixes.length;while(i--){name=cssPrefixes[i]+capName;if(name in emptyStyle){return name;}}}
function finalPropName(name){var final=jQuery.cssProps[name]||vendorProps[name];if(final){return final;}
if(name in emptyStyle){return name;}
return vendorProps[name]=vendorPropName(name)||name;}
var
rdisplayswap=/^(none|table(?!-c[ea]).+)/,cssShow={position:"absolute",visibility:"hidden",display:"block"},cssNormalTransform={letterSpacing:"0",fontWeight:"400"};function setPositiveNumber(_elem,value,subtract){var matches=rcssNum.exec(value);return matches?Math.max(0,matches[2]-(subtract||0))+(matches[3]||"px"):value;}
function boxModelAdjustment(elem,dimension,box,isBorderBox,styles,computedVal){var i=dimension==="width"?1:0,extra=0,delta=0;if(box===(isBorderBox?"border":"content")){return 0;}
for(;i<4;i+=2){if(box==="margin"){delta+=jQuery.css(elem,box+cssExpand[i],true,styles);}
if(!isBorderBox){delta+=jQuery.css(elem,"padding"+cssExpand[i],true,styles);if(box!=="padding"){delta+=jQuery.css(elem,"border"+cssExpand[i]+"Width",true,styles);}else{extra+=jQuery.css(elem,"border"+cssExpand[i]+"Width",true,styles);}}else{if(box==="content"){delta-=jQuery.css(elem,"padding"+cssExpand[i],true,styles);}
if(box!=="margin"){delta-=jQuery.css(elem,"border"+cssExpand[i]+"Width",true,styles);}}}
if(!isBorderBox&&computedVal>=0){delta+=Math.max(0,Math.ceil(elem["offset"+dimension[0].toUpperCase()+dimension.slice(1)]-
computedVal-
delta-
extra-
0.5))||0;}
return delta;}
function getWidthOrHeight(elem,dimension,extra){var styles=getStyles(elem),boxSizingNeeded=!support.boxSizingReliable()||extra,isBorderBox=boxSizingNeeded&&jQuery.css(elem,"boxSizing",false,styles)==="border-box",valueIsBorderBox=isBorderBox,val=curCSS(elem,dimension,styles),offsetProp="offset"+dimension[0].toUpperCase()+dimension.slice(1);if(rnumnonpx.test(val)){if(!extra){return val;}
val="auto";}
if((!support.boxSizingReliable()&&isBorderBox||!support.reliableTrDimensions()&&nodeName(elem,"tr")||val==="auto"||!parseFloat(val)&&jQuery.css(elem,"display",false,styles)==="inline")&&elem.getClientRects().length){isBorderBox=jQuery.css(elem,"boxSizing",false,styles)==="border-box";valueIsBorderBox=offsetProp in elem;if(valueIsBorderBox){val=elem[offsetProp];}}
val=parseFloat(val)||0;return(val+
boxModelAdjustment(elem,dimension,extra||(isBorderBox?"border":"content"),valueIsBorderBox,styles,val))+"px";}
jQuery.extend({cssHooks:{opacity:{get:function(elem,computed){if(computed){var ret=curCSS(elem,"opacity");return ret===""?"1":ret;}}}},cssNumber:{"animationIterationCount":true,"columnCount":true,"fillOpacity":true,"flexGrow":true,"flexShrink":true,"fontWeight":true,"gridArea":true,"gridColumn":true,"gridColumnEnd":true,"gridColumnStart":true,"gridRow":true,"gridRowEnd":true,"gridRowStart":true,"lineHeight":true,"opacity":true,"order":true,"orphans":true,"widows":true,"zIndex":true,"zoom":true},cssProps:{},style:function(elem,name,value,extra){if(!elem||elem.nodeType===3||elem.nodeType===8||!elem.style){return;}
var ret,type,hooks,origName=camelCase(name),isCustomProp=rcustomProp.test(name),style=elem.style;if(!isCustomProp){name=finalPropName(origName);}
hooks=jQuery.cssHooks[name]||jQuery.cssHooks[origName];if(value!==undefined){type=typeof value;if(type==="string"&&(ret=rcssNum.exec(value))&&ret[1]){value=adjustCSS(elem,name,ret);type="number";}
if(value==null||value!==value){return;}
if(type==="number"&&!isCustomProp){value+=ret&&ret[3]||(jQuery.cssNumber[origName]?"":"px");}
if(!support.clearCloneStyle&&value===""&&name.indexOf("background")===0){style[name]="inherit";}
if(!hooks||!("set"in hooks)||(value=hooks.set(elem,value,extra))!==undefined){if(isCustomProp){style.setProperty(name,value);}else{style[name]=value;}}}else{if(hooks&&"get"in hooks&&(ret=hooks.get(elem,false,extra))!==undefined){return ret;}
return style[name];}},css:function(elem,name,extra,styles){var val,num,hooks,origName=camelCase(name),isCustomProp=rcustomProp.test(name);if(!isCustomProp){name=finalPropName(origName);}
hooks=jQuery.cssHooks[name]||jQuery.cssHooks[origName];if(hooks&&"get"in hooks){val=hooks.get(elem,true,extra);}
if(val===undefined){val=curCSS(elem,name,styles);}
if(val==="normal"&&name in cssNormalTransform){val=cssNormalTransform[name];}
if(extra===""||extra){num=parseFloat(val);return extra===true||isFinite(num)?num||0:val;}
return val;}});jQuery.each(["height","width"],function(_i,dimension){jQuery.cssHooks[dimension]={get:function(elem,computed,extra){if(computed){return rdisplayswap.test(jQuery.css(elem,"display"))&&(!elem.getClientRects().length||!elem.getBoundingClientRect().width)?swap(elem,cssShow,function(){return getWidthOrHeight(elem,dimension,extra);}):getWidthOrHeight(elem,dimension,extra);}},set:function(elem,value,extra){var matches,styles=getStyles(elem),scrollboxSizeBuggy=!support.scrollboxSize()&&styles.position==="absolute",boxSizingNeeded=scrollboxSizeBuggy||extra,isBorderBox=boxSizingNeeded&&jQuery.css(elem,"boxSizing",false,styles)==="border-box",subtract=extra?boxModelAdjustment(elem,dimension,extra,isBorderBox,styles):0;if(isBorderBox&&scrollboxSizeBuggy){subtract-=Math.ceil(elem["offset"+dimension[0].toUpperCase()+dimension.slice(1)]-
parseFloat(styles[dimension])-
boxModelAdjustment(elem,dimension,"border",false,styles)-
0.5);}
if(subtract&&(matches=rcssNum.exec(value))&&(matches[3]||"px")!=="px"){elem.style[dimension]=value;value=jQuery.css(elem,dimension);}
return setPositiveNumber(elem,value,subtract);}};});jQuery.cssHooks.marginLeft=addGetHookIf(support.reliableMarginLeft,function(elem,computed){if(computed){return(parseFloat(curCSS(elem,"marginLeft"))||elem.getBoundingClientRect().left-
swap(elem,{marginLeft:0},function(){return elem.getBoundingClientRect().left;}))+"px";}});jQuery.each({margin:"",padding:"",border:"Width"},function(prefix,suffix){jQuery.cssHooks[prefix+suffix]={expand:function(value){var i=0,expanded={},parts=typeof value==="string"?value.split(" "):[value];for(;i<4;i++){expanded[prefix+cssExpand[i]+suffix]=parts[i]||parts[i-2]||parts[0];}
return expanded;}};if(prefix!=="margin"){jQuery.cssHooks[prefix+suffix].set=setPositiveNumber;}});jQuery.fn.extend({css:function(name,value){return access(this,function(elem,name,value){var styles,len,map={},i=0;if(Array.isArray(name)){styles=getStyles(elem);len=name.length;for(;i<len;i++){map[name[i]]=jQuery.css(elem,name[i],false,styles);}
return map;}
return value!==undefined?jQuery.style(elem,name,value):jQuery.css(elem,name);},name,value,arguments.length>1);}});function Tween(elem,options,prop,end,easing){return new Tween.prototype.init(elem,options,prop,end,easing);}
jQuery.Tween=Tween;Tween.prototype={constructor:Tween,init:function(elem,options,prop,end,easing,unit){this.elem=elem;this.prop=prop;this.easing=easing||jQuery.easing._default;this.options=options;this.start=this.now=this.cur();this.end=end;this.unit=unit||(jQuery.cssNumber[prop]?"":"px");},cur:function(){var hooks=Tween.propHooks[this.prop];return hooks&&hooks.get?hooks.get(this):Tween.propHooks._default.get(this);},run:function(percent){var eased,hooks=Tween.propHooks[this.prop];if(this.options.duration){this.pos=eased=jQuery.easing[this.easing](percent,this.options.duration*percent,0,1,this.options.duration);}else{this.pos=eased=percent;}
this.now=(this.end-this.start)*eased+this.start;if(this.options.step){this.options.step.call(this.elem,this.now,this);}
if(hooks&&hooks.set){hooks.set(this);}else{Tween.propHooks._default.set(this);}
return this;}};Tween.prototype.init.prototype=Tween.prototype;Tween.propHooks={_default:{get:function(tween){var result;if(tween.elem.nodeType!==1||tween.elem[tween.prop]!=null&&tween.elem.style[tween.prop]==null){return tween.elem[tween.prop];}
result=jQuery.css(tween.elem,tween.prop,"");return!result||result==="auto"?0:result;},set:function(tween){if(jQuery.fx.step[tween.prop]){jQuery.fx.step[tween.prop](tween);}else if(tween.elem.nodeType===1&&(jQuery.cssHooks[tween.prop]||tween.elem.style[finalPropName(tween.prop)]!=null)){jQuery.style(tween.elem,tween.prop,tween.now+tween.unit);}else{tween.elem[tween.prop]=tween.now;}}}};Tween.propHooks.scrollTop=Tween.propHooks.scrollLeft={set:function(tween){if(tween.elem.nodeType&&tween.elem.parentNode){tween.elem[tween.prop]=tween.now;}}};jQuery.easing={linear:function(p){return p;},swing:function(p){return 0.5-Math.cos(p*Math.PI)/2;},_default:"swing"};jQuery.fx=Tween.prototype.init;jQuery.fx.step={};var
fxNow,inProgress,rfxtypes=/^(?:toggle|show|hide)$/,rrun=/queueHooks$/;function schedule(){if(inProgress){if(document.hidden===false&&window.requestAnimationFrame){window.requestAnimationFrame(schedule);}else{window.setTimeout(schedule,jQuery.fx.interval);}
jQuery.fx.tick();}}
function createFxNow(){window.setTimeout(function(){fxNow=undefined;});return(fxNow=Date.now());}
function genFx(type,includeWidth){var which,i=0,attrs={height:type};includeWidth=includeWidth?1:0;for(;i<4;i+=2-includeWidth){which=cssExpand[i];attrs["margin"+which]=attrs["padding"+which]=type;}
if(includeWidth){attrs.opacity=attrs.width=type;}
return attrs;}
function createTween(value,prop,animation){var tween,collection=(Animation.tweeners[prop]||[]).concat(Animation.tweeners["*"]),index=0,length=collection.length;for(;index<length;index++){if((tween=collection[index].call(animation,prop,value))){return tween;}}}
function defaultPrefilter(elem,props,opts){var prop,value,toggle,hooks,oldfire,propTween,restoreDisplay,display,isBox="width"in props||"height"in props,anim=this,orig={},style=elem.style,hidden=elem.nodeType&&isHiddenWithinTree(elem),dataShow=dataPriv.get(elem,"fxshow");if(!opts.queue){hooks=jQuery._queueHooks(elem,"fx");if(hooks.unqueued==null){hooks.unqueued=0;oldfire=hooks.empty.fire;hooks.empty.fire=function(){if(!hooks.unqueued){oldfire();}};}
hooks.unqueued++;anim.always(function(){anim.always(function(){hooks.unqueued--;if(!jQuery.queue(elem,"fx").length){hooks.empty.fire();}});});}
for(prop in props){value=props[prop];if(rfxtypes.test(value)){delete props[prop];toggle=toggle||value==="toggle";if(value===(hidden?"hide":"show")){if(value==="show"&&dataShow&&dataShow[prop]!==undefined){hidden=true;}else{continue;}}
orig[prop]=dataShow&&dataShow[prop]||jQuery.style(elem,prop);}}
propTween=!jQuery.isEmptyObject(props);if(!propTween&&jQuery.isEmptyObject(orig)){return;}
if(isBox&&elem.nodeType===1){opts.overflow=[style.overflow,style.overflowX,style.overflowY];restoreDisplay=dataShow&&dataShow.display;if(restoreDisplay==null){restoreDisplay=dataPriv.get(elem,"display");}
display=jQuery.css(elem,"display");if(display==="none"){if(restoreDisplay){display=restoreDisplay;}else{showHide([elem],true);restoreDisplay=elem.style.display||restoreDisplay;display=jQuery.css(elem,"display");showHide([elem]);}}
if(display==="inline"||display==="inline-block"&&restoreDisplay!=null){if(jQuery.css(elem,"float")==="none"){if(!propTween){anim.done(function(){style.display=restoreDisplay;});if(restoreDisplay==null){display=style.display;restoreDisplay=display==="none"?"":display;}}
style.display="inline-block";}}}
if(opts.overflow){style.overflow="hidden";anim.always(function(){style.overflow=opts.overflow[0];style.overflowX=opts.overflow[1];style.overflowY=opts.overflow[2];});}
propTween=false;for(prop in orig){if(!propTween){if(dataShow){if("hidden"in dataShow){hidden=dataShow.hidden;}}else{dataShow=dataPriv.access(elem,"fxshow",{display:restoreDisplay});}
if(toggle){dataShow.hidden=!hidden;}
if(hidden){showHide([elem],true);}
anim.done(function(){if(!hidden){showHide([elem]);}
dataPriv.remove(elem,"fxshow");for(prop in orig){jQuery.style(elem,prop,orig[prop]);}});}
propTween=createTween(hidden?dataShow[prop]:0,prop,anim);if(!(prop in dataShow)){dataShow[prop]=propTween.start;if(hidden){propTween.end=propTween.start;propTween.start=0;}}}}
function propFilter(props,specialEasing){var index,name,easing,value,hooks;for(index in props){name=camelCase(index);easing=specialEasing[name];value=props[index];if(Array.isArray(value)){easing=value[1];value=props[index]=value[0];}
if(index!==name){props[name]=value;delete props[index];}
hooks=jQuery.cssHooks[name];if(hooks&&"expand"in hooks){value=hooks.expand(value);delete props[name];for(index in value){if(!(index in props)){props[index]=value[index];specialEasing[index]=easing;}}}else{specialEasing[name]=easing;}}}
function Animation(elem,properties,options){var result,stopped,index=0,length=Animation.prefilters.length,deferred=jQuery.Deferred().always(function(){delete tick.elem;}),tick=function(){if(stopped){return false;}
var currentTime=fxNow||createFxNow(),remaining=Math.max(0,animation.startTime+animation.duration-currentTime),temp=remaining/animation.duration||0,percent=1-temp,index=0,length=animation.tweens.length;for(;index<length;index++){animation.tweens[index].run(percent);}
deferred.notifyWith(elem,[animation,percent,remaining]);if(percent<1&&length){return remaining;}
if(!length){deferred.notifyWith(elem,[animation,1,0]);}
deferred.resolveWith(elem,[animation]);return false;},animation=deferred.promise({elem:elem,props:jQuery.extend({},properties),opts:jQuery.extend(true,{specialEasing:{},easing:jQuery.easing._default},options),originalProperties:properties,originalOptions:options,startTime:fxNow||createFxNow(),duration:options.duration,tweens:[],createTween:function(prop,end){var tween=jQuery.Tween(elem,animation.opts,prop,end,animation.opts.specialEasing[prop]||animation.opts.easing);animation.tweens.push(tween);return tween;},stop:function(gotoEnd){var index=0,length=gotoEnd?animation.tweens.length:0;if(stopped){return this;}
stopped=true;for(;index<length;index++){animation.tweens[index].run(1);}
if(gotoEnd){deferred.notifyWith(elem,[animation,1,0]);deferred.resolveWith(elem,[animation,gotoEnd]);}else{deferred.rejectWith(elem,[animation,gotoEnd]);}
return this;}}),props=animation.props;propFilter(props,animation.opts.specialEasing);for(;index<length;index++){result=Animation.prefilters[index].call(animation,elem,props,animation.opts);if(result){if(isFunction(result.stop)){jQuery._queueHooks(animation.elem,animation.opts.queue).stop=result.stop.bind(result);}
return result;}}
jQuery.map(props,createTween,animation);if(isFunction(animation.opts.start)){animation.opts.start.call(elem,animation);}
animation.progress(animation.opts.progress).done(animation.opts.done,animation.opts.complete).fail(animation.opts.fail).always(animation.opts.always);jQuery.fx.timer(jQuery.extend(tick,{elem:elem,anim:animation,queue:animation.opts.queue}));return animation;}
jQuery.Animation=jQuery.extend(Animation,{tweeners:{"*":[function(prop,value){var tween=this.createTween(prop,value);adjustCSS(tween.elem,prop,rcssNum.exec(value),tween);return tween;}]},tweener:function(props,callback){if(isFunction(props)){callback=props;props=["*"];}else{props=props.match(rnothtmlwhite);}
var prop,index=0,length=props.length;for(;index<length;index++){prop=props[index];Animation.tweeners[prop]=Animation.tweeners[prop]||[];Animation.tweeners[prop].unshift(callback);}},prefilters:[defaultPrefilter],prefilter:function(callback,prepend){if(prepend){Animation.prefilters.unshift(callback);}else{Animation.prefilters.push(callback);}}});jQuery.speed=function(speed,easing,fn){var opt=speed&&typeof speed==="object"?jQuery.extend({},speed):{complete:fn||!fn&&easing||isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&!isFunction(easing)&&easing};if(jQuery.fx.off){opt.duration=0;}else{if(typeof opt.duration!=="number"){if(opt.duration in jQuery.fx.speeds){opt.duration=jQuery.fx.speeds[opt.duration];}else{opt.duration=jQuery.fx.speeds._default;}}}
if(opt.queue==null||opt.queue===true){opt.queue="fx";}
opt.old=opt.complete;opt.complete=function(){if(isFunction(opt.old)){opt.old.call(this);}
if(opt.queue){jQuery.dequeue(this,opt.queue);}};return opt;};jQuery.fn.extend({fadeTo:function(speed,to,easing,callback){return this.filter(isHiddenWithinTree).css("opacity",0).show().end().animate({opacity:to},speed,easing,callback);},animate:function(prop,speed,easing,callback){var empty=jQuery.isEmptyObject(prop),optall=jQuery.speed(speed,easing,callback),doAnimation=function(){var anim=Animation(this,jQuery.extend({},prop),optall);if(empty||dataPriv.get(this,"finish")){anim.stop(true);}};doAnimation.finish=doAnimation;return empty||optall.queue===false?this.each(doAnimation):this.queue(optall.queue,doAnimation);},stop:function(type,clearQueue,gotoEnd){var stopQueue=function(hooks){var stop=hooks.stop;delete hooks.stop;stop(gotoEnd);};if(typeof type!=="string"){gotoEnd=clearQueue;clearQueue=type;type=undefined;}
if(clearQueue){this.queue(type||"fx",[]);}
return this.each(function(){var dequeue=true,index=type!=null&&type+"queueHooks",timers=jQuery.timers,data=dataPriv.get(this);if(index){if(data[index]&&data[index].stop){stopQueue(data[index]);}}else{for(index in data){if(data[index]&&data[index].stop&&rrun.test(index)){stopQueue(data[index]);}}}
for(index=timers.length;index--;){if(timers[index].elem===this&&(type==null||timers[index].queue===type)){timers[index].anim.stop(gotoEnd);dequeue=false;timers.splice(index,1);}}
if(dequeue||!gotoEnd){jQuery.dequeue(this,type);}});},finish:function(type){if(type!==false){type=type||"fx";}
return this.each(function(){var index,data=dataPriv.get(this),queue=data[type+"queue"],hooks=data[type+"queueHooks"],timers=jQuery.timers,length=queue?queue.length:0;data.finish=true;jQuery.queue(this,type,[]);if(hooks&&hooks.stop){hooks.stop.call(this,true);}
for(index=timers.length;index--;){if(timers[index].elem===this&&timers[index].queue===type){timers[index].anim.stop(true);timers.splice(index,1);}}
for(index=0;index<length;index++){if(queue[index]&&queue[index].finish){queue[index].finish.call(this);}}
delete data.finish;});}});jQuery.each(["toggle","show","hide"],function(_i,name){var cssFn=jQuery.fn[name];jQuery.fn[name]=function(speed,easing,callback){return speed==null||typeof speed==="boolean"?cssFn.apply(this,arguments):this.animate(genFx(name,true),speed,easing,callback);};});jQuery.each({slideDown:genFx("show"),slideUp:genFx("hide"),slideToggle:genFx("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(name,props){jQuery.fn[name]=function(speed,easing,callback){return this.animate(props,speed,easing,callback);};});jQuery.timers=[];jQuery.fx.tick=function(){var timer,i=0,timers=jQuery.timers;fxNow=Date.now();for(;i<timers.length;i++){timer=timers[i];if(!timer()&&timers[i]===timer){timers.splice(i--,1);}}
if(!timers.length){jQuery.fx.stop();}
fxNow=undefined;};jQuery.fx.timer=function(timer){jQuery.timers.push(timer);jQuery.fx.start();};jQuery.fx.interval=13;jQuery.fx.start=function(){if(inProgress){return;}
inProgress=true;schedule();};jQuery.fx.stop=function(){inProgress=null;};jQuery.fx.speeds={slow:600,fast:200,_default:400};jQuery.fn.delay=function(time,type){time=jQuery.fx?jQuery.fx.speeds[time]||time:time;type=type||"fx";return this.queue(type,function(next,hooks){var timeout=window.setTimeout(next,time);hooks.stop=function(){window.clearTimeout(timeout);};});};(function(){var input=document.createElement("input"),select=document.createElement("select"),opt=select.appendChild(document.createElement("option"));input.type="checkbox";support.checkOn=input.value!=="";support.optSelected=opt.selected;input=document.createElement("input");input.value="t";input.type="radio";support.radioValue=input.value==="t";})();var boolHook,attrHandle=jQuery.expr.attrHandle;jQuery.fn.extend({attr:function(name,value){return access(this,jQuery.attr,name,value,arguments.length>1);},removeAttr:function(name){return this.each(function(){jQuery.removeAttr(this,name);});}});jQuery.extend({attr:function(elem,name,value){var ret,hooks,nType=elem.nodeType;if(nType===3||nType===8||nType===2){return;}
if(typeof elem.getAttribute==="undefined"){return jQuery.prop(elem,name,value);}
if(nType!==1||!jQuery.isXMLDoc(elem)){hooks=jQuery.attrHooks[name.toLowerCase()]||(jQuery.expr.match.bool.test(name)?boolHook:undefined);}
if(value!==undefined){if(value===null){jQuery.removeAttr(elem,name);return;}
if(hooks&&"set"in hooks&&(ret=hooks.set(elem,value,name))!==undefined){return ret;}
elem.setAttribute(name,value+"");return value;}
if(hooks&&"get"in hooks&&(ret=hooks.get(elem,name))!==null){return ret;}
ret=jQuery.find.attr(elem,name);return ret==null?undefined:ret;},attrHooks:{type:{set:function(elem,value){if(!support.radioValue&&value==="radio"&&nodeName(elem,"input")){var val=elem.value;elem.setAttribute("type",value);if(val){elem.value=val;}
return value;}}}},removeAttr:function(elem,value){var name,i=0,attrNames=value&&value.match(rnothtmlwhite);if(attrNames&&elem.nodeType===1){while((name=attrNames[i++])){elem.removeAttribute(name);}}}});boolHook={set:function(elem,value,name){if(value===false){jQuery.removeAttr(elem,name);}else{elem.setAttribute(name,name);}
return name;}};jQuery.each(jQuery.expr.match.bool.source.match(/\w+/g),function(_i,name){var getter=attrHandle[name]||jQuery.find.attr;attrHandle[name]=function(elem,name,isXML){var ret,handle,lowercaseName=name.toLowerCase();if(!isXML){handle=attrHandle[lowercaseName];attrHandle[lowercaseName]=ret;ret=getter(elem,name,isXML)!=null?lowercaseName:null;attrHandle[lowercaseName]=handle;}
return ret;};});var rfocusable=/^(?:input|select|textarea|button)$/i,rclickable=/^(?:a|area)$/i;jQuery.fn.extend({prop:function(name,value){return access(this,jQuery.prop,name,value,arguments.length>1);},removeProp:function(name){return this.each(function(){delete this[jQuery.propFix[name]||name];});}});jQuery.extend({prop:function(elem,name,value){var ret,hooks,nType=elem.nodeType;if(nType===3||nType===8||nType===2){return;}
if(nType!==1||!jQuery.isXMLDoc(elem)){name=jQuery.propFix[name]||name;hooks=jQuery.propHooks[name];}
if(value!==undefined){if(hooks&&"set"in hooks&&(ret=hooks.set(elem,value,name))!==undefined){return ret;}
return(elem[name]=value);}
if(hooks&&"get"in hooks&&(ret=hooks.get(elem,name))!==null){return ret;}
return elem[name];},propHooks:{tabIndex:{get:function(elem){var tabindex=jQuery.find.attr(elem,"tabindex");if(tabindex){return parseInt(tabindex,10);}
if(rfocusable.test(elem.nodeName)||rclickable.test(elem.nodeName)&&elem.href){return 0;}
return-1;}}},propFix:{"for":"htmlFor","class":"className"}});if(!support.optSelected){jQuery.propHooks.selected={get:function(elem){var parent=elem.parentNode;if(parent&&parent.parentNode){parent.parentNode.selectedIndex;}
return null;},set:function(elem){var parent=elem.parentNode;if(parent){parent.selectedIndex;if(parent.parentNode){parent.parentNode.selectedIndex;}}}};}
jQuery.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){jQuery.propFix[this.toLowerCase()]=this;});function stripAndCollapse(value){var tokens=value.match(rnothtmlwhite)||[];return tokens.join(" ");}
function getClass(elem){return elem.getAttribute&&elem.getAttribute("class")||"";}
function classesToArray(value){if(Array.isArray(value)){return value;}
if(typeof value==="string"){return value.match(rnothtmlwhite)||[];}
return[];}
jQuery.fn.extend({addClass:function(value){var classNames,cur,curValue,className,i,finalValue;if(isFunction(value)){return this.each(function(j){jQuery(this).addClass(value.call(this,j,getClass(this)));});}
classNames=classesToArray(value);if(classNames.length){return this.each(function(){curValue=getClass(this);cur=this.nodeType===1&&(" "+stripAndCollapse(curValue)+" ");if(cur){for(i=0;i<classNames.length;i++){className=classNames[i];if(cur.indexOf(" "+className+" ")<0){cur+=className+" ";}}
finalValue=stripAndCollapse(cur);if(curValue!==finalValue){this.setAttribute("class",finalValue);}}});}
return this;},removeClass:function(value){var classNames,cur,curValue,className,i,finalValue;if(isFunction(value)){return this.each(function(j){jQuery(this).removeClass(value.call(this,j,getClass(this)));});}
if(!arguments.length){return this.attr("class","");}
classNames=classesToArray(value);if(classNames.length){return this.each(function(){curValue=getClass(this);cur=this.nodeType===1&&(" "+stripAndCollapse(curValue)+" ");if(cur){for(i=0;i<classNames.length;i++){className=classNames[i];while(cur.indexOf(" "+className+" ")>-1){cur=cur.replace(" "+className+" "," ");}}
finalValue=stripAndCollapse(cur);if(curValue!==finalValue){this.setAttribute("class",finalValue);}}});}
return this;},toggleClass:function(value,stateVal){var classNames,className,i,self,type=typeof value,isValidValue=type==="string"||Array.isArray(value);if(isFunction(value)){return this.each(function(i){jQuery(this).toggleClass(value.call(this,i,getClass(this),stateVal),stateVal);});}
if(typeof stateVal==="boolean"&&isValidValue){return stateVal?this.addClass(value):this.removeClass(value);}
classNames=classesToArray(value);return this.each(function(){if(isValidValue){self=jQuery(this);for(i=0;i<classNames.length;i++){className=classNames[i];if(self.hasClass(className)){self.removeClass(className);}else{self.addClass(className);}}}else if(value===undefined||type==="boolean"){className=getClass(this);if(className){dataPriv.set(this,"__className__",className);}
if(this.setAttribute){this.setAttribute("class",className||value===false?"":dataPriv.get(this,"__className__")||"");}}});},hasClass:function(selector){var className,elem,i=0;className=" "+selector+" ";while((elem=this[i++])){if(elem.nodeType===1&&(" "+stripAndCollapse(getClass(elem))+" ").indexOf(className)>-1){return true;}}
return false;}});var rreturn=/\r/g;jQuery.fn.extend({val:function(value){var hooks,ret,valueIsFunction,elem=this[0];if(!arguments.length){if(elem){hooks=jQuery.valHooks[elem.type]||jQuery.valHooks[elem.nodeName.toLowerCase()];if(hooks&&"get"in hooks&&(ret=hooks.get(elem,"value"))!==undefined){return ret;}
ret=elem.value;if(typeof ret==="string"){return ret.replace(rreturn,"");}
return ret==null?"":ret;}
return;}
valueIsFunction=isFunction(value);return this.each(function(i){var val;if(this.nodeType!==1){return;}
if(valueIsFunction){val=value.call(this,i,jQuery(this).val());}else{val=value;}
if(val==null){val="";}else if(typeof val==="number"){val+="";}else if(Array.isArray(val)){val=jQuery.map(val,function(value){return value==null?"":value+"";});}
hooks=jQuery.valHooks[this.type]||jQuery.valHooks[this.nodeName.toLowerCase()];if(!hooks||!("set"in hooks)||hooks.set(this,val,"value")===undefined){this.value=val;}});}});jQuery.extend({valHooks:{option:{get:function(elem){var val=jQuery.find.attr(elem,"value");return val!=null?val:stripAndCollapse(jQuery.text(elem));}},select:{get:function(elem){var value,option,i,options=elem.options,index=elem.selectedIndex,one=elem.type==="select-one",values=one?null:[],max=one?index+1:options.length;if(index<0){i=max;}else{i=one?index:0;}
for(;i<max;i++){option=options[i];if((option.selected||i===index)&&!option.disabled&&(!option.parentNode.disabled||!nodeName(option.parentNode,"optgroup"))){value=jQuery(option).val();if(one){return value;}
values.push(value);}}
return values;},set:function(elem,value){var optionSet,option,options=elem.options,values=jQuery.makeArray(value),i=options.length;while(i--){option=options[i];if(option.selected=jQuery.inArray(jQuery.valHooks.option.get(option),values)>-1){optionSet=true;}}
if(!optionSet){elem.selectedIndex=-1;}
return values;}}}});jQuery.each(["radio","checkbox"],function(){jQuery.valHooks[this]={set:function(elem,value){if(Array.isArray(value)){return(elem.checked=jQuery.inArray(jQuery(elem).val(),value)>-1);}}};if(!support.checkOn){jQuery.valHooks[this].get=function(elem){return elem.getAttribute("value")===null?"on":elem.value;};}});support.focusin="onfocusin"in window;var rfocusMorph=/^(?:focusinfocus|focusoutblur)$/,stopPropagationCallback=function(e){e.stopPropagation();};jQuery.extend(jQuery.event,{trigger:function(event,data,elem,onlyHandlers){var i,cur,tmp,bubbleType,ontype,handle,special,lastElement,eventPath=[elem||document],type=hasOwn.call(event,"type")?event.type:event,namespaces=hasOwn.call(event,"namespace")?event.namespace.split("."):[];cur=lastElement=tmp=elem=elem||document;if(elem.nodeType===3||elem.nodeType===8){return;}
if(rfocusMorph.test(type+jQuery.event.triggered)){return;}
if(type.indexOf(".")>-1){namespaces=type.split(".");type=namespaces.shift();namespaces.sort();}
ontype=type.indexOf(":")<0&&"on"+type;event=event[jQuery.expando]?event:new jQuery.Event(type,typeof event==="object"&&event);event.isTrigger=onlyHandlers?2:3;event.namespace=namespaces.join(".");event.rnamespace=event.namespace?new RegExp("(^|\\.)"+namespaces.join("\\.(?:.*\\.|)")+"(\\.|$)"):null;event.result=undefined;if(!event.target){event.target=elem;}
data=data==null?[event]:jQuery.makeArray(data,[event]);special=jQuery.event.special[type]||{};if(!onlyHandlers&&special.trigger&&special.trigger.apply(elem,data)===false){return;}
if(!onlyHandlers&&!special.noBubble&&!isWindow(elem)){bubbleType=special.delegateType||type;if(!rfocusMorph.test(bubbleType+type)){cur=cur.parentNode;}
for(;cur;cur=cur.parentNode){eventPath.push(cur);tmp=cur;}
if(tmp===(elem.ownerDocument||document)){eventPath.push(tmp.defaultView||tmp.parentWindow||window);}}
i=0;while((cur=eventPath[i++])&&!event.isPropagationStopped()){lastElement=cur;event.type=i>1?bubbleType:special.bindType||type;handle=(dataPriv.get(cur,"events")||Object.create(null))[event.type]&&dataPriv.get(cur,"handle");if(handle){handle.apply(cur,data);}
handle=ontype&&cur[ontype];if(handle&&handle.apply&&acceptData(cur)){event.result=handle.apply(cur,data);if(event.result===false){event.preventDefault();}}}
event.type=type;if(!onlyHandlers&&!event.isDefaultPrevented()){if((!special._default||special._default.apply(eventPath.pop(),data)===false)&&acceptData(elem)){if(ontype&&isFunction(elem[type])&&!isWindow(elem)){tmp=elem[ontype];if(tmp){elem[ontype]=null;}
jQuery.event.triggered=type;if(event.isPropagationStopped()){lastElement.addEventListener(type,stopPropagationCallback);}
elem[type]();if(event.isPropagationStopped()){lastElement.removeEventListener(type,stopPropagationCallback);}
jQuery.event.triggered=undefined;if(tmp){elem[ontype]=tmp;}}}}
return event.result;},simulate:function(type,elem,event){var e=jQuery.extend(new jQuery.Event(),event,{type:type,isSimulated:true});jQuery.event.trigger(e,null,elem);}});jQuery.fn.extend({trigger:function(type,data){return this.each(function(){jQuery.event.trigger(type,data,this);});},triggerHandler:function(type,data){var elem=this[0];if(elem){return jQuery.event.trigger(type,data,elem,true);}}});if(!support.focusin){jQuery.each({focus:"focusin",blur:"focusout"},function(orig,fix){var handler=function(event){jQuery.event.simulate(fix,event.target,jQuery.event.fix(event));};jQuery.event.special[fix]={setup:function(){var doc=this.ownerDocument||this.document||this,attaches=dataPriv.access(doc,fix);if(!attaches){doc.addEventListener(orig,handler,true);}
dataPriv.access(doc,fix,(attaches||0)+1);},teardown:function(){var doc=this.ownerDocument||this.document||this,attaches=dataPriv.access(doc,fix)-1;if(!attaches){doc.removeEventListener(orig,handler,true);dataPriv.remove(doc,fix);}else{dataPriv.access(doc,fix,attaches);}}};});}
var location=window.location;var nonce={guid:Date.now()};var rquery=(/\?/);jQuery.parseXML=function(data){var xml,parserErrorElem;if(!data||typeof data!=="string"){return null;}
try{xml=(new window.DOMParser()).parseFromString(data,"text/xml");}catch(e){}
parserErrorElem=xml&&xml.getElementsByTagName("parsererror")[0];if(!xml||parserErrorElem){jQuery.error("Invalid XML: "+(parserErrorElem?jQuery.map(parserErrorElem.childNodes,function(el){return el.textContent;}).join("\n"):data));}
return xml;};var
rbracket=/\[\]$/,rCRLF=/\r?\n/g,rsubmitterTypes=/^(?:submit|button|image|reset|file)$/i,rsubmittable=/^(?:input|select|textarea|keygen)/i;function buildParams(prefix,obj,traditional,add){var name;if(Array.isArray(obj)){jQuery.each(obj,function(i,v){if(traditional||rbracket.test(prefix)){add(prefix,v);}else{buildParams(prefix+"["+(typeof v==="object"&&v!=null?i:"")+"]",v,traditional,add);}});}else if(!traditional&&toType(obj)==="object"){for(name in obj){buildParams(prefix+"["+name+"]",obj[name],traditional,add);}}else{add(prefix,obj);}}
jQuery.param=function(a,traditional){var prefix,s=[],add=function(key,valueOrFunction){var value=isFunction(valueOrFunction)?valueOrFunction():valueOrFunction;s[s.length]=encodeURIComponent(key)+"="+
encodeURIComponent(value==null?"":value);};if(a==null){return"";}
if(Array.isArray(a)||(a.jquery&&!jQuery.isPlainObject(a))){jQuery.each(a,function(){add(this.name,this.value);});}else{for(prefix in a){buildParams(prefix,a[prefix],traditional,add);}}
return s.join("&");};jQuery.fn.extend({serialize:function(){return jQuery.param(this.serializeArray());},serializeArray:function(){return this.map(function(){var elements=jQuery.prop(this,"elements");return elements?jQuery.makeArray(elements):this;}).filter(function(){var type=this.type;return this.name&&!jQuery(this).is(":disabled")&&rsubmittable.test(this.nodeName)&&!rsubmitterTypes.test(type)&&(this.checked||!rcheckableType.test(type));}).map(function(_i,elem){var val=jQuery(this).val();if(val==null){return null;}
if(Array.isArray(val)){return jQuery.map(val,function(val){return{name:elem.name,value:val.replace(rCRLF,"\r\n")};});}
return{name:elem.name,value:val.replace(rCRLF,"\r\n")};}).get();}});var
r20=/%20/g,rhash=/#.*$/,rantiCache=/([?&])_=[^&]*/,rheaders=/^(.*?):[ \t]*([^\r\n]*)$/mg,rlocalProtocol=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,rnoContent=/^(?:GET|HEAD)$/,rprotocol=/^\/\//,prefilters={},transports={},allTypes="*/".concat("*"),originAnchor=document.createElement("a");originAnchor.href=location.href;function addToPrefiltersOrTransports(structure){return function(dataTypeExpression,func){if(typeof dataTypeExpression!=="string"){func=dataTypeExpression;dataTypeExpression="*";}
var dataType,i=0,dataTypes=dataTypeExpression.toLowerCase().match(rnothtmlwhite)||[];if(isFunction(func)){while((dataType=dataTypes[i++])){if(dataType[0]==="+"){dataType=dataType.slice(1)||"*";(structure[dataType]=structure[dataType]||[]).unshift(func);}else{(structure[dataType]=structure[dataType]||[]).push(func);}}}};}
function inspectPrefiltersOrTransports(structure,options,originalOptions,jqXHR){var inspected={},seekingTransport=(structure===transports);function inspect(dataType){var selected;inspected[dataType]=true;jQuery.each(structure[dataType]||[],function(_,prefilterOrFactory){var dataTypeOrTransport=prefilterOrFactory(options,originalOptions,jqXHR);if(typeof dataTypeOrTransport==="string"&&!seekingTransport&&!inspected[dataTypeOrTransport]){options.dataTypes.unshift(dataTypeOrTransport);inspect(dataTypeOrTransport);return false;}else if(seekingTransport){return!(selected=dataTypeOrTransport);}});return selected;}
return inspect(options.dataTypes[0])||!inspected["*"]&&inspect("*");}
function ajaxExtend(target,src){var key,deep,flatOptions=jQuery.ajaxSettings.flatOptions||{};for(key in src){if(src[key]!==undefined){(flatOptions[key]?target:(deep||(deep={})))[key]=src[key];}}
if(deep){jQuery.extend(true,target,deep);}
return target;}
function ajaxHandleResponses(s,jqXHR,responses){var ct,type,finalDataType,firstDataType,contents=s.contents,dataTypes=s.dataTypes;while(dataTypes[0]==="*"){dataTypes.shift();if(ct===undefined){ct=s.mimeType||jqXHR.getResponseHeader("Content-Type");}}
if(ct){for(type in contents){if(contents[type]&&contents[type].test(ct)){dataTypes.unshift(type);break;}}}
if(dataTypes[0]in responses){finalDataType=dataTypes[0];}else{for(type in responses){if(!dataTypes[0]||s.converters[type+" "+dataTypes[0]]){finalDataType=type;break;}
if(!firstDataType){firstDataType=type;}}
finalDataType=finalDataType||firstDataType;}
if(finalDataType){if(finalDataType!==dataTypes[0]){dataTypes.unshift(finalDataType);}
return responses[finalDataType];}}
function ajaxConvert(s,response,jqXHR,isSuccess){var conv2,current,conv,tmp,prev,converters={},dataTypes=s.dataTypes.slice();if(dataTypes[1]){for(conv in s.converters){converters[conv.toLowerCase()]=s.converters[conv];}}
current=dataTypes.shift();while(current){if(s.responseFields[current]){jqXHR[s.responseFields[current]]=response;}
if(!prev&&isSuccess&&s.dataFilter){response=s.dataFilter(response,s.dataType);}
prev=current;current=dataTypes.shift();if(current){if(current==="*"){current=prev;}else if(prev!=="*"&&prev!==current){conv=converters[prev+" "+current]||converters["* "+current];if(!conv){for(conv2 in converters){tmp=conv2.split(" ");if(tmp[1]===current){conv=converters[prev+" "+tmp[0]]||converters["* "+tmp[0]];if(conv){if(conv===true){conv=converters[conv2];}else if(converters[conv2]!==true){current=tmp[0];dataTypes.unshift(tmp[1]);}
break;}}}}
if(conv!==true){if(conv&&s.throws){response=conv(response);}else{try{response=conv(response);}catch(e){return{state:"parsererror",error:conv?e:"No conversion from "+prev+" to "+current};}}}}}}
return{state:"success",data:response};}
jQuery.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:location.href,type:"GET",isLocal:rlocalProtocol.test(location.protocol),global:true,processData:true,async:true,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":allTypes,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":true,"text json":JSON.parse,"text xml":jQuery.parseXML},flatOptions:{url:true,context:true}},ajaxSetup:function(target,settings){return settings?ajaxExtend(ajaxExtend(target,jQuery.ajaxSettings),settings):ajaxExtend(jQuery.ajaxSettings,target);},ajaxPrefilter:addToPrefiltersOrTransports(prefilters),ajaxTransport:addToPrefiltersOrTransports(transports),ajax:function(url,options){if(typeof url==="object"){options=url;url=undefined;}
options=options||{};var transport,cacheURL,responseHeadersString,responseHeaders,timeoutTimer,urlAnchor,completed,fireGlobals,i,uncached,s=jQuery.ajaxSetup({},options),callbackContext=s.context||s,globalEventContext=s.context&&(callbackContext.nodeType||callbackContext.jquery)?jQuery(callbackContext):jQuery.event,deferred=jQuery.Deferred(),completeDeferred=jQuery.Callbacks("once memory"),statusCode=s.statusCode||{},requestHeaders={},requestHeadersNames={},strAbort="canceled",jqXHR={readyState:0,getResponseHeader:function(key){var match;if(completed){if(!responseHeaders){responseHeaders={};while((match=rheaders.exec(responseHeadersString))){responseHeaders[match[1].toLowerCase()+" "]=(responseHeaders[match[1].toLowerCase()+" "]||[]).concat(match[2]);}}
match=responseHeaders[key.toLowerCase()+" "];}
return match==null?null:match.join(", ");},getAllResponseHeaders:function(){return completed?responseHeadersString:null;},setRequestHeader:function(name,value){if(completed==null){name=requestHeadersNames[name.toLowerCase()]=requestHeadersNames[name.toLowerCase()]||name;requestHeaders[name]=value;}
return this;},overrideMimeType:function(type){if(completed==null){s.mimeType=type;}
return this;},statusCode:function(map){var code;if(map){if(completed){jqXHR.always(map[jqXHR.status]);}else{for(code in map){statusCode[code]=[statusCode[code],map[code]];}}}
return this;},abort:function(statusText){var finalText=statusText||strAbort;if(transport){transport.abort(finalText);}
done(0,finalText);return this;}};deferred.promise(jqXHR);s.url=((url||s.url||location.href)+"").replace(rprotocol,location.protocol+"//");s.type=options.method||options.type||s.method||s.type;s.dataTypes=(s.dataType||"*").toLowerCase().match(rnothtmlwhite)||[""];if(s.crossDomain==null){urlAnchor=document.createElement("a");try{urlAnchor.href=s.url;urlAnchor.href=urlAnchor.href;s.crossDomain=originAnchor.protocol+"//"+originAnchor.host!==urlAnchor.protocol+"//"+urlAnchor.host;}catch(e){s.crossDomain=true;}}
if(s.data&&s.processData&&typeof s.data!=="string"){s.data=jQuery.param(s.data,s.traditional);}
inspectPrefiltersOrTransports(prefilters,s,options,jqXHR);if(completed){return jqXHR;}
fireGlobals=jQuery.event&&s.global;if(fireGlobals&&jQuery.active++===0){jQuery.event.trigger("ajaxStart");}
s.type=s.type.toUpperCase();s.hasContent=!rnoContent.test(s.type);cacheURL=s.url.replace(rhash,"");if(!s.hasContent){uncached=s.url.slice(cacheURL.length);if(s.data&&(s.processData||typeof s.data==="string")){cacheURL+=(rquery.test(cacheURL)?"&":"?")+s.data;delete s.data;}
if(s.cache===false){cacheURL=cacheURL.replace(rantiCache,"$1");uncached=(rquery.test(cacheURL)?"&":"?")+"_="+(nonce.guid++)+
uncached;}
s.url=cacheURL+uncached;}else if(s.data&&s.processData&&(s.contentType||"").indexOf("application/x-www-form-urlencoded")===0){s.data=s.data.replace(r20,"+");}
if(s.ifModified){if(jQuery.lastModified[cacheURL]){jqXHR.setRequestHeader("If-Modified-Since",jQuery.lastModified[cacheURL]);}
if(jQuery.etag[cacheURL]){jqXHR.setRequestHeader("If-None-Match",jQuery.etag[cacheURL]);}}
if(s.data&&s.hasContent&&s.contentType!==false||options.contentType){jqXHR.setRequestHeader("Content-Type",s.contentType);}
jqXHR.setRequestHeader("Accept",s.dataTypes[0]&&s.accepts[s.dataTypes[0]]?s.accepts[s.dataTypes[0]]+
(s.dataTypes[0]!=="*"?", "+allTypes+"; q=0.01":""):s.accepts["*"]);for(i in s.headers){jqXHR.setRequestHeader(i,s.headers[i]);}
if(s.beforeSend&&(s.beforeSend.call(callbackContext,jqXHR,s)===false||completed)){return jqXHR.abort();}
strAbort="abort";completeDeferred.add(s.complete);jqXHR.done(s.success);jqXHR.fail(s.error);transport=inspectPrefiltersOrTransports(transports,s,options,jqXHR);if(!transport){done(-1,"No Transport");}else{jqXHR.readyState=1;if(fireGlobals){globalEventContext.trigger("ajaxSend",[jqXHR,s]);}
if(completed){return jqXHR;}
if(s.async&&s.timeout>0){timeoutTimer=window.setTimeout(function(){jqXHR.abort("timeout");},s.timeout);}
try{completed=false;transport.send(requestHeaders,done);}catch(e){if(completed){throw e;}
done(-1,e);}}
function done(status,nativeStatusText,responses,headers){var isSuccess,success,error,response,modified,statusText=nativeStatusText;if(completed){return;}
completed=true;if(timeoutTimer){window.clearTimeout(timeoutTimer);}
transport=undefined;responseHeadersString=headers||"";jqXHR.readyState=status>0?4:0;isSuccess=status>=200&&status<300||status===304;if(responses){response=ajaxHandleResponses(s,jqXHR,responses);}
if(!isSuccess&&jQuery.inArray("script",s.dataTypes)>-1&&jQuery.inArray("json",s.dataTypes)<0){s.converters["text script"]=function(){};}
response=ajaxConvert(s,response,jqXHR,isSuccess);if(isSuccess){if(s.ifModified){modified=jqXHR.getResponseHeader("Last-Modified");if(modified){jQuery.lastModified[cacheURL]=modified;}
modified=jqXHR.getResponseHeader("etag");if(modified){jQuery.etag[cacheURL]=modified;}}
if(status===204||s.type==="HEAD"){statusText="nocontent";}else if(status===304){statusText="notmodified";}else{statusText=response.state;success=response.data;error=response.error;isSuccess=!error;}}else{error=statusText;if(status||!statusText){statusText="error";if(status<0){status=0;}}}
jqXHR.status=status;jqXHR.statusText=(nativeStatusText||statusText)+"";if(isSuccess){deferred.resolveWith(callbackContext,[success,statusText,jqXHR]);}else{deferred.rejectWith(callbackContext,[jqXHR,statusText,error]);}
jqXHR.statusCode(statusCode);statusCode=undefined;if(fireGlobals){globalEventContext.trigger(isSuccess?"ajaxSuccess":"ajaxError",[jqXHR,s,isSuccess?success:error]);}
completeDeferred.fireWith(callbackContext,[jqXHR,statusText]);if(fireGlobals){globalEventContext.trigger("ajaxComplete",[jqXHR,s]);if(!(--jQuery.active)){jQuery.event.trigger("ajaxStop");}}}
return jqXHR;},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json");},getScript:function(url,callback){return jQuery.get(url,undefined,callback,"script");}});jQuery.each(["get","post"],function(_i,method){jQuery[method]=function(url,data,callback,type){if(isFunction(data)){type=type||callback;callback=data;data=undefined;}
return jQuery.ajax(jQuery.extend({url:url,type:method,dataType:type,data:data,success:callback},jQuery.isPlainObject(url)&&url));};});jQuery.ajaxPrefilter(function(s){var i;for(i in s.headers){if(i.toLowerCase()==="content-type"){s.contentType=s.headers[i]||"";}}});jQuery._evalUrl=function(url,options,doc){return jQuery.ajax({url:url,type:"GET",dataType:"script",cache:true,async:false,global:false,converters:{"text script":function(){}},dataFilter:function(response){jQuery.globalEval(response,options,doc);}});};jQuery.fn.extend({wrapAll:function(html){var wrap;if(this[0]){if(isFunction(html)){html=html.call(this[0]);}
wrap=jQuery(html,this[0].ownerDocument).eq(0).clone(true);if(this[0].parentNode){wrap.insertBefore(this[0]);}
wrap.map(function(){var elem=this;while(elem.firstElementChild){elem=elem.firstElementChild;}
return elem;}).append(this);}
return this;},wrapInner:function(html){if(isFunction(html)){return this.each(function(i){jQuery(this).wrapInner(html.call(this,i));});}
return this.each(function(){var self=jQuery(this),contents=self.contents();if(contents.length){contents.wrapAll(html);}else{self.append(html);}});},wrap:function(html){var htmlIsFunction=isFunction(html);return this.each(function(i){jQuery(this).wrapAll(htmlIsFunction?html.call(this,i):html);});},unwrap:function(selector){this.parent(selector).not("body").each(function(){jQuery(this).replaceWith(this.childNodes);});return this;}});jQuery.expr.pseudos.hidden=function(elem){return!jQuery.expr.pseudos.visible(elem);};jQuery.expr.pseudos.visible=function(elem){return!!(elem.offsetWidth||elem.offsetHeight||elem.getClientRects().length);};jQuery.ajaxSettings.xhr=function(){try{return new window.XMLHttpRequest();}catch(e){}};var xhrSuccessStatus={0:200,1223:204},xhrSupported=jQuery.ajaxSettings.xhr();support.cors=!!xhrSupported&&("withCredentials"in xhrSupported);support.ajax=xhrSupported=!!xhrSupported;jQuery.ajaxTransport(function(options){var callback,errorCallback;if(support.cors||xhrSupported&&!options.crossDomain){return{send:function(headers,complete){var i,xhr=options.xhr();xhr.open(options.type,options.url,options.async,options.username,options.password);if(options.xhrFields){for(i in options.xhrFields){xhr[i]=options.xhrFields[i];}}
if(options.mimeType&&xhr.overrideMimeType){xhr.overrideMimeType(options.mimeType);}
if(!options.crossDomain&&!headers["X-Requested-With"]){headers["X-Requested-With"]="XMLHttpRequest";}
for(i in headers){xhr.setRequestHeader(i,headers[i]);}
callback=function(type){return function(){if(callback){callback=errorCallback=xhr.onload=xhr.onerror=xhr.onabort=xhr.ontimeout=xhr.onreadystatechange=null;if(type==="abort"){xhr.abort();}else if(type==="error"){if(typeof xhr.status!=="number"){complete(0,"error");}else{complete(xhr.status,xhr.statusText);}}else{complete(xhrSuccessStatus[xhr.status]||xhr.status,xhr.statusText,(xhr.responseType||"text")!=="text"||typeof xhr.responseText!=="string"?{binary:xhr.response}:{text:xhr.responseText},xhr.getAllResponseHeaders());}}};};xhr.onload=callback();errorCallback=xhr.onerror=xhr.ontimeout=callback("error");if(xhr.onabort!==undefined){xhr.onabort=errorCallback;}else{xhr.onreadystatechange=function(){if(xhr.readyState===4){window.setTimeout(function(){if(callback){errorCallback();}});}};}
callback=callback("abort");try{xhr.send(options.hasContent&&options.data||null);}catch(e){if(callback){throw e;}}},abort:function(){if(callback){callback();}}};}});jQuery.ajaxPrefilter(function(s){if(s.crossDomain){s.contents.script=false;}});jQuery.ajaxSetup({accepts:{script:"text/javascript, application/javascript, "+"application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(text){jQuery.globalEval(text);return text;}}});jQuery.ajaxPrefilter("script",function(s){if(s.cache===undefined){s.cache=false;}
if(s.crossDomain){s.type="GET";}});jQuery.ajaxTransport("script",function(s){if(s.crossDomain||s.scriptAttrs){var script,callback;return{send:function(_,complete){script=jQuery("<script>").attr(s.scriptAttrs||{}).prop({charset:s.scriptCharset,src:s.url}).on("load error",callback=function(evt){script.remove();callback=null;if(evt){complete(evt.type==="error"?404:200,evt.type);}});document.head.appendChild(script[0]);},abort:function(){if(callback){callback();}}};}});var oldCallbacks=[],rjsonp=/(=)\?(?=&|$)|\?\?/;jQuery.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var callback=oldCallbacks.pop()||(jQuery.expando+"_"+(nonce.guid++));this[callback]=true;return callback;}});jQuery.ajaxPrefilter("json jsonp",function(s,originalSettings,jqXHR){var callbackName,overwritten,responseContainer,jsonProp=s.jsonp!==false&&(rjsonp.test(s.url)?"url":typeof s.data==="string"&&(s.contentType||"").indexOf("application/x-www-form-urlencoded")===0&&rjsonp.test(s.data)&&"data");if(jsonProp||s.dataTypes[0]==="jsonp"){callbackName=s.jsonpCallback=isFunction(s.jsonpCallback)?s.jsonpCallback():s.jsonpCallback;if(jsonProp){s[jsonProp]=s[jsonProp].replace(rjsonp,"$1"+callbackName);}else if(s.jsonp!==false){s.url+=(rquery.test(s.url)?"&":"?")+s.jsonp+"="+callbackName;}
s.converters["script json"]=function(){if(!responseContainer){jQuery.error(callbackName+" was not called");}
return responseContainer[0];};s.dataTypes[0]="json";overwritten=window[callbackName];window[callbackName]=function(){responseContainer=arguments;};jqXHR.always(function(){if(overwritten===undefined){jQuery(window).removeProp(callbackName);}else{window[callbackName]=overwritten;}
if(s[callbackName]){s.jsonpCallback=originalSettings.jsonpCallback;oldCallbacks.push(callbackName);}
if(responseContainer&&isFunction(overwritten)){overwritten(responseContainer[0]);}
responseContainer=overwritten=undefined;});return"script";}});support.createHTMLDocument=(function(){var body=document.implementation.createHTMLDocument("").body;body.innerHTML="<form></form><form></form>";return body.childNodes.length===2;})();jQuery.parseHTML=function(data,context,keepScripts){if(typeof data!=="string"){return[];}
if(typeof context==="boolean"){keepScripts=context;context=false;}
var base,parsed,scripts;if(!context){if(support.createHTMLDocument){context=document.implementation.createHTMLDocument("");base=context.createElement("base");base.href=document.location.href;context.head.appendChild(base);}else{context=document;}}
parsed=rsingleTag.exec(data);scripts=!keepScripts&&[];if(parsed){return[context.createElement(parsed[1])];}
parsed=buildFragment([data],context,scripts);if(scripts&&scripts.length){jQuery(scripts).remove();}
return jQuery.merge([],parsed.childNodes);};jQuery.fn.load=function(url,params,callback){var selector,type,response,self=this,off=url.indexOf(" ");if(off>-1){selector=stripAndCollapse(url.slice(off));url=url.slice(0,off);}
if(isFunction(params)){callback=params;params=undefined;}else if(params&&typeof params==="object"){type="POST";}
if(self.length>0){jQuery.ajax({url:url,type:type||"GET",dataType:"html",data:params}).done(function(responseText){response=arguments;self.html(selector?jQuery("<div>").append(jQuery.parseHTML(responseText)).find(selector):responseText);}).always(callback&&function(jqXHR,status){self.each(function(){callback.apply(this,response||[jqXHR.responseText,status,jqXHR]);});});}
return this;};jQuery.expr.pseudos.animated=function(elem){return jQuery.grep(jQuery.timers,function(fn){return elem===fn.elem;}).length;};jQuery.offset={setOffset:function(elem,options,i){var curPosition,curLeft,curCSSTop,curTop,curOffset,curCSSLeft,calculatePosition,position=jQuery.css(elem,"position"),curElem=jQuery(elem),props={};if(position==="static"){elem.style.position="relative";}
curOffset=curElem.offset();curCSSTop=jQuery.css(elem,"top");curCSSLeft=jQuery.css(elem,"left");calculatePosition=(position==="absolute"||position==="fixed")&&(curCSSTop+curCSSLeft).indexOf("auto")>-1;if(calculatePosition){curPosition=curElem.position();curTop=curPosition.top;curLeft=curPosition.left;}else{curTop=parseFloat(curCSSTop)||0;curLeft=parseFloat(curCSSLeft)||0;}
if(isFunction(options)){options=options.call(elem,i,jQuery.extend({},curOffset));}
if(options.top!=null){props.top=(options.top-curOffset.top)+curTop;}
if(options.left!=null){props.left=(options.left-curOffset.left)+curLeft;}
if("using"in options){options.using.call(elem,props);}else{curElem.css(props);}}};jQuery.fn.extend({offset:function(options){if(arguments.length){return options===undefined?this:this.each(function(i){jQuery.offset.setOffset(this,options,i);});}
var rect,win,elem=this[0];if(!elem){return;}
if(!elem.getClientRects().length){return{top:0,left:0};}
rect=elem.getBoundingClientRect();win=elem.ownerDocument.defaultView;return{top:rect.top+win.pageYOffset,left:rect.left+win.pageXOffset};},position:function(){if(!this[0]){return;}
var offsetParent,offset,doc,elem=this[0],parentOffset={top:0,left:0};if(jQuery.css(elem,"position")==="fixed"){offset=elem.getBoundingClientRect();}else{offset=this.offset();doc=elem.ownerDocument;offsetParent=elem.offsetParent||doc.documentElement;while(offsetParent&&(offsetParent===doc.body||offsetParent===doc.documentElement)&&jQuery.css(offsetParent,"position")==="static"){offsetParent=offsetParent.parentNode;}
if(offsetParent&&offsetParent!==elem&&offsetParent.nodeType===1){parentOffset=jQuery(offsetParent).offset();parentOffset.top+=jQuery.css(offsetParent,"borderTopWidth",true);parentOffset.left+=jQuery.css(offsetParent,"borderLeftWidth",true);}}
return{top:offset.top-parentOffset.top-jQuery.css(elem,"marginTop",true),left:offset.left-parentOffset.left-jQuery.css(elem,"marginLeft",true)};},offsetParent:function(){return this.map(function(){var offsetParent=this.offsetParent;while(offsetParent&&jQuery.css(offsetParent,"position")==="static"){offsetParent=offsetParent.offsetParent;}
return offsetParent||documentElement;});}});jQuery.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(method,prop){var top="pageYOffset"===prop;jQuery.fn[method]=function(val){return access(this,function(elem,method,val){var win;if(isWindow(elem)){win=elem;}else if(elem.nodeType===9){win=elem.defaultView;}
if(val===undefined){return win?win[prop]:elem[method];}
if(win){win.scrollTo(!top?val:win.pageXOffset,top?val:win.pageYOffset);}else{elem[method]=val;}},method,val,arguments.length);};});jQuery.each(["top","left"],function(_i,prop){jQuery.cssHooks[prop]=addGetHookIf(support.pixelPosition,function(elem,computed){if(computed){computed=curCSS(elem,prop);return rnumnonpx.test(computed)?jQuery(elem).position()[prop]+"px":computed;}});});jQuery.each({Height:"height",Width:"width"},function(name,type){jQuery.each({padding:"inner"+name,content:type,"":"outer"+name},function(defaultExtra,funcName){jQuery.fn[funcName]=function(margin,value){var chainable=arguments.length&&(defaultExtra||typeof margin!=="boolean"),extra=defaultExtra||(margin===true||value===true?"margin":"border");return access(this,function(elem,type,value){var doc;if(isWindow(elem)){return funcName.indexOf("outer")===0?elem["inner"+name]:elem.document.documentElement["client"+name];}
if(elem.nodeType===9){doc=elem.documentElement;return Math.max(elem.body["scroll"+name],doc["scroll"+name],elem.body["offset"+name],doc["offset"+name],doc["client"+name]);}
return value===undefined?jQuery.css(elem,type,extra):jQuery.style(elem,type,value,extra);},type,chainable?margin:undefined,chainable);};});});jQuery.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(_i,type){jQuery.fn[type]=function(fn){return this.on(type,fn);};});jQuery.fn.extend({bind:function(types,data,fn){return this.on(types,null,data,fn);},unbind:function(types,fn){return this.off(types,null,fn);},delegate:function(selector,types,data,fn){return this.on(types,selector,data,fn);},undelegate:function(selector,types,fn){return arguments.length===1?this.off(selector,"**"):this.off(types,selector||"**",fn);},hover:function(fnOver,fnOut){return this.mouseenter(fnOver).mouseleave(fnOut||fnOver);}});jQuery.each(("blur focus focusin focusout resize scroll click dblclick "+"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave "+"change select submit keydown keypress keyup contextmenu").split(" "),function(_i,name){jQuery.fn[name]=function(data,fn){return arguments.length>0?this.on(name,null,data,fn):this.trigger(name);};});var rtrim=/^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g;jQuery.proxy=function(fn,context){var tmp,args,proxy;if(typeof context==="string"){tmp=fn[context];context=fn;fn=tmp;}
if(!isFunction(fn)){return undefined;}
args=slice.call(arguments,2);proxy=function(){return fn.apply(context||this,args.concat(slice.call(arguments)));};proxy.guid=fn.guid=fn.guid||jQuery.guid++;return proxy;};jQuery.holdReady=function(hold){if(hold){jQuery.readyWait++;}else{jQuery.ready(true);}};jQuery.isArray=Array.isArray;jQuery.parseJSON=JSON.parse;jQuery.nodeName=nodeName;jQuery.isFunction=isFunction;jQuery.isWindow=isWindow;jQuery.camelCase=camelCase;jQuery.type=toType;jQuery.now=Date.now;jQuery.isNumeric=function(obj){var type=jQuery.type(obj);return(type==="number"||type==="string")&&!isNaN(obj-parseFloat(obj));};jQuery.trim=function(text){return text==null?"":(text+"").replace(rtrim,"$1");};if(typeof define==="function"&&define.amd){define("jquery",[],function(){return jQuery;});}
var
_jQuery=window.jQuery,_$=window.$;jQuery.noConflict=function(deep){if(window.$===jQuery){window.$=_$;}
if(deep&&window.jQuery===jQuery){window.jQuery=_jQuery;}
return jQuery;};if(typeof noGlobal==="undefined"){window.jQuery=window.$=jQuery;}
return jQuery;});;

/* /web/static/lib/popper/popper.js */
(function(global,factory){typeof exports==='object'&&typeof module!=='undefined'?factory(exports):typeof define==='function'&&define.amd?define(['exports'],factory):(global=typeof globalThis!=='undefined'?globalThis:global||self,factory(global.Popper={}));}(this,(function(exports){'use strict';function getWindow(node){if(node==null){return window;}
if(node.toString()!=='[object Window]'){var ownerDocument=node.ownerDocument;return ownerDocument?ownerDocument.defaultView||window:window;}
return node;}
function isElement(node){var OwnElement=getWindow(node).Element;return node instanceof OwnElement||node instanceof Element;}
function isHTMLElement(node){var OwnElement=getWindow(node).HTMLElement;return node instanceof OwnElement||node instanceof HTMLElement;}
function isShadowRoot(node){if(typeof ShadowRoot==='undefined'){return false;}
var OwnElement=getWindow(node).ShadowRoot;return node instanceof OwnElement||node instanceof ShadowRoot;}
var max=Math.max;var min=Math.min;var round=Math.round;function getUAString(){var uaData=navigator.userAgentData;if(uaData!=null&&uaData.brands&&Array.isArray(uaData.brands)){return uaData.brands.map(function(item){return item.brand+"/"+item.version;}).join(' ');}
return navigator.userAgent;}
function isLayoutViewport(){return!/^((?!chrome|android).)*safari/i.test(getUAString());}
function getBoundingClientRect(element,includeScale,isFixedStrategy){if(includeScale===void 0){includeScale=false;}
if(isFixedStrategy===void 0){isFixedStrategy=false;}
var clientRect=element.getBoundingClientRect();var scaleX=1;var scaleY=1;if(includeScale&&isHTMLElement(element)){scaleX=element.offsetWidth>0?round(clientRect.width)/element.offsetWidth||1:1;scaleY=element.offsetHeight>0?round(clientRect.height)/element.offsetHeight||1:1;}
var _ref=isElement(element)?getWindow(element):window,visualViewport=_ref.visualViewport;var addVisualOffsets=!isLayoutViewport()&&isFixedStrategy;var x=(clientRect.left+(addVisualOffsets&&visualViewport?visualViewport.offsetLeft:0))/scaleX;var y=(clientRect.top+(addVisualOffsets&&visualViewport?visualViewport.offsetTop:0))/scaleY;var width=clientRect.width/scaleX;var height=clientRect.height/scaleY;return{width:width,height:height,top:y,right:x+width,bottom:y+height,left:x,x:x,y:y};}
function getWindowScroll(node){var win=getWindow(node);var scrollLeft=win.pageXOffset;var scrollTop=win.pageYOffset;return{scrollLeft:scrollLeft,scrollTop:scrollTop};}
function getHTMLElementScroll(element){return{scrollLeft:element.scrollLeft,scrollTop:element.scrollTop};}
function getNodeScroll(node){if(node===getWindow(node)||!isHTMLElement(node)){return getWindowScroll(node);}else{return getHTMLElementScroll(node);}}
function getNodeName(element){return element?(element.nodeName||'').toLowerCase():null;}
function getDocumentElement(element){return((isElement(element)?element.ownerDocument:element.document)||window.document).documentElement;}
function getWindowScrollBarX(element){return getBoundingClientRect(getDocumentElement(element)).left+getWindowScroll(element).scrollLeft;}
function getComputedStyle(element){return getWindow(element).getComputedStyle(element);}
function isScrollParent(element){var _getComputedStyle=getComputedStyle(element),overflow=_getComputedStyle.overflow,overflowX=_getComputedStyle.overflowX,overflowY=_getComputedStyle.overflowY;return/auto|scroll|overlay|hidden/.test(overflow+overflowY+overflowX);}
function isElementScaled(element){var rect=element.getBoundingClientRect();var scaleX=round(rect.width)/element.offsetWidth||1;var scaleY=round(rect.height)/element.offsetHeight||1;return scaleX!==1||scaleY!==1;}
function getCompositeRect(elementOrVirtualElement,offsetParent,isFixed){if(isFixed===void 0){isFixed=false;}
var isOffsetParentAnElement=isHTMLElement(offsetParent);var offsetParentIsScaled=isHTMLElement(offsetParent)&&isElementScaled(offsetParent);var documentElement=getDocumentElement(offsetParent);var rect=getBoundingClientRect(elementOrVirtualElement,offsetParentIsScaled,isFixed);var scroll={scrollLeft:0,scrollTop:0};var offsets={x:0,y:0};if(isOffsetParentAnElement||!isOffsetParentAnElement&&!isFixed){if(getNodeName(offsetParent)!=='body'||isScrollParent(documentElement)){scroll=getNodeScroll(offsetParent);}
if(isHTMLElement(offsetParent)){offsets=getBoundingClientRect(offsetParent,true);offsets.x+=offsetParent.clientLeft;offsets.y+=offsetParent.clientTop;}else if(documentElement){offsets.x=getWindowScrollBarX(documentElement);}}
return{x:rect.left+scroll.scrollLeft-offsets.x,y:rect.top+scroll.scrollTop-offsets.y,width:rect.width,height:rect.height};}
function getLayoutRect(element){var clientRect=getBoundingClientRect(element);var width=element.offsetWidth;var height=element.offsetHeight;if(Math.abs(clientRect.width-width)<=1){width=clientRect.width;}
if(Math.abs(clientRect.height-height)<=1){height=clientRect.height;}
return{x:element.offsetLeft,y:element.offsetTop,width:width,height:height};}
function getParentNode(element){if(getNodeName(element)==='html'){return element;}
return(element.assignedSlot||element.parentNode||(isShadowRoot(element)?element.host:null)||getDocumentElement(element));}
function getScrollParent(node){if(['html','body','#document'].indexOf(getNodeName(node))>=0){return node.ownerDocument.body;}
if(isHTMLElement(node)&&isScrollParent(node)){return node;}
return getScrollParent(getParentNode(node));}
function listScrollParents(element,list){var _element$ownerDocumen;if(list===void 0){list=[];}
var scrollParent=getScrollParent(element);var isBody=scrollParent===((_element$ownerDocumen=element.ownerDocument)==null?void 0:_element$ownerDocumen.body);var win=getWindow(scrollParent);var target=isBody?[win].concat(win.visualViewport||[],isScrollParent(scrollParent)?scrollParent:[]):scrollParent;var updatedList=list.concat(target);return isBody?updatedList:updatedList.concat(listScrollParents(getParentNode(target)));}
function isTableElement(element){return['table','td','th'].indexOf(getNodeName(element))>=0;}
function getTrueOffsetParent(element){if(!isHTMLElement(element)||getComputedStyle(element).position==='fixed'){return null;}
return element.offsetParent;}
function getContainingBlock(element){var isFirefox=/firefox/i.test(getUAString());var isIE=/Trident/i.test(getUAString());if(isIE&&isHTMLElement(element)){var elementCss=getComputedStyle(element);if(elementCss.position==='fixed'){return null;}}
var currentNode=getParentNode(element);if(isShadowRoot(currentNode)){currentNode=currentNode.host;}
while(isHTMLElement(currentNode)&&['html','body'].indexOf(getNodeName(currentNode))<0){var css=getComputedStyle(currentNode);if(css.transform!=='none'||css.perspective!=='none'||css.contain==='paint'||['transform','perspective'].indexOf(css.willChange)!==-1||isFirefox&&css.willChange==='filter'||isFirefox&&css.filter&&css.filter!=='none'){return currentNode;}else{currentNode=currentNode.parentNode;}}
return null;}
function getOffsetParent(element){var window=getWindow(element);var offsetParent=getTrueOffsetParent(element);while(offsetParent&&isTableElement(offsetParent)&&getComputedStyle(offsetParent).position==='static'){offsetParent=getTrueOffsetParent(offsetParent);}
if(offsetParent&&(getNodeName(offsetParent)==='html'||getNodeName(offsetParent)==='body'&&getComputedStyle(offsetParent).position==='static')){return window;}
return offsetParent||getContainingBlock(element)||window;}
var top='top';var bottom='bottom';var right='right';var left='left';var auto='auto';var basePlacements=[top,bottom,right,left];var start='start';var end='end';var clippingParents='clippingParents';var viewport='viewport';var popper='popper';var reference='reference';var variationPlacements=basePlacements.reduce(function(acc,placement){return acc.concat([placement+"-"+start,placement+"-"+end]);},[]);var placements=[].concat(basePlacements,[auto]).reduce(function(acc,placement){return acc.concat([placement,placement+"-"+start,placement+"-"+end]);},[]);var beforeRead='beforeRead';var read='read';var afterRead='afterRead';var beforeMain='beforeMain';var main='main';var afterMain='afterMain';var beforeWrite='beforeWrite';var write='write';var afterWrite='afterWrite';var modifierPhases=[beforeRead,read,afterRead,beforeMain,main,afterMain,beforeWrite,write,afterWrite];function order(modifiers){var map=new Map();var visited=new Set();var result=[];modifiers.forEach(function(modifier){map.set(modifier.name,modifier);});function sort(modifier){visited.add(modifier.name);var requires=[].concat(modifier.requires||[],modifier.requiresIfExists||[]);requires.forEach(function(dep){if(!visited.has(dep)){var depModifier=map.get(dep);if(depModifier){sort(depModifier);}}});result.push(modifier);}
modifiers.forEach(function(modifier){if(!visited.has(modifier.name)){sort(modifier);}});return result;}
function orderModifiers(modifiers){var orderedModifiers=order(modifiers);return modifierPhases.reduce(function(acc,phase){return acc.concat(orderedModifiers.filter(function(modifier){return modifier.phase===phase;}));},[]);}
function debounce(fn){var pending;return function(){if(!pending){pending=new Promise(function(resolve){Promise.resolve().then(function(){pending=undefined;resolve(fn());});});}
return pending;};}
function mergeByName(modifiers){var merged=modifiers.reduce(function(merged,current){var existing=merged[current.name];merged[current.name]=existing?Object.assign({},existing,current,{options:Object.assign({},existing.options,current.options),data:Object.assign({},existing.data,current.data)}):current;return merged;},{});return Object.keys(merged).map(function(key){return merged[key];});}
function getViewportRect(element,strategy){var win=getWindow(element);var html=getDocumentElement(element);var visualViewport=win.visualViewport;var width=html.clientWidth;var height=html.clientHeight;var x=0;var y=0;if(visualViewport){width=visualViewport.width;height=visualViewport.height;var layoutViewport=isLayoutViewport();if(layoutViewport||!layoutViewport&&strategy==='fixed'){x=visualViewport.offsetLeft;y=visualViewport.offsetTop;}}
return{width:width,height:height,x:x+getWindowScrollBarX(element),y:y};}
function getDocumentRect(element){var _element$ownerDocumen;var html=getDocumentElement(element);var winScroll=getWindowScroll(element);var body=(_element$ownerDocumen=element.ownerDocument)==null?void 0:_element$ownerDocumen.body;var width=max(html.scrollWidth,html.clientWidth,body?body.scrollWidth:0,body?body.clientWidth:0);var height=max(html.scrollHeight,html.clientHeight,body?body.scrollHeight:0,body?body.clientHeight:0);var x=-winScroll.scrollLeft+getWindowScrollBarX(element);var y=-winScroll.scrollTop;if(getComputedStyle(body||html).direction==='rtl'){x+=max(html.clientWidth,body?body.clientWidth:0)-width;}
return{width:width,height:height,x:x,y:y};}
function contains(parent,child){var rootNode=child.getRootNode&&child.getRootNode();if(parent.contains(child)){return true;}
else if(rootNode&&isShadowRoot(rootNode)){var next=child;do{if(next&&parent.isSameNode(next)){return true;}
next=next.parentNode||next.host;}while(next);}
return false;}
function rectToClientRect(rect){return Object.assign({},rect,{left:rect.x,top:rect.y,right:rect.x+rect.width,bottom:rect.y+rect.height});}
function getInnerBoundingClientRect(element,strategy){var rect=getBoundingClientRect(element,false,strategy==='fixed');rect.top=rect.top+element.clientTop;rect.left=rect.left+element.clientLeft;rect.bottom=rect.top+element.clientHeight;rect.right=rect.left+element.clientWidth;rect.width=element.clientWidth;rect.height=element.clientHeight;rect.x=rect.left;rect.y=rect.top;return rect;}
function getClientRectFromMixedType(element,clippingParent,strategy){return clippingParent===viewport?rectToClientRect(getViewportRect(element,strategy)):isElement(clippingParent)?getInnerBoundingClientRect(clippingParent,strategy):rectToClientRect(getDocumentRect(getDocumentElement(element)));}
function getClippingParents(element){var clippingParents=listScrollParents(getParentNode(element));var canEscapeClipping=['absolute','fixed'].indexOf(getComputedStyle(element).position)>=0;var clipperElement=canEscapeClipping&&isHTMLElement(element)?getOffsetParent(element):element;if(!isElement(clipperElement)){return[];}
return clippingParents.filter(function(clippingParent){return isElement(clippingParent)&&contains(clippingParent,clipperElement)&&getNodeName(clippingParent)!=='body';});}
function getClippingRect(element,boundary,rootBoundary,strategy){var mainClippingParents=boundary==='clippingParents'?getClippingParents(element):[].concat(boundary);var clippingParents=[].concat(mainClippingParents,[rootBoundary]);var firstClippingParent=clippingParents[0];var clippingRect=clippingParents.reduce(function(accRect,clippingParent){var rect=getClientRectFromMixedType(element,clippingParent,strategy);accRect.top=max(rect.top,accRect.top);accRect.right=min(rect.right,accRect.right);accRect.bottom=min(rect.bottom,accRect.bottom);accRect.left=max(rect.left,accRect.left);return accRect;},getClientRectFromMixedType(element,firstClippingParent,strategy));clippingRect.width=clippingRect.right-clippingRect.left;clippingRect.height=clippingRect.bottom-clippingRect.top;clippingRect.x=clippingRect.left;clippingRect.y=clippingRect.top;return clippingRect;}
function getBasePlacement(placement){return placement.split('-')[0];}
function getVariation(placement){return placement.split('-')[1];}
function getMainAxisFromPlacement(placement){return['top','bottom'].indexOf(placement)>=0?'x':'y';}
function computeOffsets(_ref){var reference=_ref.reference,element=_ref.element,placement=_ref.placement;var basePlacement=placement?getBasePlacement(placement):null;var variation=placement?getVariation(placement):null;var commonX=reference.x+reference.width/2-element.width/2;var commonY=reference.y+reference.height/2-element.height/2;var offsets;switch(basePlacement){case top:offsets={x:commonX,y:reference.y-element.height};break;case bottom:offsets={x:commonX,y:reference.y+reference.height};break;case right:offsets={x:reference.x+reference.width,y:commonY};break;case left:offsets={x:reference.x-element.width,y:commonY};break;default:offsets={x:reference.x,y:reference.y};}
var mainAxis=basePlacement?getMainAxisFromPlacement(basePlacement):null;if(mainAxis!=null){var len=mainAxis==='y'?'height':'width';switch(variation){case start:offsets[mainAxis]=offsets[mainAxis]-(reference[len]/2-element[len]/2);break;case end:offsets[mainAxis]=offsets[mainAxis]+(reference[len]/2-element[len]/2);break;}}
return offsets;}
function getFreshSideObject(){return{top:0,right:0,bottom:0,left:0};}
function mergePaddingObject(paddingObject){return Object.assign({},getFreshSideObject(),paddingObject);}
function expandToHashMap(value,keys){return keys.reduce(function(hashMap,key){hashMap[key]=value;return hashMap;},{});}
function detectOverflow(state,options){if(options===void 0){options={};}
var _options=options,_options$placement=_options.placement,placement=_options$placement===void 0?state.placement:_options$placement,_options$strategy=_options.strategy,strategy=_options$strategy===void 0?state.strategy:_options$strategy,_options$boundary=_options.boundary,boundary=_options$boundary===void 0?clippingParents:_options$boundary,_options$rootBoundary=_options.rootBoundary,rootBoundary=_options$rootBoundary===void 0?viewport:_options$rootBoundary,_options$elementConte=_options.elementContext,elementContext=_options$elementConte===void 0?popper:_options$elementConte,_options$altBoundary=_options.altBoundary,altBoundary=_options$altBoundary===void 0?false:_options$altBoundary,_options$padding=_options.padding,padding=_options$padding===void 0?0:_options$padding;var paddingObject=mergePaddingObject(typeof padding!=='number'?padding:expandToHashMap(padding,basePlacements));var altContext=elementContext===popper?reference:popper;var popperRect=state.rects.popper;var element=state.elements[altBoundary?altContext:elementContext];var clippingClientRect=getClippingRect(isElement(element)?element:element.contextElement||getDocumentElement(state.elements.popper),boundary,rootBoundary,strategy);var referenceClientRect=getBoundingClientRect(state.elements.reference);var popperOffsets=computeOffsets({reference:referenceClientRect,element:popperRect,strategy:'absolute',placement:placement});var popperClientRect=rectToClientRect(Object.assign({},popperRect,popperOffsets));var elementClientRect=elementContext===popper?popperClientRect:referenceClientRect;var overflowOffsets={top:clippingClientRect.top-elementClientRect.top+paddingObject.top,bottom:elementClientRect.bottom-clippingClientRect.bottom+paddingObject.bottom,left:clippingClientRect.left-elementClientRect.left+paddingObject.left,right:elementClientRect.right-clippingClientRect.right+paddingObject.right};var offsetData=state.modifiersData.offset;if(elementContext===popper&&offsetData){var offset=offsetData[placement];Object.keys(overflowOffsets).forEach(function(key){var multiply=[right,bottom].indexOf(key)>=0?1:-1;var axis=[top,bottom].indexOf(key)>=0?'y':'x';overflowOffsets[key]+=offset[axis]*multiply;});}
return overflowOffsets;}
var DEFAULT_OPTIONS={placement:'bottom',modifiers:[],strategy:'absolute'};function areValidElements(){for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key];}
return!args.some(function(element){return!(element&&typeof element.getBoundingClientRect==='function');});}
function popperGenerator(generatorOptions){if(generatorOptions===void 0){generatorOptions={};}
var _generatorOptions=generatorOptions,_generatorOptions$def=_generatorOptions.defaultModifiers,defaultModifiers=_generatorOptions$def===void 0?[]:_generatorOptions$def,_generatorOptions$def2=_generatorOptions.defaultOptions,defaultOptions=_generatorOptions$def2===void 0?DEFAULT_OPTIONS:_generatorOptions$def2;return function createPopper(reference,popper,options){if(options===void 0){options=defaultOptions;}
var state={placement:'bottom',orderedModifiers:[],options:Object.assign({},DEFAULT_OPTIONS,defaultOptions),modifiersData:{},elements:{reference:reference,popper:popper},attributes:{},styles:{}};var effectCleanupFns=[];var isDestroyed=false;var instance={state:state,setOptions:function setOptions(setOptionsAction){var options=typeof setOptionsAction==='function'?setOptionsAction(state.options):setOptionsAction;cleanupModifierEffects();state.options=Object.assign({},defaultOptions,state.options,options);state.scrollParents={reference:isElement(reference)?listScrollParents(reference):reference.contextElement?listScrollParents(reference.contextElement):[],popper:listScrollParents(popper)};var orderedModifiers=orderModifiers(mergeByName([].concat(defaultModifiers,state.options.modifiers)));state.orderedModifiers=orderedModifiers.filter(function(m){return m.enabled;});runModifierEffects();return instance.update();},forceUpdate:function forceUpdate(){if(isDestroyed){return;}
var _state$elements=state.elements,reference=_state$elements.reference,popper=_state$elements.popper;if(!areValidElements(reference,popper)){return;}
state.rects={reference:getCompositeRect(reference,getOffsetParent(popper),state.options.strategy==='fixed'),popper:getLayoutRect(popper)};state.reset=false;state.placement=state.options.placement;state.orderedModifiers.forEach(function(modifier){return state.modifiersData[modifier.name]=Object.assign({},modifier.data);});for(var index=0;index<state.orderedModifiers.length;index++){if(state.reset===true){state.reset=false;index=-1;continue;}
var _state$orderedModifie=state.orderedModifiers[index],fn=_state$orderedModifie.fn,_state$orderedModifie2=_state$orderedModifie.options,_options=_state$orderedModifie2===void 0?{}:_state$orderedModifie2,name=_state$orderedModifie.name;if(typeof fn==='function'){state=fn({state:state,options:_options,name:name,instance:instance})||state;}}},update:debounce(function(){return new Promise(function(resolve){instance.forceUpdate();resolve(state);});}),destroy:function destroy(){cleanupModifierEffects();isDestroyed=true;}};if(!areValidElements(reference,popper)){return instance;}
instance.setOptions(options).then(function(state){if(!isDestroyed&&options.onFirstUpdate){options.onFirstUpdate(state);}});function runModifierEffects(){state.orderedModifiers.forEach(function(_ref){var name=_ref.name,_ref$options=_ref.options,options=_ref$options===void 0?{}:_ref$options,effect=_ref.effect;if(typeof effect==='function'){var cleanupFn=effect({state:state,name:name,instance:instance,options:options});var noopFn=function noopFn(){};effectCleanupFns.push(cleanupFn||noopFn);}});}
function cleanupModifierEffects(){effectCleanupFns.forEach(function(fn){return fn();});effectCleanupFns=[];}
return instance;};}
var passive={passive:true};function effect$2(_ref){var state=_ref.state,instance=_ref.instance,options=_ref.options;var _options$scroll=options.scroll,scroll=_options$scroll===void 0?true:_options$scroll,_options$resize=options.resize,resize=_options$resize===void 0?true:_options$resize;var window=getWindow(state.elements.popper);var scrollParents=[].concat(state.scrollParents.reference,state.scrollParents.popper);if(scroll){scrollParents.forEach(function(scrollParent){scrollParent.addEventListener('scroll',instance.update,passive);});}
if(resize){window.addEventListener('resize',instance.update,passive);}
return function(){if(scroll){scrollParents.forEach(function(scrollParent){scrollParent.removeEventListener('scroll',instance.update,passive);});}
if(resize){window.removeEventListener('resize',instance.update,passive);}};}
var eventListeners={name:'eventListeners',enabled:true,phase:'write',fn:function fn(){},effect:effect$2,data:{}};function popperOffsets(_ref){var state=_ref.state,name=_ref.name;state.modifiersData[name]=computeOffsets({reference:state.rects.reference,element:state.rects.popper,strategy:'absolute',placement:state.placement});}
var popperOffsets$1={name:'popperOffsets',enabled:true,phase:'read',fn:popperOffsets,data:{}};var unsetSides={top:'auto',right:'auto',bottom:'auto',left:'auto'};function roundOffsetsByDPR(_ref,win){var x=_ref.x,y=_ref.y;var dpr=win.devicePixelRatio||1;return{x:round(x*dpr)/dpr||0,y:round(y*dpr)/dpr||0};}
function mapToStyles(_ref2){var _Object$assign2;var popper=_ref2.popper,popperRect=_ref2.popperRect,placement=_ref2.placement,variation=_ref2.variation,offsets=_ref2.offsets,position=_ref2.position,gpuAcceleration=_ref2.gpuAcceleration,adaptive=_ref2.adaptive,roundOffsets=_ref2.roundOffsets,isFixed=_ref2.isFixed;var _offsets$x=offsets.x,x=_offsets$x===void 0?0:_offsets$x,_offsets$y=offsets.y,y=_offsets$y===void 0?0:_offsets$y;var _ref3=typeof roundOffsets==='function'?roundOffsets({x:x,y:y}):{x:x,y:y};x=_ref3.x;y=_ref3.y;var hasX=offsets.hasOwnProperty('x');var hasY=offsets.hasOwnProperty('y');var sideX=left;var sideY=top;var win=window;if(adaptive){var offsetParent=getOffsetParent(popper);var heightProp='clientHeight';var widthProp='clientWidth';if(offsetParent===getWindow(popper)){offsetParent=getDocumentElement(popper);if(getComputedStyle(offsetParent).position!=='static'&&position==='absolute'){heightProp='scrollHeight';widthProp='scrollWidth';}}
offsetParent=offsetParent;if(placement===top||(placement===left||placement===right)&&variation===end){sideY=bottom;var offsetY=isFixed&&offsetParent===win&&win.visualViewport?win.visualViewport.height:offsetParent[heightProp];y-=offsetY-popperRect.height;y*=gpuAcceleration?1:-1;}
if(placement===left||(placement===top||placement===bottom)&&variation===end){sideX=right;var offsetX=isFixed&&offsetParent===win&&win.visualViewport?win.visualViewport.width:offsetParent[widthProp];x-=offsetX-popperRect.width;x*=gpuAcceleration?1:-1;}}
var commonStyles=Object.assign({position:position},adaptive&&unsetSides);var _ref4=roundOffsets===true?roundOffsetsByDPR({x:x,y:y},getWindow(popper)):{x:x,y:y};x=_ref4.x;y=_ref4.y;if(gpuAcceleration){var _Object$assign;return Object.assign({},commonStyles,(_Object$assign={},_Object$assign[sideY]=hasY?'0':'',_Object$assign[sideX]=hasX?'0':'',_Object$assign.transform=(win.devicePixelRatio||1)<=1?"translate("+x+"px, "+y+"px)":"translate3d("+x+"px, "+y+"px, 0)",_Object$assign));}
return Object.assign({},commonStyles,(_Object$assign2={},_Object$assign2[sideY]=hasY?y+"px":'',_Object$assign2[sideX]=hasX?x+"px":'',_Object$assign2.transform='',_Object$assign2));}
function computeStyles(_ref5){var state=_ref5.state,options=_ref5.options;var _options$gpuAccelerat=options.gpuAcceleration,gpuAcceleration=_options$gpuAccelerat===void 0?true:_options$gpuAccelerat,_options$adaptive=options.adaptive,adaptive=_options$adaptive===void 0?true:_options$adaptive,_options$roundOffsets=options.roundOffsets,roundOffsets=_options$roundOffsets===void 0?true:_options$roundOffsets;var commonStyles={placement:getBasePlacement(state.placement),variation:getVariation(state.placement),popper:state.elements.popper,popperRect:state.rects.popper,gpuAcceleration:gpuAcceleration,isFixed:state.options.strategy==='fixed'};if(state.modifiersData.popperOffsets!=null){state.styles.popper=Object.assign({},state.styles.popper,mapToStyles(Object.assign({},commonStyles,{offsets:state.modifiersData.popperOffsets,position:state.options.strategy,adaptive:adaptive,roundOffsets:roundOffsets})));}
if(state.modifiersData.arrow!=null){state.styles.arrow=Object.assign({},state.styles.arrow,mapToStyles(Object.assign({},commonStyles,{offsets:state.modifiersData.arrow,position:'absolute',adaptive:false,roundOffsets:roundOffsets})));}
state.attributes.popper=Object.assign({},state.attributes.popper,{'data-popper-placement':state.placement});}
var computeStyles$1={name:'computeStyles',enabled:true,phase:'beforeWrite',fn:computeStyles,data:{}};function applyStyles(_ref){var state=_ref.state;Object.keys(state.elements).forEach(function(name){var style=state.styles[name]||{};var attributes=state.attributes[name]||{};var element=state.elements[name];if(!isHTMLElement(element)||!getNodeName(element)){return;}
Object.assign(element.style,style);Object.keys(attributes).forEach(function(name){var value=attributes[name];if(value===false){element.removeAttribute(name);}else{element.setAttribute(name,value===true?'':value);}});});}
function effect$1(_ref2){var state=_ref2.state;var initialStyles={popper:{position:state.options.strategy,left:'0',top:'0',margin:'0'},arrow:{position:'absolute'},reference:{}};Object.assign(state.elements.popper.style,initialStyles.popper);state.styles=initialStyles;if(state.elements.arrow){Object.assign(state.elements.arrow.style,initialStyles.arrow);}
return function(){Object.keys(state.elements).forEach(function(name){var element=state.elements[name];var attributes=state.attributes[name]||{};var styleProperties=Object.keys(state.styles.hasOwnProperty(name)?state.styles[name]:initialStyles[name]);var style=styleProperties.reduce(function(style,property){style[property]='';return style;},{});if(!isHTMLElement(element)||!getNodeName(element)){return;}
Object.assign(element.style,style);Object.keys(attributes).forEach(function(attribute){element.removeAttribute(attribute);});});};}
var applyStyles$1={name:'applyStyles',enabled:true,phase:'write',fn:applyStyles,effect:effect$1,requires:['computeStyles']};function distanceAndSkiddingToXY(placement,rects,offset){var basePlacement=getBasePlacement(placement);var invertDistance=[left,top].indexOf(basePlacement)>=0?-1:1;var _ref=typeof offset==='function'?offset(Object.assign({},rects,{placement:placement})):offset,skidding=_ref[0],distance=_ref[1];skidding=skidding||0;distance=(distance||0)*invertDistance;return[left,right].indexOf(basePlacement)>=0?{x:distance,y:skidding}:{x:skidding,y:distance};}
function offset(_ref2){var state=_ref2.state,options=_ref2.options,name=_ref2.name;var _options$offset=options.offset,offset=_options$offset===void 0?[0,0]:_options$offset;var data=placements.reduce(function(acc,placement){acc[placement]=distanceAndSkiddingToXY(placement,state.rects,offset);return acc;},{});var _data$state$placement=data[state.placement],x=_data$state$placement.x,y=_data$state$placement.y;if(state.modifiersData.popperOffsets!=null){state.modifiersData.popperOffsets.x+=x;state.modifiersData.popperOffsets.y+=y;}
state.modifiersData[name]=data;}
var offset$1={name:'offset',enabled:true,phase:'main',requires:['popperOffsets'],fn:offset};var hash$1={left:'right',right:'left',bottom:'top',top:'bottom'};function getOppositePlacement(placement){return placement.replace(/left|right|bottom|top/g,function(matched){return hash$1[matched];});}
var hash={start:'end',end:'start'};function getOppositeVariationPlacement(placement){return placement.replace(/start|end/g,function(matched){return hash[matched];});}
function computeAutoPlacement(state,options){if(options===void 0){options={};}
var _options=options,placement=_options.placement,boundary=_options.boundary,rootBoundary=_options.rootBoundary,padding=_options.padding,flipVariations=_options.flipVariations,_options$allowedAutoP=_options.allowedAutoPlacements,allowedAutoPlacements=_options$allowedAutoP===void 0?placements:_options$allowedAutoP;var variation=getVariation(placement);var placements$1=variation?flipVariations?variationPlacements:variationPlacements.filter(function(placement){return getVariation(placement)===variation;}):basePlacements;var allowedPlacements=placements$1.filter(function(placement){return allowedAutoPlacements.indexOf(placement)>=0;});if(allowedPlacements.length===0){allowedPlacements=placements$1;}
var overflows=allowedPlacements.reduce(function(acc,placement){acc[placement]=detectOverflow(state,{placement:placement,boundary:boundary,rootBoundary:rootBoundary,padding:padding})[getBasePlacement(placement)];return acc;},{});return Object.keys(overflows).sort(function(a,b){return overflows[a]-overflows[b];});}
function getExpandedFallbackPlacements(placement){if(getBasePlacement(placement)===auto){return[];}
var oppositePlacement=getOppositePlacement(placement);return[getOppositeVariationPlacement(placement),oppositePlacement,getOppositeVariationPlacement(oppositePlacement)];}
function flip(_ref){var state=_ref.state,options=_ref.options,name=_ref.name;if(state.modifiersData[name]._skip){return;}
var _options$mainAxis=options.mainAxis,checkMainAxis=_options$mainAxis===void 0?true:_options$mainAxis,_options$altAxis=options.altAxis,checkAltAxis=_options$altAxis===void 0?true:_options$altAxis,specifiedFallbackPlacements=options.fallbackPlacements,padding=options.padding,boundary=options.boundary,rootBoundary=options.rootBoundary,altBoundary=options.altBoundary,_options$flipVariatio=options.flipVariations,flipVariations=_options$flipVariatio===void 0?true:_options$flipVariatio,allowedAutoPlacements=options.allowedAutoPlacements;var preferredPlacement=state.options.placement;var basePlacement=getBasePlacement(preferredPlacement);var isBasePlacement=basePlacement===preferredPlacement;var fallbackPlacements=specifiedFallbackPlacements||(isBasePlacement||!flipVariations?[getOppositePlacement(preferredPlacement)]:getExpandedFallbackPlacements(preferredPlacement));var placements=[preferredPlacement].concat(fallbackPlacements).reduce(function(acc,placement){return acc.concat(getBasePlacement(placement)===auto?computeAutoPlacement(state,{placement:placement,boundary:boundary,rootBoundary:rootBoundary,padding:padding,flipVariations:flipVariations,allowedAutoPlacements:allowedAutoPlacements}):placement);},[]);var referenceRect=state.rects.reference;var popperRect=state.rects.popper;var checksMap=new Map();var makeFallbackChecks=true;var firstFittingPlacement=placements[0];for(var i=0;i<placements.length;i++){var placement=placements[i];var _basePlacement=getBasePlacement(placement);var isStartVariation=getVariation(placement)===start;var isVertical=[top,bottom].indexOf(_basePlacement)>=0;var len=isVertical?'width':'height';var overflow=detectOverflow(state,{placement:placement,boundary:boundary,rootBoundary:rootBoundary,altBoundary:altBoundary,padding:padding});var mainVariationSide=isVertical?isStartVariation?right:left:isStartVariation?bottom:top;if(referenceRect[len]>popperRect[len]){mainVariationSide=getOppositePlacement(mainVariationSide);}
var altVariationSide=getOppositePlacement(mainVariationSide);var checks=[];if(checkMainAxis){checks.push(overflow[_basePlacement]<=0);}
if(checkAltAxis){checks.push(overflow[mainVariationSide]<=0,overflow[altVariationSide]<=0);}
if(checks.every(function(check){return check;})){firstFittingPlacement=placement;makeFallbackChecks=false;break;}
checksMap.set(placement,checks);}
if(makeFallbackChecks){var numberOfChecks=flipVariations?3:1;var _loop=function _loop(_i){var fittingPlacement=placements.find(function(placement){var checks=checksMap.get(placement);if(checks){return checks.slice(0,_i).every(function(check){return check;});}});if(fittingPlacement){firstFittingPlacement=fittingPlacement;return"break";}};for(var _i=numberOfChecks;_i>0;_i--){var _ret=_loop(_i);if(_ret==="break")break;}}
if(state.placement!==firstFittingPlacement){state.modifiersData[name]._skip=true;state.placement=firstFittingPlacement;state.reset=true;}}
var flip$1={name:'flip',enabled:true,phase:'main',fn:flip,requiresIfExists:['offset'],data:{_skip:false}};function getAltAxis(axis){return axis==='x'?'y':'x';}
function within(min$1,value,max$1){return max(min$1,min(value,max$1));}
function withinMaxClamp(min,value,max){var v=within(min,value,max);return v>max?max:v;}
function preventOverflow(_ref){var state=_ref.state,options=_ref.options,name=_ref.name;var _options$mainAxis=options.mainAxis,checkMainAxis=_options$mainAxis===void 0?true:_options$mainAxis,_options$altAxis=options.altAxis,checkAltAxis=_options$altAxis===void 0?false:_options$altAxis,boundary=options.boundary,rootBoundary=options.rootBoundary,altBoundary=options.altBoundary,padding=options.padding,_options$tether=options.tether,tether=_options$tether===void 0?true:_options$tether,_options$tetherOffset=options.tetherOffset,tetherOffset=_options$tetherOffset===void 0?0:_options$tetherOffset;var overflow=detectOverflow(state,{boundary:boundary,rootBoundary:rootBoundary,padding:padding,altBoundary:altBoundary});var basePlacement=getBasePlacement(state.placement);var variation=getVariation(state.placement);var isBasePlacement=!variation;var mainAxis=getMainAxisFromPlacement(basePlacement);var altAxis=getAltAxis(mainAxis);var popperOffsets=state.modifiersData.popperOffsets;var referenceRect=state.rects.reference;var popperRect=state.rects.popper;var tetherOffsetValue=typeof tetherOffset==='function'?tetherOffset(Object.assign({},state.rects,{placement:state.placement})):tetherOffset;var normalizedTetherOffsetValue=typeof tetherOffsetValue==='number'?{mainAxis:tetherOffsetValue,altAxis:tetherOffsetValue}:Object.assign({mainAxis:0,altAxis:0},tetherOffsetValue);var offsetModifierState=state.modifiersData.offset?state.modifiersData.offset[state.placement]:null;var data={x:0,y:0};if(!popperOffsets){return;}
if(checkMainAxis){var _offsetModifierState$;var mainSide=mainAxis==='y'?top:left;var altSide=mainAxis==='y'?bottom:right;var len=mainAxis==='y'?'height':'width';var offset=popperOffsets[mainAxis];var min$1=offset+overflow[mainSide];var max$1=offset-overflow[altSide];var additive=tether?-popperRect[len]/2:0;var minLen=variation===start?referenceRect[len]:popperRect[len];var maxLen=variation===start?-popperRect[len]:-referenceRect[len];var arrowElement=state.elements.arrow;var arrowRect=tether&&arrowElement?getLayoutRect(arrowElement):{width:0,height:0};var arrowPaddingObject=state.modifiersData['arrow#persistent']?state.modifiersData['arrow#persistent'].padding:getFreshSideObject();var arrowPaddingMin=arrowPaddingObject[mainSide];var arrowPaddingMax=arrowPaddingObject[altSide];var arrowLen=within(0,referenceRect[len],arrowRect[len]);var minOffset=isBasePlacement?referenceRect[len]/2-additive-arrowLen-arrowPaddingMin-normalizedTetherOffsetValue.mainAxis:minLen-arrowLen-arrowPaddingMin-normalizedTetherOffsetValue.mainAxis;var maxOffset=isBasePlacement?-referenceRect[len]/2+additive+arrowLen+arrowPaddingMax+normalizedTetherOffsetValue.mainAxis:maxLen+arrowLen+arrowPaddingMax+normalizedTetherOffsetValue.mainAxis;var arrowOffsetParent=state.elements.arrow&&getOffsetParent(state.elements.arrow);var clientOffset=arrowOffsetParent?mainAxis==='y'?arrowOffsetParent.clientTop||0:arrowOffsetParent.clientLeft||0:0;var offsetModifierValue=(_offsetModifierState$=offsetModifierState==null?void 0:offsetModifierState[mainAxis])!=null?_offsetModifierState$:0;var tetherMin=offset+minOffset-offsetModifierValue-clientOffset;var tetherMax=offset+maxOffset-offsetModifierValue;var preventedOffset=within(tether?min(min$1,tetherMin):min$1,offset,tether?max(max$1,tetherMax):max$1);popperOffsets[mainAxis]=preventedOffset;data[mainAxis]=preventedOffset-offset;}
if(checkAltAxis){var _offsetModifierState$2;var _mainSide=mainAxis==='x'?top:left;var _altSide=mainAxis==='x'?bottom:right;var _offset=popperOffsets[altAxis];var _len=altAxis==='y'?'height':'width';var _min=_offset+overflow[_mainSide];var _max=_offset-overflow[_altSide];var isOriginSide=[top,left].indexOf(basePlacement)!==-1;var _offsetModifierValue=(_offsetModifierState$2=offsetModifierState==null?void 0:offsetModifierState[altAxis])!=null?_offsetModifierState$2:0;var _tetherMin=isOriginSide?_min:_offset-referenceRect[_len]-popperRect[_len]-_offsetModifierValue+normalizedTetherOffsetValue.altAxis;var _tetherMax=isOriginSide?_offset+referenceRect[_len]+popperRect[_len]-_offsetModifierValue-normalizedTetherOffsetValue.altAxis:_max;var _preventedOffset=tether&&isOriginSide?withinMaxClamp(_tetherMin,_offset,_tetherMax):within(tether?_tetherMin:_min,_offset,tether?_tetherMax:_max);popperOffsets[altAxis]=_preventedOffset;data[altAxis]=_preventedOffset-_offset;}
state.modifiersData[name]=data;}
var preventOverflow$1={name:'preventOverflow',enabled:true,phase:'main',fn:preventOverflow,requiresIfExists:['offset']};var toPaddingObject=function toPaddingObject(padding,state){padding=typeof padding==='function'?padding(Object.assign({},state.rects,{placement:state.placement})):padding;return mergePaddingObject(typeof padding!=='number'?padding:expandToHashMap(padding,basePlacements));};function arrow(_ref){var _state$modifiersData$;var state=_ref.state,name=_ref.name,options=_ref.options;var arrowElement=state.elements.arrow;var popperOffsets=state.modifiersData.popperOffsets;var basePlacement=getBasePlacement(state.placement);var axis=getMainAxisFromPlacement(basePlacement);var isVertical=[left,right].indexOf(basePlacement)>=0;var len=isVertical?'height':'width';if(!arrowElement||!popperOffsets){return;}
var paddingObject=toPaddingObject(options.padding,state);var arrowRect=getLayoutRect(arrowElement);var minProp=axis==='y'?top:left;var maxProp=axis==='y'?bottom:right;var endDiff=state.rects.reference[len]+state.rects.reference[axis]-popperOffsets[axis]-state.rects.popper[len];var startDiff=popperOffsets[axis]-state.rects.reference[axis];var arrowOffsetParent=getOffsetParent(arrowElement);var clientSize=arrowOffsetParent?axis==='y'?arrowOffsetParent.clientHeight||0:arrowOffsetParent.clientWidth||0:0;var centerToReference=endDiff/2-startDiff/2;var min=paddingObject[minProp];var max=clientSize-arrowRect[len]-paddingObject[maxProp];var center=clientSize/2-arrowRect[len]/2+centerToReference;var offset=within(min,center,max);var axisProp=axis;state.modifiersData[name]=(_state$modifiersData$={},_state$modifiersData$[axisProp]=offset,_state$modifiersData$.centerOffset=offset-center,_state$modifiersData$);}
function effect(_ref2){var state=_ref2.state,options=_ref2.options;var _options$element=options.element,arrowElement=_options$element===void 0?'[data-popper-arrow]':_options$element;if(arrowElement==null){return;}
if(typeof arrowElement==='string'){arrowElement=state.elements.popper.querySelector(arrowElement);if(!arrowElement){return;}}
if(!contains(state.elements.popper,arrowElement)){return;}
state.elements.arrow=arrowElement;}
var arrow$1={name:'arrow',enabled:true,phase:'main',fn:arrow,effect:effect,requires:['popperOffsets'],requiresIfExists:['preventOverflow']};function getSideOffsets(overflow,rect,preventedOffsets){if(preventedOffsets===void 0){preventedOffsets={x:0,y:0};}
return{top:overflow.top-rect.height-preventedOffsets.y,right:overflow.right-rect.width+preventedOffsets.x,bottom:overflow.bottom-rect.height+preventedOffsets.y,left:overflow.left-rect.width-preventedOffsets.x};}
function isAnySideFullyClipped(overflow){return[top,right,bottom,left].some(function(side){return overflow[side]>=0;});}
function hide(_ref){var state=_ref.state,name=_ref.name;var referenceRect=state.rects.reference;var popperRect=state.rects.popper;var preventedOffsets=state.modifiersData.preventOverflow;var referenceOverflow=detectOverflow(state,{elementContext:'reference'});var popperAltOverflow=detectOverflow(state,{altBoundary:true});var referenceClippingOffsets=getSideOffsets(referenceOverflow,referenceRect);var popperEscapeOffsets=getSideOffsets(popperAltOverflow,popperRect,preventedOffsets);var isReferenceHidden=isAnySideFullyClipped(referenceClippingOffsets);var hasPopperEscaped=isAnySideFullyClipped(popperEscapeOffsets);state.modifiersData[name]={referenceClippingOffsets:referenceClippingOffsets,popperEscapeOffsets:popperEscapeOffsets,isReferenceHidden:isReferenceHidden,hasPopperEscaped:hasPopperEscaped};state.attributes.popper=Object.assign({},state.attributes.popper,{'data-popper-reference-hidden':isReferenceHidden,'data-popper-escaped':hasPopperEscaped});}
var hide$1={name:'hide',enabled:true,phase:'main',requiresIfExists:['preventOverflow'],fn:hide};var defaultModifiers$1=[eventListeners,popperOffsets$1,computeStyles$1,applyStyles$1];var createPopper$1=popperGenerator({defaultModifiers:defaultModifiers$1});var defaultModifiers=[eventListeners,popperOffsets$1,computeStyles$1,applyStyles$1,offset$1,flip$1,preventOverflow$1,arrow$1,hide$1];var createPopper=popperGenerator({defaultModifiers:defaultModifiers});exports.applyStyles=applyStyles$1;exports.arrow=arrow$1;exports.computeStyles=computeStyles$1;exports.createPopper=createPopper;exports.createPopperLite=createPopper$1;exports.defaultModifiers=defaultModifiers;exports.detectOverflow=detectOverflow;exports.eventListeners=eventListeners;exports.flip=flip$1;exports.hide=hide$1;exports.offset=offset$1;exports.popperGenerator=popperGenerator;exports.popperOffsets=popperOffsets$1;exports.preventOverflow=preventOverflow$1;Object.defineProperty(exports,'__esModule',{value:true});})));;

/* /web/static/lib/bootstrap/js/dist/util/index.js */
(function(global,factory){typeof exports==='object'&&typeof module!=='undefined'?factory(exports):typeof define==='function'&&define.amd?define(['exports'],factory):(global=typeof globalThis!=='undefined'?globalThis:global||self,factory(global.Index={}));})(this,(function(exports){'use strict';const MAX_UID=1000000;const MILLISECONDS_MULTIPLIER=1000;const TRANSITION_END='transitionend';const parseSelector=selector=>{if(selector&&window.CSS&&window.CSS.escape){selector=selector.replace(/#([^\s"#']+)/g,(match,id)=>`#${CSS.escape(id)}`);}
return selector;};const toType=object=>{if(object===null||object===undefined){return`${object}`;}
return Object.prototype.toString.call(object).match(/\s([a-z]+)/i)[1].toLowerCase();};const getUID=prefix=>{do{prefix+=Math.floor(Math.random()*MAX_UID);}while(document.getElementById(prefix));return prefix;};const getTransitionDurationFromElement=element=>{if(!element){return 0;}
let{transitionDuration,transitionDelay}=window.getComputedStyle(element);const floatTransitionDuration=Number.parseFloat(transitionDuration);const floatTransitionDelay=Number.parseFloat(transitionDelay);if(!floatTransitionDuration&&!floatTransitionDelay){return 0;}
transitionDuration=transitionDuration.split(',')[0];transitionDelay=transitionDelay.split(',')[0];return(Number.parseFloat(transitionDuration)+Number.parseFloat(transitionDelay))*MILLISECONDS_MULTIPLIER;};const triggerTransitionEnd=element=>{element.dispatchEvent(new Event(TRANSITION_END));};const isElement=object=>{if(!object||typeof object!=='object'){return false;}
if(typeof object.jquery!=='undefined'){object=object[0];}
return typeof object.nodeType!=='undefined';};const getElement=object=>{if(isElement(object)){return object.jquery?object[0]:object;}
if(typeof object==='string'&&object.length>0){return document.querySelector(parseSelector(object));}
return null;};const isVisible=element=>{if(!isElement(element)||element.getClientRects().length===0){return false;}
const elementIsVisible=getComputedStyle(element).getPropertyValue('visibility')==='visible';const closedDetails=element.closest('details:not([open])');if(!closedDetails){return elementIsVisible;}
if(closedDetails!==element){const summary=element.closest('summary');if(summary&&summary.parentNode!==closedDetails){return false;}
if(summary===null){return false;}}
return elementIsVisible;};const isDisabled=element=>{if(!element||element.nodeType!==Node.ELEMENT_NODE){return true;}
if(element.classList.contains('disabled')){return true;}
if(typeof element.disabled!=='undefined'){return element.disabled;}
return element.hasAttribute('disabled')&&element.getAttribute('disabled')!=='false';};const findShadowRoot=element=>{if(!document.documentElement.attachShadow){return null;}
if(typeof element.getRootNode==='function'){const root=element.getRootNode();return root instanceof ShadowRoot?root:null;}
if(element instanceof ShadowRoot){return element;}
if(!element.parentNode){return null;}
return findShadowRoot(element.parentNode);};const noop=()=>{};const reflow=element=>{element.offsetHeight;};const getjQuery=()=>{if(window.jQuery&&!document.body.hasAttribute('data-bs-no-jquery')){return window.jQuery;}
return null;};const DOMContentLoadedCallbacks=[];const onDOMContentLoaded=callback=>{if(document.readyState==='loading'){if(!DOMContentLoadedCallbacks.length){document.addEventListener('DOMContentLoaded',()=>{for(const callback of DOMContentLoadedCallbacks){callback();}});}
DOMContentLoadedCallbacks.push(callback);}else{callback();}};const isRTL=()=>document.documentElement.dir==='rtl';const defineJQueryPlugin=plugin=>{onDOMContentLoaded(()=>{const $=getjQuery();if($){const name=plugin.NAME;const JQUERY_NO_CONFLICT=$.fn[name];$.fn[name]=plugin.jQueryInterface;$.fn[name].Constructor=plugin;$.fn[name].noConflict=()=>{$.fn[name]=JQUERY_NO_CONFLICT;return plugin.jQueryInterface;};}});};const execute=(possibleCallback,args=[],defaultValue=possibleCallback)=>{return typeof possibleCallback==='function'?possibleCallback(...args):defaultValue;};const executeAfterTransition=(callback,transitionElement,waitForTransition=true)=>{if(!waitForTransition){execute(callback);return;}
const durationPadding=5;const emulatedDuration=getTransitionDurationFromElement(transitionElement)+durationPadding;let called=false;const handler=({target})=>{if(target!==transitionElement){return;}
called=true;transitionElement.removeEventListener(TRANSITION_END,handler);execute(callback);};transitionElement.addEventListener(TRANSITION_END,handler);setTimeout(()=>{if(!called){triggerTransitionEnd(transitionElement);}},emulatedDuration);};const getNextActiveElement=(list,activeElement,shouldGetNext,isCycleAllowed)=>{const listLength=list.length;let index=list.indexOf(activeElement);if(index===-1){return!shouldGetNext&&isCycleAllowed?list[listLength-1]:list[0];}
index+=shouldGetNext?1:-1;if(isCycleAllowed){index=(index+listLength)%listLength;}
return list[Math.max(0,Math.min(index,listLength-1))];};exports.defineJQueryPlugin=defineJQueryPlugin;exports.execute=execute;exports.executeAfterTransition=executeAfterTransition;exports.findShadowRoot=findShadowRoot;exports.getElement=getElement;exports.getNextActiveElement=getNextActiveElement;exports.getTransitionDurationFromElement=getTransitionDurationFromElement;exports.getUID=getUID;exports.getjQuery=getjQuery;exports.isDisabled=isDisabled;exports.isElement=isElement;exports.isRTL=isRTL;exports.isVisible=isVisible;exports.noop=noop;exports.onDOMContentLoaded=onDOMContentLoaded;exports.parseSelector=parseSelector;exports.reflow=reflow;exports.toType=toType;exports.triggerTransitionEnd=triggerTransitionEnd;Object.defineProperty(exports,Symbol.toStringTag,{value:'Module'});}));;

/* /web/static/lib/bootstrap/js/dist/dom/data.js */
(function(global,factory){typeof exports==='object'&&typeof module!=='undefined'?module.exports=factory():typeof define==='function'&&define.amd?define(factory):(global=typeof globalThis!=='undefined'?globalThis:global||self,global.Data=factory());})(this,(function(){'use strict';const elementMap=new Map();const data={set(element,key,instance){if(!elementMap.has(element)){elementMap.set(element,new Map());}
const instanceMap=elementMap.get(element);if(!instanceMap.has(key)&&instanceMap.size!==0){console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(instanceMap.keys())[0]}.`);return;}
instanceMap.set(key,instance);},get(element,key){if(elementMap.has(element)){return elementMap.get(element).get(key)||null;}
return null;},remove(element,key){if(!elementMap.has(element)){return;}
const instanceMap=elementMap.get(element);instanceMap.delete(key);if(instanceMap.size===0){elementMap.delete(element);}}};return data;}));;

/* /web/static/lib/bootstrap/js/dist/dom/event-handler.js */
(function(global,factory){typeof exports==='object'&&typeof module!=='undefined'?module.exports=factory(require('../util/index.js')):typeof define==='function'&&define.amd?define(['../util/index'],factory):(global=typeof globalThis!=='undefined'?globalThis:global||self,global.EventHandler=factory(global.Index));})(this,(function(index_js){'use strict';const namespaceRegex=/[^.]*(?=\..*)\.|.*/;const stripNameRegex=/\..*/;const stripUidRegex=/::\d+$/;const eventRegistry={};let uidEvent=1;const customEvents={mouseenter:'mouseover',mouseleave:'mouseout'};const nativeEvents=new Set(['click','dblclick','mouseup','mousedown','contextmenu','mousewheel','DOMMouseScroll','mouseover','mouseout','mousemove','selectstart','selectend','keydown','keypress','keyup','orientationchange','touchstart','touchmove','touchend','touchcancel','pointerdown','pointermove','pointerup','pointerleave','pointercancel','gesturestart','gesturechange','gestureend','focus','blur','change','reset','select','submit','focusin','focusout','load','unload','beforeunload','resize','move','DOMContentLoaded','readystatechange','error','abort','scroll']);function makeEventUid(element,uid){return uid&&`${uid}::${uidEvent++}`||element.uidEvent||uidEvent++;}
function getElementEvents(element){const uid=makeEventUid(element);element.uidEvent=uid;eventRegistry[uid]=eventRegistry[uid]||{};return eventRegistry[uid];}
function bootstrapHandler(element,fn){return function handler(event){hydrateObj(event,{delegateTarget:element});if(handler.oneOff){EventHandler.off(element,event.type,fn);}
return fn.apply(element,[event]);};}
function bootstrapDelegationHandler(element,selector,fn){return function handler(event){const domElements=element.querySelectorAll(selector);for(let{target}=event;target&&target!==this;target=target.parentNode){for(const domElement of domElements){if(domElement!==target){continue;}
hydrateObj(event,{delegateTarget:target});if(handler.oneOff){EventHandler.off(element,event.type,selector,fn);}
return fn.apply(target,[event]);}}};}
function findHandler(events,callable,delegationSelector=null){return Object.values(events).find(event=>event.callable===callable&&event.delegationSelector===delegationSelector);}
function normalizeParameters(originalTypeEvent,handler,delegationFunction){const isDelegated=typeof handler==='string';const callable=isDelegated?delegationFunction:handler||delegationFunction;let typeEvent=getTypeEvent(originalTypeEvent);if(!nativeEvents.has(typeEvent)){typeEvent=originalTypeEvent;}
return[isDelegated,callable,typeEvent];}
function addHandler(element,originalTypeEvent,handler,delegationFunction,oneOff){if(typeof originalTypeEvent!=='string'||!element){return;}
let[isDelegated,callable,typeEvent]=normalizeParameters(originalTypeEvent,handler,delegationFunction);if(originalTypeEvent in customEvents){const wrapFunction=fn=>{return function(event){if(!event.relatedTarget||event.relatedTarget!==event.delegateTarget&&!event.delegateTarget.contains(event.relatedTarget)){return fn.call(this,event);}};};callable=wrapFunction(callable);}
const events=getElementEvents(element);const handlers=events[typeEvent]||(events[typeEvent]={});const previousFunction=findHandler(handlers,callable,isDelegated?handler:null);if(previousFunction){previousFunction.oneOff=previousFunction.oneOff&&oneOff;return;}
const uid=makeEventUid(callable,originalTypeEvent.replace(namespaceRegex,''));const fn=isDelegated?bootstrapDelegationHandler(element,handler,callable):bootstrapHandler(element,callable);fn.delegationSelector=isDelegated?handler:null;fn.callable=callable;fn.oneOff=oneOff;fn.uidEvent=uid;handlers[uid]=fn;element.addEventListener(typeEvent,fn,isDelegated);}
function removeHandler(element,events,typeEvent,handler,delegationSelector){const fn=findHandler(events[typeEvent],handler,delegationSelector);if(!fn){return;}
element.removeEventListener(typeEvent,fn,Boolean(delegationSelector));delete events[typeEvent][fn.uidEvent];}
function removeNamespacedHandlers(element,events,typeEvent,namespace){const storeElementEvent=events[typeEvent]||{};for(const[handlerKey,event]of Object.entries(storeElementEvent)){if(handlerKey.includes(namespace)){removeHandler(element,events,typeEvent,event.callable,event.delegationSelector);}}}
function getTypeEvent(event){event=event.replace(stripNameRegex,'');return customEvents[event]||event;}
const EventHandler={on(element,event,handler,delegationFunction){addHandler(element,event,handler,delegationFunction,false);},one(element,event,handler,delegationFunction){addHandler(element,event,handler,delegationFunction,true);},off(element,originalTypeEvent,handler,delegationFunction){if(typeof originalTypeEvent!=='string'||!element){return;}
const[isDelegated,callable,typeEvent]=normalizeParameters(originalTypeEvent,handler,delegationFunction);const inNamespace=typeEvent!==originalTypeEvent;const events=getElementEvents(element);const storeElementEvent=events[typeEvent]||{};const isNamespace=originalTypeEvent.startsWith('.');if(typeof callable!=='undefined'){if(!Object.keys(storeElementEvent).length){return;}
removeHandler(element,events,typeEvent,callable,isDelegated?handler:null);return;}
if(isNamespace){for(const elementEvent of Object.keys(events)){removeNamespacedHandlers(element,events,elementEvent,originalTypeEvent.slice(1));}}
for(const[keyHandlers,event]of Object.entries(storeElementEvent)){const handlerKey=keyHandlers.replace(stripUidRegex,'');if(!inNamespace||originalTypeEvent.includes(handlerKey)){removeHandler(element,events,typeEvent,event.callable,event.delegationSelector);}}},trigger(element,event,args){if(typeof event!=='string'||!element){return null;}
const $=index_js.getjQuery();const typeEvent=getTypeEvent(event);const inNamespace=event!==typeEvent;let jQueryEvent=null;let bubbles=true;let nativeDispatch=true;let defaultPrevented=false;if(inNamespace&&$){jQueryEvent=$.Event(event,args);$(element).trigger(jQueryEvent);bubbles=!jQueryEvent.isPropagationStopped();nativeDispatch=!jQueryEvent.isImmediatePropagationStopped();defaultPrevented=jQueryEvent.isDefaultPrevented();}
const evt=hydrateObj(new Event(event,{bubbles,cancelable:true}),args);if(defaultPrevented){evt.preventDefault();}
if(nativeDispatch){element.dispatchEvent(evt);}
if(evt.defaultPrevented&&jQueryEvent){jQueryEvent.preventDefault();}
return evt;}};function hydrateObj(obj,meta={}){for(const[key,value]of Object.entries(meta)){try{obj[key]=value;}catch(_unused){Object.defineProperty(obj,key,{configurable:true,get(){return value;}});}}
return obj;}
return EventHandler;}));;

/* /web/static/lib/bootstrap/js/dist/dom/manipulator.js */
(function(global,factory){typeof exports==='object'&&typeof module!=='undefined'?module.exports=factory():typeof define==='function'&&define.amd?define(factory):(global=typeof globalThis!=='undefined'?globalThis:global||self,global.Manipulator=factory());})(this,(function(){'use strict';function normalizeData(value){if(value==='true'){return true;}
if(value==='false'){return false;}
if(value===Number(value).toString()){return Number(value);}
if(value===''||value==='null'){return null;}
if(typeof value!=='string'){return value;}
try{return JSON.parse(decodeURIComponent(value));}catch(_unused){return value;}}
function normalizeDataKey(key){return key.replace(/[A-Z]/g,chr=>`-${chr.toLowerCase()}`);}
const Manipulator={setDataAttribute(element,key,value){element.setAttribute(`data-bs-${normalizeDataKey(key)}`,value);},removeDataAttribute(element,key){element.removeAttribute(`data-bs-${normalizeDataKey(key)}`);},getDataAttributes(element){if(!element){return{};}
const attributes={};const bsKeys=Object.keys(element.dataset).filter(key=>key.startsWith('bs')&&!key.startsWith('bsConfig'));for(const key of bsKeys){let pureKey=key.replace(/^bs/,'');pureKey=pureKey.charAt(0).toLowerCase()+pureKey.slice(1,pureKey.length);attributes[pureKey]=normalizeData(element.dataset[key]);}
return attributes;},getDataAttribute(element,key){return normalizeData(element.getAttribute(`data-bs-${normalizeDataKey(key)}`));}};return Manipulator;}));;

/* /web/static/lib/bootstrap/js/dist/dom/selector-engine.js */
(function(global,factory){typeof exports==='object'&&typeof module!=='undefined'?module.exports=factory(require('../util/index.js')):typeof define==='function'&&define.amd?define(['../util/index'],factory):(global=typeof globalThis!=='undefined'?globalThis:global||self,global.SelectorEngine=factory(global.Index));})(this,(function(index_js){'use strict';const getSelector=element=>{let selector=element.getAttribute('data-bs-target');if(!selector||selector==='#'){let hrefAttribute=element.getAttribute('href');if(!hrefAttribute||!hrefAttribute.includes('#')&&!hrefAttribute.startsWith('.')){return null;}
if(hrefAttribute.includes('#')&&!hrefAttribute.startsWith('#')){hrefAttribute=`#${hrefAttribute.split('#')[1]}`;}
selector=hrefAttribute&&hrefAttribute!=='#'?hrefAttribute.trim():null;}
return selector?selector.split(',').map(sel=>index_js.parseSelector(sel)).join(','):null;};const SelectorEngine={find(selector,element=document.documentElement){return[].concat(...Element.prototype.querySelectorAll.call(element,selector));},findOne(selector,element=document.documentElement){return Element.prototype.querySelector.call(element,selector);},children(element,selector){return[].concat(...element.children).filter(child=>child.matches(selector));},parents(element,selector){const parents=[];let ancestor=element.parentNode.closest(selector);while(ancestor){parents.push(ancestor);ancestor=ancestor.parentNode.closest(selector);}
return parents;},prev(element,selector){let previous=element.previousElementSibling;while(previous){if(previous.matches(selector)){return[previous];}
previous=previous.previousElementSibling;}
return[];},next(element,selector){let next=element.nextElementSibling;while(next){if(next.matches(selector)){return[next];}
next=next.nextElementSibling;}
return[];},focusableChildren(element){const focusables=['a','button','input','textarea','select','details','[tabindex]','[contenteditable="true"]'].map(selector=>`${selector}:not([tabindex^="-"])`).join(',');return this.find(focusables,element).filter(el=>!index_js.isDisabled(el)&&index_js.isVisible(el));},getSelectorFromElement(element){const selector=getSelector(element);if(selector){return SelectorEngine.findOne(selector)?selector:null;}
return null;},getElementFromSelector(element){const selector=getSelector(element);return selector?SelectorEngine.findOne(selector):null;},getMultipleElementsFromSelector(element){const selector=getSelector(element);return selector?SelectorEngine.find(selector):[];}};return SelectorEngine;}));;

/* /web/static/lib/bootstrap/js/dist/util/config.js */
(function(global,factory){typeof exports==='object'&&typeof module!=='undefined'?module.exports=factory(require('../dom/manipulator.js'),require('./index.js')):typeof define==='function'&&define.amd?define(['../dom/manipulator','./index'],factory):(global=typeof globalThis!=='undefined'?globalThis:global||self,global.Config=factory(global.Manipulator,global.Index));})(this,(function(Manipulator,index_js){'use strict';class Config{static get Default(){return{};}
static get DefaultType(){return{};}
static get NAME(){throw new Error('You have to implement the static method "NAME", for each component!');}
_getConfig(config){config=this._mergeConfigObj(config);config=this._configAfterMerge(config);this._typeCheckConfig(config);return config;}
_configAfterMerge(config){return config;}
_mergeConfigObj(config,element){const jsonConfig=index_js.isElement(element)?Manipulator.getDataAttribute(element,'config'):{};return{...this.constructor.Default,...(typeof jsonConfig==='object'?jsonConfig:{}),...(index_js.isElement(element)?Manipulator.getDataAttributes(element):{}),...(typeof config==='object'?config:{})};}
_typeCheckConfig(config,configTypes=this.constructor.DefaultType){for(const[property,expectedTypes]of Object.entries(configTypes)){const value=config[property];const valueType=index_js.isElement(value)?'element':index_js.toType(value);if(!new RegExp(expectedTypes).test(valueType)){throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${property}" provided type "${valueType}" but expected type "${expectedTypes}".`);}}}}
return Config;}));;

/* /web/static/lib/bootstrap/js/dist/util/component-functions.js */
(function(global,factory){typeof exports==='object'&&typeof module!=='undefined'?factory(exports,require('../dom/event-handler.js'),require('../dom/selector-engine.js'),require('./index.js')):typeof define==='function'&&define.amd?define(['exports','../dom/event-handler','../dom/selector-engine','./index'],factory):(global=typeof globalThis!=='undefined'?globalThis:global||self,factory(global.ComponentFunctions={},global.EventHandler,global.SelectorEngine,global.Index));})(this,(function(exports,EventHandler,SelectorEngine,index_js){'use strict';const enableDismissTrigger=(component,method='hide')=>{const clickEvent=`click.dismiss${component.EVENT_KEY}`;const name=component.NAME;EventHandler.on(document,clickEvent,`[data-bs-dismiss="${name}"]`,function(event){if(['A','AREA'].includes(this.tagName)){event.preventDefault();}
if(index_js.isDisabled(this)){return;}
const target=SelectorEngine.getElementFromSelector(this)||this.closest(`.${name}`);const instance=component.getOrCreateInstance(target);instance[method]();});};exports.enableDismissTrigger=enableDismissTrigger;Object.defineProperty(exports,Symbol.toStringTag,{value:'Module'});}));;

/* /web/static/lib/bootstrap/js/dist/util/backdrop.js */
(function(global,factory){typeof exports==='object'&&typeof module!=='undefined'?module.exports=factory(require('../dom/event-handler.js'),require('./config.js'),require('./index.js')):typeof define==='function'&&define.amd?define(['../dom/event-handler','./config','./index'],factory):(global=typeof globalThis!=='undefined'?globalThis:global||self,global.Backdrop=factory(global.EventHandler,global.Config,global.Index));})(this,(function(EventHandler,Config,index_js){'use strict';const NAME='backdrop';const CLASS_NAME_FADE='fade';const CLASS_NAME_SHOW='show';const EVENT_MOUSEDOWN=`mousedown.bs.${NAME}`;const Default={className:'modal-backdrop',clickCallback:null,isAnimated:false,isVisible:true,rootElement:'body'};const DefaultType={className:'string',clickCallback:'(function|null)',isAnimated:'boolean',isVisible:'boolean',rootElement:'(element|string)'};class Backdrop extends Config{constructor(config){super();this._config=this._getConfig(config);this._isAppended=false;this._element=null;}
static get Default(){return Default;}
static get DefaultType(){return DefaultType;}
static get NAME(){return NAME;}
show(callback){if(!this._config.isVisible){index_js.execute(callback);return;}
this._append();const element=this._getElement();if(this._config.isAnimated){index_js.reflow(element);}
element.classList.add(CLASS_NAME_SHOW);this._emulateAnimation(()=>{index_js.execute(callback);});}
hide(callback){if(!this._config.isVisible){index_js.execute(callback);return;}
this._getElement().classList.remove(CLASS_NAME_SHOW);this._emulateAnimation(()=>{this.dispose();index_js.execute(callback);});}
dispose(){if(!this._isAppended){return;}
EventHandler.off(this._element,EVENT_MOUSEDOWN);this._element.remove();this._isAppended=false;}
_getElement(){if(!this._element){const backdrop=document.createElement('div');backdrop.className=this._config.className;if(this._config.isAnimated){backdrop.classList.add(CLASS_NAME_FADE);}
this._element=backdrop;}
return this._element;}
_configAfterMerge(config){config.rootElement=index_js.getElement(config.rootElement);return config;}
_append(){if(this._isAppended){return;}
const element=this._getElement();this._config.rootElement.append(element);EventHandler.on(element,EVENT_MOUSEDOWN,()=>{index_js.execute(this._config.clickCallback);});this._isAppended=true;}
_emulateAnimation(callback){index_js.executeAfterTransition(callback,this._getElement(),this._config.isAnimated);}}
return Backdrop;}));;

/* /web/static/lib/bootstrap/js/dist/util/focustrap.js */
(function(global,factory){typeof exports==='object'&&typeof module!=='undefined'?module.exports=factory(require('../dom/event-handler.js'),require('../dom/selector-engine.js'),require('./config.js')):typeof define==='function'&&define.amd?define(['../dom/event-handler','../dom/selector-engine','./config'],factory):(global=typeof globalThis!=='undefined'?globalThis:global||self,global.Focustrap=factory(global.EventHandler,global.SelectorEngine,global.Config));})(this,(function(EventHandler,SelectorEngine,Config){'use strict';const NAME='focustrap';const DATA_KEY='bs.focustrap';const EVENT_KEY=`.${DATA_KEY}`;const EVENT_FOCUSIN=`focusin${EVENT_KEY}`;const EVENT_KEYDOWN_TAB=`keydown.tab${EVENT_KEY}`;const TAB_KEY='Tab';const TAB_NAV_FORWARD='forward';const TAB_NAV_BACKWARD='backward';const Default={autofocus:true,trapElement:null};const DefaultType={autofocus:'boolean',trapElement:'element'};class FocusTrap extends Config{constructor(config){super();this._config=this._getConfig(config);this._isActive=false;this._lastTabNavDirection=null;}
static get Default(){return Default;}
static get DefaultType(){return DefaultType;}
static get NAME(){return NAME;}
activate(){if(this._isActive){return;}
if(this._config.autofocus){this._config.trapElement.focus();}
EventHandler.off(document,EVENT_KEY);EventHandler.on(document,EVENT_FOCUSIN,event=>this._handleFocusin(event));EventHandler.on(document,EVENT_KEYDOWN_TAB,event=>this._handleKeydown(event));this._isActive=true;}
deactivate(){if(!this._isActive){return;}
this._isActive=false;EventHandler.off(document,EVENT_KEY);}
_handleFocusin(event){const{trapElement}=this._config;if(event.target===document||event.target===trapElement||trapElement.contains(event.target)){return;}
const elements=SelectorEngine.focusableChildren(trapElement);if(elements.length===0){trapElement.focus();}else if(this._lastTabNavDirection===TAB_NAV_BACKWARD){elements[elements.length-1].focus();}else{elements[0].focus();}}
_handleKeydown(event){if(event.key!==TAB_KEY){return;}
this._lastTabNavDirection=event.shiftKey?TAB_NAV_BACKWARD:TAB_NAV_FORWARD;}}
return FocusTrap;}));;

/* /web/static/lib/bootstrap/js/dist/util/sanitizer.js */
(function(global,factory){typeof exports==='object'&&typeof module!=='undefined'?factory(exports):typeof define==='function'&&define.amd?define(['exports'],factory):(global=typeof globalThis!=='undefined'?globalThis:global||self,factory(global.Sanitizer={}));})(this,(function(exports){'use strict';const ARIA_ATTRIBUTE_PATTERN=/^aria-[\w-]*$/i;const DefaultAllowlist={'*':['class','dir','id','lang','role',ARIA_ATTRIBUTE_PATTERN],a:['target','href','title','rel'],area:[],b:[],br:[],col:[],code:[],dd:[],div:[],dl:[],dt:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:['src','srcset','alt','title','width','height'],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]};const uriAttributes=new Set(['background','cite','href','itemtype','longdesc','poster','src','xlink:href']);const SAFE_URL_PATTERN=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i;const allowedAttribute=(attribute,allowedAttributeList)=>{const attributeName=attribute.nodeName.toLowerCase();if(allowedAttributeList.includes(attributeName)){if(uriAttributes.has(attributeName)){return Boolean(SAFE_URL_PATTERN.test(attribute.nodeValue));}
return true;}
return allowedAttributeList.filter(attributeRegex=>attributeRegex instanceof RegExp).some(regex=>regex.test(attributeName));};function sanitizeHtml(unsafeHtml,allowList,sanitizeFunction){if(!unsafeHtml.length){return unsafeHtml;}
if(sanitizeFunction&&typeof sanitizeFunction==='function'){return sanitizeFunction(unsafeHtml);}
const domParser=new window.DOMParser();const createdDocument=domParser.parseFromString(unsafeHtml,'text/html');const elements=[].concat(...createdDocument.body.querySelectorAll('*'));for(const element of elements){const elementName=element.nodeName.toLowerCase();if(!Object.keys(allowList).includes(elementName)){element.remove();continue;}
const attributeList=[].concat(...element.attributes);const allowedAttributes=[].concat(allowList['*']||[],allowList[elementName]||[]);for(const attribute of attributeList){if(!allowedAttribute(attribute,allowedAttributes)){element.removeAttribute(attribute.nodeName);}}}
return createdDocument.body.innerHTML;}
exports.DefaultAllowlist=DefaultAllowlist;exports.sanitizeHtml=sanitizeHtml;Object.defineProperty(exports,Symbol.toStringTag,{value:'Module'});}));;

/* /web/static/lib/bootstrap/js/dist/util/scrollbar.js */
(function(global,factory){typeof exports==='object'&&typeof module!=='undefined'?module.exports=factory(require('../dom/manipulator.js'),require('../dom/selector-engine.js'),require('./index.js')):typeof define==='function'&&define.amd?define(['../dom/manipulator','../dom/selector-engine','./index'],factory):(global=typeof globalThis!=='undefined'?globalThis:global||self,global.Scrollbar=factory(global.Manipulator,global.SelectorEngine,global.Index));})(this,(function(Manipulator,SelectorEngine,index_js){'use strict';const SELECTOR_FIXED_CONTENT='.fixed-top, .fixed-bottom, .is-fixed, .sticky-top';const SELECTOR_STICKY_CONTENT='.sticky-top';const PROPERTY_PADDING='padding-right';const PROPERTY_MARGIN='margin-right';class ScrollBarHelper{constructor(){this._element=document.body;}
getWidth(){const documentWidth=document.documentElement.clientWidth;return Math.abs(window.innerWidth-documentWidth);}
hide(){const width=this.getWidth();this._disableOverFlow();this._setElementAttributes(this._element,PROPERTY_PADDING,calculatedValue=>calculatedValue+width);this._setElementAttributes(SELECTOR_FIXED_CONTENT,PROPERTY_PADDING,calculatedValue=>calculatedValue+width);this._setElementAttributes(SELECTOR_STICKY_CONTENT,PROPERTY_MARGIN,calculatedValue=>calculatedValue-width);}
reset(){this._resetElementAttributes(this._element,'overflow');this._resetElementAttributes(this._element,PROPERTY_PADDING);this._resetElementAttributes(SELECTOR_FIXED_CONTENT,PROPERTY_PADDING);this._resetElementAttributes(SELECTOR_STICKY_CONTENT,PROPERTY_MARGIN);}
isOverflowing(){return this.getWidth()>0;}
_disableOverFlow(){this._saveInitialAttribute(this._element,'overflow');this._element.style.overflow='hidden';}
_setElementAttributes(selector,styleProperty,callback){const scrollbarWidth=this.getWidth();const manipulationCallBack=element=>{if(element!==this._element&&window.innerWidth>element.clientWidth+scrollbarWidth){return;}
this._saveInitialAttribute(element,styleProperty);const calculatedValue=window.getComputedStyle(element).getPropertyValue(styleProperty);element.style.setProperty(styleProperty,`${callback(Number.parseFloat(calculatedValue))}px`);};this._applyManipulationCallback(selector,manipulationCallBack);}
_saveInitialAttribute(element,styleProperty){const actualValue=element.style.getPropertyValue(styleProperty);if(actualValue){Manipulator.setDataAttribute(element,styleProperty,actualValue);}}
_resetElementAttributes(selector,styleProperty){const manipulationCallBack=element=>{const value=Manipulator.getDataAttribute(element,styleProperty);if(value===null){element.style.removeProperty(styleProperty);return;}
Manipulator.removeDataAttribute(element,styleProperty);element.style.setProperty(styleProperty,value);};this._applyManipulationCallback(selector,manipulationCallBack);}
_applyManipulationCallback(selector,callBack){if(index_js.isElement(selector)){callBack(selector);return;}
for(const sel of SelectorEngine.find(selector,this._element)){callBack(sel);}}}
return ScrollBarHelper;}));;

/* /web/static/lib/bootstrap/js/dist/util/swipe.js */
(function(global,factory){typeof exports==='object'&&typeof module!=='undefined'?module.exports=factory(require('../dom/event-handler.js'),require('./config.js'),require('./index.js')):typeof define==='function'&&define.amd?define(['../dom/event-handler','./config','./index'],factory):(global=typeof globalThis!=='undefined'?globalThis:global||self,global.Swipe=factory(global.EventHandler,global.Config,global.Index));})(this,(function(EventHandler,Config,index_js){'use strict';const NAME='swipe';const EVENT_KEY='.bs.swipe';const EVENT_TOUCHSTART=`touchstart${EVENT_KEY}`;const EVENT_TOUCHMOVE=`touchmove${EVENT_KEY}`;const EVENT_TOUCHEND=`touchend${EVENT_KEY}`;const EVENT_POINTERDOWN=`pointerdown${EVENT_KEY}`;const EVENT_POINTERUP=`pointerup${EVENT_KEY}`;const POINTER_TYPE_TOUCH='touch';const POINTER_TYPE_PEN='pen';const CLASS_NAME_POINTER_EVENT='pointer-event';const SWIPE_THRESHOLD=40;const Default={endCallback:null,leftCallback:null,rightCallback:null};const DefaultType={endCallback:'(function|null)',leftCallback:'(function|null)',rightCallback:'(function|null)'};class Swipe extends Config{constructor(element,config){super();this._element=element;if(!element||!Swipe.isSupported()){return;}
this._config=this._getConfig(config);this._deltaX=0;this._supportPointerEvents=Boolean(window.PointerEvent);this._initEvents();}
static get Default(){return Default;}
static get DefaultType(){return DefaultType;}
static get NAME(){return NAME;}
dispose(){EventHandler.off(this._element,EVENT_KEY);}
_start(event){if(!this._supportPointerEvents){this._deltaX=event.touches[0].clientX;return;}
if(this._eventIsPointerPenTouch(event)){this._deltaX=event.clientX;}}
_end(event){if(this._eventIsPointerPenTouch(event)){this._deltaX=event.clientX-this._deltaX;}
this._handleSwipe();index_js.execute(this._config.endCallback);}
_move(event){this._deltaX=event.touches&&event.touches.length>1?0:event.touches[0].clientX-this._deltaX;}
_handleSwipe(){const absDeltaX=Math.abs(this._deltaX);if(absDeltaX<=SWIPE_THRESHOLD){return;}
const direction=absDeltaX/this._deltaX;this._deltaX=0;if(!direction){return;}
index_js.execute(direction>0?this._config.rightCallback:this._config.leftCallback);}
_initEvents(){if(this._supportPointerEvents){EventHandler.on(this._element,EVENT_POINTERDOWN,event=>this._start(event));EventHandler.on(this._element,EVENT_POINTERUP,event=>this._end(event));this._element.classList.add(CLASS_NAME_POINTER_EVENT);}else{EventHandler.on(this._element,EVENT_TOUCHSTART,event=>this._start(event));EventHandler.on(this._element,EVENT_TOUCHMOVE,event=>this._move(event));EventHandler.on(this._element,EVENT_TOUCHEND,event=>this._end(event));}}
_eventIsPointerPenTouch(event){return this._supportPointerEvents&&(event.pointerType===POINTER_TYPE_PEN||event.pointerType===POINTER_TYPE_TOUCH);}
static isSupported(){return'ontouchstart'in document.documentElement||navigator.maxTouchPoints>0;}}
return Swipe;}));;

/* /web/static/lib/bootstrap/js/dist/util/template-factory.js */
(function(global,factory){typeof exports==='object'&&typeof module!=='undefined'?module.exports=factory(require('../dom/selector-engine.js'),require('./config.js'),require('./sanitizer.js'),require('./index.js')):typeof define==='function'&&define.amd?define(['../dom/selector-engine','./config','./sanitizer','./index'],factory):(global=typeof globalThis!=='undefined'?globalThis:global||self,global.TemplateFactory=factory(global.SelectorEngine,global.Config,global.Sanitizer,global.Index));})(this,(function(SelectorEngine,Config,sanitizer_js,index_js){'use strict';const NAME='TemplateFactory';const Default={allowList:sanitizer_js.DefaultAllowlist,content:{},extraClass:'',html:false,sanitize:true,sanitizeFn:null,template:'<div></div>'};const DefaultType={allowList:'object',content:'object',extraClass:'(string|function)',html:'boolean',sanitize:'boolean',sanitizeFn:'(null|function)',template:'string'};const DefaultContentType={entry:'(string|element|function|null)',selector:'(string|element)'};class TemplateFactory extends Config{constructor(config){super();this._config=this._getConfig(config);}
static get Default(){return Default;}
static get DefaultType(){return DefaultType;}
static get NAME(){return NAME;}
getContent(){return Object.values(this._config.content).map(config=>this._resolvePossibleFunction(config)).filter(Boolean);}
hasContent(){return this.getContent().length>0;}
changeContent(content){this._checkContent(content);this._config.content={...this._config.content,...content};return this;}
toHtml(){const templateWrapper=document.createElement('div');templateWrapper.innerHTML=this._maybeSanitize(this._config.template);for(const[selector,text]of Object.entries(this._config.content)){this._setContent(templateWrapper,text,selector);}
const template=templateWrapper.children[0];const extraClass=this._resolvePossibleFunction(this._config.extraClass);if(extraClass){template.classList.add(...extraClass.split(' '));}
return template;}
_typeCheckConfig(config){super._typeCheckConfig(config);this._checkContent(config.content);}
_checkContent(arg){for(const[selector,content]of Object.entries(arg)){super._typeCheckConfig({selector,entry:content},DefaultContentType);}}
_setContent(template,content,selector){const templateElement=SelectorEngine.findOne(selector,template);if(!templateElement){return;}
content=this._resolvePossibleFunction(content);if(!content){templateElement.remove();return;}
if(index_js.isElement(content)){this._putElementInTemplate(index_js.getElement(content),templateElement);return;}
if(this._config.html){templateElement.innerHTML=this._maybeSanitize(content);return;}
templateElement.textContent=content;}
_maybeSanitize(arg){return this._config.sanitize?sanitizer_js.sanitizeHtml(arg,this._config.allowList,this._config.sanitizeFn):arg;}
_resolvePossibleFunction(arg){return index_js.execute(arg,[this]);}
_putElementInTemplate(element,templateElement){if(this._config.html){templateElement.innerHTML='';templateElement.append(element);return;}
templateElement.textContent=element.textContent;}}
return TemplateFactory;}));;

/* /web/static/lib/bootstrap/js/dist/base-component.js */
(function(global,factory){typeof exports==='object'&&typeof module!=='undefined'?module.exports=factory(require('./dom/data.js'),require('./dom/event-handler.js'),require('./util/config.js'),require('./util/index.js')):typeof define==='function'&&define.amd?define(['./dom/data','./dom/event-handler','./util/config','./util/index'],factory):(global=typeof globalThis!=='undefined'?globalThis:global||self,global.BaseComponent=factory(global.Data,global.EventHandler,global.Config,global.Index));})(this,(function(Data,EventHandler,Config,index_js){'use strict';const VERSION='5.3.3';class BaseComponent extends Config{constructor(element,config){super();element=index_js.getElement(element);if(!element){return;}
this._element=element;this._config=this._getConfig(config);Data.set(this._element,this.constructor.DATA_KEY,this);}
dispose(){Data.remove(this._element,this.constructor.DATA_KEY);EventHandler.off(this._element,this.constructor.EVENT_KEY);for(const propertyName of Object.getOwnPropertyNames(this)){this[propertyName]=null;}}
_queueCallback(callback,element,isAnimated=true){index_js.executeAfterTransition(callback,element,isAnimated);}
_getConfig(config){config=this._mergeConfigObj(config,this._element);config=this._configAfterMerge(config);this._typeCheckConfig(config);return config;}
static getInstance(element){return Data.get(index_js.getElement(element),this.DATA_KEY);}
static getOrCreateInstance(element,config={}){return this.getInstance(element)||new this(element,typeof config==='object'?config:null);}
static get VERSION(){return VERSION;}
static get DATA_KEY(){return`bs.${this.NAME}`;}
static get EVENT_KEY(){return`.${this.DATA_KEY}`;}
static eventName(name){return`${name}${this.EVENT_KEY}`;}}
return BaseComponent;}));;

/* /web/static/lib/bootstrap/js/dist/alert.js */
(function(global,factory){typeof exports==='object'&&typeof module!=='undefined'?module.exports=factory(require('./base-component.js'),require('./dom/event-handler.js'),require('./util/component-functions.js'),require('./util/index.js')):typeof define==='function'&&define.amd?define(['./base-component','./dom/event-handler','./util/component-functions','./util/index'],factory):(global=typeof globalThis!=='undefined'?globalThis:global||self,global.Alert=factory(global.BaseComponent,global.EventHandler,global.ComponentFunctions,global.Index));})(this,(function(BaseComponent,EventHandler,componentFunctions_js,index_js){'use strict';const NAME='alert';const DATA_KEY='bs.alert';const EVENT_KEY=`.${DATA_KEY}`;const EVENT_CLOSE=`close${EVENT_KEY}`;const EVENT_CLOSED=`closed${EVENT_KEY}`;const CLASS_NAME_FADE='fade';const CLASS_NAME_SHOW='show';class Alert extends BaseComponent{static get NAME(){return NAME;}
close(){const closeEvent=EventHandler.trigger(this._element,EVENT_CLOSE);if(closeEvent.defaultPrevented){return;}
this._element.classList.remove(CLASS_NAME_SHOW);const isAnimated=this._element.classList.contains(CLASS_NAME_FADE);this._queueCallback(()=>this._destroyElement(),this._element,isAnimated);}
_destroyElement(){this._element.remove();EventHandler.trigger(this._element,EVENT_CLOSED);this.dispose();}
static jQueryInterface(config){return this.each(function(){const data=Alert.getOrCreateInstance(this);if(typeof config!=='string'){return;}
if(data[config]===undefined||config.startsWith('_')||config==='constructor'){throw new TypeError(`No method named "${config}"`);}
data[config](this);});}}
componentFunctions_js.enableDismissTrigger(Alert,'close');index_js.defineJQueryPlugin(Alert);return Alert;}));;

/* /web/static/lib/bootstrap/js/dist/button.js */
(function(global,factory){typeof exports==='object'&&typeof module!=='undefined'?module.exports=factory(require('./base-component.js'),require('./dom/event-handler.js'),require('./util/index.js')):typeof define==='function'&&define.amd?define(['./base-component','./dom/event-handler','./util/index'],factory):(global=typeof globalThis!=='undefined'?globalThis:global||self,global.Button=factory(global.BaseComponent,global.EventHandler,global.Index));})(this,(function(BaseComponent,EventHandler,index_js){'use strict';const NAME='button';const DATA_KEY='bs.button';const EVENT_KEY=`.${DATA_KEY}`;const DATA_API_KEY='.data-api';const CLASS_NAME_ACTIVE='active';const SELECTOR_DATA_TOGGLE='[data-bs-toggle="button"]';const EVENT_CLICK_DATA_API=`click${EVENT_KEY}${DATA_API_KEY}`;class Button extends BaseComponent{static get NAME(){return NAME;}
toggle(){this._element.setAttribute('aria-pressed',this._element.classList.toggle(CLASS_NAME_ACTIVE));}
static jQueryInterface(config){return this.each(function(){const data=Button.getOrCreateInstance(this);if(config==='toggle'){data[config]();}});}}
EventHandler.on(document,EVENT_CLICK_DATA_API,SELECTOR_DATA_TOGGLE,event=>{event.preventDefault();const button=event.target.closest(SELECTOR_DATA_TOGGLE);const data=Button.getOrCreateInstance(button);data.toggle();});index_js.defineJQueryPlugin(Button);return Button;}));;

/* /web/static/lib/bootstrap/js/dist/carousel.js */
(function(global,factory){typeof exports==='object'&&typeof module!=='undefined'?module.exports=factory(require('./base-component.js'),require('./dom/event-handler.js'),require('./dom/manipulator.js'),require('./dom/selector-engine.js'),require('./util/index.js'),require('./util/swipe.js')):typeof define==='function'&&define.amd?define(['./base-component','./dom/event-handler','./dom/manipulator','./dom/selector-engine','./util/index','./util/swipe'],factory):(global=typeof globalThis!=='undefined'?globalThis:global||self,global.Carousel=factory(global.BaseComponent,global.EventHandler,global.Manipulator,global.SelectorEngine,global.Index,global.Swipe));})(this,(function(BaseComponent,EventHandler,Manipulator,SelectorEngine,index_js,Swipe){'use strict';const NAME='carousel';const DATA_KEY='bs.carousel';const EVENT_KEY=`.${DATA_KEY}`;const DATA_API_KEY='.data-api';const ARROW_LEFT_KEY='ArrowLeft';const ARROW_RIGHT_KEY='ArrowRight';const TOUCHEVENT_COMPAT_WAIT=500;const ORDER_NEXT='next';const ORDER_PREV='prev';const DIRECTION_LEFT='left';const DIRECTION_RIGHT='right';const EVENT_SLIDE=`slide${EVENT_KEY}`;const EVENT_SLID=`slid${EVENT_KEY}`;const EVENT_KEYDOWN=`keydown${EVENT_KEY}`;const EVENT_MOUSEENTER=`mouseenter${EVENT_KEY}`;const EVENT_MOUSELEAVE=`mouseleave${EVENT_KEY}`;const EVENT_DRAG_START=`dragstart${EVENT_KEY}`;const EVENT_LOAD_DATA_API=`load${EVENT_KEY}${DATA_API_KEY}`;const EVENT_CLICK_DATA_API=`click${EVENT_KEY}${DATA_API_KEY}`;const CLASS_NAME_CAROUSEL='carousel';const CLASS_NAME_ACTIVE='active';const CLASS_NAME_SLIDE='slide';const CLASS_NAME_END='carousel-item-end';const CLASS_NAME_START='carousel-item-start';const CLASS_NAME_NEXT='carousel-item-next';const CLASS_NAME_PREV='carousel-item-prev';const SELECTOR_ACTIVE='.active';const SELECTOR_ITEM='.carousel-item';const SELECTOR_ACTIVE_ITEM=SELECTOR_ACTIVE+SELECTOR_ITEM;const SELECTOR_ITEM_IMG='.carousel-item img';const SELECTOR_INDICATORS='.carousel-indicators';const SELECTOR_DATA_SLIDE='[data-bs-slide], [data-bs-slide-to]';const SELECTOR_DATA_RIDE='[data-bs-ride="carousel"]';const KEY_TO_DIRECTION={[ARROW_LEFT_KEY]:DIRECTION_RIGHT,[ARROW_RIGHT_KEY]:DIRECTION_LEFT};const Default={interval:5000,keyboard:true,pause:'hover',ride:false,touch:true,wrap:true};const DefaultType={interval:'(number|boolean)',keyboard:'boolean',pause:'(string|boolean)',ride:'(boolean|string)',touch:'boolean',wrap:'boolean'};class Carousel extends BaseComponent{constructor(element,config){super(element,config);this._interval=null;this._activeElement=null;this._isSliding=false;this.touchTimeout=null;this._swipeHelper=null;this._indicatorsElement=SelectorEngine.findOne(SELECTOR_INDICATORS,this._element);this._addEventListeners();if(this._config.ride===CLASS_NAME_CAROUSEL){this.cycle();}}
static get Default(){return Default;}
static get DefaultType(){return DefaultType;}
static get NAME(){return NAME;}
next(){this._slide(ORDER_NEXT);}
nextWhenVisible(){if(!document.hidden&&index_js.isVisible(this._element)){this.next();}}
prev(){this._slide(ORDER_PREV);}
pause(){if(this._isSliding){index_js.triggerTransitionEnd(this._element);}
this._clearInterval();}
cycle(){this._clearInterval();this._updateInterval();this._interval=setInterval(()=>this.nextWhenVisible(),this._config.interval);}
_maybeEnableCycle(){if(!this._config.ride){return;}
if(this._isSliding){EventHandler.one(this._element,EVENT_SLID,()=>this.cycle());return;}
this.cycle();}
to(index){const items=this._getItems();if(index>items.length-1||index<0){return;}
if(this._isSliding){EventHandler.one(this._element,EVENT_SLID,()=>this.to(index));return;}
const activeIndex=this._getItemIndex(this._getActive());if(activeIndex===index){return;}
const order=index>activeIndex?ORDER_NEXT:ORDER_PREV;this._slide(order,items[index]);}
dispose(){if(this._swipeHelper){this._swipeHelper.dispose();}
super.dispose();}
_configAfterMerge(config){config.defaultInterval=config.interval;return config;}
_addEventListeners(){if(this._config.keyboard){EventHandler.on(this._element,EVENT_KEYDOWN,event=>this._keydown(event));}
if(this._config.pause==='hover'){EventHandler.on(this._element,EVENT_MOUSEENTER,()=>this.pause());EventHandler.on(this._element,EVENT_MOUSELEAVE,()=>this._maybeEnableCycle());}
if(this._config.touch&&Swipe.isSupported()){this._addTouchEventListeners();}}
_addTouchEventListeners(){for(const img of SelectorEngine.find(SELECTOR_ITEM_IMG,this._element)){EventHandler.on(img,EVENT_DRAG_START,event=>event.preventDefault());}
const endCallBack=()=>{if(this._config.pause!=='hover'){return;}
this.pause();if(this.touchTimeout){clearTimeout(this.touchTimeout);}
this.touchTimeout=setTimeout(()=>this._maybeEnableCycle(),TOUCHEVENT_COMPAT_WAIT+this._config.interval);};const swipeConfig={leftCallback:()=>this._slide(this._directionToOrder(DIRECTION_LEFT)),rightCallback:()=>this._slide(this._directionToOrder(DIRECTION_RIGHT)),endCallback:endCallBack};this._swipeHelper=new Swipe(this._element,swipeConfig);}
_keydown(event){if(/input|textarea/i.test(event.target.tagName)){return;}
const direction=KEY_TO_DIRECTION[event.key];if(direction){event.preventDefault();this._slide(this._directionToOrder(direction));}}
_getItemIndex(element){return this._getItems().indexOf(element);}
_setActiveIndicatorElement(index){if(!this._indicatorsElement){return;}
const activeIndicator=SelectorEngine.findOne(SELECTOR_ACTIVE,this._indicatorsElement);activeIndicator.classList.remove(CLASS_NAME_ACTIVE);activeIndicator.removeAttribute('aria-current');const newActiveIndicator=SelectorEngine.findOne(`[data-bs-slide-to="${index}"]`,this._indicatorsElement);if(newActiveIndicator){newActiveIndicator.classList.add(CLASS_NAME_ACTIVE);newActiveIndicator.setAttribute('aria-current','true');}}
_updateInterval(){const element=this._activeElement||this._getActive();if(!element){return;}
const elementInterval=Number.parseInt(element.getAttribute('data-bs-interval'),10);this._config.interval=elementInterval||this._config.defaultInterval;}
_slide(order,element=null){if(this._isSliding){return;}
const activeElement=this._getActive();const isNext=order===ORDER_NEXT;const nextElement=element||index_js.getNextActiveElement(this._getItems(),activeElement,isNext,this._config.wrap);if(nextElement===activeElement){return;}
const nextElementIndex=this._getItemIndex(nextElement);const triggerEvent=eventName=>{return EventHandler.trigger(this._element,eventName,{relatedTarget:nextElement,direction:this._orderToDirection(order),from:this._getItemIndex(activeElement),to:nextElementIndex});};const slideEvent=triggerEvent(EVENT_SLIDE);if(slideEvent.defaultPrevented){return;}
if(!activeElement||!nextElement){return;}
const isCycling=Boolean(this._interval);this.pause();this._isSliding=true;this._setActiveIndicatorElement(nextElementIndex);this._activeElement=nextElement;const directionalClassName=isNext?CLASS_NAME_START:CLASS_NAME_END;const orderClassName=isNext?CLASS_NAME_NEXT:CLASS_NAME_PREV;nextElement.classList.add(orderClassName);index_js.reflow(nextElement);activeElement.classList.add(directionalClassName);nextElement.classList.add(directionalClassName);const completeCallBack=()=>{nextElement.classList.remove(directionalClassName,orderClassName);nextElement.classList.add(CLASS_NAME_ACTIVE);activeElement.classList.remove(CLASS_NAME_ACTIVE,orderClassName,directionalClassName);this._isSliding=false;triggerEvent(EVENT_SLID);};this._queueCallback(completeCallBack,activeElement,this._isAnimated());if(isCycling){this.cycle();}}
_isAnimated(){return this._element.classList.contains(CLASS_NAME_SLIDE);}
_getActive(){return SelectorEngine.findOne(SELECTOR_ACTIVE_ITEM,this._element);}
_getItems(){return SelectorEngine.find(SELECTOR_ITEM,this._element);}
_clearInterval(){if(this._interval){clearInterval(this._interval);this._interval=null;}}
_directionToOrder(direction){if(index_js.isRTL()){return direction===DIRECTION_LEFT?ORDER_PREV:ORDER_NEXT;}
return direction===DIRECTION_LEFT?ORDER_NEXT:ORDER_PREV;}
_orderToDirection(order){if(index_js.isRTL()){return order===ORDER_PREV?DIRECTION_LEFT:DIRECTION_RIGHT;}
return order===ORDER_PREV?DIRECTION_RIGHT:DIRECTION_LEFT;}
static jQueryInterface(config){return this.each(function(){const data=Carousel.getOrCreateInstance(this,config);if(typeof config==='number'){data.to(config);return;}
if(typeof config==='string'){if(data[config]===undefined||config.startsWith('_')||config==='constructor'){throw new TypeError(`No method named "${config}"`);}
data[config]();}});}}
EventHandler.on(document,EVENT_CLICK_DATA_API,SELECTOR_DATA_SLIDE,function(event){const target=SelectorEngine.getElementFromSelector(this);if(!target||!target.classList.contains(CLASS_NAME_CAROUSEL)){return;}
event.preventDefault();const carousel=Carousel.getOrCreateInstance(target);const slideIndex=this.getAttribute('data-bs-slide-to');if(slideIndex){carousel.to(slideIndex);carousel._maybeEnableCycle();return;}
if(Manipulator.getDataAttribute(this,'slide')==='next'){carousel.next();carousel._maybeEnableCycle();return;}
carousel.prev();carousel._maybeEnableCycle();});EventHandler.on(window,EVENT_LOAD_DATA_API,()=>{const carousels=SelectorEngine.find(SELECTOR_DATA_RIDE);for(const carousel of carousels){Carousel.getOrCreateInstance(carousel);}});index_js.defineJQueryPlugin(Carousel);return Carousel;}));;

/* /web/static/lib/bootstrap/js/dist/collapse.js */
(function(global,factory){typeof exports==='object'&&typeof module!=='undefined'?module.exports=factory(require('./base-component.js'),require('./dom/event-handler.js'),require('./dom/selector-engine.js'),require('./util/index.js')):typeof define==='function'&&define.amd?define(['./base-component','./dom/event-handler','./dom/selector-engine','./util/index'],factory):(global=typeof globalThis!=='undefined'?globalThis:global||self,global.Collapse=factory(global.BaseComponent,global.EventHandler,global.SelectorEngine,global.Index));})(this,(function(BaseComponent,EventHandler,SelectorEngine,index_js){'use strict';const NAME='collapse';const DATA_KEY='bs.collapse';const EVENT_KEY=`.${DATA_KEY}`;const DATA_API_KEY='.data-api';const EVENT_SHOW=`show${EVENT_KEY}`;const EVENT_SHOWN=`shown${EVENT_KEY}`;const EVENT_HIDE=`hide${EVENT_KEY}`;const EVENT_HIDDEN=`hidden${EVENT_KEY}`;const EVENT_CLICK_DATA_API=`click${EVENT_KEY}${DATA_API_KEY}`;const CLASS_NAME_SHOW='show';const CLASS_NAME_COLLAPSE='collapse';const CLASS_NAME_COLLAPSING='collapsing';const CLASS_NAME_COLLAPSED='collapsed';const CLASS_NAME_DEEPER_CHILDREN=`:scope .${CLASS_NAME_COLLAPSE} .${CLASS_NAME_COLLAPSE}`;const CLASS_NAME_HORIZONTAL='collapse-horizontal';const WIDTH='width';const HEIGHT='height';const SELECTOR_ACTIVES='.collapse.show, .collapse.collapsing';const SELECTOR_DATA_TOGGLE='[data-bs-toggle="collapse"]';const Default={parent:null,toggle:true};const DefaultType={parent:'(null|element)',toggle:'boolean'};class Collapse extends BaseComponent{constructor(element,config){super(element,config);this._isTransitioning=false;this._triggerArray=[];const toggleList=SelectorEngine.find(SELECTOR_DATA_TOGGLE);for(const elem of toggleList){const selector=SelectorEngine.getSelectorFromElement(elem);const filterElement=SelectorEngine.find(selector).filter(foundElement=>foundElement===this._element);if(selector!==null&&filterElement.length){this._triggerArray.push(elem);}}
this._initializeChildren();if(!this._config.parent){this._addAriaAndCollapsedClass(this._triggerArray,this._isShown());}
if(this._config.toggle){this.toggle();}}
static get Default(){return Default;}
static get DefaultType(){return DefaultType;}
static get NAME(){return NAME;}
toggle(){if(this._isShown()){this.hide();}else{this.show();}}
show(){if(this._isTransitioning||this._isShown()){return;}
let activeChildren=[];if(this._config.parent){activeChildren=this._getFirstLevelChildren(SELECTOR_ACTIVES).filter(element=>element!==this._element).map(element=>Collapse.getOrCreateInstance(element,{toggle:false}));}
if(activeChildren.length&&activeChildren[0]._isTransitioning){return;}
const startEvent=EventHandler.trigger(this._element,EVENT_SHOW);if(startEvent.defaultPrevented){return;}
for(const activeInstance of activeChildren){activeInstance.hide();}
const dimension=this._getDimension();this._element.classList.remove(CLASS_NAME_COLLAPSE);this._element.classList.add(CLASS_NAME_COLLAPSING);this._element.style[dimension]=0;this._addAriaAndCollapsedClass(this._triggerArray,true);this._isTransitioning=true;const complete=()=>{this._isTransitioning=false;this._element.classList.remove(CLASS_NAME_COLLAPSING);this._element.classList.add(CLASS_NAME_COLLAPSE,CLASS_NAME_SHOW);this._element.style[dimension]='';EventHandler.trigger(this._element,EVENT_SHOWN);};const capitalizedDimension=dimension[0].toUpperCase()+dimension.slice(1);const scrollSize=`scroll${capitalizedDimension}`;this._queueCallback(complete,this._element,true);this._element.style[dimension]=`${this._element[scrollSize]}px`;}
hide(){if(this._isTransitioning||!this._isShown()){return;}
const startEvent=EventHandler.trigger(this._element,EVENT_HIDE);if(startEvent.defaultPrevented){return;}
const dimension=this._getDimension();this._element.style[dimension]=`${this._element.getBoundingClientRect()[dimension]}px`;index_js.reflow(this._element);this._element.classList.add(CLASS_NAME_COLLAPSING);this._element.classList.remove(CLASS_NAME_COLLAPSE,CLASS_NAME_SHOW);for(const trigger of this._triggerArray){const element=SelectorEngine.getElementFromSelector(trigger);if(element&&!this._isShown(element)){this._addAriaAndCollapsedClass([trigger],false);}}
this._isTransitioning=true;const complete=()=>{this._isTransitioning=false;this._element.classList.remove(CLASS_NAME_COLLAPSING);this._element.classList.add(CLASS_NAME_COLLAPSE);EventHandler.trigger(this._element,EVENT_HIDDEN);};this._element.style[dimension]='';this._queueCallback(complete,this._element,true);}
_isShown(element=this._element){return element.classList.contains(CLASS_NAME_SHOW);}
_configAfterMerge(config){config.toggle=Boolean(config.toggle);config.parent=index_js.getElement(config.parent);return config;}
_getDimension(){return this._element.classList.contains(CLASS_NAME_HORIZONTAL)?WIDTH:HEIGHT;}
_initializeChildren(){if(!this._config.parent){return;}
const children=this._getFirstLevelChildren(SELECTOR_DATA_TOGGLE);for(const element of children){const selected=SelectorEngine.getElementFromSelector(element);if(selected){this._addAriaAndCollapsedClass([element],this._isShown(selected));}}}
_getFirstLevelChildren(selector){const children=SelectorEngine.find(CLASS_NAME_DEEPER_CHILDREN,this._config.parent);return SelectorEngine.find(selector,this._config.parent).filter(element=>!children.includes(element));}
_addAriaAndCollapsedClass(triggerArray,isOpen){if(!triggerArray.length){return;}
for(const element of triggerArray){element.classList.toggle(CLASS_NAME_COLLAPSED,!isOpen);element.setAttribute('aria-expanded',isOpen);}}
static jQueryInterface(config){const _config={};if(typeof config==='string'&&/show|hide/.test(config)){_config.toggle=false;}
return this.each(function(){const data=Collapse.getOrCreateInstance(this,_config);if(typeof config==='string'){if(typeof data[config]==='undefined'){throw new TypeError(`No method named "${config}"`);}
data[config]();}});}}
EventHandler.on(document,EVENT_CLICK_DATA_API,SELECTOR_DATA_TOGGLE,function(event){if(event.target.tagName==='A'||event.delegateTarget&&event.delegateTarget.tagName==='A'){event.preventDefault();}
for(const element of SelectorEngine.getMultipleElementsFromSelector(this)){Collapse.getOrCreateInstance(element,{toggle:false}).toggle();}});index_js.defineJQueryPlugin(Collapse);return Collapse;}));;

/* /web/static/lib/bootstrap/js/dist/dropdown.js */
(function(global,factory){typeof exports==='object'&&typeof module!=='undefined'?module.exports=factory(require('@popperjs/core'),require('./base-component.js'),require('./dom/event-handler.js'),require('./dom/manipulator.js'),require('./dom/selector-engine.js'),require('./util/index.js')):typeof define==='function'&&define.amd?define(['@popperjs/core','./base-component','./dom/event-handler','./dom/manipulator','./dom/selector-engine','./util/index'],factory):(global=typeof globalThis!=='undefined'?globalThis:global||self,global.Dropdown=factory(global.Popper,global.BaseComponent,global.EventHandler,global.Manipulator,global.SelectorEngine,global.Index));})(this,(function(Popper,BaseComponent,EventHandler,Manipulator,SelectorEngine,index_js){'use strict';function _interopNamespaceDefault(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:'Module'}});if(e){for(const k in e){if(k!=='default'){const d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:()=>e[k]});}}}
n.default=e;return Object.freeze(n);}
const Popper__namespace=_interopNamespaceDefault(Popper);const NAME='dropdown';const DATA_KEY='bs.dropdown';const EVENT_KEY=`.${DATA_KEY}`;const DATA_API_KEY='.data-api';const ESCAPE_KEY='Escape';const TAB_KEY='Tab';const ARROW_UP_KEY='ArrowUp';const ARROW_DOWN_KEY='ArrowDown';const RIGHT_MOUSE_BUTTON=2;const EVENT_HIDE=`hide${EVENT_KEY}`;const EVENT_HIDDEN=`hidden${EVENT_KEY}`;const EVENT_SHOW=`show${EVENT_KEY}`;const EVENT_SHOWN=`shown${EVENT_KEY}`;const EVENT_CLICK_DATA_API=`click${EVENT_KEY}${DATA_API_KEY}`;const EVENT_KEYDOWN_DATA_API=`keydown${EVENT_KEY}${DATA_API_KEY}`;const EVENT_KEYUP_DATA_API=`keyup${EVENT_KEY}${DATA_API_KEY}`;const CLASS_NAME_SHOW='show';const CLASS_NAME_DROPUP='dropup';const CLASS_NAME_DROPEND='dropend';const CLASS_NAME_DROPSTART='dropstart';const CLASS_NAME_DROPUP_CENTER='dropup-center';const CLASS_NAME_DROPDOWN_CENTER='dropdown-center';const SELECTOR_DATA_TOGGLE='[data-bs-toggle="dropdown"]:not(.disabled):not(:disabled)';const SELECTOR_DATA_TOGGLE_SHOWN=`${SELECTOR_DATA_TOGGLE}.${CLASS_NAME_SHOW}`;const SELECTOR_MENU='.dropdown-menu:not(.o-dropdown--menu)';const SELECTOR_NAVBAR='.navbar';const SELECTOR_MENU_NOT_SUB='.dropdown-menu:not(.o-dropdown--menu):not(.o_wysiwyg_submenu)';const SELECTOR_NAVBAR_NAV='.navbar-nav';const SELECTOR_VISIBLE_ITEMS='.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)';const PLACEMENT_TOP=index_js.isRTL()?'top-end':'top-start';const PLACEMENT_TOPEND=index_js.isRTL()?'top-start':'top-end';const PLACEMENT_BOTTOM=index_js.isRTL()?'bottom-end':'bottom-start';const PLACEMENT_BOTTOMEND=index_js.isRTL()?'bottom-start':'bottom-end';const PLACEMENT_RIGHT=index_js.isRTL()?'left-start':'right-start';const PLACEMENT_LEFT=index_js.isRTL()?'right-start':'left-start';const PLACEMENT_TOPCENTER='top';const PLACEMENT_BOTTOMCENTER='bottom';const Default={autoClose:true,boundary:'clippingParents',display:'dynamic',offset:[0,2],popperConfig:null,reference:'toggle'};const DefaultType={autoClose:'(boolean|string)',boundary:'(string|element)',display:'string',offset:'(array|string|function)',popperConfig:'(null|object|function)',reference:'(string|element|object)'};class Dropdown extends BaseComponent{constructor(element,config){super(element,config);this._popper=null;this._parent=this._element.parentNode;this._menu=SelectorEngine.next(this._element,SELECTOR_MENU)[0]||SelectorEngine.prev(this._element,SELECTOR_MENU)[0]||SelectorEngine.findOne(SELECTOR_MENU,this._parent);this._inNavbar=this._detectNavbar();}
static get Default(){return Default;}
static get DefaultType(){return DefaultType;}
static get NAME(){return NAME;}
toggle(){return this._isShown()?this.hide():this.show();}
show(){if(index_js.isDisabled(this._element)||this._isShown()){return;}
const relatedTarget={relatedTarget:this._element};const showEvent=EventHandler.trigger(this._element,EVENT_SHOW,relatedTarget);if(showEvent.defaultPrevented){return;}
this._createPopper();if('ontouchstart'in document.documentElement&&!this._parent.closest(SELECTOR_NAVBAR_NAV)){for(const element of[].concat(...document.body.children)){EventHandler.on(element,'mouseover',index_js.noop);}}
this._element.focus();this._element.setAttribute('aria-expanded',true);this._menu.classList.add(CLASS_NAME_SHOW);this._element.classList.add(CLASS_NAME_SHOW);EventHandler.trigger(this._element,EVENT_SHOWN,relatedTarget);}
hide(){if(index_js.isDisabled(this._element)||!this._isShown()){return;}
const relatedTarget={relatedTarget:this._element};this._completeHide(relatedTarget);}
dispose(){if(this._popper){this._popper.destroy();}
super.dispose();}
update(){this._inNavbar=this._detectNavbar();if(this._popper){this._popper.update();}}
_completeHide(relatedTarget){const hideEvent=EventHandler.trigger(this._element,EVENT_HIDE,relatedTarget);if(hideEvent.defaultPrevented){return;}
if('ontouchstart'in document.documentElement){for(const element of[].concat(...document.body.children)){EventHandler.off(element,'mouseover',index_js.noop);}}
if(this._popper){this._popper.destroy();}
this._menu.classList.remove(CLASS_NAME_SHOW);this._element.classList.remove(CLASS_NAME_SHOW);this._element.setAttribute('aria-expanded','false');Manipulator.removeDataAttribute(this._menu,'popper');EventHandler.trigger(this._element,EVENT_HIDDEN,relatedTarget);}
_getConfig(config){config=super._getConfig(config);if(typeof config.reference==='object'&&!index_js.isElement(config.reference)&&typeof config.reference.getBoundingClientRect!=='function'){throw new TypeError(`${NAME.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`);}
return config;}
_createPopper(){if(typeof Popper__namespace==='undefined'){throw new TypeError('Bootstrap\'s dropdowns require Popper (https://popper.js.org)');}
let referenceElement=this._element;if(this._config.reference==='parent'){referenceElement=this._parent;}else if(index_js.isElement(this._config.reference)){referenceElement=index_js.getElement(this._config.reference);}else if(typeof this._config.reference==='object'){referenceElement=this._config.reference;}
const popperConfig=this._getPopperConfig();this._popper=Popper__namespace.createPopper(referenceElement,this._menu,popperConfig);}
_isShown(){return this._menu.classList.contains(CLASS_NAME_SHOW);}
_getPlacement(){const parentDropdown=this._parent;if(parentDropdown.classList.contains(CLASS_NAME_DROPEND)){return PLACEMENT_RIGHT;}
if(parentDropdown.classList.contains(CLASS_NAME_DROPSTART)){return PLACEMENT_LEFT;}
if(parentDropdown.classList.contains(CLASS_NAME_DROPUP_CENTER)){return PLACEMENT_TOPCENTER;}
if(parentDropdown.classList.contains(CLASS_NAME_DROPDOWN_CENTER)){return PLACEMENT_BOTTOMCENTER;}
const isEnd=getComputedStyle(this._menu).getPropertyValue('--bs-position').trim()==='end';if(parentDropdown.classList.contains(CLASS_NAME_DROPUP)){return isEnd?PLACEMENT_TOPEND:PLACEMENT_TOP;}
return isEnd?PLACEMENT_BOTTOMEND:PLACEMENT_BOTTOM;}
_detectNavbar(){return this._element.closest(SELECTOR_NAVBAR)!==null;}
_getOffset(){const{offset}=this._config;if(typeof offset==='string'){return offset.split(',').map(value=>Number.parseInt(value,10));}
if(typeof offset==='function'){return popperData=>offset(popperData,this._element);}
return offset;}
_getPopperConfig(){const defaultBsPopperConfig={placement:this._getPlacement(),modifiers:[{name:'preventOverflow',options:{boundary:this._config.boundary}},{name:'offset',options:{offset:this._getOffset()}}]};if(this._inNavbar||this._config.display==='static'){Manipulator.setDataAttribute(this._menu,'popper','static');defaultBsPopperConfig.modifiers=[{name:'applyStyles',enabled:false}];}
return{...defaultBsPopperConfig,...index_js.execute(this._config.popperConfig,[defaultBsPopperConfig])};}
_selectMenuItem({key,target}){const items=SelectorEngine.find(SELECTOR_VISIBLE_ITEMS,this._menu).filter(element=>index_js.isVisible(element));if(!items.length){return;}
index_js.getNextActiveElement(items,target,key===ARROW_DOWN_KEY,!items.includes(target)).focus();}
static jQueryInterface(config){return this.each(function(){const data=Dropdown.getOrCreateInstance(this,config);if(typeof config!=='string'){return;}
if(typeof data[config]==='undefined'){throw new TypeError(`No method named "${config}"`);}
data[config]();});}
static clearMenus(event){if(event.button===RIGHT_MOUSE_BUTTON||event.type==='keyup'&&event.key!==TAB_KEY){return;}
const openToggles=SelectorEngine.find(SELECTOR_DATA_TOGGLE_SHOWN);for(const toggle of openToggles){const context=Dropdown.getInstance(toggle);if(!context||context._config.autoClose===false){continue;}
const composedPath=event.composedPath();const isMenuTarget=composedPath.includes(context._menu);if(composedPath.includes(context._element)||context._config.autoClose==='inside'&&!isMenuTarget||context._config.autoClose==='outside'&&isMenuTarget){continue;}
if(context._menu.contains(event.target)&&(event.type==='keyup'&&event.key===TAB_KEY||/input|select|option|textarea|form/i.test(event.target.tagName))){continue;}
const relatedTarget={relatedTarget:context._element};if(event.type==='click'){relatedTarget.clickEvent=event;}
context._completeHide(relatedTarget);}}
static dataApiKeydownHandler(event){const isInput=/input|textarea/i.test(event.target.tagName);const isEscapeEvent=event.key===ESCAPE_KEY;const isUpOrDownEvent=[ARROW_UP_KEY,ARROW_DOWN_KEY].includes(event.key);if(!isUpOrDownEvent&&!isEscapeEvent){return;}
if(isInput&&!isEscapeEvent){return;}
event.preventDefault();const getToggleButton=this.matches(SELECTOR_DATA_TOGGLE)?this:SelectorEngine.prev(this,SELECTOR_DATA_TOGGLE)[0]||SelectorEngine.next(this,SELECTOR_DATA_TOGGLE)[0]||SelectorEngine.findOne(SELECTOR_DATA_TOGGLE,event.delegateTarget.parentNode);const instance=Dropdown.getOrCreateInstance(getToggleButton);if(isUpOrDownEvent){event.stopPropagation();instance.show();instance._selectMenuItem(event);return;}
if(instance._isShown()){event.stopPropagation();instance.hide();getToggleButton.focus();}}}
EventHandler.on(document,EVENT_KEYDOWN_DATA_API,SELECTOR_DATA_TOGGLE,Dropdown.dataApiKeydownHandler);EventHandler.on(document,EVENT_KEYDOWN_DATA_API,SELECTOR_MENU_NOT_SUB,Dropdown.dataApiKeydownHandler);EventHandler.on(document,EVENT_CLICK_DATA_API,Dropdown.clearMenus);EventHandler.on(document,EVENT_KEYUP_DATA_API,Dropdown.clearMenus);EventHandler.on(document,EVENT_CLICK_DATA_API,SELECTOR_DATA_TOGGLE,function(event){event.preventDefault();Dropdown.getOrCreateInstance(this).toggle();});index_js.defineJQueryPlugin(Dropdown);return Dropdown;}));;

/* /web/static/lib/bootstrap/js/dist/modal.js */
(function(global,factory){typeof exports==='object'&&typeof module!=='undefined'?module.exports=factory(require('./base-component.js'),require('./dom/event-handler.js'),require('./dom/selector-engine.js'),require('./util/backdrop.js'),require('./util/component-functions.js'),require('./util/focustrap.js'),require('./util/index.js'),require('./util/scrollbar.js')):typeof define==='function'&&define.amd?define(['./base-component','./dom/event-handler','./dom/selector-engine','./util/backdrop','./util/component-functions','./util/focustrap','./util/index','./util/scrollbar'],factory):(global=typeof globalThis!=='undefined'?globalThis:global||self,global.Modal=factory(global.BaseComponent,global.EventHandler,global.SelectorEngine,global.Backdrop,global.ComponentFunctions,global.Focustrap,global.Index,global.Scrollbar));})(this,(function(BaseComponent,EventHandler,SelectorEngine,Backdrop,componentFunctions_js,FocusTrap,index_js,ScrollBarHelper){'use strict';const NAME='modal';const DATA_KEY='bs.modal';const EVENT_KEY=`.${DATA_KEY}`;const DATA_API_KEY='.data-api';const ESCAPE_KEY='Escape';const EVENT_HIDE=`hide${EVENT_KEY}`;const EVENT_HIDE_PREVENTED=`hidePrevented${EVENT_KEY}`;const EVENT_HIDDEN=`hidden${EVENT_KEY}`;const EVENT_SHOW=`show${EVENT_KEY}`;const EVENT_SHOWN=`shown${EVENT_KEY}`;const EVENT_RESIZE=`resize${EVENT_KEY}`;const EVENT_CLICK_DISMISS=`click.dismiss${EVENT_KEY}`;const EVENT_MOUSEDOWN_DISMISS=`mousedown.dismiss${EVENT_KEY}`;const EVENT_KEYDOWN_DISMISS=`keydown.dismiss${EVENT_KEY}`;const EVENT_CLICK_DATA_API=`click${EVENT_KEY}${DATA_API_KEY}`;const CLASS_NAME_OPEN='modal-open';const CLASS_NAME_FADE='fade';const CLASS_NAME_SHOW='show';const CLASS_NAME_STATIC='modal-static';const OPEN_SELECTOR='.modal.show';const SELECTOR_DIALOG='.modal-dialog';const SELECTOR_MODAL_BODY='.modal-body';const SELECTOR_DATA_TOGGLE='[data-bs-toggle="modal"]';const Default={backdrop:true,focus:true,keyboard:true};const DefaultType={backdrop:'(boolean|string)',focus:'boolean',keyboard:'boolean'};class Modal extends BaseComponent{constructor(element,config){super(element,config);this._dialog=SelectorEngine.findOne(SELECTOR_DIALOG,this._element);this._backdrop=this._initializeBackDrop();this._focustrap=this._initializeFocusTrap();this._isShown=false;this._isTransitioning=false;this._scrollBar=new ScrollBarHelper();this._addEventListeners();}
static get Default(){return Default;}
static get DefaultType(){return DefaultType;}
static get NAME(){return NAME;}
toggle(relatedTarget){return this._isShown?this.hide():this.show(relatedTarget);}
show(relatedTarget){if(this._isShown||this._isTransitioning){return;}
const showEvent=EventHandler.trigger(this._element,EVENT_SHOW,{relatedTarget});if(showEvent.defaultPrevented){return;}
this._isShown=true;this._isTransitioning=true;this._scrollBar.hide();document.body.classList.add(CLASS_NAME_OPEN);this._adjustDialog();this._backdrop.show(()=>this._showElement(relatedTarget));}
hide(){if(!this._isShown||this._isTransitioning){return;}
const hideEvent=EventHandler.trigger(this._element,EVENT_HIDE);if(hideEvent.defaultPrevented){return;}
this._isShown=false;this._isTransitioning=true;this._focustrap.deactivate();this._element.classList.remove(CLASS_NAME_SHOW);this._queueCallback(()=>this._hideModal(),this._element,this._isAnimated());}
dispose(){EventHandler.off(window,EVENT_KEY);EventHandler.off(this._dialog,EVENT_KEY);this._backdrop.dispose();this._focustrap.deactivate();super.dispose();}
handleUpdate(){this._adjustDialog();}
_initializeBackDrop(){return new Backdrop({isVisible:Boolean(this._config.backdrop),isAnimated:this._isAnimated()});}
_initializeFocusTrap(){return new FocusTrap({trapElement:this._element});}
_showElement(relatedTarget){if(!document.body.contains(this._element)){document.body.append(this._element);}
this._element.style.display='block';this._element.removeAttribute('aria-hidden');this._element.setAttribute('aria-modal',true);this._element.setAttribute('role','dialog');this._element.scrollTop=0;const modalBody=SelectorEngine.findOne(SELECTOR_MODAL_BODY,this._dialog);if(modalBody){modalBody.scrollTop=0;}
index_js.reflow(this._element);this._element.classList.add(CLASS_NAME_SHOW);const transitionComplete=()=>{if(this._config.focus){this._focustrap.activate();}
this._isTransitioning=false;EventHandler.trigger(this._element,EVENT_SHOWN,{relatedTarget});};this._queueCallback(transitionComplete,this._dialog,this._isAnimated());}
_addEventListeners(){EventHandler.on(this._element,EVENT_KEYDOWN_DISMISS,event=>{if(event.key!==ESCAPE_KEY){return;}
if(this._config.keyboard){this.hide();return;}
this._triggerBackdropTransition();});EventHandler.on(window,EVENT_RESIZE,()=>{if(this._isShown&&!this._isTransitioning){this._adjustDialog();}});EventHandler.on(this._element,EVENT_MOUSEDOWN_DISMISS,event=>{EventHandler.one(this._element,EVENT_CLICK_DISMISS,event2=>{if(this._element!==event.target||this._element!==event2.target){return;}
if(this._config.backdrop==='static'){this._triggerBackdropTransition();return;}
if(this._config.backdrop){this.hide();}});});}
_hideModal(){this._element.style.display='none';this._element.setAttribute('aria-hidden',true);this._element.removeAttribute('aria-modal');this._element.removeAttribute('role');this._isTransitioning=false;this._backdrop.hide(()=>{document.body.classList.remove(CLASS_NAME_OPEN);this._resetAdjustments();this._scrollBar.reset();EventHandler.trigger(this._element,EVENT_HIDDEN);});}
_isAnimated(){return this._element.classList.contains(CLASS_NAME_FADE);}
_triggerBackdropTransition(){const hideEvent=EventHandler.trigger(this._element,EVENT_HIDE_PREVENTED);if(hideEvent.defaultPrevented){return;}
const isModalOverflowing=this._element.scrollHeight>document.documentElement.clientHeight;const initialOverflowY=this._element.style.overflowY;if(initialOverflowY==='hidden'||this._element.classList.contains(CLASS_NAME_STATIC)){return;}
if(!isModalOverflowing){this._element.style.overflowY='hidden';}
this._element.classList.add(CLASS_NAME_STATIC);this._queueCallback(()=>{this._element.classList.remove(CLASS_NAME_STATIC);this._queueCallback(()=>{this._element.style.overflowY=initialOverflowY;},this._dialog);},this._dialog);this._element.focus();}
_adjustDialog(){const isModalOverflowing=this._element.scrollHeight>document.documentElement.clientHeight;const scrollbarWidth=this._scrollBar.getWidth();const isBodyOverflowing=scrollbarWidth>0;if(isBodyOverflowing&&!isModalOverflowing){const property=index_js.isRTL()?'paddingLeft':'paddingRight';this._element.style[property]=`${scrollbarWidth}px`;}
if(!isBodyOverflowing&&isModalOverflowing){const property=index_js.isRTL()?'paddingRight':'paddingLeft';this._element.style[property]=`${scrollbarWidth}px`;}}
_resetAdjustments(){this._element.style.paddingLeft='';this._element.style.paddingRight='';}
static jQueryInterface(config,relatedTarget){return this.each(function(){const data=Modal.getOrCreateInstance(this,config);if(typeof config!=='string'){return;}
if(typeof data[config]==='undefined'){throw new TypeError(`No method named "${config}"`);}
data[config](relatedTarget);});}}
EventHandler.on(document,EVENT_CLICK_DATA_API,SELECTOR_DATA_TOGGLE,function(event){const target=SelectorEngine.getElementFromSelector(this);if(['A','AREA'].includes(this.tagName)){event.preventDefault();}
EventHandler.one(target,EVENT_SHOW,showEvent=>{if(showEvent.defaultPrevented){return;}
EventHandler.one(target,EVENT_HIDDEN,()=>{if(index_js.isVisible(this)){this.focus();}});});const alreadyOpen=SelectorEngine.findOne(OPEN_SELECTOR);if(alreadyOpen){Modal.getInstance(alreadyOpen).hide();}
const data=Modal.getOrCreateInstance(target);data.toggle(this);});componentFunctions_js.enableDismissTrigger(Modal);index_js.defineJQueryPlugin(Modal);return Modal;}));;

/* /web/static/lib/bootstrap/js/dist/offcanvas.js */
(function(global,factory){typeof exports==='object'&&typeof module!=='undefined'?module.exports=factory(require('./base-component.js'),require('./dom/event-handler.js'),require('./dom/selector-engine.js'),require('./util/backdrop.js'),require('./util/component-functions.js'),require('./util/focustrap.js'),require('./util/index.js'),require('./util/scrollbar.js')):typeof define==='function'&&define.amd?define(['./base-component','./dom/event-handler','./dom/selector-engine','./util/backdrop','./util/component-functions','./util/focustrap','./util/index','./util/scrollbar'],factory):(global=typeof globalThis!=='undefined'?globalThis:global||self,global.Offcanvas=factory(global.BaseComponent,global.EventHandler,global.SelectorEngine,global.Backdrop,global.ComponentFunctions,global.Focustrap,global.Index,global.Scrollbar));})(this,(function(BaseComponent,EventHandler,SelectorEngine,Backdrop,componentFunctions_js,FocusTrap,index_js,ScrollBarHelper){'use strict';const NAME='offcanvas';const DATA_KEY='bs.offcanvas';const EVENT_KEY=`.${DATA_KEY}`;const DATA_API_KEY='.data-api';const EVENT_LOAD_DATA_API=`load${EVENT_KEY}${DATA_API_KEY}`;const ESCAPE_KEY='Escape';const CLASS_NAME_SHOW='show';const CLASS_NAME_SHOWING='showing';const CLASS_NAME_HIDING='hiding';const CLASS_NAME_BACKDROP='offcanvas-backdrop';const OPEN_SELECTOR='.offcanvas.show';const EVENT_SHOW=`show${EVENT_KEY}`;const EVENT_SHOWN=`shown${EVENT_KEY}`;const EVENT_HIDE=`hide${EVENT_KEY}`;const EVENT_HIDE_PREVENTED=`hidePrevented${EVENT_KEY}`;const EVENT_HIDDEN=`hidden${EVENT_KEY}`;const EVENT_RESIZE=`resize${EVENT_KEY}`;const EVENT_CLICK_DATA_API=`click${EVENT_KEY}${DATA_API_KEY}`;const EVENT_KEYDOWN_DISMISS=`keydown.dismiss${EVENT_KEY}`;const SELECTOR_DATA_TOGGLE='[data-bs-toggle="offcanvas"]';const Default={backdrop:true,keyboard:true,scroll:false};const DefaultType={backdrop:'(boolean|string)',keyboard:'boolean',scroll:'boolean'};class Offcanvas extends BaseComponent{constructor(element,config){super(element,config);this._isShown=false;this._backdrop=this._initializeBackDrop();this._focustrap=this._initializeFocusTrap();this._addEventListeners();}
static get Default(){return Default;}
static get DefaultType(){return DefaultType;}
static get NAME(){return NAME;}
toggle(relatedTarget){return this._isShown?this.hide():this.show(relatedTarget);}
show(relatedTarget){if(this._isShown){return;}
const showEvent=EventHandler.trigger(this._element,EVENT_SHOW,{relatedTarget});if(showEvent.defaultPrevented){return;}
this._isShown=true;this._backdrop.show();if(!this._config.scroll){new ScrollBarHelper().hide();}
this._element.setAttribute('aria-modal',true);this._element.setAttribute('role','dialog');this._element.classList.add(CLASS_NAME_SHOWING);const completeCallBack=()=>{if(!this._config.scroll||this._config.backdrop){this._focustrap.activate();}
this._element.classList.add(CLASS_NAME_SHOW);this._element.classList.remove(CLASS_NAME_SHOWING);EventHandler.trigger(this._element,EVENT_SHOWN,{relatedTarget});};this._queueCallback(completeCallBack,this._element,true);}
hide(){if(!this._isShown){return;}
const hideEvent=EventHandler.trigger(this._element,EVENT_HIDE);if(hideEvent.defaultPrevented){return;}
this._focustrap.deactivate();this._element.blur();this._isShown=false;this._element.classList.add(CLASS_NAME_HIDING);this._backdrop.hide();const completeCallback=()=>{this._element.classList.remove(CLASS_NAME_SHOW,CLASS_NAME_HIDING);this._element.removeAttribute('aria-modal');this._element.removeAttribute('role');if(!this._config.scroll){new ScrollBarHelper().reset();}
EventHandler.trigger(this._element,EVENT_HIDDEN);};this._queueCallback(completeCallback,this._element,true);}
dispose(){this._backdrop.dispose();this._focustrap.deactivate();super.dispose();}
_initializeBackDrop(){const clickCallback=()=>{if(this._config.backdrop==='static'){EventHandler.trigger(this._element,EVENT_HIDE_PREVENTED);return;}
this.hide();};const isVisible=Boolean(this._config.backdrop);return new Backdrop({className:CLASS_NAME_BACKDROP,isVisible,isAnimated:true,rootElement:this._element.parentNode,clickCallback:isVisible?clickCallback:null});}
_initializeFocusTrap(){return new FocusTrap({trapElement:this._element});}
_addEventListeners(){EventHandler.on(this._element,EVENT_KEYDOWN_DISMISS,event=>{if(event.key!==ESCAPE_KEY){return;}
if(this._config.keyboard){this.hide();return;}
EventHandler.trigger(this._element,EVENT_HIDE_PREVENTED);});}
static jQueryInterface(config){return this.each(function(){const data=Offcanvas.getOrCreateInstance(this,config);if(typeof config!=='string'){return;}
if(data[config]===undefined||config.startsWith('_')||config==='constructor'){throw new TypeError(`No method named "${config}"`);}
data[config](this);});}}
EventHandler.on(document,EVENT_CLICK_DATA_API,SELECTOR_DATA_TOGGLE,function(event){const target=SelectorEngine.getElementFromSelector(this);if(['A','AREA'].includes(this.tagName)){event.preventDefault();}
if(index_js.isDisabled(this)){return;}
EventHandler.one(target,EVENT_HIDDEN,()=>{if(index_js.isVisible(this)){this.focus();}});const alreadyOpen=SelectorEngine.findOne(OPEN_SELECTOR);if(alreadyOpen&&alreadyOpen!==target){Offcanvas.getInstance(alreadyOpen).hide();}
const data=Offcanvas.getOrCreateInstance(target);data.toggle(this);});EventHandler.on(window,EVENT_LOAD_DATA_API,()=>{for(const selector of SelectorEngine.find(OPEN_SELECTOR)){Offcanvas.getOrCreateInstance(selector).show();}});EventHandler.on(window,EVENT_RESIZE,()=>{for(const element of SelectorEngine.find('[aria-modal][class*=show][class*=offcanvas-]')){if(getComputedStyle(element).position!=='fixed'){Offcanvas.getOrCreateInstance(element).hide();}}});componentFunctions_js.enableDismissTrigger(Offcanvas);index_js.defineJQueryPlugin(Offcanvas);return Offcanvas;}));;

/* /web/static/lib/bootstrap/js/dist/tooltip.js */
(function(global,factory){typeof exports==='object'&&typeof module!=='undefined'?module.exports=factory(require('@popperjs/core'),require('./base-component.js'),require('./dom/event-handler.js'),require('./dom/manipulator.js'),require('./util/index.js'),require('./util/sanitizer.js'),require('./util/template-factory.js')):typeof define==='function'&&define.amd?define(['@popperjs/core','./base-component','./dom/event-handler','./dom/manipulator','./util/index','./util/sanitizer','./util/template-factory'],factory):(global=typeof globalThis!=='undefined'?globalThis:global||self,global.Tooltip=factory(global.Popper,global.BaseComponent,global.EventHandler,global.Manipulator,global.Index,global.Sanitizer,global.TemplateFactory));})(this,(function(Popper,BaseComponent,EventHandler,Manipulator,index_js,sanitizer_js,TemplateFactory){'use strict';function _interopNamespaceDefault(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:'Module'}});if(e){for(const k in e){if(k!=='default'){const d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:()=>e[k]});}}}
n.default=e;return Object.freeze(n);}
const Popper__namespace=_interopNamespaceDefault(Popper);const NAME='tooltip';const DISALLOWED_ATTRIBUTES=new Set(['sanitize','allowList','sanitizeFn']);const CLASS_NAME_FADE='fade';const CLASS_NAME_MODAL='modal';const CLASS_NAME_SHOW='show';const SELECTOR_TOOLTIP_INNER='.tooltip-inner';const SELECTOR_MODAL=`.${CLASS_NAME_MODAL}`;const EVENT_MODAL_HIDE='hide.bs.modal';const TRIGGER_HOVER='hover';const TRIGGER_FOCUS='focus';const TRIGGER_CLICK='click';const TRIGGER_MANUAL='manual';const EVENT_HIDE='hide';const EVENT_HIDDEN='hidden';const EVENT_SHOW='show';const EVENT_SHOWN='shown';const EVENT_INSERTED='inserted';const EVENT_CLICK='click';const EVENT_FOCUSIN='focusin';const EVENT_FOCUSOUT='focusout';const EVENT_MOUSEENTER='mouseenter';const EVENT_MOUSELEAVE='mouseleave';const AttachmentMap={AUTO:'auto',TOP:'top',RIGHT:index_js.isRTL()?'left':'right',BOTTOM:'bottom',LEFT:index_js.isRTL()?'right':'left'};const Default={allowList:sanitizer_js.DefaultAllowlist,animation:true,boundary:'clippingParents',container:false,customClass:'',delay:0,fallbackPlacements:['top','right','bottom','left'],html:false,offset:[0,6],placement:'top',popperConfig:null,sanitize:true,sanitizeFn:null,selector:false,template:'<div class="tooltip" role="tooltip">'+'<div class="tooltip-arrow"></div>'+'<div class="tooltip-inner"></div>'+'</div>',title:'',trigger:'hover focus'};const DefaultType={allowList:'object',animation:'boolean',boundary:'(string|element)',container:'(string|element|boolean)',customClass:'(string|function)',delay:'(number|object)',fallbackPlacements:'array',html:'boolean',offset:'(array|string|function)',placement:'(string|function)',popperConfig:'(null|object|function)',sanitize:'boolean',sanitizeFn:'(null|function)',selector:'(string|boolean)',template:'string',title:'(string|element|function)',trigger:'string'};class Tooltip extends BaseComponent{constructor(element,config){if(typeof Popper__namespace==='undefined'){throw new TypeError('Bootstrap\'s tooltips require Popper (https://popper.js.org)');}
super(element,config);this._isEnabled=true;this._timeout=0;this._isHovered=null;this._activeTrigger={};this._popper=null;this._templateFactory=null;this._newContent=null;this.tip=null;this._setListeners();if(!this._config.selector){this._fixTitle();}}
static get Default(){return Default;}
static get DefaultType(){return DefaultType;}
static get NAME(){return NAME;}
enable(){this._isEnabled=true;}
disable(){this._isEnabled=false;}
toggleEnabled(){this._isEnabled=!this._isEnabled;}
toggle(){if(!this._isEnabled){return;}
this._activeTrigger.click=!this._activeTrigger.click;if(this._isShown()){this._leave();return;}
this._enter();}
dispose(){clearTimeout(this._timeout);EventHandler.off(this._element.closest(SELECTOR_MODAL),EVENT_MODAL_HIDE,this._hideModalHandler);if(this._element.getAttribute('data-bs-original-title')){this._element.setAttribute('title',this._element.getAttribute('data-bs-original-title'));}
this._disposePopper();super.dispose();}
show(){if(this._element.style.display==='none'){throw new Error('Please use show on visible elements');}
if(!(this._isWithContent()&&this._isEnabled)){return;}
const showEvent=EventHandler.trigger(this._element,this.constructor.eventName(EVENT_SHOW));const shadowRoot=index_js.findShadowRoot(this._element);const isInTheDom=(shadowRoot||this._element.ownerDocument.documentElement).contains(this._element);if(showEvent.defaultPrevented||!isInTheDom){return;}
this._disposePopper();const tip=this._getTipElement();this._element.setAttribute('aria-describedby',tip.getAttribute('id'));const{container}=this._config;if(!this._element.ownerDocument.documentElement.contains(this.tip)){container.append(tip);EventHandler.trigger(this._element,this.constructor.eventName(EVENT_INSERTED));}
this._popper=this._createPopper(tip);tip.classList.add(CLASS_NAME_SHOW);if('ontouchstart'in document.documentElement){for(const element of[].concat(...document.body.children)){EventHandler.on(element,'mouseover',index_js.noop);}}
const complete=()=>{EventHandler.trigger(this._element,this.constructor.eventName(EVENT_SHOWN));if(this._isHovered===false){this._leave();}
this._isHovered=false;};this._queueCallback(complete,this.tip,this._isAnimated());}
hide(){if(!this._isShown()){return;}
const hideEvent=EventHandler.trigger(this._element,this.constructor.eventName(EVENT_HIDE));if(hideEvent.defaultPrevented){return;}
const tip=this._getTipElement();tip.classList.remove(CLASS_NAME_SHOW);if('ontouchstart'in document.documentElement){for(const element of[].concat(...document.body.children)){EventHandler.off(element,'mouseover',index_js.noop);}}
this._activeTrigger[TRIGGER_CLICK]=false;this._activeTrigger[TRIGGER_FOCUS]=false;this._activeTrigger[TRIGGER_HOVER]=false;this._isHovered=null;const complete=()=>{if(this._isWithActiveTrigger()){return;}
if(!this._isHovered){this._disposePopper();}
this._element.removeAttribute('aria-describedby');EventHandler.trigger(this._element,this.constructor.eventName(EVENT_HIDDEN));};this._queueCallback(complete,this.tip,this._isAnimated());}
update(){if(this._popper){this._popper.update();}}
_isWithContent(){return Boolean(this._getTitle());}
_getTipElement(){if(!this.tip){this.tip=this._createTipElement(this._newContent||this._getContentForTemplate());}
return this.tip;}
_createTipElement(content){const tip=this._getTemplateFactory(content).toHtml();if(!tip){return null;}
tip.classList.remove(CLASS_NAME_FADE,CLASS_NAME_SHOW);tip.classList.add(`bs-${this.constructor.NAME}-auto`);const tipId=index_js.getUID(this.constructor.NAME).toString();tip.setAttribute('id',tipId);if(this._isAnimated()){tip.classList.add(CLASS_NAME_FADE);}
return tip;}
setContent(content){this._newContent=content;if(this._isShown()){this._disposePopper();this.show();}}
_getTemplateFactory(content){if(this._templateFactory){this._templateFactory.changeContent(content);}else{this._templateFactory=new TemplateFactory({...this._config,content,extraClass:this._resolvePossibleFunction(this._config.customClass)});}
return this._templateFactory;}
_getContentForTemplate(){return{[SELECTOR_TOOLTIP_INNER]:this._getTitle()};}
_getTitle(){return this._resolvePossibleFunction(this._config.title)||this._element.getAttribute('data-bs-original-title');}
_initializeOnDelegatedTarget(event){return this.constructor.getOrCreateInstance(event.delegateTarget,this._getDelegateConfig());}
_isAnimated(){return this._config.animation||this.tip&&this.tip.classList.contains(CLASS_NAME_FADE);}
_isShown(){return this.tip&&this.tip.classList.contains(CLASS_NAME_SHOW);}
_createPopper(tip){const placement=index_js.execute(this._config.placement,[this,tip,this._element]);const attachment=AttachmentMap[placement.toUpperCase()];return Popper__namespace.createPopper(this._element,tip,this._getPopperConfig(attachment));}
_getOffset(){const{offset}=this._config;if(typeof offset==='string'){return offset.split(',').map(value=>Number.parseInt(value,10));}
if(typeof offset==='function'){return popperData=>offset(popperData,this._element);}
return offset;}
_resolvePossibleFunction(arg){return index_js.execute(arg,[this._element]);}
_getPopperConfig(attachment){const defaultBsPopperConfig={placement:attachment,modifiers:[{name:'flip',options:{fallbackPlacements:this._config.fallbackPlacements}},{name:'offset',options:{offset:this._getOffset()}},{name:'preventOverflow',options:{boundary:this._config.boundary}},{name:'arrow',options:{element:`.${this.constructor.NAME}-arrow`}},{name:'preSetPlacement',enabled:true,phase:'beforeMain',fn:data=>{this._getTipElement().setAttribute('data-popper-placement',data.state.placement);}}]};return{...defaultBsPopperConfig,...index_js.execute(this._config.popperConfig,[defaultBsPopperConfig])};}
_setListeners(){const triggers=this._config.trigger.split(' ');for(const trigger of triggers){if(trigger==='click'){EventHandler.on(this._element,this.constructor.eventName(EVENT_CLICK),this._config.selector,event=>{const context=this._initializeOnDelegatedTarget(event);context.toggle();});}else if(trigger!==TRIGGER_MANUAL){const eventIn=trigger===TRIGGER_HOVER?this.constructor.eventName(EVENT_MOUSEENTER):this.constructor.eventName(EVENT_FOCUSIN);const eventOut=trigger===TRIGGER_HOVER?this.constructor.eventName(EVENT_MOUSELEAVE):this.constructor.eventName(EVENT_FOCUSOUT);EventHandler.on(this._element,eventIn,this._config.selector,event=>{const context=this._initializeOnDelegatedTarget(event);context._activeTrigger[event.type==='focusin'?TRIGGER_FOCUS:TRIGGER_HOVER]=true;context._enter();});EventHandler.on(this._element,eventOut,this._config.selector,event=>{const context=this._initializeOnDelegatedTarget(event);context._activeTrigger[event.type==='focusout'?TRIGGER_FOCUS:TRIGGER_HOVER]=context._element.contains(event.relatedTarget);context._leave();});}}
this._hideModalHandler=()=>{if(this._element){this.hide();}};EventHandler.on(this._element.closest(SELECTOR_MODAL),EVENT_MODAL_HIDE,this._hideModalHandler);}
_fixTitle(){const title=this._element.getAttribute('title');if(!title){return;}
if(!this._element.getAttribute('aria-label')&&!this._element.textContent.trim()){this._element.setAttribute('aria-label',title);}
this._element.setAttribute('data-bs-original-title',title);this._element.removeAttribute('title');}
_enter(){if(this._isShown()||this._isHovered){this._isHovered=true;return;}
this._isHovered=true;this._setTimeout(()=>{if(this._isHovered){this.show();}},this._config.delay.show);}
_leave(){if(this._isWithActiveTrigger()){return;}
this._isHovered=false;this._setTimeout(()=>{if(!this._isHovered){this.hide();}},this._config.delay.hide);}
_setTimeout(handler,timeout){clearTimeout(this._timeout);this._timeout=setTimeout(handler,timeout);}
_isWithActiveTrigger(){return Object.values(this._activeTrigger).includes(true);}
_getConfig(config){const dataAttributes=Manipulator.getDataAttributes(this._element);for(const dataAttribute of Object.keys(dataAttributes)){if(DISALLOWED_ATTRIBUTES.has(dataAttribute)){delete dataAttributes[dataAttribute];}}
config={...dataAttributes,...(typeof config==='object'&&config?config:{})};config=this._mergeConfigObj(config);config=this._configAfterMerge(config);this._typeCheckConfig(config);return config;}
_configAfterMerge(config){config.container=config.container===false?document.body:index_js.getElement(config.container);if(typeof config.delay==='number'){config.delay={show:config.delay,hide:config.delay};}
if(typeof config.title==='number'){config.title=config.title.toString();}
if(typeof config.content==='number'){config.content=config.content.toString();}
return config;}
_getDelegateConfig(){const config={};for(const[key,value]of Object.entries(this._config)){if(this.constructor.Default[key]!==value){config[key]=value;}}
config.selector=false;config.trigger='manual';return config;}
_disposePopper(){if(this._popper){this._popper.destroy();this._popper=null;}
if(this.tip){this.tip.remove();this.tip=null;}}
static jQueryInterface(config){return this.each(function(){const data=Tooltip.getOrCreateInstance(this,config);if(typeof config!=='string'){return;}
if(typeof data[config]==='undefined'){throw new TypeError(`No method named "${config}"`);}
data[config]();});}}
index_js.defineJQueryPlugin(Tooltip);return Tooltip;}));;

/* /web/static/lib/bootstrap/js/dist/popover.js */
(function(global,factory){typeof exports==='object'&&typeof module!=='undefined'?module.exports=factory(require('./tooltip.js'),require('./util/index.js')):typeof define==='function'&&define.amd?define(['./tooltip','./util/index'],factory):(global=typeof globalThis!=='undefined'?globalThis:global||self,global.Popover=factory(global.Tooltip,global.Index));})(this,(function(Tooltip,index_js){'use strict';const NAME='popover';const SELECTOR_TITLE='.popover-header';const SELECTOR_CONTENT='.popover-body';const Default={...Tooltip.Default,content:'',offset:[0,8],placement:'right',template:'<div class="popover" role="tooltip">'+'<div class="popover-arrow"></div>'+'<h3 class="popover-header"></h3>'+'<div class="popover-body"></div>'+'</div>',trigger:'click'};const DefaultType={...Tooltip.DefaultType,content:'(null|string|element|function)'};class Popover extends Tooltip{static get Default(){return Default;}
static get DefaultType(){return DefaultType;}
static get NAME(){return NAME;}
_isWithContent(){return this._getTitle()||this._getContent();}
_getContentForTemplate(){return{[SELECTOR_TITLE]:this._getTitle(),[SELECTOR_CONTENT]:this._getContent()};}
_getContent(){return this._resolvePossibleFunction(this._config.content);}
static jQueryInterface(config){return this.each(function(){const data=Popover.getOrCreateInstance(this,config);if(typeof config!=='string'){return;}
if(typeof data[config]==='undefined'){throw new TypeError(`No method named "${config}"`);}
data[config]();});}}
index_js.defineJQueryPlugin(Popover);return Popover;}));;

/* /web/static/lib/bootstrap/js/dist/scrollspy.js */
(function(global,factory){typeof exports==='object'&&typeof module!=='undefined'?module.exports=factory(require('./base-component.js'),require('./dom/event-handler.js'),require('./dom/selector-engine.js'),require('./util/index.js')):typeof define==='function'&&define.amd?define(['./base-component','./dom/event-handler','./dom/selector-engine','./util/index'],factory):(global=typeof globalThis!=='undefined'?globalThis:global||self,global.ScrollSpy=factory(global.BaseComponent,global.EventHandler,global.SelectorEngine,global.Index));})(this,(function(BaseComponent,EventHandler,SelectorEngine,index_js){'use strict';const NAME='scrollspy';const DATA_KEY='bs.scrollspy';const EVENT_KEY=`.${DATA_KEY}`;const DATA_API_KEY='.data-api';const EVENT_ACTIVATE=`activate${EVENT_KEY}`;const EVENT_CLICK=`click${EVENT_KEY}`;const EVENT_LOAD_DATA_API=`load${EVENT_KEY}${DATA_API_KEY}`;const CLASS_NAME_DROPDOWN_ITEM='dropdown-item';const CLASS_NAME_ACTIVE='active';const SELECTOR_DATA_SPY='[data-bs-spy="scroll"]';const SELECTOR_TARGET_LINKS='[href]';const SELECTOR_NAV_LIST_GROUP='.nav, .list-group';const SELECTOR_NAV_LINKS='.nav-link';const SELECTOR_NAV_ITEMS='.nav-item';const SELECTOR_LIST_ITEMS='.list-group-item';const SELECTOR_LINK_ITEMS=`${SELECTOR_NAV_LINKS}, ${SELECTOR_NAV_ITEMS} > ${SELECTOR_NAV_LINKS}, ${SELECTOR_LIST_ITEMS}`;const SELECTOR_DROPDOWN='.dropdown';const SELECTOR_DROPDOWN_TOGGLE='.dropdown-toggle';const Default={offset:null,rootMargin:'0px 0px -25%',smoothScroll:false,target:null,threshold:[0.1,0.5,1]};const DefaultType={offset:'(number|null)',rootMargin:'string',smoothScroll:'boolean',target:'element',threshold:'array'};class ScrollSpy extends BaseComponent{constructor(element,config){super(element,config);this._targetLinks=new Map();this._observableSections=new Map();this._rootElement=getComputedStyle(this._element).overflowY==='visible'?null:this._element;this._activeTarget=null;this._observer=null;this._previousScrollData={visibleEntryTop:0,parentScrollTop:0};this.refresh();}
static get Default(){return Default;}
static get DefaultType(){return DefaultType;}
static get NAME(){return NAME;}
refresh(){this._initializeTargetsAndObservables();this._maybeEnableSmoothScroll();if(this._observer){this._observer.disconnect();}else{this._observer=this._getNewObserver();}
for(const section of this._observableSections.values()){this._observer.observe(section);}}
dispose(){this._observer.disconnect();super.dispose();}
_configAfterMerge(config){config.target=index_js.getElement(config.target)||document.body;config.rootMargin=config.offset?`${config.offset}px 0px -30%`:config.rootMargin;if(typeof config.threshold==='string'){config.threshold=config.threshold.split(',').map(value=>Number.parseFloat(value));}
return config;}
_maybeEnableSmoothScroll(){if(!this._config.smoothScroll){return;}
EventHandler.off(this._config.target,EVENT_CLICK);EventHandler.on(this._config.target,EVENT_CLICK,SELECTOR_TARGET_LINKS,event=>{const observableSection=this._observableSections.get(event.target.hash);if(observableSection){event.preventDefault();const root=this._rootElement||window;const height=observableSection.offsetTop-this._element.offsetTop;if(root.scrollTo){root.scrollTo({top:height,behavior:'smooth'});return;}
root.scrollTop=height;}});}
_getNewObserver(){const options={root:this._rootElement,threshold:this._config.threshold,rootMargin:this._config.rootMargin};return new IntersectionObserver(entries=>this._observerCallback(entries),options);}
_observerCallback(entries){const targetElement=entry=>this._targetLinks.get(`#${entry.target.id}`);const activate=entry=>{this._previousScrollData.visibleEntryTop=entry.target.offsetTop;this._process(targetElement(entry));};const parentScrollTop=(this._rootElement||document.documentElement).scrollTop;const userScrollsDown=parentScrollTop>=this._previousScrollData.parentScrollTop;this._previousScrollData.parentScrollTop=parentScrollTop;for(const entry of entries){if(!entry.isIntersecting){this._activeTarget=null;this._clearActiveClass(targetElement(entry));continue;}
const entryIsLowerThanPrevious=entry.target.offsetTop>=this._previousScrollData.visibleEntryTop;if(userScrollsDown&&entryIsLowerThanPrevious){activate(entry);if(!parentScrollTop){return;}
continue;}
if(!userScrollsDown&&!entryIsLowerThanPrevious){activate(entry);}}}
_initializeTargetsAndObservables(){this._targetLinks=new Map();this._observableSections=new Map();const targetLinks=SelectorEngine.find(SELECTOR_TARGET_LINKS,this._config.target);for(const anchor of targetLinks){if(!anchor.hash||index_js.isDisabled(anchor)){continue;}
const observableSection=SelectorEngine.findOne(decodeURI(anchor.hash),this._element);if(index_js.isVisible(observableSection)){this._targetLinks.set(decodeURI(anchor.hash),anchor);this._observableSections.set(anchor.hash,observableSection);}}}
_process(target){if(this._activeTarget===target){return;}
this._clearActiveClass(this._config.target);this._activeTarget=target;target.classList.add(CLASS_NAME_ACTIVE);this._activateParents(target);EventHandler.trigger(this._element,EVENT_ACTIVATE,{relatedTarget:target});}
_activateParents(target){if(target.classList.contains(CLASS_NAME_DROPDOWN_ITEM)){SelectorEngine.findOne(SELECTOR_DROPDOWN_TOGGLE,target.closest(SELECTOR_DROPDOWN)).classList.add(CLASS_NAME_ACTIVE);return;}
for(const listGroup of SelectorEngine.parents(target,SELECTOR_NAV_LIST_GROUP)){for(const item of SelectorEngine.prev(listGroup,SELECTOR_LINK_ITEMS)){item.classList.add(CLASS_NAME_ACTIVE);}}}
_clearActiveClass(parent){parent.classList.remove(CLASS_NAME_ACTIVE);const activeNodes=SelectorEngine.find(`${SELECTOR_TARGET_LINKS}.${CLASS_NAME_ACTIVE}`,parent);for(const node of activeNodes){node.classList.remove(CLASS_NAME_ACTIVE);}}
static jQueryInterface(config){return this.each(function(){const data=ScrollSpy.getOrCreateInstance(this,config);if(typeof config!=='string'){return;}
if(data[config]===undefined||config.startsWith('_')||config==='constructor'){throw new TypeError(`No method named "${config}"`);}
data[config]();});}}
EventHandler.on(window,EVENT_LOAD_DATA_API,()=>{for(const spy of SelectorEngine.find(SELECTOR_DATA_SPY)){ScrollSpy.getOrCreateInstance(spy);}});index_js.defineJQueryPlugin(ScrollSpy);return ScrollSpy;}));;

/* /web/static/lib/bootstrap/js/dist/tab.js */
(function(global,factory){typeof exports==='object'&&typeof module!=='undefined'?module.exports=factory(require('./base-component.js'),require('./dom/event-handler.js'),require('./dom/selector-engine.js'),require('./util/index.js')):typeof define==='function'&&define.amd?define(['./base-component','./dom/event-handler','./dom/selector-engine','./util/index'],factory):(global=typeof globalThis!=='undefined'?globalThis:global||self,global.Tab=factory(global.BaseComponent,global.EventHandler,global.SelectorEngine,global.Index));})(this,(function(BaseComponent,EventHandler,SelectorEngine,index_js){'use strict';const NAME='tab';const DATA_KEY='bs.tab';const EVENT_KEY=`.${DATA_KEY}`;const EVENT_HIDE=`hide${EVENT_KEY}`;const EVENT_HIDDEN=`hidden${EVENT_KEY}`;const EVENT_SHOW=`show${EVENT_KEY}`;const EVENT_SHOWN=`shown${EVENT_KEY}`;const EVENT_CLICK_DATA_API=`click${EVENT_KEY}`;const EVENT_KEYDOWN=`keydown${EVENT_KEY}`;const EVENT_LOAD_DATA_API=`load${EVENT_KEY}`;const ARROW_LEFT_KEY='ArrowLeft';const ARROW_RIGHT_KEY='ArrowRight';const ARROW_UP_KEY='ArrowUp';const ARROW_DOWN_KEY='ArrowDown';const HOME_KEY='Home';const END_KEY='End';const CLASS_NAME_ACTIVE='active';const CLASS_NAME_FADE='fade';const CLASS_NAME_SHOW='show';const CLASS_DROPDOWN='dropdown';const SELECTOR_DROPDOWN_TOGGLE='.dropdown-toggle';const SELECTOR_DROPDOWN_MENU='.dropdown-menu';const NOT_SELECTOR_DROPDOWN_TOGGLE=`:not(${SELECTOR_DROPDOWN_TOGGLE})`;const SELECTOR_TAB_PANEL='.list-group, .nav, [role="tablist"]';const SELECTOR_OUTER='.nav-item, .list-group-item';const SELECTOR_INNER=`.nav-link${NOT_SELECTOR_DROPDOWN_TOGGLE}, .list-group-item${NOT_SELECTOR_DROPDOWN_TOGGLE}, [role="tab"]${NOT_SELECTOR_DROPDOWN_TOGGLE}`;const SELECTOR_DATA_TOGGLE='[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]';const SELECTOR_INNER_ELEM=`${SELECTOR_INNER}, ${SELECTOR_DATA_TOGGLE}`;const SELECTOR_DATA_TOGGLE_ACTIVE=`.${CLASS_NAME_ACTIVE}[data-bs-toggle="tab"], .${CLASS_NAME_ACTIVE}[data-bs-toggle="pill"], .${CLASS_NAME_ACTIVE}[data-bs-toggle="list"]`;class Tab extends BaseComponent{constructor(element){super(element);this._parent=this._element.closest(SELECTOR_TAB_PANEL);if(!this._parent){return;}
this._setInitialAttributes(this._parent,this._getChildren());EventHandler.on(this._element,EVENT_KEYDOWN,event=>this._keydown(event));}
static get NAME(){return NAME;}
show(){const innerElem=this._element;if(this._elemIsActive(innerElem)){return;}
const active=this._getActiveElem();const hideEvent=active?EventHandler.trigger(active,EVENT_HIDE,{relatedTarget:innerElem}):null;const showEvent=EventHandler.trigger(innerElem,EVENT_SHOW,{relatedTarget:active});if(showEvent.defaultPrevented||hideEvent&&hideEvent.defaultPrevented){return;}
this._deactivate(active,innerElem);this._activate(innerElem,active);}
_activate(element,relatedElem){if(!element){return;}
element.classList.add(CLASS_NAME_ACTIVE);this._activate(SelectorEngine.getElementFromSelector(element));const complete=()=>{if(element.getAttribute('role')!=='tab'){element.classList.add(CLASS_NAME_SHOW);return;}
element.removeAttribute('tabindex');element.setAttribute('aria-selected',true);this._toggleDropDown(element,true);EventHandler.trigger(element,EVENT_SHOWN,{relatedTarget:relatedElem});};this._queueCallback(complete,element,element.classList.contains(CLASS_NAME_FADE));}
_deactivate(element,relatedElem){if(!element){return;}
element.classList.remove(CLASS_NAME_ACTIVE);element.blur();this._deactivate(SelectorEngine.getElementFromSelector(element));const complete=()=>{if(element.getAttribute('role')!=='tab'){element.classList.remove(CLASS_NAME_SHOW);return;}
element.setAttribute('aria-selected',false);element.setAttribute('tabindex','-1');this._toggleDropDown(element,false);EventHandler.trigger(element,EVENT_HIDDEN,{relatedTarget:relatedElem});};this._queueCallback(complete,element,element.classList.contains(CLASS_NAME_FADE));}
_keydown(event){if(![ARROW_LEFT_KEY,ARROW_RIGHT_KEY,ARROW_UP_KEY,ARROW_DOWN_KEY,HOME_KEY,END_KEY].includes(event.key)){return;}
event.stopPropagation();event.preventDefault();const children=this._getChildren().filter(element=>!index_js.isDisabled(element));let nextActiveElement;if([HOME_KEY,END_KEY].includes(event.key)){nextActiveElement=children[event.key===HOME_KEY?0:children.length-1];}else{const isNext=[ARROW_RIGHT_KEY,ARROW_DOWN_KEY].includes(event.key);nextActiveElement=index_js.getNextActiveElement(children,event.target,isNext,true);}
if(nextActiveElement){nextActiveElement.focus({preventScroll:true});Tab.getOrCreateInstance(nextActiveElement).show();}}
_getChildren(){return SelectorEngine.find(SELECTOR_INNER_ELEM,this._parent);}
_getActiveElem(){return this._getChildren().find(child=>this._elemIsActive(child))||null;}
_setInitialAttributes(parent,children){this._setAttributeIfNotExists(parent,'role','tablist');for(const child of children){this._setInitialAttributesOnChild(child);}}
_setInitialAttributesOnChild(child){child=this._getInnerElement(child);const isActive=this._elemIsActive(child);const outerElem=this._getOuterElement(child);child.setAttribute('aria-selected',isActive);if(outerElem!==child){this._setAttributeIfNotExists(outerElem,'role','presentation');}
if(!isActive){child.setAttribute('tabindex','-1');}
this._setAttributeIfNotExists(child,'role','tab');this._setInitialAttributesOnTargetPanel(child);}
_setInitialAttributesOnTargetPanel(child){const target=SelectorEngine.getElementFromSelector(child);if(!target){return;}
this._setAttributeIfNotExists(target,'role','tabpanel');if(child.id){this._setAttributeIfNotExists(target,'aria-labelledby',`${child.id}`);}}
_toggleDropDown(element,open){const outerElem=this._getOuterElement(element);if(!outerElem.classList.contains(CLASS_DROPDOWN)){return;}
const toggle=(selector,className)=>{const element=SelectorEngine.findOne(selector,outerElem);if(element){element.classList.toggle(className,open);}};toggle(SELECTOR_DROPDOWN_TOGGLE,CLASS_NAME_ACTIVE);toggle(SELECTOR_DROPDOWN_MENU,CLASS_NAME_SHOW);outerElem.setAttribute('aria-expanded',open);}
_setAttributeIfNotExists(element,attribute,value){if(!element.hasAttribute(attribute)){element.setAttribute(attribute,value);}}
_elemIsActive(elem){return elem.classList.contains(CLASS_NAME_ACTIVE);}
_getInnerElement(elem){return elem.matches(SELECTOR_INNER_ELEM)?elem:SelectorEngine.findOne(SELECTOR_INNER_ELEM,elem);}
_getOuterElement(elem){return elem.closest(SELECTOR_OUTER)||elem;}
static jQueryInterface(config){return this.each(function(){const data=Tab.getOrCreateInstance(this);if(typeof config!=='string'){return;}
if(data[config]===undefined||config.startsWith('_')||config==='constructor'){throw new TypeError(`No method named "${config}"`);}
data[config]();});}}
EventHandler.on(document,EVENT_CLICK_DATA_API,SELECTOR_DATA_TOGGLE,function(event){if(['A','AREA'].includes(this.tagName)){event.preventDefault();}
if(index_js.isDisabled(this)){return;}
Tab.getOrCreateInstance(this).show();});EventHandler.on(window,EVENT_LOAD_DATA_API,()=>{for(const element of SelectorEngine.find(SELECTOR_DATA_TOGGLE_ACTIVE)){Tab.getOrCreateInstance(element);}});index_js.defineJQueryPlugin(Tab);return Tab;}));;

/* /web/static/lib/bootstrap/js/dist/toast.js */
(function(global,factory){typeof exports==='object'&&typeof module!=='undefined'?module.exports=factory(require('./base-component.js'),require('./dom/event-handler.js'),require('./util/component-functions.js'),require('./util/index.js')):typeof define==='function'&&define.amd?define(['./base-component','./dom/event-handler','./util/component-functions','./util/index'],factory):(global=typeof globalThis!=='undefined'?globalThis:global||self,global.Toast=factory(global.BaseComponent,global.EventHandler,global.ComponentFunctions,global.Index));})(this,(function(BaseComponent,EventHandler,componentFunctions_js,index_js){'use strict';const NAME='toast';const DATA_KEY='bs.toast';const EVENT_KEY=`.${DATA_KEY}`;const EVENT_MOUSEOVER=`mouseover${EVENT_KEY}`;const EVENT_MOUSEOUT=`mouseout${EVENT_KEY}`;const EVENT_FOCUSIN=`focusin${EVENT_KEY}`;const EVENT_FOCUSOUT=`focusout${EVENT_KEY}`;const EVENT_HIDE=`hide${EVENT_KEY}`;const EVENT_HIDDEN=`hidden${EVENT_KEY}`;const EVENT_SHOW=`show${EVENT_KEY}`;const EVENT_SHOWN=`shown${EVENT_KEY}`;const CLASS_NAME_FADE='fade';const CLASS_NAME_HIDE='hide';const CLASS_NAME_SHOW='show';const CLASS_NAME_SHOWING='showing';const DefaultType={animation:'boolean',autohide:'boolean',delay:'number'};const Default={animation:true,autohide:true,delay:5000};class Toast extends BaseComponent{constructor(element,config){super(element,config);this._timeout=null;this._hasMouseInteraction=false;this._hasKeyboardInteraction=false;this._setListeners();}
static get Default(){return Default;}
static get DefaultType(){return DefaultType;}
static get NAME(){return NAME;}
show(){const showEvent=EventHandler.trigger(this._element,EVENT_SHOW);if(showEvent.defaultPrevented){return;}
this._clearTimeout();if(this._config.animation){this._element.classList.add(CLASS_NAME_FADE);}
const complete=()=>{this._element.classList.remove(CLASS_NAME_SHOWING);EventHandler.trigger(this._element,EVENT_SHOWN);this._maybeScheduleHide();};this._element.classList.remove(CLASS_NAME_HIDE);index_js.reflow(this._element);this._element.classList.add(CLASS_NAME_SHOW,CLASS_NAME_SHOWING);this._queueCallback(complete,this._element,this._config.animation);}
hide(){if(!this.isShown()){return;}
const hideEvent=EventHandler.trigger(this._element,EVENT_HIDE);if(hideEvent.defaultPrevented){return;}
const complete=()=>{this._element.classList.add(CLASS_NAME_HIDE);this._element.classList.remove(CLASS_NAME_SHOWING,CLASS_NAME_SHOW);EventHandler.trigger(this._element,EVENT_HIDDEN);};this._element.classList.add(CLASS_NAME_SHOWING);this._queueCallback(complete,this._element,this._config.animation);}
dispose(){this._clearTimeout();if(this.isShown()){this._element.classList.remove(CLASS_NAME_SHOW);}
super.dispose();}
isShown(){return this._element.classList.contains(CLASS_NAME_SHOW);}
_maybeScheduleHide(){if(!this._config.autohide){return;}
if(this._hasMouseInteraction||this._hasKeyboardInteraction){return;}
this._timeout=setTimeout(()=>{this.hide();},this._config.delay);}
_onInteraction(event,isInteracting){switch(event.type){case'mouseover':case'mouseout':{this._hasMouseInteraction=isInteracting;break;}
case'focusin':case'focusout':{this._hasKeyboardInteraction=isInteracting;break;}}
if(isInteracting){this._clearTimeout();return;}
const nextElement=event.relatedTarget;if(this._element===nextElement||this._element.contains(nextElement)){return;}
this._maybeScheduleHide();}
_setListeners(){EventHandler.on(this._element,EVENT_MOUSEOVER,event=>this._onInteraction(event,true));EventHandler.on(this._element,EVENT_MOUSEOUT,event=>this._onInteraction(event,false));EventHandler.on(this._element,EVENT_FOCUSIN,event=>this._onInteraction(event,true));EventHandler.on(this._element,EVENT_FOCUSOUT,event=>this._onInteraction(event,false));}
_clearTimeout(){clearTimeout(this._timeout);this._timeout=null;}
static jQueryInterface(config){return this.each(function(){const data=Toast.getOrCreateInstance(this,config);if(typeof config==='string'){if(typeof data[config]==='undefined'){throw new TypeError(`No method named "${config}"`);}
data[config](this);}});}}
componentFunctions_js.enableDismissTrigger(Toast);index_js.defineJQueryPlugin(Toast);return Toast;}));;

/* /web/static/src/libs/bootstrap.js */
odoo.define('@web/libs/bootstrap',['@web/core/utils/scrolling'],function(require){'use strict';let __exports={};const{compensateScrollbar,getScrollingElement}=require("@web/core/utils/scrolling");const bsSanitizeAllowList=Tooltip.Default.allowList;bsSanitizeAllowList["*"].push("title","style",/^data-[\w-]+/);bsSanitizeAllowList.header=[];bsSanitizeAllowList.main=[];bsSanitizeAllowList.footer=[];bsSanitizeAllowList.caption=[];bsSanitizeAllowList.col=["span"];bsSanitizeAllowList.colgroup=["span"];bsSanitizeAllowList.table=[];bsSanitizeAllowList.thead=[];bsSanitizeAllowList.tbody=[];bsSanitizeAllowList.tfooter=[];bsSanitizeAllowList.tr=[];bsSanitizeAllowList.th=["colspan","rowspan"];bsSanitizeAllowList.td=["colspan","rowspan"];bsSanitizeAllowList.address=[];bsSanitizeAllowList.article=[];bsSanitizeAllowList.aside=[];bsSanitizeAllowList.blockquote=[];bsSanitizeAllowList.section=[];bsSanitizeAllowList.button=["type"];bsSanitizeAllowList.del=[];Tooltip.Default.placement="auto";Tooltip.Default.fallbackPlacement=["bottom","right","left","top"];Tooltip.Default.html=true;Tooltip.Default.trigger="hover";Tooltip.Default.container="body";Tooltip.Default.boundary="window";Tooltip.Default.delay={show:1000,hide:0};const bootstrapShowFunction=Tooltip.prototype.show;Tooltip.prototype.show=function(){document.querySelectorAll(".tooltip").forEach((el)=>el.remove());const errorsToIgnore=["Please use show on visible elements"];try{return bootstrapShowFunction.call(this);}catch(error){if(errorsToIgnore.includes(error.message)){return 0;}
throw error;}};Dropdown.prototype._detectNavbar=function(){return false;};const bsAdjustDialogFunction=Modal.prototype._adjustDialog;Modal.prototype._adjustDialog=function(){const document=this._element.ownerDocument;this._scrollBar.reset();document.body.classList.remove("modal-open");const scrollable=getScrollingElement(document);if(document.body.contains(scrollable)){compensateScrollbar(scrollable,true);}
this._scrollBar.hide();document.body.classList.add("modal-open");return bsAdjustDialogFunction.apply(this,arguments);};const bsResetAdjustmentsFunction=Modal.prototype._resetAdjustments;Modal.prototype._resetAdjustments=function(){const document=this._element.ownerDocument;this._scrollBar.reset();document.body.classList.remove("modal-open");const scrollable=getScrollingElement(document);if(document.body.contains(scrollable)){compensateScrollbar(scrollable,false);}
return bsResetAdjustmentsFunction.apply(this,arguments);};return __exports;});;

/* /web/static/src/legacy/js/libs/jquery.js */
odoo.define('@web/legacy/js/libs/jquery',[],function(require){'use strict';let __exports={};$.extend($.expr[':'],{data:function(element,index,matches){return $(element).data(matches[3]);},});$.fn.extend({odooBounce:function(extraClass){for(const el of this){el.classList.add('o_catch_attention',extraClass);setTimeout(()=>el.classList.remove('o_catch_attention',extraClass),400);}
return this;},prependEvent:function(events,selector,data,handler){this.on.apply(this,arguments);events=events.split(' ');return this.each(function(){var el=this;events.forEach((evNameNamespaced)=>{var evName=evNameNamespaced.split('.')[0];var handler=$._data(el,'events')[evName].pop();$._data(el,'events')[evName].unshift(handler);});});},getScrollingElement(document=window.document){const $baseScrollingElement=$(document.scrollingElement);if($baseScrollingElement.isScrollable()&&$baseScrollingElement.hasScrollableContent()){return $baseScrollingElement;}
const bodyHeight=$(document.body).height();for(const el of document.body.children){if(bodyHeight-el.scrollHeight>1.5){continue;}
const $el=$(el);if($el.isScrollable()){return $el;}}
return $baseScrollingElement;},getScrollingTarget(contextItem=window.document){const isElement=obj=>obj&&obj.nodeType===Node.ELEMENT_NODE;const isJQuery=obj=>obj&&('jquery'in obj);const $scrollingElement=isElement(contextItem)?$(contextItem):isJQuery(contextItem)?contextItem:$().getScrollingElement(contextItem);const document=$scrollingElement[0].ownerDocument;return $scrollingElement.is(document.scrollingElement)?$(document.defaultView):$scrollingElement;},hasScrollableContent(){return this[0].scrollHeight>this[0].clientHeight;},isScrollable(){if(!this.length){return false;}
const overflow=this.css('overflow-y');const el=this[0];return overflow==='auto'||overflow==='scroll'||(overflow==='visible'&&el===el.ownerDocument.scrollingElement);},});const originalScrollTop=$.fn.scrollTop;$.fn.scrollTop=function(value){if(value!==undefined&&this.filter('html, body').length){const $withRealScrollable=this.not('html, body').add($().getScrollingElement(this[0].ownerDocument));originalScrollTop.apply($withRealScrollable,arguments);return this;}else if(value===undefined&&this.eq(0).is('html, body')){return originalScrollTop.apply($().getScrollingElement(this[0].ownerDocument),arguments);}
return originalScrollTop.apply(this,arguments);};const originalAnimate=$.fn.animate;$.fn.animate=function(properties,...rest){const props=Object.assign({},properties);if('scrollTop'in props&&this.filter('html, body').length){const $withRealScrollable=this.not('html, body').add($().getScrollingElement(this[0].ownerDocument));originalAnimate.call($withRealScrollable,{'scrollTop':props['scrollTop']},...rest);delete props['scrollTop'];}
if(!Object.keys(props).length){return this;}
return originalAnimate.call(this,props,...rest);};return __exports;});;

/* /web/static/src/core/utils/scrolling.js */
odoo.define('@web/core/utils/scrolling',[],function(require){'use strict';let __exports={};__exports.isScrollableX=isScrollableX;function isScrollableX(el){if(el.scrollWidth>el.clientWidth&&el.clientWidth>0){return couldBeScrollableX(el);}
return false;}
__exports.couldBeScrollableX=couldBeScrollableX;function couldBeScrollableX(el){if(el){const overflow=getComputedStyle(el).getPropertyValue("overflow-x");if(/\bauto\b|\bscroll\b/.test(overflow)){return true;}}
return false;}
__exports.closestScrollableX=closestScrollableX;function closestScrollableX(el){if(!el){return null;}
if(isScrollableX(el)){return el;}
return closestScrollableX(el.parentElement);}
__exports.isScrollableY=isScrollableY;function isScrollableY(el){if(el&&el.scrollHeight>el.clientHeight&&el.clientHeight>0){return couldBeScrollableY(el);}
return false;}
__exports.couldBeScrollableY=couldBeScrollableY;function couldBeScrollableY(el){if(el){const overflow=getComputedStyle(el).getPropertyValue("overflow-y");if(/\bauto\b|\bscroll\b/.test(overflow)){return true;}}
return false;}
__exports.closestScrollableY=closestScrollableY;function closestScrollableY(el){if(!el){return null;}
if(isScrollableY(el)){return el;}
return closestScrollableY(el.parentElement);}
__exports.scrollTo=scrollTo;function scrollTo(element,options={}){const{behavior="auto",isAnchor=false,offset=0}=options;const scrollable=closestScrollableY(options.scrollable||element.parentElement);if(!scrollable){return;}
const scrollBottom=scrollable.getBoundingClientRect().bottom;const scrollTop=scrollable.getBoundingClientRect().top;const elementBottom=element.getBoundingClientRect().bottom;const elementTop=element.getBoundingClientRect().top;const scrollPromises=[];if(elementBottom>scrollBottom&&!isAnchor){scrollPromises.push(new Promise((resolve)=>{scrollable.addEventListener("scrollend",()=>resolve(),{once:true});}));scrollable.scrollTo({top:scrollable.scrollTop+
elementTop-
scrollBottom+
Math.ceil(element.getBoundingClientRect().height)+
offset,behavior,});}else if(elementTop<scrollTop||isAnchor){scrollPromises.push(new Promise((resolve)=>{scrollable.addEventListener("scrollend",()=>resolve(),{once:true});}));scrollable.scrollTo({top:scrollable.scrollTop-scrollTop+elementTop+offset,behavior,});if(options.isAnchor){const parentScrollable=closestScrollableY(scrollable.parentElement);if(parentScrollable){scrollPromises.push(scrollTo(scrollable,{behavior,isAnchor:true,scrollable:parentScrollable,}));}}}
return Promise.all(scrollPromises);}
__exports.compensateScrollbar=compensateScrollbar;function compensateScrollbar(el,add=true,isScrollElement=true,cssProperty="padding-right"){if(!el){return;}
const scrollableEl=isScrollElement?el:closestScrollableY(el.parentElement);if(!scrollableEl){return;}
const isRTL=scrollableEl.classList.contains(".o_rtl");if(isRTL){cssProperty=cssProperty.replace("right","left");}
el.style.removeProperty(cssProperty);if(!add){return;}
const style=window.getComputedStyle(el);const borderLeftWidth=Math.ceil(parseFloat(style.borderLeftWidth.replace("px","")));const borderRightWidth=Math.ceil(parseFloat(style.borderRightWidth.replace("px","")));const bordersWidth=borderLeftWidth+borderRightWidth;const newValue=parseInt(style[cssProperty])+
scrollableEl.offsetWidth-
scrollableEl.clientWidth-
bordersWidth;el.style.setProperty(cssProperty,`${newValue}px`,"important");}
__exports.getScrollingElement=getScrollingElement;function getScrollingElement(document=window.document){const baseScrollingElement=document.scrollingElement;if(isScrollableY(baseScrollingElement)){return baseScrollingElement;}
const bodyHeight=window.getComputedStyle(document.body).height;for(const el of document.body.children){if(bodyHeight-el.scrollHeight>1.5){continue;}
if(isScrollableY(el)){return el;}}
return baseScrollingElement;}
return __exports;});;

/* /web/static/src/core/registry.js */
odoo.define('@web/core/registry',['@odoo/owl'],function(require){'use strict';let __exports={};const{EventBus,validate}=require("@odoo/owl");const KeyNotFoundError=__exports.KeyNotFoundError=class KeyNotFoundError extends Error{}
const DuplicatedKeyError=__exports.DuplicatedKeyError=class DuplicatedKeyError extends Error{}
const validateSchema=(value,schema)=>{if(!odoo.debug){return;}
validate(value,schema);}
const Registry=__exports.Registry=class Registry extends EventBus{constructor(name){super();this.content={};this.subRegistries={};this.elements=null;this.entries=null;this.name=name;this.validationSchema=null;this.addEventListener("UPDATE",()=>{this.elements=null;this.entries=null;});}
add(key,value,{force,sequence}={}){if(this.validationSchema){validateSchema(value,this.validationSchema);}
if(!force&&key in this.content){throw new DuplicatedKeyError(`Cannot add key "${key}" in the "${this.name}" registry: it already exists`);}
let previousSequence;if(force){const elem=this.content[key];previousSequence=elem&&elem[0];}
sequence=sequence===undefined?previousSequence||50:sequence;this.content[key]=[sequence,value];const payload={operation:"add",key,value};this.trigger("UPDATE",payload);return this;}
get(key,defaultValue){if(arguments.length<2&&!(key in this.content)){throw new KeyNotFoundError(`Cannot find key "${key}" in the "${this.name}" registry`);}
const info=this.content[key];return info?info[1]:defaultValue;}
contains(key){return key in this.content;}
getAll(){if(!this.elements){const content=Object.values(this.content).sort((el1,el2)=>el1[0]-el2[0]);this.elements=content.map((elem)=>elem[1]);}
return this.elements.slice();}
getEntries(){if(!this.entries){const entries=Object.entries(this.content).sort((el1,el2)=>el1[1][0]-el2[1][0]);this.entries=entries.map(([str,elem])=>[str,elem[1]]);}
return this.entries.slice();}
remove(key){const value=this.content[key];delete this.content[key];const payload={operation:"delete",key,value};this.trigger("UPDATE",payload);}
category(subcategory){if(!(subcategory in this.subRegistries)){this.subRegistries[subcategory]=new Registry(subcategory);}
return this.subRegistries[subcategory];}
addValidation(schema){if(this.validationSchema){throw new Error("Validation schema already set on this registry");}
this.validationSchema=schema;for(const value of this.getAll()){validateSchema(value,schema);}}}
const registry=__exports.registry=new Registry();return __exports;});;

/* /web/static/src/core/templates.js */
odoo.define('@web/core/templates',['@web/core/template_inheritance'],function(require){'use strict';let __exports={};const{applyInheritance}=require("@web/core/template_inheritance");function getClone(template){const c=template.cloneNode(true);new Document().append(c);return c;}
function getParsedTemplate(templateString){const doc=parser.parseFromString(templateString,"text/xml");for(const processor of templateProcessors){processor(doc);}
return doc.firstChild;}
function _getTemplate(name,blockId=null){if(!(name in parsedTemplates)){if(!(name in templates)){return null;}
const templateString=templates[name];parsedTemplates[name]=getParsedTemplate(templateString);}
let processedTemplate=parsedTemplates[name];const inheritFrom=processedTemplate.getAttribute("t-inherit");if(inheritFrom){const parentTemplate=_getTemplate(inheritFrom,blockId||info[name].blockId);if(!parentTemplate){throw new Error(`Constructing template ${name}: template parent ${inheritFrom} not found`);}
const element=getClone(processedTemplate);processedTemplate=applyInheritance(getClone(parentTemplate),element,info[name].url);if(processedTemplate.tagName!==element.tagName){const temp=processedTemplate;processedTemplate=new Document().createElement(element.tagName);processedTemplate.append(...temp.childNodes);}
for(const{name,value}of element.attributes){if(!["t-inherit","t-inherit-mode"].includes(name)){processedTemplate.setAttribute(name,value);}}}
for(const otherBlockId in templateExtensions[name]||{}){if(blockId&&otherBlockId>blockId){break;}
if(!(name in parsedTemplateExtensions)){parsedTemplateExtensions[name]={};}
if(!(otherBlockId in parsedTemplateExtensions[name])){parsedTemplateExtensions[name][otherBlockId]=[];for(const{templateString,url}of templateExtensions[name][otherBlockId]){parsedTemplateExtensions[name][otherBlockId].push({template:getParsedTemplate(templateString),url,});}}
for(const{template,url}of parsedTemplateExtensions[name][otherBlockId]){if(!urlFilters.every((filter)=>filter(url))){continue;}
processedTemplate=applyInheritance(inheritFrom?processedTemplate:getClone(processedTemplate),getClone(template),url);}}
return processedTemplate;}
function isRegistered(...args){const key=JSON.stringify([...args]);if(registered.has(key)){return true;}
registered.add(key);return false;}
const info=Object.create(null);const parsedTemplateExtensions=Object.create(null);const parsedTemplates=Object.create(null);const parser=new DOMParser();const processedTemplates=new Map();const registered=new Set();const templateExtensions=Object.create(null);const templateProcessors=[];const templates=Object.create(null);let blockType=null;let blockId=0;let urlFilters=[];__exports.checkPrimaryTemplateParents=checkPrimaryTemplateParents;function checkPrimaryTemplateParents(namesToCheck){const missing=new Set(namesToCheck.filter((name)=>!(name in templates)));if(missing.size){console.error(`Missing (primary) parent templates: ${[...missing].join(", ")}`);}}
__exports.clearProcessedTemplates=clearProcessedTemplates;function clearProcessedTemplates(){processedTemplates.clear();}
__exports.getTemplate=getTemplate;function getTemplate(name){if(!processedTemplates.has(name)){processedTemplates.set(name,_getTemplate(name));}
return processedTemplates.get(name);}
__exports.registerTemplate=registerTemplate;function registerTemplate(name,url,templateString){if(isRegistered(...arguments)){return;}
if(blockType!=="templates"){blockType="templates";blockId++;}
if(name in templates&&(info[name].url!==url||templates[name]!==templateString)){throw new Error(`Template ${name} already exists`);}
templates[name]=templateString;info[name]={blockId,url};}
__exports.registerTemplateExtension=registerTemplateExtension;function registerTemplateExtension(inheritFrom,url,templateString){if(isRegistered(...arguments)){return;}
if(blockType!=="extensions"){blockType="extensions";blockId++;}
if(!templateExtensions[inheritFrom]){templateExtensions[inheritFrom]=[];}
if(!templateExtensions[inheritFrom][blockId]){templateExtensions[inheritFrom][blockId]=[];}
templateExtensions[inheritFrom][blockId].push({templateString,url,});}
__exports.registerTemplateProcessor=registerTemplateProcessor;function registerTemplateProcessor(processor){templateProcessors.push(processor);}
__exports.setUrlFilters=setUrlFilters;function setUrlFilters(filters){urlFilters=filters;}
return __exports;});;

/* /web/static/src/core/template_inheritance.js */
odoo.define('@web/core/template_inheritance',[],function(require){'use strict';let __exports={};const RSTRIP_REGEXP=/(?=\n[ \t]*$)/;function addBefore(target,operation){const nodes=getNodes(target,operation);if(nodes.length===0){return;}
const{previousSibling}=target;target.before(...nodes);if(previousSibling?.nodeType===Node.TEXT_NODE){const[text1,text2]=previousSibling.data.split(RSTRIP_REGEXP);previousSibling.data=text1.trimEnd();if(nodes[0].nodeType===Node.TEXT_NODE){mergeTextNodes(previousSibling,nodes[0]);}
if(text2&&nodes.some((n)=>n.nodeType!==Node.TEXT_NODE)){const textNode=document.createTextNode(text2);target.before(textNode);if(textNode.previousSibling.nodeType===Node.TEXT_NODE){mergeTextNodes(textNode.previousSibling,textNode);}}}}
function getRoot(element){while(element.parentElement){element=element.parentElement;}
return element;}
const HASCLASS_REGEXP=/hasclass\(([^)]*)\)/g;function getXpath(operation){const xpath=operation.getAttribute("expr");return xpath.replaceAll(HASCLASS_REGEXP,(_,capturedGroup)=>{return capturedGroup.split(",").map((c)=>`contains(concat(' ', @class, ' '), ' ${c.trim().slice(1, -1)} ')`).join(" and ");});}
function getNode(element,operation){const root=getRoot(element);const doc=new Document();doc.appendChild(root);if(operation.tagName==="xpath"){const xpath=getXpath(operation);const result=doc.evaluate(xpath,root,null,XPathResult.FIRST_ORDERED_NODE_TYPE);return result.singleNodeValue;}
for(const elem of root.querySelectorAll(operation.tagName)){if([...operation.attributes].every(({name,value})=>name==="position"||elem.getAttribute(name)===value)){return elem;}}
return null;}
function getElement(element,operation){const node=getNode(element,operation);if(!node){throw new Error(`Element '${operation.outerHTML}' cannot be located in element tree`);}
if(!(node instanceof Element)){throw new Error(`Found node ${node} instead of an element`);}
return node;}
function getNodes(element,operation){const nodes=[];for(const childNode of operation.childNodes){if(childNode.tagName==="xpath"&&childNode.getAttribute?.("position")==="move"){const node=getElement(element,childNode);removeNode(node);nodes.push(node);}else{nodes.push(childNode);}}
return nodes;}
function mergeTextNodes(first,second,trimEnd=true){first.data=(trimEnd?first.data.trimEnd():first.data)+second.data;second.remove();}
function splitAndTrim(str,separator){return str.split(separator).map((s)=>s.trim());}
function modifyAttributes(target,operation){for(const child of operation.children){if(child.tagName!=="attribute"){continue;}
const attributeName=child.getAttribute("name");const firstNode=child.childNodes[0];let value=firstNode?.nodeType===Node.TEXT_NODE?firstNode.data:"";const add=child.getAttribute("add")||"";const remove=child.getAttribute("remove")||"";if(add||remove){if(firstNode?.nodeType===Node.TEXT_NODE){throw new Error(`Useless element content ${firstNode.outerHTML}`);}
const separator=child.getAttribute("separator")||",";const toRemove=new Set(splitAndTrim(remove,separator));const values=splitAndTrim(target.getAttribute(attributeName)||"",separator).filter((s)=>!toRemove.has(s));values.push(...splitAndTrim(add,separator).filter((s)=>s));value=values.join(separator);}
if(value){target.setAttribute(attributeName,value);}else{target.removeAttribute(attributeName);}}}
function removeNode(node){const{nextSibling,previousSibling}=node;node.remove();if(nextSibling?.nodeType===Node.TEXT_NODE&&previousSibling?.nodeType===Node.TEXT_NODE){mergeTextNodes(previousSibling,nextSibling,previousSibling.parentElement.firstChild===previousSibling);}}
function replace(root,target,operation){const mode=operation.getAttribute("mode")||"outer";switch(mode){case"outer":{const result=operation.ownerDocument.evaluate(".//*[text()='$0']",operation,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE);for(let i=0;i<result.snapshotLength;i++){const loc=result.snapshotItem(i);loc.firstChild.replaceWith(target.cloneNode(true));}
if(target.parentElement){const nodes=getNodes(target,operation);target.replaceWith(...nodes);}else{let operationContent=null;let comment=null;for(const child of operation.childNodes){if(child.nodeType===Node.ELEMENT_NODE){operationContent=child;break;}
if(child.nodeType===Node.COMMENT_NODE){comment=child;}}
root=operationContent.cloneNode(true);if(target.hasAttribute("t-name")){root.setAttribute("t-name",target.getAttribute("t-name"));}
if(comment){root.prepend(comment);}}
break;}
case"inner":while(target.firstChild){target.removeChild(target.lastChild);}
target.append(...operation.childNodes);break;default:throw new Error(`Invalid mode attribute: '${mode}'`);}
return root;}
__exports.applyInheritance=applyInheritance;function applyInheritance(root,operations,url=""){for(const operation of operations.children){const target=getElement(root,operation);const position=operation.getAttribute("position")||"inside";if(odoo.debug&&url){const attributes=[...operation.attributes].map(({name,value})=>`${name}=${JSON.stringify(name === "position" ? position : value)}`);const comment=document.createComment(` From file: ${url} ; ${attributes.join(" ; ")} `);if(position==="attributes"){target.before(comment);}else{operation.prepend(comment);}}
switch(position){case"replace":{root=replace(root,target,operation);break;}
case"attributes":{modifyAttributes(target,operation);break;}
case"inside":{const sentinel=document.createElement("sentinel");target.append(sentinel);addBefore(sentinel,operation);removeNode(sentinel);break;}
case"after":{const sentinel=document.createElement("sentinel");target.after(sentinel);addBefore(sentinel,operation);removeNode(sentinel);break;}
case"before":{addBefore(target,operation);break;}
default:throw new Error(`Invalid position attribute: '${position}'`);}}
return root;}
return __exports;});;

/* /web_editor/static/src/js/editor/odoo-editor/src/utils/utils.js */
odoo.define('@web_editor/js/editor/odoo-editor/src/utils/utils',[],function(require){'use strict';let __exports={};const DIRECTIONS=__exports.DIRECTIONS={LEFT:false,RIGHT:true,};const CTYPES=__exports.CTYPES={CONTENT:1,SPACE:2,BLOCK_OUTSIDE:4,BLOCK_INSIDE:8,BR:16,};__exports.ctypeToString=ctypeToString;function ctypeToString(ctype){return Object.keys(CTYPES).find((key)=>CTYPES[key]===ctype);}
const CTGROUPS=__exports.CTGROUPS={INLINE:CTYPES.CONTENT|CTYPES.SPACE,BLOCK:CTYPES.BLOCK_OUTSIDE|CTYPES.BLOCK_INSIDE,BR:CTYPES.BR,};const tldWhitelist=['com','net','org','ac','ad','ae','af','ag','ai','al','am','an','ao','aq','ar','as','at','au','aw','ax','az','ba','bb','bd','be','bf','bg','bh','bi','bj','bl','bm','bn','bo','br','bq','bs','bt','bv','bw','by','bz','ca','cc','cd','cf','cg','ch','ci','ck','cl','cm','cn','co','cr','cs','cu','cv','cw','cx','cy','cz','dd','de','dj','dk','dm','do','dz','ec','ee','eg','eh','er','es','et','eu','fi','fj','fk','fm','fo','fr','ga','gb','gd','ge','gf','gg','gh','gi','gl','gm','gn','gp','gq','gr','gs','gt','gu','gw','gy','hk','hm','hn','hr','ht','hu','id','ie','il','im','in','io','iq','ir','is','it','je','jm','jo','jp','ke','kg','kh','ki','km','kn','kp','kr','kw','ky','kz','la','lb','lc','li','lk','lr','ls','lt','lu','lv','ly','ma','mc','md','me','mf','mg','mh','mk','ml','mm','mn','mo','mp','mq','mr','ms','mt','mu','mv','mw','mx','my','mz','na','nc','ne','nf','ng','ni','nl','no','np','nr','nu','nz','om','pa','pe','pf','pg','ph','pk','pl','pm','pn','pr','ps','pt','pw','py','qa','re','ro','rs','ru','rw','sa','sb','sc','sd','se','sg','sh','si','sj','sk','sl','sm','sn','so','sr','ss','st','su','sv','sx','sy','sz','tc','td','tf','tg','th','tj','tk','tl','tm','tn','to','tp','tr','tt','tv','tw','tz','ua','ug','uk','um','us','uy','uz','va','vc','ve','vg','vi','vn','vu','wf','ws','ye','yt','yu','za','zm','zr','zw','co\\.uk'];const urlRegexBase=`|(?:www.))[-a-zA-Z0-9@:%._\\+~#=]{2,256}\\.[a-zA-Z][a-zA-Z0-9]{1,62}|(?:[-a-zA-Z0-9@:%._\\+~#=]{2,256}\\.(?:${tldWhitelist.join('|')})\\b))(?:(?:[/?#])[^\\s]*[^!.,})\\]'"\\s]|(?:[^!(){}.,[\\]'"\\s]+))?`;const httpCapturedRegex=`(https?:\\/\\/)`;const URL_REGEX=__exports.URL_REGEX=new RegExp(`((?:(?:${httpCapturedRegex}${urlRegexBase})`,'i');const YOUTUBE_URL_GET_VIDEO_ID=__exports.YOUTUBE_URL_GET_VIDEO_ID=/^(?:(?:https?:)?\/\/)?(?:(?:www|m)\.)?(?:youtube\.com|youtu\.be)(?:\/(?:[\w-]+\?v=|embed\/|v\/)?)([^\s?&#]+)(?:\S+)?$/i;const EMAIL_REGEX=__exports.EMAIL_REGEX=/^(mailto:)?[\w-.]+@(?:[\w-]+\.)+[\w-]{2,4}$/i;const PHONE_REGEX=__exports.PHONE_REGEX=/^(tel:(?:\/\/)?)?\+?[\d\s.\-()\/]{3,25}$/;const PROTECTED_BLOCK_TAG=__exports.PROTECTED_BLOCK_TAG=['TR','TD','TABLE','TBODY','UL','OL','LI'];const FONT_SIZE_CLASSES=__exports.FONT_SIZE_CLASSES=["display-1-fs","display-2-fs","display-3-fs","display-4-fs","h1-fs","h2-fs","h3-fs","h4-fs","h5-fs","h6-fs","base-fs","o_small-fs","small","o_small_twelve-fs","o_small_ten-fs","o_small_eight-fs"];const TEXT_STYLE_CLASSES=__exports.TEXT_STYLE_CLASSES=["display-1","display-2","display-3","display-4","lead","o_small","small"];const ZWNBSP_CHAR='\ufeff';const ZERO_WIDTH_CHARS=__exports.ZERO_WIDTH_CHARS=['\u200b',ZWNBSP_CHAR];const ZERO_WIDTH_CHARS_REGEX=__exports.ZERO_WIDTH_CHARS_REGEX=new RegExp(`[${ZERO_WIDTH_CHARS.join('')}]`,'g');__exports.leftPos=leftPos;function leftPos(node){return[node.parentNode,childNodeIndex(node)];}
__exports.rightPos=rightPos;function rightPos(node){return[node.parentNode,childNodeIndex(node)+1];}
__exports.boundariesOut=boundariesOut;function boundariesOut(node){const index=childNodeIndex(node);return[node.parentNode,index,node.parentNode,index+1];}
__exports.startPos=startPos;function startPos(node){return[node,0];}
__exports.endPos=endPos;function endPos(node){return[node,nodeSize(node)];}
__exports.boundariesIn=boundariesIn;function boundariesIn(node){return[node,0,node,nodeSize(node)];}
__exports.childNodeIndex=childNodeIndex;function childNodeIndex(node){let i=0;while(node.previousSibling){i++;node=node.previousSibling;}
return i;}
__exports.nodeSize=nodeSize;function nodeSize(node){const isTextNode=node.nodeType===Node.TEXT_NODE;return isTextNode?node.length:node.childNodes.length;}
const closestPath=__exports.closestPath=function*(node){while(node){yield node;node=node.parentNode;}};const PATH_END_REASONS={NO_NODE:0,BLOCK_OUT:1,BLOCK_HIT:2,OUT_OF_SCOPE:3,};__exports.createDOMPathGenerator=createDOMPathGenerator;function createDOMPathGenerator(direction,{leafOnly=false,inScope=false,stopTraverseFunction,stopFunction}={},){const nextDeepest=direction===DIRECTIONS.LEFT?node=>lastLeaf(node.previousSibling,stopTraverseFunction):node=>firstLeaf(node.nextSibling,stopTraverseFunction);const firstNode=direction===DIRECTIONS.LEFT?(node,offset)=>lastLeaf(node.childNodes[offset-1],stopTraverseFunction):(node,offset)=>firstLeaf(node.childNodes[offset],stopTraverseFunction);return function*(node,offset,reasons=[]){let movedUp=false;let currentNode=firstNode(node,offset);if(!currentNode){movedUp=true;currentNode=node;}
while(currentNode){if(stopFunction&&stopFunction(currentNode)){reasons.push(movedUp?PATH_END_REASONS.BLOCK_OUT:PATH_END_REASONS.BLOCK_HIT);break;}
if(inScope&&currentNode===node){reasons.push(PATH_END_REASONS.OUT_OF_SCOPE);break;}
if(!(leafOnly&&movedUp)){yield currentNode;}
movedUp=false;let nextNode=nextDeepest(currentNode);if(!nextNode){movedUp=true;nextNode=currentNode.parentNode;}
currentNode=nextNode;}
reasons.push(PATH_END_REASONS.NO_NODE);};}
__exports.findNode=findNode;function findNode(domPath,findCallback=()=>true,stopCallback=()=>false){for(const node of domPath){if(findCallback(node)){return node;}
if(stopCallback(node)){break;}}
return null;}
__exports.getFurthestUneditableParent=getFurthestUneditableParent;function getFurthestUneditableParent(node,parentLimit){if(node===parentLimit||(parentLimit&&!parentLimit.contains(node))){return undefined;}
let parent=node&&node.parentElement;let nonEditableElement;while(parent&&(!parentLimit||parent!==parentLimit)){if(!parent.isContentEditable){nonEditableElement=parent;}
if(parent.oid==="root"){break;}
parent=parent.parentElement;}
return nonEditableElement;}
__exports.closestElement=closestElement;function closestElement(node,predicate="*"){if(!node)return null;let element=node.nodeType===Node.ELEMENT_NODE?node:node.parentElement;if(typeof predicate==='function'){while(element&&!predicate(element)){element=element.parentElement;}}else{element=element?.closest(predicate);}
return element?.closest('.odoo-editor-editable')&&element;}
__exports.ancestors=ancestors;function ancestors(node,editable){if(!node||!node.parentElement||node===editable)return[];return[node.parentElement,...ancestors(node.parentElement,editable)];}
__exports.descendants=descendants;function descendants(node){const posterity=[];for(const child of(node.childNodes||[])){posterity.push(child,...descendants(child));}
return posterity;}
__exports.closestBlock=closestBlock;function closestBlock(node){return findNode(closestPath(node),node=>isBlock(node));}
__exports.lastLeaf=lastLeaf;function lastLeaf(node,stopTraverseFunction){while(node&&node.lastChild&&!(stopTraverseFunction&&stopTraverseFunction(node))){node=node.lastChild;}
return node;}
__exports.firstLeaf=firstLeaf;function firstLeaf(node,stopTraverseFunction){while(node&&node.firstChild&&!(stopTraverseFunction&&stopTraverseFunction(node))){node=node.firstChild;}
return node;}
__exports.previousLeaf=previousLeaf;function previousLeaf(node,editable,skipInvisible=false){let ancestor=node;while(ancestor&&!ancestor.previousSibling&&ancestor!==editable){ancestor=ancestor.parentElement;}
if(ancestor&&ancestor!==editable){if(skipInvisible&&!isVisible(ancestor.previousSibling)){return previousLeaf(ancestor.previousSibling,editable,skipInvisible);}else{const last=lastLeaf(ancestor.previousSibling);if(skipInvisible&&!isVisible(last)){return previousLeaf(last,editable,skipInvisible);}else{return last;}}}}
__exports.nextLeaf=nextLeaf;function nextLeaf(node,editable,skipInvisible=false){let ancestor=node;while(ancestor&&!ancestor.nextSibling&&ancestor!==editable){ancestor=ancestor.parentElement;}
if(ancestor&&ancestor!==editable){if(skipInvisible&&ancestor.nextSibling&&!isVisible(ancestor.nextSibling)){return nextLeaf(ancestor.nextSibling,editable,skipInvisible);}else{const first=firstLeaf(ancestor.nextSibling);if(skipInvisible&&!isVisible(first)){return nextLeaf(first,editable,skipInvisible);}else{return first;}}}}
__exports.getAdjacentPreviousSiblings=getAdjacentPreviousSiblings;function getAdjacentPreviousSiblings(node,predicate=n=>!!n){let previous=node.previousSibling;const list=[];while(previous&&predicate(previous)){list.push(previous);previous=previous.previousSibling;}
return list;}
__exports.getAdjacentNextSiblings=getAdjacentNextSiblings;function getAdjacentNextSiblings(node,predicate=n=>!!n){let next=node.nextSibling;const list=[];while(next&&predicate(next)){list.push(next);next=next.nextSibling;}
return list;}
__exports.getAdjacents=getAdjacents;function getAdjacents(node,predicate=n=>!!n){const previous=getAdjacentPreviousSiblings(node,predicate);const next=getAdjacentNextSiblings(node,predicate);return predicate(node)?[...previous.reverse(),node,...next]:[];}
__exports.hasTableSelection=hasTableSelection;function hasTableSelection(editable){return!!editable.querySelector('.o_selected_table');}
__exports.hasValidSelection=hasValidSelection;function hasValidSelection(editable){return hasTableSelection(editable)||editable.ownerDocument.getSelection().rangeCount>0;}
__exports.getNormalizedCursorPosition=getNormalizedCursorPosition;function getNormalizedCursorPosition(node,offset,full=true){const editable=closestElement(node,'.odoo-editor-editable');let closest=closestElement(node);while(closest&&closest!==editable&&(isSelfClosingElement(node)||!closest.isContentEditable)){[node,offset]=offset||!nodeSize(node)?rightPos(node):leftPos(node);closest=closestElement(node);}
offset=Math.min(Math.max(offset,0),nodeSize(node));if(full){let el;let elOffset;if(node.nodeType===Node.ELEMENT_NODE){el=node;elOffset=offset;}else if(node.nodeType===Node.TEXT_NODE){if(offset===0){el=node.parentNode;elOffset=childNodeIndex(node);}else if(offset===node.length){el=node.parentNode;elOffset=childNodeIndex(node)+1;}}
if(el){const leftInlineNode=leftLeafOnlyInScopeNotBlockEditablePath(el,elOffset).next().value;let leftVisibleEmpty=false;if(leftInlineNode){leftVisibleEmpty=isSelfClosingElement(leftInlineNode)||!closestElement(leftInlineNode).isContentEditable;[node,offset]=leftVisibleEmpty?rightPos(leftInlineNode):endPos(leftInlineNode);}
if(!leftInlineNode||leftVisibleEmpty){const rightInlineNode=rightLeafOnlyInScopeNotBlockEditablePath(el,elOffset).next().value;if(rightInlineNode){const closest=closestElement(rightInlineNode);const rightVisibleEmpty=isSelfClosingElement(rightInlineNode)||!closest||!closest.isContentEditable;if(!(leftVisibleEmpty&&rightVisibleEmpty)){[node,offset]=rightVisibleEmpty?leftPos(rightInlineNode):startPos(rightInlineNode);}}}}}
const prevNode=node.nodeType===Node.ELEMENT_NODE&&node.childNodes[offset-1];if(prevNode&&prevNode.nodeName==='BR'&&isFakeLineBreak(prevNode)){offset--;}
return[node,offset];}
__exports.insertSelectionChars=insertSelectionChars;function insertSelectionChars(anchorNode,anchorOffset,focusNode,focusOffset,startChar='[',endChar=']'){if(anchorNode===focusNode&&anchorOffset<=focusOffset){focusOffset+=(focusNode.nodeType===Node.TEXT_NODE?startChar.length:1);}
insertCharsAt(startChar,anchorNode,anchorOffset);insertCharsAt(endChar,focusNode,focusOffset);}
__exports.logSelection=logSelection;function logSelection(root,options={}){const sel=options.selection||root.ownerDocument.getSelection();if(!root.contains(sel.anchorNode)||!root.contains(sel.focusNode)){console.warn('The selection is not contained in the root.');return;}
let anchorClone,focusClone;const cloneTree=node=>{const clone=node.cloneNode();if(options.includeOids){clone.oid=node.oid;}
anchorClone=anchorClone||(node===sel.anchorNode&&clone);focusClone=focusClone||(node===sel.focusNode&&clone);for(const child of node.childNodes||[]){clone.append(cloneTree(child));}
return clone;}
const rootClone=cloneTree(root);insertSelectionChars(anchorClone,sel.anchorOffset,focusClone,sel.focusOffset,'%c[%c','%c]%c');rootClone.removeAttribute('data-last-history-steps');if(options.doFormat){const formatHtml=(node,spaces=0)=>{node.before(document.createTextNode('\n'+' '.repeat(spaces)));for(const child of[...node.childNodes]){formatHtml(child,spaces+4);}
if(node.nodeType!==Node.TEXT_NODE){node.appendChild(document.createTextNode('\n'+' '.repeat(spaces)));}
if(options.includeOids){if(node.nodeType===Node.TEXT_NODE){node.textContent+=` (${node.oid})`;}else{node.setAttribute('oid',node.oid);}}}
formatHtml(rootClone);}
const selectionCharacterStyle='color: #75bfff; font-weight: 700;';const defaultStyle='color: inherit; font-weight: inherit;';console.log(makeZeroWidthCharactersVisible(rootClone.outerHTML),selectionCharacterStyle,defaultStyle,selectionCharacterStyle,defaultStyle,);}
__exports.ensureFocus=ensureFocus;function ensureFocus(element){const activeElement=element.ownerDocument.activeElement;if(activeElement!==element&&(!element.contains(activeElement)||!activeElement.isContentEditable)){element.focus();}}
__exports.setSelection=setSelection;function setSelection(anchorNode,anchorOffset,focusNode=anchorNode,focusOffset=anchorOffset,normalize=true,){if(!anchorNode||!anchorNode.parentElement||!anchorNode.parentElement.closest('body')||!focusNode||!focusNode.parentElement||!focusNode.parentElement.closest('body')){return null;}
const document=anchorNode.ownerDocument;const seemsCollapsed=anchorNode===focusNode&&anchorOffset===focusOffset;[anchorNode,anchorOffset]=getNormalizedCursorPosition(anchorNode,anchorOffset,normalize);[focusNode,focusOffset]=seemsCollapsed?[anchorNode,anchorOffset]:getNormalizedCursorPosition(focusNode,focusOffset,normalize);const direction=getCursorDirection(anchorNode,anchorOffset,focusNode,focusOffset);const sel=document.getSelection();if(!sel){return null;}
try{const range=new Range();if(direction===DIRECTIONS.RIGHT){range.setStart(anchorNode,anchorOffset);range.collapse(true);}else{range.setEnd(anchorNode,anchorOffset);range.collapse(false);}
sel.removeAllRanges();sel.addRange(range);sel.extend(focusNode,focusOffset);}catch(e){if(e.name!=='NS_ERROR_FAILURE'){throw e;}}
return[anchorNode,anchorOffset,focusNode,focusOffset];}
__exports.setCursorStart=setCursorStart;function setCursorStart(node,normalize=true){const pos=startPos(node);return setSelection(...pos,...pos,normalize);}
__exports.setCursorEnd=setCursorEnd;function setCursorEnd(node,normalize=true){const pos=endPos(node);return setSelection(...pos,...pos,normalize);}
__exports.getCursorDirection=getCursorDirection;function getCursorDirection(anchorNode,anchorOffset,focusNode,focusOffset){if(anchorNode===focusNode){if(anchorOffset===focusOffset)return false;return anchorOffset<focusOffset?DIRECTIONS.RIGHT:DIRECTIONS.LEFT;}
return anchorNode.compareDocumentPosition(focusNode)&Node.DOCUMENT_POSITION_FOLLOWING?DIRECTIONS.RIGHT:DIRECTIONS.LEFT;}
__exports.getTraversedNodes=getTraversedNodes;function getTraversedNodes(editable,range=getDeepRange(editable)){const selectedTableCells=editable.querySelectorAll('.o_selected_td');const document=editable.ownerDocument;if(!range)return[];const iterator=document.createNodeIterator(range.commonAncestorContainer);let node;do{node=iterator.nextNode();}while(node&&node!==range.startContainer&&!(selectedTableCells.length&&node===selectedTableCells[0]));if(node&&!(selectedTableCells.length&&node===selectedTableCells[0])&&!range.collapsed&&node.nodeType===Node.ELEMENT_NODE&&node.childNodes.length&&range.startOffset&&node.childNodes[range.startOffset-1].nodeName==="BR"){const targetBr=node.childNodes[range.startOffset-1];while(node!=targetBr){node=iterator.nextNode();}
node=iterator.nextNode();}
if(node&&!range.collapsed&&node===range.startContainer&&range.startOffset===nodeSize(node)&&node.nextSibling&&node.nextSibling.nodeName==="BR"){node=iterator.nextNode();}
const traversedNodes=new Set([node,...descendants(node)]);while(node&&node!==range.endContainer){node=iterator.nextNode();if(node){const selectedTable=closestElement(node,'.o_selected_table');if(selectedTable){for(const selectedTd of selectedTable.querySelectorAll('.o_selected_td')){traversedNodes.add(selectedTd);descendants(selectedTd).forEach(descendant=>traversedNodes.add(descendant));}}else if(!(node===range.endContainer&&range.endOffset===0&&!range.collapsed&&node.previousSibling&&node.previousSibling.nodeName==="BR")){traversedNodes.add(node);}}}
if(node){for(const descendant of descendants(node)){if(descendant.parentElement===node&&childNodeIndex(descendant)>=range.endOffset){break;}
traversedNodes.add(descendant);}}
return[...traversedNodes];}
__exports.getSelectedNodes=getSelectedNodes;function getSelectedNodes(editable){const selectedTableCells=editable.querySelectorAll('.o_selected_td');const document=editable.ownerDocument;const sel=document.getSelection();if(!sel.rangeCount&&!selectedTableCells.length){return[];}
const range=sel.getRangeAt(0);return[...new Set(getTraversedNodes(editable).flatMap(node=>{const td=closestElement(node,'.o_selected_td');if(td){return descendants(td);}else if(range.isPointInRange(node,0)&&range.isPointInRange(node,nodeSize(node))){return node;}else{return[];}},))];}
__exports.getDeepRange=getDeepRange;function getDeepRange(editable,{range,sel,splitText,select,correctTripleClick}={}){sel=sel||editable.parentElement&&editable.ownerDocument.getSelection();if(sel&&sel.isCollapsed&&sel.anchorNode&&sel.anchorNode.nodeName==="BR"){setSelection(sel.anchorNode.parentElement,childNodeIndex(sel.anchorNode));}
range=range?range.cloneRange():sel&&sel.rangeCount&&sel.getRangeAt(0).cloneRange();if(!range)return;let start=range.startContainer;let startOffset=range.startOffset;let end=range.endContainer;let endOffset=range.endOffset;const isBackwards=!range.collapsed&&start===sel.focusNode&&startOffset===sel.focusOffset;[start,startOffset]=getDeepestPosition(start,startOffset);[end,endOffset]=getDeepestPosition(end,endOffset);if(splitText){const isInSingleContainer=start===end;if(end.nodeType===Node.TEXT_NODE&&endOffset!==0&&endOffset!==end.textContent.length){const endParent=end.parentNode;const splitOffset=splitTextNode(end,endOffset);end=endParent.childNodes[splitOffset-1]||endParent.firstChild;if(isInSingleContainer){start=end;}
endOffset=end.textContent.length;}
if(start.nodeType===Node.TEXT_NODE&&startOffset!==0&&startOffset!==start.textContent.length){splitTextNode(start,startOffset);startOffset=0;if(isInSingleContainer){endOffset=start.textContent.length;}}}
const endLeaf=firstLeaf(end);const beforeEnd=endLeaf.previousSibling;const isInsideColumn=closestElement(end,'.o_text_columns')
if(correctTripleClick&&!endOffset&&(start!==end||startOffset!==endOffset)&&(!beforeEnd||(beforeEnd.nodeType===Node.TEXT_NODE&&!isVisibleTextNode(beforeEnd)&&!isZWS(beforeEnd)))&&!closestElement(endLeaf,'table')&&!isInsideColumn){const previous=previousLeaf(endLeaf,editable,true);if(previous&&closestElement(previous).isContentEditable){[end,endOffset]=[previous,nodeSize(previous)];}}
if(select){if(isBackwards){[start,end,startOffset,endOffset]=[end,start,endOffset,startOffset];range.setEnd(start,startOffset);range.collapse(false);}else{range.setStart(start,startOffset);range.collapse(true);}
sel.removeAllRanges();sel.addRange(range);try{sel.extend(end,endOffset);}catch{}
range=sel.getRangeAt(0);}else{range.setStart(start,startOffset);range.setEnd(end,endOffset);}
return range;}
__exports.getAdjacentCharacter=getAdjacentCharacter;function getAdjacentCharacter(editable,side){let{focusNode,focusOffset}=editable.ownerDocument.getSelection();[focusNode,focusOffset]=getDeepestPosition(focusNode,focusOffset);const originalBlock=closestBlock(focusNode);let adjacentCharacter;while(!adjacentCharacter&&focusNode){if(side==='previous'){adjacentCharacter=focusOffset>0&&focusNode.textContent[focusOffset-1];}else{adjacentCharacter=focusNode.textContent[focusOffset];}
if(!adjacentCharacter){if(side==='previous'){focusNode=previousLeaf(focusNode,editable);focusOffset=focusNode&&nodeSize(focusNode);}else{focusNode=nextLeaf(focusNode,editable);focusOffset=0;}
const characterIndex=side==='previous'?focusOffset-1:focusOffset;adjacentCharacter=focusNode&&focusNode.textContent[characterIndex];}}
return closestBlock(focusNode)===originalBlock?adjacentCharacter:undefined;}
__exports.isZwnbsp=isZwnbsp;function isZwnbsp(node){return node.nodeType===Node.TEXT_NODE&&node.textContent==='\ufeff';}
function isTangible(node){return isVisible(node)||isZwnbsp(node)||hasTangibleContent(node);}
function hasTangibleContent(node){return[...(node?.childNodes||[])].some(n=>isTangible(n));}
__exports.getDeepestPosition=getDeepestPosition;function getDeepestPosition(node,offset){let direction=DIRECTIONS.RIGHT;let next=node;while(next){if(isTangible(next)||isZWS(next)){if(next!==node){[node,offset]=[next,direction?0:nodeSize(next)];}
direction=offset<node.childNodes.length;next=node.childNodes[direction?offset:offset-1];}else if(direction&&next.nextSibling&&closestBlock(node)?.contains(next.nextSibling)){next=next.nextSibling;}else{direction=DIRECTIONS.LEFT;next=closestBlock(node)?.contains(next.previousSibling)&&next.previousSibling;}
next=!isSelfClosingElement(next)&&next;}
return[node,offset];}
__exports.getCursors=getCursors;function getCursors(document){const sel=document.getSelection();if(getCursorDirection(sel.anchorNode,sel.anchorOffset,sel.focusNode,sel.focusOffset)===DIRECTIONS.LEFT)
return[[sel.focusNode,sel.focusOffset],[sel.anchorNode,sel.anchorOffset],];return[[sel.anchorNode,sel.anchorOffset],[sel.focusNode,sel.focusOffset],];}
__exports.preserveCursor=preserveCursor;function preserveCursor(document){const sel=document.getSelection();const cursorPos=[sel.anchorNode,sel.anchorOffset,sel.focusNode,sel.focusOffset];return replace=>{replace=replace||new Map();cursorPos[0]=replace.get(cursorPos[0])||cursorPos[0];cursorPos[2]=replace.get(cursorPos[2])||cursorPos[2];return setSelection(...cursorPos,false);};}
__exports.isSelectionInSelectors=isSelectionInSelectors;function isSelectionInSelectors(selector){let anchor=document.getSelection().anchorNode;if(anchor&&anchor.nodeType&&anchor.nodeType!==Node.ELEMENT_NODE){anchor=anchor.parentElement;}
if(anchor&&closestElement(anchor,selector)){return true;}
return false;}
__exports.getOffsetAndCharSize=getOffsetAndCharSize;function getOffsetAndCharSize(nodeValue,offset,direction){const splittedNodeValue=[...nodeValue];let charSize=1;let newOffset=offset;let currentSize=0;for(const item of splittedNodeValue){currentSize+=item.length;if(currentSize>=offset){newOffset=direction==DIRECTIONS.LEFT?currentSize:currentSize-item.length;charSize=item.length;break;}}
return[newOffset,charSize];}
const formatsSpecs=__exports.formatsSpecs={italic:{tagName:'em',isFormatted:isItalic,isTag:(node)=>['EM','I'].includes(node.tagName),hasStyle:(node)=>Boolean(node.style&&node.style['font-style']),addStyle:(node)=>node.style['font-style']='italic',addNeutralStyle:(node)=>node.style['font-style']='normal',removeStyle:(node)=>removeStyle(node,'font-style'),},bold:{tagName:'strong',isFormatted:isBold,isTag:(node)=>['STRONG','B'].includes(node.tagName),hasStyle:(node)=>Boolean(node.style&&node.style['font-weight']),addStyle:(node)=>node.style['font-weight']='bolder',addNeutralStyle:(node)=>{node.style['font-weight']='normal'},removeStyle:(node)=>removeStyle(node,'font-weight'),},underline:{tagName:'u',isFormatted:isUnderline,isTag:(node)=>node.tagName==='U',hasStyle:(node)=>node.style&&node.style['text-decoration-line'].includes('underline'),addStyle:(node)=>node.style['text-decoration-line']+=' underline',removeStyle:(node)=>removeStyle(node,'text-decoration-line','underline'),},strikeThrough:{tagName:'s',isFormatted:isStrikeThrough,isTag:(node)=>node.tagName==='S',hasStyle:(node)=>node.style&&node.style['text-decoration-line'].includes('line-through'),addStyle:(node)=>node.style['text-decoration-line']+=' line-through',removeStyle:(node)=>removeStyle(node,'text-decoration-line','line-through'),},fontSize:{isFormatted:isFontSize,hasStyle:(node)=>node.style&&node.style['font-size'],addStyle:(node,props)=>{node.style['font-size']=props.size;node.classList.remove(...FONT_SIZE_CLASSES);},removeStyle:(node)=>removeStyle(node,'font-size'),},setFontSizeClassName:{isFormatted:hasClass,hasStyle:(node,props)=>FONT_SIZE_CLASSES.find(cls=>node.classList.contains(cls)),addStyle:(node,props)=>node.classList.add(props.className),removeStyle:(node)=>{node.classList.remove(...FONT_SIZE_CLASSES,...TEXT_STYLE_CLASSES);if(node.classList.length===0){node.removeAttribute("class");}},},switchDirection:{isFormatted:isDirectionSwitched,}}
const removeStyle=(node,styleName,item)=>{if(item){const newStyle=node.style[styleName].split(' ').filter(x=>x!==item).join(' ');node.style[styleName]=newStyle||null;}else{node.style[styleName]=null;}
if(node.getAttribute('style')===''){node.removeAttribute('style');}};const getOrCreateSpan=(node,ancestors)=>{const span=ancestors.find((element)=>element.tagName==='SPAN'&&element.isConnected);const lastInlineAncestor=ancestors.findLast((element)=>!isBlock(element)&&element.isConnected);if(span){return span;}else{const span=document.createElement('span');if(lastInlineAncestor){lastInlineAncestor.after(span);span.append(lastInlineAncestor);}else{node.after(span);span.append(node);}
return span;}}
const removeFormat=(node,formatSpec)=>{node=closestElement(node);if(formatSpec.hasStyle(node)){formatSpec.removeStyle(node);if(['SPAN','FONT'].includes(node.tagName)&&!node.getAttributeNames().length){return unwrapContents(node);}}
if(formatSpec.isTag&&formatSpec.isTag(node)){const attributesNames=node.getAttributeNames().filter((name)=>{return name!=='data-oe-zws-empty-inline';});if(attributesNames.length){const newNode=document.createElement('span');while(node.firstChild){newNode.appendChild(node.firstChild);}
for(let index=node.attributes.length-1;index>=0;--index){newNode.attributes.setNamedItem(node.attributes[index].cloneNode());}
node.parentNode.replaceChild(newNode,node);}else{unwrapContents(node);}}}
const formatSelection=__exports.formatSelection=(editor,formatName,{applyStyle,formatProps}={})=>{const selection=editor.document.getSelection();let direction
let wasCollapsed;if(editor.editable.querySelector('.o_selected_td')){direction=DIRECTIONS.RIGHT;}else{if(!selection.rangeCount)return;wasCollapsed=selection.getRangeAt(0).collapsed;direction=getCursorDirection(selection.anchorNode,selection.anchorOffset,selection.focusNode,selection.focusOffset);}
getDeepRange(editor.editable,{splitText:true,select:true,correctTripleClick:true});if(typeof applyStyle==='undefined'){applyStyle=!isSelectionFormat(editor.editable,formatName);}
let zws;if(wasCollapsed){if(selection.anchorNode.nodeType===Node.TEXT_NODE&&selection.anchorNode.textContent==='\u200b'){zws=selection.anchorNode;selection.getRangeAt(0).selectNode(zws);}else{zws=insertAndSelectZws(selection);}
getDeepRange(editor.editable,{splitText:true,select:true,correctTripleClick:true});}
const selectedNodes=getSelectedNodes(editor.editable).filter((n)=>((n.nodeType===Node.TEXT_NODE&&(isVisibleTextNode(n)||isZWS(n)||(/^\n+$/.test(n.nodeValue)&&!applyStyle)))||n.nodeName==="BR")&&closestElement(n).isContentEditable);const selectedFieldNodes=new Set(getSelectedNodes(editor.editable).map(n=>closestElement(n,"*[t-field],*[t-out],*[t-esc]")).filter(Boolean));const formatSpec=formatsSpecs[formatName];for(const node of selectedNodes){const inlineAncestors=[];let currentNode=node;let parentNode=node.parentElement;while(parentNode&&!isBlock(parentNode)&&!isUnbreakable(parentNode)&&!isUnbreakable(currentNode)&&(parentNode.nodeName==="FONT"||parentNode.classList.length===0||[...parentNode.classList].every(cls=>FONT_SIZE_CLASSES.includes(cls)))){const isUselessZws=parentNode.tagName==='SPAN'&&parentNode.hasAttribute('data-oe-zws-empty-inline')&&parentNode.getAttributeNames().length===1;if(isUselessZws){unwrapContents(parentNode);}else{const newLastAncestorInlineFormat=splitAroundUntil(currentNode,parentNode);removeFormat(newLastAncestorInlineFormat,formatSpec);if(newLastAncestorInlineFormat.isConnected){inlineAncestors.push(newLastAncestorInlineFormat);currentNode=newLastAncestorInlineFormat;}}
parentNode=currentNode.parentElement;}
const isFormatted=formatName==="setFontSizeClassName"&&!formatProps?hasAnyFontSizeClass:formatSpec.isFormatted;const firstBlockOrClassHasFormat=isFormatted(parentNode,formatProps);if(firstBlockOrClassHasFormat&&!applyStyle){formatSpec.addNeutralStyle&&formatSpec.addNeutralStyle(getOrCreateSpan(node,inlineAncestors));}else if(!firstBlockOrClassHasFormat&&applyStyle){const tag=formatSpec.tagName&&document.createElement(formatSpec.tagName);if(tag){node.after(tag);tag.append(node);if(!isFormatted(tag,formatProps)){tag.after(node);tag.remove();formatSpec.addStyle(getOrCreateSpan(node,inlineAncestors),formatProps);}}else if(formatName!=='fontSize'||formatProps.size!==undefined){formatSpec.addStyle(getOrCreateSpan(node,inlineAncestors),formatProps);}}}
for(const selectedFieldNode of selectedFieldNodes){if(applyStyle){formatSpec.addStyle(selectedFieldNode,formatProps);}else{formatSpec.removeStyle(selectedFieldNode);}}
if(zws){const siblings=[...zws.parentElement.childNodes];if(!isBlock(zws.parentElement)&&selectedNodes.includes(siblings[0])&&selectedNodes.includes(siblings[siblings.length-1])){zws.parentElement.setAttribute('data-oe-zws-empty-inline','');}else{const span=document.createElement('span');span.setAttribute('data-oe-zws-empty-inline','');zws.before(span);span.append(zws);}}
if(selectedNodes.length===1&&selectedNodes[0].textContent==='\u200B'){setSelection(selectedNodes[0],0);}else if(selectedNodes.length){const firstNode=selectedNodes[0];const lastNode=selectedNodes[selectedNodes.length-1];if(direction===DIRECTIONS.RIGHT){setSelection(firstNode,0,lastNode,lastNode.length,false);}else{setSelection(lastNode,lastNode.length,firstNode,0,false);}}}
const isLinkEligibleForZwnbsp=__exports.isLinkEligibleForZwnbsp=(editable,link)=>{return link.parentElement.isContentEditable&&link.isContentEditable&&editable.contains(link)&&!([link,...link.querySelectorAll('*')].some(el=>el.nodeName==='IMG'||isBlock(el))||link.matches('nav a, a.nav-link'));}
const padLinkWithZws=__exports.padLinkWithZws=(editable,link)=>{if(!isLinkEligibleForZwnbsp(editable,link)){return;}
const selection=editable.ownerDocument.getSelection()||{};const{anchorOffset,focusOffset}=selection;let extraAnchorOffset=0;let extraFocusOffset=0;if(!link.textContent.startsWith('\uFEFF')){if(selection.anchorNode===link&&anchorOffset){extraAnchorOffset+=1;}
if(selection.focusNode===link&&focusOffset){extraFocusOffset+=1;}
link.prepend(document.createTextNode('\uFEFF'));}
if(!link.textContent.endsWith('\uFEFF')){if(selection.anchorNode===link&&anchorOffset+extraAnchorOffset===nodeSize(link)){extraAnchorOffset+=1;}
if(selection.focusNode===link&&focusOffset+extraFocusOffset===nodeSize(link)){extraFocusOffset+=1;}
link.append(document.createTextNode('\uFEFF'));}
const linkIndex=childNodeIndex(link);if(!(link.previousSibling&&link.previousSibling.textContent.endsWith('\uFEFF'))){if(selection.anchorNode===link.parentElement&&anchorOffset+extraAnchorOffset>linkIndex){extraAnchorOffset+=1;}
if(selection.focusNode===link.parentElement&&focusOffset+extraFocusOffset>linkIndex){extraFocusOffset+=1;}
link.before(document.createTextNode('\uFEFF'));}
if(!(link.nextSibling&&link.nextSibling.textContent.startsWith('\uFEFF'))){if(selection.anchorNode===link.parentElement&&anchorOffset+extraAnchorOffset>linkIndex+1){extraAnchorOffset+=1;}
if(selection.focusNode===link.parentElement&&focusOffset+extraFocusOffset>linkIndex+1){extraFocusOffset+=1;}
link.after(document.createTextNode('\uFEFF'));}
if(extraAnchorOffset||extraFocusOffset){setSelection(selection.anchorNode,anchorOffset+extraAnchorOffset,selection.focusNode,focusOffset+extraFocusOffset,);}}
const blockTagNames=['ADDRESS','ARTICLE','ASIDE','BLOCKQUOTE','DETAILS','DIALOG','DD','DIV','DL','DT','FIELDSET','FIGCAPTION','FIGURE','FOOTER','FORM','H1','H2','H3','H4','H5','H6','HEADER','HGROUP','HR','LI','MAIN','NAV','OL','P','PRE','SECTION','TABLE','UL','SELECT','OPTION','TR','TD','TBODY','THEAD','TH',];const computedStyles=new WeakMap();__exports.isBlock=isBlock;function isBlock(node){if(!node||node.nodeType!==Node.ELEMENT_NODE){return false;}
const tagName=node.nodeName.toUpperCase();if(tagName.startsWith('JW-')||(tagName==='T'&&node.getAttribute('t-esc')===null&&node.getAttribute('t-out')===null&&node.getAttribute('t-raw')===null)){return true;}
if(tagName==='BR'){return false;}
if(!node.isConnected){return blockTagNames.includes(tagName);}
let style=computedStyles.get(node);if(!style){style=node.ownerDocument.defaultView?.getComputedStyle(node);computedStyles.set(node,style);}
if(style?.display){return!style.display.includes('inline')&&style.display!=='contents';}
return blockTagNames.includes(tagName);}
__exports.isBold=isBold;function isBold(node){const fontWeight=+getComputedStyle(closestElement(node)).fontWeight;return fontWeight>500||fontWeight>+getComputedStyle(closestBlock(node)).fontWeight;}
__exports.isItalic=isItalic;function isItalic(node){return getComputedStyle(closestElement(node)).fontStyle==='italic';}
__exports.isUnderline=isUnderline;function isUnderline(node){let parent=closestElement(node);while(parent){if(getComputedStyle(parent).textDecorationLine.includes('underline')){return true;}
parent=parent.parentElement;}
return false;}
__exports.isStrikeThrough=isStrikeThrough;function isStrikeThrough(node){let parent=closestElement(node);while(parent){if(getComputedStyle(parent).textDecorationLine.includes('line-through')){return true;}
parent=parent.parentElement;}
return false;}
__exports.isFontSize=isFontSize;function isFontSize(node,props){const element=closestElement(node);return getComputedStyle(element)['font-size']===props.size;}
__exports.hasClass=hasClass;function hasClass(node,props){const element=closestElement(node);return element.classList.contains(props.className);}
__exports.hasAnyFontSizeClass=hasAnyFontSizeClass;function hasAnyFontSizeClass(node){return FONT_SIZE_CLASSES.find((cls)=>node?.classList?.contains(cls));}
__exports.isDirectionSwitched=isDirectionSwitched;function isDirectionSwitched(node,editable){const defaultDirection=editable.getAttribute('dir');return getComputedStyle(closestElement(node)).direction!==defaultDirection;}
__exports.isSelectionFormat=isSelectionFormat;function isSelectionFormat(editable,format){const selectedNodes=getTraversedNodes(editable).filter((n)=>n.nodeType===Node.TEXT_NODE&&n.nodeValue.replaceAll(ZWNBSP_CHAR,"").length&&(!/^\n+$/.test(n.nodeValue)||!isBlock(closestElement(n))));const isFormatted=format==="setFontSizeClassName"?hasAnyFontSizeClass:formatsSpecs[format].isFormatted;return selectedNodes.length&&selectedNodes.every(n=>isFormatted(n,editable));}
__exports.isUnbreakable=isUnbreakable;function isUnbreakable(node){if(!node||node.nodeType===Node.TEXT_NODE){return false;}
if(node.nodeType!==Node.ELEMENT_NODE){return true;}
return(isUnremovable(node)||['TABLE','THEAD','TBODY','TFOOT','TR','TH','TD','SECTION','DIV'].includes(node.tagName)||node.hasAttribute('t')||(node.nodeType===Node.ELEMENT_NODE&&(node.nodeName==='T'||node.getAttribute('t-if')||node.getAttribute('t-esc')||node.getAttribute('t-elif')||node.getAttribute('t-else')||node.getAttribute('t-foreach')||node.getAttribute('t-value')||node.getAttribute('t-out')||node.getAttribute('t-raw'))||node.getAttribute('t-field'))||node.matches(".oe_unbreakable, a.btn, a[role='tab'], a[role='button'], li.nav-item"));}
__exports.isUnremovable=isUnremovable;function isUnremovable(node){return((node.nodeType!==Node.COMMENT_NODE&&node.nodeType!==Node.ELEMENT_NODE&&node.nodeType!==Node.TEXT_NODE)||node.oid==='root'||(node.nodeType===Node.ELEMENT_NODE&&(node.classList.contains('o_editable')||node.getAttribute('t-set')||node.getAttribute('t-call')))||(node.classList&&node.classList.contains('oe_unremovable'))||(node.nodeName==='SPAN'&&node.parentElement&&node.parentElement.getAttribute('data-oe-type')==='monetary')||(node.ownerDocument&&node.ownerDocument.defaultWindow&&!ancestors(node).find(ancestor=>ancestor.oid==='root'))||(node.dataset&&node.dataset.bsToggle==='tab'));}
__exports.containsUnbreakable=containsUnbreakable;function containsUnbreakable(node){if(!node){return false;}
return isUnbreakable(node)||containsUnbreakable(node.firstChild);}
const iconTags=['I','SPAN'];const iconClasses=['fa','fab','fad','far','oi'];__exports.isIconElement=isIconElement;function isIconElement(node){return!!(node&&iconTags.includes(node.nodeName)&&iconClasses.some(cls=>node.classList.contains(cls)));}
const ICON_SELECTOR=__exports.ICON_SELECTOR=iconTags.map(tag=>{return iconClasses.map(cls=>{return`${tag}.${cls}`;}).join(', ');}).join(', ');__exports.isZWS=isZWS;function isZWS(node){return(node&&node.textContent==='\u200B');}
__exports.isEditorTab=isEditorTab;function isEditorTab(node){return(node&&(node.nodeName==='SPAN')&&node.classList.contains('oe-tabs'));}
__exports.isMediaElement=isMediaElement;function isMediaElement(node){return(isIconElement(node)||(node.classList&&(node.classList.contains('o_image')||node.classList.contains('media_iframe_video'))));}
__exports.isProtected=isProtected;function isProtected(node){const closestProtectedElement=closestElement(node,'[data-oe-protected]');if(closestProtectedElement){return["","true"].includes(closestProtectedElement.dataset.oeProtected);}
return false;}
const VOID_ELEMENT_NAMES=['AREA','BASE','BR','COL','EMBED','HR','IMG','INPUT','KEYGEN','LINK','META','PARAM','SOURCE','TRACK','WBR'];__exports.isArtificialVoidElement=isArtificialVoidElement;function isArtificialVoidElement(node){return isMediaElement(node)||node.nodeName==='HR';}
__exports.isNotAllowedContent=isNotAllowedContent;function isNotAllowedContent(node){return isArtificialVoidElement(node)||VOID_ELEMENT_NAMES.includes(node.nodeName);}
__exports.containsUnremovable=containsUnremovable;function containsUnremovable(node){if(!node){return false;}
return isUnremovable(node)||containsUnremovable(node.firstChild);}
__exports.getInSelection=getInSelection;function getInSelection(document,selector){const selection=document.getSelection();const range=selection&&!!selection.rangeCount&&selection.getRangeAt(0);if(range){const selectorInStartAncestors=closestElement(range.startContainer,selector);if(selectorInStartAncestors){return selectorInStartAncestors;}else{const commonElementAncestor=closestElement(range.commonAncestorContainer);return commonElementAncestor&&[...commonElementAncestor.querySelectorAll(selector)].find(node=>range.intersectsNode(node),);}}}
__exports.getRowIndex=getRowIndex;function getRowIndex(trOrTd){const tr=closestElement(trOrTd,'tr');const trParent=tr&&tr.parentElement;if(!trParent){return-1;}
const trSiblings=[...trParent.children].filter(child=>child.nodeName==='TR');return trSiblings.findIndex(child=>child===tr);}
__exports.getColumnIndex=getColumnIndex;function getColumnIndex(td){const tdParent=td.parentElement;if(!tdParent){return-1;}
const tdSiblings=[...tdParent.children].filter(child=>child.nodeName==='TD'||child.nodeName==='TH');return tdSiblings.findIndex(child=>child===td);}
const paragraphRelatedElements=__exports.paragraphRelatedElements=['P','H1','H2','H3','H4','H5','H6','PRE','BLOCKQUOTE',];__exports.allowsParagraphRelatedElements=allowsParagraphRelatedElements;function allowsParagraphRelatedElements(node){return isBlock(node)&&!['P','H1','H2','H3','H4','H5','H6'].includes(node.nodeName);}
__exports.makeContentsInline=makeContentsInline;function makeContentsInline(node){let childIndex=0;for(const child of node.childNodes){if(isBlock(child)){if(childIndex&&paragraphRelatedElements.includes(child.nodeName)){child.before(document.createElement('br'));}
for(const grandChild of child.childNodes){child.before(grandChild);makeContentsInline(grandChild);}
child.remove();}
childIndex+=1;}}
__exports.getOuid=getOuid;function getOuid(node,optimize=false){while(node&&!isUnbreakable(node)){if(node.ouid&&optimize)return node.ouid;node=node.parentNode;}
return node&&node.oid;}
__exports.isHtmlContentSupported=isHtmlContentSupported;function isHtmlContentSupported(node){return!closestElement(node,'[data-oe-model]:not([data-oe-field="arch"]):not([data-oe-type="html"]),[data-oe-translation-id]',true);}
const selfClosingElementTags=['BR','IMG','INPUT'];__exports.isSelfClosingElement=isSelfClosingElement;function isSelfClosingElement(node){return node&&selfClosingElementTags.includes(node.nodeName);}
__exports.isInPre=isInPre;function isInPre(node){const element=node.nodeType===Node.TEXT_NODE?node.parentElement:node;return(!!element&&(!!element.closest('pre')||getComputedStyle(element).getPropertyValue('white-space')==='pre'));}
const whitespace=`[^\\S\\u00A0\\u0009\\ufeff]`;const whitespaceRegex=new RegExp(`^${whitespace}*$`);__exports.isWhitespace=isWhitespace;function isWhitespace(value){const str=typeof value==='string'?value:value.nodeValue;return whitespaceRegex.test(str);}
__exports.isVisible=isVisible;function isVisible(node){return!!node&&((node.nodeType===Node.TEXT_NODE&&isVisibleTextNode(node))||(node.nodeType===Node.ELEMENT_NODE&&(node.getAttribute("t-esc")||node.getAttribute("t-out")))||isSelfClosingElement(node)||isIconElement(node)||hasVisibleContent(node));}
__exports.hasVisibleContent=hasVisibleContent;function hasVisibleContent(node){return[...(node?.childNodes||[])].some(n=>isVisible(n));}
__exports.isButton=isButton;function isButton(node){if(!node||node.nodeType!==Node.ELEMENT_NODE){return false;}
return node.nodeName==="BUTTON"||node.classList.contains("btn");}
const visibleCharRegex=/[^\s\u200b]|[\u00A0\u0009]$/;__exports.isVisibleTextNode=isVisibleTextNode;function isVisibleTextNode(testedNode){if(!testedNode||!testedNode.length||testedNode.nodeType!==Node.TEXT_NODE){return false;}
if(visibleCharRegex.test(testedNode.textContent)||(isInPre(testedNode)&&isWhitespace(testedNode))){return true;}
if(ZERO_WIDTH_CHARS.includes(testedNode.textContent)){return false;}
let preceding;let following;let foundTestedNode;const currentNodeParentBlock=closestBlock(testedNode);if(!currentNodeParentBlock){return false;}
const nodeIterator=document.createNodeIterator(currentNodeParentBlock);for(let node=nodeIterator.nextNode();node;node=nodeIterator.nextNode()){if(node.nodeType===Node.TEXT_NODE){if(foundTestedNode){following=node;break;}else if(testedNode===node){foundTestedNode=true;}else{preceding=node;}}else if(isBlock(node)){if(foundTestedNode){break;}else{preceding=null;}}else if(foundTestedNode&&!isWhitespace(node)){following=node;break;}}
while(following&&!visibleCharRegex.test(following.textContent)){following=following.nextSibling;}
if(!(preceding&&following)||currentNodeParentBlock!==closestBlock(preceding)||currentNodeParentBlock!==closestBlock(following)){return false;}
return visibleCharRegex.test(preceding.textContent);}
__exports.parentsGet=parentsGet;function parentsGet(node,root=undefined){const parents=[];while(node){parents.unshift(node);if(node===root){break;}
node=node.parentNode;}
return parents;}
__exports.commonParentGet=commonParentGet;function commonParentGet(node1,node2,root=undefined){if(!node1||!node2){return null;}
const n1p=parentsGet(node1,root);const n2p=parentsGet(node2,root);while(n1p.length>1&&n1p[1]===n2p[1]){n1p.shift();n2p.shift();}
return n1p[0]===n2p[0]?n1p[0]:null;}
__exports.getListMode=getListMode;function getListMode(pnode){if(!["UL","OL"].includes(pnode.tagName))return;if(pnode.tagName=='OL')return'OL';return pnode.classList.contains('o_checklist')?'CL':'UL';}
__exports.createList=createList;function createList(mode){const node=document.createElement(mode=='OL'?'OL':'UL');if(mode=='CL'){node.classList.add('o_checklist');}
return node;}
__exports.insertListAfter=insertListAfter;function insertListAfter(afterNode,mode,content=[]){const list=createList(mode);afterNode.after(list);list.append(...content.map(c=>{const li=document.createElement('LI');li.append(...[].concat(c));return li;}),);return list;}
__exports.toggleList=toggleList;function toggleList(node,mode,offset=0){let pnode=node.closest('ul, ol');if(!pnode)return;const listMode=getListMode(pnode)+mode;if(['OLCL','ULCL'].includes(listMode)){pnode.classList.add('o_checklist');for(let li=pnode.firstElementChild;li!==null;li=li.nextElementSibling){if(li.style.listStyle!=='none'){li.style.listStyle=null;if(!li.style.all)li.removeAttribute('style');}}
pnode=setTagName(pnode,'UL');}else if(['CLOL','CLUL'].includes(listMode)){toggleClass(pnode,'o_checklist');pnode=setTagName(pnode,mode);}else if(['OLUL','ULOL'].includes(listMode)){pnode=setTagName(pnode,mode);}else{let currNode=node;while(currNode){currNode=currNode.oShiftTab(offset);}
return;}
return pnode;}
__exports.convertList=convertList;function convertList(node,toMode){if(!["UL","OL","LI"].includes(node.nodeName))return;const listMode=getListMode(node);if(listMode&&toMode!==listMode){node=toggleList(node,toMode);}
for(const child of node.childNodes){convertList(child,toMode);}
return node;}
__exports.toggleClass=toggleClass;function toggleClass(node,className){node.classList.toggle(className);if(!node.className){node.removeAttribute('class');}}
__exports.makeZeroWidthCharactersVisible=makeZeroWidthCharactersVisible;function makeZeroWidthCharactersVisible(text){return text.replaceAll('\u200B','//ZWSP//').replaceAll('\uFEFF','//ZWNBSP//');}
__exports.isFakeLineBreak=isFakeLineBreak;function isFakeLineBreak(brEl){return!(getState(...rightPos(brEl),DIRECTIONS.RIGHT).cType&(CTYPES.CONTENT|CTGROUPS.BR));}
__exports.isEmptyBlock=isEmptyBlock;function isEmptyBlock(blockEl){if(!blockEl||blockEl.nodeType!==Node.ELEMENT_NODE){return false;}
if(isIconElement(blockEl)||visibleCharRegex.test(blockEl.textContent)){return false;}
if(blockEl.querySelectorAll('br').length>=2){return false;}
const nodes=blockEl.querySelectorAll('*');for(const node of nodes){if(node.nodeName!='BR'&&(isSelfClosingElement(node)||isIconElement(node)||isZWS(node))){return false;}}
return true;}
__exports.isShrunkBlock=isShrunkBlock;function isShrunkBlock(blockEl){return(isEmptyBlock(blockEl)&&!blockEl.querySelector('br')&&blockEl.nodeName!=="IMG");}
__exports.isColorGradient=isColorGradient;function isColorGradient(value){return value&&value.includes('-gradient(');}
__exports.getFontSizeDisplayValue=getFontSizeDisplayValue;function getFontSizeDisplayValue(sel,getCSSVariableValue,convertNumericToUnit){const tagNameRelatedToFontSize=["h1","h2","h3","h4","h5","h6"];const styleClassesRelatedToFontSize=["display-1","display-2","display-3","display-4","lead"];const closestStartContainerEl=closestElement(sel.getRangeAt(0).startContainer);const closestFontSizedEl=closestStartContainerEl.closest(`
        [style*='font-size'],
        ${FONT_SIZE_CLASSES.map(className => `.${className}`)},
        ${styleClassesRelatedToFontSize.map(className => `.${className}`)},
        ${tagNameRelatedToFontSize}
    `);let remValue;if(closestFontSizedEl){const useFontSizeInput=closestFontSizedEl.style.fontSize;if(useFontSizeInput){return parseFloat(getComputedStyle(closestStartContainerEl).fontSize);}
const fontSizeClass=FONT_SIZE_CLASSES.find(className=>closestFontSizedEl.classList.contains(className));let fsName;if(fontSizeClass){fsName=fontSizeClass.substring(0,fontSizeClass.length-3);}else{fsName=styleClassesRelatedToFontSize.find(className=>closestFontSizedEl.classList.contains(className))||closestFontSizedEl.tagName.toLowerCase();}
remValue=parseFloat(getCSSVariableValue(`${fsName}-font-size`));}
const pxValue=remValue&&convertNumericToUnit(remValue,"rem","px");return pxValue||parseFloat(getComputedStyle(closestStartContainerEl).fontSize);}
__exports.splitTextNode=splitTextNode;function splitTextNode(textNode,offset,originalNodeSide=DIRECTIONS.RIGHT){let parentOffset=childNodeIndex(textNode);if(offset>0){parentOffset++;if(offset<textNode.length){const left=textNode.nodeValue.substring(0,offset);const right=textNode.nodeValue.substring(offset);if(originalNodeSide===DIRECTIONS.LEFT){const newTextNode=document.createTextNode(right);textNode.after(newTextNode);textNode.nodeValue=left;}else{const newTextNode=document.createTextNode(left);textNode.before(newTextNode);textNode.nodeValue=right;}}}
return parentOffset;}
__exports.splitElement=splitElement;function splitElement(element,offset){const before=element.cloneNode();const after=element.cloneNode();let index=0;for(const child of[...element.childNodes]){index<offset?before.appendChild(child):after.appendChild(child);index++;}
const blockEl=closestBlock(after);if(blockEl){fillEmpty(blockEl);}
element.before(before);element.after(after);element.remove();return[before,after];}
__exports.splitAroundUntil=splitAroundUntil;function splitAroundUntil(elements,limitAncestor){elements=Array.isArray(elements)?elements:[elements];const firstNode=elements[0];const lastNode=elements[elements.length-1];if([firstNode,lastNode].includes(limitAncestor)){return limitAncestor;}
let before=firstNode.previousSibling;let after=lastNode.nextSibling;let beforeSplit,afterSplit;if(!before&&!after&&elements[0]!==limitAncestor){return splitAroundUntil(elements[0].parentElement,limitAncestor);}
while(after&&after.parentElement!==limitAncestor){afterSplit=splitElement(after.parentElement,childNodeIndex(after))[0];after=afterSplit.nextSibling;}
if(after){afterSplit=splitElement(limitAncestor,childNodeIndex(after))[0];limitAncestor=afterSplit;}
while(before&&before.parentElement!==limitAncestor){beforeSplit=splitElement(before.parentElement,childNodeIndex(before)+1)[1];before=beforeSplit.previousSibling;}
if(before){beforeSplit=splitElement(limitAncestor,childNodeIndex(before)+1)[1];}
return beforeSplit||afterSplit||limitAncestor;}
__exports.insertText=insertText;function insertText(sel,content){if(!content){return;}
if(sel.anchorNode.nodeType===Node.TEXT_NODE){const pos=[sel.anchorNode.parentElement,splitTextNode(sel.anchorNode,sel.anchorOffset)];setSelection(...pos,...pos,false);}
const txt=document.createTextNode(content||'#');const restore=prepareUpdate(sel.anchorNode,sel.anchorOffset);sel.getRangeAt(0).insertNode(txt);restore();setSelection(...boundariesOut(txt),false);return txt;}
__exports.insertCharsAt=insertCharsAt;function insertCharsAt(chars,node,offset){if(node.nodeType===Node.TEXT_NODE){const startValue=node.nodeValue;if(offset<0||offset>startValue.length){throw new Error(`Invalid ${chars} insertion in text node`);}
node.nodeValue=startValue.slice(0,offset)+chars+startValue.slice(offset);}else{if(offset<0||offset>node.childNodes.length){throw new Error(`Invalid ${chars} insertion in non-text node`);}
const textNode=document.createTextNode(chars);if(offset<node.childNodes.length){node.insertBefore(textNode,node.childNodes[offset]);}else{node.appendChild(textNode);}}}
__exports.unwrapContents=unwrapContents;function unwrapContents(node){const contents=[...node.childNodes];for(const child of contents){node.parentNode.insertBefore(child,node);}
node.parentNode.removeChild(node);return contents;}
__exports.fillEmpty=fillEmpty;function fillEmpty(el){const fillers={};const blockEl=closestBlock(el);if(isShrunkBlock(blockEl)){const br=document.createElement('br');blockEl.appendChild(br);fillers.br=br;}
if(!isTangible(el)&&!el.hasAttribute("data-oe-zws-empty-inline")&&isEmptyBlock(el)){const zws=document.createTextNode('\u200B');el.appendChild(zws);el.setAttribute("data-oe-zws-empty-inline","");fillers.zws=zws;if(el.classList.length&&fillers.br){fillers.br.remove();delete fillers.br;}
const previousSibling=el.previousSibling;if(previousSibling&&previousSibling.nodeName==="BR"){previousSibling.remove();}
setSelection(zws,0,zws,0);}
if(!isVisible(el)&&el.nodeName!=='A'&&closestElement(el,'a')&&getComputedStyle(el).display==='inline'){el.style.display='inline-block';}
return fillers;}
__exports.insertAndSelectZws=insertAndSelectZws;function insertAndSelectZws(selection){const offset=selection.anchorOffset;const zws=insertText(selection,'\u200B');splitTextNode(zws,offset);selection.getRangeAt(0).selectNode(zws);return zws;}
__exports.setTagName=setTagName;function setTagName(el,newTagName){if(el.tagName===newTagName){return el;}
const n=document.createElement(newTagName);if(el.nodeName!=='LI'){el.style.removeProperty('list-style');const attributes=el.attributes;for(const attr of attributes){n.setAttribute(attr.name,attr.value);}}
while(el.firstChild){n.append(el.firstChild);}
if(el.tagName==='LI'){el.append(n);}else{el.parentNode.replaceChild(n,el);}
return n;}
__exports.moveNodes=moveNodes;function moveNodes(destinationEl,destinationOffset,sourceEl,startIndex=0,endIndex=sourceEl.childNodes.length,){if(selfClosingElementTags.includes(destinationEl.nodeName)){throw new Error(`moveNodes: Invalid destination element ${destinationEl.nodeName}`);}
const nodes=[];for(let i=startIndex;i<endIndex;i++){nodes.push(sourceEl.childNodes[i]);}
if(nodes.length){const restoreDestination=prepareUpdate(destinationEl,destinationOffset);const restoreMoved=prepareUpdate(...leftPos(sourceEl.childNodes[startIndex]),...rightPos(sourceEl.childNodes[endIndex-1]),);const fragment=document.createDocumentFragment();nodes.forEach(node=>fragment.appendChild(node));const posRightNode=destinationEl.childNodes[destinationOffset];if(posRightNode){destinationEl.insertBefore(fragment,posRightNode);}else{destinationEl.appendChild(fragment);}
restoreDestination();restoreMoved();}
if(!nodeSize(sourceEl)){const restoreOrigin=prepareUpdate(...boundariesOut(sourceEl));sourceEl.remove();restoreOrigin();}
const firstNode=nodes.find(node=>!!node.parentNode);return firstNode?leftPos(firstNode):[destinationEl,destinationOffset];}
__exports.resetOuids=resetOuids;function resetOuids(node){node.ouid=undefined;for(const descendant of descendants(node)){descendant.ouid=undefined;}}
const prepareUpdateLockedEditables=new Set();__exports.prepareUpdate=prepareUpdate;function prepareUpdate(...args){const closestRoot=args.length&&ancestors(args[0]).find(ancestor=>ancestor.oid==='root');const isPrepareUpdateLocked=closestRoot&&prepareUpdateLockedEditables.has(closestRoot);const hash=(Math.random()+1).toString(36).substring(7);const options={allowReenter:true,label:hash,debug:false,...(args.length&&args[args.length-1]instanceof Object?args.pop():{}),};if(options.debug){console.log('%cPreparing%c update: '+options.label+
(options.label===hash?'':` (${hash})`)+'%c'+(isPrepareUpdateLocked?' LOCKED':''),'color: cyan;','color: white;','color: red; font-weight: bold;',);}
if(isPrepareUpdateLocked){return()=>{if(options.debug){console.log('%cRestoring%c update: '+options.label+
(options.label===hash?'':` (${hash})`)+'%c LOCKED','color: lightgreen;','color: white;','color: red; font-weight: bold;',);}};}
if(!options.allowReenter&&closestRoot){prepareUpdateLockedEditables.add(closestRoot);}
const positions=[...args];const restoreData=[];let el,offset;while(positions.length){offset=positions.pop();el=positions.pop();const left=getState(el,offset,DIRECTIONS.LEFT);const right=getState(el,offset,DIRECTIONS.RIGHT,left.cType);if(options.debug){const editable=el&&closestElement(el,'.odoo-editor-editable');const oldEditableHTML=editable&&makeZeroWidthCharactersVisible(editable.innerHTML).replaceAll(' ','_')||'';left.oldEditableHTML=oldEditableHTML;right.oldEditableHTML=oldEditableHTML;}
restoreData.push(left,right);}
return function restoreStates(){if(options.debug){console.log('%cRestoring%c update: '+options.label+
(options.label===hash?'':` (${hash})`),'color: lightgreen;','color: white;',);}
for(const data of restoreData){restoreState(data,options.debug);}
if(!options.allowReenter&&closestRoot){prepareUpdateLockedEditables.delete(closestRoot);}};}
__exports.getState=getState;function getState(el,offset,direction,leftCType){const leftDOMPath=leftLeafOnlyNotBlockPath;const rightDOMPath=rightLeafOnlyNotBlockPath;let domPath;let inverseDOMPath;const whitespaceAtStartRegex=new RegExp('^'+whitespace+'+');const whitespaceAtEndRegex=new RegExp(whitespace+'+$');const reasons=[];if(direction===DIRECTIONS.LEFT){domPath=leftDOMPath(el,offset,reasons);inverseDOMPath=rightDOMPath(el,offset);}else{domPath=rightDOMPath(el,offset,reasons);inverseDOMPath=leftDOMPath(el,offset);}
const boundaryNode=inverseDOMPath.next().value;let cType=undefined;let lastSpace=null;for(const node of domPath){if(node.nodeType===Node.TEXT_NODE){const value=node.nodeValue.replaceAll('\ufeff','');if(direction===DIRECTIONS.LEFT){if(!isWhitespace(value)){if(lastSpace){cType=CTYPES.SPACE;}else{const rightLeaf=rightLeafOnlyNotBlockPath(node).next().value;const hasContentRight=rightLeaf&&!whitespaceAtStartRegex.test(rightLeaf.textContent);cType=!hasContentRight&&whitespaceAtEndRegex.test(node.textContent)?CTYPES.SPACE:CTYPES.CONTENT;}
break;}
if(value.length){lastSpace=node;}}else{leftCType=leftCType||getState(el,offset,DIRECTIONS.LEFT).cType;if(whitespaceAtStartRegex.test(value)){const leftLeaf=leftLeafOnlyNotBlockPath(node).next().value;const hasContentLeft=leftLeaf&&!whitespaceAtEndRegex.test(leftLeaf.textContent);const rct=!isWhitespace(value)?CTYPES.CONTENT:getState(...rightPos(node),DIRECTIONS.RIGHT).cType;cType=leftCType&CTYPES.CONTENT&&rct&(CTYPES.CONTENT|CTYPES.BR)&&!hasContentLeft?CTYPES.SPACE:rct;break;}
if(!isWhitespace(value)){cType=CTYPES.CONTENT;break;}}}else if(node.nodeName==='BR'){cType=CTYPES.BR;break;}else if(isVisible(node)){cType=CTYPES.CONTENT;break;}}
if(cType===undefined){cType=reasons.includes(PATH_END_REASONS.BLOCK_HIT)?CTYPES.BLOCK_OUTSIDE:CTYPES.BLOCK_INSIDE;}
return{node:boundaryNode,direction:direction,cType:cType,};}
const priorityRestoreStateRules=[[{cType1:CTYPES.CONTENT,cType2:CTYPES.SPACE|CTGROUPS.BLOCK},{spaceVisibility:true},],[{direction:DIRECTIONS.LEFT,cType1:CTGROUPS.INLINE,cType2:CTGROUPS.BR},{spaceVisibility:true},],[{direction:DIRECTIONS.RIGHT,cType1:CTGROUPS.CONTENT,cType2:CTGROUPS.BR},{spaceVisibility:true},],[{direction:DIRECTIONS.RIGHT,cType1:CTGROUPS.BR,cType2:CTYPES.SPACE},{spaceVisibility:true},],[{direction:DIRECTIONS.RIGHT,cType1:CTGROUPS.BR,cType2:CTGROUPS.BLOCK},{spaceVisibility:true,brVisibility:true},],[{cType1:CTYPES.SPACE},{spaceVisibility:false},],[{direction:DIRECTIONS.LEFT,cType1:CTGROUPS.BR},{spaceVisibility:false},],[{cType1:CTGROUPS.BLOCK,cType2:CTGROUPS.INLINE|CTGROUPS.BR},{spaceVisibility:false},],[{direction:DIRECTIONS.RIGHT,cType1:CTGROUPS.INLINE,cType2:CTGROUPS.BLOCK},{brVisibility:true},],[{direction:DIRECTIONS.RIGHT,cType1:CTGROUPS.BLOCK,cType2:CTGROUPS.INLINE|CTGROUPS.BR,},{brVisibility:false},],[{direction:DIRECTIONS.LEFT,cType1:CTGROUPS.BR|CTGROUPS.BLOCK,cType2:CTGROUPS.INLINE,},{brVisibility:false,extraBRRemovalCondition:brNode=>isFakeLineBreak(brNode)},],];function restoreStateRuleHashCode(direction,cType1,cType2){return`${direction}-${cType1}-${cType2}`;}
const allRestoreStateRules=(function(){const map=new Map();const keys=['direction','cType1','cType2'];for(const direction of Object.values(DIRECTIONS)){for(const cType1 of Object.values(CTYPES)){for(const cType2 of Object.values(CTYPES)){const rule={direction:direction,cType1:cType1,cType2:cType2};const matchedRules=[];for(const entry of priorityRestoreStateRules){let priority=0;for(const key of keys){const entryKeyValue=entry[0][key];if(entryKeyValue!==undefined){if(typeof entryKeyValue==='boolean'?rule[key]===entryKeyValue:rule[key]&entryKeyValue){priority++;}else{priority=-1;break;}}}
if(priority>=0){matchedRules.push([priority,entry[1]]);}}
const finalRule={};for(let p=0;p<=keys.length;p++){for(const entry of matchedRules){if(entry[0]===p){Object.assign(finalRule,entry[1]);}}}
const hashCode=restoreStateRuleHashCode(direction,cType1,cType2);map.set(hashCode,finalRule);}}}
return map;})();__exports.restoreState=restoreState;function restoreState(prevStateData,debug=false){const{node,direction,cType:cType1,oldEditableHTML}=prevStateData;if(!node||!node.parentNode){return;}
const[el,offset]=direction===DIRECTIONS.LEFT?leftPos(node):rightPos(node);const{cType:cType2}=getState(el,offset,direction);const ruleHashCode=restoreStateRuleHashCode(direction,cType1,cType2);const rule=allRestoreStateRules.get(ruleHashCode);if(debug){const editable=closestElement(node,'.odoo-editor-editable');console.log('%c'+makeZeroWidthCharactersVisible(node.textContent).replaceAll(' ','_')+'\n'+'%c'+(direction===DIRECTIONS.LEFT?'left':'right')+'\n'+'%c'+ctypeToString(cType1)+'\n'+'%c'+ctypeToString(cType2)+'\n'+'%c'+'BEFORE: '+(oldEditableHTML||'(unavailable)')+'\n'+'%c'+'AFTER:  '+(editable?makeZeroWidthCharactersVisible(editable.innerHTML).replaceAll(' ','_'):'(unavailable)')+'\n','color: white; display: block; width: 100%;','color: '+(direction===DIRECTIONS.LEFT?'magenta':'lightgreen')+'; display: block; width: 100%;','color: pink; display: block; width: 100%;','color: lightblue; display: block; width: 100%;','color: white; display: block; width: 100%;','color: white; display: block; width: 100%;',rule,);}
if(Object.values(rule).filter(x=>x!==undefined).length){const inverseDirection=direction===DIRECTIONS.LEFT?DIRECTIONS.RIGHT:DIRECTIONS.LEFT;enforceWhitespace(el,offset,inverseDirection,rule);}
return rule;}
__exports.enforceWhitespace=enforceWhitespace;function enforceWhitespace(el,offset,direction,rule){let domPath,whitespaceAtEdgeRegex;if(direction===DIRECTIONS.LEFT){domPath=leftLeafOnlyNotBlockPath(el,offset);whitespaceAtEdgeRegex=new RegExp(whitespace+'+$');}else{domPath=rightLeafOnlyNotBlockPath(el,offset);whitespaceAtEdgeRegex=new RegExp('^'+whitespace+'+');}
const invisibleSpaceTextNodes=[];let foundVisibleSpaceTextNode=null;for(const node of domPath){if(node.nodeName==='BR'){if(rule.brVisibility===undefined){break;}
if(rule.brVisibility){node.before(document.createElement('br'));}else{if(!rule.extraBRRemovalCondition||rule.extraBRRemovalCondition(node)){node.remove();}}
break;}else if(node.nodeType===Node.TEXT_NODE&&!isInPre(node)){if(whitespaceAtEdgeRegex.test(node.nodeValue)){if(!isWhitespace(node)){foundVisibleSpaceTextNode=node;break;}else{invisibleSpaceTextNodes.push(node);}}else if(!isWhitespace(node)){break;}}else{break;}}
if(rule.spaceVisibility===undefined){return;}
if(!rule.spaceVisibility){for(const node of invisibleSpaceTextNodes){node.nodeValue='';const ancestorPath=closestPath(node.parentNode);let toRemove=null;for(const pNode of ancestorPath){if(toRemove){toRemove.remove();}
if(pNode.childNodes.length===1&&!isBlock(pNode)){pNode.after(node);toRemove=pNode;}else{break;}}}}
const spaceNode=foundVisibleSpaceTextNode||invisibleSpaceTextNodes[0];if(spaceNode){let spaceVisibility=rule.spaceVisibility;if(spaceVisibility&&!foundVisibleSpaceTextNode&&getState(...rightPos(spaceNode),DIRECTIONS.RIGHT).cType&CTGROUPS.BLOCK&&getState(...leftPos(spaceNode),DIRECTIONS.LEFT).cType!==CTYPES.CONTENT){spaceVisibility=false;}
spaceNode.nodeValue=spaceNode.nodeValue.replace(whitespaceAtEdgeRegex,spaceVisibility?'\u00A0':'');}}
__exports.rgbToHex=rgbToHex;function rgbToHex(rgb='',node=null){if(rgb.startsWith('#')){return rgb;}else if(rgb.startsWith('rgba')){const values=rgb.match(/[\d\.]{1,5}/g)||[];const alpha=parseFloat(values.pop());let bgRgbValues=[];if(node){let bgColor=getComputedStyle(node).backgroundColor;if(bgColor.startsWith('rgba')){bgColor=rgbToHex(bgColor,node.parentElement);}
if(bgColor&&bgColor.startsWith('#')){bgRgbValues=(bgColor.match(/[\da-f]{2}/gi)||[]).map(val=>parseInt(val,16));}else if(bgColor&&bgColor.startsWith('rgb')){bgRgbValues=(bgColor.match(/[\d\.]{1,5}/g)||[]).map(val=>parseInt(val));}}
bgRgbValues=bgRgbValues.length?bgRgbValues:[255,255,255];return('#'+
values.map((value,index)=>{const converted=Math.floor(alpha*parseInt(value)+(1-alpha)*bgRgbValues[index]);const hex=parseInt(converted).toString(16);return hex.length===1?'0'+hex:hex;}).join(''));}else{return('#'+
(rgb.match(/\d{1,3}/g)||[]).map(x=>{x=parseInt(x).toString(16);return x.length===1?'0'+x:x;}).join(''));}}
__exports.parseHTML=parseHTML;function parseHTML(document,html){const fragment=document.createDocumentFragment();const parser=new document.defaultView.DOMParser();const parsedDocument=parser.parseFromString(html,'text/html');fragment.replaceChildren(...parsedDocument.body.childNodes);return fragment;}
__exports.pxToFloat=pxToFloat;function pxToFloat(sizeString){return parseFloat(sizeString.replace('px',''));}
__exports.getRangePosition=getRangePosition;function getRangePosition(el,document,options={}){const selection=document.getSelection();if(!selection.rangeCount)return;const range=selection.getRangeAt(0);const isRtl=options.direction==='rtl';const marginRight=options.marginRight||20;const marginBottom=options.marginBottom||20;const marginTop=options.marginTop||10;const marginLeft=options.marginLeft||10;let offset;if(range.endOffset-1>0){const clonedRange=range.cloneRange();clonedRange.setStart(range.endContainer,range.endOffset-1);clonedRange.setEnd(range.endContainer,range.endOffset);const rect=clonedRange.getBoundingClientRect();offset={height:rect.height,left:rect.left+rect.width,top:rect.top};clonedRange.detach();}
if(!offset||offset.height===0){const clonedRange=range.cloneRange();const shadowCaret=document.createTextNode('|');clonedRange.insertNode(shadowCaret);clonedRange.selectNode(shadowCaret);const rect=clonedRange.getBoundingClientRect();offset={height:rect.height,left:rect.left,top:rect.top};shadowCaret.remove();clonedRange.detach();}
if(isRtl){offset.right=offset.left-el.offsetWidth;const leftMove=Math.max(0,offset.right+el.offsetWidth+marginLeft-window.innerWidth);if(leftMove&&offset.right-leftMove>marginRight){offset.right-=leftMove;}else if(offset.right-leftMove<marginRight){offset.right=marginRight;}}
const leftMove=Math.max(0,offset.left+el.offsetWidth+marginRight-window.innerWidth);if(leftMove&&offset.left-leftMove>marginLeft){offset.left-=leftMove;}else if(offset.left-leftMove<marginLeft){offset.left=marginLeft;}
if(options.getContextFromParentRect){const parentContextRect=options.getContextFromParentRect();offset.left+=parentContextRect.left;offset.top+=parentContextRect.top;if(isRtl){offset.right+=parentContextRect.left;}}
if(offset.top-marginTop+offset.height+el.offsetHeight>window.innerHeight&&offset.top-el.offsetHeight-marginBottom>0){offset.top-=el.offsetHeight;}else{offset.top+=offset.height;}
if(offset){offset.top+=window.scrollY;offset.left+=window.scrollX;if(isRtl){offset.right+=window.scrollX;}}
if(isRtl){offset.right=window.innerWidth-offset.right-el.offsetWidth;}
return offset;}
const isNotEditableNode=__exports.isNotEditableNode=node=>node.getAttribute&&node.getAttribute('contenteditable')&&node.getAttribute('contenteditable').toLowerCase()==='false';const isRoot=__exports.isRoot=node=>node.oid==="root";const leftLeafFirstPath=__exports.leftLeafFirstPath=createDOMPathGenerator(DIRECTIONS.LEFT);const leftLeafOnlyNotBlockPath=__exports.leftLeafOnlyNotBlockPath=createDOMPathGenerator(DIRECTIONS.LEFT,{leafOnly:true,stopTraverseFunction:isBlock,stopFunction:node=>isBlock(node)||isRoot(node),});const leftLeafOnlyInScopeNotBlockEditablePath=__exports.leftLeafOnlyInScopeNotBlockEditablePath=createDOMPathGenerator(DIRECTIONS.LEFT,{leafOnly:true,inScope:true,stopTraverseFunction:node=>isNotEditableNode(node)||isBlock(node),stopFunction:node=>isNotEditableNode(node)||isBlock(node)||isRoot(node),});const rightLeafOnlyNotBlockPath=__exports.rightLeafOnlyNotBlockPath=createDOMPathGenerator(DIRECTIONS.RIGHT,{leafOnly:true,stopTraverseFunction:isBlock,stopFunction:node=>isBlock(node)||isRoot(node),});const rightLeafOnlyPathNotBlockNotEditablePath=__exports.rightLeafOnlyPathNotBlockNotEditablePath=createDOMPathGenerator(DIRECTIONS.RIGHT,{leafOnly:true,stopFunction:node=>isRoot(node),});const rightLeafOnlyInScopeNotBlockEditablePath=__exports.rightLeafOnlyInScopeNotBlockEditablePath=createDOMPathGenerator(DIRECTIONS.RIGHT,{leafOnly:true,inScope:true,stopTraverseFunction:node=>isNotEditableNode(node)||isBlock(node),stopFunction:node=>isNotEditableNode(node)||isBlock(node)||isRoot(node),});const rightLeafOnlyNotBlockNotEditablePath=__exports.rightLeafOnlyNotBlockNotEditablePath=createDOMPathGenerator(DIRECTIONS.RIGHT,{leafOnly:true,stopTraverseFunction:node=>isNotEditableNode(node)||isBlock(node),stopFunction:node=>isBlock(node)&&!isNotEditableNode(node)||isRoot(node),});__exports.peek=peek;function peek(arr){return arr[arr.length-1];}
__exports.isMacOS=isMacOS;function isMacOS(){return window.navigator.userAgent.includes('Mac');}
__exports.cleanZWS=cleanZWS;function cleanZWS(node){[node,...descendants(node)].filter(node=>node.nodeType===Node.TEXT_NODE&&node.nodeValue.includes('\u200B')).forEach((node)=>{node.nodeValue=node.nodeValue.replace(/\u200B/g,"");if(node.nodeValue===""){node.remove();}});}
return __exports;});;

/* /web_editor/static/src/js/editor/odoo-editor/src/utils/constants.js */
odoo.define('@web_editor/js/editor/odoo-editor/src/utils/constants',[],function(require){'use strict';let __exports={};const UNBREAKABLE_ROLLBACK_CODE=__exports.UNBREAKABLE_ROLLBACK_CODE='UNBREAKABLE';const UNREMOVABLE_ROLLBACK_CODE=__exports.UNREMOVABLE_ROLLBACK_CODE='UNREMOVABLE';const REGEX_BOOTSTRAP_COLUMN=__exports.REGEX_BOOTSTRAP_COLUMN=/(?:^| )col(-[a-zA-Z]+)?(-\d+)?(?:$| )/;return __exports;});;

/* /web_editor/static/src/js/editor/odoo-editor/src/commands/align.js */
odoo.define('@web_editor/js/editor/odoo-editor/src/commands/align',['@web_editor/js/editor/odoo-editor/src/utils/utils'],function(require){'use strict';let __exports={};const{childNodeIndex,isBlock}=require("@web_editor/js/editor/odoo-editor/src/utils/utils");Text.prototype.oAlign=function(offset,mode){this.parentElement.oAlign(childNodeIndex(this),mode);};HTMLElement.prototype.oAlign=function(offset,mode){if(!isBlock(this)){return this.parentElement.oAlign(childNodeIndex(this),mode);}
const{textAlign}=getComputedStyle(this);const alreadyAlignedLeft=textAlign==='start'||textAlign==='left';const shouldApplyStyle=!(alreadyAlignedLeft&&mode==='left');if(shouldApplyStyle){this.style.textAlign=mode;}};return __exports;});;

/* /web_editor/static/src/js/editor/odoo-editor/src/commands/commands.js */
odoo.define('@web_editor/js/editor/odoo-editor/src/commands/commands',['@web_editor/js/editor/odoo-editor/src/utils/constants','@web_editor/js/editor/odoo-editor/src/utils/utils'],function(require){'use strict';let __exports={};const{REGEX_BOOTSTRAP_COLUMN}=require("@web_editor/js/editor/odoo-editor/src/utils/constants");const{ancestors,descendants,childNodeIndex,closestBlock,closestElement,DIRECTIONS,getCursors,getDeepRange,getInSelection,getListMode,getSelectedNodes,getTraversedNodes,insertAndSelectZws,isBlock,isColorGradient,isSelectionFormat,isShrunkBlock,isSelfClosingElement,leftLeafFirstPath,preserveCursor,rightPos,setSelection,setCursorStart,setTagName,splitAroundUntil,splitElement,splitTextNode,startPos,nodeSize,allowsParagraphRelatedElements,isUnbreakable,makeContentsInline,unwrapContents,getColumnIndex,pxToFloat,getRowIndex,parseHTML,formatSelection,getDeepestPosition,fillEmpty,isEmptyBlock,isWhitespace,isVisibleTextNode,getCursorDirection,resetOuids,FONT_SIZE_CLASSES,TEXT_STYLE_CLASSES,padLinkWithZws,isLinkEligibleForZwnbsp,paragraphRelatedElements,lastLeaf,firstLeaf,convertList,hasAnyFontSizeClass,}=require("@web_editor/js/editor/odoo-editor/src/utils/utils");const TEXT_CLASSES_REGEX=/\btext-[^\s]*\b/;const BG_CLASSES_REGEX=/\bbg-[^\s]*\b/;function align(editor,mode){const sel=editor.document.getSelection();const visitedBlocks=new Set();const traversedNode=getTraversedNodes(editor.editable);for(const node of traversedNode){if(isVisibleTextNode(node)){const block=closestBlock(node);if(!visitedBlocks.has(block)){const hasModifier=getComputedStyle(block).textAlign===mode;if(!hasModifier&&block.isContentEditable){block.oAlign(sel.anchorOffset,mode);}
visitedBlocks.add(block);}}}}
function colorElement(element,color,mode){const newClassName=element.className.replace(mode==='color'?TEXT_CLASSES_REGEX:BG_CLASSES_REGEX,'').replace(/\btext-gradient\b/g,'').replace(/\s+/,' ');element.className!==newClassName&&(element.className=newClassName);element.style['background-image']='';if(mode==='backgroundColor'){element.style['background']='';}
if(color.startsWith('text')||color.startsWith('bg-')){element.style[mode]='';element.classList.add(color);}else if(isColorGradient(color)){element.style[mode]='';if(mode==='color'){element.style['background']='';element.style['background-image']=color;element.classList.add('text-gradient');}else{element.style['background-image']=color;}}else{element.style[mode]=color;}}
function hasColor(element,mode){const style=element.style;const parent=element.parentNode;const classRegex=mode==='color'?TEXT_CLASSES_REGEX:BG_CLASSES_REGEX;if(isColorGradient(style['background-image'])){if(element.classList.contains('text-gradient')){if(mode==='color'){return true;}}else{if(mode!=='color'){return true;}}}
return((style[mode]&&style[mode]!=='inherit'&&(!parent||style[mode]!==parent.style[mode]))||(classRegex.test(element.className)&&(!parent||getComputedStyle(element)[mode]!==getComputedStyle(parent)[mode])));}
const editorCommands=__exports.editorCommands={insert:(editor,content)=>{if(!content)return;const selection=editor.document.getSelection();let startNode;let insertBefore=false;if(!selection.isCollapsed){editor.deleteRange(selection);}
const range=selection.getRangeAt(0);const block=closestBlock(selection.anchorNode);const isSelectionAtStart=firstLeaf(block)===selection.anchorNode&&selection.anchorOffset===0;const isSelectionAtEnd=lastLeaf(block)===selection.focusNode&&selection.focusOffset===nodeSize(selection.focusNode);if(range.startContainer.nodeType===Node.TEXT_NODE){insertBefore=!range.startOffset;splitTextNode(range.startContainer,range.startOffset,DIRECTIONS.LEFT);startNode=range.startContainer;}
const container=document.createElement('fake-element');const containerFirstChild=document.createElement('fake-element-fc');const containerLastChild=document.createElement('fake-element-lc');if(typeof content==='string'){container.textContent=content;}else{container.replaceChildren(content);}
const isList=node=>['UL','OL'].includes(node.nodeName);const hasSingleChild=container.childNodes.length===1;if(closestElement(selection.anchorNode,'UL, OL')&&isList(container.firstChild)){unwrapContents(container.firstChild);}
if(closestElement(selection.focusNode,'UL, OL')&&isList(container.lastChild)&&!hasSingleChild){unwrapContents(container.lastChild);}
startNode=startNode||editor.document.getSelection().anchorNode;const shouldUnwrap=(node)=>([...paragraphRelatedElements,'LI'].includes(node.nodeName)&&block.textContent!==""&&node.textContent!==""&&[node.nodeName,'DIV'].includes(block.nodeName)&&selection.anchorNode.oid!=='root');if(container.lastElementChild&&isBlock(container.lastElementChild)&&!container.lastElementChild.hasChildNodes()){fillEmpty(container.lastElementChild);}
if(container.childElementCount===1&&(['P','LI'].includes(container.firstChild.nodeName)||shouldUnwrap(container.firstChild))&&selection.anchorNode.oid!=='root'){const p=container.firstElementChild;container.replaceChildren(...p.childNodes);}else if(container.childElementCount>1){if(shouldUnwrap(container.firstChild)&&!isSelectionAtStart){if(container.firstChild.nodeName==='LI'){const deepestBlock=closestBlock(firstLeaf(container.firstChild));splitAroundUntil(deepestBlock,container.firstChild);container.firstElementChild.replaceChildren(...deepestBlock.childNodes);}
containerFirstChild.replaceChildren(...container.firstElementChild.childNodes);container.firstElementChild.remove();}
if(shouldUnwrap(container.lastChild)&&!isSelectionAtEnd){if(container.lastChild.nodeName==='LI'){const deepestBlock=closestBlock(lastLeaf(container.lastChild));splitAroundUntil(deepestBlock,container.lastChild);container.lastElementChild.replaceChildren(...deepestBlock.childNodes);}
containerLastChild.replaceChildren(...container.lastElementChild.childNodes);container.lastElementChild.remove();}}
if(startNode.nodeType===Node.ELEMENT_NODE){if(selection.anchorOffset===0){const textNode=editor.document.createTextNode('');if(isSelfClosingElement(startNode)){startNode.parentNode.insertBefore(textNode,startNode);}else{startNode.prepend(textNode);}
startNode=textNode;}else{startNode=startNode.childNodes[selection.anchorOffset-1];}}
let currentNode=startNode;let lastChildNode=false;const currentList=currentNode&&closestElement(currentNode,'UL, OL');const mode=currentList&&getListMode(currentList);const _insertAt=(reference,nodes,insertBefore)=>{for(const child of(insertBefore?nodes.reverse():nodes)){reference[insertBefore?'before':'after'](child);reference=child;}}
const lastInsertedNodes=[...containerLastChild.childNodes];if(containerLastChild.hasChildNodes()){const toInsert=[...containerLastChild.childNodes];_insertAt(currentNode,[...toInsert],insertBefore);currentNode=insertBefore?toInsert[0]:currentNode;lastChildNode=toInsert[toInsert.length-1];}
const firstInsertedNodes=[...containerFirstChild.childNodes];if(containerFirstChild.hasChildNodes()){const toInsert=[...containerFirstChild.childNodes];_insertAt(currentNode,[...toInsert],insertBefore);currentNode=toInsert[toInsert.length-1];insertBefore=false;}
if(!container.hasChildNodes()){if(isUnbreakable(closestBlock(currentNode.nextSibling))){currentNode.nextSibling.oShiftEnter(0);}else{const parent=currentNode.nextSibling.parentElement;const index=[...parent.childNodes].indexOf(currentNode.nextSibling);parent.oEnter(index);}}
let nodeToInsert;const insertedNodes=[...container.childNodes];while((nodeToInsert=container.childNodes[0])){if(isBlock(nodeToInsert)&&!allowsParagraphRelatedElements(currentNode)){while(currentNode.parentElement!==editor.editable&&(!allowsParagraphRelatedElements(currentNode.parentElement)||(currentNode.parentElement.nodeName==="LI"&&!isUnbreakable(nodeToInsert)))){if(isUnbreakable(currentNode.parentElement)){makeContentsInline(container);nodeToInsert=container.childNodes[0];break;}
let offset=childNodeIndex(currentNode);if(!insertBefore){offset+=1;}
if(offset){const[left,right]=splitElement(currentNode.parentElement,offset);if(isUnbreakable(nodeToInsert)&&container.childNodes.length===1){fillEmpty(right);}else if(isEmptyBlock(right)&&!insertBefore){right.remove();}
currentNode=insertBefore&&right.isConnected?right:left;}else{currentNode=currentNode.parentElement;}}
if(currentNode.parentElement.nodeName==='LI'&&isUnbreakable(nodeToInsert)){const br=document.createElement('br');currentNode[currentNode.textContent?'after':'before'](br);}}
if(block.nodeName==="LI"&&paragraphRelatedElements.includes(nodeToInsert.nodeName)){setTagName(nodeToInsert,"LI");}
const isNodeToInsertContentEditable=nodeToInsert.isContentEditable;if(insertBefore){currentNode.before(nodeToInsert);insertBefore=false;}else{currentNode.after(nodeToInsert);}
let convertedList;if(currentList&&((nodeToInsert.nodeName==='LI'&&nodeToInsert.classList.contains('oe-nested'))||isList(nodeToInsert))){convertedList=convertList(nodeToInsert,mode);}
if(currentNode.tagName!=='BR'&&isShrunkBlock(currentNode)){currentNode.remove();}
if(!isNodeToInsertContentEditable&&editor.editable.firstChild===nodeToInsert&&nodeToInsert.nodeType===Node.ELEMENT_NODE&&(nodeToInsert.classList.contains("o_knowledge_behavior_type_template")||nodeToInsert.classList.contains("o_editor_banner"))){const zws=document.createTextNode("\u200B");nodeToInsert.before(zws);}
currentNode=convertedList||nodeToInsert;}
currentNode=lastChildNode||currentNode;if(!isUnbreakable(currentNode)&&currentNode.nodeName!=='BR'&&currentNode.nextSibling&&currentNode.nextSibling.nodeName==='BR'&&lastLeaf(currentNode.parentNode)===currentNode.nextSibling&&!closestElement(currentNode,'[t-field],[t-esc],[t-out]')){currentNode.nextSibling.remove();}
selection.removeAllRanges();const newRange=new Range();let lastPosition;if(currentNode.nodeName==='A'&&isLinkEligibleForZwnbsp(editor.editable,currentNode)){padLinkWithZws(editor.editable,currentNode);currentNode=currentNode.nextSibling;lastPosition=getDeepestPosition(...rightPos(currentNode));}else{lastPosition=[...paragraphRelatedElements,'LI','UL','OL'].includes(currentNode.nodeName)?rightPos(lastLeaf(currentNode)):rightPos(currentNode);}
if(lastPosition[0].nodeName==="A"&&(lastPosition[1]===nodeSize(lastPosition[0])||lastPosition[1]===0)&&isLinkEligibleForZwnbsp(editor.editable,lastPosition[0])){padLinkWithZws(editor.editable,lastPosition[0]);currentNode=lastPosition[0].nextSibling;lastPosition=getDeepestPosition(...rightPos(currentNode));}
if(!editor.options.allowInlineAtRoot&&lastPosition[0]===editor.editable){lastPosition=getDeepestPosition(...lastPosition);}
newRange.setStart(lastPosition[0],lastPosition[1]);newRange.setEnd(lastPosition[0],lastPosition[1]);selection.addRange(newRange);return[...firstInsertedNodes,...insertedNodes,...lastInsertedNodes];},insertFontAwesome:(editor,faClass='fa fa-star')=>{const insertedNode=editorCommands.insert(editor,document.createElement('i'))[0];insertedNode.className=faClass;const position=rightPos(insertedNode);setSelection(...position,...position,false);},undo:editor=>editor.historyUndo(),redo:editor=>editor.historyRedo(),setTag(editor,tagName,extraClass=""){const range=getDeepRange(editor.editable,{correctTripleClick:true});const selectedBlocks=[...new Set(getTraversedNodes(editor.editable,range).map(closestBlock).filter((block)=>block.isContentEditable)),];const deepestSelectedBlocks=selectedBlocks.filter(block=>(!descendants(block).some(descendant=>selectedBlocks.includes(descendant))&&block.isContentEditable));let{startContainer,startOffset,endContainer,endOffset}=range;const startContainerChild=startContainer.firstChild;const endContainerChild=endContainer.lastChild;for(const block of deepestSelectedBlocks){if(['P','PRE','H1','H2','H3','H4','H5','H6','LI','BLOCKQUOTE'].includes(block.nodeName,)){const inLI=block.closest('li');if(inLI&&tagName==="P"){inLI.oToggleList(0);}else{const newEl=setTagName(block,tagName);newEl.classList.remove(...FONT_SIZE_CLASSES,...TEXT_STYLE_CLASSES,"h1","h2","h3","h4","h5","h6");delete newEl.style.fontSize;if(extraClass){newEl.classList.add(extraClass);}
if(newEl.classList.length===0){newEl.removeAttribute("class");}}}else{const newBlock=editor.document.createElement(tagName);const children=[...block.childNodes];block.insertBefore(newBlock,block.firstChild);children.forEach(child=>newBlock.appendChild(child));}}
const isContextBlock=container=>['TD','DIV','LI'].includes(container.nodeName);if(!startContainer.isConnected||isContextBlock(startContainer)){startContainer=startContainerChild?.parentNode||startContainer;}
if(!endContainer.isConnected||isContextBlock(endContainer)){endContainer=endContainerChild?.parentNode||endContainer;}
const newRange=new Range();newRange.setStart(startContainer,startOffset);newRange.setEnd(endContainer,endOffset);getDeepRange(editor.editable,{range:newRange,select:true});editor.historyStep();},bold:editor=>formatSelection(editor,'bold'),italic:editor=>formatSelection(editor,'italic'),underline:editor=>formatSelection(editor,'underline'),strikeThrough:editor=>formatSelection(editor,'strikeThrough'),setFontSize:(editor,size)=>formatSelection(editor,'fontSize',{applyStyle:true,formatProps:{size}}),setFontSizeClassName:(editor,className)=>formatSelection(editor,'setFontSizeClassName',{applyStyle:true,formatProps:{className}}),switchDirection:editor=>{getDeepRange(editor.editable,{splitText:true,select:true,correctTripleClick:true});const selection=editor.document.getSelection();const selectedTextNodes=[selection.anchorNode,...getSelectedNodes(editor.editable),selection.focusNode].filter(n=>n.nodeType===Node.TEXT_NODE&&closestElement(n).isContentEditable&&n.nodeValue.trim().length);const changedElements=[];const defaultDirection=editor.options.direction;const shouldApplyStyle=!isSelectionFormat(editor.editable,'switchDirection');let blocks=new Set(selectedTextNodes.map(textNode=>closestElement(textNode,'ul,ol')||closestBlock(textNode)));blocks.forEach(block=>{blocks=[...blocks,...block.querySelectorAll('ul,ol')];})
for(const block of blocks){if(!shouldApplyStyle){block.removeAttribute('dir');}else{block.setAttribute('dir',defaultDirection==='ltr'?'rtl':'ltr');}
changedElements.push(block);}
for(const element of changedElements){const style=getComputedStyle(element);if(style.direction==='ltr'&&style.textAlign==='right'){element.style.setProperty('text-align','left');}else if(style.direction==='rtl'&&style.textAlign==='left'){element.style.setProperty('text-align','right');}}},removeFormat:editor=>{const textAlignStyles=new Map();getTraversedNodes(editor.editable).forEach((element)=>{const block=closestBlock(element);if(block.style.textAlign){textAlignStyles.set(block,block.style.textAlign);}});editor.historyPauseSteps();editor.document.execCommand('removeFormat');let hasFontSizeClass;for(const node of getTraversedNodes(editor.editable)){if(node.nodeType===Node.ELEMENT_NODE&&node.hasAttribute('color')){node.removeAttribute('color');}
const element=closestElement(node);element.style.removeProperty('color');element.style.removeProperty('background');element.style.removeProperty('-webkit-text-fill-color');if(!hasFontSizeClass&&closestElement(node,hasAnyFontSizeClass)){hasFontSizeClass=true;}}
if(hasFontSizeClass){formatSelection(editor,'setFontSizeClassName',{applyStyle:false});}
textAlignStyles.forEach((textAlign,block)=>{block.style.setProperty('text-align',textAlign);});editor.historyUnpauseSteps();},justifyLeft:editor=>align(editor,'left'),justifyRight:editor=>align(editor,'right'),justifyCenter:editor=>align(editor,'center'),justifyFull:editor=>align(editor,'justify'),unlink:editor=>{const sel=editor.document.getSelection();const isCollapsed=sel.isCollapsed;getDeepRange(editor.editable,{sel,splitText:true,select:true});if(!isCollapsed){let{anchorNode,focusNode,anchorOffset,focusOffset}=sel;const direction=getCursorDirection(anchorNode,anchorOffset,focusNode,focusOffset);const[startLink,endLink]=[closestElement(anchorNode,'a'),closestElement(focusNode,'a')];if(startLink){anchorNode=splitAroundUntil(anchorNode,startLink);anchorOffset=direction===DIRECTIONS.RIGHT?0:nodeSize(anchorNode);setSelection(anchorNode,anchorOffset,focusNode,focusOffset,true);}
if(endLink&&endLink.isConnected){focusNode=splitAroundUntil(focusNode,endLink);focusOffset=direction===DIRECTIONS.RIGHT?nodeSize(focusNode):0;setSelection(anchorNode,anchorOffset,focusNode,focusOffset,true);}}
const targetedNodes=isCollapsed?[sel.anchorNode]:getSelectedNodes(editor.editable);const links=new Set(targetedNodes.map(node=>closestElement(node,'a')).filter(a=>a&&a.isContentEditable));if(links.size){const cr=preserveCursor(editor.document);for(const link of links){unwrapContents(link);}
cr();}},indentList:(editor,mode='indent')=>{const[pos1,pos2]=getCursors(editor.document);const end=leftLeafFirstPath(...pos1).next().value;const li=new Set();for(const node of leftLeafFirstPath(...pos2)){const cli=closestElement(node,'li');if(cli&&cli.tagName=='LI'&&!li.has(cli)&&!cli.classList.contains('oe-nested')&&cli.isContentEditable&&!cli.classList.contains('nav-item')){li.add(cli);}
if(node==end)break;}
for(const node of li){if(mode=='indent'){node.oTab(0);}else{node.oShiftTab(0);}}
return true;},toggleList:(editor,mode)=>{const li=new Set();const blocks=new Set();const selectedBlocks=getTraversedNodes(editor.editable);const deepestSelectedBlocks=selectedBlocks.filter(block=>(!descendants(block).some(descendant=>selectedBlocks.includes(descendant))));for(const node of deepestSelectedBlocks){let nodeToToggle=closestBlock(node);if(![...paragraphRelatedElements,'LI'].includes(nodeToToggle.nodeName)&&node.nodeType===Node.TEXT_NODE&&isWhitespace(node)&&closestElement(node).isContentEditable){node.remove();}else{const isNavItemList=node=>node.nodeName==='LI'&&node.classList.contains('nav-item');nodeToToggle=isNavItemList(nodeToToggle)?node:nodeToToggle;if(!['OL','UL'].includes(nodeToToggle.tagName)&&(nodeToToggle.isContentEditable||nodeToToggle.nodeType===Node.TEXT_NODE)){const closestLi=closestElement(nodeToToggle,'li');nodeToToggle=closestLi&&!isNavItemList(closestLi)?closestLi:nodeToToggle;const ublock=nodeToToggle.nodeName==='LI'&&nodeToToggle.closest('ol, ul');ublock&&getListMode(ublock)==mode?li.add(nodeToToggle):blocks.add(nodeToToggle);}}}
let target=[...(blocks.size?blocks:li)];if(blocks.size){for(const block of blocks){if(block.style){block.style.padding="";}}}
while(target.length){const node=target.pop();if(!node.oToggleList(0,mode)){target=target.filter(li=>li.parentNode!=node.parentNode||li.tagName!='LI',);}}},applyColor:(editor,color,mode,element)=>{const selectedTds=[...editor.editable.querySelectorAll('td.o_selected_td')].filter(node=>closestElement(node).isContentEditable);let coloredTds=[];if(selectedTds.length&&mode==="backgroundColor"){for(const td of selectedTds){colorElement(td,color,mode);}
coloredTds=[...selectedTds];}else if(element){colorElement(element,color,mode);return[element];}
const selection=editor.document.getSelection();let wasCollapsed=false;if(selection.getRangeAt(0).collapsed&&!selectedTds.length){insertAndSelectZws(selection);wasCollapsed=true;}
const range=getDeepRange(editor.editable,{splitText:true,select:true});if(!range)return;const restoreCursor=preserveCursor(editor.document);const selectionNodes=getSelectedNodes(editor.editable).filter(node=>closestElement(node).isContentEditable);if(isEmptyBlock(range.endContainer)){selectionNodes.push(range.endContainer,...descendants(range.endContainer));}
let selectedNodes=mode==="backgroundColor"?selectionNodes.filter(node=>!closestElement(node,'table.o_selected_table')):selectionNodes;const findTopMostDecoration=(current)=>{const decoration=closestElement(current.parentNode,"s, u");return decoration?.textContent===current.textContent?findTopMostDecoration(decoration):current;};selectedNodes=selectedNodes.map((node)=>{return findTopMostDecoration(node);});const selectedFieldNodes=new Set(getSelectedNodes(editor.editable).map(n=>closestElement(n,"*[t-field],*[t-out],*[t-esc]")).filter(Boolean));function getFonts(selectedNodes){return selectedNodes.flatMap(node=>{let font=closestElement(node,'font')||closestElement(node,'span');const children=font&&descendants(font);const hasInlineGradient=font&&isColorGradient(font.style["background-image"]);if(font&&(font.nodeName==="FONT"||(font.nodeName==="SPAN"&&font.style[mode]))&&(isColorGradient(color)||color===""||!hasInlineGradient)){const selectedChildren=children.filter(child=>selectedNodes.includes(child));if(selectedChildren.length){const closestGradientEl=closestElement(node,'font[style*="background-image"], span[style*="background-image"]');const isGradientBeingUpdated=closestGradientEl&&isColorGradient(color);const splitnode=isGradientBeingUpdated?closestGradientEl:font;font=splitAroundUntil(selectedChildren,splitnode);if(isGradientBeingUpdated){const classRegex=mode==='color'?TEXT_CLASSES_REGEX:BG_CLASSES_REGEX;for(const node of descendants(font)){if(node.nodeType===Node.ELEMENT_NODE&&(node.style[mode]||classRegex.test(node.className))){colorElement(node,"",mode);node.style.webkitTextFillColor="";}}}else if(mode==="color"&&(font.style.webkitTextFillColor||closestGradientEl&&closestGradientEl.classList.contains("text-gradient"))){font.style.webkitTextFillColor=color;}}else{font=[];}}else if((node.nodeType===Node.TEXT_NODE&&!isWhitespace(node)&&node.textContent!=='\ufeff')||(node.nodeName==='BR'&&isEmptyBlock(node.parentNode))||(node.nodeType===Node.ELEMENT_NODE&&node.nodeName!=='FIGURE'&&['inline','inline-block'].includes(getComputedStyle(node).display)&&!isWhitespace(node.textContent)&&!node.classList.contains('btn')&&!node.querySelector('font'))&&node.nodeName!=='A'&&!(node.nodeName==='SPAN'&&node.style['fontSize'])){const previous=node.previousSibling;const classRegex=mode==='color'?BG_CLASSES_REGEX:TEXT_CLASSES_REGEX;if(previous&&previous.nodeName==='FONT'&&!previous.style[mode==='color'?'backgroundColor':'color']&&!classRegex.test(previous.className)&&selectedNodes.includes(previous.firstChild)&&selectedNodes.includes(previous.lastChild)){font=previous;}else{const isTextGradient=hasInlineGradient&&font.classList.contains("text-gradient");font=document.createElement('font');node.after(font);if(isTextGradient&&mode==="color"){font.style.webkitTextFillColor=color;}}
if(node.textContent){font.appendChild(node);}else{fillEmpty(font);}}else{font=[];}
return font;});}
for(const fieldNode of selectedFieldNodes){colorElement(fieldNode,color,mode);}
let fonts=getFonts(selectedNodes);if(!fonts.every((font)=>font.isConnected)){fonts=getFonts(selectedNodes);}
const fontsSet=new Set(fonts);for(const font of fontsSet){colorElement(font,color,mode);if((!hasColor(font,'color')&&!hasColor(font,'backgroundColor'))&&(!font.hasAttribute('style')||!color)){for(const child of[...font.childNodes]){font.parentNode.insertBefore(child,font);}
font.parentNode.removeChild(font);fontsSet.delete(font);}}
restoreCursor();if(wasCollapsed){const newSelection=editor.document.getSelection();const range=new Range();range.setStart(newSelection.anchorNode,newSelection.anchorOffset);range.collapse(true);newSelection.removeAllRanges();newSelection.addRange(range);}
return[...fontsSet,...coloredTds];},insertTable:(editor,{rowNumber=2,colNumber=2}={})=>{const tdsHtml=new Array(colNumber).fill('<td><p><br></p></td>').join('');const trsHtml=new Array(rowNumber).fill(`<tr>${tdsHtml}</tr>`).join('');const tableHtml=`<table class="table table-bordered o_table"><tbody>${trsHtml}</tbody></table>`;const sel=editor.document.getSelection();if(!sel.isCollapsed){editor.deleteRange(sel);}
while(!isBlock(sel.anchorNode)){const anchorNode=sel.anchorNode;const isTextNode=anchorNode.nodeType===Node.TEXT_NODE;const newAnchorNode=isTextNode?splitTextNode(anchorNode,sel.anchorOffset,DIRECTIONS.LEFT)+1&&anchorNode:splitElement(anchorNode,sel.anchorOffset).shift();const newPosition=rightPos(newAnchorNode);setSelection(...newPosition,...newPosition,false);}
const[table]=editorCommands.insert(editor,parseHTML(editor.document,tableHtml));setCursorStart(table.querySelector('p'));},addColumn:(editor,beforeOrAfter,referenceCell)=>{if(!referenceCell){getDeepRange(editor.editable,{select:true});referenceCell=getInSelection(editor.document,'td');if(!referenceCell)return;}
const columnIndex=getColumnIndex(referenceCell);const table=closestElement(referenceCell,'table');const tableWidth=table.style.width?pxToFloat(table.style.width):table.clientWidth;const referenceColumn=table.querySelectorAll(`tr td:nth-of-type(${columnIndex + 1})`);const referenceCellWidth=referenceCell.style.width?pxToFloat(referenceCell.style.width):referenceCell.clientWidth;const firstRow=table.querySelector('tr');const firstRowCells=[...firstRow.children].filter(child=>child.nodeName==='TD'||child.nodeName==='TH');let totalWidth=0;for(const cell of firstRowCells){const width=cell.style.width?pxToFloat(cell.style.width):cell.clientWidth;cell.style.width=width+'px';const newWidth=Math.max(Math.round((width*tableWidth)/(tableWidth+referenceCellWidth-1)),13);cell.style.width=newWidth+'px';totalWidth+=newWidth;}
referenceColumn.forEach((cell,rowIndex)=>{const newCell=document.createElement('td');const p=document.createElement('p');p.append(document.createElement('br'));newCell.append(p);cell[beforeOrAfter](newCell);if(rowIndex===0){newCell.style.width=cell.style.width;totalWidth+=pxToFloat(cell.style.width);}});if(totalWidth!==tableWidth-1){firstRowCells[firstRowCells.length-1].style.width=pxToFloat(firstRowCells[firstRowCells.length-1].style.width)+(tableWidth-totalWidth-1)+'px';}
table.style.width=tableWidth+'px';},addRow:(editor,beforeOrAfter,referenceRow)=>{if(!referenceRow){getDeepRange(editor.editable,{select:true});referenceRow=getInSelection(editor.document,'tr');if(!referenceRow)return;}
const referenceRowHeight=referenceRow.style.height?pxToFloat(referenceRow.style.height):referenceRow.clientHeight;const newRow=document.createElement('tr');newRow.style.height=referenceRowHeight+'px';const cells=referenceRow.querySelectorAll('td');newRow.append(...Array.from(Array(cells.length)).map(()=>{const td=document.createElement('td');const p=document.createElement('p');p.append(document.createElement('br'));td.append(p);return td;}));referenceRow[beforeOrAfter](newRow);newRow.style.height=referenceRowHeight+'px';if(getRowIndex(newRow)===0){let columnIndex=0;for(const newColumn of newRow.children){newColumn.style.width=cells[columnIndex].style.width;cells[columnIndex].style.width='';columnIndex++;}}},removeColumn:(editor,cell)=>{if(!cell){getDeepRange(editor.editable,{select:true});cell=getInSelection(editor.document,'td');if(!cell)return;}
const table=closestElement(cell,'table');const cells=[...closestElement(cell,'tr').querySelectorAll('th, td')];const index=cells.findIndex(td=>td===cell);const siblingCell=cells[index-1]||cells[index+1];if(table.style.width){const tableRect=table.getBoundingClientRect();const cellRect=cell.getBoundingClientRect();table.style.width=tableRect.width-cellRect.width+'px';}
table.querySelectorAll(`tr td:nth-of-type(${index + 1})`).forEach(td=>td.remove());siblingCell?setSelection(...startPos(siblingCell)):editorCommands.deleteTable(editor,table);},removeRow:(editor,row)=>{if(!row){getDeepRange(editor.editable,{select:true});row=getInSelection(editor.document,'tr');if(!row)return;}
const table=closestElement(row,'table');const rows=[...table.querySelectorAll('tr')];const rowIndex=rows.findIndex(tr=>tr===row);const siblingRow=rows[rowIndex-1]||rows[rowIndex+1];row.remove();siblingRow?setSelection(...startPos(siblingRow)):editorCommands.deleteTable(editor,table);},resetSize:(editor,table)=>{if(!table){getDeepRange(editor.editable,{select:true});table=getInSelection(editor.document,'table');}
table.removeAttribute('style');const cells=[...table.querySelectorAll('tr, td')];cells.forEach(cell=>{const cStyle=cell.style;if(cell.tagName==='TR'){cStyle.height='';}else{cStyle.width='';}})},deleteTable:(editor,table)=>{table=table||getInSelection(editor.document,'table');if(!table)return;const p=document.createElement('p');p.appendChild(document.createElement('br'));table.before(p);table.remove();setSelection(p,0);},columnize:(editor,numberOfColumns,addParagraphAfter=true)=>{const sel=editor.document.getSelection();const anchor=sel.anchorNode;const hasColumns=!!closestElement(anchor,'.o_text_columns');if(!numberOfColumns&&hasColumns){const restore=preserveCursor(editor.document);const container=closestElement(anchor,'.o_text_columns');const rows=unwrapContents(container);for(const row of rows){const columns=unwrapContents(row);for(const column of columns){const columnContents=unwrapContents(column);for(const node of columnContents){resetOuids(node);}}}
restore();}else if(numberOfColumns&&!hasColumns){const restore=preserveCursor(editor.document);const container=document.createElement('div');if(!closestElement(anchor,'.container')){container.classList.add('container');}
container.classList.add('o_text_columns');const row=document.createElement('div');row.classList.add('row');container.append(row);const block=closestBlock(anchor);resetOuids(block);const columnSize=Math.floor(12/numberOfColumns);const columns=[];for(let i=0;i<numberOfColumns;i++){const column=document.createElement('div');column.classList.add(`col-${columnSize}`);row.append(column);columns.push(column);}
block.before(container);columns.shift().append(block);for(const column of columns){const p=document.createElement('p');p.append(document.createElement('br'));p.classList.add('oe-hint');p.setAttribute('placeholder','New column...');column.append(p);}
restore();if(addParagraphAfter){const p=document.createElement('p');p.append(document.createElement('br'));container.after(p);}}else if(numberOfColumns&&hasColumns){const row=closestElement(anchor,'.row');const columns=[...row.children];const columnSize=Math.floor(12/numberOfColumns);const diff=numberOfColumns-columns.length;if(diff>0){const restore=preserveCursor(editor.document);for(const column of columns){column.className=column.className.replace(REGEX_BOOTSTRAP_COLUMN,`col$1-${columnSize}`);}
let lastColumn=columns[columns.length-1];for(let i=0;i<diff;i++){const column=document.createElement('div');column.classList.add(`col-${columnSize}`);const p=document.createElement('p');p.append(document.createElement('br'));p.classList.add('oe-hint');p.setAttribute('placeholder','New column...');column.append(p);lastColumn.after(column);lastColumn=column;}
restore();}else if(diff<0){const restore=preserveCursor(editor.document);for(const column of columns){column.className=column.className.replace(REGEX_BOOTSTRAP_COLUMN,`col$1-${columnSize}`);}
const contents=[];for(let i=diff;i<0;i++){const column=columns.pop();const columnContents=unwrapContents(column);for(const node of columnContents){resetOuids(node);}
contents.unshift(...columnContents);}
columns[columns.length-1].append(...contents);restore();}}},insertHorizontalRule(editor){const selection=editor.document.getSelection();const range=selection.getRangeAt(0);const element=closestElement(range.startContainer,paragraphRelatedElements)||closestBlock(range.startContainer);if(element&&ancestors(element).includes(editor.editable)){element.before(editor.document.createElement('hr'));}},};return __exports;});;

/* /web_editor/static/src/js/editor/odoo-editor/src/commands/deleteBackward.js */
odoo.define('@web_editor/js/editor/odoo-editor/src/commands/deleteBackward',['@web_editor/js/editor/odoo-editor/src/utils/constants','@web_editor/js/editor/odoo-editor/src/commands/deleteForward','@web_editor/js/editor/odoo-editor/src/utils/utils'],function(require){'use strict';let __exports={};const{UNBREAKABLE_ROLLBACK_CODE,UNREMOVABLE_ROLLBACK_CODE,REGEX_BOOTSTRAP_COLUMN}=require("@web_editor/js/editor/odoo-editor/src/utils/constants");const{deleteText}=require("@web_editor/js/editor/odoo-editor/src/commands/deleteForward");const{boundariesOut,childNodeIndex,CTGROUPS,CTYPES,DIRECTIONS,endPos,fillEmpty,getState,isBlock,isEmptyBlock,isUnbreakable,isUnremovable,isVisible,leftPos,rightPos,moveNodes,nodeSize,paragraphRelatedElements,prepareUpdate,setSelection,isMediaElement,isSelfClosingElement,isNotEditableNode,createDOMPathGenerator,closestElement,closestBlock,getOffsetAndCharSize,ZERO_WIDTH_CHARS,isButton,}=require("@web_editor/js/editor/odoo-editor/src/utils/utils");Text.prototype.oDeleteBackward=function(offset,alreadyMoved=false){const parentElement=this.parentElement;if(!offset){parentElement.oDeleteBackward([...parentElement.childNodes].indexOf(this),alreadyMoved);return;}
const[newOffset,charSize]=getOffsetAndCharSize(this.nodeValue,offset,DIRECTIONS.LEFT);deleteText.call(this,charSize,newOffset-charSize,DIRECTIONS.LEFT,alreadyMoved);};const isDeletable=(node)=>{return isMediaElement(node)||isNotEditableNode(node);}
HTMLElement.prototype.oDeleteBackward=function(offset,alreadyMoved=false,offsetLimit){const contentIsZWS=ZERO_WIDTH_CHARS.includes(this.textContent);let moveDest;if(offset){const leftNode=this.childNodes[offset-1];if(isUnremovable(leftNode)){throw UNREMOVABLE_ROLLBACK_CODE;}
if(isDeletable(leftNode)){const parentEl=leftNode.parentElement;leftNode.remove();fillEmpty(parentEl);return;}
if(!isBlock(leftNode)||isSelfClosingElement(leftNode)){leftNode.oDeleteBackward(nodeSize(leftNode),alreadyMoved);return;}
alreadyMoved=true;moveDest=endPos(leftNode);}else{if(isUnremovable(this)){throw UNREMOVABLE_ROLLBACK_CODE;}
if(isUnbreakable(this)&&(REGEX_BOOTSTRAP_COLUMN.test(this.className)||!isEmptyBlock(this))){throw UNBREAKABLE_ROLLBACK_CODE;}
const parentEl=this.parentElement;if(parentEl&&parentEl.getAttribute("contenteditable")==="true"&&parentEl.oid!=="root"&&parentEl.parentElement&&!parentEl.parentElement.isContentEditable&&paragraphRelatedElements.includes(this.tagName)&&!this.previousElementSibling){throw UNREMOVABLE_ROLLBACK_CODE;}
const closestLi=closestElement(this,'li');if((closestLi&&!closestLi.previousElementSibling)||!isBlock(this)||isSelfClosingElement(this)){const parentOffset=childNodeIndex(this);if(!nodeSize(this)||contentIsZWS){const visible=isVisible(this)||isButton(this);const restore=prepareUpdate(...boundariesOut(this));this.remove();restore();fillEmpty(parentEl);if(visible){setSelection(parentEl,parentOffset);return;}}
parentEl.oDeleteBackward(parentOffset,alreadyMoved);return;}
const previousElementSiblingClosestBlock=closestBlock(this.previousElementSibling);if(previousElementSiblingClosestBlock&&(isEmptyBlock(previousElementSiblingClosestBlock)||previousElementSiblingClosestBlock.textContent==='\u200B')&&paragraphRelatedElements.includes(this.nodeName)){previousElementSiblingClosestBlock.remove();setSelection(this,0);return;}
if(!this.previousElementSibling&&paragraphRelatedElements.includes(this.nodeName)&&this.nodeName!=='P'&&!closestLi){if(!this.textContent){const p=document.createElement('p');p.replaceChildren(...this.childNodes);this.replaceWith(p);setSelection(p,offset);}
return;}else{moveDest=leftPos(this);}}
const domPathGenerator=createDOMPathGenerator(DIRECTIONS.LEFT,{leafOnly:true,stopTraverseFunction:isDeletable,});const domPath=domPathGenerator(this,offset)
const leftNode=domPath.next().value;if(leftNode&&isDeletable(leftNode)){const[parent,offset]=rightPos(leftNode);return parent.oDeleteBackward(offset,alreadyMoved);}
let node=this.childNodes[offset];const nextSibling=this.nextSibling;let currentNodeIndex=offset;if(offsetLimit===undefined){while(node&&!isBlock(node)){node=node.nextSibling;currentNodeIndex++;}}else{currentNodeIndex=offsetLimit;}
let[cursorNode,cursorOffset]=moveNodes(...moveDest,this,offset,currentNodeIndex);setSelection(cursorNode,cursorOffset);if(cursorNode.nodeType===Node.TEXT_NODE&&(cursorOffset===0||cursorOffset===cursorNode.length)){cursorOffset=childNodeIndex(cursorNode)+(cursorOffset===0?0:1);cursorNode=cursorNode.parentNode;}
if(cursorNode.nodeType!==Node.TEXT_NODE){const{cType}=getState(cursorNode,cursorOffset,DIRECTIONS.LEFT);if(cType&CTGROUPS.BLOCK&&(!alreadyMoved||cType===CTYPES.BLOCK_OUTSIDE)){cursorNode.oDeleteBackward(cursorOffset,alreadyMoved,cursorOffset+currentNodeIndex-offset);}else if(!alreadyMoved){const cursorNodeNode=cursorNode.childNodes[cursorOffset];const cursorNodeRightNode=cursorNodeNode?cursorNodeNode.nextSibling:undefined;if(cursorNodeRightNode&&cursorNodeRightNode.nodeType===Node.TEXT_NODE&&nextSibling===cursorNodeRightNode){moveDest[0].insertBefore(document.createElement('br'),cursorNodeRightNode);}}}};HTMLLIElement.prototype.oDeleteBackward=function(offset,alreadyMoved=false){if(offset===0){this.oToggleList(offset);return;}
HTMLElement.prototype.oDeleteBackward.call(this,offset,alreadyMoved);};HTMLBRElement.prototype.oDeleteBackward=function(offset,alreadyMoved=false){const parentOffset=childNodeIndex(this);const rightState=getState(this.parentElement,parentOffset+1,DIRECTIONS.RIGHT).cType;if(rightState&CTYPES.BLOCK_INSIDE){this.parentElement.oDeleteBackward(parentOffset,alreadyMoved);}else{HTMLElement.prototype.oDeleteBackward.call(this,offset,alreadyMoved);}};HTMLTableCellElement.prototype.oDeleteBackward=function(offset,alreadyMoved=false){if(offset){HTMLElement.prototype.oDeleteBackward.call(this,offset,alreadyMoved);}};return __exports;});;

/* /web_editor/static/src/js/editor/odoo-editor/src/commands/deleteForward.js */
odoo.define('@web_editor/js/editor/odoo-editor/src/commands/deleteForward',['@web_editor/js/editor/odoo-editor/src/utils/constants','@web_editor/js/editor/odoo-editor/src/utils/utils'],function(require){'use strict';let __exports={};const{UNREMOVABLE_ROLLBACK_CODE}=require("@web_editor/js/editor/odoo-editor/src/utils/constants");const{findNode,isSelfClosingElement,nodeSize,rightPos,getState,DIRECTIONS,CTYPES,leftPos,isIconElement,rightLeafOnlyNotBlockNotEditablePath,rightLeafOnlyPathNotBlockNotEditablePath,isNotEditableNode,splitTextNode,paragraphRelatedElements,prepareUpdate,isInPre,fillEmpty,setSelection,isZWS,childNodeIndex,boundariesOut,isEditorTab,isVisible,isUnbreakable,isEmptyBlock,isWhitespace,isVisibleTextNode,getOffsetAndCharSize,ZERO_WIDTH_CHARS,}=require("@web_editor/js/editor/odoo-editor/src/utils/utils");__exports.deleteText=deleteText;function deleteText(charSize,offset,direction,alreadyMoved){const parentElement=this.parentElement;const firstSplitOffset=splitTextNode(this,offset);const secondSplitOffset=splitTextNode(parentElement.childNodes[firstSplitOffset],charSize);const middleNode=parentElement.childNodes[firstSplitOffset];const restore=prepareUpdate(parentElement,firstSplitOffset,parentElement,secondSplitOffset);const isSpace=isWhitespace(middleNode)&&!isInPre(middleNode);const isZWS=ZERO_WIDTH_CHARS.includes(middleNode.nodeValue);middleNode.remove();restore();const parentState=getState(parentElement,firstSplitOffset,direction);if(isZWS||(isSpace&&(parentState.cType!==CTYPES.CONTENT||parentState.node===undefined))){if(direction===DIRECTIONS.LEFT){parentElement.oDeleteBackward(firstSplitOffset,alreadyMoved);}else{if(isSpace&&parentState.node==undefined){this.oDeleteForward(offset,alreadyMoved);}else{parentElement.oDeleteForward(firstSplitOffset,alreadyMoved);}}
if(isZWS&&parentElement.isConnected){fillEmpty(parentElement);}
return;}
if(parentElement.tagName==="CODE"&&!parentElement.textContent.length){parentElement.remove();return;}
fillEmpty(parentElement);setSelection(parentElement,firstSplitOffset);}
Text.prototype.oDeleteForward=function(offset,alreadyMoved=false){const parentElement=this.parentElement;if(offset===this.nodeValue.length){parentElement.oDeleteForward([...parentElement.childNodes].indexOf(this)+1);return;}
const[newOffset,charSize]=getOffsetAndCharSize(this.nodeValue,offset+1,DIRECTIONS.RIGHT);deleteText.call(this,charSize,newOffset,DIRECTIONS.RIGHT,alreadyMoved);};HTMLElement.prototype.oDeleteForward=function(offset){const filterFunc=node=>isSelfClosingElement(node)||isVisibleTextNode(node)||isNotEditableNode(node);const firstLeafNode=findNode(rightLeafOnlyNotBlockNotEditablePath(this,offset),filterFunc);if(firstLeafNode&&isZWS(firstLeafNode)&&this.parentElement.hasAttribute('data-oe-zws-empty-inline')){const grandparent=this.parentElement.parentElement;if(!grandparent){return;}
const parentIndex=childNodeIndex(this.parentElement);const restore=prepareUpdate(...boundariesOut(this.parentElement));this.parentElement.remove();restore();HTMLElement.prototype.oDeleteForward.call(grandparent,parentIndex);return;}else if(firstLeafNode&&firstLeafNode.nodeType===Node.TEXT_NODE&&firstLeafNode.textContent==='\ufeff'){firstLeafNode.oDeleteForward(1);return;}
if(this.hasAttribute&&this.hasAttribute('data-oe-zws-empty-inline')&&(isZWS(this)||(this.textContent===''&&this.childNodes.length===0))){const parent=this.parentElement;if(!parent){return;}
const index=childNodeIndex(this);const restore=prepareUpdate(...boundariesOut(this));this.remove();restore();HTMLElement.prototype.oDeleteForward.call(parent,index);return;}
if(firstLeafNode&&(isIconElement(firstLeafNode)||isNotEditableNode(firstLeafNode))){const nextSibling=firstLeafNode.nextSibling;const nextSiblingText=nextSibling?nextSibling.textContent:'';const parentEl=firstLeafNode.parentElement;firstLeafNode.remove();if(isEditorTab(firstLeafNode)&&nextSiblingText[0]==='\u200B'){nextSibling.textContent=nextSiblingText.replace('\u200B','');}
fillEmpty(parentEl);return;}
if(firstLeafNode&&(firstLeafNode.nodeName!=='BR'||getState(...rightPos(firstLeafNode),DIRECTIONS.RIGHT).cType!==CTYPES.BLOCK_INSIDE)){firstLeafNode.oDeleteBackward(Math.min(1,nodeSize(firstLeafNode)));return;}
let nextSibling=this.nextSibling;while(nextSibling&&isWhitespace(nextSibling)){const index=childNodeIndex(nextSibling);const left=getState(nextSibling,index,DIRECTIONS.LEFT).cType;const right=getState(nextSibling,index,DIRECTIONS.RIGHT).cType;if(left===CTYPES.BLOCK_OUTSIDE&&right===CTYPES.BLOCK_OUTSIDE){nextSibling.remove();nextSibling=this.nextSibling;}else{break;}}
if((offset===this.childNodes.length||(this.childNodes.length===1&&this.childNodes[0].tagName==='BR'))&&this.parentElement&&nextSibling&&['LI','UL','OL'].includes(nextSibling.tagName)){const nextSiblingNestedLi=nextSibling.querySelector('li:first-child');if(nextSiblingNestedLi){this.after(nextSiblingNestedLi);if(!isVisible(nextSibling,false)||nextSibling.textContent===''){nextSibling.remove();}
HTMLElement.prototype.oDeleteBackward.call(nextSiblingNestedLi,0,true);}else{HTMLElement.prototype.oDeleteBackward.call(nextSibling,0);}
return;}
if(nextSibling&&nextSibling.nodeType===Node.ELEMENT_NODE&&!nextSibling.isContentEditable){nextSibling.remove();return;}
const parentEl=this.parentElement;if(parentEl&&parentEl.getAttribute("contenteditable")==="true"&&parentEl.oid!=="root"&&parentEl.parentElement&&!parentEl.parentElement.isContentEditable&&paragraphRelatedElements.includes(this.tagName)&&!this.nextElementSibling){throw UNREMOVABLE_ROLLBACK_CODE;}
const firstOutNode=findNode(rightLeafOnlyPathNotBlockNotEditablePath(...(firstLeafNode?rightPos(firstLeafNode):[this,offset]),),filterFunc,);if(firstOutNode){if(nextSibling&&isUnbreakable(nextSibling)&&isEmptyBlock(this)){const restore=prepareUpdate(...boundariesOut(this));this.remove();restore();setSelection(firstOutNode,0);return;}
const[node,offset]=leftPos(firstOutNode);if(node.tagName==='LI'){HTMLElement.prototype.oDeleteBackward.call(node,offset);return;}
node.oDeleteBackward(offset);return;}};return __exports;});;

/* /web_editor/static/src/js/editor/odoo-editor/src/commands/enter.js */
odoo.define('@web_editor/js/editor/odoo-editor/src/commands/enter',['@web_editor/js/editor/odoo-editor/src/utils/constants','@web_editor/js/editor/odoo-editor/src/utils/utils'],function(require){'use strict';let __exports={};const{UNBREAKABLE_ROLLBACK_CODE}=require("@web_editor/js/editor/odoo-editor/src/utils/constants");const{childNodeIndex,fillEmpty,isBlock,isUnbreakable,prepareUpdate,setCursorStart,setCursorEnd,setTagName,splitTextNode,toggleClass,isVisible,descendants,isVisibleTextNode,nodeSize,getTraversedNodes,setSelection,}=require("@web_editor/js/editor/odoo-editor/src/utils/utils");Text.prototype.oEnter=function(offset){this.parentElement.oEnter(splitTextNode(this,offset),true);};HTMLElement.prototype.oEnter=function(offset,firstSplit=true){let didSplit=false;if(isUnbreakable(this)){throw UNBREAKABLE_ROLLBACK_CODE;}
if(!this.textContent&&['BLOCKQUOTE','PRE'].includes(this.parentElement.nodeName)&&!this.nextSibling){const parent=this.parentElement;const index=childNodeIndex(this);if(this.previousElementSibling){this.remove();return parent.oEnter(index,!didSplit);}
return parent.oEnter(index+1,!didSplit);}
let restore;if(firstSplit){restore=prepareUpdate(this,offset);}
let splitEl=this.cloneNode(false);while(offset<this.childNodes.length){splitEl.appendChild(this.childNodes[offset]);}
if(isBlock(this)||splitEl.hasChildNodes()){this.after(splitEl);if(isBlock(splitEl)||isVisible(splitEl)||splitEl.textContent==='\u200B'){didSplit=true;}else{splitEl.remove();}}
if(!isBlock(this)||(this.nodeName!=='LI'&&this.closest('LI'))){if(this.parentElement){this.parentElement.oEnter(childNodeIndex(this)+1,!didSplit);}else{throw UNBREAKABLE_ROLLBACK_CODE;}}
if(firstSplit&&didSplit){restore();let node=this;while(!isBlock(node)&&!isVisible(node)){const toRemove=node;node=node.parentNode;toRemove.remove();}
fillEmpty(node);fillEmpty(splitEl);if(splitEl.tagName==='A'){while(!isBlock(splitEl)&&!isVisible(splitEl)){const toRemove=splitEl;splitEl=splitEl.parentNode;toRemove.remove();}}
setCursorStart(splitEl);}
return splitEl;};HTMLHeadingElement.prototype.oEnter=function(){const newEl=HTMLElement.prototype.oEnter.call(this,...arguments);if(newEl&&!descendants(newEl).some(isVisibleTextNode)){const node=setTagName(newEl,'P');node.replaceChildren(document.createElement('br'));setCursorStart(node);}};const isAtEdgeofLink=(link,offset)=>{const childNodes=[...link.childNodes];let firstVisibleIndex=childNodes.findIndex(isVisible);firstVisibleIndex=firstVisibleIndex===-1?0:firstVisibleIndex;if(offset<=firstVisibleIndex){return'start';}
let lastVisibleIndex=childNodes.reverse().findIndex(isVisible);lastVisibleIndex=lastVisibleIndex===-1?0:childNodes.length-lastVisibleIndex;if(offset>=lastVisibleIndex){return'end';}
return false;}
HTMLAnchorElement.prototype.oEnter=function(offset){const edge=isAtEdgeofLink(this,offset);if(edge==='start'){if(this.previousSibling){return HTMLElement.prototype.oEnter.call(this.previousSibling,nodeSize(this.previousSibling));}else{const index=childNodeIndex(this);return HTMLElement.prototype.oEnter.call(this.parentElement,index?index-1:0);}}else if(edge==='end'){if(this.nextSibling){return HTMLElement.prototype.oEnter.call(this.nextSibling,0);}else{return HTMLElement.prototype.oEnter.call(this.parentElement,childNodeIndex(this));}}else{HTMLElement.prototype.oEnter.call(this,...arguments);}}
HTMLQuoteElement.prototype.oEnter=HTMLHeadingElement.prototype.oEnter;HTMLLIElement.prototype.oEnter=function(){const traverseNodes=getTraversedNodes(this);const isContainUnbreakable=traverseNodes.some(isUnbreakable);if(this.textContent||isContainUnbreakable){const node=HTMLElement.prototype.oEnter.call(this,...arguments);if(node.classList.contains('o_checked')){toggleClass(node,'o_checked');}
return node;}
this.oShiftTab();};HTMLPreElement.prototype.oEnter=function(offset){if(offset<this.childNodes.length){const lineBreak=document.createElement('br');this.insertBefore(lineBreak,this.childNodes[offset]);setCursorEnd(lineBreak);}else{if(this.parentElement.nodeName==='LI'){setSelection(this.parentElement,childNodeIndex(this)+1);HTMLLIElement.prototype.oEnter.call(this.parentElement,...arguments);return;}
const node=document.createElement('p');this.parentNode.insertBefore(node,this.nextSibling);fillEmpty(node);setCursorStart(node);}};return __exports;});;

/* /web_editor/static/src/js/editor/odoo-editor/src/commands/shiftEnter.js */
odoo.define('@web_editor/js/editor/odoo-editor/src/commands/shiftEnter',['@web_editor/js/editor/odoo-editor/src/utils/utils'],function(require){'use strict';let __exports={};const{CTYPES,DIRECTIONS,isFakeLineBreak,prepareUpdate,rightPos,setSelection,getState,leftPos,splitTextNode,isBlock,}=require("@web_editor/js/editor/odoo-editor/src/utils/utils");Text.prototype.oShiftEnter=function(offset){return this.parentElement.oShiftEnter(splitTextNode(this,offset));};HTMLElement.prototype.oShiftEnter=function(offset){const restore=prepareUpdate(this,offset);const brEl=document.createElement('br');const brEls=[brEl];if(offset>=this.childNodes.length){this.appendChild(brEl);}else{this.insertBefore(brEl,this.childNodes[offset]);}
if(isFakeLineBreak(brEl)&&getState(...leftPos(brEl),DIRECTIONS.LEFT).cType!==CTYPES.BR){const brEl2=document.createElement('br');brEl.before(brEl2);brEls.unshift(brEl2);}
restore();for(const el of brEls){if(el.parentNode){setSelection(...rightPos(el));break;}}
return brEls;};HTMLAnchorElement.prototype.oShiftEnter=function(){const brs=HTMLElement.prototype.oShiftEnter.call(this,...arguments);const anchor=brs[0].parentElement;let firstChild=anchor.firstChild;if(firstChild&&firstChild.nodeType===Node.TEXT_NODE&&firstChild.textContent==='\uFEFF'){firstChild=anchor.childNodes[1];}
let lastChild=anchor.lastChild;if(lastChild&&lastChild.nodeType===Node.TEXT_NODE&&lastChild.textContent==='\uFEFF'){lastChild=anchor.childNodes.length>1&&anchor.childNodes[anchor.childNodes.length-2];}
if(brs.includes(firstChild)){brs.forEach(br=>anchor.before(br));}else if(brs.includes(lastChild)){const brToRemove=isBlock(anchor)&&brs.pop();brs.forEach(br=>anchor.after(br));if(brToRemove){brToRemove.remove();setSelection(...leftPos(brs[0]));}else{setSelection(...rightPos(brs[0]));}}}
return __exports;});;

/* /web_editor/static/src/js/editor/odoo-editor/src/commands/shiftTab.js */
odoo.define('@web_editor/js/editor/odoo-editor/src/commands/shiftTab',['@web_editor/js/editor/odoo-editor/src/utils/utils'],function(require){'use strict';let __exports={};const{isUnbreakable,preserveCursor,toggleClass,isBlock,isVisible}=require("@web_editor/js/editor/odoo-editor/src/utils/utils");Text.prototype.oShiftTab=function(){return this.parentElement.oShiftTab(0);};HTMLElement.prototype.oShiftTab=function(offset=undefined){if(!isUnbreakable(this)){return this.parentElement.oShiftTab(offset);}
return false;};HTMLLIElement.prototype.oShiftTab=function(){const li=this;if(li.nextElementSibling){const ul=li.parentElement.cloneNode(false);while(li.nextSibling){ul.append(li.nextSibling);}
if(li.parentNode.parentNode.tagName==='LI'){const lip=document.createElement('li');toggleClass(lip,'oe-nested');lip.append(ul);li.parentNode.parentNode.after(lip);}else{li.parentNode.after(ul);}}
const restoreCursor=preserveCursor(this.ownerDocument);if(li.parentNode.parentNode.tagName==='LI'&&!li.parentNode.parentNode.classList.contains('nav-item')){const ul=li.parentNode;const shouldRemoveParentLi=!li.previousElementSibling&&!ul.previousElementSibling;const toremove=shouldRemoveParentLi?ul.parentNode:null;ul.parentNode.after(li);if(toremove){if(toremove.classList.contains('oe-nested')){toremove.remove();}else{ul.remove();}}
restoreCursor();return li;}else{const ul=li.parentNode;const dir=ul.getAttribute('dir');let p;while(li.firstChild){if(isBlock(li.firstChild)){if(p&&isVisible(p)){ul.after(p);}
p=undefined;ul.after(li.firstChild);}else{p=p||document.createElement('P');if(dir){p.setAttribute('dir',dir);p.style.setProperty('text-align',ul.style.getPropertyValue('text-align'));}
p.append(li.firstChild);}}
if(p&&isVisible(p)){ul.after(p)}
restoreCursor(new Map([[li,ul.nextSibling]]));li.remove();if(!ul.firstElementChild){ul.remove();}}
return false;};return __exports;});;

/* /web_editor/static/src/js/editor/odoo-editor/src/commands/tab.js */
odoo.define('@web_editor/js/editor/odoo-editor/src/commands/tab',['@web_editor/js/editor/odoo-editor/src/utils/utils'],function(require){'use strict';let __exports={};const{createList,getListMode,isBlock,preserveCursor,toggleClass}=require("@web_editor/js/editor/odoo-editor/src/utils/utils");Text.prototype.oTab=function(){return this.parentElement.oTab(0);};HTMLElement.prototype.oTab=function(offset){if(!isBlock(this)){return this.parentElement.oTab(offset);}
return false;};HTMLLIElement.prototype.oTab=function(){const lip=document.createElement('li');const destul=(this.previousElementSibling&&this.previousElementSibling.querySelector('ol, ul'))||(this.nextElementSibling&&this.nextElementSibling.querySelector('ol, ul'))||this.closest('ul, ol');const ul=createList(getListMode(destul));lip.append(ul);const cr=preserveCursor(this.ownerDocument);toggleClass(lip,'oe-nested');this.before(lip);ul.append(this);cr();return true;};return __exports;});;

/* /web_editor/static/src/js/editor/odoo-editor/src/commands/toggleList.js */
odoo.define('@web_editor/js/editor/odoo-editor/src/commands/toggleList',['@web_editor/js/editor/odoo-editor/src/utils/utils'],function(require){'use strict';let __exports={};const{childNodeIndex,isBlock,preserveCursor,insertListAfter,getAdjacents,closestElement,toggleList,}=require("@web_editor/js/editor/odoo-editor/src/utils/utils");Text.prototype.oToggleList=function(offset,mode){if(closestElement(this,'li').classList.contains('nav-item')){const restoreCursor=preserveCursor(this.ownerDocument);insertListAfter(this,mode,[this]);restoreCursor();}else{this.parentElement.oToggleList(childNodeIndex(this),mode);}};HTMLElement.prototype.oToggleList=function(offset,mode='UL'){if(!isBlock(this)){return this.parentElement.oToggleList(childNodeIndex(this));}
const closestLi=this.closest('li');if(closestLi&&!closestLi.classList.contains('nav-item')){return closestLi.oToggleList(0,mode);}
const restoreCursor=preserveCursor(this.ownerDocument);if(this.oid==='root'){const callingNode=this.childNodes[offset];const group=getAdjacents(callingNode,n=>!isBlock(n));insertListAfter(callingNode,mode,[group]);restoreCursor();}else{const list=insertListAfter(this,mode,[this]);if(this.hasAttribute('dir')){list.setAttribute('dir',this.getAttribute('dir'));}
restoreCursor(new Map([[this,list.firstElementChild]]));}};HTMLParagraphElement.prototype.oToggleList=function(offset,mode='UL'){const restoreCursor=preserveCursor(this.ownerDocument);const list=insertListAfter(this,mode,[[...this.childNodes]]);const classList=[...list.classList];for(const attribute of this.attributes){if(attribute.name==='class'&&attribute.value&&list.className){list.className=`${list.className} ${attribute.value}`;}else{list.setAttribute(attribute.name,attribute.value);}}
for(const className of classList){list.classList.toggle(className,true);}
this.remove();restoreCursor(new Map([[this,list.firstChild]]));return true;};HTMLLIElement.prototype.oToggleList=function(offset,mode){const restoreCursor=preserveCursor(this.ownerDocument);toggleList(this,mode,offset);restoreCursor();return false;};HTMLTableCellElement.prototype.oToggleList=function(offset,mode){const restoreCursor=preserveCursor(this.ownerDocument);const callingNode=this.childNodes[offset];const group=getAdjacents(callingNode,n=>!isBlock(n));insertListAfter(callingNode,mode,[group]);restoreCursor();};return __exports;});

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

                    odoo.define("web_editor.wysiwyg_iframe_editor_assets.bundle.xml", ["@web/core/templates"], function(require) {
                        "use strict";
                        const { checkPrimaryTemplateParents, registerTemplate, registerTemplateExtension } = require("@web/core/templates");
                        /* web_editor.wysiwyg_iframe_editor_assets */
                        registerTemplate("web_editor.toolbar", `/web_editor/static/src/xml/editor.xml`, `<t t-name="web_editor.toolbar" xml:space="preserve">
        <div id="toolbar" class="oe-toolbar oe-floating d-print-none">
            <div t-if="props.showStyle" id="style" t-attf-class="btn-group {{ props.dropDirection }}">
                <button type="button" class="btn dropdown-toggle" data-bs-toggle="dropdown" data-bs-original-title="Text style" tabindex="-1" aria-expanded="false">
                    <span title="Text style">Normal</span>
                </button>
                <ul class="dropdown-menu">
                    <li id="display-1-dropdown-item">
                        <a class="dropdown-item" href="#" id="display-1" data-call="setTag" data-arg1="h1,display-1">Header 1 Display 1</a>
                    </li>
                    <li id="display-2-dropdown-item">
                        <a class="dropdown-item" href="#" id="display-2" data-call="setTag" data-arg1="h1,display-2" data-extended-text-style="">Header 1 Display 2</a>
                    </li>
                    <li id="display-3-dropdown-item">
                        <a class="dropdown-item" href="#" id="display-3" data-call="setTag" data-arg1="h1,display-3" data-extended-text-style="">Header 1 Display 3</a>
                    </li>
                    <li id="display-4-dropdown-item">
                        <a class="dropdown-item" href="#" id="display-4" data-call="setTag" data-arg1="h1,display-4" data-extended-text-style="">Header 1 Display 4</a>
                    </li>
                    <li t-if="props.showHeading1" id="heading1-dropdown-item">
                        <a class="dropdown-item" href="#" id="heading1" data-call="setTag" data-arg1="h1">Header 1</a>
                    </li>
                    <li t-if="props.showHeading2" id="heading2-dropdown-item">
                        <a class="dropdown-item" href="#" id="heading2" data-call="setTag" data-arg1="h2">Header 2</a>
                    </li>
                    <li t-if="props.showHeading3" id="heading3-dropdown-item">
                        <a class="dropdown-item" href="#" id="heading3" data-call="setTag" data-arg1="h3">Header 3</a>
                    </li>
                    <li t-if="props.showHeading4" id="heading4-dropdown-item">
                        <a class="dropdown-item" href="#" id="heading4" data-call="setTag" data-arg1="h4">Header 4</a>
                    </li>
                    <li t-if="props.showHeading5" id="heading5-dropdown-item">
                        <a class="dropdown-item" href="#" id="heading5" data-call="setTag" data-arg1="h5">Header 5</a>
                    </li>
                    <li t-if="props.showHeading6" id="heading6-dropdown-item">
                        <a class="dropdown-item" href="#" id="heading6" data-call="setTag" data-arg1="h6">Header 6</a>
                    </li>
                    <li id="paragraph-dropdown-item">
                        <a class="dropdown-item" href="#" id="paragraph" data-call="setTag" data-arg1="p">Normal</a>
                    </li>
                    <li id="light-dropdown-item">
                        <a class="dropdown-item" href="#" id="light" data-call="setTag" data-arg1="p,lead" data-extended-text-style="">Light</a>
                    </li>
                    <li id="small-dropdown-item">
                        <a class="dropdown-item" href="#" id="small" data-call="setTag" data-arg1="p,o_small" data-extended-text-style="">Small</a>
                    </li>
                    <li id="pre-dropdown-item">
                        <a class="dropdown-item" href="#" id="pre" data-call="setTag" data-arg1="pre">Code</a>
                    </li>
                    <li id="blockquote-dropdown-item">
                        <a class="dropdown-item" href="#" id="blockquote" data-call="setTag" data-arg1="blockquote">Quote</a>
                    </li>
                </ul>
            </div>

            <t t-if="this.isSmall()">
                <button type="button" class="btn dropdown-toggle" data-bs-toggle="dropdown" title="Decoration" tabindex="-1" data-bs-original-title="Decoration" data-bs-auto-close="outside" aria-expanded="false">
                    <i class="fa fa-bold"/>
                </button>
                <div class="dropdown-menu">
                    <div id="decoration" class="btn-group">
                        <div id="bold" data-call="bold" title="Toggle bold" class="btn fa fa-bold fa-fw"/>
                        <div id="italic" data-call="italic" title="Toggle italic" class="btn fa fa-italic fa-fw"/>
                        <div id="underline" data-call="underline" title="Toggle underline" class="btn fa fa-underline fa-fw"/>
                        <div id="strikethrough" data-call="strikeThrough" title="Toggle strikethrough" class="btn fa fa-strikethrough fa-fw"/>
                    </div>

                    <div t-if="props.showColors" id="colorInputButtonGroup" class="btn-group">
                        <div class="colorpicker-group note-fore-color-preview" data-name="color" t-ref="textColorpickerDropdown" data-color-type="text">
                            <div id="oe-text-color" class="btn color-button dropdown-toggle editor-ignore" data-bs-toggle="dropdown" tabindex="-1">
                                <i class="fa fa-font color-indicator fore-color" title="Font Color"/>
                            </div>
                            <ul class="dropdown-menu colorpicker-menu">
                                <li><ColorPalette t-props="props.textColorPaletteProps"/></li>
                            </ul>
                        </div>
                        <div class="colorpicker-group note-back-color-preview" data-name="color" t-ref="backgroundColorpaletteDropdown" data-color-type="background">
                            <button id="oe-fore-color" type="button" class="btn dropdown-toggle editor-ignore" data-bs-toggle="dropdown" tabindex="-1">
                                <i class="fa fa-paint-brush color-indicator hilite-color" title="Background Color"/>
                            </button>
                            <ul class="dropdown-menu colorpicker-menu">
                                <li><ColorPalette t-props="props.backgroundColorPaletteProps"/></li>
                            </ul>
                        </div>
                    </div>
                </div>
                <div id="removeFormat" data-call="removeFormat" title="Remove format" class="btn fa fa-eraser fa-fw" t-att-class="{ 'd-none': !props.showRemoveFormat }"/>
            </t>
            <t t-else="">
                <div id="decoration" class="btn-group">
                    <div id="bold" data-call="bold" title="Toggle bold" class="btn fa fa-bold fa-fw"/>
                    <div id="italic" data-call="italic" title="Toggle italic" class="btn fa fa-italic fa-fw"/>
                    <div id="underline" data-call="underline" title="Toggle underline" class="btn fa fa-underline fa-fw"/>
                    <div id="strikethrough" data-call="strikeThrough" title="Toggle strikethrough" class="btn fa fa-strikethrough fa-fw"/>
                    <div id="removeFormat" data-call="removeFormat" title="Remove format" class="btn fa fa-eraser fa-fw" t-att-class="{ 'd-none': !props.showRemoveFormat }"/>
                </div>

                <div t-if="props.showColors" id="colorInputButtonGroup" class="btn-group">
                    <div class="colorpicker-group note-fore-color-preview" data-name="color" t-ref="textColorpickerDropdown" data-color-type="text">
                        <div id="oe-text-color" class="btn color-button dropdown-toggle editor-ignore" data-bs-toggle="dropdown" tabindex="-1">
                            <i class="fa fa-font color-indicator fore-color" title="Font Color"/>
                        </div>
                        <ul class="dropdown-menu colorpicker-menu">
                            <li><ColorPalette t-props="props.textColorPaletteProps"/></li>
                        </ul>
                    </div>
                    <div class="colorpicker-group note-back-color-preview" data-name="color" t-ref="backgroundColorpaletteDropdown" data-color-type="background">
                        <button id="oe-fore-color" type="button" class="btn dropdown-toggle editor-ignore" data-bs-toggle="dropdown" tabindex="-1">
                            <i class="fa fa-paint-brush color-indicator hilite-color" title="Background Color"/>
                        </button>
                        <ul class="dropdown-menu colorpicker-menu">
                            <li><ColorPalette t-props="props.backgroundColorPaletteProps"/></li>
                        </ul>
                    </div>
                </div>

                <div t-if="props.useFontSizeInput or props.showFontSize" id="font-size" t-attf-class="btn-group {{ props.dropDirection }}">
                    <button type="button" class="btn dropdown-toggle" data-bs-toggle="dropdown" tabindex="-1" data-bs-original-title="Font Size" aria-expanded="false">
                        <div id="font-size-input-container">
                            <input type="text" id="fontSizeCurrentValue" title="Font size" value="13" t-att-readonly="props.showFontSize" t-att-class="props.showFontSize ? 'cursor-pointer' : ''"/>
                        </div>
                    </button>
                    <ul class="dropdown-menu">

                        <li><a class="dropdown-item d-flex justify-content-between align-items-center" data-dynamic-value="display-1-font-size" data-apply-class="display-1-fs" href="#">? <span class="d-none o_we_font_size_badge badge rounded-pill text-bg-dark ms-4">Display 1</span></a></li>
                        <li><a class="dropdown-item d-flex justify-content-between align-items-center" data-dynamic-value="display-2-font-size" data-apply-class="display-2-fs" href="#">? <span class="d-none o_we_font_size_badge badge rounded-pill text-bg-dark ms-4">Display 2</span></a></li>
                        <li><a class="dropdown-item d-flex justify-content-between align-items-center" data-dynamic-value="display-3-font-size" data-apply-class="display-3-fs" href="#">? <span class="d-none o_we_font_size_badge badge rounded-pill text-bg-dark ms-4">Display 3</span></a></li>
                        <li><a class="dropdown-item d-flex justify-content-between align-items-center" data-dynamic-value="display-4-font-size" data-apply-class="display-4-fs" href="#">? <span class="d-none o_we_font_size_badge badge rounded-pill text-bg-dark ms-4">Display 4</span></a></li>
                        <li><a class="dropdown-item d-flex justify-content-between align-items-center" data-dynamic-value="h1-font-size" data-apply-class="h1-fs" href="#">? <span class="d-none o_we_font_size_badge badge rounded-pill text-bg-dark ms-4">Heading 1</span></a></li>
                        <li><a class="dropdown-item d-flex justify-content-between align-items-center" data-dynamic-value="h2-font-size" data-apply-class="h2-fs" href="#">? <span class="d-none o_we_font_size_badge badge rounded-pill text-bg-dark ms-4">Heading 2</span></a></li>
                        <li><a class="dropdown-item d-flex justify-content-between align-items-center" data-dynamic-value="h3-font-size" data-apply-class="h3-fs" href="#">? <span class="d-none o_we_font_size_badge badge rounded-pill text-bg-dark ms-4">Heading 3</span></a></li>
                        <li><a class="dropdown-item d-flex justify-content-between align-items-center" data-dynamic-value="h4-font-size" data-apply-class="h4-fs" href="#">? <span class="d-none o_we_font_size_badge badge rounded-pill text-bg-dark ms-4">Heading 4</span></a></li>
                        <li><a class="dropdown-item d-flex justify-content-between align-items-center" data-dynamic-value="h5-font-size" data-apply-class="h5-fs" href="#">? <span class="d-none o_we_font_size_badge badge rounded-pill text-bg-dark ms-4">Heading 5</span></a></li>
                        <li><a class="dropdown-item d-flex justify-content-between align-items-center" data-dynamic-value="h6-font-size" data-apply-class="h6-fs" href="#">? <span class="d-none o_we_font_size_badge badge rounded-pill text-bg-dark ms-4">Heading 6</span></a></li>
                        <li><a class="dropdown-item d-flex justify-content-between align-items-center" data-dynamic-value="font-size-base" data-apply-class="base-fs" href="#">? <span class="d-none o_we_font_size_badge badge rounded-pill text-bg-dark ms-4">Normal</span></a></li>
                        <li><a class="dropdown-item d-flex justify-content-between align-items-center" data-dynamic-value="small-font-size" data-apply-class="o_small-fs" href="#">? <span class="d-none o_we_font_size_badge badge rounded-pill text-bg-dark ms-4">Small</span></a></li>
                    </ul>
                </div>
            </t>

            <div t-if="props.showJustify" id="justify" t-attf-class="btn-group {{ props.dropDirection }}">
                <button type="button" class="btn dropdown-toggle" data-bs-toggle="dropdown" tabindex="-1" data-bs-original-title="Paragraph" aria-expanded="false">
                    <i id="paragraphDropdownButton" class="fa fa-align-left fa-fw" title="Text align"/>
                </button>
                <div class="dropdown-menu">
                    <div class="btn-group">
                        <div class="btn" id="justifyLeft" data-call="justifyLeft"><i class="fa fa-align-left fa-fw"/></div>
                        <div class="btn" id="justifyCenter" data-call="justifyCenter"><i class="fa fa-align-center fa-fw"/></div>
                        <div class="btn" id="justifyRight" data-call="justifyRight"><i class="fa fa-align-right fa-fw"/></div>
                        <div class="btn" id="justifyFull" data-call="justifyFull"><i class="fa fa-align-justify fa-fw"/></div>
                    </div>
                </div>
            </div>

            <t t-if="this.isSmall()">
                <button type="button" class="btn dropdown-toggle" data-bs-toggle="dropdown" title="List" tabindex="-1" data-bs-original-title="List" aria-expanded="false">
                    <i class="fa fa-list fa-fw"/>
                </button>
                <div class="dropdown-menu">
                    <div t-if="props.showList" id="list" class="btn-group">
                        <div id="unordered" data-call="toggleList" data-arg1="UL" title="Toggle unordered list" class="oe-toggle-unordered fa fa-list-ul fa-fw btn"/>
                        <div id="ordered" data-call="toggleList" data-arg1="OL" title="Toggle ordered list" class="oe-toggle-ordered fa fa-list-ol fa-fw btn"/>
                        <div t-if="props.showChecklist" id="checklist" data-call="toggleList" data-arg1="CL" title="Toggle checklist" class="oe-toggle-checklist btn fa fa-fw">
                            <div class="small">
                                <div class="fa fa-square-o d-block small"/>
                                <div class="fa fa-check-square d-block small"/>
                            </div>
                        </div>
                    </div>
                </div>
            </t>
            <t t-else="">
                <div t-if="props.showList" id="list" class="btn-group">
                    <div id="unordered" data-call="toggleList" data-arg1="UL" title="Toggle unordered list" class="oe-toggle-unordered fa fa-list-ul fa-fw btn"/>
                    <div id="ordered" data-call="toggleList" data-arg1="OL" title="Toggle ordered list" class="oe-toggle-ordered fa fa-list-ol fa-fw btn"/>
                    <div t-if="props.showChecklist" id="checklist" data-call="toggleList" data-arg1="CL" title="Toggle checklist" class="oe-toggle-checklist btn fa fa-fw">
                        <div class="small">
                            <div class="fa fa-square-o d-block small"/>
                            <div class="fa fa-check-square d-block small"/>
                        </div>
                    </div>
                </div>
            </t>

            <div id="image-preview" class="btn-group">
                <div id="image-fullscreen" title="Full screen" class="fa fa-search-plus btn editor-ignore"/>
            </div>

            <div t-if="props.showLink" id="link" class="btn-group">
                <div id="media-insert" title="Insert media" class="fa fa-file-image-o fa-fw btn editor-ignore"/>

                <div id="unlink" data-call="unlink" title="Remove link" class="fa fa-unlink fa-fw btn order-1"/>
                <div id="create-link" title="Insert or edit link" class="fa fa-link fa-fw btn editor-ignore"/>
                <a id="media-description" href="#" title="Edit media description" class="btn editor-ignore">Description</a>
            </div>

            <div id="chatgpt" class="btn-group">
                <div id="open-chatgpt" title="Generate or transform content with AI" class="btn editor-ignore">
                    <span class="fa fa-magic fa-fw"/>
                </div>
            </div>
            <div t-if="!state.isPublicUser" id="translate" t-attf-class="btn-group {{ props.dropDirection }}">
                <div t-if="state.languages.length === 1" class="btn lang" title="Translate with AI" t-att-data-value="state.languages[0][1]">
                    Translate
                </div>
                <t t-elif="state.languages.length &gt; 1">
                    <button type="button" class="btn dropdown-toggle" data-bs-toggle="dropdown" data-bs-original-title="Translate with AI" tabindex="-1" aria-expanded="false">
                        <span title="Translate with AI">Translate</span>
                    </button>
                    <ul class="dropdown-menu">
                        <t t-foreach="state.languages" t-as="language" t-key="language[0]">
                            <li><a class="dropdown-item lang" t-att-data-value="language[1]" href="#">to <t t-out="language[1]"/></a></li>
                        </t>
                    </ul>
                </t>
            </div>

            <div t-if="props.showImageShape" id="image-shape" class="btn-group">
                <div id="rounded" title="Shape: Rounded" class="fa fa-square fa-fw btn editor-ignore"/>
                <div id="rounded-circle" title="Shape: Circle" class="fa fa-circle-o fa-fw btn editor-ignore"/>
                <div id="shadow" title="Shadow" class="fa fa-sun-o fa-fw btn editor-ignore"/>
                <div id="img-thumbnail" title="Shape: Thumbnail" class="fa fa-picture-o fa-fw btn editor-ignore"/>
            </div>

            <div t-if="props.showImagePadding" id="image-padding" t-attf-class="btn-group {{ props.dropDirection }}">
                <button type="button" class="btn dropdown-toggle" data-bs-toggle="dropdown" tabindex="-1" aria-expanded="false">
                    <span class="fa fa-plus-square-o" title="Image padding"/>
                </button>
                <ul class="dropdown-menu">
                    <li><a class="dropdown-item editor-ignore" href="#" data-class="">None</a></li>
                    <li><a class="dropdown-item editor-ignore" href="#" data-class="padding-small">Small</a></li>
                    <li><a class="dropdown-item editor-ignore" href="#" data-class="padding-medium">Medium</a></li>
                    <li><a class="dropdown-item editor-ignore" href="#" data-class="padding-large">Large</a></li>
                    <li><a class="dropdown-item editor-ignore" href="#" data-class="padding-xl">XL</a></li>
                </ul>
            </div>

            <div t-if="props.showImageWidth" id="image-width" class="btn-group">
                <div title="Resize Default" class="btn editor-ignore">Default</div>
                <div id="100%" title="Resize Full" class="btn editor-ignore">100%</div>
                <div id="50%" title="Resize Half" class="btn editor-ignore">50%</div>
                <div id="25%" title="Resize Quarter" class="btn editor-ignore">25%</div>
            </div>

            <div t-if="props.showImageEdit" id="image-edit" class="btn-group">
                <div id="image-crop" title="Crop Image" class="btn fa fa-crop editor-ignore"/>
                <div id="image-transform" class="btn editor-ignore fa fa-object-ungroup" title="Transform the picture (click twice to reset transformation)"/>
                <span class="oe-toolbar-separator d-flex"/>
                <div id="media-replace" title="Replace media" class="btn o_we_bg_success editor-ignore">Replace</div>
                <span class="oe-toolbar-separator d-flex"/>
                <div id="image-delete" class="btn btn-link text-danger editor-ignore fa fa-trash" title="Remove (DELETE)"/>
            </div>

            <div id="fa-resize" class="btn-group only_fa">
                <div class="editor-ignore btn" title="Icon size 1x" data-value="1">1x</div>
                <div class="editor-ignore btn" title="Icon size 2x" data-value="2">2x</div>
                <div class="editor-ignore btn" title="Icon size 3x" data-value="3">3x</div>
                <div class="editor-ignore btn" title="Icon size 4x" data-value="4">4x</div>
                <div class="editor-ignore btn" title="Icon size 5x" data-value="5">5x</div>
            </div>

            <div class="btn-group only_fa">
                <div id="fa-spin" title="Toggle icon spin" class="editor-ignore btn fa fa-play"/>
            </div>

            <div t-if="props.showHistory" id="history" class="btn-group">
                <div id="undo" data-call="undo" class="btn fa fa-undo"/>
                <div id="redo" data-call="redo" class="btn fa fa-repeat"/>
            </div>

            <t t-slot="default"/>
        </div>
    </t>




    `);
registerTemplate("web_editor.toolbar.table-options", `/web_editor/static/src/xml/editor.xml`, `<t t-name="web_editor.toolbar.table-options" xml:space="preserve">
        <we-customizeblock-options id="o-we-editor-table-container">
            <we-title>
                <span>Table Options</span>
                <div id="oe-table-delete-table" data-call="deleteTable" class="o_we_hover_danger">
                    <i class="fa fa-trash"/>
                </div>
            </we-title>
            <div id="oe-table-options">
                <div class="oe-table-row">
                    <span class="oe-table-label">Add Column</span>
                    <div class="w-100">
                        <div class="oe-table-selection btn-group w-100">
                            <button class="btn w-50" data-call="addColumn" data-arg1="before">
                                <i class="small fa fa-fw fa-step-backward"/> Left
                            </button>
                            <button class="btn w-50" data-call="addColumn" data-arg1="after">
                                Right <i class="small fa fa-fw fa-step-forward"/>
                            </button>
                        </div>
                    </div>
                </div>
                <div class="oe-table-row">
                    <span class="oe-table-label">Add Row</span>
                    <div class="w-100">
                        <div class="oe-table-selection btn-group w-100">
                            <button class="btn w-50" data-call="addRow" data-arg1="before">
                                <i class="small fa fa-fw fa-step-backward fa-rotate-90"/> Above
                            </button>
                            <button class="btn w-50" data-call="addRow" data-arg1="after">
                                Below <i class="small fa fa-fw fa-step-forward fa-rotate-90"/>
                            </button>
                        </div>
                    </div>
                </div>
                <div class="oe-table-row mt-3">
                    <span class="oe-table-label">Remove Current</span>
                    <div class="w-100">
                        <div class="oe-table-selection btn-group w-100">
                            <button class="btn w-50" data-call="removeColumn">
                                <i class="small fa fa-fw fa-columns"/> Column
                            </button>
                            <button class="btn w-50" data-call="removeRow">
                                <i class="small fa fa-fw fa-bars"/> Row
                            </button>
                        </div>
                    </div>
                </div>
                 <div class="oe-table-row mt-3">
                    <span class="oe-table-label"/>
                    <div class="w-100">
                        <div class="oe-table-selection btn-group w-100">
                            <button class="btn w-50" data-call="resetSize">
                                <i class="small fa fa-fw fa-table"/> Reset Size
                            </button>
                        </div>
                    </div>
                </div>
            </div>
        </we-customizeblock-options>
    </t>






    `);
registerTemplate("web_editor.background_position_overlay", `/web_editor/static/src/xml/editor.xml`, `<t t-name="web_editor.background_position_overlay" xml:space="preserve">
        <div class="o_we_background_position_overlay oe_overlay">
            <div class="o_we_overlay_content position-absolute">
                <div class="o_overlay_background"/>
                <div class="o_we_overlay_buttons position-absolute d-flex m-1" style="top: 0">
                    <button class="btn btn-primary me-1 o_btn_apply">Apply</button>
                    <button class="btn btn-danger o_btn_discard">Discard</button>
                </div>
            </div>
        </div>
    </t>
`);
registerTemplate("web_editor.background_grid", `/web_editor/static/src/xml/grid_layout.xml`, `<t t-name="web_editor.background_grid" xml:space="preserve">
    <div t-attf-style="grid-area: 1 / 1 / #{rowCount} / -1;" class="o_we_background_grid">
        <svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%">
            <defs>
                <pattern id="cell" t-attf-width="#{columnSize + columnGap}px" t-attf-height="#{rowSize + rowGap}px" patternUnits="userSpaceOnUse">
                    <rect class="o_we_cell" x="2" y="2" rx="4" t-attf-width="#{columnSize - 4}px" t-attf-height="#{rowSize - 4}px"/>
                </pattern>
            </defs>

            <rect fill="url(#cell)" width="100%" height="100%"/>
        </svg>
    </div>
</t>

`);
registerTemplate("web_editor.snippet_overlay", `/web_editor/static/src/xml/snippets.xml`, `<t t-name="web_editor.snippet_overlay" xml:space="preserve">
        <div class="oe_overlay o_handlers_idle">
            <div class="o_handles">

                <div class="o_handle o_column_handle o_side o_side_y n readonly"><span class="o_handle_indicator"/></div>
                <div class="o_handle o_column_handle o_side o_side_x e readonly"><span class="o_handle_indicator"/></div>
                <div class="o_handle o_column_handle o_side o_side_x w readonly"><span class="o_handle_indicator"/></div>
                <div class="o_handle o_column_handle o_side o_side_y s readonly"><span class="o_handle_indicator"/></div>


                <div class="o_handle o_grid_handle o_side o_side_y n d-none"><span class="o_handle_indicator"/></div>
                <div class="o_handle o_grid_handle o_side o_side_x e d-none"><span class="o_handle_indicator"/></div>
                <div class="o_handle o_grid_handle o_side o_side_x w d-none"><span class="o_handle_indicator"/></div>
                <div class="o_handle o_grid_handle o_side o_side_y s d-none"><span class="o_handle_indicator"/></div>
                <div class="o_handle o_grid_handle o_corner_handle ne d-none"><span class="o_handle_indicator"/></div>
                <div class="o_handle o_grid_handle o_corner_handle nw d-none"><span class="o_handle_indicator"/></div>
                <div class="o_handle o_grid_handle o_corner_handle se d-none"><span class="o_handle_indicator"/></div>
                <div class="o_handle o_grid_handle o_corner_handle sw d-none"><span class="o_handle_indicator"/></div>

                <div class="o_overlay_options_wrap">

                    <div class="o_overlay_move_options">

                        <div class="o_front_back o_send_back d-none"/>
                        <div class="o_front_back o_bring_front d-none"/>
                        <div class="o_move_handle fa fa-arrows"/>
                    </div>
                    <div class="o_overlay_edit_options">
                        <button class="o_snippet_replace o_we_bg_warning fa fa-exchange d-none"/>
                        <button class="oe_snippet_remove o_we_bg_danger fa fa-trash"/>
                    </div>
                </div>
            </div>
        </div>
    </t>
    `);
registerTemplate("web_editor.customize_block_options_section", `/web_editor/static/src/xml/snippets.xml`, `<t t-name="web_editor.customize_block_options_section" xml:space="preserve">
        <we-customizeblock-options>
            <we-title>
                <span t-esc="name"/>
                <we-top-button-group>
                    <we-button class="fa fa-fw fa-clone oe_snippet_clone o_we_link o_we_hover_success" title="Duplicate Container" aria-label="Duplicate Container"/>
                    <we-button class="fa fa-fw fa-trash oe_snippet_remove o_we_link o_we_hover_danger" title="Remove Block" aria-label="Remove Block"/>
                </we-top-button-group>
            </we-title>
        </we-customizeblock-options>
    </t>
    `);
registerTemplate("web_editor.outdated_block_message", `/web_editor/static/src/xml/snippets.xml`, `<t t-name="web_editor.outdated_block_message" xml:space="preserve">
        <we-alert class="d-flex flex-column p-3 pt-4 align-items-center text-center text-white">
            <we-title>This block is outdated.</we-title>
            <span>You might not be able to customize it anymore.</span>
            <we-button class="o_we_bg_brand_primary py-2 my-4 border-0" data-no-preview="true" data-replace-snippet="">REPLACE BY NEW VERSION</we-button>
            <span>You can still access the block options but it might be ineffective.</span>
            <we-button class="o_we_bg_brand_primary py-2 my-4 border-0" data-no-preview="true" data-discard-alert="">ACCESS OPTIONS ANYWAY</we-button>
        </we-alert>
    </t>


    `);
registerTemplate("web_editor.ColorPalette", `/web_editor/static/src/xml/snippets.xml`, `<div t-name="web_editor.ColorPalette" class="colorpicker" t-ref="el" t-on-click="this._onColorpickerClick" xml:space="preserve">
        <div class="o_we_colorpicker_switch_panel d-flex justify-content-end px-2">
            <t t-set="first_button_name"><t t-if="props.withCombinations">Theme</t><t t-else="">Solid</t></t>
            <button type="button" tabindex="1" class="o_we_colorpicker_switch_pane_btn" t-attf-data-target="#{props.withCombinations ? 'color-combinations' : 'theme-colors'}" t-att-title="first_button_name" t-on-click="this._onSwitchPaneButtonClick">
                <span t-out="first_button_name"/>
            </button>
            <button type="button" tabindex="2" class="o_we_colorpicker_switch_pane_btn" data-target="custom-colors" title="Custom" t-on-click="this._onSwitchPaneButtonClick">
                <span>Custom</span>
            </button>
            <button type="button" tabindex="3" class="o_we_colorpicker_switch_pane_btn" data-target="gradients" title="Gradient" t-on-click="this._onSwitchPaneButtonClick">
                <span>Gradient</span>
            </button>
            <t t-if="props.resetButton">
                <t t-set="trash_title"><t t-if="props.withCombinations">None</t><t t-else="">Reset</t></t>
                <button type="button" class="fa fa-trash my-1 ms-5 py-0 o_we_color_btn o_colorpicker_reset o_we_hover_danger" t-att-title="trash_title"/>
            </t>
        </div>
        <div class="o_colorpicker_sections pt-2 px-2 pb-3" data-color-tab="color-combinations">

            <t t-foreach="[1, 2, 3, 4, 5]" t-as="number" t-key="number">
                <button type="button" class="o_we_color_btn o_we_color_combination_btn" t-att-data-color="number" t-attf-title="Preset #{number}">
                    <t t-call="web_editor.color.combination.preview"/>
                </button>
            </t>
        </div>
        <div class="o_colorpicker_sections py-3 px-2" data-color-tab="theme-colors"/>
        <div class="o_colorpicker_sections py-3 px-2" data-color-tab="custom-colors">
            <div class="o_colorpicker_section_container"/>
            <t t-if="!this.props.excluded.includes('custom')">
                <Colorpicker document="this.props.document" defaultColor="this.state.customDefaultColor" noTransparency="!!this.props.noTransparency" selectedColor="this.state.customSelectedColor" onColorSelect.bind="_onColorPickerSelect" onColorPreview.bind="_onColorPickerPreview" onInputEnter="props.onInputEnter"/>
            </t>
        </div>
        <div class="o_colorpicker_sections py-3 px-2" data-color-tab="gradients">
            <div class="o_colorpicker_section_container"/>
            <t t-if="state.showGradientPicker">
                <Colorpicker document="this.props.document" stopClickPropagation="true" selectedColor="this.state.gradientSelectedColor" onColorSelect.bind="_onColorPickerSelectGradient" onColorPreview.bind="_onColorPickerPreviewGradient" onInputEnter="props.onInputEnter"/>
            </t>
        </div>
    </div>
    `);
registerTemplate("web_editor.color.combination.preview", `/web_editor/static/src/xml/snippets.xml`, `<t t-name="web_editor.color.combination.preview" xml:space="preserve">
        <div class="o_we_cc_preview_wrapper d-flex justify-content-between">
            <h1 class="o_we_color_combination_btn_title">Title</h1>
            <p class="o_we_color_combination_btn_text flex-grow-1">Text</p>
            <span class="o_we_color_combination_btn_btn btn btn-sm btn-primary o_btn_preview me-1"><small>Button</small></span>
            <span class="o_we_color_combination_btn_btn btn btn-sm btn-secondary o_btn_preview"><small>Button</small></span>
        </div>
    </t>
    `);
registerTemplate("web_editor.color.combination.preview.legacy", `/web_editor/static/src/xml/snippets.xml`, `<t t-name="web_editor.color.combination.preview.legacy" xml:space="preserve">
        <div class="o_we_cc_preview_wrapper d-flex justify-content-between">
            <h1 class="o_we_color_combination_btn_title">Title</h1>
            <p class="o_we_color_combination_btn_text flex-grow-1">Text</p>
            <span class="o_we_color_combination_btn_btn btn btn-sm btn-primary o_btn_preview me-1"><small>Button</small></span>
            <span class="o_we_color_combination_btn_btn btn btn-sm btn-secondary o_btn_preview"><small>Button</small></span>
        </div>
    </t>

    `);
registerTemplate("web_editor.SnippetsMenu", `/web_editor/static/src/xml/snippets.xml`, `<t t-name="web_editor.SnippetsMenu" xml:space="preserve">
        <div id="oe_snippets" t-ref="snippets-menu" t-on-mousedown="_onMouseDown">
            <div class="o_we_website_top_actions">
                <div class="o_we_external_history_buttons d-flex">
                    <button type="button" t-on-click="_onUndo" class="btn btn-secondary fa fa-undo" t-att-disabled="!state.canUndo"/>
                    <button type="button" t-on-click="_onRedo" class="btn btn-secondary fa fa-repeat" t-att-disabled="!state.canRedo"/>
                </div>
                <form class="ms-auto d-flex">
                    <button type="button" t-on-click="_onDiscardClick" class="btn btn-secondary" data-action="cancel" title="Tip: Esc to preview" accesskey="j">Discard</button>
                    <button type="button" t-on-click="_onSaveRequest" class="btn btn-primary" data-action="save" accesskey="s">Save</button>
                </form>
            </div>
            <div id="snippets_menu">
                <button type="button" tabindex="1" t-on-click="_onBlocksTabClick" t-att-class="{ 'active': state.currentTab === constructor.tabs.BLOCKS }" class="o_we_add_snippet_btn text-uppercase" accesskey="1">
                    <span>Blocks</span>
                </button>
                <button type="button" tabindex="2" t-on-click="_onOptionsTabClick" t-att-class="{ 'active': state.currentTab === constructor.tabs.OPTIONS }" class="o_we_customize_snippet_btn text-uppercase">
                    <span>Customize</span>
                </button>
            </div>

            <div t-if="!this.hasSnippetGroups" class="o_snippet_search_filter" t-att-class="{ 'd-none': state.currentTab !== constructor.tabs.BLOCKS }">
                <input type="text" class="o_snippet_search_filter_input" t-ref="search-input" t-model="state.search" placeholder="Search for a block (e.g. numbers, image wall, ...)"/>
                <i role="button" class="fa fa-times o_snippet_search_filter_reset" t-att-class="{ 'd-none': state.search === ''}" t-on-click="() =&gt; state.search = ''"/>
            </div>

            <div id="o_scroll" t-ref="snippets-area" t-att-class="{ 'd-none': state.currentTab !== constructor.tabs.BLOCKS }">
                <t t-set="disabledTooltip">This block cannot be dropped anywhere on this page.</t>
                <t t-foreach="getSnippetsByCategories()" t-as="category" t-key="category.id">
                    <div t-att-id="category.id" t-if="category_value.length &gt; 0" class="o_panel">
                        <div class="o_panel_header">
                            <span t-esc="category.text"/>
                        </div>
                        <div t-att-id="category.id === 'snippet_custom' ? 'snippet_custom_body' : ''" class="o_panel_body" t-on-pointerup="_onMouseUp">
                            <t t-foreach="category_value" t-as="snippet" t-key="snippet.key">
                                <div t-if="snippet.visible" class="oe_snippet" t-att-class="{ 'o_disabled': snippet.disabled, 'o_snippet_install': snippet.installable, 'o_we_draggable': !snippet.renaming and !snippet.installable and !snippet.disabled }" t-att-name="snippet.displayName" t-att-data-oe-snippet-id="snippet.id" t-att-data-module-id="snippet.moduleId" t-att-data-module-display-name="snippet.moduleDisplayName" t-on-click="this._onSnippetClick" t-att-data-tooltip="snippet.disabled ? disabledTooltip : false" t-att-data-snippet-group="snippet.snippetGroup" t-att-data-snippet-key="snippet.key">
                                    <t t-if="snippet.disabled">
                                        <img src="/web_editor/static/src/img/snippet_disabled.svg" class="o_snippet_undroppable"/>
                                    </t>
                                    <div class="oe_snippet_thumbnail" t-att-class="{ 'o_we_ongoing_insertion': snippet.renaming }" t-att-data-snippet="snippet.baseBody.dataset.snippet">
                                        <div class="oe_snippet_thumbnail_img" t-attf-style="background-image: url({{snippet.thumbnailSrc}});"/>
                                        <t t-if="snippet.isCustom and snippet.renaming">
                                            <we-input class="o_we_user_value_widget w-100 mx-1">
                                                <div>
                                                    <input type="text" autocomplete="chrome-off" t-att-value="snippet.displayName" class="text-start"/>
                                                    <we-button class="o_we_confirm_btn o_we_text_success fa fa-check" data-tooltip="Confirm" t-on-click="_onConfirmRename"/>
                                                    <we-button class="o_we_cancel_btn o_we_text_danger fa fa-times" data-tooltip="Cancel" t-on-click="() =&gt; snippet.renaming = false"/>
                                                </div>
                                            </we-input>
                                        </t>
                                        <t t-else="">
                                            <span class="oe_snippet_thumbnail_title"><t t-out="snippet.displayName"/></span>
                                        </t>
                                        <t t-if="snippet.installable">
                                            <button class="btn btn-primary o_install_btn w-100" t-on-click="_onInstallBtnClick">Install</button>
                                        </t>
                                    </div>
                                    <t t-if="snippet.isCustom and !snippet.renaming">

                                        <we-button class="o_rename_btn fa fa-pencil btn o_we_hover_success" t-att-data-tooltip="snippet.renameTitle" t-att-data-snippet-key="snippet.key" t-on-click.stop="_onRenameBtnClick" t-on-pointerup.stop=""/>
                                        <we-button class="o_delete_btn fa fa-trash btn o_we_hover_danger" t-att-data-tooltip="snippet.deleteTitle" t-att-data-snippet-key="snippet.key" t-on-click.stop="_onDeleteBtnClick" t-on-pointerup.stop=""/>
                                    </t>
                                </div>
                            </t>
                        </div>
                    </div>
                </t>
            </div>
            <div class="o_we_customize_panel" t-ref="customize-panel" t-att-class="{ 'd-none': state.currentTab === constructor.tabs.BLOCKS }">
                <we-customizeblock-options id="o_we_editor_toolbar_container" t-att-class="{ 'd-none': !state.showToolbar }">
                    <we-title>
                        <span t-out="state.toolbarTitle"/>
                        <div id="removeFormat" data-call="removeFormat" title="Remove format" class="btn fa fa-eraser fa-fw"/>
                    </we-title>
                    <div class="o_we_toolbar_wrapper" t-ref="toolbar-wrapper" style="display: contents;">
                        <Toolbar t-props="options.wysiwyg.state.toolbarProps">
                            <t t-if="options.wysiwyg.state.linkToolProps">
                                <LinkTools t-props="options.wysiwyg.state.linkToolProps"/>
                            </t>
                        </Toolbar>
                    </div>
                </we-customizeblock-options>
                <t t-call="web_editor.toolbar.table-options"/>
            </div>
            <div t-if="state.invisibleElements.length" class="o_we_invisible_el_panel">
                <div class="o_panel_header">
                    Invisible Elements
                </div>
                <t t-foreach="state.invisibleElements" t-as="invisibleEntry" t-key="invisibleEntry_index">
                    <t t-call="web_editor.invisibleSnippetEntry" t-call-context="{'entry': invisibleEntry, 'menu': this}"/>
                </t>
            </div>
        </div>
    </t>

    `);
registerTemplate("web_editor.invisibleSnippetEntry", `/web_editor/static/src/xml/snippets.xml`, `<t t-name="web_editor.invisibleSnippetEntry" xml:space="preserve">
        <div class="o_we_invisible_entry d-flex align-items-center justify-content-between" t-att-class="{'o_we_invisible_root_parent': entry.isRootParent, 'o_we_sublevel_1': entry.isDescendant}" t-on-click="() =&gt; menu.onInvisibleEntryClick(entry)">
            <we-title t-out="entry.name"/>
            <i class="fa ms-2" t-att-class="entry.isVisible ? 'fa-eye' : 'fa-eye-slash'"/>
        </div>
        <ul t-if="entry.children.length &gt; 0">
            <t t-foreach="entry.children" t-as="child" t-key="child_index">
                <li>
                    <t t-call="web_editor.invisibleSnippetEntry" t-call-context="{'entry': child, menu}"/>
                </li>
            </t>
        </ul>
    </t>

`);
registerTemplate("web_editor.Wysiwyg", `/web_editor/static/src/xml/wysiwyg.xml`, `<t t-name="web_editor.Wysiwyg" xml:space="preserve">
        <div style="display: contents;" t-ref="toolbar">
            <Toolbar t-props="this.state.toolbarProps" t-if="this.state.showToolbar"/>
        </div>
        <div style="display: contents;" t-ref="imageCrop">
            <ImageCrop t-props="this.imageCropProps"/>
        </div>
        <div t-ref="el"/>

        <div t-ref="snippets-menu-container">
            <t t-if="this.state.showSnippetsMenu" t-component="this.snippetsMenuComponent" options="this.snippetsMenuOptions" folded="this.state.snippetsMenuFolded" setCSSVariables.bind="this.setCSSVariables" trigger_up="(ev) =&gt; this._trigger_up(ev)" mountedProm="this.state.snippetsMenuMountedProm" bus="this.snippetsMenuBus"/>
        </div>
    </t>






    `);
registerTemplate("web_editor.LinkDialog", `/web_editor/static/src/xml/wysiwyg.xml`, `<div t-name="web_editor.LinkDialog" xml:space="preserve">
        <Dialog size="'xl'" title.translate="Insert a Link / Button">
            <div class="o_link_dialog">
                <div class="row" t-ref="linkComponentWrapper">
                    <form class="col-lg-8">
                        <div t-attf-class="mb-3 row#{props.needLabel ? '' : ' d-none'}">
                            <label class="col-form-label col-md-3" for="o_link_dialog_label_input">Link Label</label>
                            <div class="col-md-9">
                                <input type="text" name="label" class="form-control" id="o_link_dialog_label_input" required="required" t-ref="inputText"/>
                            </div>
                        </div>
                        <div t-attf-class="mb-3 row o_url_input#{state.isButton ? ' d-none' : ''}">
                            <label class="col-form-label col-md-3" for="o_link_dialog_url_input">URL or Email</label>
                            <div class="col-md-9">
                                <input type="text" name="url" class="form-control" id="o_link_dialog_url_input" required="required" t-ref="inputUrl" t-on-keydown="onUrlKeydown"/>
                                <div class="form-check o_strip_domain d-none">
                                    <input type="checkbox" id="o_link_dialog_url_strip_domain" checked="checked" class="form-check-input"/>
                                    <label for="o_link_dialog_url_strip_domain" class="form-check-label fw-normal">
                                        Autoconvert to relative link
                                    </label>
                                </div>
                            </div>
                        </div>
                        <div class="mb-3 row">
                            <label class="col-form-label col-md-3">Style</label>
                            <div class="col-md-9 d-flex align-items-center">
                                <div t-attf-class="#{this.colorCombinationClass ? ('p-2 ' + this.colorCombinationClass) : ''}">
                                    <select name="link_style_color" class="form-select link-style">
                                        <t t-foreach="this.colorsData" t-as="colorData" t-key="colorData.type">
                                            <t t-if="colorData.type !== 'custom'">
                                                <option t-att-value="colorData.type" t-attf-class="o_btn_preview dropdown-item">
                                                    <span t-esc="colorData.label"/>
                                                </option>
                                            </t>
                                        </t>
                                    </select>
                                </div>
                            </div>
                        </div>
                        <div id="o_link_dialog_button_opts_collapse" class="collapse">
                            <div class="mb-3 row">
                                <label class="col-form-label col-md-3">Size</label>
                                <div class="col-md-9">
                                    <select name="link_style_size" class="form-select link-style">
                                        <option value="sm">Small</option>
                                        <option value="" selected="selected">Medium</option>
                                        <option value="lg">Large</option>
                                    </select>
                                </div>
                            </div>
                            <div class="mb-3 row">
                                <label class="col-form-label col-md-3">Layout</label>
                                <div class="col-md-9">
                                    <select name="link_style_shape" class="form-select link-style">
                                        <option value="" selected="selected">Default</option>
                                        <option value="rounded-circle">Default + Rounded</option>
                                        <option value="outline">Outline</option>
                                        <option value="outline,rounded-circle">Outline + Rounded</option>
                                        <option value="fill">Fill</option>
                                        <option value="fill,rounded-circle">Fill + Rounded</option>
                                        <option value="flat">Flat</option>
                                    </select>
                                </div>
                            </div>
                        </div>
                        <div class="mb-3 row" t-if="!state.isButton and !props.forceNewWindow">
                            <div class="offset-md-3 col-md-9">
                                <label class="o_switch">
                                    <input type="checkbox" name="is_new_window" t-att-checked="this.initialNewWindow ? 'checked' : undefined"/>
                                    <span/>
                                    Open in new window
                                </label>
                            </div>
                        </div>
                    </form>
                    <div class="col-lg-4 o_link_dialog_preview">
                        <div class="mb-3 text-center">
                            <label>Preview</label>
                            <div t-attf-class="#{this.colorCombinationClass ? ('p-2 ' + this.colorCombinationClass) : ''}" style="overflow-x: auto; max-width: 100%; max-height: 200px;">
                                <a href="#" id="link-preview" aria-label="Preview" title="Preview"/>
                            </div>
                        </div>
                    </div>
                </div>
                <t t-set-slot="footer">
                    <button class="btn btn-primary" t-on-click="this.onSave" data-hotkey="c">Apply</button>
                    <button class="btn btn-secondary" t-on-click="this.onDiscard" data-hotkey="j">Discard</button>
                </t>
            </div>
        </Dialog>
    </div>

    `);
registerTemplate("web_editor.LinkTools", `/web_editor/static/src/xml/wysiwyg.xml`, `<we-customizeblock-option t-name="web_editor.LinkTools" xml:space="preserve">
        <div style="display: contents" t-ref="linkComponentWrapper">
            <we-row id="url_row" t-attf-class="#{state.isButton ? ' d-none' : ''}">
                <we-input class="o_we_user_value_widget o_we_sublevel_1">
                    <we-title class="o_short_title"/>
                    <div class="o_url_input">
                        <input name="url" id="o_link_dialog_url_input" type="text" placeholder="Your URL"/>
                        <we-button class="o_we_user_value_widget fa fa-upload" t-on-click="this.uploadFile" data-tooltip="Link to an uploaded document"/>
                    </div>
                </we-input>
            </we-row>
            <we-row class="o_strip_domain d-none" t-attf-class="#{state.isButton ? ' d-none' : ''}">
                <we-button class="o_we_user_value_widget o_we_checkbox_wrapper o_we_sublevel_1 active">
                    <we-title class="o_long_title">Autoconvert to Relative Link</we-title>
                        <div class="o_switch">
                            <we-checkbox name="do_strip_domain"/>
                        </div>
                </we-button>
            </we-row>
            <we-row t-attf-class="o_we_sublevel_1 {{props.needLabel ? '' : 'd-none'}}">
                <we-title>Label</we-title>
                <we-input class="o_we_user_value_widget">
                    <div>
                        <input name="label" id="o_link_dialog_label_input" type="text"/>
                    </div>
                </we-input>
            </we-row>
            <we-row>
                <we-select class="o_we_user_value_widget o_we_sublevel_1">
                    <we-title>Style</we-title>
                    <div class="dropdown">
                        <button class="dropdown-toggle" data-bs-toggle="dropdown" tabindex="-1" aria-expanded="false">
                            <we-toggler title="Link Style"/>
                        </button>
                        <we-selection-items class="dropdown-menu" name="link_style_color">
                            <t t-foreach="this.colorsData" t-as="colorData" t-key="colorData.type">
                                <we-button class="dropdown-item" href="#" t-att-data-value="colorData.type">
                                    <t t-esc="colorData.label"/>
                                </we-button>
                            </t>
                        </we-selection-items>
                        <span class="o_we_dropdown_caret"/>
                    </div>
                </we-select>
            </we-row>
            <we-row class="link-custom-color link-custom-color-text" t-att-class="{'d-none': !state.showLinkCustomColor}">
                <we-select title="Color" class="o_we_user_value_widget o_we_so_color_palette o_we_sublevel_2">
                    <we-title>Text Color</we-title>
                    <div class="dropdown">
                        <span data-bs-toggle="dropdown" data-css-property="color" class="o_we_color_preview"/>
                        <we-selection-items class="dropdown-menu" name="link_text_color">
                            <ColorPalette selectedColor="colorpickerProps['color'].selectedColor" excluded="['transparent_grayscale']" document="this.props.wysiwyg.options.document" onSetColorNames="(colorNames) =&gt; this._onColorpaletteSetColorNames('color', colorNames)" onColorHover="(params) =&gt; this._colorpaletteApply('color', params)" onColorLeave="(params) =&gt; this._colorpaletteApply('color', params)" onColorPicked="(params) =&gt; this._onColorpaletteColorPicked('color', params)" onCustomColorPicked="(params) =&gt; this._onColorpaletteColorPicked('color', params)" getTemplate="this.props.getColorpickerTemplate"/>
                        </we-selection-items>
                    </div>
                </we-select>
            </we-row>
            <we-row class="link-custom-color link-custom-color-fill" t-att-class="{'d-none': !state.showLinkCustomColor}">
                <we-select title="Color" class="o_we_user_value_widget o_we_so_color_palette o_we_sublevel_2">
                    <we-title>Fill Color</we-title>
                    <div class="dropdown">
                        <span data-bs-toggle="dropdown" data-css-property="background-color" class="o_we_color_preview"/>
                        <we-selection-items class="dropdown-menu" name="link_fill_color">
                            <ColorPalette selectedColor="colorpickerProps['background-color'].selectedColor" excluded="['transparent_grayscale']" document="this.props.wysiwyg.options.document" withGradients="true" onSetColorNames="(colorNames) =&gt; this._onColorpaletteSetColorNames('background-color', colorNames)" onColorHover="(params) =&gt; this._colorpaletteApply('background-color', params)" onColorLeave="(params) =&gt; this._colorpaletteApply('background-color', params)" onColorPicked="(params) =&gt; this._onColorpaletteColorPicked('background-color', params)" onCustomColorPicked="(params) =&gt; this._onColorpaletteColorPicked('background-color', params)" getTemplate="this.props.getColorpickerTemplate"/>
                        </we-selection-items>
                    </div>
                </we-select>
            </we-row>
            <we-row class="link-custom-color link-custom-color-border o_we_sublevel_2" t-att-class="{'d-none': !state.showLinkCustomColor}">
                <we-title>Border</we-title>
                <div>
                    <we-input class="o_we_user_value_widget" title="Border Width">
                        <div class="o_custom_border_width_input">
                            <input name="custom_border_width" type="number" class="text-end" size="2"/>
                            <span>px</span>
                        </div>
                    </we-input>
                    <we-select class="o_we_user_value_widget" title="Border Style">
                        <div class="dropdown">
                            <button class="dropdown-toggle" data-bs-toggle="dropdown" title="" tabindex="-1" data-bs-original-title="Link Border Style" aria-expanded="false">
                                <we-toggler/>
                            </button>
                            <we-selection-items class="dropdown-menu" name="link_border_style">
                                <we-button title="Solid" class="dropdown-item" data-value="solid"><div class="o_we_fake_img_item o_we_border_preview" style="border-style: solid;"/></we-button>
                                <we-button title="Dashed" class="dropdown-item" data-value="dashed"><div class="o_we_fake_img_item o_we_border_preview" style="border-style: dashed;"/></we-button>
                                <we-button title="Dotted" class="dropdown-item" data-value="dotted"><div class="o_we_fake_img_item o_we_border_preview" style="border-style: dotted;"/></we-button>
                                <we-button title="Double" class="dropdown-item" data-value="double"><div class="o_we_fake_img_item o_we_border_preview" style="border-style: double; border-left: none; border-right: none;"/></we-button>
                            </we-selection-items>
                        </div>
                    </we-select>
                    <we-select title="Border Color" class="o_we_user_value_widget o_we_so_color_palette">
                        <div class="dropdown">
                            <span data-bs-toggle="dropdown" data-css-property="border-color" class="o_we_color_preview"/>
                            <we-selection-items class="dropdown-menu" name="link_border_color">
                                <ColorPalette selectedColor="colorpickerProps['border-color'].selectedColor" excluded="['transparent_grayscale']" document="this.props.wysiwyg.options.document" onSetColorNames="(colorNames) =&gt; this._onColorpaletteSetColorNames('border-color', colorNames)" onColorHover="(params) =&gt; this._colorpaletteApply('border-color', params)" onColorLeave="(params) =&gt; this._colorpaletteApply('border-color', params)" onColorPicked="(params) =&gt; this._onColorpaletteColorPicked('border-color', params)" onCustomColorPicked="(params) =&gt; this._onColorpaletteColorPicked('border-color', params)" getTemplate="this.props.getColorpickerTemplate"/>
                            </we-selection-items>
                        </div>
                    </we-select>
                </div>
            </we-row>
            <we-row class="link-size-row" t-att-class="{'d-none': !state.showLinkSizeRow}">
                <we-select class="o_we_user_value_widget o_we_sublevel_2">
                    <we-title>Size</we-title>
                    <div>
                        <div class="dropdown">
                            <button class="dropdown-toggle" data-bs-toggle="dropdown" title="" tabindex="-1" aria-expanded="false">
                                <we-toggler title="Link Size">
                                    Medium
                                </we-toggler>
                            </button>
                            <we-selection-items name="link_style_size" class="dropdown-menu link-style">
                                <we-button class="dropdown-item" href="#" data-value="sm">
                                    Small
                                </we-button>
                                <we-button class="dropdown-item active" href="#" data-value="">
                                    Medium
                                </we-button>
                                <we-button class="dropdown-item" href="#" data-value="lg">
                                    Large
                                </we-button>
                            </we-selection-items>
                            <span class="o_we_dropdown_caret"/>
                        </div>
                    </div>
                </we-select>
            </we-row>
            <we-row class="link-shape-row" t-att-class="{'d-none': !state.showLinkShapeRow}">
                <we-select class="o_we_user_value_widget o_we_sublevel_2">
                    <we-title>Shape</we-title>
                    <div>
                        <div class="dropdown">
                            <button class="dropdown-toggle" data-bs-toggle="dropdown" tabindex="-1" aria-expanded="false">
                                <we-toggler title="Link Shape">
                                    Default
                                </we-toggler>
                            </button>
                            <we-selection-items name="link_style_shape" class="dropdown-menu link-style">
                                <we-button class="dropdown-item active" data-value="">Default</we-button>
                                <we-button class="dropdown-item" data-value="rounded-circle">Default + Rounded</we-button>
                                <we-button class="dropdown-item" data-value="outline">Outline</we-button>
                                <we-button class="dropdown-item" data-value="outline,rounded-circle">Outline + Rounded</we-button>
                                <we-button class="dropdown-item" data-value="fill">Fill</we-button>
                                <we-button class="dropdown-item" data-value="fill,rounded-circle">Fill + Rounded</we-button>
                                <we-button class="dropdown-item" data-value="flat">Flat</we-button>
                            </we-selection-items>
                        </div>
                    </div>
                </we-select>
            </we-row>
            <we-row t-if="!state.isButton and !props.forceNewWindow and !state.isDocument">
                <we-button t-attf-class="o_we_user_value_widget o_we_checkbox_wrapper o_we_sublevel_1 #{this.initialNewWindow ? 'active' : ''}">
                    <we-title class="o_long_title">Open in New Window</we-title>
                        <div class="o_switch">
                            <we-checkbox name="is_new_window" t-att-checked="this.initialNewWindow ? 'checked' : undefined"/>
                        </div>
                </we-button>
            </we-row>
            <we-row t-if="!state.isButton and state.isDocument">
                <we-button t-attf-class="o_we_user_value_widget o_we_checkbox_wrapper o_we_sublevel_1 #{state.directDownload ? 'active' : ''}">
                    <we-title class="o_long_title">Direct Download</we-title>
                    <div class="o_switch">
                        <we-checkbox name="direct_download" t-att-checked="state.directDownload ? 'checked' : undefined"/>
                    </div>
                </we-button>
            </we-row>
        </div>
    </we-customizeblock-option>


    `);
registerTemplate("web_editor.ImageCrop", `/web_editor/static/src/xml/wysiwyg.xml`, `<div t-name="web_editor.ImageCrop" class="o_we_crop_widget" contenteditable="false" t-att-class="this.state.active ? '' : 'd-none'" t-ref="el" xml:space="preserve">
        <div class="o_we_cropper_wrapper">
            <img class="o_we_cropper_img"/>
            <div class="o_we_crop_buttons text-center mt16 o_we_no_overlay" contenteditable="false">
                <div class="btn-group btn-group-toggle" title="Aspect Ratio" data-bs-toggle="buttons">
                    <t t-foreach="this.aspectRatios" t-as="ratio" t-key="ratio">
                        <t t-set="is_active" t-value="ratio === this.aspectRatio"/>
                        <label t-attf-class="btn #{is_active and 'active' or ''}" data-action="ratio" t-att-data-value="ratio">
                            <input type="radio"/><t t-esc="ratio_value.label"/>
                        </label>
                    </t>
                </div>
                <div class="btn-group" role="group">
                    <button type="button" title="Zoom In" data-action="zoom" data-value="0.1"><i class="fa fa-fw fa-search-plus"/></button>
                    <button type="button" title="Zoom Out" data-action="zoom" data-value="-0.1"><i class="fa fa-fw fa-search-minus"/></button>
                </div>
                <div class="btn-group" role="group">
                    <button type="button" title="Rotate Left" data-action="rotate" data-value="-90"><i class="fa fa-fw fa-rotate-left"/></button>
                    <button type="button" title="Rotate Right" data-action="rotate" data-value="90"><i class="fa fa-fw fa-rotate-right"/></button>
                </div>
                <div class="btn-group" role="group">
                    <button type="button" title="Flip Horizontal" data-action="flip" data-scale-direction="scaleX"><i class="oi oi-fw oi-arrows-h"/></button>
                    <button type="button" title="Flip Vertical" data-action="flip" data-scale-direction="scaleY"><i class="oi oi-fw oi-arrows-v"/></button>
                </div>
                <div class="btn-group" role="group">
                    <button type="button" title="Reset Image" data-action="reset"><i class="fa fa-refresh"/> Reset Image</button>
                </div>
                <div class="btn-group" role="group">
                    <button type="button" title="Apply" data-action="apply" class="btn btn-primary"><i class="fa fa-check"/> Apply</button>
                    <button type="button" title="Discard" data-action="discard" class="btn btn-danger"><i class="fa fa-times"/> Discard</button>
                </div>
            </div>
        </div>
    </div>

`);
registerTemplate("wysiwyg.plugin.font.paletteButton", `/web_editor/static/src/xml/wysiwyg_colorpicker.xml`, `<t t-name="wysiwyg.plugin.font.paletteButton" xml:space="preserve">
        <div t-attf-class="note-btn-group btn-group {{className}}">
            <button type="button" class="note-btn btn btn-light btn-sm dropdown-toggle" tabindex="-1" data-bs-toggle="dropdown"><i t-att-class="icon"/></button>
            <div class="dropdown-menu"/>
        </div>
    </t>

    `);
registerTemplate("wysiwyg.plugin.font.colorPalette", `/web_editor/static/src/xml/wysiwyg_colorpicker.xml`, `<t t-name="wysiwyg.plugin.font.colorPalette" xml:space="preserve">
        <div class="note-palette">
            <button type="button" class="note-color-reset btn btn-light note-color-btn bg-undefined">
                <t t-esc="lang.color.resetToDefault"/></button>
            <div class="note-holder">
                <div class="note-color-palette">
                    <h6 class="mt-2">Theme colors</h6>
                    <div class="o_theme_color_placeholder"/>
                    <h6 class="mt-2">Transparent colors</h6>
                    <div class="o_transparent_color_placeholder"/>
                    <h6 class="mt-2">Common colors</h6>
                    <div class="o_common_color_placeholder">
                        <div class="note-color-row" t-foreach="colors" t-as="rowColors" t-key="rowColors_index">
                            <button t-foreach="rowColors" t-as="color" t-key="color_index" type="button" class="note-color-btn" data-bs-toggle="button" tabindex="-1" t-attf-style="background-color:{{color}}" t-att-data-value="color" t-att-title="color"/>
                        </div>
                    </div>
                </div>
                <h6 class="note-custom-color mt8">
                    <t t-esc="lang.color.customColor"/>
                </h6>
                <button class="note-custom-color-btn note-color-btn" style="display: none;"/>
            </div>
        </div>
    </t>
`);
                    });
