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