import{h}from"./index-ecdfb761.js";var __rest=undefined&&undefined.__rest||function(e,n){var t={};for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)&&n.indexOf(a)<0)t[a]=e[a];if(e!=null&&typeof Object.getOwnPropertySymbols==="function")for(var r=0,a=Object.getOwnPropertySymbols(e);r<a.length;r++){if(n.indexOf(a[r])<0&&Object.prototype.propertyIsEnumerable.call(e,a[r]))t[a[r]]=e[a[r]]}return t};function getWrappedValue(e,n){if(!e.includes(".")){return n[e]}var t=n;e.split(".").forEach((function(e){if(!t){return}t=t[e]}));return t}function mapFields(e){if(e===void 0){e={}}var n=e.conversionConfig,t=__rest(e,["conversionConfig"]);return convertValues(n,t)}function convertValues(e,n){if(!e){return n}Object.keys(e).forEach((function(t){var a=e[t]||t;n[a]=getWrappedValue(t,n)}));return n}var generateActionComponent=function(e,n,t,a,r,i){var o;var c=r.data,u=r.ui;if(u.componentTag){var l=u.componentTag;return h(l,{index:e,item:t,data:c})}if(i===null||i===void 0?void 0:i.simpleLink){return h("a",{href:"#",class:(o={},o[u.tint]=true,o),onClick:function(){return a.emit(generateActionEmitData(n,t,c,u.name))}},u.label)}var s=u.buttonType||"button";var f=u.scale||"medium";var v=u.shape||(u.buttonType==="icon-button"?"circle":"rectangular");var d=u.tint||"primary";var p=u.view||"solid";var m=u.buttonType==="icon-button"?u.label:undefined;var b=u.buttonType==="icon-button"?undefined:u.label;var g=s==="button"?"dvn-button":"dvn-icon-button";return h(g,{abbrTitle:m,key:u.name,scale:f,shape:v,tint:d,view:p,iconName:u.iconName,onClick:function(){return a.emit(generateActionEmitData(n,t,c,u.name))},leaned:i?i.leaned:undefined},b)};var generateActionEmitData=function(e,n,t,a){var r=mapFields(Object.assign(Object.assign(Object.assign({},(t===null||t===void 0?void 0:t.params)||{}),e),{item:n}));return Object.assign(Object.assign({},t),{name:a||t.name,params:r})};export{generateActionEmitData as a,convertValues as c,generateActionComponent as g};