"use strict";(globalThis.webpackChunk_jbrowse_web=globalThis.webpackChunk_jbrowse_web||[]).push([[8859],{78859:(e,n,s)=>{s.r(n),s.d(n,{default:()=>v});var r=s(7552),a=s(67112),l=s(99546),t=s(44928),i=s(61282),o=s(93062),c=s(76218),h=s(10240),d=s(7946),u=s(22762),j=s(30698),m=s(69092),x=s(69500);function g(){return(0,x.jsxs)("div",{children:[(0,x.jsx)(t.A,{size:20,style:{marginRight:20}}),(0,x.jsx)(i.A,{display:"inline",children:"Creating SVG"})]})}function b({children:e,...n}){return(0,x.jsx)("div",{children:(0,x.jsx)(o.A,{...n,children:e})})}function f(e,n){return(0,l.useLocalStorage)(`svg-${e}`,n)}function v({model:e,handleClose:n}){const s=(0,l.getSession)(e),t="undefined"!=typeof OffscreenCanvas,[o,v]=(0,r.useState)(t),[p,y]=(0,r.useState)(!1),[C,A]=(0,r.useState)(),[w,S]=f("file","jbrowse.svg"),[k,T]=f("theme",s.themeName||"default");return(0,x.jsxs)(a.Dialog,{open:!0,onClose:n,title:"Export SVG",children:[(0,x.jsxs)(c.A,{children:[C?(0,x.jsx)(a.ErrorMessage,{error:C}):p?(0,x.jsx)(g,{}):null,(0,x.jsx)(b,{helperText:"filename",value:w,onChange:e=>{S(e.target.value)}}),s.allThemes?(0,x.jsx)(b,{select:!0,label:"Theme",value:k,onChange:e=>{T(e.target.value)},children:Object.entries(s.allThemes()).map((([e,n])=>(0,x.jsx)(h.A,{value:e,children:n.name||"(Unknown name)"},e)))}):null,t?(0,x.jsx)(d.A,{control:(0,x.jsx)(u.A,{checked:o,onChange:()=>{v((e=>!e))}}),label:"Rasterize canvas based tracks? File may be much larger if this is turned off"}):(0,x.jsx)(i.A,{children:"Note: rasterizing layers not yet supported in this browser, so SVG size may be large"})]}),(0,x.jsxs)(j.A,{children:[(0,x.jsx)(m.A,{variant:"contained",color:"secondary",onClick:()=>{n()},children:"Cancel"}),(0,x.jsx)(m.A,{variant:"contained",color:"primary",type:"submit",onClick:async()=>{y(!0),A(void 0);try{await e.exportSvg({rasterizeLayers:o,filename:w,themeName:k}),n()}catch(e){console.error(e),A(e)}finally{y(!1)}},children:"Submit"})]})]})}}}]);
//# sourceMappingURL=8859.3c04aa40.chunk.js.map