(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 n}),i.d(e,"widget",function(){return n});var r=i(0),s=i(160),a=i(2),n=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._isCartWidgetInited=!1,e}return Object(r.d)(e,t),e.prototype.updateParams=function(t){var e,i,s=this.driver.cart.price;if(this._isCartWidgetInited)for(var a=0;a<t.lineItems.length;a++){var n=t.lineItems[a];this.driver.cart.lineItems[a]._product=this.driver.products[n.productIndex],this.driver.cart.lineItems[a].quantity=!1===n.active?0:null===n.quantity||void 0===n.quantity?this.driver.cart.lineItems[a].quantity||1:n.quantity,this.driver.cart.lineItems[a].images=n.images||[],this.driver.cart.lineItems[a].downloadUrls=n.downloadUrls||[],this.driver.cart.lineItems[a].data=n.data||{},this.driver.cart.lineItems[a].logRequest=!0===n.logRequest||this.driver.settings.logRequest||!1,this.driver.cart.lineItems[a].useBackOffice=this.driver.cart.lineItems[a].useBackOffice||!0===n.useBackOffice||this.driver.settings.useBackOffice||!1,this.driver.cart.lineItems[a].props=n.props||{},this.driver.cart.lineItems[a].sku=n.sku||"",this.driver.cart.lineItems[a].customPrice=n.customPrice||0}else{var d=[];try{for(var c=Object(r.k)(t.lineItems),l=c.next();!l.done;l=c.next()){var u=l.value,o=(t.lineItems.indexOf(u),Object.assign({},u));o.settings=this.driver.settings,o.product=this.driver.products[o.productIndex],delete o.productIndex,!1===u.active&&(o.quantity=0);var v=o;this.driver.cart.lineItems[0]&&this.driver.cart.lineItems[0].data&&this.driver.cart.lineItems[0].data.snapshot&&0===d.length&&(v.snapshot=this.driver.cart.lineItems[0].data.snapshot,void 0!=this.driver.cart.lineItems[0].cartItemKey&&""!=this.driver.cart.lineItems[0].cartItemKey&&(v.key=this.driver.cart.lineItems[0].cartItemKey));var h=this.driver.buildOrder(v);d.push(h)}}catch(t){e={error:t}}finally{try{l&&!l.done&&(i=c.return)&&i.call(c)}finally{if(e)throw e.error}}this.driver.cart.lineItems=d,this._isCartWidgetInited=!0}this.emitChange({},!1),this.driver.cart.price!==s&&this.driver.cart.updatePrice(s)},Object(r.c)([Object(a.c)(),Object(r.g)("design:type",Object)],e.prototype,"params",void 0),e=Object(r.c)([Object(a.a)("au-widget-cart")],e)}(s.a)}}]);