unisi 0.1.16__py3-none-any.whl → 0.1.17__py3-none-any.whl
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.
- unisi/__init__.py +2 -2
- unisi/autotest.py +3 -3
- unisi/common.py +2 -2
- unisi/containers.py +5 -5
- unisi/{dbelements.py → dbunits.py} +30 -3
- unisi/kdb.py +8 -5
- unisi/llmrag.py +10 -12
- unisi/server.py +4 -1
- unisi/tables.py +40 -28
- unisi/{guielements.py → units.py} +16 -16
- unisi/users.py +31 -28
- unisi/web/css/{440.824522cf.css → 508.880242b5.css} +1 -1
- unisi/web/index.html +1 -1
- unisi/web/js/508.4af55eb8.js +2 -0
- unisi/web/js/{app.c4786556.js → app.44d431b1.js} +1 -1
- {unisi-0.1.16.dist-info → unisi-0.1.17.dist-info}/METADATA +12 -12
- {unisi-0.1.16.dist-info → unisi-0.1.17.dist-info}/RECORD +19 -19
- unisi/web/js/440.970b3f89.js +0 -2
- {unisi-0.1.16.dist-info → unisi-0.1.17.dist-info}/WHEEL +0 -0
- {unisi-0.1.16.dist-info → unisi-0.1.17.dist-info}/licenses/LICENSE +0 -0
unisi/__init__.py
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
from .utils import *
|
2
|
-
from .
|
2
|
+
from .units import *
|
3
3
|
from .users import User, handle, context_user, context_screen
|
4
4
|
from .server import start
|
5
5
|
from .tables import *
|
6
6
|
from .containers import *
|
7
7
|
from .proxy import *
|
8
|
-
from .
|
8
|
+
from .dbunits import *
|
9
9
|
from .kdb import Database, Dbtable
|
unisi/autotest.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import config, os, logging, json, asyncio
|
2
2
|
from .utils import *
|
3
|
-
from .
|
3
|
+
from .units import *
|
4
4
|
from .containers import Block, Dialog
|
5
5
|
from .users import User
|
6
6
|
from .common import *
|
@@ -135,8 +135,8 @@ def check_block(block, hash_elements):
|
|
135
135
|
errors.append(f'The block {block.name} contains already used "{child.name}" in block "{hash_elements[hash_element]}"!')
|
136
136
|
else:
|
137
137
|
hash_elements[hash_element] = block.name
|
138
|
-
if not isinstance(child,
|
139
|
-
errors.append(f'The block {block.name} contains invalid element {child} instead of
|
138
|
+
if not isinstance(child, Unit) or not child:
|
139
|
+
errors.append(f'The block {block.name} contains invalid element {child} instead of Unit+ object!')
|
140
140
|
elif isinstance(child, Block):
|
141
141
|
errors.append(f'The block {block.name} contains block {child.name}. Blocks cannot contain blocks!')
|
142
142
|
elif child.name in child_names and child.type != 'line':
|
unisi/common.py
CHANGED
@@ -39,7 +39,7 @@ class ArgObject:
|
|
39
39
|
|
40
40
|
class ReceivedMessage(ArgObject):
|
41
41
|
def __init__(self, kwargs):
|
42
|
-
|
42
|
+
self.__dict__.update(kwargs)
|
43
43
|
def __str__(self):
|
44
44
|
return f'{self.block}/{self.element}->{self.event}({self.value})'
|
45
45
|
|
@@ -89,7 +89,7 @@ def get_default_args(func):
|
|
89
89
|
defaults[name] = param.default
|
90
90
|
return defaults
|
91
91
|
|
92
|
-
|
92
|
+
Unishare = ArgObject(context_user = None, sessions = {})
|
93
93
|
|
94
94
|
class Message:
|
95
95
|
def __init__(self, *gui_objects, user = None, type = 'update'):
|
unisi/containers.py
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
from .
|
2
|
-
from .common import pretty4, flatten
|
1
|
+
from .units import *
|
2
|
+
from .common import pretty4, flatten
|
3
3
|
from numbers import Number
|
4
4
|
|
5
5
|
class ContentScaler(Range):
|
@@ -21,7 +21,7 @@ class ContentScaler(Range):
|
|
21
21
|
element.height /= prev
|
22
22
|
return elements
|
23
23
|
|
24
|
-
class Block(
|
24
|
+
class Block(Unit):
|
25
25
|
def __init__(self, name, *elems, **options):
|
26
26
|
self.name = name
|
27
27
|
self.type = 'block'
|
@@ -45,14 +45,14 @@ class Block(Gui):
|
|
45
45
|
elif isinstance(elem.llm, list | tuple):
|
46
46
|
dependencies = elem.llm
|
47
47
|
exactly = True
|
48
|
-
elif isinstance(elem.llm,
|
48
|
+
elif isinstance(elem.llm, Unit):
|
49
49
|
dependencies = [elem.llm]
|
50
50
|
exactly = True
|
51
51
|
elif isinstance(elem.llm, dict):
|
52
52
|
if elem.type != 'table':
|
53
53
|
raise AttributeError(f'{elem.name} llm parameter is a dictionary only for tables, not for {elem.type}!')
|
54
54
|
|
55
|
-
elem.__llm_dependencies__ = {fld: (deps if isinstance(deps, list) else [deps]) for fld, deps in elem.llm.items()}
|
55
|
+
elem.__llm_dependencies__ = {fld: (deps if isinstance(deps, list | bool) else [deps]) for fld, deps in elem.llm.items()}
|
56
56
|
elem.llm = True
|
57
57
|
continue
|
58
58
|
else:
|
@@ -1,3 +1,26 @@
|
|
1
|
+
from .common import Unishare
|
2
|
+
import asyncio
|
3
|
+
from collections import defaultdict
|
4
|
+
|
5
|
+
#storage id -> screen name -> [elem name, block name]
|
6
|
+
dbshare = defaultdict(lambda: defaultdict(lambda: []))
|
7
|
+
#db id -> update
|
8
|
+
dbupdates = defaultdict(lambda: [])
|
9
|
+
|
10
|
+
async def sync_dbupdates():
|
11
|
+
sync_calls = []
|
12
|
+
for id, updates in dbupdates.items():
|
13
|
+
for update in updates:
|
14
|
+
screen2el_bl = dbshare[id]
|
15
|
+
for user in Unishare.sessions.values():
|
16
|
+
scr_name = user.screen.name
|
17
|
+
if scr_name in screen2el_bl:
|
18
|
+
for elem_block in screen2el_bl[scr_name]: #optim--
|
19
|
+
update4user = {**update, **elem_block.__dict__}
|
20
|
+
sync_calls.append(user.send(update4user))
|
21
|
+
dbupdates.clear()
|
22
|
+
await asyncio.gather(*sync_calls)
|
23
|
+
|
1
24
|
class Dblist:
|
2
25
|
def __init__(self, dbtable, init_list = None, cache = None):
|
3
26
|
self.cache = cache
|
@@ -91,7 +114,7 @@ class Dblist:
|
|
91
114
|
chunk.append(next_list[0])
|
92
115
|
else:
|
93
116
|
delta_list, chunk = self.get_delta_chunk(delta_list)
|
94
|
-
self.update = dict(type = '
|
117
|
+
self.update = dict(type = 'updates', index = delta_list, data = chunk)
|
95
118
|
self.clean_cache_from(next_delta_list)
|
96
119
|
|
97
120
|
def __len__(self):
|
@@ -112,9 +135,11 @@ class Dblist:
|
|
112
135
|
|
113
136
|
def extend(self, rows):
|
114
137
|
start = self.dbtable.length
|
138
|
+
delta_start = start // self.limit * self.limit
|
115
139
|
rows = self.dbtable.append_rows(rows)
|
116
140
|
len_rows = len(rows)
|
117
141
|
i_rows = 0
|
142
|
+
length = len_rows + start
|
118
143
|
while len_rows > 0:
|
119
144
|
delta_list = start // self.limit * self.limit
|
120
145
|
list = self.delta_list.get(delta_list)
|
@@ -129,8 +154,10 @@ class Dblist:
|
|
129
154
|
|
130
155
|
i_rows += can_fill
|
131
156
|
start += can_fill
|
132
|
-
len_rows -= can_fill
|
133
|
-
|
157
|
+
len_rows -= can_fill
|
158
|
+
delta, data = self.get_delta_chunk(delta_start)
|
159
|
+
self.update = dict(type = 'updates', index = delta, data = data, length = length)
|
160
|
+
return self.update
|
134
161
|
|
135
162
|
def insert(self, index, value):
|
136
163
|
self.append(value)
|
unisi/kdb.py
CHANGED
@@ -1,9 +1,12 @@
|
|
1
|
-
import kuzu, shutil, os, re
|
1
|
+
import kuzu, shutil, os, re
|
2
2
|
from datetime import date, datetime
|
3
3
|
from cymple import QueryBuilder as qb
|
4
4
|
from cymple.typedefs import Properties
|
5
|
-
from .common import get_default_args
|
6
|
-
from .
|
5
|
+
from .common import get_default_args
|
6
|
+
from .dbunits import Dblist
|
7
|
+
|
8
|
+
def equal_fields_dicts(dict1, dict2):
|
9
|
+
return dict1.keys() == dict2.keys() and all(dict1[key].lower() == dict2[key].lower() for key in dict1)
|
7
10
|
|
8
11
|
def is_modifying_query(cypher_query):
|
9
12
|
query = cypher_query.lower()
|
@@ -109,7 +112,7 @@ class Database:
|
|
109
112
|
fields = {headers[i]: type for i, type in enumerate(types)}
|
110
113
|
|
111
114
|
if (table_fields := self.get_table_fields(id)) is not None:
|
112
|
-
if not
|
115
|
+
if not equal_fields_dicts(table_fields, fields):
|
113
116
|
if self.delete_table(id):
|
114
117
|
self.message_logger(f'Node table {id} was deleted because of fields contradiction!', 'warning')
|
115
118
|
else:
|
@@ -191,7 +194,7 @@ class Dbtable:
|
|
191
194
|
rel_table_fields = self.db.get_table_fields(relname)
|
192
195
|
if isinstance(rel_table_fields, dict):
|
193
196
|
if isinstance(fields, dict):
|
194
|
-
if
|
197
|
+
if equal_fields_dicts(rel_table_fields, fields):
|
195
198
|
return relname, rel_table_fields
|
196
199
|
else:
|
197
200
|
self.db.delete_table(relname)
|
unisi/llmrag.py
CHANGED
@@ -1,12 +1,12 @@
|
|
1
|
-
from .common import
|
1
|
+
from .common import Unishare
|
2
2
|
from langchain_groq import ChatGroq
|
3
3
|
from langchain_openai import ChatOpenAI
|
4
4
|
|
5
5
|
def setup_llmrag():
|
6
6
|
import config #the module is loaded before config.py
|
7
|
-
if
|
7
|
+
if config.llm:
|
8
8
|
match config.llm:
|
9
|
-
case ['
|
9
|
+
case ['host', address]:
|
10
10
|
model = None
|
11
11
|
type = 'openai' #provider type is openai for local llms
|
12
12
|
case [type, model, address]: ...
|
@@ -17,14 +17,14 @@ def setup_llmrag():
|
|
17
17
|
|
18
18
|
type = type.lower()
|
19
19
|
if type == 'openai':
|
20
|
-
|
20
|
+
Unishare.llm_model = ChatOpenAI(
|
21
21
|
api_key = 'llm-studio',
|
22
22
|
temperature = 0.0,
|
23
23
|
openai_api_base = address
|
24
24
|
) if address else ChatOpenAI(temperature=0.0)
|
25
25
|
|
26
26
|
elif type == 'groq':
|
27
|
-
|
27
|
+
Unishare.llm_model = ChatGroq(
|
28
28
|
model = model,
|
29
29
|
temperature = 0.0,
|
30
30
|
max_tokens = None,
|
@@ -46,10 +46,10 @@ async def get_property(name, json_context = '', type = 'string', options = None,
|
|
46
46
|
"system",
|
47
47
|
f"""You are an intelligent and extremely concise assistant."""
|
48
48
|
),
|
49
|
-
("
|
50
|
-
Do not include any additional text or commentary in your answer, just exact property value.""")
|
49
|
+
("user", f"""{json_context} Reason and infer the "{name}" value, which {limits}.
|
50
|
+
Do not include any additional text or commentary in your answer, just exact the property value.""")
|
51
51
|
]
|
52
|
-
ai_msg = await
|
52
|
+
ai_msg = await Unishare.llm_model.ainvoke(messages)
|
53
53
|
value = ai_msg.content
|
54
54
|
log_error = ''
|
55
55
|
if type in numeric_types:
|
@@ -69,7 +69,5 @@ async def get_property(name, json_context = '', type = 'string', options = None,
|
|
69
69
|
log_error = f'Invalid value {value} from llm-rag for {messages[1][1]}'
|
70
70
|
|
71
71
|
if log_error:
|
72
|
-
|
73
|
-
return value
|
74
|
-
|
75
|
-
|
72
|
+
Unishare.message_logger(log_error)
|
73
|
+
return value
|
unisi/server.py
CHANGED
@@ -5,6 +5,7 @@ from .reloader import empty_app
|
|
5
5
|
from .autotest import recorder, run_tests
|
6
6
|
from .common import *
|
7
7
|
from.llmrag import setup_llmrag
|
8
|
+
from .dbunits import dbupdates, sync_dbupdates
|
8
9
|
from config import port, upload_dir
|
9
10
|
import traceback, json
|
10
11
|
|
@@ -79,7 +80,9 @@ async def websocket_handler(request):
|
|
79
80
|
if message:
|
80
81
|
if recorder.record_file:
|
81
82
|
recorder.accept(message, user.prepare_result (result))
|
82
|
-
await user.reflect(message, result)
|
83
|
+
await user.reflect(message, result)
|
84
|
+
if dbupdates:
|
85
|
+
await sync_dbupdates()
|
83
86
|
elif msg.type == WSMsgType.ERROR:
|
84
87
|
user.log('ws connection closed with exception %s' % ws.exception())
|
85
88
|
except BaseException as e:
|
unisi/tables.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
from .
|
1
|
+
from .units import Unit
|
2
2
|
from .common import *
|
3
|
-
from .
|
3
|
+
from .dbunits import Dblist, dbupdates
|
4
4
|
from .llmrag import get_property
|
5
5
|
import asyncio
|
6
6
|
|
@@ -69,7 +69,7 @@ def append_table_row(table, search_str):
|
|
69
69
|
table.rows.append(new_row)
|
70
70
|
return new_row
|
71
71
|
|
72
|
-
class Table(
|
72
|
+
class Table(Unit):
|
73
73
|
def __init__(self, *args, panda = None, **kwargs):
|
74
74
|
if panda is not None:
|
75
75
|
self.mutate(PandaTable(*args, panda=panda, **kwargs))
|
@@ -77,10 +77,9 @@ class Table(Gui):
|
|
77
77
|
super().__init__(*args, **kwargs)
|
78
78
|
set_defaults(self, dict(headers = [], type = 'table', value = None, rows = [], editing = False, dense = True))
|
79
79
|
self.__headers__ = self.headers[:]
|
80
|
-
if
|
81
|
-
|
82
|
-
|
83
|
-
db.set_db_list(self)
|
80
|
+
if hasattr(self,'id'):
|
81
|
+
if Unishare.db:
|
82
|
+
Unishare.db.set_db_list(self)
|
84
83
|
else:
|
85
84
|
raise AssertionError('Config db_dir is not defined!')
|
86
85
|
self.get = get_chunk
|
@@ -99,7 +98,7 @@ class Table(Gui):
|
|
99
98
|
self.__link__ = link_table, list(prop_types.keys()), rel_name
|
100
99
|
self.link = rel_fields
|
101
100
|
|
102
|
-
@
|
101
|
+
@Unishare.handle(link_table,'changed')
|
103
102
|
def link_table_selection_changed(master_table, val, init = False):
|
104
103
|
lstvalue = val if isinstance(val, list) else [val] if val != None else []
|
105
104
|
if lstvalue:
|
@@ -122,14 +121,14 @@ class Table(Gui):
|
|
122
121
|
link_table_selection_changed(link_table, link_table.value, True)
|
123
122
|
self.__link_table_selection_changed__ = link_table_selection_changed
|
124
123
|
|
125
|
-
@
|
124
|
+
@Unishare.handle(self,'filter')
|
126
125
|
def filter_status_changed(table, value):
|
127
126
|
self.filter = value
|
128
127
|
link_table_selection_changed(link_table, link_table.value, True)
|
129
128
|
self.calc_headers()
|
130
129
|
return self
|
131
130
|
|
132
|
-
@
|
131
|
+
@Unishare.handle(self,'changed')
|
133
132
|
def changed_selection_causes__changing_links(self, new_value):
|
134
133
|
if link_table.value is not None and link_table.value != []:
|
135
134
|
#if link table is in multi mode, links are not editable
|
@@ -147,7 +146,7 @@ class Table(Gui):
|
|
147
146
|
return Warning('The linked table is not in edit mode', self)
|
148
147
|
return self.accept(new_value)
|
149
148
|
|
150
|
-
@
|
149
|
+
@Unishare.handle(self,'search')
|
151
150
|
def search_changed(table, value):
|
152
151
|
self.search = value
|
153
152
|
if has_link:
|
@@ -183,6 +182,11 @@ class Table(Gui):
|
|
183
182
|
self.value = [] if isinstance(self.value,tuple | list) else None
|
184
183
|
return self
|
185
184
|
|
185
|
+
def extend(self, new_rows):
|
186
|
+
update = self.rows.extend(new_rows)
|
187
|
+
if hasattr(self,'id'):
|
188
|
+
dbupdates[self.id].append(update)
|
189
|
+
|
186
190
|
def calc_headers(self):
|
187
191
|
"""only for persistent"""
|
188
192
|
table_fields = self.rows.dbtable.table_fields
|
@@ -209,26 +213,28 @@ class Table(Gui):
|
|
209
213
|
|
210
214
|
async def emit(self, *_):
|
211
215
|
"""calcute llm field values for selected rows if they are None"""
|
212
|
-
if
|
216
|
+
if Unishare.llm_model and getattr(self, 'llm', None) is not None:
|
213
217
|
tasks = []
|
214
218
|
for index in self.selected_list:
|
215
|
-
values = {field: value for field, value in zip(self.headers, self.rows[index])
|
216
|
-
if value is not None and value != ''}
|
219
|
+
values = {field: value for field, value in zip(self.headers, self.rows[index]) if value}
|
217
220
|
for fld, deps in self.__llm_dependencies__.items():
|
218
|
-
if fld not in values:
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
221
|
+
if fld not in values:
|
222
|
+
if deps is True:
|
223
|
+
context = values
|
224
|
+
else:
|
225
|
+
context = {}
|
226
|
+
for dep in deps:
|
227
|
+
value = values.get(dep, None)
|
228
|
+
if value is None:
|
229
|
+
if self.llm: #exact
|
230
|
+
continue #not all fields
|
231
|
+
else:
|
232
|
+
if isinstance(dep, str):
|
233
|
+
context[dep] = value
|
234
|
+
elif isinstance(dep, Unit):
|
235
|
+
context[dep.name] = dep.value
|
236
|
+
else:
|
237
|
+
raise AttributeError(f'Invalid llm parameter {dep} in {self.name} element!')
|
232
238
|
if context:
|
233
239
|
async def assign(index, fld, jcontext):
|
234
240
|
self.rows[index][self.headers.index(fld)] = await get_property(fld, jcontext)
|
@@ -236,6 +242,12 @@ class Table(Gui):
|
|
236
242
|
if tasks:
|
237
243
|
await asyncio.gather(*tasks)
|
238
244
|
return self
|
245
|
+
@property
|
246
|
+
def is_base_table_list(self):
|
247
|
+
"""is table in basic view mode"""
|
248
|
+
if hasattr(self, 'id'):
|
249
|
+
dbtable = self.rows.dbtable
|
250
|
+
return dbtable.list is self.rows
|
239
251
|
|
240
252
|
def delete_panda_row(table, row_num):
|
241
253
|
df = table.__panda__
|
@@ -1,7 +1,7 @@
|
|
1
1
|
from .common import *
|
2
2
|
from .llmrag import get_property
|
3
3
|
|
4
|
-
class
|
4
|
+
class Unit:
|
5
5
|
def __init__(self, name, *args, **kwargs):
|
6
6
|
self.name = name
|
7
7
|
la = len(args)
|
@@ -30,14 +30,14 @@ class Gui:
|
|
30
30
|
|
31
31
|
async def emit(self, *_ ):
|
32
32
|
"""calcute value by system llm, can be used as a handler"""
|
33
|
-
if
|
33
|
+
if Unishare.llm_model and (exactly := getattr(self, 'llm', None)) is not None:
|
34
34
|
elems = [e.compact_view for e in self.__llm_dependencies__ if e.value != '' and e.value is not None]
|
35
35
|
#exactly is requirment that all elements have to have valid value
|
36
36
|
if not exactly or len(elems) == len(self.__llm_dependencies__):
|
37
37
|
context = toJson(elems)
|
38
38
|
self.value = await get_property(self.name, context, self.type, options = getattr(self, 'options', None))
|
39
39
|
return self
|
40
|
-
|
40
|
+
|
41
41
|
def add_changed_handler(self, handler):
|
42
42
|
changed_handler = getattr(self, 'changed', None)
|
43
43
|
if not changed_handler:
|
@@ -45,7 +45,7 @@ class Gui:
|
|
45
45
|
obj.value = value
|
46
46
|
self.changed = compose_handlers(changed_handler, handler)
|
47
47
|
|
48
|
-
Line =
|
48
|
+
Line = Unit("__Line__", type = 'line')
|
49
49
|
|
50
50
|
def smart_complete(lst, min_input_length = 0, max_output_length = 20):
|
51
51
|
di = {it: it.lower() for it in lst}
|
@@ -60,7 +60,7 @@ def smart_complete(lst, min_input_length = 0, max_output_length = 20):
|
|
60
60
|
return [e[1] for e in arr]
|
61
61
|
return complete
|
62
62
|
|
63
|
-
class Edit(
|
63
|
+
class Edit(Unit):
|
64
64
|
def __init__(self, name, *args, **kwargs):
|
65
65
|
super().__init__(name, *args, **kwargs)
|
66
66
|
has_value = hasattr(self,'value')
|
@@ -70,18 +70,18 @@ class Edit(Gui):
|
|
70
70
|
if type_value == int or type_value == float:
|
71
71
|
self.type = 'number'
|
72
72
|
return
|
73
|
-
self.type =
|
73
|
+
self.type = 'string'
|
74
74
|
if not has_value:
|
75
75
|
self.value = '' if self.type != 'number' else 0
|
76
76
|
|
77
|
-
class Text(
|
77
|
+
class Text(Unit):
|
78
78
|
def __init__(self, name, *args, **kwargs):
|
79
79
|
super().__init__(name, *args, **kwargs)
|
80
80
|
self.value = self.name
|
81
81
|
self.type = 'string'
|
82
82
|
self.edit = False
|
83
83
|
|
84
|
-
class Range(
|
84
|
+
class Range(Unit):
|
85
85
|
def __init__(self, name, *args, **kwargs):
|
86
86
|
super().__init__(name, *args, **kwargs)
|
87
87
|
if not hasattr(self, 'value'):
|
@@ -90,7 +90,7 @@ class Range(Gui):
|
|
90
90
|
if 'options' not in kwargs:
|
91
91
|
self.options = [self.value - 10, self.value + 10, 1]
|
92
92
|
|
93
|
-
class Button(
|
93
|
+
class Button(Unit):
|
94
94
|
def __init__(self, name, handler = None, **kwargs):
|
95
95
|
self.name = name
|
96
96
|
self.value = None
|
@@ -110,7 +110,7 @@ def UploadButton(name, handler = None,**kwargs):
|
|
110
110
|
kwargs['width'] = 250.0
|
111
111
|
return Button(name, handler, **kwargs)
|
112
112
|
|
113
|
-
class Image(
|
113
|
+
class Image(Unit):
|
114
114
|
'''name is file name or url, label is optional text to draw on the image'''
|
115
115
|
def __init__(self, name, value = False, handler = None, label = '', width = 300, **kwargs):
|
116
116
|
super().__init__(name, [], **kwargs)
|
@@ -126,7 +126,7 @@ class Image(Gui):
|
|
126
126
|
if self.url[1] == ':':
|
127
127
|
self.url = f'/{self.url}'
|
128
128
|
|
129
|
-
class Video(
|
129
|
+
class Video(Unit):
|
130
130
|
'''has to contain src parameter'''
|
131
131
|
def __init__(self,name, *args, **kwargs):
|
132
132
|
super().__init__(name, *args, **kwargs)
|
@@ -159,32 +159,32 @@ class Edge:
|
|
159
159
|
|
160
160
|
graph_default_value = {'nodes' : [], 'edges' : []}
|
161
161
|
|
162
|
-
class Graph(
|
162
|
+
class Graph(Unit):
|
163
163
|
'''has to contain nodes, edges, see Readme'''
|
164
164
|
def __init__(self, name, *args, **kwargs):
|
165
165
|
super().__init__(name, *args, **kwargs)
|
166
166
|
self.type='graph'
|
167
167
|
set_defaults(self,{'value': graph_default_value, 'nodes': [], 'edges': []})
|
168
168
|
|
169
|
-
class Switch(
|
169
|
+
class Switch(Unit):
|
170
170
|
def __init__(self,name, *args, **kwargs):
|
171
171
|
super().__init__(name, *args, **kwargs)
|
172
172
|
set_defaults(self,{'value': False, 'type': 'switch'})
|
173
173
|
|
174
|
-
class Select(
|
174
|
+
class Select(Unit):
|
175
175
|
def __init__(self,name, *args, **kwargs):
|
176
176
|
super().__init__(name, *args, **kwargs)
|
177
177
|
set_defaults(self,{'options': [], 'value': None})
|
178
178
|
if not hasattr(self, 'type'):
|
179
179
|
self.type = 'select' if len(self.options) > 3 else 'radio'
|
180
180
|
|
181
|
-
class Tree(
|
181
|
+
class Tree(Unit):
|
182
182
|
def __init__(self,name, *args, **kwargs):
|
183
183
|
super().__init__(name, *args, **kwargs)
|
184
184
|
self.type = 'tree'
|
185
185
|
set_defaults(self,{'options': [], 'value': None})
|
186
186
|
|
187
|
-
class TextArea(
|
187
|
+
class TextArea(Unit):
|
188
188
|
def __init__(self,name, *args, **kwargs):
|
189
189
|
super().__init__(name, *args, **kwargs)
|
190
190
|
self.type = 'text'
|
unisi/users.py
CHANGED
@@ -1,20 +1,17 @@
|
|
1
1
|
from .utils import *
|
2
|
-
from .
|
2
|
+
from .units import *
|
3
3
|
from .common import *
|
4
4
|
from .containers import Dialog, Screen
|
5
5
|
from .multimon import notify_monitor, logging_lock, run_external_process
|
6
6
|
from .kdb import Database
|
7
|
+
from .dbunits import dbshare
|
7
8
|
import sys, asyncio, logging, importlib
|
8
|
-
from collections import defaultdict
|
9
9
|
|
10
10
|
class User:
|
11
11
|
last_user = None
|
12
|
-
toolbar = []
|
13
|
-
sessions = {}
|
12
|
+
toolbar = []
|
14
13
|
count = 0
|
15
|
-
|
16
|
-
dbshare = defaultdict(lambda: defaultdict(lambda: []))
|
17
|
-
|
14
|
+
|
18
15
|
def __init__(self, session: str, share = None):
|
19
16
|
self.session = session
|
20
17
|
self.active_dialog = None
|
@@ -53,7 +50,7 @@ class User:
|
|
53
50
|
await asyncio.gather(*[user.send(message)
|
54
51
|
for user in self.reflections
|
55
52
|
if user is not self and screen is user.screen_module])
|
56
|
-
|
53
|
+
|
57
54
|
async def reflect(self, message, result):
|
58
55
|
if self.reflections and not is_screen_switch(message):
|
59
56
|
if result:
|
@@ -92,7 +89,7 @@ class User:
|
|
92
89
|
return module
|
93
90
|
|
94
91
|
async def delete(self):
|
95
|
-
uss =
|
92
|
+
uss = Unishare.sessions
|
96
93
|
if uss and uss.get(self.session):
|
97
94
|
del uss[self.session]
|
98
95
|
|
@@ -124,7 +121,7 @@ class User:
|
|
124
121
|
if self.screens:
|
125
122
|
self.screens.sort(key=lambda s: s.screen.order)
|
126
123
|
main = self.screens[0]
|
127
|
-
if 'prepare'
|
124
|
+
if hasattr(main, 'prepare'):
|
128
125
|
main.prepare()
|
129
126
|
self.screen_module = main
|
130
127
|
self.update_menu()
|
@@ -211,21 +208,21 @@ class User:
|
|
211
208
|
else:
|
212
209
|
if isinstance(raw, Message):
|
213
210
|
raw.fill_paths4(self)
|
214
|
-
elif isinstance(raw,
|
211
|
+
elif isinstance(raw,Unit):
|
215
212
|
raw = Message(raw, user = self)
|
216
213
|
elif isinstance(raw, (list, tuple)):
|
217
214
|
raw = Message(*raw, user = self)
|
218
215
|
return raw
|
219
216
|
|
220
217
|
async def process(self, message):
|
221
|
-
screen_change_message =
|
222
|
-
if is_screen_switch(message)
|
218
|
+
screen_change_message = message.screen and self.screen.name != message.screen
|
219
|
+
if screen_change_message or is_screen_switch(message):
|
223
220
|
for s in self.screens:
|
224
221
|
if s.name == message.value:
|
225
222
|
self.screen_module = s
|
226
223
|
if screen_change_message:
|
227
224
|
break
|
228
|
-
if getattr(s.screen,'prepare',
|
225
|
+
if getattr(s.screen,'prepare', None):
|
229
226
|
s.screen.prepare()
|
230
227
|
return True
|
231
228
|
else:
|
@@ -285,6 +282,16 @@ class User:
|
|
285
282
|
logging.info(str)
|
286
283
|
func(level = logging.WARNING)
|
287
284
|
|
285
|
+
def calc_dbsharing(self):
|
286
|
+
"""calc connections db and units"""
|
287
|
+
dbshare.clear()
|
288
|
+
for module in self.screens:
|
289
|
+
screen = module.screen
|
290
|
+
for block in flatten(screen.blocks):
|
291
|
+
for elem in flatten(block.value):
|
292
|
+
if hasattr(elem, 'id'):
|
293
|
+
dbshare[elem.id][screen.name].append(ArgObject(element = elem.name, block =block.name))
|
294
|
+
|
288
295
|
def context_user():
|
289
296
|
return context_object(User)
|
290
297
|
|
@@ -296,16 +303,17 @@ def message_logger(str, type = 'error'):
|
|
296
303
|
user = context_user()
|
297
304
|
user.log(str, type)
|
298
305
|
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
User.db = Database(config.db_dir, message_logger) if config.db_dir else None
|
306
|
+
Unishare.context_user = context_user
|
307
|
+
Unishare.message_logger = message_logger
|
303
308
|
User.type = User
|
304
309
|
|
310
|
+
if config.db_dir:
|
311
|
+
Unishare.db = Database(config.db_dir, message_logger)
|
312
|
+
|
305
313
|
def make_user(request):
|
306
314
|
session = f'{request.remote}-{User.count}'
|
307
315
|
if requested_connect := request.query_string if config.share else None:
|
308
|
-
user =
|
316
|
+
user = Unishare.sessions.get(requested_connect, None)
|
309
317
|
if not user:
|
310
318
|
error = f'Session id "{requested_connect}" is unknown. Connection refused!'
|
311
319
|
with logging_lock:
|
@@ -319,16 +327,11 @@ def make_user(request):
|
|
319
327
|
else:
|
320
328
|
user = User.type(session)
|
321
329
|
ok = user.load()
|
322
|
-
#register
|
330
|
+
#register shared db map once
|
323
331
|
if not user.count:
|
324
|
-
|
325
|
-
screen = module.screen
|
326
|
-
for block in flatten(screen.blocks):
|
327
|
-
for elem in flatten(block.value):
|
328
|
-
if hasattr(elem, 'id'):
|
329
|
-
User.dbshare[elem.id][screen.name].append([elem.name, block.name])
|
332
|
+
user.calc_dbsharing()
|
330
333
|
User.count += 1
|
331
|
-
|
334
|
+
Unishare.sessions[session] = user
|
332
335
|
return user, ok
|
333
336
|
|
334
337
|
def handle(elem, event):
|
@@ -343,4 +346,4 @@ def handle(elem, event):
|
|
343
346
|
return fn
|
344
347
|
return h
|
345
348
|
|
346
|
-
|
349
|
+
Unishare.handle = handle
|
@@ -1 +1 @@
|
|
1
|
-
thead tr:first-child th{-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);position:sticky;top:0;z-index:1000}:root{--scrollbar-width-height:10px;--scrollbar-thumb-hover:#2176d2;--scrollbar-thumb-dark:#2176d2;--scrollbar-thumb-hover-dark:#2176d2}::-webkit-scrollbar{height:var(--scrollbar-width-height);width:var(--scrollbar-width-height)}::-webkit-scrollbar-track{box-shadow:inset 0 0 4px var(--scrollbar-track-dark)}::-webkit-scrollbar-corner{background:var(--scrollbar-track-dark)}::-webkit-scrollbar-thumb{background:var(--scrollbar-thumb-dark);border-radius:5px}::-webkit-scrollbar-thumb:hover{background:var(--scrollbar-thumb-hover-dark)}body[data-v-
|
1
|
+
thead tr:first-child th{-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);position:sticky;top:0;z-index:1000}:root{--scrollbar-width-height:10px;--scrollbar-thumb-hover:#2176d2;--scrollbar-thumb-dark:#2176d2;--scrollbar-thumb-hover-dark:#2176d2}::-webkit-scrollbar{height:var(--scrollbar-width-height);width:var(--scrollbar-width-height)}::-webkit-scrollbar-track{box-shadow:inset 0 0 4px var(--scrollbar-track-dark)}::-webkit-scrollbar-corner{background:var(--scrollbar-track-dark)}::-webkit-scrollbar-thumb{background:var(--scrollbar-thumb-dark);border-radius:5px}::-webkit-scrollbar-thumb:hover{background:var(--scrollbar-thumb-hover-dark)}body[data-v-763052dd]{display:flex;justify-content:center}.custom-caption[data-v-763052dd]{padding:5px!important}.web-camera-container[data-v-763052dd]{align-items:center;border:1px solid #ccc;border-radius:4px;display:flex;flex-direction:column;justify-content:center;margin-bottom:2rem;margin-top:2rem;padding:2rem;width:500px}.web-camera-container .camera-button[data-v-763052dd]{margin-bottom:2rem}.web-camera-container .camera-box .camera-shutter[data-v-763052dd]{background-color:#fff;height:337.5px;opacity:0;position:absolute;width:450px}.web-camera-container .camera-box .camera-shutter.flash[data-v-763052dd]{opacity:1}.web-camera-container .camera-shoot[data-v-763052dd]{margin:1rem 0}.web-camera-container .camera-shoot button[data-v-763052dd]{align-items:center;border-radius:100%;display:flex;height:60px;justify-content:center;width:60px}.web-camera-container .camera-shoot button img[data-v-763052dd]{height:35px;object-fit:cover}.web-camera-container .camera-loading[data-v-763052dd]{height:100%;margin:3rem 0 0 -1.2rem;min-height:150px;overflow:hidden;position:absolute;width:100%}.web-camera-container .camera-loading ul[data-v-763052dd]{height:100%;margin:0;position:absolute;width:100%;z-index:999999}.web-camera-container .camera-loading .loader-circle[data-v-763052dd]{display:block;height:14px;left:100%;margin:0 auto;padding:0;position:absolute;top:50%;transform:translateY(-50%);transform:translateX(-50%);width:100%}.web-camera-container .camera-loading .loader-circle li[data-v-763052dd]{animation:preload-763052dd 1s infinite;background:#999;border-radius:100%;display:block;float:left;height:10px;line-height:10px;margin:0 0 0 4px;padding:0;position:relative;top:-50%;width:10px}.web-camera-container .camera-loading .loader-circle li[data-v-763052dd]:nth-child(2){animation-delay:.2s}.web-camera-container .camera-loading .loader-circle li[data-v-763052dd]:nth-child(3){animation-delay:.4s}@keyframes preload-763052dd{0%{opacity:1}50%{opacity:.4}to{opacity:1}}.q-tab__label{font-size:16px;font-weight:700}
|
unisi/web/index.html
CHANGED
@@ -1 +1 @@
|
|
1
|
-
<!DOCTYPE html><html><head><base href=/ ><title>UNISI</title><meta charset=utf-8><meta name=description content="UNISI on Quasar"><meta name=format-detection content="telephone=no"><meta name=msapplication-tap-highlight content=no><meta name=viewport content="user-scalable=no,initial-scale=1,maximum-scale=1,minimum-scale=1,width=device-width"><link rel=icon type=image/png sizes=128x128 href=icons/favicon-128x128.png><link rel=icon type=image/png sizes=96x96 href=icons/favicon-96x96.png><link rel=icon type=image/png sizes=32x32 href=icons/favicon-32x32.png><link rel=icon type=image/png sizes=16x16 href=icons/favicon-16x16.png><link rel=icon type=image/ico href=favicon.ico><script defer src=/js/vendor.eab68489.js></script><script defer src=/js/app.
|
1
|
+
<!DOCTYPE html><html><head><base href=/ ><title>UNISI</title><meta charset=utf-8><meta name=description content="UNISI on Quasar"><meta name=format-detection content="telephone=no"><meta name=msapplication-tap-highlight content=no><meta name=viewport content="user-scalable=no,initial-scale=1,maximum-scale=1,minimum-scale=1,width=device-width"><link rel=icon type=image/png sizes=128x128 href=icons/favicon-128x128.png><link rel=icon type=image/png sizes=96x96 href=icons/favicon-96x96.png><link rel=icon type=image/png sizes=32x32 href=icons/favicon-32x32.png><link rel=icon type=image/png sizes=16x16 href=icons/favicon-16x16.png><link rel=icon type=image/ico href=favicon.ico><script defer src=/js/vendor.eab68489.js></script><script defer src=/js/app.44d431b1.js></script><link href=/css/vendor.9ed7638d.css rel=stylesheet><link href=/css/app.31d6cfe0.css rel=stylesheet></head><body><div id=q-app></div></body></html>
|
@@ -0,0 +1,2 @@
|
|
1
|
+
"use strict";(globalThis["webpackChunkuniqua"]=globalThis["webpackChunkuniqua"]||[]).push([[508],{8508:(e,t,a)=>{a.r(t),a.d(t,{default:()=>va});var l=a(3673),s=a(2323);const i=(0,l._)("div",{class:"q-pa-md"},null,-1),n=(0,l._)("div",{class:"q-pa-md"},null,-1);function o(e,t,a,o,d,r){const c=(0,l.up)("q-item-label"),h=(0,l.up)("element"),u=(0,l.up)("q-tab"),p=(0,l.up)("q-tabs"),g=(0,l.up)("q-space"),m=(0,l.up)("q-tooltip"),f=(0,l.up)("q-btn"),y=(0,l.up)("q-toolbar"),w=(0,l.up)("q-header"),b=(0,l.up)("zone"),v=(0,l.up)("q-page"),k=(0,l.up)("q-page-container"),x=(0,l.up)("q-layout");return(0,l.wg)(),(0,l.j4)(x,{view:"lHh Lpr lFf"},{default:(0,l.w5)((()=>[(0,l.Wm)(w,{elevated:"",class:(0,s.C_)({"bg-deep-purple-9":e.Dark.isActive})},{default:(0,l.w5)((()=>[(0,l.Wm)(y,null,{default:(0,l.w5)((()=>[(0,l.Wm)(c,{class:"text-h5"},{default:(0,l.w5)((()=>[(0,l.Uk)((0,s.zw)(e.screen.header?e.screen.header:""),1)])),_:1}),i,((0,l.wg)(!0),(0,l.iD)(l.HY,null,(0,l.Ko)(e.left_toolbar,(t=>((0,l.wg)(),(0,l.j4)(h,{class:(0,s.C_)(["q-ma-xs",{"bg-blue-grey-7":e.Dark.isActive,"bg-blue-5":!e.Dark.isActive}]),data:t,pdata:e.tooldata},null,8,["class","data","pdata"])))),256)),n,(0,l.Wm)(p,{class:"bold-tabs",align:"center","inline-label":"",dense:"",modelValue:e.tab,"onUpdate:modelValue":t[0]||(t[0]=t=>e.tab=t),style:{float:"center"}},{default:(0,l.w5)((()=>[((0,l.wg)(!0),(0,l.iD)(l.HY,null,(0,l.Ko)(e.menu,(t=>((0,l.wg)(),(0,l.iD)("div",null,[t.icon?((0,l.wg)(),(0,l.j4)(u,{key:0,class:"justify-center text-white shadow-2","no-caps":"",name:t.name,icon:t.icon,label:t.name,onClick:a=>e.tabclick(t.name)},null,8,["name","icon","label","onClick"])):(0,l.kq)("",!0),t.icon?(0,l.kq)("",!0):((0,l.wg)(),(0,l.j4)(u,{key:1,class:"justify-center text-white shadow-2","no-caps":"",name:t.name,label:t.name,onClick:a=>e.tabclick(t.name)},null,8,["name","label","onClick"]))])))),256))])),_:1},8,["modelValue"]),(0,l.Wm)(g),((0,l.wg)(!0),(0,l.iD)(l.HY,null,(0,l.Ko)(e.right_toolbar,(t=>((0,l.wg)(),(0,l.j4)(h,{class:(0,s.C_)(["q-ma-xs",{"bg-blue-grey-7":e.Dark.isActive,"bg-blue-5":!e.Dark.isActive}]),data:t,pdata:e.tooldata},null,8,["class","data","pdata"])))),256)),(0,l.Wm)(f,{class:(0,s.C_)(["q-ma-xs",{"bg-blue-grey-9":e.Dark.isActive}]),dense:"",round:"",icon:e.Dark.isActive?"light_mode":"dark_mode",onClick:e.switchTheme},{default:(0,l.w5)((()=>[(0,l.Wm)(m,{class:"text-body2"},{default:(0,l.w5)((()=>[(0,l.Uk)("Dark/Light mode")])),_:1})])),_:1},8,["class","icon","onClick"])])),_:1})])),_:1},8,["class"]),(0,l.Wm)(k,{class:"content"},{default:(0,l.w5)((()=>[(0,l.Wm)(v,{class:"flex justify-center centers"},{default:(0,l.w5)((()=>[(0,l.Wm)(b,{data:e.screen.blocks,ref:"page"},null,8,["data"])])),_:1})])),_:1})])),_:1})}function d(e,t,a,i,n,o){const d=(0,l.up)("q-icon"),r=(0,l.up)("q-item-section"),c=(0,l.up)("q-item-label"),h=(0,l.up)("q-item");return(0,l.wg)(),(0,l.j4)(h,{clickable:"",tag:"a",target:"_blank",onClick:e.send},{default:(0,l.w5)((()=>[(0,l.Wm)(r,{avatar:""},{default:(0,l.w5)((()=>[(0,l.Wm)(d,{name:e.icon},null,8,["name"])])),_:1}),(0,l.Wm)(r,null,{default:(0,l.w5)((()=>[(0,l.Wm)(c,null,{default:(0,l.w5)((()=>[(0,l.Uk)((0,s.zw)(e.name),1)])),_:1})])),_:1})])),_:1},8,["onClick"])}a(71);var r=a(698),c=a(8603);let h=null,u={};var p;const g=!1;let m=g;const f=["graph","chart","block","text"],y=["tree","table","list","text","graph","chart"];const w=window.location.host,b=`${window.location.protocol}//${w}`;let v={},k={},x={};function C(e){let t=window.location.href,a=t.split("?"),l=2==a.length?a[1]:null;l&&(a=l.split("#"),2==a.length&&(l=a[0]));let s=g?"ws://localhost:8000/ws":`ws://${w}/ws`;l&&(s+="?"+l),p=new WebSocket(s),p.onopen=()=>e.statusConnect=!0,p.onmessage=t=>{m&&console.log("incoming message",t.data),h.designCycle=0;let a=JSON.parse(t.data);a?e.processMessage(a):e.closeProgress(a)},p.onerror=t=>e.error(t),p.onclose=t=>{t.wasClean?e.info("Connection was finished by the server."):e.error("Connection suddenly closed!"),e.statusConnect=!1,m&&console.info("close code : "+t.code+" reason: "+t.reason)},h=e}function _(e){let t={block:e[0],element:e[1],event:e[2],value:e[3]};m&&console.log("sended",t),p.send(JSON.stringify(t))}let A=!0;function q(e){A=e,e||(x={})}function S(e){if(A){let t=x[e.fullname];if(t)return t.styleSize;A=!1}return null}function D(e,t,a,l="complete"){let s=[e.pdata.name,e.data.name,l,t];_(s),u[s.toString()]=a}function z(e,t,a,l,s){let i=[e,t,s,a];_(i),u[i.toString()]=l}function j(){v={},x=k,A=!0,k={}}function $(e,t){Object.assign(e.data,t),e.updated=t.value,e.value=t.value}function E(e){for(let t of e){let e=t.path;if(e.length>1){e.reverse();let a=e.join("@"),l=k[a];$(l,t.data)}else{let a=v[e[0]];Object.assign(a.data,t.data)}}}function Z(e){let t=`${e.element}@${e.block}`,a=k[t];a.update?a.update(e):console.error()}function O(e){let t=[e.message.block,e.message.element,e.type,e.message.value].toString();if("string"==typeof e.value)h.error(e.value);else if(u[t]){let a=u[t];delete u[t],a(e.value,e.message)}else h.error(t+" doesnt exist in queryMap!")}function M(e){let t=[];for(let l of e)l instanceof Array?t.push(l):t.push([l]);let a=t.shift();return t.reduce(((e,t)=>e.flatMap((e=>t.map((t=>e instanceof Array?[...e,t]:[e,t]))))),a)}function W(e=!1){V(document.documentElement.scrollWidth>window.innerWidth)}let N=(0,c.debounce)(W,50);function V(e){if(h.designCycle>=1)return;m&&console.log(`------------------recalc design ${h.designCycle}`),h.designCycle++;const t=H(e),a=K(e);for(let[l,s]of Object.entries(t)){let e=k[l],t=a[l];const[i,n]=t||[0,1];let o,d=e.geom(),r=d.el,c=e.pdata?e.pdata.name:e.name,h=v[c];for(let a of h.data.value.slice(1))if(Array.isArray(a)){if(a.find((t=>t.name==e.data.name))){let e=a[a.length-1],t=`${e.name}@${c}`;o=k[t];break}}else if(a.name==e.data.name){o=e;break}let u=i;u/=n;let p=e.only_fixed_elems?"":`width:${Math.ceil(r.clientWidth+u)}px`,g=`height:${Math.floor(s+e.he)}px;${p}`;g!=e.styleSize&&(e.styleSize=g),e.has_recalc=!1}}function H(e){const t=h.screen.blocks;let a=window.innerHeight-60,l={},s=new Map,i=[];for(let o of t){const e=[];let t=o instanceof Array,n=t?M(o):[[o]],d={};for(let[a,l]of Object.entries(v)){let e=l.$el.getBoundingClientRect(),t=e.bottom;d[a]=t-e.top}for(let a of n){let e=0,t=!0;for(let l of a)e+=d[l.name],v[l.name].only_fixed_elems||(t=!1);if(t){let e=v[a.slice(-1)[0].name];k[e.fullname]=e}i.push([e+8*a.length,a])}i.sort(((e,t)=>e[0]>t[0]?-1:e[0]==t[0]?0:1));for(let a of i){let t=a[1];(0,r.hu)(Array.isArray(t));const l=[];for(let[e,a]of Object.entries(k))if(a.expanding_height){let[i,n]=e.split("@");if(t.find((e=>e.name==n))){let e=!0;const t=a.geom();for(let[i,n]of l.entries()){let o=n.geom();e&&n!==a&&o.top==t.top&&(o.scrollHeight<t.scrollHeight&&(l[i]=a),e=!1,s.set(a.fullname,n.fullname))}e&&l.push(a)}}l.length&&e.push([a[0],l])}for(let[s,i]of e){let e=0,t=[];for(let a of i)if(a.fullname in l)s+=l[a.fullname];else{let l=a.geom(),i=l.bottom-l.top;i<100&&(s+=100-i,i=100),a.he=i,e+=a.he,t.push(a)}let n=(e+a-s)/t.length,o=0;for(let a of t){let e,s=n-a.he;if(1==t.length)e=s;else if(e=Math.floor(s),s-e){o+=s-e;let t=Math.round(o)-o;t<.001&&t>-.001&&(e+=Math.round(o),o=0)}l[a.fullname]=e}}}let n=Array.from(s.entries());n.sort(((e,t)=>e[0]in l||e[1]in l?-1:1));for(let[o,d]of n)d in l?(l[o]=l[d],k[o].he=k[d].he):(l[d]=l[o],k[d].he=k[o].he);return l}function K(e){let t=null;const a=t?[t]:h.screen.blocks;let l=window.innerWidth-20,s=[],i={};for(let o of a)if(0==s.length)if(Array.isArray(o))for(let e of o)s.push(Array.isArray(e)?e:[e]);else s=[[o]];else{let e=[];if(Array.isArray(o))for(let t of o)for(let a of s)e.push(Array.isArray(t)?a.concat(t):[...a,t]);else for(let t of s)e.push([...t,o]);s=e}const n=[];for(let o of s){let e=0;for(let l of o){let t=v[l.name].$el.getBoundingClientRect();e+=t.right-t.left+5}let t=l-e,a=[[]];for(let l of o){let e=[];for(let t of v[l.name].hlevelements)for(let l of a)e.push([...l,...t]);a=e}for(let l of a)n.push([t,l])}n.sort(((e,t)=>t[1].length-e[1].length));for(let[o,d]of n){let t=new Map;for(let e=0;e<d.length;e++){let a=d[e],l=a.parent_name,s=l||a.name,n=a.geom(),r=(a.data.width?a.data.width:n.scrollWidth)-(n.right-n.left);if(r>1&&!f.includes(a.type)&&o>0&&!i[a.fullname]){let e=o>r?r:o;o-=e,i[a.fullname]=[e,1]}if(s=a.parent_name,s){let e=v[s],l=e.$el.getBoundingClientRect().right-6,i=e.free_right_delta4(a,n.right),o=l-i;i&&o>0&&(!t.has(s)||t.get(s)>o)&&t.set(s,o)}}for(let e of t.values())o+=e;let a=[];for(let n of d)if(n.expanding_width&&(e||f.includes(n.type)))if(i[n.fullname]){let[e,t]=i[n.fullname];o-=e/t}else a.push(n);let l=a.length;const s=o/l;for(let e of a)i[e.fullname]||(i[e.fullname]=[Math.floor(s),1]);for(let e of d)i[e.fullname]||(i[e.fullname]=[0,1])}return i}const F=(0,l.aZ)({name:"menubar",methods:{send(){_(["root",null,"changed",this.name])}},props:{name:{type:String,required:!0},icon:{type:String,default:""}}});var Q=a(4260),U=a(3414),R=a(2035),T=a(4554),I=a(2350),P=a(7518),L=a.n(P);const B=(0,Q.Z)(F,[["render",d]]),Y=B;L()(F,"components",{QItem:U.Z,QItemSection:R.Z,QIcon:T.Z,QItemLabel:I.Z});const G={key:0,class:"row q-col-gutter-xs q-py-xs"},J={class:"q-col-gutter-xs"},X={key:0,class:"column q-col-gutter-xs"};function ee(e,t,a,s,i,n){const o=(0,l.up)("zone",!0),d=(0,l.up)("block");return e.data instanceof Array?((0,l.wg)(),(0,l.iD)("div",G,[((0,l.wg)(!0),(0,l.iD)(l.HY,null,(0,l.Ko)(e.data,(e=>((0,l.wg)(),(0,l.iD)("div",J,[e instanceof Array?((0,l.wg)(),(0,l.iD)("div",X,[((0,l.wg)(!0),(0,l.iD)(l.HY,null,(0,l.Ko)(e,(e=>((0,l.wg)(),(0,l.j4)(o,{class:"q-col-gutter-xs q-py-xs",data:e},null,8,["data"])))),256))])):((0,l.wg)(),(0,l.j4)(d,{key:1,data:e},null,8,["data"]))])))),256))])):((0,l.wg)(),(0,l.j4)(d,{key:1,data:e.data},null,8,["data"]))}const te={class:"row no-wrap"},ae=["data","pdata"],le={key:0,class:"row"},se=["data","pdata"],ie={key:0,class:"row no-wrap"};function ne(e,t,a,i,n,o){const d=(0,l.up)("element"),r=(0,l.up)("q-icon"),c=(0,l.up)("q-scroll-area"),h=(0,l.up)("q-card");return(0,l.wg)(),(0,l.j4)(h,{class:"my-card q-ma-xs",style:(0,s.j5)(e.only_fixed_elems?e.styleSize:null),key:e.name},{default:(0,l.w5)((()=>[(0,l._)("div",te,[e.data.logo?((0,l.wg)(),(0,l.j4)(d,{key:0,class:"q-ma-sm",data:e.data.logo,pdata:e.data},null,8,["data","pdata"])):e.data.icon?((0,l.wg)(),(0,l.j4)(r,{key:1,class:"q-mt-sm q-ml-sm",style:{"padding-top":"6px"},size:"sm",name:e.data.icon},null,8,["name"])):(0,l.kq)("",!0),"_"!=e.name[0]?((0,l.wg)(),(0,l.iD)("p",{key:2,class:(0,s.C_)(["q-ma-sm",{"text-info":e.Dark.isActive,"text-cyan-10":!e.Dark.isActive}]),style:{"padding-top":"6px","font-size":"20px"}},(0,s.zw)(e.name),3)):(0,l.kq)("",!0),((0,l.wg)(!0),(0,l.iD)(l.HY,null,(0,l.Ko)(e.tops,(t=>((0,l.wg)(),(0,l.j4)(d,{class:"q-ma-xs",data:t,pdata:e.data},null,8,["data","pdata"])))),256))]),e.data.scroll?((0,l.wg)(),(0,l.j4)(c,{key:0,style:(0,s.j5)(e.styleSize),"thumb-style":e.thumbStyle,"bar-style":e.barStyle},{default:(0,l.w5)((()=>[((0,l.wg)(!0),(0,l.iD)(l.HY,null,(0,l.Ko)(e.data.value.slice(1),(t=>((0,l.wg)(),(0,l.iD)("div",{class:"column",data:t,pdata:e.data},[t instanceof Array?((0,l.wg)(),(0,l.iD)("div",le,[((0,l.wg)(!0),(0,l.iD)(l.HY,null,(0,l.Ko)(t,(t=>((0,l.wg)(),(0,l.j4)(d,{class:"q-ma-xs",data:t,pdata:e.data},null,8,["data","pdata"])))),256))])):((0,l.wg)(),(0,l.j4)(d,{key:1,class:"q-ma-xs",data:t,pdata:e.data},null,8,["data","pdata"]))],8,ae)))),256))])),_:1},8,["style","thumb-style","bar-style"])):((0,l.wg)(!0),(0,l.iD)(l.HY,{key:1},(0,l.Ko)(e.data.value.slice(1),(t=>((0,l.wg)(),(0,l.iD)("div",{class:"column",data:t,pdata:e.data},[t instanceof Array?((0,l.wg)(),(0,l.iD)("div",ie,[((0,l.wg)(!0),(0,l.iD)(l.HY,null,(0,l.Ko)(t,(t=>((0,l.wg)(),(0,l.j4)(d,{class:"q-ma-xs",data:t,pdata:e.data},null,8,["data","pdata"])))),256))])):((0,l.wg)(),(0,l.j4)(d,{key:1,class:"q-ma-xs",data:t,pdata:e.data},null,8,["data","pdata"]))],8,se)))),256))])),_:1},8,["style"])}var oe=a(8880);const de=e=>((0,l.dD)("data-v-763052dd"),e=e(),(0,l.Cn)(),e),re={key:4},ce={key:5,class:"{'bg-blue-grey-9': Dark.isActive}"},he={key:9},ue={key:12},pe=["width","height"],ge=["src"],me={key:19,class:"web-camera-container"},fe={class:"camera-button"},ye={key:0},we={key:1},be={class:"camera-loading"},ve=de((()=>(0,l._)("ul",{class:"loader-circle"},[(0,l._)("li"),(0,l._)("li"),(0,l._)("li")],-1))),ke=[ve],xe=["height"],Ce=["height"],_e={key:1,class:"camera-shoot"},Ae=de((()=>(0,l._)("img",{src:"https://img.icons8.com/material-outlined/50/000000/camera--v2.png"},null,-1))),qe=[Ae],Se={key:2,class:"camera-download"},De={key:20};function ze(e,t,a,i,n,o){const d=(0,l.up)("q-icon"),r=(0,l.up)("q-img"),c=(0,l.up)("q-select"),h=(0,l.up)("q-checkbox"),u=(0,l.up)("q-toggle"),p=(0,l.up)("q-badge"),g=(0,l.up)("q-slider"),m=(0,l.up)("q-btn"),f=(0,l.up)("q-btn-toggle"),y=(0,l.up)("utable"),w=(0,l.up)("linechart"),b=(0,l.up)("q-input"),v=(0,l.up)("q-tree"),k=(0,l.up)("q-scroll-area"),x=(0,l.up)("q-separator"),C=(0,l.up)("q-uploader"),_=(0,l.up)("sgraph"),A=(0,l.up)("q-tooltip"),q=(0,l.up)("q-spinner-ios");return"image"==e.type?((0,l.wg)(),(0,l.j4)(r,{key:0,src:e.data.url,"spinner-color":"blue",onClick:(0,oe.iM)(e.switchValue,["stop"]),fit:"cover",style:(0,s.j5)(e.elemSize)},{default:(0,l.w5)((()=>[e.data.label?((0,l.wg)(),(0,l.iD)("div",{key:0,class:"absolute-bottom-right text-subtitle2 custom-caption",onClick:t[0]||(t[0]=(0,oe.iM)(((...t)=>e.lens&&e.lens(...t)),["stop"]))},(0,s.zw)(e.data.label),1)):(0,l.kq)("",!0),e.value?((0,l.wg)(),(0,l.j4)(d,{key:1,class:"absolute all-pointer-events",size:"32px",name:"check_circle",color:"light-blue-2",style:{"font-size":"2em",top:"8px",left:"8px"}})):(0,l.kq)("",!0)])),_:1},8,["src","onClick","style"])):"select"==e.type?((0,l.wg)(),(0,l.j4)(c,{key:1,ref:"inputRef","transition-show":"flip-up",readonly:0==e.data.edit,"transition-hide":"flip-down",dense:"",modelValue:e.value,"onUpdate:modelValue":t[1]||(t[1]=t=>e.value=t),options:e.data.options},(0,l.Nv)({_:2},[e.showname?{name:"prepend",fn:(0,l.w5)((()=>[(0,l._)("p",{class:(0,s.C_)(["text-subtitle1 q-ma-sm",{white:e.Dark.isActive,black:!e.Dark.isActive}])},(0,s.zw)(e.name),3)])),key:"0"}:void 0]),1032,["readonly","modelValue","options"])):"check"==e.type?((0,l.wg)(),(0,l.j4)(h,{key:2,ref:"inputRef","left-label":"",disable:0==e.data.edit,modelValue:e.value,"onUpdate:modelValue":t[2]||(t[2]=t=>e.value=t),label:e.nameLabel,"checked-icon":"task_alt","unchecked-icon":"highlight_off"},null,8,["disable","modelValue","label"])):"switch"==e.type?((0,l.wg)(),(0,l.j4)(u,{key:3,ref:"inputRef",modelValue:e.value,"onUpdate:modelValue":t[3]||(t[3]=t=>e.value=t),disable:0==e.data.edit,color:"primary",label:e.nameLabel,"left-label":""},null,8,["modelValue","disable","label"])):"range"==e.type?((0,l.wg)(),(0,l.iD)("div",re,[(0,l.Wm)(p,{outline:"",dense:"",color:e.Dark.isActive?"blue-3":"blue-9"},{default:(0,l.w5)((()=>[(0,l.Uk)((0,s.zw)(e.name)+": "+(0,s.zw)(e.value)+" ("+(0,s.zw)(e.data.options[0])+" to "+(0,s.zw)(e.data.options[1])+", Δ "+(0,s.zw)(e.data.options[2])+")",1)])),_:1},8,["color"]),(0,l.Wm)(g,{class:"q-pl-sm",dense:"",modelValue:e.value,"onUpdate:modelValue":t[4]||(t[4]=t=>e.value=t),min:e.data.options[0],max:e.data.options[1],step:e.data.options[2],color:"primary"},null,8,["modelValue","min","max","step"])])):"radio"==e.type?((0,l.wg)(),(0,l.iD)("div",ce,[e.showname?((0,l.wg)(),(0,l.j4)(m,{key:0,ripple:!1,color:"indigo-10",disable:"",label:e.name,"no-caps":""},null,8,["label"])):(0,l.kq)("",!0),(0,l.Wm)(f,{ref:"inputRef",modelValue:e.value,"onUpdate:modelValue":t[5]||(t[5]=t=>e.value=t),readonly:0==e.data.edit,class:(0,s.C_)({"bg-blue-grey-9":e.Dark.isActive}),"no-caps":"",options:e.data.options.map((e=>({label:e,value:e})))},null,8,["modelValue","readonly","class","options"])])):"table"==e.type?((0,l.wg)(),(0,l.j4)(y,{key:6,data:e.data,pdata:e.pdata,styleSize:e.styleSize},null,8,["data","pdata","styleSize"])):"chart"==e.type?((0,l.wg)(),(0,l.j4)(w,{key:7,data:e.data,pdata:e.pdata,styleSize:e.styleSize},null,8,["data","pdata","styleSize"])):"string"==e.type&&e.data.hasOwnProperty("complete")?((0,l.wg)(),(0,l.j4)(c,{key:8,ref:"inputRef",dense:"",readonly:0==e.data.edit,modelValue:e.value,"onUpdate:modelValue":t[6]||(t[6]=t=>e.value=t),"use-input":"","hide-selected":"",borderless:"",outlined:"","hide-bottom-space":"","fill-input":"","input-debounce":"0",options:e.options,onFilter:e.complete,label:e.name,onKeydown:(0,oe.D2)(e.pressedEnter,["enter"])},null,8,["readonly","modelValue","options","onFilter","label","onKeydown"])):"string"==e.type&&0==e.data.edit?((0,l.wg)(),(0,l.iD)("div",he,[(0,l._)("p",{class:(0,s.C_)(["q-ma-sm",{white:e.Dark.isActive,black:!e.Dark.isActive}])},(0,s.zw)(e.value),3)])):"string"==e.type?((0,l.wg)(),(0,l.j4)(b,{key:10,modelValue:e.value,"onUpdate:modelValue":t[7]||(t[7]=t=>e.value=t),label:e.name2show,ref:"inputRef",autogrow:e.data.autogrow,dense:"",onKeydown:(0,oe.D2)(e.pressedEnter,["enter"]),readonly:0==e.data.edit},null,8,["modelValue","label","autogrow","onKeydown","readonly"])):"number"==e.type?((0,l.wg)(),(0,l.j4)(b,{key:11,modelValue:e.value,"onUpdate:modelValue":t[8]||(t[8]=t=>e.value=t),modelModifiers:{number:!0},label:e.name2show,ref:"inputRef",dense:"",onKeydown:(0,oe.D2)(e.pressedEnter,["enter"]),type:"number",readonly:0==e.data.edit},null,8,["modelValue","label","onKeydown","readonly"])):"tree"==e.type||"list"==e.type?((0,l.wg)(),(0,l.iD)("div",ue,[e.showname?((0,l.wg)(),(0,l.iD)("p",{key:0,class:(0,s.C_)(["text-subtitle1 q-ma-sm text-grey-7",{"text-white":e.Dark.isActive,"text-indigo-10":!e.Dark.isActive}])},(0,s.zw)(e.name),3)):(0,l.kq)("",!0),(0,l.Wm)(k,{style:(0,s.j5)(e.styleSize),"thumb-style":e.thumbStyle,"bar-style":e.barStyle,ref:"scroller"},{default:(0,l.w5)((()=>[(0,l.Wm)(v,{nodes:e.treeNodes,"selected-color":e.Dark.isActive?"blue-3":"blue-9",dense:e.data.dense,ref:"tree",selected:e.value,"onUpdate:selected":t[9]||(t[9]=t=>e.value=t),expanded:e.expandedKeys,"onUpdate:expanded":t[10]||(t[10]=t=>e.expandedKeys=t),"node-key":"label","default-expand-all":""},null,8,["nodes","selected-color","dense","selected","expanded"])])),_:1},8,["style","thumb-style","bar-style"])])):"text"==e.type?(0,l.wy)(((0,l.wg)(),(0,l.iD)("textarea",{key:13,class:(0,s.C_)(["textarea",{"bg-grey-10":e.Dark.isActive,"text-white":e.Dark.isActive}]),"onUpdate:modelValue":t[11]||(t[11]=t=>e.value=t),filled:"",type:"textarea",style:(0,s.j5)(e.elemSize),onKeydown:t[12]||(t[12]=(0,oe.D2)(((...t)=>e.pressedEnter&&e.pressedEnter(...t)),["enter"]))},null,38)),[[oe.nr,e.value]]):"line"==e.type?((0,l.wg)(),(0,l.j4)(x,{key:14,color:"green"})):"video"==e.type?((0,l.wg)(),(0,l.iD)("video",{key:e.fullname,controls:"",width:e.data.width,height:e.data.height},[(0,l._)("source",{src:e.data.url,type:"video/mp4"},null,8,ge)],8,pe)):"uploader"==e.type?((0,l.wg)(),(0,l.j4)(C,{key:16,label:e.name,"auto-upload":"",thumbnails:"",url:e.host_path,onUploaded:e.updateDom,onAdded:e.onAdded,style:(0,s.j5)(e.elemSize),ref:"uploaderRef",flat:"",class:(0,s.C_)({"bg-grey-10":e.Dark.isActive}),color:e.Dark.isActive?"purple-10":"blue"},null,8,["label","url","onUploaded","onAdded","style","class","color"])):"image_uploader"==e.type?((0,l.wg)(),(0,l.j4)(C,{key:17,label:e.name,"auto-upload":"",thumbnails:"",url:e.host_path,onUploaded:e.updateDom,onAdded:e.onAdded,ref:"uploaderRef",flat:"",class:(0,s.C_)({"bg-grey-10":e.Dark.isActive}),color:e.Dark.isActive?"purple-10":"blue"},null,8,["label","url","onUploaded","onAdded","class","color"])):"graph"==e.type?((0,l.wg)(),(0,l.j4)(_,{key:18,data:e.data,pdata:e.pdata,styleSize:e.elemSize},null,8,["data","pdata","styleSize"])):"camera"==e.type?((0,l.wg)(),(0,l.iD)("div",me,[(0,l._)("div",fe,[(0,l._)("button",{class:(0,s.C_)(["button is-rounded",{"is-primary":!e.isCameraOpen,"is-danger":e.isCameraOpen}]),type:"button",onClick:t[13]||(t[13]=(...t)=>e.toggleCamera&&e.toggleCamera(...t))},[e.isCameraOpen?((0,l.wg)(),(0,l.iD)("span",we,"Close Camera")):((0,l.wg)(),(0,l.iD)("span",ye,"Open Camera"))],2)]),(0,l.wy)((0,l._)("div",be,ke,512),[[oe.F8,e.isCameraOpen&&e.isLoading]]),e.isCameraOpen?(0,l.wy)(((0,l.wg)(),(0,l.iD)("div",{key:0,class:(0,s.C_)(["camera-box",{flash:e.isShotPhoto}])},[(0,l._)("div",{class:(0,s.C_)(["camera-shutter",{flash:e.isShotPhoto}])},null,2),(0,l.wy)((0,l._)("video",{ref:"camera",width:450,height:337.5,autoplay:""},null,8,xe),[[oe.F8,!e.isPhotoTaken]]),(0,l.wy)((0,l._)("canvas",{id:"photoTaken",ref:"canvas",width:450,height:337.5},null,8,Ce),[[oe.F8,e.isPhotoTaken]])],2)),[[oe.F8,!e.isLoading]]):(0,l.kq)("",!0),e.isCameraOpen&&!e.isLoading?((0,l.wg)(),(0,l.iD)("div",_e,[(0,l._)("button",{class:"button",type:"button",onClick:t[14]||(t[14]=(...t)=>e.takePhoto&&e.takePhoto(...t))},qe)])):(0,l.kq)("",!0),e.isPhotoTaken&&e.isCameraOpen?((0,l.wg)(),(0,l.iD)("div",Se,[(0,l.Wm)(m,{onClick:e.downloadImage,label:"Send"},null,8,["onClick"])])):(0,l.kq)("",!0)])):""!=e.showname?((0,l.wg)(),(0,l.iD)("div",De,[(0,l.Wm)(m,{ref:"inputRef","no-caps":"",disable:0==e.data.edit,class:(0,s.C_)({"bg-blue-grey-8":e.Dark.isActive}),label:e.name,icon:e.data.icon,onClick:e.sendValue},{default:(0,l.w5)((()=>[e.data.tooltip?((0,l.wg)(),(0,l.j4)(A,{key:0,class:"text-body2"},{default:(0,l.w5)((()=>[(0,l.Uk)((0,s.zw)(e.data.tooltip),1)])),_:1})):(0,l.kq)("",!0)])),_:1},8,["disable","class","label","icon","onClick"])])):e.data.spinner?((0,l.wg)(),(0,l.j4)(m,{key:22,ref:"inputRef","no-caps":"",dense:"",disable:0==e.data.edit,round:"",class:(0,s.C_)({"bg-blue-grey-8":e.Dark.isActive}),onClick:e.sendValue},{default:(0,l.w5)((()=>[(0,l.Wm)(q,{color:e.Dark.isActive?"white":"black"},null,8,["color"]),e.data.tooltip?((0,l.wg)(),(0,l.j4)(A,{key:0,class:"text-body2"},{default:(0,l.w5)((()=>[(0,l.Uk)((0,s.zw)(e.data.tooltip),1)])),_:1})):(0,l.kq)("",!0)])),_:1},8,["disable","class","onClick"])):((0,l.wg)(),(0,l.j4)(m,{key:21,ref:"inputRef","no-caps":"",disable:0==e.data.edit,dense:"",round:"",class:(0,s.C_)({"bg-blue-grey-8":e.Dark.isActive}),icon:e.data.icon,onClick:e.sendValue},{default:(0,l.w5)((()=>[e.data.tooltip?((0,l.wg)(),(0,l.j4)(A,{key:0,class:"text-body2"},{default:(0,l.w5)((()=>[(0,l.Uk)((0,s.zw)(e.data.tooltip),1)])),_:1})):(0,l.kq)("",!0)])),_:1},8,["disable","class","icon","onClick"]))}const je={class:"text-h6"},$e={key:0},Ee={class:"row"},Ze=["onClick"],Oe=["onClick"];function Me(e,t,a,i,n,o){const d=(0,l.up)("q-tooltip"),r=(0,l.up)("q-btn"),c=(0,l.up)("q-icon"),h=(0,l.up)("q-input"),u=(0,l.up)("q-th"),p=(0,l.up)("q-tr"),g=(0,l.up)("q-checkbox"),m=(0,l.up)("q-select"),f=(0,l.up)("q-td"),y=(0,l.up)("q-table");return(0,l.wg)(),(0,l.j4)(y,{"virtual-scroll":"",dense:e.data.dense,style:(0,s.j5)(e.styleSize?e.styleSize:e.currentStyle()),flat:"",filter:e.data.id?"":e.search,ref:"table",virtualScrollSliceSize:"100","rows-per-page-options":[0],"virtual-scroll-sticky-size-start":48,"row-key":"iiid",title:e.name,rows:e.rows,columns:e.columns,selection:e.singleMode?"single":"multiple",selected:e.selected,"onUpdate:selected":t[2]||(t[2]=t=>e.selected=t)},{"top-left":(0,l.w5)((()=>["link"in e.data?((0,l.wg)(),(0,l.j4)(r,{key:0,class:(0,s.C_)(["q-ml-xs",{"bg-blue-grey-8":e.Dark.isActive}]),dense:"",outline:"",color:"primary",icon:e.data.filter?"filter_alt":"filter_alt_off","no-caps":"",onClick:e.switchFilter},{default:(0,l.w5)((()=>[(0,l.Wm)(d,{class:"text-body2"},{default:(0,l.w5)((()=>[(0,l.Uk)((0,s.zw)(e.data.filter?"Turn off filter":"Turn on filter"),1)])),_:1})])),_:1},8,["class","icon","onClick"])):(0,l.kq)("",!0),(0,l._)("div",je,(0,s.zw)(e.name),1)])),"top-right":(0,l.w5)((()=>[!1!==e.data.tools?((0,l.wg)(),(0,l.iD)("div",$e,[(0,l._)("div",Ee,[(0,l.Wm)(h,{modelValue:e.search,"onUpdate:modelValue":t[1]||(t[1]=t=>e.search=t),label:"Search",dense:"",ref:"searchField"},(0,l.Nv)({append:(0,l.w5)((()=>[""!=e.search?((0,l.wg)(),(0,l.j4)(c,{key:0,class:"cursor-pointer",name:"close",size:"xs",onClick:t[0]||(t[0]=t=>{e.search="",e.$refs.searchField.focus()})},{default:(0,l.w5)((()=>[(0,l.Wm)(d,{class:"text-body2"},{default:(0,l.w5)((()=>[(0,l.Uk)("Reset search ")])),_:1})])),_:1})):(0,l.kq)("",!0)])),_:2},[""==e.search?{name:"prepend",fn:(0,l.w5)((()=>[(0,l.Wm)(c,{name:"search",size:"xs"})])),key:"0"}:void 0]),1032,["modelValue"]),(0,l._)("div",null,[(0,l.Wm)(r,{class:(0,s.C_)(["q-ml-xs",{"bg-blue-grey-8":e.Dark.isActive}]),dense:"",rounded:"",icon:"select_all","no-caps":"",onClick:e.showSelected},{default:(0,l.w5)((()=>[(0,l.Wm)(d,{class:"text-body2"},{default:(0,l.w5)((()=>[(0,l.Uk)("Show selected ")])),_:1})])),_:1},8,["class","onClick"]),(0,l.Wm)(r,{class:(0,s.C_)(["q-ml-xs",{"bg-blue-grey-8":e.Dark.isActive}]),dense:"",rounded:"",icon:"deselect","no-caps":"",onClick:e.deselectAll},{default:(0,l.w5)((()=>[(0,l.Wm)(d,{class:"text-body2"},{default:(0,l.w5)((()=>[(0,l.Uk)("Deselect all")])),_:1})])),_:1},8,["class","onClick"]),!1!==e.data.multimode?((0,l.wg)(),(0,l.j4)(r,{key:0,class:(0,s.C_)(["q-ml-xs",{"bg-blue-grey-8":e.Dark.isActive}]),dense:"",rounded:"",icon:e.singleMode?"looks_one":"grain","no-caps":"",onClick:e.switchMode},{default:(0,l.w5)((()=>[(0,l.Wm)(d,{class:"text-body2"},{default:(0,l.w5)((()=>[(0,l.Uk)("Multi-single select mode ")])),_:1})])),_:1},8,["class","icon","onClick"])):(0,l.kq)("",!0),e.editable?((0,l.wg)(),(0,l.j4)(r,{key:1,class:(0,s.C_)(["q-ml-xs",{"bg-blue-grey-8":e.Dark.isActive}]),dense:"",rounded:"",icon:e.data.editing?"cancel":"edit","no-caps":"",onClick:e.switchEdit},{default:(0,l.w5)((()=>[(0,l.Wm)(d,{class:"text-body2"},{default:(0,l.w5)((()=>[(0,l.Uk)("Edit mode")])),_:1})])),_:1},8,["class","icon","onClick"])):(0,l.kq)("",!0),e.editable&&"append"in e.data?((0,l.wg)(),(0,l.j4)(r,{key:2,class:(0,s.C_)(["q-ml-xs",{"bg-blue-grey-8":e.Dark.isActive}]),dense:"",rounded:"",icon:"add","no-caps":"",onClick:e.append},{default:(0,l.w5)((()=>[(0,l.Wm)(d,{class:"text-body2"},{default:(0,l.w5)((()=>[(0,l.Uk)((0,s.zw)(e.data.filter?"Add a new entity+link":"Add a new row"),1)])),_:1})])),_:1},8,["class","onClick"])):(0,l.kq)("",!0),"delete"in e.data?((0,l.wg)(),(0,l.j4)(r,{key:3,class:(0,s.C_)(["q-ml-xs",{"bg-blue-grey-8":e.Dark.isActive}]),dense:"",rounded:"",icon:"delete_forever","no-caps":"",onClick:e.delSelected},{default:(0,l.w5)((()=>[(0,l.Wm)(d,{class:"text-body2"},{default:(0,l.w5)((()=>[(0,l.Uk)("Delete selected ")])),_:1})])),_:1},8,["class","onClick"])):(0,l.kq)("",!0),"view"in e.data?((0,l.wg)(),(0,l.j4)(r,{key:4,class:(0,s.C_)(["q-ml-xs",{"bg-blue-grey-8":e.Dark.isActive}]),dense:"",rounded:"",icon:"insights","no-caps":"",onClick:e.chart},{default:(0,l.w5)((()=>[(0,l.Wm)(d,{class:"text-body2"},{default:(0,l.w5)((()=>[(0,l.Uk)("Draw the chart")])),_:1})])),_:1},8,["class","onClick"])):(0,l.kq)("",!0)])])])):(0,l.kq)("",!0)])),header:(0,l.w5)((t=>[(0,l.Wm)(p,{props:t},{default:(0,l.w5)((()=>[((0,l.wg)(!0),(0,l.iD)(l.HY,null,(0,l.Ko)(t.cols,(a=>((0,l.wg)(),(0,l.j4)(u,{class:(0,s.C_)(["text-italic",{"text-grey-9":!e.Dark.isActive,"text-teal-3":e.Dark.isActive}]),key:a.name,props:t},{default:(0,l.w5)((()=>[(0,l.Uk)((0,s.zw)(a.label),1)])),_:2},1032,["class","props"])))),128))])),_:2},1032,["props"])])),body:(0,l.w5)((t=>[(0,l.Wm)(p,{props:t,onClick:e=>t.selected=!t.selected},{default:(0,l.w5)((()=>[((0,l.wg)(!0),(0,l.iD)(l.HY,null,(0,l.Ko)(e.columns,((a,i)=>((0,l.wg)(),(0,l.j4)(f,{key:a.name,props:t},{default:(0,l.w5)((()=>["boolean"==typeof t.row[a.name]?((0,l.wg)(),(0,l.j4)(g,{key:0,modelValue:t.row[a.name],"onUpdate:modelValue":[e=>t.row[a.name]=e,l=>e.change_switcher(t.row,a.name,i)],dense:"",disable:!e.data.editing},null,8,["modelValue","onUpdate:modelValue","disable"])):e.data.editing&&"complete"in e.data&&i==e.cedit&&e.redit==t.row.iiid?((0,l.wg)(),(0,l.j4)(m,{key:1,dense:"","model-value":t.row[a.name],"use-input":"","hide-selected":"","fill-input":"",autofocus:"",outlined:"",borderless:"",onInputValue:e.change,"hide-dropdown-icon":"","input-debounce":"0",options:e.options,onKeydown:e.keyInput,onFilter:e.complete},null,8,["model-value","onInputValue","options","onKeydown","onFilter"])):e.data.editing&&i==e.cedit&&e.redit==t.row.iiid?((0,l.wg)(),(0,l.j4)(h,{key:2,modelValue:t.row[a.name],"onUpdate:modelValue":[e=>t.row[a.name]=e,e.change],dense:"",onKeydown:e.keyInput,autofocus:""},null,8,["modelValue","onUpdate:modelValue","onKeydown"])):void 0==t.row[a.name]?((0,l.wg)(),(0,l.iD)("div",{key:3,onClick:a=>e.select(t.row,i)},"-- ",8,Ze)):((0,l.wg)(),(0,l.iD)("div",{key:4,onClick:a=>e.select(t.row,i)},(0,s.zw)(t.row[a.name]),9,Oe))])),_:2},1032,["props"])))),128))])),_:2},1032,["props","onClick"])])),_:1},8,["dense","style","filter","title","rows","columns","selection","selected"])}var We=a(1959),Ne=a(9058);function Ve(e,t){return e.length===t.length&&e.every(((e,a)=>t[a]&&e.iiid==t[a].iiid))}let He="✘";function Ke(e,t){let a=[];const l=e.headers,s=l.length,i=t.length;for(var n=0;n<i;n++){const i={},d=t[n];for(var o=0;o<s;o++)null!=d[o]&&void 0!=d[o]&&(i[l[o]]=d[o]);let r=d.length;i.iiid=s<r||e.id?d[r-1]:n,a.push(i)}return a}function Fe(e,t){let a=[],{limit:l,length:s,data:i}=t.rows;//!! занести в update init?
|
2
|
+
s&&a.splice(0,0,...Ke(t,i)),a.length=s,a=(0,We.qj)(a);let n=[];function o(l,s){switch(l.type){case"update":a[l.index]=l.data;break;case"updates":if(l.data){let e=l.data.length;a.splice(l.index,e,...Ke(t,l.data))}if("length"in l&&(a.length=l.length),s){let a=n.indexOf(s.value);-1!=a&&n.splice(a,1),n.length&&z(e,t.name,n[n.length-1],o,"get")}break;case"delete":this.length--,a.splice(l.index,1);break;case"add":a[this.length]=Ke(t,[l.data])[0],this.length++;break;case"adds":a.splice(l.index,0,...Ke(t,l.data)),this.length+=l.data.length}}function d(a){-1==n.indexOf(a)&&(n.length>5&&n.splice(0,1),n.push(a),1==n.length&&z(e,t.name,a,o,"get"))}h.update=o;let r=new Proxy(a,{get(e,t,a){if("slice"===t)return function(...a){a[0];let s=a[1];if(s>0){let a=(t/l|0)*l;for(;a<=s;a+=l)e[a]||d(a)}return Array.prototype.slice.apply(e,a)};if(e[t]||isNaN(t))return e[t];{let e=(t/l|0)*l;return void d(e)}}});return r}const Qe=(0,l.aZ)({name:"utable",setup(e){const{data:t,pdata:a}=(0,We.BK)(e);let s=(0,l.Fl)((()=>{let e=t.value;return e.id?Fe(a.value.name,e):Ke(e,e.rows)})),i=()=>{let e=t.value,a=null===e.value||0==s.value.length?[]:Array.isArray(e.value)?s.value.filter((t=>e.value.includes(t.iiid))):s.value.filter((t=>e.value==t.iiid));return a},n=i(),o=(0,We.iH)(n),d=(0,We.iH)(n),r=(0,We.iH)(!Array.isArray(t.value.value)),c=(e,l)=>{_([a.value.name,t.value.name,e,l])},h=(0,l.Fl)((()=>t.value.value));return(0,l.YP)(s,((e,t)=>{d.value=i(),o.value=d.value})),(0,l.YP)(t,((e,a)=>{m&&console.log("data update",a.name),d.value=i(),o.value=d.value,r.value=!Array.isArray(t.value.value)})),{rows:s,selected:d,singleMode:r,sendMessage:c,datavalue:h,updated:o}},data(){return{Dark:Ne.Z,search:"",options:[],prevSelectedId:void 0,cedit:null}},methods:{switchFilter(){let e=this.data;e.filter=!e.filter,this.sendMessage("filter",e.filter)},currentStyle(){let e=this.data.tablerect;if(e){let t=e.width,a=e.height;return`width: ${t}px; height: ${a}px`}return null},select(e,t){if(this.data.editing){let a=this.headers[t];"ID"!=a&&"ⓇID"!=a&&(this.cedit=t,m&&console.log("selected",e.iiid,this.cedit))}},change_switcher(e,t,a){if(console.log(e,t,a,e[t]),this.data.editing){let l=this.data.headers.indexOf(t);this.cedit=a,e[t]=!e[t],this.sendMessage("modify",{value:e[t],id:e.iiid,name:t,delta:this.rows.indexOf(e),cell:l})}},change(e){let t=this.headers[this.cedit],a=this.data.headers.indexOf(t);if(m&&console.log("changed",t,e),this.data.editing&&this.selected.length){const l=this.selected[0];l[t]=e;let s=this.rows.indexOf(l);s<0&&console.log("Losted row in rows!"),this.sendMessage("modify",{value:e,delta:s,name:t,id:l.iiid,cell:a})}},keyInput(e){if("Control"==e.key)return;let t=!1;switch(e.key){case"Enter":"update"in this.data&&this.sendMessage("update",[this.rows[this.redit][this.headers[this.cedit]],[this.redit,this.cedit]]),t=!0;case"ArrowRight":if(e.ctrlKey||t)for(let e=this.cedit+1;e<this.headers.length;){let t=this.headers[e],a=this.selected[0][t],l=typeof a;if("boolean"!=l&&"ⓇID"!=t&&"ID"!=t){this.cedit=e;break}}break;case"Escape":this.switchEdit();break;case"ArrowLeft":if(e.ctrlKey)for(let e=this.cedit-1;e>=0;e--){let t=this.headers[e],a=typeof this.selected[0][t];if("boolean"!=a&&"ⓇID"!=t&&"ID"!=t){this.cedit=e;break}}break;case"ArrowUp":if(e.ctrlKey&&this.redit>0){let e=this.redit-1,t=this.data,a=typeof t.rows[e][this.cedit];"string"!=a&&"number"!=a||(t.value=e),this.selected=[this.rows[e]]}break;case"ArrowDown":if(e.ctrlKey&&this.redit+1<this.rows.length){let e=this.redit+1,t=this.data,a=typeof t.rows[e][this.cedit];"string"!=a&&"number"!=a||(t.value=e),this.selected=[this.rows[e]]}break}},complete(e,t,a){D(this,[e,[this.redit,this.cedit]],(e=>t((()=>{this.options=e}))))},append(){let e=this.rows,t=e.length,a=this;"append"in this.data&&D(this,this.search,(function(l){if(!Array.isArray(l))return h.error(l);m&&console.log("added row",l),a.search="",l=Ke(a.data,[l])[0],e.push(l),setTimeout((()=>{let e=a.rows;a.selected=[e[t]],a.showSelected(),a.data.editing||a.switchEdit(),a.select(e[t],0)}),100)}),"append")},showSelected(){if(this.selected.length){let e=this.$refs.table,t=this.rows,a=this.selected[0];if(void 0!=this.prevSelectedId){let e=this.selected.findIndex((e=>(null===e||void 0===e?void 0:e.iiid)==this.prevSelectedId));-1!=e&&(++e>=this.selected.length&&(e=0),a=this.selected[e])}let s=a.iiid;this.prevSelectedId=s;let i=Object.keys(t).find((e=>{var a;return(null===(a=t[e])||void 0===a?void 0:a.iiid)===s}));e.scrollTo(i),(0,l.Y3)((()=>{requestAnimationFrame((()=>{requestAnimationFrame((()=>{requestAnimationFrame((()=>{requestAnimationFrame((()=>{requestAnimationFrame((()=>{requestAnimationFrame((()=>{e.scrollTo(i)}))}))}))}))}))}))}))}},deselectAll(){this.selected=[],this.sendMessage("changed",this.value)},chart(){let e=this.data;e.type="chart",e.tablerect=this.$refs.table.$el.getBoundingClientRect(),k[this.fullname].styleSize=this.currentStyle()},switchMode(){this.singleMode=!this.singleMode,this.singleMode&&this.selected.length>1&&this.selected.splice(1)},switchEdit(){let e=this.data;e.editing=!e.editing,this.sendMessage("editing",this.data.editing)},delSelected(){if(!this.selected.length)return void h.error("Rows are not selected!");this.sendMessage("delete",this.value);let e=this.rows;if(this.singleMode){let t=this.selected[0].iiid;this.data.id&&(t=e.findIndex((e=>e.iiid==t))),this.selected=[],e.splice(t,1)}else{this.selected.length>1&&this.selected.sort(((e,t)=>t.iiid-e.iiid));let t=this.selected.map((e=>e.iiid));this.selected=[];for(let a of t)e.splice(a,1)}}},watch:{selected(e){const t=this.data;Ve(this.updated,this.selected)||(this.sendMessage("changed",this.value),this.updated=this.selected),t.show&&(this.showSelected(),t.show=!1)},search(e){this.data.id&&this.sendMessage("search",e)}},computed:{fullname(){return`${this.data.name}@${this.pdata.name}`},redit(){return this.data.editing&&this.selected.length?this.selected[0].iiid:null},editable(){return 0!=this.data["edit"]},value(){let e=this.selected.map((e=>this.rows.findIndex((t=>t.iiid===e.iiid))));return-1!=e.indexOf(-1)&&console.error("selected row in a table did not found!"),this.singleMode?1==e.length?e[0]:null:e},name(){return"_"==this.data.name?"":this.data.name},headers(){let e=this.data;return e.headers.filter((e=>!e.startsWith(He)))},columns(){let e=!this.data.id;return this.headers.map((t=>({name:t,label:t,align:"left",sortable:e,field:t})))}},props:{data:Object,pdata:Object,styleSize:String}});var Ue=a(9267),Re=a(2165),Te=a(8870),Ie=a(4842),Pe=a(8186),Le=a(2414),Be=a(3884),Ye=a(5735),Ge=a(7208);const Je=(0,Q.Z)(Qe,[["render",Me]]),Xe=Je;function et(e,t,a,i,n,o){return(0,l.wg)(),(0,l.iD)("div",{ref:"graph",style:(0,s.j5)(a.styleSize),id:"graph"},null,4)}L()(Qe,"components",{QTable:Ue.Z,QBtn:Re.Z,QTooltip:Te.Z,QInput:Ie.Z,QIcon:T.Z,QTr:Pe.Z,QTh:Le.Z,QTd:Be.Z,QCheckbox:Ye.Z,QSelect:Ge.Z});var tt=a(130),at=a.n(tt),lt=a(309);var st=a(5154),it=a.n(st),nt=a(4150),ot=a.n(nt);let dt="#091159",rt={hideEdgesOnMove:!1,hideLabelsOnMove:!1,renderLabels:!0,renderEdgeLabels:!0,enableEdgeClickEvents:!0,enableEdgeWheelEvents:!1,enableEdgeHoverEvents:!0,enableEdgeHovering:!0,allowInvalidContainer:!0,enableEdgeClickEvents:!0,enableEdgeHoverEvents:!0,defaultNodeColor:"#FCA072",defaultNodeType:"circle",defaultEdgeColor:"#888",defaultEdgeType:"arrow",labelFont:"Arial",labelSize:14,labelWeight:"normal",labelColor:{color:"#00838F",attribute:"#000"},edgeLabelFont:"Arial",edgeLabelSize:14,edgeLabelWeight:"normal",edgeLabelColor:{attribute:"color"},stagePadding:30,labelDensity:1,labelGridCellSize:100,labelRenderedSizeThreshold:6,animationsTime:1e3,borderSize:2,outerBorderSize:3,defaultNodeOuterBorderColor:"rgb(236, 81, 72)",edgeHoverHighlightNodes:"circle",sideMargin:1,edgeHoverColor:"edge",defaultEdgeHoverColor:"#062646",edgeHoverSizeRatio:1,edgeHoverExtremities:!0,scalingMode:"outside"};const ct={name:"sgraph",props:{data:{type:Object,required:!0},pdata:{type:Object,required:!0},styleSize:String},data(){return{Dark:Ne.Z,s:null,state:{searchQuery:""},selectedNodes:[],selectedEdges:[],graph:null,fa2start:null,fa2stop:null,fa2run:null}},methods:{sendMessage(e,t){_([this.pdata["name"],this.data["name"],e,t])},refresh(){let e=this.graph();const t=ot().inferSettings(e);let a=new(it())(e,{settings:t});m&&console.log("refresh graph",this.data.name,this.pdata.name),a.isRunning()||(a.start(),setTimeout((function(){a.stop()}),1e3))},setSelectedEdges(e){this.s.selectEdges(e)},setSearchQuery(e){if(e){const t=e.toLowerCase(),a=this.graph().nodes().map((e=>({id:e,label:graph.getNodeAttribute(e,"label")}))).filter((({label:e})=>e.toLowerCase().includes(t)));if(1===a.length&&a[0].label===e){this.state.selectedNode=a[0].id,this.state.suggestions=void 0;const e=this.s.getNodeDisplayData(this.state.selectedNode);this.s.getCamera().animate(e,{duration:500})}else this.state.selectedNode=void 0,this.state.suggestions=new Set(a.map((({id:e})=>e)))}else this.state.selectedNode=void 0,this.state.suggestions=void 0;this.s.refresh()},load(e){let t=e.value;this.selectedNodes=t.nodes?t.nodes.map((e=>String(e))):[],this.selectedEdges=t.edges?t.edges.map((e=>String(e))):[];let a=e.sizing,l=e.nodes,s=this.graph(),i=[],n=[],o=new Map;for(let h=0;h<l.length;h++){if(!l[h])continue;let e=Object.assign({},l[h]);void 0==e.id&&(e.id=h),void 0!=e.name&&(e.label=e.name);let t={key:String(e.id),attributes:e};e.size=e.size?e.size:10,i.push(t),o.set(e.id,h);let a=s._nodes.get(t.key);a?(e.x=a.attributes.x,e.y=a.attributes.y):(e.x=Math.random(),e.y=Math.random()),this.selectedNodes.includes(t.key)&&(e.highlighted=!0)}let d=[],r=new Map,c=Array(i.length).fill(0);for(let h=0;h<e.edges.length;h++){let t=Object.assign({},e.edges[h]),l=o.get(t.source),s=o.get(t.target);if(void 0==l||void 0==s)continue;if(void 0==t.id&&(t.id=h),t.name&&(t.label=t.name),t.key=String(t.id),n.push(t),a){"in"!=a&&(s=o.get(t.source),l=o.get(t.target)),c[s]++,r.has(s)?r.get(s).push(l):r.set(s,[l]);let e=d.indexOf(l),i=d.indexOf(s);if(-1==e&&(e=d.length,d.push(l)),-1==i&&(i=d.length,d.push(s)),i<e){let t=d[e];d[e]=d[i],d[i]=t}}let i=t.attributes;i||(i={},t.attributes=i),i.id=t.id,i.size=t.size?t.size:5,this.selectedEdges.includes(t.key)?(i.ocolor=i.color?i.color:rt.defaultEdgeColor,i.color=dt):t.color&&(i.color=t.color),t.label&&(i.label=t.label)}if(a)for(let h=0;h<d.length;h++){let e=d[h];if(r.has(e))for(let t of r.get(e))c[e]+=c[t];i[e].attributes.size=10+c[e]}s.clear(),s.import({nodes:i,edges:n}),this.refresh()}},computed:{value(){let e=this.graph(),t=this.selectedNodes.map((t=>e._nodes.get(t).attributes.id)),a=this.selectedEdges.map((t=>e._edges.get(t).attributes.id));return{nodes:t,edges:a}}},watch:{data:{handler(e,t){m&&console.log("data update",this.data.name,this.pdata.name),this.load(e)},deep:!0},"Dark.isActive":function(e){this.s.settings.labelColor.color=e?"#00838F":"#000",this.s.refresh()}},updated(){this.s.refresh(),m&&console.log("updated",this.data.name,this.pdata.name)},mounted(){let e=new lt.MultiDirectedGraph;this.graph=()=>e;let t=this.$refs.graph;this.s=new(at())(e,t,rt);let a=this.s;var l=this;function s(t){t?l.state.hoveredNeighbors=new Set(e.neighbors(t)):(l.state.hoveredNode=void 0,l.state.hoveredNeighbors=void 0),a.refresh()}function i(t,a=dt){let l=e.getEdgeAttributes(t);l.color!=a&&(l.ocolor||(l.ocolor=l.color?l.color:rt.defaultEdgeColor),e.setEdgeAttribute(t,"color",a))}function n(t,a=dt){let l=e.getEdgeAttributes(t);if(l.color==a){let a=e.getEdgeAttribute(t,"ocolor");e.setEdgeAttribute(t,"color",a)}}this.s.settings.labelColor.color=Ne.Z.isActive?"#00838F":"#000",a.on("clickNode",(function(t){let s=t.node;if(!h.shiftKey){for(let e of l.selectedEdges)n(e);l.selectedEdges=[]}if(l.selectedNodes.includes(s))if(e.setNodeAttribute(s,"highlighted",!1),h.shiftKey){let e=l.selectedNodes.indexOf(s);-1!=e&&l.selectedNodes.array.splice(e,1)}else l.selectedNodes=[];else{if(!h.shiftKey&&l.selectedNodes.length>0){for(let t of l.selectedNodes)e.setNodeAttribute(t,"highlighted",!1);l.selectedNodes=[]}e.setNodeAttribute(s,"highlighted",!0),l.selectedNodes.push(s)}a.refresh(),l.sendMessage("changed",l.value)})),a.on("clickEdge",(function({edge:t}){if(!h.shiftKey){for(let t of l.selectedNodes)e.setNodeAttribute(t,"highlighted",!1);l.selectedNodes=[]}if(l.selectedEdges.includes(t))if(n(t),h.shiftKey){let e=l.selectedEdges.indexOf(t);-1!=e&&l.selectedEdges.array.splice(e,1)}else l.selectedEdges=[];else{if(!h.shiftKey&&l.selectedEdges.length>0){for(let e of l.selectedEdges)n(e);l.selectedEdges=[]}i(t),l.selectedEdges.push(t)}a.refresh(),l.sendMessage("changed",l.value)})),a.on("enterNode",(function({node:t}){for(let a of e.edgeEntries())a.target==t?i(a.edge,"#808000"):a.source==t&&i(a.edge,"#2F4F4F");s(t)})),a.on("leaveNode",(function({node:t}){for(let a of e.edgeEntries())a.target==t?l.selectedEdges.includes(a.edge)?e.setEdgeAttribute(a.edge,"color",dt):n(a.edge,"#808000"):a.source==t&&(l.selectedEdges.includes(a.edge)?e.setEdgeAttribute(a.edge,"color",dt):n(a.edge,"#2F4F4F"));s(void 0)})),a.on("enterEdge",(function({edge:e}){l.selectedEdges.includes(e)||i(e)})),a.on("leaveEdge",(function({edge:e}){l.selectedEdges.includes(e)||n(e)}));const o=new ResizeObserver((e=>a.refresh()));o.observe(t);let d=null,r=!1;a.on("downNode",(t=>{r=!0,d=t.node,e.setNodeAttribute(d,"highlighted",!0)})),a.getMouseCaptor().on("mousemovebody",(t=>{if(!r||!d)return;const l=a.viewportToGraph(t);e.setNodeAttribute(d,"x",l.x),e.setNodeAttribute(d,"y",l.y),t.preventSigmaDefault(),t.original.preventDefault(),t.original.stopPropagation()})),a.getMouseCaptor().on("mouseup",(()=>{d&&e.removeNodeAttribute(d,"highlighted"),r=!1,d=null})),a.getMouseCaptor().on("mousedown",(()=>{a.getCustomBBox()||a.setCustomBBox(a.getBBox())})),this.load(this.data)}},ht=(0,Q.Z)(ct,[["render",et]]),ut=ht;function pt(e,t,a,i,n,o){const d=(0,l.up)("v-chart");return(0,l.wg)(),(0,l.iD)("div",{style:(0,s.j5)(a.styleSize?a.styleSize:o.currentStyle())},[(0,l.Wm)(d,{ref:"chart","manual-update":!0,onClick:o.clicked,autoresize:!0},null,8,["onClick"])],4)}var gt=a(9642),mt=a(6938),ft=a(1006),yt=a(6080),wt=a(3526),bt=a(763),vt=a(546),kt=a(6902),xt=a(2826),Ct=a(5256),_t=a(3825),At=a(8825);(0,bt.D)([mt.N,ft.N,wt.N,yt.N]),(0,bt.D)([vt.N,kt.N,xt.N,Ct.N,_t.N]);let qt=["","#80FFA5","#00DDFF","#37A2FF","#FF0087","#FFBF00","rgba(128, 255, 165)","rgba(77, 119, 255)"];const St={name:"linechart",components:{VChart:gt.ZP},props:{data:Object,pdata:Object,styleSize:String},data(){const e=(0,At.Z)();return{$q:e,model:!1,animation:null,markPoint:null,options:{responsive:!0,maintainAspectRatio:!1,legend:{data:[],bottom:10,textStyle:{color:"#4DD0E1"}},tooltip:{trigger:"axis",position:function(e){return[e[0],"10%"]}},title:{left:"center",text:""},toolbox:{feature:{}},xAxis:{type:"category",boundaryGap:!1,data:null},yAxis:{type:"value",boundaryGap:[0,"100%"]},dataZoom:[{type:"inside",start:0,end:10},{start:0,end:10}],series:[]}}},computed:{fullname(){return`${this.data.name}@${this.pdata.name}`}},methods:{setOptions(){this.$refs.chart.setOption(this.options)},currentStyle(){let e=this.data.tablerect,t=e?e.width:300,a=e?e.height:200;return`width: ${t}px; height: ${a}px`},processCoord(e,t,a){let l=null;for(let s of t)if(e[0]==s.coord[0]){l=s;break}a?l?t.splice(t.indexOf(l),1):t.push({coord:e}):(t.splice(0,t.length),l||t.push({coord:e}))},clicked(e){let t=[e.dataIndex,this.options.series[e.seriesIndex].data[e.dataIndex]];this.processCoord(t,this.markPoint.data,h.shiftKey);let a=this.markPoint.data.map((e=>e.coord[0])),l=this.data;if(l.value=Array.isArray(l.value)||a.length>1?a:a.length?a[0]:null,this.animation){let e=this.options.dataZoom;e[0].start=this.animation.start,e[1].start=this.animation.start,e[0].end=this.animation.end,e[1].end=this.animation.end}this.setOptions(),_([this.pdata.name,this.data.name,"changed",this.data.value])},calcSeries(){this.options.toolbox.feature.mySwitcher={show:!0,title:"Switch view to the table",icon:"image:M0 2a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V2zm15 2h-4v3h4V4zm0 4h-4v3h4V8zm0 4h-4v3h3a1 1 0 0 0 1-1v-2zm-5 3v-3H6v3h4zm-5 0v-3H1v2a1 1 0 0 0 1 1h3zm-4-4h4V8H1v3zm0-4h4V4H1v3zm5-3v3h4V4H6zm4 4H6v3h4V8z",onclick:()=>{let e=this.data;e.type="table",e.tablerect=this.$refs.chart.$el.getBoundingClientRect(),k[this.fullname].styleSize=this.currentStyle()}};let e=this.data.view,t=this.data.headers;"_"!=this.data.name[0]&&(this.options.title.text=this.data.name);let a=e.split("-"),l=a[1].split(",");l.unshift(a[0]);let s=[];for(let n=0;n<l.length;n++)l[n]="i"==l[n]?-1:parseInt(l[n]),s.push([]),n&&(this.options.series.push({name:t[l[n]],type:"line",symbol:"circle",symbolSize:10,sampling:"lttb",itemStyle:{color:qt[n]},data:s[n]}),this.options.legend.data.push(t[l[n]]));this.options.xAxis.data=s[0];let i=this.data.rows;for(let n=0;n<i.length;n++)for(let e=0;e<l.length;e++)s[e].push(-1==l[e]?n:i[n][l[e]]);if(this.options.series[1]){let e=[],t=this.options.series[1].data,a=Array.isArray(this.data.value)?this.data.value:null===this.data.value?[]:[this.data.value];for(let l=0;l<a.length;l++)this.processCoord([a[l],t[a[l]]],e,!0);this.markPoint={symbol:"rect",symbolSize:10,animationDuration:300,silent:!0,label:{color:"#fff"},itemStyle:{color:"blue"},data:e},this.options.series[1].markPoint=this.markPoint}this.setOptions()}},mounted(){this.calcSeries();let e=this;this.$refs.chart.chart.on("datazoom",(function(t){(t.start||t.end)&&(e.animation=t)}))}},Dt=(0,Q.Z)(St,[["render",pt]]),zt=Dt;let jt={right:"4px",borderRadius:"7px",backgroundColor:"#027be3",width:"4px",opacity:.75},$t={right:"2px",borderRadius:"9px",backgroundColor:"#027be3",width:"8px",opacity:.2};function Et(e){let t=new FormData;t.append("image",e);let a=new XMLHttpRequest;a.open("POST",b,!0),a.onload=function(){200===this.status?console.log(this.response):console.error(a)},a.send(t)}const Zt=(0,l.aZ)({name:"element",components:{utable:Xe,sgraph:ut,linechart:zt},methods:{log(e){console.log(e)},showSelected(){if("tree"==this.type||"list"==this.type){let e=this.value;e&&requestAnimationFrame((()=>{requestAnimationFrame((()=>{let t=this.$refs.tree.$el,a=this.$refs.scroller.$el;for(let l of t.getElementsByTagName("div"))if(l.innerHTML==e){const{bottom:e,height:t,top:s}=l.getBoundingClientRect();if(s){const l=a.getBoundingClientRect();(s<=l.top?l.top-s<=t:e-l.bottom<=t)||this.$refs.scroller.setScrollPosition("vertical",s-l.top);break}}}))}))}},onAdded(e){0!==e.length&&(0!==this.fileArr.length?(this.$refs.uploaderRef.removeFile(this.fileArr[0]),this.fileArr.splice(0,1,e[0])):this.fileArr.push(e[0]))},sendMessage(e,t){_([this.pdata["name"],this.data["name"],e,t])},pressedEnter(){"update"in this.data&&this.sendMessage("update",this.value)},updateDom(e){let t=e.files.length;t&&this.sendMessage("changed",e.xhr.responseText)},sendValue(){this.sendMessage("changed",this.value)},switchValue(){this.value=!this.value},setValue(e){this.value=e},complete(e,t,a){D(this,e,(e=>t((()=>{this.options=e}))))},lens(){h.lens(this.data)},toggleCamera(){this.isCameraOpen?(this.isCameraOpen=!1,this.isPhotoTaken=!1,this.isShotPhoto=!1,this.stopCameraStream()):(this.isCameraOpen=!0,this.createCameraElement())},createCameraElement(){this.isLoading=!0;const e=window.constraints={audio:!1,video:!0};navigator.mediaDevices.getUserMedia(e).then((e=>{this.isLoading=!1,this.$refs.camera.srcObject=e})).catch((e=>{this.isLoading=!1,alert("May the browser didn't support or there are some errors.")}))},stopCameraStream(){let e=this.$refs.camera.srcObject.getTracks();e.forEach((e=>{e.stop()}))},takePhoto(){if(!this.isPhotoTaken){this.isShotPhoto=!0;const e=50;setTimeout((()=>{this.isShotPhoto=!1}),e)}this.isPhotoTaken=!this.isPhotoTaken;const e=this.$refs.canvas.getContext("2d");e.drawImage(this.$refs.camera,0,0,450,337.5)},downloadImage(){document.getElementById("downloadPhoto"),document.getElementById("photoTaken").toBlob(Et,"image/jpeg")},rect(){let e="clientHeight"in this.$el?this.$el:this.$el.nextElementSibling;return e.getBoundingClientRect()},geom(){let e=this.type,t=this.$el;t="tree"==e||"list"==e?t.querySelector(".scroll"):"clientHeight"in t?t:t.nextElementSibling,t||(t=this.$el.previousElementSibling,t="clientHeight"in t?t:t.nextElementSibling);const a="text"==e||"graph"==e||"chart"==e?t:t.querySelector("table"==e?".scroll":".q-tree"),l=t.getBoundingClientRect();return{el:t,inner:a,left:l.left,right:l.right,top:l.top,bottom:l.bottom,scrollHeight:a.scrollHeight,scrollWidth:a.scrollWidth}}},updated(){k[this.fullname]=this,this.showSelected(),m&&console.log("updated",this.fullname)},mounted(){let e=this.data;k[this.fullname]=this,e.id&&"table"==e.type&&!e.filter&&(this.update=h.update),e.focus&&this.$refs.inputRef.$el.focus(),this.showSelected(),m&&console.log("mounted",this.fullname)},data(){return{Dark:Ne.Z,value:this.data.value,styleSize:A?S(this):null,has_recalc:!0,host_path:b,options:[],expandedKeys:[],thumbStyle:jt,barStyle:$t,updated:"#027be3sds",isCameraOpen:!1,isPhotoTaken:!1,isShotPhoto:!1,isLoading:!1,link:"#",fileArr:[]}},computed:{elemSize(){let e="";return this.data.width&&(e=`width:${this.data.width}px`),this.data.height&&(""!=e&&(e+="; "),e+=`height:${this.data.height}px`),""==e?this.styleSize:e},parent_name(){return this.pdata?this.pdata.name:null},name(){return this.data.name},fullname(){return`${this.data.name}@${this.pdata.name}`},showname(){let e=this.data.name;return e&&"_"!=e[0]},name2show(){let e=this.data.name;return e&&"_"!=e[0]?e:""},nameLabel(){return this.data.label?this.data.label:"_"!=this.data.name[0]?this.data.name:""},text(){return this.data.text},expanding(){return y.includes(this.type)},expanding_width(){return!this.data.width&&this.expanding},expanding_height(){return!this.data.height&&this.expanding},selection(){return this.data.selection},icon(){return this.data.icon},type(){return this.data.type},treeNodes(){var e=[];if("list"==this.type)return this.data.options.map((e=>({label:e,children:[]})));var t={};for(const[s,i]of Object.entries(this.data.options)){var a=t[s];if(a||(a={label:s,children:[]},t[s]=a),i){var l=t[i];l||(l={label:i,children:[]},t[i]=l),l.children.push(a)}else e.push(a)}return e}},props:{data:{type:Object,required:!0},pdata:{type:Object,required:!0}},watch:{value(e,t){"tree"!=this.type&&"list"!=this.type||(this.data.options[e]==t&&this.expandedKeys.indexOf(t)<0&&this.expandedKeys.push(t),this.showSelected()),e!==this.updated&&(m&&console.log("value changed",e,t),this.sendValue(),this.updated=e)},selection(e){m&&console.log("selection changed",e,this.$refs.inputRef),Array.isArray(e)||(e=[0,0]);let t=this.$refs.inputRef.$el;t.focus();let a=t.getElementsByTagName("textarea");0==a.length&&(a=t.getElementsByTagName("input")),a[0].setSelectionRange(e[0],e[1])},data(e,t){m&&console.log("data update",this.fullname,t.name),this.styleSize||(this.styleSize=null),h.screen.reload&&"tree"==this.type&&this.$refs.tree&&this.$refs.tree.expandAll();let a=this.data;this.value=a.value,this.updated=this.value,k[this.fullname]=this}}});var Ot=a(4027),Mt=a(8886),Wt=a(9721),Nt=a(2064),Vt=a(8761),Ht=a(7704),Kt=a(5551),Ft=a(5869),Qt=a(1745),Ut=a(8506);const Rt=(0,Q.Z)(Zt,[["render",ze],["__scopeId","data-v-763052dd"]]),Tt=Rt;L()(Zt,"components",{QImg:Ot.Z,QIcon:T.Z,QSelect:Ge.Z,QCheckbox:Ye.Z,QToggle:Mt.Z,QBadge:Wt.Z,QSlider:Nt.Z,QBtn:Re.Z,QBtnToggle:Vt.Z,QInput:Ie.Z,QScrollArea:Ht.Z,QTree:Kt.Z,QSeparator:Ft.Z,QUploader:Qt.Z,QTooltip:Te.Z,QSpinnerIos:Ut.Z});const It=(0,l.aZ)({name:"block",components:{element:Tt},data(){return{Dark:Ne.Z,styleSize:null,thumbStyle:{right:"4px",borderRadius:"7px",backgroundColor:"#027be3",width:"4px",opacity:.75},barStyle:{right:"2px",borderRadius:"9px",backgroundColor:"#027be3",width:"8px",opacity:.2}}},methods:{log(){console.log(Object.keys(v).length,this.name,this.$el.getBoundingClientRect())},geom(){let e="clientHeight"in this.$el?this.$el:this.$el.nextElementSibling,t=e.querySelector(".q-scrollarea");t||(t=e);const a=t.getBoundingClientRect();return{el:e,inner:t,left:a.left,right:a.right,top:a.top,bottom:a.bottom,scrollHeight:window.innerHeight,scrollWidth:window.innerWidth}},free_right_delta4(e,t){for(let a of this.data.value)if(Array.isArray(a)){for(let l of a)if(l==e.data){let l=a[a.length-1];return l==e.data?t:f.includes(l.type)?0:k[`${l.name}@${this.name}`].$el.getBoundingClientRect().right}}else if(a===e)return t;return 0}},mounted(){v[this.data.name]=this,(this.expanding||this.data.width)&&(k[this.fullname]=this)},computed:{name(){return this.data.name},fullname(){return`${this.data.scroll?"_scroll":"_space"}@${this.name}`},icon(){return this.data.icon},type(){return this.data.type},expanding(){return this.data.scroll},expanding_width(){return this.expanding},name_elements(){if(this.expanding)return[this.fullname];let e=[];for(let t of this.data.value)if(Array.isArray(t))for(let a of t)e.push(`${a.name}@${this.name}`);else e.push(`${t.name}@${this.name}`);return e},hlevelements(){if(this.expanding)return[[k[this.fullname]]];let e=[];for(let t of this.data.value)if(Array.isArray(t)){let a=t.map((e=>k[`${e.name}@${this.name}`])).filter((e=>e.expanding));a.length&&e.push(a)}else{let a=k[`${t.name}@${this.name}`];a.expanding&&e.push([a])}return e},only_fixed_elems(){if(this.data.scroll)return!1;for(let e of this.data.value)if(Array.isArray(e)){for(let t of e)if(y.includes(t.type))return!1}else if(y.includes(e.type))return!1;return!0},expanding_height(){return!this.data.height&&(this.expanding||this.only_fixed_elems)},tops(){let e=this.data.value;return e.length?Array.isArray(e[0])?e[0]:[e[0]]:[]}},props:{data:{type:Object,required:!0}},watch:{data(e){m&&console.log("data update",this.name),v[this.name]=this,this.expanding&&(k[this.fullname]=this)}}});var Pt=a(151);const Lt=(0,Q.Z)(It,[["render",ne]]),Bt=Lt;function Yt(){let e=A&&k.size==x.size;if(e)for(let[t,a]of Object.entries(k))if(!x[t]){e=!1;break}e||(V(document.documentElement.scrollWidth>window.innerWidth),(0,l.Y3)((()=>{requestAnimationFrame((()=>{requestAnimationFrame((()=>{h.visible(!0)}))}))})))}L()(It,"components",{QCard:Pt.Z,QIcon:T.Z,QScrollArea:Ht.Z});const Gt=(0,l.aZ)({name:"zone",components:{block:Bt},props:{data:Object},updated(e){(0,l.Y3)((()=>{requestAnimationFrame((()=>{requestAnimationFrame(Yt)}))}))}}),Jt=(0,Q.Z)(Gt,[["render",ee]]),Xt=Jt,ea={class:"row q-gutter-sm row-md"};function ta(e,t,a,i,n,o){const d=(0,l.up)("block"),r=(0,l.up)("q-item-label"),c=(0,l.up)("q-space"),h=(0,l.up)("q-btn"),u=(0,l.up)("q-card"),p=(0,l.up)("q-dialog");return(0,l.wg)(),(0,l.j4)(p,{ref:"dialog",onHide:o.onDialogHide,onKeyup:(0,oe.D2)(o.pressedEnter,["enter"])},{default:(0,l.w5)((()=>[(0,l.Wm)(u,{class:"q-dialog-plugin q-pa-md items-start q-gutter-md",bordered:"",style:(0,s.j5)(a.data.internal?"width: 800px; max-width: 80vw;":"")},{default:(0,l.w5)((()=>[a.data?((0,l.wg)(),(0,l.j4)(d,{key:0,data:a.data},null,8,["data"])):(0,l.kq)("",!0),(0,l.Wm)(r,{class:"text-h6"},{default:(0,l.w5)((()=>[(0,l.Uk)((0,s.zw)(a.data.text?a.data.text:""),1)])),_:1}),(0,l._)("div",ea,[(0,l.Wm)(c),((0,l.wg)(!0),(0,l.iD)(l.HY,null,(0,l.Ko)(a.commands,(e=>((0,l.wg)(),(0,l.j4)(h,{class:"col-md-3",label:e,"no-caps":"",color:a.commands[0]==e?"primary":"secondary",onClick:t=>o.sendMessage(e)},null,8,["label","color","onClick"])))),256))])])),_:1},8,["style"])])),_:1},8,["onHide","onKeyup"])}const aa={props:{data:Object,commands:Array},components:{block:Bt},emits:["ok","hide"],data(){return{closed:!1}},methods:{show(){this.$refs.dialog.show(),h.dialog=this},message4(e){return[this.data["name"],null,"changed",e]},sendMessage(e){this.data.internal||_(this.message4(e)),this.closed=!0,this.hide()},hide(){this.$refs.dialog.hide(),h.dialog=null},onDialogHide(){this.$emit("hide"),this.closed||this.data.internal||_(this.message4(null))},pressedEnter(){this.sendMessage(this.commands[0])},onOKClick(){this.$emit("ok"),this.hide()},onCancelClick(){this.hide()}}};var la=a(5926),sa=a(2025);const ia=(0,Q.Z)(aa,[["render",ta]]),na=ia;L()(aa,"components",{QDialog:la.Z,QCard:Pt.Z,QItemLabel:I.Z,QSpace:sa.Z,QBtn:Re.Z});var oa=a(589);let da="theme";try{Ne.Z.set(oa.Z.getItem(da))}catch(ka){}let ra=null,ca=["complete","append","get"];const ha=(0,l.aZ)({name:"MainLayout",data(){return{leftDrawerOpen:!1,Dark:Ne.Z,menu:[],tab:"",tooldata:{name:"toolbar"},localServer:!0,statusConnect:!1,screen:{blocks:[],toolbar:[]},visibility:!0,designCycle:0,shiftKey:!1}},components:{menubar:Y,zone:Xt,element:Tt},created(){C(this)},unmounted(){window.removeEventListener("resize",this.onResize)},computed:{left_toolbar(){return this.screen.toolbar.filter((e=>!e.right))},right_toolbar(){return this.screen.toolbar.filter((e=>e.right))}},methods:{switchTheme(){Ne.Z.set(!Ne.Z.isActive),oa.Z.set(da,Ne.Z.isActive)},toggleLeftDrawer(){this.leftDrawerOpen=!this.leftDrawerOpen},tabclick(e){_(["root",null,"changed",e])},visible(e){this.visibility!=e&&(this.$refs.page.$el.style.visibility=e?"":"hidden",this.visibility=e)},handleKeyDown(e){"Shift"==e.key&&(this.shiftKey=!0)},handleKeyUp(e){"Shift"==e.key&&(this.shiftKey=!1)},onResize(e){m&&console.log(`window has been resized w = ${window.innerWidth}, h=${window.innerHeight}`),this.designCycle=0,N()},lens(e){let t={title:"Photo lens",message:e.text,cancel:!0,persistent:!0,component:na},{height:a,...l}=e;l.width=750;let s={name:`Picture lens of ${e.name}`,value:[[],l],internal:!0};t.componentProps={data:s,commands:["Close"]},this.$q.dialog(t)},notify(e,t){let a=t,l={message:e,type:t,position:"top",icon:a};"progress"==t?null==ra?(l={group:!1,timeout:0,spinner:!0,type:"info",message:e||"Progress..",position:"top",color:"secondary"},ra=this.$q.notify(l)):null==e?(ra(),ra=null):(l={caption:e},ra(l)):("error"==t&&l.type,this.$q.notify(l))},error(e){this.notify(e,"error")},info(e){this.notify(e,"info")},processMessage(e){if("screen"==e.type)j(),this.screen.name!=e.name?(q(!1),m||this.visible(!1)):e.reload&&q(!1),this.screen=e,this.menu=e.menu.map((e=>({name:e[0],icon:e[1],order:e[2]}))),this.tab=this.screen.name;else if("dialog"==e.type){let t={title:e.name,message:e.text,cancel:!0,persistent:!0};t.component=na,t.componentProps={data:e,commands:e.commands},this.$q.dialog(t)}else if(e.block&&e.element)Z(e);else if(ca.includes(e.type))O(e);else if("action"==e.type&&"close"==e.value)this.dialog&&(this.dialog.data.internal=!0),this.dialog.hide();else{let t=e.updates&&e.updates.length;t&&E(e.updates);let a=!1;["error","progress","warning","info"].includes(e.type)&&(this.notify(e.value,e.type),a=!0),a||t||(this.error("Invalid data came from the server! Look the console."),console.log(`Invalid data came from the server! ${e}`))}this.closeProgress(e)},closeProgress(e){!ra||e&&"progress"==e.type||this.notify(null,"progress")}},mounted(){window.addEventListener("resize",this.onResize);const e=new ResizeObserver((e=>{let t=document.documentElement.scrollWidth>window.innerWidth||document.documentElement.scrollHeight>window.innerHeight;t&&W(!1)}));let t=this.$refs.page.$el;e.observe(t),window.addEventListener("keydown",this.handleKeyDown),window.addEventListener("keyup",this.handleKeyUp)},beforeUnmount(){window.removeEventListener("keydown",this.handleKeyDown),window.removeEventListener("keyup",this.handleKeyUp)}});var ua=a(9214),pa=a(3812),ga=a(9570),ma=a(7547),fa=a(3269),ya=a(2652),wa=a(4379);const ba=(0,Q.Z)(ha,[["render",o]]),va=ba;L()(ha,"components",{QLayout:ua.Z,QHeader:pa.Z,QToolbar:ga.Z,QBtn:Re.Z,QItemLabel:I.Z,QTabs:ma.Z,QTab:fa.Z,QSpace:sa.Z,QTooltip:Te.Z,QPageContainer:ya.Z,QPage:wa.Z})}}]);
|
@@ -1 +1 @@
|
|
1
|
-
(()=>{"use strict";var e={653:(e,t,r)=>{r(5363),r(71);var n=r(8880),o=r(9592),a=r(3673);const i={id:"q-app"};function l(e,t,r,n,o,l){const s=(0,a.up)("router-view");return(0,a.wg)(),(0,a.iD)("div",i,[(0,a.Wm)(s)])}const s=(0,a.aZ)({name:"App"});var u=r(4260);const c=(0,u.Z)(s,[["render",l]]),d=c;var p=r(3340),f=r(8339);const h=[{path:"/",component:()=>Promise.all([r.e(736),r.e(
|
1
|
+
(()=>{"use strict";var e={653:(e,t,r)=>{r(5363),r(71);var n=r(8880),o=r(9592),a=r(3673);const i={id:"q-app"};function l(e,t,r,n,o,l){const s=(0,a.up)("router-view");return(0,a.wg)(),(0,a.iD)("div",i,[(0,a.Wm)(s)])}const s=(0,a.aZ)({name:"App"});var u=r(4260);const c=(0,u.Z)(s,[["render",l]]),d=c;var p=r(3340),f=r(8339);const h=[{path:"/",component:()=>Promise.all([r.e(736),r.e(508)]).then(r.bind(r,8508)),children:[{path:"",component:()=>Promise.all([r.e(736),r.e(430)]).then(r.bind(r,6430))}]},{path:"/:catchAll(.*)*",component:()=>Promise.all([r.e(736),r.e(193)]).then(r.bind(r,2193))}],v=h,m=(0,p.BC)((function(){const e=f.PO,t=(0,f.p7)({scrollBehavior:()=>({left:0,top:0}),routes:v,history:e("/")});return t}));async function b(e,t){const r="function"===typeof m?await m({}):m,n=e(d);return n.use(o.Z,t),{app:n,router:r}}var g=r(6417),y=r(5597),w=r(589),O=r(7153);const k={config:{notify:{}},plugins:{Notify:g.Z,Dialog:y.Z,LocalStorage:w.Z,SessionStorage:O.Z}},C="/";async function P({app:e,router:t},r){let n=!1;const o=e=>{try{return t.resolve(e).href}catch(r){}return Object(e)===e?null:e},a=e=>{if(n=!0,"string"===typeof e&&/^https?:\/\//.test(e))return void(window.location.href=e);const t=o(e);null!==t&&(window.location.href=t)},i=window.location.href.replace(window.location.origin,"");for(let s=0;!1===n&&s<r.length;s++)try{await r[s]({app:e,router:t,ssrContext:null,redirect:a,urlPath:i,publicPath:C})}catch(l){return l&&l.url?void a(l.url):void console.error("[Quasar] boot error:",l)}!0!==n&&(e.use(t),e.mount("#q-app"))}b(n.ri,k).then((e=>Promise.all([Promise.resolve().then(r.bind(r,2390))]).then((t=>{const r=t.map((e=>e.default)).filter((e=>"function"===typeof e));P(e,r)}))))},2390:(e,t,r)=>{r.r(t),r.d(t,{default:()=>o});var n=r(3340);const o=(0,n.xr)((async({app:e})=>{}))}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var a=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(a.exports,a,a.exports,r),a.loaded=!0,a.exports}r.m=e,(()=>{var e=[];r.O=(t,n,o,a)=>{if(!n){var i=1/0;for(c=0;c<e.length;c++){for(var[n,o,a]=e[c],l=!0,s=0;s<n.length;s++)(!1&a||i>=a)&&Object.keys(r.O).every((e=>r.O[e](n[s])))?n.splice(s--,1):(l=!1,a<i&&(i=a));if(l){e.splice(c--,1);var u=o();void 0!==u&&(t=u)}}return t}a=a||0;for(var c=e.length;c>0&&e[c-1][2]>a;c--)e[c]=e[c-1];e[c]=[n,o,a]}})(),(()=>{r.n=e=>{var t=e&&e.__esModule?()=>e["default"]:()=>e;return r.d(t,{a:t}),t}})(),(()=>{r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}})(),(()=>{r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce(((t,n)=>(r.f[n](e,t),t)),[]))})(),(()=>{r.u=e=>"js/"+e+"."+{193:"283445be",430:"591e9a73",508:"4af55eb8"}[e]+".js"})(),(()=>{r.miniCssF=e=>"css/"+({143:"app",736:"vendor"}[e]||e)+"."+{143:"31d6cfe0",508:"880242b5",736:"9ed7638d"}[e]+".css"})(),(()=>{r.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}()})(),(()=>{r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{var e={},t="uniqua:";r.l=(n,o,a,i)=>{if(e[n])e[n].push(o);else{var l,s;if(void 0!==a)for(var u=document.getElementsByTagName("script"),c=0;c<u.length;c++){var d=u[c];if(d.getAttribute("src")==n||d.getAttribute("data-webpack")==t+a){l=d;break}}l||(s=!0,l=document.createElement("script"),l.charset="utf-8",l.timeout=120,r.nc&&l.setAttribute("nonce",r.nc),l.setAttribute("data-webpack",t+a),l.src=n),e[n]=[o];var p=(t,r)=>{l.onerror=l.onload=null,clearTimeout(f);var o=e[n];if(delete e[n],l.parentNode&&l.parentNode.removeChild(l),o&&o.forEach((e=>e(r))),t)return t(r)},f=setTimeout(p.bind(null,void 0,{type:"timeout",target:l}),12e4);l.onerror=p.bind(null,l.onerror),l.onload=p.bind(null,l.onload),s&&document.head.appendChild(l)}}})(),(()=>{r.r=e=>{"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})(),(()=>{r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e)})(),(()=>{r.p="/"})(),(()=>{var e=(e,t,r,n)=>{var o=document.createElement("link");o.rel="stylesheet",o.type="text/css";var a=a=>{if(o.onerror=o.onload=null,"load"===a.type)r();else{var i=a&&("load"===a.type?"missing":a.type),l=a&&a.target&&a.target.href||t,s=new Error("Loading CSS chunk "+e+" failed.\n("+l+")");s.code="CSS_CHUNK_LOAD_FAILED",s.type=i,s.request=l,o.parentNode.removeChild(o),n(s)}};return o.onerror=o.onload=a,o.href=t,document.head.appendChild(o),o},t=(e,t)=>{for(var r=document.getElementsByTagName("link"),n=0;n<r.length;n++){var o=r[n],a=o.getAttribute("data-href")||o.getAttribute("href");if("stylesheet"===o.rel&&(a===e||a===t))return o}var i=document.getElementsByTagName("style");for(n=0;n<i.length;n++){o=i[n],a=o.getAttribute("data-href");if(a===e||a===t)return o}},n=n=>new Promise(((o,a)=>{var i=r.miniCssF(n),l=r.p+i;if(t(i,l))return o();e(n,l,o,a)})),o={143:0};r.f.miniCss=(e,t)=>{var r={508:1};o[e]?t.push(o[e]):0!==o[e]&&r[e]&&t.push(o[e]=n(e).then((()=>{o[e]=0}),(t=>{throw delete o[e],t})))}})(),(()=>{var e={143:0};r.f.j=(t,n)=>{var o=r.o(e,t)?e[t]:void 0;if(0!==o)if(o)n.push(o[2]);else{var a=new Promise(((r,n)=>o=e[t]=[r,n]));n.push(o[2]=a);var i=r.p+r.u(t),l=new Error,s=n=>{if(r.o(e,t)&&(o=e[t],0!==o&&(e[t]=void 0),o)){var a=n&&("load"===n.type?"missing":n.type),i=n&&n.target&&n.target.src;l.message="Loading chunk "+t+" failed.\n("+a+": "+i+")",l.name="ChunkLoadError",l.type=a,l.request=i,o[1](l)}};r.l(i,s,"chunk-"+t,t)}},r.O.j=t=>0===e[t];var t=(t,n)=>{var o,a,[i,l,s]=n,u=0;if(i.some((t=>0!==e[t]))){for(o in l)r.o(l,o)&&(r.m[o]=l[o]);if(s)var c=s(r)}for(t&&t(n);u<i.length;u++)a=i[u],r.o(e,a)&&e[a]&&e[a][0](),e[i[u]]=0;return r.O(c)},n=globalThis["webpackChunkuniqua"]=globalThis["webpackChunkuniqua"]||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})();var n=r.O(void 0,[736],(()=>r(653)));n=r.O(n)})();
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: unisi
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.17
|
4
4
|
Summary: Unified System Interface, GUI and Remote API
|
5
5
|
Author-Email: UNISI Tech <g.dernovoy@gmail.com>
|
6
6
|
License: Apache-2.0
|
@@ -78,7 +78,7 @@ block = Block('X Block',
|
|
78
78
|
| blocks | Has to be defined | list |which blocks to show on the screen |
|
79
79
|
| user | Always defined, read-only | User+ | Access to User(inherited) class which associated with a current user |
|
80
80
|
| header | Optional | str | show it instead of app name |
|
81
|
-
| toolbar | Optional | list |
|
81
|
+
| toolbar | Optional | list | Unit elements to show in the screen toolbar |
|
82
82
|
| order | Optional | int | order in the program menu |
|
83
83
|
| icon | Optional | str | MD icon of screen to show in the screen menu |
|
84
84
|
| prepare | Optional | def prepare() | Syncronizes GUI elements one to another and with the program/system data. If defined then is called before screen appearing. |
|
@@ -108,9 +108,9 @@ where gui_object is a Python object the user interacted with and value for the e
|
|
108
108
|
|
109
109
|
#### UNISI supports synchronous and asynchronous handlers automatically adopting them for using. ####
|
110
110
|
|
111
|
-
All
|
111
|
+
All Unit objects except Button have a field ‘value’.
|
112
112
|
For an edit field the value is a string or number, for a switch or check button the value is boolean, for table is row id or index, e.t.c.
|
113
|
-
When a user changes the value of the
|
113
|
+
When a user changes the value of the Unit object or presses Button, the server calls the ‘changed’ function handler.
|
114
114
|
|
115
115
|
```
|
116
116
|
def clean_table(_, value):
|
@@ -121,8 +121,8 @@ clean_button = Button('Clean the table’, clean_table)
|
|
121
121
|
|
122
122
|
| Handler returns | Description |
|
123
123
|
| :---: | :---: |
|
124
|
-
|
|
125
|
-
|
|
124
|
+
| Unit object | Object to update |
|
125
|
+
| Unit object array or tuple | Objects to update |
|
126
126
|
| None | Nothing to update, Ok |
|
127
127
|
| Error(...), Warning(...), Info(...) | Show to user info about a state. |
|
128
128
|
| True | Update whole screen |
|
@@ -131,7 +131,7 @@ clean_button = Button('Clean the table’, clean_table)
|
|
131
131
|
|
132
132
|
Unisi synchronizes GUI state on frontend-end automatically after calling a handler.
|
133
133
|
|
134
|
-
If a
|
134
|
+
If a Unit object doesn't have 'changed' handler the object accepts incoming value automatically to the 'value' variable of gui object.
|
135
135
|
|
136
136
|
If 'value' is not acceptable instead of returning an object possible to return Error or Warning or Info. That functions can update a object list passed after the message argument.
|
137
137
|
|
@@ -197,7 +197,7 @@ blocks = [ [b1,b2], [b3, [b4, b5]]]
|
|
197
197
|
### ParamBlock ###
|
198
198
|
ParamBlock(name, *gui_elements, row = 3, **parameters)
|
199
199
|
|
200
|
-
ParamBlock creates blocks with
|
200
|
+
ParamBlock creates blocks with Unit elements formed from parameters. Parameters can be string, bool, number and optional types. Example:
|
201
201
|
```
|
202
202
|
block = ParamBlock('Learning parameters', Button('Start learning', learn_nn)
|
203
203
|
per_device_eval_batch_size=16, num_train_epochs=10, warmup_ratio=0.1,
|
@@ -217,13 +217,13 @@ Normally they have type property which says unisi what data it contains and opti
|
|
217
217
|
#### If the element name starts from _ , unisi will hide its name on the screen. ####
|
218
218
|
if we need to paint an icon in an element, add 'icon': 'any MD icon name' to the element constructor.
|
219
219
|
|
220
|
-
#### Most constructor parameters are optional for
|
220
|
+
#### Most constructor parameters are optional for Unit elements except the first one which is the element name. ####
|
221
221
|
|
222
222
|
Common form for element constructors:
|
223
223
|
```
|
224
|
-
|
224
|
+
Unit('Name', value = some_value, changed = changed_handler)
|
225
225
|
#It is possible to use short form, that is equal:
|
226
|
-
|
226
|
+
Unit('Name', some_value, changed_handler)
|
227
227
|
```
|
228
228
|
calling the method
|
229
229
|
def accept(self, value)
|
@@ -409,7 +409,7 @@ def dialog_callback(current_dialog, command_button_name):
|
|
409
409
|
do_this()
|
410
410
|
elif ..
|
411
411
|
```
|
412
|
-
content can be filled with
|
412
|
+
content can be filled with Unit elements for additional dialog functionality like a Block.
|
413
413
|
|
414
414
|
|
415
415
|
### Popup windows ###
|
@@ -1,27 +1,27 @@
|
|
1
|
-
unisi-0.1.
|
2
|
-
unisi-0.1.
|
3
|
-
unisi-0.1.
|
4
|
-
unisi/__init__.py,sha256=
|
5
|
-
unisi/autotest.py,sha256=
|
6
|
-
unisi/common.py,sha256=
|
7
|
-
unisi/containers.py,sha256=
|
8
|
-
unisi/
|
9
|
-
unisi/guielements.py,sha256=fhPqMO4-uzfOhisbteHXb142FI4F3HVsxGwGJcaq5P4,6652
|
1
|
+
unisi-0.1.17.dist-info/METADATA,sha256=AEMoN-uJk-ycc1PsJ3faeUTT15jx9oL2KywsWhSlsWI,23990
|
2
|
+
unisi-0.1.17.dist-info/WHEEL,sha256=rSwsxJWe3vzyR5HCwjWXQruDgschpei4h_giTm0dJVE,90
|
3
|
+
unisi-0.1.17.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
4
|
+
unisi/__init__.py,sha256=a4I_tbvmIh5STXoirJiP0v_HSlOnzRY4bN4nViR7uZw,257
|
5
|
+
unisi/autotest.py,sha256=G23JDc00rDYuj0qxIJwlSn4A7qe16utXe4cNyEW8yvw,8733
|
6
|
+
unisi/common.py,sha256=UjFtua5nZjz7gKc3ExkLgLRud3foHxgaGxp5xiVxj24,4360
|
7
|
+
unisi/containers.py,sha256=uCEDMio8lZ0qkbwrouER3UvNIJ2rk2MQ4nXS8lZOmoE,5952
|
8
|
+
unisi/dbunits.py,sha256=ML6XXc3IIKU_zG9rnmHL7o1whRQIa287wo1JZCXxBX8,6554
|
10
9
|
unisi/jsoncomparison/__init__.py,sha256=lsWkYEuL6v3Qol-lwSUvB6y63tm6AKcCMUd4DZDx3Cg,350
|
11
10
|
unisi/jsoncomparison/compare.py,sha256=qPDaxd9n0GgiNd2SgrcRWvRDoXGg7NStViP9PHk2tlQ,6152
|
12
11
|
unisi/jsoncomparison/config.py,sha256=LbdLJE1KIebFq_tX7zcERhPvopKhnzcTqMCnS3jN124,381
|
13
12
|
unisi/jsoncomparison/errors.py,sha256=wqphE1Xn7K6n16uvUhDC45m2BxbsMUhIF2olPbhqf4o,1192
|
14
13
|
unisi/jsoncomparison/ignore.py,sha256=xfF0a_BBEyGdZBoq-ovpCpawgcX8SRwwp7IrGnu1c2w,2634
|
15
|
-
unisi/kdb.py,sha256=
|
16
|
-
unisi/llmrag.py,sha256=
|
14
|
+
unisi/kdb.py,sha256=A6ZW8Ea90mHXLWmU0ZlwYcbOgOMNzaYMMsNrukpqT5Q,13667
|
15
|
+
unisi/llmrag.py,sha256=6kIU6M2D3-bnrwc8q-N7_GYj3AavlOJO2jvUvSVfbVQ,2695
|
17
16
|
unisi/multimon.py,sha256=5xgzR_dbJWr10IttgdgRA1llRHOArQtyt2YEvuHyoE4,4007
|
18
17
|
unisi/proxy.py,sha256=aFZXMaCIy43r-TbR0Ff9NNDwmpg_SZ27oS5Y4p5c_uY,7697
|
19
18
|
unisi/reloader.py,sha256=ZKWBR30Ho-cwbuWX4x05XRryBqA6YcVccBQf4xmJyw0,6585
|
20
|
-
unisi/server.py,sha256=
|
21
|
-
unisi/tables.py,sha256=
|
22
|
-
unisi/
|
19
|
+
unisi/server.py,sha256=4aup4lpG80IhdTTqyA_uyntYKNdYuUnhRrpwjIfzEGI,4477
|
20
|
+
unisi/tables.py,sha256=B1Je-pgg92jCRoetmSFSY8EZhg0aYrwGDaZaq3L2Svc,13844
|
21
|
+
unisi/units.py,sha256=HbKW4lef5Fn-UFh3KALv-iZz7dPklCm9wjxcJRbWARw,6674
|
22
|
+
unisi/users.py,sha256=FIs-1Ckgb4XCjWngqaKs6zNIDK8gNXqeEClpSz52Ldo,14288
|
23
23
|
unisi/utils.py,sha256=o1t9N7GMVUy9Le2570PK0hVEsjxS5-aMKiwhvhRwZOg,2491
|
24
|
-
unisi/web/css/
|
24
|
+
unisi/web/css/508.880242b5.css,sha256=Ozm-q1ciBu593NcEYkG0RC4zutNdfzCgtmHjkQ3C6R8,2691
|
25
25
|
unisi/web/css/app.31d6cfe0.css,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
26
26
|
unisi/web/css/vendor.9ed7638d.css,sha256=p_6HvcTaHu2zmOmfGxEGiGu5TIFZ75_XKHJZWA0eGCE,220597
|
27
27
|
unisi/web/favicon.ico,sha256=2ZcJaY_4le4w5NSBzWjaj3yk1faLAX0XqioI-Tjscbs,64483
|
@@ -37,10 +37,10 @@ unisi/web/icons/favicon-128x128.png,sha256=zmGg0n6RZ5OM4gg-E5HeHuUUtA2KD1w2AqegT
|
|
37
37
|
unisi/web/icons/favicon-16x16.png,sha256=3ynBFHJjwaUFKcZVC2rBs27b82r64dmcvfFzEo52-sU,859
|
38
38
|
unisi/web/icons/favicon-32x32.png,sha256=lhGXZOqIhjcKDymmbKyo4mrVmKY055LMD5GO9eW2Qjk,2039
|
39
39
|
unisi/web/icons/favicon-96x96.png,sha256=0PbP5YF01VHbwwP8z7z8jjltQ0q343C1wpjxWjj47rY,9643
|
40
|
-
unisi/web/index.html,sha256=
|
40
|
+
unisi/web/index.html,sha256=9vqp9fQUKBz8J-ny2I-qjB1uVvRt5WEzU1NqrWuqO2s,923
|
41
41
|
unisi/web/js/193.283445be.js,sha256=FID-PRjvjbe_OHxm7L2NC92Cj_5V7AtDQ2WvKxLZ0lw,763
|
42
42
|
unisi/web/js/430.591e9a73.js,sha256=7S1CJTwGdE2EKXzeFRcaYuTrn0QteoVI03Hykz8qh3s,6560
|
43
|
-
unisi/web/js/
|
44
|
-
unisi/web/js/app.
|
43
|
+
unisi/web/js/508.4af55eb8.js,sha256=cm_klwqJonkprfO_izAyd6KwYtVeJ_qqjpk3_A2dLQw,60306
|
44
|
+
unisi/web/js/app.44d431b1.js,sha256=WwpMys-Xp8uF-RTTggbKq-YoJVCKFGKTlhinYOkteJM,5901
|
45
45
|
unisi/web/js/vendor.eab68489.js,sha256=kf7Bf302l1D1kmnVoG2888ZwR7boc9qLeiEOoxa_UA0,1279366
|
46
|
-
unisi-0.1.
|
46
|
+
unisi-0.1.17.dist-info/RECORD,,
|
unisi/web/js/440.970b3f89.js
DELETED
@@ -1,2 +0,0 @@
|
|
1
|
-
"use strict";(globalThis["webpackChunkuniqua"]=globalThis["webpackChunkuniqua"]||[]).push([[440],{5440:(e,t,a)=>{a.r(t),a.d(t,{default:()=>ba});var l=a(3673),s=a(2323);const i=(0,l._)("div",{class:"q-pa-md"},null,-1),n=(0,l._)("div",{class:"q-pa-md"},null,-1);function o(e,t,a,o,d,r){const c=(0,l.up)("q-item-label"),h=(0,l.up)("element"),u=(0,l.up)("q-tab"),p=(0,l.up)("q-tabs"),g=(0,l.up)("q-space"),m=(0,l.up)("q-tooltip"),f=(0,l.up)("q-btn"),y=(0,l.up)("q-toolbar"),w=(0,l.up)("q-header"),b=(0,l.up)("zone"),v=(0,l.up)("q-page"),k=(0,l.up)("q-page-container"),x=(0,l.up)("q-layout");return(0,l.wg)(),(0,l.j4)(x,{view:"lHh Lpr lFf"},{default:(0,l.w5)((()=>[(0,l.Wm)(w,{elevated:"",class:(0,s.C_)({"bg-deep-purple-9":e.Dark.isActive})},{default:(0,l.w5)((()=>[(0,l.Wm)(y,null,{default:(0,l.w5)((()=>[(0,l.Wm)(c,{class:"text-h5"},{default:(0,l.w5)((()=>[(0,l.Uk)((0,s.zw)(e.screen.header?e.screen.header:""),1)])),_:1}),i,((0,l.wg)(!0),(0,l.iD)(l.HY,null,(0,l.Ko)(e.left_toolbar,(t=>((0,l.wg)(),(0,l.j4)(h,{class:(0,s.C_)(["q-ma-xs",{"bg-blue-grey-7":e.Dark.isActive,"bg-blue-5":!e.Dark.isActive}]),data:t,pdata:e.tooldata},null,8,["class","data","pdata"])))),256)),n,(0,l.Wm)(p,{class:"bold-tabs",align:"center","inline-label":"",dense:"",modelValue:e.tab,"onUpdate:modelValue":t[0]||(t[0]=t=>e.tab=t),style:{float:"center"}},{default:(0,l.w5)((()=>[((0,l.wg)(!0),(0,l.iD)(l.HY,null,(0,l.Ko)(e.menu,(t=>((0,l.wg)(),(0,l.iD)("div",null,[t.icon?((0,l.wg)(),(0,l.j4)(u,{key:0,class:"justify-center text-white shadow-2","no-caps":"",name:t.name,icon:t.icon,label:t.name,onClick:a=>e.tabclick(t.name)},null,8,["name","icon","label","onClick"])):(0,l.kq)("",!0),t.icon?(0,l.kq)("",!0):((0,l.wg)(),(0,l.j4)(u,{key:1,class:"justify-center text-white shadow-2","no-caps":"",name:t.name,label:t.name,onClick:a=>e.tabclick(t.name)},null,8,["name","label","onClick"]))])))),256))])),_:1},8,["modelValue"]),(0,l.Wm)(g),((0,l.wg)(!0),(0,l.iD)(l.HY,null,(0,l.Ko)(e.right_toolbar,(t=>((0,l.wg)(),(0,l.j4)(h,{class:(0,s.C_)(["q-ma-xs",{"bg-blue-grey-7":e.Dark.isActive,"bg-blue-5":!e.Dark.isActive}]),data:t,pdata:e.tooldata},null,8,["class","data","pdata"])))),256)),(0,l.Wm)(f,{class:(0,s.C_)(["q-ma-xs",{"bg-blue-grey-9":e.Dark.isActive}]),dense:"",round:"",icon:e.Dark.isActive?"light_mode":"dark_mode",onClick:e.switchTheme},{default:(0,l.w5)((()=>[(0,l.Wm)(m,{class:"text-body2"},{default:(0,l.w5)((()=>[(0,l.Uk)("Dark/Light mode")])),_:1})])),_:1},8,["class","icon","onClick"])])),_:1})])),_:1},8,["class"]),(0,l.Wm)(k,{class:"content"},{default:(0,l.w5)((()=>[(0,l.Wm)(v,{class:"flex justify-center centers"},{default:(0,l.w5)((()=>[(0,l.Wm)(b,{data:e.screen.blocks,ref:"page"},null,8,["data"])])),_:1})])),_:1})])),_:1})}function d(e,t,a,i,n,o){const d=(0,l.up)("q-icon"),r=(0,l.up)("q-item-section"),c=(0,l.up)("q-item-label"),h=(0,l.up)("q-item");return(0,l.wg)(),(0,l.j4)(h,{clickable:"",tag:"a",target:"_blank",onClick:e.send},{default:(0,l.w5)((()=>[(0,l.Wm)(r,{avatar:""},{default:(0,l.w5)((()=>[(0,l.Wm)(d,{name:e.icon},null,8,["name"])])),_:1}),(0,l.Wm)(r,null,{default:(0,l.w5)((()=>[(0,l.Wm)(c,null,{default:(0,l.w5)((()=>[(0,l.Uk)((0,s.zw)(e.name),1)])),_:1})])),_:1})])),_:1},8,["onClick"])}a(71);var r=a(698),c=a(8603);let h=null,u={};var p;const g=!1;let m=g;const f=["graph","chart","block","text"],y=["tree","table","list","text","graph","chart"];const w=window.location.host,b=`${window.location.protocol}//${w}`;let v={},k={},x={};function C(e){let t=window.location.href,a=t.split("?"),l=2==a.length?a[1]:null;l&&(a=l.split("#"),2==a.length&&(l=a[0]));let s=g?"ws://localhost:8000/ws":`ws://${w}/ws`;l&&(s+="?"+l),p=new WebSocket(s),p.onopen=()=>e.statusConnect=!0,p.onmessage=t=>{m&&console.log("incoming message",t.data),h.designCycle=0;let a=JSON.parse(t.data);a?e.processMessage(a):e.closeProgress(a)},p.onerror=t=>e.error(t),p.onclose=t=>{t.wasClean?e.info("Connection was finished by the server."):e.error("Connection suddenly closed!"),e.statusConnect=!1,m&&console.info("close code : "+t.code+" reason: "+t.reason)},h=e}function _(e){let t={block:e[0],element:e[1],event:e[2],value:e[3]};m&&console.log("sended",t),p.send(JSON.stringify(t))}let A=!0;function q(e){A=e,e||(x={})}function S(e){if(A){let t=x[e.fullname];if(t)return t.styleSize;A=!1}return null}function D(e,t,a,l="complete"){let s=[e.pdata.name,e.data.name,l,t];_(s),u[s.toString()]=a}function z(e,t,a,l,s){let i=[e,t,s,a];_(i),u[i.toString()]=l}function j(){v={},x=k,A=!0,k={}}function E(e,t){Object.assign(e.data,t),e.updated=t.value,e.value=t.value}function $(e){for(let t of e){let e=t.path;if(e.length>1){e.reverse();let a=e.join("@"),l=k[a];E(l,t.data)}else{let a=v[e[0]];Object.assign(a.data,t.data)}}}function Z(e){let t=[e.message.block,e.message.element,e.type,e.message.value].toString();if("string"==typeof e.value)h.error(e.value);else if(u[t]){let a=u[t];delete u[t],a(e.value,e.message)}else h.error(t+" doesnt exist in queryMap!")}function O(e){let t=[];for(let l of e)l instanceof Array?t.push(l):t.push([l]);let a=t.shift();return t.reduce(((e,t)=>e.flatMap((e=>t.map((t=>e instanceof Array?[...e,t]:[e,t]))))),a)}function M(e=!1){N(document.documentElement.scrollWidth>window.innerWidth)}let W=(0,c.debounce)(M,50);function N(e){if(h.designCycle>=1)return;m&&console.log(`------------------recalc design ${h.designCycle}`),h.designCycle++;const t=V(e),a=H(e);for(let[l,s]of Object.entries(t)){let e=k[l],t=a[l];const[i,n]=t||[0,1];let o,d=e.geom(),r=d.el,c=e.pdata?e.pdata.name:e.name,h=v[c];for(let a of h.data.value.slice(1))if(Array.isArray(a)){if(a.find((t=>t.name==e.data.name))){let e=a[a.length-1],t=`${e.name}@${c}`;o=k[t];break}}else if(a.name==e.data.name){o=e;break}let u=i;u/=n;let p=e.only_fixed_elems?"":`width:${Math.ceil(r.clientWidth+u)}px`,g=`height:${Math.floor(s+e.he)}px;${p}`;g!=e.styleSize&&(e.styleSize=g),e.has_recalc=!1}}function V(e){const t=h.screen.blocks;let a=window.innerHeight-60,l={},s=new Map,i=[];for(let o of t){const e=[];let t=o instanceof Array,n=t?O(o):[[o]],d={};for(let[a,l]of Object.entries(v)){let e=l.$el.getBoundingClientRect(),t=e.bottom;d[a]=t-e.top}for(let a of n){let e=0,t=!0;for(let l of a)e+=d[l.name],v[l.name].only_fixed_elems||(t=!1);if(t){let e=v[a.slice(-1)[0].name];k[e.fullname]=e}i.push([e+8*a.length,a])}i.sort(((e,t)=>e[0]>t[0]?-1:e[0]==t[0]?0:1));for(let a of i){let t=a[1];(0,r.hu)(Array.isArray(t));const l=[];for(let[e,a]of Object.entries(k))if(a.expanding_height){let[i,n]=e.split("@");if(t.find((e=>e.name==n))){let e=!0;const t=a.geom();for(let[i,n]of l.entries()){let o=n.geom();e&&n!==a&&o.top==t.top&&(o.scrollHeight<t.scrollHeight&&(l[i]=a),e=!1,s.set(a.fullname,n.fullname))}e&&l.push(a)}}l.length&&e.push([a[0],l])}for(let[s,i]of e){let e=0,t=[];for(let a of i)if(a.fullname in l)s+=l[a.fullname];else{let l=a.geom(),i=l.bottom-l.top;i<100&&(s+=100-i,i=100),a.he=i,e+=a.he,t.push(a)}let n=(e+a-s)/t.length,o=0;for(let a of t){let e,s=n-a.he;if(1==t.length)e=s;else if(e=Math.floor(s),s-e){o+=s-e;let t=Math.round(o)-o;t<.001&&t>-.001&&(e+=Math.round(o),o=0)}l[a.fullname]=e}}}let n=Array.from(s.entries());n.sort(((e,t)=>e[0]in l||e[1]in l?-1:1));for(let[o,d]of n)d in l?(l[o]=l[d],k[o].he=k[d].he):(l[d]=l[o],k[d].he=k[o].he);return l}function H(e){let t=null;const a=t?[t]:h.screen.blocks;let l=window.innerWidth-20,s=[],i={};for(let o of a)if(0==s.length)if(Array.isArray(o))for(let e of o)s.push(Array.isArray(e)?e:[e]);else s=[[o]];else{let e=[];if(Array.isArray(o))for(let t of o)for(let a of s)e.push(Array.isArray(t)?a.concat(t):[...a,t]);else for(let t of s)e.push([...t,o]);s=e}const n=[];for(let o of s){let e=0;for(let l of o){let t=v[l.name].$el.getBoundingClientRect();e+=t.right-t.left+5}let t=l-e,a=[[]];for(let l of o){let e=[];for(let t of v[l.name].hlevelements)for(let l of a)e.push([...l,...t]);a=e}for(let l of a)n.push([t,l])}n.sort(((e,t)=>t[1].length-e[1].length));for(let[o,d]of n){let t=new Map;for(let e=0;e<d.length;e++){let a=d[e],l=a.parent_name,s=l||a.name,n=a.geom(),r=(a.data.width?a.data.width:n.scrollWidth)-(n.right-n.left);if(r>1&&!f.includes(a.type)&&o>0&&!i[a.fullname]){let e=o>r?r:o;o-=e,i[a.fullname]=[e,1]}if(s=a.parent_name,s){let e=v[s],l=e.$el.getBoundingClientRect().right-6,i=e.free_right_delta4(a,n.right),o=l-i;i&&o>0&&(!t.has(s)||t.get(s)>o)&&t.set(s,o)}}for(let e of t.values())o+=e;let a=[];for(let n of d)if(n.expanding_width&&(e||f.includes(n.type)))if(i[n.fullname]){let[e,t]=i[n.fullname];o-=e/t}else a.push(n);let l=a.length;const s=o/l;for(let e of a)i[e.fullname]||(i[e.fullname]=[Math.floor(s),1]);for(let e of d)i[e.fullname]||(i[e.fullname]=[0,1])}return i}const K=(0,l.aZ)({name:"menubar",methods:{send(){_(["root",null,"changed",this.name])}},props:{name:{type:String,required:!0},icon:{type:String,default:""}}});var F=a(4260),Q=a(3414),U=a(2035),R=a(4554),T=a(2350),I=a(7518),P=a.n(I);const L=(0,F.Z)(K,[["render",d]]),B=L;P()(K,"components",{QItem:Q.Z,QItemSection:U.Z,QIcon:R.Z,QItemLabel:T.Z});const Y={key:0,class:"row q-col-gutter-xs q-py-xs"},G={class:"q-col-gutter-xs"},J={key:0,class:"column q-col-gutter-xs"};function X(e,t,a,s,i,n){const o=(0,l.up)("zone",!0),d=(0,l.up)("block");return e.data instanceof Array?((0,l.wg)(),(0,l.iD)("div",Y,[((0,l.wg)(!0),(0,l.iD)(l.HY,null,(0,l.Ko)(e.data,(e=>((0,l.wg)(),(0,l.iD)("div",G,[e instanceof Array?((0,l.wg)(),(0,l.iD)("div",J,[((0,l.wg)(!0),(0,l.iD)(l.HY,null,(0,l.Ko)(e,(e=>((0,l.wg)(),(0,l.j4)(o,{class:"q-col-gutter-xs q-py-xs",data:e},null,8,["data"])))),256))])):((0,l.wg)(),(0,l.j4)(d,{key:1,data:e},null,8,["data"]))])))),256))])):((0,l.wg)(),(0,l.j4)(d,{key:1,data:e.data},null,8,["data"]))}const ee={class:"row no-wrap"},te=["data","pdata"],ae={key:0,class:"row"},le=["data","pdata"],se={key:0,class:"row no-wrap"};function ie(e,t,a,i,n,o){const d=(0,l.up)("element"),r=(0,l.up)("q-icon"),c=(0,l.up)("q-scroll-area"),h=(0,l.up)("q-card");return(0,l.wg)(),(0,l.j4)(h,{class:"my-card q-ma-xs",style:(0,s.j5)(e.only_fixed_elems?e.styleSize:null),key:e.name},{default:(0,l.w5)((()=>[(0,l._)("div",ee,[e.data.logo?((0,l.wg)(),(0,l.j4)(d,{key:0,class:"q-ma-sm",data:e.data.logo,pdata:e.data},null,8,["data","pdata"])):e.data.icon?((0,l.wg)(),(0,l.j4)(r,{key:1,class:"q-mt-sm q-ml-sm",style:{"padding-top":"6px"},size:"sm",name:e.data.icon},null,8,["name"])):(0,l.kq)("",!0),"_"!=e.name[0]?((0,l.wg)(),(0,l.iD)("p",{key:2,class:(0,s.C_)(["q-ma-sm",{"text-info":e.Dark.isActive,"text-cyan-10":!e.Dark.isActive}]),style:{"padding-top":"6px","font-size":"20px"}},(0,s.zw)(e.name),3)):(0,l.kq)("",!0),((0,l.wg)(!0),(0,l.iD)(l.HY,null,(0,l.Ko)(e.tops,(t=>((0,l.wg)(),(0,l.j4)(d,{class:"q-ma-xs",data:t,pdata:e.data},null,8,["data","pdata"])))),256))]),e.data.scroll?((0,l.wg)(),(0,l.j4)(c,{key:0,style:(0,s.j5)(e.styleSize),"thumb-style":e.thumbStyle,"bar-style":e.barStyle},{default:(0,l.w5)((()=>[((0,l.wg)(!0),(0,l.iD)(l.HY,null,(0,l.Ko)(e.data.value.slice(1),(t=>((0,l.wg)(),(0,l.iD)("div",{class:"column",data:t,pdata:e.data},[t instanceof Array?((0,l.wg)(),(0,l.iD)("div",ae,[((0,l.wg)(!0),(0,l.iD)(l.HY,null,(0,l.Ko)(t,(t=>((0,l.wg)(),(0,l.j4)(d,{class:"q-ma-xs",data:t,pdata:e.data},null,8,["data","pdata"])))),256))])):((0,l.wg)(),(0,l.j4)(d,{key:1,class:"q-ma-xs",data:t,pdata:e.data},null,8,["data","pdata"]))],8,te)))),256))])),_:1},8,["style","thumb-style","bar-style"])):((0,l.wg)(!0),(0,l.iD)(l.HY,{key:1},(0,l.Ko)(e.data.value.slice(1),(t=>((0,l.wg)(),(0,l.iD)("div",{class:"column",data:t,pdata:e.data},[t instanceof Array?((0,l.wg)(),(0,l.iD)("div",se,[((0,l.wg)(!0),(0,l.iD)(l.HY,null,(0,l.Ko)(t,(t=>((0,l.wg)(),(0,l.j4)(d,{class:"q-ma-xs",data:t,pdata:e.data},null,8,["data","pdata"])))),256))])):((0,l.wg)(),(0,l.j4)(d,{key:1,class:"q-ma-xs",data:t,pdata:e.data},null,8,["data","pdata"]))],8,le)))),256))])),_:1},8,["style"])}var ne=a(8880);const oe=e=>((0,l.dD)("data-v-6eb6b02a"),e=e(),(0,l.Cn)(),e),de={key:4},re={key:5,class:"{'bg-blue-grey-9': Dark.isActive}"},ce={key:9},he={key:12},ue=["width","height"],pe=["src"],ge={key:19,class:"web-camera-container"},me={class:"camera-button"},fe={key:0},ye={key:1},we={class:"camera-loading"},be=oe((()=>(0,l._)("ul",{class:"loader-circle"},[(0,l._)("li"),(0,l._)("li"),(0,l._)("li")],-1))),ve=[be],ke=["height"],xe=["height"],Ce={key:1,class:"camera-shoot"},_e=oe((()=>(0,l._)("img",{src:"https://img.icons8.com/material-outlined/50/000000/camera--v2.png"},null,-1))),Ae=[_e],qe={key:2,class:"camera-download"},Se={key:20};function De(e,t,a,i,n,o){const d=(0,l.up)("q-icon"),r=(0,l.up)("q-img"),c=(0,l.up)("q-select"),h=(0,l.up)("q-checkbox"),u=(0,l.up)("q-toggle"),p=(0,l.up)("q-badge"),g=(0,l.up)("q-slider"),m=(0,l.up)("q-btn"),f=(0,l.up)("q-btn-toggle"),y=(0,l.up)("utable"),w=(0,l.up)("linechart"),b=(0,l.up)("q-input"),v=(0,l.up)("q-tree"),k=(0,l.up)("q-scroll-area"),x=(0,l.up)("q-separator"),C=(0,l.up)("q-uploader"),_=(0,l.up)("sgraph"),A=(0,l.up)("q-tooltip"),q=(0,l.up)("q-spinner-ios");return"image"==e.type?((0,l.wg)(),(0,l.j4)(r,{key:0,src:e.data.url,"spinner-color":"blue",onClick:(0,ne.iM)(e.switchValue,["stop"]),fit:"cover",style:(0,s.j5)(e.elemSize)},{default:(0,l.w5)((()=>[e.data.label?((0,l.wg)(),(0,l.iD)("div",{key:0,class:"absolute-bottom-right text-subtitle2 custom-caption",onClick:t[0]||(t[0]=(0,ne.iM)(((...t)=>e.lens&&e.lens(...t)),["stop"]))},(0,s.zw)(e.data.label),1)):(0,l.kq)("",!0),e.value?((0,l.wg)(),(0,l.j4)(d,{key:1,class:"absolute all-pointer-events",size:"32px",name:"check_circle",color:"light-blue-2",style:{"font-size":"2em",top:"8px",left:"8px"}})):(0,l.kq)("",!0)])),_:1},8,["src","onClick","style"])):"select"==e.type?((0,l.wg)(),(0,l.j4)(c,{key:1,ref:"inputRef","transition-show":"flip-up",readonly:0==e.data.edit,"transition-hide":"flip-down",dense:"",modelValue:e.value,"onUpdate:modelValue":t[1]||(t[1]=t=>e.value=t),options:e.data.options},(0,l.Nv)({_:2},[e.showname?{name:"prepend",fn:(0,l.w5)((()=>[(0,l._)("p",{class:(0,s.C_)(["text-subtitle1 q-ma-sm",{white:e.Dark.isActive,black:!e.Dark.isActive}])},(0,s.zw)(e.name),3)])),key:"0"}:void 0]),1032,["readonly","modelValue","options"])):"check"==e.type?((0,l.wg)(),(0,l.j4)(h,{key:2,ref:"inputRef","left-label":"",disable:0==e.data.edit,modelValue:e.value,"onUpdate:modelValue":t[2]||(t[2]=t=>e.value=t),label:e.nameLabel,"checked-icon":"task_alt","unchecked-icon":"highlight_off"},null,8,["disable","modelValue","label"])):"switch"==e.type?((0,l.wg)(),(0,l.j4)(u,{key:3,ref:"inputRef",modelValue:e.value,"onUpdate:modelValue":t[3]||(t[3]=t=>e.value=t),disable:0==e.data.edit,color:"primary",label:e.nameLabel,"left-label":""},null,8,["modelValue","disable","label"])):"range"==e.type?((0,l.wg)(),(0,l.iD)("div",de,[(0,l.Wm)(p,{outline:"",dense:"",color:e.Dark.isActive?"blue-3":"blue-9"},{default:(0,l.w5)((()=>[(0,l.Uk)((0,s.zw)(e.name)+": "+(0,s.zw)(e.value)+" ("+(0,s.zw)(e.data.options[0])+" to "+(0,s.zw)(e.data.options[1])+", Δ "+(0,s.zw)(e.data.options[2])+")",1)])),_:1},8,["color"]),(0,l.Wm)(g,{class:"q-pl-sm",dense:"",modelValue:e.value,"onUpdate:modelValue":t[4]||(t[4]=t=>e.value=t),min:e.data.options[0],max:e.data.options[1],step:e.data.options[2],color:"primary"},null,8,["modelValue","min","max","step"])])):"radio"==e.type?((0,l.wg)(),(0,l.iD)("div",re,[e.showname?((0,l.wg)(),(0,l.j4)(m,{key:0,ripple:!1,color:"indigo-10",disable:"",label:e.name,"no-caps":""},null,8,["label"])):(0,l.kq)("",!0),(0,l.Wm)(f,{ref:"inputRef",modelValue:e.value,"onUpdate:modelValue":t[5]||(t[5]=t=>e.value=t),readonly:0==e.data.edit,class:(0,s.C_)({"bg-blue-grey-9":e.Dark.isActive}),"no-caps":"",options:e.data.options.map((e=>({label:e,value:e})))},null,8,["modelValue","readonly","class","options"])])):"table"==e.type?((0,l.wg)(),(0,l.j4)(y,{key:6,data:e.data,pdata:e.pdata,styleSize:e.styleSize},null,8,["data","pdata","styleSize"])):"chart"==e.type?((0,l.wg)(),(0,l.j4)(w,{key:7,data:e.data,pdata:e.pdata,styleSize:e.styleSize},null,8,["data","pdata","styleSize"])):"string"==e.type&&e.data.hasOwnProperty("complete")?((0,l.wg)(),(0,l.j4)(c,{key:8,ref:"inputRef",dense:"",readonly:0==e.data.edit,modelValue:e.value,"onUpdate:modelValue":t[6]||(t[6]=t=>e.value=t),"use-input":"","hide-selected":"",borderless:"",outlined:"","hide-bottom-space":"","fill-input":"","input-debounce":"0",options:e.options,onFilter:e.complete,label:e.name,onKeydown:(0,ne.D2)(e.pressedEnter,["enter"])},null,8,["readonly","modelValue","options","onFilter","label","onKeydown"])):"string"==e.type&&0==e.data.edit?((0,l.wg)(),(0,l.iD)("div",ce,[(0,l._)("p",{class:(0,s.C_)(["q-ma-sm",{white:e.Dark.isActive,black:!e.Dark.isActive}])},(0,s.zw)(e.value),3)])):"string"==e.type?((0,l.wg)(),(0,l.j4)(b,{key:10,modelValue:e.value,"onUpdate:modelValue":t[7]||(t[7]=t=>e.value=t),label:e.name2show,ref:"inputRef",autogrow:e.data.autogrow,dense:"",onKeydown:(0,ne.D2)(e.pressedEnter,["enter"]),readonly:0==e.data.edit},null,8,["modelValue","label","autogrow","onKeydown","readonly"])):"number"==e.type?((0,l.wg)(),(0,l.j4)(b,{key:11,modelValue:e.value,"onUpdate:modelValue":t[8]||(t[8]=t=>e.value=t),modelModifiers:{number:!0},label:e.name2show,ref:"inputRef",dense:"",onKeydown:(0,ne.D2)(e.pressedEnter,["enter"]),type:"number",readonly:0==e.data.edit},null,8,["modelValue","label","onKeydown","readonly"])):"tree"==e.type||"list"==e.type?((0,l.wg)(),(0,l.iD)("div",he,[e.showname?((0,l.wg)(),(0,l.iD)("p",{key:0,class:(0,s.C_)(["text-subtitle1 q-ma-sm text-grey-7",{"text-white":e.Dark.isActive,"text-indigo-10":!e.Dark.isActive}])},(0,s.zw)(e.name),3)):(0,l.kq)("",!0),(0,l.Wm)(k,{style:(0,s.j5)(e.styleSize),"thumb-style":e.thumbStyle,"bar-style":e.barStyle,ref:"scroller"},{default:(0,l.w5)((()=>[(0,l.Wm)(v,{nodes:e.treeNodes,"selected-color":e.Dark.isActive?"blue-3":"blue-9",dense:e.data.dense,ref:"tree",selected:e.value,"onUpdate:selected":t[9]||(t[9]=t=>e.value=t),expanded:e.expandedKeys,"onUpdate:expanded":t[10]||(t[10]=t=>e.expandedKeys=t),"node-key":"label","default-expand-all":""},null,8,["nodes","selected-color","dense","selected","expanded"])])),_:1},8,["style","thumb-style","bar-style"])])):"text"==e.type?(0,l.wy)(((0,l.wg)(),(0,l.iD)("textarea",{key:13,class:(0,s.C_)(["textarea",{"bg-grey-10":e.Dark.isActive,"text-white":e.Dark.isActive}]),"onUpdate:modelValue":t[11]||(t[11]=t=>e.value=t),filled:"",type:"textarea",style:(0,s.j5)(e.elemSize),onKeydown:t[12]||(t[12]=(0,ne.D2)(((...t)=>e.pressedEnter&&e.pressedEnter(...t)),["enter"]))},null,38)),[[ne.nr,e.value]]):"line"==e.type?((0,l.wg)(),(0,l.j4)(x,{key:14,color:"green"})):"video"==e.type?((0,l.wg)(),(0,l.iD)("video",{key:e.fullname,controls:"",width:e.data.width,height:e.data.height},[(0,l._)("source",{src:e.data.url,type:"video/mp4"},null,8,pe)],8,ue)):"uploader"==e.type?((0,l.wg)(),(0,l.j4)(C,{key:16,label:e.name,"auto-upload":"",thumbnails:"",url:e.host_path,onUploaded:e.updateDom,onAdded:e.onAdded,style:(0,s.j5)(e.elemSize),ref:"uploaderRef",flat:"",class:(0,s.C_)({"bg-grey-10":e.Dark.isActive}),color:e.Dark.isActive?"purple-10":"blue"},null,8,["label","url","onUploaded","onAdded","style","class","color"])):"image_uploader"==e.type?((0,l.wg)(),(0,l.j4)(C,{key:17,label:e.name,"auto-upload":"",thumbnails:"",url:e.host_path,onUploaded:e.updateDom,onAdded:e.onAdded,ref:"uploaderRef",flat:"",class:(0,s.C_)({"bg-grey-10":e.Dark.isActive}),color:e.Dark.isActive?"purple-10":"blue"},null,8,["label","url","onUploaded","onAdded","class","color"])):"graph"==e.type?((0,l.wg)(),(0,l.j4)(_,{key:18,data:e.data,pdata:e.pdata,styleSize:e.elemSize},null,8,["data","pdata","styleSize"])):"camera"==e.type?((0,l.wg)(),(0,l.iD)("div",ge,[(0,l._)("div",me,[(0,l._)("button",{class:(0,s.C_)(["button is-rounded",{"is-primary":!e.isCameraOpen,"is-danger":e.isCameraOpen}]),type:"button",onClick:t[13]||(t[13]=(...t)=>e.toggleCamera&&e.toggleCamera(...t))},[e.isCameraOpen?((0,l.wg)(),(0,l.iD)("span",ye,"Close Camera")):((0,l.wg)(),(0,l.iD)("span",fe,"Open Camera"))],2)]),(0,l.wy)((0,l._)("div",we,ve,512),[[ne.F8,e.isCameraOpen&&e.isLoading]]),e.isCameraOpen?(0,l.wy)(((0,l.wg)(),(0,l.iD)("div",{key:0,class:(0,s.C_)(["camera-box",{flash:e.isShotPhoto}])},[(0,l._)("div",{class:(0,s.C_)(["camera-shutter",{flash:e.isShotPhoto}])},null,2),(0,l.wy)((0,l._)("video",{ref:"camera",width:450,height:337.5,autoplay:""},null,8,ke),[[ne.F8,!e.isPhotoTaken]]),(0,l.wy)((0,l._)("canvas",{id:"photoTaken",ref:"canvas",width:450,height:337.5},null,8,xe),[[ne.F8,e.isPhotoTaken]])],2)),[[ne.F8,!e.isLoading]]):(0,l.kq)("",!0),e.isCameraOpen&&!e.isLoading?((0,l.wg)(),(0,l.iD)("div",Ce,[(0,l._)("button",{class:"button",type:"button",onClick:t[14]||(t[14]=(...t)=>e.takePhoto&&e.takePhoto(...t))},Ae)])):(0,l.kq)("",!0),e.isPhotoTaken&&e.isCameraOpen?((0,l.wg)(),(0,l.iD)("div",qe,[(0,l.Wm)(m,{onClick:e.downloadImage,label:"Send"},null,8,["onClick"])])):(0,l.kq)("",!0)])):""!=e.showname?((0,l.wg)(),(0,l.iD)("div",Se,[(0,l.Wm)(m,{ref:"inputRef","no-caps":"",disable:0==e.data.edit,class:(0,s.C_)({"bg-blue-grey-8":e.Dark.isActive}),label:e.name,icon:e.data.icon,onClick:e.sendValue},{default:(0,l.w5)((()=>[e.data.tooltip?((0,l.wg)(),(0,l.j4)(A,{key:0,class:"text-body2"},{default:(0,l.w5)((()=>[(0,l.Uk)((0,s.zw)(e.data.tooltip),1)])),_:1})):(0,l.kq)("",!0)])),_:1},8,["disable","class","label","icon","onClick"])])):e.data.spinner?((0,l.wg)(),(0,l.j4)(m,{key:22,ref:"inputRef","no-caps":"",dense:"",disable:0==e.data.edit,round:"",class:(0,s.C_)({"bg-blue-grey-8":e.Dark.isActive}),onClick:e.sendValue},{default:(0,l.w5)((()=>[(0,l.Wm)(q,{color:e.Dark.isActive?"white":"black"},null,8,["color"]),e.data.tooltip?((0,l.wg)(),(0,l.j4)(A,{key:0,class:"text-body2"},{default:(0,l.w5)((()=>[(0,l.Uk)((0,s.zw)(e.data.tooltip),1)])),_:1})):(0,l.kq)("",!0)])),_:1},8,["disable","class","onClick"])):((0,l.wg)(),(0,l.j4)(m,{key:21,ref:"inputRef","no-caps":"",disable:0==e.data.edit,dense:"",round:"",class:(0,s.C_)({"bg-blue-grey-8":e.Dark.isActive}),icon:e.data.icon,onClick:e.sendValue},{default:(0,l.w5)((()=>[e.data.tooltip?((0,l.wg)(),(0,l.j4)(A,{key:0,class:"text-body2"},{default:(0,l.w5)((()=>[(0,l.Uk)((0,s.zw)(e.data.tooltip),1)])),_:1})):(0,l.kq)("",!0)])),_:1},8,["disable","class","icon","onClick"]))}const ze={class:"text-h6"},je={key:0},Ee={class:"row"},$e=["onClick"],Ze=["onClick"];function Oe(e,t,a,i,n,o){const d=(0,l.up)("q-tooltip"),r=(0,l.up)("q-btn"),c=(0,l.up)("q-icon"),h=(0,l.up)("q-input"),u=(0,l.up)("q-th"),p=(0,l.up)("q-tr"),g=(0,l.up)("q-checkbox"),m=(0,l.up)("q-select"),f=(0,l.up)("q-td"),y=(0,l.up)("q-table");return(0,l.wg)(),(0,l.j4)(y,{"virtual-scroll":"",dense:e.data.dense,style:(0,s.j5)(e.styleSize?e.styleSize:e.currentStyle()),flat:"",filter:e.data.id?"":e.search,ref:"table",virtualScrollSliceSize:"100","rows-per-page-options":[0],"virtual-scroll-sticky-size-start":48,"row-key":"iiid",title:e.name,rows:e.rows,columns:e.columns,selection:e.singleMode?"single":"multiple",selected:e.selected,"onUpdate:selected":t[2]||(t[2]=t=>e.selected=t)},{"top-left":(0,l.w5)((()=>["link"in e.data?((0,l.wg)(),(0,l.j4)(r,{key:0,class:(0,s.C_)(["q-ml-xs",{"bg-blue-grey-8":e.Dark.isActive}]),dense:"",outline:"",color:"primary",icon:e.data.filter?"filter_alt":"filter_alt_off","no-caps":"",onClick:e.switchFilter},{default:(0,l.w5)((()=>[(0,l.Wm)(d,{class:"text-body2"},{default:(0,l.w5)((()=>[(0,l.Uk)((0,s.zw)(e.data.filter?"Turn off filter":"Turn on filter"),1)])),_:1})])),_:1},8,["class","icon","onClick"])):(0,l.kq)("",!0),(0,l._)("div",ze,(0,s.zw)(e.name),1)])),"top-right":(0,l.w5)((()=>[!1!==e.data.tools?((0,l.wg)(),(0,l.iD)("div",je,[(0,l._)("div",Ee,[(0,l.Wm)(h,{modelValue:e.search,"onUpdate:modelValue":t[1]||(t[1]=t=>e.search=t),label:"Search",dense:"",ref:"searchField"},(0,l.Nv)({append:(0,l.w5)((()=>[""!=e.search?((0,l.wg)(),(0,l.j4)(c,{key:0,class:"cursor-pointer",name:"close",size:"xs",onClick:t[0]||(t[0]=t=>{e.search="",e.$refs.searchField.focus()})},{default:(0,l.w5)((()=>[(0,l.Wm)(d,{class:"text-body2"},{default:(0,l.w5)((()=>[(0,l.Uk)("Reset search ")])),_:1})])),_:1})):(0,l.kq)("",!0)])),_:2},[""==e.search?{name:"prepend",fn:(0,l.w5)((()=>[(0,l.Wm)(c,{name:"search",size:"xs"})])),key:"0"}:void 0]),1032,["modelValue"]),(0,l._)("div",null,[(0,l.Wm)(r,{class:(0,s.C_)(["q-ml-xs",{"bg-blue-grey-8":e.Dark.isActive}]),dense:"",rounded:"",icon:"select_all","no-caps":"",onClick:e.showSelected},{default:(0,l.w5)((()=>[(0,l.Wm)(d,{class:"text-body2"},{default:(0,l.w5)((()=>[(0,l.Uk)("Show selected ")])),_:1})])),_:1},8,["class","onClick"]),(0,l.Wm)(r,{class:(0,s.C_)(["q-ml-xs",{"bg-blue-grey-8":e.Dark.isActive}]),dense:"",rounded:"",icon:"deselect","no-caps":"",onClick:e.deselectAll},{default:(0,l.w5)((()=>[(0,l.Wm)(d,{class:"text-body2"},{default:(0,l.w5)((()=>[(0,l.Uk)("Deselect all")])),_:1})])),_:1},8,["class","onClick"]),!1!==e.data.multimode?((0,l.wg)(),(0,l.j4)(r,{key:0,class:(0,s.C_)(["q-ml-xs",{"bg-blue-grey-8":e.Dark.isActive}]),dense:"",rounded:"",icon:e.singleMode?"looks_one":"grain","no-caps":"",onClick:e.switchMode},{default:(0,l.w5)((()=>[(0,l.Wm)(d,{class:"text-body2"},{default:(0,l.w5)((()=>[(0,l.Uk)("Multi-single select mode ")])),_:1})])),_:1},8,["class","icon","onClick"])):(0,l.kq)("",!0),e.editable?((0,l.wg)(),(0,l.j4)(r,{key:1,class:(0,s.C_)(["q-ml-xs",{"bg-blue-grey-8":e.Dark.isActive}]),dense:"",rounded:"",icon:e.data.editing?"cancel":"edit","no-caps":"",onClick:e.switchEdit},{default:(0,l.w5)((()=>[(0,l.Wm)(d,{class:"text-body2"},{default:(0,l.w5)((()=>[(0,l.Uk)("Edit mode")])),_:1})])),_:1},8,["class","icon","onClick"])):(0,l.kq)("",!0),e.editable&&"append"in e.data?((0,l.wg)(),(0,l.j4)(r,{key:2,class:(0,s.C_)(["q-ml-xs",{"bg-blue-grey-8":e.Dark.isActive}]),dense:"",rounded:"",icon:"add","no-caps":"",onClick:e.append},{default:(0,l.w5)((()=>[(0,l.Wm)(d,{class:"text-body2"},{default:(0,l.w5)((()=>[(0,l.Uk)((0,s.zw)(e.data.filter?"Add a new entity+link":"Add a new row"),1)])),_:1})])),_:1},8,["class","onClick"])):(0,l.kq)("",!0),"delete"in e.data?((0,l.wg)(),(0,l.j4)(r,{key:3,class:(0,s.C_)(["q-ml-xs",{"bg-blue-grey-8":e.Dark.isActive}]),dense:"",rounded:"",icon:"delete_forever","no-caps":"",onClick:e.delSelected},{default:(0,l.w5)((()=>[(0,l.Wm)(d,{class:"text-body2"},{default:(0,l.w5)((()=>[(0,l.Uk)("Delete selected ")])),_:1})])),_:1},8,["class","onClick"])):(0,l.kq)("",!0),"view"in e.data?((0,l.wg)(),(0,l.j4)(r,{key:4,class:(0,s.C_)(["q-ml-xs",{"bg-blue-grey-8":e.Dark.isActive}]),dense:"",rounded:"",icon:"insights","no-caps":"",onClick:e.chart},{default:(0,l.w5)((()=>[(0,l.Wm)(d,{class:"text-body2"},{default:(0,l.w5)((()=>[(0,l.Uk)("Draw the chart")])),_:1})])),_:1},8,["class","onClick"])):(0,l.kq)("",!0)])])])):(0,l.kq)("",!0)])),header:(0,l.w5)((t=>[(0,l.Wm)(p,{props:t},{default:(0,l.w5)((()=>[((0,l.wg)(!0),(0,l.iD)(l.HY,null,(0,l.Ko)(t.cols,(a=>((0,l.wg)(),(0,l.j4)(u,{class:(0,s.C_)(["text-italic",{"text-grey-9":!e.Dark.isActive,"text-teal-3":e.Dark.isActive}]),key:a.name,props:t},{default:(0,l.w5)((()=>[(0,l.Uk)((0,s.zw)(a.label),1)])),_:2},1032,["class","props"])))),128))])),_:2},1032,["props"])])),body:(0,l.w5)((t=>[(0,l.Wm)(p,{props:t,onClick:e=>t.selected=!t.selected},{default:(0,l.w5)((()=>[((0,l.wg)(!0),(0,l.iD)(l.HY,null,(0,l.Ko)(e.columns,((a,i)=>((0,l.wg)(),(0,l.j4)(f,{key:a.name,props:t},{default:(0,l.w5)((()=>["boolean"==typeof t.row[a.name]?((0,l.wg)(),(0,l.j4)(g,{key:0,modelValue:t.row[a.name],"onUpdate:modelValue":[e=>t.row[a.name]=e,l=>e.change_switcher(t.row,a.name,i)],dense:"",disable:!e.data.editing},null,8,["modelValue","onUpdate:modelValue","disable"])):e.data.editing&&"complete"in e.data&&i==e.cedit&&e.redit==t.row.iiid?((0,l.wg)(),(0,l.j4)(m,{key:1,dense:"","model-value":t.row[a.name],"use-input":"","hide-selected":"","fill-input":"",autofocus:"",outlined:"",borderless:"",onInputValue:e.change,"hide-dropdown-icon":"","input-debounce":"0",options:e.options,onKeydown:e.keyInput,onFilter:e.complete},null,8,["model-value","onInputValue","options","onKeydown","onFilter"])):e.data.editing&&i==e.cedit&&e.redit==t.row.iiid?((0,l.wg)(),(0,l.j4)(h,{key:2,modelValue:t.row[a.name],"onUpdate:modelValue":[e=>t.row[a.name]=e,e.change],dense:"",onKeydown:e.keyInput,autofocus:""},null,8,["modelValue","onUpdate:modelValue","onKeydown"])):void 0==t.row[a.name]?((0,l.wg)(),(0,l.iD)("div",{key:3,onClick:a=>e.select(t.row,i)},"-- ",8,$e)):((0,l.wg)(),(0,l.iD)("div",{key:4,onClick:a=>e.select(t.row,i)},(0,s.zw)(t.row[a.name]),9,Ze))])),_:2},1032,["props"])))),128))])),_:2},1032,["props","onClick"])])),_:1},8,["dense","style","filter","title","rows","columns","selection","selected"])}var Me=a(1959),We=a(9058);function Ne(e,t){return e.length===t.length&&e.every(((e,a)=>t[a]&&e.iiid==t[a].iiid))}let Ve="✘";function He(e,t){let a=[];const l=e.headers,s=l.length,i=t.length;for(var n=0;n<i;n++){const i={},d=t[n];for(var o=0;o<s;o++)null!=d[o]&&void 0!=d[o]&&(i[l[o]]=d[o]);let r=d.length;i.iiid=s<r||e.id?d[r-1]:n,a.push(i)}return a}function Ke(e,t){let a=[],{limit:l,length:s,data:i}=t.rows;//!! занести в update init?
|
2
|
-
s&&a.splice(0,0,...He(t,i)),a.length=s,a=(0,Me.qj)(a);let n=[];function o(l,s){switch(l.type){case"update":a[l.index]=l.data;break;case"updates":if(l.data){let e=l.data.length;a.splice(l.index,e,...He(t,l.data))}let i=n.indexOf(s.value);-1!=i&&n.splice(i,1),n.length&&z(e,t.name,n[n.length-1],o,"get");break;case"delete":this.length--,a.splice(l.index,1);break;case"add":a[this.length]=He(t,[l.data])[0],this.length++;break;case"adds":a.splice(l.index,0,...He(t,l.data)),this.length+=l.data.length}}function d(a){-1==n.indexOf(a)&&(n.length>5&&n.splice(0,1),n.push(a),1==n.length&&z(e,t.name,a,o,"get"))}let r=new Proxy(a,{get(e,t,a){if("slice"===t)return function(...a){a[0];let s=a[1];if(s>0){let a=(t/l|0)*l;for(;a<=s;a+=l)e[a]||d(a)}return Array.prototype.slice.apply(e,a)};if(e[t]||isNaN(t))return e[t];{let e=(t/l|0)*l;return void d(e)}}});return r}const Fe=(0,l.aZ)({name:"utable",setup(e){const{data:t,pdata:a}=(0,Me.BK)(e);let s=(0,l.Fl)((()=>{let e=t.value;return e.id?Ke(a.value.name,e):He(e,e.rows)})),i=()=>{let e=t.value,a=null===e.value||0==s.value.length?[]:Array.isArray(e.value)?s.value.filter((t=>e.value.includes(t.iiid))):s.value.filter((t=>e.value==t.iiid));return a},n=i(),o=(0,Me.iH)(n),d=(0,Me.iH)(n),r=(0,Me.iH)(!Array.isArray(t.value.value)),c=(e,l)=>{_([a.value.name,t.value.name,e,l])},h=(0,l.Fl)((()=>t.value.value));return(0,l.YP)(s,((e,t)=>{d.value=i(),o.value=d.value})),(0,l.YP)(t,((e,a)=>{m&&console.log("data update",a.name),d.value=i(),o.value=d.value,r.value=!Array.isArray(t.value.value)})),{rows:s,selected:d,singleMode:r,sendMessage:c,datavalue:h,updated:o}},data(){return{Dark:We.Z,search:"",options:[],prevSelectedId:void 0,cedit:null}},methods:{switchFilter(){let e=this.data;e.filter=!e.filter,this.sendMessage("filter",e.filter)},currentStyle(){let e=this.data.tablerect;if(e){let t=e.width,a=e.height;return`width: ${t}px; height: ${a}px`}return null},select(e,t){if(this.data.editing){let a=this.headers[t];"ID"!=a&&"ⓇID"!=a&&(this.cedit=t,m&&console.log("selected",e.iiid,this.cedit))}},change_switcher(e,t,a){if(console.log(e,t,a,e[t]),this.data.editing){let l=this.data.headers.indexOf(t);this.cedit=a,e[t]=!e[t],this.sendMessage("modify",{value:e[t],id:e.iiid,name:t,delta:this.rows.indexOf(e),cell:l})}},change(e){let t=this.headers[this.cedit],a=this.data.headers.indexOf(t);if(m&&console.log("changed",t,e),this.data.editing&&this.selected.length){const l=this.selected[0];l[t]=e;let s=this.rows.indexOf(l);s<0&&console.log("Losted row in rows!"),this.sendMessage("modify",{value:e,delta:s,name:t,id:l.iiid,cell:a})}},keyInput(e){if("Control"==e.key)return;let t=!1;switch(e.key){case"Enter":"update"in this.data&&this.sendMessage("update",[this.rows[this.redit][this.headers[this.cedit]],[this.redit,this.cedit]]),t=!0;case"ArrowRight":if(e.ctrlKey||t)for(let e=this.cedit+1;e<this.headers.length;){let t=this.headers[e],a=this.selected[0][t],l=typeof a;if("boolean"!=l&&"ⓇID"!=t&&"ID"!=t){this.cedit=e;break}}break;case"Escape":this.switchEdit();break;case"ArrowLeft":if(e.ctrlKey)for(let e=this.cedit-1;e>=0;e--){let t=this.headers[e],a=typeof this.selected[0][t];if("boolean"!=a&&"ⓇID"!=t&&"ID"!=t){this.cedit=e;break}}break;case"ArrowUp":if(e.ctrlKey&&this.redit>0){let e=this.redit-1,t=this.data,a=typeof t.rows[e][this.cedit];"string"!=a&&"number"!=a||(t.value=e),this.selected=[this.rows[e]]}break;case"ArrowDown":if(e.ctrlKey&&this.redit+1<this.rows.length){let e=this.redit+1,t=this.data,a=typeof t.rows[e][this.cedit];"string"!=a&&"number"!=a||(t.value=e),this.selected=[this.rows[e]]}break}},complete(e,t,a){D(this,[e,[this.redit,this.cedit]],(e=>t((()=>{this.options=e}))))},append(){let e=this.rows,t=e.length,a=this;"append"in this.data&&D(this,this.search,(function(l){if(!Array.isArray(l))return h.error(l);m&&console.log("added row",l),a.search="",l=He(a.data,[l])[0],e.push(l),setTimeout((()=>{let e=a.rows;a.selected=[e[t]],a.showSelected(),a.data.editing||a.switchEdit(),a.select(e[t],0)}),100)}),"append")},showSelected(){if(this.selected.length){let e=this.$refs.table,t=this.rows,a=this.selected[0];if(void 0!=this.prevSelectedId){let e=this.selected.findIndex((e=>(null===e||void 0===e?void 0:e.iiid)==this.prevSelectedId));-1!=e&&(++e>=this.selected.length&&(e=0),a=this.selected[e])}let s=a.iiid;this.prevSelectedId=s;let i=Object.keys(t).find((e=>{var a;return(null===(a=t[e])||void 0===a?void 0:a.iiid)===s}));e.scrollTo(i),(0,l.Y3)((()=>{requestAnimationFrame((()=>{requestAnimationFrame((()=>{requestAnimationFrame((()=>{requestAnimationFrame((()=>{requestAnimationFrame((()=>{requestAnimationFrame((()=>{e.scrollTo(i)}))}))}))}))}))}))}))}},deselectAll(){this.selected=[],this.sendMessage("changed",this.value)},chart(){let e=this.data;e.type="chart",e.tablerect=this.$refs.table.$el.getBoundingClientRect(),k[this.fullname].styleSize=this.currentStyle()},switchMode(){this.singleMode=!this.singleMode,this.singleMode&&this.selected.length>1&&this.selected.splice(1)},switchEdit(){let e=this.data;e.editing=!e.editing,this.sendMessage("editing",this.data.editing)},delSelected(){if(!this.selected.length)return void h.error("Rows are not selected!");this.sendMessage("delete",this.value);let e=this.rows;if(this.singleMode){let t=this.selected[0].iiid;this.data.id&&(t=e.findIndex((e=>e.iiid==t))),this.selected=[],e.splice(t,1)}else{this.selected.length>1&&this.selected.sort(((e,t)=>t.iiid-e.iiid));let t=this.selected.map((e=>e.iiid));this.selected=[];for(let a of t)e.splice(a,1)}}},watch:{selected(e){const t=this.data;Ne(this.updated,this.selected)||(this.sendMessage("changed",this.value),this.updated=this.selected),t.show&&(this.showSelected(),t.show=!1)},search(e){this.data.id&&this.sendMessage("search",e)}},computed:{fullname(){return`${this.data.name}@${this.pdata.name}`},redit(){return this.data.editing&&this.selected.length?this.selected[0].iiid:null},editable(){return 0!=this.data["edit"]},value(){let e=this.selected.map((e=>this.rows.findIndex((t=>t.iiid===e.iiid))));return-1!=e.indexOf(-1)&&console.error("selected row in a table did not found!"),this.singleMode?1==e.length?e[0]:null:e},name(){return"_"==this.data.name?"":this.data.name},headers(){let e=this.data;return e.headers.filter((e=>!e.startsWith(Ve)))},columns(){let e=!this.data.id;return this.headers.map((t=>({name:t,label:t,align:"left",sortable:e,field:t})))}},props:{data:Object,pdata:Object,styleSize:String}});var Qe=a(9267),Ue=a(2165),Re=a(8870),Te=a(4842),Ie=a(8186),Pe=a(2414),Le=a(3884),Be=a(5735),Ye=a(7208);const Ge=(0,F.Z)(Fe,[["render",Oe]]),Je=Ge;function Xe(e,t,a,i,n,o){return(0,l.wg)(),(0,l.iD)("div",{ref:"graph",style:(0,s.j5)(a.styleSize),id:"graph"},null,4)}P()(Fe,"components",{QTable:Qe.Z,QBtn:Ue.Z,QTooltip:Re.Z,QInput:Te.Z,QIcon:R.Z,QTr:Ie.Z,QTh:Pe.Z,QTd:Le.Z,QCheckbox:Be.Z,QSelect:Ye.Z});var et=a(130),tt=a.n(et),at=a(309);var lt=a(5154),st=a.n(lt),it=a(4150),nt=a.n(it);let ot="#091159",dt={hideEdgesOnMove:!1,hideLabelsOnMove:!1,renderLabels:!0,renderEdgeLabels:!0,enableEdgeClickEvents:!0,enableEdgeWheelEvents:!1,enableEdgeHoverEvents:!0,enableEdgeHovering:!0,allowInvalidContainer:!0,enableEdgeClickEvents:!0,enableEdgeHoverEvents:!0,defaultNodeColor:"#FCA072",defaultNodeType:"circle",defaultEdgeColor:"#888",defaultEdgeType:"arrow",labelFont:"Arial",labelSize:14,labelWeight:"normal",labelColor:{color:"#00838F",attribute:"#000"},edgeLabelFont:"Arial",edgeLabelSize:14,edgeLabelWeight:"normal",edgeLabelColor:{attribute:"color"},stagePadding:30,labelDensity:1,labelGridCellSize:100,labelRenderedSizeThreshold:6,animationsTime:1e3,borderSize:2,outerBorderSize:3,defaultNodeOuterBorderColor:"rgb(236, 81, 72)",edgeHoverHighlightNodes:"circle",sideMargin:1,edgeHoverColor:"edge",defaultEdgeHoverColor:"#062646",edgeHoverSizeRatio:1,edgeHoverExtremities:!0,scalingMode:"outside"};const rt={name:"sgraph",props:{data:{type:Object,required:!0},pdata:{type:Object,required:!0},styleSize:String},data(){return{Dark:We.Z,s:null,state:{searchQuery:""},selectedNodes:[],selectedEdges:[],graph:null,fa2start:null,fa2stop:null,fa2run:null}},methods:{sendMessage(e,t){_([this.pdata["name"],this.data["name"],e,t])},refresh(){let e=this.graph();const t=nt().inferSettings(e);let a=new(st())(e,{settings:t});m&&console.log("refresh graph",this.data.name,this.pdata.name),a.isRunning()||(a.start(),setTimeout((function(){a.stop()}),1e3))},setSelectedEdges(e){this.s.selectEdges(e)},setSearchQuery(e){if(e){const t=e.toLowerCase(),a=this.graph().nodes().map((e=>({id:e,label:graph.getNodeAttribute(e,"label")}))).filter((({label:e})=>e.toLowerCase().includes(t)));if(1===a.length&&a[0].label===e){this.state.selectedNode=a[0].id,this.state.suggestions=void 0;const e=this.s.getNodeDisplayData(this.state.selectedNode);this.s.getCamera().animate(e,{duration:500})}else this.state.selectedNode=void 0,this.state.suggestions=new Set(a.map((({id:e})=>e)))}else this.state.selectedNode=void 0,this.state.suggestions=void 0;this.s.refresh()},load(e){let t=e.value;this.selectedNodes=t.nodes?t.nodes.map((e=>String(e))):[],this.selectedEdges=t.edges?t.edges.map((e=>String(e))):[];let a=e.sizing,l=e.nodes,s=this.graph(),i=[],n=[],o=new Map;for(let h=0;h<l.length;h++){if(!l[h])continue;let e=Object.assign({},l[h]);void 0==e.id&&(e.id=h),void 0!=e.name&&(e.label=e.name);let t={key:String(e.id),attributes:e};e.size=e.size?e.size:10,i.push(t),o.set(e.id,h);let a=s._nodes.get(t.key);a?(e.x=a.attributes.x,e.y=a.attributes.y):(e.x=Math.random(),e.y=Math.random()),this.selectedNodes.includes(t.key)&&(e.highlighted=!0)}let d=[],r=new Map,c=Array(i.length).fill(0);for(let h=0;h<e.edges.length;h++){let t=Object.assign({},e.edges[h]),l=o.get(t.source),s=o.get(t.target);if(void 0==l||void 0==s)continue;if(void 0==t.id&&(t.id=h),t.name&&(t.label=t.name),t.key=String(t.id),n.push(t),a){"in"!=a&&(s=o.get(t.source),l=o.get(t.target)),c[s]++,r.has(s)?r.get(s).push(l):r.set(s,[l]);let e=d.indexOf(l),i=d.indexOf(s);if(-1==e&&(e=d.length,d.push(l)),-1==i&&(i=d.length,d.push(s)),i<e){let t=d[e];d[e]=d[i],d[i]=t}}let i=t.attributes;i||(i={},t.attributes=i),i.id=t.id,i.size=t.size?t.size:5,this.selectedEdges.includes(t.key)?(i.ocolor=i.color?i.color:dt.defaultEdgeColor,i.color=ot):t.color&&(i.color=t.color),t.label&&(i.label=t.label)}if(a)for(let h=0;h<d.length;h++){let e=d[h];if(r.has(e))for(let t of r.get(e))c[e]+=c[t];i[e].attributes.size=10+c[e]}s.clear(),s.import({nodes:i,edges:n}),this.refresh()}},computed:{value(){let e=this.graph(),t=this.selectedNodes.map((t=>e._nodes.get(t).attributes.id)),a=this.selectedEdges.map((t=>e._edges.get(t).attributes.id));return{nodes:t,edges:a}}},watch:{data:{handler(e,t){m&&console.log("data update",this.data.name,this.pdata.name),this.load(e)},deep:!0},"Dark.isActive":function(e){this.s.settings.labelColor.color=e?"#00838F":"#000",this.s.refresh()}},updated(){this.s.refresh(),m&&console.log("updated",this.data.name,this.pdata.name)},mounted(){let e=new at.MultiDirectedGraph;this.graph=()=>e;let t=this.$refs.graph;this.s=new(tt())(e,t,dt);let a=this.s;var l=this;function s(t){t?l.state.hoveredNeighbors=new Set(e.neighbors(t)):(l.state.hoveredNode=void 0,l.state.hoveredNeighbors=void 0),a.refresh()}function i(t,a=ot){let l=e.getEdgeAttributes(t);l.color!=a&&(l.ocolor||(l.ocolor=l.color?l.color:dt.defaultEdgeColor),e.setEdgeAttribute(t,"color",a))}function n(t,a=ot){let l=e.getEdgeAttributes(t);if(l.color==a){let a=e.getEdgeAttribute(t,"ocolor");e.setEdgeAttribute(t,"color",a)}}this.s.settings.labelColor.color=We.Z.isActive?"#00838F":"#000",a.on("clickNode",(function(t){let s=t.node;if(!h.shiftKey){for(let e of l.selectedEdges)n(e);l.selectedEdges=[]}if(l.selectedNodes.includes(s))if(e.setNodeAttribute(s,"highlighted",!1),h.shiftKey){let e=l.selectedNodes.indexOf(s);-1!=e&&l.selectedNodes.array.splice(e,1)}else l.selectedNodes=[];else{if(!h.shiftKey&&l.selectedNodes.length>0){for(let t of l.selectedNodes)e.setNodeAttribute(t,"highlighted",!1);l.selectedNodes=[]}e.setNodeAttribute(s,"highlighted",!0),l.selectedNodes.push(s)}a.refresh(),l.sendMessage("changed",l.value)})),a.on("clickEdge",(function({edge:t}){if(!h.shiftKey){for(let t of l.selectedNodes)e.setNodeAttribute(t,"highlighted",!1);l.selectedNodes=[]}if(l.selectedEdges.includes(t))if(n(t),h.shiftKey){let e=l.selectedEdges.indexOf(t);-1!=e&&l.selectedEdges.array.splice(e,1)}else l.selectedEdges=[];else{if(!h.shiftKey&&l.selectedEdges.length>0){for(let e of l.selectedEdges)n(e);l.selectedEdges=[]}i(t),l.selectedEdges.push(t)}a.refresh(),l.sendMessage("changed",l.value)})),a.on("enterNode",(function({node:t}){for(let a of e.edgeEntries())a.target==t?i(a.edge,"#808000"):a.source==t&&i(a.edge,"#2F4F4F");s(t)})),a.on("leaveNode",(function({node:t}){for(let a of e.edgeEntries())a.target==t?l.selectedEdges.includes(a.edge)?e.setEdgeAttribute(a.edge,"color",ot):n(a.edge,"#808000"):a.source==t&&(l.selectedEdges.includes(a.edge)?e.setEdgeAttribute(a.edge,"color",ot):n(a.edge,"#2F4F4F"));s(void 0)})),a.on("enterEdge",(function({edge:e}){l.selectedEdges.includes(e)||i(e)})),a.on("leaveEdge",(function({edge:e}){l.selectedEdges.includes(e)||n(e)}));const o=new ResizeObserver((e=>a.refresh()));o.observe(t);let d=null,r=!1;a.on("downNode",(t=>{r=!0,d=t.node,e.setNodeAttribute(d,"highlighted",!0)})),a.getMouseCaptor().on("mousemovebody",(t=>{if(!r||!d)return;const l=a.viewportToGraph(t);e.setNodeAttribute(d,"x",l.x),e.setNodeAttribute(d,"y",l.y),t.preventSigmaDefault(),t.original.preventDefault(),t.original.stopPropagation()})),a.getMouseCaptor().on("mouseup",(()=>{d&&e.removeNodeAttribute(d,"highlighted"),r=!1,d=null})),a.getMouseCaptor().on("mousedown",(()=>{a.getCustomBBox()||a.setCustomBBox(a.getBBox())})),this.load(this.data)}},ct=(0,F.Z)(rt,[["render",Xe]]),ht=ct;function ut(e,t,a,i,n,o){const d=(0,l.up)("v-chart");return(0,l.wg)(),(0,l.iD)("div",{style:(0,s.j5)(a.styleSize?a.styleSize:o.currentStyle())},[(0,l.Wm)(d,{ref:"chart","manual-update":!0,onClick:o.clicked,autoresize:!0},null,8,["onClick"])],4)}var pt=a(9642),gt=a(6938),mt=a(1006),ft=a(6080),yt=a(3526),wt=a(763),bt=a(546),vt=a(6902),kt=a(2826),xt=a(5256),Ct=a(3825),_t=a(8825);(0,wt.D)([gt.N,mt.N,yt.N,ft.N]),(0,wt.D)([bt.N,vt.N,kt.N,xt.N,Ct.N]);let At=["","#80FFA5","#00DDFF","#37A2FF","#FF0087","#FFBF00","rgba(128, 255, 165)","rgba(77, 119, 255)"];const qt={name:"linechart",components:{VChart:pt.ZP},props:{data:Object,pdata:Object,styleSize:String},data(){const e=(0,_t.Z)();return{$q:e,model:!1,animation:null,markPoint:null,options:{responsive:!0,maintainAspectRatio:!1,legend:{data:[],bottom:10,textStyle:{color:"#4DD0E1"}},tooltip:{trigger:"axis",position:function(e){return[e[0],"10%"]}},title:{left:"center",text:""},toolbox:{feature:{}},xAxis:{type:"category",boundaryGap:!1,data:null},yAxis:{type:"value",boundaryGap:[0,"100%"]},dataZoom:[{type:"inside",start:0,end:10},{start:0,end:10}],series:[]}}},computed:{fullname(){return`${this.data.name}@${this.pdata.name}`}},methods:{setOptions(){this.$refs.chart.setOption(this.options)},currentStyle(){let e=this.data.tablerect,t=e?e.width:300,a=e?e.height:200;return`width: ${t}px; height: ${a}px`},processCoord(e,t,a){let l=null;for(let s of t)if(e[0]==s.coord[0]){l=s;break}a?l?t.splice(t.indexOf(l),1):t.push({coord:e}):(t.splice(0,t.length),l||t.push({coord:e}))},clicked(e){let t=[e.dataIndex,this.options.series[e.seriesIndex].data[e.dataIndex]];this.processCoord(t,this.markPoint.data,h.shiftKey);let a=this.markPoint.data.map((e=>e.coord[0])),l=this.data;if(l.value=Array.isArray(l.value)||a.length>1?a:a.length?a[0]:null,this.animation){let e=this.options.dataZoom;e[0].start=this.animation.start,e[1].start=this.animation.start,e[0].end=this.animation.end,e[1].end=this.animation.end}this.setOptions(),_([this.pdata.name,this.data.name,"changed",this.data.value])},calcSeries(){this.options.toolbox.feature.mySwitcher={show:!0,title:"Switch view to the table",icon:"image:M0 2a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V2zm15 2h-4v3h4V4zm0 4h-4v3h4V8zm0 4h-4v3h3a1 1 0 0 0 1-1v-2zm-5 3v-3H6v3h4zm-5 0v-3H1v2a1 1 0 0 0 1 1h3zm-4-4h4V8H1v3zm0-4h4V4H1v3zm5-3v3h4V4H6zm4 4H6v3h4V8z",onclick:()=>{let e=this.data;e.type="table",e.tablerect=this.$refs.chart.$el.getBoundingClientRect(),k[this.fullname].styleSize=this.currentStyle()}};let e=this.data.view,t=this.data.headers;"_"!=this.data.name[0]&&(this.options.title.text=this.data.name);let a=e.split("-"),l=a[1].split(",");l.unshift(a[0]);let s=[];for(let n=0;n<l.length;n++)l[n]="i"==l[n]?-1:parseInt(l[n]),s.push([]),n&&(this.options.series.push({name:t[l[n]],type:"line",symbol:"circle",symbolSize:10,sampling:"lttb",itemStyle:{color:At[n]},data:s[n]}),this.options.legend.data.push(t[l[n]]));this.options.xAxis.data=s[0];let i=this.data.rows;for(let n=0;n<i.length;n++)for(let e=0;e<l.length;e++)s[e].push(-1==l[e]?n:i[n][l[e]]);if(this.options.series[1]){let e=[],t=this.options.series[1].data,a=Array.isArray(this.data.value)?this.data.value:null===this.data.value?[]:[this.data.value];for(let l=0;l<a.length;l++)this.processCoord([a[l],t[a[l]]],e,!0);this.markPoint={symbol:"rect",symbolSize:10,animationDuration:300,silent:!0,label:{color:"#fff"},itemStyle:{color:"blue"},data:e},this.options.series[1].markPoint=this.markPoint}this.setOptions()}},mounted(){this.calcSeries();let e=this;this.$refs.chart.chart.on("datazoom",(function(t){(t.start||t.end)&&(e.animation=t)}))}},St=(0,F.Z)(qt,[["render",ut]]),Dt=St;let zt={right:"4px",borderRadius:"7px",backgroundColor:"#027be3",width:"4px",opacity:.75},jt={right:"2px",borderRadius:"9px",backgroundColor:"#027be3",width:"8px",opacity:.2};function Et(e){let t=new FormData;t.append("image",e);let a=new XMLHttpRequest;a.open("POST",b,!0),a.onload=function(){200===this.status?console.log(this.response):console.error(a)},a.send(t)}const $t=(0,l.aZ)({name:"element",components:{utable:Je,sgraph:ht,linechart:Dt},methods:{log(e){console.log(e)},showSelected(){if("tree"==this.type||"list"==this.type){let e=this.value;e&&requestAnimationFrame((()=>{requestAnimationFrame((()=>{let t=this.$refs.tree.$el,a=this.$refs.scroller.$el;for(let l of t.getElementsByTagName("div"))if(l.innerHTML==e){const{bottom:e,height:t,top:s}=l.getBoundingClientRect();if(s){const l=a.getBoundingClientRect();(s<=l.top?l.top-s<=t:e-l.bottom<=t)||this.$refs.scroller.setScrollPosition("vertical",s-l.top);break}}}))}))}},onAdded(e){0!==e.length&&(0!==this.fileArr.length?(this.$refs.uploaderRef.removeFile(this.fileArr[0]),this.fileArr.splice(0,1,e[0])):this.fileArr.push(e[0]))},sendMessage(e,t){_([this.pdata["name"],this.data["name"],e,t])},pressedEnter(){"update"in this.data&&this.sendMessage("update",this.value)},updateDom(e){let t=e.files.length;t&&this.sendMessage("changed",e.xhr.responseText)},sendValue(){this.sendMessage("changed",this.value)},switchValue(){this.value=!this.value},setValue(e){this.value=e},complete(e,t,a){D(this,e,(e=>t((()=>{this.options=e}))))},lens(){h.lens(this.data)},toggleCamera(){this.isCameraOpen?(this.isCameraOpen=!1,this.isPhotoTaken=!1,this.isShotPhoto=!1,this.stopCameraStream()):(this.isCameraOpen=!0,this.createCameraElement())},createCameraElement(){this.isLoading=!0;const e=window.constraints={audio:!1,video:!0};navigator.mediaDevices.getUserMedia(e).then((e=>{this.isLoading=!1,this.$refs.camera.srcObject=e})).catch((e=>{this.isLoading=!1,alert("May the browser didn't support or there are some errors.")}))},stopCameraStream(){let e=this.$refs.camera.srcObject.getTracks();e.forEach((e=>{e.stop()}))},takePhoto(){if(!this.isPhotoTaken){this.isShotPhoto=!0;const e=50;setTimeout((()=>{this.isShotPhoto=!1}),e)}this.isPhotoTaken=!this.isPhotoTaken;const e=this.$refs.canvas.getContext("2d");e.drawImage(this.$refs.camera,0,0,450,337.5)},downloadImage(){document.getElementById("downloadPhoto"),document.getElementById("photoTaken").toBlob(Et,"image/jpeg")},rect(){let e="clientHeight"in this.$el?this.$el:this.$el.nextElementSibling;return e.getBoundingClientRect()},geom(){let e=this.type,t=this.$el;t="tree"==e||"list"==e?t.querySelector(".scroll"):"clientHeight"in t?t:t.nextElementSibling,t||(t=this.$el.previousElementSibling,t="clientHeight"in t?t:t.nextElementSibling);const a="text"==e||"graph"==e||"chart"==e?t:t.querySelector("table"==e?".scroll":".q-tree"),l=t.getBoundingClientRect();return{el:t,inner:a,left:l.left,right:l.right,top:l.top,bottom:l.bottom,scrollHeight:a.scrollHeight,scrollWidth:a.scrollWidth}}},updated(){k[this.fullname]=this,this.showSelected(),m&&console.log("updated",this.fullname)},mounted(){k[this.fullname]=this,this.data.focus&&this.$refs.inputRef.$el.focus(),this.showSelected(),m&&console.log("mounted",this.fullname)},data(){return{Dark:We.Z,value:this.data.value,styleSize:A?S(this):null,has_recalc:!0,host_path:b,options:[],expandedKeys:[],thumbStyle:zt,barStyle:jt,updated:"#027be3sds",isCameraOpen:!1,isPhotoTaken:!1,isShotPhoto:!1,isLoading:!1,link:"#",fileArr:[]}},computed:{elemSize(){let e="";return this.data.width&&(e=`width:${this.data.width}px`),this.data.height&&(""!=e&&(e+="; "),e+=`height:${this.data.height}px`),""==e?this.styleSize:e},parent_name(){return this.pdata?this.pdata.name:null},name(){return this.data.name},fullname(){return`${this.data.name}@${this.pdata.name}`},showname(){let e=this.data.name;return e&&"_"!=e[0]},name2show(){let e=this.data.name;return e&&"_"!=e[0]?e:""},nameLabel(){return this.data.label?this.data.label:"_"!=this.data.name[0]?this.data.name:""},text(){return this.data.text},expanding(){return y.includes(this.type)},expanding_width(){return!this.data.width&&this.expanding},expanding_height(){return!this.data.height&&this.expanding},selection(){return this.data.selection},icon(){return this.data.icon},type(){return this.data.type},treeNodes(){var e=[];if("list"==this.type)return this.data.options.map((e=>({label:e,children:[]})));var t={};for(const[s,i]of Object.entries(this.data.options)){var a=t[s];if(a||(a={label:s,children:[]},t[s]=a),i){var l=t[i];l||(l={label:i,children:[]},t[i]=l),l.children.push(a)}else e.push(a)}return e}},props:{data:{type:Object,required:!0},pdata:{type:Object,required:!0}},watch:{value(e,t){"tree"!=this.type&&"list"!=this.type||(this.data.options[e]==t&&this.expandedKeys.indexOf(t)<0&&this.expandedKeys.push(t),this.showSelected()),e!==this.updated&&(m&&console.log("value changed",e,t),this.sendValue(),this.updated=e)},selection(e){m&&console.log("selection changed",e,this.$refs.inputRef),Array.isArray(e)||(e=[0,0]);let t=this.$refs.inputRef.$el;t.focus();let a=t.getElementsByTagName("textarea");0==a.length&&(a=t.getElementsByTagName("input")),a[0].setSelectionRange(e[0],e[1])},data(e,t){m&&console.log("data update",this.fullname,t.name),this.styleSize||(this.styleSize=null),h.screen.reload&&"tree"==this.type&&this.$refs.tree&&this.$refs.tree.expandAll(),this.value=this.data.value,this.updated=this.value,k[this.fullname]=this}}});var Zt=a(4027),Ot=a(8886),Mt=a(9721),Wt=a(2064),Nt=a(8761),Vt=a(7704),Ht=a(5551),Kt=a(5869),Ft=a(1745),Qt=a(8506);const Ut=(0,F.Z)($t,[["render",De],["__scopeId","data-v-6eb6b02a"]]),Rt=Ut;P()($t,"components",{QImg:Zt.Z,QIcon:R.Z,QSelect:Ye.Z,QCheckbox:Be.Z,QToggle:Ot.Z,QBadge:Mt.Z,QSlider:Wt.Z,QBtn:Ue.Z,QBtnToggle:Nt.Z,QInput:Te.Z,QScrollArea:Vt.Z,QTree:Ht.Z,QSeparator:Kt.Z,QUploader:Ft.Z,QTooltip:Re.Z,QSpinnerIos:Qt.Z});const Tt=(0,l.aZ)({name:"block",components:{element:Rt},data(){return{Dark:We.Z,styleSize:null,thumbStyle:{right:"4px",borderRadius:"7px",backgroundColor:"#027be3",width:"4px",opacity:.75},barStyle:{right:"2px",borderRadius:"9px",backgroundColor:"#027be3",width:"8px",opacity:.2}}},methods:{log(){console.log(Object.keys(v).length,this.name,this.$el.getBoundingClientRect())},geom(){let e="clientHeight"in this.$el?this.$el:this.$el.nextElementSibling,t=e.querySelector(".q-scrollarea");t||(t=e);const a=t.getBoundingClientRect();return{el:e,inner:t,left:a.left,right:a.right,top:a.top,bottom:a.bottom,scrollHeight:window.innerHeight,scrollWidth:window.innerWidth}},free_right_delta4(e,t){for(let a of this.data.value)if(Array.isArray(a)){for(let l of a)if(l==e.data){let l=a[a.length-1];return l==e.data?t:f.includes(l.type)?0:k[`${l.name}@${this.name}`].$el.getBoundingClientRect().right}}else if(a===e)return t;return 0}},mounted(){v[this.data.name]=this,(this.expanding||this.data.width)&&(k[this.fullname]=this)},computed:{name(){return this.data.name},fullname(){return`${this.data.scroll?"_scroll":"_space"}@${this.name}`},icon(){return this.data.icon},type(){return this.data.type},expanding(){return this.data.scroll},expanding_width(){return this.expanding},name_elements(){if(this.expanding)return[this.fullname];let e=[];for(let t of this.data.value)if(Array.isArray(t))for(let a of t)e.push(`${a.name}@${this.name}`);else e.push(`${t.name}@${this.name}`);return e},hlevelements(){if(this.expanding)return[[k[this.fullname]]];let e=[];for(let t of this.data.value)if(Array.isArray(t)){let a=t.map((e=>k[`${e.name}@${this.name}`])).filter((e=>e.expanding));a.length&&e.push(a)}else{let a=k[`${t.name}@${this.name}`];a.expanding&&e.push([a])}return e},only_fixed_elems(){if(this.data.scroll)return!1;for(let e of this.data.value)if(Array.isArray(e)){for(let t of e)if(y.includes(t.type))return!1}else if(y.includes(e.type))return!1;return!0},expanding_height(){return!this.data.height&&(this.expanding||this.only_fixed_elems)},tops(){let e=this.data.value;return e.length?Array.isArray(e[0])?e[0]:[e[0]]:[]}},props:{data:{type:Object,required:!0}},watch:{data(e){m&&console.log("data update",this.name),v[this.name]=this,this.expanding&&(k[this.fullname]=this)}}});var It=a(151);const Pt=(0,F.Z)(Tt,[["render",ie]]),Lt=Pt;function Bt(){let e=A&&k.size==x.size;if(e)for(let[t,a]of Object.entries(k))if(!x[t]){e=!1;break}e||(N(document.documentElement.scrollWidth>window.innerWidth),(0,l.Y3)((()=>{requestAnimationFrame((()=>{requestAnimationFrame((()=>{h.visible(!0)}))}))})))}P()(Tt,"components",{QCard:It.Z,QIcon:R.Z,QScrollArea:Vt.Z});const Yt=(0,l.aZ)({name:"zone",components:{block:Lt},props:{data:Object},updated(e){(0,l.Y3)((()=>{requestAnimationFrame((()=>{requestAnimationFrame(Bt)}))}))}}),Gt=(0,F.Z)(Yt,[["render",X]]),Jt=Gt,Xt={class:"row q-gutter-sm row-md"};function ea(e,t,a,i,n,o){const d=(0,l.up)("block"),r=(0,l.up)("q-item-label"),c=(0,l.up)("q-space"),h=(0,l.up)("q-btn"),u=(0,l.up)("q-card"),p=(0,l.up)("q-dialog");return(0,l.wg)(),(0,l.j4)(p,{ref:"dialog",onHide:o.onDialogHide,onKeyup:(0,ne.D2)(o.pressedEnter,["enter"])},{default:(0,l.w5)((()=>[(0,l.Wm)(u,{class:"q-dialog-plugin q-pa-md items-start q-gutter-md",bordered:"",style:(0,s.j5)(a.data.internal?"width: 800px; max-width: 80vw;":"")},{default:(0,l.w5)((()=>[a.data?((0,l.wg)(),(0,l.j4)(d,{key:0,data:a.data},null,8,["data"])):(0,l.kq)("",!0),(0,l.Wm)(r,{class:"text-h6"},{default:(0,l.w5)((()=>[(0,l.Uk)((0,s.zw)(a.data.text?a.data.text:""),1)])),_:1}),(0,l._)("div",Xt,[(0,l.Wm)(c),((0,l.wg)(!0),(0,l.iD)(l.HY,null,(0,l.Ko)(a.commands,(e=>((0,l.wg)(),(0,l.j4)(h,{class:"col-md-3",label:e,"no-caps":"",color:a.commands[0]==e?"primary":"secondary",onClick:t=>o.sendMessage(e)},null,8,["label","color","onClick"])))),256))])])),_:1},8,["style"])])),_:1},8,["onHide","onKeyup"])}const ta={props:{data:Object,commands:Array},components:{block:Lt},emits:["ok","hide"],data(){return{closed:!1}},methods:{show(){this.$refs.dialog.show(),h.dialog=this},message4(e){return[this.data["name"],null,"changed",e]},sendMessage(e){this.data.internal||_(this.message4(e)),this.closed=!0,this.hide()},hide(){this.$refs.dialog.hide(),h.dialog=null},onDialogHide(){this.$emit("hide"),this.closed||this.data.internal||_(this.message4(null))},pressedEnter(){this.sendMessage(this.commands[0])},onOKClick(){this.$emit("ok"),this.hide()},onCancelClick(){this.hide()}}};var aa=a(5926),la=a(2025);const sa=(0,F.Z)(ta,[["render",ea]]),ia=sa;P()(ta,"components",{QDialog:aa.Z,QCard:It.Z,QItemLabel:T.Z,QSpace:la.Z,QBtn:Ue.Z});var na=a(589);let oa="theme";try{We.Z.set(na.Z.getItem(oa))}catch(va){}let da=null,ra=["complete","append","get"];const ca=(0,l.aZ)({name:"MainLayout",data(){return{leftDrawerOpen:!1,Dark:We.Z,menu:[],tab:"",tooldata:{name:"toolbar"},localServer:!0,statusConnect:!1,screen:{blocks:[],toolbar:[]},visibility:!0,designCycle:0,shiftKey:!1}},components:{menubar:B,zone:Jt,element:Rt},created(){C(this)},unmounted(){window.removeEventListener("resize",this.onResize)},computed:{left_toolbar(){return this.screen.toolbar.filter((e=>!e.right))},right_toolbar(){return this.screen.toolbar.filter((e=>e.right))}},methods:{switchTheme(){We.Z.set(!We.Z.isActive),na.Z.set(oa,We.Z.isActive)},toggleLeftDrawer(){this.leftDrawerOpen=!this.leftDrawerOpen},tabclick(e){_(["root",null,"changed",e])},visible(e){this.visibility!=e&&(this.$refs.page.$el.style.visibility=e?"":"hidden",this.visibility=e)},handleKeyDown(e){"Shift"==e.key&&(this.shiftKey=!0)},handleKeyUp(e){"Shift"==e.key&&(this.shiftKey=!1)},onResize(e){m&&console.log(`window has been resized w = ${window.innerWidth}, h=${window.innerHeight}`),this.designCycle=0,W()},lens(e){let t={title:"Photo lens",message:e.text,cancel:!0,persistent:!0,component:ia},{height:a,...l}=e;l.width=750;let s={name:`Picture lens of ${e.name}`,value:[[],l],internal:!0};t.componentProps={data:s,commands:["Close"]},this.$q.dialog(t)},notify(e,t){let a=t,l={message:e,type:t,position:"top",icon:a};"progress"==t?null==da?(l={group:!1,timeout:0,spinner:!0,type:"info",message:e||"Progress..",position:"top",color:"secondary"},da=this.$q.notify(l)):null==e?(da(),da=null):(l={caption:e},da(l)):("error"==t&&l.type,this.$q.notify(l))},error(e){this.notify(e,"error")},info(e){this.notify(e,"info")},processMessage(e){if("screen"==e.type)j(),this.screen.name!=e.name?(q(!1),m||this.visible(!1)):e.reload&&q(!1),this.screen=e,this.menu=e.menu.map((e=>({name:e[0],icon:e[1],order:e[2]}))),this.tab=this.screen.name;else if("dialog"==e.type){let t={title:e.name,message:e.text,cancel:!0,persistent:!0};t.component=ia,t.componentProps={data:e,commands:e.commands},this.$q.dialog(t)}else if(ra.includes(e.type))Z(e);else if("action"==e.type&&"close"==e.value)this.dialog&&(this.dialog.data.internal=!0),this.dialog.hide();else{let t=e.updates&&e.updates.length;t&&$(e.updates);let a=!1;["error","progress","warning","info"].includes(e.type)&&(this.notify(e.value,e.type),a=!0),a||t||(this.error("Invalid data came from the server! Look the console."),console.log(`Invalid data came from the server! ${e}`))}this.closeProgress(e)},closeProgress(e){!da||e&&"progress"==e.type||this.notify(null,"progress")}},mounted(){window.addEventListener("resize",this.onResize);const e=new ResizeObserver((e=>{let t=document.documentElement.scrollWidth>window.innerWidth||document.documentElement.scrollHeight>window.innerHeight;t&&M(!1)}));let t=this.$refs.page.$el;e.observe(t),window.addEventListener("keydown",this.handleKeyDown),window.addEventListener("keyup",this.handleKeyUp)},beforeUnmount(){window.removeEventListener("keydown",this.handleKeyDown),window.removeEventListener("keyup",this.handleKeyUp)}});var ha=a(9214),ua=a(3812),pa=a(9570),ga=a(7547),ma=a(3269),fa=a(2652),ya=a(4379);const wa=(0,F.Z)(ca,[["render",o]]),ba=wa;P()(ca,"components",{QLayout:ha.Z,QHeader:ua.Z,QToolbar:pa.Z,QBtn:Ue.Z,QItemLabel:T.Z,QTabs:ga.Z,QTab:ma.Z,QSpace:la.Z,QTooltip:Re.Z,QPageContainer:fa.Z,QPage:ya.Z})}}]);
|
File without changes
|
File without changes
|