@overmap-ai/core 1.0.48-add-agent-response-rating.2 → 1.0.48-add-teams.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.
@@ -622,15 +622,15 @@ var __publicField = (obj, key, value) => {
622
622
  };
623
623
  const migrations = [initialVersioning, signOut, signOut, createOutboxState];
624
624
  const manifest = Object.fromEntries(migrations.map((migration2, i) => [i, wrapMigration(migration2)]));
625
- const initialState$n = {
625
+ const initialState$o = {
626
626
  accessToken: "",
627
627
  refreshToken: "",
628
628
  isLoggedIn: false
629
629
  };
630
630
  const authSlice = toolkit.createSlice({
631
631
  name: "auth",
632
- initialState: initialState$n,
633
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$n)),
632
+ initialState: initialState$o,
633
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$o)),
634
634
  reducers: {
635
635
  setTokens: (state, action) => {
636
636
  state.accessToken = action.payload.accessToken;
@@ -1361,7 +1361,7 @@ var __publicField = (obj, key, value) => {
1361
1361
  return getLocalDateString(date);
1362
1362
  return relative.format(days, "days");
1363
1363
  });
1364
- const initialState$m = {
1364
+ const initialState$n = {
1365
1365
  categories: {},
1366
1366
  usedCategoryColors: [],
1367
1367
  categoryVisibility: {
@@ -1371,8 +1371,8 @@ var __publicField = (obj, key, value) => {
1371
1371
  };
1372
1372
  const categorySlice = toolkit.createSlice({
1373
1373
  name: "categories",
1374
- initialState: initialState$m,
1375
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$m)),
1374
+ initialState: initialState$n,
1375
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$n)),
1376
1376
  reducers: {
1377
1377
  setCategories: (state, action) => {
1378
1378
  if (!Array.isArray(action.payload))
@@ -1540,14 +1540,14 @@ var __publicField = (obj, key, value) => {
1540
1540
  delete state.attachments[attachmentId];
1541
1541
  }
1542
1542
  }
1543
- const initialState$l = {
1543
+ const initialState$m = {
1544
1544
  components: {},
1545
1545
  attachments: {}
1546
1546
  };
1547
1547
  const componentSlice = toolkit.createSlice({
1548
1548
  name: "components",
1549
- initialState: initialState$l,
1550
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$l)),
1549
+ initialState: initialState$m,
1550
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$m)),
1551
1551
  reducers: {
1552
1552
  addComponent: (state, action) => {
1553
1553
  state.components[action.payload.offline_id] = action.payload;
@@ -1601,6 +1601,7 @@ var __publicField = (obj, key, value) => {
1601
1601
  }
1602
1602
  return prevComponents;
1603
1603
  };
1604
+ const selectComponentsMapping = (state) => state.componentReducer.components;
1604
1605
  const selectComponentsFromComponentType = (componentTypeId) => (state) => {
1605
1606
  if (!componentTypeId)
1606
1607
  return [];
@@ -1631,16 +1632,14 @@ var __publicField = (obj, key, value) => {
1631
1632
  }
1632
1633
  return ret;
1633
1634
  };
1634
- const selectComponentsByType = (componentTypeId) => (state) => {
1635
- const components = state.componentReducer.components;
1636
- const componentsOfType = [];
1637
- for (const component of Object.values(components)) {
1638
- if (component.component_type === componentTypeId) {
1639
- componentsOfType.push(component);
1635
+ const selectComponentsByType = restructureCreateSelectorWithArgs(
1636
+ toolkit.createSelector(
1637
+ [selectComponents, (_state, componentTypeId) => componentTypeId],
1638
+ (components, componentTypeId) => {
1639
+ return components.filter((component) => component.component_type === componentTypeId);
1640
1640
  }
1641
- }
1642
- return componentsOfType;
1643
- };
1641
+ )
1642
+ );
1644
1643
  const selectNumberOfComponentsOfComponentType = (componentTypeId) => (state) => {
1645
1644
  var _a2;
1646
1645
  if (!componentTypeId)
@@ -1701,13 +1700,13 @@ var __publicField = (obj, key, value) => {
1701
1700
  removeAllComponentsOfType
1702
1701
  } = componentSlice.actions;
1703
1702
  const componentReducer = componentSlice.reducer;
1704
- const initialState$k = {
1703
+ const initialState$l = {
1705
1704
  completionsByComponentId: {}
1706
1705
  };
1707
1706
  const componentStageCompletionSlice = toolkit.createSlice({
1708
1707
  name: "componentStageCompletions",
1709
- initialState: initialState$k,
1710
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$k)),
1708
+ initialState: initialState$l,
1709
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$l)),
1711
1710
  reducers: {
1712
1711
  addStageCompletion: (state, action) => {
1713
1712
  let stageToCompletionDateMapping = state.completionsByComponentId[action.payload.component];
@@ -1758,13 +1757,13 @@ var __publicField = (obj, key, value) => {
1758
1757
  return Object.keys(state.componentStageCompletionReducer.completionsByComponentId[component.offline_id] ?? {});
1759
1758
  };
1760
1759
  const componentStageCompletionReducer = componentStageCompletionSlice.reducer;
1761
- const initialState$j = {
1760
+ const initialState$k = {
1762
1761
  stages: {}
1763
1762
  };
1764
1763
  const componentStageSlice = toolkit.createSlice({
1765
1764
  name: "componentStages",
1766
- initialState: initialState$j,
1767
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$j)),
1765
+ initialState: initialState$k,
1766
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$k)),
1768
1767
  reducers: {
1769
1768
  addStages: (state, action) => {
1770
1769
  Object.assign(state.stages, toOfflineIdRecord(action.payload));
@@ -1798,6 +1797,11 @@ var __publicField = (obj, key, value) => {
1798
1797
  }
1799
1798
  });
1800
1799
  const selectStageMapping = (state) => state.componentStageReducer.stages;
1800
+ const selectStage = restructureCreateSelectorWithArgs(
1801
+ toolkit.createSelector([selectStageMapping, (_state, stageId) => stageId], (stageMapping, stageId) => {
1802
+ return stageMapping[stageId];
1803
+ })
1804
+ );
1801
1805
  const selectStages = toolkit.createSelector(
1802
1806
  [selectStageMapping],
1803
1807
  (stageMapping) => {
@@ -1825,6 +1829,20 @@ var __publicField = (obj, key, value) => {
1825
1829
  }
1826
1830
  )
1827
1831
  );
1832
+ const selectComponentTypeStagesMapping = restructureCreateSelectorWithArgs(
1833
+ toolkit.createSelector(
1834
+ [selectStageMapping, (_state, componentTypeId) => componentTypeId],
1835
+ (stagesMapping, componentTypeId) => {
1836
+ const componentTypeStagesMapping = {};
1837
+ for (const [stageId, stage] of Object.entries(stagesMapping)) {
1838
+ if (stage.component_type === componentTypeId) {
1839
+ componentTypeStagesMapping[stageId] = stage;
1840
+ }
1841
+ }
1842
+ return componentTypeStagesMapping;
1843
+ }
1844
+ )
1845
+ );
1828
1846
  const selectStagesFromComponentType = restructureCreateSelectorWithArgs(
1829
1847
  toolkit.createSelector(
1830
1848
  [selectStages, (_state, componentTypeId) => componentTypeId],
@@ -1855,15 +1873,15 @@ var __publicField = (obj, key, value) => {
1855
1873
  );
1856
1874
  const { addStages, updateStages, removeStages, linkStageToForm, unlinkStageToForm } = componentStageSlice.actions;
1857
1875
  const componentStageReducer = componentStageSlice.reducer;
1858
- const initialState$i = {
1876
+ const initialState$j = {
1859
1877
  componentTypes: {},
1860
1878
  hiddenComponentTypeIds: {},
1861
1879
  attachments: {}
1862
1880
  };
1863
1881
  const componentTypeSlice = toolkit.createSlice({
1864
1882
  name: "componentTypes",
1865
- initialState: initialState$i,
1866
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$i)),
1883
+ initialState: initialState$j,
1884
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$j)),
1867
1885
  reducers: {
1868
1886
  addComponentType: (state, action) => {
1869
1887
  state.componentTypes[action.payload.offline_id] = action.payload;
@@ -1971,13 +1989,13 @@ var __publicField = (obj, key, value) => {
1971
1989
  deleteComponentType
1972
1990
  } = componentTypeSlice.actions;
1973
1991
  const componentTypeReducer = componentTypeSlice.reducer;
1974
- const initialState$h = {
1992
+ const initialState$i = {
1975
1993
  workspaces: {},
1976
1994
  activeWorkspaceId: null
1977
1995
  };
1978
1996
  const workspaceSlice = toolkit.createSlice({
1979
1997
  name: "workspace",
1980
- initialState: initialState$h,
1998
+ initialState: initialState$i,
1981
1999
  // The `reducers` field lets us define reducers and generate associated actions
1982
2000
  reducers: {
1983
2001
  setWorkspaces: (state, action) => {
@@ -2034,10 +2052,11 @@ var __publicField = (obj, key, value) => {
2034
2052
  );
2035
2053
  const workspaceReducer = workspaceSlice.reducer;
2036
2054
  const maxRecentIssues = 10;
2037
- const initialState$g = {
2055
+ const initialState$h = {
2038
2056
  issues: {},
2039
2057
  attachments: {},
2040
2058
  comments: {},
2059
+ updates: {},
2041
2060
  visibleStatuses: [IssueStatus.BACKLOG, IssueStatus.SELECTED],
2042
2061
  visibleUserIds: null,
2043
2062
  recentIssueIds: [],
@@ -2045,9 +2064,9 @@ var __publicField = (obj, key, value) => {
2045
2064
  };
2046
2065
  const issueSlice = toolkit.createSlice({
2047
2066
  name: "issues",
2048
- initialState: initialState$g,
2067
+ initialState: initialState$h,
2049
2068
  extraReducers: (builder) => builder.addCase("RESET", (state) => {
2050
- Object.assign(state, initialState$g);
2069
+ Object.assign(state, initialState$h);
2051
2070
  }),
2052
2071
  reducers: {
2053
2072
  setIssues: (state, action) => {
@@ -2059,6 +2078,16 @@ var __publicField = (obj, key, value) => {
2059
2078
  });
2060
2079
  },
2061
2080
  setIssueAttachments: setAttachments,
2081
+ setIssueUpdates: (state, action) => {
2082
+ if (action.payload.filter(onlyUniqueOfflineIds).length !== action.payload.length) {
2083
+ throw new Error("Tried to use setIssues reducer with duplicate ID's");
2084
+ }
2085
+ const newUpdates = {};
2086
+ for (const update of action.payload) {
2087
+ newUpdates[update.offline_id] = update;
2088
+ }
2089
+ state.updates = newUpdates;
2090
+ },
2062
2091
  setActiveIssueId: (state, action) => {
2063
2092
  state.activeIssueId = action.payload;
2064
2093
  },
@@ -2070,6 +2099,17 @@ var __publicField = (obj, key, value) => {
2070
2099
  },
2071
2100
  addIssueAttachment: addAttachment,
2072
2101
  addIssueAttachments: addAttachments,
2102
+ addIssueUpdate: (state, action) => {
2103
+ if (action.payload.offline_id in state.updates) {
2104
+ throw new Error(`Tried to add duplicate issue update with offline_id: ${action.payload.offline_id}`);
2105
+ }
2106
+ state.updates[action.payload.offline_id] = action.payload;
2107
+ },
2108
+ addIssueUpdates: (state, action) => {
2109
+ for (const update of action.payload) {
2110
+ state.updates[update.offline_id] = update;
2111
+ }
2112
+ },
2073
2113
  updateIssue: (state, action) => {
2074
2114
  if (action.payload.offline_id in state.issues) {
2075
2115
  state.issues[action.payload.offline_id] = {
@@ -2089,6 +2129,18 @@ var __publicField = (obj, key, value) => {
2089
2129
  }
2090
2130
  },
2091
2131
  removeIssueAttachment: removeAttachment,
2132
+ removeIssueUpdate: (state, action) => {
2133
+ if (action.payload in state.updates) {
2134
+ delete state.updates[action.payload];
2135
+ } else {
2136
+ throw new Error(`Failed to remove issue update because offline_id doesn't exist: ${action.payload}`);
2137
+ }
2138
+ },
2139
+ removeIssueUpdates: (state, action) => {
2140
+ for (const updateId of action.payload) {
2141
+ delete state.updates[updateId];
2142
+ }
2143
+ },
2092
2144
  removeAttachmentsOfIssue: (state, action) => {
2093
2145
  const attachments = Object.values(state.attachments).filter((a) => a.issue === action.payload);
2094
2146
  for (const attachment of attachments) {
@@ -2101,20 +2153,55 @@ var __publicField = (obj, key, value) => {
2101
2153
  setVisibleUserIds: (state, action) => {
2102
2154
  state.visibleUserIds = [...new Set(action.payload)];
2103
2155
  },
2104
- setIssueComments: (state, action) => {
2156
+ // Comments
2157
+ addIssueComment: (state, action) => {
2158
+ if (action.payload.offline_id in state.comments) {
2159
+ throw new Error(
2160
+ `Tried to add issue comment with offline_id: ${action.payload.offline_id} that already exists`
2161
+ );
2162
+ }
2163
+ state.comments[action.payload.offline_id] = action.payload;
2164
+ },
2165
+ addIssueComments: (state, action) => {
2166
+ for (const comment of action.payload) {
2167
+ if (comment.offline_id in state.comments) {
2168
+ throw new Error(
2169
+ `Tried to add issue comment with offline_id: ${comment.offline_id} that already exists`
2170
+ );
2171
+ }
2172
+ }
2105
2173
  for (const comment of action.payload) {
2106
2174
  state.comments[comment.offline_id] = comment;
2107
2175
  }
2108
2176
  },
2177
+ setIssueComment: (state, action) => {
2178
+ state.comments[action.payload.offline_id] = action.payload;
2179
+ },
2180
+ setIssueComments: (state, action) => {
2181
+ const newComments = {};
2182
+ for (const comment of action.payload) {
2183
+ newComments[comment.offline_id] = comment;
2184
+ }
2185
+ state.comments = newComments;
2186
+ },
2109
2187
  addOrReplaceIssueComment: (state, action) => {
2110
2188
  state.comments[action.payload.offline_id] = action.payload;
2111
2189
  },
2112
2190
  removeIssueComment: (state, action) => {
2113
- if (action.payload in state.comments) {
2114
- delete state.comments[action.payload];
2115
- } else {
2191
+ if (!(action.payload in state.comments)) {
2116
2192
  throw new Error(`Failed to remove issue comment because ID doesn't exist: ${action.payload}`);
2117
2193
  }
2194
+ delete state.comments[action.payload];
2195
+ },
2196
+ removeIssueComments: (state, action) => {
2197
+ for (const commentId of action.payload) {
2198
+ if (!(commentId in state.comments)) {
2199
+ throw new Error(`Failed to remove issue comment because ID doesn't exist: ${commentId}`);
2200
+ }
2201
+ }
2202
+ for (const commentId of action.payload) {
2203
+ delete state.comments[commentId];
2204
+ }
2118
2205
  },
2119
2206
  cleanRecentIssues: (state) => {
2120
2207
  state.recentIssueIds = state.recentIssueIds.filter((recentIssue) => state.issues[recentIssue.offlineId]);
@@ -2145,23 +2232,33 @@ var __publicField = (obj, key, value) => {
2145
2232
  addIssueAttachment,
2146
2233
  addIssueAttachments,
2147
2234
  addIssue,
2235
+ addIssueUpdate,
2236
+ addIssueUpdates,
2148
2237
  addOrReplaceIssueComment,
2149
2238
  addToRecentIssues,
2150
2239
  cleanRecentIssues,
2151
2240
  removeIssueAttachment,
2152
2241
  removeAttachmentsOfIssue,
2153
2242
  removeIssue,
2154
- removeIssueComment,
2243
+ removeIssueUpdate,
2244
+ removeIssueUpdates,
2155
2245
  removeRecentIssue,
2156
2246
  resetRecentIssues,
2157
2247
  setActiveIssueId,
2158
2248
  setIssueAttachments,
2159
- setIssueComments,
2249
+ setIssueUpdates,
2160
2250
  setIssues,
2161
2251
  setVisibleStatuses,
2162
2252
  setVisibleUserIds,
2163
2253
  updateIssueAttachment,
2164
- updateIssue
2254
+ updateIssue,
2255
+ // Commments
2256
+ addIssueComment,
2257
+ addIssueComments,
2258
+ setIssueComment,
2259
+ setIssueComments,
2260
+ removeIssueComment,
2261
+ removeIssueComments
2165
2262
  } = issueSlice.actions;
2166
2263
  const selectIssueMapping = (state) => state.issueReducer.issues;
2167
2264
  const selectRecentIssueIds = (state) => state.issueReducer.recentIssueIds;
@@ -2232,6 +2329,12 @@ var __publicField = (obj, key, value) => {
2232
2329
  return Object.values(commentMapping).filter((comment) => comment.issue === issueId);
2233
2330
  })
2234
2331
  );
2332
+ const selectIssueUpdateMapping = (state) => state.issueReducer.updates;
2333
+ const selectIssueUpdatesOfIssue = restructureCreateSelectorWithArgs(
2334
+ toolkit.createSelector([selectIssueUpdateMapping, (_state, issueId) => issueId], (updates, issueId) => {
2335
+ return Object.values(updates).filter((update) => update.issue === issueId);
2336
+ })
2337
+ );
2235
2338
  const selectAttachmentsOfIssue = restructureCreateSelectorWithArgs(
2236
2339
  toolkit.createSelector(
2237
2340
  [selectIssueAttachments, (_state, issueId) => issueId],
@@ -2368,15 +2471,15 @@ var __publicField = (obj, key, value) => {
2368
2471
  }
2369
2472
  );
2370
2473
  const issueReducer = issueSlice.reducer;
2371
- const initialState$f = {
2474
+ const initialState$g = {
2372
2475
  s3Urls: {}
2373
2476
  };
2374
2477
  const msPerHour = 1e3 * 60 * 60;
2375
2478
  const msPerWeek = msPerHour * 24 * 7;
2376
2479
  const fileSlice = toolkit.createSlice({
2377
2480
  name: "file",
2378
- initialState: initialState$f,
2379
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$f)),
2481
+ initialState: initialState$g,
2482
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$g)),
2380
2483
  reducers: {
2381
2484
  setUploadUrl: (state, action) => {
2382
2485
  const { url, fields, sha1 } = action.payload;
@@ -2403,7 +2506,7 @@ var __publicField = (obj, key, value) => {
2403
2506
  return url;
2404
2507
  };
2405
2508
  const fileReducer = fileSlice.reducer;
2406
- const initialState$e = {
2509
+ const initialState$f = {
2407
2510
  // TODO: Change first MapStyle.SATELLITE to MaptStyle.None when project creation map is fixed
2408
2511
  mapStyle: MapStyle.SATELLITE,
2409
2512
  showTooltips: false,
@@ -2411,8 +2514,8 @@ var __publicField = (obj, key, value) => {
2411
2514
  };
2412
2515
  const mapSlice = toolkit.createSlice({
2413
2516
  name: "map",
2414
- initialState: initialState$e,
2415
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$e)),
2517
+ initialState: initialState$f,
2518
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$f)),
2416
2519
  reducers: {
2417
2520
  setMapStyle: (state, action) => {
2418
2521
  state.mapStyle = action.payload;
@@ -2440,6 +2543,16 @@ var __publicField = (obj, key, value) => {
2440
2543
  OrganizationAccessLevel2[OrganizationAccessLevel2["ADMIN"] = 2] = "ADMIN";
2441
2544
  return OrganizationAccessLevel2;
2442
2545
  })(OrganizationAccessLevel || {});
2546
+ var IssueUpdateChange = /* @__PURE__ */ ((IssueUpdateChange2) => {
2547
+ IssueUpdateChange2["STATUS"] = "status";
2548
+ IssueUpdateChange2["PRIORITY"] = "priority";
2549
+ IssueUpdateChange2["CATEGORY"] = "category";
2550
+ IssueUpdateChange2["DESCRIPTION"] = "description";
2551
+ IssueUpdateChange2["TITLE"] = "title";
2552
+ IssueUpdateChange2["ASSIGNED_TO"] = "assigned_to";
2553
+ IssueUpdateChange2["DUE_DATE"] = "due_date";
2554
+ return IssueUpdateChange2;
2555
+ })(IssueUpdateChange || {});
2443
2556
  var ProjectType = /* @__PURE__ */ ((ProjectType2) => {
2444
2557
  ProjectType2[ProjectType2["PERSONAL"] = 0] = "PERSONAL";
2445
2558
  ProjectType2[ProjectType2["ORGANIZATION"] = 2] = "ORGANIZATION";
@@ -2471,7 +2584,7 @@ var __publicField = (obj, key, value) => {
2471
2584
  LicenseStatus2[LicenseStatus2["PAST_DUE"] = 8] = "PAST_DUE";
2472
2585
  return LicenseStatus2;
2473
2586
  })(LicenseStatus || {});
2474
- const initialState$d = {
2587
+ const initialState$e = {
2475
2588
  users: {},
2476
2589
  currentUser: {
2477
2590
  id: 0,
@@ -2482,8 +2595,8 @@ var __publicField = (obj, key, value) => {
2482
2595
  };
2483
2596
  const userSlice = toolkit.createSlice({
2484
2597
  name: "users",
2485
- initialState: initialState$d,
2486
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$d)),
2598
+ initialState: initialState$e,
2599
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$e)),
2487
2600
  reducers: {
2488
2601
  setUsers: (state, action) => {
2489
2602
  const usersMapping = {};
@@ -2545,13 +2658,13 @@ var __publicField = (obj, key, value) => {
2545
2658
  const selectUsersAsMapping = (state) => state.userReducer.users;
2546
2659
  const selectFavouriteProjects = (state) => state.userReducer.currentUser.profile.favourite_project_ids;
2547
2660
  const userReducer = userSlice.reducer;
2548
- const initialState$c = {
2661
+ const initialState$d = {
2549
2662
  organizationAccesses: {}
2550
2663
  };
2551
2664
  const organizationAccessSlice = toolkit.createSlice({
2552
2665
  name: "organizationAccess",
2553
- initialState: initialState$c,
2554
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$c)),
2666
+ initialState: initialState$d,
2667
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$d)),
2555
2668
  reducers: {
2556
2669
  setOrganizationAccesses: (state, action) => {
2557
2670
  if (!Array.isArray(action.payload))
@@ -2614,13 +2727,13 @@ var __publicField = (obj, key, value) => {
2614
2727
  return organizationAccesses;
2615
2728
  };
2616
2729
  const organizationAccessReducer = organizationAccessSlice.reducer;
2617
- const initialState$b = {
2730
+ const initialState$c = {
2618
2731
  licenses: {}
2619
2732
  };
2620
2733
  const licenseSlice = toolkit.createSlice({
2621
2734
  name: "license",
2622
- initialState: initialState$b,
2623
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$b)),
2735
+ initialState: initialState$c,
2736
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$c)),
2624
2737
  reducers: {
2625
2738
  setLicenses: (state, action) => {
2626
2739
  if (!Array.isArray(action.payload))
@@ -2665,13 +2778,13 @@ var __publicField = (obj, key, value) => {
2665
2778
  (licenses) => Object.values(licenses).filter((license) => license.project).reduce((accum, license) => ({ ...accum, [license.project]: license }), {})
2666
2779
  );
2667
2780
  const licenseReducer = licenseSlice.reducer;
2668
- const initialState$a = {
2781
+ const initialState$b = {
2669
2782
  projectAccesses: {}
2670
2783
  };
2671
2784
  const projectAccessSlice = toolkit.createSlice({
2672
2785
  name: "projectAccess",
2673
- initialState: initialState$a,
2674
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$a)),
2786
+ initialState: initialState$b,
2787
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$b)),
2675
2788
  reducers: {
2676
2789
  setProjectAccesses: (state, action) => {
2677
2790
  if (!Array.isArray(action.payload))
@@ -2739,7 +2852,7 @@ var __publicField = (obj, key, value) => {
2739
2852
  return projectAccesses;
2740
2853
  };
2741
2854
  const projectAccessReducer = projectAccessSlice.reducer;
2742
- const initialState$9 = {
2855
+ const initialState$a = {
2743
2856
  projects: {},
2744
2857
  activeProjectId: null,
2745
2858
  recentProjectIds: [],
@@ -2749,7 +2862,7 @@ var __publicField = (obj, key, value) => {
2749
2862
  };
2750
2863
  const projectSlice = toolkit.createSlice({
2751
2864
  name: "projects",
2752
- initialState: initialState$9,
2865
+ initialState: initialState$a,
2753
2866
  reducers: {
2754
2867
  setProjects: (state, action) => {
2755
2868
  const projectsMap = {};
@@ -2936,14 +3049,14 @@ var __publicField = (obj, key, value) => {
2936
3049
  }
2937
3050
  )
2938
3051
  );
2939
- const initialState$8 = {
3052
+ const initialState$9 = {
2940
3053
  organizations: {},
2941
3054
  activeOrganizationId: null
2942
3055
  };
2943
3056
  const organizationSlice = toolkit.createSlice({
2944
3057
  name: "organizations",
2945
- initialState: initialState$8,
2946
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$8)),
3058
+ initialState: initialState$9,
3059
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$9)),
2947
3060
  reducers: {
2948
3061
  setOrganizations: (state, action) => {
2949
3062
  for (const org of action.payload) {
@@ -3062,14 +3175,14 @@ var __publicField = (obj, key, value) => {
3062
3175
  }
3063
3176
  };
3064
3177
  };
3065
- const initialState$7 = {
3178
+ const initialState$8 = {
3066
3179
  deletedRequests: [],
3067
3180
  latestRetryTime: 0
3068
3181
  };
3069
3182
  const outboxSlice = toolkit.createSlice({
3070
3183
  name: "outbox",
3071
- initialState: initialState$7,
3072
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$7)),
3184
+ initialState: initialState$8,
3185
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$8)),
3073
3186
  reducers: {
3074
3187
  // enqueueActions is a reducer that does nothing but enqueue API request to the Redux Offline outbox
3075
3188
  // Whenever an issue is being created, a reducer addIssue() is responsible for adding it to the offline store
@@ -3101,7 +3214,7 @@ var __publicField = (obj, key, value) => {
3101
3214
  const selectLatestRetryTime = (state) => state.outboxReducer.latestRetryTime;
3102
3215
  const { enqueueRequest, markForDeletion, markAsDeleted, _setLatestRetryTime } = outboxSlice.actions;
3103
3216
  const outboxReducer = outboxSlice.reducer;
3104
- const initialState$6 = {
3217
+ const initialState$7 = {
3105
3218
  projectFiles: {},
3106
3219
  activeProjectFileId: null,
3107
3220
  isImportingProjectFile: false,
@@ -3109,8 +3222,8 @@ var __publicField = (obj, key, value) => {
3109
3222
  };
3110
3223
  const projectFileSlice = toolkit.createSlice({
3111
3224
  name: "projectFiles",
3112
- initialState: initialState$6,
3113
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$6)),
3225
+ initialState: initialState$7,
3226
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$7)),
3114
3227
  reducers: {
3115
3228
  addOrReplaceProjectFiles: (state, action) => {
3116
3229
  for (let fileObj of action.payload) {
@@ -3211,12 +3324,12 @@ var __publicField = (obj, key, value) => {
3211
3324
  const selectActiveProjectFileId = (state) => state.projectFileReducer.activeProjectFileId;
3212
3325
  const selectIsImportingProjectFile = (state) => state.projectFileReducer.isImportingProjectFile;
3213
3326
  const projectFileReducer = projectFileSlice.reducer;
3214
- const initialState$5 = {
3327
+ const initialState$6 = {
3215
3328
  isRehydrated: false
3216
3329
  };
3217
3330
  const rehydratedSlice = toolkit.createSlice({
3218
3331
  name: "rehydrated",
3219
- initialState: initialState$5,
3332
+ initialState: initialState$6,
3220
3333
  // The `reducers` field lets us define reducers and generate associated actions
3221
3334
  reducers: {
3222
3335
  setRehydrated: (state, action) => {
@@ -3226,7 +3339,7 @@ var __publicField = (obj, key, value) => {
3226
3339
  });
3227
3340
  const selectRehydrated = (state) => state.rehydratedReducer.isRehydrated;
3228
3341
  const rehydratedReducer = rehydratedSlice.reducer;
3229
- const initialState$4 = {
3342
+ const initialState$5 = {
3230
3343
  useIssueTemplate: false,
3231
3344
  placementMode: false,
3232
3345
  enableClustering: false,
@@ -3243,8 +3356,8 @@ var __publicField = (obj, key, value) => {
3243
3356
  };
3244
3357
  const settingSlice = toolkit.createSlice({
3245
3358
  name: "settings",
3246
- initialState: initialState$4,
3247
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$4)),
3359
+ initialState: initialState$5,
3360
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$5)),
3248
3361
  reducers: {
3249
3362
  setEnableDuplicateIssues: (state, action) => {
3250
3363
  state.useIssueTemplate = action.payload;
@@ -3317,7 +3430,7 @@ var __publicField = (obj, key, value) => {
3317
3430
  function getLatestRevisionFromCache(formId2) {
3318
3431
  return LATEST_REVISION_CACHE[formId2];
3319
3432
  }
3320
- const initialState$3 = {
3433
+ const initialState$4 = {
3321
3434
  userForms: {},
3322
3435
  revisions: {},
3323
3436
  submissions: {},
@@ -3326,8 +3439,8 @@ var __publicField = (obj, key, value) => {
3326
3439
  };
3327
3440
  const userFormSlice = toolkit.createSlice({
3328
3441
  name: "userForms",
3329
- initialState: initialState$3,
3330
- extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$3)),
3442
+ initialState: initialState$4,
3443
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$4)),
3331
3444
  reducers: {
3332
3445
  setUserForms: (state, action) => {
3333
3446
  state.userForms = {};
@@ -3542,6 +3655,9 @@ var __publicField = (obj, key, value) => {
3542
3655
  return state.userFormReducer.userForms[formId2];
3543
3656
  };
3544
3657
  const selectSubmissionMapping = (state) => state.userFormReducer.submissions;
3658
+ const selectUserFormSubmission = (submissionId) => (state) => {
3659
+ return state.userFormReducer.submissions[submissionId];
3660
+ };
3545
3661
  const selectSubmissions = toolkit.createSelector([selectSubmissionMapping], (submissions) => Object.values(submissions));
3546
3662
  const selectRevisionMapping = (state) => state.userFormReducer.revisions;
3547
3663
  const selectRevisions = toolkit.createSelector([selectRevisionMapping], (revisions) => Object.values(revisions));
@@ -3583,6 +3699,23 @@ var __publicField = (obj, key, value) => {
3583
3699
  }
3584
3700
  )
3585
3701
  );
3702
+ const selectComponentSubmissionMapping = toolkit.createSelector(
3703
+ [selectSubmissionMapping, selectComponentsMapping],
3704
+ (submissions, components) => {
3705
+ var _a2;
3706
+ const componentSubmissionMapping = {};
3707
+ for (const componentId in components) {
3708
+ componentSubmissionMapping[componentId] = [];
3709
+ }
3710
+ for (const submissionId in submissions) {
3711
+ const submission = submissions[submissionId];
3712
+ if (submission.component) {
3713
+ (_a2 = componentSubmissionMapping[submission.component]) == null ? void 0 : _a2.push(submission);
3714
+ }
3715
+ }
3716
+ return componentSubmissionMapping;
3717
+ }
3718
+ );
3586
3719
  const selectUserFormMapping = (state) => {
3587
3720
  return state.userFormReducer.userForms;
3588
3721
  };
@@ -3631,12 +3764,12 @@ var __publicField = (obj, key, value) => {
3631
3764
  return Object.values(userForms).filter((form) => !form.component_type).length;
3632
3765
  });
3633
3766
  const userFormReducer = userFormSlice.reducer;
3634
- const initialState$2 = {
3767
+ const initialState$3 = {
3635
3768
  emailDomains: {}
3636
3769
  };
3637
3770
  const emailDomainsSlice = toolkit.createSlice({
3638
3771
  name: "emailDomains",
3639
- initialState: initialState$2,
3772
+ initialState: initialState$3,
3640
3773
  reducers: {
3641
3774
  setEmailDomains: (state, action) => {
3642
3775
  const emailDomains = {};
@@ -3663,14 +3796,14 @@ var __publicField = (obj, key, value) => {
3663
3796
  (ed1, ed2) => ed1.domain.localeCompare(ed2.domain)
3664
3797
  );
3665
3798
  const emailDomainsReducer = emailDomainsSlice.reducer;
3666
- const initialState$1 = {
3799
+ const initialState$2 = {
3667
3800
  documents: {}
3668
3801
  };
3669
3802
  const documentSlice = toolkit.createSlice({
3670
3803
  name: "documents",
3671
- initialState: initialState$1,
3804
+ initialState: initialState$2,
3672
3805
  extraReducers: (builder) => builder.addCase("RESET", (state) => {
3673
- Object.assign(state, initialState$1);
3806
+ Object.assign(state, initialState$2);
3674
3807
  }),
3675
3808
  reducers: {
3676
3809
  setDocuments: (state, action) => {
@@ -3835,6 +3968,59 @@ var __publicField = (obj, key, value) => {
3835
3968
  (documents) => documents.filter((document2) => !document2.parent_document)
3836
3969
  );
3837
3970
  const documentsReducer = documentSlice.reducer;
3971
+ const initialState$1 = {
3972
+ teams: {}
3973
+ };
3974
+ const teamSlice = toolkit.createSlice({
3975
+ name: "teams",
3976
+ initialState: initialState$1,
3977
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$1)),
3978
+ reducers: {
3979
+ setTeam: (state, action) => {
3980
+ state.teams[action.payload.offline_id] = action.payload;
3981
+ },
3982
+ setTeams: (state, action) => {
3983
+ state.teams = {};
3984
+ for (const team of action.payload) {
3985
+ state.teams[team.offline_id] = team;
3986
+ }
3987
+ },
3988
+ addTeam: (state, action) => {
3989
+ if (state.teams[action.payload.offline_id]) {
3990
+ throw new Error(`Team with offline_id ${action.payload.offline_id} already exists`);
3991
+ }
3992
+ state.teams[action.payload.offline_id] = action.payload;
3993
+ },
3994
+ updateTeam: (state, action) => {
3995
+ if (!state.teams[action.payload.offline_id]) {
3996
+ throw new Error(`Team with offline_id ${action.payload.offline_id} does not exist`);
3997
+ }
3998
+ state.teams[action.payload.offline_id] = action.payload;
3999
+ },
4000
+ deleteTeam: (state, action) => {
4001
+ delete state.teams[action.payload];
4002
+ }
4003
+ }
4004
+ });
4005
+ const { setTeam, setTeams, addTeam, updateTeam, deleteTeam } = teamSlice.actions;
4006
+ const selectTeamsMapping = (state) => state.teamReducer.teams;
4007
+ const selectTeams = toolkit.createSelector([selectTeamsMapping], (teams) => {
4008
+ return Object.values(teams);
4009
+ });
4010
+ const selectTeamsOfOrganization = restructureCreateSelectorWithArgs(
4011
+ toolkit.createSelector(
4012
+ [selectTeams, (_state, organizationId) => organizationId],
4013
+ (teams, organizationId) => {
4014
+ return teams.filter((team) => team.organization === organizationId);
4015
+ }
4016
+ )
4017
+ );
4018
+ const selectTeamsOfUser = restructureCreateSelectorWithArgs(
4019
+ toolkit.createSelector([selectTeams, (_state, userId) => userId], (teams, userId) => {
4020
+ return teams.filter((team) => team.members.includes(userId));
4021
+ })
4022
+ );
4023
+ const teamReducer = teamSlice.reducer;
3838
4024
  const initialState = {
3839
4025
  version: 0
3840
4026
  };
@@ -3881,7 +4067,8 @@ var __publicField = (obj, key, value) => {
3881
4067
  workspaceReducer,
3882
4068
  emailDomainsReducer,
3883
4069
  licenseReducer,
3884
- documentsReducer
4070
+ documentsReducer,
4071
+ teamReducer
3885
4072
  };
3886
4073
  const overmapReducer = toolkit.combineReducers(overmapReducers);
3887
4074
  const resetStore = "RESET";
@@ -4428,7 +4615,7 @@ var __publicField = (obj, key, value) => {
4428
4615
  }
4429
4616
  // Attachments aren't models, so we use the OptimisticGenericResult type instead
4430
4617
  async addIssueAttachment(attachmentPayload) {
4431
- const { description: description2, issue, file_sha1, offline_id } = attachmentPayload;
4618
+ const { issue, file_sha1, offline_id } = attachmentPayload;
4432
4619
  if (!attachmentPayload.file.objectURL) {
4433
4620
  throw new Error("Expected attachmentPayload.file.objectURL to be defined.");
4434
4621
  }
@@ -4436,7 +4623,9 @@ var __publicField = (obj, key, value) => {
4436
4623
  ...attachmentPayload,
4437
4624
  file: attachmentPayload.file.objectURL,
4438
4625
  file_name: attachmentPayload.file.name,
4439
- file_type: attachmentPayload.file.type
4626
+ file_type: attachmentPayload.file.type,
4627
+ submitted_at: (/* @__PURE__ */ new Date()).toISOString(),
4628
+ created_by: this.client.store.getState().userReducer.currentUser.id
4440
4629
  };
4441
4630
  await this.client.files.addCache(attachmentPayload.file, file_sha1);
4442
4631
  this.client.store.dispatch(addIssueAttachment(offlineAttachment));
@@ -4448,10 +4637,7 @@ var __publicField = (obj, key, value) => {
4448
4637
  blocks: [offline_id, issue],
4449
4638
  blockers: [file_sha1],
4450
4639
  payload: {
4451
- offline_id,
4452
- issue,
4453
- description: description2 ?? "",
4454
- submitted_at: (/* @__PURE__ */ new Date()).getTime() / 1e3,
4640
+ ...offlineAttachment,
4455
4641
  ...fileProps
4456
4642
  }
4457
4643
  });
@@ -4462,7 +4648,7 @@ var __publicField = (obj, key, value) => {
4462
4648
  return [offlineAttachment, promise];
4463
4649
  }
4464
4650
  async addComponentAttachment(attachmentPayload) {
4465
- const { description: description2, component, file_sha1, offline_id } = attachmentPayload;
4651
+ const { component, file_sha1, offline_id } = attachmentPayload;
4466
4652
  if (!attachmentPayload.file.objectURL) {
4467
4653
  throw new Error("Expected attachmentPayload.file.objectURL to be defined.");
4468
4654
  }
@@ -4470,7 +4656,9 @@ var __publicField = (obj, key, value) => {
4470
4656
  ...attachmentPayload,
4471
4657
  file: attachmentPayload.file.objectURL,
4472
4658
  file_name: attachmentPayload.file.name,
4473
- file_type: attachmentPayload.file.type
4659
+ file_type: attachmentPayload.file.type,
4660
+ submitted_at: (/* @__PURE__ */ new Date()).toISOString(),
4661
+ created_by: this.client.store.getState().userReducer.currentUser.id
4474
4662
  };
4475
4663
  await this.client.files.addCache(attachmentPayload.file, file_sha1);
4476
4664
  this.client.store.dispatch(addComponentAttachment(offlineAttachment));
@@ -4482,10 +4670,7 @@ var __publicField = (obj, key, value) => {
4482
4670
  blocks: [offline_id, component],
4483
4671
  blockers: [file_sha1],
4484
4672
  payload: {
4485
- offline_id,
4486
- component,
4487
- description: description2 ?? "",
4488
- submitted_at: (/* @__PURE__ */ new Date()).getTime() / 1e3,
4673
+ ...offlineAttachment,
4489
4674
  ...fileProps
4490
4675
  }
4491
4676
  });
@@ -4496,7 +4681,7 @@ var __publicField = (obj, key, value) => {
4496
4681
  return [offlineAttachment, promise];
4497
4682
  }
4498
4683
  async addComponentTypeAttachment(attachmentPayload) {
4499
- const { description: description2, component_type, file_sha1, offline_id } = attachmentPayload;
4684
+ const { component_type, file_sha1, offline_id } = attachmentPayload;
4500
4685
  if (!attachmentPayload.file.objectURL) {
4501
4686
  throw new Error("Expected attachmentPayload.file.objectURL to be defined.");
4502
4687
  }
@@ -4504,7 +4689,9 @@ var __publicField = (obj, key, value) => {
4504
4689
  ...attachmentPayload,
4505
4690
  file: attachmentPayload.file.objectURL,
4506
4691
  file_name: attachmentPayload.file.name,
4507
- file_type: attachmentPayload.file.type
4692
+ file_type: attachmentPayload.file.type,
4693
+ submitted_at: (/* @__PURE__ */ new Date()).toISOString(),
4694
+ created_by: this.client.store.getState().userReducer.currentUser.id
4508
4695
  };
4509
4696
  await this.client.files.addCache(attachmentPayload.file, file_sha1);
4510
4697
  this.client.store.dispatch(addComponentTypeAttachment(offlineAttachment));
@@ -4516,10 +4703,7 @@ var __publicField = (obj, key, value) => {
4516
4703
  blocks: [offline_id, component_type],
4517
4704
  blockers: [file_sha1],
4518
4705
  payload: {
4519
- offline_id,
4520
- component_type,
4521
- description: description2 ?? "",
4522
- submitted_at: (/* @__PURE__ */ new Date()).getTime() / 1e3,
4706
+ ...offlineAttachment,
4523
4707
  ...fileProps
4524
4708
  }
4525
4709
  });
@@ -4538,7 +4722,9 @@ var __publicField = (obj, key, value) => {
4538
4722
  ...attachmentPayload,
4539
4723
  file: attachmentPayload.file.objectURL,
4540
4724
  file_name: attachmentPayload.file.name,
4541
- file_type: attachmentPayload.file.type
4725
+ file_type: attachmentPayload.file.type,
4726
+ submitted_at: (/* @__PURE__ */ new Date()).toISOString(),
4727
+ created_by: this.client.store.getState().userReducer.currentUser.id
4542
4728
  };
4543
4729
  await this.client.files.addCache(attachmentPayload.file, file_sha1);
4544
4730
  this.client.store.dispatch(addProjectAttachment(offlineAttachment));
@@ -4578,7 +4764,9 @@ var __publicField = (obj, key, value) => {
4578
4764
  file_name: file2.name,
4579
4765
  file_type: file2.type,
4580
4766
  issue: issueId,
4581
- file_sha1: hash
4767
+ file_sha1: hash,
4768
+ submitted_at: (/* @__PURE__ */ new Date()).toISOString(),
4769
+ created_by: this.client.store.getState().userReducer.currentUser.id
4582
4770
  });
4583
4771
  return this.addIssueAttachment(attachment);
4584
4772
  };
@@ -4597,7 +4785,9 @@ var __publicField = (obj, key, value) => {
4597
4785
  file_name: file2.name,
4598
4786
  file_type: file2.type,
4599
4787
  component: componentId,
4600
- file_sha1: hash
4788
+ file_sha1: hash,
4789
+ submitted_at: (/* @__PURE__ */ new Date()).toISOString(),
4790
+ created_by: this.client.store.getState().userReducer.currentUser.id
4601
4791
  });
4602
4792
  return this.addComponentAttachment(attachment);
4603
4793
  };
@@ -4616,7 +4806,9 @@ var __publicField = (obj, key, value) => {
4616
4806
  file_name: file2.name,
4617
4807
  file_type: file2.type,
4618
4808
  component_type: componentTypeId,
4619
- file_sha1: hash
4809
+ file_sha1: hash,
4810
+ submitted_at: (/* @__PURE__ */ new Date()).toISOString(),
4811
+ created_by: this.client.store.getState().userReducer.currentUser.id
4620
4812
  });
4621
4813
  return this.addComponentTypeAttachment(attachment);
4622
4814
  };
@@ -4635,7 +4827,9 @@ var __publicField = (obj, key, value) => {
4635
4827
  file_name: file2.name,
4636
4828
  file_type: file2.type,
4637
4829
  project: projectId,
4638
- file_sha1: hash
4830
+ file_sha1: hash,
4831
+ submitted_at: (/* @__PURE__ */ new Date()).toISOString(),
4832
+ created_by: this.client.store.getState().userReducer.currentUser.id
4639
4833
  });
4640
4834
  return this.addProjectAttachment(attachment);
4641
4835
  };
@@ -5712,49 +5906,35 @@ var __publicField = (obj, key, value) => {
5712
5906
  }
5713
5907
  }
5714
5908
  class IssueCommentService extends BaseApiService {
5909
+ // Omit author and submitted_at since these will always be set internally
5715
5910
  add(comment) {
5716
- const offlinePayload = offline(comment);
5717
- const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
5718
5911
  const { store } = this.client;
5719
- const offlineComment = {
5720
- ...offlinePayload,
5912
+ const offlineComment = offline({
5913
+ ...comment,
5721
5914
  author: store.getState().userReducer.currentUser.id,
5722
- created_at: submittedAt
5723
- };
5724
- store.dispatch(addOrReplaceIssueComment(offlineComment));
5915
+ submitted_at: (/* @__PURE__ */ new Date()).toISOString()
5916
+ });
5917
+ store.dispatch(addIssueComment(offlineComment));
5725
5918
  const promise = this.enqueueRequest({
5726
5919
  description: `${truncate(comment.content, 80)}`,
5727
5920
  method: HttpMethod.POST,
5728
5921
  url: `/issues/${comment.issue}/comment/`,
5729
- payload: { ...offlinePayload, submitted_at: submittedAt },
5922
+ payload: offlineComment,
5730
5923
  blockers: [comment.issue],
5731
- blocks: [offlinePayload.offline_id]
5924
+ blocks: [offlineComment.offline_id]
5925
+ });
5926
+ promise.catch(() => {
5927
+ store.dispatch(removeIssueComment(offlineComment.offline_id));
5732
5928
  });
5733
5929
  return [offlineComment, promise];
5734
5930
  }
5735
- async refreshStore() {
5931
+ update(comment) {
5736
5932
  const { store } = this.client;
5737
- const result = await this.enqueueRequest({
5738
- description: "Get comments",
5739
- method: HttpMethod.GET,
5740
- // TODO: Choose between /issues/comments/in-project/${projectId}/ and /projects/${projectId}/issue-comments/
5741
- url: `/projects/${store.getState().projectReducer.activeProjectId}/comments/`,
5742
- blockers: [],
5743
- blocks: []
5744
- });
5745
- let filteredResult = result.filter(onlyUniqueOfflineIds);
5746
- filteredResult = filteredResult.map((comment) => {
5747
- return { ...comment };
5748
- });
5749
- if (result.length !== filteredResult.length) {
5750
- console.error(
5751
- `Received duplicate comments from the API (new length ${filteredResult.length}); filtered in browser.`
5752
- );
5933
+ const commentToUpdate = store.getState().issueReducer.comments[comment.offline_id];
5934
+ if (!commentToUpdate) {
5935
+ throw new Error(`Comment with offline_id ${comment.offline_id} not found in store`);
5753
5936
  }
5754
- store.dispatch(setIssueComments(filteredResult));
5755
- }
5756
- update(comment) {
5757
- this.client.store.dispatch(addOrReplaceIssueComment(comment));
5937
+ store.dispatch(setIssueComment(comment));
5758
5938
  const promise = this.enqueueRequest({
5759
5939
  description: `Edit comment: ${truncate(comment.content, 80)}`,
5760
5940
  method: HttpMethod.PATCH,
@@ -5763,17 +5943,62 @@ var __publicField = (obj, key, value) => {
5763
5943
  blockers: [comment.issue],
5764
5944
  blocks: [comment.offline_id]
5765
5945
  });
5946
+ promise.catch(() => {
5947
+ store.dispatch(setIssueComment(commentToUpdate));
5948
+ });
5766
5949
  return [comment, promise];
5767
5950
  }
5768
5951
  remove(offline_id) {
5952
+ const commentToRemove = this.client.store.getState().issueReducer.comments[offline_id];
5953
+ if (!commentToRemove) {
5954
+ throw new Error(`Comment with offline_id ${offline_id} not found in store`);
5955
+ }
5769
5956
  this.client.store.dispatch(removeIssueComment(offline_id));
5770
- return this.enqueueRequest({
5957
+ const promise = this.enqueueRequest({
5771
5958
  description: "Delete comment",
5772
5959
  method: HttpMethod.DELETE,
5773
5960
  url: `/issues/comments/${offline_id}/`,
5774
5961
  blockers: [offline_id],
5775
5962
  blocks: []
5776
5963
  });
5964
+ promise.catch(() => {
5965
+ this.client.store.dispatch(addIssueComment(commentToRemove));
5966
+ });
5967
+ return promise;
5968
+ }
5969
+ async refreshStore() {
5970
+ const { store } = this.client;
5971
+ const result = await this.enqueueRequest({
5972
+ description: "Get comments",
5973
+ method: HttpMethod.GET,
5974
+ // TODO: Choose between /issues/comments/in-project/${projectId}/ and /projects/${projectId}/issue-comments/
5975
+ url: `/projects/${store.getState().projectReducer.activeProjectId}/comments/`,
5976
+ blockers: [],
5977
+ blocks: []
5978
+ });
5979
+ store.dispatch(setIssueComments(result));
5980
+ }
5981
+ }
5982
+ class IssueUpdateService extends BaseApiService {
5983
+ async refreshStore() {
5984
+ const { store } = this.client;
5985
+ const result = await this.enqueueRequest({
5986
+ description: "Get issue updates",
5987
+ method: HttpMethod.GET,
5988
+ url: `/projects/${store.getState().projectReducer.activeProjectId}/issues/updates/`,
5989
+ blockers: [],
5990
+ blocks: []
5991
+ });
5992
+ let filteredResult = result.filter(onlyUniqueOfflineIds);
5993
+ filteredResult = filteredResult.map((comment) => {
5994
+ return { ...comment };
5995
+ });
5996
+ if (result.length !== filteredResult.length) {
5997
+ console.error(
5998
+ `Received duplicate comments from the API (new length ${filteredResult.length}); filtered in browser.`
5999
+ );
6000
+ }
6001
+ store.dispatch(setIssueUpdates(filteredResult));
5777
6002
  }
5778
6003
  }
5779
6004
  class IssueService extends BaseApiService {
@@ -5854,7 +6079,83 @@ var __publicField = (obj, key, value) => {
5854
6079
  return [offlineIssues, promise];
5855
6080
  }
5856
6081
  update(issue) {
6082
+ const state = this.client.store.getState();
6083
+ const issueToBeUpdated = state.issueReducer.issues[issue.offline_id];
6084
+ if (!issueToBeUpdated) {
6085
+ throw new Error(
6086
+ `Attempting to update an issue with offline_id ${issue.offline_id} that doesn't exist in the store`
6087
+ );
6088
+ }
5857
6089
  this.client.store.dispatch(updateIssue(issue));
6090
+ const changes = {};
6091
+ for (const issueUpdateChange of [
6092
+ IssueUpdateChange.TITLE,
6093
+ IssueUpdateChange.DESCRIPTION,
6094
+ IssueUpdateChange.STATUS,
6095
+ IssueUpdateChange.CATEGORY,
6096
+ IssueUpdateChange.PRIORITY,
6097
+ IssueUpdateChange.ASSIGNED_TO,
6098
+ IssueUpdateChange.DUE_DATE
6099
+ ]) {
6100
+ if (issueUpdateChange in issue && issue[issueUpdateChange] !== issueToBeUpdated[issueUpdateChange]) {
6101
+ switch (issueUpdateChange) {
6102
+ case "category": {
6103
+ let categoryOrNull = null;
6104
+ const categoryIdOrNull = issue[issueUpdateChange];
6105
+ if (categoryIdOrNull) {
6106
+ categoryOrNull = state.categoryReducer.categories[categoryIdOrNull] ?? null;
6107
+ if (!categoryOrNull)
6108
+ throw new Error(
6109
+ `Trying to update issue category to ${categoryIdOrNull} which does not exist in store`
6110
+ );
6111
+ }
6112
+ changes[issueUpdateChange] = categoryOrNull ? {
6113
+ name: categoryOrNull.name,
6114
+ color: categoryOrNull.color,
6115
+ offline_id: categoryOrNull.offline_id
6116
+ } : null;
6117
+ break;
6118
+ }
6119
+ case "assigned_to": {
6120
+ let userOrNull = null;
6121
+ const userIdOrNull = issue[issueUpdateChange];
6122
+ if (userIdOrNull) {
6123
+ userOrNull = state.userReducer.users[userIdOrNull] ?? null;
6124
+ if (!userOrNull)
6125
+ throw new Error(
6126
+ `Trying to update issue assigned_to to ${userIdOrNull} which does not exist in store`
6127
+ );
6128
+ }
6129
+ changes[issueUpdateChange] = userOrNull ? {
6130
+ full_name: userOrNull.username,
6131
+ id: userOrNull.id
6132
+ } : null;
6133
+ break;
6134
+ }
6135
+ case "description":
6136
+ changes[issueUpdateChange] = issue[issueUpdateChange] ?? null;
6137
+ break;
6138
+ case "title":
6139
+ changes[issueUpdateChange] = issue[issueUpdateChange] ?? null;
6140
+ break;
6141
+ case "priority":
6142
+ changes[issueUpdateChange] = issue[issueUpdateChange];
6143
+ break;
6144
+ case "status":
6145
+ changes[issueUpdateChange] = issue[issueUpdateChange];
6146
+ break;
6147
+ case "due_date":
6148
+ changes[issueUpdateChange] = issue[issueUpdateChange] ? issue[issueUpdateChange] : null;
6149
+ }
6150
+ }
6151
+ }
6152
+ const offlineIssueUpdate = offline({
6153
+ created_by: state.userReducer.currentUser.id,
6154
+ submitted_at: (/* @__PURE__ */ new Date()).toISOString(),
6155
+ issue: issueToBeUpdated.offline_id,
6156
+ changes
6157
+ });
6158
+ this.client.store.dispatch(addIssueUpdate(offlineIssueUpdate));
5858
6159
  const promise = this.enqueueRequest({
5859
6160
  description: "Edit issue",
5860
6161
  method: HttpMethod.PATCH,
@@ -5863,23 +6164,30 @@ var __publicField = (obj, key, value) => {
5863
6164
  blockers: [issue.offline_id],
5864
6165
  blocks: [issue.offline_id]
5865
6166
  });
6167
+ promise.catch(() => {
6168
+ this.client.store.dispatch(updateIssue(issueToBeUpdated));
6169
+ this.client.store.dispatch(removeIssueUpdate(offlineIssueUpdate.offline_id));
6170
+ });
5866
6171
  const fullIssue = this.client.store.getState().issueReducer.issues[issue.offline_id];
5867
6172
  return [fullIssue, promise];
5868
6173
  }
5869
6174
  async remove(id) {
5870
6175
  const { store } = this.client;
5871
6176
  const state = store.getState();
6177
+ const dispatch = store.dispatch;
5872
6178
  const backup = state.issueReducer.issues[id];
5873
6179
  if (!backup) {
5874
6180
  throw new Error(`No issue with id ${id} found in the store`);
5875
6181
  }
5876
6182
  const attachments = Object.values(state.issueReducer.attachments).filter((a) => a.issue === id);
5877
6183
  const attachmentsOfIssue = selectAttachmentsOfIssue(id)(state);
5878
- this.client.store.dispatch(removeIssue(id));
5879
- store.dispatch(addActiveProjectIssuesCount(-1));
5880
- if (attachmentsOfIssue.length > 0) {
5881
- this.client.store.dispatch(removeAttachmentsOfIssue(id));
5882
- }
6184
+ const updatesOfIssue = selectIssueUpdatesOfIssue(id)(state);
6185
+ dispatch(removeIssue(id));
6186
+ dispatch(addActiveProjectIssuesCount(-1));
6187
+ if (attachmentsOfIssue.length > 0)
6188
+ dispatch(removeAttachmentsOfIssue(id));
6189
+ if (updatesOfIssue.length > 0)
6190
+ dispatch(removeIssueUpdates(updatesOfIssue.map(({ offline_id }) => offline_id)));
5883
6191
  try {
5884
6192
  return await this.enqueueRequest({
5885
6193
  description: "Delete issue",
@@ -5889,9 +6197,10 @@ var __publicField = (obj, key, value) => {
5889
6197
  blocks: []
5890
6198
  });
5891
6199
  } catch (e) {
5892
- this.client.store.dispatch(addIssue(backup));
5893
- this.client.store.dispatch(addIssueAttachments(attachments));
5894
- store.dispatch(addActiveProjectIssuesCount(1));
6200
+ dispatch(addIssue(backup));
6201
+ dispatch(addIssueAttachments(attachments));
6202
+ dispatch(addIssueUpdates(updatesOfIssue));
6203
+ dispatch(addActiveProjectIssuesCount(1));
5895
6204
  throw e;
5896
6205
  }
5897
6206
  }
@@ -6008,6 +6317,7 @@ var __publicField = (obj, key, value) => {
6008
6317
  }
6009
6318
  if (currentOrgId) {
6010
6319
  await this.client.organizations.fetchInitialOrganizationData(currentOrgId, false);
6320
+ void this.client.teams.refreshStore();
6011
6321
  }
6012
6322
  if (!isProjectIdValid) {
6013
6323
  if (validProjects.length !== 0) {
@@ -6073,6 +6383,7 @@ var __publicField = (obj, key, value) => {
6073
6383
  store.dispatch(setProjectAttachments(project_attachments));
6074
6384
  });
6075
6385
  void this.client.documents.refreshStore();
6386
+ void this.client.issueUpdates.refreshStore();
6076
6387
  }
6077
6388
  store.dispatch(setIsFetchingInitialData(false));
6078
6389
  if (overwrite) {
@@ -7526,6 +7837,142 @@ var __publicField = (obj, key, value) => {
7526
7837
  });
7527
7838
  }
7528
7839
  }
7840
+ class TeamService extends BaseApiService {
7841
+ add(teamPayload) {
7842
+ const { store } = this.client;
7843
+ const state = store.getState();
7844
+ const activeOrganizationId = state.organizationReducer.activeOrganizationId;
7845
+ if (!activeOrganizationId) {
7846
+ throw new Error(`Expected active organization to be set, got ${activeOrganizationId}`);
7847
+ }
7848
+ const offlineTeam = offline({
7849
+ ...teamPayload,
7850
+ organization: activeOrganizationId
7851
+ // TODO: uncomment once supported
7852
+ // submitted_at: new Date().toISOString(),
7853
+ // created_by: state.userReducer.currentUser.id,
7854
+ });
7855
+ store.dispatch(addTeam(offlineTeam));
7856
+ const promise = this.enqueueRequest({
7857
+ description: "Create team",
7858
+ method: HttpMethod.POST,
7859
+ url: `/organizations/${activeOrganizationId}/teams/`,
7860
+ payload: offlineTeam,
7861
+ // No blocks since users and organizations are not offline
7862
+ blockers: [],
7863
+ blocks: [offlineTeam.offline_id]
7864
+ });
7865
+ promise.then((createdTeam) => {
7866
+ store.dispatch(setTeam(createdTeam));
7867
+ }).catch(() => {
7868
+ store.dispatch(deleteTeam(offlineTeam.offline_id));
7869
+ });
7870
+ return [offlineTeam, promise];
7871
+ }
7872
+ // TODO: @Audiopolis / Magnus - should we pass a offline_id as one arg and a UpdatedTeamProps as a second arg instead of this set up?
7873
+ update(team) {
7874
+ const { store } = this.client;
7875
+ const teamToBeUpdated = store.getState().teamReducer.teams[team.offline_id];
7876
+ const offlineUpdatedTeam = {
7877
+ ...teamToBeUpdated,
7878
+ ...team
7879
+ };
7880
+ store.dispatch(updateTeam(offlineUpdatedTeam));
7881
+ const promise = this.enqueueRequest({
7882
+ description: "Update team",
7883
+ method: HttpMethod.PATCH,
7884
+ url: `/organizations/teams/${team.offline_id}/`,
7885
+ payload: offlineUpdatedTeam,
7886
+ blockers: [team.offline_id],
7887
+ blocks: [team.offline_id]
7888
+ });
7889
+ promise.then((updatedTeam) => {
7890
+ store.dispatch(setTeam(updatedTeam));
7891
+ }).catch(() => {
7892
+ store.dispatch(setTeam(teamToBeUpdated));
7893
+ });
7894
+ return [offlineUpdatedTeam, promise];
7895
+ }
7896
+ async delete(teamId) {
7897
+ const { store } = this.client;
7898
+ const state = store.getState();
7899
+ const team = state.teamReducer.teams[teamId];
7900
+ if (!team) {
7901
+ throw new Error(`Expected team with id ${teamId} to exist`);
7902
+ }
7903
+ store.dispatch(deleteTeam(teamId));
7904
+ try {
7905
+ return await this.enqueueRequest({
7906
+ description: "Delete team",
7907
+ method: HttpMethod.DELETE,
7908
+ url: `/organizations/teams/${teamId}/`,
7909
+ blockers: [teamId],
7910
+ blocks: [teamId]
7911
+ });
7912
+ } catch (e) {
7913
+ store.dispatch(setTeam(team));
7914
+ throw e;
7915
+ }
7916
+ }
7917
+ async setMembers(teamId, members) {
7918
+ const { store } = this.client;
7919
+ const team = store.getState().teamReducer.teams[teamId];
7920
+ if (!team) {
7921
+ throw new Error(`Expected team with id ${teamId} to exist`);
7922
+ }
7923
+ if (members.length !== new Set(members).size) {
7924
+ throw new Error("Duplicate members found in the list");
7925
+ }
7926
+ store.dispatch(updateTeam({ ...team, members }));
7927
+ const promise = this.enqueueRequest({
7928
+ description: "Set team members",
7929
+ method: HttpMethod.PUT,
7930
+ url: `/organizations/teams/${teamId}/set-members/`,
7931
+ payload: {
7932
+ members
7933
+ },
7934
+ blockers: [teamId],
7935
+ blocks: [teamId]
7936
+ });
7937
+ promise.catch(() => {
7938
+ store.dispatch(setTeam(team));
7939
+ });
7940
+ return promise;
7941
+ }
7942
+ async addMembers(teamId, members) {
7943
+ const { store } = this.client;
7944
+ const team = store.getState().teamReducer.teams[teamId];
7945
+ if (!team) {
7946
+ throw new Error(`Expected team with id ${teamId} to exist`);
7947
+ }
7948
+ const newMembers = [...team.members, ...members];
7949
+ return this.setMembers(teamId, newMembers);
7950
+ }
7951
+ async removeMembers(teamId, members) {
7952
+ const { store } = this.client;
7953
+ const team = store.getState().teamReducer.teams[teamId];
7954
+ if (!team) {
7955
+ throw new Error(`Expected team with id ${teamId} to exist`);
7956
+ }
7957
+ const newMembers = team.members.filter((member) => !members.includes(member));
7958
+ return this.setMembers(teamId, newMembers);
7959
+ }
7960
+ async refreshStore() {
7961
+ const { store } = this.client;
7962
+ const activeOrganizationId = store.getState().organizationReducer.activeOrganizationId;
7963
+ if (!activeOrganizationId) {
7964
+ throw new Error(`Expected active organization to be set, got ${activeOrganizationId}`);
7965
+ }
7966
+ const result = await this.enqueueRequest({
7967
+ description: "Fetch teams",
7968
+ method: HttpMethod.GET,
7969
+ url: `/organizations/${activeOrganizationId}/teams/`,
7970
+ blockers: [],
7971
+ blocks: []
7972
+ });
7973
+ store.dispatch(setTeams(result));
7974
+ }
7975
+ }
7529
7976
  class OvermapSDK {
7530
7977
  constructor(apiUrl, store) {
7531
7978
  __publicField(this, "API_URL");
@@ -7540,6 +7987,7 @@ var __publicField = (obj, key, value) => {
7540
7987
  __publicField(this, "organizationAccess", new OrganizationAccessService(this));
7541
7988
  __publicField(this, "issues", new IssueService(this));
7542
7989
  __publicField(this, "issueComments", new IssueCommentService(this));
7990
+ __publicField(this, "issueUpdates", new IssueUpdateService(this));
7543
7991
  __publicField(this, "workspaces", new WorkspaceService(this));
7544
7992
  __publicField(this, "main", new MainService(this));
7545
7993
  __publicField(this, "components", new ComponentService(this));
@@ -7554,6 +8002,7 @@ var __publicField = (obj, key, value) => {
7554
8002
  __publicField(this, "emailDomains", new EmailDomainsService(this));
7555
8003
  __publicField(this, "licenses", new LicenseService(this));
7556
8004
  __publicField(this, "documents", new DocumentService(this));
8005
+ __publicField(this, "teams", new TeamService(this));
7557
8006
  this.API_URL = apiUrl;
7558
8007
  this.store = store;
7559
8008
  }
@@ -11995,8 +12444,7 @@ var __publicField = (obj, key, value) => {
11995
12444
  description: "List possible options for the user to select from.",
11996
12445
  required: true,
11997
12446
  identifier: `${path}options`,
11998
- minimum_length: 2,
11999
- maximum_length: 20
12447
+ minimum_length: 2
12000
12448
  }),
12001
12449
  showDirectly: true
12002
12450
  }
@@ -13013,52 +13461,54 @@ var __publicField = (obj, key, value) => {
13013
13461
  Footer,
13014
13462
  Loading
13015
13463
  };
13016
- const ImageCard = React.memo((props) => {
13017
- const { file, alt, error: error2, size, rightSlot, className, truncateLength, ...rest } = props;
13018
- const fileCardRef = React.useRef(null);
13019
- const imageInsetRef = React.useRef(null);
13020
- const fileCardSize = blocks.useSize(fileCardRef);
13021
- React.useLayoutEffect(() => {
13022
- if (!imageInsetRef.current || !fileCardSize)
13023
- return;
13024
- imageInsetRef.current.style.height = `${fileCardSize.height * 4}px`;
13025
- }, [fileCardSize]);
13026
- const fileName2 = React.useMemo(() => {
13027
- if (!file)
13028
- return;
13029
- return truncateLength !== void 0 ? truncate(file.name, truncateLength) : file.name;
13030
- }, [file, truncateLength]);
13031
- return /* @__PURE__ */ jsxRuntime.jsxs(
13032
- Flex,
13033
- {
13034
- className: classNames$1(className, styles$4.ImageCard),
13035
- width: "100%",
13036
- direction: "column",
13037
- position: "relative",
13038
- height: "max-content",
13039
- gap: "0",
13040
- ...rest,
13041
- children: [
13042
- !file && !error2 && /* @__PURE__ */ jsxRuntime.jsx(Flex, { width: "100%", height: "100%", align: "center", justify: "center", position: "absolute", children: /* @__PURE__ */ jsxRuntime.jsx(blocks.Spinner, {}) }),
13043
- /* @__PURE__ */ jsxRuntime.jsx(Inset, { className: styles$4.ImageInset, ref: imageInsetRef, clip: "padding-box", side: "y", pb: "0", children: file && !error2 && /* @__PURE__ */ jsxRuntime.jsx("img", { className: styles$4.Image, src: URL.createObjectURL(file), alt: alt ?? file.name }) }),
13044
- /* @__PURE__ */ jsxRuntime.jsx(
13045
- blocks.OvermapItem,
13046
- {
13047
- className: classNames$1(styles$4.Footer, {
13048
- [styles$4.Loading]: !file
13049
- }),
13050
- size,
13051
- ref: fileCardRef,
13052
- leftSlot: error2 ? /* @__PURE__ */ jsxRuntime.jsx(blocks.RiIcon, { icon: "RiFileWarningLine" }) : file && /* @__PURE__ */ jsxRuntime.jsx(FileIcon, { fileType: file.type }),
13053
- rightSlot,
13054
- children: error2 ?? fileName2
13055
- }
13056
- )
13057
- ]
13058
- }
13059
- );
13060
- });
13061
- ImageCard.displayName = "ImageCard";
13464
+ const ImageCard = React.memo(
13465
+ React.forwardRef((props, forwardedRef) => {
13466
+ const { file, alt, error: error2, size, rightSlot, className, truncateLength, ...rest } = props;
13467
+ const fileCardRef = React.useRef(null);
13468
+ const imageInsetRef = React.useRef(null);
13469
+ const fileCardSize = blocks.useSize(fileCardRef);
13470
+ React.useLayoutEffect(() => {
13471
+ if (!imageInsetRef.current || !fileCardSize)
13472
+ return;
13473
+ imageInsetRef.current.style.height = `${fileCardSize.height * 4}px`;
13474
+ }, [fileCardSize]);
13475
+ const fileName2 = React.useMemo(() => {
13476
+ if (!file)
13477
+ return;
13478
+ return truncateLength !== void 0 ? truncate(file.name, truncateLength) : file.name;
13479
+ }, [file, truncateLength]);
13480
+ return /* @__PURE__ */ jsxRuntime.jsxs(
13481
+ Flex,
13482
+ {
13483
+ className: classNames$1(className, styles$4.ImageCard),
13484
+ width: "100%",
13485
+ direction: "column",
13486
+ position: "relative",
13487
+ height: "max-content",
13488
+ gap: "0",
13489
+ ref: forwardedRef,
13490
+ ...rest,
13491
+ children: [
13492
+ !file && !error2 && /* @__PURE__ */ jsxRuntime.jsx(Flex, { width: "100%", height: "100%", align: "center", justify: "center", position: "absolute", children: /* @__PURE__ */ jsxRuntime.jsx(blocks.Spinner, {}) }),
13493
+ /* @__PURE__ */ jsxRuntime.jsx(Inset, { className: styles$4.ImageInset, ref: imageInsetRef, clip: "padding-box", side: "y", pb: "0", children: file && !error2 && /* @__PURE__ */ jsxRuntime.jsx("img", { className: styles$4.Image, src: URL.createObjectURL(file), alt: alt ?? file.name }) }),
13494
+ /* @__PURE__ */ jsxRuntime.jsx(
13495
+ blocks.OvermapItem,
13496
+ {
13497
+ className: classNames$1(styles$4.Footer, {
13498
+ [styles$4.Loading]: !file
13499
+ }),
13500
+ size,
13501
+ ref: fileCardRef,
13502
+ leftSlot: error2 ? /* @__PURE__ */ jsxRuntime.jsx(blocks.RiIcon, { icon: "RiFileWarningLine" }) : file && /* @__PURE__ */ jsxRuntime.jsx(FileIcon, { fileType: file.type }),
13503
+ rightSlot,
13504
+ children: error2 ?? fileName2
13505
+ }
13506
+ )
13507
+ ]
13508
+ }
13509
+ );
13510
+ })
13511
+ );
13062
13512
  const UploadInput = React.memo((props) => {
13063
13513
  var _a2;
13064
13514
  const [{ inputId, labelId, size, severity, helpText, showInputOnly, field, fieldProps }, rest] = useFormikInput(props);
@@ -14195,17 +14645,15 @@ var __publicField = (obj, key, value) => {
14195
14645
  Action.key
14196
14646
  )) }),
14197
14647
  /* @__PURE__ */ jsxRuntime.jsx(Box, { display: forMobile(true, "block"), children: /* @__PURE__ */ jsxRuntime.jsx(
14198
- blocks.DropdownItemMenu,
14648
+ blocks.OvermapDropdownMenu,
14199
14649
  {
14200
14650
  trigger: /* @__PURE__ */ jsxRuntime.jsx(blocks.IconButton, { variant: "ghost", "aria-label": "Actions menu", children: /* @__PURE__ */ jsxRuntime.jsx(blocks.RiIcon, { icon: "RiMore2Line" }) }),
14201
14651
  items: actions.map((Action) => {
14202
14652
  var _a2;
14203
14653
  return {
14204
- content: /* @__PURE__ */ jsxRuntime.jsxs(blocks.Flex, { gap: "2", align: "center", children: [
14205
- /* @__PURE__ */ jsxRuntime.jsx(Action.Icon, {}),
14206
- Action.text
14207
- ] }, Action.key),
14208
- onSelect: (_a2 = Action.buttonProps) == null ? void 0 : _a2.onClick
14654
+ leftSlot: /* @__PURE__ */ jsxRuntime.jsx(Action.Icon, {}),
14655
+ children: Action.text,
14656
+ onClick: (_a2 = Action.buttonProps) == null ? void 0 : _a2.onClick
14209
14657
  };
14210
14658
  })
14211
14659
  }
@@ -14263,10 +14711,8 @@ var __publicField = (obj, key, value) => {
14263
14711
  const field = FieldTypeToClsMapping[identifier];
14264
14712
  const Icon = field.Icon;
14265
14713
  return {
14266
- content: /* @__PURE__ */ jsxRuntime.jsxs(blocks.Flex, { align: "center", gap: "2", children: [
14267
- /* @__PURE__ */ jsxRuntime.jsx(Icon, {}),
14268
- /* @__PURE__ */ jsxRuntime.jsx(blocks.Text, { children: field.fieldTypeName })
14269
- ] }, identifier),
14714
+ children: field.fieldTypeName,
14715
+ leftSlot: /* @__PURE__ */ jsxRuntime.jsx(Icon, {}),
14270
14716
  value: identifier,
14271
14717
  onSelect: () => {
14272
14718
  onSelect(identifier);
@@ -14470,7 +14916,7 @@ var __publicField = (obj, key, value) => {
14470
14916
  }
14471
14917
  ),
14472
14918
  /* @__PURE__ */ jsxRuntime.jsxs(blocks.Flex, { align: "center", gap: "3", children: [
14473
- /* @__PURE__ */ jsxRuntime.jsx(blocks.Badge, { className: styles.typeBadge, children: (_f = fieldTypeItems.flat().find((item) => item.value === type)) == null ? void 0 : _f.content }),
14919
+ /* @__PURE__ */ jsxRuntime.jsx(blocks.Badge, { className: styles.typeBadge, children: (_f = fieldTypeItems.flat().find((item) => item.value === type)) == null ? void 0 : _f.children }),
14474
14920
  showPopoverInputs && /* @__PURE__ */ jsxRuntime.jsx(FieldSettingsPopover, { popoverInputs, hasError: popoverHasErrors })
14475
14921
  ] }),
14476
14922
  resolvedImage && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
@@ -14831,7 +15277,7 @@ var __publicField = (obj, key, value) => {
14831
15277
  )),
14832
15278
  droppableProvided.placeholder,
14833
15279
  /* @__PURE__ */ jsxRuntime.jsx(
14834
- blocks.DropdownItemMenu,
15280
+ blocks.OvermapDropdownMenu,
14835
15281
  {
14836
15282
  trigger: /* @__PURE__ */ jsxRuntime.jsxs(blocks.Button, { type: "button", variant: "soft", children: [
14837
15283
  /* @__PURE__ */ jsxRuntime.jsx(blocks.RiIcon, { icon: "RiAddLine" }),
@@ -15266,6 +15712,8 @@ var __publicField = (obj, key, value) => {
15266
15712
  exports2.IssuePriority = IssuePriority;
15267
15713
  exports2.IssueService = IssueService;
15268
15714
  exports2.IssueStatus = IssueStatus;
15715
+ exports2.IssueUpdateChange = IssueUpdateChange;
15716
+ exports2.IssueUpdateService = IssueUpdateService;
15269
15717
  exports2.LicenseLevel = LicenseLevel;
15270
15718
  exports2.LicenseService = LicenseService;
15271
15719
  exports2.LicenseStatus = LicenseStatus;
@@ -15304,6 +15752,7 @@ var __publicField = (obj, key, value) => {
15304
15752
  exports2.SpreadsheetViewer = SpreadsheetViewer;
15305
15753
  exports2.StringField = StringField;
15306
15754
  exports2.StringInput = StringInput;
15755
+ exports2.TeamService = TeamService;
15307
15756
  exports2.TextField = TextField;
15308
15757
  exports2.TextInput = TextInput;
15309
15758
  exports2.UserFormService = UserFormService;
@@ -15329,6 +15778,10 @@ var __publicField = (obj, key, value) => {
15329
15778
  exports2.addIssue = addIssue;
15330
15779
  exports2.addIssueAttachment = addIssueAttachment;
15331
15780
  exports2.addIssueAttachments = addIssueAttachments;
15781
+ exports2.addIssueComment = addIssueComment;
15782
+ exports2.addIssueComments = addIssueComments;
15783
+ exports2.addIssueUpdate = addIssueUpdate;
15784
+ exports2.addIssueUpdates = addIssueUpdates;
15332
15785
  exports2.addLicenses = addLicenses;
15333
15786
  exports2.addOrReplaceCategories = addOrReplaceCategories;
15334
15787
  exports2.addOrReplaceIssueComment = addOrReplaceIssueComment;
@@ -15341,6 +15794,7 @@ var __publicField = (obj, key, value) => {
15341
15794
  exports2.addStageCompletion = addStageCompletion;
15342
15795
  exports2.addStageCompletions = addStageCompletions;
15343
15796
  exports2.addStages = addStages;
15797
+ exports2.addTeam = addTeam;
15344
15798
  exports2.addToRecentIssues = addToRecentIssues;
15345
15799
  exports2.addUserForm = addUserForm;
15346
15800
  exports2.addUserFormRevision = addUserFormRevision;
@@ -15380,6 +15834,7 @@ var __publicField = (obj, key, value) => {
15380
15834
  exports2.defaultStore = defaultStore;
15381
15835
  exports2.deleteComponentType = deleteComponentType;
15382
15836
  exports2.deleteProject = deleteProject;
15837
+ exports2.deleteTeam = deleteTeam;
15383
15838
  exports2.deleteUserForm = deleteUserForm;
15384
15839
  exports2.deleteUserFormRevision = deleteUserFormRevision;
15385
15840
  exports2.deleteUserFormRevisions = deleteUserFormRevisions;
@@ -15488,6 +15943,9 @@ var __publicField = (obj, key, value) => {
15488
15943
  exports2.removeIssue = removeIssue;
15489
15944
  exports2.removeIssueAttachment = removeIssueAttachment;
15490
15945
  exports2.removeIssueComment = removeIssueComment;
15946
+ exports2.removeIssueComments = removeIssueComments;
15947
+ exports2.removeIssueUpdate = removeIssueUpdate;
15948
+ exports2.removeIssueUpdates = removeIssueUpdates;
15491
15949
  exports2.removeOrganizationAccess = removeOrganizationAccess;
15492
15950
  exports2.removeProjectAccess = removeProjectAccess;
15493
15951
  exports2.removeProjectAccessesOfProject = removeProjectAccessesOfProject;
@@ -15549,11 +16007,13 @@ var __publicField = (obj, key, value) => {
15549
16007
  exports2.selectCompletedStages = selectCompletedStages;
15550
16008
  exports2.selectComponent = selectComponent;
15551
16009
  exports2.selectComponentAttachmentMapping = selectComponentAttachmentMapping;
16010
+ exports2.selectComponentSubmissionMapping = selectComponentSubmissionMapping;
15552
16011
  exports2.selectComponentType = selectComponentType;
15553
16012
  exports2.selectComponentTypeAttachmentMapping = selectComponentTypeAttachmentMapping;
15554
16013
  exports2.selectComponentTypeForm = selectComponentTypeForm;
15555
16014
  exports2.selectComponentTypeFromComponent = selectComponentTypeFromComponent;
15556
16015
  exports2.selectComponentTypeFromComponents = selectComponentTypeFromComponents;
16016
+ exports2.selectComponentTypeStagesMapping = selectComponentTypeStagesMapping;
15557
16017
  exports2.selectComponentTypes = selectComponentTypes;
15558
16018
  exports2.selectComponentTypesByName = selectComponentTypesByName;
15559
16019
  exports2.selectComponentTypesFromIds = selectComponentTypesFromIds;
@@ -15561,6 +16021,7 @@ var __publicField = (obj, key, value) => {
15561
16021
  exports2.selectComponents = selectComponents;
15562
16022
  exports2.selectComponentsByType = selectComponentsByType;
15563
16023
  exports2.selectComponentsFromComponentType = selectComponentsFromComponentType;
16024
+ exports2.selectComponentsMapping = selectComponentsMapping;
15564
16025
  exports2.selectCreateProjectType = selectCreateProjectType;
15565
16026
  exports2.selectCurrentUser = selectCurrentUser;
15566
16027
  exports2.selectDeletedRequests = selectDeletedRequests;
@@ -15589,6 +16050,8 @@ var __publicField = (obj, key, value) => {
15589
16050
  exports2.selectIssueAttachmentMapping = selectIssueAttachmentMapping;
15590
16051
  exports2.selectIssueAttachments = selectIssueAttachments;
15591
16052
  exports2.selectIssueMapping = selectIssueMapping;
16053
+ exports2.selectIssueUpdateMapping = selectIssueUpdateMapping;
16054
+ exports2.selectIssueUpdatesOfIssue = selectIssueUpdatesOfIssue;
15592
16055
  exports2.selectIssues = selectIssues;
15593
16056
  exports2.selectLatestFormRevision = selectLatestFormRevision;
15594
16057
  exports2.selectLatestRetryTime = selectLatestRetryTime;
@@ -15640,6 +16103,7 @@ var __publicField = (obj, key, value) => {
15640
16103
  exports2.selectSortedOrganizationUsers = selectSortedOrganizationUsers;
15641
16104
  exports2.selectSortedProjectUsers = selectSortedProjectUsers;
15642
16105
  exports2.selectSortedProjects = selectSortedProjects;
16106
+ exports2.selectStage = selectStage;
15643
16107
  exports2.selectStageFormIdsFromStageIds = selectStageFormIdsFromStageIds;
15644
16108
  exports2.selectStageMapping = selectStageMapping;
15645
16109
  exports2.selectStages = selectStages;
@@ -15650,11 +16114,16 @@ var __publicField = (obj, key, value) => {
15650
16114
  exports2.selectSubmissionsForComponent = selectSubmissionsForComponent;
15651
16115
  exports2.selectSubmissionsForForm = selectSubmissionsForForm;
15652
16116
  exports2.selectSubmissionsForIssue = selectSubmissionsForIssue;
16117
+ exports2.selectTeams = selectTeams;
16118
+ exports2.selectTeamsMapping = selectTeamsMapping;
16119
+ exports2.selectTeamsOfOrganization = selectTeamsOfOrganization;
16120
+ exports2.selectTeamsOfUser = selectTeamsOfUser;
15653
16121
  exports2.selectUploadUrl = selectUploadUrl;
15654
16122
  exports2.selectUsedColors = selectUsedColors;
15655
16123
  exports2.selectUser = selectUser;
15656
16124
  exports2.selectUserForm = selectUserForm;
15657
16125
  exports2.selectUserFormMapping = selectUserFormMapping;
16126
+ exports2.selectUserFormSubmission = selectUserFormSubmission;
15658
16127
  exports2.selectUsersAsMapping = selectUsersAsMapping;
15659
16128
  exports2.selectVisibleStatuses = selectVisibleStatuses;
15660
16129
  exports2.selectVisibleUserIds = selectVisibleUserIds;
@@ -15684,7 +16153,9 @@ var __publicField = (obj, key, value) => {
15684
16153
  exports2.setIsImportingProjectFile = setIsImportingProjectFile;
15685
16154
  exports2.setIsLoading = setIsLoading;
15686
16155
  exports2.setIssueAttachments = setIssueAttachments;
16156
+ exports2.setIssueComment = setIssueComment;
15687
16157
  exports2.setIssueComments = setIssueComments;
16158
+ exports2.setIssueUpdates = setIssueUpdates;
15688
16159
  exports2.setIssues = setIssues;
15689
16160
  exports2.setLicenses = setLicenses;
15690
16161
  exports2.setLoggedIn = setLoggedIn;
@@ -15699,6 +16170,8 @@ var __publicField = (obj, key, value) => {
15699
16170
  exports2.setSectionExpanded = setSectionExpanded;
15700
16171
  exports2.setShowTooltips = setShowTooltips;
15701
16172
  exports2.setStageCompletions = setStageCompletions;
16173
+ exports2.setTeam = setTeam;
16174
+ exports2.setTeams = setTeams;
15702
16175
  exports2.setTokens = setTokens;
15703
16176
  exports2.setTourStep = setTourStep;
15704
16177
  exports2.setUploadUrl = setUploadUrl;
@@ -15715,6 +16188,8 @@ var __publicField = (obj, key, value) => {
15715
16188
  exports2.slugify = slugify;
15716
16189
  exports2.spacesToDashesLower = spacesToDashesLower;
15717
16190
  exports2.successColor = successColor;
16191
+ exports2.teamReducer = teamReducer;
16192
+ exports2.teamSlice = teamSlice;
15718
16193
  exports2.toFileNameSafeString = toFileNameSafeString;
15719
16194
  exports2.toOfflineIdRecord = toOfflineIdRecord;
15720
16195
  exports2.toggleComponentTypeVisibility = toggleComponentTypeVisibility;
@@ -15737,6 +16212,7 @@ var __publicField = (obj, key, value) => {
15737
16212
  exports2.updateProjectAccess = updateProjectAccess;
15738
16213
  exports2.updateProjectAttachment = updateProjectAttachment;
15739
16214
  exports2.updateStages = updateStages;
16215
+ exports2.updateTeam = updateTeam;
15740
16216
  exports2.useAppDispatch = useAppDispatch;
15741
16217
  exports2.useAppSelector = useAppSelector;
15742
16218
  exports2.useFieldInput = useFieldInput;