n8n-editor-ui 1.63.2 → 1.64.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.
Files changed (137) hide show
  1. package/dist/assets/{AnnotationTagsDropdown.ee-BrHzX0gM.js → AnnotationTagsDropdown.ee.vue_vue_type_script_setup_true_lang-DZsUO41i.js} +2 -3
  2. package/dist/assets/{AuthView-DBTpAWBR.js → AuthView-CCyCGmwi.js} +3 -6
  3. package/dist/assets/{AuthView-BnHKMYu_.css → AuthView-Cnr31xHM.css} +6 -5
  4. package/dist/assets/{CanvasControls-DJjSv7Wo.js → CanvasControls-Bh28om35.js} +1 -31
  5. package/dist/assets/{ChangePasswordView-4HfufusV.js → ChangePasswordView-CzOXz1B5.js} +2 -32
  6. package/dist/assets/CollectionParameter--dDx2Uul.js +4 -0
  7. package/dist/assets/{CredentialsView-ChVc0kqb.js → CredentialsView-Uwkj-6Gn.js} +5 -35
  8. package/dist/assets/{ErrorView-C3MNpu-h.js → ErrorView-Du8F4roT.js} +1 -31
  9. package/dist/assets/{ExecutionsFilter-C71cMIbt.js → ExecutionsFilter-X5OsOzg1.js} +2 -5
  10. package/dist/assets/{ExecutionsView-CyfD2AaP.js → ExecutionsView-Cdl2wX8O.js} +18 -54
  11. package/dist/assets/{file-saver-Dbfm4l4I.js → FileSaver.min-BZDLz63C.js} +5 -12
  12. package/dist/assets/{FixedCollectionParameter-DjS7zdm4.js → FixedCollectionParameter-h3uHE3EI.js} +1 -32
  13. package/dist/assets/{ForgotMyPasswordView-BThu5AzW.js → ForgotMyPasswordView-DKha33bM.js} +2 -32
  14. package/dist/assets/{MainHeader-BonioYN5.js → MainHeader-Dp0CMpLa.js} +8 -47
  15. package/dist/assets/{MainSidebar-NOlas3VF.js → MainSidebar-DX7RWqIJ.js} +5 -44
  16. package/dist/assets/{NodeCreation-ByUlHR8c.js → NodeCreation-CH8QZkmg.js} +4 -7
  17. package/dist/assets/{NodeCreator-DE9FRbnS.js → NodeCreator-GlBp8VyB.js} +20 -64
  18. package/dist/assets/{NodeViewSwitcher-BMWd0Gm9.css → NodeViewSwitcher-0LWuIntY.css} +136 -135
  19. package/dist/assets/{NodeViewSwitcher-D7fdLnF1.js → NodeViewSwitcher-B6pXHQpy.js} +17208 -4340
  20. package/dist/assets/{ProjectCardBadge-f4baniz3.js → ProjectCardBadge.vue_vue_type_script_setup_true_lang-R4VvIcND.js} +1 -12
  21. package/dist/assets/{ProjectSettings-CeJUMGSQ.js → ProjectSettings-BRbDO1Gw.js} +6 -38
  22. package/dist/assets/{ProjectTabs-dq7a740r.js → ProjectTabs-DGe3p6nk.js} +1 -3
  23. package/dist/assets/{PushConnectionTracker-Bs_UzKPJ.js → PushConnectionTracker-CYr4h_PG.js} +1 -4
  24. package/dist/assets/{ResourcesListLayout-B1XBsMRy.js → ResourcesListLayout-Cp1vFuQD.js} +2 -7
  25. package/dist/assets/{RunDataAi-DdGO06st.js → RunDataAi-Dr6ypWYk.js} +51 -13
  26. package/dist/assets/{RunDataJson-DTKvzLZz.js → RunDataJson-BR2zl0xs.js} +11 -34
  27. package/dist/assets/{jsonpath--XXuA3UN.js → RunDataJsonActions-hnNDgPdr.js} +272 -73
  28. package/dist/assets/{RunDataSearch-CW0connN.js → RunDataSearch-aEp6SsT6.js} +1 -31
  29. package/dist/assets/{RunDataTable-C-mEq2dD.js → RunDataTable-CNdHnjmM.js} +43 -70
  30. package/dist/assets/{SamlOnboarding-BfsNvcA1.js → SamlOnboarding-BGSor93S.js} +2 -32
  31. package/dist/assets/{SettingsApiView--aIfdlDF.js → SettingsApiView-DnaOHGOU.js} +11 -42
  32. package/dist/assets/{SettingsCommunityNodesView-DdyT-sgu.js → SettingsCommunityNodesView-DG_uJUfX.js} +3 -35
  33. package/dist/assets/{SettingsExternalSecrets-DTMX68vp.js → SettingsExternalSecrets-CC-c2C10.js} +2 -32
  34. package/dist/assets/SettingsFakeDoorView-DJJ9xpvu.js +44 -0
  35. package/dist/assets/{humanize-duration-DdvB4QXM.js → SettingsLdapView-BTxklMe-.js} +827 -12
  36. package/dist/assets/{SettingsLogStreamingView-lQvw760T.js → SettingsLogStreamingView-D32eR0j1.js} +1 -31
  37. package/dist/assets/{SettingsPersonalView-2vlxeSgj.js → SettingsPersonalView-CycnGnFd.js} +1 -31
  38. package/dist/assets/{SettingsSourceControl-1Z-AF1Yv.js → SettingsSourceControl-CpzwZEYt.js} +4 -35
  39. package/dist/assets/{SettingsSso-Bp82V4Mw.js → SettingsSso-HjdnsVOf.js} +1 -31
  40. package/dist/assets/{SettingsUsageAndPlan-CDXY25ax.js → SettingsUsageAndPlan-CYQUE0tK.js} +1 -32
  41. package/dist/assets/{SettingsUsersView-3sIYeb4A.js → SettingsUsersView-DkzKTkeO.js} +1 -31
  42. package/dist/assets/{SettingsView-BNNArsIx.js → SettingsView-DVcUKSKE.js} +25 -34
  43. package/dist/assets/{SetupView-pspJi2at.js → SetupView-RG_ylo8Z.js} +2 -32
  44. package/dist/assets/{SetupWorkflowCredentialsButton-SC5-MI0D.js → SetupWorkflowCredentialsButton-DrA_a2OJ.js} +1 -31
  45. package/dist/assets/{SetupWorkflowFromTemplateView-CU3grpvN.js → SetupWorkflowFromTemplateView-DDIIQT4h.js} +3 -33
  46. package/dist/assets/{SigninView-CZdE2LU3.js → SigninView-SB0OrGE8.js} +2 -32
  47. package/dist/assets/SignoutView-CydN5z6L.js +27 -0
  48. package/dist/assets/{SignupView-BPlt_Lbh.js → SignupView-GfwP9_4w.js} +2 -32
  49. package/dist/assets/{TemplateDetails-CdRKYWL6.js → TemplateDetails-BHYTgWe7.js} +1 -4
  50. package/dist/assets/{TemplateList-BYq50eQG.js → TemplateList-DqeiM-sc.js} +1 -3
  51. package/dist/assets/{TemplatesCollectionView-D-N6pD00.js → TemplatesCollectionView-BmNqs_gk.js} +5 -35
  52. package/dist/assets/{TemplatesSearchView-BYNWZYGm.css → TemplatesSearchView-BiokbeYf.css} +94 -1
  53. package/dist/assets/{TemplatesSearchView-CaRL_LUd.js → TemplatesSearchView-CNF6-vdG.js} +738 -41
  54. package/dist/assets/{TemplatesView-C5HnqMFU.js → TemplatesView-2elduxzA.js} +1 -3
  55. package/dist/assets/{TemplatesWorkflowView-XV_mNcau.js → TemplatesWorkflowView-ZW6hOx7N.js} +5 -35
  56. package/dist/assets/{VariablesView-CDacoelY.js → VariablesView-BX27mddL.js} +2 -33
  57. package/dist/assets/{WorkerView-DciBUDzM.js → WorkerView-Cr7HLqrl.js} +159 -43
  58. package/dist/assets/{WorkflowActivator-GHyUbwAO.js → WorkflowActivator-BdyaV7fz.js} +3 -7
  59. package/dist/assets/{WorkflowExecutionsInfoAccordion-Dez7kHwM.js → WorkflowExecutionsInfoAccordion-GC5Xu1TI.js} +1 -3
  60. package/dist/assets/{WorkflowExecutionsLandingPage-j7sS9stL.js → WorkflowExecutionsLandingPage-DUaKxO-Z.js} +2 -32
  61. package/dist/assets/{WorkflowExecutionsPreview-DLogApYK.js → WorkflowExecutionsPreview-1hB0xaBl.js} +10 -42
  62. package/dist/assets/{WorkflowExecutionsView-CZ0E-5CZ.js → WorkflowExecutionsView-OE3NlCHo.js} +6 -37
  63. package/dist/assets/{WorkflowHistory-D6BLJ_QX.js → WorkflowHistory-q9Izoevv.js} +8 -45
  64. package/dist/assets/{WorkflowOnboardingView-7Z0s7yrd.js → WorkflowOnboardingView-B3UpsBmI.js} +1 -31
  65. package/dist/assets/{WorkflowPreview-C2zFAYYi.js → WorkflowPreview-MCXIiPMR.js} +1 -3
  66. package/dist/assets/{WorkflowsView-CLNYtnzv.js → WorkflowsView-BpzSj9Gu.js} +19 -37
  67. package/dist/assets/cloud-C5pqS4q0.js +37 -0
  68. package/dist/assets/{dateFormatter-B-oph3V5.js → dateFormatter-BgjGibAI.js} +1 -1
  69. package/dist/assets/{index-B5Pl_Rdy.css → index-BGyoJ6bM.css} +3941 -8
  70. package/dist/assets/index-TQ22MZub.js +331746 -0
  71. package/dist/assets/{pushConnection.store-C38m0a4q.js → pushConnection.store-DBI9rig9.js} +3 -3
  72. package/dist/assets/{templateActions-BDzt5tYG.js → templateActions-BlnfhXAQ.js} +1 -1
  73. package/dist/assets/{useBeforeUnload-DAuWtScP.js → useBeforeUnload-Db4Xtdlx.js} +1 -2
  74. package/dist/assets/{useExecutionDebugging-DjezN4ny.js → useExecutionDebugging-rQ2a9vrr.js} +1 -2
  75. package/dist/assets/{usePushConnection-C-AngCFB.js → usePushConnection-Bg_ZQZs0.js} +12 -17
  76. package/dist/assets/{useWorkflowActivate-CgGEceEs.js → useWorkflowActivate-DXNYJQNZ.js} +1 -2
  77. package/dist/index.html +2 -33
  78. package/package.json +1 -1
  79. package/vite.config.mts +0 -41
  80. package/dist/assets/@jsplumb/browser-ui-D3WTv2iL.js +0 -5431
  81. package/dist/assets/@jsplumb/common-Cn2WooAp.js +0 -142
  82. package/dist/assets/@jsplumb/connector-bezier-BsoOTqok.js +0 -1019
  83. package/dist/assets/@jsplumb/core-DLCSr9D4.js +0 -7317
  84. package/dist/assets/@jsplumb/util-DggqnqQo.js +0 -936
  85. package/dist/assets/@lezer/common-Bs5t-XhT.js +0 -1988
  86. package/dist/assets/@n8n/api-types-Clq_Leox.js +0 -1
  87. package/dist/assets/@n8n/codemirror-lang-Bizw8G99.js +0 -20928
  88. package/dist/assets/@n8n/codemirror-lang-sql-C9sfSTUi.js +0 -14443
  89. package/dist/assets/@n8n/permissions-BxSXRD9U.js +0 -52
  90. package/dist/assets/@sentry/vue-By9cUXYj.js +0 -23618
  91. package/dist/assets/@vue-flow/background-B1J8rodd.js +0 -123
  92. package/dist/assets/@vue-flow/controls-B4bXJQnK.js +0 -204
  93. package/dist/assets/@vue-flow/core-tETEFGtP.js +0 -9818
  94. package/dist/assets/@vue-flow/minimap-CGW7BbeH.js +0 -2951
  95. package/dist/assets/@vue-flow/node-resizer-C7hxX6Ea.js +0 -1398
  96. package/dist/assets/@vueuse/core-BTO0AmLR.js +0 -8894
  97. package/dist/assets/RunDataJsonActions-0J53luAF.js +0 -270
  98. package/dist/assets/SettingsFakeDoorView-CpouiCJM.js +0 -74
  99. package/dist/assets/SettingsLdapView-DtUi0T-K.js +0 -746
  100. package/dist/assets/SignoutView-DN2qdM5U.js +0 -57
  101. package/dist/assets/aws-secrets-manager-NwVFybsa.svg +0 -18
  102. package/dist/assets/axios-BW6T4tHC.js +0 -2403
  103. package/dist/assets/azure-key-vault-DTTl_IR7.svg +0 -23
  104. package/dist/assets/bowser-CDCHPFWD.js +0 -1931
  105. package/dist/assets/change-case-Dux1iW35.js +0 -137
  106. package/dist/assets/chart.js-BYpPl_l4.js +0 -14318
  107. package/dist/assets/cloud-DJUTi_f-.js +0 -95
  108. package/dist/assets/codemirror-lang-html-n8n-BElKE4vf.js +0 -2498
  109. package/dist/assets/dateformat-BevCJF2z.js +0 -208
  110. package/dist/assets/email-providers-Brdpqw-Z.js +0 -1
  111. package/dist/assets/esprima-next-DUEu30kB.js +0 -6712
  112. package/dist/assets/fast-json-stable-stringify-D9R5x91P.js +0 -55
  113. package/dist/assets/flatted-BLlNkUR-.js +0 -76
  114. package/dist/assets/gcp-secrets-manager-BcK0Zj6Y.svg +0 -9
  115. package/dist/assets/hashicorp-5zlHdJCj.webp +0 -0
  116. package/dist/assets/highlight.js-Brdpqw-Z.js +0 -1
  117. package/dist/assets/index-DOjaKjUd.js +0 -87778
  118. package/dist/assets/infisical-Db7VXgLp.webp +0 -0
  119. package/dist/assets/lodash-es-DCRmYdQ5.js +0 -6061
  120. package/dist/assets/luxon-N8mghSWH.js +0 -6159
  121. package/dist/assets/n8n-C6KBCWah.css +0 -4973
  122. package/dist/assets/n8n-o-6nV4eX.js +0 -163925
  123. package/dist/assets/pinia-BWzoPyXU.js +0 -1650
  124. package/dist/assets/prettier-eWLVZldr.js +0 -2294
  125. package/dist/assets/qrcode.vue-BavVPFUM.js +0 -1132
  126. package/dist/assets/timeago.js-CgQus8nl.js +0 -116
  127. package/dist/assets/useUserHelpers-nsswfS_i.js +0 -27
  128. package/dist/assets/uuid-DRDfXVM2.js +0 -542
  129. package/dist/assets/v3-infinite-loading-CHlSsXAy.js +0 -114
  130. package/dist/assets/vendor-D8YCjNHu.js +0 -14463
  131. package/dist/assets/vue-agile-B2NGbzqY.css +0 -93
  132. package/dist/assets/vue-agile-Busf3nxn.js +0 -727
  133. package/dist/assets/vue-chartjs-DBNEiLG-.js +0 -203
  134. package/dist/assets/vue-i18n-CeifA_Nk.js +0 -5329
  135. package/dist/assets/vue-json-pretty-DHS8nWi_.js +0 -340
  136. package/dist/assets/vue3-touch-events-DVOgU3fI.js +0 -301
  137. package/dist/assets/xss-Brdpqw-Z.js +0 -1
