pollination-react-io 1.51.0 → 1.52.0

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.
@@ -1,15 +1,10 @@
1
- import { CloudJob, RunList, RunStatusEnum, UserPrivate } from '@pollination-solutions/pollination-sdk';
1
+ import { CloudJob, UserPrivate } from '@pollination-solutions/pollination-sdk';
2
2
  import { CSSProperties } from 'react';
3
3
  import { APIClient } from '../hooks';
4
4
  export declare enum JobTabs {
5
5
  details = "details",
6
6
  workspace = "workspace"
7
7
  }
8
- export interface RunListParams {
9
- page: number;
10
- pageSize: number;
11
- filter: RunStatusEnum;
12
- }
13
8
  export interface StudyCardProps {
14
9
  projectOwner: string;
15
10
  projectName: string;
@@ -23,6 +18,5 @@ export interface StudyCardProps {
23
18
  enableLink?: boolean;
24
19
  canWrite?: boolean;
25
20
  interval?: number;
26
- getValue?: (runList: RunList) => any;
27
- runListParams?: RunListParams;
21
+ getValue?: (job: CloudJob) => any;
28
22
  }
@@ -1,10 +1,16 @@
1
1
  import React from 'react';
2
2
  import './Card.scss';
3
+ import { APIClient } from '../../hooks';
3
4
  export interface FileCardProps {
5
+ projectOwner?: string;
6
+ projectName?: string;
7
+ client?: APIClient;
8
+ studyId?: string;
9
+ runId?: string;
4
10
  label: string;
5
11
  path: string;
6
12
  description: string;
7
- file?: Blob | File | string;
13
+ file?: Blob | File | string | undefined;
8
14
  onClicked?: (card: FileCardProps) => any;
9
15
  }
10
16
  export declare const FileCard: React.FC<FileCardProps>;
@@ -1,3 +1,4 @@
1
+ import { CSSProperties } from "react";
1
2
  export declare enum Action {
2
3
  add = "add",
3
4
  delete = "delete",
@@ -17,5 +18,6 @@ export interface SendGeometryProps {
17
18
  };
18
19
  buttonLabel?: string;
19
20
  geometryOptions?: GeometryOptions;
21
+ style?: CSSProperties;
20
22
  }
21
23
  export {};
@@ -1,3 +1,4 @@
1
+ import { CSSProperties } from "react";
1
2
  export declare enum Action {
2
3
  add = "add",
3
4
  delete = "delete",
@@ -13,4 +14,5 @@ export interface SendModelProps {
13
14
  [index in Action]: boolean;
14
15
  };
15
16
  buttonLabel?: string;
17
+ style?: CSSProperties;
16
18
  }
@@ -1,3 +1,4 @@
1
+ import { CSSProperties } from 'react';
1
2
  import { XOR } from '../ts-utils';
2
3
  export declare enum Action {
3
4
  add = "add",
@@ -18,5 +19,6 @@ export interface SendResultsProps {
18
19
  };
19
20
  buttonLabel?: string;
20
21
  geometryOptions?: ResultsOptions;
22
+ style?: CSSProperties;
21
23
  }
22
24
  export {};
@@ -1,4 +1,4 @@
1
- import React, { FC, ReactNode } from 'react';
1
+ import React, { CSSProperties, FC, ReactNode } from 'react';
2
2
  import { OptionGroup } from '../Dropdown/Dropdown';
3
3
  export interface SettingsButtonProps {
4
4
  onClick: () => void;
@@ -9,6 +9,7 @@ export interface SettingsButtonProps {
9
9
  triggerIcon?: React.ReactNode;
10
10
  helpText?: string;
11
11
  icon?: ReactNode;
12
+ style?: CSSProperties;
12
13
  }
13
14
  export declare const SettingsButton: FC<SettingsButtonProps>;
14
15
  export default SettingsButton;
@@ -3186,7 +3186,7 @@ var Button = function (_a) {
3186
3186
  children));
3187
3187
  };
3188
3188
 
