@visuallyjs/browser-ui-vue 1.2.0 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/definitions.d.ts CHANGED
@@ -1,11 +1,13 @@
1
- import { BrowserElement, CanvasDropFilter, DataGeneratorFunction, GroupIdentifierFunction, ObjectData, OnVertexAddedCallback, Size, SurfaceOptions, TypeGeneratorFunction, EdgeMapping, NodeMapping, GroupMapping, PortMapping, ModelOptions, Base, Surface, PointXY, SvgExportUIOptions, ImageExportUIOptions, DiagramCell, PaletteMode, Diagram, PreparedShape } from "@visuallyjs/browser-ui";
1
+ import { BrowserElement, CanvasDropFilter, DataGeneratorFunction, GroupIdentifierFunction, ObjectData, OnVertexAddedCallback, Size, SurfaceOptions, TypeGeneratorFunction, EdgeMapping, NodeMapping, GroupMapping, PortMapping, ModelOptions, Base, Surface, PointXY, SvgExportUIOptions, ImageExportUIOptions, DiagramCell, PaletteMode, Diagram, PreparedShape, OverlaySpec } from "@visuallyjs/browser-ui";
2
2
  export declare const DEFAULT_VUE_SURFACE_ID = "surfaceId";
3
+ export declare const DEFAULT_VUE_PAPER_ID = "paperId";
3
4
  export declare const PROP_TYPE_FUNCTION = "typeFunction";
4
5
  export declare const PROP_CLICK_TO_CENTER = "clickToCenter";
5
6
  export declare const PROP_SHOW_LASSO = "showLasso";
6
7
  export declare const PROP_ACTIVE_TRACKING = "activeTracking";
7
8
  export declare const PROP_TRACK_SELECTION = "trackSelection";
8
9
  export declare const PROP_SURFACE_ID = "surfaceId";
10
+ export declare const PROP_PAPER_ID = "paperId";
9
11
  export declare const PROP_CLASS_NAME = "className";
10
12
  export declare const PROP_DATA = "data";
11
13
  export declare const PROP_MODE = "mode";
@@ -53,6 +55,11 @@ export declare const CLASS_VUE_NODE = "vjs-vue-node";
53
55
  * @group CSS Classes
54
56
  */
55
57
  export declare const CLASS_VUE_GROUP = "vjs-vue-group";
58
+ /**
59
+ * CSS class set on the root element rendered for some overlay
60
+ * @group CSS Classes
61
+ */
62
+ export declare const CLASS_VUE_OVERLAY = "vjs-vue-overlay";
56
63
  /**
57
64
  * Render options for a SurfaceComponent.
58
65
  */
@@ -95,7 +102,21 @@ export interface VuePortMapping extends Omit<PortMapping<BrowserElement>, "templ
95
102
  /**
96
103
  * Mapping definition for edges.
97
104
  */
