PageSourceSearch

https://www.carrefour.it/on/demandware.static/Sites-carrefour-IT-S…ubstitutionModalUnavailableList-js.chunk.js

js carrefour.it collected 2026-09-24 17:45:37 UTC 12,803 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkapp_project=self.webpackChunkapp_project||[]).push([[4413],{8732:function(t,e,n){n.d(e,{Em:function(){return h},Jt:function(){return p},bE:function(){return f}});var r=n(10467),a=n(80296),o=n(54756),i=n.n(o),c=n(72505),s=n.n(c),u=n(79889),l=(n(57520),s().create({transformRequest:[function(t,e){if(e&&e.skiptransform)return delete e.skiptransform,t;if(t&&Object.entries(t)){for(var n=new FormData,r=0,o=Object.entries(t);r<o.length;r++){var i=(0,a.A)(o[r],2),c=i[0],s=i[1];n.append(c,s)}return n}}]})),d=function(){var t=(0,r.A)(i().mark(function t(e){var n,r;return i().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.googleRecaptchaAction,r=e.googleRecaptchaClientSide,t.abrupt("return",new Promise(function(t,e){window.grecaptcha.ready(function(){window.grecaptcha.execute(r,{action:n}).then(function(e){t(e)})})}));case 1:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}();l.defaults.headers.common["X-Requested-With"]="XMLHttpRequest",l.interceptors.request.use(function(){var t=(0,r.A)(i().mark(function t(e){var n;return i().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!(e.data&&e.data.googleRecaptchaAction&&e.data.googleRecaptchaClientSide&&window.grecaptcha)){t.next=2;break}return t.next=1,d(e.data);case 1:return n=t.sent,e.data.googleRecaptchaToken=n,t.abrupt("return",e);case 2:return t.abrupt("return",e);case 3:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}(),function(t){return Promise.reject(t)}),l.interceptors.response.use(function(t){var e=new u.A;if(t.data&&t.data.pushState||t.data.replaceState)t.data.pushState&&history.pushState({},"",t.data.pushState),t.data.replaceState&&history.replaceState({},"",t.data.replaceState),t.data.redirectUrl&&setTimeout(function(){location.href=t.data.redirectUrl},500);else if(t.data&&t.data.redirectUrl){var n=t.data.redirectUrl,r="";t.data.isPaybackPopupActive&&(r=n.indexOf("?")>-1?"&isPaybackPopupActive=true":"?isPaybackPopupActive=true"),n+=r;var a="";t.data.subscriptionTrialModalNotEligibleAfterLogin&&(a=n.indexOf("?")>-1?"&subscriptionTrialModalNotEligibleAfterLogin=true":"?subscriptionTrialModalNotEligibleAfterLogin=true"),location.href=n+a}if(t.data&&t.data.error&&(t.config.data instanceof FormData&&(t.config.data=Object.fromEntries(t.config.data),t.config.headers["Content-Type"]="application/json"),e.EMIT("error.".concat(t.data.error),{res:t})),t.data&&t.data.notificationPush&&t.data.notificationPush.showNotification&&e.EMIT("notification:push",t.data.notificationPush),t.data&&t.data.pushPromoPre&&t.data.pushPromoPre.length>0){var o=t.data.pushPromoPre.sort(function(t,e){return t.rank>e.rank?-1:e.rank>t.rank?1:0});e.EMIT("notification:pushFirstAvailable",{notifications:o})}return t.data&&t.data.pushPromoPost&&e.EMIT("notification:pushall",t.data.pushPromoPost),t},function(t){var e,n;return null!==(e=t.response)&&void 0!==e&&e.data&&null!==(n=t.response)&&void 0!==n&&null!==(n=n.data)&&void 0!==n&&n.redirectUrl&&(location.href=t.response.data.redirectUrl),Promise.reject(t)});s().CancelToken;var p=l.get,f=l.post,h=(l.all,l.spread,l.request)},57467:function(t,e,n){n.d(e,{A:function(){return h}});var r=n(64467),a=n(23029),o=n(92901),i=n(50388),c=n(53954),s=n(15361),u=n(85349),l=n.n(u),d=n(24263);function p(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function f(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(f=function(){return!!t})()}var h=function(t){function e(t){var n,r,o,s;return(0,a.A)(this,e),r=this,o=e,s=[t],o=(0,c.A)(o),(n=(0,i.A)(r,f()?Reflect.construct(o,s||[],(0,c.A)(r).constructor):o.apply(r,s)))._componentElement=t,n._componentElement.setAttribute("data-component-init","true"),n._checkMessages(),n}return(0,s.A)(e,t),(0,o.A)(e,[{key:"$el",get:function(){return this._componentElement}},{key:"$options",get:function(){var t={},n=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};
1e%2?p(Object(n),!0).forEach(function(e){(0,r.A)(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({},this.$el.dataset);return Object.keys(n).filter(function(t){return t.includes("option")}).forEach(function(r){var a,o=e.cleanOptionKey(r);a=n[r].includes("{")&&n[r].includes("}")?JSON.parse(n[r].replace(/'/g,'"')):e.convertType(n[r]),t[o]=a}),(0,d.A)(t)}},{key:"COMPONENT_NAME",get:function(){return this.$el.getAttribute("data-component")}},{key:"$on",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.$el,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;n&&t&&e&&(r?l().on(n,t,r,function(t){t&&t.stopPropagation(),e(t)}):l().on(n,t,function(t){t&&t.stopPropagation(),e(t)}))}},{key:"$one",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.$el;l().one(n,t,e)}},{key:"$off",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.$el;l().off(e,t)}},{key:"$fire",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.$el;l().fire(e,t)}},{key:"loading",value:function(t,e){this._loading=!0,this.EMIT(this.CUSTOM_MESSAGES.LOADER_EVENTS.show,{container:t||document.body,message:null!=e?e:null})}},{key:"endLoading",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=arguments.length>3?arguments[3]:void 0;this._loading=!1,setTimeout(function(){n._loading||n.EMIT(n.CUSTOM_MESSAGES.LOADER_EVENTS.hide,{container:t||document.body,message:e,error:r,icon:a})},400)}}],[{key:"convertType",value:function(t){var e;switch(t){case"false":e=!1;break;case"true":e=!0;break;case"null":e=null;break;default:e=t}return e}},{key:"cleanOptionKey",value:function(t){var e=t.replace("option","");return"".concat(e.charAt(0).toLocaleLowerCase()).concat(e.slice(1))}}])}(n(39860).A)},92974:function(t,e,n){n.r(e),n.d(e,{default:function(){return b}});var r=n(45458),a=n(10467),o=n(23029),i=n(92901),c=n(50388),s=n(53954),u=n(15361),l=n(54756),d=n.n(l),p=n(57467),f=n(8732),h=n(27848),v=n(43591);function S(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return g(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?g(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,a=function(){};return{s:a,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,c=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return i=t.done,t},e:function(t){c=!0,o=t},f:function(){try{i||null==n.return||n.return()}finally{if(c)throw o}}}}function g(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function y(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(y=function(){return!!t})()}var b=function(t){function e(t){var n,r,a,i;(0,o.A)(this,e),r=this,a=e,i=[t],a=(0,s.A)(a),(n=(0,c.A)(r,y()?Reflect.construct(a,i||[],(0,s.A)(r).constructor):a.apply(r,i))).loading(),n.setDeleteProductListener();var u=n.$options.uuid,l=n.$options.pid,d=document.querySelector(n.SELECTORS.unavailableProductsContainer);return d&&d.getAttribute("data-option-selected-uuid")&&d.getAttribute("data-option-selected-pid")&&(u=d.getAttribute("data-option-selected-uuid"),l=d.getAttribute("data-option-selected-pid")),n.setState({count:0,totalSteps:+n.$options.length,nextUUID:u,nextPID:l}),n.selectNextLineItem(),n.setListHeight(),n}return(0,u.A)(e,t),(0,i.A)(e,[{key:"SELECTORS",get:function(){return{productLineItem:".js-line-item-card",deleteBtn:".js-product-remove",countLabel:".js-count-label",progressBar:".js-progress-wizard",subsitutionListContainer:".js-substitution-list-container",substituteBtn:".js-product-substitution-btn",wizardModal:".replace-wizard .vex-content",templateElement:"#js-wizard-cart-complete",unavailableProductsContainer:".unavailable-products"}}},{key:"CLASSES",get:function(){return{displayNone:"d-none"}}},{key:"setListHeight",value:function(){var t=document.querySelector(this.SELECTORS.subsitutionListContainer);new v.A(function(e){if((0,h.YW)("lg",null)){var n,r=S(e);try{for(r.s();!(n=r.n()).done;){n.value;t.style.height=window.innerHeight-t.getBoundingClientRect().top+"px"}}catch(t){r.e(t)}finally{r.f()}}else t.style.height="unset"}).observe(document.querySelector(this.SELECTORS.wizardModal))}},{key:"stateChange",value:function(t){"currentUUID"in t&&this.handleLineItemSelection(),"count"in t&&this.updateCountLabel()}},{key:"setDeleteProductListener",value:function(){var t=this;this.$on("click.deleteProductBtn",function(){var e=(0,a.A)(d().mark(function e(n){return d().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t.loading(),e.prev=1,e.next=2,(0,f.Jt)(n.target.getAttribute("data-option-endpoint"));case 2:t.selectNextLineItem(),t.endLoading(),e.next=4;break;case 3:e.prev=3,e.catch(1),t.endLoading();case 4:case"end":return e.stop()}},e,null,[[1,3]])}
1));return function(t){return e.apply(this,arguments)}}(),this.$el,(0,r.A)(this.$el.querySelectorAll(this.SELECTORS.deleteBtn)))}},{key:"setProductSubstituteListener",value:function(t){var e=this;t?this.$off("click.substituteProductBtn"):this.$on("click.substituteProductBtn",function(){var t=(0,a.A)(d().mark(function t(n){return d().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e.loading(),t.prev=1,e.$el.querySelectorAll(e.SELECTORS.deleteBtn).forEach(function(t){t.classList.add(e.CLASSES.displayNone)}),t.next=2,(0,f.bE)(e.$options.endpointSubmit,{oldProductId:e.state.currentPID,oldProductUUID:e.state.currentUUID,newProductId:n.target.getAttribute("data-option-pid")});case 2:t.sent.data.success&&(n.target.closest(".line-item-card").classList.add("selected"),e.$el.querySelectorAll(".line-item-card:not(.selected)").forEach(function(t){t.classList.add("with-opacity")}),setTimeout(function(){e.selectNextLineItem(),e.$el.querySelectorAll(e.SELECTORS.deleteBtn).forEach(function(t){t.classList.remove(e.CLASSES.displayNone)})},2500)),e.endLoading(),t.next=4;break;case 3:t.prev=3,t.catch(1),e.endLoading();case 4:case"end":return t.stop()}},t,null,[[1,3]])}));return function(e){return t.apply(this,arguments)}}(),this.$el,(0,r.A)(this.$el.querySelectorAll(this.SELECTORS.substituteBtn)))}},{key:"selectNextLineItem",value:function(){var t=this;this.state.count===this.state.totalSteps?(this.EMIT(this.CUSTOM_MESSAGES.MODAL_EVENTS.close,{}),this.EMIT(this.CUSTOM_MESSAGES.MODAL_EVENTS.show,{selector:this.SELECTORS.templateElement,className:"full-height w-400 empty-cart js-replace-items js-cart-ready",afterClose:function(){t.loading(),window.location.reload()}})):this.setState({currentUUID:this.state.nextUUID,currentPID:this.state.nextPID})}},{key:"handleLineItemSelection",value:function(){var t=this;this.$el.querySelectorAll(this.SELECTORS.productLineItem).forEach(function(e){e.classList.add(t.CLASSES.displayNone)});var e=this.$el.querySelector("#js-unavailable-line-".concat(this.state.currentUUID));e&&(e.classList.remove(this.CLASSES.displayNone),this.setState({nextUUID:e.getAttribute("data-option-next-uuid"),nextPID:e.getAttribute("data-option-next-pid"),count:this.state.count+1})),this.getSubstitutionProductList()}},{key:"updateCountLabel",value:function(){document.querySelector(this.SELECTORS.countLabel).innerHTML="<b>"+this.state.count+"</b> / "+this.state.totalSteps,document.querySelector(this.SELECTORS.progressBar).style.width=this.state.count/this.state.totalSteps*100+"%"}},{key:"getSubstitutionProductList",value:(n=(0,a.A)(d().mark(function t(){var e;return d().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return this.loading(),t.prev=1,this.setProductSubstituteListener(!0),t.next=2,(0,f.Jt)(this.$options.endpoint,{params:{pid:this.state.currentPID}});case 2:e=t.sent,this.$el.querySelector(this.SELECTORS.subsitutionListContainer).innerHTML=e.data,this.setProductSubstituteListener(),t.next=4;break;case 3:t.prev=3,t.catch(1);case 4:this.endLoading();case 5:case"end":return t.stop()}},t,this,[[1,3]])})),function(){return n.apply(this,arguments)})}]);var n}(p.A)}}]);

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.