3189
- var css_248z$n = ":root {\n --background: #FFFAEE;\n --primary: #1890ff;\n --primary2: #40a9ff;\n --primary1: #cceefe;\n --primary0: #e6f7ff;\n --secondary: #fff566;\n --primary3: #000;\n --success: #46A758;\n --warning: #F76809;\n --danger: #FF4616;\n /* radix-ui/colors */\n --slate1: hsl(206, 30.0%, 98.8%);\n --slate2: hsl(210, 16.7%, 97.6%);\n --slate3: hsl(209, 13.3%, 95.3%);\n --slate4: hsl(209, 12.2%, 93.2%);\n --slate5: hsl(208, 11.7%, 91.1%);\n --slate6: hsl(208, 11.3%, 88.9%);\n --slate7: hsl(207, 11.1%, 85.9%);\n --slate8: hsl(205, 10.7%, 78.0%);\n --slate9: hsl(206, 6.0%, 56.1%);\n --slate10: hsl(206, 5.8%, 52.3%);\n --slate11: hsl(206, 6.0%, 43.5%);\n --slate12: hsl(206, 24.0%, 9.0%);\n}\n\n@keyframes spin {\n from {\n transform: rotate(0);\n }\n to {\n transform: rotate(360deg);\n }\n}\n.spin {\n animation: spin 1s linear 0s infinite;\n}\n\n@keyframes Animation {\n 0% {\n background-position: 200%;\n }\n 50% {\n background-position: 100%;\n }\n 100% {\n background-position: 0%;\n }\n}\n.loading {\n background: linear-gradient(45deg, transparent, var(--primary), 12%, transparent);\n background-size: 200%;\n animation: Animation 3s ease infinite;\n}\n\n@keyframes open {\n from {\n height: 0;\n }\n to {\n height: var(--radix-collapsible-content-height);\n }\n}\n@keyframes close {\n from {\n height: var(--radix-collapsible-content-height);\n }\n to {\n height: 0;\n }\n}\n.collapse-content {\n overflow: hidden;\n font-size: inherit;\n color: inherit;\n}\n\n.collapse-content[data-state=open] {\n animation: open 300ms ease-out;\n}\n\n.collapse-content[data-state=closed] {\n animation: close 300ms ease-out;\n}\n\n.btn-group {\n width: fit-content;\n display: flex;\n border-radius: 4px;\n box-sizing: border-box;\n}\n\n.btn-group:hover {\n box-shadow: 0 1px 2px 0 rgba(26, 115, 232, 0.45), 0 1px 3px 1px rgba(26, 115, 232, 0.3);\n}\n\n.btn-group-disabled:hover {\n box-shadow: none;\n}\n\n.btn-group input {\n width: 100%;\n}\n\n.btn-group input::placeholder {\n color: var(--primary1);\n}\n\n.btn-group-disabled input::placeholder {\n color: var(--slate9);\n}\n\n.btn-group * {\n background-color: var(--primary);\n color: white;\n transition: background-color 0.125s ease-in-out;\n}\n\n.btn-group-disabled * {\n background-color: var(--slate5);\n border-color: var(--slate11) !important;\n color: var(--slate11);\n cursor: default !important;\n}\n\n.btn-group i,\n.btn-group svg {\n background-color: rgba(0, 0, 0, 0);\n}\n\n.btn-group button,\n.btn-group input {\n display: flex;\n padding: 8px 10px;\n cursor: pointer;\n float: left;\n z-index: 10;\n align-items: center;\n gap: 8px;\n border: 1px solid var(--primary);\n border-left-color: #096dd9;\n transition: box-shadow 0.125s ease-in-out;\n line-height: 1.5rem;\n}\n\n.btn-group button:active {\n box-shadow: inset 0px 0px 14px 14px #096dd9;\n}\n\n.btn-group button:first-child,\n.btn-group input:first-child {\n border-top-left-radius: 4px;\n border-bottom-left-radius: 4px;\n border-top-right-radius: 0px;\n border-bottom-right-radius: 0px;\n border-left-color: var(--primary);\n}\n\n.btn-group button:last-child {\n border-top-right-radius: 4px;\n border-bottom-right-radius: 4px;\n border-top-left-radius: 0px;\n border-bottom-left-radius: 0px;\n}\n\n.btn-group button:not(:last-child),\n.btn-group input:not(:last-child) {\n border-right: none;\n}\n\n.btn-group button:focus-visible,\n.btn-group input:focus-visible {\n outline: none;\n}\n\n.btn-group button:focus,\n.btn-group input:focus {\n outline: none;\n}\n\n/* Clear floats (clearfix hack) */\n.btn-group:after {\n content: \"\";\n clear: both;\n display: table;\n}\n\n.btn-group button:hover,\n.btn-group input:hover {\n background-color: var(--primary2);\n z-index: 11;\n}\n\n.btn-group-disabled:hover button:hover {\n box-shadow: none;\n}\n\n.btn-group-disabled:hover button:hover,\n.btn-group-disabled:hover input:hover {\n background-color: var(--slate5);\n}\n\n.options-content {\n font-size: clamp(0.65rem, 8vw - 0.75rem, 0.85rem);\n}";
3189
+ var css_248z$n = ":root {\n --background: #FFFAEE;\n --primary: #1890ff;\n --primary2: #40a9ff;\n --primary1: #cceefe;\n --primary0: #e6f7ff;\n --secondary: #fff566;\n --primary3: #000;\n --success: #46A758;\n --warning: #F76809;\n --danger: #FF4616;\n /* radix-ui/colors */\n --slate1: hsl(206, 30.0%, 98.8%);\n --slate2: hsl(210, 16.7%, 97.6%);\n --slate3: hsl(209, 13.3%, 95.3%);\n --slate4: hsl(209, 12.2%, 93.2%);\n --slate5: hsl(208, 11.7%, 91.1%);\n --slate6: hsl(208, 11.3%, 88.9%);\n --slate7: hsl(207, 11.1%, 85.9%);\n --slate8: hsl(205, 10.7%, 78.0%);\n --slate9: hsl(206, 6.0%, 56.1%);\n --slate10: hsl(206, 5.8%, 52.3%);\n --slate11: hsl(206, 6.0%, 43.5%);\n --slate12: hsl(206, 24.0%, 9.0%);\n}\n\n@keyframes spin {\n from {\n transform: rotate(0);\n }\n to {\n transform: rotate(360deg);\n }\n}\n.spin {\n animation: spin 1s linear 0s infinite;\n}\n\n@keyframes Animation {\n 0% {\n background-position: 200%;\n }\n 50% {\n background-position: 100%;\n }\n 100% {\n background-position: 0%;\n }\n}\n.loading {\n background: linear-gradient(45deg, transparent, var(--primary), 12%, transparent);\n background-size: 200%;\n animation: Animation 3s ease infinite;\n}\n\n@keyframes open {\n from {\n height: 0;\n }\n to {\n height: var(--radix-collapsible-content-height);\n }\n}\n@keyframes close {\n from {\n height: var(--radix-collapsible-content-height);\n }\n to {\n height: 0;\n }\n}\n.collapse-content {\n overflow: hidden;\n font-size: inherit;\n color: inherit;\n}\n\n.collapse-content[data-state=open] {\n animation: open 300ms ease-out;\n}\n\n.collapse-content[data-state=closed] {\n animation: close 300ms ease-out;\n}\n\n.btn-group {\n width: fit-content;\n display: flex;\n border-radius: 4px;\n box-sizing: border-box;\n}\n\n.btn-group:hover {\n box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 2px -2px, rgba(0, 0, 0, 0.12) 0px 2px 4px 0px, rgba(0, 0, 0, 0.09) 0px 3px 8px 3px;\n}\n\n.btn-group-disabled:hover {\n box-shadow: none;\n}\n\n.btn-group input {\n width: 100%;\n}\n\n.btn-group input::placeholder {\n color: var(--primary1);\n}\n\n.btn-group-disabled input::placeholder {\n color: var(--slate9);\n}\n\n.btn-group * {\n background-color: var(--primary);\n color: white;\n transition: background-color 0.125s ease-in-out;\n}\n\n.btn-group-disabled * {\n background-color: var(--slate5);\n border-color: var(--slate11) !important;\n color: var(--slate11);\n cursor: default !important;\n}\n\n.btn-group i,\n.btn-group svg {\n background-color: rgba(0, 0, 0, 0);\n}\n\n.btn-group button,\n.btn-group input {\n display: flex;\n padding: 8px 10px;\n cursor: pointer;\n float: left;\n z-index: 10;\n align-items: center;\n gap: 8px;\n border: 1px solid var(--primary);\n border-left-color: var(--primary2);\n transition: box-shadow 0.125s ease-in-out;\n line-height: 1.5rem;\n}\n\n.btn-group button:active {\n box-shadow: inset 0px 0px 7px 7px var(--primary2);\n}\n\n.btn-group button:first-child,\n.btn-group input:first-child {\n border-top-left-radius: 4px;\n border-bottom-left-radius: 4px;\n border-top-right-radius: 0px;\n border-bottom-right-radius: 0px;\n border-left-color: var(--primary);\n}\n\n.btn-group button:last-child {\n border-top-right-radius: 4px;\n border-bottom-right-radius: 4px;\n border-top-left-radius: 0px;\n border-bottom-left-radius: 0px;\n}\n\n.btn-group button:not(:last-child),\n.btn-group input:not(:last-child) {\n border-right: none;\n}\n\n.btn-group button:focus-visible,\n.btn-group input:focus-visible {\n outline: none;\n}\n\n.btn-group button:focus,\n.btn-group input:focus {\n outline: none;\n}\n\n/* Clear floats (clearfix hack) */\n.btn-group:after {\n content: \"\";\n clear: both;\n display: table;\n}\n\n.btn-group button:hover,\n.btn-group input:hover {\n background-color: var(--primary2);\n z-index: 11;\n}\n\n.btn-group-disabled:hover button:hover {\n box-shadow: none;\n}\n\n.btn-group-disabled:hover button:hover,\n.btn-group-disabled:hover input:hover {\n background-color: var(--slate5);\n}\n\n.options-content {\n font-size: clamp(0.65rem, 8vw - 0.75rem, 0.85rem);\n}";
3190
3190
  styleInject(css_248z$n);
