1let DEFAULT_SHOP=16;var Modal={overquantity:!1,mobileApp:null,main(){$("#modalConfirmation").on("hidden.bs.modal",Modal.confirmationResetModal)},confirm(e,a,t){if(!(e=void 0===e?null:e))return!1;$("#modalConfirmation").busyLoad("show"),$("#modalConfirmation").modal().on("shown.bs.modal",function(){Modal.confirmationResetModal(),Modal.confirmationSetContent(e),$('[data-action="modalConfirmation-cancel"]').click(function(e){e.preventDefault(),Modal.confirmationResetModal(),null!=t&&t(e)}),$('[data-action="modalConfirmation-confirm"]').click(function(e){e.preventDefault(),$("#modalConfirmation").modal("hide"),null!=a&&a(e)})})},confirmationSetContent(e){var a;void 0===e&&(e=null),a=$("#modalConfirmation .modal-content .modal-body"),$("#modalConfirmation .modal-content .modal-footer"),e&&e.info&&e.info.title&&a.find("[data-title]").html(e.info.title),e&&e.info&&e.info.description&&a.find("[data-content]").html(e.info.description),$("#modalConfirmation").busyLoad("hide")},confirmationResetModal(){$("#modalConfirmation [data-title], #modalConfirmation [data-content]").html("")},loading(e){e?$.busyLoadFull("show"):$.busyLoadFull("hide")},sendVerificationOTP(e,a={},t){$("#error_otp").parent().addClass("d-none");let o=$("#ModalOTP_numbers").find("input").map(function(){return this.value}).get();o=o.join(""),$.ajax({async:!0,type:"POST",data:{...a,otp:o},dataType:"json",url:validateURL.URL()+e,success:function(e){if(e.success){"undefined"!=typeof accountApp&&window.location.pathname.includes("ecoclient/account")&&accountApp.$mount.$refs.account.$refs.myaccount.cancelEdit();try{InsiderEvent.sendObject(t.insiderObject)}catch(e){}""!==e.message&&Main.showNotify(e.message),null!==t.url&&e.success&&document.location.replace(t.url),$("#modalOTP").modal("toggle")}else $("#error_otp").parent().removeClass("d-none"),$("#error_otp").html(e.message)},error:function(e){$("#error_otp").parent().removeClass("d-none");e=JSON.parse(e.responseText);$("#error_otp").html(e.message)}}).always(function(){$("#ModalOTP_numbers").find("input").prop("disabled",!1)})},showModalOTP(o,n,d={}){$("#error_otp").parent().addClass("d-none"),!1!==o.otp.modal&&($("#modalOTP").modal().off("shown.bs.modal"),$("#modalOTP").modal().on("shown.bs.modal",function(){$("#modalOTP[data-numOTP]").val(o.otp.length);var a='<div class="row"><div class="col-12">';for(let e=1;e<=o.otp.length;e++){var t="code_"+e;a+='<input id="'+t+'" inputmode="numeric" pattern="[0-9]*" type="text" name="'+t+'"'+(e+1<=o.otp.length?' data-next="code_'+(e+1)+'"':"")+(0<e-1?' data-previous="code_'+(e-1)+'"':"")+' maxlength="1" class="border" autocomplete="off" style="display: inline-block; width: 5rem; height: 5rem; margin: 0.25rem; background-color: #f5f5f5;">'}a+="</div></div>",$("#modalOTP #ModalOTP_numbers").html(a),$("#modalOTP #code_1").focus(),$("#ModalOTP_numbers").find("input").each(function(){$(this).on("keyup",function(e){var a,t=$($(this).parent());8===e.keyCode||37===e.keyCode?(a=t.find("input#"+$(this).data("previous"))).length&&$(a).select():0<e.target.value.length&&((a=t.find("input#"+$(this).data("next"))).length?$(a).select():($("#ModalOTP_numbers").find("input").prop("disabled",!0),Modal.sendVerificationOTP(n,d,o)))})}),$("#resendOTP").click(function(){var e=void 0!==d.emailOrPhone?d.emailOrPhone:null,a=void 0!==d.password?d.password:null,t=void 0!==d.password_retype?d.password_retype:null,o=void 0!==d.csrf_token?d.csrf_token:null;return void 0!==d.isForgotPassword&&d.isForgotPassword?Modal.forgotPassword(e,a,t,o):Modal.resendVerificationOTP(e),Modal.countdown("ModalOTP_counter","counterModal",30,1e3),$("#ModalOTP_numbers").find("input").map(function(){$(this).val("")}
1),!1})}))},resendVerificationOTP(a){grecaptcha.execute(recaptcha.key_web_site,{action:"resendOTP"}).then(function(e){document.getElementById("resendOTP").value=e,$.ajax({async:!0,type:"POST",data:{emailOrPhone:a,gtoken:e},dataType:"json",url:validateURL.URL()+"/ecoclient/resendVerificationOTP",success:function(e){e.success||($("#error_otp").parent().removeClass("d-none"),$("#error_otp").html(e.message)),Modal.disableElementForSpecifiedTime("resendOTP",3e4)},error:function(e){$("#error_otp").parent().removeClass("d-none");e=JSON.parse(e.responseText);Modal.disableButtonResend(e.code),"recaptcha"==e.action?$("#error_otp").html(e.error):$("#error_otp").html(e.message)}})})},forgotPassword(t,o,n,d){grecaptcha.execute(recaptcha.key_web_site,{action:"forgotPass_ChangePassword"}).then(function(e){$(".message").remove();let a={emailOrPhone:t,password:o,password_retype:n,csrf_token:d,isForgotPassword:!0,gtoken:e};$.ajax({type:"POST",data:a,dataType:"json",url:validateURL.URL()+"/ecoclient/forgotSendOTP",timeout:1e5,success:function(e){e.success?e.otp.modal&&Modal.showModalOTP(e,"/ecoclient/resetPasswordFamily",a):(e=Messages.getText("error"),$("#error_otp").parent().removeClass("d-none"),$("#error_otp").html(e)),Modal.disableElementForSpecifiedTime("resendOTP",3e4)},error:function(e){var a=Messages.getText("error");$("#error_otp").parent().removeClass("d-none"),$("#error_otp").html(a)}})})},countdown(e,a,t,o){let n=document.querySelector("#"+e),d=(n.style.display="block",document.querySelector("#"+a)),l=(d.innerHTML=t,setInterval(function(){t--,0==(d.innerHTML=t)&&(n.style.display="none",clearInterval(l))},o))},disableElementForSpecifiedTime(e,a){let t=document.querySelector("#"+e);t.disabled=!0,setTimeout(()=>{t.disabled=!1},a)},disableButtonResend(e){document.querySelector("#resendOTP").disabled=!0,document.querySelector("#ModalOTP_counter").style.display="none"}};function showBuyModal(e,a){var t=$("#modal > .modal-dialog"),o=(t.addClass("modal-dialog-lg modal-dialog-buy h-100"),t.find(".modal-content").addClass("modal-buy"),$('.productBox .itemCounter input[type="number"]').val());$.ajax({type:"GET",data:{items:a},dataType:"html",url:validateURL.URL()+"/products/template_modal_buy",headers:{"Content-Type":"application/json",Accept:isWebpSupported()?"image/webp":""},async:!1,success:function(e){$("#modal").modal().on("hidden.bs.modal",function(){$("#modal .modal-content").html(""),$(this).modal("dispose")});var n=$("#modal");n.html(e),n.find(".related-box").on("click",".combine",function(e){e.preventDefault();var e=$(this).data("item"),t=[],a=(n.find(".additems_list .list .item").each(function(e,a){t.push($(this).data("id"))}),(-1!==t.indexOf(e)?sumItemToList:addItemToList)(e),$("#count_"+e).attr("max")),o=$("#count_"+e).val();disabledQuantity(parseInt(e),parseInt(a),parseInt(o),1)}),$(".modal .itemCounter span.val").text(o)},error:()=>{$.busyLoadFull("hide"),toastr.error(Messages.getText("error")),window.location.href="/"},complete:()=>$.busyLoadFull("hide"),timeout:1e4})}function showAbandonedCartModal(){$("#modal").modal().off("shown.bs.modal"),$("#modal").modal().on("shown.bs.modal",function(){$.ajax({async:!0,type:"GET",dataType:"html",url:validateURL.URL()+"/shoppingcart/template_abandoned_cart_modal",global:!1,success:function(e){$("#modal").html(e),$("#modal_abandoned").parent().addClass("modal-abandoned"),$(".modal-backdrop").last().removeClass("show")},timeout:1e4})}),$("#modal").modal().off("hidden.bs.modal"),$("#modal").modal().on("hidden.bs.modal",function(){$("#modal .modal-content").html(""),$(this).modal("dispose")})}function showDeleteAccount(){$("#modal").modal().off("shown.bs.modal"),$("#modal").modal().on("shown.bs.modal",function(){$("#modal .modal-header").html("<h4>Are you sure to delete your account</h4>"),$("#modal .modal-body").html("<p>If you'd like to reduce your email notifications, <a href=''>you can disable them here</a> or if you just want to change your personal information, <a href=''>you can do that here.</a></p>"),$("#modal .modal-footer").html('<div class="form-group"><button @click="cancelDelete" class="btn btn-sm mt-0 business">Cancel</button><button @click="deleteAccount" class="btn btn-sm mt-0 business"><i class="fa fa-exclamation"></i>Delete account</button></div>')})}function cancelDelete(){$("#modal").html("<h4>Are you sure to delete your account</h4>")}function showOfferEvoucher(a){var t=$("div.register #create_registration_base").val();$("#modal").modal().off("shown.bs.modal"),$("#modal").modal().on("shown.bs.modal",function(){$.ajax({async:!0,type:"GET",dataType:"html",url:validateURL.URL()+"/shoppingcart/template_provide_evoucher",global:!1,success:function(e){$("#modal").length,$("#modal").html(e),$("#modal_offer_evoucher div.register #create_registration_base").val(t),$("#modal_offer_evoucher div.register #createAccount_email").val(a.email),$("#modal_offer_evoucher div.register #createAccount_phone").val(a.p
1hone),$("#modal_offer_evoucher div.register #createAccount_name").val(a.name),$("#modal_offer_evoucher div.register #createAccount_lastname").val(a.lastname),$("#modal_offer_evoucher div.register #evoucher_email").html(a.email)},timeout:1e4})}),$("#modal").modal().off("hidden.bs.modal"),$("#modal").modal().on("hidden.bs.modal",function(){$("#modal .modal-content").html(""),$(this).modal("dispose")})}function addItemToList(l){if(!/^[0-9]{8}$/.test(pad(l,8)))return!1;$.ajax({async:!0,type:"GET",data:{id:l},dataType:"html",url:validateURL.URL()+"/products/item_list_preview",success:function(n){let e=[{id:l,quantity:1}],d=this;RepositoryFactory.get("shoppingcart").addToCart(e,function(e){if(e?.purchase){var e=e.purchase,t=e.shopping.filter(e=>e.id==l)[0];try{Main.gaModalAddToCart(t,Modal.mobileApp,1)}catch(e){console.warn("Error dispatching events - Add to cart")}var t=document.querySelector("#modal .modal-dialog .modal-content.modal-buy"),o=(t.querySelector(".additems_list .list").insertAdjacentHTML("beforeend",n),$(".quantity-limit-side").addClass("d-none"),$(".quantity-limit-under").removeClass("d-none"),GA_datalayer.sendEventToFlutter(Modal.mobileApp,"updateShoppingCartIcon"),$(d).attr("data-item",l),t.querySelectorAll(".additems_list .list .item"));let a=0;0<o.length&&o.forEach(e=>{0<Number(e.dataset.stock)&&a++});o=t.querySelector(".modal-header .added > .num");o&&(o.textContent=a),bbVue.eventBus.emit("updateCart",e)}})},timeout:1e4})}function checkItemOnList(e,a){return a===e}function sumItemToList(e){var a=$('#modal .modal-content .modal-body .list [data-id="'+e+'"]');a.find('[data-quantity] [data-action="sum"]').click(),a.addClass("uploading"),setTimeout(function(){a.removeClass("uploading")},1e3)}function getUrlShare(e){var a=validateURL.URL()+"/ecoclient/getUrlShare",t=null;return $.ajax({async:!1,type:"POST",data:{order:e},dataType:"json",url:a,success:function(e){t=e}}),t}function showShareEmailModal(a,e,t){$("#modal").modal().on("shown.bs.modal",function(){$.ajax({async:!0,type:"GET",data:{id:e,isOrder:t},dataType:"html",url:validateURL.URL()+"/products/template_modal_sharemail",success:function(e){$("#modal").html(e),0<$("#itemURL").length&&$("#itemURL").val(a)},timeout:1e4})})}function sendEmail(){var e=$("#itemId").val(),a=$("#itemURL").val(),t=$("#recipientEmail").val(),o=!0,n=(validateEmail(t)||(n=Messages.getText("email_format"),toastr.error(n),o=!1),getUrlShare(e));1==o&&(n?(o=null,o={url:a+validateURL.URL()+"/Shoppingcart/sharesocialmedia?token="+n,recipientEmail:t,orderId:e},$.ajax({async:!0,type:"POST",data:{dataSendMail:o},dataType:"json",url:validateURL.URL()+"/ecoEmail/sendEmailShare",success:function(e){$("#sendButton").prop("disabled",!0)},timeout:5e3})):$.ajax({async:!0,type:"POST",data:{itemId:e,itemURL:a,recipientEmail:t},dataType:"json",url:validateURL.URL()+"/products/sendEmailShare",success:function(e){$("#sendButton").prop("disabled",!0)},timeout:5e3}),$("#modal").modal("hide"))}function showNoStockModal(e,t,o,n,d){var l=document.getElementById("modal");if(l){let a=new bootstrap.Modal(l,{keyboard:!1});$.ajax({async:!0,type:"POST",data:{productNoStock:e,currentStock:t,buyable:o,showable:n,end_sale_date:d},dataType:"html",url:validateURL.URL()+"/shoppingcart/template_modal_no_stock",success:function(e){$("#modal").html(e),0<$(".modal-stock-item-list p.alert-inline-message--negative").length&&$(".modal-stock-item-list p.alert-inline-message--negative").removeClass("d-none"),a.show()}})}}function findItems(e,a){var t=[];if(e&&a)for(var o in e)for(var n in a)e[o].id==a[n].id&&(e[o].quantityAdded=a[n].quantity,t.push(e[o]));return t}function getMaxAllowedQuantity(e,a){return a&&a<e?a:e}$(document).on("click",'[data-action="goCart"]',function(e){$("#modal").busyLoad("show"),window.location.href=validateURL.URL()+"/shoppingcart"}),$(document).ready(function(){$(document).on("click",'[data-action="buy"]',function(r){let s=parseInt(r.currentTarget.dataset.item);if(!/^[0-9]{8}$/.test(pad(s,8)))return!1;$.busyLoadFull("show");let c=1,m=(null!=$(".productBox #count_"+s).val()&&(c=parseInt($(".productBox #count_"+s).val())),[]),u=0<$("#csi label strong").length?$("#csi label strong")[0].dataset.value:"";var e;void 0!==u&&""!=u&&(e=0<$("#csi label strong").length?parseInt($("#csi label strong")[0].dataset.quantity):0,m.push({id:parseInt(u),quantity:e,parent:!1})),m.push({id:s,quantity:c,parent:!0}),m.sort(function(e,a){return a.parent-e.parent});RepositoryFactory.get("shoppingcart").addToCart(m,function(e){if(e?.purchase){var a,l,i,t=e.purchase;
1for(a in GA_datalayer.sendEventToFlutter(Modal.mobileApp,"updateShoppingCartIcon"),$(this).attr("data-item",s),void 0!==u&&""!=u&&$(this).attr("data-child",u),showBuyModal($(this),m),t.shopping)t.shopping[a].id==s&&(l=t.shopping[a].stock,i=t.shopping[a].quantity_limit);$("#modal").on("shown.bs.modal",function(){let d=$(this);m.forEach(e=>{var a=parseInt(e.id),e=parseInt(e.quantity),t=d.find("#count_"+a),t=(t.val(e).attr("value",e),t.val(e).attr("data-oldValue",e),parseFloat(t.attr("data-currentprice"))||0),t=t*e,o=d.find(`article[data-id="${a}"]`).find(".product-total"),n=(o.empty(),$("<span />").addClass("currency").html("Rp")),o=(o.append(n).append(formatPrice(t)),getMaxAllowedQuantity(parseInt(l),i&&parseInt(i)));disabledQuantity(a,o,e,1)})}),bbVue.eventBus.emit("updateCart",t);try{var o,n=t.shopping.filter(e=>e.id==s)[0],d=(Main.gaModalAddToCart(n,Modal.mobileApp,c,r.target),void 0!==u&&""!=u&&void 0!==(o=t.shopping.filter(e=>e.id==u)[0])&&Main.gaModalAddToCart(o,Modal.mobileApp,quantityItemRelation),AlgoliaEvents.getItemFromLocalStorage("clickedObjectIDsAfterSearch",s));"boolean"!=typeof d&&AlgoliaEvents.setLocalChanges("convertedObjectIDsAfterSearch",s,d)}catch(e){console.warn("Error dispatching events - Add to cart")}}})}),$(document).on("click",'[data-action="cashOnDelivery"]',function(e){e.preventDefault(),$("#modal").busyLoad("show");let a={showPrice:-1!==window.location.href.indexOf("products")?{showPrice:!1}:{showPrice:!0}};$("#modal").modal({keyboard:!1,backdrop:"static"}).on("shown.bs.modal",function(){$.ajax({async:!0,type:"POST",dataType:"html",data:a,url:validateURL.URL()+"/shoppingcart/template_cash_on_delivery_modal",success:function(e){$("#modal").html(e)}})}),$("#modal").modal().off("hidden.bs.modal"),$("#modal").modal().on("hidden.bs.modal",function(){$("#modal .modal-content").html(""),$(this).modal("dispose")})}),$(document).on("click",'[data-action="cashOnDeliverySummary"]',function(e){e.preventDefault(),$("#modal").busyLoad("show"),$("#modal").modal({keyboard:!1,backdrop:"static"}).on("shown.bs.modal",function(){$.ajax({async:!0,type:"POST",dataType:"html",url:validateURL.URL()+"/shoppingcart/template_cash_on_delivery_summary_modal",success:function(e){$("#modal").html(e)}})}),$("#modal").modal().off("hidden.bs.modal"),$("#modal").modal().on("hidden.bs.modal",function(){$("#modal .modal-content").html(""),$(this).modal("dispose")})});{let a=$(".sliderProductDetail");$("#modalGallery").on("shown.bs.modal",function(e){$('#modalGallery [data-slider="tab"]').slick({lazyLoad:"ondemand",dots:!1,arrows:!1,slidesToShow:8,slidesToScroll:1,vertical:!0,verticalSwiping:!0,infinite:!1,centerMode:!1,responsive:[{breakpoint:1200,settings:{vertical:!1,verticalSwiping:!1,slidesToShow:10,arrows:!0}},{breakpoint:1e3,settings:{vertical:!1,verticalSwiping:!1,slidesToShow:9,arrows:!0}},{breakpoint:768,settings:{vertical:!1,verticalSwiping:!1,slidesToShow:8,arrows:!0}},{breakpoint:620,settings:{vertical:!1,verticalSwiping:!1,slidesToShow:6,arrows:!0}},{breakpoint:460,settings:{vertical:!1,verticalSwiping:!1,slidesToShow:5,arrows:!0}}],asNavFor:"#modalGallery .sliderProductDetail"}),1!==a[0].slick.slideCount&&(e=e.relatedTarget.dataset.index,a)&&a.slick("slickGoTo",e)}),$("#modalGallery").on("hidden.bs.modal",()=>$('#modalGallery [data-slider="tab"]').slick("unslick"))}}),window.addEventListener("resize",function(){$(document).width()<768?$("#modalGallery").modal("hide"):0<$("#zoomProductDetail").length&&$("#zoomProductDetail").remove()}),$(document).ajaxStart(function(){$("#modal").busyLoad("show",{animation:"fade"})}).ajaxStop(function(){$("#modal").busyLoad("hide",{animation:"fade"})}),$(document).mouseup(function(e){var a=$(".container-email-stock");a.is(e.target)||0!==a.has(e.target).length||a.addClass("d-none")});
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.