PageSourceSearch

https://dreamofalifetime.ca/cdn/shop/t/13/assets/general-cart.js?v=143732464508407693461783714605

js dreamofalifetime.ca collected 2026-10-04 13:24:04 UTC 12,917 bytes, 2 lines download raw bytes

1function RequestLocation(geofenceAreaSelection,multipleJurisdictionSale=!1,additionalJurisdictionLists=""){navigator.geolocation?navigator.geolocation.getCurrentPosition(handlePrimaryLookupSuccess.bind(this),doSecondaryGeoLookup.bind(this,geofenceAreaSelection,multipleJurisdictionSale,additionalJurisdictionLists)):geoip2?doSecondaryGeoLookup(geofenceAreaSelection,multipleJurisdictionSale,additionalJurisdictionLists):LocationError("servicesError")}function handlePrimaryLookupSuccess(position){this.browserLocation=position,validateLocation(position,!1)}function doSecondaryGeoLookup(geofenceAreaSelection=window.geofenceConfig.areaSelection,multipleJurisdictionSale=window.geofenceConfig.multipleJurisdictionSale,additionalJurisdictionLists=window.geofenceConfig.additionalJurisdictionLists){if(!geoip2){LocationError("servicesError");return}let options={};geoip2.city(position=>handleSecondaryLookupSuccess(position,geofenceAreaSelection,multipleJurisdictionSale,additionalJurisdictionLists),handleSecondaryLookupError.bind(this),options)}function handleSecondaryLookupError(error){this.browserLocation!==null?LocationError("outsideBounds",this.browserLocation.coords):LocationError("servicesError")}function LocationError(errorType,coordsData){let servDisplay="block",invalidDisplay="block",fbServDisplay="block";switch(errorType){case"outsideBounds":coordsData?(document.getElementById("location-data").innerText="Lat "+this.NumberTrunc(coordsData.latitude,4)+", Lon "+this.NumberTrunc(coordsData.longitude,4),document.getElementById("location-label").style.display="block"):document.getElementById("location-label").style.display="none",invalidDisplay="block",servDisplay="none",fbServDisplay="none";break;case"servicesError":this.IsFacebookApp()?(fbServDisplay="block",servDisplay="none",invalidDisplay="none"):(servDisplay="block",invalidDisplay="none",fbServDisplay="none");break}document.getElementById("location-service-error").style.display=servDisplay,document.getElementById("grid-location-service-error").style.display=fbServDisplay=="none"?servDisplay:fbServDisplay,document.getElementById("invalid-location-error").style.display=invalidDisplay,document.getElementById("grid-invalid-location-error").style.display=invalidDisplay,document.getElementById("fb-location-service-error").style.display=fbServDisplay,document.getElementById("top-grid-error-msg").style.display="block",document.getElementById("popup-blur").style.display="block"}function validateLocation(position,isSecondaryLookup){let dataIsInvalid=position==null||geoData==null;dataIsInvalid&&isSecondaryLookup?LocationError("servicesError"):dataIsInvalid&&doSecondaryGeoLookup(),geoData.constructor===Array?(console.log(position),console.log(isSecondaryLookup),validateLocationArray(position,isSecondaryLookup)):validateLocationSingle(position,isSecondaryLookup)}function IsFacebookApp(){var ua=navigator.userAgent||navigator.vendor||window.opera;return ua.indexOf("FBAN")>-1||ua.indexOf("FBAV")>-1}function HandleGeoValidationSuccess(position,passType2="primary"){this.browserLocation=position,console.log("Geo validation of location passed");const cookieExpiryMinutes=60;let expiry=new Date;expiry.setTime(expiry.getTime()+cookieExpiryMinutes*60*1e3);const expires="; expires="+expiry.toGMTString();document.cookie="isEligible=true;"+expires+"; path=/",document.cookie="geoState="+position.state+";"+expires+"; path=/",document.cookie="latitude="+position.latitude+";"+expires+"; path=/",document.cookie="longitude="+position.longitude+";"+expires+"; path=/",document.cookie="passType="+passType2+";"+expires+"; path=/";let locationObj={latitude:position.latitude,longitude:position.longitude,passType:passType2,state:position.state};document.getElementById("hid_latitude-longitude").value=JSON.stringify(locationObj),updateCheckoutBtnStatus()}function HandleCookieLookupSuccess(position){const stateFromCookies=readCookie("geoState"),latFromCookies=readCookie("latitude"),lngFromCookies=readCookie("longitude"),passTypeFromCookies=readCookie("passType");position.coords.state=stateFromCookies,position.coords.state=stateFromCookies,position.coords.latitude=latFromCookies,position.coords.longitude=lngFromCo
1okies,HandleGeoValidationSuccess(position.coords,passTypeFromCookies)}function HandleCookieLookupError(position){const geoState=readCookie("geoState"),latFromCookies=readCookie("latitude"),lngFromCookies=readCookie("longitude"),passTypeFromCookies=readCookie("passType");geoState!=null?(console.log("unable to get state location from cookies"),HandleGeoValidationSuccess({latitude:latFromCookies,longitude:lngFromCookies,state:geoState},passType=passTypeFromCookies)):(console.log("Unable to add geofence success info, will need to grab location from IP"),doSecondaryGeoLookup())}function NumberTrunc(num,decimalPlaces=0){let truncNum=num,decimalModifier=10**decimalPlaces;return truncNum=num>0?Math.floor(num*decimalModifier)/decimalModifier:Math.ceil(num*decimalModifier)/decimalModifier,truncNum}function readCookie(name){for(var nameEQ=name+"=",ca=document.cookie.split(";"),i=0;i<ca.length;i++){for(var c=ca[i];c.charAt(0)==" ";)c=c.substring(1,c.length);if(c.indexOf(nameEQ)==0)return c.substring(nameEQ.length,c.length)}return null}function handleSecondaryLookupSuccess(position,geofenceAreaSelection,multipleJurisdictionSale=!1,additionalJurisdictionLists=""){let provState=null,provCode=null;if(position.subdivisions?(provState=position.subdivisions[0].names.en,provCode=position.subdivisions[0].iso_code):LocationError("servicesError"),provState==geofenceAreaSelection){const code=provCode;position.location.state=code,HandleGeoValidationSuccess(position.location,"secondary")}else{if(multipleJurisdictionSale==!0&&additionalJurisdictionLists!=""){var additionalJurisdictions=additionalJurisdictionLists.split(",").map(function(item){return item.trim()});if(additionalJurisdictions.includes(provCode)){const code=provCode;position.location.state=code,HandleGeoValidationSuccess(position.location,"secondary");return}}console.log("Geo validation of location failed"),LocationError("outsideBounds",position.location)}}function validateLocationArray(position,isSecondaryLookup){for(var latTolerance=.01,longTolerance=.01,geoDataLocal=geoData,found=0,state="",i=0;i<geoDataLocal.length&&found==0;i++)if(state=geoDataLocal[i].state,position.coords.latitude<geoDataLocal[i].border.n+latTolerance&&position.coords.latitude>geoDataLocal[i].border.s-latTolerance&&position.coords.longitude>geoDataLocal[i].border.w-longTolerance&&position.coords.longitude<geoDataLocal[i].border.e+longTolerance&&(found=1),found==1){var foundBoundary=i,xRes=(geoDataLocal[foundBoundary].res-1)/(geoDataLocal[foundBoundary].border.e-geoDataLocal[foundBoundary].border.w),yRes=(geoDataLocal[foundBoundary].res-1)/(geoDataLocal[foundBoundary].border.n-geoDataLocal[foundBoundary].border.s),xLookup=Math.floor((position.coords.longitude-geoDataLocal[foundBoundary].border.w)*xRes),yLookup=Math.floor(geoDataLocal[foundBoundary].res-1-(position.coords.latitude-geoDataLocal[foundBoundary].border.s)*yRes);xLookup<0&&(xLookup=0),xLookup>=geoDataLocal[foundBoundary].res&&(xLookup=geoDataLocal[foundBoundary].res-1),yLookup<0&&(yLookup=0),yLookup>=geoDataLocal[foundBoundary].res&&(yLookup=geoDataLocal[foundBoundary].res-1);var geoRowData=geoDataLocal[foundBoundary].data[yLookup];geoDataLocal[foundBoundary].compression=="True"&&(geoRowData=DecompressRow(geoRowData));var geoElementIndex=Math.floor(xLookup/4),geoElementBitMask=1<<xLookup-geoElementIndex*4,geoElementCharacter=geoRowData.charAt(geoElementIndex),geoHex=parseInt(geoElementCharacter,16);(geoElementBitMask&geoHex)==geoElementBitMask?(position.coords.state=state,HandleGeoValidationSuccess(position.coords)):found=0}found==0&&isSecondaryLookup?(console.log("Geo validation of location failed"),LocationError("outsideBounds",position.coords)):found==0&&(console.log("Primary geo lookup shows user outside bounds, doing secondary lookup"),doSecondaryGeoLookup())}function DecompressRow(rowData){for(var outputRow="",i=0;i<rowData.length;i++){var myChar=rowData[i];if(myChar=="&"){var startPos=i+1,endPos=rowData.indexOf("-",startPos);i=endPos+1;for(var numberOfRepeats=rowData.substring(startPos,endPos),repeatingChar=rowData[i],j=0;j<parseInt(numberOfRepeats);j++)outputRow+=repeatingChar}else outputRow+=rowData[i]}return outputRow}function validateLocationSingle(position,isSecondaryLookup){var latTolerance=.01,longTolerance=.01,state=geoData?.state??null;let isOutsideBounds=position.coords.latitude>geoData.border.n+latTolerance||position.coords.latitude<geoData.border.s-latTolerance||position.coords.longitude<geoData.border.w-longTolerance||position.coords.longitude>geoData.border.e+longTolerance;if(isOutsideBounds&&isSecondaryLookup){LocationError("outsideBounds",position.coords);return}else if(isOutsideBounds){console.log("Primary geo lookup shows user outside bounds, doing secondary lookup"),doSecondaryGeoLookup();return}var xRes=(geoData.res-1)/(geoData.border.e-geoData.border.w),yRes=(geoData.res-1)/(geoData.border.n-geoData.border.s),xLookup=Math.floor((position.coords.longitude-geoData.border.w)*xRes),yLookup=Math.floor(geoData.res-1-(position.coords.latitude-geoData.border.s)*yRes);xLookup<0&&(xLookup=0),xLookup>=geoData.Res&&(xLookup=geoData.res-1),yLookup<0&&(yLookup=0),yLookup>=geoData.Res&&(yLookup=geoData.res-1);var geoRowData=geoData.data[yLookup];geoData.compression=="True"&&(geoRowData=DecompressRow(geoRowData));var geoElementIndex=Math.floor(xLookup/4),geoElementBitMask=1<<xLookup-geoElementIndex*4,geoElementCharacter=geoRowData.charAt(geoElementIndex),geoHex=parseInt(geoElementCharacter,16);(geoElementBitMask&geoHex)==geoElementBitMask?(position.coords.state=state,HandleGeoValidationSuccess(position.coords)):isSecondaryLookup?(console.log("Geo validation of location failed"),LocationError("outsideBounds",position.coords)):(console.log("Primary geo lookup shows user outside bounds, doing secondary lookup"),doSecondaryGeoLookup())}function updateCheckoutBtnStatus(){const isCheckbox1Valid=!document.getElementById("eligible-cbx")||document.getElementById("eligible-cbx").checked,isCheckbox2Valid=!document.getElementById("eligible-cbx2")||document.getElementById("eligible-cbx2").checked,isCheckbox3Valid=!document.getElementById("eligible-cbx3")||document.getElementById("eligible-cbx3").checked,isCheckbox4Valid=!document.getElementById("eligible-cbx4")||document.getElementById("eligible-cbx4").checked,isCheckbox5Valid=!document.getElementById("eligible-cbx5")||document.getElementById("eligible-cbx5").checked,isAllCheckboxesValid=isCheckbox1Valid&&isCheckbox2Valid&&isCheckbox3Valid&&isCheckbox4Valid&&isCheckbox5Valid,freeTicketButton=document.getElementById("free-ticket-button");freeTicketButton&&(freeTicketButton.disabled=!isAllCheckboxesValid)}function handleEnvelopeClick(e){let envelopeClicked=Number($("#"+e.currentTarget.parentElement.id).attr("data-value"));!$("#suit-"+envelopeClicked).length&&envelopeClicked&&($(".currentPick").removeClass("currentPick"),$("#"+e.currentTarget.parentElement.id).addClass("currentPick"),$("#hid_envelope-selection").val(envelopeClicked),document.getElementById("selection-validation-error").style.visibility="hidden",updateCheckoutBtnStatus())}document.addEventListener("DOMContentLoaded",function(){const isFullyEligible=readCookie("isEligible"),geofenceAreaSelection=window.geofenceConfig.areaSelection,multipleJurisdictionSale=window.geofenceConfig.multipleJurisdictionSale,additionalJurisdictionLists=window.geofenceConfig.additionalJurisdictionLists,eligibleCheckboxes=Array.from(document.getElementsByClassName("eligible-checkbox")),envelopes=Array.from(document.getElementsByClassName("envelope-grid-item"));window.steppedCartDeferGeo||(isFullyEligible?navigator.geolocation?navigator.geolocation.getCurrentPosition(HandleCookieLookupSuccess.bind(this),HandleCookieLookupError.bind(this)):HandleCookieLookupError():RequestLocation(geofenceAreaSelection,multipleJurisdictionSale,additionalJurisdictionLists));const ageRangeFromCookies=readCookie("ageRange");ageRangeFromCookies!==null&&document.getElementById("age-range-selector")!==null&&(document.getElementById("age-range-selector").value=ageRangeFromCookies,document.getElementById("hid_age_range").value=ageRangeFromCookies),document.querySelector(".close-popup-button").addEventListener("click",function(e){let parentId=e.currentTarget.parentElement.id,$popupClicked=$("#"+parentId);$("#popup-blur").hide()}),document.querySelector(".reopen-popup-button").addEventListener("click",function(e){$("#popup-blur").show()}
1),eligibleCheckboxes.forEach(function(checkbox){checkbox.addEventListener("click",updateCheckoutBtnStatus)}),envelopes.forEach(function(envelope){envelope.addEventListener("click",handleEnvelopeClick)})});
2//# sourceMappingURL=/cdn/shop/t/13/assets/general-cart.js.map?v=143732464508407693461783714605

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.