!function(){var e={835:function(e){e.exports={version:"v33"}},230:function(e){e.exports="object"==typeof self?self.FormData:window.FormData}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}!function(){"use strict";function e(e,t){return function(){return e.apply(t,arguments)}}const{toString:t}=Object.prototype,{getPrototypeOf:r}=Object,i=(o=Object.create(null),e=>{const n=t.call(e);return o[n]||(o[n]=n.slice(8,-1).toLowerCase())});var o;const s=e=>(e=e.toLowerCase(),t=>i(t)===e),a=e=>t=>typeof t===e,{isArray:c}=Array,u=a("undefined"),l=s("ArrayBuffer"),h=a("string"),d=a("function"),f=a("number"),p=e=>null!==e&&"object"==typeof e,g=e=>{if("object"!==i(e))return!1;const t=r(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},m=s("Date"),v=s("File"),y=s("Blob"),_=s("FileList"),w=s("URLSearchParams");function E(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,i;if("object"!=typeof e&&(e=[e]),c(e))for(r=0,i=e.length;r0;)if(r=n[i],t===r.toLowerCase())return r;return null}const C="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,S=e=>!u(e)&&e!==C,O=(x="undefined"!=typeof Uint8Array&&r(Uint8Array),e=>x&&e instanceof x);var x;const R=s("HTMLFormElement"),A=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),T=s("RegExp"),N=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};E(n,((n,i)=>{!1!==t(n,i,e)&&(r[i]=n)})),Object.defineProperties(e,r)};var I={isArray:c,isArrayBuffer:l,isBuffer:function(e){return null!==e&&!u(e)&&null!==e.constructor&&!u(e.constructor)&&d(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{const n="[object FormData]";return e&&("function"==typeof FormData&&e instanceof FormData||t.call(e)===n||d(e.toString)&&e.toString()===n)},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&l(e.buffer),t},isString:h,isNumber:f,isBoolean:e=>!0===e||!1===e,isObject:p,isPlainObject:g,isUndefined:u,isDate:m,isFile:v,isBlob:y,isRegExp:T,isFunction:d,isStream:e=>p(e)&&d(e.pipe),isURLSearchParams:w,isTypedArray:O,isFileList:_,forEach:E,merge:function e(){const{caseless:t}=S(this)&&this||{},n={},r=(r,i)=>{const o=t&&b(n,i)||i;g(n[o])&&g(r)?n[o]=e(n[o],r):g(r)?n[o]=e({},r):c(r)?n[o]=r.slice():n[o]=r};for(let e=0,t=arguments.length;e(E(n,((n,i)=>{r&&d(n)?t[i]=e(n,r):t[i]=n}),{allOwnKeys:i}),t),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,i)=>{let o,s,a;const c={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),s=o.length;s-- >0;)a=o[s],i&&!i(a,e,t)||c[a]||(t[a]=e[a],c[a]=!0);e=!1!==n&&r(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:i,kindOfTest:s,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(c(e))return e;let t=e.length;if(!f(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:R,hasOwnProperty:A,hasOwnProp:A,reduceDescriptors:N,freezeMethods:e=>{N(e,((t,n)=>{if(d(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];d(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach((e=>{n[e]=!0}))};return c(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[_-\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(e,t)=>(e=+e,Number.isFinite(e)?e:t),findKey:b,global:C,isContextDefined:S,toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(p(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[r]=e;const i=c(e)?[]:{};return E(e,((e,t)=>{const o=n(e,r+1);!u(o)&&(i[t]=o)})),t[r]=void 0,i}}return e};return n(e,0)}};function U(e,t,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i)}I.inherits(U,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:I.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const j=U.prototype,P={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{P[e]={value:e}})),Object.defineProperties(U,P),Object.defineProperty(j,"isAxiosError",{value:!0}),U.from=(e,t,n,r,i,o)=>{const s=Object.create(j);return I.toFlatObject(e,s,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),U.call(s,e.message,t,n,r,i),s.cause=e,s.name=e.name,o&&Object.assign(s,o),s};var F=U,k=n(230);function L(e){return I.isPlainObject(e)||I.isArray(e)}function B(e){return I.endsWith(e,"[]")?e.slice(0,-2):e}function D(e,t,n){return e?e.concat(t).map((function(e,t){return e=B(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}const q=I.toFlatObject(I,{},null,(function(e){return/^is[A-Z]/.test(e)}));var M=function(e,t,n){if(!I.isObject(e))throw new TypeError("target must be an object");t=t||new(k||FormData);const r=(n=I.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!I.isUndefined(t[e])}))).metaTokens,i=n.visitor||l,o=n.dots,s=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&(c=t)&&I.isFunction(c.append)&&"FormData"===c[Symbol.toStringTag]&&c[Symbol.iterator];var c;if(!I.isFunction(i))throw new TypeError("visitor must be a function");function u(e){if(null===e)return"";if(I.isDate(e))return e.toISOString();if(!a&&I.isBlob(e))throw new F("Blob is not supported. Use a Buffer instead.");return I.isArrayBuffer(e)||I.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function l(e,n,i){let a=e;if(e&&!i&&"object"==typeof e)if(I.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(I.isArray(e)&&function(e){return I.isArray(e)&&!e.some(L)}(e)||I.isFileList(e)||I.endsWith(n,"[]")&&(a=I.toArray(e)))return n=B(n),a.forEach((function(e,r){!I.isUndefined(e)&&null!==e&&t.append(!0===s?D([n],r,o):null===s?n:n+"[]",u(e))})),!1;return!!L(e)||(t.append(D(i,n,o),u(e)),!1)}const h=[],d=Object.assign(q,{defaultVisitor:l,convertValue:u,isVisitable:L});if(!I.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!I.isUndefined(n)){if(-1!==h.indexOf(n))throw Error("Circular reference detected in "+r.join("."));h.push(n),I.forEach(n,(function(n,o){!0===(!(I.isUndefined(n)||null===n)&&i.call(t,n,I.isString(o)?o.trim():o,r,d))&&e(n,r?r.concat(o):[o])})),h.pop()}}(e),t};function H(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function $(e,t){this._pairs=[],e&&M(e,this,t)}const K=$.prototype;K.append=function(e,t){this._pairs.push([e,t])},K.toString=function(e){const t=e?function(t){return e.call(this,t,H)}:H;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};var z=$;function J(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function W(e,t,n){if(!t)return e;const r=n&&n.encode||J,i=n&&n.serialize;let o;if(o=i?i(t,n):I.isURLSearchParams(t)?t.toString():new z(t,n).toString(r),o){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}var V=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){I.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},X={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},G="undefined"!=typeof URLSearchParams?URLSearchParams:z,Q=FormData;const Z=(()=>{let e;return("undefined"==typeof navigator||"ReactNative"!==(e=navigator.product)&&"NativeScript"!==e&&"NS"!==e)&&"undefined"!=typeof window&&"undefined"!=typeof document})(),Y="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts;var ee={isBrowser:!0,classes:{URLSearchParams:G,FormData:Q,Blob:Blob},isStandardBrowserEnv:Z,isStandardBrowserWebWorkerEnv:Y,protocols:["http","https","file","blob","url","data"]},te=function(e){function t(e,n,r,i){let o=e[i++];const s=Number.isFinite(+o),a=i>=e.length;return o=!o&&I.isArray(r)?r.length:o,a?(I.hasOwnProp(r,o)?r[o]=[r[o],n]:r[o]=n,!s):(r[o]&&I.isObject(r[o])||(r[o]=[]),t(e,n,r[o],i)&&I.isArray(r[o])&&(r[o]=function(e){const t={},n=Object.keys(e);let r;const i=n.length;let o;for(r=0;r{t(function(e){return I.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),r,n,0)})),n}return null};const ne={"Content-Type":void 0},re={transitional:X,adapter:["xhr","http"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,i=I.isObject(e);if(i&&I.isHTMLForm(e)&&(e=new FormData(e)),I.isFormData(e))return r&&r?JSON.stringify(te(e)):e;if(I.isArrayBuffer(e)||I.isBuffer(e)||I.isStream(e)||I.isFile(e)||I.isBlob(e))return e;if(I.isArrayBufferView(e))return e.buffer;if(I.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let o;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return M(e,new ee.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,r){return ee.isNode&&I.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((o=I.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return M(o?{"files[]":e}:e,t&&new t,this.formSerializer)}}return i||r?(t.setContentType("application/json",!1),function(e,t,n){if(I.isString(e))try{return(0,JSON.parse)(e),I.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||re.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(e&&I.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(e){if(n){if("SyntaxError"===e.name)throw F.from(e,F.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ee.classes.FormData,Blob:ee.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};I.forEach(["delete","get","head"],(function(e){re.headers[e]={}})),I.forEach(["post","put","patch"],(function(e){re.headers[e]=I.merge(ne)}));var ie=re;const oe=I.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),se=Symbol("internals");function ae(e){return e&&String(e).trim().toLowerCase()}function ce(e){return!1===e||null==e?e:I.isArray(e)?e.map(ce):String(e)}function ue(e,t,n,r){return I.isFunction(r)?r.call(this,t,n):I.isString(t)?I.isString(r)?-1!==t.indexOf(r):I.isRegExp(r)?r.test(t):void 0:void 0}class le{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function i(e,t,n){const i=ae(t);if(!i)throw new Error("header name must be a non-empty string");const o=I.findKey(r,i);(!o||void 0===r[o]||!0===n||void 0===n&&!1!==r[o])&&(r[o||t]=ce(e))}const o=(e,t)=>I.forEach(e,((e,n)=>i(e,n,t)));return I.isPlainObject(e)||e instanceof this.constructor?o(e,t):I.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z]+$/.test(e.trim())?o((e=>{const t={};let n,r,i;return e&&e.split("\n").forEach((function(e){i=e.indexOf(":"),n=e.substring(0,i).trim().toLowerCase(),r=e.substring(i+1).trim(),!n||t[n]&&oe[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)})),t})(e),t):null!=e&&i(t,e,n),this}get(e,t){if(e=ae(e)){const n=I.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(I.isFunction(t))return t.call(this,e,n);if(I.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=ae(e)){const n=I.findKey(this,e);return!(!n||t&&!ue(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function i(e){if(e=ae(e)){const i=I.findKey(n,e);!i||t&&!ue(0,n[i],i,t)||(delete n[i],r=!0)}}return I.isArray(e)?e.forEach(i):i(e),r}clear(){return Object.keys(this).forEach(this.delete.bind(this))}normalize(e){const t=this,n={};return I.forEach(this,((r,i)=>{const o=I.findKey(n,i);if(o)return t[o]=ce(r),void delete t[i];const s=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(i):String(i).trim();s!==i&&delete t[i],t[s]=ce(r),n[s]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return I.forEach(this,((n,r)=>{null!=n&&!1!==n&&(t[r]=e&&I.isArray(n)?n.join(", "):n)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach((e=>n.set(e))),n}static accessor(e){const t=(this[se]=this[se]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=ae(e);t[r]||(function(e,t){const n=I.toCamelCase(" "+t);["get","set","has"].forEach((r=>{Object.defineProperty(e,r+n,{value:function(e,n,i){return this[r].call(this,t,e,n,i)},configurable:!0})}))}(n,e),t[r]=!0)}return I.isArray(e)?e.forEach(r):r(e),this}}le.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent"]),I.freezeMethods(le.prototype),I.freezeMethods(le);var he=le;function de(e,t){const n=this||ie,r=t||n,i=he.from(r.headers);let o=r.data;return I.forEach(e,(function(e){o=e.call(n,o,i.normalize(),t?t.status:void 0)})),i.normalize(),o}function fe(e){return!(!e||!e.__CANCEL__)}function pe(e,t,n){F.call(this,null==e?"canceled":e,F.ERR_CANCELED,t,n),this.name="CanceledError"}I.inherits(pe,F,{__CANCEL__:!0});var ge=pe,me=ee.isStandardBrowserEnv?{write:function(e,t,n,r,i,o){const s=[];s.push(e+"="+encodeURIComponent(t)),I.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),I.isString(r)&&s.push("path="+r),I.isString(i)&&s.push("domain="+i),!0===o&&s.push("secure"),document.cookie=s.join("; ")},read:function(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}};function ve(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}var ye=ee.isStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let n;function r(n){let r=n;return e&&(t.setAttribute("href",r),r=t.href),t.setAttribute("href",r),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return n=r(window.location.href),function(e){const t=I.isString(e)?r(e):e;return t.protocol===n.protocol&&t.host===n.host}}():function(){return!0};function _e(e,t){let n=0;const r=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i,o=0,s=0;return t=void 0!==t?t:1e3,function(a){const c=Date.now(),u=r[s];i||(i=c),n[o]=a,r[o]=c;let l=s,h=0;for(;l!==o;)h+=n[l++],l%=e;if(o=(o+1)%e,o===s&&(s=(s+1)%e),c-i{const o=i.loaded,s=i.lengthComputable?i.total:void 0,a=o-n,c=r(a);n=o;const u={loaded:o,total:s,progress:s?o/s:void 0,bytes:a,rate:c||void 0,estimated:c&&s&&o<=s?(s-o)/c:void 0,event:i};u[t?"download":"upload"]=!0,e(u)}}const we={http:null,xhr:"undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){let r=e.data;const i=he.from(e.headers).normalize(),o=e.responseType;let s;function a(){e.cancelToken&&e.cancelToken.unsubscribe(s),e.signal&&e.signal.removeEventListener("abort",s)}I.isFormData(r)&&(ee.isStandardBrowserEnv||ee.isStandardBrowserWebWorkerEnv)&&i.setContentType(!1);let c=new XMLHttpRequest;if(e.auth){const t=e.auth.username||"",n=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";i.set("Authorization","Basic "+btoa(t+":"+n))}const u=ve(e.baseURL,e.url);function l(){if(!c)return;const r=he.from("getAllResponseHeaders"in c&&c.getAllResponseHeaders());!function(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new F("Request failed with status code "+n.status,[F.ERR_BAD_REQUEST,F.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}((function(e){t(e),a()}),(function(e){n(e),a()}),{data:o&&"text"!==o&&"json"!==o?c.response:c.responseText,status:c.status,statusText:c.statusText,headers:r,config:e,request:c}),c=null}if(c.open(e.method.toUpperCase(),W(u,e.params,e.paramsSerializer),!0),c.timeout=e.timeout,"onloadend"in c?c.onloadend=l:c.onreadystatechange=function(){c&&4===c.readyState&&(0!==c.status||c.responseURL&&0===c.responseURL.indexOf("file:"))&&setTimeout(l)},c.onabort=function(){c&&(n(new F("Request aborted",F.ECONNABORTED,e,c)),c=null)},c.onerror=function(){n(new F("Network Error",F.ERR_NETWORK,e,c)),c=null},c.ontimeout=function(){let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const r=e.transitional||X;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(new F(t,r.clarifyTimeoutError?F.ETIMEDOUT:F.ECONNABORTED,e,c)),c=null},ee.isStandardBrowserEnv){const t=(e.withCredentials||ye(u))&&e.xsrfCookieName&&me.read(e.xsrfCookieName);t&&i.set(e.xsrfHeaderName,t)}void 0===r&&i.setContentType(null),"setRequestHeader"in c&&I.forEach(i.toJSON(),(function(e,t){c.setRequestHeader(t,e)})),I.isUndefined(e.withCredentials)||(c.withCredentials=!!e.withCredentials),o&&"json"!==o&&(c.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&c.addEventListener("progress",_e(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&c.upload&&c.upload.addEventListener("progress",_e(e.onUploadProgress)),(e.cancelToken||e.signal)&&(s=t=>{c&&(n(!t||t.type?new ge(null,e,c):t),c.abort(),c=null)},e.cancelToken&&e.cancelToken.subscribe(s),e.signal&&(e.signal.aborted?s():e.signal.addEventListener("abort",s)));const h=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(u);h&&-1===ee.protocols.indexOf(h)?n(new F("Unsupported protocol "+h+":",F.ERR_BAD_REQUEST,e)):c.send(r||null)}))}};I.forEach(we,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));function Ee(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new ge(null,e)}function be(e){return Ee(e),e.headers=he.from(e.headers),e.data=de.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),(e=>{e=I.isArray(e)?e:[e];const{length:t}=e;let n,r;for(let i=0;ie instanceof he?e.toJSON():e;function Se(e,t){t=t||{};const n={};function r(e,t,n){return I.isPlainObject(e)&&I.isPlainObject(t)?I.merge.call({caseless:n},e,t):I.isPlainObject(t)?I.merge({},t):I.isArray(t)?t.slice():t}function i(e,t,n){return I.isUndefined(t)?I.isUndefined(e)?void 0:r(void 0,e,n):r(e,t,n)}function o(e,t){if(!I.isUndefined(t))return r(void 0,t)}function s(e,t){return I.isUndefined(t)?I.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function a(n,i,o){return o in t?r(n,i):o in e?r(void 0,n):void 0}const c={url:o,method:o,data:o,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(e,t)=>i(Ce(e),Ce(t),!0)};return I.forEach(Object.keys(e).concat(Object.keys(t)),(function(r){const o=c[r]||i,s=o(e[r],t[r],r);I.isUndefined(s)&&o!==a||(n[r]=s)})),n}const Oe={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{Oe[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const xe={};Oe.transitional=function(e,t,n){function r(e,t){return"[Axios v1.2.3] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,i,o)=>{if(!1===e)throw new F(r(i," has been removed"+(t?" in "+t:"")),F.ERR_DEPRECATED);return t&&!xe[i]&&(xe[i]=!0,console.warn(r(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,i,o)}};var Re={assertOptions:function(e,t,n){if("object"!=typeof e)throw new F("options must be an object",F.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const o=r[i],s=t[o];if(s){const t=e[o],n=void 0===t||s(t,o,e);if(!0!==n)throw new F("option "+o+" must be "+n,F.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new F("Unknown option "+o,F.ERR_BAD_OPTION)}},validators:Oe};const Ae=Re.validators;class Te{constructor(e){this.defaults=e,this.interceptors={request:new V,response:new V}}request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Se(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:i}=t;let o;void 0!==n&&Re.assertOptions(n,{silentJSONParsing:Ae.transitional(Ae.boolean),forcedJSONParsing:Ae.transitional(Ae.boolean),clarifyTimeoutError:Ae.transitional(Ae.boolean)},!1),void 0!==r&&Re.assertOptions(r,{encode:Ae.function,serialize:Ae.function},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase(),o=i&&I.merge(i.common,i[t.method]),o&&I.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete i[e]})),t.headers=he.concat(o,i);const s=[];let a=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,s.unshift(e.fulfilled,e.rejected))}));const c=[];let u;this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)}));let l,h=0;if(!a){const e=[be.bind(this),void 0];for(e.unshift.apply(e,s),e.push.apply(e,c),l=e.length,u=Promise.resolve(t);h{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null})),this.promise.then=e=>{let t;const r=new Promise((e=>{n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e,r,i){n.reason||(n.reason=new ge(e,r,i),t(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}static source(){let e;return{token:new Ie((function(t){e=t})),cancel:e}}}var Ue=Ie;const je={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(je).forEach((([e,t])=>{je[t]=e}));var Pe=je;const Fe=function t(n){const r=new Ne(n),i=e(Ne.prototype.request,r);return I.extend(i,Ne.prototype,r,{allOwnKeys:!0}),I.extend(i,r,null,{allOwnKeys:!0}),i.create=function(e){return t(Se(n,e))},i}(ie);Fe.Axios=Ne,Fe.CanceledError=ge,Fe.CancelToken=Ue,Fe.isCancel=fe,Fe.VERSION="1.2.3",Fe.toFormData=M,Fe.AxiosError=F,Fe.Cancel=Fe.CanceledError,Fe.all=function(e){return Promise.all(e)},Fe.spread=function(e){return function(t){return e.apply(null,t)}},Fe.isAxiosError=function(e){return I.isObject(e)&&!0===e.isAxiosError},Fe.mergeConfig=Se,Fe.AxiosHeaders=he,Fe.formToJSON=e=>te(I.isHTMLForm(e)?new FormData(e):e),Fe.HttpStatusCode=Pe,Fe.default=Fe;var ke=Fe;const Le={};var Be=e=>e in Le?Le[e]:Le[e]=ke.get(e);class De{constructor(e){let{id:t,link:{url:n,integrity:r}}=e;this._id=t,this._url=n,this._integrity=r}get id(){return this._id}get url(){return this._url}get integrity(){return this._integrity}}class qe{constructor(e){let{id:t,name:n,url:r}=e;this._id=t,this._name=n,this._url=r}get id(){return this._id}get name(){return this._name}get url(){return this._url}}class Me{constructor(e){let{id:t,name:n,url:r}=e;this._id=t,this._name=n,this._url=r}get id(){return this._id}get name(){return this._name}get url(){return this._url}}class He{constructor(e){let{id:t,url:n}=e;this._id=t,this._url=n}get id(){return this._id}get url(){return this._url}}class $e{constructor(e,t){let{programKey:n,countersUrl:r,eventsUrl:i,scenarios:o,invites:s,overlays:a,surveys:c,cfrUrl:u}=e;this._programKey=n,this._countersUrl=r,this._eventsUrl=i,this._cfrUrl=u,this._scenarios=o.map((e=>new De(e))),this._invites=s.map((e=>new qe(e))),this._containers=a.map((e=>new Me(e))),this._surveys=c.map((e=>new He(e))),this._userCountry=t}get programKey(){return this._programKey}get countersUrl(){return this._countersUrl}get eventsUrl(){return this._eventsUrl}get cfrUrl(){return this._cfrUrl}get scenarios(){return this._scenarios}get invites(){return this._invites}get containers(){return this._containers}get surveys(){return this._surveys}get userCountry(){return this._userCountry}}var Ke=(e,t)=>new Promise(((n,r)=>{try{const i=document.createElement("script");i.type="text/javascript",i.src=e,i.async=!0,t&&(i.crossOrigin="anonymous",i.integrity=t),i.addEventListener("load",(()=>n()),!1),i.addEventListener("error",(()=>r(new Error(`Failed to load script ${e}`))),!1);const o=document.getElementsByTagName("script")[0];o.parentNode.insertBefore(i,o)}catch(e){r(e)}}));window.DigitalFeedback=window.DigitalFeedback||{};var ze=window.DigitalFeedback;class Je{constructor(e){this._name=e,this._subscribers=[]}get name(){return this._name}on(e){void 0===this._subscribers.find((t=>t===e))&&this._subscribers.push(e)}off(e){this._subscribers=this._subscribers.filter((t=>t!==e))}trigger(e){this._subscribers.forEach((t=>t(e)))}}const We=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r={__digital_feedback_ctx:JSON.stringify({programKey:e,scenarioId:t})},i=(e,t)=>void 0!==Object.keys(e).find((e=>e.toLowerCase()===t.toLowerCase())),o=Object.entries(r),s=Object.entries(n).filter((e=>{let[t]=e;return!i(r,t)})),a=[...o,...s].map((e=>{let[t,n]=e;return`${encodeURIComponent(t)}=${encodeURIComponent(n)}`})).join("&");return a};function Ve(e){"none"!==e.style.display&&(e.style.display="none")}function Xe(e){"none"===e.style.display&&(e.style.display="")}function Ge(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document.body,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const r=document.createElement("div");r.innerHTML=e.trim();const i=r.firstChild;return n&&Ve(i),t.appendChild(i)}function Qe(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function Ze(e){if(!function(e){if(e.tabIndex>0||0===e.tabIndex&&null!==e.getAttribute("tabIndex"))return!0;if(e.disabled)return!1;switch(e.nodeName){case"A":return!!e.href&&"ignore"!==e.rel;case"INPUT":return"hidden"!==e.type&&"file"!==e.type;case"BUTTON":case"SELECT":case"TEXTAREA":case"IFRAME":return!0;default:return!1}}(e))return!1;try{e.focus()}catch(e){}return document.activeElement===e}function Ye(e){for(let t=0;t=0;t--){const n=e.childNodes[t];if(Ze(n))return n;const r=et(n);if(r)return r}return null}class tt{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this._invite=e,this._options=t,this._wrapper=null,this._node=null,this._showInviteEvent=new Je("invite:show"),this._acceptInviteEvent=new Je("invite:accept"),this._declineInviteEvent=new Je("invite:decline"),this._closeInviteEvent=new Je("invite:close")}get showInviteEvent(){return this._showInviteEvent}get acceptInviteEvent(){return this._acceptInviteEvent}get declineInviteEvent(){return this._declineInviteEvent}get closeInviteEvent(){return this._closeInviteEvent}async render(){this.close();const{url:e}=this._invite,{data:{html:t,css:n}}=await Be(e);this._renderContents(t,n),this._attachEvents(),this._show()}close(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this._node&&(Qe(this._node),this._node=null,Qe(this._wrapper),this._wrapper=null,e&&this._closeInviteEvent.trigger())}_resolveTarget(){const{target:e}=this._options;return e?"string"==typeof e?document.querySelector(e):e:document.body}_renderContents(e,t){const n=this._resolveTarget();this._wrapper=Ge('
',n,!1),this._node=Ge(e,this._wrapper),Ge(``,this._node)}_attachEvents(){this._node.querySelectorAll("[data-invite-accept]").forEach((e=>e.addEventListener("click",(()=>this._accept())))),this._node.querySelectorAll("[data-invite-decline]").forEach((e=>e.addEventListener("click",(()=>this._decline())))),this._node.querySelectorAll("[data-invite-close]").forEach((e=>e.addEventListener("click",(()=>this.close(!0)))))}_show(){Xe(this._node),this._showInviteEvent.trigger()}_accept(){this._node.hasAttribute("data-invite-persistent")||this.close(),this._acceptInviteEvent.trigger()}_decline(){this.close(),this._declineInviteEvent.trigger()}}class nt{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this._container=e,this._surveyUrl=t,this._options=n,this._node=null,this._frame=null,this._autoHeight=!1,this._ignoreFocusChanges=!1,this._showContainerEvent=new Je("container:show"),this._completeSurveyEvent=new Je("survey:complete"),this._closeContainerEvent=new Je("container:close"),this._surveyMessageEvent=new Je("container:surveymessage")}get showContainerEvent(){return this._showContainerEvent}get completeSurveyEvent(){return this._completeSurveyEvent}get closeContainerEvent(){return this._closeContainerEvent}get surveyMessageEvent(){return this._surveyMessageEvent}async render(){this.close();const{url:e}=this._container,{data:{html:t,css:n}}=await Be(e);this._renderContents(t,n),this._attachEvents(),this._setSurveyUrl(),this._show()}close(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this._node&&(Qe(this._node),this._node=null,e&&this._closeContainerEvent.trigger())}setHidden(){this._node&&Ve(this._node)}setVisible(){this._node&&Xe(this._node)}_resolveTarget(){const{target:e}=this._options;return e?"string"==typeof e?document.querySelector(e):e:document.body}_renderContents(e,t){const n=this._resolveTarget();this._node=Ge(e,n),Ge(``,this._node),this._frame=this._node.querySelector("[data-container-frame]"),this._adjustForAutoHeight()}_adjustForAutoHeight(){const e=this._node.hasAttribute("data-auto-height"),t=this._isMobile();e&&!t?(this._autoHeight=!0,this._frame.setAttribute("scrolling","no")):(this._autoHeight=!1,this._node.removeAttribute("data-auto-height"))}_isMobile(){const e=+this._node.getAttribute("data-mobile-threshold")||640,t=window.innerWidth||document.documentElement.clientWidth,n=window.innerHeight||document.documentElement.clientHeight;return Math.min(t,n)<=e}_onForwardFocusTrap(e){if(this._ignoreFocusChanges)return;this._ignoreFocusChanges=!0,e.preventDefault();const t=this._node.querySelector("[data-container]");if(t){const e=Ye(t);e&&"IFRAME"===e.nodeName&&this.sendMessageToSurvey({type:"cf-focus-first-element"})}this._ignoreFocusChanges=!1}_onBackwardFocusTrap(e){if(this._ignoreFocusChanges)return;this._ignoreFocusChanges=!0,e.preventDefault();const t=this._node.querySelector("[data-container]");if(t){const e=et(t);e&&"IFRAME"===e.nodeName&&this.sendMessageToSurvey({type:"cf-focus-last-element"})}this._ignoreFocusChanges=!1}_onEscapeKey(e){"Escape"!==e.key&&"Esc"!==e.key||(this.close(!0),e.stopPropagation())}_attachEvents(){this._frame&&(this._frame.addEventListener("load",(()=>this._surveyLoaded())),window.addEventListener("message",(e=>this._handleMessage(e)))),this._node.querySelectorAll("[data-container-close]").forEach((e=>e.addEventListener("click",(()=>this.close(!0)))));const e=this._node.querySelector("[data-container-shim]");e&&e.addEventListener("keyup",(e=>this._onEscapeKey(e)));const t=this._node.querySelector("[data-focus-trap-backward]");t&&t.addEventListener("focus",(e=>this._onBackwardFocusTrap(e)));const n=this._node.querySelector("[data-focus-trap-forward]");n&&n.addEventListener("focus",(e=>this._onForwardFocusTrap(e)))}_show(){this._node&&(Xe(this._node),this._setFocus(),this._showContainerEvent.trigger())}_surveyLoaded(){this._node&&(this._node.querySelectorAll("[data-container-loader]").forEach((e=>Ve(e))),this._setFocus(),this.sendMessageToSurvey({type:"cf-focus-first-element"}))}_setFocus(){this._frame&&!this._options.nofocus&&this._frame.focus()}_handleMessage(e){if(e.source===this._frame.contentWindow&&"object"==typeof e.data){switch(e.data.type){case"cf-survey-end":this._onSurveyEnd();break;case"cf-survey-break":this._onSurveyBreak();break;case"cf-height-change":this._onHeightChange(e.data.value)}this._surveyMessageEvent.trigger(e.data)}}sendMessageToSurvey(e){this._frame&&this._frame.contentWindow.postMessage(e,this._frame.src)}_onSurveyEnd(){this._completeSurveyEvent.trigger(),this.close()}_onSurveyBreak(){this.close(!0)}_onHeightChange(e){this._autoHeight&&this._frame&&(this._frame.style.height=e+"px")}_setSurveyUrl(){this._frame&&this._surveyUrl&&(this._frame.src=this._surveyUrl)}}const rt="InvitePresented",it="InviteAccepted",ot="InviteDeclined",st="InviteClosed",at="ContainerPresented",ct="ContainerClosed",ut="SurveyCompleted";var lt=e=>{console.warn(e)},ht=e=>({on:t=>e.on(t),off:t=>e.off(t)});const dt=(e,t,n)=>{if("string"==typeof n)return e.find((e=>t(e).toLowerCase()===n.toLowerCase()))};class ft{constructor(e,t,n,r){this._apiConfig=e,this._programConfig=t,this._scenarioConfig=n,this._pluginsConfig=r,this._programCounters=[],this._activePlugins=[],this._state={invite:void 0,container:void 0,survey:void 0,data:void 0},this._events={showInvite:new Je("api:show-invite"),acceptInvite:new Je("api:accept-invite"),declineInvite:new Je("api:decline-invite"),closeInvite:new Je("api:close-invite"),showContainer:new Je("api:show-container"),completeSurvey:new Je("api:complete-survey"),closeContainer:new Je("api:close-container")}}get events(){return this._events}setConfig(e){this._apiConfig=e}setInvite(e,t){const{invites:n}=this._programConfig,r=dt(n,(e=>e.name),e);if(void 0===r)throw new Error(`Cannot find invite '${e}'`);this._setState({invite:r,inviteOptions:t}),Be(r.url)}setContainer(e,t){const{containers:n}=this._programConfig,r=dt(n,(e=>e.name),e);if(void 0===r)throw new Error(`Cannot find container '${e}'`);this._setState({container:r,containerOptions:t}),Be(r.url)}setSurvey(e){const{surveys:t}=this._programConfig,n=dt(t,(e=>e.id),e);if(void 0===n)throw new Error(`Cannot find survey '${e}'`);this._setState({survey:n})}setSurveyData(e,t){t&&(e={...this._state.data,...e}),this._setState({data:e})}usePlugin(e){const t=dt(this._pluginsConfig,(e=>e.name),e);if(void 0===t)throw new Error(`Cannot find plugin '${e}'`);const{clientKey:n,url:r,integrity:i}=t;if(dt(this._activePlugins,(e=>e.clientKey),n))return;const o=Ke(r,i);for(var s=arguments.length,a=new Array(s>1?s-1:0),c=1;cn.scenarioId===t&&n.surveyId===e));return void 0===r?n:{...n,...r}}getUserCountry(){const{userCountry:e}=this._programConfig;return e}_setState(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._state={...this._state,...e}}_showInvite(){const{invite:e,inviteOptions:t}=this._state;if(void 0===e)return;const n=new tt(e,t),r={model:e,view:n};return n.showInviteEvent.on((()=>this._onInviteEvent(rt,r))),n.acceptInviteEvent.on((()=>this._onInviteEvent(it,r))),n.declineInviteEvent.on((()=>this._onInviteEvent(ot,r))),n.closeInviteEvent.on((()=>this._onInviteEvent(st,r))),n.render().catch(lt),n}_onInviteEvent(e,t){this._triggerPublicInviteEvent(e,t),this._triggerApiInviteEvent(e,t),e===it&&this._showContainer()}_shouldTriggerApiInviteEvent(e){const t=`count${e}`,{[t]:n}=this._apiConfig;return!!n}_triggerApiInviteEvent(e,t){let{model:n}=t;if(!this._shouldTriggerApiInviteEvent(e))return;const{eventsUrl:r,programKey:i}=this._programConfig,{id:o}=this._scenarioConfig,s=`${r}&eventType=${e}&scenarioId=${o}&inviteId=${n.id}`;ke.get(s,{headers:{"X-ClientId":i}}).catch(lt)}_triggerPublicInviteEvent(e,t){let{model:n,view:r}=t;({[rt]:this._events.showInvite,[it]:this._events.acceptInvite,[ot]:this._events.declineInvite,[st]:this._events.closeInvite})[e].trigger({inviteName:n.name,closeInvite:e=>{r.close(e)}})}_showContainer(){const{container:e,containerOptions:t,survey:n,data:r}=this._state;if(void 0===e)return;const{programKey:i}=this._programConfig,{id:o}=this._scenarioConfig;let s;void 0!==n&&(s=((e,t,n,r)=>{if("string"!=typeof n)return;const i=-1===n.indexOf("?")?"?":"&";return`${n}${i}${"object"==typeof r?We(e,t,r):We(e,t)}`})(i,o,n.url,r));const a=new nt(e,s,t),c={model:e,view:a,survey:n,surveyUrl:s};return a.showContainerEvent.on((()=>this._onContainerEvent(at,c))),a.closeContainerEvent.on((()=>this._onContainerEvent(ct,c))),a.completeSurveyEvent.on((()=>this._onContainerEvent(ut,c))),a.render().catch(lt),a}_onContainerEvent(e,t){this._triggerPublicContainerEvent(e,t)}_triggerPublicContainerEvent(e,t){let{model:n,view:r,survey:i,surveyUrl:o}=t;const s={[at]:this._events.showContainer,[ct]:this._events.closeContainer,[ut]:this._events.completeSurvey},a=ht(r.surveyMessageEvent),c=s[e],u={containerName:n.name,surveyId:i.id,surveyUrl:o,closeContainer:e=>{r.close(e)},setContainerHidden:()=>{r.setHidden()},setContainerVisible:()=>{r.setVisible()},surveyMessageEvent:a,sendMessageToSurvey:e=>{r.sendMessageToSurvey(e)}};c.trigger(u)}}const pt=(e,t,n,r)=>{const i=new ft(e,t,n,r),o={invite:(e,t)=>(i.setInvite(e,t),o),container:(e,t)=>(i.setContainer(e,t),o),survey:e=>(i.setSurvey(e),o),data:function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return i.setSurveyData(e,t),o},show:()=>(i.show(),o),loadCountersAsync:async()=>(await i.loadCountersAsync(),o),scenarioCounters:e=>i.getScenarioCounters(e),checkContactFrequencyRules:(e,t)=>i.checkContactFrequencyRules(e,t),usePlugin:e=>(i.usePlugin(e,o),o),getUserCountry:()=>i.getUserCountry(),config:e=>(i.setConfig(e),o),events:{showInvite:ht(i.events.showInvite),acceptInvite:ht(i.events.acceptInvite),declineInvite:ht(i.events.declineInvite),closeInvite:ht(i.events.closeInvite),showContainer:ht(i.events.showContainer),completeSurvey:ht(i.events.completeSurvey),closeContainer:ht(i.events.closeContainer)}};return o};var gt=async(e,t,n,r)=>{(await n)((function(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return pt(n,e,t,r)}))};class mt{constructor(e){let{name:t,version:n,link:{url:r,integrity:i}}=e;this._name=t,this._version=n,this._url=r,this._integrity=i}get name(){return this._name}get version(){return this._version}get url(){return this._url}get integrity(){return this._integrity}get clientKey(){return`${this.name}:${this.version}`}}var vt=async(e,t)=>{const n=await(async e=>{try{const{data:t,headers:n}=await Be(e);return new $e(t,n["x-df-geo-country"])}catch(t){throw new Error(`Cannot load program: ${e}`)}})(e),r=t.map((e=>new mt(e))),{scenarios:i}=n,o=n.scenarios.map((e=>(async e=>{let{url:t,integrity:n}=e;try{await Ke(t,n)}catch(e){throw new Error(`Cannot load scenario script: '${t}'`)}const r=ze[t];if("function"!=typeof r)throw new Error(`Cannot parse scenario script: '${t}'`);return delete ze[t],r})(e)));for(let e=0;e\n \n \n
\n
\n
\n Digital Feedback is running in Test Mode.\n \x3c!----\x3e\n
\n
\n
\n
\n\n",document.body,!1);const e=this._container.querySelector(".cf-tm-warning__close");e&&e.addEventListener("click",(()=>this._hide()))}_show(){const e=this._container.querySelector(".cf-tm-warning");e.offsetTop,e.classList.remove("cf-tm-warning--hidden")}_hide(){this._container.querySelector(".cf-tm-warning").classList.add("cf-tm-warning--hidden")}}var _t=n(835);ze[_t.version]={run:async e=>{const{programUrl:t,isTest:n,plugins:r=[]}=e;n&&(new yt).render(),await vt(t,r)}}}()}(); //# sourceMappingURL=intercept-survey.js.map