(window.multistep_editor_jsonpFunction=window.multistep_editor_jsonpFunction||[]).push([[45],{902:function(e,t){e.exports='<style>\n    :host {\n        width: 100%;\n        height: 100%;\n    }\n</style>\n\n<iframe id="frameID" width="100%" height="100%" style="border: none;"></iframe>'},944:function(e,t,r){"use strict";r.r(t),r.d(t,"AuWidgetPreviewMockupSlider",function(){return u}),r.d(t,"widget",function(){return u});var i=r(0),n=r(1),c=r(2),s=r(160),o=r(902),u=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(i.d)(t,e),t.prototype.exportWidgetData=function(e){return Object(i.b)(this,void 0,void 0,function(){return Object(i.e)(this,function(e){return[2,{previewResourceUrl:this.previewResourceUrl}]})})},t.prototype.restoreWidgetFromData=function(e,t){return Object(i.b)(this,void 0,void 0,function(){return Object(i.e)(this,function(t){return this.previewResourceUrl=e.previewResourceUrl,this.emitChange(),[2]})})},t.prototype.updateParams=function(e){this._initIFrame(e.productId,e.productVersionId,e.productVariantId,e.stateId,e.previewSize.width,e.previewSize.height)},t.prototype.createPreviewResource=function(){return Object(i.b)(this,void 0,void 0,function(){var e;return Object(i.e)(this,function(t){switch(t.label){case 0:return e=this,[4,this._element.createPreviewResource()];case 1:return e.previewResourceUrl=t.sent(),this.emitChange(),[2,this.previewResourceUrl]}})})},t.prototype._initIFrame=function(e,t,r,n,c,s){return Object(i.b)(this,void 0,void 0,function(){var o,u,a,d,h,l;return Object(i.e)(this,function(i){switch(i.label){case 0:return o=this.querySelectorShadow("#frameID"),u=o.contentWindow||o,0!==(a=o.contentDocument||u.document).head.innerHTML.length?[3,2]:[4,this.getScriptContent()];case 1:d=i.sent(),(h=a.createRange()).selectNode(a.head),l=h.createContextualFragment(d),a.head.appendChild(l),i.label=2;case 2:return 0!==a.body.innerHTML.length&&(a.body.innerHTML=""),this._element=a.createElement("au-preview-mockup-slider"),this._element.token=this.auWizard.driver.backOffice.token,this._element.assetStorageUrl=this.auWizard.driver.backOffice.assetStorageUrl,this._element.backOfficeUrl=this.auWizard.driver.backOffice.backOfficeUrl,this._element.designAtomsApiUrl=this.auWizard.driver.backOffice.designAtomsApiUrl,Number(e)&&(this._element.productId=Number(e)),Number(t)&&(this._element.productVersionId=Number(t)),Number(r)&&(this._element.productVariantId=Number(r)),this._element.tenantId=this.auWizard.driver.backOffice.tenantId,this._element.userId=this.auWizard.driver.user.id,this._element.stateId=n,Number(c)&&(this._element.previewWidth=Number(c)),Number(s)&&(this._element.previewHeight=Number(s)),a.body.appendChild(this._element),[2]}})})},t.prototype.getScriptContent=function(){return Object(i.b)(this,void 0,void 0,function(){var e,t,r=this;return Object(i.e)(this,function(c){switch(c.label){case 0:return e=function(){return Object(i.b)(r,void 0,void 0,function(){return Object(i.e)(this,function(e){switch(e.label){case 0:return[4,n.a.loadHtml(n.a.getPatchedUrl("static/preview-mockup-slider/previewMockupSlider.html?t="+Date.now()))];case 1:return[2,e.sent()]}})})},[4,function(){return Object(i.b)(r,void 0,void 0,function(){var e,t;return Object(i.e)(this,function(r){switch(r.label){case 0:if(e="",!this.driver.backOffice||0===this.driver.backOffice.tenantId)return[3,4];t=n.a.ensureEndsWith(this.driver.backOffice.backOfficeUrl,"/")+"assets/preview-mockup-slider/dist/previewMockupSlider.html?t="+Date.now(),r.label=1;case 1:return r.trys.push([1,3,,4]),[4,n.a.loadHtml(t)];case 2:return e=r.sent(),[3,4];case 3:return r.sent(),console.warn("Failed to load PreviewMockupSlider scripts from backend ".concat(t)),[3,4];case 4:return[2,e]}})})}()];case 1:return""!==(t=c.sent())?[3,3]:[4,e()];case 2:t=c.sent(),c.label=3;case 3:return[2,t]}})})},Object(i.c)([Object(c.c)(),Object(i.g)("design:type",String)],t.prototype,"previewResourceUrl",void 0),t=Object(i.c)([Object(c.a)("au-widget-preview-mockup-slider",o)],t)}(s.c)}}]);