(function() { function bxBootstrap() { var re = /bot|crawl|slurp|spider|mediapartners|headlesschrome|snap-prefetch|remotasks|woorank|uptime\.com|facebookexternalhit|facebookcatalog/i; if (re.test(navigator.userAgent) || navigator.userAgent == '') { return; } if (!(window.bouncex&&bouncex.website)) { var pushedData = []; if(window.bouncex && bouncex.push && bouncex.length){ pushedData = bouncex; } window.bouncex = {}; bouncex.pushedData = pushedData; bouncex.website = {"id":5368,"name":"Budget CA","cookie_name":"bounceClientVisit5368","domain":"budget.ca","ct":"fp_local_storage","ally":0,"ei":0,"tcjs":"","cjs":"/** https://www.wrike.com/open.htm?id=941872568 **/\nif (bouncex.cookie.vpv === 1) {\n if (bouncex.vars.reserved_this_visit) {\n bouncex.setVar('reserved_last_visit', true);\n bouncex.setVarAndReload('reserved_this_visit', false);\n }\n}\n\njQuery(document).on('click.bx', '#res-vehicle-select.btn.btn-default-avis', function(){\n bouncex.setv('pay_later_selected', true);\n setBounceCookie();\n});\n\njQuery(document).on('click.bx', '#res-vehicles-pay-later.btn.btn-default-avis', function(){\n bouncex.setv('pay_later_selected', true);\n setBounceCookie();\n});\n\n// Single-page app fix: detects page changes\n(function () {\n if (window.angular) {\n var ele = angular.element(document.querySelector('body'));\n var rootScope = ele.injector() ? ele.injector().get('$rootScope') : false;\n var initBx;\n\n if (rootScope) {\n rootScope.$on('$locationChangeSuccess', function(event, next, current) {\n clearTimeout(initBx);\n initBx = setTimeout(function() {\n init_vars();\n bouncex.cookie.vpv++;\n bouncex.pa = 0;\n setBounceCookie();\n\n for (var ca_id in bouncex.campaigns) {\n if (bouncex.campaigns.hasOwnProperty(ca_id)) {\n bouncex.destroy_ad(ca_id);\n }\n }\n\n bouncex.body = jQuery('body').eq(0);\n bouncex.calling_url = encodeURIComponent(window.location.href);\n bouncex.reload_campaigns();\n bouncex.et.init();\n }, 600);\n });\n rootScope.$on('Profile.refreshCustomerInfo', function(event, next, current) {\n bouncex.et.init();\n });\n }\n }\n})();\n\n// clicktale integration 6/8/2018, old integrations have this in pre-activation and will overwrite this\nbouncex.clicktaleReport = function(label) {\n // check old format (new format has \"BounceX: Impression [label]\")\n var oldFormat = label.indexOf('BounceX: ') !== 0;\n if (oldFormat) {\n label = 'BounceX: ' + label;\n label = label.replace('BounceX: Impression', 'BounceX: Impression ');\n label = label.replace('BounceX: Click', 'BounceX: Click ');\n label = label.replace('BounceX: Submit', 'BounceX: Submit ');\n label = label.replace(' ', ' '); // inconsistent spaces in campaigns;\n }\n\n if (window.ClicktaleIntegrationExperienceHandler) {\n ClicktaleIntegrationExperienceHandler(label);\n }\n};\n\n/* wrike: 659162879 custom reporting */\nif (window.ga && typeof window.ga === \"function\") {\n window.ga('create', bouncex.website.gai, { name: \"wknd\" });\n \n bouncex.report_ga = function(action, label, bypass) {\n if (typeof action !== 'string' || typeof label !== 'string') return;\n \n var formattedAction = action;\n var bypassCasing = typeof bypass !== 'undefined' && !!bypass;\n \n if (!bypassCasing) {\n formattedAction = 'Wunderkind ' + action.charAt(0).toUpperCase() + action.slice(1).toLowerCase();\n }\n \n var interaction = /Impression$/.test(formattedAction);\n window.ga('wknd.send', 'event', 'Wunderkind', action, label, { 'nonInteraction': interaction });\n };\n}\n\n// auto-apply coupon\nvar $step1ModalLink = jQuery('.res-discFld.form-controlD'),\n $step2ModalLink = jQuery('.discount-dropdown.s-dropdown'),\n $step3ModalLink = jQuery('.edit-icon[data-target=\".discountCodeModal\"]'),\n step1ModalHidden = jQuery('.res-discount:visible').length === 0,\n step2ModalHidden = jQuery('.res-discount.container-fluid:visible').length === 0,\n summaryContainerExpanded = jQuery('.summary-container').hasClass('expand-mode'),\n isMobileSite = jQuery('html').hasClass('mobile'),\n couponValue = bouncex.utils.url.getParam('text_coupon_code');\n\nfunction autoApplyCoupon($input, $submit) {\n $input.val(couponValue);\n $input.trigger('input');\n $input.trigger('change');\n if ($submit) {\n $submit.trigger('click');\n }\n}\n\nfunction showMobileModal() {\n if ($step1ModalLink.length > 0) {\n if (step1ModalHidden) {\n jQuery('#triggerRes').trigger('click');\n if (!jQuery('.filterCon:visible').length) {\n jQuery('.fullSection .sortFilter.col-sm-12').trigger('click');\n }\n }\n autoApplyCoupon(jQuery('#awd'), null);\n }\n else if ($step2ModalLink.length > 0) {\n if (step2ModalHidden) {\n jQuery('#res-mobile-vehicles-sort').trigger('click');\n }\n autoApplyCoupon(jQuery('input[name=\"DiscAWDMob\"]'), jQuery('.vehUpdateBtn:eq(0)'));\n }\n else if ($step3ModalLink.length > 0) {\n if (summaryContainerExpanded) {\n $step3ModalLink.trigger('click');\n }\n else {\n jQuery('.modify-rental .modify-link').trigger('click');\n $step3ModalLink.trigger('click');\n }\n autoApplyCoupon(jQuery('#awd'), jQuery('.awd-space .btn-submit:eq(0)'));\n }\n}\n\nif (bouncex.cookie.vpv === 1 && !jQuery('#awd').val() && jQuery('#awd').val() !== couponValue && isMobileSite) {\n showMobileModal();\n}","force_https":false,"waypoints":false,"content_width":900,"gai":"UA-6997633-39","swids":"","sd":0,"ljq":"auto","campaign_id":0,"is_preview":false,"aco":{"first_party_limit":"3500","local_storage":"1"},"cmp":{"gdpr":0,"gmp":0,"whitelist_check":1},"burls":[{"prop":"contains","val":"bxtest12346"}],"ple":false,"fbe":true,"ffs":"","mas":2,"map":1,"gar":true,"ete":1,"ettm":false,"etjs":"/* -------------------------------- CONFIG -------------------------------- */\n// This tracking code should be applied to WID's 2252, 4625, and 2537\n// update -SB 9.27.21\n// update -XO 2.14.23\n\n// getLocalConfig returns an object with the following shape\n// {\n// hostnames: /* site hostnames */,\n// countryCode: /* market to run code in */,\n// id: /* website id */,\n// name: /* name of business used to set default config keys */\n// stepConfig: /* determines step number and name of the current step in\n// conversion funnel */,\n// smpCID: /* Save My Progress campaign ID */,\n// smrCID: /* Save My Reservation campaign ID */,\n// replenPath: /* path of reservation rehydration url */,\n// replenSessionStorageKey: /* session storage key set during replen to\n// validate replensihment and report it */,\n// makeReservationTimeParams: /* makes reservtion rehydration parameters\n// specfic to pickup and dropoff times and locations */,\n// makeSiteQp: /* makes site specific reservtion rehydration parameters */,\n// isValidQP: /* validate required site specific reservtion rehydration\n// parameters */,\n// setSiteReplenParams: /* edits reservation rehydration parameters before\n// replen */,\n// siteSpecificEventFuncs: /* array of funcs to be fired on pageload */,\n// runSiteSpecificEventFuncs: /* standarized way to run\n// siteSpecificEventFuncs */\n// }\nvar getLocalConfig = (\n function () {\n var etConfigs = {\n 2252: {\n hostnames: ['www.avis.com'],\n countryCode: 'US',\n // Save My Progress campaign ID\n smpCID: 1400791,\n // Save My Reservation campaign ID\n smrCID: 842686,\n },\n 4625: {\n hostnames: ['www.avis.ca'],\n countryCode: 'CA',\n },\n 2537: {\n hostnames: ['www.budget.com', 'global.budget.com'],\n countryCode: 'US',\n smpCID: 542067,\n smrCID: 1460526,\n makeReservationTimeParams: function (timeConfig) {\n return {\n 'PICKUP_MONTH_YEAR': timeConfig.pickUp.monthYear,\n 'PICKUP_DATE': timeConfig.pickUp.date,\n 'PICKUP_TIME': timeConfig.pickUp.militaryTime,\n 'PICKUP_LOC': timeConfig.pickUp.location,\n 'DROPOFF_MONTH_YEAR': timeConfig.dropOff.monthYear,\n 'DROPOFF_DATE': timeConfig.dropOff.date,\n 'DROPOFF_TIME': timeConfig.dropOff.militaryTime,\n 'DROPOFF_LOC': timeConfig.dropOff.location\n };\n },\n makeSiteQp: function (reservationInfo, stepCode) {\n var siteQp = {\n 'rateCode': reservationInfo.rateCode,\n 'IN': reservationInfo.iataNumber,\n 'BCD': reservationInfo.coupon.discountNumber || '',\n 'COUNTRY': reservationInfo.personalInfoRQ.residency\n };\n if (stepCode > 2) {\n siteQp['carGroupCode'] = reservationInfo\n .userSelectedCar;\n }\n return siteQp;\n },\n isValidQP: function (qp) {\n var requiredParams = [\n 'PICKUP_LOC',\n 'PICKUP_DATE',\n 'PICKUP_MONTH_YEAR',\n 'PICKUP_TIME',\n 'DROPOFF_LOC',\n 'DROPOFF_DATE',\n 'DROPOFF_MONTH_YEAR',\n 'DROPOFF_TIME'\n ],\n i = 0;\n for (i; i < requiredParams.length; i++) {\n if (!qp[requiredParams[i]]) {\n bouncex.log('ibx validation missing param: ', requiredParams[i]);\n return false;\n }\n }\n return true;\n },\n setSiteReplenParams: function (params) {\n if (\n bouncex.utils.url.getParam('carGroupCode', params)\n .length === 2\n ) {\n params = params.replace(/&carGroupCode=[^&]*/, '');\n }\n return params;\n },\n siteSpecificEventFuncs: [\n function () {\n bouncex.et.on(\n jQuery('button#res-home-select-car'),\n 'click.bx',\n function () {\n var currentCode = jQuery(\n '#awd,' +\n 'input[name=\"vehicle.coupon.discountNumber\"],' +\n 'input[name=\"DiscAWDMob\"]'\n )\n .val() || '';\n if (!currentCode.startsWith('Y1265')) { return; }\n bouncex.push(['used usaa code']);\n\n }\n );\n\n }\n ],\n replenPath: '/budgetWeb/reservation/processoptions.ex',\n },\n 5368: {\n hostnames: ['www.budget.ca'],\n countryCode: 'CA',\n smpCIDLangSpecific: {\n 'EN': 1516837,\n 'FR': 1529654,\n },\n smrCIDLangSpecific: {\n 'EN': 1516845,\n 'FR': 1529644\n },\n checkLanguage: true,\n makeReservationTimeParams: function (timeConfig) {\n return {\n 'PICKUP_MONTH_YEAR': timeConfig.pickUp.monthYear,\n 'PICKUP_DATE': timeConfig.pickUp.date,\n 'PICKUP_TIME': timeConfig.pickUp.militaryTime,\n 'PICKUP_LOC': timeConfig.pickUp.location,\n 'DROPOFF_MONTH_YEAR': timeConfig.dropOff.monthYear,\n 'DROPOFF_DATE': timeConfig.dropOff.date,\n 'DROPOFF_TIME': timeConfig.dropOff.militaryTime,\n 'DROPOFF_LOC': timeConfig.dropOff.location\n };\n },\n makeSiteQp: function (reservationInfo, stepCode) {\n var siteQp = {\n 'rateCode': reservationInfo.rateCode,\n 'IN': reservationInfo.iataNumber,\n 'BCD': reservationInfo.coupon.discountNumber || '',\n 'COUNTRY': reservationInfo.personalInfoRQ.residency\n };\n if (stepCode > 2) {\n siteQp['carGroupCode'] = reservationInfo\n .userSelectedCar;\n }\n return siteQp;\n },\n isValidQP: function (qp) {\n var requiredParams = [\n 'PICKUP_LOC',\n 'PICKUP_DATE',\n 'PICKUP_MONTH_YEAR',\n 'PICKUP_TIME',\n 'DROPOFF_LOC',\n 'DROPOFF_DATE',\n 'DROPOFF_MONTH_YEAR',\n 'DROPOFF_TIME'\n ],\n i = 0;\n for (i; i < requiredParams.length; i++) {\n if (!qp[requiredParams[i]]) {\n bouncex.log('ibx validation missing param: ', requiredParams[i]);\n return false;\n }\n }\n return true;\n },\n setSiteReplenParams: function (params) {\n if (\n bouncex.utils.url.getParam('carGroupCode', params)\n .length === 2\n ) {\n params = params.replace(/&carGroupCode=[^&]*/, '');\n }\n return params;\n },\n siteSpecificEventFuncs: [\n function () {\n bouncex.et.on(\n jQuery('button#res-home-select-car'),\n 'click.bx',\n function () {\n var currentCode = jQuery(\n '#awd,' +\n 'input[name=\"vehicle.coupon.discountNumber\"],' +\n 'input[name=\"DiscAWDMob\"]'\n )\n .val() || '';\n if (!currentCode.startsWith('Y1265')) { return; }\n bouncex.push(['used usaa code']);\n\n }\n );\n\n }\n ],\n replenPath: '/budgetWeb/reservation/processoptions.ex',\n }\n },\n avisConfig = {\n makeReservationTimeParams: function (timeConfig) {\n return {\n 'PICKUP_DAY': timeConfig.pickUp.date,\n 'PICKUP_MONTH': timeConfig.pickUp.month,\n 'PICKUP_YEAR': timeConfig.pickUp.year,\n 'PICKUP_MINUTE': timeConfig.pickUp.minute,\n 'PICKUP_HOUR': timeConfig.pickUp.hour,\n 'PICKUP_AM_PM': timeConfig.pickUp.meridiem,\n 'PICKUP_LOCATION_CODE': timeConfig.pickUp.location,\n 'RETURN_DAY': timeConfig.dropOff.date,\n 'RETURN_MONTH': timeConfig.dropOff.month,\n 'RETURN_YEAR': timeConfig.dropOff.year,\n 'RETURN_MINUTE': timeConfig.dropOff.minute,\n 'RETURN_HOUR': timeConfig.dropOff.hour,\n 'RETURN_AM_PM': timeConfig.dropOff.meridiem,\n 'RETURN_LOCATION_CODE': timeConfig.dropOff.location,\n };\n },\n makeSiteQp: function (reservationInfo, stepCode) {\n return {\n 'DEFAULT_OPTIONS': 'true',\n 'RENTAL_ONEWAY': !!reservationInfo.dropInfo,\n 'STEP_CODE': stepCode,\n 'COUNTRY_OF_RESIDENCE_CODE': reservationInfo\n .personalInfoRQ\n .residency,\n 'CAR_GROUP_CODE': reservationInfo.userSelectedCar ||\n reservationInfo.carClass ||\n '',\n 'AWD_NUMBER': reservationInfo.coupon.discountNumber ||\n '',\n };\n },\n isValidQP: function (qp) {\n var requiredParams = [\n 'STEP_CODE',\n 'PICKUP_DAY',\n 'PICKUP_MONTH',\n 'PICKUP_YEAR',\n 'PICKUP_HOUR',\n 'PICKUP_MINUTE',\n 'PICKUP_AM_PM',\n 'RETURN_DAY',\n 'RETURN_MONTH',\n 'RETURN_YEAR',\n 'RETURN_HOUR',\n 'RETURN_MINUTE',\n 'RETURN_AM_PM',\n 'PICKUP_LOCATION_CODE'\n ],\n i = 0;\n for (i; i < requiredParams.length; i++) {\n if (!qp[requiredParams[i]]) { return false; }\n }\n return true;\n },\n setSiteReplenParams: function (params) {\n if (\n bouncex.utils.url.getParam('CAR_GROUP_CODE', params)\n .length === 2\n ) {\n params = params.replace(/(STEP_CODE=)(\\d+)/, '$13');\n }\n return params;\n },\n replenPath: '/car-rental/reservation/initialize-reservation.ac',\n },\n defaultConfig = {\n hostnames: [],\n countryCode: '',\n stepConfig: getStepConfig(),\n replenSessionStorageKey: 'bx_replen',\n makeReservationTimeParams: function () { return {}; },\n makeSiteQp: function () { return {}; },\n isValidQP: function () { return false; },\n replenPath: '',\n setSiteReplenParams: function (params) { return params; },\n siteSpecificEventFuncs: [],\n runSiteSpecificEventFuncs: function () {\n var i = 0;\n for (i; i < this.siteSpecificEventFuncs.length; i++) {\n if (\n typeof this.siteSpecificEventFuncs[i] !== 'function'\n ) {\n return;\n }\n this.siteSpecificEventFuncs[i]();\n }\n\n }\n },\n config = etConfigs[bouncex.website.id] || {};\n\n config.id = bouncex.website.id || 0;\n config.name = bouncex.website.name || '';\n\n // avis websites share many of the same config keys\n if (config.name.toLowerCase().indexOf('avis') > -1) {\n for (var akey in avisConfig) {\n if (config[akey]) { continue; }\n config[akey] = avisConfig[akey];\n }\n }\n\n // set defaults for shared or undefined keys\n for (var key in defaultConfig) {\n if (config[key]) { continue; }\n config[key] = defaultConfig[key];\n }\n \n config.siteLanguage = getSiteLanguage(config.hostnames);\n\n return function () {\n return config;\n };\n }\n)();\n\nfunction getStepConfig() {\n var steps = {\n 'vehicles': 3,\n 'extras': 4,\n 'review-and-book': 5\n };\n\n for (var step in steps) {\n if (window.location.hash.indexOf(step) > -1) {\n return {\n name: step,\n code: steps[step]\n };\n }\n }\n return {\n name: '',\n code: 0\n };\n}\n\nfunction getSiteLanguage(hostnames) {\n var url = bouncex.utils.url.allowParams(),\n r,\n m,\n i = 0;\n hostnames = hostnames || [];\n for (i; i < hostnames.length; i++) {\n r = new RegExp(hostnames[i] + '\\/([a-z]{2})\\/');\n m = url.match(r);\n if (!m) { continue; }\n return m[1].toUpperCase();\n }\n return '';\n}\n\n// initUTK adds functions to bouncex.utk for use in onsite campaigns.\n// request email functions are used in Save My Progress, Save My Reservation and\n// any other ecap campaigns requiring event metadata in submission js.\n// makeReservationEvent returns all reservation data, including item:ids\n// The metadata in the return object is used in request emails, specifically\n// the keys 'token', 'timestamp', and 'item:ids'\n// for ease of use and to make the code maintable, the addition of configurable\n// IBX campaign ids have been added to the return object. This will allow for\n// updates of campaign ids to be made in etjs.\nfunction initUTK() {\n var localConfig = getLocalConfig();\n bouncex.utk = bouncex.utk || {};\n bouncex.utk.makeReservationEvent = makeReservationEvent;\n bouncex.utk.makeRequestEmailEvent = function (cid, ids) {\n ids = ids || '';\n var event = makeReservationEvent(ids);\n event['campaignid'] = cid;\n event['requestemail:testmode'] = bouncex.testmode.bxdev ? 1 : 0;\n return event;\n };\n bouncex.utk.makeSaveMyProgressEvent = function () {\n return bouncex.utk.makeRequestEmailEvent(\n localConfig.smpCID,\n getItemIds()\n );\n };\n bouncex.utk.makeSaveMyReservationEvent = function () {\n return bouncex.utk.makeRequestEmailEvent(\n localConfig.smrCID,\n getReservationItemId()\n );\n };\n\n}\n\n/* --------------------- CUSTOM CLIENT CONTEXT HELPERS ---------------------- */\nfunction getCustomClientContext() {\n var ccc = bouncex.parseJSON(\n sessionStorage['customClientContext']\n );\n ccc.geoLocationCountry = ccc.geoLocationCountry || '';\n return ccc;\n}\n\n/* -------------------------- RESERVATION HELPERS -------------------------- */\n// getMonth has January as 0\nfunction getMonth(month) {\n var monthNum = window.parseInt(month) - 1;\n return window.isNaN(monthNum) ? '' : monthNum.toString();\n}\n\n// input example \"YYYY-MM-DD\"\nfunction makeDateConfig(date) {\n date = date || '';\n var dateInfo = date.split('-');\n return {\n date: dateInfo[2] || '',\n month: getMonth(dateInfo[1]),\n year: dateInfo[0],\n monthYear: dateInfo[0] + dateInfo[1]\n };\n}\n\n// input example \"12:00 AM\"\nfunction makeTimeConfig(time) {\n time = time || '';\n var times = time.split(/:|\\s/g),\n config = {\n minute: times[1] || '',\n hour: times[0] || '',\n meridiem: times[2] || ''\n };\n config.militaryHour = getMiltaryHour(config);\n config.militaryTime = config.militaryHour + config.minute;\n return config;\n}\n\n// midnight is 24\nfunction getMiltaryHour(config) {\n var milHour = window.parseInt(config.hour);\n switch (config.meridiem) {\n case 'AM':\n if (milHour === 12) { milHour = 24; }\n break;\n case 'PM':\n if (milHour !== 12) { milHour += 12; }\n break;\n default:\n break;\n }\n return (milHour < 10 ? '0' : '' ) + milHour.toString();\n}\n\nfunction makeReservationTimeConfig(date, time, location) {\n var dateConfig = makeDateConfig(date),\n timeConfig = makeTimeConfig(time),\n config = Object.assign({}, dateConfig, timeConfig);\n config.timeStamp = new Date(\n config.year,\n config.month,\n config.date,\n config.militaryHour,\n config.minute,\n '00'\n ).getTime();\n config.location = location;\n return config;\n}\n\nfunction makeFullReservationTimeConfig(reservationInfo) {\n reservationInfo = reservationInfo || makeReservationInfo();\n return {\n pickUp: makeReservationTimeConfig(\n reservationInfo.pickUpDate,\n reservationInfo.pickUpTime,\n reservationInfo.pickInfo,\n ),\n // budget: dropInfo is '' if it is the same location as the pickup\n dropOff: makeReservationTimeConfig(\n reservationInfo.dropDate,\n reservationInfo.dropTime,\n reservationInfo.dropInfo || reservationInfo.pickInfo,\n )\n };\n}\n\nfunction makeReservationInfo() {\n var reservationInfo = bouncex.parseJSON(\n sessionStorage['ngStorage-reservationModel']\n );\n reservationInfo.pickInfo = reservationInfo.pickInfo || '';\n reservationInfo.dropInfo = reservationInfo.dropInfo || '';\n reservationInfo.rateCode = reservationInfo.rateCode || '';\n reservationInfo.iataNumber = reservationInfo.iataNumber || '';\n reservationInfo.personalInfoRQ = reservationInfo.personalInfoRQ ||\n {\n residency: '',\n age: 0\n };\n reservationInfo.coupon = reservationInfo.coupon || { discountNumber: '' };\n reservationInfo.selectedInsurances = reservationInfo\n .selectedInsurances || [];\n reservationInfo.selectedProducts = reservationInfo.selectedProducts ||\n [];\n reservationInfo.pickUpLocation = reservationInfo.pickUpLocation ||\n { suggDescription: '' };\n return reservationInfo;\n}\n\nfunction makeSelectionInsuranceQP(insurances) {\n var iQp = {},\n i = 0;\n\n for (i; i < insurances.length; i++) {\n var code = insurances[i].code;\n if(code) {\n iQp[code + '_ACCEPT'] = 'true';\n }\n }\n return iQp;\n}\n\nfunction makeSelectedProducstQP(sps) {\n var spsQp = {},\n product,\n i = 0;\n\n for (i; i < sps.length; i++) {\n product = sps[i];\n switch (product.code) {\n case 'RSN':\n case 'XMR':\n spsQp[product.code + '_ACCEPT'] = 'true';\n break;\n case 'GPS':\n spsQp['AVIS_ASSIST'] = 'true';\n break;\n case 'CSS':\n spsQp['CHILD_SAFETY_SEAT'] = 'true';\n spsQp['CHILD_SAFETY_SEAT_QUANTITY'] = product.quantity;\n break;\n case 'CBS':\n spsQp['CHILD_BOOSTER_SEAT'] = 'true';\n spsQp['CHILD_BOOSTER_SEAT_QUANTITY'] = product.quantity;\n break;\n default:\n break;\n }\n }\n return spsQp;\n}\n\n// makeReservationEvent creates an event with used for all user interaction\n// events. The user interaction events: 'view progress', 'add to cart'\n// 'requestemail' all happen in the same scope using data from\n// sessionStorage['ngStorage-reservationModel']. To simplify eligibility,\n// all events will have the same meta data. Here is an example\n// {\n// cart:accountType: \"L\" /* businsess \"B\" or lesiure \"L */\n// cart:ancillaryItems: false\n// cart:carCode: \"A\"\n// cart:pickuptimestamp: 1632412800000\n// cart:step: 4 /* step code in checkout flow according to getStepConfig */\n// cart:token: /* validated params for reservation rehydration */\n// items:ids: \"comma, separated, item ids\"\n// page:title: \"Vehicles\"\n// page:url: /* current URL */\n// pickup:date: \"Thu, Aug 12, 12:00 PM\"\n// pickup:location: \"Piedmont Triad Intl Airport, Greensboro, NC, US-(GSO)\"\n// }\n\n/* Wrike 919211747 - 3/15/23 BUSINESS_LEISURE patch */ \nfunction getAlternateBusinessLeisureCode() {\n return angular && angular.element('#reservation-partial') && angular.element('#reservation-partial').controller() && angular.element('#reservation-partial').controller().response && angular.element('#reservation-partial').controller().response.webHeader && angular.element('#reservation-partial').controller().response.webHeader.p13nDetailsMap && angular.element('#reservation-partial').controller().response.webHeader.p13nDetailsMap.discountNumberType || bouncex.vars.business_leisure_code;\n}\n\nfunction makeReservationEvent(ids) {\n var localConfig = getLocalConfig(),\n stepConfig = localConfig.stepConfig,\n reservationInfo = makeReservationInfo(),\n reservationTimeConfig = makeFullReservationTimeConfig(reservationInfo),\n reservationTimeQp = localConfig\n .makeReservationTimeParams(reservationTimeConfig),\n insurancesQp = makeSelectionInsuranceQP(\n reservationInfo.selectedInsurances\n ),\n selectedProductsQP = makeSelectedProducstQP(\n reservationInfo.selectedProducts\n ),\n businessLeisureCode = reservationInfo.coupon && reservationInfo.coupon.discountNumberType || getAlternateBusinessLeisureCode(),\n qp = {\n 'AGE': reservationInfo.personalInfoRQ.age,\n 'BUSINESS_LEISURE': businessLeisureCode !== 'M' && businessLeisureCode !== '' ? 'B' : 'L'\n },\n siteQp = localConfig.makeSiteQp(reservationInfo, stepConfig.code),\n params = Object.assign(\n {},\n reservationTimeQp,\n insurancesQp,\n selectedProductsQP,\n qp,\n siteQp\n );\n \n /* Wrike 919211747 - 3/15/23 BUSINESS_LEISURE patch - pt2 */ \n if (businessLeisureCode && !bouncex.vars.business_leisure_code) {\n bouncex.setv('business_leisure_code', businessLeisureCode);\n }\n\n return {\n 'cart:token': bouncex.utils.url.generateQuerystring(params),\n 'cart:pickuptimestamp': reservationTimeConfig.pickUp.timeStamp,\n 'cart:step': stepConfig.code,\n 'cart:carCode': reservationInfo.userSelectedCar ||\n reservationInfo.carClass ||\n '',\n 'cart:accountType': params['BUSINESS_LEISURE'],\n 'cart:ancillaryItems': reservationInfo.selectedProducts.length > 0 ||\n reservationInfo.selectedInsurances.length > 0,\n 'cart:hasconverted': bouncex.cookie.lc ? 1 : 0,\n 'pickup:location': reservationInfo.pickUpLocation.suggDescription\n || jQuery('.location-info').eq(0).text().trim().split(',').shift(),\n 'pickup:date': jQuery('.day-time-info').eq(0).text().trim() ||\n reservationInfo.pickUpDateDisplay,\n 'page:title': stepConfig.name.replace(/-/g, ' ').toLowerCase(),\n 'page:url': jQuery('link[rel=\"canonical\"]').attr('href') || '',\n 'items:ids': ids,\n 'item:id': ids\n };\n}\n\n/* --------------------------------- ITEM ---------------------------------- */\n// removes item url smart tag validation. Emails drive user back to reservation\n// page. Vehicle PDP's do not exist.\nfunction setItemTrackingRequirements() {\n var requirements = bouncex.et.item.requirements || [],\n excludedReqs = ['url'],\n newReqs = [],\n i = 0;\n\n for (i; i < requirements.length; i++) {\n if (excludedReqs.indexOf(requirements[i].name) > - 1) { continue; }\n newReqs[newReqs.length] = requirements[i];\n }\n bouncex.et.item.requirements = newReqs;\n\n}\n\nfunction makeItemId(copy) {\n var localConfig, itemId;\n\n if (!copy) {\n return '';\n }\n\n localConfig = getLocalConfig();\n itemId = slugify(copy);\n\n if (localConfig.checkLanguage && localConfig.siteLanguage) {\n return localConfig.siteLanguage + ':' + itemId;\n }\n\n return itemId;\n\n}\n\nfunction slugify(copy) {\n copy = copy || '';\n return copy.replace(/\\s/g, '_').toLowerCase();\n}\n\nfunction getItem($item) {\n var copy = $item.find('.featurecartxt').text().trim(),\n src = $item.find('img').attr('src') || '',\n imageurl = '';\n\n // replace small and medium images with large\n src = src.replace(/(\\/cars\\/)(s|m)(\\/)/, '$1l$3');\n if (src) { imageurl = bouncex.utils.getOrigin() + src; }\n\n return {\n id: makeItemId(copy),\n copy: copy.replace(/ or similar$/g, ''),\n imageurl: imageurl,\n instock: true\n };\n}\n\nfunction getItems() {\n var $items = jQuery('.featured-car-box, .available-car-box'),\n items = [],\n i = 0;\n\n for (i; i < $items.length; i++) {\n items[items.length] = getItem(jQuery($items[i]));\n }\n return items;\n}\n\nfunction getItemIds(items) {\n var ids = [],\n i = 0;\n items = items || getItems();\n for (i; i < items.length; i++) {\n if (!items[i].id) { continue; }\n ids[ids.length] = items[i].id;\n }\n return ids.join(',');\n}\n\nfunction isValidItem(item) {\n item = item || {};\n return !!item.id &&\n !!item.copy &&\n !!item.imageurl &&\n item.imageurl.indexOf('unavailable') === -1 &&\n item.imageurl.indexOf('uat1') === -1;\n}\n\n/* ----------------------- RESERVATION INITIALIZERS ------------------------ */\nfunction isValidReservationEvent(resEvent) {\n resEvent = resEvent || { 'cart:token': '' };\n return !!resEvent['items:ids'] &&\n !!resEvent['page:url'] &&\n !!resEvent['pickup:location'] &&\n !!resEvent['pickup:date'] &&\n getLocalConfig().isValidQP(\n bouncex.utils.url.queryStringToObject(resEvent['cart:token'])\n );\n}\n\nfunction initializeReservationEvents() {\n var items = getItems(),\n ids = getItemIds(items),\n event = makeReservationEvent(ids),\n i = 0;\n\n \n setItemTrackingRequirements();\n for (i; i < items.length; i++) {\n if (!isValidItem(items[i])) { continue; }\n bouncex.push(['item', items[i]]);\n }\n\n if (!isValidReservationEvent(event)) { return; }\n bouncex.push(['view progress', event]);\n\n}\n\nfunction getReservationItemId() {\n return makeItemId(jQuery('.vehicle-info span').first().text().trim());\n}\n\n/* --------------------------------- CART ---------------------------------- */\nfunction initializeAddToCart() {\n // itemId of single reservation\n var itemId = getReservationItemId(),\n event = makeReservationEvent(itemId);\n\n if (!isValidReservationEvent(event)) { return; }\n bouncex.push(['add to cart', event]);\n\n}\n\n/* ------------------------------- CART ------------------------------------ */\nfunction getMillisecondsFromHours(hours) {\n return 1000 * 60 * 60 * hours;\n}\n\n// replenish makes a request to an initialize-reservation endpoint with\n// reservation paramters. The server then redirects to the avis main site with\n// rehydrated reservation info.\nfunction replenish(cart) {\n var hours = 3,\n staleEmailHourLimit = getMillisecondsFromHours(hours),\n pickupTimestamp = window.parseInt(cart.pickupTimestamp) || 0,\n now = Date.now();\n if (pickupTimestamp - now < staleEmailHourLimit) {\n bouncex.setv('res_passed', true);\n bouncex.reload_campaigns();\n bouncex.push(['cart replenish',\n {\n 'cart:success': 'NA',\n 'cart:reason': 'reservation less than ' + hours + ' hours'\n }\n ]);\n return;\n }\n try {\n sessionStorage.setItem(\n getLocalConfig().replenSessionStorageKey,\n cart.stepCode\n );\n } catch (e) {\n\t\tbouncex.log('error setting session storage');\n\t}\n\n var localConfig = getLocalConfig(),\n params = localConfig.setSiteReplenParams(cart.token);\n\n if (localConfig.replenPath === '') {\n bouncex.log('empty replenPath in local config. Please set to a path');\n return;\n }\n\n bouncex.setTimeout2(\n function () {\n window.location.href = bouncex.utils.getOrigin() +\n localConfig.replenPath +\n '?' +\n params;\n\n },\n 300\n );\n\n}\n\n// reportReplenishment checks for a session storage value set during\n// replenishment to determine if replenishment was successful. Replenishment\n// involves making a request with reservation parameters that redirects to the\n// site with the rservation details. Because of this redirect, sustaining a\n// parameter of 'bx_replen' is not possible.\nfunction reportReplenishment() {\n var localConfig = getLocalConfig(),\n replenStep = parseInt(\n sessionStorage.getItem(localConfig.replenSessionStorageKey)\n );\n if (!replenStep) { return; }\n sessionStorage.removeItem(localConfig.replenSessionStorageKey);\n var failReason = jQuery('.res-PageError:visible').text().trim();\n if (failReason) {\n pushCartReplensih(false, failReason);\n return;\n }\n var stepConfig = localConfig.stepConfig;\n\n if (stepConfig.name === 'vehicles' && jQuery('.available-car-box').length) {\n pushCartReplensih(false, 'no cars');\n return;\n }\n\n if (window.location.href.indexOf('reservation#/oneclick') > -1) {\n pushCartReplensih(false, 'bad step');\n return;\n }\n\n if (replenStep !== stepConfig.code) {\n var reason = 'should be step ' + replenStep +\n ' on step ' + stepConfig.code;\n pushCartReplensih(false, reason);\n return;\n }\n\n pushCartReplensih(true, false);\n\n}\n\nfunction pushCartReplensih(success, reason) {\n bouncex.push(['cart replenish',\n {\n 'cart:success': success,\n 'cart:reason': reason\n }\n ]);\n\n}\n\n/* ------------------------------ USER TRACKING ----------------------------- */\n\nfunction initializeUserTracking() {\n if (!bouncex.vars.logged_in || !!bouncex.vars.logged_in_identified) {\n return;\n }\n\n var userEmail;\n\n bouncex.et.onTrue(\n function () {\n userEmail = (jQuery('[type=\"email\"]').val() || '').toLowerCase();\n return bouncex.utils.validate.email(userEmail);\n },\n function () {\n bouncex.push([\n 'user',\n {\n 'email': userEmail,\n 'source': 'LoggedIn'\n }\n ]);\n bouncex.setVar('logged_in_identified', true);\n },\n 5\n );\n}\n\n/* ------------------------------- INIT ------------------------------------ */\nfunction init() {\n var localConfig = getLocalConfig(),\n stepConfig = localConfig.stepConfig;\n\n initUTK();\n initializeUserTracking();\n\n if (\n localConfig.hostnames.indexOf(window.location.hostname) === -1 ||\n bouncex.utils.getNestedProp('bouncex.state.geo.country_code') !==\n localConfig.countryCode\n ) {\n return;\n }\n\n bouncex.et.cart.init({\n replenish: replenish,\n reportReplenishment: reportReplenishment\n });\n\n localConfig.runSiteSpecificEventFuncs();\n // progress abandonment\n if (\n window.location.href.indexOf('/reservation#') === -1 ||\n !stepConfig.code\n ) { return; }\n\n if (stepConfig.code === 3) {\n initializeReservationEvents();\n return;\n }\n\n // fire add to cart with specific item id\n if (stepConfig.code === 4 || stepConfig.code === 5) {\n initializeAddToCart();\n }\n\n}\n\ninit();\n","dge":true,"bxidLoadFirst":false,"pie":true,"cme":true,"gbi_enabled":0,"bpush":false,"pt":null,"els":{},"vars":[{"name":"vehicle_type_selected","polling":"all","persist":"no","page_types":[],"testmode":false,"default":"false","code":"(function() {\n\tvar reservation = JSON.parse(sessionStorage.getItem('ngStorage-reservationModel'));\n\tif (reservation && typeof reservation.selectedCar !== 'undefined' && typeof reservation.selectedCar[0] !== 'undefined'){\n\t\treturn reservation.selectedCar[0].carGroup;\n\t}\n})();","trigger":"pageload"},{"name":"length_of_rental","polling":"all","persist":"no","page_types":[],"testmode":false,"default":"false","code":"(function() { \n\tvar context = JSON.parse(sessionStorage.getItem('customClientContext'));\n\tif (context && context.lor) {\n\t\treturn context.lor;\n\t}\n})();","trigger":"pageload"},{"name":"booking_days_out","polling":"all","persist":"no","page_types":[],"testmode":false,"default":"false","code":"(function() { \n\tvar context = JSON.parse(sessionStorage.getItem('customClientContext'));\n\tif (context && context.pickupDatetime) {\n\t\tvar secondDate = new Date(context.pickupDatetime);\n\t\tvar firstDate = new Date();\n\t\treturn Math.round(Math.abs((firstDate.getTime() - secondDate.getTime())/(24*60*60*1000)));\n\t}\n})();","trigger":"pageload"},{"name":"carclass_selected","polling":"all","persist":"no","page_types":[],"testmode":false,"default":"false","code":"(function() {\n\tvar reservation = JSON.parse(sessionStorage.getItem('ngStorage-reservationModel'));\n\tif (reservation && typeof reservation.selectedCar !== 'undefined' && typeof reservation.selectedCar[0] !== 'undefined'){\n\t\treturn reservation.selectedCar[0].carClass;\n\t}\n})();","trigger":"pageload"},{"name":"bcd_applied","polling":"all","persist":"no","page_types":[],"testmode":false,"default":"false","code":"(function() {\n var excludedDiscounts = ['S612500', 'Mobile rate'];\n \n /* car selection page */\n var context = JSON.parse(sessionStorage.getItem('customClientContext'));\n var discountNumberVisible = context && context.discountNumber && context.discountNumber.length > 0 && excludedDiscounts.indexOf(context.discountNumber) === -1;\n \n /* home and reservation pages */\n var discountInput = jQuery('#AWD, #awd').first().val();\n var discountInputApplied = discountInput && excludedDiscounts.indexOf(discountInput) === -1 ? discountInput.length > 0 : false;\n\n var bcdCoupon = jQuery('.discount-summary-section:contains(AWD)').text();\n var bcdApplied = /(?!BCD:)\\w+?\\d+/.test(bcdCoupon) && excludedDiscounts.every(x => bcdCoupon.indexOf(x) === -1);\n \n return discountNumberVisible || discountInputApplied || bcdApplied || false;\n })();","trigger":"pageload"},{"name":"ancillary_selected_confirmation","polling":"all","persist":"no","page_types":[],"testmode":false,"default":"false","code":"(function() {\n\tvar reservation = JSON.parse(sessionStorage.getItem('ngStorage-reservationModel'));\n\tif (reservation && typeof reservation.selectedInsurances !== 'undefined' && typeof reservation.selectedProducts !== 'undefined') {\n\t\tvar insurances = reservation.selectedInsurances;\n\t\tvar products = reservation.selectedProducts;\n\t\tvar ret = [];\n\t\tfor (var i = 0; i < products.length; i++) {\n\t\t\tif (products[i].code) {\n\t\t\t\tret.push(products[i].code);\n\t\t\t}\n\t\t}\n\t\tfor (var j = 0; j < insurances.length; j++) {\n\t\t\tif (insurances[j].code) {\n\t\t\t\tret.push(insurances[j].code);\n\t\t\t}\n\t\t}\n\t\tif (ret.length > 0) {\n\t\t\treturn ret.join();\n\t\t}\n\t}\n\treturn false;\n})();","trigger":"pageload"},{"name":"pickup_location","polling":"all","persist":"visit","page_types":[],"testmode":false,"default":"false","code":"jQuery('.source .location-info').contents().filter(function() {\n return this.nodeType == 3;\n}).text().trim().replace(/\\s+/g, ' ') || null;","trigger":"pageload"},{"name":"coupon_code_applied","polling":"all","persist":"visit","page_types":[],"testmode":true,"default":"false","code":"(function(){\n if(window.location.href.indexOf('reservation#/time-and-place') > -1){\n return jQuery('#coupon').val() && !jQuery('.platform-error-message.error:contains(\"Your discount code is invalid\")').is(':visible') ? true : false;\n }\n return null;\n})();","trigger":"pageload"},{"name":"pickup_province","polling":"all","persist":"visit","page_types":[],"testmode":false,"default":"false","code":"bouncex.utils.gtmLookup('pulstate') || null;","trigger":"pageload"},{"name":"bcd_number","polling":"all","persist":"visit","page_types":[],"testmode":false,"default":"false","code":"/* Wrike 919211698 - duped from bcd_number */\njQuery('#awd').length > 0 ? jQuery('#awd').val() || false : null;","trigger":"pageload"},{"name":"ancillary_social_proof_number","polling":"none","persist":"no","page_types":[],"testmode":false,"default":"false","code":"Math.floor(Math.random() * 200) + 700;","trigger":"pageload"},{"name":"pickup_province_full","polling":"all","persist":"visit","page_types":[],"testmode":false,"default":"false","code":"(function() {\n var statesObj = {\n /* canadrian provinces */\n AB: 'Alberta',\n BC: 'British Columbia',\n MB: 'Manitoba',\n NB: 'New Brunswick',\n NL: 'Newfoundland and Labrador',\n NT: 'Northwest Territories',\n NS: 'Nova Scotia',\n NU: 'Nunavut',\n ON: 'Ontario',\n PE: 'Prince Edward Island',\n QC: 'Quebec',\n SK: 'Saskatchewan',\n YT: 'Yukon',\n /* US states */\n AL: 'Alabama',\n AK: 'Alaska',\n AZ: 'Arizona',\n AR: 'Arkansas',\n CA: 'California',\n CO: 'Colorado',\n CT: 'Connecticut',\n DE: 'Delaware',\n FL: 'Florida',\n GA: 'Georgia',\n HI: 'Hawaii',\n ID: 'Idaho',\n IL: 'Illinois',\n IN: 'Indiana',\n IA: 'Iowa',\n KS: 'Kansas',\n KY: 'Kentucky',\n LA: 'Louisiana',\n ME: 'Maine',\n MD: 'Maryland',\n MA: 'Massachusetts',\n MI: 'Michigan',\n MN: 'Minnesota',\n MS: 'Mississippi',\n MO: 'Missouri',\n MT: 'Montana',\n NE: 'Nebraska',\n NV: 'Nevada',\n NH: 'New Hampshire',\n NJ: 'New Jersey',\n NM: 'New Mexico',\n NY: 'New York',\n NC: 'North Carolina',\n ND: 'North Dakota',\n OH: 'Ohio',\n OK: 'Oklahoma',\n OR: 'Oregon',\n PA: 'Pennsylvania',\n RI: 'Rhode Island',\n SC: 'South Carolina',\n SD: 'South Dakota',\n TN: 'Tennessee',\n TX: 'Texas',\n UT: 'Utah',\n VT: 'Vermont',\n VA: 'Virginia',\n WA: 'Washington',\n WV: 'West Virginia',\n WI: 'Wisconsin',\n WY: 'Wyoming'\n };\n var state = bouncex.utils.gtmLookup('pulstate');\n if (statesObj[state]) {\n return statesObj[state];\n }\n})();","trigger":"pageload"},{"name":"pay_later_selected","polling":"none","persist":"visit","page_types":[],"testmode":false,"default":"false","code":"null;","trigger":"pageload"},{"name":"dropoff_location","polling":"none","persist":"visit","page_types":[],"testmode":false,"default":"false","code":"jQuery('.destination .location-info').contents().filter(function() {\n return this.nodeType === 3;\n}).text().trim().replace(/\\s+/g, ' ') || null;","trigger":"pageload"},{"name":"dropoff_location_polling","polling":"all","persist":"no","page_types":[],"testmode":false,"default":"false","code":"jQuery('#DropLoc_value').val().match(/.*\\(([^\\]\\[]*)\\)/) ? jQuery('#DropLoc_value').val().match(/.*\\(([^\\]\\[]*)\\)/) [1] : null;","trigger":"pageload"},{"name":"drop_off_date","polling":"none","persist":"visit","page_types":[],"testmode":false,"default":"false","code":"(function() {\n var returnDate = jQuery('input#to').val();\n if (returnDate.length) {\n var dateArr = returnDate.split('/'), year = dateArr[2], month = dateArr[0], day = dateArr[1];\n return year+month+day;\n }\n return null;\n})();","trigger":"pageload"},{"name":"location_code","polling":"all","persist":"no","page_types":[],"testmode":false,"default":"false","code":"jQuery('.location-info:first').length > 0 ? jQuery('.location-info:first').text().trim().split('\\n')[1].trim() : false;","trigger":"pageload"},{"name":"pickup_month","polling":"all","persist":"no","page_types":[],"testmode":false,"default":"false","code":"(function() {\r\n var datesOfMonthFormatted = {\r\n 1: 'January ',\r\n 2: 'February',\r\n 3: 'March',\r\n 4: 'April',\r\n 5: 'May',\r\n 6: 'June',\r\n 7: 'July',\r\n 8: 'August',\r\n 9: 'September',\r\n 10: 'October',\r\n 11: 'November',\r\n 12: 'December'\r\n };\r\n var $pickUpDate = jQuery('input.date-form-field').val() || '';\r\n if ($pickUpDate.length > 0) {\r\n $pickUpDate = Number($pickUpDate.split('/')[0]);\r\n }\r\n return datesOfMonthFormatted[$pickUpDate] || false;\r\n})();","trigger":"pageload"},{"name":"pay_now_savings","polling":"all","persist":"no","page_types":[],"testmode":false,"default":"false","code":"(function() {\n var savings;\n try {\n savings = angular.element(document).injector().get('getDataService').getAvailableExtras().reservationSummary.vehicle.savedAmt;\n } catch {\n savings = false;\n }\n return savings || null;\n})();","trigger":"pageload"},{"name":"pickup_day_of_week","polling":"all","persist":"visit","page_types":[],"testmode":false,"default":"false","code":"(function() {\n var data = sessionStorage['ngStorage-reservationModel'].length > 0 && sessionStorage['ngStorage-reservationModel'];\n if (data) {\n var parsed = data.length > 0 && JSON.parse(data);\n var pickup = parsed.pickUpDateDisplay !== undefined && parsed.pickUpDateDisplay;\n var date = new Date(pickup).getDay();\n var weekday = new Array(7);\n weekday[0] = \"Sunday\";\n weekday[1] = \"Monday\";\n weekday[2] = \"Tuesday\";\n weekday[3] = \"Wednesday\";\n weekday[4] = \"Thursday\";\n weekday[5] = \"Friday\";\n weekday[6] = \"Saturday\";\n return weekday[date];\n }\n return null;\n})();","trigger":"pageload"},{"name":"return_day_of_week","polling":"all","persist":"visit","page_types":[],"testmode":false,"default":"false","code":"(function() {\n var data = sessionStorage['ngStorage-reservationModel'].length > 0 && sessionStorage['ngStorage-reservationModel'];\n if (data) {\n var parsed = data.length > 0 && JSON.parse(data);\n var dropoff = parsed.dropDateDisplay !== undefined && parsed.dropDateDisplay;\n var date = new Date(dropoff).getDay();\n var weekday = new Array(7);\n weekday[0] = \"Sunday\";\n weekday[1] = \"Monday\";\n weekday[2] = \"Tuesday\";\n weekday[3] = \"Wednesday\";\n weekday[4] = \"Thursday\";\n weekday[5] = \"Friday\";\n weekday[6] = \"Saturday\";\n return weekday[date];\n }\n return null;\n})();","trigger":"pageload"},{"name":"reservation_in_future","polling":"all","persist":"no","page_types":[],"testmode":false,"default":"false","code":"(function() {\n var pickupTime = jQuery('input#from').val(),\n pickupDate = pickupTime ? new Date(pickupTime) : new Date(),\n dateNow = new Date();\n return pickupDate > dateNow;\n})();","trigger":"pageload"},{"name":"pickup_city_persistent","polling":"all","persist":"permanent","page_types":[],"testmode":false,"default":"false","code":"(function() {\n try {\n var city = JSON.parse(sessionStorage['ngStorage-reservationModel'])['pickCity'];\n return city || null;\n } catch(e) {\n return null;\n }\n})();","trigger":"pageload"},{"name":"logged_in","polling":"all","persist":"visit","page_types":[],"testmode":false,"default":"false","code":"(function() {\n\tvar customer = JSON.parse(sessionStorage.getItem('ngStorage-customer'));\n\tif (customer) {\n\t\treturn customer.userState === 'AUTHENTICATED';\n\t} else if (jQuery('.my-logout').length > 0) {\n\t\treturn true;\n\t}\n})();","trigger":"pageload"},{"name":"ever_logged_in","polling":"none","persist":"permanent","page_types":[],"testmode":false,"default":"false","code":"bouncex.vars.logged_in || null;","trigger":"pageload"},{"name":"cart","polling":"none","persist":"no","page_types":[],"testmode":false,"default":"false","code":"null;","trigger":"pageload"},{"name":"cart_qty","polling":"none","persist":"no","page_types":[],"testmode":false,"default":"false","code":"null;","trigger":"pageload"},{"name":"res_passed","polling":"all","persist":"visit","page_types":[],"testmode":false,"default":"false","code":"null;","trigger":"pageload"},{"name":"corp_bcd_applied","polling":"all","persist":"permanent","page_types":[],"testmode":false,"default":"false","code":"(function () {\n\tvar reservation = JSON.parse(sessionStorage.getItem('ngStorage-reservationModel'));\n\tif (reservation && typeof reservation.corporateAWD !== 'undefined' && reservation.corporateAWD){\n\t\treturn reservation.corporateAWD;\n\t}\n})();","trigger":"pageload"},{"name":"search_date","polling":"all","persist":"visit","page_types":[],"testmode":false,"default":"false","code":"(function() {\n var $pickUpDateField = jQuery('[message-id=fDate]');\n \n if ($pickUpDateField.length > 0 && $pickUpDateField.val()) {\n var pickUpDateString = $pickUpDateField.val();\n var pickUpDate = new Date(pickUpDateString);\n var textMonths = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];\n var month = textMonths[pickUpDate.getMonth()];\n var dayOfMonth = pickUpDate.getDate().toString();\n var ordinalSuffix=(function(day){\n switch(day){\n case '1': case '21': case '31':\n return 'st';\n case '2': case '22':\n return 'nd';\n case '3': case '23':\n return 'rd';\n default:\n return 'th';\n }\n })(dayOfMonth);\n return month + ' ' + dayOfMonth + ordinalSuffix || null;\n }\n return false;\n})();","trigger":"pageload"},{"name":"ldw_price","polling":"all","persist":"visit","page_types":[],"testmode":false,"default":"false","code":"(function() {\n var num = parseFloat(jQuery('#CDWchk').closest('div').text().trim().replace(/[^0-9.]/g, '')).toFixed(2) || null;\n return num !== \"NaN\" ? num : null;\n})();","trigger":"pageload"},{"name":"ancillary_disabled_confirmation","polling":"all","persist":"no","page_types":[],"testmode":false,"default":"false","code":"(function(){\n\tvar productList = JSON.parse(sessionStorage.getItem('ngStorage-productList'));\n\tvar insuranceList = JSON.parse(sessionStorage.getItem('ngStorage-insuranceList'));\n\tif (productList && insuranceList) {\n\t\tvar ancillaries = productList.concat(insuranceList);\n\t\tvar disabledAncillaries = [];\n\t\tfor (var i = 0; i < ancillaries.length; i++) {\n\t\t\tif (ancillaries[i].disabled === true) {\n\t\t\t\tdisabledAncillaries.push(ancillaries[i].code);\n\t\t\t}\n\t\t}\n\t\tif (disabledAncillaries.length > 0) {\n\t\t return disabledAncillaries.join();\n\t\t}\n\t}\n})();","trigger":"pageload"},{"name":"bcd_type","polling":"none","persist":"visit","page_types":[],"testmode":false,"default":"false","code":"/* Wrike 919211698 - duped from awd_type */\n(function(){ \n\tvar context = JSON.parse(sessionStorage.getItem('customClientContext'));\n\tif (context && context.discountNumberType) {\n\t\treturn context.discountNumberType;\n\t}\n})();","trigger":"pageload"},{"name":"ancillary_requested","polling":"none","persist":"visit","page_types":[],"testmode":false,"default":"false","code":"null;","trigger":"pageload"},{"name":"search_french_date","polling":"all","persist":"visit","page_types":[],"testmode":false,"default":"false","code":"(function(){\n try {\n var lang = jQuery('html').attr('lang') || '',\n $dateVal = jQuery('[message-id=fDate]').val() || '',\n $date,\n $month,\n titleCase;\n if (lang === 'fr' && $dateVal) {\n $date = new Date($dateVal).toLocaleDateString('fr-FR',{month: 'long', day: 'numeric' }).split(' ');\n $month = $date.pop();\n titleCase = $month[0].toUpperCase() + $month.slice(1);\n return $date[0] + ' ' + encodeURIComponent(titleCase) || null;\n }\n } catch (error) {\n return false;\n } \n}());","trigger":"pageload"},{"name":"ancillaries_selected","polling":"all","persist":"no","page_types":[],"testmode":false,"default":"false","code":"(function() {\n\tif (window.location.href.indexOf('reservation#/extras') !== -1) {\n\t\tvar selected = [];\n\t\tjQuery('.reservation-extras').find('.checkbox-custom:checked').filter( function(){\n\t\t\tselected.push(jQuery(this).attr('id').replace('chk',''));\n\t\t});\n\t\treturn (selected.length === 0) ? false : selected.join(', ');\n\t}\n})();","trigger":"pageload"},{"name":"cart_token","polling":"all","persist":"permanent","page_types":[],"testmode":false,"default":"false","code":"bouncex.utk && typeof bouncex.utk.makeReservationEvent() === 'object' && bouncex.utk.makeReservationEvent()['cart:token'] || null;","trigger":"pageload"},{"name":"pickup_date","polling":"all","persist":"permanent","page_types":[],"testmode":false,"default":"false","code":"(function() {\n var cartParams = bouncex.utk && typeof bouncex.utk.makeReservationEvent() === 'object' && bouncex.utk.makeReservationEvent()['cart:token'] || null,\n pickupDay = !!cartParams && bouncex.utils.getParam('PICKUP_DAY', cartParams),\n datesOfMonthFormatted = {\n '01': '1st',\n '02': '2nd',\n '03': '3rd',\n '04': '4th',\n '05': '5th',\n '06': '6th',\n '07': '7th',\n '08': '8th',\n '09': '9th',\n '10': '10th',\n '11': '11th',\n '12': '12th',\n '13': '13th',\n '14': '14th',\n '15': '15th',\n '16': '16th',\n '17': '17th',\n '18': '18th',\n '19': '19th',\n '20': '20th',\n '21': '21st',\n '22': '22nd',\n '23': '23rd',\n '24': '24th',\n '25': '25th',\n '26': '26th',\n '27': '27th',\n '28': '28th',\n '29': '29th',\n '30': '30th',\n '31': '31st'\n };\n\n return datesOfMonthFormatted[pickupDay] || null;\n})();","trigger":"pageload"},{"name":"reserved_this_visit","polling":"none","persist":"permanent","page_types":[],"testmode":false,"default":"false","code":"(window.location.href.indexOf('reservation') > -1 && window.location.href.indexOf('confirmation') > -1 && jQuery('.confirmation-info-holder-text').length > 0) || null;","trigger":"pageload"},{"name":"reserved_last_visit","polling":"none","persist":"visit","page_types":[],"testmode":false,"default":"false","code":"null;","trigger":"pageload"},{"name":"business_leisure_code","polling":"none","persist":"visit","page_types":[],"testmode":false,"default":"","code":"null;","trigger":"pageload"},{"name":"logged_in_identified","polling":"none","persist":"no","page_types":[],"testmode":false,"default":"false","code":"null;","trigger":"pageload"},{"name":"cookie_modal_present","polling":"all","persist":"no","page_types":[],"testmode":false,"default":"false","code":"jQuery('#onetrust-banner-sdk').is(':visible');","trigger":"pageload"}],"dgu":"pixel.cdnwidget.com","dgp":false,"ba":{"enabled":0,"fbte":0},"biu":"assets.bounceexchange.com","bau":"api.bounceexchange.com","beu":"events.bouncex.net","ibx":{"tjs":"","cjs":"","miw":0,"mibcx":1,"te":1,"cart_rep":{"get":"","set":""},"ulpj":{"et_rid":"espemailid"},"cus":"","miw_exclude":"","enabled":1},"etjson":null,"osre":true,"osru":"osr.bounceexchange.com/v1/osr/items","checkDfp":false,"gamNetwork":"","spa":1,"spatm":0,"preinit_cjs":"","crs":{"integrations":null,"pageCount":null},"mat":0,"math":0,"cpnu":"coupons.bounceexchange.com","dfpcms":0,"sms":{"optm":"Hit 'Send' to sign-up for automated, recurring Budget CA mktg txts (like cart reminders) to this #, per terms.\n\n","eventSharing":false,"shqId":"","enabled":1},"pde":true,"fmc":["AW","AI","AG","AR","BS","BB","BZ","BM","BO","BQ","BR","CA","KY","CL","CO","CR","CU","CW","DM","DO","EC","SV","GF","GL","GD","GT","GP","HT","HN","JM","MQ","MX","MS","NI","PA","PY","PE","PR","PM","MF","BL","KN","LC","VC","SX","SR","TT","US","UM","UY","VE","VG","VI"],"fme":true,"fmx":"","uid2":false,"sdk":{"android":{"enabled":false,"enabledVersions":[],"eventModifications":null},"ios":{"enabled":false,"enabledVersions":[],"eventModifications":null}},"onsite":{"enabled":1},"ads":{"enabled":0},"pubs":{"enabled":0},"websdk":{"enabled":0,"devMode":0},"ga4_property_id":"387482631","ga4_measurement_id":"G-7MWZDCRSKK","tag_state_domain":"api.bounceexchange.com"} ; bouncex.tag = 'tag3'; bouncex.$ = window.jQuery; bouncex.env = 'production'; bouncex.restrictedTlds = {"casl":{"ca":1},"gdpr":{"ad":1,"al":1,"at":1,"ax":1,"ba":1,"be":1,"bg":1,"by":1,"xn--90ais":1,"ch":1,"cy":1,"cz":1,"de":1,"dk":1,"ee":1,"es":1,"eu":1,"fi":1,"fo":1,"fr":1,"uk":1,"gb":1,"gg":1,"gi":1,"gr":1,"hr":1,"hu":1,"ie":1,"im":1,"is":1,"it":1,"je":1,"li":1,"lt":1,"lu":1,"lv":1,"mc":1,"md":1,"me":1,"mk":1,"xn--d1al":1,"mt":1,"nl":1,"no":1,"pl":1,"pt":1,"ro":1,"rs":1,"xn--90a3ac":1,"ru":1,"su":1,"xn--p1ai":1,"se":1,"si":1,"sj":1,"sk":1,"sm":1,"ua":1,"xn--j1amh":1,"va":1,"tr":1}}; bouncex.client = { supportsBrotli: 1 }; bouncex.assets = {"ads":"7b352b1295e35e9c90089d9dd48e488f","creativesBaseStyles":"a53944a2","gpsAuction":"bbb80866120d17013073bb6d284cbd6b","inbox":"75060a85c1a4aebcc6f779b9e84db722","onsite":"abbdf7a49be9b52b097917b7b527b262","sms":"e39203556bab2366e56296ce42e974a7","websdk":"04cde0014774b7eb597770595769aab1"}; bouncex.push = function(pushData) { bouncex.pushedData.push(pushData); } var runtime = document.createElement('script'); runtime.setAttribute('src', '//assets.bounceexchange.com/assets/smart-tag/versioned/runtime_c81e76ee00d795b1eebf8d27949f8dc5.br.js'); runtime.setAttribute('async', 'async'); bouncex.initializeTag = function() { var script = document.createElement('script'); script.setAttribute('src', '//assets.bounceexchange.com/assets/smart-tag/versioned/main-v2_c957d4b6668bf5c52b37a4a0fd797d56.br.js'); script.setAttribute('async', 'async'); document.body.appendChild(script); var deviceGraphScript = document.createElement('script'); deviceGraphScript.setAttribute('src', '//assets.bounceexchange.com/assets/smart-tag/versioned/cjs_min_6ef1802500d8367a80105e664862d0d7.js'); deviceGraphScript.setAttribute('async', 'async'); var dgAttrs = [{"Key":"id","Value":"c.js"},{"Key":"async","Value":"true"},{"Key":"data-apikey","Value":"2^HIykD"},{"Key":"data-cb","Value":"bouncex.dg.initPostDeviceGraph"},{"Key":"data-bx","Value":"1"},{"Key":"data-gm","Value":"1"},{"Key":"data-fire","Value":"1"}]; if (dgAttrs) { for (var i = 0; i < dgAttrs.length; i++) { deviceGraphScript.setAttribute(dgAttrs[i].Key, dgAttrs[i].Value); } } document.body.appendChild(deviceGraphScript); bouncex.initializeTag = function() {}; }; runtime.onload = bouncex.initializeTag; document.body.appendChild(runtime); } } if (document.readyState === "loading") { document.addEventListener("DOMContentLoaded", bxBootstrap); } else { bxBootstrap(); }})();