1(window.webpackJsonp=window.webpackJsonp||[]).push([[0],[function(module,__webpack_exports__,__webpack_require__){"use strict";var regenerator_runtime_runtime__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(96),regenerator_runtime_runtime__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(regenerator_runtime_runtime__WEBPACK_IMPORTED_MODULE_0__),_UtilsCore__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(22),lodash_debounce__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(36),lodash_debounce__WEBPACK_IMPORTED_MODULE_2___default=__webpack_require__.n(lodash_debounce__WEBPACK_IMPORTED_MODULE_2__),md5__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(106),md5__WEBPACK_IMPORTED_MODULE_3___default=__webpack_require__.n(md5__WEBPACK_IMPORTED_MODULE_3__),_helpers_LocalStorageHandler__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(15),_shared_Optimizely_sdk_optimizelyUser__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(54),_shared_Optimizely_sdk_optimizelySetup__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__(21),_shared_utils_rewriteDestinationLinks__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__(100),_this2=void 0,_Utils;function asyncGeneratorStep(e,t,i,n,r,o,s){try{var a=e[o](s),l=a.value}catch(e){return void i(e)}a.done?t(l):Promise.resolve(l).then(n,r)}function _asyncToGenerator(e){return function(){var t=this,i=arguments;return new Promise((function(n,r){var o=e.apply(t,i);function s(e){asyncGeneratorStep(o,n,r,s,a,"next",e)}function a(e){asyncGeneratorStep(o,n,r,s,a,"throw",e)}s(void 0)}))}}function _createForOfIteratorHelper(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=_unsupportedIterableToArray(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0,r=function(){};return{s:r,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:r}}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 o,s=!0,a=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return s=e.done,e},e:function(e){a=!0,o=e},f:function(){try{s||null==i.return||i.return()}finally{if(a)throw o}}}}function ownKeys(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(i),!0).forEach((function(t){_defineProperty(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):ownKeys(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function _defineProperty(e,t,i){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return"symbol"===_typeof(t)?t:String(t)}function _toPrimitive(e,t){if("object"!==_typeof(e)||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!==_typeof(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _nonIterableRest(){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 _iterableToArrayLimit(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var n,r,o,s,a=[],l=!0,c=!1;try{if(o=(i=i.call(e)).next,0===t){if(Object(i)!==i)return;l=!1}else for(;!(l=(n=o.call(i)).done)&&(a.push(n.value),a.length!==t);l=!0);}catch(e){c=!0,r=e}finally{try{if(!l&&null!=i.return&&(s=i.return(),Object(s)!==s))return}finally{if(c)throw r}}return a}}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _construct(e,t,i){return(_construct=_isNativeReflectConstruct()?Reflect.construct.bind():function(e,t,i){var n=[null];n.push.apply(n,t);var r=new(Function.bind.apply(e,n));return i&&_setPrototypeOf(r,i.prototype),r}).apply(null,arguments)}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function _setPrototypeOf(e,t){return(_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _nonIterableSpread(){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 _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?_arrayLikeToArray(e,t):void 0}}function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}for(var numberFormatLocaleMapping={es:"es",en:"en",fr:"fr",it:"it",pt:"pt",mx:"en",ar:"es",br:"pt"},momentLocaleMapping={es:"es",en:"en",fr:"fr",it:"it",pt:"pt",mx:"es",ar:"es",br:"pt"},numberFormatLocaleRegionMapping={es:"es-ES",en:"en-GB",fr:"fr-FR",it:"it-IT",pt:"pt-PT",mx:"es-MX",ar:"es-AR",br:"pt-BR"},amountAndCurrencySymbolMapping={es:"{1}{2}",mx:"{1}{2}",ar:"{1}{2}",en:"{2}{1}",fr:"{1}{2}",pt:"{2}{1}",br:"{2}{1}",it:"{1}{2}"},parsleyLocaleMapping=numberFormatLocaleMapping,zendeskLocaleMapping=numberFormatLocaleMapping,mapBoxLocaleMapping={es:"es",en:"en",fr:"fr",it:"es",pt:"pt",mx:"es",ar:"es",br:"pt"},$cache={},loadings={},minutesPerDay=1440,recentACookieFormatMappings={activities:{id:"i",name:"n",url:"u",destName:"dN",destUrl:"dU",timeAdded:"ti",isDestSeoLanding:"iDSL"},destinations:{id:"i",name:"n",url:"u",countryName:"cN",countryUrl:"cU",timeAdded:"ti",isSeoLanding:"iSL"}},Utils=(_Utils={convertCivLastAObject:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"short";if(!Array.isArray(e))return console.error("Invalid cookieDataObject provided:",e),[];if("short"!==t&&"long"!==t)return console.error("Invalid format provided:",t),[];var i="short"===t,n=function(e){return i?{a:e.activityId,as:Utils.cloneObject(e.activityIds),d:e.destinationId,c:e.countryId,t:e.time}:{activityId:e.a,activityIds:Utils.cloneObject(e.as),destinationId:e.d,countryId:e.c,time:e.t}},r=e.length>0&&void 0!==e[0].activityId;return r&&"long"===t?e:e.map(n)},convertCivRecentAItem:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"short";if("object"!==_typeof(e)||null===e)return console.error("Invalid item provided:",e),{};if("string"!=typeof t||!["activities","destinations"].includes(t))return console.error("Invalid type provided:",t),{};if("short"!==i&&"long"!==i)return console.error("Invalid format provided:",i),{};var n=recentACookieFormatMappings[t];if(!n||"object"!==_typeof(n))return console.error("Mapping for type '".concat(t,"' not found or invalid.")),{};var r={},o=function(e,t,n){var o;try{if("short"===i)void 0!==(o=n[e])&&("string"==typeof t&&(t=t.replace("https://www.civitatis.com","")),r[o]=t);else if("long"===i)for(var s in n)n[s]===e&&(r[o=s]=t)}catch(i){console.error("Error processing key '".concat(e,"' with value '").concat(t,"':"),i)}};for(var s in e){var a=e[s];o(s,a,n)}return r},getRecentSearchObject:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"civRecentA",t={activities:[],destinations:[]},i=function(e){var t=Utils.readCookie(e);if(!t)return null;try{var i=$.base64.decode(decodeURIComponent(t));return Utils.isSecureHref(i)?JSON.parse(i):null}catch(t){return console.error("Error decoding or parsing cookie '".concat(e,"':"),t),null}},n=function(e){return{activities:(e.a||[]).map((function(e){return Utils.convertCivRecentAItem(e,"activities","long")})),destinations:(e.d||[]).map((function(e){return Utils.convertCivRecentAItem(e,"destinations","long")}))}},r=i(e);if(!r)return Utils.deleteCookie(e),t;var o=r.activities||r.destinations,s=r.a||r.d;return o?r:s?n(r):(Utils.deleteCookie(e),t)},isSecureHref:function(e){if("string"!=typeof e)return console.error("Invalid href provided to isSecureHref:",e),!1;var t=e.trim().toLowerCase();return!["javascript","data:text/html"].some((function(e){return t.includes(e)}))},isDebug:function(){return"debug"===_UtilsCore__WEBPACK_IMPORTED_MODULE_1__.a.readCookie("debug")},isNoLog:function(){return"true"===_UtilsCore__WEBPACK_IMPORTED_MODULE_1__.a.readCookie("nolog")},l:function(){var e;
1isLocal&&!Utils.isNoLog()&&(e=console).log.apply(e,arguments)},alerta:function(e){isAlert?alert(e):Utils.l("alert ---\x3e"+e)},la:function(e){null!=_UtilsCore__WEBPACK_IMPORTED_MODULE_1__.a.readCookie("log")&&console.log(e)},error:function(e){isLocal&&console.error(e)},warn:function(e){isLocal&&console.warn(e)},getDescendantProp:function(e,t){if(void 0!==e)try{return t.split(".").reduce((function(e,t){return e[t]}),e)}catch(e){return}},serializedToObject:function(e){var t={};return e.map((function(e){void 0===t[e.name]?t[e.name]=e.value:t[e.name]=t[e.name]+","+e.value})),t},elemToRequestDataObject:function(e,t){t=void 0===t||null!==t||1==t||"true"==t||"1"==t;var i=Utils.cloneObject(Utils.serializedToObject(e.serializeArray()));return t&&(i=Utils.replaceCopyFormData(i)),i},elemToDataObject:function(e,t){t=void 0===t||null!==t||1==t||"true"==t||"1"==t;var i=Utils.serializedToObject(e.serializeArray());return t&&(i=Utils.replaceCopyFormData(i)),i},cloneObject:function(e){return JSON.parse(JSON.stringify(e))},cloneFullObject:function(e){return jQuery.extend(!0,{},e)},cloneArray:function(e){return e.slice(0)},insertItemIntoArray:function(e,t,i){e.splice(i,0,t)},insertItemIntoArrayOrdered:function(e,t,i){e.push(t),e.sort((function(e,t){return t[i]-e[i]}))},removeItemFromArray:function(e,t){e.splice(t,1)},orderObject:function(e){var t={};return Object.keys(e).sort().forEach((function(i){t[i]=e[i]})),t},areEqualObjects:function(e,t){return JSON.stringify(e)===JSON.stringify(t)},areEqualSelectors:function(e,t){return e.length==t.length&&e.length==e.filter(t).length},mergeObjects:function(e,t){for(var i in t)e[i]=t[i]},isEmptyObject:function(e){return JSON.stringify(e)===JSON.stringify({})},isEmptyStringsArray:function(e){return""===e.toString().replace(/,/g,"")},getRandomString:function(e){return e=void 0!==e?e:5,(Math.random().toString(36)+"00000000000000000").slice(2,e+2)},generateId:function(e){return(e=void 0!==e?e:"generatedID")+"_"+Math.random().toString().replace(".","")},setIdIfNotId:function(e,t){t=void 0!==t?t:"generatedID";var i=e.attr("id");return void 0!==i&&!1!==i||(i=Utils.generateId(t),e.attr("id",i)),i},getById:function(e,t){e=e.toString();for(var i=0;i<t.length;i++)if(void 0!==t[i].id&&null!==t[i].id&&t[i].id.toString()===e)return t[i]},getByKey:function(e,t,i){for(var n=0;n<i.length;n++)if(void 0!==i[n][e]&&null!==i[n][e]&&i[n][e].toString()===t)return i[n]},getNumberOfKeys:function(e){var t=0;for(var i in e)t++;return t},copyProp:function(e,t,i,n){void 0!==e&&void 0!==t&&(void 0!==e[i]?t[i]=e[i]:void 0!==n&&(t[i]=n))},pad:function(e,t){var i="000000000"+e;return i.substr(i.length-t)},capitalizeFirst:function(e){return e[0].toUpperCase()+e.slice(1)},replaceAll:function(e,t,i){i=void 0!==i?i:"";var n=e.replace(new RegExp(t,"g"),i);return-1===n.indexOf(t)?n:Utils.replaceAll(n,t,i)},getMoment:function(e,t,i){var n=null;if(null!=e){if(moment.isMoment(e))n=e;else if(moment.isDate(e))n=moment(e);else if("string"==typeof e)if(null!=t&&""!==t)n=null!=i&&"boolean"==typeof i?moment(e,t,i):moment(e,t);else{var r=e.split(/\-|\s|:/).map((function(e,t){return 1==t?parseInt(e)-1:parseInt(e)}));n=moment(_construct(Date,_toConsumableArray(r)))}}else n=moment(new Date);return n},toDate:function(e){var t=e.split("-");return new Date(t[0],t[1]-1,t[2])},dateToYYYYMMDD:function(e){return Utils.getMoment(e).format("YYYY-MM-DD")},dateFormatToYYYYMMDD:function(e){return Utils.getMoment(e,Utils.tr("timeFormats.datePickerFormat")).format("YYYY-MM-DD")},noOffsetDate:function(e){return new Date(e.getTime()+Math.abs(6e4*e.getTimezoneOffset()))},dateStringToDDMMYYYY:function(e){var t=e.split("/"),i=Utils.tr("timeFormats.datePickerFormat").split("/"),n=i.indexOf("YYYY"),r=i.indexOf("MM"),o=i.indexOf("DD");return t[n]+"-"+t[r]+"-"+t[o]},dateStringToSlashDDMMYYYY:function(e){if(""===e)return"";var t=e.split("-");return t[2]+"/"+t[1]+"/"+t[0]},dateToDDMMYYYY:function(e){var t=function(e){return e<10?"0"+e:e};return[t(e.getDate()),t(e.getMonth()+1),e.getFullYear()].join("/")},dateToFormat:function(e,t){return Utils.getMoment(e).format(t)},dateToHHMM:function(e){return Utils.getMoment(e).format("HH:mm")},isDate:function(e){var t=new Date(e);return!isNaN(t.valueOf())},addDaysToDate:function(e,t){var i=new Date(e);return i.setDate(i.getDate()+t),i},hourFormat:function(e){if(/^((?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d$)/.test(e)){var t=e.indexOf(":",e.indexOf(":")+1);return e.substr(0,t)}return e},normalizeTime:function(e){var t=e.split(":")[0],i=e.split(":")[1],n=e.split(":")[2];void 0===n&&(n="00");var r=[];return r.push(Utils.pad(t,2)),r.push(Utils.pad(i,2)),r.push(Utils.pad(n,2)),r.join(":")},getLocale:function(){var e=void 0!==window.civLocale&&""!==window.civLocale?window.civLocale:Utils.getLocaleFromHtmlAttr();return void 0!==e&&""!==e||(e="es"),e}
1,getLocaleFromHtmlAttr:function(){var e=document.documentElement;return e.hasAttribute("data-lang")?e.getAttribute("data-lang"):e.getAttribute("lang")},getLocaleCurrencySpace:function(){var e=!1;return void 0!==window.civLocaleCurrencySpace&&null!==window.civLocaleCurrencySpace&&(e=1==window.civLocaleCurrencySpace||"true"==window.civLocaleCurrencySpace||"1"==window.civLocaleCurrencySpace),e},getLocaleCurrencyBeforeAmount:function(){var e=!1;return void 0!==window.civLocaleCurrencyBeforeAmount&&null!==window.civLocaleCurrencyBeforeAmount&&(e=1==window.civLocaleCurrencyBeforeAmount||"true"==window.civLocaleCurrencyBeforeAmount||"1"==window.civLocaleCurrencyBeforeAmount),e},getMappedLocale:function(e,t){return e[t=void 0!==t?t:Utils.getLocale()]},getNumberFormatLocale:function(e){return Utils.getMappedLocale(numberFormatLocaleMapping,e)},getMomentLocale:function(e){return Utils.getMappedLocale(momentLocaleMapping,e)},getParsleyLocale:function(e){return Utils.getMappedLocale(parsleyLocaleMapping,e)},getZendeskLocale:function(e){return Utils.getMappedLocale(zendeskLocaleMapping,e)},getMapboxLocale:function(e){return Utils.getMappedLocale(mapBoxLocaleMapping,e)},getRegionFromLocale:function(e){return e=void 0!==e?e:Utils.getLocale(),i18n.localeToRegion[e]},translateAmmountAndCurrency:function(e,t,i){e=Utils.getNumberFormatLocale(e);var n=t.toLocaleString(e);return amountAndCurrencySymbolMapping[e].replace("{1}",n).replace("{2}",i)},getCurrencySymbolFromCurrency:function(e){i18n.currencySymbols[e];var t=i18n.currencySymbols[e];return void 0!==t?t:e},getCurrencySymbol:function(e){e=void 0!==e?e:window.currency;var t="undefined"!=typeof i18n&&void 0!==i18n.currencyToLocale&&null!==i18n.currencyToLocale?i18n.currencySymbols[e]:void 0,i=void 0!==window.currencyPorperties&&null!==window.currencyPorperties&&void 0!==window.currencyPorperties[e]&&null!==window.currencyPorperties[e]?window.currencyPorperties[e].symbol:void 0;return null!=t?t:i},getCurrencyTranslation:function(e){return e=void 0!==e?e:window.currency,void 0!==window.currencyPorperties&&null!==window.currencyPorperties&&void 0!==window.currencyPorperties[e]&&null!==window.currencyPorperties[e]?window.currencyPorperties[e].translation:""},getCurrencyFromSymbol:function(e){e="undefined"!=typeof currency?e:getCurrencySymbol();var t="";if("undefined"!=typeof i18n&&null!==i18n)for(var i in i18n.currencySymbols)i18n.currencySymbols.hasOwnProperty(i)&&i18n.currencySymbols[i]===e&&(t=i);for(var n in window.currencyPorperties)window.currencyPorperties.hasOwnProperty(n)&&window.currencyPorperties[n].symbol===e&&(t=n);return null!=t?t:""},getCurrencySmallCurrency:function(e){return e=void 0!==e?e:window.currency,void 0!==window.currencyPorperties&&null!==window.currencyPorperties&&void 0!==window.currencyPorperties[e]&&null!==window.currencyPorperties[e]&&void 0!==window.currencyPorperties[e].smallCurrency&&null!==window.currencyPorperties[e].smallCurrency&&window.currencyPorperties[e].smallCurrency},checkForCurrency:function(e){var t=window.currencyPorperties||{},i=null!=e&&""!==e,n=void 0!==t[e]&&null!==t[e];return i&&n},formatNumber:function(e,t,i){t=void 0!==t?t:window.currency;i=void 0!==i?i:numberFormatLocaleRegionMapping[Utils.getLocale()];var n=e%1;if("undefined"==typeof Intl)return e.toFixed(2).replace(/0+$/,"");var r=0==n||"fr_FR"!=i&&"en_GB"!=i?{useGrouping:!0}:{minimumFractionDigits:2,useGrouping:!0};return Intl.NumberFormat(i,r).format(e)},formatNumberWithFractionDigitsIfNotInteger:function(e,t,i){return t=void 0!==t?t:2,i=void 0!==i?i:Utils.getLocale(),i=Utils.getNumberFormatLocale(i),Number.isInteger(e)?e.toLocaleString(i,{minimumFractionDigits:0,maximumFractionDigits:0,useGrouping:!0}):e.toLocaleString(i,{minimumFractionDigits:t,maximumFractionDigits:t,useGrouping:!0})},formatNumberWithMaxFractionDigits:function(e,t,i){return e=Number(e),t=void 0!==t?t:2,i=void 0!==i?i:Utils.getLocale(),i=Utils.getNumberFormatLocale(i),e.toLocaleString(i,{maximumFractionDigits:t})},isActivityDetail:function(){return $("body").hasClass("page-activity-details")||$(".page-activity-details__inner").length>0},isCartConfirmation:function(){return!0===window.isCartConfirmation},isCommentsActivity:function(){return $(".main-comments-section").length>0},isCartPage:function(){return $("body").hasClass("is-booking-page")},isTransferSelection:function(){return $(".for-transfer-selection._transfer-selection-header").length>0},isNewLoading:function(){return!Utils.isInWebView()},loading:function(e){loadings[e]=!0,Utils.isNewLoading()?CivAPP.loader.showModal({}):$("body").addClass("is-loading")},miniLoading:function(e){$("body").addClass("is-loading_quick"),loadings[e]=!0},unLoading:function(e){setTimeout((function(){delete loadings[e],Utils.isEmptyObject(loadings)&&($("body").removeClass("is-loading is-loading_quick"),Utils.isNewLoading()&&CivAPP.loader.closeModal())}),0)},unLoadingAll:function(e){var t=void 0!==(e=void 0!==e?e:{}).callback?e.callback:Function.prototype,i=void 0!==e.delay?e.delay:0;window.setTimeout((function(){loadings={},$("body").removeClass("is-loading is-loading_quick"),Utils.isNewLoading()&&CivAPP.loader.closeModal(),t()}),i)},getParams:function(e){e=e.split("+").join(" ");for(var t,i={},n=/[?&]?([^=]+)=([^&]*)/g;t=n.exec(e);)i[decodeURIComponent(t[1])]=decodeURIComponent(t[2]);return i},getParam:function(e,t){void 0===t&&(t=window.location.href);try{e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var i=new RegExp("[\\?&]"+e+"=([^&#]*)").exec(t);return null===i?void 0:i[1]}catch(e){return}},addParam:function(e,t,i){return void 0===i&&(i=window.location.href),i=Utils.removeParam(e,i),i+=(i.split("?")[1]?"&":"?")+e+"="+t},addParams:function(e,t){for(var i in e)t=this.addParam(i,e[i],t);return t},removeParam:function(e,t){void 0===t&&(t=window.location.href);var i=t.split("?")[0],n=[],r=-1!==t.indexOf("?")?t.split("?")[1]:"";if(""!==r){for(var o=(n=r.split("&")).length-1;o>=0;o-=1)n[o].split("=")[0]===e&&n.splice(o,1);n.length>0&&(i=i+"?"+n.join("&"))}return i},getHashFromString:function(e){var t;try{t=new URL(e).hash}catch(i){t="#"+e.split("#")[1]}return t},getLocalEnv:function(){return[]},getStgEnv:function(){return["dev-gke"]},getStaticPath:function(e){e=void 0!==e?e:"";var t=document.location.host,i="/f";return-1!==t.indexOf(".civitatis.local")?i="https://cdn.civitatis.local/f":-1!==t.indexOf("local")&&(i="https://cdnlocal.civitatis.com/f"),i+e},getStaticPathWithQALocal:function(e){e=void 0!==e?e:"";var t="/f";return-1!==document.location.host.indexOf("local")&&(t="https://qa.civitatis.com/f"),t+e},getCivitatisLocationOrigin:function(){return-1!==document.location.host.indexOf("local")?"https://local.civitatis.com":-1!==document.location.host.indexOf("staging")?"https://staging.civitatis.com":-1!==document.location.host.indexOf("qa")?"https://qa.civitatis.com":-1!==document.location.host.indexOf("www.
1civitatis.com")?"https://www.civitatis.com":-1!==document.location.host.indexOf(".civitatis.com")?document.location.protocol+"//"+document.location.hostname:void 0},getEnv:function(){var e=document.location.hostname.split(".")[0];return-1!==document.location.host.indexOf("local")||-1!==Utils.getLocalEnv().indexOf(e)?"local":-1!==document.location.host.indexOf("staging")||-1!==Utils.getStgEnv().indexOf(e)?"staging":-1!==document.location.host.indexOf("qa")?"qa":-1!==document.location.host.indexOf(".civitatis.com")||Utils.isGuide()?"pro":void 0},getCivitatisHostPrefix:function(){return document.location.hostname.endsWith(".civitatis.local")?document.location.host:Utils.getEnvPrev()+".civitatis.com"},getEnvPrev:function(){return-1!==document.location.host.indexOf("local")?"local":-1!==document.location.host.indexOf("staging")?"staging":-1!==document.location.host.indexOf("qa")?document.location.hostname.split(".")[0]:-1!==document.location.host.indexOf("www.civitatis.com")?"www":-1!==document.location.host.indexOf(".civitatis.com")?document.location.hostname.split(".")[0]:"www"},isInWebView:function(){var e=window.navigator.standalone,t=window.navigator.userAgent.toLowerCase(),i=/safari/.test(t),n=/iphone|ipod|ipad/.test(t),r=-1!==t.indexOf("civitatis-ios-app"),o=-1!==t.indexOf("civitatis-android-app");return r||o||n&&!e&&!i},isIosApp:function(){var e=window.navigator.userAgent.toLowerCase();return Utils.isInWebView()&&-1!==e.indexOf("civitatis-ios-app")},isAndroidApp:function(){var e=window.navigator.userAgent.toLowerCase();return Utils.isInWebView()&&-1!==e.indexOf("civitatis-android-app")},hasMobileApp:function(e){return Utils.isInWebView()&&"undefined"!=typeof mobileApp&&(void 0===e||void 0!==e&&"function"==typeof mobileApp[e])&&Utils.setCartAppCivitatisAndGuideCheck()},hasWebKit:function(e){return Utils.isIosApp()&&void 0!==window.webkit&&void 0!==window.webkit.messageHandlers&&(void 0===e||void 0!==e&&void 0!==window.webkit.messageHandlers[e])&&Utils.setCartAppCivitatisAndGuideCheckWebKit()},returnAppVersion:function(e,t,i){window.navigator.standalone;var n=null!=i&&""!==i?i.toLowerCase():window.navigator.userAgent.toLowerCase(),r=(/safari/.test(n),/iphone|ipod|ipad/.test(n),n.indexOf("civitatis-ios-app"),n.indexOf("civitatis-android-app"),-1!==n.indexOf("com.civitatis.")&&-1===n.indexOf("com.civitatis.ios.civitatis")&&-1===n.indexOf("com.civitatis.civitatis")),o=Utils.isInWebView(),s=null,a=null,l=null;if(o)for(var c=n.split("/"),u=0;u<c.length;u++)-1===c[u].indexOf("civitatis-ios-app")&&-1===c[u].indexOf("civitatis-android-app")||(a=(s=c[u+1]).split("-"),s=a[0]),r&&-1!==c[u].indexOf("com.civitatis.")&&(l=c[u].replace("com.civitatis.ios.","").replace("com.civitatis.",""));var d="undefined"!==CivAPP.isGuide&&null!==CivAPP.isGuide&&!0===CivAPP.isGuide,f=null!=s&&Utils.isVersionStringSameOrUpper(s,e);return o&&f&&(!d||d&&(null==t||""===t||null!=t&&""!==t&&null!=l&&l==t))},isVersionStringSameOrUpper:function(e,t){var i=/^[0-9]+(\.[0-9]+)*$/,n=!1;if(i.test(e)&&i.test(t)){var r=Utils.versionArray(e),o=Utils.versionArray(t);Utils.compareVersionArray(r,o)&&(n=!0)}return n},versionArray:function(e){for(var t=e.split("."),i=new Array(t.length),n=0;n<t.length;n++)i[n]=parseInt(t[n]);return i},compareVersionArray:function(e,t){for(var i=0,n=!1,r=e.length<t.length?e.length:t.length;i<r&&0==n;)e[i]<t[i]&&(n=!0),i++;return!n},isBookingView:function(){return Utils.$("body").hasClass("is-booking-view")||null!==_UtilsCore__WEBPACK_IMPORTED_MODULE_1__.a.readCookie("debug-app")},sendMessageToApp:function(e,t){Utils.isIosApp()&&void 0!==window.webkit&&void 0!==window.webkit.messageHandlers&&void 0!==window.webkit.messageHandlers[e]?webkit.messageHandlers[e].postMessage(t):"undefined"!=typeof mobileApp&&"function"==typeof mobileApp[e]&&mobileApp[e](t)},getItunesUrlByLang:function(e){return{es:"https://apps.apple.com/es/app/civitatis-llena-tu-viaje/id1209079115",ar:"https://apps.apple.com/ar/app/civitatis-llena-tu-viaje/id1209079115",mx:"https://apps.apple.com/mx/app/civitatis-llena-tu-viaje/id1209079115",en:"https://apps.apple.com/us/app/civitatis-fill-your-trip/id1209079115",fr:"https://apps.apple.com/fr/app/civitatis-votre-voyage/id1209079115",it:"https://apps.apple.com/it/app/civitatis-il-tuo-viaggio
1/id1209079115",br:"https://apps.apple.com/br/app/civitatis-complete-sua-viagem/id1209079115",pt:"https://apps.apple.com/pt/app/civitatis-complete-sua-viagem/id1209079115"}[e]},isCartLoaded:function(){return $("#o-cart-buttons__container").length>0},md5:function(e){return md5__WEBPACK_IMPORTED_MODULE_3___default()(e)},scrollBodyToElement:function(e,t){t=void 0!==t?t:{},e=$(e);var i=void 0!==t.onlyUpwards&&t.onlyUpwards,n=void 0!==t.callback?t.callback:Function.prototype;if(0!==e.length){var r=e.offset().top;!i||window.pageYOffset>r?Utils.scrollBodyTo(r,t):n()}},scrollBodyTo:function(e,t){var i=void 0!==(t=void 0!==t?t:{}).duration?t.duration:500,n=void 0!==t.callback?t.callback:Function.prototype,r=t.hash,o=void 0!==t.topMargin?parseInt(t.topMargin):0,s=$(document).scrollTop();e-=o,null!=r&&(window.location.hash=r),$(document).scrollTop(s);$.when(("parentIFrame"in window&&window.parentIFrame.scrollToOffset(0,e),$("html, body").animate({scrollTop:e},i))).done((function(){n()}))},scrollToTop:function(){document.body.scrollTop=document.documentElement.scrollTop=0},scrollToBottom:function(){document.body.scrollTop=document.documentElement.scrollTop=document.body.scrollHeight-document.body.clientHeight},scrollWithHeader:function(e,t,i,n){e<(document.documentElement.scrollTop||document.body.scrollTop)&&(e-=72),Utils.scrollBodyTo(e,t,i,n)},initGoTos:function(e){(e=void 0!==e?$(e):$("body")).find(".js-link-to").each((function(){var e=$
1(this).attr("href");-1!==e.indexOf("#")&&(e="#"+e.split("#")[1],$(this).on("click",(function(t){t.preventDefault();var i=$(this).hasClass("js-link-to_upwards"),n=$(this).attr("data-js-link-offset-upwards"),r={};$(this).hasClass("_no-hash")||(r={hash:e}),i&&(CivAPP.Utils.isGuide()&&(n-=60),r.topMargin=n),CivAPP.Utils.scrollBodyToElement(e,r)})))}))},isInternalLink:function(e){try{return new URL(e).origin===location.origin}catch(e){return!0}},addTrailingSlashToUrl:function(e){var t=e.split("?")[0];t=t.endsWith("/")?t:t+"/";var i=e.split("?")[1];return t+(i=void 0!==i?"?".concat(i):"")},isValidLink:function(e){try{new URL(e);return!0}catch(e){return!1}},initJsLinks:function(){$(".js-link, .js-dropdown-b").not(".js-new-window-size").each((function(){var e=$(this),t=e.attr("data-loc"),i=e.attr("data-href");if(t||i){var n=t?atob(t):i;if(Utils.isValidLink(n)){if(Utils.isInternalLink(n)){var r=new URL(n),o=Utils.addTrailingSlashToUrl(r.pathname);n=r.origin+o+r.search}}else n=Utils.addTrailingSlashToUrl(n);if(void 0!==e.attr("data-seo-destination-link")){var s=String(Utils.tr("search.disambiguationUrl")||"").replace(/^\/+|\/+$/g,"");s&&(n=Object(_shared_utils_rewriteDestinationLinks__WEBPACK_IMPORTED_MODULE_7__.a)(n,s)||n)}if(void 0!==e.attr("data-to-anchor")){var a=this.createNewLink(e);return a.attr("rel","noindex nofollow"),this.replaceLinkWithNewLink(e,a),void e.attr("href",n)}e.css("cursor","pointer"),e.off("click.jsLink").on("click.jsLink",(function(t){if(e.hasClass("js-dropdown-b")){if($(t.target).closest(".js-dropdown-b-button, .o-archives__number").length>0)return;e.attr("data-target")?window.open(n,e.attr("data-target")):window.location.href=n}else e.attr("data-target")?window.open(n,e.attr("data-target")):window.location.href=n}))}}))},decodeHtml:function(e){var t=document.createElement("textarea");return t.innerHTML=e,t.value},decode:function(e){return e.replace(/&#(\d+);/g,(function(e,t){return String.fromCharCode(t)}))},stripScripts:function(e){var t=document.createElement("div");t.innerHTML=e;for(var i=t.getElementsByTagName("script"),n=i.length;n--;)i[n].parentNode.removeChild(i[n]);return t.innerHTML},stripHtml:function(e){var t=document.createElement("DIV");return t.innerHTML=e,t.textContent||t.innerText||""},exists:function(e){return $(e).length>0},isFiltersPage:function(){return this.exists("#activity-filters")},isCalendarPage:function(){return this.exists("#formReservaActividad__container")},fixCollaboratorLoginAutoComplete:function(){$("#login-name").closest(".u-floating-label--s").addClass("is-focused"),$("#login-password").closest(".u-floating-label--s").addClass("is-focused")},initCollaboratorTargetTrigger:function(){$(document).ready((function(){var e=Utils.getParam("target"),t=$("#login-collaborators-trigger");void 0!==e&&""!==e&&1===t.length&&(setTimeout((function(){Utils.fixCollaboratorLoginAutoComplete()}),200),t.hasClass("is-js-enabled")?(t.trigger("click"),setTimeout((function(){$("#login-name").focus()}),200)):t.addClass("js-auto-trigger"))}))},initCivTips:function(){var e=function(e){$(e).removeAttr("data-civtip"),$(e).attr("data-tooltip",!0),$(e).foundation(),$(e).trigger("mouseover")};$("body").off("mouseover.initcivtips"),$("body").on("mouseover.initcivtips","[data-civtip]",(function(t){e($(this))})),$("body").off("click.initcivtips"),$("body").on("click.initcivtips",'[data-civtip][data-tooltip-click="true"]',(function(t){e($(this))}))},getTooltipTemPlate:function(e){return'<div class="tooltip '+(e="string"==typeof e?e:"")+'" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>'},foundation:function(e,t){var i=null!=t&&t.length>0?$(t):$(document);""!==Foundation.MediaQuery.current&&!0!==e||$(i).foundation()},triggerResize:function(){var e=document.createEvent("UIEvents");e.initUIEvent("resize",!0,!1,window,0),window.dispatchEvent(e)},setFakeViewportWidth:function(e){var t=document.querySelector('meta[name="viewport"]'),i=window.innerWidth/e;t.setAttribute("data-is-fake-viewport","true"),t.content="width=".concat(e,",initial-scale=").concat(i,",maximum-scale=").concat(i,",minimum-scale=").concat(i,",user-scalable=no"),window.setTimeout((function(){t.removeAttribute("data-is-fake-viewport")}),500)},isFakeViewport:function(){return document.querySelector('meta[name="viewport"]').hasAttribute("data-is-fake-viewport")},refreshBlazy:function(){"undefined"!=typeof CivAPP&&("function"==typeof CivAPP.refreshBlazy?CivAPP.refreshBlazy():Utils.l("no hay CivAPP.refreshBlazy"))},setupLazyBgs:function(e){-1===(e=void 0!==e?e:[]).indexOf(".js-lazy-bg")&&e.push(".js-lazy-bg");var t=e.join();$(t).each((function(){$(this);
1var e=$(this)[0];new Waypoint({element:e,offset:"105%",handler:function(e){$(this.element).addClass("is-visible"),this.destroy()}})}))},initRatingStars:function(){$(".rating__stars:not(._loaded)").each((function(){var e=$(this),t=e.find(".rating__stars__full"),i=$('<span class="rating__stars__empty">î§î§î§î§î§</span>'),n=t.text();t.html('<span class="hide">'+n+"</span>î§î§î§î§î§"),t.before(i),e.addClass("rating__stars_loaded")})),$(".m-rating__stars:not(.m-rating__stars--loaded)").each((function(){var e=$(this),t=e.find(".m-rating__stars__empty"),i=e.find(".m-rating__stars__full"),n=i.text();t.html("î§î§î§î§î§"),i.html('<span class="hide">'+n+"</span>î§î§î§î§î§"),e.addClass("m-rating__stars--loaded")}))},initRating:function initRating(){var ratingMsgCSSClasses=["--very-bad","--bad","--regular","--good","--very-good"],ratingMsgCSSOverClasses=["--very-bad--hover","--bad--hover","--regular--hover","--good--hover","--very-good--hover"],initRatingDivs=function initRatingDivs(){Utils.$(".rating-module").each((function(index){var rated=null,$ratingModule=$(this),$stars=$(this).find(".rateit"),$msgs=$(this).find(".rating-msg"),initialMsg=$msgs.text(),actualValue=-1,$input=$($($stars).data("rateit-backingfld")),$selectedStars=$(this).find(".rateit-selected");$selectedStars.width($selectedStars.width()+2);var removeCSSClasses=function(){for(var e=0;e<ratingMsgCSSClasses.length;e++)$msgs.removeClass(ratingMsgCSSClasses[e])},removeCSSOverClasses=function(){for(var e=0;e<ratingMsgCSSOverClasses.length;e++)$msgs.removeClass(ratingMsgCSSOverClasses[e])},requiredConditionalElements=function requiredConditionalElements(value){var $requiredElementsCondition=$("[data-required-from-puntuation]");$($requiredElementsCondition).each((function(index,$element){var condition=$($element).attr("data-required-from-puntuation");condition=value+condition,eval(condition)?$($element).attr("required",!0):$($element).removeAttr("required")}))},minLengthConditionalElements=function minLengthConditionalElements(value){var $requiredElementsCondition=$("[data-minlength-from-puntuation]");$($requiredElementsCondition).each((function(index,$element){var auxArray=$($element).attr("data-minlength-from-puntuation");auxArray="string"==typeof auxArray?JSON.parse(auxArray):auxArray;var minLengthValue=auxArray[0],condition=auxArray[1];condition=value+condition,eval(condition)?$($element).attr("minlength",minLengthValue):$($element).removeAttr("minlength")}))},placeHolderConditional=function placeHolderConditional(value){var $placeHolderConditional=$("[data-placeholder-condition]");$($placeHolderConditional).each((function(index,$element){var originText=$($element).attr("data-placeholder-condition-origin-text"),conditionText=$($element).attr("data-placeholder-condition-text"),condition=$($element).attr("data-placeholder-condition");condition=value+condition,eval(condition)?$($element).html(conditionText):$($element).html(originText)}))};$stars.on("rated",(function(e,t){removeCSSClasses(),$ratingModule.addClass("--rated"),rated=t,initialMsg=Utils.tr("ratingMsg."+t),actualValue=t;var i='<div class="--inner">'+initialMsg+"</div>";$msgs.html(i),$msgs.addClass("rated"),$msgs.addClass(ratingMsgCSSClasses[t-1]),requiredConditionalElements(t),minLengthConditionalElements(t),placeHolderConditional(t)})),$stars.on("over",(function(e,t){removeCSSOverClasses();var i='<div class="--inner">'+Utils.tr("ratingMsg."+t)+"</div>";$msgs.html(i),$msgs.addClass(ratingMsgCSSOverClasses[t-1]),placeHolderConditional(t)})),$stars.on("mouseleave",(function(e){removeCSSOverClasses(),$msgs.html('<div class="--inner">'+initialMsg+"</div>"),placeHolderConditional(actualValue)})),$($stars).data("rateit-triggerclick")&&$stars.trigger("rated",[$($input).val()])}))};0!==Utils.$(".js-rateit").length&&(Utils.$(".js-rateit").rateit(),fontSpy("civ-icons",{success:function(){Utils.$(".js-rateit").rateit(),initRatingDivs()},failure:function(){Utils.$(".js-rateit").rateit(),initRatingDivs()}}),initRatingDivs(),$(window).on("resize",lodash_debounce__WEBPACK_IMPORTED_MODULE_2___default()((function(){Utils.$(".js-rateit").rateit(),initRatingDivs()}),100)))},initRating2:function initRating2(){var $radioRating=$('.m-super-radio--square._opinion [type="radio"]'),$initedRating=$($radioR
1ating).filter(":checked"),requiredConditionalElements=function requiredConditionalElements(value){var $requiredElementsCondition=$("[data-required-from-puntuation]");$($requiredElementsCondition).each((function(index,$element){var condition=$($element).attr("data-required-from-puntuation");condition=value+condition,eval(condition)?$($element).attr("required",!0):$($element).removeAttr("required"),$($element).parsley().validate()}))},minLengthConditionalElements=function minLengthConditionalElements(value){var $requiredElementsCondition=$("[data-minlength-from-puntuation]");$($requiredElementsCondition).each((function(index,$element){var auxArray=$($element).attr("data-minlength-from-puntuation");auxArray="string"==typeof auxArray?JSON.parse(auxArray):auxArray;var minLengthValue=auxArray[0],condition=auxArray[1];condition=value+condition,eval(condition)?$($element).attr("minlength",minLengthValue):$($element).removeAttr("minlength"),$($element).parsley().validate()}))};$initedRating.length>0&&(requiredConditionalElements($initedRating.val()),minLengthConditionalElements($initedRating.val())),$($radioRating).off("change.initRating2"),$($radioRating).on("change.initRating2",(function(){requiredConditionalElements($($radioRating).filter('[name="'+this.name+'"]:checked').val()),minLengthConditionalElements($($radioRating).filter('[name="'+this.name+'"]:checked').val())}))},swapElements:function(e,t){var i=0!==$("#utils_swapper").length?$("#utils_swapper"):$('<div id="utils_swapper">');t.after(i);var n=t.detach();e.after(n);n=e.detach();i.after(n),i.remove()},onElementOutsideClick:function(e,t,i){e="string"==typeof e?$(e):e,i=void 0!==i?i:Function.prototype,t=void 0!==t?t:Function.prototype;var n=Utils.setIdIfNotId(e);$(document).on("click focusin",(function e(r){$(r.target).closest("#"+n).length?i():(t(),$(document).off("click",e))}))},$:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e){return void 0===$cache[e]&&($cache[e]=$(e)),$cache[e]}
1)),$clear:function(e){delete $cache[e]},$fresh:function(e){return _this2.$clear(e),_this2.$(e)},sessionStorage:{test:function(){var e=Utils.generateId("str");try{return localStorage.setItem(e,e),localStorage.getItem(e),localStorage.removeItem(e),!0}catch(e){return!1}},getItem:function(e,t){var i=!0===t?localStorage:sessionStorage;return JSON.parse(i.getItem(e))},setItem:function(e,t,i){var n=!0===i?localStorage:sessionStorage;try{n.setItem(e,JSON.stringify(t))}catch(e){}},removeItem:function(e,t){(!0===t?localStorage:sessionStorage).removeItem(e)},clear:function(e){(!0===e?localStorage:sessionStorage).clear()}},equalizer:{init:function(){Utils.equalizer.equalizeDefaults(),$(window).on("resize",lodash_debounce__WEBPACK_IMPORTED_MODULE_2___default()((function(){Utils.equalizer.equalizeDefaults()}),400))},equalizeDefaults:function(){var e=$(".js-equalizer");Utils.equalizer.equalize(e,"js-equalizer__item")},equalize:function(e,t){(e="string"==typeof e?$(e):e).each((function(){var e=$(this).find("."+t),i=0;e.each((function(){$(this).height("auto")}
1)),e.each((function(){var e=$(this).height();e>i&&(i=e)})),e.height(i)}))}},initDropdowns:function(){var e=Utils.$("body");e.find(".js-dropdown-b").each((function(){var e=$(this),t=$('<i class="js-dropdown-b-button">'),i=(e.next(),!0);e.prepend(t),t.off("click.dropdownb"),t.on("click.dropdownb",(function(t){t.preventDefault(),i?(i=!1,e.addClass("_is-visible")):(i=!0,e.removeClass("_is-visible"))}))})),e.find(".js-dropdown").each((function(){var t=$(this),i=void 0!==$(t).data("target")&&null!==$(t).data("target")&&""!==$(t).data("target")?$("#"+$(t).data("target")):t.next(),n=$(),r=t.attr("data-dropdown-parent-class-selector");"string"==typeof r&&""!==r&&(n=t.closest(r)),t.hasClass("js-dropdown-opened")||t.hasClass("js-dropdown-minus")?(n.removeClass("_is-closed"),n.addClass("_is-opened"),i.removeClass("v--hidden"),i.css("display","block"),t.hasClass("js-dropdown-minus")||t.addClass("js-dropdown-minus")):(n.addClass("_is-closed"),n.removeClass("_is-opened"),i.addClass("v--hidden"),i.css("display","none")),t.off("click.dropdown"),t.on("click.dropdown",(function(r){if(r.preventDefault(),t.hasClass("js-dropdown-mobile")&&!_UtilsCore__WEBPACK_IMPORTED_MODULE_1__.a.isMobile())return!1;"open"===(i.hasClass("v--hidden")?"open":"close")?(n.removeClass("_is-closed"),n.addClass("_is-opened"),i.removeClass("v--hidden"),t.addClass("js-dropdown-minus"),i.hasClass("share-social-widget__body")?i.fadeIn(200):i.slideDown(),void 0!==t.data("dropdown")&&null!==t.data("dropdown")&&""!==t.data("dropdown")?e.find('.js-dropdown.js-dropdown-minus[data-dropdown="'+t.data("dropdown")+'"]').not(t).trigger("click.dropdown"):void 0!==t.data("dropdown-global")&&null!==t.data("dropdown-global")&&""!==t.data("dropdown-global")?e.find('.js-dropdown.js-dropdown-minus[data-dropdown-global="'+t.data("dropdown-global")+'"]').not(t).trigger("click.dropdown"):e.find(".js-dropdown.js-dropdown-collapse-outside.js-dropdown-minus").not(t).trigger("click.dropdown")):(n.addClass("_is-closed"),n.removeClass("_is-opened"),i.addClass("v--hidden"),t.removeClass("js-dropdown-minus"),i.hasClass("share-social-widget__body")?i.fadeOut(200):i.slideUp())}))})),Utils.clickOutsideJsDropdownSocial(e)},clickOutsideJsDropdownSocial:function(e){(e=$(null!=e)?e:Utils.$("body")).find(".js-dropdown.js-dropdown-collapse-outside").length>0&&($(e).off("click.clickOutside"),$(e).on("click.clickOutside",(function(e){$(e.target).hasClass("js-dropdown-collapse-outside")||0!=$(e.target).parents(".js-dropdown-collapse-outside").length||0!=$(e.target).filter("[data-dropdown-content]").siblings(".js-dropdown-collapse-outside").length||0!=$(e.target).parents("[data-dropdown-content]").siblings(".js-dropdown-collapse-outside").length||$(".js-dropdown-collapse-outside").filter(".js-dropdown-minus").each((function(e,t){$(t).trigger("click.dropdown")}))})))},i18n:{_arguments:null,_function:function(e,t,i,n){var r=Utils.i18n._arguments[t];return void 0!==r?r:" "},translate:function(e){if("undefined"==typeof Ls)return"faltan traducciones";var t=Ls[e];if(void 0!==t){if(-1===t.toString().indexOf("{"))return t;Utils.i18n._arguments=arguments;var i=t.replace(/{(.)}/g,Utils.i18n._function);return Utils.i18n._arguments=null,i}return Utils.l("sin traducir: "+e),""}},tr:function(e){for(var t,i=arguments.length,n=new Array(i>1?i-1:0),r=1;r<i;r++)n[r-1]=arguments[r];return(t=Utils.i18n).translate.apply(t,[e].concat(n))},trWithNumber:function(e,t){for(var i,n,r,o=e+"_plural",s=1!==t?o:e,a=1!==t?e:o,l=arguments.length,c=new Array(l>2?l-2:0),u=2;u<l;u++)c[u-2]=arguments[u];return void 0!==(n=(i=Utils.i18n).translate.apply(i,[s].concat(c)))&&""!==n?n:void 0!==(n=(r=Utils.i18n).translate.apply(r,[a].concat(c)))&&""!==n?n:void 0},removeDiacritics:function(e){return void 0===e?"":e.replace(/[^\u
10000-\u007E]/g,(function(e){return diacriticsMap[e]||e}))},userAgent:function(){var e=navigator.userAgent||navigator.vendor||window.opera;return/android/i.test(e)?"android":/iPad|iPhone|iPod/.test(e)&&!window.MSStream?"ios":"unknown"},detectIE:function(){var e=window.navigator.userAgent;if(e.indexOf("MSIE ")>0)return!0;if(e.indexOf("Trident/")>0){e.indexOf("rv:");return!0}return e.indexOf("Edge/")>0},isElementInViewport:function(e){var t=e[0].getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth)},inViewport:function(e){if(void 0===e[0])return!1;var t=e.outerHeight(),i=$(window).height(),n=e[0].getBoundingClientRect(),r=n.top,o=n.bottom;return Math.max(0,r>0?Math.min(t,i-r):o<i?o:i)},isWebkit:function(){return-1!=navigator.userAgent.indexOf("AppleWebKit")},isGuide:function(){return $("body").hasClass("is-guide")},isAffiliatesPanel:function(){return 0!==$("#civ-affiliates").length},isAggenciesPanel:function(){return 0!==$("#civ-agencies").length},isNewUserPanel:function(){return Utils.$("body").hasClass("--new-client-panel")}},_defineProperty(_Utils,"decodeHtml",(function(e){if(void 0===e||null==e||""===e)return"";var t,i=(new DOMParser).parseFromString("<!doctype html><body>"+e,"text/html");try{t=i.body.textContent}catch(i){t=e.replace(/&#(\d+);/g,(function(e,t){return String.fromCharCode(t)}))}return t})),_defineProperty(_Utils,"getFlightDate",(function(e){var t=(e=Utils.getMoment(e,"YYYY-MM-DD")).format("DD"),i=e.format("MMMM");return $('<span class="datepicker-custom__date">'+t+'</span><span class="datepicker-custom__month">'+i+"</span>")})),_defineProperty(_Utils,"getFlightDateEmpty",(function(){return'<span class="datepicker-custom__empty">+</span>'})),_defineProperty(_Utils,"getUrlParams",(function(e){for(var t,i={},n=e.slice(e.indexOf("?")+1).split("&"),r=0;r<n.length;r++)i[(t=n[r].split("="))[0]]=t[1];return i})),_defineProperty(_Utils,"getUrlWithoutParams",(function(e){return e.split("?")[0]})),_defineProperty(_Utils,"setCartAppCivitatisAndGuideCheck",(function(){var e=void 0!==CivAPP.isInMobileApp&&null!==CivAPP.isInMobileApp&&CivAPP.isInMobileApp,t=void 0!==CivAPP.isGuide&&null!==CivAPP.isGuide&&CivAPP.isGuide,i=void 0!==CivAPP.isSpecificCivitatis&&null!==CivAPP.isSpecificCivitatis&&CivAPP.isSpecificCivitatis,n=void 0!==CivAPP.isSpecificGuide&&null!==CivAPP.isSpecificGuide&&CivAPP.isSpecificGuide;return e&&(!t&&(void 0===CivAPP.isSpecificCivitatis||i)||t&&(void 0===CivAPP.isSpecificGuide||n))})),_defineProperty(_Utils,"setCartAppCivitatisAndGuideCheckWebKit",(function(){var e=void 0!==CivAPP.isInMobileApp&&null!==CivAPP.isInMobileApp&&CivAPP.isInMobileApp,t=void 0!==CivAPP.isGuide&&null!==CivAPP.isGuide&&CivAPP.isGuide,i=void 0!==CivAPP.isSpecificCivitatisWebkit&&null!==CivAPP.isSpecificCivitatisWebkit&&CivAPP.isSpecificCivitatisWebkit,n=void 0!==CivAPP.isSpecificGuideWebkit&&null!==CivAPP.isSpecificGuideWebkit&&CivAPP.isSpecificGuideWebkit;return e&&(!t&&(void 0===CivAPP.isSpecificCivitatis||i)||t&&(void 0===CivAPP.isSpecificGuide||n))})),_defineProperty(_Utils,"returnNumberWithParams",(function(e,t,i,n,r){var o="",s="",a=Utils.getLocale(),l=Utils.getCurrencyFromSymbol(t),c=!!r||Utils.getCurrencySmallCurrency(l);i=null!=i?i:Utils.getLocaleCurrencySpace(),n=null!=n?n:Utils.getLocaleCurrencyBeforeAmount(),null!=c&&1==c&&(o="<span>",s="</span>");var u=/^[a-zA-Z]+$/.test(t);return!n||u&&("en"==a||"mx"==a||"ar"==a)?i?e+" "+o+t+s:e+""+o+t+s:i?o+t+s+" "+e:o+t+s+""+e})),_defineProperty(_Utils,"getAllAttributes",(function(e){var t={},i=$(e)[0];return null!=i&&$.each(i.attributes,(function(e,i){t[i.name]=i.value})),t})),_defineProperty(_Utils,"removeAllAttributes",(function(e){var t=Utils.getAllAttributes(e);$.each(t,(function(t,i){$(e).removeAttr(t)}))})),_defineProperty(_Utils,"getCartMessageErrorService",(function(){var e=Utils.tr("contactUrl");return $("body").hasClass("is-guide")||(e="/"+Utils.getLocale()+e),Utils.tr("civitatis_cartMessageErrorService",e)})),_defineProperty(_Utils,"regexArrayString",(function(e){return/\[(\"!?[a-zA-Z0-9\-\_]*\"\,)*(\"!?[a-zA-Z0-9\-\_]*\")\]/g.test(e)})),_defineProperty(_Utils,"tooltipHtml",(function(e){var t=CivAPP.Utils.readCookie("sutr"),i=!0===t||"true"===t||"1"===t||1===t;$('[data-tooltip][data-allow-html="true"], [data-civtip][data-allow-html="true"]').not("._processed").each((function(){var e=$
1(this);if(e.addClass("_processed"),i){var t=$("#"+$(e).attr("data-toggle")),n=Utils.decodeHtml(t.html());$(t).html(n)}e.on("show.zf.tooltip.html",(function(){var t=$("#"+$(this).attr("data-toggle"));if(!i){var n=Utils.decodeHtml(t.html());$(t).html(n)}var r=function e(){t.is(":visible")&&$(t).css("display","none"),window.removeEventListener("resize",e)};e.off("click.resizeHandler"),e.on("click.resizeHandler",(function(){window.addEventListener("resize",r)})),$(this).off("show.zf.tooltip.html")}))}))})),_defineProperty(_Utils,"tooltipPreventDefault",(function(){$('[data-tooltip], [data-civtip][data-tooltip-click="true"]').each((function(e,t){var i=$(t).closest("a");i.length>0&&($(i).off("click.tooltipdefault"),$(i).on("click.tooltipdefault",(function(e){(Utils.isTouchDevice()&&!Utils.isHoverDevice()||$(e.target).filter('[data-click-inside="true"]').length>0)&&$(e.target).filter("[data-tooltip]").length>0&&e.preventDefault()})))}))})),_defineProperty(_Utils,"tooltipAllowClickInside",(function(){$('[data-tooltip][data-click-inside="true"]').not("._processed-click").each((function(){var e=$
1(this);setTimeout((function(){e.addClass("_processed-click"),$("#"+$(e).attr("data-toogle")).addClass("_processed-click")}))})),setTimeout((function(){$("body").off("mouseenter.tooltipClick"),$("body").on("mouseenter.tooltipClick",'[data-tooltip][data-click-inside="true"]',(function(){})),$("body").off("mouseleave.tooltipClick"),$("body").on("mouseleave.tooltipClick",".tooltip.landing-register-note._small",(function(){}))}))})),_defineProperty(_Utils,"executeScriptElement",(function executeScriptElement($script,callback){callback=void 0!==callback&&"function"===callback?callback:function(){},void 0!==$($script).attr("src")&&null!==$($script).attr("src")?setTimeout((function(){$.getScript($($script).attr("src"),callback)})):eval($($script).text())})),_defineProperty(_Utils,"loadScripts",(function(e){var t=$.map(e,(function(e){return $.getScript(e)}));return t.push($.Deferred((function(e){$(e.resolve)}))),$.when.apply($,t)})),_defineProperty(_Utils,"loadScript",(function(e,t,i,n,r,o){n="0"!==Utils.getParam("cssPreloadJs")&&("boolean"!=typeof n||n),r=null!=r&&"object"==_typeof(r)&&Object.keys(r).length>0?r:{},o=null!=o&&"object"==_typeof(o)&&Object.keys(o).length>0?o:{};var s=document.getElementsByTagName("head")[0],a=document.createElement("script");if("string"==typeof t){var l=document.createElement("link");l.title="not-loaded",l.href=t;var c=function(){"not-loaded"===l.title&&(l.title="is-loaded",l.rel="stylesheet")};n?(l.rel="preload",l.as="style",l.crossOrigin="anonymous",l.onload=function(){"not-loaded"===l.title&&(l.title="is-loaded",l.rel="stylesheet",l.onload=Function.prototype)},$.each(Object.keys(o),(function(e,t){l.setAttribute(t,o[t])})),s.appendChild(l),"complete"===document.readyState&&c(),$(window).on("load",(function(){c()}))):(l.rel="stylesheet",$.each(Object.keys(o),(function(e,t){l.setAttribute(t,o[t])})),s.appendChild(l))}function u(){i&&(i(),a.onload=a.onreadystatechange=null,i=null)}a.type="text/javascript",a.onload=u,a.onreadystatechange=function(){"complete"===this.readyState&&u()},a.src=e,$.each(Object.keys(r),(function(e,t){a.setAttribute(t,r[t])})),s.appendChild(a)})),_defineProperty(_Utils,"insertAfter",(function(e,t){e.parentNode.insertBefore(t,e.nextSibling)})),_defineProperty(_Utils,"switcherProfileLinks",(function(){var e=$
1(".o-profiles-switch .__switch .__item:not(._active) > a"),t=$(".o-profiles-switch .__switch .__item._active > a");$(e).length>0&&(CivAPP.forceEmailScript=!0),$(e).off("click.switcherProfileLinks"),$(e).on("click.switcherProfileLinks",(function(e){e.preventDefault();var t=$(this),i=void 0!==$(t).data("pass")&&(1==$(t).data("pass")||"true"==$(t).data("pass")||"1"==$(t).data("pass")),n=$(t).attr("href"),r=void 0!==$(t).data("typology")&&null!==$(t).data("typology")&&""!==$(t).data("typology")?parseInt($(t).data("typology")):null,o=void 0!==$(t).data("email")&&null!==$(t).data("email")&&""!==$(t).data("email")?$(t).data("email"):null;if(i){var s={title:Utils.tr("loginOptionSelectTypology_title"+r),action:n};null!==r&&(s.typology=r),CivAPP.ConfirmUtil.changeProfile(s,o)}else 2!=r&&Utils.clearUserSessionFromLocalStorage(),window.location.href=n})),$(t).off("click.switcherProfileLinks"),$(t).on("click",(function(e){e.preventDefault()}))})),_defineProperty(_Utils,"slugify",(function(e){var t="à áâäæãåÄÄÄ
çÄÄÄÄèéêëÄÄÄÄÄǵḧîïÃīįìÅḿñÅǹÅôöòóÅøÅõÅá¹ÅÅÃÅÅ¡ÅÈÅ¥ÈûüùúūÇůűųáºáºÃ¿Ã½Å¾ÅºÅ¼Â·/_,:;",i=new RegExp(t.split("").join("|"),"g");return e.toString().toLowerCase().replace(/\s+/g,"-").replace(i,(function(e){return"aaaaaaaaaacccddeeeeeeeegghiiiiiilmnnnnoooooooooprrsssssttuuuuuuuuuwxyyzzz------".charAt(t.indexOf(e))})).replace(/&/g,"-and-").replace(/[^\w\-]+/g,"").replace(/\-\-+/g,"-").replace(/^-+/,"").replace(/-+$/,"")})),_defineProperty(_Utils,"removeDuplicatesFromArray",(function(e){for(var t={},i=e.length-1;i>=0;i--){var n=JSON.stringify(e[i]);t[n]?e.splice(i,1):t[n]=!0}return e})),_defineProperty(_Utils,"capitalizeFirstLetter",(function(e){return e.charAt(0).toUpperCase()+e.slice(1)})),_defineProperty(_Utils,"capitalizeAll",(function(e){for(var t=e.split(" "),i=0;i<t.length;i+=1)t[i]=t[i].charAt(0).toUpperCase()+t[i].slice(1);return t.join(" ")})),_defineProperty(_Utils,"lowercaseFirstLetter",(function(e){return e.charAt(0).toLowerCase()+e.slice(1)})),_defineProperty(_Utils,"htmlTextAreaFormat",(function(e){return e.replace(/\n/g,"<br />")})),_defineProperty(_Utils,"isInArray",(function(e,t){var i=!1;return $.each(t,(function(t,n){n==e&&(i=!0)})),i})),_defineProperty(_Utils,"camelcaseToUnderscore",(function(e){return e.replace(/\.?([A-Z])/g,(function(e,t){return"_"+t.toLowerCase()})).replace(/^_/,"")})),_defineProperty(_Utils,"underscoreToCamelcase",(function(e){return e.replace(/([-_][a-z])/gi,(function(e){return e.toUpperCase().replace("-","").replace("_","")}))})),_defineProperty(_Utils,"isUrlString",(function(e){return/(http(s)?:\/\/.)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/.test(e)}
1)),_defineProperty(_Utils,"radioOpenClass",(function(){var e=$(".js-radio-open");e.length>0&&e.each((function(e,t){var i=$('input[type="radio"]');i.off("change.radioOpenClass"),i.on("change.radioOpenClass",(function(){var e=$(this),t=$(e).attr("name");$('[name="'+t+'"]').filter(":checked").length,$("body").addClass("_radio-opened-"+t)}))}))})),_defineProperty(_Utils,"reloadChangeMediaQuery",(function(){if("true"!==new URLSearchParams(window.location.search).get("optimizely_editor")){var e=$("._r-mq").length>0,t=$("._r-mq-all").length>0,i=$("._r-mq-n-l").length>0;if(e||t){var n=function(e){return"small"==e||"medium"==e},r=function(e){return"small"!==e&&"medium"!==e};$(window).on("changed.zf.mediaquery",(function(e,o,s){if(console.log("changed.zf.mediaquery U1"),Utils.isFakeViewport())console.log("U1 - return FKV");else{var a=!0;_UtilsCore__WEBPACK_IMPORTED_MODULE_1__.a.isIphone()&&"number"==typeof window.originalWidth&&(a=window.originalWidth!==window.innerWidth),a?(t||n(o)&&r(s)||n(s)&&r(o))&&(i||Utils.loading(),console.log("U1 - reload"),_UtilsCore__WEBPACK_IMPORTED_MODULE_1__.a.isIphone()&&(console.log("ow - "+window.originalWidth),console.log("iw - "+window.innerWidth)),document.location.reload()):console.log("U1 - return notc")}}))}}})),_defineProperty(_Utils,"isNewCityViewFunction",(function(){return!!window.isNewCityView})),_defineProperty(_Utils,"removeOverlayParameter",(function(e,t){e=null!=e?e:window.location.href,t=null!=t?t:"login",Utils.getParam(t,e)&&history.replaceState({},document.title,Utils.removeParam(t,e))})),_defineProperty(_Utils,"removeContentIframeAffiliate",(function(){if(self===top&&$("body").hasClass("--iframe")){Utils.l("se va a borrar cookie aid");var e=window.location.href;e=CivAPP.Utils.removeParam("aid",e),e=CivAPP.Utils.removeParam("iframeUI",e),document.cookie="aid=;path=/;expires="+new Date(0).toUTCString(),document.cookie="aid=;path=/;domain=.civitatis.com; expires="+new Date(0).toUTCString(),document.cookie="aid=;path=/;domain=www.civitatis.com; expires="+new Date(0).toUTCString(),setTimeout((function(){location.replace(e)}))}else Utils.l("no se borra cookie aid")})),_defineProperty(_Utils,"isElementVisible",(function(e){return null!=e&&$(e).length>0&&($(e).is(":visible")||$(e).closest(".v--hidden").length>0&&0==$(e).filter("[data-depends-on]").length&&0==$(e).closest("[data-depends-on]").length||$(e).closest(".v--hidden").length>0&&$(e).filter("[data-depends-on]").length>0&&"none"!==$(e).css("display")||$(e).closest(".v--hidden").length>0&&$(e).closest("[data-depends-on]").length>0&&"none"!==$(e).closest("[data-depends-on]").css("display"))})),_defineProperty(_Utils,"getCopyFormDataSufix",(function(){return"_copyInputFinal"})),_defineProperty(_Utils,"replaceCopyFormData",(function(e){var t=Utils.cloneFullObject(e);return $.each(Object.keys(t),(function(t,i){if(-1!==i.indexOf(Utils.getCopyFormDataSufix())){var n=i.replaceAll(Utils.getCopyFormDataSufix(),"");e[n]=e[i],delete e[i]}})),e})),_defineProperty(_Utils,"normalizeStringSpecialCharacters",(function(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"")})),_defineProperty(_Utils,"hideTooltipWithTimer",(function(e){$("body").addClass("_with-"+e+"_transparent"),Utils.sessionStorage.setItem(e,"1",!0),$("body").off("click."+e),$("body").removeClass("_with-"+e),setTimeout((function(){$("#"+e+", #"+e+"-overlay").remove()}),1e3)})),_defineProperty(_Utils,"showTooltipWithTimerTrigger",(function(e,t,i,n){(i&&"map"!==n||!i)&&($("body").addClass("_with-"+e),$("body").on("click."+e,"#"+e+", #"+e+"-overlay",(function(){$("body").removeClass("_with-"+e),Utils.hideTooltipWithTimer(e)})),setTimeout((function(){Utils.hideTooltipWithTimer(e)}),1e3*t))})),_defineProperty(_Utils,"showTooltipWithTimer",(function(e,t,i){if(t=null!=t&&(1==t||"true"==t||"1"==t),i=null!=i&&""!==i?i:"",!Utils.sessionStorage.test())return $("body").addClass("_with-"+e),void $("body").addClass("_with-"+e+"_transparent");if(!t||void 0!==window.cityCoordinates&&void 0!==window.cityCoordinates.latitude&&""!==window.cityCoordinates.latitude&&void 0!==window.cityCoordinates.longitude&&""!==window.cityCoordinates.longitude){if(null==Utils.sessionStorage.getItem(e,!0))var n="lwtooltip"!==e&&$("#lwtooltip").length>0,r=n?5e3:0,o=0,s=setInterval((function(){r>0&&o<r?!n||n&&$("._with-lwtooltip_transparent").length>0?(clearInterval(s),setTimeout((function(){Utils.showTooltipWithTimerTrigger(e,5,t,i)}))):o+=100:(clearInterval(s),setTimeout((function(){Utils.showTooltipWithTimerTrigger(e,5,t,i)})))}),100);else $("body").addClass("_with-"+e),Utils.hideTooltipWithTimer(e)}})),_defineProperty(_Utils,"isJsonString",(function(e){try{JSON.parse(e)}catch(e){return!1}return!0})),_defineProperty(_Utils,"mergeIfMultipleFilesAndRemoveDuplicates",(function(e){var t=e.file,i=e.multiple,n=void 0===i||i,r=e.myAcceptedFiles,o=void 0===r?[]:r,s=n&&o.length>0?[].concat(_toConsumableArray(o),[t]):[t];return this.removeDuplicatesFromArray(s)})),_defineProperty(_Utils,"acceptImgFormats",(function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=["tif","tiff","webp"],n=["jpg","jpeg","gif","png","heif","heic"].concat(_toConsumableArray(t?i:[]));return e?n:n.map((function(e){return".".concat(e)})).join(", ")})),_defineProperty(_Utils,"acceptDocFormats",(function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=["ppt","pptx","txt"],n=["doc","docx","pdf","xlsx","xsl"].concat(_toConsumableArray(t?i:[]));return e?n:n.map((function(e){return".".concat(e)})).join(", ")})),_defineProperty(_Utils,"convertFileToImgSrc",(function(e){var t=e.file,i=e.maxSize,n=void 0===i?8388608:i,r=e.minWidth,o=e.callback,s=void 0===o?Function.prototype:o,a=URL.createObjectURL(t),l=new Image,c=t.size,u=(t.type,_slicedToArray(t.name.split("."),2)),d=(u[0],u[1]),f=this.acceptImgFormats(!0).includes(d);return l.onload=function(){c>n?"undefined"!=typeof CivAPP&&null!==CivAPP&&void 0!==CivAPP.ConfirmUtil&&null!==CivAPP.ConfirmUtil&&CivAPP.ConfirmUtil.showError({message:Utils.tr("maxSizeWarning","".concat(n/1024/1024,"MB"))}):f?r&&this.width<r?"undefined"!=typeof CivAPP&&null!==CivAPP&&void 0!==CivAPP.ConfirmUtil&&null!==CivAPP.ConfirmUtil&&CivAPP.ConfirmUtil.showError({message:Utils.tr("minWidthWarning",r)}):(Object.assign(t,{preview:a}),s(this)):"undefined"!=typeof CivAPP&&null!==CivAPP&&void 0!==CivAPP.ConfirmUtil&&null!==CivAPP.ConfirmUtil&&CivAPP.ConfirmUtil.showError({message:Utils.tr("imageFileTypeWarning")})},l.src=a,{img:l,myurl:a}})),_defineProperty(_Utils,"getBase64",(function(e){return new Promise((function(t,i){var n=new FileReader;n.readAsDataURL(e),n.onload=function(){return t(n.result)},n.onerror=function(e){return i(e)}}))})),_defineProperty(_Utils,"isActiveTest",(function(e){var t=Utils.readCookie("ABTastyEnabledTests");return!(!t||!e)&&t.split(",").map((function(e){return e.trim()})).includes(e)})),_defineProperty(_Utils,"getABTastyEnabledTests",(function(){return void 0!==window.ABTasty&&null!==window.ABTasty?Object.keys(window.ABTasty.getTestsOnPage()):[]})),_defineProperty(_Utils,"setABTastyEnabledTestsCookie",(function(){var e=function(e){var t=[];for(var i in e)if(Object.hasOwnProperty.call(e,i)){var n=e[i],r=n.variationName,o=n.status;"original"!==r&&"accepted"===o&&t.push(i)}Utils.readCookie("ABTastyEnabledTests")!==t.toString()&&(Utils.createCookie("ABTastyEnabledTests",t.toString()),window.location.reload())},t=0,i=setInterval((function(){if(t<3e3)if(void 0!==window.ABTasty&&null!==window.ABTasty){clearInterval(i);var n=0,r=setInterval((function(){var t="function"==typeof window.ABTasty.getTestsOnPage?window.ABTasty.getTestsOnPage():null;n<5e4?null!=t&&"object"===_typeof(t)&&Object.keys(t).length>0?(clearInterval(r),e(t)):n+=100:(clearInterval(r),e(t))}),50)}else t+=100;else clearInterval(i)}),50)})),_defineProperty(_Utils,"deleteABTastyEnabledTestsCookie",(function(){Utils.deleteCookie("ABTastyEnabledTests")})),_defineProperty(_Utils,"convertProblematicImgFormatsToJpg",(function(e,t){var i=function(){"undefined"!=typeof CivAPP&&null!==CivAPP&&void 0!==CivAPP.ConfirmUtil&&null!==CivAPP.ConfirmUtil&&CivAPP.ConfirmUtil.showError({message:Utils.tr("addImage_error")})};e.map((function(e){if(null!=e){Utils.loading();var n=_slicedToArray(e.name.split("."),2),r=n[0];switch(n[1]){case"heif":case"heic":var o=new FormData,s=e._removeLink,a=e.accepted,l=void 0===a||a,c=e.previewElement,u=e.previewTemplate,d=(e.status,e.upload);o.append("file",e),fetch("https://image.civitatis.com/convert/format",{method:"POST",body:o}).then((function(e){return e.blob()})).then((function(e){var i="".concat(r,".jpg"),n=new File([e],i,{type:"image/jpeg"}),o=Utils.convertFileToImgSrc({file:n}),a=o.img;o.myurl;Utils.getBase64(n).then((function(e){if(n._removeLink=s,n.accepted=l,n.dataURL=e,n.path=i,n.previewElement=c,n.previewTemplate=u,n.status="queued",n.height=a.height,n.width=a.width,null!=d){var r=d.uuid,o=d.progress,f=d.bytesSent,h=d.chunked,p=d.totalChunkCount;n.upload=_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({},r&&{uuid:r}),o&&{progress:o}),f&&{bytesSent:f}),h&&{chunked:h}),p&&{totalChunkCount:p}),{},{total:n.size,filename:i})}Utils.unLoadingAll(),t(n)}))})).catch((function(e){Utils.unLoadingAll(),i()}));break;default:Utils.unLoadingAll(),t(e)}}else i()}))})),_defineProperty(_Utils,"getElementPosition",(function(e){try{if(!e)throw Error("Element does not exist.");var t=e.getBoundingClientRect();if(0===t.width||0===t.height)throw Error("Element is not visible in the viewport.");var i=window.scrollY||window.pageYOffset;return{top:t.top+i,left:t.left,bottom:t.bottom+i,right:t.right}}catch(e){return null}})),_defineProperty(_Utils,"fixedElementsFromElement",(function(e){try{if(e){var t=Utils.getElementPosition(e);
1if(t&&null!==t.top){var i=document.body.getBoundingClientRect().height-t.top,n=document.getElementById("zendeskAux"),r=document.querySelector("iframe#launcher");n&&n.style.setProperty("bottom","".concat(i,"px"),"important"),r&&r.style.setProperty("bottom","".concat(i,"px"),"important")}}}catch(e){}})),_defineProperty(_Utils,"removeFixedElementsFromElement",(function(){try{var e=document.getElementById("zendeskAux"),t=document.querySelector("iframe#launcher");e&&e.style.removeProperty("bottom"),t&&t.style.removeProperty("bottom")}catch(e){}})),_defineProperty(_Utils,"formatPromoText",(function(e){var t,i=null,n=_createForOfIteratorHelper(e.split(","));try{for(n.s();!(t=n.n()).done;){var r=t.value.trim();if(i){var o=Utils.tr(r)?Utils.tr(r):r;i+=", ".concat(o)}else{i=Utils.tr(r)?Utils.tr(r):r}}}catch(e){n.e(e)}finally{n.f()}return i})),_defineProperty(_Utils,"getTextAccordingToActivationDate",(function(e){if(!e)return Utils.tr("without_rating");var t=new Date(e),i=new Date(t);i.setDate(i.getDate()+90);var n=new Date;return i.toISOString().slice(0,10)<n.toISOString().slice(0,10)?Utils.tr("without_rating"):Utils.tr("novedad_string")})),_defineProperty(_Utils,"pagantisCalculator",(function(e){var t="undefined"!=typeof calendarCFG&&null!==calendarCFG&&calendarCFG.pagantisQuotas||3,i="undefined"!=typeof calendarCFG&&null!==calendarCFG&&calendarCFG.pagantisInterestPercent||0;return((e="string"==typeof e?parseFloat(e):e)+e*(i/100)*t)/t})),_defineProperty(_Utils,"getSourceImage",(function(e){return Utils.isLocal()?"https://www.civitatis.com".concat(e):e})),_defineProperty(_Utils,"isMopsOnTabsActive",(function(){return Utils.isActiveTest("1068610000")&&!_UtilsCore__WEBPACK_IMPORTED_MODULE_1__.a.isMobile()&&!$("body.is_logged-agency").length>0&&document.getElementById("activityPaxDataForm")&&(document.body.classList.contains("_price-EUR")||document.body.classList.contains("_price-USD")||document.body.classList.contains("_price-GBP"))})),_defineProperty(_Utils,"validateEmail",(function(e){return!!/^\w+([.-_+]?\w+)*@\w+([.-]?\w+)*(\.\w{2,10})+$/.test(e)})),_defineProperty(_Utils,"isEventInDataLayer",(function(e){return!!(e&&e.event&&Array.isArray(window.dataLayer))&&window.dataLayer.some((function(t){return t&&t.event&&t.event===e.event}))})),_defineProperty(_Utils,"pushGTMDataLayerObject",(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t||0;"complete"===document.readyState?setTimeout((function(){window.dataLayer.push(e)}),t):window.addEventListener("load",(function(){setTimeout((function(){window.dataLayer.push(e)}),t)}))})),_defineProperty(_Utils,"pushGTMDataLayerObjectWithCheck",(function(e){Utils.isEventInDataLayer(e)||window.dataLayer.push(e)})),_defineProperty(_Utils,"calculateExpirationTime",(function(e,t){var i;switch(t){case"days":i=24*e*60*60*1e3;break;case"hours":i=60*e*60*1e3;break;case"minutes":i=60*e*1e3;break;default:throw new Error("Unidad de tiempo no válida. Debe ser 'days', 'hours' o 'minutes'.")}return i})),_defineProperty(_Utils,"setKeyWithExpiration",(function(e,t,i,n){var r=Utils.calculateExpirationTime(i,n),o=Date.now()+r;_helpers_LocalStorageHandler__WEBPACK_IMPORTED_MODULE_4__.a.set(e,t),_helpers_LocalStorageHandler__WEBPACK_IMPORTED_MODULE_4__.a.set(e+"-exp",o)})),_defineProperty(_Utils,"clearUserSessionFromLocalStorage",(function(){["userLogin","userToken","affiliateLogin","agencyLogin","accommodationLogin","userEmail","userName","userSurname"].forEach((function(e){_helpers_LocalStorageHandler__WEBPACK_IMPORTED_MODULE_4__.a.get(e)&&(_helpers_LocalStorageHandler__WEBPACK_IMPORTED_MODULE_4__.a.delete(e),_helpers_LocalStorageHandler__WEBPACK_IMPORTED_MODULE_4__.a.delete("".concat(e,"-exp")))}))})),_defineProperty(_Utils,"storeUserLoginInLocalStorage",(function(e){if(e){var t=e.id,i=e.token,n=e.email,r=e.name,o=e.surname;Utils.setKeyWithExpiration("userLogin",t,7,"days"),Utils.setKeyWithExpiration("userToken",i,7,"days"),null!=n&&Utils.setKeyWithExpiration("userEmail",n,7,"days"),null!=r&&Utils.setKeyWithExpiration("userName",r,7,"days"),null!=o&&Utils.setKeyWithExpiration("userSurname",o,7,"days")}})),_defineProperty(_Utils,"decodeMaybeDoubleEncoded",(function(e){if("string"!=typeof e)return null;var t,i=e;do{t=i;try{i=decodeURIComponent(i)}catch(e){return t}}while(i!==t);return i})),_defineProperty(_Utils,"rewriteCookieForLocalStorage",(function(){var e=Utils.readCookie("oauthUserLogin"),t=Utils.readCookie("oauthUserToken"),i=Utils.readCookie("oauthUserBasicInfo"),n=Utils.readCookie("twoFactorAgencyLogin"),r=Utils.readCookie("twoFactorAffiliateLogin"),o=Utils.readCookie("twoFactorAccommodationLogin");if(e){if(Utils.setKeyWithExpiration("userLogin",e,7,"days"),Utils.setKeyWithExpiration("userToken",t,7,"days"),i){var s=Utils.decodeMaybeDoubleEncoded(i);if(s)try{var a=atob(s),l=JSON.parse(a);l.name&&Utils.setKeyWithExpiration("userName",l.name,7,"days"),l.surname&&Utils.setKeyWithExpiration("userSurname",l.surname,7,"days"),l.email&&Utils.setKeyWithExpiration("userEmail",l.email,7,"days")}catch(e){console.error("Error parseando oauthUserBasicInfo:",e)}_UtilsCore__WEBPACK_IMPORTED_MODULE_1__.a.deleteCookie("oauthUserBasicInfo")}setTimeout((function(){console.log("enviamos braze"),"undefined"!=typeof braze&&braze.changeUser(data.userLogin.id)}),3e3),_UtilsCore__WEBPACK_IMPORTED_MODULE_1__.a.deleteCookie("oauthUserLogin"),_UtilsCore__WEBPACK_IMPORTED_MODULE_1__.a.deleteCookie("oauthUserToken")}else n?(Utils.setKeyWithExpiration("agencyLogin",n,7,"days"),_UtilsCore__WEBPACK_IMPORTED_MODULE_1__.a.deleteCookie("twoFactorAgencyLogin")):r?(Utils.setKeyWithExpiration("affiliateLogin",r,7,"days"),_UtilsCore__WEBPACK_IMPORTED_MODULE_1__.a.deleteCookie("twoFactorAffiliateLogin")):Utils.readCookie("twoFactorAccommodationLogin")&&(Utils.setKeyWithExpiration("accommodationLogin",o,7,"days"),_UtilsCore__WEBPACK_IMPORTED_MODULE_1__.a.deleteCookie("twoFactorAffiliateLogin"))})),_defineProperty(_Utils,"isGeneralActivity",(function(){var e=window.activityData;if(!e)return!1;var t=/\s+eSIM\s+/i.test(e.titulo||""),i=Number(e.destinationId);return 0===i&&!isNaN(i)||t})),_defineProperty(_Utils,"disableHourRange",(function(e,t,i){for(var n=t;n<i;n++)e.find('option[value="'.concat(n,'"]')).attr("disabled",!0)})),_defineProperty(_Utils,"disableMinuteRange",(function(e,t,i){for(var n=t;n<=i;n+=5)e.find('option[value="'.concat(n,'"]')).attr("disabled",!0)})),_defineProperty(_Utils,"updateSelect2DisabledHours",(function(e,t){var i=this,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=Utils.getMoment(t,Utils.tr("timeFormats.datePickerFormat")).format("YYYY-MM-DD"),o=r?window.closedDatesAndHours.filter((function(e){return e.fecha===r})):"";return n&&e.find("option").attr("disabled",!1),o&&o.length>0&&o.forEach((function(t){var n=_slicedToArray(t.start_hour.split(":").map(Number),2),r=n[0],o=n[1],s=_slicedToArray(t.end_hour.split(":").map(Number),2),a=s[0],l=s[1];o>0||l>0||(r>=0&&a>0?i.disableHourRange(e,r,a):r>=0&&(isNaN(a)||0==a)?i.disableHourRange(e,r,24):(isNaN(r)||0==r)&&a>0&&i.disableHourRange(e,0,a)),o>0&&!(l>0)&&(a>0?i.disableHourRange(e,r+1,a):(isNaN(a)||0==a)&&i.disableHourRange(e,r+1,24)),!(o>0)&&l>0&&(r>0?i.disableHourRange(e,r,a):(isNaN(r)||0==r)&&i.disableHourRange(e,0,a)),o>0&&l>0&&i.disableHourRange(e,r+1,a),t.startHourParsed=r,t.endHourParsed=a,t.startHourMinutes=o,t.endHourMinutes=l})),e.trigger("change.select2"),o})),_defineProperty(_Utils,"updateSelect2DisabledMinutes",(function(e,t,i){var n=this,r=parseInt(e.val(),10);(t.find("option").attr("disabled",!1),i&&i.length>0)&&i.filter((function(e){return e.startHourParsed==r&&e.startHourMinutes>0||e.endHourParsed==r}
1)).forEach((function(e){e.startHourParsed==r&&e.endHourParsed!==r&&n.disableMinuteRange(t,e.startHourMinutes,55),e.startHourParsed!==r&&e.endHourParsed==r&&(e.endHourParsed>0||e.endHourMinutes>0)&&n.disableMinuteRange(t,0,e.endHourMinutes),e.startHourParsed==r&&e.endHourParsed==r&&n.disableMinuteRange(t,e.startHourMinutes,e.endHourMinutes)}))})),_defineProperty(_Utils,"refreshSelect2",(function(e){e.select2("destroy"),CivAPP.Forms.initSelects(e.parent(),!0)})),_defineProperty(_Utils,"handleHourChange",(function(e,t,i){$(e).val()?(t.attr("disabled",!1),this.updateSelect2DisabledMinutes(e,t,i),""!==t.val()&&t.val("").trigger("change"),this.refreshSelect2(t)):t.attr("disabled",!0)})),_defineProperty(_Utils,"handleTransferCalendarClick",(function(e,t,i,n){var r,o=null===(r=document.getElementById(i))||void 0===r?void 0:r.value;if(o){if(e.attr("disabled",!1),"returnDate_pickerInput"===i){var s,a=null===(s=document.getElementById("date_pickerInput"))||void 0===s?void 0:s.value;n=a&&o&&a==o?this.updateSelect2DisabledHours(e,o,!1):this.updateSelect2DisabledHours(e,o)}else n=this.updateSelect2DisabledHours(e,o);e.val("").trigger("change"),""!==t.val()&&t.val("").trigger("change")}else e.attr("disabled",!0),t.attr("disabled",!0);return this.refreshSelect2(e),n})),_defineProperty(_Utils,"getPageIdentifier",(function(){var e=document.querySelector('meta[name="sitewide-event"]');if(e){var t=JSON.parse(atob(e.getAttribute("content"))),i=JSON.parse(t);return"".concat(i.page.typology.toLowerCase().replaceAll(" ","-")).concat("cart"===i.page.typology?"-".concat(i.page.title):"")}})),_defineProperty(_Utils,"sendCTAEvent",(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i="".concat(e,"_Click");Object(_shared_Optimizely_sdk_optimizelyUser__WEBPACK_IMPORTED_MODULE_5__.c)(i,t)})),_defineProperty(_Utils,"handleClickNavigation",(function(e){"undefined"!=typeof localStorage&&null!==localStorage&&localStorage.setItem("previousPage",e)})),_defineProperty(_Utils,"checkPreviousPageAndSendEvent",(function(e,t){"undefined"!=typeof localStorage&&null!==localStorage&&(localStorage.getItem("previousPage")===e&&(Object(_shared_Optimizely_sdk_optimizelyUser__WEBPACK_IMPORTED_MODULE_5__.c)("".concat(t,"_View")),localStorage.removeItem("previousPage")))})),_defineProperty(_Utils,"checkPreviousPageAndSendEventAnalytics",(function(e,t){"undefined"!=typeof localStorage&&null!==localStorage&&(localStorage.getItem("previousPage")===e&&(dataLayer.push({event:"pdp_view_from_seo_landing",prev_page:e,next_page:t}),localStorage.removeItem("previousPage")))})),_defineProperty(_Utils,"sendAbandonmentRateEvent",(function(e){var t="".concat(e,"_Abandonment_Rate");Object(_shared_Optimizely_sdk_optimizelyUser__WEBPACK_IMPORTED_MODULE_5__.c)(t)})),_defineProperty(_Utils,"getPrivacyAndTermsUrls",(function(){var e=this.getLocale(),t="https://policies.google.com/";return{privacyUrl:"".concat(t,"privacy?hl=").concat(e),termsUrl:"".concat(t,"terms?hl=").concat(e)}})),_defineProperty(_Utils,"priceShouldShowFromString",(function(e){var t=e.fromString,i=void 0===t||!0===t||"true"===t||"1"===t,
1n=!0===e.hasOtherOffers,r=!0===e.hasVariablePrices,o=!0===e.hasDynamicPrices,s=!0===e.hasBackupMinimumPrice,a=n||r||o||s||i,l=parseInt(e.tipo||0,10),c=Number(e.precioMinimoFront)||Number(e.precioMinimo)||0;return 1===l&&0!==c&&a})),_defineProperty(_Utils,"priceShouldShowDiscount",(function(e){var t=Number(e.precioOficialFront)||Number(e.precioOficial)||0,i=Number(e.precioMinimoFront)||Number(e.precioMinimo)||0,n=0!==t&&0!==i&&t>i,r=!0===e.hasGlobalOffers,o=!0===e.hasOtherOffers,s=r||o,a=Number(e.descuentoVenta)||0;return n&&(s||a>0)})),_defineProperty(_Utils,"getPrincipalActivityData",(function(e){var t,i,n,r,o=null!=e?e:null===(t=window.activityData)||void 0===t?void 0:t.activityId,s=window.activityData?{id:o,divisa:null===(i=window.activityData)||void 0===i?void 0:i.activityCurrency}:null;if(Array.isArray(window.calendarDataFetch)){var a,l=window.calendarDataFetch.find((function(e){var t;return(null==e?void 0:null===(t=e.activity)||void 0===t?void 0:t.id)===o}));return null!==(a=null==l?void 0:l.activity)&&void 0!==a?a:s}return null!==(n=null===(r=window.calendarDataFetch)||void 0===r?void 0:r.activity)&&void 0!==n?n:s})),_defineProperty(_Utils,"sendNavigationClickEvent",(function(e,t,i){dataLayer.push({event:"navigation_clic",event_category:e,event_action:null!=t?t:e,event_label:null!=i?i:e})})),_defineProperty(_Utils,"loadRecaptchaScript",(function(){if(!document.body.querySelector(".grecaptcha-badge")){var e=document.createElement("script");e.src="https://www.google.com/recaptcha/api.js?render=6Lc9qZUnAAAAAHG5EkgJUqwYHo_VFoa-a60GJFMW",e.async=!0,e.defer=!0,document.body.appendChild(e)}})),_defineProperty(_Utils,"handleShowCalendarClick",(function(){var e=$
1("#showCalendarButton"),t=Utils.tr("calendar_url"),i=document.getElementsByName("base-guide-booking"),n=i.length>=1&&"isGuideBooking"===i[0].content;e&&e.on("click",(function(e){var i,r,o,s,a,l;if(e.preventDefault(),window.isActivityNewLayoutView||window.isGuideView||Utils.isGuide()&&!n){var c;if(_UtilsCore__WEBPACK_IMPORTED_MODULE_1__.a.isMobile()&&!Utils.isGuide()&&(null===(a=CivAPP)||void 0===a?void 0:null===(l=a.optimizelyFlags)||void 0===l?void 0:l.pxp_test_mobile_pdp_new_pdp_design)&&(Utils.sendCTAEvent("PDP_CTA_Availability"),Utils.handleClickNavigation("PDP_new")),""!==window.location.search){var u=window.location.search;return c=window.location.href.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/\d+\//g,"/").replace(/\/$/,"").toString()+"/"+t+"/"+u,void(window.location.href=c)}c=window.location.href.replace(/#.*$/,"").replace(/\/\d+\//g,"/").replace(/\/$/,"").toString()+"/"+t+"/",window.location.href=c}else Utils.$("body").addClass("js-is-booking--01 show-calendar-and-hide-other show-calendar-and-hide-other_step-01").removeClass("js-is-booking--02 show-calendar-and-hide-other_step-02");null!==(null===(i=calendarCFG)||void 0===i?void 0:i.onlyCalendarAndTime)&&(1==(null===(r=calendarCFG)||void 0===r?void 0:r.onlyCalendarAndTime)||"true"==(null===(o=calendarCFG)||void 0===o?void 0:o.onlyCalendarAndTime)||"1"==(null===(s=calendarCFG)||void 0===s?void 0:s.onlyCalendarAndTime))&&Utils.$("body").addClass("_basic"),_UtilsCore__WEBPACK_IMPORTED_MODULE_1__.a.isMobile()&&Utils.scrollToTop()}))})),_defineProperty(_Utils,"userOrCompanyPanelType",(function(){if(window.APPConfig){var e=window.APPConfig,t=function(t){var i=e[t];return void 0!==i&&(1==i||"true"==i||"1"==i)};return t("isAccommodation")?"accommodation":t("isAccommodationGroup")?"accommodationGroup":t("isAgencyGroup")?"agencyGroup":e.agencyId&&!(t("isAccommodation")||t("isAccommodationGroup")||t("isAgencyGroup"))?"agency":e.providerId?"provider":e.affiliateId?"affiliate":"unknown"}return"unknown"})),_defineProperty(_Utils,"isSeoLandingDestinationFromOptimizely",(function(e){var t=Object(_shared_Optimizely_sdk_optimizelySetup__WEBPACK_IMPORTED_MODULE_6__.a)("wave_release_web_seo_countries_new_landing","destinationsSeoLanding");if(!t||"object"!==_typeof(t)||Array.isArray(t))return!1;var i=t.destinations;return!i||!Array.isArray(i)||0===i.length||i.includes(e)})),_defineProperty(_Utils,"parseFlexibleDestinationId",(function(e){if(null==e||""===e)return null;var t=String(e).trim(),i=parseInt(t,10);if(!isNaN(i)&&/^\d+$/.test(t))return i;var n=t.replace(/\D/g,"");if(!n)return null;var r=parseInt(n,10);return isNaN(r)?null:r})),_defineProperty(_Utils,"isDestinationSeoLandingCity",(function(e){var t=e?e.id:null;if(!t)return!1;var i=parseInt(t,10);return!isNaN(i)&&0!==i&&Utils.isSeoLandingDestinationFromOptimizely(i)})),_defineProperty(_Utils,"seoAttrsForDestinationCity",(function(e,t){return!0===t?{"data-seo-destination-link":!0}:!1===t?{}:null!==e&&Utils.isDestinationSeoLandingCity({id:e})?{"data-seo-destination-link":!0}:{}})),_defineProperty(_Utils,"destinationCityHrefAndSeoAttrs",(function(e,t,i){var n=Utils.parseFlexibleDestinationId(e);return{href:Utils.buildCleanDestinationHref({id:n},t),seoAttrs:Utils.seoAttrsForDestinationCity(n,i)}})),_defineProperty(_Utils,"buildCleanDestinationHref",(function(e,t){var i=Utils.getLocale(),n=t?String(t).replace(/\/$/,""):"/".concat(i,"/").concat(e.url);/^https?:\/\//i.test(n)&&(n=n.replace(/^https?:\/\/[^/]+/i,"")),n.startsWith("/")||(n="/".concat(n));var r=String(Utils.tr("search.disambiguationUrl")||"").replace(/\/+$/,"");if(r){var o=(r.startsWith("/")?r:"/".concat(r)).replace(/[.*+?^${}()|[\]\\]/g,"\\$&");n=n.replace(new RegExp("".concat(o,"/?$"),"i"),"")}return n||(n="/"),n.endsWith("/")?n:"".concat(n,"/")})),_defineProperty(_Utils,"buildDestinationSeoUrl",(function(e,t){var i=Utils.getLocale(),n=t?t.replace(/\/$/,""):"/".concat(i,"/").concat(e.url),r=e?e.id:null;if(!r)return n;var o=parseInt(r,10);if(isNaN(o)||0===o)return n;if(!Utils.isSeoLandingDestinationFromOptimizely(o))return n;var s=Utils.tr("search.disambiguationUrl"),a="".concat(s,"/");return"".concat(n).concat(a)}
1)),_defineProperty(_Utils,"checkHeader",(_checkHeader=_asyncToGenerator(regeneratorRuntime.mark((function e(t,i){var n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,fetch(t,{method:"HEAD"});case 3:if(!(n=e.sent).headers.has(i)){e.next=10;break}return r=n.headers.get(i),e.abrupt("return",r);case 10:return e.abrupt("return",!1);case 11:e.next=16;break;case 13:return e.prev=13,e.t0=e.catch(0),e.abrupt("return",!1);case 16:case"end":return e.stop()}}),e,null,[[0,13]])}))),function(e,t){return _checkHeader.apply(this,arguments)})),_defineProperty(_Utils,"sanitizeHrefQuotes",(function(e){return e.replace(/href="(.*?)"/g,(function(e,t){return'href="'.concat(t,'"')}))})),_Utils),_checkHeader,isLocal=_UtilsCore__WEBPACK_IMPORTED_MODULE_1__.a.isLocal(),isAlert=_UtilsCore__WEBPACK_IMPORTED_MODULE_1__.a.isAlert(),isDebug=Utils.isDebug(),defaultDiacriticsRemovalMap=[{base:"A",letters:"Aâ¶ï¼¡ÃÃÃẦẤẪẨÃÄÄáº°áº®áº´áº²È¦Ç ÃÇẢÃ
ǺÇÈÈẠẬẶá¸ÄȺⱯ"},{base:"AA",letters:"ê²"},{base:"AE",letters:"ÃǼǢ"},{base:"AO",letters:"ê´"},{base:"AU",letters:"ê¶"},{base:"AV",letters:"ê¸êº"},{base:"AY",letters:"ê¼"},{base:"B",letters:"Bâ·ï¼¢á¸á¸á¸ÉÆÆ"},{base:"C",letters:"Câ¸ï¼£ÄÄÄÄÃá¸ÆÈ»ê¾"},{base:"D",letters:"Dâ¹ï¼¤á¸Äá¸á¸á¸á¸ÄÆÆÆê¹"},{base:"DZ",letters:"DZÇ"},{base:"Dz",letters:"DzÇ
"},{base:"E",letters:"Eâºï¼¥ÃÃÃá»áº¾á»á»áº¼Äá¸á¸ÄÄÃẺÄÈÈẸá»È¨á¸Äá¸á¸ÆÆ"},{base:"F",letters:"Fâ»ï¼¦á¸Æê»"},{base:"G",letters:"Gâ¼ï¼§Ç´ÄḠÄÄ Ç¦Ä¢Ç¤Æê ê½ê¾"},{base:"H",letters:"Hâ½ï¼¨Ä¤á¸¢á¸¦ÈḤḨḪĦⱧⱵê"},{base:"I",letters:"Iâ¾ï¼©ÃÃÃĨĪĬİÃḮá»ÇÈÈá»Ä®á¸¬Æ"},{base:"J",letters:"Jâ¿ï¼ªÄ´É"},{base:"K",letters:"KâKḰǨḲĶḴÆâ±©êêêê¢"},{base:"L",letters:"LâLĿĹĽḶḸĻḼḺÅȽⱢⱠêêê"},{base:"LJ",letters:"Ç"},{base:"Lj",letters:"Ç"},{base:"M",letters:"Mâï¼á¸¾á¹á¹â±®Æ"},{base:"N",letters:"NâNǸÅÃá¹Åá¹Å
á¹á¹È Æêê¤"},{base:"NJ",letters:"Ç"},{base:"Nj",letters:"Ç"},{base:"O",letters:"OâOÃÃÃá»á»á»á»Ãá¹È¬á¹Åá¹á¹ÅȮȰÃȪá»ÅÇÈÈÆ á»á»á» á»á»¢á»á»ÇªÇ¬ÃÇ¾ÆÆêê"},{base:"OI",letters:"Æ¢"},{base:"OO",letters:"ê"},{base:"OU",letters:"È¢"},{base:"OE",letters:"ÂÅ"},{base:"oe",letters:"ÂÅ"},{base:"P",letters:"Pâ
ï¼°á¹á¹Æ¤â±£êêê"},{base:"Q",letters:"Qâï¼±êêÉ"},{base:"R",letters:"Râï¼²Åá¹ÅÈÈá¹á¹Åá¹ÉⱤêê¦ê"},{base:"S",letters:"Sâï¼³áºÅṤÅṠŠṦṢṨÈÅâ±¾ê¨ê"},{base:"T",letters:"TâTṪŤṬÈŢṰṮŦƬƮȾê"},{base:"TZ",letters:"ê¨"},{base:"U",letters:"Uâï¼µÃÃÃŨṸŪṺŬÃÇÇÇÇỦŮŰÇÈÈÆ¯á»ªá»¨á»®á»¬á»°á»¤á¹²Å²á¹¶á¹´É"},{base:"V",letters:"VâVṼṾƲêÉ
"},{base:"VY",letters:"ê "},{base:"W",letters:"Wâï¼·áºáºÅ´áºáºáºâ±²"},{base:"X",letters:"XâXáºáº"},{base:"Y",letters:"YâYỲÃŶỸȲáºÅ¸á»¶á»´Æ³ÉỾ"},{base:"Z",letters:"ZâZŹáºÅ»Å½áºáºÆµÈ¤â±¿â±«ê¢"},{base:"a",letters:"aâï½áºÃ áâầấẫẩãÄÄằắẵẳȧǡäÇảåǻÇÈÈạáºáº·á¸Ä
â±¥É"},{base:"aa",letters:"ê³"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"êµ"},{base:"au",letters:"ê·"},{base:"av",letters:"ê¹ê»"},{base:"ay",letters:"ê½"},{base:"b",letters:"bâï½á¸á¸
á¸ÆÆÉ"},{base:"c",letters:"câï½ÄÄÄÄÃ§á¸ÆÈ¼ê¿â"},{base:"d",letters:"dâï½á¸Äá¸á¸á¸á¸ÄÆÉÉêº"},{base:"dz",letters:"dzÇ"},{base:"e",letters:"eâï½
èéêá»áº¿á»
á»áº½Äá¸á¸ÄÄëẻÄÈ
Èẹá»È©á¸Äá¸á¸ÉÉÇ"},{base:"f",letters:"fâï½á¸Æê¼"},{base:"g",letters:"gâï½ÇµÄḡÄÄ¡Ç§Ä£Ç¥É ê¡áµ¹ê¿"},{base:"h",letters:"hâï½Ä¥á¸£á¸§ÈḥḩḫáºÄ§â±¨â±¶É¥"},{base:"hv",letters:"Æ"},{base:"i",letters:"iâï½Ã¬ÃîĩīÄïḯá»ÇÈÈá»Ä¯á¸É¨Ä±"},{base:"j",letters:"jâï½ÄµÇ°É"},{base:"k",letters:"kâï½á¸±Ç©á¸³Ä·á¸µÆâ±ªêêê
ê£"},{base:"l",letters:"lâï½ÅÄºÄ¾á¸·á¸¹Ä¼á¸½á¸»Å¿ÅÆÉ«â±¡êêê"},{base:"lj",letters:"Ç"},{base:"m",letters:"mâï½á¸¿á¹á¹É±É¯"},{base:"n",letters:"nâï½Ç¹Åñá¹
Åá¹Åá¹á¹ÆÉ²Åêê¥"},{base:"nj",letters:"Ç"},{base:"o",letters:"oâï½Ã²Ã³Ã´á»á»á»á»Ãµá¹Èá¹Åá¹á¹Åȯȱöȫá»ÅÇÈÈÆ¡á»á»á»¡á»á»£á»á»Ç«ÇøǿÉêêɵ"},{base:"oi",letters:"Æ£"},{base:"ou",letters:"È£"},{base:"oo",letters:"ê"},{base:"p",letters:"pâï½á¹á¹Æ¥áµ½êêê"},{base:"q",letters:"qâ ï½Éêê"},{base:"r",letters:"râ¡ï½Åá¹ÅÈÈá¹á¹Åá¹Éɽêê§ê"},{base:"s",letters:"sâ¢ï½ÃÅá¹¥ÅṡšṧṣṩÈÅÈ¿ê©ê
áº"},{base:"t",letters:"tâ£ï½á¹«áºÅ¥á¹ÈţṱṯŧÆÊⱦê"},{base:"tz",letters:"ê©"},{base:"u",letters:"uâ¤ï½Ã¹ÃºÃ»Å©á¹¹Å«á¹»ÅüÇÇÇÇủůűÇÈÈÆ°á»«á»©á»¯á»á»±á»¥á¹³Å³á¹·á¹µÊ"},{base:"v",letters:"vâ¥ï½á¹½á¹¿ÊêÊ"},{base:"vy",letters:"ê¡"},{base:"w",letters:"wâ¦ï½áºáºÅµáºáº
áºáºâ±³"},{base:"x",letters:"xâ§ï½áºáº"},{base:"y",letters:"yâ¨ï½á»³Ã½Å·á»¹È³áºÃ¿á»·áºá»µÆ´Éỿ"},{base:"z",letters:"zâ©ï½ÅºáºÅ¼Å¾áºáºÆ¶È¥Éⱬê£"}],diacriticsMap={},i=0;i<defaultDiacriticsRemovalMap.length;i++)for(var letters=defaultDiacriticsRemovalMap[i].letters,j=0;j<letters.length;j++)diacriticsMap[letters[j]]=defaultDiacriticsRemovalMap[i].base;$.extend(Utils,_UtilsCore__WEBPACK_IMPORTED_MODULE_1__.a),__webpack_exports__.a=Utils},,,,,,,function(e,t,i){"use strict";i.d(t,"D",(function(){return m})),i.d(t,"C",(function(){return _})),i.d(t,"b",(function(){return y}
vendor: 4,200 bytes, line 1
1)),i.d(t,"d",(function(){return b})),i.d(t,"c",(function(){return E})),i.d(t,"H",(function(){return w})),i.d(t,"e",(function(){return O})),i.d(t,"B",(function(){return S})),i.d(t,"v",(function(){return A})),i.d(t,"s",(function(){return C})),i.d(t,"t",(function(){return $})),i.d(t,"m",(function(){return T})),i.d(t,"h",(function(){return k})),i.d(t,"g",(function(){return x})),i.d(t,"f",(function(){return R})),i.d(t,"E",(function(){return N})),i.d(t,"G",(function(){return L})),i.d(t,"y",(function(){return M})),i.d(t,"n",(function(){return V})),i.d(t,"j",(function(){return B})),i.d(t,"o",(function(){return G})),i.d(t,"k",(function(){return z})),i.d(t,"z",(function(){return K})),i.d(t,"A",(function(){return W})),i.d(t,"q",(function(){return Y})),i.d(t,"p",(function(){return J})),i.d(t,"x",(function(){return X})),i.d(t,"r",(function(){return Z})),i.d(t,"u",(function(){return Q})),i.d(t,"w",(function(){return ee})),i.d(t,"a",(function(){return te})),i.d(t,"l",(function(){return re})),i.d(t,"i",(function(){return oe})),i.d(t,"F",(function(){return se}));var n=i(89),r=(i(98),i(0)),o=i(21);function s(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function a(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?s(Object(i),!0).forEach((function(t){l(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):s(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function l(e,t,i){return(t=function(e){var t=function(e,t){if("object"!==f(e)||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!==f(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===f(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function c(e,t,i,n,r,o,s){try{var a=e[o](s),l=a.value}catch(e){return void i(e)}a.done?t(l):Promise.resolve(l).then(n,r)}function u(e){return function(){var t=this,i=arguments;return new Promise((function(n,r){var o=e.apply(t,i);function s(e){c(o,n,r,s,a,"next",e)}function a(e){c(o,n,r,s,a,"throw",e)}s(void 0)}))}}function d(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=v(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0,r=function(){};return{s:r,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:r}}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 o,s=!0,a=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return s=e.done,e},e:function(e){a=!0,o=e},f:function(){try{s||null==i.return||i.return()}finally{if(a)throw o}}}}function f(e){return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function h(e){return function(e){if(Array.isArray(e))return g(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||v(e)||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 p(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var n,r,o,s,a=[],l=!0,c=!1;try{if(o=(i=i.call(e)).next,0===t){if(Object(i)!==i)return;l=!1}else for(;!(l=(n=o.call(i)).done)&&(a.push(n.value),a.length!==t);l=!0);}catch(e){c=!0,r=e}finally{try{if(!l&&null!=i.return&&(s=i.return(),Object(s)!==s))return}finally{if(c)throw r}}return a}}(e,t)||v(e,t)||function(){throw new TypeError("Invalid attempt to de
1structure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(e,t){if(e){if("string"==typeof e)return g(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?g(e,t):void 0}}function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}var m=function(e,t,i){if(null!=e){var n="string"==typeof e?parseFloat(e):Number(e);if(!Number.isNaN(n))return i&&!i.includes(n)?null!=t?t:0:n}return null!=t?t:0},_=function(e){return null!=e&&[!0,"true",1,"1"].includes(e)},y=function(e,t){var i=new Date(e);return i.setDate(i.getDate()+t),i},b=function(e){var t,i=(t=e?new Date(e):new Date).getTimezoneOffset();return new Date(t.getTime()-60*i*1e3)},E=function(e,t,i){var n=null!=t&&""!==t;if(!n)return e;if(!(null!=e&&""!==e)&&n)return t;var r=b(e),o=b(t);return i&&o<r||!i&&o>r?t:e},w=function(e){var t=p(e.split(":"),2),i=t[0],n=t[1],r=parseInt(i,10),o=parseInt(n,10),s=new Date;return s.setHours(r),s.setMinutes(o),s},I={},O=function(e){return null==e?[]:e.split(";").map((function(e){var t,i;if(I.hasOwnProperty(e))t=I[e].feeValue,i=I[e].hoursArray;else{var n=p((e.includes(".")?e:"".concat(e.includes(":")?"":e,".").concat(e.includes(":")?e:"")).split("."),2),r=n[0],o=n[1];t=m(r,-1),i=(i=o?o.split(","):[]).filter((function(e){var t=p(F(e),2),i=t[0],n=t[1];return null!==i&&null!==n&&!isNaN(i)&&!isNaN(n)})),I[e]={feeValue:t,hoursArray:i}}return{fee:t,hours:i}})).filter((function(e){return"number"==typeof e.fee&&e.fee>=0}))},S=function(){var e;return _(null===(e=window.APPConfig)||void 0===e?void 0:e.payLater)},A=function(){var e;return m(null===(e=window.APPConfig)||void 0===e?void 0:e.payLaterDays,0)},C=function(e){return null!=e?e:{}},$=function(e){return null!=e?e:{}},T=function(e){var t=m(e,0);return{rate:"".concat(m(void 0,t))}},P=function(e){var t=m(e,0);return{rate:m(void 0,t)}},k=function(e,t){return Array(e).fill(t)},x=function(e,t,i,n){if(!e)return[];if(!t||t.length<=e.length)return e;for(var r=t.length-e.length,o=h(e),s=0;s<r;s+=1)o.push(i&&Array.isArray(i)?k(i.length,P(n)):[]);return o},R=function(e,t,i){if(!t||t.length<=e.length)return e;for(var n=t.length-e.length,r=h(e),o=0;o<n;o+=1)r.push(P(i));return r},D=function(e,t){if(t)try{for(var i=new Map,n=Array.from(t.matchAll(e)),r=0,o=n;r<o.length;r++){var s=o[r],a=s[1],l=s[2];i.set(a,l)}var c=Math.max.apply(Math,h(Array.from(i.keys()).map(Number)));return Array.from({length:c+1},(function(e,t){return i.get(t.toString())||""}))}catch(e){return[]}return[]},N=function(e,t,i){var n,r=e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),o=new RegExp("".concat(r,'\\[(\\d+)]="([^"]*)"'),"g");return Array.isArray(i)?i.reduce((function(e,t){t&&D(o,t).forEach((function(t,i){!(void 0!==e[i]&&null!==e[i]&&""!==e[i])&&(null!=t&&""!==t)&&(e[i]=t)}));return e}),[]):Array.isArray(t)&&t.some(Array.isArray)?t.reduce((function(e,t){return(null!=t?t:[]).forEach((function(t,i){!(void 0!==e[i]&&null!==e[i]&&""!==e[i])&&(null!=t&&""!==t)&&(e[i]=t)})),e}),[]):i?D(o,i):null!==(n=t)&&void 0!==n?n:[]},L=function(e,t){if(!e||!t)return!1;var i=null==t?void 0:t[e],n=O(i);return void 0!==i&&n.every((function(e){return Array.isArray(e.hours)&&e.hours.length>0}))},M=function(e,t,i){var n=null!=i?i:"";return n?e&&function(e,t){if(!e||!t)return!1;var i=null==t?void 0:t[e];if(null==i||""===i)return!1;var n=O(i);return n.length>0&&n.every((function(e){return 0===e.hours.length}))}(t,e.horasValidas)?"":n:""},U={},F=function(e){if(!e||""===e.trim())return[null,null];if(U.hasOwnProperty(e))return U[e];var t=p(e.split(":"),2),i=t[0],n=t[1],r=parseInt(i,10),o=parseInt(n,10);return U[e]=[r,o],[r,o]},j=function(e){var t=p(F(e),2),i=t[0],n=t[1];if(null===i||null===n)return"";var r=i<10?"0".concat(i):"".concat(i),o=n<10?"0".concat(n):"".concat(n);return"".concat(r,":").concat(o)},V=function(e,t,i){var n,r;if(!t)return[];if(!Array.isArray(e))return[e];if(e.length<=1)return e;for(var o=null===(n=window.CivAPP)||void 0===n?void 0:null===(r=n.CalendarHelper)||void 0===r?void 0:r.shouldShowAllBackupModalities(),s=[],a=0;a<e.length;a++){var l=e[a],c=l.horasValidas;if(c&&"object"===f(c)){var u=null==c?void 0:c[t],d=O(u);if(void 0!==u){if(null==i||"string"==typeof i&&0===i.length){if(s.push(l),!o)return[l];continue}for(var h=0;h<d.length;h++){var p=d[h],v=j(i);if(p.hours.includes(v)){if(s.push(l),!o)return[l];break}}}}}return s.length>0?s:[e[0]]},B=function(e){var t,i=document.getElementById("activityId"),n=(null==i?void 0:i.value)||null,r=(null===(t=window.activityData)||void 0===t?void 0:t.activityId)||null;return parseInt(e||n||r,10)},G=function(e,t,i,n){var r,o,s,a=B(t);if(Array.isArray(e)){var l=V(e,i,n);if(l.length>0)return l[0];var c=(o=e,(s=a)?o.filter((function(e){var t,i;return(null==e?void 0:null===(t=e.activity)||void 0===t?void 0:t.id)===s||(null==e?void 0:null===(i=e.activity)||void 0===i?void 0:i.id)===s.toString()})):[]);if(c.length>0){var u=c[0],d=u.modifyCalendar,f=u.modifyCartCalendar;if(d||f)return c[0]}var h=function(e){return null==e?void 0:e.filter((function(e){return!_(null==e?void 0:e.isSecondary)}))}(e);if(h.length>0)return h[0]}return null!==(r=null==e?void 0:e[0])&&void 0!==r?r:e};function q(e,t){var i,n=e,r=d(t.split("."));try{for(r.s();!(i=r.n()).done;){var o=i.value;if(!(n&&"object"===f(n)&&o in n))return;n=n[o]}}catch(e){r.e(e)}finally{r.f()}return n}function H(e,t){return Array.isArray(t)?t.reduce((function(t,i){var n=i.split(".");return t[n[n.length-1]]=q(e,i),t}),{}):q(e,t)}var z=function(e,t,i,r,o){return Array.isArray(e)?null==e?void 0:e.reduce((function(e,t){return function(e,t,i){var r,o,s=null==e?void 0:null===(r=e.activity)||void 0===r?void 0:r.activa,a=null==s||Object(n.a)(null==e?void 0:null===(o=e.activity)||void 0===o?void 0:o.activa),l=Object(n.q)(e,t,i);return _(window.isAdmin)||a&&l}(t,r,o)&&e.push(H(t,i)),e}),[]):H(t,i)},K=function(){var e=u(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",!0);case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),W=function(){var e=u(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",!0);case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Y=function(e){for(var t=Array.from(new Set(e)),i=[],n=0;n<t.length;n++){i.push([]);for(var r=t[n].split("||"),o=0;o<r.length;o++){i[n].push([]);for(var s=r[o].split("|"),a=0;a<s.length;a++){var l=s[a].split("/"),c=l[0],u=l[1],d={};c.includes("(")?(d.originalRate=parseFloat(c.split(")")[0].split("(")[1]),d.rate=parseFloat(c.split(")")[1])):d.rate=parseFloat(c),d.supplement=c.includes("%")?u:parseFloat(u),i[n][o].push(d)}}}return i},J=function(e){var t=[];return e&&null!==e&&(t=Array.from(new Set(Object.values(e).map((function(e){return e.split(".")[0]}))))),t},X=function(e){var t=0,i=0,n=0;if(e.length>0&&Array.isArray(e[0])){var r=e.flat(1).map((function(e){return parseFloat(e[0].rate)}));t=Math.min.apply(Math,h(r));var o=r.findIndex((function(e){return e===t})),s=e.flat(1)[o][0];(i=(i=s.originalRate?parseFloat(s.originalRate):Number.MAX_SAFE_INTEGER)===Number.MAX_SAFE_INTEGER?0:i)>t&&(n=Math.round(100-100*t/i))}
1return{minimumPrice:t,officialPrice:i,discount:n}},Z=function(e,t){try{if(e){if("object"===f(e)&&"precioMinimoFront"in e)return e.precioMinimoFront;if(Array.isArray(e)){var i=e.map(Number).filter((function(e){return!isNaN(e)}));if(0===i.length)throw new Error("precioMinimoFront array does not contain valid numeric values.");return Math.min.apply(Math,h(i))}var n=Number(e);if(isNaN(n))throw new Error("precioMinimoFront is not a valid numeric value.");return n}}catch(e){console.error("Error calculating minimum price:",e)}return t},Q=function(e,t){try{if(e){if("object"===f(e)&&"precioOficialFront"in e)return e.precioOficialFront;if(Array.isArray(e)){var i=e.map(Number).filter((function(e){return!isNaN(e)}));if(0===i.length)throw new Error("precioOficialFront array does not contain valid numeric values.");return Math.max.apply(Math,h(i))}var n=Number(e);if(isNaN(n))throw new Error("precioOficialFront is not a valid numeric value.");return n}}catch(e){console.error("Error calculating official price:",e)}return t},ee=function(e,t,i){try{if(!e)throw new Error("No prices provided.");var n=function(e){var t=Number(e.id),i=Number(e.precioMinimoFront),n=Number(e.precioOficialFront);if(isNaN(i)||isNaN(n))throw new Error("Invalid numeric values in price.");return a(a({},e),{},{precioMinimoFront:i,precioOficialFront:n,id:t})};if(Array.isArray(e)){var r=e.map((function(e){try{return n(e)}catch(e){return null}})).filter((function(e){return null!==e}));if(0===r.length)throw new Error("No valid prices found in the array.");return r.reduce((function(e,t){return t.precioMinimoFront<e.precioMinimoFront?t:e}))}return n(e)}catch(e){return console.error("Error processing prices:",e),{id:0,precioMinimoFront:Number(t),precioOficialFront:Number(i),isSecondary:!1}}},te=function(e,t){var i,n=(null!==(i=function(e){try{if(null!=e&&e){if(Array.isArray(e))return e;if("string"==typeof e){var t=JSON.parse(e);if(Array.isArray(t))return t}}}catch(e){}return[]}(t))&&void 0!==i?i:[]).map((function(e){return m(e)})),r=m(e);return!n.includes(r)},ie=function(e){var t;return e?null===(t=document.getElementById("calendarUrl"))||void 0===t?void 0:t.dataset.calendarUrl:window.location.origin},ne=function(e,t,i,n){return n?"/api/calendars/".concat(e):"/api/activity/calendar/".concat(e,"/").concat(t.toLowerCase(),"/").concat(i.toLowerCase())},re=function(e,t,i){var n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],r=!0===Object(o.a)("flow_release_web_store","flow-2153");if(r&&"undefined"!=typeof window){var s=new URLSearchParams(window.location.search).get("calendar_test_url");if(s)try{var a=new URL(s,window.location.origin),l="calendar.civitatis.com"===a.hostname;if(("http:"===a.protocol||"https:"===a.protocol)&&l)return a.toString()}catch(e){}}var c=ie(n),u=ne(e,t,i,n);return"".concat(c).concat(u)},oe=function(e,t,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:3,o=arguments.length>4?arguments[4]:void 0,s=arguments.length>5?arguments[5]:void 0,a="string"==typeof o?parseFloat(o):o;if(0===a||"EUR"!==e||"ES"!==i)return r.a.tr("calendarLegacy.pagantisGenericQuotasCalendar");var l=r.a.returnNumberWithParams(r.a.formatNumber(r.a.pagantisCalculator(a).toFixed(2)),s,t);return r.a.tr("calendarLegacy.pagantisQuotasCalendar","".concat(n),"".concat(l))},se=function(e){if(!e)return"";var t=e.split("/"),i={};return t.forEach((function(e){if(e.trim()){for(var t=[],n="",r=0,o=e.split(";"),s=0;s<o.length;s++){n+=(n?";":"")+o[s];var a=++r>=2,l=s===o.length-1,c=!l&&!isNaN(Number(o[s]))&&isNaN(Number(o[s+1].charAt(0)));a&&(l||c)&&(t.push(n),n="",r=0)}n&&t.push(n),t.forEach((function(e){var t=e.split(";");if(t.length>=2){var n=t[0].trim(),r=parseInt(t[1],10);(!i[n]||r>0)&&(i[n]=e)}}))}})),Object.values(i).join("/")}},,,,,,,,function(e,t,i){"use strict";var n="undefined"!=typeof localStorage&&null!==localStorage,r={get:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return n?t&&void 0!==localStorage[e]?JSON.parse(localStorage[e]):localStorage[e]:void 0},set:function(e,t){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];
1n&&(localStorage[e]=i?JSON.stringify(t):t)},purge:function(){if(n)for(var e in localStorage)delete localStorage[e]},delete:function(e){n&&(Array.isArray(e)?e.forEach((function(e){delete localStorage[e]})):delete localStorage[e])},getWithExpiration:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,s=e+"-exp",a=r.get(e,t),l=r.get(s,t);return a&&l<Date.now()?(r.delete([e,s]),i&&(r.set(e,a,t),r.set(s,Date.now()+n,t)),o):a},manageWithExpiration:function(e,t,i){var n=r.get(e),o=new Date;if(n){if(o.getTime()<=n.expiry)return n.value;r.delete(e)}var s={value:t,expiry:o.getTime()+24*i*60*60*1e3};return r.set(e,s),t}};t.a=r},,,,,,function(e,t,i){"use strict";var n,r,o=i(54),s=i(0);function a(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var n,r,o,s,a=[],l=!0,c=!1;try{if(o=(i=i.call(e)).next,0===t){if(Object(i)!==i)return;l=!1}else for(;!(l=(n=o.call(i)).done)&&(a.push(n.value),a.length!==t);l=!0);}catch(e){c=!0,r=e}finally{try{if(!l&&null!=i.return&&(s=i.return(),Object(s)!==s))return}finally{if(c)throw r}}return a}}(e,t)||l(e,t)||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 l(e,t){if(e){if("string"==typeof e)return c(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?c(e,t):void 0}}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}var u=/(^|_)test(_|$)/i,d=/(^|_)all(_|$)/i,f=/(^|_)web(_|$)/i,h=(window.languageCodes||[]).map((function(e){return e.toLowerCase()})),p=(window.currencyCodes||[]).map((function(e){return e.toLowerCase()})),v=null===(n=window.currency)||void 0===n?void 0:n.toLowerCase(),g=null===(r=window.locale)||void 0===r?void 0:r.toLowerCase(),m=["HOME","PDP","PLP","CHK01","CHK02","CHK03","TYP","WISHLIST","BOOKINGS","ACCOUNT","SEARCH-RESULTS"].flatMap((function(e){return["".concat(e,"_mobile"),"".concat(e,"_desktop")]})),_=function(e){var t=e.toLowerCase().split("_"),i=t.some((function(e){return h.includes(e)})),n=t.some((function(e){return p.includes(e)}));return!(i&&!t.includes(g))&&!(n&&!t.includes(v))},y=function(e){var t=function(){var e=null;try{var t=s.a.readCookie(decodeURIComponent("optimizelyTestABOrigin"));e=JSON.parse(t)}catch(e){s.a.l("Invalid optimizelyTestABOrigin cookie. Using feature by default")}var i={};return e&&Object.keys(e).length>0?i=e:m.forEach((function(e){i[e]="feature"})),i}(),i={},n={};try{var r=s.a.readCookie(decodeURIComponent("selectedFeatureTestAB"));i=JSON.parse(r)||{}}catch(e){s.a.l("Invalid selectedFeatureTestAB cookie.")}try{var o=s.a.readCookie(decodeURIComponent("optimizelyTestABOrigin"));n=JSON.parse(o)||{}}catch(e){s.a.l("Invalid testABOrigin cookie.")}var c,h={},p=Object.keys(e).filter((function(e){return u.test(e)})),v=Object.keys(e).filter((function(e){return d.test(e)&&u.test(e)})),g=function(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=l(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0,r=function(){};return{s:r,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:r}}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 o,s=!0,a=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return s=e.done,e},e:function(e){a=!0,o=e},f:function(){try{s||null==i.return||i.return()}finally{if(a)throw o}}}}(m);try{var y=function(){var e=c.value,n=a(e.split("_"),2),r=n[0],o=n[1];if("feature"===t[e]){var s=i[e];if(s&&p.includes(s)&&_(s))h[e]=s;else{var l=p.filter((function(e){var t=e.toLowerCase(),i=t.includes(r.toLowerCase())||d.test(t),n=t.includes(o.toLowerCase())||f.test(t);return!(!i||!n)&&_(e)}));l.length>0?h[e]=l[Math.floor(Math.random()*l.length)]:h[e]=null}}else h[e]=null};for(g.s();!(c=g.n()).done;)y()}catch(e){g.e(e)}finally{g.f()}var b=function(e,t,i){return m.forEach((function(i){var n,r=null===(n=e[i])||void 0===n?void 0:n.toLowerCase();if(r){var o=m.filter((function(e){var t=e.split("_")[0].toLowerCase();return r.includes(t)}));o.length>2&&o.forEach((function(i){var n=a(i.split("_"),2),o=n[0],s=n[1];r.includes(s)?(e[i]=r,t[i]="feature"):f.test(r)&&(e["".concat(o,"_mobile")]=r,e["".concat(o,"_desktop")]=r,t["".concat(o,"_mobile")]="feature",t["".concat(o,"_desktop")]="feature")}))}}
1)),i&&i.forEach((function(i){_(i)&&m.forEach((function(n){e[n]=i,t[n]="feature"}))})),{pageObject:e,testABOrigin:t}}(h,n||t,v),E=b.pageObject,w=b.testABOrigin;s.a.createCookie("selectedFeatureTestAB",JSON.stringify(E),21),s.a.createCookie("optimizelyTestABOrigin",JSON.stringify(w),21)},b=!1,E=window,w=function(e){b||(b=!0,E.CS_CONF&&(E.CS_CONF.integrations=E.CS_CONF.integrations||[],E.CS_CONF.integrations.push("Optimizely Full Stack")))};i(62),i(22);function I(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=function(e,t){if(!e)return;if("string"==typeof e)return O(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);"Object"===i&&e.constructor&&(i=e.constructor.name);if("Map"===i||"Set"===i)return Array.from(e);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return O(e,t)}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0,r=function(){};return{s:r,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:r}}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 o,s=!0,a=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return s=e.done,e},e:function(e){a=!0,o=e},f:function(){try{s||null==i.return||i.return()}finally{if(a)throw o}}}}function O(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}i.d(t,"d",(function(){return S})),i.d(t,"c",(function(){return A})),i.d(t,"b",(function(){return C})),i.d(t,"a",(function(){return $}));var S={},A={},C=function(){var e,t,i=(null===(e=window)||void 0===e?void 0:null===(t=e.optimizelyDatafile)||void 0===t?void 0:t.featureFlags)?window.optimizelyDatafile.featureFlags:null;if(i){var n,r=I(i);try{for(r.s();!(n=r.n()).done;){var a=n.value,l=Object(o.a)(a.key);if(!l)return;l.enabled&&(A[a.key]=l.variables)}}catch(e){r.e(e)}finally{r.f()}y(A),S=function(e){var t={};try{var i=s.a.readCookie(decodeURIComponent("selectedFeatureTestAB"));t=JSON.parse(i)}catch(e){}var n=Object.values(t).filter((function(e){return null!==e})),r={};return Object.keys(e).forEach((function(t){u.test(t)&&!n.includes(t)||(r[t]=e[t])})),r}(A)}},$=function(e,t){var i,n=null===(i=window.CivAPP)||void 0===i?void 0:i.optimizelyFlags;return n&&n[e]?(/test/i.test(e)&&function(e){if(b=!1,E._uxa){E._uxa.push(["afterPageView",w]);var t,i,n=Object(o.a)(e);n&&(t="AB_OP_"+n.flagKey,i=n.variationKey,E._uxa.push(["trackDynamicVariable",{key:t,value:i}]))}}(e),t?n[e].hasOwnProperty(t)?n[e][t]:null:n[e]):null}},function(e,t,i){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function o(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?r(Object(i),!0).forEach((function(t){s(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):r(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function s(e,t,i){return(t=function(e){var t=function(e,t){if("object"!==n(e)||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var r=i.call(e,t||"default");if("object"!==n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===n(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var a={isLocal:function(){return"undefined"!=typeof window&&window.appEnv?"local"===window.appEnv:(-1!==location.host.indexOf("local")||-1!==location.href.indexOf("file")||null!==this.readCookie("debug"))&&null==this.readCookie("noLocal")},isStaging:function(){return"undefined"!=typeof window&&window.appEnv?"staging"===window.appEnv:-1!==location.host.indexOf("staging")},isQa:function(){return"undefined"!=typeof window&&window.appEnv?"qa"===window.appEnv:-1!==location.host.indexOf("qa")}
1,isPro:function(){return!(this.isLocal()||this.isStaging()||this.isQa())},isDebug:function(){return null!==this.readCookie("debug")},isAlert:function(){return null!==this.readCookie("alert")},isTouchDevice:function(){return"ontouchstart"in document.documentElement||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0},isHoverDevice:function(){return!window.matchMedia("(hover: none)").matches},addBodyClasses:function(){var e="has-script ";this.isLocal()&&(e+="is-local "),this.isTouchDevice()?e+="is-touch-device ":e+="is-NOT-touch-device ",this.isHoverDevice()?e+="is-hover-device ":e+="is-NOT-hover-device ",/iphone|ipod|ipad/i.test(navigator.userAgent)&&(e+=" is-ios-device ",/CriOS/i.test(navigator.userAgent)&&(e+=" is-chrome-ios "),/iphone/i.test(navigator.userAgent)&&(e+=" is-iphone-device ")),/mac/i.test(navigator.userAgent)&&(e+=" is-mac "),document.getElementById("portraitPDP")&&(e+=" is-new-pdp-design "),this.isAndroid()&&(e+=" is-android-device "),document.body.className+=" "+e},createCookie:function(e,t,i){var n="";if(i){var r=new Date;r.setTime(r.getTime()+24*i*60*60*1e3);n="; expires="+r.toUTCString()}document.cookie=e+"="+t+n+"; path=/;SameSite=None;Secure"},createCookieWithMilliseconds:function(e,t,i){var n="";if(i){var r=new Date;r.setTime(r.getTime()+i);n="; expires="+r.toUTCString()}document.cookie=e+"="+t+n+"; path=/;SameSite=None;Secure"},readCookie:function(e){for(var t=e+"=",i=document.cookie.split(";"),n=0;n<i.length;n++){for(var r=i[n];" "==r.charAt(0);)r=r.substring(1,r.length);if(0==r.indexOf(t))return r.substring(t.length,r.length)}return null},deleteCookie:function(e){this.createCookie(e,"",-1)}
1,initFavButtons:function(){var e=$(".comfort-card__like[data-fav-info]");e.length>0&&(e.off("click.clickLike"),e.on("click.clickLike",(function(e){e.preventDefault();var r=$(this),o=r.attr("data-fav-info"),s=r.attr("data-fav-info-city"),a=r.attr("data-fav-to-list");null!=o&&""!==o&&(o=JSON.parse(o)),r.hasClass("_not-logged")?n(o):r.hasClass("_on")?CivAPP.FavsController.favButtonsOn(e,$(this),o):null!=a&&""!==a?t(r,o,a):i(o,s)})));var t=function(e,t,i){void 0!==CivAPP.FavsController&&null!==CivAPP.FavsController&&CivAPP.FavsController.createFavoriteFnc(o(o({},{listId:"string"==typeof i?parseInt(i):i}),t),(function(t){CivAPP.FavsController.activeLikeButton(e,t.favId),void 0!==CivAPP.FavsController&&null!==CivAPP.FavsController&&void 0!==CivAPP.FavsController.FavsListPage&&null!==CivAPP.FavsController.FavsListPage&&CivAPP.FavsController.FavsListPage.forceUpdateFavs((function(){void 0!==CivAPP.FavsController&&null!==CivAPP.FavsController&&void 0!==CivAPP.FavsController.RelatedItemsComponent&&null!==CivAPP.FavsController.RelatedItemsComponent&&CivAPP.FavsController.RelatedItemsComponent.forceUpdateRelated()}))}),(function(e){void 0!==CivAPP.FavsController&&null!==CivAPP.FavsController&&void 0!==CivAPP.FavsController.FavsListPage&&null!==CivAPP.FavsController.FavsListPage&&CivAPP.FavsController.FavsListPage.forceUpdateFavs((function(){void 0!==CivAPP.FavsController&&null!==CivAPP.FavsController&&void 0!==CivAPP.FavsController.RelatedItemsComponent&&null!==CivAPP.FavsController.RelatedItemsComponent&&CivAPP.FavsController.RelatedItemsComponent.forceUpdateRelated()}))}))},i=function(e,t,i){var n=void 0;t=null!=t&&""!==t?t:void 0;var r=React.createElement(FavsSelectListContent,{data:e,dataCity:t,urls:n.props.urls,methods:n.props.methods,callback:i,modalId:n.state.modalId,closeHandler:PopupboxManager.close});PopupboxManager.open({content:r,config:{className:"_favs-list-select _no-min-height",onOpen:function(){AffUtils.popen()},onClosed:function(){n.setState({modalId:Utils.getRandomString()},(function(){AffUtils.pclose()}))}}})},n=function(e,t){var i=void 0,n=React.createElement(FavsLoginContent,{data:e,urls:i.props.urls,methods:i.props.methods,callback:t,modalId:i.state.modalId,closeHandler:PopupboxManager.close});PopupboxManager.open({content:n,config:{className:"--login-general _no-min-height",onOpen:function(){AffUtils.popen()},onClosed:function(){i.setState({modalId:Utils.getRandomString()},(function(){AffUtils.pclose()}))}}})}},isMobile:function(){return("small"===Foundation.MediaQuery.current||"medium"===Foundation.MediaQuery.current)&&window.innerHeight>window.innerWidth},isMobileB:function(){return window.innerWidth<767&&window.innerHeight>window.innerWidth},isMobileLandscape:function(){return("small"===Foundation.MediaQuery.current||"medium"===Foundation.MediaQuery.current)&&window.innerHeight<=window.innerWidth},isTablet:function(){return("small"===Foundation.MediaQuery.current||"medium"===Foundation.MediaQuery.current)&&window.innerHeight<window.innerWidth||"large"===Foundation.MediaQuery.current},isTabletLandscape:function(){return"xlarge"===Foundation.MediaQuery.current},isDesktop:function(){return!this.isMobile()&&!this.isTablet()},isMobileDevice:function(){return/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase())&&this.isMobile()},isTabletDevice:function(){return/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase())&&!this.isMobile()},isPhoneDevice:function(){return/mobi/i.test(navigator.userAgent.toLowerCase())&&!/ipad/i.test(navigator.userAgent.toLowerCase())},isDesktopDevice:function(){return!this.isMobileDevice()&&!this.isTabletDevice()&&(this.isDesktop()||this.isTablet())},isMsEdge:function(){return-1!==navigator.userAgent.indexOf("Edge")},isIE:function(){return-1!==navigator.userAgent.indexOf("MSIE")||navigator.appVersion.indexOf("Trident/")>0},isFirefox:function(){return navigator.userAgent.toLowerCase().indexOf("firefox")>-1},isIphone:function(){return-1!==navigator.userAgent.toLowerCase().indexOf("iphone")},isAndroid:function(){var e=navigator.userAgent.toLowerCase();return-1!==e.indexOf("android")&&-1===e.indexOf("iphone")&&-1===e.indexOf("ipad")&&-1===e.indexOf("ipod")},isMac:function(){return navigator.userAgent.toLowerCase().includes("macintosh")}};t.a=a},,,,,,,,,,,,function(e,t,i){"use strict";var n=i(1),r=i.n(n),o=i(18),s=i.n(o),a=i(67),l=i.n(a),c=i(0),u=function(e){if($(e).length>0){var t=$(e);d(t),f(t)}},d=function(e){var t=/[^(<|>)]/g;e.on("keypress",(function(e){return!!String.fromCharCode(e.which).match(t)}))},f=function(e){var t=/(<([^>]+)>)/gi,i=/(<|>)/gi;e.on("paste",(function(n){setTimeout((function(){var n=e.val(),r=n.replace(t,"").replace(i,"");n!=r&&e.val(r)}))}))},h=i(15),p=i(44);function v(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=function(e,t){if(!e)return;if("string"==typeof e)return g(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);"Object"===i&&e.constructor&&(i=e.constructor.name);if("Map"===i||"Set"===i)return Array.from(e);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return g(e,t)}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0,r=function(){};return{s:r,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:r}}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 o,s=!0,a=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return s=e.done,e},e:function(e){a=!0,o=e}
1,f:function(){try{s||null==i.return||i.return()}finally{if(a)throw o}}}}function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}var m=function(){return window.APP_CONTEXT||{}},_=function(){return""!==(m().hostApp||"")&&window.parent!==window},y=function(e){try{return new URL(e).origin}catch(e){return""}},b=function(e){try{window.sessionStorage.setItem("civitatisHostAppOrigin",e)}catch(e){}},E=function(){for(var e,t,i,n=(e=m().hostAppOrigin,t=[],"string"==typeof e&&e.split(",").forEach((function(e){var i=e.trim();if(""!==i&&"*"!==i)try{var n=new URL(i).origin;-1===t.indexOf(n)&&t.push(n)}catch(e){}})),t),r=[(i=window.location.ancestorOrigins)&&i.length>0?i[0]:"",document.referrer],o=0;o<r.length;o+=1){var s=y(r[o]);if(-1!==n.indexOf(s))return b(s),s}var a=function(){try{return window.sessionStorage.getItem("civitatisHostAppOrigin")||""}catch(e){return""}}();return-1!==n.indexOf(a)?a:""},w={es:!0,en:!0,fr:!0,it:!0,pt:!0,de:!0},I=function(e,t){var i,n=new URL(t,window.location.origin).toString();return e+"/"+("mx"===(i=window.civLocale||"es")||"ar"===i?"es":"br"===i?"pt":w[i]?i:"es")+"/checkout?url="+encodeURIComponent(n)},O=function(e){if(!_())return!1;var t=E();if(""===t)return S(e);try{window.top.location.href=I(t,e)}catch(t){return S(e)}return!0},S=function(e){if(!_())return!1;var t=function(e){if("string"!=typeof e||""===e)return null;var t=e.split("?")[1];if(!t)return null;var i=new URLSearchParams(t),n=i.get("cart"),r=i.get("p");return n&&r?{cartId:n,pin:r}:null}(e);if(null===t)return!1;var i=E();if(""===i)return!1;var n={type:"CIVITATIS_PDP_CART_UPDATED",cartId:t.cartId,pin:t.pin};try{window.parent.postMessage(n,i)}catch(e){return!1}return!0},A=function(e){var t=void 0!==e.valueWithAmount&&null!==e.valueWithAmount&&(1==e.valueWithAmount||"true"==e.valueWithAmount||"1"==e.valueWithAmount),i=c.a.formatNumber(e.currency.amount),n=e.currency.currency,o=c.a.getCurrencyTranslation(n);"USD"==n&&(o=c.a.tr("paymentFormCurrency_dolares")+" US");var s=e.name,a=void 0!==e.defaultChecked&&null!==e.defaultChecked&&(1==e.defaultChecked||"true"==e.defaultChecked||"1"==e.defaultChecked),l=c.a.returnNumberWithParams(i,c.a.getCurrencySymbol(n),null,null,!0);return r.a.createElement("div",{className:"m-super-radio m-super-radio--currency","data-cs-override-id":n},r.a.createElement("input",{type:"radio",name:s,value:t?i+"-"+n:n,id:s+n,defaultChecked:a}),r.a.createElement("label",{for:s+n},r.a.createElement("span",{className:"m-super-radio__price",dangerouslySetInnerHTML:{__html:l}}),r.a.createElement("span",{className:"m-super-radio__currency"},o)))},C=i(21);i.d(t,"Cb",(function(){return F})),i.d(t,"Qb",(function(){return j})),i.d(t,"cb",(function(){return B})),i.d(t,"y",(function(){return K})),i.d(t,"z",(function(){return W})),i.d(t,"x",(function(){return Y})),i.d(t,"A",(function(){return J})),i.d(t,"U",(function(){return ee})),i.d(t,"q",(function(){return te})),i.d(t,"P",(function(){return ie})),i.d(t,"O",(function(){return ne})),i.d(t,"W",(function(){return se})),i.d(t,"h",(function(){return ae})),i.d(t,"e",(function(){return le})),i.d(t,"L",(function(){return ce})),i.d(t,"Rb",(function(){return ue})),i.d(t,"F",(function(){return de})),i.d(t,"H",(function(){return fe})),i.d(t,"ub",(function(){return he})),i.d(t,"b",(function(){return pe})),i.d(t,"I",(function(){return ve})),i.d(t,"wb",(function(){return ge})),i.d(t,"xb",(function(){return me})),i.d(t,"zb",(function(){return _e})),i.d(t,"mb",(function(){return ye})),i.d(t,"nb",(function(){return be})),i.d(t,"db",(function(){return Ee})),i.d(t,"vb",(function(){return we})),i.d(t,"p",(function(){return Ie})),i.d(t,"qb",(function(){return Oe})),i.d(t,"Gb",(function(){return Se})),i.d(t,"Bb",(function(){return Ae})),i.d(t,"Db",(function(){return Ce})),i.d(t,"K",(function(){return $e})),i.d(t,"Fb",(function(){return Pe})),i.d(t,"Nb",(function(){return ke})),i.d(t,"Eb",(function(){return xe})),i.d(t,"tb",(function(){return Ne})),i.d(t,"Ob",(function(){return Fe})),i.d(t,"c",(function(){return je})),i.d(t,"rb",(function(){return Ve})),i.d(t,"R",(function(){return Be})),i.d(t,"yb",(function(){return Ke})),i.d(t,"Pb",(function(){return We})),i.d(t,"jb",(function(){return Ye})),i.d(t,"n",(function(){return Je})),i.d(t,"E",(function(){return Xe})),i.d(t,"ob",(function(){return Ze})),i.d(t,"bb",(function(){return Qe})),i.d(t,"Ib",(function(){return et})),i.d(t,"r",(function(){return tt})),i.d(t,"Jb",(function(){return it})),i.d(t,"t",(function(){return nt})),i.d(t,"s",(function(){return rt})),i.d(t,"Lb",(function(){return ot})),i.d(t,"N",(function(){return at})),i.d(t,"D",(function(){return ct})),i.d(t,"J",(function(){return ut})),i.d(t,"Z",(function(){return dt})),i.d(t,"fb",(function(){return ft})),i.d(t,"d",(function(){return _t})),i.d(t,"sb",(function(){return yt})),i.d(t,"T",(function(){return bt})),i.d(t,"kb",(function(){return Et})),i.d(t,"M",(function(){return It})),i.d(t,"X",(function(){return Ot})),i.d(t,"V",(function(){return St})),i.d(t,"S",(function(){return At})),i.d(t,"Hb",(function(){return Ct})),i.d(t,"gb",(function(){return $t})),i.d(t,"m",(function(){return Tt})),i.d(t,"pb",(function(){return Pt})),i.d(t,"g",(function(){return kt})),i.d(t,"f",(function(){return xt})),i.d(t,"Ab",(function(){return Rt})),i.d(t,"Mb",(function(){return Dt})),i.d(t,"Kb",(function(){return Lt})),i.d(t,"u",(function(){return Mt})),i.d(t,"eb",(function(){return Ut})),i.d(t,"w",(function(){return Bt})),i.d(t,"l",(function(){return qt})),i.d(t,"v",(function(){return zt})),i.d(t,"C",(function(){return Kt})),i.d(t,"hb",(function(){return Wt})),i.d(t,"Q",(function(){return Yt})),i.d(t,"Sb",(function(){return Jt})),i.d(t,"o",(function(){return Zt})),i.d(t,"j",(function(){return Qt})),i.d(t,"Y",(function(){return ei})),i.d(t,"k",(function(){return ti})),i.d(t,"lb",(function(){return ii})),i.d(t,"i",(function(){return ni})),i.d(t,"a",(function(){return oi})),i.d(t,"B",(function(){return si}
1)),i.d(t,"ab",(function(){return ai})),i.d(t,"ib",(function(){return li})),i.d(t,"G",(function(){return ci}));function T(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=N(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0,r=function(){};return{s:r,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:r}}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 o,s=!0,a=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return s=e.done,e},e:function(e){a=!0,o=e},f:function(){try{s||null==i.return||i.return()}finally{if(a)throw o}}}}function P(e,t,i,n,r,o,s){try{var a=e[o](s),l=a.value}catch(e){return void i(e)}a.done?t(l):Promise.resolve(l).then(n,r)}function k(e){return function(){var t=this,i=arguments;return new Promise((function(n,r){var o=e.apply(t,i);function s(e){P(o,n,r,s,a,"next",e)}function a(e){P(o,n,r,s,a,"throw",e)}s(void 0)}))}}function x(e){return(x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function R(e){throw new TypeError('"'+e+'" is read-only')}function D(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var n,r,o,s,a=[],l=!0,c=!1;try{if(o=(i=i.call(e)).next,0===t){if(Object(i)!==i)return;l=!1}else for(;!(l=(n=o.call(i)).done)&&(a.push(n.value),a.length!==t);l=!0);}catch(e){c=!0,r=e}finally{try{if(!l&&null!=i.return&&(s=i.return(),Object(s)!==s))return}finally{if(c)throw r}}return a}}(e,t)||N(e,t)||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 N(e,t){if(e){if("string"==typeof e)return L(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?L(e,t):void 0}}function L(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}var M=function(e){var t={};return document.cookie.split(";").forEach((function(e){var i=D(e.split("="),2),n=i[0],r=i[1];t[n.trim()]=r})),t[e]},U=!0===M("sutr")||"true"===M("sutr")||"1"===M("sutr")||1===M("sutr"),F=function(){var e=$
1("#tipo_id_fiscal"),t=$("#country_fiscal"),i=$("#identificador_fiscal");0!==i.length&&(e.on("change",(function(){"01"==e.val()&&"ES"==t.val()?(i.attr("data-is-dnicifnie",!0),i.attr("data-is-documentvalidator",!0)):i.removeAttr("data-is-dnicifnie"),""!==i.val()&&i.parsley().validate()})),t.on("change",(function(){"01"==e.val()&&"ES"==t.val()?i.attr("data-is-dnicifnie",!0):i.removeAttr("data-is-dnicifnie"),""!==i.val()&&i.parsley().validate()})))};function j(e){var t=/^(?=.*[0-9])(?=\S+$).{0,16}$/;return null===t||t.test(e)}var V={X:"0",Y:"1",Z:"2"};function B(e){if(!e)return!1;var t=e.toUpperCase();if(!/^[XYZ]?\d{5,8}[A-Z]$/.test(t))return!1;var i=t.slice(0,-1),n=t.slice(-1),r=i[0],o=V[r]?V[r]+i.slice(1):i;return"TRWAGMYFPDXBNJZSQVHLCKET"[Number(o)%23]===n}var G=function(e){return $(e).find('[type="submit"], button.--save')},q=function(e,t){c.a.l("---\x3eresetTooltipError"),c.a.l("$element"),c.a.l(e),e.off(".zf.trigger .zf.tooltip"),c.a.l(0);var i=e.hasClass("tooltip-parent");try{e.foundation("destroy")}catch(e){c.a.l("error del foundation destroy")}$(e).attr("data-title-html",t),c.a.l(1),i||$(e).attr("title",t),$(e).removeClass("_processed"),c.a.foundation(!0,e)},H=function(e){e.off(".zf.trigger .zf.tooltip"),e.foundation("destroy"),$(e).removeClass("has-error-submit-tooltip"),$(e).removeAttr("data-type-error");var t=U?"left":"top";$(e).addClass(t),$(e).removeAttr("data-tooltip"),$(e).removeAttr("data-allow-html"),$(e).removeAttr("data-title-html"),$(e).removeAttr("title"),$(e).removeAttr("data-tooltip-class"),$(e).removeClass("_processed")},z=function(e){try{$(e).foundation("show"),$(e).foundation("hide")}catch(e){console.error("error en tooltipErrorShowHide")}},K=function(){u("#tradeName"),u("#direccion_fisica"),u("#cp_fisica"),u("#ciudad_fisica"),u("#web"),u("#phone"),u("#agencyIdentification"),u("#hasGroup"),u("#nombre_fiscal"),u("#cp_fiscal_BR"),u("#ciudad_fiscal"),u("#cp_fiscal"),u("#identificador_fiscal"),u("#direccion_fiscal"),u("#pec"),u("#name"),u("#surname")},W=function(){u("#identificador_fiscal"),u("#direccion_fiscal"),u("#tipo_id_fiscal")},Y=function(){u("#accommodationName"),u("#direccion_fisica"),u("#ciudad_fisica"),u("#cp_fisica"),u("#worksWithPms"),u("#name"),u("#surname"),u("#phone")},J=function(){u("#name"),u("#surname"),u("#city"),u("#phone")},X=function e(t,i,n){n=null!=n?n:"init";var r=$(t).attr("data-field"),o=$(t).attr("data-change"),s=null!=o?$("#"+o):null,a=$();null!=s&&(a=s.find(".m-super-radio__currency_peque"));var l=$(t).attr("data-change-data"),u=null!=l?window[l]:null,d=[];$.each(u,(function(e,t){d[e-1]=t}));var f=null!=i?i:parseInt($("input[name="+r+"]").val()),h=parseInt($("input[name="+r+"]").attr("min")),p=parseInt($("input[name="+r+"]").attr("max")),v=$("[data-note="+r+"]"),g=$("#"+$(t).attr("data-change-pagantis")),m=$(g).find("select"),_=$(g).find(".pg-sim-custom-amount-value");if("init"==n&&m.length>0&&(isNaN(h)&&($("input[name="+r+"]").attr("min",$(m).find("option").first().val()),R("minValue"),h=parseInt($(m).find("option").first().val())),isNaN(p)&&($("input[name="+r+"]").attr("max",$(m).find("option").last().val()),R("maxValue"),p=parseInt($(m).find("option").last().val()))),"minus"==n&&f-1>=h||"plus"==n&&f+1<=p||"init"==n)if("minus"==n&&(d.length>0&&(void 0===d[f-2]||null===d[f-2]||""===d[f-2])||m.length>0&&0==m.find('option[value="'+(f-1)+'"]').length))e(t,f-1,"minus");else if("plus"==n&&(d.length>0&&(void 0===d[f]||null===d[f]||""===d[f])||m.length>0&&0==m.find('option[value="'+(f+1)+'"]').length))e(t,f+1,"plus");else if(!isNaN(f)&&f>0||"init"==n){if("minus"==n){if($("input[name="+r+"]").val(f-1),m.length>0){var y=new Event("change");m.val(f-1),m[0].dispatchEvent(y)}}else if("plus"==n){if($("input[name="+r+"]").val(f+1),m.length>0){var b=new Event("change");m.val(f+1),m[0].dispatchEvent(b)}}else"init"==n&&m.length>0&&$("input[name="+r+"]").val($(m).find("option:selected").val());if("minus"==n&&null!==s&&$(s).length>0){if(null!=d&&d[f-2])$(s).html(d[f-2]);else if(g.length>0){var E=c.a.returnNumberWithParams(_.html(),c.a.getCurrencySymbol($(t).attr("data-change-pagantis-currency")),null,null,!0),w=1==parseInt($(m).find("option:selected").val())?c.a.tr("instalment_with_amount",E):c.a.tr("instalment_with_amount_plural",E);$(s).html(w)}$(s).append(a)}else if("plus"==n&&null!==s&&$(s).length>0){if(null!=d&&d[f])$(s).html(d[f]);else if(g.length>0){var I=c.a.returnNumberWithParams(_.html(),c.a.getCurrencySymbol($(t).attr("data-change-pagantis-currency")),null,null,!0),O=1==parseInt($(m).find("option:selected").val())?c.a.tr("instalment_with_amount",I):c.a.tr("instalment_with_amount_plural",I);$(s).html(O)}$(s).append(a)}else if("init"==n&&null!==s&&$(s).length>0){if(null!=d&&d[f-1])$(s).html(d[f-1]);else if(g.length>0){var S=c.a.returnNumberWithParams(_.html(),c.a.getCurrencySymbol($(t).attr("data-change-pagantis-currency")),null,null,!0),A=1==parseInt($(m).find("option:selected").val())?c.a.tr("instalment_with_amount",S):c.a.tr("instalment_with_amount_plural",S);$(s).html(A)}$(s).append(a)}null!=v&&$(v).length>0&&$(v).each((function(e,t){var i=$(t).attr("data-note-singular"),n=$(t).attr("data-note-plural");1==$("input[name="+r+"]").val()&&null!=i?$(t).html(c.a.tr(i)):$("input[name="+r+"]").val()>1&&null!=i&&$(t).html(c.a.tr(n))}))}else $("input[name="+r+"]").val(0)},Z=function(e,t,i){!function(e,t,i){var n=e.hasClass("tooltip-parent"),r=U?"left":"top";$(e).addClass(r),$(e).attr("data-tooltip",!0),$(e).attr("data-allow-html",!0),$(e).attr("data-title-html",t),n||$(e).attr("title",$(t).text()),$(e).attr("data-tooltip-class",i),c.a.foundation(!0,e)}(e,'<div class="messages-wrapper">'.concat(t,"</div>"),"tooltip error-submit-tooltip".concat(i))},Q=function(e,t,i){setTimeout((function(){c.a.tooltipHtml(),c.a.tooltipPreventDefault()}),500),z(e),i&&t.length>0&&setTimeout((function(){z(t)}))}
1,ee=function(){var e=$('input[type="number"]');$(e).on("keydown",(function(e){69===e.which&&e.preventDefault()}))},te=function(){if(document.querySelectorAll('input[type="number"]').length>0){var e=function(e){"number"===e.target.type&&e.target.blur()};document.removeEventListener("wheel",e),document.addEventListener("wheel",e,{passive:!0})}},ie=function(e){e=null!=e?e:$("body");var t=$(e).find(":input");$(t).filter('[font-select="true"]').each((function(e,t){var i=$(t).attr("placeholder");$(t).is(":visible")&&$(t).fontselect({systemFonts:[],googleFonts:["Montserrat","Open+Sans","Lato","Oswald","Rokkitt","Merriweather","Playfair+Display","Josefin+Sans","Courier+Prime"],placeholder:null!=i&&""!==i?i:"Font",searchable:!1})}))},ne=function(e){e=null!=e?e:$("body");var t="undefined"!=typeof CivAPP&&null!==CivAPP&&void 0!==CivAPP.ColorPicker&&null!==CivAPP.ColorPicker?CivAPP.ColorPicker:null,i=$(e).find(":input"),n=$(i).filter('[color-select="true"]');n.length>0&&null!==t&&n.each((function(e,i){var n=$('<div class="color-select"></div>');$(i).parent().append(n),$(i).attr("type","hidden"),s.a.render(r.a.createElement(t,{defaultValue:"#"+$(i).val()}),n[0])}))},re=function(e,t,i){$(e).val()!=i?$(t).hide():$(t).show()},oe=function(e,t,i){$(e).val()===i?$(t).removeAttr("required"):$(t).attr("required","required")}
1,se=function(){var e=$("#activityPaxDataForm"),t=$('[name="payLaterActive"]');if(0!==e.length||0!==t.length){var i=$(t).filter("#payLater_deactive"),n=$(t).filter("#payLater_active");if($(n).length>0){var r=function(){var e=$(n).attr("type");"checkbox"==e&&$(n).is(":checked")?$(n).trigger("click"):"radio"==e&&$(i).length>0&&!$(i).is(":checked")&&$(i).trigger("click")},o=function(e){if(c.a.isElementVisible(e)){if(c.a.isElementVisible(e))var t=0,i=setInterval((function(){t<1e3?c.a.isElementVisible(e)?t+=100:(clearInterval(i),setTimeout((function(){r()}))):clearInterval(i)}),100)}else r()},s=$(n).attr("data-currencies");s="string"==typeof s&&""!=s?JSON.parse(s):s;var a=$(n).closest("[data-depends-on]");if($(a).length>0){var l=c.a.regexArrayString(a.attr("data-depends-on"))?JSON.parse(a.attr("data-depends-on")).length>1?JSON.parse(a.attr("data-depends-on")):JSON.parse(a.attr("data-depends-on"))[0]:a.attr("data-depends-on");l=Array.isArray(l)?l:[l],$.each(l,(function(e,t){var i,n=$('[id="'+t+'"]');n.length>0&&(i="radio"===(n[0].type||n[0].tagName.toLowerCase())?'[name="'+$(n).attr("name")+'"]':'[id="'+t+'"]',o(a),$(i).off("change.initPayLaterInputsDisplay"),$(i).on("change.initPayLaterInputsDisplay",(function(){o(a)})))}))}if(null!=s&&Array.isArray(s)&&s.length>0){var u=e.find("input[name=divisa]"),d=function(){var e=u.filter(":checked");if(-1==s.indexOf(e.attr("id"))&&$(n).is(":enabled")){$(n).prop("disabled",!0);var t=$(n).attr("type");"checkbox"==t&&$(n).is(":checked")?$(n).trigger("click"):"radio"==t&&$(i).length>0&&!$(i).is(":checked")&&$(i).trigger("click")}else-1==s.indexOf(e.attr("id"))||$(n).is(":enabled")||$(n).prop("disabled",!1)};d(),$(u).off("change.initPayLaterInputsDisplay"),$(u).on("change.initPayLaterInputsDisplay",(function(){d()})),"undefined"!=typeof adyenComponents&&null!==adyenComponents&&"object"===("undefined"==typeof adyenComponents?"undefined":x(adyenComponents))&&Object.keys(adyenComponents).length>0&&($(t).off("change.initPayLaterInputsDisplayStore"),$(t).on("change.initPayLaterInputsDisplayStore",(function(e){var t=$(n).is(":checked");$.each(adyenComponents,(function(e,i){var n=i._node||null;if($(n).length>0){var r=$(n).find('input[name="storeDetails"]');$(r).length>0&&(t?($(r).prop("checked",!0),$(r).prop("disabled",!0)):($(r).prop("checked",!1),$(r).prop("disabled",!1)))}}))})))}}}},ae=function(){if(void 0===window.intlTelInputGlobals||null===window.intlTelInputGlobals)return!1;var e=window.intlTelInputGlobals.getCountryData(),t=window.prefixCountries,i=[],n=[],r=[],o=[],s=null!=t&&Object.keys(t).length>0,a=null!=e&&e.length>0;if(s&&a)for(var l=0;l<e.length;l++){var c=e[l],u=t[c.iso2.toUpperCase()],d=null!=u&&void 0!==u.name&&null!==u.name&&""!==u.name?u.name:u,f=null!=u&&void 0!==u.id&&null!==u.id&&""!==u.id?u.id:null;null!=d&&""!==d?(null!=f&&""!==f&&(c.civId=f),c.name!==d?(c.oldName=c.name,c.name=d,i.push(c)):n.push(c),o.push(c)):(r.push(c),e.splice(l,1),l--)}e.sort((function(e,t){return e.name>t.name?1:-1}))},le=function(){document.querySelectorAll("[data-prefix-change]").forEach((function(e){e.addEventListener("change",(function(e){var t=e.target,i=t.getAttribute("data-prefix-change"),n=document.getElementById(i);if(n){var r=Array.from(t.options).filter((function(e){return e.value===t.value}))[0];n.value=r.getAttribute("data-prefix"),n.dispatchEvent(new Event("change"))}}))}))},ce=function(e,t){e.closest("form").add(e.find("form")).each((function(){var i=$('<div class="o-info o-info--error hide"></div>'),n=e.find(":input").not(":hidden");0==e.find(".o-info.o-info--error").length&&e.prepend(i),t||n.each((function(t){e.on("select2:close",(function(e){setTimeout((function(){var e=window._docKeyProps||{},i=e.keyCode,r=e.shiftKey;if(9===i){var o=r?t-1:t+1;n.eq(o).focus()}}),100)}))}))}))},ue=function(e){e.find(":input").each((function(e,t){$(t).is('[type="radio"], [type="checkbox"]')||void 0===$(t).val()||null===$(t).val()||""===$(t).val()||$(t).parsley().validate()}))},de=function(e){"affiliate-myaccount-form"===e.attr("id")&&"undefined"!=typeof autobillConditions&&(window.originalAutobillConditions=autobillConditions,window.autonomousHasAutobillConditionsOk=$("#tipoAfiliado2").is(":checked")&&"1"===autobillConditions)},fe=function(e){if("widger-generator"===e.attr("id")){var t=G(e),i=e.find(':input[name="display"]');i.length>0&&i.on("change.inputChangeWidgetSubmit",(function(){t.hasClass("--deactive")&&t.removeClass("--deactive"),i.off("change.inputChangeWidgetSubmit")}))}},he=function(e){e.each((function(e,t){void 0===$(t).data("error-messages")||null===$(t).data("error-messages")||1!=$(t).data("error-messages")&&"true"!=$(t).data("error-messages")&&"1"!=$(t).data("error-messages")||$(t).parent().find(".parsley-errors-list").remove();$(t).removeClass("--error")}))},pe=function(e){e.each((function(e,t){if(void 0!==$(t).data("error-messages")&&null!==$(t).data("error-messages")&&(1==$(t).data("error-messages")||"true"==$(t).data("error-messages")||"1"==$(t).data("error-messages"))){var i=c.a.tr("dropzone_required"),n=$('<ul class="parsley-errors-list filled"><li class="parsley-required">'+i+"</li></ul>");$(n).insertBefore($(t))}$(t).addClass("--error")}))},ve=function(e,t,i){i=i||[],(t=null!=t&&(1==t||"true"==t||"1"==t))&&(null==i||!Array.isArray(i)||Array.isArray(i)&&0==i.length)&&$(e).addClass("js-hide")},ge=function(e){$(e).parsley().reset(),$(e)[0].reset(),$(e).find("select").trigger("change"),$(e).find("select").trigger("select2:select")}
1,me=function(){var e=$("#generic-contact"),t=$("#transfers-contact"),i=$(".a-icon--account"),n=$(".a-icon--compass");$(i).on("click",(function(){t.length>0&&t[0].reset()})),$(n).on("click",(function(){e.length>0&&e[0].reset()}))},_e=function(){var e=$("#user-register"),t=e.find("#cp_fisica"),i=e.find("#cp_fiscal"),n=e.find("#cp_fisica_BR"),r=e.find("#cp_fiscal_BR"),o=e.find("#country_fisica"),s=e.find("#country_fiscal");o.on("change",(function(){var e=n.val();"BR"==o.val()||"br"==o.val()?t.val(""):("BR"!=o.val()||"br"!=o.val())&&(null==e?void 0:e.length)>0&&n.val("")})),s.on("change",(function(){var e=r.val();"BR"==s.val()||"br"==s.val()?i.val(""):("BR"!=s.val()||"br"!=s.val())&&e.length>0&&r.val("")}))},ye=function(){document.querySelectorAll("[data-validate-related]").forEach((function(e){var t=e.getAttribute("data-validate-related");if(t&&""!==t.trim()){var i=t.split(",");e.addEventListener("change",(function(){i.forEach((function(e){var t=e.trim(),i=document.getElementById(t);i?$(i).parsley&&"function"==typeof $(i).parsley?$(i).parsley().validate():console.error("Parsley has not been initialized on the element with ID â".concat(t,"â.")):console.error(" ERROR: The element with ID â".concat(t,"â was not found in the DOM."))}))}))}else console.error("Attribute 'data-validate-related' is empty or missing.")}))},be=function(){document.querySelectorAll("[data-parsley-phoneintltel-google]").forEach((function(e){var t=/^[0-9\+\-\(\)\s]*$/,i=/[^0-9\+\-\(\)\s]*/g;e.addEventListener("keydown",(function(e){var i=e.key,n=e.keyCode,r=e.ctrlKey;void 0!==i&&("Backspace"===i||"Delete"===i||"Tab"===i||"Escape"===i||"Enter"===i||"a"===i&&!0===r||"c"===i&&!0===r||"x"===i&&!0===r||"v"===i&&!0===r||n>=37&&n<=40||i.match(t)||e.preventDefault())})),e.addEventListener("paste",function(){var e=k(regeneratorRuntime.mark((function e(t){var n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.target,e.next=3,navigator.clipboard.readText();case 3:r=e.sent,n.value=r.replace(i,"");case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())}))},Ee=function(e){try{var t,i=(null!==(t=e[0])&&void 0!==t?t:e).value;return/^\s*(\+\d+)?(([-.]|\s*)?\(\d+\))?(([-.]|\s*)?\d+)+\s*$/.test(i)}catch(e){return!1}},we=function(e,t){var i=!0;null!=e&&""!==e&&("string"==typeof e&&(e=JSON.parse(e)),void 0!==e.errors&&null!==e.errors&&""!==e.errors&&e.errors.length>0&&""!==e.errors[0]&&(i=!1)),t.hasClass("js-form-resetOnSuccess")?i&&ge(t):t.hasClass("js-form-resetOnError")?i||ge(t):t.hasClass("js-form-reset")&&ge(t)},Ie=function(e){G(e).addClass("--disabled-button"),e.find(':input:not([data-exception-disabled= "true"])').prop("disabled",!0)}
1,Oe=function(){var e=$(".zone-row");"none"==$("#region-container").css("display")&&(e.removeClass("rearrange-2"),e.addClass("rearrange")),"block"==$("#province-container").css("display")&&"block"==$("#region-container").css("display")&&(e.removeClass("rearrange"),e.addClass("rearrange-2"))},Se=function(){var e=$(".--paypal"),t=$(".paypal-message").find("span").find("iframe");e.on("click",(function(){t.css("opacity","1")}))},Ae=function(e){var t=e;try{if("string"==typeof t&&(t=JSON.parse(t)),"1"===t.agencyLogin&&"string"==typeof t.agency&&""!==t.agency){var i={event:"AgencyLogin",agencyId:t.agency};void 0!==t.affiliate_id&&(i.affiliateId=t.affiliate_id),dataLayer.push(i)}}catch(e){}},Ce=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=$("#cartPaxDataForm").find("#email"),n=null!==e&&e.length>0&&null!==e[0],r=null!==t&&t.length>0&&null!==t[0];if((n||r)&&!t.some((function(e){return"error_activity_prebooking"===e.id}))){var o=n?e:t,s=n?"error_activity_cart14":c.a.tr("error_activity_cart14"),a=o.map((function(e){return null!==e?n?c.a.tr(e):e:""})).join("\n");CivAPP.ConfirmUtil.showWarning({message:a,closeCallback:function(){o.includes(s)&&i.val("").removeClass("parsley-success").removeClass("parsley-error").parent(".u-floating-label--s").removeClass("is-focused").removeClass("is-focused-and-empty")}})}},$e=function(e){e=void 0!==e?$(e):$("body");var t=$(e).find('input[type="email"][data-check-mail]');t.length>0&&t.off("blur.checkMail").on("blur.checkMail",(function(){t.val()===t.data("check-mail")&&Ce(["error_activity_cart14"])}))},Te=function(e,t,i){i="function"==typeof i?i:Function.prototype;var n=Function.prototype;switch(e){case"alphabeticalAZ":n=function(e,t){return e.text<t.text?-1:1};break;case"alphabeticalZA":n=function(e,t){return e.text>t.text?-1:1};break;case"older":n=function(e,t){return e.defaultOrder<t.defaultOrder?-1:1};break;case"moreRecent":n=function(e,t){return e.defaultOrder>t.defaultOrder?-1:1}}t.sort(n),t.map((function(e,t){$("#"+e.id).css("order",t)})),i()},Pe=function(e,t){var i=$('[id="'+$(e).data("paste-html-element")+'"]');t=null!=t?t:$(i).children(":not(.js-hide)").length;var n=$(i).children(":not(.js-hide)").find("[data-remove-html-element]");t<=1?$(n).addClass("js-hide"):$(n).removeClass("js-hide")},ke=function(e,t){var i=$('[id="'+$(e).data("paste-html-element")+'"]'),n=$('[id="'+$(e).data("counter-element")+'"]');t=null!=t?t:$(i).children(":not(.js-hide)").length,n.val(t)},xe=function(e,t){var i=$('[id="'+$(e).data("paste-html-element")+'"]');t=null!=t?t:$(i).children(":not(.js-hide)").length;var n=void 0!==$(e).data("max-copy-paste-elements")&&null!==$(e).data("max-copy-paste-elements")&&""!==$(e).data("max-copy-paste-elements")?parseInt($(e).data("max-copy-paste-elements")):null;null!==n&&t>=n?$(e).addClass("js-hide-important"):$(e).removeClass("js-hide-important")},Re=function(e,t){t=null!=t&&(1==t||"true"==t||"1"==t);var i=$(e).find("#activity");i.length>0&&($(i).attr("data-id",""),$(i).attr("data-country",""),t&&$(i).val(""))},De=function(e){$(e).find(':input:not([data-exclude-reset="true"])').each((function(){switch(this.type){case"password":case"select-multiple":case"select-one":case"text":case"textarea":case"hidden":case"tel":case"number":$(this).val("");break;case"checkbox":case"radio":this.checked=!1}"select-multiple"!=this.type&&"select-one"!=this.type||($(this).trigger("change"),$(this).trigger("select2:select"))}))},Ne=function(e){e=null!=e?e:$("body"),$(e).find("[data-copy-html-element]").filter("[data-paste-html-element]").each((function(e,t){var i=$('[id="'+$(t).data("paste-html-element")+'"]');$(i).children(":not(.js-hide)").each((function(e,t){De(t);var i=$(t).find("[data-remove-html-element]");i.hasClass("js-hide")||i.trigger("click")}))}))},Le=function(e){if(null==e)return!1;var t=$(e).find("#cmp"),i=$(e).find("#lang"),n=$(e).find("#dest");if(t.length>0&&i.length>0){var r=$(t).data("auto-fill"),o=$(t).data("auto-fill-off");if(o=null!=o&&(1==o||"true"==o||"1"==o),null!=r&&""!==r&&!o){var s="";"widget"==r?s+=c.a.tr("widget"):"billboard"==r&&(s+=c.a.tr("poster")),n.length>0&&""!==$(n).val()&&void 0!==$(n).attr("data-id")&&null!==$(n).attr("data-id")&&""!==$(n).attr("data-id")&&(s+="_"+encodeURI(c.a.normalizeStringSpecialCharacters(n.val()).replace(/\s+/g,"_").replace(/[^A-Za-z0-9]/g,"_"))),s+="_"+i.val().toUpperCase(),$(t).val(s),$(t).trigger("change")}}},Me=function(e,t){var i=$(e).find("#dest"),n=$(e).find("#idDest"),r=$(e).find("#type");if($(i).removeAttr("data-id"),n.length>0&&($(n).val(""),$(n).trigger("change"),function(e){try{if(!e)throw new Error("Invalid input or suggestion data");var t=e.getAttribute("data-min-activities-by-dest-result"),i=document.getElementById(t);if(!i)throw new Error('Result input element with ID "'.concat(t,'" not found'));i.value="false"}catch(e){console.error("An error occurred:",e.message)}}($(i)[0])),r.length>0&&($(r).val(""),$(r).trigger("change")),Le(e),null!=t&&!0===t){var o=window.autocomplete.categories,s=$(e).find("select#categories"),a=$($(s).find("option")[0]).html();s.empty(),s.append($("<option></option>").attr("value","").text(a)),$.each(o,(function(e,t){s.append($("<option></option>").attr("value",t.id).text(t.name))})),$(s).trigger("change")}},Ue=function(e,t){try{if(!(e&&t&&t.data&&t.data.numberOfActivities))throw new Error("Invalid input or suggestion data");var i=e.getAttribute("data-min-activities-by-dest"),n=i&&!isNaN(i)?parseInt(i):null,r=e.getAttribute("data-min-activities-by-dest-result"),o=document.getElementById(r);if(!o)throw new Error('Result input element with ID "'.concat(r,'" not found'));var s=t.data.numberOfActivities;o.value=null!==n&&s<n?"true":"false"}catch(e){console.error("An error occurred:",e.message)}},Fe=function(e,t,i,n,r){c.a.l("updateDropzoneValidation"),he($(e.element));var o=!1;
1e.files.forEach((function(e){"error"===e.status&&(o=!0)})),$("#"+r+"-parley-list").remove();var s,a,l=(s=e.files,a=0,s.forEach((function(e){a+=e.size})),a);c.a.l("filesSize"),c.a.l(l);var u,d,f=(u=l,d=1048576*n,c.a.l("validateFileSize"),c.a.l(d),!(u<d));c.a.l("isPostMaxSizeError"),c.a.l(f);var h=r+"__container";if(o||f){if(c.a.l("updateDropzoneValidation: no es válido el peso"),t.find(".a-new-form-button_contact").attr("disabled",!0),t.find(".a-new-form-button_contact").addClass("--disabled-button"),0===$("#"+h).length){var p=$('<div id="'.concat(h,'" class="hide"><input type="text" name="').concat(r,'" id="').concat(r,'" required class="force-validate-required"></div>'));t.append(p)}if(f){var v=$('<ul class="parsley-errors-list _dropzone-error filled" id="'.concat(r,'-parley-list" style="order: 9"><li class="parsley-required">').concat(c.a.tr("dropzone.dictPostMaxSizeExceeded",n+"MB"),"</li></ul>"));$(e.previewsContainer).after(v)}}else c.a.l("updateDropzoneValidation: Sà es válido el peso"),$("#"+h).remove(),t.parsley()},je=function(e,t,i){var n=document.getElementsByClassName("error-submit-tooltip _mobile top"),r=document.getElementById("newsletter")&&n.length>0,o=function(){for(var e in n)e.style.display="none"};c.a.l("---\x3eaddTooltipErrorSubmit");var s=G(e),a=$(e).find(".tooltip-parent").filter((function(){return!t||$(this).find(t).length})),u=$(t).data("parent-anchor");c.a.l("parentTooltip"),c.a.l(a);var d="";switch(i){case"policy-check":r?o():(d='<span class="'.concat(i,' error">\n <span>').concat(c.a.tr($(t).data("policy-check-text")||"tooltip.errorPrivacyConditions"),"</span>\n </span>"),$(window).off("scroll.tooltip"),$(window).on("scroll.tooltip",l()((function(){$("#button_submit_continue").each((function(){$(this).foundation("hide")}))}),150)));break;case"email-error":var f="undefined"!=typeof punycode&&null!==punycode?punycode.toUnicode($(t).val()):$(t).val();d='<span class="'.concat(i,' warning">\n <span>').concat(c.a.tr("tooltip.errorEmail",f),"</span>\n </span>");break;case"phone-error":var h=$(t).val();d='<span class="'.concat(i,' warning">\n <span>').concat(c.a.tr("tooltip.errorPhone",h),"</span>\n </span>");break;default:d=""}if(s.length>0)if(s.hasClass("has-error-submit-tooltip"))setTimeout((function(){var e=$
1(s.attr("data-title-html"));(function(e,t){return 0!==e.find(".".concat(t)).length})(e,i)||(q(s,e.prop("outerHTML")),u&&a.length>0&&setTimeout((function(){q(a,e.prop("outerHTML"))}),500),Q(s,a,u))}),500);else{if(c.a.l("ð¶ !submitButton.hasClass('has-error-submit-tooltip')"),Ve(e),s.addClass("has-error-submit-tooltip").attr("data-type-error",i),u&&a.length>0)if(a.hasClass("_only-parent"))Z(s,d," js-hide-important"),setTimeout((function(){Z(a,d,"")}));else{var p=" _desktop";"policy-check"===i&&(r?o():p+=" _policy-check-tooltip "),Z(s,d,p),setTimeout((function(){Z(a,d," _mobile")}))}else c.a.l("entra por aquÃ"),Z(s,d,"");Q(s,a,u)}"policy-check"===i&&$(t).one("change",(function(){c.a.l("cambia el check condiciones"),setTimeout((function(){var n=$(t).hasClass("parsley-error")||$(t).parents(".parsley-error").length>0,r=$(t).is(":checked");!n&&r&&Ve(e,t,i)}),500),c.a.l("se va a lanzar la validación del teléfono..."),setTimeout((function(){""!==$("#telefono").val()?(c.a.l("se lanza porque no está vacÃo"),$(e).parsley().validate("phone-error")):c.a.l("no se lanza porque está vacÃo")}),500)}))},Ve=function e(t,i,n){c.a.l("---\x3eremoveTooltipErrorSubmit"),c.a.l("type"),c.a.l(n);var r=G(t),o=null!=i&&i.length>0&&$(i).closest(".tooltip-parent").length>0?$(i).closest(".tooltip-parent"):$(t).find(".tooltip-parent"),s=void 0!==$(i).attr("data-parent-anchor")&&null!==$(i).attr("data-parent-anchor")&&""!==$(i).attr("data-parent-anchor");if(r.length>0&&r.hasClass("has-error-submit-tooltip"))if((void 0===i||i.data("policy-check-text"))&&$(r).removeClass("has-error-submit-tooltip"),null!=i&&null!=n){var a=$(r).attr("data-title-html"),l=$(a);l.find("."+n).remove(),'<div class="messages-wrapper"></div>'!=(a=l.prop("outerHTML"))?(q(r,a),s&&o.length>0&&setTimeout((function(){q(o,a)}),500),Q(r,o,s)):H(r)}else H(r);"policy-check"==n&&$(i).on("change.policyCheckOn",(function(){c.a.l("$($input).is(':checked')"),c.a.l($(i).is(":checked")),c.a.l("cambia el check condiciones en removeTooltip"),setTimeout((function(){($(i).hasClass("parsley-error")||$(i).parents(".parsley-error").length>0||!$(i).is(":checked"))&&(c.a.l("se lanza el addTooltipErrorSubmit"),e(t,i,"phone-error"),je(t,i,n),$(i).off("change.policyCheckOn"))}))}))},Be=function(e){var t;t=void 0!==e?$("#"+e):$("[data-list-order]"),void 0===CivAPP.sortArrays&&(CivAPP.sortArrays={}
1),t.each((function(){var e=$(this),t=c.a.setIdIfNotId(e),i=$("#"+e.attr("data-list")),n=i.parents(".o-filters-container"),r=i.find("li:not(.js-hide)");r.length>0?n.removeClass("hide"):n.addClass("hide"),i.css({display:"flex","flex-direction":"column"}),void 0===CivAPP.sortArrays[t]&&(CivAPP.sortArrays[t]=[]);var o=CivAPP.sortArrays[t];r.each((function(e){var t=$(this),i=e;t.css("order",i);var n=c.a.setIdIfNotId(t);void 0===c.a.getById(n,o)&&o.push({id:n,text:t.find(".__activity").text(),defaultOrder:i})})),CivAPP.sortArrays[t]=o,e.off("change"),e.on("change",(function(){var t=e.val();Te(t,o)}));var s=e.val();Te(s,o)}))},Ge=function(e){e=$(e);var t=$(e).closest(".a-filter--applied"),i=e.closest(".o-filters--applied"),n=$("#"+e.data("remove-reference")),r=$("#"+e.data("remove-reference-aux")),o=$("#"+e.data("remove-reference-values")),s=$(t).attr("data-id"),a=$(t).attr("data-value");if("number"==typeof s&&(s=s.toString()),null!=s&&""!==s){var l=$(n).val();if(l=null!=l&&""!==l?l.split(","):[],null!=o&&o.length>0){var c=jQuery.inArray(a,u);u=null!=(u=$(o).val())&&""!==u?u.split("\n"):[]}else{c=jQuery.inArray(a,u);var u=[]}var d=jQuery.inArray(s,l);-1!==d&&(l.splice(d,1),l=l.join(),$(n).val(l),$(n).trigger("change"),null!=o&&o.length>0&&(u.splice(c,1),u=u.join("\n"),$(o).val(u),$(o).trigger("change")),$(t).remove(),$(i).find(".a-filter--applied:not(.--example)").length<=0&&$(i).addClass("js-hide")),r.length>0&&"-1"===s&&r.val("0");var f=i.attr("data-sort-select");"string"==typeof f&&Be(f)}},qe=function(e){var t=$(e).find("[data-remove-reference]");$(t).on("click",(function(e){e.stopPropagation();var t=$(this),i=t.attr("data-remove-element-url");if(void 0===i)Ge(t);else{c.a.loading();var n={activityId:t.parent("li").attr("data-id")};$.ajax({url:i,type:"POST",data:n}).done((function(){Ge(t),c.a.unLoadingAll()})).fail((function(){CivAPP.ConfirmUtil.showWarning({title:c.a.tr("modify_errorSavingChangesMessage"),message:""}),c.a.unLoadingAll()}))}}))},He=function(e){var t=$(e).find("#resultActivities");if(t.length>0){var i=$(t).find(".a-filter--applied:not(.--example)");$(i).each((function(e,t){var i=$(t).find("[data-remove-reference]");Ge(i)}))}},ze=function(e){var t=$(e).find("#resultCategories");if(t.length>0){var i=$(t).find(".a-filter--applied:not(.--example)");$(i).each((function(e,t){var i=$(t).find("[data-remove-reference]");Ge(i)}))}},Ke=function(e){var t=$(e).find("[data-paste-element]");$(t).each((function(e,t){var i=$("#"+$(t).data("paste-element"));if(i.length>0){var n=$(i).find(".a-filter--applied:not(.--example)");$(n).each((function(e,t){var i=$(t).find("[data-remove-reference]");Ge(i)}))}}))},We=function(e,t){t=void 0!==t?$(t):$("body");var i="#"+e,n=$(t).find(i);switch(e){case"hotelSearchForm":case"hotelSearchFormAside":var r=t.find("#roomStartDate"),o=t.find("#roomEndDate"),s=t.find("#diaLlegada");0===$(s).length&&(n.append('<input type="hidden" id="diaLlegada" name="diaLlegada" value="myvalue" />'),n.append('<input type="hidden" id="mesLlegada" name="mesLlegada" value="myvalue" />'),n.append('<input type="hidden" id="diaSalida" name="diaSalida" value="myvalue" />'),n.append('<input type="hidden" id="mesSalida" name="mesSalida" value="myvalue" />')),t.find("#diaLlegada").val(c.a.dateToFormat(new Date($(r).val()),"D")),t.find("#mesLlegada").val(c.a.dateToFormat(new Date($(r).val()),"YYYY-M")),t.find("#diaSalida").val(c.a.dateToFormat(new Date($(o).val()),"D")),t.find("#mesSalida").val(c.a.dateToFormat(new Date($(o).val()),"YYYY-M"))}},Ye=function(e,t,i,n,r){if(0==$("[data-filter*='"+t+"']").length){if(n.parsley().validate(),!n.parsley().isValid()){var o=$(n).find('[data-policy-check="true"]');return o.length>0&&($(o).hasClass("parsley-error")||$(o).parents(".parsley-error").length>0||!$(o).is(":checked")?je(n,o,"policy-check"):Ve(n,o,"policy-check")),!1}Ve(n),"confirmModifyBooking"==t&&c.a.sendMessageToApp("setModifyCancelStatus",1),We(t,i),r&&c.a.loading(t),n[0].submit()}},Je=function(e){e=void 0!==e?e:c.a.$(".o-form, .o-form--inverse"),$(e).find(".parsley-errors-list").remove(),$(e).find(".parsley-error").removeClass("parsley-error")},Xe=function(e){var t=e.find(".parsley-error:first");
1if(t.length>0&&!t.is("[data-dont-scroll-on-error]")&&!e.is("[data-dont-scroll-on-error]"))if("true"===M("sutr")&&t.find("#condiciones").length>0);else{var i=t.closest(".o-form-block, .columns"),n=c.a.isMobile()?i.offset().top:i.offset().top-20;if(i.hasClass("tooltip-parent")&&(n-=250),i.hasClass("o-form-block"))c.a.scrollBodyTo(n);else if(i.hasClass("columns")){$(window).scrollTop()!==n+1&&c.a.scrollBodyTo(n,{callback:function(){setTimeout((function(){$(window).scrollTop($(window).scrollTop()+1)}),500)}})}setTimeout((function(){return t.focus()}))}},Ze=function(){$("#otherDestinationCheck").on("change.p",(function(){$(this).is(":checked")?($("#destinations").removeAttr("required"),$("#dest-container").find(".parsley-errors-list").addClass("hide")):($("#destinations").attr("required","required"),$("#dest-container").find(".parsley-errors-list").removeClass("hide"))}))},Qe=function(){if(!c.a.isAffiliatesPanel()){var e=$("[data-vehicle-id]"),t=c.a.getParam("reqid"),i="/add-transfer-to-cart";CivAPP.isGuide||(i=void 0!==window.civLocale&&null!==window.civLocale?"/"+window.civLocale+"/add-transfer-to-cart":"/es/add-transfer-to-cart"),e.each((function(){var e,n=$(this);e=!!n.attr("data-cart")&&n.attr("data-cart");var r={vehicleId:n.attr("data-vehicle-id"),reqid:t,cart:e};if(c.a.hasMobileApp()||c.a.hasWebKit()){var o=c.a.readCookie("emailApp"),s=window.emailApp,a=null!=o&&""!==o?o:null!=s&&""!==s?s:"";"undefined"!==a&&null!==a&&""!==a&&(r.emailApp=a)}"true"===M("sutr")&&(r.sutr=!0);var l=Function.prototype;if(window.isGTMNewModelEnabled){var u=n.attr("data-gtm-new-model-add-to-cart");try{u=JSON.parse(u);try{for(var d=u.ecommerce.add.products,f=0;f<d.length;f++)d[f].quantity=1}catch(e){}l=function(){dataLayer.push(u),function(e){if(Object(p.a)()&&"function"==typeof window.wunderkindSDK&&Array.isArray(e)){var t,i=v(e);try{for(i.s();!(t=i.n()).done;){var n=t.value;null!=n&&null!=n.id&&window.wunderkindSDK("addToCart",{"item:id":String(n.id)})}}catch(e){i.e(e)}finally{i.f()}}}(u&&u.ecommerce&&u.ecommerce.add&&u.ecommerce.add.products)}}catch(e){c.a.l("... el contenido del atributo (data-gtm-new-model-add-to-cart) no es json válido"),c.a.l(u)}}n.on("click",(function(){window.navigator.onLine?(CivAPP.loader.showModal({text:c.a.tr("addingTransferToCart")}),$.ajax({url:i,type:"POST",data:JSON.stringify(r),contentType:"application/json",dataType:"json",success:function(t){if(c.a.hasMobileApp("setCartStr")||c.a.hasWebKit("setCartStr")){var i=JSON.stringify(t);c.a.sendMessageToApp("setCartStr",i)}if(null==x(t.errors)||null==t.errors||""==t.errors)if("true"==e||1==e)if(CivAPP.Cart.pushElement(t),c.a.hasMobileApp("setCartStr")||c.a.hasWebKit("setCartStr")){var n={title:c.a.tr("cartMessageCorrect"),titleExtraClass:"--confirmed"};void 0===CivAPP.isGuide||null===CivAPP.isGuide||!0!==CivAPP.isGuide||c.a.setCartAppCivitatisAndGuideCheck()||(n.buttonText=c.a.tr("cartFinishBooking"),n.buttonUrl=t.action),CivAPP.ConfirmUtil.cartModal(n)}else l(),O(t.action)?CivAPP.loader.closeModal():document.location=t.action;else c.a.hasMobileApp("setCartStr")||c.a.hasWebKit("setCartStr")||(O(t.action)?CivAPP.loader.closeModal():window.location.href=t.action);else CivAPP.loader.closeModal(),CivAPP.ConfirmUtil.showWarning({title:t.errors,message:c.a.getCartMessageErrorService()})},error:function(e,t,i){CivAPP.loader.closeModal(),CivAPP.ConfirmUtil.showWarning({title:c.a.tr("cartMessageFatalError"),message:c.a.getCartMessageErrorService()}),0!==e.status&&(c.a.isLocal()?console.error(new Error("Ajax error: "+t+", "+i)):console.error(new Error("Ajax error: "+t+", "+i+" || Cart id "+c.a.readCookie("cart")+" || Ajax request: "+r+" || Ajax response: status: "+e.status+", statusText: "+e.statusText+", responseText: "+e.responseText)))},complete:function(e,t){}})):CivAPP.ConfirmUtil.showWarning({title:c.a.tr("cartError_addItem_conexionError_title"),message:c.a.tr("cartError_addItem_conexionError_subtitle")})}))}))}},et=function(e,t,i){$(e).closest(".o-form").find(".o-info__container").find(".o-info").addClass("hide"),c.a.unLoadingAll(),CivAPP.ConfirmUtil.showSuccess({title:i.message,message:"",closeCallback:function(){window.location.href=i.actionRedirect}})},tt=function(e,t,i){$(e).closest(".o-form").find(".o-info__container").find(".o-info").addClass("hide");var n=null!=i&&void 0!==i.errors&&null!==i.errors&&i.errors.length>0,r=c.a.tr("cartMessageFatalError"),o=n?i.errors[0]:c.a.getCartMessageErrorService();c.a.unLoadingAll(),CivAPP.ConfirmUtil.showWarning({title:r,message:o})},it=function(e,t,i){var n=Date.now();if(void 0!==window._checkoutRedirectTime&&window._checkoutRedirectTime>
10&&n-window._checkoutRedirectTime<2e3)return;window._checkoutRedirectTime=n;var r=$(e).siblings(".o-info"),o=$(r).find(".--inner");$(r).addClass("hide"),$(o).html("");var s=i.action;if(!0===CivAPP.isGuide&&-1!==s.indexOf("civitatis.com")&&"undefined"!=typeof ga&&null!==ga&&"function"==typeof ga.getAll&&void 0!==ga.getAll()&&null!==ga.getAll()&&ga.getAll().length>0){var a=ga.getAll()[0].get("linkerParam").split("=");s=c.a.addParam(a[0],a[1],s)}window.location.href=s},nt=function(e,t,i){var n=$(e).siblings(".o-info"),r=$(n).find(".--inner");$(r).html(""),$(i.errors).each((function(e,t){$(r).append($("<p>"+t+"</p>"))})),$(n).removeClass("hide");for(var o=$(".o-cart-summary__item, .o-form-block"),s=i.cart.items,a=$(".o-container-price-yellow"),l=$(a).find(".a-total"),c=$(a).find(".a-pagado"),u=$(a).find(".a-restante"),d=$(a).find(".a-resto-pagar"),f=parseFloat(i.cart.totalPrice),h=parseFloat(i.cart.totalDeposit),p=f-h,v=i.cart.displayCurrency,g=0,m=0;m<s.length;m++){var _=$(o).filter('[data-requestid="'+s[m].itemId+'"]'),y=$(_).filter(".o-cart-summary__item").find(".o-cart-summary__item__price span"),b=$(_).filter(".o-cart-summary__item").find(".o-cart-summary__item__body__paxes"),E=s[m].paxes,w=s[m].totalPriceInDisplayCurrency;" true "==s[m].errors?($(y).html(w+" "+v),_.fadeTo(500,0,(function(){_.animate({height:"0px",padding:"0px"},500,(function(){var e=_.parents(".l-main-section");if(_.remove(),g++,s.length==g){var t=e.data("carterror");null!=x(t)&&null!=t&&""!=t&&(window.location.href=t)}}))})),$(l).find("span").html(f+" "+v),$(c).find("span").html(h+" "+v),$(u).find("span").html(p+" "+v),f==h&&($(c).addClass("hide"),$(u).addClass("hide"),$(d).addClass("hide"))):" true "==s[m].warning&&($(y).html(w+" "+v),$(b).html(""),$(E).each((function(e,t){var i="<li>"+t.pax+" "+t.ticket,n=w;null!=x(t.priceInDisplayCurrency)&&null!=t.priceInDisplayCurrency&&""!=t.priceInDisplayCurrency?(n=(n=parseFloat(t.pax)*parseFloat(t.priceInDisplayCurrency)).toString().replace(".",","),i+=" X "+t.priceInDisplayCurrency+" "+v+'<span class="--right">'+n+" "+v+"</span></li>"):i+='<span class="--right">'+n+" "+v+"</span></li>",$(b).append($(i))})),$(l).find("span").html(f+" "+v),$(c).find("span").html(h+" "+v),$(u).find("span").html(p+" "+v),f==h&&($(c).addClass("hide"),$(u).addClass("hide"),$(d).addClass("hide")))}},rt=function(e,t,i){var n=i.oldFreeTour,r="",o="";1==n.length?(r=c.a.tr("cartMessageFreeTourReservedTitle",n[0].title,c.a.getMoment(n[0].date).format("D MMMM YYYY"),n[0].time),o=c.a.tr("cartMessageFreeTourReservedBody")):(r=c.a.tr("cartMessageFreeTourMultipleReservedTitle"),o+='<div><ul class="u-margin--b--20">',$.each(n,(function(e,t){o+="<li>"+c.a.tr("cartMessageFreeTourMultipleReservedBody2",t.title,c.a.getMoment(t.date).format("D MMMM YYYY"),t.time)+"</li>"})),o+="</ul><p>"+c.a.tr("cartMessageFreeTourMultipleReservedBody")+"</p></div>"),$(e).removeClass("--disable-button"),CivAPP.ConfirmUtil.cartModal({title:r,titleExtraClass:"--info",body:o,buttonText:c.a.tr("btns.continue"),buttonUrl:"#",cartText:c.a.tr("btns.cancelCapitalize"),cartUrl:"#",replaceFreeTourButtons:!0,markDown:!0,callback:function(){$(e).find("#replaceFreeTour").remove(),$("<input>").attr({type:"hidden",id:"replaceFreeTour",name:"replaceFreeTour",value:!0}).appendTo(e),setTimeout((function(){$(e).find('button[type="submit"]').trigger("click")}))},cancelCallback:function(){$(e).find("#replaceFreeTour").remove()}})},ot=function(e,t,i){if(e.hasClass("_block-activities-form"))c.a.unLoading(),CivAPP.ConfirmUtil.showSuccess({title:c.a.tr("affiliate_panel_modifySuccessMessage"),message:""});else{var n=$(e).find("[data-clipboard-text]"),r=$(e).find("[data-show-code-text]"),o=$(e).find("[data-show-link-text]"),s=$(e).find("#iframe-result"),a=$(e).find("#iframe-result-responsive"),l=$(e).find('button[type="submit"]'),u=$(l).attr("id"),d=$(e).find(':input:not(.js-autocomplete):not([name="responsive"])'),f=$(e).find(':input[name="responsive"]'),h=-1!==$(e).find('input[name="display"]:checked').val().indexOf("-lateral");
1if(void 0!==i.iframeCode&&null!==i.iframeCode&&""!==i.iframeCode){$(s).empty(),$(s).prepend($(i.iframeCode)),$(a).removeClass("js-hide"),$(n).attr("data-clipboard-text",i.iframeCode),$(r).text(""+i.iframeCode),$(o).text(""+i.iframeUrl);var p=$(s).find("iframe");p.length>0?($("body").hasClass("is-loading")||c.a.loading(),$(p).on("load.loadIframe",(function(){c.a.unLoading(),$(p).off("load.loadIframe"),null!=u&&""!==u?c.a.scrollBodyToElement("#"+u,{topMargin:24}):a.length>0&&a.is(":visible")?c.a.scrollBodyToElement("#"+$(a).attr("id"),{topMargin:24}):c.a.scrollBodyToElement("#"+$(s).attr("id"),{topMargin:24}),$(f).filter('[id="desktop"]').trigger("click"),$(f).filter('[id="desktop"]').trigger("change.inputResponsiveChangeWidget")}))):c.a.unLoading(),$(n).hasClass("--deactive")&&$(n).removeClass("--deactive"),$(n).removeClass("--success"),$(l).addClass("--deactive"),$(d).on("change.inputChangeWidgetSubmit",(function(){$(l).removeClass("--deactive"),$(d).off("change.inputChangeWidgetSubmit")})),$(f).off("change.inputResponsiveChangeWidget"),$(f).on("change.inputResponsiveChangeWidget",(function(){if(p.length>0){var e=p.data("maxwidth"),t=void 0!==$('input[name="'+$(this).attr("name")+'"]:checked').data("valuelateral")&&null!==$('input[name="'+$(this).attr("name")+'"]:checked').data("valuelateral")&&""!==$('input[name="'+$(this).attr("name")+'"]:checked').data("valuelateral")?$('input[name="'+$(this).attr("name")+'"]:checked').data("valuelateral"):null,i=h&&null!==t?t:$('input[name="'+$(this).attr("name")+'"]:checked').val();if(null!=e&&""!==e&&"none"!==e)if("100%"!==e)if("100%"!==i)parseFloat(e.replace("px",""))>parseFloat(i.replace("px",""))?$(p).css("max-width",i):$(p).css("max-width",e);else $(p).css("max-width",e);else $(p).css("max-width",i);else $(p).css("max-width",i);setTimeout((function(){var e=window.document.createEvent("UIEvents");e.initUIEvent("resize",!0,!1,window,0),p[0].dispatchEvent(e)}))}}))}}},st=function(e){var t=e.find(":input"),i=[];return t.each((function(){i.push($(this)[0])})),Array.prototype.slice.call(i).filter((function(e){return!e.disabled})).filter((function(e){return!/^input$/i.test(e.tagName)||!/^(?:checkbox|radio)$/i.test(e.type)||e.checked})).map((function(e){switch(e.tagName.toLowerCase()){case"checkbox":case"radio":return{name:e.name,value:null===e.value?"on":e.value};case"select":return e.multiple?{name:e.name,value:Array.prototype.slice.call(e.selectedOptions).map((function(e){return e.value}))}:{name:e.name,value:e.value};default:return{name:e.name,value:e.value||""}}}))},at=function(){$(".js-radio-highlight").each((function(){var e=$
1(this);e.find('[type="radio"], [type="checkbox"]').each((function(){$(this).on("change",(function(){e.find('[type="radio"]:checked, [type="checkbox"]:checked').length>0?e.addClass("__with-selected"):e.removeClass("__with-selected")}))}))}))},lt=function(e){var t=[];return e.find("fieldset").each((function(){for(var e={},i=st($(this)),n=0;n<i.length;n++){var r=i[n],o=r.name;-1!==o.indexOf("_")&&(o=o.substring(0,o.indexOf("_"))),-1===r.name.indexOf("idaYVuelta")&&""!==o&&(e[o]=r.value)}if(void 0!==e.date)if(e.date=c.a.dateStringToDDMMYYYY(e.date),void 0!==e.returnDate){var s={date:c.a.dateStringToDDMMYYYY(e.returnDate),time:e.returnTime,departure:e.returnOrigin,destination:e.returnDestination};delete e.returnDate,delete e.returnTime,delete e.returnOrigin,delete e.returnDestination,t.push(e),t.push(s)}else t.push(e);else $.each(e,(function(t,i){c.a.isDate(i)&&(e[t]=c.a.dateStringToDDMMYYYY(e[t]))}))})),t},ct=function(e){var t,i=$("#"+e);switch(e){case"transferHomeForm":t={paxCount:$("#paxCount").val(),cityId:$("#cityId").val(),transfers:lt(i)},$("#zoneId").length>0&&(t.zoneId=$("#zoneId").val());break;case"paxDataForm":(t=function(e){var t,i,n={},r=[],o=e.find('> fieldset:not(".js-additional-data")'),s=e.find("fieldset.js-additional-data");return o.each((function(){(i=st($(this))).map((function(e){n[e.name]=e.value}))})),s.each((function(){i=st($(this)),t={};for(var e=0;e<i.length;e++){var n=i[e],o=n.name.substring(0,n.name.indexOf("-"));t[o]=n.value}r.push(t)})),n.additional=r,n}(i)).reqid=c.a.getParam("reqid"),$("#subscribe").is(":checked")&&(t.subscribe=$("#subscribe").val()),$("#conditions").is(":checked")&&(t.conditions=$("#conditions").val());break;case"paymentForm":(t=c.a.elemToDataObject(i)).reqid=c.a.getParam("reqid");break;case"formModificarActividad":(t=c.a.elemToDataObject(i)).horaActividad=$("#horaActividad").val();break;case"widger-generator":if(t=c.a.elemToDataObject(i),i.hasClass("_block-activities-form"))delete t.activity;else{delete t.activity,delete t.categories,delete t.dest,t.destination=null,t.country=null,t.zone=null,"dest"===t.type?t.destination=t.idDest:"country"===t.type?t.country=t.idDest:"zone"===t.type&&(t.zone=t.idDest),delete t.idDest,delete t.type;var n=void 0!==t.allWithTransfers&&"1"==t.allWithTransfers;if(t.transfer=n?"1":"0","manual"===t.typeSelection)t.tags=null,t.category=null,""===t.activities&&(t.activities=null);else if("category"===t.typeSelection)t.tags=null,t.activities=null,""===t.category&&(t.category=null);else if("tag"===t.typeSelection)t.activities=null,t.categories=null,""===t.category&&(t.tags=null);else{t.category=null,t.activities=null;""!==t.destination||""!==t.country||t.zone;delete t.allWithTransfers}""===t.width?t.width="100%":t.width=t.width+"px",""===t.height?t.height=null:t.height=t.height+"px",""===t.cant&&(t.cant="6"),""===t.cmp?t.cmp=null:t.cmp=encodeURI(c.a.normalizeStringSpecialCharacters(t.cmp).replace(/\s+/g,"_").replace(/[^A-Za-z0-9]/g,"_")),void 0!==t.hideButton&&null!==t.hideButton||(1==t.showButton||"1"==t.showButton?t.hideButton="0":t.hideButton="1",delete t.showButton),-1!==t.display.indexOf("-lateral")?(t.lateral="1",t.display=t.display.replace("-lateral","")):t.lateral=null}break;case"user-register":case"user-register_user-lightbox":case"user-register_user-lightbox-favs":case"new-login-register-process-form-register-step":case"affiliate-myaccount-form":case"affiliate-myaccount-form3":var r=$(i).hasClass("js-include-disabled"),o=null;if(r&&(o=$(i).find(":input:disabled")).removeAttr("disabled"),t=c.a.elemToDataObject(i,!0),r&&o.attr("disabled",!0),delete t.dest,"on"!=t.otherDestinationCheck&&delete t.otherDestination,(void 0!==t.tipo_afiliado&&null!==t.tipo_afiliado||void 0!==t.tipoAfiliado&&null!==t.tipoAfiliado)&&("ES"!=t.country||"1"!=t.tipo_afiliado&&"1"!=t.tipoAfiliado?"ES"!=t.country||"2"!=t.tipo_afiliado&&"2"!=t.tipoAfiliado?"affiliate-myaccount-form"==e?t.identificationType=t.tipo_id_fiscal_notEs:t.tipo_id_fiscal=t.tipo_id_fiscal_notEs:"affiliate-myaccount-form"==e?t.identificationType=t.tipo_id_fiscal_tipoAfiliado2:t.tipo_id_fiscal=t.tipo_id_fiscal_tipoAfiliado2:"affiliate-myaccount-form"==e?t.identificationType=t.tipo_id_fiscal_tipoAfiliado1:t.tipo_id_fiscal=t.tipo_id_fiscal_tipoAfiliado1,delete t.tipo_id_fiscal_tipoAfiliado1,delete t.tipo_id_fiscal_tipoAfiliado2,delete t.tipo_id_fiscal_notEs),void 0!==t.websInput&&null!==t.websInput){var s=void 0!==t.websInputName&&null!==t.websInputName&&""!==t.websInputName?t.websInputName:"webs";if(t[s]="",void 0!==t["webs-counter"]&&null!==t["webs-counter"]&&""!==t["webs-counter"]){delete t.websInput;var a=document.querySelectorAll("input[name^=websInput]");a.forEach((function(e,i){e.value&&e.value.length>0&&(t[s]+=e.value,i<a.length-1&&(t[s]+="\r\n")),delete t[e.name]})),delete t["webs-counter"]}delete t.websInputName}if(void 0!==t.cityInput&&null!==t.cityInput){if(t.cities="",void 0!==t["cities-counter"]&&null!==t["cities-counter"]&&""!==t["cities-counter"]){delete t.cityInput;var l=document.querySelectorAll("input[name^=cityInput]");l.forEach((function(e,i){e.value&&e.value.length>0&&(t.cities+=e.value,i<l.length-1&&(t.cities+="\r\n")),delete t[e.name]})),delete t["cities-counter"]}t.cities&&0===t.cities.length&&delete t.cities}break;case"press-select":"all"==(t=c.a.elemToDataObject(i)).lang&&delete t.lang;break;case"checkConditionsProviders":void 0!==(t=c.a.elemToDataObject(i)).iban&&null!==t.iban&&""!==t.iban&&(t.iban=t.iban.replace(/\s/g,""),t.iban_0=t.iban_0.replace(/\s/g,""));if(void 0!==t.nameContactProvider3&&null!==t.nameContactProvider3&&""!==t.nameContactProvider3)for(var u=0;u<3;u++)void 0!==t["sameAsBookingContact"+u]&&"on"==t["sameAsBookingContact"+u]&&(t["nameContactProvider"+u]=t.nameContactProvider3,t["phoneContactProvider"+u]=t.phoneContactProvider3,t["emailContactProvider"+u]=t.emailContactProvider3,t["emailCCContactProvider"+u]=t.emailCCContactProvider3);break;case"cartPaxDataForm":var d=$(i).find('[type="checkbox"]:disabled, [data-disabled-format="true"]:disabled');d.removeAttr("disabled"),t=c.a.elemToDataObject(i),d.attr("disabled",!0);break;case"activityPaxDataForm":t=c.a.elemToDataObject(i),$('[name="bookingEmail"]').length>0&&$('[name="bookingEmail"]').filter("#logedEmailOption").is(":checked")&&(t.bookingEmail=$("#logedEmailOption").val());var f=void 0!==t.partialPayment&&null!==t.partialPayment&&"on"==t.partialPayment,h=void 0!==t.payMode&&null!==t.payMode&&"discount_to_wallet"==t.payMode;f&&h&&(t.partialPayment="off");break;case"affiliate-contact-form":document.getElementById("affiliate-contact-form_is-partnership")&&document.getElementById("content-creator-contact-tab")&&document.getElementById("ota-contact-tab")&&(document.getElementById("affiliate-contact-form_is-partnership").value=d
1ocument.getElementById("ota-contact-tab").className.includes("is-active")?"1":"0"),t=c.a.elemToDataObject(i);break;default:t=c.a.elemToDataObject(i)}return t},ut=function(e){var t=void 0!==e?$(e).find("#texto, #comentarios, #comentariosAlProveedor, #comments, [id^='comentarios-'], [id^='comentariosAlProveedor-'], [id^='comments-']"):$("#texto, #comentarios, #comentariosAlProveedor, #comments, [id^='comentarios-'], [id^='comentariosAlProveedor-'], [id^='comments-']");$(t).each((function(e,t){var i=$(t).val();if(null!=x(i)&&null!=i&&""!=i){var n=$('[data-commentscounter="'+$(t).attr("id")+'"]'),r=i.match(/^\s+/g);null!=r&&r.length>0&&$(t).val(i.replace(/^\s+/g,"")),n.html(i.length)}})),$(t).keyup((function(){var e=$(this).val(),t=$('[data-commentscounter="'+$(this).attr("id")+'"]');if(null!=x(e)&&null!=e&&""!=e){var i=e.match(/^\s+/g);null!=i&&i.length>0&&$(this).val(e.replace(/^\s+/g,""))}t.html(e.length)}))},dt=function(e,t,i,n,r,o,s,a){s=void 0!==s&&s,n=void 0!==n?n:{},r=void 0!==r&&r,o=void 0!==o&&o;var l="string"==typeof e?$(e):e,u=l.attr("data-counter")?parseInt(l.attr("data-counter"),10):0;l.attr("data-counter",u+1);var d=Math.random().toString(36).substring(2,15);l.attr("data-".concat(d),"pepe");var f,h,p=l.attr("data-min-results-for-search")?l.attr("data-min-results-for-search"):1/0,v=l.attr("data-search-placeholder")?l.attr("data-search-placeholder"):null,g=l.attr("data-parent-self")&&(1==l.attr("data-parent-self")||"true"==l.attr("data-parent-self")||"1"==l.attr("data-parent-self")),m=l.attr("data-open-modal-mobile")&&(1==l.attr("data-open-modal-mobile")||"true"==l.attr("data-open-modal-mobile")||"1"==l.attr("data-open-modal-mobile")),_=void 0!==l.data("modal-mobile-title")&&null!==l.data("modal-mobile-title")&&""!==l.data("modal-mobile-title")?l.data("modal-mobile-title"):null;if(0!==l.length){var y="#s2id_"+l.attr("id");$(y).remove();var b={minimumResultsForSearch:p,placeholder:t,language:{noResults:function(){return c.a.tr("errors.noResults.short")}}};if(0==Object.keys(n).length){if(void 0!==l.data("booking-selector")&&null!==l.data("booking-selector")&&(1==l.data("booking-selector")||"true"==l.data("booking-selector")||"1"==l.data("booking-selector"))){var E=function(e){var t="",i="",n=e.text;if(void 0!==e.element){var r=$(e.element);void 0!==r.data("date")&&null!==r.data("date")&&""!==r.data("date")&&(t='<span class="date-element">'+r.data("date")+"</span>"),void 0===r.data("status")||null===r.data("status")||6!==r.data("status")&&7!==r.data("status")||(i=' <span style="color:#f70759">'+c.a.tr("cardCancel")+"</span>
1",n='<span style="text-decoration: line-through;">'+e.text+"</span>")}return $('<span class="select2-date-option">'+t+n+i+"</span>")};n={templateResult:E,templateSelection:E}}if(void 0!==l.data("phone-prefix-selector")&&null!==l.data("phone-prefix-selector")&&(1==l.data("phone-prefix-selector")||"true"==l.data("phone-prefix-selector")||"1"==l.data("phone-prefix-selector"))){var w=function(e){var t=e.text.split(" /// "),i='<div class="iti__flag-box"><div class="iti__flag iti__'.concat(t[0],'" width="20"></div></div>'),n='<span class="iti__dial-code">'.concat(t[1],"</span>"),r=document.getElementById("register-collaborators")?'<span class="iti__country-name name-in-option">'.concat(t[2],"</span>"):"";return $('<div class="select2-prefijo-option">'+i+n+r+"<div>")};n={templateResult:w,templateSelection:w}}}"function"==typeof n.templateResult&&(b.templateResult=function(e){return n.templateResult(e,l)}),"function"==typeof n.templateSelection&&(b.templateSelection=n.templateSelection),void 0!==$.fn.select2.defaults.dropdownCssClass&&(b.dropdownCssClass="_civ-dropdown "+i),(void 0!==i&&(-1!==i.indexOf("--location")||-1!==i.indexOf("--override-template"))||void 0!==$(l).attr("data-optionsClass")&&"true"===$(l).attr("data-optionsClass"))&&(s||(b.templateResult=R),void 0!==$(l).attr("data-selectionHtml")&&"true"===$(l).attr("data-selectionHtml")&&(b.templateSelection=R)),g&&(b.dropdownParent=l.parent()),l.select2(b),function(e){var t=e.attr("data-test-id"),i=e.attr("id");t&&i&&(e.removeAttr("data-test-id"),$("#select2-"+i+"-container").closest(".select2-selection").attr("data-test-id",t))}(l);var I=null,O=null,S=null,A=function(e){!function(e){var t=e.attr("data-test-id-options"),i=e.attr("id");if(t&&i){var n=null;!function e(){clearTimeout(n),n=setTimeout((function(){var n=$("#select2-"+i+"-results"),r=n.parents(".select2-container--open").find(".select2-search__field");n.find(".select2-results__option").attr("data-test-id",t),r.length>0&&r.off("input.vrtcl2").on("input.vrtcl2",e)}))}()}}(e);var t=$("#select2-"+e.attr("id")+"-results"),i=t.parents(".select2-container--open"),n=i.find(".select2-search__field");setTimeout((function(){!0===$(e).data("copy-class")&&$(e).find("option").each((function(n,r){if(void 0!==x($(r).attr("class"))&&null!==$(r).attr("class")&&""!==$(r).attr("class")&&void 0!==x($(r).attr("value"))&&null!==$(r).attr("value")&&""!==$(r).attr("value")){var o=$(t).find('.select2-results__option[id$="'+$(r).attr("value")+'"]');if($(o).addClass($(r).attr("class")),"js-hide"===$(r).attr("class")&&$(i).offset().top<$(e).offset().top){var s=$(i).offset().top+$(o).outerHeight();$(i).css("top",s)}}}))})),null!=v&&""!==v&&n.length>0&&n.attr("placeholder",v),m&&setTimeout((function(){$("body").addClass("_openedSelector"),I=$("<span>").attr({class:"select2_modal_close"}),O=$("<span>").attr({class:"select2_modal_title"}).html(_),S=$(i).find(".select2-dropdown"),""!==_&&$(S).prepend(O),$(S).prepend(I),$(I).off("click.select2CloseClick"),$(I).on("click.select2CloseClick",(function(){c.a.isMobile()&&l.select2("close")})),$(window).off("click.select2CloseClick"),$(window).on("click.select2CloseClick",(function(){c.a.isMobile()&&l.select2("close")})),$(S).off("click.clickOutsideCart"),$(S).on("click.clickOutsideCart",(function(e){c.a.isMobile()&&e.stopPropagation()}))})),void 0===l.data("booking-selector")||null===l.data("booking-selector")||1!=l.data("booking-selector")&&"true"!=l.data("booking-selector")&&"1"!=l.data("booking-selector")||$("body").addClass("_booking-selector-opened")};if(a||l.on("select2:open",(function(e){e.stopPropagation();$(this);A($(this))})),l.on("select2:close",(function(e){e.stopPropagation(),function(e){var t=$("#select2-"+e.attr("id")+"-results");$(e).parents(".transfers-F2-container").length>0&&t.parents(".select2-container--open").removeClass("transfers-F2-container-dropdown");a||(r||(c.a.l("ð´ !changeOnSelect ð´"),e.trigger("change")),o||(c.a.l("ð´ !changeOnSelectVanilla ð´"),e[0].dispatchEvent(new Event("change")))),m&&setTimeout((function(){$("body").removeClass("_openedSelector"),$(I).remove(),$(O).remove(),I=null,O=null,S=null,$(I).off("click.select2CloseClick"),$(window).off("click.select2CloseClick"),$(S).off("click.clickOutsideCart")})),void 0===l.data("booking-selector")||null===l.data("booking-selector")||1!=l.data("booking-selector")&&"true"!=l.data("booking-selector")&&"1"!=l.data("booking-selector")||$("body").removeClass("_booking-selector-opened")}($(this))})),0!==$("#civ-agencies").length||0!==$("#civ-affiliates").length){var C=function(e){var t=$(e),i=t.data().select2.container;""===t.val()?i.addClass("_empty-select"):i.removeClass("_empty-select")};setTimeout((function(){C(l)}),100),new MutationObserver((function(e){e.map((function(e){"data-parsley-excluded"===e.attributeName&&C(l)}))})).observe(l[0],{attributes:!0});var T=l.attr("id");void 0!==T&&""!==T&&(void 0===window.selects2Table&&(window.selects2Table={}),window.selects2Table[T]=l),l.on("select2-close",(function(){C(this)}))}if(r&&l.on("select2:select",(function(e){$(this).trigger("change")})),o&&l.on("select2:select",(function(e){this.dispatchEvent(new Event("change"))})),void 0!==i){var P=void 0!==(f=l.data().select2).$container&&null!==f.$container&&f.$container.length>0?f.$container:f.container;$(P).addClass(i),void 0===(h=f.$dropdown)&&(h=f.dropdown),h.addClass(i)}var k=l.attr("data-for-testid");if(k)$("#select2-".concat(l.attr("id"),"-container")).attr("data-testid",k)}function R(e){var t,i=void 0!==e.element?e.element.className:"";return t=$('<span class="'+i+'">'+e.text+"</span>"),void 0!==e.element&&void 0!==$(l).attr("data-optionsAttributes")&&"true"===$(l).attr("data-optionsAttributes")&&$.each(e.element.dataset,(function(e,i){$(t).attr("data-"+e,i)})),t}}
1,ft=function(){!0===Object(C.a)("wave_release_web_all_social_login","use_social_sdk")?ht():mt()},ht=function(){var e=k(regeneratorRuntime.mark((function e(){var t,n,r,o,s,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,i.e(34).then(i.bind(null,180));case 3:return t=e.sent,n=t.default,e.next=7,i.e(33).then(i.bind(null,181));case 7:return r=e.sent,o=r.default,e.next=11,i.e(32).then(i.bind(null,182));case 11:return s=e.sent,a=s.default,e.next=15,n.initializeGoogle({clientId:"538638977831-8frk5c41hdf0lnlfeq6f8vjm67du9mqt.apps.googleusercontent.com",onSuccess:function(){var e=k(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,fetch("/login-with-google-one-tap-callback",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({credential:t.credential})});case 3:if(e.sent.ok){e.next=6;break}return e.abrupt("return");case 6:window.location.reload(),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(0),console.error("Google login error:",e.t0);case 12:case"end":return e.stop()}}),e,null,[[0,9]])})));return function(t){return e.apply(this,arguments)}}(),onError:function(e){return console.error("Google init error:",e)}});case 15:return e.next=17,o.initializeFacebook({appId:o.getDefaultAppId(),onError:function(e){return console.error("Facebook init error:",e)}});case 17:return e.next=19,a.initializeApple({clientId:a.getDefaultClientId(),onError:function(e){return console.error("Apple init error:",e)}});case 19:pt(n),vt(o),gt(a),e.next=28;break;case 24:e.prev=24,e.t0=e.catch(0),console.error("Failed to initialize new social login:",e.t0),mt();case 28:case"end":return e.stop()}}),e,null,[[0,24]])})));return function(){return e.apply(this,arguments)}}(),pt=function(e){document.querySelectorAll('[data-href*="/login-with-google"]:not(._email-enter-step):not(._setted), .o-social-buttons__button._google:not(._email-enter-step):not(._setted)').forEach(function(){var t=k(regeneratorRuntime.mark((function t(i){var n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i.classList.add("_setted"),n=i.parentElement.querySelector(".hidden-google-button-container"),t.next=4,e.renderGoogleButton(n);case 4:i.addEventListener("click",function(){var t=k(regeneratorRuntime.mark((function t(i){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i.preventDefault(),i.stopPropagation(),n){t.next=4;break}return t.abrupt("return");case 4:return t.prev=4,t.next=7,e.triggerGoogleLogin({element:n,onError:function(e){console.error("Google login error:",e)}});case 7:t.next=12;break;case 9:t.prev=9,t.t0=t.catch(4),console.error("Google login error:",t.t0);case 12:case"end":return t.stop()}}),t,null,[[4,9]])})));return function(e){return t.apply(this,arguments)}}());case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())},vt=function(e){document.querySelectorAll('[data-href*="/login-with-facebook"]:not(._email-enter-step):not(._setted), .o-social-buttons__button._facebook:not(._email-enter-step):not(._setted)').forEach((function(t){t.classList.add("_setted"),t.addEventListener("click",function(){var t=k(regeneratorRuntime.mark((function t(i){var n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i.preventDefault(),i.stopPropagation(),t.prev=2,t.next=5,e.triggerFacebookLogin({appId:e.getDefaultAppId(),onSuccess:function(){var e=k(regeneratorRuntime.mark((function e(t){var i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=t.authResponse.accessToken,e.next=3,fetch(window.location.origin+"/login-with-facebook-callback",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({access_token:i})});case 3:if(!e.sent.ok){e.next=8;break}window.location.reload(),e.next=9;break;case 8:throw new Error("Facebook login failed");case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),onError:function(e){console.error("Facebook login error:",e)},onCancel:function(){console.log("Facebook login cancelled")}});case 5:if(!(n=t.sent)){t.next=10;break}return t.next=9,fetch(window.location.origin+"/login-with-facebook-callback",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({access_token:n.authResponse.accessToken})});
1case 9:t.sent;case 10:t.next=15;break;case 12:t.prev=12,t.t0=t.catch(2),console.error("Facebook login error:",t.t0);case 15:case"end":return t.stop()}}),t,null,[[2,12]])})));return function(e){return t.apply(this,arguments)}}())}))},gt=function(e){document.querySelectorAll('[data-href*="/login-with-apple"]:not(._email-enter-step):not(._setted), .o-social-buttons__button._apple:not(._email-enter-step):not(._setted)').forEach((function(t){t.classList.add("_setted"),t.addEventListener("click",function(){var t=k(regeneratorRuntime.mark((function t(i){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i.preventDefault(),i.stopPropagation(),t.prev=2,t.next=5,e.triggerAppleSignIn({clientId:e.getDefaultClientId(),onSuccess:function(){var e=k(regeneratorRuntime.mark((function e(t){var i,n,r,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=t.authorization||{},n=i.code||null,r=i.id_token||null,o=t.user||null,n||r){e.next=6;break}throw new Error("Apple Sign-In failed - no authorization data");case 6:return e.next=8,fetch(window.location.origin+"/login-with-apple-callback",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({code:n,id_token:r,user:o})});case 8:if(!e.sent.ok){e.next=13;break}window.location.reload(),e.next=14;break;case 13:throw new Error("Apple login failed");case 14:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),onError:function(e){console.error("Apple Sign-In error:",e)},onCancel:function(){console.log("Apple Sign-In cancelled")}});case 5:t.sent,t.next=11;break;case 8:t.prev=8,t.t0=t.catch(2),console.error("Apple Sign-In error:",t.t0);case 11:case"end":return t.stop()}}),t,null,[[2,8]])})));return function(e){return t.apply(this,arguments)}}())}))}
1,mt=function(){var e=$("body").hasClass("--google-login"),t=$("body").hasClass("--apple-login"),i=$("body").hasClass("--facebook-login");if(e||t||i){var n,r=e||t?"400":"1006",o=e||t?"425":"710",s=e?"/login-with-google":t?"/login-with-apple":"/login-with-facebook",a=window.open(s,"login","width=".concat(r,", height=").concat(o,", scrollbars=yes, resizable=yes, toolbar=no, menubar=no, location=no, status=no")),l=!1,u=function(e,t){"undefined"!=typeof $&&$&&($("body").data("overlap","".concat(e,", ").concat(t)),l=void 0!==$("body").data("overlap")&&null!==$("body").data("overlap")&&["true",!0,"1"].includes($("body").data("overlap")))};e||t?(u("width=400","height=425"),n=window.setInterval((function(){return function(e,t,i){if(null!=e&&e.closed)if(window.clearInterval(t),i)location=c.a.addParam("login",1,location.href);else{var n=new URLSearchParams(location.search).get("target")||"";location.href=n}}(a,n,l)}),500)):i&&(u("width=1006","height=710"),n=window.setInterval((function(){try{-1!=a.document.URL.indexOf(previousUrl)&&(window.clearInterval(n),l?location=c.a.addParam("login",1,location.href):location.reload(),a.close())}catch(e){c.a.l("Error login"),c.a.l(e)}}),500))}console.log("Final de OLD LOGIN")}
1,_t=function(){var e=$(".js-textareaValidation"),t=$(".js-textareaDynamic");re(e,t,"cotizaciones"),$(e).on("change",(function(){re(this,t,"cotizaciones")}))},yt=function(){var e=$(".js-inputRequiredValidation"),t=$(".js-inputRequiredDynamic");oe(e,t,"consulta"),$(e).on("change",(function(){oe(this,t,"consulta")}))},bt=function(){var e=$('[name="divisa"]'),t=$("#mops-radio-wrapper").find(".m-super-radio"),i=[];e.each((function(){var e=$(this);i.push(e.attr("id"))})),i.forEach((function(e,i){t.filter('[data-depends-on*="'+e+'"]').each((function(e){$(this).find('[name="fop"]').attr("data-id","currency-"+i+"-mop-"+e)}))}))},Et=function(){var e=$('[name="fop"]').filter(":checked").attr("id"),t=$('[name="divisa"]:checked').attr("id");if(void 0!==t&&"klarna"!==e){var i="adyen-scheme-".concat(t,"-regular");document.getElementById("activityPaxDataForm").classList.contains("--disable-button")||($("#".concat(i)).trigger("click"),$($('label[for="'.concat(i,'"] input[name="fop-inner"]'))[0]).trigger("click"))}},wt=function(){var e=$
1("#activityPaxDataForm"),t=$('[name="divisa"]');if(0!==e.length||0!==t.length){var i=t.filter(":checked").closest(".m-super-radio--currency");if(!c.a.isElementVisible(i))for(var n=!1,r=0;r<t.length&&!n;){var o=$(t[r]),s=$(o).closest(".m-super-radio--currency");c.a.isElementVisible(s)&&($(o).trigger("click"),$(o).trigger("change"),n=!0),r++}}},It=function(){var e=$("#activityPaxDataForm");if(0!==e.length&&void 0!==CivAPP.isGuide&&null!==CivAPP.isGuide&&!0===CivAPP.isGuide)var t=0,i=setInterval((function(){if(t<5e3)if("undefined"!=typeof ga&&null!==ga&&"function"==typeof ga.getAll&&void 0!==ga.getAll()&&null!==ga.getAll()&&ga.getAll().length>0){clearInterval(i);var n=ga.getAll()[0].get("linkerParam");n=n.split("=");var r=$(e).find('[name="'+n[0]+'"]');r.length>0&&r.val(n[1])}else t+=100;else clearInterval(i)}),100)},Ot=function(){var e=$("#activityPaxDataForm");if(0!==e.length){var t=e.find("input[name=divisa]"),i=e.find("input[name=fop]"),n=e.find(".fop-image"),r=t.add(i),o=$("#payment-methods-container"),s=["BRL","MXN","ARS"],a=function(){var e=t.filter(":checked").attr("id");if("EUR"===t.filter(":checked").attr("id")){var i,r=T(document.querySelectorAll(".cart__payment__quotas__text"));try{for(r.s();!(i=r.n()).done;){i.value.style.display="block"}}catch(e){r.e(e)}finally{r.f()}var a,l=T(document.querySelectorAll(".mobile-text-quotas"));try{for(l.s();!(a=l.n()).done;){a.value.style.display="block"}}catch(e){l.e(e)}finally{l.f()}}else{var c,u=T(document.querySelectorAll(".cart__payment__quotas__text"));try{for(u.s();!(c=u.n()).done;){c.value.style.display="none"}}catch(e){u.e(e)}finally{u.f()}var d,f=T(document.querySelectorAll(".mobile-text-quotas"));try{for(f.s();!(d=f.n()).done;){d.value.style.display="none"}}catch(e){f.e(e)}finally{f.f()}}n.addClass("hide"),n.each((function(){var t=$(this);-1!==JSON.parse(t.attr("data-visible-currencies")).indexOf(e)&&t.removeClass("hide")})),-1!==s.indexOf(e)?o.removeClass("u-display-inline--large").addClass("u-width-100--large"):o.removeClass("u-width-100--large").addClass("u-display-inline--large"),setTimeout((function(){wt()}))};r.on("change",(function(e){$(this);a()})),a()}}
1,St=function(){var e=$("#activityPaxDataForm"),t=$('[name="partialPayment"]'),i=$('[name="divisa_descuento"], [name="divisa_parcial"]');if(0!==e.length||0!==t.length){var n="checkbox"===t.attr("type"),r=e.find("input[name=divisa]"),o=r.add(t),s=$('[name="payMode"]'),a=function(){r.filter(":checked").attr("id");(n?t.is(":checked"):"on"==t.val())?i.each((function(e,t){var i=r.filter(":checked").attr("id");$(t).attr("id")=="divisa_descuento_"+i||$(t).attr("id")=="divisa_parcial_"+i?$(t).prop("disabled",!1):$(t).prop("disabled",!0)})):i.each((function(e,t){$(t).prop("disabled",!0)})),setTimeout((function(){wt()}))};o.on("change",(function(e){$(this);setTimeout((function(){a(),"function"==typeof klarnaAsyncCallback&&klarnaAsyncCallback()}))})),c.a.isMopsOnTabsActive()&&t.on("change",(function(){var e=$(this),t=e.closest(".o-form__separator_beige"),i=$("#m-payment-radios__container"),n=$(".payment-methods-container-wallet"),r=$(".m-wallet-check .m-super-radio__submit.--show");e.is(":checked")?($(t).addClass("_active"),$(i).addClass("hide"),$(n).addClass("hide"),$(r).removeClass("hide")):($(t).removeClass("_active"),$(i).removeClass("hide"),$(n).removeClass("hide"),$(r).addClass("hide"))})),s.on("change",(function(){(n?t.is(":checked"):"on"==t.val())&&t.trigger("click"),a()})),setTimeout((function(){a()}))}}
1,At=function(){var e=$("#activityPaxDataForm"),t=$('[name="fop"]');if(0!==e.length||0!==t.length){var i=t,n=function(){var e,i,n,r=t.filter(":checked").attr("id"),o=$('label[for="'.concat(r,'"]')).find('[type="radio"]'),s=$('[name="divisa"]:checked').attr("id");"adyen-scheme-".concat(s,"-regular");if(o.length>0&&r.includes("ebanx-dropin")){var a=o.filter(":checked"),l=o.filter('[checked="checked"], [checked="true"]'),u=l.length>0&&(0==a.length||a.length>0&&a.attr("id")!=l.attr("id"))?l:o[0];e=$(u),i=0,n=setInterval((function(){var t=$('[data-depends-on~="'.concat(e.attr("id"),'"]'));i<5e4?t.length>0?(clearInterval(n),setTimeout((function(){e.trigger("click")}))):i+=100:(clearInterval(n),e.trigger("click"))}),100)}else c.a.isMopsOnTabsActive()&&Et()},r=$(i).closest(".m-super-radio");if(null!=r&&$(r).length>0){var o=$(r).find(".m-super-radio__txt.js-equalize-txt");null!=o&&$(o).length>0&&c.a.equalizeWidths($(o),!1,!1,{notImportant:!0})}if(c.a.isMopsOnTabsActive())document.querySelectorAll("#activityPaxDataForm .m-super-radio__submit").forEach((function(e){e.addEventListener("click",(function(){if(this.classList.contains("--show")){var t=e.closest("label");document.getElementById("activityPaxDataForm").setAttribute("mop-selection",t.getAttribute("for"))}}))})),window.ApplePaySession&&window.ApplePaySession.canMakePayments()&&document.body.classList.add("_ios-device");i.on("change",(function(e){$(this);setTimeout((function(){n()}))})),setTimeout((function(){n()}))}}
1,Ct=function(){var e=$(".a-title--transfer-card__submit");$(e).on("click",(function(e){e.preventDefault();var t=$(this).parents(".o-card, .comfort-card, .compact-card, .cosy-card").find('input[type="submit"]');$(t).length>0&&$(t).click()}))},$t=function(e,t){var i;"new-login-register-process-form-login-step"===e&&"on"===t.remember_me&&t.user_name?((null===(i=h.a.get("rememberUser"))||void 0===i?void 0:i.value)!==t.user_name&&h.a.delete("rememberUser"),h.a.manageWithExpiration("rememberUser",t.user_name,180)):"new-login-register-process-form-login-step"!==e||"on"===t.remember_me&&t.remember_me||h.a.delete("rememberUser")},Tt=function(e,t,i){var n=ct(t);if(void 0!==CivAPP.FavsController&&null!==CivAPP.FavsController){var r=i.listId||null,o={cityId:n.cityId||null,productId:n.productId||null,productType:n.productType||null};CivAPP.FavsController.createListFormCallback(r,o,(function(){CivAPP.ConfirmUtil.closeDiv()}))}else CivAPP.ConfirmUtil.closeDiv()},Pt=function(e,t,i){if(void 0!==i.messages&&null!==i.messages&&""!==i.messages&&i.messages.length>0)CivAPP.ConfirmUtil.closeDiv(),setTimeout((function(){var e={title:c.a.tr("content_moduloAccountCreateSuccess"),message:i.messages[0],extraClass:"_success-big",closeCallback:function(){var e=$
1('.js-lightbox[data-target-id="generic-login-form"]');if($(e).length>0){c.a.loading();var t=0,i=setInterval((function(){t<5e4?0==$("#divModal").length?(clearInterval(i),setTimeout((function(){$(e[0]).trigger("click"),c.a.unLoading()}))):t+=100:(clearInterval(i),setTimeout((function(){$(e[0]).trigger("click"),c.a.unLoading()})))}),100)}}};setTimeout((function(){CivAPP.ConfirmUtil.showSuccess(e)}))}));else{var n=void 0!==i.action&&null!==i.action&&""!==i.action?i.action:$("#"+t).attr("action");window.location.href=n}},kt=function(e,t,i){var n=void 0!==i.action&&null!==i.action&&""!==i.action?i.action:"/",r={title:c.a.tr("bookingCancelSuccessModal_title"),message:c.a.tr("bookingCancelSuccessModal_subtitle"),extraClass:"_success2",buttonText:c.a.tr("btns.acceptCapitalize"),buttonUrl:n,closeCallback:function(){window.location.href=n}};setTimeout((function(){CivAPP.ConfirmUtil.showSuccess(r)}))},xt=function(e,t,i){var n={title:c.a.tr("cartMessageFatalError"),message:i.errors[0],extraClass:"_success2"};setTimeout((function(){CivAPP.ConfirmUtil.showWarning(n)}))},Rt=function(){var e=window.location.href,t={reviewVoting:!0,rvID:$("#votingButtonId").val()};e=c.a.addParams(t,e),window.location.href=e},Dt=function(e,t,i,n){if(n=void 0!==n&&n,null!=i&&1==i.status){var o=ct(t);if(void 0!==o.walletInit&&null!==o.walletInit&&(1==o.walletInit||"true"==o.walletInit||"1"==o.walletInit)||n){var a,l={walletKey:o.walletKey,walletCode:i.code};n?(a=o.walletSelectCurrency,l.currency=o.walletSelectCurrency):(a=o.walletCurrency,l.currency=null),function(e,t){var i="/"+window.civLocale+"/wallet/code/redeem/";e=JSON.stringify(e),c.a.loading(),$.ajax({url:i,type:"POST",data:e}).done((function(e,i,n){setTimeout((function(){var i=e.code,n=c.a.returnNumberWithParams(i["amount"+t],c.a.getCurrencySymbol(t),null,null,!0),r="undefined"!=typeof APPConfig&&null!==APPConfig&&void 0!==APPConfig.agencyId&&null!==APPConfig.agencyId&&""!==APPConfig.agencyId,o=c.a.tr("wallet_refillCodeSuccess_subtitle"),s=c.a.tr("walletAgency_refillCodeSuccess_subtitle"),a=r&&null!=s&&""!==s;CivAPP.ConfirmUtil.showSuccess({title:c.a.tr("wallet_refillCodeSuccess_title",n),message:a?s:o,buttonText:c.a.tr("seeActivities_string"),extraClass:"_success-big",buttonExtraClass:"_full",closeCallback:function(){window.location.reload()}}),c.a.unLoading()}))})).fail((function(e,t,i){c.a.l("fail"),c.a.l("jqXHR.responseText"),c.a.l(e.responseText),CivAPP.ConfirmUtil.showWarning({title:c.a.tr("error_payment_title"),message:c.a.tr("error_payment_subtitle")}),c.a.unLoading()}))}(l,a)}else!function(e,t,i){var n=$("#walletCodeInit"),o=$(n).find("#walletSelectCurrencies"),a=[];$.each(["EUR","USD"],(function(e,t){void 0!==i["amount"+t]&&null!==i["amount"+t]&&a.push(r.a.createElement(A,{currency:{amount:i["amount"+t],currency:t},name:"walletSelectCurrency"}))}));var l=r.a.createElement("div",null,a);s.a.render(l,o[0]),$(n).find('[name="walletCode"]').val(i.code),CivAPP.ConfirmUtil.showDiv({id:"walletCodeInit",extraClass:"_wallet-code"}),c.a.unLoading()}(0,0,i)}else null!=i&&5==i.status?(CivAPP.ConfirmUtil.showWarning({title:c.a.tr("error_payment_title"),message:c.a.tr("error_wallet_usedCode")}),c.a.unLoading()):(CivAPP.ConfirmUtil.showWarning({title:c.a.tr("error_payment_title"),message:c.a.tr("error_wallet_wrongCode")}),c.a.unLoading())},Nt=function(e,t){t="boolean"!=typeof t||t;var i=e.boookingId,n=e.type,r=$("#booking-container-"+i).attr("data-booking-pin"),o=$("#booking-title-"+i).text(),s=$("#booking-number-"+i).text(),a=e.value.errors,l=e.value.statusInvoice,u=e.value.statusInvoiceProvider,d="<p>";if(t&&(d+="<strong>"+o+" ("+s+")</strong><br>"),0!==a.length)a.map((function(e){d+=e+"<br>"}));else if("11"===l||"21"===l){var f=function(e,t,i){var n="/"+(1===i?c.a.tr("activitiesUrlWithoutSlash"):c.a.tr("transfersUrlWithoutSlash"))+"/invoice/"+e+"/"+t+"/"+i;return!1===$("body").hasClass("is-guide")&&(n="/"+c.a.getLocale()+n),c.a.tr("civitatis_invoiceBodySuccessModal",n)}(i,r,n);d+=f+"<br>"}else if("10"===l)d+=c.a.tr("invoices.REQUESTED_STATUS_OK_REQUESTED")+"<br>";else if("13"===u)d+=c.a.tr("invoices.REQUESTED_EDIT_STATUS_OK_REQUESTED")+"<br>";else if("23"===l)d+=c.a.tr("invoices.REQUESTED_STATUS_KO_ALREADY_REQUESTED_BUT_NOT_READY")+"<br>";else if("24"===l)d+=c.a.tr("invoices.REQUESTED_STATUS_KO_CANNOT_SOLICIT_BY_STATUS")+"<br>";else if("25"===l)d+=c.a.tr("invoices.REQUESTED_STATUS_KO_CANNOT_SOLICIT_ITS_FREETOUR")+"<br>";else if("12"===u)d+=c.a.tr("invoices.REQUESTED_STATUS_OK_TO_PROVIDER_READY_WHEN_TOUR_FINISH")+"<br>";
1else if("20"===l){var h=function(e,t){return"/"+c.a.getLocale()+c.a.tr("contactUrl")+"/"+e+"/"+t+"/4"}(i,r);d+=c.a.tr("invoices.REQUESTED_STATUS_KO_ERROR_REQUESTING",h)+"<br>"}else"22"===l&&(d+=c.a.tr("invoices.REQUESTED_STATUS_KO_10_DAYS_PAST")+"<br>");return d+="</p>"},Lt=function(e,t,i){c.a.l("Forms.successSendInvoice");var n=$("#divModal"),r=e.attr("booking-pnr"),o="string"==typeof r&&""!==r?r:typeBooking+idBooking;if($(n).find(".close-button").trigger("click"),Array.isArray(i)){var s="",a={};i.forEach((function(e){""!==e.value.statusInvoiceProvider?a[e.value.statusInvoiceProvider]=!0:""!==e.value.statusInvoice&&(a[e.value.statusInvoice]=!0);var t=Nt(e);s+=t}));var l=i.length>1?"invoices.invoiceRequested_plural":"invoices.titleSuccessProviderModal";CivAPP.ConfirmUtil.showSuccess({title:c.a.tr(l),message:s})}else{var u=$(e).find("#idBooking").val(),d=$(e).find("#pinBooking").val(),f=$(e).find("#typeBooking").val(),h=$("#requestInvoice-"+o),p=$("#downloadInvoice-"+o),v=$("#downloadInvoice-"+o+"-download"),g=$("#downloadInvoiceError-"+o);c.a.l("$requestInvoiceDoneLinkLi:"),c.a.l("#requestInvoiceDone-"+o);var m,_=$("#requestInvoiceDone-"+o),y=Nt({boookingId:u,pin:d,type:f,value:i},!1);if("20"===i.statusInvoice||"24"===i.statusInvoice||"25"===i.statusInvoice||"22"===i.statusInvoice)m="invoices.titleErrorModal",g.removeClass("js-hide"),h.addClass("js-hide"),p.addClass("js-hide"),v.addClass("js-hide"),_.addClass("js-hide");else if("11"===i.statusInvoice||"21"===i.statusInvoice)m="invoices.titleSuccessModal",p.removeClass("js-hide"),v.removeClass("js-hide"),h.addClass("js-hide"),g.addClass("js-hide"),_.addClass("js-hide");else if(c.a.l("entra por aquÃ"),m="invoices.titleSuccessProviderModal",_.removeClass("js-hide"),p.addClass("js-hide"),v.addClass("js-hide"),h.addClass("js-hide"),g.addClass("js-hide"),"13"===i.statusInvoiceProvider){var b=h.closest("tr"),E=h.closest("td");b.removeClass("_rejected"),E.addClass("_no-tooltip")}CivAPP.ConfirmUtil.showSuccess({title:c.a.tr(m),message:y})}},Mt=function(e,t,i,n){var r=$("#divModal");$(r).find(".close-button").trigger("click");var o,s=$elem.attr("booking-pnr"),a="string"==typeof s&&""!==s?s:f+l,l=$(e).find("#idBooking").val(),u=$(e).find("#pinBooking").val(),d=$(e).find("#typeBooking").val(),f=null!=d?"1"===d?"A":"T":"",h=$("#requestInvoice-"+a),p=$("#downloadInvoice-"+a),v=$("#downloadInvoiceError-"+a),g=$("#requestInvoiceDone-"+a);if(p.addClass("js-hide"),h.removeClass("js-hide"),v.addClass("js-hide"),g.addClass("js-hide"),null!=n&&!0!==n)o=i.errors[0];else{var m=c.a.tr("contactUrl");$("body").hasClass("is-guide")||(m="/"+c.a.getLocale()+m),m+="/"+l+"/"+u+"/4",o=c.a.tr("civitatis_invoiceBodyErrorModal",m)}CivAPP.ConfirmUtil.showWarning({title:c.a.tr("invoices.titleErrorModal"),message:o})},Ut=function(e){if("undefined"==typeof Dropzone){e=void 0!==e?e:Function.prototype;$.getScript("".concat(c.a.getStaticPath(),"/js/vendor/dropzone-").concat("b5ddccc27bcb6f1f2c156f3d7503f28c6dc1079f",".min.js"),(function(t,i,n){Dropzone.autoDiscover=!1,$(".dz-default").dragster({enter:function(){$(this).addClass("dz-drag-hover")},leave:function(e){e.stopPropagation(),$(this).removeClass("dz-drag-hover")},drop:function(e,t){$(this).removeClass("dz-drag-hover")}}),e()}))}},Ft=function(e,t,i){e=null!=e?e:$("body");var n="";null==i&&(i=$(t).data("copyinputresult").split(","));for(var r=0;r<i.length;r++){var o=$(e).find('[data-copyinput="'+i[r]+'"]');if($(o).length>0){var s=$('[id="'+o.attr("id")+'"]').val();null!=x(s)&&null!=s&&""!=s&&(n+=s+" ")}}n=n.slice(0,-1),$(t).val(n),"select"===$(t).prop("tagName").toLowerCase()?($(t).trigger("change"),$(t).trigger("select2:select")):$(t).trigger("blur")},jt=function(e,t){t.forEach((function(t){var i=$('[id="'+t.id+'"]').attr("data-changed");null!=i&&(1==i||"true"==i||"1"==i)||Ft(e,$('[id="'+t.id+'"]'),t.copyInputResult)}))},Vt=function(e,t,i){var n=i.reduce((function(e,t){var i=JSON.stringify(t.copyInputResult);return e[i]||(e[i]=[]),e[i].push(t),e}),{});Object.values(n).forEach((function(i){i[0].copyInputResult.forEach((function(n){var r=t[n],o=$('[id="'.concat(r,'"]'));o.off("change.copyInputResultsListener keyup.copyInputResultsListener"),o.on("change.copyInputResultsListener keyup.copyInputResultsListener",(function(){return jt(e,i)})),o&&""!==o.val()&&jt(e,i)}
1)),i.forEach((function(e){var t,i;t=e.id,(i=$('[id="'.concat(t,'"]'))).off("focus.copyInputResultsListener"),i.on("focus.copyInputResultsListener",(function(){i.off("change.copyInputResultsListener keyup.copyInputResultsListener"),i.on("change.copyInputResultsListener keyup.copyInputResultsListener",(function(){""!==$(void 0).val()&&$(void 0).attr("data-changed",!0)}))}))}))}))},Bt=function(e){e=null!=e?e:$("body");var t,i,n,r,o,s=$(e).find(":input").filter("[data-copyinput], [data-copyinputresult], [data-copyself]"),a={},l=[],c={};s.length>0&&($(s).each((function(e,s){if(t=$(s).data("copyinput"),i=$(s).data("copyinputresult"),n=$(s).data("copyself"),r=$(s).val(),o=null!=(o=$(s).data("forcelistener"))&&(1==o||"true"==o||"1"==o),null!=x(t)&&null!=t&&""!=t&&(a[t]=$(s).attr("id")),null!=x(i)&&null!=i&&""!=i&&(null==x(r)||null==r||""==r||o)){var u={};u.id=$(s).attr("id"),u.copyInputResult=i.split(","),l.push(u)}null!=x(n)&&null!=n&&""!=n&&(null==x(r)||null==r||""==r||o)&&(null!=x(c[n])&&null!=c[n]?c[n].push($(s).attr("id")):c[n]=[$(s).attr("id")])})),Vt(e,a,l),function(e,t){var i;for(i in t)t.hasOwnProperty(i)&&function(){var e,n=[];$(t[i]).each((function(t,i){n.push({id:i}),$('[id="'+i+'"]').off("focus.copySelfsListener"),$('[id="'+i+'"]').on("focus.copySelfsListener",(function(){$('[id="'+i+'"]').off("change.copySelfsListener keyup.copySelfsListener paste.copySelfsListener"),$('[id="'+i+'"]').on("change.copySelfsListener keyup.copySelfsListener paste.copySelfsListener",(function(){if(""!==$('[id="'+i+'"]').val())if(null==e)e=i,$(this).attr("data-firstChanged",!0),$(n).each((function(e,t){var n=$('[id="'+t.id+'"]').attr("data-changed");null!=n&&(1==n||"true"==n||"1"==n)||t.id==i||($('[id="'+t.id+'"]').val($('[id="'+i+'"]').val()),"select"===$('[id="'+t.id+'"]').prop("tagName").toLowerCase()?($('[id="'+t.id+'"]').trigger("change"),$('[id="'+t.id+'"]').trigger("select2:select")):$('[id="'+t.id+'"]').blur())}));else{var r=$('[id="'+n[t].id+'"]').attr("data-changed"),o=null!=r&&(1==r||"true"==r||"1"==r);n[t].id==e?$(n).each((function(e,t){var n=$('[id="'+t.id+'"]').attr("data-changed");null!=n&&(1==n||"true"==n||"1"==n)||t.id==i||($('[id="'+t.id+'"]').val($('[id="'+i+'"]').val()),"select"===$('[id="'+t.id+'"]').prop("tagName").toLowerCase()?($('[id="'+t.id+'"]').trigger("change"),$('[id="'+t.id+'"]').trigger("select2:select")):$('[id="'+t.id+'"]').blur())})):n[t].id==e||o||$('[id="'+n[t].id+'"]').attr("data-changed",!0)}}))}))}))}()}(0,c))},Gt=function(e,t){var i=$(e).find(":selected").data("name-country");$(t).val(i)}
1,qt=function(){var e=$('select[data-name-country-select="true"]');$(e).length>0&&$(e).each((function(t,i){var n=$(e).siblings('input[type="hidden"][data-name-country-input="true"]');Gt(i,n),$(i).on("change",(function(){Gt(this,n)}))}))},Ht=function(e,t){var i=$(t).data("selectdata"),n="";n=null!=i&&""!==i?$(e).find(":selected").data(i):$(e).val(),$(t).val(n),$(t).trigger("change")},zt=function(){$('input[type="hidden"][data-copyselectdata]').each((function(e,t){var i=$('[id="'+$(t).data("copyselectdata")+'"]');i.length>0&&(Ht(i,t),$(i).on("change",(function(){Ht(i,t)})))}))},Kt=function(){var e=$(".js-autocomplete");$(e).each((function(e,t){var i,n=$(t).attr("id"),r=$(t).hasClass("js-avoid-categories-request"),o=$(t).is("[data-keep-activities]"),s=$(t).attr("data-autocomplete"),a=$(t).attr("data-autocomplete-url"),l=$(t).hasClass("_complex"),u=$(t).parents('form#widger-generator, form[id^="user-register"], form#provider-register'),d=$(this).is("[data-autoadd]");d&&(i=$("#"+$(this).attr("data-autoadd"))).data("delay",200);var f=void 0!==$(t).attr("data-show-activities-title"),h=function(e){return e=(e=(e=(e=(e=(e=(e=e.replace(/[aáà âäãAÃÃÃÃÃÃ
Ã]/i,"[aáà âäãAÃÃÃÃÃÃ
Ã]")).replace(/[eéèêëEÃÃÃÃ]/i,"[eéèêëEÃÃÃÃ]")).replace(/[iÃìîïIÃÃÃÃ]/i,"[iÃìîïIÃÃÃÃ]")).replace(/[oóòôöõOÃÃÃÃÃ]/i,"[oóòôöõOÃÃÃÃÃ]")).replace(/[uúùüûUÃÃÃÃ]/i,"[uúùüûUÃÃÃÃ]")).replace(/[cçC]/i,"[cçC]")).replace(/[yYÿÃ]/i,"[yYÿÃ]")},p=function(e,i){var r,o={},s=[],d=a=$(t).attr("data-autocomplete-url"),f={};if(l){var h=$(t).attr("data-extra-params");if("string"==typeof h&&""!==h)try{if(r=JSON.parse(h),d=c.a.addParams(r,d),"activity"===n&&null!=u){var p=$(u).find("#lang"),v=$(u).find("#idDest"),g=$(u).find("#type"),m=$(u).find("#blockActivities");p.length>0&&(d=c.a.addParam("lang",$(p).val(),d)),v.length>0&&(d=c.a.addParam("idDest",$(v).val(),d)),g.length>0&&(d=c.a.addParam("type",$(g).val(),d)),m.length>0&&(d=c.a.addParam("blockActivities",$(m).val(),d))}}catch(e){c.a.l("JSON error;"),c.a.l(e)}}else if("activity"===n&&null!=u){p=$(u).find("#lang"),v=$(u).find("#idDest"),g=$(u).find("#type"),m=$(u).find("#blockActivities");p.length>0&&(f.lang=$(p).val()),v.length>0&&(f.idDest=$(v).val()),g.length>0&&(f.type=$(g).val()),m.length>0&&(f.blockActivities=$(m).val())}f=JSON.stringify(f),$.ajax({type:l?"GET":"POST",url:d.replace("queryString",e),dataType:"json",data:l?"":f,success:function(e){if(l){if("undefined"!==e&&null!==e&&"object"===x(e)){if("categories"!==n&&"activity"!==n){var t=e[0].destinations||[];$.each(t,(function(e,t){s.push({value:!l||void 0!==t.name&&null!==t.name&&""!=t.name?t.name:t.countryName,data:{id:t.id,destinationId:t.destinationId,countryId:t.countryId,country:"city"===t.destinationType?t.countryName:"",type:t.destinationType||t.type,numberOfActivities:void 0!==t.totalActivities&&null!==t.totalActivities&&""!==t.totalActivities?t.totalActivities+(void 0!==t.transfers&&null!==t.transfers&&1==t.transfers?1:0):null}})}))}if("categories"!==n&&"dest"!==n){var a=e[1].activities||[];$.each(a,(function(e,t){var i=t.id,n=i.match(/^[A-Za-z]+/i)?i.replace(/^[A-Za-z]+/i,""):i,o=null==n||""===n;o&&(!o||void 0!==r.transfers&&null!==r.transfers&&""!==r.transfers&&!0!==r.tranfers&&"true"!==r.transfers&&"1"!==r.transfers)||s.push({value:t.name,data:{id:t.id,activityId:t.activityId,country:t.destName}})}))}}}else{var c=void 0!==e.data&&null!==e.data?e.data:e;for(var u in c)if(c.hasOwnProperty(u)){c[u].name;s.push({value:c[u].name,data:{id:c[u].id,country:c[u].dest}})}}o.suggestions=s,i(o)},error:function(e,t,i){0!==e.status&&(c.a.isLocal()?console.error(new Error("Ajax error: "+t+", "+i)):console.error(new Error("Ajax error: "+t+", "+i+" || Ajax response: status: "+e.status+" , statusText: "+e.statusText+" , responseText: "+e.responseText)))}})},v=$(t).parsley(),g={lookupFilter:function(e,t,i){var n="(\\b|^)("+$.Autocomplete.utils.escapeRegExChars(i)+")";n=h(n);var r=new RegExp(n);return e.value.toLowerCase().match(r)},formatResult:function(e,t){var i="(\\b|^)("+$.Autocomplete.utils.escapeRegExChars(t)+")";i=h(i);var r=e.value.replace(new RegExp(i,"gi"),"<strong>$1$2</strong>");return(null!=s&&"dest"===s||null!=a&&"activity"===n)&&void 0!==e.data.country&&null!==e.data.country&&""!==e.data.country&&(r+='<sp
1an class="lighter"> - '+e.data.country+"</span>"),r},triggerSelectOnValidInput:!1,onHide:function(e){setTimeout((function(){var e=$(t).autocomplete().suggestions,i=void 0!==$(t).val()&&null!==$(t).val()&&""!==$(t).val();1==e.length&&i?($(t).autocomplete().onSelect(0),window.ParsleyUI.removeError(v,"errorInput")):e.length>1&&i||0==e.length&&i?(window.ParsleyUI.removeError(v,"errorInput"),0==v._ui.$errorsWrapper.children().length&&(window.ParsleyUI.addError(v,"errorInput",function(e){return null!=e&&""!==e?"dest"==e?$(t).hasClass("js-error-not-found-bbdd")?c.a.tr("error.noDestinationFound"):c.a.tr("error.errorInputDestination"):"categories"==e?c.a.tr("error.errorInputCategory"):"activity"==e?c.a.tr("error.errorInputActivity"):c.a.tr("error.errorInputData"):c.a.tr("error.errorInputData")}(n)),u.length>0&&"dest"==n&&Me(u),u.length>0&&"activity"==n&&Re(u))):(window.ParsleyUI.removeError(v,"errorInput"),u.length>0&&"dest"==n&&(Me(u,!0),o&&Re(u,!0)),u.length>0&&"activity"==n&&Re(u))}))},onSelect:function(e){setTimeout((function(){window.ParsleyUI.removeError(v,"errorInput"),u.length>0&&"dest"==n&&(!function(e,t){var i,n=$(e).find("#dest"),r=$(e).find("#idDest"),o=$(e).find("#type"),s=t.data.destinationType||t.data.type,a=$(e).is("#widger-generator")||$(e).is("#billboard-generator")||$(e).is("#banner-generator")?t.data.destinationId>0?String(t.data.destinationId):t.data.countryId>0?String(t.data.countryId):(i=String(t.data.id)).match(/^[A-Za-z]+/i)?i.replace(/^[A-Za-z]+/i,""):i:function(){var e=String(t.data.id);return e.match(/^[A-Za-z]+/i)?e.replace(/^[A-Za-z]+/i,""):e}(),l="city"==s?"dest":s;$(n).attr("data-id",a),r.length>0&&($(r).val(a),$(r).trigger("change")),o.length>0&&($(o).val(l),$(o).trigger("change")),Le(e)}(u,e),u.filter("form#widger-generator")&&(r||function(e,t){var i=void 0!==APPConfig.isAccommodation&&(1==APPConfig.isAccommodation||"true"==APPConfig.isAccommodation||"1"==APPConfig.isAccommodation),n=void 0!==APPConfig.isAgencyGroup&&(1==APPConfig.isAgencyGroup||"true"==APPConfig.isAgencyGroup||"1"==APPConfig.isAgencyGroup),r=void 0!==APPConfig.agencyId&&null!==APPConfig.agencyId&&""!==APPConfig.agencyId?"/"+(n?c.a.tr("agencies_group_url_link_href"):i?c.a.tr("accommodations_url_link_href"):c.a.tr("agencies_url_link_href")):c.a.tr("affiliatesUrl"),o=c.a.isGuide()?r+"/get-categories":void 0!==window.civLocale&&null!==window.civLocale?"/"+window.civLocale+r+"/get-categories":"/es"+r+"/get-categories",s=$(e).find("#lang"),a="es";s.length>0&&(a=$(s).val());var l,u=t.data.destinationType||t.data.type,d={lang:a,idDest:t.data.destinationId>0?String(t.data.destinationId):t.data.countryId>0?String(t.data.countryId):(l=String(t.data.id)).match(/^[A-Za-z]+/i)?l.replace(/^[A-Za-z]+/i,""):l,type:"city"==u?"dest":u};d=JSON.stringify(d),c.a.loading(),$.ajax({url:o,type:"POST",data:d,dataType:"json",success:function(t){var i=$(e).find("select#categories"),n=$($(i).find("option")[0]).html();i.empty(),i.append($("<option></option>").attr("value","").text(n)),$.each(t,(function(e,t){i.append($("<option></option>").attr("value",t.id).text(t.name))})),$(i).trigger("change")},error:function(e,t,i){0!==e.status&&(c.a.isLocal()?console.error(new Error("Ajax error: "+t+", "+i)):console.error(new Error("Ajax error: "+t+", "+i+" || Ajax request: "+dataAjax+" || Ajax response: status: "+e.status+", statusText: "+e.statusText+", responseText: "+e.responseText)))},complete:function(){c.a.unLoading()}})}(u,e),o?Re(u,!0):function(e){var t=$(e).find("#activity"),i=$(e).find("#categories");t.length>0&&($(t).val(""),$(t).trigger("change"),$(t).attr("data-id",""),$(t).attr("data-country",""),He(e)),i.length>0&&($(i).val(""),$(i).trigger("change"),ze(e))}(u)),Ue(t[0],e)),u.length>0&&"activity"==n&&function(e,t){var i;if(t.data.activityId>0)i=String(t.data.activityId);else{var n=String(t.data.id);i=n.match(/^[A-Za-z]+/i)?n.replace(/^[A-Za-z]+/i,""):n}i=null==i||""===i?-1:i;var r=t.data.countryId||t.data.country,o=$(e).find("#activity");o.length>0&&($(o).attr("data-id",i),$(o).attr("data-country",r))}(u,e),d&&setTimeout((function(){i.trigger("click")}))}))},beforeRender:function(e,t){if(f){var i=t.length;
1e.prepend('<div class="autocomplete-suggestions__title"><strong>'+c.a.tr("activities_url")+'</strong> <span class="autocomplete-suggestions__title__count">('+c.a.trWithNumber("n-results",i,i)+")</span></div>"),e.addClass("show-activities-title")}}};if(null!=s&&""!==s&&void 0!==window.autocomplete&&null!==window.autocomplete&&void 0!==window.autocomplete[s]&&null!==window.autocomplete[s]){var m=window.autocomplete[s];null!=m&&""!==m?g.lookup=m:null!=a&&""!==a&&(g.deferRequestBy=200,-1!==a.indexOf("queryString")?g.lookup=p:g.serviceUrl=a)}else null!=a&&""!==a&&(g.deferRequestBy=200,-1!==a.indexOf("queryString")?g.lookup=p:g.serviceUrl=a);$(t).autocomplete(g)}))},Wt=function(){var e=$(".js-new-autocomplete"),t=function(e){return e=(e=(e=(e=(e=(e=(e=e.replace(/[aáà âäãAÃÃÃÃÃÃ
Ã]/i,"[aáà âäãAÃÃÃÃÃÃ
Ã]")).replace(/[eéèêëEÃÃÃÃ]/i,"[eéèêëEÃÃÃÃ]")).replace(/[iÃìîïIÃÃÃÃ]/i,"[iÃìîïIÃÃÃÃ]")).replace(/[oóòôöõOÃÃÃÃÃ]/i,"[oóòôöõOÃÃÃÃÃ]")).replace(/[uúùüûUÃÃÃÃ]/i,"[uúùüûUÃÃÃÃ]")).replace(/[cçC]/i,"[cçC]")).replace(/[yYÿÃ]/i,"[yYÿÃ]")},i=function(e,i,n){var r="(\\b|^)("+$.Autocomplete.utils.escapeRegExChars(n)+")";r=t(r);var o=new RegExp(r);return e.value.toLowerCase().match(o)},n=function(e,t){t=null!=t&&(1==t||"true"==t||"1"==t);var i=e.is("[data-allow-free-text]");(setTimeout((function(){var n=e.parsley(),r=e.autocomplete().suggestions;if(void 0!==e.val()&&null!==e.val()&&""!==e.val()){var o=void 0===e.attr("data-autoselect-one")||null==e.attr("data-autoselect-one")||1==e.attr("data-autoselect-one")||"true"==e.attr("data-autoselect-one")||"1"==e.attr("data-autoselect-one");o&&1==r.length||i?(o&&1==r.length&&e.autocomplete().onSelect(0),window.ParsleyUI.removeError(n,"errorInput")):(window.ParsleyUI.removeError(n,"errorInput"),0==n._ui.$errorsWrapper.children().length&&(window.ParsleyUI.addError(n,"errorInput",function(e){var t=c.a.tr("error.errorInputData");return void 0!==e&&1===e.length&&(t=e.hasClass("js-error-not-found-bbdd")?e.attr("data-error-not-found-bbdd"):e.is("[data-default-error]")?e.attr("data-default-error"):c.a.tr("error.errorInputData")),t}(e)),e.attr("data-id",""),e.attr("data-url",""),e.attr("data-type",""),t&&e.trigger("change")))}else window.ParsleyUI.removeError(n,"errorInput"),e.attr("data-id",""),e.attr("data-url",""),e.attr("data-type",""),t&&e.trigger("change")})),e.is("[data-validate-on-select]"))&&e.closest("form").trigger("form:validate")};
1e.each((function(){var e=$(this);e.autocomplete("dispose");var r="true"===e.attr("data-show-country"),o="true"===e.attr("data-show-country-in-input"),s=void 0!==e.attr("data-min-chars")&&null!==e.attr("data-min-chars")&&""!==e.attr("data-min-chars")?"string"==typeof e.attr("data-min-chars")?parseInt(e.attr("data-min-chars")):e.attr("data-min-chars"):1,a=void 0!==e.attr("data-position")&&null!==e.attr("data-position")&&""!==e.attr("data-position")?e.attr("data-position"):"bottom",l=e.hasClass("_complex"),u=e.is("[data-allow-free-text]"),d={lookupFilter:i,formatResult:function(e,i){return function(e,i,n){var r="(\\b|^)("+$.Autocomplete.utils.escapeRegExChars(i)+")";r=t(r);var o=e.value.replace(new RegExp(r,"gi"),"<strong>$1$2</strong>");return"undefined"!=typeof dataAutocomplete&&null!==dataAutocomplete&&"dest"===dataAutocomplete||"undefined"!=typeof dataAutocompleteUrl&&null!==dataAutocompleteUrl&&"activity"===inputId?void 0!==e.data.country&&null!==e.data.country&&""!==e.data.country&&(o+='<span class="lighter"> - '+e.data.country+"</span>"):n&&void 0!==e.data.country&&null!==e.data.country&&""!==e.data.country&&(o+='<span class="lighter"> - '+e.data.country+"</span>"),o}(e,i,r)},onHide:function(t){n(e,l)},onSelect:function(t){setTimeout((function(){var i=void 0!==e.data("on-select")&&null!==e.data("on-select")?e.data("on-select"):null;null!==i?i(e,t,o):function(e,t,i,n){n=null!=n&&(1==n||"true"==n||"1"==n);var r=e.val();i&&void 0!==t.data.country&&null!==t.data.country&&""!==t.data.country&&(r+=" - "+t.data.country),e.val(c.a.decode(r));var o=e.parsley();window.ParsleyUI.removeError(o,"errorInput");var s=t.data.id;s=null==(s=s.match(/^[A-Za-z]+/i)?s.replace(/^[A-Za-z]+/i,""):s)||""===s?-1:s;var a=e.closest("form");(a.is("#widger-generator")||a.is("#billboard-generator")||a.is("#banner-generator"))&&(t.data.destinationId>0?s=String(t.data.destinationId):t.data.countryId>0?s=String(t.data.countryId):t.data.activityId>0&&(s=String(t.data.activityId))),e.attr("data-id",s);var l=t.data.url;e.attr("data-url",l);var u=t.data.type;(u="city"==u?"dest":u,e.attr("data-type",u),n&&e.trigger("change"),Ue(e[0],t),e.is("[data-validate-on-select]"))&&e.closest("form").trigger("form:validate")}(e,t,o,l)}))},minChars:s,orientation:a};u&&(d.respones=function(e,t){0==t.content.length&&t.content.push({label:"New Search value: "+$(this).val(),value:$(this).val(),id:0})});var f=e.is("[data-service-url]"),h=e.is("[data-lookup]");if(f)d.lookup=function(t,i){!function(e,t,i,n){var r=i.attr("data-min-length");if(!(void 0!==r&&e.length<parseInt(r))){n=null!=n&&(1==n||"true"==n||"1"==n),i.addClass("_loading");var o={},s=[],a={lang:$("#lang").val()},l=i.attr("data-params"),u=i.attr("data-params-name");void 0!==l&&(l=l.split(","),u=void 0!==u?u.split(","):l,l.forEach((function(e,t){var i=$("#"+e);1===i.length&&(a[u[t]]=i.val())}))),a=JSON.stringify(a);var d,f=i.attr("data-service-url").replace("queryString",e),h=i.attr("data-extra-params");if("string"==typeof h&&""!==h)try{d=JSON.parse(h),f=c.a.addParams(d,f),n&&null!=l&&""!==l&&Array.isArray(l)&&l.length>0&&l.forEach((function(e,t){var i=$("#"+e);1===i.length&&(f=c.a.addParam(u[t],i.val(),f))}))}catch(e){c.a.l("JSON error;"),c.a.l(e)}var p=i.attr("data-request-type");void 0===p&&(p=n?"GET":"POST"),$.ajax({type:p,url:f,dataType:"json",data:n?"":a,success:function(e){var r=i.attr("id");if(n){if("undefined"!==e&&null!==e&&"object"===x(e)){var a=e[0].destinations||[],l=[],u=[];$.each(a,(function(e,t){if("categories"!==r&&"activity"!==r&&"activities"!==r){var n=t.id;i.is("[data-numeric-id]")&&(n=n.replace(/^[A-Za-z]+/i,"")),l.push({value:void 0!==t.name&&""!==t.name?t.name:t.countryName,data:{id:n,destinationId:t.destinationId||null,countryId:t.countryId||null,country:void 0!==t.destinationType&&"city"===t.destinationType?t.countryName:"",url:-1!==t.url.indexOf("civitatis.com")?t.url:"https://www.civitatis.com"+t.url,type:t.destinationType||t.type,numberOfActivities:void 0!==t.totalActivities&&null!==t.totalActivities&&""!==t.totalActivities?t.totalActivities+(void 0!==t.transfers&&null!==t.transfers&&1==t.transfers?1:0):null}})}if("categories"!==r&&"dest"!==r&&"destinations"!==r&&void 0!==t&&void 0!==d&&!(void 0===t.transfers||null===t.transfers||1!=t.transfers&&"true"!=t.transfers&&"1"!=t.transfers||void 0!==d.transfers&&null!==d.transfers&&""!==d.transfers&&!0!==d.tranfers&&"true"!==d.transfers&&"1"!==d.transfers)){var o=void 0!==t.name&&""!==t.name?t.name:t.countryName,s=t.translations.trasladosen||null,a=t.translations.on_zone||t.translations.on_country||null,f=null!==s&&""!==s?s:null!==a&&""!==a?c.a.tr("transfersIn2",a):c.a.tr("transfersIn",o),h=t.translations.transfers_url||c.a.tr("transfersUrlWithoutSlash");u.push({value:f,data:{id:t.id,country:null,url:-1!==t.url.indexOf("civitatis.com")?t.url+h+"/":"https://www.civitatis.com"+t.url+h+"/",type:t.destinationType||t.type}})}}));var f=e[1].activities||[],h=[];$.each(f,(function(e,t){var n=t.id,o=n.match(/^[A-Za-z]+/i)?n.replace(/^[A-Za-z]+/i,""):n;if("categories"!==r&&"dest"!==r&&"destinations"!==r){var s=null==o||""===o;if(!s||s&&(void 0===d.transfers||null===d.transfers||""===d.transfers||!0===d.tranfers||"true"===d.transfers||"1"===d.transfers)){var a=t.id;i.is("[data-numeric-id]")&&(a=a.replace(/^[A-Za-z]+/i,"")),h.push({value:t.name,data:{id:a,activityId:t.activityId,country:t.destName,url:-1!==t.url.indexOf("civitatis.com")?t.url:"https://www.civitatis.com"+t.url}})}}})),s=$.merge($.merge($.merge([],l),u),h)}}else for(var p in void 0!==e.data&&(e=e.data),e){var v=e[p].name,g=e[p].id,m=void 0!==e[p].destination?e[p].destination:void 0!==e[p].country?e[p].country:e[p].dest;s.push({value:v,data:{id:g,country:m}})}o.suggestions=s,i.removeClass("_loading"),t(o)},error:function(e,t,n){i.removeClass("_loading"),0!==e.status&&(c.a.isLocal()?console.error(new Error("Ajax error: "+t+", "+n)):console.error(new Error("Ajax error: "+t+", "+n+" || Ajax response: status: "+e.status+" , statusText: "+e.statusText+" , responseText: "+e.responseText)))}})}}(t,i,e,l)},d.deferRequestBy=200;else if(h){var p=window.autocomplete[e.attr("data-lookup")];if(void 0===p)return void c.a.l("no hay datajson");d.lookup=p}e.autocomplete(d)}))}
1,Yt=function(){var e=$("body").hasClass("is_logged-agency")||$("body").hasClass("is_logged-accommodations")||c.a.isAggenciesPanel(),t=e?"ag_cmp":"cmp",i=function(e,i){var n=$(e).find(":input"),r=$(n).filter("#lang"),o=$(n).filter("#desAct"),s=$(n).filter("#cmp"),a=r.length>0?r.val():"",l=null!=i&&""!==i?i:o.length>0?$(o).attr("data-url"):"",u=s.length>0?s.val():"",d="";return null!=l&&""!==l&&(d=l,"undefined"!=typeof APPConfig&&null!==APPConfig&&void 0!==APPConfig.agencyId&&null!==APPConfig.agencyId&&""!==APPConfig.agencyId?(d=c.a.addParam("ag_aid",void 0!==APPConfig.agencyIdOriginal&&null!==APPConfig.agencyIdOriginal&&""!==APPConfig.agencyIdOriginal?APPConfig.agencyIdOriginal:APPConfig.agencyId,d),void 0!==APPConfig.externalId&&null!==APPConfig.externalId&&""!==APPConfig.externalId&&(d=c.a.addParam("ex_aid",APPConfig.externalId,d),void 0!==APPConfig.groupid&&null!==APPConfig.groupid&&""!==APPConfig.groupid&&(d=c.a.addParam("g_id",void 0!==APPConfig.groupidOriginal&&null!==APPConfig.groupidOriginal&&""!==APPConfig.groupidOriginal?APPConfig.groupidOriginal:APPConfig.groupid,d)))):"undefined"!=typeof APPConfig&&null!==APPConfig&&void 0!==APPConfig.affiliateId&&null!==APPConfig.affiliateId&&""!==APPConfig.affiliateId&&(d=c.a.addParam("aid",void 0!==APPConfig.affiliateIdOriginal&&null!==APPConfig.affiliateIdOriginal&&""!==APPConfig.affiliateIdOriginal?APPConfig.affiliateIdOriginal:APPConfig.affiliateId,d)),null!=u&&""!==u&&(d=c.a.addParam(t,encodeURI(c.a.normalizeStringSpecialCharacters(u).replace(/\s+/g,"_").replace(/[^A-Za-z0-9]/g,"_")),d)),null!=a&&""!==a&&(d=d.replace(/(https?:\/\/www\..*?\/)(.*?)(\/.*)$/,"$1".concat(a,"$3")))),d},n=function(e){$('[data-link="true"]').each((function(t,i){var n=$(i).attr("href");n="facebook"==$(i).attr("data-value")?c.a.addParam("u",encodeURIComponent(e),n):c.a.addParam("url",encodeURIComponent(e),n),$(i).attr("href",n)}))},r=function(t){var i=$("#qr-generator-wrapper"),n=$("#qr-code-image"),r=$("#qr-generator-wrapper").find(".__qr-download");if(0!==i.length&&0!==n.length)if(null!=t&&""!==t){var o=e?"ag_cmpint":"cmpint";t=c.a.addParam(o,"QR",t);var s="/api/qr-generator?type=logo&url="+encodeURIComponent(t);n.attr("src",s),n.removeAttr("style"),n.css({display:"block",width:"72px",height:"72px",margin:"0"}),i.removeClass("js-hide js-hide-important"),r.length>0&&(r.off("click.qrDownload"),r.on("click.qrDownload",(function(e){e.preventDefault();var t=s+"&format=png";window.open(t,"_blank")})))}else n.css("display","none"),i.addClass("js-hide")},o=$("#link-generator, #generate-link-form");if(o.length>0){$(o).off("submit.initLinkGenerator"),$(o).on("submit.initLinkGenerator",(function(e){e.preventDefault()}));
1var s,a=$(o).find(":input"),l=$(a).filter("#lang"),u=$(a).filter("#desAct"),d=$(a).filter("#cmp"),f=$(o).find("#link-generator-wrapper"),h=$(f).data("url-static"),p=$(o).find(".__text"),v=$(o).find(".__link"),g=$(o).find(".__short"),m=$(o).find("#generated-link-input"),_=$(o).find(".hidden-link-wrapper");if(g.click((function(){var e=i(o,h);null!=e&&""!==e&&$.ajax({type:"POST",url:"/api/urlShortener",dataType:"json",data:JSON.stringify({url:e,token:APPConfig.csrfToken}),success:function(e){navigator.clipboard.writeText(e.url)},error:function(){navigator.clipboard.writeText(e)}})})),$("#lang").off("change"),$("#lang").on("change",(function(){u.removeAttr("data-url"),u.attr("data-service-url",Object(C.a)("wave_release_web_disambiguation_search_engine")?"/api/search/".concat($(a).filter("#lang").val(),"/queryString"):"/".concat($(a).filter("#lang").val(),"/ajaxsearchall/queryString")),u.val("")})),0==l.length&&0==u.length){var y=i(o,h);null!=y&&""!==y?(p.text(y),v.attr("data-clipboard-text",y),n(y),r(y)):(p.text(""),v.attr("data-clipboard-text",""),n(""),r(""))}l.length>0&&(l.off("change.linkgenerator"),l.on("change.linkgenerator",(function(){u.removeAttr("data-url"),u.attr("data-service-url",Object(C.a)("wave_release_web_disambiguation_search_engine")?"/api/search/".concat($(a).filter("#lang").val(),"/queryString"):"/".concat($(a).filter("#lang").val(),"/ajaxsearchall/queryString")),u.val("");var e=$(this).hasClass("parsley-error"),t=$(this).val(),s=i(o,h);e||null==s||""===s||""===t?(f.hasClass("no-js-hide")||f.addClass("js-hide"),_&&_.addClass("js-hide"),m.attr("value",""),p.text(""),v.attr("data-clipboard-text",""),n(""),r("")):(f.removeClass("js-hide"),p.text(s),v.attr("data-clipboard-text",s),n(s),r(s))}))),u.length>0&&(u.off("change.linkgenerator"),u.on("change.linkgenerator",(function(){var e=$
1(this).hasClass("parsley-error"),t=$(this).val(),s=i(o,h);e||null==s||""===s||""===t?(f.hasClass("no-js-hide")||f.addClass("js-hide"),_&&_.removeClass("js-hide"),m.attr("value",""),p.text(""),v.attr("data-clipboard-text",""),n(""),r("")):(f.removeClass("js-hide"),_&&_.removeClass("js-hide"),m.attr("value",s),p.text(s),v.attr("data-clipboard-text",s),n(s),r(s))})));var b=function(){var e=d.hasClass("parsley-error"),t=i(o,h);e||null==t||""===t?(p.text(""),v.attr("data-clipboard-text",""),n(""),r("")):(p.text(t),v.attr("data-clipboard-text",t),n(t),r(t))};d.off("change.linkgenerator input.linkgenerator"),d.on("change.linkgenerator",b),d.on("input.linkgenerator",(function(){clearTimeout(s),s=setTimeout(b,500)}));var E=function(){if(null!=h&&""!==h){var e=i(o,h);null!=e&&""!==e&&r(e)}};E();var w=$("#generate-your-link-and-share");w.length>0&&w.on("open.zf.reveal opened.fndtn.reveal",(function(){setTimeout(E,100)}))}},Jt=function(){var e=$("#widger-generator");e.length>0&&(function(e){if(null==e)return!1;var t=$(e).find("#lang"),i=t.is("[data-keep-language]"),n=t.is("[data-keep-activities]"),r=void 0!==APPConfig.isAccommodation&&(1==APPConfig.isAccommodation||"true"==APPConfig.isAccommodation||"1"==APPConfig.isAccommodation),o=void 0!==APPConfig.isAgencyGroup&&(1==APPConfig.isAgencyGroup||"true"==APPConfig.isAgencyGroup||"1"==APPConfig.isAgencyGroup),s=void 0!==APPConfig.agencyId&&null!==APPConfig.agencyId&&""!==APPConfig.agencyId?"/"+(o?c.a.tr("agencies_group_url_link_href"):r?c.a.tr("accommodations_url_link_href"):c.a.tr("agencies_url_link_href")):c.a.tr("affiliatesUrl"),a=c.a.isGuide()?s+"/get-ids":void 0!==window.civLocale&&null!==window.civLocale?"/"+window.civLocale+s+"/get-ids":"/es"+s+"/get-ids";$(t).on("change",(function(){var r={lang:i?c.a.getLocale():$(t).val()};r=JSON.stringify(r),Le(e),c.a.loading(),$.ajax({url:a,type:"POST",data:r,dataType:"json",success:function(r){void 0!==window.autocomplete&&null!==window.autocomplete&&void 0!==window.autocomplete.dest&&null!==window.autocomplete.dest&&void 0!==r.dest&&null!==r.dest&&Array.isArray(r.dest)&&r.dest.length>0&&(window.autocomplete.dest=r.dest),void 0!==window.autocomplete&&null!==window.autocomplete&&void 0!==window.autocomplete.categories&&null!==window.autocomplete.categories&&void 0!==r.categories&&null!==r.categories&&Array.isArray(r.categories)&&r.categories.length>0&&(window.autocomplete.categories=r.categories);var o=$(e).find('.js-autocomplete[data-autocomplete="dest"]');
1if(o.length>0)if(void 0!==$(o).attr("data-autocomplete-url")&&null!==$(o).attr("data-autocomplete-url")&&""!==$(o).attr("data-autocomplete-url")){var s=$(o).attr("data-autocomplete-url"),a=$(o).attr("data-url-lang");if(null!=a&&""!==a){var l=s.replaceAll("/"+a+"/","/"+(i?c.a.getLocale():$(t).val())+"/"),u=i?c.a.getLocale():$(t).val();$(o).attr("data-autocomplete-url",l),$(o).attr("data-url-lang",u)}}else $(o).autocomplete().setOptions({lookup:r.dest});var d=$(e).find("select#categories"),f=$($(d).find("option")[0]).html();d.empty(),d.append($("<option></option>").attr("value","").text(f)),$.each(r.categories,(function(e,t){d.append($("<option></option>").attr("value",t.id).text(t.name))})),$(d).trigger("change"),ze(e),n?Re(e,!0):He(e);var h=$(e).find("#activity.js-autocomplete");if(h.length>0&&void 0!==$(h).attr("data-autocomplete-url")&&null!==$(h).attr("data-autocomplete-url")&&""!==$(h).attr("data-autocomplete-url")){var p=$(h).attr("data-autocomplete-url"),v=$(h).attr("data-url-lang");if(null!=v&&""!==v){var g=p.replaceAll("/"+v+"/","/"+(i?c.a.getLocale():$(t).val())+"/"),m=i?c.a.getLocale():$(t).val();$(h).attr("data-autocomplete-url",g),$(h).attr("data-url-lang",m)}}var _=$("fieldset#activities-widget");_.length>0&&De(_)},error:function(e,t,i){0!==e.status&&(c.a.isLocal()?console.error(new Error("Ajax error: "+t+", "+i)):console.error(new Error("Ajax error: "+t+", "+i+" || Ajax request: "+dataAjax+" || Ajax response: status: "+e.status+", statusText: "+e.statusText+", responseText: "+e.responseText)))},complete:function(){c.a.unLoading()}})}))}(e),Le(e),function(e){var t=$(e).find("#cmp");$(t).off("keyup.cmpChange"),$(t).on("keyup.cmpChange",(function(){$(t).off("change.cmpChange"),$(t).attr("data-auto-fill-off","true")}))}(e))},Xt=function(e,t,i,n,r,o,s){var a=function(a){if(a="function"==typeof a?a:Function.prototype,null!=t&&""!==t||(t=void 0===$(i).data("data-notempty")||"true"!=$(i).data("notempty")&&"1"!=$(i).data("notempty")?String(e||"").trim().replace(/\s+/g,"_").replace(/[^A-Za-z0-9_\-]/g,"").toLowerCase():$(r).children(":not(.--example)").length.toString()),null!=e&&""!==e&&null!=t&&""!==t){var l=$(i).val();if(l=null!=l&&""!==l?l.split(","):[],null!=n&&n.length>0)c=null!=(c=$(n).val())&&""!==c?c.split("\n"):[];else var c=[];if(-1===jQuery.inArray(t,l)&&-1===jQuery.inArray(e,c)){l.push(t),l=l.join(),$(i).val(l),$(i).trigger("change"),null!=n&&n.length>0&&(c.push(e),c=c.join("\n"),$(n).val(c),$(n).trigger("change"));var u=$(o).find(".__activity");0!=u.length?(u.html(e),void 0!==s&&u.after('<span class="__city">'+s+"</span>")):$(o).find(".a-filter--applied__text").html(e),$(o).removeClass("js-hide").removeClass("--example").appendTo(r),$(o).attr("data-id",t),$(o).attr("data-value",e),$(r).removeClass("js-hide"),qe(o)}a()}},l=r.attr("data-sort-select");"string"==typeof l?a((function(){Be(l)})):a()},Zt=function(e){e=null!=e?e:$("body");var t=$(e).find("[data-remove-html-element]");$(t).off("click.deleteHtmlElement"),$(t).on("click.deleteHtmlElement",(function(e){var t=$(this);e.preventDefault(),e.stopPropagation();var i=$("[id='"+$(t).data("remove-html-element")+"']"),n=$('[data-paste-html-element="'+$(i).parent().attr("id")+'"]');$(i).remove(),$(n).each((function(e,t){Pe(t),xe(t),ke(t),function(e){var t=$('[id="'+$(e).data("paste-html-element")+'"]'),i=$(t).children(":not(.js-hide)");$(i).each((function(e,t){var i=e+1,n=$(t).data("label-text").replace("%s",i),r=$(t).find("[data-label]");null!=n&&""!==n&&r.length>0&&$(r).text(n)}))}(t)}))}))}
1,Qt=function(){var e=$("[data-copy-element]").filter("[data-paste-element]");e.data("isclicked",!1),$(e).on("click",(function(e){var t=$(this);e.preventDefault();var i=void 0!==t.data("delay")?t.data("delay"):0;setTimeout((function(){if(!t.data("isclicked")){t.data("isclicked",!0);var e=$("#"+t.data("copy-element")),i=$("#"+t.data("paste-element")),n=$(i).find(".o-filters--applied"),r=$(i).find(".a-filter--applied.--example").clone(),o=$("#"+t.data("paste-element-input")),s=$("#"+t.data("paste-element-input-aux")),a=$("#"+t.data("paste-element-input-value")),l=void 0!==$(t).data("copy-paste-validate")&&null!==$(t).data("copy-paste-validate")&&(1==$(t).data("copy-paste-validate")||"1"==$(t).data("copy-paste-validate")||"true"==$(t).data("copy-paste-validate"));if(l&&$(e).parsley().validate(),!l||l&&$(e).parsley().isValid()&&0==$(e).next(".parsley-errors-list.filled").length){var u,d=$(e).val();e.is("select")&&(d=$(e).find("option:selected").text());var f="";e.is("select")?u=$(e).val():(u=$(e).attr("data-id"),f=$(e).attr("data-country"),u||(u=$(e).val())),"number"==typeof u&&(u=u.toString());var h=t.attr("data-add-element-url");if(void 0===h)Xt(d,u,o,a,n,r,f),s.length>0&&"-1"==u&&s.val("1"),setTimeout((function(){t.data("isclicked",!1)}),100);else{if(""===u)return;c.a.loading();var p={activityId:u};$.ajax({url:h,type:"POST",data:p}).done((function(e,i,l){Xt(d,u,o,a,n,r,f),s.length>0&&"-1"==u&&s.val("1"),t.data("isclicked",!1),c.a.unLoadingAll()})).fail((function(e,i,l){Xt(d,u,o,a,n,r,f),s.length>0&&"-1"==u&&s.val("1"),CivAPP.ConfirmUtil.showWarning({title:c.a.tr("modify_errorSavingChangesMessage"),message:""}),setTimeout((function(){t.data("isclicked",!1)}),100),c.a.unLoadingAll()}))}}}}),i)}))},ei=function(){$("[data-remove-elements-list]").find("li:not(.--example)").each((function(){var e=$
1(this);qe(e)}))},ti=function(e){e=null!=e?e:$("body"),$(e).find('[data-quantity="plus"]').each((function(){var e=$(this);e.off("click.plusclick"),e.on("click.plusclick",(function(e){e.preventDefault(),X(this,null,"plus")}))})),$(e).find('[data-quantity="minus"]').each((function(){var e=$(this);e.off("click.minusclick"),e.on("click.minusclick",(function(e){e.preventDefault(),X(this,null,"minus")}))})),$(e).find("[data-change-pagantis]").each((function(){var e=$(this),t=$("#"+$(e).attr("data-change-pagantis")),i=$(t).find("select"),n=0,r=setInterval((function(){n<5e4?(t=$("#"+$(e).attr("data-change-pagantis")),i=$(t).find("select"),t.length>0&&i.length>0?(clearInterval(r),setTimeout((function(){X(e)}))):n+=100):clearInterval(r)}),100)}));var t=$(e).find("[data-pagantis]");t.length>0&&t.each((function(){var e=$(this),t=void 0!==$(e).data("pagantis")&&null!==$(e).data("pagantis")&&""!==$(e).data("pagantis")?window[$(e).data("pagantis")]:window[pagantisOptions];$.ajax({url:"https://api.pagamastarde.com/v1/instalments",data:t,success:function(t){var i,n,r=t.instalments,o={};$.each(r,(function(t,r){var s=c.a.returnNumberWithParams(r.amounts[0]/100,c.a.getCurrencySymbol($(e).attr("data-change-pagantis-currency")),null,null,!0),a=1==t?c.a.tr("instalment_with_amount",s):c.a.tr("instalment_with_amount_plural",s);o[t]=a,i=void 0===i||parseInt(t)<i?parseInt(t):i,n=void 0===n||parseInt(t)>n?parseInt(t):n}));var s=$(e).attr("data-field"),a=parseInt($("input[name="+s+"]").attr("min")),l=parseInt($("input[name="+s+"]").attr("max")),u=parseInt($("input[name="+s+"]").attr("value"));isNaN(a)&&$("input[name="+s+"]").attr("min",i),isNaN(l)&&$("input[name="+s+"]").attr("max",n),isNaN(u)&&$("input[name="+s+"]").attr("value",i),window[$(e).data("change-data")]=o,X(e)},error:function(e,t,i){0!==e.status&&(c.a.isLocal()?console.error(new Error("Ajax error: "+t+", "+i)):console.error(new Error("Ajax error: "+t+", "+i+" || Ajax response: status: "+e.status+" , statusText: "+e.statusText+" , responseText: "+e.responseText)))}})}))},ii=function e(t,i){if(t.length>0){null!=i&&1!=i||void 0!==t[0]&&null!==t[0]&&function(e){if("select"===$(e).prop("tagName").toLowerCase())$(e).select2("open");else if("date"==$(e).attr("type")){var t=$(e).attr("id")+"_pickerInput";$("#"+t).trigger("click")}}(t[0]);var n=t[0];$(t[0]).on("change.inputNotFilledChange",(function(){var i=$(this);if("undefined"!=$(this).val()&&null!=$(this).val()&&$(this).val()!==n&&""!=$(this).val()){t.splice(0,1),$(i).off("change.inputNotFilledChange");var r=0;$(this).is('input[type="date"]')&&(r=600),setTimeout((function(){e(t,!0)}),r)}else $(t).off("change.inputNotFilledChange")}))}},ni=function(e){e=void 0!==e?$(e):$("body");var t=$(e).find('[name="bookingEmail"]');t.length>0&&(t.off("change.changeLoginCards"),t.on("change.changeLoginCards",(function(){var e=$
1(this),t=$("[id^=storedPaymentMethodId-]").closest(".m-super-radio"),i="logedEmailOption"==$(e).attr("id");t.each((function(e,t){var n=$(t).find("[id^=payButton-]"),r=$(t).find(".o-info");i?($(t).removeClass("_with-oi"),$(n).removeClass("--disabled-button --bg"),$(r).addClass("js-hide")):($(t).addClass("_with-oi"),$(n).addClass("--disabled-button --bg"),$(r).removeClass("js-hide"))}))})))},ri=function(e,t){t=void 0!==t?$(t):$("body");var i=$(e).is(":checked"),n=$(t).find('[sameData="'+$(e).attr("id")+'"]');n=n.length>0?n:t;var r=$(n).find("[data-copyinputresult]"),o=$("#tipo_id_fiscal");i?(r.each((function(e,t){Ft(n,$(t)),$(t).removeAttr("data-changed"),$(t).attr("disabled",!0)})),$("#country_fiscal").attr("disabled",!0)):(r.each((function(e,t){$(t).attr("data-changed",!0),$(t).removeAttr("disabled")})),$("#country_fisica").attr("disabled",!1),$("#country_fiscal").attr("disabled","01"===$(o).val()))},oi=function(e){e=void 0!==e?$(e):$("body");var t=$(e).find('input[type="checkbox"].js-sameData');$(t).each((function(){ri(this,e)})),$(t).off("change.activeSameData"),$(t).on("change.activeSameData",(function(){ri(this,e)}))},si=function(e){e=void 0!==e?e:c.a.$("body");var t=$(e).find(".swiper-container");$(t).each((function(e,i){var n=$(i).find(".__left"),r=$(i).find(".__right"),o=function(e){$(e).find('a, button, input, textarea, select, details,[tabindex]:not([tabindex="-1"])').each((function(e,t){$(t).attr("tabindex","-1")}))},s=function(e){$(e).find('[tabindex="-1"]').each((function(e,t){$(t).removeAttr("tabindex")}))},a=$(i).find('[data-go-right="true"]'),l=$(i).find('[data-go-left="true"]');($(a).length>0||$(l).length>0)&&$(a).off("click.goRight"),$(a).on("click.goRight",(function(e){e.preventDefault(),("legend"!=$(this).prop("tagName").toLowerCase()||c.a.isMobile())&&(0===$(this).closest("#page-nav__user").length&&$(this).closest(".swiper-container").addClass("js-shown-form-page"),$(this).closest(".swiper-container").addClass("_right-opened"),s(r),o(n))})),$(l).off("click.goLeft"),$(l).on("click.goLeft",(function(e){e.preventDefault(),("legend"!=$(this).prop("tagName").toLowerCase()||c.a.isMobile())&&(0===$(this).closest("#page-nav__user").length&&$(this).closest(".swiper-container").removeClass("js-shown-form-page"),$(this).closest(".swiper-container").removeClass("_right-opened"),s(n),o(r))})),$(t).hasClass("_right-opened")?(s(r),o(n)):(s(n),o(r))}))},ai=function(e){e=void 0!==e?e:c.a.$("body"),$(e).find('input[type="password"].js-toggle-show-pass:not(._toggle-init)').each((function(e,t){$(t).addClass("_toggle-init");var i="togglePass_"+c.a.generateId(),n=$('<div class="js-toggle-show-pass-elem"><input type="checkbox" id="'+i+'" class="__elem"/><label for="'+i+'" class="__label">Mostrar password</label></div>');$(t).after(n),$(t).parent().addClass("js-toogle-show-pass-wrapper");var r=$("#"+i);$(r).off("change.toogleShowPass"),$(r).on("change.toogleShowPass",(function(){var e=$
1(this),i=$(e).is(":checked");t.type=i?"text":"password"}))}))},li=function(){var e=$('[id^="user-register"]');if($(e).length){var t=$(e).find('[id^="country"]');$(t).on("change.changeCountry"),$(t).on("change.changeCountry",(function(e){var t=$(this).closest("form"),i=$(t).find('[id^="prefix"]');if(null!=i&&i.length>0){var n=$(t).find('[data-prefix-input-name="prefix"]'),r=$($(e.target.selectedOptions)[0]),o=$(r).data("country-code");$(n).length>0&&null!=o&&""!==o||("select"===i[0].tagName.toLowerCase()?($(i).find("option:selected").removeAttr("selected"),$(i).find("option").eq(e.target.selectedIndex).attr("selected",!0)):$(i).val($(e.target).val())),$(t).find('[id^="prefix"]').trigger("change")}}))}},ci=function(e,t){if(0===e.closest("#contactDropdown.o-container-list-contact-us").length){var i=e.find('[data-policy-check="true"]');i.length>0&&setTimeout((function(){i.hasClass("parsley-error")||i.parents(".parsley-error").length>0||!i.is(":checked")?je(t,i,"policy-check"):Ve(t,i,"policy-check")}),500)}}},,function(e,t,i){(function(t){var i=/^\s+|\s+$/g,n=/^[-+]0x[0-9a-f]+$/i,r=/^0b[01]+$/i,o=/^0o[0-7]+$/i,s=parseInt,a="object"==typeof t&&t&&t.Object===Object&&t,l="object"==typeof self&&self&&self.Object===Object&&self,c=a||l||Function("return this")(),u=Object.prototype.toString,d=Math.max,f=Math.min,h=function(){return c.Date.now()};function p(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function v(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==u.call(e)}(e))return NaN;if(p(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=p(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(i,"");var a=r.test(e);return a||o.test(e)?s(e.slice(2),a?2:8):n.test(e)?NaN:+e}e.exports=function(e,t,i){var n,r,o,s,a,l,c=0,u=!1,g=!1,m=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function _(t){var i=n,o=r;return n=r=void 0,c=t,s=e.apply(o,i)}function y(e){return c=e,a=setTimeout(E,t),u?_(e):s}function b(e){var i=e-l;return void 0===l||i>=t||i<0||g&&e-c>=o}function E(){var e=h();if(b(e))return w(e);a=setTimeout(E,function(e){var i=t-(e-l);return g?f(i,o-(e-c)):i}(e))}function w(e){return a=void 0,m&&n?_(e):(n=r=void 0,s)}function I(){var e=h(),i=b(e);if(n=arguments,r=this,l=e,i){if(void 0===a)return y(l);if(g)return a=setTimeout(E,t),_(l)}return void 0===a&&(a=setTimeout(E,t)),s}return t=v(t)||0,p(i)&&(u=!!i.leading,o=(g="maxWait"in i)?d(v(i.maxWait)||0,t):o,m="trailing"in i?!!i.trailing:m),I.cancel=function(){void 0!==a&&clearTimeout(a),c=0,n=l=r=a=void 0},I.flush=function(){return void 0===a?s:w(h())},I}}).call(this,i(88))},,,,,,,,function(e,t,i){"use strict";i.d(t,"a",(function(){return r}));function n(e){return Boolean(e)&&"function"==typeof e.getUserConsentStatusForVendor&&!0===e.getUserConsentStatusForVendor("256")}function r(){var e=window.Didomi;return Boolean(e)&&n(e)}},,,,,,,,,,function(e,t,i){"use strict";i.d(t,"a",(function(){return u})),i.d(t,"d",(function(){return d})),i.d(t,"c",(function(){return f})),i.d(t,"b",(function(){return h}));var n=i(69),r=i(62),o=i(0);function s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var n,r,o,s,a=[],l=!0,c=!1;try{if(o=(i=i.call(e)).next,0===t){if(Object(i)!==i)return;l=!1}else for(;!(l=(n=o.call(i)).done)&&(a.push(n.value),a.length!==t);l=!0);}catch(e){c=!0,r=e}finally{try{if(!l&&null!=i.return&&(s=i.return(),Object(s)!==s))return}finally{if(c)throw r}}return a}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return a(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);"Object"===i&&e.constructor&&(i=e.constructor.name);if("Map"===i||"Set"===i)return Array.from(e);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return a(e,t)}(e,t)||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 a(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}var l=function(){var e=function(){var e=o.a.readCookie("optimizelyUserId");return e?e.replace(/^["']|["']$/g,""):null}();if(e)return e;var t=o.a.getRandomString(9);return function(e){o.a.createCookie("optimizelyUserId",e,151)}(t),t}
vendor: 4,922 bytes, line 1
1,c=function(){return r.a?(Object(n.setLogger)(null),r.a.createUserContext(l())):null},u=function(e){var t=c();return!!t&&t.decide(e)},d=function(e){var t=c();t&&Object.entries(e).forEach((function(e){var i=s(e,2),n=i[0],r=i[1];t.setAttribute(n,r)}))},f=function(e,t){var i=c();i&&i.trackEvent(e,t)},h=function(e){var t=u(e);t&&window.dataLayer.push({event:"optimizely-decision","optimizely-flagKey":t.flagKey,"optimizely-ruleKey":t.ruleKey,"optimizely-variationKey":t.variationKey})}},,,,,,function(e,t,i){"use strict";const n="u">typeof window?window:void 0,r="u">typeof globalThis?globalThis:n,o=null==r?void 0:r.navigator,s=null==r?void 0:r.document,a=null==r?void 0:r.location,l=null==r?void 0:r.fetch,c=(null==r?void 0:r.XMLHttpRequest)&&"withCredentials"in new r.XMLHttpRequest?r.XMLHttpRequest:void 0,u=null==r?void 0:r.AbortController,d=null==r?void 0:r.CompressionStream,f=null==o?void 0:o.userAgent;function h(){return!(!n||!1===n.navigator.onLine)}const p="undefined"!=typeof globalThis?globalThis:n;p&&"undefined"==typeof self&&(p.self=p),p&&"undefined"==typeof File&&(p.File=function(){});const v=null!=n?n:{},g="0.8.3",m={DEBUG:!1,LIB_VERSION:g,LIB_NAME:"browser-common",JS_SDK_VERSION:g};var _=function(e){return e.AnonymousId="anonymous_id",e.DistinctId="distinct_id",e.Props="props",e.EnablePersonProcessing="enable_person_processing",e.PersonMode="person_mode",e.FeatureFlagDetails="feature_flag_details",e.FeatureFlags="feature_flags",e.FeatureFlagPayloads="feature_flag_payloads",e.BootstrapFeatureFlagDetails="bootstrap_feature_flag_details",e.BootstrapFeatureFlags="bootstrap_feature_flags",e.BootstrapFeatureFlagPayloads="bootstrap_feature_flag_payloads",e.OverrideFeatureFlags="override_feature_flags",e.Queue="queue",e.AiQueue="ai_queue",e.AiCaptureQueue="ai_capture_queue",e.LogsQueue="logs_queue",e.OptedOut="opted_out",e.SessionId="session_id",e.SessionStartTimestamp="session_start_timestamp",e.SessionLastTimestamp="session_timestamp",e.PersonProperties="person_properties",e.GroupProperties="group_properties",e.InstalledAppBuild="installed_app_build",e.InstalledAppVersion="installed_app_version",e.SessionReplay="session_replay",e.PushRegistered="push_registered",e.SessionReplayEventTriggerActivatedSession="session_replay_event_trigger_activated_session",e.SurveyLastSeenDate="survey_last_seen_date",e.SurveysSeen="surveys_seen",e.Surveys="surveys",e.RemoteConfig="remote_config",e.FlagsEndpointWasHit="flags_endpoint_was_hit",e.DeviceId="device_id",e}({}),y=function(e){return e.GZipJS="gzip-js",e.Base64="base64",e}({});const b=["$snapshot","$pageview","$pageleave","$set","survey dismissed","survey sent","survey shown","$identify","$groupidentify","$create_alias","$$client_ingestion_warning","$web_experiment_applied","$feature_enrollment_update","$feature_flag_called"],E=["token"];function w(e,t){return-1!==e.indexOf(t)}const I=function(e){return e.trim()},O=function(e){return e.replace(/^\$/,"")};function S(e){var t;const i=[];return null!==(t=JSON.stringify(e,(function(e,t){if("bigint"==typeof t)return t.toString();if("function"!=typeof t&&"symbol"!=typeof t){if(t instanceof Error)return{name:t.name,message:t.message,stack:t.stack};if(t&&"object"==typeof t){for(;i.length>0&&i[i.length-1]!==this;)i.pop();if(i.includes(t))return"[Circular]";i.push(t)}return t}})))&&void 0!==t?t:"null"}const A=Object.prototype,C=A.hasOwnProperty,$=A.toString,T=Array.isArray||function(e){return"[object Array]"===$.call(e)},P=e=>"function"==typeof e,k=e=>e===Object(e)&&!T(e),x=e=>{if(k(e)){for(const t in e)if(C.call(e,t))return!1;return!0}return!1},R=e=>void 0===e,D=e=>"[object String]"==$.call(e),N=e=>D(e)&&0===e.trim().length,L=e=>null===e,M=e=>R(e)||L(e),U=e=>"[object Number]"==$.call(e)&&e==e,F=e=>U(e)&&e>0,j=e=>"[object Boolean]"===$.call(e),V=e=>w(b,e),B=e=>w(E,e);function G(e){return null===e||"object"!=typeof e}function q(e,t){return{}.toString.call(e)===`[object ${t}]`}function H(e){switch({}.toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":case"[object WebAssembly.Exception]":return!0;default:return K(e,Error)}}function z(e){return"u">typeof Event&&K(e,Event)}function K(e,t){try{return e instanceof t}catch(e){return!1}}const W=[!0,"true",1,"1","yes"],Y=e=>w(W,e),J=[!1,"false",0,"0","no"];function X(e,t,i,n,r,o,s){try{var a=e[o](s),l=a.value}catch(e){return void i(e)}a.done?t(l):Promise.resolve(l).then(n,r)}function Z(e){return function(){var t=this,i=arguments;return new Promise((function(n,r){var o=e.apply(t,i);function s(e){X(o,n,r,s,a,"next",e)}function a(e){X(o,n,r,s,a,"throw",e)}s(void 0)}))}}const Q=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hub
1spot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterestbot","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],ee=function(e,t=[]){if(!e)return!1;const i=e.toLowerCase();return Q.concat(t).some(e=>{const t=e.toLowerCase();return-1!==i.indexOf(t)})};function te(e,t,i,n,r){return t>i&&(n.warn("min cannot be greater than max."),t=i),U(e)?e>i?(n.warn(" cannot be greater than max: "+i+". Using max value instead."),i):t>e?(n.warn(" cannot be less than min: "+t+". Using min value instead."),t):e:(n.warn(" must be a number. using max or fallback. max: "+i+", fallback: "+r),te(null!=r?r:i,t,i,n))}const ie="Mobile",ne="Android",re="Tablet",oe="Android Tablet",se="Apple Watch",ae="Safari",le="BlackBerry",ce="Samsung Internet",ue="Chrome",de="Chrome iOS",fe="Internet Explorer",he="Internet Explorer Mobile",pe="Microsoft Edge",ve="Firefox",ge="Firefox iOS",me="Nintendo",_e="PlayStation",ye="Xbox",be="Android Mobile",Ee="Mobile Safari",we="Windows",Ie="Windows Phone",Oe="Ouya",Se="Generic "+ie.toLowerCase(),Ae="Generic "+re.toLowerCase(),Ce="Konqueror",$e="Oculus Browser",Te="Vivaldi",Pe="DuckDuckGo",ke="Pale Moon",xe="Waterfox",Re="Brave",De="ChatGPT",Ne="Google Search App",Le=new RegExp("Version/(\\d+(\\.\\d+)?)"),Me=new RegExp("(Claude|Codex|ChatGPT)\\/(\\d+(\\.\\d+)?)"),Ue=new RegExp(ye,"i"),Fe=new RegExp("PlayStation \\w+","i"),je=new RegExp("Nintendo \\w+","i"),Ve=new RegExp("BlackBerry|PlayBook|BB10","i"),Be={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"},Ge=function(e,t,i,n){return t=t||"",function(e){return(null==e?void 0:e.brave)?Re:null}(i)||((null==n?void 0:n.detectGoogleSearchApp)&&w(e,"GSA/")?Ne:w(e," OPR/")&&w(e,"Mini")?"Opera Mini":w(e," OPR/")?"Opera":Ve.test(e)?le:w(e,"IEMobile")||w(e,"WPDesktop")?he:w(e,"OculusBrowser")?$e:w(e,"SamsungBrowser")?ce:w(e,"Edge")||w(e,"Edg/")?pe:w(e,"Vivaldi/")?Te:w(e,"YaBrowser/")?"Yandex":w(e,"Whale/")?"Whale":w(e,"DuckDuckGo/")||w(e,"Ddg/")?Pe:w(e,"Claude/")?"Claude":w(e,"Codex/")?"Codex":w(e,"ChatGPT/")?De:w(e,"FBIOS")?"Facebook Mobile":w(e,"UCWEB")||w(e,"UCBrowser")?"UC Browser":w(e,"CriOS")?de:w(e,"CrMo")||w(e,ue)?ue:w(e,ne)&&w(e,ae)?be:w(e,"FxiOS")?ge:w(e.toLowerCase(),Ce.toLowerCase())?Ce:w(e,"Brave/")?Re:((e,t)=>t&&w(t,"Apple")||function(e){return w(e,ae)&&!w(e,ue)&&!w(e,ne)}(e))(e,t)?w(e,ie)?Ee:ae:w(e,"PaleMoon/")?ke:w(e,"Waterfox/")?xe:w(e,ve)?ve:w(e,"MSIE")||w(e,"Trident/")?fe:w(e,"Gecko")?ve:"")},qe={[he]:[new RegExp("rv:(\\d+(\\.\\d+)?)")],[pe]:[new RegExp("Edge?\\/(\\d+(\\.\\d+)?)")],[ue]:[new RegExp("(Chrome|CrMo)\\/(\\d+(\\.\\d+)?)")],[de]:[new RegExp("CriOS\\/(\\d+(\\.\\d+)?)")],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/(\\d+(\\.\\d+)?)")],[ae]:[Le],[Ee]:[Le],Opera:[new RegExp("(Opera|OPR)\\/(\\d+(\\.\\d+)?)")],[ve]:[new RegExp("Firefox\\/(\\d+(\\.\\d+)?)")],[ge]:[new RegExp("FxiOS\\/(\\d+(\\.\\d+)?)")],[Ce]:[new RegExp("Konqueror[:/]?(\\d+(\\.\\d+)?)","i")],[le]:[new RegExp("BlackBerry (\\d+(\\.\\d+)?)"),Le],[be]:[new RegExp("android\\s(\\d+(\\.\\d+)?)","i")],[ce]:[new RegExp("SamsungBrowser\\/(\\d+(\\.\\d+)?)")],[$e]:[new RegExp("OculusBrowser\\/(\\d+(\\.\\d+)?)")],[Te]:[new RegExp("Vivaldi\\/(\\d+(\\.\\d+)?)")],Yandex:[new RegExp("YaBrowser\\/(\\d+(\\.\\d+)?)")],Whale:[new RegExp("Whale\\/(\\d+(\\.\\d+)?)")],[Re]:[new RegExp("Brave\\/(\\d+(\\.\\d+)?)")],Claude:[Me],Codex:[Me],[De]:[Me],[Pe]:[new RegExp("(DuckDuckGo|Ddg)\\/(\\d+(\\.\\d+)?)")],[ke]:[new RegExp("PaleMoon\\/(\\d+(\\.\\d+)?)")],[xe]:[new RegExp("Waterfox\\/(\\d+(\\.\\d+)?)")],[Ne]:[new RegExp("GSA\\/(\\d+(\\.\\d+)?)")],[fe]:[new RegExp("(rv:|MSIE )(\\d+(\\.\\d+)?)")],Mozilla:[new RegExp("rv:(\\d+(\\.\\d+)?)")]},He=function(e,t,i,n){const r=Ge(e,t,i,n),o=qe[r];if(R(o))return null;for(let t=0;o.length>t;t++){const i=e.match(o[t]);if(i)return parseFloat(i[i.length-2])}return null},ze=[[new RegExp("Xbox; Xbox (.*?)[);]","i"),e=>[ye,e&&e[1]||""]],[new RegExp(me,"i"),[me,""]],[new RegExp(_e,"i"),[_e,""]],[Ve,[le,""]],[new RegExp(we,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[Ie,""];if(new RegExp(ie).test(t)&&!/IEMobile\b/.test(t))return["Windows Mobile",""];const i=/Windows NT ([0-9.]+)/i.exec(t);if(i&&i[1]){let e=Be[i[1]]||"";return/arm/i.test(t)&&(e="RT"),[we,e]}return[we,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>e&&e[3]?["iOS",[e[3],e[4],e[5]||"0"].join(".")]:["iOS",""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{let t="";return e&&e.length>=3&&(t=R(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("(Android (\\d+)\\.(\\d+)\\.?(\\d+)?|Android)","i"),e=>e&&e[2]?[ne,[e[2],e[3],e[4]||"0"].join(".")]:[ne,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{const t=["Mac OS X",""];return e&&e[1]&&(t[1]=[e[1],e[2],e[3]||"0"].join(".")),t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,["Chrome OS",""]],[/Linux|debian/i,["Linux",""]]],Ke=function(e){for(let t=0;ze.length>t;t++){const[i,n]=ze[t],r=i.exec(e),o=r&&(P(n)?n(r,e):n);if(o)return o}return["",""]},We=function(e){return je.test(e)?me:Fe.test(e)?_e:Ue.test(e)?ye:new RegExp(Oe,"i").test(e)?Oe:new RegExp("(Windows Phone|WPDesktop)","i").test(e)?Ie:/iPad/.test(e)?"iPad":/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?se:Ve.test(e)?le:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp("Nokia","i").test(e)?"Nokia":/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?"Kindle Fire":/(Android|ZTE)/i.test(e)?new RegExp(ie).test(e)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)||/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?ne:oe:new RegExp("(pda|Mobile)","i").test(e)?Se:new RegExp(re,"i").test(e)&&!new RegExp("Tablet pc","i").test(e)?Ae:""},Ye=function(e,t){var i;const n=We(e);return"iPad"===n||n===oe||"Kobo"===n||"Kindle Fire"===n||n===Ae?re:n===me||n===ye||n===_e||n===Oe?"Console":n===se?"Wearable":n?ie:"Android"===(null==t?void 0:t.userAgentDataPlatform)&&(null!==(i=null==t?void 0:t.maxTouchPoints)&&void 0!==i?i:0)>0?600>Math.min(null!==(r=null==t?void 0:t.screenWidth)&&void 0!==r?r:0,null!==(o=null==t?void 0:t.screenHeight)&&void 0!==o?o:0)/(null!==(s=null==t?void 0:t.devicePixelRatio)&&void 0!==s?s:1)?ie:re:"Desktop";var r,o,s}
vendor: 4,280 bytes, line 1
1,Je=/\bFBAV\/(\d+(?:\.\d+)*)/i,Xe=[[/\bInstagram(?:[ /](\d+(?:\.\d+)*))?\b/i,"Instagram"],[/\bBarcelona[ /](\d+(?:\.\d+)*)?/i,"Threads"],[/\b(?:MessengerForiOS|(?:FBAN|FB_IAB)\/Orca-Android)\b/i,"Messenger",Je],[/\bFBAN\/EMA\b/i,"Facebook Lite",Je],[/\b(?:FBIOS|(?:FBAN|FB_IAB)\/(?:FB4A|FBIOS))\b/i,"Facebook",Je],[/\bLinkedInApp(?:\]?\/(\d+(?:\.\d+)*))?\b/i,"LinkedIn"],[/\bTwitter(?:Android| for (?:iPhone|iPad|Android))(?:\/(\d+(?:\.\d+)*))?\b/i,"Twitter"],[/\b(?:musical_ly|trill)(?:[_/](\d+\.\d+(?:\.\d+)*))?(?=\b|_)/i,"TikTok",/\bapp_version\/(\d+(?:\.\d+)*)/i],[/\b(?:MicroMessenger|WeChat)\/(\d+(?:\.\d+)*)?/i,"WeChat"],[/\bLine\/(\d+(?:\.\d+)*)?/i,"Line"],[/\bGSA\/(\d+(?:\.\d+)*)?/i,"Google"],[/\[Pinterest\/(?:iOS|Android)\b|\bPinterest(?: for (?:Android(?: Tablet)?|iOS))?\/(\d+(?:\.\d+)*)/i,"Pinterest"],[/\b(?:WA4A|WAiOS)\/(\d+(?:\.\d+)*)?/i,"WhatsApp"],[/\bSnapchat[ /](\d+(?:\.\d+)*)?/i,"Snapchat"],[/\bBing(?:Web|Sapphire)\/(\d+(?:\.\d+)*)?/i,"Bing"],[/\bNAVER\(inapp; search;/i,"Naver",/\bNAVER\(inapp; search;[^;)]*; (\d+(?:\.\d+)*)/i],[/\bKAKAOTALK[ /](\d+\.\d+(?:\.\d+)*)?/i,"KakaoTalk"]],Ze="[Truncated]",Qe="[Unserializable]";function et(e){let t="";for(let i=0;e.length>i;i++){const n=e.charCodeAt(i);if(55296>n||n>56319)t+=56320>n||n>57343?e[i]:"�";else{const n=e.charCodeAt(i+1);56320>n||n>57343?t+="�":(t+=e[i]+e[i+1],i++)}}return t}function tt(e,t){if(!t)return e;let i=[];try{i=Object.keys(t)}catch(e){i=[]}for(const n of i){let i;try{i=t[n]}catch(e){i=Qe}Object.defineProperty(e,n,{value:i,enumerable:!0,writable:!0,configurable:!0})}return e}Date,Date;const it=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function nt(e,t){return"string"==typeof(i=e)&&it.test(i)?e:t();var i}function rt(e,t){const i=new Error(t);try{Object.defineProperty(i,"name",{value:e,writable:!0,enumerable:!0,configurable:!0})}catch(e){}return i}function ot(e){return e?e.split("#")[0]:e}function st(e){try{return e()}catch(e){return}}function at(e,t){const i=setTimeout(e,t);return null!=i&&i.unref&&(null==i||i.unref()),i}function lt(e,t,i){return ct.apply(this,arguments)}function ct(){return(ct=Z((function*(e,t,i){let n;try{return yield Promise.race([e,new Promise((e,r)=>{n=at(()=>{try{null==i||i(),e()}catch(e){r(e)}},t)})])}finally{clearTimeout(n)}}))).apply(this,arguments)}let ut,dt,ft;function ht(e){const t=globalThis._posthogChunkIds;if(!t)return;const i=Object.keys(t);return ft&&i.length===dt||(dt=i.length,ft=i.reduce((i,n)=>{ut||(ut={});const r=ut[n];if(r)i[r[0]]=r[1];else{const r=e(n);for(let e=r.length-1;e>=0;e--){const o=r[e],s=null==o?void 0:o.filename,a=t[n];if(s&&a){i[s]=a,ut[n]=[s,a];break}}}return i},{})),ft}function pt(e){return(pt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function vt(e,t,i){return(t=function(e){var t=function(e){if("object"!=pt(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=pt(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==pt(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function gt(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function mt(e){for(var t=1;arguments.length>t;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?gt(Object(i),!0).forEach((function(t){vt(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):gt(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}const _t=/^([a-z][a-z0-9.+-]+):/i,yt=["http","https","file","blob","app","capacitor","ionic","webpack","webpack-internal","ng"];function bt(e){if(!e||"<anonymous>"===e)return!1;const t=_t.exec(e);return!t||yt.includes(t[1].toLowerCase())}function Et(e,t,i,n,r){const o={platform:e,filename:t,function:"<anonymous>"===i?"?":i,in_app:bt(t)};return R(n)||(o.lineno=n),R(r)||(o.colno=r),o}const wt=(e,t)=>
vendor: 5,913 bytes, line 1
1{const i=-1!==e.indexOf("safari-extension"),n=-1!==e.indexOf("safari-web-extension");return i||n?[-1!==e.indexOf("@")?e.split("@")[0]:"?",i?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},It=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Ot=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,St=/\((\S*)(?::(\d+))(?::(\d+))\)/,At=(e,t)=>{const i=It.exec(e);if(i){const[,e,n,r]=i;return Et(t,e,"?",+n,+r)}const n=Ot.exec(e);if(n){if(n[2]&&0===n[2].indexOf("eval")){const e=St.exec(n[2]);e&&(n[2]=e[1],n[3]=e[2],n[4]=e[3])}const[e,i]=wt(n[1]||"?",n[2]);return Et(t,i,e,n[3]?+n[3]:void 0,n[4]?+n[4]:void 0)}},Ct=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,$t=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Tt=(e,t)=>{const i=Ct.exec(e);if(i){if(i[3]&&i[3].indexOf(" > eval")>-1){const e=$t.exec(i[3]);e&&(i[1]=i[1]||"eval",i[3]=e[1],i[4]=e[2],i[5]="")}let e=i[3],n=i[1]||"?";return[n,e]=wt(n,e),Et(t,e,n,i[4]?+i[4]:void 0,i[5]?+i[5]:void 0)}},Pt=/\(error: (.*)\)/;function kt(e,t){return e.filename===t.filename&&e.function===t.function&&e.module===t.module&&e.lineno===t.lineno&&e.colno===t.colno}function xt(e){for(let t=1;10>=t;t++){const i=e.length-2*t;if(0>i)break;let n=!0;for(let r=0;t>r;r++)if(!kt(e[i+r],e[i+t+r])){n=!1;break}if(n){for(let n=0;t>n;n++)e[i+n]=e[i+t+n];return e.length=i+t,{start:i,length:t}}}}function Rt(e,t){const i=t.start+t.length,n=Nt(e,t);n&&e.splice(i+n===e.length?i:t.start,n)}function Dt(e,t){let i=t.start;for(;i>0&&kt(e[i-1],e[i-1+t.length]);)i--;return t.start-i}function Nt(e,t){const i=t.start+t.length;let n=i;for(;e.length>n&&kt(e[n],e[n-t.length]);)n++;return n-i}function Lt(e,t){const i=t[0];let n=e.length-(i?Dt(e,i):0);for(const i of t)n-=Nt(e,i);return n}function Mt(e,t,i){for(let n=0;e.length>n;n++){const r=e[(t+n)%e.length],o=e[(i+n)%e.length];if(r!==o)return o>r}return!1}var Ut=class{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,t){const i=D(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:i?e.stack:void 0,cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?"DOMError":"DOMException"}getValue(e){const t=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?`${t}: ${e.message}`:t}isDOMException(e){return q(e,"DOMException")}isDOMError(e){return q(e,"DOMError")}},Ft=class{match(e){return H(e)}coerce(e,t){var i;const n=this.getStack(e),r=void 0===n;return{type:this.getType(e),value:this.getMessage(e,t),stack:null!=n?n:null===(i=t.syntheticException)||void 0===i?void 0:i.stack,cause:e.cause?t.next(e.cause):void 0,synthetic:r}}getType(e){return e.name||e.constructor.name}getMessage(e,t){const i=e.message;return String(i.error&&"string"==typeof i.error.message?i.error.message:i)}getStack(e){return e.stacktrace||e.stack||void 0}},jt=class{match(e){return!!q(e,"ErrorEvent")&&(null!=e.error||this.lr(e))}coerce(e,t){var i;if(null!=e.error)return t.apply(e.error);const n=t.apply(e.message);return mt(mt({},n),{},{stack:null!==(i=this.ur(e))&&void 0!==i?i:n.stack,synthetic:!0})}lr(e){return D(e.message)&&e.message.length>0}ur(e){var t,i;const n=e,r=null!==(t=n.lineno)&&void 0!==t?t:0,o=null!==(i=n.colno)&&void 0!==i?i:0;if(D(n.filename)&&0!==n.filename.length&&0!==r)return`Error\n at ${n.filename}:${r}:${o}`}};const Vt=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;var Bt=class{match(e){return"string"==typeof e}coerce(e,t){var i;const[n,r]=this.getInfos(e);return{type:null!=n?n:"Error",value:null!=r?r:e,stack:null===(i=t.syntheticException)||void 0===i?void 0:i.stack,synthetic:!0}}getInfos(e){let t="Error",i=e;const n=e.match(Vt);return n&&(t=n[1],i=n[2]),[t,i]}};const Gt=["fatal","error","warning","log","info","debug"];function qt(e,t=40){const i=Object.keys(e);if(i.sort(),!i.length)return"[object has no keys]";for(let e=i.length;e>0;e--){const n=i.slice(0,e).join(", ");if(t>=n.length)return e===i.length?n:n.length>t?`${n.slice(0,t)}...`:n}return""}var Ht=class{match(e){return"object"==typeof e&&null!==e}coerce(e,t){var i,n;const r=this.getErrorPropertyFromObject(e);return r?t.apply(r):{type:this.getType(e),value:this.getValue(e),stack:null!==(i=this.getStack(e))&&void 0!==i?i:null===(n=t.syntheticException)||void 0===n?void 0:n.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){if(z(e))return e.constructor.name;const t="name"in e?e.name:void 0;return D(t)&&!N(t)?t:"Error"}getValue(e){if("name"in e&&"string"==typeof e.name){let t=`'${e.name}' captured as exception`;return"message"in e&&"string"==typeof e.message&&(t+=` with message: '${e.message}'`),t}if("message"in e&&"string"==typeof e.message)return e.message;const t=this.getObjectClassName(e);return`${t&&"Object"!==t?`'${t}'`:"Object"} captured as exception with keys: ${qt(e)}`}isSeverityLevel(e){return D(e)&&!N(e)&&Gt.indexOf(e)>=0}getStack(e){try{return D(e.stacktrace)&&e.stacktrace.length>0?e.stacktrace:D(e.stack)&&e.stack.length>0?e.stack:void 0}catch(e){return}}getErrorPropertyFromObject(e){for(const t in e)if({}.hasOwnProperty.call(e,t)){const i=e[t];if(H(i))return i}}getObjectClassName(e){try{const t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(e){return}}},zt=class{match(e){return z(e)}coerce(e,t){var i;const n=e.constructor.name;return{type:n,value:`${n} captured as exception with keys: ${qt(e)}`,stack:null===(i=t.syntheticException)||void 0===i?void 0:i.stack,synthetic:!0}}},Kt=class{match(e){return G(e)}coerce(e,t){var i;return{type:"Error",value:`Primitive value captured as exception: ${String(e)}`,stack:null===(i=t.syntheticException)||void 0===i?void 0:i.stack,synthetic:!0}}},Wt=class{match(e){return q(e,"PromiseRejectionEvent")||this.isCu
vendor: 4,205 bytes, line 1
1stomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!z(e))return!1;try{const t=e.detail;return null!=t&&"object"==typeof t&&"reason"in t}catch(e){return!1}}coerce(e,t){var i;const n=this.getUnhandledRejectionReason(e);return G(n)?{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(n)}`,stack:null===(i=t.syntheticException)||void 0===i?void 0:i.stack,synthetic:!0}:t.apply(n)}getUnhandledRejectionReason(e){try{if("reason"in e)return e.reason;if("detail"in e&&null!=e.detail&&"object"==typeof e.detail&&"reason"in e.detail)return e.detail.reason}catch(e){}return e}};const Yt="$message",Jt="$timestamp",Xt=new Set([Yt,Jt]),Zt={enabled:!0,max_bytes:32768};function Qt(e){var t;return e?{enabled:null!==(t=e.enabled)&&void 0!==t?t:Zt.enabled,max_bytes:ei(e.max_bytes,Zt.max_bytes)}:mt({},Zt)}function ei(e,t){if(!U(e)||1/0===e||-1/0===e)return t;const i=Math.floor(e);return 0>i?t:i}const ti=e=>{if("string"!=typeof e)return e;try{return JSON.parse(e)}catch(t){return e}};function ii(e){return"string"==typeof e||e}function ni(e){return"string"==typeof e?e:void 0}const ri=["$feature_flag","$feature_flag_response","$feature_flag_has_experiment","$feature_flag_id","$feature_flag_version","$feature_flag_reason","$feature_flag_request_id","$feature_flag_evaluated_at","$feature_flag_error","locally_evaluated","$groups","$process_person_profile","$geoip_disable","$current_url","$pathname","$referring_domain","utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid","gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx","$session_id","$window_id","$lib","$lib_version","$device_id","$is_server"],oi="NativeGzipValidationError",si=e=>e.length>=2&&31===e[0]&&139===e[1],ai=(e,t)=>e===y.GZipJS||t===y.GZipJS||"gzip"===t,li=e=>!(!e||"object"!=typeof e)&&"NotReadableError"===("name"in e?String(e.name):"");let ci;const ui=e=>{throw rt(oi,`Native gzip produced invalid output: ${e}`)},di=(fi=Z((function*(e,t){18>e.size&&ui("too-short");const i=new Uint8Array(yield e.slice(0,10).arrayBuffer());si(i)&&8===i[2]||ui("invalid-header");const n=new DataView(yield e.slice(e.size-8).arrayBuffer());n.getUint32(0,!0)!==(e=>{const t=(()=>{if(ci)return ci;ci=[];for(let e=0;256>e;e++){let t=e;for(let e=0;8>e;e++)t=1&t?3988292384^t>>>1:t>>>1;ci[e]=t>>>0}return ci})();let i=4294967295;for(let n=0;e.length>n;n++)i=t[255&(i^e[n])]^i>>>8;return(4294967295^i)>>>0})(t)&&ui("invalid-crc");const r=t.length>>>0;n.getUint32(4,!0)!==r&&ui("invalid-size")})),function(e,t){return fi.apply(this,arguments)});var fi;function hi(){return(hi=Z((function*(e,t=!0,i){try{const t=(new TextEncoder).encode(e),i=new globalThis.CompressionStream("gzip"),r=i.writable.getWriter(),o=r.write(t).then(()=>r.close()).catch((n=Z((function*(e){try{yield r.abort(e)}catch(e){}throw e})),function(e){return n.apply(this,arguments)})),s=new Response(i.readable).blob(),[a]=yield Promise.all([s,o]);return yield di(a,t),a}catch(e){if(null==i?void 0:i.rethrow)throw e;return t&&console.error("Failed to gzip compress data",e),null}var n}))).apply(this,arguments)}var pi=class{record(e){if("too-large"===e.kind)return;if("retry-later"!==e.kind)return void this.reset();if(!e.retryAfterMs)return;const t=this.isOpen(),i=Date.now(),n=Math.min(e.retryAfterMs,3e5);if(!t)return this.ss=i,void(this.rs=i+n);this.rs=Math.max(this.rs,Math.min(i+n,this.ss+3e5))}remainingMs(){const e=Date.now();if(this.ss-5e3>e)return this.reset(),0;const t=Math.min(3e5,Math.max(0,this.rs-e));return 0===t&&this.reset(),t}isOpen(){return this.remainingMs()>0}reset(){this.rs=0,this.ss=0}constructor(){this.rs=0,this.ss=0}};function vi(e,t){if(null==e)return{};var i,n,r=function(e,t){if(null==e)return{};var i={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;i[n]=e[n]}return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;o.length>n;n++)t.includes(i=o[n])||{}.propertyIsEnumerable.call(e,i)&&(r[i]=e[i])}return r}const gi={}.propertyIsEnumerable;function mi(e,t){try{return bi(e,t,{ancestors:new WeakSet,remainingNodes:1e4}
vendor: 7,606 bytes, line 1
1,0)}catch(e){return[]}}function _i(e,t,i,n){if(0>=i.remainingNodes)return{stringValue:Ze};if(i.remainingNodes--,j(e))return{boolValue:e};if("bigint"==typeof e)return function(e,t){const i=e.toString(),n=BigInt("9223372036854775808");return e>=n||-n>e?(null==t||t.debug(`Attribute ${i} is outside the int64 range; encoding it as a string`),{stringValue:i}):{intValue:i}}(e,t);if("number"==typeof e){if(!Number.isFinite(e))return{stringValue:String(e)};if(Number.isInteger(e)){if(Number.isSafeInteger(e))return{intValue:String(e)};if(typeof BigInt>"u")return{stringValue:String(e)};const i=BigInt(e).toString();return e>=0x8000000000000000||-0x8000000000000000>e?(null==t||t.debug(`Attribute ${i} is outside the int64 range; encoding it as a string`),{stringValue:i}):{intValue:i}}return{doubleValue:e}}if("string"==typeof e)return{stringValue:et(e)};if("function"==typeof e)return{stringValue:"[Function]"};if("symbol"==typeof e)return{stringValue:String(e)};if("object"==typeof e&&null!==e){if(i.ancestors.has(e))return{stringValue:"[Circular]"};if(n>=20)return{stringValue:Ze};if(e instanceof Date){const t=e.getTime(),i=Number.isFinite(t)?e.toISOString():String(e);return{stringValue:"string"==typeof i?et(i):String(i)}}i.ancestors.add(e);try{try{const r=e.toJSON;if("function"==typeof r)return _i(r.call(e),t,i,n+1)}catch(e){}return T(e)?{arrayValue:{values:yi(e,t,i,n+1)}}:{kvlistValue:{values:bi(e,t,i,n+1)}}}finally{i.ancestors.delete(e)}}return{stringValue:et(String(e))}}function yi(e,t,i,n){const r=[],o=Math.min(e.length,1e3);let s=0;for(;o>s&&i.remainingNodes>0;s++)try{const o=s in e?e[s]:void 0;if(M(o))continue;r.push(_i(o,t,i,n))}catch(e){r.push({stringValue:Qe})}return e.length>s&&r.push({stringValue:Ze}),r}function bi(e,t,i,n){const r=[];for(const o in e)if(gi.call(e,o)){if(!o){null==t||t.debug("Dropping an attribute with an empty key");continue}if(r.length>=1e3||0>=i.remainingNodes){null==t||t.debug("Attributes truncated: the value exceeds the OTLP encoder budget");break}try{const s=e[o];if(L(s)||R(s))continue;r.push({key:et(o),value:_i(s,t,i,n)})}catch(e){r.push({key:et(o),value:{stringValue:Qe}})}}return r}function Ei(e,t,i){return mt(mt(mt(mt({},tt({},e.resourceAttributes)),{},{"service.name":e.serviceName||"unknown_service"},e.environment&&{"deployment.environment":e.environment}),e.serviceVersion&&{"service.version":e.serviceVersion}),{},{"telemetry.sdk.name":t,"telemetry.sdk.version":i})}const wi=["service.name","deployment.environment","service.version","telemetry.sdk.name","telemetry.sdk.version"];function Ii(e,t){const i=tt({},e),n={};for(const e of wi)({}).hasOwnProperty.call(i,e)&&(n[e]=i[e],delete i[e]);return[...mi(i,t),...mi(n,t)]}const Oi={darwin:"macOS",win32:"Windows",cygwin:"Windows",linux:"Linux",android:"Android",freebsd:"FreeBSD",openbsd:"OpenBSD",netbsd:"NetBSD",sunos:"SunOS",aix:"AIX",haiku:"Haiku","Mac OS X":"macOS"},Si={trace:{text:"TRACE",number:1},debug:{text:"DEBUG",number:5},info:{text:"INFO",number:9},warn:{text:"WARN",number:13},error:{text:"ERROR",number:17},fatal:{text:"FATAL",number:21}},Ai=Si.info;function Ci(e){try{return et(String(e))}catch(e){return Qe}}function $i(e,t,i,n){const r=e.level||"info",{text:o,number:s}=Si[r]||Ai,a=function(e=Date.now()){return String(e)+"000000"}(U(n)?n:void 0),l={};t.distinctId&&(l.posthogDistinctId=t.distinctId),t.sessionId&&(l.sessionId=t.sessionId),t.windowId&&(l["window.id"]=t.windowId),M(t.sessionStartTimestamp)||(l.sessionStartTimestamp=String(t.sessionStartTimestamp)),M(t.lastActivityTimestamp)||(l.lastActivityTimestamp=String(t.lastActivityTimestamp)),t.currentUrl&&(l["url.full"]=t.currentUrl),t.screenName&&(l["screen.name"]=t.screenName),t.appState&&(l["app.state"]=t.appState),t.activeFeatureFlags&&t.activeFeatureFlags.length>0&&(l.feature_flags=t.activeFeatureFlags);const c=mt({},l),u=e.attributes;if(u){let e=[];try{e=Object.keys(u)}catch(t){e=[]}for(const i of e){let e;try{e=u[i]}catch(t){e=Qe}Object.defineProperty(c,i,{value:e,enumerable:!0,writable:!0,configurable:!0})}}const d={timeUnixNano:a,observedTimeUnixNano:a,severityNumber:s,severityText:o,body:{stringValue:Ci(e.body)},attributes:mi(c,i)};return e.trace_id&&(d.traceId=e.trace_id),e.span_id&&(d.spanId=e.span_id),R(e.trace_flags)||(d.flags=e.trace_flags),d}function Ti(e,t,i){return Ei(e,t,i)}function Pi(e,t,i,n){return{resourceLogs:[{resource:{attributes:Ii(t)},scopeLogs:[{scope:{name:i,version:n},logRecords:e}]}]}}var ki=class{constructor(e){this.ls=e,this.us=0}get pending(){return!!this.hs}arm(e){this.clear(),this.us=Date.now()+e,this.hs=at(()=>{this.hs=void 0,this.ls()},e)}armNoEarlierThan(e){this.hs&&Date.now()+e<=this.us||this.arm(e)}clear(){this.hs&&(clearTimeout(this.hs),this.hs=void 0)}};function xi(){return.75+.5*Math.random()}function Ri(e,t,i,n){const r=Math.min(Math.max(0,t-1),6),o=e*Math.pow(2,r);return Math.round((void 0===n?o:Math.min(o,Math.max(n,e)))*i)}var Di=class{constructor(e,t,i,n,r,o=(()=>Promise.resolve()),s){var a;this._instance=e,this.Mr=t,this.$=i,this.cs=n,this.ds=r,this.vs=o,this.fs=s,this.ps=new ki(()=>this.gs()),this.ys=null,this.bs=0,this._s=0,this.ws=new pi,this.ks=0,this.Ss=1,this.xs=0,this.Cs=0,this.$s=!1,this.Ts=t.maxBufferSize,this.Is=Math.max(null!==(a=t.maxQueueSize)&&void 0!==a?a:t.maxBufferSize,t.maxBufferSize),this.Ms=t.flushIntervalMs,this.Es=t.maxBatchRecordsPerPost,this.Ps=t.rateCapWindowMs,this.Rs=t.maxLogsPerInterval}clearQueue(){this._s++,this._instance.setPersistedProperty(_.LogsQueue,[])}reset(){this.ps.clear(),this.xs=0,this.Cs=0,this.$s=!1,this.ks=0,this.Ss=1,this.ws.reset(),this.Es=this.Mr.maxBatchRecordsPerPost}onReconnect(){this.ks=0,this.Ss=1,this.ws.isOpen()?this.As()&&this.Fs():this.gs()}captureLog(e,t){var i;if(this._instance.isDisabled)return;if(this._instance.optedOut)return;if(!(null==e?void 0:e.body))return;const n=this.Os(e);if(null===n)return;if(!n.body)return void this.$.info("Log was rejected in beforeSend function");if(!this.Ds())return;const r={record:$i(n,null!==(i=null==t?void 0:t.context)&&void 0!==i?i:this.cs(),this.$,null==t?void 0:t.occurredAtMs)};this.ds(()=>this.Ls(r))}Os(e){const t=this.Mr.beforeSend;if(!t)return e;const i=T(t)?t:[t];let n=e;for(const t of i)try{const e=t(n);if(!e)return this.$.info("Log was rejected in beforeSend function"),null;n=e}catch(e){return this.$.error("Error in beforeSend function for log:",e),null}return n}Ds(){if(void 0===this.Rs)return!0;const e=Date.now(),t=e-this.xs;return this.Ps>t&&t>=0||(this.xs=e,this.Cs=0,this.$s=!1),this.Rs>this.Cs?(this.Cs++,!0):(this.$s||(this.$.warn(`captureLog dropping logs: exceeded ${this.Rs} logs per ${this.Ps}ms`),this.$s=!0),!1)}flush(){var e=this;return Z((function*(){if(!e._instance.isDisabled)return e.ys||(e.ys=e.Ns().finally(()=>{e.ys=null})),e.ys}))()}Ns(){var e=this;return Z((function*(){var t;e.ps.clear();let i=null!==(t=e._instance.getPersistedProperty(_.LogsQueue))&&void 0!==t?t:[];if(0===i.length)return;const n=i.length;let r=0;for(;i.length>0&&n>r;){var o,s;const t=e._s;e.bs=0;const n=Math.min(i.length,e.Es),a=i.slice(0,n),l=Pi(a.map(e=>e.record),e.qs(),null!==(o=e.fs)&&void 0!==o?o:e._instance.getLibraryId(),e._instance.getLibraryVersion()),c=yield e._instance.js(l);if(e._s!==t)return;if("too-large"===c.kind&&a.length>1)e.Es=Math.max(1,Math.floor(a.length/2)),e.$.warn(`Logs batch of size ${a.length} was too large for the ingestion endpoint, reducing batch size to ${e.Es}`);else{if(e.ws.record(c),e.ps.pending&&e.ps.arm(Math.max(e.Ms,e.ws.remainingMs())),"retry-later"===c.kind)throw c.error;if("too-large"===c.kind?e.$.warn("Dropping a single log record with batch size 1 â the record
1is larger than the server cap and cannot be split further."):"ok"===c.kind&&e.Mr.maxBatchRecordsPerPost>e.Es&&(e.Es=Math.min(e.Mr.maxBatchRecordsPerPost,e.Es+1)),yield e.Bs(a.length),i=null!==(s=e._instance.getPersistedProperty(_.LogsQueue))&&void 0!==s?s:[],r+=a.length,"fatal"===c.kind)throw c.error}}}))()}Bs(e){var t=this;return Z((function*(){var i;const n=Math.max(0,e-t.bs),r=null!==(i=t._instance.getPersistedProperty(_.LogsQueue))&&void 0!==i?i:[];t._instance.setPersistedProperty(_.LogsQueue,r.slice(n)),yield t.vs()}))()}qs(){return Ti(this.Mr,this._instance.getLibraryId(),this._instance.getLibraryVersion())}Ls(e){var t;if(this._instance.optedOut)return;const i=null!==(t=this._instance.getPersistedProperty(_.LogsQueue))&&void 0!==t?t:[];this.Is>i.length||(i.shift(),this.bs++,this.$.info("Logs queue is full, dropping oldest record.")),i.push(e),this._instance.setPersistedProperty(_.LogsQueue,i),this.Ts>i.length||this.ws.isOpen()?this.Fs():this.gs()}Fs(){this.ps.pending||this.ps.arm(Math.max(this.Ms,this.ws.remainingMs()))}Hs(){return Math.max(Ri(this.Ms,this.ks,this.Ss,3e4),this.ws.remainingMs())}As(){const e=this._instance.getPersistedProperty(_.LogsQueue);return!!e&&e.length>0}shutdown(e){var t=this;return Z((function*(){t.ps.clear();const i=t.flush().catch(()=>{});void 0!==e?yield lt(i,e):yield i}))()}flushWithTimeout(e){var t=this;return Z((function*(){const i=t.flush();yield lt(i,e,()=>{i.catch(()=>{})})}))()}gs(){this.flush().then(()=>{this.ks=0,this.Ss=1},e=>{this.ks++,this.Ss=xi(),this.$.error("PostHog logs flush failed:",e)}).finally(()=>{!this._instance.isDisabled&&this.As()&&this.ps.armNoEarlierThan(this.Hs())})}};const Ni=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function Li(e){return String(e)+"000000"}function Mi(e,t,i,n){let r="";return n&&(r=Object.keys(n).sort().map(e=>`${JSON.stringify(e)}:${JSON.stringify(n[e])}`).join(",")),`${e}\0${t}\0${null!=i?i:""}\0${r}`}const Ui=(e,{debugEnabled:t}={})=>{const i={N(i,...r){n&&(m.DEBUG||n.POSTHOG_DEBUG||t)&&!R(n.console)&&n.console&&("__rrweb_original__"in n.console[i]?n.console[i].__rrweb_original__:n.console[i])(e,...r)},debug(...e){i.N("debug",...e)},info(...e){i.N("log",...e)},warn(...e){i.N("warn",...e)},error(...e){i.N("error",...e)},critical(...t){console.error(e,...t)},uninitializedWarning(e){i.error(`You must initialize PostHog before calling ${e}`)},createLogger:(t,i)=>Ui(`${e} ${t}`,i)};return i},Fi=Ui("[PostHog.js]"),ji=Fi.createLogger,Vi=ji("[ExternalScriptsLoader]"),Bi=e=>{const t=null==s?void 0:s.querySelectorAll("script");if(t)for(let i=0;t.length>i;i++)if(t[i].src===e||t[i].getAttribute("src")===e)return t[i]},Gi=(e,t,i)=>{if(e.config.disable_external_dependency_loading)return Vi.warn(`${t} was requested but loading of external scripts is disabled.`),i("Loading of external scripts is disabled");const n=Bi(t);if(n){if(n.__posthog_loading_callback_fired)return i();const e=n.__posthog_loading_error;return e?i(e):(n.addEventListener("load",e=>{n.__posthog_loading_callback_fired=!0,i(void 0,e)}),void n.addEventListener("error",e=>{n.__posthog_loading_error=e,i(e)}))}const r=()=>{if(!s)return i("document not found");if(Bi(t))return Gi(e,t,i);let n=s.createElement("script");if(n.type="text/javascript",n.crossOrigin="anonymous",n.src=t,n.onload=e=>{n.__posthog_loading_callback_fired=!0,i(void 0,e)},n.onerror=e=>{n.__posthog_loading_error=e,i(e)},e.config.prepare_external_dependency_script&&(n=e.config.prepare_external_dependency_script(n)),!n)return i("prepare_external_dependency_script returned null");if("head"===e.config.external_scripts_inject_target)s.head.appendChild(n);else{const e=s.querySelectorAll("body > script");var r;e.length>0?null===(r=e[0].parentNode)||void 0===r||r.insertBefore(n,e[0]):s.body.appendChild(n)}};(null==s?void 0:s.body)?r():null==s||s.addEventListener("DOMContentLoaded",r)},qi={},Hi=(e,t)=>{let i=`/static/${t}.js?v=${e.version}`;if("toolbar"===t){const e=3e5;i=`${i}&t=${Math.floor(Date.now()/e)*e}`}return e.requestRouter.endpointFor("assets",i)};v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.loadExternalDependency=(e,t,i)=>{if("remote-config"===t){const t=e.requestRouter.endpointFor("assets",`/array/${e.config.token}/config.js`);return void Gi(e,t,i)}const n=e.config.strict_script_versioning;if(n){const r=e.requestRouter.endpointFor("assets",`/static/${e.version}/${t}.js`),o=qi[r];if("fallback"===n&&o){if(Bi(o))return void Gi(e,o,i);delete qi[r]}Gi(e,r,"fallback"===n?(n,o)=>
vendor: 23,442 bytes, line 1
1{if(n)if("string"==typeof n)i(n);else{var s;const n=Hi(e,t);qi[r]=n;const o=Bi(r);null==o||null===(s=o.parentNode)||void 0===s||s.removeChild(o),Gi(e,n,i)}else i(void 0,o)}:i)}else Gi(e,Hi(e,t),i)},v.__PosthogExtensions__.loadSiteApp=(e,t,i)=>{const n=e.requestRouter.endpointFor("api",t);Gi(e,n,i)},m.DEBUG=!1,m.LIB_VERSION="1.431.1",m.LIB_NAME="web";var zi=m;const Ki="distinct_id",Wi="$device_id",Yi="$device_model",Ji="__alias",Xi="$fbc",Zi="$fbc_persistence",Qi="__timers",en="$autocapture_disabled_server_side",tn="$heatmaps_enabled_server_side",nn="$exception_capture_enabled_server_side",rn="$error_tracking_suppression_rules",on="$error_tracking_capture_extension_exceptions",sn="$web_vitals_enabled_server_side",an="$dead_clicks_enabled_server_side",ln="$product_tours_enabled_server_side",cn="$logs_capture_enabled_server_side",un="$web_vitals_allowed_metrics",dn="$session_recording_remote_config",fn="$sesid",hn="$session_is_sampled",pn="$enabled_feature_flags",vn="$active_feature_flags",gn="$early_access_features",mn="$feature_flag_details",_n="$feature_flag_payloads",yn="$feature_flag_request_id",bn="$minimal_flag_called_events",En="$override_feature_flags",wn="$override_feature_flag_payloads",In="$stored_person_properties",On="$stored_group_properties",Sn="$groups",An="$surveys",Cn="$surveys_loaded_at",$n="$surveys_activated",Tn="$surveys_activated_session",Pn="$surveys_activated_timestamps",kn="ph_product_tours",xn="$flag_call_reported",Rn="$flag_call_reported_session_id",Dn="$feature_flag_errors",Nn="$feature_flag_evaluated_at",Ln="$user_state",Mn="$client_session_props",Un="$initial_campaign_params",Fn="$initial_referrer_info",jn="$initial_person_info",Vn="$epp",Bn="$posthog_cookieless",Gn="$cookieless_mode",qn="$sdk_debug_extensions_init_method",Hn="$sdk_debug_extensions_init_time_ms",zn="$sdk_debug_recording_script_not_loaded",Kn="PostHog loadExternalDependency extension not found.",Wn="anonymous",Yn="identified",Jn="identified_only",Xn="visibilitychange",Zn="beforeunload",Qn="$pageview",er="$pageleave",tr="$identify",ir="$groupidentify";function nr(e,t){T(e)&&e.forEach(t)}function rr(e,t){if(!M(e))if(T(e))e.forEach(t);else if((e=>e instanceof FormData)(e))e.forEach((e,i)=>t(e,i));else for(const i in e)C.call(e,i)&&t(e[i],i)}const or=function(e,...t){for(const i of t)for(const t in i)void 0!==i[t]&&(e[t]=i[t]);return e};function sr(e){const t=Object.keys(e);let i=t.length;const n=new Array(i);for(;i--;)n[i]=[t[i],e[t[i]]];return n}const ar=function(e){return function(...t){try{return e.apply(this,t)}catch(e){Fi.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),Fi.critical(e)}}},lr=function(e){const t={};return rr(e,(function(e,i){(D(e)&&e.length>0||U(e))&&(t[i]=e)})),t};function cr(e){const t=mt({},e);for(const i of["name","message","stack","cause","errors"])try{i in e&&(t[i]=e[i])}catch(e){}return t}const ur=["herokuapp.com","vercel.app","netlify.app"];function dr(e){const t=null==e?void 0:e.hostname;if(!D(t))return!1;const i=t.split(".").slice(-2).join(".");for(const e of ur)if(i===e)return!1;return!0}function fr(e,t,i,n){const{capture:r=!1,passive:o=!0}=null!=n?n:{};null==e||e.addEventListener(t,i,{capture:r,passive:o})}function hr(e){return"ph_toolbar_internal"===e.name}const pr=e=>{if(s){try{const t=e+"=",i=s.cookie.split(";").filter(e=>e.length);for(let e=0;i.length>e;e++){let n=i[e];for(;" "==n.charAt(0);)n=n.substring(1,n.length);if(0===n.indexOf(t))return decodeURIComponent(n.substring(t.length,n.length))}}catch(e){}return null}};Math.trunc||(Math.trunc=function(e){return 0>e?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return U(e)&&isFinite(e)&&Math.floor(e)===e});let vr=e=>{if("u">typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(let t=0;e.length>t;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};n&&!R(n.crypto)&&crypto.getRandomValues&&(vr=e=>crypto.getRandomValues(e));var gr=class{nextUint32(){return this.Rt.length>this.$t||(vr(this.Rt),this.$t=0),this.Rt[this.$t++]}constructor(){this.Rt=new Uint32Array(8),this.$t=1/0}};let mr;const _r=()=>yr().toString(),yr=()=>(mr||(mr=new class{generate(){const e=this.generateOrAbort();if(!R(e))return e;{this.Ct=0;const e=this.generateOrAbort();if(R(e))throw new Error("Could not generate UUID after timestamp reset");return e}}generateOrAbort(){const e=(()=>{const e=Date.now();return U(e)&&isFinite(e)?Math.min(Math.max(Math.floor(e),0),0xffffffffffff):0})();if(e>this.Ct)this.Ct=e,this.Mt();else{if(this.Ct>=e+1e4)return;this.It++,this.It>4398046511103&&(this.Ct++,this.Mt())}return class e{constructor(e){if(this.bytes=e,16!==e.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(t,i,n,r){if(!Number.isInteger(t)||!Number.isInteger(i)||!Number.isInteger(n)||!Number.isInteger(r)||0>t||0>i||0>n||0>r||t>0xffffffffffff||i>4095||n>1073741823||r>4294967295)throw new RangeError("invalid field value");const o=new Uint8Array(16);return o[0]=t/Math.pow(2,40),o[1]=t/Math.pow(2,32),o[2]=t/Math.pow(2,24),o[3]=t/Math.pow(2,16),o[4]=t/256,o[5]=t,o[6]=112|i>>>8,o[7]=i,o[8]=128|n>>>24,o[9]=n>>>16,o[10]=n>>>8,o[11]=n,o[12]=r>>>24,o[13]=r>>>16,o[14]=r>>>8,o[15]=r,new e(o)}toString(){let e="";for(let t=0;this.bytes.length>t;t++)e=e+(this.bytes[t]>>>4).toString(16)+(15&this.bytes[t]).toString(16),3!==t&&5!==t&&7!==t&&9!==t||(e+="-");if(36!==e.length)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new e(this.bytes.slice(0))}equals(e){return 0===this.compareTo(e)}compareTo(e){for(let t=0;16>t;t++){const i=this.bytes[t]-e.bytes[t];if(0!==i)return Math.sign(i)}return 0}}.fromFieldsV7(this.Ct,Math.trunc(this.It/Math.pow(2,30)),this.It&Math.pow(2,30)-1,this.Tt.nextUint32())}Mt(){this.It=1024*this.Tt.nextUint32()+(1023&this.Tt.nextUint32())}constructor(){this.Ct=0,this.It=0,this.Tt=new gr}})).generate();let br="";const Er=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;let wr=null;const Ir={Et(){if(!L(wr))return wr;if(wr=!1,s)try{const e=`__ph_cookie_support_${_r()}`;Ir.At(e,"xyz"),wr='"xyz"'===pr(e),Ir.Lt(e)}catch(e){wr=!1}return wr},Pt(e){Fi.error("cookieStore error: "+e)},Ot:pr,Dt(e){let t;try{t=JSON.parse(Ir.Ot(e))||{}}catch(e){}return t},At(e,t,i,n,r){if(!s)return!1;try{let o="",a="";const l=function(e,t){if(t){let t=function(e,t=s){if(br)return br;if(!t)return"";if(["localhost","127.0.0.1"].includes(e))return"";const i=e.split(".");let n=Math.min(i.length,8);const r="dmn_chk_"+_r();for(;!br&&n--;){const e=i.slice(n).join("."),o=r+"=1;domain=."+e+";path=/";t.cookie=o+";max-age=3",t.cookie.includes(r)&&(t.cookie=o+";max-age=0",br=e)}return br}(e);if(!t){const i=(e=>{const t=e.match(Er);return t?t[0]:""})(e);i!==t&&Fi.info("Warning: cookie subdomain discovery mismatch",i,t),t=i}return t?"; domain=."+t:""}return""}(s.location.hostname,n);if(i){const e=new Date;e.setTime(e.getTime()+864e5*i),o="; expires="+e.toUTCString()}r&&(a="; secure");const c=e+"="+encodeURIComponent(JSON.stringify(t))+o+"; SameSite=Lax; path=/"+l+a;return c.length>3686.4&&Fi.warn("cookieStore warning: large cookie, len="+c.length),s.cookie=c,!0}catch(e){return!1}},Lt(e,t){if(null==s?void 0:s.cookie)try{Ir.At(e,"",-1,t)}catch(e){return}}};let Or=null;const Sr={Et(){if(!L(Or))return Or;let e=!0;if(R(n))e=!1;else try{const t="__mplssupport__";Sr.At(t,"xyz"),'"xyz"'!==Sr.Ot(t)&&(e=!1),Sr.Lt(t)}catch(t){e=!1}return e||Fi.error("localStorage unsupported; falling back to cookie store"),Or=e,e},Pt(e){Fi.error("localStorage error: "+e)},Ot(e){try{return null==n?void 0:n.localStorage.getItem(e)}catch(e){Sr.Pt(e)}return null},Dt(e){try{return JSON.parse(Sr.Ot(e))||{}}catch(e){}return null},At(e,t){try{return null==n||n.localStorage.setItem(e,JSON.stringify(t)),!0}catch(e){Sr.Pt(e)}return!1},Lt(e){try{null==n||n.localStorage.removeItem(e)}catch(e){Sr.Pt(e)}}},Ar=[In,vn,pn,mn,_n,yn,Nn,Dn,xn],Cr=[Wi,Ki,fn,hn,Vn,jn,Zi,Ln],$r=e=>e+"_cpm",Tr=["__proto__","constructor","prototype"],Pr=e=>{if(!k(e))return{};const t={};return Object.keys(e).forEach(i=>{-1===Tr.indexOf(i)&&(t[i]=e[i])}),t},kr=(e,t=[])=>{const i={};return[...Cr,...t].forEach(t=>{const n=e[t];R(n)||L(n)||""===n||(i[t]=n)}),i},xr=e=>{let t=5381,i=2166136261;for(let n=0;e.length>n;n++){const r=e.charCodeAt(n);t=33*t^r,i=Math.imul(i^r,16777619)}return e.length.toString(36)+"."+(t>>>0).toString(36)+"."+(i>>>0).toString(36)},Rr=(e,t)=>({p:t,f:xr(JSON.stringify(e))}),Dr=(e,t)=>{if(!t)return{properties:[],isValid:!1};try{const i=Ir.Dt($r(e)),n=(null==i?void 0:i.f)===xr(t)&&T(i.p);return{properties:n?i.p:[],isValid:n}}catch(e){return{properties:[],isValid:!1}}},Nr=(e,t)=>t+"|"+(Ir.Ot($r(e))||""),Lr={},Mr={Et:()=>!0,Pt(e){Fi.error("memoryStorage error: "+e)},Ot:e=>e in Lr?Lr[e]:null,Dt:e=>e in Lr?Lr[e]:null,At:(e,t)=>(Lr[e]=t,!0),Lt(e){delete Lr[e]}};let Ur=null;const Fr={Et(){if(!L(Ur))return Ur;if(Ur=!0,R(n))Ur=!1;else try{const e="__support__";Fr.At(e,"xyz"),'"xyz"'!==Fr.Ot(e)&&(Ur=!1),Fr.Lt(e)}catch(e){Ur=!1}return Ur},Pt(e){Fi.error("sessionStorage error: ",e)},Ot(e){try{return null==n?void 0:n.sessionStorage.getItem(e)}catch(e){Fr.Pt(e)}return null},Dt(e){try{return JSON.parse(Fr.Ot(e))||null}catch(e){}return null},At(e,t){try{return null==n||n.sessionStorage.setItem(e,JSON.stringify(t)),!0}catch(e){Fr.Pt(e)}return!1},Lt(e){try{null==n||n.sessionStorage.removeItem(e)}catch(e){Fr.Pt(e)}}};var jr=class{constructor(e){this._instance=e}get Mr(){return this._instance.config}get consent(){return this.Ro()?0:this.Ao}isOptedOut(){return"always"===this.Mr.cookieless_mode||this.isRejected()||-1===this.consent&&"on_reject"===this.Mr.cookieless_mode}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return 0===this.consent}isRejected(){return 0===this.consent||-1===this.consent&&this.Mr.opt_out_capturing_by_default}optInOut(e){this.Fo.At(this.Oo,e?1:0,this.Mr.cookie_expiration,this.Mr.cross_subdomain_cookie,this.Mr.secure_cookie)}reset(){this.Fo.Lt(this.Oo,this.Mr.cross_subdomain_cookie)}get Oo(){const{token:e,opt_out_capturing_cookie_prefix:t,consent_persistence_name:i}=this._instance.config;return i||(t?t+e:"__ph_opt_in_out_"+e)}get Ao(){const e=this.Fo.Ot(this.Oo);return Y(e)?1:w(J,e)?0:-1}get Fo(){const e=this.Mr.opt_out_capturing_persistence_type,t="localStorage"===e?Sr:Ir,i=t.Et()?t:Mr;if(!this.Do||this.Do!==i){this.Do=i;const t="localStorage"===e?Ir:Sr;t.Ot(this.Oo)&&(this.Do.Ot(this.Oo)||this.optInOut(Y(t.Ot(this.Oo))),t.Lt(this.Oo,this.Mr.cross_subdomain_cookie))}return this.Do}Ro(){return!!this.Mr.respect_dnt&&[null==o?void 0:o.doNotTrack,null==o?void 0:o.msDoNotTrack,v.doNotTrack,null==o?void 0:o.globalPrivacyControl].some(e=>Y(e))}};function Vr(e,t){var i;const n=null==e||null===(i=e.config)||void 0===i?void 0:i.get_current_url;if(!P(n))return t;try{const e=n(t);return D(e)&&e?e:t}catch(e){return Fi.error("Error in get_current_url, falling back to window.location.href",e),t}}function Br(e){var t;return e instanceof Element&&("__POSTHOG_TOOLBAR__"===e.id||!!(null===(t=e.closest)||void 0===t?void 0:t.call(e,".toolbar-global-fade-container")))}function Gr(e){return!!e&&1===e.nodeType}function qr(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function Hr(e){return!!e&&3===e.nodeType}function zr(e){return!!e&&11===e.nodeType&&Gr(e.host)}function Kr(e){return e?I(e).split(/\s+/):[]}function Wr(e,t){const i=function(e){var t;const i=null==n||null===(t=n.location)||void 0===t?void 0:t.href;return R(i)?void 0:Vr(e,i)}(t);return!!(i&&e&&e.some(e=>i.match(e)))}function Yr(e){let t="";switch(typeof e.className){case"string":t=e.className;break;case"object":t=(e.className&&"baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";break;default:t=""}return Kr(t)}function Jr(e){return M(e)?null:I(e).split(/(\s+)/).filter(e=>wo(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Xr(e){let t="";return ho(e)&&!po(e)&&e.childNodes&&e.childNodes.length&&rr(e.childNodes,(function(e){var i;Hr(e)&&e.textContent&&(t+=null!==(i=Jr(e.textContent))&&void 0!==i?i:"")})),I(t)}function Zr(e){var t;return R(e.target)?e.srcElement||null:(null===(t=e.target)||void 0===t?void 0:t.shadowRoot)?e.composedPath()[0]||null:e.target||null}const Qr=["a","button","form","input","select","textarea","label"];function eo(e,t){const i=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector;try{return!!i&&i.call(e,t)}catch(e){return!1}}function to(e,t){if(R(t))return!0;for(const i of e)if(t.some(e=>eo(i,e)))return!0;return!1}function io(e){const t=e.parentNode;return!(!t||!Gr(t))&&t}const no=[".ph-no-autocapture","[data-ph-no-autocapture]"],ro=["next","previous","prev",">","<"],oo=[...ro,"+","-","â","â"],so=(e,t)=>/[a-z0-9]/i.test(t)?e.includes(t):e===t,ao=[".ph-no-rageclick",".ph-no-capture"],lo=["","text","search","email","password","url","tel","number"];function co(e,t){if(!n||uo(e))return!1;let i,r,o;var s,a;if(j(t)?(i=!!t&&ao,r=void 0,o=!1):(i=null!==(s=null==t?void 0:t.css_selector_ignorelist)&&void 0!==s?s:ao,r=null==t?void 0:t.content_ignorelist,o=null!==(a=null==t?void 0:t.ignore_text_selection)&&void 0!==a&&a),!1===i)return!1;if(o&&function(e){return!(!e||!Gr(e))&&(!!qr(e,"textarea")||(qr(e,"input")?w(lo,(e.getAttribute("type")||"").toLowerCase()):function(e){var t;if(e.isContentEditable)return!0;const i=null===(t=e.getAttribute)||void 0===t?void 0:t.call(e,"contenteditable");return"true"===i||""===i}(e)))}(e))return!1;const{targetElementList:l}=fo(e,!1);return!function(e,t){if(!1===e||R(e))return!1;let i;if(!0===e)i=ro;else{if(!T(e))return!1;if(e.length>10)return Fi.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;i=e.map(e=>e.toLowerCase())}return t.some(({safeText:e,ariaLabel:t})=>i.some(i=>so(e,i)||so(t,i)))}(r,l.map(e=>{var t;return{safeText:Xr(e).toLowerCase(),ariaLabel:(null===(t=e.getAttribute("aria-label"))||void 0===t?void 0:t.toLowerCase().trim())||""}}))&&!to(l,i)}const uo=e=>!e||qr(e,"html")||!Gr(e),fo=(e,t)=>{if(!n||uo(e))return{parentIsUsefulElement:!1,targetElementList:[]};let i=!1;const r=[e];let o=e;for(;o.parentNode&&!qr(o,"body");){if(zr(o.parentNode)){r.push(o.parentNode.host),o=o.parentNode.host;continue}const e=io(o);if(!e)break;if(t||Qr.indexOf(e.tagName.toLowerCase())>-1)i=!0;else try{const t=n.getComputedStyle(e);t&&"pointer"===t.getPropertyValue("cursor")&&(i=!0)}catch(e){}r.push(e),o=e}return{parentIsUsefulElement:i,targetElementList:r}};function ho(e){const t=new Set;let i=0;for(let n=e;n.parentNode&&!qr(n,"body");n=n.parentNode){if(i++>=1e3||t.has(n))return!1;t.add(n);const e=Yr(n);if(w(e,"ph-sensitive")||w(e,"ph-no-capture"))return!1}if(w(Yr(e),"ph-include"))return!0;const n=e.type||"";if(D(n))switch(n.toLowerCase()){case"hidden":case"password":return!1}const r=e.name||e.id||"";return!D(r)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(r.replace(/[^a-zA-Z0-9]/g,""))}function po(e){return!!(qr(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||qr(e,"select")||qr(e,"textarea")||"true"===e.getAttribute("contenteditable"))}const vo=new RegExp("^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$"),go=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,mo=[16,15,14,13],_o=new RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),yo=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),bo=/[0-9A-Za-z_]/;function Eo(e){let t=0,i=!1;for(let n=e.length-1;n>=0;n--){let r=e.charCodeAt(n)-48;i&&(r*=2,r>9&&(r-=9)),t+=r,i=!i}return t%10==0}function wo(e,t=!0){if(M(e))return!1;if(D(e)){if(e=I(e),t?vo.test((e||"").replace(/[- ]/g,"")):function(e){let t;for(go.lastIndex=0;t=go.exec(e);){const e=t[2];if(!e)continue;const i=e.replace(/[- ]/g,"");for(let e=0;i.length>e;e++)for(const t of mo){const n=e+t;if(i.length>=n){const t=i.slice(e,n);if(vo.test(t)&&Eo(t))return!0}}}return!1}(e))return!1;if(t?_o.test(e):function(e){let t;for(yo.lastIndex=0;t=yo.exec(e);){const e=t[1],i=t[3];if(!(e&&i&&bo.test(e)&&bo.test(i)))return!0}return!1}(e))return!1}return!0}function Io(e){let t=Xr(e);return t=`${t} ${function e(t){let i="";return t&&t.childNodes&&t.childNodes.length&&rr(t.childNodes,(function(t){var n;if(t&&"span"===(null===(n=t.tagName)||void 0===n?void 0:n.toLowerCase()))try{const n=Xr(t);i=`${i} ${n}`.trim(),t.childNodes&&t.childNodes.length&&(i=`${i} ${e(t)}`.trim())}catch(t){Fi.error("[AutoCapture]",t)}})),i}(e)}`.trim(),wo(t)?t:""}function Oo(e){return e.replace(/"|\\"/g,'\\"')}function So(e){const t=e.attr__class;if(t)return T(t)?t:Kr(t)}const Ao=ji("[Dead Clicks]"),Co=()=>!0,$o=e=>{var t;const i=!!(null===(t=e.instance.persistence)||void 0===t?void 0:t.get_property(an)),n=e.instance.config.capture_dead_clicks;return j(n)?n:!!k(n)||i};var To=class{get lazyLoadedDeadClicksAutocapture(){return this.Lo}constructor(e,t,i){this.instance=e,this.isEnabled=t,this.onCapture=i,this.startIfEnabledOrStop()}onRemoteConfig(e){if(!e.ok)return;const t=e.config;"captureDeadClicks"in t&&(this.instance.persistence&&this.instance.persistence.register({[an]:t.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this.No(()=>{this.qo()}):this.stop()}No(e){var t,i,n;(null===(t=v.__PosthogExtensions__)||void 0===t?void 0:t.initDeadClicksAutocapture)?e():null===(i=v.__PosthogExtensions__)||void 0===i||null===(n=i.loadExternalDependency)||void 0===n||n.call(i,this.instance,"dead-clicks-autocapture",t=>{t?Ao.error("failed to load script",t):e()})}qo(){var e;if(s){if(!this.Lo&&(null===(e=v.__PosthogExtensions__)||void 0===e?void 0:e.initDeadClicksAutocapture)){const e=k(this.instance.config.capture_dead_clicks)?mt({},this.instance.config.capture_dead_clicks):{};e.__onCapture=this.onCapture,this.onCapture&&(e.capture_dead_swipes=!1),this.Lo=v.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,e),this.Lo.start(s),Ao.info("starting...")}}else Ao.error("`document` not found. Cannot start.")}stop(){this.Lo&&(this.Lo.stop(),this.Lo=void 0,Ao.info("stopping..."))}};const Po=ji("[SegmentIntegration]");function ko(e,t,i=!0){const n=e.config.segment;if(!n)return t();const{analytics:r,filterProperties:o}=(e=>P(e.register))(s=n)?{analytics:s}:s;var s;!function(e,t,i,n){const r=t=>{const r=()=>t.anonymousId()||_r();e.config.get_device_id=r,n&&t.id()&&(e.register({distinct_id:t.id(),$device_id:r()}),e.persistence.set_property(Ln,Yn)),i(n?void 0:t.anonymousId()||void 0)},o=t.user();"then"in o&&P(o.then)?o.then(r):r(o)}(e,r,i=>{r.register(((e,t,{filterProperties:i}={})=>{"undefined"!=typeof Promise&&Promise.resolve||Po.warn("This browser does not have Promise support, and can not use the segment integration");const n=(n,r)=>{if(!r)return n;const o=!!t&&n.event.anonymousId===t&&!n.event.userId;o||n.event.userId||n.event.anonymousId===e.get_distinct_id()||(Po.info("No userId set, resetting PostHog"),e.reset()),o||(t=void 0),n.event.userId&&n.event.userId!==e.get_distinct_id()&&(Po.info("UserId set, identifying with PostHog"),e.identify(n.event.userId));let s=e.calculateEventProperties(r,n.event.properties);if(!M(i)){const e=n.event.properties||{},t={};for(const i of Object.keys(s))C.call(e,i)||(t[i]=s[i]);const r=((e,t)=>{const i=T(e)?e:[e];let n=mt({},t);for(const t of i)try{if(n=t(n),M(n))return null}catch(e){return Po.error("Error in Segment filterProperties:",e),null}return n})(i,t);if(M(r))return n;s=r}return n.event.properties=Object.assign({},s,n.event.properties),n};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:e=>n(e,e.event.event),page:e=>n(e,Qn),identify:e=>n(e,tr),screen:e=>n(e,"$screen")}})(e,i,{filterProperties:o})).then(()=>{t()},e=>{Po.error("Failed to register the Segment integration",e),t()})},i)}const xo="posthog-js";function Ro(e,{organization:t,projectId:i,prefix:n,severityAllowList:r=["error"],sendExceptionsToPostHog:o=!0}={}){return s=>{var a,l,c,u,d;if("*"!==r&&!r.includes(s.level)||!e.__loaded)return s;s.tags||(s.tags={});const f=e.requestRouter.endpointFor("ui",`/project/${e.config.token}/person/${e.get_distinct_id()}`);s.tags["PostHog Person URL"]=f,e.sessionRecordingStarted()&&(s.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));const h=(null===(a=s.exception)||void 0===a?void 0:a.values)||[],p=h.map(e=>mt(mt({},e),{},{stacktrace:e.stacktrace?mt(mt({},e.stacktrace),{},{type:"raw",frames:(e.stacktrace.frames||[]).map(e=>mt(mt({},e),{},{platform:"web:javascript"}))}):void 0})),v={$exception_message:(null===(l=h[0])||void 0===l?void 0:l.value)||s.message,$exception_type:null===(c=h[0])||void 0===c?void 0:c.type,$exception_level:s.level,$exception_list:p,$sentry_event_id:s.event_id,$sentry_exception:s.exception,$sentry_exception_message:(null===(u=h[0])||void 0===u?void 0:u.value)||s.message,$sentry_exception_type:null===(d=h[0])||void 0===d?void 0:d.type,$sentry_tags:s.tags};var g;return t&&i&&(v.$sentry_url=(n||"https://sentry.io/organizations/")+t+"/issues/?project="+i+"&query="+s.event_id),o&&(null===(g=e.exceptions)||void 0===g||g.sendExceptionEvent(v)),s}}var Do=class{constructor(e){this.jo=(e,t,i)=>{i&&(i.noSessionId||i.activityTimeout||i.sessionPastMaximumLength||i.crossTabAdoption)&&(Fi.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:e,changeReason:i}),this.Bo=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.Ho()}Ho(){var e;this.zo=null===(e=this._instance.sessionManager)||void 0===e?void 0:e.onSessionId(this.jo)}destroy(){var e;null===(e=this.zo)||void 0===e||e.call(this),this.zo=void 0}doPageView(e,t){var i;const r=this.Uo(e,t);return this.Bo={pathname:null!==(i=null==n?void 0:n.location.pathname)&&void 0!==i?i:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),r}doPageLeave(e){var t;return this.Uo(e,null===(t=this.Bo)||void 0===t?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:null===(e=this.Bo)||void 0===e?void 0:e.pageViewId}}Uo(e,t){const i=this.Bo;if(!i)return{$pageview_id:t};let n={$pageview_id:t,$prev_pageview_id:i.pageViewId};const r=this._instance.scrollManager.getContext();if(r&&!this._instance.config.disable_scroll_properties){let{maxScrollHeight:e,lastScrollY:t,maxScrollY:i,maxContentHeight:o,lastContentY:s,maxContentY:a}=r;if(!(R(e)||R(t)||R(i)||R(o)||R(s)||R(a))){e=Math.ceil(e),t=Math.ceil(t),i=Math.ceil(i),o=Math.ceil(o),s=Math.ceil(s),a=Math.ceil(a);const r=e>1?te(t/e,0,1,Fi):1,l=e>1?te(i/e,0,1,Fi):1,c=o>1?te(s/o,0,1,Fi):1,u=o>1?te(a/o,0,1,Fi):1;n=or(n,{$prev_pageview_last_scroll:t,$prev_pageview_last_scroll_percentage:r,$prev_pageview_max_scroll:i,$prev_pageview_max_scroll_percentage:l,$prev_pageview_last_content:s,$prev_pageview_last_content_percentage:c,$prev_pageview_max_content:a,$prev_pageview_max_content_percentage:u})}}return i.pathname&&(n.$prev_pageview_pathname=i.pathname),i.timestamp&&(n.$prev_pageview_duration=(e.getTime()-i.timestamp.getTime())/1e3),n}};const No=["flags","surveys"],Lo={$people_distinct_id:{exposure:"hidden"},[Ji]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[Qi]:{exposure:"hidden"},[Zi]:{exposure:"hidden"}
1,[en]:{exposure:"event"},[tn]:{exposure:"hidden"},[cn]:{exposure:"hidden"},[nn]:{exposure:"event"},[rn]:{exposure:"hidden"},[on]:{exposure:"event"},[sn]:{exposure:"event"},[an]:{exposure:"event"},[ln]:{exposure:"hidden"},[un]:{exposure:"event"},[dn]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[fn]:{exposure:"hidden"},[hn]:{exposure:"event"},$replay_sample_rate:{exposure:"event",shouldSkipFromEventProperties:e=>L(e)},$session_past_minimum_duration:{exposure:"event"},$session_recording_url_trigger_activated_session:{exposure:"event"},$session_recording_event_trigger_activated_session:{exposure:"event"},$debug_first_full_snapshot_timestamp:{exposure:"event"},$sess_rec_flush_size:{exposure:"hidden"},[pn]:{exposure:"hidden",storageGroup:"flags"},[vn]:{exposure:"hidden",storageGroup:"flags"},[gn]:{exposure:"hidden"},[mn]:{exposure:"hidden",storageGroup:"flags"},[_n]:{exposure:"hidden",storageGroup:"flags"},[yn]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[bn]:{exposure:"hidden",storageGroup:"flags"},[En]:{exposure:"hidden"},[wn]:{exposure:"hidden"},[In]:{exposure:"hidden"},[On]:{exposure:"hidden"},[An]:{exposure:"hidden",storageGroup:"surveys"},[Cn]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[$n]:{exposure:"event"},[Tn]:{exposure:"hidden"},[Pn]:{exposure:"hidden"},[kn]:{exposure:"hidden"},$product_tours_activated:{exposure:"hidden"},$product_tours_activated_session:{exposure:"hidden"},$conversations_widget_session_id:{exposure:"event"},$conversations_ticket_id:{exposure:"event"},$conversations_widget_state:{exposure:"event"},$conversations_user_traits:{exposure:"event"},[xn]:{exposure:"hidden"},[Rn]:{exposure:"hidden"},[Sn]:{exposure:"event"},[Dn]:{exposure:"hidden"},[Nn]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[Ln]:{exposure:"hidden"},[Mn]:{exposure:"hidden"},$capture_rate_limit:{exposure:"hidden"},[Un]:{exposure:"hidden"},[Fn]:{exposure:"hidden"},[jn]:{exposure:"hidden"},[Vn]:{exposure:"hidden"},$replay_override_sampling:{exposure:"event"},$replay_override_linked_flag:{exposure:"event"},$replay_override_url_trigger:{exposure:"event"},$replay_override_event_trigger:{exposure:"event"},[qn]:{exposure:"event"},[Hn]:{exposure:"event"},[zn]:{exposure:"event"},$sdk_debug_replay_event_trigger_status:{exposure:"event"},$sdk_debug_replay_linked_flag_trigger_status:{exposure:"event"},$sdk_debug_replay_matched_recording_trigger_groups:{exposure:"event"}
vendor: 73,450 bytes, line 1
1,$sdk_debug_replay_pending_trigger_conditions:{exposure:"event"},$sdk_debug_replay_remote_trigger_matching_config:{exposure:"event"},$sdk_debug_replay_trigger_groups_count:{exposure:"event"},$sdk_debug_replay_url_trigger_status:{exposure:"event"},$session_recording_start_reason:{exposure:"event"}},Mo=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],Uo=e=>{const t=Lo[e];if(t)return t;for(const[t,i]of Mo)if(0===e.indexOf(t))return i},Fo=(e,t)=>{try{let i;return JSON.stringify(e,(e,t)=>{var n;return H(t)?(null!==(n=i)&&void 0!==n||(i=new WeakMap),i.has(t)||i.set(t,cr(t)),i.get(t)):"bigint"==typeof t?t.toString():t},t)}catch(t){return S(e)}},jo=e=>{const t=null==s?void 0:s.createElement("a");return R(t)?null:(t.href=e,t)},Vo=function(e,t){const i=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&");let n;for(let e=0;i.length>e;e++){const r=i[e].split("=");if(r[0]===t){n=r;break}}if(!T(n)||2>n.length)return"";{let e=n[1];try{e=decodeURIComponent(e)}catch(t){Fi.error("Skipping decoding for malformed query param: "+e)}return e.replace(/\+/g," ")}},Bo=function(e,t,i){if(!e||!t||!t.length)return e;const n=e.split("#"),r=n[1],o=(n[0]||"").split("?"),s=o[1],a=o[0],l=(s||"").split("&"),c=[];for(let e=0;l.length>e;e++){const n=l[e].split("=");T(n)&&(t.includes(n[0])?c.push(n[0]+"="+i):c.push(l[e]))}let u=a;return null!=s&&(u+="?"+c.join("&")),null!=r&&(u+="#"+r),u},Go=function(e,t){const i=e.match(new RegExp(t+"=([^&]*)"));return i?i[1]:null},qo=(e,t)=>e>=t&&h(),Ho=(e,t,i,n)=>{if(0===e){if(h()){const e=t+1;return e===i&&n(),e}return t}return 0},zo=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],Ko=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...zo],Wo="<masked>",Yo=["li_fat_id"];function Jo(e,t,i){if(!s)return{};const n=t?[...zo,...i||[]]:[],r=Xo(Bo(s.URL,n,Wo),e),o=function(){const e={};return rr(Yo,(function(t){const i=pr(t);e[t]=i||null})),e}();return or(o,r)}function Xo(e,t){const i=Ko.concat(t||[]),n={};return rr(i,(function(t){const i=Vo(e,t);n[t]=i||null})),n}function Zo(e){const t=function(e){return e?0===e.search("https?://(.*)google.([^/?]*)")?"google":0===e.search("https?://(.*)bing.com")?"bing":0===e.search("https?://(.*)yahoo.com")?"yahoo":0===e.search("https?://(.*)duckduckgo.com")?"duckduckgo":null:null}(e),i="yahoo"!=t?"q":"p",n={};if(!L(t)){n.$search_engine=t;const e=s?Vo(s.referrer,i):"";e.length&&(n.ph_keyword=e)}return n}function Qo(){return navigator.language||navigator.userLanguage}function es(){const e=Qo();return"string"==typeof e?e.split("-")[0]:void 0}const ts="$direct";function is(){return(null==s?void 0:s.referrer)||ts}function ns(e,t,i=!1){const n=e?[...zo,...t||[]]:[],r=i?ot(null==a?void 0:a.href):null==a?void 0:a.href,o=null==r?void 0:r.substring(0,1e3);return{r:is().substring(0,1e3),u:o?Bo(o,n,Wo):void 0}}function rs(e,t=!1){var i;const{r:n,u:r}=e,o=t?ot(r):r,s={$referrer:n,$referring_domain:null==n?void 0:n==ts?ts:null===(i=jo(n))||void 0===i?void 0:i.host};if(o){s.$current_url=o;const e=jo(o);s.$host=null==e?void 0:e.host,s.$pathname=null==e?void 0:e.pathname;const t=Xo(o);or(s,t)}if(n){const e=Zo(n);or(s,e)}return s}function os(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}}function ss(){try{return(new Date).getTimezoneOffset()}catch(e){return}}const as={flags:Nn,surveys:Cn},ls=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],cs=e=>`${e}_cookie_identity_change_pending`,us=e=>{let t="",i=0;for(const n of e){const e=encodeURIComponent(JSON.stringify(n).slice(1,-1)).length;if(i+e>1e3)break;t+=n,i+=e}return t},ds="main",fs=[pn,vn,mn,_n,yn,Nn,bn,In],hs=e=>-1!==fs.indexOf(e),ps=(e,t)=>{try{return JSON.stringify(e)===JSON.stringify(t)}catch(i){return e===t}},vs=e=>{if(!e)return{};const t=JSON.parse(e);return k(t)?t:{}},gs=(e,t)=>{rr(e,(i,n)=>{const r=Uo(n);r&&"event"!==r.exposure||{}.hasOwnProperty.call(t,n)||delete e[n]})};var ms=class{constructor(e,t,i=!0){if(this.Wo={},this.Vo=!1,this.Go=!1,this.Zo=!1,this.Qo=!1,this.Jo=!1,this.Ko=new Map,this.Xo=!1,this.Yo=!1,this.tl=!1,this.el=!1,this.il=new Set,this.Mr=e,this.nl=i,this.props={},this.sl=void 0,this.rl=(e=>{let t="";return e.token&&(t=e.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),e.persistence_name?"ph_"+e.persistence_name:"ph_"+t+"_posthog"})(e),this.Fo=this.ol(e),this.Zo=this.ll(e),this.load(),this.al(),e.debug&&Fi.info("Persistence loaded",e.persistence,mt({},this.props)),this.update_config(e,e,t),this.save(),n){const e=()=>this.flush();fr(n,"beforeunload",e,{capture:!1}),fr(n,"pagehide",e,{capture:!1}),this.ul=e=>{if(this.Vo&&(!e.storageArea||e.storageArea===(null==n?void 0:n.localStorage))&&e.key)if(e.key!==this.rl){if(this.Zo){const t=No.find(t=>e.key===this.hl(t));t&&this.cl(e.key,t)}}else this.cl(e.key,ds)},fr(n,"storage",this.ul)}}markCrossTabFeatureFlagChanges(e){Object.entries(e).forEach(([e,t])=>{const i=this.Ko.get(e);if(!hs(e)||!0===i)return;if(!0===t)return void this.dl(e,!0);const n=new Set(i||[]);t.forEach(e=>n.add(e)),n.size&&this.dl(e,n)})}onCrossTabFeatureFlagChange(e){return this.il.add(e),()=>this.il.delete(e)}destroy(){this.ul&&n&&(n.removeEventListener("storage",this.ul),this.ul=void 0),this.il.clear()}cl(e,t,i=!0){if(this.pi)return!1;let n,r;try{if(r=Sr.Ot(e),L(r)){const e=this.vl(t);return e.storageValue=null,t!==ds&&(e.persisted=!1),!1}n=vs(r)}catch(e){return!1}const o=t===ds?n:Sr.Dt(this.rl);if(o&&this.fl(o))return!1;const s=this.pl(n,t,i);return t===ds&&this.Zo&&!ps(this.gl().main,n)||this.ml(n,t,!0,r),s}fl(e){const t=this.props[Ki],i=e[Ki];return!R(t)&&!R(i)&&t!==i}ml(e,t,i,n){const r=this.vl(t);r.storageValue=n,t!==ds&&(r.persisted=i);try{r.fingerprint=this.yl(e,t)}catch(e){r.fingerprint=void 0}}pl(e,t,i){let n=!1;return fs.forEach(i=>{var r;const o=null===(r=Uo(i))||void 0===r?void 0:r.storageGroup;if(t===ds&&this.Zo&&o||t!==ds&&o!==t)return;const s=i in e,a=this.bl(i,s?e[i]:void 0),l=this.Ko.has(i)?i in this.props:s;l===i in this.props&&ps(a,this.props[i])||(l?this._l(i,a,!1):this.wl(i,!1),n=!0)}),n&&i&&this.il.forEach(e=>e()),n}kl(){if(!this.Vo)return!1;try{this.tl=!1;const e=Sr.Ot(this.rl),t=this.vl(ds);let i,n=!1,r=!1;if(e!==t.storageValue)if(L(e))t.storageValue=null;else{if(i=vs(e),this.tl=!this.Yo&&this.fl(i),this.tl)return!1;r=this.pl(i,ds,!1),!this.Zo||ps(this.gl().main,i)?this.ml(i,ds,!0,e):t.storageValue=e,n=!0}return this.Zo&&No.forEach(e=>{const t=Sr.Ot(this.hl(e)),o=this.vl(e),s=i||{},a=n&&fs.some(t=>{var i;return(null===(i=Uo(t))||void 0===i?void 0:i.storageGroup)===e&&t in s});if(t===o.storageValue&&!a)return;if(L(t))return o.storageValue=null,o.persisted=!1,void(a&&(r=this.pl(s,e,!1)||r));const l=vs(t);r=this.pl(l,e,!1)||r,this.ml(l,e,!0,t)}),r}catch(e){return!1}}dl(e,t){this.Ko.set(e,t);const i=Uo(e);(null==i?void 0:i.volatile)||(this.vl((this.Zo?null==i?void 0:i.storageGroup:void 0)||ds).fingerprint=void 0,this.Sl(e))}xl(){fs.forEach(e=>this.Ko.set(e,!0))}al(){if(this.Vo)try{const e=Sr.Ot(this.rl),t=vs(e);this.vl(ds).storageValue=e,fs.forEach(e=>{var i;const n=this.Zo?null===(i=Uo(e))||void 0===i?void 0:i.storageGroup:void 0,r=n?Sr.Ot(this.hl(n)):null;if(n){const e=this.vl(n);e.storageValue=r,e.persisted=!L(r)}const o=n&&!L(r)?vs(r):t;e in this.props?this.Cl(e,o[e],this.props[e]):e in o&&this.dl(e,!0)})}catch(e){}}bl(e,t){const i=this.Ko.get(e);if(!i)return t;if(!0===i)return this.props[e];if("$active_feature_flags"===e){const n=new Set(T(t)?t:[]),r=new Set(T(this.props[e])?this.props[e]:[]);return i.forEach(e=>r.has(e)?n.add(e):n.delete(e)),Array.from(n)}const n=k(t)?mt({},t):{},r=k(this.props[e])?this.props[e]:{};return i.forEach(e=>{e in r?n[e]=r[e]:delete n[e]}),n}Cl(e,t,i){if(!hs(e))return;const n=this.Ko.get(e);if(!0===n)return;let r=t;if(this.Vo)try{var o;const t=this.Zo?null===(o=Uo(e))||void 0===o?void 0:o.storageGroup:void 0,i=t?this.hl(t):this.rl;r=vs(Sr.Ot(i))[e]}catch(e){}const s=new Set(n||[]);if("$active_feature_flags"===e){if(!R(t)&&!T(t)||!R(r)&&!T(r)||!T(i))return void this.dl(e,!0);const n=new Set(t||[]),o=new Set(r||[]),a=new Set(i);new Set([...n,...a]).forEach(e=>{n.has(e)!==a.has(e)&&s.add(e)}),s.forEach(e=>{o.has(e)===a.has(e)&&s.delete(e)})}else{if(!k(i))return void(ps(r,i)?this.Ko.delete(e):this.dl(e,!0));{if(!R(t)&&!k(t)||R(t)&&x(i)&&R(r))return void this.dl(e,!0);const n=k(t)?t:{},o=k(r)?r:{};new Set([...Object.keys(n),...Object.keys(i)]).forEach(e=>{e in n==e in i&&ps(n[e],i[e])||s.add(e)}),s.forEach(e=>{e in o==e in i&&ps(o[e],i[e])&&s.delete(e)})}}s.size?this.dl(e,s):this.Ko.delete(e)}$l(){var e;const t=null===(e=this.Mr)||void 0===e?void 0:e.persistence_save_debounce_ms;return U(t)&&t>0?t:0}Tl(e){if(this.Mr.cookieWinsOnConflict&&"localstorage+cookie"===this.Mr.persistence.toLowerCase())if(e)try{const t=kr(e,this.Mr.cookie_persisted_properties||[]),i=Rr(t,this.Mr.cookie_persisted_properties||[]),n=JSON.stringify(t)+"|"+JSON.stringify(i),r=Ir.Ot(this.rl)||void 0;r&&Nr(this.rl,r)===n&&(this.Il=n,this.Ml=r)}catch(e){}else try{const e=Ir.Ot(this.rl)||void 0;this.Il=e?Nr(this.rl,e):void 0,this.Ml=e}catch(e){}}syncCookieProperties(){return this.El(this.Mr)}El(e,t=!1){if(this.pi&&!t||this.Jo||!e.cookieWinsOnConflict||"localstorage+cookie"!==e.persistence.toLowerCase())return!1;let i;try{i=Ir.Ot(this.rl)||void 0}catch(e){}if(!i||i===this.Ml)return!1;const n=Nr(this.rl,i);let r;try{r=Pr(JSON.parse(i))}catch(e){return!1}if((Ir.Ot(this.rl)||void 0)!==i)return!1;this.Il=n,this.Ml=i;const o=Dr(this.rl,i),s=[...Cr,...o.properties],a={};if(Object.keys(r).forEach(e=>{const t=r[e];(R(t)||L(t)||""===t||"$user_state"===e&&"anonymous"!==t&&"identified"!==t)&&(a[e]=!0,delete r[e])}),x(r))return!1;const l="distinct_id"in r||"anonymous"===r.$user_state||"identified"===r.$user_state,c=this.props,u=c[Ki],d=c[Ln],f=or({},c);[...Cr,...e.cookie_persisted_properties||[]].forEach(e=>{if(-1!==s.indexOf(e)&&!(e in r)&&!a[e]&&(l||"distinct_id"!==e&&"$user_state"!==e)){const t=f[e];(o.isValid||-1===Cr.indexOf(e)||!1!==t&&0!==t)&&delete f[e]}}),this.props=or(f,r),fs.forEach(e=>{const t=e in this.props;e in c===t&&ps(c[e],this.props[e])||(t?this.Cl(e,c[e],this.props[e]):this.dl(e,!0))}),!l||"$user_state"in r||"$user_state"in this.props||this._l(Ln,Wn);const h=this.props[Ki],p=this.props[Ln];return!l||h===u&&p===d||(this.Yo=!0,this.Qo=!0,Fr.At(cs(this.rl),!0),this.wl(In),this.wl(vn),this.wl(pn),this.wl(mn),this.wl(_n),this.wl(yn),this.wl(Nn),this.wl(Dn),this.wl(xn),"anonymous"!==p||"identified"!==d&&"anonymous"!==r.$user_state&&(R(u)||h===u)||(gs(this.props,r),this.wl(On)),"identified"===p?this.props.$user_id=h:delete this.props.$user_id,this.wl(Ji)),!0}consumeCookieIdentityChange(){const e=cs(this.rl),t=this.Qo||!!Fr.Ot(e);return this.Qo=!1,t&&Fr.Lt(e),t}Pl(e=!1){return!(this.Jo||this.pi&&!e||!this.Mr.cookieWinsOnConflict||"localstorage+cookie"!==this.Mr.persistence.toLowerCase()||(this.Jo=!0,0))}Rl(){this.Jo&&(R(this.Al)||(clearTimeout(this.Al),this.Al=void 0),delete this.Wo[ds],this.Fl(!0))}Ol(e=!0){if(this.Jo)try{e?this.Rl():R(this.Al)||(clearTimeout(this.Al),this.Al=void 0)}finally{this.Jo=!1}}isDisabled(){return!!this.pi}ol(e){-1===ls.indexOf(e.persistence.toLowerCase())&&(Fi.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");const t=((e=[],t=!1)=>{const i=[...Cr,...e];return mt(mt({},Sr),{},{Dt(e){try{let r,o={};try{r=Ir.Ot(e)||void 0,o=r?Pr(JSON.parse(r)):{}}catch(e){}const s=JSON.parse(Sr.Ot(e)||"{}");let a;if(t){const t=Dr(e,r),l=[...Cr,...t.properties],c={};Object.keys(o).forEach(e=>{const t=o[e];L(t)||""===t||"$user_state"===e&&"anonymous"!==t&&"identified"!==t||(c[e]=t)});const u="distinct_id"in c||"anonymous"===c.$user_state||"identified"===c.$user_state;if(Object.keys(c).length>0){var n;const e=s[Ki],r=null!==(n=s.$user_state)&&void 0!==n?n:Wn;i.forEach(e=>{if(-1!==l.indexOf(e)&&!(e in o)&&(u||"distinct_id"!==e&&"$user_state"!==e)){const i=s[e];(t.isValid||-1===Cr.indexOf(e)||!1!==i&&0!==i)&&delete s[e]}}),!u||"$user_state"in o||"$user_state"in s||(s[Ln]=Wn),!u||("distinct_id"in c?c[Ki]:s[Ki])===e&&("$user_state"in c?c[Ln]:s[Ln])===r||(Ar.forEach(e=>delete s[e]),"identified"===c.$user_state&&"distinct_id"in c?s.$user_id=c[Ki]:delete s.$user_id,"identified"!==c.$user_state&&(delete s[Sn],delete s[On]),delete s.__alias)}a=or(s,c)}else a=or(o,s);return Sr.At(e,a),a}catch(e){}return null},At(i,n,r,o,s,a){const l=Sr.At(i,n,void 0,void 0,a);try{const c=kr(n,e);if(Object.keys(c).length){if(t){const t=$r(i),u=Rr(c,e);if(Ir.At(t,u,r,o,s,a),Ir.Ot(t)!==JSON.stringify(u)){Ir.Lt(t,o);const e=kr(n);return Ir.At(i,e,r,o,s,a),l}}Ir.At(i,c,r,o,s,a)}}catch(i){Sr.Pt(i)}return l},Lt(e,t){try{null==n||n.localStorage.removeItem(e),Ir.Lt(e,t),Ir.Lt($r(e),t)}catch(e){Sr.Pt(e)}}})})(e.cookie_persisted_properties||[],e.cookieWinsOnConflict);let i,r=!1,o=!1;const s=e.persistence.toLowerCase();return"localstorage"===s&&Sr.Et()?(i=Sr,o=!0):"localstorage+cookie"===s&&t.Et()?(i=t,o=!0,r=!0):"sessionstorage"===s&&Fr.Et()?i=Fr:"memory"===s?i=Mr:"cookie"===s&&Ir.Et()?(i=Ir,r=!0):t.Et()?(i=t,o=!0,r=!0):Ir.Et()?(i=Ir,r=!0):i=Mr,this.Vo=o,this.Go=r,i}hl(e){return`${this.rl}__${e}`}ll(e){return this.Vo&&!!e.split_storage}properties(){const e={};return rr(this.props,(t,i)=>{const n=Uo(i);if(!n||"event"===n.exposure){var r;if(null==n||null===(r=n.shouldSkipFromEventProperties)||void 0===r?void 0:r.call(n,t))return;e[i]=t}}),e}load(e=!1){if(this.pi&&!e)return;const t=this.Mr.cookieWinsOnConflict&&"localstorage+cookie"===this.Mr.persistence.toLowerCase(),i=t?Sr.Dt(this.rl):null;let n={};if(t)try{n=Pr(Ir.Dt(this.rl)),rr(n,(e,t)=>{(R(e)||L(e)||""===e)&&delete n[t]})}catch(e){}const r=this.Fo.Dt(this.rl);if(r&&(this.props=or({},r)),this.Zo&&this.Dl(),t&&r){var o,s;const e=null==i?void 0:i[Ki],t=null!==(o=null==i?void 0:i.$user_state)&&void 0!==o?o:Wn,a=r[Ki],l=null!==(s=r.$user_state)&&void 0!==s?s:Wn;if(a!==e||l!==t){this.Qo=!0,Fr.At(cs(this.rl),!0);const i=or({},this.props);Ar.forEach(e=>delete i[e]),"anonymous"!==l||"identified"!==t&&"anonymous"!==n.$user_state&&(R(e)||a===e)||(gs(i,n),delete i[On]),this.props=i;const r=new Set;Ar.forEach(e=>{var t;const i=null===(t=Uo(e))||void 0===t?void 0:t.storageGroup;i&&r.add(i)}),r.forEach(e=>{const t={};rr(this.props,(i,n)=>{var r;(null===(r=Uo(n))||void 0===r?void 0:r.storageGroup)===e&&(t[n]=i)}),x(t)?(Sr.Lt(this.hl(e)),this.Wo[e]={}):Sr.At(this.hl(e),t)&&(this.Wo[e]={persisted:!0,fingerprint:this.yl(t,e)})})}}Fr.Ot(cs(this.rl))&&(this.Qo=!0)}Dl(){for(const e of No){const t=Sr.Dt(this.hl(e));if(t&&!x(t)){const i=this.vl(e);i.persisted=!0,this.Ll(e)||(i.fingerprint=this.yl(t,e)),this.Nl(e,t)||or(this.props,t)}}}Ll(e){return Object.keys(this.props).some(t=>{var i;return(null===(i=Uo(t))||void 0===i?void 0:i.storageGroup)===e})}Nl(e,t){const i=as[e];if(!i)return!1;const n=t[i],r=this.props[i];return U(n)&&U(r)&&r>n}refreshKey(e){var t;if(this.pi)return;if("$fbc_persistence"===e&&this.el)return;const i=this.Zo?null===(t=Uo(e))||void 0===t?void 0:t.storageGroup:void 0,n=i?Sr.Dt(this.hl(i)):this.Fo.Dt(this.rl);if(n&&e in n)this._l(e,n[e],!1);else{if(i){const t=this.Fo.Dt(this.rl);if(t&&e in t)return void this._l(e,t[e],!1)}this.wl(e,!1)}}save(){if(this.pi)return;const e=this.$l();e>0?R(this.Al)&&(this.Al=setTimeout(()=>{this.Al=void 0,this.Fl()},e)):this.Fl()}flush(){R(this.Al)||(clearTimeout(this.Al),this.Al=void 0,this.Fl())}Fl(e=!1){if(this.pi||this.Jo&&!e)return;e||(this.syncCookieProperties(),this.el||this.Mr.cookieWinsOnConflict&&"localstorage+cookie"===this.Mr.persistence.toLowerCase()||this.refreshKey(Zi));const t=!e&&!this.Xo;t||(this.tl=!1);const i=!!t&&this.kl();if(this.tl)return void(this.Mr.debug&&Fi.warn("skipping persistence write because storage belongs to a different distinct ID"));if(this.Zo)return this.ql(),void(i&&this.il.forEach(e=>e()));const n=this.jl(this.Fo,this.rl,this.props,ds);"written"===n&&this.Tl(this.props),"failed"!==n&&(this.Ko.clear(),this.Yo=!1,this.el=!1),i&&this.il.forEach(e=>e())}ql(){const{main:e,groups:t}=this.gl(),i=this.jl(this.Fo,this.rl,e,ds);"written"===i&&this.Tl(e),"failed"!==i&&(this.Yo=!1,this.el=!1,fs.forEach(e=>{var t;(null===(t=Uo(e))||void 0===t?void 0:t.storageGroup)||this.Ko.delete(e)}));for(const e of No){var n;const i=t[e];if(x(i)&&!(null===(n=this.Wo[e])||void 0===n?void 0:n.persisted)){fs.forEach(t=>{var i;(null===(i=Uo(t))||void 0===i?void 0:i.storageGroup)===e&&this.Ko.delete(t)});continue}const r=this.jl(Sr,this.hl(e),i,e);"failed"!==r&&fs.forEach(t=>{const i=Uo(t);(null==i?void 0:i.storageGroup)!==e||"written"!==r&&i.volatile||this.Ko.delete(t)})}}gl(){const e={},t={flags:{},surveys:{}};return rr(this.props,(i,n)=>{var r;const o=null===(r=Uo(n))||void 0===r?void 0:r.storageGroup;o?t[o][n]=i:e[n]=i}),{main:e,groups:t}}yl(e,t){if(t===ds)return JSON.stringify(e)+"|"+this.Bl+"|"+this.Hl+"|"+this.zl;const i={};return rr(e,(e,t)=>{var n;i[t]=(null===(n=Uo(t))||void 0===n?void 0:n.volatile)?"__volatile__":e}),JSON.stringify(i)}jl(e,t,i,n){const r=this.vl(n);if(n!==ds&&!r.dirty&&!R(r.fingerprint))return"skipped";let o;try{if(o=this.yl(i,n),o===r.fingerprint)return r.dirty=!1,"skipped"}catch(e){o=void 0}return e.At(t,i,this.Bl,this.Hl,this.zl,this.Mr.debug)?(r.dirty=!1,n!==ds&&(r.persisted=!0),R(o)||(r.fingerprint=o),this.Vo&&(r.storageValue=Sr.Ot(t)),"written"):(this.Mr.debug&&Fi.warn(`failed to persist storage entry "${t}"; will retry on next save`),"failed")}remove({keepGroupEntries:e=!1}={}){if(this.xl(),R(this.Al)||(clearTimeout(this.Al),this.Al=void 0),this.Fo.Lt(this.rl,!1),this.Fo.Lt(this.rl,!0),!e&&this.nl)for(const e of No)Sr.Lt(this.hl(e));e?delete this.Wo[ds]:this.Wo={},this.Il=void 0,this.Ml=void 0}clear(){this.remove(),this.props={}}register_once(e,t,i){if(k(e)){this.syncCookieProperties(),R(t)&&(t="None"),this.Bl=R(i)?this.Ul:i;let n=!1;if(rr(e,(e,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==t||(this._l(i,e),n=!0)}),n)return this.save(),!0}return!1}register(e,t){if(k(e)){this.syncCookieProperties(),this.Bl=R(t)?this.Ul:t;let i=!1;if(rr(e,(t,n)=>{e.hasOwnProperty(n)&&(this.props[n]!==t||k(t)||T(t))&&(this._l(n,t),i=!0)}),i)return this.save(),!0}return!1}unregister(e){this.syncCookieProperties();const t="string"==typeof e?[e]:e;let i=!1;for(const e of t)e in this.props&&(this.wl(e),i=!0);i&&this.save()}update_campaign_params(){const e=null==s?void 0:s.URL;if(e===this.sl)return;const t=Jo(this.Mr.custom_campaign_params,this.Mr.mask_personal_data_properties,this.Mr.custom_personal_data_properties),i=!x(lr(t));return i&&this.register(t),this.sl=e,i?t:void 0}update_search_keyword(){this.register(function(){const e=null==s?void 0:s.referrer;return e?Zo(e):{}}())}update_referrer_info(){var e;this.register_once({$referrer:is(),$referring_domain:(null==s?void 0:s.referrer)&&(null===(e=jo(s.referrer))||void 0===e?void 0:e.host)||ts},void 0)}set_initial_person_info(){if(this.props.$initial_campaign_params||this.props.$initial_referrer_info)return;const e=ns(this.Mr.mask_personal_data_properties,this.Mr.custom_personal_data_properties,this.Mr.disable_capture_url_hashes);this.register_once({[jn]:this.Go?{r:us(e.r),u:e.u?us(e.u):void 0}:e},void 0)}get_initial_props(){const e={};rr([Fn,Un],t=>{const i=this.props[t];i&&rr(i,(function(t,i){e["$initial_"+O(i)]=t}))});const t=this.props[jn];if(t){const i=function(e,t=!1){const i=rs(e,t),n={};return rr(i,(function(e,t){n[`$initial_${O(t)}`]=e})),n}(t,this.Mr.disable_capture_url_hashes);or(e,i)}return e}safe_merge(e){return rr(this.props,(function(t,i){i in e||(e[i]=t)})),e}update_config(e,t,i){const n=e.persistence!==t.persistence,r=!((e,t)=>{if(e.length!==t.length)return!1;const i=[...e].sort(),n=[...t].sort();return i.every((e,t)=>e===n[t])})(e.cookie_persisted_properties||[],t.cookie_persisted_properties||[]),o=n||r,s=e.cookieWinsOnConflict!==t.cookieWinsOnConflict,a=e.disable_persistence||!!i,l=!!this.pi&&!a;a||this.El(t,l),this.Mr=e,!a&&(n||r||s)&&(this.Il=void 0,this.Ml=void 0,this.El(mt(mt({},e),{},{cookie_persisted_properties:t.cookie_persisted_properties}),l));const c=o||s?this.ol(e):this.Fo;this.Wl();const u=this.ll(e),d=o||u!==this.Zo,f=!a&&(d||e.cross_subdomain_cookie!==this.Hl||e.secure_cookie!==this.zl)&&this.Pl(l);this.Xo=d;try{if(this.Ul=this.Bl=e.cookie_expiration,this.set_disabled(a),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),d){const e=this.props;this.clear(),this.Fo=c,this.Zo=u,this.props=e,this.save()}else s&&(this.Fo=c,a||(delete this.Wo[ds],this.Fl()))}finally{this.Xo=!1,f&&this.Ol()}}Wl(){const e=this.props[jn];if(!this.Go||!k(e)||"string"!=typeof e.r)return;const t=us(e.r),i="string"==typeof e.u?us(e.u):e.u;t===e.r&&i===e.u||this._l(jn,mt(mt({},e),{},{r:t,u:i}))}set_disabled(e){this.pi=e,this.pi?this.remove():this.save()}set_cross_subdomain(e){e!==this.Hl&&(this.Hl=e,this.remove({keepGroupEntries:!0}),this.save())}set_secure(e){e!==this.zl&&(this.zl=e,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(e,t){const i=this.props.__timers||{};i[e]=t,this._l(Qi,i),this.save()}remove_event_timer(e){const t=this.props.__timers||{},i=t[e];return R(i)||(delete t[e],this._l(Qi,t),this.save()),i}get_property(e){return this.props[e]}set_property(e,t){this._l(e,t),this.save()}_l(e,t,i=!0){var n;const r=this.props[e];this.props[e]=t,i&&("distinct_id"!==e&&"$user_state"!==e||r===t||(this.Yo=!0),"$fbc_persistence"!==e||ps(r,t)||(this.el=!0),this.Cl(e,r,t),(null===(n=Uo(e))||void 0===n?void 0:n.volatile)||this.Sl(e))}wl(e,t=!0){delete this.props[e],t&&(hs(e)&&this.dl(e,!0),"$fbc_persistence"===e&&(this.el=!0),this.Sl(e))}Sl(e){var t;const i=null===(t=Uo(e))||void 0===t?void 0:t.storageGroup;i&&(this.vl(i).dirty=!0)}vl(e){return this.Wo[e]||(this.Wo[e]={})}};const _s="gzip-js",ys="base64",bs="events",Es="cancelEvents",ws="popover",Is="api",Os="widget",Ss="survey shown",As="survey dismissed",Cs="survey sent",$s="$survey_id",Ts="$survey_iteration",Ps="$survey_last_seen_date",ks="popover",xs="inline";function Rs(e){let t=!0;return{dispose(){if(t){t=!1;const i=e();i&&P(i.then)&&i.then(void 0,()=>{})}}}}const Ds="product tour shown",Ns="$product_tour_last_seen_date",Ls="$product_tour_type",Ms=ji("[RateLimiter]");const Us=ji("[RemoteConfig]");var Fs=class{constructor(e){this._instance=e}get remoteConfig(){var e;return null===(e=v._POSTHOG_REMOTE_CONFIG)||void 0===e||null===(e=e[this._instance.config.token])||void 0===e?void 0:e.config}Ql(e){var t,i,n;(null===(t=v.__PosthogExtensions__)||void 0===t?void 0:t.loadExternalDependency)?null===(i=v.__PosthogExtensions__)||void 0===i||null===(n=i.loadExternalDependency)||void 0===n||n.call(i,this._instance,"remote-config",()=>e(this.remoteConfig)):e()}Jl(e){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets",`/array/${this._instance.config.token}/config`),callback:e})}load(){try{if(this.remoteConfig)return Us.info("Using preloaded remote config",this.remoteConfig),void this.Kl(this.remoteConfig);if(this._instance.Xl())return void Us.warn("Remote config is disabled. Falling back to local config.");this.Ql(e=>{if(!e)return Us.info("No config found after loading remote JS config. Falling back to JSON."),void this.Jl(e=>{this.Kl(e.json,e)});this.Kl(e)})}catch(e){Us.error("Error loading remote config",e),this.Kl()}}Kl(e,t){!e&&t&&(0===t.statusCode?t.error||Us.warn("Failed to fetch remote config from PostHog."):Us.error("Failed to fetch remote config from PostHog."));try{this._instance.Kl(e?{ok:!0,config:e}:{ok:!1})}catch(e){Us.error("Error applying remote config",e)}if(!1!==(null==e?void 0:e.hasFeatureFlags)&&!this._instance.config.advanced_disable_feature_flags_on_first_load)try{var i;null===(i=this._instance.featureFlags)||void 0===i||i.ensureFlagsLoaded()}catch(e){Us.error("Error loading feature flags",e)}}};var js=Uint8Array,Vs=Uint16Array,Bs=Uint32Array,Gs=new js([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),qs=new js([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Hs=new js([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),zs=function(e,t){for(var i=new Vs(31),n=0;31>n;++n)i[n]=t+=1<<e[n-1];var r=new Bs(i[30]);for(n=1;30>n;++n)for(var o=i[n];i[n+1]>o;++o)r[o]=o-i[n]<<5|n;return[i,r]},Ks=zs(Gs,2),Ws=Ks[1];Ks[0][28]=258,Ws[258]=28;for(var Ys=zs(qs,0)[1],Js=new Vs(32768),Xs=0;32768>Xs;++Xs){var Zs=(43690&Xs)>>>1|(21845&Xs)<<1;Js[Xs]=((65280&(Zs=(61680&(Zs=(52428&Zs)>>>2|(13107&Zs)<<2))>>>4|(3855&Zs)<<4))>>>8|(255&Zs)<<8)>>>1}var Qs=function(e,t,i){for(var n=e.length,r=0,o=new Vs(t);n>r;++r)++o[e[r]-1];var s,a=new Vs(t);for(r=0;t>r;++r)a[r]=a[r-1]+o[r-1]<<1;if(i){s=new Vs(1<<t);var l=15-t;for(r=0;n>r;++r)if(e[r])for(var c=r<<4|e[r],u=t-e[r],d=a[e[r]-1]++<<u,f=d|(1<<u)-1;f>=d;++d)s[Js[d]>>>l]=c}else for(s=new Vs(n),r=0;n>r;++r)s[r]=Js[a[e[r]-1]++]>>>15-e[r];return s},ea=new js(288);for(Xs=0;144>Xs;++Xs)ea[Xs]=8;for(Xs=144;256>Xs;++Xs)ea[Xs]=9;for(Xs=256;280>Xs;++Xs)ea[Xs]=7;for(Xs=280;288>Xs;++Xs)ea[Xs]=8;var ta=new js(32);for(Xs=0;32>Xs;++Xs)ta[Xs]=5;var ia=Qs(ea,9,0),na=Qs(ta,5,0),ra=function(e){return(e/8|0)+(7&e&&1)},oa=function(e,t,i){(null==t||0>t)&&(t=0),(null==i||i>e.length)&&(i=e.length);var n=new(e instanceof Vs?Vs:e instanceof Bs?Bs:js)(i-t);return n.set(e.subarray(t,i)),n},sa=function(e,t,i){var n=t/8|0;e[n]|=i<<=7&t,e[n+1]|=i>>>8},aa=function(e,t,i){var n=t/8|0;e[n]|=i<<=7&t,e[n+1]|=i>>>8,e[n+2]|=i>>>16},la=function(e,t){for(var i=[],n=0;e.length>n;++n)e[n]&&i.push({s:n,f:e[n]});var r=i.length,o=i.slice();if(!r)return[new js(0),0];if(1==r){var s=new js(i[0].s+1);return s[i[0].s]=1,[s,1]}i.sort((function(e,t){return e.f-t.f})),i.push({s:-1,f:25001});var a=i[0],l=i[1],c=0,u=1,d=2;for(i[0]={s:-1,f:a.f+l.f,l:a,r:l};u!=r-1;)a=i[i[d].f>i[c].f?c++:d++],l=i[c!=u&&i[d].f>i[c].f?c++:d++],i[u++]={s:-1,f:a.f+l.f,l:a,r:l};var f=o[0].s;for(n=1;r>n;++n)o[n].s>f&&(f=o[n].s);var h=new Vs(f+1),p=ca(i[u-1],h,0);if(p>t){n=0;var v=0,g=p-t,m=1<<g;for(o.sort((function(e,t){return h[t.s]-h[e.s]||e.f-t.f}));r>n;++n){var _=o[n].s;if(t>=h[_])break;v+=m-(1<<p-h[_]),h[_]=t}for(v>>>=g;v>0;){var y=o[n].s;t>h[y]?v-=1<<t-h[y]++-1:++n}for(;n>=0&&v;--n){var b=o[n].s;h[b]==t&&(--h[b],++v)}p=t}return[new js(h),p]},ca=function(e,t,i){return-1==e.s?Math.max(ca(e.l,t,i+1),ca(e.r,t,i+1)):t[e.s]=i},ua=function(e){for(var t=e.length;t&&!e[--t];);for(var i=new Vs(++t),n=0,r=e[0],o=1,s=function(e){i[n++]=e},a=1;t>=a;++a)if(e[a]==r&&a!=t)++o;else{if(!r&&o>2){for(;o>138;o-=138)s(32754);o>2&&(s(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(s(r),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0)}for(;o--;)s(r);o=1,r=e[a]}return[i.subarray(0,n),t]},da=function(e,t){for(var i=0,n=0;t.length>n;++n)i+=e[n]*t[n];return i},fa=function(e,t,i){var n=i.length,r=ra(t+2);e[r]=255&n,e[r+1]=n>>>8,e[r+2]=255^e[r],e[r+3]=255^e[r+1];for(var o=0;n>o;++o)e[r+o+4]=i[o];return 8*(r+4+n)},ha=function(e,t,i,n,r,o,s,a,l,c,u){sa(t,u++,i),++r[256];for(var d=la(r,15),f=d[0],h=d[1],p=la(o,15),v=p[0],g=p[1],m=ua(f),_=m[0],y=m[1],b=ua(v),E=b[0],w=b[1],I=new Vs(19),O=0;_.length>O;++O)I[31&_[O]]++;for(O=0;E.length>O;++O)I[31&E[O]]++;for(var S=la(I,7),A=S[0],C=S[1],$=19;$>4&&!A[Hs[$-1]];--$);var T,P,k,x,R=c+5<<3,D=da(r,ea)+da(o,ta)+s,N=da(r,f)+da(o,v)+s+14+3*$+da(I,A)+(2*I[16]+3*I[17]+7*I[18]);if(D>=R&&N>=R)return fa(t,u,e.subarray(l,l+c));if(sa(t,u,1+(D>N)),u+=2,D>N){T=Qs(f,h,0),P=f,k=Qs(v,g,0),x=v;var L=Qs(A,C,0);for(sa(t,u,y-257),sa(t,u+5,w-1),sa(t,u+10,$-4),u+=14,O=0;$>O;++O)sa(t,u+3*O,A[Hs[O]]);u+=3*$;for(var M=[_,E],U=0;2>U;++U){var F=M[U];for(O=0;F.length>O;++O)sa(t,u,L[j=31&F[O]]),u+=A[j],j>15&&(sa(t,u,F[O]>>>5&127),u+=F[O]>>>12)}}else T=ia,P=ea,k=na,x=ta;for(O=0;a>O;++O)if(n[O]>255){var j;aa(t,u,T[257+(j=n[O]>>>18&31)]),u+=P[j+257],j>7&&(sa(t,u,n[O]>>>23&31),u+=Gs[j]);var V=31&n[O];aa(t,u,k[V]),u+=x[V],V>3&&(aa(t,u,n[O]>>>5&8191),u+=qs[V])}else aa(t,u,T[n[O]]),u+=P[n[O]];return aa(t,u,T[256]),u+P[256]},pa=new Bs([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),va=(new js(0),function(){for(var e=new Bs(256),t=0;256>t;++t){for(var i=t,n=9;--n;)i=(1&i&&3988292384)^i>>>1;e[t]=i}return e}()),ga=function(e,t,i){for(;i;++t)e[t]=i,i>>>=8};const ma=!!c||!!l,_a=new WeakMap,ya="text/plain";let ba=!1;const Ea=(e,t)=>{const[i,n]=e.split("#"),[r,o]=i.split("?");if(!o)return e;const s=o.split("&").filter(e=>e.split("=")[0]!==t).join("&");return`${r}${s?`?${s}`:""}${n?`#${n}`:""}`},wa=(e,t,i=!0)=>{var n;const[r,o]=e.split("?"),s=mt({},t),a=null!==(n=null==o?void 0:o.split("&").map(e=>{var t;const[n,r]=e.split("="),o=i&&null!==(t=s[n])&&void 0!==t?t:r;return delete s[n],`${n}=${o}`}))&&void 0!==n?n:[],l=function(e,t="&"){let i,n;const r=[];return rr(e,(function(e,t){R(e)||R(t)||"undefined"===t||(i=encodeURIComponent((e=>e instanceof File)(e)?e.name:e.toString()),n=encodeURIComponent(t),r[r.length]=n+"="+i)})),r.join(t)}(s);return l&&a.push(l),a.length>0?`${r}?${a.join("&")}`:r},Ia=e=>{if(e.Yl)return e.Yl;const{data:t,compression:i}=e;if(!t)return;if(i===_s){const e=function(e,t){void 0===t&&(t={});var i=function(){var e=4294967295;return{p(t){for(var i=e,n=0;t.length>n;++n)i=va[255&i^t[n]]^i>>>8;e=i},d:()=>4294967295^e}}(),n=e.length;i.p(e);var r,o,s,a,l=(a=10+((r=t).filename&&r.filename.length+1||0),8,function(e,t,i,n,r,o){var s=e.length,a=new js(n+s+5*(1+Math.floor(s/7e3))+8),l=a.subarray(n,a.length-8),c=0;if(!t||8>s)for(var u=0;s>=u;u+=65535){var d=u+65535;s>d?c=fa(l,c,e.subarray(u,d)):(l[u]=!0,c=fa(l,c,e.subarray(u,s)))}else{for(var f=pa[t-1],h=f>>>13,p=8191&f,v=(1<<i)-1,g=new Vs(32768),m=new Vs(v+1),_=Math.ceil(i/3),y=2*_,b=function(t){return(e[t]^e[t+1]<<_^e[t+2]<<y)&v},E=new Bs(25e3),w=new Vs(288),I=new Vs(32),O=0,S=0,A=(u=0,0),C=0,$=0;s>u;++u){var T=b(u),P=32767&u,k=m[T];if(g[P]=k,m[T]=P,u>=C){var x=s-u;if((O>7e3||A>24576)&&x>423){c=ha(e,l,0,E,w,I,S,A,$,u-$,c),A=O=S=0,$=u;for(var R=0;286>R;++R)w[R]=0;for(R=0;30>R;++R)I[R]=0}var D=2,N=0,L=p,M=P-k&32767;if(x>2&&T==b(u-M))for(var U=Math.min(h,x)-1,F=Math.min(32767,u),j=Math.min(258,x);F>=M&&--L&&P!=k;){if(e[u+D]==e[u+D-M]){for(var V=0;j>V&&e[u+V]==e[u+V-M];++V);if(V>D){if(D=V,N=M,V>U)break;var B=Math.min(M,V-2),G=0;for(R=0;B>R;++R){var q=u-M+R+32768&32767,H=q-g[q]+32768&32767;H>G&&(G=H,k=q)}}}M+=(P=k)-(k=g[P])+32768&32767}if(N){E[A++]=268435456|Ws[D]<<18|Ys[N];var z=31&Ws[D],K=31&Ys[N];S+=Gs[z]+qs[K],++w[257+z],++I[K],C=u+D,++O}else E[A++]=e[u],++w[e[u]]}}c=ha(e,l,!0,E,w,I,S,A,$,u-$,c)}return oa(a,0,n+ra(c)+8)}(o=e,null==(s=t).level?6:s.level,null==s.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(o.length)))):12+s.mem,a)),c=l.length;return function(e,t){var i=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=2>t.level?4:9==t.level?2:0,e[9]=3,0!=t.mtime&&ga(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),i){e[3]=8;for(var n=0;i.length>=n;++n)e[n+10]=i.charCodeAt(n)}}(l,t),ga(l,c-8,i.d()),ga(l,c-4,n),l}(function(e){var t=e.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var i=new js(e.length+(e.length>>>1)),n=0,r=function(e){i[n++]=e},o=0;t>o;++o){if(n+5>i.length){var s=new js(n+8+(t-o<<1));s.set(i),i=s}var a=e.charCodeAt(o);128>a?r(a):2048>a?(r(192|a>>>6),r(128|63&a)):a>55295&&57344>a?(r(240|(a=65536+(1047552&a)|1023&e.charCodeAt(++o))>>>18),r(128|a>>>12&63),r(128|a>>>6&63),r(128|63&a)):(r(224|a>>>12),r(128|a>>>6&63),r(128|63&a))}return oa(i,0,n)}(Fo(t)),{mtime:0});return{contentType:ya,body:e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength),estimatedSize:e.byteLength}}if(i===ys){const e=(e=>"data="+encodeURIComponent("string"==typeof e?e:Fo(e)))(function(e){return e?btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,(e,t)=>String.fromCharCode(parseInt(t,16)))):e}(Fo(t)));return{contentType:"application/x-www-form-urlencoded",body:e,estimatedSize:new Blob([e]).size}}const n=Fo(t);return{contentType:"application/json",body:n,estimatedSize:new Blob([n]).size}},Oa=e=>{const t=()=>"sendBeacon"===e.transport?{url:wa(e.url,{compression:ys}),encodedBody:Ia(mt(mt({},e),{},{compression:ys,Yl:void 0}))}:{url:Ea(e.url,"compression"),encodedBody:Ia(mt(mt({},e),{},{compression:void 0,Yl:void 0}))};let i;try{i=Ia(e)}catch(i){if(ai(e.compression,Vo(e.url,"compression")))return Fi.error("Failed to gzip request body, sending uncompressed payload",i),t();throw i}return i&&ai(e.compression,Vo(e.url,"compression"))&&!((n=i.body)instanceof ArrayBuffer?si(new Uint8Array(n)):ArrayBuffer.isView(n)&&si(new Uint8Array(n.buffer,n.byteOffset,n.byteLength)))?(ba=!0,t()):{url:e.url,encodedBody:i};var n},Sa=e=>{try{return Oa(e)}catch(i){var t;return Fi.error(i),void(null===(t=e.callback)||void 0===t||t.call(e,{statusCode:0,error:i}))}},Aa=function(){var e=Z((function*(e){const t=yield function(e){return hi.apply(this,arguments)}(Fo(e.data),zi.DEBUG,{rethrow:!0});if(!t)return e;const i=yield t.arrayBuffer();return mt(mt({},e),{},{Yl:{contentType:ya,body:i,estimatedSize:i.byteLength}})}));return function(t){return e.apply(this,arguments)}}(),Ca=/Failed to fetch|NetworkError|Load failed/i,$a=e=>"TypeError"===(null==e?void 0:e.name)&&Ca.test((null==e?void 0:e.message)||""),Ta=e=>{const t=Sa(e);if(!t)return;const i=new c;_a.set(i,!0);const{url:n,encodedBody:r}=t;i.open(e.method||"GET",n,!0);const{contentType:o,body:s}=null!=r?r:{};rr(e.headers,(function(e,t){i.setRequestHeader(t,e)})),o&&i.setRequestHeader("Content-Type",o),e.timeout&&(i.timeout=e.timeout),i.onreadystatechange=()=>{if(4===i.readyState){var t;const n={statusCode:i.status,text:i.responseText};if(200===i.status)try{n.json=JSON.parse(i.responseText)}catch(e){}null===(t=e.callback)||void 0===t||t.call(e,n)}},i.send(s)},Pa=e=>{const t=Sa(e);if(!t)return;const{url:i,encodedBody:n}=t,{contentType:r,body:o,estimatedSize:s}=null!=n?n:{},a=new Headers;rr(e.headers,(function(e,t){a.append(t,e)})),r&&a.append("Content-Type",r);let c=null,d=!1;if(u){const t=new u;c={signal:t.signal,timeout:setTimeout(()=>{var i;d=!0,t.abort(rt("AbortError","PostHog request timed out"+((i=e.timeout)?` after ${i}ms`:"")))},e.timeout)}}const f=t=>{var i;d&&"AbortError"===(null==t?void 0:t.name)||$a(t)?Fi.warn(t):Fi.error(t),null===(i=e.callback)||void 0===i||i.call(e,{statusCode:0,error:t})};try{l(i,mt({method:(null==e?void 0:e.method)||"GET",headers:a,keepalive:"POST"===e.method&&!e.ta&&52428.8>(s||0),body:o,signal:null==c?void 0:c.signal},e.fetchOptions)).then(t=>t.text().then(i=>{var n;const r={statusCode:t.status,text:i};if(200===t.status)try{r.json=JSON.parse(i)}catch(e){Fi.error(e)}null===(n=e.callback)||void 0===n||n.call(e,r)})).catch(f).finally(()=>c?clearTimeout(c.timeout):null)}catch(e){c&&clearTimeout(c.timeout),f(e)}},ka=e=>{try{var t;const{url:i,encodedBody:n}=Oa(e),{contentType:r,body:s,estimatedSize:a}=null!=n?n:{};if(!s)return;const c=s instanceof Blob?s:new Blob([s],{type:r});if(o.sendBeacon(i,c))return;const u=T(e.data)?e.data:null===(t=e.data)||void 0===t?void 0:t.batch;if(T(u)&&u.length>1&&(null!=a?a:0)>16384){const t=Math.ceil(u.length/2),i=t=>T(e.data)?t:mt(mt({},e.data),{},{batch:t});return ka(mt(mt({},e),{},{data:i(u.slice(0,t))})),void ka(mt(mt({},e),{},{data:i(u.slice(t))}))}Fi.warn(`Beacon of ~${null!=a?a:0} bytes was rejected by the browser, falling back to ${l?"fetch":"XHR"}`),l?Pa(mt(mt({},e),{},{ta:!0})):Ta(e)}catch(e){Fi.warn("Beacon send failed",e)}},xa=(e,t,i,n)=>{const r="query"===n?"POST"===t?"sent_at":"_":void 0;return wa(i===_s?Ea(e,"compression"):e,mt(mt({},r?{[r]:Date.now().toString()}:{}),i===_s?{}:{compression:i}))},Ra=(()=>{const e=[];return l&&e.push({transport:"fetch",method:Pa}),c&&e.push({transport:"XHR",method:Ta}),(null==o?void 0:o.sendBeacon)&&e.push({transport:"sendBeacon",method:ka}),e})();const Da=["retriesPerformedSoFar"];var Na=class{constructor(e){this._instance=e,this.ya=()=>{var e,t,i,n;this.ba||(this.ba={});const r=this.scrollElement(),o=this.scrollY(),s=r?Math.max(0,r.scrollHeight-r.clientHeight):0,a=o+((null==r?void 0:r.clientHeight)||0),l=(null==r?void 0:r.scrollHeight)||0;this.ba.lastScrollY=Math.ceil(o),this.ba.maxScrollY=Math.max(o,null!==(e=this.ba.maxScrollY)&&void 0!==e?e:0),this.ba.maxScrollHeight=Math.max(s,null!==(t=this.ba.maxScrollHeight)&&void 0!==t?t:0),this.ba.lastContentY=a,this.ba.maxContentY=Math.max(a,null!==(i=this.ba.maxContentY)&&void 0!==i?i:0),this.ba.maxContentHeight=Math.max(l,null!==(n=this.ba.maxContentHeight)&&void 0!==n?n:0)}}get _a(){return this._instance.config.scroll_root_selector}getContext(){return this.ba}resetContext(){const e=this.ba;return this.ba=void 0,setTimeout(this.ya,0),e}startMeasuringScrollPosition(){fr(n,"scroll",this.ya,{capture:!0}),fr(n,"scrollend",this.ya,{capture:!0}),fr(n,"resize",this.ya)}scrollElement(){var e;if(!this._a)return null==n||null===(e=n.document)||void 0===e?void 0:e.documentElement;{const e=T(this._a)?this._a:[this._a];for(const i of e){var t;const e=null==n||null===(t=n.document)||void 0===t?void 0:t.querySelector(i);if(e)return e}}}wa(e){var t,i;const r="y"===e?"scrollTop":"scrollLeft";if(this._a){const e=this.scrollElement();return e&&e[r]||0}return n?"y"===e?n.scrollY||n.pageYOffset||(null===(t=n.document)||void 0===t||null===(t=t.documentElement)||void 0===t?void 0:t.scrollTop)||0:n.scrollX||n.pageXOffset||(null===(i=n.document)||void 0===i||null===(i=i.documentElement)||void 0===i?void 0:i.scrollLeft)||0:0}scrollY(){return this.wa("y")}scrollX(){return this.wa("x")}};const La=e=>ns(null==e?void 0:e.config.mask_personal_data_properties,null==e?void 0:e.config.custom_personal_data_properties,null==e?void 0:e.config.disable_capture_url_hashes);var Ma=class{constructor(e,t,i,n){this.je=e=>{const t=this.ka();if(t&&t.sessionId===e)return;const i={sessionId:e,props:this.Sa(this._instance)};this.xa.register({[Mn]:i})},this._instance=e,this.Ca=t,this.xa=i,this.Sa=n||La,this.Ca.onSessionId(this.je)}ka(){return this.xa.props[Mn]}getSetOnceProps(){var e;const t=null===(e=this.ka())||void 0===e?void 0:e.props;return t?"r"in t?rs(t,this._instance.config.disable_capture_url_hashes):{$referring_domain:t.referringDomain,$pathname:t.initialPathName,utm_source:t.utm_source,utm_campaign:t.utm_campaign,utm_medium:t.utm_medium,utm_content:t.utm_content,utm_term:t.utm_term}:{}}getSessionProps(){const e={};return rr(lr(this.getSetOnceProps()),(t,i)=>{"$current_url"===i&&(i="url"),e[`$session_entry_${O(i)}`]=t}),e}},Ua=class{on(e,t){return this.$a[e]||(this.$a[e]=[]),this.$a[e].push(t),()=>{this.$a[e]=this.$a[e].filter(e=>e!==t)}}emit(e,t){for(const i of this.$a[e]||[])i(t);for(const i of this.$a["*"]||[])i(e,t)}constructor(){this.$a={}}};const Fa=ji("[SessionId]");var ja=class{on(e,t){return this.Ta.on(e,t)}constructor(e,t,i){var n;if(this.Ia=null,this.Ma=null,this.Ea=[],this.Pa=void 0,this.Ra=!1,this.Ta=new Ua,this.Aa=(e,t)=>!(!F(e)||!F(t))&&Math.abs(e-t)>this.sessionTimeoutMs,!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if("always"===e.config.cookieless_mode)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Mr=e.config,this.xa=e.persistence,this.Be=void 0,this.Xt=void 0,this._sessionStartTimestamp=null,this.Fa=void 0,this._sessionActivityTimestamp=null,this.Oa=t||_r,this.Da=i||_r;const r=this.Mr.persistence_name||this.Mr.token;if(this._sessionTimeoutMs=1e3*te(this.Mr.session_idle_timeout_seconds||1800,60,36e3,Fa.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.La(),this.Na="ph_"+r+"_window_id",this.qa="ph_"+r+"_primary_window_exists",this.ja()){const e=Fr.Dt(this.Na),t=Fr.Dt(this.qa);e&&!t?this.Be=e:Fr.Lt(this.Na),Fr.At(this.qa,!0)}(null===(n=this.Mr.bootstrap)||void 0===n?void 0:n.sessionID)&&this.setBootstrapSessionId(this.Mr.bootstrap.sessionID),this.Ba()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return R(this.Ea)&&(this.Ea=[]),this.Ea.push(e),this.Xt&&e(this.Xt,this.Be),()=>{this.Ea=this.Ea.filter(t=>t!==e)}}ja(){return"memory"!==this.Mr.persistence&&!this.xa.pi&&Fr.Et()}Ha(e){e!==this.Be&&(this.Be=e,this.ja()&&Fr.At(this.Na,e))}za(){return this.Be?this.Be:this.ja()?Fr.Dt(this.Na):null}Ua(e){const t=this.Ia;return!L(t)&&!L(e)&&5e3>Math.abs(e-t)}Wa(e,t,i){const n=t!==this._sessionActivityTimestamp,r=!(e!==this.Xt||i!==this._sessionStartTimestamp);this._sessionStartTimestamp=i,this._sessionActivityTimestamp=t,this.Xt=e,r&&!n||r&&this.Ua(t)||(this.Ia=t,this.xa.register({[fn]:[t,e,i]}))}Va(){var e;const t=null===(e=this.Mr)||void 0===e?void 0:e.persistence_save_debounce_ms;return F(t)&&t>0}Ga(){this.Va()?this.xa.refreshKey(fn):(this.xa.flush(),this.xa.load())}Za(){var e;if(L(this._sessionActivityTimestamp)||this._sessionActivityTimestamp===this.Ia)return;this.Ga();const[,t,i]=this.Qa();t===this.Xt&&i===this._sessionStartTimestamp&&(this.Ia=this._sessionActivityTimestamp,this.xa.register({[fn]:[this._sessionActivityTimestamp,null!==(e=this.Xt)&&void 0!==e?e:null,this._sessionStartTimestamp]}),this.xa.flush())}Ja(){const[e]=this.Qa(),t=F(e)?e:0,i=F(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(t,i)}Ka(e){return this.Ga(),this.Aa(e,this.Ja())}Qa(){const e=this.xa.props[fn];return T(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.Ia=null,this.Fa=void 0,clearTimeout(this.Xa),this.Xa=void 0,this.Wa(null,null,null)}setBootstrapSessionId(e,t=!1){const i=((e,t=(new Date).getTime())=>{try{const i=(e=>{const t=e.replace(/-/g,"");if(32!==t.length)throw new Error("Not a valid UUID");if("7"!==t[12])throw new Error("Not a UUIDv7");return parseInt(t.substring(0,12),16)})(e);return i>t+6e4?void Fa.error("Bootstrap sessionID cannot be in the future"):i}catch(e){return void Fa.error("Invalid sessionID in bootstrap",e)}})(e);return!R(i)&&(t?this.Fa={sessionId:e,sessionStartTimestamp:i}:this.Wa(e,(new Date).getTime(),i),!0)}destroy(){this.Ra=!0,this.Za(),clearTimeout(this.Xa),this.Xa=void 0,this.Pa&&n&&(n.removeEventListener(Zn,this.Pa,{capture:!1}),this.Pa=void 0),this.Ea=[]}Ba(){this.Pa=()=>{this.Za(),this.ja()&&Fr.Lt(this.qa)},fr(n,Zn,this.Pa,{capture:!1})}checkAndGetSessionAndWindowId(e=!1,t=null,i=!1){if("always"===this.Mr.cookieless_mode)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');const n=t||(new Date).getTime(),r=this.Xt;if(i)this.Ma=n;else if(L(this.Ma)||this.Ma>n||n-this.Ma>=1e3){var o,s;null===(o=(s=this.xa).syncCookieProperties)||void 0===o||o.call(s),this.Ma=n}let[,a,l]=this.Qa();const c=!R(r)&&a!==r,u=this.Ja();let d=this.za();const f=this.Fa,h=!!f&&(f.sessionStartTimestamp>n+6e4||n-f.sessionStartTimestamp>864e5),p=f?h:F(l)&&Math.abs(n-l)>864e5;let v=!1,g=c;const m=!a||!!f,_=a;let y=!m&&!e&&this.Aa(n,u);if(y&&(y=this.Ka(n),y||Fa.info("cross-tab refresh kept the session alive",{sessionId:a}),[,a,l]=this.Qa()),m||y||p){g=!1;const e=f&&!h;a=e?f.sessionId:this.Oa(),d=this.Da(),Fa.info("new session ID assigned",{sessionId:a,windowId:d,bootstrapped:!!e,changeReason:{noSessionId:m,activityTimeout:y,sessionPastMaximumLength:p}}),l=e?f.sessionStartTimestamp:n,this.Fa=void 0,v=!0}else d||(d=this.Da(),v=!0),g=g||a!==_,g&&(Fa.info("adopted cross-tab session id",{sessionId:a,windowId:d}),v=!0);const b=F(u)&&e&&!p?u:n,E=F(l)?l:(new Date).getTime();this.Ha(d),this.Wa(a,b,E),e||this.La();const w={noSessionId:m,activityTimeout:y,sessionPastMaximumLength:p,crossTabAdoption:g};return v&&this.Ea.forEach(e=>e(a,d,w)),{sessionId:a,windowId:d,sessionStartTimestamp:E,changeReason:v?w:void 0,lastActivityTimestamp:u}}La(){this.Ra||(clearTimeout(this.Xa),this.Xa=setTimeout(()=>{if(!this.Ra)if(this.Ka((new Date).getTime())){const e=this.Xt;this.resetSessionId(),this.Ta.emit("forcedIdleReset",{idleSessionId:e})}else this.La()},1.1*this.sessionTimeoutMs))}};const Va=function(e,t){if(!e)return!1;const i=e.userAgent;if(i&&ee(i,t))return!0;try{const i=null==e?void 0:e.userAgentData;if((null==i?void 0:i.brands)&&i.brands.some(e=>ee(null==e?void 0:e.brand,t)))return!0}catch(e){}return!!e.webdriver};function Ba(){return(Ba=Z((function*(){const e=null==o?void 0:o.userAgentData;if(null==e?void 0:e.getHighEntropyValues)try{const t=yield e.getHighEntropyValues(["model"]),i=null==t?void 0:t.model;return D(i)&&i.length>0?i:void 0}catch(e){return void Fi.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",e)}}))).apply(this,arguments)}function Ga(e,t){let i=`$survey_${t}/${e.id}`;return e.current_iteration&&e.current_iteration>0&&(i=`$survey_${t}/${e.id}/${e.current_iteration}`),i}function qa(e){var t;return!!(null===(t=e.conditions)||void 0===t||null===(t=t.events)||void 0===t||null===(t=t.values)||void 0===t?void 0:t.length)}const Ha=(e,t)=>{if(!(e=>{try{new RegExp(e)}catch(e){return!1}return!0})(t))return!1;try{return new RegExp(t).test(e)}catch(e){return!1}},za=e=>e.toLowerCase(),Ka={exact:(e,t)=>t.some(t=>e.some(e=>t===e)),is_not:(e,t)=>t.every(t=>e.every(e=>t!==e)),regex:(e,t)=>t.some(t=>e.some(e=>Ha(t,e))),not_regex:(e,t)=>t.every(t=>e.every(e=>!Ha(t,e))),icontains:(e,t)=>t.map(za).some(t=>e.map(za).some(e=>t.includes(e))),not_icontains:(e,t)=>t.map(za).every(t=>e.map(za).every(e=>!t.includes(e))),gt:(e,t)=>t.some(t=>{const i=parseFloat(t);return!isNaN(i)&&e.some(e=>i>parseFloat(e))}),lt:(e,t)=>t.some(t=>{const i=parseFloat(t);return!isNaN(i)&&e.some(e=>i<parseFloat(e))})};function Wa(e,t){return!e||Object.entries(e).every(([e,i])=>{const n=null==t?void 0:t[e];if(null==n)return!1;const r=Ka[i.operator];return!!r&&r(i.values,[String(n)])})}function Ya(e,t,i){return Fo({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:i})}const Ja="custom",Xa="i.posthog.com",Za=/^\/static\//,Qa=["/s/","/e/","/i/"];const el=ji("[Surveys]"),tl=e=>{try{const t=(e=>((e,t)=>`seenSurvey_${function(e){return e.current_iteration&&e.current_iteration>0?`${e.id}_${e.current_iteration}`:e.id}(t)}`)(0,e))(e);if(localStorage.getItem(t))return;localStorage.setItem(t,"true")}catch(e){el.error("Failed to persist survey seen state",e)}},il=[ws,Os,Is],nl={ignoreConditions:!1,ignoreDelay:!1,displayType:ks},rl=ji("[PostHog ExternalIntegrations]"),ol={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};const sl="extensionsRemoteConfig";const al={};let ll=0;const cl=()=>{},ul='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',dl="Surveys module not available",fl="sanitize_properties is deprecated. Use before_send instead",hl="Invalid value for property_denylist config: ",pl=/^[A-Za-z0-9_-]{1,400}$/,vl=/^fb\.[0-9]+\.[0-9]+\.[A-Za-z0-9_-]+(?:\.[A-Za-z0-9_-]+)?$/,gl=["token","distinct_id",Gn],ml="posthog";let _l=!ma&&-1===(null==f?void 0:f.indexOf("MSIE"))&&-1===(null==f?void 0:f.indexOf("Mozilla"));const yl=e=>{const t={};return e&&"unset"!==e?("2025-11-30">e||(t.strictMinimumDuration=!0),"2026-05-30">e||(t.canvasCapture={resolutionScale:.6}),"2026-06-25">e||(t.streamNetworkBody=!0),"2026-08-30">e||(t.captureJsonLd=!0),t):t},bl=e=>{var t;return mt({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:dr(null==s?void 0:s.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:cl,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:null!=e?e:"unset",__preview_deferred_init_extensions:!1,__preview_external_dependency_versioned_paths:!1,__preview_cookie_wins_on_conflict:!1,debug:a&&D(null==a?void 0:a.search)&&-1!==a.search.indexOf("__posthog_debug=true")||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disableDeviceModel:!1,reuseAnonymousId:!1,disable_external_dependency_loading:!1,strict_script_versioning:"fallback",enable_recording_console_log:void 0,secure_cookie:"https:"===(null==n||null===(t=n.location)||void 0===t?void 0:t.protocol),ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_feature_flags_dedup_per_session:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error(e){Fi.error("Bad HTTP status: "+e.statusCode+" "+e.text)},get_device_id:e=>e,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:Jn,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:3e3},error_tracking:{},_onCapture:cl},(e=>({rageclick:e&&e>="2026-05-30"?{content_ignorelist:oo,ignore_text_selection:!0}:!e||"2025-11-30">e||{content_ignorelist:!0},capture_pageview:!e||"2025-05-24">e||"history_change",session_recording:yl(e),external_scripts_inject_target:e&&e>="2026-01-30"?"head":"body",internal_or_test_user_hostname:e&&e>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0,persistence_save_debounce_ms:e&&e>="2026-05-30"?250:0,split_storage:!(!e||"2026-05-30">e),detect_google_search_app:!(!e||"2026-05-30">e),disable_capture_url_hashes:!(!e||"2026-06-25">e),cookieWinsOnConflict:!(!e||"unset"===e||"2026-08-29">e)}))(e))},El=[["process_person","person_profiles"],["xhr_headers","request_headers"],["cookie_name","persistence_name"],["disable_cookie","disable_persistence"],["__preview_disable_beacon","disable_beacon"],["store_google","save_campaign_params"],["verbose","debug"],["__preview_cookie_wins_on_conflict","cookieWinsOnConflict"]],wl=e=>{const t={};for(const[i,n]of El)R(e[i])||(t[n]=e[i]);const i=or({},t,e),n=e.__preview_external_dependency_versioned_paths;return R(n)||(R(e.strict_script_versioning)&&(i.strict_script_versioning=!!n),D(n)&&R(e.asset_host)&&(i.asset_host=n)),T(e.property_blacklist)&&(R(e.property_denylist)?i.property_denylist=e.property_blacklist:T(e.property_denylist)?i.property_denylist=[...e.property_blacklist,...e.property_denylist]:Fi.error(hl+e.property_denylist)),i};var Il=class e{du(e){if(!e)return;const t=this.su.indexOf(e);-1!==t&&this.su.splice(t,1)}vu(e,t){var i;return this.du(e),this.su.push(t),null===(i=t.initialize)||void 0===i||i.call(t),t}fu(){return"always"===this.config.cookieless_mode||"on_reject"===this.config.cookieless_mode&&this.consent.isRejected()}pu(){if(this.gu)return;if(this.config.reuseAnonymousId)return;if(this.config.segment)return;if(this.fu())return;const e="memory"===this.config.persistence||"sessionStorage"===this.config.persistence;if(!e&&!this.config.disable_persistence)return;if(this.mu)return;let t,i,n;e?(t=`persistence is set to '${this.config.persistence}'`,i="memory"===this.config.persistence?"on every page load":"for every new browser tab or window",n="Either set persistence to 'localStorage+cookie', keep this persistence and pass a stable ID through bootstrap.distinctID, or enable reuseAnonymousId."):(t="persistence is disabled (disable_persistence is true)",i="on every page load",n="Either set disable_persistence to false, keep persistence disabled and pass a stable ID through bootstrap.distinctID, or enable reuseAnonymousId."),this.gu=!0,console.warn("[PostHog.js]",`${t} but no bootstrap.distinctID was provided. PostHog will mint a new distinct ID ${i}, so calling identify() merges a new ID onto the person each time. A person can then pass the distinct-ID limit and its events stop appearing on person pages and the session tab. ${n}`)}yu(){if(this.fu()||"$posthog_cookieless"!==this.get_distinct_id())return;const e=this.persistence;if(!e)return;this.bu()||e.load(!0);const t=this.get_distinct_id();if(!t||"$posthog_cookieless"===t){const t=this.config.get_device_id(_r());this.register({distinct_id:t,$device_id:t}),e.set_property(Ln,Wn)}this._u()}get decideEndpointWasHit(){var e,t;return null!==(e=null===(t=this.featureFlags)||void 0===t?void 0:t.hasLoadedFlags)&&void 0!==e&&e}get flagsEndpointWasHit(){var e,t;return null!==(e=null===(t=this.featureFlags)||void 0===t?void 0:t.hasLoadedFlags)&&void 0!==e&&e}constructor(){var t;this.wu=!1,this.ku=!1,this.webPerformance=new class{constructor(){this.__forceAllowLocalhost=!1}get cu(){return this.__forceAllowLocalhost}set cu(e){Fi.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}},this.Su=!1,this.version=zi.LIB_VERSION,this.xu=new Set,this.Cu="",this.au=new Ua,this.su=[],this.$u=[],this.mu=!1,this.gu=!1,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=bl(),this.SentryIntegration=class{constructor(e,t,i,n,r,o){this.name=xo,this.setupOnce=function(s){s(Ro(e,{organization:t,projectId:i,prefix:n,severityAllowList:r,sendExceptionsToPostHog:null==o||o}))}}},this.sentryIntegration=e=>function(e,t){const i=Ro(e,t);return{name:xo,processEvent:e=>i(e)}}(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Tu=!1,this.Iu=null,this.Mu=null,this.Eu=null,this.scrollManager=new Na(this),this.pageViewManager=new Do(this),this.rateLimiter=new class{constructor(e){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=e=>{const t=e.text;if(t&&t.length)try{(JSON.parse(t).quota_limited||[]).forEach(e=>{Ms.info(`${e||"events"} is quota limited.`),this.serverLimits[e]=(new Date).getTime()+6e4})}catch(e){return void Ms.warn(`could not rate limit - continuing. Error: "${null==e?void 0:e.message}"`,{text:t})}},this.instance=e,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var e;return(null===(e=this.instance.config.rate_limiting)||void 0===e?void 0:e.events_per_second)||10}get captureEventsBurstLimit(){var e;return Math.max((null===(e=this.instance.config.rate_limiting)||void 0===e?void 0:e.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(e=!1){var t,i,n;const{captureEventsBurstLimit:r,captureEventsPerSecond:o}=this,s=(new Date).getTime(),a=null!==(t=null===(i=this.instance.persistence)||void 0===i?void 0:i.get_property("$capture_rate_limit"))&&void 0!==t?t:{tokens:r,last:s};a.tokens+=(s-a.last)/1e3*o,a.last=s,a.tokens>r&&(a.tokens=r);const l=1>a.tokens;if(l||e||(a.tokens=Math.max(0,a.tokens-1)),l&&!e){const e=(U(a.dropped)?a.dropped:0)+1;a.dropped=e,!this.lastEventRateLimited&&this.Vl(e)&&(a.dropped=0)}return this.lastEventRateLimited=l,null===(n=this.instance.persistence)||void 0===n||n.set_property("$capture_rate_limit",a),{isRateLimited:l,remainingTokens:a.tokens}}Gl(e){const t=this.instance.config.property_denylist;return!T(t)||!t.includes(e)}Zl(){var e;if(this.Gl("$current_url")&&this.Gl("$pathname")&&(null==a?void 0:a.pathname))return`${null!==(e=a.origin)&&void 0!==e?e:""}${a.pathname}`}Vl(e){var t,i;const{captureEventsBurstLimit:n,captureEventsPerSecond:r}=this,o=this.Zl(),s=this.Gl("$session_id")?null===(t=(i=this.instance).get_session_id)||void 0===t?void 0:t.call(i):void 0,a=[`${e} event(s) dropped since the last warning`,o?`triggered on ${o}`:void 0,s?`session ${s}`:void 0].filter(Boolean).join(", ");return!!this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:`posthog-js client rate limited: ${a}. Config is set to ${r} events per second and ${n} events burst limit.`},{skip_client_rate_limiting:!0})}isServerRateLimited(e){const t=this.serverLimits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t}}(this),this.requestRouter=new class{constructor(e){this.Ya={},this.instance=e}get apiHost(){const e=this.instance.config.api_host.trim().replace(/\/$/,"");return"https://app.posthog.com"===e?"https://us.i.posthog.com":e}get flagsApiHost(){const e=this.instance.config.flags_api_host;return e?e.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var e;let t=null===(e=this.instance.config.ui_host)||void 0===e?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace(`.${Xa}`,".posthog.com")),"https://app.posthog.com"===t?"https://us.posthog.com":t}get region(){return this.Ya[this.apiHost]||(this.Ya[this.apiHost]=/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"us":/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"eu":Ja),this.Ya[this.apiHost]}tu(e){if(!Za.test(e))return;const t=this.instance.config.asset_host;return"string"==typeof t&&t.trim().replace(/\/$/,"")||void 0}eu(e){const t=jo(e);return t?t.protocol+"//"+t.host+t.pathname:void 0}iu(e,t,i){if("ui"===e)return i;let n=i;const r=this.instance.config.rewriteRequestPath;if(r){var o;const e=(null===(o=jo(i))||void 0===o?void 0:o.href)||i;n=r(new URL(e)).toString()}if(r&&"api"===e&&Qa.some(e=>0===t.indexOf(e))){const e=this.eu(n);if(e){const t=this.apiHost;let i=this.nu;(null==i?void 0:i.apiHost)===t&&i.rewriteRequestPath===r||(i={apiHost:t,rewriteRequestPath:r,urls:new Set},this.nu=i),i.urls.add(e)}}return n}isIngestionEndpoint(e){const t=this.nu,i=this.eu(e);return(null==t?void 0:t.apiHost)===this.apiHost&&t.rewriteRequestPath===this.instance.config.rewriteRequestPath&&!!i&&t.urls.has(i)}endpointFor(e,t=""){if(t&&(t="/"===t[0]?t:`/${t}`),"ui"===e)return this.iu(e,t,this.uiHost+t);if("flags"===e)return this.iu(e,t,this.flagsApiHost+t);if("assets"===e){const i=this.tu(t);if(i)return this.iu(e,t,`${i}${t}`)}if(this.region===Ja)return this.iu(e,t,this.apiHost+t);const i=Xa+t;switch(e){case"assets":return this.iu(e,t,`https://${this.region}-assets.${i}`);case"api":return this.iu(e,t,`https://${this.region}.${i}`)}}}(this),this.consent=new jr(this),this.externalIntegrations=new class{constructor(e){this._instance=e}No(e,t){var i,n;null===(i=v.__PosthogExtensions__)||void 0===i||null===(n=i.loadExternalDependency)||void 0===n||n.call(i,this._instance,e,e=>{if(e)return rl.error("failed to load script",e);t()})}startIfEnabledOrStop(){var e;for(const[r,o]of Object.entries(null!==(e=this._instance.config.integrations)&&void 0!==e?e:{})){var t,i,n;o&&!(null===(t=v.__PosthogExtensions__)||void 0===t||null===(t=t.integrations)||void 0===t?void 0:t[r])&&this.No(ol[r],()=>{var e;null===(e=v.__PosthogExtensions__)||void 0===e||null===(e=e.integrations)||void 0===e||null===(e=e[r])||void 0===e||e.start(this._instance)}),!o&&(null===(i=v.__PosthogExtensions__)||void 0===i||null===(i=i.integrations)||void 0===i?void 0:i[r])&&(null===(n=v.__PosthogExtensions__)||void 0===n||null===(n=n.integrations)||void 0===n||null===(n=n[r])||void 0===n||n.stop())}}}(this);const i=null!==(t=e.__defaultExtensionClasses)&&void 0!==t?t:{};this.featureFlags=i.featureFlags&&new i.featureFlags(this),this.toolbar=i.toolbar&&new i.toolbar(this),this.surveys=i.surveys&&new i.surveys(this),this.conversations=i.conversations&&new i.conversations(this),this.logs=i.logs&&new i.logs(this),this.metrics=i.metrics&&new i.metrics(this),this.experiments=i.experiments&&new i.experiments(this),this.exceptions=i.exceptions&&new i.exceptions(this),this.people={set:(e,t,i)=>{const n=D(e)?{[e]:t}:e;this.setPersonProperties(n),null==i||i({})},set_once:(e,t,i)=>{const n=D(e)?{[e]:t}:e;this.setPersonProperties(void 0,n),null==i||i({})}},this.on("eventCaptured",e=>Fi.info(`send "${null==e?void 0:e.event}"`,e))}init(t,i,n){if(n&&n!==ml){var r;const o=null!==(r=al[n])&&void 0!==r?r:new e;return o._init(t,i,n),al[n]=o,al[ml][n]=o,o}return this._init(t,i,n)}_init(e,t={},i){var r,o,s;const a=D(e)?e.trim():"";if(!a)return Fi.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;var l;if(this.__loaded)return a!==(null===(l=this.config)||void 0===l?void 0:l.token)?console.warn("[PostHog.js]",`You have already initialized PostHog with a different project token! Re-initializing is a no-op, so events will keep going to the project this instance was initialized with. To capture into a second project, load PostHog once, then initialize a named instance after the SDK has loaded, e.g. posthog.init('${a}', { ... }, 'project2')`):console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config=bl(t.defaults),t.debug=this.Pu(t.debug),this.Ru=t,this.Au=[],t.person_profiles?this.Mu=t.person_profiles:t.process_person&&(this.Mu=t.process_person);const c=bl(t.defaults),u=wl(t),d=or({},c,u,{name:i,token:a});k(c.rageclick)&&k(u.rageclick)&&(d.rageclick=or({},c.rageclick,u.rageclick)),k(c.session_recording)&&k(u.session_recording)&&(d.session_recording=or({},c.session_recording,u.session_recording)),this.set_config(d),this.config.on_xhr_error&&Fi.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=t.disable_compression?void 0:_s;const f=this.bu();if(this.persistence=new ms(this.config,f),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new ms(mt(mt({},this.config),{},{persistence:"sessionStorage"}),f,!1),this.Cu="ph_"+(this.config.persistence_name||this.config.token)+"_session_registered_properties","memory"!==this.config.persistence&&!f&&Fr.Et()){const e=Fr.Dt(this.Cu);T(e)&&e.forEach(e=>{D(e)&&this.xu.add(e)})}else Fr.Lt(this.Cu);const h=mt({},this.persistence.props),p=mt({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.Fu=new class{constructor(e,t){this.ea=!0,this.ia=[],this.na=te((null==t?void 0:t.flush_interval_ms)||3e3,250,5e3,Fi.createLogger("flush interval"),3e3),this.sa=e}enqueue(e){this.ia.push(e),this.ra||this.oa()}unload(){this.la();const e=this.ia.length>0?this.aa():{},t=Object.values(e);[...t.filter(e=>0===e.url.indexOf("/e")),...t.filter(e=>0!==e.url.indexOf("/e"))].map(e=>{this.ua(mt(mt({},e),{},{transport:"sendBeacon"}))})}enable(){this.ea=!1,this.oa()}oa(){this.ea||(this.ra=setTimeout(()=>{if(this.la(),this.ia.length>0){const e=this.aa();for(const t in e)this.ua(e[t])}},this.na))}ua(e){try{this.sa(e)}catch(e){Fi.error(e)}}la(){clearTimeout(this.ra),this.ra=void 0}aa(){const e={};return rr(this.ia,t=>{var i;const n=t,r=((n?n.batchKey:null)||n.url)+(n.batchGroup?`:${n.batchGroup}`:"");R(e[r])&&(e[r]=mt(mt({},n),{},{data:[]})),null===(i=e[r].data)||void 0===i||i.push(n.data)}),this.ia=[],e}}(e=>this.Ou(e),this.config.request_queue_config),this.Du=new class{constructor(e){this._instance=e,this.ha=!1,this.ca=3e3,this.ia=[],this.ia=[],this.da=!0,this.resume()}resume(){if(!R(n)&&"onLine"in n.navigator){if(this.da=n.navigator.onLine,this.va)return;this.va=()=>{this.da=!0,this.fa()},this.pa=()=>{this.da=!1},fr(n,"online",this.va),fr(n,"offline",this.pa)}}get length(){return this.ia.length}retriableRequest(e){let{retriesPerformedSoFar:t}=e,i=vi(e,Da);F(t)&&(i.url=wa(i.url,{retry_count:t})),this._instance._send_request(mt(mt({},i),{},{callback:e=>{var n;if(200!==e.statusCode&&(400>e.statusCode||e.statusCode>=500)){if((0===e.statusCode?3:10)>(null!=t?t:0))return void this.Ls(mt({retriesPerformedSoFar:t},i));0===e.statusCode&&Fi.warn(`Request failed before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped retrying after ${null!=t?t:0} retries.`)}null===(n=i.callback)||void 0===n||n.call(i,e)}}))}Ls(e){const t=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=t+1;const i=function(e){const t=3e3*Math.pow(2,e),i=t/2,n=Math.min(18e5,t),r=(Math.random()-.5)*(n-i);return Math.ceil(n+r)}(t),n=Date.now()+i;this.ia.push({retryAt:n,requestOptions:e});let r=`Enqueued failed request for retry in ${i}`;navigator.onLine||(r+=" (Browser is offline)"),Fi.warn(r),this.ha||(this.ha=!0,this.ga())}ga(){if(this.ma&&clearTimeout(this.ma),0===this.ia.length)return this.ha=!1,void(this.ma=void 0);this.ma=setTimeout(()=>{this.da&&this.ia.length>0&&this.fa(),this.ga()},this.ca)}fa(){const e=Date.now(),t=[],i=this.ia.filter(i=>e>i.retryAt||(t.push(i),!1));if(this.ia=t,i.length>0)for(const{requestOptions:e}of i)this.retriableRequest(e)}unload(){this.ma&&(clearTimeout(this.ma),this.ma=void 0),this.ha=!1,R(n)||(this.va&&(n.removeEventListener("online",this.va),this.va=void 0),this.pa&&(n.removeEventListener("offline",this.pa),this.pa=void 0));for(const{requestOptions:e}of this.ia)try{this._instance._send_request(mt(mt({},e),{},{transport:"sendBeacon"}))}catch(e){Fi.error(e)}this.ia=[]}}(this),this.__request_queue=[];const v=this.fu();v||(this.sessionManager=new ja(this),this.sessionPropsManager=new Ma(this,this.sessionManager,this.persistence),this.sessionManager.onSessionId((e,t,i)=>{((null==i?void 0:i.activityTimeout)||(null==i?void 0:i.sessionPastMaximumLength)||(null==i?void 0:i.crossTabAdoption))&&this.Lu()})),this.Nu(),this.config.__preview_deferred_init_extensions?(Fi.info("Deferring extension initialization to improve startup performance"),setTimeout(()=>{this.qu(v)},0)):(Fi.info("Initializing extensions synchronously"),this.qu(v)),zi.DEBUG=zi.DEBUG||this.config.debug,zi.DEBUG&&Fi.info("Starting in debug mode",{this:this,config:t,thisC:mt({},this.config),p:h,s:p}),this.config.identity_distinct_id&&!(null===(r=t.bootstrap)||void 0===r?void 0:r.distinctID)&&(t.bootstrap=mt(mt({},t.bootstrap),{},{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0}));const g=null===(o=t.bootstrap)||void 0===o?void 0:o.distinctID;if(this.mu=!!g&&!N(g),null===(s=t.bootstrap)||void 0===s?void 0:s.distinctID){const e=t.bootstrap.distinctID,i=this.get_distinct_id(),n=this.persistence.get_property(Ln);if(t.bootstrap.isIdentifiedID&&null!=i&&i!==e&&"anonymous"===n)this.identify(e);else if(t.bootstrap.isIdentifiedID&&null!=i&&i!==e&&"identified"===n)Fi.warn("Bootstrap distinctID differs from an already-identified user. The existing identity is preserved. Call reset() before reinitializing if you intend to switch users.");else{const i=this.config.get_device_id(_r()),n=t.bootstrap.isIdentifiedID?i:e;this.persistence.set_property(Ln,t.bootstrap.isIdentifiedID?Yn:Wn),this.register({distinct_id:e,$device_id:n})}}if(v)this.register_once({distinct_id:Bn,$device_id:null},"");else if(!this.get_distinct_id()){const e=this.config.get_device_id(_r());this.register_once({distinct_id:e,$device_id:e},""),this.persistence.set_property(Ln,Wn)}return fr(n,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),fr(n,"pageshow",()=>{var e;this.wu=!1,this.ku||null===(e=this.Du)||void 0===e||e.resume()}),t.segment?ko(this,()=>this.ju()):this.ju(),P(this.config._onCapture)&&this.config._onCapture!==cl&&(Fi.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",e=>this.config._onCapture(e.event,e))),this.config.ip&&Fi.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this.config.disableDeviceModel||function(){return Ba.apply(this,arguments)}().then(e=>{e&&this.register({[Yi]:e})}).catch(cl),this}Bu(e){const t=e;return D(t.name)&&P(t.setup)}Hu(e,t){this.Bu(e)?t.push(()=>{this.zu().add(e).catch(()=>{var t;return null===(t=e.dispose)||void 0===t?void 0:t.call(e)}).catch(t=>{Fi.error(`Failed to dispose browser extension "${e.name}"`,t)})}):this.su.push(e)}Nu(){var t,i,n;const r=null!==(t=null===(i=this.config.__extensionClasses)||void 0===i?void 0:i.featureFlags)&&void 0!==t?t:null===(n=e.__defaultExtensionClasses)||void 0===n?void 0:n.featureFlags;var o,s,a;r&&(this.featureFlags&&this.featureFlags instanceof r||(null===(o=this.Uu)||void 0===o||o.call(this),this.Uu=void 0,this.featureFlags=new r(this)),P(this.featureFlags.onReloading)&&P(this.featureFlags.setup)?this.Uu||(this.Uu=this.featureFlags.onReloading(()=>{this.au.emit("featureFlagsReloading",!0)}),this.zu().add(this.featureFlags)):null===(s=(a=this.featureFlags).initialize)||void 0===s||s.call(a))}qu(t){const i=performance.now(),n=mt(mt({},e.__defaultExtensionClasses),this.config.__extensionClasses),r=[];var o,s,a,l,c,u,d;n.exceptions&&this.su.push(this.exceptions=null!==(o=this.exceptions)&&void 0!==o?o:new n.exceptions(this)),n.historyAutocapture&&this.su.push(this.historyAutocapture=new n.historyAutocapture(this)),n.tracingHeaders&&this.su.push(this.tracingHeaders=new n.tracingHeaders(this)),n.siteApps&&this.su.push(this.siteApps=new n.siteApps(this)),n.sessionRecording&&!t&&this.su.push(this.sessionRecording=new n.sessionRecording(this)),this.config.disable_scroll_properties||r.push(()=>{this.scrollManager.startMeasuringScrollPosition()}),n.autocapture&&this.Hu(this.autocapture=new n.autocapture(this),r),n.surveys&&this.Hu(this.surveys=null!==(s=this.surveys)&&void 0!==s?s:new n.surveys(this),r),n.logs&&this.Hu(this.logs=null!==(a=this.logs)&&void 0!==a?a:new n.logs(this),r),n.metrics&&this.su.push(this.metrics=null!==(l=this.metrics)&&void 0!==l?l:new n.metrics(this)),n.conversations&&this.su.push(this.conversations=null!==(c=this.conversations)&&void 0!==c?c:new n.conversations(this)),n.productTours&&this.su.push(this.productTours=new n.productTours(this)),n.heatmaps&&this.su.push(this.heatmaps=new n.heatmaps(this)),n.webVitalsAutocapture&&this.su.push(this.webVitalsAutocapture=new n.webVitalsAutocapture(this)),n.exceptionObserver&&this.su.push(this.exceptionObserver=new n.exceptionObserver(this)),n.deadClicksAutocapture&&this.su.push(this.deadClicksAutocapture=new n.deadClicksAutocapture(this,$o)),n.toolbar&&this.su.push(this.toolbar=null!==(u=this.toolbar)&&void 0!==u?u:new n.toolbar(this)),n.experiments&&this.su.push(this.experiments=null!==(d=this.experiments)&&void 0!==d?d:new n.experiments(this)),this.su.forEach(e=>{e.initialize&&r.push(()=>{var t;null===(t=e.initialize)||void 0===t||t.call(e)})}),r.push(()=>{if(this.Wu){const e=this.Wu;this.Wu=void 0,this.su.forEach(t=>{var i;return null===(i=t.onRemoteConfig)||void 0===i?void 0:i.call(t,e)})}}),this.Vu(r,i)}Vu(e,t){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-t>=30&&e.length>0)return void setTimeout(()=>{this.Vu(e,t)},0);const i=e.shift();if(i)try{i()}catch(e){Fi.error("Error initializing extension:",e)}}const i=Math.round(performance.now()-t);this.register_for_session({[qn]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[Hn]:i}),this.config.__preview_deferred_init_extensions&&Fi.info(`PostHog extensions initialized (${i}ms)`)}Kl(e){var t;if(!s||!s.body)return Fi.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.Kl(e)},500);if(this.config.__preview_deferred_init_extensions&&(this.Wu=e),this.lu=e,this.compression=void 0,e.ok){var i;const t=e.config;t.supportedCompression&&!this.config.disable_compression&&(this.compression=w(t.supportedCompression,_s)?_s:w(t.supportedCompression,ys)?ys:void 0),(null===(i=t.analytics)||void 0===i?void 0:i.endpoint)&&(this.analyticsDefaultEndpoint=t.analytics.endpoint)}this.set_config({person_profiles:this.Mu?this.Mu:Jn}),null===(t=this.Gu)||void 0===t||t.handleRemoteConfig(e),this.su.forEach(t=>{var i;return null===(i=t.onRemoteConfig)||void 0===i?void 0:i.call(t,e)})}ju(){try{this.config.loaded(this)}catch(e){Fi.critical("`loaded` function failed",e)}if(this.Zu(),this.config.internal_or_test_user_hostname&&(null==a?void 0:a.hostname)){const e=a.hostname,t=this.config.internal_or_test_user_hostname;("string"==typeof t?e===t:t.test(e))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout(()=>{(this.consent.isOptedIn()||this.fu())&&this.Qu()},1),this.Ju=new Fs(this),this.Ju.load()}Zu(){var e;this.is_capturing()&&this.config.request_batching&&(null===(e=this.Fu)||void 0===e||e.enable())}_dom_loaded(){this.is_capturing()&&nr(this.__request_queue,e=>this.Ou(e)),this.__request_queue=[],this.Zu()}_handle_unload(){var e,t,i,n,r,o;this.wu=!0,null===(e=this.surveys)||void 0===e||null===(t=e.handlePageUnload)||void 0===t||t.call(e),null===(i=this.metrics)||void 0===i||i.flush("sendBeacon"),this.config.request_batching?(this.Ku()&&this.capture(er),null===(n=this.logs)||void 0===n||n.flushLogs("sendBeacon"),null===(r=this.Fu)||void 0===r||r.unload(),null===(o=this.Du)||void 0===o||o.unload()):this.Ku()&&this.capture(er,null,{transport:"sendBeacon"})}_send_request(e){var t,i,n;this.__loaded?_l?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)?e.fireCallbackOnDrop&&(null===(i=e.callback)||void 0===i||i.call(e,{statusCode:429})):(e.transport=e.transport||this.config.api_transport,e.headers=mt(mt({},this.config.request_headers),e.headers),e.compression="best-available"===e.compression?null!==(t=this.compression)&&void 0!==t?t:e.compressionFallback:e.compression,(R(this.config.disable_beacon)?this.config.__preview_disable_beacon:this.config.disable_beacon)&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,
1(e=>{var t,i,n;const r=mt({},e);r.timeout=r.timeout||6e4;const o=null!==(t=r.transport)&&void 0!==t?t:"fetch";"sendBeacon"===o&&R(r.compression)&&r.data&&(r.compression=ys),"POST"===r.method&&r.data&&("capture-body"===r.timestampMode?r.data=(e=>{var t,i;const n=(T(e)?e:[e]).map(e=>mt(mt({},e),e.timestamp instanceof Date&&!isNaN(e.timestamp.getTime())?{timestamp:e.timestamp.toISOString()}:{})),r=n[0];return{api_key:null!==(t=null==r||null===(i=r.properties)||void 0===i?void 0:i.token)&&void 0!==t?t:null==r?void 0:r.token,batch:n,sent_at:(new Date).toISOString()}})(r.data):"body"===r.timestampMode&&(r.data=((e,t=(new Date).toISOString())=>T(e)?e.map(e=>mt(mt({},e),{},{sent_at:t})):mt(mt({},e),{},{sent_at:t}))(r.data))),r.url=xa(r.url,r.method,r.compression,r.timestampMode);const s=Ra.filter(e=>!r.disableTransport||!e.transport||!r.disableTransport.includes(e.transport)),a=null!==(i=null===(n=function(e,t){for(let i=0;e.length>i;i++)if(t(e[i]))return e[i]}(s,e=>e.transport===o))||void 0===n?void 0:n.method)&&void 0!==i?i:s[0].method;if(!a)throw new Error("No available transport method");const l=e=>{try{a(e)}catch(e){var t;$a(e)?Fi.warn(e):Fi.error(e),null===(t=r.callback)||void 0===t||t.call(r,{statusCode:0,error:e})}};"sendBeacon"!==o&&r.data&&r.compression===_s&&d&&"undefined"!=typeof Promise&&!ba?Aa(r).then(e=>{l(e)}).catch(t=>{if(li(t))return ba=!0,void l(mt(mt({},r),{},{compression:void 0,url:xa(e.url,e.method,void 0,e.timestampMode)}));(e=>{if(!e||"object"!=typeof e)return!1;const t="name"in e?String(e.name):"";return li(e)||t===oi})(t)&&(ba=!0),l(r)}):a(r)})(mt(mt({},e),{},{callback:t=>{var i,n,r;this.rateLimiter.checkForLimiting(t),400>t.statusCode||null===(n=(r=this.config).on_request_error)||void 0===n||n.call(r,t),null===(i=e.callback)||void 0===i||i.call(e,t)}}))):e.fireCallbackOnDrop&&(null===(n=e.callback)||void 0===n||n.call(e,{statusCode:0}))}Ou(e){this.Du?this.Du.retriableRequest(e):this._send_request(e)}_execute_array(e){ll++;try{let t;const i=[],n=[],r=[];nr(e,e=>{if(e)if(t=e[0],T(t))r.push(e);else if(P(e))try{e.call(this)}catch(t){Fi.error("Error executing queued PostHog call",e,t)}else T(e)&&"alias"===t?i.push(e):T(e)&&-1!==t.indexOf("capture")&&P(this[t])?r.push(e):n.push(e)});const o=function(e,t){nr(e,(function(e){try{if(T(e[0])){let i=t;rr(e,(function(e){i=i[e[0]].apply(i,e.slice(1))}))}else t[e[0]].apply(t,e.slice(1))}catch(t){Fi.error("Error executing queued PostHog call",e,t)}}))};o(i,this),o(n,this),o(r,this)}finally{ll--}}push(t){if(ll>0&&T(t)&&D(t[0])){const i=e.prototype[t[0]];P(i)&&i.apply(this,t.slice(1))}else this._execute_array([t])}Xu(){var e;const t=null===(e=this.persistence)||void 0===e?void 0:e.get_property(Zi);return D(t)&&vl.test(t)?{value:t,delivered:!1}:k(t)&&D(t.value)&&vl.test(t.value)?{value:t.value,delivered:!0===t.delivered}:void 0}Yu(e,t,i,n){if(!this.persistence)return;this.persistence.refreshKey(Zi);const r=this.Xu();if(!n){if(i)return D(t)&&vl.test(t)?(t!==(null==r?void 0:r.value)&&this.persistence.register({[Zi]:{value:t,delivered:!1}}),{value:t,pending:t!==(null==r?void 0:r.value)||!r.delivered}):void this.persistence.unregister(Zi);if(D(e)&&pl.test(e)){if((null==r?void 0:r.value.split(".")[3])===e)return{value:r.value,pending:!r.delivered};const t=`fb.1.${Date.now()}.${e}`;return this.persistence.register({[Zi]:{value:t,delivered:!1}}),{value:t,pending:!0}}return r?{value:r.value,pending:!r.delivered}:void 0}this.persistence.unregister(Zi)}th(e){if(!this.persistence)return;this.persistence.refreshKey(Zi);const t=this.Xu();(null==t?void 0:t.value)!==e||t.delivered||this.persistence.register({[Zi]:{value:e,delivered:!0}})}capture(e,t,i){var n,r,o,s,a,l;if(!(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Fu))return void Fi.uninitializedWarning("posthog.capture");if(!this.is_capturing())return;if(R(e)||!D(e))return void Fi.error("No event name provided to posthog.capture");this.yu();const c=!this.config.opt_out_useragent_filter&&this._is_bot();if(c&&!this.config.__preview_capture_bot_pageviews)return;const u=(null==i?void 0:i.skip_client_rate_limiting)?void 0:this.rateLimiter.clientRateLimitContext();if(null==u?void 0:u.isRateLimited)return void Fi.critical("This capture call is ignored due to client rate limiting.");let d;(null==t?void 0:t.$current_url)&&!D(null==t?void 0:t.$current_url)&&(Fi.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==t||delete t.$current_url),"$exception"!==e||(null==i?void 0:i.eh)||Fi.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&(d=this.sessionPersistence.update_campaign_params()),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();const f=new Date,h=(null==i?void 0:i.timestamp)||f,p=nt(null==i?void 0:i.uuid,_r);let v={uuid:p,event:e,properties:this.calculateEventProperties(e,t||{},h,p)};"$pageview"===e&&this.config.__preview_capture_bot_pageviews&&c&&(v.event="$bot_pageview",v.properties.$browser_type="bot"),u&&(v.properties.$lib_rate_limit_remaining_tokens=u.remainingTokens);const g="$feature_flag_called"===e&&!1===v.properties.$feature_flag_has_experiment&&!0===this.get_property("$minimal_flag_called_events");(null==i?void 0:i.$set)&&!g&&(v.$set=null==i?void 0:i.$set);const m=k(null==t?void 0:t.$set)?t.$set:void 0,_=!!(null==i?void 0:i.$set)&&"$fbc"in i.$set,y=_||!!m&&"$fbc"in m,b=_?null==i||null===(n=i.$set)||void 0===n?void 0:n[Xi]:null==m?void 0:m[Xi],E=T(null==t?void 0:t.$unset)?t.$unset:[],w=(null==i?void 0:i.$unset)||[],I=-1!==E.indexOf("$fbc")||-1!==w.indexOf("$fbc"),O=this.Yu(null==d?void 0:d.fbclid,b,y,I);O&&!0===v.properties.$process_person_profile&&O.pending&&!y&&!g&&(v.$set=mt({[Xi]:O.value},v.$set));const S=null==i?void 0:i.$unset;S&&(v.$unset=S);const A=g?void 0:this.ih(null==i?void 0:i.$set_once,e!==ir,e===tr);if(A&&(v.$set_once=A),(null==i?void 0:i._noTruncate)||(C=this.config.properties_string_max_length,v=function(e,t){const i=new Set;return function e(n,r){if(n!==Object(n))return t?t(n):n;if(i.has(n))return;let o;if(i.add(n),T(n))o=[],nr(n,t=>{o.push(e(t))});else{const t={};rr(H(n)?cr(n):n,(n,r)=>{i.has(n)||(t[r]=e(n,r))}),o=t}return o}(e)}(v,e=>D(e)?e.slice(0,C):e)),v.timestamp=h,R(null==i?void 0:i.timestamp)||(v.properties.$event_time_override_provided=!0,v.properties.$event_time_override_system_time=f),g&&(v.properties=((e,t=[])=>{const i={},n=t=>{void 0!==e[t]&&(i[t]=e[t])};
1return ri.forEach(n),t.forEach(n),i})(v.properties,gl)),e===As||e===Cs){const i=null==t?void 0:t[$s],n=null==t?void 0:t[Ts];tl({id:i,current_iteration:n}),v.$set=mt(mt({},v.$set),{},{[Ga({id:i,current_iteration:n},e===Cs?"responded":"dismissed")]:!0})}else e===Ss&&(v.$set=mt(mt({},v.$set),{},{[Ps]:(new Date).toISOString()}));var C;if(e===Ds){const e=null==t?void 0:t[Ls];e&&(v.$set=mt(mt({},v.$set),{},{[`${Ns}/${e}`]:(new Date).toISOString()}))}const $=mt(mt({},v.properties.$set),v.$set);if(x($)||this.setPersonPropertiesForFlags($),!M(this.config.before_send)){const e=this.Os(v);if(!e)return;v=e,v.uuid=nt(v.uuid,_r)}const P=null!==(r=null===(o=v.$set)||void 0===o?void 0:o.$fbc)&&void 0!==r?r:k(null===(s=v.properties)||void 0===s?void 0:s.$set)?v.properties.$set[Xi]:void 0,N=(null==O?void 0:O.pending)&&P===O.value?O.value:void 0;this.au.emit("eventCaptured",v);const L=null!==(a=null==i?void 0:i._url)&&void 0!==a?a:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),U="recordings"===(null==i?void 0:i._batchKey)||/\/s\/(?:\?|$)/.test(L),F=mt(mt(mt({method:"POST",url:L,data:v,compression:"best-available",timestampMode:U?"body":"capture-body",batchKey:null==i?void 0:i._batchKey},U&&(null===(l=v.properties)||void 0===l?void 0:l.$session_id)?{batchGroup:v.properties.$session_id}:{}),(null==i?void 0:i.transport)?{transport:i.transport}:{}),N?{fireCallbackOnDrop:!0,callback:e=>{e.statusCode>=200&&300>e.statusCode&&this.th(N)}}:{});var j;return!this.config.request_batching||i&&!(null==i?void 0:i._batchKey)||(null==i?void 0:i.send_instantly)||N?(!F.transport&&!F.callback&&x(null!==(j=this.config.request_headers)&&void 0!==j?j:{})&&this.wu&&(F.transport="sendBeacon"),this.Ou(F)):this.Fu.enqueue(F),v}_addCaptureHook(e){return this.on("eventCaptured",t=>e(t.event,t))}getExtension(e){var t;return null===(t=this.Gu)||void 0===t?void 0:t.getExtension(e)}zu(){var e;return null!==(e=this.Gu)&&void 0!==e?e:this.Gu=new class{constructor(e){this.instance=e,this.So=!1,this.$=Fi,this.ou=e.lu,this.kv=new class{constructor(e){this._instance=e}initialize(){}get(e){const t=this._instance.persistence;if("string"==typeof e)return null==t?void 0:t.get_property(e);const i={};for(const n of e){const e=null==t?void 0:t.get_property(n);R(e)||(i[n]=e)}return i}set(e,t){var i;null===(i=this._instance.persistence)||void 0===i||i.register("string"==typeof e?{[e]:t}:e)}remove(e){var t;null===(t=this._instance.persistence)||void 0===t||t.unregister(e)}}(e),this.onEvent=e=>Rs(this.instance.on("eventCaptured",t=>{try{e({event:t.event,properties:t.properties})}catch(e){this.$.error("Browser extension event listener failed",e)}})),this.onRemoteConfig=e=>{if(this.So)return Rs(()=>{});const t=t=>{try{e(t)}catch(e){this.$.error("Browser extension remote config listener failed",e)}},i=this.instance.au.on(sl,t);return this.ou&&t(this.ou),Rs(i)},this.uu=new class{constructor(e,t){this.$=e,this.po=t,this.su=new Map,this.So=!1}add(e){var t=this;return Z((function*(){if(t.So)throw new Error("Cannot add an extension to a disposed ExtensionRuntime");if(t.su.has(e.name))throw new Error(`Browser extension "${e.name}" is already registered`);t.su.set(e.name,e);try{const i=e.setup(t.po);i&&(yield i)}catch(i){const n=t.su.get(e.name)===e;n&&t.su.delete(e.name),t.$.error(`Failed to set up browser extension "${e.name}"`,i),n&&t.ru(e)}}))()}getExtension(e){return this.su.get(e)}dispose(){if(this.So)return;this.So=!0;const e=Array.from(this.su.values()).reverse();this.su.clear();for(const t of e)this.ru(t)}ru(e){try{var t;const i=null===(t=e.dispose)||void 0===t?void 0:t.call(e);i&&P(i.then)&&i.then(void 0,t=>{this.$.error(`Failed to dispose browser extension "${e.name}"`,t)})}catch(t){this.$.error(`Failed to dispose browser extension "${e.name}"`,t)}}}(Fi.createLogger("[BrowserExtensions]"),this)}get logger(){return this.$}get distinctId(){return this.instance.get_distinct_id()}get anonymousId(){var e;return null!==(e=this.instance.get_property("$device_id"))&&void 0!==e?e:this.distinctId}get deviceId(){const e=this.instance.get_property(Wi);return"string"==typeof e?e:void 0}
vendor: 10,600 bytes, line 1
1get library(){return{name:zi.LIB_NAME,version:zi.LIB_VERSION}}get initialPersonProperties(){var e,t;return null!==(e=null===(t=this.instance.persistence)||void 0===t?void 0:t.get_initial_props())&&void 0!==e?e:{}}get groups(){return this.instance.getGroups()}get session(){try{var e,t,i,n;const r=null===(e=this.instance.sessionManager)||void 0===e?void 0:e.checkAndGetSessionAndWindowId(!0);return{sessionId:null!==(t=null==r?void 0:r.sessionId)&&void 0!==t?t:"",windowId:null!==(i=null==r?void 0:r.windowId)&&void 0!==i?i:"",sessionStartTimestamp:null!==(n=null==r?void 0:r.sessionStartTimestamp)&&void 0!==n?n:0}}catch(e){return{sessionId:"",windowId:"",sessionStartTimestamp:0}}}get canCapture(){return this.instance.is_capturing()}get projectToken(){return this.instance.config.token}add(e){return this.uu.add(e)}getExtension(e){return this.uu.getExtension(e)}capture(e,t,i){var n=this;return Z((function*(){i?n.instance.capture(e,t,{timestamp:i.timestamp,uuid:i.uuid,$set:i.set,$set_once:i.setOnce}):n.instance.capture(e,t)}))()}registerDynamicEventProperties(e){return Rs(this.instance.hu(e))}handleRemoteConfig(e){this.So||(this.ou=e,this.instance.au.emit(sl,e))}sendRequest(e){var t=this;return Z((function*(e,i={}){var n;const r=t.instance.requestRouter.endpointFor(null!==(n=i.target)&&void 0!==n?n:"api",e),o={method:i.method,url:i.query?wa(r,i.query):r,data:i.body,headers:i.headers,timeout:i.timeoutMs,fireCallbackOnDrop:!0,transport:i.transport,compression:i.compression,compressionFallback:"flags"===i.target&&"best-available"===i.compression?y.Base64:void 0,timestampMode:i.sentAt};return"sendBeacon"===i.transport?(t.instance._send_request(o),{statusCode:202}):new Promise(e=>{o.callback=e,t.instance._send_request(o)})})).apply(this,arguments)}dispose(){this.So||(this.So=!0,this.uu.dispose())}}(this)}hu(e){this.$u.push(e);let t=!0;return()=>{if(!t)return;t=!1;const i=this.$u.indexOf(e);-1!==i&&this.$u.splice(i,1)}}nh(e=!0){var t,i,n;return!!(null===(t=this.persistence)||void 0===t?void 0:t.consumeCookieIdentityChange())&&(this.Eu=null,"anonymous"===this.persistence.get_property("$user_state")&&(null===(n=this.sessionPersistence)||void 0===n||n.clear(),this.xu.clear(),this.sh()),null===(i=this.featureFlags)||void 0===i||i.reset(),e&&this.reloadFeatureFlags(),!0)}calculateEventProperties(e,t,i,r,o){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return t;this.persistence.syncCookieProperties(),this.nh();const l=o?void 0:this.persistence.remove_event_timer(e);let c=mt({},t);if(c.token=this.config.token,c.$config_defaults=this.config.defaults,this.fu()&&(c[Gn]=!0),"$snapshot"===e){const e=mt(mt({},this.persistence.properties()),this.sessionPersistence.properties());return c.distinct_id=e.distinct_id,(!D(c.distinct_id)&&!U(c.distinct_id)||N(c.distinct_id))&&Fi.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),c}const u=function(e,t,i,r=!1){var o,s,l,c;if(!f)return{};const u=e?[...zo,...t||[]]:[],[d,h]=Ke(f),[p,v]=function(e){for(let t=0;Xe.length>t;t++){const[i,n,r]=Xe[t],o=e.match(i);if(o){const t=r&&e.match(r)||o;return[n,(null==t?void 0:t[1])||""]}}return["",""]}(f),g=function(){const e="u">typeof navigator?navigator:void 0;return(null==e?void 0:e.brave)?{brave:!0}:{}}(),_={};R(i)||(_.detectGoogleSearchApp=i);const y={},b=null===(o=navigator)||void 0===o||null===(o=o.userAgentData)||void 0===o?void 0:o.platform,E=null===(s=navigator)||void 0===s?void 0:s.maxTouchPoints,w=null==n||null===(l=n.screen)||void 0===l?void 0:l.width,I=null==n||null===(c=n.screen)||void 0===c?void 0:c.height,O=null==n?void 0:n.devicePixelRatio;R(b)||(y.userAgentDataPlatform=b),R(E)||(y.maxTouchPoints=E),R(w)||(y.screenWidth=w),R(I)||(y.screenHeight=I),R(O)||(y.devicePixelRatio=O);const S=or(lr({$os:d,$os_version:h,$browser:Ge(f,navigator.vendor,g,_),$webview_app:p,$webview_app_version:v,$device:We(f),$device_type:Ye(f,y),$timezone:os(),$timezone_offset:ss()}),{$current_url:Bo(r?ot(null==a?void 0:a.href):null==a?void 0:a.href,u,Wo),$host:null==a?void 0:a.host,$pathname:null==a?void 0:a.pathname,$raw_user_agent:f.length>1e3?f.substring(0,997)+"...":f,$browser_version:He(f,navigator.vendor,g,_),$browser_language:Qo(),$browser_language_prefix:es(),$screen_height:null==n?void 0:n.screen.height,$screen_width:null==n?void 0:n.screen.width,$viewport_height:null==n?void 0:n.innerHeight,$viewport_width:null==n?void 0:n.innerWidth,$lib:m.LIB_NAME,$lib_version:m.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return m.SDK_DIST_CHANNEL&&(S.$sdk_dist_channel=m.SDK_DIST_CHANNEL),S}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties,this.config.detect_google_search_app,this.config.disable_capture_url_hashes);if(this.sessionManager){const{sessionId:e,windowId:t}=this.sessionManager.checkAndGetSessionAndWindowId(o,i.getTime(),!0);c.$session_id=e,c.$window_id=t}this.sessionPropsManager&&or(c,this.sessionPropsManager.getSessionProps());try{var d;this.sessionRecording&&or(c,this.sessionRecording.sdkDebugProperties),c.$sdk_debug_retry_queue_size=null===(d=this.Du)||void 0===d?void 0:d.length}catch(e){c.$sdk_debug_error_capturing_properties=String(e)}let h;if(this.requestRouter.region===Ja&&(c.$lib_custom_api_host=this.config.api_host),h="$pageview"!==e||o?"$pageleave"!==e||o?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,r),c=or(c,h),"$pageview"===e&&s&&(c.title=s.title),!R(l)){const e=i.getTime()-l;c.$duration=parseFloat((e/1e3).toFixed(3))}f&&this.config.opt_out_useragent_filter&&(c.$browser_type=this._is_bot()?"bot":"browser");const p=this.persistence.properties(),v=this.sessionPersistence.properties(),g=c.$groups,_=p.$groups;k(g)&&!x(g)&&(c.$groups=mt(mt({},k(_)?_:{}),g)),rr(["$referrer","$referring_domain"],e=>{e in p&&delete v[e]});const y={};if(this.$u.length>0)for(const e of this.$u.slice())try{or(y,e())}catch(e){Fi.error("Failed to produce browser extension event properties",e)}c=or({},u,p,v,mt(mt({},y),c)),c.$is_identified=this._isIdentified(),T(this.config.property_denylist)?rr(this.config.property_denylist,(function(e){delete c[e]})):Fi.error(hl+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);const b=this.config.sanitize_properties;b&&(Fi.error(fl),c=b(c,e));const E=this.rh();return c.$process_person_profile=E,E&&!o&&this.oh("_calculate_event_properties"),c}ih(e,t=!0,i=!1){var n;if(!this.persistence||!this.rh())return e;if(this.Su&&!i)return e;const r=this.persistence.get_initial_props(),o=null===(n=this.sessionPropsManager)||void 0===n?void 0:n.getSetOnceProps();let s=or({},r,o||{},e||{});const a=this.config.sanitize_properties;return a&&(Fi.error(fl),s=a(s,"$set_once")),t&&(this.Su=!0),x(s)?void 0:s}register(e,t){var i;null===(i=this.persistence)||void 0===i||i.register(e,t)}register_once(e,t,i){var n;null===(n=this.persistence)||void 0===n||n.register_once(e,t,i)}register_for_session(e){var t,i;null===(t=this.persistence)||void 0===t||t.syncCookieProperties(),this.nh(),null===(i=this.sessionPersistence)||void 0===i||i.register(e),Object.keys(e).forEach(e=>this.xu.add(e)),this.sh()}unregister(e){var t;null===(t=this.persistence)||void 0===t||t.unregister(e)}unregister_for_session(e){var t;null===(t=this.sessionPersistence)||void 0===t||t.unregister(e),this.xu.delete(e),this.sh()}ah(e,t){this.register({[e]:t})}Lu(){this.xu.forEach(e=>{var t;null===(t=this.sessionPersistence)||void 0===t||t.unregister(e)}),this.xu.clear(),this.sh()}sh(){var e;if(!this.Cu)return;if("memory"===this.config.persistence||(null===(e=this.sessionPersistence)||void 0===e?void 0:e.pi)||!Fr.Et())return void Fr.Lt(this.Cu);const t=[];this.xu.forEach(e=>t.push(e)),t.length>0?Fr.At(this.Cu,t):Fr.Lt(this.Cu)}getFeatureFlag(e,t){var i;return null===(i=this.featureFlags)||void 0===i?void 0:i.getFeatureFlag(e,t)}getFeatureFlagPayload(e){var t;return null===(t=this.featureFlags)||void 0===t?void 0:t.getFeatureFlagPayload(e)}getFeatureFlagResult(e,t){var i;return null===(i=this.featureFlags)||void 0===i?void 0:i.getFeatureFlagResult(e,t)}getAllFeatureFlags(){var e,t;return null!==(e=null===(t=this.featureFlags)||void 0===t?void 0:t.getAllFeatureFlags())&&void 0!==e?e:[]}isFeatureEnabled(e,t){var i,n;return null!==(i=null===(n=this.featureFlags)||void 0===n?void 0:n.isFeatureEnabled(e,t))&&void 0!==i?i:null==t?void 0:t.defaultValue}reloadFeatureFlags(){var e;null===(e=this.featureFlags)||void 0===e||e.reloadFeatureFlags()}updateFlags(e,t,i){var n;null===(n=this.featureFlags)||void 0===n||n.updateFlags(e,t,i)}updateEarlyAccessFeatureEnrollment(e,t,i){var n;null===(n=this.featureFlags)||void 0===n||n.updateEarlyAccessFeatureEnrollment(e,t,i)}getEarlyAccessFeatures(e,t=!1,i){var n;return null===(n=this.featureFlags)||void 0===n?void 0:n.getEarlyAccessFeatures(e,t,i)}on(e,t){return this.au.on(e,t)}onFeatureFlags(e){return this.featureFlags?this.featureFlags.onFeatureFlags(e):(e([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(e){return this.surveys?this.surveys.onSurveysLoaded(e):(e([],{isLoaded:!1,error:dl}),()=>{})}onSessionId(e){var t,i;return null!==(t=null===(i=this.sessionManager)||void 0===i?void 0:i.onSessionId(e))&&void 0!==t?t:()=>{}}getSurveys(e,t=!1){this.surveys?this.surveys.getSurveys(e,t):e([],{isLoaded:!1,error:dl})}getActiveMatchingSurveys(e,t=!1){this.surveys?this.surveys.getActiveMatchingSurveys(e,t):e([],{isLoaded:!1,error:dl})}renderSurvey(e,t){var i;null===(i=this.surveys)||void 0===i||i.renderSurvey(e,t)}displaySurvey(e,t=nl){var i;null===(i=this.surveys)||void 0===i||i.displaySurvey(e,t)}cancelPendingSurvey(e){var t;null===(t=this.surveys)||void 0===t||t.cancelPendingSurvey(e)}canRenderSurvey(e){var t,i;return null!==(t=null===(i=this.surveys)||void 0===i?void 0:i.canRenderSurvey(e))&&void 0!==t?t:{visible:!1,disabledReason:dl}}canRenderSurveyAsync(e,t=!1){var i,n;return null!==(i=null===(n=this.surveys)||void 0===n?void 0:n.canRenderSurveyAsync(e,t))&&void 0!==i?i:Promise.resolve({visible:!1,disabledReason:dl})}uh(e){return!e||N(e)?(Fi.critical("Unique user id has not been set in posthog.identify"),!1):"$posthog_cookieless"===e?(Fi.critical(`The string "${e}" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.`),!1):!["distinct_id","distinctid"].includes(e.toLowerCase())&&!["undefined","null"].includes(e.toLowerCase())||(Fi.critical(`The string "${e}" was set in posthog.identify which indicates an error. This ID should be unique to the user and n
1ot a hardcoded string.`),!1)}identify(e,t,i){if(!this.__loaded||!this.persistence)return Fi.uninitializedWarning("posthog.identify");if(U(e)&&(e=e.toString(),Fi.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),!this.uh(e))return;if(!this.oh("posthog.identify"))return;this.yu();const n=this.get_distinct_id(),r=this.persistence.syncCookieProperties()&&this.get_distinct_id()!==n,o=this.nh(!1);this.persistence.Pl();let s=!1;try{const n=this.get_distinct_id();this.register({$user_id:e}),this.get_property("$device_id")||this.register_once({$had_persisted_distinct_id:!0,$device_id:n},""),e!==n&&e!==this.get_property("__alias")&&(this.unregister(Ji),this.register({distinct_id:e}));const l=(this.persistence.get_property("$user_state")||"anonymous")===Wn,c=e!==n,u=!c&&l;if(c&&l){var a;const r=this.config.reuseAnonymousId?{distinct_id:e}:{distinct_id:e,$anon_distinct_id:n};this.persistence.set_property(Ln,Yn),this.setPersonPropertiesForFlags({$set:t||{},$set_once:i||{}},!1),this.config.cookieWinsOnConflict&&this.persistence.Rl(),this.capture(tr,r,{$set:t||{},$set_once:i||{}}),this.Eu=Ya(e,t,i),null===(a=this.featureFlags)||void 0===a||a.setAnonymousDistinctId(this.config.reuseAnonymousId?void 0:n)}else if(u){this.persistence.set_property(Ln,Yn);const n=t||{},r=i||{};this.setPersonPropertiesForFlags({$set:n,$set_once:r},!1),this.config.cookieWinsOnConflict&&this.persistence.Rl(),this.capture("$set",{$set:n,$set_once:r}),this.Eu=Ya(e,t,i)}else(t||i)&&this.setPersonProperties(t,i);c||r||o?(this.reloadFeatureFlags(),this.featureFlags?this.featureFlags.resetFlagCallReported():this.unregister(xn)):u&&(t||i)&&this.reloadFeatureFlags(),s=!0}finally{l&&this.persistence.Ol(s)}}setPersonProperties(e,t){if(!e&&!t)return;if(!this.oh("posthog.setPersonProperties"))return;const i=Ya(this.get_distinct_id(),e,t);this.Eu!==i?(this.setPersonPropertiesForFlags({$set:e||{},$set_once:t||{}},!0),this.capture("$set",{$set:e||{},$set_once:t||{}}),this.Eu=i):Fi.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}unsetPersonProperties(e){var t;const i=(T(e)?e:[e]).filter(e=>D(e)&&e.length>0);0!==i.length&&this.oh("posthog.unsetPersonProperties")&&(null===(t=this.featureFlags)||void 0===t||t.unsetPersonPropertiesForFlags(i,!0),this.capture("$set",{$unset:i}),this.Eu=null)}group(e,t,i){var n;if(!e||!t)return void Fi.error("posthog.group requires a group type and group key");null===(n=this.persistence)||void 0===n||n.syncCookieProperties(),this.nh();const r=this.getGroups(),o=r[e]!==t;if(o&&this.resetGroupPropertiesForFlags(e),this.register({$groups:mt(mt({},r),{},{[e]:t})}),(o||i)&&this.rh()){const n={$group_type:e,$group_key:t};i&&(n.$group_set=i),this.capture(ir,n)}i&&this.setGroupPropertiesForFlags({[e]:i}),o&&!i&&this.reloadFeatureFlags()}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,t=!0){var i;null===(i=this.featureFlags)||void 0===i||i.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(e=!0){var t;null===(t=this.featureFlags)||void 0===t||t.resetPersonPropertiesForFlags(e)}setGroupPropertiesForFlags(e,t=!0){var i;this.oh("posthog.setGroupPropertiesForFlags")&&(null===(i=this.featureFlags)||void 0===i||i.setGroupPropertiesForFlags(e,t))}resetGroupPropertiesForFlags(e){var t;null===(t=this.featureFlags)||void 0===t||t.resetGroupPropertiesForFlags(e)}reset(e){const t=j(e)?e:null==e?void 0:e.resetDeviceID,i=j(e)||null==e?void 0:e.bootstrap;this.hh(t,!1,i)}hh(e,t=!1,i){var n,r,o,s,a,l;if(Fi.info("reset"),!this.__loaded)return Fi.uninitializedWarning("posthog.reset");const c=null==i?void 0:i.sessionID;this.config.bootstrap=i||(null===(n=this.Ru)||void 0===n?void 0:n.bootstrap)||{},null===(r=this.featureFlags)||void 0===r||null===(o=r.updateConfig)||void 0===o||o.call(r,this.config,this.Xl());const u=this.get_property(Wi),d=this.get_property(Yi),f=this.get_property(dn);null===(s=this.sessionRecording)||void 0===s||s.flushBeforeIdentityReset();const h=this.is_capturing();this.consent.reset(),t||!h||this.is_capturing()||console.warn("[PostHog.js]","reset() cleared the stored consent, and capturing is now off because of `opt_out_capturing_by_default`. Call opt_in_capturing() again, and prefer calling reset() before opting in rather than after.");const p=null===(a=this.persistence)||void 0===a||null===(l=a.Pl)||void 0===l?void 0:l.call(a);let v=!1;try{var g,m,_,y,b,E,w,I,O,S,A,C,$;if(null===(g=this.persistence)||void 0===g||g.clear(),null===(m=this.sessionPersistence)||void 0===m||m.clear(),this.xu.clear(),this.sh(),R(f)||null===(S=this.persistence)||void 0===S||S.register({$session_recording_remote_config:f}),null===(_=this.surveys)||void 0===_||_.reset(),null===(y=this.featureFlags)||void 0===y||y.reset(),null===(b=this.conversations)||void 0===b||b.reset(),null===(E=this.logs)||void 0===E||E.reset(),null===(w=this.metrics)||void 0===w||w.reset(),null===(I=this.persistence)||void 0===I||I.set_property("$user_state","anonymous"),null===(O=this.sessionManager)||void 0===O||O.resetSessionId(),this.Eu=null,"always"===this.config.cookieless_mode)this.register_once({distinct_id:Bn,$device_id:null},"");else{const t=this.config.get_device_id(_r());this.register_once({distinct_id:t,$device_id:e?t:u},""),e||R(d)||this.register({[Yi]:d})}if(this.register({$last_posthog_reset:(new Date).toISOString()},1),i&&(i.distinctID&&!this.fu()&&(null===($=this.persistence)||void 0===$||$.set_property("$user_state",i.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:i.distinctID})),null===(A=this.featureFlags)||void 0===A||A.initialize(),!M(c)&&!(null===(C=this.sessionManager)||void 0===C?void 0:C.setBootstrapSessionId(c,!0)))){const e=mt({},i);delete e.sessionID,this.config.bootstrap=e}delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,v=!0}finally{var T,P;p&&(null===(T=this.persistence)||void 0===T||null===(P=T.Ol)||void 0===P||P.call(T,v))}this.reloadFeatureFlags()}shutdown(e){var t=this;return Z((function*(){var e,i,n,r,o,s,a,l;if(t.__loaded){t.ku=!0,t.zu().dispose(),null===(e=t.sessionRecording)||void 0===e||e.dispose(),null===(i=t.logs)||void 0===i||i.flushLogs("sendBeacon"),null===(n=t.metrics)||void 0===n||n.flush("sendBeacon"),null===(r=t.metrics)||void 0===r||r.dispose(),null===(o=t.Fu)||void 0===o||o.unload(),null===(s=t.Du)||void 0===s||s.unload();try{var c;null===(c=t.featureFlags)||void 0===c||c.destroy()}catch(e){Fi.error("Error while destroying feature flags",e)}null===(a=t.persistence)||void 0===a||a.destroy(),null===(l=t.sessionPersistence)||void 0===l||l.destroy()}else Fi.uninitializedWarning("posthog.shutdown")}))()}setIdentity(e,t){var i;delete this.config.identity_claims,this.config.identity_distinct_id=e,this.config.identity_hash=t,this.alias(e),null===(i=this.conversations)||void 0===i||i.dh()}clearIdentity(){var e;delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,null===(e=this.conversations)||void 0===e||e.fh()}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,t;return null!==(e=null===(t=this.sessionManager)||void 0===t?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)&&void 0!==e?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";const{sessionId:t,sessionStartTimestamp:i}=this.sessionManager.checkAndGetSessionAndWindowId(!0);let n=this.requestRouter.endpointFor("ui",`/project/${this.config.token}/replay/${t}`);if((null==e?void 0:e.withTimestamp)&&i){var r;const t=null!==(r=e.timestampLookBack)&&void 0!==r?r:10;if(!i)return n;n+=`?t=${Math.max(Math.floor(((new Date).getTime()-i)/1e3)-t,0)}`}return n}alias(e,t){return e===this.get_property("$people_distinct_id")?(Fi.critical("Attempting to create alias for existing People user - aborting."),-2):this.oh("posthog.alias")?(R(t)&&(t=this.get_distinct_id()),e!==t?(this.ah(Ji,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(Fi.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){const t=mt({},this.config);if(k(e)){var i,n,r,o,s,a,l,c,u,d,f,h,p,v;or(this.config,wl(e));const m=this.bu();null===(i=this.persistence)||void 0===i||i.update_config(this.config,t,m),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new ms(mt(mt({},this.config),{},{persistence:"sessionStorage"}),m,!1);const _=this.Pu(this.config.debug);var g;j(_)&&(this.config.debug=_),j(this.config.debug)&&(this.config.debug?(zi.DEBUG=!0,Sr.Et()&&Sr.At("ph_debug",!0),Fi.info("set_config",{config:e,oldConfig:t,newConfig:mt({},this.config)})):(zi.DEBUG=!1,Sr.Et()&&Sr.Lt("ph_debug"))),null===(n=this.featureFlags)||void 0===n||null===(r=n.updateConfig)||void 0===r||r.call(n,this.config,this.Xl()),null===(o=this.exceptionObserver)||void 0===o||o.onConfigChange(),null===(s=this.exceptions)||void 0===s||s.onConfigChange(),null===(a=this.metrics)||void 0===a||a.onConfigChange(),null===(l=this.sessionRecording)||void 0===l||l.startIfEnabledOrStop(),null===(c=this.tracingHeaders)||void 0===c||c.startIfEnabledOrStop(),null===(u=this.autocapture)||void 0===u||u.startIfEnabled(),null===(d=this.heatmaps)||void 0===d||d.startIfEnabled(),("capture_pageview"in e||"disable_capture_url_hashes"in e)&&(null===(g=this.historyAutocapture)||void 0===g||g.startIfEnabledOrStop()),null===(f=this.exceptionObserver)||void 0===f||f.startIfEnabledOrStop(),null===(h=this.deadClicksAutocapture)||void 0===h||h.startIfEnabledOrStop(),null===(p=this.surveys)||void 0===p||p.loadIfEnabled(),this._u(),null===(v=this.externalIntegrations)||void 0===v||v.startIfEnabledOrStop(),!t.segment&&this.config.segment&&this.persistence&&ko(this,cl,!1)}}_overrideSDKInfo(e,t){zi.LIB_NAME=e,zi.LIB_VERSION=t}startSessionRecording(e){const t=!0===e,i={sampling:t||!!(null==e?void 0:e.sampling),linked_flag:t||!!(null==e?void 0:e.linked_flag),url_trigger:t||!!(null==e?void 0:e.url_trigger),event_trigger:t||!!(null==e?void 0:e.event_trigger)};var n,r,o,s,a;Object.values(i).some(Boolean)&&(null===(n=this.sessionManager)||void 0===n||n.checkAndGetSessionAndWindowId(),i.sampling&&(null===(r=this.sessionRecording)||void 0===r||r.overrideSampling()),i.linked_flag&&(null===(o=this.sessionRecording)||void 0===o||o.overrideLinkedFlag()),i.url_trigger&&(null===(s=this.sessionRecording)||void 0===s||s.overrideTrigger("url")),i.event_trigger&&(null===(a=this.sessionRecording)||void 0===a||a.overrideTrigger("event"))),this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!!(null===(e=this.sessionRecording)||void 0===e?void 0:e.started)}captureException(e,t){try{if(!this.exceptions)return;const i=this.exceptions.buildProperties(e,{handled:!0,syntheticException:new Error("PostHog syntheticException")});return this.exceptions.sendExceptionEvent(mt(mt({},i),t))}catch(e){return}}addExceptionStep(e,t){var i;null===(i=this.exceptions)||void 0===i||i.addExceptionStep(e,t)}captureLog(e){var t;null===(t=this.logs)||void 0===t||t.captureLog(e)}get logger(){var t,i;return null!==(t=null===(i=this.logs)||void 0===i?void 0:i.logger)&&void 0!==t?t:e.ph}startExceptionAutocapture(e){this.set_config({capture_exceptions:null==e||e})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(e){var t,i;return null!==(t=null===(i=this.toolbar)||void 0===i?void 0:i.loadToolbar(e))&&void 0!==t&&t}get_property(e){var t;return null===(t=this.persistence)||void 0===t?void 0:t.props[e]}getSessionProperty(e){var t;return null===(t=this.sessionPersistence)||void 0===t?void 0:t.props[e]}toString(){var e;let t=null!==(e=this.config.name)&&void 0!==e?e:ml;return t!==ml&&(t="posthog."+t),t}_isIdentified(){var e,t;return"identified"===(null===(e=this.persistence)||void 0===e?void 0:e.get_property("$user_state"))||"identified"===(null===(t=this.sessionPersistence)||void 0===t?void 0:t.get_property("$user_state"))}rh(){var e,t;return!("never"===this.config.person_profiles||"identified_only"===this.config.person_profiles&&
vendor: 4,200 bytes, line 1
1!this._isIdentified()&&x(this.getGroups())&&!(null===(e=this.persistence)||void 0===e||null===(e=e.props)||void 0===e?void 0:e.__alias)&&!(null===(t=this.persistence)||void 0===t||null===(t=t.props)||void 0===t?void 0:t.$epp))}Ku(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&!!this.config.capture_pageview}createPersonProfile(){this.rh()||this.oh("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.oh("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}oh(e){return"never"===this.config.person_profiles?(Fi.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.pu(),this.ah(Vn,!0),!0)}bu(){if("always"===this.config.cookieless_mode)return!0;const e=this.consent.isOptedOut();return this.config.disable_persistence||e&&!(!this.config.opt_out_persistence_by_default&&"on_reject"!==this.config.cookieless_mode)}_u(){var e,t;const i=this.bu();var n,r,o;return this.is_capturing()||null===(n=this.logs)||void 0===n||n.gh(),(null===(e=this.persistence)||void 0===e?void 0:e.pi)!==i&&(null===(r=this.persistence)||void 0===r||r.set_disabled(i)),(null===(t=this.sessionPersistence)||void 0===t?void 0:t.pi)!==i&&(null===(o=this.sessionPersistence)||void 0===o||o.set_disabled(i)),i&&(this.xu.clear(),this.sh()),i}opt_in_capturing(t){var i;if("always"!==this.config.cookieless_mode){if(this.fu()){var n,r,o,s,a,l;null===(n=this.sessionRecording)||void 0===n||n.dispose({discardBufferedEvents:!0}),this.hh(!0,!0),null===(r=this.sessionManager)||void 0===r||r.destroy(),null===(o=this.pageViewManager)||void 0===o||o.destroy(),this.sessionManager=new ja(this),this.pageViewManager=new Do(this),this.persistence&&(this.sessionPropsManager=new Ma(this,this.sessionManager,this.persistence));const t=null!==(s=null===(a=this.config.__extensionClasses)||void 0===a?void 0:a.sessionRecording)&&void 0!==s?s:null===(l=e.__defaultExtensionClasses)||void 0===l?void 0:l.sessionRecording;var c,u;t&&(this.sessionRecording=this.vu(this.sessionRecording,new t(this)),this.lu&&(null===(c=this.sessionRecording)||void 0===c||null===(u=c.onRemoteConfig)||void 0===u||u.call(c,this.lu)))}var d,f;this.consent.optInOut(!0),this._u(),this.Zu(),null===(i=this.sessionRecording)||void 0===i||i.startIfEnabledOrStop(),"on_reject"==this.config.cookieless_mode&&(null===(d=this.surveys)||void 0===d||d.loadIfEnabled()),(R(null==t?void 0:t.captureEventName)||(null==t?void 0:t.captureEventName))&&this.capture(null!==(f=null==t?void 0:t.captureEventName)&&void 0!==f?f:"$opt_in",null==t?void 0:t.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Qu()}else Fi.warn(ul)}opt_out_capturing(){if("always"===this.config.cookieless_mode)return void Fi.warn(ul);const e="on_reject"===this.config.cookieless_mode?this.sessionRecording:void 0;var t,i;null==e||e.dispose({discardBufferedEvents:!0}),"on_reject"===this.config.cookieless_mode&&this.consent.isOptedIn()&&this.hh(!0,!0),this.consent.optInOut(!1),this._u(),"on_reject"===this.config.cookieless_mode&&(this.register({distinct_id:Bn,$device_id:null}),this.du(e),this.sessionRecording=void 0,null===(t=this.sessionManager)||void 0===t||t.destroy(),null===(i=this.pageViewManager)||void 0===i||i.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this.Qu(),this.Zu())}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){const e=this.consent.consent;return 1===e?"granted":0===e?"denied":"pending"}is_capturing(){return"always"===this.config.cookieless_mode||("on_reject"===this.config.cookieless_mode?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this._u()}_is_bot(){return o?Va(o,this.config.custom_blocked_useragents):void 0}Qu(){s&&("visible"===s.visibilityState?this.Tu||(this.Tu=!0,this.capture(Qn,{title:s.title},{send_instantly:!0}),this.Iu&&(s.removeEventListener(Xn,this.Iu),this.Iu=null)):this.Iu||(this.Iu=this.Qu.bind(this),fr(s,Xn,this.Iu)))}
1debug(e){!1===e?(null==n||n.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==n||n.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),this.set_config({debug:!0}))}Xl(){const e=this.Ru||{};return"advanced_disable_flags"in e?!!e.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(Fi.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):function(e,t,i,n,r){const o=t in e&&!M(e[t]),s=i in e&&!M(e[i]);return o?e[t]:!!s&&(r&&r.warn(`Config field '${i}' is deprecated. Please use '${t}' instead. The old field will be removed in a future major version.`),e[i])}(e,"advanced_disable_flags","advanced_disable_decide",0,Fi)}Os(e){var t;if(M(this.config.before_send))return e;const i=Object.keys(null!==(t=e.properties)&&void 0!==t?t:{}).filter(B),n=T(this.config.before_send)?this.config.before_send:[this.config.before_send];let r=e;for(const i of n)try{if(r=i(r),M(r)){const t=`Event '${e.event}' was rejected in beforeSend function`;return V(e.event)?Fi.warn(`${t}. This can cause unexpected behavior.`):Fi.info(t),null}r.properties&&!x(r.properties)||Fi.warn(`Event '${e.event}' has no properties after beforeSend function, this is likely an error.`)}catch(t){return Fi.error(`Error in beforeSend function for event '${e.event}':`,t),null}for(const t of i)if(r.properties&&M(r.properties[t]))return Fi.warn(`Event '${e.event}' had its '${t}' property removed in a beforeSend function. This property is required for ingestion, so the event will be dropped.`),null;return r}getPageViewId(){var e;return null===(e=this.pageViewManager.Bo)||void 0===e?void 0:e.pageViewId}captureTraceFeedback(e,t){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:t})}captureTraceMetric(e,t,i){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:t,$ai_metric_value:String(i)})}Pu(e){const t=j(e)&&!e,i=Sr.Et()&&"true"===Sr.Ot("ph_debug");return!t&&(!!i||e)}};Il.__defaultExtensionClasses={},Il.ph=(()=>{const e=()=>{};return{trace:e,debug:e,info:e,warn:e,error:e,fatal:e}})(),function(e,t){for(let i=0;t.length>i;i++)e.prototype[t[i]]=ar(e.prototype[t[i]])}(Il,["identify"]);var Ol=class{constructor(e){this.disabled=!1===e;const t=k(e)?e:{};this.thresholdPx=t.threshold_px||30,this.timeoutMs=t.timeout_ms||1e3,this.clickCount=t.click_count||3,this.clicks=[]}isRageClick(e,t,i){if(this.disabled)return!1;const n=this.clicks[this.clicks.length-1];if(n&&Math.abs(e-n.x)+Math.abs(t-n.y)<this.thresholdPx&&this.timeoutMs>i-n.timestamp){if(this.clicks.push({x:e,y:t,timestamp:i}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:t,timestamp:i}];return!1}};const Sl="$copy_autocapture",Al=ji("[AutoCapture]");function Cl(e,t){return t.length>e?t.slice(0,e)+"...":t}function $l(e){if(e.previousElementSibling)return e.previousElementSibling;let t=e;do{t=t.previousSibling}while(t&&!Gr(t));return t}const Tl=ji("[ExceptionAutocapture]"),Pl=()=>{},kl=e=>{var t;if(P(e))return null!==(t=e.__posthog_layer__)&&void 0!==t?t:e.__rrweb_layer__};function xl(e,t,i){try{if(!(t in e))return Pl;const n={next:e[t]},r=i((function(...e){return n.next.apply(this,e)}));return P(r)&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:n}})),e[t]=r,()=>{if(e[t]===r)return void(e[t]=n.next);let i=e[t],o=kl(i);for(;o;){if(o.next===r)return void(o.next=n.next);i=o.next,o=kl(i)}}}catch(e){return Pl}}const Rl=ji("[TracingHeaders]"),Dl=ji("[Web Vitals]"),Nl=["CLS","FCP","INP","LCP"],Ll=["INP","LCP"],Ml=["interactionTarget","interactionType","inputDelay","processingDuration","presentationDelay","loadState","target","url","timeToFirstByte","resourceLoadDelay","resourceLoadDuration","elementRenderDelay","largestShiftTarget","largestShiftTime","largestShiftValue","firstByteToFCP"],Ul="disabled",Fl="lazy_loading",jl=ji("[SessionRecording]"),Vl=ji("[Heatmaps]");function Bl(e){return k(e)&&"clientX"in e&&"clientY"in e&&U(e.clientX)&&U(e.clientY)}const Gl=ji("[Product Tours]"),ql=e=>{var t;return!e.config.disable_product_tours&&!!(null===(t=e.persistence)||void 0===t?void 0:t.get_property(ln))},Hl=["$set_once","$set"],zl=ji("[SiteApps]"),Kl="Error while initializing PostHog app with config id ",Wl=(e,t)=>
1(null==e?void 0:e.then)?e.then(t):t(e),Yl="SDK is not enabled or survey functionality is not yet loaded",Jl="Disabled. Not loading surveys.";function Xl(e,t,i){if(M(e))return!1;switch(i){case"exact":return e===t;case"contains":{const i=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(i,"i").test(e)}case"regex":try{return new RegExp(t).test(e)}catch(e){return!1}default:return!1}}var Zl=class{constructor(e){this._instance=e}initialize(){}get(e){if("string"==typeof e)return this._instance.get_property(e);const t={};for(const i of e){const e=this._instance.get_property(i);R(e)||(t[i]=e)}return t}set(e,t){this._instance.register("string"==typeof e?{[e]:t}:e)}remove(e){"string"!=typeof e?e.forEach(e=>this._instance.unregister(e)):this._instance.unregister(e)}};const Ql=(null==n?void 0:n.location)?Go(n.location.hash,"__posthog")||Go(location.hash,"state"):null,ec="_postHogToolbarParams",tc=ji("[Toolbar]"),ic=ji("[FeatureFlags]");const nc=ji("[FeatureFlags]"),rc=ji("[FeatureFlags]",{debugEnabled:!0}),oc="\" failed. Feature flags didn't load in time.",sc=["click","keydown","wheel","touchstart","pointerdown"],ac="connection_error",lc=e=>{const t={};for(let i=0;e.length>i;i++)t[e[i]]=!0;return t},cc=e=>{const t={};for(const[i,n]of sr(e||{}))n&&(t[i]=n);return t},uc=e=>H(e)&&("RangeError"===e.name&&0===e.message.indexOf("Maximum call stack size exceeded")||"InternalError"===e.name&&"too much recursion"===e.message),dc=ji("[Error tracking]"),fc="webkit-masked-url:",hc=[{value:"isolatedAPI.contexts.topHostname",exact:!1},{value:"No response from target",exact:!0}],pc=["chrome-extension://","moz-extension://","safari-extension:","safari-web-extension:",fc],vc=["__firefox__","__gCrWeb"],gc="Refusing to render web experiment since the viewer is a likely bot",mc={icontains:(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>-1===t.toLowerCase().indexOf(e.toLowerCase()),regex:(e,t)=>Ha(t,e),not_regex:(e,t)=>!Ha(t,e),exact:(e,t)=>t===e,is_not:(e,t)=>t!==e},_c=ji("[Conversations]"),yc="Conversations not available yet.";function bc(e,t){var i,n,r,s,a,l,c;const u=null!==(i=null==e?void 0:e.flushIntervalMs)&&void 0!==i?i:3e3,d=null!==(n=null==e?void 0:e.maxBufferSize)&&void 0!==n?n:100,f=(null==t?void 0:t.consoleCapture)?void 0:null!==(r=null==e?void 0:e.maxLogsPerInterval)&&void 0!==r?r:1e3,h=R(f)?Math.max(d,2048):Math.max(d,f),p=mt(mt({},function(){let e="",t="";try{const i=null==o?void 0:o.userAgent;i&&([e,t]=Ke(i))}catch(e){}return function(e,t){const i=function(e){if(e)return{}.hasOwnProperty.call(Oi,e)?Oi[e]:e}(e);return mt(mt({},i?{"os.name":i}:{}),t?{"os.version":t}:{})}(e,t)}()),null==e?void 0:e.resourceAttributes);return{serviceName:null!==(s=null!==(a=null==p?void 0:p["service.name"])&&void 0!==a?a:null==e?void 0:e.serviceName)&&void 0!==s?s:null==t?void 0:t.serviceNameDefault,serviceVersion:null!==(l=null==p?void 0:p["service.version"])&&void 0!==l?l:null==e?void 0:e.serviceVersion,environment:null!==(c=null==p?void 0:p["deployment.environment"])&&void 0!==c?c:null==e?void 0:e.environment,resourceAttributes:p,beforeSend:null==e?void 0:e.beforeSend,flushIntervalMs:u,maxBufferSize:d,maxQueueSize:h,maxBatchRecordsPerPost:100,rateCapWindowMs:u,maxLogsPerInterval:f,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}}const Ec=["debug","log","warn","error","info"],wc=e=>{for(;null==e?void 0:e.__rrweb_original__;)e=e.__rrweb_original__;return e},Ic="console",Oc="__posthogHandledLogsRequestError",Sc=(e,t)=>{const i=e instanceof Error?e:new Error(t);return i[Oc]=!0,i},Ac=e=>!!e&&"object"==typeof e&&!0===e[Oc],Cc=ji("[NetworkMetrics]"),$c=()=>{var e;return(null==n||null===(e=n.performance)||void 0===e?void 0:e.now)?n.performance.now():Date.now()},Tc=e=>e?`${Math.floor(e/100)}xx`:"missing",Pc=(e,t)=>{var i;const n=String(t);return{method:String(e).toUpperCase(),url:(null===(i=jo(n))||void 0===i?void 0:i.href)||n}},kc=(e,t,i,n,r)=>{try{var o,s,a;const c=r();if(!c)return;const u=i||void 0,d=$c()-n,f=jo(t.url);if(f&&"http:"!==f.protocol&&"https:"!==f.protocol)return;const h={url:(null==f?void 0:f.href)||t.url,method:t.method},p=P(c.name)?c.name(h):D(c.name)?c.name:"http.client.request.duration";if(!p)return;const v=mt({method:h.method,host:null!==(o=null==f?void 0:f.hostname)&&void 0!==o?o:"",path:f?(l=f.pathname,l.
1split("/").map(e=>(e=>/^\d+$/.test(e)||e.length>=8&&/^[0-9a-f-]*\d[0-9a-f-]*$/i.test(e))(e)?":id":e).join("/")):"",status_class:Tc(u)},null===(s=c.attributes)||void 0===s?void 0:s.call(c,h,{status:u,durationMs:d}));null===(a=e.metrics)||void 0===a||a.histogram(p,d,{unit:"ms",attributes:v})}catch(e){Cc.error("Failed to record network metric",e)}var l},xc=()=>{},Rc=(e,t)=>P(null==n?void 0:n.fetch)?xl(n,"fetch",i=>function(...n){const r=$c(),o=i.apply(this,n);if(!t())return o;try{var s,a,l;const[i,c]=n,u=Pc(null!==(s=null!==(a=null==c?void 0:c.method)&&void 0!==a?a:null==i?void 0:i.method)&&void 0!==s?s:"GET",null!==(l=null==i?void 0:i.url)&&void 0!==l?l:i);return o.then(i=>(kc(e,u,null==i?void 0:i.status,r,t),i),i=>{throw kc(e,u,void 0,r,t),i})}catch(e){return Cc.error("Failed to observe fetch",e),o}}):xc,Dc=(e,t)=>{var i;const r=null==n||null===(i=n.XMLHttpRequest)||void 0===i?void 0:i.prototype;if(!r)return xc;const o=new WeakMap,s=xl(r,"open",e=>function(...t){try{(()=>_a.has(this))()||o.set(this,Pc(t[0],t[1]))}catch(e){Cc.error("Failed to observe XHR open",e)}return e.apply(this,t)}),a=xl(r,"send",i=>function(...n){let r;try{const i=o.get(this);if(i&&t()){const n=$c();r=()=>{this.removeEventListener("loadend",r),kc(e,i,this.status,n,t)},fr(this,"loadend",r)}}catch(e){Cc.error("Failed to observe XHR send",e)}try{return i.apply(this,n)}catch(e){throw r&&this.removeEventListener("loadend",r),e}});return()=>{s(),a()}},Nc={featureFlags:class{constructor(e){this.name="featureFlags",this.Hc=!1,this.featureFlagEventHandlers=[],this.$=nc,this.zc={},this.Uc={},this.Wc=[],this.Vc=!1,this.Gc=!1,this.Zc=0,this.Qc=!1,this.Jc=!1,this.Kc=!1,this.Xc=!1,this.Yc=0,this.td=!1,this.sn=()=>{const e=this.ed();this.Yc=0,e&&this.reloadFeatureFlags()},this.nd=()=>{var e,t;const i=this.sd,n=null!==(e=this.rd)&&void 0!==e?e:i;R(i)||R(n)||this.Mr.remoteRequestsDisabled||!s||"hidden"===s.visibilityState||Date.now()-(null!==(t=this.od)&&void 0!==t?t:0)<n||(this.rd=this.td||!this.Mr.idleRefreshBackoff?i:Math.min(2*n,36e5),this.td=!1,this.reloadFeatureFlags(),this.ld())},this.ad=()=>{this.td&&this.rd===this.sd||this.ud()},this.an=()=>{"visible"===(null==s?void 0:s.visibilityState)&&this.ud()},"get"in e?this.yo=e:(this._instance=e,this.hd=new class{constructor(e,t=!1){this.jc=!1,this.update(e,t)}update(e,t){this.Bc=((e,t)=>{var i,n,r,o,s,a,l;return{bootstrap:{featureFlags:null!==(i=null===(n=e.bootstrap)||void 0===n?void 0:n.featureFlags)&&void 0!==i?i:void 0,featureFlagPayloads:null!==(r=null===(o=e.bootstrap)||void 0===o?void 0:o.featureFlagPayloads)&&void 0!==r?r:void 0},remoteRequestsDisabled:t,featureFlagsDisabled:!!e.advanced_disable_feature_flags,onlyEvaluateSurveyFeatureFlags:!!e.advanced_only_evaluate_survey_feature_flags,deduplicateCallsPerSession:!!e.advanced_feature_flags_dedup_per_session,cacheTtlMs:e.feature_flag_cache_ttl_ms,refreshIntervalMs:null!==(s=e.remote_config_refresh_interval_ms)&&void 0!==s?s:3e5,idleRefreshBackoff:R(e.remote_config_refresh_interval_ms),requestTimeoutMs:e.feature_flag_request_timeout_ms,compression:e.disable_compression?void 0:"best-available",evaluationContexts:null!==(a=null!==(l=e.evaluation_contexts)&&void 0!==l?l:e.evaluation_environments)&&void 0!==a?a:[],flagKeys:T(e.flag_keys)?e.flag_keys:void 0}})(e,t),!e.evaluation_environments||e.evaluation_contexts||this.jc||(ic.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.jc=!0),R(e.flag_keys)||T(e.flag_keys)||ic.error("Invalid flag_keys found:",e.flag_keys,"Expected array of non-empty strings")}get(){return this.Bc}}(e.config,e.Xl()),this.yo=this.hd)}updateConfig(e,t){var i;null===(i=this.hd)||void 0===i||i.update(e,t),this.po&&this.dd()}setup(e){return this.xh=e,this.$=e.logger.createLogger("[FeatureFlags]"),Wl(e.kv.initialize(),()=>{this.xh===e&&(this.xh=void 0,this.po=e,this.vd(e))})}vd(e){var t;if(this.po===e)return n&&fr(n,"online",this.sn),this.dd(),this.fd=e.registerDynamicEventProperties(()=>this.pd()?this.zc:this.Uc),this.gd=null===(t=this._instance)||void 0===t||null===(t=t.persistence)||void 0===t?void 0:t.onCrossTabFeatureFlagChange(()=>{this.md(),this.yd(),this.bd()}),this.yd(),this.initialize()}ud(){this.td=!0,this.rd=this.sd,this.nd()}dd(){const e=this.Mr.refreshIntervalMs,t=!this.Mr.remoteRequestsDisabled&&s&&!R(e)&&e>0?e:void 0;this.Mr.idleRefreshBackoff||(this.rd=t),t!==this.sd&&(this._d(),R(t)||(this.sd=t,this.rd=t,this.ld(),(null==s?void 0:s.addEventListener)&&(fr(s,Xn,this.an),nr(sc,e=>{fr(s,e,this.ad,{capture:!0})}
1))))}ld(){R(this.sd)||(R(this.wd)||clearInterval(this.wd),this.od=Date.now(),this.wd=setInterval(this.nd,this.sd))}_d(){var e;R(this.wd)||(clearInterval(this.wd),this.wd=void 0,null==s||null===(e=s.removeEventListener)||void 0===e||e.call(s,"visibilitychange",this.an),nr(sc,e=>{var t;null==s||null===(t=s.removeEventListener)||void 0===t||t.call(s,e,this.ad,{capture:!0})})),this.sd=void 0,this.rd=void 0,this.td=!1,this.od=void 0}destroy(){this.kd()}dispose(){this.kd()}kd(){var e,t;this._d(),this.Zc++,this.Jc=!1,this.xh=void 0,this.po&&(this.Sd(),null===(e=this.fd)||void 0===e||e.dispose(),this.fd=void 0,null===(t=this.gd)||void 0===t||t.call(this),this.gd=void 0,this.Wc=[],null==n||n.removeEventListener("online",this.sn),this.po=void 0)}get Mr(){return this.yo.get()}xd(e){var t;return this.Cd&&e in this.Cd?this.Cd[e]:null===(t=this.po)||void 0===t?void 0:t.kv.get(e)}md(){return!!this.Cd&&(this.Cd=void 0,!0)}$d(){var e;return!R(null===(e=this.po)||void 0===e?void 0:e.kv.get("$enabled_feature_flags"))&&this.md()}At(e){this.Td(()=>{var t;return null===(t=this.po)||void 0===t?void 0:t.kv.set(e)})}Id(e,t,i){var n;if(!(null===(n=this._instance)||void 0===n?void 0:n.persistence)||!e.$enabled_feature_flags)return;const r=this.xd("$enabled_feature_flags")||{},o=e.$enabled_feature_flags||{},s=t.flags||t.featureFlags,a=t.flags?Object.entries(t.flags).filter(([,e])=>!(null==e?void 0:e.failed)).map(([e])=>e):[],l=!!t.errorsWhileComputingFlags&&!!t.flags,c=l?a:i&&!T(s)?Object.keys(s||{}):Array.from(new Set([...Object.keys(r),...Object.keys(o)])),u=this.xd("$feature_flag_payloads")||{},d=e.$feature_flag_payloads||{},f=l||i?c:Array.from(new Set([...Object.keys(u),...Object.keys(d)])),h=!l&&!i,p=!!h||c,v={[vn]:p,[pn]:p,[_n]:!!h||f};e.$feature_flag_details&&(v[mn]=p);for(const t of[yn,Nn,bn])R(e[t])||(v[t]=!0);this._instance.persistence.markCrossTabFeatureFlagChanges(v)}Lt(e){this.Td(()=>{var t;return null===(t=this.po)||void 0===t?void 0:t.kv.remove(e)})}Td(e){try{e()}catch(e){this.$.error("Failed to update feature flag persistence",e)}}yd(){const e={};for(const t of[vn,_n,yn,En]){const i=this.xd(t);R(i)||(e[t]=i)}this.zc=e;const t=mt({},e),i=this.xd(pn);if(i)for(const[e,n]of Object.entries(i))t[`$feature/${e}`]=n;this.Uc=t}pd(){const e=this.Mr.cacheTtlMs;if(!e||0>=e)return!1;const t=this.xd(Nn);return"number"!=typeof t||Date.now()-t>e}Md(){return!!this.pd()&&(this.Xc||this.Gc||(this.Xc=!0,this.$.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}Ed(){const e=this.Mr.evaluationContexts;return(null==e?void 0:e.length)?e.filter(e=>{const t=e&&"string"==typeof e&&e.trim().length>0;return t||this.$.error("Invalid evaluation context found:",e,"Expected non-empty string"),t}):[]}Pd(){const e=this.Mr.flagKeys;if(!R(e))return e.filter(e=>{const t=e&&"string"==typeof e&&e.trim().length>0;return t||this.$.error("Invalid flag key found:",e,"Expected non-empty string"),t})}initialize(){var e,t;const i=this.Mr,n=null!==(e=null===(t=i.bootstrap)||void 0===t?void 0:t.featureFlags)&&void 0!==e?e:{};if(Object.keys(n).length){var r,o;const e=null!==(r=null===(o=i.bootstrap)||void 0===o?void 0:o.featureFlagPayloads)&&void 0!==r?r:{},t=Object.keys(n).filter(e=>!R(n[e])).reduce((e,t)=>(e[t]=n[t],e),{}),s=Object.keys(e).filter(e=>t[e]).reduce((t,i)=>(t[i]=e[i],t),{});return this.Rd({featureFlags:t,featureFlagPayloads:s},void 0,{persist:!1})}}updateFlags(e,t,i){var n,r;const o=(null==i?void 0:i.merge)&&null!==(n=this.xd("$enabled_feature_flags"))&&void 0!==n?n:{},s=(null==i?void 0:i.merge)&&null!==(r=this.xd("$feature_flag_payloads"))&&void 0!==r?r:{},a=mt(mt({},o),e),l=mt(mt({},s),t),c={};for(const[e,t]of Object.entries(a))c[e]={key:e,enabled:ii(t),variant:ni(t),reason:void 0,metadata:R(null==l?void 0:l[e])?void 0:{id:0,version:void 0,description:void 0,payload:l[e]}};this.Rd({flags:c})}get hasLoadedFlags(){return this.Vc}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){const e=this.xd(mn),t=this.xd(En),i=this.xd(wn);if(!i&&!t)return e||{};const n=or({},e||{}),r=[...new Set([...Object.keys(i||{}),...Object.keys(t||{})])];for(const e of r){var o;const r=n[e],a=null==t?void 0:t[e],l=R(a)?null!==(o=null==r?void 0:r.enabled)&&void 0!==o&&o:!!a,c=R(a)?null==r?void 0:r.variant:"string"==typeof a?a:void 0,u=null==i?void 0:i[e],d=mt(mt({},r),{},{enabled:l,variant:l?null!=c?c:null==r?void 0:r.variant:void 0});var s;l!==(null==r?void 0:r.enabled)&&(d.original_enabled=null==r?void 0:r.enabled),c!==(null==r?void 0:r.variant)&&(
1d.original_variant=null==r?void 0:r.variant),u&&(d.metadata=mt(mt({},null==r?void 0:r.metadata),{},{payload:u,original_payload:null==r||null===(s=r.metadata)||void 0===s?void 0:s.payload})),n[e]=d}return this.Hc||(this.$.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:i,finalDetails:n}),this.Hc=!0),n}getAllFeatureFlags(){const e=this.getFlagVariants(),t=this.getFlagPayloads();return Object.keys(e).map(i=>{const n=e[i];return{key:i,enabled:ii(n),variant:ni(n),payload:ti(t[i])}})}getFlagVariants(){const e=this.xd(pn),t=this.xd(En);if(!t)return e||{};const i=or({},e||{}),n=Object.keys(t);for(let e=0;n.length>e;e++)i[n[e]]=t[n[e]];return this.Hc||(this.$.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:i}),this.Hc=!0),i}getFlagPayloads(){const e=this.xd(_n),t=this.xd(wn);if(!t)return e||{};const i=or({},e||{}),n=Object.keys(t);for(let e=0;n.length>e;e++)i[n[e]]=t[n[e]];return this.Hc||(this.$.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:i}),this.Hc=!0),i}reloadFeatureFlags(){this.Qc||this.Mr.featureFlagsDisabled||this.ed()||(this.Gc&&(this.Jc=!0),this.Ad||(this.Wc.slice().forEach(e=>{try{e()}catch(e){this.$.error("Error while running feature flags reloading callback",e)}}),this.Ad=setTimeout(()=>{this.Fd()},5)))}Sd(){clearTimeout(this.Ad),this.Ad=void 0}onReloading(e){return this.Wc.push(e),()=>{this.Wc=this.Wc.filter(t=>t!==e)}}ensureFlagsLoaded(){this.Vc||this.Gc||this.Ad||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.Qc=e}resetFlagCallReported(){this.Lt(xn)}Fd(e){this.Sd();const t=this.po;if(!t||this.Mr.remoteRequestsDisabled||this.ed())return;if(this.Gc)return void(this.Jc=!0);const i={token:t.projectToken,distinct_id:t.distinctId,groups:t.groups,$anon_distinct_id:this.$anon_distinct_id,person_properties:mt(mt(mt({},t.initialPersonProperties),this.xd("$stored_person_properties")||{}),{},{$lib:t.library.name,$lib_version:t.library.version}),group_properties:this.xd(On),timezone:os()};R(t.deviceId)||(i.$device_id=t.deviceId),((null==e?void 0:e.disableFlags)||this.Mr.featureFlagsDisabled)&&(i.disable_flags=!0);const n=this.Ed();n.length&&(i.evaluation_contexts=n);const r=this.Pd();R(r)||(i.flag_keys=r);const o=this.Mr.onlyEvaluateSurveyFeatureFlags,s="/flags/?v=2"+(o?"&only_evaluate_survey_feature_flags=true":""),a=this.Zc;this.Gc=!0;const l=()=>{this.Jc&&(this.Jc=!1,this.Fd())},c=e=>{var t,n;const r=null!==(t=e.json)&&void 0!==t?t:{},s=200!==e.statusCode;if(this.Gc=!1,a!==this.Zc)return void l();if(this.Od(e.statusCode),s||this.Jc||(this.$anon_distinct_id=void 0),i.disable_flags&&!this.Jc)return;this.Kc=!s;const c=[];e.error?c.push(e.error instanceof Error&&"AbortError"===e.error.name?"timeout":e.error instanceof Error?ac:"unknown_error"):200!==e.statusCode&&c.push(`api_error_${e.statusCode}`),r.errorsWhileComputingFlags&&c.push("errors_while_computing_flags");const u=!!(null===(n=r.quotaLimited)||void 0===n?void 0:n.includes("feature_flags"));u&&c.push("quota_limited"),this.At({[Dn]:c}),u?this.$.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more."):i.disable_flags||this.Rd(r,s,{partialResponse:o}),l()},u=e=>{this.Gc=!1,a===this.Zc?(this.At({[Dn]:[ac]}),this.$.error("Feature flag request failed",e),this.$d()&&this.bd(!0),l()):l()};try{t.sendRequest(s,{target:"flags",method:"POST",body:i,compression:this.Mr.compression,sentAt:"body",timeoutMs:this.Mr.requestTimeoutMs}).then(c).catch(u)}catch(e){u(e)}}ed(){return qo(this.Yc,3)}Od(e){this.Yc=Ho(e,this.Yc,3,()=>this.$.warn("Feature flag requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped refreshing feature flags; will try again when connectivity changes."))}getFeatureFlag(e,t={}){var i;if(t.fresh&&!this.Kc)return;if(!(this.Vc||this.getFlags()&&this.getFlags().length>0))return void this.$.warn('getFeatureFlag for key "'+e+oc);if(this.Md())return;const n=this.getFeatureFlagResult(e,t);return null!==(i=null==n?void 0:n.variant)&&void 0!==i?i:null==n?void 0:n.enabled}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){const t=this.getFeatureFlagResult(e,{send_event:!1});return null==t?void 0:t.payload}getFeatureFlagResult(e,t={}){if(t.fresh&&!this.Kc)return;if(!(this.Vc||this.getFlags()&&this.getFlags().length>0))return void this.$.warn('getFeatureFlagResult for key "'+e+oc);if(this.Md())return;const i=this.getFlagVariants(),n=e in i,r=i[e],o=this.getFlagPayloads()[e],s=String(r),a=this.xd("$feature_flag_request_id")||void 0,l=this.xd("$feature_flag_evaluated_at")||void 0;let c,u=this.xd("$flag_call_reported")||{};if(this.Mr.deduplicateCallsPerSession){var d;const e=null===(d=this.po)||void 0===d?void 0:d.session.sessionId,t=this.xd(Rn);e&&e!==t&&(u={},c=e)}if(!t.send_event&&"send_event"in t)c&&this.At({[xn]:u,[Rn]:c});else if(e in u&&u[e].includes(s))c&&this.At({[xn]:u,[Rn]:c});else{var f,h,p,v,g,m,_,y,b,E,w,I;T(u[e])?u[e].push(s):u[e]=[s],this.At(mt({[xn]:u}
1,c?{[Rn]:c}:{}));const t=this.getFeatureFlagDetails(e),i=[...null!==(f=this.xd("$feature_flag_errors"))&&void 0!==f?f:[]];R(r)&&i.push("flag_missing");const n={$feature_flag:e,$feature_flag_response:r,$feature_flag_payload:null!=o?o:null,$feature_flag_request_id:a,$feature_flag_evaluated_at:l,$feature_flag_bootstrapped_response:null!==(h=null===(p=this.Mr.bootstrap)||void 0===p||null===(p=p.featureFlags)||void 0===p?void 0:p[e])&&void 0!==h?h:null,$feature_flag_bootstrapped_payload:null!==(v=null===(g=this.Mr.bootstrap)||void 0===g||null===(g=g.featureFlagPayloads)||void 0===g?void 0:g[e])&&void 0!==v?v:null,$used_bootstrap_value:!this.Kc};R(null==t||null===(m=t.metadata)||void 0===m?void 0:m.has_experiment)||(n.$feature_flag_has_experiment=t.metadata.has_experiment),R(null==t||null===(_=t.metadata)||void 0===_?void 0:_.version)||(n.$feature_flag_version=t.metadata.version);const d=null!==(y=null==t||null===(b=t.reason)||void 0===b?void 0:b.description)&&void 0!==y?y:null==t||null===(E=t.reason)||void 0===E?void 0:E.code;var O;d&&(n.$feature_flag_reason=d),(null==t||null===(w=t.metadata)||void 0===w?void 0:w.id)&&(n.$feature_flag_id=t.metadata.id),R(null==t?void 0:t.original_variant)&&R(null==t?void 0:t.original_enabled)||(n.$feature_flag_original_response=R(t.original_variant)?t.original_enabled:t.original_variant),(null==t||null===(I=t.metadata)||void 0===I?void 0:I.original_payload)&&(n.$feature_flag_original_payload=null==t||null===(O=t.metadata)||void 0===O?void 0:O.original_payload),i.length&&(n.$feature_flag_error=i.join(",")),this.Dd(n)}return n?{key:e,enabled:!!r,variant:"string"==typeof r?r:void 0,payload:ti(o)}:void 0}Dd(e){try{var t;null===(t=this.po)||void 0===t||t.capture("$feature_flag_called",e).catch(e=>{this.$.error("Failed to capture feature flag call",e)})}catch(e){this.$.error("Failed to capture feature flag call",e)}}getRemoteConfigPayload(e,t){this.Ld(e,t)}Ld(e,t){var i=this;return Z((function*(){const n=i.po;if(!n)return;const r={distinct_id:n.distinctId,token:n.projectToken,person_properties:{$lib:n.library.name,$lib_version:n.library.version}},o=i.Ed();o.length&&(r.evaluation_contexts=o);const s=i.Pd();let a;R(s)||(r.flag_keys=s);try{var l;const t=null===(l=(yield n.sendRequest("/flags/?v=2",{target:"flags",method:"POST",body:r,compression:i.Mr.compression,sentAt:"body",timeoutMs:i.Mr.requestTimeoutMs})).json)||void 0===l?void 0:l.featureFlagPayloads;a=(null==t?void 0:t[e])||void 0}catch(e){return void i.$.error("Remote config feature flag request failed",e)}try{t(a)}catch(e){i.$.error("Remote config feature flag callback failed",e)}}))()}isFeatureEnabled(e,t={}){if(t.fresh&&!this.Kc)return t.defaultValue;if(!(this.Vc||this.getFlags()&&this.getFlags().length>0))return this.$.warn('isFeatureEnabled for key "'+e+oc),t.defaultValue;const i=this.getFeatureFlag(e,t);return R(i)?t.defaultValue:!!i}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(t=>t!==e)}receivedFeatureFlags(e,t,i){this.Rd(e,t,i)}Rd(e,t,i){if(!this.po)return;this.Vc=!0;const n=((e,t={},i={},n={},r,o=nc)=>{const s=((e,t)=>{const i=e.flags;if(i){const t=Object.fromEntries(Object.keys(i).map(e=>{var t;return[e,null!==(t=i[e].variant)&&void 0!==t?t:i[e].enabled]})),n=Object.fromEntries(Object.keys(i).filter(e=>i[e].enabled).filter(e=>{var t;return!R(null===(t=i[e].metadata)||void 0===t?void 0:t.payload)}).map(e=>{var t;return[e,null===(t=i[e].metadata)||void 0===t?void 0:t.payload]}));return mt(mt({},e),{},{featureFlags:t,featureFlagPayloads:n})}return e.featureFlags&&t.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),e})(e,o),a=s.flags,l=s.featureFlags,c=s.featureFlagPayloads;if(!l)return;const u=e.requestId,d=e.evaluatedAt;if(T(l)){o.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");const e={};if(l)for(let t=0;l.length>t;t++)e[l[t]]=!0;return{[vn]:l,[pn]:e,[bn]:!1}}let f=l,h=c,p=a;if(null==r?void 0:r.partialResponse){const e=Object.keys(f),r=h||{};f=mt(mt({},t),f),h=mt(mt({}
1,i),r),e.forEach(e=>{e in r||null==h||delete h[e]}),p=mt(mt({},n),p)}else if(e.errorsWhileComputingFlags)if(a){const e=new Set(Object.keys(a).filter(e=>{var t;return!(null===(t=a[e])||void 0===t?void 0:t.failed)}));f=mt(mt({},t),Object.fromEntries(Object.entries(f).filter(([t])=>e.has(t))));const r=Object.fromEntries(Object.entries(h||{}).filter(([t])=>e.has(t)));h=mt(mt({},i),r),e.forEach(e=>{e in r||null==h||delete h[e]}),p=mt(mt({},n),Object.fromEntries(Object.entries(p||{}).filter(([t])=>e.has(t))))}else f=mt(mt({},t),f),h=mt(mt({},i),h),p=mt(mt({},n),p);return mt(mt({[vn]:Object.keys(cc(f)),[pn]:f||{},[_n]:h||{},[mn]:p||{},[bn]:!0===e.minimalFlagCalledEvents},u?{[yn]:u}:{}),d?{[Nn]:d}:{})})(e,this.getFlagVariants(),this.getFlagPayloads(),this.getFlagsWithDetails(),i,this.$);if(n)if(!1===(null==i?void 0:i.persist)){const e=!R(this.po.kv.get(pn));this.Cd=n,e||this.At(n)}else this.md(),this.Id(n,e,!!(null==i?void 0:i.partialResponse)),this.At(n);else t&&this.$d();t||(this.Xc=!1),this.bd(t)}override(e,t=!1){this.$.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){this.Nd(e)}Nd(e){if(this.po){if(!1===e)return this.Lt([En,wn]),this.bd(),void rc.info("All overrides cleared");if(T(e))return this.At({[En]:lc(e)}),this.bd(),void rc.info("Flag overrides set",{flags:e});if(e&&"object"==typeof e&&("flags"in e||"payloads"in e)){var t;const i=e;this.Hc=Boolean(null!==(t=i.suppressWarning)&&void 0!==t&&t);const n={},r=i.flags,o=i.payloads;return r&&(n[En]=T(r)?lc(r):r),o&&(n[wn]=o),Object.keys(n).length&&this.At(n),!1===r&&!1===o?this.Lt([En,wn]):!1===r?this.Lt(En):!1===o&&this.Lt(wn),this.bd(),!1===r?rc.info("Flag overrides cleared"):r&&rc.info("Flag overrides set",{flags:r}),void(!1===o?rc.info("Payload overrides cleared"):o&&rc.info("Payload overrides set",{payloads:o}))}if(e&&"object"==typeof e)return this.At({[En]:e}),this.bd(),void rc.info("Flag overrides set",{flags:e});this.$.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:e})}else this.$.warn("posthog.featureFlags.overrideFeatureFlags called before feature flags were ready")}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.Vc){const{flags:t,flagVariants:i}=this.qd();try{e(t,i)}catch(e){this.$.error("Error while running feature flags callback",e)}}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t,i){var n;const r=(this.xd("$early_access_features")||[]).find(t=>t.flagKey===e),o={[`$feature_enrollment/${e}`]:t},s={$feature_flag:e,$feature_enrollment:t,$set:o};r&&(s.$early_access_feature_name=r.name),i&&(s.$feature_enrollment_stage=i);const a=mt(mt({},this.getFlagVariants()),{},{[e]:t});null===(n=this._instance)||void 0===n||null===(n=n.persistence)||void 0===n||n.markCrossTabFeatureFlagChanges({$active_feature_flags:[e],$enabled_feature_flags:[e],$stored_person_properties:Object.keys(o)}),this.At({[vn]:Object.keys(cc(a)),[pn]:a,[In]:mt(mt({},this.xd("$stored_person_properties")||{}),o)}),this.bd();try{var l;null===(l=this.po)||void 0===l||l.capture("$feature_enrollment_update",s).catch(e=>{this.$.error("Failed to capture early access feature enrollment",e)})}catch(e){this.$.error("Failed to capture early access feature enrollment",e)}}getEarlyAccessFeatures(e,t=!1,i){const n=this.xd(gn);!n||t?this.jd(e,i):e(n)}jd(e,t){var i=this;return Z((function*(){const n=i.po;if(!n)return;const r=t?`&${t.map(e=>`stage=${e}`).join("&")}`:"";let o;try{const e=yield n.sendRequest(`/api/early_access_features/?token=${n.projectToken}${r}`,{target:"api",method:"GET",sentAt:"query"});if(!e.json)return;o=e.json.earlyAccessFeatures,i.At({[gn]:o})}catch(e){return void i.$.error("Early access feature request failed",e)}try{e(o)}catch(e){i.$.error("Early access feature callback failed",e)}}))()}qd(){const e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter(e=>t[e]),flagVariants:Object.keys(t).filter(e=>t[e]).reduce((e,i)=>(e[i]=t[i],e),{})}}bd(e){this.yd();const{flags:t,flagVariants:i}=this.qd();
1this.featureFlagEventHandlers.forEach(n=>{try{n(t,i,{errorsLoading:e})}catch(e){this.$.error("Error while running feature flags callback",e)}})}setPersonPropertiesForFlags(e,t=!0){this.Bd(e,t)}Bd(e,t=!0){const i=this.xd("$stored_person_properties")||{},n=(null==e?void 0:e.$set)||((null==e?void 0:e.$set_once)?{}:e),r=null==e?void 0:e.$set_once,o={};if(r)for(const e in r)({}).hasOwnProperty.call(r,e)&&(e in i||(o[e]=r[e]));this.At({[In]:mt(mt(mt({},i),o),n)}),t&&this.reloadFeatureFlags()}unsetPersonPropertiesForFlags(e,t=!0){const i=mt({},this.xd("$stored_person_properties")||{});e.forEach(e=>{delete i[e]}),this.At({[In]:i}),t&&this.reloadFeatureFlags()}resetPersonPropertiesForFlags(e=!0){this.Lt(In),e&&this.reloadFeatureFlags()}setGroupPropertiesForFlags(e,t=!0){const i=this.xd("$stored_group_properties")||{},n=mt({},i);for(const t of Object.keys(e))n[t]=mt(mt({},i[t]),e[t]);this.At({[On]:n}),t&&this.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){const t=this.xd("$stored_group_properties")||{};this.At({[On]:mt(mt({},t),{},{[e]:{}})})}else this.Lt(On)}reset(){this.Zc++,this.Jc=!1,this.zc={},this.Uc={},this.Cd=void 0,this.Vc=!1,this.Qc=!1,this.Kc=!1,this.$anon_distinct_id=void 0,this.Sd(),this.Hc=!1,this.Yc=0}}},Lc={sessionRecording:class{get Mr(){return this._instance.config}get xa(){return this._instance.persistence}get started(){var e;return!!(null===(e=this.Hd)||void 0===e?void 0:e.isStarted)}get status(){var e,t;return"awaiting_config"===this.zd||"missing_config"===this.zd?this.zd:null!==(e=null===(t=this.Hd)||void 0===t?void 0:t.status)&&void 0!==e?e:this.zd}constructor(e){if(this._instance=e,this._forceAllowLocalhostNetworkCapture=!1,this.zd=Ul,this.Ud=void 0,this.Wd=!1,this.Ke=(()=>{var e,t;if(!(null==s?void 0:s.visibilityState)||"visible"===s.visibilityState)return!0;const i=null==n||null===(e=n.performance)||void 0===e||null===(t=e.getEntriesByType)||void 0===t?void 0:t.call(e,"visibility-state");return!(null==i?void 0:i.length)||i.some(e=>"visible"===e.name)})(),this.an=()=>{var e,t;"visible"===(null==s?void 0:s.visibilityState)&&(this.Ke=!0,null===(e=this.Hd)||void 0===e||null===(t=e.setDocumentWasEverVisible)||void 0===t||t.call(e,!0))},!this._instance.sessionManager)throw jl.error("started without valid sessionManager"),new Error("[SessionRecording] started without valid sessionManager. This is a bug.");if("always"===this.Mr.cookieless_mode)throw new Error('[SessionRecording] cannot be used with cookieless_mode="always"');(null==s?void 0:s.addEventListener)&&fr(s,"visibilitychange",this.an)}initialize(){this.startIfEnabledOrStop()}dispose({discardBufferedEvents:e=!1}={}){var t;this.Wd=!0,null==s||null===(t=s.removeEventListener)||void 0===t||t.call(s,"visibilitychange",this.an),e?this.Vd(!0):this.stopRecording()}get Gd(){var e;const t=!!(null===(e=this._instance.get_property("$session_recording_remote_config"))||void 0===e?void 0:e.enabled),i=!this.Mr.disable_session_recording,r=this.Mr.disable_session_recording||this._instance.consent.isOptedOut();return n&&t&&i&&!r}startIfEnabledOrStop(e){var t;if(this.Wd)return;if(this.Gd&&(null===(t=this.Hd)||void 0===t?void 0:t.isStarted))return;const i=!R(Object.assign)&&!R(Array.from);this.Gd&&i?(this.Zd(e),jl.info("starting")):(this.zd=Ul,this.stopRecording())}Zd(e){var t,i;if(this.Gd)if("awaiting_config"!==this.zd&&"missing_config"!==this.zd&&(this.zd=Fl),(null==v||null===(t=v.__PosthogExtensions__)||void 0===t||null===(t=t.rrweb)||void 0===t?void 0:t.record)&&(null===(i=v.__PosthogExtensions__)||void 0===i?void 0:i.initSessionRecording))this.Qd(e);else{var n,r;const t=this._instance.sessionManager;null===(n=v.__PosthogExtensions__)||void 0===n||null===(r=n.loadExternalDependency)||void 0===r||r.call(n,this._instance,this.Jd,i=>{if(!this.Wd&&this.Gd&&this._instance.sessionManager===t)return i?(this._instance.register_for_session({$sdk_debug_recording_script_not_loaded:!0}),jl.error("could not load recorder",i)):void this.Qd(e);this.zd="disabled"})}}stopRecording(){var e,t;null===(e=this.Ud)||void 0===e||e.call(this),this.Ud=void 0,null===(t=this.Hd)||void 0===t||t.stop()}Vd(e=!1){var t,i;null===(t=this.Ud)||void 0===t||t.call(this),this.Ud=void 0,null===(i=this.Hd)||void 0===i||i.discard({discardProducerEvents:e})}Kd(){var e,t;null===(e=this.xa)||void 0===e||e.unregister("$session_is_sampled"),null===(t=this.xa)||void 0===t||t.unregister("$replay_sample_rate")}Xd(e,t){if(M(e))return null;const i=U(e)?e:parseFloat(e);return"number"!=typeof(n=i)||!Number.isFinite(n)||0>n||n>1?(jl.warn(`${t} must be between 0 and 1. Ignoring invalid value:`,e),null):i;var n}Yd(e){if(this.xa){var t,i;const n=this.xa,r=()=>{var t;const i=!1===e.sessionRecording?void 0:e.sessionRecording,r=this.Xd(null===(t=this.Mr.session_recording)||void 0===t?void 0:t.sampleRate,"session_recording.sampleRate"),o=this.Xd(null==i?void 0:i.sampleRate,"remote config sampleRate"),s=null!=r?r:o;M(s)&&this.Kd();const a=null==i?void 0:i.minimumDurationMilliseconds;n.register({[dn]:mt(mt({cache_timestamp:Date.now(),enabled:!!i},i),{},{networkPayloadCapture:mt({capturePerformance:e.capturePerformance},null==i?void 0:i.networkPayloadCapture),canvasRecording:{enabled:null==i?void 0:i.recordCanvas,fps:null==i?void 0:i.canvasFps,quality:null==i?void 0:i.canvasQuality},sampleRate:s,minimumDurationMilliseconds:R(a)?null:a,endpoint:null==i?void 0:i.endpoint,triggerMatchType:null==i?void 0:i.triggerMatchType,masking:null==i?void 0:i.masking,urlTriggers:null==i?void 0:i.urlTriggers,version:null==i?void 0:i.version,triggerGroups:null==i?void 0:i.triggerGroups})})};r(),null===(t=this.Ud)||void 0===t||t.call(this),this.Ud=null===(i=this._instance.sessionManager)||void 0===i?void 0:i.onSessionId(r)}}onRemoteConfig(e){const t=e.ok?e.config:void 0;return t&&"sessionRecording"in t?!1===t.sessionRecording?(this.Yd(t),void this.Vd()):(this.Yd(t),void this.startIfEnabledOrStop()):("awaiting_config"===this.zd&&(this.zd="missing_config",jl.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(e,t="log"){var i;(null===(i=this.Hd)||void 0===i?void 0:i.log)?this.Hd.log(e,t):jl.warn("log called before recorder was ready")}get Jd(){var e,t;const i=null===(e=this._instance)||void 0===e||null===(e=e.persistence)||void 0===e?void 0:e.get_property(dn);return(null==i||null===(t=i.scriptConfig)||void 0===t?void 0:t.script)||"lazy-recorder"}tv(){const e=this._instance.get_property(dn);if(!e)return!1;let t;try{t="object"==typeof e?e:JSON.parse(e)}catch(e){return jl.warn("persisted remote config for session recording is invali
1d and will be ignored",e),!1}return!M(t.cache_timestamp)&&36e5>=Date.now()-t.cache_timestamp}Qd(e){var t,i,n;if(!this.Wd&&this.Gd&&this._instance.sessionManager){if(!(null===(t=v.__PosthogExtensions__)||void 0===t?void 0:t.initSessionRecording))return jl.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[zn]:!0});var r;if(this.Hd||(this.Hd=null===(r=v.__PosthogExtensions__)||void 0===r?void 0:r.initSessionRecording(this._instance,this.Ke),this.Hd._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.tv()){if("missing_config"===this.zd||"awaiting_config"===this.zd)return;return this.zd="awaiting_config",jl.info("persisted remote config is stale, requesting fresh config before starting"),void new Fs(this._instance).load()}this.zd=Fl,null===(i=(n=this.Hd).setDocumentWasEverVisible)||void 0===i||i.call(n,this.Ke),this.Hd.start(e)}else this.zd=Ul}onRRwebEmit(e){var t,i;null===(t=this.Hd)||void 0===t||null===(i=t.onRRwebEmit)||void 0===i||i.call(t,e)}overrideLinkedFlag(){var e,t;this.Hd||null===(t=this.xa)||void 0===t||t.register({$replay_override_linked_flag:!0}),null===(e=this.Hd)||void 0===e||e.overrideLinkedFlag()}overrideSampling(){var e,t;this.Hd||null===(t=this.xa)||void 0===t||t.register({$replay_override_sampling:!0}),null===(e=this.Hd)||void 0===e||e.overrideSampling()}overrideTrigger(e){var t,i;this.Hd||null===(i=this.xa)||void 0===i||i.register({["url"===e?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}),null===(t=this.Hd)||void 0===t||t.overrideTrigger(e)}get sdkDebugProperties(){var e;return(null===(e=this.Hd)||void 0===e?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,t){var i;return!!(null===(i=this.Hd)||void 0===i?void 0:i.tryAddCustomEvent(e,t))}flushBeforeIdentityReset(){var e,t;null===(e=this.Hd)||void 0===e||null===(t=e.flushBeforeIdentityReset)||void 0===t||t.call(e)}}},Mc={autocapture:class extends class{uo(){this.ho=void 0,clearTimeout(this.co),this.co=void 0}do(e){var t;if(!ho(e))return!0;const i=null!==(t=this.vo().css_selector_ignorelist)&&void 0!==t?t:no,n=new Set;let r=e;for(;r;){if(n.size>=1e3||n.has(r))return!0;n.add(r);const e=r,t=Yr(e);if(w(t,"ph-no-capture")||w(t,"ph-sensitive")||po(e)||i.some(t=>eo(e,t)))return!0;const o=r.parentNode;r=zr(o)?o.host:o&&Gr(o)?o:null}return!1}fo(e){if(!this.isEnabled||"pointercancel"===e.type)return void this.uo();if("pointerdown"===e.type){this.uo();const i=Zr(e);var t;return void(e.isPrimary&&0===e.button&&!e.ctrlKey&&i&&Gr(i)&&(this.ho={target:i,excluded:this.do(i),id:e.pointerId,x:e.clientX,y:e.clientY,released:!1,distinctId:null===(t=this.po)||void 0===t?void 0:t.distinctId}))}const i=this.ho;i&&(e.pointerId!==i.id||Math.abs(e.clientX-i.x)>5||Math.abs(e.clientY-i.y)>5?this.uo():"pointerup"===e.type&&(i.released=!0,this.co=setTimeout(()=>this.uo(),0)))}mo(e){var t;const i=this.ho;this.uo();const n=Zr(e);if((null==i?void 0:i.released)&&i.target.isConnected&&i.distinctId===(null===(t=this.po)||void 0===t?void 0:t.distinctId)&&e.pointerId===i.id&&(e.detail>0||"touch"===e.pointerType||"pen"===e.pointerType)&&0===e.button&&5>=Math.abs(e.clientX-i.x)&&5>=Math.abs(e.clientY-i.y)&&n&&(qr(n,"html")||qr(n,"body"))){var r;if(i.excluded)return null;const e=null!==(r=this.vo().css_selector_ignorelist)&&void 0!==r?r:no;return[n,null==s?void 0:s.documentElement,null==s?void 0:s.body].some(t=>{if(!t)return!1;const i=Yr(t);return w(i,"ph-no-capture")||w(i,"ph-sensitive")||!ho(t)||po(t)||e.some(e=>eo(t,e))})?null:i.target}}constructor(e){this.yo=e,this.name="autocapture",this.bo=!1,this._o=null,this.wo=!1,this.ko=!1,this.Mr={enabled:!1,rageclick:!1,maskAllElementAttributes:!1,maskAllText:!1,disableCaptureUrlHashes:!1,remoteRequestsDisabled:!1},this.So=!1,this.yo.refresh(this.Mr),this.rageclicks=new Ol(this.Mr.rageclick),this.xo=null}setup(e){this.Co(),this.po=e;const t=e.onRemoteConfig(this.onRemoteConfig.bind(this));this.So?t.dispose():(this.$o=t,this.startIfEnabled())}dispose(){var e;this.So||(this.So=!0,this.po=void 0,null===(e=this.$o)||void 0===e||e.dispose(),this.$o=void 0,this.To())}vo(){return this.yo.refresh(this.Mr),this.Mr}Co(){var e,t;return this.vo(),this.Mr.url_allowlist=null===(e=this.Mr.url_allowlist)||void 0===e?void 0:e.map(e=>new RegExp(e)),this.Mr.url_ignorelist=null===(t=this.Mr.url_ignorelist)||void 0===t?void 0:t.map(e=>new RegExp(e)),this.Mr}Io(){if(!this.isBrowserSupported())return void Al.info("Disabling Automatic Event Collection because this browser is not supported");if(!n||!s)return;const e=this.Mo=e=>{e=e||(null==n?void 0:n.event);try{if("blur"===e.type)return void this.uo();if(0===e.type.indexOf("pointer"))return void this.fo(e);const t="click"===e.type?this.mo(e):void 0;if(L(t))return;this.Eo(e,"$autocapture",t)}catch(e){Al.error("Failed to capture event",e)}};if(fr(n,"blur",e),fr(s,"submit",e,{capture:!0}),fr(s,"change",e,{capture:!0}),fr(s,"click",e,{capture:!0}),rr(["pointerdown","pointermove","pointerup","pointercancel"],t=>{fr(s,t,e,{capture:!0})}),this.vo().capture_copied_text){const e=this.Po=e=>{e=e||(null==n?void 0:n.event);try{this.Eo(e,Sl)}catch(e){Al.error("Failed to capture clipboard event",e)}};fr(s,"copy",e,{capture:!0}),fr(s,"cut",e,{capture:!0}),fr(s,"paste",e,{capture:!0})}}To(){this.uo(),this.Mo&&(null==n||n.removeEventListener("blur",this.Mo),rr(["pointerdown","pointermove","pointerup","pointercancel"],e=>{null==s||s.removeEventListener(e,this.Mo,!0)}),null==s||s.removeEventListener("submit",this.Mo,!0),null==s||s.removeEventListener("change",this.Mo,!0),null==s||s.removeEventListener("click",this.Mo,!0),this.Mo=void 0),this.Po&&(null==s||s.removeEventListener("copy",this.Po,!0),null==s||s.removeEventListener("cut",this.Po,!0),null==s||s.removeEventListener("paste",this.Po,!0),this.Po=void 0),this.bo=!1}startIfEnabled(){this.isEnabled||this.uo(),!this.So&&this.po&&this.isEnabled&&!this.bo&&(this.Io(),this.bo=!0)}onRemoteConfig(e){if(this.So)return;if(this.wo=!0,!e.ok)return void this.startIfEnabled();const t=e.config;
1t.elementsChainAsString&&(this.ko=t.elementsChainAsString);const i=t.autocapture_opt_out;var n;j(i)&&(null===(n=this.po)||void 0===n||n.kv.set("$autocapture_disabled_server_side",i),this._o=i),this.startIfEnabled()}setElementSelectors(e){this.xo=e}getElementSelectors(e,t){var i;const n=[];return null===(i=this.xo)||void 0===i||i.forEach(i=>{const r=null==s?void 0:s.querySelectorAll(i);null==r||r.forEach(r=>{e!==r&&t!==r||w(n,i)||n.push(i)})}),n}get isEnabled(){var e,t;if(this.So)return!1;const i=null===(e=this.po)||void 0===e?void 0:e.kv.get(en),n=this._o,r=this.vo();if(!r.remoteRequestsDisabled&&!this.wo)return!1;const o=r.remoteRequestsDisabled&&!this.wo;if(L(n)&&!j(i)&&!o)return!1;const s=null!==(t=this._o)&&void 0!==t?t:!!i;return!!r.enabled&&!s}Eo(e,t="$autocapture",i){if(!this.isEnabled)return void this.uo();let r=i||Zr(e);Hr(r)&&(r=r.parentNode||null);const o=this.Co();var s;"$autocapture"===t&&"click"===e.type&&e instanceof MouseEvent&&o.rageclick&&(null===(s=this.rageclicks)||void 0===s?void 0:s.isRageClick(e.clientX,e.clientY,e.timeStamp||(new Date).getTime()))&&co(r,o.rageclick)&&this.Eo(e,"$rageclick",i);const a=t===Sl,l=a?mt(mt({},o),{},{dom_event_allowlist:void 0}):o;if(r&&function(e,t,i,r,o,s){var a;if(!n||uo(e))return!1;if((null==i?void 0:i.url_allowlist)&&!Wr(i.url_allowlist,s))return!1;if((null==i?void 0:i.url_ignorelist)&&Wr(i.url_ignorelist,s))return!1;if(null==i?void 0:i.dom_event_allowlist){const e=i.dom_event_allowlist;if(e&&!e.some(e=>t.type===e))return!1}const{parentIsUsefulElement:l,targetElementList:c}=fo(e,r);if(!function(e,t){const i=null==t?void 0:t.element_allowlist;if(R(i))return!0;for(const t of e)if(i.some(e=>t.tagName.toLowerCase()===e))return!0;return!1}(c,i))return!1;if(!to(c,null==i?void 0:i.css_selector_allowlist))return!1;if(to(c,null!==(a=null==i?void 0:i.css_selector_ignorelist)&&void 0!==a?a:no))return!1;try{const i=n.getComputedStyle(e);if(i&&"pointer"===i.getPropertyValue("cursor")&&"click"===t.type)return!0}catch(e){}const u=e.tagName.toLowerCase();switch(u){case"html":return!1;case"form":return(o||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(o||["change","click"]).indexOf(t.type)>=0;default:return l?(o||["click"]).indexOf(t.type)>=0:(o||["click"]).indexOf(t.type)>=0&&(Qr.indexOf(u)>-1||"true"===e.getAttribute("contenteditable"))}}(r,e,l,a,a?["copy","cut","paste"]:void 0,{config:{get_current_url:o.getCurrentUrl}})){var c;const{props:i,explicitNoCapture:s,target:a}=function(e,{e:t,maskAllElementAttributes:i,maskAllText:r,elementAttributeIgnoreList:o,elementsC
vendor: 9,126 bytes, line 1
1hainAsString:s,disableCaptureUrlHashes:a}){var l,c;if(!Gr(e))return{props:{}};const u=[e],d=new Set([e]);let f=e;for(;f.parentNode&&!qr(f,"body")&&1e3>u.length;)if(zr(f.parentNode)){const e=f.parentNode.host;if(d.has(e))break;d.add(e),u.push(e),f=e}else{if(!Gr(f.parentNode))break;if(d.has(f.parentNode))break;d.add(f.parentNode),u.push(f.parentNode),f=f.parentNode}const h="click"===t.type&&"http://www.w3.org/2000/svg"===e.namespaceURI?u.findIndex(e=>qr(e,"button")||qr(e,"a")):-1;h>0&&(r=r||u.slice(0,h+1).some(e=>!ho(e)||po(e)));const p=[],v={};let g,m=!1,_=!1;if(rr(u,e=>{const t=ho(e);if(qr(e,"a")){const i=e.getAttribute("href");m=!!(t&&i&&wo(i))&&(a?ot(i):i)}w(Yr(e),"ph-no-capture")&&(_=!0),p.push(function(e,t,i,n,r=!1){const o=e.tagName.toLowerCase(),s={tag_name:o};Qr.indexOf(o)>-1&&!i&&(s.$el_text="a"===o.toLowerCase()||"button"===o.toLowerCase()?Cl(1024,Io(e)):Cl(1024,Xr(e)));const a=Yr(e);a.length>0&&(s.classes=a.filter((function(e){return""!==e}))),rr(e.attributes,(function(i){var o;if((!po(e)||-1!==["name","id","class","aria-label"].indexOf(i.name))&&!(null==n?void 0:n.includes(i.name))&&!t&&wo(i.value)&&(!D(o=i.name)||"_ngcontent"!==o.substring(0,10)&&"_nghost"!==o.substring(0,7))){let e=i.value;"class"===i.name&&(e=Kr(e).join(" ")),s["attr__"+i.name]=Cl(1024,"href"===i.name&&r?ot(e):e)}}));let l=1,c=1,u=e;for(;u=$l(u);)l++,u.tagName===e.tagName&&c++;return s.nth_child=l,s.nth_of_type=c,s}(e,i,r,o,a)),rr(function(e){if(!ho(e))return{};const t={};return rr(e.attributes,(function(e){if(e.name&&0===e.name.indexOf("data-ph-capture-attribute")){const i=e.name.replace("data-ph-capture-attribute-",""),n=e.value;i&&n&&wo(n)&&(t[i]=n)}})),t}(e),(e,t)=>{({}).hasOwnProperty.call(v,t)||(v[t]=e)})}),_)return{props:{},explicitNoCapture:_};if(h>0&&(e=u[h],p.splice(0,h)),r||(p[0].$el_text=qr(e,"a")||qr(e,"button")?Io(e):Xr(e)),m){var y,b;p[0].attr__href=m;const e=null===(y=jo(m))||void 0===y?void 0:y.host,t=null==n||null===(b=n.location)||void 0===b?void 0:b.host;e&&t&&e!==t&&(g=m)}return{props:or((I=t.type,{$event_type:I,$ce_version:1}),s?{}:{$elements:p},{$elements_chain:(E=p,T(E)?function(e){return e.map(e=>{var t,i;let n="";if(e.tag_name&&(n+=e.tag_name),e.attr_class){e.attr_class.sort();for(const t of e.attr_class)n+=`.${t.replace(/"/g,"")}`}const r=mt(mt(mt(mt({},e.text?{text:e.text}:{}),{},{"nth-child":null!==(t=e.nth_child)&&void 0!==t?t:0,"nth-of-type":null!==(i=e.nth_of_type)&&void 0!==i?i:0},e.href?{href:e.href}:{}),e.attr_id?{attr_id:e.attr_id}:{}),e.attributes),o={};return sr(r).sort(([e],[t])=>function(e,t){return t>e?-1:e>t?1:0}(e,t)).forEach(([e,t])=>o[Oo(e.toString())]=Oo(t.toString())),n+=":",n+=sr(o).map(([e,t])=>`${e}="${t}"`).join(""),n}).join(";")}(function(e){return e.map(e=>{var t,i;const n={text:null===(t=e.$el_text)||void 0===t?void 0:t.slice(0,400),tag_name:e.tag_name,href:null===(i=e.attr__href)||void 0===i?void 0:i.slice(0,2048),attr_class:So(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return sr(e).filter(([e])=>0===e.indexOf("attr__")).forEach(([e,t])=>n.attributes[e]=t),n})}(E)):"")},(null===(l=p[0])||void 0===l?void 0:l.$el_text)?{$el_text:null===(c=p[0])||void 0===c?void 0:c.$el_text}:{},g&&"click"===t.type?{$external_click_url:g}:{},v),target:e};var E,I}(r,{e:e,maskAllElementAttributes:o.maskAllElementAttributes,maskAllText:o.maskAllText,elementAttributeIgnoreList:o.element_attribute_ignorelist,elementsChainAsString:this.ko,disableCaptureUrlHashes:o.disableCaptureUrlHashes});if(s)return!1;const l=this.getElementSelectors(r,a);if(l&&l.length>0&&(i.$element_selectors=l),t===Sl){const t=e.type||"clipboard";if("paste"!==t){var u,d;const e=null==n||null===(u=n.getSelection())||void 0===u?void 0:u.toString(),t=Jr(e);if(!t)return!1;i.$selected_content=t,i.$clipboard_text_length=null!==(d=null==e?void 0:e.length)&&void 0!==d?d:0}i.$copy_type=t}return null===(c=this.po)||void 0===c||c.capture(t,i).catch(e=>Al.error("Failed to capture event",e)),!0}}isBrowserSupported(){return P(null==s?void 0:s.querySelectorAll)}}{constructor(e){super(new class{constructor(e){this._instance=e}refresh(e){const t=this._instance.config,i=k(t.autocapture)?t.autocapture:void 0;e.enabled=!!t.autocapture,e.rageclick=t.rageclick,e.maskAllElementAttributes=t.mask_all_element_attributes,e.maskAllText=t.mask_all_text,e.disableCaptureUrlHashes=t.disable_capture_url_hashes,e.getCurrentUrl=t.get_current_url,e.remoteRequestsDisabled=this._instance.Xl(),e.url_allowlist=null==i?void 0:i.url_allowlist,e.url_ignorelist=null==i?void 0:i.url_ignorelist,e.dom_event_allowlist=null==i?void 0:i.dom_event_allowlist,e.element_allowlist=null==i?void 0:i.element_allowlist,e.css_selector_allowlist=null==i?void 0:i.css_selector_allowlist,e.css_selector_ignorelist=null==i?void 0:i.css_selector_ignorelist,e.element_attribute_ignorelist=null==i?void 0:i.element_attribute_ignorelist,e.capture_copied_text=null==i?void 0:i.capture_copied_text}}(e)),this.instance=e}},historyAutocapture:class{constructor(e){this._instance=e,this.ev=this.iv()}initialize(){this.startIfEnabled()}get isEnabled(){const e=this.nv();return!!(e.path||e.search||this.sv(e))}startIfEnabled(){this.isEnabled&&(Fi.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}startIfEnabledOrStop(){this.stop(),this.ev=this.iv(),this.startIfEnabled()}stop(){this.rv&&this.rv(),this.rv=void 0,this.ov&&this.ov(),this.ov=void 0,Fi.info("History API monitoring stopped")}monitorHistoryChanges(){n&&n.history&&(this.lv("pushState"),this.lv("replaceState"),this.av(),this.sv()&&this.uv())}lv(e){var t;if(!n||(null===(t=n.history[e])||void 0===t?void 0:t.__posthog_wrapped__))return;const i=this;xl(n.history,e,t=>function(n,r,o){t.call(this,n,r,o),i.hv(e)})}iv(){const e=null==n?void 0:n.location;if(null==e?void 0:e.pathname)return{pathname:e.pathname,search:e.search,hash:e.hash}}nv(){const e=this._instance.config.capture_pageview;return"history_change"===e?{path:!0}:k(e)?e:{}}sv(e=this.nv()){return!!e.hash&&!this._instance.config.disable_capture_url_hashes}dv(e){const t=this.nv(),i=this.ev;return!(!i||!(t.path&&e.pathname!==i.pathname||t.search&&e.search!==i.search||this.sv(t)&&e.hash!==i.hash))}hv(e){try{const t=this.iv();if(!t)return;this.dv(t)&&this._instance.capture(Qn,{navigation_type:e}),this.ev=t}catch(t){Fi.error(`Error capturing ${e} pageview`,t)}}av(){if(this.rv)return;const e=()=>{this.hv("popstate")};fr(n,"popstate",e),this.rv=()=>{n&&n.removeEventListener("popstate",e)}}uv(){if(this.ov)return;const e=()=>{this.hv("hashchange")};fr(n,"hashchange",e),this.ov=()=>{n&&n.removeEventListener("hashchange",e)}}},heatmaps:class{get Mr(){return this.instance.config}constructor(e){var t;this.vv=!1,this.bo=!1,this.fv=null,this.instance=e,this.vv=!!(null===(t=this.instance.persistence)||void 0===t?void 0:t.props[tn]),this.rageclicks=new Ol(e.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){let e=5e3;return k(this.Mr.capture_heatmaps)&&this.Mr.capture_heatmaps.flush_interval_milliseconds&&(e=this.Mr.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return M(this.Mr.capture_heatmaps)?M(this.Mr.enable_heatmaps)?this.vv:this.Mr.enable_heatmaps:!1!==this.Mr.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this.bo)return;Vl.info("starting..."),this.pv(),this.an()}else{var e;clearInterval(null!==(e=this.fv)&&void 0!==e?e:void 0),this.gv(),this.getAndClearBuffer()}}onRemoteConfig(e){if(!e.ok)return;const t=e.config;if(!("heatmaps"in t))return;const i=!!t.heatmaps;this.instance.persistence&&this.instance.persistence.register({[tn]:i}),this.vv=i,this.startIfEnabled()}getAndClearBuffer(){const e=this.Rt;return this.Rt=void 0,e}mv(e){Bl(e.originalEvent)&&this.Cr(e.originalEvent,"deadclick")}an(){this.fv&&clearInterval(this.fv),this.fv="visible"===(null==s?void 0:s.visibilityState)?setInterval(this.fa.bind(this),this.flushIntervalMilliseconds):null}pv(){n&&s&&(this.yv=this.fa.bind(this),fr(n,Zn,this.yv),this.bv=e=>this.Cr(e||(null==n?void 0:n.event)),fr(s,"click",this.bv,{capture:!0}),this._v=e=>this.wv(e||(null==n?void 0:n.event)),fr(s,"mousemove",this._v,{capture:!0}),this.Sv=new To(this.instance,Co,this.mv.bind(this)),this.Sv.startIfEnabledOrStop(),this.xv=this.an.bind(this),fr(s,Xn,this.xv),this.bo=!0)}gv(){var e;n&&s&&(this.yv&&n.removeEventListener(Zn,this.yv),this.bv&&s.removeEventListener("click",this.bv,{capture:!0}),this._v&&s.removeEventListener("mousemove",this._v,{capture:!0}),this.xv&&s.removeEventListener(Xn,this.xv),clearTimeout(this.Cv),null===(e=this.Sv)||void 0===e||e.stop(),this.bo=!1)}$v(e,t){const i=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),o=this.instance.scrollManager.scrollElement(),s=function(e,t,i){let r=e;for(;r&&Gr(r)&&!qr(r,"body");){if(r===i)return!1;let e;try{var o,s,a;e=null===(o=null!==(s=null===(a=r.ownerDocument)||void 0===a?void 0:a.defaultView)&&void 0!==s?s:n)||void 0===o?void 0:o.getComputedStyle(r).position}catch(e){return!1}if(w(t,e))return!0;r=io(r)}return!1}(Zr(e),["fixed","sticky"],o);return{x:e.clientX+(s?0:r),y:e.clientY+(s?0:i),target_fixed:s,type:t}}
1Cr(e,t="click"){var i;if(Br(e.target)||!Bl(e))return;const n=this.$v(e,t);(null===(i=this.rageclicks)||void 0===i?void 0:i.isRageClick(e.clientX,e.clientY,(new Date).getTime()))&&co(Zr(e),this.instance.config.rageclick)&&this.Zs(mt(mt({},n),{},{type:"rageclick"})),this.Zs(n)}wv(e){!Br(e.target)&&Bl(e)&&(clearTimeout(this.Cv),this.Cv=setTimeout(()=>{this.Zs(this.$v(e,"mousemove"))},500))}Zs(e){if(!n)return;const t=this.Mr.disable_capture_url_hashes?ot(n.location.href):n.location.href,i=this.Mr.custom_personal_data_properties,r=this.Mr.mask_personal_data_properties?[...zo,...i||[]]:[],o=Bo(t,r,Wo);this.Rt=this.Rt||{},this.Rt[o]||(this.Rt[o]=[]),this.Rt[o].push(e)}fa(){this.Rt&&!x(this.Rt)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:To,webVitalsAutocapture:class{constructor(e){var t;this._instance=e,this.vv=!1,this.bo=!1,this.Rt={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Tv=()=>{clearTimeout(this.Iv),this.Iv=void 0,0!==this.Rt.metrics.length&&(this._instance.capture("$web_vitals",mt({$current_url:this.Rt.url},this.Rt.metrics.reduce((e,t)=>mt(mt({},e),{},{[`$web_vitals_${t.name}_event`]:mt({},t),[`$web_vitals_${t.name}_value`]:t.value}),{}))),this.Rt={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Mv=e=>{var t;if(this.Rt=this.Rt||{navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},M(null==e?void 0:e.name)||M(null==e?void 0:e.value))return void Dl.error("Invalid metric received",e);const i="string"==typeof e.navigationURL?e.navigationURL:void 0,n=this.Ev(i);if(R(n))return;const r=U(e.navigationId)||"string"==typeof e.navigationId?`navigation:${e.navigationId}`:`url:${n}`;if(this.Pv&&e.value>=this.Pv)return void Dl.error("Ignoring metric with value >= "+this.Pv,e);this.Rt.navigationKey!==r&&(this.Tv(),this.Iv=setTimeout(this.Tv,this.flushToCaptureTimeoutMs)),R(this.Rt.navigationKey)&&(this.Rt.navigationKey=r,this.Rt.url=n),this.Rt.firstMetricTimestamp=R(this.Rt.firstMetricTimestamp)?Date.now():this.Rt.firstMetricTimestamp;const o=null===(t=this._instance.sessionManager)||void 0===t?void 0:t.checkAndGetSessionAndWindowId(!0),s=mt(mt(mt({},e),i?{navigationURL:n}:{}),{},{$current_url:n,timestamp:Date.now()});if(delete s.entries,k(e.attribution)&&this.attributionMetrics.indexOf(e.name)>-1){const t={};for(const i of Ml){const n="url"===i&&"string"==typeof e.attribution[i]?this.Ev(e.attribution[i]):e.attribution[i];R(n)||(t[i]=n)}s.attribution=t}else delete s.attribution;R(o)||(s.$session_id=o.sessionId,s.$window_id=o.windowId),this.Rt.metrics.push(s),this.Rt.metrics.length===this.allowedMetrics.length&&this.Tv()},this.Rv=()=>{if(this.bo)return;let e,t,i,n,r=!1;const o=v.__PosthogExtensions__,s=null==o?void 0:o.postHogWebVitalsCallbacksByFlavor,a=(null==s?void 0:s[this.Av])||("web-vitals"===this.Av&&R(s)?null==o?void 0:o.postHogWebVitalsCallbacks:void 0);if(!R(a)){const o=a.withoutAttribution,s=this.attributionMetrics;r=!R(o),e=s.indexOf("LCP")>-1?a.onLCP:(null==o?void 0:o.onLCP)||a.onLCP,t=s.indexOf("CLS")>-1?a.onCLS:(null==o?void 0:o.onCLS)||a.onCLS,i=s.indexOf("FCP")>-1?a.onFCP:(null==o?void 0:o.onFCP)||a.onFCP,n=s.indexOf("INP")>-1?a.onINP:(null==o?void 0:o.onINP)||a.onINP}if(!(e&&t&&i&&n))return void Dl.error("web vitals callbacks not loaded - not starting");const l={reportSoftNavs:this.useSoftNavs},c=r&&this.attributionMetrics.indexOf("INP")>-1?mt(mt({},l),{},{includeProcessedEventEntries:!1}):l;this.allowedMetrics.indexOf("LCP")>-1&&e(this.Mv.bind(this),l),this.allowedMetrics.indexOf("CLS")>-1&&t(this.Mv.bind(this),l),this.allowedMetrics.indexOf("FCP")>-1&&i(this.Mv.bind(this),l),this.allowedMetrics.indexOf("INP")>-1&&n(this.Mv.bind(this),c),this.bo=!0},this.vv=!!(null===(t=this._instance.persistence)||void 0===t?void 0:t.props[sn]),this.startIfEnabled()}get Fv(){return this._instance.config.capture_performance}get allowedMetrics(){var e,t;const i=k(this.Fv)?null===(e=this.Fv)||void 0===e?void 0:e.web_vitals_allowed_metrics:void 0;return M(i)?(null===(t=this._instance.persistence)||void 0===t?void 0:t.props.$web_vitals_allowed_metrics)||Nl:i}get flushToCaptureTimeoutMs(){return(k(this.Fv)?this.Fv.web_vitals_delayed_flush_ms:void 0)||5e3}get attributionMetrics(){const e=k(this.Fv)?this.Fv.web_vitals_attribution:void 0;return j(e)?e?Nl:[]:T(e)?e:Ll}get useAttribution(){return this.attributionMetrics.length>0}get useSoftNavs(){const e=k(this.Fv)?this.Fv.__preview_web_vitals_soft_navs:void 0;return null!=e&&e}get Pv(){const e=k(this.Fv)&&U(this.Fv.__web_vitals_max_value)?this.Fv.__web_vitals_max_value:9e5;return e>0&&6e4>=e?9e5:e}get isEnabled(){const e=null==a?void 0:a.protocol;if("http:"!==e&&"https:"!==e)return Dl.info("Web Vitals are disabled on non-http/https protocols"),!1;const t=k(this.Fv)?this.Fv.web_vitals:j(this.Fv)?this.Fv:void 0;return j(t)?t:this.vv}startIfEnabled(){this.isEnabled&&!this.bo&&(Dl.info("enabled, starting..."),this.No(this.Rv))}onRemoteConfig(e){if(!e.ok)return;const t=e.config;if(!("capturePerformance"in t))return;const i=k(t.capturePerformance)&&!!t.capturePerformance.web_vitals,n=k(t.capturePerformance)?t.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[sn]:i}),this._instance.persistence.register({[un]:n})),this.vv=i,this.startIfEnabled()}get Av(){return this.useSoftNavs?this.useAttribution?"web-vitals-with-attribution-soft-navs":"web-vitals-soft-navs":this.useAttribution?"web-vitals-with-attribution":"web-vitals"}No(e){var t;const i=v.__PosthogExtensions__,n=this.Av,r=null==i?void 0:i.postHogWebVitalsCallbacksByFlavor;(null==r?void 0:r[n])||"web-vitals"===n&&R(r)&&(null==i?void 0:i.postHogWebVitalsCallbacks)?e():null==i||null===(t=i.loadExternalDependency)||void 0===t||t.call(i,this._instance,n,t=>{t?Dl.error("failed to load script",t):e()})}Ev(e){const t=e||(null==n?void 0:n.location.href);if(!t)return void Dl.error("Could not determine current URL");const i=this._instance.config.disable_capture_url_hashes?ot(t):t,r=this._instance.config.custom_personal_data_properties,o=this._instance.config.mask_personal_data_properties?[...zo,...r||[]]:[];return Bo(i,o,Wo)}}},Uc={exceptionObserver:class{constructor(e){var t;this.Rv=()=>{var e;if(!n||!this.isEnabled||!(null===(e=v.__PosthogExtensions__)||void 0===e?void 0:e.errorWrappingFunctions))return;const t=v.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,i=v.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,r=v.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.Ov&&this.Mr.capture_unhandled_errors&&(this.Ov=t(this.captureException.bind(this))),!this.Dv&&this.Mr.capture_unhandled_rejections&&(this.Dv=i(this.captureException.bind(this))),!this.Lv&&this.Mr.capture_console_errors&&(this.Lv=r(this.captureException.bind(this)))}catch(e){Tl.error("failed to start",e),this.Nv()}},this._instance=e,this.qv=!!(null===(t=this._instance.persistence)||void 0===t?void 0:t.props[nn]),this.wt=new class{constructor(e){this.C={},this.I=e.I,this.R=te(e.bucketSize,0,100,e.$),this.A=te(e.refillRate,0,this.R,e.$),this.O=te(e.refillInterval,0,864e5,e.$)}F(e,t){const i=Math.floor((t-e.lastAccess)/this.O);i>0&&(e.tokens=Math.min(e.tokens+i*this.A,this.R),e.lastAccess=e.lastAccess+i*this.O)}consumeRateLimit(e){var t;const i=Date.now(),n=String(e);let r=this.C[n];return r?this.F(r,i):(r={tokens:this.R,lastAccess:i},this.C[n]=r),0===r.tokens||(r.tokens--,0===r.tokens&&(null===(t=this.I)||void 0===t||t.call(this,e)),0===r.tokens)}stop(){this.C={}}}(mt(mt({},function(e={}){var t,i,n,r;return{refillRate:null!==(t=null!==(i=e.exceptionRateLimiterRefillRate)&&void 0!==i?i:e.__exceptionRateLimiterRefillRate)&&void 0!==t?t:1,bucketSize:null!==(n=null!==(r=e.exceptionRateLimiterBucketSize)&&void 0!==r?r:e.__exceptionRateLimiterBucketSize)&&void 0!==n?n:10}}(this._instance.config.error_tracking)),{},{refillInterval:1e4,$:Tl})),this.Mr=this.jv(),this.startIfEnabledOrStop()}jv(){const e=this._instance.config.capture_exceptions;let t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return k(e)?t=mt(mt({},t),e):(R(e)?this.qv:e)&&(t=mt(mt({},t),{},{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.Mr.capture_console_errors||this.Mr.capture_unhandled_errors||this.Mr.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(Tl.info("enabled"),this.Nv(),this.No(this.Rv)):this.Nv()}No(e){var t,i,n;(null===(t=v.__PosthogExtensions__)||void 0===t?void 0:t.errorWrappingFunctions)?e():null===(i=v.__PosthogExtensions__)||void 0===i||null===(n=i.loadExternalDependency)||void 0===n||n.call(i,this._instance,"exception-autocapture",t=>{if(t)return Tl.error("failed to load script",t);e()})}Nv(){var e,t,i;null===(e=this.Ov)||void 0===e||e.call(this),this.Ov=void 0,null===(t=this.Dv)||void 0===t||t.call(this),this.Dv=void 0,null===(i=this.Lv)||void 0===i||i.call(this),this.Lv=void 0}onRemoteConfig(e){if(!e.ok)return;const t=e.config;"autocaptureExceptions"in t&&(this.qv=!!t.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[nn]:this.qv}),this.Mr=this.jv(),this.startIfEnabledOrStop())}onConfigChange(){this.Mr=this.jv()}captureException(e){try{var t,i,n;const r=null!==(t=null==e||null===(i=e.$exception_list)||void 0===i||null===(i=i[0])||void 0===i?void 0:i.type)&&void 0!==t?t:"Exception";if(this.wt.consumeRateLimit(r))return void Tl.info("Skipping exception capture because of client rate limiting.",{exception:r});null===(n=this._instance.exceptions)||void 0===n||n.sendExceptionEvent(e)}catch(e){}}},exceptions:class{constructor(e){var t,i;this.Bv=[],this.Hv=new class{constructor(e,t,i=[]){this.coercers=e,this.stackParser=t,this.modifiers=i}buildFromUnknown(e,t={}){const i=t&&t.mechanism||{handled:!0,type:"generic"},n=this.buildCoercingContext(i,t,0).apply(e),r=this.buildParsingContext(t),o=this.parseStacktrace(n,r);return{$exception_list:this.convertToExceptionList(o,i),$exception_level:"error"}}modifyFrames(e){var t=this;return Z((function*(){for(const i of e)i.stacktrace&&i.stacktrace.frames&&T(i.stacktrace.frames)&&(i.stacktrace.frames=yield t.applyModifiers(i.stacktrace.frames));return e}))()}coerceFallback(e){var t;return{type:"Error",value:"Unknown error",stack:null===(t=e.syntheticException)||void 0===t?void 0:t.stack,synthetic:!0}}parseStacktrace(e,t){let i,n;return null!=e.cause&&(i=this.parseStacktrace(e.cause,t)),""!=e.stack&&null!=e.stack&&(n=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?t.ski
1pFirstLines:0),t.chunkIdMap)),mt(mt({},e),{},{cause:i,stack:n})}applyChunkIds(e,t){return e.map(e=>(e.filename&&t&&(e.chunk_id=t[e.filename]),e))}applyCoercers(e,t){for(const i of this.coercers)if(i.match(e))return i.coerce(e,t);return this.coerceFallback(t)}applyModifiers(e){var t=this;return Z((function*(){let i=e;for(const e of t.modifiers)i=yield e(i);return i}))()}convertToExceptionList(e,t){var i,n,r;const o={type:e.type,value:e.value,mechanism:{type:null!==(i=t.type)&&void 0!==i?i:"generic",handled:null===(n=t.handled)||void 0===n||n,synthetic:null!==(r=e.synthetic)&&void 0!==r&&r}};e.stack&&(o.stacktrace={type:"raw",frames:e.stack});const s=[o];return null!=e.cause&&s.push(...this.convertToExceptionList(e.cause,mt(mt({},t),{},{handled:!0}))),s}buildParsingContext(e){var t;return{chunkIdMap:ht(this.stackParser),skipFirstLines:null!==(t=e.skipFirstLines)&&void 0!==t?t:1}}buildCoercingContext(e,t,i=0){const n=(i,n)=>{if(4>=n){const r=this.buildCoercingContext(e,t,n);return this.applyCoercers(i,r)}};return mt(mt({},t),{},{syntheticException:0==i?t.syntheticException:void 0,mechanism:e,apply:e=>n(e,i),next:e=>n(e,i+1)})}}([new Ut,new Wt,new jt,new Ft,new zt,new Ht,new Bt,new Kt],function(e,...t){return(i,n=0)=>{const r=[],o=i.split("\n"),s=Math.min(o.length,n+1e3),a=[];for(let i=n;s>i;i++){const n=o[i];if(n.length>1024)continue;const s=Pt.test(n)?n.replace(Pt,"$1"):n;if(!s.match(/\S*Error: /)){for(const i of t){const t=i(s,e);if(t){r.push(t);const e=xt(r);if(e){for(let t=a.length-1;t>=0;t--){const i=a[t];if(e.start>=i.start+i.length)break;a.pop()}a.push(e)}break}}if(Lt(r,a)>=50)break}}const l=[...a].sort((e,t)=>t.start-e.start),c=l[l.length-1];if(c){const e=Dt(r,c);r.splice(c.start-e,e);for(const t of l)t.start-=e}for(const e of l)Rt(r,e);return a.some(e=>0===e.start&&r.length===e.length)&&function(e){const t=e.map(e=>`${e.function}|${e.filename}|${e.lineno}|${e.colno}|${e.module}`);let i=0;for(let e=1;t.length>e;e++)Mt(t,e,i)&&(i=e);e.push(...e.splice(0,i))}(r),function(e){if(!e.length)return[];const t=Array.from(e);return t.reverse(),t.slice(0,50).map(e=>{return mt(mt({},e),{},{filename:e.filename||(i=t,i[i.length-1]||{}).filename,function:e.function||"?"});var i})}(r)}}("web:javascript",At,Tt)),this._instance=e,this.Bv=null!==(t=null===(i=this._instance.persistence)||void 0===i?void 0:i.get_property("$error_tracking_suppression_rules"))&&void 0!==t?t:[],this.zv=Qt(this.Uv()),this.Wv=new class{constructor(e){this.ts=[],this.es=0,this.Mr=Qt(e)}setConfig(e){this.Mr=Qt(e),this.ns()}add(e){const t=function(e){let t;try{t=S(e)}catch(e){return}try{const e=JSON.parse(t);if(!k(e))return;const i=e,n=i[Yt],r=i[Jt];if(!D(n)||0===n.trim().length)return;if(!D(r)&&!U(r))return;return{step:i,json:t}}catch(e){return}}(e);if(!t)return;const i=function(e){if("u">typeof TextEncoder)return(new TextEncoder).encode(e).length;const t=encodeURIComponent(e);let i=0;for(let e=0;t.length>e;e++)"%"===t[e]?(i+=1,e+=2):i+=1;return i}(t.json);i>this.Mr.max_bytes||(this.ts.push({step:t.step,bytes:i}),this.es+=i,this.ns())}getAttachable(){return this.ts.map(e=>e.step)}clear(){this.ts=[],this.es=0}size(){return this.ts.length}ns(){for(;this.es>this.Mr.max_bytes&&this.ts.length>0;){const e=this.ts.shift();e&&(this.es-=e.bytes)}}}(this.zv)}onConfigChange(){this.zv=Qt(this.Uv()),this.Wv.setConfig(this.zv)}onRemoteConfig(e){var t,i,n;if(!e.ok)return;const r=e.config;if(!("errorTracking"in r))return;const o=null!==(t=null===(i=r.errorTracking)||void 0===i?void 0:i.suppressionRules)&&void 0!==t?t:[],s=null===(n=r.errorTracking)||void 0===n?void 0:n.captureExtensionExceptions;this.Bv=o,this._instance.persistence&&this._instance.persistence.register({[rn]:this.Bv,[on]:s})}get Vv(){var e;const t=!!this._instance.get_property(on),i=this._instance.config.error_tracking.captureExtensionExceptions;return null!==(e=null!=i?i:t)&&void 0!==e&&e}buildProperties(e,t){return this.Hv.buildFromUnknown(e,{syntheticException:null==t?void 0:t.syntheticException,mechanism:{handled:null==t?void 0:t.handled}})}addExceptionStep(e,t){if(this.zv.enabled)try{if(!D(e)||0===e.trim().length)return void dc.warn("Ignoring exception step because message must be a non-empty string");const{sanitizedProperties:i,droppedKeys:n}=function(e){if(!e)return{sanitizedProperties:{},droppedKeys:[]};const t=[];return{sanitizedProperties:Object.keys(e).reduce((i,n)=>Xt.has(n)?(t.push(n),i):(i[n]=e[n],i),{}),droppedKeys:t}}(this.Gv(t));n.length>0&&dc.warn("Ignoring reserved exception step fields",{droppedKeys:n}),this.Wv.add(mt({[Yt]:e,[Jt]:(new Date).toISOString()},i))}catch(e){dc.error("Failed to add exception step. Ignoring breadcrumb.",e)}}sendExceptionEvent(e){try{const t=e.$exception_list;if(this.Zv(t)){if(this.Qv(t))return this.Jv("Exception dropped: matched a suppression rule"),void dc.info("Skipping exception capture because a suppression rule matched");if(!this.Vv&&this.Kv(t))return this.Jv("Exception dropped: thrown by a browser extension"),void dc.info("Skipping exception capture because it was thrown by an extension");if(!this.Vv&&this.Xv(t))return this.Jv("Exception dropped: thrown by an injected browser script"),void dc.info("Skipping exception capture because it was thrown by an injected browser script");
1if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.Yv(t))return this.Jv("Exception dropped: thrown by the PostHog SDK"),void dc.info("Skipping exception capture because it was thrown by the PostHog SDK")}const i=this.zv.enabled&&M(e.$exception_steps)?this.tf(e):e,n=function(){const e=globalThis._posthogReleaseId;return"string"==typeof e&&e.length>0?e:void 0}();n&&(i.$release_id=n);try{const e=this._instance.capture("$exception",i,{_noTruncate:!0,_batchKey:"exceptionEvent",eh:!0});return e&&this.Wv.clear(),e}catch(e){return uc(e)||dc.error("Failed to capture exception event. Dropping this exception.",e),void this.Wv.clear()}}catch(e){return void(uc(e)||dc.error("Failed to process exception event. Ignoring this exception.",e))}}tf(e){try{const t=this.Wv.getAttachable();return 0===t.length?e:mt(mt({},e),{},{$exception_steps:t})}catch(t){return dc.error("Failed to read buffered exception steps. Capturing exception without steps.",t),e}}Jv(e){this.zv.enabled&&this.Wv.add({[Yt]:e,[Jt]:(new Date).toISOString()})}Gv(e){return k(e)?mt({},e):{}}Uv(){var e,t;return null!==(e=null===(t=this._instance.config.error_tracking)||void 0===t?void 0:t.exception_steps)&&void 0!==e?e:{}}Qv(e){if(0===e.length)return!1;try{const t=e.reduce((e,{type:t,value:i})=>(D(t)&&t.length>0&&e.$exception_types.push(t),D(i)&&i.length>0&&e.$exception_values.push(i),e),{$exception_types:[],$exception_values:[]});return this.Bv.some(e=>{const i=e.values.map(e=>{const i=Ka[e.operator],n=t[e.key];if(!i||!n)return!1;const r=T(e.value)?e.value:[e.value];return r.length>0&&i(r,n)});return"OR"===e.type?i.some(Boolean):i.every(Boolean)})}catch(e){return dc.warn("Failed to evaluate suppression rules. Capturing the exception.",e),!1}}Kv(e){const t=e.flatMap(e=>{var t,i;return null!==(t=null===(i=e.stacktrace)||void 0===i?void 0:i.frames)&&void 0!==t?t:[]}),i=t.filter(({filename:e})=>!!e&&pc.some(t=>e.startsWith(t)));return 0!==i.length&&(!i.every(({filename:e})=>!!e&&e.startsWith(fc))||e.some(({type:e,value:t})=>"NoResponse"===e||D(t)&&hc.some(({value:e,exact:i})=>i?t===e:t.includes(e)))&&!t.some(({in_app:e,filename:t})=>e&&!(null==t?void 0:t.startsWith(fc))))}Xv(e){return e.some(({value:e})=>D(e)&&vc.some(t=>e.includes(t)))}Yv(e){if(e.length>0){var t,i,n,r;const o=null!==(t=null===(i=e[0].stacktrace)||void 0===i?void 0:i.frames)&&void 0!==t?t:[],s=o[o.length-1];return null!==(n=null==s||null===(r=s.filename)||void 0===r?void 0:r.includes("posthog.com/static"))&&void 0!==n&&n}return!1}Zv(e){return!M(e)&&T(e)}}},Fc=mt({productTours:class{get xa(){return this._instance.persistence}constructor(e){this.ef=null,this.if=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!e.ok)return;const t=e.config;if("productTours"in t){var i,n;if(this.xa&&this.xa.register({[ln]:!!t.productTours}),!ql(this._instance))return!this.ef&&M(null===(i=this.xa)||void 0===i?void 0:i.props.ph_product_tours)||Gl.info("product tours disabled; stopping and clearing cached tours"),null===(n=this.ef)||void 0===n||n.stop(),this.ef=null,void this.clearCache();this.loadIfEnabled()}}loadIfEnabled(){!this.ef&&ql(this._instance)&&this.No(()=>this.nf())}No(e){var t,i,n;(null===(t=v.__PosthogExtensions__)||void 0===t?void 0:t.generateProductTours)?e():null===(i=v.__PosthogExtensions__)||void 0===i||null===(n=i.loadExternalDependency)||void 0===n||n.call(i,this._instance,"product-tours",t=>{t?Gl.error("Could not load product tours script",t):e()})}nf(){var e;!this.ef&&(null===(e=v.__PosthogExtensions__)||void 0===e?void 0:e.generateProductTours)&&(this.ef=v.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(e,t=!1){if(T(this.if)&&!t)return void e(this.if,{isLoaded:!0});const i=this.xa;if(i){const n=i.props[kn];if(T(n)&&!t)return this.if=n,void e(n,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api",`/api/product_tours/?token=${this._instance.config.token}`),method:"GET",timestampMode:"query",callback:t=>{if(!ql(this._instance))return void e([],{isLoaded:!0});const n=t.statusCode;if(200!==n||!t.json){const i=`Product Tours API could not be loaded, status: ${n}`;return 0===n?t.error||Gl.warn(i):Gl.error(i),void e([],{isLoaded:!1,error:i})}const r=T(t.json.product_tours)?t.json.product_tours:[];this.if=r,i&&i.register({[kn]:r}),e(r,{isLoaded:!0})}})}getActiveProductTours(e){M(this.ef)?e([],{isLoaded:!1,error:"Product tours not loaded"}):this.ef.getActiveProductTours(e)}showProductTour(e){var t;null===(t=this.ef)||void 0===t||t.showTourById(e)}previewTour(e){this.ef?this.ef.previewTour(e):this.No(()=>{var t;this.nf(),null===(t=this.ef)||void 0===t||t.previewTour(e)})}dismissProductTour(){var e;null===(e=this.ef)||void 0===e||e.dismissTour("user_clicked_skip")}nextStep(){var e;null===(e=this.ef)||void 0===e||e.nextStep()}previousStep(){var e;null===(e=this.ef)||void 0===e||e.previousStep()}clearCache(){var e;this.if=null,null===(e=this.xa)||void 0===e||e.unregister("ph_product_tours")}resetTour(e){var t;null===(t=this.ef)||void 0===t||t.resetTour(e)}resetAllTours(){var e;null===(e=this.ef)||void 0===e||e.resetAllTours()}cancelPendingTour(e){var t;null===(t=this.ef)||void 0===t||t.cancelPendingTour(e)}}},Nc),jc={siteApps:class{constructor(e){this._instance=e,this.sf=0,this.rf=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}lf(e,t){if(!t)return;const i=this.globalsForEvent(t);this.rf.push(i),this.rf.length>1e3&&(this.rf=this.rf.slice(10))}get siteAppLoaders(){var e;return null===(e=v._POSTHOG_REMOTE_CONFIG)||void 0===e||null===(e=e[this._instance.config.token])||void 0===e?void 0:e.siteApps}initialize(){if(this.isEnabled){const e=this._instance._addCaptureHook(this.lf.bind(this));this.af=()=>{e(),this.rf=[],this.af=void 0}}}globalsForEvent(e){var t,i,n,r,o,s,a;if(!e)throw new Error("Event payload is required");const l={},c=this._instance.get_property("$groups")||[],u=this._instance.get_property("$stored_group_properties")||{};for(const[e,t]of Object.entries(u))l[e]={id:c[e],type:e,properties:t};const{$set_once:d,$set:f}=e;return{event:mt(mt({},vi(e,Hl)),{},{properties:mt(mt(mt({},e.properties),f?{$set:mt(mt({},null!==(t=null===(i=e.properties)||void 0===i?void 0:i.$set)&&void 0!==t?t:{}),f)}:{}),d?{$set_once:mt(mt({},null!==(n=null===(r=e.properties)||void 0===r?void 0:r.$set_once)&&void 0!==n?n:{}),d)}:{}),elements_chain:null!==(o=null===(s=e.properties)||void 0===s?void 0:s.$elements_chain)&&void 0!==o?o:"",distinct_id:null===(a=e.properties)||void 0===a?void 0:a.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:l}}uf(e){var t;const i=null===(t=e.tagName)||void 0===t?void 0:t.toLowerCase();return"style"===i&&this._instance.config.prepare_external_dependency_stylesheet?this._instance.config.prepare_external_dependency_stylesheet(e)||(zl.error("prepare_external_dependency_stylesheet returned null"),null):"script"===i&&this._instance.config.prepare_external_dependency_script?this._instance.config.prepare_external_dependency_script(e)||(zl.error("prepare_external_dependency_script returned null"),null):e}hf(){var e,t,i,n,r,o,a,l;if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return()=>{};const c=null==s?void 0:s.defaultView,u=null==c||null===(e=c.Node)||void 0===e?void 0:e.prototype;if(!c||!u)return()=>{};if(this.sf++,this.cf)return this.df();const d=[],f=this,h=new WeakSet,p=(e,t,i)=>{if(!(null==e?void 0:e[t]))return;const n=e[t];e[t]=i(n),d.push(()=>{e[t]=n})},v=e=>{if(h.has(e))return e;const t=f.uf(e);return t&&h.add(t),t},g=e=>e.map(e=>"string"==typeof e?e:v(e)).filter(e=>!L(e));return p(u,"appendChild",e=>function(t){const i=v(t);return i?e.call(this,i):t}),p(u,"insertBefore",e=>function(t,i){const n=v(t);return n?e.call(this,n,i):t}),p(u,"replaceChild",e=>function(t,i){const n=v(t);return n?e.call(this,n,i):i}),[null===(t=c.Element)||void 0===t?void 0:t.prototype,null===(i=c.Document)||void 0===i?void 0:i.prototype,null===(n=c.DocumentFragment)||void 0===n?void 0:n.prototype].forEach(e
1=>{p(e,"append",e=>function(...t){return e.apply(this,g(t))}),p(e,"prepend",e=>function(...t){return e.apply(this,g(t))})}),[null===(r=c.Element)||void 0===r?void 0:r.prototype,null===(o=c.CharacterData)||void 0===o?void 0:o.prototype,null===(a=c.DocumentType)||void 0===a?void 0:a.prototype].forEach(e=>{p(e,"before",e=>function(...t){return e.apply(this,g(t))}),p(e,"after",e=>function(...t){return e.apply(this,g(t))}),p(e,"replaceWith",e=>function(...t){const i=g(t);return t.length&&!i.length?void 0:e.apply(this,i)})}),p(null===(l=c.Element)||void 0===l?void 0:l.prototype,"insertAdjacentElement",e=>function(t,i){const n=v(i);return n?e.call(this,t,n):null}),this.cf=()=>{d.forEach(e=>e()),this.cf=void 0},this.df()}df(){let e=!1;return()=>{var t;e||(e=!0,this.sf--,0===this.sf&&(null===(t=this.cf)||void 0===t||t.call(this)))}}vf(e,t=!0){const i=this.hf();try{const n=e(i);return t&&i(),n}catch(e){throw i(),e}}setupSiteApp(e){const t=this.apps[e.id],i=()=>{var i;!t.errored&&this.rf.length&&(zl.info(`Processing ${this.rf.length} events for site app with id ${e.id}`),this.rf.forEach(e=>this.vf(()=>{var i;return null===(i=t.processEvent)||void 0===i?void 0:i.call(t,e)})),t.processedBuffer=!0),Object.values(this.apps).every(e=>e.processedBuffer||e.errored)&&(null===(i=this.af)||void 0===i||i.call(this))};let n=!1;const r=r=>{t.errored=!r,t.loaded=!0,zl.info(`Site app with id ${e.id} ${r?"loaded":"errored"}`),n&&i()};try{const{processEvent:i}=this.vf(t=>e.init({posthog:this._instance,callback(e){t(),r(e)}}),!1);i&&(t.processEvent=i),n=!0}catch(t){zl.error(Kl+e.id,t),r(!1)}if(n&&t.loaded)try{i()}catch(i){zl.error(`Error while processing buffered events PostHog app with config id ${e.id}`,i),t.errored=!0}}ff(){const e=this.siteAppLoaders||[];for(const t of e)this.apps[t.id]={id:t.id,loaded:!1,errored:!1,processedBuffer:!1};for(const t of e)this.setupSiteApp(t)}pf(e){if(0===Object.keys(this.apps).length)return;const t=this.globalsForEvent(e);for(const i of Object.values(this.apps))try{this.vf(()=>{var e;return null===(e=i.processEvent)||void 0===e?void 0:e.call(i,t)})}catch(t){zl.error(`Error while processing event ${e.event} for site app ${i.id}`,t)}}onRemoteConfig(e){var t,i,n;if(null===(t=this.siteAppLoaders)||void 0===t?void 0:t.length)return this.isEnabled?(this.ff(),void this._instance.on("eventCaptured",e=>this.pf(e))):void zl.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null===(i=this.af)||void 0===i||i.call(this),!e.ok)return;const r=e.config;if(null===(n=r.siteApps)||void 0===n?void 0:n.length)if(this.isEnabled)for(const{id:e,url:t}of r.siteApps){var o,s;v[`__$$ph_site_app_${e}`]=this._instance,null===(o=v.__PosthogExtensions__)||void 0===o||null===(s=o.loadSiteApp)||void 0===s||s.call(o,this._instance,t,t=>{if(t)return zl.error(Kl+e,t)})}else zl.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}},Vc={tracingHeaders:class{constructor(e){this._instance=e,this.gf=void 0,this.mf=void 0,this.yf=void 0,this.Rv=()=>{const e=this.bf();var t,i;e?(R(this.gf)&&(this.gf=null===(t=v.__PosthogExtensions__)||void 0===t||null===(t=t.tracingHeadersPatchFns)||void 0===t?void 0:t._patchXHR(e,()=>this._instance.get_distinct_id(),this._instance.sessionManager)),R(this.mf)&&(this.mf=null===(i=v.__PosthogExtensions__)||void 0===i||null===(i=i.tracingHeadersPatchFns)||void 0===i?void 0:i._patchFetch(e,()=>this._instance.get_distinct_id(),this._instance.sessionManager))):this.Nv()}}initialize(){this.startIfEnabledOrStop()}No(e){var t,i,n;(null===(t=v.__PosthogExtensions__)||void 0===t?void 0:t.tracingHeadersPatchFns)?e():null===(i=v.__PosthogExtensions__)||void 0===i||null===(n=i.loadExternalDependency)||void 0===n||n.call(i,this._instance,"tracing-headers",t=>{if(t)return Rl.error("failed to load script",t);e()})}_f(){var e,t;return null!==(e=null!==(t=this._instance.config.tracing_headers)&&void 0!==t?t:this._instance.config.addTracingHeaders)&&void 0!==e?e:this._instance.config.__add_tracing_headers}bf(){const e=this._f();return T(e)?(T(this.yf)?this.yf.splice(0,this.yf.length,...e):this.yf=[...e],e.length>0?this.yf:void 0):(T(this.yf)&&this.yf.splice(0),this.yf=e||void 0,this.yf)}Nv(){var e,t;null===(e=this.gf)||void 0===e||e.call(this),null===(t=this.mf)||void 0===t||t.call(this),this.gf=void 0,this.mf=void 0}startIfEnabledOrStop(){this.bf()?this.No(this.Rv):this.Nv()}}},Bc=mt({surveys:class extends class{constructor(e,t){this.yo=e,this.mh=t,this.name="surveys",this._surveyEventReceiver=null,this._surveyManager=null,this.yh=!1,this.bh=[],this._h=null,this.wh=null,this.So=!1,this.kh=new Set,this.onRemoteConfig=e=>{if(this.So)return;if(this.Mr.disableSurveys)return;if(!e.ok)return el.warn("Remote config unavailable. Not loading surveys.");const t=e.config.surveys;if(M(t))return el.warn("Flags not loaded yet. Not loading surveys.");this.Sh=j(t)?t:t.length>0,el.info(`flags response received, isSurveysEnabled: ${this.Sh}`),this.loadIfEnabled()}}setup(e){if(!this.So)return this.xh=e,Wl(e.kv.initialize(),()=>{if(this.xh!==e||this.So)return;this.xh=void 0,this.po=e;const t=e.onRemoteConfig(this.onRemoteConfig);this.So?t.dispose():(this.$o=t,this.loadIfEnabled())})}dispose(){var e,t,i,n;this.So||(this.So=!0,this.xh=void 0,this.po=void 0,null===(e=this.$o)||void 0===e||e.dispose(),this.$o=void 0,null===(t=this._surveyEventReceiver)||void 0===t||t.dis
1pose(),this._surveyEventReceiver=null,null===(i=this._surveyManager)||void 0===i||null===(n=i.dispose)||void 0===n||n.call(i),this._surveyManager=null,this.bh=[],this._h=null,this.kh.forEach(e=>clearTimeout(e)),this.kh.clear())}get Mr(){return this.yo.get()}initialize(){this.loadIfEnabled()}reset(){try{var e;null===(e=this._surveyEventReceiver)||void 0===e||e.reset(),localStorage.removeItem("lastSeenSurveyDate");const t=[];for(let e=0;e<localStorage.length;e++){const i=localStorage.key(e);((null==i?void 0:i.startsWith("seenSurvey_"))||(null==i?void 0:i.startsWith("inProgressSurvey_")))&&t.push(i)}t.forEach(e=>localStorage.removeItem(e))}catch(e){}}loadIfEnabled(){if(this.So||!this.po)return;const e=this.Mr;if(this._surveyManager)return;if(this.yh)return void el.info("Already initializing surveys, skipping...");if(e.disableSurveys)return void el.info(Jl);if(e.cookielessMode&&this.yo.isOptedOut())return void el.info("Not loading surveys in cookieless mode without consent.");const t=this.yo.getExtensions();if(!t)return void el.error("PostHog Extensions not found.");if(R(this.Sh)&&!e.advancedEnableSurveys)return;const i=this.Sh||e.advancedEnableSurveys;this.yh=!0;try{const e=t.generateSurveys;if(e)return this.Ch(e,i),void(this.yh=!1);const n=t.loadExternalDependency;if(!n)return this.$h(Kn),void(this.yh=!1);n(e=>{try{if(this.So)return;const t=this.yo.getExtensions();e||!(null==t?void 0:t.generateSurveys)?this.$h("Could not load surveys script",e):this.Ch(t.generateSurveys,i)}finally{this.yh=!1}})}catch(e){throw this.yh=!1,this.$h("Error initializing surveys",e),e}}Ch(e,t){this.So||(this._surveyManager=e(t),this._surveyEventReceiver=this.yo.createEventReceiver(),el.info("Surveys loaded successfully"),this.Th({isLoaded:!0}))}$h(e,t){el.error(e,t),this.Th({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.bh.push(e),this._surveyManager&&this.Th({isLoaded:!0}),()=>{this.bh=this.bh.filter(t=>t!==e)}}getSurveys(e,t=!1){var i;const n=null!==(i=this.po)&&void 0!==i?i:this.mh;if(!n||this.So)return;if(this.Mr.disableSurveys)return el.info(Jl),e([]);const r=n.kv.get(An);if(r&&!t)return e(r,{isLoaded:!0}),void(this.Ih()&&this.getSurveys(()=>{},!0));if(this._h)return void this._h.then(({surveys:t,context:i})=>{this.So||e(t,i)}).catch(e=>el.error("Error in survey callback",e));const o=this.Mh("/api/surveys/",{method:"GET",query:{token:n.projectToken},sentAt:"query",timeoutMs:this.Mr.requestTimeoutMs}).then(e=>{try{return this.Eh(n,e)}catch(e){return el.error("Error processing surveys response",e),this.Eh(n,{statusCode:0,error:e})}},e=>this.Eh(n,{statusCode:0,error:e}));this._h=o;const s=()=>{this._h===o&&(this._h=null)};o.then(t=>{s(),this.So||e(t.surveys,t.context)},s).catch(e=>el.error("Error in survey callback",e))}Mh(e,t){const i=this.po;return i?i.sendRequest(e,t):new Promise(e=>e({statusCode:0,error:new Error(Yl)}))}Eh(e,t){if(this.So)return{surveys:[],context:{isLoaded:!1,error:Yl}};const i=t.statusCode;if(200!==i||!t.json){const e=`Surveys API could not be loaded, status: ${i}`;return 0!==i?el.error(e):t.error||el.warn(e),this.wh=Date.now(),{surveys:[],context:{isLoaded:!1,error:e}}}this.wh=null;const n=t.json.surveys||[],r=n.filter(e=>function(e){return!(!e.start_date||e.end_date)}(e)&&(qa(e)||function(e){var t;return!!(null===(t=e.conditions)||void 0===t||null===(t=t.actions)||void 0===t||null===(t=t.values)||void 0===t?void 0:t.length)}(e)));var o;return r.length>0&&(null===(o=this._surveyEventReceiver)||void 0===o||o.register(r)),e.kv.set({[An]:n,[Cn]:Date.now()}),{surveys:n,context:{isLoaded:!0}}}Ih(){return this.Ph()&&!this._h&&!this.Rh()}Ph(){var e,t;const i=null===(e=null!==(t=this.po)&&void 0!==t?t:this.mh)||void 0===e?void 0:e.kv.get(Cn);return U(i)&&Date.now()-i>3e5}Rh(){return U(this.wh)&&3e5>Date.now()-this.wh}markSurveyAsSeen(e,t){var i;const n={id:e,current_iteration:null!==(i=null==t?void 0:t.iteration)&&void 0!==i?i:null};tl(n);try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(e){}}Th(e){for(const t of this.bh)try{if(!e.isLoaded)return t([],e);this.getSurveys(t)}catch(e){el.error("Error in survey callback",e)}}getActiveMatchingSurveys(e,t=!1){if(!M(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);el.warn("init was not called")}Ah(e){let t=null;
1return this.getSurveys(i=>{var n;t=null!==(n=i.find(t=>t.id===e))&&void 0!==n?n:null}),t}Fh(e){if(M(this._surveyManager))return{eligible:!1,reason:Yl};const t="string"==typeof e?this.Ah(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}Oh(e){if(!this.yo.isCapturing())return{eligible:!1,reason:"PostHog is not capturing, so a survey response cannot be recorded"};if(M(this._surveyManager))return{eligible:!1,reason:Yl};const t="string"==typeof e?this.Ah(e):e;return t?this._surveyManager.checkSurveyRenderability(t):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(M(this._surveyManager))return el.warn("init was not called"),{visible:!1,disabledReason:Yl};const t=this.Oh(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return M(this._surveyManager)?(el.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:Yl})):new Promise(i=>{this.getSurveys(t=>{var n;const r=null!==(n=t.find(t=>t.id===e))&&void 0!==n?n:null;if(r){const e=this.Oh(r);i({visible:e.eligible,disabledReason:e.reason})}else i({visible:!1,disabledReason:"Survey not found"})},t)})}renderSurvey(e,t,i){var n;if(!this.yo.isCapturing())return;if(M(this._surveyManager))return void el.warn("init was not called");const r="string"==typeof e?this.Ah(e):e;if(!(null==r?void 0:r.id))return void el.warn("Survey not found");if(!il.includes(r.type))return void el.warn(`Surveys of type ${r.type} cannot be rendered in the app`);const o=null==s?void 0:s.querySelector(t);if(o){if(null===(n=r.appearance)||void 0===n?void 0:n.surveyPopupDelaySeconds){el.info(`Rendering survey ${r.id} with delay of ${r.appearance.surveyPopupDelaySeconds} seconds`);const e=setTimeout(()=>{var t,n;this.kh.delete(e),!this.So&&this.yo.isCapturing()&&(el.info(`Rendering survey ${r.id} with delay of ${null===(t=r.appearance)||void 0===t?void 0:t.surveyPopupDelaySeconds} seconds`),null===(n=this._surveyManager)||void 0===n||n.renderSurvey(r,o,i),el.info(`Survey ${r.id} rendered`))},1e3*r.appearance.surveyPopupDelaySeconds);return void this.kh.add(e)}this._surveyManager.renderSurvey(r,o,i)}else el.warn("Survey element not found")}displaySurvey(e,t){var i;if(!this.yo.isCapturing())return;if(M(this._surveyManager))return void el.warn("init was not called");const n=this.Ah(e);if(!n)return void el.warn("Survey not found");let r=n;if((null===(i=n.appearance)||void 0===i?void 0:i.surveyPopupDelaySeconds)&&t.ignoreDelay&&(r=mt(mt({},n),{},{appearance:mt(mt({},n.appearance),{},{surveyPopupDelaySeconds:0})})),t.displayType!==ks&&t.initialResponses&&el.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),!1===t.ignoreConditions){const e=this.Fh(n);if(!e.eligible)return void el.warn("Survey is not eligible to be displayed: ",e.reason)}t.displayType!==xs?this._surveyManager.handlePopoverSurvey(r,t):this.renderSurvey(r,t.selector,t.properties)}cancelPendingSurvey(e){M(this._surveyManager)?el.warn("init was not called"):this._surveyManager.cancelSurvey(e)}handlePageUnload(){var e,t;null===(e=this._surveyManager)||void 0===e||null===(t=e.handlePageUnload)||void 0===t||t.call(e)}}{constructor(e){var t;super(new class{constructor(e){this._instance=e}get(){const e=this._instance.config;return{disableSurveys:e.disable_surveys,cookielessMode:!!e.cookieless_mode,advancedEnableSurveys:e.advanced_enable_surveys,requestTimeoutMs:e.surveys_request_timeout_ms}}isOptedOut(){return this._instance.consent.isOptedOut()}isCapturing(){return this._instance.is_capturing()}getExtensions(){const e=null==v?void 0:v.__PosthogExtensions__;if(!e)return;const{generateSurveys:t,loadExternalDependency:i}=e;return{generateSurveys:t?e=>t(this._instance,e):void 0,loadExternalDependency:i?e=>i(this._instance,"surveys",e):void 0}}createEventReceiver(){return new class extends class{constructor(e){var t,i;this.Kh=[],this._instance=e,this.Xh=new Map,this.Yh=new Map,this.tc=new Map,this.ec=null===(t=this._instance)||void 0===t||null===(i=t.onSessionId)||void 0===i?void 0:i.call(t,e=>this.nc(e))}sc(e){return!1}rc(){return null}oc(e){}lc(){}ac(e,t){return!!e&&Wa(e.propertyFilters,null==t?void 0:t.properties)}uc(e,t){const i=new Map;
vendor: 8,695 bytes, line 1
1return e.forEach(e=>{var n;null===(n=e.conditions)||void 0===n||null===(n=n[t])||void 0===n||null===(n=n.values)||void 0===n||n.forEach(t=>{if(null==t?void 0:t.name){const n=i.get(t.name)||[];n.push(e.id),i.set(t.name,n)}})}),i}hc(e,t,i){const n=(i===bs?this.Xh:this.Yh).get(e);let r=[];return this.cc(e=>{r=e.filter(e=>null==n?void 0:n.includes(e.id))}),r.filter(n=>{var r;const o=null===(r=n.conditions)||void 0===r||null===(r=r[i])||void 0===r||null===(r=r.values)||void 0===r?void 0:r.find(t=>t.name===e);return this.ac(o,t)})}register(e){this.dc(e,!1)}replace(e){this.dc(e,!0)}dc(e,t){var i;R(null===(i=this._instance)||void 0===i?void 0:i._addCaptureHook)||(this.vc(e,t),this.fc(e,t))}fc(e,t){const i=e.filter(e=>{var t;return null===(t=e.conditions)||void 0===t||null===(t=t.actions)||void 0===t||null===(t=t.values)||void 0===t?void 0:t.length});var n;if(t&&this.tc.clear(),0===i.length)return void(t&&(null===(n=this.gc)||void 0===n||n.replace([])));this.gc||(this.gc=new class{constructor(e){this._instance=e,this.Dh=new Set,this.Lh=new Set,this.Nh=new Ua,this.qh=(e,t)=>this.jh(e,t)&&this.Bh(e,t)&&this.Hh(e,t)&&this.zh(e,t),this.jh=(e,t)=>!(null==t?void 0:t.event)||(null==e?void 0:e.event)===(null==t?void 0:t.event)}init(){var e,t;R(null===(e=this._instance)||void 0===e?void 0:e._addCaptureHook)||(this.Uh=null===(t=this._instance)||void 0===t?void 0:t._addCaptureHook((e,t)=>{this.on(e,t)}))}dispose(){var e;null===(e=this.Uh)||void 0===e||e.call(this),this.Uh=void 0,this.Nh=new Ua}register(e){var t,i;if(!R(null===(t=this._instance)||void 0===t?void 0:t._addCaptureHook)&&(e.forEach(e=>{var t;this.Dh.add(e),null===(t=e.steps)||void 0===t||t.forEach(e=>{this.Lh.add((null==e?void 0:e.event)||"")})}),null===(i=this._instance)||void 0===i?void 0:i.autocapture)){const e=new Set;this.Dh.forEach(t=>{var i;null===(i=t.steps)||void 0===i||i.forEach(t=>{(null==t?void 0:t.selector)&&e.add(t.selector)})}),this._instance.autocapture.setElementSelectors(e)}}replace(e){this.Dh.clear(),this.Lh.clear(),this.register(e)}on(e,t){null!=t&&0!=e.length&&(this.Lh.has(e)||this.Lh.has(t.event))&&this.Dh.forEach(e=>{this.Wh(t,e)&&this.Nh.emit("actionCaptured",e.name)})}Vh(e){this.onAction("actionCaptured",t=>e(t))}Wh(e,t){if(null==(null==t?void 0:t.steps))return!1;for(const i of t.steps)if(this.qh(e,i))return!0;return!1}onAction(e,t){return this.Nh.on(e,t)}Bh(e,t){if(null==t?void 0:t.url){var i;const n=null==e||null===(i=e.properties)||void 0===i?void 0:i.$current_url;if(!n||"string"!=typeof n)return!1;if(!Xl(n,t.url,t.url_matching||"contains"))return!1}return!0}Hh(e,t){return!!this.Gh(e,t)&&!!this.Zh(e,t)&&!!this.Qh(e,t)}Gh(e,t){var i;if(!(null==t?void 0:t.href))return!0;const n=this.Jh(e);if(n.length>0)return n.some(e=>Xl(e.href,t.href,t.href_matching||"exact"));const r=(null==e||null===(i=e.properties)||void 0===i?void 0:i.$elements_chain)||"";return!!r&&Xl(function(e){const t=e.match(/(?::|")href="(.*?)"/);return t?t[1]:""}(r),t.href,t.href_matching||"exact")}Zh(e,t){var i;if(!(null==t?void 0:t.text))return!0;const n=this.Jh(e);if(n.length>0)return n.some(e=>Xl(e.text,t.text,t.text_matching||"exact")||Xl(e.$el_text,t.text,t.text_matching||"exact"));const r=(null==e||null===(i=e.properties)||void 0===i?void 0:i.$elements_chain)||"";return!!r&&(o=function(e){const t=[],i=/(?::|")text="(.*?)"/g;let n;for(;!M(n=i.exec(e));)t.includes(n[1])||t.push(n[1]);return t}(r),s=t.text,a=t.text_matching||"exact",o.some(e=>Xl(e,s,a)));var o,s,a}Qh(e,t){var i,n;if(!(null==t?void 0:t.selector))return!0;const r=null==e||null===(i=e.properties)||void 0===i?void 0:i.$element_selectors;if(null==r?void 0:r.includes(t.selector))return!0;const o=(null==e||null===(n=e.properties)||void 0===n?void 0:n.$elements_chain)||"";if(t.selector_regex&&o)try{return new RegExp(t.selector_regex).test(o)}catch(e){return!1}return!1}Jh(e){var t;return null==(null==e||null===(t=e.properties)||void 0===t?void 0:t.$elements)?[]:null==e?void 0:e.properties.$elements}zh(e,t){return!(null==t?void 0:t.properties)||0===t.properties.length||Wa(t.properties.reduce((e,t)=>{const i=T(t.value)?t.value.map(String):null!=t.value?[String(t.value)]:[];return e[t.key]={values:i,operator:t.operator||"exact"},e},{}),null==e?void 0:e.properties)}}(this._instance),this.gc.init(),this.gc.Vh(e=>this.onAction(e)));const r=[];i.forEach(e=>{var t;null===(t=e.conditions)||void 0===t||null===(t=t.actions)||void 0===t||t.values.forEach(t=>{if(r.push(t),t.name){var i;const n=null!==(i=this.tc.get(t.name))&&void 0!==i?i:[];n.includes(e.id)||n.push(e.id),this.tc.set(t.name,n)}})}),t?this.gc.replace(r):this.gc.register(r)}mc(e,t){t.forEach((t,i)=>{var n;const r=null!==(n=e.get(i))&&void 0!==n?n:[];t.forEach(e=>{r.includes(e)||r.push(e)}),e.set(i,r)})}vc(e,t){var i,n;const r=e.filter(e=>{var t,i;return(null===(t=e.conditions)||void 0===t?void 0:t.events)&&(null===(i=e.conditions)||void 0===i||null===(i=i.events)||void 0===i||null===(i=i.values)||void 0===i?void 0:i.length)>0}),o=e.filter(e=>{var t,i;return(null===(t=e.conditions)||void 0===t?void 0:t.cancelEvents)&&(null===(i=e.conditions)||void 0===i||null===(i=i.cancelEvents)||void 0===i||null===(i=i.values)||void 0===i?void 0:i.length)>0}),s=this.uc(e,bs),a=this.uc(e,Es);t?(this.Xh=s,this.Yh=a):(this.mc(this.Xh,s),this.mc(this.Yh,a)),(0!==r.length||0!==o.length)&&(null!==(i=this.Uh)&&void 0!==i||(this.Uh=null===(n=this._instance)||void 0===n?void 0:n._addCaptureHook((e,t)=>{this.onEvent(e,t)})))}onEvent(e,t){var i,n;const r=this.yc(),o=(null==t||null===(i=t.properties)||void 0===i?void 0:i.$survey_id)||(null==t||null===(n=t.properties)||void 0===n?void 0:n.$product_tour_id);if(o&&this.getActivatedIds().includes(o)){const t=this.bc(e,o);if("consume"===t)return r.info("event consumed activated item, removing it",{event:e,itemId:o}),void this._c([o]);if("persist"===t)return r.info("shown item promoted to persisted activation",{event:e,itemId:o}),this.wc(o),void this.kc([o])}if(this.Yh.has(e)){const i=this.hc(e,t,Es);i.length>0&&(r.info("cancel event matched, cancelling items",{event:e,itemsToCancel:i.map(e=>e.id)}),this._c(i.map(e=>e.id)),i.forEach(e=>this.Sc(e.id)))}if(!this.Xh.has(e))return;r.info("event name matched",{event:e,eventPayload:t,items:this.Xh.get(e)});const s=this.hc(e,t,bs);this.xc(s.map(e=>e.id))}onAction(e){this.tc.has(e)&&this.xc(this.tc.get(e)||[])}xc(e){var t,i;if(0===e.length)return;const n=!!(null===(t=this._instance)||void 0===t||null===(i=t.get_session_id)||void 0===i?void 0:i.call(t)),r=[];for(const t of e)n&&this.sc(t)?this.wc(t)&&this.Cc(t):r.push(t);r.length>0&&(this.Kh=[...new Set([...this.Kh,...r])]),this.yc().info("updating activated items",{activatedItems:this.getActivatedIds()})}wc(e){this.Kh=this.Kh.filter(t=>t!==e);const t=this.$c();return!t.includes(e)&&(this.Tc([...t,e]),this.Ic(),!0)}_c(e){const t=new Set(e);this.Kh=this.Kh.filter(e=>!t.has(e));const i=this.Mc(),n=i.filter(e=>!t.has(e));n.length!==i.length&&(this.Tc(n),0===n.length&&this.Ec()),this.kc(e)}Pc(){var e;const t=this.rc();if(!t)return{};const i=null===(e=this._instance)||void 0===e||null===(e=e.persistence)||void 0===e?void 0:e.props[t];return i&&"object"==typeof i?i:{}}Cc(e){if(!this.rc())return;const t=this.Pc();this.oc(mt(mt({},t),{},{[e]:Date.now()}))}kc(e){if(!this.rc())return;const t=this.Pc(),i={};let n=!1;for(const[r,o]of Object.entries(t))e.includes(r)?n=!0:i[r]=o;n&&(x(i)?this.lc():this.oc(i))}Rc(){this.rc()&&this.lc()}getActivationTimestamp(e){if(!this.$c().includes(e))return;const t=this.Pc()[e];return U(t)?t:void 0}Mc(){var e;const t=this.Ac();return(null===(e=this._instance)||void 0===e||null===(e=e.persistence)||void 0===e?void 0:e.props[t])||[]}$c(){var e,t,i;const n=this.Mc();if(0===n.length)return[];const r=null===(e=this._instance)||void 0===e||null===(e=e.persistence)||void 0===e?void 0:e.props[this.Fc()],o=null===(t=this._instance)||void 0===t||null===(i=t.get_session_id)||void 0===i?void 0:i.call(t);return o&&r===o?n:[]}Ic(){var e,t;const i=null===(e=this._instance)||void 0===e||null===(t=e.get_session_id)||void 0===t?void 0:t.call(e);i&&this.Oc(i)}Ec(){this.Dc()}nc(e){var t;const i=null===(t=this._instance)||void 0===t||null===(t=t.persistence)||void 0===t?void 0:t.props[this.Fc()];if(i&&i!==e){const e=this.Mc(),t=this.Pc();e.length>0&&(this.Tc([]),e.filter(e=>U(t[e])).forEach(e=>this.Sc(e))),this.Ec(),this.Rc()}}getActivatedIds(){return[...new Set([...this.$c(),...this.Kh])].filter(e=>!this.Lc(e))}dispose(){var e,t,i;null===(e=this.ec)||void 0===e||e.call(this),this.ec=void 0,null===(t=this.Uh)||void 0===t||t.call(this),this.Uh=void 0,null===(i=this.gc)||void 0===i||i.dispose(),this.gc=void 0}reset(){this.Kh=[],this.Mc().length>0&&this.Tc([]),this.Ec(),this.Rc()}
1getEventToItemsMap(){return this.Xh}Nc(){return this.gc}}{constructor(e){super(e)}Ac(){return $n}Fc(){return Tn}rc(){return Pn}oc(e){var t;null===(t=this._instance)||void 0===t||null===(t=t.persistence)||void 0===t||t.register({$surveys_activated_timestamps:e})}lc(){var e;null===(e=this._instance)||void 0===e||null===(e=e.persistence)||void 0===e||e.unregister("$surveys_activated_timestamps")}sc(e){var t;let i;this.cc(t=>{i=t.find(t=>t.id===e)});const n=null==i||null===(t=i.appearance)||void 0===t?void 0:t.surveyPopupDelaySeconds;return U(n)&&n>0}qc(){return Ss}cc(e){var t;null===(t=this._instance)||void 0===t||t.getSurveys(e)}Sc(e){var t;null===(t=this._instance)||void 0===t||t.cancelPendingSurvey(e)}yc(){return el}Tc(e){var t;null===(t=this._instance)||void 0===t||null===(t=t.persistence)||void 0===t||t.register({$surveys_activated:e})}Oc(e){var t;null===(t=this._instance)||void 0===t||null===(t=t.persistence)||void 0===t||t.register({$surveys_activated_session:e})}Dc(){var e;null===(e=this._instance)||void 0===e||null===(e=e.persistence)||void 0===e||e.unregister("$surveys_activated_session")}Lc(){return!1}bc(e,t){let i;return this.cc(e=>{i=e.find(e=>e.id===t)}),!i||function(e){var t;return qa(e)&&!!(null===(t=e.conditions)||void 0===t||null===(t=t.events)||void 0===t?void 0:t.repeatedActivation)||"always"===e.schedule}(i)?e===Ss?"consume":"ignore":e===Ss?"persist":e===As||e===Cs?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}(this._instance)}}(e),{get projectToken(){return t.config.token},kv:new Zl(t=e)}),this._instance=e}Mh(e,t){const i=t.query?wa(e,t.query):e;return new Promise(e=>{var n;this._instance._send_request({method:t.method,url:this._instance.requestRouter.endpointFor(null!==(n=t.target)&&void 0!==n?n:"api",i),data:t.body,headers:t.headers,timeout:t.timeoutMs,fireCallbackOnDrop:!0,transport:t.transport,compression:t.compression,timestampMode:t.sentAt,callback:e})})}}},Nc),Gc={toolbar:class{constructor(e){this.instance=e}wf(e){v.ph_toolbar_state=e}kf(){var e;return null!==(e=v.ph_toolbar_state)&&void 0!==e?e:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(e,t,i){var r,o;if(hr(this.instance.config))return!1;if(!n||!s)return!1;e=null!==(r=e)&&void 0!==r?r:n.location,i=null!==(o=i)&&void 0!==o?o:n.history;try{if(!t){try{n.localStorage.setItem("test","test"),n.localStorage.removeItem("test")}catch(e){return!1}t=null==n?void 0:n.localStorage}const r=Ql||Go(e.hash,"__posthog")||Go(e.hash,"state");let o;const s=r?st(()=>JSON.parse(atob(decodeURIComponent(r))))||st(()=>JSON.parse(decodeURIComponent(r))):null;return s&&"ph_authorize"===s.action?(o=s,o.source="url",o&&Object.keys(o).length>0&&(s.desiredHash?e.hash=s.desiredHash:i?i.replaceState(i.state,"",e.pathname+e.search):e.hash="")):(o=JSON.parse(t.getItem(ec)||"{}"),o.source="localstorage",delete o.userIntent),!(!o.token||this.instance.config.token!==o.token||(this.loadToolbar(o),0))}catch(e){return!1}}Sf(e){const t=v.ph_load_toolbar||v.ph_load_editor;!M(t)&&P(t)?t(e,this.instance):tc.warn("No toolbar load function found")}loadToolbar(e){const t=!!(null==s?void 0:s.getElementById("__POSTHOG_TOOLBAR__"));if(!n||t)return!1;const i="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,r=mt(mt({token:this.instance.config.token},e),{},{apiURL:this.instance.requestRouter.endpointFor("ui")},i?{instrument:!1}:{});if(n.localStorage.setItem(ec,JSON.stringify(mt(mt({},r),{},{source:void 0}))),2===this.kf())this.Sf(r);else if(0===this.kf()){var o,a;this.wf(1),null===(o=v.__PosthogExtensions__)||void 0===o||null===(a=o.loadExternalDependency)||void 0===a||a.call(o,this.instance,"toolbar",e=>{if(e)return tc.error("[Toolbar] Failed to load",e),void this.wf(0);this.wf(2),this.Sf(r)}),fr(n,"turbolinks:load",()=>{this.wf(0),this.loadToolbar(r)})}return!0}xf(e){return this.loadToolbar(e)}maybeLoadEditor(e,t,i){return this.maybeLoadToolbar(e,t,i)}}},qc=mt({experiments:class e{get Mr(){return this._instance.config}constructor(t){this._instance=t,this.getWebExperimentsAndEvaluateDisplayLogic=(t=!1)=>{this.getWebExperiments(t=>{e.Cf("retrieved web experiments from the server"),this.$f=new Map,t.forEach(t=>
1{if(t.feature_flag_key){var i;this.$f&&(e.Cf("setting flag key ",t.feature_flag_key," to web experiment ",t),null===(i=this.$f)||void 0===i||i.set(t.feature_flag_key,t));const n=this._instance.getFeatureFlag(t.feature_flag_key);D(n)&&t.variants[n]&&this.Tf(t.name,n,t.variants[n].transforms)}else if(t.variants)for(const i in t.variants){const n=t.variants[i];e.If(n,this._instance)&&this.Tf(t.name,i,n.transforms)}})},t)},this._instance.onFeatureFlags(e=>{this.onFeatureFlags(e)})}initialize(){}onFeatureFlags(t){if(this._is_bot())e.Cf(gc);else if(!this.Mr.disable_web_experiments){if(M(this.$f))return this.$f=new Map,this.loadIfEnabled(),void this.previewWebExperiment();e.Cf("applying feature flags",t),t.forEach(e=>{var t;if(this.$f&&(null===(t=this.$f)||void 0===t?void 0:t.has(e))){var i;const t=this._instance.getFeatureFlag(e),n=null===(i=this.$f)||void 0===i?void 0:i.get(e);t&&(null==n?void 0:n.variants[t])&&this.Tf(n.name,t,n.variants[t].transforms)}})}}previewWebExperiment(){const t=e.getWindowLocation();if(null==t?void 0:t.search){const i=Vo(null==t?void 0:t.search,"__experiment_id"),n=Vo(null==t?void 0:t.search,"__experiment_variant");i&&n&&(e.Cf(`previewing web experiments ${i} && ${n}`),this.getWebExperiments(e=>{this.Mf(parseInt(i),n,e)},!1,!0))}}loadIfEnabled(){this.Mr.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,t,i){if(this.Mr.disable_web_experiments&&!i)return e([]);const n=this._instance.get_property("$web_experiments");if(n&&!t)return e(n);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api",`/api/web_experiments/?token=${this.Mr.token}`),method:"GET",timestampMode:"query",callback:t=>e(200===t.statusCode&&t.json&&t.json.experiments||[])})}Mf(t,i,n){const r=n.filter(e=>e.id===t);r&&r.length>0&&(e.Cf(`Previewing web experiment [${r[0].name}] with variant [${i}]`),this.Tf(r[0].name,i,r[0].variants[i].transforms))}static If(t,i){return!M(t.conditions)&&e.Ef(t,i)&&e.Pf(t)}static Ef(t,i){var n;if(M(t.conditions)||M(null===(n=t.conditions)||void 0===n?void 0:n.url))return!0;const r=e.getWindowLocation();if(r){var o,s,a;const e=Vr(i,r.href);return!(null===(o=t.conditions)||void 0===o?void 0:o.url)||mc[null!==(s=null===(a=t.conditions)||void 0===a?void 0:a.urlMatchType)&&void 0!==s?s:"icontains"](t.conditions.url,e)}return!1}
1static getWindowLocation(){return null==n?void 0:n.location}static Pf(e){var t;if(M(e.conditions)||M(null===(t=e.conditions)||void 0===t?void 0:t.utm))return!0;const i=Jo();if(i.utm_source){var n,r,o,s,a,l,c,u;const t=!(null===(n=e.conditions)||void 0===n||null===(n=n.utm)||void 0===n?void 0:n.utm_campaign)||(null===(r=e.conditions)||void 0===r||null===(r=r.utm)||void 0===r?void 0:r.utm_campaign)==i.utm_campaign,d=!(null===(o=e.conditions)||void 0===o||null===(o=o.utm)||void 0===o?void 0:o.utm_source)||(null===(s=e.conditions)||void 0===s||null===(s=s.utm)||void 0===s?void 0:s.utm_source)==i.utm_source,f=!(null===(a=e.conditions)||void 0===a||null===(a=a.utm)||void 0===a?void 0:a.utm_medium)||(null===(l=e.conditions)||void 0===l||null===(l=l.utm)||void 0===l?void 0:l.utm_medium)==i.utm_medium,h=!(null===(c=e.conditions)||void 0===c||null===(c=c.utm)||void 0===c?void 0:c.utm_term)||(null===(u=e.conditions)||void 0===u||null===(u=u.utm)||void 0===u?void 0:u.utm_term)==i.utm_term;return t&&f&&h&&d}return!1}static Cf(e,...t){Fi.info(`[WebExperiments] ${e}`,t)}Tf(t,i,n){this._is_bot()?e.Cf(gc):"control"!==i?n.forEach(n=>{if(n.selector){var r;e.Cf(`applying transform of variant ${i} for experiment ${t} `,n);const o=null===(r=document)||void 0===r?void 0:r.querySelectorAll(n.selector);null==o||o.forEach(e=>{const t=e;n.html&&(t.innerHTML=n.html),n.css&&t.setAttribute("style",n.css)})}}):e.Cf("Control variants leave the page unmodified.")}_is_bot(){return o&&this._instance?Va(o,this.Mr.custom_blocked_useragents):void 0}}},Nc),Hc={conversations:class{constructor(e){this._instance=e,this.Rf=void 0,this._conversationsManager=null,this.Af=!1,this.ne=null,this.Ff=!1}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(this._instance.config.disable_conversations)return;if(this.Of=e.ok,!e.ok)return;const t=e.config.conversations;M(t)||(j(t)?this.Rf=t:(this.Rf=t.enabled,this.ne=t),this.loadIfEnabled())}reset(){var e;null===(e=this._conversationsManager)||void 0===e||e.reset(),this._conversationsManager=null,this.Rf=void 0,this.ne=null,this.Of=void 0,this.Ff=!1}loadIfEnabled(){if(this._conversationsManager)return;if(this.Af)return;if(this._instance.config.disable_conversations)return;if(hr(this._instance.config))return;if(this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())return;const e=null==v?void 0:v.__PosthogExtensions__;if(e&&!R(this.Rf)&&this.Rf)if(this.ne&&this.ne.token){this.Af=!0;try{const t=e.initConversations;if(t)return this.Df(t),void(this.Af=!1);const i=e.loadExternalDependency;if(!i)return void this.Lf(Kn);i(this._instance,"conversations",t=>{t||!e.initConversations?this.Lf("Could not load conversations script",t):this.Df(e.initConversations),this.Af=!1})}catch(e){this.Lf("Error initializing conversations",e),this.Af=!1}}else _c.error("Conversations enabled but missing token in remote config.")}Df(e){if(this.ne)try{this._conversationsManager=e(this.ne,this._instance),this.Ff=!1,_c.info("Conversations loaded successfully")}catch(e){this.Lf("Error completing conversations initialization",e)}else _c.error("Cannot complete initialization: remote config is null")}Lf(e,t){_c.error(e,t),this._conversationsManager=null,this.Af=!1,this.Ff=!0}show(){this._conversationsManager?this._conversationsManager.show():_c.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.Rf&&!L(this._conversationsManager)}getUnavailableReason(){return this.isAvailable()?null:this._instance.config.disable_conversations?"disabled_by_config":hr(this._instance.config)?"disabled_for_toolbar":this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut()?"consent_opted_out":!1===this.Of?"remote_config_failed":R(this.Rf)?this.Of?"disabled_in_project":"remote_config_pending":this.Rf?M(this.ne)||!this.ne.token?"missing_token":(null==v?void 0:v.__PosthogExtensions__)?this.Af?"initializing":this.Ff?"load_failed":"not_loaded":"extensions_unavailable":"disabled_in_project"}isVisible(){var e,t;return null!==(e=null===(t=this._conversationsManager)||void 0===t?void 0:t.isVisible())&&void 0!==e&&e}
1sendMessage(e,t,i){var n=this;return Z((function*(){return n._conversationsManager?n._conversationsManager.sendMessage(e,t,i):(_c.warn(yc),null)}))()}getMessages(e,t){var i=this;return Z((function*(){return i._conversationsManager?i._conversationsManager.getMessages(e,t):(_c.warn(yc),null)}))()}markAsRead(e){var t=this;return Z((function*(){return t._conversationsManager?t._conversationsManager.markAsRead(e):(_c.warn(yc),null)}))()}getTickets(e){var t=this;return Z((function*(){return t._conversationsManager?t._conversationsManager.getTickets(e):(_c.warn(yc),null)}))()}requestRestoreLink(e){var t=this;return Z((function*(){return t._conversationsManager?t._conversationsManager.requestRestoreLink(e):(_c.warn(yc),null)}))()}restoreFromToken(e){var t=this;return Z((function*(){return t._conversationsManager?t._conversationsManager.restoreFromToken(e):(_c.warn(yc),null)}))()}restoreFromUrlToken(){var e=this;return Z((function*(){return e._conversationsManager?e._conversationsManager.restoreFromUrlToken():(_c.warn(yc),null)}))()}getCurrentTicketId(){var e,t;return null!==(e=null===(t=this._conversationsManager)||void 0===t?void 0:t.getCurrentTicketId())&&void 0!==e?e:null}getWidgetSessionId(){var e,t;return null!==(e=null===(t=this._conversationsManager)||void 0===t?void 0:t.getWidgetSessionId())&&void 0!==e?e:null}dh(){var e;null===(e=this._conversationsManager)||void 0===e||e.setIdentity()}fh(){var e;null===(e=this._conversationsManager)||void 0===e||e.clearIdentity()}}},zc={logs:class{constructor(e){var t;this._instance=e,this.name="logs",this.Nf=!1,this.qf=!1,this.jf=!1,this.$=ji("[logs]"),this.Bf=mt(mt({},this.$),{},{error:(...e)=>{e.some(Ac)||this.$.error(...e)}}),this.ia=[],this.Hf=[],this.Yc=0,this.So=!1,this.zf=[],this.Uf=[],this.Wf=!1,this.Vf=!1,this.Gf=()=>{var e,t;this.So||(this.Yc=0,null===(e=this.Zf)||void 0===e||e.onReconnect(),null===(t=this.Qf)||void 0===t||t.onReconnect())},this._instance&&(null===(t=this._instance.config.logs)||void 0===t?void 0:t.captureConsoleLogs)&&(this.Nf=!0),n&&fr(n,"online",this.Gf)}Jf(e,t,i,n){var r;const o=bc(null===(r=this._instance)||void 0===r||null===(r=r.config)||void 0===r?void 0:r.logs,i);return[new Di(this.Kf(e,t),o,this.Bf,()=>this.Xf(),e=>e(),void 0,n),o]}Yf(){var e;const t=null===(e=this._instance)||void 0===e||null===(e=e.config)||void 0===e?void 0:e.logs;var i;return this.Zf&&this.tp===t||(null===(i=this.Zf)||void 0===i||i.reset(),this.tp=t,[this.Zf,this.ep]=this.Jf(()=>this.ia,e=>{this.ia=e})),this.Zf}np(){var e;const t=null===(e=this._instance)||void 0===e||null===(e=e.config)||void 0===e?void 0:e.logs;var i;return this.Qf&&this.sp===t||(null===(i=this.Qf)||void 0===i||i.reset(),this.sp=t,[this.Qf,this.rp]=this.Jf(()=>this.Hf,e=>{this.Hf=e},{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},Ic)),this.Qf}setup(e){var t;if(this.So)return;this.po=e,(null===(t=this._instance)||void 0===t||null===(t=t.config)||void 0===t||null===(t=t.logs)||void 0===t?void 0:t.captureConsoleLogs)&&(this.Nf=!0),(this.Nf||this.op()&&this.lp())&&this.ap();let i=!1;const n=e.onRemoteConfig(e=>{var t;i=e.ok&&!0===(null===(t=e.config.logs)||void 0===t?void 0:t.captureConsoleLogs),this.onRemoteConfig(e)});this.So?n.dispose():(this.$o=n,i||this.loadIfEnabled())}dispose(){var e,t,i,r;this.So||(this.So=!0,this.up(),null===(e=this.$o)||void 0===e||e.dispose(),this.$o=void 0,this.po=void 0,this.jf=!1,null==n||n.removeEventListener("online",this.Gf),null===(t=this.hp)||void 0===t||t.call(this),this.hp=void 0,null===(i=this.Zf)||void 0===i||i.reset(),null===(r=this.Qf)||void 0===r||r.reset())}onRemoteConfig(e){var t,i;if(this.So)return;const n=e.ok?null===(t=e.config.logs)||void 0===t?void 0:t.captureConsoleLogs:void 0;M(n)?this.cp():(null===(i=this._instance)||void 0===i||null===(i=i.persistence)||void 0===i||i.register({$logs_capture_enabled_server_side:!!n}),n?(this.Nf=!0,this.qf||this.ap(),this.loadIfEnabled()):this.cp())}reset(){var e,t,i,n;this.up(),null===(e=this.Zf)||void 0===e||e.clearQueue(),this.ia=[],null===(t=this.Zf)||void 0===t||t.reset(),null===(i=this.Qf)||void 0===i||i.clearQueue(),this.Hf=[],null===(n=this.Qf)||void 0===n||n.reset(),this.Yc=0}captureLog(e){this.So||this.Yf().captureLog(e)}captureConsoleLog(e){this.So||this.np().captureLog(e)}captureBufferedConsoleLog(e,t,i){this.So||this.np().captureLog(e,{context:t,occurredAtMs:i})}lp(){var e;return!!(null===(e=this._instance)||void 0===e||null===(e=e.persistence)||void 0===e||null===(e=e.props)||void 0===e?void 0:e[cn])}op(){var e,t,i;return!(null===(e=this._instance)||void 0===e||null===(t=e.Xl)||void 0===t?void 0:t.call(e))||!!(null===(i=v._POSTHOG_REMOTE_CONFIG)||void 0===i||null===(i=i[this._instance.config.token])||void 0===i?void 0:i.config)}gh(){var e;this.up(),null===(e=this.Qf)||void 0===e||e.clearQueue(),this.Hf=[]}cp(){this.Nf||this.up()}ap(){var e;if(this.Wf||!(null==v?void 0:v.console))return;const t=bc(null===(e=this._instance)||void 0===e||null===(e=e.config)||void 0===e?void 0:e.logs).maxBufferSize;let i=!0;this.Uf.push(()=>{i=!1});for(const n of Ec){let r;try{r=wc(v.console[n])}catch(e){continue}r&&this.Uf.push(xl(v.console,n,e=>{const o=(...r)=>{try{i&&this.dp(n,r,t)}catch(e){}return e.apply(v.console,r)};return o.__rrweb_original__=r,o}))}this.Wf=!0,this.vp=setTimeout(()=>{this.up()},3e4)}dp(e,t,i){var n;if(this.Wf&&!this.Vf&&0!==t.length)if(null===(n=this._instance)||void 0===n?void 0:n.is_capturing()){if(i>this.zf.length){this.Vf=!0;try{this.zf.push({level:e,args:t,occurredAtMs:Date.now(),context:this.Xf()})}finally{this.Vf=!1}}}else this.up()}up(){if(this.zf=[],this.Wf){this.Wf=!1,this.vp&&(clearTimeout(this.vp),this.vp=void 0);for(const e of this.Uf)e();this.Uf=[]}}fp(){const e=this.zf;return this.up(),e}get logger(){return this.pp||(this.pp={trace:(e,t)=>this.captureLog({body:e,level:"trace",attributes:t}),debug:(e,t)=>this.captureLog({body:e,level:"debug",attributes:t}),info:(e,t)=>this.captureLog({body:e,level:"info",attributes:t}),warn:(e,t)=>this.captureLog({body:e,level:"warn",attributes:t}),error:(e,t)=>
1this.captureLog({body:e,level:"error",attributes:t}),fatal:(e,t)=>this.captureLog({body:e,level:"fatal",attributes:t})}),this.pp}flushLogs(e){e?this.gp(e):(this.Zf&&this.Zf.flush().catch(e=>this.mp(e)),this.Qf&&this.Qf.flush().catch(e=>this.mp(e)))}mp(e){Ac(e)||this.$.error("PostHog logs flush failed:",e)}loadIfEnabled(){if(this.So||!this.Nf||this.qf||this.jf)return;const e=null==v?void 0:v.__PosthogExtensions__;if(!e)return this.$.error("PostHog Extensions not found."),void this.up();const t=e.loadExternalDependency;if(!t)return this.$.error(Kn),void this.up();this.jf=!0;try{t(this._instance,"logs",t=>{if(this.jf=!1,this.So||!this.Nf)return;const i=e.logs;if(t||!(null==i?void 0:i.initializeLogs))this.$.error("Could not load logs script",t),this.up();else{var n;const e=this.fp();var r,o;this.hp=i.initializeLogs(null!==(n=this.po)&&void 0!==n?n:this._instance),this.qf=!0,e.length>0&&(null===(r=i.replayConsoleBuffer)||void 0===r||r.call(i,null!==(o=this.po)&&void 0!==o?o:this._instance,e))}})}catch(e){throw this.jf=!1,e}}Kf(e,t){const i=this._instance;return{get isDisabled(){return!1},get optedOut(){return!i.is_capturing()},getPersistedProperty:t=>t===_.LogsQueue?e():void 0,setPersistedProperty(e,i){var n;e===_.LogsQueue&&t(null!==(n=i)&&void 0!==n?n:[])},js:e=>this.js(e),getLibraryId:()=>zi.LIB_NAME,getLibraryVersion:()=>zi.LIB_VERSION}}js(e){return new Promise(t=>{if(qo(this.Yc,3))return void t({kind:"fatal",error:Sc(void 0,"logs endpoint is unreachable, dropping batch")});let i=!1;const n=e=>{i||(i=!0,clearTimeout(r),t(e))},r=setTimeout(()=>{this.$.warn("Logs request timed out before receiving a response"),n({kind:"retry-later",error:Sc(void 0,"logs request timed out")})},9e4);this._instance._send_request({method:"POST",url:this.yp(),data:e,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback:e=>{const t=e.statusCode;if(this.bp(t),t>=200&&300>t)n({kind:"ok"});else if(413===t)n({kind:"too-large"});else if(0!==t&&408!==t&&429!==t&&500>t)n({kind:"fatal",error:new Error(`logs request failed with status ${t}`)});else{var i;0===t?(e.error||this.$.warn("Logs request failed before receiving an HTTP response"),n({kind:"retry-later",error:Sc(e.error,"logs request failed before receiving an HTTP response")})):n({kind:"retry-later",error:null!==(i=e.error)&&void 0!==i?i:new Error(`logs request failed with status ${t}`)})}}})})}bp(e){(0!==e||this._instance.__loaded)&&(this.Yc=Ho(e,this.Yc,3,()=>this.$.warn("Log requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped sending logs; will try again when connectivity changes.")))}gp(e){this.ia.length>0&&this._p(e,this.ia,this.ep,zi.LIB_NAME,e=>{this.ia=e}),this.Hf.length>0&&this._p(e,this.Hf,this.rp,Ic,e=>{this.Hf=e})}_p(e,t,i,n,r){if(0===t.length)return;const o=t.map(e=>e.record);r([]);const s=Pi(o,Ti(i,zi.LIB_NAME,zi.LIB_VERSION),n,zi.LIB_VERSION);this._instance._send_request({method:"POST",url:this.yp(),data:s,compression:"best-available",batchKey:"logs",transport:e})}yp(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}Xf(){var e;const t={};if(t.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){const{sessionId:e,windowId:i,sessionStartTimestamp:n,lastActivityTimestamp:r}=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0);t.sessionId=e,t.windowId=i,M(n)||(t.sessionStartTimestamp=n),M(r)||(t.lastActivityTimestamp=r)}if((null==v||null===(e=v.location)||void 0===e?void 0:e.href)&&(t.currentUrl=this._instance.config.disable_capture_url_hashes?ot(v.location.href):v.location.href),this._instance.featureFlags){const e=this._instance.featureFlags.getFlags();e&&e.length>0&&(t.activeFeatureFlags=e)}return t}}},Kc={metrics:class{constructor(e){this._instance=e,this.$=ji("[metrics]"),this.So=!1}initialize(){this.onConfigChange()}onConfigChange(){var e;if(this.So)return;const t=!!(null===(e=this._instance.config.metrics)||void 0===e?void 0:e.network);t&&!this.wp?this.wp=(e=>{let t=!0;const i=()=>t?(e=>{var t;const i=null===(t=e.config.metrics)||void 0===t?void 0:t.network;return!0===i?{}:i||void 0})(e):void 0,n=Rc(e,i),r=Dc(e,i);return()=>{t=!1,n(),r()}})(this._instance):!t&&this.wp&&(this.wp(),this.wp=void 0)}Yf(){var e;const t=null===(e=this._instance)||void 0===e||null===(e=e.config)||void 0===e?void 0:e.metrics;var i;return this.Zf&&this.tp===t||(null===(i=this.Zf)||void 0===i||i.reset(),this.tp=t,this.Zf=new class{constructor(e,t,i){this._instance=e,this.Mr=t,this.$=i,this.zs=new Map,this.ps=new ki(()=>this.flush().catch(e=>{this.$.error("Metrics flush failed:",e)})),this.ys=null,this.Us=!1,this.Ws=new Map,this.Vs=new Set,this.ws=new pi,this.ks=0,this.Ss=1,this.Gs=0}count(e,t=1,i){this.Zs({name:e,type:"count",value:t,unit:null==i?void 0:i.unit,attributes:null==i?void 0:i.attributes})}
vendor: 6,056 bytes, line 1
1gauge(e,t,i){this.Zs({name:e,type:"gauge",value:t,unit:null==i?void 0:i.unit,attributes:null==i?void 0:i.attributes})}histogram(e,t,i){this.Zs({name:e,type:"histogram",value:t,unit:null==i?void 0:i.unit,attributes:null==i?void 0:i.attributes})}flush(){var e=this;const t=this.ys,i=function(){var i=Z((function*(){t&&(yield t.catch(()=>{})),yield e.Qs()}));return function(){return i.apply(this,arguments)}}()().finally(()=>{this.ys===i&&(this.ys=null)});return this.ys=i,i}drainWindow(){if(0===this.zs.size)return null;const e=this.zs;return this.zs=new Map,this.Us=!1,this.Ws=new Map,this.Vs=new Set,this.Js(e)}reset(){this.Gs++,this.ws.reset(),this.ks=0,this.Ss=1,this.ps.clear(),this.zs=new Map,this.ys=null,this.Us=!1,this.Ws=new Map,this.Vs=new Set}Zs(e){if(this._instance.isDisabled||this._instance.optedOut)return;const t=this.Os(e);if(null===t)return;if(!t.name||"string"!=typeof t.name)return void this.$.warn("Dropping metric with empty name");if("number"!=typeof t.value||!Number.isFinite(t.value))return void this.$.warn(`Dropping metric '${t.name}': value must be a finite number`);if("count"===t.type&&0>t.value)return void this.$.warn(`Dropping count '${t.name}': counters are monotonic, value must be >= 0`);let i,n;try{i=t.attributes?mt({},t.attributes):void 0,n=Mi(t.type,t.name,t.unit,i)}catch(e){return void this.$.warn(`Dropping metric '${t.name}': attributes could not be serialized`,e)}let r=this.zs.get(n);if(!r){if(!this.Ks())return;r={name:t.name,type:t.type,unit:t.unit,attributes:i,windowStartMs:Date.now()},this.zs.set(n,r)}const o=this.Ws.get(t.name);void 0===o?this.Ws.set(t.name,t.type):o===t.type||this.Vs.has(t.name)||(this.Vs.add(t.name),this.$.warn(`Metric name '${t.name}' is already used as a ${o}; recording it as a ${t.type} too will blend both series in charts. Use a distinct name.`)),this.Xs(r,t.value),this.Fs()}Ks(){return this.Mr.maxSeriesPerFlush>this.zs.size||(this.Us||(this.Us=!0,this.$.warn(`Metric series cap reached (${this.Mr.maxSeriesPerFlush} per flush window); dropping new series until the next flush. Reduce attribute cardinality.`)),!1)}Xs(e,t){switch(e.type){case"count":var i;e.total=(null!==(i=e.total)&&void 0!==i?i:0)+t;break;case"gauge":e.last=t;break;case"histogram":{e.hist||(e.hist={count:0,sum:0,min:t,max:t,bucketCounts:new Array(Ni.length+1).fill(0)});const i=e.hist;i.count+=1,i.sum+=t,i.min=Math.min(i.min,t),i.max=Math.max(i.max,t),i.bucketCounts[function(e,t){for(let i=0;t.length>i;i++)if(t[i]>=e)return i;return t.length}(t,Ni)]+=1;break}}}Os(e){const t=this.Mr.beforeSend;if(!t)return e;const i=T(t)?t:[t];let n=e;for(const t of i)try{const e=t(n);if(!e)return this.$.info("Metric was rejected in beforeSend function"),null;n=e}catch(e){return this.$.error("Error in beforeSend function for metric:",e),null}return n}Fs(){this.ps.pending||this.ps.arm(this.Hs())}Hs(){return Math.max(Ri(this.Mr.flushIntervalMs,this.ks,this.Ss,3e4),this.ws.remainingMs())}Qs(){var e=this;return Z((function*(){if(e.ps.clear(),0===e.zs.size)return;const t=e.zs;e.zs=new Map,e.Us=!1,e.Ws=new Map,e.Vs=new Set;const i=e.Gs,n=yield e._instance.Ys(e.Js(t));if(i===e.Gs)switch(e.ws.record(n),"retry-later"===n.kind?(e.ks++,e.Ss=xi()):(e.ks=0,e.Ss=1),e.ps.pending&&e.ps.arm(e.Hs()),n.kind){case"ok":return;case"retry-later":return e.lo(t),void e.ps.armNoEarlierThan(e.Hs());case"too-large":return void e.$.warn("Metrics batch exceeded the server size limit and was dropped");case"fatal":return void e.$.error("Failed to send metrics batch:",n.error)}}))()}Js(e){return t=this.ao(e),i=function(e,t,i){return Ei(e,t,i)}(this.Mr,this._instance.getLibraryId(),this._instance.getLibraryVersion()),n=this._instance.getLibraryId(),r=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:Ii(i)},scopeMetrics:[{scope:{name:n,version:r},metrics:t}]}]};var t,i,n,r}ao(e){const t=Li(Date.now()),i=new Map;for(const s of e.values()){var n;const e=Mi(s.type,s.name,s.unit,void 0);let a=i.get(e);a||(a=mt({name:s.name},s.unit&&{unit:s.unit}),"count"===s.type?a.sum={aggregationTemporality:1,isMonotonic:!0,dataPoints:[]}:"gauge"===s.type?a.gauge={dataPoints:[]}:a.histogram={aggregationTemporality:1,dataPoints:[]},i.set(e,a));const l=mi(null!==(n=s.attributes)&&void 0!==n?n:{},this.$),c=Li(s.windowStartMs);if("count"===s.type){var r;const e={attributes:l,startTimeUnixNano:c,timeUnixNano:t,asDouble:null!==(r=s.total)&&void 0!==r?r:0};a.sum.dataPoints.push(e)}else if("gauge"===s.type){var o;const e={attributes:l,timeUnixNano:t,asDouble:null!==(o=s.last)&&void 0!==o?o:0};a.gauge.dataPoints.push(e)}else s.hist&&a.histogram.dataPoints.push({attributes:l,startTimeUnixNano:c,timeUnixNano:t,count:s.hist.count,sum:s.hist.sum,min:s.hist.min,max:s.hist.max,bucketCounts:s.hist.bucketCounts,explicitBounds:Ni})}return Array.from(i.values())}lo(e){for(const[n,r]of e){const e=this.zs.get(n);if(e)switch(e.windowStartMs=Math.min(e.windowStartMs,r.windowStartMs),e.type){case"count":var t,i;e.total=(null!==(t=e.total)&&void 0!==t?t:0)+(null!==(i=r.total)&&void 0!==i?i:0);break;case"gauge":break;case"histogram":if(r.hist)if(e.hist){e.hist.count+=r.hist.count,e.hist.sum+=r.hist.sum,e.hist.min=Math.min(e.hist.min,r.hist.min),e.hist.max=Math.max(e.hist.max,r.hist.max);for(let t=0;e.hist.bucketCounts.length>t;t++)e.hist.bucketCounts[t]+=r.hist.bucketCounts[t]}else e.hist=r.hist}else this.Ks()&&this.zs.set(n,r)}}}(this.Kf(),function(e){var t,i,n,r,o;const s=null==e?void 0:e.resourceAttributes;return{serviceName:null!==(t=null==s?void 0:s["service.name"])&&void 0!==t?t:null==e?void 0:e.serviceName,serviceVersion:null!==(i=null==s?void 0:s["service.version"])&&void 0!==i?i:null==e?void 0:e.serviceVersion,environment:null!==(n=null==s?void 0:s["deployment.environment"])&&void 0!==n?n:null==e?void 0:e.environment,resourceAttributes:s,beforeSend:null==e?void 0:e.beforeSend,flushIntervalMs:null!==(r=null==e?void 0:e.flushIntervalMs)&&void 0!==r?r:1e4,maxSeriesPerFlush:null!==(o=null==e?void 0:e.maxSeriesPerFlush)&&void 0!==o?o:1e3}}(t),this.$)),this.Zf}count(e,t=1,i){this.Yf().count(e,t,i)}
1gauge(e,t,i){this.Yf().gauge(e,t,i)}histogram(e,t,i){this.Yf().histogram(e,t,i)}flush(e){if(!this.Zf)return Promise.resolve();if(e){const t=this.Zf.drainWindow();return t&&this.Ys(t,e),Promise.resolve()}return this.Zf.flush().catch(e=>this.$.error("PostHog metrics flush failed:",e))}reset(){var e;null===(e=this.Zf)||void 0===e||e.reset()}dispose(){var e,t;this.So=!0,null===(e=this.wp)||void 0===e||e.call(this),this.wp=void 0,null===(t=this.Zf)||void 0===t||t.reset()}Kf(){const e=this._instance,t=this;return{get isDisabled(){return!1},get optedOut(){return!e.is_capturing()},Ys:e=>t.Ys(e),getLibraryId:()=>zi.LIB_NAME,getLibraryVersion:()=>zi.LIB_VERSION}}Ys(e,t){return new Promise(i=>{let n=!1;const r=e=>{n||(n=!0,clearTimeout(o),i(e))},o=setTimeout(()=>r({kind:"retry-later",error:new Error("metrics request timed out")}),9e4);this._instance._send_request(mt(mt({method:"POST",url:this.kp(),data:e,compression:"best-available",batchKey:"metrics"},t&&{transport:t}),{},{fireCallbackOnDrop:!0,callback(e){const t=e.statusCode;if(t>=200&&300>t)r({kind:"ok"});else if(413===t)r({kind:"too-large"});else if(0!==t&&408!==t&&429!==t&&500>t)r({kind:"fatal",error:new Error(`metrics request failed with status ${t}`)});else{var i;r({kind:"retry-later",error:null!==(i=e.error)&&void 0!==i?i:new Error(`metrics request failed with status ${t}`)})}}}))})}kp(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}};Il.__defaultExtensionClasses=mt({},mt(mt(mt(mt(mt(mt(mt(mt(mt(mt(mt(mt(mt({},Nc),Lc),Mc),Uc),Fc),jc),Bc),Vc),Gc),qc),Hc),zc),Kc));var Wc=function(){zi.SDK_DIST_CHANNEL="npm";const e=al[ml]=new Il;return function(){function e(){e.done||(e.done=!0,_l=!1,rr(al,(function(e){e._dom_loaded()})))}(null==s?void 0:s.addEventListener)?"complete"===s.readyState?e():fr(s,"DOMContentLoaded",e,{capture:!1}):n&&Fi.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),e}(),Yc=globalThis.posthogProjectToken,Jc=globalThis.posthogHost;Yc&&Wc.init(Yc,{api_host:Jc,defaults:"2026-01-30"});t.a=Wc},,function(e,t,i){"use strict";i.d(t,"a",(function(){return a}));var n=i(69),r=i(22),o=window.optimizelySdkKey,s={datafile:window.optimizelyDatafile,eventDispatcher:n.sendBeaconEventDispatcher};r.a.isLocal()||(s.sdkKey=o);var a=document.getElementById("optimizelySDKEnabled")?Object(n.createInstance)(s):null},,,,function(e,t,i){"use strict";var n={es:["Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado"],mx:["Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado"],ar:["Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado"],en:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],fr:["Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi"],pt:["Domingo","Segunda-feira","Terça-feira","Quarta-feira","Quinta-feira","Sexta-feira","Sábado"],br:["Domingo","Segunda-feira","Terça-feira","Quarta-feira","Quinta-feira","Sexta-feira","Sábado"],it:["Domenica","Lunedì","Martedì","Mercoledì","Giovadì","Venerdì","Sabato"]},r={es:["d","l","m","x","j","v","s"],mx:["d","l","m","x","j","v","s"],ar:["d","l","m","x","j","v","s"],en:["Su","Mo","Tu","We","Th","Fr","Sa"],fr:["d","l","m","m","j","v","s"],pt:["d","s","t","q","q","s","s"],br:["d","s","t","q","q","s","s"],it:["d","l","m","m","g","v","s"]},o={es:["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],mx:["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],ar:["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],en:["January","February","March","April","May","June","July","August","September","October","November","December"],fr:["Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre"],pt:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],br:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],it:["Gennaio","Febbraio","Marzo","Aprile","Maggio","Giugno","Luglio","Agosto","Settembre","Ottobre","Novembre","Dicembre"]},s={es:1,mx:1,ar:1,en:0,fr:1,pt:1,br:1,it:1},a={formatDay:function(e,t){var i;return i=e,e=new Date(i.getUTCFullYear(),i.getUTCMonth(),i.getUTCDate(),i.getUTCHours(),i.getUTCMinutes(),i.getUTCSeconds()),n[t][e.getDay()]+", "+e.getDate()+" "+o[t][e.getMonth()]+" "+e.getFullYear()},formatWeekdayShort:function(e,t){return r[t][e]},formatWeekdayLong:function(e,t){return n[t][e]},getFirstDayOfWeek:function(e){return s[e]},getMonths:function(e){return o[e]},formatMonthTitle:function(e,t){return"".concat(o[t][e.getMonth()]," ").concat(e.getFullYear())}};t.a=a},function(e,t,i){(function(t){var i=/^\s+|\s+$/g,n=/^[-+]0x[0-9a-f]+$/i,r=/^0b[01]+$/i,o=/^0o[0-7]+$/i,s=parseInt,a="object"==typeof t&&t&&t.Object===Object&&t,l="object"==typeof self&&self&&self.Object===Object&&self,c=a||l||Function("return this")(),u=Object.prototype.toString,d=Math.max,f=Math.min,h=function(){return c.Date.now()};function p(e,t,i){var n,r,o,s,a,l,c=0,u=!1,p=!1,m=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function _(t){var i=n,o=r;return n=r=void 0,c=t,s=e.apply(o,i)}function y(e){return c=e,a=setTimeout(E,t),u?_(e):s}function b(e){var i=e-l;return void 0===l||i>=t||i<0||p&&e-c>=o}function E(){var e=h();if(b(e))return w(e);a=setTimeout(E,function(e){var i=t-(e-l);return p?f(i,o-(e-c)):i}(e))}function w(e){return a=void 0,m&&n?_(e):(n=r=void 0,s)}function I(){var e=h(),i=b(e);
1if(n=arguments,r=this,l=e,i){if(void 0===a)return y(l);if(p)return a=setTimeout(E,t),_(l)}return void 0===a&&(a=setTimeout(E,t)),s}return t=g(t)||0,v(i)&&(u=!!i.leading,o=(p="maxWait"in i)?d(g(i.maxWait)||0,t):o,m="trailing"in i?!!i.trailing:m),I.cancel=function(){void 0!==a&&clearTimeout(a),c=0,n=l=r=a=void 0},I.flush=function(){return void 0===a?s:w(h())},I}function v(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function g(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==u.call(e)}(e))return NaN;if(v(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=v(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(i,"");var a=r.test(e);return a||o.test(e)?s(e.slice(2),a?2:8):n.test(e)?NaN:+e}e.exports=function(e,t,i){var n=!0,r=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return v(i)&&(n="leading"in i?!!i.leading:n,r="trailing"in i?!!i.trailing:r),p(e,t,{leading:n,maxWait:t,trailing:r})}}).call(this,i(88))},,function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,r=i(125),o=i(116),s=(n=i(117))&&"object"==typeof n&&"default"in n?n.default:n,a=i(118),l=function(e,t){return(l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])})(e,t)};function c(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}l(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}var u=function(){return(u=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};function d(e,t,i,n){return new(i||(i=Promise))((function(r,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,a)}l((n=n.apply(e,t||[])).next())}))}function f(e,t){var i,n,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(l){return function(a){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(i=1,n&&(r=2&a[0]?n.return:a[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,a[1])).done)return r;switch(n=0,r&&(a=[2&a[0],r.value]),a[0]){case 0:case 1:r=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,n=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((r=(r=s.trys).length>0&&r[r.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]<r[3])){s.label=a[1];break}if(6===a[0]&&s.label<r[1]){s.label=r[1],r=a;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(a);break}r[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],n=0}finally{i=r=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}}function h(e,t,i){if(i||2===arguments.length)for(var n,r=0,o=t.length;r<o;r++)!n&&r in t||(n||(n=Array.prototype.slice.call(t,0,r)),n[r]=t[r]);return e.concat(n||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var p=new(function(){function e(){}return e.prototype.handleError=function(e){},e}());function v(){return p}var g=Math.pow(2,53);function m(e){for(var t=[],i=1;i<arguments.length;i++)t[i-1]=arguments[i];if(!e)return{};if("function"==typeof Object.assign)return Object.assign.apply(Object,h([e],t,!1));for(var n=Object(e),r=0;r<t.length;r++){var o=t[r];if(null!=o)for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])}return n}function _(e,t){return e?S(e,(function(e){return e[t]})):{}}function y(){return r.v4()}function b(){return(new Date).getTime()}function E(e,t){for(var i=!1,n=Object.keys(e),r=0;r<n.length;r++)if(t===e[n[r]]){i=!0;break}return i}function w(e){return Object.keys(e).map((function(t){return e[t]}))}function I(e){return Object.keys(e).map((function(t){return[t,e[t]]}))}function O(e,t){for(var i,n=0,r=e;n<r.length;n++){var o=r[n];if(t(o)){i=o;break}}return i}function S(e,t){var i={};return e.forEach((function(e){var n=t(e);i[n]=e})),i}function A(e){for(var t=[],i=1;i<arguments.length;i++)t[i-1]=arguments[i];var n=0;return e.replace(/%s/g,(function(){var e=t[n++],i=typeof e;return"function"===i?e():"string"===i?e:String(e)}))}function C(e,t){return e.length===t.length&&e.every((function(e,i){return e===t[i]}))}var $,T={assign:m,checkArrayEquality:C,currentTimestamp:function(){return Math.round((new Date).getTime())},isSafeInteger:function(e){return"number"==typeof e&&Math.abs(e)<=g},keyBy:_,uuid:y,isNumber:function(e){return"number"==typeof e},getTimestamp:b,isValidEnum:E,groupBy:function(e,t){var i={};return e.forEach((function(e){var n=t(e);i[n]=i[n]||[],i[n].push(e)})),w(i)},objectValues:w,objectEntries:I,find:O,keyByUtil:S,sprintf:A};($=t.LogLevel||(t.LogLevel={}))[$.NOTSET=0]="NOTSET",$[$.DEBUG=1]="DEBUG",$[$.INFO=2]="INFO",$[$.WARNING=3]="WARNING",$[$.ERROR=4]="ERROR";var P={NOTSET:0,DEBUG:1,INFO:2,WARNING:3,ERROR:4};function k(e){return"string"!=typeof e?e:("WARN"===(e=e.toUpperCase())&&(e="WARNING"),P[e]?P[e]:e)}var x=function(){function e(){this.defaultLoggerFacade=new L,this.loggers={}}return e.prototype.getLogger=function(e){return e?(this.loggers[e]||(this.loggers[e]=new L({messagePrefix:e})),this.loggers[e]):this.defaultLoggerFacade},e}(),R=function(){function e(e){void 0===e&&(e={}),this.logLevel=t.LogLevel.NOTSET,void 0!==e.logLevel&&E(t.LogLevel,e.logLevel)&&this.setLogLevel(e.logLevel),this.logToConsole=void 0===e.logToConsole||!!e.logToConsole,this.prefix=void 0!==e.prefix?e.prefix:"[OPTIMIZELY]"}return e.prototype.log=function(e,t){if(this.shouldLog(e)&&this.logToConsole){var i="".concat(this.prefix," - ").concat(this.getLogLevelName(e)," ").concat(this.getTime()," ").concat(t);this.consoleLog(e,[i])}},e.prototype.setLogLevel=function(e){e=k(e),E(t.LogLevel,e)&&void 0!==e?this.logLevel=e:this.logLevel=t.LogLevel.ERROR},e.prototype.getTime=function(){return(new Date).toISOString()},e.prototype.shouldLog=function(e){return e>=this.logLevel},e.prototype.getLogLevelName=function(e){switch(e){case t.LogLevel.DEBUG:return"DEBUG";case t.LogLevel.INFO:return"INFO ";case t.LogLevel.WARNING:return"WARN ";case t.LogLevel.ERROR:return"ERROR";default:return"NOTSET"}},e.prototype.consoleLog=function(e,i){switch(e){case t.LogLevel.DEBUG:console.log.apply(console,i);break;case t.LogLevel.INFO:console.info.apply(console,i);break;case t.LogLevel.WARNING:console.warn.apply(console,i);break;case t.LogLevel.ERROR:console.error.apply(console,i);break;default:console.log.apply(console,i)}},e}(),D=t.LogLevel.NOTSET,N=null,L=function(){function e(e){void 0===e&&(e={}),this.messagePrefix="",e.messagePrefix&&(this.messagePrefix=e.messagePrefix)}return e.prototype.log=function(e,t){for(var i=[],n=2;n<arguments.length;n++)i[n-2]=arguments[n];this.internalLog(k(e),{message:t,splat:i})},e.prototype.info=function(e){for(var i=[],n=1;n<arguments.length;n++)i[n-1]=arguments[n];this.namedLog(t.LogLevel.INFO,e,i)},e.prototype.debug=function(e){for(var i=[],n=1;n<arguments.length;n++)i[n-1]=arguments[n];
1this.namedLog(t.LogLevel.DEBUG,e,i)},e.prototype.warn=function(e){for(var i=[],n=1;n<arguments.length;n++)i[n-1]=arguments[n];this.namedLog(t.LogLevel.WARNING,e,i)},e.prototype.error=function(e){for(var i=[],n=1;n<arguments.length;n++)i[n-1]=arguments[n];this.namedLog(t.LogLevel.ERROR,e,i)},e.prototype.format=function(e){return"".concat(this.messagePrefix?this.messagePrefix+": ":"").concat(A.apply(void 0,h([e.message],e.splat,!1)))},e.prototype.internalLog=function(e,t){N&&(e<D||(N.log(e,this.format(t)),t.error&&t.error instanceof Error&&v().handleError(t.error)))},e.prototype.namedLog=function(e,t,i){var n;if(t instanceof Error)return t=(n=t).message,void this.internalLog(e,{error:n,message:t,splat:i});if(0!==i.length){var r=i[i.length-1];r instanceof Error&&(n=r,i.splice(-1)),this.internalLog(e,{message:t,error:n,splat:i})}else this.internalLog(e,{message:t,splat:i})},e}(),M=new x;function U(e){return M.getLogger(e)}function F(e){N=e}var j={setLogLevel:function(e){e=k(e),D=E(t.LogLevel,e)&&void 0!==e?e:t.LogLevel.ERROR},setLogHandler:F};function V(e,t){var i=e.context,n=t.context;return i.accountId===n.accountId&&i.projectId===n.projectId&&i.clientName===n.clientName&&i.clientVersion===n.clientVersion&&i.revision===n.revision&&i.anonymizeIP===n.anonymizeIP&&i.botFiltering===n.botFiltering}var B,G,q,H=U("EventProcessor"),z=function(){function e(e){var t=e.timeout,i=e.callback;this.timeout=Math.max(t,0),this.callback=i}return e.prototype.start=function(){this.timeoutId=setTimeout(this.callback,this.timeout)},e.prototype.refresh=function(){this.stop(),this.start()},e.prototype.stop=function(){this.timeoutId&&clearTimeout(this.timeoutId)},e}(),K=function(){function e(e){var t=e.sink;this.sink=t}return e.prototype.start=function(){return Promise.resolve()},e.prototype.stop=function(){return Promise.resolve()},e.prototype.enqueue=function(e){this.sink([e])},e}(),W=function(){function e(e){var t=e.flushInterval,i=e.maxQueueSize,n=e.sink,r=e.closingSink,o=e.batchComparator;this.buffer=[],this.maxQueueSize=Math.max(i,1),this.sink=n,this.closingSink=r,this.batchComparator=o,this.timer=new z({callback:this.flush.bind(this),timeout:t}),this.started=!1}return e.prototype.start=function(){return this.started=!0,Promise.resolve()},e.prototype.stop=function(){this.started=!1;var e=this.closingSink?this.closingSink(this.buffer):this.sink(this.buffer);return this.buffer=[],this.timer.stop(),e},e.prototype.enqueue=function(e){if(this.started){var t=this.buffer[0];t&&!this.batchComparator(t,e)&&this.flush(),0===this.buffer.length&&this.timer.refresh(),this.buffer.push(e),this.buffer.length>=this.maxQueueSize&&this.flush()}else H.warn("Queue is stopped, not accepting event")},e.prototype.flush=function(){this.sink(this.buffer),this.buffer=[],this.timer.stop()},e}(),Y={NOTSET:0,DEBUG:1,INFO:2,WARNING:3,ERROR:4},J={BROWSER_ODP_MANAGER_INITIALIZATION_FAILED:"%s: Error initializing Browser ODP Manager.",CONDITION_EVALUATOR_ERROR:"%s: Error evaluating audience condition of type %s: %s",DATAFILE_AND_SDK_KEY_MISSING:"%s: You must provide at least one of sdkKey or datafile. Cannot start Optimizely",EXPERIMENT_KEY_NOT_IN_DATAFILE:"%s: Experiment key %s is not in datafile.",FEATURE_NOT_IN_DATAFILE:"%s: Feature key %s is not in datafile.",FETCH_SEGMENTS_FAILED_INVALID_IDENTIFIER:"%s: Audience segments fetch failed. (invalid identifier)",FETCH_SEGMENTS_FAILED_NETWORK_ERROR:"%s: Audience segments fetch failed. (network error)",FETCH_SEGMENTS_FAILED_DECODE_ERROR:"%s: Audience segments fetch failed. (decode error)",IMPROPERLY_FORMATTED_EXPERIMENT:"%s: Experiment key %s is improperly formatted.",INVALID_ATTRIBUTES:"%s: Provided attributes are in an invalid format.",INVALID_BUCKETING_ID:"%s: Unable to generate hash for bucketing ID %s: %s",INVALID_DATAFILE:"%s: Datafile is invalid - property %s: %s",INVALID_DATAFILE_MALFORMED:"%s: Datafile is invalid because it is malformed.",INVALID_CONFIG:"%s: Provided Optimizely config is in an invalid format.",INVALID_JSON:"%s: JSON object is not valid.",INVALID_ERROR_HANDLER:'%s: Provided "errorHandler" is in an invali
1d format.',INVALID_EVENT_DISPATCHER:'%s: Provided "eventDispatcher" is in an invalid format.',INVALID_EVENT_TAGS:"%s: Provided event tags are in an invalid format.",INVALID_EXPERIMENT_KEY:"%s: Experiment key %s is not in datafile. It is either invalid, paused, or archived.",INVALID_EXPERIMENT_ID:"%s: Experiment ID %s is not in datafile.",INVALID_GROUP_ID:"%s: Group ID %s is not in datafile.",INVALID_LOGGER:'%s: Provided "logger" is in an invalid format.',INVALID_ROLLOUT_ID:"%s: Invalid rollout ID %s attached to feature %s",INVALID_USER_ID:"%s: Provided user ID is in an invalid format.",INVALID_USER_PROFILE_SERVICE:"%s: Provided user profile service instance is in an invalid format: %s.",LOCAL_STORAGE_DOES_NOT_EXIST:"Error accessing window localStorage.",MISSING_INTEGRATION_KEY:"%s: Integration key missing from datafile. All integrations should include a key.",NO_DATAFILE_SPECIFIED:"%s: No datafile specified. Cannot start optimizely.",NO_JSON_PROVIDED:"%s: No JSON object to validate against schema.",NO_VARIATION_FOR_EXPERIMENT_KEY:"%s: No variation key %s defined in datafile for experiment %s.",ODP_EVENT_FAILED:"ODP event send failed.",ODP_FETCH_QUALIFIED_SEGMENTS_SEGMENTS_MANAGER_MISSING:"%s: ODP unable to fetch qualified segments (Segments Manager not initialized).",ODP_IDENTIFY_FAILED_EVENT_MANAGER_MISSING:"%s: ODP identify event %s is not dispatched (Event Manager not instantiated).",ODP_INITIALIZATION_FAILED:"%s: ODP failed to initialize.",ODP_INVALID_DATA:"%s: ODP data is not valid",ODP_EVENT_FAILED_ODP_MANAGER_MISSING:"%s: ODP Event failed to send. (ODP Manager not initialized).",ODP_FETCH_QUALIFIED_SEGMENTS_FAILED_ODP_MANAGER_MISSING:"%s: ODP failed to Fetch Qualified Segments. (ODP Manager not initialized).",ODP_IDENTIFY_USER_FAILED_ODP_MANAGER_MISSING:"%s: ODP failed to Identify User. (ODP Manager not initialized).",ODP_IDENTIFY_USER_FAILED_USER_CONTEXT_INITIALIZATION:"%s: ODP failed to Identify User. (Failed during User Context Initialization).",ODP_MANAGER_UPDATE_SETTINGS_FAILED_EVENT_MANAGER_MISSING:"%s: ODP Manager failed to update OdpConfig settings for internal event manager. (Event Manager not initialized).",ODP_MANAGER_UPDATE_SETTINGS_FAILED_SEGMENTS_MANAGER_MISSING:"%s: ODP Manager failed to update OdpConfig settings for internal segments manager. (Segments Manager not initialized).",ODP_NOT_ENABLED:"ODP is not enabled",ODP_NOT_INTEGRATED:"%s: ODP is not integrated",ODP_SEND_EVENT_FAILED_EVENT_MANAGER_MISSING:"%s: ODP send event %s was not dispatched (Event Manager not instantiated).",ODP_SEND_EVENT_FAILED_UID_MISSING:"%s: ODP send event %s was not dispatched (No valid user identifier provided).",ODP_SEND_EVENT_FAILED_VUID_MISSING:"%s: ODP send event %s was not dispatched (Unable to fetch VUID).",ODP_SDK_KEY_MISSING_NOTIFICATION_CENTER_FAILURE:"%s: You must provide an sdkKey. Cannot start Notification Center for ODP Integration.",ODP_VUID_INITIALIZATION_FAILED:"%s: ODP VUID initialization failed.",ODP_VUID_REGISTRATION_FAILED:"%s: ODP VUID failed to be registered.",ODP_VUID_REGISTRATION_FAILED_EVENT_MANAGER_MISSING:"%s: ODP register vuid failed. (Event Manager not instantiated).",UNDEFINED_ATTRIBUTE:"%s: Provided attribute: %s has an undefined value.",UNRECOGNIZED_ATTRIBUTE:"%s: Unrecognized attribute %s provided. Pruning before sending event to Optimizely.",UNABLE_TO_CAST_VALUE:"%s: Unable to cast value %s to type %s, returning null.",USER_NOT_IN_FORCED_VARIATION:"%s: User %s is not in the forced variation map. Cannot remove their forced variation.",USER_PROFILE_LOOKUP_ERROR:'%s: Error while looking up user profile for user ID "%s": %s.',USER_PROFILE_SAVE_ERROR:'%s: Error while saving user profile for user ID "%s": %s.',VARIABLE_KEY_NOT_IN_DATAFILE:'%s: Variable with key "%s" associated with feature with key "%s" is not in datafile.',VARIATION_ID_NOT_IN_DATAFILE:"%s: No variation ID %s defined in datafile for experiment %s.",VARIATION_ID_NOT_IN_DATAFILE_NO_EXPERIMENT:"%s: Variation ID %s is not in the datafile.",INVALID_INPUT_FORMAT:"%s: Provided %s is in an invalid format.",INVALID_DATAFILE_VERSION:"%s: This version of the JavaScript SDK does not support the given datafile version: %s",INVALID_VARIATION_KEY:"%s: Provided variation key is in an invali
1d format."},X={ACTIVATE_USER:"%s: Activating user %s in experiment %s.",DISPATCH_CONVERSION_EVENT:"%s: Dispatching conversion event to URL %s with params %s.",DISPATCH_IMPRESSION_EVENT:"%s: Dispatching impression event to URL %s with params %s.",DEPRECATED_EVENT_VALUE:"%s: Event value is deprecated in %s call.",EVENT_KEY_NOT_FOUND:"%s: Event key %s is not in datafile.",EXPERIMENT_NOT_RUNNING:"%s: Experiment %s is not running.",FEATURE_ENABLED_FOR_USER:"%s: Feature %s is enabled for user %s.",FEATURE_NOT_ENABLED_FOR_USER:"%s: Feature %s is not enabled for user %s.",FEATURE_HAS_NO_EXPERIMENTS:"%s: Feature %s is not attached to any experiments.",FAILED_TO_PARSE_VALUE:'%s: Failed to parse event value "%s" from event tags.',FAILED_TO_PARSE_REVENUE:'%s: Failed to parse revenue value "%s" from event tags.',FORCED_BUCKETING_FAILED:"%s: Variation key %s is not in datafile. Not activating user %s.",INVALID_OBJECT:"%s: Optimizely object is not valid. Failing %s.",INVALID_CLIENT_ENGINE:"%s: Invalid client engine passed: %s. Defaulting to node-sdk.",INVALID_DEFAULT_DECIDE_OPTIONS:"%s: Provided default decide options is not an array.",INVALID_DECIDE_OPTIONS:"%s: Provided decide options is not an array. Using default decide options.",INVALID_VARIATION_ID:"%s: Bucketed into an invalid variation ID. Returning null.",NOTIFICATION_LISTENER_EXCEPTION:"%s: Notification listener for (%s) threw exception: %s",NO_ROLLOUT_EXISTS:"%s: There is no rollout of feature %s.",NOT_ACTIVATING_USER:"%s: Not activating user %s for experiment %s.",NOT_TRACKING_USER:"%s: Not tracking user %s.",ODP_DISABLED:"ODP Disabled.",ODP_IDENTIFY_FAILED_ODP_DISABLED:"%s: ODP identify event for user %s is not dispatched (ODP disabled).",ODP_IDENTIFY_FAILED_ODP_NOT_INTEGRATED:"%s: ODP identify event %s is not dispatched (ODP not integrated).",ODP_SEND_EVENT_IDENTIFIER_CONVERSION_FAILED:"%s: sendOdpEvent failed to parse through and convert fs_user_id aliases",PARSED_REVENUE_VALUE:'%s: Parsed revenue value "%s" from event tags.',PARSED_NUMERIC_VALUE:'%s: Parsed event value "%s" from event tags.',RETURNING_STORED_VARIATION:'%s: Returning previously activated variation "%s" of experiment "%s" for user "%s" from user profile.',ROLLOUT_HAS_NO_EXPERIMENTS:"%s: Rollout of feature %s has no experiments",SAVED_VARIATION:'%s: Saved variation "%s" of experiment "%s" for user "%s".',SAVED_VARIATION_NOT_FOUND:"%s: User %s was previously bucketed into variation with ID %s for experiment %s, but no matching variation was found.",SHOULD_NOT_DISPATCH_ACTIVATE:'%s: Experiment %s is not in "Running" state. Not activating user.',SKIPPING_JSON_VALIDATION:"%s: Skipping JSON schema validation.",TRACK_EVENT:"%s: Tracking event %s for user %s.",UNRECOGNIZED_DECIDE_OPTION:"%s: Unrecognized decide option %s provided.",USER_ASSIGNED_TO_EXPERIMENT_BUCKET:"%s: Assigned bucket %s to user with bucketing ID %s.",USER_BUCKETED_INTO_EXPERIMENT_IN_GROUP:"%s: User %s is in experiment %s of group %s.",USER_BUCKETED_INTO_TARGETING_RULE:"%s: User %s bucketed into targeting rule %s.",USER_IN_FEATURE_EXPERIMENT:"%s: User %s is in variation %s of experiment %s on the feature %s.",USER_IN_ROLLOUT:"%s: User %s is in rollout of feature %s.",USER_NOT_BUCKETED_INTO_EVERYONE_TARGETING_RULE:"%s: User %s not bucketed into everyone targeting rule due to traffic allocation.",USER_NOT_BUCKETED_INTO_EXPERIMENT_IN_GROUP:"%s: User %s is not in experiment %s of group %s.",USER_NOT_BUCKETED_INTO_ANY_EXPERIMENT_IN_GROUP:"%s: User %s is not in any experiment of group %s.",USER_NOT_BUCKETED_INTO_TARGETING_RULE:"%s User %s not bucketed into targeting rule %s due to traffic allocation. Trying everyone rule.",USER_NOT_IN_FEATURE_EXPERIMENT:"%s: User %s is not in any experiment on the feature %s.",USER_NOT_IN_ROLLOUT:"%s: User %s is not in rollout of feature %s.",USER_FORCED_IN_VARIATION:"%s: User %s is forced in variation %s.",USER_MAPPED_TO_FORCED_VARIATION:"%s: Set variation %s for experiment %s and user %s in the forced variation map.",USER_DOESNT_MEET_CONDITIONS_FOR_TARGETING_RULE:"%s: User %s does not meet conditions for targeting rule %s.",USER_MEETS_CONDITIONS_FOR_TARGETING_RULE:"
1%s: User %s meets conditions for targeting rule %s.",USER_HAS_VARIATION:"%s: User %s is in variation %s of experiment %s.",USER_HAS_FORCED_DECISION_WITH_RULE_SPECIFIED:"Variation (%s) is mapped to flag (%s), rule (%s) and user (%s) in the forced decision map.",USER_HAS_FORCED_DECISION_WITH_NO_RULE_SPECIFIED:"Variation (%s) is mapped to flag (%s) and user (%s) in the forced decision map.",USER_HAS_FORCED_DECISION_WITH_RULE_SPECIFIED_BUT_INVALID:"Invalid variation is mapped to flag (%s), rule (%s) and user (%s) in the forced decision map.",USER_HAS_FORCED_DECISION_WITH_NO_RULE_SPECIFIED_BUT_INVALID:"Invalid variation is mapped to flag (%s) and user (%s) in the forced decision map.",USER_HAS_FORCED_VARIATION:"%s: Variation %s is mapped to experiment %s and user %s in the forced variation map.",USER_HAS_NO_VARIATION:"%s: User %s is in no variation of experiment %s.",USER_HAS_NO_FORCED_VARIATION:"%s: User %s is not in the forced variation map.",USER_HAS_NO_FORCED_VARIATION_FOR_EXPERIMENT:"%s: No experiment %s mapped to user %s in the forced variation map.",USER_NOT_IN_ANY_EXPERIMENT:"%s: User %s is not in any experiment of group %s.",USER_NOT_IN_EXPERIMENT:"%s: User %s does not meet conditions to be in experiment %s.",USER_RECEIVED_DEFAULT_VARIABLE_VALUE:'%s: User "%s" is not in any variation or rollout rule. Returning default value for variable "%s" of feature flag "%s".',FEATURE_NOT_ENABLED_RETURN_DEFAULT_VARIABLE_VALUE:'%s: Feature "%s" is not enabled for user %s. Returning the default variable value "%s".',VARIABLE_NOT_USED_RETURN_DEFAULT_VARIABLE_VALUE:'%s: Variable "%s" is not used in variation "%s". Returning default value.',USER_RECEIVED_VARIABLE_VALUE:'%s: Got variable value "%s" for variable "%s" of feature flag "%s"',VALID_DATAFILE:"%s: Datafile is valid.",VALID_USER_PROFILE_SERVICE:"%s: Valid user profile service provided.",VARIATION_REMOVED_FOR_USER:"%s: Variation mapped to experiment %s has been removed for user %s.",VARIABLE_REQUESTED_WITH_WRONG_TYPE:'%s: Requested variable type "%s", but variable is of type "%s". Use correct API to retrieve value. Returning None.',VALID_BUCKETING_ID:'%s: BucketingId is valid: "%s"',BUCKETING_ID_NOT_STRING:"%s: BucketingID attribute is not a string. Defaulted to userId",EVALUATING_AUDIENCE:'%s: Starting to evaluate audience "%s" with conditions: %s.',EVALUATING_AUDIENCES_COMBINED:'%s: Evaluating audiences for %s "%s": %s.',AUDIENCE_EVALUATION_RESULT:'%s: Audience "%s" evaluated to %s.',AUDIENCE_EVALUATION_RESULT_COMBINED:"%s: Audiences for %s %s collectively evaluated to %s.",MISSING_ATTRIBUTE_VALUE:'%s: Audience condition %s evaluated to UNKNOWN because no value was passed for user attribute "%s".',UNEXPECTED_CONDITION_VALUE:"%s: Audience condition %s evaluated to UNKNOWN because the condition value is not supported.",UNEXPECTED_TYPE:'%s: Audience condition %s evaluated to UNKNOWN because a value of type "%s" was passed for user attribute "%s".',UNEXPECTED_TYPE_NULL:'%s: Audience condition %s evaluated to UNKNOWN because a null value was passed for user attribute "%s".',UNKNOWN_CONDITION_TYPE:"%s: Audience condition %s has an unknown condition type. You may need to upgrade to a newer release of the Optimizely SDK.",UNKNOWN_MATCH_TYPE:"%s: Audience condition %s uses an unknown match type. You may need to upgrade to a newer release of the Optimizely SDK.",UPDATED_OPTIMIZELY_CONFIG:"%s: Updated Optimizely config to revision %s (project id %s)",OUT_OF_BOUNDS:'%s: Audience condition %s evaluated to UNKNOWN because the number value for user attribute "%s" is not in the range [-2^53, +2^53].',UNABLE_TO_ATTACH_UNLOAD:'%s: unable to bind optimizely.close() to page unload event: "%s"'},Z={BOT_FILTERING:"$opt_bot_filtering",BUCKETING_ID:"$opt_bucketing_id",STICKY_BUCKETING_KEY:"$opt_experiment_bucket_map",USER_AGENT:"$opt_user_agent",FORCED_DECISION_NULL_RULE_KEY:"$opt_null_rule_key"},Q={AB_TEST:"ab-test",FEATURE:"feature",FEATURE_TEST:"feature-test",FEATURE_VARIABLE:"feature-variable",ALL_FEATURE_VARIABLES:"all-feature-variables",FLAG:"flag"},ee={FEATURE_TEST:"feature-test",ROLLOUT:"rollout",EXPERIMENT:"experiment"},te={RULE:"rule",EXPERIMENT:"experiment"},ie={BOOLEAN:"boolean",DOUBLE:"double",INTEGER:"integer",STRING:"string",JSON:"json"},ne={V2:"2",V3:"3",V4:"4"},re={SDK_NOT_READY:"Optimizely SDK not configured properly yet.",FLAG_KEY_INVALID:'No flag was found for key "%s".',VARIABLE_VALUE_INVALID:'Variable value for key "%s" is invali
1d or wrong type.'};!function(e){e.ACTIVATE="ACTIVATE:experiment, user_id,attributes, variation, event",e.DECISION="DECISION:type, userId, attributes, decisionInfo",e.LOG_EVENT="LOG_EVENT:logEvent",e.OPTIMIZELY_CONFIG_UPDATE="OPTIMIZELY_CONFIG_UPDATE",e.TRACK="TRACK:event_key, user_id, attributes, event_tags, event"}(B||(B={})),function(e){e.VUID="vuid",e.FS_USER_ID="fs_user_id"}(G||(G={})),function(e){e.IDENTIFIED="identified",e.INITIALIZED="client_initialized"}(q||(q={}));var oe=Object.freeze({__proto__:null,LOG_LEVEL:Y,ERROR_MESSAGES:J,LOG_MESSAGES:X,CONTROL_ATTRIBUTES:Z,JAVASCRIPT_CLIENT_ENGINE:"javascript-sdk",NODE_CLIENT_ENGINE:"node-sdk",REACT_CLIENT_ENGINE:"react-sdk",REACT_NATIVE_CLIENT_ENGINE:"react-native-sdk",REACT_NATIVE_JS_CLIENT_ENGINE:"react-native-js-sdk",CLIENT_VERSION:"5.2.1",DECISION_NOTIFICATION_TYPES:Q,DECISION_SOURCES:ee,AUDIENCE_EVALUATION_TYPES:te,FEATURE_VARIABLE_TYPES:ie,DATAFILE_VERSIONS:ne,DECISION_MESSAGES:re,get NOTIFICATION_TYPES(){return B},REQUEST_TIMEOUT_MS:6e4,REQUEST_TIMEOUT_ODP_SEGMENTS_MS:1e4,REQUEST_TIMEOUT_ODP_EVENTS_MS:1e4,get ODP_USER_KEY(){return G},FS_USER_ID_ALIAS:"fs-user-id",ODP_DEFAULT_EVENT_TYPE:"fullstack",get ODP_EVENT_ACTION(){return q}}),se=U("EventProcessor"),ae=U("EventProcessor"),le=function(){function e(e){var t=e.key,i=e.maxValues,n=void 0===i?1e3:i;this.LS_KEY=t,this.maxValues=n}return e.prototype.get=function(e){return this.getMap()[e]||null},e.prototype.set=function(e,t){var i=this.getMap();i[e]=t,this.replace(i)},e.prototype.remove=function(e){var t=this.getMap();delete t[e],this.replace(t)},e.prototype.values=function(){return w(this.getMap())},e.prototype.clear=function(){this.replace({})},e.prototype.replace=function(e){try{"undefined"!=typeof window?window&&window.localStorage&&localStorage.setItem(this.LS_KEY,JSON.stringify(e)):localStorage.setItem(this.LS_KEY,JSON.stringify(e)),this.clean()}catch(e){ae.error(String(e))}},e.prototype.clean=function(){var e=this.getMap(),t=Object.keys(e),i=t.length-this.maxValues;if(!(i<1)){var n=t.map((function(t){return{key:t,value:e[t]}}));n.sort((function(e,t){return e.value.timestamp-t.value.timestamp}));for(var r=0;r<i;r++)delete e[n[r].key];this.replace(e)}},e.prototype.getMap=function(){try{var e="undefined"!=typeof window?window&&window.localStorage&&localStorage.getItem(this.LS_KEY):localStorage.getItem(this.LS_KEY);if(e)return JSON.parse(e)||{}}catch(e){ae.error(e)}return{}},e}(),ce=U("EventProcessor"),ue=function(e){function t(t){var i=t.eventDispatcher;return e.call(this,{eventDispatcher:i,store:new le({maxValues:100,key:"fs_optly_pending_events"})})||this}return c(t,e),t}(function(){function e(e){var t=e.eventDispatcher,i=e.store;this.dispatcher=t,this.store=i}return e.prototype.dispatchEvent=function(e,t){this.send({uuid:y(),timestamp:b(),request:e},t)},e.prototype.sendPendingEvents=function(){var e=this,t=this.store.values();ce.debug("Sending %s pending events from previous page",t.length),t.forEach((function(t){try{e.send(t,(function(){}))}catch(e){ce.debug(String(e))}}))},e.prototype.send=function(e,t){var i=this;this.store.set(e.uuid,e),this.dispatcher.dispatchEvent(e.request,(function(n){i.store.remove(e.uuid),t(n)}))},e}());function de(e){var t=[],i=e[0];return e.forEach((function(e){if("conversion"===e.type||"impression"===e.type){var i=function(e){var t={snapshots:[],visitor_id:e.user.id,attributes:[]};return e.user.attributes.forEach((function(e){t.attributes.push({entity_id:e.entityId,key:e.key,type:"custom",value:e.value})})),"boolean"==typeof e.context.botFiltering&&t.attributes.push({entity_id:"$opt_bot_filtering",key:"$opt_bot_filtering",type:"custom",value:e.context.botFiltering}),t}(e);"impression"===e.type?i.snapshots.push(function(e){var t,i,n=e.layer,r=e.experiment,o=e.variation,s=e.ruleKey,a=e.flagKey,l=e.ruleType,c=e.enabled,u=n?n.id:null;return{decisions:[{campaign_id:u,experiment_id:null!==(t=null==r?void 0:r.id)&&void 0!==t?t:"",variation_id:null!==(i=null==o?void 0:o.id)&&void 0!==i?i:"",metadata:{flag_key:a,rule_key:s,rule_type:l,variation_key:o?o.key:"",enabled:c}}],events:[{entity_id:u,timestamp:e.timestamp,key:"campaign_activated",uuid:e.uuid}]}}(e)):"conversion"===e.type&&i.snapshots.push(function(e){var t=u({},e.tags);delete t.revenue,delete t.value;
1var i={entity_id:e.event.id,key:e.event.key,timestamp:e.timestamp,uuid:e.uuid};return e.tags&&(i.tags=e.tags),null!=e.value&&(i.value=e.value),null!=e.revenue&&(i.revenue=e.revenue),{events:[i]}}(e)),t.push(i)}})),{client_name:i.context.clientName,client_version:i.context.clientVersion,account_id:i.context.accountId,project_id:i.context.projectId,revision:i.context.revision,anonymize_ip:i.context.anonymizeIP,enrich_decisions:!0,visitors:t}}var fe=function(){function e(){this.reqsInFlightCount=0,this.reqsCompleteResolvers=[]}return e.prototype.trackRequest=function(e){var t=this;this.reqsInFlightCount++;var i=function(){t.reqsInFlightCount--,0===t.reqsInFlightCount&&(t.reqsCompleteResolvers.forEach((function(e){return e()})),t.reqsCompleteResolvers=[])};e.then(i,i)},e.prototype.onRequestsComplete=function(){var e=this;return new Promise((function(t){0===e.reqsInFlightCount?t():e.reqsCompleteResolvers.push(t)}))},e}(),he=U("LogTierV1EventProcessor"),pe=function(){function e(e){var t=e.dispatcher,i=e.closingDispatcher,n=e.flushInterval,r=void 0===n?3e4:n,o=e.batchSize,s=void 0===o?10:o,a=e.notificationCenter;this.dispatcher=t,this.closingDispatcher=i,this.notificationCenter=a,this.requestTracker=new fe,r=function(e){return e<=0&&(se.warn("Invalid flushInterval ".concat(e,", defaulting to ").concat(3e4)),e=3e4),e}(r),s=function(e){return(e=Math.floor(e))<1&&(se.warn("Invalid batchSize ".concat(e,", defaulting to ").concat(10)),e=10),Math.max(1,e)}(s),this.queue=function(e,t,i,n,r){return e>1?new W({flushInterval:t,maxQueueSize:e,sink:n,closingSink:r,batchComparator:i}):new K({sink:n})}(s,r,V,this.drainQueue.bind(this,!1),this.drainQueue.bind(this,!0))}return e.prototype.drainQueue=function(e,t){var i=this,n=new Promise((function(n){if(he.debug("draining queue with %s events",t.length),0!==t.length){var r,o,s={url:"https://logx.optimizely.com/v1/events",httpVerb:"POST",params:de(t)};(e&&i.closingDispatcher?i.closingDispatcher:i.dispatcher).dispatchEvent(s,(function(){n()})),o=s,(r=i.notificationCenter)&&r.sendNotifications(B.LOG_EVENT,o)}else n()}));return this.requestTracker.trackRequest(n),n},e.prototype.process=function(e){this.queue.enqueue(e)},e.prototype.stop=function(){try{return this.queue.stop(),this.requestTracker.onRequestsComplete()}catch(e){he.error('Error stopping EventProcessor: "%s"',Object(e).message,String(e))}return Promise.resolve()},e.prototype.start=function(){return d(this,void 0,void 0,(function(){return f(this,(function(e){switch(e.label){case 0:return[4,this.queue.start()];case 1:return e.sent(),[2]}}))}))},e}(),ve="CONFIG_VALIDATOR",ge=[ne.V2,ne.V3,ne.V4],me={handleError:function(){}},_e={dispatchEvent:function(e,t){var i,n=e.params,r=e.url;"POST"===e.httpVerb?((i=new XMLHttpRequest).open("POST",r,!0),i.setRequestHeader("Content-Type","application/json"),i.onreadystatechange=function(){if(4===i.readyState&&t&&"function"==typeof t)try{t({statusCode:i.status})}catch(e){}},i.send(JSON.stringify(n))):(r+="?wxhr=true",n&&(r+="&"+function(e){return Object.keys(e).map((function(t){return encodeURIComponent(t)+"="+encodeURIComponent(e[t])})).join("&")}(n)),(i=new XMLHttpRequest).open("GET",r,!0),i.onreadystatechange=function(){if(4===i.readyState&&t&&"function"==typeof t)try{t({statusCode:i.status})}catch(e){}},i.send())}},ye={dispatchEvent:function(e,t){var i=e.params,n=e.url,r=new Blob([JSON.stringify(i)],{type:"application/json"});t({statusCode:navigator.sendBeacon(n,r)?200:500})}},be=function(){function e(){}return e.prototype.log=function(){},e}();function Ee(e){return new R(e)}var we=Object.freeze({__proto__:null,NoOpLogger:be,createLogger:Ee,createNoOpLogger:function(){return new be}}),Ie=function(){function e(e){var t=this;this.logger=e.logger,this.errorHandler=e.errorHandler,this.notificationListeners={},w(B).forEach((function(e){t.notificationListeners[e]=[]})),this.listenerId=1}return e.prototype.addNotificationListener=function(e,t){try{if(!(w(B).indexOf(e)>-1))return-1;this.notificationListeners[e]||(this.notificationListeners[e]=[]);var i=!1;if((this.notificationListeners[e]||[]).forEach((function(e){e.callback!==t||(i=!0)})),i)return-1;this.notificationListeners[e].push({id:this.listenerId,callback:t});var n=this.listenerId;return this.listenerId+=1,n}catch(e){return this.logger.log(Y.ERROR,e.message),this.errorHandler.handleError(e),-1}},e.prototype.removeNotificationListener=function(e){var t=this;try{var i,n;if(Object.keys(this.notificationListeners).some((function(r){return(t.notificationListeners[r]||[]).every((function(t,o){return t.id!==e||(i=o,n=r,!1)})),void 0!==i&&void 0!==n})),void 0!==i&&void 0!==n)return this.notificationListeners[n].splice(i,1),!0}catch(e){this.logger.log(Y.ERROR,e.message),this.errorHandler.handleError(e)}return!1},e.prototype.clearAllNotificationListeners=function(){var e=this;
1try{w(B).forEach((function(t){e.notificationListeners[t]=[]}))}catch(e){this.logger.log(Y.ERROR,e.message),this.errorHandler.handleError(e)}},e.prototype.clearNotificationListeners=function(e){try{this.notificationListeners[e]=[]}catch(e){this.logger.log(Y.ERROR,e.message),this.errorHandler.handleError(e)}},e.prototype.sendNotifications=function(e,t){var i=this;try{(this.notificationListeners[e]||[]).forEach((function(n){var r=n.callback;try{r(t)}catch(t){i.logger.log(Y.ERROR,X.NOTIFICATION_LISTENER_EXCEPTION,"NOTIFICATION_CENTER",e,t.message)}}))}catch(e){this.logger.log(Y.ERROR,e.message),this.errorHandler.handleError(e)}},e}();function Oe(e){return new Ie(e)}var Se,Ae,Ce,$e=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return new(pe.bind.apply(pe,h([void 0],e,!1)))};(Se=t.OptimizelySegmentOption||(t.OptimizelySegmentOption={})).IGNORE_CACHE="IGNORE_CACHE",Se.RESET_CACHE="RESET_CACHE",function(e){e.BOOLEAN="boolean",e.DOUBLE="double",e.INTEGER="integer",e.STRING="string",e.JSON="json"}(Ae||(Ae={})),(Ce=t.OptimizelyDecideOption||(t.OptimizelyDecideOption={})).DISABLE_DECISION_EVENT="DISABLE_DECISION_EVENT",Ce.ENABLED_FLAGS_ONLY="ENABLED_FLAGS_ONLY",Ce.IGNORE_USER_PROFILE_SERVICE="IGNORE_USER_PROFILE_SERVICE",Ce.INCLUDE_REASONS="INCLUDE_REASONS",Ce.EXCLUDE_VARIABLES="EXCLUDE_VARIABLES";var Te="Polling intervals below ".concat(30," seconds are not recommended."),Pe=[0,8,16,32,64,128,256,512],ke=U("DatafileManager");var xe=function(){function e(){this.listeners={},this.listenerId=1}return e.prototype.on=function(e,t){var i=this;this.listeners[e]||(this.listeners[e]={});var n=String(this.listenerId);return this.listenerId++,this.listeners[e][n]=t,function(){i.listeners[e]&&delete i.listeners[e][n]}},e.prototype.emit=function(e,t){var i=this.listeners[e];
1i&&Object.keys(i).forEach((function(e){(0,i[e])(t)}))},e.prototype.removeAllListeners=function(){this.listeners={}},e}(),Re=function(){function e(){this.errorCount=0}return e.prototype.getDelay=function(){return 0===this.errorCount?0:1e3*Pe[Math.min(Pe.length-1,this.errorCount)]+Math.round(1e3*Math.random())},e.prototype.countError=function(){this.errorCount<Pe.length-1&&this.errorCount++},e.prototype.reset=function(){this.errorCount=0},e}(),De=function(){function e(){}return e.getNotificationCenter=function(e,i){var n;if(void 0===i&&(i=U()),e)return this._notificationCenters.has(e)?n=this._notificationCenters.get(e):(n=Oe({logger:i,errorHandler:{handleError:function(){}}}),this._notificationCenters.set(e,n)),n;i.log(t.LogLevel.ERROR,"No SDK key provided to getNotificationCenter.")},e.removeNotificationCenter=function(e){if(e){var t=this._notificationCenters.get(e);t&&(t.clearAllNotificationListeners(),this._notificationCenters.delete(e))}},e._notificationCenters=new Map,e}(),Ne=U("DatafileManager");function Le(e){return e>=200&&e<400}var Me={get:function(){return Promise.resolve(void 0)},set:function(){return Promise.resolve()},contains:function(){return Promise.resolve(!1)},remove:function(){return Promise.resolve(!1)}},Ue=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return c(t,e),t.prototype.makeGetRequest=function(e,t){return function(e,t){var i=new XMLHttpRequest;return{responsePromise:new Promise((function(n,r){i.open("GET",e,!0),function(e,t){Object.keys(e).forEach((function(i){var n=e[i];t.setRequestHeader(i,n)}))}(t,i),i.onreadystatechange=function(){if(4===i.readyState){if(0===i.status)return void r(new Error("Request error"));var e=function(e){var t=e.getAllResponseHeaders();if(null===t)return{};var i=t.split("\r\n"),n={};return i.forEach((function(e){var t=e.indexOf(": ");if(t>-1){var i=e.slice(0,t),r=e.slice(t+2);r.length>0&&(n[i]=r)}})),n}(i),t={statusCode:i.status,body:i.responseText,headers:e};n(t)}},i.timeout=6e4,i.ontimeout=function(){ke.error("Request timed out")},i.send()})),abort:function(){i.abort()}}}(e,t)},t.prototype.getConfigDefaults=function(){return{autoUpdate:!1}},t}(function(){function e(e){var t=this,i=u(u({},this.getConfigDefaults()),e),n=i.datafile,r=i.autoUpdate,o=void 0!==r&&r,s=i.sdkKey,a=i.updateInterval,l=void 0===a?3e5:a,c=i.urlTemplate,d=void 0===c?"https://cdn.optimizely.com/datafiles/%s.json":c,f=i.cache,h=void 0===f?Me:f;this.cache=h,this.cacheKey="opt-datafile-"+s,this.sdkKey=s,this.isReadyPromiseSettled=!1,this.readyPromiseResolver=function(){},this.readyPromiseRejecter=function(){},this.readyPromise=new Promise((function(e,i){t.readyPromiseResolver=e,t.readyPromiseRejecter=i})),n?(this.currentDatafile=n,s||this.resolveReadyPromise()):this.currentDatafile="",this.isStarted=!1,this.datafileUrl=A(d,s),this.emitter=new xe,this.autoUpdate=o,this.updateInterval=l,this.updateInterval<3e4&&Ne.warn(Te),this.currentTimeout=null,this.currentRequest=null,this.backoffController=new Re,this.syncOnCurrentRequestComplete=!1}return e.prototype.get=function(){return this.currentDatafile},e.prototype.start=function(){this.isStarted||(Ne.debug("Datafile manager started"),this.isStarted=!0,this.backoffController.reset(),this.setDatafileFromCacheIfAvailable(),this.syncDatafile())},e.prototype.stop=function(){return Ne.debug("Datafile manager stopped"),this.isStarted=!1,this.currentTimeout&&(clearTimeout(this.currentTimeout),this.currentTimeout=null),this.emitter.removeAllListeners(),this.currentRequest&&(this.currentRequest.abort(),this.currentRequest=null),Promise.resolve()},e.prototype.onReady=function(){return this.readyPromise},e.prototype.on=function(e,t){return this.emitter.on(e,t)},e.prototype.onRequestRejected=function(e){this.isStarted&&(this.backoffController.countError(),e instanceof Error?Ne.error("Error fetching datafile: %s",e.message,e):"string"==typeof e?Ne.error("Error fetching datafile: %s",e):Ne.error("Error fetching datafile"))},e.prototype.onRequestResolved=function(e){var t;if(this.isStarted){void 0!==e.statusCode&&Le(e.statusCode)?this.backoffController.reset():this.backoffController.countError(),this.trySavingLastModified(e.headers);var i=this.getNextDatafileFromResponse(e);if(""!==i)if(Ne.info("Updating datafile from response"),this.currentDatafile=i,this.cache.set(this.cacheKey,i),this.isReadyPromiseSettled){var n={datafile:i};null===(t=De.getNotificationCenter(this.sdkKey,Ne))||void 0===t||t.sendNotifications(B.OPTIMIZELY_CONFIG_UPDATE),this.emitter.emit("update",n)}else this.resolveReadyPromise()}},e.prototype.onRequestComplete=function(){this.isStarted&&(this.currentRequest=null,this.isReadyPromiseSettled||this.autoUpdate||this.rejectReadyPromise(new Error("Failed to become ready")),this.autoUpdate&&this.syncOnCurrentRequestComplete&&this.syncDatafile(),this.syncOnCurrentRequestComplete=!1)},e.prototype.syncDatafile=function(){var e=this,t={};this.lastResponseLastModified&&(t["if-modified-since"]=this.lastResponseLastModified),Ne.debug("Making datafile request to url %s with headers: %s",this.datafileUrl,(function(){return JSON.stringify(t)}
1)),this.currentRequest=this.makeGetRequest(this.datafileUrl,t);var i=function(){e.onRequestComplete()};this.currentRequest.responsePromise.then((function(t){e.onRequestResolved(t)}),(function(t){e.onRequestRejected(t)})).then(i,i),this.autoUpdate&&this.scheduleNextUpdate()},e.prototype.resolveReadyPromise=function(){this.readyPromiseResolver(),this.isReadyPromiseSettled=!0},e.prototype.rejectReadyPromise=function(e){this.readyPromiseRejecter(e),this.isReadyPromiseSettled=!0},e.prototype.scheduleNextUpdate=function(){var e=this,t=this.backoffController.getDelay(),i=Math.max(t,this.updateInterval);Ne.debug("Scheduling sync in %s ms",i),this.currentTimeout=setTimeout((function(){e.currentRequest?e.syncOnCurrentRequestComplete=!0:e.syncDatafile()}),i)},e.prototype.getNextDatafileFromResponse=function(e){return Ne.debug("Response status code: %s",e.statusCode),void 0===e.statusCode||304===e.statusCode?"":Le(e.statusCode)?e.body:(Ne.error("Datafile fetch request failed with status: ".concat(e.statusCode)),"")},e.prototype.trySavingLastModified=function(e){var t=e["last-modified"]||e["Last-Modified"];void 0!==t&&(this.lastResponseLastModified=t,Ne.debug("Saved last modified header value from response: %s",this.lastResponseLastModified))},e.prototype.setDatafileFromCacheIfAvailable=function(){var e=this;this.cache.get(this.cacheKey).then((function(t){e.isStarted&&!e.isReadyPromiseSettled&&t&&(Ne.debug("Using datafile from cache"),e.currentDatafile=t,e.resolveReadyPromise())}))},e}()),Fe="PROJECT_CONFIG",je=function(e,t){void 0===t&&(t=null);var i,n,r,o,s=((o=m({},i=e)).audiences=(i.audiences||[]).map((function(e){return m({},e)})),o.experiments=(i.experiments||[]).map((function(e){return m({},e)})),o.featureFlags=(i.featureFlags||[]).map((function(e){return m({},e)})),o.groups=(i.groups||[]).map((function(e){var t=m({},e);return t.experiments=(e.experiments||[]).map((function(e){return m({},e)})),t})),o.rollouts=(i.rollouts||[]).map((function(e){var t=m({},e);return t.experiments=(e.experiments||[]).map((function(e){return m({},e)})),t})),o.environmentKey=null!==(n=i.environmentKey)&&void 0!==n?n:"",o.sdkKey=null!==(r=i.sdkKey)&&void 0!==r?r:"",o);s.__datafileStr=null===t?JSON.stringify(e):t,(s.audiences||[]).forEach((function(e){e.conditions=JSON.parse(e.conditions)})),s.audiencesById=_(s.audiences,"id"),m(s.audiencesById,_(s.typedAudiences,"id")),s.allSegments=[];var a=new Set;return Object.keys(s.audiencesById).map((function(e){return Ve(s.audiencesById[e])})).forEach((function(e){e.forEach((function(e){a.add(e)}))})),s.allSegments=Array.from(a),s.attributeKeyMap=_(s.attributes,"key"),s.eventKeyMap=_(s.events,"key"),s.groupIdMap=_(s.groups,"id"),Object.keys(s.groupIdMap||{}).forEach((function(e){(s.groupIdMap[e].experiments||[]).forEach((function(t){s.experiments.push(m(t,{groupId:e}))}))})),s.rolloutIdMap=_(s.rollouts||[],"id"),w(s.rolloutIdMap||{}).forEach((function(e){(e.experiments||[]).forEach((function(e){s.experiments.push(e),e.variationKeyMap=_(e.variations,"key")}))})),s.integrations&&(s.integrationKeyMap=_(s.integrations,"key"),s.integrations.forEach((function(e){if(!("key"in e))throw new Error(A(J.MISSING_INTEGRATION_KEY,Fe));"odp"===e.key&&(e.publicKey&&!s.publicKeyForOdp&&(s.publicKeyForOdp=e.publicKey),e.host&&!s.hostForOdp&&(s.hostForOdp=e.host),e.pixelUrl&&!s.pixelUrlForOdp&&(s.pixelUrlForOdp=e.pixelUrl))}))),s.experimentKeyMap=_(s.experiments,"key"),s.experimentIdMap=_(s.experiments,"id"),s.variationIdMap={},s.variationVariableUsageMap={},(s.experiments||[]).forEach((function(e){e.variationKeyMap=_(e.variations,"key"),m(s.variationIdMap,_(e.variations,"id")),w(e.variationKeyMap||{}).forEach((function(e){e.variables&&(s.variationVariableUsageMap[e.id]=_(e.variables,"id"))}))})),s.experimentFeatureMap={},s.featureKeyMap=_(s.featureFlags||[],"key"),w(s.featureKeyMap||{}
1).forEach((function(e){e.variables.forEach((function(e){e.type===ie.STRING&&e.subType===ie.JSON&&(e.type=ie.JSON,delete e.subType)})),e.variableKeyMap=_(e.variables,"key"),(e.experimentIds||[]).forEach((function(t){s.experimentFeatureMap[t]?s.experimentFeatureMap[t].push(e.id):s.experimentFeatureMap[t]=[e.id]}))})),s.flagRulesMap={},(s.featureFlags||[]).forEach((function(e){var t=[];e.experimentIds.forEach((function(e){var i=s.experimentIdMap[e];i&&t.push(i)}));var i=s.rolloutIdMap[e.rolloutId];i&&t.push.apply(t,i.experiments),s.flagRulesMap[e.key]=t})),s.flagVariationsMap={},I(s.flagRulesMap||{}).forEach((function(e){var t=e[0],i=e[1],n=[];i.forEach((function(e){e.variations.forEach((function(e){O(n,(function(t){return t.id===e.id}))||n.push(e)}))})),s.flagVariationsMap[t]=n})),s},Ve=function(e){return e.conditions?Be(e.conditions):[]},Be=function(e){var t=[];return function(e){return["and","or","not"].includes(e)}(e)?[]:(Array.isArray(e)?e.forEach((function(e){return t.push.apply(t,Be(e))})):"qualified"===e.match&&t.push(e.value),t)},Ge=function(e,t){var i=e.experimentIdMap[t];if(!i)throw new Error(A(J.INVALID_EXPERIMENT_ID,Fe,t));return i.layerId},qe=function(e,t,i){var n=e.attributeKeyMap[t],r=0===t.indexOf("$opt_");return n?(r&&i.log(Y.WARNING,"Attribute %s unexpectedly has reserved prefix %s; using attribute ID instead of reserved attribute name.",t,"$opt_"),n.id):r?t:(i.log(Y.DEBUG,J.UNRECOGNIZED_ATTRIBUTE,Fe,t),null)},He=function(e,t){var i=e.eventKeyMap[t];return i?i.id:null},ze=function(e,t){var i=e.experimentKeyMap[t];if(!i)throw new Error(A(J.INVALID_EXPERIMENT_KEY,Fe,t));return i.status},Ke=function(e,t){return e.variationIdMap.hasOwnProperty(t)?e.variationIdMap[t].key:null},We=function(e,t){if(e.experimentKeyMap.hasOwnProperty(t)){var i=e.experimentKeyMap[t];if(i)return i}throw new Error(A(J.EXPERIMENT_KEY_NOT_IN_DATAFILE,Fe,t))},Ye=function(e,t){var i=e.experimentIdMap[t];if(!i)throw new Error(A(J.INVALID_EXPERIMENT_ID,Fe,t));return i.trafficAllocation},Je=function(e,t,i){if(e.experimentIdMap.hasOwnProperty(t)){var n=e.experimentIdMap[t];if(n)return n}return i.log(Y.ERROR,J.INVALID_EXPERIMENT_ID,Fe,t),null},Xe=function(e,t,i){return e&&O(e.flagVariationsMap[t],(function(e){return e.key===i}))||null},Ze=function(e,t,i){if(e.featureKeyMap.hasOwnProperty(t)){var n=e.featureKeyMap[t];if(n)return n}return i.log(Y.ERROR,J.FEATURE_NOT_IN_DATAFILE,Fe,t),null},Qe=function(e){return e.__datafileStr},et=function(e){var t;try{t=function(e){if(!e)throw new Error(A(J.NO_DATAFILE_SPECIFIED,ve));if("string"==typeof e)try{e=JSON.parse(e)}catch(e){throw new Error(A(J.INVALID_DATAFILE_MALFORMED,ve))}if("object"==typeof e&&!Array.isArray(e)&&null!==e&&-1===ge.indexOf(e.version))throw new Error(A(J.INVALID_DATAFILE_VERSION,ve,e.version));return e}(e.datafile)}catch(e){return{configObj:null,error:e}}if(e.jsonSchemaValidator)try{e.jsonSchemaValidator.validate(t),e.logger.log(Y.INFO,X.VALID_DATAFILE,Fe)}catch(e){return{configObj:null,error:e}}else e.logger.log(Y.INFO,X.SKIPPING_JSON_VALIDATION,Fe);var i=[t];return"string"==typeof e.datafile&&i.push(e.datafile),{configObj:je.apply(void 0,i),error:null}},tt=function(e){return!!e.sendFlagDecisions};function it(e,t,i,n){var r={sdkKey:e};if((void 0===n||"object"==typeof n&&null!==n)&&T.assign(r,n),i){var o=et({datafile:i,jsonSchemaValidator:void 0,logger:t}),s=o.configObj,a=o.error;a&&t.error(a),s&&(r.datafile=Qe(s))}return new Ue(r)}var nt=function(){function e(e,t){void 0===t&&(t=6e4),this.logger=e,this.timeout=t}return e.prototype.makeRequest=function(e,i,n,r){var o=this,s=new XMLHttpRequest;return{responsePromise:new Promise((function(a,l){s.open(n,e,!0),o.setHeadersInXhr(i,s),s.onreadystatechange=function(){if(s.readyState===XMLHttpRequest.DONE){if(0===s.status)return void l(new Error("Request error"));var e=o.parseHeadersFromXhr(s),t={statusCode:s.status,body:s.responseText,headers:e};a(t)}},s.timeout=o.timeout,s.ontimeout=function(){o.logger.log(t.LogLevel.WARNING,"Request timed out")},s.send(r)})),abort:function(){s.abort()}}},e.prototype.setHeadersInXhr=function(e,t){Object.keys(e).forEach((function(i){var n=e[i];"string"==typeof n&&t.setRequestHeader(i,n)}))},e.prototype.parseHeadersFromXhr=function(e){var i=this,n=e.getAllResponseHeaders();if(null===n)return{};var r=n.split("\r\n"),o={};return r.forEach((function(e){try{var n=e.indexOf(": ");if(n>-1){var r=e.slice(0,n),s=e.slice(n+2);r&&s&&(o[r]=s)}}catch(n){i.logger.log(t.LogLevel.WARNING,"Unable to parse & skipped header item '".concat(e,"'"))}})),o},e}(),rt=function(e){var t=e.browserCallback,i=e.nonBrowserCallback;return"undefined"!=typeof window?t(null===window||void 0===window?void 0:window.localStorage):i()},ot=function(){function e(){this.logger=U()}return e.prototype.contains=function(e){return d(this,void 0,void 0,(function(){var t=this;return f(this,(function(i){return[2,rt({browserCallback:function(t){return null!==(null==t?void 0:t.getItem(e))},nonBrowserCallback:function(){return t.logger.error(J.LOCAL_STORAGE_DOES_NOT_EXIST),!1}})]}))}))},e.prototype.get=function(e){return d(this,void 0,void 0,(function(){var t=this;return f(this,(function(i){return[2,rt({browserCallback:function(t){return(null==t?void 0:t.getItem(e))||void 0},nonBrowserCallback:function(){t.logger.error(J.LOCAL_STORAGE_DOES_NOT_EXIST)}})]}))}))},e.prototype.remove=function(e){return d(this,void 0,void 0,(function(){var t=this;return f(this,(function(i){switch(i.label){case 0:return[4,this.contains(e)];case 1:return i.sent()?(rt({browserCallback:function(t){null==t||t.removeItem(e)},nonBrowserCallback:function(){t.logger.error(J.LOCAL_STORAGE_DOES_NOT_EXIST)}}),[2,!0]):[2,!1]}}))}))},e.prototype.set=function(e,t){return d(this,void 0,void 0,(function(){var i=this;return f(this,(function(n){return[2,rt({browserCallback:function(i){null==i||i.setItem(e,t)},nonBrowserCallback:function(){i.logger.error(J.LOCAL_STORAGE_DOES_NOT_EXIST)}})]}))}))},e}(),st=function(){function e(e){void 0===e&&(e=null),this._value=e,this._time=Date.now()}return Object.defineProperty(e.prototype,"value",{get:function(){return this._value}
1,enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"time",{get:function(){return this._time},enumerable:!1,configurable:!0}),e.prototype.is_stale=function(e){return!(e<=0)&&Date.now()-this._time>=e},e}(),at=function(){function e(e){var t=e.maxSize,i=e.timeout;this._map=new Map;var n=U();n.debug("Provisioning cache with maxSize of ".concat(t)),n.debug("Provisioning cache with timeout of ".concat(i)),this._maxSize=t,this._timeout=i}return Object.defineProperty(e.prototype,"map",{get:function(){return this._map},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxSize",{get:function(){return this._maxSize},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"timeout",{get:function(){return this._timeout},enumerable:!1,configurable:!0}),e.prototype.lookup=function(e){if(this._maxSize<=0)return null;var t=this._map.get(e);return t?t.is_stale(this._timeout)?(this._map.delete(e),null):(this._map.delete(e),this._map.set(e,t),t.value):null},e.prototype.save=function(e){var t=e.key,i=e.value;if(!(this._maxSize<=0)&&(this._map.get(t)&&this._map.delete(t),this._map.set(t,new st(i)),this._map.size>this._maxSize)){var n=this._map.keys().next().value;this._map.delete(n)}},e.prototype.reset=function(){this._maxSize<=0||this._map.clear()},e.prototype.peek=function(e){var t;if(this._maxSize<=0)return null;var i=this._map.get(e);return null!==(t=null==i?void 0:i.value)&&void 0!==t?t:null},e}(),lt=function(e){function t(t){var i,n;return e.call(this,{maxSize:null!==(i=null==t?void 0:t.maxSize)&&void 0!==i?i:100,timeout:null!==(n=null==t?void 0:t.timeout)&&void 0!==n?n:6e5})||this}return c(t,e),t}(at),ct=(function(e){c((function(t){var i,n;return e.call(this,{maxSize:null!==(i=null==t?void 0:t.maxSize)&&void 0!==i?i:1e4,timeout:null!==(n=null==t?void 0:t.timeout)&&void 0!==n?n:6e5})||this}),e)}(at),function(){function e(){this._keyForVuid="optimizely-vuid",this._vuid=""}return Object.defineProperty(e.prototype,"vuid",{get:function(){return this._vuid},enumerable:!1,configurable:!0}),e.instance=function(t){return d(this,void 0,void 0,(function(){return f(this,(function(i){switch(i.label){case 0:return this._instance||(this._instance=new e),this._instance._vuid?[3,2]:[4,this._instance.load(t)];case 1:i.sent(),i.label=2;case 2:return[2,this._instance]}}))}))},e.prototype.load=function(t){return d(this,void 0,void 0,(function(){var i;return f(this,(function(n){switch(n.label){case 0:return[4,t.get(this._keyForVuid)];case 1:return(i=n.sent())&&e.isVuid(i)?(this._vuid=i,[3,4]):[3,2];case 2:return this._vuid=this.makeVuid(),[4,this.save(this._vuid,t)];case 3:n.sent(),n.label=4;case 4:return[2,this._vuid]}}))}))},e.prototype.makeVuid=function(){var t=y().replace(/-/g,"").toLowerCase(),i="".concat(e.vuid_prefix).concat(t);return i.length<=32?i:i.substring(0,32)},e.prototype.save=function(e,t){return d(this,void 0,void 0,(function(){return f(this,(function(i){switch(i.label){case 0:return[4,t.set(this._keyForVuid,e)];case 1:return i.sent(),[2]}}))}))},e._reset=function(){this._instance._vuid=""},e.vuid_prefix="vuid_",e.isVuid=function(t){return(null==t?void 0:t.startsWith(e.vuid_prefix))||!1},e}()),ut=function(){function e(e,t,i,n){this._apiKey=null!=e?e:"",this._apiHost=null!=t?t:"",this._pixelUrl=null!=i?i:"",this._segmentsToCheck=null!=n?n:[]}return Object.defineProperty(e.prototype,"apiHost",{get:function(){return this._apiHost},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"apiKey",{get:function(){return this._apiKey},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pixelUrl",{get:function(){return this._pixelUrl},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"segmentsToCheck",{get:function(){return this._segmentsToCheck},enumerable:!1,configurable:!0}),e.prototype.update=function(e){return!this.equals(e)&&(e.apiKey&&(this._apiKey=e.apiKey),e.apiHost&&(this._apiHost=e.apiHost),e.pixelUrl&&(this._pixelUrl=e.pixelUrl),e.segmentsToCheck&&(this._segmentsToCheck=e.segmentsToCheck),!0)},e.prototype.isReady=function(){return!!this._apiKey&&!!this._apiH
1ost},e.prototype.equals=function(e){return this._apiHost===e._apiHost&&this._apiKey===e._apiKey&&this._pixelUrl===e._pixelUrl&&C(this.segmentsToCheck,e._segmentsToCheck)},e}();function dt(e){var t=["string","number","boolean"],i=!1;return e.forEach((function(e){t.includes(typeof e)||null===e||(i=!0)})),i}var ft,ht=function(e,t,i,n){this.type=e,this.action=t,this.identifiers=null!=i?i:new Map,this.data=null!=n?n:new Map},pt=function(){function e(){this.enabled=!0,this.logger=U(),this.odpConfig=new ut}return e.prototype.updateSettings=function(e){var i,n=e.apiKey,r=e.apiHost,o=e.pixelUrl,s=e.segmentsToCheck;if(!this.enabled)return!1;if(!this.eventManager)return this.logger.log(t.LogLevel.ERROR,J.ODP_MANAGER_UPDATE_SETTINGS_FAILED_EVENT_MANAGER_MISSING),!1;if(!this.segmentManager)return this.logger.log(t.LogLevel.ERROR,J.ODP_MANAGER_UPDATE_SETTINGS_FAILED_SEGMENTS_MANAGER_MISSING),!1;this.eventManager.flush();var a=new ut(n,r,o,s);return!!this.odpConfig.update(a)&&(this.odpConfig.update(a),null===(i=this.segmentManager)||void 0===i||i.reset(),!0)},e.prototype.close=function(){var e;this.enabled&&(null===(e=this.eventManager)||void 0===e||e.stop())},e.prototype.fetchQualifiedSegments=function(e,i){return void 0===i&&(i=[]),d(this,void 0,void 0,(function(){return f(this,(function(n){return this.enabled?this.segmentManager?ct.isVuid(e)?[2,this.segmentManager.fetchQualifiedSegments(G.VUID,e,i)]:[2,this.segmentManager.fetchQualifiedSegments(G.FS_USER_ID,e,i)]:(this.logger.log(t.LogLevel.ERROR,J.ODP_FETCH_QUALIFIED_SEGMENTS_SEGMENTS_MANAGER_MISSING),[2,null]):(this.logger.log(t.LogLevel.ERROR,J.ODP_NOT_ENABLED),[2,null])}))}))},e.prototype.identifyUser=function(e,i){this.enabled?this.odpConfig.isReady()?this.eventManager?e&&ct.isVuid(e)?this.eventManager.identifyUser(void 0,e):this.eventManager.identifyUser(e,i):this.logger.log(t.LogLevel.ERROR,J.ODP_IDENTIFY_FAILED_EVENT_MANAGER_MISSING):this.logger.log(t.LogLevel.DEBUG,X.ODP_IDENTIFY_FAILED_ODP_NOT_INTEGRATED):this.logger.log(t.LogLevel.DEBUG,X.ODP_IDENTIFY_FAILED_ODP_DISABLED)},e.prototype.sendEvent=function(e){var t=e.type,i=e.action,n=e.identifiers,r=e.data,o=t;if("string"==typeof o&&""!==o||(o="fullstack"),!this.enabled)throw new Error(J.ODP_NOT_ENABLED);if(!this.odpConfig.isReady())throw new Error(J.ODP_NOT_INTEGRATED);if(dt(r))throw new Error(J.ODP_INVALID_DATA);if(!this.eventManager)throw new Error(J.ODP_SEND_EVENT_FAILED_EVENT_MANAGER_MISSING);if("string"!=typeof i||""===i)throw new Error("ODP action is not valid (cannot be empty).");this.eventManager.sendEvent(new ht(o,i,n,r))},e}(),vt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return c(i,e),i.prototype.shouldSendEvents=function(e){return e.length<=1||(this.getLogger().log(t.LogLevel.ERROR,"".concat("ODP event send failed"," (browser only supports batch size 1)")),!1)},i.prototype.getPixelApiEndpoint=function(){var e;if(!(null===(e=this.odpConfig)||void 0===e?void 0:e.isReady()))throw new Error("ODP config not ready");var t=this.odpConfig.pixelUrl;return new URL("v2/zaius.gif",t).href},i.prototype.generateRequestData=function(e){var i;if(!(null===(i=this.odpConfig)||void 0===i?void 0:i.isReady()))throw this.getLogger().log(t.LogLevel.ERROR,"ODP config not ready"),new Error("ODP config not ready");var n=this.getPixelApiEndpoint(),r=this.odpConfig.apiKey,o=e[0],s=new URL(n);return o.identifiers.forEach((function(e,t){s.searchParams.append(t,e)})),o.data.forEach((function(e,t){s.searchParams.append(t,e)})),s.searchParams.append("tracker_id",r),s.searchParams.append("event_type",o.type),s.searchParams.append("vdl_action",o.action),{method:"GET",endpoint:s.toString(),headers:{},data:""}},i}(function(){function e(e,t){this.requestHandler=e,this.logger=t}return e.prototype.updateSettings=function(e){this.odpConfig=e},e.prototype.getLogger=function(){return this.logger},e.prototype.sendEvents=function(e){var i,n;return d(this,void 0,void 0,(function(){var r,o,s,a,l,c,u,d,h,p;return f(this,(function(f){switch(f.label){case 0:if(r=!1,!(null===(i=this.odpConfig)||void 0===i?void 0:i.isReady()))return this.logger.log(t.LogLevel.ERROR,"".concat("ODP event send failed"," (").concat("ODP config not ready",")")),[2,r];
1if(0===e.length)return this.logger.log(t.LogLevel.ERROR,"".concat("ODP event send failed"," (no events)")),[2,r];if(!this.shouldSendEvents(e))return[2,r];o=this.generateRequestData(e),s=o.method,a=o.endpoint,l=o.headers,c=o.data,u=0,f.label=1;case 1:return f.trys.push([1,3,,4]),[4,this.requestHandler.makeRequest(a,l,s,c).responsePromise];case 2:return d=f.sent(),u=null!==(n=d.statusCode)&&void 0!==n?n:u,[3,4];case 3:return h=f.sent(),p="network error",h instanceof Error&&(p=h.message),this.logger.log(t.LogLevel.ERROR,"".concat("ODP event send failed"," (").concat(p,")")),r=!0,[3,4];case 4:return u>=400&&this.logger.log(t.LogLevel.ERROR,"".concat("ODP event send failed"," (").concat(u,")")),u>=500&&(r=!0),[2,r]}}))}))},e}());!function(e){e[e.STOPPED=0]="STOPPED",e[e.RUNNING=1]="RUNNING",e[e.PROCESSING=2]="PROCESSING"}(ft||(ft={}));var gt=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.hasNecessaryIdentifiers=function(e){return e.identifiers.size>=0},t}return c(i,e),i.prototype.initParams=function(e,i,n){this.queueSize=i||100,this.batchSize=1,this.flushInterval=0,void 0!==e&&1!==e&&this.getLogger().log(t.LogLevel.WARNING,"ODP event batch size must be 1 in the browser."),void 0!==n&&0!==n&&this.getLogger().log(t.LogLevel.WARNING,"ODP event flush interval must be 0 in the browser.")},i.prototype.discardEventsIfNeeded=function(){this.getLogger().log(t.LogLevel.DEBUG,"ODPConfig not ready. Leaving events in queue.")},i}(function(){function e(e){var t=e.odpConfig,i=e.apiManager,n=e.logger,r=e.clientEngine,o=e.clientVersion,s=e.queueSize,a=e.batchSize,l=e.flushInterval,c=e.userAgentParser;if(this.state=ft.STOPPED,this.queue=new Array,this.odpConfig=t,this.apiManager=i,this.logger=n,this.clientEngine=r,this.clientVersion=o,this.initParams(a,s,l),this.state=ft.STOPPED,this.userAgentParser=c,c){var u=c.parseUserAgentInfo(),d=u.os,f=u.device,h={os:d.name,os_version:d.version,device_type:f.type,model:f.model};this.userAgentData=new Map(Object.entries(h).filter((function(e){e[0];var t=e[1];return null!=t&&null!=t})))}this.apiManager.updateSettings(t)}return e.prototype.updateSettings=function(e){this.odpConfig=e,this.apiManager.updateSettings(e)},e.prototype.flush=function(){this.processQueue(!0)},e.prototype.start=function(){this.state=ft.RUNNING,this.setNewTimeout()},e.prototype.stop=function(){return d(this,void 0,void 0,(function(){return f(this,(function(e){switch(e.label){case 0:return this.logger.log(t.LogLevel.DEBUG,"Stop requested."),[4,this.processQueue(!0)];case 1:return e.sent(),this.state=ft.STOPPED,this.logger.log(t.LogLevel.DEBUG,"Stopped. Queue Count: %s",this.queue.length),[2]}}))}))},e.prototype.registerVuid=function(e){var t=new Map;t.set(G.VUID,e);var i=new ht("fullstack",q.INITIALIZED,t);this.sendEvent(i)},e.prototype.identifyUser=function(e,i){var n=new Map;if(e||i){i&&n.set(G.VUID,i),e&&n.set(G.FS_USER_ID,e);var r=new ht("fullstack",q.IDENTIFIED,n);this.sendEvent(r)}else this.logger.log(t.LogLevel.ERROR,J.ODP_SEND_EVENT_FAILED_UID_MISSING)},e.prototype.sendEvent=function(e){dt(e.data)?this.logger.log(t.LogLevel.ERROR,"Event data found to be invalid."):(e.data=this.augmentCommonData(e.data),this.enqueue(e))},e.prototype.enqueue=function(e){this.state!==ft.STOPPED?this.hasNecessaryIdentifiers(e)?this.queue.length>=this.queueSize?this.logger.log(t.LogLevel.WARNING,"Failed to Process ODP Event. Event Queue full. queueSize = %s.",this.queue.length):(this.queue.push(e),this.processQueue()):this.logger.log(t.LogLevel.ERROR,"ODP events should have at least one key-value pair in identifiers."):this.logger.log(t.LogLevel.WARNING,"Failed to Process ODP Event. ODPEventManager is not running.")},e.prototype.processQueue=function(e){if(void 0===e&&(e=!1),this.state===ft.RUNNING&&this.isOdpConfigurationReady()){if(e)for(this.clearCurrentTimeout(),this.state=ft.PROCESSING;this.queueContainsItems();)this.makeAndSend1Batch();else if(this.queueHasBatches())for(this.clearCurrentTimeout(),this.state=ft.PROCESSING;this.queueHasBatches();)this.makeAndSend1Batch();this.state=ft.RUNNING,this.setNewTimeout()}},e.prototype.clearCurrentTimeout=function(){clearTimeout(this.timeoutId),this.timeoutId=void 0},e.prototype.setNewTimeout=function(){var e=this;void 0===this.timeoutId&&(this.timeoutId=setTimeout((function(){return e.processQueue(!0)}),this.flushInterval))},e.prototype.makeAndSend1Batch=function(){for(var e=this,t=new Array,i=0;i<this.batchSize;i+=1){var n=this.queue.shift();if(!n)break;t.push(n)}t.length>0&&setTimeout((function(){return d(e,void 0,void 0,(function(){var e,i;return f(this,(function(n){switch(n.label){case 0:i=0,n.label=1;case 1:return[4,this.apiManager.sendEvents(t)];case 2:e=n.sent(),i+=1,n.label=3;case 3:if(e&&i<3)return[3,1];n.label=4;case 4:return[2]}}
1))}))}))},e.prototype.queueHasBatches=function(){return this.queueContainsItems()&&this.queue.length%this.batchSize==0},e.prototype.queueContainsItems=function(){return this.queue.length>0},e.prototype.isOdpConfigurationReady=function(){return!!this.odpConfig.isReady()||(this.discardEventsIfNeeded(),!1)},e.prototype.augmentCommonData=function(e){var t=new Map(this.userAgentData);return t.set("idempotence_id",y()),t.set("data_source_type","sdk"),t.set("data_source",this.clientEngine),t.set("data_source_version",this.clientVersion),e.forEach((function(e,i){return t.set(i,e)})),t},e.prototype.getLogger=function(){return this.logger},e}()),mt=function(){function e(e,t,i,n){this.odpConfig=e,this._segmentsCache=t,this.odpSegmentApiManager=i,this.logger=n||U("OdpSegmentManager")}return Object.defineProperty(e.prototype,"segmentsCache",{get:function(){return this._segmentsCache},enumerable:!1,configurable:!0}),e.prototype.fetchQualifiedSegments=function(e,i,n){return d(this,void 0,void 0,(function(){var r,o,s,a,l,c,u,d,h;return f(this,(function(f){switch(f.label){case 0:if(r=this.odpConfig,o=r.apiHost,!(s=r.apiKey)||!o)return this.logger.log(t.LogLevel.WARNING,J.FETCH_SEGMENTS_FAILED_INVALID_IDENTIFIER),[2,null];if(!(a=this.odpConfig.segmentsToCheck)||a.length<=0)return this.logger.log(t.LogLevel.DEBUG,"No segments are used in the project. Returning an empty list."),[2,[]];if(l=this.makeCacheKey(e,i),c=n.includes(t.OptimizelySegmentOption.IGNORE_CACHE),(u=n.includes(t.OptimizelySegmentOption.RESET_CACHE))&&this.reset(),!c&&!u){if(d=this._segmentsCache.lookup(l))return this.logger.log(t.LogLevel.DEBUG,'ODP cache hit. Returning segments from cache "%s".',l),[2,d];this.logger.log(t.LogLevel.DEBUG,"ODP cache miss.")}return this.logger.log(t.LogLevel.DEBUG,"Making a call to ODP server."),[4,this.odpSegmentApiManager.fetchSegments(s,o,e,i,a)];case 1:return(h=f.sent())&&!c&&this._segmentsCache.save({key:l,value:h}),[2,h]}}))}))},e.prototype.reset=function(){this._segmentsCache.reset()},e.prototype.makeCacheKey=function(e,t){return"".concat(e,"-$-").concat(t)},e.prototype.updateSettings=function(e){this.odpConfig=e,this._segmentsCache.reset()},e}(),_t={$schema:"http://json-schema.org/draft-04/schema#",title:"Project Config JSON Schema",type:"object",properties:{projectId:{type:"string",required:!0},accountId:{type:"string",required:!0},groups:{type:"array",items:{type:"object",properties:{id:{type:"string",required:!0},policy:{type:"string",required:!0},trafficAllocation:{type:"array",items:{type:"object",properties:{entityId:{type:"string",required:!0},endOfRange:{type:"integer",required:!0}}},required:!0},experiments:{type:"array",items:{type:"object",properties:{id:{type:"string",required:!0},key:{type:"string",required:!0},status:{type:"string",required:!0},layerId:{type:"string",required:!0},variations:{type:"array",items:{type:"object",properties:{id:{type:"string",required:!0},key:{type:"string",required:!0}}},required:!0},trafficAllocation:{type:"array",items:{type:"object",properties:{entityId:{type:"string",required:!0},endOfRange:{type:"integer",required:!0}}},required:!0},audienceIds:{type:"array",items:{type:"string"},required:!0},forcedVariations:{type:"object",required:!0}}},required:!0}}},required:!0},experiments:{type:"array",items:{type:"object",properties:{id:{type:"string",required:!0},key:{type:"string",required:!0},status:{type:"string",required:!0},layerId:{type:"string",required:!0},variations:{type:"array",items:{type:"object",properties:{id:{type:"string",required:!0},key:{type:"string",required:!0}}},required:!0},trafficAllocation:{type:"array",items:{type:"object",properties:{entityId:{type:"string",required:!0},endOfRange:{type:"integer",required:!0}}},required:!0},audienceIds:{type:"array",items:{type:"string"},required:!0},forcedVariations:{type:"object",required:!0}}},required:!0},events:{type:"array",items:{type:"object",properties:{key:{type:"string",required:!0},experimentIds:{type:"array",items:{type:"string",required:!0}},id:{type:"string",required:!0}}},required:!0},audiences:{type:"array",items:{type:"object",properties:{id:{type:"string",required:!0},name:{type:"string",required:!0},conditions:{type:"string",required:!0}}},required:!0},attributes:{type:"array",items:{type:"object",properties:{id:{type:"string",required:!0},key:{type:"string",required:!0}}},required:!0},version:{type:"string",required:!0},revision:{type:"string",required:!0},integrations:{type:"array",items:{type:"object",properties:{key:{type:"string",required:!0},host:{type:"string"},publicKey:{type:"string"},pixelUrl:{type:"string"}}}}}},yt={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://example.com/example.json",title:"ODP Response Schema",type:"object",required:["data"],properties:{data:{title:"The data Schema",type:"object",required:["customer"],properties:{customer:{title:"The customer Schema",type:"object",required:[],properties:{audiences:{title:"The audiences Schema",type:"object",required:["edges"],properties:{edges:{title:"The edges Schema",type:"array",items:{title:"A Schema",type:"object",required:["node"],properties:{node:{title:"The node Schema",type:"object",required:["name","state"],properties:{name:{title:"The name Schema",type:"string",examples:["has_email","has_email_opted_in"]}
1,state:{title:"The state Schema",type:"string",examples:["qualified"]}},examples:[]}},examples:[]},examples:[]}},examples:[]}},examples:[]}},examples:[]},errors:{title:"The errors Schema",type:"array",default:[],items:{title:"A Schema",type:"object",required:["message","locations","extensions"],properties:{message:{title:"The message Schema",type:"string",examples:["Exception while fetching data (/customer) : java.lang.RuntimeException: could not resolve _fs_user_id = asdsdaddddd"]},locations:{title:"The locations Schema",type:"array",items:{title:"A Schema",type:"object",required:["line","column"],properties:{line:{title:"The line Schema",type:"integer",examples:[2]},column:{title:"The column Schema",type:"integer",examples:[3]}},examples:[]},examples:[]},path:{title:"The path Schema",type:"array",items:{title:"A Schema",type:"string",examples:["customer"]},examples:[]},extensions:{title:"The extensions Schema",type:"object",required:["classification"],properties:{classification:{title:"The classification Schema",type:"string",examples:["InvalidIdentifierException"]}},examples:[]}},examples:[]},examples:[]}},examples:[]},bt=[],Et=function(){function e(e,t){this.toGraphQLJson=function(e,t,i){return h(h(['{"query" : "query {customer',"(".concat(e,' : \\"').concat(t,'\\") '),"{audiences","(subset: ["],(null==i?void 0:i.map((function(e,t){return'\\"'.concat(e,'\\"').concat(t<i.length-1?",":"")})))||"",!0),[']) {edges {node {name state}}}}}"}'],!1).join("")},this.requestHandler=e,this.logger=t}return e.prototype.fetchSegments=function(e,i,n,r,o){var s,a,l,c;return d(this,void 0,void 0,(function(){var u,d,h,p,v,g,m,_;return f(this,(function(f){switch(f.label){case 0:return e&&i?0===(null==o?void 0:o.length)?[2,bt]:(u="".concat(i,"/v3/graphql"),d=this.toGraphQLJson(n,r,o),[4,this.querySegments(e,u,n,r,d)]):(this.logger.log(t.LogLevel.ERROR,"".concat("Audience segments fetch failed"," (Parameters apiKey or apiHost invalid)")),[2,null]);case 1:return(h=f.sent())?(p=this.parseSegmentsResponseJson(h))?(null===(s=p.errors)||void 0===s?void 0:s.length)>0?(v=p.errors[0].extensions,g=v.code,m=v.classification,"INVALID_IDENTIFIER_EXCEPTION"==g?this.logger.log(t.LogLevel.ERROR,"".concat("Audience segments fetch failed"," (invalid identifier)")):this.logger.log(t.LogLevel.ERROR,"".concat("Audience segments fetch failed"," (").concat(m,")")),[2,null]):(_=null===(c=null===(l=null===(a=null==p?void 0:p.data)||void 0===a?void 0:a.customer)||void 0===l?void 0:l.audiences)||void 0===c?void 0:c.edges)?[2,_.filter((function(e){return"qualified"==e.node.state})).map((function(e){return e.node.name}))]:(this.logger.log(t.LogLevel.ERROR,"".concat("Audience segments fetch failed"," (decode error)")),[2,null]):(this.logger.log(t.LogLevel.ERROR,"".concat("Audience segments fetch failed"," (decode error)")),[2,null]):(this.logger.log(t.LogLevel.ERROR,"".concat("Audience segments fetch failed"," (network error)")),[2,null])}}))}))},e.prototype.querySegments=function(e,t,i,n,r){return d(this,void 0,void 0,(function(){var i,n,o,s;return f(this,(function(a){switch(a.label){case 0:i="POST",n=t,o={"Content-Type":"application/json","x-api-key":e},a.label=1;case 1:return a.trys.push([1,3,,4]),[4,this.requestHandler.makeRequest(n,o,i,r).responsePromise];case 2:return s=a.sent(),[3,4];case 3:return a.sent(),[2,null];case 4:return[2,s.body]}}))}))},e.prototype.parseSegmentsResponseJson=function(e){var t={};try{t=JSON.parse(e)}catch(e){return null}return function(e,t,i){void 0===t&&(t=_t),void 0===i&&(i=!0);var n="".concat("JSON_SCHEMA_VALIDATOR"," (").concat(t.title,")");if("object"!=typeof e||null===e)throw new Error(A(J.NO_JSON_PROVIDED,n));var r=o.validate(e,t);if(r.valid)return!0;if(!i)return!1;if(Array.isArray(r.errors))throw new Error(A(J.INVALID_DATAFILE,n,r.errors[0].property,r.errors[0].message));throw new Error(A(J.INVALID_JSON,n))}(t,yt,!1)?t:null},e}(),wt=function(e){function i(n){var r,o,s=n.logger,a=n.odpOptions,l=e.call(this)||this;return l.logger=s||U(),(null==a?void 0:a.disabled)?(l.initPromise=Promise.resolve(),l.enabled=!1,l.logger.log(t.LogLevel.INFO,X.ODP_DISABLED),l):(r=(null==a?void 0:a.segmentsRequestHandler)?a.segmentsRequestHandler:new nt(l.logger,(null==a?void 0:a.segmentsApiTimeout)||1e4),(null==a?void 0:a.segmentManager)?(l.segmentManager=a.segmentManager,l.segmentManager.updateSettings(l.odpConfig)):l.segmentManager=new mt(l.odpConfig,(null==a?void 0:a.segmentsCache)||new lt({maxSize:null==a?void 0:a.segmentsCacheSize,timeout:null==a?void 0:a.segmentsCacheTimeout}),new Et(r,l.logger)),o=(null==a?void 0:a.eventRequestHandler)?a.eventRequestHandler:new nt(l.logger,(null==a?void 0:a.eventApiTimeout)||1e4),(null==a?void 0:a.eventManager)?(l.eventManager=a.eventManager,l.eventManager.updateSettings(l.odpConfig)):l.eventManager=new gt({odpConfig:l.odpConfig,apiManager:new vt(o,l.logger),logger:l.logger,clientEngine:"javascript-sdk",clientVersion:"5.2.1",flushInterval:null==a?void 0:a.eventFlushInterval,batchSize:null==a?void 0:a.eventBatchSize,queueSize:null==a?void 0:a.eventQueueSize,userAgentParser:null==a?void 0:a.userAgentParser}),l.eventManager.start(),l.initPromise=l.initializeVuid(i.cache).catch((function(e){l.logger.log(l.enabled?t.LogLevel.ERROR:t.LogLevel.DEBUG,e)})),l)}return c(i,e),i.prototype.initializeVuid=function(e){return d(this,void 0,void 0,(function(){var t;return f(this,(function(i){switch(i.label){case 0:return[4,ct.instance(e)];case 1:return t=i.sent(),this.vuid=t.vuid,this.registerVuid(this.vuid),[2]}}))}))},i.prototype.registerVuid=function(e){if(this.eventManager)try{this.eventManager.registerVuid(e)}catch(e){this.logger.log(this.enabled?t.LogLevel.ERROR:t.LogLevel.DEBUG,J.ODP_VUID_REGISTRATION_FAILED)}else this.logger.log(t.LogLevel.ERROR,J.ODP_VUID_REGISTRATION_FAILED_EVENT_MANAGER_MISSING)},i.prototype.identifyUser=function(t,i){t&&ct.isVuid(t)?e.prototype.identifyUser.call(this,void 0,t):t&&i&&ct.isVuid(i)?e.prototype.identifyUser.call(this,t,i):e.prototype.identifyUser.call(this,t,i||this.vuid)},i.prototype.sendEvent=function(t){var i=t.type,n=t.action,r=t.identifiers,o=t.data,s=new Map(r);if(!r.has(G.VUID)){if(!this.vuid)throw new Error(J.ODP_SEND_EVENT_FAILED_VUID_MISSING);s.set(G.VUID,this.vuid)}e.prototype.sendEvent.call(this,{type:i,action:n,identifiers:s,data:o})},i.prototype.isVuidEnabled=function(){return!0},i.prototype.getVuid=function(){return this.vuid},i.cache=new ot,i}(pt);function It(e,t,i){return{variationKey:null,enabled:!1,variables:{},ruleKey:null,flagKey:e,userContext:t,reasons:i}}var Ot=function(){function e(e){var t,i=e.optimizely,n=e.userId,r=e.attributes,o=e.shouldIdentifyUser,s=void 0===o||o;this._qualifiedSegments=null,this.optimizely=i,this.userId=n,this.attributes=null!==(t=u({},r))&&void 0!==t?t:{},this.forcedDecisionsMap={},s&&this.identifyUser()}return e.prototype.identifyUser=function(){this.optimizely.identifyUser(this.userId)},e.prototype.setAttribute=function(e,t){this.attributes[e]=t},e.prototype.getUserId=function(){return this.userId},e.prototype.getAttributes=function(){return u({},this.attributes)},e.prototype.getOptimizely=function(){return this.optimizely},Object.defineProperty(e.prototype,"qualifiedSegments",{get:function(){return this._qualifiedSegments},set:function(e){this._qualifiedSegments=e}
1,enumerable:!1,configurable:!0}),e.prototype.decide=function(e,t){return void 0===t&&(t=[]),this.optimizely.decide(this.cloneUserContext(),e,t)},e.prototype.decideForKeys=function(e,t){return void 0===t&&(t=[]),this.optimizely.decideForKeys(this.cloneUserContext(),e,t)},e.prototype.decideAll=function(e){return void 0===e&&(e=[]),this.optimizely.decideAll(this.cloneUserContext(),e)},e.prototype.trackEvent=function(e,t){this.optimizely.track(e,this.userId,this.attributes,t)},e.prototype.setForcedDecision=function(e,t){var i,n=e.flagKey,r=null!==(i=e.ruleKey)&&void 0!==i?i:Z.FORCED_DECISION_NULL_RULE_KEY,o={variationKey:t.variationKey};return this.forcedDecisionsMap[n]||(this.forcedDecisionsMap[n]={}),this.forcedDecisionsMap[n][r]=o,!0},e.prototype.getForcedDecision=function(e){return this.findForcedDecision(e)},e.prototype.removeForcedDecision=function(e){var t,i=null!==(t=e.ruleKey)&&void 0!==t?t:Z.FORCED_DECISION_NULL_RULE_KEY,n=e.flagKey,r=!1;return this.forcedDecisionsMap.hasOwnProperty(n)&&(this.forcedDecisionsMap[n].hasOwnProperty(i)&&(delete this.forcedDecisionsMap[n][i],r=!0),0===Object.keys(this.forcedDecisionsMap[n]).length&&delete this.forcedDecisionsMap[n]),r},e.prototype.removeAllForcedDecisions=function(){return this.forcedDecisionsMap={},!0},e.prototype.findForcedDecision=function(e){var t,i=null!==(t=e.ruleKey)&&void 0!==t?t:Z.FORCED_DECISION_NULL_RULE_KEY,n=e.flagKey;if(this.forcedDecisionsMap.hasOwnProperty(e.flagKey)){var r=this.forcedDecisionsMap[n];if(r.hasOwnProperty(i))return{variationKey:r[i].variationKey}}return null},e.prototype.cloneUserContext=function(){var t=new e({shouldIdentifyUser:!1,optimizely:this.getOptimizely(),userId:this.getUserId(),attributes:this.getAttributes()});return Object.keys(this.forcedDecisionsMap).length>0&&(t.forcedDecisionsMap=u({},this.forcedDecisionsMap)),t._qualifiedSegments=this._qualifiedSegments,t},e.prototype.fetchQualifiedSegments=function(e){return d(this,void 0,void 0,(function(){var t;return f(this,(function(i){switch(i.label){case 0:return[4,this.optimizely.fetchQualifiedSegments(this.userId,e)];case 1:return t=i.sent(),this.qualifiedSegments=t,[2,null!==t]}}))}))},e.prototype.isQualifiedFor=function(e){return!!this._qualifiedSegments&&this._qualifiedSegments.indexOf(e)>-1},e}(),St=["and","or","not"];function At(e,t){if(Array.isArray(e)){var i=e[0],n=e.slice(1);switch("string"==typeof i&&-1===St.indexOf(i)&&(i="or",n=e),i){case"and":return function(e,t){var i=!1;if(Array.isArray(e)){for(var n=0;n<e.length;n++){var r=At(e[n],t);
1if(!1===r)return!1;null===r&&(i=!0)}return!i||null}return null}(n,t);case"not":return function(e,t){if(Array.isArray(e)&&e.length>0){var i=At(e[0],t);return null===i?null:!i}return null}(n,t);default:return function(e,t){var i=!1;if(Array.isArray(e)){for(var n=0;n<e.length;n++){var r=At(e[n],t);if(!0===r)return!0;null===r&&(i=!0)}return!!i&&null}return null}(n,t)}}return t(e)}var Ct=function(){function e(t,i,n){var r,o;this.sdkKey=null!==(r=t.sdkKey)&&void 0!==r?r:"",this.environmentKey=null!==(o=t.environmentKey)&&void 0!==o?o:"",this.attributes=t.attributes,this.audiences=e.getAudiences(t),this.events=t.events,this.revision=t.revision;var s=(t.featureFlags||[]).reduce((function(e,t){return e[t.id]=t.variables,e}),{}),a=e.getVariableIdMap(t),l=e.getExperimentsMap(t,s,a,n),c=l.experimentsMapById,u=l.experimentsMapByKey;this.experimentsMap=u,this.featuresMap=e.getFeaturesMap(t,s,c,a),this.datafile=i}return e.prototype.getDatafile=function(){return this.datafile},e.getAudiences=function(e){var t=[],i=[];return(e.typedAudiences||[]).forEach((function(e){t.push({id:e.id,conditions:JSON.stringify(e.conditions),name:e.name}),i.push(e.id)})),(e.audiences||[]).forEach((function(e){-1===i.indexOf(e.id)&&"$opt_dummy_audience"!=e.id&&t.push({id:e.id,conditions:JSON.stringify(e.conditions),name:e.name})})),t},e.getSerializedAudiences=function(t,i){var n="";if(t){var r="";t.forEach((function(t){var o="";if(t instanceof Array)o=e.getSerializedAudiences(t,i),o="(".concat(o,")");else if(St.indexOf(t)>-1)r=t.toUpperCase();else{var s=i[t]?i[t].name:t;n||"NOT"===r?(r=""===r?"OR":r,n=""===n?"".concat(r,' "').concat(i[t].name,'"'):n.concat(" ".concat(r,' "').concat(s,'"'))):n='"'.concat(s,'"')}""!==o&&(""!==n||"NOT"===r?(r=""===r?"OR":r,n=""===n?"".concat(r," ").concat(o):n.concat(" ".concat(r," ").concat(o))):n=n.concat(o))}))}return n},e.getExperimentAudiences=function(t,i){return t.audienceConditions?e.getSerializedAudiences(t.audienceConditions,i.audiencesById):""},e.mergeFeatureVariables=function(e,t,i,n,r){var o=(e[i]||[]).reduce((function(e,t){return e[t.key]={id:t.id,key:t.key,type:t.type,value:t.defaultValue},e}),{});return(n||[]).forEach((function(e){var i=t[e.id],n={id:e.id,key:i.key,type:i.type,value:r?e.value:i.defaultValue};o[i.key]=n})),o},e.getVariationsMap=function(t,i,n,r){return t.reduce((function(t,o){var s=e.mergeFeatureVariables(i,n,r,o.variables,o.featureEnabled);return t[o.key]={id:o.id,key:o.key,featureEnabled:o.featureEnabled,variablesMap:s},t}),{})},e.getVariableIdMap=function(e){return(e.featureFlags||[]).reduce((function(e,t){return t.variables.forEac
1h((function(t){e[t.id]=t})),e}),{})},e.getDeliveryRules=function(t,i,n,r,o){return r.map((function(r){return{id:r.id,key:r.key,audiences:e.getExperimentAudiences(r,t),variationsMap:e.getVariationsMap(r.variations,i,o,n)}}))},e.getRolloutExperimentIds=function(e){var t=[];return(e||[]).forEach((function(e){e.experiments.forEach((function(e){t.push(e.id)}))})),t},e.getExperimentsMap=function(t,i,n,r){var o=this.getRolloutExperimentIds(t.rollouts),s={},a={};return(t.experiments||[]).forEach((function(l){if(-1===o.indexOf(l.id)){var c=t.experimentFeatureMap[l.id],u="";c&&c.length>0&&(u=c[0]);var d=e.getVariationsMap(l.variations,i,n,u.toString()),f={id:l.id,key:l.key,audiences:e.getExperimentAudiences(l,t),variationsMap:d};s[l.id]=f,a[l.key]&&r&&r.warn("Duplicate experiment keys found in datafile: ".concat(l.key)),a[l.key]=f}})),{experimentsMapById:s,experimentsMapByKey:a}},e.getExperimentsKeyMap=function(e){var t={};for(var i in e){var n=e[i];t[n.key]=n}return t},e.getFeaturesMap=function(t,i,n,r){var o={};return t.featureFlags.forEach((function(s){var a={},l=[];s.experimentIds.forEach((function(e){var t=n[e];t&&(a[t.key]=t),l.push(n[e])}));var c=(s.variables||[]).reduce((function(e,t){return e[t.key]={id:t.id,key:t.key,type:t.type,value:t.defaultValue},e}),{}),u=[],d=t.rolloutIdMap[s.rolloutId];d&&(u=e.getDeliveryRules(t,i,s.id,d.experiments,r)),o[s.key]={id:s.id,key:s.key,experimentRules:l,deliveryRules:u,experimentsMap:a,variablesMap:c}})),o},e}(),$t=U();function Tt(e,t){return e instanceof Error?e.message:t||"Unknown error"}var Pt=function(){function e(e){this.updateListeners=[],this.configObj=null,this.optimizelyConfigObj=null,this.datafileManager=null;try{if(this.jsonSchemaValidator=e.jsonSchemaValidator,!e.datafile&&!e.sdkKey){var t=new Error(A(J.DATAFILE_AND_SDK_KEY_MISSING,"PROJECT_CONFIG_MANAGER"));return this.readyPromise=Promise.resolve({success:!1,reason:Tt(t)}),void $t.error(t)}var i=null;e.datafile&&(i=this.handleNewDatafile(e.datafile)),e.sdkKey&&e.datafileManager?(this.datafileManager=e.datafileManager,this.datafileManager.start(),this.readyPromise=this.datafileManager.onReady().then(this.onDatafileManagerReadyFulfill.bind(this),this.onDatafileManagerReadyReject.bind(this)),this.datafileManager.on("update",this.onDatafileManagerUpdate.bind(this))):this.configObj?this.readyPromise=Promise.resolve({success:!0}):this.readyPromise=Promise.resolve({success:!1,reason:Tt(i,"Invalid datafile")})}catch(e){$t.error(e),this.readyPromise=Promise.resolve({success:!1,reason:Tt(e,"Error in initialize")})}}return e.prototype.onDatafileManagerReadyFulfill=function(){if(this.datafileManager){var e=this.handleNewDatafile(this.datafileManager.get());return e?{success:!1,reason:Tt(e)}:{success:!0}}return{success:!1,reason:Tt(null,"Datafile manager is not provided")}},e.prototype.onDatafileManagerReadyReject=function(e){return{success:!1,reason:Tt(e,"Failed to become ready")}},e.prototype.onDatafileManagerUpdate=function(){this.datafileManager&&this.handleNewDatafile(this.datafileManager.get())},e.prototype.handleNewDatafile=function(e){var t=et({datafile:e,jsonSchemaValidator:this.jsonSchemaValidator,logger:$t}),i=t.configObj,n=t.error;if(n)$t.error(n);else{var r=this.configObj?this.configObj.revision:"null";i&&r!==i.revision&&(this.configObj=i,this.optimizelyConfigObj=null,this.updateListeners.forEach((function(e){return e(i)})))}return n},e.prototype.getConfig=function(){return this.configObj},e.prototype.getOptimizelyConfig=function(){return!this.optimizelyConfigObj&&this.configObj&&(this.optimizelyConfigObj=function(e,t,i){return new Ct(e,t,i)}(this.configObj,Qe(this.configObj),$t)),this.optimizelyConfigObj},e.prototype.onReady=function(){return this.readyPromise},e.prototype.onUpdate=function(e){var t=this;return this.updateListeners.push(e),function(){var i=t.updateListeners.indexOf(e);i>-1&&t.updateListeners.splice(i,1)}},e.prototype.stop=function(){this.datafileManager&&this.datafileManager.stop(),this.updateListeners=[]},e}(),kt=Math.pow(2,32),xt=function(e){var t=[],i=e.experimentIdMap[e.experimentId].groupId;if(i){var n=e.groupIdMap[i];
1if(!n)throw new Error(A(J.INVALID_GROUP_ID,"BUCKETER",i));if("random"===n.policy){var r=Rt(n,e.bucketingId,e.userId,e.logger);if(null===r)return e.logger.log(Y.INFO,X.USER_NOT_IN_ANY_EXPERIMENT,"BUCKETER",e.userId,i),t.push([X.USER_NOT_IN_ANY_EXPERIMENT,"BUCKETER",e.userId,i]),{result:null,reasons:t};if(r!==e.experimentId)return e.logger.log(Y.INFO,X.USER_NOT_BUCKETED_INTO_EXPERIMENT_IN_GROUP,"BUCKETER",e.userId,e.experimentKey,i),t.push([X.USER_NOT_BUCKETED_INTO_EXPERIMENT_IN_GROUP,"BUCKETER",e.userId,e.experimentKey,i]),{result:null,reasons:t};e.logger.log(Y.INFO,X.USER_BUCKETED_INTO_EXPERIMENT_IN_GROUP,"BUCKETER",e.userId,e.experimentKey,i),t.push([X.USER_BUCKETED_INTO_EXPERIMENT_IN_GROUP,"BUCKETER",e.userId,e.experimentKey,i])}}var o="".concat(e.bucketingId).concat(e.experimentId),s=Nt(o);e.logger.log(Y.DEBUG,X.USER_ASSIGNED_TO_EXPERIMENT_BUCKET,"BUCKETER",s,e.userId),t.push([X.USER_ASSIGNED_TO_EXPERIMENT_BUCKET,"BUCKETER",s,e.userId]);var a=Dt(s,e.trafficAllocationConfig);return null===a||e.variationIdMap[a]?{result:a,reasons:t}:(a&&(e.logger.log(Y.WARNING,X.INVALID_VARIATION_ID,"BUCKETER"),t.push([X.INVALID_VARIATION_ID,"BUCKETER"])),{result:null,reasons:t})},Rt=function(e,t,i,n){var r="".concat(t).concat(e.id),o=Nt(r);n.log(Y.DEBUG,X.USER_ASSIGNED_TO_EXPERIMENT_BUCKET,"BUCKETER",o,i);var s=e.trafficAllocation;return Dt(o,s)},Dt=function(e,t){for(var i=0;i<t.length;i++)if(e<t[i].endOfRange)return t[i].entityId;return null},Nt=function(e){try{var t=s.v3(e,1)/kt;return Math.floor(1e4*t)}catch(t){throw new Error(A(J.INVALID_BUCKETING_ID,"BUCKETER",e,t.message))}},Lt=U();function Mt(e){return/^\d+$/.test(e)}function Ut(e){var t=e.indexOf("-"),i=e.indexOf("+");return!(t<0)&&(i<0||t<i)}function Ft(e){var t=e.indexOf("-"),i=e.indexOf("+");return!(i<0)&&(t<0||i<t)}function jt(e){var t=e,i="";if(function(e){return/\s/.test(e)}(e))return Lt.warn(X.UNKNOWN_MATCH_TYPE,"SEMANTIC VERSION",e),null;if(Ut(e)?(t=e.substring(0,e.indexOf("-")),i=e.substring(e.indexOf("-")+1)):Ft(e)&&(t=e.substring(0,e.indexOf("+")),i=e.substring(e.indexOf("+")+1)),"string"!=typeof t||"string"!=typeof i)return null;var n=t.split(".").length-1;if(n>2)return Lt.warn(X.UNKNOWN_MATCH_TYPE,"SEMANTIC VERSION",e),null;var r=t.split(".");if(r.length!=n+1)return Lt.warn(X.UNKNOWN_MATCH_TYPE,"SEMANTIC VERSION",e),null;for(var o=0,s=r;o<s.length;o++)if(!Mt(s[o]))return Lt.warn(X.UNKNOWN_MATCH_TYPE,"SEMANTIC VERSION",e),null;return i&&r.push(i),r}var Vt="CUSTOM_ATTRIBUTE_CONDITION_EVALUATOR",Bt=U(),Gt=["exact","exists","gt","ge","lt","le","substring","semver_eq","semver_lt","semver_le","semver_gt","semver_ge"],qt={};function Ht(e){return"string"==typeof e||"boolean"==typeof e||T.isNumber(e)}function zt(e,t){var i=t.getAttributes(),n=e.value,r=typeof n,o=e.name,s=i[o],a=typeof s;return!Ht(n)||T.isNumber(n)&&!T.isSafeInteger(n)?(Bt.warn(X.UNEXPECTED_CONDITION_VALUE,Vt,JSON.stringify(e)),null):null===s?(Bt.debug(X.UNEXPECTED_TYPE_NULL,Vt,JSON.stringify(e),o),null):Ht(s)&&r===a?T.isNumber(s)&&!T.isSafeInteger(s)?(Bt.warn(X.OUT_OF_BOUNDS,Vt,JSON.stringify(e),o),null):n===s:(Bt.warn(X.UNEXPECTED_TYPE,Vt,JSON.stringify(e),a,o),null)}function Kt(e,t){var i=t.getAttributes(),n=e.name,r=i[n],o=typeof r,s=e.value;return null!==s&&T.isSafeInteger(s)?null===r?(Bt.debug(X.UNEXPECTED_TYPE_NULL,Vt,JSON.stringify(e),n),!1):T.isNumber(r)?!!T.isSafeInteger(r)||(Bt.warn(X.OUT_OF_BOUNDS,Vt,JSON.stringify(e),n),!1):(Bt.warn(X.UNEXPECTED_TYPE,Vt,JSON.stringify(e),o,n),!1):(Bt.warn(X.UNEXPECTED_CONDITION_VALUE,Vt,JSON.stringify(e)),!1)}function Wt(e,t){var i=t.getAttributes(),n=e.name,r=i[n],o=typeof r,s=e.value;return"string"!=typeof s?(Bt.warn(X.UNEXPECTED_CONDITION_VALUE,Vt,JSON.stringify(e)),null):null===r?(Bt.debug(X.UNEXPECTED_TYPE_NULL,Vt,JSON.stringify(e),n),null):"string"!=typeof r?(Bt.warn(X.UNEXPECTED_TYPE,Vt,JSON.stringify(e),o,n),null):function(e,t){var i=jt(t),n=jt(e);if(!i||!n)return null;for(var r=i.length,o=0;o<n.length;o++){if(r<=o)return Ut(e)||Ft(e)?1:-1;if(Mt(i[o])){var s=parseInt(i[o]),a=parseInt(n[o]);if(s>a)return 1;if(s<a)return-1}else{if(i[o]<n[o])return Ut(e)&&!Ut(t)?1:-1;if(i[o]>
1n[o])return!Ut(e)&&Ut(t)?-1:1}}return Ut(t)&&!Ut(e)?-1:0}(s,r)}qt.exact=zt,qt.exists=function(e,t){return null!=t.getAttributes()[e.name]},qt.gt=function(e,t){var i=t.getAttributes()[e.name],n=e.value;return Kt(e,t)&&null!==n?i>n:null},qt.ge=function(e,t){var i=t.getAttributes()[e.name],n=e.value;return Kt(e,t)&&null!==n?i>=n:null},qt.lt=function(e,t){var i=t.getAttributes()[e.name],n=e.value;return Kt(e,t)&&null!==n?i<n:null},qt.le=function(e,t){var i=t.getAttributes()[e.name],n=e.value;return Kt(e,t)&&null!==n?i<=n:null},qt.substring=function(e,t){var i=t.getAttributes(),n=e.name,r=i[e.name],o=typeof r,s=e.value;return"string"!=typeof s?(Bt.warn(X.UNEXPECTED_CONDITION_VALUE,Vt,JSON.stringify(e)),null):null===r?(Bt.debug(X.UNEXPECTED_TYPE_NULL,Vt,JSON.stringify(e),n),null):"string"!=typeof r?(Bt.warn(X.UNEXPECTED_TYPE,Vt,JSON.stringify(e),o,n),null):-1!==r.indexOf(s)},qt.semver_eq=function(e,t){var i=Wt(e,t);return null===i?null:0===i},qt.semver_gt=function(e,t){var i=Wt(e,t);return null===i?null:i>0},qt.semver_ge=function(e,t){var i=Wt(e,t);return null===i?null:i>=0},qt.semver_lt=function(e,t){var i=Wt(e,t);return null===i?null:i<0},qt.semver_le=function(e,t){var i=Wt(e,t);return null===i?null:i<=0};var Yt=Object.freeze({__proto__:null,evaluate:function(e,t){var i=t.getAttributes(),n=e.match;if(void 0!==n&&-1===Gt.indexOf(n))return Bt.warn(X.UNKNOWN_MATCH_TYPE,Vt,JSON.stringify(e)),null;var r=e.name;return i.hasOwnProperty(r)||"exists"==n?(n&&qt[n]||zt)(e,t):(Bt.debug(X.MISSING_ATTRIBUTE_VALUE,Vt,JSON.stringify(e),r),null)}}),Jt=U(),Xt=["qualified"],Zt={};function Qt(e,t){return t.isQualifiedFor(e.value)}Zt.qualified=Qt;var ei=Object.freeze({__proto__:null,evaluate:function(e,t){var i=e.match;return void 0!==i&&-1===Xt.indexOf(i)?(Jt.warn(X.UNKNOWN_MATCH_TYPE,"ODP_SEGMENT_CONDITION_EVALUATOR",JSON.stringify(e)),null):(i&&Zt[i]||Qt)(e,t)}}),ti=U(),ii=function(){function e(e){this.typeToEvaluatorMap=T.assign({},e,{custom_attribute:Yt,third_party_dimension:ei})}return e.prototype.evaluate=function(e,t,i){var n=this;return!e||0===e.length||!!At(e,(function(e){var r=t[e];if(r){ti.log(Y.DEBUG,X.EVALUATING_AUDIENCE,"AUDIENCE_EVALUATOR",e,JSON.stringify(r.conditions));var o=At(r.conditions,n.evaluateConditionWithUserAttributes.bind(n,i)),s=null===o?"UNKNOWN":o.toString().toUpperCase();return ti.log(Y.DEBUG,X.AUDIENCE_EVALUATION_RESULT,"AUDIENCE_EVALUATOR",e,s),o}return null}))},e.prototype.evaluateConditionWithUserAttributes=function(e,t){var i=this.typeToEvaluatorMap[t.type];if(!i)return ti.log(Y.WARNING,X.UNKNOWN_CONDITION_TYPE,"AUDIENCE_EVALUATOR",JSON.stringify(t)),null;try{return i.evaluate(t,e)}catch(e){ti.log(Y.ERROR,J.CONDITION_EVALUATOR_ERROR,"AUDIENCE_EVALUATOR",t.type,e.message)}return null},e}();function ni(e){return"string"==typeof e&&""!==e}var ri="DECISION_SERVICE",oi=function(){function e(e){var t;this.audienceEvaluator=(t=e.UNSTABLE_conditionEvaluators,new ii(t)),this.forcedVariationMap={},this.logger=e.logger,this.userProfileService=e.userProfileService||null}return e.prototype.getVariation=function(e,i,n,r){void 0===r&&(r={});var o=n.getUserId(),s=n.getAttributes(),a=this.getBucketingId(o,s),l=[],c=i.key;if(!this.checkIfExperimentIsActive(e,c))return this.logger.log(Y.INFO,X.EXPERIMENT_NOT_RUNNING,ri,c),l.push([X.EXPERIMENT_NOT_RUNNING,ri,c]),{result:null,reasons:l};var u=this.getForcedVariation(e,c,o);l.push.apply(l,u.reasons);var d=u.result;if(d)return{result:d,reasons:l};var f=this.getWhitelistedVariation(i,o);l.push.apply(l,f.reasons);var h=f.result;if(h)return{result:h.key,reasons:l};var p=r[t.OptimizelyDecideOption.IGNORE_USER_PROFILE_SERVICE],v=this.resolveExperimentBucketMap(o,s);if(!p&&(h=this.getStoredVariation(e,i,o,v)))return this.logger.log(Y.INFO,X.RETURNING_STORED_VARIATION,ri,h.key,c,o),l.push([X.RETURNING_STORED_VARIATION,ri,h.key,c,o]),{result:h.key,reasons:l};var g=this.checkIfUserIsInAudience(e,i,te.EXPERIMENT,n,"");if(l.push.apply(l,g.reasons),!g.result)return this.logger.log(Y.INFO,X.USER_NOT_IN_EXPERIMENT,ri,o,c),l.push([X.USER_NOT_IN_EXPERIMENT,ri,o,c]),{result:null,reasons:l};var m=this.buildBucketerParams(e,i,a,o),_=xt(m);l.push.apply(l,_.reasons);var y=_.result;return y&&(h=e.variationIdMap[y]),h?(this.logger.log(Y.INFO,X.USER_HAS_VARIATION,ri,o,h.key,c),l.push([X.USER_HAS_VARIATION,ri,o,h.key,c]),p||this.saveUserProfile(i,h,o,v),{result:h.key,reasons:l}):(this.logger.log(Y.DEBUG,X.USER_HAS_NO_VARIATION,ri,o,c),l.push([X.USER_HAS_NO_VARIATION,ri,o,c]),{result:null,reasons:l})},e.prototype.resolveExperimentBucketMap=function(e,t){t=t||{};var i=this.getUserProfile(e)||{},n=t[Z.STICKY_BUCKETING_KEY];return T.assign({},i.experiment_bucket_map,n)},e.prototype.checkIfExperimentIsActive=function(e,t){return function(e,t){return"Running"===ze(e,t)}(e,t)},e.prototype.getWhitelistedVariation=function(e,t){var i=[];if(e.forcedVariations&&e.forcedVariations.hasOwnProperty(t)){var n=e.forcedVariations[t];return e.variationKeyMap.hasOwnProperty(n)?(this.logger.log(Y.INFO,X.USER_FORCED_IN_VARIATION,ri,t,n),i.push([X.USER_FORCED_IN_VARIATION,ri,t,n]),{result:e.variationKeyMap[n],reasons:i}):(this.logger.log(Y.ERROR,X.FORCED_BUCKETING_FAILED,ri,n,t),i.push([X.FORCED_BUCKETING_FAILED,ri,n,t]),{result:null,reasons:i})}return{result:null,reasons:i}},e.prototype.checkIfUserIsInAudience=function(e,t,i,n,r){var o=[],s=function(e,t){var i=e.experimentIdMap[t];if(!i)throw new Error(A(J.INVALID_EXPERIMENT_ID,Fe,t));return i.audienceConditions||i.audienceIds}(e,t.id),a=e.audiencesById;this.logger.log(Y.DEBUG,X.EVALUATING_AUDIENCES_COMBINED,ri,i,r||t.key,JSON.stringify(s)),o.push([X.EVALUATING_AUDIENCES_COMBINED,ri,i,r||t.key,JSON.stringify(s)]);var l=this.audienceEvaluator.evaluate(s,a,n);return this.logger.log(Y.INFO,X.AUDIENCE_EVALUATION_RESULT_COMBINED,ri,i,r||t.key,l.toString().toUpperCase()),o.push([X.AUDIENCE_EVALUATION_RESULT_COMBINED,ri,i,r||t.key,l.toString().toUpperCase()]),{result:l,reasons:o}},e.prototype.buildBucketerParams=function(e,t,i,n){return{bucketingId:i,experimentId:t.id,experimentKey:t.key,experimentIdMap:e.experimentIdMap,experimentKeyMap:e.experimentKeyMap,groupIdMap:e.groupIdMap,logger:this.logger,trafficAllocationConfig:Ye
1(e,t.id),userId:n,variationIdMap:e.variationIdMap}},e.prototype.getStoredVariation=function(e,t,i,n){if(n.hasOwnProperty(t.id)){var r=n[t.id],o=r.variation_id;if(e.variationIdMap.hasOwnProperty(o))return e.variationIdMap[r.variation_id];this.logger.log(Y.INFO,X.SAVED_VARIATION_NOT_FOUND,ri,i,o,t.key)}return null},e.prototype.getUserProfile=function(e){var t={user_id:e,experiment_bucket_map:{}};if(!this.userProfileService)return t;try{return this.userProfileService.lookup(e)}catch(t){this.logger.log(Y.ERROR,J.USER_PROFILE_LOOKUP_ERROR,ri,e,t.message)}return null},e.prototype.saveUserProfile=function(e,t,i,n){if(this.userProfileService)try{n[e.id]={variation_id:t.id},this.userProfileService.save({user_id:i,experiment_bucket_map:n}),this.logger.log(Y.INFO,X.SAVED_VARIATION,ri,t.key,e.key,i)}catch(e){this.logger.log(Y.ERROR,J.USER_PROFILE_SAVE_ERROR,ri,i,e.message)}},e.prototype.getVariationForFeature=function(e,t,i,n){void 0===n&&(n={});var r=[],o=this.getVariationForFeatureExperiment(e,t,i,n);r.push.apply(r,o.reasons);var s=o.result;if(null!==s.variation)return{result:s,reasons:r};var a=this.getVariationForRollout(e,t,i);r.push.apply(r,a.reasons);var l=a.result,c=i.getUserId();return l.variation?(this.logger.log(Y.DEBUG,X.USER_IN_ROLLOUT,ri,c,t.key),r.push([X.USER_IN_ROLLOUT,ri,c,t.key]),{result:l,reasons:r}):(this.logger.log(Y.DEBUG,X.USER_NOT_IN_ROLLOUT,ri,c,t.key),r.push([X.USER_NOT_IN_ROLLOUT,ri,c,t.key]),{result:l,reasons:r})},e.prototype.getVariationForFeatureExperiment=function(e,t,i,n){void 0===n&&(n={});var r,o,s=[],a=null;if(t.experimentIds.length>0)for(o=0;o<t.experimentIds.length;o++){var l=Je(e,t.experimentIds[o],this.logger);
1if(l&&(r=this.getVariationFromExperimentRule(e,t.key,l,i,n),s.push.apply(s,r.reasons),a=r.result)){var c=null;return(c=l.variationKeyMap[a])||(c=Xe(e,t.key,a)),{result:{experiment:l,variation:c,decisionSource:ee.FEATURE_TEST},reasons:s}}}else this.logger.log(Y.DEBUG,X.FEATURE_HAS_NO_EXPERIMENTS,ri,t.key),s.push([X.FEATURE_HAS_NO_EXPERIMENTS,ri,t.key]);return{result:{experiment:null,variation:null,decisionSource:ee.FEATURE_TEST},reasons:s}},e.prototype.getVariationForRollout=function(e,t,i){var n=[];if(!t.rolloutId)return this.logger.log(Y.DEBUG,X.NO_ROLLOUT_EXISTS,ri,t.key),n.push([X.NO_ROLLOUT_EXISTS,ri,t.key]),{result:{experiment:null,variation:null,decisionSource:ee.ROLLOUT},reasons:n};var r=e.rolloutIdMap[t.rolloutId];if(!r)return this.logger.log(Y.ERROR,J.INVALID_ROLLOUT_ID,ri,t.rolloutId,t.key),n.push([J.INVALID_ROLLOUT_ID,ri,t.rolloutId,t.key]),{result:{experiment:null,variation:null,decisionSource:ee.ROLLOUT},reasons:n};var o,s,a,l=r.experiments;if(0===l.length)return this.logger.log(Y.ERROR,X.ROLLOUT_HAS_NO_EXPERIMENTS,ri,t.rolloutId),n.push([X.ROLLOUT_HAS_NO_EXPERIMENTS,ri,t.rolloutId]),{result:{experiment:null,variation:null,decisionSource:ee.ROLLOUT},reasons:n};for(var c=0;c<l.length;){if(o=this.getVariationFromDeliveryRule(e,t.key,l,c,i),n.push.apply(n,o.reasons),a=o.result,s=o.skipToEveryoneElse,a)return{result:{experiment:e.experimentIdMap[l[c].id],variation:a,decisionSource:ee.ROLLOUT},reasons:n};c=s?l.length-1:c+1}return{result:{experiment:null,variation:null,decisionSource:ee.ROLLOUT},reasons:n}},e.prototype.getBucketingId=function(e,t){var i=e;return null!=t&&"object"==typeof t&&t.hasOwnProperty(Z.BUCKETING_ID)&&("string"==typeof t[Z.BUCKETING_ID]?(i=String(t[Z.BUCKETING_ID]),this.logger.log(Y.DEBUG,X.VALID_BUCKETING_ID,ri,i)):this.logger.log(Y.WARNING,X.BUCKETING_ID_NOT_STRING,ri)),i},e.prototype.findValidatedForcedDecision=function(e,t,i,n){var r,o=[],s=t.getForcedDecision({flagKey:i,ruleKey:n}),a=null,l=t.getUserId();return e&&s&&(r=s.variationKey,(a=Xe(e,i,r))?n?(this.logger.log(Y.INFO,X.USER_HAS_FORCED_DECISION_WITH_RULE_SPECIFIED,r,i,n,l),o.push([X.USER_HAS_FORCED_DECISION_WITH_RULE_SPECIFIED,r,i,n,l])):(this.logger.log(Y.INFO,X.USER_HAS_FORCED_DECISION_WITH_NO_RULE_SPECIFIED,r,i,l),o.push([X.USER_HAS_FORCED_DECISION_WITH_NO_RULE_SPECIFIED,r,i,l])):n?(this.logger.log(Y.INFO,X.USER_HAS_FORCED_DECISION_WITH_RULE_SPECIFIED_BUT_INVALID,i,n,l),o.push([X.USER_HAS_FORCED_DECISION_WITH_RULE_SPECIFIED_BUT_INVALID,i,n,l])):(this.logger.log(Y.INFO,X.USER_HAS_FORCED_DECISION_WITH_NO_RULE_SPECIFIED_BUT_INVALID,i,l),o.push([X.USER_HAS_FORCED_DECISION_WITH_NO_RULE_SPECIFIED_BUT_INVALID,i,l]))),{result:a,reasons:o}},e.prototype.removeForcedVariation=function(e,t,i){if(!e)throw new Error(A(J.INVALID_USER_ID,ri));if(!this.forcedVariationMap.hasOwnProperty(e))throw new Error(A(J.USER_NOT_IN_FORCED_VARIATION,ri,e));delete this.forcedVariationMap[e][t],this.logger.log(Y.DEBUG,X.VARIATION_REMOVED_FOR_USER,ri,i,e)},e.prototype.setInForcedVariationMap=function(e,t,i){this.forcedVariationMap.hasOwnProperty(e)||(this.forcedVariationMap[e]={}),this.forcedVariationMap[e][t]=i,this.logger.log(Y.DEBUG,X.USER_MAPPED_TO_FORCED_VARIATION,ri,i,t,e)},e.prototype.getForcedVariation=function(e,t,i){var n,r=[],o=this.forcedVariationMap[i];if(!o)return this.logger.log(Y.DEBUG,X.USER_HAS_NO_FORCED_VARIATION,ri,i),{result:null,reasons:r};try{var s=We(e,t);if(!s.hasOwnProperty("id"))return this.logger.log(Y.ERROR,J.IMPROPERLY_FORMATTED_EXPERIMENT,ri,t),r.push([J.IMPROPERLY_FORMATTED_EXPERIMENT,ri,t]),{result:null,reasons:r};n=s.id}catch(e){return this.logger.log(Y.ERROR,e.message),r.push(e.message),{result:null,reasons:r}}var a=o[n];if(!a)return this.logger.log(Y.DEBUG,X.USER_HAS_NO_FORCED_VARIATION_FOR_EXPERIMENT,ri,t,i),{result:null,reasons:r};var l=Ke(e,a);return l?(this.logger.log(Y.DEBUG,X.USER_HAS_FORCED_VARIATION,ri,l,t,i),r.push([X.USER_HAS_FORCED_VARIATION,ri,l,t,i])):this.logger.log(Y.DEBUG,X.USER_HAS_NO_FORCED_VARIATION_FOR_EXPERIMENT,ri,t,i),{result:l,reasons:r}},e.prototype.setForcedVariation=function(e,t,i,n){if(null!=n&&!ni(n))return this.logger.log(Y.ERROR,J.INVALID_VARIATION_KEY,ri),!1;var r;try{var o=We(e,t);if(!o.hasOwnProperty("id"))return this.logger.log(Y.ERROR,J.IMPROPERLY_FORMATTED_EXPERIMENT,ri,t),!1;r=o.id}catch(e){return this.logger.log(Y.ERROR,e.message),!1}if(null==n)try{return this.removeForcedVariation(i,r,t),!0}catch(e){return this.logger.log(Y.ERROR,e.message),!1}var s=function(e,t,i){var n=e.experimentKeyMap[t];return n.variationKeyMap.hasOwnProperty(i)?n.variationKeyMap[i].id:null}(e,t,n);if(!s)return this.logger.log(Y.ERROR,J.NO_VARIATION_FOR_EXPERIMENT_KEY,ri,n,t),!1;try{return this.setInForcedVariationMap(i,r,s),!0}catch(e){return this.logger.log(Y.ERROR,e.message),!1}},e.prototype.getVariationFromExperimentRule=function(e,t,i,n,r){void 0===r&&(r={});var o=[],s=this.findValidatedForcedDecision(e,n,t,i.key);o.push.apply(o,s.reasons);var a=s.result;if(a)return{result:a.key,reasons:o};var l=this.getVariation(e,i,n,r);return o.push.apply(o,l.reasons),{result:l.result,reasons:o}},e.prototype.getVariationFromDeliveryRule=function(e,t,i,n,r){var o=[],s=!1,a=i[n],l=this.findValidatedForcedDecision(e,r,t,a.key);o.push.apply(o,l.reasons);var c=l.result;if(c)return{result:c,reasons:o,skipToEveryoneElse:s};var u,d,f,h,p,v=r.getUserId(),g=r.getAttributes(),m=this.getBucketingId(v,g),_=n===i.length-1,y=_?"Everyone Else":n+1,b=null,E=this.checkIfUserIsInAudience(e,a,te.RULE,r,y);return o.push.apply(o,E.reasons),E.result?(this.logger.log(Y.DEBUG,X.USER_MEETS_CONDITIONS_FOR_TARGETING_RULE,ri,v,y),o.push([X.USER_MEETS_CONDITIONS_FOR_TARGETING_RULE,ri,v,y]),d=this.buildBucketerParams(e,a,m,v),f=xt(d),o.push.apply(o,f.reasons),(u=f.result)&&(p=u,b=(h=e).variationIdMap.hasOwnProperty(p)?h.variationIdMap[p]:null),b?(this.logger.log(Y.DEBUG,X.USER_BUCKET
1ED_INTO_TARGETING_RULE,ri,v,y),o.push([X.USER_BUCKETED_INTO_TARGETING_RULE,ri,v,y])):_||(this.logger.log(Y.DEBUG,X.USER_NOT_BUCKETED_INTO_TARGETING_RULE,ri,v,y),o.push([X.USER_NOT_BUCKETED_INTO_TARGETING_RULE,ri,v,y]),s=!0)):(this.logger.log(Y.DEBUG,X.USER_DOESNT_MEET_CONDITIONS_FOR_TARGETING_RULE,ri,v,y),o.push([X.USER_DOESNT_MEET_CONDITIONS_FOR_TARGETING_RULE,ri,v,y])),{result:b,reasons:o,skipToEveryoneElse:s}},e}();function si(e,t){var i=e.revenue;if(null==i)return null;var n="string"==typeof i?parseInt(i):i;return isFinite(n)?(t.log(Y.INFO,X.PARSED_REVENUE_VALUE,"EVENT_TAG_UTILS",n),n):(t.log(Y.INFO,X.FAILED_TO_PARSE_REVENUE,"EVENT_TAG_UTILS",i),null)}function ai(e,t){var i=e.value;if(null==i)return null;var n="string"==typeof i?parseFloat(i):i;return isFinite(n)?(t.log(Y.INFO,X.PARSED_NUMERIC_VALUE,"EVENT_TAG_UTILS",n),n):(t.log(Y.INFO,X.FAILED_TO_PARSE_VALUE,"EVENT_TAG_UTILS",i),null)}function li(e,t){return"string"==typeof e&&("string"==typeof t||"boolean"==typeof t||T.isNumber(t)&&T.isSafeInteger(t))}var ci="https://logx.optimizely.com/v1/events";function ui(e){var t=e.attributes,i=e.userId,n=e.clientEngine,r=e.clientVersion,o=e.configObj,s=e.logger,a=!!o.anonymizeIP&&o.anonymizeIP,l=o.botFiltering,c={snapshots:[],visitor_id:i,attributes:[]},u={account_id:o.accountId,project_id:o.projectId,visitors:[c],revision:o.revision,client_name:n,client_version:r,anonymize_ip:a,enrich_decisions:!0};return t&&Object.keys(t||{}).forEach((function(e){var i=t[e];if(li(e,i)){var n=qe(o,e,s);n&&u.visitors[0].attributes.push({entity_id:n,key:e,type:"custom",value:i})}})),"boolean"==typeof l&&u.visitors[0].attributes.push({entity_id:Z.BOT_FILTERING,key:Z.BOT_FILTERING,type:"custom",value:l}),u}function di(e){var t,i;return null!==(i=null===(t=e.experiment)||void 0===t?void 0:t.key)&&void 0!==i?i:""}function fi(e){var t,i;return null!==(i=null===(t=e.variation)||void 0===t?void 0:t.key)&&void 0!==i?i:""}function hi(e){var t,i;return null!==(i=null===(t=e.variation)||void 0===t?void 0:t.featureEnabled)&&void 0!==i&&i}function pi(e){var t,i;return null!==(i=null===(t=e.experiment)||void 0===t?void 0:t.id)&&void 0!==i?i:null}function vi(e){var t,i;return null!==(i=null===(t=e.variation)||void 0===t?void 0:t.id)&&void 0!==i?i:null}var gi=U("EVENT_BUILDER");function mi(e,t){var i=[];return t&&Object.keys(t||{}).forEach((function(n){var r=t[n];if(li(n,r)){var o=qe(e,n,gi);o&&i.push({entityId:o,key:n,value:r})}})),i}var _i="USER_PROFILE_SERVICE_VALIDATOR",yi=function(){function e(e){var i,n,r=this,o=e.clientEngine;o||(e.logger.log(Y.INFO,X.INVALID_CLIENT_ENGINE,"OPTIMIZELY",o),o="node-sdk"),this.clientEngine=o,this.clientVersion=e.clientVersion||"5.2.1",this.errorHandler=e.errorHandler,this.isOptimizelyConfigValid=e.isValidInstance,this.logger=e.logger;var s=null!==(i=e.defaultDecideOptions)&&void 0!==i?i:[];Array.isArray(s)||(this.logger.log(Y.DEBUG,X.INVALID_DEFAULT_DECIDE_OPTIONS,"OPTIMIZELY"),s=[]);var a={};s.forEach((function(e){t.OptimizelyDecideOption[e]?a[e]=!0:r.logger.log(Y.WARNING,X.UNRECOGNIZED_DECIDE_OPTION,"OPTIMIZELY",e)})),this.defaultDecideOptions=a,this.projectConfigManager=function(e){return new Pt(e)}({datafile:e.datafile,jsonSchemaValidator:e.jsonSchemaValidator,sdkKey:e.sdkKey,datafileManager:e.datafileManager}),this.disposeOnUpdate=this.projectConfigManager.onUpdate((function(t){var i;r.logger.log(Y.INFO,X.UPDATED_OPTIMIZELY_CONFIG,"OPTIMIZELY",t.revision,t.projectId),r.notificationCenter.sendNotifications(B.OPTIMIZELY_CONFIG_UPDATE),null===(i=De.getNotificationCenter(e.sdkKey))||void 0===i||i.sendNotifications(B.OPTIMIZELY_CONFIG_UPDATE),r.updateOdpSettings()}));var l,c=this.projectConfigManager.onReady(),u=null;if(e.userProfileService)try{(function(e){if("object"==typeof e&&null!==e){if("function"!=typeof e.lookup)throw new Error(A(J.INVALID_USER_PROFILE_SERVICE,_i,"Missing function 'lookup'"));if("function"!=typeof e.save)throw new Error(A(J.INVALID_USER_PROFILE_SERVICE,_i,"Missing function 'save'"));return!0}throw new Error(A(J.INVALID_USER_PROFILE_SERVICE,_i))})(e.userProfileService)&&(u=e.userProfileService,this.logger.log(Y.INFO,X.VALID_USER_PROFILE_SERVICE,"OPTIMIZELY"))}catch(e){this.logger.log(Y.WARNING,e.message)}this.decisionService=(l={userProfileService:u,logger:this.logger,UNSTABLE_conditionEvaluators:e.UNSTABLE_conditionEvaluators},new oi(l)),this.notificationCenter=e.notificationCenter,this.eventProcessor=e.eventProcessor;var d=[c,this.eventProcessor.start()];(null===(n=e.odpManager)||void 0===n?void 0:n.initPromise)&&d.push(e.odpManager.initPromise),this.readyPromise=Promise.all(d).then((function(t){var i,n,o;if(null!=e.odpManager){r.odpManager=e.odpManager,null===(i=r.odpManager.eventManager)||void 0===i||i.start(),r.updateOd
1pSettings();var s=null===(n=r.projectConfigManager.getConfig())||void 0===n?void 0:n.sdkKey;null!=s?null===(o=De.getNotificationCenter(s,r.logger))||void 0===o||o.addNotificationListener(B.OPTIMIZELY_CONFIG_UPDATE,(function(){return r.updateOdpSettings()})):r.logger.log(Y.ERROR,J.ODP_SDK_KEY_MISSING_NOTIFICATION_CENTER_FAILURE)}return t[0]})),this.readyTimeouts={},this.nextReadyTimeoutId=0}return e.prototype.isValidInstance=function(){return this.isOptimizelyConfigValid&&!!this.projectConfigManager.getConfig()},e.prototype.activate=function(e,t,i){try{if(!this.isValidInstance())return this.logger.log(Y.ERROR,X.INVALID_OBJECT,"OPTIMIZELY","activate"),null;if(!this.validateInputs({experiment_key:e,user_id:t},i))return this.notActivatingExperiment(e,t);var n=this.projectConfigManager.getConfig();if(!n)return null;try{var r=this.getVariation(e,t,i);if(null===r)return this.notActivatingExperiment(e,t);if(!function(e,t){return"Running"===ze(e,t)}(n,e))return this.logger.log(Y.DEBUG,X.SHOULD_NOT_DISPATCH_ACTIVATE,"OPTIMIZELY",e),r;var o=We(n,e),s={experiment:o,variation:o.variationKeyMap[r],decisionSource:ee.EXPERIMENT};return this.sendImpressionEvent(s,"",t,!0,i),r}catch(i){return this.logger.log(Y.ERROR,i.message),this.logger.log(Y.INFO,X.NOT_ACTIVATING_USER,"OPTIMIZELY",t,e),this.errorHandler.handleError(i),null}}catch(e){return this.logger.log(Y.ERROR,e.message),this.errorHandler.handleError(e),null}},e.prototype.sendImpressionEvent=function(e,t,i,n,r){var o=this.projectConfigManager.getConfig();if(o){var s=function(e){var t=e.configObj,i=e.decisionObj,n=e.userId,r=e.flagKey,o=e.enabled,s=e.userAttributes,a=e.clientEngine,l=e.clientVersion,c=i.decisionSource,u=di(i),d=pi(i),f=fi(i),h=vi(i),p=null!==d?Ge(t,d):null;return{type:"impression",timestamp:T.currentTimestamp(),uuid:T.uuid(),user:{id:n,attributes:mi(t,s)},context:{accountId:t.accountId,projectId:t.projectId,revision:t.revision,clientName:a,clientVersion:l,anonymizeIP:t.anonymizeIP||!1,botFiltering:t.botFiltering},layer:{id:p},experiment:{id:d,key:u},variation:{id:h,key:f},ruleKey:u,flagKey:r,ruleType:c,enabled:o}}({decisionObj:e,flagKey:t,enabled:n,userId:i,userAttributes:r,clientEngine:this.clientEngine,clientVersion:this.clientVersion,configObj:o});this.eventProcessor.process(s),this.emitNotificationCenterActivate(e,t,i,n,r)}},e.prototype.emitNotificationCenterActivate=function(e,t,i,n,r){var o=this.projectConfigManager.getConfig();if(o){var s,a=e.decisionSource,l=di(e),c=pi(e),u=fi(e),d=vi(e);null!==c&&""!==u&&(s=o.experimentIdMap[c]);var f,h=function(e){var t,i,n,r,o,s,a,l,c=ui(e),u=(t=e.configObj,i=e.experimentId,n=e.variationId,r=e.ruleKey,o=e.ruleType,s=e.flagKey,a=e.enabled,{decisions:[{campaign_id:l=i?Ge(t,i):null,experiment_id:i,variation_id:n,metadata:{flag_key:s,rule_key:r,rule_type:o,variation_key:(n?Ke(t,n):null)||"",enabled:a}}],events:[{entity_id:l,timestamp:T.currentTimestamp(),key:"campaign_activated",uuid:T.uuid()}]});return c.visitors[0].snapshots.push(u),{httpVerb:"POST",url:ci,params:c}}({attributes:r,clientEngine:this.clientEngine,clientVersion:this.clientVersion,configObj:o,experimentId:c,ruleKey:l,flagKey:t,ruleType:a,userId:i,enabled:n,variationId:d,logger:this.logger});s&&s.variationKeyMap&&""!==u&&(f=s.variationKeyMap[u]),this.notificationCenter.sendNotifications(B.ACTIVATE,{experiment:s,userId:i,attributes:r,variation:f,logEvent:h})}},e.prototype.track=function(e,t,i,n){try{if(!this.isValidInstance())return void this.logger.log(Y.ERROR,X.INVALID_OBJECT,"OPTIMIZELY","track");if(!this.validateInputs({user_id:t,event_key:e},i,n))return;var r=this.projectConfigManager.getConfig();if(!r)return;if(!function(e,t){return e.eventKeyMap.hasOwnProperty(t)}(r,e))return this.logger.log(Y.WARNING,X.EVENT_KEY_NOT_FOUND,"OPTIMIZELY",e),void this.logger.log(Y.WARNING,X.NOT_TRACKING_USER,"OPTIMIZELY",t);var o=function(e){var t=e.configObj,i=e.userId,n=e.userAttributes,r=e.clientEngine,o=e.clientVersion,s=e.eventKey,a=e.eventTags,l=He(t,s),c=a?si(a,gi):null,u=a?ai(a,gi):null;return{type:"conversion",timestamp:T.currentTimestamp(),uuid:T.uuid(),user:{id:i,attributes:mi(t,n)},context:{accountId:t.accountId,projectId:t.projectId,revision:t.revision,clientName:r,clientVersion:o,anonymizeIP:t.anonymizeIP||!1,botFiltering:t.botFiltering},event:{id:l,key:s},revenue:c,value:u,tags:a}}
1({eventKey:e,eventTags:n=this.filterEmptyValues(n),userId:t,userAttributes:i,clientEngine:this.clientEngine,clientVersion:this.clientVersion,configObj:r});this.logger.log(Y.INFO,X.TRACK_EVENT,"OPTIMIZELY",e,t),this.eventProcessor.process(o),this.emitNotificationCenterTrack(e,t,i,n)}catch(e){this.logger.log(Y.ERROR,e.message),this.errorHandler.handleError(e),this.logger.log(Y.ERROR,X.NOT_TRACKING_USER,"OPTIMIZELY",t)}},e.prototype.emitNotificationCenterTrack=function(e,t,i,n){try{var r=this.projectConfigManager.getConfig();if(!r)return;var o=function(e){var t=ui(e),i=function(e,t,i,n){var r={events:[]},o={entity_id:He(e,t),timestamp:T.currentTimestamp(),uuid:T.uuid(),key:t};if(n){var s=si(n,i);null!==s&&(o.revenue=s);var a=ai(n,i);null!==a&&(o.value=a),o.tags=n}return r.events.push(o),r}(e.configObj,e.eventKey,e.logger,e.eventTags);return t.visitors[0].snapshots=[i],{httpVerb:"POST",url:ci,params:t}}({attributes:i,clientEngine:this.clientEngine,clientVersion:this.clientVersion,configObj:r,eventKey:e,eventTags:n,logger:this.logger,userId:t});this.notificationCenter.sendNotifications(B.TRACK,{eventKey:e,userId:t,attributes:i,eventTags:n,logEvent:o})}catch(e){this.logger.log(Y.ERROR,e.message),this.errorHandler.handleError(e)}},e.prototype.getVariation=function(e,t,i){try{if(!this.isValidInstance())return this.logger.log(Y.ERROR,X.INVALID_OBJECT,"OPTIMIZELY","getVariation"),null;try{if(!this.validateInputs({experiment_key:e,user_id:t},i))return null;var n=this.projectConfigManager.getConfig();if(!n)return null;var r=n.experimentKeyMap[e];if(!r)return this.logger.log(Y.DEBUG,J.INVALID_EXPERIMENT_KEY,"OPTIMIZELY",e),null;var o=this.decisionService.getVariation(n,r,this.createInternalUserContext(t,i)).result,s=(a=n,l=r.id,a.experimentFeatureMap.hasOwnProperty(l)?Q.FEATURE_TEST:Q.AB_TEST);return this.notificationCenter.sendNotifications(B.DECISION,{type:s,userId:t,attributes:i||{},decisionInfo:{experimentKey:e,variationKey:o}}),o}catch(e){return this.logger.log(Y.ERROR,e.message),this.errorHandler.handleError(e),null}}catch(e){return this.logger.log(Y.ERROR,e.message),this.errorHandler.handleError(e),null}var a,l},e.prototype.setForcedVariation=function(e,t,i){if(!this.validateInputs({experiment_key:e,user_id:t}))return!1;var n=this.projectConfigManager.getConfig();if(!n)return!1;try{return this.decisionService.setForcedVariation(n,e,t,i)}catch(e){return this.logger.log(Y.ERROR,e.message),this.errorHandler.handleError(e),!1}},e.prototype.getForcedVariation=function(e,t){if(!this.validateInputs({experiment_key:e,user_id:t}))return null;var i=this.projectConfigManager.getConfig();if(!i)return null;try{return this.decisionService.getForcedVariation(i,e,t).result}catch(e){return this.logger.log(Y.ERROR,e.message),this.errorHandler.handleError(e),null}},e.prototype.validateInputs=function(e,t,i){try{if(e.hasOwnProperty("user_id")){var n=e.user_id;if("string"!=typeof n||null===n||"undefined"===n)throw new Error(A(J.INVALID_INPUT_FORMAT,"OPTIMIZELY","user_id"));delete e.user_id}return Object.keys(e).forEach((function(t){if(!ni(e[t]))throw new Error(A(J.INVALID_INPUT_FORMAT,"OPTIMIZELY",t))})),t&&function(e){if("object"!=typeof e||Array.isArray(e)||null===e)throw new Error(A(J.INVALID_ATTRIBUTES,"ATTRIBUTES_VALIDATOR"));Object.keys(e).forEach((function(t){if(void 0===e[t])throw new Error(A(J.UNDEFINED_ATTRIBUTE,"ATTRIBUTES_VALIDATOR",t))}))}(t),i&&function(e){if("object"!=typeof e||Array.isArray(e)||null===e)throw new Error(A(J.INVALID_EVENT_TAGS,"EVENT_TAGS_VALIDATOR"))}(i),!0}catch(e){return this.logger.log(Y.ERROR,e.message),this.errorHandler.handleError(e),!1}},e.prototype.notActivatingExperiment=function(e,t){return this.logger.log(Y.INFO,X.NOT_ACTIVATING_USER,"OPTIMIZELY",t,e),null},e.prototype.filterEmptyValues=function(e){for(var t in e)!e.hasOwnProperty(t)||null!==e[t]&&void 0!==e[t]||delete e[t];return e},e.prototype.isFeatureEnabled=function(e,t,i){try{if(!this.isValidInstance())return this.logger.log(Y.ERROR,X.INVALID_OBJECT,"OPTIMIZELY","isFeatureEnabled"),!1;if(!this.validateInputs({feature_key:e,user_id:t},i))return!1;var n=this.projectConfigManager.getConfig();if(!n)return!1;var r=Ze(n,e,this.logger);if(!r)return!1;var o={},s=this.createInternalUserContext(t,i),a=this.decisionService.getVariationForFeature
1(n,r,s).result,l=a.decisionSource,c=di(a),u=fi(a),d=hi(a);l===ee.FEATURE_TEST&&(o={experimentKey:c,variationKey:u}),(l===ee.FEATURE_TEST||l===ee.ROLLOUT&&tt(n))&&this.sendImpressionEvent(a,r.key,t,d,i),!0===d?this.logger.log(Y.INFO,X.FEATURE_ENABLED_FOR_USER,"OPTIMIZELY",e,t):(this.logger.log(Y.INFO,X.FEATURE_NOT_ENABLED_FOR_USER,"OPTIMIZELY",e,t),d=!1);var f={featureKey:e,featureEnabled:d,source:a.decisionSource,sourceInfo:o};return this.notificationCenter.sendNotifications(B.DECISION,{type:Q.FEATURE,userId:t,attributes:i||{},decisionInfo:f}),d}catch(e){return this.logger.log(Y.ERROR,e.message),this.errorHandler.handleError(e),!1}},e.prototype.getEnabledFeatures=function(e,t){var i=this;try{var n=[];if(!this.isValidInstance())return this.logger.log(Y.ERROR,X.INVALID_OBJECT,"OPTIMIZELY","getEnabledFeatures"),n;if(!this.validateInputs({user_id:e}))return n;var r=this.projectConfigManager.getConfig();return r?(w(r.featureKeyMap).forEach((function(r){i.isFeatureEnabled(r.key,e,t)&&n.push(r.key)})),n):n}catch(e){return this.logger.log(Y.ERROR,e.message),this.errorHandler.handleError(e),[]}},e.prototype.getFeatureVariable=function(e,t,i,n){try{return this.isValidInstance()?this.getFeatureVariableForType(e,t,null,i,n):(this.logger.log(Y.ERROR,X.INVALID_OBJECT,"OPTIMIZELY","getFeatureVariable"),null)}catch(e){return this.logger.log(Y.ERROR,e.message),this.errorHandler.handleError(e),null}},e.prototype.getFeatureVariableForType=function(e,t,i,n,r){if(!this.validateInputs({feature_key:e,variable_key:t,user_id:n},r))return null;var o=this.projectConfigManager.getConfig();if(!o)return null;var s=Ze(o,e,this.logger);if(!s)return null;var a=function(e,t,i,n){var r=e.featureKeyMap[t];return r?r.variableKeyMap[i]||(n.log(Y.ERROR,J.VARIABLE_KEY_NOT_IN_DATAFILE,Fe,i,t),null):(n.log(Y.ERROR,J.FEATURE_NOT_IN_DATAFILE,Fe,t),null)}(o,e,t,this.logger);if(!a)return null;if(i&&a.type!==i)return this.logger.log(Y.WARNING,X.VARIABLE_REQUESTED_WITH_WRONG_TYPE,"OPTIMIZELY",i,a.type),null;var l=this.createInternalUserContext(n,r),c=this.decisionService.getVariationForFeature(o,s,l).result,u=hi(c),d=this.getFeatureVariableValueFromVariation(e,u,c.variation,a,n),f={};return c.decisionSource===ee.FEATURE_TEST&&null!==c.experiment&&null!==c.variation&&(f={experimentKey:c.experiment.key,variationKey:c.variation.key}),this.notificationCenter.sendNotifications(B.DECISION,{type:Q.FEATURE_VARIABLE,userId:n,attributes:r||{},decisionInfo:{featureKey:e,featureEnabled:u,source:c.decisionSource,variableKey:t,variableValue:d,variableType:a.type,sourceInfo:f}}),d},e.prototype.getFeatureVariableValueFromVariation=function(e,t,i,n,r){var o=this.projectConfigManager.getConfig();if(!o)return null;var s=n.defaultValue;if(null!==i){var a=function(e,t,i,n){if(!t||!i)return null;if(!e.variationVariableUsageMap.hasOwnProperty(i.id))return n.log(Y.ERROR,J.VARIATION_ID_NOT_IN_DATAFILE_NO_EXPERIMENT,Fe,i.id),null;var r=e.variationVariableUsageMap[i.id][t.id];return r?r.value:null}(o,n,i,this.logger);null!==a?t?(s=a,this.logger.log(Y.INFO,X.USER_RECEIVED_VARIABLE_VALUE,"OPTIMIZELY",s,n.key,e)):this.logger.log(Y.INFO,X.FEATURE_NOT_ENABLED_RETURN_DEFAULT_VARIABLE_VALUE,"OPTIMIZELY",e,r,s):this.logger.log(Y.INFO,X.VARIABLE_NOT_USED_RETURN_DEFAULT_VARIABLE_VALUE,"OPTIMIZELY",n.key,i.key)}else this.logger.log(Y.INFO,X.USER_RECEIVED_DEFAULT_VARIABLE_VALUE,"OPTIMIZELY",r,n.key,e);return function(e,t,i){var n;switch(t){case ie.BOOLEAN:"true"!==e&&"false"!==e?(i.log(Y.ERROR,J.UNABLE_TO_CAST_VALUE,Fe,e,t),n=null):n="true"===e;break;case ie.INTEGER:n=parseInt(e,10),isNaN(n)&&(i.log(Y.ERROR,J.UNABLE_TO_CAST_VALUE,Fe,e,t),n=null);break;case ie.DOUBLE:n=parseFloat(e),isNaN(n)&&(i.log(Y.ERROR,J.UNABLE_TO_CAST_VALUE,Fe,e,t),n=null);break;case ie.JSON:try{n=JSON.parse(e)}catch(r){i.log(Y.ERROR,J.UNABLE_TO_CAST_VALUE,Fe,e,t),n=null}break;default:n=e}return n}(s,n.type,this.logger)},e.prototype.getFeatureVariableBoolean=function(e,t,i,n){try{return this.isValidInstance()?this.getFeatureVariableForType(e,t,ie.BOOLEAN,i,n):(this.logger.log(Y.ERROR,X.INVALID_OBJECT,"OPTIMIZELY","getFeatureVariableBoolean"),null)}catch(e){return this.logger.log(Y.ERROR,e.message),this.errorHandler.handleError(e),null}},e.prototype.getFeatureVariableDouble=function(e,t,i,n){try{return this.isValidInstance()?this.getFeatureVariableForType(e,t,ie.DOUBLE,i,n):(this.logger.log(Y.ERROR,X.INVALID_OBJECT,"OPTIMIZELY","getFeatureVariableDouble"),null)}catch(e){return this.logger.log(Y.ERROR,e.message),this.errorHandler.handleError(e),null}},e.prototype.getFeatureVariableInteger=function(e,t,i,n){try{return this.isValidInstance()?this.getFeatureVariableForType(e,t,ie.INTEGER,i,n):(this.logger.log(Y.ERROR,X.INVALID_OBJECT,"OPTIMIZELY","getFeatureVariableInteger"),null)}catch(e){return this.logger.log(Y.ERROR,e.message),this.errorHandler.handleError(e),null}},e.prototype.getFeatureVariableString=function(e,t,i,n){try{return this.isValidInstance()?this.getFeatureVariableForType(e,t,ie.STRING,i,n):(this.logger.log(Y.ERROR,X.INVALID_OBJECT,"OPTIMIZELY","getFeatureVariableString"),null)}catch(e){return this.logger.log(Y.ERROR,e.message),this.errorHandler.handleError(e),null}},e.prototype.getFeatureVariableJSON=function(e,t,i,n){try{return this.isValidInstance()?this.getFeatureVariableForType(e,t,ie.JSON,i,n):(this.logger.log(Y.ERROR,X.INVALID_OBJECT,"OPTIMIZELY","getFeatureVariableJSON"),null)}catch(e){return this.logger.log(Y.ERROR,e.message),this.errorHandler.handleError(e),null}},e.prototype.getAllFeatureVariables=function(e,t,i){var n=this;try{if(!this.isValidInstance())return this.logger.log(Y.ERROR,X.INVALID_OBJECT,"OPTIMIZELY","getAllFeatureVariables"),null;if(!this.validateInputs({feature_key:e,user_id:t},i))return null;var r=this.projectConfigManager.getConfig();if(!r)return null;var o=Ze(r,e,this.logger);if(!o)return null;var s=this.createInternalUserContext(t,i),a=this.decisionService.getVariationForFeature
1(r,o,s).result,l=hi(a),c={};o.variables.forEach((function(i){c[i.key]=n.getFeatureVariableValueFromVariation(e,l,a.variation,i,t)}));var u={};return a.decisionSource===ee.FEATURE_TEST&&null!==a.experiment&&null!==a.variation&&(u={experimentKey:a.experiment.key,variationKey:a.variation.key}),this.notificationCenter.sendNotifications(B.DECISION,{type:Q.ALL_FEATURE_VARIABLES,userId:t,attributes:i||{},decisionInfo:{featureKey:e,featureEnabled:l,source:a.decisionSource,variableValues:c,sourceInfo:u}}),c}catch(e){return this.logger.log(Y.ERROR,e.message),this.errorHandler.handleError(e),null}},e.prototype.getOptimizelyConfig=function(){try{return this.projectConfigManager.getConfig()?this.projectConfigManager.getOptimizelyConfig():null}catch(e){return this.logger.log(Y.ERROR,e.message),this.errorHandler.handleError(e),null}},e.prototype.close=function(){var e,t=this;try{this.odpManager&&this.odpManager.close(),this.notificationCenter.clearAllNotificationListeners();var i=null===(e=this.projectConfigManager.getConfig())||void 0===e?void 0:e.sdkKey;i&&De.removeNotificationCenter(i);var n=this.eventProcessor.stop();return this.disposeOnUpdate&&(this.disposeOnUpdate(),this.disposeOnUpdate=null),this.projectConfigManager&&this.projectConfigManager.stop(),Object.keys(this.readyTimeouts).forEach((function(e){var i=t.readyTimeouts[e];clearTimeout(i.readyTimeout),i.onClose()})),this.readyTimeouts={},n.then((function(){return{success:!0}}),(function(e){return{success:!1,reason:String(e)}}))}catch(e){return this.logger.log(Y.ERROR,e.message),this.errorHandler.handleError(e),Promise.resolve({success:!1,reason:String(e)})}},e.prototype.onReady=function(e){var t,i,n=this;"object"==typeof e&&null!==e&&void 0!==e.timeout&&(t=e.timeout),T.isSafeInteger(t)||(t=3e4);var r=new Promise((function(e){i=e})),o=this.nextReadyTimeoutId;this.nextReadyTimeoutId++;var s=setTimeout((function(){delete n.readyTimeouts[o],i({success:!1,reason:A("onReady timeout expired after %s ms",t)})}),t);return this.readyTimeouts[o]={readyTimeout:s,onClose:function(){i({success:!1,reason:"Instance closed"})}},this.readyPromise.then((function(){clearTimeout(s),delete n.readyTimeouts[o],i({success:!0})})),Promise.race([this.readyPromise,r])},e.prototype.createUserContext=function(e,t){var i,n;return null!=(n=(null===(i=this.odpManager)||void 0===i?void 0:i.isVuidEnabled())&&!e?e||this.getVuid():e)&&this.validateInputs({user_id:n},t)?new Ot({optimizely:this,userId:n,attributes:t,shouldIdentifyUser:!0}):null},e.prototype.createInternalUserContext=function(e,t){return new Ot({optimizely:this,userId:e,attributes:t,shouldIdentifyUser:!1})},e.prototype.decide=function(e,i,n){var r,o,s,a,l=this;void 0===n&&(n=[]);var c,u=e.getUserId(),d=e.getAttributes(),f=this.projectConfigManager.getConfig(),p=[];if(!this.isValidInstance()||!f)return this.logger.log(Y.INFO,X.INVALID_OBJECT,"OPTIMIZELY","decide"),It(i,e,[re.SDK_NOT_READY]);var v=f.featureKeyMap[i];if(!v)return this.logger.log(Y.ERROR,J.FEATURE_NOT_IN_DATAFILE,"OPTIMIZELY",i),It(i,e,[A(re.FLAG_KEY_INVALID,i)]);var g=this.getAllDecideOptions(n),m=this.decisionService.findValidatedForcedDecision(f,e,i);p.push.apply(p,m.reasons);var _=m.result;if(_)c={experiment:null,variation:_,decisionSource:ee.FEATURE_TEST};else{var y=this.decisionService.getVariationForFeature(f,v,e,g);p.push.apply(p,y.reasons),c=y.result}var b=c.decisionSource,E=null!==(o=null===(r=c.experiment)||void 0===r?void 0:r.key)&&void 0!==o?o:null,w=null!==(a=null===(s=c.variation)||void 0===s?void 0:s.key)&&void 0!==a?a:null,I=hi(c);!0===I?this.logger.log(Y.INFO,X.FEATURE_ENABLED_FOR_USER,"OPTIMIZELY",i,u):this.logger.log(Y.INFO,X.FEATURE_NOT_ENABLED_FOR_USER,"OPTIMIZELY",i,u);var O={},S=!1;g[t.OptimizelyDecideOption.EXCLUDE_VARIABLES]||v.variables.forEac
1h((function(e){O[e.key]=l.getFeatureVariableValueFromVariation(i,I,c.variation,e,u)})),!g[t.OptimizelyDecideOption.DISABLE_DECISION_EVENT]&&(b===ee.FEATURE_TEST||b===ee.ROLLOUT&&tt(f))&&(this.sendImpressionEvent(c,i,u,I,d),S=!0);var C=[];g[t.OptimizelyDecideOption.INCLUDE_REASONS]&&(C=p.map((function(e){return A.apply(void 0,h([e[0]],e.slice(1),!1))})));var $={flagKey:i,enabled:I,variationKey:w,ruleKey:E,variables:O,reasons:C,decisionEventDispatched:S};return this.notificationCenter.sendNotifications(B.DECISION,{type:Q.FLAG,userId:u,attributes:d,decisionInfo:$}),{variationKey:w,enabled:I,variables:O,ruleKey:E,flagKey:i,userContext:e,reasons:C}},e.prototype.getAllDecideOptions=function(e){var i=this,n=u({},this.defaultDecideOptions);return Array.isArray(e)?e.forEach((function(e){t.OptimizelyDecideOption[e]?n[e]=!0:i.logger.log(Y.WARNING,X.UNRECOGNIZED_DECIDE_OPTION,"OPTIMIZELY",e)})):this.logger.log(Y.DEBUG,X.INVALID_DECIDE_OPTIONS,"OPTIMIZELY"),n},e.prototype.decideForKeys=function(e,i,n){var r=this;void 0===n&&(n=[]);var o={};if(!this.isValidInstance())return this.logger.log(Y.ERROR,X.INVALID_OBJECT,"OPTIMIZELY","decideForKeys"),o;if(0===i.length)return o;var s=this.getAllDecideOptions(n);return i.forEach((function(i){var a=r.decide(e,i,n);s[t.OptimizelyDecideOption.ENABLED_FLAGS_ONLY]&&!a.enabled||(o[i]=a)})),o},e.prototype.decideAll=function(e,t){void 0===t&&(t=[]);var i=this.projectConfigManager.getConfig();if(!this.isValidInstance()||!i)return this.logger.log(Y.ERROR,X.INVALID_OBJECT,"OPTIMIZELY","decideAll"),{};var n=Object.keys(i.featureKeyMap);return this.decideForKeys(e,n,t)}
1,e.prototype.updateOdpSettings=function(){var e=this.projectConfigManager.getConfig();null!=this.odpManager&&null!=e&&this.odpManager.updateSettings(new ut(e.publicKeyForOdp,e.hostForOdp,e.pixelUrlForOdp,e.allSegments))},e.prototype.sendOdpEvent=function(e,t,i,n){if(this.odpManager){var r=null!=t?t:"fullstack",o=new Map(i);if(i&&i.size>0)try{i.forEach((function(e,t){"fs-user-id"!==t.toLowerCase()&&G.FS_USER_ID!==t.toLowerCase()||(o.delete(t),o.set(G.FS_USER_ID,e))}))}catch(e){this.logger.warn(X.ODP_SEND_EVENT_IDENTIFIER_CONVERSION_FAILED)}try{var s=new ht(r,e,o,n);this.odpManager.sendEvent(s)}catch(e){this.logger.error(J.ODP_EVENT_FAILED,e)}}else this.logger.error(J.ODP_EVENT_FAILED_ODP_MANAGER_MISSING)},e.prototype.identifyUser=function(e){this.odpManager&&this.odpManager.enabled&&this.odpManager.identifyUser(e)},e.prototype.fetchQualifiedSegments=function(e,t){return d(this,void 0,void 0,(function(){return f(this,(function(i){switch(i.label){case 0:return this.odpManager?this.odpManager.enabled?[4,this.odpManager.fetchQualifiedSegments(e,t)]:(this.logger.error(J.ODP_FETCH_QUALIFIED_SEGMENTS_FAILED_ODP_MANAGER_MISSING),[2,null]):[2,null];case 1:return[2,i.sent()]}}))}))},e.prototype.getVuid=function(){var e;if(this.odpManager){if(this.odpManager.isVuidEnabled())return this.odp
1Manager.getVuid();this.logger.log(Y.WARNING,"getVuid() unavailable for this platform","OPTIMIZELY")}else null===(e=this.logger)||void 0===e||e.error("Unable to get VUID - ODP Manager is not instantiated yet.")},e}(),bi={parseUserAgentInfo:function(){var e=(new a.UAParser).getResult();return{os:e.os,device:e.device}}};function Ei(){return bi}var wi=Object.freeze({__proto__:null,get LogLevel(){return t.LogLevel},getLogger:U,setLogHandler:F,LOG_LEVEL:Y,createLogger:Ee}),Ii=U();j.setLogHandler(Ee()),j.setLogLevel(t.LogLevel.INFO);var Oi=!1,Si=function(e){var i,n;try{var r=!1;e.errorHandler&&(n=e.errorHandler,p=n),e.logger&&(j.setLogHandler(e.logger),j.setLogLevel(t.LogLevel.NOTSET)),void 0!==e.logLevel&&j.setLogLevel(e.logLevel);try{(function(e){if("object"==typeof e&&null!==e){var t=e,i=t.errorHandler,n=t.eventDispatcher,r=t.logger;if(i&&"function"!=typeof i.handleError)throw new Error(A(J.INVALID_ERROR_HANDLER,ve));if(n&&"function"!=typeof n.dispatchEvent)throw new Error(A(J.INVALID_EVENT_DISPATCHER,ve));if(r&&"function"!=typeof r.log)throw new Error(A(J.INVALID_LOGGER,ve));return!0}throw new Error(A(J.INVALID_CONFIG,ve))})(e),r=!0}catch(e){Ii.error(e)}var o=void 0;null==e.eventDispatcher?(o=new ue({eventDispatcher:_e}),Oi||(o.sendPendingEvents(),Oi=!0)):o=e.eventDispatcher;var s=e.closingEventDispatcher;!e.eventDispatcher&&!s&&window.navigator&&"sendBeacon"in window.navigator&&(s=ye);var a=e.eventBatchSize,l=e.eventFlushInterval;(function(e){return!("number"!=typeof e||!T.isSafeInteger(e))&&e>=1})(e.eventBatchSize)||(Ii.warn("Invalid eventBatchSize %s, defaulting to %s",e.eventBatchSize,10),a=10),function(e){return!("number"!=typeof e||!T.isSafeInteger(e))&&e>0}(e.eventFlushInterval)||(Ii.warn("Invalid eventFlushInterval %s, defaulting to %s",e.eventFlushInterval,1e3),l=1e3);var c=v(),d=Oe({logger:Ii,errorHandler:c}),f={dispatcher:o,closingDispatcher:s,flushInterval:l,batchSize:a,maxQueueSize:e.eventMaxQueueSize||1e4,notificationCenter:d},h=!0===(null===(i=e.odpOptions)||void 0===i?void 0:i.disabled);h&&Ii.info(X.ODP_DISABLED);var g=u(u({clientEngine:"javascript-sdk"},e),{eventProcessor:$e(f),logger:Ii,errorHandler:c,datafileManager:e.sdkKey?it(e.sdkKey,Ii,e.datafile,e.datafileOptions):void 0,notificationCenter:d,isValidInstance:r,odpManager:h?void 0:new wt({logger:Ii,odpOptions:e.odpOptions})}),m=new yi(g);try{if("function"==typeof window.addEventListener){var _="onpagehide"in window?"pagehide":"unload";window.addEventListener(_,(function(){m.close()}),!1)}}catch(e){Ii.error(X.UNABLE_TO_ATTACH_UNLOAD,"INDEX_BROWSER",e.message)}return m}catch(e){return Ii.error(e),null}},Ai=function(){Oi=!1},Ci=j.setLogHandler,$i=j.setLogLevel,Ti=u(u({},wi),{logging:we,errorHandler:me,eventDispatcher:_e,sendBeaconEventDispatcher:ye,enums:oe,setLogger:Ci,setLogLevel:$i,createInstance:Si,__internalResetRetryState:Ai,OptimizelyDecideOption:t.OptimizelyDecideOption,getUserAgentParser:Ei});t.LOG_LEVEL=Y,t.__internalResetRetryState=Ai,t.createInstance=Si,t.createLogger=Ee,t.default=Ti,t.enums=oe,t.errorHandler=me,t.eventDispatcher=_e,t.getLogger=U,t.getUserAgentParser=Ei,t.logging=we,t.sendBeaconEventDispatcher=ye,t.setLogHandler=F,t.setLogLevel=$i,t.setLogger=Ci},,,,,,function(e,t,i){"use strict";var n=i(1),r=i.n(n),o=i(0);function s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var n,r,o,s,a=[],l=!0,c=!1;try{if(o=(i=i.call(e)).next,0===t){if(Object(i)!==i)return;l=!1}else for(;!(l=(n=o.call(i)).done)&&(a.push(n.value),a.length!==t);l=!0);}catch(e){c=!0,r=e}finally{try{if(!l&&null!=i.return&&(s=i.return(),Object(s)!==s))return}finally{if(c)throw r}}return a}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return a(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);"Object"===i&&e.constructor&&(i=e.constructor.name);if("Map"===i||"Set"===i)return Array.from(e);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return a(e,t)}(e,t)||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 a(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}var l=Object(n.forwardRef)((function(e,t){var i=e.title,a=e.children,l=e.onClose,c=e.avoidClose,u=void 0!==c&&c,d=e.showCloseIcon,f=void 0===d||d,h=e.isDraggable,p=void 0===h||h,v=e.loading,g=void 0!==v&&v,m=e.className,_=void 0===m?"":m,y=e.loadingIframe,b=void 0!==y&&y,E=e.closeButtonTestId,w=void 0===E?"button_close_modal":E,I=s(Object(n.useState)(!0),2),O=I[0],S=I[1],A=s(Object(n.useState)(!0),2),C=A[0],$=A[1],T=s(Object(n.useState)(g),2),P=T[0],k=T[1],x=Object(n.useRef)(null),R=Object(n.useRef)(null),D=Object(n.useRef)(null),N=Object(n.useMemo)((function(){return o.a.isMobile()}),[]),L=Object(n.useMemo)((function(){var e="drag-dialog ".concat(_," is-modal");return C&&N&&(e+=" drag-dialog--isHidden"),P&&(e+=" drag-dialog--isLoading"),e}),[C,P,_,N]);Object(n.useEffect)((function(){N&&setTimeout((function(){$(!1)}),100);var e=function(e){var t;(k(e.detail.isLoading),!e.detail.isLoading&&b)?null===(t=document.getElementById("lottie-modal-container"))||void 0===t||t.remove():e.detail.isLoading||b||V()};return D.current&&D.current.addEventListener("isLoadingModal",e),function(){D.current&&D.current.removeEventListener("isLoadingModal",e)}}),[]);var M=Object(n.useCallback)((function(e){if(p){var t,i,n=R.current?R.current.offsetTop:0,r=x.current?x.current.clientHeight:0,o=e.changedTouches[0].clientY,s=r-(document.body.clientHeight-o+n);if(s>0)null===(t=x.current)||void 0===t||t.style.setProperty("transform","translateY(".concat(s,"px)")),s>=r&&V();else null===(i=x.current)||void 0===i||i.style.setProperty("transform","")}}),[p]),U=Object(n.useCallback)((function(){var e;document.removeEventListener("touchmove",M),document.removeEventListener("touchend",U),x.current&&F(x.current),null===(e=x.current)||void 0===e||e.style.setProperty("transform","")}),[M]),F=Object(n.useCallback)((function(e){e.style.transition="transform 0.5s ease",e.addEventListener("transitionend",(function(){e.style.transition=""}),{once:!0})}),[]),j=Object(n.useCallback)((function(){p&&(document.addEventListener("touchmove",M),document.addEventListener("touchend",U))}),[p,M,U]);Object(n.useImperativeHandle)(t,(function(){return{handleCloseModal:V}}));var V=Object(n.useCallback)((function(e){var t;(null==e||e.preventDefault(),N&&!u)?(null===(t=x.current)||void 0===t||t.addEventListener("transitionend",(function(){setTimeout((function(){S(!1)}),300),l&&l()}),{once:!0}),$(!0)):(u||S(!1),l&&l())}),[N,l]);return O?r.a.createElement(r.a.Fragment,null,r.a.createElement("div",{ref:D,id:"isLoadingModal"}),r.a.createElement("div",{id:"drag-modal",className:L,ref:x},N&&r.a.createElement("div",{className:"drag-dialog__mobile-icon-dash"},p&&r.a.createElement("a",{href:"#/",ref:R,className:"drag-dialog__drag-icon",onTouchStart:j}),f&&r.a.createElement("a",{href:"#",className:"drag-dialog__cross-icon",onClick:V,"data-testid":w},r.a.createElement("div",{className:"drag-dialog__cross-icon--gray"}
1))),!N&&f&&r.a.createElement("a",{href:"#",className:"drag-dialog__cross-icon",onClick:V,"data-testid":w},r.a.createElement("div",{className:"drag-dialog__cross-icon--gray"})),r.a.createElement("div",{id:"lottie-modal-container"}),b&&r.a.createElement("div",{className:"drag-dialog__wrapper"},i&&r.a.createElement("h1",null,i),a),!P&&!b&&r.a.createElement("div",{className:"drag-dialog__wrapper"},i&&r.a.createElement("h1",null,i),a))):null}));l.displayName="DragModal",t.a=l},,,,,function(e,t,i){"use strict";var n,r=i(1),o=i.n(r),s=(i(15),i(0)),a=i(66);function l(e){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function c(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,(r=n.key,o=void 0,o=function(e,t){if("object"!==l(e)||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!==l(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(r,"string"),"symbol"===l(o)?o:String(o)),n)}var r,o}function u(e,t){return(u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function d(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=p(e);if(t){var r=p(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return f(this,i)}}function f(e,t){if(t&&("object"===l(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return h(e)}function h(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function p(e){return(p=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var v=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&u(e,t)}(f,e);var t,i,r,l=d(f);function f(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,f),(t=l.call(this,e)).state={maxDays:15,enteredTo:"",clickAction:1,isDayPickerLoaded:!1},t.onDayMouseEnter=t.onDayMouseEnter.bind(h(t)),t.onDayMouseLeave=t.onDayMouseLeave.bind(h(t)),t.onDayClick=t.onDayClick.bind(h(t)),t}return t=f,(i=[{key:"getRangeStartTime",value:function(e){if(null==e)return null;var t=e.rangeStart||e["data-rangeStart"];return null==t||""===t?null:new Date(t).setHours(0,0,0,0)}},{key:"getRangeEndTime",value:function(e){if(null==e)return null;var t=e.rangeEnd||e["data-rangeEnd"];return null==t||""===t?null:new Date(t).setHours(0,0,0,0)}},{key:"componentDidMount",value:function(){var e=this;CivAPP.loadDayPicker().then((function(t){n=t.default,e.setState({isDayPickerLoaded:!0})})).catch((function(e){console.log("error al cargar DayPicker"),console.log(e)}))}},{key:"onDayMouseEnter",value:function(e,t,i){if(t.disabled||t.disabledTo||t.disabledWithTooltip)return!1;this.setState({enteredTo:e})}},{key:"onDayMouseLeave",value:function(){this.setState({enteredTo:""})}},{key:"isDisabledForTo",value:function(e){}}
1,{key:"onDayClick",value:function(e,t,i){var n=this;if(!(t.disabled||t.disabledTo||t.disabledWithTooltip)){var r=new Date(e).setHours(0,0,0,0),o=this.getRangeStartTime(this.props);1===this.state.clickAction||null===o?this.setState({clickAction:2},(function(){n.props.handleFromClick(e)})):null!==o&&r<o||this.setState({clickAction:1},(function(){n.props.handleToClick(e)}))}}},{key:"componentWillReceiveProps",value:function(e){var t=this.getRangeStartTime(e),i=this.getRangeEndTime(e);(e.resetFirstDay||null===t&&null===i)&&this.setState({clickAction:1})}},{key:"render",value:function(){var e,t,i,r=this,l=this,c=new Date,u=new Date,d=function(e){return""!==r.props.rangeStart&&""!==r.state.enteredTo&&e.setHours(0,0,0,0)>=r.props.rangeStart.setHours(0,0,0,0)&&e.setHours(0,0,0,0)<=r.state.enteredTo.setHours(0,0,0,0)};1===this.state.clickAction?(e=function(e){return e.setHours(0,0,0,0)<c.setHours(0,0,0,0)},i=function(e){return!1},t=""===this.props.rangeEnd?d:function(e){return""!==r.state.enteredTo&&e.setHours(0,0,0,0)>=r.state.enteredTo.setHours(0,0,0,0)&&e.setHours(0,0,0,0)<=r.props.rangeEnd.setHours(0,0,0,0)}):(e=function(e){return""!==r.props.rangeStart&&e.setHours(0,0,0,0)<r.props.rangeStart.setHours(0,0,0,0)},i=function(e){return""!==r.props.rangeStart&&e.setHours(0,0,0,0)>s.a.addDaysToDate(r.props.rangeStart.setHours(0,0,0,0),14)},t=""===this.props.rangeEnd?d:function(e){return""!==r.state.enteredTo&&e.setHours(0,0,0,0)>=r.props.rangeStart.setHours(0,0,0,0)&&e.setHours(0,0,0,0)<=r.state.enteredTo.setHours(0,0,0,0)&&e.setHours(0,0,0,0)<s.a.addDaysToDate(r.props.rangeStart.setHours(0,0,0,0),15)});var f={disabled:e,selectedAny:function(e){return""!==r.props.rangeStart&&s.a.dateToYYYYMMDD(e)===s.a.dateToYYYYMMDD(r.props.rangeStart)},selectedFrom:function(e){return""!==r.props.rangeStart&&s.a.dateToYYYYMMDD(e)===s.a.dateToYYYYMMDD(r.props.rangeStart)},selectedTo:function(e){return""!==r.props.rangeEnd&&s.a.dateToYYYYMMDD(e)===s.a.dateToYYYYMMDD(r.props.rangeEnd)},inHoverRange:t,disabledWithTooltip:i,inRange:function(e){return""!==r.props.rangeStart&&""!==r.props.rangeEnd&&e.setHours(0,0,0,0)>r.props.rangeStart.setHours(0,0,0,0)&&e.setHours(0,0,0,0)<r.props.rangeEnd.setHours(0,0,0,0)}},h=1===this.state.clickAction?" _selecting-from":" _selecting-to";""!==this.props.rangeStart&&""!==this.props.rangeEnd&&(this.props.rangeStart.setHours(0,0,0,0)!==this.props.rangeEnd.setHours(0,0,0,0)?h+=" _with-range":h+=" _with-one-day"),""!==this.state.enteredTo&&(h+=" _with-hover");var p=s.a.getLocale(),v=a.a.getMonths(p);return o.a.createElement("div",{className:"m-date-range-picker__calendar "+h},o.a.createElement("div",{className:"o-calendar o-calendar_filters m-folding-calendar__calendar"},!1===this.state.isDayPickerLoaded?o.a.createElement("div",{className:"m-loader"},"se está cargando el calendrioa"):o.a.createElement(n,{showOutsideDays:!1,onDayClick:this.onDayClick,locale:p,localeUtils:a.a,modifiers:f,renderDay:function(e,t){var i=1===l.state.clickAction?s.a.tr("filters.from"):s.a.tr("filters.to"),n="",r="_time";return t.disabledWithTooltip&&(i=s.a.tr("filters.availability.maxDaysWarning",l.state.maxDays),n=" _warning",r="_warning"),o.a.createElement("div",{className:"m-calendar-tooltip-container"},o.a.createElement("div",{class:"tooltip top m-calendar-tooltip _availability _calendar"+n},o.a.createElement("div",{class:"m-availability__tooltip"},o.a.createElement("span",{class:r},i))),o.a.createElement("span",{className:"_inner"},e.getDate()))},fromMonth:c,"data-month":u,onDayMouseEnter:this.onDayMouseEnter,onDayMouseLeave:this.onDayMouseLeave,captionElement:function(e){var t=e.date;return e.localeUtils,o.a.createElement("div",{className:"DayPicker-Caption",role:"heading"},o.a.createElement("div",null,v[t.getMonth()]," ",o.a.createElement("span",{className:"__year"},t.getFullYear())))}})))}}])&&c(t.prototype,i),r&&c(t,r),Object.defineProperty(t,"prototype",{writable:!1}),f}(o.a.Component);function g(e){return(g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function m(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,(r=n.key,o=void 0,o=function(e,t){if("object"!==g(e)||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!==g(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(r,"string"),"symbol"===g(o)?o:String(o)),n)}var r,o}function _(e,t){return(_=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function y(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=w(e);if(t){var r=w(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return b(this,i)}}function b(e,t){if(t&&("object"===g(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return E(e)}function E(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}
1function w(e){return(w=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var I=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_(e,t)}(s,e);var t,i,n,r=y(s);function s(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),(t=r.call(this,e)).state={fromDate:e.fromDate||"",toDate:e.toDate||"",resetFirstDay:!1},t.toDateIsOk=t.toDateIsOk.bind(E(t)),t.handleFromClick=t.handleFromClick.bind(E(t)),t.handleToClick=t.handleToClick.bind(E(t)),t.handleDeleteSelection=t.handleDeleteSelection.bind(E(t)),t}return t=s,(i=[{key:"componentDidMount",value:function(){window.addEventListener("deleteSelectionCalendar",this.handleDeleteSelection)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("deleteSelectionCalendar",this.handleDeleteSelection)}},{key:"componentDidUpdate",value:function(e,t){this.state.resetFirstDay&&t.resetFirstDay!==this.state.resetFirstDay&&this.setState({resetFirstDay:!1})}},{key:"fromIsOk",value:function(){return""!==this.state.fromDate}},{key:"toDateIsOk",value:function(e){return""!==this.state.fromDate&&e.setHours(0,0,0,0)>=this.state.fromDate.setHours(0,0,0,0)}},{key:"handleDeleteSelection",value:function(e){var t=this;e.detail.deleteSelection&&this.setState({fromDate:"",toDate:"",resetFirstDay:!0},(function(){t.props.onDateSelectedFromModal&&t.props.onDateSelectedFromModal({fromDate:"",toDate:""})}))}},{key:"handleFromClick",value:function(e){var t=this;""===this.state.fromDate&&""===this.state.toDate?this.setState({resetFirstDay:!1,fromDate:e},(function(){t.props.onDateSelectedFromModal?t.props.onDateSelectedFromModal({fromDate:e}):t.props.updateRange({fromDate:e})})):""!==this.state.fromDate&&this.setState({resetFirstDay:!1,fromDate:e,toDate:""},(function(){t.props.onDateSelectedFromModal?t.props.onDateSelectedFromModal({fromDate:e}):t.props.updateRange({fromDate:e,toDate:""})}))}},{key:"handleToClick",value:function(e){var t=this;if(!this.toDateIsOk(e))return!1;this.setState({toDate:e},(function(){t.props.onDateSelectedFromModal?t.props.onDateSelectedFromModal({fromDate:t.state.fromDate,toDate:e}):t.props.onSelectRange({fromDate:t.state.fromDate,toDate:t.state.toDate})}))}},{key:"render",value:function(){var e=this.state.resetFirstDay||"range"!==this.props.selectedFilter&&null!=this.props.selectedFilter;!1===this.state.resetFirstDay&&(e=!1);var t=this.props.onDateSelectedFromModal?this.state.fromDate:this.props.rangeStart,i=this.props.onDateSelectedFromModal?this.state.toDate:this.props.rangeEnd;return o.a.createElement("div",null,o.a.createElement(v,{handleFromClick:this.handleFromClick,handleToClick:this.handleToClick,"data-rangeStart":this.state.fromDate,"data-rangeEnd":this.state.toDate,rangeStart:t,rangeEnd:i,resetFirstDay:e}))}}])&&m(t.prototype,i),n&&m(t,n),Object.defineProperty(t,"prototype",{writable:!1}),s}(o.a.Component);t.a=I},,,,,,,function(e,t,i){"use strict";var n=i(60),r=i(0);function o(e){var t=e.dimension33,i=e.dimension32,n=t>0?t:1,r=Math.round(i/n*100)/100,o=String(e.id);return{sku:o,product_id:o,quantity:n,price:r}}function s(e){try{var t=document.createElement("img");t.width=1,t.height=1,t.src=function(e){var t=new URLSearchParams({website_id:"8725",order_id:String(e.order_id),email:e.email,phone:e.phone,goal:e.goal,currency:e.currency,amount:String(e.amount),tax:String(e.tax),shipping:String(e.shipping),pay_method:e.pay_method});return"//wd.civitatis.com/capture/convert2.gif?".concat(t.toString())}(e),document.body.appendChild(t)}catch(e){}}var a=i(44);function l(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function c(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};
1t%2?l(Object(i),!0).forEach((function(t){u(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):l(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function u(e,t,i){return(t=h(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function d(e){return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function f(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,h(n.key),n)}}function h(e){var t=function(e,t){if("object"!==d(e)||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!==d(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===d(t)?t:String(t)}var p=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.init=this.init.bind(this),this.bindNewModelClickEventHandler=this.bindNewModelClickEventHandler.bind(this),this.init(),this.intersectionObserverIsSupported="IntersectionObserver"in window,void 0===window.GTMImpressionsInviews&&(window.GTMImpressionsInviews={})}var t,i,l;return t=e,(i=[{key:"init",value:function(){if(!window.__wkndLoggedIn&&window.userEmailHash&&"function"==typeof window.wunderkindSDK){var e=function(){window.__wkndLoggedIn||Object(a.a)()&&(window.wunderkindSDK("logIn",{emailHash:window.userEmailHash}),window.__wkndLoggedIn=!0)};e(),window.__wkndLoggedIn||(window.Didomi&&"function"==typeof window.Didomi.on?window.Didomi.on("consent.changed",e):(window.didomiOnReady=window.didomiOnReady||[],window.didomiOnReady.push((function(t){e(),!window.__wkndLoggedIn&&t&&"function"==typeof t.on&&t.on("consent.changed",e)}))))}}},{key:"bindGTMHandlers",value:function(e,t){var i=this;if(e="object"===d(e)?e:window.GTMData,t="object"===d(t)?t:window.GTMDataImpresion,void 0!==e){var l,u,f,h,p,v,g,m,_,y,b,E,w,I,O,S,A,C=e.event;if("productImpression"===C)this.bindNewModelImpressionEventHandlers(e);else{if("transaction"===C&&!1===window.showConfirmationTags)return;if("transaction"===C){var $=e.ecommerce&&e.ecommerce.purchase&&e.ecommerce.purchase.actionField&&e.ecommerce.purchase.actionField.id;if($){var T="gtm_tx_"+$;try{if(localStorage.getItem(T))return void(window.GTMData=void 0);localStorage.setItem(T,"1")}catch(e){}}"undefined"!=typeof dataLayer&&(dataLayer.push(e),window.GTMData=void 0);var P=r.a.getDescendantProp(e,"ecommerce.purchase.actionField.revenue"),k=r.a.getDescendantProp(e,"ecommerce.currencyCode");n.a.capture("purchase completed",c(c({transaction_id:$},void 0!==P?{revenue:parseFloat(P)}:{}),k?{currency:k}:{}));try{if(Object(a.a)()){var x,R,D=(l=null!==(x=window.GTMData)&&void 0!==x?x:e,u=null!==(R=window.marketingContact)&&void 0!==R?R:null,S=null!==(f=null==l?void 0:null===(h=l.ecommerce)||void 0===h?void 0:null===(p=h.purchase)||void 0===p?void 0:p.actionField)&&void 0!==f?f:{},A=null!==(v=null==l?void 0:null===(g=l.ecommerce)||void 0===g?void 0:null===(m=g.purchase)||void 0===m?void 0:m.products)&&void 0!==v?v:[],{order_id:null!==(_=S.id)&&void 0!==_?_:"",email:null!==(y=null==u?void 0:u.email)&&void 0!==y?y:"",phone:null!==(b=null==u?void 0:u.phone)&&void 0!==b?b:"",goal:"purchase",currency:null!==(E=null==l?void 0:null===(w=l.ecommerce)||void 0===w?void 0:w.currencyCode)&&void 0!==E?E:"EUR",amount:null!==(I=S.totalTransaction)&&void 0!==I?I:0,tax:0,shipping:0,pay_method:null!==(O=S.paymentMethod)&&void 0!==O?O:"",items:A.map(o)});!function(e){try{var t=window.top;Array.isArray(t.bouncex)||(t.bouncex=[]),t.bouncex.push(["conversion",e])}catch(e){}}(D),s(D)}}catch(e){}}else if("undefined"!=typeof dataLayer){var N=r.a.getDescendantProp(e,"ecommerce.impressions"),L=r.a.getDescendantProp(e,"ecommerce.currencyCode");"object"===d(N)&&N.length>0&&(N.forEach((function(e){i.bindNewModelImpressionEventHandler(e,L)})),delete e.ecommerce.impressions),dataLayer.push(e),window.GTMData=void 0}}void 0!==t&&"productImpression"===t.event&&this.bindNewModelImpressionEventHandlers(t)}}},{key:"bindProductClickHandlersUser",value:function(){if(document.getElementById("civ-users")){if(GTMDataImpresion="object"===("undefined"==typeof GTMDataImpresion?"undefined":d(GTMDataImpresion))?GTMDataImpresion:window.GTMDataImpresion,"undefined"==typeof GTMDataImpresion)return;"productImpression"===GTMDataImpresion.event&&this.bindNewModelImpressionEventHandlers(GTMDataImpresion)}}},{key:"bindNewModelClickEventHandler",value:function(){var e=this;!0===window.isGTMNewModelEnabled&&$("body").on("click","[data-gtm-new-model-click]",(function(t){var i=$(this);e.pushDataLayerObject(i,"data-gtm-new-model-click")}))}},{key:"bindNewModelImpressionEventHandlers",value:function(e){var t=this;if(void 0!==(e="object"===d(e)?e:window.productImpressionData)){var i=r.a.getDescendantProp(e,"ecommerce.impressions"),n=r.a.getDescendantProp(e,"ecommerce.currencyCode"),o=r.a.getDescendantProp(e,"ecommerce.navigationCurrency");
1void 0!==i&&i.forEach((function(e){t.bindNewModelImpressionEventHandler(e,n,o)}))}}},{key:"bindNewModelImpressionEventHandler",value:function(e,t,i){var n=e.id,r=document.getElementById("data-gtm-"+n);if(r||(r=document.querySelector('[data-gtm-activity="'+n+'"]')),null!=r){if(void 0!==window.GTMImpressionsInviews[n]){try{this.intersectionObserverIsSupported?window.GTMImpressionsInviews[n].disconnect():window.GTMImpressionsInviews[n].destroy()}catch(e){}delete window.GTMImpressionsInviews[n]}this.intersectionObserverIsSupported?(window.GTMImpressionsInviews[n]=new IntersectionObserver((function(r){if(!0===r[0].isIntersecting){try{window.GTMImpressionsInviews[n].disconnect()}catch(e){}delete window.GTMImpressionsInviews[n],dataLayer.push({event:"productImpression",ecommerce:{currencyCode:t,navigationCurrency:i,impressions:[e]}})}}),{threshold:[0]}),window.GTMImpressionsInviews[n].observe(r)):window.GTMImpressionsInviews[n]=new Waypoint.Inview({element:r,enter:function(i){try{window.GTMImpressionsInviews[n].destroy()}catch(e){}delete window.GTMImpressionsInviews[n],dataLayer.push({event:"productImpression",ecommerce:{currencyCode:t,impressions:[e]}})}})}}},{key:"destroyImpressionInviews",value:function(){if(this.intersectionObserverIsSupported)for(var e in window.GTMImpressionsInviews)window.GTMImpressionsInviews[e].disconnect();else for(var e in window.GTMImpressionsInviews)window.GTMImpressionsInviews[e].destroy();window.GTMImpressionsInviews={}}},{key:"getProductDataFromModel",value:function(e,t){return t="string"==typeof t?t:"productClick",(e="string"==typeof e?JSON.parse(e):e).ecommerce.click.products[0]}},{key:"getModelFromData",value:function(e,t,i){return{event:"productImpression",ecommerce:{currencyCode:t,impressions:[e]}}}},{key:"getProductImpressionModelFromProductClickModel",value:function(e){return{event:"productImpression",ecommerce:{currencyCode:(e="string"==typeof e?JSON.parse(e):e).ecommerce.currencyCode,impressions:e.ecommerce.click.products}}}},{key:"pushDataLayerObject",value:function(e,t){var i=e.attr(t);if("string"==typeof i&&""!==i)try{i=JSON.parse(i),dataLayer.push(i)}catch(e){r.a.l("ERROR")}}}])&&f(t.prototype,i),l&&f(t,l),Object.defineProperty(t,"prototype",{writable:!1}),e}();t.a=p},function(e,t){var i;i=function(){return this}();try{i=i||new Function("return this")()}catch(e){"object"==typeof window&&(i=window)}e.exports=i},function(e,t,i){"use strict";i.d(t,"H",(function(){return p})),i.d(t,"r",(function(){return v})),i.d(t,"k",(function(){return g})),i.d(t,"K",(function(){return m})),i.d(t,"F",(function(){return _})),i.d(t,"A",(function(){return y})),i.d(t,"p",(function(){return b})),i.d(t,"i",(function(){return E})),i.d(t,"j",(function(){return w})),i.d(t,"d",(function(){return I})),i.d(t,"y",(function(){return O})),i.d(t,"t",(function(){return S})),i.d(t,"v",(function(){return A})),i.d(t,"u",(function(){return C})),i.d(t,"C",(function(){return $})),i.d(t,"B",(function(){return T})),i.d(t,"h",(function(){return P})),i.d(t,"f",(function(){return k})),i.d(t,"G",(function(){return x})),i.d(t,"o",(function(){return R})),i.d(t,"J",(function(){return D})),i.d(t,"I",(function(){return N})),i.d(t,"x",(function(){return L})),i.d(t,"z",(function(){return M})),i.d(t,"s",(function(){return U})),i.d(t,"g",(function(){return F})),i.d(t,"e",(function(){return j})),i.d(t,"m",(function(){return V})),i.d(t,"l",(function(){return B})),i.d(t,"D",(function(){return G})),i.d(t,"n",(function(){return q})),i.d(t,"w",(function(){return H})),i.d(t,"E",(function(){return z})),i.d(t,"b",(function(){return K})),i.d(t,"a",(function(){return W})),i.d(t,"q",(function(){return Y})),i.d(t,"c",(function(){return Z}));var n=i(7),r=i(0);function o(e){return function(e){if(Array.isArray(e))return h(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||f(e)||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 s(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function a(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};
1t%2?s(Object(i),!0).forEach((function(t){u(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):s(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function l(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var n,r,o,s,a=[],l=!0,c=!1;try{if(o=(i=i.call(e)).next,0===t){if(Object(i)!==i)return;l=!1}else for(;!(l=(n=o.call(i)).done)&&(a.push(n.value),a.length!==t);l=!0);}catch(e){c=!0,r=e}finally{try{if(!l&&null!=i.return&&(s=i.return(),Object(s)!==s))return}finally{if(c)throw r}}return a}}(e,t)||f(e,t)||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 c(e){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function u(e,t,i){return(t=function(e){var t=function(e,t){if("object"!==c(e)||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!==c(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===c(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function d(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=f(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0,r=function(){};return{s:r,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:r}}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 o,s=!0,a=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return s=e.done,e},e:function(e){a=!0,o=e},f:function(){try{s||null==i.return||i.return()}finally{if(a)throw o}}}}function f(e,t){if(e){if("string"==typeof e)return h(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?h(e,t):void 0}}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}var p=function(e){if(Array.isArray(e)){var t,i,r,o="",s="",a=d(e);try{for(a.s();!(r=a.n()).done;){var l=r.value||{},c=l.start,u=l.end,f=null!=c?c:"",h=null!=u?u:"";o=Object(n.c)(o,f,!0),s=Object(n.c)(s,h,!1)}}catch(e){a.e(e)}finally{a.f()}return{start:null!==(t=o)&&void 0!==t?t:"",end:null!==(i=s)&&void 0!==i?i:""}}var p=e||{},v=p.start,g=p.end;return{start:null!=v?v:"",end:null!=g?g:""}},v=function e(t,i){var n=i?u({},i,[]):[];if(t&&"object"===c(t)&&(!Array.isArray(t)||t.length>0)){if("object"===c(t)&&!Array.isArray(t))return Object.fromEntries(Object.entries(t).map((function(e){var t=l(e,2),i=t[0],n=t[1];return[i,null===n?[]:n]})));if("object"===c(t[0])){if(1===t.length)return e(t[0],i);if(i&&t[0]&&t[0][i]&&0===t[0][i].length)return n;var r=function(e,t){if(!e||Array.isArray(e)&&0===e.length||0===Object.keys((i=e,Object.keys(i).reduce((function(e,t){return i[t]&&Array.isArray(i[t])&&i[t].length>0&&(e[t]=i[t]),e}),{}))).length)return t;var i;if(Array.isArray(e)&&Array.isArray(t))return e.filter((function(e){return t.includes(e)}));if("object"===c(e)&&!Array.isArray(e)&&"object"===c(t)&&!Array.isArray(t)){var n={},r=function(i){t.hasOwnProperty(i)&&Array.isArray(e[i])&&Array.isArray(t[i])&&(n[i]=e[i].filter((function(e){return t[i].includes(e)})))};for(var o in e)r(o);return Object.keys(n).length>0?n:void 0}return e},s=function(e){return e&&i&&Array.isArray(e[i])&&0===e[i].length},d=t.reduce((function(t,o,a){if(o&&"object"===c(o)&&(!Array.isArray(o)||o.length>0)){var l,u;if(a>
10&&s(t)||s(o))return n;var d=e(o,i);return null!==(l=null!==(u=r(null!=t?t:n,d))&&void 0!==u?u:t)&&void 0!==l?l:n}return t}),n),f=null!=d?d:n;return a(a({},n),f)}return i?u({},i,Array.from(new Set(o(t)))):Array.from(new Set(o(t)))}return n},g=function(e){var t,i;return null!==(t=null!==(i=null!=e?e:window.currencySymbol)&&void 0!==i?i:r.a.getCurrencySymbol())&&void 0!==t?t:"â¬"},m=function(e,t,i){if(!e)return{};if(Array.isArray(e)){var r=function(){for(var t={},i={},r=0,s=0,a=e;s<a.length;s++){var u=a[s];u&&"object"===c(u)&&Object.entries(u).map((function(e){var s=l(e,2),a=s[0],c=s[1];t[a]||(t[a]=null!=c?c:[]);var u=Object(n.e)(t[a]);0===r&&(i[a]=u[0].hours.slice());var f,h=t[a]===c?u:Object(n.e)(c),p=o(u),v=d(h);try{var g=function(){var e=f.value,t=p.find((function(t){return t.fee===e.fee}));t?t.hours=Array.from(new Set([].concat(o(t.hours),o(e.hours)))).sort((function(e,t){var i=Object(n.H)(e),r=Object(n.H)(t);return i.getTime()-r.getTime()})):p.push(e)};for(v.s();!(f=v.n()).done;)g()}catch(e){v.e(e)}finally{v.f()}t[a]=p.map((function(e){return"".concat(e.fee,".").concat(e.hours.join(","))})).join(";")})),r++}return{v:t}}();if("object"===c(r))return r.v}return e||{}},_=function(e){if(null!=e&&"string"==typeof e)try{return JSON.parse(e)||{}}catch(e){return{}}if(Array.isArray(e)){for(var t={},i=0,n=e;i<n.length;i++){var r=n[i],o={};if(null!=r&&"string"==typeof r)try{var s;o=null!==(s=JSON.parse(r))&&void 0!==s?s:{}}catch(e){o={}}else o=null!=r?r:{};for(var l=0,c=Object.keys(o);l<c.length;l++){var u=c[l];t[u]?t[u]=a(a({},t[u]),o[u]):t[u]=a({},o[u])}}return t}return null!=e?e:{}},y=function(e){if(Array.isArray(e)){for(var t={},i=0,n=e;i<n.length;i++){var r=n[i];"object"!==c(r)||Array.isArray(r)||(t=a(a({},t),r))}return t}return null!=e?e:{}},b=function(e){return null!=e?e:[]},E=function(e){var t;return Object(n.C)(null!==(t=null!=e?e:r.a.getLocaleCurrencyBeforeAmount())&&void 0!==t&&t)},w=function(e){var t;return Object(n.C)(null===(t=null!=e?e:r.a.getLocaleCurrencySpace())||void 0===t||t)},I=function(e){return Object(n.D)(e,0)},O=function(e){return Object(n.D)(e,0)},S=function(e){return Object(n.C)(null!=e&&e)},A=function(e){return e&&Array.isArray(e)?e.map((function(e){return Object(n.C)(null!=e&&e)})).every((function(e){return!0===e})):Object(n.C)(null!=e&&e)},C=function(e){return Object(n.C)(null!=e&&e)},$=function(e){return Object(n.D)(e,3)},T=function(e){return Object(n.D)(e,0)},P=function(e){return null!=e?e:""},k=function(e){return null!=e?e:""},x=function(e){return Object(n.D)(e,1,[1,2])},R=function(e,t,i){var r,o;if("object"===c(e)&&Array.isArray(e)){var s,a=d(e);try{for(a.s();!(s=a.n()).done;){var l=s.value;o=Object(n.c)(o,null!=l?l:"",!0)}}catch(e){a.e(e)}finally{a.f()}}else o=e;var u=null!==(r=null!=i?i:o)&&void 0!==r?r:"";if(Object(n.B)()){var f=Object(n.s)(t),h=Object(n.D)(null==f?void 0:f.statusPayLater,-1);if(0===h||3===h){var p=Object(n.v)(),v=Object(n.b)(Object(n.d)(),p+1);if(v>Object(n.d)(u))return v.toISOString().split("T")[0]}}return u},D=function(e,t,i,r){var o,s,a,l,c=Object(n.s)(e),u=Object(n.t)(t),d=null==i?void 0:i.horaActividad,f=(null==r?void 0:r.fechaDisfrute)?r.fechaDisfrute.split(" ")[1]:void 0,h=null!==(o=null==r?void 0:r.time)&&void 0!==o?o:f;return null!==(s=null!==(a=null!==(l=null!=d?d:h)&&void 0!==l?l:null==u?void 0:u.time)&&void 0!==a?a:null==c?void 0:c.time)&&void 0!==s?s:void 0},N=function(e){return!!e&&Object.keys(e).length>0},L=function(e){return Object(n.D)(e,0)},M=function(e){if("object"===c(e)&&Array.isArray(e)){var t,i=0,r=d(e);try{for(r.s();!(t=r.n()).done;){var o=t.value;i+=Object(n.D)(o,0)}}catch(e){r.e(e)}finally{r.f()}return i}return Object(n.D)(e,0)},U=function(e){return Object(n.D)(e,0)},F=function(e,t){var i=null!=t?t:null==e?void 0:e.existHours;if(null!=i)return Object(n.C)(i)?"1":"0"},j=function(e,t){var i=null!=t?t:null==e?void 0:e.allowModifyDateAndTime;if(null!=i)return Object(n.C)(i)},V=function(e){return e&&Object.keys(e).length>0?"activity_modify":void 0},B=function(e){return e&&Object.keys(e).length>0?"fechaActividad":void 0},G=function(e,t){var i,r,o=Object(n.s)(e),s=Object(n.t)(t);return null!==(i=null!==(r=null==s?void 0:s.paxesAsString)&&void 0!==r?r:null==o?void 0:o.paxesAsString)&&void 0!==i?i:void 0},q=function(e){return Object(n.C)(e)},H=function(e){return null!=e&&Array.isArray(e)?e.map((function(e){return Object(n.D)(e,0)})):[]},z=function(e,t,i,r){return e?Object(n.g)(e,t,i,r).map((function(e){return Object(n.f)(e,i,r).map((function(e){var t=e.rate,i=e.originalRate,r=e.commision,o={rate:"".concat(Object(n.D)(t,0))};return i&&(o.originalRate="".concat(Object(n.D)(i,0))),r&&(o.commision="".concat(Object(n.D)(r,0))),o}))})):Object(n.h)(t&&t.length>0?t.length:0,Object(n.h)(i&&Array.isArray(i)&&i.length>0?i.length:0,Object(n.m)(r)))},K=function(e){var t,i,n,r,o=(null===(t=window.activityData)||void 0===t?void 0:t.cityUrl)&&""!==(null===(i=window.activityData)||void 0===i?void 0:i.cityUrl)?null===(n=window.activityData)||void 0===n?void 0:n.cityUrl:void 0,s=e&&""!==e?e:void 0;return null!==(r=null!=s?s:o)&&void 0!==r?r:void 0},W=function(e){return Object(n.C)(e)},Y=function(e,t,i){var r=Object(n.o)(e,Object(n.j)()),o=r.horasValidas,s=m(Object(n.C)(t)?Object(n.k)(e,r,"horasValidas",t,i):o);if(null!=s){if(Array.isArray(s)&&s.length>0)return!0;
1if("object"===c(s)&&Object.keys(s).length>0)return!0}return!1},J=function(e){return e.filter((function(e){var t=l(e.split(":"),2),i=t[0],n=t[1],r=parseInt(i,10),o=parseInt(n,10);return!isNaN(r)&&!isNaN(o)})).sort((function(e,t){var i=Object(n.H)(e),r=Object(n.H)(t);return i.getTime()-r.getTime()}))},X=function(e){return e&&Array.isArray(e)&&(t=e,Array.isArray(t)&&t.every((function(e){return null==e||Array.isArray(e)}))&&t.some((function(e){return Array.isArray(e)})))?J(e.reduce((function(e,t){return Array.isArray(t)&&t.forEach((function(t){e.includes(t)||e.push(t)})),e}),[])):e&&Array.isArray(e)&&e.every((function(e){return"string"==typeof e}))?J(e):void 0;var t},Z=function(e,t){var i,r,o,s=Object(n.o)(e,Object(n.j)()),a=Object(n.C)(t),l=s.oldCalendarVariables,c=s.horasActividad,u=(null!=l?l:{}).horasActividad;return null!==(i=null!==(r=null!==(o=X(a?Object(n.k)(e,s,"oldCalendarVariables.horasActividad",a):u))&&void 0!==o?o:function(e,t){var i=Object(n.o)(e,Object(n.j)()),r=Object(n.C)(t),o=i.modifyCalendar,s=i.horasValidas,a=null==o?void 0:o.date;if(null!=a){if(r){var l=Object(n.k)(e,i,"horasValidas",r);if(Array.isArray(l))return X(l.map((function(e){if(Object(n.G)(a,e))return X(Object(n.e)(null==e?void 0:e[a])[0].hours)})));if(Object(n.G)(a,l))return X(Object(n.e)(null==l?void 0:l[a])[0].hours)}if(Object(n.G)(a,s))return X(Object(n.e)(null==s?void 0:s[a])[0].hours)}}(e,a))&&void 0!==r?r:X(a?Object(n.k)(e,s,"horasActividad",a):c))&&void 0!==i?i:[]}},,,,,,,function(e,t,i){var n=function(e){"use strict";var t=Object.prototype,i=t.hasOwnProperty,n=Object.defineProperty||function(e,t,i){e[t]=i.value},r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",s=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function l(e,t,i){return Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,i){return e[t]=i}}function c(e,t,i,r){var o=t&&t.prototype instanceof f?t:f,s=Object.create(o.prototype),a=new S(r||[]);return n(s,"_invoke",{value:E(e,i,a)}),s}function u(e,t,i){try{return{type:"normal",arg:e.call(t,i)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var d={};function f(){}function h(){}function p(){}var v={};l(v,o,(function(){return this}));var g=Object.getPrototypeOf,m=g&&g(g(A([])));m&&m!==t&&i.call(m,o)&&(v=m);var _=p.prototype=f.prototype=Object.create(v);function y(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function b(e,t){var r;n(this,"_invoke",{value:function(n,o){function s(){return new t((function(r,s){!function n(r,o,s,a){var l=u(e[r],e,o);if("throw"!==l.type){var c=l.arg,d=c.value;return d&&"object"==typeof d&&i.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,s,a)}),(function(e){n("throw",e,s,a)})):t.resolve(d).then((function(e){c.value=e,s(c)}),(function(e){return n("throw",e,s,a)}))}a(l.arg)}(n,o,r,s)}))}return r=r?r.then(s,s):s()}})}function E(e,t,i){var n="suspendedStart";return function(r,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===r)throw o;return C()}for(i.method=r,i.arg=o;;){var s=i.delegate;if(s){var a=w(s,i);if(a){if(a===d)continue;return a}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if("suspendedStart"===n)throw n="completed",i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);n="executing";var l=u(e,t,i);if("normal"===l.type){if(n=i.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:i.done}}"throw"===l.type&&(n="completed",i.method="throw",i.arg=l.arg)}}}function w(e,t){var i=t.method,n=e.iterator[i];if(void 0===n)return t.delegate=null,"throw"===i&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)?d:("return"!==i&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+i+"' method")),d);var r=u(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,d;var o=r.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function I(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function S(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(I,this),this.reset(!0)}function A(e){if(e){var t=e[o];if(t)return t.call(e);
vendor: 4,133 bytes, line 1
1if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,r=function t(){for(;++n<e.length;)if(i.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return r.next=r}}return{next:C}}function C(){return{value:void 0,done:!0}}return h.prototype=p,n(_,"constructor",{value:p,configurable:!0}),n(p,"constructor",{value:h,configurable:!0}),h.displayName=l(p,a,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===h||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,l(e,a,"GeneratorFunction")),e.prototype=Object.create(_),e},e.awrap=function(e){return{__await:e}},y(b.prototype),l(b.prototype,s,(function(){return this})),e.AsyncIterator=b,e.async=function(t,i,n,r,o){void 0===o&&(o=Promise);var s=new b(c(t,i,n,r),o);return e.isGeneratorFunction(i)?s:s.next().then((function(e){return e.done?e.value:s.next()}))},y(_),l(_,a,"Generator"),l(_,o,(function(){return this})),l(_,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),i=[];for(var n in t)i.push(n);return i.reverse(),function e(){for(;i.length;){var n=i.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=A,S.prototype={constructor:S,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!e)for(var t in this)"t"===t.charAt(0)&&i.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(i,n){return s.type="throw",s.arg=e,t.next=i,n&&(t.method="next",t.arg=void 0),!!n}for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r],s=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var a=i.call(o,"catchLoc"),l=i.call(o,"finallyLoc");if(a&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var s=o?o.completion:{};return s.type=e,s.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(s)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.finallyLoc===e)return this.complete(i.completion,i.afterLoc),O(i),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.tryLoc===e){var n=i.completion;if("throw"===n.type){var r=n.arg;O(i)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,i){return this.delegate={iterator:A(e),resultName:t,nextLoc:i},"next"===this.method&&(this.arg=void 0),d}},e}(e.exports);try{regeneratorRuntime=n}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}},function(e,t,i){"use strict";i.d(t,"a",(function(){return s}));var n=i(15),r=i(0),o=i(21);function s(){var e=r.a.readCookie("u_info");if(!e)return null;try{var t=r.a.decodeMaybeDoubleEncoded(e),i=atob(t),s=JSON.parse(i);if(!s||void 0===s.id)return null;var a=s.id,l=s.id_encoded,c=s.name,u=void 0===c?"":c,d=s.surname,f=void 0===d?"":d,h=s.email,p=s.banner;if(null!=a&&Object(o.a)("wave_release_web_ga4_native_user_id")){var v=n.a.get("userLogin");r.a.setKeyWithExpiration("userLogin",a,7,"days"),String(v)!==String(a)&&
1(window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"login",userid:String(a),user_civiId:String(a),user_loginStatus:"true",method:"password"}))}var g=Number(a);return isNaN(g)?null:{id:g,id_encoded:l,name:u,surname:f,email:h,banner:p||void 0}}catch(e){return console.error("Error decoding user data:",e),null}}},function(e,t,i){"use strict";i.d(t,"a",(function(){return s})),i.d(t,"b",(function(){return a})),i.d(t,"d",(function(){return l})),i.d(t,"c",(function(){return c}));var n=i(7);function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t,i){return(t=function(e){var t=function(e,t){if("object"!==r(e)||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!==r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===r(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var s=function(e,t,i){var r=Object(n.E)("tarifa",e,t);return i&&i.length>0&&(r=i.map((function(e){return r[e]}))),r},a=function(e,t){return Object(n.E)("originalRate",e,t)},l=function(e,t){return Object(n.E)("su",e,t)},c=function(e,t){var i=t||{},r=i.lang,s=i.id,a=Object(n.D)(s,1/0);if(e){var l={};for(var c in e)if(e.hasOwnProperty(c)){var u=Object(n.D)(e[c],1/0);u&&isFinite(u)&&(l[c]=u)}return r&&s&&isFinite(a)&&!l.hasOwnProperty(r)&&(l[r]=Object(n.D)(a)),l}return r&&s&&isFinite(a)?o({},r,Object(n.D)(a)):{}}},function(e,t){var i={utf8:{stringToBytes:function(e){return i.bin.stringToBytes(unescape(encodeURIComponent(e)))},bytesToString:function(e){return decodeURIComponent(escape(i.bin.bytesToString(e)))}},bin:{stringToBytes:function(e){for(var t=[],i=0;i<e.length;i++)t.push(255&e.charCodeAt(i));return t},bytesToString:function(e){for(var t=[],i=0;i<e.length;i++)t.push(String.fromCharCode(e[i]));return t.join("")}}};e.exports=i},function(e,t,i){"use strict";i.d(t,"a",(function(){return n}));function n(e,t){if(!e)return null;var i=e.indexOf("#"),n=-1!==i?e.slice(i):"",r=-1!==i?e.slice(0,i):e,o=r.indexOf("?"),s=-1!==o?r.slice(o):"",a=-1!==o?r.slice(0,o):r;if(a.includes("/".concat(t,"/"))||a.endsWith("/".concat(t))||a.endsWith("/".concat(t,"/")))return null;var l=a.endsWith("/")?a:"".concat(a,"/");return"".concat(l).concat(t,"/").concat(s).concat(n)}},,,function(e,t,i){"use strict";var n=i(0),r={get:function(e){var t={url:e};return $.ajax(t).fail((function(e){r.error(e)}))},post:function(e,t,i){var n={url:e,type:"POST",data:t};return void 0!==i&&(n.dataType=i),$.ajax(n).fail((function(e){r.error(e)}))},patch:function(e,t,i){var n={url:e,type:"PATCH",data:t};return void 0!==i&&(n.dataType=i),$.ajax(n).fail((function(e){r.error(e)}))},postWithFiles:function(e,t,i){var n=new FormData;for(var o in t)n.append(o,t[o]);var s={url:e,type:"POST",data:n,contentType:!1,processData:!1};return void 0!==i&&(s.dataType=i),$.ajax(s).fail((function(e){r.error(e)}))},delete:function(e){var t={url:e,type:"DELETE"};return $.ajax(t).fail((function(e){r.error(e)}))},error:function(e){var t;n.a.l("HTTP fail ---------------"),n.a.l(e),n.a.l("---------------");try{t=$.parseJSON(e.responseText),0!==e.status&&console.error("Ajax error: "+t)}catch(i){t={message:"error "+e.status+", "+e.statusText},n.a.warn(t),0!==e.status&&console.error("Ajax error: "+e.status+", "+e.statusText)}}},o=r,s=i(34);function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function l(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var n,r,o,s,a=[],l=!0,c=!1;try{if(o=(i=i.call(e)).next,0===t){if(Object(i)!==i)return;l=!1}else for(;!(l=(n=o.call(i)).done)&&(a.push(n.value),a.length!==t);l=!0);}catch(e){c=!0,r=e}
1finally{try{if(!l&&null!=i.return&&(s=i.return(),Object(s)!==s))return}finally{if(c)throw r}}return a}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return c(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);"Object"===i&&e.constructor&&(i=e.constructor.name);if("Map"===i||"Set"===i)return Array.from(e);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return c(e,t)}(e,t)||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 c(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}var u={urls:{activityFilters:n.a.isGuide()?"/:city/apply-filters":void 0!==window.civLocale&&null!==window.civLocale?"/"+window.civLocale+"/:city/apply-filters":"/es/:city/apply-filters",categoryFilters:n.a.isGuide()?"/:category/apply-filters":void 0!==window.civLocale&&null!==window.civLocale?"/"+window.civLocale+"/:category/apply-filters":"/es/:category/apply-filters",destinationCategoryFilters:n.a.isGuide()?"/:city/:category/apply-filters":void 0!==window.civLocale&&null!==window.civLocale?"/"+window.civLocale+"/:city/:category/apply-filters":"/es/:city/:category/apply-filters",homeViewMoreTopDestinations:"/view-more-top-destinations/:limit/:offset",clientViewMoreReserves:n.a.isGuide()?n.a.tr("clientsUrl")+n.a.tr("myBookingsUrl")+"/:slug/:offset/:limit":void 0!==window.civLocale&&null!==window.civLocale?"/"+window.civLocale+n.a.tr("clientsUrl")+n.a.tr("myBookingsUrl")+"/:slug/:offset/:limit":"/es"+n.a.tr("clientsUrl")+n.a.tr("myBookingsUrl")+"/:slug/:offset/:limit",search:n.a.isGuide()?"/ajaxsearch/:texto/":void 0!==window.civLocale&&null!==window.civLocale?"/"+window.civLocale+"/ajaxsearch/:texto/":"/es/ajaxsearch/:texto/",newSearch:"/api/search/:lang/:texto",paylandsIframeUrl:"/paylands/getiframeurl/"},methods:{generalGet:function(e){return o.get(e)},generalDelete:function(e){return o.delete(e)},paylandsIframeUrl:function(e){var t=u.getCompleteUrl("paylandsIframeUrl");return o.post(t,JSON.stringify(e.data))},search:function(e){var t=u.getCompleteUrl("search",e.params);return-1!==location.href.indexOf("localhost")&&(t="http://localhost:8090/mocks/searchData.js"),o.get(t)},newSearch:function(e){var t=u.getCompleteUrl("newSearch",e.params);return-1!==location.href.indexOf("localhost")&&(t="http://localhost:8090/mocks/searchData.js"),window.newSearchUrl=!0,o.get(t)},activityFilters:function(e){var t=u.getCompleteUrl("activityFilters",{city:e.params.city}),i=new URLSearchParams;return Object.entries(e.data||{}).forEach((function(e){var t=l(e,2),n=t[0],r=t[1];null!=r&&(n.includes("Ids")?Array.isArray(r)?r.forEach((function(e){return i.append("".concat(n,"[]"),e)})):i.append("".concat(n,"[]"),r):i.append(n,r))})),i.toString()&&(t="".concat(t,"?").concat(i)),o.get(t)},categoryFilters:function(e){var t=u.getCompleteUrl("categoryFilters",{category:e.params.category});return o.post(t,JSON.stringify(e.data))},destinationCategoryFilters:function(e){var t=u.getCompleteUrl("destinationCategoryFilters",{category:e.params.category,city:e.params.city});return o.post(t,JSON.stringify(e.data))},transfers1:function(e){var t=document.location.ref;return o.post(t,JSON.stringify(e.data))},formSubmit:function(e,t,i,n){n=void 0!==n&&n,i=void 0!==i&&i;var r=void 0!==e.action?e.action:document.location.ref;return t&&(r=t),n?o.patch(r,JSON.stringify(e.data)):!1===i?o.post(r,JSON.stringify(e.data)):o.postWithFiles(r,e.data)},homeViewMoreTopDestinations:function(e){var t=u.getCompleteUrl("homeViewMoreTopDestinations",{limit:e.params.limit,offset:e.params.offset});return o.get(t)},clientViewMoreReserves:function(e){var t=u.getCompleteUrl("clientViewMoreReserves",{slug:e.params.slug,limit:e.params.limit,offset:e.params.offset});return o.get(t)},popUpError:function(e,t,i,r){var o,s=n.a.tr("popUp.agency.acceptButtonAcceptNewConditionsAdmin"),a=n.a.tr("popUp.agency.cancelButtonAcceptNewConditionsAdmin");r=null!=r&&""!==r?r:$($("form")[0]).attr("id");var l=Function.prototype,c=n.a.tr("agenciesUrl")+"/"+n.a.tr("conditions_agencies_url_form_href");
1!1===$("body").hasClass("is-guide")&&(c="/"+n.a.getLocale()+c),"admin"===e?(o={title:n.a.tr("popUp.agency.titleAcceptNewConditionsTitle"),body:n.a.tr("civitatis_titleAcceptNewConditionsAdmin",c),confirmText:s,cancelText:a,confirmClass:"a-new-form-button a-button-form --save a-no-before u-ta-center",markDown:!0,extraClass:"_popup-agency-error _no-min-height login-form-new",isCenter:!1},l=function(){n.a.loading(),$.ajax({url:i,type:"POST",data:'{"accept":"true", "agency":"'+t+'"}',contentType:"application/json",dataType:"json",success:function(e){$("#"+r).submit()},error:function(e,t,i){0!==e.status&&console.error(new Error("Ajax error: "+t+", "+i))},complete:function(e,t){n.a.unLoading()}})}):"user"===e&&(o={title:n.a.tr("popUp.agency.titleAcceptNewConditionsTitle"),body:n.a.tr("popUp.agency.titleAcceptNewConditionsClient",c),confirmText:s,confirmClass:"a-new-form-button a-button-form --save a-no-before u-ta-center",markDown:!0,extraClass:"_popup-agency-error _no-min-height login-form-new",isCenter:!1}),$(".reveal").each((function(e,t){var i=$(t).find(".close-button");$(i).trigger("click")})),CivAPP.ConfirmUtil.load(o).done((function(){l()}))}},getParts:function(e){for(var t=[],i=e.split("/:"),n=1;n<i.length;n++){var r=i[n].split("/")[0];""!=r&&t.push(r)}return t},fillUrl:function(e,t){if(-1==e.indexOf(":"))return e;for(var i=u.getParts(e),r=0;r<i.length;r++)if(void 0===t[i[r]])throw n.a.error("error in fillUrl"),n.a.error("part:"+i[r]),n.a.error("params:"),n.a.error(t),n.a.error("url:"),n.a.error(e),"WS.fillUrl: parameters don't match url pattern";for(var o in t)-1===e.indexOf(o)&&n.a.l("fillUrl: extra param received: "+o),e=e.replace(":"+o,t[o]);return e},getUrl:function(e){var t=n.a.getDescendantProp(u.urls,e);if(void 0===t)throw"WS.getUrl - serviceId not found: "+e;return t},getCompleteUrl:function(e,t){var i=u.getUrl(e);return void 0===t&&(t={}),i=u.fillUrl(i,t)},req:function(e,t,i,r,o){var s=n.a.getDescendantProp(u.methods,e);if(void 0===s)throw"WS.req: serviceId not found";return s(t,i,r,o)},fileFormRedirect:function(e,t,i,n){return u.formRedirect(e,t,i,n,!0)},formRedirectWithPatch:function(e,t,i){return u.formRedirect(e,t,i,null,!1,!0)},formRedirect:function(e,t,i,r,o,s,a){s=void 0!==s&&s;e={data:e};return o=void 0!==o&&o,void 0!==t&&(e.action=t),"function"==typeof a?a():n.a.loading(),u.req("formSubmit",e,r,o,s).done((function(t){if(t){var r=JSON.parse(String(t).trim()).data;if("user-login"===i&&(null==r?void 0:r.token)){var o=document.getElementsByClassName("reveal-overlay")[0],s=document.getElementById("login-collaborators-trigger");o.click(),n.a.unLoadingAll(),CivAPP.ConfirmUtil.show2FAVerificationModal(r.token,e.data.user_name,(function(e){return u.processFormRedirectResponse(e,i)}),s)}else u.processFormRedirectResponse(t,i)}else u.processFormRedirectResponse(t,i)})).fail((function(t){n.a.l("fallo... en Utils.formRedirect"),n.a.l(t),"user-login"===i&&e&&e.data&&e.data.typology&&(6==e.data.typology||7==e.data.typology)?u.processFormRedirectResponse(t,i,!0):n.a.unLoadingAll()}))},processFormRedirectResponse:function(e,t,i){if(null==i||1!=i&&"true"!=i&&"1"!=i||void 0===e||"null"===e||void 0===e.responseText||null===e.responseText||""===e.responseText||(e="string"==typeof e.responseText?JSON.parse(e.responseText):e.responseText),void 0!==e){var r=void 0!==(e="object"==a(e)?e:JSON.parse(e)).messages?e.messages:[],o=void 0!==e.warnings?e.warnings:[],l=void 0!==e.errors?e.errors:[],c=void 0!==e.sucessMessages?e.sucessMessages:[],d=void 0!==e.popUp&&null!==e.popUp&&""!==e.popUp?e.popUp:null,f=void 0!==e.agency&&null!==e.agency&&""!==e.agency?e.agency:"",h=e.action,p=e.reqid,v=0===r.length&&0===o.length&&0===l.length&&0===c.length&&null===d;if("user-register"===t&&void 0!==e.newUser&&(h=n.a.addParam("newUser",e.newUser,h)),"user-register"===t&&void 0!==e.activation&&(h=n.a.addParam("activation",e.activation,h)),void 0===p&&(p=n.a.getParam("reqid")),v&&void 0!==h&&void 0!==p&&""!==p)h=h.replace(/\/$/,""),h=n.a.addParam("reqid",p,h),document.location=h;else if(v&&void 0!==h)document.location=h;else if(v)n.a.l("Error en formRedirect; datos de respuesta incorrectos"),n.a.unLoadingAll();else{if(void 0!==CivAPP.Forms&&null!==CivAPP.Forms&&null!=i&&(1==i||"true"==i||"1"==i)){var g=$("#".concat(t));Object(s.vb)(e,g),CivAPP.Forms.updateMessages(e,g),Object(s.I)(g,g.hasClass("js-hide-form"),l)}n.a.unLoadingAll(),null!==d&&u.methods.popUpError(d,f,h,t)}}else{$("body").hasClass("_multiple-submit")?$("#".concat(t)).addClass("_submitted"):n.a.unLoadingAll();var m=function(){};if(void 0!==$("#".concat(t)).attr("data-success-callback")&&null!==$("#".concat(t)).attr("data-success-callback")&&""!==$("#".concat(t)).attr("data-success-callback")&&(m=function(){window.location=$("#".concat(t)).attr("data-success-callback")}),$("body").hasClass("_multiple-submit")){var _=$("form.js-conditional-inputs.js-modal-submit"),y=$(_).filter("._submitted");_.length==y.length&&(n.a.unLoadingAll(),$("body").removeClass("_multiple-submit"),$(_).removeClass("_submitted"),m())}else CivAPP.ConfirmUtil.showSuccess({title:n.a.tr("successMessage"),message:"",closeCallback:m})}}};t.a=u},,,function(e,t,i){var n,r,o,s,a;n=i(114),r=i(99).utf8,o=i(115),s=i(99).bin,(a=function(e,t){e.constructor==String?e=t&&"binary"===t.encoding?s.stringToBytes(e):r.stringToBytes(e):o(e)?e=Array.prototype.slice.call(e,0):Array.isArray(e)||e.constructor===Uint8Array||(e=e.toString());for(var i=n.bytesToWords(e),l=8*e.length,c=1732584193,u=-271733879,d=-1732584194,f=271733878,h=0;h<i.length;h++)i[h]=16711935&(i[h]<<8|i[h]>>>24)|4278255360&(i[h]<<24|i[h]>>>8);i[l>>>5]|=128<<l%32,i[14+(l+64>>>9<<4)]=l;var p=a._ff,v=a._gg,g=a._hh,m=a._ii;for(h=0;h<i.length;h+=16){var _=c,y=u,b=d,E=f;c=p(c,u,d,f,i[h+0],7,-680876936),f=p(f,c,u,d,i[h+1],12,-389564586),d=p(d,f,c,u,i[h+2],17,606105819),u=p(u,d,f,c,i[h+3],22,-1044525330),c=p(c,u,d,f,i[h+4],7,-176418897),f=p(f,c,u,d,i[h+5],12,1200080426),d=p(d,f,c,u,i[h+6],17,-1473231341),u=p(u,d,f,c,i[h+7],22,-45705983),c=p(c,u,d,f,i[h+8],7,1770035416),f=p(f,c,u,d,i[h+9],12,-1958414417),d=p(d,f,c,u,i[h+10],17,-42063),u=p(u,d,f,c,i[h+11],22,-1990404162),
1c=p(c,u,d,f,i[h+12],7,1804603682),f=p(f,c,u,d,i[h+13],12,-40341101),d=p(d,f,c,u,i[h+14],17,-1502002290),c=v(c,u=p(u,d,f,c,i[h+15],22,1236535329),d,f,i[h+1],5,-165796510),f=v(f,c,u,d,i[h+6],9,-1069501632),d=v(d,f,c,u,i[h+11],14,643717713),u=v(u,d,f,c,i[h+0],20,-373897302),c=v(c,u,d,f,i[h+5],5,-701558691),f=v(f,c,u,d,i[h+10],9,38016083),d=v(d,f,c,u,i[h+15],14,-660478335),u=v(u,d,f,c,i[h+4],20,-405537848),c=v(c,u,d,f,i[h+9],5,568446438),f=v(f,c,u,d,i[h+14],9,-1019803690),d=v(d,f,c,u,i[h+3],14,-187363961),u=v(u,d,f,c,i[h+8],20,1163531501),c=v(c,u,d,f,i[h+13],5,-1444681467),f=v(f,c,u,d,i[h+2],9,-51403784),d=v(d,f,c,u,i[h+7],14,1735328473),c=g(c,u=v(u,d,f,c,i[h+12],20,-1926607734),d,f,i[h+5],4,-378558),f=g(f,c,u,d,i[h+8],11,-2022574463),d=g(d,f,c,u,i[h+11],16,1839030562),u=g(u,d,f,c,i[h+14],23,-35309556),c=g(c,u,d,f,i[h+1],4,-1530992060),f=g(f,c,u,d,i[h+4],11,1272893353),d=g(d,f,c,u,i[h+7],16,-155497632),u=g(u,d,f,c,i[h+10],23,-1094730640),c=g(c,u,d,f,i[h+13],4,681279174),f=g(f,c,u,d,i[h+0],11,-358537222),d=g(d,f,c,u,i[h+3],16,-722521979),u=g(u,d,f,c,i[h+6],23,76029189),c=g(c,u,d,f,i[h+9],4,-640364487),f=g(f,c,u,d,i[h+12],11,-421815835),d=g(d,f,c,u,i[h+15],16,530742520),c=m(c,u=g(u,d,f,c,i[h+2],23,-995338651),d,f,i[h+0],6,-198630844),f=m(f,c,u,d,i[h+7],10,1126891415),d=m(d,f,c,u,i[h+14],15,-1416354905),u=m(u,d,f,c,i[h+5],21,-57434055),c=m(c,u,d,f,i[h+12],6,1700485571),f=m(f,c,u,d,i[h+3],10,-1894986606),d=m(d,f,c,u,i[h+10],15,-1051523),u=m(u,d,f,c,i[h+1],21,-2054922799),c=m(c,u,d,f,i[h+8],6,1873313359),f=m(f,c,u,d,i[h+15],10,-30611744),d=m(d,f,c,u,i[h+6],15,-1560198380),u=m(u,d,f,c,i[h+13],21,1309151649),c=m(c,u,d,f,i[h+4],6,-145523070),f=m(f,c,u,d,i[h+11],10,-1120210379),d=m(d,f,c,u,i[h+2],15,718787259),u=m(u,d,f,c,i[h+9],21,-343485551),c=c+_>>>0,u=u+y>>>0,d=d+b>>>0,f=f+E>>>0}return n.endian([c,u,d,f])})._ff=function(e,t,i,n,r,o,s){var a=e+(t&i|~t&n)+(r>>>0)+s;return(a<<o|a>>>32-o)+t},a._gg=function(e,t,i,n,r,o,s){var a=e+(t&n|i&~n)+(r>>>0)+s;return(a<<o|a>>>32-o)+t},a._hh=function(e,t,i,n,r,o,s){var a=e+(t^i^n)+(r>>>0)+s;return(a<<o|a>>>32-o)+t},a._ii=function(e,t,i,n,r,o,s){var a=e+(i^(t|~n))+(r>>>0)+s;return(a<<o|a>>>32-o)+t},a._blocksize=16,a._digestsize=16,e.exports=function(e,t){if(null==e)throw new Error("Illegal argument "+e);var i=n.wordsToBytes(a(e,t));return t&&t.asBytes?i:t&&t.asString?s.bytesToString(i):n.bytesToHex(i)}},,,,,,,,function(e,t){var i,n;i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n={rotl:function(e,t){return e<<t|e>>>32-t},rotr:function(e,t){return e<<32-t|e>>>t},endian:function(e){if(e.constructor==Number)return 16711935&n.rotl(e,8)|4278255360&n.rotl(e,24);for(var t=0;t<e.length;t++)e[t]=n.endian(e[t]);return e},randomBytes:function(e){for(var t=[];e>0;e--)t.push(Math.floor(256*Math.random()));return t},bytesToWords:function(e){for(var t=[],i=0,n=0;i<e.length;i++,n+=8)t[n>>>5]|=e[i]<<24-n%32;return t},wordsToBytes:function(e){for(var t=[],i=0;i<32*e.length;i+=8)t.push(e[i>>>5]>>>24-i%32&255);return t},bytesToHex:function(e){for(var t=[],i=0;i<e.length;i++)t.push((e[i]>>>4).toString(16)),t.push((15&e[i]).toString(16));return t.join("")},hexToBytes:function(e){for(var t=[],i=0;i<e.length;i+=2)t.push(parseInt(e.substr(i,2),16));return t},bytesToBase64:function(e){for(var t=[],n=0;n<e.length;n+=3)for(var r=e[n]<<16|e[n+1]<<8|e[n+2],o=0;o<4;o++)8*n+6*o<=8*e.length?t.push(i.charAt(r>>>6*(3-o)&63)):t.push("=");return t.join("")},base64ToBytes:function(e){e=e.replace(/[^A-Z0-9+\/]/gi,"");for(var t=[],n=0,r=0;n<e.length;r=++n%4)0!=r&&t.push((i.indexOf(e.charAt(n-1))&Math.pow(2,-2*r+8)-1)<<2*r|i.indexOf(e.charAt(n))>>>6-2*r);return t}},e.exports=n},function(e,t){function i(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)} 2/*! 3 * Determine if an object is a Buffer 4 * 5 * @author Feross Aboukhadijeh <https://feross.org> 6 * @license MIT 7 */ 8e.exports=function(e){return null!=e&&(i(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&i(e.slice(0,0))}(e)||!!e._isBuffer)}},function(e,t,i){var n;void 0===(n=function(){return function(){var e=i;e.Integer={type:"integer"};var t={String:String,Boolean:Boolean,Number:Number,Object:Object,Array:Array,Date:Date};function i(e,t){return i(e,t,{changing:!1})}e.validate=i,e.checkPropertyChange=function(e,t,n){return i(e,t,{changing:n||"property"})};var i=e._validate=function(e,i,n){n||(n={});var r=n.changing;function o(e){return e.type||t[e.name]==e&&e.name.toLowerCase()}var s=[];function a(e,t,i,l){var c;function u(e){s.push({property:i,message:e})}if(i+=i?"number"==typeof l?"["+l+"]":void 0===l?"":"."+l:l,("object"!=typeof t||t instanceof Array)&&(i||"function"!=typeof t)&&(!t||!o(t)))return"function"==typeof t?e instanceof t||u("is not an instance of the class/constructor "+t.name):t&&u("Invalid schema/property definition "+t),null;function d(e,t){if(e){if(!("string"!=typeof e||"any"==e||("null"==e?null===t:typeof t==e)||t instanceof Array&&"array"==e||t instanceof Date&&"date"==e||"integer"==e&&t%1==0))return[{property:i,message:t+" - "+typeof t+" value found, but a "+e+" is required"}];if(e instanceof Array){for(var n=[],r=0;r<e.length&&(n=d(e[r],t)).length;r++);if(n.length)return n}else if("object"==typeof e){var o=s;
8s=[],a(t,e,i);var l=s;return s=o,l}}return[]}if(r&&t.readonly&&u("is a readonly field, it can not be changed"),t.extends&&a(e,t.extends,i,l),void 0===e)t.required&&u("is missing and it is required");else if(s=s.concat(d(o(t),e)),t.disallow&&!d(t.disallow,e).length&&u(" disallowed value was matched"),null!==e){if(e instanceof Array){if(t.items){var f=t.items instanceof Array,h=t.items;for(l=0,c=e.length;l<c;l+=1)f&&(h=t.items[l]),n.coerce&&(e[l]=n.coerce(e[l],h)),s.concat(a(e[l],h,i,l))}t.minItems&&e.length<t.minItems&&u("There must be a minimum of "+t.minItems+" in the array"),t.maxItems&&e.length>t.maxItems&&u("There must be a maximum of "+t.maxItems+" in the array")}else(t.properties||t.additionalProperties)&&s.concat(function(e,t,i,o){if("object"==typeof t)for(var l in("object"!=typeof e||e instanceof Array)&&s.push({property:i,message:"an object is required"}),t)if(t.hasOwnProperty(l)&&"__proto__"!=l&&"constructor"!=l){var c=e.hasOwnProperty(l)?e[l]:void 0;if(void 0===c&&n.existingOnly)continue;var u=t[l];void 0===c&&u.default&&(c=e[l]=u.default),n.coerce&&l in e&&(c=e[l]=n.coerce(c,u)),a(c,u,i,l)}for(l in e){if(e.hasOwnProperty(l)&&("_"!=l.charAt(0)||"_"!=l.charAt(1))&&t&&!t[l]&&!1===o){if(n.filter){delete e[l];continue}s.push({property:i,message:"The property "+l+" is not defined in the schema and the schema does not allow additional properties"})}var d=t&&t[l]&&t[l].requires;!d||d in e||s.push({property:i,message:"the presence of the property "+l+" requires that "+d+" also be present"}),c=e[l],!o||t&&"object"==typeof t&&l in t||(n.coerce&&(c=e[l]=n.coerce(c,o)),a(c,o,i,l)),!r&&c&&c.$schema&&(s=s.concat(a(c,c.$schema,i,l)))}return s}(e,t.properties,i,t.additionalProperties));if(t.pattern&&"string"==typeof e&&!e.match(t.pattern)&&u("does not match the regex pattern "+t.pattern),t.maxLength&&"string"==typeof e&&e.length>t.maxLength&&u("may only be "+t.maxLength+" characters long"),t.minLength&&"string"==typeof e&&e.length<t.minLength&&u("must be at least "+t.minLength+" characters long"),void 0!==t.minimum&&typeof e==typeof t.minimum&&t.minimum>e&&u("must have a minimum value of "+t.minimum),void 0!==t.maximum&&typeof e==typeof t.maximum&&t.maximum<e&&u("must have a maximum value of "+t.maximum),t.enum){var p,v=t.enum;c=v.length;for(var g=0;g<c;g++)if(v[g]===e){p=1;break}p||u("does not have a value in the enumeration "+v.join(", "))}"number"==typeof t.maxDecimal&&e.toString().match(new RegExp("\\.[0-9]{"+(t.maxDecimal+1)+",}"))&&u("may only have "+t.maxDecimal+" digits of decimal places")}return null}return i&&a(e,i,"",r||""),!r&&e&&e.$schema&&a(e,e.$schema,"",""),{valid:!s.length,errors:s}};return e.mustBeValid=function(e){if(!e.valid)throw new TypeError(e.errors.map((function(e){return"for property "+e.property+": "+e.message})).join(", \n"))},e}()}.apply(t,[]))||(e.exports=n)},function(e,t,i){!function(){const t=e=>(new TextEncoder).encode(e);function i(e,i){let n,r,o,s,a,l,c,u;for("string"==typeof e&&(e=t(e)),n=3&e.length,r=e.length-n,o=i,a=3432918353,l=461845907,u=0;u<r;)c=255&e[u]|(255&e[++u])<<8|(255&e[++u])<<16|(255&e[++u])<<24,++u,c=(65535&c)*a+(((c>>>16)*a&65535)<<16)&4294967295,c=c<<15|c>>>17,c=(65535&c)*l+(((c>>>16)*l&65535)<<16)&4294967295,o^=c,o=o<<13|o>>>19,s=5*(65535&o)+((5*(o>>>16)&65535)<<16)&4294967295,o=27492+(65535&s)+((58964+(s>>>16)&65535)<<16);switch(c=0,n){case 3:c^=(255&e[u+2])<<16;case 2:c^=(255&e[u+1])<<8;case 1:c^=255&e[u],c=(65535&c)*a+(((c>>>16)*a&65535)<<16)&4294967295,c=c<<15|c>>>17,c=(65535&c)*l+(((c>>>16)*l&65535)<<16)&4294967295,o^=c}return o^=e.length,o^=o>>>16,o=2246822507*(65535&o)+((2246822507*(o>>>16)&65535)<<16)&4294967295,o^=o>>>13,o=3266489909*(65535&o)+((3266489909*(o>>>16)&65535)<<16)&4294967295,o^=o>>>16,o>>>0}const n=i;n.v2=function(e,i){"string"==typeof e&&(e=t(e));let n,r=e.length,o=i^r,s=0;for(;r>=4;)n=255&e[s]|(255&e[++s])<<8|(255&e[++s])<<16|(255&e[++s])<<24,n=1540483477*(65535&n)+((1540483477*(n>>>16)&65535)<<16),n^=n>>>24,n=1540483477*(65535&n)+((1540483477*(n>>>16)&65535)<<16),o=1540483477*(65535&o)+((1540483477*(o>>>16)&65535)<<16)^n,r-=4,++s;switch(r){case 3:o^=(255&e[s+2])<<16;case 2:o^=(255&e[s+1])<<8;case 1:o^=255&e[s],o=1540483477*(65535&o)+((1540483477*(o>>>16)&65535)<<16)}return o^=o>>>13,o=1540483477*(65535&o)+((1540483477*(o>>>16)&65535)<<16),o^=o>>>15,o>>>0},n.v3=i,e.exports=n}()},function(e,t,i){var n;!function(r,o){"use strict";var s="model",a="name",l="type",c="vendor",u="version",d="mobile",f="tablet",h="smarttv",p=function(e){for(var t={},i=0;i<e.length;i++)t[e[i].toUpperCase()]=e[i];return t},v=function(e,t){return"string"==typeof e&&-1!==g(t).indexOf(g(e))},g=function(e){return e.toLowerCase()},m=function(e,t){if("string"==typeof e)return e=e.replace(/^\s\s*/,""),void 0===t?e:e.substring(0,500)},_=function(e,t){for(var i,n,r,o,s,a,l=0;l<t.length&&!s;){var c=t[l],u=t[l+1];for(i=n=0;i<c.length&&!s&&c[i];)if(s=c[i++].exec(e))for(r=0;r<u.length;r++)a=s[++n],"object"==typeof(o=u[r])&&o.length>0?2===o.length?"function"==typeof o[1]?this[o[0]]=o[1].call(this,a):this[o[0]]=o[1]:3===o.length?"function"!=typeof o[1]||o[1].exec&&o[1].test?this[o[0]]=a?a.replace(o[
vendor: 4,865 bytes, line 8
81],o[2]):void 0:this[o[0]]=a?o[1].call(this,a,o[2]):void 0:4===o.length&&(this[o[0]]=a?o[3].call(this,a.replace(o[1],o[2])):void 0):this[o]=a||void 0;l+=2}},y=function(e,t){for(var i in t)if("object"==typeof t[i]&&t[i].length>0){for(var n=0;n<t[i].length;n++)if(v(t[i][n],e))return"?"===i?void 0:i}else if(v(t[i],e))return"?"===i?void 0:i;return e},b={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},E={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[u,[a,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[u,[a,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[a,u],[/opios[\/ ]+([\w\.]+)/i],[u,[a,"Opera Mini"]],[/\bopr\/([\w\.]+)/i],[u,[a,"Opera"]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[u,[a,"Baidu"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim)\s?(?:browser)?[\/ ]?([\w\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(heytap|ovi)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[a,u],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[u,[a,"UCBrowser"]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[u,[a,"WeChat"]],[/konqueror\/([\w\.]+)/i],[u,[a,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[u,[a,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[u,[a,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[u,[a,"Smart Lenovo Browser"]],[/(avast|avg)\/([\w\.]+)/i],[[a,/(.+)/,"$1 Secure Browser"],u],[/\bfocus\/([\w\.]+)/i],[u,[a,"Firefox Focus"]],[/\bopt\/([\w\.]+)/i],[u,[a,"Opera Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[u,[a,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[u,[a,"Dolphin"]],[/coast\/([\w\.]+)/i],[u,[a,"Opera Coast"]],[/miuibrowser\/([\w\.]+)/i],[u,[a,"MIUI Browser"]],[/fxios\/([-\w\.]+)/i],[u,[a,"Firefox"]],[/\bqihu|(qi?ho?o?|360)browser/i],[[a,"360 Browser"]],[/(oculus|sailfish|huawei|vivo)browser\/([\w\.]+)/i],[[a,/(.+)/,"$1 Browser"],u],[/samsungbrowser\/([\w\.]+)/i],[u,[a,"Samsung Internet"]],[/(comodo_dragon)\/([\w\.]+)/i],[[a,/_/g," "],u],[/metasr[\/ ]?([\d\.]+)/i],[u,[a,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[a,"Sogou Mobile"],u],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345Explorer)[\/ ]?([\w\.]+)/i],[a,u],[/(lbbrowser)/i,/\[(linkedin)app\]/i],[a],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[a,"Facebook"],u],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[a,u],[/\bgsa\/([\w\.]+) .*safari\//i],[u,[a,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[u,[a,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[u,[a,"Chrome Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[a,"Chrome WebView"],u],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[u,[a,"Android Browser"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[a,u],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[u,[a,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[u,a],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[a,[u,y,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[a,u],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[a,"Netscape"],u],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[u,[a,"Firefox Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i,/panasonic;(viera)/i],[a,u],[/(cobalt)\/([\w\.]+)/i],[a,[u,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[["architecture","amd64"]],[/(ia32(?=;))/i],[["architecture",g]],[/((?:i[346]|x)86)[;\)]/i],[["architecture","ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[["architecture","arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[["architecture","armhf"]],[/windows (ce|mobile); ppc;/i],[["architecture","arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[["architecture",/ower/,"",g]],[/(sun4\w)[;\)]/i],[["architecture","sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;
8|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[["architecture",g]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[s,[c,"Samsung"],[l,f]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[s,[c,"Samsung"],[l,d]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[s,[c,"Apple"],[l,d]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[s,[c,"Apple"],[l,f]],[/(macintosh);/i],[s,[c,"Apple"]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[s,[c,"Sharp"],[l,d]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[s,[c,"Huawei"],[l,f]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[s,[c,"Huawei"],[l,d]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[s,/_/g," "],[c,"Xiaomi"],[l,d]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[s,/_/g," "],[c,"Xiaomi"],[l,f]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[s,[c,"OPPO"],[l,d]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[s,[c,"Vivo"],[l,d]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[s,[c,"Realme"],[l,d]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[s,[c,"Motorola"],[l,d]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[s,[c,"Motorola"],[l,f]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[s,[c,"LG"],[l,f]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[s,[c,"LG"],[l,d]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[s,[c,"Lenovo"],[l,f]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[s,/_/g," "],[c,"Nokia"],[l,d]],[/(pixel c)\b/i],[s,[c,"Google"],[l,f]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[s,[c,"Google"],[l,d]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[s,[c,"Sony"],[l,d]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[s,"Xperia Tablet"],[c,"Sony"],[l,f]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[s,[c,"OnePlus"],[l,d]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[s,[c,"Amazon"],[l,f]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[s,/(.+)/g,"Fire Phone $1"],[c,"Amazon"],[l,d]],[/(playbook);[-\w\),; ]+(rim)/i],[s,c,[l,f]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[s,[c,"BlackBerry"],[l,d]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[s,[c,"ASUS"],[l,f]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[s,[c,"ASUS"],[l,d]],[/(nexus 9)/i],[s,[c,"HTC"],[l,f]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[c,[s,/_/g," "],[l,d]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[s,[c,"Acer"],[l,f]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[s,[c,"Meizu"],[l,d]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[s,[c,"Ulefone"],[l,d]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[c,s,[l,d]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[c,s,[l,f]],[/(surface duo)/i],[s,[c,"Microsoft"],[l,f]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[s,[c,"Fairphone"],[l,d]],[/(u304aa)/i],[s,[c,"AT&T"],[l,d]],[/\bsie-(\w*)/i],[s,[c,"Siemens"],[l,d]],[/\b(rct\w+) b/i],[s,[c,"RCA"],[l,f]],[/\b(venue[\d ]{2,7}) b/i],[s,[c,"Dell"],[l,f]],[/\b(q(?:mv|ta)\w+) b/i],[s,[c,"Verizon"],[l,f]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[s,[c,"Barnes & Noble"],[l,f]],[/\b(tm\d{3}\w+) b/i],[s,[c,"NuVision"],[l,f]],[/\b(k88) b/i],[s,[c,"ZTE"],[l,f]],[/\b(nx\d{3}j) b/i],[s,[c,"ZTE"],[l,d]],[/\b(gen\d{3}) b.+49h/i],[s,[c,"Swiss"],[l,d]],[/\b(zur\d{3}) b/i],[s,[c,"Swiss"],[l,f]],[/\b((zeki)?tb.*\b) b/i],[s,[c,"Zeki"],[l,f]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[c,"Dragon Touch"],s,[l,f]],[/\b(ns-?\w{0,9}) b/i],[s,[c,"Insignia"],[l,f]],[/\b((nxa|next)-?\w{0,9}) b/i],[s,[c,"NextBook"],[l,f]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[c,"Voice"],s,[l,d]],[/\b(lvtel\-)?(v1[12]) b/i],[[c,"LvTel"],s,[l,d]],[/\b(ph-1) /i],[s,[c,"Essential"],[l,d]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[s,[c,"Envizen"],[l,f]],[/\b(trio[-\w\. ]+) b/i],[s,[c,"MachSpeed"],[l,f]],[/\btu_(1491) b/i],[s,[c,"Rotor"],[l,f]],[/(shield[\w ]+) b/i],[s,[c,"Nvidia"],[l,f]],[/(sprint) (\w+)/i],[c,s,[l,d]],[/(kin\.[onetw]{3})/i],[[s,/\./g," "],[c,"Microsoft"],[l,d]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[s,[c,"Zebra"],[l,f]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[s,[c,"Zebra"],[l,d]],[/smart-tv.+(samsung)/i],[c,[l,h]],[/hbbtv.+maple;(\d+)/i],[[s,/^/,"SmartTV"],[c,"Samsung"],[l,h]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[c,"LG"],[l,h]],[/(apple) ?tv/i],[c,[s,"Apple TV"],[l,h]],[/crkey/i],[[s,"Chromecast"],[c,"Google"],[l,h]],[/droid.+aft(\w+)( bui|\))/i],[s,[c,"Amazon"],[l,h]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[s,[c,"Sharp"],[l,h]],[/(bravia[\w ]+)( bui|\))/i],[s,[c,"Sony"],[l,h]],[/(mitv-\w{5}) bui/i],[s,[c,"Xiaomi"],[l,h]],[/Hbbtv.*(technisat) (.*);/i],[c,s,[l,h]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[c,m],[s,m],[l,h]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[l,h]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[c,s,[l,"console"]],[/droid.+; (shield) bui/i],[s,[c,"Nvidia"],[l,"console"]],[/(playstation [345portablevi]+)/i],[s,[c,"Sony"],[l,"console"]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[s,[c,"Microsoft"],[l,"console"]],[/((pebble))app/i],[c,s,[l,"wearable"]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[s,[c,"Apple"],[l,"wearable"]],[/droid.+; (glass) \d/i],[s,[c,"Google"],[l,"wearable"]],[/droid.+; (wt63?0{2,3})\)/i],[s,[c,"Zebra"],[l,"wearable"]],[/(quest( 2| pro)?)/i],[s,[c,"Facebook"],[l,"wearable"]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[c,[l,"embedded"]],[/(aeobc)\b/i],[s,[c,"Amazon"],[l,"embedded"]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[s,[l,d]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[s,[l,f]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[l,f]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[l,d]],[/(android[-\w\. ]{0,9});.+buil/i],[s,[c,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[u,[a,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[u,[a,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[a,u],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[u,a]],os:[[/microsoft (windows) (vista|xp)/i],[a,u],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[a,[u,y,b]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[u,y,b],[a,"Windows"]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[u,/_/g,"."],[a,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[a,"Mac OS"],[u,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[u,a],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[a,u],[/\(bb(10);/i],[u,[a,"BlackBerry"]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[u,[a,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[u,[a,"Firefox OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[u,[a,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[u,[a,"watchOS"]],[/crkey\/([\d\.]+)/i],[u,[a,"Chromecast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[a,"Chromium OS"],u],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[a,u],[/(sunos) ?([\w\.\d]*)/i],[[a,"Solaris"],u],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[a,u]]},w=function(e,t){if("object"==typeof e&&(t=e,e=void 0),!(this instanceof w))return new w(e,t).getResult();var i=void 0!==r&&r.navigator?r.navigator:void 0,n=e||(i&&i.userAgent?i.userAgent:""),o=i&&i.userAgentData?i.userAgentData:void 0,s=t?function(e,t){var i={};for(var n in e)t[n]&&t[n].length%2==0?i[n]=t[n].concat(e[n]):i[n]=e[n];return i}(E,t):E,a=i&&i.userAgent==n;return this.getBrowser=function(){var e,t={};return t.name=void 0,t.version=void 0,_.call(t,n,s.browser),t.major="string"==typeof(e=t.version)?e.replace(/[^\d\.]/g,"").split(".")[0]:void 0,a&&i&&i.brave&&"function"==typeof i.brave.isBrave&&(t.name="Brave"),t},this.getCPU=function(){var e={architecture:void 0};return _.call(e,n,s.cpu),e},this.getDevice=function(){var e={vendor:void 0,model:void 0,type:void 0};return _.call(e,n,s.device),a&&!e.type&&o&&o.mobile&&(e.type=d),a&&"Macintosh"==e.model&&i&&void 0!==i.standalone&&i.maxTouchPoints&&i.maxTouchPoints>2&&(e.model="iPad",e.type=f),e},this.getEngine=function(){var e={name:void 0,version:void 0};return _.call(e,n,s.engine),e},this.getOS=function(){var e={name:void 0,version:void 0};return _.call(e,n,s.os),a&&!e.name&&o&&"Unknown"!=o.platform&&(e.name=o.platform.replace(/chrome os/i,"Chromium OS").replace(/macos/i,"Mac OS")),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return n},this.setUA=function(e){return n="string"==typeof e&&e.length>500?m(e,500):e,this},this.setUA(n),this};w.VERSION="1.0.37",w.BROWSER=p([a,u,"major"]),w.CPU=p(["architecture"]),w.DEVICE=p([s,c,l,"console",d,h,f,"wearable","embedded"]),w.ENGINE=w.OS=p([a,u]),void 0!==t?(void 0!==e&&e.exports&&(t=e.exports=w),t.UAParser=w):i(119)?void 0===(n=function(){return w}.call(t,i,t,e))||(e.exports=n):void 0!==r&&(r.UAParser=w);var I=void 0!==r&&(r.jQuery||r.Zepto);if(I&&!I.ua){var O=new w;I.ua=O.getResult(),I.ua.get=function(){return O.getUA()},I.ua.set=function(e){O.setUA(e);var t=O.getResult();for(var i in t)I.ua[i]=t[i]}}}("object"==typeof window?window:this)},function(e,t){(function(t){e.exports=t}).call(this,{})},,,,,,function(e,t,i){"use strict";let n;i.r(t);
vendor: 4,295 bytes, line 8
8const r=new Uint8Array(16);function o(){if(!n&&(n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!n))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return n(r)}var s=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;var a=function(e){return"string"==typeof e&&s.test(e)};const l=[];for(let e=0;e<256;++e)l.push((e+256).toString(16).slice(1));function c(e,t=0){return l[e[t+0]]+l[e[t+1]]+l[e[t+2]]+l[e[t+3]]+"-"+l[e[t+4]]+l[e[t+5]]+"-"+l[e[t+6]]+l[e[t+7]]+"-"+l[e[t+8]]+l[e[t+9]]+"-"+l[e[t+10]]+l[e[t+11]]+l[e[t+12]]+l[e[t+13]]+l[e[t+14]]+l[e[t+15]]}var u=function(e,t=0){const i=c(e,t);if(!a(i))throw TypeError("Stringified UUID is invalid");return i};let d,f,h=0,p=0;var v=function(e,t,i){let n=t&&i||0;const r=t||new Array(16);let s=(e=e||{}).node||d,a=void 0!==e.clockseq?e.clockseq:f;if(null==s||null==a){const t=e.random||(e.rng||o)();null==s&&(s=d=[1|t[0],t[1],t[2],t[3],t[4],t[5]]),null==a&&(a=f=16383&(t[6]<<8|t[7]))}let l=void 0!==e.msecs?e.msecs:Date.now(),u=void 0!==e.nsecs?e.nsecs:p+1;const v=l-h+(u-p)/1e4;if(v<0&&void 0===e.clockseq&&(a=a+1&16383),(v<0||l>h)&&void 0===e.nsecs&&(u=0),u>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");h=l,p=u,f=a,l+=122192928e5;const g=(1e4*(268435455&l)+u)%4294967296;r[n++]=g>>>24&255,r[n++]=g>>>16&255,r[n++]=g>>>8&255,r[n++]=255&g;const m=l/4294967296*1e4&268435455;r[n++]=m>>>8&255,r[n++]=255&m,r[n++]=m>>>24&15|16,r[n++]=m>>>16&255,r[n++]=a>>>8|128,r[n++]=255&a;for(let e=0;e<6;++e)r[n+e]=s[e];return t||c(r)};var g=function(e){if(!a(e))throw TypeError("Invalid UUID");let t;const i=new Uint8Array(16);return i[0]=(t=parseInt(e.slice(0,8),16))>>>24,i[1]=t>>>16&255,i[2]=t>>>8&255,i[3]=255&t,i[4]=(t=parseInt(e.slice(9,13),16))>>>8,i[5]=255&t,i[6]=(t=parseInt(e.slice(14,18),16))>>>8,i[7]=255&t,i[8]=(t=parseInt(e.slice(19,23),16))>>>8,i[9]=255&t,i[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,i[11]=t/4294967296&255,i[12]=t>>>24&255,i[13]=t>>>16&255,i[14]=t>>>8&255,i[15]=255&t,i};function m(e,t,i){function n(e,n,r,o){var s;if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));const t=[];for(let i=0;i<e.length;++i)t.push(e.charCodeAt(i));return t}(e)),"string"==typeof n&&(n=g(n)),16!==(null===(s=n)||void 0===s?void 0:s.length))throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let a=new Uint8Array(16+e.length);if(a.set(n),a.set(e,n.length),a=i(a),a[6]=15&a[6]|t,a[8]=63&a[8]|128,r){o=o||0;for(let e=0;e<16;++e)r[o+e]=a[e];return r}return c(a)}try{n.name=e}catch(e){}return n.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",n.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",n}function _(e){return 14+(e+64>>>9<<4)+1}function y(e,t){const i=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(i>>16)<<16|65535&i}function b(e,t,i,n,r,o){return y((s=y(y(t,e),y(n,o)))<<(a=r)|s>>>32-a,i);var s,a}function E(e,t,i,n,r,o,s){return b(t&i|~t&n,e,t,r,o,s)}function w(e,t,i,n,r,o,s){return b(t&n|i&~n,e,t,r,o,s)}function I(e,t,i,n,r,o,s){return b(t^i^n,e,t,r,o,s)}function O(e,t,i,n,r,o,s){return b(i^(t|~n),e,t,r,o,s)}var S=m("v3",48,(function(e){if("string"==typeof e){const t=unescape(encodeURIComponent(e));e=new Uint8Array(t.length);for(let i=0;i<t.length;++i)e[i]=t.charCodeAt(i)}return function(e){const t=[],i=32*e.length;for(let n=0;n<i;n+=8){const i=e[n>>5]>>>n%32&255,r=parseInt("0123456789abcdef".charAt(i>>>4&15)+"0123456789abcdef".charAt(15&i),16);t.push(r)}return t}(function(e,t){e[t>>5]|=128<<t%32,e[_(t)-1]=t;let i=1732584193,n=-271733879,r=-1732584194,o=271733878;for(let t=0;t<e.length;t+=16){const s=i,a=n,l=r,c=o;i=E(i,n,r,o,e[t],7,-680876936),o=E(o,i,n,r,e[t+1],12,-389564586),r=E(r,o,i,n,e[t+2],17,606105819),n=E(n,r,o,i,e[t+3],22,-1044525330),i=E(i,n,r,o,e[t+4],7,-176418897),o=E(o,i,n,r,e[t+5],12,1200080426),r=E(r,o,i,n,e[t+6],17,-1473231341),n=E(n,r,o,i,e[t+7],22,-45705983),i=E(i,n,r,o,e[t+8],7,1770035416),o=E(o,i,n,r,e[t+9],12,-1958414417),r=E(r,o,i,n,e[t+10],17,-42063),n=E(n,r,o,i,e[t+11],22,-1990404162),i=E(i,n,r,o,e[t+12],7,1804603682),o=E(o,i,n,r,e[t+13],12,-40341101),r=E(r,o,i,n,e[t+14],17,-1502002290),n=E(n,r,o,i,e[t+15],22,1236535329),i=w(i,n,r,o,e[t+1
8],5,-165796510),o=w(o,i,n,r,e[t+6],9,-1069501632),r=w(r,o,i,n,e[t+11],14,643717713),n=w(n,r,o,i,e[t],20,-373897302),i=w(i,n,r,o,e[t+5],5,-701558691),o=w(o,i,n,r,e[t+10],9,38016083),r=w(r,o,i,n,e[t+15],14,-660478335),n=w(n,r,o,i,e[t+4],20,-405537848),i=w(i,n,r,o,e[t+9],5,568446438),o=w(o,i,n,r,e[t+14],9,-1019803690),r=w(r,o,i,n,e[t+3],14,-187363961),n=w(n,r,o,i,e[t+8],20,1163531501),i=w(i,n,r,o,e[t+13],5,-1444681467),o=w(o,i,n,r,e[t+2],9,-51403784),r=w(r,o,i,n,e[t+7],14,1735328473),n=w(n,r,o,i,e[t+12],20,-1926607734),i=I(i,n,r,o,e[t+5],4,-378558),o=I(o,i,n,r,e[t+8],11,-2022574463),r=I(r,o,i,n,e[t+11],16,1839030562),n=I(n,r,o,i,e[t+14],23,-35309556),i=I(i,n,r,o,e[t+1],4,-1530992060),o=I(o,i,n,r,e[t+4],11,1272893353),r=I(r,o,i,n,e[t+7],16,-155497632),n=I(n,r,o,i,e[t+10],23,-1094730640),i=I(i,n,r,o,e[t+13],4,681279174),o=I(o,i,n,r,e[t],11,-358537222),r=I(r,o,i,n,e[t+3],16,-722521979),n=I(n,r,o,i,e[t+6],23,76029189),i=I(i,n,r,o,e[t+9],4,-640364487),o=I(o,i,n,r,e[t+12],11,-421815835),r=I(r,o,i,n,e[t+15],16,530742520),n=I(n,r,o,i,e[t+2],23,-995338651),i=O(i,n,r,o,e[t],6,-198630844),o=O(o,i,n,r,e[t+7],10,1126891415),r=O(r,o,i,n,e[t+14],15,-1416354905),n=O(n,r,o,i,e[t+5],21,-57434055),i=O(i,n,r,o,e[t+12],6,1700485571),o=O(o,i,n,r,e[t+3],10,-1894986606),r=O(r,o,i,n,e[t+10],15,-1051523),n=O(n,r,o,i,e[t+1],21,-2054922799),i=O(i,n,r,o,e[t+8],6,1873313359),o=O(o,i,n,r,e[t+15],10,-30611744),r=O(r,o,i,n,e[t+6],15,-1560198380),n=O(n,r,o,i,e[t+13],21,1309151649),i=O(i,n,r,o,e[t+4],6,-145523070),o=O(o,i,n,r,e[t+11],10,-1120210379),r=O(r,o,i,n,e[t+2],15,718787259),n=O(n,r,o,i,e[t+9],21,-343485551),i=y(i,s),n=y(n,a),r=y(r,l),o=y(o,c)}return[i,n,r,o]}(function(e){if(0===e.length)return[];const t=8*e.length,i=new Uint32Array(_(t));for(let n=0;n<t;n+=8)i[n>>5]|=(255&e[n/8])<<n%32;return i}(e),8*e.length))}));var A={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};var C=function(e,t,i){if(A.randomUUID&&!t&&!e)return A.randomUUID();const n=(e=e||{}).random||(e.rng||o)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){i=i||0;for(let e=0;e<16;++e)t[i+e]=n[e];return t}return c(n)};function $(e,t,i,n){switch(e){case 0:return t&i^~t&n;case 1:return t^i^n;case 2:return t&i^t&n^i&n;case 3:return t^i^n}}function T(e,t){return e<<t|e>>>32-t}var P=m("v5",80,(function(e){const t=[1518500249,1859775393,2400959708,3395469782],i=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof e){const t=unescape(encodeURIComponent(e));e=[];for(let i=0;i<t.length;++i)e.push(t.charCodeAt(i))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);const n=e.length/4+2,r=Math.ceil(n/16),o=new Array(r);for(let t=0;t<r;++t){const i=new Uint32Array(16);for(let n=0;n<16;++n)i[n]=e[64*t+4*n]<<24|e[64*t+4*n+1]<<16|e[64*t+4*n+2]<<8|e[64*t+4*n+3];o[t]=i}o[r-1][14]=8*(e.length-1)/Math.pow(2,32),o[r-1][14]=Math.floor(o[r-1][14]),o[r-1][15]=8*(e.length-1)&4294967295;for(let e=0;e<r;++e){const n=new Uint32Array(80);for(let t=0;t<16;++t)n[t]=o[e][t];for(let e=16;e<80;++e)n[e]=T(n[e-3]^n[e-8]^n[e-14]^n[e-16],1);let r=i[0],s=i[1],a=i[2],l=i[3],c=i[4];for(let e=0;e<80;++e){const i=Math.floor(e/20),o=T(r,5)+$(i,s,a,l)+c+t[i]+n[e]>>>0;c=l,l=a,a=T(s,30)>>>0,s=r,r=o}i[0]=i[0]+r>>>0,i[1]=i[1]+s>>>0,i[2]=i[2]+a>>>0,i[3]=i[3]+l>>>0,i[4]=i[4]+c>>>0}return[i[0]>>24&255,i[0]>>16&255,i[0]>>8&255,255&i[0],i[1]>>24&255,i[1]>>16&255,i[1]>>8&255,255&i[1],i[2]>>24&255,i[2]>>16&255,i[2]>>8&255,255&i[2],i[3]>>24&255,i[3]>>16&255,i[3]>>8&255,255&i[3],i[4]>>24&255,i[4]>>16&255,i[4]>>8&255,255&i[4]]}));var k=function(e){if(!a(e))throw TypeError("Invalid UUID");return parseInt(e.slice(14,15),16)};i.d(t,"v1",(function(){return v})),i.d(t,"v3",(function(){return S})),i.d(t,"v4",(function(){return C})),i.d(t,"v5",(function(){return P})),i.d(t,"NIL",(function(){return"00000000-0000-0000-0000-000000000000"})),i.d(t,"version",(function(){return k})),i.d(t,"validate",(function(){return a})),i.d(t,"stringify",(function(){return u})),i.d(t,"parse",(function(){return g}))},,function(e,t,i){"use strict";var n=i(1),r=i.n(n),o=i(0);t.a=function(e){var t,i=e.activity,n=e.className,s=void 0===n?"":n,a=e.onClick,l=o.a.tr,c=r.a.createElement(r.a.Fragment,null,r.a.createElement("div",{className:"alternative-activities-modal__image-wrapper"}
8,r.a.createElement("img",{src:i.imagePath,alt:i.title,className:"alternative-activities-modal__image"})),r.a.createElement("div",{className:"alternative-activities-modal__details"},r.a.createElement("h3",{className:"alternative-activities-modal__title"},i.title),void 0!==i.rating&&void 0!==i.totalReviews&&r.a.createElement("div",{className:"alternative-activities-modal__rating"},r.a.createElement("span",{className:"alternative-activities-modal__rating-value"},i.rating.toFixed(1)),r.a.createElement("span",{className:"alternative-activities-modal__total-reviews"},"(",i.totalReviews,")")),(null===(t=i.cancellationTexts)||void 0===t?void 0:t.show)&&r.a.createElement("p",{className:"alternative-activities-modal__cancellation",style:{color:"#008000"}},i.cancellationTexts.text),r.a.createElement("div",{className:"alternative-activities-modal__price"},l("from_string")," ",r.a.createElement("strong",null,i.minPrice,o.a.getCurrencySymbol()))));return r.a.createElement("li",{className:"alternative-activities-modal__item ".concat(s),"data-activitiesItem":i.activityIdAlt},r.a.createElement("a",{href:i.path,className:"alternative-activities-modal__link",style:{textDecoration:"none"},onClick:function(e){return null==a?void 0:a(e)}},c))}}]]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.