@sfgrp/distinguish 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2881 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ import { reactive, toRefs, defineComponent, computed, openBlock, createElementBlock, withDirectives, createElementVNode, isRef, vModelCheckbox, unref, createTextVNode, Fragment, renderList, toDisplayString, vModelSelect, normalizeClass, renderSlot, onMounted, onUnmounted, createBlock, Transition, withCtx, normalizeStyle, withModifiers, ref, createVNode, createCommentVNode, pushScopeId, popScopeId, watch, withKeys, vModelText, resolveDynamicComponent, createApp } from "vue";
21
+ import { defineStore, createPinia } from "pinia";
22
+ const state = reactive({
23
+ baseURL: "",
24
+ projectId: void 0,
25
+ projectToken: void 0,
26
+ userToken: void 0
27
+ });
28
+ const useAPIConfig = () => {
29
+ const updatePreferences = (preferences) => {
30
+ Object.assign(state, preferences);
31
+ };
32
+ return __spreadProps(__spreadValues({}, toRefs(state)), {
33
+ updatePreferences
34
+ });
35
+ };
36
+ var axios$2 = { exports: {} };
37
+ var bind$2 = function bind(fn, thisArg) {
38
+ return function wrap() {
39
+ var args = new Array(arguments.length);
40
+ for (var i = 0; i < args.length; i++) {
41
+ args[i] = arguments[i];
42
+ }
43
+ return fn.apply(thisArg, args);
44
+ };
45
+ };
46
+ var bind$1 = bind$2;
47
+ var toString = Object.prototype.toString;
48
+ var kindOf = function(cache) {
49
+ return function(thing) {
50
+ var str = toString.call(thing);
51
+ return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
52
+ };
53
+ }(/* @__PURE__ */ Object.create(null));
54
+ function kindOfTest(type) {
55
+ type = type.toLowerCase();
56
+ return function isKindOf(thing) {
57
+ return kindOf(thing) === type;
58
+ };
59
+ }
60
+ function isArray(val) {
61
+ return Array.isArray(val);
62
+ }
63
+ function isUndefined(val) {
64
+ return typeof val === "undefined";
65
+ }
66
+ function isBuffer(val) {
67
+ return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && typeof val.constructor.isBuffer === "function" && val.constructor.isBuffer(val);
68
+ }
69
+ var isArrayBuffer = kindOfTest("ArrayBuffer");
70
+ function isArrayBufferView(val) {
71
+ var result;
72
+ if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) {
73
+ result = ArrayBuffer.isView(val);
74
+ } else {
75
+ result = val && val.buffer && isArrayBuffer(val.buffer);
76
+ }
77
+ return result;
78
+ }
79
+ function isString(val) {
80
+ return typeof val === "string";
81
+ }
82
+ function isNumber(val) {
83
+ return typeof val === "number";
84
+ }
85
+ function isObject(val) {
86
+ return val !== null && typeof val === "object";
87
+ }
88
+ function isPlainObject(val) {
89
+ if (kindOf(val) !== "object") {
90
+ return false;
91
+ }
92
+ var prototype2 = Object.getPrototypeOf(val);
93
+ return prototype2 === null || prototype2 === Object.prototype;
94
+ }
95
+ var isDate = kindOfTest("Date");
96
+ var isFile = kindOfTest("File");
97
+ var isBlob = kindOfTest("Blob");
98
+ var isFileList = kindOfTest("FileList");
99
+ function isFunction(val) {
100
+ return toString.call(val) === "[object Function]";
101
+ }
102
+ function isStream(val) {
103
+ return isObject(val) && isFunction(val.pipe);
104
+ }
105
+ function isFormData(thing) {
106
+ var pattern = "[object FormData]";
107
+ return thing && (typeof FormData === "function" && thing instanceof FormData || toString.call(thing) === pattern || isFunction(thing.toString) && thing.toString() === pattern);
108
+ }
109
+ var isURLSearchParams = kindOfTest("URLSearchParams");
110
+ function trim(str) {
111
+ return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g, "");
112
+ }
113
+ function isStandardBrowserEnv() {
114
+ if (typeof navigator !== "undefined" && (navigator.product === "ReactNative" || navigator.product === "NativeScript" || navigator.product === "NS")) {
115
+ return false;
116
+ }
117
+ return typeof window !== "undefined" && typeof document !== "undefined";
118
+ }
119
+ function forEach(obj, fn) {
120
+ if (obj === null || typeof obj === "undefined") {
121
+ return;
122
+ }
123
+ if (typeof obj !== "object") {
124
+ obj = [obj];
125
+ }
126
+ if (isArray(obj)) {
127
+ for (var i = 0, l = obj.length; i < l; i++) {
128
+ fn.call(null, obj[i], i, obj);
129
+ }
130
+ } else {
131
+ for (var key in obj) {
132
+ if (Object.prototype.hasOwnProperty.call(obj, key)) {
133
+ fn.call(null, obj[key], key, obj);
134
+ }
135
+ }
136
+ }
137
+ }
138
+ function merge() {
139
+ var result = {};
140
+ function assignValue(val, key) {
141
+ if (isPlainObject(result[key]) && isPlainObject(val)) {
142
+ result[key] = merge(result[key], val);
143
+ } else if (isPlainObject(val)) {
144
+ result[key] = merge({}, val);
145
+ } else if (isArray(val)) {
146
+ result[key] = val.slice();
147
+ } else {
148
+ result[key] = val;
149
+ }
150
+ }
151
+ for (var i = 0, l = arguments.length; i < l; i++) {
152
+ forEach(arguments[i], assignValue);
153
+ }
154
+ return result;
155
+ }
156
+ function extend(a, b, thisArg) {
157
+ forEach(b, function assignValue(val, key) {
158
+ if (thisArg && typeof val === "function") {
159
+ a[key] = bind$1(val, thisArg);
160
+ } else {
161
+ a[key] = val;
162
+ }
163
+ });
164
+ return a;
165
+ }
166
+ function stripBOM(content) {
167
+ if (content.charCodeAt(0) === 65279) {
168
+ content = content.slice(1);
169
+ }
170
+ return content;
171
+ }
172
+ function inherits(constructor, superConstructor, props, descriptors2) {
173
+ constructor.prototype = Object.create(superConstructor.prototype, descriptors2);
174
+ constructor.prototype.constructor = constructor;
175
+ props && Object.assign(constructor.prototype, props);
176
+ }
177
+ function toFlatObject(sourceObj, destObj, filter) {
178
+ var props;
179
+ var i;
180
+ var prop;
181
+ var merged = {};
182
+ destObj = destObj || {};
183
+ do {
184
+ props = Object.getOwnPropertyNames(sourceObj);
185
+ i = props.length;
186
+ while (i-- > 0) {
187
+ prop = props[i];
188
+ if (!merged[prop]) {
189
+ destObj[prop] = sourceObj[prop];
190
+ merged[prop] = true;
191
+ }
192
+ }
193
+ sourceObj = Object.getPrototypeOf(sourceObj);
194
+ } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);
195
+ return destObj;
196
+ }
197
+ function endsWith(str, searchString, position) {
198
+ str = String(str);
199
+ if (position === void 0 || position > str.length) {
200
+ position = str.length;
201
+ }
202
+ position -= searchString.length;
203
+ var lastIndex = str.indexOf(searchString, position);
204
+ return lastIndex !== -1 && lastIndex === position;
205
+ }
206
+ function toArray(thing) {
207
+ if (!thing)
208
+ return null;
209
+ var i = thing.length;
210
+ if (isUndefined(i))
211
+ return null;
212
+ var arr = new Array(i);
213
+ while (i-- > 0) {
214
+ arr[i] = thing[i];
215
+ }
216
+ return arr;
217
+ }
218
+ var isTypedArray = function(TypedArray) {
219
+ return function(thing) {
220
+ return TypedArray && thing instanceof TypedArray;
221
+ };
222
+ }(typeof Uint8Array !== "undefined" && Object.getPrototypeOf(Uint8Array));
223
+ var utils$h = {
224
+ isArray,
225
+ isArrayBuffer,
226
+ isBuffer,
227
+ isFormData,
228
+ isArrayBufferView,
229
+ isString,
230
+ isNumber,
231
+ isObject,
232
+ isPlainObject,
233
+ isUndefined,
234
+ isDate,
235
+ isFile,
236
+ isBlob,
237
+ isFunction,
238
+ isStream,
239
+ isURLSearchParams,
240
+ isStandardBrowserEnv,
241
+ forEach,
242
+ merge,
243
+ extend,
244
+ trim,
245
+ stripBOM,
246
+ inherits,
247
+ toFlatObject,
248
+ kindOf,
249
+ kindOfTest,
250
+ endsWith,
251
+ toArray,
252
+ isTypedArray,
253
+ isFileList
254
+ };
255
+ var utils$g = utils$h;
256
+ function encode(val) {
257
+ return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
258
+ }
259
+ var buildURL$2 = function buildURL(url, params, paramsSerializer) {
260
+ if (!params) {
261
+ return url;
262
+ }
263
+ var serializedParams;
264
+ if (paramsSerializer) {
265
+ serializedParams = paramsSerializer(params);
266
+ } else if (utils$g.isURLSearchParams(params)) {
267
+ serializedParams = params.toString();
268
+ } else {
269
+ var parts = [];
270
+ utils$g.forEach(params, function serialize(val, key) {
271
+ if (val === null || typeof val === "undefined") {
272
+ return;
273
+ }
274
+ if (utils$g.isArray(val)) {
275
+ key = key + "[]";
276
+ } else {
277
+ val = [val];
278
+ }
279
+ utils$g.forEach(val, function parseValue(v) {
280
+ if (utils$g.isDate(v)) {
281
+ v = v.toISOString();
282
+ } else if (utils$g.isObject(v)) {
283
+ v = JSON.stringify(v);
284
+ }
285
+ parts.push(encode(key) + "=" + encode(v));
286
+ });
287
+ });
288
+ serializedParams = parts.join("&");
289
+ }
290
+ if (serializedParams) {
291
+ var hashmarkIndex = url.indexOf("#");
292
+ if (hashmarkIndex !== -1) {
293
+ url = url.slice(0, hashmarkIndex);
294
+ }
295
+ url += (url.indexOf("?") === -1 ? "?" : "&") + serializedParams;
296
+ }
297
+ return url;
298
+ };
299
+ var utils$f = utils$h;
300
+ function InterceptorManager$1() {
301
+ this.handlers = [];
302
+ }
303
+ InterceptorManager$1.prototype.use = function use(fulfilled, rejected, options) {
304
+ this.handlers.push({
305
+ fulfilled,
306
+ rejected,
307
+ synchronous: options ? options.synchronous : false,
308
+ runWhen: options ? options.runWhen : null
309
+ });
310
+ return this.handlers.length - 1;
311
+ };
312
+ InterceptorManager$1.prototype.eject = function eject(id) {
313
+ if (this.handlers[id]) {
314
+ this.handlers[id] = null;
315
+ }
316
+ };
317
+ InterceptorManager$1.prototype.forEach = function forEach2(fn) {
318
+ utils$f.forEach(this.handlers, function forEachHandler(h) {
319
+ if (h !== null) {
320
+ fn(h);
321
+ }
322
+ });
323
+ };
324
+ var InterceptorManager_1 = InterceptorManager$1;
325
+ var utils$e = utils$h;
326
+ var normalizeHeaderName$1 = function normalizeHeaderName(headers, normalizedName) {
327
+ utils$e.forEach(headers, function processHeader(value, name) {
328
+ if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {
329
+ headers[normalizedName] = value;
330
+ delete headers[name];
331
+ }
332
+ });
333
+ };
334
+ var utils$d = utils$h;
335
+ function AxiosError$5(message, code, config, request2, response) {
336
+ Error.call(this);
337
+ this.message = message;
338
+ this.name = "AxiosError";
339
+ code && (this.code = code);
340
+ config && (this.config = config);
341
+ request2 && (this.request = request2);
342
+ response && (this.response = response);
343
+ }
344
+ utils$d.inherits(AxiosError$5, Error, {
345
+ toJSON: function toJSON() {
346
+ return {
347
+ message: this.message,
348
+ name: this.name,
349
+ description: this.description,
350
+ number: this.number,
351
+ fileName: this.fileName,
352
+ lineNumber: this.lineNumber,
353
+ columnNumber: this.columnNumber,
354
+ stack: this.stack,
355
+ config: this.config,
356
+ code: this.code,
357
+ status: this.response && this.response.status ? this.response.status : null
358
+ };
359
+ }
360
+ });
361
+ var prototype = AxiosError$5.prototype;
362
+ var descriptors = {};
363
+ [
364
+ "ERR_BAD_OPTION_VALUE",
365
+ "ERR_BAD_OPTION",
366
+ "ECONNABORTED",
367
+ "ETIMEDOUT",
368
+ "ERR_NETWORK",
369
+ "ERR_FR_TOO_MANY_REDIRECTS",
370
+ "ERR_DEPRECATED",
371
+ "ERR_BAD_RESPONSE",
372
+ "ERR_BAD_REQUEST",
373
+ "ERR_CANCELED"
374
+ ].forEach(function(code) {
375
+ descriptors[code] = { value: code };
376
+ });
377
+ Object.defineProperties(AxiosError$5, descriptors);
378
+ Object.defineProperty(prototype, "isAxiosError", { value: true });
379
+ AxiosError$5.from = function(error, code, config, request2, response, customProps) {
380
+ var axiosError = Object.create(prototype);
381
+ utils$d.toFlatObject(error, axiosError, function filter(obj) {
382
+ return obj !== Error.prototype;
383
+ });
384
+ AxiosError$5.call(axiosError, error.message, code, config, request2, response);
385
+ axiosError.name = error.name;
386
+ customProps && Object.assign(axiosError, customProps);
387
+ return axiosError;
388
+ };
389
+ var AxiosError_1 = AxiosError$5;
390
+ var transitional = {
391
+ silentJSONParsing: true,
392
+ forcedJSONParsing: true,
393
+ clarifyTimeoutError: false
394
+ };
395
+ var utils$c = utils$h;
396
+ function toFormData$1(obj, formData) {
397
+ formData = formData || new FormData();
398
+ var stack = [];
399
+ function convertValue(value) {
400
+ if (value === null)
401
+ return "";
402
+ if (utils$c.isDate(value)) {
403
+ return value.toISOString();
404
+ }
405
+ if (utils$c.isArrayBuffer(value) || utils$c.isTypedArray(value)) {
406
+ return typeof Blob === "function" ? new Blob([value]) : Buffer.from(value);
407
+ }
408
+ return value;
409
+ }
410
+ function build(data2, parentKey) {
411
+ if (utils$c.isPlainObject(data2) || utils$c.isArray(data2)) {
412
+ if (stack.indexOf(data2) !== -1) {
413
+ throw Error("Circular reference detected in " + parentKey);
414
+ }
415
+ stack.push(data2);
416
+ utils$c.forEach(data2, function each(value, key) {
417
+ if (utils$c.isUndefined(value))
418
+ return;
419
+ var fullKey = parentKey ? parentKey + "." + key : key;
420
+ var arr;
421
+ if (value && !parentKey && typeof value === "object") {
422
+ if (utils$c.endsWith(key, "{}")) {
423
+ value = JSON.stringify(value);
424
+ } else if (utils$c.endsWith(key, "[]") && (arr = utils$c.toArray(value))) {
425
+ arr.forEach(function(el) {
426
+ !utils$c.isUndefined(el) && formData.append(fullKey, convertValue(el));
427
+ });
428
+ return;
429
+ }
430
+ }
431
+ build(value, fullKey);
432
+ });
433
+ stack.pop();
434
+ } else {
435
+ formData.append(parentKey, convertValue(data2));
436
+ }
437
+ }
438
+ build(obj);
439
+ return formData;
440
+ }
441
+ var toFormData_1 = toFormData$1;
442
+ var AxiosError$4 = AxiosError_1;
443
+ var settle$1 = function settle(resolve, reject, response) {
444
+ var validateStatus2 = response.config.validateStatus;
445
+ if (!response.status || !validateStatus2 || validateStatus2(response.status)) {
446
+ resolve(response);
447
+ } else {
448
+ reject(new AxiosError$4("Request failed with status code " + response.status, [AxiosError$4.ERR_BAD_REQUEST, AxiosError$4.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4], response.config, response.request, response));
449
+ }
450
+ };
451
+ var utils$b = utils$h;
452
+ var cookies$1 = utils$b.isStandardBrowserEnv() ? function standardBrowserEnv() {
453
+ return {
454
+ write: function write(name, value, expires, path, domain, secure) {
455
+ var cookie = [];
456
+ cookie.push(name + "=" + encodeURIComponent(value));
457
+ if (utils$b.isNumber(expires)) {
458
+ cookie.push("expires=" + new Date(expires).toGMTString());
459
+ }
460
+ if (utils$b.isString(path)) {
461
+ cookie.push("path=" + path);
462
+ }
463
+ if (utils$b.isString(domain)) {
464
+ cookie.push("domain=" + domain);
465
+ }
466
+ if (secure === true) {
467
+ cookie.push("secure");
468
+ }
469
+ document.cookie = cookie.join("; ");
470
+ },
471
+ read: function read(name) {
472
+ var match = document.cookie.match(new RegExp("(^|;\\s*)(" + name + ")=([^;]*)"));
473
+ return match ? decodeURIComponent(match[3]) : null;
474
+ },
475
+ remove: function remove(name) {
476
+ this.write(name, "", Date.now() - 864e5);
477
+ }
478
+ };
479
+ }() : function nonStandardBrowserEnv() {
480
+ return {
481
+ write: function write() {
482
+ },
483
+ read: function read() {
484
+ return null;
485
+ },
486
+ remove: function remove() {
487
+ }
488
+ };
489
+ }();
490
+ var isAbsoluteURL$1 = function isAbsoluteURL(url) {
491
+ return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
492
+ };
493
+ var combineURLs$1 = function combineURLs(baseURL, relativeURL) {
494
+ return relativeURL ? baseURL.replace(/\/+$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL;
495
+ };
496
+ var isAbsoluteURL2 = isAbsoluteURL$1;
497
+ var combineURLs2 = combineURLs$1;
498
+ var buildFullPath$2 = function buildFullPath(baseURL, requestedURL) {
499
+ if (baseURL && !isAbsoluteURL2(requestedURL)) {
500
+ return combineURLs2(baseURL, requestedURL);
501
+ }
502
+ return requestedURL;
503
+ };
504
+ var utils$a = utils$h;
505
+ var ignoreDuplicateOf = [
506
+ "age",
507
+ "authorization",
508
+ "content-length",
509
+ "content-type",
510
+ "etag",
511
+ "expires",
512
+ "from",
513
+ "host",
514
+ "if-modified-since",
515
+ "if-unmodified-since",
516
+ "last-modified",
517
+ "location",
518
+ "max-forwards",
519
+ "proxy-authorization",
520
+ "referer",
521
+ "retry-after",
522
+ "user-agent"
523
+ ];
524
+ var parseHeaders$1 = function parseHeaders(headers) {
525
+ var parsed = {};
526
+ var key;
527
+ var val;
528
+ var i;
529
+ if (!headers) {
530
+ return parsed;
531
+ }
532
+ utils$a.forEach(headers.split("\n"), function parser(line) {
533
+ i = line.indexOf(":");
534
+ key = utils$a.trim(line.substr(0, i)).toLowerCase();
535
+ val = utils$a.trim(line.substr(i + 1));
536
+ if (key) {
537
+ if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {
538
+ return;
539
+ }
540
+ if (key === "set-cookie") {
541
+ parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);
542
+ } else {
543
+ parsed[key] = parsed[key] ? parsed[key] + ", " + val : val;
544
+ }
545
+ }
546
+ });
547
+ return parsed;
548
+ };
549
+ var utils$9 = utils$h;
550
+ var isURLSameOrigin$1 = utils$9.isStandardBrowserEnv() ? function standardBrowserEnv2() {
551
+ var msie = /(msie|trident)/i.test(navigator.userAgent);
552
+ var urlParsingNode = document.createElement("a");
553
+ var originURL;
554
+ function resolveURL(url) {
555
+ var href = url;
556
+ if (msie) {
557
+ urlParsingNode.setAttribute("href", href);
558
+ href = urlParsingNode.href;
559
+ }
560
+ urlParsingNode.setAttribute("href", href);
561
+ return {
562
+ href: urlParsingNode.href,
563
+ protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, "") : "",
564
+ host: urlParsingNode.host,
565
+ search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, "") : "",
566
+ hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, "") : "",
567
+ hostname: urlParsingNode.hostname,
568
+ port: urlParsingNode.port,
569
+ pathname: urlParsingNode.pathname.charAt(0) === "/" ? urlParsingNode.pathname : "/" + urlParsingNode.pathname
570
+ };
571
+ }
572
+ originURL = resolveURL(window.location.href);
573
+ return function isURLSameOrigin2(requestURL) {
574
+ var parsed = utils$9.isString(requestURL) ? resolveURL(requestURL) : requestURL;
575
+ return parsed.protocol === originURL.protocol && parsed.host === originURL.host;
576
+ };
577
+ }() : function nonStandardBrowserEnv2() {
578
+ return function isURLSameOrigin2() {
579
+ return true;
580
+ };
581
+ }();
582
+ var AxiosError$3 = AxiosError_1;
583
+ var utils$8 = utils$h;
584
+ function CanceledError$3(message) {
585
+ AxiosError$3.call(this, message == null ? "canceled" : message, AxiosError$3.ERR_CANCELED);
586
+ this.name = "CanceledError";
587
+ }
588
+ utils$8.inherits(CanceledError$3, AxiosError$3, {
589
+ __CANCEL__: true
590
+ });
591
+ var CanceledError_1 = CanceledError$3;
592
+ var parseProtocol$1 = function parseProtocol(url) {
593
+ var match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
594
+ return match && match[1] || "";
595
+ };
596
+ var utils$7 = utils$h;
597
+ var settle2 = settle$1;
598
+ var cookies = cookies$1;
599
+ var buildURL$1 = buildURL$2;
600
+ var buildFullPath$1 = buildFullPath$2;
601
+ var parseHeaders2 = parseHeaders$1;
602
+ var isURLSameOrigin = isURLSameOrigin$1;
603
+ var transitionalDefaults$1 = transitional;
604
+ var AxiosError$2 = AxiosError_1;
605
+ var CanceledError$2 = CanceledError_1;
606
+ var parseProtocol2 = parseProtocol$1;
607
+ var xhr = function xhrAdapter(config) {
608
+ return new Promise(function dispatchXhrRequest(resolve, reject) {
609
+ var requestData = config.data;
610
+ var requestHeaders = config.headers;
611
+ var responseType = config.responseType;
612
+ var onCanceled;
613
+ function done() {
614
+ if (config.cancelToken) {
615
+ config.cancelToken.unsubscribe(onCanceled);
616
+ }
617
+ if (config.signal) {
618
+ config.signal.removeEventListener("abort", onCanceled);
619
+ }
620
+ }
621
+ if (utils$7.isFormData(requestData) && utils$7.isStandardBrowserEnv()) {
622
+ delete requestHeaders["Content-Type"];
623
+ }
624
+ var request2 = new XMLHttpRequest();
625
+ if (config.auth) {
626
+ var username = config.auth.username || "";
627
+ var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : "";
628
+ requestHeaders.Authorization = "Basic " + btoa(username + ":" + password);
629
+ }
630
+ var fullPath = buildFullPath$1(config.baseURL, config.url);
631
+ request2.open(config.method.toUpperCase(), buildURL$1(fullPath, config.params, config.paramsSerializer), true);
632
+ request2.timeout = config.timeout;
633
+ function onloadend() {
634
+ if (!request2) {
635
+ return;
636
+ }
637
+ var responseHeaders = "getAllResponseHeaders" in request2 ? parseHeaders2(request2.getAllResponseHeaders()) : null;
638
+ var responseData = !responseType || responseType === "text" || responseType === "json" ? request2.responseText : request2.response;
639
+ var response = {
640
+ data: responseData,
641
+ status: request2.status,
642
+ statusText: request2.statusText,
643
+ headers: responseHeaders,
644
+ config,
645
+ request: request2
646
+ };
647
+ settle2(function _resolve(value) {
648
+ resolve(value);
649
+ done();
650
+ }, function _reject(err) {
651
+ reject(err);
652
+ done();
653
+ }, response);
654
+ request2 = null;
655
+ }
656
+ if ("onloadend" in request2) {
657
+ request2.onloadend = onloadend;
658
+ } else {
659
+ request2.onreadystatechange = function handleLoad() {
660
+ if (!request2 || request2.readyState !== 4) {
661
+ return;
662
+ }
663
+ if (request2.status === 0 && !(request2.responseURL && request2.responseURL.indexOf("file:") === 0)) {
664
+ return;
665
+ }
666
+ setTimeout(onloadend);
667
+ };
668
+ }
669
+ request2.onabort = function handleAbort() {
670
+ if (!request2) {
671
+ return;
672
+ }
673
+ reject(new AxiosError$2("Request aborted", AxiosError$2.ECONNABORTED, config, request2));
674
+ request2 = null;
675
+ };
676
+ request2.onerror = function handleError() {
677
+ reject(new AxiosError$2("Network Error", AxiosError$2.ERR_NETWORK, config, request2, request2));
678
+ request2 = null;
679
+ };
680
+ request2.ontimeout = function handleTimeout() {
681
+ var timeoutErrorMessage = config.timeout ? "timeout of " + config.timeout + "ms exceeded" : "timeout exceeded";
682
+ var transitional3 = config.transitional || transitionalDefaults$1;
683
+ if (config.timeoutErrorMessage) {
684
+ timeoutErrorMessage = config.timeoutErrorMessage;
685
+ }
686
+ reject(new AxiosError$2(timeoutErrorMessage, transitional3.clarifyTimeoutError ? AxiosError$2.ETIMEDOUT : AxiosError$2.ECONNABORTED, config, request2));
687
+ request2 = null;
688
+ };
689
+ if (utils$7.isStandardBrowserEnv()) {
690
+ var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ? cookies.read(config.xsrfCookieName) : void 0;
691
+ if (xsrfValue) {
692
+ requestHeaders[config.xsrfHeaderName] = xsrfValue;
693
+ }
694
+ }
695
+ if ("setRequestHeader" in request2) {
696
+ utils$7.forEach(requestHeaders, function setRequestHeader(val, key) {
697
+ if (typeof requestData === "undefined" && key.toLowerCase() === "content-type") {
698
+ delete requestHeaders[key];
699
+ } else {
700
+ request2.setRequestHeader(key, val);
701
+ }
702
+ });
703
+ }
704
+ if (!utils$7.isUndefined(config.withCredentials)) {
705
+ request2.withCredentials = !!config.withCredentials;
706
+ }
707
+ if (responseType && responseType !== "json") {
708
+ request2.responseType = config.responseType;
709
+ }
710
+ if (typeof config.onDownloadProgress === "function") {
711
+ request2.addEventListener("progress", config.onDownloadProgress);
712
+ }
713
+ if (typeof config.onUploadProgress === "function" && request2.upload) {
714
+ request2.upload.addEventListener("progress", config.onUploadProgress);
715
+ }
716
+ if (config.cancelToken || config.signal) {
717
+ onCanceled = function(cancel) {
718
+ if (!request2) {
719
+ return;
720
+ }
721
+ reject(!cancel || cancel && cancel.type ? new CanceledError$2() : cancel);
722
+ request2.abort();
723
+ request2 = null;
724
+ };
725
+ config.cancelToken && config.cancelToken.subscribe(onCanceled);
726
+ if (config.signal) {
727
+ config.signal.aborted ? onCanceled() : config.signal.addEventListener("abort", onCanceled);
728
+ }
729
+ }
730
+ if (!requestData) {
731
+ requestData = null;
732
+ }
733
+ var protocol = parseProtocol2(fullPath);
734
+ if (protocol && ["http", "https", "file"].indexOf(protocol) === -1) {
735
+ reject(new AxiosError$2("Unsupported protocol " + protocol + ":", AxiosError$2.ERR_BAD_REQUEST, config));
736
+ return;
737
+ }
738
+ request2.send(requestData);
739
+ });
740
+ };
741
+ var _null = null;
742
+ var utils$6 = utils$h;
743
+ var normalizeHeaderName2 = normalizeHeaderName$1;
744
+ var AxiosError$1 = AxiosError_1;
745
+ var transitionalDefaults = transitional;
746
+ var toFormData = toFormData_1;
747
+ var DEFAULT_CONTENT_TYPE = {
748
+ "Content-Type": "application/x-www-form-urlencoded"
749
+ };
750
+ function setContentTypeIfUnset(headers, value) {
751
+ if (!utils$6.isUndefined(headers) && utils$6.isUndefined(headers["Content-Type"])) {
752
+ headers["Content-Type"] = value;
753
+ }
754
+ }
755
+ function getDefaultAdapter() {
756
+ var adapter;
757
+ if (typeof XMLHttpRequest !== "undefined") {
758
+ adapter = xhr;
759
+ } else if (typeof process !== "undefined" && Object.prototype.toString.call(process) === "[object process]") {
760
+ adapter = xhr;
761
+ }
762
+ return adapter;
763
+ }
764
+ function stringifySafely(rawValue, parser, encoder) {
765
+ if (utils$6.isString(rawValue)) {
766
+ try {
767
+ (parser || JSON.parse)(rawValue);
768
+ return utils$6.trim(rawValue);
769
+ } catch (e) {
770
+ if (e.name !== "SyntaxError") {
771
+ throw e;
772
+ }
773
+ }
774
+ }
775
+ return (encoder || JSON.stringify)(rawValue);
776
+ }
777
+ var defaults$3 = {
778
+ transitional: transitionalDefaults,
779
+ adapter: getDefaultAdapter(),
780
+ transformRequest: [function transformRequest(data2, headers) {
781
+ normalizeHeaderName2(headers, "Accept");
782
+ normalizeHeaderName2(headers, "Content-Type");
783
+ if (utils$6.isFormData(data2) || utils$6.isArrayBuffer(data2) || utils$6.isBuffer(data2) || utils$6.isStream(data2) || utils$6.isFile(data2) || utils$6.isBlob(data2)) {
784
+ return data2;
785
+ }
786
+ if (utils$6.isArrayBufferView(data2)) {
787
+ return data2.buffer;
788
+ }
789
+ if (utils$6.isURLSearchParams(data2)) {
790
+ setContentTypeIfUnset(headers, "application/x-www-form-urlencoded;charset=utf-8");
791
+ return data2.toString();
792
+ }
793
+ var isObjectPayload = utils$6.isObject(data2);
794
+ var contentType = headers && headers["Content-Type"];
795
+ var isFileList2;
796
+ if ((isFileList2 = utils$6.isFileList(data2)) || isObjectPayload && contentType === "multipart/form-data") {
797
+ var _FormData = this.env && this.env.FormData;
798
+ return toFormData(isFileList2 ? { "files[]": data2 } : data2, _FormData && new _FormData());
799
+ } else if (isObjectPayload || contentType === "application/json") {
800
+ setContentTypeIfUnset(headers, "application/json");
801
+ return stringifySafely(data2);
802
+ }
803
+ return data2;
804
+ }],
805
+ transformResponse: [function transformResponse(data2) {
806
+ var transitional3 = this.transitional || defaults$3.transitional;
807
+ var silentJSONParsing = transitional3 && transitional3.silentJSONParsing;
808
+ var forcedJSONParsing = transitional3 && transitional3.forcedJSONParsing;
809
+ var strictJSONParsing = !silentJSONParsing && this.responseType === "json";
810
+ if (strictJSONParsing || forcedJSONParsing && utils$6.isString(data2) && data2.length) {
811
+ try {
812
+ return JSON.parse(data2);
813
+ } catch (e) {
814
+ if (strictJSONParsing) {
815
+ if (e.name === "SyntaxError") {
816
+ throw AxiosError$1.from(e, AxiosError$1.ERR_BAD_RESPONSE, this, null, this.response);
817
+ }
818
+ throw e;
819
+ }
820
+ }
821
+ }
822
+ return data2;
823
+ }],
824
+ timeout: 0,
825
+ xsrfCookieName: "XSRF-TOKEN",
826
+ xsrfHeaderName: "X-XSRF-TOKEN",
827
+ maxContentLength: -1,
828
+ maxBodyLength: -1,
829
+ env: {
830
+ FormData: _null
831
+ },
832
+ validateStatus: function validateStatus(status) {
833
+ return status >= 200 && status < 300;
834
+ },
835
+ headers: {
836
+ common: {
837
+ "Accept": "application/json, text/plain, */*"
838
+ }
839
+ }
840
+ };
841
+ utils$6.forEach(["delete", "get", "head"], function forEachMethodNoData(method) {
842
+ defaults$3.headers[method] = {};
843
+ });
844
+ utils$6.forEach(["post", "put", "patch"], function forEachMethodWithData(method) {
845
+ defaults$3.headers[method] = utils$6.merge(DEFAULT_CONTENT_TYPE);
846
+ });
847
+ var defaults_1 = defaults$3;
848
+ var utils$5 = utils$h;
849
+ var defaults$2 = defaults_1;
850
+ var transformData$1 = function transformData(data2, headers, fns) {
851
+ var context = this || defaults$2;
852
+ utils$5.forEach(fns, function transform(fn) {
853
+ data2 = fn.call(context, data2, headers);
854
+ });
855
+ return data2;
856
+ };
857
+ var isCancel$1 = function isCancel(value) {
858
+ return !!(value && value.__CANCEL__);
859
+ };
860
+ var utils$4 = utils$h;
861
+ var transformData2 = transformData$1;
862
+ var isCancel2 = isCancel$1;
863
+ var defaults$1 = defaults_1;
864
+ var CanceledError$1 = CanceledError_1;
865
+ function throwIfCancellationRequested(config) {
866
+ if (config.cancelToken) {
867
+ config.cancelToken.throwIfRequested();
868
+ }
869
+ if (config.signal && config.signal.aborted) {
870
+ throw new CanceledError$1();
871
+ }
872
+ }
873
+ var dispatchRequest$1 = function dispatchRequest(config) {
874
+ throwIfCancellationRequested(config);
875
+ config.headers = config.headers || {};
876
+ config.data = transformData2.call(config, config.data, config.headers, config.transformRequest);
877
+ config.headers = utils$4.merge(config.headers.common || {}, config.headers[config.method] || {}, config.headers);
878
+ utils$4.forEach(["delete", "get", "head", "post", "put", "patch", "common"], function cleanHeaderConfig(method) {
879
+ delete config.headers[method];
880
+ });
881
+ var adapter = config.adapter || defaults$1.adapter;
882
+ return adapter(config).then(function onAdapterResolution(response) {
883
+ throwIfCancellationRequested(config);
884
+ response.data = transformData2.call(config, response.data, response.headers, config.transformResponse);
885
+ return response;
886
+ }, function onAdapterRejection(reason) {
887
+ if (!isCancel2(reason)) {
888
+ throwIfCancellationRequested(config);
889
+ if (reason && reason.response) {
890
+ reason.response.data = transformData2.call(config, reason.response.data, reason.response.headers, config.transformResponse);
891
+ }
892
+ }
893
+ return Promise.reject(reason);
894
+ });
895
+ };
896
+ var utils$3 = utils$h;
897
+ var mergeConfig$2 = function mergeConfig(config1, config2) {
898
+ config2 = config2 || {};
899
+ var config = {};
900
+ function getMergedValue(target, source2) {
901
+ if (utils$3.isPlainObject(target) && utils$3.isPlainObject(source2)) {
902
+ return utils$3.merge(target, source2);
903
+ } else if (utils$3.isPlainObject(source2)) {
904
+ return utils$3.merge({}, source2);
905
+ } else if (utils$3.isArray(source2)) {
906
+ return source2.slice();
907
+ }
908
+ return source2;
909
+ }
910
+ function mergeDeepProperties(prop) {
911
+ if (!utils$3.isUndefined(config2[prop])) {
912
+ return getMergedValue(config1[prop], config2[prop]);
913
+ } else if (!utils$3.isUndefined(config1[prop])) {
914
+ return getMergedValue(void 0, config1[prop]);
915
+ }
916
+ }
917
+ function valueFromConfig2(prop) {
918
+ if (!utils$3.isUndefined(config2[prop])) {
919
+ return getMergedValue(void 0, config2[prop]);
920
+ }
921
+ }
922
+ function defaultToConfig2(prop) {
923
+ if (!utils$3.isUndefined(config2[prop])) {
924
+ return getMergedValue(void 0, config2[prop]);
925
+ } else if (!utils$3.isUndefined(config1[prop])) {
926
+ return getMergedValue(void 0, config1[prop]);
927
+ }
928
+ }
929
+ function mergeDirectKeys(prop) {
930
+ if (prop in config2) {
931
+ return getMergedValue(config1[prop], config2[prop]);
932
+ } else if (prop in config1) {
933
+ return getMergedValue(void 0, config1[prop]);
934
+ }
935
+ }
936
+ var mergeMap = {
937
+ "url": valueFromConfig2,
938
+ "method": valueFromConfig2,
939
+ "data": valueFromConfig2,
940
+ "baseURL": defaultToConfig2,
941
+ "transformRequest": defaultToConfig2,
942
+ "transformResponse": defaultToConfig2,
943
+ "paramsSerializer": defaultToConfig2,
944
+ "timeout": defaultToConfig2,
945
+ "timeoutMessage": defaultToConfig2,
946
+ "withCredentials": defaultToConfig2,
947
+ "adapter": defaultToConfig2,
948
+ "responseType": defaultToConfig2,
949
+ "xsrfCookieName": defaultToConfig2,
950
+ "xsrfHeaderName": defaultToConfig2,
951
+ "onUploadProgress": defaultToConfig2,
952
+ "onDownloadProgress": defaultToConfig2,
953
+ "decompress": defaultToConfig2,
954
+ "maxContentLength": defaultToConfig2,
955
+ "maxBodyLength": defaultToConfig2,
956
+ "beforeRedirect": defaultToConfig2,
957
+ "transport": defaultToConfig2,
958
+ "httpAgent": defaultToConfig2,
959
+ "httpsAgent": defaultToConfig2,
960
+ "cancelToken": defaultToConfig2,
961
+ "socketPath": defaultToConfig2,
962
+ "responseEncoding": defaultToConfig2,
963
+ "validateStatus": mergeDirectKeys
964
+ };
965
+ utils$3.forEach(Object.keys(config1).concat(Object.keys(config2)), function computeConfigValue(prop) {
966
+ var merge2 = mergeMap[prop] || mergeDeepProperties;
967
+ var configValue = merge2(prop);
968
+ utils$3.isUndefined(configValue) && merge2 !== mergeDirectKeys || (config[prop] = configValue);
969
+ });
970
+ return config;
971
+ };
972
+ var data = {
973
+ "version": "0.27.2"
974
+ };
975
+ var VERSION = data.version;
976
+ var AxiosError = AxiosError_1;
977
+ var validators$1 = {};
978
+ ["object", "boolean", "number", "function", "string", "symbol"].forEach(function(type, i) {
979
+ validators$1[type] = function validator2(thing) {
980
+ return typeof thing === type || "a" + (i < 1 ? "n " : " ") + type;
981
+ };
982
+ });
983
+ var deprecatedWarnings = {};
984
+ validators$1.transitional = function transitional2(validator2, version, message) {
985
+ function formatMessage(opt, desc) {
986
+ return "[Axios v" + VERSION + "] Transitional option '" + opt + "'" + desc + (message ? ". " + message : "");
987
+ }
988
+ return function(value, opt, opts) {
989
+ if (validator2 === false) {
990
+ throw new AxiosError(formatMessage(opt, " has been removed" + (version ? " in " + version : "")), AxiosError.ERR_DEPRECATED);
991
+ }
992
+ if (version && !deprecatedWarnings[opt]) {
993
+ deprecatedWarnings[opt] = true;
994
+ console.warn(formatMessage(opt, " has been deprecated since v" + version + " and will be removed in the near future"));
995
+ }
996
+ return validator2 ? validator2(value, opt, opts) : true;
997
+ };
998
+ };
999
+ function assertOptions(options, schema, allowUnknown) {
1000
+ if (typeof options !== "object") {
1001
+ throw new AxiosError("options must be an object", AxiosError.ERR_BAD_OPTION_VALUE);
1002
+ }
1003
+ var keys = Object.keys(options);
1004
+ var i = keys.length;
1005
+ while (i-- > 0) {
1006
+ var opt = keys[i];
1007
+ var validator2 = schema[opt];
1008
+ if (validator2) {
1009
+ var value = options[opt];
1010
+ var result = value === void 0 || validator2(value, opt, options);
1011
+ if (result !== true) {
1012
+ throw new AxiosError("option " + opt + " must be " + result, AxiosError.ERR_BAD_OPTION_VALUE);
1013
+ }
1014
+ continue;
1015
+ }
1016
+ if (allowUnknown !== true) {
1017
+ throw new AxiosError("Unknown option " + opt, AxiosError.ERR_BAD_OPTION);
1018
+ }
1019
+ }
1020
+ }
1021
+ var validator$1 = {
1022
+ assertOptions,
1023
+ validators: validators$1
1024
+ };
1025
+ var utils$2 = utils$h;
1026
+ var buildURL2 = buildURL$2;
1027
+ var InterceptorManager = InterceptorManager_1;
1028
+ var dispatchRequest2 = dispatchRequest$1;
1029
+ var mergeConfig$1 = mergeConfig$2;
1030
+ var buildFullPath2 = buildFullPath$2;
1031
+ var validator = validator$1;
1032
+ var validators = validator.validators;
1033
+ function Axios$1(instanceConfig) {
1034
+ this.defaults = instanceConfig;
1035
+ this.interceptors = {
1036
+ request: new InterceptorManager(),
1037
+ response: new InterceptorManager()
1038
+ };
1039
+ }
1040
+ Axios$1.prototype.request = function request(configOrUrl, config) {
1041
+ if (typeof configOrUrl === "string") {
1042
+ config = config || {};
1043
+ config.url = configOrUrl;
1044
+ } else {
1045
+ config = configOrUrl || {};
1046
+ }
1047
+ config = mergeConfig$1(this.defaults, config);
1048
+ if (config.method) {
1049
+ config.method = config.method.toLowerCase();
1050
+ } else if (this.defaults.method) {
1051
+ config.method = this.defaults.method.toLowerCase();
1052
+ } else {
1053
+ config.method = "get";
1054
+ }
1055
+ var transitional3 = config.transitional;
1056
+ if (transitional3 !== void 0) {
1057
+ validator.assertOptions(transitional3, {
1058
+ silentJSONParsing: validators.transitional(validators.boolean),
1059
+ forcedJSONParsing: validators.transitional(validators.boolean),
1060
+ clarifyTimeoutError: validators.transitional(validators.boolean)
1061
+ }, false);
1062
+ }
1063
+ var requestInterceptorChain = [];
1064
+ var synchronousRequestInterceptors = true;
1065
+ this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
1066
+ if (typeof interceptor.runWhen === "function" && interceptor.runWhen(config) === false) {
1067
+ return;
1068
+ }
1069
+ synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
1070
+ requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
1071
+ });
1072
+ var responseInterceptorChain = [];
1073
+ this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
1074
+ responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
1075
+ });
1076
+ var promise;
1077
+ if (!synchronousRequestInterceptors) {
1078
+ var chain = [dispatchRequest2, void 0];
1079
+ Array.prototype.unshift.apply(chain, requestInterceptorChain);
1080
+ chain = chain.concat(responseInterceptorChain);
1081
+ promise = Promise.resolve(config);
1082
+ while (chain.length) {
1083
+ promise = promise.then(chain.shift(), chain.shift());
1084
+ }
1085
+ return promise;
1086
+ }
1087
+ var newConfig = config;
1088
+ while (requestInterceptorChain.length) {
1089
+ var onFulfilled = requestInterceptorChain.shift();
1090
+ var onRejected = requestInterceptorChain.shift();
1091
+ try {
1092
+ newConfig = onFulfilled(newConfig);
1093
+ } catch (error) {
1094
+ onRejected(error);
1095
+ break;
1096
+ }
1097
+ }
1098
+ try {
1099
+ promise = dispatchRequest2(newConfig);
1100
+ } catch (error) {
1101
+ return Promise.reject(error);
1102
+ }
1103
+ while (responseInterceptorChain.length) {
1104
+ promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift());
1105
+ }
1106
+ return promise;
1107
+ };
1108
+ Axios$1.prototype.getUri = function getUri(config) {
1109
+ config = mergeConfig$1(this.defaults, config);
1110
+ var fullPath = buildFullPath2(config.baseURL, config.url);
1111
+ return buildURL2(fullPath, config.params, config.paramsSerializer);
1112
+ };
1113
+ utils$2.forEach(["delete", "get", "head", "options"], function forEachMethodNoData2(method) {
1114
+ Axios$1.prototype[method] = function(url, config) {
1115
+ return this.request(mergeConfig$1(config || {}, {
1116
+ method,
1117
+ url,
1118
+ data: (config || {}).data
1119
+ }));
1120
+ };
1121
+ });
1122
+ utils$2.forEach(["post", "put", "patch"], function forEachMethodWithData2(method) {
1123
+ function generateHTTPMethod(isForm) {
1124
+ return function httpMethod(url, data2, config) {
1125
+ return this.request(mergeConfig$1(config || {}, {
1126
+ method,
1127
+ headers: isForm ? {
1128
+ "Content-Type": "multipart/form-data"
1129
+ } : {},
1130
+ url,
1131
+ data: data2
1132
+ }));
1133
+ };
1134
+ }
1135
+ Axios$1.prototype[method] = generateHTTPMethod();
1136
+ Axios$1.prototype[method + "Form"] = generateHTTPMethod(true);
1137
+ });
1138
+ var Axios_1 = Axios$1;
1139
+ var CanceledError = CanceledError_1;
1140
+ function CancelToken(executor) {
1141
+ if (typeof executor !== "function") {
1142
+ throw new TypeError("executor must be a function.");
1143
+ }
1144
+ var resolvePromise;
1145
+ this.promise = new Promise(function promiseExecutor(resolve) {
1146
+ resolvePromise = resolve;
1147
+ });
1148
+ var token = this;
1149
+ this.promise.then(function(cancel) {
1150
+ if (!token._listeners)
1151
+ return;
1152
+ var i;
1153
+ var l = token._listeners.length;
1154
+ for (i = 0; i < l; i++) {
1155
+ token._listeners[i](cancel);
1156
+ }
1157
+ token._listeners = null;
1158
+ });
1159
+ this.promise.then = function(onfulfilled) {
1160
+ var _resolve;
1161
+ var promise = new Promise(function(resolve) {
1162
+ token.subscribe(resolve);
1163
+ _resolve = resolve;
1164
+ }).then(onfulfilled);
1165
+ promise.cancel = function reject() {
1166
+ token.unsubscribe(_resolve);
1167
+ };
1168
+ return promise;
1169
+ };
1170
+ executor(function cancel(message) {
1171
+ if (token.reason) {
1172
+ return;
1173
+ }
1174
+ token.reason = new CanceledError(message);
1175
+ resolvePromise(token.reason);
1176
+ });
1177
+ }
1178
+ CancelToken.prototype.throwIfRequested = function throwIfRequested() {
1179
+ if (this.reason) {
1180
+ throw this.reason;
1181
+ }
1182
+ };
1183
+ CancelToken.prototype.subscribe = function subscribe(listener) {
1184
+ if (this.reason) {
1185
+ listener(this.reason);
1186
+ return;
1187
+ }
1188
+ if (this._listeners) {
1189
+ this._listeners.push(listener);
1190
+ } else {
1191
+ this._listeners = [listener];
1192
+ }
1193
+ };
1194
+ CancelToken.prototype.unsubscribe = function unsubscribe(listener) {
1195
+ if (!this._listeners) {
1196
+ return;
1197
+ }
1198
+ var index = this._listeners.indexOf(listener);
1199
+ if (index !== -1) {
1200
+ this._listeners.splice(index, 1);
1201
+ }
1202
+ };
1203
+ CancelToken.source = function source() {
1204
+ var cancel;
1205
+ var token = new CancelToken(function executor(c) {
1206
+ cancel = c;
1207
+ });
1208
+ return {
1209
+ token,
1210
+ cancel
1211
+ };
1212
+ };
1213
+ var CancelToken_1 = CancelToken;
1214
+ var spread = function spread2(callback) {
1215
+ return function wrap(arr) {
1216
+ return callback.apply(null, arr);
1217
+ };
1218
+ };
1219
+ var utils$1 = utils$h;
1220
+ var isAxiosError = function isAxiosError2(payload) {
1221
+ return utils$1.isObject(payload) && payload.isAxiosError === true;
1222
+ };
1223
+ var utils = utils$h;
1224
+ var bind2 = bind$2;
1225
+ var Axios = Axios_1;
1226
+ var mergeConfig2 = mergeConfig$2;
1227
+ var defaults = defaults_1;
1228
+ function createInstance(defaultConfig) {
1229
+ var context = new Axios(defaultConfig);
1230
+ var instance = bind2(Axios.prototype.request, context);
1231
+ utils.extend(instance, Axios.prototype, context);
1232
+ utils.extend(instance, context);
1233
+ instance.create = function create(instanceConfig) {
1234
+ return createInstance(mergeConfig2(defaultConfig, instanceConfig));
1235
+ };
1236
+ return instance;
1237
+ }
1238
+ var axios$1 = createInstance(defaults);
1239
+ axios$1.Axios = Axios;
1240
+ axios$1.CanceledError = CanceledError_1;
1241
+ axios$1.CancelToken = CancelToken_1;
1242
+ axios$1.isCancel = isCancel$1;
1243
+ axios$1.VERSION = data.version;
1244
+ axios$1.toFormData = toFormData_1;
1245
+ axios$1.AxiosError = AxiosError_1;
1246
+ axios$1.Cancel = axios$1.CanceledError;
1247
+ axios$1.all = function all(promises) {
1248
+ return Promise.all(promises);
1249
+ };
1250
+ axios$1.spread = spread;
1251
+ axios$1.isAxiosError = isAxiosError;
1252
+ axios$2.exports = axios$1;
1253
+ axios$2.exports.default = axios$1;
1254
+ var axios = axios$2.exports;
1255
+ const useRequest = (instanceConfiguration = {}) => {
1256
+ const {
1257
+ baseURL,
1258
+ projectId,
1259
+ projectToken,
1260
+ userToken,
1261
+ csrfToken
1262
+ } = useAPIConfig();
1263
+ const axiosConfiguration = __spreadValues({
1264
+ baseURL: baseURL.value,
1265
+ params: {
1266
+ project_id: projectId == null ? void 0 : projectId.value,
1267
+ project_token: projectToken == null ? void 0 : projectToken.value,
1268
+ token: userToken == null ? void 0 : userToken.value
1269
+ }
1270
+ }, instanceConfiguration);
1271
+ if (!projectToken || !(projectId && userToken)) {
1272
+ const headers = { "X-CSRF-Token": csrfToken };
1273
+ Object.assign(axiosConfiguration, { headers });
1274
+ }
1275
+ return axios.create(__spreadValues({}, axiosConfiguration));
1276
+ };
1277
+ class ObservationMatrix {
1278
+ static key(id, params) {
1279
+ return useRequest().get(`/observation_matrices/${id}/key`, params);
1280
+ }
1281
+ }
1282
+ const makeCharacterState = (data2) => ({
1283
+ characterStateId: data2.id,
1284
+ depictionIds: data2.depiction_ids,
1285
+ label: data2.label,
1286
+ name: data2.name,
1287
+ numberOfObjects: data2.number_of_objects,
1288
+ position: data2.position,
1289
+ status: data2.status
1290
+ });
1291
+ const makeDepiction = (data2) => ({
1292
+ depictionId: data2.id,
1293
+ caption: data2.caption,
1294
+ figureLabel: data2.figure_label,
1295
+ imageUrl: data2.image.medium
1296
+ });
1297
+ const descriptorTypes = {
1298
+ Qualitative: "Descriptor::Qualitative",
1299
+ Continuous: "Descriptor::Continuous",
1300
+ Sample: "Descriptor::Sample",
1301
+ Presence: "Descriptor::PresenceAbsence"
1302
+ };
1303
+ const makeBaseDescriptor = (data2) => ({
1304
+ descriptorId: data2.id,
1305
+ name: data2.name,
1306
+ description: data2.description,
1307
+ position: data2.position,
1308
+ status: data2.status,
1309
+ type: data2.type,
1310
+ depictionIds: data2.depiction_ids,
1311
+ usefulness: data2.usefulness,
1312
+ weight: data2.weight
1313
+ });
1314
+ const makeDescriptorContinuos = (data2) => __spreadProps(__spreadValues({}, makeBaseDescriptor(data2)), {
1315
+ defaultUnit: data2.default_unit,
1316
+ max: data2.max,
1317
+ min: data2.min
1318
+ });
1319
+ const makeDescriptorSample = (data2) => __spreadProps(__spreadValues({}, makeBaseDescriptor(data2)), {
1320
+ defaultUnit: data2.default_unit,
1321
+ max: data2.max,
1322
+ min: data2.min
1323
+ });
1324
+ const makeDescriptorPresenceAbsence = (data2) => __spreadProps(__spreadValues({}, makeBaseDescriptor(data2)), {
1325
+ presence: data2.precense
1326
+ });
1327
+ const makeDescriptorQualitative = (data2) => __spreadProps(__spreadValues({}, makeBaseDescriptor(data2)), {
1328
+ characterStates: data2.states.map((item) => makeCharacterState(item))
1329
+ });
1330
+ const makeDescriptor = (data2) => {
1331
+ switch (data2.type) {
1332
+ case descriptorTypes.Continuous:
1333
+ return makeDescriptorContinuos(data2);
1334
+ case descriptorTypes.Sample:
1335
+ return makeDescriptorSample(data2);
1336
+ case descriptorTypes.PresenceAbsence:
1337
+ return makeDescriptorPresenceAbsence(data2);
1338
+ case descriptorTypes.Qualitative:
1339
+ return makeDescriptorQualitative(data2);
1340
+ default:
1341
+ return makeBaseDescriptor(data2);
1342
+ }
1343
+ };
1344
+ const makeObservationMatrix = (data2) => ({
1345
+ observationMatrixId: data2.observation_matrix_id,
1346
+ name: data2.observation_matrix.name,
1347
+ globalId: data2.observation_matrix.global_id
1348
+ });
1349
+ const makeRow = (data2) => ({
1350
+ errorDescriptors: data2.error_descriptors,
1351
+ errors: data2.errors,
1352
+ objectLabel: data2.object.object_label,
1353
+ objectTag: data2.object.object_tag,
1354
+ observationObjectId: data2.object.observation_object_id,
1355
+ observationObjectType: data2.object.observation_object_type,
1356
+ rowId: data2.object.id
1357
+ });
1358
+ const makeKeyword = (data2) => ({
1359
+ keywordId: data2.id,
1360
+ definition: data2.description,
1361
+ name: data2.name
1362
+ });
1363
+ const makeLanguage = (data2) => ({
1364
+ languageId: data2.id,
1365
+ name: data2.english_name
1366
+ });
1367
+ const useObservationMatrixStore = defineStore("observationMatrix", {
1368
+ state: () => ({
1369
+ observationMatrix: void 0,
1370
+ citation: void 0,
1371
+ descriptors: [],
1372
+ eliminated: [],
1373
+ remaining: [],
1374
+ availableKeywords: [],
1375
+ availableLanguages: []
1376
+ }),
1377
+ getters: {
1378
+ getCitation: (state2) => state2.citation,
1379
+ getObservationMatrix: (state2) => state2.observationMatrix,
1380
+ getDescriptors: (state2) => state2.descriptors,
1381
+ getDescriptorById: (state2) => (id) => state2.descriptors.find((d) => d.descriptorId === id),
1382
+ getDescriptorsUsed: (state2) => state2.descriptors.filter((d) => d.status === "used"),
1383
+ getDescriptorsUseless: (state2) => state2.descriptors.filter((d) => d.status === "useless"),
1384
+ getDescriptorsUseful: (state2) => state2.descriptors.filter((d) => d.status === "useful"),
1385
+ getEliminated: (state2) => state2.eliminated,
1386
+ getKeywords: (state2) => state2.availableKeywords,
1387
+ getLanguages: (state2) => state2.availableLanguages,
1388
+ getRemaining: (state2) => state2.remaining
1389
+ },
1390
+ actions: {
1391
+ setDescriptors(descriptors2) {
1392
+ this.descriptors = descriptors2;
1393
+ },
1394
+ setEliminated(rows) {
1395
+ this.eliminated = rows;
1396
+ },
1397
+ setRemaining(rows) {
1398
+ this.remaining = rows;
1399
+ },
1400
+ setLanguages(languages) {
1401
+ this.availableLanguages = languages;
1402
+ },
1403
+ setKeywords(keywords) {
1404
+ this.availableKeywords = keywords;
1405
+ },
1406
+ setObservationMatrix(observationMatrix) {
1407
+ this.observationMatrix = observationMatrix;
1408
+ },
1409
+ async requestInteractiveKey({ observationMatrixId, params = {}, opt = {} }) {
1410
+ const request2 = await ObservationMatrix.key(observationMatrixId, { params });
1411
+ const { data: data2 } = request2;
1412
+ if (!opt.refreshOnlyTaxa) {
1413
+ this.setObservationMatrix(makeObservationMatrix(data2));
1414
+ this.setDescriptors(data2.list_of_descriptors.map((d) => makeDescriptor(d)));
1415
+ this.setKeywords(data2.descriptor_available_keywords.map((r) => makeKeyword(r)));
1416
+ this.setLanguages(data2.descriptor_available_languages.map((r) => makeLanguage(r)));
1417
+ }
1418
+ this.setEliminated(data2.eliminated.map((r) => makeRow(r)));
1419
+ this.setRemaining(data2.remaining.map((r) => makeRow(r)));
1420
+ return request2;
1421
+ }
1422
+ }
1423
+ });
1424
+ const useFilterStore = defineStore("filter", {
1425
+ state: () => ({
1426
+ descriptors: {},
1427
+ eliminateUnknown: void 0,
1428
+ errorTolerance: void 0,
1429
+ identifiedToRank: void 0,
1430
+ keywordIds: [],
1431
+ languageId: void 0,
1432
+ rowIds: [],
1433
+ sorting: void 0
1434
+ }),
1435
+ getters: {
1436
+ getKeywordIds: (state2) => state2.keywordIds,
1437
+ getLanguageId: (state2) => state2.languageId,
1438
+ getRowIds: (state2) => state2.rowIds,
1439
+ getDescriptors: (state2) => state2.descriptors,
1440
+ getIdentifiedToRank: (state2) => state2.identifiedToRank,
1441
+ getEliminateUknown: (state2) => state2.eliminateUnknown,
1442
+ getErrorTolerance: (state2) => state2.errorTolerance,
1443
+ getSorting: (state2) => state2.sorting,
1444
+ getDescriptorValueById: (state2) => (id) => {
1445
+ const value = state2.descriptors[id];
1446
+ return typeof value === "boolean" ? value : value || "";
1447
+ },
1448
+ getFilterParams: (state2) => {
1449
+ const descriptorsParam = Object.entries(state2.descriptors).map(([key, value]) => Array.isArray(value) ? `${key}:${value.join("|")}` : `${key}:${value}`).join("||");
1450
+ return {
1451
+ selected_descriptors: descriptorsParam,
1452
+ language_id: state2.languageId,
1453
+ keyword_ids: state2.keywordIds,
1454
+ sorting: state2.sorting,
1455
+ identified_to_rank: state2.identifiedToRank,
1456
+ error_tolerance: state2.errorTolerance,
1457
+ eliminate_unknown: state2.eliminateUnknown,
1458
+ row_filter: state2.rowIds.join("|")
1459
+ };
1460
+ }
1461
+ },
1462
+ actions: {
1463
+ setDescriptor({ descriptorId, value }) {
1464
+ this.descriptors[descriptorId] = value;
1465
+ },
1466
+ removeDescriptor(descriptorId) {
1467
+ delete this.descriptors[descriptorId];
1468
+ },
1469
+ removeKeywordId(id) {
1470
+ const index = this.keywordIds.findIndex((keywordId) => keywordId === id);
1471
+ if (index > -1) {
1472
+ this.keywordIds.splice(index, 1);
1473
+ }
1474
+ },
1475
+ addKeywordId(id) {
1476
+ this.keywordIds.push(id);
1477
+ },
1478
+ setLanguageId(id) {
1479
+ this.languageId = id;
1480
+ },
1481
+ setErrorTolerance(value) {
1482
+ this.errorTolerance = value;
1483
+ },
1484
+ setEliminateUnknown(value) {
1485
+ this.eliminateUnknown = value;
1486
+ }
1487
+ }
1488
+ });
1489
+ const useSettingsStore = defineStore("settings", {
1490
+ state: () => ({
1491
+ gridLayout: "layout-mode-1",
1492
+ isLoading: false,
1493
+ isRefreshing: false,
1494
+ refreshOnlyTaxa: false,
1495
+ rowFilter: true,
1496
+ shouldUpdate: true,
1497
+ observationMatrixId: void 0
1498
+ }),
1499
+ getters: {
1500
+ getIsLoading: (state2) => state2.isLoading,
1501
+ getLayout: (state2) => state2.gridLayout,
1502
+ getRefreshOnlyTaxa: (state2) => state2.refreshOnlyTaxa,
1503
+ getRowFilter: (state2) => state2.rowFilter,
1504
+ getShouldUpdate: (state2) => state2.shouldUpdate,
1505
+ getObservationMatrixId: (state2) => state2.observationMatrixId
1506
+ },
1507
+ actions: {
1508
+ setObservationMatrixId(value) {
1509
+ this.observationMatrixId = value;
1510
+ },
1511
+ setShouldUpdate(value) {
1512
+ this.shouldUpdate = value;
1513
+ },
1514
+ setRefreshOnlyTaxa(value) {
1515
+ this.refreshOnlyTaxa = value;
1516
+ },
1517
+ checkUpdate() {
1518
+ const filterStore = useFilterStore();
1519
+ const observationStore = useObservationMatrixStore();
1520
+ const observationMatrixId = this.observationMatrixId;
1521
+ if (this.shouldUpdate && observationMatrixId) {
1522
+ this.isLoading = true;
1523
+ observationStore.requestInteractiveKey({
1524
+ observationMatrixId,
1525
+ params: filterStore.getFilterParams,
1526
+ opt: {
1527
+ refreshOnlyTaxa: this.refreshOnlyTaxa
1528
+ }
1529
+ }).then((_) => {
1530
+ this.isLoading = false;
1531
+ });
1532
+ }
1533
+ }
1534
+ }
1535
+ });
1536
+ const _hoisted_1$v = /* @__PURE__ */ createTextVNode(" Eliminate unknowns ");
1537
+ const _sfc_main$y = /* @__PURE__ */ defineComponent({
1538
+ __name: "FilterEliminateUnknowns",
1539
+ setup(__props) {
1540
+ const store = useFilterStore();
1541
+ const eliminateUknown = computed({
1542
+ get: () => !!store.getEliminateUknown,
1543
+ set: (value) => {
1544
+ store.setEliminateUnknown(value);
1545
+ }
1546
+ });
1547
+ return (_ctx, _cache) => {
1548
+ return openBlock(), createElementBlock("label", null, [
1549
+ withDirectives(createElementVNode("input", {
1550
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(eliminateUknown) ? eliminateUknown.value = $event : null),
1551
+ type: "checkbox"
1552
+ }, null, 512), [
1553
+ [vModelCheckbox, unref(eliminateUknown)]
1554
+ ]),
1555
+ _hoisted_1$v
1556
+ ]);
1557
+ };
1558
+ }
1559
+ });
1560
+ const _hoisted_1$u = /* @__PURE__ */ createElementVNode("label", {
1561
+ for: "languages",
1562
+ class: "d-block"
1563
+ }, " Error tolerance ", -1);
1564
+ const _hoisted_2$g = /* @__PURE__ */ createElementVNode("option", { value: "" }, null, -1);
1565
+ const _hoisted_3$9 = ["value"];
1566
+ const _sfc_main$x = /* @__PURE__ */ defineComponent({
1567
+ __name: "FilterErrorTolerance",
1568
+ setup(__props) {
1569
+ const ERROR_TOLERANCE_VALUES = [0, 1, 2];
1570
+ const filterStore = useFilterStore();
1571
+ const errorTolerance = computed({
1572
+ get: () => filterStore.getErrorTolerance,
1573
+ set: (error) => {
1574
+ filterStore.setErrorTolerance(error);
1575
+ }
1576
+ });
1577
+ return (_ctx, _cache) => {
1578
+ return openBlock(), createElementBlock("div", null, [
1579
+ _hoisted_1$u,
1580
+ withDirectives(createElementVNode("select", {
1581
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(errorTolerance) ? errorTolerance.value = $event : null),
1582
+ name: "languages",
1583
+ role: "listbox"
1584
+ }, [
1585
+ _hoisted_2$g,
1586
+ (openBlock(), createElementBlock(Fragment, null, renderList(ERROR_TOLERANCE_VALUES, (value) => {
1587
+ return createElementVNode("option", {
1588
+ key: value,
1589
+ value
1590
+ }, toDisplayString(value), 9, _hoisted_3$9);
1591
+ }), 64))
1592
+ ], 512), [
1593
+ [vModelSelect, unref(errorTolerance)]
1594
+ ])
1595
+ ]);
1596
+ };
1597
+ }
1598
+ });
1599
+ const RANK_TYPES = [
1600
+ "otu",
1601
+ "subspecies",
1602
+ "species",
1603
+ "subgenus",
1604
+ "genus",
1605
+ "subtribe",
1606
+ "tribe",
1607
+ "subfamily",
1608
+ "family"
1609
+ ];
1610
+ const _hoisted_1$t = /* @__PURE__ */ createElementVNode("label", { class: "d-block" }, "Identified to rank", -1);
1611
+ const _hoisted_2$f = /* @__PURE__ */ createElementVNode("option", { value: void 0 }, null, -1);
1612
+ const _sfc_main$w = /* @__PURE__ */ defineComponent({
1613
+ __name: "FilterRank",
1614
+ setup(__props) {
1615
+ const store = useFilterStore();
1616
+ const rankSelected = computed({
1617
+ get() {
1618
+ return store.getIdentifiedToRank;
1619
+ },
1620
+ set(value) {
1621
+ store.$patch({ identifiedToRank: value });
1622
+ }
1623
+ });
1624
+ return (_ctx, _cache) => {
1625
+ return openBlock(), createElementBlock("div", null, [
1626
+ _hoisted_1$t,
1627
+ withDirectives(createElementVNode("select", {
1628
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(rankSelected) ? rankSelected.value = $event : null)
1629
+ }, [
1630
+ _hoisted_2$f,
1631
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(RANK_TYPES), (rank) => {
1632
+ return openBlock(), createElementBlock("option", { key: rank }, toDisplayString(rank), 1);
1633
+ }), 128))
1634
+ ], 512), [
1635
+ [vModelSelect, unref(rankSelected)]
1636
+ ])
1637
+ ]);
1638
+ };
1639
+ }
1640
+ });
1641
+ const _hoisted_1$s = /* @__PURE__ */ createElementVNode("label", { class: "d-block" }, "Descriptor sorting", -1);
1642
+ const _hoisted_2$e = /* @__PURE__ */ createElementVNode("option", { value: void 0 }, null, -1);
1643
+ const _sfc_main$v = /* @__PURE__ */ defineComponent({
1644
+ __name: "FilterSort",
1645
+ setup(__props) {
1646
+ const SORT_TYPES = [
1647
+ "ordered",
1648
+ "weighted",
1649
+ "optimized"
1650
+ ];
1651
+ const store = useFilterStore();
1652
+ const sortDescriptors = computed({
1653
+ get() {
1654
+ return store.getSorting;
1655
+ },
1656
+ set(value) {
1657
+ store.$patch({ sorting: value });
1658
+ }
1659
+ });
1660
+ return (_ctx, _cache) => {
1661
+ return openBlock(), createElementBlock("div", null, [
1662
+ _hoisted_1$s,
1663
+ withDirectives(createElementVNode("select", {
1664
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(sortDescriptors) ? sortDescriptors.value = $event : null)
1665
+ }, [
1666
+ _hoisted_2$e,
1667
+ (openBlock(), createElementBlock(Fragment, null, renderList(SORT_TYPES, (rank) => {
1668
+ return createElementVNode("option", { key: rank }, toDisplayString(rank), 1);
1669
+ }), 64))
1670
+ ], 512), [
1671
+ [vModelSelect, unref(sortDescriptors)]
1672
+ ])
1673
+ ]);
1674
+ };
1675
+ }
1676
+ });
1677
+ const _hoisted_1$r = /* @__PURE__ */ createElementVNode("label", {
1678
+ for: "languages",
1679
+ class: "d-block"
1680
+ }, " Languages ", -1);
1681
+ const _hoisted_2$d = ["value"];
1682
+ const _sfc_main$u = /* @__PURE__ */ defineComponent({
1683
+ __name: "FilterLanguage",
1684
+ setup(__props) {
1685
+ const filterStore = useFilterStore();
1686
+ const store = useObservationMatrixStore();
1687
+ const language = computed({
1688
+ get: () => filterStore.getLanguageId,
1689
+ set: (languageId) => {
1690
+ filterStore.setLanguageId(Number(languageId));
1691
+ }
1692
+ });
1693
+ return (_ctx, _cache) => {
1694
+ return openBlock(), createElementBlock("div", null, [
1695
+ _hoisted_1$r,
1696
+ withDirectives(createElementVNode("select", {
1697
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(language) ? language.value = $event : null),
1698
+ name: "languages",
1699
+ role: "listbox"
1700
+ }, [
1701
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(store).getLanguages, ({ languageId, name }) => {
1702
+ return openBlock(), createElementBlock("option", {
1703
+ key: languageId,
1704
+ value: languageId
1705
+ }, toDisplayString(name), 9, _hoisted_2$d);
1706
+ }), 128))
1707
+ ], 512), [
1708
+ [vModelSelect, unref(language)]
1709
+ ])
1710
+ ]);
1711
+ };
1712
+ }
1713
+ });
1714
+ var VBtn_vue_vue_type_style_index_0_lang = /* @__PURE__ */ (() => ".btn{border-radius:8px;border:none}.btn-primary-color{background-color:var(--primary-color);color:#fff}.btn-medium-size{min-height:var(--btn-medium-size)}\n")();
1715
+ const _sfc_main$t = /* @__PURE__ */ defineComponent({
1716
+ __name: "VBtn",
1717
+ props: {
1718
+ color: { default: "primary" },
1719
+ size: { default: "medium" }
1720
+ },
1721
+ setup(__props) {
1722
+ const props = __props;
1723
+ const buttonClasses = computed(() => [
1724
+ `btn-${props.color}-color`,
1725
+ `btn-${props.size}-size`
1726
+ ]);
1727
+ return (_ctx, _cache) => {
1728
+ return openBlock(), createElementBlock("button", {
1729
+ type: "button",
1730
+ class: normalizeClass(["btn", unref(buttonClasses)])
1731
+ }, [
1732
+ renderSlot(_ctx.$slots, "default")
1733
+ ], 2);
1734
+ };
1735
+ }
1736
+ });
1737
+ var VModal_vue_vue_type_style_index_0_lang = /* @__PURE__ */ (() => '.modal-mask{position:fixed;z-index:1099;top:0;left:0;width:100%;height:100%;background-color:#00000080;display:table;transition:opacity .3s ease}.modal-wrapper{display:table-cell;vertical-align:middle}.modal-container{position:relative;width:300px;margin:0 auto;padding:20px 30px;background-color:#fff;border-radius:2px;box-shadow:0 2px 8px #00000054;transition:all .3s ease;font-family:IBM Plex Sans,Helvetica,Arial,sans-serif;max-height:90vh;overflow-y:auto}.modal-close{position:absolute;cursor:pointer;top:26px;right:30px;width:10px;height:10px;background-image:image-url("close.svg");background-size:10px 10px;opacity:.4}.modal-close:hover{opacity:1}.modal-header h3{margin-top:0;color:#42b983}.modal-body{margin:20px 0}.modal-default-button{float:right}.modal-enter,.modal-leave-active{opacity:0}.modal-enter .modal-container,.modal-leave-active .modal-container{-webkit-transform:scale(1.1);transform:scale(1.1)}.transparent-modal{background-color:#000c!important}.transparent-modal .modal-header h3{margin:0 0 2em 2em;padding:6px 6px 6px 12px;border-radius:3px;background-color:#0000004d;color:#ffffff80}.transparent-modal .modal-close{right:42px;top:30px;color:#ffffff80;background-image:image-url("w_close.svg")}.transparent-modal .modal-container{width:70%;position:relative;background-color:transparent!important;box-shadow:none}.transparent-modal .modal-container .modal-body{overflow:auto;margin-right:1em;max-height:80vh}.transparent-modal .modal-container .modal-body::-webkit-scrollbar{position:absolute;right:40px;-webkit-appearance:none}.transparent-modal .modal-container .modal-body::-webkit-scrollbar:vertical{width:6px}.transparent-modal .modal-container .modal-body::-webkit-scrollbar:horizontal{height:6px}.transparent-modal .modal-container .modal-body::-webkit-scrollbar-thumb{border-radius:8px;width:11px;height:5px;border:rgba(255,255,255,.5);background-color:#ffffff80}.transparent-modal .modal-container .modal-body::-webkit-scrollbar-track{background-color:#0000004d;border-radius:8px}\n')();
1738
+ const _hoisted_1$q = { class: "modal-wrapper" };
1739
+ const _hoisted_2$c = { class: "modal-header" };
1740
+ const _hoisted_3$8 = { class: "modal-body" };
1741
+ const _hoisted_4$5 = { class: "modal-footer" };
1742
+ const _sfc_main$s = /* @__PURE__ */ defineComponent({
1743
+ __name: "VModal",
1744
+ props: {
1745
+ containerClass: null,
1746
+ containerStyle: null
1747
+ },
1748
+ emits: ["close"],
1749
+ setup(__props, { emit }) {
1750
+ const handleKeyboard = (event) => {
1751
+ event.preventDefault();
1752
+ if (event.key === "Escape") {
1753
+ emit("close");
1754
+ }
1755
+ };
1756
+ onMounted(() => document.addEventListener("keydown", handleKeyboard));
1757
+ onUnmounted(() => document.removeEventListener("keydown", handleKeyboard));
1758
+ return (_ctx, _cache) => {
1759
+ return openBlock(), createBlock(Transition, { name: "modal" }, {
1760
+ default: withCtx(() => [
1761
+ createElementVNode("div", {
1762
+ class: "modal-mask",
1763
+ onClick: _cache[2] || (_cache[2] = ($event) => emit("close")),
1764
+ onKey: _cache[3] || (_cache[3] = ($event) => emit("close"))
1765
+ }, [
1766
+ createElementVNode("div", _hoisted_1$q, [
1767
+ createElementVNode("div", {
1768
+ class: normalizeClass(["modal-container", __props.containerClass]),
1769
+ style: normalizeStyle(__spreadValues({}, __props.containerStyle)),
1770
+ onClick: _cache[1] || (_cache[1] = withModifiers(() => {
1771
+ }, ["stop"]))
1772
+ }, [
1773
+ createElementVNode("div", _hoisted_2$c, [
1774
+ createElementVNode("div", {
1775
+ class: "modal-close",
1776
+ onClick: _cache[0] || (_cache[0] = ($event) => emit("close"))
1777
+ }),
1778
+ renderSlot(_ctx.$slots, "header")
1779
+ ]),
1780
+ createElementVNode("div", _hoisted_3$8, [
1781
+ renderSlot(_ctx.$slots, "body")
1782
+ ]),
1783
+ createElementVNode("div", _hoisted_4$5, [
1784
+ renderSlot(_ctx.$slots, "footer")
1785
+ ])
1786
+ ], 6)
1787
+ ])
1788
+ ], 32)
1789
+ ]),
1790
+ _: 3
1791
+ });
1792
+ };
1793
+ }
1794
+ });
1795
+ const _hoisted_1$p = /* @__PURE__ */ createTextVNode(" Keyword ");
1796
+ const _hoisted_2$b = /* @__PURE__ */ createElementVNode("h3", null, "Keywords", -1);
1797
+ const _hoisted_3$7 = { class: "list-none p-0" };
1798
+ const _hoisted_4$4 = ["value"];
1799
+ const _sfc_main$r = /* @__PURE__ */ defineComponent({
1800
+ __name: "FilterKeywords",
1801
+ setup(__props) {
1802
+ const store = useObservationMatrixStore();
1803
+ const filterStore = useFilterStore();
1804
+ const isModalVisible = ref(false);
1805
+ const keywordIds = computed({
1806
+ get: () => filterStore.getKeywordIds,
1807
+ set: (value) => {
1808
+ filterStore.$patch({ keywordIds: value });
1809
+ }
1810
+ });
1811
+ return (_ctx, _cache) => {
1812
+ return openBlock(), createElementBlock(Fragment, null, [
1813
+ createVNode(_sfc_main$t, {
1814
+ color: "primary",
1815
+ size: "medium",
1816
+ onClick: _cache[0] || (_cache[0] = ($event) => isModalVisible.value = true)
1817
+ }, {
1818
+ default: withCtx(() => [
1819
+ _hoisted_1$p
1820
+ ]),
1821
+ _: 1
1822
+ }),
1823
+ isModalVisible.value ? (openBlock(), createBlock(_sfc_main$s, {
1824
+ key: 0,
1825
+ onClose: _cache[2] || (_cache[2] = ($event) => isModalVisible.value = false)
1826
+ }, {
1827
+ header: withCtx(() => [
1828
+ _hoisted_2$b
1829
+ ]),
1830
+ body: withCtx(() => [
1831
+ createElementVNode("ul", _hoisted_3$7, [
1832
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(store).getKeywords, ({ keywordId, name }) => {
1833
+ return openBlock(), createElementBlock("li", { key: keywordId }, [
1834
+ createElementVNode("label", null, [
1835
+ withDirectives(createElementVNode("input", {
1836
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isRef(keywordIds) ? keywordIds.value = $event : null),
1837
+ value: keywordId,
1838
+ type: "checkbox"
1839
+ }, null, 8, _hoisted_4$4), [
1840
+ [vModelCheckbox, unref(keywordIds)]
1841
+ ]),
1842
+ createTextVNode(" " + toDisplayString(name), 1)
1843
+ ])
1844
+ ]);
1845
+ }), 128))
1846
+ ])
1847
+ ]),
1848
+ _: 1
1849
+ })) : createCommentVNode("", true)
1850
+ ], 64);
1851
+ };
1852
+ }
1853
+ });
1854
+ const _hoisted_1$o = /* @__PURE__ */ createTextVNode(" Refresh only taxa ");
1855
+ const _sfc_main$q = /* @__PURE__ */ defineComponent({
1856
+ __name: "SettingRefresh",
1857
+ setup(__props) {
1858
+ const store = useSettingsStore();
1859
+ const refreshTaxa = computed({
1860
+ get: () => store.getRefreshOnlyTaxa,
1861
+ set: (value) => {
1862
+ store.setRefreshOnlyTaxa(value);
1863
+ }
1864
+ });
1865
+ return (_ctx, _cache) => {
1866
+ return openBlock(), createElementBlock("label", null, [
1867
+ withDirectives(createElementVNode("input", {
1868
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(refreshTaxa) ? refreshTaxa.value = $event : null),
1869
+ type: "checkbox"
1870
+ }, null, 512), [
1871
+ [vModelCheckbox, unref(refreshTaxa)]
1872
+ ]),
1873
+ _hoisted_1$o
1874
+ ]);
1875
+ };
1876
+ }
1877
+ });
1878
+ var MenuList_vue_vue_type_style_index_0_lang = /* @__PURE__ */ (() => ".menu-list{display:flex;list-style:none;align-items:center;margin:0}.menu-list li:first-child{padding-left:0}\n")();
1879
+ var _export_sfc = (sfc, props) => {
1880
+ const target = sfc.__vccOpts || sfc;
1881
+ for (const [key, val] of props) {
1882
+ target[key] = val;
1883
+ }
1884
+ return target;
1885
+ };
1886
+ const _sfc_main$p = {};
1887
+ const _hoisted_1$n = { class: "menu-list" };
1888
+ function _sfc_render$2(_ctx, _cache) {
1889
+ return openBlock(), createElementBlock("ul", _hoisted_1$n, [
1890
+ renderSlot(_ctx.$slots, "default")
1891
+ ]);
1892
+ }
1893
+ var MenuList = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["render", _sfc_render$2]]);
1894
+ var MenuItem_vue_vue_type_style_index_0_scoped_true_lang = /* @__PURE__ */ (() => ".list-item[data-v-3f00bdeb]{justify-content:center;padding-left:1em;padding-right:1em;border-right:1px solid #e5e5e5}\n")();
1895
+ const _sfc_main$o = {};
1896
+ const _hoisted_1$m = { class: "list-item" };
1897
+ function _sfc_render$1(_ctx, _cache) {
1898
+ return openBlock(), createElementBlock("li", _hoisted_1$m, [
1899
+ renderSlot(_ctx.$slots, "default", {}, void 0, true)
1900
+ ]);
1901
+ }
1902
+ var MenuListItem = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["render", _sfc_render$1], ["__scopeId", "data-v-3f00bdeb"]]);
1903
+ const LAYOUT_MODES = {
1904
+ "layout-mode-1": "layout-mode-2",
1905
+ "layout-mode-2": "layout-mode-1"
1906
+ };
1907
+ var VGrid_vue_vue_type_style_index_0_scoped_true_lang = /* @__PURE__ */ (() => ".grid[data-v-203acd5e]{display:grid;grid-template-columns:repeat(2,1fr);grid-template-rows:repeat(2,1fr);grid-column-gap:0px;grid-row-gap:0px;grid-gap:1px;background-color:var(--border-color);box-shadow:0 2px 2px #0003}\n")();
1908
+ const _sfc_main$n = {};
1909
+ const _hoisted_1$l = { class: "grid" };
1910
+ function _sfc_render(_ctx, _cache) {
1911
+ return openBlock(), createElementBlock("div", _hoisted_1$l, [
1912
+ renderSlot(_ctx.$slots, "default", {}, void 0, true)
1913
+ ]);
1914
+ }
1915
+ var VGrid = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["render", _sfc_render], ["__scopeId", "data-v-203acd5e"]]);
1916
+ var GridToggle_vue_vue_type_style_index_0_lang = /* @__PURE__ */ (() => ".grid-icon{width:20px;height:12px;border:2px solid transparent;background-color:transparent;grid-gap:2px}.grid-icon>div{background-color:#fff}\n")();
1917
+ const _hoisted_1$k = /* @__PURE__ */ createElementVNode("div", { class: "panel-descriptors" }, null, -1);
1918
+ const _hoisted_2$a = /* @__PURE__ */ createElementVNode("div", { class: "panel-remaining" }, null, -1);
1919
+ const _hoisted_3$6 = /* @__PURE__ */ createElementVNode("div", { class: "panel-eliminated" }, null, -1);
1920
+ const _sfc_main$m = /* @__PURE__ */ defineComponent({
1921
+ __name: "GridToggle",
1922
+ setup(__props) {
1923
+ const store = useSettingsStore();
1924
+ const gridLayout = computed(() => store.getLayout);
1925
+ const setLayout = () => {
1926
+ store.$patch({
1927
+ gridLayout: LAYOUT_MODES[gridLayout.value]
1928
+ });
1929
+ };
1930
+ return (_ctx, _cache) => {
1931
+ return openBlock(), createBlock(_sfc_main$t, {
1932
+ class: normalizeClass(unref(LAYOUT_MODES)[unref(gridLayout)]),
1933
+ onClick: setLayout
1934
+ }, {
1935
+ default: withCtx(() => [
1936
+ createVNode(VGrid, { class: "grid-icon" }, {
1937
+ default: withCtx(() => [
1938
+ _hoisted_1$k,
1939
+ _hoisted_2$a,
1940
+ _hoisted_3$6
1941
+ ]),
1942
+ _: 1
1943
+ })
1944
+ ]),
1945
+ _: 1
1946
+ }, 8, ["class"]);
1947
+ };
1948
+ }
1949
+ });
1950
+ const _hoisted_1$j = /* @__PURE__ */ createTextVNode(" Reset ");
1951
+ const _sfc_main$l = /* @__PURE__ */ defineComponent({
1952
+ __name: "ResetButton",
1953
+ setup(__props) {
1954
+ const store = useFilterStore();
1955
+ return (_ctx, _cache) => {
1956
+ return openBlock(), createBlock(_sfc_main$t, {
1957
+ color: "primary",
1958
+ size: "medium",
1959
+ onClick: _cache[0] || (_cache[0] = ($event) => unref(store).$reset())
1960
+ }, {
1961
+ default: withCtx(() => [
1962
+ _hoisted_1$j
1963
+ ]),
1964
+ _: 1
1965
+ });
1966
+ };
1967
+ }
1968
+ });
1969
+ var HeaderBar_vue_vue_type_style_index_0_scoped_true_lang = /* @__PURE__ */ (() => ".header-bar[data-v-2f031624]{background-color:var(--bg-panel-color);padding:1em;box-shadow:#24252614 4px 4px 15px;border-radius:.9rem;display:flex;justify-content:space-between;align-items:center}.header-bar__buttons[data-v-2f031624]{display:flex;align-items:center}\n")();
1970
+ const _withScopeId$1 = (n) => (pushScopeId("data-v-2f031624"), n = n(), popScopeId(), n);
1971
+ const _hoisted_1$i = { class: "header-bar" };
1972
+ const _hoisted_2$9 = /* @__PURE__ */ _withScopeId$1(() => /* @__PURE__ */ createElementVNode("div", null, null, -1));
1973
+ const _hoisted_3$5 = { class: "header-bar__buttons" };
1974
+ const _sfc_main$k = /* @__PURE__ */ defineComponent({
1975
+ __name: "HeaderBar",
1976
+ setup(__props) {
1977
+ return (_ctx, _cache) => {
1978
+ return openBlock(), createElementBlock("div", _hoisted_1$i, [
1979
+ _hoisted_2$9,
1980
+ createVNode(MenuList, null, {
1981
+ default: withCtx(() => [
1982
+ createVNode(MenuListItem, null, {
1983
+ default: withCtx(() => [
1984
+ createVNode(_sfc_main$q)
1985
+ ]),
1986
+ _: 1
1987
+ }),
1988
+ createVNode(MenuListItem, null, {
1989
+ default: withCtx(() => [
1990
+ createVNode(_sfc_main$y)
1991
+ ]),
1992
+ _: 1
1993
+ }),
1994
+ createVNode(MenuListItem, null, {
1995
+ default: withCtx(() => [
1996
+ createVNode(_sfc_main$x)
1997
+ ]),
1998
+ _: 1
1999
+ }),
2000
+ createVNode(MenuListItem, null, {
2001
+ default: withCtx(() => [
2002
+ createVNode(_sfc_main$w)
2003
+ ]),
2004
+ _: 1
2005
+ }),
2006
+ createVNode(MenuListItem, null, {
2007
+ default: withCtx(() => [
2008
+ createVNode(_sfc_main$u)
2009
+ ]),
2010
+ _: 1
2011
+ }),
2012
+ createVNode(MenuListItem, null, {
2013
+ default: withCtx(() => [
2014
+ createVNode(_sfc_main$v)
2015
+ ]),
2016
+ _: 1
2017
+ }),
2018
+ createVNode(MenuListItem, null, {
2019
+ default: withCtx(() => [
2020
+ createVNode(_sfc_main$r)
2021
+ ]),
2022
+ _: 1
2023
+ })
2024
+ ]),
2025
+ _: 1
2026
+ }),
2027
+ createElementVNode("div", _hoisted_3$5, [
2028
+ createVNode(_sfc_main$l, { class: "margin-small-right" }),
2029
+ createVNode(_sfc_main$m)
2030
+ ])
2031
+ ]);
2032
+ };
2033
+ }
2034
+ });
2035
+ var HeaderBar = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["__scopeId", "data-v-2f031624"]]);
2036
+ const _hoisted_1$h = ["innerHTML"];
2037
+ const _sfc_main$j = /* @__PURE__ */ defineComponent({
2038
+ __name: "PanelRowItem",
2039
+ props: {
2040
+ row: null
2041
+ },
2042
+ setup(__props) {
2043
+ return (_ctx, _cache) => {
2044
+ return openBlock(), createElementBlock("li", {
2045
+ innerHTML: __props.row.objectTag
2046
+ }, null, 8, _hoisted_1$h);
2047
+ };
2048
+ }
2049
+ });
2050
+ const _sfc_main$i = /* @__PURE__ */ defineComponent({
2051
+ __name: "PanelEliminated",
2052
+ setup(__props) {
2053
+ const store = useObservationMatrixStore();
2054
+ const eliminated = computed(() => store.getEliminated);
2055
+ return (_ctx, _cache) => {
2056
+ return openBlock(), createElementBlock("div", null, [
2057
+ createElementVNode("h2", null, "Eliminated (" + toDisplayString(unref(eliminated).length) + ")", 1),
2058
+ createElementVNode("ul", null, [
2059
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(eliminated), (item) => {
2060
+ return openBlock(), createBlock(_sfc_main$j, {
2061
+ key: item.rowId,
2062
+ row: item,
2063
+ class: "margin-small-bottom"
2064
+ }, null, 8, ["row"]);
2065
+ }), 128))
2066
+ ])
2067
+ ]);
2068
+ };
2069
+ }
2070
+ });
2071
+ const _hoisted_1$g = /* @__PURE__ */ createTextVNode(" Select ");
2072
+ const _hoisted_2$8 = /* @__PURE__ */ createElementVNode("h3", null, "Filter row", -1);
2073
+ const _hoisted_3$4 = { class: "list-none p-0" };
2074
+ const _hoisted_4$3 = ["value"];
2075
+ const _sfc_main$h = /* @__PURE__ */ defineComponent({
2076
+ __name: "FilterRow",
2077
+ setup(__props) {
2078
+ const store = useObservationMatrixStore();
2079
+ const settingStore = useSettingsStore();
2080
+ const filterStore = useFilterStore();
2081
+ const isModalVisible = ref(false);
2082
+ const previousRowIds = ref([]);
2083
+ const hasChanged = computed(() => {
2084
+ const newValue = filterStore.getRowIds;
2085
+ const oldValue = previousRowIds.value;
2086
+ return newValue.length !== oldValue.length || !newValue.every((id) => oldValue.includes(id));
2087
+ });
2088
+ const rowIds = computed({
2089
+ get: () => filterStore.getRowIds,
2090
+ set: (value) => {
2091
+ filterStore.$patch({ rowIds: value });
2092
+ }
2093
+ });
2094
+ watch(isModalVisible, (newValue) => {
2095
+ settingStore.setShouldUpdate(!newValue);
2096
+ if (!newValue && hasChanged.value) {
2097
+ settingStore.checkUpdate();
2098
+ }
2099
+ previousRowIds.value = filterStore.getRowIds;
2100
+ });
2101
+ return (_ctx, _cache) => {
2102
+ return openBlock(), createElementBlock(Fragment, null, [
2103
+ createVNode(_sfc_main$t, {
2104
+ color: "primary",
2105
+ size: "medium",
2106
+ onClick: _cache[0] || (_cache[0] = ($event) => isModalVisible.value = true)
2107
+ }, {
2108
+ default: withCtx(() => [
2109
+ _hoisted_1$g
2110
+ ]),
2111
+ _: 1
2112
+ }),
2113
+ isModalVisible.value ? (openBlock(), createBlock(_sfc_main$s, {
2114
+ key: 0,
2115
+ onClose: _cache[2] || (_cache[2] = ($event) => isModalVisible.value = false)
2116
+ }, {
2117
+ header: withCtx(() => [
2118
+ _hoisted_2$8
2119
+ ]),
2120
+ body: withCtx(() => [
2121
+ createElementVNode("ul", _hoisted_3$4, [
2122
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(store).getRemaining, (row) => {
2123
+ return openBlock(), createElementBlock("li", {
2124
+ key: row.rowId
2125
+ }, [
2126
+ createElementVNode("label", null, [
2127
+ withDirectives(createElementVNode("input", {
2128
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isRef(rowIds) ? rowIds.value = $event : null),
2129
+ value: row.rowId,
2130
+ type: "checkbox"
2131
+ }, null, 8, _hoisted_4$3), [
2132
+ [vModelCheckbox, unref(rowIds)]
2133
+ ]),
2134
+ createTextVNode(" " + toDisplayString(row.objectLabel), 1)
2135
+ ])
2136
+ ]);
2137
+ }), 128))
2138
+ ])
2139
+ ]),
2140
+ _: 1
2141
+ })) : createCommentVNode("", true)
2142
+ ], 64);
2143
+ };
2144
+ }
2145
+ });
2146
+ const _hoisted_1$f = { class: "d-flex justify-between align-center" };
2147
+ const _sfc_main$g = /* @__PURE__ */ defineComponent({
2148
+ __name: "PanelRemaining",
2149
+ setup(__props) {
2150
+ const store = useObservationMatrixStore();
2151
+ const remaining = computed(() => store.getRemaining);
2152
+ return (_ctx, _cache) => {
2153
+ return openBlock(), createElementBlock("div", null, [
2154
+ createElementVNode("div", _hoisted_1$f, [
2155
+ createElementVNode("h2", null, "Remaining (" + toDisplayString(unref(remaining).length) + ")", 1),
2156
+ createVNode(_sfc_main$h)
2157
+ ]),
2158
+ createElementVNode("ul", null, [
2159
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(remaining), (item) => {
2160
+ return openBlock(), createBlock(_sfc_main$j, {
2161
+ key: item.rowId,
2162
+ row: item,
2163
+ class: "margin-small-bottom"
2164
+ }, null, 8, ["row"]);
2165
+ }), 128))
2166
+ ])
2167
+ ]);
2168
+ };
2169
+ }
2170
+ });
2171
+ class Depiction {
2172
+ static find(id) {
2173
+ return useRequest().get(`/depictions/${id}.json`, { params: { extend: ["image"] } });
2174
+ }
2175
+ }
2176
+ var VDepiction_vue_vue_type_style_index_0_lang = /* @__PURE__ */ (() => ".depiction-box{display:flex;align-items:center;justify-content:center;border:1px solid black;height:300px;width:300px}\n")();
2177
+ const _hoisted_1$e = {
2178
+ key: 0,
2179
+ class: "depiction-box"
2180
+ };
2181
+ const _hoisted_2$7 = ["src"];
2182
+ const _sfc_main$f = /* @__PURE__ */ defineComponent({
2183
+ __name: "VDepiction",
2184
+ props: {
2185
+ depictionId: null
2186
+ },
2187
+ setup(__props) {
2188
+ const props = __props;
2189
+ const depiction = ref();
2190
+ Depiction.find(props.depictionId).then(({ data: data2 }) => {
2191
+ depiction.value = makeDepiction(data2);
2192
+ });
2193
+ return (_ctx, _cache) => {
2194
+ return depiction.value ? (openBlock(), createElementBlock("div", _hoisted_1$e, [
2195
+ createElementVNode("img", {
2196
+ src: depiction.value.imageUrl
2197
+ }, null, 8, _hoisted_2$7)
2198
+ ])) : createCommentVNode("", true);
2199
+ };
2200
+ }
2201
+ });
2202
+ var CharacterStateCell_vue_vue_type_style_index_0_lang = /* @__PURE__ */ (() => ".character-descriptor__cell{display:flex;align-items:flex-end}\n")();
2203
+ const _hoisted_1$d = { class: "character-descriptor__cell" };
2204
+ const _hoisted_2$6 = ["value"];
2205
+ const _sfc_main$e = /* @__PURE__ */ defineComponent({
2206
+ __name: "CharacterStateCell",
2207
+ props: {
2208
+ characterState: null,
2209
+ descriptorId: null
2210
+ },
2211
+ setup(__props) {
2212
+ const props = __props;
2213
+ const store = useFilterStore();
2214
+ const updateCharacterStateFilter = computed({
2215
+ get: () => store.getDescriptorValueById(props.descriptorId) || [],
2216
+ set: (value) => {
2217
+ if (value.length) {
2218
+ store.setDescriptor({
2219
+ descriptorId: props.descriptorId,
2220
+ value
2221
+ });
2222
+ } else {
2223
+ store.removeDescriptor(props.descriptorId);
2224
+ }
2225
+ }
2226
+ });
2227
+ return (_ctx, _cache) => {
2228
+ return openBlock(), createElementBlock("div", _hoisted_1$d, [
2229
+ createElementVNode("label", null, [
2230
+ (openBlock(true), createElementBlock(Fragment, null, renderList(__props.characterState.depictionIds, (depictionId) => {
2231
+ return openBlock(), createBlock(_sfc_main$f, {
2232
+ key: depictionId,
2233
+ "depiction-id": depictionId
2234
+ }, null, 8, ["depiction-id"]);
2235
+ }), 128)),
2236
+ withDirectives(createElementVNode("input", {
2237
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(updateCharacterStateFilter) ? updateCharacterStateFilter.value = $event : null),
2238
+ value: __props.characterState.characterStateId,
2239
+ type: "checkbox"
2240
+ }, null, 8, _hoisted_2$6), [
2241
+ [vModelCheckbox, unref(updateCharacterStateFilter)]
2242
+ ]),
2243
+ createTextVNode(" " + toDisplayString(__props.characterState.name), 1)
2244
+ ])
2245
+ ]);
2246
+ };
2247
+ }
2248
+ });
2249
+ var CharacterStateGrid_vue_vue_type_style_index_0_lang = /* @__PURE__ */ (() => ".character-states-grid{display:grid;grid-template-columns:repeat(3,minmax(33.33%,1fr));gap:1em}\n")();
2250
+ const _hoisted_1$c = { class: "character-states-grid" };
2251
+ const _sfc_main$d = /* @__PURE__ */ defineComponent({
2252
+ __name: "CharacterStateGrid",
2253
+ props: {
2254
+ descriptor: null
2255
+ },
2256
+ setup(__props) {
2257
+ const props = __props;
2258
+ const filterStore = useFilterStore();
2259
+ const settingStore = useSettingsStore();
2260
+ const descriptorFilter = ref();
2261
+ const hasChanged = computed(() => {
2262
+ const newValue = filterStore.getDescriptorValueById(props.descriptor.descriptorId) || [];
2263
+ const oldValue = descriptorFilter.value || [];
2264
+ return newValue.length !== oldValue.length || !newValue.every((id) => oldValue.includes(id));
2265
+ });
2266
+ onMounted(() => {
2267
+ settingStore.setShouldUpdate(false);
2268
+ descriptorFilter.value = filterStore.getDescriptorValueById(props.descriptor.descriptorId);
2269
+ });
2270
+ onUnmounted(() => {
2271
+ settingStore.setShouldUpdate(true);
2272
+ if (hasChanged.value) {
2273
+ settingStore.checkUpdate();
2274
+ }
2275
+ });
2276
+ return (_ctx, _cache) => {
2277
+ return openBlock(), createElementBlock("div", _hoisted_1$c, [
2278
+ (openBlock(true), createElementBlock(Fragment, null, renderList(__props.descriptor.characterStates, (characterState) => {
2279
+ return openBlock(), createBlock(_sfc_main$e, {
2280
+ key: characterState.characterStateId,
2281
+ "descriptor-id": __props.descriptor.descriptorId,
2282
+ "character-state": characterState
2283
+ }, null, 8, ["descriptor-id", "character-state"]);
2284
+ }), 128))
2285
+ ]);
2286
+ };
2287
+ }
2288
+ });
2289
+ var DescriptorModal_vue_vue_type_style_index_0_lang = /* @__PURE__ */ (() => ".descriptor-modal{width:1000px;max-height:90vh;overflow-y:scroll}.descriptor-modal__depiction{display:flex;justify-content:center}\n")();
2290
+ const _hoisted_1$b = { key: 0 };
2291
+ const _hoisted_2$5 = { class: "descriptor-modal__depiction" };
2292
+ const _hoisted_3$3 = /* @__PURE__ */ createElementVNode("hr", null, null, -1);
2293
+ const _sfc_main$c = /* @__PURE__ */ defineComponent({
2294
+ __name: "DescriptorModal",
2295
+ props: {
2296
+ descriptor: null
2297
+ },
2298
+ setup(__props) {
2299
+ return (_ctx, _cache) => {
2300
+ return openBlock(), createBlock(_sfc_main$s, { "container-class": "descriptor-modal" }, {
2301
+ header: withCtx(() => [
2302
+ createElementVNode("h3", null, toDisplayString(__props.descriptor.name), 1),
2303
+ __props.descriptor.description ? (openBlock(), createElementBlock("span", _hoisted_1$b, toDisplayString(__props.descriptor.description), 1)) : createCommentVNode("", true)
2304
+ ]),
2305
+ body: withCtx(() => [
2306
+ createElementVNode("div", _hoisted_2$5, [
2307
+ (openBlock(true), createElementBlock(Fragment, null, renderList(__props.descriptor.depictionIds, (depictionId) => {
2308
+ return openBlock(), createBlock(_sfc_main$f, {
2309
+ key: depictionId,
2310
+ "depiction-id": depictionId
2311
+ }, null, 8, ["depiction-id"]);
2312
+ }), 128))
2313
+ ]),
2314
+ _hoisted_3$3,
2315
+ __props.descriptor.type === unref(descriptorTypes).Qualitative ? (openBlock(), createBlock(_sfc_main$d, {
2316
+ key: 0,
2317
+ descriptor: __props.descriptor
2318
+ }, null, 8, ["descriptor"])) : createCommentVNode("", true)
2319
+ ]),
2320
+ _: 1
2321
+ });
2322
+ };
2323
+ }
2324
+ });
2325
+ const _hoisted_1$a = ["id"];
2326
+ const _hoisted_2$4 = { class: "d-block" };
2327
+ const _sfc_main$b = /* @__PURE__ */ defineComponent({
2328
+ __name: "DescriptorContainer",
2329
+ props: {
2330
+ descriptor: null
2331
+ },
2332
+ setup(__props) {
2333
+ const isModalVisible = ref(false);
2334
+ return (_ctx, _cache) => {
2335
+ return openBlock(), createElementBlock(Fragment, null, [
2336
+ createElementVNode("div", {
2337
+ id: `descriptor-${__props.descriptor.descriptorId}`
2338
+ }, [
2339
+ createElementVNode("div", _hoisted_2$4, [
2340
+ createElementVNode("span", {
2341
+ class: "link",
2342
+ onClick: _cache[0] || (_cache[0] = ($event) => isModalVisible.value = true)
2343
+ }, [
2344
+ renderSlot(_ctx.$slots, "title", {}, () => [
2345
+ createTextVNode(toDisplayString(__props.descriptor.name), 1)
2346
+ ])
2347
+ ])
2348
+ ]),
2349
+ renderSlot(_ctx.$slots, "default")
2350
+ ], 8, _hoisted_1$a),
2351
+ isModalVisible.value ? (openBlock(), createBlock(_sfc_main$c, {
2352
+ key: 0,
2353
+ descriptor: __props.descriptor,
2354
+ onClose: _cache[1] || (_cache[1] = ($event) => isModalVisible.value = false)
2355
+ }, null, 8, ["descriptor"])) : createCommentVNode("", true)
2356
+ ], 64);
2357
+ };
2358
+ }
2359
+ });
2360
+ const _hoisted_1$9 = ["onKeyup"];
2361
+ const _sfc_main$a = /* @__PURE__ */ defineComponent({
2362
+ __name: "DescriptorContinuous",
2363
+ props: {
2364
+ descriptor: null
2365
+ },
2366
+ setup(__props) {
2367
+ const props = __props;
2368
+ const useStore = useFilterStore();
2369
+ const fieldValue = ref(String(useStore.getDescriptorValueById(props.descriptor.descriptorId)));
2370
+ const setDescriptorValue = () => {
2371
+ useStore.setDescriptor({
2372
+ descriptorId: props.descriptor.descriptorId,
2373
+ value: fieldValue.value
2374
+ });
2375
+ };
2376
+ return (_ctx, _cache) => {
2377
+ return openBlock(), createBlock(_sfc_main$b, { descriptor: __props.descriptor }, {
2378
+ title: withCtx(() => [
2379
+ createTextVNode(toDisplayString(__props.descriptor.name) + " (" + toDisplayString(__props.descriptor.min) + "-" + toDisplayString(__props.descriptor.max) + " " + toDisplayString(__props.descriptor.defaultUnit) + ") ", 1)
2380
+ ]),
2381
+ default: withCtx(() => [
2382
+ withDirectives(createElementVNode("input", {
2383
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => fieldValue.value = $event),
2384
+ type: "text",
2385
+ onBlur: setDescriptorValue,
2386
+ onKeyup: withKeys(setDescriptorValue, ["enter"])
2387
+ }, null, 40, _hoisted_1$9), [
2388
+ [vModelText, fieldValue.value]
2389
+ ])
2390
+ ]),
2391
+ _: 1
2392
+ }, 8, ["descriptor"]);
2393
+ };
2394
+ }
2395
+ });
2396
+ const _hoisted_1$8 = /* @__PURE__ */ createElementVNode("option", null, null, -1);
2397
+ const _hoisted_2$3 = /* @__PURE__ */ createElementVNode("option", { value: true }, " Present ", -1);
2398
+ const _hoisted_3$2 = /* @__PURE__ */ createElementVNode("option", { value: false }, " Absent ", -1);
2399
+ const _hoisted_4$2 = [
2400
+ _hoisted_1$8,
2401
+ _hoisted_2$3,
2402
+ _hoisted_3$2
2403
+ ];
2404
+ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
2405
+ __name: "DescriptorPresenceAbsence",
2406
+ props: {
2407
+ descriptor: null
2408
+ },
2409
+ setup(__props) {
2410
+ const props = __props;
2411
+ const useStore = useFilterStore();
2412
+ const descriptorValue = computed({
2413
+ get: () => {
2414
+ return useStore.getDescriptorValueById(props.descriptor.descriptorId);
2415
+ },
2416
+ set: (value) => {
2417
+ const { descriptorId } = props.descriptor;
2418
+ if (typeof value === "boolean") {
2419
+ useStore.setDescriptor({
2420
+ descriptorId,
2421
+ value: Boolean(value)
2422
+ });
2423
+ } else {
2424
+ useStore.removeDescriptor(descriptorId);
2425
+ }
2426
+ }
2427
+ });
2428
+ return (_ctx, _cache) => {
2429
+ return openBlock(), createBlock(_sfc_main$b, { descriptor: __props.descriptor }, {
2430
+ default: withCtx(() => [
2431
+ withDirectives(createElementVNode("select", {
2432
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(descriptorValue) ? descriptorValue.value = $event : null)
2433
+ }, _hoisted_4$2, 512), [
2434
+ [vModelSelect, unref(descriptorValue)]
2435
+ ])
2436
+ ]),
2437
+ _: 1
2438
+ }, 8, ["descriptor"]);
2439
+ };
2440
+ }
2441
+ });
2442
+ const _hoisted_1$7 = /* @__PURE__ */ createElementVNode("option", { value: "" }, null, -1);
2443
+ const _hoisted_2$2 = ["value", "selected"];
2444
+ const _hoisted_3$1 = { key: 0 };
2445
+ const _hoisted_4$1 = { key: 1 };
2446
+ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
2447
+ __name: "DescriptorQualitative",
2448
+ props: {
2449
+ descriptor: null
2450
+ },
2451
+ setup(__props) {
2452
+ const props = __props;
2453
+ const useStore = useFilterStore();
2454
+ const setDescriptorValue = (e) => {
2455
+ const target = e.target;
2456
+ const { descriptorId } = props.descriptor;
2457
+ if (target.value) {
2458
+ useStore.setDescriptor({
2459
+ descriptorId,
2460
+ value: [Number(target.value)]
2461
+ });
2462
+ } else {
2463
+ useStore.removeDescriptor(descriptorId);
2464
+ }
2465
+ };
2466
+ const selectedOption = (characterState) => {
2467
+ const storedValue = useStore.getDescriptorValueById(props.descriptor.descriptorId);
2468
+ return storedValue.includes(characterState.characterStateId);
2469
+ };
2470
+ return (_ctx, _cache) => {
2471
+ return openBlock(), createBlock(_sfc_main$b, { descriptor: __props.descriptor }, {
2472
+ default: withCtx(() => [
2473
+ createElementVNode("select", {
2474
+ name: "listbox",
2475
+ onChange: setDescriptorValue
2476
+ }, [
2477
+ _hoisted_1$7,
2478
+ (openBlock(true), createElementBlock(Fragment, null, renderList(__props.descriptor.characterStates, (characterState) => {
2479
+ return openBlock(), createElementBlock("option", {
2480
+ key: characterState.characterStateId,
2481
+ value: characterState.characterStateId,
2482
+ selected: selectedOption(characterState)
2483
+ }, [
2484
+ selectedOption(characterState) ? (openBlock(), createElementBlock("span", _hoisted_3$1, ">")) : createCommentVNode("", true),
2485
+ characterState.status === "useless" ? (openBlock(), createElementBlock("span", _hoisted_4$1, "-")) : createCommentVNode("", true),
2486
+ createTextVNode(" " + toDisplayString(characterState.name) + " (" + toDisplayString(characterState.numberOfObjects) + ") ", 1)
2487
+ ], 8, _hoisted_2$2);
2488
+ }), 128))
2489
+ ], 32)
2490
+ ]),
2491
+ _: 1
2492
+ }, 8, ["descriptor"]);
2493
+ };
2494
+ }
2495
+ });
2496
+ const _hoisted_1$6 = ["onKeyup"];
2497
+ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
2498
+ __name: "DescriptorSample",
2499
+ props: {
2500
+ descriptor: null
2501
+ },
2502
+ setup(__props) {
2503
+ const props = __props;
2504
+ const useStore = useFilterStore();
2505
+ const fieldValue = ref(String(useStore.getDescriptorValueById(props.descriptor.descriptorId)));
2506
+ const setDescriptorValue = () => {
2507
+ useStore.setDescriptor({
2508
+ descriptorId: props.descriptor.descriptorId,
2509
+ value: fieldValue.value
2510
+ });
2511
+ };
2512
+ return (_ctx, _cache) => {
2513
+ return openBlock(), createBlock(_sfc_main$b, { descriptor: __props.descriptor }, {
2514
+ title: withCtx(() => [
2515
+ createTextVNode(toDisplayString(__props.descriptor.name) + " (" + toDisplayString(__props.descriptor.min) + "-" + toDisplayString(__props.descriptor.max) + " " + toDisplayString(__props.descriptor.defaultUnit) + ") ", 1)
2516
+ ]),
2517
+ default: withCtx(() => [
2518
+ withDirectives(createElementVNode("input", {
2519
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => fieldValue.value = $event),
2520
+ type: "text",
2521
+ onBlur: setDescriptorValue,
2522
+ onKeyup: withKeys(setDescriptorValue, ["enter"])
2523
+ }, null, 40, _hoisted_1$6), [
2524
+ [vModelText, fieldValue.value]
2525
+ ])
2526
+ ]),
2527
+ _: 1
2528
+ }, 8, ["descriptor"]);
2529
+ };
2530
+ }
2531
+ });
2532
+ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
2533
+ __name: "DescriptorsList",
2534
+ props: {
2535
+ title: null,
2536
+ descriptors: null
2537
+ },
2538
+ setup(__props) {
2539
+ const components = {
2540
+ DescriptorContinuous: _sfc_main$a,
2541
+ DescriptorPresenceAbsence: _sfc_main$9,
2542
+ DescriptorQualitative: _sfc_main$8,
2543
+ DescriptorSample: _sfc_main$7
2544
+ };
2545
+ const componentFor = (descriptorType) => {
2546
+ const componentName = descriptorType.replace("::", "");
2547
+ return components[componentName];
2548
+ };
2549
+ return (_ctx, _cache) => {
2550
+ return openBlock(), createElementBlock(Fragment, null, [
2551
+ createElementVNode("h2", null, toDisplayString(__props.title), 1),
2552
+ createElementVNode("ol", null, [
2553
+ (openBlock(true), createElementBlock(Fragment, null, renderList(__props.descriptors, (descriptor) => {
2554
+ return openBlock(), createElementBlock("li", {
2555
+ key: descriptor.descriptorId
2556
+ }, [
2557
+ (openBlock(), createBlock(resolveDynamicComponent(componentFor(descriptor.type)), { descriptor }, null, 8, ["descriptor"]))
2558
+ ]);
2559
+ }), 128))
2560
+ ])
2561
+ ], 64);
2562
+ };
2563
+ }
2564
+ });
2565
+ const _hoisted_1$5 = { class: "descriptors-view" };
2566
+ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
2567
+ __name: "PanelDescriptors",
2568
+ setup(__props) {
2569
+ const useStore = useObservationMatrixStore();
2570
+ return (_ctx, _cache) => {
2571
+ return openBlock(), createElementBlock("div", _hoisted_1$5, [
2572
+ unref(useStore).getDescriptorsUsed.length ? (openBlock(), createBlock(_sfc_main$6, {
2573
+ key: 0,
2574
+ descriptors: unref(useStore).getDescriptorsUsed,
2575
+ title: "Used Descriptors"
2576
+ }, null, 8, ["descriptors"])) : createCommentVNode("", true),
2577
+ unref(useStore).getDescriptorsUseful.length ? (openBlock(), createBlock(_sfc_main$6, {
2578
+ key: 1,
2579
+ descriptors: unref(useStore).getDescriptorsUseful,
2580
+ title: "Descriptors Useful for Identification"
2581
+ }, null, 8, ["descriptors"])) : createCommentVNode("", true),
2582
+ unref(useStore).getDescriptorsUseless.length ? (openBlock(), createBlock(_sfc_main$6, {
2583
+ key: 2,
2584
+ descriptors: unref(useStore).getDescriptorsUseless,
2585
+ title: "Descriptors no longer relevant for identification"
2586
+ }, null, 8, ["descriptors"])) : createCommentVNode("", true)
2587
+ ]);
2588
+ };
2589
+ }
2590
+ });
2591
+ var VSpinner_vue_vue_type_style_index_0_scoped_true_lang = /* @__PURE__ */ (() => ".tw-spinner[data-v-3541fc5b]{display:flex;margin:0 auto;height:auto;width:auto;align-items:center;justify-content:center}.fade-enter-active[data-v-3541fc5b],.fade-leave-active[data-v-3541fc5b]{transition:opacity .5s}.fade-enter[data-v-3541fc5b],.fade-leave-to[data-v-3541fc5b]{opacity:0}.tw-spinner-left[data-v-3541fc5b]{flex-direction:row}.tw-spinner-right[data-v-3541fc5b]{flex-direction:row-reverse}.tw-spinner-top[data-v-3541fc5b]{flex-direction:column}.tw-spinner-bottom[data-v-3541fc5b]{flex-direction:column-reverse}.box-spinner[data-v-3541fc5b]{display:flex;position:absolute;box-shadow:0 1px 1px #0003;background-image:none!important;background-color:#fff;align-items:center;z-index:9999;height:100%;opacity:.9}.tw-spinner[data-v-3541fc5b]{font-size:20px;overflow:hidden;width:100%;position:relative}.tw-spinner svg[data-v-3541fc5b]{display:block;position:relative;width:30px;height:30px;margin:0 auto}.tw-spinner #Tail[data-v-3541fc5b]{opacity:0;animation:tail-3541fc5b 2s ease infinite;fill:#41ba8d}.tw-spinner #LeftBottom[data-v-3541fc5b]{fill:#00845d;opacity:0;animation:spinner-3541fc5b 1s ease alternate infinite;animation-delay:0s}.tw-spinner #LeftMid[data-v-3541fc5b]{fill:#28221b;opacity:0;animation:spinner-3541fc5b 1s ease alternate infinite;animation-delay:.2s}.tw-spinner #LeftTop[data-v-3541fc5b]{fill:#342d25;opacity:0;animation:spinner-3541fc5b 1s ease alternate infinite;animation-delay:.4s}.tw-spinner #Head[data-v-3541fc5b]{fill:#342d25;opacity:0;animation:spinner-3541fc5b 1s ease alternate infinite;animation-delay:.6s}@keyframes spinner-3541fc5b{0%{opacity:0}30%{opacity:0}90%{opacity:1}to{opacity:1}}@keyframes tail-3541fc5b{0%{opacity:0}30%{opacity:1}50%{opacity:1}90%{opacity:0}to{opacity:0}}\n")();
2592
+ const _withScopeId = (n) => (pushScopeId("data-v-3541fc5b"), n = n(), popScopeId(), n);
2593
+ const _hoisted_1$4 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("path", {
2594
+ id: "LeftTop",
2595
+ d: "M14.2,63.1C24.3,63.1,28,76.3,28,76.3s5,15.5,15.3,15.5c7.7,0,9.4-6.3,9.8-9.1c0-0.1,0-0.2,0-0.4s0-0.5,0.1-0.8\n c0-0.1,0-0.1,0-0.2c0.3-2-0.8-4-2.7-4.8l0,0c-3.1-1.1-5.9-3-8-5.6c-6.4-7.4-3-17,4.5-23.6c-3.5-4-8-8.7-12-10.8\n c-8.7-4.6-15.7,2.6-16.2,3.2L18.7,40c-0.6,0.8-1.2,1.6-1.8,2.5l-0.1,0.1c-0.6,0.9-1.2,1.8-1.8,2.7L15,45.4c-0.5,0.8-1,1.6-1.5,2.4\n l-0.3,0.5c-1,1.8-2,3.6-3,5.5L10,54.3c-0.4,0.9-0.9,1.8-1.3,2.7l-0.1,0.1C8.2,58,7.8,59,7.4,59.9l-0.2,0.5c-0.3,0.8-0.6,1.5-0.9,2.3\n l-0.2,0.6c-0.4,1-0.7,1.9-1,2.9L5,66.7c-0.1,0.3-0.2,0.5-0.2,0.8C7.1,64.7,10.5,63.1,14.2,63.1z"
2596
+ }, null, -1));
2597
+ const _hoisted_2$1 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("path", {
2598
+ id: "Head",
2599
+ d: "M36.2,33c5.3,1.8,11.4,6.8,15.7,11c0.5-0.3,1.1-0.6,1.6-0.9c2.3-1.2,4.7-2.1,7.2-2.7\n c-2.4-4.9-5.6-12.8-4.9-18.3c1.4-11.2,13.6-12,13.6-12S58.3,12.5,59,22.9c0.3,5,4.7,12.5,7.5,16.8c7-0.1,13,2.7,15.8,8\n c0.3,0.5,0.5,1.1,0.7,1.6l0,0c0.5,1,1.3,1.9,2.3,2.4c3.6,1.2,7.6,2.5,11.7,4.2c5.8,2.3,11.5,5,17,8.1c0.5,0.2,1,0,1.2-0.5\n c0.1-0.3,0.1-0.7-0.2-0.9c-27.2-26.1-8-36.3-8-36.3c-9.8,14.2,6.6,24.5,25.5,35.1c16.6,9.3,28.4,19.5,41.3,12.7\n c6.4-3.4,1.9-11-1-15.2c-2.2-2.9-4-6-5.6-9.2c-1-2.1-1.3-4.4-0.8-6.6c0.7-3.1-0.4-6.8-2.8-10.5c-1.8-2.8-5.1-5.7-7.6-7.6\n c-1.6-1.3-3.1-2.7-4.3-4.4c-9-12.6-32.2-17.9-32.2-17.9l0,0C97.5-2.6,74.3,0.1,54,10.2l0,0c-6.9,3.5-13.5,7.7-19.4,12.7l-0.8,0.6\n c-1.4,1.2-2.8,2.5-4.2,3.8l0,0c-0.8,0.8-1.6,1.5-2.3,2.3l0,0c-1.5,1.6-3,3.2-4.4,4.9l-0.2,0.2l-0.4,0.5C25.2,32.8,29.6,30.9,36.2,33\n z M145.8,33.9c3.9-1.7,8.5,0.1,10.2,4c0.6,1.3,0.8,2.7,0.6,4c-2.5,1.2-5.5,0.9-7.7-0.9C146.5,39.5,145.3,36.7,145.8,33.9L145.8,33.9\n z"
2600
+ }, null, -1));
2601
+ const _hoisted_3 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("path", {
2602
+ id: "LeftMid",
2603
+ d: "M53.2,106.9c-0.2-2-0.4-4-0.4-6.3c-2.3,1-4.7,1.5-7.2,1.5c-19,0-19.5-18.8-26.2-29.2\n c-7-10.8-16.8,0.9-17.8,7.2c0,0.3-0.1,0.5-0.1,0.7c-0.1,0.6-0.2,1.3-0.3,1.9C1,83.1,1,83.4,1,83.6c-0.1,0.8-0.2,1.6-0.3,2.3\n c0,0.3-0.1,0.5-0.1,0.8c-0.1,1-0.2,2.1-0.3,3.1c0,0.1,0,0.2,0,0.3c-0.1,0.9-0.2,1.9-0.2,2.8c0,0.3,0,0.6,0,0.9C0,94.9,0,95.8,0,96.7\n c0,0.1,0,0.2,0,0.3s0,0.1,0,0.1s0,0.1,0,0.1c0,0.4,0,0.8,0,1.2s0,0.8,0,1.2c0,0.6,0,1.2,0.1,1.7c0,0.2,0,0.5,0,0.7\n c1.5,30.7,17.5,58.9,43,76c-8-7.8-12.7-17.8-12.7-28.6c0-13.4,7.3-26,19.1-34.4C52,113.2,53.5,110.1,53.2,106.9z"
2604
+ }, null, -1));
2605
+ const _hoisted_4 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("path", {
2606
+ id: "LeftBottom",
2607
+ d: "M128.3,170c-5.8,2.4-12,3.9-18.3,4.4c-1.1,0.1-2.2,0.1-3.3,0.1c-12.3,0-28.4-4.8-40.7-25.3\n l-1.6-2.7c-1.9,2.7-2.9,6-2.9,9.3c0,13.9,16.6,26.5,36.7,26.5c5.4,0.1,10.7-0.6,15.9-2c-4.6,2.9-13.8,5.6-21.9,5.6\n C69.2,186,50,170.8,50,152.7c0.1-6.3,2.1-12.5,5.8-17.6c1.5-2.1,1.9-4.8,1.1-7.2l0,0c-10.5,6.1-17,15.4-17,26.6\n c0,17.2,15.3,31.9,37,37.9c1.2,0.3,2.5,0.5,3.7,0.7c15.6,2.6,29.5-0.1,38.9-9.1C123.5,180.1,126.5,175.3,128.3,170z"
2608
+ }, null, -1));
2609
+ const _hoisted_5 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("path", {
2610
+ id: "Tail",
2611
+ class: "st0",
2612
+ d: "M171,33.8c28,39.3,18.8,93.8-20.5,121.8c-2.4,1.7-4.9,3.3-7.5,4.8l-0.2,0.2c0-0.4,0-0.9,0.1-1.3\n c0.6-3.9,2.1-7.6,4.4-10.8c7.5-10.7,12.4-27-0.3-48.1c-7-11.6-21.7-28-51.7-40.1c-4.1-1.7-8.1-3.1-11.8-4.2L82,55.6l-0.2-0.1\n c-1.1-0.3-2.1-0.6-3.1-0.9h-0.2l-2.9-0.8h-0.1l-1.3-0.3h-0.1l-2.6-0.6h-0.1l-2.3-0.5h-0.2l-1-0.2l0,0L67,51.7h-0.2l-0.7-0.2h-0.2\n l-0.8-0.2H65l-0.6-0.1h-0.2L63.7,51l-0.1,0.4v0.1l-0.1,0.3l0,0.2l-0.1,0.3l-0.1,0.2l-0.1,0.3l-0.1,0.2L63,53.5L63,53.7l-0.1,0.4\n l-0.1,0.2l-0.1,0.5l-0.1,0.3l-0.1,0.6L62.3,56l-0.1,0.5l-0.1,0.3L62,57.2l-0.1,0.4L61.8,58l-0.1,0.4l-0.1,0.5l-0.1,0.4l-0.1,0.5\n l-0.1,0.4l-0.1,0.6l-0.1,0.5L61,61.9l-0.1,0.4l-0.1,0.5l-0.1,0.5l-0.1,0.5l-0.1,0.5l-0.1,0.5l-0.1,0.5l-0.1,0.5l-0.1,0.5L60,66.9\n l-0.1,0.5l-0.1,0.7l-0.1,0.5l-0.2,1l-0.1,0.5l-0.1,0.6l-0.1,0.5l-0.1,0.6l-0.1,0.6L59,73.1l-0.1,0.6l-0.1,0.6l-0.1,0.6l-0.1,0.7\n l-0.1,0.6l-0.1,0.8l-0.1,0.5c-0.2,1.8-0.4,3.6-0.6,5.5V83c0,0.6-0.1,1.1-0.1,1.7l0,0c0,0.6-0.1,1.1-0.1,1.7v0.1\n c0,0.6-0.1,1.1-0.1,1.7l0,0c-0.2,3-0.2,6.2-0.2,9.5c0.1,4.3,0.4,8.5,0.8,12.7c0,0.3,0.1,0.7,0.1,1.1c0.7,5.8,1.9,11.4,3.6,17\n c1.5,4.5,3.2,8.9,5.2,13.2c0.9,1.7,1.8,3.4,2.8,5.1c9.2,15.3,21.5,23,36.6,23c1,0,2.1,0,3.2-0.1c7-0.6,13.9-2.5,20.2-5.6\n c4.9-24.5-8.4-59.3-36.1-88.3C90,71.8,86,68,81.7,64.4c9.2,6.9,13.9,10.7,19.2,16.3c37.8,39.6,49.7,89.7,26.5,111.9\n c-3.4,3.3-7.5,5.8-11.9,7.5c5.8-1.6,11.1-4.5,15.4-8.6c1.4-1.3,2.6-2.7,3.8-4.2c49.6-20.7,73-77.7,52.4-127.3\n C183.1,50.4,177.7,41.6,171,33.8z"
2613
+ }, null, -1));
2614
+ const _hoisted_6 = [
2615
+ _hoisted_1$4,
2616
+ _hoisted_2$1,
2617
+ _hoisted_3,
2618
+ _hoisted_4,
2619
+ _hoisted_5
2620
+ ];
2621
+ const _hoisted_7 = ["innerHTML"];
2622
+ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
2623
+ __name: "VSpinner",
2624
+ props: {
2625
+ fullScreen: {
2626
+ type: Boolean,
2627
+ default: false
2628
+ },
2629
+ legend: {
2630
+ type: String,
2631
+ default: "Loading, please wait."
2632
+ },
2633
+ resize: {
2634
+ type: Boolean,
2635
+ default: true
2636
+ },
2637
+ legendStyle: {
2638
+ type: Object,
2639
+ default: () => ({
2640
+ color: "#444",
2641
+ marginTop: "30px",
2642
+ textAlign: "center"
2643
+ })
2644
+ },
2645
+ showLegend: {
2646
+ type: Boolean,
2647
+ default: true
2648
+ },
2649
+ showSpinner: {
2650
+ type: Boolean,
2651
+ default: true
2652
+ },
2653
+ spinnerPosition: {
2654
+ type: String,
2655
+ default: "top"
2656
+ },
2657
+ logoSize: {
2658
+ type: Object,
2659
+ default: () => ({
2660
+ width: "50px",
2661
+ height: "50px"
2662
+ })
2663
+ }
2664
+ },
2665
+ setup(__props) {
2666
+ const props = __props;
2667
+ const FULL_SCREEN_STYLE = {
2668
+ position: "fixed",
2669
+ width: "100vw",
2670
+ height: "100vh",
2671
+ top: "0px",
2672
+ left: "0px"
2673
+ };
2674
+ const spinnerElement = ref();
2675
+ const cssProperties = ref({});
2676
+ const resizeInterval = ref();
2677
+ onMounted(() => {
2678
+ init();
2679
+ if (props.resize && !props.fullScreen) {
2680
+ checkResize();
2681
+ }
2682
+ });
2683
+ onUnmounted(() => clearInterval(resizeInterval.value));
2684
+ const init = () => {
2685
+ var _a;
2686
+ const domElement = (_a = spinnerElement.value) == null ? void 0 : _a.parentNode;
2687
+ if (!domElement)
2688
+ return;
2689
+ Object.assign(cssProperties.value, props.fullScreen ? FULL_SCREEN_STYLE : calculateSpinnerStyle(domElement));
2690
+ };
2691
+ const calculateSpinnerStyle = (element) => {
2692
+ const size = element.getBoundingClientRect();
2693
+ const computedStyle = window.getComputedStyle(element, null);
2694
+ const paddingLeft = parseInt(computedStyle.getPropertyValue("padding-left"), 10);
2695
+ const paddingRight = parseInt(computedStyle.getPropertyValue("padding-right"), 10);
2696
+ const paddingTop = parseInt(computedStyle.getPropertyValue("padding-top"), 10);
2697
+ const paddingBottom = parseInt(computedStyle.getPropertyValue("padding-bottom"), 10);
2698
+ return {
2699
+ position: "absolute",
2700
+ width: size.width - paddingLeft - paddingRight + "px",
2701
+ height: size.height - paddingTop - paddingBottom + "px"
2702
+ };
2703
+ };
2704
+ const checkResize = () => {
2705
+ resizeInterval.value = setInterval(init, 500);
2706
+ };
2707
+ return (_ctx, _cache) => {
2708
+ return openBlock(), createBlock(Transition, { name: "fade" }, {
2709
+ default: withCtx(() => [
2710
+ createElementVNode("div", {
2711
+ ref_key: "spinnerElement",
2712
+ ref: spinnerElement,
2713
+ class: "box-spinner mx-spinner absolute bg-white opacity-90",
2714
+ style: normalizeStyle(cssProperties.value)
2715
+ }, [
2716
+ createElementVNode("div", {
2717
+ class: normalizeClass(["tw-spinner", [`tw-spinner-${__props.spinnerPosition}`]])
2718
+ }, [
2719
+ __props.showSpinner ? (openBlock(), createElementBlock("svg", {
2720
+ key: 0,
2721
+ style: normalizeStyle([__props.logoSize, { "enable-background": "new 0 0 194.6 200" }]),
2722
+ version: "1.1",
2723
+ xmlns: "http://www.w3.org/2000/svg",
2724
+ "xmlns:xlink": "http://www.w3.org/1999/xlink",
2725
+ x: "0px",
2726
+ y: "0px",
2727
+ viewBox: "0 0 194.6 200",
2728
+ "xml:space": "preserve"
2729
+ }, _hoisted_6, 4)) : createCommentVNode("", true),
2730
+ createElementVNode("div", {
2731
+ style: normalizeStyle(__props.legendStyle)
2732
+ }, [
2733
+ __props.showLegend ? (openBlock(), createElementBlock("span", {
2734
+ key: 0,
2735
+ innerHTML: __props.legend
2736
+ }, null, 8, _hoisted_7)) : createCommentVNode("", true),
2737
+ renderSlot(_ctx.$slots, "default", {}, void 0, true)
2738
+ ], 4)
2739
+ ], 2)
2740
+ ], 4)
2741
+ ]),
2742
+ _: 3
2743
+ });
2744
+ };
2745
+ }
2746
+ });
2747
+ var VSpinner = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-3541fc5b"]]);
2748
+ const _hoisted_1$3 = /* @__PURE__ */ createTextVNode(" Interactive key ");
2749
+ const _hoisted_2 = { key: 0 };
2750
+ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
2751
+ __name: "TitleMatrix",
2752
+ setup(__props) {
2753
+ const store = useObservationMatrixStore();
2754
+ return (_ctx, _cache) => {
2755
+ return openBlock(), createElementBlock("h1", null, [
2756
+ _hoisted_1$3,
2757
+ unref(store).getObservationMatrix ? (openBlock(), createElementBlock("span", _hoisted_2, "| " + toDisplayString(unref(store).getObservationMatrix.name), 1)) : createCommentVNode("", true)
2758
+ ]);
2759
+ };
2760
+ }
2761
+ });
2762
+ const _hoisted_1$2 = ["title"];
2763
+ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
2764
+ __name: "TitleMatrixCitation",
2765
+ setup(__props) {
2766
+ const store = useObservationMatrixStore();
2767
+ const citationLabel = computed(() => {
2768
+ const citation = store.getCitation;
2769
+ return Object.values(citation || {}).filter(Boolean).join(", ");
2770
+ });
2771
+ return (_ctx, _cache) => {
2772
+ return openBlock(), createElementBlock("span", { title: unref(citationLabel) }, toDisplayString(unref(citationLabel)), 9, _hoisted_1$2);
2773
+ };
2774
+ }
2775
+ });
2776
+ const _hoisted_1$1 = { class: "d-flex justify-between" };
2777
+ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
2778
+ __name: "TitleKey",
2779
+ setup(__props) {
2780
+ return (_ctx, _cache) => {
2781
+ return openBlock(), createElementBlock("div", _hoisted_1$1, [
2782
+ createVNode(_sfc_main$3),
2783
+ createVNode(_sfc_main$2)
2784
+ ]);
2785
+ };
2786
+ }
2787
+ });
2788
+ const _hoisted_1 = { class: "vue-interactive-keys" };
2789
+ const __default__ = {
2790
+ name: "InteractiveKey"
2791
+ };
2792
+ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__), {
2793
+ props: {
2794
+ observationMatrixId: { default: 1 },
2795
+ apiConfig: null
2796
+ },
2797
+ setup(__props) {
2798
+ const props = __props;
2799
+ const settingStore = useSettingsStore();
2800
+ const filterStore = useFilterStore();
2801
+ useObservationMatrixStore();
2802
+ const isLoading = computed(() => settingStore.getIsLoading);
2803
+ const gridLayout = computed(() => settingStore.getLayout);
2804
+ const initialize = () => {
2805
+ const api = useAPIConfig();
2806
+ api.updatePreferences(props.apiConfig);
2807
+ settingStore.setObservationMatrixId(props.observationMatrixId);
2808
+ settingStore.checkUpdate();
2809
+ };
2810
+ initialize();
2811
+ filterStore.$subscribe((_) => {
2812
+ if (settingStore.shouldUpdate) {
2813
+ settingStore.checkUpdate();
2814
+ }
2815
+ });
2816
+ return (_ctx, _cache) => {
2817
+ return openBlock(), createElementBlock("div", _hoisted_1, [
2818
+ createVNode(_sfc_main$1),
2819
+ createVNode(HeaderBar, { class: "margin-medium-bottom" }),
2820
+ createVNode(VGrid, {
2821
+ class: normalizeClass(["w-100", unref(gridLayout)])
2822
+ }, {
2823
+ default: withCtx(() => [
2824
+ createVNode(_sfc_main$5, { class: "panel-descriptors grid-panel" }),
2825
+ createVNode(_sfc_main$g, { class: "panel-remaining grid-panel" }),
2826
+ createVNode(_sfc_main$i, { class: "panel-eliminated grid-panel" })
2827
+ ]),
2828
+ _: 1
2829
+ }, 8, ["class"]),
2830
+ unref(isLoading) ? (openBlock(), createBlock(VSpinner, {
2831
+ key: 0,
2832
+ "full-screen": "",
2833
+ legend: "Loading interactive key..."
2834
+ })) : createCommentVNode("", true)
2835
+ ]);
2836
+ };
2837
+ }
2838
+ }));
2839
+ var main = /* @__PURE__ */ (() => ":root{--bg-color: #f7f8fc;--bg-panel-color: #FFFFFF;--primary-color: #5D9ECE;--border-color: #CCCCCC;--link-color: #5D9ECE;--btn-medium-size: 28px}.d-block{display:block}.d-flex{display:flex}.justify-between{justify-content:space-between}.align-center{align-items:center}.w-100{height:100%}.margin-medium-bottom{margin-bottom:1em}.margin-small-right{margin-right:.5em}.p-0{padding:0}.link{color:var(--link-color);cursor:pointer}.list-none{list-style:none}body{background-color:var(--bg-color)}.vue-interactive-keys{height:calc(100vh - 160px);max-height:calc(100vh - 160px);font-family:Arial,Helvetica,sans-serif;font-size:13px}.vue-interactive-keys .grid-panel{background-color:#fff;padding:1rem;overflow-y:scroll}.vue-interactive-keys .layout-mode-1 .panel-descriptors{grid-area:1/1/2/3}.vue-interactive-keys .layout-mode-1 .panel-remaining{grid-area:2/1/3/2}.vue-interactive-keys .layout-mode-1 .panel-eliminated{grid-area:2/2/3/3}.vue-interactive-keys .layout-mode-2 .panel-descriptors{grid-area:1/1/3/2}.vue-interactive-keys .layout-mode-2 .panel-remaining{grid-area:1/2/2/3}.vue-interactive-keys .layout-mode-2 .panel-eliminated{grid-area:2/2/3/3}.vue-interactive-keys input,.vue-interactive-keys select{padding:.5em 1em;border:1px solid;border-radius:2px;border-color:var(--border-color);background-color:#fff}\n")();
2840
+ function discoverInteractiveKey(selector) {
2841
+ const tag = selector || '[data-interactive-key="true"]';
2842
+ const elements = document.querySelectorAll(tag);
2843
+ const elementsList = [...elements];
2844
+ return elementsList.map((element) => createInteractiveKey(element, parseElementOptions(element)));
2845
+ }
2846
+ function autoDiscover() {
2847
+ discoverInteractiveKey();
2848
+ }
2849
+ function parseElementOptions(element) {
2850
+ return {
2851
+ observationMatrixId: Number(element.getAttribute("data-observation-matrix-id")),
2852
+ apiConfig: {
2853
+ baseURL: element.getAttribute("data-base-url") || "",
2854
+ projectToken: element.getAttribute("data-project-token") || void 0,
2855
+ projectId: Number(element.getAttribute("data-project-id")) || void 0,
2856
+ userToken: element.getAttribute("data-user-token") || void 0,
2857
+ csrfToken: element.getAttribute("data-csrf-token") || void 0
2858
+ }
2859
+ };
2860
+ }
2861
+ function createInteractiveKey(element, opt) {
2862
+ const {
2863
+ apiConfig,
2864
+ observationMatrixId
2865
+ } = opt;
2866
+ if (!observationMatrixId) {
2867
+ throw "Missing observation matrix ID";
2868
+ }
2869
+ if (!apiConfig || !apiConfig.projectToken && !apiConfig.csrfToken && !(apiConfig.projectId && apiConfig.userToken)) {
2870
+ throw "Missing API configuration";
2871
+ }
2872
+ const app = createApp(_sfc_main, {
2873
+ observationMatrixId,
2874
+ apiConfig
2875
+ });
2876
+ app.use(createPinia());
2877
+ app.mount(element);
2878
+ return app;
2879
+ }
2880
+ window.addEventListener("DOMContentLoaded", autoDiscover);
2881
+ export { _sfc_main as VueInteractiveKey, createInteractiveKey, discoverInteractiveKey };