PageSourceSearch

https://www.landrover.com.cn/etc.clientlibs/jlr/clientlibs/clientl…ro-immersivehero-js.4aac54a892df27c46421.js

js landrover.com.cn collected 2026-10-05 09:37:42 UTC 58,805 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkaem_maven_archetype=self.webpackChunkaem_maven_archetype||[]).push([["components-dynamic-media-handler-DynamicMediaHandler-js","components-dynamic-media-handler-js-renditions-js","components-htmlinjection-js-injectionHandler-js","components-immersivehero-immersivehero-js","components-immersivehero-js-constants-js","components-mapcomponent-js-filter-js","components-modal-Modal-js","components-popup-modal-popup-modal-js","components-vehicleavailability-sections-vehicleavailability-section-js","components-vehiclecomparerulesengine-js-api-js"],{78777:function(e,t,n){n.d(t,{A:function(){return m}});var o=n(2048),r=n(56094),i=n(61799),a=["frame","vehicle","scale","scaleToFit"];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},l(e)}function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,o)}return n}function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach(function(t){d(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function u(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,f(o.key),o)}}function d(e,t,n){return(t=f(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function f(e){var t=function(e,t){if("object"!=l(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=l(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==l(t)?t:t+""}var m=function(){return e=function e(t,n){var o;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),d(this,"rootElement",void 0),d(this,"apiKey",void 0),d(this,"activeCplayer",void 0),d(this,"outgoingCplayer",void 0),d(this,"cplayerInstance",void 0),d(this,"emitter",new i.n),d(this,"pendingActiveFrame",void 0),this.rootElement=t,null!==(o=this.rootElement)&&void 0!==o&&o.cplayer)return this.rootElement.cplayer;this.rootElement.classList.add("DxCPlayer"),this.apiKey=n.apiKey,this.activeCplayer=this.rootElement.querySelector(".DxCPlayer__active"),this.outgoingCplayer=this.rootElement.querySelector(".DxCPlayer__outgoing"),this.rootElement.cplayer=this},t=[{key:"render",value:function(e){var t=c({view:"exterior",useBackground:!1},e);this.outgoingCplayer||(this.outgoingCplayer=this.createElementWithClass("DxCPlayer__outgoing",!!t.useBackground)),this.activeCplayer||(this.activeCplayer=this.createElementWithClass("DxCPlayer__active",!!t.useBackground)),this.renderCplayer(t)}},{key:"on",value:function(e,t){return this.emitter.on(e,t),this}},{key:"off",value:function(e,t){return this.emitter.off(e,t),this}},{key:"removePreviousCplayer",value:function(){this.activeCplayer&&this.activeCplayer.querySelectorAll(".CPlayer__innerdiv").forEach(function(e,t){0!==t&&e.remove()})}},{key:"handleCPlayerRenderComplete",value:function(){this.outgoingCplayer&&this.activeCplayer&&(this.outgoingCplayer.style.removeProperty("transition"),this.activeCplayer.style.opacity="1",this.outgoingCplayer.style.opacity="0",this.setContainerActiveFrame(this.activeCplayer,this.pendingActiveFrame),this.removePreviousCplayer())}},{key:"handleCPlayerImageChange",value:function(){this.activeCplayer&&this.outgoingCplayer&&((0,r.eN)(this.activeCplayer,this.outgoingCplayer),this.setContainerActiveFrame(this.outgoingCplayer,this.activeCplayer.getAttribute("data-active-frame")),this.activeCplayer.style.opacity="0",this.outgoingCplayer.style.transition="none",this.outgoingCplayer.style.opacity="1")}},{key:"renderCplayer",value:function(e){var t=this,n=e.frame,r=e.vehicle,i=e.scale,l=e.scaleToFit,s=function(e,t){if(null==e)return{};var n,o,r=function(e,t){if(null==e)return{};var n={};for(var o in e)if({}.hasOwnProperty.call(e,o)){if(-1!==t.indexOf(o))continue;n[o]=e[o]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)n=i[o],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}(e,a);this.pendingActiveFrame=this.getActiveFrame(e);var u=c({currentFrame:n,frames:[n],frame:n+1,layout:"desktop",rcDoc:r},s),d={apiKey:this.apiKey,onRenderCompleteCallback:function(){var n;t.handleCPlayerRenderComplete(),t.emitter.emit("renderComplete",{cplayer:t}),null===(n=e.onRenderCompleteCallback)||void 0===n||n.call(e)}};void 0===i||Number.isNaN(i)||(d.scale=i),void 0!==l&&(d.scaleToFit=l),this.handleCPlayerImageChange(),this.cplayerInstance=this.cplayerInstance||new o.A(this.activeCplayer,d),this.cplayerInstance.renderFrame(u)}},{key:"getActiveFrame",value:function(e){var t=e.frame,n=e.view;return"".concat(void 0===n?"exterior":n,"-").concat(t)}},{key:"setContainerActiveFrame",value:function(e,t){t?e.setAttribute("data-active-frame",t):e.removeAttribute("data-active-frame")}},{key:"createElementWithClass",value:function(e,t){var n=document.createElement("div");return n.classList.add(e),t&&n.classList.add("".concat(e,"--withBackgroun
1d")),this.rootElement.prepend(n),n}}],t&&u(e.prototype,t),n&&u(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n}()},10329:function(e,t,n){n.d(t,{A:function(){return f}});var o=n(12285);function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,o)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach(function(t){s(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function l(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,c(o.key),o)}}function s(e,t,n){return(t=c(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e){var t=function(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==r(t)?t:t+""}var u="DxPlayPause::click",d="DxPlayPause::complete",f=function(){return e=function e(t,n){var o=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),s(this,"mountElement",void 0),s(this,"defaults",void 0),s(this,"options",void 0),s(this,"isPlaying",void 0),s(this,"element",void 0),s(this,"controlButton",void 0),s(this,"playIcon",void 0),s(this,"pauseIcon",void 0),s(this,"countdownControl",void 0),s(this,"countdownAnimation",void 0),s(this,"startCountdown",function(){if(o.isPlaying&&o.countdownControl&&document.body.contains(o.countdownControl))try{if(0===o.countdownControl.getClientRects().length)return;var e=o.countdownControl.getTotalLength();o.countdownControl.classList.add("DxPlayPause__border--countdown"),o.countdownControl.style.strokeDasharray=e.toString();var t=e.toString();requestAnimationFrame(function(){var e,n,r;o.countdownControl.style.strokeDashoffset="0",o.countdownControl.style.opacity="1",o.countdownAnimation?o.countdownAnimation.play():(n=[{strokeDashoffset:"0",opacity:1,offset:0},{strokeDashoffset:t,opacity:1,offset:.99},{strokeDashoffset:t,opacity:0,offset:1}],r={duration:1e3*(null!==(e=o.options.duration)&&void 0!==e?e:0),easing:"linear",fill:"forwards"},o.countdownAnimation=o.countdownControl.animate(n,r),o.countdownAnimation&&(o.countdownAnimation.pause(),o.countdownAnimation.onfinish=function(){o.countdownControl.style.opacity="0",o.countdownAnimation=null,o.element.dispatchEvent(new CustomEvent(d,{detail:{instance:o}})),o.animationComplete()},o.countdownAnimation.play()))})}catch(e){console.error(e)}}),this.mountElement=t,this.defaults={autoplay:!0,duration:null,loop:!0,theme:"light",playLabel:"Play",pauseLabel:"Pause",pausedLabel:"Paused",playingLabel:"Playing"},this.options=a(a({},this.defaults),n),this.init()},t=[{key:"init",value:function(){var e;this.isPlaying=null===(e=this.options.autoplay)||void 0===e||e,this.element=this.buildElement(),this.mountElement.appendChild(this.element),this.handleIconVisibility(),this.options.duration&&this.options.duration>0&&this.startCountdown()}},{key:"setDuration",value:function(e){this.options.duration=e,this.restartCountdown()}},{key:"clearCountdownAnimation",value:function(){this.countdownAnimation&&(this.countdownAnimation.pause(),this.countdownAnimation=null),this.countdownControl&&(this.countdownControl.style.opacity="0")}},{key:"restartCountdown",value:function(){this.clearCountdownAnimation(),!this.options.duration||this.options.duration<=0||!this.isPlaying||this.startCountdown()}},{key:"resumeCountdown",value:function(){!this.options.duration||this.options.duration<=0||(this.isPlaying=!0,this.handleIconVisibility(),this.restartCountdown())}},{key:"buildElement",value:function(){var e=(0,o.Kp)("div",["DxPlayPause","DxPlayPause--".concat(this.options.theme)],{"data-animating":Boolean(this.options.autoplay).toString()}),t=(0,o.Kp)("button");t.type="button",this.controlButton=t;var n=(0,o.Kp)("div",["DxPlayPause__playButton","icon-play-v2"]),r=(0,o.Kp)("div",["DxPlayPause__pauseButton","icon-pause"]);t.appendChild(n),t.appendChild(r),this.playIcon=n,this.pauseIcon=r;var i=document.createElementNS("http://www.w3.org/2000/svg","svg");return i.classList.add("DxPlayPause__wrapper"),i.setAttribute("aria-hidden","true"),this.countdownControl
1=document.createElementNS("http://www.w3.org/2000/svg","circle"),this.countdownControl.classList.add("DxPlayPause__border"),this.countdownControl.setAttribute("r","20"),this.countdownControl.setAttribute("cx","21"),this.countdownControl.setAttribute("cy","21"),i.appendChild(this.countdownControl),t.appendChild(i),e.appendChild(t),t.addEventListener("click",this.onClick.bind(this)),e}},{key:"on",value:function(e,t,n){this.element.addEventListener("DxPlayPause::".concat(e),t,n)}},{key:"onClick",value:function(){this.togglePlayState();var e=this.isPlaying?"playing":"paused";this.element.dispatchEvent(new CustomEvent(u,{detail:{instance:this,playState:e}}))}},{key:"toggleHidden",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;null!==e?this.element.classList.toggle("DxPlayPause--hidden",e):this.element.classList.toggle("DxPlayPause--hidden")}},{key:"getAriaLabel",value:function(){var e=this.isPlaying?this.options.pauseLabel:this.options.playLabel,t=this.isPlaying?this.options.playingLabel:this.options.pausedLabel;if(e)return t?"".concat(t,", ").concat(e):e}},{key:"handleIconVisibility",value:function(){this.isPlaying?(this.pauseIcon.style.opacity="1",this.playIcon.style.opacity="0",this.controlButton.setAttribute("aria-label","".concat(this.options.playingLabel,", ").concat(this.options.pauseLabel))):(this.pauseIcon.style.opacity="0",this.playIcon.style.opacity="1",this.controlButton.setAttribute("aria-label","".concat(this.options.pausedLabel,", ").concat(this.options.playLabel)));var e=this.getAriaLabel();e?this.controlButton.setAttribute("aria-label",e):this.controlButton.removeAttribute("aria-label")}},{key:"animationComplete",value:function(){this.options.loop&&this.startCountdown()}},{key:"pauseCountdown",value:function(){this.isPlaying=!1,this.countdownAnimation&&this.countdownAnimation.pause()}},{key:"playCountdown",value:function(){this.isPlaying=!0,this.countdownAnimation&&this.countdownAnimation.play()}},{key:"stopCountdown",value:function(){this.isPlaying=!1,this.clearCountdownAnimation()}},{key:"togglePlayState",value:function(e){this.isPlaying=null!=e?e:!this.isPlaying,this.handleIconVisibility(),this.isPlaying?this.countdownAnimation?this.countdownAnimation.play():this.startCountdown():this.pauseCountdown()}},{key:"destroy",value:function(){this.stopCountdown(),this.element.remove()}}],t&&l(e.prototype,t),n&&l(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n}()},61799:function(e,t,n){function o(e){return o="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},o(e)}function r(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,i(o.key),o)}}function i(e){var t=function(e,t){if("object"!=o(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==o(t)?t:t+""}n.d(t,{n:function(){return a}});var a=function(){return e=function e(){var t,n,o;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t=this,n="events",o=new Map,(n=i(n))in t?Object.defineProperty(t,n,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[n]=o},(t=[{key:"on",value:function(e,t){this.events.has(e)||this.events.set(e,new Set);var n=this.events.get(e);return n&&n.add(t),this}},{key:"off",value:function(e,t){if(!this.events.has(e))return this;var n=this.events.get(e);return t?null==n||n.delete(t):null==n||n.clear(),0===(null==n?void 0:n.size)&&this.events.delete(e),this}},{key:"emit",value:function(e,t){if(this.events.has(e)){var n=this.events.get(e);null==n||n.forEach(function(n){try{n(t)}catch(t){console.error("Error in event handler for ".concat(e),t)}})}}},{key:"hasEvent",value:function(e){var t=this.events.get(e);return!(!this.events.has(e)||!t)&&t.size>0}}
1,{key:"getEventCount",value:function(e){var t,n;return null!==(t=null===(n=this.events.get(e))||void 0===n?void 0:n.size)&&void 0!==t?t:0}},{key:"removeAllListeners",value:function(){this.events.clear()}}])&&r(e.prototype,t),n&&r(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n}()},53642:function(e,t,n){function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,o)}return n}function r(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach(function(t){i(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function i(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=a(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=a(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==a(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}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},a(e)}function l(e,t){var n=null;return function(){for(var o=arguments.length,r=new Array(o),i=0;i<o;i++)r[i]=arguments[i];var a=this;null!==n&&clearTimeout(n),n=setTimeout(function(){n=null,e.apply(a,r)},t)}}function s(e){return new Promise(function(t){return setTimeout(t,e)})}function c(e,t,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"horizontal";return new Promise(function(r){var i,a=e===window,l="horizontal"===o?"scrollLeft":"scrollTop";i=a?"horizontal"===o?window.scrollX:window.scrollY:e[l];var s=function(t){if(a){var n="horizontal"===o?t:window.scrollX,r="vertical"===o?t:window.scrollY;window.scrollTo({top:r,left:n,behavior:"smooth"})}else e[l]=t};if(n<=0)return s(t),r();var c=t-i,u=performance.now();var d=function(e){var t,o=e-u,a=Math.min(o/n,1),l=(t=a)<.5?2*t*t:(4-2*t)*t-1;s(i+c*l),a<1?requestAnimationFrame(d):r()};requestAnimationFrame(d)})}function u(e,t){var n=null,o=function(){n&&clearTimeout(n),n=window.setTimeout(function(){e.removeEventListener("scroll",o),t()},100)};e.addEventListener("scroll",o)}function d(e){return null!==e&&"object"===a(e)&&!Array.isArray(e)&&"[object Object]"===Object.prototype.toString.call(e)}function f(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];if(!n.length)return r({},e);var i=r({},e),a=n.shift();if(d(i)&&d(a))for(var l in a)if(Object.prototype.hasOwnProperty.call(a,l)){var s=a[l];d(s)&&d(i[l])?i[l]=f(i[l],s):i[l]=s}return f.apply(void 0,[i].concat(n))}function m(e){return e.replace(/<\/?[^>]+(>|$)/g,"")}function p(e,t,n){return e<t?t:e>n?n:e}n.d(t,{$J:function(){return m},$N:function(){return f},BD:function(){return c},IJ:function(){return u},cb:function(){return s},qE:function(){return p},sg:function(){return l}})},13442:function(e,t,n){function o(e){return o="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},o(e)}function r(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,i(o.key),o)}}function i(e){var t=function(e,t){if("object"!=o(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==o(t)?t:t+""}n.r(t),n.d(t,{default:function(){return a}});var a=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.element=t,this.options=n,this.options.src&&this.options.renditions&&(this.renditions=e.renditionsToArray(this.options.renditions),this.currentUrl=this.options.src,this.maxSrc=this.getMaxSrc(),this.init())}return t=e,o=[{key:"renditionsToArray",value:function(e){return e.split(",").map(function(e){return Number(e)}).sort(function(e,t){return e-t})}},{key:"getDelimiter",value:function(e){return e.includes("?")?"&":"?"}},{key:"constructRenditionUrl",value:function(e,t){try{var n=new URL(e,document.baseURI);return n.searchParams.set("wid",t),n.searchParams.set("fit","stretch,1"),n.toString()}catch(t){return e}}}],(n=[{key:"init",value:function(){var e=this;new ResizeObserver(function(t){var n=t[0],o=e.buildSrc(n.target);o!==e.currentUrl&&(e.currentUrl=o,"VIDEO"===n.target.tagName?n.target.poster=e.currentUrl:e.options.background?n.target.style.backgroundImage="url(".concat(e.currentUrl,")"):n.target.src=e.currentUrl)}).observe(this.element)}},{key:"findFirstHigherIndex",value:function(e){return this.renditions.findIndex(function(t){return t>=e})}},{key:"getUrlSrc",value:function(e){var t=this.options.overrideSmallSrc,n=this.options.overrideSmallSize;return!t||!n||e>Number(n)?this.options.src:t}},{key:"buildSrc",value:function(t){var n=t.getBoundingClientRect(),o=this.findFirstHigherIndex(n.width),r="";if(-1===o)r=this.maxSrc;else{var i=this.renditions[o],a=this.getUrlSrc(n.width);r=e.constructRenditionUrl(a,i)}return r}},{key:"getMaxSrc",value:function(){return e.constructRenditionUrl(this.options.src,this.renditions.at(-1))}}
1])&&r(t.prototype,n),o&&r(t,o),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,o}()},73474:function(e,t,n){n.r(t),n.d(t,{RENDITIONS:function(){return o}});var o={accolades:{image:"260,460",background:"480,740,900,1280,1460,1660"},contentcard:"480,680",dualframecarousel:"480,740,900,1280",fullframecarousel:"480,740,900,1280,1660",gallerycategories:{landscape:"480,740,900,1280,1460,1660,2000"},gallerylist:{image:"480,740,900,1280,1460,1660,2000",video:"480,740,900,1280",thumbnail:"200"},heroitem:"480,740,900,1280,1660",herotitle:"480,740,900,1280,1660",signpost:"480,740",immersivehero:"1280,1660",masonrymedia:{support:"200,420,600",narrow:"0,240,360",main:"400,600,900"},preferredretailersignpost:"720,650,340",retailorLocator:"720,650,340"}},90800:function(e,t,n){n.r(t),n.d(t,{default:function(){return W}});var o=n(10329),r=n(68469),i=n(78777),a=n(95841),l=n(11968),s=n(13442),c=n(73474),u=n(99686),d=n(26016),f=n(37380),m=n(40443),p=n(16786),v=n(26587),h=n(70963),y=n(15085),g=n(34283),b=n(23790),w=n(27300),P=n(53642),C=["enabled"];function S(e){return S="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},S(e)}function k(){var e,t,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",r=n.toStringTag||"@@toStringTag";function i(n,o,r,i){var s=o&&o.prototype instanceof l?o:l,c=Object.create(s.prototype);return _(c,"_invoke",function(n,o,r){var i,l,s,c=0,u=r||[],d=!1,f={p:0,n:0,v:e,a:m,f:m.bind(e,4),d:function(t,n){return i=t,l=0,s=e,f.n=n,a}};function m(n,o){for(l=n,s=o,t=0;!d&&c&&!r&&t<u.length;t++){var r,i=u[t],m=f.p,p=i[2];n>3?(r=p===o)&&(s=i[(l=i[4])?5:(l=3,3)],i[4]=i[5]=e):i[0]<=m&&((r=n<2&&m<i[1])?(l=0,f.v=o,f.n=i[1]):m<p&&(r=n<3||i[0]>o||o>p)&&(i[4]=n,i[5]=o,f.n=p,l=0))}if(r||n>1)return a;throw d=!0,o}return function(r,u,p){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&m(u,p),l=u,s=p;(t=l<2?e:s)||!d;){i||(l?l<3?(l>1&&(f.n=-1),m(l,s)):f.n=s:f.v=s);try{if(c=2,i){if(l||(r="next"),t=i[r]){if(!(t=t.call(i,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,l<2&&(l=0)}else 1===l&&(t=i.return)&&t.call(i),l<2&&(s=TypeError("The iterator does not provide a '"+r+"' method"),l=1);i=e}else if((t=(d=f.n<0)?s:n.call(o,f))!==a)break}catch(t){i=e,l=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,r,i),!0),c}var a={};function l(){}function s(){}function c(){}t=Object.getPrototypeOf;var u=[][o]?t(t([][o]())):(_(t={},o,function(){return this}),t),d=c.prototype=l.prototype=Object.create(u);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,_(e,r,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,_(d,"constructor",c),_(c,"constructor",s),s.displayName="GeneratorFunction",_(c,r,"GeneratorFunction"),_(d),_(d,r,"Generator"),_(d,o,function(){return this}),_(d,"toString",function(){return"[object Generator]"}),(k=function(){return{w:i,m:f}})()}function _(e,t,n,o){var r=Object.defineProperty;try{r({},"",{})}catch(e){r=0}_=function(e,t,n,o){if(t)r?r(e,t,{value:n,enumerable:!o,configurable:!o,writable:!o}):e[t]=n;else{var i=function(t,n){_(e,t,function(e){return this._invoke(t,n,e)})};i("next",0),i("throw",1),i("return",2)}},_(e,t,n,o)}function E(e,t,n,o,r,i,a){try{var l=e[i](a),s=l.value}catch(e){return void n(e)}l.done?t(s):Promise.resolve(s).then(o,r)}function A(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,j(o.key),o)}}function O(e,t,n){return(t=j(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function j(e){var t=function(e,t){if("object"!=S(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=S(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==S(t)?t:t+""}var I={"desktop-xl":260,desktop:120,tablet:60,mobile:50},L=function(){function e(t){var n=this,o=t.element,r=t.getTarget,i=t.onStart,a=t.onEnd;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),O(this,"element",void 0),O(this,"getTarget",void 0),O(this,"onStart",void 0),O(this,"onEnd",void 0),O(this,"controller",null),O(this,"handleResize",(0,P.sg)(function(){n.run()},100)),this.element=o,this.getTarget=r,this.onStart=i,this.onEnd=a,window.addEventListener("resize",this.handleResize)}return t=e,n=[{key:"getFromScale",value:function(){var e=window.innerWidth;return(e-I[(0,b.m)()])/e}},{key:"run",value:(r=k().m(function e(){var t,n,o,r,i=this;return k().w(function(e){for(;;)switch(e.n){case 0:if(t=this.getTarget()){e.n=1;break}return e.a(2);case 1:if(n=this.getFromScale(),this.controller){e.n=3;break}return e.n=2,(0,w.n)({target:t,trigger:this.element,fromScale:n,toScale:1,end:"center 65%",onStart:this.onStart,onEnd:this.onEnd});case 2:return o=e.v,r=o.controller,this.controller=r,e.a(2);case 3:this.controller.setFrom(function(){return{scale:i.getFromScale()}});case 4:return e.a(2)}},e,this)}),i=function(){var e=this,t=arguments;return new Promise(function(n,o){var i=r.apply(e,t);function a(e){E(i,n,o,a,l,"next",e)}function l(e){E(i,n,o,a,l,"throw",e)}a(void 0)})},function(){return i.apply(this,arguments)})},{key:"destroy",value:function(){var e;window.removeEventListener("resize",this.handleResize),null===(e=this.controller)||void 0===e||e.destroy(),this.controller=null}}],o=[{key:"create",value:function(t){var n=t.enabled,o=function(e,t){if(null==e)return{};var n,o,r=function(e,t){if(null==e)return{};var n={};for(var o in e)if({}.hasOwnProperty.call(e,o)){if(-1!==t.indexOf(o))continue;n[o]=e[o]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)n=i[o],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}(t,C);return n?new e(o):null}}
1],n&&A(t.prototype,n),o&&A(t,o),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,o,r,i}();function T(e){return T="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},T(e)}function D(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,o)}return n}function x(e,t,n){return(t=N(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function R(){var e,t,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",r=n.toStringTag||"@@toStringTag";function i(n,o,r,i){var s=o&&o.prototype instanceof l?o:l,c=Object.create(s.prototype);return H(c,"_invoke",function(n,o,r){var i,l,s,c=0,u=r||[],d=!1,f={p:0,n:0,v:e,a:m,f:m.bind(e,4),d:function(t,n){return i=t,l=0,s=e,f.n=n,a}};function m(n,o){for(l=n,s=o,t=0;!d&&c&&!r&&t<u.length;t++){var r,i=u[t],m=f.p,p=i[2];n>3?(r=p===o)&&(s=i[(l=i[4])?5:(l=3,3)],i[4]=i[5]=e):i[0]<=m&&((r=n<2&&m<i[1])?(l=0,f.v=o,f.n=i[1]):m<p&&(r=n<3||i[0]>o||o>p)&&(i[4]=n,i[5]=o,f.n=p,l=0))}if(r||n>1)return a;throw d=!0,o}return function(r,u,p){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&m(u,p),l=u,s=p;(t=l<2?e:s)||!d;){i||(l?l<3?(l>1&&(f.n=-1),m(l,s)):f.n=s:f.v=s);try{if(c=2,i){if(l||(r="next"),t=i[r]){if(!(t=t.call(i,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,l<2&&(l=0)}else 1===l&&(t=i.return)&&t.call(i),l<2&&(s=TypeError("The iterator does not provide a '"+r+"' method"),l=1);i=e}else if((t=(d=f.n<0)?s:n.call(o,f))!==a)break}catch(t){i=e,l=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,r,i),!0),c}var a={};function l(){}function s(){}function c(){}t=Object.getPrototypeOf;var u=[][o]?t(t([][o]())):(H(t={},o,function(){return this}),t),d=c.prototype=l.prototype=Object.create(u);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,H(e,r,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,H(d,"constructor",c),H(c,"constructor",s),s.displayName="GeneratorFunction",H(c,r,"GeneratorFunction"),H(d),H(d,r,"Generator"),H(d,o,function(){return this}),H(d,"toString",function(){return"[object Generator]"}),(R=function(){return{w:i,m:f}})()}function H(e,t,n,o){var r=Object.defineProperty;try{r({},"",{})}catch(e){r=0}H=function(e,t,n,o){if(t)r?r(e,t,{value:n,enumerable:!o,configurable:!o,writable:!o}):e[t]=n;else{var i=function(t,n){H(e,t,function(e){return this._invoke(t,n,e)})};i("next",0),i("throw",1),i("return",2)}},H(e,t,n,o)}function q(e,t,n,o,r,i,a){try{var l=e[i](a),s=l.value}catch(e){return void n(e)}l.done?t(s):Promise.resolve(s).then(o,r)}function M(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)||function(e,t){if(e){if("string"==typeof e)return F(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?F(e,t):void 0}}(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 F(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n<t;n++)o[n]=e[n];return o}function U(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,N(o.key),o)}}function N(e){var t=function(e,t){if("object"!=T(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=T(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==T(t)?t:t+""}function B(e,t){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.add(e)}
1function V(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}var K="bookTestDrive",z="sendToRetailer",G=new WeakSet,W=function(){return e=function e(t){var n,o,i,a,l,s,c;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),B(this,G),this.el=t,this.brand=t.dataset.brand,this.configuratorBaseUrl=t.dataset.configuratorBaseUrl,this.pdfBaseUrl=t.dataset.pdfBaseUrl,this.immersiveHero=t.querySelector(".ImmersiveHero"),this.pipeFields=t.querySelectorAll(".ImmersiveHero--uses-pipes"),this.watchLinks=t.querySelectorAll('.ImmersiveHero__cta-link[data-target="youtube"]'),this.checkStockCtas=t.querySelectorAll('.ImmersiveHero__cta-link[data-target="pageEvent"]'),this.scrollButton=t.querySelector(".ImmersiveHero__scroll-button"),this.assetType=t.getAttribute("data-asset-type"),this.background=t.querySelector(".ImmersiveHero__background"),this.videoElement=t.querySelector(".ImmersiveHero__background-video"),this.videoContainer=t.querySelector(".ImmersiveHero__background-video-container"),this.pictureElement=t.querySelector(".ImmersiveHero__background-image"),this.headerSection=t.querySelector(".ImmersiveHero__header-section"),this.configPrompt=t.querySelector(".ImmersiveHero__config-prompt"),this.configPromptAbandoned=t.querySelector(".ImmersiveHero__config-prompt-abandoned"),this.configPromptCompleted=t.querySelector(".ImmersiveHero__config-prompt-completed"),this.configPromptCaveatWrapper=t.querySelector(".ImmersiveHero__caveat"),this.configPromptCaveat=t.querySelector("#ConfigPromptCaveat"),this.backgroundImage=null===(n=this.pictureElement)||void 0===n?void 0:n.querySelector("img"),this.isMobile=window.innerWidth<768,this.enableConfigPrompt="true"===t.dataset.configPromptEnabled,this.configPromptLoaded=!1,this.unloadSkeletonTimeout=null,this.contentSkeleton=new r.A({target:this.el.querySelector(".ImmersiveHero__content-skeleton"),swapTarget:this.el.querySelector(".ImmersiveHero__header-section"),manualMode:!0}),this.configPromptSkeleton=new r.A({target:this.el.querySelector(".ImmersiveHero__content-skeleton"),swapTarget:this.el.querySelector(".ImmersiveHero__config-prompt"),manualMode:!0}),this.caveatSkeleton=new r.A({target:this.el.querySelector(".ImmersiveHero__caveat-skeleton"),swapTarget:this.el.querySelector(".ImmersiveHero__caveat-inner"),manualMode:!0}),this.configPromptCaveatSymbol=t.dataset.configPromptCaveatSymbol,this.configPromptCaveatDisclaimer=t.dataset.configPromptCaveatDisclaimer,this.handleMediaReady=V(G,this,Y).bind(this),this.checkVideoReadyState=this.checkVideoReadyState.bind(this),this.nameplateRestrictions=null===(o=t.dataset)||void 0===o?void 0:o.nameplateRestrictions,this.bodystyleRestriction=null===(i=t.dataset)||void 0===i?void 0:i.bodystyleRestriction,this.locale=null===(a=t.dataset)||void 0===a?void 0:a.locale,this.configPromptRemovalLabel=null===(l=t.dataset)||void 0===l?void 0:l.configPromptRemovalLabel,this.mlpxBaseUrl=null===(s=t.dataset)||void 0===s?void 0:s.mlpxBaseUrl,this.rulesEngineApiBaseUrl=null===(c=t.dataset)||void 0===c?void 0:c.rulesEngineApiBaseUrl,this.analytics=g.j.init("ImmersiveHero"),this.playLabel=this.el.dataset.labelPlay,this.pauseLabel=this.el.dataset.labelPause,this.imageExpansion=V(G,this,J).call(this),this.init(),this.setupRenditions()},t=[{key:"setupRenditions",value:function(){var e=this;if(M(this.el.querySelectorAll('[data-dynamic-renditions-enabled="true"]')).forEach(function(t){if("SOURCE"!==t.tagName){var n={src:t.dataset.src,renditions:c.RENDITIONS.immersivehero};new s.default(t,n)}else t.srcset=e.constructRenditionUrl(t.dataset.src,1280)}),this.videoContainer){var t=this.videoContainer.dataset,n=t.posterDesktopSrc,o=t.posterMobileSrc,r=t.dynamicRenditionsEnabledPosterDekstop,i=t.dynamicRenditionsEnabledPosterMobile;"true"===r&&this.videoContainer.style.setProperty("--_desktop-poster","url(".concat(this.constructRenditionUrl(n,1660),")")),"true"===i&&this.videoContainer.style.setProperty("--_mobile-poster","url(".concat(this.constructRenditionUrl(o,1280),")"))}}},{key:"constructRenditionUrl",value:function(e,t){try{var n=new URL(e,document.baseURI);return n.searchParams.set("wid",t),n.searchParams.set("fit","stretch,1"),n.toString()}catch(t){return e}}},{key:"getMlpxUrl",value:function(e){var t=e["feature-dictionary"].vehicle.href.split("?")[0],n=new URLSearchParams({configUrl:this.rulesEngineApiBaseUrl+t,locale:this.locale,market:e.metadata.meta.Market,returnSiteName:"DX",returnSitePath:window.location.href,vehicleLineProgrammeCode:e["feature-dictionary"].vehicle.property.JLRProgrammeCode}),o=e["feature-dictionary"].vehicle.property.BrandFamily;if(o){var r=o.replace(/_/g,""),i=this.mlpxBaseUrl.replace("{MARKET}",r);return"".concat(i,"?").concat(n.toString())}}},{key:"setMlpxCtaLinks",value:function(e){if(this.mlpxBaseUrl){var t=this.getMlpxUrl(e);t&&this.configPrompt.querySelectorAll(".ImmersiveHero__config-prompt-mlpx").forEach(function(e){e.href=t})}}},{key:"init",value:function(){var e,t=this;this.bindEvents(),this.initConfigPrompt(),null===(e=this.pipeFields)||void 0===e||e.forEach(function(e){return t.convertPipes(e)}),"video"===this.assetType?this.setVideoTitle():this.setImageAlt()}},{key:"initConfigPrompt",value:(b=R().m(function e(){var t,n,o,r,i,a,l,s;return R().w(function(e){for(;;)switch(e.n){case 0:if(this.enableConfigPrompt){e.n=1;break}return this.disableConfigPrompt(),e.a(2);case 1:return this.rcAPI=null!==(t=window.RCApi)&&void 0!==t?t:window.RCApi=f.A,this.rcAPI.configBaseUrl=this.configuratorBaseUrl,e.n=2,(0,y.extractSavedBuild)(this.nameplateRestrictions,this.locale,{bodystyle:this.bodystyleRestriction,rcAPI:this.rcAPI});case 2:if(n=e.v,this.enableConfigPrompt&&n){e.n=3;break}return this.disableConfigPrompt(),e.a(2);case 3:try{i=JSON.parse(null==n?void 0:n.value),(o=null==i?void 0:i.url)&&this.checkStockCtas.forEach(function(e){e.dataset.vehicleUrl=o}),r=i.onSummary}catch(e){console.error("Error parsing saved build JSON:",e)}if(o){e.n=4;break}return this.disableConfigPrompt(),e.a(2);case 4:return e.p=4,a=this.rcAPI.stripModelYearFromURL([o]),e.n=5,this.rcAPI.loadJsonp(a);case 5:l=e.v,this.renderConfigPrompt(l,r,n),e.n=7;break;case 6:e.p=6,s=e.v,console.error(s),this.disableConfigPrompt();case 7:return e.a(2)}},e,this,[[4,6]])}),w=function(){var e=this,t=arguments;return new Promise(function(n,o){var r=b.apply(e,t);function i(e){q(r,n,o,i,a,"next",e)}function a(e){q(r,n,o,i,a,"throw",e)}i(void 0)})},function(){return w.apply(this,arguments)})},{key:"renderConfigPrompt",value:function(e,t,n){var o;this.configPromptCPlayer(e);var r=m.A.getSelectedFeature("MODEL",e),i=m.A.getFeature("EXTERIOR",e),a=m.A.getFeature("PAINT",i),l=null!==(o=m.A.getSelectedFeature("PAINT_COLOUR",a))&&void 0!==o?o:this.rcAPI.getSelectedFeature("PAINT_COLOUR",e),s=m.A.getGrossPrice(e),c=(0,p.A)(null==s?void 0:s.value,e.metadata.meta["currency-format"]),u=this.configPromptCompleted.querySelector(".ImmersiveHero__config-prompt-book-test-drive"),d=this.configPromptCompleted.querySelector(".ImmersiveHero__config-prompt-send-to-retailer"),f=this.configPromptAbandoned.querySelector(".ImmersiveHero__config-prompt-finish-your-build");if(t?(this.renderConfigPromptSubHeader(this.configPromptCompleted,r,l),this.renderConfigPromptPrice(this.configPromptCompleted,c,null==s?void 0:s.value),this.configPromptCompleted.hidden=!1,u&&this.generateForm(u,e,K),d&&this.generateForm(d,e,z)):(this.renderConfigPromptSubHeader(this.configPromptAbandoned,r,l),this.renderConfigPromptPrice(this.configPromptAbandoned,c,null==s?void 0:s.value),this.configPromptAbandoned.hidden=!1,f&&(f.href=this.rcAPI.getVehicleURL(e))),this.setMlpxCtaLinks(e),this.headerSection.hidden=!0,this.configPrompt.hidden=!1,this.configPromptLoaded=!0,this.configPromptCaveat.
1innerHTML="",this.configPromptCaveatSymbol&&!this.configPromptCaveatDisclaimer){var v=this.rcAPI.getDisclaimerCaveat(this.configPromptCaveatSymbol);this.configPromptCaveat.innerHTML=v}else this.configPromptCaveatDisclaimer&&(this.configPromptCaveat.innerHTML=this.configPromptCaveatDisclaimer);var h,g=this.configPromptRemovalLabel;g&&(null===(h=this.configPromptCaveatWrapper)||void 0===h||h.appendChild((0,y.buildReminderRemovalButton)(g,n.key,n.value))),this.handleCaveatVisibility(),V(G,this,$).call(this)}},{key:"generateForm",value:function(e,t,n){this.generateFormInputs(t,n).filter(function(e){return e}).forEach(function(t){e.appendChild(t)}),this.openFormInDrawer(e)}},{key:"getPdfUrl",value:function(e){var t=h.Uc[this.brand].replace(" ","").toLowerCase(),n=this.rcAPI.getPdfUrl(e);return n&&this.pdfBaseUrl&&t?"".concat(this.pdfBaseUrl).concat(n).concat(t,".pdf"):null}},{key:"getBookTestDriveFormInputs",value:function(e){var t,n=this.rcAPI.getVehicleURL(e),o=this.getPdfUrl(e),r=m.A.getVehicleDetails(e),i=m.A.getDescription(null==r?void 0:r.description);return[{name:"brand",value:h.Uc[this.brand].replace(" ","")},{name:"directLink",value:n},{name:"environment",value:null==e||null===(t=e.metadata)||void 0===t||null===(t=t.meta)||void 0===t?void 0:t.Environment},{name:"modelLine",value:"".concat(null==r?void 0:r.id,"|").concat(i)},{name:"modelYear",value:null==r?void 0:r.modelyear},{name:"nameplate",value:i},{name:"nameplateId",value:null==r?void 0:r.id},{name:"source",value:"configPrompt"},{name:"pdfUrl",value:o}]}},{key:"getSendToRetailerFormInputs",value:function(e){var t,n=this.rcAPI.getVehicleURL(e),o=m.A.getVehicleDetails(e),r=m.A.getDescription(null==o?void 0:o.description);return[{name:"configBrand",value:h.Uc[this.brand].replace(" ","")},{name:"configDirectLink",value:n},{name:"environment",value:null==e||null===(t=e.metadata)||void 0===t||null===(t=t.meta)||void 0===t?void 0:t.Environment},{name:"configModelYear",value:null==o?void 0:o.modelyear},{name:"configNameplate",value:r},{name:"configNameplateId",value:null==o?void 0:o.id},{name:"source",value:"configPrompt"},{name:"configModelLine",value:"".concat(null==o?void 0:o.id,"|").concat(r)},{name:"configEngine",value:(0,y.extractProductDetails)({vehicle:e},"ENGINE")},{name:"configDerivative",value:(0,y.extractProductDetails)({vehicle:e},"PRODUCT")},{name:"configDPackCode",value:(0,y.extractPackCode)({vehicle:e})},{name:"configExteriorColor",value:(0,y.extractExteriorDetails)(e)},{name:"configInteriorColor",value:(0,y.extractInteriorDetails)({vehicle:e})}].concat(M((0,y.extractOptions)(e).map(function(e){var t,n;return{name:"configOptions",value:"".concat(null!==(t=e.id)&&void 0!==t?t:""," | ").concat(null!==(n=m.A.getDescription(e.description))&&void 0!==n?n:""," | N/A")}})),[{name:"configPrice",value:(0,y.extractPricingDetails)((0,y.extractPrice)({vehicle:e}))}])}},{key:"getFormInputs",value:function(e,t){return t===K?this.getBookTestDriveFormInputs(e):t===z?this.get
1SendToRetailerFormInputs(e):void 0}},{key:"generateFormInputs",value:function(e,t){var n=this,o=this.getFormInputs(e,t),r=[];return o.forEach(function(e){r.push(n.createHiddenInput(e.name,e.value))}),r}},{key:"openFormInDrawer",value:function(e){e&&e.addEventListener("submit",function(e){e.preventDefault();var t=new FormData(e.target),n=new URLSearchParams(t).toString(),o=e.target.action.includes("?")?"&":"?",r=(0,l.Kp)("iframe",[],{width:"100%",height:"100%",src:"".concat(e.target.action).concat(o).concat(n)}),i=new a.A({className:"ImmersiveHero__config-prompt-drawer"});i.injectContent(r),i.openDrawer()})}},{key:"renderConfigPromptSubHeader",value:function(e,t,n){var o=e.querySelector(".ImmersiveHero__subHeader");o.textContent=o.textContent.replace("{MODEL}",m.A.getDescription(t.description)).replace("{PAINT_COLOUR}",m.A.getDescription(n.description))}},{key:"renderConfigPromptPrice",value:function(e,t,n){var o=e.querySelector(".ImmersiveHero__additionalInfo");if(t){if(/^0*$/.test(parseInt(n,10)))return;o.textContent="".concat(o.textContent,": ").concat(t)}else o.innerHTML=""}},{key:"configPromptCPlayer",value:function(e){var t,n=this.el.querySelector(".ImmersiveHero__config-prompt-cplayer-wrapper"),o=this.el.querySelector(".ImmersiveHero__config-prompt-cplayer"),r=null===(t=this.el.dataset)||void 0===t?void 0:t.cplayerApiKey;if(r){this.background.setAttribute("hidden","true"),n.removeAttribute("hidden");var a={rcDoc:e,currentFrame:0,frames:[0],useBackground:!1},l={apiKey:r};this.cPlayer=new i.A(o,l),this.cPlayer.render(a)}}},{key:"disableConfigPrompt",value:function(){var e;this.enableConfigPrompt=!1,this.background.hidden=!1,this.handleCaveatVisibility(),V(G,this,$).call(this),this.imageExpansion||(this.imageExpansion=V(G,this,J).call(this),null===(e=this.imageExpansion)||void 0===e||e.run())}},{key:"convertPipes",value:function(e){if(e&&e.textContent.includes("|")){var t=e.querySelectorAll(":scope > p");t.length&&(e.classList.add("ImmersiveHero--custom-pipes"),e.classList.remove("ImmersiveHero--uses-pipes"),t.forEach(function(t){t.innerHTML.split("|").forEach(function(t){if(""!==t.replace(/&nbsp;/g,"").trim()){var n=document.createElement("p"),o=document.createElement("span");o.innerHTML=t.trim(),n.appendChild(o),e.appendChild(n)}}),t.remove()}))}}},{key:"initVideoControls",value:function(){var e=this,t=(0,l.Kp)("div",["ImmersiveHero__background-video-play-pause"]);this.background.appendChild(t),this.videoContainer.videoControls=new o.A(t,{duration:this.videoElement.duration,playLabel:this.playLabel,pauseLabel:this.pauseLabel});var n=function(t){var n,o;e.analytics.trackEvent({eventAction:"click",eventCategory:"video",eventLabel:"video_".concat(t),customData:{video_title:null!==(n=e.videoElement.title)&&void 0!==n?n:"",video_source:null!==(o=e.videoElement.currentSrc)&&void 0!==o?o:"",video_playtime:(0,v.A)(e.videoElement.currentTime)}})};this.videoContainer.videoControls.on("click",function(t){"playing"===t.detail.playState?(n("play"),e.videoElement.play(),e.background.classList.remove("ImmersiveHero__background--dimmed")):(n("pause"),e.videoElement.pause(),e.background.classList.add("ImmersiveHero__background--dimmed"))})}},{key:"setVideoTitle",value:function(){var e=this.videoElement.getAttribute("data-mobile-title"),t=this.videoElement.getAttribute("data-desktop-title");this.videoElement.setAttribute("title",this.isMobile&&e?e:t)}},{key:"bindEvents",value:function(){var e=this;this.watchLinks.length>0&&this.watchLinks.forEach(function(t){t.addEventListener("click",e.youtubeModal.bind(e))}),this.scrollButton&&this.scrollButton.addEventListener("click",function(){window.scrollBy(0,e.el.getBoundingClientRect().height-window.scrollY)}),"video"===this.assetType&&this.videoElement&&(this.unloadSkeletonTimeout=setTimeout(function(){console.warn("Video is taking too long to load. Unloading skeleton."),V(G,e,$).call(e),e.immersiveHero.classList.remove("ImmersiveHero--not-loaded")},d.SKELETON_TIMEOUT_DURATION),this.videoElement.readyState>=2?this.checkVideoReadyState():(this.videoElement.addEventListener("canplaythrough",this.handleMediaReady),setTimeout(function(){e.checkVideoReadyState()},2e3))),"image"===this.assetType&&this.backgroundImage&&(this.backgroundImage.complete?V(G,this,Y).call(this,"image"):this.backgroundImage.addEventListener("load",this.onBackgroun
1dImageLoaded.bind(this)))}},{key:"onBackgroundImageLoaded",value:function(){V(G,this,Y).call(this,"image")}},{key:"checkVideoReadyState",value:function(){this.videoElement.readyState>=4?V(G,this,Y).call(this,"video"):setTimeout(this.checkVideoReadyState,50)}},{key:"youtubeModal",value:function(e){var t;e.preventDefault();var n,o=e.currentTarget,r=document.getElementById("immersiveHeroModal").content,i=o.dataset.youtubeId,a=o.dataset.modalTitle,l=o.dataset.modalVideoLabel,s=(null===(t=document)||void 0===t||null===(t=t.querySelector('meta[name="overlay.close"]'))||void 0===t?void 0:t.getAttribute("content"))||"Close";if(window.jlr_consent&&!window.jlr_consent.categories.analytics)document.querySelector(".cookie-modal").classList.add("cookie-modal--visible");else{var c=(n=i)?n.includes("http")?"".concat(n,"?enablejsapi=1&color=white&rel=0"):"https://www.youtube-nocookie.com/embed/".concat(n,"?enablejsapi=1&color=white&rel=0"):"",d=r.querySelector(".contentCardVideo");d.setAttribute("title",l),d.setAttribute("src",c);var f=document.createElement("div");f.classList.add("contentCard__modal-video-wrapper"),f.classList.add("contentCard__modal-video-wrapper--youtube"),f.appendChild(d.cloneNode(!0)),new u.default(o,{fullScreenMode:!0,footer:!1,closeLabel:s,headerTitle:a}).open(f)}}},{key:"setImageAlt",value:function(){var e,t,n,o=null===(e=this.pictureElement)||void 0===e?void 0:e.getAttribute("data-mobile-alt"),r=null===(t=this.pictureElement)||void 0===t?void 0:t.getAttribute("data-desktop-alt");null===(n=this.backgroundImage)||void 0===n||n.setAttribute("alt",this.isMobile&&o?o:r)}},{key:"createHiddenInput",value:function(e,t){return e&&t?(0,l.Kp)("input",[],{type:"hidden",readOnly:!0,"aria-hidden":"true",tabindex:"-1",name:e,value:t}):null}},{key:"handleCaveatVisibility",value:function(){var e,t=this.el.querySelector(".ImmersiveHero__caveat-inner"),n=!t||""===t.textContent.trim(),o=this.el.querySelector(".ImmersiveHero__config-prompt-remove");n&&!o&&(null===(e=this.configPromptCaveatWrapper)||void 0===e||e.classList.add("hide"))}}],t&&U(e.prototype,t),n&&U(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n,b,w}();function J(){var e,t=this;return L.create(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?D(Object(n),!0).forEach(function(t){x(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):D(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({enabled:!this.enableConfigPrompt&&(null===(e=this.el.parentElement)||void 0===e?void 0:e.classList.contains("image-expansion-animation")),element:this.immersiveHero,getTarget:function(){return t.background}},(0,w.$)("immersivehero")))}function $(){this.enableConfigPrompt&&!this.configPromptLoaded||(this.caveatSkeleton.unload({destroy:!0,destroyDelay:2e3}),this.configPromptSkeleton.unload({destroy:!0}),this.contentSkeleton.unload({destroy:!0,destroyDelay:2e3}))}function Y(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"video";(V(G,this,$).call(this),this.immersiveHero.classList.remove("ImmersiveHero--not-loaded"),this.enableConfigPrompt)||(null===(e=this.imageExpansion)||void 0===e||e.run());"video"===t&&(clearTimeout(this.unloadSkeletonTimeout),this.initVideoControls(),this.videoElement.removeEventListener("canplaythrough",this.handleMediaReady))}},26016:function(e,t,n){n.r(t),n.d(t,{SKELETON_TIMEOUT_DURATION:function(){return o}});var o=7e3},99686:function(e,t,n){n.r(t),n.d(t,{default:function(){return u}});var o=n(71202),r=n(69805);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},i(e)}function a(e){return function(e){if(Array.isArray(e))return l(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return l(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(e,t):void 0}}(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 l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n<t;n++)o[n]=e[n];return o}function s(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,c(o.key),o)}}function c(e){var t=function(e,t){if("object"!=i(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=i(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==i(t)?t:t+""}var u=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._defaults={className:"Modal",selector:".Modal",speed:350,modalModifier:null,closeLabel:null,enableClose:!0,fullScreenMode:!1,headerTitle:null,isCompact:!1,footer:!0},this.element=t,this._modal=null,this._modalContent=null,this.fullScreenClass="Modal--full-screen",this.options=Object.assign({},this._defaults,n)}return t=e,i=[{key:"toggleContent",value:function(e){[document.querySelector(".pageWrapper"),document.querySelector(".Fullscreen"),document.querySelector(".sharedNavigation"),document.querySelector("body > #jaguar")||document.querySelector("body > #landrover"),document.querySelector("main"),document.querySelector(".footercontainer")].filter(function(e){return e instanceof HTMLElement}
1).forEach(function(t){e?t.setAttribute("aria-hidden","true"):t.removeAttribute("aria-hidden")})}}],(n=[{key:"_attachModal",value:function(){var e=this,t=document.createElement("section"),n=this.options,o=n.className,r=n.modalModifier,i=n.closeLabel,l=n.enableClose,s=n.fullScreenMode,c=n.headerTitle,u=n.isCompact,d=l?'<button data-modal-close class="'.concat(o,'__close"></button>'):"",f=c?'<h2 class="Modal__header-title headline headline--s">'.concat(c,"</h2>"):"",m='\n          <div class="'.concat(o,'__content-wrapper">\n            <div class="').concat(o,'__header">\n              ').concat(f,"\n              ").concat(d,'\n            </div>\n            <div data-modal-content class="').concat(o,'__content" tabindex="0"></div>\n            <div data-modal-footer class="').concat(o,'__footer"></div>\n            <div data-modal-tab-target class="').concat(o,'__tab-target" tabindex="0"></div>\n          </div>\n        ');t.setAttribute("data-modal",""),t.setAttribute("role","dialog"),t.setAttribute("tabIndex","-1"),t.classList.add(o),s&&t.classList.add(this.fullScreenClass),null!==r&&(Array.isArray(r)||(this.options.modalModifier=r.split()),this.options.modalModifier.forEach(function(e){return t.classList.add("".concat(o,"--").concat(e))})),t.innerHTML=m,(document.querySelector(".mfp-content")||document.body).appendChild(t),this._modal=t;var p=t.querySelectorAll("[data-modal-content]")[0];this._modalContent=p;var v=t.querySelectorAll("[data-modal-footer]")[0];this._modalFooter=v,this._modal.classList.toggle("".concat(o,"--hide-footer"),!this.options.footer);var h=document.createElement("div");h.classList.add("".concat(o,"__background")),h.setAttribute("data-modal-close",""),t.appendChild(h),l&&a(this._modal.querySelectorAll("[data-modal-close]")).forEach(function(t){var n=t.classList.contains("".concat(o,"__background"));null===i||n||t.setAttribute("aria-label",i),t.addEventListener("click",function(t){t.preventDefault(),e._close()})}),u&&this._setupCompactMode(t)}},{key:"_detachModal",value:function(){var e=document.querySelectorAll(this.options.selector)[0];if(null!=e){var t=document.querySelector(".mfp-content")||document.body,n=t.childNodes;n&&n.length>0&&n.forEach(function(n){n.isEqualNode(e)&&t.removeChild(e)})}}},{key:"_keyboardControls",value:function(){var e=this;this._modal.focus(),this.options.enableClose&&this._modal.addEventListener("keydown",function(t){e._closeOnEsc(t)});var t=this._modal.querySelector("[data-modal-close]");t.addEventListener("keydown",function(e){e.keyCode===r.D.TAB&&e.shiftKey&&e.preventDefault()}),this._modal.querySelector("[data-modal-tab-target]").addEventListener("focus",function(){return t.focus()})}},{key:"_closeOnEsc",value:function(e){e.keyCode===r.D.ESC&&(e.preventDefault(),this._close())}},{key:"_open",value:function(t){var n=this;e.toggleContent(!0),this._attachModal(),this._modalContent.innerHTML="",this._modalContent.appendChild(t.cloneNode(!0)),this._modal.style.display="block",this.element.setAttribute("data-modal-return","true");var r=function(){if(Math.ceil(n._modalContent.scrollTop)===n._modalContent.scrollHeight-n._modalContent.offsetHeight){if(n.options.isCompact)return void n._modalContent.toggleAttribute("data-scroll-end",!0);n._modalFooter.style.opacity=0,requestAnimationFrame(function(){setTimeout(function(){n._modalFooter.style.display="none",n.isHidden=!0},10)})}else if(Math.ceil(n._modalContent.scrollTop)!==n._modalContent.scrollHeight-n._modalContent.offsetHeight){if(n.options.isCompact)return void n._modalContent.toggleAttribute("data-scroll-end",!1);if(!n.isHidden)return;n.isHidden=!1,n._modalFooter.style.display="block",requestAnimationFrame(function(){setTimeout(function(){n._modalFooter.style.opacity=1},10)})}};requestAnimationFrame(function(){var e;if(n._modal.style.opacity=1,(0,o.Vb)(n._modalContent)?n._modalContent.addEventListener("scroll",r):n.options.isCompact?n._modalContent.toggleAttribute("data-scroll-end",!0):n._modalFooter.style.display="none",n.options.fullScreenMode){document.documentElement.classList.add("modal-fullscreen");var t=document.querySelector(".Page__wrapper, #jaguar, #landrover");t&&(t.style.visibility="hidden")}n._modal.classList.toggle("".concat(n.options.className,"--hide-footer"),!n.options.footer||n.options.isCompact&&0===(null===(e=n._modalFooter)||void 0===e?void 0:e.children.length)),setTimeout(function(){n._keyboardControls(),n._eventTrigger("".concat(n.options.className,":opened"))},n.options.speed)})}},{key:"_close",value:function(){var t=this;e.toggleContent(!1),requestAnimationFrame(function(){if(t._modal.style.opacity=0,t.options.fullScreenMode){var e=document.querySelector(".Page__wrapper, #jaguar, #landrover");e&&(e.style.visibility="visible"),document.documentElement.classList.remove("modal-fullscreen")}setTimeout(function(){t._modal.style.display="none",t._eventTrigger("".concat(t.options.className,":closed")),t._detachModal(),t.element.focus();var e=document.querySelectorAll("[data-modal-return]")[0];e.focus(),e.removeAttribute("data-modal-return")},t.options.speed)})}},{key:"_eventTrigger",value:function(e){var t=new CustomEvent(e);this.element.dispatchEvent(t)}},{key:"_setupCompactMode",value:function(e){e.classList.add("Modal--compact")}},{key:"open",value:function(e){this._open(e)}},{key:"close",value:function(){this._close()}},{key:"resetKeyboardControls",value:function(){this._keyboardControls()}},{key:"modal",value:function(){return this._modal}}])&&s(t.prototype,n),i&&s(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,i}()},70963:function(e,t,n){n.d(t,{QH:function(){return o},Uc:function(){return i},Ve:function(){return r},r_:function(){return a},w2:function(){return l}});var o={lrdx:"lr",rrdx:"lr",jdx:"jag"},r=function(e){var t;return null!==(t=o[e])&&void 0!==t?t:e},i={lrdx:"Land Rover",rrdx:"Range Rover",jdx:"Jaguar"},a={range_rover:"rangeRover",defender:"defender",discovery:"discovery",jaguar:"jaguarAll"},l={rangeRover:"range-rover",defender:"defender",discovery:"discovery",jaguarAll:"jaguar"}},56094:function(e,t,n){n.d(t,{eN:function(){return o}});var o=function(e,t){if(e&&e.querySelector){var n="string"==typeof t?document.querySelector(t):t,o=e.querySelector("canvas");if(o){var r=e.cloneNode(!0);n.innerHTML=r.innerHTML;var i=n.querySelectorAll("canvas");
1i&&0!==i.length&&i.forEach(function(e,t){e.width=o.width,e.height=o.height;var n=e.getContext("2d");n?n.drawImage(o,0,0):console.error("Could not get 2D context for canvas element:",e)})}}}},26587:function(e,t){t.A=function(e){var t=Math.floor(e/3600),n=Math.floor(e%3600/60),o=Math.floor(e%60);return"".concat(t.toString().padStart(2,"0"),":").concat(n.toString().padStart(2,"0"),":").concat(o.toString().padStart(2,"0"))}},16786:function(e,t,n){var o=n(71221);t.A=function(e,t){var n={metadata:{meta:{}}};t&&(t=t.replace(/'?&nbsp;?'?/g," ")),n.metadata.meta["currency-format"]=t;var r=new o.W;return r.readCurrencyFormats(n),r.getFormattedPrice(e,t)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.