(window.webpackJsonp=window.webpackJsonp||[]).push([[0],[function(module,__webpack_exports__,__webpack_require__){"use strict";var _UtilsCore__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(4),lodash_debounce__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(5),lodash_debounce__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(lodash_debounce__WEBPACK_IMPORTED_MODULE_1__),md5__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(23),md5__WEBPACK_IMPORTED_MODULE_2___default=__webpack_require__.n(md5__WEBPACK_IMPORTED_MODULE_2__),_helpers_LocalStorageHandler__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(8),_shared_Optimizely_sdk_optimizelyUser__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(9),_this2=void 0,_Utils;function _createForOfIteratorHelper(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=_unsupportedIterableToArray(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach((function(t){_defineProperty(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function _defineProperty(e,t,r){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,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 r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.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 r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],l=!0,u=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function _arrayWithHoles(e){if(Array.isArray(e))return e}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)}function _construct(e,t,r){return(_construct=_isNativeReflectConstruct()?Reflect.construct.bind():function(e,t,r){var n=[null];n.push.apply(n,t);var i=new(Function.bind.apply(e,n));return r&&_setPrototypeOf(i,r.prototype),i}).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 r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_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 r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}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"},destinations:{id:"i",name:"n",url:"u",countryName:"cN",countryUrl:"cU",timeAdded:"ti"}},Utils=(_Utils={convertCivLastAObjectToShortFormat:function(e){var t=[];return e.forEach((function(e){var r={a:e.activityId,as:Utils.cloneObject(e.activityIds),d:e.destinationId,c:e.countryId,t:e.time};t.push(r)})),t},convertCivLastAObjectToLongFormat:function(e){if(0===e.length)return[];if(void 0!==e[0].activityId)return e;var t=[];return e.forEach((function(e){var r={activityId:e.a,activityIds:Utils.cloneObject(e.as),destinationId:e.d,countryId:e.c,time:e.t};t.push(r)})),t},convertCivRecentAItemToShortFormat:function(e,t){var r,n,i=recentACookieFormatMappings[t],o={};for(var a in e)r=e[a],void 0!==(n=i[a])&&("string"==typeof r&&(r=r.replace("https://www.civitatis.com","")),o[n]=r);return o},convertCivRecentAItemToLongFormat:function(e,t){var r,n=recentACookieFormatMappings[t],i={};for(var o in e)for(var a in r=e[o],n)n[a]===o&&(i[a]=r);return i},getRecentSearchObject:function(e){e="string"==typeof e?e:"civRecentA";var t={activities:[],destinations:[]},r=Utils.readCookie(e);return null!=r&&(r=$.base64.decode(decodeURIComponent(r)),Utils.isSecureHref(r)?void 0!==(r=JSON.parse(r)).activities||void 0!==r.destinations||void 0===r.a||void 0===r.d?t=r:(r.a.forEach((function(e){t.activities.push(Utils.convertCivRecentAItemToLongFormat(e,"activities"))})),r.d.forEach((function(e){t.destinations.push(Utils.convertCivRecentAItemToLongFormat(e,"destinations"))}))):Utils.deleteCookie(e)),t},isSecureHref:function(e){return-1===e.indexOf("javascript")&&-1===e.indexOf("data:text/html")},isDebug:function(){return"debug"===_UtilsCore__WEBPACK_IMPORTED_MODULE_0__.a.readCookie("debug")},isNoLog:function(){return"true"===_UtilsCore__WEBPACK_IMPORTED_MODULE_0__.a.readCookie("nolog")},l:function(e){isLocal&&!Utils.isNoLog()&&console.log(e)},alerta:function(e){isAlert?alert(e):Utils.l("alert ---\x3e"+e)},la:function(e){null!=_UtilsCore__WEBPACK_IMPORTED_MODULE_0__.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 r=Utils.cloneObject(Utils.serializedToObject(e.serializeArray()));return t&&(r=Utils.replaceCopyFormData(r)),r},elemToDataObject:function(e,t){t=void 0===t||null!==t||1==t||"true"==t||"1"==t;var r=Utils.serializedToObject(e.serializeArray());return t&&(r=Utils.replaceCopyFormData(r)),r},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,r){e.splice(r,0,t)},insertItemIntoArrayOrdered:function(e,t,r){e.push(t),e.sort((function(e,t){return t[r]-e[r]}))},removeItemFromArray:function(e,t){e.splice(t,1)},orderObject:function(e){var t={};return Object.keys(e).sort().forEach((function(r){t[r]=e[r]})),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 r in t)e[r]=t[r]},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 r=e.attr("id");return void 0!==r&&!1!==r||(r=Utils.generateId(t),e.attr("id",r)),r},getById:function(e,t){e=e.toString();for(var r=0;r<t.length;r++)if(void 0!==t[r].id&&null!==t[r].id&&t[r].id.toString()===e)return t[r]},getByKey:function(e,t,r){for(var n=0;n<r.length;n++)if(void 0!==r[n][e]&&null!==r[n][e]&&r[n][e].toString()===t)return r[n]},getNumberOfKeys:function(e){var t=0;for(var r in e)t++;return t},copyProp:function(e,t,r,n){void 0!==e&&void 0!==t&&(void 0!==e[r]?t[r]=e[r]:void 0!==n&&(t[r]=n))},pad:function(e,t){var r="000000000"+e;return r.substr(r.length-t)},capitalizeFirst:function(e){return e[0].toUpperCase()+e.slice(1)},replaceAll:function(e,t,r){r=void 0!==r?r:"";var n=e.replace(new RegExp(t,"g"),r);return-1===n.indexOf(t)?n:Utils.replaceAll(n,t,r)},getMoment:function(e,t,r){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!=r&&"boolean"==typeof r?moment(e,t,r):moment(e,t);else{var i=e.split(/\-|\s|:/).map((function(e,t){return 1==t?parseInt(e)-1:parseInt(e)}));n=moment(_construct(Date,_toConsumableArray(i)))}}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("/"),r=Utils.tr("timeFormats.datePickerFormat").split("/"),n=r.indexOf("YYYY"),i=r.indexOf("MM"),o=r.indexOf("DD");return t[n]+"-"+t[i]+"-"+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 r=new Date(e);return r.setDate(r.getDate()+t),r},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],r=e.split(":")[1],n=e.split(":")[2];void 0===n&&(n="00");var i=[];return i.push(Utils.pad(t,2)),i.push(Utils.pad(r,2)),i.push(Utils.pad(n,2)),i.join(":")},getLocale:function(){var e=void 0!==window.civLocale&&""!==window.civLocale?window.civLocale:Utils.getLocaleFromHtmlAttr();return void 0!==e&&""!==e||(e="es"),e},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,r){e=Utils.getNumberFormatLocale(e);var n=t.toLocaleString(e);return amountAndCurrencySymbolMapping[e].replace("{1}",n).replace("{2}",r)},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,r=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:r},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 r in i18n.currencySymbols)i18n.currencySymbols.hasOwnProperty(r)&&i18n.currencySymbols[r]===e&&(t=r);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||{},r=null!=e&&""!==e,n=void 0!==t[e]&&null!==t[e];return r&&n},formatNumber:function(e,t,r){t=void 0!==t?t:window.currency;r=void 0!==r?r:numberFormatLocaleRegionMapping[Utils.getLocale()];var n=e%1;if("undefined"==typeof Intl)return e.toFixed(2).replace(/0+$/,"");var i=0==n||"fr_FR"!=r&&"en_GB"!=r?{useGrouping:!0}:{minimumFractionDigits:2,useGrouping:!0};return Intl.NumberFormat(r,i).format(e)},formatNumberWithFractionDigitsIfNotInteger:function(e,t,r){return t=void 0!==t?t:2,r=void 0!==r?r:Utils.getLocale(),r=Utils.getNumberFormatLocale(r),Number.isInteger(e)?e.toLocaleString(r,{minimumFractionDigits:0,maximumFractionDigits:0,useGrouping:!0}):e.toLocaleString(r,{minimumFractionDigits:t,maximumFractionDigits:t,useGrouping:!0})},formatNumberWithMaxFractionDigits:function(e,t,r){return e=Number(e),t=void 0!==t?t:2,r=void 0!==r?r:Utils.getLocale(),r=Utils.getNumberFormatLocale(r),e.toLocaleString(r,{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,r=void 0!==e.delay?e.delay:0;window.setTimeout((function(){loadings={},$("body").removeClass("is-loading is-loading_quick"),Utils.isNewLoading()&&CivAPP.loader.closeModal(),t()}),r)},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!Utils.isMobile()&&!Utils.isTablet()},isMobileDevice:function(){return/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase())&&Utils.isMobile()},isTabletDevice:function(){return/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase())&&!Utils.isMobile()},isPhoneDevice:function(){return/mobi/i.test(navigator.userAgent.toLowerCase())&&!/ipad/i.test(navigator.userAgent.toLowerCase())},isDesktopDevice:function(){return!Utils.isMobileDevice()&&!Utils.isTabletDevice()&&(Utils.isDesktop()||Utils.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")},isMac:function(){return navigator.userAgent.toLowerCase().includes("macintosh")},getParams:function(e){e=e.split("+").join(" ");for(var t,r={},n=/[?&]?([^=]+)=([^&]*)/g;t=n.exec(e);)r[decodeURIComponent(t[1])]=decodeURIComponent(t[2]);return r},getParam:function(e,t){void 0===t&&(t=window.location.href);try{e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var r=new RegExp("[\\?&]"+e+"=([^&#]*)").exec(t);return null===r?void 0:r[1]}catch(e){return}},addParam:function(e,t,r){return void 0===r&&(r=window.location.href),r=Utils.removeParam(e,r),r+=(r.split("?")[1]?"&":"?")+e+"="+t},addParams:function(e,t){for(var r in e)t=this.addParam(r,e[r],t);return t},removeParam:function(e,t){void 0===t&&(t=window.location.href);var r=t.split("?")[0],n=[],i=-1!==t.indexOf("?")?t.split("?")[1]:"";if(""!==i){for(var o=(n=i.split("&")).length-1;o>=0;o-=1)n[o].split("=")[0]===e&&n.splice(o,1);n.length>0&&(r=r+"?"+n.join("&"))}return r},getHashFromString:function(e){var t;try{t=new URL(e).hash}catch(r){t="#"+e.split("#")[1]}return t},getLocalEnv:function(){return[]},getStgEnv:function(){return["dev-gke"]},getStaticPath:function(e){e=void 0!==e?e:"";var t="/f";return-1!==document.location.host.indexOf("local")&&(t="https://cdnlocal.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.civitatis.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},getEnvPrev:function(){return-1!==document.location.host.indexOf("local")?"local":-1!==document.location.host.indexOf("staging")?"staging":-1!==document.location.host.indexOf("qa")?"qa":-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(),r=/safari/.test(t),n=/iphone|ipod|ipad/.test(t),i=-1!==t.indexOf("civitatis-ios-app"),o=-1!==t.indexOf("civitatis-android-app");return i||o||n&&!e&&!r},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,r){window.navigator.standalone;var n=null!=r&&""!==r?r.toLowerCase():window.navigator.userAgent.toLowerCase(),i=(/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(),a=null,s=null,l=null;if(o)for(var u=n.split("/"),c=0;c<u.length;c++)-1===u[c].indexOf("civitatis-ios-app")&&-1===u[c].indexOf("civitatis-android-app")||(s=(a=u[c+1]).split("-"),a=s[0]),i&&-1!==u[c].indexOf("com.civitatis.")&&(l=u[c].replace("com.civitatis.ios.","").replace("com.civitatis.",""));var d="undefined"!==CivAPP.isGuide&&null!==CivAPP.isGuide&&!0===CivAPP.isGuide,f=null!=a&&Utils.isVersionStringSameOrUpper(a,e);return o&&f&&(!d||d&&(null==t||""===t||null!=t&&""!==t&&null!=l&&l==t))},isVersionStringSameOrUpper:function(e,t){var r=/^[0-9]+(\.[0-9]+)*$/,n=!1;if(r.test(e)&&r.test(t)){var i=Utils.versionArray(e),o=Utils.versionArray(t);Utils.compareVersionArray(i,o)&&(n=!0)}return n},versionArray:function(e){for(var t=e.split("."),r=new Array(t.length),n=0;n<t.length;n++)r[n]=parseInt(t[n]);return r},compareVersionArray:function(e,t){for(var r=0,n=!1,i=e.length<t.length?e.length:t.length;r<i&&0==n;)e[r]<t[r]&&(n=!0),r++;return!n},isBookingView:function(){return Utils.$("body").hasClass("is-booking-view")||null!==_UtilsCore__WEBPACK_IMPORTED_MODULE_0__.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)},isCartLoaded:function(){return $("#o-cart-buttons__container").length>0},md5:function(e){return md5__WEBPACK_IMPORTED_MODULE_2___default()(e)},scrollBodyToElement:function(e,t){t=void 0!==t?t:{},e=$(e);var r=void 0!==t.onlyUpwards&&t.onlyUpwards,n=void 0!==t.callback?t.callback:Function.prototype;if(0!==e.length){var i=e.offset().top;!r||window.pageYOffset>i?Utils.scrollBodyTo(i,t):n()}},scrollBodyTo:function(e,t){var r=void 0!==(t=void 0!==t?t:{}).duration?t.duration:500,n=void 0!==t.callback?t.callback:Function.prototype,i=t.hash,o=void 0!==t.topMargin?parseInt(t.topMargin):0,a=$(document).scrollTop();e-=o,null!=i&&(window.location.hash=i),$(document).scrollTop(a);$.when(("parentIFrame"in window&&window.parentIFrame.scrollToOffset(0,e),$("html, body").animate({scrollTop:e},r))).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,r,n){e<(document.documentElement.scrollTop||document.body.scrollTop)&&(e-=72),Utils.scrollBodyTo(e,t,r,n)},initGoTos:function(e){(e=void 0!==e?$(e):$("body")).find(".js-link-to").each((function(){var e=$(this).attr("href");-1!==e.indexOf("#")&&(e="#"+e.split("#")[1],$(this).on("click",(function(t){t.preventDefault();var r=$(this).hasClass("js-link-to_upwards"),n=$(this).attr("data-js-link-offset-upwards"),i={};$(this).hasClass("_no-hash")||(i={hash:e}),r&&(CivAPP.Utils.isGuide()&&(n-=60),i.topMargin=n),CivAPP.Utils.scrollBodyToElement(e,i)})))}))},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 r=e.split("?")[1];return t+(r=void 0!==r?"?".concat(r):"")},isValidLink:function(e){try{new URL(e);return!0}catch(e){return!1}},initJsLinks:function(){$(".js-link").filter((function(){return void 0!==$(this).attr("data-loc")||void 0!==$(this).attr("data-href")})).each((function(){var e=$(this),t=void 0!==$(this).attr("data-loc")?atob(e.attr("data-loc")):e.attr("data-href");if(Utils.isValidLink(t)){if(Utils.isInternalLink(t)){var r=new URL(t),n=Utils.addTrailingSlashToUrl(r.pathname);t=r.origin+n+r.search}}else t=Utils.addTrailingSlashToUrl(t);if(void 0!==e.attr("data-to-anchor")){var i=this.createNewLink(e);i.attr("rel","noindex nofollow"),this.replaceLinkWithNewLink(e,i),e.attr("href",t)}else e.css("cursor","pointer"),e.off("click").on("click",(function(r){if(r.preventDefault(),e.hasClass("js-new-window-size")){var n=e.data("width"),i=e.data("height");window.open(t,"_blank","width=".concat(n,", height=").concat(i)),e.data("reload-href")&&(window.location.href=e.data("reload-href"))}else void 0!==e.attr("data-target")?window.open(t,e.attr("data-target")):window.location.href=t}))}))},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 r=t.getElementsByTagName("script"),n=r.length;n--;)r[n].parentNode.removeChild(r[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 r=null!=t&&t.length>0?$(t):$(document);""!==Foundation.MediaQuery.current&&!0!==e||$(r).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"]'),r=window.innerWidth/e;t.setAttribute("data-is-fake-viewport","true"),t.content="width=".concat(e,",initial-scale=").concat(r,",maximum-scale=").concat(r,",minimum-scale=").concat(r,",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);var 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"),r=$('<span class="rating__stars__empty"></span>'),n=t.text();t.html('<span class="hide">'+n+"</span>"),t.before(r),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"),r=e.find(".m-rating__stars__full"),n=r.text();t.html(""),r.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 r='<div class="--inner">'+initialMsg+"</div>";$msgs.html(r),$msgs.addClass("rated"),$msgs.addClass(ratingMsgCSSClasses[t-1]),requiredConditionalElements(t),minLengthConditionalElements(t),placeHolderConditional(t)})),$stars.on("over",(function(e,t){removeCSSOverClasses();var r='<div class="--inner">'+Utils.tr("ratingMsg."+t)+"</div>";$msgs.html(r),$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_1___default()((function(){Utils.$(".js-rateit").rateit(),initRatingDivs()}),100)))},initRating2:function initRating2(){var $radioRating=$('.m-super-radio--square._opinion [type="radio"]'),$initedRating=$($radioRating).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 r=0!==$("#utils_swapper").length?$("#utils_swapper"):$('<div id="utils_swapper">');t.after(r);var n=t.detach();e.after(n);n=e.detach();r.after(n),r.remove()},onElementOutsideClick:function(e,t,r){e="string"==typeof e?$(e):e,r=void 0!==r?r:Function.prototype,t=void 0!==t?t:Function.prototype;var n=Utils.setIdIfNotId(e);$(document).on("click focusin",(function e(i){$(i.target).closest("#"+n).length?r():(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]})),$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 r=!0===t?localStorage:sessionStorage;return JSON.parse(r.getItem(e))},setItem:function(e,t,r){var n=!0===r?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_1___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),r=0;e.each((function(){$(this).height("auto")})),e.each((function(){var e=$(this).height();e>r&&(r=e)})),e.height(r)}))}},initDropdowns:function(){var e=Utils.$("body");e.find(".js-dropdown-b").each((function(){var e=$(this),t=$('<i class="js-dropdown-b-button">'),r=(e.next(),!0);e.prepend(t),t.off("click.dropdownb"),t.on("click.dropdownb",(function(t){t.preventDefault(),r?(r=!1,e.addClass("_is-visible")):(r=!0,e.removeClass("_is-visible"))}))})),e.find(".js-dropdown").each((function(){var t=$(this),r=void 0!==$(t).data("target")&&null!==$(t).data("target")&&""!==$(t).data("target")?$("#"+$(t).data("target")):t.next(),n=$(),i=t.attr("data-dropdown-parent-class-selector");"string"==typeof i&&""!==i&&(n=t.closest(i)),t.hasClass("js-dropdown-opened")||t.hasClass("js-dropdown-minus")?(n.removeClass("_is-closed"),n.addClass("_is-opened"),r.removeClass("v--hidden"),r.css("display","block"),t.hasClass("js-dropdown-minus")||t.addClass("js-dropdown-minus")):(n.addClass("_is-closed"),n.removeClass("_is-opened"),r.addClass("v--hidden"),r.css("display","none")),t.off("click.dropdown"),t.on("click.dropdown",(function(i){if(i.preventDefault(),t.hasClass("js-dropdown-mobile")&&!Utils.isMobile())return!1;"open"===(r.hasClass("v--hidden")?"open":"close")?(n.removeClass("_is-closed"),n.addClass("_is-opened"),r.removeClass("v--hidden"),t.addClass("js-dropdown-minus"),r.hasClass("share-social-widget__body")?r.fadeIn(200):r.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"),r.addClass("v--hidden"),t.removeClass("js-dropdown-minus"),r.hasClass("share-social-widget__body")?r.fadeOut(200):r.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,r,n){var i=Utils.i18n._arguments[t];return void 0!==i?i:" "},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 r=t.replace(/{(.)}/g,Utils.i18n._function);return Utils.i18n._arguments=null,r}return Utils.l("sin traducir: "+e),""}},tr:function(e){for(var t,r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return(t=Utils.i18n).translate.apply(t,[e].concat(n))},trWithNumber:function(e,t){for(var r,n,i,o=e+"_plural",a=1!==t?o:e,s=1!==t?e:o,l=arguments.length,u=new Array(l>2?l-2:0),c=2;c<l;c++)u[c-2]=arguments[c];return void 0!==(n=(r=Utils.i18n).translate.apply(r,[a].concat(u)))&&""!==n?n:void 0!==(n=(i=Utils.i18n).translate.apply(i,[s].concat(u)))&&""!==n?n:void 0},removeDiacritics:function(e){return void 0===e?"":e.replace(/[^\u0000-\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(),r=$(window).height(),n=e[0].getBoundingClientRect(),i=n.top,o=n.bottom;return Math.max(0,i>0?Math.min(t,r-i):o<r?o:r)},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,r=(new DOMParser).parseFromString("<!doctype html><body>"+e,"text/html");try{t=r.body.textContent}catch(r){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"),r=e.format("MMMM");return $('<span class="datepicker-custom__date">'+t+'</span><span class="datepicker-custom__month">'+r+"</span>")})),_defineProperty(_Utils,"getFlightDateEmpty",(function(){return'<span class="datepicker-custom__empty">+</span>'})),_defineProperty(_Utils,"getUrlParams",(function(e){for(var t,r={},n=e.slice(e.indexOf("?")+1).split("&"),i=0;i<n.length;i++)r[(t=n[i].split("="))[0]]=t[1];return r})),_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,r=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||r)||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,r=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||r)||t&&(void 0===CivAPP.isSpecificGuide||n))})),_defineProperty(_Utils,"returnNumberWithParams",(function(e,t,r,n,i){var o="",a="",s=Utils.getLocale(),l=Utils.getCurrencyFromSymbol(t),u=!!i||Utils.getCurrencySmallCurrency(l);r=null!=r?r:Utils.getLocaleCurrencySpace(),n=null!=n?n:Utils.getLocaleCurrencyBeforeAmount(),null!=u&&1==u&&(o="<span>",a="</span>");var c=/^[a-zA-Z]+$/.test(t);return!n||c&&("en"==s||"mx"==s||"ar"==s)?r?e+" "+o+t+a:e+""+o+t+a:r?o+t+a+" "+e:o+t+a+""+e})),_defineProperty(_Utils,"getAllAttributes",(function(e){var t={},r=$(e)[0];return null!=r&&$.each(r.attributes,(function(e,r){t[r.name]=r.value})),t})),_defineProperty(_Utils,"removeAllAttributes",(function(e){var t=Utils.getAllAttributes(e);$.each(t,(function(t,r){$(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"),r=!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=$(this);if(e.addClass("_processed"),r){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(!r){var n=Utils.decodeHtml(t.html());$(t).html(n)}var i=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",i)})),$(this).off("show.zf.tooltip.html")}))}))})),_defineProperty(_Utils,"tooltipPreventDefault",(function(){$('[data-tooltip], [data-civtip][data-tooltip-click="true"]').each((function(e,t){var r=$(t).closest("a");r.length>0&&($(r).off("click.tooltipdefault"),$(r).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=$(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,r,n,i,o){n="0"!==Utils.getParam("cssPreloadJs")&&("boolean"!=typeof n||n),i=null!=i&&"object"==_typeof(i)&&Object.keys(i).length>0?i:{},o=null!=o&&"object"==_typeof(o)&&Object.keys(o).length>0?o:{};var a=document.getElementsByTagName("head")[0],s=document.createElement("script");if("string"==typeof t){var l=document.createElement("link");l.title="not-loaded",l.href=t;var u=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])})),a.appendChild(l),"complete"===document.readyState&&u(),$(window).on("load",(function(){u()}))):(l.rel="stylesheet",$.each(Object.keys(o),(function(e,t){l.setAttribute(t,o[t])})),a.appendChild(l))}function c(){r&&(r(),s.onload=s.onreadystatechange=null,r=null)}s.type="text/javascript",s.onload=c,s.onreadystatechange=function(){"complete"===this.readyState&&c()},s.src=e,$.each(Object.keys(i),(function(e,t){s.setAttribute(t,i[t])})),a.appendChild(s)})),_defineProperty(_Utils,"insertAfter",(function(e,t){e.parentNode.insertBefore(t,e.nextSibling)})),_defineProperty(_Utils,"switcherProfileLinks",(function(){var e=$(".o-profiles-switch .__switch .__item:not(._active) > a"),t=$(".o-profiles-switch .__switch .__item._active > a");$(e).off("click.switcherProfileLinks"),$(e).on("click.switcherProfileLinks",(function(e){e.preventDefault();var t=$(this),r=void 0!==$(t).data("pass")&&(1==$(t).data("pass")||"true"==$(t).data("pass")||"1"==$(t).data("pass")),n=$(t).attr("href"),i=void 0!==$(t).data("typology")&&null!==$(t).data("typology")&&""!==$(t).data("typology")?parseInt($(t).data("typology")):null;if(r){var o={title:Utils.tr("loginOptionSelectTypology_title"+i),action:n};null!==i&&(o.typology=i),CivAPP.ConfirmUtil.changeProfile(o)}else window.location.href=n})),$(t).off("click.switcherProfileLinks"),$(t).on("click",(function(e){e.preventDefault()}))})),_defineProperty(_Utils,"slugify",(function(e){var t="àáâäæãåāăąçćčđďèéêëēėęěğǵḧîïíīįìłḿñńǹňôöòóœøōõőṕŕřßśšşșťțûüùúūǘůűųẃẍÿýžźż·/_,:;",r=new RegExp(t.split("").join("|"),"g");return e.toString().toLowerCase().replace(/\s+/g,"-").replace(r,(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={},r=e.length-1;r>=0;r--){var n=JSON.stringify(e[r]);t[n]?e.splice(r,1):t[n]=!0}return e})),_defineProperty(_Utils,"capitalizeFirstLetter",(function(e){return e.charAt(0).toUpperCase()+e.slice(1)})),_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 r=!1;return $.each(t,(function(t,n){n==e&&(r=!0)})),r})),_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)})),_defineProperty(_Utils,"radioOpenClass",(function(){var e=$(".js-radio-open");e.length>0&&e.each((function(e,t){var r=$('input[type="radio"]');r.off("change.radioOpenClass"),r.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,r=$("._r-mq-n-l").length>0;if(e||t){var n=function(e){return"small"==e||"medium"==e},i=function(e){return"small"!==e&&"medium"!==e};$(window).on("changed.zf.mediaquery",(function(e,o,a){if(console.log("changed.zf.mediaquery U1"),Utils.isFakeViewport())console.log("U1 - return FKV");else{var s=!0;Utils.isIphone()&&"number"==typeof window.originalWidth&&(s=window.originalWidth!==window.innerWidth),s?(t||n(o)&&i(a)||n(a)&&i(o))&&(r||Utils.loading(),console.log("U1 - reload"),Utils.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,r){if(-1!==r.indexOf(Utils.getCopyFormDataSufix())){var n=r.replaceAll(Utils.getCopyFormDataSufix(),"");e[n]=e[r],delete e[r]}})),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,r,n){(r&&"map"!==n||!r)&&($("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,r){if(t=null!=t&&(1==t||"true"==t||"1"==t),r=null!=r&&""!==r?r:"",!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,i=n?5e3:0,o=0,a=setInterval((function(){i>0&&o<i?!n||n&&$("._with-lwtooltip_transparent").length>0?(clearInterval(a),setTimeout((function(){Utils.showTooltipWithTimerTrigger(e,5,t,r)}))):o+=100:(clearInterval(a),setTimeout((function(){Utils.showTooltipWithTimerTrigger(e,5,t,r)})))}),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,r=e.multiple,n=void 0===r||r,i=e.myAcceptedFiles,o=void 0===i?[]:i,a=n&&o.length>0?[].concat(_toConsumableArray(o),[t]):[t];return this.removeDuplicatesFromArray(a)})),_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],r=["tif","tiff","webp"],n=["jpg","jpeg","gif","png","heif","heic"].concat(_toConsumableArray(t?r:[]));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],r=["ppt","pptx","txt"],n=["doc","docx","pdf","xlsx","xsl"].concat(_toConsumableArray(t?r:[]));return e?n:n.map((function(e){return".".concat(e)})).join(", ")})),_defineProperty(_Utils,"convertFileToImgSrc",(function(e){var t=e.file,r=e.maxSize,n=void 0===r?8388608:r,i=e.minWidth,o=e.callback,a=void 0===o?Function.prototype:o,s=URL.createObjectURL(t),l=new Image,u=t.size,c=(t.type,_slicedToArray(t.name.split("."),2)),d=(c[0],c[1]),f=this.acceptImgFormats(!0).includes(d);return l.onload=function(){u>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?i&&this.width<i?"undefined"!=typeof CivAPP&&null!==CivAPP&&void 0!==CivAPP.ConfirmUtil&&null!==CivAPP.ConfirmUtil&&CivAPP.ConfirmUtil.showError({message:Utils.tr("minWidthWarning",i)}):(Object.assign(t,{preview:s}),a(this)):"undefined"!=typeof CivAPP&&null!==CivAPP&&void 0!==CivAPP.ConfirmUtil&&null!==CivAPP.ConfirmUtil&&CivAPP.ConfirmUtil.showError({message:Utils.tr("imageFileTypeWarning")})},l.src=s,{img:l,myurl:s}})),_defineProperty(_Utils,"getBase64",(function(e){return new Promise((function(t,r){var n=new FileReader;n.readAsDataURL(e),n.onload=function(){return t(n.result)},n.onerror=function(e){return r(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 r in e)if(Object.hasOwnProperty.call(e,r)){var n=e[r],i=n.variationName,o=n.status;"original"!==i&&"accepted"===o&&t.push(r)}Utils.readCookie("ABTastyEnabledTests")!==t.toString()&&(Utils.createCookie("ABTastyEnabledTests",t.toString()),window.location.reload())},t=0,r=setInterval((function(){if(t<3e3)if(void 0!==window.ABTasty&&null!==window.ABTasty){clearInterval(r);var n=0,i=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(i),e(t)):n+=100:(clearInterval(i),e(t))}),50)}else t+=100;else clearInterval(r)}),50)})),_defineProperty(_Utils,"deleteABTastyEnabledTestsCookie",(function(){Utils.deleteCookie("ABTastyEnabledTests")})),_defineProperty(_Utils,"convertProblematicImgFormatsToJpg",(function(e,t){var r=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),i=n[0];switch(n[1]){case"heif":case"heic":var o=new FormData,a=e._removeLink,s=e.accepted,l=void 0===s||s,u=e.previewElement,c=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 r="".concat(i,".jpg"),n=new File([e],r,{type:"image/jpeg"}),o=Utils.convertFileToImgSrc({file:n}),s=o.img;o.myurl;Utils.getBase64(n).then((function(e){if(n._removeLink=a,n.accepted=l,n.dataURL=e,n.path=r,n.previewElement=u,n.previewTemplate=c,n.status="queued",n.height=s.height,n.width=s.width,null!=d){var i=d.uuid,o=d.progress,f=d.bytesSent,p=d.chunked,g=d.totalChunkCount;n.upload=_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({},i&&{uuid:i}),o&&{progress:o}),f&&{bytesSent:f}),p&&{chunked:p}),g&&{totalChunkCount:g}),{},{total:n.size,filename:r})}Utils.unLoadingAll(),t(n)}))})).catch((function(e){Utils.unLoadingAll(),r()}));break;default:Utils.unLoadingAll(),t(e)}}else r()}))})),_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 r=window.scrollY||window.pageYOffset;return{top:t.top+r,left:t.left,bottom:t.bottom+r,right:t.right}}catch(e){return null}})),_defineProperty(_Utils,"fixedElementsFromElement",(function(e){try{if(e){var t=Utils.getElementPosition(e);if(t&&null!==t.top){var r=document.body.getBoundingClientRect().height-t.top,n=document.getElementById("zendeskAux"),i=document.querySelector("iframe#launcher");n&&n.style.setProperty("bottom","".concat(r,"px"),"important"),i&&i.style.setProperty("bottom","".concat(r,"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,r=null,n=_createForOfIteratorHelper(e.split(","));try{for(n.s();!(t=n.n()).done;){var i=t.value.trim();if(r){var o=Utils.tr(i)?Utils.tr(i):i;r+=", ".concat(o)}else{r=Utils.tr(i)?Utils.tr(i):i}}}catch(e){n.e(e)}finally{n.f()}return r})),_defineProperty(_Utils,"getTextAccordingToActivationDate",(function(e){return e&&new Date(e).toISOString().slice(0,10)<(new Date).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,r="undefined"!=typeof calendarCFG&&null!==calendarCFG&&calendarCFG.pagantisInterestPercent||0;return((e="string"==typeof e?parseFloat(e):e)+e*(r/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")&&!Utils.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){for(var t=0;t<window.dataLayer.length;t++){var r=window.dataLayer[t];if(JSON.stringify(r)===JSON.stringify(e))return!0}return!1})),_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 r;switch(t){case"days":r=24*e*60*60*1e3;break;case"hours":r=60*e*60*1e3;break;case"minutes":r=60*e*1e3;break;default:throw new Error("Unidad de tiempo no válida. Debe ser 'days', 'hours' o 'minutes'.")}return r})),_defineProperty(_Utils,"setKeyWithExpiration",(function(e,t,r,n){var i=Utils.calculateExpirationTime(r,n),o=Date.now()+i;_helpers_LocalStorageHandler__WEBPACK_IMPORTED_MODULE_3__.a.set(e,t),_helpers_LocalStorageHandler__WEBPACK_IMPORTED_MODULE_3__.a.set(e+"-exp",o)})),_defineProperty(_Utils,"rewriteCookieForLocalStorage",(function(){var e=Utils.readCookie("oauthUserLogin"),t=Utils.readCookie("twoFactorAgencyLogin"),r=Utils.readCookie("twoFactorAffiliateLogin"),n=Utils.readCookie("twoFactorAccommodationLogin");e?(Utils.setKeyWithExpiration("userLogin",e,7,"days"),setTimeout((function(){console.log("enviamos braze"),"undefined"!=typeof braze&&braze.changeUser(data.userLogin.id)}),3e3),_UtilsCore__WEBPACK_IMPORTED_MODULE_0__.a.deleteCookie("oauthUserLogin")):t?(Utils.setKeyWithExpiration("agencyLogin",t,7,"days"),_UtilsCore__WEBPACK_IMPORTED_MODULE_0__.a.deleteCookie("twoFactorAgencyLogin")):r?(Utils.setKeyWithExpiration("affiliateLogin",r,7,"days"),_UtilsCore__WEBPACK_IMPORTED_MODULE_0__.a.deleteCookie("twoFactorAffiliateLogin")):Utils.readCookie("twoFactorAccommodationLogin")&&(Utils.setKeyWithExpiration("accommodationLogin",n,7,"days"),_UtilsCore__WEBPACK_IMPORTED_MODULE_0__.a.deleteCookie("twoFactorAffiliateLogin"))})),_defineProperty(_Utils,"isGeneralActivity",(function(){var e=window.activityData;if(!e)return!1;var t=/\s+eSIM\s+/i.test(e.titulo||""),r=Number(e.destinationId);return 0===r&&!isNaN(r)||t})),_defineProperty(_Utils,"disableHourRange",(function(e,t,r){for(var n=t;n<r;n++)e.find('option[value="'.concat(n,'"]')).attr("disabled",!0)})),_defineProperty(_Utils,"disableMinuteRange",(function(e,t,r){for(var n=t;n<=r;n+=5)e.find('option[value="'.concat(n,'"]')).attr("disabled",!0)})),_defineProperty(_Utils,"updateSelect2DisabledHours",(function(e,t){var r=this,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=Utils.getMoment(t,Utils.tr("timeFormats.datePickerFormat")).format("YYYY-MM-DD"),o=i?window.closedDatesAndHours.filter((function(e){return e.fecha===i})):"";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),i=n[0],o=n[1],a=_slicedToArray(t.end_hour.split(":").map(Number),2),s=a[0],l=a[1];o>0||l>0||(i>=0&&s>0?r.disableHourRange(e,i,s):i>=0&&(isNaN(s)||0==s)?r.disableHourRange(e,i,24):(isNaN(i)||0==i)&&s>0&&r.disableHourRange(e,0,s)),o>0&&!(l>0)&&(s>0?r.disableHourRange(e,i+1,s):(isNaN(s)||0==s)&&r.disableHourRange(e,i+1,24)),!(o>0)&&l>0&&(i>0?r.disableHourRange(e,i,s):(isNaN(i)||0==i)&&r.disableHourRange(e,0,s)),o>0&&l>0&&r.disableHourRange(e,i+1,s),t.startHourParsed=i,t.endHourParsed=s,t.startHourMinutes=o,t.endHourMinutes=l})),e.trigger("change.select2"),o})),_defineProperty(_Utils,"updateSelect2DisabledMinutes",(function(e,t,r){var n=this,i=parseInt(e.val(),10);(t.find("option").attr("disabled",!1),r&&r.length>0)&&r.filter((function(e){return e.startHourParsed==i&&e.startHourMinutes>0||e.endHourParsed==i})).forEach((function(e){e.startHourParsed==i&&e.endHourParsed!==i&&n.disableMinuteRange(t,e.startHourMinutes,55),e.startHourParsed!==i&&e.endHourParsed==i&&(e.endHourParsed>0||e.endHourMinutes>0)&&n.disableMinuteRange(t,0,e.endHourMinutes),e.startHourParsed==i&&e.endHourParsed==i&&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,r){$(e).val()?(t.attr("disabled",!1),this.updateSelect2DisabledMinutes(e,t,r),""!==t.val()&&t.val("").trigger("change"),this.refreshSelect2(t)):t.attr("disabled",!0)})),_defineProperty(_Utils,"handleTransferCalendarClick",(function(e,t,r,n){var i,o=null===(i=document.getElementById(r))||void 0===i?void 0:i.value;if(o){if(e.attr("disabled",!1),"returnDate_pickerInput"===r){var a,s=null===(a=document.getElementById("date_pickerInput"))||void 0===a?void 0:a.value;n=s&&o&&s==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"))),r=JSON.parse(t);return"".concat(r.page.typology.toLowerCase().replaceAll(" ","-")).concat("cart"===r.page.typology?"-".concat(r.page.title):"")}})),_defineProperty(_Utils,"sendCTAEvent",(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r="".concat(e,"_Click");Object(_shared_Optimizely_sdk_optimizelyUser__WEBPACK_IMPORTED_MODULE_4__.b)(r,t)})),_defineProperty(_Utils,"handleClickNavigation",(function(e){localStorage.setItem("previousPage",e)})),_defineProperty(_Utils,"checkPreviousPageAndSendEvent",(function(e,t){localStorage.getItem("previousPage")===e&&(Object(_shared_Optimizely_sdk_optimizelyUser__WEBPACK_IMPORTED_MODULE_4__.b)("".concat(t,"_View")),localStorage.removeItem("previousPage"))})),_Utils),isLocal=_UtilsCore__WEBPACK_IMPORTED_MODULE_0__.a.isLocal(),isAlert=_UtilsCore__WEBPACK_IMPORTED_MODULE_0__.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:"ǱǄ"},{base:"Dz",letters:"ǲǅ"},{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ⓀＫḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁＬĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"Ǉ"},{base:"Lj",letters:"ǈ"},{base:"M",letters:"MⓂＭḾṀṂⱮƜ"},{base:"N",letters:"NⓃＮǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"Ǌ"},{base:"Nj",letters:"ǋ"},{base:"O",letters:"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ⓉＴṪŤṬȚŢṰṮŦƬƮȾꞆ"},{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ⓏＺŹẐŻŽẒẔƵȤⱿⱫꝢ"},{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:"ǳǆ"},{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_0__.a),__webpack_exports__.a=Utils},,function(e,t,r){"use strict";r.d(t,"A",(function(){return p})),r.d(t,"z",(function(){return g})),r.d(t,"b",(function(){return v})),r.d(t,"d",(function(){return h})),r.d(t,"c",(function(){return m})),r.d(t,"D",(function(){return y})),r.d(t,"e",(function(){return _})),r.d(t,"y",(function(){return b})),r.d(t,"u",(function(){return I})),r.d(t,"s",(function(){return O})),r.d(t,"t",(function(){return A})),r.d(t,"m",(function(){return w})),r.d(t,"h",(function(){return S})),r.d(t,"g",(function(){return R})),r.d(t,"f",(function(){return N})),r.d(t,"B",(function(){return C})),r.d(t,"C",(function(){return U})),r.d(t,"n",(function(){return k})),r.d(t,"j",(function(){return F})),r.d(t,"o",(function(){return x})),r.d(t,"k",(function(){return j})),r.d(t,"w",(function(){return G})),r.d(t,"x",(function(){return B})),r.d(t,"q",(function(){return $})),r.d(t,"p",(function(){return K})),r.d(t,"v",(function(){return H})),r.d(t,"r",(function(){return q})),r.d(t,"a",(function(){return z})),r.d(t,"l",(function(){return J})),r.d(t,"i",(function(){return X}));var n=r(15),i=(r(18),r(0));function o(e,t,r,n,i,o,a){try{var s=e[o](a),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,i)}function a(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var a=e.apply(t,r);function s(e){o(a,n,i,s,l,"next",e)}function l(e){o(a,n,i,s,l,"throw",e)}s(void 0)}))}}function s(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=d(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}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 u(e){return function(e){if(Array.isArray(e))return f(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||d(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 c(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],l=!0,u=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}(e,t)||d(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 d(e,t){if(e){if("string"==typeof e)return f(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?f(e,t):void 0}}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var p=function(e,t,r){if(null!=e){var n="string"==typeof e?parseFloat(e):Number(e);if(!Number.isNaN(n))return r&&!r.includes(n)?null!=t?t:0:n}return null!=t?t:0},g=function(e){return null!=e&&[!0,"true",1,"1"].includes(e)},v=function(e,t){var r=new Date(e);return r.setDate(r.getDate()+t),r},h=function(e){var t,r=(t=e?new Date(e):new Date).getTimezoneOffset();return new Date(t.getTime()-60*r*1e3)},m=function(e,t,r){var n=null!=t&&""!==t;if(!n)return e;if(!(null!=e&&""!==e)&&n)return t;var i=h(e),o=h(t);return r&&o<i||!r&&o>i?t:e},y=function(e){var t=c(e.split(":"),2),r=t[0],n=t[1],i=parseInt(r,10),o=parseInt(n,10),a=new Date;return a.setHours(i),a.setMinutes(o),a},E={},_=function(e){return null==e?[]:e.split(";").map((function(e){var t,r;if(E.hasOwnProperty(e))t=E[e].feeValue,r=E[e].hoursArray;else{var n=c((e.includes(".")?e:"".concat(e.includes(":")?"":e,".").concat(e.includes(":")?e:"")).split("."),2),i=n[0],o=n[1];t=p(i,-1),r=(r=o?o.split(","):[]).filter((function(e){var t=c(L(e),2),r=t[0],n=t[1];return null!==r&&null!==n&&!isNaN(r)&&!isNaN(n)})),E[e]={feeValue:t,hoursArray:r}}return{fee:t,hours:r}})).filter((function(e){return"number"==typeof e.fee&&e.fee>=0}))},b=function(){var e;return g(null===(e=window.APPConfig)||void 0===e?void 0:e.payLater)},I=function(){var e;return p(null===(e=window.APPConfig)||void 0===e?void 0:e.payLaterDays,0)},O=function(e){return null!=e?e:{}},A=function(e){return null!=e?e:{}},w=function(e){var t=p(e,0);return{rate:"".concat(p(void 0,t))}},T=function(e){var t=p(e,0);return{rate:p(void 0,t)}},S=function(e,t){return Array(e).fill(t)},R=function(e,t,r,n){if(!e)return[];if(!t||t.length<=e.length)return e;for(var i=t.length-e.length,o=u(e),a=0;a<i;a+=1)o.push(r&&Array.isArray(r)?S(r.length,T(n)):[]);return o},N=function(e,t,r){if(!t||t.length<=e.length)return e;for(var n=t.length-e.length,i=u(e),o=0;o<n;o+=1)i.push(T(r));return i},D=function(e,t){if(t)try{for(var r=new Map,n=Array.from(t.matchAll(e)),i=0,o=n;i<o.length;i++){var a=o[i],s=a[1],l=a[2];r.set(s,l)}var c=Math.max.apply(Math,u(Array.from(r.keys()).map(Number)));return Array.from({length:c+1},(function(e,t){return r.get(t.toString())||""}))}catch(e){return[]}return[]},C=function(e,t,r){var n,i=e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),o=new RegExp("".concat(i,'\\[(\\d+)]="([^"]*)"'),"g");return Array.isArray(r)?r.reduce((function(e,t){t&&D(o,t).forEach((function(t,r){!(void 0!==e[r]&&null!==e[r]&&""!==e[r])&&(null!=t&&""!==t)&&(e[r]=t)}));return e}),[]):Array.isArray(t)&&t.some(Array.isArray)?t.reduce((function(e,t){return(null!=t?t:[]).forEach((function(t,r){!(void 0!==e[r]&&null!==e[r]&&""!==e[r])&&(null!=t&&""!==t)&&(e[r]=t)})),e}),[]):r?D(o,r):null!==(n=t)&&void 0!==n?n:[]},U=function(e,t){if(!e||!t)return!1;var r=null==t?void 0:t[e],n=_(r);return void 0!==r&&n.every((function(e){return Array.isArray(e.hours)&&e.hours.length>0}))},P={},L=function(e){if(!e||""===e.trim())return[null,null];if(P.hasOwnProperty(e))return P[e];var t=c(e.split(":"),2),r=t[0],n=t[1],i=parseInt(r,10),o=parseInt(n,10);return P[e]=[i,o],[i,o]},M=function(e){var t=c(L(e),2),r=t[0],n=t[1];if(null===r||null===n)return"";var i=r<10?"0".concat(r):"".concat(r),o=n<10?"0".concat(n):"".concat(n);return"".concat(i,":").concat(o)},k=function(e,t,r){if(!t)return[];if(Array.isArray(e)){if(e.length>1){for(var n=0;n<e.length;n++){var i=e[n],o=i.horasValidas;if(o&&"object"===l(o)){var a=null==o?void 0:o[t],s=_(a);if(void 0!==a){if(null==r||"string"==typeof r&&0===r.length)return[i];for(var u=0;u<s.length;u++){if(s[u].hours.includes(M(r)))return[i]}}}}return[e[0]]}return e}return[e]},F=function(e){var t,r=document.getElementById("activityId"),n=(null==r?void 0:r.value)||null,i=(null===(t=window.activityData)||void 0===t?void 0:t.activityId)||null;return parseInt(e||n||i,10)},x=function(e,t,r,n){var i,o,a,s=F(t);if(Array.isArray(e)){var l=k(e,r,n);if(l.length>0)return l[0];var u=(o=e,(a=s)?o.filter((function(e){var t,r;return(null==e?void 0:null===(t=e.activity)||void 0===t?void 0:t.id)===a||(null==e?void 0:null===(r=e.activity)||void 0===r?void 0:r.id)===a.toString()})):[]);if(u.length>0){var c=u[0],d=c.modifyCalendar,f=c.modifyCartCalendar;if(d||f)return u[0]}var p=function(e){return null==e?void 0:e.filter((function(e){return!g(null==e?void 0:e.isSecondary)}))}(e);if(p.length>0)return p[0]}return null!==(i=null==e?void 0:e[0])&&void 0!==i?i:e};function V(e,t){var r,n=e,i=s(t.split("."));try{for(i.s();!(r=i.n()).done;){var o=r.value;if(!(n&&"object"===l(n)&&o in n))return;n=n[o]}}catch(e){i.e(e)}finally{i.f()}return n}var j=function(e,t,r,i,o){return Array.isArray(e)?null==e?void 0:e.reduce((function(e,t){return function(e,t,r){var i,o,a=null==e?void 0:null===(i=e.activity)||void 0===i?void 0:i.activa,s=null==a||Object(n.a)(null==e?void 0:null===(o=e.activity)||void 0===o?void 0:o.activa),l=Object(n.q)(e,t,r);return g(window.isAdmin)||s&&l}(t,i,o)&&e.push(V(t,r)),e}),[]):V(t,r)},G=function(){var e=a(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)}}(),B=function(){var e=a(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)}}(),$=function(e){for(var t=Array.from(new Set(e)),r=[],n=0;n<t.length;n++){r.push([]);for(var i=t[n].split("||"),o=0;o<i.length;o++){r[n].push([]);for(var a=i[o].split("|"),s=0;s<a.length;s++){var l=a[s].split("/"),u=l[0],c=l[1],d={};u.includes("(")?(d.originalRate=parseFloat(u.split(")")[0].split("(")[1]),d.rate=parseFloat(u.split(")")[1])):d.rate=parseFloat(u),d.supplement=u.includes("%")?c:parseFloat(c),r[n][o].push(d)}}}return r},K=function(e){var t=[];return e&&null!==e&&(t=Array.from(new Set(Object.values(e).map((function(e){return e.split(".")[0]}))))),t},H=function(e){var t=0,r=0,n=0;if(e.length>0&&Array.isArray(e[0])){var i=e.flat(1).map((function(e){return parseFloat(e[0].rate)}));t=Math.min.apply(Math,u(i));var o=i.findIndex((function(e){return e===t})),a=e.flat(1)[o][0];(r=(r=a.originalRate?parseFloat(a.originalRate):Number.MAX_SAFE_INTEGER)===Number.MAX_SAFE_INTEGER?0:r)>t&&(n=Math.round(100-100*t/r))}return{minimumPrice:t,officialPrice:r,discount:n}},q=function(e,t){try{if(e){if(Array.isArray(e)){var r=e.map(Number).filter((function(e){return!isNaN(e)}));if(0===r.length)throw new Error("precioMinimoFront is not a numeric value.");return Math.min.apply(Math,u(r))}var n=Number(e);if(isNaN(n))throw new Error("precioMinimoFront is not a numeric value.");return n}}catch(e){console.error("Error calculating minimum price:",e)}return t},z=function(e,t){var r,n=(null!==(r=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!==r?r:[]).map((function(e){return p(e)})),i=p(e);return!n.includes(i)},Y=function(e){var t;return e?null===(t=document.getElementById("calendarUrl"))||void 0===t?void 0:t.dataset.calendarUrl:window.location.origin},W=function(e,t,r,n){return n?"/api/calendars/".concat(e):"/api/activity/calendar/".concat(e,"/").concat(t.toLowerCase(),"/").concat(r.toLowerCase())},J=function(e,t,r){var n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=Y(n),o=W(e,t,r,n);return"".concat(i).concat(o)},X=function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:3,o=arguments.length>4?arguments[4]:void 0,a=arguments.length>5?arguments[5]:void 0,s="string"==typeof o?parseFloat(o):o;if(0===s||"EUR"!==e||"ES"!==r)return i.a.tr("calendarLegacy.pagantisGenericQuotasCalendar");var l=i.a.returnNumberWithParams(i.a.formatNumber(i.a.pagantisCalculator(s).toFixed(2)),a,t);return i.a.tr("calendarLegacy.pagantisQuotasCalendar","".concat(n),"".concat(l))}},,function(e,t,r){"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 i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function o(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function a(e,t,r){return(t=function(e){var t=function(e,t){if("object"!==n(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!==n(i))return i;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:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var s={isLocal:function(){return(-1!==location.host.indexOf("local")||-1!==location.href.indexOf("file")||null!==this.readCookie("debug"))&&null==this.readCookie("noLocal")},isStaging:function(){return-1!==location.host.indexOf("staging")},isQa:function(){return-1!==location.host.indexOf("qa")},isPro:function(){return!(s.isLocal()||s.isStaging()||s.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 ";s.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 "),$("body").addClass(e)},createCookie:function(e,t,r){var n="";if(r){var i=new Date;i.setTime(i.getTime()+24*r*60*60*1e3);n="; expires="+i.toUTCString()}document.cookie=e+"="+t+n+"; path=/;SameSite=None;Secure"},createCookieWithMilliseconds:function(e,t,r){var n="";if(r){var i=new Date;i.setTime(i.getTime()+r);n="; expires="+i.toUTCString()}document.cookie=e+"="+t+n+"; path=/;SameSite=None;Secure"},readCookie:function(e){for(var t=e+"=",r=document.cookie.split(";"),n=0;n<r.length;n++){for(var i=r[n];" "==i.charAt(0);)i=i.substring(1,i.length);if(0==i.indexOf(t))return i.substring(t.length,i.length)}return null},deleteCookie:function(e){this.createCookie(e,"",-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 i=$(this),o=i.attr("data-fav-info"),a=i.attr("data-fav-info-city"),s=i.attr("data-fav-to-list");null!=o&&""!==o&&(o=JSON.parse(o)),i.hasClass("_not-logged")?n(o):i.hasClass("_on")?CivAPP.FavsController.favButtonsOn(e,$(this),o):null!=s&&""!==s?t(i,o,s):r(o,a)})));var t=function(e,t,r){void 0!==CivAPP.FavsController&&null!==CivAPP.FavsController&&CivAPP.FavsController.createFavoriteFnc(o(o({},{listId:"string"==typeof r?parseInt(r):r}),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()}))}))},r=function(e,t,r){var n=void 0;t=null!=t&&""!==t?t:void 0;var i=React.createElement(FavsSelectListContent,{data:e,dataCity:t,urls:n.props.urls,methods:n.props.methods,callback:r,modalId:n.state.modalId,closeHandler:PopupboxManager.close});PopupboxManager.open({content:i,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 r=void 0,n=React.createElement(FavsLoginContent,{data:e,urls:r.props.urls,methods:r.props.methods,callback:t,modalId:r.state.modalId,closeHandler:PopupboxManager.close});PopupboxManager.open({content:n,config:{className:"--login-general _no-min-height",onOpen:function(){AffUtils.popen()},onClosed:function(){r.setState({modalId:Utils.getRandomString()},(function(){AffUtils.pclose()}))}}})}}};t.a=s},function(e,t,r){(function(t){var r=/^\s+|\s+$/g,n=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,o=/^0o[0-7]+$/i,a=parseInt,s="object"==typeof t&&t&&t.Object===Object&&t,l="object"==typeof self&&self&&self.Object===Object&&self,u=s||l||Function("return this")(),c=Object.prototype.toString,d=Math.max,f=Math.min,p=function(){return u.Date.now()};function g(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]"==c.call(e)}(e))return NaN;if(g(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=g(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(r,"");var s=i.test(e);return s||o.test(e)?a(e.slice(2),s?2:8):n.test(e)?NaN:+e}e.exports=function(e,t,r){var n,i,o,a,s,l,u=0,c=!1,h=!1,m=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function y(t){var r=n,o=i;return n=i=void 0,u=t,a=e.apply(o,r)}function E(e){return u=e,s=setTimeout(b,t),c?y(e):a}function _(e){var r=e-l;return void 0===l||r>=t||r<0||h&&e-u>=o}function b(){var e=p();if(_(e))return I(e);s=setTimeout(b,function(e){var r=t-(e-l);return h?f(r,o-(e-u)):r}(e))}function I(e){return s=void 0,m&&n?y(e):(n=i=void 0,a)}function O(){var e=p(),r=_(e);if(n=arguments,i=this,l=e,r){if(void 0===s)return E(l);if(h)return s=setTimeout(b,t),y(l)}return void 0===s&&(s=setTimeout(b,t)),a}return t=v(t)||0,g(r)&&(c=!!r.leading,o=(h="maxWait"in r)?d(v(r.maxWait)||0,t):o,m="trailing"in r?!!r.trailing:m),O.cancel=function(){void 0!==s&&clearTimeout(s),u=0,n=l=i=s=void 0},O.flush=function(){return void 0===s?a:I(p())},O}}).call(this,r(17))},,,function(e,t,r){"use strict";var n="undefined"!=typeof localStorage&&null!==localStorage,i={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 r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];n&&(localStorage[e]=r?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],r=!(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,a=e+"-exp",s=i.get(e,t),l=i.get(a,t);return s&&l<Date.now()?(i.delete([e,a]),r&&(i.set(e,s,t),i.set(a,Date.now()+n,t)),o):s},manageWithExpiration:function(e,t,r){var n=i.get(e),o=new Date;if(n){if(o.getTime()<=n.expiry)return n.value;i.delete(e)}var a={value:t,expiry:o.getTime()+24*r*60*60*1e3};return i.set(e,a),t}};t.a=i},function(e,t,r){"use strict";var n=r(12),i=r(4),o={REVISION:"ff2e8611614e102b56518502a13ad722352981c4"}.OPTIMIZELY_SDK_KEY,a={datafile:window.optimizelyDatafile};i.a.isLocal()||(a.sdkKey=o);var s=document.getElementById("optimizelySDKEnabled")?Object(n.createInstance)(a):null,l=r(0);function u(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],l=!0,u=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return c(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))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 r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}r.d(t,"a",(function(){return p})),r.d(t,"c",(function(){return g})),r.d(t,"b",(function(){return v}));var d=function(){var e,t,r=function(){var e=l.a.readCookie("optimizelyUserId");return e||null}();if(r)l.a.l("User profile found in cookie. Using existing user profile.");else{l.a.l("User profile not found in cookie. Creating a new user profile...");var n=l.a.getRandomString(9);e=n,t=JSON.stringify(e),l.a.createCookie("optimizelyUserId",t,151),r=n}return r},f=function(){return s?(Object(n.setLogger)(null),s.createUserContext(d())):null},p=function(e){var t=f();return!!t&&t.decide(e)},g=function(e){var t=f();t&&Object.entries(e).forEach((function(e){var r=u(e,2),n=r[0],i=r[1];t.setAttribute(n,i)}))},v=function(e,t){var r=f();r&&r.trackEvent(e,t)}},,function(e,t,r){"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"]},i={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"]},a={es:1,mx:1,ar:1,en:0,fr:1,pt:1,br:1,it:1},s={formatDay:function(e,t){var r;return r=e,e=new Date(r.getUTCFullYear(),r.getUTCMonth(),r.getUTCDate(),r.getUTCHours(),r.getUTCMinutes(),r.getUTCSeconds()),n[t][e.getDay()]+", "+e.getDate()+" "+o[t][e.getMonth()]+" "+e.getFullYear()},formatWeekdayShort:function(e,t){return i[t][e]},formatWeekdayLong:function(e,t){return n[t][e]},getFirstDayOfWeek:function(e){return a[e]},getMonths:function(e){return o[e]},formatMonthTitle:function(e,t){return"".concat(o[t][e.getMonth()]," ").concat(e.getFullYear())}};t.a=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,i=r(32),o=r(27),a=(n=r(28))&&"object"==typeof n&&"default"in n?n.default:n,s=r(29),l=function(e,t){return(l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)};function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}l(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var c=function(){return(c=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function d(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{l(n.next(e))}catch(e){o(e)}}function s(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}l((n=n.apply(e,t||[])).next())}))}function f(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}function p(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var g=new(function(){function e(){}return e.prototype.handleError=function(e){},e}());function v(){return g}var h=Math.pow(2,53);function m(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(!e)return{};if("function"==typeof Object.assign)return Object.assign.apply(Object,p([e],t,!1));for(var n=Object(e),i=0;i<t.length;i++){var o=t[i];if(null!=o)for(var a in o)Object.prototype.hasOwnProperty.call(o,a)&&(n[a]=o[a])}return n}function y(e,t){return e?w(e,(function(e){return e[t]})):{}}function E(){return i.v4()}function _(){return(new Date).getTime()}function b(e,t){for(var r=!1,n=Object.keys(e),i=0;i<n.length;i++)if(t===e[n[i]]){r=!0;break}return r}function I(e){return Object.keys(e).map((function(t){return e[t]}))}function O(e){return Object.keys(e).map((function(t){return[t,e[t]]}))}function A(e,t){for(var r,n=0,i=e;n<i.length;n++){var o=i[n];if(t(o)){r=o;break}}return r}function w(e,t){var r={};return e.forEach((function(e){var n=t(e);r[n]=e})),r}function T(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var n=0;return e.replace(/%s/g,(function(){var e=t[n++],r=typeof e;return"function"===r?e():"string"===r?e:String(e)}))}function S(e,t){return e.length===t.length&&e.every((function(e,r){return e===t[r]}))}var R,N={assign:m,checkArrayEquality:S,currentTimestamp:function(){return Math.round((new Date).getTime())},isSafeInteger:function(e){return"number"==typeof e&&Math.abs(e)<=h},keyBy:y,uuid:E,isNumber:function(e){return"number"==typeof e},getTimestamp:_,isValidEnum:b,groupBy:function(e,t){var r={};return e.forEach((function(e){var n=t(e);r[n]=r[n]||[],r[n].push(e)})),I(r)},objectValues:I,objectEntries:O,find:A,keyByUtil:w,sprintf:T};(R=t.LogLevel||(t.LogLevel={}))[R.NOTSET=0]="NOTSET",R[R.DEBUG=1]="DEBUG",R[R.INFO=2]="INFO",R[R.WARNING=3]="WARNING",R[R.ERROR=4]="ERROR";var D={NOTSET:0,DEBUG:1,INFO:2,WARNING:3,ERROR:4};function C(e){return"string"!=typeof e?e:("WARN"===(e=e.toUpperCase())&&(e="WARNING"),D[e]?D[e]:e)}var U=function(){function e(){this.defaultLoggerFacade=new k,this.loggers={}}return e.prototype.getLogger=function(e){return e?(this.loggers[e]||(this.loggers[e]=new k({messagePrefix:e})),this.loggers[e]):this.defaultLoggerFacade},e}(),P=function(){function e(e){void 0===e&&(e={}),this.logLevel=t.LogLevel.NOTSET,void 0!==e.logLevel&&b(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 r="".concat(this.prefix," - ").concat(this.getLogLevelName(e)," ").concat(this.getTime()," ").concat(t);this.consoleLog(e,[r])}},e.prototype.setLogLevel=function(e){e=C(e),b(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,r){switch(e){case t.LogLevel.DEBUG:console.log.apply(console,r);break;case t.LogLevel.INFO:console.info.apply(console,r);break;case t.LogLevel.WARNING:console.warn.apply(console,r);break;case t.LogLevel.ERROR:console.error.apply(console,r);break;default:console.log.apply(console,r)}},e}(),L=t.LogLevel.NOTSET,M=null,k=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 r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];this.internalLog(C(e),{message:t,splat:r})},e.prototype.info=function(e){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];this.namedLog(t.LogLevel.INFO,e,r)},e.prototype.debug=function(e){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];this.namedLog(t.LogLevel.DEBUG,e,r)},e.prototype.warn=function(e){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];this.namedLog(t.LogLevel.WARNING,e,r)},e.prototype.error=function(e){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];this.namedLog(t.LogLevel.ERROR,e,r)},e.prototype.format=function(e){return"".concat(this.messagePrefix?this.messagePrefix+": ":"").concat(T.apply(void 0,p([e.message],e.splat,!1)))},e.prototype.internalLog=function(e,t){M&&(e<L||(M.log(e,this.format(t)),t.error&&t.error instanceof Error&&v().handleError(t.error)))},e.prototype.namedLog=function(e,t,r){var n;if(t instanceof Error)return t=(n=t).message,void this.internalLog(e,{error:n,message:t,splat:r});if(0!==r.length){var i=r[r.length-1];i instanceof Error&&(n=i,r.splice(-1)),this.internalLog(e,{message:t,error:n,splat:r})}else this.internalLog(e,{message:t,splat:r})},e}(),F=new U;function x(e){return F.getLogger(e)}function V(e){M=e}var j={setLogLevel:function(e){e=C(e),L=b(t.LogLevel,e)&&void 0!==e?e:t.LogLevel.ERROR},setLogHandler:V};function G(e,t){var r=e.context,n=t.context;return r.accountId===n.accountId&&r.projectId===n.projectId&&r.clientName===n.clientName&&r.clientVersion===n.clientVersion&&r.revision===n.revision&&r.anonymizeIP===n.anonymizeIP&&r.botFiltering===n.botFiltering}var B,$,K,H=x("EventProcessor"),q=function(){function e(e){var t=e.timeout,r=e.callback;this.timeout=Math.max(t,0),this.callback=r}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}(),z=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}(),Y=function(){function e(e){var t=e.flushInterval,r=e.maxQueueSize,n=e.sink,i=e.closingSink,o=e.batchComparator;this.buffer=[],this.maxQueueSize=Math.max(r,1),this.sink=n,this.closingSink=i,this.batchComparator=o,this.timer=new q({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}(),W={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 invalid 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 invalid 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:"%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"},re={BOOLEAN:"boolean",DOUBLE:"double",INTEGER:"integer",STRING:"string",JSON:"json"},ne={V2:"2",V3:"3",V4:"4"},ie={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 invalid 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"}($||($={})),function(e){e.IDENTIFIED="identified",e.INITIALIZED="client_initialized"}(K||(K={}));var oe=Object.freeze({__proto__:null,LOG_LEVEL:W,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:re,DATAFILE_VERSIONS:ne,DECISION_MESSAGES:ie,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 $},FS_USER_ID_ALIAS:"fs-user-id",ODP_DEFAULT_EVENT_TYPE:"fullstack",get ODP_EVENT_ACTION(){return K}}),ae=x("EventProcessor"),se=x("EventProcessor"),le=function(){function e(e){var t=e.key,r=e.maxValues,n=void 0===r?1e3:r;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 r=this.getMap();r[e]=t,this.replace(r)},e.prototype.remove=function(e){var t=this.getMap();delete t[e],this.replace(t)},e.prototype.values=function(){return I(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){se.error(String(e))}},e.prototype.clean=function(){var e=this.getMap(),t=Object.keys(e),r=t.length-this.maxValues;if(!(r<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 i=0;i<r;i++)delete e[n[i].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){se.error(e)}return{}},e}(),ue=x("EventProcessor"),ce=function(e){function t(t){var r=t.eventDispatcher;return e.call(this,{eventDispatcher:r,store:new le({maxValues:100,key:"fs_optly_pending_events"})})||this}return u(t,e),t}(function(){function e(e){var t=e.eventDispatcher,r=e.store;this.dispatcher=t,this.store=r}return e.prototype.dispatchEvent=function(e,t){this.send({uuid:E(),timestamp:_(),request:e},t)},e.prototype.sendPendingEvents=function(){var e=this,t=this.store.values();ue.debug("Sending %s pending events from previous page",t.length),t.forEach((function(t){try{e.send(t,(function(){}))}catch(e){ue.debug(String(e))}}))},e.prototype.send=function(e,t){var r=this;this.store.set(e.uuid,e),this.dispatcher.dispatchEvent(e.request,(function(n){r.store.remove(e.uuid),t(n)}))},e}());function de(e){var t=[],r=e[0];return e.forEach((function(e){if("conversion"===e.type||"impression"===e.type){var r=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?r.snapshots.push(function(e){var t,r,n=e.layer,i=e.experiment,o=e.variation,a=e.ruleKey,s=e.flagKey,l=e.ruleType,u=e.enabled,c=n?n.id:null;return{decisions:[{campaign_id:c,experiment_id:null!==(t=null==i?void 0:i.id)&&void 0!==t?t:"",variation_id:null!==(r=null==o?void 0:o.id)&&void 0!==r?r:"",metadata:{flag_key:s,rule_key:a,rule_type:l,variation_key:o?o.key:"",enabled:u}}],events:[{entity_id:c,timestamp:e.timestamp,key:"campaign_activated",uuid:e.uuid}]}}(e)):"conversion"===e.type&&r.snapshots.push(function(e){var t=c({},e.tags);delete t.revenue,delete t.value;var r={entity_id:e.event.id,key:e.event.key,timestamp:e.timestamp,uuid:e.uuid};return e.tags&&(r.tags=e.tags),null!=e.value&&(r.value=e.value),null!=e.revenue&&(r.revenue=e.revenue),{events:[r]}}(e)),t.push(r)}})),{client_name:r.context.clientName,client_version:r.context.clientVersion,account_id:r.context.accountId,project_id:r.context.projectId,revision:r.context.revision,anonymize_ip:r.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 r=function(){t.reqsInFlightCount--,0===t.reqsInFlightCount&&(t.reqsCompleteResolvers.forEach((function(e){return e()})),t.reqsCompleteResolvers=[])};e.then(r,r)},e.prototype.onRequestsComplete=function(){var e=this;return new Promise((function(t){0===e.reqsInFlightCount?t():e.reqsCompleteResolvers.push(t)}))},e}(),pe=x("LogTierV1EventProcessor"),ge=function(){function e(e){var t=e.dispatcher,r=e.closingDispatcher,n=e.flushInterval,i=void 0===n?3e4:n,o=e.batchSize,a=void 0===o?10:o,s=e.notificationCenter;this.dispatcher=t,this.closingDispatcher=r,this.notificationCenter=s,this.requestTracker=new fe,i=function(e){return e<=0&&(ae.warn("Invalid flushInterval ".concat(e,", defaulting to ").concat(3e4)),e=3e4),e}(i),a=function(e){return(e=Math.floor(e))<1&&(ae.warn("Invalid batchSize ".concat(e,", defaulting to ").concat(10)),e=10),Math.max(1,e)}(a),this.queue=function(e,t,r,n,i){return e>1?new Y({flushInterval:t,maxQueueSize:e,sink:n,closingSink:i,batchComparator:r}):new z({sink:n})}(a,i,G,this.drainQueue.bind(this,!1),this.drainQueue.bind(this,!0))}return e.prototype.drainQueue=function(e,t){var r=this,n=new Promise((function(n){if(pe.debug("draining queue with %s events",t.length),0!==t.length){var i,o,a={url:"https://logx.optimizely.com/v1/events",httpVerb:"POST",params:de(t)};(e&&r.closingDispatcher?r.closingDispatcher:r.dispatcher).dispatchEvent(a,(function(){n()})),o=a,(i=r.notificationCenter)&&i.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){pe.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",he=[ne.V2,ne.V3,ne.V4],me={handleError:function(){}},ye={dispatchEvent:function(e,t){var r,n=e.params,i=e.url;"POST"===e.httpVerb?((r=new XMLHttpRequest).open("POST",i,!0),r.setRequestHeader("Content-Type","application/json"),r.onreadystatechange=function(){if(4===r.readyState&&t&&"function"==typeof t)try{t({statusCode:r.status})}catch(e){}},r.send(JSON.stringify(n))):(i+="?wxhr=true",n&&(i+="&"+function(e){return Object.keys(e).map((function(t){return encodeURIComponent(t)+"="+encodeURIComponent(e[t])})).join("&")}(n)),(r=new XMLHttpRequest).open("GET",i,!0),r.onreadystatechange=function(){if(4===r.readyState&&t&&"function"==typeof t)try{t({statusCode:r.status})}catch(e){}},r.send())}},Ee={dispatchEvent:function(e,t){var r=e.params,n=e.url,i=new Blob([JSON.stringify(r)],{type:"application/json"});t({statusCode:navigator.sendBeacon(n,i)?200:500})}},_e=function(){function e(){}return e.prototype.log=function(){},e}();function be(e){return new P(e)}var Ie=Object.freeze({__proto__:null,NoOpLogger:_e,createLogger:be,createNoOpLogger:function(){return new _e}}),Oe=function(){function e(e){var t=this;this.logger=e.logger,this.errorHandler=e.errorHandler,this.notificationListeners={},I(B).forEach((function(e){t.notificationListeners[e]=[]})),this.listenerId=1}return e.prototype.addNotificationListener=function(e,t){try{if(!(I(B).indexOf(e)>-1))return-1;this.notificationListeners[e]||(this.notificationListeners[e]=[]);var r=!1;if((this.notificationListeners[e]||[]).forEach((function(e){e.callback!==t||(r=!0)})),r)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(W.ERROR,e.message),this.errorHandler.handleError(e),-1}},e.prototype.removeNotificationListener=function(e){var t=this;try{var r,n;if(Object.keys(this.notificationListeners).some((function(i){return(t.notificationListeners[i]||[]).every((function(t,o){return t.id!==e||(r=o,n=i,!1)})),void 0!==r&&void 0!==n})),void 0!==r&&void 0!==n)return this.notificationListeners[n].splice(r,1),!0}catch(e){this.logger.log(W.ERROR,e.message),this.errorHandler.handleError(e)}return!1},e.prototype.clearAllNotificationListeners=function(){var e=this;try{I(B).forEach((function(t){e.notificationListeners[t]=[]}))}catch(e){this.logger.log(W.ERROR,e.message),this.errorHandler.handleError(e)}},e.prototype.clearNotificationListeners=function(e){try{this.notificationListeners[e]=[]}catch(e){this.logger.log(W.ERROR,e.message),this.errorHandler.handleError(e)}},e.prototype.sendNotifications=function(e,t){var r=this;try{(this.notificationListeners[e]||[]).forEach((function(n){var i=n.callback;try{i(t)}catch(t){r.logger.log(W.ERROR,X.NOTIFICATION_LISTENER_EXCEPTION,"NOTIFICATION_CENTER",e,t.message)}}))}catch(e){this.logger.log(W.ERROR,e.message),this.errorHandler.handleError(e)}},e}();function Ae(e){return new Oe(e)}var we,Te,Se,Re=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return new(ge.bind.apply(ge,p([void 0],e,!1)))};(we=t.OptimizelySegmentOption||(t.OptimizelySegmentOption={})).IGNORE_CACHE="IGNORE_CACHE",we.RESET_CACHE="RESET_CACHE",function(e){e.BOOLEAN="boolean",e.DOUBLE="double",e.INTEGER="integer",e.STRING="string",e.JSON="json"}(Te||(Te={})),(Se=t.OptimizelyDecideOption||(t.OptimizelyDecideOption={})).DISABLE_DECISION_EVENT="DISABLE_DECISION_EVENT",Se.ENABLED_FLAGS_ONLY="ENABLED_FLAGS_ONLY",Se.IGNORE_USER_PROFILE_SERVICE="IGNORE_USER_PROFILE_SERVICE",Se.INCLUDE_REASONS="INCLUDE_REASONS",Se.EXCLUDE_VARIABLES="EXCLUDE_VARIABLES";var Ne="Polling intervals below ".concat(30," seconds are not recommended."),De=[0,8,16,32,64,128,256,512],Ce=x("DatafileManager");var Ue=function(){function e(){this.listeners={},this.listenerId=1}return e.prototype.on=function(e,t){var r=this;this.listeners[e]||(this.listeners[e]={});var n=String(this.listenerId);return this.listenerId++,this.listeners[e][n]=t,function(){r.listeners[e]&&delete r.listeners[e][n]}},e.prototype.emit=function(e,t){var r=this.listeners[e];r&&Object.keys(r).forEach((function(e){(0,r[e])(t)}))},e.prototype.removeAllListeners=function(){this.listeners={}},e}(),Pe=function(){function e(){this.errorCount=0}return e.prototype.getDelay=function(){return 0===this.errorCount?0:1e3*De[Math.min(De.length-1,this.errorCount)]+Math.round(1e3*Math.random())},e.prototype.countError=function(){this.errorCount<De.length-1&&this.errorCount++},e.prototype.reset=function(){this.errorCount=0},e}(),Le=function(){function e(){}return e.getNotificationCenter=function(e,r){var n;if(void 0===r&&(r=x()),e)return this._notificationCenters.has(e)?n=this._notificationCenters.get(e):(n=Ae({logger:r,errorHandler:{handleError:function(){}}}),this._notificationCenters.set(e,n)),n;r.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}(),Me=x("DatafileManager");function ke(e){return e>=200&&e<400}var Fe={get:function(){return Promise.resolve(void 0)},set:function(){return Promise.resolve()},contains:function(){return Promise.resolve(!1)},remove:function(){return Promise.resolve(!1)}},xe=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return u(t,e),t.prototype.makeGetRequest=function(e,t){return function(e,t){var r=new XMLHttpRequest;return{responsePromise:new Promise((function(n,i){r.open("GET",e,!0),function(e,t){Object.keys(e).forEach((function(r){var n=e[r];t.setRequestHeader(r,n)}))}(t,r),r.onreadystatechange=function(){if(4===r.readyState){if(0===r.status)return void i(new Error("Request error"));var e=function(e){var t=e.getAllResponseHeaders();if(null===t)return{};var r=t.split("\r\n"),n={};return r.forEach((function(e){var t=e.indexOf(": ");if(t>-1){var r=e.slice(0,t),i=e.slice(t+2);i.length>0&&(n[r]=i)}})),n}(r),t={statusCode:r.status,body:r.responseText,headers:e};n(t)}},r.timeout=6e4,r.ontimeout=function(){Ce.error("Request timed out")},r.send()})),abort:function(){r.abort()}}}(e,t)},t.prototype.getConfigDefaults=function(){return{autoUpdate:!1}},t}(function(){function e(e){var t=this,r=c(c({},this.getConfigDefaults()),e),n=r.datafile,i=r.autoUpdate,o=void 0!==i&&i,a=r.sdkKey,s=r.updateInterval,l=void 0===s?3e5:s,u=r.urlTemplate,d=void 0===u?"https://cdn.optimizely.com/datafiles/%s.json":u,f=r.cache,p=void 0===f?Fe:f;this.cache=p,this.cacheKey="opt-datafile-"+a,this.sdkKey=a,this.isReadyPromiseSettled=!1,this.readyPromiseResolver=function(){},this.readyPromiseRejecter=function(){},this.readyPromise=new Promise((function(e,r){t.readyPromiseResolver=e,t.readyPromiseRejecter=r})),n?(this.currentDatafile=n,a||this.resolveReadyPromise()):this.currentDatafile="",this.isStarted=!1,this.datafileUrl=T(d,a),this.emitter=new Ue,this.autoUpdate=o,this.updateInterval=l,this.updateInterval<3e4&&Me.warn(Ne),this.currentTimeout=null,this.currentRequest=null,this.backoffController=new Pe,this.syncOnCurrentRequestComplete=!1}return e.prototype.get=function(){return this.currentDatafile},e.prototype.start=function(){this.isStarted||(Me.debug("Datafile manager started"),this.isStarted=!0,this.backoffController.reset(),this.setDatafileFromCacheIfAvailable(),this.syncDatafile())},e.prototype.stop=function(){return Me.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?Me.error("Error fetching datafile: %s",e.message,e):"string"==typeof e?Me.error("Error fetching datafile: %s",e):Me.error("Error fetching datafile"))},e.prototype.onRequestResolved=function(e){var t;if(this.isStarted){void 0!==e.statusCode&&ke(e.statusCode)?this.backoffController.reset():this.backoffController.countError(),this.trySavingLastModified(e.headers);var r=this.getNextDatafileFromResponse(e);if(""!==r)if(Me.info("Updating datafile from response"),this.currentDatafile=r,this.cache.set(this.cacheKey,r),this.isReadyPromiseSettled){var n={datafile:r};null===(t=Le.getNotificationCenter(this.sdkKey,Me))||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),Me.debug("Making datafile request to url %s with headers: %s",this.datafileUrl,(function(){return JSON.stringify(t)})),this.currentRequest=this.makeGetRequest(this.datafileUrl,t);var r=function(){e.onRequestComplete()};this.currentRequest.responsePromise.then((function(t){e.onRequestResolved(t)}),(function(t){e.onRequestRejected(t)})).then(r,r),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(),r=Math.max(t,this.updateInterval);Me.debug("Scheduling sync in %s ms",r),this.currentTimeout=setTimeout((function(){e.currentRequest?e.syncOnCurrentRequestComplete=!0:e.syncDatafile()}),r)},e.prototype.getNextDatafileFromResponse=function(e){return Me.debug("Response status code: %s",e.statusCode),void 0===e.statusCode||304===e.statusCode?"":ke(e.statusCode)?e.body:(Me.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,Me.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&&(Me.debug("Using datafile from cache"),e.currentDatafile=t,e.resolveReadyPromise())}))},e}()),Ve="PROJECT_CONFIG",je=function(e,t){void 0===t&&(t=null);var r,n,i,o,a=((o=m({},r=e)).audiences=(r.audiences||[]).map((function(e){return m({},e)})),o.experiments=(r.experiments||[]).map((function(e){return m({},e)})),o.featureFlags=(r.featureFlags||[]).map((function(e){return m({},e)})),o.groups=(r.groups||[]).map((function(e){var t=m({},e);return t.experiments=(e.experiments||[]).map((function(e){return m({},e)})),t})),o.rollouts=(r.rollouts||[]).map((function(e){var t=m({},e);return t.experiments=(e.experiments||[]).map((function(e){return m({},e)})),t})),o.environmentKey=null!==(n=r.environmentKey)&&void 0!==n?n:"",o.sdkKey=null!==(i=r.sdkKey)&&void 0!==i?i:"",o);a.__datafileStr=null===t?JSON.stringify(e):t,(a.audiences||[]).forEach((function(e){e.conditions=JSON.parse(e.conditions)})),a.audiencesById=y(a.audiences,"id"),m(a.audiencesById,y(a.typedAudiences,"id")),a.allSegments=[];var s=new Set;return Object.keys(a.audiencesById).map((function(e){return Ge(a.audiencesById[e])})).forEach((function(e){e.forEach((function(e){s.add(e)}))})),a.allSegments=Array.from(s),a.attributeKeyMap=y(a.attributes,"key"),a.eventKeyMap=y(a.events,"key"),a.groupIdMap=y(a.groups,"id"),Object.keys(a.groupIdMap||{}).forEach((function(e){(a.groupIdMap[e].experiments||[]).forEach((function(t){a.experiments.push(m(t,{groupId:e}))}))})),a.rolloutIdMap=y(a.rollouts||[],"id"),I(a.rolloutIdMap||{}).forEach((function(e){(e.experiments||[]).forEach((function(e){a.experiments.push(e),e.variationKeyMap=y(e.variations,"key")}))})),a.integrations&&(a.integrationKeyMap=y(a.integrations,"key"),a.integrations.forEach((function(e){if(!("key"in e))throw new Error(T(J.MISSING_INTEGRATION_KEY,Ve));"odp"===e.key&&(e.publicKey&&!a.publicKeyForOdp&&(a.publicKeyForOdp=e.publicKey),e.host&&!a.hostForOdp&&(a.hostForOdp=e.host),e.pixelUrl&&!a.pixelUrlForOdp&&(a.pixelUrlForOdp=e.pixelUrl))}))),a.experimentKeyMap=y(a.experiments,"key"),a.experimentIdMap=y(a.experiments,"id"),a.variationIdMap={},a.variationVariableUsageMap={},(a.experiments||[]).forEach((function(e){e.variationKeyMap=y(e.variations,"key"),m(a.variationIdMap,y(e.variations,"id")),I(e.variationKeyMap||{}).forEach((function(e){e.variables&&(a.variationVariableUsageMap[e.id]=y(e.variables,"id"))}))})),a.experimentFeatureMap={},a.featureKeyMap=y(a.featureFlags||[],"key"),I(a.featureKeyMap||{}).forEach((function(e){e.variables.forEach((function(e){e.type===re.STRING&&e.subType===re.JSON&&(e.type=re.JSON,delete e.subType)})),e.variableKeyMap=y(e.variables,"key"),(e.experimentIds||[]).forEach((function(t){a.experimentFeatureMap[t]?a.experimentFeatureMap[t].push(e.id):a.experimentFeatureMap[t]=[e.id]}))})),a.flagRulesMap={},(a.featureFlags||[]).forEach((function(e){var t=[];e.experimentIds.forEach((function(e){var r=a.experimentIdMap[e];r&&t.push(r)}));var r=a.rolloutIdMap[e.rolloutId];r&&t.push.apply(t,r.experiments),a.flagRulesMap[e.key]=t})),a.flagVariationsMap={},O(a.flagRulesMap||{}).forEach((function(e){var t=e[0],r=e[1],n=[];r.forEach((function(e){e.variations.forEach((function(e){A(n,(function(t){return t.id===e.id}))||n.push(e)}))})),a.flagVariationsMap[t]=n})),a},Ge=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)},$e=function(e,t){var r=e.experimentIdMap[t];if(!r)throw new Error(T(J.INVALID_EXPERIMENT_ID,Ve,t));return r.layerId},Ke=function(e,t,r){var n=e.attributeKeyMap[t],i=0===t.indexOf("$opt_");return n?(i&&r.log(W.WARNING,"Attribute %s unexpectedly has reserved prefix %s; using attribute ID instead of reserved attribute name.",t,"$opt_"),n.id):i?t:(r.log(W.DEBUG,J.UNRECOGNIZED_ATTRIBUTE,Ve,t),null)},He=function(e,t){var r=e.eventKeyMap[t];return r?r.id:null},qe=function(e,t){var r=e.experimentKeyMap[t];if(!r)throw new Error(T(J.INVALID_EXPERIMENT_KEY,Ve,t));return r.status},ze=function(e,t){return e.variationIdMap.hasOwnProperty(t)?e.variationIdMap[t].key:null},Ye=function(e,t){if(e.experimentKeyMap.hasOwnProperty(t)){var r=e.experimentKeyMap[t];if(r)return r}throw new Error(T(J.EXPERIMENT_KEY_NOT_IN_DATAFILE,Ve,t))},We=function(e,t){var r=e.experimentIdMap[t];if(!r)throw new Error(T(J.INVALID_EXPERIMENT_ID,Ve,t));return r.trafficAllocation},Je=function(e,t,r){if(e.experimentIdMap.hasOwnProperty(t)){var n=e.experimentIdMap[t];if(n)return n}return r.log(W.ERROR,J.INVALID_EXPERIMENT_ID,Ve,t),null},Xe=function(e,t,r){return e&&A(e.flagVariationsMap[t],(function(e){return e.key===r}))||null},Ze=function(e,t,r){if(e.featureKeyMap.hasOwnProperty(t)){var n=e.featureKeyMap[t];if(n)return n}return r.log(W.ERROR,J.FEATURE_NOT_IN_DATAFILE,Ve,t),null},Qe=function(e){return e.__datafileStr},et=function(e){var t;try{t=function(e){if(!e)throw new Error(T(J.NO_DATAFILE_SPECIFIED,ve));if("string"==typeof e)try{e=JSON.parse(e)}catch(e){throw new Error(T(J.INVALID_DATAFILE_MALFORMED,ve))}if("object"==typeof e&&!Array.isArray(e)&&null!==e&&-1===he.indexOf(e.version))throw new Error(T(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(W.INFO,X.VALID_DATAFILE,Ve)}catch(e){return{configObj:null,error:e}}else e.logger.log(W.INFO,X.SKIPPING_JSON_VALIDATION,Ve);var r=[t];return"string"==typeof e.datafile&&r.push(e.datafile),{configObj:je.apply(void 0,r),error:null}},tt=function(e){return!!e.sendFlagDecisions};function rt(e,t,r,n){var i={sdkKey:e};if((void 0===n||"object"==typeof n&&null!==n)&&N.assign(i,n),r){var o=et({datafile:r,jsonSchemaValidator:void 0,logger:t}),a=o.configObj,s=o.error;s&&t.error(s),a&&(i.datafile=Qe(a))}return new xe(i)}var nt=function(){function e(e,t){void 0===t&&(t=6e4),this.logger=e,this.timeout=t}return e.prototype.makeRequest=function(e,r,n,i){var o=this,a=new XMLHttpRequest;return{responsePromise:new Promise((function(s,l){a.open(n,e,!0),o.setHeadersInXhr(r,a),a.onreadystatechange=function(){if(a.readyState===XMLHttpRequest.DONE){if(0===a.status)return void l(new Error("Request error"));var e=o.parseHeadersFromXhr(a),t={statusCode:a.status,body:a.responseText,headers:e};s(t)}},a.timeout=o.timeout,a.ontimeout=function(){o.logger.log(t.LogLevel.WARNING,"Request timed out")},a.send(i)})),abort:function(){a.abort()}}},e.prototype.setHeadersInXhr=function(e,t){Object.keys(e).forEach((function(r){var n=e[r];"string"==typeof n&&t.setRequestHeader(r,n)}))},e.prototype.parseHeadersFromXhr=function(e){var r=this,n=e.getAllResponseHeaders();if(null===n)return{};var i=n.split("\r\n"),o={};return i.forEach((function(e){try{var n=e.indexOf(": ");if(n>-1){var i=e.slice(0,n),a=e.slice(n+2);i&&a&&(o[i]=a)}}catch(n){r.logger.log(t.LogLevel.WARNING,"Unable to parse & skipped header item '".concat(e,"'"))}})),o},e}(),it=function(e){var t=e.browserCallback,r=e.nonBrowserCallback;return"undefined"!=typeof window?t(null===window||void 0===window?void 0:window.localStorage):r()},ot=function(){function e(){this.logger=x()}return e.prototype.contains=function(e){return d(this,void 0,void 0,(function(){var t=this;return f(this,(function(r){return[2,it({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(r){return[2,it({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(r){switch(r.label){case 0:return[4,this.contains(e)];case 1:return r.sent()?(it({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 r=this;return f(this,(function(n){return[2,it({browserCallback:function(r){null==r||r.setItem(e,t)},nonBrowserCallback:function(){r.logger.error(J.LOCAL_STORAGE_DOES_NOT_EXIST)}})]}))}))},e}(),at=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},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}(),st=function(){function e(e){var t=e.maxSize,r=e.timeout;this._map=new Map;var n=x();n.debug("Provisioning cache with maxSize of ".concat(t)),n.debug("Provisioning cache with timeout of ".concat(r)),this._maxSize=t,this._timeout=r}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,r=e.value;if(!(this._maxSize<=0)&&(this._map.get(t)&&this._map.delete(t),this._map.set(t,new at(r)),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 r=this._map.get(e);return null!==(t=null==r?void 0:r.value)&&void 0!==t?t:null},e}(),lt=function(e){function t(t){var r,n;return e.call(this,{maxSize:null!==(r=null==t?void 0:t.maxSize)&&void 0!==r?r:100,timeout:null!==(n=null==t?void 0:t.timeout)&&void 0!==n?n:6e5})||this}return u(t,e),t}(st),ut=(function(e){u((function(t){var r,n;return e.call(this,{maxSize:null!==(r=null==t?void 0:t.maxSize)&&void 0!==r?r:1e4,timeout:null!==(n=null==t?void 0:t.timeout)&&void 0!==n?n:6e5})||this}),e)}(st),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(r){switch(r.label){case 0:return this._instance||(this._instance=new e),this._instance._vuid?[3,2]:[4,this._instance.load(t)];case 1:r.sent(),r.label=2;case 2:return[2,this._instance]}}))}))},e.prototype.load=function(t){return d(this,void 0,void 0,(function(){var r;return f(this,(function(n){switch(n.label){case 0:return[4,t.get(this._keyForVuid)];case 1:return(r=n.sent())&&e.isVuid(r)?(this._vuid=r,[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=E().replace(/-/g,"").toLowerCase(),r="".concat(e.vuid_prefix).concat(t);return r.length<=32?r:r.substring(0,32)},e.prototype.save=function(e,t){return d(this,void 0,void 0,(function(){return f(this,(function(r){switch(r.label){case 0:return[4,t.set(this._keyForVuid,e)];case 1:return r.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}()),ct=function(){function e(e,t,r,n){this._apiKey=null!=e?e:"",this._apiHost=null!=t?t:"",this._pixelUrl=null!=r?r:"",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._apiHost},e.prototype.equals=function(e){return this._apiHost===e._apiHost&&this._apiKey===e._apiKey&&this._pixelUrl===e._pixelUrl&&S(this.segmentsToCheck,e._segmentsToCheck)},e}();function dt(e){var t=["string","number","boolean"],r=!1;return e.forEach((function(e){t.includes(typeof e)||null===e||(r=!0)})),r}var ft,pt=function(e,t,r,n){this.type=e,this.action=t,this.identifiers=null!=r?r:new Map,this.data=null!=n?n:new Map},gt=function(){function e(){this.enabled=!0,this.logger=x(),this.odpConfig=new ct}return e.prototype.updateSettings=function(e){var r,n=e.apiKey,i=e.apiHost,o=e.pixelUrl,a=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 s=new ct(n,i,o,a);return!!this.odpConfig.update(s)&&(this.odpConfig.update(s),null===(r=this.segmentManager)||void 0===r||r.reset(),!0)},e.prototype.close=function(){var e;this.enabled&&(null===(e=this.eventManager)||void 0===e||e.stop())},e.prototype.fetchQualifiedSegments=function(e,r){return void 0===r&&(r=[]),d(this,void 0,void 0,(function(){return f(this,(function(n){return this.enabled?this.segmentManager?ut.isVuid(e)?[2,this.segmentManager.fetchQualifiedSegments($.VUID,e,r)]:[2,this.segmentManager.fetchQualifiedSegments($.FS_USER_ID,e,r)]:(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,r){this.enabled?this.odpConfig.isReady()?this.eventManager?e&&ut.isVuid(e)?this.eventManager.identifyUser(void 0,e):this.eventManager.identifyUser(e,r):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,r=e.action,n=e.identifiers,i=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(i))throw new Error(J.ODP_INVALID_DATA);if(!this.eventManager)throw new Error(J.ODP_SEND_EVENT_FAILED_EVENT_MANAGER_MISSING);if("string"!=typeof r||""===r)throw new Error("ODP action is not valid (cannot be empty).");this.eventManager.sendEvent(new pt(o,r,n,i))},e}(),vt=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return u(r,e),r.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)},r.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},r.prototype.generateRequestData=function(e){var r;if(!(null===(r=this.odpConfig)||void 0===r?void 0:r.isReady()))throw this.getLogger().log(t.LogLevel.ERROR,"ODP config not ready"),new Error("ODP config not ready");var n=this.getPixelApiEndpoint(),i=this.odpConfig.apiKey,o=e[0],a=new URL(n);return o.identifiers.forEach((function(e,t){a.searchParams.append(t,e)})),o.data.forEach((function(e,t){a.searchParams.append(t,e)})),a.searchParams.append("tracker_id",i),a.searchParams.append("event_type",o.type),a.searchParams.append("vdl_action",o.action),{method:"GET",endpoint:a.toString(),headers:{},data:""}},r}(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 r,n;return d(this,void 0,void 0,(function(){var i,o,a,s,l,u,c,d,p,g;return f(this,(function(f){switch(f.label){case 0:if(i=!1,!(null===(r=this.odpConfig)||void 0===r?void 0:r.isReady()))return this.logger.log(t.LogLevel.ERROR,"".concat("ODP event send failed"," (").concat("ODP config not ready",")")),[2,i];if(0===e.length)return this.logger.log(t.LogLevel.ERROR,"".concat("ODP event send failed"," (no events)")),[2,i];if(!this.shouldSendEvents(e))return[2,i];o=this.generateRequestData(e),a=o.method,s=o.endpoint,l=o.headers,u=o.data,c=0,f.label=1;case 1:return f.trys.push([1,3,,4]),[4,this.requestHandler.makeRequest(s,l,a,u).responsePromise];case 2:return d=f.sent(),c=null!==(n=d.statusCode)&&void 0!==n?n:c,[3,4];case 3:return p=f.sent(),g="network error",p instanceof Error&&(g=p.message),this.logger.log(t.LogLevel.ERROR,"".concat("ODP event send failed"," (").concat(g,")")),i=!0,[3,4];case 4:return c>=400&&this.logger.log(t.LogLevel.ERROR,"".concat("ODP event send failed"," (").concat(c,")")),c>=500&&(i=!0),[2,i]}}))}))},e}());!function(e){e[e.STOPPED=0]="STOPPED",e[e.RUNNING=1]="RUNNING",e[e.PROCESSING=2]="PROCESSING"}(ft||(ft={}));var ht=function(e){function r(){var t=null!==e&&e.apply(this,arguments)||this;return t.hasNecessaryIdentifiers=function(e){return e.identifiers.size>=0},t}return u(r,e),r.prototype.initParams=function(e,r,n){this.queueSize=r||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.")},r.prototype.discardEventsIfNeeded=function(){this.getLogger().log(t.LogLevel.DEBUG,"ODPConfig not ready. Leaving events in queue.")},r}(function(){function e(e){var t=e.odpConfig,r=e.apiManager,n=e.logger,i=e.clientEngine,o=e.clientVersion,a=e.queueSize,s=e.batchSize,l=e.flushInterval,u=e.userAgentParser;if(this.state=ft.STOPPED,this.queue=new Array,this.odpConfig=t,this.apiManager=r,this.logger=n,this.clientEngine=i,this.clientVersion=o,this.initParams(s,a,l),this.state=ft.STOPPED,this.userAgentParser=u,u){var c=u.parseUserAgentInfo(),d=c.os,f=c.device,p={os:d.name,os_version:d.version,device_type:f.type,model:f.model};this.userAgentData=new Map(Object.entries(p).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($.VUID,e);var r=new pt("fullstack",K.INITIALIZED,t);this.sendEvent(r)},e.prototype.identifyUser=function(e,r){var n=new Map;if(e||r){r&&n.set($.VUID,r),e&&n.set($.FS_USER_ID,e);var i=new pt("fullstack",K.IDENTIFIED,n);this.sendEvent(i)}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,r=0;r<this.batchSize;r+=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,r;return f(this,(function(n){switch(n.label){case 0:r=0,n.label=1;case 1:return[4,this.apiManager.sendEvents(t)];case 2:e=n.sent(),r+=1,n.label=3;case 3:if(e&&r<3)return[3,1];n.label=4;case 4:return[2]}}))}))}))},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",E()),t.set("data_source_type","sdk"),t.set("data_source",this.clientEngine),t.set("data_source_version",this.clientVersion),e.forEach((function(e,r){return t.set(r,e)})),t},e.prototype.getLogger=function(){return this.logger},e}()),mt=function(){function e(e,t,r,n){this.odpConfig=e,this._segmentsCache=t,this.odpSegmentApiManager=r,this.logger=n||x("OdpSegmentManager")}return Object.defineProperty(e.prototype,"segmentsCache",{get:function(){return this._segmentsCache},enumerable:!1,configurable:!0}),e.prototype.fetchQualifiedSegments=function(e,r,n){return d(this,void 0,void 0,(function(){var i,o,a,s,l,u,c,d,p;return f(this,(function(f){switch(f.label){case 0:if(i=this.odpConfig,o=i.apiHost,!(a=i.apiKey)||!o)return this.logger.log(t.LogLevel.WARNING,J.FETCH_SEGMENTS_FAILED_INVALID_IDENTIFIER),[2,null];if(!(s=this.odpConfig.segmentsToCheck)||s.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,r),u=n.includes(t.OptimizelySegmentOption.IGNORE_CACHE),(c=n.includes(t.OptimizelySegmentOption.RESET_CACHE))&&this.reset(),!u&&!c){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(a,o,e,r,s)];case 1:return(p=f.sent())&&!u&&this._segmentsCache.save({key:l,value:p}),[2,p]}}))}))},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}(),yt={$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"}}}}}},Et={$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"]},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:[]},_t=[],bt=function(){function e(e,t){this.toGraphQLJson=function(e,t,r){return p(p(['{"query" : "query {customer',"(".concat(e,' : \\"').concat(t,'\\") '),"{audiences","(subset: ["],(null==r?void 0:r.map((function(e,t){return'\\"'.concat(e,'\\"').concat(t<r.length-1?",":"")})))||"",!0),[']) {edges {node {name state}}}}}"}'],!1).join("")},this.requestHandler=e,this.logger=t}return e.prototype.fetchSegments=function(e,r,n,i,o){var a,s,l,u;return d(this,void 0,void 0,(function(){var c,d,p,g,v,h,m,y;return f(this,(function(f){switch(f.label){case 0:return e&&r?0===(null==o?void 0:o.length)?[2,_t]:(c="".concat(r,"/v3/graphql"),d=this.toGraphQLJson(n,i,o),[4,this.querySegments(e,c,n,i,d)]):(this.logger.log(t.LogLevel.ERROR,"".concat("Audience segments fetch failed"," (Parameters apiKey or apiHost invalid)")),[2,null]);case 1:return(p=f.sent())?(g=this.parseSegmentsResponseJson(p))?(null===(a=g.errors)||void 0===a?void 0:a.length)>0?(v=g.errors[0].extensions,h=v.code,m=v.classification,"INVALID_IDENTIFIER_EXCEPTION"==h?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]):(y=null===(u=null===(l=null===(s=null==g?void 0:g.data)||void 0===s?void 0:s.customer)||void 0===l?void 0:l.audiences)||void 0===u?void 0:u.edges)?[2,y.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,r,n,i){return d(this,void 0,void 0,(function(){var r,n,o,a;return f(this,(function(s){switch(s.label){case 0:r="POST",n=t,o={"Content-Type":"application/json","x-api-key":e},s.label=1;case 1:return s.trys.push([1,3,,4]),[4,this.requestHandler.makeRequest(n,o,r,i).responsePromise];case 2:return a=s.sent(),[3,4];case 3:return s.sent(),[2,null];case 4:return[2,a.body]}}))}))},e.prototype.parseSegmentsResponseJson=function(e){var t={};try{t=JSON.parse(e)}catch(e){return null}return function(e,t,r){void 0===t&&(t=yt),void 0===r&&(r=!0);var n="".concat("JSON_SCHEMA_VALIDATOR"," (").concat(t.title,")");if("object"!=typeof e||null===e)throw new Error(T(J.NO_JSON_PROVIDED,n));var i=o.validate(e,t);if(i.valid)return!0;if(!r)return!1;if(Array.isArray(i.errors))throw new Error(T(J.INVALID_DATAFILE,n,i.errors[0].property,i.errors[0].message));throw new Error(T(J.INVALID_JSON,n))}(t,Et,!1)?t:null},e}(),It=function(e){function r(n){var i,o,a=n.logger,s=n.odpOptions,l=e.call(this)||this;return l.logger=a||x(),(null==s?void 0:s.disabled)?(l.initPromise=Promise.resolve(),l.enabled=!1,l.logger.log(t.LogLevel.INFO,X.ODP_DISABLED),l):(i=(null==s?void 0:s.segmentsRequestHandler)?s.segmentsRequestHandler:new nt(l.logger,(null==s?void 0:s.segmentsApiTimeout)||1e4),(null==s?void 0:s.segmentManager)?(l.segmentManager=s.segmentManager,l.segmentManager.updateSettings(l.odpConfig)):l.segmentManager=new mt(l.odpConfig,(null==s?void 0:s.segmentsCache)||new lt({maxSize:null==s?void 0:s.segmentsCacheSize,timeout:null==s?void 0:s.segmentsCacheTimeout}),new bt(i,l.logger)),o=(null==s?void 0:s.eventRequestHandler)?s.eventRequestHandler:new nt(l.logger,(null==s?void 0:s.eventApiTimeout)||1e4),(null==s?void 0:s.eventManager)?(l.eventManager=s.eventManager,l.eventManager.updateSettings(l.odpConfig)):l.eventManager=new ht({odpConfig:l.odpConfig,apiManager:new vt(o,l.logger),logger:l.logger,clientEngine:"javascript-sdk",clientVersion:"5.2.1",flushInterval:null==s?void 0:s.eventFlushInterval,batchSize:null==s?void 0:s.eventBatchSize,queueSize:null==s?void 0:s.eventQueueSize,userAgentParser:null==s?void 0:s.userAgentParser}),l.eventManager.start(),l.initPromise=l.initializeVuid(r.cache).catch((function(e){l.logger.log(l.enabled?t.LogLevel.ERROR:t.LogLevel.DEBUG,e)})),l)}return u(r,e),r.prototype.initializeVuid=function(e){return d(this,void 0,void 0,(function(){var t;return f(this,(function(r){switch(r.label){case 0:return[4,ut.instance(e)];case 1:return t=r.sent(),this.vuid=t.vuid,this.registerVuid(this.vuid),[2]}}))}))},r.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)},r.prototype.identifyUser=function(t,r){t&&ut.isVuid(t)?e.prototype.identifyUser.call(this,void 0,t):t&&r&&ut.isVuid(r)?e.prototype.identifyUser.call(this,t,r):e.prototype.identifyUser.call(this,t,r||this.vuid)},r.prototype.sendEvent=function(t){var r=t.type,n=t.action,i=t.identifiers,o=t.data,a=new Map(i);if(!i.has($.VUID)){if(!this.vuid)throw new Error(J.ODP_SEND_EVENT_FAILED_VUID_MISSING);a.set($.VUID,this.vuid)}e.prototype.sendEvent.call(this,{type:r,action:n,identifiers:a,data:o})},r.prototype.isVuidEnabled=function(){return!0},r.prototype.getVuid=function(){return this.vuid},r.cache=new ot,r}(gt);function Ot(e,t,r){return{variationKey:null,enabled:!1,variables:{},ruleKey:null,flagKey:e,userContext:t,reasons:r}}var At=function(){function e(e){var t,r=e.optimizely,n=e.userId,i=e.attributes,o=e.shouldIdentifyUser,a=void 0===o||o;this._qualifiedSegments=null,this.optimizely=r,this.userId=n,this.attributes=null!==(t=c({},i))&&void 0!==t?t:{},this.forcedDecisionsMap={},a&&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 c({},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},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 r,n=e.flagKey,i=null!==(r=e.ruleKey)&&void 0!==r?r:Z.FORCED_DECISION_NULL_RULE_KEY,o={variationKey:t.variationKey};return this.forcedDecisionsMap[n]||(this.forcedDecisionsMap[n]={}),this.forcedDecisionsMap[n][i]=o,!0},e.prototype.getForcedDecision=function(e){return this.findForcedDecision(e)},e.prototype.removeForcedDecision=function(e){var t,r=null!==(t=e.ruleKey)&&void 0!==t?t:Z.FORCED_DECISION_NULL_RULE_KEY,n=e.flagKey,i=!1;return this.forcedDecisionsMap.hasOwnProperty(n)&&(this.forcedDecisionsMap[n].hasOwnProperty(r)&&(delete this.forcedDecisionsMap[n][r],i=!0),0===Object.keys(this.forcedDecisionsMap[n]).length&&delete this.forcedDecisionsMap[n]),i},e.prototype.removeAllForcedDecisions=function(){return this.forcedDecisionsMap={},!0},e.prototype.findForcedDecision=function(e){var t,r=null!==(t=e.ruleKey)&&void 0!==t?t:Z.FORCED_DECISION_NULL_RULE_KEY,n=e.flagKey;if(this.forcedDecisionsMap.hasOwnProperty(e.flagKey)){var i=this.forcedDecisionsMap[n];if(i.hasOwnProperty(r))return{variationKey:i[r].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=c({},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(r){switch(r.label){case 0:return[4,this.optimizely.fetchQualifiedSegments(this.userId,e)];case 1:return t=r.sent(),this.qualifiedSegments=t,[2,null!==t]}}))}))},e.prototype.isQualifiedFor=function(e){return!!this._qualifiedSegments&&this._qualifiedSegments.indexOf(e)>-1},e}(),wt=["and","or","not"];function Tt(e,t){if(Array.isArray(e)){var r=e[0],n=e.slice(1);switch("string"==typeof r&&-1===wt.indexOf(r)&&(r="or",n=e),r){case"and":return function(e,t){var r=!1;if(Array.isArray(e)){for(var n=0;n<e.length;n++){var i=Tt(e[n],t);if(!1===i)return!1;null===i&&(r=!0)}return!r||null}return null}(n,t);case"not":return function(e,t){if(Array.isArray(e)&&e.length>0){var r=Tt(e[0],t);return null===r?null:!r}return null}(n,t);default:return function(e,t){var r=!1;if(Array.isArray(e)){for(var n=0;n<e.length;n++){var i=Tt(e[n],t);if(!0===i)return!0;null===i&&(r=!0)}return!!r&&null}return null}(n,t)}}return t(e)}var St=function(){function e(t,r,n){var i,o;this.sdkKey=null!==(i=t.sdkKey)&&void 0!==i?i:"",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 a=(t.featureFlags||[]).reduce((function(e,t){return e[t.id]=t.variables,e}),{}),s=e.getVariableIdMap(t),l=e.getExperimentsMap(t,a,s,n),u=l.experimentsMapById,c=l.experimentsMapByKey;this.experimentsMap=c,this.featuresMap=e.getFeaturesMap(t,a,u,s),this.datafile=r}return e.prototype.getDatafile=function(){return this.datafile},e.getAudiences=function(e){var t=[],r=[];return(e.typedAudiences||[]).forEach((function(e){t.push({id:e.id,conditions:JSON.stringify(e.conditions),name:e.name}),r.push(e.id)})),(e.audiences||[]).forEach((function(e){-1===r.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,r){var n="";if(t){var i="";t.forEach((function(t){var o="";if(t instanceof Array)o=e.getSerializedAudiences(t,r),o="(".concat(o,")");else if(wt.indexOf(t)>-1)i=t.toUpperCase();else{var a=r[t]?r[t].name:t;n||"NOT"===i?(i=""===i?"OR":i,n=""===n?"".concat(i,' "').concat(r[t].name,'"'):n.concat(" ".concat(i,' "').concat(a,'"'))):n='"'.concat(a,'"')}""!==o&&(""!==n||"NOT"===i?(i=""===i?"OR":i,n=""===n?"".concat(i," ").concat(o):n.concat(" ".concat(i," ").concat(o))):n=n.concat(o))}))}return n},e.getExperimentAudiences=function(t,r){return t.audienceConditions?e.getSerializedAudiences(t.audienceConditions,r.audiencesById):""},e.mergeFeatureVariables=function(e,t,r,n,i){var o=(e[r]||[]).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 r=t[e.id],n={id:e.id,key:r.key,type:r.type,value:i?e.value:r.defaultValue};o[r.key]=n})),o},e.getVariationsMap=function(t,r,n,i){return t.reduce((function(t,o){var a=e.mergeFeatureVariables(r,n,i,o.variables,o.featureEnabled);return t[o.key]={id:o.id,key:o.key,featureEnabled:o.featureEnabled,variablesMap:a},t}),{})},e.getVariableIdMap=function(e){return(e.featureFlags||[]).reduce((function(e,t){return t.variables.forEach((function(t){e[t.id]=t})),e}),{})},e.getDeliveryRules=function(t,r,n,i,o){return i.map((function(i){return{id:i.id,key:i.key,audiences:e.getExperimentAudiences(i,t),variationsMap:e.getVariationsMap(i.variations,r,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,r,n,i){var o=this.getRolloutExperimentIds(t.rollouts),a={},s={};return(t.experiments||[]).forEach((function(l){if(-1===o.indexOf(l.id)){var u=t.experimentFeatureMap[l.id],c="";u&&u.length>0&&(c=u[0]);var d=e.getVariationsMap(l.variations,r,n,c.toString()),f={id:l.id,key:l.key,audiences:e.getExperimentAudiences(l,t),variationsMap:d};a[l.id]=f,s[l.key]&&i&&i.warn("Duplicate experiment keys found in datafile: ".concat(l.key)),s[l.key]=f}})),{experimentsMapById:a,experimentsMapByKey:s}},e.getExperimentsKeyMap=function(e){var t={};for(var r in e){var n=e[r];t[n.key]=n}return t},e.getFeaturesMap=function(t,r,n,i){var o={};return t.featureFlags.forEach((function(a){var s={},l=[];a.experimentIds.forEach((function(e){var t=n[e];t&&(s[t.key]=t),l.push(n[e])}));var u=(a.variables||[]).reduce((function(e,t){return e[t.key]={id:t.id,key:t.key,type:t.type,value:t.defaultValue},e}),{}),c=[],d=t.rolloutIdMap[a.rolloutId];d&&(c=e.getDeliveryRules(t,r,a.id,d.experiments,i)),o[a.key]={id:a.id,key:a.key,experimentRules:l,deliveryRules:c,experimentsMap:s,variablesMap:u}})),o},e}(),Rt=x();function Nt(e,t){return e instanceof Error?e.message:t||"Unknown error"}var Dt=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(T(J.DATAFILE_AND_SDK_KEY_MISSING,"PROJECT_CONFIG_MANAGER"));return this.readyPromise=Promise.resolve({success:!1,reason:Nt(t)}),void Rt.error(t)}var r=null;e.datafile&&(r=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:Nt(r,"Invalid datafile")})}catch(e){Rt.error(e),this.readyPromise=Promise.resolve({success:!1,reason:Nt(e,"Error in initialize")})}}return e.prototype.onDatafileManagerReadyFulfill=function(){if(this.datafileManager){var e=this.handleNewDatafile(this.datafileManager.get());return e?{success:!1,reason:Nt(e)}:{success:!0}}return{success:!1,reason:Nt(null,"Datafile manager is not provided")}},e.prototype.onDatafileManagerReadyReject=function(e){return{success:!1,reason:Nt(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:Rt}),r=t.configObj,n=t.error;if(n)Rt.error(n);else{var i=this.configObj?this.configObj.revision:"null";r&&i!==r.revision&&(this.configObj=r,this.optimizelyConfigObj=null,this.updateListeners.forEach((function(e){return e(r)})))}return n},e.prototype.getConfig=function(){return this.configObj},e.prototype.getOptimizelyConfig=function(){return!this.optimizelyConfigObj&&this.configObj&&(this.optimizelyConfigObj=function(e,t,r){return new St(e,t,r)}(this.configObj,Qe(this.configObj),Rt)),this.optimizelyConfigObj},e.prototype.onReady=function(){return this.readyPromise},e.prototype.onUpdate=function(e){var t=this;return this.updateListeners.push(e),function(){var r=t.updateListeners.indexOf(e);r>-1&&t.updateListeners.splice(r,1)}},e.prototype.stop=function(){this.datafileManager&&this.datafileManager.stop(),this.updateListeners=[]},e}(),Ct=Math.pow(2,32),Ut=function(e){var t=[],r=e.experimentIdMap[e.experimentId].groupId;if(r){var n=e.groupIdMap[r];if(!n)throw new Error(T(J.INVALID_GROUP_ID,"BUCKETER",r));if("random"===n.policy){var i=Pt(n,e.bucketingId,e.userId,e.logger);if(null===i)return e.logger.log(W.INFO,X.USER_NOT_IN_ANY_EXPERIMENT,"BUCKETER",e.userId,r),t.push([X.USER_NOT_IN_ANY_EXPERIMENT,"BUCKETER",e.userId,r]),{result:null,reasons:t};if(i!==e.experimentId)return e.logger.log(W.INFO,X.USER_NOT_BUCKETED_INTO_EXPERIMENT_IN_GROUP,"BUCKETER",e.userId,e.experimentKey,r),t.push([X.USER_NOT_BUCKETED_INTO_EXPERIMENT_IN_GROUP,"BUCKETER",e.userId,e.experimentKey,r]),{result:null,reasons:t};e.logger.log(W.INFO,X.USER_BUCKETED_INTO_EXPERIMENT_IN_GROUP,"BUCKETER",e.userId,e.experimentKey,r),t.push([X.USER_BUCKETED_INTO_EXPERIMENT_IN_GROUP,"BUCKETER",e.userId,e.experimentKey,r])}}var o="".concat(e.bucketingId).concat(e.experimentId),a=Mt(o);e.logger.log(W.DEBUG,X.USER_ASSIGNED_TO_EXPERIMENT_BUCKET,"BUCKETER",a,e.userId),t.push([X.USER_ASSIGNED_TO_EXPERIMENT_BUCKET,"BUCKETER",a,e.userId]);var s=Lt(a,e.trafficAllocationConfig);return null===s||e.variationIdMap[s]?{result:s,reasons:t}:(s&&(e.logger.log(W.WARNING,X.INVALID_VARIATION_ID,"BUCKETER"),t.push([X.INVALID_VARIATION_ID,"BUCKETER"])),{result:null,reasons:t})},Pt=function(e,t,r,n){var i="".concat(t).concat(e.id),o=Mt(i);n.log(W.DEBUG,X.USER_ASSIGNED_TO_EXPERIMENT_BUCKET,"BUCKETER",o,r);var a=e.trafficAllocation;return Lt(o,a)},Lt=function(e,t){for(var r=0;r<t.length;r++)if(e<t[r].endOfRange)return t[r].entityId;return null},Mt=function(e){try{var t=a.v3(e,1)/Ct;return Math.floor(1e4*t)}catch(t){throw new Error(T(J.INVALID_BUCKETING_ID,"BUCKETER",e,t.message))}},kt=x();function Ft(e){return/^\d+$/.test(e)}function xt(e){var t=e.indexOf("-"),r=e.indexOf("+");return!(t<0)&&(r<0||t<r)}function Vt(e){var t=e.indexOf("-"),r=e.indexOf("+");return!(r<0)&&(t<0||r<t)}function jt(e){var t=e,r="";if(function(e){return/\s/.test(e)}(e))return kt.warn(X.UNKNOWN_MATCH_TYPE,"SEMANTIC VERSION",e),null;if(xt(e)?(t=e.substring(0,e.indexOf("-")),r=e.substring(e.indexOf("-")+1)):Vt(e)&&(t=e.substring(0,e.indexOf("+")),r=e.substring(e.indexOf("+")+1)),"string"!=typeof t||"string"!=typeof r)return null;var n=t.split(".").length-1;if(n>2)return kt.warn(X.UNKNOWN_MATCH_TYPE,"SEMANTIC VERSION",e),null;var i=t.split(".");if(i.length!=n+1)return kt.warn(X.UNKNOWN_MATCH_TYPE,"SEMANTIC VERSION",e),null;for(var o=0,a=i;o<a.length;o++)if(!Ft(a[o]))return kt.warn(X.UNKNOWN_MATCH_TYPE,"SEMANTIC VERSION",e),null;return r&&i.push(r),i}var Gt="CUSTOM_ATTRIBUTE_CONDITION_EVALUATOR",Bt=x(),$t=["exact","exists","gt","ge","lt","le","substring","semver_eq","semver_lt","semver_le","semver_gt","semver_ge"],Kt={};function Ht(e){return"string"==typeof e||"boolean"==typeof e||N.isNumber(e)}function qt(e,t){var r=t.getAttributes(),n=e.value,i=typeof n,o=e.name,a=r[o],s=typeof a;return!Ht(n)||N.isNumber(n)&&!N.isSafeInteger(n)?(Bt.warn(X.UNEXPECTED_CONDITION_VALUE,Gt,JSON.stringify(e)),null):null===a?(Bt.debug(X.UNEXPECTED_TYPE_NULL,Gt,JSON.stringify(e),o),null):Ht(a)&&i===s?N.isNumber(a)&&!N.isSafeInteger(a)?(Bt.warn(X.OUT_OF_BOUNDS,Gt,JSON.stringify(e),o),null):n===a:(Bt.warn(X.UNEXPECTED_TYPE,Gt,JSON.stringify(e),s,o),null)}function zt(e,t){var r=t.getAttributes(),n=e.name,i=r[n],o=typeof i,a=e.value;return null!==a&&N.isSafeInteger(a)?null===i?(Bt.debug(X.UNEXPECTED_TYPE_NULL,Gt,JSON.stringify(e),n),!1):N.isNumber(i)?!!N.isSafeInteger(i)||(Bt.warn(X.OUT_OF_BOUNDS,Gt,JSON.stringify(e),n),!1):(Bt.warn(X.UNEXPECTED_TYPE,Gt,JSON.stringify(e),o,n),!1):(Bt.warn(X.UNEXPECTED_CONDITION_VALUE,Gt,JSON.stringify(e)),!1)}function Yt(e,t){var r=t.getAttributes(),n=e.name,i=r[n],o=typeof i,a=e.value;return"string"!=typeof a?(Bt.warn(X.UNEXPECTED_CONDITION_VALUE,Gt,JSON.stringify(e)),null):null===i?(Bt.debug(X.UNEXPECTED_TYPE_NULL,Gt,JSON.stringify(e),n),null):"string"!=typeof i?(Bt.warn(X.UNEXPECTED_TYPE,Gt,JSON.stringify(e),o,n),null):function(e,t){var r=jt(t),n=jt(e);if(!r||!n)return null;for(var i=r.length,o=0;o<n.length;o++){if(i<=o)return xt(e)||Vt(e)?1:-1;if(Ft(r[o])){var a=parseInt(r[o]),s=parseInt(n[o]);if(a>s)return 1;if(a<s)return-1}else{if(r[o]<n[o])return xt(e)&&!xt(t)?1:-1;if(r[o]>n[o])return!xt(e)&&xt(t)?-1:1}}return xt(t)&&!xt(e)?-1:0}(a,i)}Kt.exact=qt,Kt.exists=function(e,t){return null!=t.getAttributes()[e.name]},Kt.gt=function(e,t){var r=t.getAttributes()[e.name],n=e.value;return zt(e,t)&&null!==n?r>n:null},Kt.ge=function(e,t){var r=t.getAttributes()[e.name],n=e.value;return zt(e,t)&&null!==n?r>=n:null},Kt.lt=function(e,t){var r=t.getAttributes()[e.name],n=e.value;return zt(e,t)&&null!==n?r<n:null},Kt.le=function(e,t){var r=t.getAttributes()[e.name],n=e.value;return zt(e,t)&&null!==n?r<=n:null},Kt.substring=function(e,t){var r=t.getAttributes(),n=e.name,i=r[e.name],o=typeof i,a=e.value;return"string"!=typeof a?(Bt.warn(X.UNEXPECTED_CONDITION_VALUE,Gt,JSON.stringify(e)),null):null===i?(Bt.debug(X.UNEXPECTED_TYPE_NULL,Gt,JSON.stringify(e),n),null):"string"!=typeof i?(Bt.warn(X.UNEXPECTED_TYPE,Gt,JSON.stringify(e),o,n),null):-1!==i.indexOf(a)},Kt.semver_eq=function(e,t){var r=Yt(e,t);return null===r?null:0===r},Kt.semver_gt=function(e,t){var r=Yt(e,t);return null===r?null:r>0},Kt.semver_ge=function(e,t){var r=Yt(e,t);return null===r?null:r>=0},Kt.semver_lt=function(e,t){var r=Yt(e,t);return null===r?null:r<0},Kt.semver_le=function(e,t){var r=Yt(e,t);return null===r?null:r<=0};var Wt=Object.freeze({__proto__:null,evaluate:function(e,t){var r=t.getAttributes(),n=e.match;if(void 0!==n&&-1===$t.indexOf(n))return Bt.warn(X.UNKNOWN_MATCH_TYPE,Gt,JSON.stringify(e)),null;var i=e.name;return r.hasOwnProperty(i)||"exists"==n?(n&&Kt[n]||qt)(e,t):(Bt.debug(X.MISSING_ATTRIBUTE_VALUE,Gt,JSON.stringify(e),i),null)}}),Jt=x(),Xt=["qualified"],Zt={};function Qt(e,t){return t.isQualifiedFor(e.value)}Zt.qualified=Qt;var er=Object.freeze({__proto__:null,evaluate:function(e,t){var r=e.match;return void 0!==r&&-1===Xt.indexOf(r)?(Jt.warn(X.UNKNOWN_MATCH_TYPE,"ODP_SEGMENT_CONDITION_EVALUATOR",JSON.stringify(e)),null):(r&&Zt[r]||Qt)(e,t)}}),tr=x(),rr=function(){function e(e){this.typeToEvaluatorMap=N.assign({},e,{custom_attribute:Wt,third_party_dimension:er})}return e.prototype.evaluate=function(e,t,r){var n=this;return!e||0===e.length||!!Tt(e,(function(e){var i=t[e];if(i){tr.log(W.DEBUG,X.EVALUATING_AUDIENCE,"AUDIENCE_EVALUATOR",e,JSON.stringify(i.conditions));var o=Tt(i.conditions,n.evaluateConditionWithUserAttributes.bind(n,r)),a=null===o?"UNKNOWN":o.toString().toUpperCase();return tr.log(W.DEBUG,X.AUDIENCE_EVALUATION_RESULT,"AUDIENCE_EVALUATOR",e,a),o}return null}))},e.prototype.evaluateConditionWithUserAttributes=function(e,t){var r=this.typeToEvaluatorMap[t.type];if(!r)return tr.log(W.WARNING,X.UNKNOWN_CONDITION_TYPE,"AUDIENCE_EVALUATOR",JSON.stringify(t)),null;try{return r.evaluate(t,e)}catch(e){tr.log(W.ERROR,J.CONDITION_EVALUATOR_ERROR,"AUDIENCE_EVALUATOR",t.type,e.message)}return null},e}();function nr(e){return"string"==typeof e&&""!==e}var ir="DECISION_SERVICE",or=function(){function e(e){var t;this.audienceEvaluator=(t=e.UNSTABLE_conditionEvaluators,new rr(t)),this.forcedVariationMap={},this.logger=e.logger,this.userProfileService=e.userProfileService||null}return e.prototype.getVariation=function(e,r,n,i){void 0===i&&(i={});var o=n.getUserId(),a=n.getAttributes(),s=this.getBucketingId(o,a),l=[],u=r.key;if(!this.checkIfExperimentIsActive(e,u))return this.logger.log(W.INFO,X.EXPERIMENT_NOT_RUNNING,ir,u),l.push([X.EXPERIMENT_NOT_RUNNING,ir,u]),{result:null,reasons:l};var c=this.getForcedVariation(e,u,o);l.push.apply(l,c.reasons);var d=c.result;if(d)return{result:d,reasons:l};var f=this.getWhitelistedVariation(r,o);l.push.apply(l,f.reasons);var p=f.result;if(p)return{result:p.key,reasons:l};var g=i[t.OptimizelyDecideOption.IGNORE_USER_PROFILE_SERVICE],v=this.resolveExperimentBucketMap(o,a);if(!g&&(p=this.getStoredVariation(e,r,o,v)))return this.logger.log(W.INFO,X.RETURNING_STORED_VARIATION,ir,p.key,u,o),l.push([X.RETURNING_STORED_VARIATION,ir,p.key,u,o]),{result:p.key,reasons:l};var h=this.checkIfUserIsInAudience(e,r,te.EXPERIMENT,n,"");if(l.push.apply(l,h.reasons),!h.result)return this.logger.log(W.INFO,X.USER_NOT_IN_EXPERIMENT,ir,o,u),l.push([X.USER_NOT_IN_EXPERIMENT,ir,o,u]),{result:null,reasons:l};var m=this.buildBucketerParams(e,r,s,o),y=Ut(m);l.push.apply(l,y.reasons);var E=y.result;return E&&(p=e.variationIdMap[E]),p?(this.logger.log(W.INFO,X.USER_HAS_VARIATION,ir,o,p.key,u),l.push([X.USER_HAS_VARIATION,ir,o,p.key,u]),g||this.saveUserProfile(r,p,o,v),{result:p.key,reasons:l}):(this.logger.log(W.DEBUG,X.USER_HAS_NO_VARIATION,ir,o,u),l.push([X.USER_HAS_NO_VARIATION,ir,o,u]),{result:null,reasons:l})},e.prototype.resolveExperimentBucketMap=function(e,t){t=t||{};var r=this.getUserProfile(e)||{},n=t[Z.STICKY_BUCKETING_KEY];return N.assign({},r.experiment_bucket_map,n)},e.prototype.checkIfExperimentIsActive=function(e,t){return function(e,t){return"Running"===qe(e,t)}(e,t)},e.prototype.getWhitelistedVariation=function(e,t){var r=[];if(e.forcedVariations&&e.forcedVariations.hasOwnProperty(t)){var n=e.forcedVariations[t];return e.variationKeyMap.hasOwnProperty(n)?(this.logger.log(W.INFO,X.USER_FORCED_IN_VARIATION,ir,t,n),r.push([X.USER_FORCED_IN_VARIATION,ir,t,n]),{result:e.variationKeyMap[n],reasons:r}):(this.logger.log(W.ERROR,X.FORCED_BUCKETING_FAILED,ir,n,t),r.push([X.FORCED_BUCKETING_FAILED,ir,n,t]),{result:null,reasons:r})}return{result:null,reasons:r}},e.prototype.checkIfUserIsInAudience=function(e,t,r,n,i){var o=[],a=function(e,t){var r=e.experimentIdMap[t];if(!r)throw new Error(T(J.INVALID_EXPERIMENT_ID,Ve,t));return r.audienceConditions||r.audienceIds}(e,t.id),s=e.audiencesById;this.logger.log(W.DEBUG,X.EVALUATING_AUDIENCES_COMBINED,ir,r,i||t.key,JSON.stringify(a)),o.push([X.EVALUATING_AUDIENCES_COMBINED,ir,r,i||t.key,JSON.stringify(a)]);var l=this.audienceEvaluator.evaluate(a,s,n);return this.logger.log(W.INFO,X.AUDIENCE_EVALUATION_RESULT_COMBINED,ir,r,i||t.key,l.toString().toUpperCase()),o.push([X.AUDIENCE_EVALUATION_RESULT_COMBINED,ir,r,i||t.key,l.toString().toUpperCase()]),{result:l,reasons:o}},e.prototype.buildBucketerParams=function(e,t,r,n){return{bucketingId:r,experimentId:t.id,experimentKey:t.key,experimentIdMap:e.experimentIdMap,experimentKeyMap:e.experimentKeyMap,groupIdMap:e.groupIdMap,logger:this.logger,trafficAllocationConfig:We(e,t.id),userId:n,variationIdMap:e.variationIdMap}},e.prototype.getStoredVariation=function(e,t,r,n){if(n.hasOwnProperty(t.id)){var i=n[t.id],o=i.variation_id;if(e.variationIdMap.hasOwnProperty(o))return e.variationIdMap[i.variation_id];this.logger.log(W.INFO,X.SAVED_VARIATION_NOT_FOUND,ir,r,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(W.ERROR,J.USER_PROFILE_LOOKUP_ERROR,ir,e,t.message)}return null},e.prototype.saveUserProfile=function(e,t,r,n){if(this.userProfileService)try{n[e.id]={variation_id:t.id},this.userProfileService.save({user_id:r,experiment_bucket_map:n}),this.logger.log(W.INFO,X.SAVED_VARIATION,ir,t.key,e.key,r)}catch(e){this.logger.log(W.ERROR,J.USER_PROFILE_SAVE_ERROR,ir,r,e.message)}},e.prototype.getVariationForFeature=function(e,t,r,n){void 0===n&&(n={});var i=[],o=this.getVariationForFeatureExperiment(e,t,r,n);i.push.apply(i,o.reasons);var a=o.result;if(null!==a.variation)return{result:a,reasons:i};var s=this.getVariationForRollout(e,t,r);i.push.apply(i,s.reasons);var l=s.result,u=r.getUserId();return l.variation?(this.logger.log(W.DEBUG,X.USER_IN_ROLLOUT,ir,u,t.key),i.push([X.USER_IN_ROLLOUT,ir,u,t.key]),{result:l,reasons:i}):(this.logger.log(W.DEBUG,X.USER_NOT_IN_ROLLOUT,ir,u,t.key),i.push([X.USER_NOT_IN_ROLLOUT,ir,u,t.key]),{result:l,reasons:i})},e.prototype.getVariationForFeatureExperiment=function(e,t,r,n){void 0===n&&(n={});var i,o,a=[],s=null;if(t.experimentIds.length>0)for(o=0;o<t.experimentIds.length;o++){var l=Je(e,t.experimentIds[o],this.logger);if(l&&(i=this.getVariationFromExperimentRule(e,t.key,l,r,n),a.push.apply(a,i.reasons),s=i.result)){var u=null;return(u=l.variationKeyMap[s])||(u=Xe(e,t.key,s)),{result:{experiment:l,variation:u,decisionSource:ee.FEATURE_TEST},reasons:a}}}else this.logger.log(W.DEBUG,X.FEATURE_HAS_NO_EXPERIMENTS,ir,t.key),a.push([X.FEATURE_HAS_NO_EXPERIMENTS,ir,t.key]);return{result:{experiment:null,variation:null,decisionSource:ee.FEATURE_TEST},reasons:a}},e.prototype.getVariationForRollout=function(e,t,r){var n=[];if(!t.rolloutId)return this.logger.log(W.DEBUG,X.NO_ROLLOUT_EXISTS,ir,t.key),n.push([X.NO_ROLLOUT_EXISTS,ir,t.key]),{result:{experiment:null,variation:null,decisionSource:ee.ROLLOUT},reasons:n};var i=e.rolloutIdMap[t.rolloutId];if(!i)return this.logger.log(W.ERROR,J.INVALID_ROLLOUT_ID,ir,t.rolloutId,t.key),n.push([J.INVALID_ROLLOUT_ID,ir,t.rolloutId,t.key]),{result:{experiment:null,variation:null,decisionSource:ee.ROLLOUT},reasons:n};var o,a,s,l=i.experiments;if(0===l.length)return this.logger.log(W.ERROR,X.ROLLOUT_HAS_NO_EXPERIMENTS,ir,t.rolloutId),n.push([X.ROLLOUT_HAS_NO_EXPERIMENTS,ir,t.rolloutId]),{result:{experiment:null,variation:null,decisionSource:ee.ROLLOUT},reasons:n};for(var u=0;u<l.length;){if(o=this.getVariationFromDeliveryRule(e,t.key,l,u,r),n.push.apply(n,o.reasons),s=o.result,a=o.skipToEveryoneElse,s)return{result:{experiment:e.experimentIdMap[l[u].id],variation:s,decisionSource:ee.ROLLOUT},reasons:n};u=a?l.length-1:u+1}return{result:{experiment:null,variation:null,decisionSource:ee.ROLLOUT},reasons:n}},e.prototype.getBucketingId=function(e,t){var r=e;return null!=t&&"object"==typeof t&&t.hasOwnProperty(Z.BUCKETING_ID)&&("string"==typeof t[Z.BUCKETING_ID]?(r=String(t[Z.BUCKETING_ID]),this.logger.log(W.DEBUG,X.VALID_BUCKETING_ID,ir,r)):this.logger.log(W.WARNING,X.BUCKETING_ID_NOT_STRING,ir)),r},e.prototype.findValidatedForcedDecision=function(e,t,r,n){var i,o=[],a=t.getForcedDecision({flagKey:r,ruleKey:n}),s=null,l=t.getUserId();return e&&a&&(i=a.variationKey,(s=Xe(e,r,i))?n?(this.logger.log(W.INFO,X.USER_HAS_FORCED_DECISION_WITH_RULE_SPECIFIED,i,r,n,l),o.push([X.USER_HAS_FORCED_DECISION_WITH_RULE_SPECIFIED,i,r,n,l])):(this.logger.log(W.INFO,X.USER_HAS_FORCED_DECISION_WITH_NO_RULE_SPECIFIED,i,r,l),o.push([X.USER_HAS_FORCED_DECISION_WITH_NO_RULE_SPECIFIED,i,r,l])):n?(this.logger.log(W.INFO,X.USER_HAS_FORCED_DECISION_WITH_RULE_SPECIFIED_BUT_INVALID,r,n,l),o.push([X.USER_HAS_FORCED_DECISION_WITH_RULE_SPECIFIED_BUT_INVALID,r,n,l])):(this.logger.log(W.INFO,X.USER_HAS_FORCED_DECISION_WITH_NO_RULE_SPECIFIED_BUT_INVALID,r,l),o.push([X.USER_HAS_FORCED_DECISION_WITH_NO_RULE_SPECIFIED_BUT_INVALID,r,l]))),{result:s,reasons:o}},e.prototype.removeForcedVariation=function(e,t,r){if(!e)throw new Error(T(J.INVALID_USER_ID,ir));if(!this.forcedVariationMap.hasOwnProperty(e))throw new Error(T(J.USER_NOT_IN_FORCED_VARIATION,ir,e));delete this.forcedVariationMap[e][t],this.logger.log(W.DEBUG,X.VARIATION_REMOVED_FOR_USER,ir,r,e)},e.prototype.setInForcedVariationMap=function(e,t,r){this.forcedVariationMap.hasOwnProperty(e)||(this.forcedVariationMap[e]={}),this.forcedVariationMap[e][t]=r,this.logger.log(W.DEBUG,X.USER_MAPPED_TO_FORCED_VARIATION,ir,r,t,e)},e.prototype.getForcedVariation=function(e,t,r){var n,i=[],o=this.forcedVariationMap[r];if(!o)return this.logger.log(W.DEBUG,X.USER_HAS_NO_FORCED_VARIATION,ir,r),{result:null,reasons:i};try{var a=Ye(e,t);if(!a.hasOwnProperty("id"))return this.logger.log(W.ERROR,J.IMPROPERLY_FORMATTED_EXPERIMENT,ir,t),i.push([J.IMPROPERLY_FORMATTED_EXPERIMENT,ir,t]),{result:null,reasons:i};n=a.id}catch(e){return this.logger.log(W.ERROR,e.message),i.push(e.message),{result:null,reasons:i}}var s=o[n];if(!s)return this.logger.log(W.DEBUG,X.USER_HAS_NO_FORCED_VARIATION_FOR_EXPERIMENT,ir,t,r),{result:null,reasons:i};var l=ze(e,s);return l?(this.logger.log(W.DEBUG,X.USER_HAS_FORCED_VARIATION,ir,l,t,r),i.push([X.USER_HAS_FORCED_VARIATION,ir,l,t,r])):this.logger.log(W.DEBUG,X.USER_HAS_NO_FORCED_VARIATION_FOR_EXPERIMENT,ir,t,r),{result:l,reasons:i}},e.prototype.setForcedVariation=function(e,t,r,n){if(null!=n&&!nr(n))return this.logger.log(W.ERROR,J.INVALID_VARIATION_KEY,ir),!1;var i;try{var o=Ye(e,t);if(!o.hasOwnProperty("id"))return this.logger.log(W.ERROR,J.IMPROPERLY_FORMATTED_EXPERIMENT,ir,t),!1;i=o.id}catch(e){return this.logger.log(W.ERROR,e.message),!1}if(null==n)try{return this.removeForcedVariation(r,i,t),!0}catch(e){return this.logger.log(W.ERROR,e.message),!1}var a=function(e,t,r){var n=e.experimentKeyMap[t];return n.variationKeyMap.hasOwnProperty(r)?n.variationKeyMap[r].id:null}(e,t,n);if(!a)return this.logger.log(W.ERROR,J.NO_VARIATION_FOR_EXPERIMENT_KEY,ir,n,t),!1;try{return this.setInForcedVariationMap(r,i,a),!0}catch(e){return this.logger.log(W.ERROR,e.message),!1}},e.prototype.getVariationFromExperimentRule=function(e,t,r,n,i){void 0===i&&(i={});var o=[],a=this.findValidatedForcedDecision(e,n,t,r.key);o.push.apply(o,a.reasons);var s=a.result;if(s)return{result:s.key,reasons:o};var l=this.getVariation(e,r,n,i);return o.push.apply(o,l.reasons),{result:l.result,reasons:o}},e.prototype.getVariationFromDeliveryRule=function(e,t,r,n,i){var o=[],a=!1,s=r[n],l=this.findValidatedForcedDecision(e,i,t,s.key);o.push.apply(o,l.reasons);var u=l.result;if(u)return{result:u,reasons:o,skipToEveryoneElse:a};var c,d,f,p,g,v=i.getUserId(),h=i.getAttributes(),m=this.getBucketingId(v,h),y=n===r.length-1,E=y?"Everyone Else":n+1,_=null,b=this.checkIfUserIsInAudience(e,s,te.RULE,i,E);return o.push.apply(o,b.reasons),b.result?(this.logger.log(W.DEBUG,X.USER_MEETS_CONDITIONS_FOR_TARGETING_RULE,ir,v,E),o.push([X.USER_MEETS_CONDITIONS_FOR_TARGETING_RULE,ir,v,E]),d=this.buildBucketerParams(e,s,m,v),f=Ut(d),o.push.apply(o,f.reasons),(c=f.result)&&(g=c,_=(p=e).variationIdMap.hasOwnProperty(g)?p.variationIdMap[g]:null),_?(this.logger.log(W.DEBUG,X.USER_BUCKETED_INTO_TARGETING_RULE,ir,v,E),o.push([X.USER_BUCKETED_INTO_TARGETING_RULE,ir,v,E])):y||(this.logger.log(W.DEBUG,X.USER_NOT_BUCKETED_INTO_TARGETING_RULE,ir,v,E),o.push([X.USER_NOT_BUCKETED_INTO_TARGETING_RULE,ir,v,E]),a=!0)):(this.logger.log(W.DEBUG,X.USER_DOESNT_MEET_CONDITIONS_FOR_TARGETING_RULE,ir,v,E),o.push([X.USER_DOESNT_MEET_CONDITIONS_FOR_TARGETING_RULE,ir,v,E])),{result:_,reasons:o,skipToEveryoneElse:a}},e}();function ar(e,t){var r=e.revenue;if(null==r)return null;var n="string"==typeof r?parseInt(r):r;return isFinite(n)?(t.log(W.INFO,X.PARSED_REVENUE_VALUE,"EVENT_TAG_UTILS",n),n):(t.log(W.INFO,X.FAILED_TO_PARSE_REVENUE,"EVENT_TAG_UTILS",r),null)}function sr(e,t){var r=e.value;if(null==r)return null;var n="string"==typeof r?parseFloat(r):r;return isFinite(n)?(t.log(W.INFO,X.PARSED_NUMERIC_VALUE,"EVENT_TAG_UTILS",n),n):(t.log(W.INFO,X.FAILED_TO_PARSE_VALUE,"EVENT_TAG_UTILS",r),null)}function lr(e,t){return"string"==typeof e&&("string"==typeof t||"boolean"==typeof t||N.isNumber(t)&&N.isSafeInteger(t))}var ur="https://logx.optimizely.com/v1/events";function cr(e){var t=e.attributes,r=e.userId,n=e.clientEngine,i=e.clientVersion,o=e.configObj,a=e.logger,s=!!o.anonymizeIP&&o.anonymizeIP,l=o.botFiltering,u={snapshots:[],visitor_id:r,attributes:[]},c={account_id:o.accountId,project_id:o.projectId,visitors:[u],revision:o.revision,client_name:n,client_version:i,anonymize_ip:s,enrich_decisions:!0};return t&&Object.keys(t||{}).forEach((function(e){var r=t[e];if(lr(e,r)){var n=Ke(o,e,a);n&&c.visitors[0].attributes.push({entity_id:n,key:e,type:"custom",value:r})}})),"boolean"==typeof l&&c.visitors[0].attributes.push({entity_id:Z.BOT_FILTERING,key:Z.BOT_FILTERING,type:"custom",value:l}),c}function dr(e){var t,r;return null!==(r=null===(t=e.experiment)||void 0===t?void 0:t.key)&&void 0!==r?r:""}function fr(e){var t,r;return null!==(r=null===(t=e.variation)||void 0===t?void 0:t.key)&&void 0!==r?r:""}function pr(e){var t,r;return null!==(r=null===(t=e.variation)||void 0===t?void 0:t.featureEnabled)&&void 0!==r&&r}function gr(e){var t,r;return null!==(r=null===(t=e.experiment)||void 0===t?void 0:t.id)&&void 0!==r?r:null}function vr(e){var t,r;return null!==(r=null===(t=e.variation)||void 0===t?void 0:t.id)&&void 0!==r?r:null}var hr=x("EVENT_BUILDER");function mr(e,t){var r=[];return t&&Object.keys(t||{}).forEach((function(n){var i=t[n];if(lr(n,i)){var o=Ke(e,n,hr);o&&r.push({entityId:o,key:n,value:i})}})),r}var yr="USER_PROFILE_SERVICE_VALIDATOR",Er=function(){function e(e){var r,n,i=this,o=e.clientEngine;o||(e.logger.log(W.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 a=null!==(r=e.defaultDecideOptions)&&void 0!==r?r:[];Array.isArray(a)||(this.logger.log(W.DEBUG,X.INVALID_DEFAULT_DECIDE_OPTIONS,"OPTIMIZELY"),a=[]);var s={};a.forEach((function(e){t.OptimizelyDecideOption[e]?s[e]=!0:i.logger.log(W.WARNING,X.UNRECOGNIZED_DECIDE_OPTION,"OPTIMIZELY",e)})),this.defaultDecideOptions=s,this.projectConfigManager=function(e){return new Dt(e)}({datafile:e.datafile,jsonSchemaValidator:e.jsonSchemaValidator,sdkKey:e.sdkKey,datafileManager:e.datafileManager}),this.disposeOnUpdate=this.projectConfigManager.onUpdate((function(t){var r;i.logger.log(W.INFO,X.UPDATED_OPTIMIZELY_CONFIG,"OPTIMIZELY",t.revision,t.projectId),i.notificationCenter.sendNotifications(B.OPTIMIZELY_CONFIG_UPDATE),null===(r=Le.getNotificationCenter(e.sdkKey))||void 0===r||r.sendNotifications(B.OPTIMIZELY_CONFIG_UPDATE),i.updateOdpSettings()}));var l,u=this.projectConfigManager.onReady(),c=null;if(e.userProfileService)try{(function(e){if("object"==typeof e&&null!==e){if("function"!=typeof e.lookup)throw new Error(T(J.INVALID_USER_PROFILE_SERVICE,yr,"Missing function 'lookup'"));if("function"!=typeof e.save)throw new Error(T(J.INVALID_USER_PROFILE_SERVICE,yr,"Missing function 'save'"));return!0}throw new Error(T(J.INVALID_USER_PROFILE_SERVICE,yr))})(e.userProfileService)&&(c=e.userProfileService,this.logger.log(W.INFO,X.VALID_USER_PROFILE_SERVICE,"OPTIMIZELY"))}catch(e){this.logger.log(W.WARNING,e.message)}this.decisionService=(l={userProfileService:c,logger:this.logger,UNSTABLE_conditionEvaluators:e.UNSTABLE_conditionEvaluators},new or(l)),this.notificationCenter=e.notificationCenter,this.eventProcessor=e.eventProcessor;var d=[u,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 r,n,o;if(null!=e.odpManager){i.odpManager=e.odpManager,null===(r=i.odpManager.eventManager)||void 0===r||r.start(),i.updateOdpSettings();var a=null===(n=i.projectConfigManager.getConfig())||void 0===n?void 0:n.sdkKey;null!=a?null===(o=Le.getNotificationCenter(a,i.logger))||void 0===o||o.addNotificationListener(B.OPTIMIZELY_CONFIG_UPDATE,(function(){return i.updateOdpSettings()})):i.logger.log(W.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,r){try{if(!this.isValidInstance())return this.logger.log(W.ERROR,X.INVALID_OBJECT,"OPTIMIZELY","activate"),null;if(!this.validateInputs({experiment_key:e,user_id:t},r))return this.notActivatingExperiment(e,t);var n=this.projectConfigManager.getConfig();if(!n)return null;try{var i=this.getVariation(e,t,r);if(null===i)return this.notActivatingExperiment(e,t);if(!function(e,t){return"Running"===qe(e,t)}(n,e))return this.logger.log(W.DEBUG,X.SHOULD_NOT_DISPATCH_ACTIVATE,"OPTIMIZELY",e),i;var o=Ye(n,e),a={experiment:o,variation:o.variationKeyMap[i],decisionSource:ee.EXPERIMENT};return this.sendImpressionEvent(a,"",t,!0,r),i}catch(r){return this.logger.log(W.ERROR,r.message),this.logger.log(W.INFO,X.NOT_ACTIVATING_USER,"OPTIMIZELY",t,e),this.errorHandler.handleError(r),null}}catch(e){return this.logger.log(W.ERROR,e.message),this.errorHandler.handleError(e),null}},e.prototype.sendImpressionEvent=function(e,t,r,n,i){var o=this.projectConfigManager.getConfig();if(o){var a=function(e){var t=e.configObj,r=e.decisionObj,n=e.userId,i=e.flagKey,o=e.enabled,a=e.userAttributes,s=e.clientEngine,l=e.clientVersion,u=r.decisionSource,c=dr(r),d=gr(r),f=fr(r),p=vr(r),g=null!==d?$e(t,d):null;return{type:"impression",timestamp:N.currentTimestamp(),uuid:N.uuid(),user:{id:n,attributes:mr(t,a)},context:{accountId:t.accountId,projectId:t.projectId,revision:t.revision,clientName:s,clientVersion:l,anonymizeIP:t.anonymizeIP||!1,botFiltering:t.botFiltering},layer:{id:g},experiment:{id:d,key:c},variation:{id:p,key:f},ruleKey:c,flagKey:i,ruleType:u,enabled:o}}({decisionObj:e,flagKey:t,enabled:n,userId:r,userAttributes:i,clientEngine:this.clientEngine,clientVersion:this.clientVersion,configObj:o});this.eventProcessor.process(a),this.emitNotificationCenterActivate(e,t,r,n,i)}},e.prototype.emitNotificationCenterActivate=function(e,t,r,n,i){var o=this.projectConfigManager.getConfig();if(o){var a,s=e.decisionSource,l=dr(e),u=gr(e),c=fr(e),d=vr(e);null!==u&&""!==c&&(a=o.experimentIdMap[u]);var f,p=function(e){var t,r,n,i,o,a,s,l,u=cr(e),c=(t=e.configObj,r=e.experimentId,n=e.variationId,i=e.ruleKey,o=e.ruleType,a=e.flagKey,s=e.enabled,{decisions:[{campaign_id:l=r?$e(t,r):null,experiment_id:r,variation_id:n,metadata:{flag_key:a,rule_key:i,rule_type:o,variation_key:(n?ze(t,n):null)||"",enabled:s}}],events:[{entity_id:l,timestamp:N.currentTimestamp(),key:"campaign_activated",uuid:N.uuid()}]});return u.visitors[0].snapshots.push(c),{httpVerb:"POST",url:ur,params:u}}({attributes:i,clientEngine:this.clientEngine,clientVersion:this.clientVersion,configObj:o,experimentId:u,ruleKey:l,flagKey:t,ruleType:s,userId:r,enabled:n,variationId:d,logger:this.logger});a&&a.variationKeyMap&&""!==c&&(f=a.variationKeyMap[c]),this.notificationCenter.sendNotifications(B.ACTIVATE,{experiment:a,userId:r,attributes:i,variation:f,logEvent:p})}},e.prototype.track=function(e,t,r,n){try{if(!this.isValidInstance())return void this.logger.log(W.ERROR,X.INVALID_OBJECT,"OPTIMIZELY","track");if(!this.validateInputs({user_id:t,event_key:e},r,n))return;var i=this.projectConfigManager.getConfig();if(!i)return;if(!function(e,t){return e.eventKeyMap.hasOwnProperty(t)}(i,e))return this.logger.log(W.WARNING,X.EVENT_KEY_NOT_FOUND,"OPTIMIZELY",e),void this.logger.log(W.WARNING,X.NOT_TRACKING_USER,"OPTIMIZELY",t);var o=function(e){var t=e.configObj,r=e.userId,n=e.userAttributes,i=e.clientEngine,o=e.clientVersion,a=e.eventKey,s=e.eventTags,l=He(t,a),u=s?ar(s,hr):null,c=s?sr(s,hr):null;return{type:"conversion",timestamp:N.currentTimestamp(),uuid:N.uuid(),user:{id:r,attributes:mr(t,n)},context:{accountId:t.accountId,projectId:t.projectId,revision:t.revision,clientName:i,clientVersion:o,anonymizeIP:t.anonymizeIP||!1,botFiltering:t.botFiltering},event:{id:l,key:a},revenue:u,value:c,tags:s}}({eventKey:e,eventTags:n=this.filterEmptyValues(n),userId:t,userAttributes:r,clientEngine:this.clientEngine,clientVersion:this.clientVersion,configObj:i});this.logger.log(W.INFO,X.TRACK_EVENT,"OPTIMIZELY",e,t),this.eventProcessor.process(o),this.emitNotificationCenterTrack(e,t,r,n)}catch(e){this.logger.log(W.ERROR,e.message),this.errorHandler.handleError(e),this.logger.log(W.ERROR,X.NOT_TRACKING_USER,"OPTIMIZELY",t)}},e.prototype.emitNotificationCenterTrack=function(e,t,r,n){try{var i=this.projectConfigManager.getConfig();if(!i)return;var o=function(e){var t=cr(e),r=function(e,t,r,n){var i={events:[]},o={entity_id:He(e,t),timestamp:N.currentTimestamp(),uuid:N.uuid(),key:t};if(n){var a=ar(n,r);null!==a&&(o.revenue=a);var s=sr(n,r);null!==s&&(o.value=s),o.tags=n}return i.events.push(o),i}(e.configObj,e.eventKey,e.logger,e.eventTags);return t.visitors[0].snapshots=[r],{httpVerb:"POST",url:ur,params:t}}({attributes:r,clientEngine:this.clientEngine,clientVersion:this.clientVersion,configObj:i,eventKey:e,eventTags:n,logger:this.logger,userId:t});this.notificationCenter.sendNotifications(B.TRACK,{eventKey:e,userId:t,attributes:r,eventTags:n,logEvent:o})}catch(e){this.logger.log(W.ERROR,e.message),this.errorHandler.handleError(e)}},e.prototype.getVariation=function(e,t,r){try{if(!this.isValidInstance())return this.logger.log(W.ERROR,X.INVALID_OBJECT,"OPTIMIZELY","getVariation"),null;try{if(!this.validateInputs({experiment_key:e,user_id:t},r))return null;var n=this.projectConfigManager.getConfig();if(!n)return null;var i=n.experimentKeyMap[e];if(!i)return this.logger.log(W.DEBUG,J.INVALID_EXPERIMENT_KEY,"OPTIMIZELY",e),null;var o=this.decisionService.getVariation(n,i,this.createInternalUserContext(t,r)).result,a=(s=n,l=i.id,s.experimentFeatureMap.hasOwnProperty(l)?Q.FEATURE_TEST:Q.AB_TEST);return this.notificationCenter.sendNotifications(B.DECISION,{type:a,userId:t,attributes:r||{},decisionInfo:{experimentKey:e,variationKey:o}}),o}catch(e){return this.logger.log(W.ERROR,e.message),this.errorHandler.handleError(e),null}}catch(e){return this.logger.log(W.ERROR,e.message),this.errorHandler.handleError(e),null}var s,l},e.prototype.setForcedVariation=function(e,t,r){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,r)}catch(e){return this.logger.log(W.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 r=this.projectConfigManager.getConfig();if(!r)return null;try{return this.decisionService.getForcedVariation(r,e,t).result}catch(e){return this.logger.log(W.ERROR,e.message),this.errorHandler.handleError(e),null}},e.prototype.validateInputs=function(e,t,r){try{if(e.hasOwnProperty("user_id")){var n=e.user_id;if("string"!=typeof n||null===n||"undefined"===n)throw new Error(T(J.INVALID_INPUT_FORMAT,"OPTIMIZELY","user_id"));delete e.user_id}return Object.keys(e).forEach((function(t){if(!nr(e[t]))throw new Error(T(J.INVALID_INPUT_FORMAT,"OPTIMIZELY",t))})),t&&function(e){if("object"!=typeof e||Array.isArray(e)||null===e)throw new Error(T(J.INVALID_ATTRIBUTES,"ATTRIBUTES_VALIDATOR"));Object.keys(e).forEach((function(t){if(void 0===e[t])throw new Error(T(J.UNDEFINED_ATTRIBUTE,"ATTRIBUTES_VALIDATOR",t))}))}(t),r&&function(e){if("object"!=typeof e||Array.isArray(e)||null===e)throw new Error(T(J.INVALID_EVENT_TAGS,"EVENT_TAGS_VALIDATOR"))}(r),!0}catch(e){return this.logger.log(W.ERROR,e.message),this.errorHandler.handleError(e),!1}},e.prototype.notActivatingExperiment=function(e,t){return this.logger.log(W.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,r){try{if(!this.isValidInstance())return this.logger.log(W.ERROR,X.INVALID_OBJECT,"OPTIMIZELY","isFeatureEnabled"),!1;if(!this.validateInputs({feature_key:e,user_id:t},r))return!1;var n=this.projectConfigManager.getConfig();if(!n)return!1;var i=Ze(n,e,this.logger);if(!i)return!1;var o={},a=this.createInternalUserContext(t,r),s=this.decisionService.getVariationForFeature(n,i,a).result,l=s.decisionSource,u=dr(s),c=fr(s),d=pr(s);l===ee.FEATURE_TEST&&(o={experimentKey:u,variationKey:c}),(l===ee.FEATURE_TEST||l===ee.ROLLOUT&&tt(n))&&this.sendImpressionEvent(s,i.key,t,d,r),!0===d?this.logger.log(W.INFO,X.FEATURE_ENABLED_FOR_USER,"OPTIMIZELY",e,t):(this.logger.log(W.INFO,X.FEATURE_NOT_ENABLED_FOR_USER,"OPTIMIZELY",e,t),d=!1);var f={featureKey:e,featureEnabled:d,source:s.decisionSource,sourceInfo:o};return this.notificationCenter.sendNotifications(B.DECISION,{type:Q.FEATURE,userId:t,attributes:r||{},decisionInfo:f}),d}catch(e){return this.logger.log(W.ERROR,e.message),this.errorHandler.handleError(e),!1}},e.prototype.getEnabledFeatures=function(e,t){var r=this;try{var n=[];if(!this.isValidInstance())return this.logger.log(W.ERROR,X.INVALID_OBJECT,"OPTIMIZELY","getEnabledFeatures"),n;if(!this.validateInputs({user_id:e}))return n;var i=this.projectConfigManager.getConfig();return i?(I(i.featureKeyMap).forEach((function(i){r.isFeatureEnabled(i.key,e,t)&&n.push(i.key)})),n):n}catch(e){return this.logger.log(W.ERROR,e.message),this.errorHandler.handleError(e),[]}},e.prototype.getFeatureVariable=function(e,t,r,n){try{return this.isValidInstance()?this.getFeatureVariableForType(e,t,null,r,n):(this.logger.log(W.ERROR,X.INVALID_OBJECT,"OPTIMIZELY","getFeatureVariable"),null)}catch(e){return this.logger.log(W.ERROR,e.message),this.errorHandler.handleError(e),null}},e.prototype.getFeatureVariableForType=function(e,t,r,n,i){if(!this.validateInputs({feature_key:e,variable_key:t,user_id:n},i))return null;var o=this.projectConfigManager.getConfig();if(!o)return null;var a=Ze(o,e,this.logger);if(!a)return null;var s=function(e,t,r,n){var i=e.featureKeyMap[t];return i?i.variableKeyMap[r]||(n.log(W.ERROR,J.VARIABLE_KEY_NOT_IN_DATAFILE,Ve,r,t),null):(n.log(W.ERROR,J.FEATURE_NOT_IN_DATAFILE,Ve,t),null)}(o,e,t,this.logger);if(!s)return null;if(r&&s.type!==r)return this.logger.log(W.WARNING,X.VARIABLE_REQUESTED_WITH_WRONG_TYPE,"OPTIMIZELY",r,s.type),null;var l=this.createInternalUserContext(n,i),u=this.decisionService.getVariationForFeature(o,a,l).result,c=pr(u),d=this.getFeatureVariableValueFromVariation(e,c,u.variation,s,n),f={};return u.decisionSource===ee.FEATURE_TEST&&null!==u.experiment&&null!==u.variation&&(f={experimentKey:u.experiment.key,variationKey:u.variation.key}),this.notificationCenter.sendNotifications(B.DECISION,{type:Q.FEATURE_VARIABLE,userId:n,attributes:i||{},decisionInfo:{featureKey:e,featureEnabled:c,source:u.decisionSource,variableKey:t,variableValue:d,variableType:s.type,sourceInfo:f}}),d},e.prototype.getFeatureVariableValueFromVariation=function(e,t,r,n,i){var o=this.projectConfigManager.getConfig();if(!o)return null;var a=n.defaultValue;if(null!==r){var s=function(e,t,r,n){if(!t||!r)return null;if(!e.variationVariableUsageMap.hasOwnProperty(r.id))return n.log(W.ERROR,J.VARIATION_ID_NOT_IN_DATAFILE_NO_EXPERIMENT,Ve,r.id),null;var i=e.variationVariableUsageMap[r.id][t.id];return i?i.value:null}(o,n,r,this.logger);null!==s?t?(a=s,this.logger.log(W.INFO,X.USER_RECEIVED_VARIABLE_VALUE,"OPTIMIZELY",a,n.key,e)):this.logger.log(W.INFO,X.FEATURE_NOT_ENABLED_RETURN_DEFAULT_VARIABLE_VALUE,"OPTIMIZELY",e,i,a):this.logger.log(W.INFO,X.VARIABLE_NOT_USED_RETURN_DEFAULT_VARIABLE_VALUE,"OPTIMIZELY",n.key,r.key)}else this.logger.log(W.INFO,X.USER_RECEIVED_DEFAULT_VARIABLE_VALUE,"OPTIMIZELY",i,n.key,e);return function(e,t,r){var n;switch(t){case re.BOOLEAN:"true"!==e&&"false"!==e?(r.log(W.ERROR,J.UNABLE_TO_CAST_VALUE,Ve,e,t),n=null):n="true"===e;break;case re.INTEGER:n=parseInt(e,10),isNaN(n)&&(r.log(W.ERROR,J.UNABLE_TO_CAST_VALUE,Ve,e,t),n=null);break;case re.DOUBLE:n=parseFloat(e),isNaN(n)&&(r.log(W.ERROR,J.UNABLE_TO_CAST_VALUE,Ve,e,t),n=null);break;case re.JSON:try{n=JSON.parse(e)}catch(i){r.log(W.ERROR,J.UNABLE_TO_CAST_VALUE,Ve,e,t),n=null}break;default:n=e}return n}(a,n.type,this.logger)},e.prototype.getFeatureVariableBoolean=function(e,t,r,n){try{return this.isValidInstance()?this.getFeatureVariableForType(e,t,re.BOOLEAN,r,n):(this.logger.log(W.ERROR,X.INVALID_OBJECT,"OPTIMIZELY","getFeatureVariableBoolean"),null)}catch(e){return this.logger.log(W.ERROR,e.message),this.errorHandler.handleError(e),null}},e.prototype.getFeatureVariableDouble=function(e,t,r,n){try{return this.isValidInstance()?this.getFeatureVariableForType(e,t,re.DOUBLE,r,n):(this.logger.log(W.ERROR,X.INVALID_OBJECT,"OPTIMIZELY","getFeatureVariableDouble"),null)}catch(e){return this.logger.log(W.ERROR,e.message),this.errorHandler.handleError(e),null}},e.prototype.getFeatureVariableInteger=function(e,t,r,n){try{return this.isValidInstance()?this.getFeatureVariableForType(e,t,re.INTEGER,r,n):(this.logger.log(W.ERROR,X.INVALID_OBJECT,"OPTIMIZELY","getFeatureVariableInteger"),null)}catch(e){return this.logger.log(W.ERROR,e.message),this.errorHandler.handleError(e),null}},e.prototype.getFeatureVariableString=function(e,t,r,n){try{return this.isValidInstance()?this.getFeatureVariableForType(e,t,re.STRING,r,n):(this.logger.log(W.ERROR,X.INVALID_OBJECT,"OPTIMIZELY","getFeatureVariableString"),null)}catch(e){return this.logger.log(W.ERROR,e.message),this.errorHandler.handleError(e),null}},e.prototype.getFeatureVariableJSON=function(e,t,r,n){try{return this.isValidInstance()?this.getFeatureVariableForType(e,t,re.JSON,r,n):(this.logger.log(W.ERROR,X.INVALID_OBJECT,"OPTIMIZELY","getFeatureVariableJSON"),null)}catch(e){return this.logger.log(W.ERROR,e.message),this.errorHandler.handleError(e),null}},e.prototype.getAllFeatureVariables=function(e,t,r){var n=this;try{if(!this.isValidInstance())return this.logger.log(W.ERROR,X.INVALID_OBJECT,"OPTIMIZELY","getAllFeatureVariables"),null;if(!this.validateInputs({feature_key:e,user_id:t},r))return null;var i=this.projectConfigManager.getConfig();if(!i)return null;var o=Ze(i,e,this.logger);if(!o)return null;var a=this.createInternalUserContext(t,r),s=this.decisionService.getVariationForFeature(i,o,a).result,l=pr(s),u={};o.variables.forEach((function(r){u[r.key]=n.getFeatureVariableValueFromVariation(e,l,s.variation,r,t)}));var c={};return s.decisionSource===ee.FEATURE_TEST&&null!==s.experiment&&null!==s.variation&&(c={experimentKey:s.experiment.key,variationKey:s.variation.key}),this.notificationCenter.sendNotifications(B.DECISION,{type:Q.ALL_FEATURE_VARIABLES,userId:t,attributes:r||{},decisionInfo:{featureKey:e,featureEnabled:l,source:s.decisionSource,variableValues:u,sourceInfo:c}}),u}catch(e){return this.logger.log(W.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(W.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 r=null===(e=this.projectConfigManager.getConfig())||void 0===e?void 0:e.sdkKey;r&&Le.removeNotificationCenter(r);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 r=t.readyTimeouts[e];clearTimeout(r.readyTimeout),r.onClose()})),this.readyTimeouts={},n.then((function(){return{success:!0}}),(function(e){return{success:!1,reason:String(e)}}))}catch(e){return this.logger.log(W.ERROR,e.message),this.errorHandler.handleError(e),Promise.resolve({success:!1,reason:String(e)})}},e.prototype.onReady=function(e){var t,r,n=this;"object"==typeof e&&null!==e&&void 0!==e.timeout&&(t=e.timeout),N.isSafeInteger(t)||(t=3e4);var i=new Promise((function(e){r=e})),o=this.nextReadyTimeoutId;this.nextReadyTimeoutId++;var a=setTimeout((function(){delete n.readyTimeouts[o],r({success:!1,reason:T("onReady timeout expired after %s ms",t)})}),t);return this.readyTimeouts[o]={readyTimeout:a,onClose:function(){r({success:!1,reason:"Instance closed"})}},this.readyPromise.then((function(){clearTimeout(a),delete n.readyTimeouts[o],r({success:!0})})),Promise.race([this.readyPromise,i])},e.prototype.createUserContext=function(e,t){var r,n;return null!=(n=(null===(r=this.odpManager)||void 0===r?void 0:r.isVuidEnabled())&&!e?e||this.getVuid():e)&&this.validateInputs({user_id:n},t)?new At({optimizely:this,userId:n,attributes:t,shouldIdentifyUser:!0}):null},e.prototype.createInternalUserContext=function(e,t){return new At({optimizely:this,userId:e,attributes:t,shouldIdentifyUser:!1})},e.prototype.decide=function(e,r,n){var i,o,a,s,l=this;void 0===n&&(n=[]);var u,c=e.getUserId(),d=e.getAttributes(),f=this.projectConfigManager.getConfig(),g=[];if(!this.isValidInstance()||!f)return this.logger.log(W.INFO,X.INVALID_OBJECT,"OPTIMIZELY","decide"),Ot(r,e,[ie.SDK_NOT_READY]);var v=f.featureKeyMap[r];if(!v)return this.logger.log(W.ERROR,J.FEATURE_NOT_IN_DATAFILE,"OPTIMIZELY",r),Ot(r,e,[T(ie.FLAG_KEY_INVALID,r)]);var h=this.getAllDecideOptions(n),m=this.decisionService.findValidatedForcedDecision(f,e,r);g.push.apply(g,m.reasons);var y=m.result;if(y)u={experiment:null,variation:y,decisionSource:ee.FEATURE_TEST};else{var E=this.decisionService.getVariationForFeature(f,v,e,h);g.push.apply(g,E.reasons),u=E.result}var _=u.decisionSource,b=null!==(o=null===(i=u.experiment)||void 0===i?void 0:i.key)&&void 0!==o?o:null,I=null!==(s=null===(a=u.variation)||void 0===a?void 0:a.key)&&void 0!==s?s:null,O=pr(u);!0===O?this.logger.log(W.INFO,X.FEATURE_ENABLED_FOR_USER,"OPTIMIZELY",r,c):this.logger.log(W.INFO,X.FEATURE_NOT_ENABLED_FOR_USER,"OPTIMIZELY",r,c);var A={},w=!1;h[t.OptimizelyDecideOption.EXCLUDE_VARIABLES]||v.variables.forEach((function(e){A[e.key]=l.getFeatureVariableValueFromVariation(r,O,u.variation,e,c)})),!h[t.OptimizelyDecideOption.DISABLE_DECISION_EVENT]&&(_===ee.FEATURE_TEST||_===ee.ROLLOUT&&tt(f))&&(this.sendImpressionEvent(u,r,c,O,d),w=!0);var S=[];h[t.OptimizelyDecideOption.INCLUDE_REASONS]&&(S=g.map((function(e){return T.apply(void 0,p([e[0]],e.slice(1),!1))})));var R={flagKey:r,enabled:O,variationKey:I,ruleKey:b,variables:A,reasons:S,decisionEventDispatched:w};return this.notificationCenter.sendNotifications(B.DECISION,{type:Q.FLAG,userId:c,attributes:d,decisionInfo:R}),{variationKey:I,enabled:O,variables:A,ruleKey:b,flagKey:r,userContext:e,reasons:S}},e.prototype.getAllDecideOptions=function(e){var r=this,n=c({},this.defaultDecideOptions);return Array.isArray(e)?e.forEach((function(e){t.OptimizelyDecideOption[e]?n[e]=!0:r.logger.log(W.WARNING,X.UNRECOGNIZED_DECIDE_OPTION,"OPTIMIZELY",e)})):this.logger.log(W.DEBUG,X.INVALID_DECIDE_OPTIONS,"OPTIMIZELY"),n},e.prototype.decideForKeys=function(e,r,n){var i=this;void 0===n&&(n=[]);var o={};if(!this.isValidInstance())return this.logger.log(W.ERROR,X.INVALID_OBJECT,"OPTIMIZELY","decideForKeys"),o;if(0===r.length)return o;var a=this.getAllDecideOptions(n);return r.forEach((function(r){var s=i.decide(e,r,n);a[t.OptimizelyDecideOption.ENABLED_FLAGS_ONLY]&&!s.enabled||(o[r]=s)})),o},e.prototype.decideAll=function(e,t){void 0===t&&(t=[]);var r=this.projectConfigManager.getConfig();if(!this.isValidInstance()||!r)return this.logger.log(W.ERROR,X.INVALID_OBJECT,"OPTIMIZELY","decideAll"),{};var n=Object.keys(r.featureKeyMap);return this.decideForKeys(e,n,t)},e.prototype.updateOdpSettings=function(){var e=this.projectConfigManager.getConfig();null!=this.odpManager&&null!=e&&this.odpManager.updateSettings(new ct(e.publicKeyForOdp,e.hostForOdp,e.pixelUrlForOdp,e.allSegments))},e.prototype.sendOdpEvent=function(e,t,r,n){if(this.odpManager){var i=null!=t?t:"fullstack",o=new Map(r);if(r&&r.size>0)try{r.forEach((function(e,t){"fs-user-id"!==t.toLowerCase()&&$.FS_USER_ID!==t.toLowerCase()||(o.delete(t),o.set($.FS_USER_ID,e))}))}catch(e){this.logger.warn(X.ODP_SEND_EVENT_IDENTIFIER_CONVERSION_FAILED)}try{var a=new pt(i,e,o,n);this.odpManager.sendEvent(a)}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(r){switch(r.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,r.sent()]}}))}))},e.prototype.getVuid=function(){var e;if(this.odpManager){if(this.odpManager.isVuidEnabled())return this.odpManager.getVuid();this.logger.log(W.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}(),_r={parseUserAgentInfo:function(){var e=(new s.UAParser).getResult();return{os:e.os,device:e.device}}};function br(){return _r}var Ir=Object.freeze({__proto__:null,get LogLevel(){return t.LogLevel},getLogger:x,setLogHandler:V,LOG_LEVEL:W,createLogger:be}),Or=x();j.setLogHandler(be()),j.setLogLevel(t.LogLevel.INFO);var Ar=!1,wr=function(e){var r,n;try{var i=!1;e.errorHandler&&(n=e.errorHandler,g=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,r=t.errorHandler,n=t.eventDispatcher,i=t.logger;if(r&&"function"!=typeof r.handleError)throw new Error(T(J.INVALID_ERROR_HANDLER,ve));if(n&&"function"!=typeof n.dispatchEvent)throw new Error(T(J.INVALID_EVENT_DISPATCHER,ve));if(i&&"function"!=typeof i.log)throw new Error(T(J.INVALID_LOGGER,ve));return!0}throw new Error(T(J.INVALID_CONFIG,ve))})(e),i=!0}catch(e){Or.error(e)}var o=void 0;null==e.eventDispatcher?(o=new ce({eventDispatcher:ye}),Ar||(o.sendPendingEvents(),Ar=!0)):o=e.eventDispatcher;var a=e.closingEventDispatcher;!e.eventDispatcher&&!a&&window.navigator&&"sendBeacon"in window.navigator&&(a=Ee);var s=e.eventBatchSize,l=e.eventFlushInterval;(function(e){return!("number"!=typeof e||!N.isSafeInteger(e))&&e>=1})(e.eventBatchSize)||(Or.warn("Invalid eventBatchSize %s, defaulting to %s",e.eventBatchSize,10),s=10),function(e){return!("number"!=typeof e||!N.isSafeInteger(e))&&e>0}(e.eventFlushInterval)||(Or.warn("Invalid eventFlushInterval %s, defaulting to %s",e.eventFlushInterval,1e3),l=1e3);var u=v(),d=Ae({logger:Or,errorHandler:u}),f={dispatcher:o,closingDispatcher:a,flushInterval:l,batchSize:s,maxQueueSize:e.eventMaxQueueSize||1e4,notificationCenter:d},p=!0===(null===(r=e.odpOptions)||void 0===r?void 0:r.disabled);p&&Or.info(X.ODP_DISABLED);var h=c(c({clientEngine:"javascript-sdk"},e),{eventProcessor:Re(f),logger:Or,errorHandler:u,datafileManager:e.sdkKey?rt(e.sdkKey,Or,e.datafile,e.datafileOptions):void 0,notificationCenter:d,isValidInstance:i,odpManager:p?void 0:new It({logger:Or,odpOptions:e.odpOptions})}),m=new Er(h);try{if("function"==typeof window.addEventListener){var y="onpagehide"in window?"pagehide":"unload";window.addEventListener(y,(function(){m.close()}),!1)}}catch(e){Or.error(X.UNABLE_TO_ATTACH_UNLOAD,"INDEX_BROWSER",e.message)}return m}catch(e){return Or.error(e),null}},Tr=function(){Ar=!1},Sr=j.setLogHandler,Rr=j.setLogLevel,Nr=c(c({},Ir),{logging:Ie,errorHandler:me,eventDispatcher:ye,sendBeaconEventDispatcher:Ee,enums:oe,setLogger:Sr,setLogLevel:Rr,createInstance:wr,__internalResetRetryState:Tr,OptimizelyDecideOption:t.OptimizelyDecideOption,getUserAgentParser:br});t.LOG_LEVEL=W,t.__internalResetRetryState=Tr,t.createInstance=wr,t.createLogger=be,t.default=Nr,t.enums=oe,t.errorHandler=me,t.eventDispatcher=ye,t.getLogger=x,t.getUserAgentParser=br,t.logging=Ie,t.sendBeaconEventDispatcher=Ee,t.setLogHandler=V,t.setLogLevel=Rr,t.setLogger=Sr},function(e,t,r){"use strict";var n=r(0);function i(e){return(i="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){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,(o=n.key,a=void 0,a=function(e,t){if("object"!==i(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(o,"string"),"symbol"===i(a)?a:String(a)),n)}var o,a}var a=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,r,a;return t=e,(r=[{key:"init",value:function(){}},{key:"bindGTMHandlers",value:function(e){var t=this;if(void 0!==(e="object"===i(e)?e:window.GTMData))if("productImpression"===e.event)this.bindNewModelImpressionEventHandlers(e);else if("undefined"!=typeof dataLayer){var r=n.a.getDescendantProp(e,"ecommerce.impressions"),o=n.a.getDescendantProp(e,"ecommerce.currencyCode");"object"===i(r)&&r.length>0&&(r.forEach((function(e){t.bindNewModelImpressionEventHandler(e,o)})),delete e.ecommerce.impressions),dataLayer.push(e),window.GTMData=void 0}}},{key:"bindNewModelClickEventHandler",value:function(){var e=this;!0===window.isGTMNewModelEnabled&&$("body").on("click","[data-gtm-new-model-click]",(function(t){var r=$(this);e.pushDataLayerObject(r,"data-gtm-new-model-click")}))}},{key:"bindNewModelImpressionEventHandlers",value:function(e){var t=this;if(void 0!==(e="object"===i(e)?e:window.productImpressionData)){var r=n.a.getDescendantProp(e,"ecommerce.impressions"),o=n.a.getDescendantProp(e,"ecommerce.currencyCode");void 0!==r&&r.forEach((function(e){t.bindNewModelImpressionEventHandler(e,o)}))}}},{key:"bindNewModelImpressionEventHandler",value:function(e,t){var r=e.id,n=document.getElementById("data-gtm-"+r);if(null!=n){if(void 0!==window.GTMImpressionsInviews[r]){try{this.intersectionObserverIsSupported?window.GTMImpressionsInviews[r].disconnect():window.GTMImpressionsInviews[r].destroy()}catch(e){}delete window.GTMImpressionsInviews[r]}this.intersectionObserverIsSupported?(window.GTMImpressionsInviews[r]=new IntersectionObserver((function(n){if(!0===n[0].isIntersecting){try{window.GTMImpressionsInviews[r].disconnect()}catch(e){}delete window.GTMImpressionsInviews[r],dataLayer.push({event:"productImpression",ecommerce:{currencyCode:t,impressions:[e]}})}}),{threshold:[0]}),window.GTMImpressionsInviews[r].observe(n)):window.GTMImpressionsInviews[r]=new Waypoint.Inview({element:n,enter:function(n){try{window.GTMImpressionsInviews[r].destroy()}catch(e){}delete window.GTMImpressionsInviews[r],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,r){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 r=e.attr(t);if("string"==typeof r&&""!==r)try{r=JSON.parse(r),dataLayer.push(r)}catch(e){n.a.l("ERROR")}}}])&&o(t.prototype,r),a&&o(t,a),Object.defineProperty(t,"prototype",{writable:!1}),e}();t.a=a},,function(e,t,r){"use strict";r.d(t,"H",(function(){return y})),r.d(t,"r",(function(){return E})),r.d(t,"k",(function(){return _})),r.d(t,"K",(function(){return O})),r.d(t,"F",(function(){return A})),r.d(t,"A",(function(){return w})),r.d(t,"p",(function(){return T})),r.d(t,"i",(function(){return S})),r.d(t,"j",(function(){return R})),r.d(t,"d",(function(){return N})),r.d(t,"y",(function(){return D})),r.d(t,"t",(function(){return C})),r.d(t,"v",(function(){return U})),r.d(t,"u",(function(){return P})),r.d(t,"C",(function(){return L})),r.d(t,"B",(function(){return M})),r.d(t,"h",(function(){return k})),r.d(t,"f",(function(){return F})),r.d(t,"G",(function(){return x})),r.d(t,"o",(function(){return V})),r.d(t,"J",(function(){return j})),r.d(t,"I",(function(){return G})),r.d(t,"x",(function(){return B})),r.d(t,"z",(function(){return $})),r.d(t,"s",(function(){return K})),r.d(t,"g",(function(){return H})),r.d(t,"e",(function(){return q})),r.d(t,"m",(function(){return z})),r.d(t,"l",(function(){return Y})),r.d(t,"D",(function(){return W})),r.d(t,"n",(function(){return J})),r.d(t,"w",(function(){return X})),r.d(t,"E",(function(){return Z})),r.d(t,"b",(function(){return Q})),r.d(t,"a",(function(){return ee})),r.d(t,"q",(function(){return te})),r.d(t,"c",(function(){return ie}));var n=r(2),i=r(0),o=r(6);function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach((function(t){d(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function l(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)||p(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 u(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],l=!0,u=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}(e,t)||p(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 d(e,t,r){return(t=function(e){var t=function(e,t){if("object"!==c(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.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:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function f(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=p(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}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,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function p(e,t){if(e){if("string"==typeof e)return g(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?g(e,t):void 0}}function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var v=document.getElementById("calendarFeatures"),h=Object(o.a)("backup_functionality","MAX_TIME_BETWEEN_PROVIDERS")||(v&&v.dataset.maxTimeBetweenProviders?parseInt(v.dataset.maxTimeBetweenProviders):void 0),m=Object(o.a)("backup_functionality","MINIMUM_PROVIDER_QUOTAS")||(v&&v.dataset.minimumProviderQuotas?parseInt(v.dataset.minimumProviderQuotas):void 0),y=function(e){if(Array.isArray(e)){var t,r,i,o="",a="",s=f(e);try{for(s.s();!(i=s.n()).done;){var l=i.value||{},u=l.start,c=l.end,d=null!=u?u:"",p=null!=c?c:"";o=Object(n.c)(o,d,!0),a=Object(n.c)(a,p,!1)}}catch(e){s.e(e)}finally{s.f()}return{start:null!==(t=o)&&void 0!==t?t:"",end:null!==(r=a)&&void 0!==r?r:""}}var g=e||{},v=g.start,h=g.end;return{start:null!=v?v:"",end:null!=h?h:""}},E=function e(t,r){var n=r?d({},r,[]):[];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=u(e,2),r=t[0],n=t[1];return[r,null===n?[]:n]})));if("object"===c(t[0])){if(1===t.length)return e(t[0],r);if(r&&t[0]&&t[0][r]&&0===t[0][r].length)return n;var i=function(e,t){if(!e||Array.isArray(e)&&0===e.length||0===Object.keys((r=e,Object.keys(r).reduce((function(e,t){return r[t]&&Array.isArray(r[t])&&r[t].length>0&&(e[t]=r[t]),e}),{}))).length)return t;var r;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={},i=function(r){t.hasOwnProperty(r)&&Array.isArray(e[r])&&Array.isArray(t[r])&&(n[r]=e[r].filter((function(e){return t[r].includes(e)})))};for(var o in e)i(o);return Object.keys(n).length>0?n:void 0}return e},o=t.reduce((function(t,o){if(o&&"object"===c(o)&&(!Array.isArray(o)||o.length>0)){var a=e(o,r);return i(null!=t?t:n,a)}return t}),n);return null!=o?o:n}return r?d({},r,Array.from(new Set(l(t)))):Array.from(new Set(l(t)))}return n},_=function(e){var t,r;return null!==(t=null!==(r=null!=e?e:window.currencySymbol)&&void 0!==r?r:i.a.getCurrencySymbol())&&void 0!==t?t:"€"},b=function(e,t,r){var n,i=f(t.filter((function(e){return!I(e,r)})));try{var o=function(){var r=n.value;e=e.filter((function(e){return n=r,i=u(e.split(":").map(Number),2),o=i[0],a=i[1],s=u(n.split(":").map(Number),2),l=s[0],c=s[1],d=Math.abs(60*(o-l)+(a-c)),!h||d>=h||t.includes(e);var n,i,o,a,s,l,c,d}))};for(i.s();!(n=i.n()).done;)o()}catch(e){i.e(e)}finally{i.f()}return e},I=function(e,t){var r=!1;if(t&&m&&m>0)for(var n=0,i=Object.keys(t);n<i.length;n++){var o=i[n];if(o.includes(e)){var a=t[o];if(parseInt(a)<=m){r=!0;break}}}return r},O=function(e,t,r){if(!e)return{};if(Array.isArray(e)){var i=function(){for(var i={},o={},a=0,s=0,d=e;s<d.length;s++){var p=d[s];p&&"object"===c(p)&&Object.entries(p).map((function(s){var c=u(s,2),d=c[0],p=c[1];i[d]||(i[d]=null!=p?p:[]);var g=Object(n.e)(i[d]);0===a&&(o[d]=g[0].hours.slice());var v,m=i[d]===p?g:Object(n.e)(p),y=l(g),E=f(m);try{var _=function(){var e=v.value,t=y.find((function(t){return t.fee===e.fee}));t?t.hours=Array.from(new Set([].concat(l(t.hours),l(e.hours)))).sort((function(e,t){var r=Object(n.D)(e),i=Object(n.D)(t);return r.getTime()-i.getTime()})):y.push(e)};for(E.s();!(v=E.n()).done;)_()}catch(e){E.e(e)}finally{E.f()}if(e[0]&&e[0][d]&&h&&h>0&&r){var I,O=o[d];Array.isArray(t)&&t[0]&&A(t[0])[d]&&(I=A(t[0])[d]),y.forEach((function(e){e.hours=b(e.hours,O,I)}))}i[d]=y.map((function(e){return"".concat(e.fee,".").concat(e.hours.join(","))})).join(";")})),a++}return{v:i}}();if("object"===c(i))return i.v}return e||{}},A=function(e){if(null!=e&&"string"==typeof e)try{return JSON.parse(e)||{}}catch(e){return{}}if(Array.isArray(e)){for(var t={},r=0,n=e;r<n.length;r++){var i=n[r],o={};if(null!=i&&"string"==typeof i)try{var a;o=null!==(a=JSON.parse(i))&&void 0!==a?a:{}}catch(e){o={}}else o=null!=i?i:{};for(var l=0,u=Object.keys(o);l<u.length;l++){var c=u[l];t[c]?t[c]=s(s({},t[c]),o[c]):t[c]=s({},o[c])}}return t}return null!=e?e:{}},w=function(e){if(Array.isArray(e)){for(var t={},r=0,n=e;r<n.length;r++){var i=n[r];"object"!==c(i)||Array.isArray(i)||(t=s(s({},t),i))}return t}return null!=e?e:{}},T=function(e){return null!=e?e:[]},S=function(e){var t;return Object(n.z)(null!==(t=null!=e?e:i.a.getLocaleCurrencyBeforeAmount())&&void 0!==t&&t)},R=function(e){var t;return Object(n.z)(null===(t=null!=e?e:i.a.getLocaleCurrencySpace())||void 0===t||t)},N=function(e){return Object(n.A)(e,0)},D=function(e){return Object(n.A)(e,0)},C=function(e){return Object(n.z)(null!=e&&e)},U=function(e){return e&&Array.isArray(e)?e.map((function(e){return Object(n.z)(null!=e&&e)})).every((function(e){return!0===e})):Object(n.z)(null!=e&&e)},P=function(e){return Object(n.z)(null!=e&&e)},L=function(e){return Object(n.A)(e,3)},M=function(e){return Object(n.A)(e,0)},k=function(e){return null!=e?e:""},F=function(e){return null!=e?e:""},x=function(e){return Object(n.A)(e,1,[1,2])},V=function(e,t,r){var i,o;if("object"===c(e)&&Array.isArray(e)){var a,s=f(e);try{for(s.s();!(a=s.n()).done;){var l=a.value;o=Object(n.c)(o,null!=l?l:"",!0)}}catch(e){s.e(e)}finally{s.f()}}else o=e;var u=null!==(i=null!=r?r:o)&&void 0!==i?i:"";if(Object(n.y)()){var d=Object(n.s)(t),p=Object(n.A)(null==d?void 0:d.statusPayLater,-1);if(0===p||3===p){var g=Object(n.u)(),v=Object(n.b)(Object(n.d)(),g+1);if(v>Object(n.d)(u))return v.toISOString().split("T")[0]}}return u},j=function(e,t,r,i){var o,a,s,l,u=Object(n.s)(e),c=Object(n.t)(t),d=null==r?void 0:r.horaActividad,f=(null==i?void 0:i.fechaDisfrute)?i.fechaDisfrute.split(" ")[1]:void 0,p=null!==(o=null==i?void 0:i.time)&&void 0!==o?o:f;return null!==(a=null!==(s=null!==(l=null!=d?d:p)&&void 0!==l?l:null==c?void 0:c.time)&&void 0!==s?s:null==u?void 0:u.time)&&void 0!==a?a:void 0},G=function(e){return!!e&&Object.keys(e).length>0},B=function(e){return Object(n.A)(e,0)},$=function(e){if("object"===c(e)&&Array.isArray(e)){var t,r=0,i=f(e);try{for(i.s();!(t=i.n()).done;){var o=t.value;r+=Object(n.A)(o,0)}}catch(e){i.e(e)}finally{i.f()}return r}return Object(n.A)(e,0)},K=function(e){return Object(n.A)(e,0)},H=function(e,t){var r=null!=t?t:null==e?void 0:e.existHours;if(null!=r)return Object(n.z)(r)?"1":"0"},q=function(e,t){var r=null!=t?t:null==e?void 0:e.allowModifyDateAndTime;if(null!=r)return Object(n.z)(r)},z=function(e){return e&&Object.keys(e).length>0?"activity_modify":void 0},Y=function(e){return e&&Object.keys(e).length>0?"fechaActividad":void 0},W=function(e,t){var r,i,o=Object(n.s)(e),a=Object(n.t)(t);return null!==(r=null!==(i=null==a?void 0:a.paxesAsString)&&void 0!==i?i:null==o?void 0:o.paxesAsString)&&void 0!==r?r:void 0},J=function(e){return Object(n.z)(e)},X=function(e){return null!=e&&Array.isArray(e)?e.map((function(e){return Object(n.A)(e,0)})):[]},Z=function(e,t,r,i){return e?Object(n.g)(e,t,r,i).map((function(e){return Object(n.f)(e,r,i).map((function(e){var t=e.rate,r=e.originalRate,i=e.commision,o={rate:"".concat(Object(n.A)(t,0))};return r&&(o.originalRate="".concat(Object(n.A)(r,0))),i&&(o.commision="".concat(Object(n.A)(i,0))),o}))})):Object(n.h)(t&&t.length>0?t.length:0,Object(n.h)(r&&Array.isArray(r)&&r.length>0?r.length:0,Object(n.m)(i)))},Q=function(e){var t,r,n,i,o=(null===(t=window.activityData)||void 0===t?void 0:t.cityUrl)&&""!==(null===(r=window.activityData)||void 0===r?void 0:r.cityUrl)?null===(n=window.activityData)||void 0===n?void 0:n.cityUrl:void 0,a=e&&""!==e?e:void 0;return null!==(i=null!=a?a:o)&&void 0!==i?i:void 0},ee=function(e){return Object(n.z)(e)},te=function(e,t,r){var i=Object(n.o)(e,Object(n.j)()),o=i.horasValidas,a=O(Object(n.z)(t)?Object(n.k)(e,i,"horasValidas",t,r):o);if(null!=a){if(Array.isArray(a)&&a.length>0)return!0;if("object"===c(a)&&Object.keys(a).length>0)return!0}return!1},re=function(e){return e.filter((function(e){var t=u(e.split(":"),2),r=t[0],n=t[1],i=parseInt(r,10),o=parseInt(n,10);return!isNaN(i)&&!isNaN(o)})).sort((function(e,t){var r=Object(n.D)(e),i=Object(n.D)(t);return r.getTime()-i.getTime()}))},ne=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)})))?re(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}))?re(e):void 0;var t},ie=function(e,t){var r,i,o,a=Object(n.o)(e,Object(n.j)()),s=Object(n.z)(t),l=a.oldCalendarVariables,u=a.horasActividad,c=(null!=l?l:{}).horasActividad;return null!==(r=null!==(i=null!==(o=ne(s?Object(n.k)(e,a,"oldCalendarVariables.horasActividad",s):c))&&void 0!==o?o:function(e,t){var r=Object(n.o)(e,Object(n.j)()),i=Object(n.z)(t),o=r.modifyCalendar,a=r.horasValidas,s=null==o?void 0:o.date;if(null!=s){if(i){var l=Object(n.k)(e,r,"horasValidas",i);if(Array.isArray(l))return ne(l.map((function(e){if(Object(n.C)(s,e))return ne(Object(n.e)(null==e?void 0:e[s])[0].hours)})));if(Object(n.C)(s,l))return ne(Object(n.e)(null==l?void 0:l[s])[0].hours)}if(Object(n.C)(s,a))return ne(Object(n.e)(null==a?void 0:a[s])[0].hours)}}(e,s))&&void 0!==i?i:ne(s?Object(n.k)(e,a,"horasActividad",s):u))&&void 0!==r?r:[]}},,function(e,t){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(e){"object"==typeof window&&(r=window)}e.exports=r},function(e,t,r){"use strict";r.d(t,"a",(function(){return a})),r.d(t,"b",(function(){return s})),r.d(t,"d",(function(){return l})),r.d(t,"c",(function(){return u}));var n=r(2);function i(e){return(i="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,r){return(t=function(e){var t=function(e,t){if("object"!==i(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===i(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var a=function(e,t,r){var i=Object(n.B)("tarifa",e,t);return r&&r.length>0&&(i=r.map((function(e){return i[e]}))),i},s=function(e,t){return Object(n.B)("originalRate",e,t)},l=function(e,t){return Object(n.B)("su",e,t)},u=function(e,t){var r=t||{},i=r.lang,a=r.id,s=Object(n.A)(a,1/0);if(e){var l={};for(var u in e)if(e.hasOwnProperty(u)){var c=Object(n.A)(e[u],1/0);c&&isFinite(c)&&(l[u]=c)}return i&&a&&isFinite(s)&&!l.hasOwnProperty(i)&&(l[i]=Object(n.A)(s)),l}return i&&a&&isFinite(s)?o({},i,Object(n.A)(s)):{}}},function(e,t){var r={utf8:{stringToBytes:function(e){return r.bin.stringToBytes(unescape(encodeURIComponent(e)))},bytesToString:function(e){return decodeURIComponent(escape(r.bin.bytesToString(e)))}},bin:{stringToBytes:function(e){for(var t=[],r=0;r<e.length;r++)t.push(255&e.charCodeAt(r));return t},bytesToString:function(e){for(var t=[],r=0;r<e.length;r++)t.push(String.fromCharCode(e[r]));return t.join("")}}};e.exports=r},function(e,t,r){"use strict";var n=r(0),i={get:function(e){var t={url:e};return $.ajax(t).fail((function(e){i.error(e)}))},post:function(e,t,r){var n={url:e,type:"POST",data:t};return void 0!==r&&(n.dataType=r),$.ajax(n).fail((function(e){i.error(e)}))},patch:function(e,t,r){var n={url:e,type:"PATCH",data:t};return void 0!==r&&(n.dataType=r),$.ajax(n).fail((function(e){i.error(e)}))},postWithFiles:function(e,t,r){var n=new FormData;for(var o in t)n.append(o,t[o]);var a={url:e,type:"POST",data:n,contentType:!1,processData:!1};return void 0!==r&&(a.dataType=r),$.ajax(a).fail((function(e){i.error(e)}))},delete:function(e){var t={url:e,type:"DELETE"};return $.ajax(t).fail((function(e){i.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(r){t={message:"error "+e.status+", "+e.statusText},n.a.warn(t),0!==e.status&&console.error("Ajax error: "+e.status+", "+e.statusText)}}},o=i;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)}var s={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",footerNewsletterRegisterExpress:"/newsletter/alta-express",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/",paylandsIframeUrl:"/paylands/getiframeurl/"},methods:{generalGet:function(e){return o.get(e)},generalDelete:function(e){return o.delete(e)},paylandsIframeUrl:function(e){var t=s.getCompleteUrl("paylandsIframeUrl");return o.post(t,JSON.stringify(e.data))},search:function(e){var t=s.getCompleteUrl("search",e.params);return-1!==location.href.indexOf("localhost")&&(t="http://localhost:8090/mocks/searchData.js"),o.get(t)},activityFilters:function(e){var t=s.getCompleteUrl("activityFilters",{city:e.params.city});return o.post(t,JSON.stringify(e.data))},categoryFilters:function(e){var t=s.getCompleteUrl("categoryFilters",{category:e.params.category});return o.post(t,JSON.stringify(e.data))},destinationCategoryFilters:function(e){var t=s.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,r,n){n=void 0!==n&&n,r=void 0!==r&&r;var i=void 0!==e.action?e.action:document.location.ref;return t&&(i=t),n?o.patch(i,JSON.stringify(e.data)):!1===r?o.post(i,JSON.stringify(e.data)):o.postWithFiles(i,e.data)},homeViewMoreTopDestinations:function(e){var t=s.getCompleteUrl("homeViewMoreTopDestinations",{limit:e.params.limit,offset:e.params.offset});return o.get(t)},clientViewMoreReserves:function(e){var t=s.getCompleteUrl("clientViewMoreReserves",{slug:e.params.slug,limit:e.params.limit,offset:e.params.offset});return o.get(t)},footerNewsletterRegisterExpress:function(e){var t=s.getCompleteUrl("footerNewsletterRegisterExpress",{email:e.params.email});return o.post(t,e.params)},popUpError:function(e,t,r,i){var o,a=n.a.tr("popUp.agency.acceptButtonAcceptNewConditionsAdmin"),s=n.a.tr("popUp.agency.cancelButtonAcceptNewConditionsAdmin");i=null!=i&&""!==i?i:$($("form")[0]).attr("id");var l=Function.prototype,u=n.a.tr("agenciesUrl")+"/"+n.a.tr("conditions_agencies_url_form_href");!1===$("body").hasClass("is-guide")&&(u="/"+n.a.getLocale()+u),"admin"===e?(o={title:n.a.tr("popUp.agency.titleAcceptNewConditionsTitle"),body:n.a.tr("civitatis_titleAcceptNewConditionsAdmin",u),confirmText:a,cancelText: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},l=function(){n.a.loading(),$.ajax({url:r,type:"POST",data:'{"accept":"true", "agency":"'+t+'"}',contentType:"application/json",dataType:"json",success:function(e){$("#"+i).submit()},error:function(e,t,r){0!==e.status&&console.error(new Error("Ajax error: "+t+", "+r))},complete:function(e,t){n.a.unLoading()}})}):"user"===e&&(o={title:n.a.tr("popUp.agency.titleAcceptNewConditionsTitle"),body:n.a.tr("popUp.agency.titleAcceptNewConditionsClient",u),confirmText: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}),$(".reveal").each((function(e,t){var r=$(t).find(".close-button");$(r).trigger("click")})),CivAPP.ConfirmUtil.load(o).done((function(){l()}))}},getParts:function(e){for(var t=[],r=e.split("/:"),n=1;n<r.length;n++){var i=r[n].split("/")[0];""!=i&&t.push(i)}return t},fillUrl:function(e,t){if(-1==e.indexOf(":"))return e;for(var r=s.getParts(e),i=0;i<r.length;i++)if(void 0===t[r[i]])throw n.a.error("error in fillUrl"),n.a.error("part:"+r[i]),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(s.urls,e);if(void 0===t)throw"WS.getUrl - serviceId not found: "+e;return t},getCompleteUrl:function(e,t){var r=s.getUrl(e);return void 0===t&&(t={}),r=s.fillUrl(r,t)},req:function(e,t,r,i,o){var a=n.a.getDescendantProp(s.methods,e);if(void 0===a)throw"WS.req: serviceId not found";return a(t,r,i,o)},fileFormRedirect:function(e,t,r,n){return s.formRedirect(e,t,r,n,!0)},formRedirectWithPatch:function(e,t,r){return s.formRedirect(e,t,r,null,!1,!0)},formRedirect:function(e,t,r,i,o,a,l){a=void 0!==a&&a;e={data:e};return o=void 0!==o&&o,void 0!==t&&(e.action=t),"function"==typeof l?l():n.a.loading(),s.req("formSubmit",e,i,o,a).done((function(e){s.processFormRedirectResponse(e,r)})).fail((function(t){n.a.l("fallo... en Utils.formRedirect"),n.a.l(t),"user-login"===r&&e&&e.data&&e.data.typology&&(6==e.data.typology||7==e.data.typology)?s.processFormRedirectResponse(t,r,!0):n.a.unLoadingAll()}))},processFormRedirectResponse:function(e,t,r){if(null==r||1!=r&&"true"!=r&&"1"!=r||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 i=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:[],u=void 0!==e.sucessMessages?e.sucessMessages:[],c=void 0!==e.popUp&&null!==e.popUp&&""!==e.popUp?e.popUp:null,d=void 0!==e.agency&&null!==e.agency&&""!==e.agency?e.agency:"",f=e.action,p=e.reqid,g=0===i.length&&0===o.length&&0===l.length&&0===u.length&&null===c;if("user-register"===t&&void 0!==e.newUser&&(f=n.a.addParam("newUser",e.newUser,f)),"user-register"===t&&void 0!==e.activation&&(f=n.a.addParam("activation",e.activation,f)),void 0===p&&(p=n.a.getParam("reqid")),g&&void 0!==f&&void 0!==p&&""!==p)f=f.replace(/\/$/,""),f=n.a.addParam("reqid",p,f),document.location=f;else if(g&&void 0!==f)document.location=f;else if(g)n.a.l("Error en formRedirect; datos de respuesta incorrectos"),n.a.unLoadingAll();else{if(void 0!==CivAPP.Forms&&null!==CivAPP.Forms&&null!=r&&(1==r||"true"==r||"1"==r)){var v=$("#".concat(t));CivAPP.Forms.resetForm(e,v),CivAPP.Forms.updateMessages(e,v),CivAPP.Forms.hideFormInSuccess(v,v.hasClass("js-hide-form"),l)}n.a.unLoadingAll(),null!==c&&s.methods.popUpError(c,d,f,t)}}else{$("body").hasClass("_multiple-submit")?$("#".concat(t)).addClass("_submitted"):n.a.unLoadingAll();var h=function(){};if(void 0!==$("#".concat(t)).attr("data-success-callback")&&null!==$("#".concat(t)).attr("data-success-callback")&&""!==$("#".concat(t)).attr("data-success-callback")&&(h=function(){window.location=$("#".concat(t)).attr("data-success-callback")}),$("body").hasClass("_multiple-submit")){var m=$("form.js-conditional-inputs.js-modal-submit"),y=$(m).filter("._submitted");m.length==y.length&&(n.a.unLoadingAll(),$("body").removeClass("_multiple-submit"),$(m).removeClass("_submitted"),h())}else CivAPP.ConfirmUtil.showSuccess({title:n.a.tr("successMessage"),message:"",closeCallback:h})}}};t.a=s},function(e,t,r){"use strict";var n,i=r(1),o=r.n(i),a=r(0),s=r(11);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 u(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,(i=n.key,o=void 0,o=function(e,t){if("object"!==l(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.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)}(i,"string"),"symbol"===l(o)?o:String(o)),n)}var i,o}function c(e,t){return(c=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 r,n=g(e);if(t){var i=g(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return f(this,r)}}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 p(e)}function p(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function g(e){return(g=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&&c(e,t)}(f,e);var t,r,i,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(p(t)),t.onDayMouseLeave=t.onDayMouseLeave.bind(p(t)),t.onDayClick=t.onDayClick.bind(p(t)),t}return t=f,(r=[{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,r){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){}},{key:"onDayClick",value:function(e,t,r){var n=this;if(t.disabled||t.disabledTo||t.disabledWithTooltip)return!1;if(1===this.state.clickAction)this.setState({clickAction:2},(function(){n.props.handleFromClick(e)}));else{if(e.setHours(0,0,0,0)<this.props.rangeStart.setHours(0,0,0,0))return!1;this.setState({clickAction:1},(function(){n.props.handleToClick(e)}))}}},{key:"componentWillReceiveProps",value:function(e){e.resetFirstDay&&this.setState({clickAction:1})}},{key:"render",value:function(){var e,t,r,i=this,l=this,u=new Date,c=new Date,d=function(e){return""!==i.props.rangeStart&&""!==i.state.enteredTo&&e.setHours(0,0,0,0)>=i.props.rangeStart.setHours(0,0,0,0)&&e.setHours(0,0,0,0)<=i.state.enteredTo.setHours(0,0,0,0)};1===this.state.clickAction?(e=function(e){return e.setHours(0,0,0,0)<u.setHours(0,0,0,0)},r=function(e){return!1},t=""===this.props.rangeEnd?d:function(e){return""!==i.state.enteredTo&&e.setHours(0,0,0,0)>=i.state.enteredTo.setHours(0,0,0,0)&&e.setHours(0,0,0,0)<=i.props.rangeEnd.setHours(0,0,0,0)}):(e=function(e){return""!==i.props.rangeStart&&e.setHours(0,0,0,0)<i.props.rangeStart.setHours(0,0,0,0)},r=function(e){return""!==i.props.rangeStart&&e.setHours(0,0,0,0)>a.a.addDaysToDate(i.props.rangeStart.setHours(0,0,0,0),14)},t=""===this.props.rangeEnd?d:function(e){return""!==i.state.enteredTo&&e.setHours(0,0,0,0)>=i.props.rangeStart.setHours(0,0,0,0)&&e.setHours(0,0,0,0)<=i.state.enteredTo.setHours(0,0,0,0)&&e.setHours(0,0,0,0)<a.a.addDaysToDate(i.props.rangeStart.setHours(0,0,0,0),15)});var f={disabled:e,selectedAny:function(e){return""!==i.props.rangeStart&&a.a.dateToYYYYMMDD(e)===a.a.dateToYYYYMMDD(i.props.rangeStart)},selectedFrom:function(e){return""!==i.props.rangeStart&&a.a.dateToYYYYMMDD(e)===a.a.dateToYYYYMMDD(i.props.rangeStart)},selectedTo:function(e){return""!==i.props.rangeEnd&&a.a.dateToYYYYMMDD(e)===a.a.dateToYYYYMMDD(i.props.rangeEnd)},inHoverRange:t,disabledWithTooltip:r,inRange:function(e){return""!==i.props.rangeStart&&""!==i.props.rangeEnd&&e.setHours(0,0,0,0)>i.props.rangeStart.setHours(0,0,0,0)&&e.setHours(0,0,0,0)<i.props.rangeEnd.setHours(0,0,0,0)}},p=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)?p+=" _with-range":p+=" _with-one-day"),""!==this.state.enteredTo&&(p+=" _with-hover");var g=a.a.getLocale(),v=s.a.getMonths(g);return o.a.createElement("div",{className:"m-date-range-picker__calendar "+p},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:g,localeUtils:s.a,modifiers:f,renderDay:function(e,t){var r=1===l.state.clickAction?a.a.tr("filters.from"):a.a.tr("filters.to"),n="",i="_time";return t.disabledWithTooltip&&(r=a.a.tr("filters.availability.maxDaysWarning",l.state.maxDays),n=" _warning",i="_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:i},r))),o.a.createElement("span",{className:"_inner"},e.getDate()))},fromMonth:u,"data-month":c,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())))}})))}}])&&u(t.prototype,r),i&&u(t,i),Object.defineProperty(t,"prototype",{writable:!1}),f}(o.a.Component);function h(e){return(h="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 r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,(i=n.key,o=void 0,o=function(e,t){if("object"!==h(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==h(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(i,"string"),"symbol"===h(o)?o:String(o)),n)}var i,o}function y(e,t){return(y=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function E(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 r,n=I(e);if(t){var i=I(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return _(this,r)}}function _(e,t){if(t&&("object"===h(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return b(e)}function b(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function I(e){return(I=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var O=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&&y(e,t)}(a,e);var t,r,n,i=E(a);function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).state={fromDate:"",toDate:""},t.toDateIsOk=t.toDateIsOk.bind(b(t)),t.handleFromClick=t.handleFromClick.bind(b(t)),t.handleToClick=t.handleToClick.bind(b(t)),t}return t=a,(r=[{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:"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="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,r=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:r,resetFirstDay:e}))}}])&&m(t.prototype,r),n&&m(t,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(o.a.Component);t.a=O},,function(e,t,r){var n,i,o,a,s;n=r(25),i=r(19).utf8,o=r(26),a=r(19).bin,(s=function(e,t){e.constructor==String?e=t&&"binary"===t.encoding?a.stringToBytes(e):i.stringToBytes(e):o(e)?e=Array.prototype.slice.call(e,0):Array.isArray(e)||e.constructor===Uint8Array||(e=e.toString());for(var r=n.bytesToWords(e),l=8*e.length,u=1732584193,c=-271733879,d=-1732584194,f=271733878,p=0;p<r.length;p++)r[p]=16711935&(r[p]<<8|r[p]>>>24)|4278255360&(r[p]<<24|r[p]>>>8);r[l>>>5]|=128<<l%32,r[14+(l+64>>>9<<4)]=l;var g=s._ff,v=s._gg,h=s._hh,m=s._ii;for(p=0;p<r.length;p+=16){var y=u,E=c,_=d,b=f;u=g(u,c,d,f,r[p+0],7,-680876936),f=g(f,u,c,d,r[p+1],12,-389564586),d=g(d,f,u,c,r[p+2],17,606105819),c=g(c,d,f,u,r[p+3],22,-1044525330),u=g(u,c,d,f,r[p+4],7,-176418897),f=g(f,u,c,d,r[p+5],12,1200080426),d=g(d,f,u,c,r[p+6],17,-1473231341),c=g(c,d,f,u,r[p+7],22,-45705983),u=g(u,c,d,f,r[p+8],7,1770035416),f=g(f,u,c,d,r[p+9],12,-1958414417),d=g(d,f,u,c,r[p+10],17,-42063),c=g(c,d,f,u,r[p+11],22,-1990404162),u=g(u,c,d,f,r[p+12],7,1804603682),f=g(f,u,c,d,r[p+13],12,-40341101),d=g(d,f,u,c,r[p+14],17,-1502002290),u=v(u,c=g(c,d,f,u,r[p+15],22,1236535329),d,f,r[p+1],5,-165796510),f=v(f,u,c,d,r[p+6],9,-1069501632),d=v(d,f,u,c,r[p+11],14,643717713),c=v(c,d,f,u,r[p+0],20,-373897302),u=v(u,c,d,f,r[p+5],5,-701558691),f=v(f,u,c,d,r[p+10],9,38016083),d=v(d,f,u,c,r[p+15],14,-660478335),c=v(c,d,f,u,r[p+4],20,-405537848),u=v(u,c,d,f,r[p+9],5,568446438),f=v(f,u,c,d,r[p+14],9,-1019803690),d=v(d,f,u,c,r[p+3],14,-187363961),c=v(c,d,f,u,r[p+8],20,1163531501),u=v(u,c,d,f,r[p+13],5,-1444681467),f=v(f,u,c,d,r[p+2],9,-51403784),d=v(d,f,u,c,r[p+7],14,1735328473),u=h(u,c=v(c,d,f,u,r[p+12],20,-1926607734),d,f,r[p+5],4,-378558),f=h(f,u,c,d,r[p+8],11,-2022574463),d=h(d,f,u,c,r[p+11],16,1839030562),c=h(c,d,f,u,r[p+14],23,-35309556),u=h(u,c,d,f,r[p+1],4,-1530992060),f=h(f,u,c,d,r[p+4],11,1272893353),d=h(d,f,u,c,r[p+7],16,-155497632),c=h(c,d,f,u,r[p+10],23,-1094730640),u=h(u,c,d,f,r[p+13],4,681279174),f=h(f,u,c,d,r[p+0],11,-358537222),d=h(d,f,u,c,r[p+3],16,-722521979),c=h(c,d,f,u,r[p+6],23,76029189),u=h(u,c,d,f,r[p+9],4,-640364487),f=h(f,u,c,d,r[p+12],11,-421815835),d=h(d,f,u,c,r[p+15],16,530742520),u=m(u,c=h(c,d,f,u,r[p+2],23,-995338651),d,f,r[p+0],6,-198630844),f=m(f,u,c,d,r[p+7],10,1126891415),d=m(d,f,u,c,r[p+14],15,-1416354905),c=m(c,d,f,u,r[p+5],21,-57434055),u=m(u,c,d,f,r[p+12],6,1700485571),f=m(f,u,c,d,r[p+3],10,-1894986606),d=m(d,f,u,c,r[p+10],15,-1051523),c=m(c,d,f,u,r[p+1],21,-2054922799),u=m(u,c,d,f,r[p+8],6,1873313359),f=m(f,u,c,d,r[p+15],10,-30611744),d=m(d,f,u,c,r[p+6],15,-1560198380),c=m(c,d,f,u,r[p+13],21,1309151649),u=m(u,c,d,f,r[p+4],6,-145523070),f=m(f,u,c,d,r[p+11],10,-1120210379),d=m(d,f,u,c,r[p+2],15,718787259),c=m(c,d,f,u,r[p+9],21,-343485551),u=u+y>>>0,c=c+E>>>0,d=d+_>>>0,f=f+b>>>0}return n.endian([u,c,d,f])})._ff=function(e,t,r,n,i,o,a){var s=e+(t&r|~t&n)+(i>>>0)+a;return(s<<o|s>>>32-o)+t},s._gg=function(e,t,r,n,i,o,a){var s=e+(t&n|r&~n)+(i>>>0)+a;return(s<<o|s>>>32-o)+t},s._hh=function(e,t,r,n,i,o,a){var s=e+(t^r^n)+(i>>>0)+a;return(s<<o|s>>>32-o)+t},s._ii=function(e,t,r,n,i,o,a){var s=e+(r^(t|~n))+(i>>>0)+a;return(s<<o|s>>>32-o)+t},s._blocksize=16,s._digestsize=16,e.exports=function(e,t){if(null==e)throw new Error("Illegal argument "+e);var r=n.wordsToBytes(s(e,t));return t&&t.asBytes?r:t&&t.asString?a.bytesToString(r):n.bytesToHex(r)}},,function(e,t){var r,n;r="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=[],r=0,n=0;r<e.length;r++,n+=8)t[n>>>5]|=e[r]<<24-n%32;return t},wordsToBytes:function(e){for(var t=[],r=0;r<32*e.length;r+=8)t.push(e[r>>>5]>>>24-r%32&255);return t},bytesToHex:function(e){for(var t=[],r=0;r<e.length;r++)t.push((e[r]>>>4).toString(16)),t.push((15&e[r]).toString(16));return t.join("")},hexToBytes:function(e){for(var t=[],r=0;r<e.length;r+=2)t.push(parseInt(e.substr(r,2),16));return t},bytesToBase64:function(e){for(var t=[],n=0;n<e.length;n+=3)for(var i=e[n]<<16|e[n+1]<<8|e[n+2],o=0;o<4;o++)8*n+6*o<=8*e.length?t.push(r.charAt(i>>>6*(3-o)&63)):t.push("=");return t.join("")},base64ToBytes:function(e){e=e.replace(/[^A-Z0-9+\/]/gi,"");for(var t=[],n=0,i=0;n<e.length;i=++n%4)0!=i&&t.push((r.indexOf(e.charAt(n-1))&Math.pow(2,-2*i+8)-1)<<2*i|r.indexOf(e.charAt(n))>>>6-2*i);return t}},e.exports=n},function(e,t){function r(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}
/*!
 * Determine if an object is a Buffer
 *
 * @author   Feross Aboukhadijeh <https://feross.org>
 * @license  MIT
 */
e.exports=function(e){return null!=e&&(r(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&r(e.slice(0,0))}(e)||!!e._isBuffer)}},function(e,t,r){var n;void 0===(n=function(){return function(){var e=r;e.Integer={type:"integer"};var t={String:String,Boolean:Boolean,Number:Number,Object:Object,Array:Array,Date:Date};function r(e,t){return r(e,t,{changing:!1})}e.validate=r,e.checkPropertyChange=function(e,t,n){return r(e,t,{changing:n||"property"})};var r=e._validate=function(e,r,n){n||(n={});var i=n.changing;function o(e){return e.type||t[e.name]==e&&e.name.toLowerCase()}var a=[];function s(e,t,r,l){var u;function c(e){a.push({property:r,message:e})}if(r+=r?"number"==typeof l?"["+l+"]":void 0===l?"":"."+l:l,("object"!=typeof t||t instanceof Array)&&(r||"function"!=typeof t)&&(!t||!o(t)))return"function"==typeof t?e instanceof t||c("is not an instance of the class/constructor "+t.name):t&&c("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:r,message:t+" - "+typeof t+" value found, but a "+e+" is required"}];if(e instanceof Array){for(var n=[],i=0;i<e.length&&(n=d(e[i],t)).length;i++);if(n.length)return n}else if("object"==typeof e){var o=a;a=[],s(t,e,r);var l=a;return a=o,l}}return[]}if(i&&t.readonly&&c("is a readonly field, it can not be changed"),t.extends&&s(e,t.extends,r,l),void 0===e)t.required&&c("is missing and it is required");else if(a=a.concat(d(o(t),e)),t.disallow&&!d(t.disallow,e).length&&c(" disallowed value was matched"),null!==e){if(e instanceof Array){if(t.items){var f=t.items instanceof Array,p=t.items;for(l=0,u=e.length;l<u;l+=1)f&&(p=t.items[l]),n.coerce&&(e[l]=n.coerce(e[l],p)),a.concat(s(e[l],p,r,l))}t.minItems&&e.length<t.minItems&&c("There must be a minimum of "+t.minItems+" in the array"),t.maxItems&&e.length>t.maxItems&&c("There must be a maximum of "+t.maxItems+" in the array")}else(t.properties||t.additionalProperties)&&a.concat(function(e,t,r,o){if("object"==typeof t)for(var l in("object"!=typeof e||e instanceof Array)&&a.push({property:r,message:"an object is required"}),t)if(t.hasOwnProperty(l)&&"__proto__"!=l&&"constructor"!=l){var u=e.hasOwnProperty(l)?e[l]:void 0;if(void 0===u&&n.existingOnly)continue;var c=t[l];void 0===u&&c.default&&(u=e[l]=c.default),n.coerce&&l in e&&(u=e[l]=n.coerce(u,c)),s(u,c,r,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}a.push({property:r,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||a.push({property:r,message:"the presence of the property "+l+" requires that "+d+" also be present"}),u=e[l],!o||t&&"object"==typeof t&&l in t||(n.coerce&&(u=e[l]=n.coerce(u,o)),s(u,o,r,l)),!i&&u&&u.$schema&&(a=a.concat(s(u,u.$schema,r,l)))}return a}(e,t.properties,r,t.additionalProperties));if(t.pattern&&"string"==typeof e&&!e.match(t.pattern)&&c("does not match the regex pattern "+t.pattern),t.maxLength&&"string"==typeof e&&e.length>t.maxLength&&c("may only be "+t.maxLength+" characters long"),t.minLength&&"string"==typeof e&&e.length<t.minLength&&c("must be at least "+t.minLength+" characters long"),void 0!==t.minimum&&typeof e==typeof t.minimum&&t.minimum>e&&c("must have a minimum value of "+t.minimum),void 0!==t.maximum&&typeof e==typeof t.maximum&&t.maximum<e&&c("must have a maximum value of "+t.maximum),t.enum){var g,v=t.enum;u=v.length;for(var h=0;h<u;h++)if(v[h]===e){g=1;break}g||c("does not have a value in the enumeration "+v.join(", "))}"number"==typeof t.maxDecimal&&e.toString().match(new RegExp("\\.[0-9]{"+(t.maxDecimal+1)+",}"))&&c("may only have "+t.maxDecimal+" digits of decimal places")}return null}return r&&s(e,r,"",i||""),!i&&e&&e.$schema&&s(e,e.$schema,"",""),{valid:!a.length,errors:a}};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,r){!function(){const t=e=>(new TextEncoder).encode(e);function r(e,r){let n,i,o,a,s,l,u,c;for("string"==typeof e&&(e=t(e)),n=3&e.length,i=e.length-n,o=r,s=3432918353,l=461845907,c=0;c<i;)u=255&e[c]|(255&e[++c])<<8|(255&e[++c])<<16|(255&e[++c])<<24,++c,u=(65535&u)*s+(((u>>>16)*s&65535)<<16)&4294967295,u=u<<15|u>>>17,u=(65535&u)*l+(((u>>>16)*l&65535)<<16)&4294967295,o^=u,o=o<<13|o>>>19,a=5*(65535&o)+((5*(o>>>16)&65535)<<16)&4294967295,o=27492+(65535&a)+((58964+(a>>>16)&65535)<<16);switch(u=0,n){case 3:u^=(255&e[c+2])<<16;case 2:u^=(255&e[c+1])<<8;case 1:u^=255&e[c],u=(65535&u)*s+(((u>>>16)*s&65535)<<16)&4294967295,u=u<<15|u>>>17,u=(65535&u)*l+(((u>>>16)*l&65535)<<16)&4294967295,o^=u}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=r;n.v2=function(e,r){"string"==typeof e&&(e=t(e));let n,i=e.length,o=r^i,a=0;for(;i>=4;)n=255&e[a]|(255&e[++a])<<8|(255&e[++a])<<16|(255&e[++a])<<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,i-=4,++a;switch(i){case 3:o^=(255&e[a+2])<<16;case 2:o^=(255&e[a+1])<<8;case 1:o^=255&e[a],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=r,e.exports=n}()},function(e,t,r){var n;!function(i,o){"use strict";var a="model",s="name",l="type",u="vendor",c="version",d="mobile",f="tablet",p="smarttv",g=function(e){for(var t={},r=0;r<e.length;r++)t[e[r].toUpperCase()]=e[r];return t},v=function(e,t){return"string"==typeof e&&-1!==h(t).indexOf(h(e))},h=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)},y=function(e,t){for(var r,n,i,o,a,s,l=0;l<t.length&&!a;){var u=t[l],c=t[l+1];for(r=n=0;r<u.length&&!a&&u[r];)if(a=u[r++].exec(e))for(i=0;i<c.length;i++)s=a[++n],"object"==typeof(o=c[i])&&o.length>0?2===o.length?"function"==typeof o[1]?this[o[0]]=o[1].call(this,s):this[o[0]]=o[1]:3===o.length?"function"!=typeof o[1]||o[1].exec&&o[1].test?this[o[0]]=s?s.replace(o[1],o[2]):void 0:this[o[0]]=s?o[1].call(this,s,o[2]):void 0:4===o.length&&(this[o[0]]=s?o[3].call(this,s.replace(o[1],o[2])):void 0):this[o]=s||void 0;l+=2}},E=function(e,t){for(var r in t)if("object"==typeof t[r]&&t[r].length>0){for(var n=0;n<t[r].length;n++)if(v(t[r][n],e))return"?"===r?void 0:r}else if(v(t[r],e))return"?"===r?void 0:r;return e},_={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"},b={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[c,[s,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[c,[s,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[s,c],[/opios[\/ ]+([\w\.]+)/i],[c,[s,"Opera Mini"]],[/\bopr\/([\w\.]+)/i],[c,[s,"Opera"]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[c,[s,"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],[s,c],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[c,[s,"UCBrowser"]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[c,[s,"WeChat"]],[/konqueror\/([\w\.]+)/i],[c,[s,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[c,[s,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[c,[s,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[c,[s,"Smart Lenovo Browser"]],[/(avast|avg)\/([\w\.]+)/i],[[s,/(.+)/,"$1 Secure Browser"],c],[/\bfocus\/([\w\.]+)/i],[c,[s,"Firefox Focus"]],[/\bopt\/([\w\.]+)/i],[c,[s,"Opera Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[c,[s,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[c,[s,"Dolphin"]],[/coast\/([\w\.]+)/i],[c,[s,"Opera Coast"]],[/miuibrowser\/([\w\.]+)/i],[c,[s,"MIUI Browser"]],[/fxios\/([-\w\.]+)/i],[c,[s,"Firefox"]],[/\bqihu|(qi?ho?o?|360)browser/i],[[s,"360 Browser"]],[/(oculus|sailfish|huawei|vivo)browser\/([\w\.]+)/i],[[s,/(.+)/,"$1 Browser"],c],[/samsungbrowser\/([\w\.]+)/i],[c,[s,"Samsung Internet"]],[/(comodo_dragon)\/([\w\.]+)/i],[[s,/_/g," "],c],[/metasr[\/ ]?([\d\.]+)/i],[c,[s,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[s,"Sogou Mobile"],c],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345Explorer)[\/ ]?([\w\.]+)/i],[s,c],[/(lbbrowser)/i,/\[(linkedin)app\]/i],[s],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[s,"Facebook"],c],[/(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],[s,c],[/\bgsa\/([\w\.]+) .*safari\//i],[c,[s,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[c,[s,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[c,[s,"Chrome Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[s,"Chrome WebView"],c],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[c,[s,"Android Browser"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[s,c],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[c,[s,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[c,s],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[s,[c,E,{"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],[s,c],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[s,"Netscape"],c],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[c,[s,"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],[s,c],[/(cobalt)\/([\w\.]+)/i],[s,[c,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[["architecture","amd64"]],[/(ia32(?=;))/i],[["architecture",h]],[/((?: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/,"",h]],[/(sun4\w)[;\)]/i],[["architecture","sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[["architecture",h]]],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],[a,[u,"Samsung"],[l,f]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[a,[u,"Samsung"],[l,d]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[a,[u,"Apple"],[l,d]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[a,[u,"Apple"],[l,f]],[/(macintosh);/i],[a,[u,"Apple"]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[a,[u,"Sharp"],[l,d]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[a,[u,"Huawei"],[l,f]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[a,[u,"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],[[a,/_/g," "],[u,"Xiaomi"],[l,d]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[a,/_/g," "],[u,"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],[a,[u,"OPPO"],[l,d]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[a,[u,"Vivo"],[l,d]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[a,[u,"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],[a,[u,"Motorola"],[l,d]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[a,[u,"Motorola"],[l,f]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[a,[u,"LG"],[l,f]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[a,[u,"LG"],[l,d]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[a,[u,"Lenovo"],[l,f]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[a,/_/g," "],[u,"Nokia"],[l,d]],[/(pixel c)\b/i],[a,[u,"Google"],[l,f]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[a,[u,"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],[a,[u,"Sony"],[l,d]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[a,"Xperia Tablet"],[u,"Sony"],[l,f]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[a,[u,"OnePlus"],[l,d]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[a,[u,"Amazon"],[l,f]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[a,/(.+)/g,"Fire Phone $1"],[u,"Amazon"],[l,d]],[/(playbook);[-\w\),; ]+(rim)/i],[a,u,[l,f]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[a,[u,"BlackBerry"],[l,d]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[a,[u,"ASUS"],[l,f]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[a,[u,"ASUS"],[l,d]],[/(nexus 9)/i],[a,[u,"HTC"],[l,f]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[u,[a,/_/g," "],[l,d]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[a,[u,"Acer"],[l,f]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[a,[u,"Meizu"],[l,d]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[a,[u,"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],[u,a,[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],[u,a,[l,f]],[/(surface duo)/i],[a,[u,"Microsoft"],[l,f]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[a,[u,"Fairphone"],[l,d]],[/(u304aa)/i],[a,[u,"AT&T"],[l,d]],[/\bsie-(\w*)/i],[a,[u,"Siemens"],[l,d]],[/\b(rct\w+) b/i],[a,[u,"RCA"],[l,f]],[/\b(venue[\d ]{2,7}) b/i],[a,[u,"Dell"],[l,f]],[/\b(q(?:mv|ta)\w+) b/i],[a,[u,"Verizon"],[l,f]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[a,[u,"Barnes & Noble"],[l,f]],[/\b(tm\d{3}\w+) b/i],[a,[u,"NuVision"],[l,f]],[/\b(k88) b/i],[a,[u,"ZTE"],[l,f]],[/\b(nx\d{3}j) b/i],[a,[u,"ZTE"],[l,d]],[/\b(gen\d{3}) b.+49h/i],[a,[u,"Swiss"],[l,d]],[/\b(zur\d{3}) b/i],[a,[u,"Swiss"],[l,f]],[/\b((zeki)?tb.*\b) b/i],[a,[u,"Zeki"],[l,f]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[u,"Dragon Touch"],a,[l,f]],[/\b(ns-?\w{0,9}) b/i],[a,[u,"Insignia"],[l,f]],[/\b((nxa|next)-?\w{0,9}) b/i],[a,[u,"NextBook"],[l,f]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[u,"Voice"],a,[l,d]],[/\b(lvtel\-)?(v1[12]) b/i],[[u,"LvTel"],a,[l,d]],[/\b(ph-1) /i],[a,[u,"Essential"],[l,d]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[a,[u,"Envizen"],[l,f]],[/\b(trio[-\w\. ]+) b/i],[a,[u,"MachSpeed"],[l,f]],[/\btu_(1491) b/i],[a,[u,"Rotor"],[l,f]],[/(shield[\w ]+) b/i],[a,[u,"Nvidia"],[l,f]],[/(sprint) (\w+)/i],[u,a,[l,d]],[/(kin\.[onetw]{3})/i],[[a,/\./g," "],[u,"Microsoft"],[l,d]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[a,[u,"Zebra"],[l,f]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[a,[u,"Zebra"],[l,d]],[/smart-tv.+(samsung)/i],[u,[l,p]],[/hbbtv.+maple;(\d+)/i],[[a,/^/,"SmartTV"],[u,"Samsung"],[l,p]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[u,"LG"],[l,p]],[/(apple) ?tv/i],[u,[a,"Apple TV"],[l,p]],[/crkey/i],[[a,"Chromecast"],[u,"Google"],[l,p]],[/droid.+aft(\w+)( bui|\))/i],[a,[u,"Amazon"],[l,p]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[a,[u,"Sharp"],[l,p]],[/(bravia[\w ]+)( bui|\))/i],[a,[u,"Sony"],[l,p]],[/(mitv-\w{5}) bui/i],[a,[u,"Xiaomi"],[l,p]],[/Hbbtv.*(technisat) (.*);/i],[u,a,[l,p]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[u,m],[a,m],[l,p]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[l,p]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[u,a,[l,"console"]],[/droid.+; (shield) bui/i],[a,[u,"Nvidia"],[l,"console"]],[/(playstation [345portablevi]+)/i],[a,[u,"Sony"],[l,"console"]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[a,[u,"Microsoft"],[l,"console"]],[/((pebble))app/i],[u,a,[l,"wearable"]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[a,[u,"Apple"],[l,"wearable"]],[/droid.+; (glass) \d/i],[a,[u,"Google"],[l,"wearable"]],[/droid.+; (wt63?0{2,3})\)/i],[a,[u,"Zebra"],[l,"wearable"]],[/(quest( 2| pro)?)/i],[a,[u,"Facebook"],[l,"wearable"]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[u,[l,"embedded"]],[/(aeobc)\b/i],[a,[u,"Amazon"],[l,"embedded"]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[a,[l,d]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[a,[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],[a,[u,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[c,[s,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[c,[s,"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],[s,c],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[c,s]],os:[[/microsoft (windows) (vista|xp)/i],[s,c],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[s,[c,E,_]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[c,E,_],[s,"Windows"]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[c,/_/g,"."],[s,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[s,"Mac OS"],[c,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[c,s],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[s,c],[/\(bb(10);/i],[c,[s,"BlackBerry"]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[c,[s,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[c,[s,"Firefox OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[c,[s,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[c,[s,"watchOS"]],[/crkey\/([\d\.]+)/i],[c,[s,"Chromecast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[s,"Chromium OS"],c],[/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],[s,c],[/(sunos) ?([\w\.\d]*)/i],[[s,"Solaris"],c],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[s,c]]},I=function(e,t){if("object"==typeof e&&(t=e,e=void 0),!(this instanceof I))return new I(e,t).getResult();var r=void 0!==i&&i.navigator?i.navigator:void 0,n=e||(r&&r.userAgent?r.userAgent:""),o=r&&r.userAgentData?r.userAgentData:void 0,a=t?function(e,t){var r={};for(var n in e)t[n]&&t[n].length%2==0?r[n]=t[n].concat(e[n]):r[n]=e[n];return r}(b,t):b,s=r&&r.userAgent==n;return this.getBrowser=function(){var e,t={};return t.name=void 0,t.version=void 0,y.call(t,n,a.browser),t.major="string"==typeof(e=t.version)?e.replace(/[^\d\.]/g,"").split(".")[0]:void 0,s&&r&&r.brave&&"function"==typeof r.brave.isBrave&&(t.name="Brave"),t},this.getCPU=function(){var e={architecture:void 0};return y.call(e,n,a.cpu),e},this.getDevice=function(){var e={vendor:void 0,model:void 0,type:void 0};return y.call(e,n,a.device),s&&!e.type&&o&&o.mobile&&(e.type=d),s&&"Macintosh"==e.model&&r&&void 0!==r.standalone&&r.maxTouchPoints&&r.maxTouchPoints>2&&(e.model="iPad",e.type=f),e},this.getEngine=function(){var e={name:void 0,version:void 0};return y.call(e,n,a.engine),e},this.getOS=function(){var e={name:void 0,version:void 0};return y.call(e,n,a.os),s&&!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};I.VERSION="1.0.37",I.BROWSER=g([s,c,"major"]),I.CPU=g(["architecture"]),I.DEVICE=g([a,u,l,"console",d,p,f,"wearable","embedded"]),I.ENGINE=I.OS=g([s,c]),void 0!==t?(void 0!==e&&e.exports&&(t=e.exports=I),t.UAParser=I):r(30)?void 0===(n=function(){return I}.call(t,r,t,e))||(e.exports=n):void 0!==i&&(i.UAParser=I);var O=void 0!==i&&(i.jQuery||i.Zepto);if(O&&!O.ua){var A=new I;O.ua=A.getResult(),O.ua.get=function(){return A.getUA()},O.ua.set=function(e){A.setUA(e);var t=A.getResult();for(var r in t)O.ua[r]=t[r]}}}("object"==typeof window?window:this)},function(e,t){(function(t){e.exports=t}).call(this,{})},,function(e,t,r){"use strict";let n;r.r(t);const i=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(i)}var a=/^(?:[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 s=function(e){return"string"==typeof e&&a.test(e)};const l=[];for(let e=0;e<256;++e)l.push((e+256).toString(16).slice(1));function u(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 c=function(e,t=0){const r=u(e,t);if(!s(r))throw TypeError("Stringified UUID is invalid");return r};let d,f,p=0,g=0;var v=function(e,t,r){let n=t&&r||0;const i=t||new Array(16);let a=(e=e||{}).node||d,s=void 0!==e.clockseq?e.clockseq:f;if(null==a||null==s){const t=e.random||(e.rng||o)();null==a&&(a=d=[1|t[0],t[1],t[2],t[3],t[4],t[5]]),null==s&&(s=f=16383&(t[6]<<8|t[7]))}let l=void 0!==e.msecs?e.msecs:Date.now(),c=void 0!==e.nsecs?e.nsecs:g+1;const v=l-p+(c-g)/1e4;if(v<0&&void 0===e.clockseq&&(s=s+1&16383),(v<0||l>p)&&void 0===e.nsecs&&(c=0),c>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");p=l,g=c,f=s,l+=122192928e5;const h=(1e4*(268435455&l)+c)%4294967296;i[n++]=h>>>24&255,i[n++]=h>>>16&255,i[n++]=h>>>8&255,i[n++]=255&h;const m=l/4294967296*1e4&268435455;i[n++]=m>>>8&255,i[n++]=255&m,i[n++]=m>>>24&15|16,i[n++]=m>>>16&255,i[n++]=s>>>8|128,i[n++]=255&s;for(let e=0;e<6;++e)i[n+e]=a[e];return t||u(i)};var h=function(e){if(!s(e))throw TypeError("Invalid UUID");let t;const r=new Uint8Array(16);return r[0]=(t=parseInt(e.slice(0,8),16))>>>24,r[1]=t>>>16&255,r[2]=t>>>8&255,r[3]=255&t,r[4]=(t=parseInt(e.slice(9,13),16))>>>8,r[5]=255&t,r[6]=(t=parseInt(e.slice(14,18),16))>>>8,r[7]=255&t,r[8]=(t=parseInt(e.slice(19,23),16))>>>8,r[9]=255&t,r[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,r[11]=t/4294967296&255,r[12]=t>>>24&255,r[13]=t>>>16&255,r[14]=t>>>8&255,r[15]=255&t,r};function m(e,t,r){function n(e,n,i,o){var a;if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));const t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}(e)),"string"==typeof n&&(n=h(n)),16!==(null===(a=n)||void 0===a?void 0:a.length))throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let s=new Uint8Array(16+e.length);if(s.set(n),s.set(e,n.length),s=r(s),s[6]=15&s[6]|t,s[8]=63&s[8]|128,i){o=o||0;for(let e=0;e<16;++e)i[o+e]=s[e];return i}return u(s)}try{n.name=e}catch(e){}return n.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",n.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",n}function y(e){return 14+(e+64>>>9<<4)+1}function E(e,t){const r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}function _(e,t,r,n,i,o){return E((a=E(E(t,e),E(n,o)))<<(s=i)|a>>>32-s,r);var a,s}function b(e,t,r,n,i,o,a){return _(t&r|~t&n,e,t,i,o,a)}function I(e,t,r,n,i,o,a){return _(t&n|r&~n,e,t,i,o,a)}function O(e,t,r,n,i,o,a){return _(t^r^n,e,t,i,o,a)}function A(e,t,r,n,i,o,a){return _(r^(t|~n),e,t,i,o,a)}var w=m("v3",48,(function(e){if("string"==typeof e){const t=unescape(encodeURIComponent(e));e=new Uint8Array(t.length);for(let r=0;r<t.length;++r)e[r]=t.charCodeAt(r)}return function(e){const t=[],r=32*e.length;for(let n=0;n<r;n+=8){const r=e[n>>5]>>>n%32&255,i=parseInt("0123456789abcdef".charAt(r>>>4&15)+"0123456789abcdef".charAt(15&r),16);t.push(i)}return t}(function(e,t){e[t>>5]|=128<<t%32,e[y(t)-1]=t;let r=1732584193,n=-271733879,i=-1732584194,o=271733878;for(let t=0;t<e.length;t+=16){const a=r,s=n,l=i,u=o;r=b(r,n,i,o,e[t],7,-680876936),o=b(o,r,n,i,e[t+1],12,-389564586),i=b(i,o,r,n,e[t+2],17,606105819),n=b(n,i,o,r,e[t+3],22,-1044525330),r=b(r,n,i,o,e[t+4],7,-176418897),o=b(o,r,n,i,e[t+5],12,1200080426),i=b(i,o,r,n,e[t+6],17,-1473231341),n=b(n,i,o,r,e[t+7],22,-45705983),r=b(r,n,i,o,e[t+8],7,1770035416),o=b(o,r,n,i,e[t+9],12,-1958414417),i=b(i,o,r,n,e[t+10],17,-42063),n=b(n,i,o,r,e[t+11],22,-1990404162),r=b(r,n,i,o,e[t+12],7,1804603682),o=b(o,r,n,i,e[t+13],12,-40341101),i=b(i,o,r,n,e[t+14],17,-1502002290),n=b(n,i,o,r,e[t+15],22,1236535329),r=I(r,n,i,o,e[t+1],5,-165796510),o=I(o,r,n,i,e[t+6],9,-1069501632),i=I(i,o,r,n,e[t+11],14,643717713),n=I(n,i,o,r,e[t],20,-373897302),r=I(r,n,i,o,e[t+5],5,-701558691),o=I(o,r,n,i,e[t+10],9,38016083),i=I(i,o,r,n,e[t+15],14,-660478335),n=I(n,i,o,r,e[t+4],20,-405537848),r=I(r,n,i,o,e[t+9],5,568446438),o=I(o,r,n,i,e[t+14],9,-1019803690),i=I(i,o,r,n,e[t+3],14,-187363961),n=I(n,i,o,r,e[t+8],20,1163531501),r=I(r,n,i,o,e[t+13],5,-1444681467),o=I(o,r,n,i,e[t+2],9,-51403784),i=I(i,o,r,n,e[t+7],14,1735328473),n=I(n,i,o,r,e[t+12],20,-1926607734),r=O(r,n,i,o,e[t+5],4,-378558),o=O(o,r,n,i,e[t+8],11,-2022574463),i=O(i,o,r,n,e[t+11],16,1839030562),n=O(n,i,o,r,e[t+14],23,-35309556),r=O(r,n,i,o,e[t+1],4,-1530992060),o=O(o,r,n,i,e[t+4],11,1272893353),i=O(i,o,r,n,e[t+7],16,-155497632),n=O(n,i,o,r,e[t+10],23,-1094730640),r=O(r,n,i,o,e[t+13],4,681279174),o=O(o,r,n,i,e[t],11,-358537222),i=O(i,o,r,n,e[t+3],16,-722521979),n=O(n,i,o,r,e[t+6],23,76029189),r=O(r,n,i,o,e[t+9],4,-640364487),o=O(o,r,n,i,e[t+12],11,-421815835),i=O(i,o,r,n,e[t+15],16,530742520),n=O(n,i,o,r,e[t+2],23,-995338651),r=A(r,n,i,o,e[t],6,-198630844),o=A(o,r,n,i,e[t+7],10,1126891415),i=A(i,o,r,n,e[t+14],15,-1416354905),n=A(n,i,o,r,e[t+5],21,-57434055),r=A(r,n,i,o,e[t+12],6,1700485571),o=A(o,r,n,i,e[t+3],10,-1894986606),i=A(i,o,r,n,e[t+10],15,-1051523),n=A(n,i,o,r,e[t+1],21,-2054922799),r=A(r,n,i,o,e[t+8],6,1873313359),o=A(o,r,n,i,e[t+15],10,-30611744),i=A(i,o,r,n,e[t+6],15,-1560198380),n=A(n,i,o,r,e[t+13],21,1309151649),r=A(r,n,i,o,e[t+4],6,-145523070),o=A(o,r,n,i,e[t+11],10,-1120210379),i=A(i,o,r,n,e[t+2],15,718787259),n=A(n,i,o,r,e[t+9],21,-343485551),r=E(r,a),n=E(n,s),i=E(i,l),o=E(o,u)}return[r,n,i,o]}(function(e){if(0===e.length)return[];const t=8*e.length,r=new Uint32Array(y(t));for(let n=0;n<t;n+=8)r[n>>5]|=(255&e[n/8])<<n%32;return r}(e),8*e.length))}));var T={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};var S=function(e,t,r){if(T.randomUUID&&!t&&!e)return T.randomUUID();const n=(e=e||{}).random||(e.rng||o)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(let e=0;e<16;++e)t[r+e]=n[e];return t}return u(n)};function R(e,t,r,n){switch(e){case 0:return t&r^~t&n;case 1:return t^r^n;case 2:return t&r^t&n^r&n;case 3:return t^r^n}}function N(e,t){return e<<t|e>>>32-t}var D=m("v5",80,(function(e){const t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof e){const t=unescape(encodeURIComponent(e));e=[];for(let r=0;r<t.length;++r)e.push(t.charCodeAt(r))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);const n=e.length/4+2,i=Math.ceil(n/16),o=new Array(i);for(let t=0;t<i;++t){const r=new Uint32Array(16);for(let n=0;n<16;++n)r[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]=r}o[i-1][14]=8*(e.length-1)/Math.pow(2,32),o[i-1][14]=Math.floor(o[i-1][14]),o[i-1][15]=8*(e.length-1)&4294967295;for(let e=0;e<i;++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]=N(n[e-3]^n[e-8]^n[e-14]^n[e-16],1);let i=r[0],a=r[1],s=r[2],l=r[3],u=r[4];for(let e=0;e<80;++e){const r=Math.floor(e/20),o=N(i,5)+R(r,a,s,l)+u+t[r]+n[e]>>>0;u=l,l=s,s=N(a,30)>>>0,a=i,i=o}r[0]=r[0]+i>>>0,r[1]=r[1]+a>>>0,r[2]=r[2]+s>>>0,r[3]=r[3]+l>>>0,r[4]=r[4]+u>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,255&r[0],r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,255&r[1],r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,255&r[2],r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,255&r[3],r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,255&r[4]]}));var C=function(e){if(!s(e))throw TypeError("Invalid UUID");return parseInt(e.slice(14,15),16)};r.d(t,"v1",(function(){return v})),r.d(t,"v3",(function(){return w})),r.d(t,"v4",(function(){return S})),r.d(t,"v5",(function(){return D})),r.d(t,"NIL",(function(){return"00000000-0000-0000-0000-000000000000"})),r.d(t,"version",(function(){return C})),r.d(t,"validate",(function(){return s})),r.d(t,"stringify",(function(){return c})),r.d(t,"parse",(function(){return h}))}]]);