window.NOIBUJS_CONFIG={"scriptID":"1.122.0","domain":"."};(()=>{var e={181:(e,t,n)=>{var r=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,o=/^0o[0-7]+$/i,a=parseInt,c="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,l="object"==typeof self&&self&&self.Object===Object&&self,u=c||l||Function("return this")(),d=Object.prototype.toString,h=Math.max,p=Math.min,g=function(){return u.Date.now()};function f(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function m(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==d.call(e)}(e))return NaN;if(f(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=f(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(r,"");var n=s.test(e);return n||o.test(e)?a(e.slice(2),n?2:8):i.test(e)?NaN:+e}e.exports=function(e,t,n){var r,i,s,o,a,c,l=0,u=!1,d=!1,v=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function y(t){var n=r,s=i;return r=i=void 0,l=t,o=e.apply(s,n)}function b(e){return l=e,a=setTimeout(C,t),u?y(e):o}function I(e){var n=e-c;return void 0===c||n>=t||n<0||d&&e-l>=s}function C(){var e=g();if(I(e))return w(e);a=setTimeout(C,function(e){var n=t-(e-c);return d?p(n,s-(e-l)):n}(e))}function w(e){return a=void 0,v&&r?y(e):(r=i=void 0,o)}function S(){var e=g(),n=I(e);if(r=arguments,i=this,c=e,n){if(void 0===a)return b(c);if(d)return a=setTimeout(C,t),y(c)}return void 0===a&&(a=setTimeout(C,t)),o}return t=m(t)||0,f(n)&&(u=!!n.leading,s=(d="maxWait"in n)?h(m(n.maxWait)||0,t):s,v="trailing"in n?!!n.trailing:v),S.cancel=function(){void 0!==a&&clearTimeout(a),l=0,r=c=i=a=void 0},S.flush=function(){return void 0===a?o:w(g())},S}},471:e=>{for(var t=[],n=0;n<256;++n)t[n]=(n+256).toString(16).substr(1);e.exports=function(e,n){var r=n||0,i=t;return[i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]]].join("")}},814:e=>{var t="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(t){var n=new Uint8Array(16);e.exports=function(){return t(n),n}}else{var r=new Array(16);e.exports=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),r[t]=e>>>((3&t)<<3)&255;return r}}},550:(e,t,n)=>{var r=n(814),i=n(471);e.exports=function(e,t,n){var s=t&&n||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var o=(e=e||{}).random||(e.rng||r)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,t)for(var a=0;a<16;++a)t[s+a]=o[a];return t||i(o)}}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var s=t[r]={exports:{}};return e[r](s,s.exports,n),s.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{"use strict";var e,t,r,i,s,o,a,c,l,u,d,h,p,g,f={};n.r(f),n.d(f,{CLSThresholds:()=>ai,FCPThresholds:()=>si,FIDThresholds:()=>Ji,INPThresholds:()=>wi,LCPThresholds:()=>Ui,TTFBThresholds:()=>Bi,onCLS:()=>ci,onFCP:()=>li,onFID:()=>Yi,onINP:()=>Fi,onLCP:()=>Wi,onTTFB:()=>Gi}),function(e){e.TwoG="2g",e.ThreeG="3g",e.FourG="4g",e.Slow2g="slow-2g"}(e||(e={})),function(e){e.JS="js",e.Http="http",e.Gql="gql",e.Csp="csp",e.Resource="res",e.PageCheck="pagecheck_err",e.HttpResponseMatch="http_match"}(t||(t={})),function(e){e.Error="err",e.UserStep="userstep",e.Http="http",e.Loc="loc",e.Page="page",e.WebVital="wv",e.ECommerce="ecommerce",e.NetworkStats="network",e.Sample="sample",e.ApplicationNavigation="app_nav",e.PageCheck="pagecheck",e.VisualError="visual_error",e.Title="title",e.PageType="page_type",e.PageGroups="page_groups"}(r||(r={})),function(e){e.VideoBlock="vid_block",e.PageVisitBlock="pv_block",e.FullBlock="full_block",e.CloseConnection="close_conn",e.OK="ok"}(i||(i={})),function(e){e.StorageFull="sf",e.StorageUnavailable="su",e.StorageUnavailableSecurityError="suse"}(s||(s={})),function(e){e.XMLHttpRequest="XMLHttpRequest",e.ErrorEvent="ErrorEvent",e.UnhandledRejectionError="UnhandledRejectionError",e.Event="Event",e.Response="Response",e.WrappedException="WrappedException",e.FetchException="FetchException",e.ErrorLogEvent="ErrorLogEvent",e.CustomError="CustomError",e.ReactError="ReactError",e.VueError="VueError",e.PageCheckError="PageCheckError"}(o||(o={})),function(e){e.WARN="warn",e.INFO="info",e.DEBUG="debug",e.ERROR="error"}(a||(a={})),function(e){e.Click="click",e.Keyboard="kbd",e.Navigation="navigation"}(c||(c={})),function(e){e.RRWeb="RRWeb",e.AndroidNative="AndroidNative",e.IOSNative="IOSNative"}(l||(l={})),function(e){e.PageVisitPart="pvp",e.PageVisitVideoFile="pvvf",e.PageVisitHttp="pvh",e.PageVisitMeta="pvm",e.WorkRequest="wr"}(u||(u={})),function(e){e.CumulativeLayoutShift="CLS",e.FirstContentfulPaint="FCP",e.FirstInputDelay="FID",e.InteractionToNextPaint="INP",e.LargestContentfulPaint="LCP",e.TimeToFirstByte="TTFB"}(d||(d={})),function(e){e.Good="good",e.NeedsImprovement="needs-improvement",e.Poor="poor",e.Unknown="unknown"}(h||(h={})),function(e){e.HelpCode="hc"}(p||(p={})),function(e){e.PageVisitPart="pv_part",e.CollectError="collect_error",e.Metrics="metrics",e.PageVisit="pv"}(g||(g={}));const m=["metroplexSocketBase","metroplexHTTPBase"],v="Response data unavailable due to an improperly wrapped fetch call",y=["authorization","from","proxy-authorization","content-md5","cookie","x-forwarded-for","x-real-ip","x-device-id","x-auth-token","x-user-id","x-forwarded-for","x-uidh","set-cookie","forwarded"],b=/[0-9]+/g,I=/\b[a-z0-9!#$%&'*+/=?^_‘{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_‘{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)*[a-z0-9-]*[a-z]\w*\b/gi,C=[/\b4\d{12}(?:\d{3})?\b/g,/\b(?:5[1-5]\d{2}|222[1-9]|22[3-9]\d|2[3-6]\d{2}|27[01]\d|2720)\d{12}\b/g,/\b3[47]\d{13}\b/g,/\b3(?:0[0-5]|[68]\d)\d{11}\b/g,/\b6(?:011|5\d{2})\d{12}\b/g,/\b(?:2131|1800|35\d{3})\d{11}\b/g,I,/\b(?!000|666)[0-8]\d{2}[-.● ]?(?!00)\d{2}[-.● ]?(?!0000)\d{4}\b/g,/\b(\d{3}[-.● ]?\d{3}[-.● ]?\d{3})\b/g,/\+(?:\d●?){6,14}\d\b/g],w=/^www\d{0,2}$/,S=/(getElementById\(')([^']*)('\)\.value = )('[^']*')/g,E=a.ERROR,k=a.WARN,A=(a.INFO,a.DEBUG,["Image","EventTarget","Window","Node","ApplicationCache","AudioTrackList","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"]),T=u.PageVisitPart,_=u.PageVisitVideoFile,R=u.PageVisitMeta,M=u.PageVisitHttp,L="type",N="tag",x="src",D="txt",O="hid",P="class",F=p.HelpCode,U=u.WorkRequest,V=(s.StorageFull,s.StorageUnavailable,s.StorageUnavailableSecurityError,t.Http),W=r.Http,B=t.JS,q=t.Gql,G=t.Csp,H=t.Resource,j=r.UserStep,z=r.WebVital,$=c.Click,Z=c.Keyboard,K=(c.Navigation,r.Loc),J=r.Error,Y=r.Page,Q=r.NetworkStats,X=r.ECommerce,ee=(r.Sample,t.PageCheck),te=r.VisualError,ne=r.Title,re=r.PageGroups,ie=u.PageVisitPart,se=u.PageVisitVideoFile,oe=u.PageVisitMeta,ae=u.PageVisitHttp,ce=l.RRWeb;function le(){return self.NOIBUJS_CONFIG||{}}const ue=["i.noibu","i.staging.noibu","input.staging.noibu","input.b.noibu","input.noibu","vf.staging.noibu","vf.noibu"],de=g.PageVisitPart,he=g.CollectError,pe=(g.Metrics,g.PageVisit),ge=i.VideoBlock,fe=i.PageVisitBlock,me=i.FullBlock,ve=i.CloseConnection,ye=i.OK,be=o.XMLHttpRequest,Ie=o.ErrorEvent,Ce=o.UnhandledRejectionError,we=o.Event,Se=o.Response,Ee=o.PageCheckError,ke=o.WrappedException,Ae=o.FetchException,Te=o.ErrorLogEvent,_e=o.CustomError,Re=o.ReactError,Me=o.VueError,Le=["error","warn","log"],Ne=["pagehide","pageshow","popstate","online","offline","messageerror","languagechange","hashchange","beforeprint","afterprint","load","resize"],xe=["blur","focus"],De=["visibilitychange","resume","freeze","readystatechange","cut","copy","paste"],Oe=new Set(["background-position-x","background-position-y","background-size","background-attachment","background-origin","background-clip","background-color","border-image-source","border-image-slice","border-image-width","border-image-outset","border-image-repeat","border-top-style","border-right-style","border-bottom-style","border-left-style","border-top-color","border-right-color","border-bottom-color","border-left-color","border-top-width","border-right-width","border-bottom-width","border-left-width","flex-wrap","list-style-image","list-style-position","max-width","outline-color","outline-style","outline-width","max-height","height","color","border-collapse","text-indent","width","position","line-height","white-space","display","top","pointer-events","right","overflow-x","overflow-y","text-align","padding-top","padding-bottom","padding-right","padding-left","transform","text-decoration-line","font-variant-ligatures","font-variant-caps","font-variant-alternates","font-variant-numeric","font-variant-east-asian","font-variant-position","background-image"].map(e=>"--quantum-metric-"+e));function Pe(){return"beta"===le().njs_version}function Fe(){return Pe()?"1.122.0-beta":"1.122.0"}function Ue(){return le().att_sel||{}}function Ve(){return Pe()?"wss://input.b.noibu.com":"wss://input.noibu.com"}function We(){return Pe()?"https://input.b.noibu.com":"https://input.noibu.com"}function Be(){return`${We()}/${pe}`}const qe=[e=>/AppMeasurement Debug/i.test(e)],Ge=new Set(["button","radio","checkbox","reset","submit"]),He=[e=>"button"===e,(e,t)=>"input"===e&&Ge.has(t.type),e=>"a"===e,e=>"select"===e,e=>"option"===e];var je,ze=n(550),$e=n.n(ze);function Ze(e){return e.nodeType===e.ELEMENT_NODE}function Ke(e){var t=null==e?void 0:e.host;return Boolean((null==t?void 0:t.shadowRoot)===e)}function Je(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}!function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"}(je||(je={}));var Ye={"animation-duration: ;":"animation-duration: 0.6s;","animation-timing-function: ;":"animation-timing-function: cubic-bezier(0, 0, 0.3, 1);","animation-iteration-count: ;":"animation-iteration-count: 1;","animation-direction: ;":"animation-direction: normal;","animation-fill-mode: ;":"animation-fill-mode: forwards;","animation-play-state: ;":"animation-play-state: running;","animation-name: ;":"animation-name: slideIn;","animation-timeline: ;":"animation-timeline: auto;","animation-range-start: ;":"animation-range-start: normal;","animation-range-end: ;":"animation-range-end: normal;","animation-delay: ;":"animation-delay: 0s;"};function Qe(e){try{var t=e.rules||e.cssRules;return t?function(e){e.includes(" background-clip: text;")&&!e.includes(" -webkit-background-clip: text;")&&(e=e.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;"));var t=Object.keys(Ye);return t.some((function(t){return e.includes(t)}))&&t.forEach((function(t){var n=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r=new RegExp(n,"g");e=e.replace(r,Ye[t])})),e}(Array.from(t).map(Xe).join("")):null}catch(e){return null}}function Xe(e){var t;if(function(e){return"styleSheet"in e}(e))try{t=Qe(e.styleSheet)||function(e){var t=e.cssText;if(t.split('"').length<3)return t;var n=["@import","url(".concat(JSON.stringify(e.href),")")];return""===e.layerName?n.push("layer"):e.layerName&&n.push("layer(".concat(e.layerName,")")),e.supportsText&&n.push("supports(".concat(e.supportsText,")")),e.media.length&&n.push(e.media.mediaText),n.join(" ")+";"}(e)}catch(e){}return function(e){if(e.includes(":")){return e.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")}return e}(t||e.cssText)}var et=function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(e){var t;if(!e)return-1;var n=null===(t=this.getMeta(e))||void 0===t?void 0:t.id;return null!=n?n:-1},e.prototype.getNode=function(e){return this.idNodeMap.get(e)||null},e.prototype.getIds=function(){return Array.from(this.idNodeMap.keys())},e.prototype.getMeta=function(e){return this.nodeMetaMap.get(e)||null},e.prototype.removeNodeFromMap=function(e){var t=this,n=this.getId(e);if(this.idNodeMap.delete(n),e.childNodes&&e.childNodes.forEach((function(e){return t.removeNodeFromMap(e)})),e.nodeType===Node.ELEMENT_NODE){var r=e;r.shadowRoot&&r.shadowRoot.childNodes.forEach((function(e){return t.removeNodeFromMap(e)}))}},e.prototype.has=function(e){return this.idNodeMap.has(e)},e.prototype.hasNode=function(e){return this.nodeMetaMap.has(e)},e.prototype.add=function(e,t){var n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)},e.prototype.replace=function(e,t){var n=this.getNode(e);if(n){var r=this.nodeMetaMap.get(n);r&&this.nodeMetaMap.set(t,r)}this.idNodeMap.set(e,t)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function tt(e){var t=e.element,n=e.maskInputOptions,r=e.tagName,i=e.type,s=e.value,o=e.maskInputFn,a=s||"",c=i&&nt(i);return(n[r.toLowerCase()]||c&&n[c])&&(a=o?o(a,t):"*".repeat(a.length)),a}function nt(e){return e.toLowerCase()}function rt(e){var t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?nt(t):null}var it,st,ot=1,at=new RegExp("[^a-z0-9-_:]");function ct(){return ot++}var lt=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,ut=/^(?:[a-z+]+:)?\/\//i,dt=/^www\..*/i,ht=/^(data:)([^,]*),(.*)/i;function pt(e,t){return(e||"").replace(lt,(function(e,n,r,i,s,o){var a,c=r||s||o,l=n||i||"";if(!c)return e;if(ut.test(c)||dt.test(c))return"url(".concat(l).concat(c).concat(l,")");if(ht.test(c))return"url(".concat(l).concat(c).concat(l,")");if("/"===c[0])return"url(".concat(l).concat((a=t,(a.indexOf("//")>-1?a.split("/").slice(0,3).join("/"):a.split("/")[0]).split("?")[0]+c)).concat(l,")");var u=t.split("/"),d=c.split("/");u.pop();for(var h=0,p=d;h<p.length;h++){var g=p[h];"."!==g&&(".."===g?u.pop():u.push(g))}return"url(".concat(l).concat(u.join("/")).concat(l,")")}))}var gt=/^[^ \t\n\r\u000c]+/,ft=/^[, \t\n\r\u000c]+/;function mt(e,t){if(!t||""===t.trim())return t;var n=e.createElement("a");return n.href=t,n.href}function vt(){var e=document.createElement("a");return e.href="",e.href}function yt(e,t,n,r){return r?"src"===n||"href"===n&&("use"!==t||"#"!==r[0])||"xlink:href"===n&&"#"!==r[0]?mt(e,r):"background"!==n||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===n?function(e,t){if(""===t.trim())return t;var n=0;function r(e){var r,i=e.exec(t.substring(n));return i?(r=i[0],n+=r.length,r):""}for(var i=[];r(ft),!(n>=t.length);){var s=r(gt);if(","===s.slice(-1))s=mt(e,s.substring(0,s.length-1)),i.push(s);else{var o="";s=mt(e,s);for(var a=!1;;){var c=t.charAt(n);if(""===c){i.push((s+o).trim());break}if(a)")"===c&&(a=!1);else{if(","===c){n+=1,i.push((s+o).trim());break}"("===c&&(a=!0)}o+=c,n+=1}}}return i.join(", ")}(e,r):"style"===n?pt(r,vt()):"object"===t&&"data"===n?mt(e,r):r:mt(e,r):r}function bt(e,t,n){return("video"===e||"audio"===e)&&"autoplay"===t}function It(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!n&&It(e.parentNode,t,n);for(var r=e.classList.length;r--;){var i=e.classList[r];if(t.test(i))return!0}return!!n&&It(e.parentNode,t,n)}function Ct(e,t,n){try{var r=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(null===r)return!1;if("string"==typeof t){if(r.classList.contains(t))return!0;if(r.closest(".".concat(t)))return!0}else if(It(r,t,!0))return!0;if(n){if(r.matches(n))return!0;if(r.closest(n))return!0}}catch(e){}return!1}function wt(e,t){var n=t.doc,r=t.mirror,i=t.blockClass,s=t.blockSelector,o=t.maskTextClass,a=t.maskTextSelector,c=t.inlineStylesheet,l=t.maskInputOptions,u=void 0===l?{}:l,d=t.maskTextFn,h=t.maskInputFn,p=t.dataURLOptions,g=void 0===p?{}:p,f=t.inlineImages,m=t.recordCanvas,v=t.keepIframeSrcFn,y=t.newlyAddedElement,b=void 0!==y&&y,I=t.maskCurrentNode,C=function(e,t){if(!t.hasNode(e))return;var n=t.getId(e);return 1===n?void 0:n}(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:je.Document,childNodes:[],compatMode:e.compatMode}:{type:je.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:je.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:C};case e.ELEMENT_NODE:return function(e,t){for(var n=t.doc,r=t.blockClass,i=t.blockSelector,s=t.inlineStylesheet,o=t.maskInputOptions,a=void 0===o?{}:o,c=t.maskInputFn,l=t.dataURLOptions,u=void 0===l?{}:l,d=t.inlineImages,h=t.recordCanvas,p=t.keepIframeSrcFn,g=t.newlyAddedElement,f=void 0!==g&&g,m=t.rootId,v=function(e,t,n){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var r=e.classList.length;r--;){var i=e.classList[r];if(t.test(i))return!0}if(n)return e.matches(n)}catch(e){}return!1}(e,r,i),y=function(e){if(e instanceof HTMLFormElement)return"form";var t=nt(e.tagName);return at.test(t)?"div":t}(e),b={},I=e.attributes.length,C=0;C<I;C++){var w=e.attributes[C];bt(y,w.name,w.value)||(b[w.name]=yt(n,y,nt(w.name),w.value))}if("link"===y&&s){var S=Array.from(n.styleSheets).find((function(t){return t.href===e.href})),E=null;S&&(E=Qe(S)),E&&(delete b.rel,delete b.href,b._cssText=pt(E,S.href))}if("style"===y&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){(E=Qe(e.sheet))&&(b._cssText=pt(E,vt()))}if("input"===y||"textarea"===y||"select"===y){var k=e.value,A=e.checked;if("radio"!==b.type&&"checkbox"!==b.type&&"submit"!==b.type&&"button"!==b.type&&k){var T=rt(e);b.value=tt({element:e,type:T,tagName:y,value:k,maskInputOptions:a,maskInputFn:c})}else A&&(b.checked=A)}"option"===y&&(e.selected&&!a.select?b.selected=!0:delete b.selected);if("canvas"===y&&h)if("2d"===e.__context)(function(e){var t=e.getContext("2d");if(!t)return!0;for(var n=0;n<e.width;n+=50)for(var r=0;r<e.height;r+=50){var i=t.getImageData,s="__rrweb_original__"in i?i.__rrweb_original__:i;if(new Uint32Array(s.call(t,n,r,Math.min(50,e.width-n),Math.min(50,e.height-r)).data.buffer).some((function(e){return 0!==e})))return!1}return!0})(e)||(b.rr_dataURL=e.toDataURL(u.type,u.quality));else if(!("__context"in e)){var _=e.toDataURL(u.type,u.quality),R=document.createElement("canvas");R.width=e.width,R.height=e.height;var M=R.toDataURL(u.type,u.quality);_!==M&&(b.rr_dataURL=_)}if("img"===y&&d){it||(it=n.createElement("canvas"),st=it.getContext("2d"));var L=e,N=L.crossOrigin;L.crossOrigin="anonymous";var x=function(){L.removeEventListener("load",x);try{it.width=L.naturalWidth,it.height=L.naturalHeight,st.drawImage(L,0,0),b.rr_dataURL=it.toDataURL(u.type,u.quality)}catch(e){}N?b.crossOrigin=N:L.removeAttribute("crossorigin")};L.complete&&0!==L.naturalWidth?x():L.addEventListener("load",x)}"audio"!==y&&"video"!==y||(b.rr_mediaState=e.paused?"paused":"played",b.rr_mediaCurrentTime=e.currentTime);f||(e.scrollLeft&&(b.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(b.rr_scrollTop=e.scrollTop));if(v){var D=e.getBoundingClientRect(),O=D.width,P=D.height;b={class:b.class,rr_width:"".concat(O,"px"),rr_height:"".concat(P,"px")}}"iframe"!==y||p(b.src)||(e.contentDocument||(b.rr_src=b.src),delete b.src);return{type:je.Element,tagName:y,attributes:b,childNodes:[],isSVG:(F=e,Boolean("svg"===F.tagName||F.ownerSVGElement)||void 0),needBlock:v,rootId:m};var F}(e,{doc:n,blockClass:i,blockSelector:s,inlineStylesheet:c,maskInputOptions:u,maskInputFn:h,dataURLOptions:g,inlineImages:f,recordCanvas:m,keepIframeSrcFn:v,newlyAddedElement:b,rootId:C});case e.TEXT_NODE:return function(e,t){var n,r=t.maskTextClass,i=t.maskTextSelector,s=t.maskTextFn,o=t.rootId,a=t.maskCurrentNode,c=e.parentNode&&e.parentNode.tagName,l=e.textContent,u="STYLE"===c||void 0,d="SCRIPT"===c||void 0;if(u&&l){try{e.nextSibling||e.previousSibling||(null===(n=e.parentNode.sheet)||void 0===n?void 0:n.cssRules)&&(l=Qe(e.parentNode.sheet))}catch(e){}l=pt(l,vt())}d&&(l="SCRIPT_PLACEHOLDER");if(!u&&!d&&l){(void 0===a?Ct(e,r,i):a)&&(l=s?s(l):l.replace(/[\S]/g,"*"))}return{type:je.Text,textContent:l||"",isStyle:u,rootId:o}}(e,{maskTextClass:o,maskTextSelector:a,maskTextFn:d,rootId:C,maskCurrentNode:I});case e.CDATA_SECTION_NODE:return{type:je.CDATA,textContent:"",rootId:C};case e.COMMENT_NODE:return{type:je.Comment,textContent:e.textContent||"",rootId:C};default:return!1}}function St(e){return null==e?"":e.toLowerCase()}function Et(e,t){var n=t.doc,r=t.mirror,i=t.blockClass,s=t.blockSelector,o=t.maskTextClass,a=t.maskTextSelector,c=t.skipChild,l=void 0!==c&&c,u=t.inlineStylesheet,d=void 0===u||u,h=t.maskInputOptions,p=void 0===h?{}:h,g=t.maskTextFn,f=t.maskInputFn,m=t.slimDOMOptions,v=t.dataURLOptions,y=void 0===v?{}:v,b=t.inlineImages,I=void 0!==b&&b,C=t.recordCanvas,w=void 0!==C&&C,S=t.onSerialize,E=t.onIframeLoad,k=t.iframeLoadTimeout,A=void 0===k?5e3:k,T=t.onStylesheetLoad,_=t.stylesheetLoadTimeout,R=void 0===_?5e3:_,M=t.keepIframeSrcFn,L=void 0===M?function(){return!1}:M,N=t.newlyAddedElement,x=void 0!==N&&N,D=t.maskedElements,O=void 0===D?[]:D,P=t.preserveWhiteSpace,F=void 0===P||P,U=t.maskCurrentNode;!1===U&&(U=O.includes(e));var V,W=wt(e,{doc:n,mirror:r,blockClass:i,blockSelector:s,maskTextClass:o,maskTextSelector:a,inlineStylesheet:d,maskInputOptions:p,maskTextFn:g,maskInputFn:f,dataURLOptions:y,inlineImages:I,recordCanvas:w,keepIframeSrcFn:L,newlyAddedElement:x,maskCurrentNode:U});if(!W)return null;V=r.hasNode(e)?r.getId(e):!function(e,t){if(t.comment&&e.type===je.Comment)return!0;if(e.type===je.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&("preload"===e.attributes.rel||"modulepreload"===e.attributes.rel)&&"script"===e.attributes.as||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&e.attributes.href.endsWith(".js")))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(St(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===St(e.attributes.name)||"icon"===St(e.attributes.rel)||"apple-touch-icon"===St(e.attributes.rel)||"shortcut icon"===St(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&St(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(St(e.attributes.property).match(/^(og|twitter|fb):/)||St(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===St(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===St(e.attributes.name)||"googlebot"===St(e.attributes.name)||"bingbot"===St(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===St(e.attributes.name)||"generator"===St(e.attributes.name)||"framework"===St(e.attributes.name)||"publisher"===St(e.attributes.name)||"progid"===St(e.attributes.name)||St(e.attributes.property).match(/^article:/)||St(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===St(e.attributes.name)||"yandex-verification"===St(e.attributes.name)||"csrf-token"===St(e.attributes.name)||"p:domain_verify"===St(e.attributes.name)||"verify-v1"===St(e.attributes.name)||"verification"===St(e.attributes.name)||"shopify-checkout-api-token"===St(e.attributes.name)))return!0}}return!1}(W,m)&&(F||W.type!==je.Text||W.isStyle||W.textContent.replace(/^\s+|\s+$/gm,"").length)?ct():-2;var B=Object.assign(W,{id:V});if(r.add(e,B),-2===V)return null;S&&S(e);var q=!l;if(B.type===je.Element){q=q&&!B.needBlock,delete B.needBlock;var G=e.shadowRoot;G&&Je(G)&&(B.isShadowHost=!0)}if((B.type===je.Document||B.type===je.Element)&&q){m.headWhitespace&&B.type===je.Element&&"head"===B.tagName&&(F=!1);for(var H={doc:n,mirror:r,blockClass:i,blockSelector:s,maskTextClass:o,maskTextSelector:a,skipChild:l,inlineStylesheet:d,maskInputOptions:p,maskTextFn:g,maskInputFn:f,slimDOMOptions:m,dataURLOptions:y,inlineImages:I,recordCanvas:w,preserveWhiteSpace:F,onSerialize:S,onIframeLoad:E,iframeLoadTimeout:A,onStylesheetLoad:T,stylesheetLoadTimeout:R,keepIframeSrcFn:L,maskCurrentNode:U,maskedElements:O},j=0,z=Array.from(e.childNodes);j<z.length;j++){(K=Et(z[j],H))&&B.childNodes.push(K)}if(Ze(e)&&e.shadowRoot)for(var $=0,Z=Array.from(e.shadowRoot.childNodes);$<Z.length;$++){var K;(K=Et(Z[$],H))&&(Je(e.shadowRoot)&&(K.isShadow=!0),B.childNodes.push(K))}}return e.parentNode&&Ke(e.parentNode)&&Je(e.parentNode)&&(B.isShadow=!0),B.type===je.Element&&"iframe"===B.tagName&&function(e,t,n){var r=e.contentWindow;if(r){var i,s=!1;try{i=r.document.readyState}catch(e){return}if("complete"===i){if("about:blank"!==r.location.href||"about:blank"===e.src||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}else{var o=setTimeout((function(){s||(t(),s=!0)}),n);e.addEventListener("load",(function(){clearTimeout(o),s=!0,t()}))}}}(e,(function(){var t=e.contentDocument;if(t&&E){var n=Et(t,{doc:t,mirror:r,blockClass:i,blockSelector:s,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:d,maskInputOptions:p,maskTextFn:g,maskInputFn:f,slimDOMOptions:m,dataURLOptions:y,inlineImages:I,recordCanvas:w,preserveWhiteSpace:F,onSerialize:S,onIframeLoad:E,iframeLoadTimeout:A,onStylesheetLoad:T,stylesheetLoadTimeout:R,keepIframeSrcFn:L,maskCurrentNode:U,maskedElements:O});n&&E(e,n)}}),A),B.type===je.Element&&"link"===B.tagName&&"stylesheet"===B.attributes.rel&&function(e,t,n){var r,i=!1;try{r=e.sheet}catch(e){return}if(!r){var s=setTimeout((function(){i||(t(),i=!0)}),n);e.addEventListener("load",(function(){clearTimeout(s),i=!0,t()}))}}(e,(function(){if(T){var t=Et(e,{doc:n,mirror:r,blockClass:i,blockSelector:s,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:d,maskInputOptions:p,maskTextFn:g,maskInputFn:f,slimDOMOptions:m,dataURLOptions:y,inlineImages:I,recordCanvas:w,preserveWhiteSpace:F,onSerialize:S,onIframeLoad:E,iframeLoadTimeout:A,onStylesheetLoad:T,stylesheetLoadTimeout:R,keepIframeSrcFn:L,maskCurrentNode:U,maskedElements:O});t&&T(e,t)}}),R),B}var kt=/([^\\]):hover/;new RegExp(kt.source,"g");function At(e,t,n=document){const r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>{try{n.removeEventListener(e,t,r)}catch(e){}}}let Tt={map:{},getId:()=>-1,getNode:()=>null,removeNodeFromMap(){},has:()=>!1,reset(){}};function _t(e,t,n={}){let r=null,i=0;return function(...s){const o=Date.now();i||!1!==n.leading||(i=o);const a=t-(o-i),c=this;a<=0||a>t?(r&&(clearTimeout(r),r=null),i=o,e.apply(c,s)):r||!1===n.trailing||(r=setTimeout(()=>{i=!1===n.leading?0:Date.now(),r=null,e.apply(c,s)},a))}}function Rt(e,t,n,r,i=window){const s=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,r?n:{set(e){setTimeout(()=>{n.set.call(this,e)},0),s&&s.set&&s.set.call(this,e)}}),()=>Rt(e,t,s||{},!0)}function Mt(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],i=n(r);return"function"==typeof i&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=i,()=>{e[t]=r}}catch(e){return()=>{}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(Tt=new Proxy(Tt,{get:(e,t,n)=>Reflect.get(e,t,n)}));let Lt=Date.now;function Nt(e){var t,n,r,i,s,o;const a=e.document;return{left:a.scrollingElement?a.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:(null==a?void 0:a.documentElement.scrollLeft)||(null===(n=null===(t=null==a?void 0:a.body)||void 0===t?void 0:t.parentElement)||void 0===n?void 0:n.scrollLeft)||(null===(r=null==a?void 0:a.body)||void 0===r?void 0:r.scrollLeft)||0,top:a.scrollingElement?a.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==a?void 0:a.documentElement.scrollTop)||(null===(s=null===(i=null==a?void 0:a.body)||void 0===i?void 0:i.parentElement)||void 0===s?void 0:s.scrollTop)||(null===(o=null==a?void 0:a.body)||void 0===o?void 0:o.scrollTop)||0}}function xt(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Dt(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Ot(e,t,n,r){if(!e)return!1;const i=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(!i)return!1;try{if("string"==typeof t){if(i.classList.contains(t))return!0;if(r&&null!==i.closest("."+t))return!0}else if(It(i,t,r))return!0}catch(e){}if(n){if(i.matches(n))return!0;if(r&&null!==i.closest(n))return!0}return!1}function Pt(e,t){return-2===t.getId(e)}function Ft(e){return Boolean(e.changedTouches)}function Ut(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function Vt(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function Wt(e){return Boolean(null==e?void 0:e.shadowRoot)}/[1-9][0-9]{12}/.test(Date.now().toString())||(Lt=()=>(new Date).getTime());class Bt{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(e){var t;return null!==(t=this.styleIDMap.get(e))&&void 0!==t?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let n;return n=void 0===t?this.id++:t,this.styleIDMap.set(e,n),this.idStyleMap.set(n,e),n}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function qt(e){var t,n;let r=null;return(null===(n=null===(t=e.getRootNode)||void 0===t?void 0:t.call(e))||void 0===n?void 0:n.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&e.getRootNode().host&&(r=e.getRootNode().host),r}function Gt(e){const t=e.ownerDocument;if(!t)return!1;const n=function(e){let t,n=e;for(;t=qt(n);)n=t;return n}(e);return t.contains(n)}function Ht(e){const t=e.ownerDocument;return!!t&&(t.contains(e)||Gt(e))}var jt=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(jt||{}),zt=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e))(zt||{}),$t=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))($t||{}),Zt=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(Zt||{}),Kt=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(Kt||{});function Jt(e){return"__ln"in e}class Yt{constructor(){this.length=0,this.head=null,this.tail=null}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let n=0;n<e;n++)t=(null==t?void 0:t.next)||null;return t}addNode(e){const t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&Jt(e.previousSibling)){const n=e.previousSibling.__ln.next;t.next=n,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,n&&(n.previous=t)}else if(e.nextSibling&&Jt(e.nextSibling)&&e.nextSibling.__ln.previous){const n=e.nextSibling.__ln.previous;t.previous=n,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,n&&(n.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;null===t.next&&(this.tail=t),this.length++}removeNode(e){const t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}const Qt=(e,t)=>`${e}@${t}`;class Xt{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=e=>{const t=e=>{e.forEach(this.processMutation),this.emit()};if(this.deferProcessMutations){const n=100;for(let r=0;r<Math.ceil(e.length/n);r++){const i=r*n,s=(r+1)*n;setTimeout(()=>t(e.slice(i,s)))}}else t(e)},this.emit=()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,n=new Yt,r=e=>{let t=e,n=-2;for(;-2===n;)t=t&&t.nextSibling,n=t&&this.mirror.getId(t);return n},i=i=>{if(!i.parentNode||!Ht(i))return;const s=Ke(i.parentNode)?this.mirror.getId(qt(i)):this.mirror.getId(i.parentNode),o=r(i);if(-1===s||-1===o)return n.addNode(i);const a=Et(i,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:e=>{Ut(e,this.mirror)&&this.iframeManager.addIframe(e),Vt(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),Wt(i)&&this.shadowDomManager.addShadowRoot(i.shadowRoot,this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)}});a&&(e.push({parentId:s,nextId:o,node:a}),t.add(a.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const e of this.movedSet)tn(this.removes,e,this.mirror)&&!this.movedSet.has(e.parentNode)||i(e);for(const e of this.addedSet)nn(this.droppedSet,e)||tn(this.removes,e,this.mirror)?nn(this.movedSet,e)?i(e):this.droppedSet.add(e):i(e);let s=null;for(;n.length;){let e=null;if(s){const t=this.mirror.getId(s.value.parentNode),n=r(s.value);-1!==t&&-1!==n&&(e=s)}if(!e){let t=n.tail;for(;t;){const n=t;if(t=t.previous,n){const t=this.mirror.getId(n.value.parentNode);if(-1===r(n.value))continue;if(-1!==t){e=n;break}{const t=n.value;if(t.parentNode&&t.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const r=t.parentNode.host;if(-1!==this.mirror.getId(r)){e=n;break}}}}}}if(!e){for(;n.head;)n.removeNode(n.head.value);break}s=e.previous,n.removeNode(e.value),i(e.value)}const o={texts:this.texts.map(e=>({id:this.mirror.getId(e.node),value:e.value})).filter(e=>!t.has(e.id)).filter(e=>this.mirror.has(e.id)),attributes:this.attributes.map(e=>{const{attributes:t}=e;if("string"==typeof t.style){const n=JSON.stringify(e.styleDiff),r=JSON.stringify(e._unchangedStyles);n.length<t.style.length&&(n+r).split("var(").length===t.style.split("var(").length&&(t.style=e.styleDiff)}return{id:this.mirror.getId(e.node),attributes:t}}).filter(e=>!t.has(e.id)).filter(e=>this.mirror.has(e.id)),removes:this.removes,adds:e};(o.texts.length||o.attributes.length||o.removes.length||o.adds.length)&&(this.texts=[],this.attributes=[],this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(o))},this.processMutation=e=>{try{if(Xt.shouldSkipMutation(e))return}catch(e){}if(Pt(e.target,this.mirror))return;let t;try{t=document.implementation.createHTMLDocument()}catch(e){t=this.doc}switch(e.type){case"characterData":{const t=e.target.textContent;Ot(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:Ct(e.target,this.maskTextClass,this.maskTextSelector)&&t?this.maskTextFn?this.maskTextFn(t):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const n=e.target;let r=e.attributeName,i=e.target.getAttribute(r);if("value"===r){const e=rt(n);i=tt({element:n,maskInputOptions:this.maskInputOptions,tagName:n.tagName,type:e,value:i,maskInputFn:this.maskInputFn})}if(Ot(e.target,this.blockClass,this.blockSelector,!1)||i===e.oldValue)return;let s=this.attributes.find(t=>t.node===e.target);if("IFRAME"===n.tagName&&"src"===r&&!this.keepIframeSrcFn(i)){if(n.contentDocument)return;try{e.attributeName="rr_src"}catch(e){return}}if(s||(s={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(s)),"type"===r&&"INPUT"===n.tagName&&"password"===(e.oldValue||"").toLowerCase()&&n.setAttribute("data-rr-is-password","true"),!bt(n.tagName,r)&&(s.attributes[r]=yt(this.doc,nt(n.tagName),nt(r),i),"style"===r)){const r=t.createElement("span");e.oldValue&&r.setAttribute("style",e.oldValue);for(const e of Array.from(n.style)){const t=n.style.getPropertyValue(e),i=n.style.getPropertyPriority(e);t!==r.style.getPropertyValue(e)||i!==r.style.getPropertyPriority(e)?s.styleDiff[e]=""===i?t:[t,i]:s._unchangedStyles[e]=[t,i]}for(const e of Array.from(r.style))""===n.style.getPropertyValue(e)&&(s.styleDiff[e]=!1)}break}case"childList":if(Ot(e.target,this.blockClass,this.blockSelector,!0))return;e.addedNodes.forEach(t=>this.genAdds(t,e.target)),e.removedNodes.forEach(t=>{const n=this.mirror.getId(t),r=Ke(e.target)?this.mirror.getId(e.target.host):this.mirror.getId(e.target);Ot(e.target,this.blockClass,this.blockSelector,!1)||Pt(t,this.mirror)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(en(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===n||function e(t,n){if(Ke(t))return!1;const r=n.getId(t);return!n.has(r)||(!t.parentNode||t.parentNode.nodeType!==t.DOCUMENT_NODE)&&(!t.parentNode||e(t.parentNode,n))}(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[Qt(n,r)]?en(this.movedSet,t):this.removes.push({parentId:r,id:n,isShadow:!(!Ke(e.target)||!Je(e.target))||void 0})),this.mapRemoves.push(t))})}},this.genAdds=(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){try{const t=e.getRootNode();if(t instanceof ShadowRoot&&"closed"===t.mode)return}catch(e){}if(this.mirror.hasNode(e)){if(Pt(e,this.mirror))return;this.movedSet.add(e);let n=null;t&&this.mirror.hasNode(t)&&(n=this.mirror.getId(t)),n&&-1!==n&&(this.movedMap[Qt(this.mirror.getId(e),n)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);Ot(e,this.blockClass,this.blockSelector,!1)||(e.childNodes.forEach(e=>this.genAdds(e)),Wt(e)&&e.shadowRoot.childNodes.forEach(t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)}))}}}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager","deferProcessMutations"].forEach(t=>{this[t]=e[t]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}static shouldSkipMutation(e){var t;const n=e.attributeName||"",r="attributes"===e.type,i=e.oldValue,s=null===(t=e.target.attributes.getNamedItem(n))||void 0===t?void 0:t.value;if(r&&i===s)return!0;const o=window.location.hostname.toLowerCase();if("uat.jtv.com"===o||"www.jtv.com"===o){const e="id"===n&&(0===(i||"").indexOf("sizzle-")||0===(s||"").indexOf("sizzle-"));if(r&&("tabindex"===n||e||"data-slick-index"===n))return!0}return!1}}function en(e,t){e.delete(t),t.childNodes.forEach(t=>en(e,t))}function tn(e,t,n){return 0!==e.length&&function e(t,n,r){const{parentNode:i}=n;if(!i)return!1;const s=r.getId(i);if(t.some(e=>e.id===s))return!0;return e(t,i,r)}(e,t,n)}function nn(e,t){return 0!==e.size&&function e(t,n){const{parentNode:r}=n;if(!r)return!1;if(t.has(r))return!0;return e(t,r)}(e,t)}let rn;function sn(e){rn=e}function on(){rn=void 0}const an=e=>{if(!rn)return e;return(...t)=>{try{return e(...t)}catch(e){if(rn&&!0===rn(e))return;throw e}}},cn=[];function ln(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch(e){}return e&&e.target}function un(e,t){var n,r;const i=new Xt;cn.push(i),i.init(e);let s=window.MutationObserver||window.__rrMutationObserver;const o=null===(r=null===(n=null===window||void 0===window?void 0:window.Zone)||void 0===n?void 0:n.__symbol__)||void 0===r?void 0:r.call(n,"MutationObserver");o&&window[o]&&(s=window[o]);const a=new s(an(i.processMutations.bind(i)));return a.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),a}function dn({mouseInteractionCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,sampling:s}){if(!1===s.mouseInteraction)return()=>{};const o=!0===s.mouseInteraction||void 0===s.mouseInteraction?{}:s.mouseInteraction,a=[];let c=null;return Object.keys($t).filter(e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==o[e]).forEach(s=>{let o=nt(s);const l=(t=>s=>{const o=ln(s);if(Ot(o,r,i,!0))return;let a=null,l=t;if("pointerType"in s){switch(s.pointerType){case"mouse":a=Zt.Mouse;break;case"touch":a=Zt.Touch;break;case"pen":a=Zt.Pen}a===Zt.Touch?$t[t]===$t.MouseDown?l="TouchStart":$t[t]===$t.MouseUp&&(l="TouchEnd"):Zt.Pen}else Ft(s)&&(a=Zt.Touch);null!==a?(c=a,(l.startsWith("Touch")&&a===Zt.Touch||l.startsWith("Mouse")&&a===Zt.Mouse)&&(a=null)):$t[t]===$t.Click&&(a=c,c=null);const u=Ft(s)?s.changedTouches[0]:s;if(!u)return;const d=n.getId(o),{clientX:h,clientY:p}=u;an(e)(Object.assign({type:$t[l],id:d,x:h,y:p},null!==a&&{pointerType:a}))})(s);if(window.PointerEvent)switch($t[s]){case $t.MouseDown:case $t.MouseUp:o=o.replace("mouse","pointer");break;case $t.TouchStart:case $t.TouchEnd:return}a.push(At(o,l,t))}),an(()=>{a.forEach(e=>e())})}function hn({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,sampling:s}){return At("scroll",an(_t(an(s=>{const o=ln(s);if(!o||Ot(o,r,i,!0))return;const a=n.getId(o);if(o===t&&t.defaultView){const n=Nt(t.defaultView);e({id:a,x:n.left,y:n.top})}else e({id:a,x:o.scrollLeft,y:o.scrollTop})}),s.scroll||100)),t)}function pn(e,t){const n=Object.assign({},e);return t||delete n.userTriggered,n}const gn=["INPUT","TEXTAREA","SELECT"],fn=new WeakMap;function mn(e){return function(e,t){if(In("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||In("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||In("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||In("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){const n=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(n)}else if(e.parentStyleSheet){const n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(n)}return t}(e,[])}function vn(e,t,n){let r,i;return e?(e.ownerNode?r=t.getId(e.ownerNode):i=n.getId(e),{styleId:i,id:r}):{}}function yn({mirror:e,stylesheetManager:t},n){var r,i,s;let o=null;o="#document"===n.nodeName?e.getId(n):e.getId(n.host);const a="#document"===n.nodeName?null===(r=n.defaultView)||void 0===r?void 0:r.Document:null===(s=null===(i=n.ownerDocument)||void 0===i?void 0:i.defaultView)||void 0===s?void 0:s.ShadowRoot,c=Object.getOwnPropertyDescriptor(null==a?void 0:a.prototype,"adoptedStyleSheets");return null!==o&&-1!==o&&a&&c?(Object.defineProperty(n,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get(){var e;return null===(e=c.get)||void 0===e?void 0:e.call(this)},set(e){var n;const r=null===(n=c.set)||void 0===n?void 0:n.call(this,e);if(null!==o&&-1!==o)try{t.adoptStyleSheets(e,o)}catch(e){}return r}}),an(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get:c.get,set:c.set})})):()=>{}}function bn(e,t={}){const n=e.doc.defaultView;if(!n)return()=>{};!function(e,t){const{mutationCb:n,mousemoveCb:r,mouseInteractionCb:i,scrollCb:s,viewportResizeCb:o,inputCb:a,mediaInteractionCb:c,styleSheetRuleCb:l,styleDeclarationCb:u,canvasMutationCb:d,fontCb:h,selectionCb:p}=e;e.mutationCb=(...e)=>{t.mutation&&t.mutation(...e),n(...e)},e.mousemoveCb=(...e)=>{t.mousemove&&t.mousemove(...e),r(...e)},e.mouseInteractionCb=(...e)=>{t.mouseInteraction&&t.mouseInteraction(...e),i(...e)},e.scrollCb=(...e)=>{t.scroll&&t.scroll(...e),s(...e)},e.viewportResizeCb=(...e)=>{t.viewportResize&&t.viewportResize(...e),o(...e)},e.inputCb=(...e)=>{t.input&&t.input(...e),a(...e)},e.mediaInteractionCb=(...e)=>{t.mediaInteaction&&t.mediaInteaction(...e),c(...e)},e.styleSheetRuleCb=(...e)=>{t.styleSheetRule&&t.styleSheetRule(...e),l(...e)},e.styleDeclarationCb=(...e)=>{t.styleDeclaration&&t.styleDeclaration(...e),u(...e)},e.canvasMutationCb=(...e)=>{t.canvasMutation&&t.canvasMutation(...e),d(...e)},e.fontCb=(...e)=>{t.font&&t.font(...e),h(...e)},e.selectionCb=(...e)=>{t.selection&&t.selection(...e),p(...e)}}(e,t);const r=un(e,e.doc),i=function({mousemoveCb:e,sampling:t,doc:n,mirror:r}){if(!1===t.mousemove)return()=>{};const i="number"==typeof t.mousemove?t.mousemove:50,s="number"==typeof t.mousemoveCallback?t.mousemoveCallback:500;let o,a=[];const c=_t(an(t=>{const n=Date.now()-o;e(a.map(e=>(e.timeOffset-=n,e)),t),a=[],o=null}),s),l=an(_t(an(e=>{const t=ln(e),{clientX:n,clientY:i}=Ft(e)?e.changedTouches[0]:e;o||(o=Lt()),a.push({x:n,y:i,id:r.getId(t),timeOffset:Lt()-o}),c("undefined"!=typeof DragEvent&&e instanceof DragEvent?zt.Drag:e instanceof MouseEvent?zt.MouseMove:zt.TouchMove)}),i,{trailing:!1})),u=[At("mousemove",l,n),At("touchmove",l,n),At("drag",l,n)];return an(()=>{u.forEach(e=>e())})}(e),s=dn(e),o=hn(e),a=function({viewportResizeCb:e},{win:t}){let n=-1,r=-1;return At("resize",an(_t(an(()=>{const t=xt(),i=Dt();n===t&&r===i||(e({width:Number(i),height:Number(t)}),n=t,r=i)}),200)),t)}(e,{win:n}),c=function({inputCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,ignoreClass:s,ignoreSelector:o,maskInputOptions:a,maskInputFn:c,sampling:l,userTriggeredOnInput:u}){function d(e){let n=ln(e);const l=e.isTrusted,d=n&&n.tagName;if(n&&"OPTION"===d&&(n=n.parentElement),!n||!d||gn.indexOf(d)<0||Ot(n,r,i,!0))return;if(n.classList.contains(s)||o&&n.matches(o))return;let p=n.value,g=!1;const f=rt(n)||"";"radio"===f||"checkbox"===f?g=n.checked:(a[d.toLowerCase()]||a[f])&&(p=tt({element:n,maskInputOptions:a,tagName:d,type:f,value:p,maskInputFn:c})),h(n,an(pn)({text:p,isChecked:g,userTriggered:l},u));const m=n.name;"radio"===f&&m&&g&&t.querySelectorAll(`input[type="radio"][name="${CSS.escape(m)}"]`).forEach(e=>{e!==n&&h(e,an(pn)({text:e.value,isChecked:!g,userTriggered:!1},u))})}function h(t,r){const i=fn.get(t);if(!i||i.text!==r.text||i.isChecked!==r.isChecked){fn.set(t,r);const i=n.getId(t);an(e)(Object.assign(Object.assign({},r),{id:i}))}}const p=("last"===l.input?["change"]:["input","change"]).map(e=>At(e,an(d),t)),g=t.defaultView;if(!g)return()=>{p.forEach(e=>e())};const f=g.Object.getOwnPropertyDescriptor(g.HTMLInputElement.prototype,"value"),m=[[g.HTMLInputElement.prototype,"value"],[g.HTMLInputElement.prototype,"checked"],[g.HTMLSelectElement.prototype,"value"],[g.HTMLTextAreaElement.prototype,"value"],[g.HTMLSelectElement.prototype,"selectedIndex"],[g.HTMLOptionElement.prototype,"selected"]];try{g.document.querySelectorAll('input[type="checkbox"]').forEach(e=>{g.Object.getOwnPropertyDescriptor(e,"checked")&&m.push([e,"checked"])})}catch(e){}return f&&f.set&&p.push(...m.map(e=>Rt(e[0],e[1],{set(){an(d)({target:this,isTrusted:!1})}},!1,g))),an(()=>{p.forEach(e=>e())})}(e),l=function({mediaInteractionCb:e,blockClass:t,blockSelector:n,mirror:r,sampling:i,doc:s}){const o=an(s=>_t(an(i=>{const o=ln(i);if(!o||Ot(o,t,n,!0))return;const{currentTime:a,volume:c,muted:l,playbackRate:u}=o;e({type:s,id:r.getId(o),currentTime:a,volume:c,muted:l,playbackRate:u})}),i.media||500)),a=[At("play",o(0),s),At("pause",o(1),s),At("seeked",o(2),s),At("volumechange",o(3),s),At("ratechange",o(4),s)];return an(()=>{a.forEach(e=>e())})}(e),u=function({styleSheetRuleCb:e,mirror:t,stylesheetManager:n},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};const i=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(i,{apply:an((r,i,s)=>{const[o,a]=s,{id:c,styleId:l}=vn(i,t,n.styleMirror);return(c&&-1!==c||l&&-1!==l)&&e({id:c,styleId:l,adds:[{rule:o,index:a}]}),r.apply(i,s)})});const s=r.CSSStyleSheet.prototype.deleteRule;let o,a;r.CSSStyleSheet.prototype.deleteRule=new Proxy(s,{apply:an((r,i,s)=>{const[o]=s,{id:a,styleId:c}=vn(i,t,n.styleMirror);return(a&&-1!==a||c&&-1!==c)&&e({id:a,styleId:c,removes:[{index:o}]}),r.apply(i,s)})}),r.CSSStyleSheet.prototype.replace&&(o=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(o,{apply:an((r,i,s)=>{const[o]=s,{id:a,styleId:c}=vn(i,t,n.styleMirror);return(a&&-1!==a||c&&-1!==c)&&e({id:a,styleId:c,replace:o}),r.apply(i,s)})})),r.CSSStyleSheet.prototype.replaceSync&&(a=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(a,{apply:an((r,i,s)=>{const[o]=s,{id:a,styleId:c}=vn(i,t,n.styleMirror);return(a&&-1!==a||c&&-1!==c)&&e({id:a,styleId:c,replaceSync:o}),r.apply(i,s)})}));const c={};Cn("CSSGroupingRule")?c.CSSGroupingRule=r.CSSGroupingRule:(Cn("CSSMediaRule")&&(c.CSSMediaRule=r.CSSMediaRule),Cn("CSSConditionRule")&&(c.CSSConditionRule=r.CSSConditionRule),Cn("CSSSupportsRule")&&(c.CSSSupportsRule=r.CSSSupportsRule));const l={};return Object.entries(c).forEach(([r,i])=>{l[r]={insertRule:i.prototype.insertRule,deleteRule:i.prototype.deleteRule},i.prototype.insertRule=new Proxy(l[r].insertRule,{apply:an((r,i,s)=>{const[o,a]=s,{id:c,styleId:l}=vn(i.parentStyleSheet,t,n.styleMirror);return(c&&-1!==c||l&&-1!==l)&&e({id:c,styleId:l,adds:[{rule:o,index:[...mn(i),a||0]}]}),r.apply(i,s)})}),i.prototype.deleteRule=new Proxy(l[r].deleteRule,{apply:an((r,i,s)=>{const[o]=s,{id:a,styleId:c}=vn(i.parentStyleSheet,t,n.styleMirror);return(a&&-1!==a||c&&-1!==c)&&e({id:a,styleId:c,removes:[{index:[...mn(i),o]}]}),r.apply(i,s)})})}),an(()=>{try{r.CSSStyleSheet.prototype.insertRule=i,r.CSSStyleSheet.prototype.deleteRule=s,o&&(r.CSSStyleSheet.prototype.replace=o),a&&(r.CSSStyleSheet.prototype.replaceSync=a),Object.entries(c).forEach(([e,t])=>{t.prototype.insertRule=l[e].insertRule,t.prototype.deleteRule=l[e].deleteRule})}catch(e){}})}(e,{win:n}),d=yn(e,e.doc),h=function({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:n,stylesheetManager:r},{win:i}){const s=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(s,{apply:an((i,o,a)=>{var c;const[l,u,d]=a;if(n.has(l))return s.apply(o,[l,u,d]);const{id:h,styleId:p}=vn(null===(c=o.parentRule)||void 0===c?void 0:c.parentStyleSheet,t,r.styleMirror);return(h&&-1!==h||p&&-1!==p)&&e({id:h,styleId:p,set:{property:l,value:u,priority:d},index:mn(o.parentRule)}),i.apply(o,a)})});const o=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(o,{apply:an((i,s,a)=>{var c;const[l]=a;if(n.has(l))return o.apply(s,[l]);const{id:u,styleId:d}=vn(null===(c=s.parentRule)||void 0===c?void 0:c.parentStyleSheet,t,r.styleMirror);return(u&&-1!==u||d&&-1!==d)&&e({id:u,styleId:d,remove:{property:l},index:mn(s.parentRule)}),i.apply(s,a)})}),an(()=>{try{i.CSSStyleDeclaration.prototype.setProperty=s,i.CSSStyleDeclaration.prototype.removeProperty=o}catch(e){}})}(e,{win:n}),p=e.collectFonts?function({fontCb:e,doc:t}){const n=t.defaultView;if(!n)return()=>{};const r=[],i=new WeakMap,s=n.FontFace;n.FontFace=function(e,t,n){const r=new s(e,t,n);return i.set(r,{family:e,buffer:"string"!=typeof t,descriptors:n,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),r};const o=Mt(t.fonts,"add",(function(t){return function(n){return setTimeout(an(()=>{const t=i.get(n);t&&(e(t),i.delete(n))}),0),t.apply(this,[n])}}));return r.push(()=>{try{n.FontFace=s}catch(e){}}),r.push(o),an(()=>{r.forEach(e=>e())})}(e):()=>{},g=function(e){const{doc:t,mirror:n,blockClass:r,blockSelector:i,selectionCb:s}=e;let o=!0;const a=an(()=>{const e=t.getSelection();if(!e||o&&(null==e?void 0:e.isCollapsed))return;o=e.isCollapsed||!1;const a=[],c=e.rangeCount||0;for(let t=0;t<c;t++){const s=e.getRangeAt(t),{startContainer:o,startOffset:c,endContainer:l,endOffset:u}=s;Ot(o,r,i,!0)||Ot(l,r,i,!0)||a.push({start:n.getId(o),startOffset:c,end:n.getId(l),endOffset:u})}s({ranges:a})});return a(),At("selectionchange",a)}(e),f=[];for(const t of e.plugins)f.push(t.observer(t.callback,n,t.options));return an(()=>{cn.forEach(e=>e.reset()),r.disconnect(),i(),s(),o(),a(),c(),l(),u(),d(),h(),p(),g(),f.forEach(e=>e())})}function In(e){return void 0!==window[e]}function Cn(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class wn{constructor(e){this.generateIdFn=e,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(e,t,n,r){const i=n||this.getIdToRemoteIdMap(e),s=r||this.getRemoteIdToIdMap(e);let o=i.get(t);return o||(o=this.generateIdFn(),i.set(t,o),s.set(o,t)),o}getIds(e,t){const n=this.getIdToRemoteIdMap(e),r=this.getRemoteIdToIdMap(e);return t.map(t=>this.getId(e,t,n,r))}getRemoteId(e,t,n){const r=n||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;const i=r.get(t);return i||-1}getRemoteIds(e,t){const n=this.getRemoteIdToIdMap(e);return t.map(t=>this.getRemoteId(e,t,n))}reset(e){if(!e)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}class Sn{constructor(e){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new wn(ct),this.crossOriginIframeRootIdMap=new WeakMap,this.ignoreIframes=e.ignoreIframes,this.ignoreIframes||(this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new wn(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this)))}addIframe(e){this.ignoreIframes||(this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e))}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var n;this.ignoreIframes||(this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),null===(n=this.loadListener)||void 0===n||n.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument)))}handleMessage(e){const t=e;if("rrweb"!==t.data.type||t.origin!==t.data.origin)return;if(!e.source)return;const n=this.crossOriginIframeMap.get(e.source);if(!n)return;const r=this.transformCrossOriginEvent(n,t.data.event);r&&this.wrappedEmit(r,t.data.isCheckout)}transformCrossOriginEvent(e,t){var n;switch(t.type){case jt.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);const n=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,n),this.patchRootIdOnNode(t.data.node,n),{timestamp:t.timestamp,type:jt.IncrementalSnapshot,data:{source:zt.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case jt.Meta:case jt.Load:case jt.DomContentLoaded:return!1;case jt.Plugin:return t;case jt.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case jt.IncrementalSnapshot:switch(t.data.source){case zt.Mutation:return t.data.adds.forEach(t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e);const n=this.crossOriginIframeRootIdMap.get(e);n&&this.patchRootIdOnNode(t.node,n)}),t.data.removes.forEach(t=>{this.replaceIds(t,e,["parentId","id"])}),t.data.attributes.forEach(t=>{this.replaceIds(t,e,["id"])}),t.data.texts.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case zt.Drag:case zt.TouchMove:case zt.MouseMove:return t.data.positions.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case zt.ViewportResize:return!1;case zt.MediaInteraction:case zt.MouseInteraction:case zt.Scroll:case zt.CanvasMutation:case zt.Input:return this.replaceIds(t.data,e,["id"]),t;case zt.StyleSheetRule:case zt.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case zt.Font:return t;case zt.Selection:return t.data.ranges.forEach(t=>{this.replaceIds(t,e,["start","end"])}),t;case zt.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null===(n=t.data.styles)||void 0===n||n.forEach(t=>{this.replaceStyleIds(t,e,["styleId"])}),t}}}replace(e,t,n,r){for(const i of r)(Array.isArray(t[i])||"number"==typeof t[i])&&(Array.isArray(t[i])?t[i]=e.getIds(n,t[i]):t[i]=e.getId(n,t[i]));return t}replaceIds(e,t,n){return this.replace(this.crossOriginIframeMirror,e,t,n)}replaceStyleIds(e,t,n){return this.replace(this.crossOriginIframeStyleMirror,e,t,n)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(e=>{this.replaceIdOnNode(e,t)})}patchRootIdOnNode(e,t){e.type===je.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(e=>{this.patchRootIdOnNode(e,t)})}}class En{constructor(e){this.shadowDoms=new WeakSet,this.restoreHandlers=[],this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.active=!0,this.patchAttachShadow(Element,document)}addShadowRoot(e,t){if(!this.active)return;if(!Je(e))return;if(this.shadowDoms.has(e))return;this.shadowDoms.add(e);const n=un(Object.assign(Object.assign({},this.bypassOptions),{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e);this.restoreHandlers.push(()=>n.disconnect()),this.restoreHandlers.push(hn(Object.assign(Object.assign({},this.bypassOptions),{scrollCb:this.scrollCb,doc:e,mirror:this.mirror}))),setTimeout(()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(e.host)),this.restoreHandlers.push(yn({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))},0)}observeAttachShadow(e){e.contentWindow&&e.contentDocument&&this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){const n=this;Mt(e.prototype,"attachShadow",(function(e){return function(r){const i=e.call(this,r);return this.shadowRoot&&Ht(this)&&n.addShadowRoot(this.shadowRoot,t),i}}))}reset(){this.active=!1,this.restoreHandlers.forEach(e=>{try{e()}catch(e){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}function kn(e,t,n,r){return new(n||(n=Promise))((function(i,s){function o(e){try{c(r.next(e))}catch(e){s(e)}}function a(e){try{c(r.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}c((r=r.apply(e,t||[])).next())}))}for(var An="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Tn="undefined"==typeof Uint8Array?[]:new Uint8Array(256),_n=0;_n<An.length;_n++)Tn[An.charCodeAt(_n)]=_n;const Rn=new Map;const Mn=(e,t,n)=>{if(!e||!xn(e,t)&&"object"!=typeof e)return;const r=function(e,t){let n=Rn.get(e);return n||(n=new Map,Rn.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}(n,e.constructor.name);let i=r.indexOf(e);return-1===i&&(i=r.length,r.push(e)),i};function Ln(e,t,n){if(e instanceof Array)return e.map(e=>Ln(e,t,n));if(null===e)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray){return{rr_type:e.constructor.name,args:[Object.values(e)]}}if(e instanceof ArrayBuffer){return{rr_type:e.constructor.name,base64:function(e){var t,n=new Uint8Array(e),r=n.length,i="";for(t=0;t<r;t+=3)i+=An[n[t]>>2],i+=An[(3&n[t])<<4|n[t+1]>>4],i+=An[(15&n[t+1])<<2|n[t+2]>>6],i+=An[63&n[t+2]];return r%3==2?i=i.substring(0,i.length-1)+"=":r%3==1&&(i=i.substring(0,i.length-2)+"=="),i}(e)}}if(e instanceof DataView){return{rr_type:e.constructor.name,args:[Ln(e.buffer,t,n),e.byteOffset,e.byteLength]}}if(e instanceof HTMLImageElement){const t=e.constructor.name,{src:n}=e;return{rr_type:t,src:n}}if(e instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:e.toDataURL()}}if(e instanceof ImageData){return{rr_type:e.constructor.name,args:[Ln(e.data,t,n),e.width,e.height]}}if(xn(e,t)||"object"==typeof e){return{rr_type:e.constructor.name,index:Mn(e,t,n)}}return e}const Nn=(e,t,n)=>[...e].map(e=>Ln(e,t,n)),xn=(e,t)=>{const n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(e=>"function"==typeof t[e]);return Boolean(n.find(n=>e instanceof t[n]))};function Dn(e,t,n,r){const i=[];try{const s=Mt(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(i,...s){if(!Ot(this,t,n,!0)){const e=function(e){return"experimental-webgl"===e?"webgl":e}(i);if("__context"in this||(this.__context=e),r&&["webgl","webgl2"].includes(e))if(s[0]&&"object"==typeof s[0]){const e=s[0];e.preserveDrawingBuffer||(e.preserveDrawingBuffer=!0)}else s.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[i,...s])}}));i.push(s)}catch(e){}return()=>{i.forEach(e=>e())}}function On(e,t,n,r,i,s,o){const a=[],c=Object.getOwnPropertyNames(e);for(const s of c)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(s))try{if("function"!=typeof e[s])continue;const c=Mt(e,s,(function(e){return function(...a){const c=e.apply(this,a);if(Mn(c,o,this),"tagName"in this.canvas&&!Ot(this.canvas,r,i,!0)){const e=Nn([...a],o,this),r={type:t,property:s,args:e};n(this.canvas,r)}return c}}));a.push(c)}catch(r){const i=Rt(e,s,{set(e){n(this.canvas,{type:t,property:s,args:[e],setter:!0})}});a.push(i)}return a}function Pn(e,t,n){var r=void 0===t?null:t,i=function(e,t){var n=atob(e);if(t){for(var r=new Uint8Array(n.length),i=0,s=n.length;i<s;++i)r[i]=n.charCodeAt(i);return String.fromCharCode.apply(null,new Uint16Array(r.buffer))}return n}(e,void 0!==n&&n),s=i.indexOf("\n",10)+1,o=i.substring(s)+(r?"//# sourceMappingURL="+r:""),a=new Blob([o],{type:"application/javascript"});return URL.createObjectURL(a)}var Fn,Un,Vn,Wn,Bn=(Fn="Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24gKCkgewogICAgJ3VzZSBzdHJpY3QnOwoKICAgIC8qISAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KICAgIENvcHlyaWdodCAoYykgTWljcm9zb2Z0IENvcnBvcmF0aW9uLg0KDQogICAgUGVybWlzc2lvbiB0byB1c2UsIGNvcHksIG1vZGlmeSwgYW5kL29yIGRpc3RyaWJ1dGUgdGhpcyBzb2Z0d2FyZSBmb3IgYW55DQogICAgcHVycG9zZSB3aXRoIG9yIHdpdGhvdXQgZmVlIGlzIGhlcmVieSBncmFudGVkLg0KDQogICAgVEhFIFNPRlRXQVJFIElTIFBST1ZJREVEICJBUyBJUyIgQU5EIFRIRSBBVVRIT1IgRElTQ0xBSU1TIEFMTCBXQVJSQU5USUVTIFdJVEgNCiAgICBSRUdBUkQgVE8gVEhJUyBTT0ZUV0FSRSBJTkNMVURJTkcgQUxMIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkNCiAgICBBTkQgRklUTkVTUy4gSU4gTk8gRVZFTlQgU0hBTEwgVEhFIEFVVEhPUiBCRSBMSUFCTEUgRk9SIEFOWSBTUEVDSUFMLCBESVJFQ1QsDQogICAgSU5ESVJFQ1QsIE9SIENPTlNFUVVFTlRJQUwgREFNQUdFUyBPUiBBTlkgREFNQUdFUyBXSEFUU09FVkVSIFJFU1VMVElORyBGUk9NDQogICAgTE9TUyBPRiBVU0UsIERBVEEgT1IgUFJPRklUUywgV0hFVEhFUiBJTiBBTiBBQ1RJT04gT0YgQ09OVFJBQ1QsIE5FR0xJR0VOQ0UgT1INCiAgICBPVEhFUiBUT1JUSU9VUyBBQ1RJT04sIEFSSVNJTkcgT1VUIE9GIE9SIElOIENPTk5FQ1RJT04gV0lUSCBUSEUgVVNFIE9SDQogICAgUEVSRk9STUFOQ0UgT0YgVEhJUyBTT0ZUV0FSRS4NCiAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLw0KDQogICAgZnVuY3Rpb24gX19hd2FpdGVyKHRoaXNBcmcsIF9hcmd1bWVudHMsIFAsIGdlbmVyYXRvcikgew0KICAgICAgICBmdW5jdGlvbiBhZG9wdCh2YWx1ZSkgeyByZXR1cm4gdmFsdWUgaW5zdGFuY2VvZiBQID8gdmFsdWUgOiBuZXcgUChmdW5jdGlvbiAocmVzb2x2ZSkgeyByZXNvbHZlKHZhbHVlKTsgfSk7IH0NCiAgICAgICAgcmV0dXJuIG5ldyAoUCB8fCAoUCA9IFByb21pc2UpKShmdW5jdGlvbiAocmVzb2x2ZSwgcmVqZWN0KSB7DQogICAgICAgICAgICBmdW5jdGlvbiBmdWxmaWxsZWQodmFsdWUpIHsgdHJ5IHsgc3RlcChnZW5lcmF0b3IubmV4dCh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiByZWplY3RlZCh2YWx1ZSkgeyB0cnkgeyBzdGVwKGdlbmVyYXRvclsidGhyb3ciXSh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiBzdGVwKHJlc3VsdCkgeyByZXN1bHQuZG9uZSA/IHJlc29sdmUocmVzdWx0LnZhbHVlKSA6IGFkb3B0KHJlc3VsdC52YWx1ZSkudGhlbihmdWxmaWxsZWQsIHJlamVjdGVkKTsgfQ0KICAgICAgICAgICAgc3RlcCgoZ2VuZXJhdG9yID0gZ2VuZXJhdG9yLmFwcGx5KHRoaXNBcmcsIF9hcmd1bWVudHMgfHwgW10pKS5uZXh0KCkpOw0KICAgICAgICB9KTsNCiAgICB9CgogICAgLyoKICAgICAqIGJhc2U2NC1hcnJheWJ1ZmZlciAxLjAuMSA8aHR0cHM6Ly9naXRodWIuY29tL25pa2xhc3ZoL2Jhc2U2NC1hcnJheWJ1ZmZlcj4KICAgICAqIENvcHlyaWdodCAoYykgMjAyMSBOaWtsYXMgdm9uIEhlcnR6ZW4gPGh0dHBzOi8vaGVydHplbi5jb20+CiAgICAgKiBSZWxlYXNlZCB1bmRlciBNSVQgTGljZW5zZQogICAgICovCiAgICB2YXIgY2hhcnMgPSAnQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyc7CiAgICAvLyBVc2UgYSBsb29rdXAgdGFibGUgdG8gZmluZCB0aGUgaW5kZXguCiAgICB2YXIgbG9va3VwID0gdHlwZW9mIFVpbnQ4QXJyYXkgPT09ICd1bmRlZmluZWQnID8gW10gOiBuZXcgVWludDhBcnJheSgyNTYpOwogICAgZm9yICh2YXIgaSA9IDA7IGkgPCBjaGFycy5sZW5ndGg7IGkrKykgewogICAgICAgIGxvb2t1cFtjaGFycy5jaGFyQ29kZUF0KGkpXSA9IGk7CiAgICB9CiAgICB2YXIgZW5jb2RlID0gZnVuY3Rpb24gKGFycmF5YnVmZmVyKSB7CiAgICAgICAgdmFyIGJ5dGVzID0gbmV3IFVpbnQ4QXJyYXkoYXJyYXlidWZmZXIpLCBpLCBsZW4gPSBieXRlcy5sZW5ndGgsIGJhc2U2NCA9ICcnOwogICAgICAgIGZvciAoaSA9IDA7IGkgPCBsZW47IGkgKz0gMykgewogICAgICAgICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaV0gPj4gMl07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1soKGJ5dGVzW2ldICYgMykgPDwgNCkgfCAoYnl0ZXNbaSArIDFdID4+IDQpXTsKICAgICAgICAgICAgYmFzZTY0ICs9IGNoYXJzWygoYnl0ZXNbaSArIDFdICYgMTUpIDw8IDIpIHwgKGJ5dGVzW2kgKyAyXSA+PiA2KV07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1tieXRlc1tpICsgMl0gJiA2M107CiAgICAgICAgfQogICAgICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgJz0nOwogICAgICAgIH0KICAgICAgICBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgJz09JzsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIGJhc2U2NDsKICAgIH07CgogICAgY29uc3QgbGFzdEJsb2JNYXAgPSBuZXcgTWFwKCk7DQogICAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gbmV3IE1hcCgpOw0KICAgIGZ1bmN0aW9uIGdldFRyYW5zcGFyZW50QmxvYkZvcih3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucykgew0KICAgICAgICByZXR1cm4gX19hd2FpdGVyKHRoaXMsIHZvaWQgMCwgdm9pZCAwLCBmdW5jdGlvbiogKCkgew0KICAgICAgICAgICAgY29uc3QgaWQgPSBgJHt3aWR0aH0tJHtoZWlnaHR9YDsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgaWYgKHRyYW5zcGFyZW50QmxvYk1hcC5oYXMoaWQpKQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJhbnNwYXJlbnRCbG9iTWFwLmdldChpZCk7DQogICAgICAgICAgICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsNCiAgICAgICAgICAgICAgICBvZmZzY3JlZW4uZ2V0Q29udGV4dCgnMmQnKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0geWllbGQgYmxvYi5hcnJheUJ1ZmZlcigpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7DQogICAgICAgICAgICAgICAgdHJhbnNwYXJlbnRCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICByZXR1cm4gYmFzZTY0Ow0KICAgICAgICAgICAgfQ0KICAgICAgICAgICAgZWxzZSB7DQogICAgICAgICAgICAgICAgcmV0dXJuICcnOw0KICAgICAgICAgICAgfQ0KICAgICAgICB9KTsNCiAgICB9DQogICAgY29uc3Qgd29ya2VyID0gc2VsZjsNCiAgICB3b3JrZXIub25tZXNzYWdlID0gZnVuY3Rpb24gKGUpIHsNCiAgICAgICAgcmV0dXJuIF9fYXdhaXRlcih0aGlzLCB2b2lkIDAsIHZvaWQgMCwgZnVuY3Rpb24qICgpIHsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgY29uc3QgeyBpZCwgYml0bWFwLCB3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucyB9ID0gZS5kYXRhOw0KICAgICAgICAgICAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zKTsNCiAgICAgICAgICAgICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGN0eCA9IG9mZnNjcmVlbi5nZXRDb250ZXh0KCcyZCcpOw0KICAgICAgICAgICAgICAgIGN0eC5kcmF3SW1hZ2UoYml0bWFwLCAwLCAwKTsNCiAgICAgICAgICAgICAgICBiaXRtYXAuY2xvc2UoKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IHR5cGUgPSBibG9iLnR5cGU7DQogICAgICAgICAgICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSB5aWVsZCBibG9iLmFycmF5QnVmZmVyKCk7DQogICAgICAgICAgICAgICAgY29uc3QgYmFzZTY0ID0gZW5jb2RlKGFycmF5QnVmZmVyKTsNCiAgICAgICAgICAgICAgICBpZiAoIWxhc3RCbG9iTWFwLmhhcyhpZCkgJiYgKHlpZWxkIHRyYW5zcGFyZW50QmFzZTY0KSA9PT0gYmFzZTY0KSB7DQogICAgICAgICAgICAgICAgICAgIGxhc3RCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHdvcmtlci5wb3N0TWVzc2FnZSh7IGlkIH0pOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7DQogICAgICAgICAgICAgICAgd29ya2VyLnBvc3RNZXNzYWdlKHsNCiAgICAgICAgICAgICAgICAgICAgaWQsDQogICAgICAgICAgICAgICAgICAgIHR5cGUsDQogICAgICAgICAgICAgICAgICAgIGJhc2U2NCwNCiAgICAgICAgICAgICAgICAgICAgd2lkdGgsDQogICAgICAgICAgICAgICAgICAgIGhlaWdodCwNCiAgICAgICAgICAgICAgICB9KTsNCiAgICAgICAgICAgICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7DQogICAgICAgICAgICB9DQogICAgICAgICAgICBlbHNlIHsNCiAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsNCiAgICAgICAgICAgIH0NCiAgICAgICAgfSk7DQogICAgfTsKCn0pKCk7Cgo=",Un=null,Vn=!1,function(e){return Wn=Wn||Pn(Fn,Un,Vn),new Worker(Wn,e)});class qn{reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}constructor(e){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=(e,t)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)};const{sampling:t="all",win:n,blockClass:r,blockSelector:i,recordCanvas:s,dataURLOptions:o}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,s&&"all"===t&&this.initCanvasMutationObserver(n,r,i),s&&"number"==typeof t&&this.initCanvasFPSObserver(t,n,r,i,{dataURLOptions:o})}initCanvasFPSObserver(e,t,n,r,i){const s=Dn(t,n,r,!0),o=new Map,a=new Bn;a.onmessage=e=>{const{id:t}=e.data;if(o.set(t,!1),!("base64"in e.data))return;const{base64:n,type:r,width:i,height:s}=e.data;this.mutationCb({id:t,type:Kt["2D"],commands:[{property:"clearRect",args:[0,0,i,s]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:n}],type:r}]},0,0]}]})};const c=1e3/e;let l,u=0;const d=e=>{u&&e-u<c||(u=e,(()=>{const e=[];return t.document.querySelectorAll("canvas").forEach(t=>{Ot(t,n,r,!0)||e.push(t)}),e})().forEach(e=>kn(this,void 0,void 0,(function*(){var t;const n=this.mirror.getId(e);if(o.get(n))return;if(o.set(n,!0),["webgl","webgl2"].includes(e.__context)){const n=e.getContext(e.__context);!1===(null===(t=null==n?void 0:n.getContextAttributes())||void 0===t?void 0:t.preserveDrawingBuffer)&&n.clear(n.COLOR_BUFFER_BIT)}const r=yield createImageBitmap(e);a.postMessage({id:n,bitmap:r,width:e.width,height:e.height,dataURLOptions:i.dataURLOptions},[r])})))),l=requestAnimationFrame(d)};l=requestAnimationFrame(d),this.resetObservers=()=>{s(),cancelAnimationFrame(l)}}initCanvasMutationObserver(e,t,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const r=Dn(e,t,n,!1),i=function(e,t,n,r){const i=[],s=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const o of s)try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[o])continue;const s=Mt(t.CanvasRenderingContext2D.prototype,o,(function(i){return function(...s){return Ot(this.canvas,n,r,!0)||setTimeout(()=>{const n=Nn([...s],t,this);e(this.canvas,{type:Kt["2D"],property:o,args:n})},0),i.apply(this,s)}}));i.push(s)}catch(n){const r=Rt(t.CanvasRenderingContext2D.prototype,o,{set(t){e(this.canvas,{type:Kt["2D"],property:o,args:[t],setter:!0})}});i.push(r)}return()=>{i.forEach(e=>e())}}(this.processMutation.bind(this),e,t,n),s=function(e,t,n,r,i){const s=[];return s.push(...On(t.WebGLRenderingContext.prototype,Kt.WebGL,e,n,r,0,t)),void 0!==t.WebGL2RenderingContext&&s.push(...On(t.WebGL2RenderingContext.prototype,Kt.WebGL2,e,n,r,0,t)),()=>{s.forEach(e=>e())}}(this.processMutation.bind(this),e,t,n,this.mirror);this.resetObservers=()=>{r(),i(),s()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,t)=>{const n=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,n)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;const n=this.pendingCanvasMutations.get(e);if(!n||-1===t)return;const r=n.map(e=>function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(e,["type"])),{type:i}=n[0];this.mutationCb({id:t,type:i,commands:r}),this.pendingCanvasMutations.delete(e)}}class Gn{constructor(e){this.trackedLinkElements=new WeakSet,this.styleMirror=new Bt,this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(0===e.length)return;const n={id:t,styleIds:[]},r=[];for(const t of e){let e;if(this.styleMirror.has(t))e=this.styleMirror.getId(t);else{e=this.styleMirror.add(t);const n=Array.from(t.rules||CSSRule);r.push({styleId:e,rules:n.map((e,t)=>({rule:Xe(e),index:t}))})}n.styleIds.push(e)}r.length>0&&(n.styles=r),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class Hn{constructor(){this.nodeMap=new WeakMap,this.loop=!0,this.periodicallyClear()}periodicallyClear(){requestAnimationFrame(()=>{this.clear(),this.loop&&this.periodicallyClear()})}inOtherBuffer(e,t){const n=this.nodeMap.get(e);return n&&Array.from(n).some(e=>e!==t)}add(e,t){this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}clear(){this.nodeMap=new WeakMap}destroy(){this.loop=!1}}function jn(e){return Object.assign(Object.assign({},e),{timestamp:Lt()})}let zn,$n,Zn,Kn=!1;const Jn=new et;function Yn(e={}){const{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,deferProcessMutations:i=!1,blockClass:s="rr-block",blockSelector:o=null,ignoreClass:a="rr-ignore",ignoreSelector:c=null,maskTextClass:l="rr-mask",maskTextSelector:u=null,inlineStylesheet:d=!0,maskAllInputs:h,maskInputOptions:p,slimDOMOptions:g,maskInputFn:f,maskTextFn:m,hooks:v,packFn:y,sampling:b={},dataURLOptions:I={},mousemoveWait:C,recordCanvas:w=!1,recordCrossOriginIframes:S=!1,recordAfter:E=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:k=!1,collectFonts:A=!1,inlineImages:T=!1,plugins:_,keepIframeSrcFn:R=(()=>!1),ignoreCSSAttributes:M=new Set([]),errorHandler:L,ignoreIframes:N=!1}=e;sn(L);const x=!S||window.parent===window;let D=!1;if(!x)try{window.parent.document&&(D=!1)}catch(e){D=!0}if(x&&!t)throw new Error("emit function is required");void 0!==C&&void 0===b.mousemove&&(b.mousemove=C),Jn.reset();const O=!0===h?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0,hidden:!0}:void 0!==p?p:{password:!0},P=!0===g||"all"===g?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===g,headMetaDescKeywords:"all"===g}:g||{};let F;!function(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...e)=>{let t=e[0];if(!(0 in e))throw new TypeError("1 argument is required");do{if(this===t)return!0}while(t=t&&t.parentNode);return!1})}();let U=0;const V=e=>{for(const t of _||[])t.eventProcessor&&(e=t.eventProcessor(e));return y&&!D&&(e=y(e)),e};zn=(e,i)=>{var s;if(!(null===(s=cn[0])||void 0===s?void 0:s.isFrozen())||e.type===jt.FullSnapshot||e.type===jt.IncrementalSnapshot&&e.data.source===zt.Mutation||cn.forEach(e=>e.unfreeze()),x)null==t||t(V(e),i);else if(D){const t={type:"rrweb",event:V(e),origin:window.location.origin,isCheckout:i};window.parent.postMessage(t,"*")}if(e.type===jt.FullSnapshot)F=e,U=0;else if(e.type===jt.IncrementalSnapshot){if(e.data.source===zt.Mutation&&e.data.isAttachIframe)return;U++;const t=r&&U>=r,i=n&&e.timestamp-F.timestamp>n;(t||i)&&$n(!0)}};const W=e=>{zn(jn({type:jt.IncrementalSnapshot,data:Object.assign({source:zt.Mutation},e)}))},B=e=>zn(jn({type:jt.IncrementalSnapshot,data:Object.assign({source:zt.Scroll},e)})),q=e=>zn(jn({type:jt.IncrementalSnapshot,data:Object.assign({source:zt.CanvasMutation},e)})),G=new Gn({mutationCb:W,adoptedStyleSheetCb:e=>zn(jn({type:jt.IncrementalSnapshot,data:Object.assign({source:zt.AdoptedStyleSheet},e)}))}),H=new Sn({mirror:Jn,mutationCb:W,stylesheetManager:G,recordCrossOriginIframes:S,wrappedEmit:zn,ignoreIframes:N});for(const e of _||[])e.getMirror&&e.getMirror({nodeMirror:Jn,crossOriginIframeMirror:H.crossOriginIframeMirror,crossOriginIframeStyleMirror:H.crossOriginIframeStyleMirror});const j=new Hn;Zn=new qn({recordCanvas:w,mutationCb:q,win:window,blockClass:s,blockSelector:o,mirror:Jn,sampling:b.canvas,dataURLOptions:I});const z=new En({mutationCb:W,scrollCb:B,bypassOptions:{blockClass:s,blockSelector:o,deferProcessMutations:i,maskTextClass:l,maskTextSelector:u,inlineStylesheet:d,maskInputOptions:O,dataURLOptions:I,maskTextFn:m,maskInputFn:f,recordCanvas:w,inlineImages:T,sampling:b,slimDOMOptions:P,iframeManager:H,stylesheetManager:G,canvasManager:Zn,keepIframeSrcFn:R,processedNodeManager:j},mirror:Jn});$n=(e=!1)=>{zn(jn({type:jt.Meta,data:{href:window.location.href,width:Dt(),height:xt()}}),e),G.reset(),z.init(),cn.forEach(e=>e.lock());const t=function(e,t){var n,r,i=t||{},s=i.mirror,o=void 0===s?new et:s,a=i.blockClass,c=void 0===a?"rr-block":a,l=i.blockSelector,u=void 0===l?null:l,d=i.maskTextClass,h=void 0===d?"rr-mask":d,p=i.maskTextSelector,g=void 0===p?null:p,f=i.inlineStylesheet,m=void 0===f||f,v=i.inlineImages,y=void 0!==v&&v,b=i.recordCanvas,I=void 0!==b&&b,C=i.maskAllInputs,w=void 0!==C&&C,S=i.maskTextFn,E=i.maskInputFn,k=i.slimDOM,A=void 0!==k&&k,T=i.dataURLOptions,_=i.preserveWhiteSpace,R=i.onSerialize,M=i.onIframeLoad,L=i.iframeLoadTimeout,N=i.onStylesheetLoad,x=i.stylesheetLoadTimeout,D=i.keepIframeSrcFn,O=void 0===D?function(){return!1}:D,P=!0===w?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0,hidden:!0}:!1===w?{password:!0}:w,F=!0===A||"all"===A?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===A,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===A?{}:A;if("string"==typeof h){var U=e.querySelectorAll("."+h);if(n=!1,r=Array.from(U),g){var V=e.querySelectorAll(g);r=r.concat(Array.from(V))}}return Et(e,{doc:e,mirror:o,blockClass:c,blockSelector:u,maskTextClass:h,maskTextSelector:g,skipChild:!1,inlineStylesheet:m,maskInputOptions:P,maskTextFn:S,maskInputFn:E,slimDOMOptions:F,dataURLOptions:T,inlineImages:y,recordCanvas:I,preserveWhiteSpace:_,onSerialize:R,onIframeLoad:M,iframeLoadTimeout:L,onStylesheetLoad:N,stylesheetLoadTimeout:x,keepIframeSrcFn:O,newlyAddedElement:!1,maskCurrentNode:n,maskedElements:r})}(document,{mirror:Jn,blockClass:s,blockSelector:o,maskTextClass:l,maskTextSelector:u,inlineStylesheet:d,maskAllInputs:O,maskTextFn:m,maskInputFn:f,slimDOM:P,dataURLOptions:I,recordCanvas:w,inlineImages:T,onSerialize:e=>{Ut(e,Jn)&&H.addIframe(e),Vt(e,Jn)&&G.trackLinkElement(e),Wt(e)&&z.addShadowRoot(e.shadowRoot,document)},onIframeLoad:(e,t)=>{H.attachIframe(e,t),z.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{G.attachLinkElement(e,t)},keepIframeSrcFn:R});t&&(zn(jn({type:jt.FullSnapshot,data:{node:t,initialOffset:Nt(window)}}),e),cn.forEach(e=>e.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&G.adoptStyleSheets(document.adoptedStyleSheets,Jn.getId(document)))};try{const e=[],t=e=>{var t;return an(bn)({mutationCb:W,mousemoveCb:(e,t)=>zn(jn({type:jt.IncrementalSnapshot,data:{source:t,positions:e}})),mouseInteractionCb:e=>zn(jn({type:jt.IncrementalSnapshot,data:Object.assign({source:zt.MouseInteraction},e)})),scrollCb:B,viewportResizeCb:e=>zn(jn({type:jt.IncrementalSnapshot,data:Object.assign({source:zt.ViewportResize},e)})),inputCb:e=>zn(jn({type:jt.IncrementalSnapshot,data:Object.assign({source:zt.Input},e)})),mediaInteractionCb:e=>zn(jn({type:jt.IncrementalSnapshot,data:Object.assign({source:zt.MediaInteraction},e)})),styleSheetRuleCb:e=>zn(jn({type:jt.IncrementalSnapshot,data:Object.assign({source:zt.StyleSheetRule},e)})),styleDeclarationCb:e=>zn(jn({type:jt.IncrementalSnapshot,data:Object.assign({source:zt.StyleDeclaration},e)})),canvasMutationCb:q,fontCb:e=>zn(jn({type:jt.IncrementalSnapshot,data:Object.assign({source:zt.Font},e)})),selectionCb:e=>{zn(jn({type:jt.IncrementalSnapshot,data:Object.assign({source:zt.Selection},e)}))},blockClass:s,deferProcessMutations:i,ignoreClass:a,ignoreSelector:c,maskTextClass:l,maskTextSelector:u,maskInputOptions:O,inlineStylesheet:d,sampling:b,recordCanvas:w,inlineImages:T,userTriggeredOnInput:k,collectFonts:A,doc:e,maskInputFn:f,maskTextFn:m,keepIframeSrcFn:R,blockSelector:o,slimDOMOptions:P,dataURLOptions:I,mirror:Jn,iframeManager:H,stylesheetManager:G,shadowDomManager:z,processedNodeManager:j,canvasManager:Zn,ignoreCSSAttributes:M,plugins:(null===(t=null==_?void 0:_.filter(e=>e.observer))||void 0===t?void 0:t.map(e=>({observer:e.observer,options:e.options,callback:t=>zn(jn({type:jt.Plugin,data:{plugin:e.name,payload:t}}))})))||[]},v)};H.addLoadListener(n=>{try{e.push(t(n.contentDocument))}catch(e){}});const n=()=>{$n(),e.push(t(document)),Kn=!0};return"interactive"===document.readyState||"complete"===document.readyState?n():(e.push(At("DOMContentLoaded",()=>{zn(jn({type:jt.DomContentLoaded,data:{}})),"DOMContentLoaded"===E&&n()})),e.push(At("load",()=>{zn(jn({type:jt.Load,data:{}})),"load"===E&&n()},window))),()=>{e.forEach(e=>e()),j.destroy(),Kn=!1,on()}}catch(e){}}Yn.addCustomEvent=(e,t)=>{if(!Kn)throw new Error("please add custom event after start recording");zn(jn({type:jt.Custom,data:{tag:e,payload:t}}))},Yn.freezePage=()=>{cn.forEach(e=>e.freeze())},Yn.takeFullSnapshot=e=>{if(!Kn)throw new Error("please take full snapshot after start recording");$n(e)},Yn.mirror=Jn;const{addCustomEvent:Qn}=Yn,{freezePage:Xn}=Yn;var er=Uint8Array,tr=Uint16Array,nr=Uint32Array,rr=new er([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),ir=new er([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),sr=new er([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),or=function(e,t){for(var n=new tr(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];var i=new nr(n[30]);for(r=1;r<30;++r)for(var s=n[r];s<n[r+1];++s)i[s]=s-n[r]<<5|r;return[n,i]},ar=or(rr,2),cr=ar[0],lr=ar[1];cr[28]=258,lr[258]=28;for(var ur=or(ir,0),dr=(ur[0],ur[1]),hr=new tr(32768),pr=0;pr<32768;++pr){var gr=(43690&pr)>>>1|(21845&pr)<<1;gr=(61680&(gr=(52428&gr)>>>2|(13107&gr)<<2))>>>4|(3855&gr)<<4,hr[pr]=((65280&gr)>>>8|(255&gr)<<8)>>>1}var fr=function(e,t,n){for(var r=e.length,i=0,s=new tr(t);i<r;++i)++s[e[i]-1];var o,a=new tr(t);for(i=0;i<t;++i)a[i]=a[i-1]+s[i-1]<<1;if(n){o=new tr(1<<t);var c=15-t;for(i=0;i<r;++i)if(e[i])for(var l=i<<4|e[i],u=t-e[i],d=a[e[i]-1]++<<u,h=d|(1<<u)-1;d<=h;++d)o[hr[d]>>>c]=l}else for(o=new tr(r),i=0;i<r;++i)o[i]=hr[a[e[i]-1]++]>>>15-e[i];return o},mr=new er(288);for(pr=0;pr<144;++pr)mr[pr]=8;for(pr=144;pr<256;++pr)mr[pr]=9;for(pr=256;pr<280;++pr)mr[pr]=7;for(pr=280;pr<288;++pr)mr[pr]=8;var vr=new er(32);for(pr=0;pr<32;++pr)vr[pr]=5;var yr=fr(mr,9,0),br=fr(vr,5,0),Ir=function(e){return(e/8>>0)+(7&e&&1)},Cr=function(e,t,n){(null==t||t<0)&&(t=0),(null==n||n>e.length)&&(n=e.length);var r=new(e instanceof tr?tr:e instanceof nr?nr:er)(n-t);return r.set(e.subarray(t,n)),r},wr=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8},Sr=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8,e[r+2]|=n>>>16},Er=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var i=n.length,s=n.slice();if(!i)return[new er(0),0];if(1==i){var o=new er(n[0].s+1);return o[n[0].s]=1,[o,1]}n.sort((function(e,t){return e.f-t.f})),n.push({s:-1,f:25001});var a=n[0],c=n[1],l=0,u=1,d=2;for(n[0]={s:-1,f:a.f+c.f,l:a,r:c};u!=i-1;)a=n[n[l].f<n[d].f?l++:d++],c=n[l!=u&&n[l].f<n[d].f?l++:d++],n[u++]={s:-1,f:a.f+c.f,l:a,r:c};var h=s[0].s;for(r=1;r<i;++r)s[r].s>h&&(h=s[r].s);var p=new tr(h+1),g=kr(n[u-1],p,0);if(g>t){r=0;var f=0,m=g-t,v=1<<m;for(s.sort((function(e,t){return p[t.s]-p[e.s]||e.f-t.f}));r<i;++r){var y=s[r].s;if(!(p[y]>t))break;f+=v-(1<<g-p[y]),p[y]=t}for(f>>>=m;f>0;){var b=s[r].s;p[b]<t?f-=1<<t-p[b]++-1:++r}for(;r>=0&&f;--r){var I=s[r].s;p[I]==t&&(--p[I],++f)}g=t}return[new er(p),g]},kr=function(e,t,n){return-1==e.s?Math.max(kr(e.l,t,n+1),kr(e.r,t,n+1)):t[e.s]=n},Ar=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new tr(++t),r=0,i=e[0],s=1,o=function(e){n[r++]=e},a=1;a<=t;++a)if(e[a]==i&&a!=t)++s;else{if(!i&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(i),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(i);s=1,i=e[a]}return[n.subarray(0,r),t]},Tr=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},_r=function(e,t,n){var r=n.length,i=Ir(t+2);e[i]=255&r,e[i+1]=r>>>8,e[i+2]=255^e[i],e[i+3]=255^e[i+1];for(var s=0;s<r;++s)e[i+s+4]=n[s];return 8*(i+4+r)},Rr=function(e,t,n,r,i,s,o,a,c,l,u){wr(t,u++,n),++i[256];for(var d=Er(i,15),h=d[0],p=d[1],g=Er(s,15),f=g[0],m=g[1],v=Ar(h),y=v[0],b=v[1],I=Ar(f),C=I[0],w=I[1],S=new tr(19),E=0;E<y.length;++E)S[31&y[E]]++;for(E=0;E<C.length;++E)S[31&C[E]]++;for(var k=Er(S,7),A=k[0],T=k[1],_=19;_>4&&!A[sr[_-1]];--_);var R,M,L,N,x=l+5<<3,D=Tr(i,mr)+Tr(s,vr)+o,O=Tr(i,h)+Tr(s,f)+o+14+3*_+Tr(S,A)+(2*S[16]+3*S[17]+7*S[18]);if(x<=D&&x<=O)return _r(t,u,e.subarray(c,c+l));if(wr(t,u,1+(O<D)),u+=2,O<D){R=fr(h,p,0),M=h,L=fr(f,m,0),N=f;var P=fr(A,T,0);wr(t,u,b-257),wr(t,u+5,w-1),wr(t,u+10,_-4),u+=14;for(E=0;E<_;++E)wr(t,u+3*E,A[sr[E]]);u+=3*_;for(var F=[y,C],U=0;U<2;++U){var V=F[U];for(E=0;E<V.length;++E){var W=31&V[E];wr(t,u,P[W]),u+=A[W],W>15&&(wr(t,u,V[E]>>>5&127),u+=V[E]>>>12)}}}else R=yr,M=mr,L=br,N=vr;for(E=0;E<a;++E)if(r[E]>255){W=r[E]>>>18&31;Sr(t,u,R[W+257]),u+=M[W+257],W>7&&(wr(t,u,r[E]>>>23&31),u+=rr[W]);var B=31&r[E];Sr(t,u,L[B]),u+=N[B],B>3&&(Sr(t,u,r[E]>>>5&8191),u+=ir[B])}else Sr(t,u,R[r[E]]),u+=M[r[E]];return Sr(t,u,R[256]),u+M[256]},Mr=new nr([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Lr=new er(0),Nr=function(e,t,n,r,i){return function(e,t,n,r,i,s){var o=e.length,a=new er(r+o+5*(1+Math.floor(o/7e3))+i),c=a.subarray(r,a.length-i),l=0;if(!t||o<8)for(var u=0;u<=o;u+=65535){var d=u+65535;d<o?l=_r(c,l,e.subarray(u,d)):(c[u]=s,l=_r(c,l,e.subarray(u,o)))}else{for(var h=Mr[t-1],p=h>>>13,g=8191&h,f=(1<<n)-1,m=new tr(32768),v=new tr(f+1),y=Math.ceil(n/3),b=2*y,I=function(t){return(e[t]^e[t+1]<<y^e[t+2]<<b)&f},C=new nr(25e3),w=new tr(288),S=new tr(32),E=0,k=0,A=(u=0,0),T=0,_=0;u<o;++u){var R=I(u),M=32767&u,L=v[R];if(m[M]=L,v[R]=M,T<=u){var N=o-u;if((E>7e3||A>24576)&&N>423){l=Rr(e,c,0,C,w,S,k,A,_,u-_,l),A=E=k=0,_=u;for(var x=0;x<286;++x)w[x]=0;for(x=0;x<30;++x)S[x]=0}var D=2,O=0,P=g,F=M-L&32767;if(N>2&&R==I(u-F))for(var U=Math.min(p,N)-1,V=Math.min(32767,u),W=Math.min(258,N);F<=V&&--P&&M!=L;){if(e[u+D]==e[u+D-F]){for(var B=0;B<W&&e[u+B]==e[u+B-F];++B);if(B>D){if(D=B,O=F,B>U)break;var q=Math.min(F,B-2),G=0;for(x=0;x<q;++x){var H=u-F+x+32768&32767,j=H-m[H]+32768&32767;j>G&&(G=j,L=H)}}}F+=(M=L)-(L=m[M])+32768&32767}if(O){C[A++]=268435456|lr[D]<<18|dr[O];var z=31&lr[D],$=31&dr[O];k+=rr[z]+ir[$],++w[257+z],++S[$],T=u+D,++E}else C[A++]=e[u],++w[e[u]]}}l=Rr(e,c,s,C,w,S,k,A,_,u-_,l),s||(l=_r(c,l,Lr))}return Cr(a,0,r+Ir(l)+i)}(e,null==t.level?6:t.level,null==t.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,n,r,!i)};function xr(e,t){void 0===t&&(t={});var n=function(){var e=1,t=0;return{p:function(n){for(var r=e,i=t,s=n.length,o=0;o!=s;){for(var a=Math.min(o+5552,s);o<a;++o)i+=r+=n[o];r%=65521,i%=65521}e=r,t=i},d:function(){return(e>>>8<<16|(255&t)<<8|t>>>8)+2*((255&e)<<23)}}}();n.p(e);var r=Nr(e,t,2,4);return function(e,t){var n=t.level,r=0==n?0:n<6?1:9==n?3:2;e[0]=120,e[1]=r<<6|(r?32-2*r:1)}(r,t),function(e,t,n){for(;n;++t)e[t]=n,n>>>=8}(r,r.length-4,n.d()),r}const Dr=(e,t)=>{const n=Object.assign(Object.assign({},e),{v:"v1"});return function(e,t){var n="";if(!t&&"undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);for(var r=0;r<e.length;){var i=e[r++];i<128||t?n+=String.fromCharCode(i):i<224?n+=String.fromCharCode((31&i)<<6|63&e[r++]):i<240?n+=String.fromCharCode((15&i)<<12|(63&e[r++])<<6|63&e[r++]):(i=((15&i)<<18|(63&e[r++])<<12|(63&e[r++])<<6|63&e[r++])-65536,n+=String.fromCharCode(55296|i>>10,56320|1023&i))}return n}(xr(function(e,t){var n=e.length;if(!t&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var r=new er(e.length+(e.length>>>1)),i=0,s=function(e){r[i++]=e},o=0;o<n;++o){if(i+5>r.length){var a=new er(i+8+(n-o<<1));a.set(r),r=a}var c=e.charCodeAt(o);c<128||t?s(c):c<2048?(s(192|c>>>6),s(128|63&c)):c>55295&&c<57344?(s(240|(c=65536+(1047552&c)|1023&e.charCodeAt(++o))>>>18),s(128|c>>>12&63),s(128|c>>>6&63),s(128|63&c)):(s(224|c>>>12),s(128|c>>>6&63),s(128|63&c))}return Cr(r,0,i)}(JSON.stringify(n)),t),!0)};var Or,Pr,Fr,Ur=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},Vr=function(e){if("loading"===document.readyState)return"loading";var t=Ur();if(t){if(e<t.domInteractive)return"loading";if(0===t.domContentLoadedEventStart||e<t.domContentLoadedEventStart)return"dom-interactive";if(0===t.domComplete||e<t.domComplete)return"dom-content-loaded"}return"complete"},Wr=function(e){var t=e.nodeName;return 1===e.nodeType?t.toLowerCase():t.toUpperCase().replace(/^#/,"")},Br=function(e,t){var n="";try{for(;e&&9!==e.nodeType;){var r=e,i=r.id?"#"+r.id:Wr(r)+(r.classList&&r.classList.value&&r.classList.value.trim()&&r.classList.value.trim().length?"."+r.classList.value.trim().replace(/\s+/g,"."):"");if(n.length+i.length>(t||100)-1)return n||i;if(n=n?i+">"+n:i,r.id)break;e=r.parentNode}}catch(e){}return n},qr=-1,Gr=function(){return qr},Hr=function(e){addEventListener("pageshow",(function(t){t.persisted&&(qr=t.timeStamp,e(t))}),!0)},jr=function(){var e=Ur();return e&&e.activationStart||0},zr=function(e,t){var n=Ur(),r="navigate";return Gr()>=0?r="back-forward-cache":n&&(document.prerendering||jr()>0?r="prerender":document.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:e,value:void 0===t?-1:t,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:r}},$r=function(e,t,n){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var r=new PerformanceObserver((function(e){Promise.resolve().then((function(){t(e.getEntries())}))}));return r.observe(Object.assign({type:e,buffered:!0},n||{})),r}}catch(e){}},Zr=function(e,t,n,r){var i,s;return function(o){t.value>=0&&(o||r)&&((s=t.value-(i||0))||void 0===i)&&(i=t.value,t.delta=s,t.rating=function(e,t){return e>t[1]?"poor":e>t[0]?"needs-improvement":"good"}(t.value,n),e(t))}},Kr=function(e){requestAnimationFrame((function(){return requestAnimationFrame((function(){return e()}))}))},Jr=function(e){document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e()}))},Yr=function(e){var t=!1;return function(){t||(e(),t=!0)}},Qr=-1,Xr=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},ei=function(e){"hidden"===document.visibilityState&&Qr>-1&&(Qr="visibilitychange"===e.type?e.timeStamp:0,ni())},ti=function(){addEventListener("visibilitychange",ei,!0),addEventListener("prerenderingchange",ei,!0)},ni=function(){removeEventListener("visibilitychange",ei,!0),removeEventListener("prerenderingchange",ei,!0)},ri=function(){return Qr<0&&(Qr=Xr(),ti(),Hr((function(){setTimeout((function(){Qr=Xr(),ti()}),0)}))),{get firstHiddenTime(){return Qr}}},ii=function(e){document.prerendering?addEventListener("prerenderingchange",(function(){return e()}),!0):e()},si=[1800,3e3],oi=function(e,t){t=t||{},ii((function(){var n,r=ri(),i=zr("FCP"),s=$r("paint",(function(e){e.forEach((function(e){"first-contentful-paint"===e.name&&(s.disconnect(),e.startTime<r.firstHiddenTime&&(i.value=Math.max(e.startTime-jr(),0),i.entries.push(e),n(!0)))}))}));s&&(n=Zr(e,i,si,t.reportAllChanges),Hr((function(r){i=zr("FCP"),n=Zr(e,i,si,t.reportAllChanges),Kr((function(){i.value=performance.now()-r.timeStamp,n(!0)}))})))}))},ai=[.1,.25],ci=function(e,t){!function(e,t){t=t||{},oi(Yr((function(){var n,r=zr("CLS",0),i=0,s=[],o=function(e){e.forEach((function(e){if(!e.hadRecentInput){var t=s[0],n=s[s.length-1];i&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(i+=e.value,s.push(e)):(i=e.value,s=[e])}})),i>r.value&&(r.value=i,r.entries=s,n())},a=$r("layout-shift",o);a&&(n=Zr(e,r,ai,t.reportAllChanges),Jr((function(){o(a.takeRecords()),n(!0)})),Hr((function(){i=0,r=zr("CLS",0),n=Zr(e,r,ai,t.reportAllChanges),Kr((function(){return n()}))})),setTimeout(n,0))})))}((function(t){var n=function(e){var t,n={};if(e.entries.length){var r=e.entries.reduce((function(e,t){return e&&e.value>t.value?e:t}));if(r&&r.sources&&r.sources.length){var i=(t=r.sources).find((function(e){return e.node&&1===e.node.nodeType}))||t[0];i&&(n={largestShiftTarget:Br(i.node),largestShiftTime:r.startTime,largestShiftValue:r.value,largestShiftSource:i,largestShiftEntry:r,loadState:Vr(r.startTime)})}}return Object.assign(e,{attribution:n})}(t);e(n)}),t)},li=function(e,t){oi((function(t){var n=function(e){var t={timeToFirstByte:0,firstByteToFCP:e.value,loadState:Vr(Gr())};if(e.entries.length){var n=Ur(),r=e.entries[e.entries.length-1];if(n){var i=n.activationStart||0,s=Math.max(0,n.responseStart-i);t={timeToFirstByte:s,firstByteToFCP:e.value-s,loadState:Vr(e.entries[0].startTime),navigationEntry:n,fcpEntry:r}}}return Object.assign(e,{attribution:t})}(t);e(n)}),t)},ui=0,di=1/0,hi=0,pi=function(e){e.forEach((function(e){e.interactionId&&(di=Math.min(di,e.interactionId),hi=Math.max(hi,e.interactionId),ui=hi?(hi-di)/7+1:0)}))},gi=function(){"interactionCount"in performance||Or||(Or=$r("event",pi,{type:"event",buffered:!0,durationThreshold:0}))},fi=[],mi=new Map,vi=0,yi=function(){return(Or?ui:performance.interactionCount||0)-vi},bi=[],Ii=function(e){if(bi.forEach((function(t){return t(e)})),e.interactionId||"first-input"===e.entryType){var t=fi[fi.length-1],n=mi.get(e.interactionId);if(n||fi.length<10||e.duration>t.latency){if(n)e.duration>n.latency?(n.entries=[e],n.latency=e.duration):e.duration===n.latency&&e.startTime===n.entries[0].startTime&&n.entries.push(e);else{var r={id:e.interactionId,latency:e.duration,entries:[e]};mi.set(r.id,r),fi.push(r)}fi.sort((function(e,t){return t.latency-e.latency})),fi.length>10&&fi.splice(10).forEach((function(e){return mi.delete(e.id)}))}}},Ci=function(e){var t=self.requestIdleCallback||self.setTimeout,n=-1;return e=Yr(e),"hidden"===document.visibilityState?e():(n=t(e),Jr(e)),n},wi=[200,500],Si=[],Ei=new Map,ki=[],Ai=new WeakMap,Ti=new Map,_i=-1,Ri=function(e){Si=Si.concat(e),Mi()},Mi=function(){_i<0&&(_i=Ci(Li))},Li=function(){Ti.size>10&&Ti.forEach((function(e,t){mi.has(t)||Ti.delete(t)})),ki=ki.slice(-50);var e=new Set(ki.concat(fi.map((function(e){return Ai.get(e.entries[0])}))));Ei.forEach((function(t,n){e.has(n)||Ei.delete(n)}));var t=new Set;Ei.forEach((function(e){Pi(e.startTime,e.processingEnd).forEach((function(e){t.add(e)}))}));for(var n=0;n<50;n++){var r=Si[Si.length-1-n];if(!r||r.startTime<Fr)break;t.add(r)}Si=Array.from(t),_i=-1};bi.push((function(e){e.interactionId&&e.target&&!Ti.has(e.interactionId)&&Ti.set(e.interactionId,e.target)}),(function(e){var t,n=e.startTime+e.duration;Fr=Math.max(Fr,e.processingEnd);for(var r=ki.length-1;r>=0;r--)if(t=ki[r],Math.abs(n-t)<=8){var i=Ei.get(t);i.startTime=Math.min(e.startTime,i.startTime),i.processingStart=Math.min(e.processingStart,i.processingStart),i.processingEnd=Math.max(e.processingEnd,i.processingEnd),i.entries.push(e),n=t;break}n!==t&&(ki.push(n),Ei.set(n,{startTime:e.startTime,processingStart:e.processingStart,processingEnd:e.processingEnd,entries:[e]})),(e.interactionId||"first-input"===e.entryType)&&Ai.set(e,n),Mi()}));var Ni,xi,Di,Oi,Pi=function(e,t){for(var n,r=[],i=0;n=Si[i];i++)if(!(n.startTime+n.duration<e)){if(n.startTime>t)break;r.push(n)}return r},Fi=function(e,t){Pr||(Pr=$r("long-animation-frame",Ri)),function(e,t){"PerformanceEventTiming"in self&&"interactionId"in PerformanceEventTiming.prototype&&(t=t||{},ii((function(){var n;gi();var r,i=zr("INP"),s=function(e){Ci((function(){e.forEach(Ii);var t,n=(t=Math.min(fi.length-1,Math.floor(yi()/50)),fi[t]);n&&n.latency!==i.value&&(i.value=n.latency,i.entries=n.entries,r())}))},o=$r("event",s,{durationThreshold:null!==(n=t.durationThreshold)&&void 0!==n?n:40});r=Zr(e,i,wi,t.reportAllChanges),o&&(o.observe({type:"first-input",buffered:!0}),Jr((function(){s(o.takeRecords()),r(!0)})),Hr((function(){vi=0,fi.length=0,mi.clear(),i=zr("INP"),r=Zr(e,i,wi,t.reportAllChanges)})))})))}((function(t){var n=function(e){var t=e.entries[0],n=Ai.get(t),r=Ei.get(n),i=t.processingStart,s=r.processingEnd,o=r.entries.sort((function(e,t){return e.processingStart-t.processingStart})),a=Pi(t.startTime,s),c=e.entries.find((function(e){return e.target})),l=c&&c.target||Ti.get(t.interactionId),u=[t.startTime+t.duration,s].concat(a.map((function(e){return e.startTime+e.duration}))),d=Math.max.apply(Math,u),h={interactionTarget:Br(l),interactionTargetElement:l,interactionType:t.name.startsWith("key")?"keyboard":"pointer",interactionTime:t.startTime,nextPaintTime:d,processedEventEntries:o,longAnimationFrameEntries:a,inputDelay:i-t.startTime,processingDuration:s-i,presentationDelay:Math.max(d-s,0),loadState:Vr(t.startTime)};return Object.assign(e,{attribution:h})}(t);e(n)}),t)},Ui=[2500,4e3],Vi={},Wi=function(e,t){!function(e,t){t=t||{},ii((function(){var n,r=ri(),i=zr("LCP"),s=function(e){t.reportAllChanges||(e=e.slice(-1)),e.forEach((function(e){e.startTime<r.firstHiddenTime&&(i.value=Math.max(e.startTime-jr(),0),i.entries=[e],n())}))},o=$r("largest-contentful-paint",s);if(o){n=Zr(e,i,Ui,t.reportAllChanges);var a=Yr((function(){Vi[i.id]||(s(o.takeRecords()),o.disconnect(),Vi[i.id]=!0,n(!0))}));["keydown","click"].forEach((function(e){addEventListener(e,(function(){return Ci(a)}),!0)})),Jr(a),Hr((function(r){i=zr("LCP"),n=Zr(e,i,Ui,t.reportAllChanges),Kr((function(){i.value=performance.now()-r.timeStamp,Vi[i.id]=!0,n(!0)}))}))}}))}((function(t){var n=function(e){var t={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:e.value};if(e.entries.length){var n=Ur();if(n){var r=n.activationStart||0,i=e.entries[e.entries.length-1],s=i.url&&performance.getEntriesByType("resource").filter((function(e){return e.name===i.url}))[0],o=Math.max(0,n.responseStart-r),a=Math.max(o,s?(s.requestStart||s.startTime)-r:0),c=Math.max(a,s?s.responseEnd-r:0),l=Math.max(c,i.startTime-r);t={element:Br(i.element),timeToFirstByte:o,resourceLoadDelay:a-o,resourceLoadDuration:c-a,elementRenderDelay:l-c,navigationEntry:n,lcpEntry:i},i.url&&(t.url=i.url),s&&(t.lcpResourceEntry=s)}}return Object.assign(e,{attribution:t})}(t);e(n)}),t)},Bi=[800,1800],qi=function(e,t){t=t||{};var n=zr("TTFB"),r=Zr(e,n,Bi,t.reportAllChanges);!function e(t){document.prerendering?ii((function(){return e(t)})):"complete"!==document.readyState?addEventListener("load",(function(){return e(t)}),!0):setTimeout(t,0)}((function(){var i=Ur();i&&(n.value=Math.max(i.responseStart-jr(),0),n.entries=[i],r(!0),Hr((function(){n=zr("TTFB",0),(r=Zr(e,n,Bi,t.reportAllChanges))(!0)})))}))},Gi=function(e,t){qi((function(t){var n=function(e){var t={waitingDuration:0,cacheDuration:0,dnsDuration:0,connectionDuration:0,requestDuration:0};if(e.entries.length){var n=e.entries[0],r=n.activationStart||0,i=Math.max((n.workerStart||n.fetchStart)-r,0),s=Math.max(n.domainLookupStart-r,0),o=Math.max(n.connectStart-r,0),a=Math.max(n.connectEnd-r,0);t={waitingDuration:i,cacheDuration:s-i,dnsDuration:o-s,connectionDuration:a-o,requestDuration:e.value-a,navigationEntry:n}}return Object.assign(e,{attribution:t})}(t);e(n)}),t)},Hi={passive:!0,capture:!0},ji=new Date,zi=function(e,t){Ni||(Ni=t,xi=e,Di=new Date,Ki(removeEventListener),$i())},$i=function(){if(xi>=0&&xi<Di-ji){var e={entryType:"first-input",name:Ni.type,target:Ni.target,cancelable:Ni.cancelable,startTime:Ni.timeStamp,processingStart:Ni.timeStamp+xi};Oi.forEach((function(t){t(e)})),Oi=[]}},Zi=function(e){if(e.cancelable){var t=(e.timeStamp>1e12?new Date:performance.now())-e.timeStamp;"pointerdown"==e.type?function(e,t){var n=function(){zi(e,t),i()},r=function(){i()},i=function(){removeEventListener("pointerup",n,Hi),removeEventListener("pointercancel",r,Hi)};addEventListener("pointerup",n,Hi),addEventListener("pointercancel",r,Hi)}(t,e):zi(t,e)}},Ki=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach((function(t){return e(t,Zi,Hi)}))},Ji=[100,300],Yi=function(e,t){!function(e,t){t=t||{},ii((function(){var n,r=ri(),i=zr("FID"),s=function(e){e.startTime<r.firstHiddenTime&&(i.value=e.processingStart-e.startTime,i.entries.push(e),n(!0))},o=function(e){e.forEach(s)},a=$r("first-input",o);n=Zr(e,i,Ji,t.reportAllChanges),a&&(Jr(Yr((function(){o(a.takeRecords()),a.disconnect()}))),Hr((function(){var r;i=zr("FID"),n=Zr(e,i,Ji,t.reportAllChanges),Oi=[],xi=-1,Ni=null,Ki(addEventListener),r=s,Oi.push(r),$i()})))}))}((function(t){var n=function(e){var t=e.entries[0],n={eventTarget:Br(t.target),eventType:t.name,eventTime:t.startTime,eventEntry:t,loadState:Vr(t.startTime)};return Object.assign(e,{attribution:n})}(t);e(n)}),t)},Qi=n(181),Xi=n.n(Qi);const es=(e,t)=>{const n=-1!==e.indexOf("safari-extension"),r=-1!==e.indexOf("safari-web-extension");return n||r?[-1!==e.indexOf("@")?e.split("@")[0]:"<unknown>",n?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]};function ts(e,t,n,r){const i={file:e,mname:t};return void 0!==n&&(i.line=n),void 0!==r&&(i.column=r),i}const ns=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,rs=/\((\S*)(?::(\d+))(?::(\d+))\)/,is=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,ss=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,os=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i,as=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,cs=/ line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^)]+))\(.*\))? in (.*):\s*$/i;function ls(e,t=!1){const n=e.split("\n");return n.length>50?[]:n.reduce((function(e,n,r){if(n.length>1024)return e;const i=(e=>{const t=as.exec(e);return t?ts(t[2],t[3]||"<unknown>",+t[1]):void 0})(n)||(e=>{const t=cs.exec(e);return t?ts(t[5],t[3]||t[4]||"<unknown>",+t[1],+t[2]):void 0})(n)||(e=>{const t=ns.exec(e);if(t){if(t[2]&&0===t[2].indexOf("eval")){const e=rs.exec(t[2]);e&&(t[2]=e[1],t[3]=e[2],t[4]=e[3])}const[e,n]=es(t[1]||"<unknown>",t[2]);return ts(n,e,t[3]?+t[3]:void 0,t[4]?+t[4]:void 0)}})(n)||(e=>{const t=os.exec(e);return t?ts(t[2],t[1]||"<unknown>",+t[3],t[4]?+t[4]:void 0):void 0})(n)||(e=>{const t=is.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const e=ss.exec(t[3]);e&&(t[1]=t[1]||"eval",t[3]=e[1],t[4]=e[2],t[5]="")}let e=t[3],n=t[1]||"<unknown>";return[n,e]=es(n,e),ts(e,n,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}})(n);return i&&(t?e.push(Object.assign(Object.assign({},i),{_frameLocationIndexInOrigString:r})):e.push(i)),e}),[])}let us,ds,hs=null,ps=null,gs=!1;function fs(){ms(),ps&&(window.clearTimeout(ps),ps=null),gs&&(gs=!1,document.removeEventListener("readystatechange",bs))}function ms(){hs&&(window.clearTimeout(hs),hs=null)}function vs(){fs(),ds(!1)}function ys(){fs(),ds(!0)}function bs(){switch(document.readyState){case"complete":fs(),ds(!0);break;case"interactive":ms(),ps=window.setTimeout(ys,0);break;case"loading":hs=window.setTimeout(vs,5e3);break;default:fs(),ds(!1)}}function Is(){return"undefined"==typeof window?Promise.resolve(!0):(!us&&window.NOIBUJS_DOCUMENT_READY_PROMISE instanceof Promise&&(us=window.NOIBUJS_DOCUMENT_READY_PROMISE),us||(us=new Promise(e=>{ds=e,"complete"!==document.readyState&&(gs=!0,document.addEventListener("readystatechange",bs)),bs()}),window.NOIBUJS_DOCUMENT_READY_PROMISE=us,us))}const Cs=(e,t,n)=>{if(!("object"==typeof e&&null!==e))return!1;if(!(t in e))return!1;const r=e[t];if(r&&r.__noibu_wrapped__)return!0;const i=Object.getOwnPropertyDescriptor(e,t);if(i&&!1===i.writable)return!1;const s=n(r);if("function"==typeof s)try{s.prototype=s.prototype||{},Object.defineProperties(s,{__noibu__:{enumerable:!1,value:!0},__noibu_original__:{enumerable:!1,value:r},__noibu_wrapped__:{enumerable:!1,value:s}})}catch(e){}return e[t]=s,!0};const ws=e=>{if(!function(e){if(!e)return!1;try{return"function"==typeof e[Symbol.iterator]}catch(e){return!1}}(e))return{};const t={};try{for(const[n,r]of e)t[n]=r}catch(e){}return t};function Ss(e,t,n){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(e,t,{set(e){r.set.call(this,n(e))}})}function Es(e){return e&&e.__noibu_original__||e}function ks(e,t=1024){return"string"!=typeof e?"":e.length<t?e:e.substring(0,t)}function As(e,t=1){try{return ls(e).length>t}catch(e){return!1}}function Ts(e){if(!e)return"";return function(e){if(As(e)){const t=ls(e,!0),n=e.split("\n"),r=Object.fromEntries(t.map(e=>[e._frameLocationIndexInOrigString,!0]));return n.filter((e,t)=>!r[t]).join("\n")}return e}(ks(e)).replace(S,"$1$2$3'*'").replace(I,"******")}function _s(e){return qs(e)?new URL(e).host:""}function Rs(e,t){const n=new URL(e);Object.assign(n,t);let r=n.toString();return t.protocol&&t.protocol!==n.protocol&&(r=`${t.protocol}:${r.slice(n.protocol.length)}`),r}function Ms(){var e,t,n,r,i;if("undefined"!=typeof noibuShopifyProxy){const{api:e}=noibuShopifyProxy;return e.init.context.window.location.href}let s=null===(e=self.location)||void 0===e?void 0:e.href;return s?(!s.startsWith("http")&&(null===(i=null===(r=null===(n=null===(t=self.parent)||void 0===t?void 0:t.location)||void 0===n?void 0:n.href)||void 0===r?void 0:r.startsWith)||void 0===i?void 0:i.call(r,"http"))&&(s=self.parent.location.href),ks(s)):""}function Ls(e){return e.map(e=>{const t={line:"_",mname:"_",file:"_"};return e.line&&Number.isInteger(e.line)&&(t.line=String(e.line)),e.mname&&"<unknown>"!==e.mname&&(t.mname=String(e.mname)),e.file&&"<unknown>"!==e.file&&(t.file=String(e.file)),e.column&&Number.isInteger(e.column)&&(t.column=e.column),t})}function Ns(e,t=!0){let n=[{line:"_",mname:"_",file:"_"}];if("object"!=typeof e||!e)return{frames:n,msg:""};const r=e;if(r.stack)n=Ls(ls(r.stack));else{const t=e;t.fileName&&"string"==typeof t.fileName&&(n[0].file=t.fileName),t.lineNumber&&(n[0].line=String(t.lineNumber)),t.columnNumber&&Number.isInteger(t.columnNumber)&&(n[0].column=t.columnNumber)}n.length>=50&&(n=n.slice(0,50));const i={frames:(s=n,s?s.filter(e=>!e.mname.toLowerCase().includes("nbuwrapper")):[]),msg:Ts(r.message)};var s;return e.cause&&(i.cause=function(e){if(!Array.isArray(e))return[];const t=e.filter(e=>[D,O,x,N,L,P].every(t=>"string"==typeof e[t]));return t.length?t:[]}(e.cause)),t&&i.cause&&delete i.cause,i}function xs(e){let t="";try{e&&e.stack&&(t=`(stack: ${e.stack})`)}catch(e){}return t}function Ds(e){const t=[];try{const n=JSON.stringify(e,(function(e,n){try{if("object"!=typeof n||null===n)return n;if("undefined"!=typeof Node&&n instanceof Node)return{};for(;t.length>0&&t[t.length-1]!==this;)t.pop();return t.includes(n)?{}:(t.push(n),n)}catch(e){return{}}}));return void 0===n?"null":n}catch(e){return"{}"}}function Os(e){if(Array.prototype.toJSON){const t=Array.prototype.toJSON;delete Array.prototype.toJSON;const n=Ds(e);return Array.prototype.toJSON=t,n}return Ds(e)}function Ps(e){const t=e;if(t.className){const n=typeof t.className;if("string"===n)return t.className;if("object"===n&&"baseVal"in e.className)return e.className.baseVal}return""}function Fs(e){return"string"==typeof e.id?e.id:""}function Us(e){return e?"object"==typeof e?Os(e):String(e):""}function Vs(e,t,n,r=!1,i=0){const s=Es(self.fetch);if(!s)return Promise.resolve();const o={method:"POST",headers:n,body:Us(t),keepalive:r};let a=0;const c="function"==typeof AbortController;if(i&&c){const e=new AbortController;o.signal=e.signal,a=self.setTimeout(()=>e.abort(),i)}const l=s(e,o);return a&&l.finally(()=>self.clearTimeout(a)),l}function Ws(){const e=le();return function(){const e=le();return e.http_re&&Array.isArray(e.http_re)}()?e.http_re:[]}function Bs(){const e=le(),t=[".noibu-blocked",".creditCard"];return function(){const e=le();return e.sel&&Array.isArray(e.sel)}()&&t.push(...e.sel),""+t.join(",")}function qs(e=""){if("function"==typeof URL.canParse)return URL.canParse(e);try{return new URL(e),!0}catch(e){return!1}}function Gs(){return function(e){var t;let n=e;return n||(n=null===(t=null===self||void 0===self?void 0:self.navigator)||void 0===t?void 0:t.userAgent),"string"==typeof n&&("sfra.sfcc.noibu.com"!==le().domain&&(n=n.toLowerCase(),new RegExp("(bot|crawl(er)?|sp(i|y)der|search|worm|fetch|nutch|headless|baidu|teoma|yandex|woorankreview|pingdom|synthetic|dataprovider|qaautomation|morningscore|wappalyzer|foregenix|StatusCake|SpeedCurve|Outlook-iOS|bitdiscovery|testing|webflow|bingpreview|(r|R)igor|facebookexternalhit/\\d+\\.\\d+)","i").test(n)))}(null)}function Hs(e){return"string"!=typeof e?"":e.trim()}function js(e,t=!1){let n=Ms();if(t&&!qs(e))n=Rs(n,{pathname:e});else{const t=Hs(e);t&&"undefined"!==t&&(n=e)}return ks(n)}function zs(e,t){try{return"function"==typeof t&&e instanceof t}catch(e){return!1}}function $s(e){return"string"==typeof e||e instanceof String}function Zs(e,t,n){Is().then(()=>{try{const r=document.createElement("script");r.setAttribute("src",e),r.setAttribute("async","true"),"function"==typeof n&&(r.onerror=n),"function"==typeof t&&(r.onload=t),setTimeout(()=>{document.body.appendChild(r)})}catch(e){n(e)}})}function Ks(){return"object"==typeof window}function Js(e,t=null){try{return e()}catch(e){return"function"==typeof t?t(e):t}}class Ys{constructor(e){this._provider=e}static isAvailable(e){let t=!0,n=null;try{const t=e();if(!t||!t.setItem||!t.removeItem)return{result:!1,error:"provider is nullish"};t.setItem("n_key",0),t.removeItem("n_key")}catch(e){t=!1,n=e}return{result:t,error:n}}load(e){return this._provider.getItem(e)}loadWithExpiry(e){const t=this.load(e);if(!t)return null;const n=JSON.parse(t);return Date.now()>n.expiry?(this.remove(e),null):n.value}updateExpiry(e,t){const n=this.load(e);if(!n)return;const r=JSON.parse(n);r.expiry=Date.now()+t,this.save(e,JSON.stringify(r))}save(e,t){this._provider.setItem(e,t)}saveWithExpiry(e,t,n){const r={value:t,expiry:Date.now()+n};this.save(e,Os(r))}remove(e){this._provider.removeItem(e)}calculateUsedSize(){let e=0;for(let t=0;t<this._provider.length;t++){const n=this._provider.key(t);if(n){e+=n.length;const t=this._provider.getItem(n);t&&(e+=t.length)}}return e}}class Qs extends Ys{constructor(){super(window.localStorage)}static isAvailable(){return Ys.isAvailable(()=>window.localStorage)}}class Xs extends Ys{constructor(){super(window.sessionStorage)}static isAvailable(){return Ys.isAvailable(()=>window.sessionStorage)}}class eo{constructor(){const e=Qs.isAvailable(),t=Xs.isAvailable();this._isLocalStorageAvailable=e.result,this._isSessionStorageAvailable=t.result,this._localStorageError=e.error,this._sessionStorageError=t.error,this._provider=null,this._type="unavailable",this._isLocalStorageAvailable?(this._provider=new Qs,this._type="LocalStorage"):this._isSessionStorageAvailable&&(this._provider=new Xs,this._type="SessionStorage")}static getInstance(){return this._instance||(this._instance=new eo),this._instance}isAvailable(){return null!=this._provider}load(e){return this.isAvailable()?this._provider.load(e):null}loadWithExpiry(e){return this.isAvailable()?this._provider.loadWithExpiry(e):null}save(e,t){this.isAvailable()&&this._provider.save(e,t)}saveWithExpiry(e,t,n){this.isAvailable()&&this._provider.saveWithExpiry(e,t,n)}updateExpiry(e,t){this.isAvailable()&&this._provider.updateExpiry(e,t)}remove(e){this.isAvailable()&&this._provider.remove(e)}calculateUsedSize(){return this.isAvailable()?this._provider.calculateUsedSize():0}getDiagnoseInfo(){return{storageProvider:this._type,localStorageAvailable:this._isLocalStorageAvailable,localStorageError:this._localStorageError,sessionStorageAvailable:this._isSessionStorageAvailable,sessionStorageError:this._sessionStorageError,storageUsedSize:this.calculateUsedSize()}}}class to{static get scriptInitializeTime(){return this._scriptInitializeTime}static get recordingStartTime(){return this._recordingStartTime}static get recordingStopTime(){return this._recordingStopTime}static setScriptInitializeTime(){null===this._scriptInitializeTime&&(this._scriptInitializeTime=performance.now())}static setRecordingStartTime(){null===this._recordingStartTime&&(this._recordingStartTime=performance.now())}static setRecordingStopTime(){null===this._recordingStopTime&&(this._recordingStopTime=performance.now())}static resetScriptTimeline(){this._scriptInitializeTime=null,this._recordingStartTime=null,this._recordingStopTime=null}}function no(){return!("now"in Date)||("number"!=typeof Date.now()||(!("toISOString"in new Date)||"string"!=typeof(new Date).toISOString()))}function ro(e){if("number"!=typeof e&&no()){if(Date.prototype.hasOwnProperty("valueOf")&&"function"==typeof e.valueOf&&"number"==typeof e.valueOf())return e.valueOf();oo.getInstance().postNoibuErrorAndOptionallyDisableClient("The date object has been overwritten and can't be processed properly.\nClient has been disabled.",!0,E,!0)}return e}function io(e){return!(e instanceof Date)||isNaN(e.getTime())}to._scriptInitializeTime=null,to._recordingStartTime=null,to._recordingStopTime=null;class so{constructor(){this.eventListeners=[]}trackEventListener(e,t,n){this.eventListeners.push(ao(e,t,n))}cleanupAllEventListeners(){this.eventListeners.forEach(({element:e,event:t,handler:n})=>{try{e.removeEventListener(t,n)}catch(e){}}),this.eventListeners=[]}}class oo{static configureInstance(e){this.instance||(to.setScriptInitializeTime(),this.instance=new oo(e))}static reinitializeInstance(){if(this.instance){this.instance.eventListenerManager.cleanupAllEventListeners();const e=this.instance.collectErrorUrl;to.resetScriptTimeline(),to.setScriptInitializeTime(),this.instance=new oo(e)}}static getInstance(){if(!this.instance)throw new Error("ClientConfig was not configured.");return this.instance}constructor(e){this.inactiveThresholdTime=174e4,this.pvCountOveruseLockTime=27e5,this.pvCountLimit=300,this.collectErrorLimit=50,this.storage=eo.getInstance(),this.pvId=$e()(),this.isBeta=Pe(),this.scriptId=Fe(),this.deviceEnvironment="browser",this.config=null,this.isStorageAvailable=!0,this.collectErrorCount=0,this.initialPageVisitSequence=0,this.eventListenerManager=new so,this.collectErrorUrl=e;try{this.initialize()}catch(e){const t="ClientConfig initialization failed. "+e;this.collectError(t,a.ERROR,!1)}Ks()&&this.eventListenerManager.trackEventListener(window.document,"visibilitychange",()=>{"visible"===window.document.visibilityState&&this.initialize()})}initialize(){const e=null===this.config;this.restoreConfig(e);const t=this.config;if(this.isStorageAvailable){if(t.DisabledStatus)if(null===t.ClientUnlockTime)t.DisabledStatus=!1;else{new Date>t.ClientUnlockTime&&(t.DisabledStatus=!1,t.ClientUnlockTime=null)}else t.ClientUnlockTime=null;if(!t.DisabledStatus){if(e)this.isInactive&&(t.CurrentPageVisitCount=0),t.CurrentPageVisitCount+=1,this.initialPageVisitSequence=t.CurrentPageVisitCount-1;else if(this.isInactive)return t.LastActive=new Date,t.CurrentPageVisitCount=0,void this.lockClientUntilNextPage("Session reset, locking until next page");t.LastActive=new Date}this.saveConfig(),this.lockClientIfPageVisitCountOverused()}else t.DisabledStatus=!0}restoreConfig(e){let t=null;try{this.storage.load("n_config_reset")&&e?this.storage.remove("n_config_reset"):t=this.storage.load("n_browser_data")}catch(e){this.isStorageAvailable=!1}let n={};if(null!==t)try{n=JSON.parse(t)}catch(e){}"string"!=typeof n.BrowserId&&(n.BrowserId=$e()()),"number"!=typeof n.CurrentPageVisitCount&&(n.CurrentPageVisitCount=0),"boolean"!=typeof n.DisabledStatus&&(n.DisabledStatus=!1),"string"==typeof n.LastActive&&(n.LastActive=new Date(n.LastActive)),io(n.LastActive)&&(n.LastActive=new Date),null!==n.ClientUnlockTime&&("string"==typeof n.ClientUnlockTime&&(n.ClientUnlockTime=new Date(n.ClientUnlockTime)),io(n.ClientUnlockTime)&&(n.ClientUnlockTime=null)),this.config=n}saveConfig(){if(this.isStorageAvailable)try{const e=Os(this.config);this.storage.save("n_browser_data",e)}catch(e){this.config.DisabledStatus=!0,this.isStorageAvailable=!1}}get browserId(){return this.config.BrowserId}get pageVisitId(){return this.pvId}get pageVisitSequence(){return this.initialPageVisitSequence}get lastActiveTime(){return this.config.LastActive}get isDisabled(){return this.config.DisabledStatus}get isInactive(){return function(e,t){const n=Date.now()-t;return e<new Date(n)}(this.config.LastActive,this.inactiveThresholdTime)}postNoibuErrorAndOptionallyDisableClient(e,t,n,r=!1,i=!1){if(!this.config.DisabledStatus||i){if(t&&(this.config.DisabledStatus=!0,this.saveConfig()),this.collectErrorCount+=1,this.collectErrorCount>this.collectErrorLimit)return e="Shutting collect off (reached the limit of collect errors).",void this.lockClient(10,e);this.collectError(e,n,r)}}updateLastActiveTime(e=new Date){this.config.LastActive=e,this.saveConfig()}scheduleResetClientConfig(){this.isStorageAvailable&&this.storage.save("n_config_reset",!0)}lockClient(e,t){const n=new Date;n.setMinutes(n.getMinutes()+e),this.config.DisabledStatus=!0,this.config.ClientUnlockTime=n,this.saveConfig(),this.collectError(t,E,!1)}lockClientUntilNextPage(e){if(this.config.DisabledStatus)return;this.config.DisabledStatus=!0,this.saveConfig();const t=this.isBeta?E:k;this.collectError(e,t,!1)}lockClientIfPageVisitCountOverused(){if(this.config.CurrentPageVisitCount<this.pvCountLimit)return;this.config.CurrentPageVisitCount=0;const e=this.pvCountOveruseLockTime/1e3/60;this.lockClient(e,"Hit max page visits, disabling client.")}collectError(e,t,n){var r,i;if(t!==E)return;const s={browserId:(null===(r=this.config)||void 0===r?void 0:r.BrowserId)||$e()(),pageVisitId:this.pvId,scriptId:this.scriptId,deviceEnv:this.deviceEnvironment,ua:(null===(i=null===self||void 0===self?void 0:self.navigator)||void 0===i?void 0:i.userAgent)||"",error:e},o={url:Ms(),err_msg:s,sev:t},{collectErrorUrl:a}=this;Vs(a,o,{"content-type":"application/json"},n,2e3).catch(()=>{})}}function ao(e,t,n,r){if(!e||!t||!n)return null;const i=e=>{try{n(e)}catch(e){oo.getInstance().postNoibuErrorAndOptionallyDisableClient("addEventListener callback error: "+e.message,!1,E)}},s=n=>{if(n instanceof TypeError){if((()=>{if(!Reflect)return!1;try{Reflect.get(e,"addEventListener")(t,i,r)}catch(e){return!1}return!0})())return;if(!e.addEventListener)return void oo.getInstance().postNoibuErrorAndOptionallyDisableClient(`Error in addSafeEventListener: '${e.addEventListener}' is supposed to be a function. ${n}`,!1,E)}oo.getInstance().postNoibuErrorAndOptionallyDisableClient("Error in addSafeEventListener: "+n,!1,E)};try{return e.addEventListener(t,i,r),{element:e,event:t,handler:i}}catch(e){return s(e),null}}function co(e,t,n,r,i,s,o,a){a(`Wait for element. Timeout: ${i}s. Selector: "${t}".`);const c=uo(e,t,n,r,a);if(c)return a("Found target element: true."),Promise.resolve(c);if(0===i){a("Found target element: false.");const e=new Error(`Element not found: "${t}".`);return Promise.reject(e)}return new Promise((c,l)=>{let u=0;const d=()=>{a("Process mutation.");const i=uo(e,t,n,r,a);i&&(a(`Found target element: ${!!i}.`),window.clearTimeout(u),s.unsubscribe(d),c(i))};s.subscribe(d),o.subscribe(()=>{s.unsubscribe(d);const e=new Error(`Waiting for element has been cancelled: "${t}".`);l(e)});if(i>0){const e=1e3*i;u=window.setTimeout(()=>{s.unsubscribe(d);const e=new Error(`Timeout waiting for element: "${t}".`);l(e)},e)}})}function lo(e,t,n,r,i){let s=function(e,t,n,r,i){let s;if(s=t?[...e.querySelectorAll(t)].filter(e=>e.nodeType===Node.ELEMENT_NODE):[e],i(`Filtered ${s.length} elements by selector.`),(n||r)&&(s=s.filter(e=>"string"==typeof e.innerText),0!==s.length&&(n&&(i(`Filtering by text: "${n=n.toLowerCase()}".`),s=s.filter(e=>e.innerText.toLowerCase().includes(n)),i(`Filtered ${s.length} elements by text.`)),r))){const e=new RegExp(r,"im");i(`Filtering by regexp: '${e}'.`),s=s.filter(t=>e.test(t.innerText)),i(`Filtered ${s.length} elements by regexp.`)}return s}(e,t,n,r,i);return s.length&&(s=s.filter(e=>function(e){if(e.checkVisibility)return e.checkVisibility({visibilityProperty:!0,opacityProperty:!0});const t=window.getComputedStyle(e);return"none"!==t.display&&"hidden"!==t.visibility}(e)),i(`Filtered ${s.length} elements by visibility.`)),s}function uo(e,t,n,r,i){const s=lo(e,t,n,r,i);return 0===s.length?void 0:s[0]}function ho(e){let t="";if(e.tag&&(t+=e.tag),e.id&&(t+="#"+e.id),e.class&&(t+=Hs(e.class).split(/\s+/).map(e=>"."+e).join("")),e.attributes)for(const[n,r]of Object.entries(e.attributes))t+=`[${n}="${r}"]`;if(e.parentSelector){t=`${ho(e.parentSelector)} ${t}`}if(""===t)throw new Error("Incorrect element selector.");return t}function po(){return le().page_groups||null}function go(e=null){let t="";if(e){const n=new URL(e);t=n.hostname+n.pathname}else t=window.location.hostname+window.location.pathname;return t+=t.endsWith("/")?"":"/",t.startsWith("www.")&&(t=t.slice(4)),t}const fo=new Map;function mo(e,t=null){let n=fo.get(e);if(void 0===n||0===n.length){n=e.replace(/https?:\\\/\\\/|www\\\./g,""),n.startsWith("^")||(n="^"+n);n.endsWith(")")&&(n.endsWith("/",n.length-1)||n.endsWith("*",n.length-1)||(n+="/")),n.endsWith("$")||(n+="$"),fo.set(e,n)}return new RegExp(n).test(go(t))}function vo(e=null,t=!0){const n=po();if(!n)return[];return Object.values(n).filter(e=>!(t&&"PageCheck"===e.group_type)).filter(t=>function(e,t=null){try{if(e.url_regex){if(mo(e.url_regex,t))return!0}else if(e.urls){const n=go(t);if(e.urls.includes(n))return!0}if(e.element_selector){const t=ho(e.element_selector);if(window.document.querySelector(t))return!0}}catch(e){}return!1}(t,e)).map(e=>e.name).filter(Hs)}class yo{constructor(){this.expectedVideoLength=0,this.expectedVfSeq=0,this.expectedPvPart=0,this.httpSequenceNumber=0,this.httpPayloadCount=0,this.httpDroppedPayloadByLengthCount=0,this.httpDroppedPayloadByTypeCount=0,this.httpOverLimitCount=0,this.videoClicks=0,this.pvClicks=0,this.didCutPv=!1,this.didCutVideo=!1,this.didStartVideo=!1,this.httpCount=0,this.errCount=0,this.customAttributeTotalCount=0,this.customAttributeFailCount=0,this.customAttributeKeyCount=0,this.otherMetrics={},this.eventListenerManager=new so,this._setupListeners()}static getInstance(){return this.instance||(this.instance=new yo),this.instance}static reinitializeInstance(){this.instance&&(this.instance.eventListenerManager.cleanupAllEventListeners(),this.instance=new yo)}addVideoFragData(e,t){this.expectedVfSeq=e,this.expectedVideoLength=t}setPvPart(e){this.expectedPvPart=e}addVideoClick(){this.videoClicks+=1}addPvClick(){this.pvClicks+=1}addError(){this.errCount+=1}addHttpEvent(){this.httpCount+=1}addHttpData(){this.httpSequenceNumber+=1}addHttpDataOverLimit(){this.httpOverLimitCount+=1}addHttpDataDropByType(){this.httpDroppedPayloadByTypeCount+=1}addHttpDataDropByLength(){this.httpDroppedPayloadByLengthCount+=1}addHttpDataPayloadCount(){this.httpPayloadCount+=1}addCustomAttributeTotalCount(){this.customAttributeTotalCount+=1}addCustomAttributeFailCount(){this.customAttributeFailCount+=1}setCustomAttributeKeyCount(e){this.customAttributeKeyCount=e}addOtherMetricsCount(e,t=1){this.otherMetrics[e]||(this.otherMetrics[e]=0),this.otherMetrics[e]+=t}setDidCutVideo(){this.didCutVideo=!0}setDidStartVideo(){this.didStartVideo=!0}setDidCutPv(){this.didCutPv=!0}_setupListeners(){if(!Ks())return;this.eventListenerManager.trackEventListener(window,"pagehide",()=>{this._postMetricsIfActive()})}_postMetricsIfActive(){oo.getInstance().isDisabled||oo.getInstance().isInactive}}var bo=function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function o(e){try{c(r.next(e))}catch(e){s(e)}}function a(e){try{c(r.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}c((r=r.apply(e,t||[])).next())}))};class Io{constructor(){this.flushedStorage=!1;eo.getInstance().isAvailable()&&this._postPreviousPageVisit()}static getInstance(){return this.instance||(this.instance=new Io),this.instance}checkAndStoreRetryQueue(e,t){const{type:n,payload:r}=e[e.length-1];if(n!==T||!r[ie])return;(r[ie].events?r[ie].events:[]).filter(e=>e[L]===j||e[L]===J||e[L]===K||e[L]===z).length>0&&this.writePageVisitsFromRetryQueue(e,t)}writePageVisitsFromRetryQueue(e,t){const n=e.filter(({type:e})=>e===T).map(({payload:e})=>e[ie]);this._writePageVisitFrags(n,t)}_writePageVisitFrags(e,t){const n={pageVisitFrags:e,pageVisitInfo:t,timestamp:new Date},r=eo.getInstance(),i=Os(n);try{r.save("n_stored_page_visit",i)}catch(e){r.remove("n_stored_page_visit"),oo.getInstance().postNoibuErrorAndOptionallyDisableClient({details:`Error writing pv to storage: ${e.toString()}${xs(e)}`,diagnosis:r.getDiagnoseInfo()},!1,E)}}_getPostData(){const e=eo.getInstance(),t=e.load("n_stored_page_visit");if(!t)return null;let n={};try{n=JSON.parse(t)}catch(n){return e.remove("n_stored_page_visit"),oo.getInstance().postNoibuErrorAndOptionallyDisableClient(`Error parsing page visit string '${t}': ${n}`,!1,E),null}if(n.timestamp){const e=new Date;if(e.setSeconds(e.getSeconds()-1740),+e>=Date.parse(n.timestamp))return null}const r={pvi:n.pageVisitInfo,[ie]:[],[se]:[]};return r.pvi.last=!0,r[ie].push(...n.pageVisitFrags),r}_postPreviousPageVisit(){return bo(this,void 0,void 0,(function*(){const e=this._getPostData();if(e){const t={"content-type":"application/json"};try{yield Vs(Be(),e,t,!1,6e4)}catch(e){}}this._updateStorageFlushed()}))}_updateStorageFlushed(){this.flushedStorage=!0;eo.getInstance().remove("n_stored_page_visit")}}function Co(){return window.performance&&window.performance.now?window.performance.now():ro(Date.now())}var wo,So,Eo=function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function o(e){try{c(r.next(e))}catch(e){s(e)}}function a(e){try{c(r.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}c((r=r.apply(e,t||[])).next())}))};class ko{static getInstance(){return this.instance||(this.instance=new ko)}static reinitializeInstance(e){this.instance&&this.instance.initialize(e)}constructor(){this.broadcastContext=null;try{let e=sessionStorage.getItem(wo.TabId);null===e&&(e=$e()(),sessionStorage.setItem(wo.TabId,e)),this.tabId=e}catch(e){return}if(!this.isShopifyCheckout)try{const e=this.receiveBroadcastMessage.bind(this),t=new BroadcastChannel("noibu_referrer");ao(t,"message",e),this.broadcastChannel=t}catch(e){}}get isDisabled(){return!this.tabId}get isShopifyCheckout(){return"object"==typeof noibuShopifyProxy}get currentUrl(){return this.isShopifyCheckout?noibuShopifyProxy.api.init.context.window.location.href:window.location.href}get referrerUrl(){return this.isDisabled?"":sessionStorage.getItem(wo.ReferrerUrl)||""}get referrerPageGroups(){if(this.isDisabled)return[];const e=sessionStorage.getItem(wo.ReferrerPageGroups);return e?JSON.parse(e):[]}get storedPageGroups(){if(this.isDisabled)return[];const e=sessionStorage.getItem(wo.PageGroups);return e?JSON.parse(e):[]}storePageGroups(e){if(this.isDisabled)return;const t=JSON.stringify(e);sessionStorage.setItem(wo.PageGroups,t)}initialize(){return Eo(this,arguments,void 0,(function*(e=null){if(!this.isDisabled)try{yield this.initializeUnsafe(e)}catch(e){}}))}initializeUnsafe(){return Eo(this,arguments,void 0,(function*(e=null){if(null===e){switch(function(){try{const e=performance.getEntriesByType("navigation");return e[0].type}catch(e){return null}}()){case"reload":break;case"back_forward":{const e=sessionStorage.getItem(wo.Url),t=sessionStorage.getItem(wo.PageGroups);sessionStorage.setItem(wo.Url,this.currentUrl),sessionStorage.setItem(wo.ReferrerUrl,e||""),sessionStorage.setItem(wo.ReferrerPageGroups,t||"[]");break}default:{let e=sessionStorage.getItem(wo.Url),t=sessionStorage.getItem(wo.PageGroups);if(null==e&&(e=document.referrer||null),null!=e&&null==t&&this.broadcastChannel){const n=yield this.sendBroadcastMessage(e);t=JSON.stringify(n)}sessionStorage.setItem(wo.Url,this.currentUrl),sessionStorage.setItem(wo.ReferrerUrl,e||""),sessionStorage.setItem(wo.ReferrerPageGroups,t||"[]")}}}else{const{url:t,referrerUrl:n,referrerPageGroups:r}=e,i=JSON.stringify(r);sessionStorage.setItem(wo.Url,t),sessionStorage.setItem(wo.ReferrerUrl,n),sessionStorage.setItem(wo.ReferrerPageGroups,i)}}))}sendBroadcastMessage(e){const t={timeout:null,promise:null,resolve:null};t.promise=new Promise(e=>t.resolve=e),t.timeout=window.setTimeout(()=>t.resolve([]),5),this.broadcastContext=t;const n={type:"request",tabId:this.tabId,referrer:e};return this.broadcastChannel.postMessage(n),t.promise}receiveBroadcastMessage({data:e}){switch(e.type){case"request":this.handleRequestMessage(e);break;case"response":this.handleResponseMessage(e)}}handleRequestMessage({tabId:e,referrer:t}){if(t!==window.location.href)return;const n=sessionStorage.getItem(wo.PageGroups);if(null===n)return;const r={type:"response",tabId:e,pageGroups:JSON.parse(n)};this.broadcastChannel.postMessage(r)}handleResponseMessage({tabId:e,pageGroups:t}){if(e!==this.tabId)return;const n=this.broadcastContext;this.broadcastContext=null,window.clearTimeout(n.timeout),n.resolve(t)}}function Ao(e,t=[],n=1.5,r=2){return new Proxy(t,{get:(t,i)=>"push"===i?(...i)=>{t.push(...i),t.length>=n*e&&t.splice(0,e/r)}:t[i]})}ko.instance=null,function(e){e.TabId="noibu_tab_id",e.Url="noibu_url",e.PageGroups="noibu_page_groups",e.ReferrerUrl="noibu_referrer_url",e.ReferrerPageGroups="noibu_referrer_page_groups"}(wo||(wo={}));class To{constructor(e,t){this.retryMessageQueue=Ao(500),this.inactivityTimeout=0;const n=Ve();this.forceClosed=!1,this.socket=null,this.socketInstanceId=null,this.previousMessageType="",this.currentConnectionAttempts=0,this.connectionCount=0,this.sessionStartTime=Co(),this.connectionPromise=null,this.pageVisitInfoSent=!1,this.connectionURL=`${n}/${de}`,this.postURL=Be(),this.messageSequenceNum=0,this.latestReceivedSeqNumber=-1,this.isRetryLoopDisabled=!1,this.metroplexTypeLock={};const{referrerUrl:r}=ko.getInstance();this.initialReferingURL=ks(r),(null==t?void 0:t.url)?this.initialURL=t.url:this.initialURL=Ms(),(null==t?void 0:t.pageTitle)?this.initialPageTitle=t.pageTitle:Ks()&&window.document.title?this.initialPageTitle=window.document.title:this.initialPageTitle="",this.sessionTimestamp=new Date,this.latestReceivedSeqNumStoredTime=new Date,this.instanceId=$e()(),this.scriptInstanceId=e,this.sessionLength=0,this.socketCloseCodes=[],this.socketOpens=[],this.ackedOnce=!1,this.metroRetryFrequencyMS=3e4,this.debouncedInactivityHandler=Xi()(()=>{this._socketTimeout()},5e3),this.eventListenerManager=new so}static getInstance(e){return this.instance||(this.instance=new To(e),this.instance.start()),this.instance}static reinitializeInstance(e,t){if(this.instance)return this.instance.eventListenerManager.cleanupAllEventListeners(),clearInterval(this.instance.retryMetroplexInterval),clearTimeout(this.instance.inactivityTimeout),this.instance=new To(e,t),this.instance.start(),this.instance}start(){this.connectSocket(),this._setupOffloadEvents()}_addSeqNumToPayload(e,t){switch(e){case u.PageVisitPart:this._setSeqNumInPayloadAndIncrementSeqNum(ie,t);break;case u.PageVisitVideoFile:this._setSeqNumInPayloadAndIncrementSeqNum(se,t);break;case u.PageVisitHttp:this._setSeqNumInPayloadAndIncrementSeqNum(ae,t);break;case u.PageVisitMeta:this._setSeqNumInPayloadAndIncrementSeqNum(oe,t)}}_setSeqNumInPayloadAndIncrementSeqNum(e,t){t[e].seq_num=this.messageSequenceNum,this.messageSequenceNum+=1}sendMessage(e,t){if(e in this.metroplexTypeLock||oo.getInstance().isDisabled)return!1;const n=t;if(e!==U&&(this._addSeqNumToPayload(e,n),this.retryMessageQueue.push({payload:n,type:e}),Io.getInstance().checkAndStoreRetryQueue(this.retryMessageQueue,this.getPageInformation())),this.isConnected()&&this.pageVisitInfoSent&&this._sendSocketMessage(n),this.previousMessageType=e,e===T&&t[ie]){const e=t[ie].events?t[ie].events:[];this._updateLatestPvTimestamp(e)}return!0}_updateLatestPvTimestamp(e){this._filterUserEvents(e).length>0&&(oo.getInstance().updateLastActiveTime(),this.debouncedInactivityHandler())}_socketTimeout(){this.inactivityTimeout&&self.clearTimeout(this.inactivityTimeout),this.inactivityTimeout=self.setTimeout(()=>{this.closeIfInactive()},174e4)}_filterUserEvents(e){return e.filter(e=>e[L]===j)}isConnected(){return null!==this.socket&&1===this.socket.readyState}isConnecting(){return null!==this.socket&&0===this.socket.readyState}close(){this.forceClosed=!0,(this.isConnected()||this.isConnecting())&&this.socket.close(1e3)}handleConnect(e,t){(t||!this.isConnected()&&!this.isConnecting())&&(this.currentConnectionAttempts+=1,this.socket=new WebSocket(this.connectionURL),this.socketInstanceId=$e()(),this.socket.onerror=()=>{},this.socket.onclose=t=>{this.pageVisitInfoSent=!1,this.forceClosed||(this.socketCloseCodes.push(`${no()?"":(new Date).toISOString()}:${t.code}`),this.isConnecting()||(clearInterval(this.retryMetroplexInterval),this.currentConnectionAttempts>=20?oo.getInstance().lockClientUntilNextPage("Too many reconnection attempts, locking until next page"):this.connectionCount>=100?oo.getInstance().lockClientUntilNextPage("Too many connections, locking until next page"):setTimeout(()=>{this.handleConnect(e,!1)},Math.pow(this.currentConnectionAttempts,2)*("undefined"!=typeof METROPLEX_CONSECUTIVE_CONNECTION_DELAY?METROPLEX_CONSECUTIVE_CONNECTION_DELAY:1e3))))},this.socket.onmessage=t=>{this._onSocketMessage(t,e)},this.socket.onopen=()=>{this.socketOpens.push(""+(no()?"":(new Date).toISOString())),this._onSocketOpen()})}connectSocket(){return this.isConnected()||this.isConnecting()||(this.connectionPromise=new Promise(e=>{if(!Ks())return void this.handleConnect(e,!1);"visible"===window.document.visibilityState&&!window.document.hidden&&this.handleConnect(e,!1),this.eventListenerManager.trackEventListener(window,"visibilitychange",()=>{const t="visible"===window.document.visibilityState;if(t){if(oo.getInstance().isDisabled)return;this.forceClosed=!1,this._closeForVisibilityChange(),this.handleConnect(e,t)}else this._closeForVisibilityChange()})})),this.connectionPromise}_closeForVisibilityChange(){(this.isConnected()||this.isConnecting())&&(this.socket.onclose=()=>{},this.socket.close(1e3))}addEndTimeToPayload(e,t){const n=Math.ceil(Co()-this.sessionStartTime);t&&(this.sessionLength=n);const r=new Date(this.sessionTimestamp.getTime()+n).toISOString();e.end_at=r}_onSocketOpen(){this.isConnected()&&!oo.getInstance().isDisabled&&(this._sendSocketMessage(this.getPageInformation()),this.pageVisitInfoSent=!0,this.currentConnectionAttempts=0,this.previousMessageType="",this._sendUnconfirmedMessages(!1),this.setupRetryMechanism(),this.connectionCount+=1)}_onSocketMessage(e,t){switch(e.data){case ge:this.metroplexTypeLock[_]=!0,yo.getInstance().setDidCutVideo();break;case fe:this.metroplexTypeLock[T]=!0,yo.getInstance().setDidCutPv();break;case me:oo.getInstance().lockClient(1440,"Metroplex blocked script"),this.close();break;case ve:this.close();break;case ye:break;default:if(e.data.includes("seq_num")){const n=e.data.split("seq_num:");if(n.length<2){oo.getInstance().postNoibuErrorAndOptionallyDisableClient("Invalid message received from metroplex while clearing retry queue "+e.data,!1,E);break}const r=parseInt(n[1],10);if(-1===r)break;r<=this.latestReceivedSeqNumber?this.isRetryLoopDisabled=!0:(this.isRetryLoopDisabled=!1,this.latestReceivedSeqNumber=r,this._clearRetryQueue(r)),!this.ackedOnce&&t&&(this.ackedOnce=!0,t())}if(this._tryProcessHelpCodeResponse(e.data))break}}_messagePayloadHasLargerSeqNum(e,t,n){return e.payload[t]&&e.payload[t].seq_num&&e.payload[t].seq_num>n}_clearRetryQueue(e){this.latestReceivedSeqNumStoredTime=new Date;const t=this.retryMessageQueue.filter(t=>this._messagePayloadHasLargerSeqNum(t,ie,e)||this._messagePayloadHasLargerSeqNum(t,se,e));this.retryMessageQueue=Ao(500,t)}_sendUnconfirmedMessages(e){if(!this.isConnected()||oo.getInstance().isDisabled)return;if(e){const e=new Date;if(e.setMilliseconds(e.getMilliseconds()-this.metroRetryFrequencyMS),e<this.latestReceivedSeqNumStoredTime)return;if(this.isRetryLoopDisabled)return}const t=this.retryMessageQueue.filter(e=>!(e.type in this.metroplexTypeLock));this.retryMessageQueue=Ao(500,t);for(let e=0;e<this.retryMessageQueue.length;e+=1){const{type:t,payload:n}=this.retryMessageQueue[e];if(!this._sendSocketMessage(n))break;this.previousMessageType=t}}setupRetryMechanism(){this.retryMetroplexInterval=setInterval(()=>{this._sendUnconfirmedMessages(!0)},3e4)}_setupOffloadEvents(){Ks()&&this.eventListenerManager.trackEventListener(window,"pagehide",()=>{this.handleUnload()})}handleUnload(e=null){this.close(),oo.getInstance().isDisabled||oo.getInstance().isInactive||0!=this.messageSequenceNum&&this.postFullPageVisit(e)}postFullPageVisit(e=null){if(0===this.retryMessageQueue.length)return;e=e||this.getPageInformation();const t=[],n={[_]:0,[T]:0};let r=0,i={pvi:e,[ie]:[],[se]:[],[ae]:[],vpnum:this.connectionCount};if(i.pvi.last=!0,this.retryMessageQueue.forEach(s=>{let{type:o,payload:a}=s;const c=new Blob([Os(a)]).size;if(c>59e3)n[o]+=1;else{if(r+=c,r>=59e3){this.postMessage(i);let n="Vid: "+i[se].length;n+=" PV: "+i[ie].length,n+=` HTTP: ${i[ae].length},`,t.push(n),i={pvi:e,[ie]:[],[se]:[],[ae]:[],vpnum:i.vpnum},i.pvi.last=!0,r=c}switch(o){case _:i[se].push(a[se]);break;case T:i[ie].push(a[ie]);break;case M:i[ae].push(a[ae])}}}),this.postMessage(i),this.retryMessageQueue.length>500){let e="Vid: "+i[se].length;e+=" PV: "+i[ie].length,e+=` HTTP: ${i[ae].length},`,t.push(e);let r="POST Full PV complete";r+=", POSTs count: "+t.length,r+=", POSTs info: "+Os(t),r+=", Retry message queue size: "+this.retryMessageQueue.length,n[_]>0&&(r+=", Video parts dropped: "+n[_]),n[T]>0&&(r+=", Page visit parts dropped: "+n[T]),n[M]>0&&(r+=", HTTP data parts dropped: "+n[M]),r+=", Sequence Info: Latest "+this.messageSequenceNum,r+=` Ack'd ${this.latestReceivedSeqNumStoredTime} ${this.latestReceivedSeqNumber}`;const s=!1,o=!0;oo.getInstance().postNoibuErrorAndOptionallyDisableClient(r,!1,E,s,o)}}postMessage(e){const t=e;t.vpnum+=1;Vs(this.postURL,t,{"content-type":"application/json"},!0)}_sendSocketMessage(e){return!this.closeIfInactive()&&(this.socket.send(Os(e)),!0)}closeIfInactive(){const e=oo.getInstance().isInactive;return e&&!oo.getInstance().isDisabled&&(oo.getInstance().lockClientUntilNextPage("Session is inactive, locking until next page"),this.close(),this.postFullPageVisit()),e}getPageInformation(){const e=oo.getInstance(),t=vo(this.initialURL),{referrerPageGroups:n}=ko.getInstance(),r={br_id:e.browserId,pv_id:e.pageVisitId,v:5,seq:e.pageVisitSequence,on_url:this.initialURL,page_title:this.initialPageTitle,page_groups:t,ref_url:this.initialReferingURL,ref_page_groups:n,start_at:this.sessionTimestamp.toISOString(),conc:this.connectionCount,cv:2,last:!1,script_id:Fe(),script_inst_id:this.scriptInstanceId,mp_sock_inst_id:this.instanceId,sock_inst_id:this.socketInstanceId,video_recorder:ce},i=function(){const e=self.navigator.userLanguage||self.navigator.language;return"string"==typeof e?e.toLowerCase():null}();return i&&(r.lang=i),r}_tryProcessHelpCodeResponse(e){const t=F+":";if("string"!=typeof e||!e.startsWith(t))return!1;const n=e.substring(t.length),r=/^\d{6}$/.test(n),i=new CustomEvent("noibuHelpCode",{detail:{success:r,data:n}});return self.dispatchEvent(i),!0}}class _o{constructor(){this.partCounter=0,this.pvMap={},this.partCounter=0,this.pvEventLength=0,this.visibilityChangedCounter=0,this.totalPvEventLength=0,this.inDebounceHandle=0,this.isInAcceleratedPvPostMode=!1,this.liveViewEnabled=!1}static configureInstance(){this.instance||(this.instance=new _o)}static getInstance(){if(!this.instance)throw new Error("Pagevisit was never configured");return this.instance}addPageVisitEvents(e,t){e.forEach(e=>{this._addPageVisitEvent(e,t)}),this._sendPageVisitMessage(),this.postEvents(t,e)}addPageVisitEvent(e,t){const n=this._addPageVisitEvent(e,t);return this._sendPageVisitMessage(),this.postEvents(t,[e]),n}_addPageVisitEvent(e,t){if(!("occurredAt"in e)||!("event"in e))throw new Error("missing attributes in the eventObj");const n={[L]:t,occ_at:e.occurredAt,[t]:e.event};this.pvEventLength>=200&&this._sendPageVisitMessage();const r=$e()();return this.pvMap[r]=n,this.pvEventLength+=1,this.totalPvEventLength+=1,r}static makePageVisitFrag(e,t){const n={};return n.events=e,n.pc=t,To.getInstance().addEndTimeToPayload(n,!0),n}_sendPageVisitMessage(){const e=Object.keys(this.pvMap).map(e=>this.pvMap[e]);if(0===e.length)return;if(this.partCounter>=1e4)return void oo.getInstance().lockClientUntilNextPage(`NoibuJS will stop processing parts because we reached max parts: 10000. Variables: \n      total Pv Event Length: ${this.totalPvEventLength}\n      visibility Changed Counter: ${this.visibilityChangedCounter}\n      `);const t=_o.makePageVisitFrag(e,this.partCounter);yo.getInstance().setPvPart(this.partCounter);const n={[ie]:t};To.getInstance().sendMessage(T,n),this.pvMap={},this.pvEventLength=0,this.partCounter+=1}postEvents(e,t){this.liveViewEnabled&&self.dispatchEvent(new CustomEvent("noibuPageVisitEvent",{detail:{type:e,eventObjects:t}}))}requestLiveView(){this.liveViewEnabled=!0}disableLiveView(){this.liveViewEnabled=!1}}class Ro{constructor(e){this.unmaskedInputSelectors=null,this.unmaskedInputCache=new Set,this.maskedInputCache=new Set,this.unmaskedInputSelectors=e}maskInputSafely(e,t){try{return this.maskInput(e,t)}catch(e){return"*"}}maskInput(e,t){if(null==this.unmaskedInputSelectors)return Ro.mask(e);if(this.maskedInputCache.has(t))return Ro.mask(e);if(this.unmaskedInputCache.has(t))return e;for(const n of this.unmaskedInputSelectors){const r=document.querySelectorAll(n);for(const n of r){if(n===t)return this.unmaskedInputCache.add(t),e}}return this.maskedInputCache.add(t),Ro.mask(e)}static mask(e){return"*".repeat(e.length)}}!function(e){e[e.Init=0]="Init",e[e.Fail=1]="Fail",e[e.Ready=2]="Ready"}(So||(So={}));var Mo=function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function o(e){try{c(r.next(e))}catch(e){s(e)}}function a(e){try{c(r.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}c((r=r.apply(e,t||[])).next())}))};class Lo{constructor(e,t){this.status=So.Init,this.recordSnapshotId=0,this.scriptUrl=e,this.errorCallback=t,this.stats={start:0,fetch:0,read:0,create:0,ping:0,pong:0,init:0,error:0,send:0,receive:0,queue:0,first:0,max:0,avg:0}}ready(){return this.statusPromise}start(){this.statusPromise=new Promise((e,t)=>{const n=performance.now();this.statusResolver={timestamp:n,resolve:e,reject:t},this.init()})}processRecordSnapshot(e){if(this.status!==So.Ready){const e=new Error("Worker is not initialized.");return Promise.reject(e)}return new Promise((t,n)=>{const r=this.getNextRecordSnapshotId(),i={timestamp:performance.now(),resolve:t,reject:n};this.recordSnapshotResolvers.set(r,i),this.sendRecordSnapshotMessage(r,e)})}reportError(e,t){const n=!!this.recordSnapshotResolvers;this.stats.queue=n?this.recordSnapshotResolvers.size:0;const r=Os({error:`${e} ${t} ${xs(t)}`,status:this.status,stats:this.stats});this.errorCallback(r)}init(){return Mo(this,void 0,void 0,(function*(){try{this.worker=yield Lo.createWorker(this.scriptUrl,this.stats),this.worker.addEventListener("error",e=>{this.stats.error+=1,this.handleInitError(e.error)}),this.worker.addEventListener("message",e=>{this.receiveMessage(e.data)}),this.worker.addEventListener("messageerror",e=>{this.reportError("Message error.",e.data)}),this.setupInitTimeout(),this.sendPingMessage()}catch(e){this.handleInitError(e)}}))}static createWorker(e,t){return Mo(this,void 0,void 0,(function*(){t.start=performance.now();const n=yield fetch(e);if(t.fetch=performance.now(),!n.ok)throw new Error(`Failed to fetch worker script. Code: ${n.status}. Status: ${n.statusText}.`);const r=yield n.text();t.read=performance.now();const i=new Blob([r],{type:"application/javascript"}),s=URL.createObjectURL(i),o=new Worker(s);return t.create=performance.now(),o}))}handleReady(){this.status===So.Init&&(this.recordSnapshotResolvers=new Map,this.stats.init=performance.now()-this.statusResolver.timestamp,this.status=So.Ready,this.statusResolver.resolve(this.status),this.setupRecordSnapshotCleanup())}handleInitError(e){if(this.status===So.Init){this.status=So.Fail,this.statusResolver.resolve(this.status);Lo.isInitErrorAcknowledged(e)||this.reportError("Init error.",e)}}static isInitErrorAcknowledged(e){if(!e)return!0;const t=(""+e).trim();return 0===t.length||Lo.knownInitErrors.some(e=>t.includes(e))}setupInitTimeout(){window.setTimeout(()=>{const e=new Error("Init timeout.");this.handleInitError(e)},5e3)}sendMessage(e){this.status===So.Ready&&(this.stats.send+=1,this.worker.postMessage(e))}sendPingMessage(){this.stats.ping=performance.now(),this.worker.postMessage({type:"ping"})}sendRecordSnapshotMessage(e,t){const n={type:"record-snapshot-request",payload:{id:e,snapshot:t}};this.sendMessage(n)}receiveMessage(e){switch(e.type){case"pong":this.stats.pong=this.stats.pong||performance.now(),this.handleReady();break;case"record-snapshot-response":this.receiveRecordSnapshotResponse(e.payload);break;case"messageerror":this.reportError("Received message error.",null)}}receiveRecordSnapshotResponse(e){const{id:t}=e,n=this.recordSnapshotResolvers.get(t);n&&(Lo.updateReceiveStats(n,this.stats),this.recordSnapshotResolvers.delete(t),e.error?(this.reportError("Service error.",e.error),n.reject(e.error)):n.resolve(e))}static updateReceiveStats(e,t){const n=performance.now()-e.timestamp,r=t.receive+1;let{avg:i}=t;i-=i/r,i+=n/r,t.receive=r,t.avg=i,0===t.first&&(t.first=n),n>t.max&&(t.max=n)}setupRecordSnapshotCleanup(){window.setInterval(()=>this.cleanupRecordSnapshot(),12e4)}cleanupRecordSnapshot(){let e=0;const t=[...this.recordSnapshotResolvers.entries()];for(const[n,r]of t){if(performance.now()-r.timestamp>12e4){this.recordSnapshotResolvers.delete(n);const t=new Error("Resolver expired.");r.reject(t),e+=1}}if(e){const t=new Error(`Collected ${e} expired resolvers.`);this.reportError("Cleanup.",t)}}getNextRecordSnapshotId(){return this.recordSnapshotId+=1,this.recordSnapshotId}}var No,xo;Lo.knownInitErrors=["SecurityError: The operation is insecure","TypeError: Load failed","TypeError: Failed to fetch","SecurityError: Failed to construct","QuotaExceededError: Failed to construct","TypeError: NetworkError when attempting to fetch resource","AbortError: The operation was aborted"];const Do=(null===(xo=null===(No=null==Promise?void 0:Promise.all)||void 0===No?void 0:No.bind)||void 0===xo?void 0:xo.call(No,Promise))||(e=>new Promise((function(t,n){const r=[];let i=0;e.forEach((s,o)=>{Promise.resolve(s).then(n=>{r[o]=n,i+=1,i===e.length&&t(r)}).catch(n)})})));var Oo,Po,Fo,Uo;!function(e){e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin"}(Oo||(Oo={})),function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"}(Po||(Po={})),function(e){e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet"}(Fo||(Fo={})),function(e){e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel"}(Uo||(Uo={}));var Vo=function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function o(e){try{c(r.next(e))}catch(e){s(e)}}function a(e){try{c(r.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}c((r=r.apply(e,t||[])).next())}))};class Wo{constructor(e,t,n=null){if(this.isRecordingStopped=!1,this.isMetaEventReceived=!1,this.isRecordingAllowedHandled=!1,this.isRecordingLoadedHandled=!1,this.liveViewRecording=!1,this.eventBuffer=[],this.vfCounter=0,this.didSetupRecorder=!1,this.recordStopper=null,this.firstRecordedTimestamp=null,this.lastRecordedTimestamp=null,this.invalidVideoLength=!1,this.lastFragPostTimestamp=Date.now(),this.pauseTimeout=null,this.freezingEvents=!1,this.cssURLs=new Map,this.pageStateHistory=[],this.lastRRWebEvent=null,this.eventListenerManager=new so,t)return void(this.didSetupRecorder=!0);const r=function(){const e=le().unmask;return Array.isArray(e)?e:null}();this.inputMaskManager=new Ro(r),this.setupUnloadHandler(),this.eventListenerManager.trackEventListener(window,"click",()=>{this.handleFragPost()}),e&&(null!==n?this.workerAgent=n:(this.workerAgent=new Lo("https://cdn.noibu.com/collect-worker.js",Wo.postWorkerError),this.workerAgent.start()))}static reinitializeInstance(e=!0){if(this.instance){clearTimeout(this.instance.pauseTimeout),this.instance.eventListenerManager.cleanupAllEventListeners();const t={record:this.instance.rrwebRecord,pack:this.instance.rrwebPack,addCustomEvent:this.instance.rrwebAddCustomEvent};this.instance=new Wo(e,!1,this.instance.workerAgent),t.record&&t.pack&&t.addCustomEvent&&this.instance.handleRRWebLoaded(t)}}static configureInstance(e=!0){this.instance||(this.instance=new Wo(e,!1))}static getInstance(){if(!this.instance)throw new Error("SessionRecorder was not configured");return this.instance}static postWorkerError(e){oo.getInstance().postNoibuErrorAndOptionallyDisableClient("Worker error: "+e,!1,k)}addCSSURLs(e){this.cssURLs.get(e)||this.cssURLs.set(e,{seq_sent:To.getInstance().messageSequenceNum,received:!1})}searchObjectForCSSUrls(e){(function(e){const t=[];return function e(n){if(n)for(const[r,i]of Object.entries(n)){const s="href"===r,o="string"==typeof i&&!!i.length;if(s&&o){const e=i.includes(".css"),r="text/css"===n.type,s="stylesheet"===n.rel;if(e||r||s){const e=i.replace(/['"]/g,"");t.push(e)}}else"object"==typeof i&&null!==i&&e(i)}}(e),t})(e).forEach(e=>{this.addCSSURLs(e)})}checkForCSSURLs(e){3!==e.type&&2!==e.type||this.searchObjectForCSSUrls(e)}getCSSURLsNotReceived(){const{latestReceivedSeqNumber:e}=To.getInstance(),t=[];return this.cssURLs.forEach((n,r)=>{if(!n.received&&n.seq_sent<e){const e=n;e.received=!0,this.cssURLs.set(r,e)}else n.received||t.push(r)}),t}setupUnloadHandler(){["pagehide","visibilitychange"].forEach(e=>this.eventListenerManager.trackEventListener(window,e,()=>{this.pageStateHistory.push(`${no()?"":(new Date).toISOString()}: ${e}`),"pagehide"===e&&this.handleFragPost()}))}recordUserSession(e={}){if(To.getInstance().closeIfInactive()||yo.getInstance().didCutVideo)return;if(this.didSetupRecorder)return;const{domain:t}=le(),n="uat.jtv.com"===t||"www.jtv.com"===t,r="console.noibu.com"===t,i=Object.assign({emit:e=>{this.handleNewRRwebEvent(e,2e3)},inlineStylesheet:!0,maskAllInputs:!0,maskInputFn:this.inputMaskManager.maskInputSafely.bind(this.inputMaskManager),deferProcessMutations:n,maskTextSelector:Bs(),ignoreCSSAttributes:Oe,ignoreIframes:r,collectFonts:!0,blockSelector:'img[alt="prescription image preview"]'},e);to.setRecordingStartTime(),yo.getInstance().setDidStartVideo(),this.recordStopper=this.rrwebRecord(i),this.didSetupRecorder=!0}handleNewRRwebEvent(e,t){return Vo(this,void 0,void 0,(function*(){if(To.getInstance().closeIfInactive()||yo.getInstance().didCutVideo)return void this.stopRecording();if(this.isRecordingStopped)return;if(e.type===Oo.Meta&&(this.isMetaEventReceived=!0),!this.isMetaEventReceived)return;if(e.type===Oo.Custom&&"unfreeze"===e.data.tag)return;if(e.type===Oo.IncrementalSnapshot&&e.data.source===Fo.Mutation||(this.pauseTimeout&&(clearTimeout(this.pauseTimeout),this.pauseTimeout=null,this.freezingEvents=!1),this.pauseTimeout=setTimeout(()=>{this.rrwebRecord.freezePage&&(this.freezingEvents=!0,this.rrwebRecord.freezePage())},t)),e.timestamp=ro(e.timestamp),this.firstRecordedTimestamp||(this.firstRecordedTimestamp=e.timestamp),(!this.lastRecordedTimestamp||e.timestamp>this.lastRecordedTimestamp)&&(this.lastRecordedTimestamp=e.timestamp),this.firstRecordedTimestamp&&e.timestamp<this.firstRecordedTimestamp)return void oo.getInstance().postNoibuErrorAndOptionallyDisableClient("Detected time rewind. Client has been disabled.",!0,E,!0);const n=yield this.packAndParseCss(e);this.handleLiveView(n),this.eventBuffer.push(n),this.lastRRWebEvent=e,e.type===Oo.IncrementalSnapshot&&(e.data.source!==Fo.MouseInteraction||e.data.type!==Uo.Click&&e.data.type!==Uo.DblClick||yo.getInstance().addVideoClick());let r=!0;if(e.type===Oo.IncrementalSnapshot){const e=Date.now()-this.lastFragPostTimestamp<500,t=this.eventBuffer.length<10;e&&t&&(r=!1)}r&&this.handleFragPost()}))}packAndParseCss(e){return Vo(this,void 0,void 0,(function*(){let t=null;if(this.workerAgent){if((yield this.workerAgent.ready())===So.Ready){const n=Object.assign(Object.assign({},e),{v:"v1"});try{const e=yield this.workerAgent.processRecordSnapshot(n);t=e.compressedData,e.cssUrls.forEach(e=>this.addCSSURLs(e))}catch(e){t=null}}}return null==t&&(t=this.rrwebPack(e,{level:1}),this.checkForCSSURLs(e)),t}))}handleFragPost(){if(!To.getInstance().closeIfInactive()&&this.didSetupRecorder&&0!==this.eventBuffer.length){try{let e=0;this.firstRecordedTimestamp&&this.lastRecordedTimestamp&&!this.invalidVideoLength&&(e=this.lastRecordedTimestamp-this.firstRecordedTimestamp),!this.invalidVideoLength&&(e<0||e>=Number.MAX_SAFE_INTEGER)&&(oo.getInstance().postNoibuErrorAndOptionallyDisableClient(`video lengthMS is invalid: ${e}, start time: ${this.firstRecordedTimestamp}, end time: `+this.lastRecordedTimestamp,!1,E),this.invalidVideoLength=!0,e=0),this.vfCounter+=1;const t={};t.vid=Os(this.eventBuffer),t.seq=this.vfCounter,t.len=e,t.css_urls=this.getCSSURLsNotReceived(),To.getInstance().addEndTimeToPayload(t,!1),yo.getInstance().addVideoFragData(this.vfCounter,e);const n={};n[se]=t,To.getInstance().sendMessage(_,n),this.lastFragPostTimestamp=Date.now()}catch(e){oo.getInstance().postNoibuErrorAndOptionallyDisableClient("video frag socket closed with err: "+e.message,!1,E),this.stopRecording()}this.eventBuffer=[]}}unfreeze(){this.freezingEvents&&this.rrwebAddCustomEvent("unfreeze",{})}downloadIfAllowed(){if(!this.isRecordingAllowed())return this.listenRecordingAllowedEvent(),void this.listenRecordingLoadedEvent();this.download()}download(){this.listenRecordingLoadedEvent(),Zs("https://cdn.noibu.com/collect-recording.js",null,e=>{oo.getInstance().postNoibuErrorAndOptionallyDisableClient("Error loading session recording script. "+e,!0,E)})}isRecordingAllowed(){try{const{src:e}=document.currentScript;if(new URL(e).searchParams.has("hold"))return!1}catch(e){}return!0}listenRecordingAllowedEvent(){this.isRecordingAllowedHandled||(this.isRecordingAllowedHandled=!0,this.eventListenerManager.trackEventListener(window,"noibuRecordingAllowed",()=>{this.download()}))}listenRecordingLoadedEvent(){this.isRecordingLoadedHandled||(this.isRecordingLoadedHandled=!0,this.eventListenerManager.trackEventListener(window,"noibuRecordingLoaded",e=>{this.handleRRWebLoaded(e.detail)}))}handleRRWebLoaded(e){if(e){if(this.setRRWeb(e)){const e=To.getInstance();Do([Is(),e.connectionPromise]).then(()=>{this.recordUserSession()})}}else oo.getInstance().postNoibuErrorAndOptionallyDisableClient("Error loading rrweb script",!0,E)}setRRWeb(e){return e&&e.record&&e.pack&&e.addCustomEvent?(this.rrwebRecord=e.record,this.rrwebPack=e.pack,this.rrwebAddCustomEvent=e.addCustomEvent,!0):(oo.getInstance().postNoibuErrorAndOptionallyDisableClient("RRweb functions not all present",!0,E),!1)}requestLiveView(){this.liveViewRecording=!0,this.rrwebRecord.takeFullSnapshot(!0)}disableLiveView(){this.liveViewRecording=!1}handleLiveView(e){this.liveViewRecording&&zo.getInstance().sendData(e)}stopRecording(){try{this.recordStopper&&(this.isRecordingStopped=!0,this.eventBuffer=[],this.recordStopper(),this.recordStopper=null)}catch(e){oo.getInstance().postNoibuErrorAndOptionallyDisableClient("Error while trying to stop recording: "+e,!0,E)}}getFirstRecordedTimestamp(){return this.firstRecordedTimestamp}}const Bo=0,qo=1,Go=2;function Ho(){}class jo extends class{_e=new Map;on(e,t){let n=this._e.get(e);n||this._e.set(e,n=[]),n.push(t)}emit(e,...t){const n=this._e.get(e);if(n)for(const e of n)e.apply(null,t)}}{id;connected=!1;_t;_s;_n;_i;_o;_r=[];_c;_a=!0;constructor(e,t){super(),this._t=e,this._s=Object.assign({path:"/socket.io/",reconnectionDelay:2e3},t),this._h()}_h(){this._n=new WebSocket(this._u()),this._n.onmessage=({data:e})=>this._p(e),this._n.onerror=Ho,this._n.onclose=()=>this._l("transport close")}_u(){return`${this._t.replace(/^http/,"ws")}${this._s.path}?EIO=4&transport=websocket`}_p(e){if("string"==typeof e)switch(e[0]){case"0":this._d(e);break;case"1":this._l("transport close");break;case"2":this._T(),this._m("3");break;case"4":let t;try{t=function(e){let t=1;const n={type:parseInt(e.charAt(t++),10)},r=e.indexOf(",");e.substring(t,r);if(t=r+1,e.charAt(t)&&(n.data=JSON.parse(e.substring(t))),!function(e){switch(e.type){case Bo:return"object"==typeof e.data;case qo:return void 0===e.data;case Go:{const t=e.data;return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]}default:return!1}}(n))throw new Error("invalid format");return n}(e)}catch(e){return this._l("parse error")}this._f(t);break;default:this._l("parse error")}}_d(e){let t;try{t=JSON.parse(e.substring(1))}catch(e){return this._l("parse error")}this._o=t.pingInterval+t.pingTimeout,this._T(),this._C()}_f(e){switch(e.type){case Bo:this._g(e);break;case qo:this._a=!1,this._l("io server disconnect");break;case Go:super.emit.apply(this,e.data);break;default:this._l("parse error")}}_g(e){this.id=e.data.sid,this.connected=!0,this._r.forEach(e=>this._y(e)),this._r.slice(0),super.emit("connect")}_l(e){this._n&&(this._n.onclose=Ho,this._n.close()),clearTimeout(this._i),clearTimeout(this._c),this.connected?(this.connected=!1,this.id=void 0,super.emit("disconnect",e)):super.emit("connect_error",e),this._a&&(this._c=setTimeout(()=>this._h(),this._s.reconnectionDelay))}_T(){clearTimeout(this._i),this._i=setTimeout(()=>{this._l("ping timeout")},this._o)}_m(e){this._n.readyState===WebSocket.OPEN&&this._n.send(e)}_y(e){const t=this._s.namespace;this._m("4"+function(e){let n=""+e.type;return t&&(n+="/"+t+","),e.data&&(n+=Os(e.data)),n}(e))}_C(){this._y({type:Bo})}emit(...e){const t={type:Go,data:e};this.connected?this._y(t):this._r.push(t)}disconnect(){this._a=!1,this._l("io client disconnect")}}class zo{constructor(){this.socket=null,this.throttledUpdate=null,this.idleConnectionTimer=null,this.connectionTimeout=12e4}static getInstance(){return zo.instance||(zo.instance=new zo),zo.instance}monitor(){const e=eo.getInstance();if(!e.isAvailable())return;const t=e.loadWithExpiry("noibuHC");t?(e.updateExpiry("noibuHC",12e4),this.connectToSocketIoServer(t)):ao(window,"noibuHCAlert",e=>this.handleHelpCode(e)),ao(window,"noibuPageVisitEvent",e=>this.sendPVEvents(e.detail.type,e.detail.eventObjects))}handleHelpCode(e){const{data:t}=e.detail;eo.getInstance().saveWithExpiry("noibuHC",t,12e4),this.connectToSocketIoServer(t)}connectToSocketIoServer(e){const{domain:t}=le();if(t&&(this.helpcode=e,!this.socket)){try{this.socket=function(e,t){return"string"!=typeof e&&(t=e,e=location.origin),new jo(e,t)}("https://live.noibu.com",{namespace:t,reconnectionDelay:500})}catch(e){return}try{this.throttledUpdate=Xi()(this.updateTTL.bind(this),6e4,{leading:!0,maxWait:6e4,trailing:!1}),this.socket.on("connect",this.errorHandler(()=>{this.socket.emit("join_as_recorder",e)})),this.socket.on("start_sending_data",this.errorHandler(e=>{this.helpcode===e&&(Wo.getInstance().requestLiveView(),_o.getInstance().requestLiveView(),eo.getInstance().updateExpiry("noibuHC",12e4),this.cancelConnectionDisconnectTime())})),this.socket.on("stop_sending_data",this.errorHandler(e=>{this.helpcode===e&&(Wo.getInstance().disableLiveView(),_o.getInstance().disableLiveView(),this.startConnectionDisconnectTimer())})),this.socket.on("user-event",this.errorHandler(()=>{})),this.startConnectionDisconnectTimer()}catch(e){this.disconnectAndCancelThrottledUpdate()}}}startConnectionDisconnectTimer(){this.cancelConnectionDisconnectTime(),this.idleConnectionTimer=setTimeout(()=>{this.disconnectAndCancelThrottledUpdate()},this.connectionTimeout)}cancelConnectionDisconnectTime(){clearTimeout(this.idleConnectionTimer),this.idleConnectionTimer=null}sendData(e){if(this.socket){try{this.socket.emit("send-event-compressed",{event:e,helpcode:this.helpcode})}catch(e){}this.throttledUpdate()}}sendPVEvents(e,t){if(this.socket){try{this.socket.emit("send-njs-events",{type:e,events:t,helpcode:this.helpcode})}catch(e){}this.throttledUpdate()}}updateTTL(){eo.getInstance().updateExpiry("noibuHC",12e4)}disconnectAndCancelThrottledUpdate(){try{this.socket.disconnect()}catch(e){}if(this.socket=null,this.throttledUpdate){try{this.throttledUpdate.cancel()}catch(e){}this.throttledUpdate=null}}errorHandler(e){const t=e=>{this.disconnectAndCancelThrottledUpdate()};return(...n)=>{try{const r=e.apply(this,n);r&&"function"==typeof r.catch&&r.catch(t)}catch(e){t()}}}getSocket(){return this.socket}}class $o{constructor(){this.eventsToDebounce={},this.registerInputType(K,0),this.registerInputType(ne,0),this.registerInputType(re,0),this.registerInputType(Y,500),this.registerInputType(J,500),this.registerInputType(W,500),this.registerInputType(Q,500),this.registerInputType(Z,500,j),this.registerInputType(X,500),this._setupUnloadHandler()}static getInstance(){return this.instance||(this.instance=new $o),this.instance}registerInputType(e,t,n=e){e in this.eventsToDebounce||(this.eventsToDebounce[e]={timeout:null,events:[],debouncePeriod:t,eventName:n})}addEvent(e,t,n){t in this.eventsToDebounce?(n||(n=Date.now()),this.eventsToDebounce[t].events.push({event:e,occurredAt:new Date(ro(n)).toISOString()}),this._debouncePvEvents(t)):oo.getInstance().postNoibuErrorAndOptionallyDisableClient(new Error(`Type: ${t} is not in eventsToDebounce`),!1,E)}_debouncePvEvents(e){clearTimeout(this.eventsToDebounce[e].timeout),this.eventsToDebounce[e].timeout=setTimeout(()=>{this.eventsToDebounce[e].timeout=null,_o.getInstance().addPageVisitEvents(this.eventsToDebounce[e].events,this.eventsToDebounce[e].eventName),this.eventsToDebounce[e].events=[]},this.eventsToDebounce[e].debouncePeriod)}_setupUnloadHandler(){ao(window,"pagehide",()=>{Object.values(this.eventsToDebounce).forEach(e=>{_o.getInstance().addPageVisitEvents(e.events,e.eventName)})})}}const Zo="product_added_to_cart",Ko="product_removed_from_cart",Jo="checkout_started",Yo="payment_info_submitted",Qo="checkout_completed";function Xo(e,t,n,r,i,s){if(ea(t)&&(t=ta(t),null===e))return;if("boolean"===t)return void("boolean"!=typeof e&&r.push(`boolean is expected [${n}]`));if("number"===t)return void("number"!=typeof e&&r.push(`number is expected [${n}]`));if("string"===t)return void("string"!=typeof e&&r.push(`string is expected [${n}]`));if("object"!=typeof e)return void r.push(`${t} is expected [${n}]`);if(null===e)return void r.push(`${t} is expected [${n}]`);if(na(t)){const o=function(e){ea(e)&&(e=ta(e));return e.replace("[]","")}(t);if(Array.isArray(e))for(let t=0;t<e.length;t++){Xo(e[t],o,[...n,`[${t}]`],r,i,s)}else r.push(`array is expected [${n}]`);return}const o=i.get(t);if(void 0===o)return void r.push(`schema "${t}" not found [${n}]`);const a=o.properties.map(e=>e.key);for(const t of Object.keys(e))a.includes(t)||(s.autoRemoveUnexpectedProperties?delete e[t]:r.push(`property "${t}" is not expected [${n}]`));for(const t of o.properties){if(!(t.key in e)){const i=ea(t.type),o=na(t.type),a=ra(t.type),c=s.ignoreMissedNullableProperties,l=s.autoAddMissedNullableProperties,u=s.autoFixMissedNullableProperties;if(i&&c)continue;if(i&&l){e[t.key]=null;continue}if(!i||!u){r.push(`${t.type} is expected [${[...n,t.key]}]`);continue}if(a||o){e[t.key]=null;continue}e[t.key]={}}Xo(e[t.key],t.type,[...n,t.key],r,i,s)}}function ea(e){return e.endsWith("?")}function ta(e){return e.replace("?","")}function na(e){return ea(e)&&(e=ta(e)),e.endsWith("[]")}function ra(e){return ea(e)&&(e=ta(e)),"boolean"===e||"number"===e||"string"===e}const ia=new Map(Object.entries({Money:{properties:[{key:"amount",type:"number?"},{key:"currencyCode",type:"string?"}]},DeliveryOption:{properties:[{key:"cost",type:"Money?"},{key:"costAfterDiscounts",type:"Money?"},{key:"description",type:"string?"},{key:"handle",type:"string?"},{key:"title",type:"string?"},{key:"type",type:"string?"}]},Delivery:{properties:[{key:"selectedDeliveryOptions",type:"DeliveryOption[]?"}]},Product:{properties:[{key:"id",type:"string?"},{key:"title",type:"string?"},{key:"untranslatedTitle",type:"string?"},{key:"type",type:"string?"},{key:"url",type:"string?"},{key:"vendor",type:"string?"}]},ProductVariant:{properties:[{key:"id",type:"string?"},{key:"price",type:"Money?"},{key:"product",type:"Product?"},{key:"sku",type:"string?"},{key:"title",type:"string?"},{key:"untranslatedTitle",type:"string?"}]},DiscountApplication:{properties:[{key:"allocationMethod",type:"string?"},{key:"targetSelection",type:"string?"},{key:"targetType",type:"string?"},{key:"title",type:"string?"},{key:"type",type:"string?"},{key:"value",type:"Money?"}]},DiscountAllocation:{properties:[{key:"amount",type:"Money?"},{key:"discountApplication",type:"DiscountApplication?"}]},SellingPlan:{properties:[{key:"id",type:"string?"},{key:"name",type:"string?"}]},SellingPlanAllocation:{properties:[{key:"sellingPlan",type:"SellingPlan?"}]},OrderCustomer:{properties:[{key:"id",type:"string?"},{key:"isFirstOrder",type:"boolean?"}]},Order:{properties:[{key:"id",type:"string?"},{key:"customer",type:"OrderCustomer?"}]},ShippingRate:{properties:[{key:"price",type:"Money?"}]},TransactionPaymentMethod:{properties:[{key:"name",type:"string?"},{key:"type",type:"string?"}]},Transaction:{properties:[{key:"amount",type:"Money?"},{key:"gateway",type:"string?"},{key:"paymentMethod",type:"TransactionPaymentMethod?"}]},CartLineCost:{properties:[{key:"totalAmount",type:"Money?"}]},CartLine:{properties:[{key:"cost",type:"CartLineCost?"},{key:"merchandise",type:"ProductVariant?"},{key:"quantity",type:"number?"}]},CheckoutLineItem:{properties:[{key:"discountAllocations",type:"DiscountAllocation[]?"},{key:"finalLinePrice",type:"Money?"},{key:"id",type:"string?"},{key:"quantity",type:"number?"},{key:"sellingPlanAllocation",type:"SellingPlanAllocation?"},{key:"title",type:"string?"},{key:"variant",type:"ProductVariant?"}]},Checkout:{properties:[{key:"buyerAcceptsEmailMarketing",type:"boolean?"},{key:"buyerAcceptsSmsMarketing",type:"boolean?"},{key:"currencyCode",type:"string?"},{key:"delivery",type:"Delivery?"},{key:"discountApplications",type:"DiscountApplication[]?"},{key:"discountsAmount",type:"Money?"},{key:"token",type:"string?"},{key:"lineItems",type:"CheckoutLineItem[]?"},{key:"order",type:"Order?"},{key:"shippingLine",type:"ShippingRate?"},{key:"subtotalPrice",type:"Money?"},{key:"totalPrice",type:"Money?"},{key:"totalTax",type:"Money?"},{key:"transactions",type:"Transaction[]?"}]},ProductAddedToCart:{properties:[{key:"cartLine",type:"CartLine?"}]},ProductRemovedFromCart:{properties:[{key:"cartLine",type:"CartLine?"}]},CheckoutStarted:{properties:[{key:"checkout",type:"Checkout?"}]},PaymentInfoSubmitted:{properties:[{key:"checkout",type:"Checkout?"}]},CheckoutCompleted:{properties:[{key:"checkout",type:"Checkout?"}]}}));function sa(e,t){const n={success:!0,errors:[]};try{!function(e,t,n){const r={ignoreMissedNullableProperties:!0,autoFixMissedNullableProperties:!1,autoAddMissedNullableProperties:!1,autoRemoveUnexpectedProperties:!0};switch(e){case Zo:!function(e,t,n){Xo(e,"ProductAddedToCart",[],n.errors,ia,t)}(t,r,n);break;case Ko:!function(e,t,n){Xo(e,"ProductRemovedFromCart",[],n.errors,ia,t)}(t,r,n);break;case Jo:!function(e,t,n){Xo(e,"CheckoutStarted",[],n.errors,ia,t)}(t,r,n);break;case Yo:!function(e,t,n){Xo(e,"PaymentInfoSubmitted",[],n.errors,ia,t)}(t,r,n);break;case Qo:!function(e,t,n){Xo(e,"CheckoutCompleted",[],n.errors,ia,t)}(t,r,n);break;default:n.success=!1,n.errors.push(`Event type "${e}" is not supported.`)}n.errors.length&&(n.success=!1)}(e,t,n)}catch(e){n.success=!1,n.errors.push("Unexpected error: "+e)}if(!n.success)return n;const r={platform:"noibu",name:e,data:Os(t)};return $o.getInstance().addEvent(r,X),n}function oa(e,t,n){const r=n.get(e);if(!r)return{success:!1,errors:["Converter is not implemented."]};let i;try{i=r(t)}catch(e){return{success:!1,errors:["Converter error: "+e]}}const s={success:!0,errors:[]};for(const t of i)try{const n=sa(e,t);n.success||(s.success=!1,s.errors.push(...n.errors))}catch(e){s.success=!1,s.errors.push("Unexpected error: "+e)}return s}const aa=e=>[e],ca=new Map;ca.set(Zo,aa),ca.set(Ko,aa),ca.set(Jo,aa),ca.set(Yo,aa),ca.set(Qo,aa);const la={"input.noibu.com":!0,"input.staging.noibu.com":!0,"vf.noibu.com":!0,"vf.staging.noibu.com":!0,"cdn.noibu.com":!0};function ua(e,t=!0){return{url:js(e.filename),[L]:B,j_err:Ns(e.error,t)}}function da(e,t,n){var r;let i=t;(null===(r=null==t?void 0:t.error)||void 0===r?void 0:r.originalError)&&(i=t.error.originalError);let s,o=e;switch(e){case be:s=function(e,t){const n={url:js(e.responseURL,!0),[L]:V,h_code:Math.max(e.status,0)};return(t||0===t)&&(n.seq=t),n}(i,n);break;case Ie:s=ua(i);break;case Se:s=function(e,t){const n={url:js(e.url,!0),[L]:V,h_code:Math.max(e.status,0)};return(t||0===t)&&(n.seq=t),n}(i,n);break;case"GQLError":o=Se,s=function(e,t){const n={url:Ms(),[L]:q,gql_err:e};return(t||0===t)&&(n.seq=t),n}(i,n);break;case"CSPError":o=Ie,a=i,s={url:Ms(),[L]:G,csp_err:a};break;case"ImageError":o=Ie,s=function(e){return{url:Ms(),[L]:H,res_err:e}}(i);break;case Ee:s=function(e){return{url:Ms(),[L]:ee,pagecheck_err:e}}(i);break;case ke:s=ua(i,!1);break;case Ae:s=ua(i);break;case Te:s=function(e){return{url:Ms(),[L]:B,j_err:Ns(e)}}(i);break;case Ce:case _e:s=ua(i);break;default:try{s=ua(i),i instanceof Event&&(!function(e,t,n){let r=null;if(n.detail)try{r=Os(n.detail)}catch(e){r="non-serializable"}let i=`Fire error event of type ${e}.`;null!=r&&(i+=` Detail: ${r}.`),t.j_err.msg=ks(i)}(o,s,i),o=Ie)}catch(e){return null}}var a;return s&&(s.err_src=o),s}const ha=_s(Ls(ls((new Error).stack)).pop().file);function pa(e,t,n,r){if(e===we)return;const i=da(e,t,n);if(!i||!i.url)return;const s=i.url;if(qs(s)){const e=new URL(s);if(e.hostname in la||!e.protocol.startsWith("http"))return}if(function(e){const t=Os(e);return qe.some(e=>e(t))}(i))return;(function(e){if(e[L]===B){if(e.j_err){const t=e.j_err.frames;if(t&&t.length>0){const n=t[0].file.toLowerCase(),r=t[0].mname.toLowerCase();if(n.includes("noibu")&&_s(n)===ha&&!r.includes("nbuwrapper")&&!n.includes("noibu-customer-session-playback"))return oo.getInstance().postNoibuErrorAndOptionallyDisableClient(e,!1,E),!0}}if(e.msg){const t=e.msg.toLowerCase();if(t.includes("input.noibu")||t.includes("input.b.noibu"))return oo.getInstance().postNoibuErrorAndOptionallyDisableClient(e,!1,E),!0}}else if(e[L]===V&&e.url){const t=e.url;if("string"==typeof t)for(let n=0;n<ue.length;n+=1){const r=ue[n];if(t.includes(r))return oo.getInstance().postNoibuErrorAndOptionallyDisableClient(e,!1,E),!0}}return!1})(i)||(yo.getInstance().addError(),$o.getInstance().addEvent(i,J,r))}class ga{static configure(e){return this.allowUntrustedEvents=e,this.initialRequest=!1,this.instance||(this.instance=new ga),this.instance}static getInstance(){if(!this.instance)throw new Error("HelpCode was not configured");return this.instance}constructor(){this.requestContext=null,Ks()&&(ao(window,"hashchange",e=>this._handleHashChange(e)),ao(window,"noibuHelpCode",e=>this._receiveHelpCode(e)))}requestHelpCode(e=!0){if(null!=this.requestContext)return this.requestContext.promise;const t={alertUser:e,resolve:null,reject:null,promise:null};t.promise=new Promise((e,n)=>{t.resolve=e,t.reject=n}),this.requestContext=t;return!1===this._sendRequest()?(this.requestContext=null,Promise.reject(new Error("noibu connection is unavailable"))):this.requestContext.promise}checkInitialRequest(){Ms().toLowerCase().includes("#helpcode")&&!1===ga.initialRequest&&(ga.initialRequest=!0,this._sendRequest())}_handleHashChange(e){if(!e.isTrusted&&!ga.allowUntrustedEvents)return;!e.oldURL.toLowerCase().includes("#helpcode")&&e.newURL.toLowerCase().includes("#helpcode")&&(window.history.back(),this._sendRequest())}_receiveHelpCode(e){if(null==this.requestContext)return void this._presentHelpCode(e);const t=this.requestContext;this.requestContext=null,!0===t.alertUser&&this._presentHelpCode(e);const{success:n,data:r}=e.detail;n?t.resolve(r):t.reject(new Error(r))}_presentHelpCode(e){const{success:t,data:n}=e.detail;if(t){window.prompt("",n);const e=new CustomEvent("noibuHCAlert",{detail:{data:n}});window.dispatchEvent(e)}else{const e="Noibu help code is not available due to "+n;window.alert(e),oo.getInstance().postNoibuErrorAndOptionallyDisableClient(e,!1,E)}}_sendRequest(){return To.getInstance().sendMessage(U,{[U]:F})}}class fa{constructor(){this.customIDs={},this.customErrorsCount=0,this.internalCustomIDs={},this.TOO_MANY_IDS_ADDED_MSG="TOO_MANY_IDS_ADDED",this.ID_NAME_ALREADY_ADDED_MSG="ID_NAME_ALREADY_ADDED",this.NAME_TOO_LONG_MSG="NAME_TOO_LONG",this.VALUE_TOO_LONG_MSG="VALUE_TOO_LONG",this.INVALID_NAME_TYPE_MSG="INVALID_NAME_TYPE",this.INVALID_VALUE_TYPE_MSG="INVALID_VALUE_TYPE",this.NAME_HAS_NO_LENGTH_MSG="NAME_HAS_NO_LENGTH",this.VALUE_HAS_NO_LENGTH_MSG="VALUE_HAS_NO_LENGTH",this.SUCCESS_MSG="SUCCESS",this.ERROR_HAS_NO_MSG_MSG="ERROR_HAS_NO_MSG",this.ERROR_HAS_NO_STACK_MSG="ERROR_HAS_NO_STACK",this.NULL_CUSTOM_ERR_MSG="NULL_CUSTOM_ERROR",this.ERROR_ALREADY_RECEIVED_MSG="ERROR_ALREADY_RECEIVED",this.INVALID_ERROR_SOURCE_MSG="INVALID_ERROR_SOURCE_MSG",this.TOO_MANY_ERRORS_RECEIVED_PER_PAGEVISIT_MSG="TOO_MANY_ERRORS_RECEIVED_PER_PAGEVISIT"}static getInstance(){return this.instance||(this.instance=new fa),this.instance}exposeFunctions(){const e=this._getSDKWindowObject();window.NOIBUJS=e,window.dispatchEvent(new CustomEvent("noibuSDKReady"))}_getSDKWindowObject(){return{requestHelpCode:this.requestHelpCode.bind(this),addCustomAttribute:this.addCustomAttribute.bind(this),addError:this.addCustomError.bind(this),addJsSdkError:this._addErrorFromJSSdk.bind(this),noibuBrowserID:this.noibuBrowserID.bind(this),resetSession:this.resetSession.bind(this),track:sa}}_validateCustomError(e){return e?e.message?e.stack?this.SUCCESS_MSG:this.ERROR_HAS_NO_STACK_MSG:this.ERROR_HAS_NO_MSG_MSG:this.NULL_CUSTOM_ERR_MSG}_validateAndSetCustomError(e){if(this.customErrorsCount>=500)return this.TOO_MANY_ERRORS_RECEIVED_PER_PAGEVISIT_MSG;const t=this._validateCustomError(e);return t!==this.SUCCESS_MSG?t:(this.customErrorsCount+=1,this.SUCCESS_MSG)}_addErrorFromJSSdk(e,t){const n=this._validateAndSetCustomError(e);return n!==this.SUCCESS_MSG?n:t!==Re&&t!==Me?this.INVALID_ERROR_SOURCE_MSG:(pa(t,{error:e}),n)}addCustomError(e){const t=this._validateAndSetCustomError(e);return t!==this.SUCCESS_MSG||pa(_e,{error:e}),t}addCustomAttribute(e,t){return this.addCustomAttributeInternal(e,t,!1)}addNoibuInternalCustomAttribute(e,t){return this.addCustomAttributeInternal(e,t,!0)}addCustomAttributeInternal(e,t,n){let r=this.customIDs;if(n&&(r=this.internalCustomIDs),yo.getInstance().addCustomAttributeTotalCount(),!n&&Object.keys(r).length>=50)return yo.getInstance().addCustomAttributeFailCount(),this.TOO_MANY_IDS_ADDED_MSG;const i=this._validateCustomIDInput(e,t);if(i!==this.SUCCESS_MSG)return yo.getInstance().addCustomAttributeFailCount(),i;if(e in r)return yo.getInstance().addCustomAttributeFailCount(),this.ID_NAME_ALREADY_ADDED_MSG;if(r[e]=t,To.getInstance().sendMessage(R,{[oe]:{id_name:e,id_val:t}}),!n){const e=Object.keys(r).length;yo.getInstance().setCustomAttributeKeyCount(e)}return this.SUCCESS_MSG}_validateCustomIDInput(e,t){return"string"!=typeof e?this.INVALID_NAME_TYPE_MSG:"string"!=typeof t?this.INVALID_VALUE_TYPE_MSG:t.length>500?this.VALUE_TOO_LONG_MSG:e.length>100?this.NAME_TOO_LONG_MSG:0===t.length?this.VALUE_HAS_NO_LENGTH_MSG:0===e.length?this.NAME_HAS_NO_LENGTH_MSG:this.SUCCESS_MSG}requestHelpCode(e=!0){return ga.getInstance().requestHelpCode(e)}noibuBrowserID(){return oo.getInstance().browserId}resetSession(){oo.getInstance().scheduleResetClientConfig()}}class ma{constructor(){this.eventDebouncer=$o.getInstance(),this.inputManager=fa.getInstance()}static getInstance(){return this.instance||(this.instance=new ma),this.instance}monitor(){window.addEventListener("message",e=>{if(e.data)if("noibuShopifyEvent"===e.data.type){if("ping"===e.data.payload){return void e.source.postMessage("ping","*")}this.handleStandardEvent(e.data.payload,null)}else if("noibuShopifyEventWithName"===e.data.type){if(!e.data.payload)return;if("ping"===e.data.payload){return void e.source.postMessage("ping","*")}"StandardEvent"===e.data.payload.type?this.handleStandardEvent(e.data.payload.data,e.data.payload.extra):"CustomEvent"===e.data.payload.type?this.handleCustomEvent(e.data.payload.data):"DomEvent"===e.data.payload.type&&this.handleDomEvent(e.data.payload.data)}}),this.notifyPixels()}notifyPixels(){document.querySelectorAll("iframe").forEach(e=>{try{e.contentWindow.postMessage("ping","*")}catch(e){}})}handleStandardEvent(e,t){let{data:n}=e;"page_viewed"===e.name&&(n={location:e.context.window.location.href,title:e.context.document.title},this.inputManager.addCustomAttributeInternal("clientId",e.clientId,!0),(null==t?void 0:t.cartId)&&this.inputManager.addCustomAttributeInternal("cartId",t.cartId,!0),(null==t?void 0:t.customerId)&&this.inputManager.addCustomAttributeInternal("customerId",t.customerId,!0));const r={platform:"shopify",name:e.name,data:Os(n)};this.eventDebouncer.addEvent(r,X),oa(e.name,n,ca)}handleCustomEvent(e){const{customData:t}=e,n={platform:"shopify",name:e.name,data:Os(t)};this.eventDebouncer.addEvent(n,X)}handleDomEvent(e){const{data:t}=e,n={platform:"shopify",name:e.name,data:Os(t)};this.eventDebouncer.addEvent(n,X)}}ma.instance=null;const va=new Map;function ya(e){const t=[];for(const n of e.line_items){const e={cartLine:{quantity:n.quantity,cost:{totalAmount:{amount:n.purchase_price,currencyCode:n.currency}},merchandise:Ia(n)}};t.push(e)}return t}function ba(e){return{checkout:{currencyCode:e.currency,totalPrice:{amount:e.cart_value,currencyCode:e.currency},lineItems:e.line_items.map(e=>({quantity:e.quantity,title:e.product_name,finalLinePrice:{amount:e.purchase_price,currencyCode:e.currency},variant:Ia(e)}))}}}function Ia(e){return{id:""+e.variant_id,sku:e.sku,price:{amount:e.base_price,currencyCode:e.currency},product:{id:e.product_id,title:e.product_name}}}va.set(Zo,(function(e){return ya(e)})),va.set(Ko,(function(e){return ya(e)})),va.set(Jo,(function(e){return[ba(e)]})),va.set(Yo,(function(e){return[ba(e)]})),va.set(Qo,(function(e){return[ba(e)]}));class Ca{constructor(){this.eventDebouncer=$o.getInstance()}static getInstance(){return this.instance||(this.instance=new Ca)}monitor(){const e=this.subscribeEvents.bind(this);ao(window,"load",e,!1)}subscribeEvents(){const e=window.bodlEvents;if(!e)return;const{banner:t,product:n,cart:r,checkout:i}=e,s=(e,t,n)=>{if("object"==typeof e&&"function"==typeof e[t]){const r=e=>this.handleEvent(n,e);e[t](r)}};s(t,"viewed","banner_viewed"),s(n,"searchPerformed","search_submitted"),s(n,"pageViewed","product_viewed"),s(n,"categoryViewed","collection_viewed"),s(r,"viewed","cart_viewed"),s(r,"addItem","product_added_to_cart"),s(r,"removeItem","product_removed_from_cart"),s(i,"checkoutBegin","checkout_started"),s(i,"shippingDetailsProvided","checkout_shipping_info_submitted"),s(i,"paymentDetailsProvided","payment_info_submitted"),s(i,"orderPurchased","checkout_completed")}handleEvent(e,t){const n={name:e,platform:"bigcommerce",data:Os(t)};this.eventDebouncer.addEvent(n,X),function(e,t){oa(e,t,va)}(e,t)}}Ca.instance=null;const wa=new Map;function Sa(e){const{eventInfo:t}=e,{storefrontInstanceContext:n,changedProductsContext:r}=t,i=r.items,s=n.storeViewCurrencyCode,o=[];for(const e of i){const{product:t}=e,n={cartLine:{quantity:e.quantity,cost:{totalAmount:{amount:e.prices.price.value,currencyCode:s}},merchandise:{id:t.productId,title:t.name,sku:t.sku}}};o.push(n)}return o}function Ea(e){const{eventInfo:t}=e,{storefrontInstanceContext:n,shoppingCartContext:r}=t,{items:i}=r,s=n.storeViewCurrencyCode,o=[];for(const e of i){const t={id:e.id,quantity:e.quantity,variant:ka(e,s)};o.push(t)}return{checkout:{currencyCode:s,lineItems:o}}}function ka(e,t){const{product:n}=e;return{id:n.productId,price:{amount:n.pricing.regularPrice,currencyCode:t},sku:n.sku,title:n.name}}wa.set(Zo,(function(e){return Sa(e)})),wa.set(Ko,(function(e){return Sa(e)})),wa.set(Jo,(function(e){return[Ea(e)]})),wa.set(Qo,(function(e){const t=Ea(e);return t.checkout.order={id:e.eventInfo.orderContext.orderId},[t]}));class Aa{constructor(){this.clientConfig=oo.getInstance(),this.eventDebouncer=$o.getInstance()}static getInstance(){return this.instance||(this.instance=new Aa)}monitor(){const e=()=>!!window.magentoStorefrontEvents&&!!window.magentoStorefrontEvents.subscribe;if(e())return void this.subscribeEvents();let t=0;const n=setInterval(()=>{t+=1,t>5&&clearInterval(n),e()&&(clearInterval(n),this.subscribeEvents())},1e3)}subscribeEvents(){try{const{subscribe:e}=window.magentoStorefrontEvents,t=this.handleEvent.bind(this);e.pageView(e=>t("page_viewed",e)),e.addToCart(e=>t("product_added_to_cart",e)),e.removeFromCart(e=>t("product_removed_from_cart",e)),e.initiateCheckout(e=>t("checkout_started",e)),e.placeOrder(e=>t("checkout_completed",e))}catch(e){const t="MagentoEventMonitor: "+e;this.clientConfig.postNoibuErrorAndOptionallyDisableClient(t,!1,E)}}handleEvent(e,t){const n={name:e,platform:"magento",data:Os(t)};this.eventDebouncer.addEvent(n,X),function(e,t){oa(e,t,wa)}(e,t)}}function Ta(){try{Cs(window.history,"pushState",(function(e){return function nbuWrapper(t,n,r){e.call(history,t,n,r),_a()}})),ao(window,"popstate",_a),ao(window,"hashchange",_a)}catch(e){}}function _a(){const e=new CustomEvent("noibuNavigation");window.dispatchEvent(e)}Aa.instance=null;const Ra=["password","address","credit","postal","token","phone","mobile","expir","account","email","cardnumber","lastname"],Ma=["firstname","lastname","street","fullname","creditcard","postcode","zipcode","city","town","county","cc","cardtype","cardnumber","email","nameoncard"];function La(e){return Ma.some(t=>e===t)||Ra.some(t=>e.indexOf(t)>=0)}function Na(e){return"string"!=typeof e?null:e.length?e=function(e){return C.forEach(t=>{e=e.replace(t,"******")}),e=function(e){return e.replace(/(?<!\d)(\+1\s?)?(\(?\d{3}\)?)[\s.-]?(\d{3})[\s.-]?(\d{4})\b/g,e=>{const t=e.replace(/\D/g,"");return e.includes("+1")&&11===t.length||!e.includes("+1")&&10===t.length?"******":e})}(e)}(e=function(e){const t=e[0];if(!("{"===t||"["===t))return e;let n=!1;try{const t=JSON.parse(e);return((e,t,n={depth:10})=>{const r=(e,i)=>{if(!(i>n.depth))for(const n in e)try{const s=t(e,n,e[n]);void 0!==s&&(e[n]=s),null!==e[n]&&"object"==typeof e[n]&&r(e[n],i+1)}catch(e){}};r(e,1)})(t,(e,t)=>{if("string"!=typeof t)return;return La(t.toLowerCase())?(n=!0,"******"):void 0}),n?Os(t):e}catch(t){return e}}(e)):e}var xa=function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function o(e){try{c(r.next(e))}catch(e){s(e)}}function a(e){try{c(r.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}c((r=r.apply(e,t||[])).next())}))};class Da{constructor(){this.contentTypeReadableRegex=new RegExp("text|json|xml|html|graphql|x-www-form-urlencoded|form-data","i");const e=Ms();if(this.initialURLPartsReversed=[],this.hostname="",e&&e.length>0)try{this.hostname=new URL(e).hostname,this.initialURLPartsReversed=this.hostname.split("."),w.test(this.initialURLPartsReversed[0])&&this.initialURLPartsReversed.shift(),this.initialURLPartsReversed.reverse()}catch(e){oo.getInstance().postNoibuErrorAndOptionallyDisableClient("Unable to determine hostname for initial URL: "+e,!1,k)}this.httpDataCollectionEnabled=!!le().http_data_collection;const t=Ws();this.httpDataAllowedAbsoluteRegex=Da.buildAllowedRegex(t,!0),this.httpDataAllowedRelativeRegex=Da.buildAllowedRegex(t,!1)}static getInstance(){return this.instance||(this.instance=new Da),this.instance}static buildAllowedRegex(e,t){if(!e||!Array.isArray(e))return null;const n=e.map(e=>Hs(e).toLowerCase()).filter(e=>{const n=Da.isAbsoluteURL(e);return t?e&&n:e&&!n});return n.length>0?new RegExp(n.join("|")):null}static headersMapFromIterable(e){const t=new Map;for(const n of e)"string"!=typeof n[0]&&(n[0]=String(n[0])),"string"!=typeof n[1]&&(n[1]=String(n[1])),t.set(n[0].toLowerCase(),n[1]);return t}static headersMapFromString(e){const t=new Map;if(!e||"string"!=typeof e)return t;return e.split("\r\n").filter(Boolean).forEach((function(e){const n=e.split(": ");2===n.length&&n[0].length>0&&n[1].length>0&&t.set(n[0].toLowerCase(),n[1])})),t}static getResponseStringFromXHR(e){return xa(this,void 0,void 0,(function*(){var t;if(!e)return null;if(""===e.responseType||"text"===e.responseType)return e.responseText;if(!e.response)return"null";if(null===(t=e.response.documentElement)||void 0===t?void 0:t.innerHTML)return e.response.documentElement.innerHTML;if("function"==typeof e.response.text)return yield e.response.text();if("json"===e.responseType)try{const t=Os(e.response);return"{}"===t?null:t}catch(e){return oo.getInstance().postNoibuErrorAndOptionallyDisableClient("Unable to stringify JSON response: "+e,!1,k),null}return null}))}isURLSameDomain(e,t=!1){if("string"!=typeof e||!this.initialURLPartsReversed||this.initialURLPartsReversed.length<1)return!1;let n=t?e:"";if(!t)try{let t=e;e.startsWith("//")&&(t="https:"+e),n=new URL(t).hostname}catch(e){return oo.getInstance().postNoibuErrorAndOptionallyDisableClient("Unable to determine hostname for request URL: "+e,!1,k),!1}const r=n.split(".");if(r.length<1)return!1;if(w.test(r[0])&&r.shift(),r.reverse(),!t&&r.length<this.initialURLPartsReversed.length)return!1;if(t){const e=r.length>=this.initialURLPartsReversed.length&&this.initialURLPartsReversed.every((e,t)=>e===r[t]),t=r.length<=this.initialURLPartsReversed.length&&r.every((e,t)=>e===this.initialURLPartsReversed[t]);return e||t}return this.initialURLPartsReversed.every((e,t)=>e===r[t])}bundleHTTPData(e,t,n,r,i,s,o){if(!this.isValidRequest(e,s))return null;let a="",c="";this.shouldCollectPayloadForURL(e)&&(a=this.getReasonPayloadIsDropped(t,o)||this.stringFromRequestBody(n,t),c=this.getReasonPayloadIsDropped(r,o)||this.stringFromRequestBody(i,r));const l=t||new Map,u=a||"",d=r||new Map,h=c||"";if(0===l.size&&!u&&0===d.size&&!h)return null;const p=this.restrictPayload(u,e,o),g=this.restrictPayload(h,e,o);return{rqh:ws(this.removePIIHeaders(t)),rqp:p,rsh:ws(this.removePIIHeaders(r)),rsp:g}}isValidRequest(e,t){return!!this.httpDataCollectionEnabled&&!(!t||"string"!=typeof t)}shouldContinueForURL(e){return!!this.httpDataCollectionEnabled&&(!(!e||"string"!=typeof e||!this.initialURLPartsReversed)&&!(Da.isAbsoluteURL(e)&&!this.isURLSameDomain(e)&&!this.shouldCollectPayloadForURL(e)))}static isAbsoluteURL(e){return!(!e||"string"!=typeof e)&&(e.indexOf("://")>0||0===e.indexOf("//"))}shouldCollectPayloadForURL(e){if(!e||"string"!=typeof e)return!1;const t=!!this.httpDataAllowedAbsoluteRegex&&this.httpDataAllowedAbsoluteRegex.test(e.toLowerCase()),n=(!Da.isAbsoluteURL(e)||this.isURLSameDomain(e))&&!!this.httpDataAllowedRelativeRegex&&this.httpDataAllowedRelativeRegex.test(e.toLowerCase());return t||n}restrictPayload(e,t,n){if(!e||!this.shouldCollectPayloadForURL(t))return"null";if("string"!=typeof e)return oo.getInstance().postNoibuErrorAndOptionallyDisableClient({msg:"restrictPayload received non string payload",payloadType:typeof e},!1,E),"null";if("null"===e||e.startsWith&&(e.startsWith("Dropped due to length.")||e.startsWith("Dropped due to unsupported type."))||e.indexOf&&(0===e.indexOf("Dropped due to length.")||0===e.indexOf("Dropped due to unsupported type.")))return e;let r=n?262144:65536;return"www.holtrenfrew.com"===this.hostname&&(r=1572864),e.length>r?(yo.getInstance().addHttpDataDropByLength(),"Dropped due to length. Payload length: "+e.length):(yo.getInstance().addHttpDataPayloadCount(),Na(e))}contentLengthAcceptable(e,t){let n=t?262144:65536;return"www.holtrenfrew.com"===this.hostname&&(n=1572864),this.contentLength(e)<=n}contentTypeAcceptable(e){const t=e.get("content-type");return!(t&&!this.contentTypeReadableRegex.test(t.toLowerCase()))}getReasonPayloadIsDropped(e,t){if(!(null==e?void 0:e.get))return"";const n=Da.getInstance();return n.contentTypeAcceptable(e)?n.contentLengthAcceptable(e,t)?"":(yo.getInstance().addHttpDataDropByLength(),"Dropped due to length. Payload length: "+n.contentLength(e)):(yo.getInstance().addHttpDataDropByType(),"Dropped due to unsupported type. Payload type: "+e.get("content-type"))}contentLength(e){if(!(null==e?void 0:e.get))return 0;let t=0;const n=e.get("content-length");if(!n)return-1;try{if(t=parseInt(n,10),Number.isNaN(t))return-1}catch(e){return-1}return t}stringFromRequestBody(e,t){if(null==e)return null;try{if($s(e)&&t instanceof Map){const n=t.get("content-type");n&&n.toLowerCase().includes("application/x-www-form-urlencoded")&&(e=new URLSearchParams(e))}}catch(e){}try{(e instanceof FormData||e instanceof URLSearchParams)&&(e=Array.from(e.entries()).reduce((e,[t,n])=>(e[t]=this.stringFromRequestBody(n,null),e),{}))}catch(e){}try{const t=e.toString();if(!t.includes("[object"))return t}catch(e){}try{return e.documentElement.innerHTML}catch(e){}try{return Os(e)}catch(e){oo.getInstance().postNoibuErrorAndOptionallyDisableClient("Unable to stringify request body: "+e,!1,k)}return null}removePIIHeaders(e){if(!(e instanceof Map))return null;if(!e.size)return e;const t=new Map(e);return t.forEach((e,t,n)=>{y.includes(t.toLowerCase())?n.set(t,"******"):n.set(t,Na(e))}),t}static removePIIFromURL(e){try{if(Da.isAbsoluteURL(e)){const t=new URL(e);return Array.from(t.searchParams.entries()).forEach(([e,n])=>{La(e)?t.searchParams.set(e,"******"):t.searchParams.set(e,Na(n))}),t.toString()}{const[t,n]=e.split("?");if(!n)return e;const r=new URLSearchParams(n);return Array.from(r.entries()).forEach(([e,t])=>{La(e)?r.set(e,"******"):r.set(e,Na(t))}),t+"?"+r.toString()}}catch(t){return e}}}function Oa(e){return"number"!=typeof e||(e>=400||e<=0)}class Pa{constructor(e,t,n=null){const r=e=>!e||e<0?0:e;this.httpEvent={code:r(e.code),r_time:r(e.r_time),mtd:(e.mtd||"get").toUpperCase(),url:ks(Us(e.url))},this.httpData=t,this.gqlError=n}saveHTTPEvent(){if(!this.httpEvent||!Hs(this.httpEvent.url))return;yo.getInstance().addHttpEvent();const e=this.httpEvent.code,t=!!this.gqlError;if(this.httpData){const n=yo.getInstance().httpSequenceNumber;if(Pa.isSendAllowed(e,n,t)){this.httpData.seq=n,this.httpEvent.seq=n,yo.getInstance().addHttpData();const e={};e[ae]=this.httpData,To.getInstance().sendMessage(M,e)}else yo.getInstance().addHttpDataOverLimit()}Oa(e)?_o.getInstance().addPageVisitEvent({event:this.httpEvent,occurredAt:new Date(ro(Date.now())).toISOString()},W):$o.getInstance().addEvent(this.httpEvent,W)}static isSendAllowed(e,t,n=!1){const r=Oa(e)||n;if(!r){if(t<100)return!0;0}return r&&t<120}}var Fa=function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function o(e){try{c(r.next(e))}catch(e){s(e)}}function a(e){try{c(r.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}c((r=r.apply(e,t||[])).next())}))};function Ua(e){try{const{origin:t}=e,n=new CustomEvent("noibuFrameAttach",{detail:e});window.dispatchEvent(n)}catch(e){}}function Va(e){e.forEach(e=>{"childList"===e.type&&e.addedNodes.forEach(e=>{const t=e;if("IFRAME"===t.tagName||"FRAME"===t.tagName){const e=t,{contentWindow:n}=e;n&&Ua(n)}})})}function Wa(){return Fa(this,void 0,void 0,(function*(){yield Is(),function(){try{const e={childList:!0,subtree:!0};new MutationObserver(Va).observe(document.body,e)}catch(e){}}();try{for(let e=0;e<window.frames.length;e++){Ua(window.frames[e])}}catch(e){}}))}const Ba=["Click","Change","Input","Submit"];class qa{constructor(){this.subscribers=new Set,this.cancelled=!1}subscribe(e){this.cancelled?e():this.subscribers.add(e)}cancel(){this.cancelled=!0;for(const e of this.subscribers)try{e()}catch(e){}this.subscribers.clear()}assert(){if(this.cancelled)throw new Error("Cancelled.")}}class Ga extends Error{constructor(e,t,n,r,i){super(e.message),this.name=this.constructor.name,this.original=e,this.checkId=t||null,this.version=n||null,this.triggerId=r||null,this.assertionId=i||null}}var Ha,ja=function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function o(e){try{c(r.next(e))}catch(e){s(e)}}function a(e){try{c(r.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}c((r=r.apply(e,t||[])).next())}))};!function(e){e[e.Started=1]="Started",e[e.TriggerCompleted=2]="TriggerCompleted",e[e.AssertionCompleted=3]="AssertionCompleted"}(Ha||(Ha={}));class za{get cancelled(){return this.cancellation.cancelled}constructor(e,t,n,r,i,s,o){this.tag=`${t.id}-${Date.now()}`,this.pageVisitId=e,this.check=t,this.watcher=n,this.dispatcher=r,this.cancellation=i,this.inputManager=s,this.logger=o}start(){return ja(this,void 0,void 0,(function*(){const e=this.logger.tag(this.tag,this.logger.log);try{this.submitStatus(Ha.Started),yield this.waitTriggers(e),this.submitStatus(Ha.TriggerCompleted),yield this.waitAssertions(e),this.submitStatus(Ha.AssertionCompleted)}catch(t){throw e(`Check failed. ${t} Stack: ${t.stack}`),t}}))}cancel(){return ja(this,void 0,void 0,(function*(){this.logger.tag(this.tag,this.logger.log)("Cancel."),this.cancellation.cancel()}))}waitTriggers(e){return ja(this,void 0,void 0,(function*(){const t=this.check.triggers.map(t=>this.waitTriggerSafely(t,e));yield Promise.all(t),this.cancellation.assert()}))}waitAssertions(e){return ja(this,void 0,void 0,(function*(){const t=this.check.assertions.map(t=>this.waitAssertionSafely(t,e));yield Promise.all(t),this.cancellation.assert()}))}waitTriggerSafely(e,t){return ja(this,void 0,void 0,(function*(){try{yield this.waitTrigger(e,t)}catch(t){throw new Ga(t,this.check.id,this.check.version,e.id,null)}}))}waitAssertionSafely(e,t){return ja(this,void 0,void 0,(function*(){try{yield this.waitAssertion(e,window.document.body,t)}catch(t){throw new Ga(t,this.check.id,this.check.version,null,e.id)}}))}waitTrigger(e,t){return ja(this,void 0,void 0,(function*(){(t=this.logger.tag(e.id,t))("Wait trigger",e);const n=e.trigger_type,r=e.element_selector;switch(n){case"PageLoad":yield this.waitPageLoadEvent(e.trigger_value,t);break;case"Click":yield this.waitCommonElementEvent("click",r);break;case"Input":yield this.waitCommonElementEvent("input",r);break;case"Submit":yield this.waitCommonElementEvent("submit",r);break;case"Change":{const t=e.trigger_value;yield this.waitChangeEvent(r,t);break}default:throw new Error(`Trigger type "${n}" is not supported.`)}}))}waitAssertion(e,t,n){return ja(this,void 0,void 0,(function*(){(n=this.logger.tag(e.id,n))("Wait assertion",e);const r=e.assertion_type,i=e.element_selector,s=e.assertion_value,{timeout:o,text:a,group:c}=s;let l=!1;try{switch(r){case"ElementExists":{const e=yield this.waitElement(t,i,a,o,n);c&&(yield this.assertGroup(e,c,n));break}case"TextExists":yield this.waitText(t,a,o,n);break;default:l=!0}}catch(e){if(s.negated)return;throw e}if(l)throw new Error(`Assertion type "${r}" is not supported.`);if(s.negated)throw new Error("Assertion failed (negated).")}))}waitElement(e,t,n,r,i){return ja(this,void 0,void 0,(function*(){const s=ho(t);return this.waitElementBySelector(e,s,n,r,i)}))}waitText(e,t,n,r){return ja(this,void 0,void 0,(function*(){return this.waitElementBySelector(e,null,t,n,r)}))}waitElementBySelector(e,t,n,r,i){return ja(this,void 0,void 0,(function*(){return co(e,t,null==n?void 0:n.content,null==n?void 0:n.regex,r,this.watcher,this.cancellation,i)}))}assertGroup(e,t,n){return ja(this,void 0,void 0,(function*(){const r=ho(t.element_selector),i=[...e.querySelectorAll(r)];let{max:s,min:o}=t;if(-1===s&&(s=Number.MAX_SAFE_INTEGER),-1===o&&(o=Number.MAX_SAFE_INTEGER),i.length>s)throw new Error("The maximum number of elements has been exceeded.");if(i.length<o)throw new Error("The minimum number of elements has not been met.");let a=Date.now();const c=[];for(const e of i)for(const r of t.items){r.id=a+=1,r.assertion_value.timeout=0;const t=this.waitAssertion(r,e,n);c.push(t)}yield Promise.all(c)}))}waitPageLoadEvent(e,t){return ja(this,void 0,void 0,(function*(){return new Promise(n=>{Is().then(()=>{(null==e?void 0:e.text)&&(e.text.content||e.text.regex)?co(window.document.body,null,e.text.content,e.text.regex,0,this.watcher,this.cancellation,t).then(()=>e.negated?null:n()).catch(()=>e.negated?n():null):n()})})}))}waitCommonElementEvent(e,t){return ja(this,void 0,void 0,(function*(){const n=ho(t);yield new Promise((t,r)=>{const i=r=>{const s=r.target.closest(n);s&&(this.dispatcher.unsubscribe(e,i),t(s))};this.cancellation.subscribe(()=>{this.dispatcher.unsubscribe(e,i);const t=new Error("Waiting click has been cancelled.");r(t)}),this.dispatcher.subscribe(e,i)})}))}waitChangeEvent(e,t){return ja(this,void 0,void 0,(function*(){const n=ho(e);yield new Promise((e,r)=>{const i=r=>{var s;const o=r.target;if(!o.matches(n))return;if(void 0!==o.value&&(null===(s=null==t?void 0:t.ignore_value)||void 0===s?void 0:s.length)){const e=t.ignore_value;if(e.includes(o.value))return;if("SELECT"===o.tagName){const t=o,{text:n}=t.options[t.selectedIndex];if(e.includes(n))return}}this.dispatcher.unsubscribe("change",i),e(!0)};this.cancellation.subscribe(()=>{this.dispatcher.unsubscribe("change",i);const e=new Error("Waiting change has been cancelled.");r(e)}),this.dispatcher.subscribe("change",i)})}))}submitStatus(e){}}class $a{constructor(){this.entries=[]}tag(e,t){return(n,r)=>{n=`[${e}] ${n}`,t.call(this,n,r)}}log(e,t){let n=`${Date.now()}: ${e}`;t&&(n+=` ${Os(t)}.`),this.entries.push(n)}}var Za=function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function o(e){try{c(r.next(e))}catch(e){s(e)}}function a(e){try{c(r.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}c((r=r.apply(e,t||[])).next())}))};class Ka{static create(e,t,n,r,i=null,s=null){const o=Ka.fetchTest(),a=po();return Ka.isConfigValid(o,a)?new Ka(e,t,n,r,o,a,i,s):null}constructor(e,t,n,r,i,s,o=null,a=null){this.activeCheckers=new Map,this.test=i,this.pageGroups=s,this.watcher=e,this.dispatcher=t,this.clientConfig=n,this.inputManager=r,this.startCallback=o,this.resultCallback=a}start(){window.setTimeout(()=>{Ka.normalizeTest(this.test);const e=this.handleNavigationChange.bind(this);window.addEventListener("noibuNavigation",e),this.startChecks()})}startChecks(){for(const e of this.test.checks)this.startCheckIfApplicable(e)}startCheckIfApplicable(e){const t=new $a;if(this.startCallback&&this.startCallback(e,t.entries),this.isCheckApplicable(e,t)){const n=this.activeCheckers.get(e);if(n&&!n.cancelled)return;this.startCheck(e,t)}}isCheckApplicable(e,t){const n=t.tag(""+e.id,t.log);n("Start page group validation.");const r=e.page_group_id,i=this.pageGroups[r];if(!i)return n("Page group not found (no matching id)."),!1;if(i.url_regex){if(!mo(i.url_regex))return n("Page group not found (no matching url regexp)."),!1}else if(i.urls){const e=go();if(!i.urls.some(t=>e.includes(t)))return n("Page group not found (no matching urls)."),!1}if(i.element_selector){const e=ho(i.element_selector);if(!window.document.querySelector(e))return n("Page group not found (no matching element selector)."),!1}return n("Found page group."),!0}startCheck(e,t){return Za(this,void 0,void 0,(function*(){let n=null;const r=new qa,i=new za(this.clientConfig.pageVisitId,e,this.watcher,this.dispatcher,r,this.inputManager,t);this.activeCheckers.set(e,i);try{yield i.start()}catch(e){n=e}if(this.activeCheckers.delete(e),!i.cancelled){const r=null===n;this.submitResult(r,e,n,t),r||this.submitError(n,t)}Ka.isCheckRestartRequired(e)&&window.setTimeout(()=>this.startCheckIfApplicable(e))}))}handleNavigationChange(){for(const[e,t]of this.activeCheckers){this.isCheckApplicable(e,t.logger)||t.cancelled||t.cancel()}this.startChecks()}submitResult(e,t,n,r){const i=r.tag(""+t.id,r.log),s=(null==n?void 0:n.triggerId)||"0",o=(null==n?void 0:n.assertionId)||"0",a=e?"Pass":"Fail",c=this.clientConfig.pageVisitId,l=`PageCheckResult-${a}-${t.id}-${t.version}-${c}-${s}-${o}`;i("Page check result success: "+e),this.resultCallback&&this.resultCallback(l,e,r.entries)}submitError(e,t){const n=t.entries,{checkId:r,version:i,triggerId:s,assertionId:o}=e;pa(Ee,{checkId:r,version:i,triggerId:s,assertionId:o,log:n})}static fetchTest(){return le().page_checks||null}static isConfigValid(e,t){return null!==e&&null!==t}static isCheckRestartRequired(e){const{triggers:t}=e;return t.find(({trigger_type:e})=>{return t=e,Ba.includes(t);var t})}static normalizeTest(e){const t=e=>null!==e&&"object"==typeof e&&0===Object.keys(e).length;for(const n of e.checks){for(const e of n.triggers)t(e.trigger_value)&&(e.trigger_value=null),t(e.element_selector)&&(e.element_selector=null);for(const e of n.assertions)null===e.assertion_value&&(e.assertion_value={}),"number"!=typeof e.assertion_value.timeout&&(e.assertion_value.timeout=20),t(e.element_selector)&&(e.element_selector=null)}}}var Ja=function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function o(e){try{c(r.next(e))}catch(e){s(e)}}function a(e){try{c(r.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}c((r=r.apply(e,t||[])).next())}))};class Ya{constructor(e,t,n,r,i=null){this.reportedSnippets=new Set,this.reportedErrors=new Set,this.handleMutationCallback=this.handleMutation.bind(this),this.handleIdleCallback=this.handleIdle.bind(this),this.supportIdleRequest="function"==typeof window.requestIdleCallback,this.idleRequestOptions={timeout:3e3},this.watcher=e,this.clientConfig=t,this.pageVisit=n,this.stopWordDictionary=r,this.resultCallback=i}start(){this.watcher.subscribe(this.handleMutationCallback),window.setTimeout(this.handleMutationCallback)}handleMutation(){this.supportIdleRequest?window.requestIdleCallback(this.handleIdleCallback,this.idleRequestOptions):this.search()}handleIdle(){this.search()}search(){let e=null;try{const t=Ya.getVisiblePageContent();e=Ya.searchMatches(t,this.stopWordDictionary)}catch(e){this.collectError(e)}if(null!==e){let t=null;for(const n of e)this.reportedSnippets.has(n.snippet)||(this.reportedSnippets.add(n.snippet),t=t||[],t.push(n));null!==t&&this.sendEvent(t)}}static searchMatches(e,t){if(!e)return null;let n=null;for(const r of t.values){let t=0,i=0;for(;i<10&&(i+=1,t=e.lower.indexOf(r.value,t),-1!==t);){const i=t;t+=1;if(!Ya.isWord(e.lower,i,i+r.value.length-1))continue;n=n||[];const s=Ya.searchSnippet(e.original,i,r.value.length);if(Ya.validateSnippet(s,r)){const e={stopWord:r.value,snippet:s,start:i,end:i+r.value.length};n.push(e)}}}return n}static searchSnippet(e,t,n){const r=t+n-1,i=Ya.searchSnippetIndex(e,t,-1),s=Ya.searchSnippetIndex(e,r,1)+1;return e.slice(i,s).trim()}static searchSnippetIndex(e,t,n){let r=0,i=0;for(;i<70;){i+=1;const s=e[t+n];if(void 0===s||Ya.snippetSeparators.has(s)){r=0;break}""===s.trim()&&(r=t),t+=n}return 0!==r&&(t=r),t}static validateSnippet(e,t){if(e=e.toLowerCase(),t.exclude)for(const n of t.exclude)if(e.includes(n))return!1;if(!t.include)return!0;for(const n of t.include)if(e.includes(n))return!0;return!1}static isWord(e,t,n){let r,i=!1,s=!1;return t>0&&(r=e[t-1],i=Ya.isWordRegExp.test(r)),n<e.length-1&&(r=e[n+1],s=Ya.isWordRegExp.test(r)),!i&&!s}sendEvent(e){return Ja(this,void 0,void 0,(function*(){const t={text:{dictionaryVersion:this.stopWordDictionary.version,lang:this.stopWordDictionary.lang,matches:e},performance:null},n={event:t,occurredAt:new Date(ro(Date.now())).toISOString()};this.pageVisit.addPageVisitEvent(n,te),this.resultCallback&&this.resultCallback(t)}))}collectError(e){const t=""+e;this.reportedErrors.has(t)||(this.reportedErrors.add(t),this.clientConfig.postNoibuErrorAndOptionallyDisableClient(t,!1,E))}static getVisiblePageContent(){var e,t;let n=null===(t=null===(e=window.document)||void 0===e?void 0:e.body)||void 0===t?void 0:t.innerText;if(!n)return null;n=Ya.removeFragmentsToIgnore(n);const r=n.toLowerCase();return{original:n,lower:r}}static removeFragmentsToIgnore(e){const t=Ya.getFragmentsToIgnore();if(null===t)return e;for(const n of t)e=e.replace(n,"");return e}static getFragmentsToIgnore(){const e=document.querySelectorAll(Ya.fragmentToIgnoreSelector);if(0===e.length)return null;const t=[];return e.forEach(e=>{const n=null==e?void 0:e.innerText;n&&t.push(n)}),t}}Ya.snippetSeparators=new Set([".","!","?","\n"]),Ya.isWordRegExp=/\w/,Ya.fragmentToIgnoreSelector='[class*="review"], [id*="review"], [class*="footer"], [id*="footer"], nav ';class Qa{constructor(e){this.subscribers=new Map,this.window=e}subscribe(e,t){let n=this.subscribers.get(e);n||(n=this.registerEvent(e)),n.add(t)}unsubscribe(e,t){const n=this.subscribers.get(e);n&&n.delete(t)}registerEvent(e){window.addEventListener(e,t=>this.nofity(e,t),{capture:!0});const t=new Set;return this.subscribers.set(e,t),t}nofity(e,t){const n=this.subscribers.get(e);for(const e of n)try{e(t)}catch(e){}}}class Xa{constructor(e){this.subscribers=new Set,this.observer=null,this.mutated=!1,this.window=e}start(){this.observer=new MutationObserver(this.handleMutation.bind(this)),this.observer.observe(this.window.document,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style","class"]})}stop(){this.observer.disconnect(),this.observer=null}subscribe(e){null===this.observer&&this.start(),this.subscribers.add(e)}unsubscribe(e){this.subscribers.delete(e)}handleMutation(){this.mutated||(this.mutated=!0,this.window.setTimeout(()=>{this.mutated=!1,this.nofity()},Xa.notificationTimeThreshold))}nofity(){for(const e of this.subscribers)try{e()}catch(e){}}}function ec(){const e=new Xa(window),t=new Qa(window),n=oo.getInstance(),r=fa.getInstance(),i=_o.getInstance(),s=Ka.create(e,t,n,r);s&&s.start();const o=tc();new Ya(e,n,i,o).start(),function(e,t,n,r){window.addEventListener("noibuPageCheckValidationRequest",i=>{const{pageGroups:s,test:o}=i.detail;new Ka(e,t,n,r,o,s,(e,t)=>{const n=new CustomEvent("noibuPageCheckValidationResponse",{detail:{check:e,logs:t}});window.dispatchEvent(n)}).start()})}(e,t,n,r)}function tc(e){var t,n;const r=(null===(n=null===(t=window.document)||void 0===t?void 0:t.documentElement)||void 0===n?void 0:n.lang)||"en",i=e||function(e){try{return new Intl.Locale(e).language}catch(e){return null}}(r)||"en",s=i in nc.values?i:"en",o=nc.values[s];return{version:nc.version,lang:s,values:o}}Xa.notificationTimeThreshold=1e3;const nc={version:5,values:{en:[{value:"error",include:["application","validation","login","password","payment","transaction","registration","checkout","shipping","order","network","database","connection","server","configuration","security","format","fulfillment","json","code","unexpected","referenceerror","typeerror","syntaxerror","rangeerror","typeerror","urierror","securityerror","quotaexceedederror","evalerror"],exclude:["design with no error codes","no need to worry"]},{value:"fail",include:["create","update","delete","remove","send","receive","validation","login","password","payment","transaction","registration","checkout","shipping","order","network","database","connection","server"]},{value:"unable",include:["create","update","delete","remove","send","receive","load","save","process","connect","complete","verify","retrieve"]},{value:"unavailable",include:["system","service","resource","page","product","feature","payment","shipping"]},{value:"invalid",include:["credentials","payment","parameters","request","file","data","information","address","email","login","password","field","form","card number"]},{value:"exception",include:["database","payment","inventory","shipping","checkout","configuration","session","unexpected","overflow","memory"]},{value:"timeout",include:["operation","gateway","server","service","network","connection","session","payment","request","transaction","database"]},{value:"expired",include:["session","coupon","payment","offer","token","subscription","license"]},{value:"refused",include:["payment","transaction","connection","access","service","order"]},{value:"denied",include:["access","permission","login","authentication","service","request","order"]},{value:"declined",include:["payment","transaction","access","card","request","authorization"]},{value:"blocked",include:["access","account","payment","transaction","content","service"]},{value:"miss",include:["information","payment","required","credential","parameters"]},{value:"inaccessible",include:["service","server","page","system","resource","content","feature","account"]},{value:"overload",include:["system","service","server","network","database","checkout"]},{value:"disabled",include:["account","feature","payment","checkout","access","user","service"],exclude:["“disabled access”"]},{value:"not permitted",include:["action","access","transaction","modification","upload","download","registration"]},{value:"already exist",include:["user","email","file","account","record","process","entry"]},{value:"server",include:["overload","not found","address"]},{value:"maintenance",include:["server","system","under","down","scheduled"]},{value:"connection",include:["timed out","timedout","refused","lost","reset","denied"]},{value:"crash",exclude:["course","courses","door crasher"]},{value:"not supported",include:["browser","payment","shipping","feature","file","language","currency","version","device","protocol","operation"]},{value:"unsupported",include:["browser","payment","shipping","feature","file","language","currency","version","device","protocol","operation"]},{value:"undefined"},{value:"[object object]"},{value:"addeventlistener"},{value:"400 bad request"},{value:"401 unauthorized"},{value:"403 forbidden"},{value:"404 not found"},{value:"405 method not allowed"},{value:"500 internal server error"},{value:"502 bad gateway"},{value:"503 service unavailable"},{value:"504 gateway timeout"},{value:"went wrong"},{value:"not found"},{value:"check your internet"},{value:"try later"},{value:"try again"},{value:"terminated"},{value:"exceeded",exclude:["my expectation","my expectations"]},{value:"corrupt",exclude:["jeans"]},{value:"disconnected"},{value:"unresponsive"},{value:"violation",exclude:["copyright"]},{value:"execution rights"},{value:"out of memory"},{value:"transaction rollback"},{value:"disk space exhausted"},{value:"protocol version"},{value:"doesn't exist"},{value:"has already been used"},{value:"choose a different delivery address"},{value:"no longer available"},{value:"can't be shipped"},{value:"no payment methods available"},{value:"enter a valid email"},{value:"more than what's in stock"},{value:"fill in the required"},{value:"is incorrect"},{value:"isn't valid"},{value:"is not valid"},{value:"coupon is not valid"},{value:"does not exist"},{value:"not authorized"},{value:"account is suspended"},{value:"no longer valid"},{value:"deactivated"},{value:"already in use"},{value:"sqlstate"},{value:"foreign key constraint"},{value:"is not defined"},{value:"no such entity"},{value:"more permissions"},{value:"duplicate entry"},{value:"account is locked"},{value:"api call"},{value:"module not enabled"},{value:"token has expired"},{value:"php extension"},{value:"security reasons"},{value:"file exceeds"},{value:"technical difficulties"},{value:"not allowed to access"},{value:"ssl certificate"},{value:"csrf token"},{value:"memory limit"},{value:"theme registry"},{value:"Current customer does not have an active cart"},{value:"link you selected is expired"}]}};var rc=function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function o(e){try{c(r.next(e))}catch(e){s(e)}}function a(e){try{c(r.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}c((r=r.apply(e,t||[])).next())}))};class ic{static getInstance(){return ic.instance||(ic.instance=new ic),ic.instance}constructor(){this.incomingErrorBuffer=[],this.confirmedErrorBuffer=[],this.processedUrls=new Set,this.incomingErrorBufferTimeoutId=0,this.processing=!1,this.terminated=!1,"function"==typeof window.fetch?this.nativeFetch=window.fetch.bind(window):this.terminated=!0}monitor(){const e=window;ao(e,"error",t=>this.handleError(t,e),!0)}terminate(){this.terminated=!0,this.incomingErrorBuffer.splice(0,this.incomingErrorBuffer.length),this.confirmedErrorBuffer.splice(0,this.confirmedErrorBuffer.length),this.processedUrls.clear(),window.clearTimeout(this.incomingErrorBufferTimeoutId)}handleError(e,t){if(this.terminated)return;const n=this.createErrorContext(e,t);null!==n&&(this.incomingErrorBuffer.push(n),this.scheduleErrorProcessing())}scheduleErrorProcessing(){window.clearTimeout(this.incomingErrorBufferTimeoutId),this.incomingErrorBufferTimeoutId=window.setTimeout(()=>this.processErrors(),ic.incomingErrorBufferTimeout)}processErrors(){return rc(this,void 0,void 0,(function*(){if(!this.terminated&&!this.processing){this.processing=!0;try{for(;this.incomingErrorBuffer.length;){if(this.checkIncomingErrorBufferOverflow())return;const e=this.incomingErrorBuffer.shift();(yield this.executeConfirmation(e))&&this.confirmedErrorBuffer.push(e)}for(;this.confirmedErrorBuffer.length;){const e=this.confirmedErrorBuffer.shift();this.submitError(e)}}finally{this.processing=!1}}}))}checkIncomingErrorBufferOverflow(){const e=this.incomingErrorBuffer.length>=ic.incomingErrorBufferOverflowLimit;return e&&this.terminate(),e}executeConfirmation(e){return rc(this,void 0,void 0,(function*(){const{url:t}=e.request,n=ic.confirmationRequestTimeout;if(e.originalResponse=yield this.executeRequest(t,null,n),ic.isErrorConfirmed(e.originalResponse))return!0;if(e.originalResponse.cors){const r=encodeURIComponent(t),i=ic.proxyUrl+"/?"+r,s=new Headers({"X-Upstream-URL":t});if(e.proxyResponse=yield this.executeRequest(i,s,n),ic.isErrorConfirmed(e.proxyResponse))return!0}return!1}))}executeRequest(e,t,n){return rc(this,void 0,void 0,(function*(){const r=new AbortController,{signal:i}=r,s={method:"HEAD",headers:t,signal:i},o=window.setTimeout(()=>r.abort(),n),a={ok:!1,status:0,contentType:null,error:null,timeout:!1,cors:!1};try{const t=yield this.nativeFetch(e,s);a.ok=t.ok,a.status=t.status,a.contentType=t.headers.get("content-type")}catch(e){const t="AbortError"===e.name,n=e instanceof TypeError;a.timeout=t,a.cors=n,a.error=""+e}finally{window.clearTimeout(o)}return a}))}submitError(e){const{tagName:t,id:n,alt:r,title:i,width:s,height:o}=e.image,a=e.request.url,{timestamp:c,originalResponse:l,proxyResponse:u}=e;pa("ImageError",{tag_name:t,id:n||null,src:a,detail:Os({alt:r,title:i,width:s,height:o,originalResponse:l,proxyResponse:u})},void 0,c)}createErrorContext(e,t){const{isTrusted:n,target:r}=e;if(!(n&&r instanceof HTMLImageElement))return null;const i=r,{width:s,height:o,src:a,baseURI:c}=i;if(s<=1||o<=1||!a)return null;let l=a.toLowerCase();if(l.startsWith("//")&&(l=t.location.protocol+l),!l.startsWith("http"))return null;if(ic.areUrlsEqual(l,c))return null;if(this.processedUrls.has(l))return null;this.processedUrls.add(l);const u={tagName:i.tagName,alt:i.alt,id:i.id,src:i.src,title:i.title,width:i.width,height:i.height},d={url:i.src};return{timestamp:Date.now(),image:u,request:d,originalResponse:null,proxyResponse:null}}static isErrorConfirmed(e){if(e.status>=400)return!0;if(e.contentType){const t=e.contentType.startsWith("image");if(e.ok&&!t)return!0}return!1}static areUrlsEqual(e,t){try{const n=new URL(e.toLowerCase()),r=new URL(t.toLowerCase());return n.origin===r.origin&&n.pathname===r.pathname&&n.search===r.search}catch(e){return!1}}}ic.proxyUrl="https://resource-proxy.noibu.com",ic.confirmationRequestTimeout=5e3,ic.incomingErrorBufferTimeout=3e3,ic.incomingErrorBufferOverflowLimit=5;class sc{static getInstance(){return sc.instance||(sc.instance=new sc),sc.instance}monitor(e){if(e&&e.length>0)return;const t=setInterval(()=>{const e=document.title;e&&e.length>0&&(this.handler(e),clearInterval(t))},100);setTimeout(()=>{this.clear(t)},5e3)}clear(e){clearInterval(e)}handler(e){const t=ko.getInstance(),n={url:Ms(),page_title:e,page_groups:vo(),ref_url:ks(t.referrerUrl)};$o.getInstance().addEvent(n,ne)}}class oc{static getInstance(...e){return oc.instances.has(this)||oc.instances.set(this,new this(...null!=e?e:[])),oc.instances.get(this)}destroy(){}static resetInstances(){oc.instances.forEach(e=>{e.destroy()}),oc.instances.clear()}}oc.instances=new Map;class ac extends oc{monitor(){this._monitor(window),ao(window,"noibuFrameAttach",e=>{const t=e.detail;this._monitor(t)})}_monitor(e){ao(e,"input",this._handle.bind(this))}getPayload(e){const{target:t}=e,n=t,r=n.placeholder||n.name||n.id,i=Ps(n),s=Fs(n);return{[x]:"",[D]:r,[N]:n.tagName?n.tagName.toLowerCase():"",[O]:s,[L]:Z,[P]:Us(i)}}isValid(e){const{target:t}=e,n=t;return("INPUT"===n.tagName||"TEXTAREA"===n.tagName)&&!!(n.placeholder||n.name||n.id)}_handle(e){this.isValid(e)&&$o.getInstance().addEvent(this.getPayload(e),Z)}}const cc=["\\b(view|add|my)\\b.*\\b(cart|bag|basket|bucket|box)\\b","\\b(buy now)\\b","^backorder$","\\b(acquista ora)\\b","\\b(buy this)\\b","\\b(ajouter|mon)\\b.*\\b(panier)\\b","\\b(aggiungi)\\b.*\\b(cart|borsa|carrello)\\b","^ajouter à la shopping bag$","^aggiungi$","^aggiungi alla shopping bag$","\\b(warenkorb)\\b","(^kaufen$)","^купить$","\\b(agregar)\\b.*\\b(carrito)\\b","\\b(adicionar)\\b.*\\b(carrinho)\\b","^carrinho$","^añadir al carrito de compras$","(^añadir al carrito$)","(add another)","(in winkelmand)","(sepete ekle)","(Lagg I Varukorgen)","(ΠΡΟΣΘΗΚΗ ΣΤΟ ΚΑΛΑΘΙ)","(Lägg i varukorgen)","(Köp)","(カートに追加)","^添加至购物袋$","^购买$","^購入する$","(أضف الى السلة)"],lc=["(paypal)","(checkout|payment|check out)","(l.?achat|règlement|paiement|la commande)","(passer).*(commande)","valider mon panier","(acheter maintenant)","^caisse$","(gå vidare till kassan)","(cassa|acquisto)","^vai alla cassa$","^procedi all.?acquisto$","^procedi al checkout$","^siguiente$","(kasse)","^zur kasse gehen$","^bezahlen$","^weiter zum checkout$","(comprar ahora)","^comprar$","(prosseguir com a compra)","^pasar por la caja$","^afrekenen$","^compre$","(continue to pay)","(naar de kassa)","Перейти к оформлению заказа","^купить сейчас$","^bestellen$","(Alışverişi Tamamla)","^Till kassan$","(チェックアウトに進む)","^去结算$","^付款。$","^お支払い$","(تاكيد الطلب)"],uc=["(checkout|continue) (with paypal)","^continue to paypal$","^weiter zu paypal$","^continue to afterpay$","^braintree_paypal$","^pay and place order$","^mit paypal bezahlen$","^continue to payment securely$","(continua su paypal)","(apple pay|applepay)","(amazon pay|amazonpay|continue with amazon)","(sezzlepay)","(place order)","(place your order)","(order confirmation)","(complete purchase)","submit.*order","(pay now)","(^pay it now$)","(make payment)","(^make payment$)","(complete order)","^complete your order$","(fazer pedido)","^encomendar$","((realizar) (pedido|pago))","^finalizar compra$","^pagar$","^jetzt kaufen$","^bestellung aufgeben$","^bestellung prüfen$","^auftragsbestätigung$","^bestelling plaatsen$","^passer la commande$","(je confirme et je paye)","(accéder au paiement)","^passer au paiement$","(Valider et continuer)","^valider la commande$","(^passez la commande$)","^invia ordine$","(effettua ordine)","^effettua l.?ordine$","(conferma acquisto)","^conferma l.?acquisto$","^confirmation de commande$","^confirma l.?ordine$","^conferma l.?ordine$","^conferma ordine$","(SİPARİŞİ TAMAMLA)","^Разместить заказ$","(Slutför köp)","(注文する)","(إنشاء الطلب)","(注文を確定)","^お支払いへ進む$","^确认下单$"];function dc(e){if(!(e instanceof Element))return{target:null,selector:null};let t=e,n=[],r=!1;for(;e&&e.nodeType===Node.ELEMENT_NODE;){const{id:i,tagName:s,classList:o,parentNode:a}=e;if(!r&&gc(e)&&(t=e,n.splice(0,n.length),r=!0),fc(i)){const t="#"+i;if(mc(t,e)){n.push(t);break}}let c=s.toLowerCase();if("html"!==c&&"body"!==c){const t=Array.from(o).filter(fc);t.length>0&&(c+="."+t.join("."));c+=`:nth-of-type(${pc(e)+1})`}n.push(c),e=a}n=function(e,t){const n=[];for(const r of t){n.push(r);const t=hc(n);if(mc(t,e))break}return n}(t,n);return{target:t,selector:hc(n)}}function hc(e){return(e=[...e]).length?e.reverse().join(" > "):null}function pc(e){let t=0;for(let n=e.previousElementSibling;null!==n;n=n.previousElementSibling)n.tagName===e.tagName&&(t+=1);return t}function gc(e){const t=e.tagName.toLowerCase();if(yc.includes(t))return!0;const n=e.getAttribute("role");return!!bc.includes(n)}function fc(e){if(!e)return!1;if(!vc.test(e))return!1;if(Ic.some(t=>e.toLowerCase().indexOf(t)>=0))return!1;return!/\d/.test(e)}function mc(e,t){const n=document.querySelectorAll(e);return 1===n.length&&n[0]===t}const vc=/^[a-zA-Z_-][a-zA-Z0-9_-]*$/,yc=["svg","li","label","product-item"],bc=["button","menuitem"],Ic=["load","active","fixed","visible","focus","show","collaps","animat","hover","site-menu-item-open"];class Cc extends oc{constructor(){super(),this.textCapturedWhiteListRegex=new RegExp(cc.concat(lc).concat(uc).join("|"),"i"),this.htmlIDWhiteListRegex=new RegExp("method|finance|sagepay|cart|bag|coupon|affirm|karna|sezzle|button","i"),this.collectTrustedEventsOnly=!0,this.blockedSelector=null,this.blockedSelector=Cc.createBlockedSelector()}static createBlockedSelector(){let e;try{e=Bs(),window.document.querySelector(e)}catch(t){e=null;oo.getInstance().postNoibuErrorAndOptionallyDisableClient("Failed to parse selector: "+t,!1,E)}return e}monitorClicks(){this._monitor(window),ao(window,"noibuFrameAttach",e=>{const t=e.detail;this._monitor(t)})}_monitor(e){ao(e,"click",this._onClickHandle.bind(this),!0)}_onClickHandle(e){this.isValid(e)&&(yo.getInstance().addPvClick(),_o.getInstance().addPageVisitEvents([{event:this.getPayload(e),occurredAt:new Date(ro(Date.now())).toISOString()}],j))}isValid(e){return!(this.collectTrustedEventsOnly&&!e.isTrusted)}getPayload(e){const t=e.target,n=t,r=t.src||"",i=n.tagName?n.tagName.toLowerCase():"",s=Ps(n),o=Fs(n),a=this.getElementText(i,t,o),c=function(e){try{const{selector:t}=dc(e);return t}catch(e){return null}}(n);let l=0,u=0;try{const{documentElement:e}=window.document;l=e.scrollWidth,u=e.scrollHeight}catch(e){}return{[x]:r,[D]:a,[N]:i,[O]:o,[L]:$,[P]:Us(s),selector:c,x:Math.trunc(e.pageX||0),y:Math.trunc(e.pageY||0),w:l,h:u}}getElementText(e,t,n){if(null===this.blockedSelector)return"*";let r="";if("img"===e){const e=t;e.alt&&(r=e.alt)}else{const e=t;if(this.isEnclosedByBlockedElement(e))return"*";r=this._getContainedText(e,!0)}if(!this.textCapturedWhiteListRegex.test(r)&&!this.htmlIDWhiteListRegex.test(n))if("input"===e){if(!He.some(n=>n(e,t)))return"*"}else if("textarea"===e)return"*";return function(e){return e.replace(I,"******").replace(b,"*")}(Cc.cutoffText(Cc.trimSpaces(r)))}_getContainedText(e,t){let n=this._parseInnerContent(e);if(t){const t=e.tagName?e.tagName.toLowerCase():"";if(""===n)n=this._parseTextFromParentElement(e);else if("select"===t){const t=n;n=this._parseTextFromParentElement(e),n=n.replace(t,"")}}return n}_parseInnerContent(e,t="",n={v:0}){const r=e,i=e;if(t.length>=100||n.v>=100)return t;if(n.v+=1,i&&"function"==typeof i.matches&&i.matches(this.blockedSelector))return t?t+" *":"*";e.nodeType===Node.TEXT_NODE&&(t=this._parseAndAppendText(t,[e.textContent]));let s=!0;if(e.nodeType===Node.ELEMENT_NODE){if(Ms().includes("hannaandersson")){const t=t=>t(i.tagName.toLowerCase(),e);if(!He.some(t))return"*"}const n="string"==typeof r.type?r.type.toLowerCase():"",o="string"==typeof r.title?r.title.toLowerCase():"";if(La(n)||La(o))return this._parseAndAppendText(t,["*"]);0===e.childNodes.length&&(t=this._parseAndAppendText(t,[r.value,r.title])),1===e.childNodes.length&&e.childNodes[0].nodeType===Node.TEXT_NODE&&(s=!1,t=this._parseAndAppendText(t,[e.textContent,r.value,r.title]))}if(s)for(const r of e.childNodes)t=this._parseInnerContent(r,t,n);return t}_parseAndAppendText(e,t){if(e.length>=100)return e;const n=t.filter(e=>Number.isFinite(e)||"string"==typeof e).map(e=>Cc.trimSpaces(e)).filter(e=>e.length>0).slice(0,1).join("");return e?`${e} ${n}`:n}static trimSpaces(e){return Hs(e).replace(/\s+/g," ")}static cutoffText(e){if(e.length>100){const t=e.lastIndexOf(" ",100-"...".length);return t>0?e.substring(0,t)+"...":"..."}return e}_parseTextFromParentElement(e){let t=e;const n=[];let r=0;for(;t&&!(r>=5)&&t.parentNode;)t=t.parentNode,n.push(t),r+=1;for(let e=0;e<n.length;e+=1){const t=n[e];if(t&&"BUTTON"===t.tagName)return this._getContainedText(t,!1)}return""}isEnclosedByBlockedElement(e){const t=document.querySelectorAll(this.blockedSelector);for(const n of t)if(n.contains(e))return!0;return!1}}class wc{constructor(){this.processedResourceKeys=new Set,this.allowedResourceKeys=new Set(["inline","eval","wasm-eval","trusted-types-policy","trusted-types-sink"])}static getInstance(){return this.instance||(this.instance=new wc),this.instance}monitor(){const e=this.handle.bind(this);ao(window,"securitypolicyviolation",e,!0)}handle(e){if("report"===e.disposition)return;const t=this.getResourceKey(e.blockedURI);if(!t||this.processedResourceKeys.has(t))return;this.processedResourceKeys.add(t);const{blockedURI:n,violatedDirective:r}=e;pa("CSPError",{blocked_uri:n,violated_directive:r,original_policy:null})}getResourceKey(e){try{const t=new URL(e),{hostname:n}=t;if(/^\d{1,3}(\.\d{1,3}){3}$/.test(n))return n;const r=n.split(".");return r.length>=3?r.slice(-3).join("."):n}catch(e){}return this.allowedResourceKeys.has(e)?e:null}}class Sc{constructor(){this.debouncedCalls=0}static getInstance(){return this.instance||(this.instance=new Sc),this.instance}monitor(){const e=this._onPageEventHandle.bind(this),t=()=>{const t=Xi()(e,1e3,{leading:!0,trailing:!0});return(...e)=>(this.debouncedCalls+=1,t(...e))};Ne.forEach(t=>ao(window,t,e,!0)),xe.forEach(e=>ao(window,e,t(),!0)),De.forEach(t=>ao(document,t,e,!0))}_onPageEventHandle(e){if(!e||!e.type)return;const t={type:e.type};switch(e.type){case"visibilitychange":t.data="state: "+this.getDocumentState();break;case"readystatechange":t.data="state: "+document.readyState;break;case"pagehide":case"pageshow":case"load":e.persisted&&(t.data="persisted: "+e.persisted);break;case"storage":e.key&&(t.data="key: "+e.key);break;case"message":case"messageerror":e.data&&e.origin&&(t.data=`origin: ${e.origin} size: ${this.getSizeInBytes(e.data)}`);break;case"hashchange":e.newURL&&(t.data="newURL: "+e.newURL)}this.setDocumentSize(t),$o.getInstance().addEvent(t,Y)}getDocumentState(){return"hidden"===document.visibilityState?"hidden":document.hasFocus()?"active":"passive"}getSizeInBytes(e){let t=e;return"string"!=typeof e&&(t=Os(e)),2*t.length}setDocumentSize(e){const{type:t}=e;if("pageshow"===t||"resize"===t)try{const{documentElement:t}=window.document;e.width=t.scrollWidth,e.height=t.scrollHeight}catch(e){}}}class Ec{constructor(){this.submittedMetrics=new Set,this.startedMonitoring=!1,this.onLCP=null,this.onFID=null,this.onCLS=null,this.onFCP=null,this.onINP=null,this.onTTFB=null}static getInstance(){return this.instance||(this.instance=new Ec),this.instance}sendMetric(e){var t,n,r;if(!e||!e.name)return;const{name:i,value:s,rating:o}=e;if(this.submittedMetrics.has(i)&&"CLS"!==i)return;this.submittedMetrics.add(i);let{attribution:a}=e;switch(a||(a={}),a.njsSessionStartTime=to.scriptInitializeTime,i){case d.CumulativeLayoutShift:{const e=a;Ec.setEventRecorded(e.largestShiftTime,a);break}case d.FirstContentfulPaint:{const e=a;Ec.setEventRecorded(null===(t=e.fcpEntry)||void 0===t?void 0:t.startTime,a);break}case d.FirstInputDelay:{const e=a;Ec.setEventRecorded(e.eventTime,a);break}case d.InteractionToNextPaint:{a.interactionTargetElement=void 0;const e=a;Ec.setEventRecorded(e.interactionTime,a);break}case d.LargestContentfulPaint:{const e=a;Ec.setEventRecorded(null===(n=e.lcpEntry)||void 0===n?void 0:n.startTime,a);break}case d.TimeToFirstByte:{const e=a;Ec.setEventRecorded(null===(r=e.navigationEntry)||void 0===r?void 0:r.startTime,a);break}}const c={name:i,value:s.toString(),rating:o,attribution:Os(a)};_o.getInstance().addPageVisitEvent({event:c,occurredAt:new Date(ro(Date.now())).toISOString()},z)}static setEventRecorded(e,t){let n=!1;e&&to.recordingStartTime&&(n=e>to.recordingStartTime,n&&to.recordingStopTime&&(n=e<to.recordingStopTime)),t.rrwebRecorder=n}monitor(){try{if(!Ec.isAvailable())return;if(this.startedMonitoring)return;this.startedMonitoring=!0;const e=this.sendMetric.bind(this);this.onLCP(e),this.onFID(e),this.onCLS(e),this.onFCP(e),this.onINP(e),this.onTTFB(e)}catch(e){this.startedMonitoring=!1,oo.getInstance().postNoibuErrorAndOptionallyDisableClient("Error in WebVitalMonitor: "+e,!1,E)}}download(){Ec.isAvailable()&&(ao(window,"noibuWebVitalsLoaded",e=>{this.setWebVitals(e.detail),this.monitor()}),Zs("https://cdn.noibu.com/collect-webvitals.js",null,e=>{oo.getInstance().postNoibuErrorAndOptionallyDisableClient("Error loading webvitals script. "+e,!1,E)}))}setWebVitals(e){this.onLCP=e.onLCP,this.onFID=e.onFID,this.onCLS=e.onCLS,this.onFCP=e.onFCP,this.onINP=e.onINP,this.onTTFB=e.onTTFB}static isAvailable(){return"object"==typeof window.performance}}class kc{static getInstance(){return this.instance||(this.instance=new kc),this.instance}_safeQueryAll(e,t){let n;try{n=e.querySelectorAll(t)}catch(e){oo.getInstance().postNoibuErrorAndOptionallyDisableClient("Error in ElementMonitor: "+e,!1,E)}return n?Array.from(n):[]}_processMatchingElements(e,t){e.forEach(e=>{if(!e)return;const n=e.textContent;n&&fa.getInstance().addCustomAttribute(t,n)})}_findAndAddMatchingElementsInNodes(e){Object.keys(Ue()).forEach(t=>{const n=Ue()[t];n&&e.forEach(e=>{if(e.nodeType===Node.TEXT_NODE&&e.parentNode&&(e=e.parentNode),e.nodeType!==Node.ELEMENT_NODE)return;let r=[];e.matches(n)&&r.push(e);const i=this._safeQueryAll(e,n);r=r.concat(i),this._processMatchingElements(r,t)})})}_setupMutationObserver(){const e=new MutationObserver(e=>{e.forEach(e=>{if("childList"===e.type&&e.addedNodes.length>0&&this._findAndAddMatchingElementsInNodes(e.addedNodes),"attributes"===e.type){const t=e.target;t.nodeType===Node.ELEMENT_NODE&&this._findAndAddMatchingElementsInNodes([t])}})});e.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0}),this.observer=e}_findAndAddMatchingElements(){Object.keys(Ue()).forEach(e=>{const t=Ue()[e];if(!t)return;const n=this._safeQueryAll(document,t);this._processMatchingElements(n,e)})}monitor(){var e;0!==Object.keys(Ue()).length&&(this._findAndAddMatchingElements(),"undefined"!=typeof MutationObserver&&MutationObserver&&(null===(e=document.documentElement)||void 0===e?void 0:e.nodeType)===Node.ELEMENT_NODE?this._setupMutationObserver():this.interval=setInterval(()=>{this._findAndAddMatchingElements()},5e3))}_disconnectObserver(){this.observer&&this.observer.disconnect&&"function"==typeof this.observer.disconnect&&this.observer.disconnect(),this.interval&&clearInterval(this.interval)}}class Ac{constructor(){this.enabled=!0,this.initialHeight=null,this.maxOffset=0}static getInstance(){return Ac.instance||(Ac.instance=new Ac),Ac.instance}monitor(){const e=this.handle.bind(this),t=Xi()(e,1e3,{leading:!0,trailing:!0});ao(window,"scroll",t),ao(window,"noibuNavigation",()=>{this.enabled=!1,setTimeout(()=>{this.reset(),this.report(!0)},1e3)}),Is().then(()=>{null!==this.initialHeight||this.report(!0)})}reset(){this.enabled=!0,this.initialHeight=null,this.maxOffset=0}handle(e){e.target===document&&this.report(!1)}report(e){if(!this.enabled)return;const t=Math.max(document.body.scrollHeight,document.documentElement.scrollHeight,document.body.offsetHeight,document.documentElement.offsetHeight,document.body.clientHeight,document.documentElement.clientHeight),n=window.innerHeight,r=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop,i=r+n;let s=!1;null===this.initialHeight&&(this.initialHeight=t,s=!0),r>this.maxOffset&&(this.maxOffset=r,s=!0);const o={initialHeight:this.initialHeight,height:t,viewportHeight:n,scrollTop:r,scrollBottom:i,isMax:e||s,isSynthetic:e},a={type:"scroll",data:JSON.stringify(o)};$o.getInstance().addEvent(a,Y)}}class Tc{constructor(){this.pageVisit=_o.getInstance(),this.eventTimestamps=new Map}static getInstance(){return this.instance||(this.instance=new Tc)}monitor(){try{this.monitorDataLayer()}catch(e){}}monitorDataLayer(){window.dataLayer=window.dataLayer||[];const e=this.handleDataLayerItems.bind(this);Cs(window.dataLayer,"push",(function(t){return function nbuWrapper(...n){return e(n),t.apply(window.dataLayer,n)}})),e(window.dataLayer)}handleDataLayerItems(e){const t=[];try{e.forEach(e=>this.extractFromDataLayer(e,t)),t.filter(_c).filter(e=>this.debounce(e.name)).forEach(e=>{this.toStandardName(e),this.sendEvent(e)})}catch(e){}}extractFromDataLayer(e,t){const n=Object.prototype.toString.call(e);if("[object Arguments]"===n){for(const n of e)if(Rc.has(n)){const r=e[2];return void t.push({name:n,data:"object"==typeof r?r:null})}return}if("[object Object]"===n)for(const[n,r]of Object.entries(e)){if(("event"===n||"event_name"===n)&&Rc.has(r)){const n=e.ecommerce;return void t.push({name:r,data:"object"==typeof n?n:null})}}else;}debounce(e){const t=this.eventTimestamps.get(e)||0,n=Date.now();return!(n-t<1e3)&&(this.eventTimestamps.set(e,n),!0)}toStandardName(e){const{name:t}=e;e.name=Mc.get(t)||t}sendEvent(e){const t={event:{platform:"ga4",name:e.name,data:Os(e.data)},occurredAt:new Date(ro(Date.now())).toISOString()};this.pageVisit.addPageVisitEvent(t,X)}}function _c(e,t,n){return n.findIndex(t=>t.name===e.name)===t}Tc.instance=null;const Rc=new Set(["login","sign_up","share","search","add_to_cart","remove_from_cart","view_cart","begin_checkout","purchase","refund"]),Mc=new Map([["add_to_cart","product_added_to_cart"],["remove_from_cart","product_removed_from_cart"],["view_cart","cart_viewed"],["begin_checkout","checkout_started"],["purchase","checkout_completed"]]);let Lc=0;function Nc(e,t){if("function"!=typeof e)return e;if(e===Function.prototype)return e;try{if(e.__noibu__)return e;if(e.__noibu_wrapped__)return e.__noibu_wrapped__}catch(t){return e}const nbuWrapper=function(...n){try{const t=Array.prototype.slice.call(n).map(e=>Nc(e));return e.handleEvent?e.handleEvent.apply(this,t):e.apply(this,t)}catch(e){throw(null==t?void 0:t.getCause)&&(e.cause=t.getCause(n)),pa(ke,{error:e}),Lc+=1,setTimeout(()=>{Lc-=1}),e}};try{for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(nbuWrapper[t]=e[t])}catch(e){}nbuWrapper.prototype=e.prototype||{},Object.defineProperty(e,"__noibu_wrapped__",{enumerable:!1,value:nbuWrapper}),Object.defineProperties(nbuWrapper,{__noibu__:{enumerable:!1,value:!0},__noibu_original__:{enumerable:!1,value:e}});try{Object.getOwnPropertyDescriptor(nbuWrapper,"name").configurable&&Object.defineProperty(nbuWrapper,"name",{get:()=>e.name})}catch(t){return e}return nbuWrapper}function xc(e){const t=[];e.forEach(e=>{e&&(Array.isArray(e)?t.push(...e):t.push(e))});const{errorLikeObjs:n,rest:r}=t.reduce((e,t)=>(!function(e){if(!e)return!1;const t=e;try{return"string"==typeof t.stack&&"string"==typeof t.message}catch(e){return!1}}(t)?e.rest.push(t):e.errorLikeObjs.push(t),e),{errorLikeObjs:[],rest:[]});n.concat(function(e){const t=e.filter(e=>"string"==typeof e&&!!e);if(!t.length)return[];if(2===t.length)switch(!0){case As(t[0]):return[{stack:t[0],message:t[1]}];case As(t[1]):return[{stack:t[1],message:t[0]}];default:return[]}const n=[],r=[];return t.forEach(e=>{if(As(e)){n.push(e);const t=e.split("\n");As(t[0],0)?r.push("_"):r.push(t[0])}}),n.map((e,t)=>({stack:e,message:r[t]}))}(r)).forEach(e=>{try{pa(Te,e)}catch(e){}})}function Dc(e){e&&Le.forEach(t=>{e[t]&&Cs(e,t,(function(t){return function nbuWrapper(){t.call(e,...arguments),xc(Array.from(arguments))}}))})}function Oc(e){e&&e.constructor&&e.constructor.name&&"undefined"!==e.constructor.name&&!(Lc>0)&&pa(e.constructor.name,e)}function Pc(e){if(!e.reason)return;if(!e.reason.message||!e.reason.stack)return;const t=new Error;t.message=e.reason.message,t.stack=e.reason.stack;pa(Ce,{error:t})}function Fc(e){!function(e){ao(e,"error",Oc,!0),ao(e,"unhandledrejection",Pc,!0),A.forEach(t=>{const n=e[t],r=n&&n.prototype;r&&r.hasOwnProperty&&r.hasOwnProperty("addEventListener")&&(Cs(r,"addEventListener",(function(e){return function nbuWrapper(t,n,r){if(!n)return e.call(this,t,n,r);let i;if(n.handleEvent){const e=Nc(n.handleEvent.bind(n));i=n,i.handleEvent=e}else i=Nc(n);return e.call(this,t,i,r)}})),Cs(r,"removeEventListener",(function(e){return function nbuWrapper(t,n,r){let i=n;try{i=i&&(i.__noibu_wrapped__||i)}catch(e){}return e.call(this,t,i,r)}})))})}(e),Dc(e.console),function(e){var t;const n=e=>t=>{try{return t.filter(e.isValid.bind(e)).map(t=>e.getPayload(t))}catch(e){return oo.getInstance().postNoibuErrorAndOptionallyDisableClient({msg:"Can't get cause for an onclick error in wrapHtmlElementEvents: "+e,args:t},!1,E),[]}};try{const r=null===(t=null==e?void 0:e.HTMLElement)||void 0===t?void 0:t.prototype;if(!r)return;Ss(r,"onclick",e=>Nc(e,{getCause:n(Cc.getInstance())})),Ss(r,"oninput",e=>Nc(e,{getCause:n(ac.getInstance())})),Ss(r,"onchange",e=>Nc(e,{getCause:n(ac.getInstance())}))}catch(e){oo.getInstance().postNoibuErrorAndOptionallyDisableClient("Error in wrapHtmlElementEvents: "+e,!1,E)}}(e),function(e){const t=e.console;let n=0,r=t;const i=()=>{try{const{console:t}=e}catch(e){return}if(n+=1,e.console!==r){r=e.console;const n={};Object.keys(t).forEach(t=>{e.console[t]||(e.console[t]=()=>{n[t]||(n[t]=!0,pa("GlobalReassignError",{error:new Error(`The console object was overridden and the ${t} method does not exist. Backfilling it with an empty function to avoid errors.`)}))})}),Dc(e.console)}n<3&&setTimeout(i,500)};setTimeout(i,500)}(e)}function Uc(){Fc(window),ao(window,"noibuFrameAttach",e=>{Fc(e.detail)})}class Vc{static async fromFetch(e,t,n,r){try{if(!(zs(r,Response)&&r.ok&&!r.bodyUsed))return null;const i=this._getHeaderFromFetchArguments("content-type",t,n),s=this._getHeaderFromFetchArguments("apollographql-client-name",t,n);if(null!=s||this._shouldHandleRequest(e,i)){const t=await r.json();return this._validate(t,e,[])}}catch(e){this._isRequestAborted(t,n)||this._postError(e)}return null}static async fromXhr(e,t){try{if(!(zs(t,XMLHttpRequest)&&t.status>=200&&t.status<=299))return null;let n=null,r=!1;if(t.noibuRequestHeaders&&(n=t.noibuRequestHeaders.get("content-type"),r=t.noibuRequestHeaders.has("apollographql-client-name")),r||this._shouldHandleRequest(e,n)){let n=null;if("blob"===t.responseType){if(t.response.text){const e=await t.response.text();n=this._parseJsonSafely(e)}}else if("json"===t.responseType)n=t.response;else{const e=t.responseText;n=this._parseJsonSafely(e)}if(n)return this._validate(n,e,[])}}catch(e){this._postError(e)}return null}static _parseJsonSafely(e){try{return JSON.parse(e)}catch(e){return null}}static _getHeaderFromFetchArguments(e,t,n){let r=null;zs(n,Request)?r=n.headers:t&&t.headers&&(r=new Headers(t.headers));let i=null;return r&&(i=r.get(e)),i}static _isRequestAborted(e,t){return zs(t,Request)?t.signal&&t.signal.aborted:!(!e||!zs(e.signal,AbortSignal))&&e.signal.aborted}static _shouldHandleRequest(e,t){$s(t)&&(t=t.toLowerCase());let n=!1;return e&&(zs(e,URL)&&(e=e.toString()),$s(e)&&(n=e.toLowerCase().includes("graphql"))),"application/json"===t&&n||"application/graphql"===t}static _validate(e,t,n){let r=null;if(e&&Array.isArray(e.errors)){r=e.errors;for(const e of r){const r=Object.keys(e);for(const t of r)switch(t){case"message":this._validateMessage(e);break;case"locations":this._validateLocations(e,n);break;case"path":this._validatePath(e,n);break;case"extensions":this._validateExtensions(e);break;default:delete e[t],n.push("unexpected error."+t)}e.src=t}n.length>0&&this._postValidationIssues(n)}return r}static _validateMessage(e){e.message=ks(e.message,1e3)}static _validateExtensions(e){const t=Na(Os(e.extensions));e.extensions=ks(t,1e3)}static _validateLocations(e,t){const n=e.locations;if(Array.isArray(n))for(const e of n){const n=Object.keys(e);for(const r of n)switch(r){case"line":case"column":if(!Number.isSafeInteger(e[r])){const n=e[r];e[r]=0,t.push(`unexpected ${r} value '${n}'`)}break;default:delete e[r],t.push("unexpected error.location."+r)}}else delete e.locations,t.push("unexpected error.locations")}static _validatePath(e,t){const n=e.path;Array.isArray(n)?e.path=e.path.map(e=>e.toString()):(delete e.path,t.push("unexpected error.path"))}static _postError(e){oo.getInstance().postNoibuErrorAndOptionallyDisableClient("GQL parse error: "+e,!1,E)}static _postValidationIssues(e){const t=e.join(",");oo.getInstance().postNoibuErrorAndOptionallyDisableClient("GQL error validation warning: "+t,!1,E)}}var Wc=function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function o(e){try{c(r.next(e))}catch(e){s(e)}}function a(e){try{c(r.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}c((r=r.apply(e,t||[])).next())}))};tc("en");function Bc(e,t,n,r,i){const s={mtd:n,code:e,url:Da.removePIIFromURL(r),r_time:i},o=Da.getInstance(),a=o.contentLength(t);return a>0&&o.shouldContinueForURL(r)&&(s.resp_len=a),s}function qc(e){return Wc(this,void 0,void 0,(function*(){return e instanceof Response?e.bodyUsed?v:Es(e.text).call(e):""}))}function Gc(e,t,n,r,i,s,o,a){return Wc(this,void 0,void 0,(function*(){return Da.getInstance().shouldContinueForURL(r)?Da.getInstance().bundleHTTPData(r,function(e,t){var n;let r=[];return"function"==typeof(null===(n=null==e?void 0:e.headers)||void 0===n?void 0:n.entries)&&(r=e.headers.entries()),Array.from(r).length<1&&((null==t?void 0:t.headers)instanceof Headers?r=t.headers.entries():"object"==typeof(null==t?void 0:t.headers)&&(r=Object.entries(t.headers))),Da.headersMapFromIterable(r)}(e,i),function(e,t){return"string"==typeof e?e:null==t?void 0:t.body}(o,i),function(e){return(null==e?void 0:e.headers)?Da.headersMapFromIterable(e.headers.entries()):new Map}(t),a,n,s):null}))}function Hc(e,t,n,r,i){return Wc(this,void 0,void 0,(function*(){var s;const o=Date.now()-t,a=yield Vc.fromXhr(n,e),c=Oa(e.status);let l=[];const u=yield Da.getResponseStringFromXHR(e);const d=Bc(e.status,Da.headersMapFromString(e.getAllResponseHeaders()),r,n,o),h=yield function(e,t,n,r){return Wc(this,arguments,void 0,(function*(e,t,n,r,i=null,s){if(!Da.getInstance().shouldContinueForURL(n))return null;const o=Da.headersMapFromString(e.getAllResponseHeaders());return Da.getInstance().bundleHTTPData(n,e.noibuRequestHeaders,i,o,s,t,r)}))}(e,r,n,c||!!a||!!l.length,i,u),p=new Pa(d,h,a);p.saveHTTPEvent();const g=null===(s=p.httpData)||void 0===s?void 0:s.seq;c&&pa(be,e,g),a&&a.forEach(e=>pa("GQLError",e,g))}))}function jc(e){return e.bodyUsed?e:e.clone()}function zc(e){const t=e;"function"==typeof t.fetch&&(function(e){var t,n,r;return null===(r=null===(n=null===(t=e.toString)||void 0===t?void 0:t.call(e))||void 0===n?void 0:n.includes)||void 0===r?void 0:r.call(n,"native code")}(Response.prototype.text)||(Response.prototype.text.__noibu_original__=function(e){try{const t=document.createElement("iframe");document.body.appendChild(t);let n=t.contentWindow;return e.split(".").forEach(e=>{n=n[e]}),t.remove(),n}catch(e){}}("Response.prototype.text")||Response.prototype.text),Cs(t,"fetch",(function(e){return function nbuWrapper(t,n){let r;const{url:i,method:s}=function(e,t){const n={method:"GET",url:""};try{return e?e instanceof Request&&e.method?{method:e.method,url:e.url||""}:{method:(null==t?void 0:t.method)||"GET",url:"function"==typeof e.toString?e.toString():""}:n}catch(e){oo.getInstance().postNoibuErrorAndOptionallyDisableClient("Error in fetch() wrapper: "+e,!1,E)}return n}(t,n);$c(i,null==n?void 0:n.body),t instanceof Request&&(r=t.clone());const o=Date.now(),a=e.call(this,t,n);return a.then(function(e,t,n,r,i){return s=>Wc(this,void 0,void 0,(function*(){var o,a,c;try{if(!s)return oo.getInstance().postNoibuErrorAndOptionallyDisableClient("Error in custom fetch() callback: no response received",!1,E);const l=jc(s),u=jc(l),d=jc(l),h=Date.now()-e;let p=[];const g=l.status,f=l.headers,m=yield Vc.fromFetch(t,r,i,u),v=Oa(g),[y,b]=yield Do([Promise.resolve(null===(a=null===(o=Es(null==i?void 0:i.text))||void 0===o?void 0:o.call)||void 0===a?void 0:a.call(o,i)),qc(d)]);0;const I=Bc(g,f,n,t,h),C=yield Gc(i,d,n,t,r,v||!!m||!!p.length,y,b),w=new Pa(I,C,m);w.saveHTTPEvent();const S=null===(c=w.httpData)||void 0===c?void 0:c.seq;v&&pa(Se,l,S),p.length,m&&m.forEach(e=>pa("GQLError",e,S))}catch(e){if("AbortError"===e.name)return;const t=xs(e);oo.getInstance().postNoibuErrorAndOptionallyDisableClient(`Error in custom fetch() callback: ${e}${t}`,!1,E)}}))}(o,i,s,n,r)).catch(e=>{!function(e,t){if(!e||"object"!=typeof e)return;const n=e;if(!(null==n?void 0:n.message)||!(null==n?void 0:n.stack))return;const r=new Error;r.stack=n.stack;const i=Hs(t),s=i?" on url "+i:"";r.message=`${n.message}${s}`,pa(Ae,{error:r})}(e,i)}),a}})))}function $c(e,t){try{const n=new CustomEvent("noibuRequest",{detail:{url:e,body:t}});dispatchEvent(n)}catch(e){}}function Zc(e){const t=e.XMLHttpRequest,n=t&&t.prototype;!function(e,t){Cs(e,"open",(function(e){return function nbuWrapper(n,r,i=!0,s=null,o=null){try{$c(r,null);try{this.noibuHttpMethod=n,this.noibuHttpUrl=r}catch(e){oo.getInstance().postNoibuErrorAndOptionallyDisableClient("Unable to set custom properties on XHR object: "+e,!1,k)}if(t){const e=Date.now();ao(this,"loadend",()=>Hc(this,e,r,n,null))}}catch(e){const t=xs(e);oo.getInstance().postNoibuErrorAndOptionallyDisableClient(`Error in XHR.open() wrapper: ${e}${t}`,!1,E)}return e.call(this,n,r,i,s,o)}}))}(n,!function(e){return Cs(e,"send",(function(e){return function nbuWrapper(t){try{const e=function(e,t){return e.noibuHttpMethod?e.noibuHttpMethod:t?"POST":"GET"}(this,t),n=Date.now();ao(this,"loadend",()=>Hc(this,n,this.noibuHttpUrl||this.responseURL,e,t))}catch(e){const t=xs(e);oo.getInstance().postNoibuErrorAndOptionallyDisableClient(`Error in XHR.send() wrapper: ${e}${t}`,!1,E)}return e.call(this,t)}}))}(n)),function(e){Cs(e,"setRequestHeader",(function(e){return function nbuWrapper(t,n){try{this.noibuRequestHeaders instanceof Map||(this.noibuRequestHeaders=new Map);const e="string"==typeof n?n:String(n);"string"==typeof t&&this.noibuRequestHeaders.set(t.toLowerCase(),e)}catch(e){oo.getInstance().postNoibuErrorAndOptionallyDisableClient("Error in XHR.setRequestHeader() wrapper: "+e,!1,E)}return e.call(this,t,n)}}))}(n)}function Kc(e){Zc(e),zc(e)}var Jc=function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function o(e){try{c(r.next(e))}catch(e){s(e)}}function a(e){try{c(r.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}c((r=r.apply(e,t||[])).next())}))};function Yc(){return Jc(this,arguments,void 0,(function*(e=null){const t=ko.getInstance(),n=vo(e);t.storePageGroups(n),yield Is();const r=vo(e);if(n.length===r.length&&n.every((e,t)=>e===r[t]))return;t.storePageGroups(r);const i={page_groups:r};$o.getInstance().addEvent(i,re)}))}function Qc(){const e={event:{type:"page_visit_start"},occurredAt:(new Date).toISOString()};_o.getInstance().addPageVisitEvent(e,Y)}const Xc=["carrot-top.com"];function el(){let e=Ms();e&&ao(window,"noibuNavigation",()=>{const t=Ms();if(!t||e===t)return;const n=e;if(e=t,r=t,i=n,Js(()=>{const e=new URL(r),t=new URL(i);return e.host===t.host&&e.pathname===t.pathname},!1)&&!Xc.some(e=>t.includes(e)))return void function(e,t){const n={url:e,page_title:window.document.title,page_groups:vo(),ref_url:t};$o.getInstance().addEvent(n,K)}(t,n);var r,i;const s=ko.getInstance().storedPageGroups,o=To.getInstance().getPageInformation();o.page_groups=s,Wo.getInstance().stopRecording(),To.getInstance().handleUnload(o),setTimeout(()=>{const t={url:e,pageTitle:window.document.title,referrerUrl:n,referrerPageGroups:s};Js(()=>{oo.reinitializeInstance(),ko.reinitializeInstance(t),yo.reinitializeInstance(),To.reinitializeInstance($e()(),t),Wo.reinitializeInstance(),Qc(),Yc()})},10)})}let tl=!1;let nl=!1;function rl(){fa.getInstance().addNoibuInternalCustomAttribute("qualtrics_survey_completed","true")}function il(){ao(window,"message",e=>{if("string"==typeof e.data){if(e.data.startsWith("QualtricsEOS"))try{const t=e.data.split("|"),n=t[1],r=t[2];rl(),fa.getInstance().addNoibuInternalCustomAttribute("qualtrics_survey_id",n),fa.getInstance().addNoibuInternalCustomAttribute("qualtrics_session_id",r)}catch(e){}if("endOfSurvey"===e.data)try{rl()}catch(e){}}})}function sl(){window.QSI&&window.QSI.API&&il()}let ol=!1;function al(){ol||(ol=!0,ao(window,"MDigital_Submit_Feedback",e=>{const t=e.detail.Form_ID,n=e.detail.Feedback_UUID;fa.getInstance().addNoibuInternalCustomAttribute("medallia_form_id",t),fa.getInstance().addNoibuInternalCustomAttribute("medallia_feedback_uuid",n)}))}var cl=function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function o(e){try{c(r.next(e))}catch(e){s(e)}}function a(e){try{c(r.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}c((r=r.apply(e,t||[])).next())}))};let ll=!1;function ul(e){if(e)try{const{id:t,response_id:n}=e;t&&fa.getInstance().addNoibuInternalCustomAttribute("hotjar_feedback_id",""+t),n&&fa.getInstance().addNoibuInternalCustomAttribute("hotjar_feedback_response_id",""+n)}catch(e){}}function dl(){return cl(this,void 0,void 0,(function*(){ll||(ll=!0,yield function(){return cl(this,void 0,void 0,(function*(){yield Is(),window.hj&&"function"==typeof window.hj&&window.hj.event&&(window.hj.event.listen("feedback.sentiment",e=>{ul(e)}),window.hj.event.listen("poll.send",e=>{ul(e)}))}))}())}))}let hl=!1;let pl=!1;function gl(e){var t,n;(null===(t=null==e?void 0:e.detail)||void 0===t?void 0:t.campaignId)&&(null===(n=null==e?void 0:e.detail)||void 0===n?void 0:n.variationId)&&fa.getInstance().addNoibuInternalCustomAttribute("abtasty-campaign-"+e.detail.campaignId,"variation-"+e.detail.variationId)}async function fl(t){if(Gs())return;if(function(e){for(let t=0;t<m.length;t+=1){if(!e[m[t]])return!0}return!1}(t))return;if(!Ms().startsWith("http"))return;if(function(){const e=void 0!==self.noibuJSLoaded;return self.noibuJSLoaded=!0,e}())return;const n=`${t.metroplexHTTPBase}/${he}`;oo.configureInstance(n);try{const t=$e()();if(oo.getInstance().isDisabled)return;await ko.getInstance().initialize(),Ta(),ga.configure(!1);const n=To.getInstance(t);Wo.configureInstance(),_o.configureInstance(),Io.getInstance(),Qc();const r=Sc.getInstance(),i=wc.getInstance(),s=ic.getInstance(),o=sc.getInstance(),a=ac.getInstance(),c=Cc.getInstance(),l=Ec.getInstance(),u=kc.getInstance(),d=Ac.getInstance(),h=Tc.getInstance(),p=ma.getInstance(),g=Ca.getInstance(),m=Aa.getInstance(),v=zo.getInstance();Da.getInstance(),r.monitor(),i.monitor(),o.monitor(n.initialPageTitle),Uc(),Kc(window),ao(window,"noibuFrameAttach",e=>{Kc(e.detail)}),c.monitorClicks(),el(),Yc(),d.monitor(),a.monitor(),u.monitor(),p.monitor(),g.monitor(),m.monitor(),h.monitor(),function(t=!1){if(!tl||t){if(tl=!0,!window.navigator||!window.navigator.connection||!window.navigator.connection.downlink)return;const{connection:{downlink:t,rtt:n,effectiveType:r,saveData:i}}=window.navigator;$o.getInstance().addEvent({downlink:Number(t),effective_type:r===e.TwoG||r===e.ThreeG||r===e.FourG||r===e.Slow2g?r:e.FourG,rtt:Number(n),save_data:!!i},Q)}}(),nl||(nl=!0,window.QSI&&window.QSI.API?il():ao(window,"qsi_js_loaded",sl,!1)),al(),pl||(pl=!0,ao(window,"abtasty_executedCampaign",gl,!1)),Wa(),ec(),s.monitor();const y=Wo.getInstance();n.connectionPromise.then(()=>{fa.getInstance().exposeFunctions(),ga.getInstance().checkInitialRequest(),function(){if(!hl){hl=!0;try{const e=new URLSearchParams(window.location.search),t=["utm_source","utm_medium","utm_campaign","utm_term","utm_content"],n=fa.getInstance();t.forEach(t=>{const r=e.get(t);r&&n.addNoibuInternalCustomAttribute(t,r)})}catch(e){}}}()}),Do([Is(),n.connectionPromise]).then(()=>{y.setRRWeb({record:Yn,addCustomEvent:Qn,pack:Dr}),y.recordUserSession(),l.setWebVitals(f),l.monitor(),v.monitor(),dl()}).catch(e=>{const t=xs(e);oo.getInstance().postNoibuErrorAndOptionallyDisableClient(`Error during recordUserSession: ${e}${t}`,!1,E)}),function(){try{const{search:e}=location;return new URLSearchParams(e).has("noibu-agent")}catch(e){return!1}}()&&function(e){const t=new URL("https://cdn.noibu.com/collect-agent.js");t.searchParams.set("pv",e),Zs(t,null,null)}(oo.getInstance().pageVisitId)}catch(e){const t=xs(e);oo.getInstance().postNoibuErrorAndOptionallyDisableClient(`Error during globalInit: ${e}${t}`,!0,E)}}const ml={metroplexSocketBase:Ve(),metroplexHTTPBase:We()};(async()=>{await fl(ml)})()})()})();