utopia-ui 3.0.33 → 3.0.34

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,4 @@
1
+ import type { Item } from '#types/Item';
2
+ export declare const GalleryView: ({ item }: {
3
+ item: Item;
4
+ }) => import("react/jsx-runtime").JSX.Element;
package/dist/index.d.ts CHANGED
@@ -8,6 +8,8 @@ export { TitleCard, CardPage, MapOverlayPage, OverlayItemsIndexPage, MoonCalenda
8
8
  export { TextInput, TextAreaInput, SelectBox } from './Components/Input';
9
9
  declare global {
10
10
  interface Window {
11
- my_modal_3: any;
11
+ my_modal_3: {
12
+ showModal(): void;
13
+ };
12
14
  }
13
15
  }
package/dist/index.js CHANGED
@@ -3362,9 +3362,9 @@ function ItemFormPopup(props) {
3362
3362
  var user = useAuth().user;
3363
3363
  var handleSubmit = function (evt) { return __awaiter(_this, void 0, void 0, function () {
3364
3364
  var formItem, success, error_1, item, uuid, success, _a, _b, error_2;
3365
- var _c, _d, _e, _f;
3366
- return __generator(this, function (_g) {
3367
- switch (_g.label) {
3365
+ var _c, _d, _e, _f, _g;
3366
+ return __generator(this, function (_h) {
3367
+ switch (_h.label) {
3368
3368
  case 0:
3369
3369
  formItem = {};
3370
3370
  Array.from(evt.target).forEach(function (input) {
@@ -3386,16 +3386,16 @@ function ItemFormPopup(props) {
3386
3386
  }));
3387
3387
  if (!props.item) return [3 /*break*/, 5];
3388
3388
  success = false;
3389
- _g.label = 1;
3389
+ _h.label = 1;
3390
3390
  case 1:
3391
- _g.trys.push([1, 3, , 4]);
3391
+ _h.trys.push([1, 3, , 4]);
3392
3392
  return [4 /*yield*/, ((_d = props.layer.api) === null || _d === void 0 ? void 0 : _d.updateItem(__assign(__assign({}, formItem), { id: props.item.id })))];
3393
3393
  case 2:
3394
- _g.sent();
3394
+ _h.sent();
3395
3395
  success = true;
3396
3396
  return [3 /*break*/, 4];
3397
3397
  case 3:
3398
- error_1 = _g.sent();
3398
+ error_1 = _h.sent();
3399
3399
  toast.error(error_1.toString());
3400
3400
  return [3 /*break*/, 4];
3401
3401
  case 4:
@@ -3412,28 +3412,28 @@ function ItemFormPopup(props) {
3412
3412
  item = items.find(function (i) { var _a, _b; return ((_a = i.user_created) === null || _a === void 0 ? void 0 : _a.id) === (user === null || user === void 0 ? void 0 : user.id) && ((_b = i.layer) === null || _b === void 0 ? void 0 : _b.itemType.name) === props.layer.itemType.name; });
3413
3413
  uuid = crypto.randomUUID();
3414
3414
  success = false;
3415
- _g.label = 6;
3415
+ _h.label = 6;
3416
3416
  case 6:
3417
- _g.trys.push([6, 11, , 12]);
3417
+ _h.trys.push([6, 11, , 12]);
3418
3418
  _a = props.layer.onlyOnePerOwner &&
3419
3419
  item;
3420
3420
  if (!_a) return [3 /*break*/, 8];
3421
3421
  return [4 /*yield*/, ((_e = props.layer.api) === null || _e === void 0 ? void 0 : _e.updateItem(__assign(__assign({}, formItem), { id: item.id })))];
3422
3422
  case 7:
3423
- _a = (_g.sent());
3424
- _g.label = 8;
3423
+ _a = (_h.sent());
3424
+ _h.label = 8;
3425
3425
  case 8:
3426
3426
  _b = (!props.layer.onlyOnePerOwner || !item);
3427
3427
  if (!_b) return [3 /*break*/, 10];
3428
3428
  return [4 /*yield*/, ((_f = props.layer.api) === null || _f === void 0 ? void 0 : _f.createItem(__assign(__assign({}, formItem), { id: uuid, name: formItem.name ? formItem.name : user === null || user === void 0 ? void 0 : user.first_name })))];
3429
3429
  case 9:
3430
- _b = (_g.sent());
3431
- _g.label = 10;
3430
+ _b = (_h.sent());
3431
+ _h.label = 10;
3432
3432
  case 10:
3433
3433
  success = true;
3434
3434
  return [3 /*break*/, 12];
3435
3435
  case 11:
3436
- error_2 = _g.sent();
3436
+ error_2 = _h.sent();
3437
3437
  toast.error(error_2.toString());
3438
3438
  return [3 /*break*/, 12];
3439
3439
  case 12:
@@ -3441,14 +3441,14 @@ function ItemFormPopup(props) {
3441
3441
  if (props.layer.onlyOnePerOwner && item)
3442
3442
  updateItem(__assign(__assign({}, item), formItem));
3443
3443
  if (!props.layer.onlyOnePerOwner || !item) {
3444
- addItem(__assign(__assign({}, formItem), { name: formItem.name ? formItem.name : user === null || user === void 0 ? void 0 : user.first_name, user_created: user, type: props.layer.itemType, id: uuid, layer: props.layer, public_edit: !user }));
3444
+ addItem(__assign(__assign({}, formItem), { name: (_g = (formItem.name ? formItem.name : user === null || user === void 0 ? void 0 : user.first_name)) !== null && _g !== void 0 ? _g : '', user_created: user !== null && user !== void 0 ? user : undefined, type: props.layer.itemType, id: uuid, layer: props.layer, public_edit: !user }));
3445
3445
  }
3446
3446
  toast.success('New item created');
3447
3447
  resetFilterTags();
3448
3448
  }
3449
3449
  setSpinner(false);
3450
3450
  map.closePopup();
3451
- _g.label = 13;
3451
+ _h.label = 13;
3452
3452
  case 13:
3453
3453
  props.setItemFormPopup(null);
3454
3454
  return [2 /*return*/];
@@ -4076,52 +4076,61 @@ var PopupButton = function (_a) {
4076
4076
  };
4077
4077
 
4078
4078
  function NavBar(_a) {
4079
+ var _this = this;
4079
4080
  var appName = _a.appName, userType = _a.userType;
4080
4081
  var _b = useAuth(), isAuthenticated = _b.isAuthenticated, user = _b.user, logout = _b.logout;
4081
4082
  var _c = useState({}), userProfile = _c[0], setUserProfile = _c[1];
4082
4083
  var items = useItems();
4083
4084
  useEffect(function () {
4085
+ var _a;
4084
4086
  var profile = user &&
4085
4087
  items.find(function (i) { var _a, _b; return ((_a = i.user_created) === null || _a === void 0 ? void 0 : _a.id) === user.id && ((_b = i.layer) === null || _b === void 0 ? void 0 : _b.itemType.name) === userType; });
4086
4088
  profile
4087
4089
  ? setUserProfile(profile)
4088
- : setUserProfile({ id: crypto.randomUUID(), name: user === null || user === void 0 ? void 0 : user.first_name, text: '' });
4090
+ : setUserProfile({ id: crypto.randomUUID(), name: (_a = user === null || user === void 0 ? void 0 : user.first_name) !== null && _a !== void 0 ? _a : '', text: '' });
4089
4091
  // eslint-disable-next-line react-hooks/exhaustive-deps
4090
4092
  }, [user, items]);
4091
- useEffect(function () { }, [userProfile]);
4093
+ // useEffect(() => {}, [userProfile])
4092
4094
  var nameRef = useRef(null);
4093
4095
  var _d = useState(0), nameWidth = _d[0], setNameWidth = _d[1];
4094
4096
  var location = useLocation();
4095
4097
  var _e = useState(false), showNav = _e[0], setShowNav = _e[1];
4096
4098
  useEffect(function () {
4097
- showNav && nameRef && setNameWidth(nameRef.current.scrollWidth);
4099
+ showNav && nameRef.current && setNameWidth(nameRef.current.scrollWidth);
4098
4100
  }, [nameRef, appName, showNav]);
4099
4101
  useEffect(function () {
4100
4102
  var params = new URLSearchParams(location.search);
4101
4103
  var embedded = params.get('embedded');
4102
4104
  embedded !== 'true' && setShowNav(true);
4103
4105
  }, [location]);
4104
- var onLogout = function () {
4105
- toast.promise(logout(), {
4106
- success: {
4107
- render: function () {
4108
- return 'Bye bye';
4109
- },
4110
- // other options
4111
- icon: '👋',
4112
- },
4113
- error: {
4114
- render: function (_a) {
4115
- var data = _a.data;
4116
- return "".concat(data);
4117
- },
4118
- },
4119
- pending: 'logging out ..',
4106
+ var onLogout = function () { return __awaiter(_this, void 0, void 0, function () {
4107
+ return __generator(this, function (_a) {
4108
+ switch (_a.label) {
4109
+ case 0: return [4 /*yield*/, toast.promise(logout(), {
4110
+ success: {
4111
+ render: function () {
4112
+ return 'Bye bye';
4113
+ },
4114
+ // other options
4115
+ icon: '👋',
4116
+ },
4117
+ error: {
4118
+ render: function (_a) {
4119
+ var data = _a.data;
4120
+ return JSON.stringify(data);
4121
+ },
4122
+ },
4123
+ pending: 'logging out ..',
4124
+ })];
4125
+ case 1:
4126
+ _a.sent();
4127
+ return [2 /*return*/];
4128
+ }
4120
4129
  });
4121
- };
4130
+ }); };
4122
4131
  if (showNav) {
4123
- return (jsx(Fragment, { children: jsxs("div", __assign({ className: 'tw-navbar tw-bg-base-100 tw-z-[10000] tw-shadow-xl tw-relative' }, { children: [jsx("button", __assign({ className: 'tw-btn tw-btn-square tw-btn-ghost', "data-te-sidenav-toggle-ref": true, "data-te-target": '#sidenav', "aria-controls": '#sidenav', "aria-haspopup": 'true' }, { children: jsx("svg", __assign({ xmlns: 'http://www.w3.org/2000/svg', fill: 'none', viewBox: '0 0 24 24', className: 'tw-inline-block tw-w-5 tw-h-5 tw-stroke-current' }, { children: jsx("path", { strokeLinecap: 'round', strokeLinejoin: 'round', strokeWidth: '2', d: 'M4 6h16M4 12h16M4 18h16' }) })) })), jsx("div", __assign({ className: 'tw-flex-1 tw-mr-2' }, { children: jsxs("div", __assign({ className: 'tw-flex-1 tw-truncate tw-grid tw-grid-flow-col', style: { maxWidth: nameWidth + 60 } }, { children: [jsx(Link, __assign({ className: 'tw-btn tw-btn-ghost tw-px-2 tw-normal-case tw-text-xl tw-flex-1 tw-truncate', to: '/' }, { children: jsx("h1", __assign({ ref: nameRef, className: 'tw-truncate' }, { children: appName })) })), jsx("button", __assign({ className: 'tw-btn tw-px-2 tw-btn-ghost', onClick: function () { return window.my_modal_3.showModal(); } }, { children: jsx(QuestionMarkIcon, { className: 'tw-h-5 tw-w-5' }) }))] })) })), isAuthenticated ? (jsxs("div", __assign({ className: 'tw-flex-none' }, { children: [jsxs(Link, __assign({ to: "".concat(userProfile.id && '/item/' + userProfile.id), className: 'tw-flex tw-items-center' }, { children: [(userProfile === null || userProfile === void 0 ? void 0 : userProfile.image) && (jsx("div", __assign({ className: 'tw-avatar' }, { children: jsx("div", __assign({ className: 'tw-w-10 tw-rounded-full' }, { children: jsx("img", { src: 'https://api.utopia-lab.org/assets/' + userProfile.image }) })) }))), jsx("div", __assign({ className: 'tw-ml-2 tw-mr-2' }, { children: userProfile.name || (user === null || user === void 0 ? void 0 : user.first_name) }))] })), jsxs("div", __assign({ className: 'tw-dropdown tw-dropdown-end' }, { children: [jsx("label", __assign({ tabIndex: 0, className: 'tw-btn tw-btn-ghost tw-btn-square' }, { children: jsx("svg", __assign({ xmlns: 'http://www.w3.org/2000/svg', className: 'tw-h-5 tw-w-5', viewBox: '0 0 20 20', fill: 'currentColor' }, { children: jsx("path", { d: 'M10 6a2 2 0 110-4 2 2 0 010 4zM10 12a2 2 0 110-4 2 2 0 010 4zM10 18a2 2 0 110-4 2 2 0 010 4z' }) })) })), jsxs("ul", __assign({ tabIndex: 0, className: 'tw-menu tw-menu-compact tw-dropdown-content tw-mt-3 tw-p-2 tw-shadow tw-bg-base-100 tw-rounded-box tw-w-52 !tw-z-[10000]' }, { children: [jsx("li", { children: jsx(Link, __assign({ to: "".concat(userProfile.id && '/edit-item/' + userProfile.id) }, { children: "Profile" })) }), jsx("li", { children: jsx(Link, __assign({ to: '/user-settings' }, { children: "Settings" })) }), jsx("li", { children: jsx("a", __assign({ onClick: function () {
4124
- onLogout();
4132
+ return (jsx(Fragment, { children: jsxs("div", __assign({ className: 'tw-navbar tw-bg-base-100 tw-z-[10000] tw-shadow-xl tw-relative' }, { children: [jsx("button", __assign({ className: 'tw-btn tw-btn-square tw-btn-ghost', "data-te-sidenav-toggle-ref": true, "data-te-target": '#sidenav', "aria-controls": '#sidenav', "aria-haspopup": 'true' }, { children: jsx("svg", __assign({ xmlns: 'http://www.w3.org/2000/svg', fill: 'none', viewBox: '0 0 24 24', className: 'tw-inline-block tw-w-5 tw-h-5 tw-stroke-current' }, { children: jsx("path", { strokeLinecap: 'round', strokeLinejoin: 'round', strokeWidth: '2', d: 'M4 6h16M4 12h16M4 18h16' }) })) })), jsx("div", __assign({ className: 'tw-flex-1 tw-mr-2' }, { children: jsxs("div", __assign({ className: 'tw-flex-1 tw-truncate tw-grid tw-grid-flow-col', style: { maxWidth: nameWidth + 60 } }, { children: [jsx(Link, __assign({ className: 'tw-btn tw-btn-ghost tw-px-2 tw-normal-case tw-text-xl tw-flex-1 tw-truncate', to: '/' }, { children: jsx("h1", __assign({ ref: nameRef, className: 'tw-truncate' }, { children: appName })) })), jsx("button", __assign({ className: 'tw-btn tw-px-2 tw-btn-ghost', onClick: function () { return window.my_modal_3.showModal(); } }, { children: jsx(QuestionMarkIcon, { className: 'tw-h-5 tw-w-5' }) }))] })) })), isAuthenticated ? (jsxs("div", __assign({ className: 'tw-flex-none' }, { children: [jsxs(Link, __assign({ to: "".concat(userProfile.id && '/item/' + userProfile.id), className: 'tw-flex tw-items-center' }, { children: [userProfile.image && (jsx("div", __assign({ className: 'tw-avatar' }, { children: jsx("div", __assign({ className: 'tw-w-10 tw-rounded-full' }, { children: jsx("img", { src: 'https://api.utopia-lab.org/assets/' + userProfile.image }) })) }))), jsx("div", __assign({ className: 'tw-ml-2 tw-mr-2' }, { children: userProfile.name || (user === null || user === void 0 ? void 0 : user.first_name) }))] })), jsxs("div", __assign({ className: 'tw-dropdown tw-dropdown-end' }, { children: [jsx("label", __assign({ tabIndex: 0, className: 'tw-btn tw-btn-ghost tw-btn-square' }, { children: jsx("svg", __assign({ xmlns: 'http://www.w3.org/2000/svg', className: 'tw-h-5 tw-w-5', viewBox: '0 0 20 20', fill: 'currentColor' }, { children: jsx("path", { d: 'M10 6a2 2 0 110-4 2 2 0 010 4zM10 12a2 2 0 110-4 2 2 0 010 4zM10 18a2 2 0 110-4 2 2 0 010 4z' }) })) })), jsxs("ul", __assign({ tabIndex: 0, className: 'tw-menu tw-menu-compact tw-dropdown-content tw-mt-3 tw-p-2 tw-shadow tw-bg-base-100 tw-rounded-box tw-w-52 !tw-z-[10000]' }, { children: [jsx("li", { children: jsx(Link, __assign({ to: "".concat(userProfile.id && '/edit-item/' + userProfile.id) }, { children: "Profile" })) }), jsx("li", { children: jsx(Link, __assign({ to: '/user-settings' }, { children: "Settings" })) }), jsx("li", { children: jsx("a", __assign({ onClick: function () {
4133
+ void onLogout();
4125
4134
  } }, { children: "Logout" })) })] }))] }))] }))) : (jsxs("div", { children: [jsxs("div", __assign({ className: 'tw-hidden md:tw-flex' }, { children: [jsx(Link, __assign({ to: '/login' }, { children: jsx("div", __assign({ className: 'tw-btn tw-btn-ghost tw-mr-2' }, { children: "Login" })) })), jsx(Link, __assign({ to: '/signup' }, { children: jsx("div", __assign({ className: 'tw-btn tw-btn-ghost tw-mr-2' }, { children: "Sign Up" })) }))] })), jsxs("div", __assign({ className: 'tw-dropdown tw-dropdown-end' }, { children: [jsx("label", __assign({ tabIndex: 1, className: 'tw-btn tw-btn-ghost md:tw-hidden' }, { children: jsx("svg", __assign({ xmlns: 'http://www.w3.org/2000/svg', className: 'tw-h-5 tw-w-5', viewBox: '0 0 20 20', fill: 'currentColor' }, { children: jsx("path", { d: 'M10 6a2 2 0 110-4 2 2 0 010 4zM10 12a2 2 0 110-4 2 2 0 010 4zM10 18a2 2 0 110-4 2 2 0 010 4z' }) })) })), jsxs("ul", __assign({ tabIndex: 1, className: 'tw-menu tw-dropdown-content tw-mt-3 tw-p-2 tw-shadow tw-bg-base-100 tw-rounded-box tw-w-52 !tw-z-[10000]' }, { children: [jsx("li", { children: jsx(Link, __assign({ to: '/login' }, { children: "Login" })) }), jsx("li", { children: jsx(Link, __assign({ to: '/signup' }, { children: "Sign Up" })) })] }))] }))] }))] })) }));
4126
4135
  }
4127
4136
  else
@@ -4439,7 +4448,7 @@ var OverlayItemsIndexPage = function (_a) {
4439
4448
  if (success) {
4440
4449
  toast.success('New item created');
4441
4450
  }
4442
- addItem(__assign(__assign({}, formItem), { user_created: user, id: uuid, layer: layer, public_edit: !user }));
4451
+ addItem(__assign(__assign({}, formItem), { user_created: user !== null && user !== void 0 ? user : undefined, id: uuid, layer: layer, public_edit: !user }));
4443
4452
  setLoading(false);
4444
4453
  setAddItemPopupType('');
4445
4454
  return [2 /*return*/];
@@ -4622,7 +4631,7 @@ var AttestationForm = function (_a) {
4622
4631
  var to;
4623
4632
  return __generator(this, function (_a) {
4624
4633
  to = [];
4625
- users === null || users === void 0 ? void 0 : users.map(function (u) { return to.push({ directus_users_id: u.user_created.id }); });
4634
+ users === null || users === void 0 ? void 0 : users.map(function (u) { var _a; return to.push({ directus_users_id: (_a = u.user_created) === null || _a === void 0 ? void 0 : _a.id }); });
4626
4635
  (api === null || api === void 0 ? void 0 : api.createItem) &&
4627
4636
  toast
4628
4637
  .promise(api.createItem({
@@ -4645,9 +4654,9 @@ var AttestationForm = function (_a) {
4645
4654
  var _a;
4646
4655
  return navigate('/item/' +
4647
4656
  ((_a = items.find(function (i) {
4648
- var _a;
4649
- return i.user_created.id === to[0].directus_users_id &&
4650
- ((_a = i.layer) === null || _a === void 0 ? void 0 : _a.itemType.name) === 'player';
4657
+ var _a, _b;
4658
+ return ((_a = i.user_created) === null || _a === void 0 ? void 0 : _a.id) === to[0].directus_users_id &&
4659
+ ((_b = i.layer) === null || _b === void 0 ? void 0 : _b.itemType.name) === 'player';
4651
4660
  })) === null || _a === void 0 ? void 0 : _a.id) +
4652
4661
  '?tab=2');
4653
4662
  });
@@ -5110,8 +5119,9 @@ var FlexView = function (_a) {
5110
5119
  };
5111
5120
 
5112
5121
  var OnepagerView = function (_a) {
5122
+ var _b;
5113
5123
  var item = _a.item;
5114
- return (jsxs("div", __assign({ className: 'tw-h-full tw-overflow-y-auto fade' }, { children: [jsx(GroupSubHeaderView, { item: item, shareBaseUrl: "https://www.wuerdekompass.org/aktivitaeten/gruppensuche/#/gruppe/".concat(item.slug) }), item.user_created.first_name && jsx(ContactInfoView, { heading: 'Du hast Fragen?', item: item }), jsx("div", __assign({ className: 'tw-my-10 tw-mt-2 tw-px-6 tw-text-sm ' }, { children: jsx(TextView, { rawText: item.text || 'Keine Beschreibung vorhanden' }) })), item.next_appointment && (jsxs("div", __assign({ className: 'tw-my-10 tw-px-6' }, { children: [jsx("h2", __assign({ className: 'tw-text-lg tw-font-semibold' }, { children: "N\u00E4chste Termine" })), jsx("div", __assign({ className: 'tw-mt-2 tw-text-sm' }, { children: jsx(TextView, { rawText: item.next_appointment }) }))] }))), ";"] })));
5124
+ return (jsxs("div", __assign({ className: 'tw-h-full tw-overflow-y-auto fade' }, { children: [jsx(GroupSubHeaderView, { item: item, shareBaseUrl: "https://www.wuerdekompass.org/aktivitaeten/gruppensuche/#/gruppe/".concat(item.slug) }), ((_b = item.user_created) === null || _b === void 0 ? void 0 : _b.first_name) && jsx(ContactInfoView, { heading: 'Du hast Fragen?', item: item }), jsx("div", __assign({ className: 'tw-my-10 tw-mt-2 tw-px-6 tw-text-sm ' }, { children: jsx(TextView, { rawText: item.text || 'Keine Beschreibung vorhanden' }) })), item.next_appointment && (jsxs("div", __assign({ className: 'tw-my-10 tw-px-6' }, { children: [jsx("h2", __assign({ className: 'tw-text-lg tw-font-semibold' }, { children: "N\u00E4chste Termine" })), jsx("div", __assign({ className: 'tw-mt-2 tw-text-sm' }, { children: jsx(TextView, { rawText: item.next_appointment }) }))] }))), ";"] })));
5115
5125
  };
5116
5126
 
5117
5127
  var SimpleView = function (_a) {
@@ -5211,7 +5221,7 @@ var TabsView = function (_a) {
5211
5221
  // eslint-disable-next-line react-hooks/exhaustive-deps
5212
5222
  }, [location.search]);
5213
5223
  return (jsxs("div", __assign({ role: 'tablist', className: 'tw-tabs tw-tabs-lifted tw-mt-2 tw-mb-2 tw-px-6' }, { children: [jsx("input", { type: 'radio', name: 'my_tabs_2', role: 'tab', className: 'tw-tab tw-font-bold !tw-ps-2 !tw-pe-2 [--tab-border-color:var(--fallback-bc,oklch(var(--bc)/0.2))]', "aria-label": "".concat(((_b = item.layer) === null || _b === void 0 ? void 0 : _b.itemType.icon_as_labels) && activeTab !== 1 ? '📝' : '📝\u00A0Info'), checked: activeTab === 1 && true, onChange: function () { return updateActiveTab(1); } }), jsxs("div", __assign({ role: 'tabpanel', className: 'tw-tab-content tw-bg-base-100 tw-rounded-box tw-h-[calc(100dvh-280px)] tw-overflow-y-auto fade tw-pt-2 tw-pb-4 tw-mb-4 tw-overflow-x-hidden' }, { children: [((_c = item.layer) === null || _c === void 0 ? void 0 : _c.itemType.show_start_end) && (jsx("div", __assign({ className: 'tw-max-w-xs' }, { children: jsx(StartEndView, { item: item }) }))), jsx(TextView, { item: item }), jsx("div", { className: 'tw-h-4' }), jsx(TextView, { item: item, itemTextField: 'contact' })] })), ((_d = item.layer) === null || _d === void 0 ? void 0 : _d.itemType.questlog) && (jsxs(Fragment, { children: [jsx("input", { type: 'radio', name: 'my_tabs_2', role: 'tab', className: 'tw-tab tw-font-bold !tw-ps-2 !tw-pe-2 [--tab-border-color:var(--fallback-bc,oklch(var(--bc)/0.2))]', "aria-label": "".concat(item.layer.itemType.icon_as_labels && activeTab !== 2 ? '❤️' : '❤️\u00A0Credibility'), checked: activeTab === 2 && true, onChange: function () { return updateActiveTab(2); } }), jsx("div", __assign({ role: 'tabpanel', className: 'tw-tab-content tw-bg-base-100 tw-rounded-box tw-h-[calc(100dvh-280px)] tw-overflow-y-auto fade tw-pt-2 tw-pb-4 tw-mb-4 tw-overflow-x-hidden' }, { children: jsx("table", __assign({ className: 'sm:tw-table-sm md:tw-table-md' }, { children: jsx("tbody", { children: attestations
5214
- .filter(function (a) { return a.to.some(function (t) { return t.directus_users_id === item.user_created.id; }); })
5224
+ .filter(function (a) { return a.to.some(function (t) { var _a; return t.directus_users_id === ((_a = item.user_created) === null || _a === void 0 ? void 0 : _a.id); }); })
5215
5225
  .sort(function (a, b) {
5216
5226
  return new Date(b.date_created).getTime() - new Date(a.date_created).getTime();
5217
5227
  })
@@ -5889,6 +5899,7 @@ function ProfileForm() {
5889
5899
  item && hasUserPermission('items', 'update', item) && setUpdatePermission(true);
5890
5900
  }, [hasUserPermission, item]);
5891
5901
  useEffect(function () {
5902
+ var _a;
5892
5903
  var itemId = location.pathname.split('/')[2];
5893
5904
  var item = items.find(function (i) { return i.id === itemId; });
5894
5905
  item && setItem(item);
@@ -5896,7 +5907,7 @@ function ProfileForm() {
5896
5907
  var layer = layers.find(function (l) { return l.itemType.name === appState.userType; });
5897
5908
  setItem({
5898
5909
  id: crypto.randomUUID(),
5899
- name: user ? user.first_name : '',
5910
+ name: (_a = user === null || user === void 0 ? void 0 : user.first_name) !== null && _a !== void 0 ? _a : '',
5900
5911
  text: '',
5901
5912
  layer: layer,
5902
5913
  new: true,