(window.multistep_editor_jsonpFunction=window.multistep_editor_jsonpFunction||[]).push([[18],{929:function(t,e,i){"use strict";i.r(e),i.d(e,"AuWidgetCart",function(){return d}),i.d(e,"widget",function(){return d});var r=i(0),s=i(160),a=i(2);let d=class extends s.a{constructor(){super(...arguments),this._isCartWidgetInited=!1}updateParams(t){const e=this.driver.cart.price;if(this._isCartWidgetInited)for(let e=0;e<t.lineItems.length;e++){const i=t.lineItems[e];this.driver.cart.lineItems[e]._product=this.driver.products[i.productIndex],this.driver.cart.lineItems[e].quantity=!1===i.active?0:null===i.quantity||void 0===i.quantity?this.driver.cart.lineItems[e].quantity||1:i.quantity,this.driver.cart.lineItems[e].images=i.images||[],this.driver.cart.lineItems[e].downloadUrls=i.downloadUrls||[],this.driver.cart.lineItems[e].data=i.data||{},this.driver.cart.lineItems[e].logRequest=!0===i.logRequest||this.driver.settings.logRequest||!1,this.driver.cart.lineItems[e].useBackOffice=this.driver.cart.lineItems[e].useBackOffice||!0===i.useBackOffice||this.driver.settings.useBackOffice||!1,this.driver.cart.lineItems[e].props=i.props||{},this.driver.cart.lineItems[e].sku=i.sku||"",this.driver.cart.lineItems[e].customPrice=i.customPrice||0}else{let e=[];for(let i of t.lineItems){t.lineItems.indexOf(i);let r=Object.assign({},i);r.settings=this.driver.settings,r.product=this.driver.products[r.productIndex],delete r.productIndex,!1===i.active&&(r.quantity=0);let s=r;this.driver.cart.lineItems[0]&&this.driver.cart.lineItems[0].data&&this.driver.cart.lineItems[0].data.snapshot&&0===e.length&&(s.snapshot=this.driver.cart.lineItems[0].data.snapshot,void 0!=this.driver.cart.lineItems[0].cartItemKey&&""!=this.driver.cart.lineItems[0].cartItemKey&&(s.key=this.driver.cart.lineItems[0].cartItemKey));const a=this.driver.buildOrder(s);e.push(a)}this.driver.cart.lineItems=e,this._isCartWidgetInited=!0}this.emitChange({},!1),this.driver.cart.price!==e&&this.driver.cart.updatePrice(e)}};Object(r.a)([Object(a.c)(),Object(r.b)("design:type",Object)],d.prototype,"params",void 0),d=Object(r.a)([Object(a.a)("au-widget-cart")],d)}}]);