1jQuery(document).ready(function ($) { 2 3 function initIndiaSlider(type) { 4 if (typeof pictoryIndiaData === 'undefined') return; 5 6 const data = pictoryIndiaData[type]; 7 if (!data) return; 8 9 const $slider = $(`#pictory-slider-india-${type}`); 10 const $price = $(`#pictory-price-india-${type}`); 11 const $minutes = $(`#pictory-minutes-india-${type}`); 12 const $tooltip = $(`#pictory-tooltip-india-${type}`); 13 14 if (!$slider.length) return; 15 16 function updateDisplay(val) { 17 const match = data.find(entry => entry.slider === parseInt(val, 10)); 18 if (!match) return; 19 20 $price.text(`â¹${match.cost.toLocaleString('en-IN')}`); 21 $minutes.text(`${match.minutes} video minutes`); 22 $tooltip.text(match.minutes); 23 24 const range = $slider[0].max - $slider[0].min; 25 const percent = (val - $slider[0].min) / range; 26 $tooltip.css('left', (percent * $slider[0].offsetWidth) + 'px'); 27 } 28 29 // Initial state 30 updateDisplay($slider.val()); 31 32 $slider.on('input change', function () { 33 updateDisplay(this.value); 34 }); 35 } 36 37 // Init India sliders 38 initIndiaSlider('monthly'); 39 initIndiaSlider('annual'); 40 41 // â Checkout for India 42 $('.pictory-checkout-btn-india').on('click', function (e) { 43 e.preventDefault(); 44 45 const type = $(this).data('type'); // "monthly" or "annual" 46 const $slider = $(`#pictory-slider-india-${type}`); 47 let sliderValue = parseInt($slider.val(), 10); 48 if (isNaN(sliderValue)) sliderValue = 0; 49 50 const plan = type === 'monthly' 51 ? 'Pictory-API-Self-Service-USD-Monthly' 52 : 'Pictory-API-Self-Service-USD-Yearly'; 53 54 const addon = 'APIAdditionalCredits-USD-Monthly'; 55 const addonQuantity = sliderValue / 120; // 0 when at start, 1 for first step, etc. 56 57 const base = 'https://checkout.pictory.ai/api-plan-checkout'; 58 const params = 59 '?plan=' + encodeURIComponent(plan) + 60 '&addon=' + encodeURIComponent(addon) + 61 '&addonQuantity=' + encodeURIComponent(addonQuantity) + 62 '&countryCode=IN'; 63 64 window.location.href = base + params; 65 }); 66})
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.