(window.multistep_editor_jsonpFunction=window.multistep_editor_jsonpFunction||[]).push([[48],{958:function(e,t,a){"use strict";a.r(t),a.d(t,"AuWidgetSteps",function(){return c}),a.d(t,"widget",function(){return c});var s,i=a(0),n=a(2),d=a(160),o=a(1);!function(e){e[e.previous=0]="previous",e[e.visited=1]="visited",e[e.all=2]="all"}(s||(s={}));var p=a(15),r=a(46),l=a(76);let c=class extends d.a{connectedCallback(){super.connectedCallback(),this.stepSubscription=this.observe(p.a.STEP_CHANGED).subscribe(e=>this._stepChangeCallback(e))}async _stepChangeCallback(e){const t=e.data.step;if(o.a.isNotNullOrUndefined(this.params)&&o.a.isNotNullOrUndefined(this.params.availabilityMode)){switch(s[this.params.availabilityMode.toString()]){case s.previous:await this.stepsManager.handleModePrevious(t);break;case s.visited:await this.stepsManager.handleModeVisited(t);break;case s.all:}this.updateParams(this.params)}}updateParams(e){e.steps&&this.changeStepState(e.steps)}async changeStepState(e){const t=this.stepsManager.steps;for(const[a,s]of Object.entries(e))await this._applyConfig(t,a,s);this.stepsManager.update()}async _applyConfig(e,t,a){const s=o.a.isNum(t)?e[Number(t)]:e.find(e=>e.title===t||e.name===t);if(s){const t=e.indexOf(s);o.a.isNotNullOrUndefined(a.enabled)&&this.stepsManager.toggleDisable(t,!a.enabled,!1),o.a.isNotNullOrUndefined(a.disabled)&&this.stepsManager.toggleDisable(t,a.disabled,!1),o.a.isNotNullOrUndefined(a.hidden)&&this.stepsManager.toggleHidden(t,a.hidden,!1)}}};Object(i.a)([Object(r.b)("StepsManager"),Object(i.b)("design:type",l.a)],c.prototype,"stepsManager",void 0),Object(i.a)([Object(n.c)(),Object(i.b)("design:type",Object)],c.prototype,"params",void 0),c=Object(i.a)([Object(n.a)("au-widget-steps")],c)}}]);