efe12526-ec24-4d2f-b914-7511c0db3d3a.convious.net Open in urlscan Pro
65.9.95.118  Public Scan

URL: https://efe12526-ec24-4d2f-b914-7511c0db3d3a.convious.net/js/v5/latest/txt.min.js?id=efe12526-ec24-4d2f-b914-7511c0db3d3a&domain=www.avonturenpark.nl
Submission: On June 04 via manual from NL — Scanned from NL

Form analysis 0 forms found in the DOM

Text Content

(()=>{var __getOwnPropNames=Object.getOwnPropertyNames;var __esm=(fn,res)=>function(){return fn&&(res=(0,fn[__getOwnPropNames(fn)[0]])(fn=0)),res};var __commonJS=(cb,mod)=>function(){return mod||(0,cb[__getOwnPropNames(cb)[0]])((mod={exports:{}}).exports,mod),mod.exports};function trim(str){return str&&str.trim().replace(/\s{2,}/g," ")}function swap(obj,p1,p2){var tmp=obj[p1];obj[p1]=obj[p2],obj[p2]=tmp}function diffDOM(options){var defaults={debug:!1,diffcap:10,maxDepth:!1,maxChildCount:50,maxChildDiffCount:3,valueDiffing:!0,textDiff:function(){arguments[0].data=arguments[3]},preVirtualDiffApply:function(){},postVirtualDiffApply:function(){},preDiffApply:function(){},postDiffApply:function(){},filterOuterDiff:null,compress:!1},varNames,i,j;typeof options>"u"&&(options={});for(i in defaults)typeof options[i]>"u"?this[i]=defaults[i]:this[i]=options[i];var varNames={addAttribute:"addAttribute",modifyAttribute:"modifyAttribute",removeAttribute:"removeAttribute",modifyTextElement:"modifyTextElement",relocateGroup:"relocateGroup",removeElement:"removeElement",addElement:"addElement",removeTextElement:"removeTextElement",addTextElement:"addTextElement",replaceElement:"replaceElement",modifyValue:"modifyValue",modifyChecked:"modifyChecked",modifySelected:"modifySelected",modifyComment:"modifyComment",action:"action",route:"route",oldValue:"oldValue",newValue:"newValue",element:"element",group:"group",from:"from",to:"to",name:"name",value:"value",data:"data",attributes:"attributes",nodeName:"nodeName",childNodes:"childNodes",checked:"checked",selected:"selected"};if(this.compress){j=0,this._const={};for(i in varNames)this._const[i]=j,j++}else this._const=varNames}var diffcount,foundAll,Diff,elementDescriptors,findUniqueDescriptors,uniqueInBoth,removeDone,isEqual,roughlyEqual,cloneObj,findCommonSubsets,makeArray,getGapInformation,markSubTrees,DiffTracker,init_diffdom=__esm({"clientjs/diffdom.js"(){foundAll=!1,Diff=function(options){var diff=this;if(options){var keys=Object.keys(options),length=keys.length,i;for(i=0;i<length;i++)diff[keys[i]]=options[keys[i]]}};Diff.prototype={toString:function(){return JSON.stringify(this)},setValue:function(aKey,aValue){return this[aKey]=aValue,this}};elementDescriptors=function(el){var output=[];return el.nodeName!=="#text"&&el.nodeName!=="#comment"&&(output.push(el.nodeName),el.attributes&&(el.attributes.class&&output.push(el.nodeName+"."+trim(el.attributes.class).replace(/ /g,".")),el.attributes.id&&output.push(el.nodeName+"#"+el.attributes.id))),output},findUniqueDescriptors=function(li){var uniqueDescriptors={},duplicateDescriptors={},liLength=li.length,nodeLength,node,descriptors,descriptor,inUnique,inDupes,i,j;for(i=0;i<liLength;i++)for(node=li[i],nodeLength=node.length,descriptors=elementDescriptors(node),j=0;j<nodeLength;j++)descriptor=descriptors[j],inUnique=descriptor in uniqueDescriptors,inDupes=descriptor in duplicateDescriptors,!inUnique&&!inDupes?uniqueDescriptors[descriptor]=!0:inUnique&&(delete uniqueDescriptors[descriptor],duplicateDescriptors[descriptor]=!0);return uniqueDescriptors},uniqueInBoth=function(l1,l2){var l1Unique=findUniqueDescriptors(l1),l2Unique=findUniqueDescriptors(l2),inBoth={},keys=Object.keys(l1Unique),length=keys.length,key,i;for(i=0;i<length;i++)key=keys[i],l2Unique[key]&&(inBoth[key]=!0);return inBoth},removeDone=function(tree){return delete tree.outerDone,delete tree.innerDone,delete tree.valueDone,tree.childNodes?tree.childNodes.every(removeDone):!0},isEqual=function(e1,e2){var e1Attributes,e2Attributes;return!(!["nodeName","value","checked","selected","data"].every(function(element){return e1[element]===e2[element]})||!!e1.attributes!=!!e2.attributes||!!e1.childNodes!=!!e2.childNodes||e1.attributes&&(e1Attributes=Object.keys(e1.attributes),e2Attributes=Object.keys(e2.attributes),e1Attributes.length!==e2Attributes.length||!e1Attributes.every(function(attribute){return trim(e1.attributes[attribute])===trim(e2.attributes[attribute])}))||e1.childNodes&&(e1.childNodes.length!==e2.childNodes.length||!e1.childNodes.every(function(childNode,index){return isEqual(childNode,e2.childNodes[index])})))};roughlyEqual=function(e1,e2,uniqueDescriptors,sameSiblings,preventRecursion){var childUniqueDescriptors,nodeList1,nodeList2;if(!e1||!e2||e1.nodeName!==e2.nodeName)return!1;if(e1.nodeName==="#text")return preventRecursion?!0:e1.data===e2.data;if(e1.nodeName in uniqueDescriptors)return!0;if(e1.attributes&&e2.attributes){if(e1.attributes.id){if(e1.attributes.id!==e2.attributes.id)return!1;var idDescriptor=e1.nodeName+"#"+e1.attributes.id;if(idDescriptor in uniqueDescriptors)return!0}if(e1.attributes.class&&trim(e1.attributes.class)===trim(e2.attributes.class)){var classDescriptor=e1.nodeName+"."+trim(e1.attributes.class).replace(/ /g,".");if(classDescriptor in uniqueDescriptors)return!0}}return sameSiblings?!0:(nodeList1=e1.childNodes?e1.childNodes.slice().reverse():[],nodeList2=e2.childNodes?e2.childNodes.slice().reverse():[],nodeList1.length!==nodeList2.length?!1:preventRecursion?nodeList1.every(function(element,index){return element.nodeName===nodeList2[index].nodeName}):(childUniqueDescriptors=uniqueInBoth(nodeList1,nodeList2),nodeList1.every(function(element,index){return roughlyEqual(element,nodeList2[index],childUniqueDescriptors,!0,!0)})))},cloneObj=function(obj){return JSON.parse(JSON.stringify(obj))},findCommonSubsets=function(c1,c2,marked1,marked2){var lcsSize=0,index=[],c1Length=c1.length,c2Length=c2.length,matches=Array.apply(null,new Array(c1Length+1)).map(function(){return[]}),uniqueDescriptors=uniqueInBoth(c1,c2),subsetsSame=c1Length===c2Length,origin,ret,c1Index,c2Index,c1Element,c2Element;for(subsetsSame&&c1.some(function(element,i){var c1Desc=elementDescriptors(element),c2Desc=elementDescriptors(c2[i]);if(c1Desc.length!==c2Desc.length)return subsetsSame=!1,!0;if(c1Desc.some(function(description,i2){if(description!==c2Desc[i2])return subsetsSame=!1,!0}),!subsetsSame)return!0}),c1Index=0;c1Index<c1Length;c1Index++)for(c1Element=c1[c1Index],c2Index=0;c2Index<c2Length;c2Index++)c2Element=c2[c2Index],!marked1[c1Index]&&!marked2[c2Index]&&roughlyEqual(c1Element,c2Element,uniqueDescriptors,subsetsSame)?(matches[c1Index+1][c2Index+1]=matches[c1Index][c2Index]?matches[c1Index][c2Index]+1:1,matches[c1Index+1][c2Index+1]>=lcsSize&&(lcsSize=matches[c1Index+1][c2Index+1],index=[c1Index+1,c2Index+1])):matches[c1Index+1][c2Index+1]=0;return lcsSize===0?!1:{oldValue:index[0]-lcsSize,newValue:index[1]-lcsSize,length:lcsSize}},makeArray=function(n,v){return Array.apply(null,new Array(n)).map(function(){return v})},getGapInformation=function(t1,t2,stable){var gaps1=t1.childNodes?makeArray(t1.childNodes.length,!0):[],gaps2=t2.childNodes?makeArray(t2.childNodes.length,!0):[],group=0,length=stable.length,i,j,endOld,endNew,subset;for(i=0;i<length;i++){for(subset=stable[i],endOld=subset.oldValue+subset.length,endNew=subset.newValue+subset.length,j=subset.oldValue;j<endOld;j+=1)gaps1[j]=group;for(j=subset.newValue;j<endNew;j+=1)gaps2[j]=group;group+=1}return{gaps1,gaps2}},markSubTrees=function(oldTree,newTree){for(var oldChildren=oldTree.childNodes?oldTree.childNodes:[],newChildren=newTree.childNodes?newTree.childNodes:[],marked1=makeArray(oldChildren.length,!1),marked2=makeArray(newChildren.length,!1),subsets=[],subset=!0,returnIndex=function(){return arguments[1]},markBoth=function(i2){marked1[subset.oldValue+i2]=!0,marked2[subset.newValue+i2]=!0},length,subsetArray,i;subset;)if(subset=findCommonSubsets(oldChildren,newChildren,marked1,marked2),subset)for(subsets.push(subset),subsetArray=Array.apply(null,new Array(subset.length)).map(returnIndex),length=subsetArray.length,i=0;i<length;i++)markBoth(subsetArray[i]);return oldTree.subsets=subsets,oldTree.subsetsAge=100,subsets};DiffTracker=function(){this.list=[]};DiffTracker.prototype={list:!1,add:function(diffs){this.list.push.apply(this.list,diffs)},forEach:function(fn){var length=this.list.length,i;for(i=0;i<length;i++)fn(this.list[i])}};diffDOM.Diff=Diff,diffDOM.prototype={diff:function(t1Node,t2Node){var t1=this.nodeToObj(t1Node),t2=this.nodeToObj(t2Node);return diffcount=0,this.debug&&(this.t1Orig=this.nodeToObj(t1Node),this.t2Orig=this.nodeToObj(t2Node)),this.tracker=new DiffTracker,this.findDiffs(t1,t2)},findDiffs:function(t1,t2){var diffs;do{if(this.debug&&(diffcount+=1,diffcount>this.diffcap))throw window.diffError=[this.t1Orig,this.t2Orig],new Error("surpassed diffcap:"+JSON.stringify(this.t1Orig)+" -> "+JSON.stringify(this.t2Orig));diffs=this.findNextDiff(t1,t2,[]),diffs.length===0&&(isEqual(t1,t2)||(foundAll?(console.error("Could not find remaining diffs!"),console.log({t1,t2})):(foundAll=!0,removeDone(t1),diffs=this.findNextDiff(t1,t2,[])))),diffs.length>0&&(foundAll=!1,this.tracker.add(diffs),this.applyVirtual(t1,diffs))}while(diffs.length>0);return this.tracker.list},findNextDiff:function(t1,t2,route){var diffs,fdiffs;if(this.maxDepth&&route.length>this.maxDepth)return[];if(!t1.outerDone){if(diffs=this.findOuterDiff(t1,t2,route),this.filterOuterDiff&&(fdiffs=this.filterOuterDiff(t1,t2,diffs),fdiffs&&(diffs=fdiffs)),diffs.length>0)return t1.outerDone=!0,diffs;t1.outerDone=!0}if(!t1.innerDone){if(diffs=this.findInnerDiff(t1,t2,route),diffs.length>0)return diffs;t1.innerDone=!0}if(this.valueDiffing&&!t1.valueDone){if(diffs=this.findValueDiff(t1,t2,route),diffs.length>0)return t1.valueDone=!0,diffs;t1.valueDone=!0}return[]},findOuterDiff:function(t1,t2,route){var t=this,diffs=[],attr,attr1,attr2,attrLength,pos,i;if(t1.nodeName!==t2.nodeName)return[new Diff().setValue(t._const.action,t._const.replaceElement).setValue(t._const.oldValue,cloneObj(t1)).setValue(t._const.newValue,cloneObj(t2)).setValue(t._const.route,route)];if(route.length&&this.maxChildCount&&t1.childNodes&&t2.childNodes&&t1.childNodes.length>this.maxChildCount&&t2.childNodes.length>this.maxChildCount){for(var childNodesLength=t1.childNodes.length<t2.childNodes.length?t1.childNodes.length:t2.childNodes.length,childDiffCount=0,j=0;childDiffCount<this.maxChildDiffCount&&j<childNodesLength;)isEqual(t1.childNodes[j],t2.childNodes[j])||childDiffCount++,j++;if(childDiffCount===this.maxChildDiffCount)return[new Diff().setValue(t._const.action,t._const.replaceElement).setValue(t._const.oldValue,cloneObj(t1)).setValue(t._const.newValue,cloneObj(t2)).setValue(t._const.route,route)]}if(t1.data!==t2.data)return t1.nodeName==="#text"?[new Diff().setValue(t._const.action,t._const.modifyTextElement).setValue(t._const.route,route).setValue(t._const.oldValue,t1.data).setValue(t._const.newValue,t2.data)]:[new Diff().setValue(t._const.action,t._const.modifyComment).setValue(t._const.route,route).setValue(t._const.oldValue,t1.data).setValue(t._const.newValue,t2.data)];for(attr1=t1.attributes?Object.keys(t1.attributes).sort():[],attr2=t2.attributes?Object.keys(t2.attributes).sort():[],attrLength=attr1.length,i=0;i<attrLength;i++)attr=attr1[i],!(attr.indexOf("data-")===0&&attr.indexOf("data-bg-img")===-1)&&(pos=attr2.indexOf(attr),pos===-1?diffs.push(new Diff().setValue(t._const.action,t._const.removeAttribute).setValue(t._const.route,route).setValue(t._const.name,attr).setValue(t._const.value,t1.attributes[attr])):(attr2.splice(pos,1),trim(t1.attributes[attr])!==trim(t2.attributes[attr])&&(attr!=="value"||attr==="value"&&this.valueDiffing)&&diffs.push(new Diff().setValue(t._const.action,t._const.modifyAttribute).setValue(t._const.route,route).setValue(t._const.name,attr).setValue(t._const.oldValue,t1.attributes[attr]).setValue(t._const.newValue,t2.attributes[attr]))));for(attrLength=attr2.length,i=0;i<attrLength;i++)attr=attr2[i],attr.indexOf("data-")!==0&&(attr!=="value"||attr==="value"&&this.valueDiffing)&&diffs.push(new Diff().setValue(t._const.action,t._const.addAttribute).setValue(t._const.route,route).setValue(t._const.name,attr).setValue(t._const.value,t2.attributes[attr]));return diffs},nodeToObj:function(aNode){var objNode={},dobj=this,nodeArray,childNode,length,attribute,i;if(objNode.nodeName=aNode.nodeName,objNode.nodeName==="#text"||objNode.nodeName==="#comment")objNode.data=aNode.data;else{if(aNode.attributes&&aNode.attributes.length>0)for(objNode.attributes={},nodeArray=Array.prototype.slice.call(aNode.attributes),length=nodeArray.length,i=0;i<length;i++)attribute=nodeArray[i],objNode.attributes[attribute.name]=attribute.value;if(objNode.nodeName==="TEXTAREA")objNode.value=aNode.value;else if(aNode.childNodes&&aNode.childNodes.length>0)for(objNode.childNodes=[],nodeArray=Array.prototype.slice.call(aNode.childNodes),length=nodeArray.length,i=0;i<length;i++)childNode=nodeArray[i],objNode.childNodes.push(dobj.nodeToObj(childNode));this.valueDiffing&&(aNode.checked!==void 0&&aNode.type&&["radio","checkbox"].indexOf(aNode.type.toLowerCase())!==-1?objNode.checked=aNode.checked:aNode.value!==void 0&&(objNode.value=aNode.value),aNode.selected!==void 0&&(objNode.selected=aNode.selected))}return objNode},objToNode:function(objNode,insideSvg){var node,dobj=this,attribute,attributeArray,childNode,childNodeArray,length,i;if(objNode.nodeName==="#text")node=document.createTextNode(objNode.data);else if(objNode.nodeName==="#comment")node=document.createComment(objNode.data);else{if(objNode.nodeName==="svg"||insideSvg?(node=document.createElementNS("http://www.w3.org/2000/svg",objNode.nodeName),insideSvg=!0):node=document.createElement(objNode.nodeName),objNode.attributes)for(attributeArray=Object.keys(objNode.attributes),length=attributeArray.length,i=0;i<length;i++)attribute=attributeArray[i],node.setAttribute(attribute,objNode.attributes[attribute]);if(objNode.childNodes)for(childNodeArray=objNode.childNodes,length=childNodeArray.length,i=0;i<length;i++)childNode=childNodeArray[i],node.appendChild(dobj.objToNode(childNode,insideSvg));this.valueDiffing&&(objNode.value&&(node.value=objNode.value),objNode.checked&&(node.checked=objNode.checked),objNode.selected&&(node.selected=objNode.selected))}return node},findInnerDiff:function(t1,t2,route){var oldSubsets=t1.subsets,subtrees=t1.subsets&&t1.subsetsAge--?t1.subsets:t1.childNodes&&t2.childNodes?markSubTrees(t1,t2):[],t1ChildNodes=t1.childNodes?t1.childNodes:[],t2ChildNodes=t2.childNodes?t2.childNodes:[],childNodesLengthDifference,diffs=[],index=0,t=this,last,e1,e2,i;if(subtrees.length>0&&(diffs=this.attemptGroupRelocation(t1,t2,subtrees,route),diffs.length>0))return diffs;for(last=Math.max(t1ChildNodes.length,t2ChildNodes.length),t1ChildNodes.length!==t2ChildNodes.length&&(childNodesLengthDifference=!0),i=0;i<last;i+=1)e1=t1ChildNodes[i],e2=t2ChildNodes[i],childNodesLengthDifference&&(e1&&!e2?e1.nodeName==="#text"?(diffs.push(new Diff().setValue(t._const.action,t._const.removeTextElement).setValue(t._const.route,route.concat(index)).setValue(t._const.value,e1.data)),index-=1):(diffs.push(new Diff().setValue(t._const.action,t._const.removeElement).setValue(t._const.route,route.concat(index)).setValue(t._const.element,cloneObj(e1))),index-=1):e2&&!e1&&(e2.nodeName==="#text"?diffs.push(new Diff().setValue(t._const.action,t._const.addTextElement).setValue(t._const.route,route.concat(index)).setValue(t._const.value,e2.data)):diffs.push(new Diff().setValue(t._const.action,t._const.addElement).setValue(t._const.route,route.concat(index)).setValue(t._const.element,cloneObj(e2))))),e1&&e2&&(diffs=diffs.concat(this.findNextDiff(e1,e2,route.concat(index)))),index+=1;return t1.innerDone=!0,diffs},attemptGroupRelocation:function(t1,t2,subtrees,route){var t=this,gapInformation=getGapInformation(t1,t2,subtrees),gaps1=gapInformation.gaps1,gaps2=gapInformation.gaps2,shortest=Math.min(gaps1.length,gaps2.length),destinationDifferent,toGroup,group,node,similarNode,testI,diffs=[],index1,index2,j;for(index2=0,index1=0;index2<shortest;index1+=1,index2+=1)if(gaps1[index2]===!0)if(node=t1.childNodes[index1],node.nodeName==="#text"){if(t2.childNodes[index2].nodeName==="#text"&&node.data!==t2.childNodes[index2].data){for(testI=index1;t1.childNodes.length>testI+1&&t1.childNodes[testI+1].nodeName==="#text";)if(testI+=1,t2.childNodes[index2].data===t1.childNodes[testI].data){similarNode=!0;break}if(!similarNode)return diffs.push(new Diff().setValue(t._const.action,t._const.modifyTextElement).setValue(t._const.route,route.concat(index2)).setValue(t._const.oldValue,node.data).setValue(t._const.newValue,t2.childNodes[index2].data)),diffs}diffs.push(new Diff().setValue(t._const.action,t._const.removeTextElement).setValue(t._const.route,route.concat(index2)).setValue(t._const.value,node.data)),gaps1.splice(index2,1),shortest=Math.min(gaps1.length,gaps2.length),index2-=1}else diffs.push(new Diff().setValue(t._const.action,t._const.removeElement).setValue(t._const.route,route.concat(index2)).setValue(t._const.element,cloneObj(node))),gaps1.splice(index2,1),shortest=Math.min(gaps1.length,gaps2.length),index2-=1;else if(gaps2[index2]===!0)node=t2.childNodes[index2],node.nodeName==="#text"?(diffs.push(new Diff().setValue(t._const.action,t._const.addTextElement).setValue(t._const.route,route.concat(index2)).setValue(t._const.value,node.data)),gaps1.splice(index2,0,!0),shortest=Math.min(gaps1.length,gaps2.length),index1-=1):(diffs.push(new Diff().setValue(t._const.action,t._const.addElement).setValue(t._const.route,route.concat(index2)).setValue(t._const.element,cloneObj(node))),gaps1.splice(index2,0,!0),shortest=Math.min(gaps1.length,gaps2.length),index1-=1);else if(gaps1[index2]!==gaps2[index2]){if(diffs.length>0)return diffs;if(group=subtrees[gaps1[index2]],toGroup=Math.min(group.newValue,t1.childNodes.length-group.length),toGroup!==group.oldValue){for(destinationDifferent=!1,j=0;j<group.length;j+=1)roughlyEqual(t1.childNodes[toGroup+j],t1.childNodes[group.oldValue+j],[],!1,!0)||(destinationDifferent=!0);if(destinationDifferent)return[new Diff().setValue(t._const.action,t._const.relocateGroup).setValue("groupLength",group.length).setValue(t._const.from,group.oldValue).setValue(t._const.to,toGroup).setValue(t._const.route,route)]}}return diffs},findValueDiff:function(t1,t2,route){var diffs=[],t=this;return t1.selected!==t2.selected&&diffs.push(new Diff().setValue(t._const.action,t._const.modifySelected).setValue(t._const.oldValue,t1.selected).setValue(t._const.newValue,t2.selected).setValue(t._const.route,route)),(t1.value||t2.value)&&t1.value!==t2.value&&t1.nodeName!=="OPTION"&&diffs.push(new Diff().setValue(t._const.action,t._const.modifyValue).setValue(t._const.oldValue,t1.value).setValue(t._const.newValue,t2.value).setValue(t._const.route,route)),t1.checked!==t2.checked&&diffs.push(new Diff().setValue(t._const.action,t._const.modifyChecked).setValue(t._const.oldValue,t1.checked).setValue(t._const.newValue,t2.checked).setValue(t._const.route,route)),diffs},applyVirtual:function(tree,diffs){var dobj=this,length=diffs.length,diff,i;if(length===0)return!0;for(i=0;i<length;i++)diff=diffs[i],dobj.applyVirtualDiff(tree,diff);return!0},getFromVirtualRoute:function(tree,route){var node=tree,parentNode,nodeIndex;for(route=route.slice();route.length>0;){if(!node.childNodes)return!1;nodeIndex=route.splice(0,1)[0],parentNode=node,node=node.childNodes[nodeIndex]}return{node,parentNode,nodeIndex}},applyVirtualDiff:function(tree,diff){var routeInfo=this.getFromVirtualRoute(tree,diff[this._const.route]),node=routeInfo.node,parentNode=routeInfo.parentNode,nodeIndex=routeInfo.nodeIndex,newSubsets=[],splitLength,newNode,movedNode,nodeArray,route,length,c,i,t=this,info={diff,node};if(this.preVirtualDiffApply(info))return!0;switch(diff[this._const.action]){case this._const.addAttribute:node.attributes||(node.attributes={}),node.attributes[diff[this._const.name]]=diff[this._const.value],diff[this._const.name]==="checked"?node.checked=!0:diff[this._const.name]==="selected"?node.selected=!0:node.nodeName==="INPUT"&&diff[this._const.name]==="value"&&(console.log("text input"),node.value=diff[this._const.value]);break;case this._const.modifyAttribute:node.attributes[diff[this._const.name]]=diff[this._const.newValue],node.nodeName==="INPUT"&&diff[this._const.name]==="value"&&(console.log("text input2"),node.value=diff[this._const.value]);break;case this._const.removeAttribute:delete node.attributes[diff[this._const.name]],Object.keys(node.attributes).length===0&&delete node.attributes,diff[this._const.name]==="checked"?node.checked=!1:diff[this._const.name]==="selected"?delete node.selected:node.nodeName==="INPUT"&&diff[this._const.name]==="value"&&(console.log("text input3"),delete node.value);break;case this._const.modifyTextElement:node.data=diff[this._const.newValue];break;case this._const.modifyValue:node.value=diff[this._const.newValue];break;case this._const.modifyComment:node.data=diff[this._const.newValue];break;case this._const.modifyChecked:node.checked=diff[this._const.newValue];break;case this._const.modifySelected:node.selected=diff[this._const.newValue];break;case this._const.replaceElement:newNode=cloneObj(diff[this._const.newValue]),newNode.outerDone=!0,newNode.innerDone=!0,newNode.valueDone=!0,parentNode.childNodes[nodeIndex]=newNode;break;case this._const.relocateGroup:for(nodeArray=node.childNodes.splice(diff[this._const.from],diff.groupLength).reverse(),length=nodeArray.length,i=0;i<length;i++)movedNode=nodeArray[i],node.childNodes.splice(diff[t._const.to],0,movedNode);node.subsets&&node.subsets.forEach(function(map){diff[t._const.from]<diff[t._const.to]&&map.oldValue<=diff[t._const.to]&&map.oldValue>diff[t._const.from]?(map.oldValue-=diff.groupLength,splitLength=map.oldValue+map.length-diff[t._const.to],splitLength>0&&(newSubsets.push({oldValue:diff[t._const.to]+diff.groupLength,newValue:map.newValue+map.length-splitLength,length:splitLength}),map.length-=splitLength)):diff[t._const.from]>diff[t._const.to]&&map.oldValue>diff[t._const.to]&&map.oldValue<diff[t._const.from]?(map.oldValue+=diff.groupLength,splitLength=map.oldValue+map.length-diff[t._const.to],splitLength>0&&(newSubsets.push({oldValue:diff[t._const.to]+diff.groupLength,newValue:map.newValue+map.length-splitLength,length:splitLength}),map.length-=splitLength)):map.oldValue===diff[t._const.from]&&(map.oldValue=diff[t._const.to])});break;case this._const.removeElement:parentNode.childNodes.splice(nodeIndex,1),parentNode.subsets&&parentNode.subsets.forEach(function(map){map.oldValue>nodeIndex?map.oldValue-=1:map.oldValue===nodeIndex?map.delete=!0:map.oldValue<nodeIndex&&map.oldValue+map.length>nodeIndex&&(map.oldValue+map.length-1===nodeIndex?map.length--:(newSubsets.push({newValue:map.newValue+nodeIndex-map.oldValue,oldValue:nodeIndex,length:map.length-nodeIndex+map.oldValue-1}),map.length=nodeIndex-map.oldValue))}),node=parentNode;break;case this._const.addElement:route=diff[this._const.route].slice(),c=route.splice(route.length-1,1)[0],node=this.getFromVirtualRoute(tree,route).node,newNode=cloneObj(diff[this._const.element]),newNode.outerDone=!0,newNode.innerDone=!0,newNode.valueDone=!0,node.childNodes||(node.childNodes=[]),c>=node.childNodes.length?node.childNodes.push(newNode):node.childNodes.splice(c,0,newNode),node.subsets&&node.subsets.forEach(function(map){map.oldValue>=c?map.oldValue+=1:map.oldValue<c&&map.oldValue+map.length>c&&(splitLength=map.oldValue+map.length-c,newSubsets.push({newValue:map.newValue+map.length-splitLength,oldValue:c+1,length:splitLength}),map.length-=splitLength)});break;case this._const.removeTextElement:parentNode.childNodes.splice(nodeIndex,1),parentNode.nodeName==="TEXTAREA"&&delete parentNode.value,parentNode.subsets&&parentNode.subsets.forEach(function(map){map.oldValue>nodeIndex?map.oldValue-=1:map.oldValue===nodeIndex?map.delete=!0:map.oldValue<nodeIndex&&map.oldValue+map.length>nodeIndex&&(map.oldValue+map.length-1===nodeIndex?map.length--:(newSubsets.push({newValue:map.newValue+nodeIndex-map.oldValue,oldValue:nodeIndex,length:map.length-nodeIndex+map.oldValue-1}),map.length=nodeIndex-map.oldValue))}),node=parentNode;break;case this._const.addTextElement:route=diff[this._const.route].slice(),c=route.splice(route.length-1,1)[0],newNode={},newNode.nodeName="#text",newNode.data=diff[this._const.value],node=this.getFromVirtualRoute(tree,route).node,node.childNodes||(node.childNodes=[]),c>=node.childNodes.length?node.childNodes.push(newNode):node.childNodes.splice(c,0,newNode),node.nodeName==="TEXTAREA"&&(node.value=diff[this._const.newValue]),node.subsets&&node.subsets.forEach(function(map){map.oldValue>=c&&(map.oldValue+=1),map.oldValue<c&&map.oldValue+map.length>c&&(splitLength=map.oldValue+map.length-c,newSubsets.push({newValue:map.newValue+map.length-splitLength,oldValue:c+1,length:splitLength}),map.length-=splitLength)});break;default:console.log("unknown action")}node.subsets&&(node.subsets=node.subsets.filter(function(map){return!map.delete&&map.oldValue!==map.newValue}),newSubsets.length&&(node.subsets=node.subsets.concat(newSubsets))),info.newNode=newNode,this.postVirtualDiffApply(info)},apply:function(tree,diffs){var dobj=this,length=diffs.length,diff,i;if(length===0)return!0;for(i=0;i<length;i++)if(diff=diffs[i],!dobj.applyDiff(tree,diff))return!1;return!0},getFromRoute:function(tree,route){route=route.slice();for(var c,node=tree;route.length>0;){if(!node.childNodes)return!1;c=route.splice(0,1)[0],node=node.childNodes[c]}return node},applyDiff:function(tree,diff){var node=this.getFromRoute(tree,diff[this._const.route]),newNode,reference,route,nodeArray,length,childNode,index,c,t=this,info={diff,node};if(this.preDiffApply(info))return!0;switch(diff[this._const.action]){case this._const.addAttribute:if(!node||!node.setAttribute)return!1;node.setAttribute(diff[this._const.name],diff[this._const.value]);break;case this._const.modifyAttribute:if(!node||!node.setAttribute)return!1;node.setAttribute(diff[this._const.name],diff[this._const.newValue]);break;case this._const.removeAttribute:if(!node||!node.removeAttribute)return!1;node.removeAttribute(diff[this._const.name]);break;case this._const.modifyTextElement:if(!node||node.nodeType!==3)return!1;this.textDiff(node,node.data,diff[this._const.oldValue],diff[this._const.newValue]);break;case this._const.modifyValue:if(!node||typeof node.value>"u")return!1;node.value=diff[this._const.newValue];break;case this._const.modifyComment:if(!node||typeof node.data>"u")return!1;this.textDiff(node,node.data,diff[this._const.oldValue],diff[this._const.newValue]);break;case this._const.modifyChecked:if(!node||typeof node.checked>"u")return!1;node.checked=diff[this._const.newValue];break;case this._const.modifySelected:if(!node||typeof node.selected>"u")return!1;node.selected=diff[this._const.newValue];break;case this._const.replaceElement:node.parentNode.replaceChild(this.objToNode(diff[this._const.newValue],node.namespaceURI==="http://www.w3.org/2000/svg"),node);break;case this._const.relocateGroup:for(nodeArray=Array.apply(null,new Array(diff.groupLength)).map(function(){return node.removeChild(node.childNodes[diff[t._const.from]])}),length=nodeArray.length,index=0;index<length;index++)childNode=nodeArray[index],index===0&&(reference=node.childNodes[diff[t._const.to]]),node.insertBefore(childNode,reference||null);break;case this._const.removeElement:node.parentNode.removeChild(node);break;case this._const.addElement:route=diff[this._const.route].slice(),c=route.splice(route.length-1,1)[0],node=this.getFromRoute(tree,route),node.insertBefore(this.objToNode(diff[this._const.element],node.namespaceURI==="http://www.w3.org/2000/svg"),node.childNodes[c]||null);break;case this._const.removeTextElement:if(!node||node.nodeType!==3)return!1;node.parentNode.removeChild(node);break;case this._const.addTextElement:if(route=diff[this._const.route].slice(),c=route.splice(route.length-1,1)[0],newNode=document.createTextNode(diff[this._const.value]),node=this.getFromRoute(tree,route),!node||!node.childNodes)return!1;node.insertBefore(newNode,node.childNodes[c]||null);break;default:console.log("unknown action")}return info.newNode=newNode,this.postDiffApply(info),!0},undo:function(tree,diffs){var dobj=this,diff,length=diffs.length,i;for(diffs=diffs.slice(),length||(diffs=[diffs]),diffs.reverse(),i=0;i<length;i++)diff=diffs[i],dobj.undoDiff(tree,diff)},undoDiff:function(tree,diff){switch(diff[this._const.action]){case this._const.addAttribute:diff[this._const.action]=this._const.removeAttribute,this.applyDiff(tree,diff);break;case this._const.modifyAttribute:swap(diff,this._const.oldValue,this._const.newValue),this.applyDiff(tree,diff);break;case this._const.removeAttribute:diff[this._const.action]=this._const.addAttribute,this.applyDiff(tree,diff);break;case this._const.modifyTextElement:swap(diff,this._const.oldValue,this._const.newValue),this.applyDiff(tree,diff);break;case this._const.modifyValue:swap(diff,this._const.oldValue,this._const.newValue),this.applyDiff(tree,diff);break;case this._const.modifyComment:swap(diff,this._const.oldValue,this._const.newValue),this.applyDiff(tree,diff);break;case this._const.modifyChecked:swap(diff,this._const.oldValue,this._const.newValue),this.applyDiff(tree,diff);break;case this._const.modifySelected:swap(diff,this._const.oldValue,this._const.newValue),this.applyDiff(tree,diff);break;case this._const.replaceElement:swap(diff,this._const.oldValue,this._const.newValue),this.applyDiff(tree,diff);break;case this._const.relocateGroup:swap(diff,this._const.from,this._const.to),this.applyDiff(tree,diff);break;case this._const.removeElement:diff[this._const.action]=this._const.addElement,this.applyDiff(tree,diff);break;case this._const.addElement:diff[this._const.action]=this._const.removeElement,this.applyDiff(tree,diff);break;case this._const.removeTextElement:diff[this._const.action]=this._const.addTextElement,this.applyDiff(tree,diff);break;case this._const.addTextElement:diff[this._const.action]=this._const.removeTextElement,this.applyDiff(tree,diff);break;default:console.log("unknown action")}}}}});var txtMap,txtFilter,txtFindIndex,txtFind,txtReduce,init_polyfill=__esm({"clientjs/polyfill.js"(){txtMap=function(arr,fun){if(arr==null)throw new TypeError;let t=Object(arr),len=t.length>>>0;if(typeof fun!="function")throw new TypeError;let res=new Array(len),thisArg=arguments.length>=2?arguments[1]:void 0;for(let i=0;i<len;i++)i in t&&(res[i]=fun.call(thisArg,t[i],i,t));return res},txtFilter=function(arr,fn,thisArg){let result=[],test=thisArg===void 0?fn:function(a,b,c){return fn.call(thisArg,a,b,c)},i,len;for(i=0,len=arr.length;i<len;i++)test(arr[i],i,arr)&&(result[result.length]=arr[i]);return result},txtFindIndex=function(arr,fn,thisArg){let test=thisArg===void 0?fn:function(a,b,c){return fn.call(thisArg,a,b,c)},i,len;for(i=0,len=arr.length;i<len;i++)if(test(arr[i],i,arr))return i;return-1},txtFind=function(arr,fn,thisArg){let filtered=txtFilter(arr,fn,thisArg);return filtered&&filtered.length>0?filtered[0]:null},txtReduce=function(arr,callback,initialValue){if(arr==null||typeof callback!="function")return null;var t=Object(arr),len=t.length>>>0,k=0,value;if(initialValue)value=initialValue;else{for(;k<len&&!(k in t);)k++;if(k>=len)return null;value=t[k++]}for(;k<len;k++)k in t&&(value=callback(value,t[k],k,t));return value};typeof Object.assign!="function"&&Object.defineProperty(Object,"assign",{value:function(target,varArgs){"use strict";if(target==null)throw new TypeError("Cannot convert undefined or null to object");for(var to=Object(target),index=1;index<arguments.length;index++){var nextSource=arguments[index];if(nextSource!=null)for(var nextKey in nextSource)Object.prototype.hasOwnProperty.call(nextSource,nextKey)&&(to[nextKey]=nextSource[nextKey])}return to},writable:!0,configurable:!0})}});function getQuerystringValue(param){if(!param||param.length===0)return null;let name=param.replace(/[[]/,"\\[").replace(/[\]]/,"\\]"),results=new RegExp("[\\?&]"+name+"=([^&#]*)","i").exec(decodeURIComponent(window.location.search).replace(/%20/gi," "));return results===null?"":decodeURIComponent(results[1].replace(/\+/gi," "))}function getPropertyCaseInsensitive(obj,key){for(let p in obj)if(obj.hasOwnProperty(p)&&key.toLowerCase()===p.toLowerCase())return obj[p]}function isAdmin(){return!!(getQuerystringValue("txt-edit")==="true"||window.location.hash&&window.location.hash.split("&").find(param=>param==="#edit"||param==="edit"))}function throwEvent(name,detail){try{let event=new CustomEvent(name,{detail});document.dispatchEvent(event)}catch{Txt.log("This browser does not support CustomEvent, not throwing event.")}}function insertInlineStyle(inlineCss,personalizationId2,headDoc){let head=headDoc||document.head||document.getElementsByTagName("head")[0],style=document.createElement("style");style.setAttribute("rel","stylesheet"),style.type="text/css",personalizationId2&&style.setAttribute("data-custom-css",personalizationId2),style.styleSheet?style.styleSheet.cssText=inlineCss:style.appendChild(document.createTextNode(inlineCss)),head.appendChild(style)}function unlessApplyTemplate(tmpl,data2){return!data2||!tmpl?(Txt.log("no data found, returning original template",data2),tmpl):new Function("data","var arr=['"+tmpl.replace(/[\r\t\n]/g,"").split("'").join("\\'").split('"').join('\\"').replace(/{{\s*(.+?)(\|\|(.+?))?\s*}}/gi,"',(data['$1'.trim().toLowerCase()])?data['$1'.trim().toLowerCase()]:'','")+"']; return arr.join('');")(data2)}function fillTemplateProps(txt2,template,props){let regexpResults=template.match(/{{\s*(.+?)\s*}}/g);if(regexpResults&&regexpResults.length>0)for(let result of regexpResults){let resultArr=result.substring(2,result.length-2).split("||"),resultValue=resultArr[0].toLowerCase().trim();if(!props[resultValue]&&(props[resultValue]=getPropertyCaseInsensitive(txt2.queryParams,resultValue)||getQuerystringValue(resultValue),!props[resultValue]&&resultArr.length>1)){let fallbackParam=resultArr[1].trim().replace(/\\"/g,'"').replace(/\\'/g,"'");fallbackParam[0]==='"'||fallbackParam[0]==="'"?props[resultValue]=fallbackParam.substr(1,fallbackParam.length-2):props[resultValue]=getPropertyCaseInsensitive(txt2.queryParams,fallbackParam)||getQuerystringValue(fallbackParam)}}}function runCustomScripts(txt,resource,personalizationId,customHead=null,customWindow=null){let customCss,customPrepareJs,customJs,customTitle,customDocument=customWindow?customWindow.document:null;if(resource&&(resource.i18n&&resource.i18n["custom-css"]?customCss=resource.i18n["custom-css"]:resource.customs&&resource.customs["custom-css"]&&(customCss=resource.customs["custom-css"]),resource.i18n&&resource.i18n["custom-js"]?customJs=resource.i18n["custom-js"]:resource.customs&&resource.customs["custom-js"]&&(customJs=resource.customs["custom-js"]),resource.i18n&&resource.i18n["meta-title"]?customTitle=resource.i18n["meta-title"]:resource.customs&&resource.customs["meta-title"]&&(customTitle=resource.customs["meta-title"]),customPrepareJs=resource.customs["custom-prepare-js"]),customPrepareJs){Txt.log("Executing custom prepare js");try{eval(customPrepareJs)}catch(e){Txt.log("Error executing custom prepare js",e)}}if(customCss){Txt.log("Executing custom stylesheet"),removeExistingCustomCss(personalizationId,customDocument||document);let data2={};fillTemplateProps(txt,customCss,data2),insertInlineStyle(unlessApplyTemplate(customCss,data2),personalizationId,customHead)}if(customJs){Txt.log("Executing custom javascript");try{customWindow&&(customJs=customJs.replace(/window\./g,"customWindow.")),customDocument&&(customJs=customJs.replace(/document\./g,"customDocument.")),txt.scriptHost&&(customJs=customJs.replace(new RegExp(`${txt.id}.unless.com`,"g"),txt.scriptHost));let data={};Txt.log("Filling template props",personalizationId),fillTemplateProps(txt,customJs,data);let templatedCustomJs=unlessApplyTemplate(customJs,data);Txt.log("Executing templated customJs cleaned",personalizationId),eval(templatedCustomJs.replace(/\n/g,"\\n"))}catch(error){Txt.log("Error executing custom script",personalizationId,error);try{Txt.log("Retrying executing customJs without templating",personalizationId),eval(customJs)}catch(e){}}}if(customTitle){Txt.log("Executing custom meta title");let data2={};fillTemplateProps(txt,customTitle,data2),document.title=unlessApplyTemplate(customTitle,data2)}}function cleanupOldCustomCss(personalizationIds){let existingStyles=document.querySelectorAll("[data-custom-css]");for(let existingStyle of existingStyles){let existingPersonalizationId=existingStyle.getAttribute("data-custom-css");personalizationIds.includes(existingPersonalizationId)||removeExistingCustomCss(existingPersonalizationId,document)}}function removeExistingCustomCss(personalizationId2,doc){let existingCustomStyle=doc.querySelector('[data-custom-css="'+personalizationId2+'"]');existingCustomStyle&&existingCustomStyle.parentNode.removeChild(existingCustomStyle)}function runCustomStartupScript(code){try{Txt.log("Executing custom startup script"),eval(code)}catch(e){console.error("Your Unless custom startup script contains an error",e)}}function mergeObjects(obj1,obj2){var obj3={};for(var attrname in obj1)obj3[attrname]=obj1[attrname];for(var attrname in obj2)obj3[attrname]=obj2[attrname];return obj3}function getScrollPercent(){try{let h=document.documentElement,b=document.body,st="scrollTop",sh="scrollHeight";return(h[st]||b[st])/((h[sh]||b[sh])-h.clientHeight)*100}catch{return 0}}function guid(){function s4(){return Math.floor((1+Math.random())*65536).toString(16).substring(1)}return s4()+s4()+"-"+s4()+"-"+s4()+"-"+s4()+"-"+s4()+s4()+s4()}function jsonToUrlEncoded(element,key,list){if(list=list||[],typeof element=="object"&&!Array.isArray(element))for(let idx in element)jsonToUrlEncoded(element[idx],key?key+"["+idx+"]":idx,list);else if(Array.isArray(element))for(let i=0;i<element.length;i++)jsonToUrlEncoded(element[i],key?key+"["+i+"]":i,list);else key&&typeof element<"u"&&list.push(key+"="+encodeURIComponent(element));return list.join("&")}function createCookie(name,value,days){document.cookie=updateCookieString(name,value,days)}function deleteCookie(name){readCookie(name)&&(document.cookie=updateCookieString(name,"",-1))}function updateCookieString(name,value,days=365){let expires="";if(days>0){let date=new Date;date.setTime(date.getTime()+days*24*60*60*1e3),expires="; expires="+date.toUTCString()}else days===-1&&(expires="; Max-Age=-99999999");let domain=extractRootDomain(window.location.hostname);return`${name}=${value}${expires}; domain=${domain!=="localhost"?".":""}${domain}; path=/; SameSite=Lax`}function getSessionItem(itemName){try{return sessionStorage.getItem(itemName)}catch{console.log("session storage is disabled")}}function setSessionItem(itemName,itemValue){try{sessionStorage.setItem(itemName,itemValue)}catch{console.log("session storage is disabled")}}function deleteSessionItem(itemName){try{sessionStorage.removeItem(itemName)}catch{}}function getLocalItem(itemName){try{return localStorage.getItem(itemName)}catch{console.log("local storage is disabled")}}function setLocalItem(itemName,itemValue){try{localStorage.setItem(itemName,itemValue)}catch{console.log("local storage is disabled")}}function deleteLocalItem(itemName){try{localStorage.removeItem(itemName)}catch{}}function extractRootDomain(url){let domain=extractHostname(url),splitArr=domain.split("."),arrLen=splitArr.length;return arrLen>2&&(domain=splitArr[arrLen-2]+"."+splitArr[arrLen-1],splitArr[arrLen-2].length<=3&&splitArr[arrLen-1].length<=2&&(domain=splitArr[arrLen-3]+"."+domain)),domain}function readCookie(name){for(var nameEQ=name+"=",ca=document.cookie.split(";"),i=0;i<ca.length;i++){for(var c=ca[i];c.charAt(0)===" ";)c=c.substring(1,c.length);if(c.indexOf(nameEQ)===0)return c.substring(nameEQ.length,c.length)}return null}function addScript(url,callback){Txt.log("loading script",url);let js,args,rs,s;js=document.createElement("script"),js.src=url,js.type="text/javascript",js.async="true",args=arguments.length>2?Array.prototype.slice.call(arguments,2):[],js.onload=js.onreadystatechange=function(){if(rs=this.readyState,!(rs&&rs!=="complete"&&rs!=="loaded"))try{callback.apply(this,args)}catch{return}},s=document.getElementsByTagName("script")[0],s.parentNode.insertBefore(js,s)}var getViewSize,extractHostname,cleanNode,getPageUrl,isInIframe,matchWildcardPath,normalizeUrl,cssEscape,splitWithIgnoreGroups,pseudoClasses,cssEscapeValue,init_utils=__esm({"clientjs/utils.js"(){init_polyfill();getViewSize=()=>Math.max(document.documentElement.clientWidth,window.innerWidth||0);extractHostname=url=>{let hostname;return url.indexOf("://")>-1?hostname=url.split("/")[2]:hostname=url.split("/")[0],hostname=hostname.split(":")[0],hostname=hostname.split("?")[0],hostname};cleanNode=node=>{for(let n=0;n<node.childNodes.length;n++){let child=node.childNodes[n];if(child.nodeType===8||child.nodeType===3&&!/\S/.test(child.nodeValue))node.removeChild(child),n--;else if(child.nodeType===3){let regExp=/[\r\n]/gi;regExp.test(child.nodeValue)&&(child.nodeValue=child.nodeValue.replace(regExp,""))}else child.nodeType===1&&cleanNode(child)}},getPageUrl=()=>{let path=window.location.pathname,search=window.location.search,searchSplit=search.split("&");return searchSplit=txtFilter(searchSplit,s=>s.indexOf("unless_audiences")===-1),searchSplit.length>0?(search=searchSplit.join("&"),search.length>0&&search[0]!=="?"&&(search="?"+search)):search="",path+search.substring(0,100)},isInIframe=()=>{try{return window.self!==window.top}catch{return!0}},matchWildcardPath=(currentUrl,path)=>{try{if(path.indexOf("^")>-1&&new RegExp(path.substr(path.indexOf("^")),"i").test(getPageUrl())){let normalizedPath=normalizeUrl(path.substr(0,path.indexOf("^")),!0);if(currentUrl.indexOf(normalizedPath)===0)return!0}else if(new RegExp("^"+path.split("*").join(".*")+"$","i").test(currentUrl)){if(currentUrl.indexOf(path.split("*")[0])===0)return!0}else if(new RegExp("^"+path.split("*").join(".*")+"$","i").test(currentUrl+"/")&&(currentUrl+"/").indexOf(path.split("*")[0])===0)return!0}catch(e){console.warn("Encountered an error while parsing this regular expression",currentUrl,path,e)}return!1},normalizeUrl=(url,stripProtocol)=>url?(stripProtocol&&(url=url.replace("http://","").replace("https://","")),url.indexOf("www.")===0&&(url=url.substr(4)),url[url.length-1]==="/"&&(url=url.substr(0,url.length-1)),url.toLowerCase()):"",cssEscape=value=>{let splitAndEscape=(part,separator)=>{let klasses=splitWithIgnoreGroups(part,separator);for(let i=0;i<klasses.length;i++)klasses[i]=cssEscapeValue(klasses[i],separator===".");return klasses.join(separator)},parts=value.split(">");for(let p=0;p<parts.length;p++)parts[p]=splitAndEscape(parts[p],"."),parts[p]=splitAndEscape(parts[p],"#");return parts.join(" > ")},splitWithIgnoreGroups=(value,separator)=>{let parts=[];for(let i=0;i<value.length;i++){if(value[i]==="[")for(;value[i]!=="]"&&i<value.length;)i++;value[i]===separator&&(parts.push(value.substr(0,i)),value=value.substr(i+1),i=0)}return parts.push(value),parts},pseudoClasses=[":link",":visited",":hover",":active",":focus",":target",":lang",":enabled",":disabled",":checked",":root",":nth-child",":nth-last-child",":nth-of-type",":nth-last-of-type",":first-child",":last-child",":first-of-type",":last-of-type",":only-child",":only-of-type",":empty",":not","::first-line","::first-letter","::before","::after"],cssEscapeValue=(value,escapeDot)=>{let string=String(value),length=string.length,index=-1,codeUnit,result="",firstCodeUnit=string.charCodeAt(0);for(;++index<length;){if(codeUnit=string.charCodeAt(index),codeUnit===0){result+="\uFFFD";continue}if(codeUnit>=1&&codeUnit<=31||codeUnit===127||index===0&&codeUnit>=48&&codeUnit<=57||index===1&&codeUnit>=48&&codeUnit<=57&&firstCodeUnit===45){result+="\\"+codeUnit.toString(16)+" ";continue}if(index===0&&length===1&&codeUnit===45){result+="\\"+string.charAt(index);continue}if(codeUnit>=128||codeUnit===45||codeUnit===95||codeUnit>=48&&codeUnit<=57||codeUnit>=65&&codeUnit<=90||codeUnit>=97&&codeUnit<=122){result+=string.charAt(index);continue}if(string.charAt(index-1)!=="\\"&&(string.charAt(index)==="/"||escapeDot&&string.charAt(index)==="."))result+="\\"+string.charAt(index);else if(string.charAt(index-1)!=="\\"&&string.charAt(index)===":"){let found=!1;for(let pseudoClass of pseudoClasses)if(string.substr(index,pseudoClass.length)===pseudoClass){found=!0,result+=string.charAt(index);break}found||(result+="\\"+string.charAt(index))}else string.charAt(index-1)!=="\\"&&string.indexOf("=")===-1&&(string.charAt(index)==="["||string.charAt(index)==="]")?result+="\\"+string.charAt(index):result+=string.charAt(index)}return result}}});function getSessionId(expired=!1){let sessionId=readCookie("unless_sid")||Txt.localSessionId;if(!sessionId||expired){let id=guid();return Txt.mode==="all"&&createCookie("unless_sid",id,0),Txt.localSessionId=id,id}return Txt.localSessionId=sessionId,sessionId}function getSession(){let session2=getSessionItem("unless_session"),expired=!1;if(session2){let parsed=JSON.parse(session2);if(parsed.lastActiveDate+18e5>Date.now())return parsed;expired=!0}return{startDate:Date.now(),sessionId:getSessionId(expired),lastActiveDate:Date.now()}}function deleteSessionData(){deleteLocalItem("unless_stats"),deleteSessionItem("unless_session")}function getLocalStats(){let localStats=getLocalItem("unless_stats");return localStats?JSON.parse(localStats):{sessions:[]}}function saveSession(session2){Txt.mode==="all"&&setSessionItem("unless_session",JSON.stringify(session2))}function saveLocalStats(localStats){Txt.mode==="all"&&setLocalItem("unless_stats",JSON.stringify(localStats))}function updateSessionStats(onPageLoad,onPageUnload){if(!Txt.queryParams)return{};let session2=getSession();session2.lastActiveDate=Date.now(),saveSession(session2);let localStats=getLocalStats(),sessionStats2=txtFind(localStats.sessions,s=>s.sessionId===session2.sessionId);sessionStats2||(sessionStats2={sessionId:session2.sessionId,startDate:Date.now()},localStats.sessions.push(sessionStats2));let sessionIndex=txtFindIndex(localStats.sessions,s=>s.sessionId===session2.sessionId),previousSession=localStats.sessions[sessionIndex-1];return sessionStats2.lastActiveDate=session2.lastActiveDate,sessionStats2.isReturning=localStats.sessions.length>1||Txt.queryParams["behavior.returningVisitor"],sessionStats2.referer=sessionStats2.referer||isExternalReferer(Txt.queryParams["behavior.referer"])||isExternalReferer(document.referrer),sessionStats2.nrOfPersonalizationsSeen=(sessionStats2.nrOfPersonalizationsSeen||0)+Txt.personalizationsSeenIds.length,onPageLoad&&(sessionStats2.nrOfPagesInSession=(sessionStats2.nrOfPagesInSession||0)+1),sessionStats2.timeSincePreviousSession=Math.max(0,sessionStats2.timeSincePreviousSession||(previousSession?sessionStats2.startDate-previousSession.lastActiveDate:0)),sessionStats2.totalSessionDuration=Math.max(0,session2.lastActiveDate-session2.startDate),saveLocalStats(localStats),sessionStats2}var isExternalReferer,init_sessions=__esm({"clientjs/sessions.js"(){init_utils();init_polyfill();isExternalReferer=referer=>{if(!referer)return null;let currentDomain=extractRootDomain(window.location.hostname),refererDomain=extractRootDomain(referer);return currentDomain!==refererDomain?referer:null}}});var require_txt=__commonJS({"clientjs/txt.js"(exports,module){init_diffdom();init_polyfill();init_sessions();init_utils();init_utils();(inTxt=>{var _a,_b;let txt=inTxt,unhidePage=()=>{document.documentElement.style.opacity="",txt&&txt.log&&txt.log("unhiding elements")};if(window.Txt)return console&&(console.log("Another Unless script detected on this page, aborting.."),unhidePage()),window.Txt;window.Txt=txt={},window.unlessComponentCleanUp=[],window.opener&&document.referrer&&window.opener.postMessage({action:"unless-script-installed"},document.referrer);let fullyLoaded=!1,asyncReceivedAudiences=!1,styleInserted=!1,adminLoaded=!1,receivedPersonalizedData=!1,fetchingPersonalizatedData=!1,adminPath="https://unless.com/en/js/5.30.20/edit.min.js",observers=[],customStartupScriptRan=!1,turbolinksRendering=!1,setTxtLocationOptions=()=>{txt&&(txt.url=window.location.href,txt.query=window.location.search,txt.host=window.location.host,txt.origin=window.location.origin,txt.pathname=window.location.pathname)};txt.version="5.30.20",typeof document<"u"&&(txt.snippetVersion=(_a=document.querySelector("[data-unless]"))==null?void 0:_a.getAttribute("data-unless"),txt.snippetInstaller=(_b=document.querySelector("[data-unless]"))==null?void 0:_b.getAttribute("data-installer")),txt.dd=new diffDOM({debug:!1}),txt.currentTime=Date.now(),txt.queryParams={},txt.baseTargetUrl=null,txt.personalizationsLoadedIds=[],txt.personalizationsEligible=[],txt.personalizationsSeenIds=[],txt.personalizationsProcessedIds=[],txt.applyRetryStack=[],txt.visitId=null,txt.websiteId=null,txt.matchedAudiences=[],txt.inAudiences=null,txt.delayedQueue=[],txt.syncGa=!1,txt.syncGTM=!1,txt.consistent=!1,txt.disableTracking=!1,txt.autoObserveElements=!1,txt.disableSPAMode=!1,txt.excludeIframes=!1,txt.autoTrackingWhitelist=!1,txt.customStartupScript=null,txt.profileData=null,txt.scrollPercentage=0,txt.gaEventQueue=[],txt.gtmEventQueue=[],setTxtLocationOptions(),console&&console.log(`Loading Unless.com v${txt.version}`),txt.isInEditor=isAdmin,txt.refresh=txt.render=options=>{txt.log("txt refresh"),txt.clear(options),initiate(options)},txt.clear=options=>{if(txt.log("txt clear"),options!=null&&options.evaluate){if(setTxtLocationOptions(),receivedPersonalizedData=!1,fetchingPersonalizatedData=!1,fullyLoaded=!1,txt.currentTime=Date.now(),options.resetPersonalizations){txt.delayedQueue=[],txt.personalizationsLoadedIds=[],txt.personalizationsEligible=[],txt.personalizationsSeenIds=[],txt.personalizationsProcessedIds=[],asyncReceivedAudiences=!1,customStartupScriptRan=!1,txt.visitId=null;for(let el of document.querySelectorAll("[data-txt-rendered]"))el.removeAttribute("data-txt-rendered");resetObservers();for(let f of Object.values(window.unlessComponentCleanUp||[]))f&&f(!0)}txt.baseTargetUrl=null;for(let rs of txt.applyRetryStack)clearTimeout(rs);txt.applyRetryStack=[]}},txt.log=(...args)=>{if((txt.debug||isPreviewing())&&console){let date=new Date;args[0]=`TXT (${`0${date.getHours()}`.slice(-2)}:${`0${date.getMinutes()}`.slice(-2)}:${`0${date.getSeconds()}`.slice(-2)}:${`0${date.getMilliseconds()}`.slice(-3)}): ${args[0]}`,console.log.apply(console,args)}},txt.loadAdmin=()=>{if(document.readyState==="complete"){if(!adminLoaded){adminLoaded=!0;let callback=()=>{txt.log("activating edit-js"),window.TxtEdit.activate()};txt.log("loading edit-js"),addScript(adminPath.replace("unless.com",`${txt.id}.unless.com`),callback)}}else txt.log("loading admin after doc is ready"),setTimeout(txt.loadAdmin,500)},txt.withOptions=txt.setOptions=options=>(txt.id=options.id||txt.id,txt.baseTargetUrl=options.baseTargetUrl||txt.baseTargetUrl||null,txt.debug=options.debug||txt.debug||!1,txt.refid=options.refid||txt.refid,txt.personalizedPages=options.personalizedPages||txt.personalizedPages||[],txt.sendCookies=options.sendCookies||txt.sendCookies||[],txt.query=options.query||txt.query,txt.pathname=options.pathname||txt.pathname,txt.syncGa=options.syncGa||txt.syncGa,txt.syncGTM=options.syncGTM||txt.syncGTM,txt.disableTracking=options.disableTracking||txt.disableTracking,txt.autoObserveElements=options.autoObserveElements||txt.autoObserveElements,txt.disableSPAMode=options.disableSPAMode||txt.disableSPAMode,txt.excludeIframes=options.excludeIframes||txt.excludeIframes,txt.autoTrackingWhitelist=options.autoTrackingWhitelist||txt.autoTrackingWhitelist,txt.customStartupScript=options.customStartupScript||txt.customStartupScript,txt.defaultMode=txt.defaultMode||options.mode,txt.scriptHost=txt.scriptHost||options.scriptHost,txt.customIdentifier=txt.customIdentifier||options.customIdentifier,txt.snippetVersion=txt.snippetVersion||options.snippetVersion||"unknown",txt.snippetInstaller=txt.snippetInstaller||options.snippetInstaller||"unknown",txt.host=options.host||txt.host,txt.url=options.url||txt.url,txt.origin=options.origin||txt.origin,options.host&&(txt.url=txt.url.replace(window.location.host,options.host),txt.original=txt.origin.replace(window.location.origin,options.host)),readCookie("unless_opt_out")?txt.mode=readCookie("unless_opt_out"):readCookie("unless_id")?txt.mode="all":txt.mode=options.mode||txt.mode||"all",console&&txt.mode!=="all"&&console.log("Until consent, UNLESS does not store cookies or any other session data."),getQuerystringValue("debug")==="true"&&(txt.debug=!0),!styleInserted&&document.readyState==="loading"&&hidePage(),txt);let hidePage=()=>{document.currentScript instanceof HTMLScriptElement&&!document.currentScript.async&&(txt.log("hiding elements"),document.documentElement.style.opacity="0",setTimeout(()=>{document.documentElement.style.opacity!==""&&!isAdmin()&&(txt.log("set visibility by timeout"),unhidePage())},3e3),styleInserted=!0)},getDiffList=(selector,diffs)=>{if(Array.isArray(diffs)){let foundList=txtFilter(diffs,x=>x.selector===selector&&!x.failed);return foundList.length>0?foundList.reduce((a,c)=>({diffs:a.diffs.concat(c.diffs)})).diffs:[]}else return diffs[selector]};txt.applyDiffs=(disableTemplate=!1,rootElement=null)=>{if(turbolinksRendering)Txt.log("Turbolinks rendering, waiting to apply diffs...");else{let targetElement=rootElement||document.body;for(let personalization2 of txt.personalizationsEligible){if(personalization2.variation==="control-group"||txt.personalizationsProcessedIds.includes(personalization2.variationId)){txt.personalizationsProcessedIds.includes(personalization2.variationId)||(txt.log("adding to processed ids control group?",personalization2.variationId),txt.personalizationsProcessedIds.push(personalization2.variationId));continue}txt.log("adding to processed ids",personalization2.variation),txt.personalizationsProcessedIds.push(personalization2.variation),txt.personalizationsSeenIds.push(personalization2.variation);let diffs=(personalization2==null?void 0:personalization2.diffs)||null;if(diffs&&targetElement){let selectors=[];Array.isArray(diffs)?selectors=txtMap(diffs,x=>x.selector):selectors=Object.keys(diffs);for(let selector of selectors){let diffList=getDiffList(selector,diffs);if(!diffList||diffList.length===0)continue;let didApply=!1;try{applySelector(targetElement,selector,disableTemplate,diffList,didApply,diffs,0,personalization2.variation)}catch(e){txt.log("diff failed exception",e)}}}}}done()};let getAppliedPersonalizationId=(elm,personalizationId2)=>{let appliedPersonalizationId=null,renderedNodes=document.querySelectorAll("[data-txt-rendered]");for(let renderedNode of renderedNodes){let renderedPersonalizationId=renderedNode.getAttribute("data-txt-rendered");if(renderedPersonalizationId!==personalizationId2){let parent=renderedNode;for(;parent&&!appliedPersonalizationId;)parent===elm&&(appliedPersonalizationId=renderedPersonalizationId),parent=parent.parentElement;for(parent=elm;parent&&!appliedPersonalizationId;)parent===renderedNode&&(appliedPersonalizationId=renderedPersonalizationId),parent=parent.parentElement;if(appliedPersonalizationId)break}}return appliedPersonalizationId},applySelector=(targetElement,selector,disableTemplate,diffList,didApply,diffs,timeoutId,personalizationId2)=>{timeoutId&&txt.applyRetryStack.indexOf(timeoutId)>-1&&txt.applyRetryStack.splice(txt.applyRetryStack.indexOf(timeoutId),1);let elm=targetElement.querySelector(cssEscape(selector));if(!elm){let toId=setTimeout(()=>applySelector(document.body,selector,disableTemplate,diffList,didApply,diffs,toId,personalizationId2),250);txt.applyRetryStack.push(toId);return}if(getAppliedPersonalizationId(elm,personalizationId2)){txt.log("skipped diff, selector (child or parent) already personalized by other personalization");return}let parsedDiffList=null;if(!disableTemplate){let props=[],tpl=JSON.stringify(diffList);fillTemplateProps(txt,tpl,props);try{parsedDiffList=JSON.parse(unlessApplyTemplate(tpl,props))}catch(e){txt.log(`Skipping templating, failed to parse json:
${e}
TPL: ${tpl}
PROPS: ${props}`)}}for(let diff of parsedDiffList||diffList)applyDiff(targetElement,diff,selector,personalizationId2)},applyDiff=(targetElement,diff,selector,personalizationId2)=>{try{let elm=targetElement.querySelector(cssEscape(selector));cleanNode(elm),txt.dd.apply(elm,[diff])?(txt.log(`diff applied: ${selector}`,diff),elm.setAttribute("data-txt-rendered",personalizationId2),isAdmin()||observe(elm,targetElement,diff,selector,personalizationId2)):(txt.log(`diff failed: ${selector}`,diff),diff.failed=!0)}catch{console.error("error applying diff",diff),diff.failed=!0}},observerMap={},observe=(elm,targetElement,diff,selector,personalizationId2)=>{if(txt.autoObserveElements&&!observerMap[elm]){observerMap[elm]=!0;let observer=new MutationObserver(mutations=>{for(let _ of mutations)txt.log("data-txt-rendered change observed, re-apply diff"),applyDiff(targetElement,diff,selector,personalizationId2);observer.disconnect()});observer.observe(elm,{attributes:!1,childList:!0,subtree:!0,characterData:!0}),observers.push(observer)}},resetObservers=()=>{for(;observers.length>0;)observers.shift().disconnect()};txt.getVariationIdForEditing=()=>{let variationIdForEditing2=getQuerystringValue("unless_experience").split("_")[0];if(!variationIdForEditing2&&window.location.hash.includes("unless_experience"))for(let param of window.location.hash.split("&"))param.includes("unless_experience")&&(variationIdForEditing2=param.split("=")[1].split("_")[0]);return variationIdForEditing2};let getExperiences=({personalizationId,componentPackageName,forceShow}={})=>{let refid=[],variationIdForEditing=txt.getVariationIdForEditing();if(txt.excludeIframes&&isInIframe()){txt.log("set visibility because script is running inside iframe."),unhidePage(),done();return}if(!receivedPersonalizedData&&!fetchingPersonalizatedData){if(!variationIdForEditing){let currentPageUrl=normalizeUrl(txt.host+decodeURIComponent(txt.pathname));isPreviewing()&&refid.push(txt.origin+txt.pathname);let asyncOnly=!0;for(let personalizedPage of txt.personalizedPages){let url=personalizedPage.url,personalizedPageAsyncOnly=personalizedPage.asyncOnly,pageUrl=normalizeUrl(url,!0);(pageUrl.indexOf("*")>-1||pageUrl.indexOf("^")>-1)&&matchWildcardPath(currentPageUrl,pageUrl)?(!personalizedPage.draft||isPreviewing())&&(txt.log("found matching wildcard page url",pageUrl,url),refid.push(url),asyncOnly=asyncOnly&&personalizedPageAsyncOnly):currentPageUrl===pageUrl.split("?")[0]&&(!personalizedPage.draft||isPreviewing())&&(txt.log("found matching page url",pageUrl,url),refid.push(url),asyncOnly=asyncOnly&&personalizedPageAsyncOnly)}refid.length>0&&asyncOnly&&(txt.log("set visibility because only async experiences detected on the page."),unhidePage())}if(txt.matchedPersonalizedUrls=refid,txt.refid&&(refid=txt.refid),!refid||refid.length===0||variationIdForEditing)receivedPersonalizedData=!0,done();else{txt.log("fetching personalizations"),fetchingPersonalizatedData=!0;let onGetPersonalizedData=data=>{if(txt.log("received personalizations",data),receivedPersonalizedData=!0,txt.queryParams=data.queryParams?mergeObjects(txt.queryParams,data.queryParams):txt.queryParams,txt.baseTargetUrl=data.baseTargetUrl,txt.visitId=txt.visitId||data.visitId,txt.websiteId=txt.websiteId||data.websiteId,data.visitorId&&createCookie("unless_id",data.visitorId,365),data.personalizations&&data.personalizations.length>0){txt.personalizationsLoadedIds=data.personalizations.map(p=>p.variationId);for(let personalization of data.personalizations){if(personalization.redirectUrl&&personalization.redirectUrl.length>0){txt.log("executing redirect url",personalization.redirectUrl),setSessionItem("unless-redirect-experience",JSON.stringify({experienceId:personalization.variationId,experienceName:personalization.variationName})),window.location=personalization.redirectUrl;return}if(!isAdmin()){if(personalization.delayOption&&personalization.delayOption!=="none"){txtFind(txt.delayedQueue,p=>p.variationId===personalization.variationId)||(txt.log("pushing on delay queue",personalization),txt.delayedQueue.push(personalization));continue}if(personalization.javascriptTrigger)try{let start=()=>{if(txt.log("starting experience from custom javascript trigger."),personalization.variationBody)preparePersonalizationToExecute(personalization),asyncReceivedAudiences=!1;else{let variationUrl=personalization.variationUrl;txt.scriptHost&&(variationUrl=variationUrl.replace("data.unless.com",txt.scriptHost)),txt.log("fetching experience",variationUrl),fetch(variationUrl,data2=>{personalization.variationBody=data2,preparePersonalizationToExecute(personalization),asyncReceivedAudiences=!1},e=>{console.error("could not fetch experience",e)})}},isControl=personalization.variation==="control-group";eval(`(function(start, settings, isControl){${personalization.javascriptTrigger}})(start, isControl)`);continue}catch(e){console.warn("Error evaluating custom javascript trigger",e)}preparePersonalizationToExecute(personalization)}}}txt.applyDiffs()},onGetPersonalizedDataError=()=>{receivedPersonalizedData=!0,done()},session=getSession(),sessionStats=txtFind(getLocalStats().sessions,s=>s.sessionId===session.sessionId);sessionStats||updateSessionStats(!1,!1);let postData={unlessid:refid,referer:document.referrer,viewSize:getViewSize(),browserLanguage:navigator.language||navigator.userLanguage,query:txt.query,url:txt.url,accountId:txt.id,version:txt.version,personalizationId,componentPackageName,forceShow,consistent:txt.consistent,mode:txt.mode};if(txt.mode==="all"&&(postData.sessionId=session.sessionId,postData.sessionStartedAt=session.startDate,postData.visitorId=txt.getVisitorId()),txt.sendCookies.length>0){postData.cookie="";for(let cookieName of txt.sendCookies)txt.getCookie(cookieName)&&(postData.cookie+=`${cookieName}=${txt.getCookie(cookieName)}; `)}fetch(`${getDomain()}/txt-api/get-experiences`,onGetPersonalizedData,onGetPersonalizedDataError,"POST",postData,!1)}}else done()},getDomain=()=>txt.scriptHost?`https://${txt.scriptHost}/api/v1`:`https://${txt.id}.unless.com/api/v1`;txt.trackEvent=(eventName,eventValue,callback)=>{txt.track({eventName,eventValue,callback})},txt.processEventStack=()=>{if(txt.mode==="all"&&txt.getVisitorId()){let eventStack=getSessionItem("unless_event_stack")?JSON.parse(getSessionItem("unless_event_stack")):[];for(;eventStack.length>0;){let options=eventStack.pop();txt.track(options)}setSessionItem("unless_event_stack",JSON.stringify([]))}},txt.markPersonalizationProcessed=personalizationId2=>{let changed=!1;txt.personalizationsProcessedIds.includes(personalizationId2)||(txt.log("adding to processed ids by API",personalizationId2),txt.personalizationsProcessedIds.push(personalizationId2),changed=!0),txt.personalizationsSeenIds.includes(personalizationId2)||(txt.personalizationsSeenIds.push(personalizationId2),changed=!0),changed&&setTimeout(()=>{txt.log("updating visitor because new personalization processed",personalizationId2),updateVisitor({isEvent:!1,useBeacon:!0})},txt.visitId?1:1e3)},txt.track=options=>{if(txt.mode!=="all"){txt.log("Postponing event, waiting for consent.");let eventStack=getSessionItem("unless_event_stack")?JSON.parse(getSessionItem("unless_event_stack")):[];eventStack.push(options),setSessionItem("unless_event_stack",JSON.stringify(eventStack)),options.callback&&options.callback();return}let{isEvent=!0,eventName,eventValue,joinAudienceId,profileData,addOnCtaId,callback,useBeacon,eventSource="api"}=options;if(profileData){let error2=!1;if(Array.isArray(profileData)?profileData.length>0&&(typeof profileData[0].key>"u"||typeof profileData[0].value>"u"||typeof profileData[0].type>"u")&&(error2=!0):error2=!0,error2){console.error('Invalid profile data supplied. Expecting an array of objects containing the keys: "key", "value" and "type".',profileData),callback&&callback();return}}if(asyncReceivedAudiences&&txt.visitId||!isEvent)if(eventName||profileData||joinAudienceId){if(txt.log("tracking event",options),updateVisitor({isEvent,eventName,eventValue,eventSource,joinAudienceId,profileData,addOnCtaId,callback,useBeacon}),profileData&&profileData.length>0)for(let pd of profileData)txt.set(`profile.${pd.key}`,pd.value)}else callback&&callback();else options.tried=options.tried||0,options.tried<100&&setTimeout(()=>{callback&&callback(),options.callback=null,options.tried++,txt.track(options)},100)},txt.setProfile=data2=>{txt.profileData=data2},txt.setCookie=(name,value,days)=>{createCookie(name,value,days)},txt.getCookie=name=>readCookie(name),txt.get=key=>{for(let[entryKey,entryValue]of Object.entries(Txt.queryParams||{}))if(entryKey.toLowerCase()===key.toLowerCase())return entryValue;return null},txt.set=(key,value)=>{txt.queryParams[key]=value},txt.getVisitorId=()=>{if(txt.customIdentifier)return txt.customIdentifier;let visitorId=readCookie("unless_id")||readCookie("unless_visitorId");return visitorId!==!0&&visitorId!=="true"?visitorId:null},txt.getSessionId=()=>getSession().sessionId,txt.deleteSessionId=()=>{deleteCookie("unless_sid"),deleteSessionData(),Txt.localSessionId=null},txt.identify=(email,data2,identifier)=>{txt.log("identifying",email,data2,identifier);let profileData=[];email&&profileData.push({key:"email",type:"text",value:email,label:"Email"}),identifier&&profileData.push({key:"identifier",type:"identifier",value:identifier,label:"identifier"}),data2&&Array.isArray(data2)&&data2.length>0&&(profileData=profileData.concat(data2)),txt.updateProfile(profileData)},txt.updateProfile=profileData=>{let update=!1;for(let pd of profileData)pd.value&&pd.value!==txt.queryParams[`profile.${pd.key}`]&&(update||(txt.log("updating profile",profileData,txt.queryParams[`profile.${pd.key}`],"-->",pd.value),update=!0),txt.queryParams[`profile.${pd.key}`]=pd.value);update&&txt.track({profileData,eventSource:"api#update-profile"})},txt.launchComponent=(personalizationId2,options={})=>{txt.log("starting experience by API",personalizationId2,options),receivedPersonalizedData=!1,fetchingPersonalizatedData=!1,asyncReceivedAudiences=!1,getExperiences({personalizationId:personalizationId2,forceShow:options.force})},txt.openChat=(...args)=>{console.info("AI component not loaded, starting to load the AI component.");let originalOpenChat=txt.openChat;receivedPersonalizedData=!1,fetchingPersonalizatedData=!1,asyncReceivedAudiences=!1,getExperiences({componentPackageName:"https://unless.com/en/components-4.0/prod/ChatbotMultiDisplayConversationCenter/manifest.json",forceShow:!0});let interval=setInterval(()=>{originalOpenChat!==Txt.openChat&&(setTimeout(()=>{Txt.openChat.apply(Txt,args)},50),clearInterval(interval))},100)},txt.joinAudience=audienceId=>{txt.log("joining audience with id",audienceId),txt.track({isEvent:!0,eventName:"joinAudienceEvent",joinAudienceId:audienceId,useBeacon:!1})},txt.leaveAudience=audienceId=>{txt.log("leaving audience with id",audienceId),txt.track({isEvent:!0,eventName:"leaveAudienceEvent",eventValue:audienceId,useBeacon:!1})},txt.optOutTracking=(mode="essential")=>{mode!=="essential"&&mode!=="none"?console.error("Parameter 'mode' should be either 'essential' or 'none'."):(txt.log("Opted out. Setting mode to essential."),txt.defaultMode==="all"&&createCookie("unless_opt_out",mode,365),deleteCookie("unless_id"),deleteCookie("unless_sid"),deleteSessionData(),txt.mode=mode)},txt.optInTracking=()=>{txt.log("Opted in. Setting mode to all."),deleteCookie("unless_opt_out"),txt.processEventStack(),!isPreviewing()&&txt.mode!=="all"&&(txt.mode="all",txt.disableTracking?txt.matchedPersonalizedUrls.length>0?updateVisitor({eventSource:"opt-in"}):createCookie("unless_id",!0,365):updateVisitor({eventSource:"opt-in"}))};let initiate=options=>{if(options&&txt.setOptions(options),txt.mode==="none")txt.log("Not showing experiences. Not consented and mode set to 'none'."),unhidePage();else{txt.customStartupScript&&!customStartupScriptRan&&(runCustomStartupScript(txt.customStartupScript),customStartupScriptRan=!0),updateSession();let hash=window.location.hash.substring(1)||"";hash.match(/^[{]?[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}[}]?$/)?txt.launchComponent(hash):getExperiences()}checkLoadAdmin(),addKeyboardShortcut()},isPreviewing=()=>txt.query.indexOf("unless_audiences=")>=0||txt.query.indexOf("unless_preview=")>=0,updateSession=isPersonalized=>{let session2=getSession();session2.lastActiveDate=Date.now(),session2.isPersonalized=session2.isPersonalized||isPersonalized,saveSession(session2)},addKeyboardShortcut=()=>{window.onkeyup=event=>{event.keyCode===84&&event.altKey+event.shiftKey+event.ctrlKey+event.metaKey>=2&&txt.loadAdmin()}},hasActiveExperienceOnPage=()=>txt.matchedPersonalizedUrls.length>0,isOnWhitelistedPage=()=>{let whitelistedPages=(txt.autoTrackingWhitelist||"").split(",");for(let whitelistedPage of whitelistedPages)if(new RegExp(`^${whitelistedPage}$`).test(window.location.pathname))return!0;return!1},refreshTimeoutRunning=!1,done=()=>{fullyLoaded||document.readyState==="complete"&&(fullyLoaded=!0,txt.log("txt-loaded"),throwEvent("txt-loaded"),updateSessionStats(!0,!1),cleanupOldCustomCss(txt.personalizationsEligible.map(p=>p.variationId))),document.readyState!=="loading"&&document.body&&receivedPersonalizedData&&document.documentElement.style.opacity!==""&&!isAdmin()&&(txt.log("set visibility"),unhidePage()),fullyLoaded&&receivedPersonalizedData&&!asyncReceivedAudiences&&!isAdmin()&&(!(txt.disableTracking||isInIframe())||hasActiveExperienceOnPage()||isOnWhitelistedPage())&&!isPreviewing()&&txt.mode==="all"&&(txt.log("tracking audiences because fully loaded"),updateVisitor({eventSource:"pageLoad"})),syncGaEvents(),!refreshTimeoutRunning&&!adminLoaded&&(refreshTimeoutRunning=!0,setTimeout(()=>{if(refreshTimeoutRunning=!1,isAdmin())(!document.body||!document.body.style||document.documentElement.style.opacity!=="")&&done();else for(txt.applyDiffs(),checkDelayedQueue();window._unless&&window._unless.length>0;)txt.track(window._unless.shift())},document.readyState==="complete"?200:50))},updateVisitor=({isEvent=!1,eventName="",eventValue=0,eventSource,joinAudienceId,profileData,addOnCtaId,callback,useBeacon})=>{if(isPreviewing()){txt.inAudiences=[];return}if(txt.mode!=="all")return;if(!txt.url){console.warn("no url found, not updating visitor");return}if(txt.excludeIframes&&isInIframe()){txt.log(`Unless script is disabled in iframes. (${window.location.href})`);return}let session2=getSession(),sessionStats2=txtFind(getLocalStats().sessions,s=>s.sessionId===session2.sessionId),personalizationsLoadedIds=txt.personalizationsLoadedIds,personalizationsEligible=txt.personalizationsEligible.filter(p=>txt.personalizationsProcessedIds.includes(p.variationId)).map(p=>({variationId:p.variationId,variantId:p.variantId,testMode:p.testMode,seen:txt.personalizationsSeenIds.indexOf(p.variationId)!==-1})),redirectExperience=getSessionItem("unless-redirect-experience");if(redirectExperience&&!useBeacon){let{experienceId,experienceName}=JSON.parse(redirectExperience);txt.log("processing redirect experience",experienceId,experienceName),txt.personalizationsSeenIds.push(experienceId),txt.log("adding to processed ids because redirect",experienceId),txt.personalizationsProcessedIds.push(experienceId),personalizationsLoadedIds.push(experienceId),personalizationsEligible.push({variationId:experienceId,seen:!0}),addExperienceToEventQueue(experienceId,experienceName,!0,!1),deleteSessionItem("unless-redirect-experience")}let isPersonalized=!!session2.isPersonalized;if(!isPersonalized)for(let seenId of txt.personalizationsSeenIds){let eligible=txt.personalizationsEligible.find(p=>p.variationId===seenId);if(eligible&&eligible.testMode!=="always"){isPersonalized=!0;break}}updateSession(isPersonalized),asyncReceivedAudiences=!0;let postData2={isEvent,eventName,eventValue,eventSource,joinAudienceId,profileData:profileData||txt.profileData,addOnCtaId,refid:txt.refid,variationId:txt.getVariationIdForEditing(),referer:document.referrer,viewSize:getViewSize(),browserLanguage:navigator.language||navigator.userLanguage,query:txt.query,url:txt.url,accountId:txt.id,visitorId:txt.getVisitorId(),version:txt.version,snippetVersion:txt.snippetVersion,snippetInstaller:txt.snippetInstaller,personalizationsEligible,isPersonalized,matchedPersonalizedUrls:txt.matchedPersonalizedUrls,visitId:txt.visitId,sessionId:session2.sessionId,sessionStartedAt:session2.startDate,sessionStats:sessionStats2,useBeacon};if(txt.profileData=null,txt.sendCookies.length>0){postData2.cookie="";for(let cookieName of txt.sendCookies)txt.getCookie(cookieName)&&(postData2.cookie+=`${cookieName}=${txt.getCookie(cookieName)}; `)}let onDataReceived=data2=>{if(txt.log("Received audience data",data2),!data2||data2.errorMessage)return onError();let existingVisitorIdFromCookie=txt.getVisitorId();if(existingVisitorIdFromCookie?existingVisitorIdFromCookie!==data2.visitorId&&(txt.log("re-identification happened",data2.visitorId),createCookie("unless_id",data2.visitorId,365)):createCookie("unless_id",data2.visitorId,365),txt.visitId=data2.visitId,txt.inAudiences=data2.audiences,eventSource!=="pageLoad"){let joinedAudiences=data2.joinedAudiences||[];for(let joinedAudience of joinedAudiences)if(txt.matchedAudiences.indexOf(joinedAudience.ruleId)===-1&&(joinedAudience.duration==="session"||joinedAudience.duration>0)&&!joinedAudience.readOnly){txt.consistent=!0,setTimeout(()=>txt.refresh({evaluate:!0}),1e3);break}}callback&&callback(),txt.processEventStack()},onError=()=>{callback&&callback()};fetch(`${getDomain()}/txt-api/update-visitor`,onDataReceived,onError,"POST",postData2,useBeacon)},checkDelayedQueue=mouseLeave=>{let timeOnPage=(Date.now()-txt.currentTime)/1e3,scrollPercent=getScrollPercent(),reset=()=>{asyncReceivedAudiences=!1};for(let i=0;i<txt.delayedQueue.length;i++){let delayedPersonalization=txt.delayedQueue[i];if(delayedPersonalization.delayOption==="timeOnPage"&&timeOnPage>=delayedPersonalization.delayValue)return txt.log(`Showing personalization after ${timeOnPage} seconds delay.`),txt.delayedQueue.splice(i,1),preparePersonalizationToExecute(delayedPersonalization),reset(),checkDelayedQueue(mouseLeave);if(delayedPersonalization.delayOption==="scrollDistance"&&scrollPercent>=delayedPersonalization.delayValue)return txt.log(`Showing personalization after scrolling ${scrollPercent}% of the page.`),txt.delayedQueue.splice(i,1),preparePersonalizationToExecute(delayedPersonalization),reset(),checkDelayedQueue(mouseLeave);if(delayedPersonalization.delayOption==="exitIntent"&&mouseLeave)return txt.log("Showing personalization because of exit intent."),txt.delayedQueue.splice(i,1),preparePersonalizationToExecute(delayedPersonalization),reset(),checkDelayedQueue(mouseLeave)}},preparePersonalizationToExecute=personalization2=>{turbolinksRendering?(Txt.log("Turbolinks rendering, waiting to execute custom scripts..."),setTimeout(()=>preparePersonalizationToExecute(personalization2),100)):(runCustomScripts(txt,personalization2.variationBody,personalization2.variationId),personalization2.variationBody.variation=personalization2.variation,personalization2.variationBody.variationId=personalization2.variationId,personalization2.variationBody.testMode=personalization2.testMode,personalization2.variationBody.variantId=personalization2.variantId,personalization2.variationBody.variantName=personalization2.variantName,personalization2.variationBody.variationName=personalization2.variationName,txt.personalizationsEligible.push(personalization2.variationBody),addExperienceToEventQueue(personalization2.variationId,personalization2.variationName,personalization2.variation!=="control-group",!personalization2.variationBody.diffs||personalization2.variationBody.diffs.length===0,personalization2.variantName))},checkLoadAdmin=()=>{(isAdmin()||adminLoaded)&&txt.loadAdmin()},fetch=(path,callback,onerror,method="GET",postData2=null,useBeacon=!1)=>{if(useBeacon)navigator.sendBeacon(path,jsonToUrlEncoded(postData2));else{let httpRequest=window.XMLHttpRequest?new XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");httpRequest.onreadystatechange=()=>{if(httpRequest.readyState===4)try{let data2=JSON.parse(httpRequest.responseText);if(data2.errorMessage)throw new Error(data2.errorMessage);callback&&callback(data2)}catch(e){txt.log("error fetching and parsing data source",e),onerror&&onerror(e)}},httpRequest.open(method,path,!0),method==="POST"?(httpRequest.setRequestHeader("Content-type","application/x-www-form-urlencoded"),httpRequest.withCredentials=!1,httpRequest.send(jsonToUrlEncoded(postData2))):httpRequest.send()}},addExperienceToEventQueue=(experienceId,experienceName,isSeen,isComponent,variantName)=>{let label=isSeen?"Participant":"Control";variantName&&(label=variantName);let context={url:window.location.href,experienceName,experienceId};txt.addToEventQueue({experienceName,experienceId,isComponent,label,context})};txt.addToEventQueue=({experienceName,experienceId,isComponent,label,context})=>{txt.syncGa&&experienceName&&!txt.gaEventQueue.find(e=>e.experienceName===experienceName)&&txt.gaEventQueue.push({category:"Unless - experiences",action:experienceName,label}),txt.syncGTM&&experienceName&&!txt.gtmEventQueue.find(e=>e.experienceName===experienceName)&&txt.gtmEventQueue.push({event:"Unless",category:"unless_experiences",action:experienceName,label,context,event_params:{event_type:"third_party",experience_name:experienceName,experience_id:experienceId,experience_type:isComponent?"Component":"On-site",experience_test:label}}),throwEvent("unless-event",{event_type:"experience_started",experience_name:experienceName,experience_id:experienceId,experience_type:isComponent?"Component":"On-site",experience_test:label})};let syncGaEvents=()=>{if(txt.syncGa&&txt.gaEventQueue.length>0&&"ga"in window&&typeof window.ga.getAll=="function"){let gaTracker=window.ga.getAll()[0];if(gaTracker)for(;txt.gaEventQueue.length>0;){let event=txt.gaEventQueue.shift();txt.log("sending event to GA",event),gaTracker.send("event",event.category,event.action,event.label,{nonInteraction:!0,useBeacon:!0})}}if(txt.syncGTM&&txt.gtmEventQueue.length>0&&"dataLayer"in window&&typeof window.dataLayer.push=="function")for(;txt.gtmEventQueue.length>0;){let event=txt.gtmEventQueue.shift();txt.log("sending event to GTM",event),window.dataLayer=window.dataLayer||[],window.dataLayer.push(event)}};window.addEventListener("hashchange",()=>{checkLoadAdmin()}),window.addEventListener("popstate",()=>{let url=document.location.href,urlWithoutHash=url;urlWithoutHash.endsWith("#")&&(urlWithoutHash=urlWithoutHash.slice(0,-1)),!txt.disableSPAMode&&url!==txt.url&&urlWithoutHash!==txt.url&&(txt.log("history change detected",url),throwEvent("txt-history-change",{url,prevUrl:window.location.pathname+window.location.search}),setTimeout(()=>txt.refresh({evaluate:!0,resetPersonalizations:!0}),1))});let pushState=history.pushState,historyChangeTimeout=null;history.pushState=(state,title,url)=>(txt.log("pushstate requested",url),!txt.disableSPAMode&&url!==txt.pathname+txt.query&&!turbolinksRendering&&(txt.log("history change detected",url),throwEvent("txt-history-change",{url,prevUrl:window.location.pathname+window.location.search}),historyChangeTimeout&&clearTimeout(historyChangeTimeout),historyChangeTimeout=setTimeout(()=>{historyChangeTimeout=null,txt.refresh({evaluate:!0,resetPersonalizations:!0})},1)),pushState.apply(history,[state,title,url])),document.addEventListener("turbolinks:before-visit",()=>{txt.log("Turbolinks request detected",window.location.href),turbolinksRendering=!0,setTimeout(()=>txt.refresh({evaluate:!0,resetPersonalizations:!0}),1)}),document.addEventListener("turbolinks:load",()=>{txt.log("Turbolinks rendered",window.location.href),window.location.href!==txt.url&&(txt.log("Turbolinks location is different than stored URL, refreshing..."),txt.refresh({evaluate:!0,resetPersonalizations:!0})),turbolinksRendering=!1}),document.documentElement.addEventListener("mouseleave",e=>{e.clientY<=0&&checkDelayedQueue(!0)},!1),window.addEventListener("scroll",()=>{txt.scrollPercentage=Math.max(txt.scrollPercentage,getScrollPercent())}),window.addEventListener("beforeunload",()=>{updateSessionStats(!1,!0)});let opts={"id":"efe12526-ec24-4d2f-b914-7511c0db3d3a","debug":false,"personalizedPages":[],"syncGa":false,"syncGTM":false,"disableTracking":false,"customStartupScript":"if (window.location.host === 'control.convious.com' && window.location.hash === '#edit') {\n  console.log('disabled speedy'); \n  SC_DISABLE_SPEEDY = true;\n}","mode":"essential","scriptHost":"efe12526-ec24-4d2f-b914-7511c0db3d3a.convious.net","disableSPAMode":false};Object.assign(opts,window.TxtOptions),txt.render(opts)})()}});require_txt();})();