(window.multistep_editor_jsonpFunction=window.multistep_editor_jsonpFunction||[]).push([[43],{906:function(t,e){t.exports='<style>\n    .content {\n        display: flex;\n        flex-direction: column;\n        height: 100%;\n    }\n\n    .content au-widget {\n        margin-bottom: var(--group-padding-content-bottom, 30px);\n        height: var(--au-widget-height, auto);\n        width: var(--au-width, 100%);\n    }\n</style>\n\n<div class="content">\n    <dom-repeat items="{{options}}" id="repeater">\n        <template>\n            <au-widget name="{{item.name}}" language="{{language}}" driver="{{driver}}"\n                definition="{{item}}"></au-widget>\n        </template>\n    </dom-repeat>\n</div>\n\n'},957:function(t,e,i){"use strict";i.r(e),i.d(e,"AuWidgetPimOptions",function(){return d}),i.d(e,"widget",function(){return d});var s=i(0),n=i(2),o=i(1),a=i(14),p=i(430),l=i(160),r=i(906);let d=class extends l.b{constructor(){super(...arguments),this.options=[],this._optionsWidgets=[],this._optionsNames=[],this._optionsAreLoaded=!1}get _(){if(this._optionsWidgets.length>0){let t={};return this._optionsWidgets.forEach(e=>{var i;e.element.isActive&&(Array.isArray(e._)?(t[e._[0].id]=[],e._.forEach(e=>{var i;t[e.id].push(null===(i=e.optionValue)||void 0===i?void 0:i.id)})):t[e._.id]=null===(i=e._.optionValue)||void 0===i?void 0:i.id)}),t}return[]}checkOptionsLoading(){this._optionsAreLoaded||0===this.options.length||this.options.length!==this._optionsWidgets.length||(this._optionsAreLoaded=!0,this._onReadyFunction&&this._onReadyFunction())}get summary(){return this._optionsWidgets.length>0?this._optionsWidgets.map(t=>new class{constructor(t){Array.isArray(t)?(this.name=t[0].title,this.value=t.map(t=>t.optionValue.title),this.visible=t[0].visible):(this.name=t.title,this.value=t.optionValue.title,this.visible=t.visible)}}(t._)):[]}updateParams(t){if(!t)return;if(t.options.length<1)return;let e=[];if(t.onReady&&(this._onReadyFunction=o.a.functionWrapperConstructor(t.onReady)),t.options.length>0){let i=new Map;t.modifiers&&t.modifiers.length>0&&t.modifiers.forEach(t=>i.set(t.name,{subType:t.subType,type:t.type,visible:t.visible,preselectedValue:t.preselectedValue,title:t.title,description:t.description,prompt:t.prompt})),t.options.forEach(s=>{let n=[...t.options];const o=i.has(s.title);let a=o?i.get(s.title).visible:void 0,p=a;const l=1===s.values.length,r=o&&i.get(s.title).preselectedValue;l&&(p=!1!==a,a=!!a),r&&!l&&(n=n.map(t=>Object.assign(Object.assign({},t),{values:t.values.map(t=>Object.assign(Object.assign({},t),{preselected:!(r!==t.title&&(null===r||void 0===r||!r.includes(t.title)))}))})));const d=new class{constructor(t,e){var i;this.title=null!==(i=t.title)&&void 0!==i?i:e.name,this.description=t.description,this.prompt=t.prompt,this.name=e.name,this.type="pim-option-selector",this.params={name:e.name,options:e.options,type:e.type,subType:e.subType,visible:e.visible,active:e.active}}}({title:i.has(s.title)?i.get(s.title).title:null,description:i.has(s.title)?i.get(s.title).description:"",prompt:i.has(s.title)?i.get(s.title).prompt:""},{name:s.title,options:n,visible:null===a||void 0===a||a,active:p,type:i.has(s.title)?i.get(s.title).type:null,subType:i.has(s.title)?i.get(s.title).subType:null});e.push(d)})}this.options=e,this._optionsNames=this.options.map(t=>t.name)}async updateParamsAsync(t){await super.updateParamsAsync(t)}async connectedCallback(){super.connectedCallback(),this._optionSubscription=this.observe(a.a.PIM_OPTIONS_READY).subscribe(t=>this.emitChange()),this._subscription=this.observe(a.a.WIDGET_CHANGE).pipe(Object(p.a)(t=>this._optionsNames.indexOf(t.name)>=0&&!!t.sender._)).subscribe(t=>{this._updateWidgets(t),this.checkOptionsLoading()})}async _updateWidgets(t){this._optionsWidgets.length>0?(this._optionsWidgets=this._optionsWidgets.filter(e=>e.name!==t.sender.name),this._optionsWidgets.push(t.sender)):this._optionsWidgets.push(t.sender)}disconnectedCallback(){super.disconnectedCallback(),this._subscription.unsubscribe(),this._optionSubscription.unsubscribe()}clearSelection(){}};Object(s.a)([Object(n.c)(),Object(s.b)("design:type",Object)],d.prototype,"options",void 0),Object(s.a)([Object(n.c)(),Object(s.b)("design:type",Object),Object(s.b)("design:paramtypes",[])],d.prototype,"_",null),d=Object(s.a)([Object(n.a)("au-widget-pim-options",r)],d)}}]);