function e(e){let t=typeof e==`object`?e:JSON.parse(e),n=``;for(let e=0;e<t.length;e++){let r=``;for(let n in t[e])r!==``&&(r+=`,`),r+=t[e][n];n+=r+`\r
`}return n}function t(t,n){let r=e(JSON.stringify(t)),i=n+`.csv`||`export.csv`,a=new Blob([r],{type:`text/csv;charset=utf-8;`});if(navigator.msSaveBlob)navigator.msSaveBlob(a,i);else{let e=document.createElement(`a`);if(e.download!==void 0){let t=URL.createObjectURL(a);e.setAttribute(`href`,t),e.setAttribute(`download`,i),e.style.visibility=`hidden`,document.body.appendChild(e),e.click(),document.body.removeChild(e)}}}export{t};