mirror of
https://github.com/lana-k/sqliteviz.git
synced 2025-12-06 18:18:53 +08:00
2 lines
40 KiB
JavaScript
2 lines
40 KiB
JavaScript
(function(e){function t(t){for(var s,r,o=t[0],c=t[1],l=t[2],d=0,h=[];d<o.length;d++)r=o[d],Object.prototype.hasOwnProperty.call(i,r)&&i[r]&&h.push(i[r][0]),i[r]=0;for(s in c)Object.prototype.hasOwnProperty.call(c,s)&&(e[s]=c[s]);u&&u(t);while(h.length)h.shift()();return a.push.apply(a,l||[]),n()}function n(){for(var e,t=0;t<a.length;t++){for(var n=a[t],s=!0,o=1;o<n.length;o++){var c=n[o];0!==i[c]&&(s=!1)}s&&(a.splice(t--,1),e=r(r.s=n[0]))}return e}var s={},i={app:0},a=[];function r(t){if(s[t])return s[t].exports;var n=s[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,r),n.l=!0,n.exports}r.m=e,r.c=s,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var s in e)r.d(n,s,function(t){return e[t]}.bind(null,s));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="";var o=window["webpackJsonp"]=window["webpackJsonp"]||[],c=o.push.bind(o);o.push=t,o=o.slice();for(var l=0;l<o.length;l++)t(o[l]);var u=c;a.push([0,"chunk-vendors"]),n()})({0:function(e,t,n){e.exports=n("56d7")},"017d":function(e,t,n){},"02dd":function(e,t,n){},"034f":function(e,t,n){"use strict";var s=n("85ec"),i=n.n(s);i.a},"048e":function(e,t,n){},"096b":function(e,t,n){"use strict";var s=n("73e1"),i=n.n(s);i.a},"0ca3":function(e,t,n){e.exports=n.p+"img/chevron.47c36bae.svg"},1276:function(e,t,n){"use strict";var s=n("4b31"),i=n.n(s);i.a},"1dd6":function(e,t,n){},"2c34":function(e,t,n){},"33da":function(e,t,n){},"3c5c":function(e,t,n){"use strict";var s=n("b344"),i=n.n(s);i.a},"3e43":function(e,t,n){"use strict";var s=n("5d2b"),i=n.n(s);i.a},4219:function(e,t,n){"use strict";var s=n("9a9d"),i=n.n(s);i.a},"44ed":function(e,t,n){"use strict";var s=n("51c0"),i=n.n(s);i.a},4531:function(e,t,n){},"47b0":function(e,t,n){"use strict";var s=n("d2c9"),i=n.n(s);i.a},"4b31":function(e,t,n){},5187:function(e,t,n){},"51c0":function(e,t,n){},"52c7":function(e,t,n){"use strict";var s=n("048e"),i=n.n(s);i.a},5384:function(e,t,n){"use strict";var s=n("ea6d"),i=n.n(s);i.a},"56d7":function(e,t,n){"use strict";n.r(t);n("e260"),n("e6cf"),n("cca6"),n("a79d");var s=n("2b0e"),i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{attrs:{id:"app"}},[n("router-view")],1)},a=[],r=(n("034f"),n("2877")),o={},c=Object(r["a"])(o,i,a,!1,null,null,null),l=c.exports,u=n("8c4f"),d=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("splitpanes",{staticClass:"schema-tabs-splitter",attrs:{before:{size:20,max:30},after:{size:80,max:100}}},[n("div",{attrs:{slot:"left-pane"},slot:"left-pane"},[n("schema")],1),n("div",{attrs:{slot:"right-pane"},slot:"right-pane"},[n("tabs")],1)])],1)},h=[],f=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{ref:"container",class:["splitpanes","splitpanes--"+(e.horizontal?"horizontal":"vertical"),{"splitpanes--dragging":e.touch.dragging}]},[n("div",{ref:"left",staticClass:"splitpanes__pane",style:e.styles[0],attrs:{size:e.paneBefore.size,"max-size":"30"}},[e._t("left-pane")],2),n("splitter",{attrs:{expanded:0!==e.paneBefore.size},on:{mousedown:e.onMouseDown,toggle:e.toggleFirstPane}}),n("div",{ref:"right",staticClass:"splitpanes__pane",style:e.styles[1]},[e._t("right-pane")],2)],1)},m=[],v=n("ade3"),p=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"splitpanes__splitter",on:{mousedown:function(t){return e.$emit("mousedown")},touchstart:function(t){return e.$emit("mousedown")}}},[s("div",{staticClass:"toggle-btn",on:{click:function(t){return e.$emit("toggle")}}},[s("img",{staticClass:"direction-icon",style:e.directionIconStyle,attrs:{src:n("0ca3")}})])])},b=[],g={name:"splitter",props:["expanded"],computed:{directionIconStyle:function(){var e="translate(-50%, -50%)";return this.$parent.horizontal?{transform:"".concat(e," ").concat(this.expanded?"rotate(-90deg)":"rotate(90deg)")}:{transform:"".concat(e," ").concat(this.expanded?"rotate(180deg)":"")}}}},w=g,x=(n("3e43"),Object(r["a"])(w,p,b,!1,null,null,null)),y=x.exports,C={name:"splitpanes",components:{Splitter:y},props:{horizontal:{type:Boolean,default:!1},before:{type:Object},after:{type:Object}},data:function(){return{container:null,paneBefore:null,paneAfter:null,beforeMinimising:20,touch:{mouseDown:!1,dragging:!1}}},computed:{styles:function(){return[Object(v["a"])({},this.horizontal?"height":"width","".concat(this.paneBefore.size,"%")),Object(v["a"])({},this.horizontal?"height":"width","".concat(this.paneAfter.size,"%"))]}},methods:{bindEvents:function(){document.addEventListener("mousemove",this.onMouseMove,{passive:!1}),document.addEventListener("mouseup",this.onMouseUp),"ontouchstart"in window&&(document.addEventListener("touchmove",this.onMouseMove,{passive:!1}),document.addEventListener("touchend",this.onMouseUp))},unbindEvents:function(){document.removeEventListener("mousemove",this.onMouseMove,{passive:!1}),document.removeEventListener("mouseup",this.onMouseUp),"ontouchstart"in window&&(document.removeEventListener("touchmove",this.onMouseMove,{passive:!1}),document.removeEventListener("touchend",this.onMouseUp))},onMouseDown:function(){this.bindEvents(),this.touch.mouseDown=!0},onMouseMove:function(e){this.touch.mouseDown&&(e.preventDefault(),this.touch.dragging=!0,this.calculatePanesSize(this.getCurrentMouseDrag(e)))},onMouseUp:function(){var e=this;this.touch.mouseDown=!1,setTimeout((function(){e.touch.dragging=!1,e.unbindEvents()}),100)},getCurrentMouseDrag:function(e){var t=this.container.getBoundingClientRect(),n="ontouchstart"in window&&e.touches?e.touches[0]:e,s=n.clientX,i=n.clientY;return{x:s-t.left,y:i-t.top}},getCurrentDragPercentage:function(e){e=e[this.horizontal?"y":"x"];var t=this.container[this.horizontal?"clientHeight":"clientWidth"];return 100*e/t},calculatePanesSize:function(e){var t=this.getCurrentDragPercentage(e),n=this.paneBefore,s=this.paneAfter,i=n.max<100&&t>=n.max,a=s.max<100&&t<=100-s.max;i||a?i?(n.size=n.max,s.size=Math.max(100-n.max,0)):(n.size=Math.max(100-s.max,0),s.size=s.max):(n.size=Math.min(Math.max(t,0),n.max),s.size=Math.min(Math.max(100-t,0),s.max))},toggleFirstPane:function(){this.paneBefore.size>0?(this.beforeMinimising=this.paneBefore.size,this.paneBefore.size=0):this.paneBefore.size=this.beforeMinimising,this.paneAfter.size=100-this.paneBefore.size}},mounted:function(){this.container=this.$refs.container},created:function(){this.paneBefore=this.before,this.paneAfter=this.after}},_=C,k=(n("94b3"),Object(r["a"])(_,f,m,!1,null,null,null)),$=k.exports,L=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("text-field",{attrs:{placeholder:"Search table",width:"100%"}}),n("div",{attrs:{id:"db"}},[n("div",{staticClass:"db-name",on:{click:function(t){e.schemaVisible=!e.schemaVisible}}},[n("svg",{staticClass:"chevron-icon",style:{transform:e.schemaVisible?"rotate(90deg)":"rotate(0)"},attrs:{width:"9",height:"9",viewBox:"0 0 8 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"}},[n("path",{attrs:{d:"M0.721924 9.93097L4.85292 5.79997L0.721924 1.66897L1.99992 0.399973L7.39992 5.79997L1.99992 11.2L0.721924 9.93097Z",fill:e.schemaVisible?"#506784":"rgba(80, 103, 132, 0.5)"}})]),e._v(" "+e._s(e.dbName)+" ")]),n("div",{staticClass:"db-edit"},[n("input",{ref:"dbfile",attrs:{type:"file",id:"actual-btn",hidden:""},on:{change:e.changeDb}}),n("label",{attrs:{for:"actual-btn"}},[n("svg",{staticClass:"db-edit-icon",attrs:{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"}},[n("path",{attrs:{d:"M3 10.5V12.75C3 14.25 5.2875 15.54 8.25 15.75V13.5825L8.3475 13.5C5.34 13.32 3 12.045 3 10.5ZM9 9.75C5.685 9.75 3 8.4075 3 6.75V9C3 10.6575 5.685 12 9 12C9.2925 12 9.5775 12 9.87 12L12.75 9.09C11.55 9.54 10.2825 9.75 9 9.75ZM9 2.25C5.685 2.25 3 3.5925 3 5.25C3 6.9075 5.685 8.25 9 8.25C12.315 8.25 15 6.9075 15 5.25C15 3.5925 12.315 2.25 9 2.25ZM15.75 8.3475C15.6375 8.3475 15.5325 8.3925 15.4575 8.475L14.7075 9.225L16.245 10.725L16.995 9.975C17.1525 9.825 17.16 9.57 16.995 9.3975L16.065 8.475C15.99 8.3925 15.885 8.3475 15.78 8.3475H15.75ZM14.28 9.66L9.75 14.205V15.75H11.295L15.84 11.1975L14.28 9.66Z",fill:"#A2B1C6"}})])]),n("span",{staticClass:"db-edit-tooltip"},[e._v("Change database")])])]),n("div",{directives:[{name:"show",rawName:"v-show",value:e.schemaVisible,expression:"schemaVisible"}],staticClass:"schema"},e._l(e.schema,(function(e,t){return n("table-description",{key:t,attrs:{name:e[0],sql:e[1]}})})),1)],1)},I=[],M=(n("baa5"),n("d3b7"),n("ddb0"),function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("div",{staticClass:"table-name",on:{click:function(t){e.colVisible=!e.colVisible}}},[n("svg",{staticClass:"chevron-icon",style:{transform:e.colVisible?"rotate(90deg)":"rotate(0)"},attrs:{width:"9",height:"9",viewBox:"0 0 8 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"}},[n("path",{attrs:{d:"M0.721924 9.93097L4.85292 5.79997L0.721924 1.66897L1.99992 0.399973L7.39992 5.79997L1.99992 11.2L0.721924 9.93097Z",fill:e.colVisible?"#506784":"rgba(80, 103, 132, 0.5)"}})]),e._v(" "+e._s(e.name)+" ")]),n("div",{directives:[{name:"show",rawName:"v-show",value:e.colVisible,expression:"colVisible"}],staticClass:"columns"},e._l(e.columns,(function(t,s){return n("div",{key:s,staticClass:"column"},[e._v(" "+e._s(t.name)+" "),n("span",{staticClass:"column-type"},[e._v(e._s(t.type))])])})),0)])}),Q=[],S=(n("4160"),n("b0c0"),n("159b"),n("6283")),T=n.n(S),O={name:"TableDescription",props:["name","sql"],data:function(){return{colVisible:!1}},computed:{ast:function(){return T()(this.sql)},columns:function(){var e=[];return this.ast.statement[0].definition.forEach((function(t){if("column"===t.variant){var n=t.datatype.variant;t.datatype.args&&(n=n+"("+t.datatype.args.expression[0].value,2===t.datatype.args.expression.length&&(n=n+", "+t.datatype.args.expression[1].value),n+=")"),e.push({name:t.name,type:n})}})),e}}},q=O,N=(n("5384"),Object(r["a"])(q,M,Q,!1,null,"38d0b4fd",null)),E=N.exports,V=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("div",{class:["text-field-label",{error:e.errorMsg}]},[e._v(e._s(e.label))]),n("input",{class:{error:e.errorMsg},style:{width:e.width},attrs:{type:"text",placeholder:e.placeholder},domProps:{value:e.value},on:{input:function(t){return e.$emit("input",t.target.value)}}}),n("div",{staticClass:"text-field-error"},[e._v(e._s(e.errorMsg))])])},D=[],z={name:"textField",props:["placeholder","label","errorMsg","value","width"]},H=z,j=(n("a231"),Object(r["a"])(H,V,D,!1,null,"519e18b9",null)),A=j.exports,B={name:"Schema",components:{TableDescription:E,TextField:A},data:function(){return{schemaVisible:!0,worker:this.$store.state.worker}},computed:{schema:function(){return this.$store.state.schema},dbName:function(){return this.$store.state.dbName}},methods:{changeDb:function(){var e=this,t=this.$refs.dbfile.value.substr(this.$refs.dbfile.value.lastIndexOf("\\")+1);this.$store.commit("saveDbName",t);var n=this.$refs.dbfile.files[0],s=new FileReader;s.onload=function(){e.worker.onmessage=function(){var t="\n SELECT name, sql\n FROM sqlite_master\n WHERE type='table' AND name NOT LIKE 'sqlite_%';";e.worker.onmessage=function(t){e.$store.commit("saveSchema",t.data.results[0].values)},e.worker.postMessage({action:"exec",sql:t})},e.$store.commit("saveDbFile",s.result);try{e.worker.postMessage({action:"open",buffer:s.result},[s.result])}catch(t){e.worker.postMessage({action:"open",buffer:s.result})}},s.readAsArrayBuffer(n)}}},P=B,U=(n("3c5c"),Object(r["a"])(P,L,I,!1,null,"4a84e98a",null)),R=U.exports,F=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("div",{attrs:{id:"tabs__header"}},e._l(e.tabs,(function(t,s){return n("div",{key:t.id,class:[{tab__selected:t.id===e.selectedIndex},"tab"],on:{click:function(n){return e.selectTab(t.id)}}},[n("div",{staticClass:"tab-name"},[n("span",{directives:[{name:"show",rawName:"v-show",value:t.isUnsaved,expression:"tab.isUnsaved"}]},[e._v("*")]),t.name?n("span",[e._v(e._s(t.name))]):n("span",{staticClass:"tab-untitled"},[e._v(e._s(t.tempName))])]),n("div",[n("svg",{staticClass:"close-icon",attrs:{width:"10",height:"10",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},on:{click:function(t){return t.stopPropagation(),e.closeTab(s)}}},[n("path",{attrs:{d:"M14 1.41L12.59 0L7 5.59L1.41 0L0 1.41L5.59 7L0 12.59L1.41 14L7 8.41L12.59 14L14 12.59L8.41 7L14 1.41Z",fill:"#A2B1C6"}})])])])})),0),e._l(e.tabs,(function(e,t){return n("tab-content",{key:e.id,attrs:{id:e.id,"init-name":e.name,"tab-index":t}})}))],2)},Z=[],W=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{directives:[{name:"show",rawName:"v-show",value:e.isActive,expression:"isActive"}],staticClass:"tab-content-container"},[n("splitpanes",{staticClass:"query-results-splitter",attrs:{horizontal:"",before:{size:50,max:50},after:{size:50,max:100}}},[n("div",{staticClass:"query-editor",attrs:{slot:"left-pane"},slot:"left-pane"},[n("div",{staticClass:"codemirror-container"},[n("codemirror",{ref:"codemirror",attrs:{options:e.cmOptions},on:{changes:e.onCmChange},model:{value:e.query,callback:function(t){e.query=t},expression:"query"}})],1),n("div",{staticClass:"run-btn-container"},[n("button",{staticClass:"primary run-btn",on:{click:e.execEditorContents}},[e._v("Run")])])]),n("div",{ref:"bottomPane",attrs:{slot:"right-pane",id:"bottomPane"},slot:"right-pane"},[n("view-switcher",{attrs:{view:e.view},on:{"update:view":function(t){e.view=t}}}),n("div",{directives:[{name:"show",rawName:"v-show",value:"table"===e.view,expression:"view === 'table'"}],staticClass:"table-view"},[e.result?n("sql-table",{attrs:{data:e.result,height:e.tableViewHeight}}):e._e()],1),n("PlotlyEditor",{directives:[{name:"show",rawName:"v-show",value:"chart"===e.view,expression:"view === 'chart'"}],attrs:{data:e.state.data,layout:e.state.layout,frames:e.state.frames,config:{editable:!0},dataSources:e.dataSources,dataSourceOptions:e.dataSourceOptions,plotly:e.plotly,useResizeHandler:!0,debug:!0,advancedTraceTypeSelector:!0},on:{onUpdate:e.update}})],1)])],1)},J=[],G=(n("d81d"),n("fb6a"),n("b64b"),n("3835")),K=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("div",{staticClass:"rounded-bg"},[n("div",{ref:"header-container",staticClass:"header-container"},[n("div",e._l(e.header,(function(t,s){return n("div",{key:s,staticClass:"fixed-header",style:{width:t.width+"px"}},[e._v(" "+e._s(t.name)+" ")])})),0)]),n("div",{ref:"table-container",staticClass:"table-container",style:{height:e.height+"px"},on:{scroll:e.onScrollTable}},[n("table",{ref:"table"},[n("thead",[n("tr",e._l(e.data.columns,(function(t,s){return n("th",{key:s,ref:"th",refInFor:!0},[n("div",{staticClass:"cell-data",style:e.cellStyle},[e._v(e._s(t))])])})),0)]),n("tbody",e._l(e.currentPageData,(function(t,s){return n("tr",{key:s},e._l(t,(function(t,s){return n("td",{key:s},[n("div",{staticClass:"cell-data",style:e.cellStyle},[e._v(e._s(t))])])})),0)})),0)])])]),n("div",{staticClass:"table-footer"},[n("div",{staticClass:"table-footer-count"},[e._v(" "+e._s(e.data.values.length)+" "+e._s(1===e.data.values.length?"row":"rows")+" retrieved ")]),n("pager",{directives:[{name:"show",rawName:"v-show",value:e.pageCount>1,expression:"pageCount > 1"}],attrs:{"page-count":e.pageCount},model:{value:e.currentPage,callback:function(t){e.currentPage=t},expression:"currentPage"}})],1)])},X=[],Y=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("paginate",{attrs:{"page-count":e.pageCount,"page-range":5,"margin-pages":1,"prev-text":e.chevron,"next-text":e.chevron,"no-li-surround":!0,"container-class":"paginator-continer","page-link-class":"paginator-page-link","active-class":"paginator-active-page","break-view-link-class":"paginator-break","next-link-class":"paginator-next","prev-link-class":"paginator-prev","disabled-class":"paginator-disabled"},model:{value:e.page,callback:function(t){e.page=t},expression:"page"}})},ee=[],te=n("8832"),ne=n.n(te),se={name:"Pager",components:{Paginate:ne.a},props:["pageCount","value"],data:function(){return{page:this.value,chevron:'\n <svg width="9" height="9" viewBox="0 0 8 12" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M0.721924 9.93097L4.85292 5.79997L0.721924 1.66897L1.99992 0.399973L7.39992 5.79997L1.99992 11.2L0.721924 9.93097Z" fill="#506784"/>\n </svg>\n '}},watch:{page:function(){this.$emit("input",this.page)},value:function(){this.page=this.value}}},ie=se,ae=(n("b7c0"),Object(r["a"])(ie,Y,ee,!1,null,"526c1dd2",null)),re=ae.exports,oe={name:"SqlTable",components:{Pager:re},props:["data","height"],data:function(){return{header:null,tableWidth:null,currentPage:1}},computed:{cellStyle:function(){var e=this.tableWidth/this.data.columns.length;return{maxWidth:"".concat(Math.max(e,100),"px")}},pageSize:function(){return Math.max(Math.floor(this.height/40),20)},pageCount:function(){return Math.ceil(this.data.values.length/this.pageSize)},currentPageData:function(){var e=(this.currentPage-1)*this.pageSize;return this.data.values.slice(e,e+this.pageSize)}},methods:{calculateHeadersWidth:function(){var e=this;this.tableWidth=this.$refs["table-container"].offsetWidth,this.$nextTick((function(){e.header=e.$refs.th.map((function(e){return{name:e.innerText,width:e.offsetWidth}}))}))},onScrollTable:function(){this.$refs["header-container"].scrollLeft=this.$refs["table-container"].scrollLeft},functionName:function(){}},mounted:function(){new ResizeObserver(this.calculateHeadersWidth).observe(this.$refs.table),this.calculateHeadersWidth()},watch:{currentPageData:"calculateHeadersWidth",data:function(){this.currentPage=1}}},ce=oe,le=Object(r["a"])(ce,K,X,!1,null,"1b374097",null),ue=le.exports,de=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"view-switcher"},[n("div",{class:["table-mode",{"active-mode":"table"===e.view}],on:{click:function(t){return e.$emit("update:view","table")}}},[e._v(" Table ")]),n("div",{class:["chart-mode",{"active-mode":"chart"===e.view}],on:{click:function(t){return e.$emit("update:view","chart")}}},[e._v(" Chart ")])])},he=[],fe={name:"ViewSwitcher",props:["view"]},me=fe,ve=(n("76c2"),Object(r["a"])(me,de,he,!1,null,"6204f3ca",null)),pe=ve.exports,be=n("f794"),ge=n.n(be),we=(n("0848"),n("56b3")),xe=n.n(we),ye=n("8f94"),Ce=(n("a7be"),n("ffda"),n("d5db"),n("9b74"),n("f6b6"),n("991c"),n("b1c6")),_e=n.n(Ce),ke={name:"TabContent",props:["id","initName","initQuery","initPlotly","tabIndex"],components:{codemirror:ye["codemirror"],SqlTable:ue,Splitpanes:$,ViewSwitcher:pe,PlotlyEditor:_e.a},data:function(){return{plotly:ge.a,state:{data:[],layout:{},frames:[]},query:"select * from albums",cmOptions:{tabSize:4,mode:"text/x-mysql",theme:"neo",lineNumbers:!0,line:!0},result:null,view:"table",tableViewHeight:0,worker:this.$store.state.worker,isUnsaved:!this.name}},computed:{isActive:function(){return this.id===this.$store.state.currentTabId},dataSources:function(){if(!this.result)return{};var e={},t=this.result.values,n=Object(G["a"])(t,1),s=n[0],i=s.map((function(e,n){return t.map((function(e){return e[n]}))}));return this.result.columns.forEach((function(t,n){e[t]=i[n]})),e},dataSourceOptions:function(){return Object.keys(this.dataSources).map((function(e){return{value:e,label:e}}))}},created:function(){this.$store.commit("setCurrentTab",this)},mounted:function(){new ResizeObserver(this.calculateTableHeight).observe(this.$refs.bottomPane),this.calculateTableHeight()},watch:{isActive:function(){this.isActive&&this.$store.commit("setCurrentTab",this)},query:function(){this.isUnsaved=!0},isUnsaved:function(){this.$store.commit("updateTabState",{index:this.tabIndex,newValue:this.isUnsaved})}},methods:{update:function(e,t,n){this.state={data:e,layout:t,frames:n},this.isUnsaved=!0,console.log(this.state)},onCmChange:function(e){var t=e.getTokenAt(e.getCursor()).string.slice(-1);if(t&&" "!==t&&";"!==t){var n={completeSingle:!1,completeOnSingleClick:!0};xe.a.showHint(e,xe.a.hint.sql,n)}},execute:function(e){var t=this;this.worker.onmessage=function(e){t.result=e.data.results[0],t.result||console.log(e.data.error)},this.worker.postMessage({action:"exec",sql:e})},execEditorContents:function(){this.execute(this.query+";")},calculateTableHeight:function(){var e=this.$refs.bottomPane,t=e.offsetHeight-88-42-30-5-40;this.tableViewHeight=t-t%40}}},$e=ke,Le=(n("44ed"),Object(r["a"])($e,W,J,!1,null,"e85565c6",null)),Ie=Le.exports,Me={components:{TabContent:Ie},data:function(){return{}},computed:{tabs:function(){return this.$store.state.tabs},selectedIndex:function(){return this.$store.state.currentTabId}},methods:{selectTab:function(e){this.$store.commit("setCurrentTabId",e)},closeTab:function(e){this.$store.commit("deleteTab",e)}}},Qe=Me,Se=(n("47b0"),Object(r["a"])(Qe,F,Z,!1,null,null,null)),Te=Se.exports,Oe={name:"Editor",components:{Schema:R,Splitpanes:$,Tabs:Te}},qe=Oe,Ne=(n("c212"),Object(r["a"])(qe,d,h,!1,null,null,null)),Ee=Ne.exports,Ve=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("div",{attrs:{id:"my-queries-content"}},[n("div",{attrs:{id:"my-queries-toolbar"}},[n("div",{attrs:{id:"toolbar-buttons"}},[n("input",{ref:"importFile",attrs:{type:"file",accept:".json",id:"import-file"},on:{change:e.importQueries}}),e._m(0),n("button",{directives:[{name:"show",rawName:"v-show",value:e.selectedQueriesCount>0,expression:"selectedQueriesCount > 0"}],staticClass:"toolbar",on:{click:function(t){return e.exportQuery(e.selectedQueriesIds)}}},[e._v(" Export ")]),n("button",{directives:[{name:"show",rawName:"v-show",value:e.selectedQueriesCount>0,expression:"selectedQueriesCount > 0"}],staticClass:"toolbar",on:{click:function(t){return e.showDeleteDialog(e.selectedQueriesIds)}}},[e._v(" Delete ")])]),n("div",{attrs:{id:"toolbar-search"}},[n("text-field",{attrs:{placeholder:"Search query by name",width:"300px"},model:{value:e.filter,callback:function(t){e.filter=t},expression:"filter"}})],1)]),n("div",{staticClass:"rounded-bg"},[n("div",{staticClass:"header-container"},[n("div",[n("div",{ref:"name-th",staticClass:"fixed-header"},[n("check-box",{ref:"mainCheckBox",attrs:{theme:"light"},on:{click:e.toggleSelectAll}}),n("div",{staticClass:"name-th"},[e._v("Name")])],1),n("div",{staticClass:"fixed-header"},[e._v(" Created at ")])])]),n("div",{ref:"table-container",staticClass:"table-container"},[n("table",{ref:"table"},[n("tbody",e._l(e.showedQueries,(function(t,s){return n("tr",{key:t.id,on:{click:function(t){return e.openQuery(s)}}},[n("td",{ref:"name-td",refInFor:!0},[n("div",{staticClass:"cell-data"},[n("check-box",{ref:"rowCheckBox",refInFor:!0,attrs:{init:e.selectAll||e.selectedQueriesIds.has(t.id)},on:{change:function(n){return e.toggleRow(n,t.id)}}}),n("div",{staticClass:"name"},[e._v(e._s(t.name))])],1)]),n("td",[n("div",{staticClass:"second-column"},[n("div",{staticClass:"date-container"},[e._v(e._s(e._f("date")(t.createdAt)))]),n("div",{staticClass:"icons-container"},[n("rename-icon",{on:{click:function(n){return e.showRenameDialog(t.id)}}}),n("copy-icon",{on:{click:function(t){return e.duplicateQuery(s)}}}),n("export-icon",{on:{click:function(t){return e.exportQuery(s)}}}),n("delete-icon",{on:{click:function(n){return e.showDeleteDialog(t.id)}}})],1)])])])})),0)])])])]),n("modal",{attrs:{name:"rename",classes:"dialog",height:"auto"}},[n("div",{staticClass:"dialog-header"},[e._v(" Rename query "),n("close-icon",{on:{click:function(t){return e.$modal.hide("rename")}}})],1),n("div",{staticClass:"dialog-body"},[n("text-field",{attrs:{label:"New query name","error-msg":e.errorMsg,width:"100%"},model:{value:e.newName,callback:function(t){e.newName=t},expression:"newName"}})],1),n("div",{staticClass:"dialog-buttons-container"},[n("button",{staticClass:"secondary",on:{click:function(t){return e.$modal.hide("rename")}}},[e._v("Cancel")]),n("button",{staticClass:"primary",on:{click:e.renameQuery}},[e._v("Rename")])])]),n("modal",{attrs:{name:"delete",classes:"dialog",height:"auto"}},[n("div",{staticClass:"dialog-header"},[e._v(" Delete "+e._s(e.deleteGroup?"queries":"query")+" "),n("close-icon",{on:{click:function(t){return e.$modal.hide("delete")}}})],1),e.deleteGroup||null!==e.currentQueryIndex&&e.currentQueryIndex>=0&&e.currentQueryIndex<e.queries.length?n("div",{staticClass:"dialog-body"},[e._v(" Are you sure you want to delete "+e._s(e.deleteGroup?e.selectedQueriesCount+" "+(e.selectedQueriesCount>1?"queries":"query"):'"'+e.queries[e.currentQueryIndex].name+'"')+"? ")]):e._e(),n("div",{staticClass:"dialog-buttons-container"},[n("button",{staticClass:"secondary",on:{click:function(t){return e.$modal.hide("delete")}}},[e._v("Cancel")]),n("button",{staticClass:"primary",on:{click:e.deleteQuery}},[e._v("Delete")])])]),n("a",{ref:"downloader"})],1)},De=[function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("button",{staticClass:"toolbar"},[n("label",{attrs:{for:"import-file"}},[e._v(" Import ")])])}],ze=(n("99af"),n("4de4"),n("c740"),n("c975"),n("a434"),n("6062"),n("3ca3"),n("2b3d"),function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("svg",{staticClass:"icon",attrs:{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},on:{click:function(t){return t.stopPropagation(),e.$emit("click")}}},[n("path",{attrs:{d:"M10.545 6.75L11.25 7.455L4.44 14.25H3.75V13.56L10.545 6.75ZM13.245 2.25C13.0575 2.25 12.8625 2.325 12.72 2.4675L11.3475 3.84L14.16 6.6525L15.5325 5.28C15.825 4.9875 15.825 4.5 15.5325 4.2225L13.7775 2.4675C13.6275 2.3175 13.44 2.25 13.245 2.25ZM10.545 4.6425L2.25 12.9375V15.75H5.0625L13.3575 7.455L10.545 4.6425Z",fill:"#A2B1C6"}})])}),He=[],je={name:"RenameIcon"},Ae=je,Be=(n("5e67"),Object(r["a"])(Ae,ze,He,!1,null,"087ec702",null)),Pe=Be.exports,Ue=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("svg",{staticClass:"icon",attrs:{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},on:{click:function(t){return t.stopPropagation(),e.$emit("click")}}},[n("path",{attrs:{d:"M14.25 15.75H6V5.25H14.25V15.75ZM14.25 3.75H6C5.60218 3.75 5.22064 3.90804 4.93934 4.18934C4.65804 4.47064 4.5 4.85218 4.5 5.25V15.75C4.5 16.1478 4.65804 16.5294 4.93934 16.8107C5.22064 17.092 5.60218 17.25 6 17.25H14.25C14.6478 17.25 15.0294 17.092 15.3107 16.8107C15.592 16.5294 15.75 16.1478 15.75 15.75V5.25C15.75 4.85218 15.592 4.47064 15.3107 4.18934C15.0294 3.90804 14.6478 3.75 14.25 3.75ZM12 0.75H3C2.60218 0.75 2.22064 0.908035 1.93934 1.18934C1.65804 1.47064 1.5 1.85218 1.5 2.25V12.75H3V2.25H12V0.75Z",fill:"#A2B1C6"}})])},Re=[],Fe={name:"CopyIcon"},Ze=Fe,We=(n("1276"),Object(r["a"])(Ze,Ue,Re,!1,null,"2e25625e",null)),Je=We.exports,Ge=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("svg",{staticClass:"icon",attrs:{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},on:{click:function(t){return t.stopPropagation(),e.$emit("click")}}},[n("path",{attrs:{d:"M10.5 1.5H4.5C3.675 1.5 3 2.175 3 3V15C3 15.825 3.675 16.5 4.5 16.5H13.5C14.325 16.5 15 15.825 15 15V6L10.5 1.5ZM13.5 15H4.5V3H9.75V6.75H13.5V15ZM12 8.25V13.575L10.425 12L8.325 14.1L6.225 12L8.325 9.9L6.675 8.25H12Z",fill:"#A2B1C6"}})])},Ke=[],Xe={name:"ExportIcon"},Ye=Xe,et=(n("096b"),Object(r["a"])(Ye,Ge,Ke,!1,null,"0a72b34b",null)),tt=et.exports,nt=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("svg",{staticClass:"icon",attrs:{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},on:{click:function(t){return t.stopPropagation(),e.$emit("click")}}},[n("path",{attrs:{d:"M6.75 2.25V3H3V4.5H3.75V14.25C3.75 14.6478 3.90804 15.0294 4.18934 15.3107C4.47064 15.592 4.85218 15.75 5.25 15.75H12.75C13.1478 15.75 13.5294 15.592 13.8107 15.3107C14.092 15.0294 14.25 14.6478 14.25 14.25V4.5H15V3H11.25V2.25H6.75ZM5.25 4.5H12.75V14.25H5.25V4.5ZM6.75 6V12.75H8.25V6H6.75ZM9.75 6V12.75H11.25V6H9.75Z",fill:"#A2B1C6"}})])},st=[],it={name:"DeleteIcon"},at=it,rt=(n("62d8"),Object(r["a"])(at,nt,st,!1,null,"2847acb2",null)),ot=rt.exports,ct=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("svg",{staticClass:"icon",attrs:{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},on:{click:function(t){return t.stopPropagation(),e.$emit("click")}}},[n("path",{attrs:{d:"M14 1.41L12.59 0L7 5.59L1.41 0L0 1.41L5.59 7L0 12.59L1.41 14L7 8.41L12.59 14L14 12.59L8.41 7L14 1.41Z",fill:"#A2B1C6"}})])},lt=[],ut={name:"CloseIcon"},dt=ut,ht=(n("da25"),Object(r["a"])(dt,ct,lt,!1,null,"de501776",null)),ft=ht.exports,mt=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"checkbox-container",on:{click:function(t){return t.stopPropagation(),e.onClick(t)}}},[s("div",{directives:[{name:"show",rawName:"v-show",value:!e.checked,expression:"!checked"}],staticClass:"unchecked"}),s("img",{directives:[{name:"show",rawName:"v-show",value:e.checked&&"accent"===e.theme,expression:"checked && theme === 'accent'"}],attrs:{src:n("93dd")}}),s("img",{directives:[{name:"show",rawName:"v-show",value:e.checked&&"light"===e.theme,expression:"checked && theme === 'light'"}],attrs:{src:n("69e6")}})])},vt=[],pt=(n("caad"),{name:"checkBox",props:{theme:{type:String,required:!1,default:"accent",validator:function(e){return["accent","light"].includes(e)}},init:{type:Boolean,required:!1,default:!1}},data:function(){return{checked:this.init}},watch:{checked:function(){this.$emit("change",this.checked)}},methods:{onClick:function(){this.checked=!this.checked,this.$emit("click",this.checked)}}}),bt=pt,gt=(n("f707"),Object(r["a"])(bt,mt,vt,!1,null,"53e168e6",null)),wt=gt.exports,xt=n("e1bd"),yt={name:"MyQueries",components:{RenameIcon:Pe,CopyIcon:Je,ExportIcon:tt,DeleteIcon:ot,CloseIcon:ft,TextField:A,CheckBox:wt},data:function(){return{queries:[],filter:null,newName:null,currentQueryId:null,errorMsg:null,selectedQueriesIds:new Set,selectedQueriesCount:0,selectAll:!1,deleteGroup:!1}},computed:{showedQueries:function(){var e=this;return this.filter?this.queries.filter((function(t){return t.name.toUpperCase().indexOf(e.filter.toUpperCase())>=0})):this.queries},currentQueryIndex:function(){var e=this;return this.queries.findIndex((function(t){return t.id===e.currentQueryId}))}},created:function(){this.queries=JSON.parse(localStorage.getItem("myQueries"))},mounted:function(){new ResizeObserver(this.calcNameWidth).observe(this.$refs.table),this.calcNameWidth()},filters:{date:function(e){if(!e)return"";var t={year:"numeric",month:"long",day:"numeric"},n={hour12:!1,hour:"2-digit",minute:"2-digit"};return new Date(e).toLocaleDateString("en-GB",t)+" "+new Date(e).toLocaleTimeString("en-GB",n)}},methods:{calcNameWidth:function(){this.$refs["name-th"].style="width: ".concat(this.$refs["name-td"][0].offsetWidth,"px")},openQuery:function(e){var t=this.showedQueries[e];t.isUnsaved=!1,this.$store.commit("addTab",t),this.$store.commit("setCurrentTabId",t.id),this.$router.push("/editor")},showRenameDialog:function(e){this.errorMsg=null,this.currentQueryId=e,this.newName=this.queries[this.currentQueryIndex].name,this.$modal.show("rename")},renameQuery:function(){if(this.newName){var e=this.queries[this.currentQueryIndex];e.name=this.newName,this.$set(this.queries,this.currentQueryIndex,e),this.$modal.hide("rename"),this.saveQueriesInLocalStorage();var t=this.findTabIndex(e.id);t>=0&&this.$store.commit("updateTabName",{index:t,newName:this.newName})}else this.errorMsg="Query name can't be empty"},duplicateQuery:function(e){var t=JSON.parse(JSON.stringify(this.showedQueries[e]));t.name=t.name+" Copy",t.id=Object(xt["a"])(),t.createdAt=new Date,this.queries.push(t),this.selectAll&&(this.selectedQueriesIds.add(t.id),this.selectedQueriesCount=this.selectedQueriesIds.size),this.saveQueriesInLocalStorage()},showDeleteDialog:function(e){this.deleteGroup="string"!==typeof e,this.deleteGroup||(this.currentQueryId=e),this.$modal.show("delete")},deleteQuery:function(){var e=this;if(this.$modal.hide("delete"),this.deleteGroup){this.queries=this.selectAll?[]:this.queries.filter((function(t){return!e.selectedQueriesIds.has(t.id)}));for(var t=this.$store.state.tabs,n=t.length-1;n>=0;n--)this.selectedQueriesIds.has(t[n].id)&&this.$store.commit("deleteTab",n);this.selectedQueriesIds.clear()}else{this.queries.splice(this.currentQueryIndex,1);var s=this.findTabIndex(this.currentQueryId);s>=0&&this.$store.commit("deleteTab",s),this.selectedQueriesIds.has(this.currentQueryId)&&this.selectedQueriesIds.delete(this.currentQueryId)}this.selectedQueriesCount=this.selectedQueriesIds.size,this.saveQueriesInLocalStorage()},findTabIndex:function(e){return this.$store.state.tabs.findIndex((function(t){return t.id===e}))},exportQuery:function(e){var t,n,s=this;"number"===typeof e?(console.log("single"),t=JSON.parse(JSON.stringify(this.showedQueries[e])),n=t.name,delete t.id,delete t.createdAt):(t=this.selectAll?JSON.parse(JSON.stringify(this.queries)):this.queries.filter((function(e){return s.selectedQueriesIds.has(e.id)})),n="My sqliteviz queries",t.forEach((function(e){delete e.id,delete e.createdAt})));var i=this.$refs.downloader,a=JSON.stringify(t,null,4),r=new Blob([a],{type:"octet/stream"}),o=window.URL.createObjectURL(r);i.href=o,i.download="".concat(n,".json"),i.click(),window.URL.revokeObjectURL(o)},importQueries:function(){var e=this,t=this.$refs.importFile.files[0],n=new FileReader;n.onload=function(){var t=JSON.parse(event.target.result);Array.isArray(t)||(t=[t]),t.forEach((function(t){t.id=Object(xt["a"])(),t.createdAt=new Date,e.selectAll&&(e.selectedQueriesIds.add(t.id),e.selectedQueriesCount=e.selectedQueriesIds.size)})),e.queries=e.queries.concat(t),e.saveQueriesInLocalStorage(),e.$refs.importFile.value=null},n.readAsText(t)},saveQueriesInLocalStorage:function(){localStorage.setItem("myQueries",JSON.stringify(this.queries))},toggleSelectAll:function(e){this.selectAll=e,this.$refs.rowCheckBox.forEach((function(t){t.checked=e})),this.selectedQueriesIds=e?new Set(this.queries.map((function(e){return e.id}))):new Set,this.selectedQueriesCount=this.selectedQueriesIds.size},toggleRow:function(e,t){e?this.selectedQueriesIds.add(t):(this.selectedQueriesIds.size===this.queries.length&&(this.$refs.mainCheckBox.checked=!1,this.selectAll=!1),this.selectedQueriesIds.delete(t)),this.selectedQueriesCount=this.selectedQueriesIds.size}}},Ct=yt,_t=(n("4219"),Object(r["a"])(Ct,Ve,De,!1,null,"54671868",null)),kt=_t.exports,$t=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{attrs:{id:"dbloader-container"}},[n("h1",[e._v("Sqliteviz")]),n("label",{attrs:{for:"assetsFieldHandle"}},[n("div",{attrs:{id:"drop-area"},on:{dragover:e.dragover,dragleave:e.dragleave,drop:e.drop}},[n("input",{ref:"file",attrs:{type:"file",id:"assetsFieldHandle",accept:".db"},on:{change:e.loadDb}}),n("div",[e._v(" Drop the database file to upload here or click to choose a file from your computer. ")])])]),n("div",{staticClass:"error",attrs:{id:"error"}})])},Lt=[],It={name:"DbUpload",data:function(){return{worker:this.$store.state.worker}},methods:{loadDb:function(){var e=this,t=this.$refs.file.value.substr(this.$refs.file.value.lastIndexOf("\\")+1);this.$store.commit("saveDbName",t);var n=this.$refs.file.files[0],s=new FileReader;s.onload=function(){e.worker.onmessage=function(){var t="\n SELECT name, sql\n FROM sqlite_master\n WHERE type='table' AND name NOT LIKE 'sqlite_%';";e.worker.onmessage=function(t){e.$store.commit("saveSchema",t.data.results[0].values),e.$router.push("/editor")},e.worker.postMessage({action:"exec",sql:t})},e.$store.commit("saveDbFile",s.result);try{e.worker.postMessage({action:"open",buffer:s.result},[s.result])}catch(t){e.worker.postMessage({action:"open",buffer:s.result})}},s.readAsArrayBuffer(n)},dragover:function(e){e.preventDefault(),e.currentTarget.classList.contains("bg-green-300")||(e.currentTarget.classList.remove("bg-gray-100"),e.currentTarget.classList.add("bg-green-300"))},dragleave:function(e){e.currentTarget.classList.add("bg-gray-100"),e.currentTarget.classList.remove("bg-green-300")},drop:function(e){e.preventDefault(),this.$refs.file.files=e.dataTransfer.files,this.loadDb(),e.currentTarget.classList.add("bg-gray-100"),e.currentTarget.classList.remove("bg-green-300")}}},Mt=It,Qt=(n("bfbb"),Object(r["a"])(Mt,$t,Lt,!1,null,"4abd87ab",null)),St=Qt.exports,Tt=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("main-menu"),n("keep-alive",{attrs:{include:"Editor"}},[n("router-view",{attrs:{id:"main-view"}})],1)],1)},Ot=[],qt=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("nav",[n("div",[n("router-link",{attrs:{to:"/editor"}},[e._v("Editor")]),n("router-link",{attrs:{to:"/my-queries"}},[e._v("My queries")])],1),n("div",[e.$store.state.tabs.length>0?n("button",{staticClass:"primary",attrs:{disabled:!e.$store.state.currentTab.isUnsaved},on:{click:e.saveQuery}},[e._v(" Save ")]):e._e(),n("button",{staticClass:"primary",on:{click:e.createNewQuery}},[e._v("Create")])])])},Nt=[],Et={name:"MainMenu",methods:{createNewQuery:function(){var e={id:Object(xt["a"])(),name:null,tempName:this.$store.state.untitledLastIndex?"Untitled ".concat(this.$store.state.untitledLastIndex):"Untitled",isUnsaved:!0};this.$store.commit("addTab",e),this.$store.commit("setCurrentTabId",e.id),this.$store.commit("updateUntitledLastIndex")},saveQuery:function(){var e=this.$store.state.currentTab,t=!this.$store.state.currentTab.initName,n={id:e.id,query:e.query};t?(n.name=prompt("query name"),this.$store.commit("updateTabName",{index:e.tabIndex,newName:n.name}),n.createdAt=new Date):n.name=e.initName;var s=JSON.parse(localStorage.getItem("myQueries"));if(s)if(t)s.push(n);else{var i=s.findIndex((function(t){return t.id===e.id}));n.createdAt=s[i].createdAt,s[i]=n}else s=[n];localStorage.setItem("myQueries",JSON.stringify(s)),e.isUnsaved=!1}}},Vt=Et,Dt=(n("e54d"),Object(r["a"])(Vt,qt,Nt,!1,null,"1934f1f0",null)),zt=Dt.exports,Ht=(n("e506"),{name:"MainView",components:{MainMenu:zt}}),jt=Ht,At=(n("52c7"),Object(r["a"])(jt,Tt,Ot,!1,null,"91443d3a",null)),Bt=At.exports;s["default"].use(u["a"]);var Pt=[{path:"/",name:"Welcome",component:St},{path:"/",name:"MainView",component:Bt,children:[{path:"/editor",name:"Editor",component:Ee},{path:"/my-queries",name:"MyQueries",component:kt}]}],Ut=new u["a"]({routes:Pt}),Rt=Ut,Ft=n("2f62");s["default"].use(Ft["a"]);var Zt=new Ft["a"].Store({state:{schema:null,dbFile:null,dbName:null,worker:new Worker("js/worker.sql-wasm.js"),tabs:[],currentTab:null,currentTabId:null,untitledLastIndex:0},mutations:{saveSchema:function(e,t){e.schema=t},saveDbFile:function(e,t){e.dbFile=t},saveDbName:function(e,t){e.dbName=t},addTab:function(e,t){e.tabs.push(t)},updateTabName:function(e,t){var n=t.index,i=t.newName,a=e.tabs[n];a.name=i,s["default"].set(e.tabs,n,a)},updateTabState:function(e,t){var n=t.index,i=t.newValue;console.log(n,i);var a=e.tabs[n];a.isUnsaved=i,s["default"].set(e.tabs,n,a)},deleteTab:function(e,t){e.tabs[t].id!==e.currentTabId||(t<e.tabs.length-1?e.currentTabId=e.tabs[t+1].id:t>0?e.currentTabId=e.tabs[t-1].id:(e.currentTabId=null,e.untitledLastIndex=0)),e.tabs.splice(t,1)},setCurrentTabId:function(e,t){e.currentTabId=t},setCurrentTab:function(e,t){e.currentTab=t},updateUntitledLastIndex:function(e){e.untitledLastIndex+=1}},actions:{},modules:{}}),Wt=n("b8ae"),Jt=n("1881"),Gt=n.n(Jt);n("017d"),n("33da"),n("6d26"),n("bebf");s["default"].use(Wt["VuePlugin"]),s["default"].use(Gt.a),s["default"].config.productionTip=!1,new s["default"]({router:Rt,store:Zt,render:function(e){return e(l)}}).$mount("#app")},"5b57":function(e,t,n){},"5d2b":function(e,t,n){},"5e67":function(e,t,n){"use strict";var s=n("6a05"),i=n.n(s);i.a},"62d8":function(e,t,n){"use strict";var s=n("02dd"),i=n.n(s);i.a},"69e6":function(e,t,n){e.exports=n.p+"img/checkbox_checked_light.611c4f86.svg"},"6a05":function(e,t,n){},"6d26":function(e,t,n){},"6e4c":function(e,t,n){},"73e1":function(e,t,n){},"76c2":function(e,t,n){"use strict";var s=n("9790"),i=n.n(s);i.a},"80c6":function(e,t,n){},"85ec":function(e,t,n){},"93dd":function(e,t,n){e.exports=n.p+"img/checkbox_checked.62e65660.svg"},"94b3":function(e,t,n){"use strict";var s=n("5b57"),i=n.n(s);i.a},9790:function(e,t,n){},"9a9d":function(e,t,n){},a231:function(e,t,n){"use strict";var s=n("2c34"),i=n.n(s);i.a},b344:function(e,t,n){},b7c0:function(e,t,n){"use strict";var s=n("4531"),i=n.n(s);i.a},bebf:function(e,t,n){},bfbb:function(e,t,n){"use strict";var s=n("6e4c"),i=n.n(s);i.a},c212:function(e,t,n){"use strict";var s=n("d883"),i=n.n(s);i.a},d2c9:function(e,t,n){},d883:function(e,t,n){},da25:function(e,t,n){"use strict";var s=n("1dd6"),i=n.n(s);i.a},e506:function(e,t,n){},e54d:function(e,t,n){"use strict";var s=n("80c6"),i=n.n(s);i.a},ea6d:function(e,t,n){},f707:function(e,t,n){"use strict";var s=n("5187"),i=n.n(s);i.a}});
|
|
//# sourceMappingURL=app.586fbd00.js.map
|