"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),n=require("react"),i=require("semantic-ui-react");n.forwardRef((d,a)=>t.jsx("div",{id:"divIdToPrint",ref:a,children:d.children}));const m=d=>{n.useRef();const[a,l]=n.useState(!1),{childContent:b,"data-height":w,"data-button-label":c="Download PDF","data-file-label":r,"data-url":s,editing:u}=d,h=()=>{l(!0),fetch("/pdf/"+s).then(o=>o.blob()).then(o=>{const f=window.URL.createObjectURL(o),e=document.createElement("a");e.href=f,e.download=r,document.body.appendChild(e),e.click(),l(!1),e.remove()})};return t.jsx(i.Container,{className:`viz download ${u?"editing":""}`,fluid:!0,children:t.jsx(n.Fragment,{children:t.jsx("div",{className:"downloadPdf",children:t.jsx(i.Button,{loading:a,className:"download",onClick:h,children:c})})})})};exports.default=m;