3191
3191
 
3192
3192
  var ButtonGroup = function (_a) {
@@ -15712,21 +15712,21 @@ var RadioList = function (_a) {
15712
15712
  };
15713
15713
 
15714
15714
  var SettingsButton = function (_a) {
15715
- var onClick = _a.onClick, label = _a.label, options = _a.options, asButtons = _a.asButtons, _b = _a.disabled, disabled = _b === void 0 ? false : _b, _c = _a.triggerIcon, triggerIcon = _c === void 0 ? React__default.createElement(CaretDownFill$1, null) : _c, helpText = _a.helpText, _d = _a.icon, icon = _d === void 0 ? React__default.createElement(Logo, null) : _d;
15715
+ var onClick = _a.onClick, label = _a.label, options = _a.options, asButtons = _a.asButtons, _b = _a.disabled, disabled = _b === void 0 ? false : _b, _c = _a.triggerIcon, triggerIcon = _c === void 0 ? React__default.createElement(CaretDownFill$1, null) : _c, helpText = _a.helpText, _d = _a.icon, icon = _d === void 0 ? React__default.createElement(Logo, null) : _d, _e = _a.style, style = _e === void 0 ? {} : _e;
15716
15716
  return (React__default.createElement(ConditionalWrapper, { condition: typeof helpText !== 'undefined' || disabled, wrapper: function (children) { return React__default.createElement(InputDescription, { helpText: disabled ? 'Enabled in Pollination CAD plugins.' : helpText }, children); } },
15717
15717
  React__default.createElement(ButtonGroup, { disabled: disabled },
15718
- React__default.createElement("button", { type: 'button', onClick: onClick, disabled: disabled, style: {
15719
- flex: 1,
15720
- } },
15718
+ React__default.createElement("button", { type: 'button', onClick: onClick, disabled: disabled, style: __assign(__assign({}, style), { flex: 1 }) },
15721
15719
  icon,
15722
15720
  label),
15723
15721
  options && options.length
15724
15722
  && React__default.createElement(React__default.Fragment, null, asButtons ?
15725
15723
  React__default.createElement(React__default.Fragment, null, options.reduce(function (p, c) { return __spreadArray(__spreadArray([], p, true), c.options, true); }, []).map(function (o) {
15726
15724
  var _a;
15727
- return React__default.createElement("button", { type: 'button', key: o.id, style: {
15728
- boxShadow: !disabled && o.checked ? 'inset 0px 0px 9px 4px #096dd9' : undefined
15729
- }, onClick: function (e) { return o.onSelect && o.onSelect(o); } }, (_a = o.icon) !== null && _a !== void 0 ? _a : o.label);
15725
+ return React__default.createElement("button", { type: 'button', key: o.id, style: __assign(__assign({}, style), { boxShadow: !disabled && o.checked
15726
+ ? style['highlight']
15727
+ ? "inset 0px 0px 9px 4px ".concat(style['highlight'])
15728
+ : 'inset 0px 0px 9px 4px #096dd9'
15729
+ : undefined }), onClick: function (e) { return o.onSelect && o.onSelect(o); } }, (_a = o.icon) !== null && _a !== void 0 ? _a : o.label);
15730
15730
  }))
15731
15731
  :
15732
15732
  React__default.createElement(Dropdown, { trigger: (React__default.createElement("button", { type: 'button' }, triggerIcon)), optionGroups: options, contentProps: {
@@ -44291,9 +44291,9 @@ var getAction$2 = function (key) {
44291
44291
  }
44292
44292
  };
44293
44293
  var SendResults = function (_a) {
44294
- var results = _a.results, defaultAction = _a.defaultAction, defaultKey = _a.defaultKey, optionsConfig = _a.optionsConfig, _b = _a.buttonLabel, buttonLabel = _b === void 0 ? 'Send Results' : _b, geometryOptions = _a.geometryOptions;
44295
- var _c = useState(defaultAction !== null && defaultAction !== void 0 ? defaultAction : Action$2.preview), selOpt = _c[0], setSelOpt = _c[1];
44296
- var _d = useState(defaultKey !== null && defaultKey !== void 0 ? defaultKey : performance.now().toString()), key = _d[0], setKey = _d[1];
44294
+ var results = _a.results, defaultAction = _a.defaultAction, defaultKey = _a.defaultKey, optionsConfig = _a.optionsConfig, _b = _a.buttonLabel, buttonLabel = _b === void 0 ? 'Send Results' : _b, geometryOptions = _a.geometryOptions, _c = _a.style, style = _c === void 0 ? {} : _c;
44295
+ var _d = useState(defaultAction !== null && defaultAction !== void 0 ? defaultAction : Action$2.preview), selOpt = _d[0], setSelOpt = _d[1];
44296
+ var _e = useState(defaultKey !== null && defaultKey !== void 0 ? defaultKey : performance.now().toString()), key = _e[0], setKey = _e[1];
44297
44297
  var sendMessage = useSendMessage().sendMessage;
44298
44298
  var disabled = useMemo(function () {
44299
44299
  return !checkPollinationPanel();
@@ -44323,7 +44323,7 @@ var SendResults = function (_a) {
44323
44323
  });
44324
44324
  };
44325
44325
  }, [disabled, geometryOptions, key, results, selOpt, sendMessage]);
44326
- return (React__default.createElement(SettingsButton, { disabled: disabled, onClick: function () {
44326
+ return (React__default.createElement(SettingsButton, { style: style, disabled: disabled, onClick: function () {
44327
44327
  if (disabled)
44328
44328
  return;
44329
44329
  sendMessage(getAction$2(selOpt), {
@@ -44341,7 +44341,7 @@ var SendResults = function (_a) {
44341
44341
  id: Action$2.preview,
44342
44342
  label: 'Preview',
44343
44343
  checked: selOpt === Action$2.preview,
44344
- icon: React__default.createElement(Eyeglasses$1, { size: 16 }),
44344
+ icon: React__default.createElement(Eyeglasses$1, { size: 16, color: style['color'] }),
44345
44345
  disabled: disabled,
44346
44346
  onSelect: function () {
44347
44347
  setSelOpt(function (state) { return (state === Action$2.preview ? undefined : Action$2.preview); });
@@ -44352,7 +44352,7 @@ var SendResults = function (_a) {
44352
44352
  id: Action$2.add,
44353
44353
  label: 'Add',
44354
44354
  checked: selOpt === Action$2.add,
44355
- icon: React__default.createElement(Building$1, { size: 16 }),
44355
+ icon: React__default.createElement(Building$1, { size: 16, color: style['color'] }),
44356
44356
  disabled: disabled,
44357
44357
  onSelect: function () {
44358
44358
  setSelOpt(function (state) { return (state === Action$2.add ? undefined : Action$2.add); });
@@ -44374,7 +44374,7 @@ var SendResults = function (_a) {
44374
44374
  id: Action$2.clear,
44375
44375
  label: 'Clear',
44376
44376
  checked: selOpt === Action$2.clear,
44377
- icon: React__default.createElement(Recycle$1, { size: 16 }),
44377
+ icon: React__default.createElement(Recycle$1, { size: 16, color: style['color'] }),
44378
44378
  disabled: disabled,
44379
44379
  onSelect: function () {
44380
44380
  setSelOpt(function (state) { return (state === Action$2.clear ? undefined : Action$2.clear); });
@@ -44385,7 +44385,7 @@ var SendResults = function (_a) {
44385
44385
  id: Action$2.subscribePreview,
44386
44386
  label: 'Subscribe Preview',
44387
44387
  checked: selOpt === Action$2.subscribePreview,
44388
- icon: React__default.createElement(ArrowRepeat$1, { size: 16 }),
44388
+ icon: React__default.createElement(ArrowRepeat$1, { size: 16, color: style['color'] }),
44389
44389
  disabled: disabled,
44390
44390
  onSelect: function () {
44391
44391
  setSelOpt(function (state) { return (state === Action$2.subscribePreview ? undefined : Action$2.subscribePreview); });
@@ -46796,7 +46796,7 @@ var getAction$1 = function (key) {
46796
46796
  }
46797
46797
  };
46798
46798
  var SendGeometry = function (_a) {
46799
- var geometry = _a.geometry, defaultAction = _a.defaultAction, defaultKey = _a.defaultKey, optionsConfig = _a.optionsConfig, _b = _a.buttonLabel, buttonLabel = _b === void 0 ? 'Send Geometry' : _b, geometryOptions = _a.geometryOptions;
46799
+ var geometry = _a.geometry, defaultAction = _a.defaultAction, defaultKey = _a.defaultKey, optionsConfig = _a.optionsConfig, _b = _a.buttonLabel, buttonLabel = _b === void 0 ? 'Send Geometry' : _b, geometryOptions = _a.geometryOptions, style = _a.style;
46800
46800
  var _c = useState(defaultAction !== null && defaultAction !== void 0 ? defaultAction : Action$1.preview), selOpt = _c[0], setSelOpt = _c[1];
46801
46801
  var _d = useState(defaultKey !== null && defaultKey !== void 0 ? defaultKey : performance.now().toString()), key = _d[0], setKey = _d[1];
46802
46802
  var sendMessage = useSendMessage().sendMessage;
@@ -46825,7 +46825,7 @@ var SendGeometry = function (_a) {
46825
46825
  });
46826
46826
  };
46827
46827
  }, [disabled, geometry, geometryOptions, key, selOpt, sendMessage]);
46828
- return (React__default.createElement(SettingsButton, { disabled: disabled, onClick: function () {
46828
+ return (React__default.createElement(SettingsButton, { style: style, disabled: disabled, onClick: function () {
46829
46829
  if (disabled)
46830
46830
  return;
46831
46831
  sendMessage(getAction$1(selOpt), {
@@ -46843,7 +46843,7 @@ var SendGeometry = function (_a) {
46843
46843
  id: Action$1.preview,
46844
46844
  label: 'Preview',
46845
46845
  checked: selOpt === Action$1.preview,
46846
- icon: React__default.createElement(Eyeglasses$1, { size: 16 }),
46846
+ icon: React__default.createElement(Eyeglasses$1, { size: 16, color: style['color'] }),
46847
46847
  disabled: disabled,
46848
46848
  onSelect: function () {
46849
46849
  setSelOpt(function (state) { return (state === Action$1.preview ? undefined : Action$1.preview); });
@@ -46854,7 +46854,7 @@ var SendGeometry = function (_a) {
46854
46854
  id: Action$1.add,
46855
46855
  label: 'Add',
46856
46856
  checked: selOpt === Action$1.add,
46857
- icon: React__default.createElement(Building$1, { size: 16 }),
46857
+ icon: React__default.createElement(Building$1, { size: 16, color: style['color'] }),
46858
46858
  disabled: disabled,
46859
46859
  onSelect: function () {
46860
46860
  setSelOpt(function (state) { return (state === Action$1.add ? undefined : Action$1.add); });
@@ -46865,7 +46865,7 @@ var SendGeometry = function (_a) {
46865
46865
  id: Action$1.delete,
46866
46866
  label: 'Delete',
46867
46867
  checked: selOpt === Action$1.delete,
46868
- icon: React__default.createElement(Trash$1, { size: 16 }),
46868
+ icon: React__default.createElement(Trash$1, { size: 16, color: style['color'] }),
46869
46869
  disabled: disabled,
46870
46870
  onSelect: function () {
46871
46871
  setSelOpt(function (state) { return (state === Action$1.delete ? undefined : Action$1.delete); });
@@ -46876,7 +46876,7 @@ var SendGeometry = function (_a) {
46876
46876
  id: Action$1.clear,
46877
46877
  label: 'Clear',
46878
46878
  checked: selOpt === Action$1.clear,
46879
- icon: React__default.createElement(Recycle$1, { size: 16 }),
46879
+ icon: React__default.createElement(Recycle$1, { size: 16, color: style['color'] }),
46880
46880
  disabled: disabled,
46881
46881
  onSelect: function () {
46882
46882
  setSelOpt(function (state) { return (state === Action$1.clear ? undefined : Action$1.clear); });
@@ -46887,7 +46887,7 @@ var SendGeometry = function (_a) {
46887
46887
  id: Action$1.subscribePreview,
46888
46888
  label: 'Subscribe Preview',
46889
46889
  checked: selOpt === Action$1.subscribePreview,
46890
- icon: React__default.createElement(ArrowRepeat$1, { size: 16 }),
46890
+ icon: React__default.createElement(ArrowRepeat$1, { size: 16, color: style['color'] }),
46891
46891
  disabled: disabled,
46892
46892
  onSelect: function () {
46893
46893
  setSelOpt(function (state) { return (state === Action$1.subscribePreview ? undefined : Action$1.subscribePreview); });
@@ -46923,9 +46923,9 @@ var getAction = function (key) {
46923
46923
  }
46924
46924
  };
46925
46925
  var SendModel = function (_a) {
46926
- var hbjson = _a.hbjson, defaultAction = _a.defaultAction, defaultKey = _a.defaultKey, optionsConfig = _a.optionsConfig, _b = _a.buttonLabel, buttonLabel = _b === void 0 ? 'Send Model' : _b;
46927
- var _c = useState(defaultAction !== null && defaultAction !== void 0 ? defaultAction : Action.preview), selOpt = _c[0], setSelOpt = _c[1];
46928
- var _d = useState(defaultKey !== null && defaultKey !== void 0 ? defaultKey : performance.now().toString()), key = _d[0], setKey = _d[1];
46926
+ var hbjson = _a.hbjson, defaultAction = _a.defaultAction, defaultKey = _a.defaultKey, optionsConfig = _a.optionsConfig, _b = _a.buttonLabel, buttonLabel = _b === void 0 ? 'Send Model' : _b, _c = _a.style, style = _c === void 0 ? {} : _c;
46927
+ var _d = useState(defaultAction !== null && defaultAction !== void 0 ? defaultAction : Action.preview), selOpt = _d[0], setSelOpt = _d[1];
46928
+ var _e = useState(defaultKey !== null && defaultKey !== void 0 ? defaultKey : performance.now().toString()), key = _e[0], setKey = _e[1];
46929
46929
  var sendHbjson = useSendHbjson().sendHbjson;
46930
46930
  var disabled = useMemo(function () {
46931
46931
  return !checkPollinationPanel();
@@ -46958,7 +46958,7 @@ var SendModel = function (_a) {
46958
46958
  });
46959
46959
  };
46960
46960
  }, [disabled, hbjson, key, selOpt, sendHbjson]);
46961
- return (React__default.createElement(SettingsButton, { disabled: disabled, onClick: function () {
46961
+ return (React__default.createElement(SettingsButton, { style: style, disabled: disabled, onClick: function () {
46962
46962
  if (disabled)
46963
46963
  return;
46964
46964
  sendHbjson(getAction(selOpt), {
@@ -46979,7 +46979,7 @@ var SendModel = function (_a) {
46979
46979
  id: Action.preview,
46980
46980
  label: 'Preview',
46981
46981
  checked: selOpt === Action.preview,
46982
- icon: React__default.createElement(Eyeglasses$1, { size: 16 }),
46982
+ icon: React__default.createElement(Eyeglasses$1, { size: 16, color: style['color'] }),
46983
46983
  disabled: disabled,
46984
46984
  onSelect: function () {
46985
46985
  setSelOpt(function (state) { return (state === Action.preview ? undefined : Action.preview); });
@@ -46990,7 +46990,7 @@ var SendModel = function (_a) {
46990
46990
  id: Action.add,
46991
46991
  label: 'Add',
46992
46992
  checked: selOpt === Action.add,
46993
- icon: React__default.createElement(Building$1, { size: 16 }),
46993
+ icon: React__default.createElement(Building$1, { size: 16, color: style['color'] }),
46994
46994
  disabled: disabled,
46995
46995
  onSelect: function () {
46996
46996
  setSelOpt(function (state) { return (state === Action.add ? undefined : Action.add); });
@@ -47001,7 +47001,7 @@ var SendModel = function (_a) {
47001
47001
  id: Action.clear,
47002
47002
  label: 'Clear',
47003
47003
  checked: selOpt === Action.clear,
47004
- icon: React__default.createElement(Recycle$1, { size: 16 }),
47004
+ icon: React__default.createElement(Recycle$1, { size: 16, color: style['color'] }),
47005
47005
  disabled: disabled,
47006
47006
  onSelect: function () {
47007
47007
  setSelOpt(function (state) { return (state === Action.clear ? undefined : Action.clear); });
@@ -47012,7 +47012,7 @@ var SendModel = function (_a) {
47012
47012
  id: Action.subscribePreview,
47013
47013
  label: 'Subscribe Preview',
47014
47014
  checked: selOpt === Action.subscribePreview,
47015
- icon: React__default.createElement(ArrowRepeat$1, { size: 16 }),
47015
+ icon: React__default.createElement(ArrowRepeat$1, { size: 16, color: style['color'] }),
47016
47016
  disabled: disabled,
47017
47017
  onSelect: function () {
47018
47018
  setSelOpt(function (state) { return (state === Action.subscribePreview ? undefined : Action.subscribePreview); });
@@ -48538,21 +48538,21 @@ var formatDuration$1 = function (duration) {
48538
48538
  var StudyCard = function (_a) {
48539
48539
  var _b;
48540
48540
  var _c, _d, _e, _f, _g, _h;
48541
- var projectName = _a.projectName, projectOwner = _a.projectOwner, _study = _a.study, style = _a.style, authUser = _a.authUser, client = _a.client, enableClick = _a.enableClick, _j = _a.getTab, getTab = _j === void 0 ? function (tab) { } : _j, _k = _a.defaultTab, defaultTab = _k === void 0 ? '' : _k, _l = _a.enableLink, enableLink = _l === void 0 ? false : _l, _m = _a.canWrite, canWrite = _m === void 0 ? false : _m, _o = _a.getValue, getValue = _o === void 0 ? function (runList) { } : _o, _p = _a.interval, interval = _p === void 0 ? 5000 : _p, _q = _a.runListParams, runListParams = _q === void 0 ? { page: 1, pageSize: 1, filter: undefined } : _q;
48541
+ var projectName = _a.projectName, projectOwner = _a.projectOwner, _study = _a.study, style = _a.style, authUser = _a.authUser, client = _a.client, enableClick = _a.enableClick, _j = _a.getTab, getTab = _j === void 0 ? function (tab) { } : _j, _k = _a.defaultTab, defaultTab = _k === void 0 ? '' : _k, _l = _a.enableLink, enableLink = _l === void 0 ? false : _l, _m = _a.canWrite, canWrite = _m === void 0 ? false : _m, _o = _a.getValue, getValue = _o === void 0 ? function (job) { } : _o, _p = _a.interval, interval = _p === void 0 ? 5000 : _p;
48542
48542
  /**
48543
48543
  * Fetch hooks
48544
48544
  */
48545
- var _r = useJobs(client), fetchJob = _r.fetchJob, getDuration = _r.getDuration, statusMap = _r.statusMap, deleteJob = _r.deleteJob, cancelJob = _r.cancelJob;
48545
+ var _q = useJobs(client), fetchJob = _q.fetchJob, getDuration = _q.getDuration, statusMap = _q.statusMap, deleteJob = _q.deleteJob, cancelJob = _q.cancelJob;
48546
48546
  var listRuns = useRuns(client).listRuns;
48547
- var _s = useWindowDimensions(), width = _s.width; _s.height;
48548
- var _t = useState(false), seeDescription = _t[0], setSeeDescription = _t[1];
48549
- var _u = useState(false), seeAction = _u[0], setSeeAction = _u[1];
48550
- var _v = useState(false), stopRefresh = _v[0], setStopRefresh = _v[1];
48551
- var _w = useState(false), isReady = _w[0], setIsReady = _w[1];
48547
+ var _r = useWindowDimensions(), width = _r.width; _r.height;
48548
+ var _s = useState(false), seeDescription = _s[0], setSeeDescription = _s[1];
48549
+ var _t = useState(false), seeAction = _t[0], setSeeAction = _t[1];
48550
+ var _u = useState(false), stopRefresh = _u[0], setStopRefresh = _u[1];
48551
+ var _v = useState(false), isReady = _v[0], setIsReady = _v[1];
48552
48552
  /**
48553
48553
  * From job to run
48554
48554
  */
48555
- var _x = useSWR(authUser && _study ? [projectOwner, projectName, _study.id] : undefined, fetchJob, {
48555
+ var _w = useSWR(authUser && _study ? [projectOwner, projectName, _study.id] : undefined, fetchJob, {
48556
48556
  revalidateOnFocus: false,
48557
48557
  refreshInterval: stopRefresh ? undefined : interval,
48558
48558
  fallbackData: _study,
@@ -48560,24 +48560,33 @@ var StudyCard = function (_a) {
48560
48560
  onSuccess: function (study, key, config) {
48561
48561
  if (!study)
48562
48562
  return;
48563
- var page = runListParams.page, pageSize = runListParams.pageSize, filter = runListParams.filter;
48564
- listRuns(projectOwner, projectName, [study.id], page, pageSize, filter)
48565
- .then(function (d) {
48566
- if (d.resources.length === 1) {
48567
- setRun(d.resources[0]);
48568
- sendRunList(d);
48569
- }
48570
- else {
48571
- sendRunList(d);
48572
- }
48573
- })
48574
- .catch(function () { return setRun(undefined); })
48575
- .finally(function () { return setIsReady(true); });
48563
+ var tot = study.status.runs_pending +
48564
+ study.status.runs_running +
48565
+ study.status.runs_failed +
48566
+ study.status.runs_completed +
48567
+ study.status.runs_cancelled;
48568
+ if (tot === 1) {
48569
+ listRuns(projectOwner, projectName, [study.id], 1, 1)
48570
+ .then(function (d) {
48571
+ if (d.resources.length === 1) {
48572
+ setRun(d.resources[0]);
48573
+ }
48574
+ })
48575
+ .catch(function () { setRun(undefined); })
48576
+ .finally(function () {
48577
+ sendJob(study);
48578
+ setIsReady(true);
48579
+ });
48580
+ }
48581
+ else {
48582
+ sendJob(study);
48583
+ setIsReady(true);
48584
+ }
48576
48585
  if (study.status.finished_at)
48577
48586
  setStopRefresh(true);
48578
48587
  }
48579
- }), study = _x.data; _x.error; _x.isValidating;
48580
- var sendRunList = useCallback(function (runList) { return getValue(runList); }, [study]);
48588
+ }), study = _w.data; _w.error; _w.isValidating;
48589
+ var sendJob = useCallback(function (job) { return getValue(job); }, [study]);
48581
48590
  var total = useMemo(function () {
48582
48591
  if (!study)
48583
48592
  return undefined;
@@ -48600,8 +48609,8 @@ var StudyCard = function (_a) {
48600
48609
  }
48601
48610
  return study.status.status.toLocaleLowerCase();
48602
48611
  }, [study]);
48603
- var _y = useState(), run = _y[0], setRun = _y[1];
48604
- var _z = useState(getDuration(study)), duration = _z[0], setDuration = _z[1];
48612
+ var _x = useState(), run = _x[0], setRun = _x[1];
48613
+ var _y = useState(getDuration(study)), duration = _y[0], setDuration = _y[1];
48605
48614
  useEffect(function () {
48606
48615
  setRun(undefined);
48607
48616
  if (!study)
@@ -48632,7 +48641,7 @@ var StudyCard = function (_a) {
48632
48641
  info: false,
48633
48642
  settings: false
48634
48643
  };
48635
- var _0 = useState(__assign(__assign({}, initialValues), (_b = {}, _b[defaultTab] = true, _b))), hover = _0[0], setHover = _0[1];
48644
+ var _z = useState(__assign(__assign({}, initialValues), (_b = {}, _b[defaultTab] = true, _b))), hover = _z[0], setHover = _z[1];
48636
48645
  var toggleHover = useCallback(function (id, value) {
48637
48646
  if (value === void 0) { value = false; }
48638
48647
  setHover(function (prevHover) {
@@ -49159,26 +49168,132 @@ var getFileIcon = function (size, type) {
49159
49168
  }
49160
49169
  };
49161
49170
 
49171
+ var CADtypeEnum;
49172
+ (function (CADtypeEnum) {
49173
+ CADtypeEnum[CADtypeEnum["HBJSON"] = 0] = "HBJSON";
49174
+ CADtypeEnum[CADtypeEnum["VSF"] = 1] = "VSF";
49175
+ })(CADtypeEnum || (CADtypeEnum = {}));
49162
49176
  var FileCard = function (_a) {
49163
49177
  var _b, _c;
49164
- var label = _a.label, path = _a.path, file = _a.file, description = _a.description, onClicked = _a.onClicked;
49178
+ var projectOwner = _a.projectOwner, projectName = _a.projectName, client = _a.client, studyId = _a.studyId, runId = _a.runId, label = _a.label, path = _a.path, file = _a.file, description = _a.description, onClicked = _a.onClicked;
49179
+ var host = getHost();
49165
49180
  var _d = useState(false), open = _d[0], setOpen = _d[1];
49166
49181
  var _e = useState(false), over = _e[0], setOver = _e[1];
49182
+ var _f = useState(true), isLoading = _f[0], setIsLoading = _f[1];
49183
+ // Data to use for CAD injections
49184
+ var _g = useState(), CADdata = _g[0], setCADdata = _g[1];
49185
+ // File to send to parent
49186
+ var _h = useState(), currFile = _h[0], setCurrFile = _h[1];
49187
+ /**
49188
+ * Check if run id is a valid UUID or file path (Local sim)
49189
+ * @param str run id
49190
+ * @returns true or false
49191
+ */
49192
+ var checkIfValidUUID = function (str) {
49193
+ var regexExp = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/gi;
49194
+ return regexExp.test(str);
49195
+ };
49196
+ var isCloud = useMemo(function () { return checkIfValidUUID(runId); }, [runId]);
49197
+ var downloadArtifact = useArtifacts(projectOwner, projectName, client).downloadArtifact;
49198
+ var setCADintegration = useCallback(function (file) {
49199
+ if (!file)
49200
+ return;
49201
+ if (host !== 'rhino')
49202
+ return;
49203
+ if (path.endsWith('hbjson')) {
49204
+ var reader_1 = new FileReader();
49205
+ reader_1.readAsText(file);
49206
+ reader_1.onload = function () {
49207
+ var res = reader_1 === null || reader_1 === void 0 ? void 0 : reader_1.result;
49208
+ setCADdata({
49209
+ data: JSON.parse(res),
49210
+ id: path,
49211
+ type: CADtypeEnum.HBJSON
49212
+ });
49213
+ };
49214
+ }
49215
+ else if (path.endsWith('vsf')) {
49216
+ var reader_2 = new FileReader();
49217
+ reader_2.readAsText(file);
49218
+ reader_2.onload = function () {
49219
+ var res = reader_2 === null || reader_2 === void 0 ? void 0 : reader_2.result;
49220
+ setCADdata({
49221
+ data: JSON.parse(res),
49222
+ id: path,
49223
+ type: CADtypeEnum.VSF
49224
+ });
49225
+ };
49226
+ }
49227
+ }, [file]);
49228
+ /**
49229
+ * Fetch file from cloud
49230
+ */
49231
+ var fetchAndSet = function (url) {
49232
+ fetch(url)
49233
+ .then(function (response) { return response.blob()
49234
+ .then(function (blob) {
49235
+ setCurrFile(blob);
49236
+ setCADintegration(blob);
49237
+ }); })
49238
+ .catch(function () { })
49239
+ .finally(function () { return setIsLoading(false); });
49240
+ };
49241
+ useEffect(function () {
49242
+ if (isCloud) {
49243
+ // Generate Blob on click
49244
+ studyId && downloadArtifact(path, studyId)
49245
+ .then(function (url) { return fetchAndSet(url); })
49246
+ .catch(function () { return onClicked({ label: label, path: path, file: undefined, description: description, runId: runId }); });
49247
+ }
49248
+ else {
49249
+ // TODO: Local later...
49250
+ onClicked({ label: label, path: path, file: currFile, description: description, runId: runId });
49251
+ }
49252
+ }, [studyId, runId, label, path]);
49167
49253
  return React__default.createElement("div", { className: 'card-param card-folder', tabIndex: 0, role: 'button', key: label, onClick: function (event) {
49168
49254
  event.stopPropagation();
49169
- onClicked({ label: label, path: path, file: file, description: description });
49255
+ onClicked({ label: label, path: path, file: currFile, description: description });
49170
49256
  } },
49171
49257
  React__default.createElement("div", { className: 'title-param' },
49172
- React__default.createElement("div", { style: { float: 'left', margin: '0 8px 0 0' } },
49258
+ React__default.createElement("div", { style: { float: 'left', margin: '0 8px 0 0' } }, !isLoading ? React__default.createElement("div", null,
49173
49259
  React__default.createElement("span", { style: { margin: '0 8px 0 0' } }, getFileIcon(18, ((_c = (_b = path.split('/')
49174
49260
  .reverse()[0]) === null || _b === void 0 ? void 0 : _b.split('.')) === null || _c === void 0 ? void 0 : _c.pop()) || '')),
49175
- label),
49261
+ label)
49262
+ : React__default.createElement(LoadingIcon, { size: 14 })),
49176
49263
  React__default.createElement("div", { style: { textAlign: 'right' } },
49177
49264
  React__default.createElement("button", { style: { all: 'unset', margin: '0 0 0 8px' }, onMouseOver: function () { return setOver(true); }, onMouseLeave: function () { return setOver(false); }, onClick: function (event) {
49178
49265
  event.stopPropagation();
49179
49266
  setOpen(function (prev) { return !prev; });
49180
49267
  } },
49181
49268
  React__default.createElement(InfoCircle$1, { size: 14, style: over ? { color: '#40a9ff' } : {} })))),
49269
+ CADdata && React__default.createElement("hr", null),
49270
+ React__default.createElement("div", { className: 'value-param' },
49271
+ CADdata && CADdata.type === CADtypeEnum.HBJSON && React__default.createElement(SendModel, { style: {
49272
+ backgroundColor: '#fff',
49273
+ color: 'var(--primary3)',
49274
+ border: '1px solid var(--slate9)',
49275
+ // @ts-ignore
49276
+ highlight: 'var(--slate7)'
49277
+ }, hbjson: CADdata.data, buttonLabel: 'Model', defaultAction: Action.add, optionsConfig: {
49278
+ add: true,
49279
+ delete: false,
49280
+ 'subscribe-preview': false,
49281
+ clear: true,
49282
+ preview: true
49283
+ }, key: CADdata.id, defaultKey: CADdata.id }),
49284
+ CADdata && CADdata.type === CADtypeEnum.VSF && React__default.createElement(SendResults, { style: {
49285
+ backgroundColor: '#fff',
49286
+ color: 'var(--primary3)',
49287
+ border: '1px solid var(--slate9)',
49288
+ // @ts-ignore
49289
+ highlight: 'var(--slate7)'
49290
+ }, results: CADdata.data, buttonLabel: 'Results', defaultAction: Action.add, optionsConfig: {
49291
+ add: true,
49292
+ delete: false,
49293
+ 'subscribe-preview': false,
49294
+ clear: true,
49295
+ preview: true
49296
+ }, key: CADdata.id, defaultKey: CADdata.id })),
49182
49297
  open && React__default.createElement("div", { className: 'card-description' }, description));
49183
49298
  };
49184
49299
 
@@ -49209,16 +49324,6 @@ styleInject(css_248z$2);
49209
49324
 
49210
49325
  var RunContent = function (_a) {
49211
49326
  var inputData = _a.inputData, projectOwner = _a.projectOwner, projectName = _a.projectName, studyId = _a.studyId, runId = _a.runId, client = _a.client, title = _a.title, style = _a.style, getFileCard = _a.getFileCard, getFolderCard = _a.getFolderCard;
49212
- var downloadArtifact = useArtifacts(projectOwner, projectName, client).downloadArtifact;
49213
- var fetchAndSet = function (url, card) {
49214
- fetch(url)
49215
- .then(function (response) { return response.blob()
49216
- .then(function (blob) {
49217
- blob.type;
49218
- getFileCard(__assign(__assign({}, card), { file: blob }));
49219
- }); })
49220
- .catch(function () { });
49221
- };
49222
49327
  var _b = useState([]), currData = _b[0], setCurrData = _b[1];
49223
49328
  var _c = useState([]), currParams = _c[0], setCurrParams = _c[1];
49224
49329
  var _d = useState([]), currFiles = _d[0], setCurrFiles = _d[1];
@@ -49234,7 +49339,7 @@ var RunContent = function (_a) {
49234
49339
  switch (i.type) {
49235
49340
  case 'StepFileInput':
49236
49341
  case 'StepFileOutput':
49237
- files.push({ label: i.name,
49342
+ files.push({ runId: runId, label: i.name,
49238
49343
  path: i.source.path, description: i.description });
49239
49344
  break;
49240
49345
  case 'StepFolderInput':
@@ -49262,16 +49367,7 @@ var RunContent = function (_a) {
49262
49367
  * @param card File card props
49263
49368
  */
49264
49369
  var onFileClicked = function (card) {
49265
- if (isCloud) {
49266
- // Generate Blob on click
49267
- studyId && downloadArtifact(card.path, studyId)
49268
- .then(function (url) { return fetchAndSet(url, card); })
49269
- .catch(function () { return getFileCard(__assign(__assign({}, card), { file: undefined })); });
49270
- }
49271
- else {
49272
- // TODO: Local later...
49273
- getFileCard(__assign(__assign({}, card), { file: card.path }));
49274
- }
49370
+ getFileCard(card);
49275
49371
  };
49276
49372
  /**
49277
49373
  * Click event handler of the folder card
@@ -49279,21 +49375,21 @@ var RunContent = function (_a) {
49279
49375
  */
49280
49376
  var onFolderClicked = function (card) {
49281
49377
  if (isCloud) {
49282
- getFolderCard(__assign({}, card));
49378
+ getFolderCard(card);
49283
49379
  // window.location.href = `/${projectOwner}/projects/${projectName}/studies/${studyId}/runs/${runId}/workspace?path=${card.path}`
49284
49380
  }
49285
49381
  else {
49286
49382
  // TODO: Fix it later when Local is ready
49287
- getFolderCard(__assign({}, card));
49383
+ getFolderCard(card);
49288
49384
  // alert(runId.concat('/').concat(card.path))
49289
49385
  }
49290
49386
  };
49291
49387
  return React__default.createElement("div", { className: 'cards-container', style: __assign({}, style) },
49292
49388
  React__default.createElement("h5", { className: 'cards-container-title' }, title || 'Something'),
49293
- currFiles.length > 0 && React__default.createElement("div", { style: { padding: '20px' } },
49389
+ currFiles.length > 0 && projectOwner && projectName && client && runId && React__default.createElement("div", { style: { padding: '20px' } },
49294
49390
  React__default.createElement("div", { className: 'cards' }, currFiles.map(function (_a, index) {
49295
49391
  var label = _a.label, path = _a.path, description = _a.description;
49296
- return React__default.createElement(FileCard, { key: "filecard-".concat(index), label: label, path: path, description: description, onClicked: onFileClicked });
49392
+ return React__default.createElement(FileCard, { projectOwner: projectOwner, projectName: projectName, studyId: studyId, runId: runId, client: client, key: "filecard-".concat(index), label: label, path: path, description: description, onClicked: onFileClicked });
49297
49393
  }))),
49298
49394
  currFolders.length > 0 && React__default.createElement("div", { style: { padding: '20px' } },
49299
49395
  React__default.createElement("div", { className: 'cards' }, currFolders.map(function (_a, index) {