
      if(window.location.hostname === 'www.lithiachryslermissoula.com') {
        
            const createSchemaObjects = (schemaInfo, imageUrl) => ({      '@context': 'http://schema.org',      '@type': 'Car',      'vehicleIdentificationNumber': `${schemaInfo.vin}`,      'vehicleModelDate': schemaInfo.modelDate,      'model': {        '@type': 'ProductModel',        'name': `${schemaInfo.name}`,        'image': `${imageUrl}`,        'offers': {          '@type': 'Offer',          'price': schemaInfo.price,          'priceCurrency': `${schemaInfo.currency}`        }      },      'image': {        '@type': 'ImageObject',        'contentUrl': `${imageUrl}`      },      'name': `${schemaInfo.name}`    });  
        
    const injectToHTML = (location, cssSelector, div) => {
      switch(location){
        case 'afterAsFirstChild':
          document.querySelector(cssSelector).prepend(div);
          return;
        case 'afterAsLastChild':
          document.querySelector(cssSelector).appendChild(div);
          return;
        case 'beforeAsSibling': {
          let element = document.querySelector(cssSelector);
          element.parentNode.insertBefore(div, element.previousSibling);
          return;
        }
        case 'afterAsSibling': {
          let element = document.querySelector(cssSelector);
          element.parentNode.insertBefore(div, element.nextSibling);
          return;
        }
        default: {
          document.querySelector(cssSelector).prepend(div);
          return;
        }
      }
    }
  
        
  const makeRandomString = () => {
    let result = '';
    const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
    const charsLength = characters.length;

    for (let i = 0; i < 6; i++) {
      result += characters.charAt(Math.floor(Math.random() * charsLength));
    }
    return result;
  }

        const createGridResponse = (
      data,
      cssSelector,
      idx,
      modifiers,
      isEmbedAsHTML,
      embedJs,
      variables,
      seoTextList,
      schemaInfoList,
      offerImpressionList
      ) => {
      return new MutationObserver(function(mutations, me){
        let offerImpressHTMLArr = [];
      let offerClickHTMLArr = [];
      if(offerImpressionList){
        for(const offerInd of offerImpressionList) {
        const impressionKeys = Object.keys(offerInd);
      
        let offerImpressHTML = "";
        let offerClickHTML = "";

        offerImpressHTML += ("event" + ': "' + "offerImpression") + '",';
        offerClickHTML += ("event" + ': "' + "offerClick") + '",';
        const offerKey = "num_of_offers";
        offerImpressHTML += ("num_of_offers" + ': "' + (offerInd[offerKey] || "")) + '",'; 
        impressionKeys.forEach(impressKey => {
          if(impressKey.includes("offerImpression")){
            offerImpressHTML += (impressKey + ': "' + offerInd[impressKey]) + '",';    
          }
      
          if(impressKey.includes("offerClick")){
            offerClickHTML += (impressKey + ': "' + offerInd[impressKey]) + '",';
          }
        });
      
        impressionHTMLStr = "window.dataLayer = window.dataLayer || [];" + "window.dataLayer.push({" + offerImpressHTML + "});";
        clickHTMLStr = "window.dataLayer = window.dataLayer || [];" + "window.dataLayer.push({" + offerClickHTML + "});";
        offerImpressHTMLArr.push(impressionHTMLStr);
        offerClickHTMLArr.push(clickHTMLStr);
        }
      }

        let div;
        let platform;
        if(cssSelector.mobile && window.innerWidth <= 740) {
          div = document.querySelector(cssSelector.mobile);
          platform = 'mobile'
        }
        else if(cssSelector.desktop && window.innerWidth > 740) {
          div = document.querySelector(cssSelector.desktop);
          platform = 'desktop'
        }
        else {
          return;
        }
        if (div) {
          cssSelector = cssSelector[platform];
          let wrapper = document.createElement('div');
          injectToHTML(modifiers[platform], cssSelector, wrapper);

          let xDown = null;
          let yDown = null;
          let isCanvasPointerEventOn = isEmbedAsHTML;

          wrapper.addEventListener('touchstart', function (e) {
            xDown = e.touches[0].clientX; 
            yDown = e.touches[0].clientY;
          });

          wrapper.addEventListener('touchmove', function(e) {
            if (!xDown || !yDown) return;
            let xUp = e.touches[0].clientX;
            let yUp = e.touches[0].clientY;
            
            let xDiff = xDown - xUp;
            let yDiff = yDown - yUp;

            if (Math.abs(xDiff) + Math.abs(yDiff) > 50) {
              if (isCanvasPointerEventOn && isEmbedAsHTML) {
                const validVariables = variables.filter(variable => {
                  return variable.length > 0;
                });
                validVariables.forEach(variable => {
                  document.getElementById(variable[1]).parentElement.style.pointerEvents = 'none';
                });
                isCanvasPointerEventOn = false;
              }              
              xDown = null;
              yDown = null;
            }
          });

          if (isEmbedAsHTML) {
            wrapper.style= 'width: 100%; margin-top: 10px; margin-bottom: 10px;';
            for(let idx = 1; idx < variables.length; idx += 2) {
              let div = document.createElement('div');
              let div1 = document.createElement('div');
              let div2 = document.createElement('div');
              let canvas1 = document.createElement('canvas');
              canvas1.style.pointerEvents = 'none';
              let canvas2 = document.createElement('canvas');
              canvas2.style.pointerEvents = 'none';
              let img1 = document.createElement('img');
              img1.onclick = function() {
                console.log("image clicked - add GA")
                let offerClickScript = document.createElement('script');
                offerClickScript.innerHTML = offerClickHTMLArr[idx - 1];
                wrapper.append(offerClickScript);
              };
              let img2 = document.createElement('img');
              img2.onclick = function() {
                console.log("image clicked - add GA")
                let offerClickScript = document.createElement('script');
                offerClickScript.innerHTML = offerClickHTMLArr[idx];
                wrapper.append(offerClickScript);
              };

              if (variables[idx - 1].length === 0 && variables[idx].length === 0) {
                img1.src = data[idx - 1].imageUrl;
                img1.style = 'width: 100%';
                if(data[idx - 1].imageLink) {
                  let a1 = document.createElement('a');
                  a1.href = data[idx - 1].imageLink;
                  if (data[idx - 1].imageLink.includes('?')) {
                    a1.href = data[idx - 1].imageLink + '&' + data[idx - 1].targetData
                  } else {
                    a1.href = data[idx - 1].imageLink + '?' + data[idx - 1].targetData
                  }
                  a1.onclick = function() {
                      console.log("image clicked - add GA")
                      let offerClickScript = document.createElement('script');
                      offerClickScript.innerHTML = offerClickHTMLArr[idx - 1];
                      wrapper.append(offerClickScript);
                    };
                  if(data[idx - 1].target) a1.target = data[idx - 1].target;
                  if(a1.target === '_blank') a1.rel = 'noreferrer noopener';
                  a1.style = 'display: inline-block';
                  a1.appendChild(img1);
                  div1.appendChild(a1);
                }
                else div1.appendChild(img1);

                img2.src = data[idx].imageUrl;
                img2.style = 'width: 100%';
                if(data[idx].imageLink) {
                  let a2 = document.createElement('a');
                  a2.href = data[idx].imageLink;
                  if (data[idx].imageLink.includes('?')) {
                    a2.href = data[idx].imageLink + '&' + data[idx].targetData
                  } else {
                    a2.href = data[idx].imageLink + '?' + data[idx].targetData
                  }
                  a2.onclick = function() {
                      console.log("image clicked - add GA")
                      let offerClickScript = document.createElement('script');
                      offerClickScript.innerHTML = offerClickHTMLArr[idx];
                      wrapper.append(offerClickScript);
                    };
                  if(data[idx].target) a2.target = data[idx].target;
                  if(a2.target === '_blank') a2.rel = 'noreferrer noopener';
                  a2.style = 'display: inline-block';
                  a2.appendChild(img2);
                  div2.appendChild(a2);
                }
                else div2.appendChild(img2);
              }
              else if (variables[idx - 1].length === 0 && variables[idx]) {
                img1.src = data[idx - 1].imageUrl;
                img1.style = 'width: 100%';
                if(data[idx - 1].imageLink) {
                  let a1 = document.createElement('a');
                  a1.href = data[idx - 1].imageLink;
                  if (data[idx - 1].imageLink.includes('?')) {
                    a1.href = data[idx - 1].imageLink + '&' + data[idx - 1].targetData
                  } else {
                    a1.href = data[idx - 1].imageLink + '?' + data[idx - 1].targetData
                  }
                  a1.onclick = function() {
                      console.log("image clicked - add GA")
                      let offerClickScript = document.createElement('script');
                      offerClickScript.innerHTML = offerClickHTMLArr[idx - 1];
                      wrapper.append(offerClickScript);
                    };
                  if(data[idx - 1].target) a1.target = data[idx - 1].target;
                  if(a1.target === '_blank') a1.rel = 'noreferrer noopener';
                  a1.style = 'display: inline-block';
                  a1.appendChild(img1);
                  div1.appendChild(a1);
                }
                else div1.appendChild(img1);

                canvas2.id = variables[idx][1];
                if(data[idx].imageLink) {
                  let a2 = document.createElement('a');
                  a2.href = data[idx].imageLink;
                  if (data[idx].imageLink.includes('?')) {
                    a2.href = data[idx].imageLink + '&' + data[idx].targetData
                  } else {
                    a2.href = data[idx].imageLink + '?' + data[idx].targetData
                  }
                  a2.onclick = function() {
                      console.log("image clicked - add GA")
                      let offerClickScript = document.createElement('script');
                      offerClickScript.innerHTML = offerClickHTMLArr[idx];
                      wrapper.append(offerClickScript);
                    };
                  if(data[idx].target) a2.target = data[idx].target;
                  if(a2.target === '_blank') a2.rel = 'noreferrer noopener';
                  a2.style = 'display: inline-block';
                  a2.appendChild(canvas2);
                  div2.appendChild(a2);
                }
                else div2.append(canvas2);
              }
              else if (variables[idx - 1] && variables[idx].length === 0) {
                canvas1.id = variables[idx - 1][1];
                if (data[idx - 1].imageLink) {
                  let a1 = document.createElement('a');
                  a1.href = data[idx - 1].imageLink;
                  if (data[idx - 1].imageLink.includes('?')) {
                    a1.href = data[idx - 1].imageLink + '&' + data[idx - 1].targetData
                  } else {
                    a1.href = data[idx - 1].imageLink + '?' + data[idx - 1].targetData
                  }
                  a1.onclick = function() {
                      console.log("image clicked - add GA")
                      let offerClickScript = document.createElement('script');
                      offerClickScript.innerHTML = offerClickHTMLArr[idx - 1];
                      wrapper.append(offerClickScript);
                    };
                  if(data[idx - 1].target) a1.target = data[idx - 1].target;
                  if(a1.target === '_blank') a1.rel = 'noreferrer noopener';
                  a1.style = 'display: inline-block';
                  a1.appendChild(canvas1);
                  div1.appendChild(a1);
                }
                else div1.append(canvas1);

                img2.src = data[idx].imageUrl;
                img2.style = 'width: 100%';
                if (data[idx].imageLink) {
                  let a2 = document.createElement('a');
                  a2.href = data[idx].imageLink;
                  if (data[idx].imageLink.includes('?')) {
                    a2.href = data[idx].imageLink + '&' + data[idx].targetData
                  } else {
                    a2.href = data[idx].imageLink + '?' + data[idx].targetData
                  }
                  a2.onclick = function() {
                      console.log("image clicked - add GA")
                      let offerClickScript = document.createElement('script');
                      offerClickScript.innerHTML = offerClickHTMLArr[idx];
                      wrapper.append(offerClickScript);
                    };
                  if(data[idx].target) a2.target = data[idx].target;
                  if(a2.target === '_blank') a2.rel = 'noreferrer noopener';
                  a2.style = 'display: inline-block';
                  a2.appendChild(img2);
                  div2.appendChild(a2);
                }
                else div2.appendChild(img2);
              }
              else {
                canvas1.id = variables[idx - 1][1];
                if(data[idx - 1].imageLink) {
                  let a1 = document.createElement('a');
                  a1.href = data[idx - 1].imageLink;
                  if (data[idx - 1].imageLink.includes('?')) {
                    a1.href = data[idx - 1].imageLink + '&' + data[idx - 1].targetData
                  } else {
                    a1.href = data[idx - 1].imageLink + '?' + data[idx - 1].targetData
                  }
                  a1.onclick = function() {
                      console.log("image clicked - add GA")
                      let offerClickScript = document.createElement('script');
                      offerClickScript.innerHTML = offerClickHTMLArr[idx - 1];
                      wrapper.append(offerClickScript);
                    };
                  if(data[idx - 1].target) a1.target = data[idx - 1].target;
                  if(a1.target === '_blank') a1.rel = 'noreferrer noopener';
                  a1.style = 'display: inline-block';
                  a1.appendChild(canvas1);
                  div1.appendChild(a1);
                }
                else div1.append(canvas1);

                canvas2.id = variables[idx][1];
                if(data[idx].imageLink) {
                  let a2 = document.createElement('a');
                  a2.href = data[idx].imageLink;
                  if (data[idx].imageLink.includes('?')) {
                    a2.href = data[idx].imageLink + '&' + data[idx].targetData
                  } else {
                    a2.href = data[idx].imageLink + '?' + data[idx].targetData
                  }
                  a2.onclick = function() {
                      console.log("image clicked - add GA")
                      let offerClickScript = document.createElement('script');
                      offerClickScript.innerHTML = offerClickHTMLArr[idx];
                      wrapper.append(offerClickScript);
                    };
                  if(data[idx].target) a2.target = data[idx].target;
                  if(a2.target === '_blank') a2.rel = 'noreferrer noopener';
                  a2.style = 'display: inline-block';
                  a2.appendChild(canvas2);
                  div2.appendChild(a2);
                }
                else div2.append(canvas2);
              }

              div.style = 'width: 100%; display: flex; align-items: center; justify-content: center;';
              div1.style = 'max-width: 50%; padding: 2%';
              div2.style = 'max-width: 50%; padding: 2%';
              div.append(div1);
              div.append(div2);

              if (platform === 'mobile') {                
                div.style.flexDirection = 'column';
                div1.style.maxWidth = '100%';
                div2.style.maxWidth = '100%';
                div1.style.width = '100%';
                div2.style.width = '100%';
              }
              wrapper.append(div);
            }
            if (variables.length % 2 !== 0) {
              let lastImage = data[data.length - 1];
              let lastDiv = document.createElement('div');
              let lastDiv1 = document.createElement('div');
              let lastCanvas = document.createElement('canvas');
              let lastImg = document.createElement('img');

              lastCanvas.style.pointerEvents = 'none';

              if (variables[variables.length - 1].length === 0) {
                lastImg.src = data[data.length - 1].imageUrl;
                if(lastImage.imageLink) {
                  let lastA = document.createElement('a');
                  lastA.href = lastImage.imageLink;
                  if (lastImage.imageLink.includes('?')) {
                    lastA.href = lastImage.imageLink + '&' + lastImage.targetData
                  } else {
                    lastA.href = lastImage.imageLink + '?' + lastImage.targetData
                  }
                  if(lastImage.target) lastA.target = lastImage.target;
                  if(lastA.target === '_blank') lastA.rel = 'noreferrer noopener';
                  lastA.style = 'display: inline-block';
                  lastA.onclick = function() {
                      console.log("image clicked - add GA")
                      let offerClickScript = document.createElement('script');
                      offerClickScript.innerHTML = offerClickHTMLArr[data.length - 1];
                      wrapper.append(offerClickScript);
                    };
                  lastA.appendChild(lastImg);
                  lastDiv1.appendChild(lastA);
                }
                else {
                  lastDiv1.appendChild(lastImg);
                  lastDiv1.style = 'display: inline-block';
                }
                lastDiv.append(lastDiv1);
                lastDiv.style = 'width: 100%; display: flex; align-items: center; justify-content: center;';
                wrapper.append(lastDiv);
              }
              else {
                lastCanvas.id = variables[variables.length - 1][1];
                if(data[variables.length - 1].imageLink) {
                  let lastA = document.createElement('a');
                  lastA.href = data[variables.length - 1].imageLink;
                  if (data[variables.length - 1].imageLink.includes('?')) {
                    lastA.href = data[variables.length - 1].imageLink + '&' + data[variables.length - 1].targetData
                  } else {
                    lastA.href = data[variables.length - 1].imageLink + '?' + data[variables.length - 1].targetData
                  }
                  lastA.onclick = function() {
                      console.log("image clicked - add GA")
                      let offerClickScript = document.createElement('script');
                      offerClickScript.innerHTML = offerClickHTMLArr[variables.length - 1];
                      wrapper.append(offerClickScript);
                    };
                  if(data[variables.length - 1].target) lastA.target = data[variables.length - 1].target;
                  if(lastA.target === '_blank') lastA.rel = 'noreferrer noopener';
                  lastA.style = 'display: inline-block';
                  lastA.appendChild(lastCanvas);
                  lastDiv1.appendChild(lastA);
                }
                else lastDiv1.append(lastCanvas);
                lastDiv.append(lastDiv1);
                lastDiv.style = 'width: 100%; display: flex; align-items: center; justify-content: center;';
                wrapper.append(lastDiv);
              }
            }
            let scriptTag = document.createElement('script');
            scriptTag.innerHTML = embedJs;
            wrapper.append(scriptTag);
          }
          else {
            wrapper.style= 'width: 100%; margin-top: 10px; margin-bottom: 10px;';
            for (let idx = 1; idx < data.length; idx += 2) {
              let div = document.createElement('div');
              let div1 = document.createElement('div');
              let div2 = document.createElement('div');
              let img1 = document.createElement('img');
              img1.onclick = function() {
                console.log("image clicked - add GA")
                let offerClickScript = document.createElement('script');
                offerClickScript.innerHTML = offerClickHTMLArr[idx - 1];
                wrapper.append(offerClickScript);
              };
              let img2 = document.createElement('img');
              img2.onclick = function() {
                console.log("image clicked - add GA")
                let offerClickScript = document.createElement('script');
                offerClickScript.innerHTML = offerClickHTMLArr[idx];
                wrapper.append(offerClickScript);
              };
              if(data[idx - 1].imageLink) {
                let a1 = document.createElement('a');
                a1.href = data[idx - 1].imageLink;
                if (data[idx - 1].imageLink.includes('?')) {
                  a1.href = data[idx - 1].imageLink + '&' + data[idx - 1].targetData
                } else {
                  a1.href = data[idx - 1].imageLink + '?' + data[idx - 1].targetData
                }
                a1.onclick = function() {
                  console.log("image clicked - add GA")
                  let offerClickScript = document.createElement('script');
                  offerClickScript.innerHTML = offerClickHTMLArr[idx - 1];
                  wrapper.append(offerClickScript);
                };
                if(data[idx - 1].target) a1.target = data[idx - 1].target;
                if(a1.target === '_blank') a1.rel = 'noreferrer noopener';
                a1.style = 'display: inline-block';
                a1.appendChild(img1);
                div1.appendChild(a1);
              }
              else div1.appendChild(img1);
              if(data[idx].imageLink) {
                let a2 = document.createElement('a');
                a2.href = data[idx].imageLink;
                if (data[idx].imageLink.includes('?')) {
                  a2.href = data[idx].imageLink + '&' + data[idx].targetData
                } else {
                  a2.href = data[idx].imageLink + '?' + data[idx].targetData
                }
                a2.onclick = function() {
                  console.log("image clicked - add GA")
                  let offerClickScript = document.createElement('script');
                  offerClickScript.innerHTML = offerClickHTMLArr[idx];
                  wrapper.append(offerClickScript);
                };
                if(data[idx].target) a2.target = data[idx].target;
                if(a2.target === '_blank') a2.rel = 'noreferrer noopener';
                a2.style = 'display: inline-block';
                a2.appendChild(img2);
                div2.appendChild(a2);
              }
              else div2.appendChild(img2);
              div.appendChild(div1);
              div.appendChild(div2);
              div.style = 'width: 100%; display: flex; align-items: center; justify-content: center;';
              div1.style = 'max-width: 50%; padding: 2%';
              div2.style = 'max-width: 50%; padding: 2%';
              img1.style = 'width: 100%';
              img1.src = data[idx - 1].imageUrl;
              img1.alt = data[idx - 1].imageAltText;
              img2.style = 'width: 100%';
              img2.src = data[idx].imageUrl;
              img2.alt = data[idx].imageAltText;
              if(platform === 'mobile'){
                div.style.flexDirection = 'column';
                div1.style.maxWidth = '100%';
                div2.style.maxWidth = '100%';
                div1.style.width = '100%';
                div2.style.width = '100%';
              }
              wrapper.appendChild(div);
            }
            if(data.length % 2 !== 0) {
              let lastImage = data[data.length - 1];
              let lastDiv = document.createElement('div');
              let lastDiv1 = document.createElement('div');
              let lastImg = document.createElement('img');
              if(lastImage.imageLink) {
                let lastA = document.createElement('a');
                lastA.href = lastImage.imageLink;
                if (lastImage.imageLink.includes('?')) {
                  lastA.href = lastImage.imageLink + '&' + lastImage.targetData
                } else {
                  lastA.href = lastImage.imageLink + '?' + lastImage.targetData
                }
                lastA.onclick = function() {
                  console.log("image clicked - add GA")
                  let offerClickScript = document.createElement('script');
                  offerClickScript.innerHTML = offerClickHTMLArr[data.length - 1];
                  wrapper.append(offerClickScript);
                };
                if(lastImage.target) lastA.target = lastImage.target;
                if(lastA.target === '_blank') lastA.rel = 'noreferrer noopener';
                lastA.style = 'display: inline-block';
                lastA.appendChild(lastImg);
                lastDiv1.appendChild(lastA);
              }
              else {
                lastDiv1.appendChild(lastImg);
                lastDiv1.style = 'display: inline-block';
              }
              lastImg.style = 'width: 100%';
              lastImg.src = lastImage.imageUrl;
              lastImg.alt = lastImage.imageAltText;
              lastDiv.style = 'width: 100%; display: flex; align-items: center; justify-content: center;';
              lastDiv.appendChild(lastDiv1);
              wrapper.appendChild(lastDiv);
            }
          }
          if (seoTextList && !!seoTextList.length) {
            let text = "";
            seoTextList.forEach(seoText => {
              text += seoText;
            });
            let seoTag = document.createElement('div');
            seoTag.innerHTML = text;
            seoTag.style.display = 'none';
            wrapper.append(seoTag);
          }
          if (schemaInfoList) {
        const schemaInfo = [];
        for (let i = 0; i < schemaInfoList.length; i++) {
          schemaInfo.push(createSchemaObjects(schemaInfoList[i], data[i].imageUrl));
          let seoDiv = document.createElement('div');
          seoDiv.style.display = 'none';
          let productDiv = document.createElement('div');
          productDiv.id = 'product';
          seoDiv.append(productDiv);

          let strongText = document.createElement('strong');
          strongText.innerHTML = schemaInfoList[i].name || '';
          productDiv.append(strongText);

          let paragraph = document.createElement('p');
          paragraph.innerHTML = schemaInfoList[i].text || '';
          productDiv.append(paragraph);
          if(offerImpressionList){
            const impressionKeys = Object.keys(offerImpressionList[i]);
            impressionKeys.forEach(impressKey => {
              let impressionP = document.createElement('p');
              impressionP.innerHTML = offerImpressionList[i][impressKey] || '';
              productDiv.append(impressionP);
            });
            let offerImpressionScript = document.createElement('script');
              offerImpressionScript.innerHTML = offerImpressHTMLArr[i];
              wrapper.append(offerImpressionScript);
          }

          let image = document.createElement('img');
          image.src = data.imageUrl;
          productDiv.append(image);

          let stamp = document.createElement('p');
          stamp.innerHTML = schemaInfoList[i].stamp || '';
          productDiv.append(stamp);

          wrapper.append(seoDiv);
        }
        let schemaTag = document.createElement('script');
        schemaTag.type = 'application/ld+json';
        schemaTag.innerHTML = JSON.stringify(schemaInfo);
        wrapper.append(schemaTag);
      }
          me.disconnect();
          return ;
        }
      });
    }
  
        
  const createSingleImageResponse = (
      data,
      cssSelector,
      idx,
      modifiers,
      isEmbedAsHTML,
      embedJs,
      variables,
      seoText,
      schemaInfoList,
      offerImpressionList,
      ) => {
      let offerImpressHTMLArr = [];
      let offerClickHTMLArr = [];
      if(offerImpressionList){
        for(const offerInd of offerImpressionList) {
        const impressionKeys = Object.keys(offerInd);
        let offerImpressHTML = "";
        let offerClickHTML = "";
        
        offerImpressHTML += ("event" + ': "' + "offerImpression") + '",';
        offerClickHTML += ("event" + ': "' + "offerClick") + '",';
        const offerKey = "num_of_offers";
        offerImpressHTML += ("num_of_offers" + ': "' + (offerInd[offerKey] || "")) + '",'; 
        impressionKeys.forEach(impressKey => {
          if(impressKey.includes("offerImpression")){
            offerImpressHTML += (impressKey + ': "' + offerInd[impressKey]) + '",';    
          }
          
          if(impressKey.includes("offerClick")){
            offerClickHTML += (impressKey + ': "' + offerInd[impressKey]) + '",';
          }
        });
      
        impressionHTMLStr = "window.dataLayer = window.dataLayer || [];" + "window.dataLayer.push({" + offerImpressHTML + "});";
        clickHTMLStr = "window.dataLayer = window.dataLayer || [];" + "window.dataLayer.push({" + offerClickHTML + "});";
        offerImpressHTMLArr.push(impressionHTMLStr);
        offerClickHTMLArr.push(clickHTMLStr);
        }
      }

      return new MutationObserver(function (mutations, me){
        let div;
        let platform;
        if(cssSelector.mobile && window.innerWidth <= 740) {
          div = document.querySelector(cssSelector.mobile);
          platform = 'mobile'
        }
        else if(cssSelector.desktop && window.innerWidth > 740) {
          div = document.querySelector(cssSelector.desktop);
          platform = 'desktop'
        }
        else {
          return;
        }
        if (div) {
          console.log("offerImpressionList", offerImpressionList);
          cssSelector = cssSelector[platform];
          let wrapper = document.createElement('div');
          injectToHTML(modifiers[platform], cssSelector, wrapper);

          let xDown = null;
          let yDown = null;
          let isCanvasPointerEventOn = isEmbedAsHTML;

          wrapper.addEventListener('touchstart', function (e) {
            xDown = e.touches[0].clientX; 
            yDown = e.touches[0].clientY;
          });

          wrapper.addEventListener('touchmove', function(e) {
            if (!xDown || !yDown) return;
            let xUp = e.touches[0].clientX;
            let yUp = e.touches[0].clientY;
            
            let xDiff = xDown - xUp;
            let yDiff = yDown - yUp;

            if (Math.abs(xDiff) + Math.abs(yDiff) > 50) {
              if (isCanvasPointerEventOn && isEmbedAsHTML) {
                document.getElementById(variables[0][1]).parentElement.style.pointerEvents = 'none';                
                isCanvasPointerEventOn = false;
              }              
              xDown = null;
              yDown = null;
            }
          });

          if (isEmbedAsHTML){
            console.log("offerImpressionList-isEmbedAsHTML", offerImpressionList);
            let canvasTag = document.createElement('canvas');
            canvasTag.style.pointerEvents = 'none';
            if (data.imageLink) {
              let a = document.createElement('a');
              a.href = data.imageLink;
              a.onclick = function() {
                console.log("image clicked - add GA")
                let offerClickScript = document.createElement('script');
                offerClickScript.innerHTML = offerClickHTMLArr[0];
                wrapper.append(offerClickScript);
              };
              a.onmouseover = function() {
                console.log("a image hover - add GA")
              };
              if (data.imageLink.includes('?')) {
                a.href = data.imageLink + '&' + data.targetData
              } else {
                a.href = data.imageLink + '?' + data.targetData
              }
              if(data.target) a.target = data.target;
              if(a.target === '_blank') a.rel = 'noreferrer noopener';
              a.append(canvasTag);
              wrapper.append(a);
            }
            else wrapper.append(canvasTag);
            wrapper.style = 'display: flex; justify-content: center; align-items: center; width: 100%; margin-top: 10px; margin-bottom: 10px;';
            canvasTag.id = variables[0][1];
            let scriptTag = document.createElement('script');
            scriptTag.innerHTML = embedJs;
            wrapper.append(scriptTag);

            const canvasWidth = parseInt(canvasTag.style.width);
            const canvasHeight = parseInt(canvasTag.style.height);

            let parentContainerWidth = window.getComputedStyle(wrapper.parentElement, null).getPropertyValue('width');
            parentContainerWidth = parseInt(parentContainerWidth);
            const properWidth = parentContainerWidth > canvasWidth ? canvasWidth : parentContainerWidth;

            if (canvasWidth > properWidth && platform === 'desktop') {
              const newRatio = Math.min(parentContainerWidth / canvasWidth, 1);
              canvasTag.style.width = (canvasWidth * newRatio).toString() + 'px';
              canvasTag.style.height = (canvasHeight * newRatio).toString() + 'px';
              canvasTag.parentElement.style.width = properWidth.toString() + 'px';
              canvasTag.nextSibling.style.width = properWidth.toString() + 'px';
            }
          }
          else {
            let imageData = new Image();
            imageData.src = data.imageUrl;
            imageData.onload = function() {
              wrapper.style= 'width: 100%; display: flex; justify-content: center; margin-top: 10px; margin-bottom: 10px;';
              let img = document.createElement('img');
              if(data.imageLink) {
                let a = document.createElement('a');
                a.href = data.imageLink;
                if (data.imageLink.includes('?')) {
                  a.href = data.imageLink + '&' + data.targetData
                } else {
                  a.href = data.imageLink + '?' + data.targetData
                }
                if(data.target) a.target = data.target;
                if(a.target === '_blank') a.rel = 'noreferrer noopener';
                a.appendChild(img);
                wrapper.appendChild(a);
              }
              else wrapper.appendChild(img);
              img.src = data.imageUrl;
              img.alt = data.imageAltText;
              img.onclick = function() {
                console.log("image clicked - add GA")
                let offerClickScript = document.createElement('script');
                offerClickScript.innerHTML = offerClickHTMLArr[0];
                wrapper.append(offerClickScript);
              };
              img.onmouseover = function() {
                console.log("image hover - add GA")
              };
              if(platform === 'mobile') {
                img.style.width = '100%';
              }
              else if(this.width > 2500) img.style.width = '100%';
            }
          }
          if (seoText && seoText[0]) {
            let seoTag = document.createElement('div');
            seoTag.innerHTML = seoText[0];
            seoTag.style.display = 'none';
            wrapper.append(seoTag);
          }
          if (schemaInfoList) {
            const schemaInfo = [];
            for (let i = 0; i < schemaInfoList.length; i++) {
              schemaInfo.push(createSchemaObjects(schemaInfoList[i], data[i].imageUrl));
              let seoDiv = document.createElement('div');
              seoDiv.style.display = 'none';
              let productDiv = document.createElement('div');
              productDiv.id = 'product';
              seoDiv.append(productDiv);
    
              let strongText = document.createElement('strong');
              strongText.innerHTML = schemaInfoList[i].name || '';
              productDiv.append(strongText);
    
              let paragraph = document.createElement('p');
              paragraph.innerHTML = schemaInfoList[i].text || '';
              productDiv.append(paragraph);
              if(offerImpressionList){
                const impressionKeys = Object.keys(offerImpressionList[i]);
                impressionKeys.forEach(impressKey => {
                  let impressionP = document.createElement('p');
                  impressionP.innerHTML = (impressKey + ":" + offerImpressionList[i][impressKey]) || '';
                  productDiv.append(impressionP);
                });

                let offerImpressionScript = document.createElement('script');
                offerImpressionScript.innerHTML = offerImpressHTMLArr[i];
                wrapper.append(offerImpressionScript);
              }
    
              let image = document.createElement('img');
              image.src = data.imageUrl;
              productDiv.append(image);
    
              let stamp = document.createElement('p');
              stamp.innerHTML = schemaInfoList[i].stamp || '';
              productDiv.append(stamp);
    
              wrapper.append(seoDiv);
            }
            let schemaTag = document.createElement('script');
            schemaTag.type = 'application/ld+json';
            schemaTag.innerHTML = JSON.stringify(schemaInfo);
            wrapper.append(schemaTag);
          }
          me.disconnect();
          return;
        }
      });
    }
  
        
const createCarouselResponse = (
  data,
  cssSelector,
  idx,
  modifiers,
  isEmbedAsHTML,
  embedJs,
  variables,
  seoTextList,
  schemaInfoList,
  isAutoScrollEnabled,
  transitionTime,
  timeUntilNextTransition,
  offerImpressionList,
  isFullWidth,
) => {
  return new MutationObserver((mutations, me) => {
    let offerImpressHTMLArr = [];
    let offerClickHTMLArr = [];
    if(offerImpressionList){
      for(const offerInd of offerImpressionList) {
      const impressionKeys = Object.keys(offerInd);
     
      let offerImpressHTML = "";
      let offerClickHTML = "";

      offerImpressHTML += ("event" + ': "' + "offerImpression") + '",';
      offerClickHTML += ("event" + ': "' + "offerClick") + '",';
      const offerKey = "num_of_offers";
      offerImpressHTML += ("num_of_offers" + ': "' + (offerInd[offerKey] || "")) + '",'; 
      impressionKeys.forEach(impressKey => {
        if(impressKey.includes("offerImpression")){
          offerImpressHTML += (impressKey + ': "' + offerInd[impressKey]) + '",';    
        }
    
        if(impressKey.includes("offerClick")){
          offerClickHTML += (impressKey + ': "' + offerInd[impressKey]) + '",';
        }
      });
    
      let impressionHTMLStr = "window.dataLayer = window.dataLayer || [];" + "window.dataLayer.push({" + offerImpressHTML + "});";
      let clickHTMLStr = "window.dataLayer = window.dataLayer || [];" + "window.dataLayer.push({" + offerClickHTML + "});";
      offerImpressHTMLArr.push(impressionHTMLStr);
      offerClickHTMLArr.push(clickHTMLStr);
      }
    }
    let offerNavLeftHTML = "";
    let offerNavRightHTML = "";
    offerNavLeftHTML += "window.dataLayer = window.dataLayer || [];" + "window.dataLayer.push({";
    offerNavLeftHTML += ("event" + ': "' + "navigationInteraction") + '",';
    offerNavLeftHTML += ("navigationInteraction_action" + ': "' + "left arrow click") + '",';
    offerNavLeftHTML += "});";

    offerNavRightHTML += "window.dataLayer = window.dataLayer || [];" + "window.dataLayer.push({";
    offerNavRightHTML += ("event" + ': "' + "navigationInteraction") + '",';
    offerNavRightHTML += ("navigationInteraction_action" + ': "' + "right arrow click") + '",';
    offerNavRightHTML += "});";
    let div;
    let platform;
    if (cssSelector.mobile && window.innerWidth <= 740) {
      div = document.querySelector(cssSelector.mobile);
      platform = 'mobile';
    }
    else if (cssSelector.desktop && window.innerWidth > 740) {
      div = document.querySelector(cssSelector.desktop);
      platform = 'desktop';
    }
    else {        
      return;
    }

    if (div) {
      const targetCssSelector = cssSelector[platform];
      let carouselContainer = document.createElement('div');
      injectToHTML(modifiers[platform], targetCssSelector, carouselContainer);
      const carouselStyle = 'position: relative; margin: 0 auto; max-width: 90% !important; margin-top: 10px; margin-bottom: 10px;';
      const fullWidthStyle = 'position: relative; margin: 0 !important; max-width: none !important; width: 100% !important;';
      carouselContainer.style = isFullWidth ? fullWidthStyle : carouselStyle;
      carouselContainer.id = 'carousel_' + makeRandomString();

      const controlsContainer = document.createElement('div');
      controlsContainer.className = 'carousel-controls';

      const rightBtnId = 'carousel_right_btn_' + makeRandomString();
      let rightBtn = document.createElement('button');
      rightBtn.id = rightBtnId;
      const btnPosition = isFullWidth ? '20px' : '0px';
      rightBtn.style = 'position: absolute; right: ' + btnPosition + '; top: 50%; background: none; border: none; cursor: pointer; outline: none;';
      let rightBtnIcon = document.createElement('img');
      rightBtnIcon.src = 'https://av2-internal-web-int-dev.s3.amazonaws.com/images/rightArrow.svg';
      rightBtnIcon.alt = 'carousel right button icon';
      rightBtnIcon.style = 'width: 30px;';
      rightBtn.appendChild(rightBtnIcon);
      controlsContainer.appendChild(rightBtn);

      const leftBtnId = 'carousel_left_btn_' + makeRandomString();
      let leftBtn = document.createElement('button');
      leftBtn.id = leftBtnId;
      leftBtn.style = 'position: absolute; left: ' + btnPosition + '; top: 50%; background: none; border: none; cursor: pointer; outline: none;';
      let leftBtnIcon = document.createElement('img');
      leftBtnIcon.src = 'https://av2-internal-web-int-dev.s3.amazonaws.com/images/leftArrow.svg';
      leftBtnIcon.alt = 'carousel left button icon';
      leftBtnIcon.style = 'width: 30px;';
      leftBtn.appendChild(leftBtnIcon);
      controlsContainer.appendChild(leftBtn);

      const carouselContentId = 'carousel_content_' + makeRandomString();
      const carouselContent = document.createElement('div');
      carouselContent.id = carouselContentId;
      carouselContent.style = 'width: 100%; height: 300px; display: flex; justify-content: flex-start; overflow: hidden; position: relative;';
      carouselContainer.appendChild(carouselContent);

      const carouselSliderId = 'carousel_slider_' + makeRandomString();
      let carouselSlider = document.createElement('div');
      carouselSlider.id = carouselSliderId;
      carouselSlider.style = 'display: flex; height: 100%; flex-shrink: 0';
      
      if (transitionTime) {
        const slideTimeTransition = transitionTime === '0' ? '0.75' : transitionTime;
        carouselSlider.style.transition = 'all ' + (slideTimeTransition * 1000).toString() + 'ms';
      } else {
        carouselSlider.style.transition = 'all 625ms';
      }
      carouselSlider.style.width = (data.length * 100).toString() + '%';

      carouselContent.appendChild(carouselSlider);
      carouselContent.appendChild(controlsContainer);

      let carouselDotsNavigator = document.createElement('div');
      carouselDotsNavigator.style = 'display: flex; justify-content: center; padding: 10px 0;';
      carouselContainer.appendChild(carouselDotsNavigator);

      const sectionPercentage = (100 / data.length).toString() + '%';
      
      let direction = -1;      

      const updateDots = (currentDot, targetDot) => {
        currentDot.classList.remove('current_slide');
        currentDot.style = 'border: 0; border-radius: 50%; width: 15px; min-width: 15px; max-width: 15px; height: 15px; margin: 0 5px; cursor: pointer; padding: unset;';
        targetDot.style = 'border: 0; border-radius: 50%; width: 15px; min-width: 15px; max-width: 15px; height: 15px; margin: 0 5px; cursor: pointer; padding: unset;';
        targetDot.classList.add('current_slide');
        targetDot.style.background = 'rgba(0,0,0, 1)';
        currentDot.style.background = 'rgba(0,0,0, 0.3)';
      }

      let autoScrollInterval = null;
      
      const clearAutoScroll = () => {
        clearInterval(autoScrollInterval);
        autoScrollInterval = setInterval(() => {
          rightBtn.click();
        },
        parseFloat(timeUntilNextTransition) * 1000
        );
      };

      if (isAutoScrollEnabled) {
        autoScrollInterval = setInterval(() => {
          rightBtn.click();
        },
        parseFloat(timeUntilNextTransition) * 1000
        );
      }

      rightBtn.addEventListener('click', (e) => {
        let rightClickScript = document.createElement('script');
        rightClickScript.innerHTML = offerNavRightHTML;
        rightBtn.append(rightClickScript);
        e.stopPropagation();

        if (autoScrollInterval) {
          clearAutoScroll();
        }

        if (direction === 1) {
          carouselSlider.prepend(carouselSlider.lastElementChild);
        }
        direction = -1;

        carouselContent.style.justifyContent = 'flex-start';
        carouselSlider.style.transform = 'translate(-' + sectionPercentage + ')';
      });

      leftBtn.addEventListener('click', (e) => {
        let leftClickScript = document.createElement('script');
        leftClickScript.innerHTML = offerNavLeftHTML;
        leftBtn.append(leftClickScript);
        e.stopPropagation();

        if (autoScrollInterval) {
          clearAutoScroll();
        }

        if (direction === -1) {
          carouselSlider.appendChild(carouselSlider.firstElementChild);
        }
        direction = 1;
        carouselContent.style.justifyContent = 'flex-end';
        carouselSlider.style.transform = 'translate(' + sectionPercentage + ')';
      });

      carouselSlider.addEventListener('transitionend', () => {
        if (direction === 1) {
          carouselSlider.prepend(carouselSlider.lastElementChild);
        } else {
          carouselSlider.appendChild(carouselSlider.firstElementChild);
        }

        carouselSlider.style.transition = 'none';
        carouselSlider.style.transform = 'translate(0)';

        let targetDot;

        const currentDot = carouselDotsNavigator.querySelector('.current_slide');
          
        if (direction === -1) {
          targetDot = currentDot.nextElementSibling;
          if (!targetDot) {
            targetDot = carouselDotsNavigator.firstElementChild;
          }
        }
        else {
          targetDot = currentDot.previousElementSibling;
          if (!targetDot) {
            targetDot = carouselDotsNavigator.lastElementChild;
          }
        }
        updateDots(currentDot, targetDot);

        setTimeout(() => {
          if (transitionTime) {
            const slideTimeTransition = transitionTime === '0' ? '0.75' : transitionTime;
            carouselSlider.style.transition = 'all ' + (slideTimeTransition * 1000).toString() + 'ms';
          } else {
            carouselSlider.style.transition = 'all 625ms';
          }
        });
      }, false);

      if (platform === 'mobile') {
        carouselContainer.style.width = '100%';
        if (!isFullWidth) {
          carouselContainer.style.maxWidth = '100%';
        }
      }

      if (seoTextList && seoTextList.length > 0) {
        let text = '';
        seoTextList.forEach(seoText => {
          text += seoText;
        });
        let seoTag = document.createElement('div');
        seoTag.innerHTML = text;
        seoTag.style.display = 'none';
        carouselContainer.append(seoTag);
      }

      if (schemaInfoList) {
        const schemaInfo = [];
        for (let i = 0; i < schemaInfoList.length; i++) {
          schemaInfo.push(createSchemaObjects(schemaInfoList[i], data[i].imageUrl));
          let seoDiv = document.createElement('div');
          seoDiv.style.display = 'none';
          let productDiv = document.createElement('div');
          productDiv.id = 'product';
          seoDiv.append(productDiv);
          
          let strongText = document.createElement('strong');
          strongText.innerHTML = schemaInfoList[i].name || '';
          productDiv.append(strongText);
          
          let paragraph = document.createElement('p');
          paragraph.innerHTML = schemaInfoList[i].text || '';
          productDiv.append(paragraph);
          if(offerImpressionList){
            const impressionKeys = Object.keys(offerImpressionList[i]);
            impressionKeys.forEach(impressKey => {
              let impressionP = document.createElement('p');
              impressionP.innerHTML = offerImpressionList[i][impressKey] || '';
              productDiv.append(impressionP);
            })
            let offerImpressionScript = document.createElement('script');
            offerImpressionScript.innerHTML = offerImpressHTMLArr[i];
            productDiv.append(offerImpressionScript);
          }
          
          let image = document.createElement('img');
          image.src = data[i].imageUrl;
          productDiv.append(image);
          
          
          let stamp = document.createElement('p');
          stamp.innerHTML = schemaInfoList[i].stamp || '';
          productDiv.append(stamp);
          
          carouselContainer.append(seoDiv);
        }
        let schemaTag = document.createElement('script');
        schemaTag.type = 'application/ld+json';
        schemaTag.innerHTML = JSON.stringify(schemaInfo);
        carouselContainer.append(schemaTag);
      }

      let xDown = null;
      let yDown = null;
      let isCanvasPointerEventOn = isEmbedAsHTML;

      carouselContent.addEventListener('touchstart', function (e) {
        xDown = e.touches[0].clientX;
        yDown = e.touches[0].clientY;
      });

      carouselContent.addEventListener('touchmove', function(e) {
        if (!xDown || !yDown) return;
        let xUp = e.touches[0].clientX;
        let yUp = e.touches[0].clientY;
        
        let xDiff = xDown - xUp;
        let yDiff = yDown - yUp;
        
        if (Math.abs(xDiff) + Math.abs(yDiff) > 50) {
          if (isCanvasPointerEventOn && isEmbedAsHTML) {
            const validVariables = variables.filter(variable => {
              return variable.length > 0;
            });
            validVariables.forEach(variable => {
              document.getElementById(variable[1]).parentElement.style.pointerEvents = 'none';
            });
            isCanvasPointerEventOn = false;
          }
          if (Math.abs(xDiff) > Math.abs(yDiff)) {
            if (xDiff > 0) rightBtn.click();
            else leftBtn.click();
          }
          xDown = null;
          yDown = null;
        }
      });

      let actualDOMImageHeight;
      let actualDOMImageWidth;

      if (isEmbedAsHTML) {
        let referenceSlide;
        variables.forEach((variable, idx) => {
          const imageSlide = document.createElement('div');
          imageSlide.style = 'flex-shrink: 0; display: flex; justify-content: center; align-items: center;';
          imageSlide.style.flexBasis = sectionPercentage;
          imageSlide.setAttribute('data-idx', idx);
          
          const canvasTag = document.createElement('canvas');
          canvasTag.style.pointerEvents = 'none';
          const img = document.createElement('img');   
          img.onclick = function() {
            console.log("image clicked - add GA")
            let offerClickScript = document.createElement('script');
            offerClickScript.innerHTML = offerClickHTMLArr[idx];
            imageSlide.append(offerClickScript);
          };       
          
          if (variable.length === 0) {
            img.src = data[idx].imageUrl;
            if (data[idx].imageLink) {
              let url = data[idx].imageLink;

              if (data[idx].imageLink.includes('?')) {
                url = data[idx].imageLink + '&' + data[idx].targetData;
              } else {
                url = data[idx].imageLink + '?' + data[idx].targetData;
              }
              
              const linkTarget = data[idx].target === '_blank' ? '_blank' : '_self';
              img.onclick = () => { 
                  let offerClickScript = document.createElement('script');
                  offerClickScript.innerHTML = offerClickHTMLArr[idx];
                  imageSlide.append(offerClickScript);
                  window.open(url, linkTarget); 
              };
              img.style.cursor = 'pointer';
            }
            
            imageSlide.appendChild(img);
            carouselSlider.appendChild(imageSlide);
          }
          else {
            canvasTag.id = variable[1];
            if(data[idx].imageLink) {
              let url = data[idx].imageLink;

              if (data[idx].imageLink.includes('?')) {
                url = data[idx].imageLink + '&' + data[idx].targetData;
              } else {
                url = data[idx].imageLink + '?' + data[idx].targetData;
              }
              const linkTarget = data[idx].target === '_blank' ? '_blank' : '_self';
              imageSlide.onclick = () => { 
                  let offerClickScript = document.createElement('script');
                  offerClickScript.innerHTML = offerClickHTMLArr[idx];
                  imageSlide.append(offerClickScript);
                  window.open(url, linkTarget); 
              };
              imageSlide.style.cursor = 'pointer';
            }

            imageSlide.appendChild(canvasTag);

            referenceSlide = imageSlide;
            carouselSlider.appendChild(imageSlide);
          }
          
          const carouselDotIndicator = document.createElement('button');
          carouselDotIndicator.style = 'border: 0; border-radius: 50%; width: 15px; min-width: 15px; max-width: 15px; height: 15px; margin: 0 5px; cursor: pointer; padding: unset;'

          if(idx === 0) {
            carouselDotIndicator.style.background = 'rgba(0,0,0, 1)';
            carouselDotIndicator.className = 'current_slide';
            imageSlide.className = 'current_slide';
          }
          else {
            carouselDotIndicator.style.background = 'rgba(0,0,0, 0.3)';
          }
          carouselDotsNavigator.appendChild(carouselDotIndicator);
        });

        const scriptTag = document.createElement('script');
        scriptTag.innerHTML = embedJs;
        carouselContainer.append(scriptTag);

        const validVariables = variables.filter(variable => {
          return variable.length > 0;
        });

        const canvas = document.getElementById(validVariables[0][1]);
        const canvasWidth = parseInt(canvas.style.width);
        const canvasHeight = parseInt(canvas.style.height);
        const parentContainerWidth = parseInt(window.getComputedStyle(carouselContainer, null).getPropertyValue('width'));
        carouselContent.style.height = canvas.style.height;

        let isParentContainerSmaller;

        if (canvasWidth > parentContainerWidth) {
          isParentContainerSmaller = true;
        }
        else {
          isParentContainerSmaller = false;
        }

        let reducedWidth;
        if (platform === 'mobile') {
          reducedWidth = canvasWidth * 0.85;
        }
        else {
          reducedWidth = canvasWidth * 0.95;
        }
        let newRatio;

        if (isParentContainerSmaller) {
          if (platform === 'mobile') {
            newRatio = Math.min((parentContainerWidth * 0.75) / canvasWidth, 1);  
          }
          else {
            newRatio = Math.min((parentContainerWidth) / canvasWidth, 1);
          }
        }
        else {
          newRatio = Math.min(reducedWidth / canvasWidth, 1);
        }
        if (isFullWidth) newRatio = 1;
        validVariables.forEach(variable => {              
          let tempCanvas = document.getElementById(variable[1]);
          if (!isFullWidth) {
            tempCanvas.style.width = (canvasWidth * newRatio).toString() + 'px';
            tempCanvas.style.height = (canvasHeight * newRatio).toString() + 'px';
            tempCanvas.parentElement.style.width = (canvasWidth * newRatio).toString() + 'px';
            tempCanvas.parentElement.style.height = (canvasHeight * newRatio).toString() + 'px';      
          } else {
            carouselContent.style.width = '100% !important';
            carouselContent.style.height = 'none !important';
            tempCanvas.style.width = '100% !important';
            tempCanvas.style.height = 'none !important';
            tempCanvas.parentElement.style.width = '100% !important';
            tempCanvas.parentElement.style.height = 'none !important';
          }    
        });
        if (!isFullWidth) {
          carouselContainer.style.maxWidth = (canvasWidth + 80).toString() + 'px';    
        }
        me.disconnect();
        return;
      } 
      else {
        let imageData = new Image();
        imageData.onload = function() {
          data.forEach((imageInfo, idx) => {
            const imageSlide = document.createElement('div');
            imageSlide.style = 'flex-shrink: 0; display: flex; justify-content: center; align-items: center;';
            imageSlide.style.flexBasis = sectionPercentage;
            imageSlide.setAttribute('data-idx', idx);
            const img = document.createElement('img');
            img.onclick = function() {
              console.log("image clicked - add GA")
              let offerClickScript = document.createElement('script');
              offerClickScript.innerHTML = offerClickHTMLArr[idx];
              imageSlide.append(offerClickScript);
            };  

            img.src = imageInfo.imageUrl;
            img.alt = imageInfo.imageAltText; 
            if (isFullWidth) {
              img.style.maxWidth = 'none !important';
            } else {
              img.style.maxWidth = this.width.toString() + 'px';
            }            

            if (imageInfo.imageLink) {                
              let url = imageInfo.imageLink;

              if (imageInfo.imageLink.includes('?')) {
                url = imageInfo.imageLink + '&' + imageInfo.targetData;
              } else {
                url = imageInfo.imageLink + '?' + imageInfo.targetData;
              }

              const linkTarget = imageInfo.target === '_blank' ? '_blank' : '_self';
              img.onclick = () => { 
                  let offerClickScript = document.createElement('script');
                  offerClickScript.innerHTML = offerClickHTMLArr[idx];
                  imageSlide.append(offerClickScript);
                  window.open(url, linkTarget); 
              };
              img.style.cursor = 'pointer';
            }
                          
            img.style.width = '93%';
            imageSlide.appendChild(img);
                          
            carouselSlider.appendChild(imageSlide);

            if (platform === 'mobile') {
              img.style.width = '75%';
            }

            if (isFullWidth) {
              img.style.width = '100%';
            }
            const carouselDotIndicator = document.createElement('button');
            carouselDotIndicator.style = 'border: 0; border-radius: 50%; width: 15px; min-width: 15px; max-width: 15px; height: 15px; margin: 0 5px; cursor: pointer; padding: unset;'

            if (idx === 0) {
              carouselDotIndicator.style.background = 'rgba(0,0,0, 1)';
              carouselDotIndicator.className = 'current_slide';
              imageSlide.className = 'current_slide';
              actualDOMImageHeight = window.getComputedStyle(img, null).getPropertyValue('height');
              actualDOMImageWidth = window.getComputedStyle(img, null).getPropertyValue('width');
            }
            else {
              carouselDotIndicator.style.background = 'rgba(0,0,0, 0.3)';
            }
            carouselDotIndicator.setAttribute('data-idx', idx);
            carouselDotsNavigator.appendChild(carouselDotIndicator);
          });

          if (platform === 'mobile') {
            carouselContent.style.height = actualDOMImageHeight;
          } else {
            carouselContent.style.height = 'auto';
          }

          if (!isFullWidth) {
            carouselContainer.style.maxWidth = (parseInt(actualDOMImageWidth) + 80).toString() + 'px';
          }
        };
        imageData.src = data[0].imageUrl;
        me.disconnect();
        return;
      }
    }
  })
}

        
    const createStackResponse = (
      data,
      cssSelector,
      idx,
      modifiers,
      isEmbedAsHTML,
      embedJs,
      variables,
      seoTextList,
      schemaInfoList,
      offerImpressionList,
      ) => {
      return new MutationObserver(function(mutations, me){
        let offerImpressHTMLArr = [];
        let offerClickHTMLArr = [];
        if(offerImpressionList){
          for(const offerInd of offerImpressionList) {
          const impressionKeys = Object.keys(offerInd);
        
          let offerImpressHTML = "";
          let offerClickHTML = "";

          offerImpressHTML += ("event" + ': "' + "offerImpression") + '",';
          offerClickHTML += ("event" + ': "' + "offerClick") + '",';
          const offerKey = "num_of_offers";
          offerImpressHTML += ("num_of_offers" + ': "' + (offerInd[offerKey] || "")) + '",'; 
          impressionKeys.forEach(impressKey => {
            if(impressKey.includes("offerImpression")){
              offerImpressHTML += (impressKey + ': "' + offerInd[impressKey]) + '",';    
            }
        
            if(impressKey.includes("offerClick")){
              offerClickHTML += (impressKey + ': "' + offerInd[impressKey]) + '",';
            }
          });
        
          impressionHTMLStr = "window.dataLayer = window.dataLayer || [];" + "window.dataLayer.push({" + offerImpressHTML + "});";
          clickHTMLStr = "window.dataLayer = window.dataLayer || [];" + "window.dataLayer.push({" + offerClickHTML + "});";
          offerImpressHTMLArr.push(impressionHTMLStr);
          offerClickHTMLArr.push(clickHTMLStr);
          }
        }

        let div;
        let platform;
        if(cssSelector.mobile && window.innerWidth <= 740) {
          div = document.querySelector(cssSelector.mobile);
          platform = 'mobile'
        }
        else if(cssSelector.desktop && window.innerWidth > 740) {
          div = document.querySelector(cssSelector.desktop);
          platform = 'desktop'
        }
        else {
          return;
        }
        if (div) {
          cssSelector = cssSelector[platform];
          let wrapper = document.createElement('div');
          injectToHTML(modifiers[platform], cssSelector, wrapper);

          let xDown = null;
          let yDown = null;
          let isCanvasPointerEventOn = isEmbedAsHTML;

          wrapper.addEventListener('touchstart', function (e) {
            xDown = e.touches[0].clientX; 
            yDown = e.touches[0].clientY;
          });

          wrapper.addEventListener('touchmove', function(e) {
            if (!xDown || !yDown) return;
            let xUp = e.touches[0].clientX;
            let yUp = e.touches[0].clientY;
            
            let xDiff = xDown - xUp;
            let yDiff = yDown - yUp;

            if (Math.abs(xDiff) + Math.abs(yDiff) > 50) {
              if (isCanvasPointerEventOn && isEmbedAsHTML) {
                const validVariables = variables.filter(variable => {
                  return variable.length > 0;
                });
                validVariables.forEach(variable => {
                  document.getElementById(variable[1]).parentElement.style.pointerEvents = 'none';
                });
                isCanvasPointerEventOn = false;
              }              
              xDown = null;
              yDown = null;
            }
          });

          if (isEmbedAsHTML) {
            for(let i = 0; i < variables.length; i++) {
              let div = document.createElement('div');
              div.style = 'display: flex; justify-content: center; align-items: center; width: 100%; padding: 1%';
              let canvasTag = document.createElement('canvas');
              let img = document.createElement('img');
              img.onclick = function() {
                console.log("image clicked - add GA")
                let offerClickScript = document.createElement('script');
                offerClickScript.innerHTML = offerClickHTMLArr[i];
                wrapper.append(offerClickScript);
              };   

              if (variables[i].length === 0) {
                img.src = data[i].imageUrl;
                img.onclick = function() {
                  console.log("image clicked - add GA")
                  let offerClickScript = document.createElement('script');
                  offerClickScript.innerHTML = offerClickHTMLArr[i];
                  wrapper.append(offerClickScript);
                };
                if (data[i].imageLink) {
                  let a = document.createElement('a');
                  a.href = data[i].imageLink;
                  if (data[i].imageLink.includes('?')) {
                    a.href = data[i].imageLink + '&' + data[i].targetData
                  } else {
                    a.href = data[i].imageLink + '?' + data[i].targetData
                  }
                  if(data[i].target) a.target = data[i].target;
                  if(a.target === '_blank') a.rel = 'noreferrer noopener';
                  a.appendChild(img);
                  div.appendChild(a);
                }
                else div.appendChild(img);
                wrapper.append(div);
              }
              else {
                canvasTag.id = variables[i][1];
                canvasTag.style.pointerEvents = 'none';
                if (data[i].imageLink) {
                  let a = document.createElement('a');
                  a.href = data[i].imageLink;
                  a.onclick = function() {
                    console.log("image clicked - add GA")
                    let offerClickScript = document.createElement('script');
                    offerClickScript.innerHTML = offerClickHTMLArr[i];
                    wrapper.append(offerClickScript);
                  };
                  if (data[i].imageLink.includes('?')) {
                    a.href = data[i].imageLink + '&' + data[i].targetData
                  } else {
                    a.href = data[i].imageLink + '?' + data[i].targetData
                  }
                  if(data[i].target) a.target = data[i].target;
                  if(a.target === '_blank') a.rel = 'noreferrer noopener';
                  a.append(canvasTag);
                  div.append(a);
                }
                else div.append(canvasTag);
                wrapper.append(div);
              }
            }
            wrapper.style = 'width: 100%; margin-top: 10px; margin-bottom: 10px;';
            let scriptTag = document.createElement('script');
            scriptTag.innerHTML = embedJs;
            wrapper.append(scriptTag);

            const validVariables = variables.filter(variable => {
              if (variable.length > 0) return variable;
            });
            let canvas = document.getElementById(validVariables[0][1]);

            const canvasWidth = parseInt(canvas.style.width);
            const canvasHeight = parseInt(canvas.style.height);

            let parentContainerWidth = window.getComputedStyle(wrapper.parentElement, null).getPropertyValue('width');
            parentContainerWidth = parseInt(parentContainerWidth);
            const properWidth = parentContainerWidth > canvasWidth ? canvasWidth : parentContainerWidth;

            if (canvasWidth > properWidth && platform === 'desktop') {
              const newRatio = Math.min(parentContainerWidth / canvasWidth, 1);
              validVariables.forEach(variable => {
                let tempCanvas = document.getElementById(variable[1]);
                tempCanvas.style.width = (canvasWidth * newRatio).toString() + 'px';
                tempCanvas.style.height = (canvasHeight * newRatio).toString() + 'px';
                tempCanvas.parentElement.style.width = properWidth.toString() + 'px';
                tempCanvas.nextSibling.style.width = properWidth.toString() + 'px';
              });
            }
          }
          else {
            let imageData = new Image();
            imageData.src = data[0].imageUrl;
            imageData.onload = function() {
              wrapper.style = 'width: 100%; margin-top: 10px; margin-bottom: 10px;';
              for(let idx = 0; idx < data.length; idx++) {
                let div = document.createElement('div');
                let img = document.createElement('img');
                img.onclick = function() {
                  console.log("image clicked - add GA")
                  let offerClickScript = document.createElement('script');
                  offerClickScript.innerHTML = offerClickHTMLArr[idx];
                  wrapper.append(offerClickScript);
                };  
                if(data[idx].imageLink) {
                  let a = document.createElement('a');
                  a.href = data[idx].imageLink;
                  a.onclick = function() {
                    console.log("image clicked - add GA")
                    let offerClickScript = document.createElement('script');
                    offerClickScript.innerHTML = offerClickHTMLArr[idx];
                    wrapper.append(offerClickScript);
                  };
                  if (data[idx].imageLink.includes('?')) {
                    a.href = data[idx].imageLink + '&' + data[idx].targetData
                  } else {
                    a.href = data[idx].imageLink + '?' + data[idx].targetData
                  }
                  if(data[idx].target) a.target = data[idx].target;
                  if(a.target === '_blank') a.rel = 'noreferrer noopener';
                  a.appendChild(img);
                  div.appendChild(a);
                }
                else div.appendChild(img);
                div.style = 'display: flex; justify-content: center; padding: 1%;';
                img.src = data[idx].imageUrl;
                img.alt = data[idx].imageAltText;
                img.onclick = function() {
                  console.log("image clicked - add GA")
                  let offerClickScript = document.createElement('script');
                  offerClickScript.innerHTML = offerClickHTMLArr[idx];
                  wrapper.append(offerClickScript);
                };
                if(platform === 'mobile') {
                  img.style.width = '100%';
                }
                else if(this.width > 2500) img.style.width = '100%';
                wrapper.appendChild(div);
              }
            }
          }
          if (seoTextList && !!seoTextList.length) {
            let text = "";
            seoTextList.forEach(seoText => {
              text += seoText;
            });
            let seoTag = document.createElement('div');
            seoTag.innerHTML = text;
            seoTag.style.display = 'none';
            wrapper.append(seoTag);
          }
          if (schemaInfoList) {
            const schemaInfo = [];
            for (let i = 0; i < schemaInfoList.length; i++) {
              schemaInfo.push(createSchemaObjects(schemaInfoList[i], data[i].imageUrl));
              let seoDiv = document.createElement('div');
              seoDiv.style.display = 'none';
              let productDiv = document.createElement('div');
              productDiv.id = 'product';
              seoDiv.append(productDiv);
    
              let strongText = document.createElement('strong');
              strongText.innerHTML = schemaInfoList[i].name || '';
              productDiv.append(strongText);
    
              let paragraph = document.createElement('p');
              paragraph.innerHTML = schemaInfoList[i].text || '';
              productDiv.append(paragraph);
              if(offerImpressionList){
                const impressionKeys = Object.keys(offerImpressionList[i]);
                impressionKeys.forEach(impressKey => {
                  let impressionP = document.createElement('p');
                  impressionP.innerHTML = offerImpressionList[i][impressKey] || '';
                  productDiv.append(impressionP);
                });
                let offerImpressionScript = document.createElement('script');
                offerImpressionScript.innerHTML = offerImpressHTMLArr[i];
                wrapper.append(offerImpressionScript);
              }
    
              let image = document.createElement('img');
              image.src = data.imageUrl;
              image.onclick = () => {
                console.log("image clicked - add GA")
              };
              productDiv.append(image);
    
              let stamp = document.createElement('p');
              stamp.innerHTML = schemaInfoList[i].stamp || '';
              productDiv.append(stamp);
    
              wrapper.append(seoDiv);
            }
            let schemaTag = document.createElement('script');
            schemaTag.type = 'application/ld+json';
            schemaTag.innerHTML = JSON.stringify(schemaInfo);
            wrapper.append(schemaTag);
          }
          me.disconnect();
          return;
        }
      });
    }
  
        
const createMultiImageCarousel = (
  data,
  cssSelector,
  idx,
  modifiers,
  isEmbedAsHTML,
  embedJs,
  variables,
  seoTextList,
  schemaInfoList,
  isAutoScrollEnabled,
  transitionTime,
  timeUntilNextTransition,
  offerImpressionList,
) => {
  return new MutationObserver(async (mutations, me) => {
    let offerImpressHTMLArr = [];
    let offerClickHTMLArr = [];
    if(offerImpressionList){
      for(const offerInd of offerImpressionList) {
      const impressionKeys = Object.keys(offerInd);
     
      let offerImpressHTML = "";
      let offerClickHTML = "";

      offerImpressHTML += ("event" + ': "' + "offerImpression") + '",';
      offerClickHTML += ("event" + ': "' + "offerClick") + '",';
      const offerKey = "num_of_offers";
      offerImpressHTML += ("num_of_offers" + ': "' + (offerInd[offerKey] || "")) + '",'; 
      impressionKeys.forEach(impressKey => {
        if(impressKey.includes("offerImpression")){
          offerImpressHTML += (impressKey + ': "' + offerInd[impressKey]) + '",';    
        }
    
        if(impressKey.includes("offerClick")){
          offerClickHTML += (impressKey + ': "' + offerInd[impressKey]) + '",';
        }
      });
    
      let impressionHTMLStr = "window.dataLayer = window.dataLayer || [];" + "window.dataLayer.push({" + offerImpressHTML + "});";
      let clickHTMLStr = "window.dataLayer = window.dataLayer || [];" + "window.dataLayer.push({" + offerClickHTML + "});";
      offerImpressHTMLArr.push(impressionHTMLStr);
      offerClickHTMLArr.push(clickHTMLStr);
      }
    }
    let offerNavLeftHTML = "";
    let offerNavRightHTML = "";
    offerNavLeftHTML += "window.dataLayer = window.dataLayer || [];" + "window.dataLayer.push({";
    offerNavLeftHTML += ("event" + ': "' + "navigationInteraction") + '",';
    offerNavLeftHTML += ("navigationInteraction_action" + ': "' + "left arrow click") + '",';
    offerNavLeftHTML += "});";

    offerNavRightHTML += "window.dataLayer = window.dataLayer || [];" + "window.dataLayer.push({";
    offerNavRightHTML += ("event" + ': "' + "navigationInteraction") + '",';
    offerNavRightHTML += ("navigationInteraction_action" + ': "' + "right arrow click") + '",';
    offerNavRightHTML += "});";
    let div;
    let platform;
    if (cssSelector.mobile && window.innerWidth <= 740) {
      div = document.querySelector(cssSelector.mobile);
      platform = 'mobile';
    }
    else if (cssSelector.desktop && window.innerWidth > 740) {
      div = document.querySelector(cssSelector.desktop);
      platform = 'desktop';
    }
    else {        
      return;
    }

    if (div) {
      const targetCssSelector = cssSelector[platform];
      let carouselContainer = document.createElement('div');
      injectToHTML(modifiers[platform], targetCssSelector, carouselContainer);
      carouselContainer.style = 'margin: 0 auto; position: relative; max-width: 90% !important; position: relative; margin-top: 10px; margin-bottom: 10px;';
      carouselContainer.id = 'carousel_' + makeRandomString();

      const controlsContainer = document.createElement('div');
      controlsContainer.className = 'carousel-controls';

      const rightBtnId = 'carousel_right_btn_' + makeRandomString();
      let rightBtn = document.createElement('button');
      rightBtn.id = rightBtnId;
      rightBtn.style = 'position: absolute; right: -40px; top: 50%; background: none; border: none; cursor: pointer; outline: none;';
      let rightBtnIcon = document.createElement('img');
      rightBtnIcon.src = 'https://av2-internal-web-int-dev.s3.amazonaws.com/images/rightArrow.svg';
      rightBtnIcon.alt = 'carousel right button icon';
      rightBtnIcon.style = 'width: 30px;';
      rightBtn.appendChild(rightBtnIcon);
      controlsContainer.appendChild(rightBtn);

      const leftBtnId = 'carousel_left_btn_' + makeRandomString();
      let leftBtn = document.createElement('button');
      leftBtn.id = leftBtnId;
      leftBtn.style = 'position: absolute; left: -40px; top: 50%; background: none; border: none; cursor: pointer; outline: none;';
      let leftBtnIcon = document.createElement('img');
      leftBtnIcon.src = 'https://av2-internal-web-int-dev.s3.amazonaws.com/images/leftArrow.svg';
      leftBtnIcon.alt = 'carousel left button icon';
      leftBtnIcon.style = 'width: 30px;';
      leftBtn.appendChild(leftBtnIcon);
      controlsContainer.appendChild(leftBtn);

      const carouselContentId = 'carousel_content_' + makeRandomString();
      const carouselContent = document.createElement('div');
      carouselContent.id = carouselContentId;
      carouselContent.style = 'width: 100%; height: 300px; display: flex; justify-content: flex-start; overflow: hidden;';
      carouselContainer.appendChild(carouselContent);

      const carouselSliderId = 'carousel_slider_' + makeRandomString();
      let carouselSlider = document.createElement('div');
      carouselSlider.id = carouselSliderId;
      carouselSlider.style = 'display: flex; height: 100%; flex-shrink: 0';
      
      if (transitionTime) {
        const slideTimeTransition = transitionTime === '0' ? '0.75' : transitionTime;
        carouselSlider.style.transition = 'all ' + (slideTimeTransition * 1000).toString() + 'ms';
      } else {
        carouselSlider.style.transition = 'all 625ms';
      }

      carouselContent.appendChild(carouselSlider);
      carouselContainer.appendChild(controlsContainer);

      let carouselDotsNavigator = document.createElement('div');
      carouselDotsNavigator.style = 'display: flex; justify-content: center; padding: 10px 0;';
      carouselContainer.appendChild(carouselDotsNavigator);

      const sectionPercentage = (100 / data.length).toString() + '%';
      
      let direction = -1;      

      const updateDots = (currentDot, targetDot) => {
        currentDot.classList.remove('current_slide');
        currentDot.style = 'border: 0; border-radius: 50%; width: 15px; min-width: 15px; max-width: 15px; height: 15px; margin: 0 5px; cursor: pointer; padding: unset;';
        targetDot.style = 'border: 0; border-radius: 50%; width: 15px; min-width: 15px; max-width: 15px; height: 15px; margin: 0 5px; cursor: pointer; padding: unset;';
        targetDot.classList.add('current_slide');
        targetDot.style.background = 'rgba(0,0,0, 1)';
        currentDot.style.background = 'rgba(0,0,0, 0.3)';
      }

      let autoScrollInterval = null;
      
      const clearAutoScroll = () => {
        clearInterval(autoScrollInterval);
        autoScrollInterval = setInterval(() => {
          rightBtn.click();
        },
        parseFloat(timeUntilNextTransition) * 1000
        );
      };

      if (isAutoScrollEnabled) {
        autoScrollInterval = setInterval(() => {
          rightBtn.click();
        },
        parseFloat(timeUntilNextTransition) * 1000
        );
      }

      rightBtn.addEventListener('click', (e) => {
        let rightClickScript = document.createElement('script');
        rightClickScript.innerHTML = offerNavRightHTML;
        rightBtn.append(rightClickScript);         
        e.stopPropagation();

        let newSectionPercentage = platform === 'desktop' 
          ? (parseInt(sectionPercentage) + 1).toString() + '%' 
          : sectionPercentage;

        if (autoScrollInterval) {
          clearAutoScroll();
        }

        if (direction === 1 && platform === 'mobile') {
          carouselSlider.prepend(carouselSlider.lastElementChild);
        }

        direction = -1;
        carouselContent.style.justifyContent = 'flex-start';
        carouselSlider.style.transform = 'translate(-' + newSectionPercentage + ')';
      });

      leftBtn.addEventListener('click', (e) => {
        let leftClickScript = document.createElement('script');
        leftClickScript.innerHTML = offerNavLeftHTML;
        leftBtn.append(leftClickScript);
        e.stopPropagation();

        let newSectionPercentage = platform === 'desktop' 
          ? (parseInt(sectionPercentage) + 1).toString() + '%' 
          : sectionPercentage;

        if (autoScrollInterval) {
          clearAutoScroll();
        }

        if (direction === -1 && platform === 'mobile') {
          carouselSlider.appendChild(carouselSlider.firstElementChild);
        }

        direction = 1;
        if (platform === 'mobile') {
          carouselContent.style.justifyContent = 'flex-end';
        }
        carouselSlider.style.transform = 'translate(' + newSectionPercentage + ')';
      });

      carouselSlider.addEventListener('transitionend', () => {
        if (direction === 1) {
          carouselSlider.prepend(carouselSlider.lastElementChild);
        } else {
          carouselSlider.appendChild(carouselSlider.firstElementChild);
        }

        carouselSlider.style.transition = 'none';
        carouselSlider.style.transform = 'translate(0)';

        let targetDot;

        const currentDot = carouselDotsNavigator.querySelector('.current_slide');
          
        if (direction === -1) {
          targetDot = currentDot.nextElementSibling;
          if (!targetDot) {
            targetDot = carouselDotsNavigator.firstElementChild;
          }
        }
        else {
          targetDot = currentDot.previousElementSibling;
          if (!targetDot) {
            targetDot = carouselDotsNavigator.lastElementChild;
          }
        }
        updateDots(currentDot, targetDot);

        setTimeout(() => {
          if (transitionTime) {
            const slideTimeTransition = transitionTime === '0' ? '0.75' : transitionTime;
            carouselSlider.style.transition = 'all ' + (slideTimeTransition * 1000).toString() + 'ms';
          } else {
            carouselSlider.style.transition = 'all 625ms';
          }
        });
      }, false);

      if (platform === 'mobile') {
        carouselContainer.style.width = '100%';
        carouselContainer.style.maxWidth = '100%';
        carouselSlider.style.width = (data.length * 100).toString() + '%';
        rightBtn.style.right = 0;
        leftBtn.style.left = 0;
      }

      if (seoTextList && seoTextList.length > 0) {
        let text = '';
        seoTextList.forEach(seoText => {
          text += seoText;
        });
        let seoTag = document.createElement('div');
        seoTag.innerHTML = text;
        seoTag.style.display = 'none';
        carouselContainer.append(seoTag);
      }

      if (schemaInfoList) {
        const schemaInfo = [];
        for (let i = 0; i < schemaInfoList.length; i++) {
          schemaInfo.push(createSchemaObjects(schemaInfoList[i], data[i].imageUrl));
          let seoDiv = document.createElement('div');
          seoDiv.style.display = 'none';
          let productDiv = document.createElement('div');
          productDiv.id = 'product';
          seoDiv.append(productDiv);
          
          let strongText = document.createElement('strong');
          strongText.innerHTML = schemaInfoList[i].name || '';
          productDiv.append(strongText);
          
          let paragraph = document.createElement('p');
          paragraph.innerHTML = schemaInfoList[i].text || '';
          productDiv.append(paragraph);

          if(offerImpressionList){
            const impressionKeys = Object.keys(offerImpressionList[i]);
            impressionKeys.forEach(impressKey => {
              let impressionP = document.createElement('p');
              impressionP.innerHTML = offerImpressionList[i][impressKey] || '';
              productDiv.append(impressionP);
            });
            let offerImpressionScript = document.createElement('script');
              offerImpressionScript.innerHTML = offerImpressHTMLArr[i];
              productDiv.append(offerImpressionScript);
          }
          
          let image = document.createElement('img');
          image.src = data[i].imageUrl;
          image.onclick = () => {
            console.log("image clicked - add GA")
          }
          productDiv.append(image);
          
          let stamp = document.createElement('p');
          stamp.innerHTML = schemaInfoList[i].stamp || '';
          productDiv.append(stamp);
          
          carouselContainer.append(seoDiv);
        }
        let schemaTag = document.createElement('script');
        schemaTag.type = 'application/ld+json';
        schemaTag.innerHTML = JSON.stringify(schemaInfo);
        carouselContainer.append(schemaTag);
      }

      let xDown = null;
      let yDown = null;
      let isCanvasPointerEventOn = isEmbedAsHTML;

      carouselContent.addEventListener('touchstart', function (e) {
        xDown = e.touches[0].clientX;
        yDown = e.touches[0].clientY;
      });

      carouselContent.addEventListener('touchmove', function(e) {
        if (!xDown || !yDown) return;
        let xUp = e.touches[0].clientX;
        let yUp = e.touches[0].clientY;
        
        let xDiff = xDown - xUp;
        let yDiff = yDown - yUp;
        
        if (Math.abs(xDiff) + Math.abs(yDiff) > 50) {
          if (isCanvasPointerEventOn && isEmbedAsHTML) {
            const validVariables = variables.filter(variable => {
              return variable.length > 0;
            });
            validVariables.forEach(variable => {
              document.getElementById(variable[1]).parentElement.style.pointerEvents = 'none';
            });
            isCanvasPointerEventOn = false;
          }
          if (Math.abs(xDiff) > Math.abs(yDiff)) {
            if (xDiff > 0) rightBtn.click();
            else leftBtn.click();
          }
          xDown = null;
          yDown = null;
        }
      });

      let actualDOMImageHeight;
      let actualDOMImageWidth;
      
      if (isEmbedAsHTML) {
        let referenceSlide;                    
        
        variables.forEach((variable, idx) => {
          const imageSlide = document.createElement('div');
          imageSlide.style = 'flex-shrink: 0; display: flex; justify-content: center; align-items: center; padding: 0.5%;';
          imageSlide.style.flexBasis = sectionPercentage;
          imageSlide.setAttribute('data-idx', idx);
          
          const canvasTag = document.createElement('canvas');
          canvasTag.style.pointerEvents = 'none';
          const img = document.createElement('img');
          img.onclick = function() {
            console.log("image clicked - add GA")
            let offerClickScript = document.createElement('script');
            offerClickScript.innerHTML = offerClickHTMLArr[idx];
            imageSlide.append(offerClickScript);
          };  
          
          if (platform === 'mobile') {
            imageSlide.style.padding = 0;
          }
          
          if (variable.length === 0) {
            const imageData = new Image();
            imageData.onload = () => {
              if (platform === 'desktop') {
                img.style.minWidth = this.width.toString() + 'px';
                img.style.maxWidth = this.width.toString() + 'px';
              } 
              else {
                img.style.width = '100%';
              }
            }; 
            imageData.src = data[idx].imageUrl;
            img.src = data[idx].imageUrl;
            if (data[idx].imageLink) {
              let url = data[idx].imageLink;

              if (data[idx].imageLink.includes('?')) {
                url = data[idx].imageLink + '&' + data[idx].targetData;
              } else {
                url = data[idx].imageLink + '?' + data[idx].targetData;
              }
              
              const linkTarget = data[idx].target === '_blank' ? '_blank' : '_self';
              img.onclick = () => { 
                let offerClickScript = document.createElement('script');
                offerClickScript.innerHTML = offerClickHTMLArr[idx];
                imageSlide.append(offerClickScript);
                window.open(url, linkTarget); };
              img.style.cursor = 'pointer';
            }

            imageSlide.appendChild(img);
            carouselSlider.appendChild(imageSlide);
          }
          else {
            canvasTag.id = variable[1];
            if(data[idx].imageLink) {
              let url = data[idx].imageLink;

              if (data[idx].imageLink.includes('?')) {
                url = data[idx].imageLink + '&' + data[idx].targetData;
              } else {
                url = data[idx].imageLink + '?' + data[idx].targetData;
              }
              const linkTarget = data[idx].target === '_blank' ? '_blank' : '_self';
              imageSlide.onclick = () => { 
                let offerClickScript = document.createElement('script');
                offerClickScript.innerHTML = offerClickHTMLArr[idx];
                imageSlide.append(offerClickScript);
                window.open(url, linkTarget); };
              imageSlide.style.cursor = 'pointer';
            }
            
            imageSlide.appendChild(canvasTag);
            
            referenceSlide = imageSlide;
            carouselSlider.appendChild(imageSlide);
          }
          
          const carouselDotIndicator = document.createElement('button');
          carouselDotIndicator.style = 'border: 0; border-radius: 50%; width: 15px; min-width: 15px; max-width: 15px; height: 15px; margin: 0 5px; cursor: pointer; padding: unset;'

          if(idx === 0) {
            carouselDotIndicator.style.background = 'rgba(0,0,0, 1)';
            carouselDotIndicator.className = 'current_slide';
            imageSlide.className = 'current_slide';
          }
          else {
            carouselDotIndicator.style.background = 'rgba(0,0,0, 0.3)';
          }
          carouselDotsNavigator.appendChild(carouselDotIndicator);
        });

        const scriptTag = document.createElement('script');
        scriptTag.innerHTML = embedJs;
        carouselContainer.append(scriptTag);

        const validVariables = variables.filter(variable => {
          return variable.length > 0;
        });

        const canvas = document.getElementById(validVariables[0][1]);
        const canvasWidth = parseInt(canvas.style.width);
        const canvasHeight = parseInt(canvas.style.height);
        const parentContainerWidth = parseInt(window.getComputedStyle(carouselContainer, null).getPropertyValue('width'));
        carouselContent.style.height = canvas.style.height;

        let isParentContainerSmaller;

        if (canvasWidth > parentContainerWidth) {
          isParentContainerSmaller = true;
        }
        else {
          isParentContainerSmaller = false;
        }

        let reducedWidth;
        if (platform === 'mobile') {
          reducedWidth = canvasWidth * 0.85;
          carouselContainer.style.maxWidth = (canvasWidth + 80).toString() + 'px';
        }
        else {
          reducedWidth = canvasWidth * 0.95;
        }
        let newRatio;

        if (isParentContainerSmaller) {
          if (platform === 'mobile') {
            newRatio = Math.min((parentContainerWidth * 0.75) / canvasWidth, 1);  
          }
          else {
            newRatio = Math.min((parentContainerWidth) / canvasWidth, 1);
          }
        }
        else {
          newRatio = Math.min(reducedWidth / canvasWidth, 1);
        }
        validVariables.forEach(variable => {              
          let tempCanvas = document.getElementById(variable[1]);
          tempCanvas.style.width = (canvasWidth * newRatio).toString() + 'px';
          tempCanvas.style.height = (canvasHeight * newRatio).toString() + 'px';
          tempCanvas.parentElement.style.width = (canvasWidth * newRatio).toString() + 'px';
          tempCanvas.parentElement.style.height = (canvasHeight * newRatio).toString() + 'px';          
        });
        me.disconnect();
        return;
      } 
      else {
        let imageData = new Image();
        imageData.onload = function() {
          data.forEach((imageInfo, idx) => {
            const imageSlide = document.createElement('div');
            imageSlide.style = 'flex-shrink: 0; display: flex; justify-content: center; align-items: center; padding: 0.5%;';
            imageSlide.style.flexBasis = sectionPercentage;
            imageSlide.setAttribute('data-idx', idx);
            const img = document.createElement('img');
            img.onclick = function() {
              console.log("image clicked - add GA")
              let offerClickScript = document.createElement('script');
              offerClickScript.innerHTML = offerClickHTMLArr[idx];
              imageSlide.append(offerClickScript);
            };  

            if (imageInfo.imageLink) {
              let url = imageInfo.imageLink;

              if (imageInfo.imageLink.includes('?')) {
                url = imageInfo.imageLink + '&' + imageInfo.targetData;
              } else {
                url = imageInfo.imageLink + '?' + imageInfo.targetData;
              }

              const linkTarget = imageInfo.target === '_blank' ? '_blank' : '_self';
              img.onclick = () => { 
                let offerClickScript = document.createElement('script');
                offerClickScript.innerHTML = offerClickHTMLArr[idx];
                imageSlide.append(offerClickScript);
                window.open(url, linkTarget); };
              img.style.cursor = 'pointer';
            }
            
            imageSlide.appendChild(img);
            
            img.src = imageInfo.imageUrl;
            img.alt = imageInfo.imageAltText;                         
            img.style.width = '95%';
            img.style.maxWidth = this.width.toString() + 'px';
            carouselSlider.appendChild(imageSlide);

            if (platform === 'mobile') {
              img.style.width = '75%';
              imageSlide.style.padding = 0;
            }
            const carouselDotIndicator = document.createElement('button');
            carouselDotIndicator.style = 'border: 0; border-radius: 50%; width: 15px; min-width: 15px; max-width: 15px; height: 15px; margin: 0 5px; cursor: pointer; padding: unset;'

            if (idx === 0) {
              carouselDotIndicator.style.background = 'rgba(0,0,0, 1)';
              carouselDotIndicator.className = 'current_slide';
              imageSlide.className = 'current_slide';
              actualDOMImageHeight = window.getComputedStyle(img, null).getPropertyValue('height');
              actualDOMImageWidth = window.getComputedStyle(img, null).getPropertyValue('width');
            }
            else {
              carouselDotIndicator.style.background = 'rgba(0,0,0, 0.3)';
            }
            carouselDotIndicator.setAttribute('data-idx', idx);
            carouselDotsNavigator.appendChild(carouselDotIndicator);
          });

          if (platform === 'mobile') {
            carouselContent.style.height = actualDOMImageHeight;
            carouselContainer.style.maxWidth = (parseInt(actualDOMImageWidth) + 80).toString() + 'px';
          } else {
            carouselContent.style.height = 'auto';
          }
        };
        imageData.src = data[0].imageUrl;
        me.disconnect();
        return;
      }
    }
  })
}

        
    const createJsCode = (
      type,
      data,
      cssSelector,
      idx,
      modifiers,
      isEmbedAsHTML,
      embedJs,
      variables,
      seoTextList,
      schemaInfoList,
      offerImpressionList,
      isAutoScrollEnabled,
      transitionTime,
      timeUntilNextTransition,
      ) => {
      switch (type) {
        case 'singleImage':
          return createSingleImageResponse(
            data[0],
            cssSelector,
            idx,
            modifiers,
            isEmbedAsHTML,
            embedJs,
            variables,
            seoTextList,
            schemaInfoList,
            offerImpressionList,
          ).observe(document, {childList: true, subtree: true});
        case 'grid':
          return createGridResponse(
            data,
            cssSelector,
            idx,
            modifiers,
            isEmbedAsHTML,
            embedJs,
            variables,
            seoTextList,
            schemaInfoList,
            offerImpressionList,
          ).observe(document, {childList: true, subtree: true});
        case 'carousel':
        case 'fullWidthCarousel':
          return createCarouselResponse(
            data,
            cssSelector,
            idx,
            modifiers,
            isEmbedAsHTML,
            embedJs,
            variables,
            seoTextList,
            schemaInfoList,
            isAutoScrollEnabled,
            transitionTime,
            timeUntilNextTransition,
            offerImpressionList,
            type === 'fullWidthCarousel',
          ).observe(document, {childList: true, subtree: true});
        case 'stack':
          return createStackResponse(
            data,
            cssSelector,
            idx,
            modifiers,
            isEmbedAsHTML,
            embedJs,
            variables,
            seoTextList,
            schemaInfoList,
            offerImpressionList,
          ).observe(document, {childList: true, subtree: true});
        case 'multiCarousel':
          return createMultiImageCarousel(
            data,
            cssSelector,
            idx,
            modifiers,
            isEmbedAsHTML,
            embedJs,
            variables,
            seoTextList,
            schemaInfoList,
            isAutoScrollEnabled,
            transitionTime,
            timeUntilNextTransition,
            offerImpressionList,
          ).observe(document, {childList: true, subtree: true});
        default:
          return null;
      }
    }
  
        const { instances } = {"domain":"www.lithiachryslermissoula.com","instances":[{"domain":"www.lithiachryslermissoula.com","instanceID":"846f33e8-15ee-4576-8883-f8107dc3cae5","integrationStatus":true,"integrationID":"","relativePath":"/new-inventory/jeep-grand-cherokee-missoula-mt.htm","mobileLocation":".ddc-page","mobilePositionModifer":"afterAsFirstChild","location":".ddc-wrapper","positionModifer":"afterAsFirstChild","type":"carousel","images":[{"imageUrl":"https://av2-ladtech-assets-prd.constellationagency.com/order-export/4b3562d0-6cfc-41f9-93aa-925b6ab7e67c_website_1c4rjkagxs8674298_950 x 250_2025_jeep_grand cherokee l_laredo__1.jpeg","imageAltText":"2025 Jeep Grand Cherokee L Laredo","imageLink":"","targetData":"AID=ladtech-prd-Lithia%20Chrysler%20Jeep%20Dodge%20of%20Missoula-1C4RJKAGXS8674298-2025-Jeep-Grand%20Cherokee%20L","target":"_parent"},{"imageUrl":"https://av2-ladtech-assets-prd.constellationagency.com/order-export/b4f501e2-92ef-4d36-84ba-6a21412533d1_website_1c4rjhbg4sc351962_950 x 250_2025_jeep_grand cherokee_limited__2.jpeg","imageAltText":"2025 Jeep Grand Cherokee Limited","imageLink":"","targetData":"AID=ladtech-prd-Lithia%20Chrysler%20Jeep%20Dodge%20of%20Missoula-1C4RJHBG4SC351962-2025-Jeep-Grand%20Cherokee","target":"_parent"}],"instanceStatus":"LIVE","createdBy":"","createdDate":1759445603332,"lastModifiedBy":"","lastModifiedDate":1759445603332,"launchLabel":"Oct MB Grand Cherokee","startDate":1759445854000,"endDate":1762243200000,"embedAsHTML":false,"embedHtmlUrl":"","variableNamesList":[],"schemaInfo":[{"price":42830,"modelDate":"2025","name":"2025 Jeep Grand Cherokee L Laredo","stamp":"ZERO DOWN LEASE per mo. for 36 mos., $0 due at signing. With Loyalty Offer $369 ","vin":"1C4RJKAGXS8674298","currency":"USD","text":"Shop Now New 2025 Jeep\nGrand Cherokee L\nLaredo 4x4 New 2025 Jeep Grand Cherokee L Laredo. 538 miles. Bright White Clearcoat. VIN 1C4RJKAGXS8674298. MSRP $42,830. ZERO-DOWN LEASE: 36 monthly payments of $369. Total due at lease signing, $0. Cap cost, $41,409, which includes first month's payment and $695 acquisition fee. $1,000 Bonus Cash $2,000 Lease Loyalty Bonus Cash (Must be in a current Stellantis lease). $500 Lease Bonus Cash $500 Jeep Monopoly Bonus Cash $0 security deposit. Lease end termination fee, $395. On approved credit. ALL OFFERS: Price does not include title, license or dealer doc fees. Images are for illustration purposes only. Offer expires 11/03/2025. "},{"price":50265,"modelDate":"2025","name":"2025 Jeep Grand Cherokee Limited","stamp":"$399 LEASE for 36 mo. $2,500 due at signing. With Loyalty Offer ","vin":"1C4RJHBG4SC351962","currency":"USD","text":"Shop Now New 2025 Jeep\nGrand Cherokee\nLimited 4x4 New 2025 Jeep Grand Cherokee Limited. 13 miles. Baltic Gray Metallic Clearcoat. VIN 1C4RJHBG4SC351962. MSRP $50,265. LEASE: 36 monthly lease payments of $399. Amount due at start, $2,500 which includes first month's payment. Payments include $695 acquisition fee. $2,500 Bonus Cash $500 Jeep Monopoly Bonus Cash $3,500 Lease Loyalty Bonus Cash $0 security deposit. Lease end termination fee, $395. On approved credit. ALL OFFERS: Price does not include title, license or dealer doc fees. Images are for illustration purposes only. Offer expires 11/03/2025. "}],"offerImpressions":[{"offerImpression_term":"36","offerClick_storeId":"MTMISDOD","offerImpression_body":"SUV","offerImpression_positionPreset":"MB Jeep Grand Cherokee + L","offerClick_trim":"Laredo","offerImpression_year":"2025","offerClick_positionPreset":"MB Jeep Grand Cherokee + L","offerImpression_type":"Zero Down Lease","offerClick_term":"36","event":null,"offerClick_price":42830,"offerClick_storeName":"Lithia Chrysler Jeep Dodge of Missoula","offerImpression_layout":"Carousel","offerClick_make":"Jeep","offerImpression_model":"Grand Cherokee L","offerImpression_theme":"FallForest_950x250.png | CJD - Bold - White - 1up","offerClick_salesEvent":null,"offerClick_dueSigning":"2242.3800","navigationInteraction_action":null,"offerClick_model":"Grand Cherokee L","offerClick_theme":"FallForest_950x250.png | CJD - Bold - White - 1up","offerClick_type":"Zero Down Lease","offerClick_body":"SUV","offerImpression_storeName":"Lithia Chrysler Jeep Dodge of Missoula","num_of_offers":"1","offerImpression_make":"Jeep","offerImpression_price":42830,"offerClick_year":"2025","offerClick_layout":"Carousel","offerImpression_storeId":"MTMISDOD","offerImpression_trim":"Laredo","offerImpression_salesEvent":null,"offerImpression_dueSigning":"2242.3800"},{"offerImpression_term":"36","offerClick_storeId":"MTMISDOD","offerImpression_body":"SUV","offerImpression_positionPreset":"MB Jeep Grand Cherokee + L","offerClick_trim":"Limited","offerImpression_year":"2025","offerClick_positionPreset":"MB Jeep Grand Cherokee + L","offerImpression_type":"Lease","offerClick_term":"36","event":null,"offerClick_price":"399","offerClick_storeName":"Lithia Chrysler Jeep Dodge of Missoula","offerImpression_layout":"Carousel","offerClick_make":"Jeep","offerImpression_model":"Grand Cherokee","offerImpression_theme":"FallForest_950x250.png | CJD - Bold - White - 1up","offerClick_salesEvent":null,"offerClick_dueSigning":"2500","navigationInteraction_action":null,"offerClick_model":"Grand Cherokee","offerClick_theme":"FallForest_950x250.png | CJD - Bold - White - 1up","offerClick_type":"Lease","offerClick_body":"SUV","offerImpression_storeName":"Lithia Chrysler Jeep Dodge of Missoula","num_of_offers":"1","offerImpression_make":"Jeep","offerImpression_price":"399","offerClick_year":"2025","offerClick_layout":"Carousel","offerImpression_storeId":"MTMISDOD","offerImpression_trim":"Limited","offerImpression_salesEvent":null,"offerImpression_dueSigning":"2500"}],"isAutoScrollEnabled":true,"transitionTime":"0.75","timeUntilNextTransition":"5"},{"domain":"www.lithiachryslermissoula.com","instanceID":"92a79705-2ad9-4e2c-81a0-fed707a445e2","integrationStatus":true,"integrationID":"","relativePath":"/","mobileLocation":".ladTechHsOffers","mobilePositionModifer":"afterAsFirstChild","location":".ladTechHsOffers","positionModifer":"afterAsFirstChild","type":"multiCarousel","images":[{"imageUrl":"https://av2-ladtech-assets-prd.constellationagency.com/order-export/2e2a7d39-7303-4308-b70e-7a12664a9be7_website_1c6pjtag9sl524443_600 x 400_2025_jeep_gladiator_sport __4.jpeg","imageAltText":"2025 Jeep Gladiator Sport ","imageLink":"https://www.lithiachryslermissoula.com/new-inventory/new-jeep-gladiator-for-sale-in-missoula-mt-ladrr.htm","targetData":"AID=ladtech-prd-Lithia%20Chrysler%20Jeep%20Dodge%20of%20Missoula-1C6PJTAG9SL524443-2025-Jeep-Gladiator","target":"_parent"},{"imageUrl":"https://av2-ladtech-assets-prd.constellationagency.com/order-export/d6024cd5-c460-46d5-b133-33825c533b21_website_1c4rjkagxs8674298_600 x 400_2025_jeep_grand cherokee l_laredo__1.jpeg","imageAltText":"2025 Jeep Grand Cherokee L Laredo","imageLink":"https://www.lithiachryslermissoula.com/new-inventory/new-jeep-grand-cherokee-for-sale-in-missoula-mt-ladrr.htm","targetData":"AID=ladtech-prd-Lithia%20Chrysler%20Jeep%20Dodge%20of%20Missoula-1C4RJKAGXS8674298-2025-Jeep-Grand%20Cherokee%20L","target":"_parent"},{"imageUrl":"https://av2-ladtech-assets-prd.constellationagency.com/order-export/e35c0bfe-017a-44a3-8867-65125616e9bf_website_1c4rjhbg4sc351962_600 x 400_2025_jeep_grand cherokee_limited__2.jpeg","imageAltText":"2025 Jeep Grand Cherokee Limited","imageLink":"https://www.lithiachryslermissoula.com/new-inventory/new-jeep-grand-cherokee-for-sale-in-missoula-mt-ladrr.htm","targetData":"AID=ladtech-prd-Lithia%20Chrysler%20Jeep%20Dodge%20of%20Missoula-1C4RJHBG4SC351962-2025-Jeep-Grand%20Cherokee","target":"_parent"},{"imageUrl":"https://av2-ladtech-assets-prd.constellationagency.com/order-export/e95a2025-fb98-4e93-b9ef-6314b9f4c6c0_website_1c6srfjp1sn742935_600 x 400_2025_ram_1500_laramie crew cab __0.jpeg","imageAltText":"2025 Ram 1500 Laramie Crew Cab ","imageLink":"https://www.lithiachryslermissoula.com/new-inventory/new-ram-1500-for-sale-in-missoula-mt-ladrr.htm","targetData":"AID=ladtech-prd-Lithia%20Chrysler%20Jeep%20Dodge%20of%20Missoula-1C6SRFJP1SN742935-2025-Ram-1500","target":"_parent"},{"imageUrl":"https://av2-ladtech-assets-prd.constellationagency.com/order-export/3a0aacfe-c163-4433-ac18-a0267bc41ec4_website_1c4pjxan1sw619950_600 x 400_2025_jeep_wrangler_sport__3.jpeg","imageAltText":"2025 Jeep Wrangler Sport","imageLink":"https://www.lithiachryslermissoula.com/new-inventory/new-jeep-wrangler-for-sale-in-missoula-mt-ladrr.htm","targetData":"AID=ladtech-prd-Lithia%20Chrysler%20Jeep%20Dodge%20of%20Missoula-1C4PJXAN1SW619950-2025-Jeep-Wrangler","target":"_parent"}],"instanceStatus":"LIVE","createdBy":"","createdDate":1759445603332,"lastModifiedBy":"","lastModifiedDate":1759445603332,"launchLabel":"Oct RR","startDate":1759445854000,"endDate":1762243200000,"embedAsHTML":false,"embedHtmlUrl":"","variableNamesList":[],"schemaInfo":[{"price":68125,"modelDate":"2025","name":"2025 Ram 1500 Laramie Crew Cab ","stamp":"$299 LEASE for 48 mo. $2,000 due at signing. ","vin":"1C6SRFJP1SN742935","currency":"USD","text":"Shop Now New 2025 Jeep\nGladiator\nSport 4x4 New 2025 Jeep Gladiator Sport. 9 miles. Firecracker Red Clearcoat. VIN 1C6PJTAG9SL524443. MSRP $43,850. LEASE: 48 monthly lease payments of $299. Amount due at start, $2,000 which includes first month's payment. Payments include $695 acquisition fee. $4,500 National Lease Bonus Cash $2,250 National Bonus Cash $0 security deposit. Lease end termination fee, $395. On approved credit. ALL OFFERS: Price does not include title, license or dealer doc fees. Images are for illustration purposes only. Offer expires 11/03/2025. "},{"price":42830,"modelDate":"2025","name":"2025 Jeep Grand Cherokee L Laredo","stamp":"ZERO DOWN LEASE per mo. for 36 mos., $0 due at signing. With Loyalty Offer $369 ","vin":"1C4RJKAGXS8674298","currency":"USD","text":"Shop Now New 2025 Jeep\nGrand Cherokee L\nLaredo 4x4 New 2025 Jeep Grand Cherokee L Laredo. 538 miles. Bright White Clearcoat. VIN 1C4RJKAGXS8674298. MSRP $42,830. ZERO-DOWN LEASE: 36 monthly payments of $369. Total due at lease signing, $0. Cap cost, $41,409, which includes first month's payment and $695 acquisition fee. $1,000 Bonus Cash $2,000 Lease Loyalty Bonus Cash (Must be in a current Stellantis lease). $500 Lease Bonus Cash $500 Jeep Monopoly Bonus Cash $0 security deposit. Lease end termination fee, $395. On approved credit. ALL OFFERS: Price does not include title, license or dealer doc fees. Images are for illustration purposes only. Offer expires 11/03/2025. "},{"price":50265,"modelDate":"2025","name":"2025 Jeep Grand Cherokee Limited","stamp":"$399 LEASE for 36 mo. $2,500 due at signing. With Loyalty Offer ","vin":"1C4RJHBG4SC351962","currency":"USD","text":"Shop Now New 2025 Jeep\nGrand Cherokee\nLimited 4x4 New 2025 Jeep Grand Cherokee Limited. 13 miles. Baltic Gray Metallic Clearcoat. VIN 1C4RJHBG4SC351962. MSRP $50,265. LEASE: 36 monthly lease payments of $399. Amount due at start, $2,500 which includes first month's payment. Payments include $695 acquisition fee. $2,500 Bonus Cash $500 Jeep Monopoly Bonus Cash $3,500 Lease Loyalty Bonus Cash $0 security deposit. Lease end termination fee, $395. On approved credit. ALL OFFERS: Price does not include title, license or dealer doc fees. Images are for illustration purposes only. Offer expires 11/03/2025. "},{"price":44740,"modelDate":"2025","name":"2025 Jeep Wrangler Sport","stamp":"$469 LEASE for 42 mo. $2,000 due at signing. With Loyalty Offer ","vin":"1C4PJXAN1SW619950","currency":"USD","text":"Shop Now New 2025 Ram\n1500\nLaramie Crew Cab 4x4 New 2025 Ram 1500 Laramie Crew Cab. 18 miles. Delmonico Red Pearlcoat. VIN 1C6SRFJP1SN742935. MSRP $68,125. LEASE: 42 monthly lease payments of $469. Amount due at start, $2,000 which includes first month's payment. Payments include $695 acquisition fee. $1,500 Lease Bonus Cash $2,000 Lease Loyalty Bonus Cash (Must be in a current Stellantis lease). $0 security deposit. Lease end termination fee, $395. On approved credit. ALL OFFERS: Price does not include title, license or dealer doc fees. Images are for illustration purposes only. Offer expires 11/03/2025. "},{"price":43850,"modelDate":"2025","name":"2025 Jeep Gladiator Sport ","stamp":"$499 LEASE for 48 mo. $499 due at signing. ","vin":"1C6PJTAG9SL524443","currency":"USD","text":"Shop Now New 2025 Jeep\nWrangler\nSport 4x4 New 2025 Jeep Wrangler Sport. 10 miles. PL4 Joose. VIN 1C4PJXAN1SW619950. MSRP $44,740. LEASE: 48 monthly lease payments of $499. Amount due at start, $499 which includes first month's payment. Payments include $695 acquisition fee. $1,750 National Lease Bonus Cash $2,000 National Select Inventory bonus Cash $0 security deposit. Lease end termination fee, $395. On approved credit. ALL OFFERS: Price does not include title, license or dealer doc fees. Images are for illustration purposes only. Offer expires 11/03/2025. "}],"offerImpressions":[{"offerImpression_term":"42","offerClick_storeId":"MTMISDOD","offerImpression_body":"Truck","offerImpression_positionPreset":"RR","offerClick_trim":"Laramie Crew Cab ","offerImpression_year":"2025","offerClick_positionPreset":"RR","offerImpression_type":"Lease","offerClick_term":"42","event":null,"offerClick_price":"469","offerClick_storeName":"Lithia Chrysler Jeep Dodge of Missoula","offerImpression_layout":"Multi-Image Carousel","offerClick_make":"Ram","offerImpression_model":"1500","offerImpression_theme":"FallForest_600x400.png | CJD - Bold - White - 1up - RR","offerClick_salesEvent":null,"offerClick_dueSigning":"2000","navigationInteraction_action":null,"offerClick_model":"1500","offerClick_theme":"FallForest_600x400.png | CJD - Bold - White - 1up - RR","offerClick_type":"Lease","offerClick_body":"Truck","offerImpression_storeName":"Lithia Chrysler Jeep Dodge of Missoula","num_of_offers":"1","offerImpression_make":"Ram","offerImpression_price":"469","offerClick_year":"2025","offerClick_layout":"Multi-Image Carousel","offerImpression_storeId":"MTMISDOD","offerImpression_trim":"Laramie Crew Cab ","offerImpression_salesEvent":null,"offerImpression_dueSigning":"2000"},{"offerImpression_term":"36","offerClick_storeId":"MTMISDOD","offerImpression_body":"SUV","offerImpression_positionPreset":"RR","offerClick_trim":"Laredo","offerImpression_year":"2025","offerClick_positionPreset":"RR","offerImpression_type":"Zero Down Lease","offerClick_term":"36","event":null,"offerClick_price":42830,"offerClick_storeName":"Lithia Chrysler Jeep Dodge of Missoula","offerImpression_layout":"Multi-Image Carousel","offerClick_make":"Jeep","offerImpression_model":"Grand Cherokee L","offerImpression_theme":"FallForest_600x400_2.png | CJD - Bold - White - 1up - RR","offerClick_salesEvent":null,"offerClick_dueSigning":"2242.3800","navigationInteraction_action":null,"offerClick_model":"Grand Cherokee L","offerClick_theme":"FallForest_600x400_2.png | CJD - Bold - White - 1up - RR","offerClick_type":"Zero Down Lease","offerClick_body":"SUV","offerImpression_storeName":"Lithia Chrysler Jeep Dodge of Missoula","num_of_offers":"1","offerImpression_make":"Jeep","offerImpression_price":42830,"offerClick_year":"2025","offerClick_layout":"Multi-Image Carousel","offerImpression_storeId":"MTMISDOD","offerImpression_trim":"Laredo","offerImpression_salesEvent":null,"offerImpression_dueSigning":"2242.3800"},{"offerImpression_term":"36","offerClick_storeId":"MTMISDOD","offerImpression_body":"SUV","offerImpression_positionPreset":"RR","offerClick_trim":"Limited","offerImpression_year":"2025","offerClick_positionPreset":"RR","offerImpression_type":"Lease","offerClick_term":"36","event":null,"offerClick_price":"399","offerClick_storeName":"Lithia Chrysler Jeep Dodge of Missoula","offerImpression_layout":"Multi-Image Carousel","offerClick_make":"Jeep","offerImpression_model":"Grand Cherokee","offerImpression_theme":"FallForest_600x400_2.png | CJD - Bold - White - 1up - RR","offerClick_salesEvent":null,"offerClick_dueSigning":"2500","navigationInteraction_action":null,"offerClick_model":"Grand Cherokee","offerClick_theme":"FallForest_600x400_2.png | CJD - Bold - White - 1up - RR","offerClick_type":"Lease","offerClick_body":"SUV","offerImpression_storeName":"Lithia Chrysler Jeep Dodge of Missoula","num_of_offers":"1","offerImpression_make":"Jeep","offerImpression_price":"399","offerClick_year":"2025","offerClick_layout":"Multi-Image Carousel","offerImpression_storeId":"MTMISDOD","offerImpression_trim":"Limited","offerImpression_salesEvent":null,"offerImpression_dueSigning":"2500"},{"offerImpression_term":"48","offerClick_storeId":"MTMISDOD","offerImpression_body":"SUV","offerImpression_positionPreset":"RR","offerClick_trim":"Sport","offerImpression_year":"2025","offerClick_positionPreset":"RR","offerImpression_type":"Lease","offerClick_term":"48","event":null,"offerClick_price":"499","offerClick_storeName":"Lithia Chrysler Jeep Dodge of Missoula","offerImpression_layout":"Multi-Image Carousel","offerClick_make":"Jeep","offerImpression_model":"Wrangler","offerImpression_theme":"FallForest_600x400_2.png | CJD - Bold - White - 1up - RR","offerClick_salesEvent":null,"offerClick_dueSigning":"499","navigationInteraction_action":null,"offerClick_model":"Wrangler","offerClick_theme":"FallForest_600x400_2.png | CJD - Bold - White - 1up - RR","offerClick_type":"Lease","offerClick_body":"SUV","offerImpression_storeName":"Lithia Chrysler Jeep Dodge of Missoula","num_of_offers":"1","offerImpression_make":"Jeep","offerImpression_price":"499","offerClick_year":"2025","offerClick_layout":"Multi-Image Carousel","offerImpression_storeId":"MTMISDOD","offerImpression_trim":"Sport","offerImpression_salesEvent":null,"offerImpression_dueSigning":"499"},{"offerImpression_term":"48","offerClick_storeId":"MTMISDOD","offerImpression_body":"Truck","offerImpression_positionPreset":"RR","offerClick_trim":"Sport ","offerImpression_year":"2025","offerClick_positionPreset":"RR","offerImpression_type":"Lease","offerClick_term":"48","event":null,"offerClick_price":"299","offerClick_storeName":"Lithia Chrysler Jeep Dodge of Missoula","offerImpression_layout":"Multi-Image Carousel","offerClick_make":"Jeep","offerImpression_model":"Gladiator","offerImpression_theme":"FallForest_600x400_2.png | CJD - Bold - White - 1up - RR","offerClick_salesEvent":null,"offerClick_dueSigning":"2000","navigationInteraction_action":null,"offerClick_model":"Gladiator","offerClick_theme":"FallForest_600x400_2.png | CJD - Bold - White - 1up - RR","offerClick_type":"Lease","offerClick_body":"Truck","offerImpression_storeName":"Lithia Chrysler Jeep Dodge of Missoula","num_of_offers":"1","offerImpression_make":"Jeep","offerImpression_price":"299","offerClick_year":"2025","offerClick_layout":"Multi-Image Carousel","offerImpression_storeId":"MTMISDOD","offerImpression_trim":"Sport ","offerImpression_salesEvent":null,"offerImpression_dueSigning":"2000"}],"isAutoScrollEnabled":true,"transitionTime":"0.75","timeUntilNextTransition":"5"},{"domain":"www.lithiachryslermissoula.com","instanceID":"a752bc2f-f449-4ce0-a5b8-d4358d175bad","integrationStatus":true,"integrationID":"","relativePath":"/new-inventory/new-jeep-wrangler-for-sale-in-missoula-mt-ladrr.htm","mobileLocation":".ddc-page","mobilePositionModifer":"afterAsFirstChild","location":".ddc-wrapper","positionModifer":"afterAsFirstChild","type":"carousel","images":[{"imageUrl":"https://av2-ladtech-assets-prd.constellationagency.com/order-export/77930bb5-a23f-440d-8ad3-f5d997734d49_website_1c4pjxan1sw619950_950 x 250_2025_jeep_wrangler_sport__3.jpeg","imageAltText":"2025 Jeep Wrangler Sport","imageLink":"","targetData":"AID=ladtech-prd-Lithia%20Chrysler%20Jeep%20Dodge%20of%20Missoula-1C4PJXAN1SW619950-2025-Jeep-Wrangler","target":"_parent"}],"instanceStatus":"LIVE","createdBy":"","createdDate":1759445603332,"lastModifiedBy":"","lastModifiedDate":1759445603332,"launchLabel":"Oct MB Wrangler","startDate":1759445854000,"endDate":1762243200000,"embedAsHTML":false,"embedHtmlUrl":"","variableNamesList":[],"schemaInfo":[{"price":44740,"modelDate":"2025","name":"2025 Jeep Wrangler Sport","stamp":"$499 LEASE for 48 mo. $499 due at signing. ","vin":"1C4PJXAN1SW619950","currency":"USD","text":"Shop Now New 2025 Jeep\nWrangler\nSport 4x4 New 2025 Jeep Wrangler Sport. 10 miles. PL4 Joose. VIN 1C4PJXAN1SW619950. MSRP $44,740. LEASE: 48 monthly lease payments of $499. Amount due at start, $499 which includes first month's payment. Payments include $695 acquisition fee. $1,750 National Lease Bonus Cash $2,000 National Select Inventory bonus Cash $0 security deposit. Lease end termination fee, $395. On approved credit. ALL OFFERS: Price does not include title, license or dealer doc fees. Images are for illustration purposes only. Offer expires 11/03/2025. "}],"offerImpressions":[{"offerImpression_term":"48","offerClick_storeId":"MTMISDOD","offerImpression_body":"SUV","offerImpression_positionPreset":"MB Jeep Wrangler","offerClick_trim":"Sport","offerImpression_year":"2025","offerClick_positionPreset":"MB Jeep Wrangler","offerImpression_type":"Lease","offerClick_term":"48","event":null,"offerClick_price":"499","offerClick_storeName":"Lithia Chrysler Jeep Dodge of Missoula","offerImpression_layout":"Carousel","offerClick_make":"Jeep","offerImpression_model":"Wrangler","offerImpression_theme":"FallForest_950x250.png | CJD - Bold - White - 1up","offerClick_salesEvent":null,"offerClick_dueSigning":"499","navigationInteraction_action":null,"offerClick_model":"Wrangler","offerClick_theme":"FallForest_950x250.png | CJD - Bold - White - 1up","offerClick_type":"Lease","offerClick_body":"SUV","offerImpression_storeName":"Lithia Chrysler Jeep Dodge of Missoula","num_of_offers":"1","offerImpression_make":"Jeep","offerImpression_price":"499","offerClick_year":"2025","offerClick_layout":"Carousel","offerImpression_storeId":"MTMISDOD","offerImpression_trim":"Sport","offerImpression_salesEvent":null,"offerImpression_dueSigning":"499"}],"isAutoScrollEnabled":true,"transitionTime":"0.75","timeUntilNextTransition":"5"},{"domain":"www.lithiachryslermissoula.com","instanceID":"cd24c3c3-e652-4914-88c4-ada74a77b5e1","integrationStatus":true,"integrationID":"","relativePath":"/promotions/new/index.htm","mobileLocation":".ddc-wrapper","mobilePositionModifer":"afterAsFirstChild","location":".ddc-wrapper","positionModifer":"afterAsFirstChild","type":"grid","images":[{"imageUrl":"https://av2-ladtech-assets-prd.constellationagency.com/order-export/80550fce-0f6b-472c-9b06-a67df85959d6_website_1c6pjtag9sl524443_600 x 400_2025_jeep_gladiator_sport __4.jpeg","imageAltText":"2025 Jeep Gladiator Sport ","imageLink":"https://www.lithiachryslermissoula.com/new-inventory/new-jeep-gladiator-for-sale-in-missoula-mt-ladrr.htm","targetData":"AID=ladtech-prd-Lithia%20Chrysler%20Jeep%20Dodge%20of%20Missoula-1C6PJTAG9SL524443-2025-Jeep-Gladiator","target":"_parent"},{"imageUrl":"https://av2-ladtech-assets-prd.constellationagency.com/order-export/e23d2549-afdd-47a1-a5fc-a9401e1b7765_website_1c4rjkagxs8674298_600 x 400_2025_jeep_grand cherokee l_laredo__1.jpeg","imageAltText":"2025 Jeep Grand Cherokee L Laredo","imageLink":"https://www.lithiachryslermissoula.com/new-inventory/new-jeep-grand-cherokee-for-sale-in-missoula-mt-ladrr.htm","targetData":"AID=ladtech-prd-Lithia%20Chrysler%20Jeep%20Dodge%20of%20Missoula-1C4RJKAGXS8674298-2025-Jeep-Grand%20Cherokee%20L","target":"_parent"},{"imageUrl":"https://av2-ladtech-assets-prd.constellationagency.com/order-export/869af586-2227-485b-b038-87ca5d8a45f6_website_1c4rjhbg4sc351962_600 x 400_2025_jeep_grand cherokee_limited__2.jpeg","imageAltText":"2025 Jeep Grand Cherokee Limited","imageLink":"https://www.lithiachryslermissoula.com/new-inventory/new-jeep-grand-cherokee-for-sale-in-missoula-mt-ladrr.htm","targetData":"AID=ladtech-prd-Lithia%20Chrysler%20Jeep%20Dodge%20of%20Missoula-1C4RJHBG4SC351962-2025-Jeep-Grand%20Cherokee","target":"_parent"},{"imageUrl":"https://av2-ladtech-assets-prd.constellationagency.com/order-export/9e2038ec-eec0-4c7e-96c4-837f1c74f62b_website_1c6srfjp1sn742935_600 x 400_2025_ram_1500_laramie crew cab __0.jpeg","imageAltText":"2025 Ram 1500 Laramie Crew Cab ","imageLink":"https://www.lithiachryslermissoula.com/new-inventory/new-ram-1500-for-sale-in-missoula-mt-ladrr.htm","targetData":"AID=ladtech-prd-Lithia%20Chrysler%20Jeep%20Dodge%20of%20Missoula-1C6SRFJP1SN742935-2025-Ram-1500","target":"_parent"},{"imageUrl":"https://av2-ladtech-assets-prd.constellationagency.com/order-export/106a744f-a417-464e-b414-62653524e9f5_website_1c4pjxan1sw619950_600 x 400_2025_jeep_wrangler_sport__3.jpeg","imageAltText":"2025 Jeep Wrangler Sport","imageLink":"https://www.lithiachryslermissoula.com/new-inventory/new-jeep-wrangler-for-sale-in-missoula-mt-ladrr.htm","targetData":"AID=ladtech-prd-Lithia%20Chrysler%20Jeep%20Dodge%20of%20Missoula-1C4PJXAN1SW619950-2025-Jeep-Wrangler","target":"_parent"}],"instanceStatus":"LIVE","createdBy":"","createdDate":1759445603332,"lastModifiedBy":"","lastModifiedDate":1759445603332,"launchLabel":"Oct LT","startDate":1759445854000,"endDate":1762243200000,"embedHtmlUrl":"","variableNamesList":[],"schemaInfo":[{"price":68125,"modelDate":"2025","name":"2025 Ram 1500 Laramie Crew Cab ","stamp":"$299 LEASE for 48 mo. $2,000 due at signing. ","vin":"1C6SRFJP1SN742935","currency":"USD","text":"Shop Now New 2025 Jeep\nGladiator\nSport 4x4 New 2025 Jeep Gladiator Sport. 9 miles. Firecracker Red Clearcoat. VIN 1C6PJTAG9SL524443. MSRP $43,850. LEASE: 48 monthly lease payments of $299. Amount due at start, $2,000 which includes first month's payment. Payments include $695 acquisition fee. $4,500 National Lease Bonus Cash $2,250 National Bonus Cash $0 security deposit. Lease end termination fee, $395. On approved credit. ALL OFFERS: Price does not include title, license or dealer doc fees. Images are for illustration purposes only. Offer expires 11/03/2025. "},{"price":42830,"modelDate":"2025","name":"2025 Jeep Grand Cherokee L Laredo","stamp":"ZERO DOWN LEASE per mo. for 36 mos., $0 due at signing. With Loyalty Offer $369 ","vin":"1C4RJKAGXS8674298","currency":"USD","text":"Shop Now New 2025 Jeep\nGrand Cherokee L\nLaredo 4x4 New 2025 Jeep Grand Cherokee L Laredo. 538 miles. Bright White Clearcoat. VIN 1C4RJKAGXS8674298. MSRP $42,830. ZERO-DOWN LEASE: 36 monthly payments of $369. Total due at lease signing, $0. Cap cost, $41,409, which includes first month's payment and $695 acquisition fee. $1,000 Bonus Cash $2,000 Lease Loyalty Bonus Cash (Must be in a current Stellantis lease). $500 Lease Bonus Cash $500 Jeep Monopoly Bonus Cash $0 security deposit. Lease end termination fee, $395. On approved credit. ALL OFFERS: Price does not include title, license or dealer doc fees. Images are for illustration purposes only. Offer expires 11/03/2025. "},{"price":50265,"modelDate":"2025","name":"2025 Jeep Grand Cherokee Limited","stamp":"$399 LEASE for 36 mo. $2,500 due at signing. With Loyalty Offer ","vin":"1C4RJHBG4SC351962","currency":"USD","text":"Shop Now New 2025 Jeep\nGrand Cherokee\nLimited 4x4 New 2025 Jeep Grand Cherokee Limited. 13 miles. Baltic Gray Metallic Clearcoat. VIN 1C4RJHBG4SC351962. MSRP $50,265. LEASE: 36 monthly lease payments of $399. Amount due at start, $2,500 which includes first month's payment. Payments include $695 acquisition fee. $2,500 Bonus Cash $500 Jeep Monopoly Bonus Cash $3,500 Lease Loyalty Bonus Cash $0 security deposit. Lease end termination fee, $395. On approved credit. ALL OFFERS: Price does not include title, license or dealer doc fees. Images are for illustration purposes only. Offer expires 11/03/2025. "},{"price":44740,"modelDate":"2025","name":"2025 Jeep Wrangler Sport","stamp":"$469 LEASE for 42 mo. $2,000 due at signing. With Loyalty Offer ","vin":"1C4PJXAN1SW619950","currency":"USD","text":"Shop Now New 2025 Ram\n1500\nLaramie Crew Cab 4x4 New 2025 Ram 1500 Laramie Crew Cab. 18 miles. Delmonico Red Pearlcoat. VIN 1C6SRFJP1SN742935. MSRP $68,125. LEASE: 42 monthly lease payments of $469. Amount due at start, $2,000 which includes first month's payment. Payments include $695 acquisition fee. $1,500 Lease Bonus Cash $2,000 Lease Loyalty Bonus Cash (Must be in a current Stellantis lease). $0 security deposit. Lease end termination fee, $395. On approved credit. ALL OFFERS: Price does not include title, license or dealer doc fees. Images are for illustration purposes only. Offer expires 11/03/2025. "},{"price":43850,"modelDate":"2025","name":"2025 Jeep Gladiator Sport ","stamp":"$499 LEASE for 48 mo. $499 due at signing. ","vin":"1C6PJTAG9SL524443","currency":"USD","text":"Shop Now New 2025 Jeep\nWrangler\nSport 4x4 New 2025 Jeep Wrangler Sport. 10 miles. PL4 Joose. VIN 1C4PJXAN1SW619950. MSRP $44,740. LEASE: 48 monthly lease payments of $499. Amount due at start, $499 which includes first month's payment. Payments include $695 acquisition fee. $1,750 National Lease Bonus Cash $2,000 National Select Inventory bonus Cash $0 security deposit. Lease end termination fee, $395. On approved credit. ALL OFFERS: Price does not include title, license or dealer doc fees. Images are for illustration purposes only. Offer expires 11/03/2025. "}],"offerImpressions":[{"offerImpression_term":"42","offerClick_storeId":"MTMISDOD","offerImpression_body":"Truck","offerImpression_positionPreset":"LT","offerClick_trim":"Laramie Crew Cab ","offerImpression_year":"2025","offerClick_positionPreset":"LT","offerImpression_type":"Lease","offerClick_term":"42","event":null,"offerClick_price":"469","offerClick_storeName":"Lithia Chrysler Jeep Dodge of Missoula","offerImpression_layout":"Grid","offerClick_make":"Ram","offerImpression_model":"1500","offerImpression_theme":"FallForest_600x400.png | CJD - Bold - White - 1up - RR","offerClick_salesEvent":null,"offerClick_dueSigning":"2000","navigationInteraction_action":null,"offerClick_model":"1500","offerClick_theme":"FallForest_600x400.png | CJD - Bold - White - 1up - RR","offerClick_type":"Lease","offerClick_body":"Truck","offerImpression_storeName":"Lithia Chrysler Jeep Dodge of Missoula","num_of_offers":"1","offerImpression_make":"Ram","offerImpression_price":"469","offerClick_year":"2025","offerClick_layout":"Grid","offerImpression_storeId":"MTMISDOD","offerImpression_trim":"Laramie Crew Cab ","offerImpression_salesEvent":null,"offerImpression_dueSigning":"2000"},{"offerImpression_term":"36","offerClick_storeId":"MTMISDOD","offerImpression_body":"SUV","offerImpression_positionPreset":"LT","offerClick_trim":"Laredo","offerImpression_year":"2025","offerClick_positionPreset":"LT","offerImpression_type":"Zero Down Lease","offerClick_term":"36","event":null,"offerClick_price":42830,"offerClick_storeName":"Lithia Chrysler Jeep Dodge of Missoula","offerImpression_layout":"Grid","offerClick_make":"Jeep","offerImpression_model":"Grand Cherokee L","offerImpression_theme":"FallForest_600x400_2.png | CJD - Bold - White - 1up - RR","offerClick_salesEvent":null,"offerClick_dueSigning":"2242.3800","navigationInteraction_action":null,"offerClick_model":"Grand Cherokee L","offerClick_theme":"FallForest_600x400_2.png | CJD - Bold - White - 1up - RR","offerClick_type":"Zero Down Lease","offerClick_body":"SUV","offerImpression_storeName":"Lithia Chrysler Jeep Dodge of Missoula","num_of_offers":"1","offerImpression_make":"Jeep","offerImpression_price":42830,"offerClick_year":"2025","offerClick_layout":"Grid","offerImpression_storeId":"MTMISDOD","offerImpression_trim":"Laredo","offerImpression_salesEvent":null,"offerImpression_dueSigning":"2242.3800"},{"offerImpression_term":"36","offerClick_storeId":"MTMISDOD","offerImpression_body":"SUV","offerImpression_positionPreset":"LT","offerClick_trim":"Limited","offerImpression_year":"2025","offerClick_positionPreset":"LT","offerImpression_type":"Lease","offerClick_term":"36","event":null,"offerClick_price":"399","offerClick_storeName":"Lithia Chrysler Jeep Dodge of Missoula","offerImpression_layout":"Grid","offerClick_make":"Jeep","offerImpression_model":"Grand Cherokee","offerImpression_theme":"FallForest_600x400_2.png | CJD - Bold - White - 1up - RR","offerClick_salesEvent":null,"offerClick_dueSigning":"2500","navigationInteraction_action":null,"offerClick_model":"Grand Cherokee","offerClick_theme":"FallForest_600x400_2.png | CJD - Bold - White - 1up - RR","offerClick_type":"Lease","offerClick_body":"SUV","offerImpression_storeName":"Lithia Chrysler Jeep Dodge of Missoula","num_of_offers":"1","offerImpression_make":"Jeep","offerImpression_price":"399","offerClick_year":"2025","offerClick_layout":"Grid","offerImpression_storeId":"MTMISDOD","offerImpression_trim":"Limited","offerImpression_salesEvent":null,"offerImpression_dueSigning":"2500"},{"offerImpression_term":"48","offerClick_storeId":"MTMISDOD","offerImpression_body":"SUV","offerImpression_positionPreset":"LT","offerClick_trim":"Sport","offerImpression_year":"2025","offerClick_positionPreset":"LT","offerImpression_type":"Lease","offerClick_term":"48","event":null,"offerClick_price":"499","offerClick_storeName":"Lithia Chrysler Jeep Dodge of Missoula","offerImpression_layout":"Grid","offerClick_make":"Jeep","offerImpression_model":"Wrangler","offerImpression_theme":"FallForest_600x400_2.png | CJD - Bold - White - 1up - RR","offerClick_salesEvent":null,"offerClick_dueSigning":"499","navigationInteraction_action":null,"offerClick_model":"Wrangler","offerClick_theme":"FallForest_600x400_2.png | CJD - Bold - White - 1up - RR","offerClick_type":"Lease","offerClick_body":"SUV","offerImpression_storeName":"Lithia Chrysler Jeep Dodge of Missoula","num_of_offers":"1","offerImpression_make":"Jeep","offerImpression_price":"499","offerClick_year":"2025","offerClick_layout":"Grid","offerImpression_storeId":"MTMISDOD","offerImpression_trim":"Sport","offerImpression_salesEvent":null,"offerImpression_dueSigning":"499"},{"offerImpression_term":"48","offerClick_storeId":"MTMISDOD","offerImpression_body":"Truck","offerImpression_positionPreset":"LT","offerClick_trim":"Sport ","offerImpression_year":"2025","offerClick_positionPreset":"LT","offerImpression_type":"Lease","offerClick_term":"48","event":null,"offerClick_price":"299","offerClick_storeName":"Lithia Chrysler Jeep Dodge of Missoula","offerImpression_layout":"Grid","offerClick_make":"Jeep","offerImpression_model":"Gladiator","offerImpression_theme":"FallForest_600x400_2.png | CJD - Bold - White - 1up - RR","offerClick_salesEvent":null,"offerClick_dueSigning":"2000","navigationInteraction_action":null,"offerClick_model":"Gladiator","offerClick_theme":"FallForest_600x400_2.png | CJD - Bold - White - 1up - RR","offerClick_type":"Lease","offerClick_body":"Truck","offerImpression_storeName":"Lithia Chrysler Jeep Dodge of Missoula","num_of_offers":"1","offerImpression_make":"Jeep","offerImpression_price":"299","offerClick_year":"2025","offerClick_layout":"Grid","offerImpression_storeId":"MTMISDOD","offerImpression_trim":"Sport ","offerImpression_salesEvent":null,"offerImpression_dueSigning":"2000"}]},{"domain":"www.lithiachryslermissoula.com","instanceID":"cfa11143-0725-4340-93fd-5fc5c36bafb3","integrationStatus":true,"integrationID":"","relativePath":"/new-inventory/new-ram-1500-for-sale-in-missoula-mt-ladrr.htm","mobileLocation":".ddc-page","mobilePositionModifer":"afterAsFirstChild","location":".ddc-wrapper","positionModifer":"afterAsFirstChild","type":"singleImage","images":[{"imageUrl":"https://av2-ladtech-assets-prd.constellationagency.com/order-export/7ffd3ee5-dc3e-48ab-a36b-eacf4beef53c_website_1c6srfjp1sn742935_950 x 250_2025_ram_1500_laramie crew cab __0.jpeg","imageAltText":"2025 Ram 1500 Laramie Crew Cab ","imageLink":"","targetData":"AID=ladtech-prd-Lithia%20Chrysler%20Jeep%20Dodge%20of%20Missoula-1C6SRFJP1SN742935-2025-Ram-1500","target":"_parent"}],"instanceStatus":"LIVE","createdBy":"","createdDate":1759445603332,"lastModifiedBy":"","lastModifiedDate":1759445603332,"launchLabel":"Oct MB 1500","startDate":1759445854000,"endDate":1762243200000,"embedAsHTML":false,"embedHtmlUrl":"","variableNamesList":[],"schemaInfo":[{"price":68125,"modelDate":"2025","name":"2025 Ram 1500 Laramie Crew Cab ","stamp":"$469 LEASE for 42 mo. $2,000 due at signing. With Loyalty Offer ","vin":"1C6SRFJP1SN742935","currency":"USD","text":"Shop Now New 2025 Ram\n1500\nLaramie Crew Cab 4x4 New 2025 Ram 1500 Laramie Crew Cab. 18 miles. Delmonico Red Pearlcoat. VIN 1C6SRFJP1SN742935. MSRP $68,125. LEASE: 42 monthly lease payments of $469. Amount due at start, $2,000 which includes first month's payment. Payments include $695 acquisition fee. $1,500 Lease Bonus Cash $2,000 Lease Loyalty Bonus Cash (Must be in a current Stellantis lease). $0 security deposit. Lease end termination fee, $395. On approved credit. ALL OFFERS: Price does not include title, license or dealer doc fees. Images are for illustration purposes only. Offer expires 11/03/2025. "}],"offerImpressions":[{"offerImpression_term":"42","offerClick_storeId":"MTMISDOD","offerImpression_body":"Truck","offerImpression_positionPreset":"MB Ram 1500","offerClick_trim":"Laramie Crew Cab ","offerImpression_year":"2025","offerClick_positionPreset":"MB Ram 1500","offerImpression_type":"Lease","offerClick_term":"42","event":null,"offerClick_price":"469","offerClick_storeName":"Lithia Chrysler Jeep Dodge of Missoula","offerImpression_layout":"Single","offerClick_make":"Ram","offerImpression_model":"1500","offerImpression_theme":"FallForest_950x250.png | CJD - Bold - White - 1up","offerClick_salesEvent":null,"offerClick_dueSigning":"2000","navigationInteraction_action":null,"offerClick_model":"1500","offerClick_theme":"FallForest_950x250.png | CJD - Bold - White - 1up","offerClick_type":"Lease","offerClick_body":"Truck","offerImpression_storeName":"Lithia Chrysler Jeep Dodge of Missoula","num_of_offers":"1","offerImpression_make":"Ram","offerImpression_price":"469","offerClick_year":"2025","offerClick_layout":"Single","offerImpression_storeId":"MTMISDOD","offerImpression_trim":"Laramie Crew Cab ","offerImpression_salesEvent":null,"offerImpression_dueSigning":"2000"}],"isAutoScrollEnabled":true,"transitionTime":"0.75","timeUntilNextTransition":"5"},{"domain":"www.lithiachryslermissoula.com","instanceID":"eebae332-4e86-45ca-a489-66f5ee356bbc","integrationStatus":true,"integrationID":"","relativePath":"/new-inventory/index.htm","mobileLocation":".ddc-page","mobilePositionModifer":"afterAsFirstChild","location":".ddc-wrapper","positionModifer":"afterAsFirstChild","type":"carousel","images":[{"imageUrl":"https://av2-ladtech-assets-prd.constellationagency.com/order-export/32a0619b-d815-4220-ae59-fd04aea229ef_website_1c6pjtag9sl524443_950 x 250_2025_jeep_gladiator_sport __4.jpeg","imageAltText":"2025 Jeep Gladiator Sport ","imageLink":"https://www.lithiachryslermissoula.com/new-inventory/new-jeep-gladiator-for-sale-in-missoula-mt-ladrr.htm","targetData":"AID=ladtech-prd-Lithia%20Chrysler%20Jeep%20Dodge%20of%20Missoula-1C6PJTAG9SL524443-2025-Jeep-Gladiator","target":"_parent"},{"imageUrl":"https://av2-ladtech-assets-prd.constellationagency.com/order-export/7f07a453-07dc-4967-a4ad-d450501d0263_website_1c4rjkagxs8674298_950 x 250_2025_jeep_grand cherokee l_laredo__1.jpeg","imageAltText":"2025 Jeep Grand Cherokee L Laredo","imageLink":"https://www.lithiachryslermissoula.com/new-inventory/new-jeep-grand-cherokee-for-sale-in-missoula-mt-ladrr.htm","targetData":"AID=ladtech-prd-Lithia%20Chrysler%20Jeep%20Dodge%20of%20Missoula-1C4RJKAGXS8674298-2025-Jeep-Grand%20Cherokee%20L","target":"_parent"},{"imageUrl":"https://av2-ladtech-assets-prd.constellationagency.com/order-export/5caaa8e9-fdcf-448f-b199-b52876d61886_website_1c4rjhbg4sc351962_950 x 250_2025_jeep_grand cherokee_limited__2.jpeg","imageAltText":"2025 Jeep Grand Cherokee Limited","imageLink":"https://www.lithiachryslermissoula.com/new-inventory/new-jeep-grand-cherokee-for-sale-in-missoula-mt-ladrr.htm","targetData":"AID=ladtech-prd-Lithia%20Chrysler%20Jeep%20Dodge%20of%20Missoula-1C4RJHBG4SC351962-2025-Jeep-Grand%20Cherokee","target":"_parent"},{"imageUrl":"https://av2-ladtech-assets-prd.constellationagency.com/order-export/6d8c2a46-5af1-4aab-9cf4-ada2afca5a83_website_1c6srfjp1sn742935_950 x 250_2025_ram_1500_laramie crew cab __0.jpeg","imageAltText":"2025 Ram 1500 Laramie Crew Cab ","imageLink":"https://www.lithiachryslermissoula.com/new-inventory/new-ram-1500-for-sale-in-missoula-mt-ladrr.htm","targetData":"AID=ladtech-prd-Lithia%20Chrysler%20Jeep%20Dodge%20of%20Missoula-1C6SRFJP1SN742935-2025-Ram-1500","target":"_parent"},{"imageUrl":"https://av2-ladtech-assets-prd.constellationagency.com/order-export/8ab8e1e6-5197-4ec0-a8c4-504b37c0bf3a_website_1c4pjxan1sw619950_950 x 250_2025_jeep_wrangler_sport__3.jpeg","imageAltText":"2025 Jeep Wrangler Sport","imageLink":"https://www.lithiachryslermissoula.com/new-inventory/new-jeep-wrangler-for-sale-in-missoula-mt-ladrr.htm","targetData":"AID=ladtech-prd-Lithia%20Chrysler%20Jeep%20Dodge%20of%20Missoula-1C4PJXAN1SW619950-2025-Jeep-Wrangler","target":"_parent"}],"instanceStatus":"LIVE","createdBy":"","createdDate":1759445603332,"lastModifiedBy":"","lastModifiedDate":1759445603332,"launchLabel":"Oct NB","startDate":1759445854000,"endDate":1762243200000,"embedAsHTML":false,"embedHtmlUrl":"","variableNamesList":[],"schemaInfo":[{"price":68125,"modelDate":"2025","name":"2025 Ram 1500 Laramie Crew Cab ","stamp":"$299 LEASE for 48 mo. $2,000 due at signing. ","vin":"1C6SRFJP1SN742935","currency":"USD","text":"Shop Now New 2025 Jeep\nGladiator\nSport 4x4 New 2025 Jeep Gladiator Sport. 9 miles. Firecracker Red Clearcoat. VIN 1C6PJTAG9SL524443. MSRP $43,850. LEASE: 48 monthly lease payments of $299. Amount due at start, $2,000 which includes first month's payment. Payments include $695 acquisition fee. $4,500 National Lease Bonus Cash $2,250 National Bonus Cash $0 security deposit. Lease end termination fee, $395. On approved credit. ALL OFFERS: Price does not include title, license or dealer doc fees. Images are for illustration purposes only. Offer expires 11/03/2025. "},{"price":42830,"modelDate":"2025","name":"2025 Jeep Grand Cherokee L Laredo","stamp":"ZERO DOWN LEASE per mo. for 36 mos., $0 due at signing. With Loyalty Offer $369 ","vin":"1C4RJKAGXS8674298","currency":"USD","text":"Shop Now New 2025 Jeep\nGrand Cherokee L\nLaredo 4x4 New 2025 Jeep Grand Cherokee L Laredo. 538 miles. Bright White Clearcoat. VIN 1C4RJKAGXS8674298. MSRP $42,830. ZERO-DOWN LEASE: 36 monthly payments of $369. Total due at lease signing, $0. Cap cost, $41,409, which includes first month's payment and $695 acquisition fee. $1,000 Bonus Cash $2,000 Lease Loyalty Bonus Cash (Must be in a current Stellantis lease). $500 Lease Bonus Cash $500 Jeep Monopoly Bonus Cash $0 security deposit. Lease end termination fee, $395. On approved credit. ALL OFFERS: Price does not include title, license or dealer doc fees. Images are for illustration purposes only. Offer expires 11/03/2025. "},{"price":50265,"modelDate":"2025","name":"2025 Jeep Grand Cherokee Limited","stamp":"$399 LEASE for 36 mo. $2,500 due at signing. With Loyalty Offer ","vin":"1C4RJHBG4SC351962","currency":"USD","text":"Shop Now New 2025 Jeep\nGrand Cherokee\nLimited 4x4 New 2025 Jeep Grand Cherokee Limited. 13 miles. Baltic Gray Metallic Clearcoat. VIN 1C4RJHBG4SC351962. MSRP $50,265. LEASE: 36 monthly lease payments of $399. Amount due at start, $2,500 which includes first month's payment. Payments include $695 acquisition fee. $2,500 Bonus Cash $500 Jeep Monopoly Bonus Cash $3,500 Lease Loyalty Bonus Cash $0 security deposit. Lease end termination fee, $395. On approved credit. ALL OFFERS: Price does not include title, license or dealer doc fees. Images are for illustration purposes only. Offer expires 11/03/2025. "},{"price":44740,"modelDate":"2025","name":"2025 Jeep Wrangler Sport","stamp":"$469 LEASE for 42 mo. $2,000 due at signing. With Loyalty Offer ","vin":"1C4PJXAN1SW619950","currency":"USD","text":"Shop Now New 2025 Ram\n1500\nLaramie Crew Cab 4x4 New 2025 Ram 1500 Laramie Crew Cab. 18 miles. Delmonico Red Pearlcoat. VIN 1C6SRFJP1SN742935. MSRP $68,125. LEASE: 42 monthly lease payments of $469. Amount due at start, $2,000 which includes first month's payment. Payments include $695 acquisition fee. $1,500 Lease Bonus Cash $2,000 Lease Loyalty Bonus Cash (Must be in a current Stellantis lease). $0 security deposit. Lease end termination fee, $395. On approved credit. ALL OFFERS: Price does not include title, license or dealer doc fees. Images are for illustration purposes only. Offer expires 11/03/2025. "},{"price":43850,"modelDate":"2025","name":"2025 Jeep Gladiator Sport ","stamp":"$499 LEASE for 48 mo. $499 due at signing. ","vin":"1C6PJTAG9SL524443","currency":"USD","text":"Shop Now New 2025 Jeep\nWrangler\nSport 4x4 New 2025 Jeep Wrangler Sport. 10 miles. PL4 Joose. VIN 1C4PJXAN1SW619950. MSRP $44,740. LEASE: 48 monthly lease payments of $499. Amount due at start, $499 which includes first month's payment. Payments include $695 acquisition fee. $1,750 National Lease Bonus Cash $2,000 National Select Inventory bonus Cash $0 security deposit. Lease end termination fee, $395. On approved credit. ALL OFFERS: Price does not include title, license or dealer doc fees. Images are for illustration purposes only. Offer expires 11/03/2025. "}],"offerImpressions":[{"offerImpression_term":"42","offerClick_storeId":"MTMISDOD","offerImpression_body":"Truck","offerImpression_positionPreset":"NB","offerClick_trim":"Laramie Crew Cab ","offerImpression_year":"2025","offerClick_positionPreset":"NB","offerImpression_type":"Lease","offerClick_term":"42","event":null,"offerClick_price":"469","offerClick_storeName":"Lithia Chrysler Jeep Dodge of Missoula","offerImpression_layout":"Carousel","offerClick_make":"Ram","offerImpression_model":"1500","offerImpression_theme":"FallForest_950x250.png | CJD - Bold - White - 1up","offerClick_salesEvent":null,"offerClick_dueSigning":"2000","navigationInteraction_action":null,"offerClick_model":"1500","offerClick_theme":"FallForest_950x250.png | CJD - Bold - White - 1up","offerClick_type":"Lease","offerClick_body":"Truck","offerImpression_storeName":"Lithia Chrysler Jeep Dodge of Missoula","num_of_offers":"1","offerImpression_make":"Ram","offerImpression_price":"469","offerClick_year":"2025","offerClick_layout":"Carousel","offerImpression_storeId":"MTMISDOD","offerImpression_trim":"Laramie Crew Cab ","offerImpression_salesEvent":null,"offerImpression_dueSigning":"2000"},{"offerImpression_term":"36","offerClick_storeId":"MTMISDOD","offerImpression_body":"SUV","offerImpression_positionPreset":"NB","offerClick_trim":"Laredo","offerImpression_year":"2025","offerClick_positionPreset":"NB","offerImpression_type":"Zero Down Lease","offerClick_term":"36","event":null,"offerClick_price":42830,"offerClick_storeName":"Lithia Chrysler Jeep Dodge of Missoula","offerImpression_layout":"Carousel","offerClick_make":"Jeep","offerImpression_model":"Grand Cherokee L","offerImpression_theme":"FallForest_950x250.png | CJD - Bold - White - 1up","offerClick_salesEvent":null,"offerClick_dueSigning":"2242.3800","navigationInteraction_action":null,"offerClick_model":"Grand Cherokee L","offerClick_theme":"FallForest_950x250.png | CJD - Bold - White - 1up","offerClick_type":"Zero Down Lease","offerClick_body":"SUV","offerImpression_storeName":"Lithia Chrysler Jeep Dodge of Missoula","num_of_offers":"1","offerImpression_make":"Jeep","offerImpression_price":42830,"offerClick_year":"2025","offerClick_layout":"Carousel","offerImpression_storeId":"MTMISDOD","offerImpression_trim":"Laredo","offerImpression_salesEvent":null,"offerImpression_dueSigning":"2242.3800"},{"offerImpression_term":"36","offerClick_storeId":"MTMISDOD","offerImpression_body":"SUV","offerImpression_positionPreset":"NB","offerClick_trim":"Limited","offerImpression_year":"2025","offerClick_positionPreset":"NB","offerImpression_type":"Lease","offerClick_term":"36","event":null,"offerClick_price":"399","offerClick_storeName":"Lithia Chrysler Jeep Dodge of Missoula","offerImpression_layout":"Carousel","offerClick_make":"Jeep","offerImpression_model":"Grand Cherokee","offerImpression_theme":"FallForest_950x250.png | CJD - Bold - White - 1up","offerClick_salesEvent":null,"offerClick_dueSigning":"2500","navigationInteraction_action":null,"offerClick_model":"Grand Cherokee","offerClick_theme":"FallForest_950x250.png | CJD - Bold - White - 1up","offerClick_type":"Lease","offerClick_body":"SUV","offerImpression_storeName":"Lithia Chrysler Jeep Dodge of Missoula","num_of_offers":"1","offerImpression_make":"Jeep","offerImpression_price":"399","offerClick_year":"2025","offerClick_layout":"Carousel","offerImpression_storeId":"MTMISDOD","offerImpression_trim":"Limited","offerImpression_salesEvent":null,"offerImpression_dueSigning":"2500"},{"offerImpression_term":"48","offerClick_storeId":"MTMISDOD","offerImpression_body":"SUV","offerImpression_positionPreset":"NB","offerClick_trim":"Sport","offerImpression_year":"2025","offerClick_positionPreset":"NB","offerImpression_type":"Lease","offerClick_term":"48","event":null,"offerClick_price":"499","offerClick_storeName":"Lithia Chrysler Jeep Dodge of Missoula","offerImpression_layout":"Carousel","offerClick_make":"Jeep","offerImpression_model":"Wrangler","offerImpression_theme":"FallForest_950x250.png | CJD - Bold - White - 1up","offerClick_salesEvent":null,"offerClick_dueSigning":"499","navigationInteraction_action":null,"offerClick_model":"Wrangler","offerClick_theme":"FallForest_950x250.png | CJD - Bold - White - 1up","offerClick_type":"Lease","offerClick_body":"SUV","offerImpression_storeName":"Lithia Chrysler Jeep Dodge of Missoula","num_of_offers":"1","offerImpression_make":"Jeep","offerImpression_price":"499","offerClick_year":"2025","offerClick_layout":"Carousel","offerImpression_storeId":"MTMISDOD","offerImpression_trim":"Sport","offerImpression_salesEvent":null,"offerImpression_dueSigning":"499"},{"offerImpression_term":"48","offerClick_storeId":"MTMISDOD","offerImpression_body":"Truck","offerImpression_positionPreset":"NB","offerClick_trim":"Sport ","offerImpression_year":"2025","offerClick_positionPreset":"NB","offerImpression_type":"Lease","offerClick_term":"48","event":null,"offerClick_price":"299","offerClick_storeName":"Lithia Chrysler Jeep Dodge of Missoula","offerImpression_layout":"Carousel","offerClick_make":"Jeep","offerImpression_model":"Gladiator","offerImpression_theme":"FallForest_950x250.png | CJD - Bold - White - 1up","offerClick_salesEvent":null,"offerClick_dueSigning":"2000","navigationInteraction_action":null,"offerClick_model":"Gladiator","offerClick_theme":"FallForest_950x250.png | CJD - Bold - White - 1up","offerClick_type":"Lease","offerClick_body":"Truck","offerImpression_storeName":"Lithia Chrysler Jeep Dodge of Missoula","num_of_offers":"1","offerImpression_make":"Jeep","offerImpression_price":"299","offerClick_year":"2025","offerClick_layout":"Carousel","offerImpression_storeId":"MTMISDOD","offerImpression_trim":"Sport ","offerImpression_salesEvent":null,"offerImpression_dueSigning":"2000"}],"isAutoScrollEnabled":true,"transitionTime":"0.75","timeUntilNextTransition":"5"},{"domain":"www.lithiachryslermissoula.com","instanceID":"fb025913-7a95-41bd-add5-f657e5519606","integrationStatus":true,"integrationID":"","relativePath":"/new-inventory/jeep-gladiator-missoula-mt.htm","mobileLocation":".ddc-page","mobilePositionModifer":"afterAsFirstChild","location":".ddc-wrapper","positionModifer":"afterAsFirstChild","type":"singleImage","images":[{"imageUrl":"https://av2-ladtech-assets-prd.constellationagency.com/order-export/d2a4f494-413c-449f-bc14-bd4853766229_website_1c6pjtag9sl524443_950 x 250_2025_jeep_gladiator_sport __4.jpeg","imageAltText":"2025 Jeep Gladiator Sport ","imageLink":"","targetData":"AID=ladtech-prd-Lithia%20Chrysler%20Jeep%20Dodge%20of%20Missoula-1C6PJTAG9SL524443-2025-Jeep-Gladiator","target":"_parent"}],"instanceStatus":"LIVE","createdBy":"","createdDate":1759445603332,"lastModifiedBy":"","lastModifiedDate":1759445603332,"launchLabel":"Oct MB Gladiator","startDate":1759445854000,"endDate":1762243200000,"embedAsHTML":false,"embedHtmlUrl":"","variableNamesList":[],"schemaInfo":[{"price":43850,"modelDate":"2025","name":"2025 Jeep Gladiator Sport ","stamp":"$299 LEASE for 48 mo. $2,000 due at signing. ","vin":"1C6PJTAG9SL524443","currency":"USD","text":"Shop Now New 2025 Jeep\nGladiator\nSport 4x4 New 2025 Jeep Gladiator Sport. 9 miles. Firecracker Red Clearcoat. VIN 1C6PJTAG9SL524443. MSRP $43,850. LEASE: 48 monthly lease payments of $299. Amount due at start, $2,000 which includes first month's payment. Payments include $695 acquisition fee. $4,500 National Lease Bonus Cash $2,250 National Bonus Cash $0 security deposit. Lease end termination fee, $395. On approved credit. ALL OFFERS: Price does not include title, license or dealer doc fees. Images are for illustration purposes only. Offer expires 11/03/2025. "}],"offerImpressions":[{"offerImpression_term":"48","offerClick_storeId":"MTMISDOD","offerImpression_body":"Truck","offerImpression_positionPreset":"MB Jeep Gladiator","offerClick_trim":"Sport ","offerImpression_year":"2025","offerClick_positionPreset":"MB Jeep Gladiator","offerImpression_type":"Lease","offerClick_term":"48","event":null,"offerClick_price":"299","offerClick_storeName":"Lithia Chrysler Jeep Dodge of Missoula","offerImpression_layout":"Single","offerClick_make":"Jeep","offerImpression_model":"Gladiator","offerImpression_theme":"FallForest_950x250.png | CJD - Bold - White - 1up","offerClick_salesEvent":null,"offerClick_dueSigning":"2000","navigationInteraction_action":null,"offerClick_model":"Gladiator","offerClick_theme":"FallForest_950x250.png | CJD - Bold - White - 1up","offerClick_type":"Lease","offerClick_body":"Truck","offerImpression_storeName":"Lithia Chrysler Jeep Dodge of Missoula","num_of_offers":"1","offerImpression_make":"Jeep","offerImpression_price":"299","offerClick_year":"2025","offerClick_layout":"Single","offerImpression_storeId":"MTMISDOD","offerImpression_trim":"Sport ","offerImpression_salesEvent":null,"offerImpression_dueSigning":"2000"}],"isAutoScrollEnabled":true,"transitionTime":"0.75","timeUntilNextTransition":"5"}]};
        const embedJsList = ["0","1","2","3","4","5","6"];
        const variablesList = ["0","1","2","3","4","5","6"];

        for (let idx = 0; idx < instances.length; idx++) {
          let {
            type,
            images,
            seoText,
            location,
            schemaInfo,
            embedAsHTML,
            relativePath,
            transitionTime,
            mobileLocation,
            positionModifer,
            offerImpressions,
            isAutoScrollEnabled,
            mobilePositionModifer,
            timeUntilNextTransition
           } = instances[idx];
          if(!location && !mobileLocation) continue;
          let cssSelector = {
            desktop: location,
            mobile: mobileLocation
          };
          let modifiers = {
            desktop: positionModifer,
            mobile: mobilePositionModifer
          };
          if(window.location.pathname === relativePath) {
            createJsCode(
              type,
              images,
              cssSelector,
              idx,
              modifiers,
              embedAsHTML,
              embedJsList[idx],
              variablesList[idx],
              seoText,
              schemaInfo,
              offerImpressions,
              isAutoScrollEnabled,
              transitionTime,
              timeUntilNextTransition,
            );
          }
        }
      }
    