PageSourceSearch

https://mesvacances.jp/cdn/shop/t/24/assets/easy_points_integration.min.js?v=119488281213799463741744268881

js mesvacances.jp collected 2026-10-02 04:30:11 UTC 11,932 bytes, 1 lines download raw bytes

1var EASY_POINTS_INTEGRATION_VERSION=220,EPI_SETTING_CART_DRAWER=!1,EPI_SETTING_CART_RENDERER="Fallback";function handleCartDrawerOpened(){}function handleCartChanges(){}function afterEasyPointsSDK(){if(EPI_SETTING_CART_DRAWER)handleCartDrawerOpened(),EasyPoints.removeDiscount();else{var t;if(!this.window.location.pathname.match(/\/cart/i))return;EasyPoints.Register.run(),EasyPoints.removeDiscount()}handleCartChanges()}window.addEventListener("DOMContentLoaded",function(){let t=0,e;e=setInterval(()=>{if(t>100){console.warn("easyPointsSDK was not loaded."),clearInterval(e);return}if(void 0!==window.easyPointsSDK){clearInterval(e),EasyPoints.sdk().setup(),afterEasyPointsSDK();return}t++},50)});var EasyPoints={sdk:function(){var t=window.easyPointsSDK;if(void 0===t){console.warn("easyPointsSDK was not loaded.");return}return t},Debug:{DEBUG:!1,print:function(t,e="info"){if(this.DEBUG)switch(t="[EasyPoints] "+t,e.toLowerCase()){case"warn":console.warn(t);break;case"error":console.error(t);break;default:console.info(t)}}},Selectors:{getElementBy$:function(t,e,n=!1){var t=n?t.querySelectorAll(e):t.querySelector(e);return t||EasyPoints.Debug.print("Could not locate "+e,"warn"),t},getTotalPointsEl:function(t,e=!1){return this.getElementBy$(t,'[data-loyal-target="total-points-value"]',e)},getRedeemContainerEl:function(t,e=!1){return this.getElementBy$(t,".easy-points-form__container",e)},getRedeemPointsButtonEl:function(t,e=!1){return this.getElementBy$(t,".easy-points-button__redeem",e)},getResetPointsButtonEl:function(t,e=!1){return this.getElementBy$(t,".easy-points-button__reset",e)},getRedeemPointsInputEl:function(t,e=!1){return this.getElementBy$(t,".easy-points-form__input input",e)},getCheckoutButtonEl:function(t,e=!1){return this.getElementBy$(t,'[type="submit"][name="checkout"]',e)},getAdditionalCheckoutButtonEl:function(t,e=!1){return this.getElementBy$(t,".additional-checkout-buttons",e)}},Points:{getExcludedCost:()=>Array.from(document.querySelectorAll('[data-loyal-target="point-exclusion"]')).reduce((t,e)=>t+parseInt(e.dataset.loyalCurrencyCost),0),getTotalBonusPoints:(t=document)=>Array.from(t.querySelectorAll('[data-loyal-bonus-points]:not([data-loyal-target="total-points-value"])')).reduce((t,e)=>{var{bonusPoints:n,quantity:s=1}=JSON.parse(e.dataset.loyalBonusPoints);return(n=parseInt(n),s=parseInt(s),!isNaN(n)&&n>0)?t+n*s:t},0),insertTotalPoints(t){EasyPoints.Selectors.getTotalPointsEl(t,!0).forEach(t=>{var e=parseInt(t.dataset.loyalCurrencyCost);e-=EasyPoints.Points.getExcludedCost(),EasyPoints.Points.setCurrencyCost(t,{price:Math.floor(e),ignoreTax:!0}),EasyPoints.sdk().insertPointValue(t)})},getPriceFromEl:function(t,e=null,n=/[^\d]/g){var s=e?t.querySelector(e):t;return s?100*parseInt(s.textContent.replace(n,"")):null},getTaxedCost:function({price:t,tax:e},n=null){return null!==n&&n.dataset.loyalOpts&&(e=JSON.parse(n.dataset.loyalOpts).tax),null===e?(EasyPoints.Debug.print("Tax object not defined.","error"),t):e.included?t:e.exempt?t:Math.floor(t*e.rate)},setCost(t,e,{price:n=null,multiplier:s=1,ignoreTax:o=!1}){if((n=(null!==n?n:parseInt(t.dataset.loyalCurrencyCost))*s)<=0){t.setAttribute(e,0);return}if(t.dataset.loyalOpts){var i=JSON.parse(t.dataset.loyalOpts);o||(n=this.getTaxedCost({price:n,tax:i.tax}))}t.setAttribute(e,n)},setCurrencyCost(t,e){this.setCost(t,"data-loyal-currency-cost",e)},resetTargets:function(t={},e=null,n=null){document.querySelectorAll(null!=n?n+' [data-loyal-target="point-value"]':'[data-loyal-target="point-value"]').forEach(e=>{!e.classList.contains("points-after-applied-discount")&&this.setCurrencyCost(e,t)}),e?e():EasyPoints.sdk().updateLoyaltyTargets()}},Cart:{url:function(){return window.location.origin+"/cart.json"},getFromJSON:function(t){var e=new XMLHttpRequest;e.onreadystatechange=function(){if(e.readyState===XMLHttpRequest.DONE){var n=e.status;0===n||n>=200&&n<400?t(JSON.parse(e.responseText)):EasyPoints.Debug.print("Failed getting data from /cart.json","error")}},e.open("GET",this.url()),e.setRequestHeader("accept","application/json"),e.send()},setRedemptionForm:function(){this.getFromJSON(function(t){var e=document.getElementById("easy-points-form");e&&((maxRedeemableInput=e.querySelector('input[name="coupon[max_redeemable]"]'))&&(maxRedeemableInput.value=t.total_price),t.items.forEac
1h(function(t){var n=e.querySelectorAll('input[name="coupon[product_ids][]"]');if(!Array.prototype.find.call(n,function(e){return e.value==t.product_id})){var s=document.createElement("input");s.setAttribute("type","hidden"),s.setAttribute("name","coupon[product_ids][]"),s.setAttribute("value",t.product_id),e.appendChild(s),EasyPoints.Debug.print("New cart item input created for the submission form.")}}))})}},UI:{showHidden:function(){EasyPoints.Selectors.getElementBy$(document,".hidden-unless-discount-applied",!0).forEach(t=>t.classList.remove("easy-points-hide"))},hideHidden:function(){EasyPoints.Selectors.getElementBy$(document,".hidden-unless-discount-applied",!0).forEach(t=>t.classList.add("easy-points-hide"))},cloneSubtotal:function(){},resetClonedSubtotal:function(){},modifySubtotal:function(t){var e=t.querySelector('[data-loyal-target="total_price"]');if(!e)return EasyPoints.Debug.print("modifySubtotal(el): missing total price target."),t;var n=EasyPoints.sdk().getDiscountSession(),s=e.dataset.loyalTotalPrice,{multiplier:o}=EasyPoints.sdk().Currency.getFormatOptions()||{multiplier:100},i=s-Math.round(n*EasyPoints.sdk().Currency.getRate()*o);if(i>=0){e.innerHTML=EasyPoints.sdk().Currency.format(i);var a=t.querySelector(".points-after-applied-discount");if(a){var r=parseInt(a.innerText.replace(/\D/g,"")),l=EasyPoints.Points.getTaxedCost({price:s,tax:null},a),u=EasyPoints.Points.getTaxedCost({price:i,tax:null},a);EasyPoints.sdk().insertPointValueIntoElement(a,Math.max(0,Math.ceil(u/l*r)))}}return t},showDiscount:function(){this.showHidden(),this.buttonReset()},hideDiscount:function(){this.hideHidden(),this.buttonRedeem()},buttonRedeem:function(){EasyPoints.Selectors.getRedeemPointsInputEl(document,!0).forEach(t=>t.removeAttribute("disabled")),EasyPoints.Selectors.getResetPointsButtonEl(document,!0).forEach(t=>t.classList.add("easy-points-hide")),EasyPoints.Selectors.getRedeemPointsButtonEl(document,!0).forEach(t=>t.classList.remove("easy-points-hide"))},buttonReset:function(){EasyPoints.Selectors.getRedeemPointsInputEl(document,!0).forEach(t=>{t.setAttribute("disabled",!0);var e=EasyPoints.sdk().getDiscountSession();!t.classList.contains("valid")&&(""==t.value||t.value<=0)&&e>0&&(t.value=e)}),EasyPoints.Selectors.getResetPointsButtonEl(document,!0).forEach(t=>t.classList.remove("easy-points-hide")),EasyPoints.Selectors.getRedeemPointsButtonEl(document,!0).forEach(t=>t.classList.add("easy-points-hide"))}},Tiers:{recalculate:function(t=null){var{rankAdvancementData:e}=getEasyPointsSession();if(e&&!(e.raw_amount>=0)){var n=EasyPoints.getDiscountSession(),{multiplier:s}=EasyPointsCore.Currency.getFormatOptions()||{multiplier:100},o=Math.round(n*EasyPointsCore.Currency.getRate()*s);if(null===t){var i=document.querySelector('[data-loyal-target="total_price"]');if(!i){EasyPoints.Debug.print("recalculate(el): missing total price target.","error");return}t=i.dataset.loyalTotalPrice}try{var a=EasyPointsCore.Tiers.getNextTier(t-o);a?(Array.prototype.slice.call(document.querySelectorAll('[data-loyal-target="rank-advancement-tier-name"]')).forEach(t=>{t.textContent=a.name}),Array.prototype.slice.call(document.querySelectorAll('[data-loyal-target="rank-advancement-amount"]')).forEach(t=>{t.innerHTML=EasyPointsCore.Currency.format(a.advancementAmountMultiplied)})):Array.prototype.slice.call(document.querySelectorAll('[data-loyal-target="rank-advancement-data"] > span')).forEach(t=>{t.style.display="max-rank"==t.dataset.loyalTarget?"":"none"})}catch{EasyPoints.Debug.print("EasyPoints Tiers: error getting next tier.","error");return}}}},getCartClass:function(){try{var t=new(EPI_SETTING_CART_DRAWER?CartDrawer:CartItems);if(void 0===t.getSectionsToRender||void 0===t.getSectionInnerHTML)return null;return t}catch(e){if(e instanceof ReferenceError)return console.error("[epi]: `CartItems` or `CartDrawer` is undefined."),null;throw e}},fetchShopifyCartUI:function(){if("WebComponents"===EPI_SETTING_CART_RENDERER){var t=this.getCartClass();if(null!==t){var e=t.getSectionsToRender().map(t=>t.section).join(",");EasyPoints.sdk().Shopify.fetchSections(e).then(t=>t.json()).then(e=>
1{t.getSectionsToRender().forEach(n=>{let s=document.getElementById(n.id).querySelector(n.selector)||document.getElementById(n.id);s.innerHTML=t.getSectionInnerHTML(e[n.section],n.selector)})}).catch(t=>{console.error(t)})}}else EasyPoints.sdk().Cart.replaceTargets(["epi_product_points"])},showDiscountUI:function(){var t=EasyPoints.sdk().getDiscountSession();EasyPoints.Debug.print("Applying discount: "+t),t>0&&(EasyPoints.sdk().displayDiscount(t),EasyPoints.UI.showDiscount(),EasyPoints.UI.cloneSubtotal(),EasyPoints.Selectors.getAdditionalCheckoutButtonEl(document,!0).forEach(t=>t.classList.add("easy-points-hide")))},hideDiscountUI:function(){EasyPoints.UI.hideDiscount(),EasyPoints.UI.resetClonedSubtotal(),EasyPoints.Selectors.getAdditionalCheckoutButtonEl(document,!0).forEach(t=>t.classList.remove("easy-points-hide")),sessionStorage.removeItem("appliedDiscount"),sessionStorage.removeItem("appliedDiscountAt"),EasyPoints.Selectors.getRedeemPointsInputEl(document,!0).forEach(t=>t.value="")},removeDiscount:function(){if(EasyPoints.sdk().getDiscountSession()>0){EasyPoints.Debug.print("Removing discount");var t=EasyPoints.Selectors.getCheckoutButtonEl(document,!0),e=EasyPoints.Selectors.getResetPointsButtonEl(document);e.setAttribute("disabled",!0),t.forEach(t=>t.setAttribute("disabled",!0)),EasyPoints.sdk().removeDiscount().then(()=>{EasyPoints.fetchShopifyCartUI(),EasyPoints.hideDiscountUI(),e.removeAttribute("disabled"),t.forEach(t=>t.removeAttribute("disabled"))})}},Form:{redeem({event:t=null,points:e=null}){if(null==e){if(null==t)return EasyPoints.Debug.print("redeem({event, points}): cant get the points value","error"),!1;var n=t.target.closest(".easy-points-form__container");if(!n)return EasyPoints.Debug.print("redeem({event, points}): target form is not defined"),!1;(input=EasyPoints.Selectors.getRedeemPointsInputEl(n))&&(input.value=input.value.toString().replace(/[^\d]/g,""),e=input.value)}return EasyPoints.sdk().setRedemptionPoints({points:e})}},Register:{run:function(){EasyPoints.sdk().updateLoyaltyTargets(),EasyPoints.Tiers.recalculate()},setEventListeners:function(t=document){0!=EasyPoints.Selectors.getRedeemContainerEl(t,!0).length&&(EasyPoints.Selectors.getRedeemPointsInputEl(t,!0).forEach(t=>{t.addEventListener("focus",this.onPointsInput),t.value>0&&EasyPoints.sdk().setRedemptionPoints({points:t.value})}),EasyPoints.Selectors.getRedeemPointsButtonEl(t,!0).forEach(t=>t.addEventListener("click",this.onClickRedeemBtn)),EasyPoints.Selectors.getResetPointsButtonEl(t,!0).forEach(t=>t.addEventListener("click",this.onClickResetBtn)),EasyPoints.Debug.print("Applied all required event listeners"))},onPointsInput:function(t){t.target.classList.remove("invalid")},onClickRedeemBtn:function(t){if(t.preventDefault(),EasyPoints.Debug.print("Clicked: Redeem"),EasyPoints.Form.redeem({event:t})){var e=EasyPoints.Selectors.getCheckoutButtonEl(document,!0);t.target.style.cursor="progress",t.target.setAttribute("disabled",!0),e.forEach(t=>t.setAttribute("disabled",!0)),EasyPoints.sdk().applyDiscount(EasyPoints.sdk().getDiscountSession()).then(()=>{EasyPoints.fetchShopifyCartUI(),EasyPoints.showDiscountUI(),t.target.style.cursor="unset",t.target.removeAttribute("disabled"),e.forEach(t=>t.removeAttribute("disabled"))})}else EasyPoints.Selectors.getRedeemPointsInputEl(document,!0).forEach(t=>t.classList.add("invalid"))},onClickResetBtn:function(t){t.preventDefault(),EasyPoints.Debug.print("Clicked: Reset"),EasyPoints.removeDiscount()}}};

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.