"use strict";(self.webpackChunk_jbrowse_web=self.webpackChunk_jbrowse_web||[]).push([[555],{70555:(e,a,l)=>{l.r(a),l.d(a,{default:()=>g});var n=l(41867),s=l(93764),r=l(51590),t=l(47409),i=l(49133),o=l(59231),c=l(96614),u=l(83171),h=l(27768),d=l(23801),j=l(35421),f=l(90872),x=l(80838);function v(){return(0,x.jsxs)("div",{children:[(0,x.jsx)(s.Z,{size:20,style:{marginRight:20}}),(0,x.jsx)(r.Z,{display:"inline",children:"Creating SVG"})]})}function b(e,a){return(0,f.useLocalStorage)("svg-"+e,a)}function g(e){let{model:a,handleClose:l}=e;const s=(0,f.getSession)(a),g="undefined"!==typeof OffscreenCanvas,[m,y]=(0,n.useState)(g),[Z,p]=(0,n.useState)(!1),[C,k]=b("file","jbrowse.svg"),[w,S]=b("tracklabels","offset"),[z,T]=b("theme",s.themeName||"default"),[L,N]=(0,n.useState)();return(0,x.jsxs)(j.Dialog,{open:!0,onClose:l,title:"Export SVG",children:[(0,x.jsxs)(t.Z,{children:[L?(0,x.jsx)(j.ErrorMessage,{error:L}):Z?(0,x.jsx)(v,{}):null,(0,x.jsx)(i.Z,{helperText:"filename",value:C,onChange:e=>k(e.target.value)}),(0,x.jsx)("br",{}),(0,x.jsxs)(i.Z,{select:!0,label:"Track label positioning",variant:"outlined",value:w,style:{width:150},onChange:e=>S(e.target.value),children:[(0,x.jsx)(o.Z,{value:"offset",children:"Offset"}),(0,x.jsx)(o.Z,{value:"overlay",children:"Overlay"}),(0,x.jsx)(o.Z,{value:"left",children:"Left"}),(0,x.jsx)(o.Z,{value:"none",children:"None"})]}),(0,x.jsx)("br",{}),s.allThemes?(0,x.jsx)(i.Z,{select:!0,label:"Theme",variant:"outlined",value:z,onChange:e=>T(e.target.value),children:Object.entries(s.allThemes()).map((e=>{let[a,l]=e;return(0,x.jsx)(o.Z,{value:a,children:l.name||"(Unknown name)"},a)}))}):null,g?(0,x.jsx)(c.Z,{control:(0,x.jsx)(u.Z,{checked:m,onChange:()=>y((e=>!e))}),label:"Rasterize canvas based tracks? File may be much larger if this is turned off"}):(0,x.jsx)(r.Z,{children:"Note: rasterizing layers not yet supported in this browser, so SVG size may be large"})]}),(0,x.jsxs)(h.Z,{children:[(0,x.jsx)(d.Z,{variant:"contained",color:"secondary",onClick:()=>l(),children:"Cancel"}),(0,x.jsx)(d.Z,{variant:"contained",color:"primary",type:"submit",onClick:async()=>{p(!0),N(void 0);try{await a.exportSvg({rasterizeLayers:m,filename:C,themeName:z,trackLabels:w}),l()}catch(e){console.error(e),N(e)}finally{p(!1)}},children:"Submit"})]})]})}}}]);
//# sourceMappingURL=555.91a78897.chunk.js.map