@@ -1,1398 +0,0 @@
1
- import { I as defineComponent, r as ref, j as toRef, w as watchEffect, J as openBlock, K as createElementBlock, _ as normalizeClass, $ as normalizeStyle, Z as renderSlot, i as inject, f as computed, b as watch, R as Fragment, af as renderList, a8 as createVNode, u as unref, U as createCommentVNode } from "../vendor-D8YCjNHu.js";
2
- import { u as useVueFlow, c as useGetPointerPosition, d as clamp, N as NodeId } from "./core-tETEFGtP.js";
3
- const style = "";
4
- var xhtml = "http://www.w3.org/1999/xhtml";
5
- const namespaces = {
6
- svg: "http://www.w3.org/2000/svg",
7
- xhtml,
8
- xlink: "http://www.w3.org/1999/xlink",
9
- xml: "http://www.w3.org/XML/1998/namespace",
10
- xmlns: "http://www.w3.org/2000/xmlns/"
11
- };
12
- function namespace(name) {
13
- var prefix = name += "", i = prefix.indexOf(":");
14
- if (i >= 0 && (prefix = name.slice(0, i)) !== "xmlns")
15
- name = name.slice(i + 1);
16
- return namespaces.hasOwnProperty(prefix) ? { space: namespaces[prefix], local: name } : name;
17
- }
18
- function creatorInherit(name) {
19
- return function() {
20
- var document2 = this.ownerDocument, uri = this.namespaceURI;
21
- return uri === xhtml && document2.documentElement.namespaceURI === xhtml ? document2.createElement(name) : document2.createElementNS(uri, name);
22
- };
23
- }
24
- function creatorFixed(fullname) {
25
- return function() {
26
- return this.ownerDocument.createElementNS(fullname.space, fullname.local);
27
- };
28
- }
29
- function creator(name) {
30
- var fullname = namespace(name);
31
- return (fullname.local ? creatorFixed : creatorInherit)(fullname);
32
- }
33
- function none() {
34
- }
35
- function selector(selector2) {
36
- return selector2 == null ? none : function() {
37
- return this.querySelector(selector2);
38
- };
39
- }
40
- function selection_select(select2) {
41
- if (typeof select2 !== "function")
42
- select2 = selector(select2);
43
- for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {
44
- for (var group = groups[j], n = group.length, subgroup = subgroups[j] = new Array(n), node, subnode, i = 0; i < n; ++i) {
45
- if ((node = group[i]) && (subnode = select2.call(node, node.__data__, i, group))) {
46
- if ("__data__" in node)
47
- subnode.__data__ = node.__data__;
48
- subgroup[i] = subnode;
49
- }
50
- }
51
- }
52
- return new Selection(subgroups, this._parents);
53
- }
54
- function array(x) {
55
- return x == null ? [] : Array.isArray(x) ? x : Array.from(x);
56
- }
57
- function empty() {
58
- return [];
59
- }
60
- function selectorAll(selector2) {
61
- return selector2 == null ? empty : function() {
62
- return this.querySelectorAll(selector2);
63
- };
64
- }
65
- function arrayAll(select2) {
66
- return function() {
67
- return array(select2.apply(this, arguments));
68
- };
69
- }
70
- function selection_selectAll(select2) {
71
- if (typeof select2 === "function")
72
- select2 = arrayAll(select2);
73
- else
74
- select2 = selectorAll(select2);
75
- for (var groups = this._groups, m = groups.length, subgroups = [], parents = [], j = 0; j < m; ++j) {
76
- for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {
77
- if (node = group[i]) {
78
- subgroups.push(select2.call(node, node.__data__, i, group));
79
- parents.push(node);
80
- }
81
- }
82
- }
83
- return new Selection(subgroups, parents);
84
- }
85
- function matcher(selector2) {
86
- return function() {
87
- return this.matches(selector2);
88
- };
89
- }
90
- function childMatcher(selector2) {
91
- return function(node) {
92
- return node.matches(selector2);
93
- };
94
- }
95
- var find = Array.prototype.find;
96
- function childFind(match) {
97
- return function() {
98
- return find.call(this.children, match);
99
- };
100
- }
101
- function childFirst() {
102
- return this.firstElementChild;
103
- }
104
- function selection_selectChild(match) {
105
- return this.select(match == null ? childFirst : childFind(typeof match === "function" ? match : childMatcher(match)));
106
- }
107
- var filter = Array.prototype.filter;
108
- function children() {
109
- return Array.from(this.children);
110
- }
111
- function childrenFilter(match) {
112
- return function() {
113
- return filter.call(this.children, match);
114
- };
115
- }
116
- function selection_selectChildren(match) {
117
- return this.selectAll(match == null ? children : childrenFilter(typeof match === "function" ? match : childMatcher(match)));
118
- }
119
- function selection_filter(match) {
120
- if (typeof match !== "function")
121
- match = matcher(match);
122
- for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {
123
- for (var group = groups[j], n = group.length, subgroup = subgroups[j] = [], node, i = 0; i < n; ++i) {
124
- if ((node = group[i]) && match.call(node, node.__data__, i, group)) {
125
- subgroup.push(node);
126
- }
127
- }
128
- }
129
- return new Selection(subgroups, this._parents);
130
- }
131
- function sparse(update) {
132
- return new Array(update.length);
133
- }
134
- function selection_enter() {
135
- return new Selection(this._enter || this._groups.map(sparse), this._parents);
136
- }
137
- function EnterNode(parent, datum2) {
138
- this.ownerDocument = parent.ownerDocument;
139
- this.namespaceURI = parent.namespaceURI;
140
- this._next = null;
141
- this._parent = parent;
142
- this.__data__ = datum2;
143
- }
144
- EnterNode.prototype = {
145
- constructor: EnterNode,
146
- appendChild: function(child) {
147
- return this._parent.insertBefore(child, this._next);
148
- },
149
- insertBefore: function(child, next) {
150
- return this._parent.insertBefore(child, next);
151
- },
152
- querySelector: function(selector2) {
153
- return this._parent.querySelector(selector2);
154
- },
155
- querySelectorAll: function(selector2) {
156
- return this._parent.querySelectorAll(selector2);
157
- }
158
- };
159
- function constant$1(x) {
160
- return function() {
161
- return x;
162
- };
163
- }
164
- function bindIndex(parent, group, enter, update, exit, data) {
165
- var i = 0, node, groupLength = group.length, dataLength = data.length;
166
- for (; i < dataLength; ++i) {
167
- if (node = group[i]) {
168
- node.__data__ = data[i];
169
- update[i] = node;
170
- } else {
171
- enter[i] = new EnterNode(parent, data[i]);
172
- }
173
- }
174
- for (; i < groupLength; ++i) {
175
- if (node = group[i]) {
176
- exit[i] = node;
177
- }
178
- }
179
- }
180
- function bindKey(parent, group, enter, update, exit, data, key) {
181
- var i, node, nodeByKeyValue = /* @__PURE__ */ new Map(), groupLength = group.length, dataLength = data.length, keyValues = new Array(groupLength), keyValue;
182
- for (i = 0; i < groupLength; ++i) {
183
- if (node = group[i]) {
184
- keyValues[i] = keyValue = key.call(node, node.__data__, i, group) + "";
185
- if (nodeByKeyValue.has(keyValue)) {
186
- exit[i] = node;
187
- } else {
188
- nodeByKeyValue.set(keyValue, node);
189
- }
190
- }
191
- }
192
- for (i = 0; i < dataLength; ++i) {
193
- keyValue = key.call(parent, data[i], i, data) + "";
194
- if (node = nodeByKeyValue.get(keyValue)) {
195
- update[i] = node;
196
- node.__data__ = data[i];
197
- nodeByKeyValue.delete(keyValue);
198
- } else {
199
- enter[i] = new EnterNode(parent, data[i]);
200
- }
201
- }
202
- for (i = 0; i < groupLength; ++i) {
203
- if ((node = group[i]) && nodeByKeyValue.get(keyValues[i]) === node) {
204
- exit[i] = node;
205
- }
206
- }
207
- }
208
- function datum(node) {
209
- return node.__data__;
210
- }
211
- function selection_data(value, key) {
212
- if (!arguments.length)
213
- return Array.from(this, datum);
214
- var bind = key ? bindKey : bindIndex, parents = this._parents, groups = this._groups;
215
- if (typeof value !== "function")
216
- value = constant$1(value);
217
- for (var m = groups.length, update = new Array(m), enter = new Array(m), exit = new Array(m), j = 0; j < m; ++j) {
218
- var parent = parents[j], group = groups[j], groupLength = group.length, data = arraylike(value.call(parent, parent && parent.__data__, j, parents)), dataLength = data.length, enterGroup = enter[j] = new Array(dataLength), updateGroup = update[j] = new Array(dataLength), exitGroup = exit[j] = new Array(groupLength);
219
- bind(parent, group, enterGroup, updateGroup, exitGroup, data, key);
220
- for (var i0 = 0, i1 = 0, previous, next; i0 < dataLength; ++i0) {
221
- if (previous = enterGroup[i0]) {
222
- if (i0 >= i1)
223
- i1 = i0 + 1;
224
- while (!(next = updateGroup[i1]) && ++i1 < dataLength)
225
- ;
226
- previous._next = next || null;
227
- }
228
- }
229
- }
230
- update = new Selection(update, parents);
231
- update._enter = enter;
232
- update._exit = exit;
233
- return update;
234
- }
235
- function arraylike(data) {
236
- return typeof data === "object" && "length" in data ? data : Array.from(data);
237
- }
238
- function selection_exit() {
239
- return new Selection(this._exit || this._groups.map(sparse), this._parents);
240
- }
241
- function selection_join(onenter, onupdate, onexit) {
242
- var enter = this.enter(), update = this, exit = this.exit();
243
- if (typeof onenter === "function") {
244
- enter = onenter(enter);
245
- if (enter)
246
- enter = enter.selection();
247
- } else {
248
- enter = enter.append(onenter + "");
249
- }
250
- if (onupdate != null) {
251
- update = onupdate(update);
252
- if (update)
253
- update = update.selection();
254
- }
255
- if (onexit == null)
256
- exit.remove();
257
- else
258
- onexit(exit);
259
- return enter && update ? enter.merge(update).order() : update;
260
- }
261
- function selection_merge(context) {
262
- var selection = context.selection ? context.selection() : context;
263
- for (var groups0 = this._groups, groups1 = selection._groups, m0 = groups0.length, m1 = groups1.length, m = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m; ++j) {
264
- for (var group0 = groups0[j], group1 = groups1[j], n = group0.length, merge = merges[j] = new Array(n), node, i = 0; i < n; ++i) {
265
- if (node = group0[i] || group1[i]) {
266
- merge[i] = node;
267
- }
268
- }
269
- }
270
- for (; j < m0; ++j) {
271
- merges[j] = groups0[j];
272
- }
273
- return new Selection(merges, this._parents);
274
- }
275
- function selection_order() {
276
- for (var groups = this._groups, j = -1, m = groups.length; ++j < m; ) {
277
- for (var group = groups[j], i = group.length - 1, next = group[i], node; --i >= 0; ) {
278
- if (node = group[i]) {
279
- if (next && node.compareDocumentPosition(next) ^ 4)
280
- next.parentNode.insertBefore(node, next);
281
- next = node;
282
- }
283
- }
284
- }
285
- return this;
286
- }
287
- function selection_sort(compare) {
288
- if (!compare)
289
- compare = ascending;
290
- function compareNode(a, b) {
291
- return a && b ? compare(a.__data__, b.__data__) : !a - !b;
292
- }
293
- for (var groups = this._groups, m = groups.length, sortgroups = new Array(m), j = 0; j < m; ++j) {
294
- for (var group = groups[j], n = group.length, sortgroup = sortgroups[j] = new Array(n), node, i = 0; i < n; ++i) {
295
- if (node = group[i]) {
296
- sortgroup[i] = node;
297
- }
298
- }
299
- sortgroup.sort(compareNode);
300
- }
301
- return new Selection(sortgroups, this._parents).order();
302
- }
303
- function ascending(a, b) {
304
- return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;
305
- }
306
- function selection_call() {
307
- var callback = arguments[0];
308
- arguments[0] = this;
309
- callback.apply(null, arguments);
310
- return this;
311
- }
312
- function selection_nodes() {
313
- return Array.from(this);
314
- }
315
- function selection_node() {
316
- for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) {
317
- for (var group = groups[j], i = 0, n = group.length; i < n; ++i) {
318
- var node = group[i];
319
- if (node)
320
- return node;
321
- }
322
- }
323
- return null;
324
- }
325
- function selection_size() {
326
- let size = 0;
327
- for (const node of this)
328
- ++size;
329
- return size;
330
- }
331
- function selection_empty() {
332
- return !this.node();
333
- }
334
- function selection_each(callback) {
335
- for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) {
336
- for (var group = groups[j], i = 0, n = group.length, node; i < n; ++i) {
337
- if (node = group[i])
338
- callback.call(node, node.__data__, i, group);
339
- }
340
- }
341
- return this;
342
- }
343
- function attrRemove(name) {
344
- return function() {
345
- this.removeAttribute(name);
346
- };
347
- }
348
- function attrRemoveNS(fullname) {
349
- return function() {
350
- this.removeAttributeNS(fullname.space, fullname.local);
351
- };
352
- }
353
- function attrConstant(name, value) {
354
- return function() {
355
- this.setAttribute(name, value);
356
- };
357
- }
358
- function attrConstantNS(fullname, value) {
359
- return function() {
360
- this.setAttributeNS(fullname.space, fullname.local, value);
361
- };
362
- }
363
- function attrFunction(name, value) {
364
- return function() {
365
- var v = value.apply(this, arguments);
366
- if (v == null)
367
- this.removeAttribute(name);
368
- else
369
- this.setAttribute(name, v);
370
- };
371
- }
372
- function attrFunctionNS(fullname, value) {
373
- return function() {
374
- var v = value.apply(this, arguments);
375
- if (v == null)
376
- this.removeAttributeNS(fullname.space, fullname.local);
377
- else
378
- this.setAttributeNS(fullname.space, fullname.local, v);
379
- };
380
- }
381
- function selection_attr(name, value) {
382
- var fullname = namespace(name);
383
- if (arguments.length < 2) {
384
- var node = this.node();
385
- return fullname.local ? node.getAttributeNS(fullname.space, fullname.local) : node.getAttribute(fullname);
386
- }
387
- return this.each((value == null ? fullname.local ? attrRemoveNS : attrRemove : typeof value === "function" ? fullname.local ? attrFunctionNS : attrFunction : fullname.local ? attrConstantNS : attrConstant)(fullname, value));
388
- }
389
- function defaultView(node) {
390
- return node.ownerDocument && node.ownerDocument.defaultView || node.document && node || node.defaultView;
391
- }
392
- function styleRemove(name) {
393
- return function() {
394
- this.style.removeProperty(name);
395
- };
396
- }
397
- function styleConstant(name, value, priority) {
398
- return function() {
399
- this.style.setProperty(name, value, priority);
400
- };
401
- }
402
- function styleFunction(name, value, priority) {
403
- return function() {
404
- var v = value.apply(this, arguments);
405
- if (v == null)
406
- this.style.removeProperty(name);
407
- else
408
- this.style.setProperty(name, v, priority);
409
- };
410
- }
411
- function selection_style(name, value, priority) {
412
- return arguments.length > 1 ? this.each((value == null ? styleRemove : typeof value === "function" ? styleFunction : styleConstant)(name, value, priority == null ? "" : priority)) : styleValue(this.node(), name);
413
- }
414
- function styleValue(node, name) {
415
- return node.style.getPropertyValue(name) || defaultView(node).getComputedStyle(node, null).getPropertyValue(name);
416
- }
417
- function propertyRemove(name) {
418
- return function() {
419
- delete this[name];
420
- };
421
- }
422
- function propertyConstant(name, value) {
423
- return function() {
424
- this[name] = value;
425
- };
426
- }
427
- function propertyFunction(name, value) {
428
- return function() {
429
- var v = value.apply(this, arguments);
430
- if (v == null)
431
- delete this[name];
432
- else
433
- this[name] = v;
434
- };
435
- }
436
- function selection_property(name, value) {
437
- return arguments.length > 1 ? this.each((value == null ? propertyRemove : typeof value === "function" ? propertyFunction : propertyConstant)(name, value)) : this.node()[name];
438
- }
439
- function classArray(string) {
440
- return string.trim().split(/^|\s+/);
441
- }
442
- function classList(node) {
443
- return node.classList || new ClassList(node);
444
- }
445
- function ClassList(node) {
446
- this._node = node;
447
- this._names = classArray(node.getAttribute("class") || "");
448
- }
449
- ClassList.prototype = {
450
- add: function(name) {
451
- var i = this._names.indexOf(name);
452
- if (i < 0) {
453
- this._names.push(name);
454
- this._node.setAttribute("class", this._names.join(" "));
455
- }
456
- },
457
- remove: function(name) {
458
- var i = this._names.indexOf(name);
459
- if (i >= 0) {
460
- this._names.splice(i, 1);
461
- this._node.setAttribute("class", this._names.join(" "));
462
- }
463
- },
464
- contains: function(name) {
465
- return this._names.indexOf(name) >= 0;
466
- }
467
- };
468
- function classedAdd(node, names) {
469
- var list = classList(node), i = -1, n = names.length;
470
- while (++i < n)
471
- list.add(names[i]);
472
- }
473
- function classedRemove(node, names) {
474
- var list = classList(node), i = -1, n = names.length;
475
- while (++i < n)
476
- list.remove(names[i]);
477
- }
478
- function classedTrue(names) {
479
- return function() {
480
- classedAdd(this, names);
481
- };
482
- }
483
- function classedFalse(names) {
484
- return function() {
485
- classedRemove(this, names);
486
- };
487
- }
488
- function classedFunction(names, value) {
489
- return function() {
490
- (value.apply(this, arguments) ? classedAdd : classedRemove)(this, names);
491
- };
492
- }
493
- function selection_classed(name, value) {
494
- var names = classArray(name + "");
495
- if (arguments.length < 2) {
496
- var list = classList(this.node()), i = -1, n = names.length;
497
- while (++i < n)
498
- if (!list.contains(names[i]))
499
- return false;
500
- return true;
501
- }
502
- return this.each((typeof value === "function" ? classedFunction : value ? classedTrue : classedFalse)(names, value));
503
- }
504
- function textRemove() {
505
- this.textContent = "";
506
- }
507
- function textConstant(value) {
508
- return function() {
509
- this.textContent = value;
510
- };
511
- }
512
- function textFunction(value) {
513
- return function() {
514
- var v = value.apply(this, arguments);
515
- this.textContent = v == null ? "" : v;
516
- };
517
- }
518
- function selection_text(value) {
519
- return arguments.length ? this.each(value == null ? textRemove : (typeof value === "function" ? textFunction : textConstant)(value)) : this.node().textContent;
520
- }
521
- function htmlRemove() {
522
- this.innerHTML = "";
523
- }
524
- function htmlConstant(value) {
525
- return function() {
526
- this.innerHTML = value;
527
- };
528
- }
529
- function htmlFunction(value) {
530
- return function() {
531
- var v = value.apply(this, arguments);
532
- this.innerHTML = v == null ? "" : v;
533
- };
534
- }
535
- function selection_html(value) {
536
- return arguments.length ? this.each(value == null ? htmlRemove : (typeof value === "function" ? htmlFunction : htmlConstant)(value)) : this.node().innerHTML;
537
- }
538
- function raise() {
539
- if (this.nextSibling)
540
- this.parentNode.appendChild(this);
541
- }
542
- function selection_raise() {
543
- return this.each(raise);
544
- }
545
- function lower() {
546
- if (this.previousSibling)
547
- this.parentNode.insertBefore(this, this.parentNode.firstChild);
548
- }
549
- function selection_lower() {
550
- return this.each(lower);
551
- }
552
- function selection_append(name) {
553
- var create = typeof name === "function" ? name : creator(name);
554
- return this.select(function() {
555
- return this.appendChild(create.apply(this, arguments));
556
- });
557
- }
558
- function constantNull() {
559
- return null;
560
- }
561
- function selection_insert(name, before) {
562
- var create = typeof name === "function" ? name : creator(name), select2 = before == null ? constantNull : typeof before === "function" ? before : selector(before);
563
- return this.select(function() {
564
- return this.insertBefore(create.apply(this, arguments), select2.apply(this, arguments) || null);
565
- });
566
- }
567
- function remove() {
568
- var parent = this.parentNode;
569
- if (parent)
570
- parent.removeChild(this);
571
- }
572
- function selection_remove() {
573
- return this.each(remove);
574
- }
575
- function selection_cloneShallow() {
576
- var clone = this.cloneNode(false), parent = this.parentNode;
577
- return parent ? parent.insertBefore(clone, this.nextSibling) : clone;
578
- }
579
- function selection_cloneDeep() {
580
- var clone = this.cloneNode(true), parent = this.parentNode;
581
- return parent ? parent.insertBefore(clone, this.nextSibling) : clone;
582
- }
583
- function selection_clone(deep) {
584
- return this.select(deep ? selection_cloneDeep : selection_cloneShallow);
585
- }
586
- function selection_datum(value) {
587
- return arguments.length ? this.property("__data__", value) : this.node().__data__;
588
- }
589
- function contextListener(listener) {
590
- return function(event) {
591
- listener.call(this, event, this.__data__);
592
- };
593
- }
594
- function parseTypenames$1(typenames) {
595
- return typenames.trim().split(/^|\s+/).map(function(t) {
596
- var name = "", i = t.indexOf(".");
597
- if (i >= 0)
598
- name = t.slice(i + 1), t = t.slice(0, i);
599
- return { type: t, name };
600
- });
601
- }
602
- function onRemove(typename) {
603
- return function() {
604
- var on = this.__on;
605
- if (!on)
606
- return;
607
- for (var j = 0, i = -1, m = on.length, o; j < m; ++j) {
608
- if (o = on[j], (!typename.type || o.type === typename.type) && o.name === typename.name) {
609
- this.removeEventListener(o.type, o.listener, o.options);
610
- } else {
611
- on[++i] = o;
612
- }
613
- }
614
- if (++i)
615
- on.length = i;
616
- else
617
- delete this.__on;
618
- };
619
- }
620
- function onAdd(typename, value, options) {
621
- return function() {
622
- var on = this.__on, o, listener = contextListener(value);
623
- if (on)
624
- for (var j = 0, m = on.length; j < m; ++j) {
625
- if ((o = on[j]).type === typename.type && o.name === typename.name) {
626
- this.removeEventListener(o.type, o.listener, o.options);
627
- this.addEventListener(o.type, o.listener = listener, o.options = options);
628
- o.value = value;
629
- return;
630
- }
631
- }
632
- this.addEventListener(typename.type, listener, options);
633
- o = { type: typename.type, name: typename.name, value, listener, options };
634
- if (!on)
635
- this.__on = [o];
636
- else
637
- on.push(o);
638
- };
639
- }
640
- function selection_on(typename, value, options) {
641
- var typenames = parseTypenames$1(typename + ""), i, n = typenames.length, t;
642
- if (arguments.length < 2) {
643
- var on = this.node().__on;
644
- if (on)
645
- for (var j = 0, m = on.length, o; j < m; ++j) {
646
- for (i = 0, o = on[j]; i < n; ++i) {
647
- if ((t = typenames[i]).type === o.type && t.name === o.name) {
648
- return o.value;
649
- }
650
- }
651
- }
652
- return;
653
- }
654
- on = value ? onAdd : onRemove;
655
- for (i = 0; i < n; ++i)
656
- this.each(on(typenames[i], value, options));
657
- return this;
658
- }
659
- function dispatchEvent(node, type, params) {
660
- var window = defaultView(node), event = window.CustomEvent;
661
- if (typeof event === "function") {
662
- event = new event(type, params);
663
- } else {
664
- event = window.document.createEvent("Event");
665
- if (params)
666
- event.initEvent(type, params.bubbles, params.cancelable), event.detail = params.detail;
667
- else
668
- event.initEvent(type, false, false);
669
- }
670
- node.dispatchEvent(event);
671
- }
672
- function dispatchConstant(type, params) {
673
- return function() {
674
- return dispatchEvent(this, type, params);
675
- };
676
- }
677
- function dispatchFunction(type, params) {
678
- return function() {
679
- return dispatchEvent(this, type, params.apply(this, arguments));
680
- };
681
- }
682
- function selection_dispatch(type, params) {
683
- return this.each((typeof params === "function" ? dispatchFunction : dispatchConstant)(type, params));
684
- }
685
- function* selection_iterator() {
686
- for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) {
687
- for (var group = groups[j], i = 0, n = group.length, node; i < n; ++i) {
688
- if (node = group[i])
689
- yield node;
690
- }
691
- }
692
- }
693
- var root = [null];
694
- function Selection(groups, parents) {
695
- this._groups = groups;
696
- this._parents = parents;
697
- }
698
- function selection_selection() {
699
- return this;
700
- }
701
- Selection.prototype = {
702
- constructor: Selection,
703
- select: selection_select,
704
- selectAll: selection_selectAll,
705
- selectChild: selection_selectChild,
706
- selectChildren: selection_selectChildren,
707
- filter: selection_filter,
708
- data: selection_data,
709
- enter: selection_enter,
710
- exit: selection_exit,
711
- join: selection_join,
712
- merge: selection_merge,
713
- selection: selection_selection,
714
- order: selection_order,
715
- sort: selection_sort,
716
- call: selection_call,
717
- nodes: selection_nodes,
718
- node: selection_node,
719
- size: selection_size,
720
- empty: selection_empty,
721
- each: selection_each,
722
- attr: selection_attr,
723
- style: selection_style,
724
- property: selection_property,
725
- classed: selection_classed,
726
- text: selection_text,
727
- html: selection_html,
728
- raise: selection_raise,
729
- lower: selection_lower,
730
- append: selection_append,
731
- insert: selection_insert,
732
- remove: selection_remove,
733
- clone: selection_clone,
734
- datum: selection_datum,
735
- on: selection_on,
736
- dispatch: selection_dispatch,
737
- [Symbol.iterator]: selection_iterator
738
- };
739
- function select(selector2) {
740
- return typeof selector2 === "string" ? new Selection([[document.querySelector(selector2)]], [document.documentElement]) : new Selection([[selector2]], root);
741
- }
742
- function sourceEvent(event) {
743
- let sourceEvent2;
744
- while (sourceEvent2 = event.sourceEvent)
745
- event = sourceEvent2;
746
- return event;
747
- }
748
- function pointer(event, node) {
749
- event = sourceEvent(event);
750
- if (node === void 0)
751
- node = event.currentTarget;
752
- if (node) {
753
- var svg = node.ownerSVGElement || node;
754
- if (svg.createSVGPoint) {
755
- var point = svg.createSVGPoint();
756
- point.x = event.clientX, point.y = event.clientY;
757
- point = point.matrixTransform(node.getScreenCTM().inverse());
758
- return [point.x, point.y];
759
- }
760
- if (node.getBoundingClientRect) {
761
- var rect = node.getBoundingClientRect();
762
- return [event.clientX - rect.left - node.clientLeft, event.clientY - rect.top - node.clientTop];
763
- }
764
- }
765
- return [event.pageX, event.pageY];
766
- }
767
- var noop = { value: () => {
768
- } };
769
- function dispatch() {
770
- for (var i = 0, n = arguments.length, _ = {}, t; i < n; ++i) {
771
- if (!(t = arguments[i] + "") || t in _ || /[\s.]/.test(t))
772
- throw new Error("illegal type: " + t);
773
- _[t] = [];
774
- }
775
- return new Dispatch(_);
776
- }
777
- function Dispatch(_) {
778
- this._ = _;
779
- }
780
- function parseTypenames(typenames, types) {
781
- return typenames.trim().split(/^|\s+/).map(function(t) {
782
- var name = "", i = t.indexOf(".");
783
- if (i >= 0)
784
- name = t.slice(i + 1), t = t.slice(0, i);
785
- if (t && !types.hasOwnProperty(t))
786
- throw new Error("unknown type: " + t);
787
- return { type: t, name };
788
- });
789
- }
790
- Dispatch.prototype = dispatch.prototype = {
791
- constructor: Dispatch,
792
- on: function(typename, callback) {
793
- var _ = this._, T = parseTypenames(typename + "", _), t, i = -1, n = T.length;
794
- if (arguments.length < 2) {
795
- while (++i < n)
796
- if ((t = (typename = T[i]).type) && (t = get(_[t], typename.name)))
797
- return t;
798
- return;
799
- }
800
- if (callback != null && typeof callback !== "function")
801
- throw new Error("invalid callback: " + callback);
802
- while (++i < n) {
803
- if (t = (typename = T[i]).type)
804
- _[t] = set(_[t], typename.name, callback);
805
- else if (callback == null)
806
- for (t in _)
807
- _[t] = set(_[t], typename.name, null);
808
- }
809
- return this;
810
- },
811
- copy: function() {
812
- var copy = {}, _ = this._;
813
- for (var t in _)
814
- copy[t] = _[t].slice();
815
- return new Dispatch(copy);
816
- },
817
- call: function(type, that) {
818
- if ((n = arguments.length - 2) > 0)
819
- for (var args = new Array(n), i = 0, n, t; i < n; ++i)
820
- args[i] = arguments[i + 2];
821
- if (!this._.hasOwnProperty(type))
822
- throw new Error("unknown type: " + type);
823
- for (t = this._[type], i = 0, n = t.length; i < n; ++i)
824
- t[i].value.apply(that, args);
825
- },
826
- apply: function(type, that, args) {
827
- if (!this._.hasOwnProperty(type))
828
- throw new Error("unknown type: " + type);
829
- for (var t = this._[type], i = 0, n = t.length; i < n; ++i)
830
- t[i].value.apply(that, args);
831
- }
832
- };
833
- function get(type, name) {
834
- for (var i = 0, n = type.length, c; i < n; ++i) {
835
- if ((c = type[i]).name === name) {
836
- return c.value;
837
- }
838
- }
839
- }
840
- function set(type, name, callback) {
841
- for (var i = 0, n = type.length; i < n; ++i) {
842
- if (type[i].name === name) {
843
- type[i] = noop, type = type.slice(0, i).concat(type.slice(i + 1));
844
- break;
845
- }
846
- }
847
- if (callback != null)
848
- type.push({ name, value: callback });
849
- return type;
850
- }
851
- const nonpassive = { passive: false };
852
- const nonpassivecapture = { capture: true, passive: false };
853
- function nopropagation(event) {
854
- event.stopImmediatePropagation();
855
- }
856
- function noevent(event) {
857
- event.preventDefault();
858
- event.stopImmediatePropagation();
859
- }
860
- function nodrag(view) {
861
- var root2 = view.document.documentElement, selection = select(view).on("dragstart.drag", noevent, nonpassivecapture);
862
- if ("onselectstart" in root2) {
863
- selection.on("selectstart.drag", noevent, nonpassivecapture);
864
- } else {
865
- root2.__noselect = root2.style.MozUserSelect;
866
- root2.style.MozUserSelect = "none";
867
- }
868
- }
869
- function yesdrag(view, noclick) {
870
- var root2 = view.document.documentElement, selection = select(view).on("dragstart.drag", null);
871
- if (noclick) {
872
- selection.on("click.drag", noevent, nonpassivecapture);
873
- setTimeout(function() {
874
- selection.on("click.drag", null);
875
- }, 0);
876
- }
877
- if ("onselectstart" in root2) {
878
- selection.on("selectstart.drag", null);
879
- } else {
880
- root2.style.MozUserSelect = root2.__noselect;
881
- delete root2.__noselect;
882
- }
883
- }
884
- const constant = (x) => () => x;
885
- function DragEvent(type, {
886
- sourceEvent: sourceEvent2,
887
- subject,
888
- target,
889
- identifier,
890
- active,
891
- x,
892
- y,
893
- dx,
894
- dy,
895
- dispatch: dispatch2
896
- }) {
897
- Object.defineProperties(this, {
898
- type: { value: type, enumerable: true, configurable: true },
899
- sourceEvent: { value: sourceEvent2, enumerable: true, configurable: true },
900
- subject: { value: subject, enumerable: true, configurable: true },
901
- target: { value: target, enumerable: true, configurable: true },
902
- identifier: { value: identifier, enumerable: true, configurable: true },
903
- active: { value: active, enumerable: true, configurable: true },
904
- x: { value: x, enumerable: true, configurable: true },
905
- y: { value: y, enumerable: true, configurable: true },
906
- dx: { value: dx, enumerable: true, configurable: true },
907
- dy: { value: dy, enumerable: true, configurable: true },
908
- _: { value: dispatch2 }
909
- });
910
- }
911
- DragEvent.prototype.on = function() {
912
- var value = this._.on.apply(this._, arguments);
913
- return value === this._ ? this : value;
914
- };
915
- function defaultFilter(event) {
916
- return !event.ctrlKey && !event.button;
917
- }
918
- function defaultContainer() {
919
- return this.parentNode;
920
- }
921
- function defaultSubject(event, d) {
922
- return d == null ? { x: event.x, y: event.y } : d;
923
- }
924
- function defaultTouchable() {
925
- return navigator.maxTouchPoints || "ontouchstart" in this;
926
- }
927
- function drag() {
928
- var filter2 = defaultFilter, container = defaultContainer, subject = defaultSubject, touchable = defaultTouchable, gestures = {}, listeners = dispatch("start", "drag", "end"), active = 0, mousedownx, mousedowny, mousemoving, touchending, clickDistance2 = 0;
929
- function drag2(selection) {
930
- selection.on("mousedown.drag", mousedowned).filter(touchable).on("touchstart.drag", touchstarted).on("touchmove.drag", touchmoved, nonpassive).on("touchend.drag touchcancel.drag", touchended).style("touch-action", "none").style("-webkit-tap-highlight-color", "rgba(0,0,0,0)");
931
- }
932
- function mousedowned(event, d) {
933
- if (touchending || !filter2.call(this, event, d))
934
- return;
935
- var gesture = beforestart(this, container.call(this, event, d), event, d, "mouse");
936
- if (!gesture)
937
- return;
938
- select(event.view).on("mousemove.drag", mousemoved, nonpassivecapture).on("mouseup.drag", mouseupped, nonpassivecapture);
939
- nodrag(event.view);
940
- nopropagation(event);
941
- mousemoving = false;
942
- mousedownx = event.clientX;
943
- mousedowny = event.clientY;
944
- gesture("start", event);
945
- }
946
- function mousemoved(event) {
947
- noevent(event);
948
- if (!mousemoving) {
949
- var dx = event.clientX - mousedownx, dy = event.clientY - mousedowny;
950
- mousemoving = dx * dx + dy * dy > clickDistance2;
951
- }
952
- gestures.mouse("drag", event);
953
- }
954
- function mouseupped(event) {
955
- select(event.view).on("mousemove.drag mouseup.drag", null);
956
- yesdrag(event.view, mousemoving);
957
- noevent(event);
958
- gestures.mouse("end", event);
959
- }
960
- function touchstarted(event, d) {
961
- if (!filter2.call(this, event, d))
962
- return;
963
- var touches = event.changedTouches, c = container.call(this, event, d), n = touches.length, i, gesture;
964
- for (i = 0; i < n; ++i) {
965
- if (gesture = beforestart(this, c, event, d, touches[i].identifier, touches[i])) {
966
- nopropagation(event);
967
- gesture("start", event, touches[i]);
968
- }
969
- }
970
- }
971
- function touchmoved(event) {
972
- var touches = event.changedTouches, n = touches.length, i, gesture;
973
- for (i = 0; i < n; ++i) {
974
- if (gesture = gestures[touches[i].identifier]) {
975
- noevent(event);
976
- gesture("drag", event, touches[i]);
977
- }
978
- }
979
- }
980
- function touchended(event) {
981
- var touches = event.changedTouches, n = touches.length, i, gesture;
982
- if (touchending)
983
- clearTimeout(touchending);
984
- touchending = setTimeout(function() {
985
- touchending = null;
986
- }, 500);
987
- for (i = 0; i < n; ++i) {
988
- if (gesture = gestures[touches[i].identifier]) {
989
- nopropagation(event);
990
- gesture("end", event, touches[i]);
991
- }
992
- }
993
- }
994
- function beforestart(that, container2, event, d, identifier, touch) {
995
- var dispatch2 = listeners.copy(), p = pointer(touch || event, container2), dx, dy, s;
996
- if ((s = subject.call(that, new DragEvent("beforestart", {
997
- sourceEvent: event,
998
- target: drag2,
999
- identifier,
1000
- active,
1001
- x: p[0],
1002
- y: p[1],
1003
- dx: 0,
1004
- dy: 0,
1005
- dispatch: dispatch2
1006
- }), d)) == null)
1007
- return;
1008
- dx = s.x - p[0] || 0;
1009
- dy = s.y - p[1] || 0;
1010
- return function gesture(type, event2, touch2) {
1011
- var p0 = p, n;
1012
- switch (type) {
1013
- case "start":
1014
- gestures[identifier] = gesture, n = active++;
1015
- break;
1016
- case "end":
1017
- delete gestures[identifier], --active;
1018
- case "drag":
1019
- p = pointer(touch2 || event2, container2), n = active;
1020
- break;
1021
- }
1022
- dispatch2.call(
1023
- type,
1024
- that,
1025
- new DragEvent(type, {
1026
- sourceEvent: event2,
1027
- subject: s,
1028
- target: drag2,
1029
- identifier,
1030
- active: n,
1031
- x: p[0] + dx,
1032
- y: p[1] + dy,
1033
- dx: p[0] - p0[0],
1034
- dy: p[1] - p0[1],
1035
- dispatch: dispatch2
1036
- }),
1037
- d
1038
- );
1039
- };
1040
- }
1041
- drag2.filter = function(_) {
1042
- return arguments.length ? (filter2 = typeof _ === "function" ? _ : constant(!!_), drag2) : filter2;
1043
- };
1044
- drag2.container = function(_) {
1045
- return arguments.length ? (container = typeof _ === "function" ? _ : constant(_), drag2) : container;
1046
- };
1047
- drag2.subject = function(_) {
1048
- return arguments.length ? (subject = typeof _ === "function" ? _ : constant(_), drag2) : subject;
1049
- };
1050
- drag2.touchable = function(_) {
1051
- return arguments.length ? (touchable = typeof _ === "function" ? _ : constant(!!_), drag2) : touchable;
1052
- };
1053
- drag2.on = function() {
1054
- var value = listeners.on.apply(listeners, arguments);
1055
- return value === listeners ? drag2 : value;
1056
- };
1057
- drag2.clickDistance = function(_) {
1058
- return arguments.length ? (clickDistance2 = (_ = +_) * _, drag2) : Math.sqrt(clickDistance2);
1059
- };
1060
- return drag2;
1061
- }
1062
- var ResizeControlVariant = /* @__PURE__ */ ((ResizeControlVariant2) => {
1063
- ResizeControlVariant2["Line"] = "line";
1064
- ResizeControlVariant2["Handle"] = "handle";
1065
- return ResizeControlVariant2;
1066
- })(ResizeControlVariant || {});
1067
- function getDirection({ width, prevWidth, height, prevHeight, invertX, invertY }) {
1068
- const deltaWidth = width - prevWidth;
1069
- const deltaHeight = height - prevHeight;
1070
- const direction = [deltaWidth > 0 ? 1 : deltaWidth < 0 ? -1 : 0, deltaHeight > 0 ? 1 : deltaHeight < 0 ? -1 : 0];
1071
- if (deltaWidth && invertX) {
1072
- direction[0] = direction[0] * -1;
1073
- }
1074
- if (deltaHeight && invertY) {
1075
- direction[1] = direction[1] * -1;
1076
- }
1077
- return direction;
1078
- }
1079
- const DefaultPositions = {
1080
- [ResizeControlVariant.Line]: "right",
1081
- [ResizeControlVariant.Handle]: "bottom-right"
1082
- };
1083
- const StylingProperty = {
1084
- [ResizeControlVariant.Line]: "borderColor",
1085
- [ResizeControlVariant.Handle]: "backgroundColor"
1086
- };
1087
- const __default__$1 = {
1088
- name: "ResizeControl",
1089
- compatConfig: { MODE: 3 }
1090
- };
1091
- const _sfc_main$1 = /* @__PURE__ */ defineComponent({
1092
- ...__default__$1,
1093
- props: {
1094
- nodeId: {},
1095
- color: {},
1096
- minWidth: { default: 10 },
1097
- minHeight: { default: 10 },
1098
- maxWidth: { default: Number.MAX_VALUE },
1099
- maxHeight: { default: Number.MAX_VALUE },
1100
- position: {},
1101
- variant: { default: "handle" },
1102
- shouldResize: {},
1103
- keepAspectRatio: { type: [Boolean, Number], default: false }
1104
- },
1105
- emits: ["resizeStart", "resize", "resizeEnd"],
1106
- setup(__props, { emit: emits }) {
1107
- const props = __props;
1108
- const initPrevValues = { width: 0, height: 0, x: 0, y: 0 };
1109
- const initStartValues = {
1110
- ...initPrevValues,
1111
- pointerX: 0,
1112
- pointerY: 0,
1113
- aspectRatio: 1
1114
- };
1115
- const { findNode, emits: triggerEmits } = useVueFlow();
1116
- const getPointerPosition = useGetPointerPosition();
1117
- const resizeControlRef = ref();
1118
- let startValues = initStartValues;
1119
- let prevValues = initPrevValues;
1120
- const controlPosition = toRef(() => props.position ?? DefaultPositions[props.variant]);
1121
- const positionClassNames = toRef(() => controlPosition.value.split("-"));
1122
- const controlStyle = toRef(() => props.color ? { [StylingProperty[props.variant]]: props.color } : {});
1123
- watchEffect((onCleanup) => {
1124
- if (!resizeControlRef.value || !props.nodeId) {
1125
- return;
1126
- }
1127
- const selection = select(resizeControlRef.value);
1128
- const enableX = controlPosition.value.includes("right") || controlPosition.value.includes("left");
1129
- const enableY = controlPosition.value.includes("bottom") || controlPosition.value.includes("top");
1130
- const invertX = controlPosition.value.includes("left");
1131
- const invertY = controlPosition.value.includes("top");
1132
- const dragHandler = drag().on("start", (event) => {
1133
- const node = findNode(props.nodeId);
1134
- const { xSnapped, ySnapped } = getPointerPosition(event);
1135
- prevValues = {
1136
- width: (node == null ? void 0 : node.dimensions.width) ?? 0,
1137
- height: (node == null ? void 0 : node.dimensions.height) ?? 0,
1138
- x: (node == null ? void 0 : node.position.x) ?? 0,
1139
- y: (node == null ? void 0 : node.position.y) ?? 0
1140
- };
1141
- startValues = {
1142
- ...prevValues,
1143
- pointerX: xSnapped,
1144
- pointerY: ySnapped,
1145
- aspectRatio: prevValues.width / prevValues.height
1146
- };
1147
- emits("resizeStart", { event, params: prevValues });
1148
- }).on("drag", (event) => {
1149
- var _a;
1150
- const { xSnapped, ySnapped } = getPointerPosition(event);
1151
- const node = findNode(props.nodeId);
1152
- if (node) {
1153
- const changes = [];
1154
- const {
1155
- pointerX: startX,
1156
- pointerY: startY,
1157
- width: startWidth,
1158
- height: startHeight,
1159
- x: startNodeX,
1160
- y: startNodeY,
1161
- aspectRatio: startAspectRatio
1162
- } = startValues;
1163
- const { x: prevX, y: prevY, width: prevWidth, height: prevHeight } = prevValues;
1164
- const distX = Math.floor(enableX ? xSnapped - startX : 0);
1165
- const distY = Math.floor(enableY ? ySnapped - startY : 0);
1166
- let width = clamp(startWidth + (invertX ? -distX : distX), props.minWidth, props.maxWidth);
1167
- let height = clamp(startHeight + (invertY ? -distY : distY), props.minHeight, props.maxHeight);
1168
- if (props.keepAspectRatio) {
1169
- const nextAspectRatio = width / height;
1170
- let aspectRatio = startAspectRatio;
1171
- if (typeof props.keepAspectRatio === "number" && nextAspectRatio !== props.keepAspectRatio) {
1172
- aspectRatio = props.keepAspectRatio;
1173
- }
1174
- const isDiagonal = enableX && enableY;
1175
- const isHorizontal = enableX && !enableY;
1176
- const isVertical = enableY && !enableX;
1177
- width = nextAspectRatio <= aspectRatio && isDiagonal || isVertical ? height * aspectRatio : width;
1178
- height = nextAspectRatio > aspectRatio && isDiagonal || isHorizontal ? width / aspectRatio : height;
1179
- if (width >= props.maxWidth) {
1180
- width = props.maxWidth;
1181
- height = props.maxWidth / aspectRatio;
1182
- } else if (width <= props.minWidth) {
1183
- width = props.minWidth;
1184
- height = props.minWidth / aspectRatio;
1185
- }
1186
- if (height >= props.maxHeight) {
1187
- height = props.maxHeight;
1188
- width = props.maxHeight * aspectRatio;
1189
- } else if (height <= props.minHeight) {
1190
- height = props.minHeight;
1191
- width = props.minHeight * aspectRatio;
1192
- }
1193
- }
1194
- const isWidthChange = width !== prevWidth;
1195
- const isHeightChange = height !== prevHeight;
1196
- if (invertX || invertY) {
1197
- const x = invertX ? startNodeX - (width - startWidth) : startNodeX;
1198
- const y = invertY ? startNodeY - (height - startHeight) : startNodeY;
1199
- const isXPosChange = x !== prevX && isWidthChange;
1200
- const isYPosChange = y !== prevY && isHeightChange;
1201
- if (isXPosChange || isYPosChange) {
1202
- const positionChange = {
1203
- id: node.id,
1204
- type: "position",
1205
- from: node.position,
1206
- position: {
1207
- x: isXPosChange ? x : prevX,
1208
- y: isYPosChange ? y : prevY
1209
- }
1210
- };
1211
- changes.push(positionChange);
1212
- prevValues.x = positionChange.position.x;
1213
- prevValues.y = positionChange.position.y;
1214
- }
1215
- }
1216
- if (props.nodeId && (isWidthChange || isHeightChange)) {
1217
- const dimensionChange = {
1218
- id: props.nodeId,
1219
- type: "dimensions",
1220
- updateStyle: true,
1221
- resizing: true,
1222
- dimensions: {
1223
- width,
1224
- height
1225
- }
1226
- };
1227
- changes.push(dimensionChange);
1228
- prevValues.width = width;
1229
- prevValues.height = height;
1230
- }
1231
- if (changes.length === 0) {
1232
- return;
1233
- }
1234
- const direction = getDirection({
1235
- width: prevValues.width,
1236
- prevWidth,
1237
- height: prevValues.height,
1238
- prevHeight,
1239
- invertX,
1240
- invertY
1241
- });
1242
- const nextValues = { ...prevValues, direction };
1243
- const callResize = (_a = props.shouldResize) == null ? void 0 : _a.call(props, event, nextValues);
1244
- if (callResize === false) {
1245
- return;
1246
- }
1247
- emits("resize", { event, params: nextValues });
1248
- triggerEmits.nodesChange(changes);
1249
- }
1250
- }).on("end", (event) => {
1251
- if (props.nodeId) {
1252
- const dimensionChange = {
1253
- id: props.nodeId,
1254
- type: "dimensions",
1255
- resizing: false
1256
- };
1257
- emits("resizeEnd", { event, params: prevValues });
1258
- triggerEmits.nodesChange([dimensionChange]);
1259
- }
1260
- });
1261
- selection.call(dragHandler);
1262
- onCleanup(() => {
1263
- selection.on(".drag", null);
1264
- });
1265
- });
1266
- return (_ctx, _cache) => {
1267
- return openBlock(), createElementBlock("div", {
1268
- ref_key: "resizeControlRef",
1269
- ref: resizeControlRef,
1270
- class: normalizeClass(["vue-flow__resize-control nodrag", [...positionClassNames.value, _ctx.variant]]),
1271
- style: normalizeStyle(controlStyle.value)
1272
- }, [
1273
- renderSlot(_ctx.$slots, "default")
1274
- ], 6);
1275
- };
1276
- }
1277
- });
1278
- const __default__ = {
1279
- name: "NodeResizer",
1280
- compatConfig: { MODE: 3 },
1281
- inheritAttrs: false
1282
- };
1283
- const _sfc_main = /* @__PURE__ */ defineComponent({
1284
- ...__default__,
1285
- props: {
1286
- nodeId: {},
1287
- color: {},
1288
- handleClassName: {},
1289
- handleStyle: {},
1290
- lineClassName: {},
1291
- lineStyle: {},
1292
- isVisible: { type: Boolean, default: true },
1293
- minWidth: {},
1294
- minHeight: {},
1295
- maxWidth: {},
1296
- maxHeight: {},
1297
- shouldResize: {},
1298
- keepAspectRatio: { type: [Boolean, Number] }
1299
- },
1300
- emits: ["resizeStart", "resize", "resizeEnd"],
1301
- setup(__props, { emit: emits }) {
1302
- const props = __props;
1303
- const { findNode, emits: triggerEmits } = useVueFlow();
1304
- const handleControls = ["top-left", "top-right", "bottom-left", "bottom-right"];
1305
- const lineControls = ["top", "right", "bottom", "left"];
1306
- const contextNodeId = inject(NodeId, null);
1307
- const nodeId = toRef(() => typeof props.nodeId === "string" ? props.nodeId : contextNodeId);
1308
- const node = computed(() => findNode(nodeId.value));
1309
- watch(
1310
- [
1311
- () => props.minWidth,
1312
- () => props.minHeight,
1313
- () => props.maxWidth,
1314
- () => props.maxHeight,
1315
- () => {
1316
- var _a;
1317
- return !!((_a = node.value) == null ? void 0 : _a.dimensions.width) && !!node.value.dimensions.height;
1318
- }
1319
- ],
1320
- ([minWidth, minHeight, maxWidth, maxHeight, isInitialized]) => {
1321
- const n = node.value;
1322
- if (n && isInitialized) {
1323
- const dimensionChange = {
1324
- id: n.id,
1325
- type: "dimensions",
1326
- updateStyle: true,
1327
- dimensions: {
1328
- width: n.dimensions.width,
1329
- height: n.dimensions.height
1330
- }
1331
- };
1332
- if (minWidth && n.dimensions.width < minWidth) {
1333
- dimensionChange.dimensions.width = minWidth;
1334
- }
1335
- if (minHeight && n.dimensions.height < minHeight) {
1336
- dimensionChange.dimensions.height = minHeight;
1337
- }
1338
- if (maxWidth && n.dimensions.width > maxWidth) {
1339
- dimensionChange.dimensions.width = maxWidth;
1340
- }
1341
- if (maxHeight && n.dimensions.height > maxHeight) {
1342
- dimensionChange.dimensions.height = maxHeight;
1343
- }
1344
- if (dimensionChange.dimensions.width !== n.dimensions.width || dimensionChange.dimensions.height !== n.dimensions.height) {
1345
- triggerEmits.nodesChange([dimensionChange]);
1346
- }
1347
- }
1348
- },
1349
- { flush: "post", immediate: true }
1350
- );
1351
- return (_ctx, _cache) => {
1352
- return _ctx.isVisible ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
1353
- (openBlock(), createElementBlock(Fragment, null, renderList(lineControls, (c) => {
1354
- return createVNode(_sfc_main$1, {
1355
- key: c,
1356
- class: normalizeClass(_ctx.lineClassName),
1357
- style: normalizeStyle(_ctx.lineStyle),
1358
- "node-id": nodeId.value,
1359
- position: c,
1360
- variant: unref(ResizeControlVariant).Line,
1361
- "keep-aspect-ratio": _ctx.keepAspectRatio,
1362
- color: _ctx.color,
1363
- "min-width": _ctx.minWidth,
1364
- "min-height": _ctx.minHeight,
1365
- "max-width": _ctx.maxWidth,
1366
- "max-height": _ctx.maxHeight,
1367
- "should-resize": _ctx.shouldResize,
1368
- onResizeStart: _cache[0] || (_cache[0] = ($event) => emits("resizeStart", $event)),
1369
- onResize: _cache[1] || (_cache[1] = ($event) => emits("resize", $event)),
1370
- onResizeEnd: _cache[2] || (_cache[2] = ($event) => emits("resizeEnd", $event))
1371
- }, null, 8, ["class", "style", "node-id", "position", "variant", "keep-aspect-ratio", "color", "min-width", "min-height", "max-width", "max-height", "should-resize"]);
1372
- }), 64)),
1373
- (openBlock(), createElementBlock(Fragment, null, renderList(handleControls, (c) => {
1374
- return createVNode(_sfc_main$1, {
1375
- key: c,
1376
- class: normalizeClass(_ctx.handleClassName),
1377
- style: normalizeStyle(_ctx.handleStyle),
1378
- "node-id": nodeId.value,
1379
- position: c,
1380
- color: _ctx.color,
1381
- "min-width": _ctx.minWidth,
1382
- "min-height": _ctx.minHeight,
1383
- "max-width": _ctx.maxWidth,
1384
- "max-height": _ctx.maxHeight,
1385
- "should-resize": _ctx.shouldResize,
1386
- "keep-aspect-ratio": _ctx.keepAspectRatio,
1387
- onResizeStart: _cache[3] || (_cache[3] = ($event) => emits("resizeStart", $event)),
1388
- onResize: _cache[4] || (_cache[4] = ($event) => emits("resize", $event)),
1389
- onResizeEnd: _cache[5] || (_cache[5] = ($event) => emits("resizeEnd", $event))
1390
- }, null, 8, ["class", "style", "node-id", "position", "color", "min-width", "min-height", "max-width", "max-height", "should-resize", "keep-aspect-ratio"]);
1391
- }), 64))
1392
- ], 64)) : createCommentVNode("", true);
1393
- };
1394
- }
1395
- });
1396
- export {
1397
- _sfc_main as _
1398
- };