PageSourceSearch

https://www.puratos.com/etc.clientlibs/settings/wcm/designs/purato…/resources/static/js/8204.8a79545f.chunk.js

js puratos.com collected 2026-10-02 03:59:10 UTC 10,726 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunkpuratos_react=self.webpackChunkpuratos_react||[]).push([[8204],{13956(e,t,n){n.d(t,{$:()=>h,h:()=>b});var o=n(96540),r=n(5556),a=n.n(r),l=n(41953),i=n(63173),s=n(23670),c=n(52819),p=n(74848);const u=["color","loading","disabled","response","className","noRemainingQuantity","translate","icon","text","small","onClick"];var d;function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,o)}return n}function m(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?f(Object(n),!0).forEach(function(t){y(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function y(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=typeof o)return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class h extends o.Component{render(){const{children:e,square:t,block:n,color:o,onClick:r,disabled:a,className:i,size:s,inverted:c,mouseEvent:u}=this.props;return(0,p.jsx)("div",{className:(0,l.zP)(["btn",n&&"btn-block",o&&"btn-"+o,s&&"btn-"+s,t&&"btn-square",c&&"btn-inverted",a&&"btn-disabled disabled",i]),onClick:a?null:r,onMouseEnter:u,onMouseLeave:u,children:e})}}function b(e){var t;let{color:n="",loading:r,disabled:a,response:l,className:d="",noRemainingQuantity:f=!1,translate:y,icon:b,text:v,small:g=!1,onClick:S}=e,O=function(e,t){if(null==e)return{};var n,o,r=function(e,t){if(null==e)return{};var n={};for(var o in e)if({}.hasOwnProperty.call(e,o)){if(-1!==t.indexOf(o))continue;n[o]=e[o]}return n}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}(e,u);const j="You have reached the maximum number of times this item can be purchased",[P,w]=(0,o.useState)(!1);return(0,o.useEffect)(()=>{r&&w(!0);let e=null;return!r&&P&&(e=setTimeout(()=>w(!1),3e3)),()=>clearTimeout(e)},[r]),(0,p.jsx)(c.A,{placement:"auto",trigger:"hover",tooltip:y?y(j):j,disabled:!f,children:g?(0,p.jsx)(s.I,{confirmation:r,response:l,children:(0,p.jsx)("a",{className:"btn-add-to-cart ".concat(a?"disabled":""),href:"#!",onClick:S,children:(0,p.jsx)("span",{className:"btn-add-to-cart__holder btn-add-to-cart__icon"})})}):(0,p.jsx)(h,m(m({color:i.gC.primary,onClick:S,className:a?(d||"")+" disabled"+(P?" button-animation-active":""):(d||"")+(P?" button-animation-active badge-success":"")},O),{},{children:(0,p.jsxs)(s.I,{confirmation:r,response:l,longButton:!0,children:[b?(0,p.jsx)("span",{className:"svg-shopping-cart-white hidden-if-not-only"}):"",null!==(t=y&&v?y(v):v)&&void 0!==t?t:(0,p.jsxs)("div",{className:"p-flex",children:["+ ",(0,p.jsx)("span",{className:"svg-shopping-cart-white p-margin-left-sm"})]})]})}))})}d=h,y(h,"defaultProps",{disabled:!1,classes:[]}),y(h,"colors",{PRIMARY:"primary",SECONDARY:"secondary",SECONDARY_INVERTED:"secondary-inverted",DEFAULT:"default"}),y(h,"propTypes",{block:a().bool,color:a().oneOf(Object.values(d.colors)),onClick:a().func.isRequired,disabled:a().bool,className:a().string,square:a().bool,children:a().any,classes:a().array})},92848(e,t,n){n.d(t,{d:()=>x});var o=n(96540),r=n(19115),a=n(99792),l=n(79393),i=n(15195),s=n(96267),c=n(20666),p=n(7689),u=n(62274),d=n(13956),f=n(74692),m=n(51044),y=n(46222),h=n(95786),b=n(60040),v=n(69727),g=n(87055),S=n(76948),O=n(6664),j=n(51701),P=n(54585),w=n(5864),_=n(31977),E=n(7790),N=n(48931),A=n(74848);function C(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,o)}return n}function D(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};
1t%2?C(Object(n),!0).forEach(function(t){k(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):C(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function k(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=typeof o)return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const x="multi-product-ordering";u.P.modals[x]=function(e){const[t,n]=(0,o.useState)(null),[u,C]=(0,o.useState)(!1),k=(0,r.useSelector)(b.B$),x=(0,r.useSelector)(O.D9),U=(0,r.useSelector)(b.u6),I=(0,r.useSelector)(O.GY),F=e.payload.skus,W=e.payload.translate,[R,T]=(0,o.useState)([]),[B,G]=(0,o.useState)([]),[M,L]=(0,o.useState)(!1),[q,K]=(0,o.useState)(!1),Y=(0,r.useDispatch)(),Q=(0,r.useSelector)(e=>(0,l.KT)(e,(0,l.FK)()));(0,o.useEffect)(()=>{if(t&&t.length){const e=[].concat(...t).filter(e=>!e.isObsolete&&e.hasPrice&&"BLOCKSALE"!==e.stockType);K(!e.length),F&&0!==(null===F||void 0===F?void 0:F.length)||0!==R.length||(T(t.map(e=>{var t;return null===(t=e[0])||void 0===t?void 0:t.materialNumber})),G(Array.from({length:t.length},()=>1)))}},[t]),(0,o.useEffect)(()=>{(0,a.hf)(a.gg.valid)&&(C(!0),(0,N.s)(e.payload.productIds).then(t=>{const o=e.payload.productIds.map(e=>t[e]||[]).filter(e=>e.length>0);n(o)}).catch(e=>{console.error("Failed to fetch multi product SKU data:",e),n([])}).finally(()=>C(!1)),e.payload.showBundles&&Y((0,g.w$)(e.payload.productIds)))},[e.payload.productIds]),(0,o.useEffect)(()=>{F&&(T(F),G(Array.from({length:F.length},()=>1)))},[F]),(0,o.useEffect)(()=>{const e=f("body");return e.addClass("modal-open"),()=>e.removeClass("modal-open")});const z=e=>n=>{var o;const r=[...R];r[e]=null===(o=(0,y.zB)(t[e],n))||void 0===o?void 0:o.materialNumber,T(r)},$=(0,o.useCallback)(e=>t=>{const n=[...B];n[e]=t,G(n)},[B]),V=(t,n)=>{Y((0,v.EG)(D(D({},t),{},{type:(0,S.GU)(e.payload.type)}))),(0,h.V)(t,e.payload.type,!0,k,x,n),j.v.selectItem({user_id:k,page_language:(0,P.wq)(),email_address:(0,a.M3)()?U:"",login_status:k?w.y.LOGGED_IN:w.y.GUEST,website_section:E.k.recipe,items:(0,_.L_)(t,x,e.payload.type)})};return(0,A.jsxs)(s.P,{skus:t,loading:u,title:"Select package",addAll:e.payload.addAll,children:[null===t||void 0===t?void 0:t.map((n,r)=>(0,A.jsx)(o.Fragment,{children:(0,A.jsxs)(m.N8,{type:e.payload.type,children:[(0,A.jsx)(c.A,{sku:n,skuChangeHandler:z(r),onQuantityChange:$(r),addAll:e.payload.addAll,showBundles:e.payload.showBundles||!1,hideCartAmountAlert:e.payload.hideCartAmountAlert,selected:n.map(e=>e.materialNumber).find(e=>R.includes(e)),quantity:B[r],addEvent:V,position:r+1}),r<t.length-1&&(0,A.jsx)(p.c,{})]})},r)),e.payload.addAll&&(0,A.jsx)(d.h,{className:"btn-add-all",loading:Q,disabled:Q||q,onClick:()=>{if(!u){L(!1);const n=t.map(e=>e.find(e=>R.includes(null===e||void 0===e?void 0:e.materialNumber))).filter(e=>"BLOCKSALE"!==(null===e||void 0===e?void 0:e.stockType)).map((e,t)=>D(D({},e),{},{quantity:B[t]}));(null===n||void 0===n?void 0:n.length)>=1&&Y((0,i.Rv)(n,e.payload.type,()=>{return o=n,G(Array.from({length:t.length},()=>1)),L(!0),void o.filter(e=>e.hasPrice).map(t=>{Y((0,v.EG)(D(D({},t),{},{type:(0,S.GU)(e.payload.type)})));const n={promotion_id:t.promoCode?t.promoCode:"",promotion_name:t.promoText?t.promoText:""};j.v.addToCart({user_id:k,page_language:(0,P.wq)(),email_address:(0,a.M3)()?U:"",login_status:k?w.y.LOGGED_IN:w.y.GUEST,website_section:(0,S.dI)(e.payload.type),subTotalPrice:I,currency:x,items:(0,_.QK)(t,x,(0,S.dI)(e.payload.type),t.quantity,n)})});var o}))}},response:M,translate:W,icon:!0,color:"PRIMARY",text:W("Add all Puratos ingredients")})]})}},71345(e,t,n){function o(){var e=this.constructor.getDerivedStateFromProps(this.props,this.state);null!==e&&void 0!==e&&this.setState(e)}function r(e){this.setState(function(t){var n=this.constructor.getDerivedStateFromProps(e,t);return null!==n&&void 0!==n?n:null}.bind(this))}function a(e,t){try{var n=this.props,o=this.state;this.props=e,this.state=t,this.__reactInternalSnapshotFlag=!0,this.__reactInternalSnapshot=this.getSnapshotBeforeUpdate(n,o)}finally{this.props=n,this.state=o}}function l(e){var t=e.prototype;if(!t||!t.isReactComponent)throw new Error("Can only polyfill class components");if("function"!==typeof e.getDerivedStateFromProps&&"function"!==typeof t.getSnapshotBeforeUpdate)return e;var n=null,l=null,i=null;if("function"===typeof t.componentWillMount?n="componentWillMount":"function"===typeof t.UNSAFE_componentWillMount&&(n="UNSAFE_componentWillMount"),"function"===typeof t.componentWillReceiveProps?l="componentWillReceiveProps":"function"===typeof t.UNSAFE_componentWillReceiveProps&&(l="UNSAFE_componentWillReceiveProps"),"function"===typeof t.componentWillUpdate?i="componentWillUpdate":"function"===typeof t.UNSAFE_componentWillUpdate&&(i="UNSAFE_componentWillUpdate"),null!==n||null!==l||null!==i){var s=e.displayName||e.name,c="function"===typeof e.getDerivedStateFromProps?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";throw Error("Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n"+s+" uses "+c+" but also contains the following legacy lifecycles:"+(null!==n?"\n  "+n:"")+(null!==l?"\n  "+l:"")+(null!==i?"\n  "+i:"")+"\n\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://fb.me/react-async-component-lifecycle-hooks")}if("function"===typeof e.getDerivedStateFromProps&&(t.componentWillMount=o,t.componentWillReceiveProps=r),"function"===typeof t.getSnapshotBeforeUpdate){if("function"!==typeof t.componentDidUpdate)throw new Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");t.componentWillUpdate=a;var p=t.componentDidUpdate;t.componentDidUpdate=function(e,t,n){var o=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:n;p.call(this,e,t,o)}}return e}
1n.r(t),n.d(t,{polyfill:()=>l}),o.__suppressDeprecationWarning=!0,r.__suppressDeprecationWarning=!0,a.__suppressDeprecationWarning=!0},9771(e){var t=function(){};e.exports=t}}]);
2//# sourceMappingURL=8204.8a79545f.chunk.js.map

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.