"use strict";(self.webpackChunkdami=self.webpackChunkdami||[]).push([[9950],{99950:(a,e,t)=>{t.r(e),t.d(e,{dataMapping:()=>o,default:()=>c});var n=t(31528),r=t.n(n),i=t(31263);function s(a,e){const t={};return e.forEach((e=>{if(!r().has(a,e.name))return;const n=r().get(a,e.name);e.destinations.forEach((({name:a})=>{r().set(t,a,n)}))})),t}async function o({id:a,data:e}){let t=null;if("table"===e.dataSource)t=this.engine.referenceData.table;else if("variable"===e.dataSource){const{variables:a}=this.engine.referenceData;if(!(0,i.aX)(a,e.varSourceName))throw new Error(`Cant find "${e.varSourceName}" variable`);t=a[e.varSourceName]}if(!(0,i.Kn)(t)&&!Array.isArray(t)){throw new Error(`Can't map data with "${null===t?"null":typeof t}" data type`)}return t=(0,i.Kn)(t)?s(t,e.sources):t.map((a=>s(a,e.sources))),e.assignVariable&&this.setVariable(e.variableName,t),e.saveData&&this.addDataToColumn(e.dataColumn,t),{data:t,nextBlockId:this.getBlockConnections(a)}}const c=o}}]);