(window.multistep_editor_jsonpFunction=window.multistep_editor_jsonpFunction||[]).push([[36],{965:function(e,t,r){"use strict";r.r(t),r.d(t,"AuWidgetMockup3DViewer",function(){return p}),r.d(t,"widget",function(){return p});var i,n=r(0),o=r(911),a=r(2),s=r(762),u=r(1),c=r(761),l=r(577),d=function(){return function(e,t,r,n){this.preloader=!0,this.axesHelperEnabled=!1,this.orbitsControlEnabled=!0,this.container=e,this.onLoadCallback=n,this.backgroundColor=t.backgroundColor||l.a,this.orbitsControl=t.orbitsControl,this.distance=t.distance,this.camera=t.cameraButtons,this.pauseAtEnd=t.pauseAtEnd,this.preloader=t.preloader,this.modelType=null!=t.modelType?t.modelType:i.default,this.items=t.items.map(function(e,t){var i=Object.assign({},e);return i.model=r[t],i})}}();!function(e){e.default="default",e.blender="blender"}(i||(i={}));var p=function(e){function t(){var t=e.call(this)||this;return t._DAMockupsApiClientConfig=t._createProductApiClientConfig(),t._DAMockupsApi=new o.b(t._DAMockupsApiClientConfig,t.designAtomsApiUrl),t}return Object(n.d)(t,e),t.prototype._createProductApiClientConfig=function(){var e=new o.a;return e.apiUrl=this.backOfficeUrl,e.setAuthorizationToken(this.token),e},Object.defineProperty(t.prototype,"backOfficeUrl",{get:function(){return u.a.removeTrailingSlash(this.auWizard.driver.backOffice.backOfficeUrl)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"designAtomsApiUrl",{get:function(){return u.a.removeTrailingSlash(this.auWizard.driver.backOffice.designAtomsApiUrl)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tenantId",{get:function(){return this.auWizard.driver.backOffice.tenantId},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"token",{get:function(){return this.auWizard.driver.backOffice.token},enumerable:!1,configurable:!0}),t.prototype.updateParams=function(e){var t;return Object(n.b)(this,void 0,void 0,function(){var r,i,o,a,s,c,l,p,f,m,h,b,g,y,w=this;return Object(n.e)(this,function(A){switch(A.label){case 0:if(u.a.isEmptyArray(e.items))return[2];if(r=e.items.some(function(e){return 0===e.images.filter(function(e){return e}).length}),i=e.items.some(function(e){return u.a.isEmptyString(e.model)}),r||i)return[2];this.origamiViewer=null,this.speed=null!==(t=e.animationSpeed)&&void 0!==t?t:this.speed,this._preloaderLockingSum=0,this.showPreloader(!0),o=this.querySelectorShadow("#divContainer"),a=function(){w.showPreloader(!1),w.SetAnimationSpeed(w.speed),w.PlayAnimation(),setTimeout(function(){w.image=w.origamiViewer.renderer.domElement.toDataURL(),w.emitChange({image:w.image})},1500)},s=[],A.label=1;case 1:A.trys.push([1,6,7,8]),c=Object(n.k)(e.items),l=c.next(),A.label=2;case 2:return l.done?[3,5]:(p=l.value,m=(f=s).push,[4,this._getTextModel(p.model)]);case 3:m.apply(f,[A.sent()]),A.label=4;case 4:return l=c.next(),[3,2];case 5:return[3,8];case 6:return h=A.sent(),g={error:h},[3,8];case 7:try{l&&!l.done&&(y=c.return)&&y.call(c)}finally{if(g)throw g.error}return[7];case 8:return b=new d(o,e,s,a),this.origamiViewer=new window.Aurigma.Origami.Viewer(b,!0),setTimeout(function(){return w.applyInterfaceParams(e)},250),[2]}})})},t.prototype._getTextModel=function(e){return Object(n.b)(this,void 0,void 0,function(){return Object(n.e)(this,function(t){switch(t.label){case 0:return[4,this._DAMockupsApi.getGeometryFile(e,this.tenantId)];case 1:return[4,t.sent().data.text()];case 2:return[2,t.sent()]}})})},t=Object(n.c)([Object(a.a)("au-widget-mockup-3d-viewer",c),Object(n.g)("design:paramtypes",[])],t)}(s.a)}}]);