"use strict";(self.webpackChunk_jbrowse_web=self.webpackChunk_jbrowse_web||[]).push([[7961],{87961:function(e,n,r){r.r(n),r.d(n,{default:function(){return p}});var t=r(32723),a=r(34795),s=r(96234),l=r(96902),i=r(78888),o=r(35388),c=r(52809),u=r(66519),h=r(15996),f=r(80367),d=r(32114),v=r(99688),x=r(44536),j=r(17867),Z=r(27664),b=r(29938);function m(){return(0,b.jsxs)("div",{children:[(0,b.jsx)(i.Z,{size:20,style:{marginRight:20}}),(0,b.jsx)(o.Z,{display:"inline",children:"Creating SVG"})]})}function g(e,n){return(0,Z.useLocalStorage)("svg-"+e,n)}function p(e){var n=e.model,r=e.handleClose,i=(0,Z.getSession)(n),p="undefined"!==typeof OffscreenCanvas,k=(0,l.useState)(p),y=(0,s.Z)(k,2),C=y[0],w=y[1],S=(0,l.useState)(!1),z=(0,s.Z)(S,2),T=z[0],L=z[1],N=g("file","jbrowse.svg"),O=(0,s.Z)(N,2),_=O[0],G=O[1],V=g("tracklabels","offset"),E=(0,s.Z)(V,2),R=E[0],D=E[1],F=g("theme",i.themeName||"default"),M=(0,s.Z)(F,2),U=M[0],q=M[1],A=(0,l.useState)(),B=(0,s.Z)(A,2),H=B[0],I=B[1];return(0,b.jsxs)(j.Dialog,{open:!0,onClose:r,title:"Export SVG",children:[(0,b.jsxs)(c.Z,{children:[H?(0,b.jsx)(j.ErrorMessage,{error:H}):T?(0,b.jsx)(m,{}):null,(0,b.jsx)(u.Z,{helperText:"filename",value:_,onChange:function(e){return G(e.target.value)}}),(0,b.jsx)("br",{}),(0,b.jsxs)(u.Z,{select:!0,label:"Track label positioning",variant:"outlined",value:R,style:{width:150},onChange:function(e){return D(e.target.value)},children:[(0,b.jsx)(h.Z,{value:"offset",children:"Offset"}),(0,b.jsx)(h.Z,{value:"overlay",children:"Overlay"}),(0,b.jsx)(h.Z,{value:"left",children:"Left"}),(0,b.jsx)(h.Z,{value:"none",children:"None"})]}),(0,b.jsx)("br",{}),i.allThemes?(0,b.jsx)(u.Z,{select:!0,label:"Theme",variant:"outlined",value:U,onChange:function(e){return q(e.target.value)},children:Object.entries(i.allThemes()).map((function(e){var n=(0,s.Z)(e,2),r=n[0],t=n[1];return(0,b.jsx)(h.Z,{value:r,children:t.name||"(Unknown name)"},r)}))}):null,p?(0,b.jsx)(f.Z,{control:(0,b.jsx)(d.Z,{checked:C,onChange:function(){return w((function(e){return!e}))}}),label:"Rasterize canvas based tracks? File may be much larger if this is turned off"}):(0,b.jsx)(o.Z,{children:"Note: rasterizing layers not yet supported in this browser, so SVG size may be large"})]}),(0,b.jsxs)(v.Z,{children:[(0,b.jsx)(x.Z,{variant:"contained",color:"secondary",onClick:function(){return r()},children:"Cancel"}),(0,b.jsx)(x.Z,{variant:"contained",color:"primary",type:"submit",onClick:(0,a.Z)((0,t.Z)().mark((function e(){return(0,t.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return L(!0),I(void 0),e.prev=2,e.next=5,n.exportSvg({rasterizeLayers:C,filename:_,themeName:U,trackLabels:R});case 5:r(),e.next=12;break;case 8:e.prev=8,e.t0=e.catch(2),console.error(e.t0),I(e.t0);case 12:return e.prev=12,L(!1),e.finish(12);case 15:case"end":return e.stop()}}),e,null,[[2,8,12,15]])}))),children:"Submit"})]})]})}}}]);
//# sourceMappingURL=7961.ea590353.chunk.js.map