\n
\n');function y(){var t;null===(t=document.querySelector("#".concat(c)))||void 0===t||t.addEventListener("click",(function(){var t=w();t&&(t.style.display="none")}))}function g(t){var e=w();if(e)e.style.display="flex";else{var r=document.createElement("style");r.textContent=m,t&&(r.textContent+="\n.".concat(f," {\n display: none !important;\n}")),document.head.appendChild(r);var o,i,a=document.querySelector("body");a&&a.insertAdjacentHTML("beforeend",v),i=1,o=setInterval((function(){var t=document.getElementById(d);t&&i<=2&&(t.innerHTML=n[i],i+=1)}),3e3),2===i&&clearInterval(o),y()}}function b(){document.querySelectorAll(".".concat(r)).forEach((function(t){t.style.opacity="0",t.remove()}))}function w(){return document.querySelector(".".concat(r))}var S="default_post_redirect_scheduler_url";const x={log:"log",debug:"debug",info:"info",warn:"warn",error:"error"},_=console,E={};Object.keys(x).forEach((t=>{E[t]=_[t]}));const k="Datadog Browser SDK:",O={debug:E.debug.bind(_,k),log:E.log.bind(_,k),info:E.info.bind(_,k),warn:E.warn.bind(_,k),error:E.error.bind(_,k)},L="https://docs.datadoghq.com",C=`${L}/real_user_monitoring/browser/troubleshooting`,j="More details:";function A(t,e){return(...n)=>{try{return t(...n)}catch(t){O.error(e,t)}}}let T,P=!1;function I(t){P=t}function R(t){return function(){return D(t,this,arguments)}}function D(t,e,n){try{return t.apply(e,n)}catch(t){F(t)}}function F(t){if(M(t),T)try{T(t)}catch(t){M(t)}}function M(...t){P&&O.error("[MONITOR]",...t)}function U(){if("object"==typeof globalThis)return globalThis;Object.defineProperty(Object.prototype,"_dd_temp_",{get(){return this},configurable:!0});let t=_dd_temp_;return delete Object.prototype._dd_temp_,"object"!=typeof t&&(t="object"==typeof self?self:"object"==typeof window?window:{}),t}function $(t){return null===t?"null":Array.isArray(t)?"array":typeof t}function N(t,e,n=function(){if("undefined"!=typeof WeakSet){const t=new WeakSet;return{hasAlreadyBeenSeen(e){const n=t.has(e);return n||t.add(e),n}}}const t=[];return{hasAlreadyBeenSeen(e){const n=t.indexOf(e)>=0;return n||t.push(e),n}}}()){if(void 0===e)return t;if("object"!=typeof e||null===e)return e;if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){const t=e.flags||[e.global?"g":"",e.ignoreCase?"i":"",e.multiline?"m":"",e.sticky?"y":"",e.unicode?"u":""].join("");return new RegExp(e.source,t)}if(n.hasAlreadyBeenSeen(e))return;if(Array.isArray(e)){const r=Array.isArray(t)?t:[];for(let t=0;t
"}finally{r(),o(),i(),a()}}function tt(t){const e=t,n=e.toJSON;return n?(delete e.toJSON,()=>{e.toJSON=n}):X}const et=220*G,nt="$",rt=3;function ot(t,e=et){const n=tt(Object.prototype),r=tt(Array.prototype),o=[],i=new WeakMap,a=it(t,nt,void 0,o,i),s=JSON.stringify(a);let u=s?s.length:0;if(!(u>e)){for(;o.length>0&&ue){st(e,"truncated",t);break}n.target[a]=s}else for(const a in n.source)if(Object.prototype.hasOwnProperty.call(n.source,a)){const s=it(n.source[a],n.path,a,o,i);if(void 0!==s&&(u+=JSON.stringify(s).length+r+a.length+rt,r=1),u>e){st(e,"truncated",t);break}n.target[a]=s}}return n(),r(),a}st(e,"discarded",t)}function it(t,e,n,r,o){const i=function(t){const e=t;if(e&&"function"==typeof e.toJSON)try{return e.toJSON()}catch(t){}return t}(t);if(!i||"object"!=typeof i)return function(t){if("bigint"==typeof t)return`[BigInt] ${t.toString()}`;if("function"==typeof t)return`[Function] ${t.name||"unknown"}`;if("symbol"==typeof t)return`[Symbol] ${t.description||t.toString()}`;return t}(i);const a=at(i);if("[Object]"!==a&&"[Array]"!==a&&"[Error]"!==a)return a;const s=t;if(o.has(s))return`[Reference seen at ${o.get(s)}]`;const u=void 0!==n?`${e}.${n}`:e,c=Array.isArray(i)?[]:{};return o.set(s,u),r.push({source:i,target:c,path:u}),c}function at(t){try{if(t instanceof Event)return{type:(e=t).type,isTrusted:e.isTrusted,currentTarget:e.currentTarget?at(e.currentTarget):null,target:e.target?at(e.target):null};if(t instanceof RegExp)return`[RegExp] ${t.toString()}`;const n=Object.prototype.toString.call(t).match(/\[object (.*)\]/);if(n&&n[1])return`[${n[1]}]`}catch(t){}var e;return"[Unserializable]"}function st(t,e,n){O.warn(`The data provided has been ${e} as it is over the limit of ${t} characters:`,n)}class ut{constructor(t){this.onFirstSubscribe=t,this.observers=[]}subscribe(t){return this.observers.push(t),1===this.observers.length&&this.onFirstSubscribe&&(this.onLastUnsubscribe=this.onFirstSubscribe(this)||void 0),{unsubscribe:()=>{this.observers=this.observers.filter((e=>t!==e)),!this.observers.length&&this.onLastUnsubscribe&&this.onLastUnsubscribe()}}}notify(t){this.observers.forEach((e=>e(t)))}}function ct(...t){return new ut((e=>{const n=t.map((t=>t.subscribe((t=>e.notify(t)))));return()=>n.forEach((t=>t.unsubscribe()))}))}function lt(t,e,n){const r={...t};for(const[t,{required:o,type:i}]of Object.entries(e))"string"!==i||ft(r[t])||(r[t]=String(r[t])),o&&ft(r[t])&&O.warn(`The property ${t} of ${n} is required; context will not be sent to the intake.`);return r}function ft(t){return null==t||""===t}function dt(t="",{propertiesConfig:e={}}={}){let n={};const r=new ut,o={getContext:()=>q(n),setContext:i=>{!function(t){const e="object"===$(t);return e||O.error("Unsupported context:",t),e}(i)?o.clearContext():n=ot(lt(i,e,t)),r.notify()},setContextProperty:(o,i)=>{n=ot(lt({...n,[o]:i},e,t)),r.notify()},removeContextProperty:o=>{delete n[o],lt(n,e,t),r.notify()},clearContext:()=>{n={},r.notify()},changeObservable:r};return o}const pt={GRANTED:"granted",NOT_GRANTED:"not-granted"};function ht(t,e,n,r,o){return mt(t,e,[n],r,o)}function mt(t,e,n,r,{once:o,capture:i,passive:a}={}){const s=R((e=>{(e.isTrusted||e.__ddIsTrusted||t.allowUntrustedEvents)&&(o&&f(),r(e))})),u=a?{capture:i,passive:a}:i,c=window.EventTarget&&e instanceof EventTarget?window.EventTarget.prototype:e,l=W(c,"addEventListener");function f(){const t=W(c,"removeEventListener");n.forEach((n=>t.call(e,n,s,u)))}return n.forEach((t=>l.call(e,t,s,u))),{stop:f}}function vt(t,e){return Object.keys(t).some((n=>t[n]===e))}function yt(t){return 0===Object.keys(t).length}const gt="_dd_c",bt=[];function wt(t,e,n,r){const o=function(t,e){return`${gt}_${t}_${e}`}(n,r);bt.push(ht(t,window,"storage",(({key:t})=>{o===t&&e.setContext(a())}))),e.changeObservable.subscribe((function(){localStorage.setItem(o,JSON.stringify(e.getContext()))}));const i=B(a(),e.getContext());function a(){const t=localStorage.getItem(o);return t?JSON.parse(t):{}}yt(i)||e.setContext(i)}const St="?";function xt(t){const e=[];let n=Tt(t,"stack");const r=String(t);return n&&n.startsWith(r)&&(n=n.slice(r.length)),n&&n.split("\n").forEach((t=>{const n=function(t){const e=kt.exec(t);if(!e)return;const n=e[2]&&0===e[2].indexOf("native"),r=e[2]&&0===e[2].indexOf("eval"),o=Ot.exec(e[2]);r&&o&&(e[2]=o[1],e[3]=o[2],e[4]=o[3]);return{args:n?[e[2]]:[],column:e[4]?+e[4]:void 0,func:e[1]||St,line:e[3]?+e[3]:void 0,url:n?void 0:e[2]}}(t)||function(t){const e=Lt.exec(t);if(!e)return;return{args:[],column:e[3]?+e[3]:void 0,func:St,line:e[2]?+e[2]:void 0,url:e[1]}}(t)||function(t){const e=Ct.exec(t);if(!e)return;return{args:[],column:e[4]?+e[4]:void 0,func:e[1]||St,line:+e[3],url:e[2]}}(t)||function(t){const e=jt.exec(t);if(!e)return;const n=e[3]&&e[3].indexOf(" > eval")>-1,r=At.exec(e[3]);n&&r&&(e[3]=r[1],e[4]=r[2],e[5]=void 0);return{args:e[2]?e[2].split(","):[],column:e[5]?+e[5]:void 0,func:e[1]||St,line:e[4]?+e[4]:void 0,url:e[3]}}(t);n&&(!n.func&&n.line&&(n.func=St),e.push(n))})),{message:Tt(t,"message"),name:Tt(t,"name"),stack:e}}const _t="((?:file|https?|blob|chrome-extension|electron|native|eval|webpack|snippet||\\w+\\.|\\/).*?)",Et="(?::(\\d+))",kt=new RegExp(`^\\s*at (.*?) ?\\(${_t}${Et}?${Et}?\\)?\\s*$`,"i"),Ot=new RegExp(`\\((\\S*)${Et}${Et}\\)`);const Lt=new RegExp(`^\\s*at ?${_t}${Et}?${Et}??\\s*$`,"i");const Ct=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;const jt=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|capacitor|\[native).*?|[^@]*bundle|\[wasm code\])(?::(\d+))?(?::(\d+))?\s*$/i,At=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;function Tt(t,e){if("object"!=typeof t||!t||!(e in t))return;const n=t[e];return"string"==typeof n?n:void 0}function Pt(t,e,n,r){if(void 0===e)return;const{name:o,message:i}=function(t){let e,n;"[object String]"==={}.toString.call(t)&&([,e,n]=It.exec(t));return{name:e,message:n}}(t);return{name:o,message:i,stack:[{url:e,column:r,line:n}]}}const It=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?([\s\S]*)$/;function Rt(t){const e=new Error(t);let n;return e.name="HandlingStack",D((()=>{const t=xt(e);t.stack=t.stack.slice(2),n=Dt(t)})),n}function Dt(t){let e=Ft(t);return t.stack.forEach((t=>{const n="?"===t.func?"":t.func,r=t.args&&t.args.length>0?`(${t.args.join(", ")})`:"",o=t.line?`:${t.line}`:"",i=t.line&&t.column?`:${t.column}`:"";e+=`\n at ${n}${r} @ ${t.url}${o}${i}`})),e}function Ft(t){return`${t.name||"Error"}: ${t.message}`}const Mt="No stack, consider using an instance of Error";function Ut({stackTrace:t,originalError:e,handlingStack:n,componentStack:r,startClocks:o,nonErrorPrefix:i,useFallbackStack:a=!0,source:s,handling:u}){const c=Bt(e);return!t&&c&&(t=xt(e)),{startClocks:o,source:s,handling:u,handlingStack:n,componentStack:r,originalError:e,type:t?t.name:void 0,message:$t(t,c,i,e),stack:t?Dt(t):a?Mt:void 0,causes:c?Gt(e,s):void 0,fingerprint:Nt(e),context:qt(e)}}function $t(t,e,n,r){return(null==t?void 0:t.message)&&(null==t?void 0:t.name)?t.message:e?"Empty message":`${n} ${Q(ot(r))}`}function Nt(t){return Bt(t)&&"dd_fingerprint"in t?String(t.dd_fingerprint):void 0}function qt(t){if(null!==t&&"object"==typeof t&&"dd_context"in t)return t.dd_context}function Bt(t){return t instanceof Error||"[object Error]"===Object.prototype.toString.call(t)}function Gt(t,e){let n=t;const r=[];for(;Bt(null==n?void 0:n.cause)&&r.length<10;){const t=xt(n.cause);r.push({message:n.cause.message,source:e,type:null==t?void 0:t.name,stack:t&&Dt(t)}),n=n.cause}return r.length?r:void 0}var Ht;!function(t){t.PROFILING="profiling",t.TRACK_INTAKE_REQUESTS="track_intake_requests",t.WRITABLE_RESOURCE_GRAPHQL="writable_resource_graphql",t.DOM_MUTATION_IGNORING="dom_mutation_ignoring"}(Ht||(Ht={}));const Vt=new Set;function zt(t){Array.isArray(t)&&t.filter((t=>vt(Ht,t))).forEach((t=>{Vt.add(t)}))}function Wt(){return Vt}const Zt="datad0g.com",Jt="dd0g-gov.com",Yt="datadoghq.com",Kt="pci.browser-intake-datadoghq.com",Xt=["ddsource","ddtags"],Qt=1e3,te=60*Qt,ee=60*te,ne=365*(24*ee);function re(){return(new Date).getTime()}function oe(){return re()}function ie(){return performance.now()}function ae(){return{relative:ie(),timeStamp:oe()}}function se(t,e){return t+e}function ue(t){return t-le()}let ce;function le(){return void 0===ce&&(ce=performance.timing.navigationStart),ce}function fe(t,e){const n=window.__ddBrowserSdkExtensionCallback;n&&n({type:t,payload:e})}function de(t){return 0!==t&&100*Math.random()<=t}function pe(){var t;const e=window.navigator;return{status:e.onLine?"connected":"not_connected",interfaces:e.connection&&e.connection.type?[e.connection.type]:void 0,effective_type:null===(t=e.connection)||void 0===t?void 0:t.effectiveType}}function he(t,e){const n=t.indexOf(e);n>=0&&t.splice(n,1)}const me=500;function ve(){const t=[];return{add:e=>{t.push(e)>me&&t.splice(0,1)},remove:e=>{he(t,e)},drain:e=>{t.forEach((t=>t(e))),t.length=0}}}const ye={log:"log",configuration:"configuration",usage:"usage"},ge=["https://www.datadoghq-browser-agent.com","https://www.datad0g-browser-agent.com","https://d3uc069fcn7uxw.cloudfront.net","https://d20xtzwzcl0ceb.cloudfront.net","http://localhost",""],be=["ddog-gov.com"];let we=ve(),Se=t=>{we.add((()=>Se(t)))};function xe(t,e){let n;const r=new ut,o=new Set,i=!be.includes(e.site)&&de(e.telemetrySampleRate),a={[ye.log]:i,[ye.configuration]:i&&de(e.telemetryConfigurationSampleRate),[ye.usage]:i&&de(e.telemetryUsageSampleRate)},s={is_local_file:"file:"===window.location.protocol,is_worker:"WorkerGlobalScope"in self};return Se=i=>{const u=Q(i);if(a[i.type]&&o.size{n=t},observable:r,enabled:i}}function _e(t,e){M(x.debug,t,e),Se({type:ye.log,message:t,status:"debug",...e})}function Ee(t,e){Se({type:ye.log,status:"error",...ke(t),...e})}function ke(t){if(Bt(t)){const e=xt(t);return{error:{kind:e.name,stack:Dt(Oe(e))},message:e.message}}return{error:{stack:Mt},message:`Uncaught ${Q(t)}`}}function Oe(t){return t.stack=t.stack.filter((t=>!t.url||ge.some((e=>t.url.startsWith(e))))),t}function Le(t,e){e.silentMultipleInit||O.error(`${t} is already initialized.`)}const Ce={AGENT:"agent",CONSOLE:"console",CUSTOM:"custom",LOGGER:"logger",NETWORK:"network",SOURCE:"source",REPORT:"report"};function je(t,e,n){const r=n.getHandler(),o=Array.isArray(r)?r:[r];return Te[t]>=Te[n.getLevel()]&&o.includes(e)}const Ae={ok:"ok",debug:"debug",info:"info",notice:"notice",warn:"warn",error:"error",critical:"critical",alert:"alert",emerg:"emerg"},Te={[Ae.ok]:0,[Ae.debug]:1,[Ae.info]:2,[Ae.notice]:4,[Ae.warn]:5,[Ae.error]:6,[Ae.critical]:7,[Ae.alert]:8,[Ae.emerg]:9};function Pe(t,{includeMessage:e=!1}={}){return{stack:t.stack,kind:t.type,message:e?t.message:void 0,causes:t.causes,fingerprint:t.fingerprint,handling:t.handling}}var Ie=function(t,e,n,r){var o,i=arguments.length,a=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,n,a):o(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a};const Re={console:"console",http:"http",silent:"silent"},De=Object.keys(Ae);class Fe{constructor(t,e,n=Re.http,r=Ae.debug,o={}){this.handleLogStrategy=t,this.handlerType=n,this.level=r,this.contextManager=dt("logger"),this.contextManager.setContext(o),e&&this.contextManager.setContextProperty("logger",{name:e})}logImplementation(t,e,n=Ae.info,r,o){const i=ot(e);let a;if(null!=r){a=B({error:Pe(Ut({originalError:r,nonErrorPrefix:"Provided",source:Ce.LOGGER,handling:"handled",startClocks:ae()}),{includeMessage:!0})},i)}else a=i;this.handleLogStrategy({message:ot(t),context:a,status:n},this,o)}log(t,e,n=Ae.info,r){let o;je(n,Re.http,this)&&(o=Rt("log")),this.logImplementation(t,e,n,r,o)}setContext(t){this.contextManager.setContext(t)}getContext(){return this.contextManager.getContext()}setContextProperty(t,e){this.contextManager.setContextProperty(t,e)}removeContextProperty(t){this.contextManager.removeContextProperty(t)}clearContext(){this.contextManager.clearContext()}setHandler(t){this.handlerType=t}getHandler(){return this.handlerType}setLevel(t){this.level=t}getLevel(){return this.level}}function Me(t){return function(e,n,r){let o;je(t,Re.http,this)&&(o=Rt("log")),this.logImplementation(e,n,t,r,o)}}function Ue(){const t=U().DatadogEventBridge;if(t)return{getCapabilities(){var e;return JSON.parse((null===(e=t.getCapabilities)||void 0===e?void 0:e.call(t))||"[]")},getPrivacyLevel(){var e;return null===(e=t.getPrivacyLevel)||void 0===e?void 0:e.call(t)},getAllowedWebViewHosts:()=>JSON.parse(t.getAllowedWebViewHosts()),send(e,n,r){const o=r?{id:r}:void 0;t.send(JSON.stringify({eventType:e,event:n,view:o}))}}}function $e(t){var e;void 0===t&&(t=null===(e=U().location)||void 0===e?void 0:e.hostname);const n=Ue();return!!n&&n.getAllowedWebViewHosts().some((e=>t===e||t.endsWith(`.${e}`)))}function Ne(t,e,n,{computeHandlingStack:r}={}){let o=t[e];if("function"!=typeof o){if(!(e in t)||!e.startsWith("on"))return{stop:X};o=X}let i=!1;const a=function(){if(i)return o.apply(this,arguments);const t=Array.from(arguments);let e;D(n,null,[{target:this,parameters:t,onPostCall:t=>{e=t},handlingStack:r?Rt("instrumented method"):void 0}]);const a=o.apply(this,t);return e&&D(e,null,[a]),a};return t[e]=a,{stop:()=>{i=!0,t[e]===a&&(t[e]=o)}}}function qe(t){return Be(t,location.href).href}function Be(t,e){const n=function(){if(void 0===He)try{const t=new Ge("http://test/path");He="http://test/path"===t.href}catch(t){He=!1}return He?Ge:void 0}();if(n)try{return void 0!==e?new n(t,e):new n(t)}catch(n){throw new Error(`Failed to construct URL: ${String(n)} ${Q({url:t,base:e})}`)}if(void 0===e&&!/:/.test(t))throw new Error(`Invalid URL: '${t}'`);let r=document;const o=r.createElement("a");if(void 0!==e){r=document.implementation.createHTMLDocument("");const t=r.createElement("base");t.href=e,r.head.appendChild(t),r.body.appendChild(o)}return o.href=t,o}Ie([function(t,e,n){const r=n.value;n.value=function(...t){return(T?R(r):r).apply(this,t)}}],Fe.prototype,"logImplementation",null),Fe.prototype.ok=Me(Ae.ok),Fe.prototype.debug=Me(Ae.debug),Fe.prototype.info=Me(Ae.info),Fe.prototype.notice=Me(Ae.notice),Fe.prototype.warn=Me(Ae.warn),Fe.prototype.error=Me(Ae.error),Fe.prototype.critical=Me(Ae.critical),Fe.prototype.alert=Me(Ae.alert),Fe.prototype.emerg=Me(Ae.emerg);const Ge=URL;let He,Ve;function ze(){return Ve||(Ve=new ut((t=>{if(!window.fetch)return;const{stop:e}=Ne(window,"fetch",(e=>function({parameters:t,onPostCall:e,handlingStack:n},r){const[o,i]=t;let a=i&&i.method;void 0===a&&o instanceof Request&&(a=o.method);const s=void 0!==a?String(a).toUpperCase():"GET",u=o instanceof Request?o.url:qe(String(o)),c=ae(),l={state:"start",init:i,input:o,method:s,startClocks:c,url:u,handlingStack:n};r.notify(l),t[0]=l.input,t[1]=l.init,e((t=>function(t,e,n){const r=n;function o(e){r.state="resolve",Object.assign(r,e),t.notify(r)}e.then(R((t=>{o({response:t,responseType:t.type,status:t.status,isAborted:!1})})),R((t=>{var e,n;o({status:0,isAborted:(null===(n=null===(e=r.init)||void 0===e?void 0:e.signal)||void 0===n?void 0:n.aborted)||t instanceof DOMException&&t.code===DOMException.ABORT_ERR,error:t})})))}(r,t,l)))}(e,t)),{computeHandlingStack:!0});return e}))),Ve}function We(t){return t?(parseInt(t,10)^16*Math.random()>>parseInt(t,10)/4).toString(16):"10000000-1000-4000-8000-100000000000".replace(/[018]/g,We)}const Ze=/([\w-]+)\s*=\s*([^;]+)/g;function Je(t,e,n=""){const r=t.charCodeAt(e-1),o=r>=55296&&r<=56319?e+1:e;return t.length<=o?t:`${t.slice(0,o)}${n}`}let Ye,Ke,Xe;function Qe(){return null!=Ye?Ye:Ye=function(t=window){var e;const n=t.navigator.userAgent;if(t.chrome||/HeadlessChrome/.test(n))return 0;if(0===(null===(e=t.navigator.vendor)||void 0===e?void 0:e.indexOf("Apple"))||/safari/i.test(n)&&!/chrome|android/i.test(n))return 1;return 2}()}function tn(t,e,n=0,r){const o=new Date;o.setTime(o.getTime()+n);const i=`expires=${o.toUTCString()}`,a=r&&r.crossSite?"none":"strict",s=r&&r.domain?`;domain=${r.domain}`:"",u=r&&r.secure?";secure":"",c=r&&r.partitioned?";partitioned":"";document.cookie=`${t}=${e};${i};path=/;samesite=${a}${s}${u}${c}`}function en(t){return function(t,e){for(Ze.lastIndex=0;;){const n=Ze.exec(t);if(!n)break;if(n[1]===e)return n[2]}}(document.cookie,t)}function nn(t){return Ke||(Ke=function(t){const e=new Map;for(Ze.lastIndex=0;;){const n=Ze.exec(t);if(!n)break;e.set(n[1],n[2])}return e}(document.cookie)),Ke.get(t)}function rn(t,e){tn(t,"",0,e)}const on="_dd_s";function an(t){return Object.values(t)}const sn=4*ee,un=15*te,cn=ne,ln={COOKIE:"cookie",LOCAL_STORAGE:"local-storage"},fn=/^([a-zA-Z]+)=([a-z0-9-]+)$/,dn="&";const pn="1";function hn(t,e){const n={isExpired:pn};return e.trackAnonymousUser&&((null==t?void 0:t.anonymousId)?n.anonymousId=null==t?void 0:t.anonymousId:n.anonymousId=We()),n}function mn(t){return yt(t)}function vn(t){return!mn(t)}function yn(t){return void 0!==t.isExpired||!((void 0===(e=t).created||re()-Number(e.created)"anonymousId"===t?`aid=${e}`:`${t}=${e}`)).join(dn);var e}function wn(t){const e={};return function(t){return!!t&&(-1!==t.indexOf(dn)||fn.test(t))}(t)&&t.split(dn).forEach((t=>{const n=fn.exec(t);if(null!==n){const[,t,r]=n;"aid"===t?e.anonymousId=r:e[t]=r}})),e}const Sn="_dd",xn="_dd_r",_n="_dd_l",En="rum",kn="logs";function On(t){const e=function(t){const e={};e.secure=!!t.useSecureSessionCookie||!!t.usePartitionedCrossSiteSessionCookie,e.crossSite=!!t.usePartitionedCrossSiteSessionCookie,e.partitioned=!!t.usePartitionedCrossSiteSessionCookie,t.trackSessionAcrossSubdomains&&(e.domain=function(){if(void 0===Xe){const t=`dd_site_test_${We()}`,e="test",n=window.location.hostname.split(".");let r=n.pop();for(;n.length&&!en(t);)r=`${n.pop()}.${r}`,tn(t,e,Qt,{domain:r});rn(t,{domain:r}),Xe=r}return Xe}());return e}(t);return function(t){if(void 0===document.cookie||null===document.cookie)return!1;try{const e=`dd_cookie_test_${We()}`,n="test";tn(e,n,te,t);const r=en(e)===n;return rn(e,t),r}catch(t){return O.error(t),!1}}(e)?{type:ln.COOKIE,cookieOptions:e}:void 0}function Ln(t,e){const n={isLockEnabled:0===Qe(),persistSession:n=>Cn(e,t,n,un),retrieveSession:jn,expireSession:n=>Cn(e,t,hn(n,t),sn)};return function(t){if(!nn(on)){const e=nn(Sn),n=nn(xn),r=nn(_n),o={};e&&(o.id=e),r&&/^[01]$/.test(r)&&(o[kn]=r),n&&/^[012]$/.test(n)&&(o[En]=n),vn(o)&&(gn(o),t.persistSession(o))}}(n),n}function Cn(t,e,n,r){tn(on,bn(n),e.trackAnonymousUser?cn:r,t)}function jn(){return wn(en(on))}const An="_dd_test_";function Tn(){try{const t=We(),e=`${An}${t}`;localStorage.setItem(e,t);const n=localStorage.getItem(e);return localStorage.removeItem(e),t===n?{type:ln.LOCAL_STORAGE}:void 0}catch(t){return}}function Pn(t){return{isLockEnabled:!1,persistSession:In,retrieveSession:Rn,expireSession:e=>function(t,e){In(hn(t,e))}(e,t)}}function In(t){localStorage.setItem(on,bn(t))}function Rn(){return wn(localStorage.getItem(on))}const Dn=10,Fn=100,Mn=[];let Un;function $n(t,e,n=0){var r;const{isLockEnabled:o,persistSession:i,expireSession:a}=e,s=t=>i({...t,lock:c}),u=()=>{const t=e.retrieveSession(),n=t.lock;return t.lock&&delete t.lock,{session:t,lock:n}};if(Un||(Un=t),t!==Un)return void Mn.push(t);if(o&&n>=Fn)return void qn(e);let c,l=u();if(o){if(l.lock)return void Nn(t,e,n);if(c=We(),s(l.session),l=u(),l.lock!==c)return void Nn(t,e,n)}let f=t.process(l.session);if(o&&(l=u(),l.lock!==c))Nn(t,e,n);else{if(f&&(yn(f)?a(f):(gn(f),o?s(f):i(f))),o&&(!f||!yn(f))){if(l=u(),l.lock!==c)return void Nn(t,e,n);i(l.session),f=l.session}null===(r=t.after)||void 0===r||r.call(t,f||l.session),qn(e)}}function Nn(t,e,n){Z((()=>{$n(t,e,n+1)}),Dn)}function qn(t){Un=void 0;const e=Mn.shift();e&&$n(e,t)}const Bn=Qt;function Gn(t){switch(t.sessionPersistence){case ln.COOKIE:return On(t);case ln.LOCAL_STORAGE:return Tn();case void 0:{let e=On(t);return!e&&t.allowFallbackToLocalStorage&&(e=Tn()),e}default:O.error(`Invalid session persistence '${String(t.sessionPersistence)}'`)}}function Hn(t,e,n,r){const o=new ut,i=new ut,a=new ut,s=t.type===ln.COOKIE?Ln(e,t.cookieOptions):Pn(e),{expireSession:u}=s,c=Y((function(){$n({process:t=>yn(t)?hn(t,e):void 0,after:p},s)}),Bn);let l;h();const{throttled:f,cancel:d}=function(t,e,n){const r=!n||void 0===n.leading||n.leading,o=!n||void 0===n.trailing||n.trailing;let i,a,s=!1;return{throttled:(...n)=>{s?i=n:(r?t(...n):i=n,s=!0,a=Z((()=>{o&&i&&t(...i),s=!1,i=void 0}),e))},cancel:()=>{J(a),s=!1,i=void 0}}}((()=>{$n({process:t=>{if(mn(t))return;const e=p(t);return function(t){if(mn(t))return!1;const{trackingType:e,isTracked:o}=r(t[n]);t[n]=e,delete t.isExpired,o&&!t.id&&(t.id=We(),t.created=String(re()))}(e),e},after:t=>{vn(t)&&!m()&&function(t){l=t,o.notify()}(t),l=t}},s)}),Bn);function p(t){return yn(t)&&(t=hn(t,e)),m()&&(!function(t){return l.id!==t.id||l[n]!==t[n]}(t)?(a.notify({previousState:l,newState:t}),l=t):(l=hn(l,e),i.notify())),t}function h(){$n({process:t=>{if(mn(t))return hn(t,e)},after:t=>{l=t}},s)}function m(){return void 0!==l[n]}return{expandOrRenewSession:f,expandSession:function(){$n({process:t=>m()?p(t):void 0},s)},getSession:()=>l,renewObservable:o,expireObservable:i,sessionStateUpdateObservable:a,restartSession:h,expire:()=>{d(),u(l),p(hn(l,e))},stop:()=>{K(c)},updateSessionState:function(t){$n({process:e=>({...e,...t}),after:p},s)}}}function Vn(t,e,n){const r=function(t,e){const n=`/api/v2/${e}`,r=t.proxy;if("string"==typeof r){const t=qe(r);return e=>`${t}?ddforward=${encodeURIComponent(`${n}?${e}`)}`}if("function"==typeof r)return t=>r({path:n,parameters:t});const o=function(t,e){const{site:n=Yt,internalAnalyticsSubdomain:r}=e;if("logs"===t&&e.usePciIntake&&n===Yt)return Kt;if(r&&n===Yt)return`${r}.${Yt}`;if(n===Jt)return`http-intake.logs.${n}`;const o=n.split("."),i=o.pop();return`browser-intake-${o.join("-")}.${i}`}(e,t);return t=>`https://${o}${n}?${t}`}(t,e);return{build(o,i){const a=function({clientToken:t,internalAnalyticsSubdomain:e},n,r,o,{retry:i,encoding:a}){const s=["sdk_version:6.8.0",`api:${o}`].concat(r);i&&s.push(`retry_count:${i.count}`,`retry_after:${i.lastFailureStatus}`);const u=["ddsource=browser",`ddtags=${encodeURIComponent(s.join(","))}`,`dd-api-key=${t}`,`dd-evp-origin-version=${encodeURIComponent("6.8.0")}`,"dd-evp-origin=browser",`dd-request-id=${We()}`];a&&u.push(`dd-evp-encoding=${a}`);"rum"===n&&u.push(`batch_time=${oe()}`);e&&u.reverse();return u.join("&")}(t,e,n,o,i);return r(a)},tags:n,urlPrefix:r(""),trackType:e}}const zn=200;function Wn(t,e){const n=zn-t.length-1;(e.length>n||function(t){if(!function(){try{return new RegExp("[\\p{Ll}]","u"),!0}catch(t){return!1}}())return!1;return new RegExp("[^\\p{Ll}\\p{Lo}0-9_:./-]","u").test(t)}(e))&&O.warn(`${t} value doesn't meet tag requirements and will be sanitized. ${j} ${L}/getting_started/tagging/#defining-tags`);return`${t}:${e.replace(/,/g,"_")}`}function Zn(t){const e=t.site||Yt,n=function(t){const{env:e,service:n,version:r,datacenter:o}=t,i=[];return e&&i.push(Wn("env",e)),n&&i.push(Wn("service",n)),r&&i.push(Wn("version",r)),o&&i.push(Wn("datacenter",o)),i}(t),r=function(t,e){return{logsEndpointBuilder:Vn(t,"logs",e),rumEndpointBuilder:Vn(t,"rum",e),profilingEndpointBuilder:Vn(t,"profile",e),sessionReplayEndpointBuilder:Vn(t,"replay",e)}}(t,n),o=function(t,e){if(!t.replica)return;const n={...t,site:Yt,clientToken:t.replica.clientToken},r={logsEndpointBuilder:Vn(n,"logs",e),rumEndpointBuilder:Vn(n,"rum",e)};return{applicationId:t.replica.applicationId,...r}}(t,n);return{replica:o,site:e,...r}}function Jn(t,e){return null==t||"string"==typeof t||(O.error(`${e} must be defined as a string`),!1)}function Yn(t,e){return!!(void 0===t||(n=t,function(t){return"number"==typeof t}(n)&&n>=0&&n<=100))||(O.error(`${e} Sample Rate should be a number between 0 and 100`),!1);var n}function Kn(t){var e,n,r,o,i,a;if(t&&t.clientToken){if((!(s=t.site)||"string"!=typeof s||/(datadog|ddog|datad0g|dd0g)/.test(s)||(O.error(`Site should be a valid Datadog site. ${j} ${L}/getting_started/site/.`),0))&&Yn(t.sessionSampleRate,"Session")&&Yn(t.telemetrySampleRate,"Telemetry")&&Yn(t.telemetryConfigurationSampleRate,"Telemetry Configuration")&&Yn(t.telemetryUsageSampleRate,"Telemetry Usage")&&Jn(t.version,"Version")&&Jn(t.env,"Env")&&Jn(t.service,"Service")){var s;if(void 0===t.trackingConsent||vt(pt,t.trackingConsent))return{beforeSend:t.beforeSend&&A(t.beforeSend,"beforeSend threw an error:"),sessionStoreStrategyType:Gn(t),sessionSampleRate:null!==(e=t.sessionSampleRate)&&void 0!==e?e:100,telemetrySampleRate:null!==(n=t.telemetrySampleRate)&&void 0!==n?n:20,telemetryConfigurationSampleRate:null!==(r=t.telemetryConfigurationSampleRate)&&void 0!==r?r:5,telemetryUsageSampleRate:null!==(o=t.telemetryUsageSampleRate)&&void 0!==o?o:5,service:t.service||void 0,silentMultipleInit:!!t.silentMultipleInit,allowUntrustedEvents:!!t.allowUntrustedEvents,trackingConsent:null!==(i=t.trackingConsent)&&void 0!==i?i:pt.GRANTED,trackAnonymousUser:null===(a=t.trackAnonymousUser)||void 0===a||a,storeContextsAcrossPages:!!t.storeContextsAcrossPages,batchBytesLimit:16*G,eventRateLimiterThreshold:3e3,maxTelemetryEventsPerPage:15,flushTimeout:30*Qt,batchMessagesLimit:50,messageBytesLimit:256*G,...Zn(t)};O.error('Tracking Consent should be either "granted" or "not-granted"')}}else O.error("Client Token is not configured, we will not send any data.")}const Xn={intervention:"intervention",deprecation:"deprecation",cspViolation:"csp_violation"};function Qn(t,e){const n=[];e.includes(Xn.cspViolation)&&n.push(function(t){return new ut((e=>{const{stop:n}=ht(t,document,"securitypolicyviolation",(t=>{e.notify(function(t){const e=`'${t.blockedURI}' blocked by '${t.effectiveDirective}' directive`;return tr({type:t.effectiveDirective,message:`${Xn.cspViolation}: ${e}`,originalError:t,csp:{disposition:t.disposition},stack:er(t.effectiveDirective,t.originalPolicy?`${e} of the policy "${Je(t.originalPolicy,100,"...")}"`:"no policy",t.sourceFile,t.lineNumber,t.columnNumber)})}(t))}));return n}))}(t));const r=e.filter((t=>t!==Xn.cspViolation));return r.length&&n.push(function(t){return new ut((e=>{if(!window.ReportingObserver)return;const n=R(((t,n)=>t.forEach((t=>e.notify(function(t){const{type:e,body:n}=t;return tr({type:n.id,message:`${e}: ${n.message}`,originalError:t,stack:er(n.id,n.message,n.sourceFile,n.lineNumber,n.columnNumber)})}(t)))))),r=new window.ReportingObserver(n,{types:t,buffered:!0});return r.observe(),()=>{r.disconnect()}}))}(r)),ct(...n)}function tr(t){return{startClocks:ae(),source:Ce.REPORT,handling:"unhandled",...t}}function er(t,e,n,r,o){return n?Dt({name:t,message:e,stack:[{func:"?",url:n,line:null!=r?r:void 0,column:null!=o?o:void 0}]}):void 0}const nr=32*G;function rr(t,e,n){return void 0===t?[]:"all"===t||Array.isArray(t)&&t.every((t=>e.includes(t)))?"all"===t?e:function(t){const e=new Set;return t.forEach((t=>e.add(t))),Array.from(e)}(t):void O.error(`${n} should be "all" or an array with allowed values "${e.join('", "')}"`)}function or(t,e,n){const r=ve();let o,i;const a=e.observable.subscribe(s);function s(){if(!i||!o||!e.isGranted())return;a.unsubscribe();const t=n(o,i);r.drain(t)}return{init(t){if(!t)return void O.error("Missing configuration");if(zt(t.enableExperimentalFeatures),$e()&&(t=function(t){return{...t,clientToken:"empty"}}(t)),o=t,i)return void Le("DD_LOGS",t);const n=function(t){!0===t.usePciIntake&&t.site&&"datadoghq.com"!==t.site&&O.warn("PCI compliance for Logs is only available for Datadog organizations in the US1 site. Default intake will be used.");const e=Kn(t),n=rr(t.forwardConsoleLogs,an(x),"Forward Console Logs"),r=rr(t.forwardReports,an(Xn),"Forward Reports");if(e&&n&&r)return t.forwardErrorsToLogs&&!n.includes(x.error)&&n.push(x.error),{forwardErrorsToLogs:!1!==t.forwardErrorsToLogs,forwardConsoleLogs:n,forwardReports:r,requestErrorResponseLengthLimit:nr,...e}}(t);n&&(i=n,ze().subscribe(X),e.tryToInit(n.trackingConsent),s())},get initConfiguration(){return o},getInternalContext:X,handleLog(e,n,o,i=t(),a=oe()){r.add((t=>t.handleLog(e,n,o,i,a)))}}}const ir="logs";const ar={HIDDEN:"visibility_hidden",UNLOADING:"before_unload",PAGEHIDE:"page_hide",FROZEN:"page_frozen"};const sr="datadog-synthetics-public-id",ur="datadog-synthetics-result-id",cr="datadog-synthetics-injects-rum";function lr(){return Boolean(window._DATADOG_SYNTHETICS_INJECTS_RUM||nn(cr))}function fr(){const t=window._DATADOG_SYNTHETICS_PUBLIC_ID||nn(sr);return"string"==typeof t?t:void 0}function dr(){const t=window._DATADOG_SYNTHETICS_RESULT_ID||nn(ur);return"string"==typeof t?t:void 0}const pr=1/0,hr=te;let mr=null;const vr=new Set;function yr({expireDelay:t,maxEntries:e}){let n=[];mr||(mr=Y((()=>{vr.forEach((t=>t()))}),hr));const r=()=>{const e=ie()-t;for(;n.length>0&&n[n.length-1].endTime{he(n,o)},close:t=>{o.endTime=t}};return e&&n.length>=e&&n.pop(),n.unshift(o),o},find:function(t=pr,e={returnInactive:!1}){for(const r of n)if(r.startTime<=t){if(e.returnInactive||t<=r.endTime)return r.value;break}},closeActive:function(t){const e=n[0];e&&e.endTime===pr&&e.close(t)},findAll:function(t=pr,e=0){const r=se(t,e);return n.filter((e=>e.startTime<=r&&t<=e.endTime)).map((t=>t.value))},reset:function(){n=[]},stop:function(){vr.delete(r),0===vr.size&&mr&&(K(mr),mr=null)}}}const gr=te,br=sn;let wr=[];function Sr(t,e,n,r){const o=new ut,i=new ut,a=Hn(t.sessionStoreStrategyType,t,e,n);wr.push((()=>a.stop()));const s=yr({expireDelay:br});function u(){return{id:a.getSession().id,trackingType:a.getSession()[e],isReplayForced:!!a.getSession().forcedReplay,anonymousId:a.getSession().anonymousId}}return wr.push((()=>s.stop())),a.renewObservable.subscribe((()=>{s.add(u(),ie()),o.notify()})),a.expireObservable.subscribe((()=>{i.notify(),s.closeActive(ie())})),a.expandOrRenewSession(),s.add(u(),[0,le()][0]),r.observable.subscribe((()=>{r.isGranted()?a.expandOrRenewSession():a.expire()})),function(t,e){const{stop:n}=mt(t,window,["click","touchstart","keydown","scroll"],e,{capture:!0,passive:!0});wr.push(n)}(t,(()=>{r.isGranted()&&a.expandOrRenewSession()})),function(t,e){const n=()=>{"visible"===document.visibilityState&&e()},{stop:r}=ht(t,document,"visibilitychange",n);wr.push(r);const o=Y(n,gr);wr.push((()=>{K(o)}))}(t,(()=>a.expandSession())),function(t,e){const{stop:n}=ht(t,window,"resume",e,{capture:!0});wr.push(n)}(t,(()=>a.restartSession())),{findSession:(t,e)=>s.find(t,e),renewObservable:o,expireObservable:i,sessionStateUpdateObservable:a.sessionStateUpdateObservable,expire:a.expire,updateSessionState:a.updateSessionState}}const xr="logs";function _r(t,e){const n=Sr(t,xr,(e=>function(t,e){const n=function(t){return"0"===t||"1"===t}(e)?e:Er(t);return{trackingType:n,isTracked:"1"===n}}(t,e)),e);return{findTrackedSession:(t,e={returnInactive:!1})=>{const r=n.findSession(t,e);return r&&"1"===r.trackingType?{id:r.id,anonymousId:r.anonymousId}:void 0},expireObservable:n.expireObservable}}function Er(t){return de(t.sessionSampleRate)?"1":"0"}function kr(t,e,n,r,o,i){const a=De.concat(["custom"]),s={};a.forEach((t=>{s[t]=function(t,e,n){let r=0,o=!1;return{isLimitReached(){if(0===r&&Z((()=>{r=0}),te),r+=1,r<=e||o)return o=!1,!1;if(r===e+1){o=!0;try{n({message:`Reached max number of ${t}s by minute: ${e}`,source:Ce.AGENT,startClocks:ae()})}finally{o=!1}}return!0}}}(t,e.eventRateLimiterThreshold,i)})),n.subscribe(0,(({rawLogsEvent:i,messageContext:a,savedCommonContext:u,domainContext:c})=>{var l,f;const d=ue(i.date),p=t.findTrackedSession(d);if(!t.findTrackedSession(d,{returnInactive:!0}))return;const h=u||o();let m;!yt(h.account)&&h.account.id&&(m=h.account),p&&p.anonymousId&&!h.user.anonymous_id&&(h.user.anonymous_id=p.anonymousId);const v=r.triggerHook(0,{startTime:d}),y=B({service:e.service,session_id:p?p.id:void 0,session:p?{id:p.id}:void 0,usr:yt(h.user)?void 0:h.user,account:m,view:h.view},h.context,v,i,a);!1===(null===(l=e.beforeSend)||void 0===l?void 0:l.call(e,y,c))||y.origin!==Ce.AGENT&&(null!==(f=s[y.status])&&void 0!==f?f:s.custom).isLimitReached()||n.notify(1,y)}))}let Or={};function Lr(t){return ct(...t.map((t=>(Or[t]||(Or[t]=function(t){return new ut((e=>{const n=_[t];return _[t]=(...r)=>{n.apply(console,r);const o=Rt("console error");D((()=>{e.notify(function(t,e,n){const r=t.map((t=>function(t){if("string"==typeof t)return ot(t);if(Bt(t))return Ft(xt(t));return Q(ot(t),void 0,2)}(t))).join(" ");if(e===x.error){const o=Ut({originalError:t.find(Bt),handlingStack:n,startClocks:ae(),source:Ce.CONSOLE,handling:"handled",nonErrorPrefix:"Provided",useFallbackStack:!1});return o.message=r,{api:e,message:r,handlingStack:n,error:o}}return{api:e,message:r,error:void 0,handlingStack:n}}(r,t,o))}))},()=>{_[t]=n}}))}(t)),Or[t]))))}const Cr={[x.log]:Ae.info,[x.debug]:Ae.debug,[x.info]:Ae.info,[x.warn]:Ae.warn,[x.error]:Ae.error};let jr;const Ar=new WeakMap;function Tr(t){return jr||(jr=function(t){return new ut((e=>{const{stop:n}=Ne(XMLHttpRequest.prototype,"open",Pr),{stop:r}=Ne(XMLHttpRequest.prototype,"send",(n=>{!function({target:t,handlingStack:e},n,r){const o=Ar.get(t);if(!o)return;const i=o;i.state="start",i.startClocks=ae(),i.isAborted=!1,i.xhr=t,i.handlingStack=e;let a=!1;const{stop:s}=Ne(t,"onreadystatechange",(()=>{t.readyState===XMLHttpRequest.DONE&&u()})),u=()=>{if(c(),s(),a)return;a=!0;const e=o;var n,u;e.state="complete",e.duration=(n=i.startClocks.timeStamp,oe()-n),e.status=t.status,r.notify((u=e,{...u}))},{stop:c}=ht(n,t,"loadend",u);r.notify(i)}(n,t,e)}),{computeHandlingStack:!0}),{stop:o}=Ne(XMLHttpRequest.prototype,"abort",Ir);return()=>{n(),r(),o()}}))}(t)),jr}function Pr({target:t,parameters:[e,n]}){Ar.set(t,{state:"open",method:String(e).toUpperCase(),url:qe(String(n))})}function Ir({target:t}){const e=Ar.get(t);e&&(e.isAborted=!0)}function Rr(t){return t>=500}function Dr(t,e){if(!t.forwardErrorsToLogs)return{stop:X};const n=Tr(t).subscribe((t=>{"complete"===t.state&&o("xhr",t)})),r=ze().subscribe((t=>{"resolve"===t.state&&o("fetch",t)}));function o(n,r){var o;function i(t){const o={isAborted:r.isAborted,handlingStack:r.handlingStack};e.notify(0,{rawLogsEvent:{message:`${Mr(n)} error ${r.method} ${r.url}`,date:r.startClocks.timeStamp,error:{stack:t||"Failed to load",handling:void 0},http:{method:r.method,status_code:r.status,url:r.url},status:Ae.error,origin:Ce.NETWORK},domainContext:o})}o=r.url,Xt.every((t=>o.includes(t)))||!function(t){return 0===t.status&&"opaque"!==t.responseType}(r)&&!Rr(r.status)||("xhr"in r?function(t,e,n){"string"==typeof t.response?n(Fr(t.response,e)):n(t.response)}(r.xhr,t,i):r.response?function(t,e,n){const r=function(t){try{return t.clone()}catch(t){return}}(t);r&&r.body?window.TextDecoder?function(t,e,n){!function(t,e,n){const r=t.getReader(),o=[];let i=0;function a(){let t,a;if(r.cancel().catch(X),n.collectStreamBody){let e;if(1===o.length)e=o[0];else{e=new Uint8Array(i);let t=0;o.forEach((n=>{e.set(n,t),t+=n.length}))}t=e.slice(0,n.bytesLimit),a=e.length>n.bytesLimit}e(void 0,t,a)}!function t(){r.read().then(R((e=>{e.done?a():(n.collectStreamBody&&o.push(e.value),i+=e.value.length,i>n.bytesLimit?a():t())})),R((t=>e(t))))}()}(t,((t,e,r)=>{if(t)n(t);else{let t=(new TextDecoder).decode(e);r&&(t+="..."),n(void 0,t)}}),{bytesLimit:e,collectStreamBody:!0})}(r.body,e.requestErrorResponseLengthLimit,((t,e)=>{n(t?`Unable to retrieve response: ${t}`:e)})):r.text().then(R((t=>n(Fr(t,e)))),R((t=>n(`Unable to retrieve response: ${t}`)))):n()}(r.response,t,i):r.error&&function(t,e,n){n(Fr(Dt(xt(t)),e))}(r.error,t,i))}return{stop:()=>{n.unsubscribe(),r.unsubscribe()}}}function Fr(t,e){return t.length>e.requestErrorResponseLengthLimit?`${t.substring(0,e.requestErrorResponseLengthLimit)}...`:t}function Mr(t){return"xhr"===t?"XHR":"Fetch"}function Ur(t){const e=(e,n)=>{const r=Ut({stackTrace:n,originalError:e,startClocks:ae(),nonErrorPrefix:"Uncaught",source:Ce.SOURCE,handling:"unhandled"});t.notify(r)},{stop:n}=(r=e,Ne(window,"onerror",(({parameters:[t,e,n,o,i]})=>{let a;Bt(i)||(a=Pt(t,e,n,o)),r(null!=i?i:t,a)})));var r;const{stop:o}=function(t){return Ne(window,"onunhandledrejection",(({parameters:[e]})=>{t(e.reason||"Empty reason")}))}(e);return{stop:()=>{n(),o()}}}const $r=class{constructor(){this.callbacks={}}notify(t,e){const n=this.callbacks[t];n&&n.forEach((t=>t(e)))}subscribe(t,e){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(e),{unsubscribe:()=>{this.callbacks[t]=this.callbacks[t].filter((t=>e!==t))}}}};function Nr(t){return{handleLog:function(e,n,r,o,i){const a=B(n.getContext(),e.context);if(je(e.status,Re.console,n)&&function({status:t,message:e},n){E[qr[t]].call(_,e,n)}(e,a),je(e.status,Re.http,n)){const n={rawLogsEvent:{date:i||oe(),message:e.message,status:e.status,origin:Ce.LOGGER},messageContext:a,savedCommonContext:o};r&&(n.domainContext={handlingStack:r}),t.notify(0,n)}}}}const qr={[Ae.ok]:x.debug,[Ae.debug]:x.debug,[Ae.info]:x.info,[Ae.notice]:x.info,[Ae.warn]:x.warn,[Ae.error]:x.error,[Ae.critical]:x.error,[Ae.alert]:x.error,[Ae.emerg]:x.error};function Br({encoder:t,request:e,flushController:n,messageBytesLimit:r}){let o={};const i=n.flushObservable.subscribe((n=>function(n){const r=an(o).join("\n");o={};const i=(s=n.reason,an(ar).includes(s)),a=i?e.sendOnExit:e.send;var s;if(i&&t.isAsync){const e=t.finishSync();e.outputBytesCount&&a(Gr(e));const n=[e.pendingData,r].filter(Boolean).join("\n");n&&a({data:n,bytesCount:z(n)})}else r&&t.write(t.isEmpty?r:`\n${r}`),t.finish((t=>{a(Gr(t))}))}(n)));function a(e,i){const a=Q(e),s=t.estimateEncodedBytesCount(a);s>=r?O.warn(`Discarded a message whose size was bigger than the maximum allowed size ${r}KB. ${j} ${C}/#technical-limitations`):(function(t){return void 0!==t&&void 0!==o[t]}(i)&&function(e){const r=o[e];delete o[e];const i=t.estimateEncodedBytesCount(r);n.notifyAfterRemoveMessage(i)}(i),function(e,r,i){n.notifyBeforeAddMessage(r),void 0!==i?(o[i]=e,n.notifyAfterAddMessage()):t.write(t.isEmpty?e:`\n${e}`,(t=>{n.notifyAfterAddMessage(t-r)}))}(a,s,i))}return{flushController:n,add:a,upsert:a,stop:i.unsubscribe}}function Gr(t){let e;return e="string"==typeof t.output?t.output:new Blob([t.output],{type:"text/plain"}),{data:e,bytesCount:t.outputBytesCount,encoding:t.encoding}}const Hr=80*G,Vr=32,zr=3*H,Wr=te,Zr=Qt;function Jr(t,e,n,r,o){0===e.transportStatus&&0===e.queuedPayloads.size()&&e.bandwidthMonitor.canHandle(t)?Kr(t,e,n,{onSuccess:()=>Xr(0,e,n,r,o),onFailure:()=>{e.queuedPayloads.enqueue(t),Yr(e,n,r,o)}}):e.queuedPayloads.enqueue(t)}function Yr(t,e,n,r){2===t.transportStatus&&Z((()=>{Kr(t.queuedPayloads.first(),t,e,{onSuccess:()=>{t.queuedPayloads.dequeue(),t.currentBackoffTime=Zr,Xr(1,t,e,n,r)},onFailure:()=>{t.currentBackoffTime=Math.min(Wr,2*t.currentBackoffTime),Yr(t,e,n,r)}})}),t.currentBackoffTime)}function Kr(t,e,n,{onSuccess:r,onFailure:o}){e.bandwidthMonitor.add(t),n(t,(n=>{e.bandwidthMonitor.remove(t),!function(t){return"opaque"!==t.type&&(0===t.status&&!navigator.onLine||408===t.status||429===t.status||Rr(t.status))}(n)?(e.transportStatus=0,r()):(e.transportStatus=e.bandwidthMonitor.ongoingRequestCount>0?1:2,t.retry={count:t.retry?t.retry.count+1:1,lastFailureStatus:n.status},o())}))}function Xr(t,e,n,r,o){0===t&&e.queuedPayloads.isFull()&&!e.queueFullReported&&(o({message:`Reached max ${r} events size queued for upload: ${zr/H}MiB`,source:Ce.AGENT,startClocks:ae()}),e.queueFullReported=!0);const i=e.queuedPayloads;for(e.queuedPayloads=Qr();i.size()>0;)Jr(i.dequeue(),e,n,r,o)}function Qr(){const t=[];return{bytesCount:0,enqueue(e){this.isFull()||(t.push(e),this.bytesCount+=e.bytesCount)},first:()=>t[0],dequeue(){const e=t.shift();return e&&(this.bytesCount-=e.bytesCount),e},size:()=>t.length,isFull(){return this.bytesCount>=zr}}}function to(t,e,n){const r={transportStatus:0,currentBackoffTime:Zr,bandwidthMonitor:{ongoingRequestCount:0,ongoingByteCount:0,canHandle(t){return 0===this.ongoingRequestCount||this.ongoingByteCount+t.bytesCount<=Hr&&this.ongoingRequestCountfunction(t,e,n,r){const o=function(){try{return window.Request&&"keepalive"in new Request("http://a")}catch(t){return!1}}()&&n.bytesCountnull==r?void 0:r({status:t.status,type:t.type})))).catch(R((()=>no(t,n,r))))}else no(t,n,r)}(t,e,n,r);return{send:e=>{Jr(e,r,o,t.trackType,n)},sendOnExit:n=>{!function(t,e,n){const r=!!navigator.sendBeacon&&n.bytesCountnull==n?void 0:n({status:t.status,type:t.type})))).catch(R((()=>null==n?void 0:n({status:0}))))}function ro({messagesLimit:t,bytesLimit:e,durationLimit:n,pageMayExitObservable:r,sessionExpireObservable:o}){const i=r.subscribe((t=>f(t.reason))),a=o.subscribe((()=>f("session_expire"))),s=new ut((()=>()=>{i.unsubscribe(),a.unsubscribe()}));let u,c=0,l=0;function f(t){if(0===l)return;const e=l,n=c;l=0,c=0,d(),s.notify({reason:t,messagesCount:e,bytesCount:n})}function d(){J(u),u=void 0}return{flushObservable:s,get messagesCount(){return l},notifyBeforeAddMessage(t){c+t>=e&&f("bytes_limit"),l+=1,c+=t,void 0===u&&(u=Z((()=>{f("duration_limit")}),n))},notifyAfterAddMessage(n=0){c+=n,l>=t?f("messages_limit"):c>=e&&f("bytes_limit")},notifyAfterRemoveMessage(t){c-=t,l-=1,0===l&&d()}}}function oo(t,e,n,r,o,i,a=Br){const s=c(t,e),u=n&&c(t,n);function c(t,{endpoint:e,encoder:n}){return a({encoder:n,request:to(e,t.batchBytesLimit,r),flushController:ro({messagesLimit:t.batchMessagesLimit,bytesLimit:t.batchBytesLimit,durationLimit:t.flushTimeout,pageMayExitObservable:o,sessionExpireObservable:i}),messageBytesLimit:t.messageBytesLimit})}return{flushObservable:s.flushController.flushObservable,add(t,e=!0){s.add(t),u&&e&&u.add(n.transformMessage?n.transformMessage(t):t)},upsert:(t,e)=>{s.upsert(t,e),u&&u.upsert(n.transformMessage?n.transformMessage(t):t,e)},stop:()=>{s.stop(),u&&u.stop()}}}function io(){let t="",e=0;return{isAsync:!1,get isEmpty(){return!t},write(n,r){const o=z(n);e+=o,t+=n,r&&r(o)},finish(t){t(this.finishSync())},finishSync(){const n={output:t,outputBytesCount:e,rawBytesCount:e,pendingData:""};return t="",e=0,n},estimateEncodedBytesCount:t=>t.length}}function ao(t,e,n,r,o,i){const a=xe("browser-logs-sdk",e);a.setContextProvider((()=>{var t,e,n,r,a,s;return{application:{id:null===(t=i())||void 0===t?void 0:t.application_id},session:{id:null===(e=o.findTrackedSession())||void 0===e?void 0:e.id},view:{id:null===(r=null===(n=i())||void 0===n?void 0:n.view)||void 0===r?void 0:r.id},action:{id:null===(s=null===(a=i())||void 0===a?void 0:a.user_action)||void 0===s?void 0:s.id}}}));const s=[];if($e()){const t=Ue(),e=a.observable.subscribe((e=>t.send("internal_telemetry",e)));s.push((()=>e.unsubscribe()))}else{const t=oo(e,{endpoint:e.rumEndpointBuilder,encoder:io()},e.replica&&{endpoint:e.replica.rumEndpointBuilder,encoder:io()},n,r,o.expireObservable);s.push((()=>t.stop()));const i=a.observable.subscribe((n=>t.add(n,function(t){return t.site===Zt}(e))));s.push((()=>i.unsubscribe()))}return we.drain(),function(t){Se({type:ye.configuration,configuration:t})}(function(t){const e={session_sample_rate:(n=t).sessionSampleRate,telemetry_sample_rate:n.telemetrySampleRate,telemetry_configuration_sample_rate:n.telemetryConfigurationSampleRate,telemetry_usage_sample_rate:n.telemetryUsageSampleRate,use_before_send:!!n.beforeSend,use_partitioned_cross_site_session_cookie:n.usePartitionedCrossSiteSessionCookie,use_secure_session_cookie:n.useSecureSessionCookie,use_proxy:!!n.proxy,silent_multiple_init:n.silentMultipleInit,track_session_across_subdomains:n.trackSessionAcrossSubdomains,track_anonymous_user:n.trackAnonymousUser,session_persistence:n.sessionPersistence,allow_fallback_to_local_storage:!!n.allowFallbackToLocalStorage,store_contexts_across_pages:!!n.storeContextsAcrossPages,allow_untrusted_events:!!n.allowUntrustedEvents,tracking_consent:n.trackingConsent};var n;return{forward_errors_to_logs:t.forwardErrorsToLogs,forward_console_logs:t.forwardConsoleLogs,forward_reports:t.forwardReports,use_pci_intake:t.usePciIntake,...e}}(t)),{telemetry:a,stop:()=>{s.forEach((t=>t()))}}}const so="DISCARDED",uo="SKIPPED";const co=function(){const t={};return{register:(e,n)=>(t[e]||(t[e]=[]),t[e].push(n),{unregister:()=>{t[e]=t[e].filter((t=>t!==n))}}),triggerHook(e,n){const r=t[e]||[],o=[];for(const t of r){const e=t(n);if(e===so)return so;e!==uo&&o.push(e)}return B(...o)}}};const lo=function(t){const e=dt("global context"),n=dt("user",{propertiesConfig:{id:{type:"string"},name:{type:"string"},email:{type:"string"}}}),r=dt("account",{propertiesConfig:{id:{type:"string",required:!0},name:{type:"string"}}}),o=function(t){const e=new ut;return{tryToInit(e){t||(t=e)},update(n){t=n,e.notify()},isGranted:()=>t===pt.GRANTED,observable:e}}();function i(){return function(t,e,n){return{view:{referrer:document.referrer,url:window.location.href},context:t.getContext(),user:e.getContext(),account:n.getContext()}}(e,n,r)}let a=or(i,o,((s,u)=>{s.storeContextsAcrossPages&&(wt(u,e,ir,2),wt(u,n,ir,1),wt(u,r,ir,4));const c=t(s,u,i,o);return a=function(t,e){return{init:t=>{Le("DD_LOGS",t)},initConfiguration:t,...e}}(s,c),c}));const s={};return function(t){const e={version:"6.8.0",onReady(t){t()},...t};return Object.defineProperty(e,"_setDebug",{get:()=>I,enumerable:!1}),e}({logger:new Fe(((...t)=>a.handleLog(...t))),init:R((t=>a.init(t))),setTrackingConsent:R((t=>{var e;o.update(t),e={feature:"set-tracking-consent",tracking_consent:t},Se({type:ye.usage,usage:e})})),getGlobalContext:R((()=>e.getContext())),setGlobalContext:R((t=>e.setContext(t))),setGlobalContextProperty:R(((t,n)=>e.setContextProperty(t,n))),removeGlobalContextProperty:R((t=>e.removeContextProperty(t))),clearGlobalContext:R((()=>e.clearContext())),createLogger:R(((t,e={})=>(s[t]=new Fe(((...t)=>a.handleLog(...t)),ot(t),e.handler,e.level,ot(e.context)),s[t]))),getLogger:R((t=>s[t])),getInitConfiguration:R((()=>q(a.initConfiguration))),getInternalContext:R((t=>a.getInternalContext(t))),setUser:R(n.setContext),getUser:R(n.getContext),setUserProperty:R(n.setContextProperty),removeUserProperty:R(n.removeContextProperty),clearUser:R(n.clearContext),setAccount:R(r.setContext),getAccount:R(r.getContext),setAccountProperty:R(r.setContextProperty),removeAccountProperty:R(r.removeContextProperty),clearAccount:R(r.clearContext)})}((function(t,e,n,r){const o=new $r,i=co(),a=[];o.subscribe(1,(t=>fe("logs",t)));const s=function(t){return e=>{t.notify(0,{rawLogsEvent:{message:e.message,date:e.startClocks.timeStamp,origin:Ce.AGENT,status:Ae.error}}),_e("Error reported to customer",{"error.message":e.message})}}(o),u=function(t){return new ut((e=>{const{stop:n}=mt(t,window,["visibilitychange","freeze"],(t=>{"visibilitychange"===t.type&&"hidden"===document.visibilityState?e.notify({reason:ar.HIDDEN}):"freeze"===t.type&&e.notify({reason:ar.FROZEN})}),{capture:!0}),r=ht(t,window,"beforeunload",(()=>{e.notify({reason:ar.UNLOADING})})).stop;return()=>{n(),r()}}))}(e),c=!e.sessionStoreStrategyType||$e()||lr()?function(t){const e="1"===Er(t)?{}:void 0;return{findTrackedSession:()=>e,expireObservable:new ut}}(e):_r(e,r),{stop:l,getRUMInternalContext:f}=function(t){const e=window;let n=!1;function r(t){const r=lr(),o=function(t,e){if(e&&e.getInternalContext)return e.getInternalContext(t)}(t,r?e.DD_RUM_SYNTHETICS:e.DD_RUM);if(o)return o;r&&!n&&(n=!0,_e("Logs sent before RUM is injected by the synthetics worker",{testId:fr(),resultId:dr()}))}return t.register(0,(({startTime:t})=>r(t)||uo)),{getRUMInternalContext:r,stop:()=>{n=!1}}}(i),{stop:d}=ao(t,e,s,u,c,f);a.push((()=>d())),Dr(e,o),function(t,e){if(!t.forwardErrorsToLogs)return{stop:X};const n=new ut,{stop:r}=Ur(n),o=n.subscribe((t=>{e.notify(0,{rawLogsEvent:{message:t.message,date:t.startClocks.timeStamp,error:Pe(t),origin:Ce.SOURCE,status:Ae.error},messageContext:t.context})}))}(e,o),function(t,e){const n=Lr(t.forwardConsoleLogs).subscribe((t=>{var n;const r={rawLogsEvent:{date:oe(),message:t.message,origin:Ce.CONSOLE,error:t.error&&Pe(t.error),status:Cr[t.api]},messageContext:null===(n=t.error)||void 0===n?void 0:n.context,domainContext:{handlingStack:t.handlingStack}};e.notify(0,r)}))}(e,o),function(t,e){const n=Qn(t,t.forwardReports).subscribe((t=>{let n,r=t.message;const o="deprecation"===t.originalError.type?Ae.warn:Ae.error;var i,a;o===Ae.error?n=Pe(t):t.stack&&(r+=` Found in ${i=t.stack,null===(a=/@ (.+)/.exec(i))||void 0===a?void 0:a[1]}`),e.notify(0,{rawLogsEvent:{date:oe(),message:r,origin:Ce.REPORT,error:n,status:o}})}))}(e,o);const{handleLog:p}=Nr(o);if(kr(c,e,o,i,n,s),$e())!function(t){const e=Ue();t.subscribe(1,(t=>{e.send("log",t)}))}(o);else{const{stop:t}=function(t,e,n,r,o){const i=oo(t,{endpoint:t.logsEndpointBuilder,encoder:io()},t.replica&&{endpoint:t.replica.logsEndpointBuilder,encoder:io()},n,r,o.expireObservable);return e.subscribe(1,(t=>{i.add(t)})),i}(e,o,s,u,c);a.push((()=>t()))}var h;return{handleLog:p,getInternalContext:(h=c,{get:t=>{const e=h.findTrackedSession(t);if(e)return{session_id:e.id}}}).get,stop:()=>{a.forEach((t=>t())),l()}}}));function fo(t){return fo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fo(t)}function po(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function ho(t,e){for(var n=0;nA(t,"onReady callback threw an error:")()))}(U(),"DD_LOGS",lo),lo.init({clientToken:"pub6599f41db237f2423363ea4fec422c65",site:"datadoghq.com",service:"default-webform-script",version:"1.0.0",env:"production",sessionSampleRate:100,forwardErrorsToLogs:!1});var yo=lo.logger,go=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,n,r;return e=t,r=[{key:"isVerbose",value:function(){return!0===window.__default__logging__verbose}},{key:"shouldSample",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.2;return Math.random()2?a-2:0),u=2;u1?e-1:0),r=1;r1?e-1:0),r=1;r1?e-1:0),r=1;r1?e-1:0),r=1;r=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(u&&c){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),j(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;j(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:T(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}function Po(t,e,n,r,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void n(t)}s.done?e(u):Promise.resolve(u).then(r,o)}function Io(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function a(t){Po(i,r,o,a,s,"next",t)}function s(t){Po(i,r,o,a,s,"throw",t)}a(void 0)}))}}var Ro="https://nucleus.default.com",Do="https://forms.default.com/api/import";function Fo(t,e,n){return Mo.apply(this,arguments)}function Mo(){return(Mo=Io(To().mark((function t(e,n,r){var o,i;return To().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,fetch("".concat(r||Ro).concat(e),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});case 2:return o=t.sent,t.next=5,o.json();case 5:if(i=t.sent,o.ok){t.next=8;break}throw new Error("Status: ".concat(o.status," ").concat(i.message||"Request failed"));case 8:return t.abrupt("return",i);case 9:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Uo(t){return $o.apply(this,arguments)}function $o(){return($o=Io(To().mark((function t(e){var n,r;return To().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,fetch(e,{method:"GET",headers:{"Content-Type":"application/json"}});case 3:return n=t.sent,t.next=6,n.json();case 6:if(r=t.sent,n.ok){t.next=9;break}throw new Error(r.message||r.error||"Request failed with status ".concat(n.status," ").concat(e));case 9:return t.abrupt("return",r);case 12:if(t.prev=12,t.t0=t.catch(0),!(t.t0 instanceof Error)){t.next=16;break}throw t.t0;case 16:throw new Error("Failed to fetch data from "+e);case 17:case"end":return t.stop()}}),t,null,[[0,12]])})))).apply(this,arguments)}function No(t){return qo.apply(this,arguments)}function qo(){return(qo=Io(To().mark((function t(e){return To().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",Fo(Oo.SUBMIT_V3,e));case 1:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Bo(t,e){return Go.apply(this,arguments)}function Go(){return(Go=Io(To().mark((function t(e,n){return To().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",Fo(Oo.SUBMIT_IN_RECOVERY_MODE,jo(jo({},n),{},{submission_version:e}),Do));case 1:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Ho(t){return Vo.apply(this,arguments)}function Vo(){return(Vo=Io(To().mark((function t(e){var n;return To().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,Fo(Oo.ENRICH_EMAIL,e);case 3:return(n=t.sent)||go.warn("No response from email enrichment",{email:e.email,teamId:e.teamId}),t.abrupt("return",n);case 8:return t.prev=8,t.t0=t.catch(0),go.error("Error enriching email",{error:t.t0 instanceof Error?t.t0.message:"Unknown error",email:e.email,teamId:e.teamId,stack:t.t0 instanceof Error?t.t0.stack:void 0}),t.abrupt("return",null);case 12:case"end":return t.stop()}}),t,null,[[0,8]])})))).apply(this,arguments)}function zo(t){return Wo.apply(this,arguments)}function Wo(){return(Wo=Io(To().mark((function t(e){var n,r;return To().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,e){t.next=3;break}throw new Error("Form ID is required");case 3:return n="".concat(Do).concat(Oo.LOAD_DEFAULT_FORM),r=new URLSearchParams({form_id:e.toString()}),t.next=7,Uo("".concat(n,"?").concat(r.toString()));case 7:return t.abrupt("return",t.sent);case 10:if(t.prev=10,t.t0=t.catch(0),!(t.t0 instanceof Error)){t.next=14;break}throw new Error("Failed to load default form: ".concat(t.t0.message));case 14:throw new Error("Failed to load default form");case 15:case"end":return t.stop()}}),t,null,[[0,10]])})))).apply(this,arguments)}function Zo(t,e,n){return Jo.apply(this,arguments)}function Jo(){return(Jo=Io(To().mark((function t(e,n,r){return To().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",Fo(Oo.WEBFORM_ERROR,{form_id:e,payload:n,errorMessage:r}));case 1:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Yo(t){return Yo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Yo(t)}function Ko(){Ko=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var i=e&&e.prototype instanceof y?e:y,a=Object.create(i.prototype),s=new A(r||[]);return o(a,"_invoke",{value:O(t,n,s)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var d="suspendedStart",p="suspendedYield",h="executing",m="completed",v={};function y(){}function g(){}function b(){}var w={};c(w,a,(function(){return this}));var S=Object.getPrototypeOf,x=S&&S(S(T([])));x&&x!==n&&r.call(x,a)&&(w=x);var _=b.prototype=y.prototype=Object.create(w);function E(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function n(o,i,a,s){var u=f(t[o],t,i);if("throw"!==u.type){var c=u.arg,l=c.value;return l&&"object"==Yo(l)&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(l).then((function(t){c.value=t,a(c)}),(function(t){return n("throw",t,a,s)}))}s(u.arg)}var i;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function O(e,n,r){var o=d;return function(i,a){if(o===h)throw new Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var u=L(s,r);if(u){if(u===v)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===d)throw o=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=h;var c=f(e,n,r);if("normal"===c.type){if(o=r.done?m:p,c.arg===v)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(o=m,r.method="throw",r.arg=c.arg)}}}function L(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,L(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=f(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function C(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function j(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function A(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function T(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(u&&c){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),j(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;j(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:T(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}function Xo(t,e,n,r,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void n(t)}s.done?e(u):Promise.resolve(u).then(r,o)}function Qo(){var t,e,n,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,o=arguments.length>1?arguments[1]:void 0;if(!r)return(null==o?void 0:o.toString())||null;var i=(null==r||null===(t=r.dataset)||void 0===t?void 0:t.defaultFormId)||(null==r||null===(e=r.parentElement)||void 0===e||null===(e=e.dataset)||void 0===e?void 0:e.defaultFormId)||(null==r||null===(n=r.parentElement)||void 0===n||null===(n=n.parentElement)||void 0===n||null===(n=n.dataset)||void 0===n?void 0:n.defaultFormId)||o;return(null==i?void 0:i.toString())||null}function ti(t,e,n){try{t.querySelectorAll('input[type="email"]').forEach((function(r){try{r.addEventListener("blur",(function(){var o,i=r.value;i&&function(t){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t)}(i)&&(o=Ko().mark((function o(){var a;return Ko().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return o.prev=0,o.next=3,Ho({email:i,teamId:e.toString(),isRequireWorkEmail:!1,isFormShortening:!1});case 3:return a=o.sent,o.next=6,zo(n);case 6:a||go.warn("Email enrichment failed",{email:i,formId:t.id,teamId:e}),o.next=12;break;case 9:o.prev=9,o.t0=o.catch(0),go.error("Error enriching email",{error:o.t0 instanceof Error?o.t0.message:"Unknown error",email:r.value,formId:t.id,teamId:e,stack:o.t0 instanceof Error?o.t0.stack:void 0});case 12:case"end":return o.stop()}}),o,null,[[0,9]])})),function(){var t=this,e=arguments;return new Promise((function(n,r){var i=o.apply(t,e);function a(t){Xo(i,n,r,a,s,"next",t)}function s(t){Xo(i,n,r,a,s,"throw",t)}a(void 0)}))})()}))}catch(n){go.error("Error attaching email enrichment listener",{error:n instanceof Error?n.message:"Unknown error",formId:t.id,teamId:e,stack:n instanceof Error?n.stack:void 0})}}))}catch(n){go.error("Error setting up email enrichment",{error:n instanceof Error?n.message:"Unknown error",formId:t.id,teamId:e,stack:n instanceof Error?n.stack:void 0})}}function ei(t,e,n){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];try{if(document.querySelector("#__DEFAULT_IFRAME__"))return;var o=xo(t);if(!o)throw new Error("Invalid Scheduler URL");var i=document.querySelector("body"),a=document.createElement("iframe");if(!i)throw new Error("No body element found");a.src=o.toString(),a.height="100%",a.width="100%",a.id="__DEFAULT_IFRAME__",a.style.border="none",a.style.position="fixed",a.style.top="0px",a.style.left="0px",a.style.zIndex="999999",i.appendChild(a),window.addEventListener("message",(function(t){if("string"==typeof(null==t?void 0:t.data)){var e,o=null==t||null===(e=t.data)||void 0===e?void 0:e.split(":re:"),i=o[0],s=o[1],u=s&&"null"!==s?s:void 0;"__default_scheduler_close__"===i&&(null==a||a.remove(),b(),null==n||n({redirectUrl:u}),u&&r&&Eo(u))}})),window.addEventListener("message",(function(t){"string"==typeof(null==t?void 0:t.data)&&"default.scheduler_loaded"===t.data&&(null==e||e(t))}))}catch(t){throw b(),go.error("scheduler handler failed",t),t}}function ni(t,e){try{var n,r,o,i,a,s;if(null!=t&&null!==(n=t.body)&&void 0!==n&&null!==(n=n.stepDetails)&&void 0!==n&&n.url&&null!=t&&null!==(r=t.body)&&void 0!==r&&null!==(r=r.stepDetails)&&void 0!==r&&r.inline){window.addEventListener("message",(function t(n){var r,o;"default.meeting_booked"===(null==n||null===(r=n.data)||void 0===r?void 0:r.event)&&(null==e||null===(o=e.onMeetingBooked)||void 0===o||o.call(e,{payload:n.data.payload}),window.removeEventListener("message",t))})),ei(t.body.stepDetails.url,(function(t){var n;null==e||null===(n=e.onSchedulerDisplayed)||void 0===n||n.call(e,t)}),(function(t){var n,r,o=t.redirectUrl;o&&(null==e||null===(r=e.onRedirect)||void 0===r||r.call(e,{redirectUrl:o}));null==e||null===(n=e.onSchedulerClosed)||void 0===n||n.call(e,{redirectUrl:o})}))}if(null!=t&&null!==(o=t.body)&&void 0!==o&&null!==(o=o.stepDetails)&&void 0!==o&&o.url&&(null==t||null===(i=t.body)||void 0===i||null===(i=i.stepDetails)||void 0===i||!i.inline))null==e||null===(s=e.onRedirect)||void 0===s||s.call(e,{redirectUrl:t.body.stepDetails.url}),Eo(t.body.stepDetails.url),b();null!=t&&null!==(a=t.body)&&void 0!==a&&null!==(a=a.stepDetails)&&void 0!==a&&a.url||b()}catch(t){throw b(),go.error("Default submit handler failed",t),t}}function ri(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,s=[],u=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(s.push(r.value),s.length!==e);u=!0);}catch(t){c=!0,o=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(t,e)||ai(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function oi(t){return function(t){if(Array.isArray(t))return si(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||ai(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ii(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=ai(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function ai(t,e){if(t){if("string"==typeof t)return si(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?si(t,e):void 0}}function si(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n1?"select":"input":ui.test(t.toString())?"email":"input":"input"}function fi(t,e){var n,r,o=ci(null===(n=e.labels)||void 0===n||null===(n=n[0])||void 0===n?void 0:n.textContent);if(o)return o;var i=e.getAttribute("aria-labelledby");if(i){var a=i.split(/\s+/).filter(Boolean).map((function(e){return t.querySelector('[id="'.concat(e,'"]'))})).map((function(t){return ci(null==t?void 0:t.textContent)})).filter(Boolean).join(" ");if(a)return a}var s=ci(e.getAttribute("aria-label"));if(s)return s;if(e.id){var u,c=ci(null===(u=t.querySelector('label[for="'.concat(e.id,'"]')))||void 0===u?void 0:u.textContent);if(c)return c}if(e.name){var l,f=ci(null===(l=t.querySelector('label[for="'.concat(e.name,'"]')))||void 0===l?void 0:l.textContent);if(f)return f}if(e.id){var d,p=ci(null===(d=t.querySelector('label[id="'.concat(e.id,'"]')))||void 0===d?void 0:d.textContent);if(p)return p}if(e.name){var h,m=ci(null===(h=t.querySelector('label[id="'.concat(e.name,'"]')))||void 0===h?void 0:h.textContent);if(m)return m}var v=e.closest("label"),y=ci(null==v?void 0:v.textContent);if(y)return y;var g=e.closest("fieldset"),b=ci(null==g||null===(r=g.querySelector("legend"))||void 0===r?void 0:r.textContent);if(b)return b;var w=ci(e.getAttribute("title"));return w||(ci(e.placeholder)||e.name)}function di(t,e,n){var r,o=ci(null===(r=t.querySelector('label[for="'.concat(e,'"]')))||void 0===r?void 0:r.textContent);if(o)return o;var i=n||t.querySelector('input[type="radio"][name="'.concat(e,'"]'));if(i){var a,s=i.closest("fieldset"),u=ci(null==s||null===(a=s.querySelector("legend"))||void 0===a?void 0:a.textContent);if(u)return u;var c=i.closest('[role="radiogroup"]');if(c){var l=c.getAttribute("aria-labelledby");if(l){var f=l.split(/\s+/).filter(Boolean).map((function(e){return t.querySelector('[id="'.concat(e,'"]'))})).map((function(t){return ci(null==t?void 0:t.textContent)})).filter(Boolean).join(" ");if(f)return f}var d=ci(c.getAttribute("aria-label"));if(d)return d}}return e}function pi(t){try{var e,n=t.elements,r=new Map,o=new Map,i=new Map,a=new Map,s=new Map,u=ii(n);try{for(u.s();!(e=u.n()).done;){var c=e.value;if("checkbox"===(null==c?void 0:c.type)&&null!=c&&c.name){var l=a.get(c.name)||0;a.set(c.name,l+1)}if("radio"===(null==c?void 0:c.type)&&null!=c&&c.name){var f=s.get(c.name)||0;s.set(c.name,f+1)}}}catch(t){u.e(t)}finally{u.f()}var d,p=ii(n);try{var h=function(){var t=d.value,e=t;if("password"===(null==e?void 0:e.type))return 1;if(null!=e&&e.name&&""!==(null==e?void 0:e.name)){r.has(e.name)||(r.set(e.name,new Set),o.set(e.name,new Map));var n=r.get(e.name),i=o.get(e.name);switch(e.type){case"select-one":case"select-multiple":var u=t;Array.from(u.options).forEach((function(t){null==n||n.add(t.value),t.textContent&&(null==i||i.set(t.value,t.textContent))}));break;case"checkbox":var c,l,f,p=e.value;if(!p||"on"===p)p=(null===(f=e.labels)||void 0===f||null===(f=f[0])||void 0===f||null===(f=f.textContent)||void 0===f?void 0:f.trim())||e.name;var h=p.toString(),m=(null===(c=e.labels)||void 0===c||null===(c=c[0])||void 0===c||null===(c=c.textContent)||void 0===c?void 0:c.trim())||h.trim();(null!==(l=a.get(e.name))&&void 0!==l?l:0)>1&&(null==n||n.add(h),null==i||i.set(h,m));break;case"radio":var v,y,g,b=e.value;if(!b||"on"===b)b=(null===(g=e.labels)||void 0===g||null===(g=g[0])||void 0===g||null===(g=g.textContent)||void 0===g?void 0:g.trim())||e.name;var w=b.toString(),S=(null===(v=e.labels)||void 0===v||null===(v=v[0])||void 0===v||null===(v=v.textContent)||void 0===v?void 0:v.trim())||w.trim();(null!==(y=s.get(e.name))&&void 0!==y?y:0)>1&&(null==n||n.add(w),null==i||i.set(w,S))}}};for(p.s();!(d=p.n()).done;)h()}catch(t){p.e(t)}finally{p.f()}var m,v=ii(n);try{for(v.s();!(m=v.n()).done;){var y=m.value,g=y;if("password"!==(null==g?void 0:g.type)&&(null!=g&&g.name&&""!==(null==g?void 0:g.name))){var b="radio"===g.type?di(t,g.name,g):fi(t,g);if(!i.has(g.name)){var w={name:g.name,type:g.type,options:Array.from(r.get(g.name)||[]),placeholder:g.placeholder,label:b,option_labels:Object.fromEntries(o.get(g.name)||[]),value:void 0};i.set(g.name,w)}var S=i.get(g.name),x=void 0;switch(g.type){case"select-one":case"select-multiple":var _=y;x=_.multiple?Array.from(_.selectedOptions).map((function(t){return t.value})):_.value;break;case"checkbox":case"radio":g.checked&&(x=g.value);break;default:x=g.value}if(void 0!==x){var E=x.toString();void 0===S.value?S.value=E:Array.isArray(S.value)?S.value=[].concat(oi(S.value),oi(Array.isArray(x)?x.map((function(t){return t.toString()})):[E])):Array.isArray(x)?S.value=[S.value.toString()].concat(oi(x.map((function(t){return t.toString()})))):S.value=[S.value.toString(),E]}}}}catch(t){v.e(t)}finally{v.f()}return Array.from(i.values()).map((function(t){if(Array.isArray(t.value)&&t.value.length>0){var e=oi(new Set(t.value));1===e.length&&(t.value=e[0])}return t.options.length>0&&void 0===t.value&&(t.value=""),t}))}catch(t){return go.error("Failed to get question data with values",t),[]}}function hi(t){return hi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},hi(t)}function mi(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function vi(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function Oi(t,e){if(t){if("string"==typeof t)return Li(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Li(t,e):void 0}}function Li(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n5&&void 0!==arguments[5]&&arguments[5],a=e?pi(e):function(t){try{return Array.isArray(t)?t.map((function(t){return{id:t.name,name:t.name,type:li(t.value),options:Array.isArray(t.value)?t.value:[],value:t.value}})):Object.entries(t).map((function(t){var e=ri(t,2),n=e[0],r=e[1];return{id:n,name:n,type:li(r),options:Array.isArray(r)?r:[],value:r}}))}catch(t){return go.error("Failed to get hubspot question data with values",t),[]}}(n),s=xi(),u=s.referrer,c=s.landingReferrer,l=s.landingUrl,f=s.utmParams,d=s.submissionUrl,p=function(t,e){var n=new Set(t.map((function(t){return t.name}))),r=t.map((function(t){var n,r;return r=Array.isArray(e)?e.find((function(e){return e.name===t.name})):{name:t.name,value:e[t.name]},ji(ji({},t),{},{value:null===(n=r)||void 0===n?void 0:n.value})}));if(Array.isArray(e)){var o,i=ki(e);try{for(i.s();!(o=i.n()).done;){var a=o.value;n.has(a.name)||r.push({name:a.name,label:a.name,type:"text",options:[],value:a.value})}}catch(t){i.e(t)}finally{i.f()}}else for(var s=0,u=Object.entries(e);s4&&void 0!==arguments[4]&&arguments[4],i=t?pi(t):function(t){try{return Object.entries(t).map((function(t){var e=ri(t,2),n=e[0],r=e[1];return void 0===r?{id:n,name:n,type:"input",options:[],value:void 0}:("number"==typeof r&&(r=r.toString()),"string"==typeof r||Array.isArray(r)||(r=[r]),{id:n,name:n,type:li(r),options:Array.isArray(r)?r:[],value:r})}))}catch(t){return go.error("Failed to get marketo question data with values",t),[]}}(e),a=xi(),s=a.referrer,u=a.landingReferrer,c=a.landingUrl,l=a.utmParams,f=a.submissionUrl;return{submission:{form_id:n,team_id:r,html_form_id:t.id,questions:i,type:"marketo"},referrer:s,utm_params:l,device_track_id:Si(r),submission_url:f,landing_url:c,landing_referrer:u,init:o}}function Ii(t){return Ii="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ii(t)}function Ri(){Ri=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var i=e&&e.prototype instanceof y?e:y,a=Object.create(i.prototype),s=new A(r||[]);return o(a,"_invoke",{value:O(t,n,s)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var d="suspendedStart",p="suspendedYield",h="executing",m="completed",v={};function y(){}function g(){}function b(){}var w={};c(w,a,(function(){return this}));var S=Object.getPrototypeOf,x=S&&S(S(T([])));x&&x!==n&&r.call(x,a)&&(w=x);var _=b.prototype=y.prototype=Object.create(w);function E(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function n(o,i,a,s){var u=f(t[o],t,i);if("throw"!==u.type){var c=u.arg,l=c.value;return l&&"object"==Ii(l)&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(l).then((function(t){c.value=t,a(c)}),(function(t){return n("throw",t,a,s)}))}s(u.arg)}var i;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function O(e,n,r){var o=d;return function(i,a){if(o===h)throw new Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var u=L(s,r);if(u){if(u===v)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===d)throw o=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=h;var c=f(e,n,r);if("normal"===c.type){if(o=r.done?m:p,c.arg===v)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(o=m,r.method="throw",r.arg=c.arg)}}}function L(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,L(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=f(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function C(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function j(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function A(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function T(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(u&&c){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),j(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;j(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:T(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}function Di(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Fi(t){for(var e=1;e3&&a>5e3&&s>3e4&&(Ni(e,Fi({},i),"Persistent load error - ".concat(t.message)),o.lastReported=Date.now());break;case"form-handling":o.count>2&&Ni(e,Fi({},i),"Form Handling error - ".concat(t.message))}$i.set(r,o)}function Gi(t){return Gi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gi(t)}function Hi(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Vi(t){for(var e=1;e=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function Wi(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(u&&c){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),j(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;j(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:T(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}function Ji(t,e,n,r,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void n(t)}s.done?e(u):Promise.resolve(u).then(r,o)}function Yi(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function a(t){Ji(i,r,o,a,s,"next",t)}function s(t){Ji(i,r,o,a,s,"throw",t)}a(void 0)}))}}function Ki(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:window.location.search,e=new URLSearchParams(t);return{displayLoadingModal:e.has("displayLoadingModal"),verboseLogging:e.has("dft_verbose"),updateDefaultFields:e.has("updateDefaultFields"),defaultPostRedirectSchedulerUrl:e.get(S)}}(),p=new Set,h=new Map,m=new Map,v=new Set,y=(o=No,i=1e4,a=!1,function(){if(Date.now(),!a){a=!0,setTimeout((function(){a=!1}),i);for(var t=arguments.length,e=new Array(t),n=0;n-1&&(null===(r=this.listeners[t])||void 0===r||r.splice(o,1))}}},{key:"emit",value:function(t,e){var n;this.listeners[t]&&(null===(n=this.listeners[t])||void 0===n||n.forEach((function(n){try{n(e)}catch(e){go.error("Error in callback for ".concat(t),e)}})))}},{key:"cleanup",value:function(){this.listeners={}}}])&&Ki(e.prototype,n),r&&Ki(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}());n.__default__.onSubmissionSuccess=function(t){k.on("submission:success",t)},n.__default__.onSubmissionError=function(t){k.on("submission:error",t)},n.__default__.onSchedulerDisplayed=function(t){k.on("scheduler:displayed",t)},n.__default__.onSchedulerClosed=function(t){k.on("scheduler:closed",t)},n.__default__.onMeetingBooked=function(t){k.on("scheduler:meeting_booked",t)},n.__default__.onRedirect=function(t){k.on("redirect",t)},n.__default__.registerSubmissionCallbacks=function(t){t.onSuccess&&k.on("submission:success",t.onSuccess),t.onError&&k.on("submission:error",t.onError),t.onSchedulerDisplayed&&k.on("scheduler:displayed",t.onSchedulerDisplayed),t.onSchedulerClosed&&k.on("scheduler:closed",t.onSchedulerClosed),t.onMeetingBooked&&k.on("scheduler:meeting_booked",t.onMeetingBooked),t.onRedirect&&k.on("redirect",t.onRedirect)},n.__default__.displayLoadingModal=function(){return g()},d.displayLoadingModal&&g(),d.verboseLogging&&(n.__default__logging__verbose=!0),window.__default__.parseForm=function(t){return pi(t instanceof HTMLFormElement?t:document.querySelector(t))};var O=function(t){var e=t.id;e&&(go.debug("Adding form to map:",e),m.set(e,t)),t.dataset.formId&&(go.debug("Adding hubspot to map:",e),m.set(t.dataset.formId,t))},L=function(){var t=Yi(Zi().mark((function t(e,n){var r,o,i,a;return Zi().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=u.toString(),o=null,t.prev=2,v.has(e)?go.warn('Duplicate HubSpot form ID detected: "'.concat(e,'". The same HubSpot form ID was found multiple times on this page. This may prevent some question responses from being sent in the submission payload.')):v.add(e),r){t.next=6;break}throw new Error("Default Form ID not found for form ".concat(e," unable to process submission"));case 6:if(o=Ti(e,void 0,n,r,c,d.updateDefaultFields)){t.next=9;break}return t.abrupt("return");case 9:go.debug("Submitting Hubspot V4 Form: ".concat(null===(i=o)||void 0===i||null===(i=i.submission)||void 0===i?void 0:i.form_id),o),U(o),t.next=17;break;case 13:t.prev=13,t.t0=t.catch(2),a=o?"submission":"form-handling",Bi(t.t0 instanceof Error?t.t0:new Error("Unknown error"),r,{type:a,payload:o,url:window.location.href,timestamp:Date.now()});case 17:case"end":return t.stop()}}),t,null,[[2,13]])})));return function(e,n){return t.apply(this,arguments)}}();n.addEventListener("message",function(){var n=Yi(Zi().mark((function n(r){var o,i,a,s,c,l,f,d,p,h,m,v;return Zi().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(n.prev=0,"DEFAULT_PARDOT_FORM_SUBMISSION"!==r.data.type){n.next=5;break}return l=null!==(c=null==r?void 0:r.data)&&void 0!==c?c:{},f=l.responses,d=l.questions,p=l.htmlFormId,h=l.questionsWithValues,V(f,d,p,h),n.abrupt("return");case 5:if("DEFAULT_PARDOT_FORM_SUCCESS"!==r.data.type){n.next=8;break}return z(),n.abrupt("return");case 8:if(!("string"==typeof r.data&&null!=r&&null!==(o=r.data)&&void 0!==o&&o.includes("paperform:")&&null!=r&&null!==(i=r.data)&&void 0!==i&&i.includes("submission_id")&&null!=r&&null!==(a=r.data)&&void 0!==a&&a.includes('"action":"submission"'))){n.next=12;break}return D(JSON.parse(r.data.slice(10))),n.abrupt("return");case 12:(null==r||null===(s=r.data)||void 0===s?void 0:s.type)===t&&"onFormSubmit"!==r.data.eventName&&r.data.eventName!==e&&B(null==r||null===(m=r.source)||void 0===m?void 0:m.document),r.data.type===t&&"onFormReady"===r.data.eventName&&(go.debug("Received Hubspot On Form Ready"),x=!0),n.next=21;break;case 16:n.prev=16,n.t0=n.catch(0),v=n.t0 instanceof Error?n.t0.message:"Unknown error",Ni(u.toString(),null,"error listening to hubspot form - ".concat(v)),go.error("Error listening to form",v,u);case 21:case"end":return n.stop()}}),n,null,[[0,16]])})));return function(t){return n.apply(this,arguments)}}()),n.addEventListener("message",function(){var n=Yi(Zi().mark((function n(r){var o,i,a;return Zi().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(n.prev=0,r.data.type!==t||r.data.eventName!==e){n.next=7;break}if(null==r||null===(o=r.data)||void 0===o||!o.id||null==r||null===(i=r.data)||void 0===i||null===(i=i.data)||void 0===i||!i.submissionValues){n.next=7;break}if(!H(r.data.id)){n.next=6;break}return go.info("skipping hubspot form",r.data.id),n.abrupt("return");case 6:P(r.data.id,r.data.data.submissionValues);case 7:n.next=14;break;case 9:n.prev=9,n.t0=n.catch(0),a=n.t0 instanceof Error?n.t0.message:"Unknown error",Ni(u.toString(),null,"error submitting hubspot form - ".concat(a)),go.error("Error submitting hubspot form",a,u);case 14:case"end":return n.stop()}}),n,null,[[0,9]])})));return function(t){return n.apply(this,arguments)}}()),n.addEventListener("hs-form-event:on-ready",function(){var t=Yi(Zi().mark((function t(e){var n,r;return Zi().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,n=e.detail.formId,go.debug("Received Hubspot V4 On Form Ready",{formId:n}),!H(n)){t.next=7;break}return go.info("skipping hubspot v4 form: ".concat(n)),t.abrupt("return");case 7:x=!0,t.next=15;break;case 10:t.prev=10,t.t0=t.catch(0),r=t.t0 instanceof Error?t.t0.message:"Unknown error",Ni(u.toString(),null,"error listening to hubspot v4 form - ".concat(r)),go.error("Error listening to hubspot v4 form",{error:r,fallbackFormId:u});case 15:case"end":return t.stop()}}),t,null,[[0,10]])})));return function(e){return t.apply(this,arguments)}}()),n.addEventListener("hs-form-event:on-submission:success",function(){var t=Yi(Zi().mark((function t(e){var r,o,i,a,s,c,l;return Zi().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,i=e,a=(null===(r=n.HubSpotFormsV4)||void 0===r?void 0:r.getFormFromEvent(i))||(null===(o=window.HubSpotFormsV4)||void 0===o?void 0:o.getFormFromEvent(i))){t.next=5;break}throw new Error("Could not get form from event");case 5:if(!H(s=a.getFormId())){t.next=9;break}return go.info("skipping hubspot v4 form: ".concat(s)),t.abrupt("return");case 9:return t.next=11,a.getFormFieldValues();case 11:if((c=t.sent)&&0!==(null==c?void 0:c.length)){t.next=14;break}throw new Error("Could not get form field values");case 14:return t.next=16,L(s,c);case 16:t.next=23;break;case 18:t.prev=18,t.t0=t.catch(0),l=t.t0 instanceof Error?t.t0.message:"Unknown error",Ni(u.toString(),null,"error submitting hubspot v4 form - ".concat(l)),go.error("Error submitting hubspot v4 form",{error:l,fallbackFormId:u});case 23:case"end":return t.stop()}}),t,null,[[0,18]])})));return function(e){return t.apply(this,arguments)}}()),r.querySelectorAll("form").forEach(function(){var t=Yi(Zi().mark((function t(e){return Zi().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,T(e);case 2:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}());var C=new MutationObserver((function(t){var e,o=zi(t);try{for(o.s();!(e=o.n()).done;){var i=e.value;"childList"===i.type&&i.addedNodes.forEach(function(){var t=Yi(Zi().mark((function t(e){var n,r,o,i,a;return Zi().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e.nodeType!==Node.ELEMENT_NODE){t.next=28;break}if("FORM"!==(n=e).tagName){t.next=8;break}return O(n),t.next=6,T(n);case 6:t.next=28;break;case 8:if(!n.querySelectorAll){t.next=28;break}r=n.querySelectorAll("form"),o=zi(r),t.prev=11,o.s();case 13:if((i=o.n()).done){t.next=20;break}return a=i.value,O(a),t.next=18,T(a);case 18:t.next=13;break;case 20:t.next=25;break;case 22:t.prev=22,t.t0=t.catch(11),o.e(t.t0);case 25:return t.prev=25,o.f(),t.finish(25);case 28:case"end":return t.stop()}}),t,null,[[11,22,25,28]])})));return function(e){return t.apply(this,arguments)}}())}}catch(t){o.e(t)}finally{o.f()}!_&&null!=n&&n.MktoForms2&&(!function(){W.apply(this,arguments)}(),B(r))})),j=function(){var t=r.body||document.body;t||(t=document.documentElement),C.observe(t,{childList:!0,subtree:!0})};if(document.body||r.body?j():document.addEventListener("DOMContentLoaded",j),w){var A=function(){var t=xo(w);if(!t){var e="Invalid scheduler URL in query parameter - ".concat(w);return go.error("Invalid scheduler URL in query parameter",e,w),void ko(S)}ei(t.toString()),ko(S)};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",A):A()}n.__default__loaded=!0}function T(t){var e=u.toString();try{if(H(t))return void go.info("skipping HTML form",t.id);if(x||function(t){var e,n;return!!(t&&t instanceof HTMLFormElement)&&!!(0===(null===(e=t.id)||void 0===e||null===(n=e.indexOf)||void 0===n?void 0:n.call(e,"hsForm"))||t.classList.contains("hs-form")||t.querySelector(".hs-form-field")||t.querySelector('input[name="hs_context"]')||t.querySelector('input[name^="hs_"]'))}(t))return void go.debug("Hubspot form detected, using hubspot events");if(function(t){var e,n=t.getAttribute("id");return"string"==typeof n&&n.includes("mktoForm")||(null===(e=t.classList)||void 0===e?void 0:e.contains("mktoForm"))||!!t.querySelector(".mktoField")}(t))return void go.debug("Marketo HTML detected, using marketo events");if(p.add(t),!(e=Qo(t,u)||u.toString()))throw new Error("Default Form ID not found for form ".concat(t.id,", unable to process submission"));ti(t,c,e),go.debug("listening to form",t.id,e),function(t,e){go.debug("Attaching form listener",t.id),t.addEventListener("submit",(function(){var n=null;try{if(go.debug("Form is submitting",t.id),n=function(t,e,n){var r,o,i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=t.id||(null===(r=t.parentElement)||void 0===r?void 0:r.id)||"",s=pi(t),u=xi(),c=u.referrer,l=u.landingReferrer,f=u.landingUrl,d=u.utmParams,p=u.submissionUrl;if(!s)throw new Error("Failed to build response and questions data");var h=t.dataset.formId,m=(null==t?void 0:t.dataset.defaultFormId)||(null==t||null===(o=t.parentElement)||void 0===o||null===(o=o.dataset)||void 0===o?void 0:o.defaultFormId),v=!!m;return{submission:{form_id:m||e,team_id:n,html_form_id:h||a,questions:s},referrer:c,utm_params:d,device_track_id:Si(n),submission_url:p,landing_url:f,landing_referrer:l,init:i,isFromDataset:v,formName:t.getAttribute("name")||""}}(t,e,c,d.updateDefaultFields),!n)throw new Error("Could not generate payload for form ".concat(t.id));go.info("Handling html form submission",n),U(n)}catch(t){var r=n?"submission":"form-handling";Bi(t instanceof Error?t:new Error("Unknown error"),u.toString(),{type:r,payload:n,url:window.location.href,timestamp:Date.now()})}}))}(t,e)}catch(n){b(),p.delete(t),Bi(n instanceof Error?n:new Error("Unknown error"),e,{type:"form-handling",url:window.location.href,timestamp:Date.now()})}}function P(t,e){var n=u.toString(),r=null;try{if(v.has(t)?go.warn('Duplicate HubSpot form ID detected: "'.concat(t,'". The same HubSpot form ID was found multiple times on this page. This may prevent some question responses from being sent in the submission payload.')):v.add(t),!n)throw new Error("Default Form ID not found for form ".concat(t," unable to process submission"));var o=function(t){var e="hsForm_".concat(t);return G(t)||G(e)}(t.toString()),i=d.updateDefaultFields;if(o||(go.debug("Hubspot form not found",t),n=Qo(o,u)||u.toString()),!(r=Ti(t,o,e,n,c,i)))throw new Error("Failed to build hubspot submission data");U(r)}catch(t){var a=r?"submission":"form-handling";Bi(t instanceof Error?t:new Error("Unknown error"),n,{type:a,payload:r,url:window.location.href,timestamp:Date.now()})}}function I(t,e){var n=null;try{if(!(n=Pi(t,e,u,c,d.updateDefaultFields)))throw new Error("Failed to build submission data");U(n)}catch(t){var r=n?"submission":"form-handling";Bi(t instanceof Error?t:new Error("Unknown error"),u.toString(),{type:r,payload:n,url:window.location.href,timestamp:Date.now()})}}function R(t,e){var n=null;try{if(n=function(t,e,n,r){var o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],i=xi(),a=i.referrer,s=i.landingReferrer,u=i.landingUrl,c=i.utmParams,l=i.submissionUrl;return{submission:{form_id:n,team_id:r,html_form_id:e,questions:t,type:"pardot"},referrer:a,utm_params:c,device_track_id:Si(r),submission_url:l,landing_url:u,landing_referrer:s,init:o}}(t,e,u,c,d.updateDefaultFields),!n)throw new Error("Failed to build submission data");go.info("Handling pardot submission",n),U(n)}catch(t){var r=n?"submission":"form-handling";Bi(t instanceof Error?t:new Error("Unknown error"),u.toString(),{type:r,payload:n,url:window.location.href,timestamp:Date.now()})}}function D(t){var e=null;try{if(e=function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=xi(),i=o.referrer,a=o.landingReferrer,s=o.landingUrl,u=o.utmParams,c=o.submissionUrl,l=Si(n),f=t.details.data,d=[];return f.forEach((function(t){d.push({name:t.key,type:t.type,options:[],label:t.label,value:t.value}),"address"===t.type&&t.attributes&&t.attributes.forEach((function(t){d.push({name:t.key,type:t.type,options:[],label:t.label,value:t.value})}))})),{submission:{form_id:e,team_id:n,questions:d,type:"paperform"},referrer:i,utm_params:u,device_track_id:l,submission_url:c,landing_url:s,landing_referrer:a,init:r}}(t,u,c,d.updateDefaultFields),!e)throw new Error("Failed to build submission data");go.info("Handling paperform submission",e),U(e)}catch(t){var n=e?"submission":"form-handling";Bi(t instanceof Error?t:new Error("Unknown error"),u.toString(),{type:n,payload:e,url:window.location.href,timestamp:Date.now()})}}function F(t,e){var n,r,o,i,a=t.submission.html_form_id,s=null==e||null===(n=e.body)||void 0===n||null===(n=n.data)||void 0===n?void 0:n.id,u=null==e||null===(r=e.body)||void 0===r||null===(r=r.data)||void 0===r?void 0:r.ids;if(null!=t&&t.init)return!1;if(null!=t&&t.isFromDataset)return!1;if(!e||!u)return!1;if(null==e||!e.body||null==e||null===(o=e.body)||void 0===o||!o.init||null==e||null===(i=e.body)||void 0===i||!i.data)return!1;if(!a)return!1;if(s===a||s===(null==t?void 0:t.formName))return!1;if(s&&a){if(s.includes(a))return!1;if(a.includes(s))return!1}if(null!=u&&u.length){var c,l=zi(u);try{for(l.s();!(c=l.n()).done;){var f=c.value;if(f===a||f===(null==t?void 0:t.formName)||f.includes(a)||a.includes(f))return!1}}catch(t){l.e(t)}finally{l.f()}}return go.info("Skipping Form ".concat(t.submission.form_id," ").concat(t.submission.html_form_id,", form doesn't match id in ").concat(s||u),t,e),!0}function M(t){if(t.init)return Promise.resolve({shouldSkip:!1,isActive:!0});var e,n=new Promise((function(n){e=setTimeout((function(){go.warn("Form validation timed out, proceeding with submission",{htmlFormId:t.submission.html_form_id}),n({shouldSkip:!1,isActive:!0})}),7e3)})),r=q(t.submission.form_id).then((function(n){clearTimeout(e);try{return go.info("Form validation data loaded",n),{shouldSkip:F(t,n),isActive:(null==n?void 0:n.body.active)||!1,hideBranding:(null==n?void 0:n.body.hideBranding)||!1}}catch(e){return go.warn("Error in form validation logic, proceeding with submission",{error:e instanceof Error?e.message:"Unknown error",htmlFormId:t.submission.html_form_id}),{shouldSkip:!1,isActive:!0}}})).catch((function(e){return go.warn("Failed to load form data for validation, proceeding with submission",{error:e instanceof Error?e.message:"Unknown error",htmlFormId:t.submission.html_form_id}),{shouldSkip:!1,isActive:!0}}));return Promise.race([r,n])}function U(t){Yi(Zi().mark((function e(){var n,r,o,i,a,s,c,l,f,d,p,h;return Zi().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,M(t);case 3:if(n=e.sent,r=n.shouldSkip,o=n.isActive,i=n.hideBranding,!r){e.next=9;break}return e.abrupt("return");case 9:return o&&(go.info("Form is active, displaying loading modal"),g(i)),delete(a=Vi({},t)).isFromDataset,delete a.formName,e.next=15,y(a);case 15:s=e.sent,go.info("Submitted Form ".concat(t.submission.html_form_id),{submissionDTO:t,response:s}),s&&(l=null==s||null===(c=s.body)||void 0===c?void 0:c.stepDetails,f=!(null==l||!l.url),d=!(null==l||!l.inline),p={schedulerUrl:f&&d?l.url:null,redirectUrl:f&&!d?l.url:null,isSchedulerDisplayed:f&&d,isRedirected:f&&!d},k.emit("submission:success",p),ni(s,{onSchedulerDisplayed:function(t){k.emit("scheduler:displayed",t)},onSchedulerClosed:function(t){k.emit("scheduler:closed",t)},onMeetingBooked:function(t){k.emit("scheduler:meeting_booked",t)},onRedirect:function(t){k.emit("redirect",t)}})),e.next=27;break;case 20:if(e.prev=20,e.t0=e.catch(0),h=e.t0 instanceof Error?e.t0:new Error("Unknown error"),k.emit("submission:error",h),e.t0 instanceof Error&&e.t0.message.includes("Status: 5"))try{Bo(3,t)}catch(t){go.error("Recovery submission failed",t)}Bi(e.t0 instanceof Error?e.t0:new Error("Unknown error"),u.toString(),{type:"submission",payload:t,url:window.location.href,timestamp:Date.now()}),b();case 27:case"end":return e.stop()}}),e,null,[[0,20]])})))()}function $(t,e,n){return N.apply(this,arguments)}function N(){return(N=Yi(Zi().mark((function t(e,n,r){var o,i,a,s,u;return Zi().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,null!=n&&null!==(o=n.body)&&void 0!==o&&o.data){t.next=3;break}return t.abrupt("return",!1);case 3:if(!((null==e?void 0:e.dataset.defaultFormId)||(null==e||null===(i=e.parentElement)||void 0===i||null===(i=i.dataset)||void 0===i?void 0:i.defaultFormId))){t.next=6;break}return t.abrupt("return",!0);case 6:if(s=n.body.data.ids||[n.body.data.id],u=e.id||(null===(a=e.parentElement)||void 0===a?void 0:a.id),s.includes(u)){t.next=12;break}return go.debug("Form ID does not match",e.id),t.abrupt("return",!1);case 12:if(!r||n.body.data.type===r){t.next=15;break}return go.debug("Form type not specified as ".concat(r),e.id),t.abrupt("return",!1);case 15:return go.debug("".concat(r||"Matching"," form found"),e.id),t.abrupt("return",!0);case 19:return t.prev=19,t.t0=t.catch(0),go.error("Error checking form match",{formId:e.id,error:t.t0 instanceof Error?t.t0.message:"Unknown error",stack:t.t0 instanceof Error?t.t0.stack:void 0}),t.abrupt("return",!1);case 23:case"end":return t.stop()}}),t,null,[[0,19]])})))).apply(this,arguments)}function q(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u,e=t.toString();if(!h.has(e)){go.debug("Fetching default form",t);var n=zo(t.toString()).then((function(t){if(!t)throw new Error("No form data received");return t})).catch((function(t){h.delete(e);var n=t instanceof Error?t:new Error("Unknown error occurred while loading form");throw go.error("Failed to load default form",{formId:e,error:n.message,stack:n.stack}),Bi(n,e,{type:"load",url:window.location.href,timestamp:Date.now()}),n}));h.set(e,n)}return go.debug("Returning form data"),h.get(e)}function B(t){var e,n=zi(t.querySelectorAll("iframe"));try{for(n.s();!(e=n.n()).done;){var r=e.value.contentDocument;if(r)r.querySelectorAll("form").forEach((function(t){O(t)}))}}catch(t){n.e(t)}finally{n.f()}}function G(t){return m.get(t)}function H(t){var e,n="string"==typeof t?t:t.id;if("string"!=typeof t&&(t.dataset.defaultFormId||null!==(e=t.parentElement)&&void 0!==e&&e.dataset.defaultFormId))return!1;return null!=f&&f.length?f.includes(n):!(null==l||!l.length)&&!l.includes(n)}function V(t,e,n,r){E={responses:t,questions:e,htmlFormId:n,questionsWithValues:r}}function z(){if(E){var t=E,e=t.questionsWithValues,n=t.htmlFormId;if(H(n))return void go.info("skipping pardot form",{htmlFormId:n,questionsWithValues:e});e&&R(e,n)}}function W(){return W=Yi(Zi().mark((function t(){return Zi().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:null!=n&&n.MktoForms2&&(_=!0,n.MktoForms2.whenReady(function(){var t=Yi(Zi().mark((function t(e){var n,r,o;return Zi().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,!H(n=e.getFormElem()[0])){t.next=5;break}return go.info("skipping marketo form",{htmlFormId:null==n?void 0:n.id}),t.abrupt("return");case 5:return O(n),t.next=8,q();case 8:if(r=t.sent,t.t0=null==l?void 0:l.includes(n.id),t.t0){t.next=14;break}return t.next=13,$(n,r,"marketo");case 13:t.t0=t.sent;case 14:o=t.t0,e.onSuccess((function(t){return I(n,t),!o})),t.next=21;break;case 18:t.prev=18,t.t1=t.catch(0),go.error("Error setting up Marketo form",{error:t.t1 instanceof Error?t.t1.message:"Unknown error",stack:t.t1 instanceof Error?t.t1.stack:void 0});case 21:case"end":return t.stop()}}),t,null,[[0,18]])})));return function(e){return t.apply(this,arguments)}}()));case 1:case"end":return t.stop()}}),t)}))),W.apply(this,arguments)}}(window,document)})();