98
- export interface VueEdgeMapping extends EdgeMapping {
105
+ export interface VueEdgeMapping extends Omit<EdgeMapping, "overlays"> {
106
+ overlays?: Array<OverlaySpec | VueOverlaySpec>;
107
+ }
108
+ /**
109
+ * Definition for an overlay when using Vue components.
110
+ */
111
+ export interface VueOverlaySpec {
112
+ /**
113
+ * Component used to render this overlay.
114
+ */
115
+ component: any;
116
+ /**
117
+ * Props to pass to the component.
118
+ */
119
+ props?: Record<string, any>;
99
120
  }
100
121
  /**
101
122
  * Options for the view in the surface component. Maps node/group/port/edge types to Components and behaviour.
@@ -130,6 +151,14 @@ export declare const COMPONENT_SURFACE = "SurfaceComponent";
130
151
  * Tag for the SurfaceProvider.
131
152
  */
132
153
  export declare const COMPONENT_SURFACE_PROVIDER = "SurfaceProvider";
154
+ /**
155
+ * Paper component tag
156
+ */
157
+ export declare const COMPONENT_PAPER = "PaperComponent";
158
+ /**
159
+ * Tag for the PaperProvider.
160
+ */
161
+ export declare const COMPONENT_PAPER_PROVIDER = "PaperProvider";
133
162
  /**
134
163
  * Tag for the DiagramProvider.
135
164
  */
@@ -198,6 +227,10 @@ export declare const COMPONENT_SANKEY_CHART = "SankeyChartComponent";
198
227
  * inspector component tag
199
228
  */
200
229
  export declare const COMPONENT_INSPECTOR = "InspectorComponent";
230
+ /**
231
+ * surface popup component tag
232
+ */
233
+ export declare const COMPONENT_SURFACE_POPUP = "SurfacePopup";
201
234
  /**
202
235
  * HTML tag for a decorator
203
236
  */
@@ -265,6 +298,37 @@ export interface SurfaceComponentProps {
265
298
  */
266
299
  data?: any;
267
300
  }
301
+ /**
302
+ * Supported props for the {@link PaperComponent}.
303
+ * @group Props
304
+ */
305
+ export interface PaperComponentProps {
306
+ /**
307
+ * ID of the paper to attach to. This is optional; Visually JS will use the default paper ID if you do not
308
+ * provide this. For apps where there's only one paper there is no need to provide this.
309
+ */
310
+ paperId?: string;
311
+ /**
312
+ * Parameters to configure the underlying paper.
313
+ */
314
+ renderOptions?: RenderOptions;
315
+ /**
316
+ * Mapping of model object types to components and behaviour
317
+ */
318
+ viewOptions?: ViewOptions;
319
+ /**
320
+ * Options for the underlying model.
321
+ */
322
+ modelOptions?: ModelOptions;
323
+ /**
324
+ * Optional url for a dataset to load.
325
+ */
326
+ url?: string;
327
+ /**
328
+ * Optional dataset to load.
329
+ */
330
+ data?: any;
331
+ }
268
332
  /**
269
333
  * Props for the `ShapeComponent`.
270
334
  * @group Props
package/index.d.ts CHANGED
@@ -22,7 +22,9 @@ export * from "./diagram-provider";
22
22
  export * from "./diagram-palette-component";
23
23
  export * from "./chart";
24
24
  export * from "./surface-component";
25
+ export * from "./paper-component";
25
26
  export * from "./surface-provider";
27
+ export * from "./paper-provider";
26
28
  export * from "./vue-wrapper";
27
29
  export * from './decorator-component';
28
30
  export * from './visuallyjs-service';
@@ -31,3 +33,4 @@ export * from './use-visuallyjs-update';
31
33
  export * from './use-surface';
32
34
  export * from './use-diagram';
33
35
  export * from './use-paper';
36
+ export * from './surface-popup';
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"@visuallyjs/browser-ui-vue","version":"1.2.0","description":"VisuallyJS Vue integration","module":"visuallyjs.browser-ui-vue.es.js","main":"visuallyjs.browser-ui-vue.cjs.js","types":"index.d.ts","files":["visuallyjs.browser-ui-vue.es.js","visuallyjs.browser-ui-vue.cjs.js","**/*.d.ts"],"author":"VisuallyJs <hello@visuallyjs.com> (https://visuallyjs.com)","license":"Commercial","dependencies":{"@visuallyjs/browser-ui":"1.2.0"},"homepage":"https://visuallyjs.com/vue","bugs":"https://github.com/visuallyjs/visuallyjs/issues"}
1
+ {"name":"@visuallyjs/browser-ui-vue","version":"1.2.1","description":"VisuallyJS Vue integration","module":"visuallyjs.browser-ui-vue.es.js","main":"visuallyjs.browser-ui-vue.cjs.js","types":"index.d.ts","files":["visuallyjs.browser-ui-vue.es.js","visuallyjs.browser-ui-vue.cjs.js","**/*.d.ts"],"author":"VisuallyJs <hello@visuallyjs.com> (https://visuallyjs.com)","license":"Commercial","dependencies":{"@visuallyjs/browser-ui":"1.2.1"},"homepage":"https://visuallyjs.com/vue","bugs":"https://github.com/visuallyjs/visuallyjs/issues"}
@@ -0,0 +1,46 @@
1
+ import { PropType } from "vue";
2
+ import { RenderOptions, ViewOptions, PaperComponentProps } from "./definitions";
3
+ import { ObjectData, ModelOptions, BrowserUIModel } from "@visuallyjs/browser-ui";
4
+ import { VertexPlaceholder, OverlayPlaceholder } from "./util";
5
+ /**
6
+ * Provides a static canvas onto which nodes, groups and edges can be drawn, with support for various plugins.
7
+ * @group Components
8
+ */
9
+ export declare const PaperComponent: {
10
+ setup(props: PaperComponentProps): {
11
+ service: unknown;
12
+ paperId: string;
13
+ };
14
+ name: string;
15
+ props: {
16
+ data: {
17
+ type: PropType<ObjectData>;
18
+ };
19
+ renderOptions: {
20
+ type: PropType<RenderOptions>;
21
+ };
22
+ modelOptions: {
23
+ type: PropType<ModelOptions>;
24
+ };
25
+ viewOptions: {
26
+ type: PropType<ViewOptions>;
27
+ };
28
+ model: {
29
+ type: PropType<BrowserUIModel>;
30
+ };
31
+ url: {
32
+ type: StringConstructor;
33
+ };
34
+ paperId: {
35
+ type: StringConstructor;
36
+ };
37
+ };
38
+ data: () => {
39
+ vertices: Array<VertexPlaceholder>;
40
+ overlays: Array<OverlayPlaceholder>;
41
+ };
42
+ mounted(): void;
43
+ render: () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
44
+ [key: string]: any;
45
+ }>;
46
+ };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Paper provider component. "Headless" in that it doesnt write out any elements of its own, it just writes out any child elements.
3
+ */
4
+ declare const PaperProvider: {
5
+ setup(): void;
6
+ render(): any;
7
+ };
8
+ export { PaperProvider };
@@ -1,7 +1,7 @@
1
1
  import { PropType } from "vue";
2
2
  import { RenderOptions, ViewOptions, SurfaceComponentProps } from "./definitions";
3
3
  import { ObjectData, ModelOptions, BrowserUIModel } from "@visuallyjs/browser-ui";
4
- import { VertexPlaceholder } from "./util";
4
+ import { VertexPlaceholder, OverlayPlaceholder } from "./util";
5
5
  /**
6
6
  * Provides a pannable and zoomable canvas onto which nodes, groups and edges can be drawn, with support for various plugins.
7
7
  * @group Components
@@ -37,6 +37,7 @@ export declare const SurfaceComponent: {
37
37
  };
38
38
  data: () => {
39
39
  vertices: Array<VertexPlaceholder>;
40
+ overlays: Array<OverlayPlaceholder>;
40
41
  };
41
42
  mounted(): void;
42
43
  render: () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
@@ -0,0 +1,5 @@
1
+ /**
2
+ * A component that provides an automatic popup mechanism for when users click on vertices in the surface.
3
+ */
4
+ declare const SurfacePopup: any;
5
+ export { SurfacePopup };
package/util.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { BrowserElement, BrowserUI, Surface, Vertex, ViewSpec } from "@visuallyjs/browser-ui";
1
+ import { BrowserElement, BrowserUI, Surface, Vertex, ViewSpec, Overlay, Edge, BrowserUIModel, Paper } from "@visuallyjs/browser-ui";
2
2
  import { BrowserUIVueModel } from "./browser-ui-vue";
3
- import { RenderOptions } from "./definitions";
3
+ import { RenderOptions, ViewOptions } from "./definitions";
4
4
  /** @internal */
5
5
  export declare const EVENT_VERTICES_RENDERED = "vertices:rendered";
6
6
  /** @internal */
@@ -105,6 +105,38 @@ export interface VertexPlaceholder {
105
105
  _key: string;
106
106
  props: Record<string, any>;
107
107
  }
108
+ /**
109
+ * Placeholder for overlays prior we're rendering. Not used by API users.
110
+ * @internal
111
+ */
112
+ export interface OverlayPlaceholder {
113
+ component: any;
114
+ el: BrowserElement;
115
+ _key: string;
116
+ props: Record<string, any>;
117
+ }
118
+ /**
119
+ * Mixin for overlay components.
120
+ * @internal
121
+ */
122
+ export declare const BaseOverlayComponent: {
123
+ props: {
124
+ data: ObjectConstructor;
125
+ model: typeof BrowserUIVueModel;
126
+ obj: typeof Edge;
127
+ edge: typeof Edge;
128
+ overlay: typeof Overlay;
129
+ ui: typeof BrowserUI;
130
+ el: {
131
+ new (): Element;
132
+ prototype: Element;
133
+ };
134
+ def: ObjectConstructor;
135
+ eventInfo: ObjectConstructor;
136
+ };
137
+ mounted(): void;
138
+ updated(): void;
139
+ };
108
140
  /**
109
141
  * @internal
110
142
  * @param model
@@ -115,3 +147,20 @@ export interface VertexPlaceholder {
115
147
  * @param view
116
148
  */
117
149
  export declare function addSurface(model: BrowserUIVueModel, surfaceId: string, container: any, vertices: Array<VertexPlaceholder>, renderParams?: RenderOptions, view?: ViewSpec<BrowserElement>): Surface;
150
+ /**
151
+ * @internal
152
+ * @param model
153
+ * @param paperId
154
+ * @param container
155
+ * @param vertices
156
+ * @param renderParams
157
+ * @param view
158
+ */
159
+ export declare function addPaper(model: BrowserUIVueModel, surfaceId: string, container: any, vertices: Array<VertexPlaceholder>, renderParams?: RenderOptions, view?: ViewSpec<BrowserElement>): Paper;
160
+ /**
161
+ * @internal
162
+ * @param viewOptions
163
+ * @param model
164
+ * @param overlays
165
+ */
166
+ export declare function $initialiseVueOverlays(viewOptions: ViewOptions, getUI: () => BrowserUI, getModel: () => BrowserUIModel, overlays: Array<OverlayPlaceholder>): void;
@@ -1 +1 @@
1
- var ve=Object.defineProperty,No=Object.defineProperties,vo=Object.getOwnPropertyDescriptor,xo=Object.getOwnPropertyDescriptors,Do=Object.getOwnPropertyNames,Qt=Object.getOwnPropertySymbols;var to=Object.prototype.hasOwnProperty,Io=Object.prototype.propertyIsEnumerable;var eo=(e,t,o)=>t in e?ve(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,te=(e,t)=>{for(var o in t||(t={}))to.call(t,o)&&eo(e,o,t[o]);if(Qt)for(var o of Qt(t))Io.call(t,o)&&eo(e,o,t[o]);return e},oe=(e,t)=>No(e,xo(t));var Mo=(e,t)=>{for(var o in t)ve(e,o,{get:t[o],enumerable:!0})},wo=(e,t,o,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Do(t))!to.call(e,s)&&s!==o&&ve(e,s,{get:()=>t[s],enumerable:!(n=vo(t,s))||n.enumerable});return e};var bo=e=>wo(ve({},"__esModule",{value:!0}),e);var er={};Mo(er,{AreaChartComponent:()=>Ge,BarChartComponent:()=>Ve,BaseGroupComponent:()=>ao,BaseNodeComponent:()=>io,BrowserUIVueModel:()=>N,BubbleChartComponent:()=>Fe,CLASS_VUE_GROUP:()=>Bt,CLASS_VUE_NODE:()=>Lt,COMPONENT_AREA_CHART:()=>Ee,COMPONENT_BAR_CHART:()=>fe,COMPONENT_BUBBLE_CHART:()=>_e,COMPONENT_COLUMN_CHART:()=>he,COMPONENT_CONTROLS:()=>ce,COMPONENT_DIAGRAM:()=>de,COMPONENT_DIAGRAM_PALETTE:()=>me,COMPONENT_DIAGRAM_PROVIDER:()=>Gt,COMPONENT_EXPORT_CONTROLS:()=>ue,COMPONENT_GAUGE_CHART:()=>Te,COMPONENT_INSPECTOR:()=>ye,COMPONENT_LINE_CHART:()=>Pe,COMPONENT_MINIVIEW:()=>ae,COMPONENT_PALETTE:()=>pe,COMPONENT_PIE_CHART:()=>Ce,COMPONENT_SANKEY_CHART:()=>ge,COMPONENT_SCATTER_CHART:()=>Se,COMPONENT_SURFACE:()=>le,COMPONENT_SURFACE_PROVIDER:()=>Ut,COMPONENT_XY_CHART:()=>Oe,ColorPickerComponent:()=>qt,ColumnChartComponent:()=>be,ControlsComponent:()=>Jt,DEFAULT_SHAPE_HEIGHT:()=>bt,DEFAULT_SHAPE_WIDTH:()=>wt,DEFAULT_VUE_SURFACE_ID:()=>rt,DecoratorComponent:()=>Ze,DiagramComponent:()=>Yt,DiagramPaletteComponent:()=>Qe,DiagramProvider:()=>qe,EVENT_VERTEX_UPDATED:()=>so,EVENT_VERTICES_RENDERED:()=>no,EdgeTypePickerComponent:()=>Ye,ExportControlsComponent:()=>Kt,GaugeChartComponent:()=>ke,InspectorComponent:()=>Ke,InspectorGetterSymbol:()=>K,InspectorSetterSymbol:()=>Oo,LineChartComponent:()=>Ue,MiniviewComponent:()=>Xt,PROP_ACTIVE_TRACKING:()=>at,PROP_ALLOW_CLICK_TO_ADD:()=>Dt,PROP_ALLOW_DROP_ON_CANVAS:()=>gt,PROP_ALLOW_DROP_ON_EDGE:()=>Tt,PROP_ALLOW_DROP_ON_GROUP:()=>yt,PROP_ALLOW_DROP_ON_NODE:()=>Rt,PROP_CANVAS_DROP_FILTER:()=>Mt,PROP_CLASS_NAME:()=>w,PROP_CLICK_TO_ADD_ONLY:()=>xt,PROP_CLICK_TO_CENTER:()=>st,PROP_CSV_DATA:()=>ft,PROP_DATA:()=>b,PROP_DATA_GENERATOR:()=>Ct,PROP_DATA_SOURCE_FILTER:()=>De,PROP_DRAG_SIZE:()=>It,PROP_GROUP_IDENTIFIER:()=>_t,PROP_ID:()=>Lo,PROP_IGNORE_DROP_ON_NODE:()=>At,PROP_INTERACTIVE:()=>mt,PROP_JSON_DATA:()=>Ot,PROP_MODE:()=>pt,PROP_MODEL:()=>ut,PROP_MODEL_OPTIONS:()=>re,PROP_ON_VERTEX_ADDED:()=>Nt,PROP_OPTIONS:()=>U,PROP_PIVOT:()=>ht,PROP_RENDER_OPTIONS:()=>ct,PROP_SELECTOR:()=>Et,PROP_SELECT_AFTER_ADD:()=>vt,PROP_SHOW_LASSO:()=>it,PROP_SURFACE_ID:()=>y,PROP_TRACK_SELECTION:()=>lt,PROP_TYPE_FUNCTION:()=>nt,PROP_TYPE_GENERATOR:()=>St,PROP_URL:()=>V,PROP_USE_MODEL:()=>Pt,PROP_VIEW_OPTIONS:()=>dt,PaletteComponent:()=>Zt,PieChartComponent:()=>Be,SankeyChartComponent:()=>He,ScatterChartComponent:()=>je,ShapeComponent:()=>We,ShapePaletteComponent:()=>Je,SurfaceComponent:()=>Wt,SurfaceProvider:()=>$e,TAG_COLOR_PICKER:()=>Vt,TAG_DECORATOR:()=>jt,TAG_EDGE_TYPE_PICKER:()=>ie,TAG_SHAPE:()=>ne,TAG_SHAPE_PALETTE:()=>se,VisuallyJsPlugin:()=>Ko,VisuallyJsService:()=>R,VisuallyJsServiceKey:()=>i,XYChartComponent:()=>Le,addSurface:()=>$t,bindToDevLifecycle:()=>jo,doProvideInspector:()=>Po,newInstance:()=>Vo,useDiagram:()=>qo,usePaper:()=>Qo,useSurface:()=>Zo,useVisuallyJsUpdate:()=>Yo,useZoom:()=>Xo});module.exports=bo(er);var xe=require("@visuallyjs/browser-ui"),N=class extends xe.BrowserUIModel{render(t,o){return(0,xe.log)("render called directly on BrowserUiVue class: should not happen. Surface component should use internal render."),null}};function Vo(e){return e=e||{},new N(e)}var rt="surfaceId",nt="typeFunction",st="clickToCenter",it="showLasso",at="activeTracking",lt="trackSelection",y="surfaceId",w="className",b="data",pt="mode",U="options",ct="renderOptions",re="modelOptions",ut="model",dt="viewOptions",V="url",mt="interactive",ht="pivot",De="dataSourceFilter",ft="csvData",Ot="jsonData",Pt="useModel",Lo="id",Et="selector",Ct="dataGenerator",St="typeGenerator",_t="groupIdentifier",Tt="allowDropOnEdge",gt="allowDropOnCanvas",yt="allowDropOnGroup",Rt="allowDropOnNode",At="ignoreDropOnNode",Nt="onVertexAdded",vt="selectAfterAdd",xt="clickToAddOnly",Dt="allowClickToAdd",It="dragSize",Mt="canvasDropFilter",ne="Shape",se="ShapePalette",wt=120,bt=90,ie="EdgeTypePickerComponent",Vt="ColorPickerComponent",Lt="vjs-vue-node",Bt="vjs-vue-group",ae="MiniviewComponent",le="SurfaceComponent",Ut="SurfaceProvider",Gt="DiagramProvider",pe="PaletteComponent",ce="ControlsComponent",ue="ExportControlsComponent",de="DiagramComponent",me="DiagramPaletteComponent",he="ColumnChartComponent",fe="BarChartComponent",Oe="XYChartComponent",Pe="LineChartComponent",Ee="AreaChartComponent",Ce="PieChartComponent",Se="ScatterChartComponent",_e="BubbleChartComponent",Te="GaugeChartComponent",ge="SankeyChartComponent",ye="InspectorComponent",jt="Decorator";var G=require("vue"),c=require("@visuallyjs/browser-ui"),Ft=class{constructor(){this.unrenderedVertices=new Map;this.eventManager=new c.OptimisticEventGenerator}vertexWillRender(t){this.unrenderedVertices.set(t.id,t)}vertexHasRendered(t){this.unrenderedVertices.delete(t.id),this.unrenderedVertices.size===0&&this.eventManager.fire(no)}vertexHasUpdated(t){this.eventManager.fire(so,t)}},no="vertices:rendered",so="vertex:updated",kt=new Map;function Ie(e){return kt.has(e)||kt.set(e,new Ft),kt.get(e)}function Bo(e,t){Ie(e).vertexHasRendered(t)}function Uo(e,t){Ie(e).vertexHasUpdated(t)}function Go(e,t){Ie(e).vertexWillRender(t)}function jo(e,t,o){Ie(e).eventManager.bind(t,o)}var oo={props:{data:Object,model:N,obj:c.Vertex,vertex:c.Vertex,ui:c.BrowserUI,el:Element,def:Object,eventInfo:Object},mounted(){let e=this,t=(0,c.isGroup)(e.obj)?Bt:Lt;e.el.firstElementChild&&(0,c.addClass)(e.el.firstElementChild,t),e.ui.$vertexRendered(e.obj,e.el,e.def,e.eventInfo),Bo(e.ui.id,e.obj)},methods:{getModel:function(){return this.model},removeVertex:function(){this.model.remove(this.obj)}},updated(){this.ui.$revalidateElement(this.el),Uo(this.ui.id,this.obj)}},io={mixins:[oo],methods:{getNode:function(){return this.obj},removeNode:function(){this.model.removeNode(this.getNode())},updateNode:function(e){this.model.updateNode(this.obj,e);let t=this.ui.getRenderedElement(this.obj.getFullId());this.ui.$revalidateElement(t)}}},ao={methods:{getGroup:function(){return this.obj},removeGroup:function(e){this.model.removeGroup(this.obj,e)},updateGroup:function(e){this.model.updateGroup(this.obj,e);let t=this.ui.getRenderedElement(this.obj.getFullId());this.ui.$revalidateElement(t)}},mixins:[oo]},Ht=(e,t)=>{t.parentNode&&t.parentNode.removeChild(t)},ro=(e,t,o,n,s,a,l,h,E)=>{let O=l.component!=null,D=(0,c.isGroup)(h),I=[];O||I.push(D?c.CLASS_DEFAULT_GROUP:c.CLASS_DEFAULT_NODE);let T=O?l.component:{render(g){return g.data.label||""}};if(T){let g=document.createElement(c.ELEMENT_DIV);(0,c.updateClasses)(g,I),T.mixins==null&&(T.mixins=[]);let M=D?ao:io;T.mixins.find(Ne=>Ne===M)||T.mixins.push(M),Go(a.id,h);let Ae={data:o,model:(0,G.markRaw)(n),ui:(0,G.markRaw)(a),obj:h,vertex:h,el:g,def:(0,G.markRaw)(l),eventInfo:E==null?null:(0,G.markRaw)(E)};if(l.inject)for(let Ne in l.inject){let ot=l.inject[Ne],Ao=typeof ot=="function"?ot(h,n):ot;Ae[Ne]=Ao}e.push({component:(0,G.markRaw)(T),el:g,o:h.getFullId(),props:Ae})}};function $t(e,t,o,n,s,a){let l={reactive:!0,asynchronous:!0,usesWrapperElement:!1,update:(E,O,D,I)=>{},render:(E,O,D,I,T,g,M,Re)=>ro(n,E,O,D,I,T,g,M,Re),cleanupVertex:Ht,cleanupPort:Ht,rerender:(E,O,D,I,T,g,M,Re,Ae)=>{Ht(M.id,Ae),ro(n,E,O,D,I,T,g,M,Re)}},h=(0,c.extend)(s||{},{view:a||{},id:t});return(0,c.renderSurface)(e,o,l,h)}var L=require("@visuallyjs/browser-ui"),j=require("vue"),i=Symbol.for("visuallyjs-service"),R=class{constructor(t){this.context=t;this.s=[];this.i=[];this.a=[];this.l=[];this.surface=(0,j.shallowRef)(null);this.model=(0,j.shallowRef)(null);this.paper=(0,j.shallowRef)(null);this.diagram=(0,j.shallowRef)(null);this.ui=(0,j.shallowRef)(null)}getSurface(t){this.e(this.i,t,this.p)}getDiagram(t){this.e(this.a,t,this.c)}getPaper(t){this.e(this.l,t,this.u)}getModel(t){this.e(this.s,t,this.r)}getModelDirect(){return this.r}e(t,o,n){if(n!=null)try{o(n)}catch(s){(0,L.log)(`WARN: could not dispatch ${s}`)}else t.push(o)}setSurface(t){this.surface.value=t,this.model.value=t.model,this.ui.value=t,this.p=t,this.n(t.model),this.t(this.i,t)}setDiagram(t){this.diagram.value=t,this.model.value=t.model,this.ui.value=t.$ui,this.c=t,this.n(t.model),t.$ui instanceof L.Surface?this.setSurface(t.$ui):t.$ui instanceof L.Paper&&this.setPaper(t.$ui),this.t(this.a,t)}setPaper(t){this.paper.value=t,this.model.value=t.model,this.ui.value=t,this.u=t,this.n(t.model),this.t(this.l,t)}n(t){this.r=t,this.t(this.s,t)}t(t,o){t.forEach(n=>{try{n(o)}catch(s){(0,L.log)(`WARN: could not flush all queue entries ${s}`)}})}};var v=require("vue"),f=require("@visuallyjs/browser-ui"),Wt={setup(e){return{service:(0,v.inject)(i),surfaceId:e.surfaceId||rt}},name:le,props:{[b]:{type:Object},[ct]:{type:Object},[re]:{type:Object},[dt]:{type:Object},[ut]:{type:Object},[V]:{type:String},[y]:{type:String}},data:function(){return{vertices:[]}},mounted(){let e=this,t=this.model||new N(this.modelOptions||{}),o=this.$refs.root;e.url?t.load({url:e.url}):e.data&&t.load({data:e.data}),this.surface=$t(t,this.surfaceId,o,this.vertices,(0,f.clone)(this.renderOptions||{}),(0,f.clone)(this.viewOptions||{})),this.service.setSurface(this.surface);let n=(a,l)=>{let h=()=>{let O={};return l.originalData||l.updates?O=Object.assign(l.originalData,l.updates):l.newData&&Object.assign(O,l.newData),O},E=this.vertices.find(O=>O.o===a);E!=null&&(E.props.data=h())},s=a=>{let l=this.vertices.findIndex(h=>h.o===a);l!==-1&&this.vertices.splice(l,1)};t.bind(f.EVENT_NODE_UPDATED,a=>{n(a.vertex.getFullId(),a)}),t.bind(f.EVENT_GROUP_UPDATED,a=>{n(a.vertex.getFullId(),a)}),t.bind(f.EVENT_NODE_REMOVED,a=>{s(a.node.id)}),t.bind(f.EVENT_GROUP_REMOVED,a=>{s(a.group.id)}),this.surface.bind(f.EVENT_RENDER_END,()=>setTimeout(()=>this.surface.$redrawEveryConnection()))},render:function(){return(0,v.h)(f.ELEMENT_DIV,{ref:"root",class:"vjs-vue-surface",style:{width:"100%",height:"100%"}},this.vertices.map(e=>(0,v.h)(v.Teleport,{to:e.el,key:e.o},[(0,v.h)(e.component,e.props)])).concat(this.$slots.hasOwnProperty("default")?this.$slots.default():[]))}};var p=require("vue"),r=require("@visuallyjs/browser-ui"),Fo="Clear dataset?",zt="vjs-selected-mode",lo="can-undo",po="can-redo",ko="data-undo",Ho="data-redo",co="data-mode",$o="data-reset",Wo="data-clear",zo="data-zoom-in",Jo="data-zoom-out",uo="vjs-controls-has-selection",Jt={setup(e){return{service:(0,p.inject)(i)}},name:ce,props:{clear:{type:Boolean,default:!0},[y]:{type:String},undoRedo:{type:Boolean,default:!0},orientation:{type:String,default:"row"},zoomToExtents:{type:Boolean,default:!0},zoomButtons:{type:Boolean,default:!1},clearMessage:{type:String,default:Fo},onMaybeClear:{type:Function},className:{type:String,default:""}},methods:{panMode:function(){var e;(e=this.service.surface.value)==null||e.setMode(r.SURFACE_MODE_PAN)},selectMode:function(){var e;(e=this.service.surface.value)==null||e.setMode(r.SURFACE_MODE_SELECT)},zoomToFit:function(){var e;(e=this.service.surface.value)==null||e.zoomToFit()},doClear:function(){let e=this.service.surface.value;e&&(this.onMaybeClear!=null?this.onMaybeClear(()=>e.model.clear()):window.confirm(this.clearMessage)&&e.model.clear())},undo:function(){var e;(e=this.service.model.value)==null||e.undo()},redo:function(){var e;(e=this.service.model.value)==null||e.redo()},zoomIn:function(){var e;(e=this.service.surface.value)==null||e.zoomIn()},zoomOut:function(){var e;(e=this.service.surface.value)==null||e.zoomOut()},resetSelection(){let e=this.service.surface.value;e&&(e.model.clearSelection(),(0,r.supportsPathEditing)(e)&&e.stopEditingPath())},updateSelectionState:function(){let e=this.service.surface.value;e&&(e.model.getSelection().isEmpty()?this.$refs.root.removeAttribute(uo):this.$refs.root.setAttribute(uo,"true"))}},data:function(){return{ready:!1,hasLasso:!1}},render(){if(this.ready){let e=[];return this.showPan&&(e.push((0,p.h)("i",{class:`vjs-pan-mode ${zt}`,[co]:r.SURFACE_MODE_PAN,onClick:()=>this.panMode(),title:"Pan mode"},[(0,p.h)("svg",{viewBox:r.PAN_VIEW_BOX,stroke:"currentColor",fill:"none"},[(0,p.h)("path",{d:r.PAN_PATH})])])),e.push((0,p.h)("i",{class:"vjs-select-mode",[co]:r.SURFACE_MODE_SELECT,onClick:()=>this.selectMode(),title:"Select mode"},[(0,p.h)("svg",{viewBox:r.LASSO_VIEW_BOX,stroke:"currentColor",fill:"currentColor"},[(0,p.h)("path",{d:r.LASSO_PATH})])]))),this.undoRedo&&(e.push((0,p.h)("i",{class:"vjs-undo",[ko]:!0,title:"Undo last action",onClick:()=>this.undo()})),e.push((0,p.h)("i",{class:"vjs-redo",[Ho]:!0,title:"Redo last action",onClick:()=>this.redo()}))),this.zoomToExtents&&e.push((0,p.h)("i",{class:"vjs-zoom-to-fit",[$o]:"true",onClick:()=>this.zoomToFit(),title:"Zoom to Fit"},[(0,p.h)("svg",{viewBox:r.ZOOM_TO_FIT_VIEW_BOX,stroke:"currentColor",fill:"currentColor"},[(0,p.h)("path",{d:r.ZOOM_TO_FIT_PATH})])])),this.zoomButtons&&(e.push((0,p.h)("i",{class:"vjs-zoom-in",[zo]:"true",onClick:()=>this.zoomIn(),title:"Zoom In"},[(0,p.h)("svg",{viewBox:r.ZOOM_IN_OUT_VIEW_BOX,stroke:"currentColor",fill:"currentColor"},[(0,p.h)("path",{d:r.ZOOM_IN_PATH})])])),e.push((0,p.h)("i",{class:"vjs-zoom-out",[Jo]:"true",onClick:()=>this.zoomOut(),title:"Zoom Out"},[(0,p.h)("svg",{viewBox:r.ZOOM_IN_OUT_VIEW_BOX,stroke:"currentColor",fill:"currentColor"},[(0,p.h)("path",{d:r.ZOOM_OUT_PATH})])]))),e.push((0,p.h)("i",{class:r.CLASS_CONTROLS_RESET_SELECTION,[r.ATTRIBUTE_RESET_SELECTION]:"true",onClick:()=>{this.resetSelection()}},[(0,p.h)("svg",{viewBox:r.RESET_SELECTION_VIEW_BOX,stroke:"currentColor",fill:"currentColor"},[(0,p.h)("path",{d:r.RESET_SELECTION_PATH})])])),this.clear&&e.push((0,p.h)("i",{class:"vjs-clear-dataset",[Wo]:"true",onClick:()=>{this.doClear()}},[(0,p.h)("svg",{viewBox:r.CLEAR_VIEW_BOX,stroke:"currentColor",fill:"currentColor"},[(0,p.h)("path",{d:r.CLEAR_PATH})])])),(0,p.h)(r.ELEMENT_DIV,{class:`vjs-controls ${this.className}`,ref:"root",[lo]:!1,[po]:!1,[r.ATTRIBUTE_CONTROLS_ORIENTATION]:this.orientation},e)}else return(0,p.h)(r.ELEMENT_DIV,{ref:"root"})},mounted(){let e=t=>{let o=t.getPlugin(r.LassoPlugin.type);this.showPan=o!=null,t.bind(r.EVENT_SURFACE_MODE_CHANGED,n=>{t.removeClass(t.$getSelector(this.$refs.root,"[data-mode]"),zt),t.addClass(t.$getSelector(this.$refs.root,"[data-mode='"+n+"']"),zt)}),t.model.bind(r.EVENT_UNDOREDO_UPDATE,n=>{this.$refs.root.setAttribute(lo,n.undoCount>0?r.TRUE:r.FALSE),this.$refs.root.setAttribute(po,n.redoCount>0?r.TRUE:r.FALSE)}),t.model.bind(r.EVENT_SELECT,()=>this.updateSelectionState()),t.model.bind(r.EVENT_DESELECT,()=>this.updateSelectionState()),t.model.bind(r.EVENT_SELECTION_CLEARED,()=>this.updateSelectionState()),this.ready=!0};this.service.surface.value==null?(0,p.watch)(this.service.surface,e):e(this.service.surface.value)}};var C=require("vue"),m=require("@visuallyjs/browser-ui"),Kt={name:ue,setup(e){return{service:(0,C.inject)(i)}},props:{surfaceId:{type:String},showLabel:{type:Boolean,default:!0},label:{type:String,default:"Export :"},margins:{type:Object},svgOptions:{type:Object},imageOptions:{type:Object},allowSvgExport:{type:Boolean,default:!0},allowPngExport:{type:Boolean,default:!0},allowJpgExport:{type:Boolean,default:!0}},methods:{loadSurface:function(e){let t=this.service.surface.value;t&&e(t)},exportSVG:function(){this.loadSurface(e=>{let t=this.svgOptions||{};this.margins!=null&&t.margins==null&&Object.assign(t,this.margins),new m.SvgExportUI(e).export(t)})},exportJPG:function(){this.loadSurface(e=>{let t=this.imageOptions||{};this.margins!=null&&t.margins==null&&Object.assign(t,this.margins),t.type="image/jpeg",new m.ImageExportUI(e).export(t)})},exportPNG:function(){this.loadSurface(e=>{let t=this.imageOptions||{};this.margins!=null&&t.margins==null&&Object.assign(t,this.margins),new m.ImageExportUI(e).export(t)})}},render(){let e=this.showLabel!==!1,t=this.allowSvgExport!==!1,o=this.allowPngExport!==!1,n=this.allowJpgExport!==!1,s=[];return t&&s.push((0,C.h)("i",{},[(0,C.h)("a",{href:"#","data-type":m.TYPE_SVG,onClick:()=>this.exportSVG()},"SVG")])),o&&s.push((0,C.h)("i",{},[(0,C.h)("a",{href:"#","data-type":m.TYPE_PNG,onClick:()=>this.exportPNG()},"PNG")])),n&&s.push((0,C.h)("i",{},[(0,C.h)("a",{href:"#","data-type":m.TYPE_JPG,onClick:()=>this.exportJPG()},"JPG")])),e&&s.unshift((0,C.h)("span",{},[this.label])),(0,C.h)(m.ELEMENT_DIV,{class:`${m.CLASS_CONTROLS} ${m.CLASS_EXPORT_CONTROLS}`},s)}};var F=require("vue"),Me=require("@visuallyjs/browser-ui"),Xt={setup(e){return{service:(0,F.inject)(i)}},name:ae,props:{[y]:{type:String},[w]:{type:String,default:""},[at]:{type:Boolean,default:!0},[st]:{type:Boolean,default:!0},[it]:{type:Boolean,default:!0},[lt]:{type:Boolean,default:!0},[nt]:{type:Function}},mounted:function(){let e=t=>{t.addPlugin({type:Me.MiniviewPlugin.type,options:{container:this.$el,activeTracking:this.activeTracking,clickToCenter:this.clickToCenter,showLasso:this.showLasso,trackSelection:this.trackSelection,typeFunction:this.typeFunction}})};this.service.surface.value!=null?e(this.service.surface.value):(0,F.watch)(this.service.surface,e)},render:function(e){return(0,F.h)(Me.ELEMENT_DIV,{ref:"root",class:e.className})}};var k=require("vue"),we=require("@visuallyjs/browser-ui"),Yt={setup(e){return{service:(0,k.inject)(i)}},name:de,props:{[b]:{type:Object},[V]:{type:String},[re]:{type:Object},[U]:{type:Object}},mounted(){let e=this.$refs.root;this.diagram=(0,k.markRaw)((0,we.createDiagram)(e,this.options,this.modelOptions)),this.service.setDiagram(this.diagram),this.data?this.diagram.load({data:this.data}):this.url&&this.diagram.load({url:this.url})},render:function(){return(0,k.h)(we.ELEMENT_DIV,{ref:"root",class:"vjs-vue-surface",style:{width:"100%",height:"100%"}},this.$slots.hasOwnProperty("default")?this.$slots.default():[])}};var x=require("vue"),u=require("@visuallyjs/browser-ui"),mo={[w]:{type:String},[b]:{type:Object},[V]:{type:String},[Pt]:{type:Boolean,default:!1}},ho={setup(){return{service:(0,x.inject)(i)}},render:function(){return(0,x.h)(u.ELEMENT_DIV,{class:`${this.className}`,ref:"root"})}};function A(e,t,o=!0){let n=oe(te({},mo),{[U]:{type:Object}}),s={};return o&&(n[De]={type:Function},s[De]=function(a){this.chart.setDataSourceFilter(a)}),oe(te({},ho),{name:e,props:n,watch:s,data:()=>({hasMounted:!1}),mounted(){let a=this.$refs.root,l=o?Object.assign({dataSourceFilter:this.dataSourceFilter},this.options):this.options;this.data&&(l.data=this.data),this.url&&(l.url=this.url);let h=()=>{this.hasMounted=!0,this.chart=new t(a,l)};this.useModel?this.service.model.value!=null?(l.dataSource=this.service.model.value,h()):(0,x.watch)(this.service.model,E=>{this.hasMounted||(l.dataSource=E,h())}):h()}})}var be=A(he,u.ColumnChart),Ve=A(fe,u.BarChart),Le=A(Oe,u.CategoryValueChart,!1),Be=A(Ce,u.PieChart),Ue=A(Pe,u.LineChart),Ge=A(Ee,u.AreaChart),je=A(Se,u.ScatterChart),Fe=A(_e,u.BubbleChart),ke=A(Te,u.GaugeChart,!1),He=oe(te({},ho),{name:ge,props:oe(te({},mo),{[ft]:{type:String},[Ot]:{type:Object},[mt]:{type:Boolean},[ht]:{type:String},[U]:{type:Object}}),data:()=>({hasMounted:!1}),mounted(){let e=this.$refs.root,t=Object.assign({},this.options);this.interactive!=null&&(t.interactive=this.interactive),this.pivot!=null&&(t.pivot=this.pivot),this.csvData&&(t.csvData=this.csvData),this.jsonData&&(t.jsonData=this.jsonData),this.url&&(t.url=this.url);let o=()=>{this.hasMounted=!1,this.chart=new u.SankeyChart(e,t)};if(this.useModel){let n=s=>{this.hasMounted||(t.dataSource=s,o())};this.service.model.value==null?(0,x.watch)(this.service.model,n):n(this.service.model.value)}else o()},watch:{pivot(e){this.chart&&this.chart.pivot(e)}},render:function(){return(0,x.h)(u.ELEMENT_DIV,{class:`${this.className}`,ref:"root"})}});var H=require("vue"),$=require("@visuallyjs/browser-ui"),Zt={setup(e){return{service:(0,H.inject)(i)}},name:pe,props:{[y]:{type:String},[Et]:{type:String},[Ct]:{type:Function},[St]:{type:Function},[_t]:{type:Function},[Tt]:{type:Boolean,default:!1},[gt]:{type:Boolean,default:!0},[yt]:{type:Boolean,default:!0},[Rt]:{type:Boolean,default:!1},[At]:{type:Boolean,default:!1},[It]:Object,[Nt]:Function,[Mt]:Function,[w]:String,[pt]:String,[vt]:{type:Boolean,default:!1},[Dt]:{type:Boolean,default:!1},[xt]:{type:Boolean,default:!1}},mounted:function(){let e=t=>{let o={source:this.$refs.root,selector:this.selector,dataGenerator:n=>this.dataGenerator?this.dataGenerator(n):(0,$.defaultDataGenerator)(n),allowDropOnEdge:this.allowDropOnEdge===!0,allowDropOnGroup:this.allowDropOnGroup!==!1,allowDropOnCanvas:this.allowDropOnCanvas!==!1,allowDropOnNode:this.allowDropOnNode===!0,ignoreDropOnNode:this.ignoreDropOnNode===!0,canvasDropFilter:this.canvasDropFilter,onVertexAdded:this.onVertexAdded,dragSize:this.dragSize,mode:this.mode};this.groupIdentifier!=null&&(o.groupIdentifier=this.groupIdentifier),this.typeGenerator!=null&&(o.typeGenerator=this.typeGenerator),this.palette=new $.Palette(t,o)};this.service.surface.value==null?(0,H.watch)(this.service.surface,e):e(this.service.surface.value)},render:function(){return(0,H.h)($.ELEMENT_DIV,{ref:"root",class:this.className||""},this.$slots.hasOwnProperty("default")?this.$slots.default():[])}};var fo=require("vue"),$e={setup(){(0,fo.provide)(i,new R("SurfaceProvider"))},render(){return this.$slots.hasOwnProperty("default")?this.$slots.default():[]}};var W=require("vue"),S=require("@visuallyjs/browser-ui"),We={name:ne,props:{data:{type:Object},showLabels:{type:Boolean,default:!1},labelProperty:{type:String,default:"label"},labelStrokeWidth:{type:Number},multilineLabels:{type:Boolean,default:!0},labelFillRatio:{type:Number,default:S.DEFAULT_LABEL_FILL_RATIO},labelColor:{type:String,default:"#000000"},font:{type:Object}},setup(){return{service:(0,W.inject)(i)}},mounted(){let e=t=>{let o=t.getShapeLibrary(),n=o.renderCompiledShape(Object.assign({sw:this.getOutlineWidth()},this.data));if(this.$refs.container.appendChild(n),this.showLabels){let s=o.renderShapeLabel(this.data,this.labelProperty,this.labelStrokeWidth,null,this.labelColor,this.labelColor,this.font);this.$refs.container.appendChild(s),this.multilineLabels!=!1&&(0,S.convertToMultilineText)(s,this.data[this.labelProperty]||"",this.getWidth()*(this.labelFillRatio||S.DEFAULT_LABEL_FILL_RATIO))}};this.service.ui.value==null?(0,W.watch)(this.service.ui,e):e(this.service.ui.value)},updated(){let e=this.service.surface.value;if(e){let t=e.getShapeLibrary(),o=t.renderCompiledShape(Object.assign({sw:this.getOutlineWidth()},this.data));if(this.$refs.container.replaceChildren(o),this.showLabels){let n=t.renderShapeLabel(this.data,this.labelProperty,this.labelStrokeWidth,null,this.labelColor,this.labelColor,this.font);this.$refs.container.appendChild(n),this.multilineLabels!=!1&&(0,S.convertToMultilineText)(n,this.data[this.labelProperty]||"",this.getWidth()*(this.labelFillRatio||S.DEFAULT_LABEL_FILL_RATIO))}}},render:function(){return(0,W.h)(S.ELEMENT_SVG,{ref:"container",preserveAspectRatio:"none",fill:this.getFill(),stroke:this.getOutline(),"stroke-width":this.getOutlineWidth(),viewBox:"0 0 "+this.getWidth()+" "+this.getHeight(),class:S.CLASS_SHAPE})},methods:{getWidth:function(){return this.data.width||wt},getHeight:function(){return this.data.height||bt},getFill:function(){return this.data.fill||"#FFFFFF"},getOutline:function(){return this.data.outline||"#000000"},getOutlineWidth(){return this.data.outlineWidth||2}}};var z=require("vue"),ze=require("@visuallyjs/browser-ui"),Je={name:se,props:{surfaceId:{type:String},dragSize:Object,iconSize:Object,fill:String,outline:String,showAllMessage:String,selectAfterDrop:Boolean,paletteStrokeWidth:Number,dataGenerator:Function,initialSet:String,mode:String,allowClickToAdd:Boolean,onVertexAdded:Function,showLabels:Boolean,inspector:{type:Boolean,default:!0},preparedShapes:Array},setup(e){return{service:(0,z.inject)(i)}},data:()=>({hasMounted:!1}),mounted(){let e=t=>{this.hasMounted||(this.hasMounted=!0,new ze.ShapePalette(t,{container:this.$refs.container,shapeLibrary:t.getShapeLibrary(),dragSize:this.dragSize,iconSize:this.iconSize,fill:this.fill,outline:this.outline,showAllMessage:this.showAllMessage,selectAfterDrop:this.selectAfterDrop,paletteStrokeWidth:this.paletteStrokeWidth,dataGenerator:this.dataGenerator,initialSet:this.initialSet,mode:this.mode,allowClickToAdd:this.allowClickToAdd,onVertexAdded:this.onVertexAdded,showLabels:this.showLabels,inspector:this.inspector,preparedShapes:this.preparedShapes}))};this.service.surface.value==null?(0,z.watch)(this.service.surface,e):e(this.service.surface.value)},render:function(){return(0,z.h)(ze.ELEMENT_DIV,{ref:"container"})}};var _=require("vue"),J=require("@visuallyjs/browser-ui"),K=Symbol.for("VueInspectorGetter"),Oo=Symbol.for("VueInspectorSetter");function Po(){let e=[],t=null;function o(a){try{a(t)}catch(l){(0,J.log)("WARN: inspector listener threw an exception",l)}}let n={listen:a=>{t!=null?o(a):e.push(a)}},s={inspector:a=>{t=a,e.forEach(o)}};return(0,_.provide)(Oo,s),(0,_.provide)(K,(0,_.readonly)(n)),s}var Ke={name:ye,props:{autoCommit:{type:Boolean,default:!0},multipleSelections:{type:Boolean,default:!0},filter:Function,renderEmptyContainer:Function,refresh:Function,className:String,showCloseButton:Boolean,afterUpdate:Function,modelValue:Object},emits:["update:modelValue"],setup(e,t){let o=Po();return{service:(0,_.inject)(i),inspectorProvider:o,inspector:null,emit:t.emit}},mounted(){let e=t=>{if(this.inspector==null){let o=new J.Inspector({container:this.$refs.root,ui:t,renderEmptyContainer:()=>(this.emit("update:modelValue",null),this.renderEmptyContainer?this.renderEmptyContainer():""),refresh:(n,s)=>{this.emit("update:modelValue",n),this.refresh&&this.refresh(n),setTimeout(s)},autoCommit:this.autoCommit,multipleSelections:this.multipleSelections,filter:this.filter,showCloseButton:this.showCloseButton,afterUpdate:()=>this.afterUpdate?this.afterUpdate(t):null});this.inspectorProvider.inspector(o)}};this.service.surface.value==null?(0,_.watch)(this.service.surface,e):e(this.service.surface.value)},render(){return(0,_.h)(J.ELEMENT_DIV,{ref:"root"},this.$slots.hasOwnProperty("default")?this.$slots.default():[])}};var Xe=require("vue"),X=require("@visuallyjs/browser-ui"),Ye={name:ie,props:{propertyName:String},setup(){return{inspectorProvider:(0,Xe.inject)(K)}},mounted(){this.inspectorProvider?this.inspectorProvider.listen(e=>{let t=new X.EdgeTypePicker(e.$ui,this.$refs.container,e.$ui.$getEdgePropertyMappings(),e.getValue(this.propertyName),(o,n)=>{e.setValue(this.propertyName,n)});t.render(this.propertyName,e.m),e.onChange(()=>{t.select(this.propertyName,e.getValue(this.propertyName))})}):(0,X.log)("WARN: EdgeTypePicker not instantiated inside an InspectorComponent. Cannot mount.")},render:function(){return(0,Xe.h)(X.ELEMENT_DIV,{ref:"container"})}};var B=require("vue"),d=require("@visuallyjs/browser-ui"),qt={render(){let e=this.swatches.map(t=>(0,B.h)(d.ELEMENT_DIV,{title:t,class:d.CLASS_COLOR_PICKER_SWATCH,style:`background-color:${t}`,"data-color":t,onClick:()=>this.selectSwatch(t)}));return(0,B.h)(d.ELEMENT_DIV,{class:`${d.CLASS_COLOR_PICKER}`},[(0,B.h)("input",{type:"color","vjs-att":this.propertyName,ref:"colorInput"}),(0,B.h)(d.ELEMENT_DIV,{class:d.CLASS_COLOR_PICKER_SWATCHES},e)])},props:{propertyName:String,maxColors:{type:Number,default:10}},data:()=>({CLASS_COLOR_PICKER:d.CLASS_COLOR_PICKER,CLASS_COLOR_PICKER_SWATCHES:d.CLASS_COLOR_PICKER_SWATCHES,CLASS_COLOR_PICKER_SWATCH:d.CLASS_COLOR_PICKER_SWATCH,colorInput:null,swatches:[]}),mounted(){let e=(0,B.inject)(K);e&&e.listen(t=>{this.inspector=t,this.swatches=t.ensureContext(d.INSPECTOR_CONTEXT_RECENT_COLORS,()=>[]),this.colorInput=this.$refs.colorInput,this.colorInput.addEventListener("change",this.colorPicked),t.bind(d.EVENT_CONTEXT_UPDATE,o=>{o.key===d.INSPECTOR_CONTEXT_RECENT_COLORS&&(this.swatches=o.value.slice())}),t.bind("change",this.setCurrentColor),this.setCurrentColor()})},methods:{addColor:function(e){let t=this.inspector.ensureContext(d.INSPECTOR_CONTEXT_RECENT_COLORS,()=>[]);if(e=e.toUpperCase(),!(t.find(n=>n.toUpperCase()===e)!=null)){let n=this.maxColors||10,s=t.slice();s.unshift(e),s.length>n&&(s.length=n),this.inspector.updateContext(d.INSPECTOR_CONTEXT_RECENT_COLORS,s)}},colorPicked:function(){let e=this.colorInput.value;this.inspector.setValue(this.propertyName,e),this.addColor(e)},selectSwatch:function(e){this.inspector.setValue(this.propertyName,e),this.colorInput.value=e},setCurrentColor:function(){let e=this.inspector.getValue(this.propertyName);e!=null&&(this.colorInput.value=e,this.addColor(e))}}};var P=require("vue"),Y=require("@visuallyjs/browser-ui"),Ze={props:{placement:{type:String,default:"floating"},position:{type:Object},constraints:{type:Object}},data:()=>({hasMounted:!1,surface:null}),setup(e){return{service:(0,P.inject)(i)}},mounted(){let e=t=>{if(!this.hasMounted){this.surface=t,this.hasMounted=!0;let o=this.position||{x:0,y:0};(0,P.nextTick)().then(()=>{this.placement==="floating"?t.floatElement(this.$refs.root,o):t.fixElement(this.$refs.fixedEl,o,this.constraints)})}};this.service.surface.value==null?(0,P.watch)(this.service.surface,e):e(this.service.surface.value)},render(){return(0,P.h)(Y.ELEMENT_DIV,{ref:"root"},this.hasMounted?this.placement==="floating"?(0,P.h)(Y.ELEMENT_DIV,{},this.$slots.hasOwnProperty("default")?this.$slots.default():[]):(0,P.h)(P.Teleport,{to:this.surface.vertexLayer,key:(0,Y.uuid)()},(0,P.h)(Y.ELEMENT_DIV,{ref:"fixedEl"},this.$slots.hasOwnProperty("default")?this.$slots.default():[])):[])}};var Eo=require("vue"),qe={setup(){(0,Eo.provide)(i,new R("DiagramProvider"))},render(){return this.$slots.hasOwnProperty("default")?this.$slots.default():[]}};var Z=require("vue"),q=require("@visuallyjs/browser-ui"),Qe={name:me,props:{fill:String,outline:String,dragSize:Object,inspector:{type:Boolean,default:!0},iconSize:Object,showLabels:Boolean,paletteStrokeWidth:Number,showAllMessage:String,onCellAdded:Function,mode:String,allowClickToAdd:Boolean,autoExitDrawMode:Boolean,selectAfterAdd:{type:Boolean,default:!0},className:String,diagram:{type:Object},onVertexAdded:Function,preparedShapes:Array},setup(e){return{service:(0,Z.inject)(i)}},data:()=>({hasMounted:!1}),mounted(){if(this.service==null&&this.diagram==null)(0,q.log)("Cannot mount DiagramPalette - no service found and Diagram not passed in as a prop");else{let e=t=>{this.hasMounted||(this.hasMounted=!0,new q.DiagramPalette(this.$refs.container,t,{fill:this.fill,outline:this.outline,dragSize:this.dragSize,inspector:this.inspector,iconSize:this.iconSize,showLabels:this.showLabels,paletteStrokeWidth:this.paletteStrokeWidth,showAllMessage:this.showAllMessage,onCellAdded:this.onCellAdded,mode:this.mode,allowClickToAdd:this.allowClickToAdd,autoExitDrawMode:this.autoExitDrawMode,selectAfterAdd:this.selectAfterAdd,onVertexAdded:this.onVertexAdded,preparedShapes:this.preparedShapes}))};this.diagram?e(this.diagram):this.service.diagram.value!=null?e(this.service.diagram.value):(0,Z.watch)(this.service.diagram,e)}},render:function(){return(0,Z.h)(q.ELEMENT_DIV,{ref:"container"})}};var Ko={install:function(e,t){e.component(Ut,$e),e.component(Gt,qe),e.component(le,Wt),e.component(de,Yt),e.component(ae,Xt),e.component(ce,Jt),e.component(ue,Kt),e.component(pe,Zt),e.component(me,Qe),e.component(fe,Ve),e.component(he,be),e.component(Oe,Le),e.component(Pe,Ue),e.component(Ee,Ge),e.component(Ce,Be),e.component(ge,He),e.component(Te,ke),e.component(_e,Fe),e.component(Se,je),e.component(ne,We),e.component(se,Je),e.component(ie,Ye),e.component(Vt,qt),e.component(ye,Ke),e.component(jt,Ze),e.provide(i,new R("root"))}};var Q=require("vue"),et=require("@visuallyjs/browser-ui"),Co=require("vue");function Xo(){let e=(0,Co.inject)(i),t=(0,Q.shallowRef)(null),o=(0,Q.shallowRef)(null),n=(0,Q.shallowRef)(null),s=(0,Q.ref)(1);return e==null||e.getSurface(a=>{o.value=a,o.value.bind(et.EVENT_ZOOM,l=>{s.value=l.zoom})}),e==null||e.getDiagram(a=>{t.value=a,t.value.$ui.bind(et.EVENT_ZOOM,l=>{s.value=l.zoom})}),e==null||e.getPaper(a=>{n.value=a,n.value.bind(et.EVENT_ZOOM,l=>{s.value=l.zoom})}),s}var tt=require("vue"),ee=require("@visuallyjs/browser-ui");function Yo(e){let t=(0,tt.inject)(i);if(t){let o=null,n=()=>{o&&e(o)},s=()=>{o&&(o.unbind(ee.EVENT_DATA_UPDATED,n),o.unbind(ee.EVENT_GRAPH_CLEARED,n))},a=l=>{s(),o=l,o&&(o.bind(ee.EVENT_DATA_UPDATED,n),o.bind(ee.EVENT_GRAPH_CLEARED,n),n())};t.getModel(l=>{a(l)}),(0,tt.onUnmounted)(()=>{s()})}}var So=require("vue"),_o=require("vue");function Zo(){let e=(0,_o.inject)(i),t=(0,So.shallowRef)(null);return e==null||e.getSurface(o=>{t.value=o}),t}var To=require("vue"),go=require("vue");function qo(){let e=(0,go.inject)(i),t=(0,To.shallowRef)(null);return e==null||e.getDiagram(o=>{t.value=o}),t}var yo=require("vue"),Ro=require("vue");function Qo(){let e=(0,Ro.inject)(i),t=(0,yo.shallowRef)(null);return e==null||e.getPaper(o=>{t.value=o}),t}
1
+ var Be=Object.defineProperty,Ho=Object.defineProperties,Wo=Object.getOwnPropertyDescriptor,zo=Object.getOwnPropertyDescriptors,Jo=Object.getOwnPropertyNames,Oo=Object.getOwnPropertySymbols;var Co=Object.prototype.hasOwnProperty,Ko=Object.prototype.propertyIsEnumerable;var Eo=(e,t,o)=>t in e?Be(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,F=(e,t)=>{for(var o in t||(t={}))Co.call(t,o)&&Eo(e,o,t[o]);if(Oo)for(var o of Oo(t))Ko.call(t,o)&&Eo(e,o,t[o]);return e},ce=(e,t)=>Ho(e,zo(t));var Yo=(e,t)=>{for(var o in t)Be(e,o,{get:t[o],enumerable:!0})},Xo=(e,t,o,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Jo(t))!Co.call(e,i)&&i!==o&&Be(e,i,{get:()=>t[i],enumerable:!(n=Wo(t,i))||n.enumerable});return e};var Zo=e=>Xo(Be({},"__esModule",{value:!0}),e);var Or={};Yo(Or,{$initialiseVueOverlays:()=>Le,AreaChartComponent:()=>Xe,BarChartComponent:()=>ze,BaseGroupComponent:()=>go,BaseNodeComponent:()=>To,BaseOverlayComponent:()=>no,BrowserUIVueModel:()=>A,BubbleChartComponent:()=>qe,CLASS_VUE_GROUP:()=>Yt,CLASS_VUE_NODE:()=>Kt,CLASS_VUE_OVERLAY:()=>Xt,COMPONENT_AREA_CHART:()=>xe,COMPONENT_BAR_CHART:()=>ve,COMPONENT_BUBBLE_CHART:()=>we,COMPONENT_COLUMN_CHART:()=>Re,COMPONENT_CONTROLS:()=>Se,COMPONENT_DIAGRAM:()=>Te,COMPONENT_DIAGRAM_PALETTE:()=>ge,COMPONENT_DIAGRAM_PROVIDER:()=>Qt,COMPONENT_EXPORT_CONTROLS:()=>ye,COMPONENT_GAUGE_CHART:()=>Ve,COMPONENT_INSPECTOR:()=>be,COMPONENT_LINE_CHART:()=>Ne,COMPONENT_MINIVIEW:()=>Oe,COMPONENT_PALETTE:()=>_e,COMPONENT_PAPER:()=>Ce,COMPONENT_PAPER_PROVIDER:()=>qt,COMPONENT_PIE_CHART:()=>De,COMPONENT_SANKEY_CHART:()=>Me,COMPONENT_SCATTER_CHART:()=>Ie,COMPONENT_SURFACE:()=>Ee,COMPONENT_SURFACE_POPUP:()=>eo,COMPONENT_SURFACE_PROVIDER:()=>Zt,COMPONENT_XY_CHART:()=>Ae,ColorPickerComponent:()=>Po,ColumnChartComponent:()=>We,ControlsComponent:()=>co,DEFAULT_SHAPE_HEIGHT:()=>zt,DEFAULT_SHAPE_WIDTH:()=>Wt,DEFAULT_VUE_PAPER_ID:()=>Ot,DEFAULT_VUE_SURFACE_ID:()=>Pt,DecoratorComponent:()=>pt,DiagramComponent:()=>ho,DiagramPaletteComponent:()=>ut,DiagramProvider:()=>ct,EVENT_VERTEX_UPDATED:()=>yo,EVENT_VERTICES_RENDERED:()=>So,EdgeTypePickerComponent:()=>lt,ExportControlsComponent:()=>uo,GaugeChartComponent:()=>Qe,InspectorComponent:()=>it,InspectorGetterSymbol:()=>re,InspectorSetterSymbol:()=>Vo,LineChartComponent:()=>Ye,MiniviewComponent:()=>mo,PROP_ACTIVE_TRACKING:()=>St,PROP_ALLOW_CLICK_TO_ADD:()=>kt,PROP_ALLOW_DROP_ON_CANVAS:()=>bt,PROP_ALLOW_DROP_ON_EDGE:()=>Mt,PROP_ALLOW_DROP_ON_GROUP:()=>Lt,PROP_ALLOW_DROP_ON_NODE:()=>Ut,PROP_CANVAS_DROP_FILTER:()=>Ht,PROP_CLASS_NAME:()=>k,PROP_CLICK_TO_ADD_ONLY:()=>Ft,PROP_CLICK_TO_CENTER:()=>Ct,PROP_CSV_DATA:()=>At,PROP_DATA:()=>L,PROP_DATA_GENERATOR:()=>It,PROP_DATA_SOURCE_FILTER:()=>Ge,PROP_DRAG_SIZE:()=>$t,PROP_GROUP_IDENTIFIER:()=>Vt,PROP_ID:()=>Qo,PROP_IGNORE_DROP_ON_NODE:()=>Bt,PROP_INTERACTIVE:()=>Rt,PROP_JSON_DATA:()=>Nt,PROP_MODE:()=>gt,PROP_MODEL:()=>de,PROP_MODEL_OPTIONS:()=>$,PROP_ON_VERTEX_ADDED:()=>jt,PROP_OPTIONS:()=>J,PROP_PAPER_ID:()=>Tt,PROP_PIVOT:()=>vt,PROP_RENDER_OPTIONS:()=>ue,PROP_SELECTOR:()=>Dt,PROP_SELECT_AFTER_ADD:()=>Gt,PROP_SHOW_LASSO:()=>_t,PROP_SURFACE_ID:()=>b,PROP_TRACK_SELECTION:()=>yt,PROP_TYPE_FUNCTION:()=>Et,PROP_TYPE_GENERATOR:()=>wt,PROP_URL:()=>U,PROP_USE_MODEL:()=>xt,PROP_VIEW_OPTIONS:()=>me,PaletteComponent:()=>fo,PaperComponent:()=>lo,PaperProvider:()=>ot,PieChartComponent:()=>Ke,SankeyChartComponent:()=>et,ScatterChartComponent:()=>Ze,ShapeComponent:()=>rt,ShapePaletteComponent:()=>st,SurfaceComponent:()=>ao,SurfacePopup:()=>dt,SurfaceProvider:()=>tt,TAG_COLOR_PICKER:()=>Jt,TAG_DECORATOR:()=>to,TAG_EDGE_TYPE_PICKER:()=>Pe,TAG_SHAPE:()=>he,TAG_SHAPE_PALETTE:()=>fe,VisuallyJsPlugin:()=>ur,VisuallyJsService:()=>N,VisuallyJsServiceKey:()=>l,XYChartComponent:()=>Je,addPaper:()=>io,addSurface:()=>so,bindToDevLifecycle:()=>rr,doProvideInspector:()=>Mo,newInstance:()=>qo,useDiagram:()=>fr,usePaper:()=>Pr,useSurface:()=>hr,useVisuallyJsUpdate:()=>mr,useZoom:()=>dr});module.exports=Zo(Or);var je=require("@visuallyjs/browser-ui"),A=class extends je.BrowserUIModel{render(t,o){return(0,je.log)("render called directly on BrowserUiVue class: should not happen. Surface component should use internal render."),null}};function qo(e){return e=e||{},new A(e)}var Pt="surfaceId",Ot="paperId",Et="typeFunction",Ct="clickToCenter",_t="showLasso",St="activeTracking",yt="trackSelection",b="surfaceId",Tt="paperId",k="className",L="data",gt="mode",J="options",ue="renderOptions",$="modelOptions",de="model",me="viewOptions",U="url",Rt="interactive",vt="pivot",Ge="dataSourceFilter",At="csvData",Nt="jsonData",xt="useModel",Qo="id",Dt="selector",It="dataGenerator",wt="typeGenerator",Vt="groupIdentifier",Mt="allowDropOnEdge",bt="allowDropOnCanvas",Lt="allowDropOnGroup",Ut="allowDropOnNode",Bt="ignoreDropOnNode",jt="onVertexAdded",Gt="selectAfterAdd",Ft="clickToAddOnly",kt="allowClickToAdd",$t="dragSize",Ht="canvasDropFilter",he="Shape",fe="ShapePalette",Wt=120,zt=90,Pe="EdgeTypePickerComponent",Jt="ColorPickerComponent",Kt="vjs-vue-node",Yt="vjs-vue-group",Xt="vjs-vue-overlay",Oe="MiniviewComponent",Ee="SurfaceComponent",Zt="SurfaceProvider",Ce="PaperComponent",qt="PaperProvider",Qt="DiagramProvider",_e="PaletteComponent",Se="ControlsComponent",ye="ExportControlsComponent",Te="DiagramComponent",ge="DiagramPaletteComponent",Re="ColumnChartComponent",ve="BarChartComponent",Ae="XYChartComponent",Ne="LineChartComponent",xe="AreaChartComponent",De="PieChartComponent",Ie="ScatterChartComponent",we="BubbleChartComponent",Ve="GaugeChartComponent",Me="SankeyChartComponent",be="InspectorComponent",eo="SurfacePopup",to="Decorator";var M=require("vue"),u=require("@visuallyjs/browser-ui"),oo=class{constructor(){this.unrenderedVertices=new Map;this.eventManager=new u.OptimisticEventGenerator}vertexWillRender(t){this.unrenderedVertices.set(t.id,t)}vertexHasRendered(t){this.unrenderedVertices.delete(t.id),this.unrenderedVertices.size===0&&this.eventManager.fire(So)}vertexHasUpdated(t){this.eventManager.fire(yo,t)}},So="vertices:rendered",yo="vertex:updated",ro=new Map;function Fe(e){return ro.has(e)||ro.set(e,new oo),ro.get(e)}function er(e,t){Fe(e).vertexHasRendered(t)}function tr(e,t){Fe(e).vertexHasUpdated(t)}function or(e,t){Fe(e).vertexWillRender(t)}function rr(e,t,o){Fe(e).eventManager.bind(t,o)}var _o={props:{data:Object,model:A,obj:u.Vertex,vertex:u.Vertex,ui:u.BrowserUI,el:Element,def:Object,eventInfo:Object},mounted(){let e=this,t=(0,u.isGroup)(e.obj)?Yt:Kt;e.el.firstElementChild&&(0,u.addClass)(e.el.firstElementChild,t),e.ui.$vertexRendered(e.obj,e.el,e.def,e.eventInfo),er(e.ui.id,e.obj)},methods:{getModel:function(){return this.model},removeVertex:function(){this.model.remove(this.obj)}},updated(){this.ui.$revalidateElement(this.el),tr(this.ui.id,this.obj)}},To={mixins:[_o],methods:{getNode:function(){return this.obj},removeNode:function(){this.model.removeNode(this.getNode())},updateNode:function(e){this.model.updateNode(this.obj,e);let t=this.ui.getRenderedElement(this.obj.getFullId());this.ui.$revalidateElement(t)}}},go={methods:{getGroup:function(){return this.obj},removeGroup:function(e){this.model.removeGroup(this.obj,e)},updateGroup:function(e){this.model.updateGroup(this.obj,e);let t=this.ui.getRenderedElement(this.obj.getFullId());this.ui.$revalidateElement(t)}},mixins:[_o]},K=(e,t)=>{t.parentNode&&t.parentNode.removeChild(t)},no={props:{data:Object,model:A,obj:u.Edge,edge:u.Edge,overlay:u.Overlay,ui:u.BrowserUI,el:Element,def:Object,eventInfo:Object},mounted(){let e=this;e.el.firstElementChild&&(0,u.addClass)(e.el.firstElementChild,Xt)},updated(){this.ui.$revalidateElement(this.el)}},ke=(e,t,o,n,i,c,r,p,a)=>{let P=r.component!=null,m=(0,u.isGroup)(p),_=[];P||_.push(m?u.CLASS_DEFAULT_GROUP:u.CLASS_DEFAULT_NODE);let S=P?r.component:{render(y){return y.data.label||""}};if(S){let y=document.createElement(u.ELEMENT_DIV);(0,u.updateClasses)(y,_),S.mixins==null&&(S.mixins=[]);let R=m?go:To;S.mixins.find(Ue=>Ue===R)||S.mixins.push(R),or(c.id,p);let z={data:o,model:(0,M.markRaw)(n),ui:(0,M.markRaw)(c),obj:p,vertex:p,el:y,def:(0,M.markRaw)(r),eventInfo:a==null?null:(0,M.markRaw)(a)};if(r.inject)for(let Ue in r.inject){let ft=r.inject[Ue],$o=typeof ft=="function"?ft(p,n):ft;z[Ue]=$o}e.push({component:(0,M.markRaw)(S),el:y,e:p.getFullId(),props:z})}};function so(e,t,o,n,i,c){let r={reactive:!0,asynchronous:!0,usesWrapperElement:!1,update:(a,P,m,_)=>{},render:(a,P,m,_,S,y,R,j)=>ke(n,a,P,m,_,S,y,R,j),cleanupVertex:K,cleanupPort:K,rerender:(a,P,m,_,S,y,R,j,z)=>{K(R.id,z),ke(n,a,P,m,_,S,y,R,j)}},p=(0,u.extend)(i||{},{view:c||{},id:t});return(0,u.renderSurface)(e,o,r,p)}function io(e,t,o,n,i,c){let r={reactive:!0,asynchronous:!0,usesWrapperElement:!1,update:(a,P,m,_)=>{},render:(a,P,m,_,S,y,R,j)=>ke(n,a,P,m,_,S,y,R,j),cleanupVertex:K,cleanupPort:K,rerender:(a,P,m,_,S,y,R,j,z)=>{K(R.id,z),ke(n,a,P,m,_,S,y,R,j)}},p=(0,u.extend)(i||{},{view:c||{},id:t});return(0,u.renderPaper)(e,o,r,p)}function Le(e,t,o,n){if(e.edges)for(let i in e.edges){let c=e.edges[i];c.overlays&&(c.overlays=c.overlays.map(r=>{let p,a={};return r.component!=null?{type:u.OVERLAY_TYPE_CUSTOM,options:{create:m=>{let _=document.createElement(u.ELEMENT_DIV),S=(0,u.uuid)();r.component.mixins==null&&(r.component.mixins=[]),r.component.mixins.indexOf(no)===-1&&r.component.mixins.push(no);let y=F({data:m.edge.data,model:(0,M.markRaw)(o()),ui:(0,M.markRaw)(t()),obj:m.edge,edge:m.edge,el:_,def:(0,M.markRaw)(r),eventInfo:null},a);return n.push({component:(0,M.markRaw)(r.component),el:_,e:S,props:y}),_}}}:r}))}}var H=require("@visuallyjs/browser-ui"),Y=require("vue"),l=Symbol.for("visuallyjs-service"),N=class{constructor(t){this.context=t;this.s=[];this.i=[];this.a=[];this.l=[];this.surface=(0,Y.shallowRef)(null);this.model=(0,Y.shallowRef)(null);this.paper=(0,Y.shallowRef)(null);this.diagram=(0,Y.shallowRef)(null);this.ui=(0,Y.shallowRef)(null)}getSurface(t){this.t(this.i,t,this.p)}getDiagram(t){this.t(this.a,t,this.c)}getPaper(t){this.t(this.l,t,this.u)}getModel(t){this.t(this.s,t,this.r)}getModelDirect(){return this.r}t(t,o,n){if(n!=null)try{o(n)}catch(i){(0,H.log)(`WARN: could not dispatch ${i}`)}else t.push(o)}setSurface(t){this.surface.value=t,this.model.value=t.model,this.ui.value=t,this.p=t,this.n(t.model),this.o(this.i,t)}setDiagram(t){this.diagram.value=t,this.model.value=t.model,this.ui.value=t.$ui,this.c=t,this.n(t.model),t.$ui instanceof H.Surface?this.setSurface(t.$ui):t.$ui instanceof H.Paper&&this.setPaper(t.$ui),this.o(this.a,t)}setPaper(t){this.paper.value=t,this.model.value=t.model,this.ui.value=t,this.u=t,this.n(t.model),this.o(this.l,t)}n(t){this.r=t,this.o(this.s,t)}o(t,o){t.forEach(n=>{try{n(o)}catch(i){(0,H.log)(`WARN: could not flush all queue entries ${i}`)}})}};var x=require("vue"),O=require("@visuallyjs/browser-ui"),ao={setup(e){return{service:(0,x.inject)(l),surfaceId:e.surfaceId||Pt}},name:Ee,props:{[L]:{type:Object},[ue]:{type:Object},[$]:{type:Object},[me]:{type:Object},[de]:{type:Object},[U]:{type:String},[b]:{type:String}},data:function(){return{vertices:[],overlays:[]}},mounted(){let e=this,t=this.model||new A(this.modelOptions||{}),o=this.$refs.root;e.url?t.load({url:e.url}):e.data&&t.load({data:e.data});let n=(0,O.clone)(this.viewOptions||{});Le(n,()=>this.surface,()=>t,this.overlays),this.surface=so(t,this.surfaceId,o,this.vertices,(0,O.clone)(this.renderOptions||{}),n),this.service.setSurface(this.surface);let i=(r,p)=>{let a=()=>{let m={};return p.originalData||p.updates?m=Object.assign(p.originalData,p.updates):p.newData&&Object.assign(m,p.newData),m},P=this.vertices.find(m=>m.e===r);P!=null&&(P.props.data=a())},c=r=>{let p=this.vertices.findIndex(a=>a.e===r);p!==-1&&this.vertices.splice(p,1)};t.bind(O.EVENT_NODE_UPDATED,r=>{i(r.vertex.getFullId(),r)}),t.bind(O.EVENT_GROUP_UPDATED,r=>{i(r.vertex.getFullId(),r)}),t.bind(O.EVENT_NODE_REMOVED,r=>{c(r.node.id)}),t.bind(O.EVENT_GROUP_REMOVED,r=>{c(r.group.id)}),t.bind(O.EVENT_EDGE_UPDATED,r=>{let p=r.edge.id;this.overlays.forEach(a=>{a.props.edge&&a.props.edge.id===p&&(a.props.data=r.edge.data)})}),t.bind(O.EVENT_EDGE_REMOVED,r=>{let p=r.edge.id,a=this.overlays.length-1;for(;a>=0;)this.overlays[a].props.edge&&this.overlays[a].props.edge.id===p&&this.overlays.splice(a,1),a--}),this.surface.bind(O.EVENT_RENDER_END,()=>setTimeout(()=>this.surface.$redrawEveryConnection()))},render:function(){let e=this.vertices.map(t=>(0,x.h)(x.Teleport,{to:t.el,key:t.e},[(0,x.h)(t.component,t.props)]));return this.overlays.forEach(t=>{e.push((0,x.h)(x.Teleport,{to:t.el,key:t.e},[(0,x.h)(t.component,t.props)]))}),(0,x.h)(O.ELEMENT_DIV,{ref:"root",class:"vjs-vue-surface",style:{width:"100%",height:"100%"}},e.concat(this.$slots.hasOwnProperty("default")?this.$slots.default():[]))}};var D=require("vue"),E=require("@visuallyjs/browser-ui"),lo={setup(e){return{service:(0,D.inject)(l),paperId:e.paperId||Ot}},name:Ce,props:{[L]:{type:Object},[ue]:{type:Object},[$]:{type:Object},[me]:{type:Object},[de]:{type:Object},[U]:{type:String},[Tt]:{type:String}},data:function(){return{vertices:[],overlays:[]}},mounted(){let e=this,t=this.model||new A(this.modelOptions||{}),o=this.$refs.root;e.url?t.load({url:e.url}):e.data&&t.load({data:e.data});let n=(0,E.clone)(this.viewOptions||{});Le(n,()=>this.paper,()=>t,this.overlays),this.paper=io(t,this.paperId,o,this.vertices,(0,E.clone)(this.renderOptions||{}),n),this.service.setPaper(this.paper);let i=(r,p)=>{let a=()=>{let m={};return p.originalData||p.updates?m=Object.assign(p.originalData,p.updates):p.newData&&Object.assign(m,p.newData),m},P=this.vertices.find(m=>m.e===r);P!=null&&(P.props.data=a())},c=r=>{let p=this.vertices.findIndex(a=>a.e===r);p!==-1&&this.vertices.splice(p,1)};t.bind(E.EVENT_NODE_UPDATED,r=>{i(r.vertex.getFullId(),r)}),t.bind(E.EVENT_GROUP_UPDATED,r=>{i(r.vertex.getFullId(),r)}),t.bind(E.EVENT_NODE_REMOVED,r=>{c(r.node.id)}),t.bind(E.EVENT_GROUP_REMOVED,r=>{c(r.group.id)}),t.bind(E.EVENT_EDGE_UPDATED,r=>{let p=r.edge.id;this.overlays.forEach(a=>{a.props.edge&&a.props.edge.id===p&&(a.props.data=r.edge.data)})}),t.bind(E.EVENT_EDGE_REMOVED,r=>{let p=r.edge.id,a=this.overlays.length-1;for(;a>=0;)this.overlays[a].props.edge&&this.overlays[a].props.edge.id===p&&this.overlays.splice(a,1),a--}),this.paper.bind(E.EVENT_RENDER_END,()=>setTimeout(()=>this.paper.$redrawEveryConnection()))},render:function(){let e=this.vertices.map(t=>(0,D.h)(D.Teleport,{to:t.el,key:t.e},[(0,D.h)(t.component,t.props)]));return this.overlays.forEach(t=>{e.push((0,D.h)(D.Teleport,{to:t.el,key:t.e},[(0,D.h)(t.component,t.props)]))}),(0,D.h)(E.ELEMENT_DIV,{ref:"root",class:"vjs-vue-paper",style:{width:"100%",height:"100%"}},e.concat(this.$slots.hasOwnProperty("default")?this.$slots.default():[]))}};var d=require("vue"),s=require("@visuallyjs/browser-ui"),nr="Clear dataset?",po="vjs-selected-mode",Ro="can-undo",vo="can-redo",sr="data-undo",ir="data-redo",Ao="data-mode",ar="data-reset",lr="data-clear",pr="data-zoom-in",cr="data-zoom-out",No="vjs-controls-has-selection",co={setup(e){return{service:(0,d.inject)(l)}},name:Se,props:{clear:{type:Boolean,default:!0},[b]:{type:String},undoRedo:{type:Boolean,default:!0},orientation:{type:String,default:"row"},zoomToExtents:{type:Boolean,default:!0},zoomButtons:{type:Boolean,default:!1},clearMessage:{type:String,default:nr},onMaybeClear:{type:Function},className:{type:String,default:""}},methods:{panMode:function(){var e;(e=this.service.surface.value)==null||e.setMode(s.SURFACE_MODE_PAN)},selectMode:function(){var e;(e=this.service.surface.value)==null||e.setMode(s.SURFACE_MODE_SELECT)},zoomToFit:function(){var e;(e=this.service.surface.value)==null||e.zoomToFit()},doClear:function(){let e=this.service.surface.value;e&&(this.onMaybeClear!=null?this.onMaybeClear(()=>e.model.clear()):window.confirm(this.clearMessage)&&e.model.clear())},undo:function(){var e;(e=this.service.model.value)==null||e.undo()},redo:function(){var e;(e=this.service.model.value)==null||e.redo()},zoomIn:function(){var e;(e=this.service.surface.value)==null||e.zoomIn()},zoomOut:function(){var e;(e=this.service.surface.value)==null||e.zoomOut()},resetSelection(){let e=this.service.surface.value;e&&(e.model.clearSelection(),(0,s.supportsPathEditing)(e)&&e.stopEditingPath())},updateSelectionState:function(){let e=this.service.surface.value;e&&(e.model.getSelection().isEmpty()?this.$refs.root.removeAttribute(No):this.$refs.root.setAttribute(No,"true"))}},data:function(){return{ready:!1,hasLasso:!1}},render(){if(this.ready){let e=[];return this.showPan&&(e.push((0,d.h)("i",{class:`vjs-pan-mode ${po}`,[Ao]:s.SURFACE_MODE_PAN,onClick:()=>this.panMode(),title:"Pan mode"},[(0,d.h)("svg",{viewBox:s.PAN_VIEW_BOX,stroke:"currentColor",fill:"none"},[(0,d.h)("path",{d:s.PAN_PATH})])])),e.push((0,d.h)("i",{class:"vjs-select-mode",[Ao]:s.SURFACE_MODE_SELECT,onClick:()=>this.selectMode(),title:"Select mode"},[(0,d.h)("svg",{viewBox:s.LASSO_VIEW_BOX,stroke:"currentColor",fill:"currentColor"},[(0,d.h)("path",{d:s.LASSO_PATH})])]))),this.undoRedo&&(e.push((0,d.h)("i",{class:"vjs-undo",[sr]:!0,title:"Undo last action",onClick:()=>this.undo()})),e.push((0,d.h)("i",{class:"vjs-redo",[ir]:!0,title:"Redo last action",onClick:()=>this.redo()}))),this.zoomToExtents&&e.push((0,d.h)("i",{class:"vjs-zoom-to-fit",[ar]:"true",onClick:()=>this.zoomToFit(),title:"Zoom to Fit"},[(0,d.h)("svg",{viewBox:s.ZOOM_TO_FIT_VIEW_BOX,stroke:"currentColor",fill:"currentColor"},[(0,d.h)("path",{d:s.ZOOM_TO_FIT_PATH})])])),this.zoomButtons&&(e.push((0,d.h)("i",{class:"vjs-zoom-in",[pr]:"true",onClick:()=>this.zoomIn(),title:"Zoom In"},[(0,d.h)("svg",{viewBox:s.ZOOM_IN_OUT_VIEW_BOX,stroke:"currentColor",fill:"currentColor"},[(0,d.h)("path",{d:s.ZOOM_IN_PATH})])])),e.push((0,d.h)("i",{class:"vjs-zoom-out",[cr]:"true",onClick:()=>this.zoomOut(),title:"Zoom Out"},[(0,d.h)("svg",{viewBox:s.ZOOM_IN_OUT_VIEW_BOX,stroke:"currentColor",fill:"currentColor"},[(0,d.h)("path",{d:s.ZOOM_OUT_PATH})])]))),e.push((0,d.h)("i",{class:s.CLASS_CONTROLS_RESET_SELECTION,[s.ATTRIBUTE_RESET_SELECTION]:"true",onClick:()=>{this.resetSelection()}},[(0,d.h)("svg",{viewBox:s.RESET_SELECTION_VIEW_BOX,stroke:"currentColor",fill:"currentColor"},[(0,d.h)("path",{d:s.RESET_SELECTION_PATH})])])),this.clear&&e.push((0,d.h)("i",{class:"vjs-clear-dataset",[lr]:"true",onClick:()=>{this.doClear()}},[(0,d.h)("svg",{viewBox:s.CLEAR_VIEW_BOX,stroke:"currentColor",fill:"currentColor"},[(0,d.h)("path",{d:s.CLEAR_PATH})])])),(0,d.h)(s.ELEMENT_DIV,{class:`vjs-controls ${this.className}`,ref:"root",[Ro]:!1,[vo]:!1,[s.ATTRIBUTE_CONTROLS_ORIENTATION]:this.orientation},e)}else return(0,d.h)(s.ELEMENT_DIV,{ref:"root"})},mounted(){let e=t=>{let o=t.getPlugin(s.LassoPlugin.type);this.showPan=o!=null,t.bind(s.EVENT_SURFACE_MODE_CHANGED,n=>{t.removeClass(t.$getSelector(this.$refs.root,"[data-mode]"),po),t.addClass(t.$getSelector(this.$refs.root,"[data-mode='"+n+"']"),po)}),t.model.bind(s.EVENT_UNDOREDO_UPDATE,n=>{this.$refs.root.setAttribute(Ro,n.undoCount>0?s.TRUE:s.FALSE),this.$refs.root.setAttribute(vo,n.redoCount>0?s.TRUE:s.FALSE)}),t.model.bind(s.EVENT_SELECT,()=>this.updateSelectionState()),t.model.bind(s.EVENT_DESELECT,()=>this.updateSelectionState()),t.model.bind(s.EVENT_SELECTION_CLEARED,()=>this.updateSelectionState()),this.ready=!0};this.service.surface.value==null?(0,d.watch)(this.service.surface,e):e(this.service.surface.value)}};var I=require("vue"),C=require("@visuallyjs/browser-ui"),uo={name:ye,setup(e){return{service:(0,I.inject)(l)}},props:{surfaceId:{type:String},showLabel:{type:Boolean,default:!0},label:{type:String,default:"Export :"},margins:{type:Object},svgOptions:{type:Object},imageOptions:{type:Object},allowSvgExport:{type:Boolean,default:!0},allowPngExport:{type:Boolean,default:!0},allowJpgExport:{type:Boolean,default:!0}},methods:{loadSurface:function(e){let t=this.service.surface.value;t&&e(t)},exportSVG:function(){this.loadSurface(e=>{let t=this.svgOptions||{};this.margins!=null&&t.margins==null&&Object.assign(t,this.margins),new C.SvgExportUI(e).export(t)})},exportJPG:function(){this.loadSurface(e=>{let t=this.imageOptions||{};this.margins!=null&&t.margins==null&&Object.assign(t,this.margins),t.type="image/jpeg",new C.ImageExportUI(e).export(t)})},exportPNG:function(){this.loadSurface(e=>{let t=this.imageOptions||{};this.margins!=null&&t.margins==null&&Object.assign(t,this.margins),new C.ImageExportUI(e).export(t)})}},render(){let e=this.showLabel!==!1,t=this.allowSvgExport!==!1,o=this.allowPngExport!==!1,n=this.allowJpgExport!==!1,i=[];return t&&i.push((0,I.h)("i",{},[(0,I.h)("a",{href:"#","data-type":C.TYPE_SVG,onClick:()=>this.exportSVG()},"SVG")])),o&&i.push((0,I.h)("i",{},[(0,I.h)("a",{href:"#","data-type":C.TYPE_PNG,onClick:()=>this.exportPNG()},"PNG")])),n&&i.push((0,I.h)("i",{},[(0,I.h)("a",{href:"#","data-type":C.TYPE_JPG,onClick:()=>this.exportJPG()},"JPG")])),e&&i.unshift((0,I.h)("span",{},[this.label])),(0,I.h)(C.ELEMENT_DIV,{class:`${C.CLASS_CONTROLS} ${C.CLASS_EXPORT_CONTROLS}`},i)}};var X=require("vue"),$e=require("@visuallyjs/browser-ui"),mo={setup(e){return{service:(0,X.inject)(l)}},name:Oe,props:{[b]:{type:String},[k]:{type:String,default:""},[St]:{type:Boolean,default:!0},[Ct]:{type:Boolean,default:!0},[_t]:{type:Boolean,default:!0},[yt]:{type:Boolean,default:!0},[Et]:{type:Function}},mounted:function(){let e=t=>{t.addPlugin({type:$e.MiniviewPlugin.type,options:{container:this.$el,activeTracking:this.activeTracking,clickToCenter:this.clickToCenter,showLasso:this.showLasso,trackSelection:this.trackSelection,typeFunction:this.typeFunction}})};this.service.surface.value!=null?e(this.service.surface.value):(0,X.watch)(this.service.surface,e)},render:function(e){return(0,X.h)($e.ELEMENT_DIV,{ref:"root",class:e.className})}};var Z=require("vue"),He=require("@visuallyjs/browser-ui"),ho={setup(e){return{service:(0,Z.inject)(l)}},name:Te,props:{[L]:{type:Object},[U]:{type:String},[$]:{type:Object},[J]:{type:Object}},mounted(){let e=this.$refs.root;this.diagram=(0,Z.markRaw)((0,He.createDiagram)(e,this.options,this.modelOptions)),this.service.setDiagram(this.diagram),this.data?this.diagram.load({data:this.data}):this.url&&this.diagram.load({url:this.url})},render:function(){return(0,Z.h)(He.ELEMENT_DIV,{ref:"root",class:"vjs-vue-surface",style:{width:"100%",height:"100%"}},this.$slots.hasOwnProperty("default")?this.$slots.default():[])}};var G=require("vue"),h=require("@visuallyjs/browser-ui"),xo={[k]:{type:String},[L]:{type:Object},[U]:{type:String},[xt]:{type:Boolean,default:!1}},Do={setup(){return{service:(0,G.inject)(l)}},render:function(){return(0,G.h)(h.ELEMENT_DIV,{class:`${this.className}`,ref:"root"})}};function B(e,t,o=!0){let n=ce(F({},xo),{[J]:{type:Object}}),i={};return o&&(n[Ge]={type:Function},i[Ge]=function(c){this.chart.setDataSourceFilter(c)}),ce(F({},Do),{name:e,props:n,watch:i,data:()=>({hasMounted:!1}),mounted(){let c=this.$refs.root,r=o?Object.assign({dataSourceFilter:this.dataSourceFilter},this.options):this.options;this.data&&(r.data=this.data),this.url&&(r.url=this.url);let p=()=>{this.hasMounted=!0,this.chart=new t(c,r)};this.useModel?this.service.model.value!=null?(r.dataSource=this.service.model.value,p()):(0,G.watch)(this.service.model,a=>{this.hasMounted||(r.dataSource=a,p())}):p()}})}var We=B(Re,h.ColumnChart),ze=B(ve,h.BarChart),Je=B(Ae,h.CategoryValueChart,!1),Ke=B(De,h.PieChart),Ye=B(Ne,h.LineChart),Xe=B(xe,h.AreaChart),Ze=B(Ie,h.ScatterChart),qe=B(we,h.BubbleChart),Qe=B(Ve,h.GaugeChart,!1),et=ce(F({},Do),{name:Me,props:ce(F({},xo),{[At]:{type:String},[Nt]:{type:Object},[Rt]:{type:Boolean},[vt]:{type:String},[J]:{type:Object}}),data:()=>({hasMounted:!1}),mounted(){let e=this.$refs.root,t=Object.assign({},this.options);this.interactive!=null&&(t.interactive=this.interactive),this.pivot!=null&&(t.pivot=this.pivot),this.csvData&&(t.csvData=this.csvData),this.jsonData&&(t.jsonData=this.jsonData),this.url&&(t.url=this.url);let o=()=>{this.hasMounted=!1,this.chart=new h.SankeyChart(e,t)};if(this.useModel){let n=i=>{this.hasMounted||(t.dataSource=i,o())};this.service.model.value==null?(0,G.watch)(this.service.model,n):n(this.service.model.value)}else o()},watch:{pivot(e){this.chart&&this.chart.pivot(e)}},render:function(){return(0,G.h)(h.ELEMENT_DIV,{class:`${this.className}`,ref:"root"})}});var q=require("vue"),Q=require("@visuallyjs/browser-ui"),fo={setup(e){return{service:(0,q.inject)(l)}},name:_e,props:{[b]:{type:String},[Dt]:{type:String},[It]:{type:Function},[wt]:{type:Function},[Vt]:{type:Function},[Mt]:{type:Boolean,default:!1},[bt]:{type:Boolean,default:!0},[Lt]:{type:Boolean,default:!0},[Ut]:{type:Boolean,default:!1},[Bt]:{type:Boolean,default:!1},[$t]:Object,[jt]:Function,[Ht]:Function,[k]:String,[gt]:String,[Gt]:{type:Boolean,default:!1},[kt]:{type:Boolean,default:!1},[Ft]:{type:Boolean,default:!1}},mounted:function(){let e=t=>{let o={source:this.$refs.root,selector:this.selector,dataGenerator:n=>this.dataGenerator?this.dataGenerator(n):(0,Q.defaultDataGenerator)(n),allowDropOnEdge:this.allowDropOnEdge===!0,allowDropOnGroup:this.allowDropOnGroup!==!1,allowDropOnCanvas:this.allowDropOnCanvas!==!1,allowDropOnNode:this.allowDropOnNode===!0,ignoreDropOnNode:this.ignoreDropOnNode===!0,canvasDropFilter:this.canvasDropFilter,onVertexAdded:this.onVertexAdded,dragSize:this.dragSize,mode:this.mode};this.groupIdentifier!=null&&(o.groupIdentifier=this.groupIdentifier),this.typeGenerator!=null&&(o.typeGenerator=this.typeGenerator),this.palette=new Q.Palette(t,o)};this.service.surface.value==null?(0,q.watch)(this.service.surface,e):e(this.service.surface.value)},render:function(){return(0,q.h)(Q.ELEMENT_DIV,{ref:"root",class:this.className||""},this.$slots.hasOwnProperty("default")?this.$slots.default():[])}};var Io=require("vue"),tt={setup(){(0,Io.provide)(l,new N("SurfaceProvider"))},render(){return this.$slots.hasOwnProperty("default")?this.$slots.default():[]}};var wo=require("vue"),ot={setup(){(0,wo.provide)(l,new N("PaperProvider"))},render(){return this.$slots.hasOwnProperty("default")?this.$slots.default():[]}};var ee=require("vue"),w=require("@visuallyjs/browser-ui"),rt={name:he,props:{data:{type:Object},showLabels:{type:Boolean,default:!1},labelProperty:{type:String,default:"label"},labelStrokeWidth:{type:Number},multilineLabels:{type:Boolean,default:!0},labelFillRatio:{type:Number,default:w.DEFAULT_LABEL_FILL_RATIO},labelColor:{type:String,default:"#000000"},font:{type:Object}},setup(){return{service:(0,ee.inject)(l)}},mounted(){let e=t=>{let o=t.getShapeLibrary(),n=o.renderCompiledShape(Object.assign({sw:this.getOutlineWidth()},this.data));if(this.$refs.container.appendChild(n),this.showLabels){let i=o.renderShapeLabel(this.data,this.labelProperty,this.labelStrokeWidth,null,this.labelColor,this.labelColor,this.font);this.$refs.container.appendChild(i),this.multilineLabels!=!1&&(0,w.convertToMultilineText)(i,this.data[this.labelProperty]||"",this.getWidth()*(this.labelFillRatio||w.DEFAULT_LABEL_FILL_RATIO))}};this.service.ui.value==null?(0,ee.watch)(this.service.ui,e):e(this.service.ui.value)},updated(){let e=this.service.surface.value;if(e){let t=e.getShapeLibrary(),o=t.renderCompiledShape(Object.assign({sw:this.getOutlineWidth()},this.data));if(this.$refs.container.replaceChildren(o),this.showLabels){let n=t.renderShapeLabel(this.data,this.labelProperty,this.labelStrokeWidth,null,this.labelColor,this.labelColor,this.font);this.$refs.container.appendChild(n),this.multilineLabels!=!1&&(0,w.convertToMultilineText)(n,this.data[this.labelProperty]||"",this.getWidth()*(this.labelFillRatio||w.DEFAULT_LABEL_FILL_RATIO))}}},render:function(){return(0,ee.h)(w.ELEMENT_SVG,{ref:"container",preserveAspectRatio:"none",fill:this.getFill(),stroke:this.getOutline(),"stroke-width":this.getOutlineWidth(),viewBox:"0 0 "+this.getWidth()+" "+this.getHeight(),class:w.CLASS_SHAPE})},methods:{getWidth:function(){return this.data.width||Wt},getHeight:function(){return this.data.height||zt},getFill:function(){return this.data.fill||"#FFFFFF"},getOutline:function(){return this.data.outline||"#000000"},getOutlineWidth(){return this.data.outlineWidth||2}}};var te=require("vue"),nt=require("@visuallyjs/browser-ui"),st={name:fe,props:{surfaceId:{type:String},dragSize:Object,iconSize:Object,fill:String,outline:String,showAllMessage:String,selectAfterDrop:Boolean,paletteStrokeWidth:Number,dataGenerator:Function,initialSet:String,mode:String,allowClickToAdd:Boolean,onVertexAdded:Function,showLabels:Boolean,inspector:{type:Boolean,default:!0},preparedShapes:Array},setup(e){return{service:(0,te.inject)(l)}},data:()=>({hasMounted:!1}),mounted(){let e=t=>{this.hasMounted||(this.hasMounted=!0,new nt.ShapePalette(t,{container:this.$refs.container,shapeLibrary:t.getShapeLibrary(),dragSize:this.dragSize,iconSize:this.iconSize,fill:this.fill,outline:this.outline,showAllMessage:this.showAllMessage,selectAfterDrop:this.selectAfterDrop,paletteStrokeWidth:this.paletteStrokeWidth,dataGenerator:this.dataGenerator,initialSet:this.initialSet,mode:this.mode,allowClickToAdd:this.allowClickToAdd,onVertexAdded:this.onVertexAdded,showLabels:this.showLabels,inspector:this.inspector,preparedShapes:this.preparedShapes}))};this.service.surface.value==null?(0,te.watch)(this.service.surface,e):e(this.service.surface.value)},render:function(){return(0,te.h)(nt.ELEMENT_DIV,{ref:"container"})}};var V=require("vue"),oe=require("@visuallyjs/browser-ui"),re=Symbol.for("VueInspectorGetter"),Vo=Symbol.for("VueInspectorSetter");function Mo(){let e=[],t=null;function o(c){try{c(t)}catch(r){(0,oe.log)("WARN: inspector listener threw an exception",r)}}let n={listen:c=>{t!=null?o(c):e.push(c)}},i={inspector:c=>{t=c,e.forEach(o)}};return(0,V.provide)(Vo,i),(0,V.provide)(re,(0,V.readonly)(n)),i}var it={name:be,props:{autoCommit:{type:Boolean,default:!0},multipleSelections:{type:Boolean,default:!0},filter:Function,renderEmptyContainer:Function,refresh:Function,className:String,showCloseButton:Boolean,afterUpdate:Function,modelValue:Object},emits:["update:modelValue"],setup(e,t){let o=Mo();return{service:(0,V.inject)(l),inspectorProvider:o,inspector:null,emit:t.emit}},mounted(){let e=t=>{if(this.inspector==null){let o=new oe.Inspector({container:this.$refs.root,ui:t,renderEmptyContainer:()=>(this.emit("update:modelValue",null),this.renderEmptyContainer?this.renderEmptyContainer():""),refresh:(n,i)=>{this.emit("update:modelValue",n),this.refresh&&this.refresh(n),setTimeout(i)},autoCommit:this.autoCommit,multipleSelections:this.multipleSelections,filter:this.filter,showCloseButton:this.showCloseButton,afterUpdate:()=>this.afterUpdate?this.afterUpdate(t):null});this.inspectorProvider.inspector(o)}};this.service.surface.value==null?(0,V.watch)(this.service.surface,e):e(this.service.surface.value)},render(){return(0,V.h)(oe.ELEMENT_DIV,{ref:"root"},this.$slots.hasOwnProperty("default")?this.$slots.default():[])}};var at=require("vue"),ne=require("@visuallyjs/browser-ui"),lt={name:Pe,props:{propertyName:String},setup(){return{inspectorProvider:(0,at.inject)(re)}},mounted(){this.inspectorProvider?this.inspectorProvider.listen(e=>{let t=new ne.EdgeTypePicker(e.$ui,this.$refs.container,e.$ui.$getEdgePropertyMappings(),e.getValue(this.propertyName),(o,n)=>{e.setValue(this.propertyName,n,null)});t.render(this.propertyName,e.m),e.onChange(()=>{t.select(this.propertyName,e.getValue(this.propertyName))})}):(0,ne.log)("WARN: EdgeTypePicker not instantiated inside an InspectorComponent. Cannot mount.")},render:function(){return(0,at.h)(ne.ELEMENT_DIV,{ref:"container"})}};var W=require("vue"),f=require("@visuallyjs/browser-ui"),Po={render(){let e=this.swatches.map(t=>(0,W.h)(f.ELEMENT_DIV,{title:t,class:f.CLASS_COLOR_PICKER_SWATCH,style:`background-color:${t}`,"data-color":t,onClick:()=>this.selectSwatch(t)}));return(0,W.h)(f.ELEMENT_DIV,{class:`${f.CLASS_COLOR_PICKER}`},[(0,W.h)("input",{type:"color","vjs-att":this.propertyName,ref:"colorInput"}),(0,W.h)(f.ELEMENT_DIV,{class:f.CLASS_COLOR_PICKER_SWATCHES},e)])},props:{propertyName:String,maxColors:{type:Number,default:10}},data:()=>({CLASS_COLOR_PICKER:f.CLASS_COLOR_PICKER,CLASS_COLOR_PICKER_SWATCHES:f.CLASS_COLOR_PICKER_SWATCHES,CLASS_COLOR_PICKER_SWATCH:f.CLASS_COLOR_PICKER_SWATCH,colorInput:null,swatches:[]}),mounted(){let e=(0,W.inject)(re);e&&e.listen(t=>{this.inspector=t,this.swatches=t.ensureContext(f.INSPECTOR_CONTEXT_RECENT_COLORS,()=>[]),this.colorInput=this.$refs.colorInput,this.colorInput.addEventListener("change",this.colorPicked),t.bind(f.EVENT_CONTEXT_UPDATE,o=>{o.key===f.INSPECTOR_CONTEXT_RECENT_COLORS&&(this.swatches=o.value.slice())}),t.bind("change",this.setCurrentColor),this.setCurrentColor()})},methods:{addColor:function(e){let t=this.inspector.ensureContext(f.INSPECTOR_CONTEXT_RECENT_COLORS,()=>[]);if(e=e.toUpperCase(),!(t.find(n=>n.toUpperCase()===e)!=null)){let n=this.maxColors||10,i=t.slice();i.unshift(e),i.length>n&&(i.length=n),this.inspector.updateContext(f.INSPECTOR_CONTEXT_RECENT_COLORS,i)}},colorPicked:function(){let e=this.colorInput.value;this.inspector.setValue(this.propertyName,e,null),this.addColor(e)},selectSwatch:function(e){this.inspector.setValue(this.propertyName,e,null),this.colorInput.value=e},setCurrentColor:function(){let e=this.inspector.getValue(this.propertyName);e!=null&&(this.colorInput.value=e,this.addColor(e))}}};var T=require("vue"),se=require("@visuallyjs/browser-ui"),pt={props:{placement:{type:String,default:"floating"},position:{type:Object},constraints:{type:Object}},data:()=>({hasMounted:!1,surface:null}),setup(e){return{service:(0,T.inject)(l)}},mounted(){let e=t=>{if(!this.hasMounted){this.surface=t,this.hasMounted=!0;let o=this.position||{x:0,y:0};(0,T.nextTick)().then(()=>{this.placement==="floating"?t.floatElement(this.$refs.root,o):t.fixElement(this.$refs.fixedEl,o,this.constraints)})}};this.service.surface.value==null?(0,T.watch)(this.service.surface,e):e(this.service.surface.value)},render(){return(0,T.h)(se.ELEMENT_DIV,{ref:"root"},this.hasMounted?this.placement==="floating"?(0,T.h)(se.ELEMENT_DIV,{},this.$slots.hasOwnProperty("default")?this.$slots.default():[]):(0,T.h)(T.Teleport,{to:this.surface.vertexLayer,key:(0,se.uuid)()},(0,T.h)(se.ELEMENT_DIV,{ref:"fixedEl"},this.$slots.hasOwnProperty("default")?this.$slots.default():[])):[])}};var bo=require("vue"),ct={setup(){(0,bo.provide)(l,new N("DiagramProvider"))},render(){return this.$slots.hasOwnProperty("default")?this.$slots.default():[]}};var ie=require("vue"),ae=require("@visuallyjs/browser-ui"),ut={name:ge,props:{fill:String,outline:String,dragSize:Object,inspector:{type:Boolean,default:!0},iconSize:Object,showLabels:Boolean,paletteStrokeWidth:Number,showAllMessage:String,onCellAdded:Function,mode:String,allowClickToAdd:Boolean,autoExitDrawMode:Boolean,selectAfterAdd:{type:Boolean,default:!0},className:String,diagram:{type:Object},onVertexAdded:Function,preparedShapes:Array},setup(e){return{service:(0,ie.inject)(l)}},data:()=>({hasMounted:!1}),mounted(){if(this.service==null&&this.diagram==null)(0,ae.log)("Cannot mount DiagramPalette - no service found and Diagram not passed in as a prop");else{let e=t=>{this.hasMounted||(this.hasMounted=!0,new ae.DiagramPalette(this.$refs.container,t,{fill:this.fill,outline:this.outline,dragSize:this.dragSize,inspector:this.inspector,iconSize:this.iconSize,showLabels:this.showLabels,paletteStrokeWidth:this.paletteStrokeWidth,showAllMessage:this.showAllMessage,onCellAdded:this.onCellAdded,mode:this.mode,allowClickToAdd:this.allowClickToAdd,autoExitDrawMode:this.autoExitDrawMode,selectAfterAdd:this.selectAfterAdd,onVertexAdded:this.onVertexAdded,preparedShapes:this.preparedShapes}))};this.diagram?e(this.diagram):this.service.diagram.value!=null?e(this.service.diagram.value):(0,ie.watch)(this.service.diagram,e)}},render:function(){return(0,ie.h)(ae.ELEMENT_DIV,{ref:"container"})}};var v=require("@visuallyjs/browser-ui"),g=require("vue"),dt={name:"SurfacePopup",props:{selector:String,anchor:{type:String,default:"bottom"}},setup(e){let t=(0,g.inject)(l),o=(0,g.ref)(null),n=(0,g.ref)("block"),i=(0,g.ref)(null),c=(0,g.ref)(null),r=p=>{c.value=new v.PopupHandler(e.selector,i.value,p,a=>{o.value=a,a==null?n.value=v.NONE:(n.value=v.BLOCK,requestAnimationFrame(()=>c.value.$positionPopup()))},e.anchor)};return(0,g.onMounted)(()=>{t.surface.value==null?(0,g.watch)(t.surface,r):r(t.surface.value)}),{service:t,current:o,display:n,rootRef:i,handler:c}},render(){var e;return(0,g.h)(v.ELEMENT_DIV,{ref:"rootRef",display:this.display,position:v.ABSOLUTE,class:v.CLASS_SURFACE_POPUP},this.$slots.hasOwnProperty("default")?this.$slots.default({vertex:this.current,model:(e=this.service.surface.value)==null?void 0:e.model,ui:this.service.surface.value,hide:()=>{var t;return(t=this.handler.value)==null?void 0:t.$hide()}}):[])}};var ur={install:function(e,t){e.component(Zt,tt),e.component(qt,ot),e.component(Qt,ct),e.component(Ee,ao),e.component(Ce,lo),e.component(Te,ho),e.component(Oe,mo),e.component(Se,co),e.component(ye,uo),e.component(_e,fo),e.component(ge,ut),e.component(ve,ze),e.component(Re,We),e.component(Ae,Je),e.component(Ne,Ye),e.component(xe,Xe),e.component(De,Ke),e.component(Me,et),e.component(Ve,Qe),e.component(we,qe),e.component(Ie,Ze),e.component(he,rt),e.component(fe,st),e.component(Pe,lt),e.component(Jt,Po),e.component(be,it),e.component(to,pt),e.component(eo,dt),e.provide(l,new N("root"))}};var le=require("vue"),mt=require("@visuallyjs/browser-ui"),Lo=require("vue");function dr(){let e=(0,Lo.inject)(l),t=(0,le.shallowRef)(null),o=(0,le.shallowRef)(null),n=(0,le.shallowRef)(null),i=(0,le.ref)(1);return e==null||e.getSurface(c=>{o.value=c,o.value.bind(mt.EVENT_ZOOM,r=>{i.value=r.zoom})}),e==null||e.getDiagram(c=>{t.value=c,t.value.$ui.bind(mt.EVENT_ZOOM,r=>{i.value=r.zoom})}),e==null||e.getPaper(c=>{n.value=c,n.value.bind(mt.EVENT_ZOOM,r=>{i.value=r.zoom})}),i}var ht=require("vue"),pe=require("@visuallyjs/browser-ui");function mr(e){let t=(0,ht.inject)(l);if(t){let o=null,n=()=>{o&&e(o)},i=()=>{o&&(o.unbind(pe.EVENT_DATA_UPDATED,n),o.unbind(pe.EVENT_GRAPH_CLEARED,n))},c=r=>{i(),o=r,o&&(o.bind(pe.EVENT_DATA_UPDATED,n),o.bind(pe.EVENT_GRAPH_CLEARED,n),n())};t.getModel(r=>{c(r)}),(0,ht.onUnmounted)(()=>{i()})}}var Uo=require("vue"),Bo=require("vue");function hr(){let e=(0,Bo.inject)(l),t=(0,Uo.shallowRef)(null);return e==null||e.getSurface(o=>{t.value=o}),t}var jo=require("vue"),Go=require("vue");function fr(){let e=(0,Go.inject)(l),t=(0,jo.shallowRef)(null);return e==null||e.getDiagram(o=>{t.value=o}),t}var Fo=require("vue"),ko=require("vue");function Pr(){let e=(0,ko.inject)(l),t=(0,Fo.shallowRef)(null);return e==null||e.getPaper(o=>{t.value=o}),t}
@@ -1 +1 @@
1
- var io=Object.defineProperty,ao=Object.defineProperties;var lo=Object.getOwnPropertyDescriptors;var Le=Object.getOwnPropertySymbols;var po=Object.prototype.hasOwnProperty,co=Object.prototype.propertyIsEnumerable;var Be=(e,t,o)=>t in e?io(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,R=(e,t)=>{for(var o in t||(t={}))po.call(t,o)&&Be(e,o,t[o]);if(Le)for(var o of Le(t))co.call(t,o)&&Be(e,o,t[o]);return e},A=(e,t)=>ao(e,lo(t));import{log as uo,BrowserUIModel as mo}from"@visuallyjs/browser-ui";var _=class extends mo{render(t,o){return uo("render called directly on BrowserUiVue class: should not happen. Surface component should use internal render."),null}};function Qn(e){return e=e||{},new _(e)}var Ue="surfaceId",Ge="typeFunction",je="clickToCenter",Fe="showLasso",ke="activeTracking",He="trackSelection",f="surfaceId",T="className",g="data",$e="mode",N="options",We="renderOptions",b="modelOptions",ze="model",Je="viewOptions",y="url",Ke="interactive",Xe="pivot",ae="dataSourceFilter",Ye="csvData",Ze="jsonData",qe="useModel",Rs="id",Qe="selector",et="dataGenerator",tt="typeGenerator",ot="groupIdentifier",rt="allowDropOnEdge",nt="allowDropOnCanvas",st="allowDropOnGroup",it="allowDropOnNode",at="ignoreDropOnNode",lt="onVertexAdded",pt="selectAfterAdd",ct="clickToAddOnly",ut="allowClickToAdd",dt="dragSize",mt="canvasDropFilter",V="Shape",L="ShapePalette",ht=120,ft=90,B="EdgeTypePickerComponent",Ot="ColorPickerComponent",Pt="vjs-vue-node",Et="vjs-vue-group",U="MiniviewComponent",G="SurfaceComponent",Ct="SurfaceProvider",St="DiagramProvider",j="PaletteComponent",F="ControlsComponent",k="ExportControlsComponent",H="DiagramComponent",$="DiagramPaletteComponent",W="ColumnChartComponent",z="BarChartComponent",J="XYChartComponent",K="LineChartComponent",X="AreaChartComponent",Y="PieChartComponent",Z="ScatterChartComponent",q="BubbleChartComponent",Q="GaugeChartComponent",ee="SankeyChartComponent",te="InspectorComponent",_t="Decorator";import{markRaw as v}from"vue";import{addClass as ho,BrowserUI as fo,CLASS_DEFAULT_GROUP as Oo,CLASS_DEFAULT_NODE as Po,ELEMENT_DIV as Eo,extend as Co,isGroup as Tt,OptimisticEventGenerator as So,renderSurface as _o,updateClasses as To,Vertex as gt}from"@visuallyjs/browser-ui";var le=class{constructor(){this.unrenderedVertices=new Map;this.eventManager=new So}vertexWillRender(t){this.unrenderedVertices.set(t.id,t)}vertexHasRendered(t){this.unrenderedVertices.delete(t.id),this.unrenderedVertices.size===0&&this.eventManager.fire(go)}vertexHasUpdated(t){this.eventManager.fire(yo,t)}},go="vertices:rendered",yo="vertex:updated",pe=new Map;function oe(e){return pe.has(e)||pe.set(e,new le),pe.get(e)}function Ro(e,t){oe(e).vertexHasRendered(t)}function Ao(e,t){oe(e).vertexHasUpdated(t)}function No(e,t){oe(e).vertexWillRender(t)}function js(e,t,o){oe(e).eventManager.bind(t,o)}var yt={props:{data:Object,model:_,obj:gt,vertex:gt,ui:fo,el:Element,def:Object,eventInfo:Object},mounted(){let e=this,t=Tt(e.obj)?Et:Pt;e.el.firstElementChild&&ho(e.el.firstElementChild,t),e.ui.$vertexRendered(e.obj,e.el,e.def,e.eventInfo),Ro(e.ui.id,e.obj)},methods:{getModel:function(){return this.model},removeVertex:function(){this.model.remove(this.obj)}},updated(){this.ui.$revalidateElement(this.el),Ao(this.ui.id,this.obj)}},vo={mixins:[yt],methods:{getNode:function(){return this.obj},removeNode:function(){this.model.removeNode(this.getNode())},updateNode:function(e){this.model.updateNode(this.obj,e);let t=this.ui.getRenderedElement(this.obj.getFullId());this.ui.$revalidateElement(t)}}},xo={methods:{getGroup:function(){return this.obj},removeGroup:function(e){this.model.removeGroup(this.obj,e)},updateGroup:function(e){this.model.updateGroup(this.obj,e);let t=this.ui.getRenderedElement(this.obj.getFullId());this.ui.$revalidateElement(t)}},mixins:[yt]},ce=(e,t)=>{t.parentNode&&t.parentNode.removeChild(t)},Rt=(e,t,o,r,n,i,a,p,u)=>{let c=a.component!=null,E=Tt(p),C=[];c||C.push(E?Oo:Po);let d=c?a.component:{render(m){return m.data.label||""}};if(d){let m=document.createElement(Eo);To(m,C),d.mixins==null&&(d.mixins=[]);let S=E?xo:vo;d.mixins.find(w=>w===S)||d.mixins.push(S),No(i.id,p);let M={data:o,model:v(r),ui:v(i),obj:p,vertex:p,el:m,def:v(a),eventInfo:u==null?null:v(u)};if(a.inject)for(let w in a.inject){let ie=a.inject[w],so=typeof ie=="function"?ie(p,r):ie;M[w]=so}e.push({component:v(d),el:m,o:p.getFullId(),props:M})}};function At(e,t,o,r,n,i){let a={reactive:!0,asynchronous:!0,usesWrapperElement:!1,update:(u,c,E,C)=>{},render:(u,c,E,C,d,m,S,I)=>Rt(r,u,c,E,C,d,m,S,I),cleanupVertex:ce,cleanupPort:ce,rerender:(u,c,E,C,d,m,S,I,M)=>{ce(S.id,M),Rt(r,u,c,E,C,d,m,S,I)}},p=Co(n||{},{view:i||{},id:t});return _o(e,o,a,p)}import{log as Nt,Paper as Do,Surface as Io}from"@visuallyjs/browser-ui";import{shallowRef as x}from"vue";var s=Symbol.for("visuallyjs-service"),O=class{constructor(t){this.context=t;this.s=[];this.i=[];this.a=[];this.l=[];this.surface=x(null);this.model=x(null);this.paper=x(null);this.diagram=x(null);this.ui=x(null)}getSurface(t){this.e(this.i,t,this.p)}getDiagram(t){this.e(this.a,t,this.c)}getPaper(t){this.e(this.l,t,this.u)}getModel(t){this.e(this.s,t,this.r)}getModelDirect(){return this.r}e(t,o,r){if(r!=null)try{o(r)}catch(n){Nt(`WARN: could not dispatch ${n}`)}else t.push(o)}setSurface(t){this.surface.value=t,this.model.value=t.model,this.ui.value=t,this.p=t,this.n(t.model),this.t(this.i,t)}setDiagram(t){this.diagram.value=t,this.model.value=t.model,this.ui.value=t.$ui,this.c=t,this.n(t.model),t.$ui instanceof Io?this.setSurface(t.$ui):t.$ui instanceof Do&&this.setPaper(t.$ui),this.t(this.a,t)}setPaper(t){this.paper.value=t,this.model.value=t.model,this.ui.value=t,this.u=t,this.n(t.model),this.t(this.l,t)}n(t){this.r=t,this.t(this.s,t)}t(t,o){t.forEach(r=>{try{r(o)}catch(n){Nt(`WARN: could not flush all queue entries ${n}`)}})}};import{h as ue,inject as Mo,Teleport as wo}from"vue";import{ELEMENT_DIV as bo,EVENT_GROUP_REMOVED as Vo,EVENT_GROUP_UPDATED as Lo,EVENT_NODE_REMOVED as Bo,EVENT_NODE_UPDATED as Uo,EVENT_RENDER_END as Go,clone as vt}from"@visuallyjs/browser-ui";var xt={setup(e){return{service:Mo(s),surfaceId:e.surfaceId||Ue}},name:G,props:{[g]:{type:Object},[We]:{type:Object},[b]:{type:Object},[Je]:{type:Object},[ze]:{type:Object},[y]:{type:String},[f]:{type:String}},data:function(){return{vertices:[]}},mounted(){let e=this,t=this.model||new _(this.modelOptions||{}),o=this.$refs.root;e.url?t.load({url:e.url}):e.data&&t.load({data:e.data}),this.surface=At(t,this.surfaceId,o,this.vertices,vt(this.renderOptions||{}),vt(this.viewOptions||{})),this.service.setSurface(this.surface);let r=(i,a)=>{let p=()=>{let c={};return a.originalData||a.updates?c=Object.assign(a.originalData,a.updates):a.newData&&Object.assign(c,a.newData),c},u=this.vertices.find(c=>c.o===i);u!=null&&(u.props.data=p())},n=i=>{let a=this.vertices.findIndex(p=>p.o===i);a!==-1&&this.vertices.splice(a,1)};t.bind(Uo,i=>{r(i.vertex.getFullId(),i)}),t.bind(Lo,i=>{r(i.vertex.getFullId(),i)}),t.bind(Bo,i=>{n(i.node.id)}),t.bind(Vo,i=>{n(i.group.id)}),this.surface.bind(Go,()=>setTimeout(()=>this.surface.$redrawEveryConnection()))},render:function(){return ue(bo,{ref:"root",class:"vjs-vue-surface",style:{width:"100%",height:"100%"}},this.vertices.map(e=>ue(wo,{to:e.el,key:e.o},[ue(e.component,e.props)])).concat(this.$slots.hasOwnProperty("default")?this.$slots.default():[]))}};import{h as l,inject as jo,watch as Fo}from"vue";import{LassoPlugin as ko,SURFACE_MODE_SELECT as Dt,SURFACE_MODE_PAN as It,PAN_PATH as Ho,PAN_VIEW_BOX as $o,LASSO_PATH as Wo,LASSO_VIEW_BOX as zo,ZOOM_TO_FIT_PATH as Jo,ZOOM_TO_FIT_VIEW_BOX as Ko,EVENT_UNDOREDO_UPDATE as Xo,TRUE as Mt,FALSE as wt,EVENT_SURFACE_MODE_CHANGED as Yo,ELEMENT_DIV as bt,ATTRIBUTE_CONTROLS_ORIENTATION as Zo,ZOOM_IN_OUT_VIEW_BOX as Vt,ZOOM_IN_PATH as qo,ZOOM_OUT_PATH as Qo,RESET_SELECTION_PATH as er,RESET_SELECTION_VIEW_BOX as tr,CLEAR_PATH as or,CLEAR_VIEW_BOX as rr,ATTRIBUTE_RESET_SELECTION as nr,CLASS_CONTROLS_RESET_SELECTION as sr,EVENT_SELECT as ir,EVENT_DESELECT as ar,EVENT_SELECTION_CLEARED as lr,supportsPathEditing as pr}from"@visuallyjs/browser-ui";var cr="Clear dataset?",de="vjs-selected-mode",Lt="can-undo",Bt="can-redo",ur="data-undo",dr="data-redo",Ut="data-mode",mr="data-reset",hr="data-clear",fr="data-zoom-in",Or="data-zoom-out",Gt="vjs-controls-has-selection",jt={setup(e){return{service:jo(s)}},name:F,props:{clear:{type:Boolean,default:!0},[f]:{type:String},undoRedo:{type:Boolean,default:!0},orientation:{type:String,default:"row"},zoomToExtents:{type:Boolean,default:!0},zoomButtons:{type:Boolean,default:!1},clearMessage:{type:String,default:cr},onMaybeClear:{type:Function},className:{type:String,default:""}},methods:{panMode:function(){var e;(e=this.service.surface.value)==null||e.setMode(It)},selectMode:function(){var e;(e=this.service.surface.value)==null||e.setMode(Dt)},zoomToFit:function(){var e;(e=this.service.surface.value)==null||e.zoomToFit()},doClear:function(){let e=this.service.surface.value;e&&(this.onMaybeClear!=null?this.onMaybeClear(()=>e.model.clear()):window.confirm(this.clearMessage)&&e.model.clear())},undo:function(){var e;(e=this.service.model.value)==null||e.undo()},redo:function(){var e;(e=this.service.model.value)==null||e.redo()},zoomIn:function(){var e;(e=this.service.surface.value)==null||e.zoomIn()},zoomOut:function(){var e;(e=this.service.surface.value)==null||e.zoomOut()},resetSelection(){let e=this.service.surface.value;e&&(e.model.clearSelection(),pr(e)&&e.stopEditingPath())},updateSelectionState:function(){let e=this.service.surface.value;e&&(e.model.getSelection().isEmpty()?this.$refs.root.removeAttribute(Gt):this.$refs.root.setAttribute(Gt,"true"))}},data:function(){return{ready:!1,hasLasso:!1}},render(){if(this.ready){let e=[];return this.showPan&&(e.push(l("i",{class:`vjs-pan-mode ${de}`,[Ut]:It,onClick:()=>this.panMode(),title:"Pan mode"},[l("svg",{viewBox:$o,stroke:"currentColor",fill:"none"},[l("path",{d:Ho})])])),e.push(l("i",{class:"vjs-select-mode",[Ut]:Dt,onClick:()=>this.selectMode(),title:"Select mode"},[l("svg",{viewBox:zo,stroke:"currentColor",fill:"currentColor"},[l("path",{d:Wo})])]))),this.undoRedo&&(e.push(l("i",{class:"vjs-undo",[ur]:!0,title:"Undo last action",onClick:()=>this.undo()})),e.push(l("i",{class:"vjs-redo",[dr]:!0,title:"Redo last action",onClick:()=>this.redo()}))),this.zoomToExtents&&e.push(l("i",{class:"vjs-zoom-to-fit",[mr]:"true",onClick:()=>this.zoomToFit(),title:"Zoom to Fit"},[l("svg",{viewBox:Ko,stroke:"currentColor",fill:"currentColor"},[l("path",{d:Jo})])])),this.zoomButtons&&(e.push(l("i",{class:"vjs-zoom-in",[fr]:"true",onClick:()=>this.zoomIn(),title:"Zoom In"},[l("svg",{viewBox:Vt,stroke:"currentColor",fill:"currentColor"},[l("path",{d:qo})])])),e.push(l("i",{class:"vjs-zoom-out",[Or]:"true",onClick:()=>this.zoomOut(),title:"Zoom Out"},[l("svg",{viewBox:Vt,stroke:"currentColor",fill:"currentColor"},[l("path",{d:Qo})])]))),e.push(l("i",{class:sr,[nr]:"true",onClick:()=>{this.resetSelection()}},[l("svg",{viewBox:tr,stroke:"currentColor",fill:"currentColor"},[l("path",{d:er})])])),this.clear&&e.push(l("i",{class:"vjs-clear-dataset",[hr]:"true",onClick:()=>{this.doClear()}},[l("svg",{viewBox:rr,stroke:"currentColor",fill:"currentColor"},[l("path",{d:or})])])),l(bt,{class:`vjs-controls ${this.className}`,ref:"root",[Lt]:!1,[Bt]:!1,[Zo]:this.orientation},e)}else return l(bt,{ref:"root"})},mounted(){let e=t=>{let o=t.getPlugin(ko.type);this.showPan=o!=null,t.bind(Yo,r=>{t.removeClass(t.$getSelector(this.$refs.root,"[data-mode]"),de),t.addClass(t.$getSelector(this.$refs.root,"[data-mode='"+r+"']"),de)}),t.model.bind(Xo,r=>{this.$refs.root.setAttribute(Lt,r.undoCount>0?Mt:wt),this.$refs.root.setAttribute(Bt,r.redoCount>0?Mt:wt)}),t.model.bind(ir,()=>this.updateSelectionState()),t.model.bind(ar,()=>this.updateSelectionState()),t.model.bind(lr,()=>this.updateSelectionState()),this.ready=!0};this.service.surface.value==null?Fo(this.service.surface,e):e(this.service.surface.value)}};import{h as P,inject as Pr}from"vue";import{CLASS_CONTROLS as Er,CLASS_EXPORT_CONTROLS as Cr,ELEMENT_DIV as Sr,ImageExportUI as Ft,SvgExportUI as _r,TYPE_JPG as Tr,TYPE_PNG as gr,TYPE_SVG as yr}from"@visuallyjs/browser-ui";var kt={name:k,setup(e){return{service:Pr(s)}},props:{surfaceId:{type:String},showLabel:{type:Boolean,default:!0},label:{type:String,default:"Export :"},margins:{type:Object},svgOptions:{type:Object},imageOptions:{type:Object},allowSvgExport:{type:Boolean,default:!0},allowPngExport:{type:Boolean,default:!0},allowJpgExport:{type:Boolean,default:!0}},methods:{loadSurface:function(e){let t=this.service.surface.value;t&&e(t)},exportSVG:function(){this.loadSurface(e=>{let t=this.svgOptions||{};this.margins!=null&&t.margins==null&&Object.assign(t,this.margins),new _r(e).export(t)})},exportJPG:function(){this.loadSurface(e=>{let t=this.imageOptions||{};this.margins!=null&&t.margins==null&&Object.assign(t,this.margins),t.type="image/jpeg",new Ft(e).export(t)})},exportPNG:function(){this.loadSurface(e=>{let t=this.imageOptions||{};this.margins!=null&&t.margins==null&&Object.assign(t,this.margins),new Ft(e).export(t)})}},render(){let e=this.showLabel!==!1,t=this.allowSvgExport!==!1,o=this.allowPngExport!==!1,r=this.allowJpgExport!==!1,n=[];return t&&n.push(P("i",{},[P("a",{href:"#","data-type":yr,onClick:()=>this.exportSVG()},"SVG")])),o&&n.push(P("i",{},[P("a",{href:"#","data-type":gr,onClick:()=>this.exportPNG()},"PNG")])),r&&n.push(P("i",{},[P("a",{href:"#","data-type":Tr,onClick:()=>this.exportJPG()},"JPG")])),e&&n.unshift(P("span",{},[this.label])),P(Sr,{class:`${Er} ${Cr}`},n)}};import{h as Rr,inject as Ar,watch as Nr}from"vue";import{ELEMENT_DIV as vr,MiniviewPlugin as xr}from"@visuallyjs/browser-ui";var Ht={setup(e){return{service:Ar(s)}},name:U,props:{[f]:{type:String},[T]:{type:String,default:""},[ke]:{type:Boolean,default:!0},[je]:{type:Boolean,default:!0},[Fe]:{type:Boolean,default:!0},[He]:{type:Boolean,default:!0},[Ge]:{type:Function}},mounted:function(){let e=t=>{t.addPlugin({type:xr.type,options:{container:this.$el,activeTracking:this.activeTracking,clickToCenter:this.clickToCenter,showLasso:this.showLasso,trackSelection:this.trackSelection,typeFunction:this.typeFunction}})};this.service.surface.value!=null?e(this.service.surface.value):Nr(this.service.surface,e)},render:function(e){return Rr(vr,{ref:"root",class:e.className})}};import{h as Dr,inject as Ir,markRaw as Mr}from"vue";import{createDiagram as wr,ELEMENT_DIV as br}from"@visuallyjs/browser-ui";var $t={setup(e){return{service:Ir(s)}},name:H,props:{[g]:{type:Object},[y]:{type:String},[b]:{type:Object},[N]:{type:Object}},mounted(){let e=this.$refs.root;this.diagram=Mr(wr(e,this.options,this.modelOptions)),this.service.setDiagram(this.diagram),this.data?this.diagram.load({data:this.data}):this.url&&this.diagram.load({url:this.url})},render:function(){return Dr(br,{ref:"root",class:"vjs-vue-surface",style:{width:"100%",height:"100%"}},this.$slots.hasOwnProperty("default")?this.$slots.default():[])}};import{h as Wt,inject as Vr,watch as zt}from"vue";import{ColumnChart as Lr,BarChart as Br,CategoryValueChart as Ur,ELEMENT_DIV as Jt,LineChart as Gr,AreaChart as jr,PieChart as Fr,ScatterChart as kr,BubbleChart as Hr,GaugeChart as $r,SankeyChart as Wr}from"@visuallyjs/browser-ui";var Kt={[T]:{type:String},[g]:{type:Object},[y]:{type:String},[qe]:{type:Boolean,default:!1}},Xt={setup(){return{service:Vr(s)}},render:function(){return Wt(Jt,{class:`${this.className}`,ref:"root"})}};function h(e,t,o=!0){let r=A(R({},Kt),{[N]:{type:Object}}),n={};return o&&(r[ae]={type:Function},n[ae]=function(i){this.chart.setDataSourceFilter(i)}),A(R({},Xt),{name:e,props:r,watch:n,data:()=>({hasMounted:!1}),mounted(){let i=this.$refs.root,a=o?Object.assign({dataSourceFilter:this.dataSourceFilter},this.options):this.options;this.data&&(a.data=this.data),this.url&&(a.url=this.url);let p=()=>{this.hasMounted=!0,this.chart=new t(i,a)};this.useModel?this.service.model.value!=null?(a.dataSource=this.service.model.value,p()):zt(this.service.model,u=>{this.hasMounted||(a.dataSource=u,p())}):p()}})}var me=h(W,Lr),he=h(z,Br),fe=h(J,Ur,!1),Oe=h(Y,Fr),Pe=h(K,Gr),Ee=h(X,jr),Ce=h(Z,kr),Se=h(q,Hr),_e=h(Q,$r,!1),Te=A(R({},Xt),{name:ee,props:A(R({},Kt),{[Ye]:{type:String},[Ze]:{type:Object},[Ke]:{type:Boolean},[Xe]:{type:String},[N]:{type:Object}}),data:()=>({hasMounted:!1}),mounted(){let e=this.$refs.root,t=Object.assign({},this.options);this.interactive!=null&&(t.interactive=this.interactive),this.pivot!=null&&(t.pivot=this.pivot),this.csvData&&(t.csvData=this.csvData),this.jsonData&&(t.jsonData=this.jsonData),this.url&&(t.url=this.url);let o=()=>{this.hasMounted=!1,this.chart=new Wr(e,t)};if(this.useModel){let r=n=>{this.hasMounted||(t.dataSource=n,o())};this.service.model.value==null?zt(this.service.model,r):r(this.service.model.value)}else o()},watch:{pivot(e){this.chart&&this.chart.pivot(e)}},render:function(){return Wt(Jt,{class:`${this.className}`,ref:"root"})}});import{h as zr,inject as Jr,watch as Kr}from"vue";import{defaultDataGenerator as Xr,ELEMENT_DIV as Yr,Palette as Zr}from"@visuallyjs/browser-ui";var Yt={setup(e){return{service:Jr(s)}},name:j,props:{[f]:{type:String},[Qe]:{type:String},[et]:{type:Function},[tt]:{type:Function},[ot]:{type:Function},[rt]:{type:Boolean,default:!1},[nt]:{type:Boolean,default:!0},[st]:{type:Boolean,default:!0},[it]:{type:Boolean,default:!1},[at]:{type:Boolean,default:!1},[dt]:Object,[lt]:Function,[mt]:Function,[T]:String,[$e]:String,[pt]:{type:Boolean,default:!1},[ut]:{type:Boolean,default:!1},[ct]:{type:Boolean,default:!1}},mounted:function(){let e=t=>{let o={source:this.$refs.root,selector:this.selector,dataGenerator:r=>this.dataGenerator?this.dataGenerator(r):Xr(r),allowDropOnEdge:this.allowDropOnEdge===!0,allowDropOnGroup:this.allowDropOnGroup!==!1,allowDropOnCanvas:this.allowDropOnCanvas!==!1,allowDropOnNode:this.allowDropOnNode===!0,ignoreDropOnNode:this.ignoreDropOnNode===!0,canvasDropFilter:this.canvasDropFilter,onVertexAdded:this.onVertexAdded,dragSize:this.dragSize,mode:this.mode};this.groupIdentifier!=null&&(o.groupIdentifier=this.groupIdentifier),this.typeGenerator!=null&&(o.typeGenerator=this.typeGenerator),this.palette=new Zr(t,o)};this.service.surface.value==null?Kr(this.service.surface,e):e(this.service.surface.value)},render:function(){return zr(Yr,{ref:"root",class:this.className||""},this.$slots.hasOwnProperty("default")?this.$slots.default():[])}};import{provide as qr}from"vue";var ge={setup(){qr(s,new O("SurfaceProvider"))},render(){return this.$slots.hasOwnProperty("default")?this.$slots.default():[]}};import{h as Qr,inject as en,watch as tn}from"vue";import{CLASS_SHAPE as on,convertToMultilineText as Zt,DEFAULT_LABEL_FILL_RATIO as ye,ELEMENT_SVG as rn}from"@visuallyjs/browser-ui";var Re={name:V,props:{data:{type:Object},showLabels:{type:Boolean,default:!1},labelProperty:{type:String,default:"label"},labelStrokeWidth:{type:Number},multilineLabels:{type:Boolean,default:!0},labelFillRatio:{type:Number,default:ye},labelColor:{type:String,default:"#000000"},font:{type:Object}},setup(){return{service:en(s)}},mounted(){let e=t=>{let o=t.getShapeLibrary(),r=o.renderCompiledShape(Object.assign({sw:this.getOutlineWidth()},this.data));if(this.$refs.container.appendChild(r),this.showLabels){let n=o.renderShapeLabel(this.data,this.labelProperty,this.labelStrokeWidth,null,this.labelColor,this.labelColor,this.font);this.$refs.container.appendChild(n),this.multilineLabels!=!1&&Zt(n,this.data[this.labelProperty]||"",this.getWidth()*(this.labelFillRatio||ye))}};this.service.ui.value==null?tn(this.service.ui,e):e(this.service.ui.value)},updated(){let e=this.service.surface.value;if(e){let t=e.getShapeLibrary(),o=t.renderCompiledShape(Object.assign({sw:this.getOutlineWidth()},this.data));if(this.$refs.container.replaceChildren(o),this.showLabels){let r=t.renderShapeLabel(this.data,this.labelProperty,this.labelStrokeWidth,null,this.labelColor,this.labelColor,this.font);this.$refs.container.appendChild(r),this.multilineLabels!=!1&&Zt(r,this.data[this.labelProperty]||"",this.getWidth()*(this.labelFillRatio||ye))}}},render:function(){return Qr(rn,{ref:"container",preserveAspectRatio:"none",fill:this.getFill(),stroke:this.getOutline(),"stroke-width":this.getOutlineWidth(),viewBox:"0 0 "+this.getWidth()+" "+this.getHeight(),class:on})},methods:{getWidth:function(){return this.data.width||ht},getHeight:function(){return this.data.height||ft},getFill:function(){return this.data.fill||"#FFFFFF"},getOutline:function(){return this.data.outline||"#000000"},getOutlineWidth(){return this.data.outlineWidth||2}}};import{h as nn,inject as sn,watch as an}from"vue";import{ELEMENT_DIV as ln,ShapePalette as pn}from"@visuallyjs/browser-ui";var Ae={name:L,props:{surfaceId:{type:String},dragSize:Object,iconSize:Object,fill:String,outline:String,showAllMessage:String,selectAfterDrop:Boolean,paletteStrokeWidth:Number,dataGenerator:Function,initialSet:String,mode:String,allowClickToAdd:Boolean,onVertexAdded:Function,showLabels:Boolean,inspector:{type:Boolean,default:!0},preparedShapes:Array},setup(e){return{service:sn(s)}},data:()=>({hasMounted:!1}),mounted(){let e=t=>{this.hasMounted||(this.hasMounted=!0,new pn(t,{container:this.$refs.container,shapeLibrary:t.getShapeLibrary(),dragSize:this.dragSize,iconSize:this.iconSize,fill:this.fill,outline:this.outline,showAllMessage:this.showAllMessage,selectAfterDrop:this.selectAfterDrop,paletteStrokeWidth:this.paletteStrokeWidth,dataGenerator:this.dataGenerator,initialSet:this.initialSet,mode:this.mode,allowClickToAdd:this.allowClickToAdd,onVertexAdded:this.onVertexAdded,showLabels:this.showLabels,inspector:this.inspector,preparedShapes:this.preparedShapes}))};this.service.surface.value==null?an(this.service.surface,e):e(this.service.surface.value)},render:function(){return nn(ln,{ref:"container"})}};import{provide as qt,readonly as cn,inject as un,h as dn,watch as mn}from"vue";import{ELEMENT_DIV as hn,Inspector as fn,log as On}from"@visuallyjs/browser-ui";var D=Symbol.for("VueInspectorGetter"),Pn=Symbol.for("VueInspectorSetter");function En(){let e=[],t=null;function o(i){try{i(t)}catch(a){On("WARN: inspector listener threw an exception",a)}}let r={listen:i=>{t!=null?o(i):e.push(i)}},n={inspector:i=>{t=i,e.forEach(o)}};return qt(Pn,n),qt(D,cn(r)),n}var Ne={name:te,props:{autoCommit:{type:Boolean,default:!0},multipleSelections:{type:Boolean,default:!0},filter:Function,renderEmptyContainer:Function,refresh:Function,className:String,showCloseButton:Boolean,afterUpdate:Function,modelValue:Object},emits:["update:modelValue"],setup(e,t){let o=En();return{service:un(s),inspectorProvider:o,inspector:null,emit:t.emit}},mounted(){let e=t=>{if(this.inspector==null){let o=new fn({container:this.$refs.root,ui:t,renderEmptyContainer:()=>(this.emit("update:modelValue",null),this.renderEmptyContainer?this.renderEmptyContainer():""),refresh:(r,n)=>{this.emit("update:modelValue",r),this.refresh&&this.refresh(r),setTimeout(n)},autoCommit:this.autoCommit,multipleSelections:this.multipleSelections,filter:this.filter,showCloseButton:this.showCloseButton,afterUpdate:()=>this.afterUpdate?this.afterUpdate(t):null});this.inspectorProvider.inspector(o)}};this.service.surface.value==null?mn(this.service.surface,e):e(this.service.surface.value)},render(){return dn(hn,{ref:"root"},this.$slots.hasOwnProperty("default")?this.$slots.default():[])}};import{h as Cn,inject as Sn}from"vue";import{EdgeTypePicker as _n,ELEMENT_DIV as Tn,log as gn}from"@visuallyjs/browser-ui";var ve={name:B,props:{propertyName:String},setup(){return{inspectorProvider:Sn(D)}},mounted(){this.inspectorProvider?this.inspectorProvider.listen(e=>{let t=new _n(e.$ui,this.$refs.container,e.$ui.$getEdgePropertyMappings(),e.getValue(this.propertyName),(o,r)=>{e.setValue(this.propertyName,r)});t.render(this.propertyName,e.m),e.onChange(()=>{t.select(this.propertyName,e.getValue(this.propertyName))})}):gn("WARN: EdgeTypePicker not instantiated inside an InspectorComponent. Cannot mount.")},render:function(){return Cn(Tn,{ref:"container"})}};import{h as re,inject as yn}from"vue";import{CLASS_COLOR_PICKER as Qt,CLASS_COLOR_PICKER_SWATCH as eo,CLASS_COLOR_PICKER_SWATCHES as to,EVENT_CONTEXT_UPDATE as Rn,ELEMENT_DIV as xe,INSPECTOR_CONTEXT_RECENT_COLORS as ne}from"@visuallyjs/browser-ui";var oo={render(){let e=this.swatches.map(t=>re(xe,{title:t,class:eo,style:`background-color:${t}`,"data-color":t,onClick:()=>this.selectSwatch(t)}));return re(xe,{class:`${Qt}`},[re("input",{type:"color","vjs-att":this.propertyName,ref:"colorInput"}),re(xe,{class:to},e)])},props:{propertyName:String,maxColors:{type:Number,default:10}},data:()=>({CLASS_COLOR_PICKER:Qt,CLASS_COLOR_PICKER_SWATCHES:to,CLASS_COLOR_PICKER_SWATCH:eo,colorInput:null,swatches:[]}),mounted(){let e=yn(D);e&&e.listen(t=>{this.inspector=t,this.swatches=t.ensureContext(ne,()=>[]),this.colorInput=this.$refs.colorInput,this.colorInput.addEventListener("change",this.colorPicked),t.bind(Rn,o=>{o.key===ne&&(this.swatches=o.value.slice())}),t.bind("change",this.setCurrentColor),this.setCurrentColor()})},methods:{addColor:function(e){let t=this.inspector.ensureContext(ne,()=>[]);if(e=e.toUpperCase(),!(t.find(r=>r.toUpperCase()===e)!=null)){let r=this.maxColors||10,n=t.slice();n.unshift(e),n.length>r&&(n.length=r),this.inspector.updateContext(ne,n)}},colorPicked:function(){let e=this.colorInput.value;this.inspector.setValue(this.propertyName,e),this.addColor(e)},selectSwatch:function(e){this.inspector.setValue(this.propertyName,e),this.colorInput.value=e},setCurrentColor:function(){let e=this.inspector.getValue(this.propertyName);e!=null&&(this.colorInput.value=e,this.addColor(e))}}};import{h as se,inject as An,nextTick as Nn,Teleport as vn,watch as xn}from"vue";import{ELEMENT_DIV as De,uuid as Dn}from"@visuallyjs/browser-ui";var Ie={props:{placement:{type:String,default:"floating"},position:{type:Object},constraints:{type:Object}},data:()=>({hasMounted:!1,surface:null}),setup(e){return{service:An(s)}},mounted(){let e=t=>{if(!this.hasMounted){this.surface=t,this.hasMounted=!0;let o=this.position||{x:0,y:0};Nn().then(()=>{this.placement==="floating"?t.floatElement(this.$refs.root,o):t.fixElement(this.$refs.fixedEl,o,this.constraints)})}};this.service.surface.value==null?xn(this.service.surface,e):e(this.service.surface.value)},render(){return se(De,{ref:"root"},this.hasMounted?this.placement==="floating"?se(De,{},this.$slots.hasOwnProperty("default")?this.$slots.default():[]):se(vn,{to:this.surface.vertexLayer,key:Dn()},se(De,{ref:"fixedEl"},this.$slots.hasOwnProperty("default")?this.$slots.default():[])):[])}};import{provide as In}from"vue";var Me={setup(){In(s,new O("DiagramProvider"))},render(){return this.$slots.hasOwnProperty("default")?this.$slots.default():[]}};import{h as Mn,inject as wn,watch as bn}from"vue";import{DiagramPalette as Vn,ELEMENT_DIV as Ln,log as Bn}from"@visuallyjs/browser-ui";var we={name:$,props:{fill:String,outline:String,dragSize:Object,inspector:{type:Boolean,default:!0},iconSize:Object,showLabels:Boolean,paletteStrokeWidth:Number,showAllMessage:String,onCellAdded:Function,mode:String,allowClickToAdd:Boolean,autoExitDrawMode:Boolean,selectAfterAdd:{type:Boolean,default:!0},className:String,diagram:{type:Object},onVertexAdded:Function,preparedShapes:Array},setup(e){return{service:wn(s)}},data:()=>({hasMounted:!1}),mounted(){if(this.service==null&&this.diagram==null)Bn("Cannot mount DiagramPalette - no service found and Diagram not passed in as a prop");else{let e=t=>{this.hasMounted||(this.hasMounted=!0,new Vn(this.$refs.container,t,{fill:this.fill,outline:this.outline,dragSize:this.dragSize,inspector:this.inspector,iconSize:this.iconSize,showLabels:this.showLabels,paletteStrokeWidth:this.paletteStrokeWidth,showAllMessage:this.showAllMessage,onCellAdded:this.onCellAdded,mode:this.mode,allowClickToAdd:this.allowClickToAdd,autoExitDrawMode:this.autoExitDrawMode,selectAfterAdd:this.selectAfterAdd,onVertexAdded:this.onVertexAdded,preparedShapes:this.preparedShapes}))};this.diagram?e(this.diagram):this.service.diagram.value!=null?e(this.service.diagram.value):bn(this.service.diagram,e)}},render:function(){return Mn(Ln,{ref:"container"})}};var up={install:function(e,t){e.component(Ct,ge),e.component(St,Me),e.component(G,xt),e.component(H,$t),e.component(U,Ht),e.component(F,jt),e.component(k,kt),e.component(j,Yt),e.component($,we),e.component(z,he),e.component(W,me),e.component(J,fe),e.component(K,Pe),e.component(X,Ee),e.component(Y,Oe),e.component(ee,Te),e.component(Q,_e),e.component(q,Se),e.component(Z,Ce),e.component(V,Re),e.component(L,Ae),e.component(B,ve),e.component(Ot,oo),e.component(te,Ne),e.component(_t,Ie),e.provide(s,new O("root"))}};import{shallowRef as be,ref as Un}from"vue";import{EVENT_ZOOM as Ve}from"@visuallyjs/browser-ui";import{inject as Gn}from"vue";function Cp(){let e=Gn(s),t=be(null),o=be(null),r=be(null),n=Un(1);return e==null||e.getSurface(i=>{o.value=i,o.value.bind(Ve,a=>{n.value=a.zoom})}),e==null||e.getDiagram(i=>{t.value=i,t.value.$ui.bind(Ve,a=>{n.value=a.zoom})}),e==null||e.getPaper(i=>{r.value=i,r.value.bind(Ve,a=>{n.value=a.zoom})}),n}import{inject as jn,onUnmounted as Fn}from"vue";import{EVENT_DATA_UPDATED as ro,EVENT_GRAPH_CLEARED as no}from"@visuallyjs/browser-ui";function xp(e){let t=jn(s);if(t){let o=null,r=()=>{o&&e(o)},n=()=>{o&&(o.unbind(ro,r),o.unbind(no,r))},i=a=>{n(),o=a,o&&(o.bind(ro,r),o.bind(no,r),r())};t.getModel(a=>{i(a)}),Fn(()=>{n()})}}import{shallowRef as kn}from"vue";import{inject as Hn}from"vue";function Vp(){let e=Hn(s),t=kn(null);return e==null||e.getSurface(o=>{t.value=o}),t}import{shallowRef as $n}from"vue";import{inject as Wn}from"vue";function Fp(){let e=Wn(s),t=$n(null);return e==null||e.getDiagram(o=>{t.value=o}),t}import{shallowRef as zn}from"vue";import{inject as Jn}from"vue";function Jp(){let e=Jn(s),t=zn(null);return e==null||e.getPaper(o=>{t.value=o}),t}export{Ee as AreaChartComponent,he as BarChartComponent,xo as BaseGroupComponent,vo as BaseNodeComponent,_ as BrowserUIVueModel,Se as BubbleChartComponent,Et as CLASS_VUE_GROUP,Pt as CLASS_VUE_NODE,X as COMPONENT_AREA_CHART,z as COMPONENT_BAR_CHART,q as COMPONENT_BUBBLE_CHART,W as COMPONENT_COLUMN_CHART,F as COMPONENT_CONTROLS,H as COMPONENT_DIAGRAM,$ as COMPONENT_DIAGRAM_PALETTE,St as COMPONENT_DIAGRAM_PROVIDER,k as COMPONENT_EXPORT_CONTROLS,Q as COMPONENT_GAUGE_CHART,te as COMPONENT_INSPECTOR,K as COMPONENT_LINE_CHART,U as COMPONENT_MINIVIEW,j as COMPONENT_PALETTE,Y as COMPONENT_PIE_CHART,ee as COMPONENT_SANKEY_CHART,Z as COMPONENT_SCATTER_CHART,G as COMPONENT_SURFACE,Ct as COMPONENT_SURFACE_PROVIDER,J as COMPONENT_XY_CHART,oo as ColorPickerComponent,me as ColumnChartComponent,jt as ControlsComponent,ft as DEFAULT_SHAPE_HEIGHT,ht as DEFAULT_SHAPE_WIDTH,Ue as DEFAULT_VUE_SURFACE_ID,Ie as DecoratorComponent,$t as DiagramComponent,we as DiagramPaletteComponent,Me as DiagramProvider,yo as EVENT_VERTEX_UPDATED,go as EVENT_VERTICES_RENDERED,ve as EdgeTypePickerComponent,kt as ExportControlsComponent,_e as GaugeChartComponent,Ne as InspectorComponent,D as InspectorGetterSymbol,Pn as InspectorSetterSymbol,Pe as LineChartComponent,Ht as MiniviewComponent,ke as PROP_ACTIVE_TRACKING,ut as PROP_ALLOW_CLICK_TO_ADD,nt as PROP_ALLOW_DROP_ON_CANVAS,rt as PROP_ALLOW_DROP_ON_EDGE,st as PROP_ALLOW_DROP_ON_GROUP,it as PROP_ALLOW_DROP_ON_NODE,mt as PROP_CANVAS_DROP_FILTER,T as PROP_CLASS_NAME,ct as PROP_CLICK_TO_ADD_ONLY,je as PROP_CLICK_TO_CENTER,Ye as PROP_CSV_DATA,g as PROP_DATA,et as PROP_DATA_GENERATOR,ae as PROP_DATA_SOURCE_FILTER,dt as PROP_DRAG_SIZE,ot as PROP_GROUP_IDENTIFIER,Rs as PROP_ID,at as PROP_IGNORE_DROP_ON_NODE,Ke as PROP_INTERACTIVE,Ze as PROP_JSON_DATA,$e as PROP_MODE,ze as PROP_MODEL,b as PROP_MODEL_OPTIONS,lt as PROP_ON_VERTEX_ADDED,N as PROP_OPTIONS,Xe as PROP_PIVOT,We as PROP_RENDER_OPTIONS,Qe as PROP_SELECTOR,pt as PROP_SELECT_AFTER_ADD,Fe as PROP_SHOW_LASSO,f as PROP_SURFACE_ID,He as PROP_TRACK_SELECTION,Ge as PROP_TYPE_FUNCTION,tt as PROP_TYPE_GENERATOR,y as PROP_URL,qe as PROP_USE_MODEL,Je as PROP_VIEW_OPTIONS,Yt as PaletteComponent,Oe as PieChartComponent,Te as SankeyChartComponent,Ce as ScatterChartComponent,Re as ShapeComponent,Ae as ShapePaletteComponent,xt as SurfaceComponent,ge as SurfaceProvider,Ot as TAG_COLOR_PICKER,_t as TAG_DECORATOR,B as TAG_EDGE_TYPE_PICKER,V as TAG_SHAPE,L as TAG_SHAPE_PALETTE,up as VisuallyJsPlugin,O as VisuallyJsService,s as VisuallyJsServiceKey,fe as XYChartComponent,At as addSurface,js as bindToDevLifecycle,En as doProvideInspector,Qn as newInstance,Fp as useDiagram,Jp as usePaper,Vp as useSurface,xp as useVisuallyJsUpdate,Cp as useZoom};
1
+ var xo=Object.defineProperty,Do=Object.defineProperties;var Io=Object.getOwnPropertyDescriptors;var ze=Object.getOwnPropertySymbols;var wo=Object.prototype.hasOwnProperty,Vo=Object.prototype.propertyIsEnumerable;var Je=(e,t,o)=>t in e?xo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,v=(e,t)=>{for(var o in t||(t={}))wo.call(t,o)&&Je(e,o,t[o]);if(ze)for(var o of ze(t))Vo.call(t,o)&&Je(e,o,t[o]);return e},I=(e,t)=>Do(e,Io(t));import{log as Mo,BrowserUIModel as bo}from"@visuallyjs/browser-ui";var O=class extends bo{render(t,o){return Mo("render called directly on BrowserUiVue class: should not happen. Surface component should use internal render."),null}};function ks(e){return e=e||{},new O(e)}var Ke="surfaceId",Ye="paperId",Xe="typeFunction",Ze="clickToCenter",qe="showLasso",Qe="activeTracking",et="trackSelection",y="surfaceId",tt="paperId",N="className",T="data",ot="mode",w="options",B="renderOptions",x="modelOptions",j="model",G="viewOptions",g="url",rt="interactive",nt="pivot",Oe="dataSourceFilter",st="csvData",it="jsonData",at="useModel",fi="id",lt="selector",pt="dataGenerator",ct="typeGenerator",ut="groupIdentifier",dt="allowDropOnEdge",mt="allowDropOnCanvas",ht="allowDropOnGroup",ft="allowDropOnNode",Pt="ignoreDropOnNode",Ot="onVertexAdded",Et="selectAfterAdd",Ct="clickToAddOnly",_t="allowClickToAdd",St="dragSize",yt="canvasDropFilter",F="Shape",k="ShapePalette",Tt=120,gt=90,$="EdgeTypePickerComponent",Rt="ColorPickerComponent",vt="vjs-vue-node",At="vjs-vue-group",Nt="vjs-vue-overlay",H="MiniviewComponent",W="SurfaceComponent",xt="SurfaceProvider",z="PaperComponent",Dt="PaperProvider",It="DiagramProvider",J="PaletteComponent",K="ControlsComponent",Y="ExportControlsComponent",X="DiagramComponent",Z="DiagramPaletteComponent",q="ColumnChartComponent",Q="BarChartComponent",ee="XYChartComponent",te="LineChartComponent",oe="AreaChartComponent",re="PieChartComponent",ne="ScatterChartComponent",se="BubbleChartComponent",ie="GaugeChartComponent",ae="SankeyChartComponent",le="InspectorComponent",wt="SurfacePopup",Vt="Decorator";import{markRaw as C}from"vue";import{addClass as Mt,BrowserUI as bt,CLASS_DEFAULT_GROUP as Lo,CLASS_DEFAULT_NODE as Uo,ELEMENT_DIV as Lt,extend as Ut,isGroup as Bt,OptimisticEventGenerator as Bo,renderSurface as jo,updateClasses as Go,Vertex as jt,Overlay as Fo,Edge as Gt,OVERLAY_TYPE_CUSTOM as ko,uuid as $o,renderPaper as Ho}from"@visuallyjs/browser-ui";var Ee=class{constructor(){this.unrenderedVertices=new Map;this.eventManager=new Bo}vertexWillRender(t){this.unrenderedVertices.set(t.id,t)}vertexHasRendered(t){this.unrenderedVertices.delete(t.id),this.unrenderedVertices.size===0&&this.eventManager.fire(Wo)}vertexHasUpdated(t){this.eventManager.fire(zo,t)}},Wo="vertices:rendered",zo="vertex:updated",Ce=new Map;function pe(e){return Ce.has(e)||Ce.set(e,new Ee),Ce.get(e)}function Jo(e,t){pe(e).vertexHasRendered(t)}function Ko(e,t){pe(e).vertexHasUpdated(t)}function Yo(e,t){pe(e).vertexWillRender(t)}function Mi(e,t,o){pe(e).eventManager.bind(t,o)}var Ft={props:{data:Object,model:O,obj:jt,vertex:jt,ui:bt,el:Element,def:Object,eventInfo:Object},mounted(){let e=this,t=Bt(e.obj)?At:vt;e.el.firstElementChild&&Mt(e.el.firstElementChild,t),e.ui.$vertexRendered(e.obj,e.el,e.def,e.eventInfo),Jo(e.ui.id,e.obj)},methods:{getModel:function(){return this.model},removeVertex:function(){this.model.remove(this.obj)}},updated(){this.ui.$revalidateElement(this.el),Ko(this.ui.id,this.obj)}},Xo={mixins:[Ft],methods:{getNode:function(){return this.obj},removeNode:function(){this.model.removeNode(this.getNode())},updateNode:function(e){this.model.updateNode(this.obj,e);let t=this.ui.getRenderedElement(this.obj.getFullId());this.ui.$revalidateElement(t)}}},Zo={methods:{getGroup:function(){return this.obj},removeGroup:function(e){this.model.removeGroup(this.obj,e)},updateGroup:function(e){this.model.updateGroup(this.obj,e);let t=this.ui.getRenderedElement(this.obj.getFullId());this.ui.$revalidateElement(t)}},mixins:[Ft]},D=(e,t)=>{t.parentNode&&t.parentNode.removeChild(t)},kt={props:{data:Object,model:O,obj:Gt,edge:Gt,overlay:Fo,ui:bt,el:Element,def:Object,eventInfo:Object},mounted(){let e=this;e.el.firstElementChild&&Mt(e.el.firstElementChild,Nt)},updated(){this.ui.$revalidateElement(this.el)}},ce=(e,t,o,n,s,p,r,l,i)=>{let d=r.component!=null,c=Bt(l),m=[];d||m.push(c?Lo:Uo);let h=d?r.component:{render(f){return f.data.label||""}};if(h){let f=document.createElement(Lt);Go(f,m),h.mixins==null&&(h.mixins=[]);let P=c?Zo:Xo;h.mixins.find(U=>U===P)||h.mixins.push(P),Yo(p.id,l);let A={data:o,model:C(n),ui:C(p),obj:l,vertex:l,el:f,def:C(r),eventInfo:i==null?null:C(i)};if(r.inject)for(let U in r.inject){let Pe=r.inject[U],No=typeof Pe=="function"?Pe(l,n):Pe;A[U]=No}e.push({component:C(h),el:f,e:l.getFullId(),props:A})}};function $t(e,t,o,n,s,p){let r={reactive:!0,asynchronous:!0,usesWrapperElement:!1,update:(i,d,c,m)=>{},render:(i,d,c,m,h,f,P,S)=>ce(n,i,d,c,m,h,f,P,S),cleanupVertex:D,cleanupPort:D,rerender:(i,d,c,m,h,f,P,S,A)=>{D(P.id,A),ce(n,i,d,c,m,h,f,P,S)}},l=Ut(s||{},{view:p||{},id:t});return jo(e,o,r,l)}function Ht(e,t,o,n,s,p){let r={reactive:!0,asynchronous:!0,usesWrapperElement:!1,update:(i,d,c,m)=>{},render:(i,d,c,m,h,f,P,S)=>ce(n,i,d,c,m,h,f,P,S),cleanupVertex:D,cleanupPort:D,rerender:(i,d,c,m,h,f,P,S,A)=>{D(P.id,A),ce(n,i,d,c,m,h,f,P,S)}},l=Ut(s||{},{view:p||{},id:t});return Ho(e,o,r,l)}function ue(e,t,o,n){if(e.edges)for(let s in e.edges){let p=e.edges[s];p.overlays&&(p.overlays=p.overlays.map(r=>{let l,i={};return r.component!=null?{type:ko,options:{create:c=>{let m=document.createElement(Lt),h=$o();r.component.mixins==null&&(r.component.mixins=[]),r.component.mixins.indexOf(kt)===-1&&r.component.mixins.push(kt);let f=v({data:c.edge.data,model:C(o()),ui:C(t()),obj:c.edge,edge:c.edge,el:m,def:C(r),eventInfo:null},i);return n.push({component:C(r.component),el:m,e:h,props:f}),m}}}:r}))}}import{log as Wt,Paper as qo,Surface as Qo}from"@visuallyjs/browser-ui";import{shallowRef as V}from"vue";var a=Symbol.for("visuallyjs-service"),E=class{constructor(t){this.context=t;this.s=[];this.i=[];this.a=[];this.l=[];this.surface=V(null);this.model=V(null);this.paper=V(null);this.diagram=V(null);this.ui=V(null)}getSurface(t){this.t(this.i,t,this.p)}getDiagram(t){this.t(this.a,t,this.c)}getPaper(t){this.t(this.l,t,this.u)}getModel(t){this.t(this.s,t,this.r)}getModelDirect(){return this.r}t(t,o,n){if(n!=null)try{o(n)}catch(s){Wt(`WARN: could not dispatch ${s}`)}else t.push(o)}setSurface(t){this.surface.value=t,this.model.value=t.model,this.ui.value=t,this.p=t,this.n(t.model),this.o(this.i,t)}setDiagram(t){this.diagram.value=t,this.model.value=t.model,this.ui.value=t.$ui,this.c=t,this.n(t.model),t.$ui instanceof Qo?this.setSurface(t.$ui):t.$ui instanceof qo&&this.setPaper(t.$ui),this.o(this.a,t)}setPaper(t){this.paper.value=t,this.model.value=t.model,this.ui.value=t,this.u=t,this.n(t.model),this.o(this.l,t)}n(t){this.r=t,this.o(this.s,t)}o(t,o){t.forEach(n=>{try{n(o)}catch(s){Wt(`WARN: could not flush all queue entries ${s}`)}})}};import{h as M,inject as er,Teleport as zt}from"vue";import{ELEMENT_DIV as tr,EVENT_GROUP_REMOVED as or,EVENT_GROUP_UPDATED as rr,EVENT_NODE_REMOVED as nr,EVENT_NODE_UPDATED as sr,EVENT_RENDER_END as ir,clone as Jt,EVENT_EDGE_UPDATED as ar,EVENT_EDGE_REMOVED as lr}from"@visuallyjs/browser-ui";var Kt={setup(e){return{service:er(a),surfaceId:e.surfaceId||Ke}},name:W,props:{[T]:{type:Object},[B]:{type:Object},[x]:{type:Object},[G]:{type:Object},[j]:{type:Object},[g]:{type:String},[y]:{type:String}},data:function(){return{vertices:[],overlays:[]}},mounted(){let e=this,t=this.model||new O(this.modelOptions||{}),o=this.$refs.root;e.url?t.load({url:e.url}):e.data&&t.load({data:e.data});let n=Jt(this.viewOptions||{});ue(n,()=>this.surface,()=>t,this.overlays),this.surface=$t(t,this.surfaceId,o,this.vertices,Jt(this.renderOptions||{}),n),this.service.setSurface(this.surface);let s=(r,l)=>{let i=()=>{let c={};return l.originalData||l.updates?c=Object.assign(l.originalData,l.updates):l.newData&&Object.assign(c,l.newData),c},d=this.vertices.find(c=>c.e===r);d!=null&&(d.props.data=i())},p=r=>{let l=this.vertices.findIndex(i=>i.e===r);l!==-1&&this.vertices.splice(l,1)};t.bind(sr,r=>{s(r.vertex.getFullId(),r)}),t.bind(rr,r=>{s(r.vertex.getFullId(),r)}),t.bind(nr,r=>{p(r.node.id)}),t.bind(or,r=>{p(r.group.id)}),t.bind(ar,r=>{let l=r.edge.id;this.overlays.forEach(i=>{i.props.edge&&i.props.edge.id===l&&(i.props.data=r.edge.data)})}),t.bind(lr,r=>{let l=r.edge.id,i=this.overlays.length-1;for(;i>=0;)this.overlays[i].props.edge&&this.overlays[i].props.edge.id===l&&this.overlays.splice(i,1),i--}),this.surface.bind(ir,()=>setTimeout(()=>this.surface.$redrawEveryConnection()))},render:function(){let e=this.vertices.map(t=>M(zt,{to:t.el,key:t.e},[M(t.component,t.props)]));return this.overlays.forEach(t=>{e.push(M(zt,{to:t.el,key:t.e},[M(t.component,t.props)]))}),M(tr,{ref:"root",class:"vjs-vue-surface",style:{width:"100%",height:"100%"}},e.concat(this.$slots.hasOwnProperty("default")?this.$slots.default():[]))}};import{h as b,inject as pr,Teleport as Yt}from"vue";import{ELEMENT_DIV as cr,EVENT_GROUP_REMOVED as ur,EVENT_GROUP_UPDATED as dr,EVENT_NODE_REMOVED as mr,EVENT_NODE_UPDATED as hr,EVENT_RENDER_END as fr,clone as Xt,EVENT_EDGE_UPDATED as Pr,EVENT_EDGE_REMOVED as Or}from"@visuallyjs/browser-ui";var Zt={setup(e){return{service:pr(a),paperId:e.paperId||Ye}},name:z,props:{[T]:{type:Object},[B]:{type:Object},[x]:{type:Object},[G]:{type:Object},[j]:{type:Object},[g]:{type:String},[tt]:{type:String}},data:function(){return{vertices:[],overlays:[]}},mounted(){let e=this,t=this.model||new O(this.modelOptions||{}),o=this.$refs.root;e.url?t.load({url:e.url}):e.data&&t.load({data:e.data});let n=Xt(this.viewOptions||{});ue(n,()=>this.paper,()=>t,this.overlays),this.paper=Ht(t,this.paperId,o,this.vertices,Xt(this.renderOptions||{}),n),this.service.setPaper(this.paper);let s=(r,l)=>{let i=()=>{let c={};return l.originalData||l.updates?c=Object.assign(l.originalData,l.updates):l.newData&&Object.assign(c,l.newData),c},d=this.vertices.find(c=>c.e===r);d!=null&&(d.props.data=i())},p=r=>{let l=this.vertices.findIndex(i=>i.e===r);l!==-1&&this.vertices.splice(l,1)};t.bind(hr,r=>{s(r.vertex.getFullId(),r)}),t.bind(dr,r=>{s(r.vertex.getFullId(),r)}),t.bind(mr,r=>{p(r.node.id)}),t.bind(ur,r=>{p(r.group.id)}),t.bind(Pr,r=>{let l=r.edge.id;this.overlays.forEach(i=>{i.props.edge&&i.props.edge.id===l&&(i.props.data=r.edge.data)})}),t.bind(Or,r=>{let l=r.edge.id,i=this.overlays.length-1;for(;i>=0;)this.overlays[i].props.edge&&this.overlays[i].props.edge.id===l&&this.overlays.splice(i,1),i--}),this.paper.bind(fr,()=>setTimeout(()=>this.paper.$redrawEveryConnection()))},render:function(){let e=this.vertices.map(t=>b(Yt,{to:t.el,key:t.e},[b(t.component,t.props)]));return this.overlays.forEach(t=>{e.push(b(Yt,{to:t.el,key:t.e},[b(t.component,t.props)]))}),b(cr,{ref:"root",class:"vjs-vue-paper",style:{width:"100%",height:"100%"}},e.concat(this.$slots.hasOwnProperty("default")?this.$slots.default():[]))}};import{h as u,inject as Er,watch as Cr}from"vue";import{LassoPlugin as _r,SURFACE_MODE_SELECT as qt,SURFACE_MODE_PAN as Qt,PAN_PATH as Sr,PAN_VIEW_BOX as yr,LASSO_PATH as Tr,LASSO_VIEW_BOX as gr,ZOOM_TO_FIT_PATH as Rr,ZOOM_TO_FIT_VIEW_BOX as vr,EVENT_UNDOREDO_UPDATE as Ar,TRUE as eo,FALSE as to,EVENT_SURFACE_MODE_CHANGED as Nr,ELEMENT_DIV as oo,ATTRIBUTE_CONTROLS_ORIENTATION as xr,ZOOM_IN_OUT_VIEW_BOX as ro,ZOOM_IN_PATH as Dr,ZOOM_OUT_PATH as Ir,RESET_SELECTION_PATH as wr,RESET_SELECTION_VIEW_BOX as Vr,CLEAR_PATH as Mr,CLEAR_VIEW_BOX as br,ATTRIBUTE_RESET_SELECTION as Lr,CLASS_CONTROLS_RESET_SELECTION as Ur,EVENT_SELECT as Br,EVENT_DESELECT as jr,EVENT_SELECTION_CLEARED as Gr,supportsPathEditing as Fr}from"@visuallyjs/browser-ui";var kr="Clear dataset?",_e="vjs-selected-mode",no="can-undo",so="can-redo",$r="data-undo",Hr="data-redo",io="data-mode",Wr="data-reset",zr="data-clear",Jr="data-zoom-in",Kr="data-zoom-out",ao="vjs-controls-has-selection",lo={setup(e){return{service:Er(a)}},name:K,props:{clear:{type:Boolean,default:!0},[y]:{type:String},undoRedo:{type:Boolean,default:!0},orientation:{type:String,default:"row"},zoomToExtents:{type:Boolean,default:!0},zoomButtons:{type:Boolean,default:!1},clearMessage:{type:String,default:kr},onMaybeClear:{type:Function},className:{type:String,default:""}},methods:{panMode:function(){var e;(e=this.service.surface.value)==null||e.setMode(Qt)},selectMode:function(){var e;(e=this.service.surface.value)==null||e.setMode(qt)},zoomToFit:function(){var e;(e=this.service.surface.value)==null||e.zoomToFit()},doClear:function(){let e=this.service.surface.value;e&&(this.onMaybeClear!=null?this.onMaybeClear(()=>e.model.clear()):window.confirm(this.clearMessage)&&e.model.clear())},undo:function(){var e;(e=this.service.model.value)==null||e.undo()},redo:function(){var e;(e=this.service.model.value)==null||e.redo()},zoomIn:function(){var e;(e=this.service.surface.value)==null||e.zoomIn()},zoomOut:function(){var e;(e=this.service.surface.value)==null||e.zoomOut()},resetSelection(){let e=this.service.surface.value;e&&(e.model.clearSelection(),Fr(e)&&e.stopEditingPath())},updateSelectionState:function(){let e=this.service.surface.value;e&&(e.model.getSelection().isEmpty()?this.$refs.root.removeAttribute(ao):this.$refs.root.setAttribute(ao,"true"))}},data:function(){return{ready:!1,hasLasso:!1}},render(){if(this.ready){let e=[];return this.showPan&&(e.push(u("i",{class:`vjs-pan-mode ${_e}`,[io]:Qt,onClick:()=>this.panMode(),title:"Pan mode"},[u("svg",{viewBox:yr,stroke:"currentColor",fill:"none"},[u("path",{d:Sr})])])),e.push(u("i",{class:"vjs-select-mode",[io]:qt,onClick:()=>this.selectMode(),title:"Select mode"},[u("svg",{viewBox:gr,stroke:"currentColor",fill:"currentColor"},[u("path",{d:Tr})])]))),this.undoRedo&&(e.push(u("i",{class:"vjs-undo",[$r]:!0,title:"Undo last action",onClick:()=>this.undo()})),e.push(u("i",{class:"vjs-redo",[Hr]:!0,title:"Redo last action",onClick:()=>this.redo()}))),this.zoomToExtents&&e.push(u("i",{class:"vjs-zoom-to-fit",[Wr]:"true",onClick:()=>this.zoomToFit(),title:"Zoom to Fit"},[u("svg",{viewBox:vr,stroke:"currentColor",fill:"currentColor"},[u("path",{d:Rr})])])),this.zoomButtons&&(e.push(u("i",{class:"vjs-zoom-in",[Jr]:"true",onClick:()=>this.zoomIn(),title:"Zoom In"},[u("svg",{viewBox:ro,stroke:"currentColor",fill:"currentColor"},[u("path",{d:Dr})])])),e.push(u("i",{class:"vjs-zoom-out",[Kr]:"true",onClick:()=>this.zoomOut(),title:"Zoom Out"},[u("svg",{viewBox:ro,stroke:"currentColor",fill:"currentColor"},[u("path",{d:Ir})])]))),e.push(u("i",{class:Ur,[Lr]:"true",onClick:()=>{this.resetSelection()}},[u("svg",{viewBox:Vr,stroke:"currentColor",fill:"currentColor"},[u("path",{d:wr})])])),this.clear&&e.push(u("i",{class:"vjs-clear-dataset",[zr]:"true",onClick:()=>{this.doClear()}},[u("svg",{viewBox:br,stroke:"currentColor",fill:"currentColor"},[u("path",{d:Mr})])])),u(oo,{class:`vjs-controls ${this.className}`,ref:"root",[no]:!1,[so]:!1,[xr]:this.orientation},e)}else return u(oo,{ref:"root"})},mounted(){let e=t=>{let o=t.getPlugin(_r.type);this.showPan=o!=null,t.bind(Nr,n=>{t.removeClass(t.$getSelector(this.$refs.root,"[data-mode]"),_e),t.addClass(t.$getSelector(this.$refs.root,"[data-mode='"+n+"']"),_e)}),t.model.bind(Ar,n=>{this.$refs.root.setAttribute(no,n.undoCount>0?eo:to),this.$refs.root.setAttribute(so,n.redoCount>0?eo:to)}),t.model.bind(Br,()=>this.updateSelectionState()),t.model.bind(jr,()=>this.updateSelectionState()),t.model.bind(Gr,()=>this.updateSelectionState()),this.ready=!0};this.service.surface.value==null?Cr(this.service.surface,e):e(this.service.surface.value)}};import{h as R,inject as Yr}from"vue";import{CLASS_CONTROLS as Xr,CLASS_EXPORT_CONTROLS as Zr,ELEMENT_DIV as qr,ImageExportUI as po,SvgExportUI as Qr,TYPE_JPG as en,TYPE_PNG as tn,TYPE_SVG as on}from"@visuallyjs/browser-ui";var co={name:Y,setup(e){return{service:Yr(a)}},props:{surfaceId:{type:String},showLabel:{type:Boolean,default:!0},label:{type:String,default:"Export :"},margins:{type:Object},svgOptions:{type:Object},imageOptions:{type:Object},allowSvgExport:{type:Boolean,default:!0},allowPngExport:{type:Boolean,default:!0},allowJpgExport:{type:Boolean,default:!0}},methods:{loadSurface:function(e){let t=this.service.surface.value;t&&e(t)},exportSVG:function(){this.loadSurface(e=>{let t=this.svgOptions||{};this.margins!=null&&t.margins==null&&Object.assign(t,this.margins),new Qr(e).export(t)})},exportJPG:function(){this.loadSurface(e=>{let t=this.imageOptions||{};this.margins!=null&&t.margins==null&&Object.assign(t,this.margins),t.type="image/jpeg",new po(e).export(t)})},exportPNG:function(){this.loadSurface(e=>{let t=this.imageOptions||{};this.margins!=null&&t.margins==null&&Object.assign(t,this.margins),new po(e).export(t)})}},render(){let e=this.showLabel!==!1,t=this.allowSvgExport!==!1,o=this.allowPngExport!==!1,n=this.allowJpgExport!==!1,s=[];return t&&s.push(R("i",{},[R("a",{href:"#","data-type":on,onClick:()=>this.exportSVG()},"SVG")])),o&&s.push(R("i",{},[R("a",{href:"#","data-type":tn,onClick:()=>this.exportPNG()},"PNG")])),n&&s.push(R("i",{},[R("a",{href:"#","data-type":en,onClick:()=>this.exportJPG()},"JPG")])),e&&s.unshift(R("span",{},[this.label])),R(qr,{class:`${Xr} ${Zr}`},s)}};import{h as rn,inject as nn,watch as sn}from"vue";import{ELEMENT_DIV as an,MiniviewPlugin as ln}from"@visuallyjs/browser-ui";var uo={setup(e){return{service:nn(a)}},name:H,props:{[y]:{type:String},[N]:{type:String,default:""},[Qe]:{type:Boolean,default:!0},[Ze]:{type:Boolean,default:!0},[qe]:{type:Boolean,default:!0},[et]:{type:Boolean,default:!0},[Xe]:{type:Function}},mounted:function(){let e=t=>{t.addPlugin({type:ln.type,options:{container:this.$el,activeTracking:this.activeTracking,clickToCenter:this.clickToCenter,showLasso:this.showLasso,trackSelection:this.trackSelection,typeFunction:this.typeFunction}})};this.service.surface.value!=null?e(this.service.surface.value):sn(this.service.surface,e)},render:function(e){return rn(an,{ref:"root",class:e.className})}};import{h as pn,inject as cn,markRaw as un}from"vue";import{createDiagram as dn,ELEMENT_DIV as mn}from"@visuallyjs/browser-ui";var mo={setup(e){return{service:cn(a)}},name:X,props:{[T]:{type:Object},[g]:{type:String},[x]:{type:Object},[w]:{type:Object}},mounted(){let e=this.$refs.root;this.diagram=un(dn(e,this.options,this.modelOptions)),this.service.setDiagram(this.diagram),this.data?this.diagram.load({data:this.data}):this.url&&this.diagram.load({url:this.url})},render:function(){return pn(mn,{ref:"root",class:"vjs-vue-surface",style:{width:"100%",height:"100%"}},this.$slots.hasOwnProperty("default")?this.$slots.default():[])}};import{h as ho,inject as hn,watch as fo}from"vue";import{ColumnChart as fn,BarChart as Pn,CategoryValueChart as On,ELEMENT_DIV as Po,LineChart as En,AreaChart as Cn,PieChart as _n,ScatterChart as Sn,BubbleChart as yn,GaugeChart as Tn,SankeyChart as gn}from"@visuallyjs/browser-ui";var Oo={[N]:{type:String},[T]:{type:Object},[g]:{type:String},[at]:{type:Boolean,default:!1}},Eo={setup(){return{service:hn(a)}},render:function(){return ho(Po,{class:`${this.className}`,ref:"root"})}};function _(e,t,o=!0){let n=I(v({},Oo),{[w]:{type:Object}}),s={};return o&&(n[Oe]={type:Function},s[Oe]=function(p){this.chart.setDataSourceFilter(p)}),I(v({},Eo),{name:e,props:n,watch:s,data:()=>({hasMounted:!1}),mounted(){let p=this.$refs.root,r=o?Object.assign({dataSourceFilter:this.dataSourceFilter},this.options):this.options;this.data&&(r.data=this.data),this.url&&(r.url=this.url);let l=()=>{this.hasMounted=!0,this.chart=new t(p,r)};this.useModel?this.service.model.value!=null?(r.dataSource=this.service.model.value,l()):fo(this.service.model,i=>{this.hasMounted||(r.dataSource=i,l())}):l()}})}var Se=_(q,fn),ye=_(Q,Pn),Te=_(ee,On,!1),ge=_(re,_n),Re=_(te,En),ve=_(oe,Cn),Ae=_(ne,Sn),Ne=_(se,yn),xe=_(ie,Tn,!1),De=I(v({},Eo),{name:ae,props:I(v({},Oo),{[st]:{type:String},[it]:{type:Object},[rt]:{type:Boolean},[nt]:{type:String},[w]:{type:Object}}),data:()=>({hasMounted:!1}),mounted(){let e=this.$refs.root,t=Object.assign({},this.options);this.interactive!=null&&(t.interactive=this.interactive),this.pivot!=null&&(t.pivot=this.pivot),this.csvData&&(t.csvData=this.csvData),this.jsonData&&(t.jsonData=this.jsonData),this.url&&(t.url=this.url);let o=()=>{this.hasMounted=!1,this.chart=new gn(e,t)};if(this.useModel){let n=s=>{this.hasMounted||(t.dataSource=s,o())};this.service.model.value==null?fo(this.service.model,n):n(this.service.model.value)}else o()},watch:{pivot(e){this.chart&&this.chart.pivot(e)}},render:function(){return ho(Po,{class:`${this.className}`,ref:"root"})}});import{h as Rn,inject as vn,watch as An}from"vue";import{defaultDataGenerator as Nn,ELEMENT_DIV as xn,Palette as Dn}from"@visuallyjs/browser-ui";var Co={setup(e){return{service:vn(a)}},name:J,props:{[y]:{type:String},[lt]:{type:String},[pt]:{type:Function},[ct]:{type:Function},[ut]:{type:Function},[dt]:{type:Boolean,default:!1},[mt]:{type:Boolean,default:!0},[ht]:{type:Boolean,default:!0},[ft]:{type:Boolean,default:!1},[Pt]:{type:Boolean,default:!1},[St]:Object,[Ot]:Function,[yt]:Function,[N]:String,[ot]:String,[Et]:{type:Boolean,default:!1},[_t]:{type:Boolean,default:!1},[Ct]:{type:Boolean,default:!1}},mounted:function(){let e=t=>{let o={source:this.$refs.root,selector:this.selector,dataGenerator:n=>this.dataGenerator?this.dataGenerator(n):Nn(n),allowDropOnEdge:this.allowDropOnEdge===!0,allowDropOnGroup:this.allowDropOnGroup!==!1,allowDropOnCanvas:this.allowDropOnCanvas!==!1,allowDropOnNode:this.allowDropOnNode===!0,ignoreDropOnNode:this.ignoreDropOnNode===!0,canvasDropFilter:this.canvasDropFilter,onVertexAdded:this.onVertexAdded,dragSize:this.dragSize,mode:this.mode};this.groupIdentifier!=null&&(o.groupIdentifier=this.groupIdentifier),this.typeGenerator!=null&&(o.typeGenerator=this.typeGenerator),this.palette=new Dn(t,o)};this.service.surface.value==null?An(this.service.surface,e):e(this.service.surface.value)},render:function(){return Rn(xn,{ref:"root",class:this.className||""},this.$slots.hasOwnProperty("default")?this.$slots.default():[])}};import{provide as In}from"vue";var Ie={setup(){In(a,new E("SurfaceProvider"))},render(){return this.$slots.hasOwnProperty("default")?this.$slots.default():[]}};import{provide as wn}from"vue";var we={setup(){wn(a,new E("PaperProvider"))},render(){return this.$slots.hasOwnProperty("default")?this.$slots.default():[]}};import{h as Vn,inject as Mn,watch as bn}from"vue";import{CLASS_SHAPE as Ln,convertToMultilineText as _o,DEFAULT_LABEL_FILL_RATIO as Ve,ELEMENT_SVG as Un}from"@visuallyjs/browser-ui";var Me={name:F,props:{data:{type:Object},showLabels:{type:Boolean,default:!1},labelProperty:{type:String,default:"label"},labelStrokeWidth:{type:Number},multilineLabels:{type:Boolean,default:!0},labelFillRatio:{type:Number,default:Ve},labelColor:{type:String,default:"#000000"},font:{type:Object}},setup(){return{service:Mn(a)}},mounted(){let e=t=>{let o=t.getShapeLibrary(),n=o.renderCompiledShape(Object.assign({sw:this.getOutlineWidth()},this.data));if(this.$refs.container.appendChild(n),this.showLabels){let s=o.renderShapeLabel(this.data,this.labelProperty,this.labelStrokeWidth,null,this.labelColor,this.labelColor,this.font);this.$refs.container.appendChild(s),this.multilineLabels!=!1&&_o(s,this.data[this.labelProperty]||"",this.getWidth()*(this.labelFillRatio||Ve))}};this.service.ui.value==null?bn(this.service.ui,e):e(this.service.ui.value)},updated(){let e=this.service.surface.value;if(e){let t=e.getShapeLibrary(),o=t.renderCompiledShape(Object.assign({sw:this.getOutlineWidth()},this.data));if(this.$refs.container.replaceChildren(o),this.showLabels){let n=t.renderShapeLabel(this.data,this.labelProperty,this.labelStrokeWidth,null,this.labelColor,this.labelColor,this.font);this.$refs.container.appendChild(n),this.multilineLabels!=!1&&_o(n,this.data[this.labelProperty]||"",this.getWidth()*(this.labelFillRatio||Ve))}}},render:function(){return Vn(Un,{ref:"container",preserveAspectRatio:"none",fill:this.getFill(),stroke:this.getOutline(),"stroke-width":this.getOutlineWidth(),viewBox:"0 0 "+this.getWidth()+" "+this.getHeight(),class:Ln})},methods:{getWidth:function(){return this.data.width||Tt},getHeight:function(){return this.data.height||gt},getFill:function(){return this.data.fill||"#FFFFFF"},getOutline:function(){return this.data.outline||"#000000"},getOutlineWidth(){return this.data.outlineWidth||2}}};import{h as Bn,inject as jn,watch as Gn}from"vue";import{ELEMENT_DIV as Fn,ShapePalette as kn}from"@visuallyjs/browser-ui";var be={name:k,props:{surfaceId:{type:String},dragSize:Object,iconSize:Object,fill:String,outline:String,showAllMessage:String,selectAfterDrop:Boolean,paletteStrokeWidth:Number,dataGenerator:Function,initialSet:String,mode:String,allowClickToAdd:Boolean,onVertexAdded:Function,showLabels:Boolean,inspector:{type:Boolean,default:!0},preparedShapes:Array},setup(e){return{service:jn(a)}},data:()=>({hasMounted:!1}),mounted(){let e=t=>{this.hasMounted||(this.hasMounted=!0,new kn(t,{container:this.$refs.container,shapeLibrary:t.getShapeLibrary(),dragSize:this.dragSize,iconSize:this.iconSize,fill:this.fill,outline:this.outline,showAllMessage:this.showAllMessage,selectAfterDrop:this.selectAfterDrop,paletteStrokeWidth:this.paletteStrokeWidth,dataGenerator:this.dataGenerator,initialSet:this.initialSet,mode:this.mode,allowClickToAdd:this.allowClickToAdd,onVertexAdded:this.onVertexAdded,showLabels:this.showLabels,inspector:this.inspector,preparedShapes:this.preparedShapes}))};this.service.surface.value==null?Gn(this.service.surface,e):e(this.service.surface.value)},render:function(){return Bn(Fn,{ref:"container"})}};import{provide as So,readonly as $n,inject as Hn,h as Wn,watch as zn}from"vue";import{ELEMENT_DIV as Jn,Inspector as Kn,log as Yn}from"@visuallyjs/browser-ui";var L=Symbol.for("VueInspectorGetter"),Xn=Symbol.for("VueInspectorSetter");function Zn(){let e=[],t=null;function o(p){try{p(t)}catch(r){Yn("WARN: inspector listener threw an exception",r)}}let n={listen:p=>{t!=null?o(p):e.push(p)}},s={inspector:p=>{t=p,e.forEach(o)}};return So(Xn,s),So(L,$n(n)),s}var Le={name:le,props:{autoCommit:{type:Boolean,default:!0},multipleSelections:{type:Boolean,default:!0},filter:Function,renderEmptyContainer:Function,refresh:Function,className:String,showCloseButton:Boolean,afterUpdate:Function,modelValue:Object},emits:["update:modelValue"],setup(e,t){let o=Zn();return{service:Hn(a),inspectorProvider:o,inspector:null,emit:t.emit}},mounted(){let e=t=>{if(this.inspector==null){let o=new Kn({container:this.$refs.root,ui:t,renderEmptyContainer:()=>(this.emit("update:modelValue",null),this.renderEmptyContainer?this.renderEmptyContainer():""),refresh:(n,s)=>{this.emit("update:modelValue",n),this.refresh&&this.refresh(n),setTimeout(s)},autoCommit:this.autoCommit,multipleSelections:this.multipleSelections,filter:this.filter,showCloseButton:this.showCloseButton,afterUpdate:()=>this.afterUpdate?this.afterUpdate(t):null});this.inspectorProvider.inspector(o)}};this.service.surface.value==null?zn(this.service.surface,e):e(this.service.surface.value)},render(){return Wn(Jn,{ref:"root"},this.$slots.hasOwnProperty("default")?this.$slots.default():[])}};import{h as qn,inject as Qn}from"vue";import{EdgeTypePicker as es,ELEMENT_DIV as ts,log as os}from"@visuallyjs/browser-ui";var Ue={name:$,props:{propertyName:String},setup(){return{inspectorProvider:Qn(L)}},mounted(){this.inspectorProvider?this.inspectorProvider.listen(e=>{let t=new es(e.$ui,this.$refs.container,e.$ui.$getEdgePropertyMappings(),e.getValue(this.propertyName),(o,n)=>{e.setValue(this.propertyName,n,null)});t.render(this.propertyName,e.m),e.onChange(()=>{t.select(this.propertyName,e.getValue(this.propertyName))})}):os("WARN: EdgeTypePicker not instantiated inside an InspectorComponent. Cannot mount.")},render:function(){return qn(ts,{ref:"container"})}};import{h as de,inject as rs}from"vue";import{CLASS_COLOR_PICKER as yo,CLASS_COLOR_PICKER_SWATCH as To,CLASS_COLOR_PICKER_SWATCHES as go,EVENT_CONTEXT_UPDATE as ns,ELEMENT_DIV as Be,INSPECTOR_CONTEXT_RECENT_COLORS as me}from"@visuallyjs/browser-ui";var Ro={render(){let e=this.swatches.map(t=>de(Be,{title:t,class:To,style:`background-color:${t}`,"data-color":t,onClick:()=>this.selectSwatch(t)}));return de(Be,{class:`${yo}`},[de("input",{type:"color","vjs-att":this.propertyName,ref:"colorInput"}),de(Be,{class:go},e)])},props:{propertyName:String,maxColors:{type:Number,default:10}},data:()=>({CLASS_COLOR_PICKER:yo,CLASS_COLOR_PICKER_SWATCHES:go,CLASS_COLOR_PICKER_SWATCH:To,colorInput:null,swatches:[]}),mounted(){let e=rs(L);e&&e.listen(t=>{this.inspector=t,this.swatches=t.ensureContext(me,()=>[]),this.colorInput=this.$refs.colorInput,this.colorInput.addEventListener("change",this.colorPicked),t.bind(ns,o=>{o.key===me&&(this.swatches=o.value.slice())}),t.bind("change",this.setCurrentColor),this.setCurrentColor()})},methods:{addColor:function(e){let t=this.inspector.ensureContext(me,()=>[]);if(e=e.toUpperCase(),!(t.find(n=>n.toUpperCase()===e)!=null)){let n=this.maxColors||10,s=t.slice();s.unshift(e),s.length>n&&(s.length=n),this.inspector.updateContext(me,s)}},colorPicked:function(){let e=this.colorInput.value;this.inspector.setValue(this.propertyName,e,null),this.addColor(e)},selectSwatch:function(e){this.inspector.setValue(this.propertyName,e,null),this.colorInput.value=e},setCurrentColor:function(){let e=this.inspector.getValue(this.propertyName);e!=null&&(this.colorInput.value=e,this.addColor(e))}}};import{h as he,inject as ss,nextTick as is,Teleport as as,watch as ls}from"vue";import{ELEMENT_DIV as je,uuid as ps}from"@visuallyjs/browser-ui";var Ge={props:{placement:{type:String,default:"floating"},position:{type:Object},constraints:{type:Object}},data:()=>({hasMounted:!1,surface:null}),setup(e){return{service:ss(a)}},mounted(){let e=t=>{if(!this.hasMounted){this.surface=t,this.hasMounted=!0;let o=this.position||{x:0,y:0};is().then(()=>{this.placement==="floating"?t.floatElement(this.$refs.root,o):t.fixElement(this.$refs.fixedEl,o,this.constraints)})}};this.service.surface.value==null?ls(this.service.surface,e):e(this.service.surface.value)},render(){return he(je,{ref:"root"},this.hasMounted?this.placement==="floating"?he(je,{},this.$slots.hasOwnProperty("default")?this.$slots.default():[]):he(as,{to:this.surface.vertexLayer,key:ps()},he(je,{ref:"fixedEl"},this.$slots.hasOwnProperty("default")?this.$slots.default():[])):[])}};import{provide as cs}from"vue";var Fe={setup(){cs(a,new E("DiagramProvider"))},render(){return this.$slots.hasOwnProperty("default")?this.$slots.default():[]}};import{h as us,inject as ds,watch as ms}from"vue";import{DiagramPalette as hs,ELEMENT_DIV as fs,log as Ps}from"@visuallyjs/browser-ui";var ke={name:Z,props:{fill:String,outline:String,dragSize:Object,inspector:{type:Boolean,default:!0},iconSize:Object,showLabels:Boolean,paletteStrokeWidth:Number,showAllMessage:String,onCellAdded:Function,mode:String,allowClickToAdd:Boolean,autoExitDrawMode:Boolean,selectAfterAdd:{type:Boolean,default:!0},className:String,diagram:{type:Object},onVertexAdded:Function,preparedShapes:Array},setup(e){return{service:ds(a)}},data:()=>({hasMounted:!1}),mounted(){if(this.service==null&&this.diagram==null)Ps("Cannot mount DiagramPalette - no service found and Diagram not passed in as a prop");else{let e=t=>{this.hasMounted||(this.hasMounted=!0,new hs(this.$refs.container,t,{fill:this.fill,outline:this.outline,dragSize:this.dragSize,inspector:this.inspector,iconSize:this.iconSize,showLabels:this.showLabels,paletteStrokeWidth:this.paletteStrokeWidth,showAllMessage:this.showAllMessage,onCellAdded:this.onCellAdded,mode:this.mode,allowClickToAdd:this.allowClickToAdd,autoExitDrawMode:this.autoExitDrawMode,selectAfterAdd:this.selectAfterAdd,onVertexAdded:this.onVertexAdded,preparedShapes:this.preparedShapes}))};this.diagram?e(this.diagram):this.service.diagram.value!=null?e(this.service.diagram.value):ms(this.service.diagram,e)}},render:function(){return us(fs,{ref:"container"})}};import{BLOCK as Os,ELEMENT_DIV as Es,NONE as Cs,PopupHandler as _s,CLASS_SURFACE_POPUP as Ss,ABSOLUTE as ys}from"@visuallyjs/browser-ui";import{h as Ts,inject as gs,onMounted as Rs,ref as fe,watch as vs}from"vue";var $e={name:"SurfacePopup",props:{selector:String,anchor:{type:String,default:"bottom"}},setup(e){let t=gs(a),o=fe(null),n=fe("block"),s=fe(null),p=fe(null),r=l=>{p.value=new _s(e.selector,s.value,l,i=>{o.value=i,i==null?n.value=Cs:(n.value=Os,requestAnimationFrame(()=>p.value.$positionPopup()))},e.anchor)};return Rs(()=>{t.surface.value==null?vs(t.surface,r):r(t.surface.value)}),{service:t,current:o,display:n,rootRef:s,handler:p}},render(){var e;return Ts(Es,{ref:"rootRef",display:this.display,position:ys,class:Ss},this.$slots.hasOwnProperty("default")?this.$slots.default({vertex:this.current,model:(e=this.service.surface.value)==null?void 0:e.model,ui:this.service.surface.value,hide:()=>{var t;return(t=this.handler.value)==null?void 0:t.$hide()}}):[])}};var $c={install:function(e,t){e.component(xt,Ie),e.component(Dt,we),e.component(It,Fe),e.component(W,Kt),e.component(z,Zt),e.component(X,mo),e.component(H,uo),e.component(K,lo),e.component(Y,co),e.component(J,Co),e.component(Z,ke),e.component(Q,ye),e.component(q,Se),e.component(ee,Te),e.component(te,Re),e.component(oe,ve),e.component(re,ge),e.component(ae,De),e.component(ie,xe),e.component(se,Ne),e.component(ne,Ae),e.component(F,Me),e.component(k,be),e.component($,Ue),e.component(Rt,Ro),e.component(le,Le),e.component(Vt,Ge),e.component(wt,$e),e.provide(a,new E("root"))}};import{shallowRef as He,ref as As}from"vue";import{EVENT_ZOOM as We}from"@visuallyjs/browser-ui";import{inject as Ns}from"vue";function Zc(){let e=Ns(a),t=He(null),o=He(null),n=He(null),s=As(1);return e==null||e.getSurface(p=>{o.value=p,o.value.bind(We,r=>{s.value=r.zoom})}),e==null||e.getDiagram(p=>{t.value=p,t.value.$ui.bind(We,r=>{s.value=r.zoom})}),e==null||e.getPaper(p=>{n.value=p,n.value.bind(We,r=>{s.value=r.zoom})}),s}import{inject as xs,onUnmounted as Ds}from"vue";import{EVENT_DATA_UPDATED as vo,EVENT_GRAPH_CLEARED as Ao}from"@visuallyjs/browser-ui";function au(e){let t=xs(a);if(t){let o=null,n=()=>{o&&e(o)},s=()=>{o&&(o.unbind(vo,n),o.unbind(Ao,n))},p=r=>{s(),o=r,o&&(o.bind(vo,n),o.bind(Ao,n),n())};t.getModel(r=>{p(r)}),Ds(()=>{s()})}}import{shallowRef as Is}from"vue";import{inject as ws}from"vue";function mu(){let e=ws(a),t=Is(null);return e==null||e.getSurface(o=>{t.value=o}),t}import{shallowRef as Vs}from"vue";import{inject as Ms}from"vue";function Cu(){let e=Ms(a),t=Vs(null);return e==null||e.getDiagram(o=>{t.value=o}),t}import{shallowRef as bs}from"vue";import{inject as Ls}from"vue";function Ru(){let e=Ls(a),t=bs(null);return e==null||e.getPaper(o=>{t.value=o}),t}export{ue as $initialiseVueOverlays,ve as AreaChartComponent,ye as BarChartComponent,Zo as BaseGroupComponent,Xo as BaseNodeComponent,kt as BaseOverlayComponent,O as BrowserUIVueModel,Ne as BubbleChartComponent,At as CLASS_VUE_GROUP,vt as CLASS_VUE_NODE,Nt as CLASS_VUE_OVERLAY,oe as COMPONENT_AREA_CHART,Q as COMPONENT_BAR_CHART,se as COMPONENT_BUBBLE_CHART,q as COMPONENT_COLUMN_CHART,K as COMPONENT_CONTROLS,X as COMPONENT_DIAGRAM,Z as COMPONENT_DIAGRAM_PALETTE,It as COMPONENT_DIAGRAM_PROVIDER,Y as COMPONENT_EXPORT_CONTROLS,ie as COMPONENT_GAUGE_CHART,le as COMPONENT_INSPECTOR,te as COMPONENT_LINE_CHART,H as COMPONENT_MINIVIEW,J as COMPONENT_PALETTE,z as COMPONENT_PAPER,Dt as COMPONENT_PAPER_PROVIDER,re as COMPONENT_PIE_CHART,ae as COMPONENT_SANKEY_CHART,ne as COMPONENT_SCATTER_CHART,W as COMPONENT_SURFACE,wt as COMPONENT_SURFACE_POPUP,xt as COMPONENT_SURFACE_PROVIDER,ee as COMPONENT_XY_CHART,Ro as ColorPickerComponent,Se as ColumnChartComponent,lo as ControlsComponent,gt as DEFAULT_SHAPE_HEIGHT,Tt as DEFAULT_SHAPE_WIDTH,Ye as DEFAULT_VUE_PAPER_ID,Ke as DEFAULT_VUE_SURFACE_ID,Ge as DecoratorComponent,mo as DiagramComponent,ke as DiagramPaletteComponent,Fe as DiagramProvider,zo as EVENT_VERTEX_UPDATED,Wo as EVENT_VERTICES_RENDERED,Ue as EdgeTypePickerComponent,co as ExportControlsComponent,xe as GaugeChartComponent,Le as InspectorComponent,L as InspectorGetterSymbol,Xn as InspectorSetterSymbol,Re as LineChartComponent,uo as MiniviewComponent,Qe as PROP_ACTIVE_TRACKING,_t as PROP_ALLOW_CLICK_TO_ADD,mt as PROP_ALLOW_DROP_ON_CANVAS,dt as PROP_ALLOW_DROP_ON_EDGE,ht as PROP_ALLOW_DROP_ON_GROUP,ft as PROP_ALLOW_DROP_ON_NODE,yt as PROP_CANVAS_DROP_FILTER,N as PROP_CLASS_NAME,Ct as PROP_CLICK_TO_ADD_ONLY,Ze as PROP_CLICK_TO_CENTER,st as PROP_CSV_DATA,T as PROP_DATA,pt as PROP_DATA_GENERATOR,Oe as PROP_DATA_SOURCE_FILTER,St as PROP_DRAG_SIZE,ut as PROP_GROUP_IDENTIFIER,fi as PROP_ID,Pt as PROP_IGNORE_DROP_ON_NODE,rt as PROP_INTERACTIVE,it as PROP_JSON_DATA,ot as PROP_MODE,j as PROP_MODEL,x as PROP_MODEL_OPTIONS,Ot as PROP_ON_VERTEX_ADDED,w as PROP_OPTIONS,tt as PROP_PAPER_ID,nt as PROP_PIVOT,B as PROP_RENDER_OPTIONS,lt as PROP_SELECTOR,Et as PROP_SELECT_AFTER_ADD,qe as PROP_SHOW_LASSO,y as PROP_SURFACE_ID,et as PROP_TRACK_SELECTION,Xe as PROP_TYPE_FUNCTION,ct as PROP_TYPE_GENERATOR,g as PROP_URL,at as PROP_USE_MODEL,G as PROP_VIEW_OPTIONS,Co as PaletteComponent,Zt as PaperComponent,we as PaperProvider,ge as PieChartComponent,De as SankeyChartComponent,Ae as ScatterChartComponent,Me as ShapeComponent,be as ShapePaletteComponent,Kt as SurfaceComponent,$e as SurfacePopup,Ie as SurfaceProvider,Rt as TAG_COLOR_PICKER,Vt as TAG_DECORATOR,$ as TAG_EDGE_TYPE_PICKER,F as TAG_SHAPE,k as TAG_SHAPE_PALETTE,$c as VisuallyJsPlugin,E as VisuallyJsService,a as VisuallyJsServiceKey,Te as XYChartComponent,Ht as addPaper,$t as addSurface,Mi as bindToDevLifecycle,Zn as doProvideInspector,ks as newInstance,Cu as useDiagram,Ru as usePaper,mu as useSurface,au as useVisuallyJsUpdate,Zc as useZoom};
package/vue-wrapper.d.ts CHANGED
@@ -1,11 +1,11 @@
1
- import { BrowserUI, ObjectData, Vertex, BrowserUIModel } from "@visuallyjs/browser-ui";
1
+ import { BrowserUI, ObjectData, Vertex, BrowserUIModel, Edge, Overlay, BrowserElement } from "@visuallyjs/browser-ui";
2
2
  /**
3
- * The props that are passed in to a component used to render a node/group by a surface component.
3
+ * The props that are passed in to a component used to render a node/group/overlay by a surface component.
4
4
  * @group Props
5
5
  */
6
- export interface VueWrapperProps<T extends Vertex = Vertex> {
6
+ export interface VueWrapperProps<T extends Vertex | Edge = Vertex | Edge> {
7
7
  /**
8
- * Data that backs the vertex. Reactive.
8
+ * Data that backs the object. Reactive.
9
9
  */
10
10
  data: ObjectData;
11
11
  /**
@@ -17,21 +17,28 @@ export interface VueWrapperProps<T extends Vertex = Vertex> {
17
17
  */
18
18
  ui: BrowserUI;
19
19
  /**
20
- * The vertex (node or group) that is being rendered
21
- * @deprecated use `vertex` from 1.2.0 onwards
20
+ * The vertex (node or group) or edge that is being rendered
21
+ * @deprecated use `vertex` or `edge` from 1.2.0 onwards
22
22
  */
23
23
  obj: T;
24
24
  /**
25
- * The vertex (node or group) that is being rendered
26
- * @since 1.2.0
25
+ * The vertex (node or group) that is being rendered. Only present if a node or group is being rendered.
27
26
  */
28
- vertex: T;
27
+ vertex?: T extends Vertex ? T : never;
28
+ /**
29
+ * The edge that is being rendered. Only present if an overlay is being rendered.
30
+ */
31
+ edge?: T extends Edge ? T : never;
32
+ /**
33
+ * The overlay that is being rendered. Only present if an overlay is being rendered.
34
+ */
35
+ overlay?: Overlay<BrowserElement>;
29
36
  /**
30
37
  * The underlying DOM element
31
38
  */
32
39
  el: any;
33
40
  /**
34
- * Definition for this node/group type
41
+ * Definition for this node/group/overlay type
35
42
  */
36
43
  def: any;
37
44
  eventInfo: any;