@overmap-ai/core 1.0.78-view-sets-cleanup.3 → 1.0.78-workflow-improvements.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.
Files changed (250) hide show
  1. package/dist/constants/defaults.d.ts +1 -2
  2. package/dist/constants/index.d.ts +1 -0
  3. package/dist/constants/workflows.d.ts +4 -0
  4. package/dist/enums/asset.d.ts +8 -0
  5. package/dist/enums/index.d.ts +2 -0
  6. package/dist/enums/issue.d.ts +7 -6
  7. package/dist/enums/workflows.d.ts +18 -0
  8. package/dist/overmap-core.js +11763 -7310
  9. package/dist/overmap-core.umd.cjs +10 -11
  10. package/dist/sdk/base.d.ts +6 -2
  11. package/dist/sdk/constants.d.ts +4 -5
  12. package/dist/sdk/errors.d.ts +5 -0
  13. package/dist/sdk/index.d.ts +5 -1
  14. package/dist/sdk/middleware/OfflineAnalyticsMiddleware.d.ts +6 -0
  15. package/dist/sdk/middleware/OfflineMiddleware.d.ts +13 -0
  16. package/dist/sdk/middleware/RateLimitingMiddleware.d.ts +6 -0
  17. package/dist/sdk/middleware/constants.d.ts +1 -0
  18. package/dist/sdk/middleware/index.d.ts +5 -0
  19. package/dist/sdk/middleware/utils.d.ts +2 -0
  20. package/dist/sdk/outbox/globals.d.ts +2 -0
  21. package/dist/sdk/{classes → outbox}/index.d.ts +1 -0
  22. package/dist/sdk/performRequest.d.ts +6 -0
  23. package/dist/sdk/services/AgentService.d.ts +2 -1
  24. package/dist/sdk/services/AssetAttachmentService.d.ts +24 -35
  25. package/dist/sdk/services/AssetProcedureService.d.ts +23 -6
  26. package/dist/sdk/services/AssetProcedureStepFieldValuesAttachmentService.d.ts +27 -12
  27. package/dist/sdk/services/AssetProcedureStepFieldValuesService.d.ts +22 -12
  28. package/dist/sdk/services/AssetProcedureStepFieldsAttachmentService.d.ts +27 -10
  29. package/dist/sdk/services/AssetProcedureStepFieldsService.d.ts +21 -4
  30. package/dist/sdk/services/AssetProcedureStepService.d.ts +21 -4
  31. package/dist/sdk/services/AssetProcedureTypeAttachmentService.d.ts +30 -0
  32. package/dist/sdk/services/AssetProcedureTypeFieldValuesAttachmentService.d.ts +31 -0
  33. package/dist/sdk/services/AssetProcedureTypeFieldValuesService.d.ts +33 -0
  34. package/dist/sdk/services/AssetProcedureTypeFieldsAttachmentService.d.ts +30 -0
  35. package/dist/sdk/services/AssetProcedureTypeFieldsService.d.ts +26 -0
  36. package/dist/sdk/services/AssetProcedureTypeService.d.ts +28 -0
  37. package/dist/sdk/services/AssetService.d.ts +23 -5
  38. package/dist/sdk/services/AssetStageCompletionService.d.ts +21 -4
  39. package/dist/sdk/services/AssetStageService.d.ts +21 -4
  40. package/dist/sdk/services/AssetTypeAttachmentService.d.ts +24 -34
  41. package/dist/sdk/services/AssetTypeFieldValuesAttachmentService.d.ts +27 -9
  42. package/dist/sdk/services/AssetTypeFieldValuesService.d.ts +22 -10
  43. package/dist/sdk/services/AssetTypeFieldsAttachmentService.d.ts +27 -10
  44. package/dist/sdk/services/AssetTypeFieldsService.d.ts +20 -3
  45. package/dist/sdk/services/AssetTypeIdentifierService.d.ts +28 -0
  46. package/dist/sdk/services/AssetTypeIdentifierValueService.d.ts +28 -0
  47. package/dist/sdk/services/AssetTypeService.d.ts +21 -4
  48. package/dist/sdk/services/AssetTypeStatusService.d.ts +28 -0
  49. package/dist/sdk/services/BaseModelApiService.d.ts +27 -0
  50. package/dist/sdk/services/BaseOfflineFileModelApiService.d.ts +17 -0
  51. package/dist/sdk/services/BaseOfflineModelApiService.d.ts +27 -0
  52. package/dist/sdk/services/BaseService.d.ts +5 -3
  53. package/dist/sdk/services/DocumentAttachmentService.d.ts +26 -34
  54. package/dist/sdk/services/DocumentService.d.ts +22 -5
  55. package/dist/sdk/services/EmailDomainsService.d.ts +21 -4
  56. package/dist/sdk/services/FileService.d.ts +8 -26
  57. package/dist/sdk/services/FormIdentifierService.d.ts +28 -0
  58. package/dist/sdk/services/FormIdentifierValueService.d.ts +27 -0
  59. package/dist/sdk/services/FormRevisionAttachmentService.d.ts +27 -10
  60. package/dist/sdk/services/FormRevisionService.d.ts +20 -3
  61. package/dist/sdk/services/FormService.d.ts +20 -3
  62. package/dist/sdk/services/FormSubmissionAttachmentService.d.ts +28 -11
  63. package/dist/sdk/services/FormSubmissionService.d.ts +22 -5
  64. package/dist/sdk/services/GeoImageService.d.ts +28 -8
  65. package/dist/sdk/services/IssueAssociationService.d.ts +21 -4
  66. package/dist/sdk/services/IssueAttachmentService.d.ts +24 -35
  67. package/dist/sdk/services/IssueCommentAttachmentService.d.ts +24 -35
  68. package/dist/sdk/services/IssueCommentService.d.ts +22 -5
  69. package/dist/sdk/services/IssueService.d.ts +24 -5
  70. package/dist/sdk/services/IssueTypeAttachmentService.d.ts +24 -35
  71. package/dist/sdk/services/IssueTypeFieldValuesAttachmentService.d.ts +27 -10
  72. package/dist/sdk/services/IssueTypeFieldValuesService.d.ts +21 -4
  73. package/dist/sdk/services/IssueTypeFieldsAttachmentService.d.ts +27 -10
  74. package/dist/sdk/services/IssueTypeFieldsService.d.ts +21 -4
  75. package/dist/sdk/services/IssueTypeIdentifierService.d.ts +28 -0
  76. package/dist/sdk/services/IssueTypeIdentifierValueService.d.ts +27 -0
  77. package/dist/sdk/services/IssueTypeService.d.ts +21 -4
  78. package/dist/sdk/services/IssueTypeStatusService.d.ts +28 -0
  79. package/dist/sdk/services/IssueUpdateService.d.ts +190 -3
  80. package/dist/sdk/services/JWTAuthService.d.ts +1 -1
  81. package/dist/sdk/services/OrganizationAccessService.d.ts +21 -4
  82. package/dist/sdk/services/OrganizationService.d.ts +20 -3
  83. package/dist/sdk/services/ProjectAccessService.d.ts +24 -6
  84. package/dist/sdk/services/ProjectAttachmentService.d.ts +24 -34
  85. package/dist/sdk/services/ProjectFileService.d.ts +29 -8
  86. package/dist/sdk/services/ProjectService.d.ts +22 -5
  87. package/dist/sdk/services/TeamMembershipService.d.ts +22 -4
  88. package/dist/sdk/services/TeamService.d.ts +21 -4
  89. package/dist/sdk/services/UserService.d.ts +24 -3
  90. package/dist/sdk/services/WorkflowIssueLinkService.d.ts +27 -0
  91. package/dist/sdk/services/WorkflowService.d.ts +28 -0
  92. package/dist/sdk/services/WorkflowStepAssigneeService.d.ts +29 -0
  93. package/dist/sdk/services/WorkflowStepCommentService.d.ts +28 -0
  94. package/dist/sdk/services/WorkflowStepDefaultAssigneeService.d.ts +27 -0
  95. package/dist/sdk/services/WorkflowStepDefaultReviewerService.d.ts +27 -0
  96. package/dist/sdk/services/WorkflowStepEventService.d.ts +24 -0
  97. package/dist/sdk/services/WorkflowStepFieldValuesAttachmentService.d.ts +31 -0
  98. package/dist/sdk/services/WorkflowStepFieldValuesReviewRequestService.d.ts +27 -0
  99. package/dist/sdk/services/WorkflowStepFieldValuesReviewService.d.ts +28 -0
  100. package/dist/sdk/services/WorkflowStepFieldValuesService.d.ts +28 -0
  101. package/dist/sdk/services/WorkflowStepFieldsAttachmentService.d.ts +30 -0
  102. package/dist/sdk/services/WorkflowStepFieldsService.d.ts +27 -0
  103. package/dist/sdk/services/WorkflowStepReviewerService.d.ts +29 -0
  104. package/dist/sdk/services/WorkflowStepService.d.ts +28 -0
  105. package/dist/sdk/services/WorkflowTypeService.d.ts +28 -0
  106. package/dist/sdk/services/index.d.ts +33 -7
  107. package/dist/sdk/typings.d.ts +27 -62
  108. package/dist/sdk/utils.d.ts +2 -0
  109. package/dist/store/adapters/modelAdapter.d.ts +13 -14
  110. package/dist/store/adapters/typings.d.ts +19 -0
  111. package/dist/store/reducers.d.ts +90 -21
  112. package/dist/store/selectors/index.d.ts +1 -0
  113. package/dist/store/selectors/utils.d.ts +1 -0
  114. package/dist/store/slices/agentsSlice.d.ts +11 -38
  115. package/dist/store/slices/assetAttachmentSlice.d.ts +11 -37
  116. package/dist/store/slices/assetProcedureSlice.d.ts +120 -41
  117. package/dist/store/slices/assetProcedureStepFieldValuesAttachmentSlice.d.ts +41 -45
  118. package/dist/store/slices/assetProcedureStepFieldValuesSlice.d.ts +43 -46
  119. package/dist/store/slices/assetProcedureStepFieldsAttachmentSlice.d.ts +41 -44
  120. package/dist/store/slices/assetProcedureStepFieldsSlice.d.ts +71 -51
  121. package/dist/store/slices/assetProcedureStepSlice.d.ts +45 -48
  122. package/dist/store/slices/assetProcedureTypeAttachmentSlice.d.ts +107 -0
  123. package/dist/store/slices/assetProcedureTypeFieldValuesAttachmentSlice.d.ts +127 -0
  124. package/dist/store/slices/assetProcedureTypeFieldValuesSlice.d.ts +128 -0
  125. package/dist/store/slices/assetProcedureTypeFieldsAttachmentSlice.d.ts +127 -0
  126. package/dist/store/slices/assetProcedureTypeFieldsSlice.d.ts +23 -0
  127. package/dist/store/slices/assetProcedureTypeSlice.d.ts +22 -0
  128. package/dist/store/slices/assetSlice.d.ts +42 -46
  129. package/dist/store/slices/assetStageCompletionSlice.d.ts +41 -45
  130. package/dist/store/slices/assetStageSlice.d.ts +44 -48
  131. package/dist/store/slices/assetTypeAttachmentSlice.d.ts +11 -37
  132. package/dist/store/slices/assetTypeFieldValuesAttachmentSlice.d.ts +41 -45
  133. package/dist/store/slices/assetTypeFieldValuesSlice.d.ts +41 -44
  134. package/dist/store/slices/assetTypeFieldsAttachmentSlice.d.ts +41 -44
  135. package/dist/store/slices/assetTypeFieldsSlice.d.ts +41 -44
  136. package/dist/store/slices/assetTypeIdentifierSlice.d.ts +22 -0
  137. package/dist/store/slices/assetTypeIdentifierValueSlice.d.ts +23 -0
  138. package/dist/store/slices/assetTypeSlice.d.ts +11 -38
  139. package/dist/store/slices/assetTypeStatusSlice.d.ts +127 -0
  140. package/dist/store/slices/documentAttachmentSlice.d.ts +11 -37
  141. package/dist/store/slices/documentSlice.d.ts +17 -24
  142. package/dist/store/slices/emailDomainsSlice.d.ts +43 -45
  143. package/dist/store/slices/fileSlice.d.ts +0 -3
  144. package/dist/store/slices/formIdentifierSlice.d.ts +22 -0
  145. package/dist/store/slices/formIdentifierValueSlice.d.ts +23 -0
  146. package/dist/store/slices/formRevisionAttachmentSlice.d.ts +118 -37
  147. package/dist/store/slices/formRevisionSlice.d.ts +41 -44
  148. package/dist/store/slices/formSlice.d.ts +41 -44
  149. package/dist/store/slices/formSubmissionAttachmentSlice.d.ts +13 -38
  150. package/dist/store/slices/formSubmissionSlice.d.ts +12 -40
  151. package/dist/store/slices/geoImageSlice.d.ts +41 -44
  152. package/dist/store/slices/index.d.ts +30 -7
  153. package/dist/store/slices/issueAssociationSlice.d.ts +43 -44
  154. package/dist/store/slices/issueAttachmentSlice.d.ts +11 -37
  155. package/dist/store/slices/issueCommentAttachmentSlice.d.ts +11 -37
  156. package/dist/store/slices/issueCommentSlice.d.ts +11 -37
  157. package/dist/store/slices/issueSlice.d.ts +11 -38
  158. package/dist/store/slices/issueTypeAttachmentSlice.d.ts +12 -38
  159. package/dist/store/slices/issueTypeFieldValuesAttachmentSlice.d.ts +41 -45
  160. package/dist/store/slices/issueTypeFieldValuesSlice.d.ts +41 -44
  161. package/dist/store/slices/issueTypeFieldsAttachmentSlice.d.ts +41 -44
  162. package/dist/store/slices/issueTypeFieldsSlice.d.ts +41 -44
  163. package/dist/store/slices/issueTypeIdentifierSlice.d.ts +22 -0
  164. package/dist/store/slices/issueTypeIdentifierValueSlice.d.ts +23 -0
  165. package/dist/store/slices/issueTypeSlice.d.ts +12 -43
  166. package/dist/store/slices/issueTypeStatusSlice.d.ts +127 -0
  167. package/dist/store/slices/issueUpdateSlice.d.ts +268 -38
  168. package/dist/store/slices/organizationAccessSlice.d.ts +11 -37
  169. package/dist/store/slices/organizationSlice.d.ts +41 -44
  170. package/dist/store/slices/outboxSlice.d.ts +6 -7
  171. package/dist/store/slices/projectAccessSlice.d.ts +11 -37
  172. package/dist/store/slices/projectAttachmentSlice.d.ts +13 -39
  173. package/dist/store/slices/projectFileSlice.d.ts +42 -60
  174. package/dist/store/slices/projectSlice.d.ts +41 -44
  175. package/dist/store/slices/teamMembershipSlice.d.ts +11 -37
  176. package/dist/store/slices/teamSlice.d.ts +11 -38
  177. package/dist/store/slices/userSlice.d.ts +44 -54
  178. package/dist/store/slices/workflowIssueLinkSlice.d.ts +130 -0
  179. package/dist/store/slices/workflowSlice.d.ts +23 -0
  180. package/dist/store/slices/workflowStepAssigneeSlice.d.ts +129 -0
  181. package/dist/store/slices/workflowStepCommentSlice.d.ts +129 -0
  182. package/dist/store/slices/workflowStepDefaultAssigneeSlice.d.ts +127 -0
  183. package/dist/store/slices/workflowStepDefaultReviewerSlice.d.ts +127 -0
  184. package/dist/store/slices/workflowStepEventSlice.d.ts +129 -0
  185. package/dist/store/slices/workflowStepFieldValuesAttachmentSlice.d.ts +127 -0
  186. package/dist/store/slices/workflowStepFieldValuesReviewRequestSlice.d.ts +129 -0
  187. package/dist/store/slices/workflowStepFieldValuesReviewSlice.d.ts +130 -0
  188. package/dist/store/slices/workflowStepFieldValuesSlice.d.ts +130 -0
  189. package/dist/store/slices/workflowStepFieldsAttachmentSlice.d.ts +127 -0
  190. package/dist/store/slices/workflowStepFieldsSlice.d.ts +128 -0
  191. package/dist/store/slices/workflowStepReviewerSlice.d.ts +129 -0
  192. package/dist/store/slices/workflowStepSlice.d.ts +22 -0
  193. package/dist/store/slices/workflowTypeSlice.d.ts +22 -0
  194. package/dist/store/store.d.ts +4 -14
  195. package/dist/store/typings.d.ts +18 -1
  196. package/dist/typings/files.d.ts +32 -18
  197. package/dist/typings/index.d.ts +0 -3
  198. package/dist/typings/models/agents.d.ts +2 -1
  199. package/dist/typings/models/assets.d.ts +80 -51
  200. package/dist/typings/models/base.d.ts +22 -13
  201. package/dist/typings/models/documents.d.ts +6 -3
  202. package/dist/typings/models/emailDomain.d.ts +2 -1
  203. package/dist/typings/models/emailVerification.d.ts +7 -5
  204. package/dist/typings/models/fields.d.ts +7 -7
  205. package/dist/typings/models/forms.d.ts +15 -10
  206. package/dist/typings/models/geoImages.d.ts +7 -7
  207. package/dist/typings/models/index.d.ts +1 -3
  208. package/dist/typings/models/issues.d.ts +62 -33
  209. package/dist/typings/models/organizations.d.ts +1 -1
  210. package/dist/typings/models/projects.d.ts +9 -5
  211. package/dist/typings/models/teams.d.ts +4 -4
  212. package/dist/typings/models/users.d.ts +4 -3
  213. package/dist/typings/models/workflows.d.ts +91 -0
  214. package/dist/utils/file.d.ts +7 -11
  215. package/dist/utils/index.d.ts +2 -2
  216. package/dist/utils/models/assets.d.ts +5 -0
  217. package/dist/utils/models/documents.d.ts +4 -0
  218. package/dist/utils/models/index.d.ts +3 -0
  219. package/dist/utils/models/issues.d.ts +2 -0
  220. package/dist/utils/utils.d.ts +0 -7
  221. package/dist/utils/uuid.d.ts +7 -0
  222. package/package.json +37 -51
  223. package/dist/sdk/services/AssetProcedureAttachmentService.d.ts +0 -40
  224. package/dist/sdk/services/AssetProcedureFieldValuesAttachmentService.d.ts +0 -16
  225. package/dist/sdk/services/AssetProcedureFieldValuesService.d.ts +0 -22
  226. package/dist/sdk/services/AssetProcedureFieldsAttachmentService.d.ts +0 -13
  227. package/dist/sdk/services/AssetProcedureFieldsService.d.ts +0 -9
  228. package/dist/sdk/services/AssetProcedureInstanceService.d.ts +0 -11
  229. package/dist/sdk/services/BaseAttachmentService.d.ts +0 -38
  230. package/dist/sdk/services/BaseUploadService.d.ts +0 -10
  231. package/dist/sdk/services/CategoryService.d.ts +0 -11
  232. package/dist/store/slices/assetProcedureAttachmentSlice.d.ts +0 -48
  233. package/dist/store/slices/assetProcedureFieldValuesAttachmentSlice.d.ts +0 -131
  234. package/dist/store/slices/assetProcedureFieldValuesSlice.d.ts +0 -131
  235. package/dist/store/slices/assetProcedureFieldsAttachmentSlice.d.ts +0 -130
  236. package/dist/store/slices/assetProcedureFieldsSlice.d.ts +0 -49
  237. package/dist/store/slices/assetProcedureInstanceSlice.d.ts +0 -132
  238. package/dist/store/slices/categorySlice.d.ts +0 -131
  239. package/dist/typings/colors.d.ts +0 -8
  240. package/dist/typings/json.d.ts +0 -6
  241. package/dist/typings/memoization.d.ts +0 -1
  242. package/dist/typings/models/attachments.d.ts +0 -31
  243. package/dist/typings/models/categories.d.ts +0 -8
  244. package/dist/typings/models/issueTypes.d.ts +0 -7
  245. package/dist/typings/models/store.d.ts +0 -0
  246. package/dist/typings/search.d.ts +0 -23
  247. package/dist/utils/coordinates.d.ts +0 -4
  248. package/dist/utils/offline.d.ts +0 -13
  249. /package/dist/sdk/{classes → outbox}/OutboxCoordinator.d.ts +0 -0
  250. /package/dist/sdk/{classes → outbox}/OutboxCoordinator.spec.d.ts +0 -0
@@ -1,15 +1,14 @@
1
- (function(s,U){typeof exports=="object"&&typeof module<"u"?U(exports,require("@redux-offline/redux-offline/lib/types"),require("@reduxjs/toolkit"),require("superagent"),require("uuid"),require("file-saver"),require("react"),require("@redux-offline/redux-offline"),require("@redux-offline/redux-offline/lib/defaults"),require("buffer"),require("localforage"),require("redux-persist-migrate"),require("@overmap-ai/forms"),require("idb"),require("jwt-decode"),require("dependency-graph"),require("@tiptap/core")):typeof define=="function"&&define.amd?define(["exports","@redux-offline/redux-offline/lib/types","@reduxjs/toolkit","superagent","uuid","file-saver","react","@redux-offline/redux-offline","@redux-offline/redux-offline/lib/defaults","buffer","localforage","redux-persist-migrate","@overmap-ai/forms","idb","jwt-decode","dependency-graph","@tiptap/core"],U):(s=typeof globalThis<"u"?globalThis:s||self,U(s["overmap-core"]={},null,s.toolkit,s.request,s.uuid,s.fileSaver,s.react,s.reduxOffline,s.offlineConfig,null,s.localforage,s.createMigration,null,s.idb,s.jwtDecode,s.dependencyGraph))})(this,function(s,U,d,Le,Ne,pm,Am,fm,pc,RP,ym,Sm,vP,gm,bm,Pm){"use strict";var OP=Object.defineProperty;var _P=(s,U,d)=>U in s?OP(s,U,{enumerable:!0,configurable:!0,writable:!0,value:d}):s[U]=d;var S=(s,U,d)=>_P(s,typeof U!="symbol"?U+"":U,d);var mm;const Ac=Object.freeze([]),fc=Object.freeze({});var yc=(t=>(t[t.GUEST=0]="GUEST",t[t.BASIC=2]="BASIC",t[t.ADMIN=4]="ADMIN",t))(yc||{}),h=(t=>(t.GET="GET",t.POST="POST",t.PATCH="PATCH",t.PUT="PUT",t.DELETE="DELETE",t))(h||{}),Sc=(t=>(t.Issue="issue",t.Asset="asset",t.AssetType="asset_type",t.Project="project",t.Document="document",t))(Sc||{}),$t=(t=>(t[t.LOWEST=0]="LOWEST",t[t.LOW=2]="LOW",t[t.MEDIUM=4]="MEDIUM",t[t.HIGH=6]="HIGH",t[t.HIGHEST=8]="HIGHEST",t))($t||{}),Lt=(t=>(t[t.BACKLOG=0]="BACKLOG",t[t.SELECTED=2]="SELECTED",t[t.DONE=4]="DONE",t))(Lt||{}),j=(t=>(t.STATUS="status",t.PRIORITY="priority",t.CATEGORY="category",t.DESCRIPTION="description",t.TITLE="title",t.ASSIGNED_TO="assigned_to",t.DUE_DATE="due_date",t))(j||{});const Fm=Lt.BACKLOG,Tm=$t.MEDIUM,gc=6e4;function I(t){return{addOne:(p,A)=>{const f=t(A.payload);p.instances[f]=A.payload},addMany:(p,A)=>{for(const f of A.payload){const b=t(f);p.instances[b]=f}},setOne:(p,A)=>{const f=t(A.payload);p.instances[f]=A.payload},setMany:(p,A)=>{for(const f of A.payload){const b=t(f);p.instances[b]=f}},updateOne:(p,A)=>{const f=t(A.payload);p.instances[f]=A.payload},updateMany:(p,A)=>{for(const f of A.payload){const b=t(f);p.instances[b]=f}},deleteOne:(p,A)=>{delete p.instances[A.payload]},deleteMany:(p,A)=>{for(const f of A.payload)delete p.instances[f]},initialize:(p,A)=>{p.instances={};const f=new Set;for(const b of A.payload){const P=t(b);f.add(P),p.instances[P]=b}f.size!==A.payload.length&&console.warn("duplicate ids detected when initializing model instances.")},getInitialState:p=>({...p,instances:{}})}}function Im(){return{initializeSelection:(m,u)=>{m.selection=Array.from(new Set(u.payload))},selectOne:(m,u)=>{new Set(m.selection).has(u.payload)||m.selection.push(u.payload)},selectMany:(m,u)=>{const o=new Set(m.selection);for(const p of u.payload)o.has(p)||o.add(p);m.selection=Array.from(o)},unselectOne:(m,u)=>{const o=new Set(m.selection);o.has(u.payload)&&(o.delete(u.payload),m.selection=Array.from(o))},unselectMany:(m,u)=>{const o=new Set(m.selection);for(const p of u.payload)o.has(p)&&o.delete(p);m.selection=Array.from(o)},toggleOne:(m,u)=>{const o=new Set(m.selection);o.has(u.payload)?o.delete(u.payload):o.add(u.payload),m.selection=Array.from(o)},toggleMany:(m,u)=>{const o=new Set(m.selection);for(const p of u.payload)o.has(p)?o.delete(p):o.add(p);m.selection=Array.from(o)},getInitialState:m=>({...m,selection:[]})}}const Ze="versioning",F=d.createAction("RESET"),M=d.createAction("RESET_PROJECT_STATE"),O=d.createAction("RESET_ORGANIZATION_STATE");mm=Symbol.toStringTag;class bc{constructor(){S(this,mm,"Promise");S(this,"_promise");S(this,"_resolve");S(this,"_reject");S(this,"_state","pending");this._resolve=null,this._reject=null,this._promise=new Promise((e,i)=>{this._resolve=e,this._reject=i})}get state(){return this._state}then(e,i){return this._promise.then(e,i)}catch(e){return this._promise.catch(e)}resolve(e){if(!this._resolve)throw new Error("No resolve callback");this._resolve(e),this._state="fulfilled"}reject(e){if(!this._reject)throw e;this._reject(e),this._state="rejected"}finally(e){throw new Error("`finally` not implemented")}}const Om=t=>({type:"Point",coordinates:t}),_m=t=>({type:"MultiPoint",coordinates:t}),Rm=(t,e)=>t[0]===e[0]&&t[1]===e[1];let Nt=!1;["true","1"].includes("".toLowerCase())&&(Nt=!0);function vm(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;const i=Object.keys(t),a=Object.keys(e),c=i.length;if(c!==a.length)return!1;for(let n=0;n<c;n++){const r=i[n];if(!Object.prototype.hasOwnProperty.call(e,r)||t[r]!==e[r])return!1}return!0}function Ht(t){const e={};return function(){const i=Array.prototype.slice.call(arguments);return i in e?(Nt&&console.debug(`Memoization debug: Using memorized return value for ${t.toString()}(`,i,")"),e[i]):(Nt&&console.debug(`Memoization debug: Cache miss! Memoizing ${t.toString()}(`,i,")"),e[i]=t.apply(this,i))}}function wm(t,e){if(t.length!==e.length)return!1;for(let i=0;i<t.length;i++)if(t[i]!==e[i])return!1;return!0}const g=t=>t.length===0?Ac:t,ht=t=>Object.keys(t).length===0?fc:t,Pc=Ht(t=>{if(!t)return"";const e=new Date(t),i=e.getFullYear()===Wt.getFullYear(),a={day:"numeric",month:"short"};return i||(a.year="numeric"),e.toLocaleDateString([],a)}),Mm=new Intl.RelativeTimeFormat([],{style:"long",numeric:"auto"}),Em=1e3*86400,Wt=new Date,jm=t=>new Date(t).toDateString()===Wt.toDateString(),qm=Ht((t,e,i)=>{const a=Math.round((new Date(t).getTime()-Wt.getTime())/Em);return a<e||a>i?Pc(t):Mm.format(a,"days")});function Vm(t){return new Uint8Array(t).reduce((i,a)=>i+a.toString(16).padStart(2,"0"),"")}const Yt=async(t,e)=>{e||(e=await He(t));let i=t.type;if(i.includes("/")&&(i=i.split("/")[1]),!i)throw new Error(`Could not extract file type from ${t.type}`);return`${e}.${i}`};function He(t){return new Promise((e,i)=>{const a=new FileReader;a.onload=()=>{const c=a.result;if(!c){i(new Error("FileReader did not return a valid ArrayBuffer."));return}crypto.subtle.digest("SHA-1",c).then(n=>{const r=Vm(n);e(r)})},a.readAsArrayBuffer(t)})}function zm(t){if(!t.name||!t.type||!t.size){const e="File has no name, type, and/or size";throw new Error(e)}return`${t.name}&${t.type}${t.size}`}function Fc(t,e){return new File([t],e,{type:t.type})}function Um(t,e){const i=document.createElement("a");i.setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(e)),i.setAttribute("download",t),i.style.display="none",document.body.appendChild(i),i.click(),document.body.removeChild(i)}const Dm=async t=>{const e={};for(const i of t){const a=await He(i);e[a]={sha1:a,extension:i.name.split(".").pop()||"",file_type:i.type,size:i.size}}return Object.values(e)},Tc=async t=>(await fetch(t)).blob(),Cm=t=>new Promise((e,i)=>{const a=new FileReader;a.onloadend=()=>{var c;e(((c=a.result)==null?void 0:c.toString())||"")},a.readAsDataURL(t)});function km(t){const e=new Blob([t]);pm.saveAs(e,t.name)}const Ic={};function Bm(t,e,i,...a){const c=Ic[t];let n=!1;c?c[e]||(c[e]=!0,n=!0):(Ic[t]={[e]:!0},n=!0),n&&console[i](...a)}const Oc=["created_at","updated_at","index","revision"];function T(t){return{...t,uuid:Ne.v4()}}function _c(t){const e={};for(const i of t)e[i.uuid]=i;return e}function Gm(t,e=void 0,i=255){let a=t.replace(/[^a-z0-9_\-.]/gi,"_").replace(/_{2,}/g,"_");if(!e){const n=t.split(".");n.length>1&&(e=n[n.length-1])}e&&!e.startsWith(".")&&(e="."+e);const c=e?e.length:0;return a.length+c>i&&(a=a.slice(0,i-c)+(e||"")),a}function $m(t){return t.toLowerCase().replace(" ","-")}function Lm(t,e=!1){return t.normalize("NFKD").toLowerCase().replace(/[^\w\s-]/g,"").trim().replace(/[-\s]+/g,e?"_":"-")}function Nm(t,e){if(t.length<=e)return t;const i=t.slice(0,e-1);return i.slice(0,i.lastIndexOf(" "))+"…"}const y=t=>e=>i=>t(i,e);function Rc(t,e,i){return i.findIndex(a=>a.uuid===t.uuid)===e}function Hm(t,e,i){return i.findIndex(a=>a.file_sha1===t.file_sha1)===e}const Wm=/^.+@.+\..+$/;function w(t){const e={...t};for(const i of[...Oc,"created_by"])i in e&&delete e[i];return e}const k=I(t=>t.uuid),vc=k.getInitialState({}),Kt=d.createSlice({name:"agents",initialState:vc,extraReducers:t=>t.addMatcher(d.isAnyOf(F,M,O),e=>Object.assign(e,vc)),reducers:{initializeConversations:k.initialize,addConversation:k.addOne,addConversations:k.addMany,setConversation:k.setOne,setConversations:k.setMany,updateConversation:k.updateOne,updateConversations:k.updateMany,deleteConversation:k.deleteOne,deleteConversations:k.deleteMany}}),{initializeConversations:wc,addConversation:Mc,addConversations:Ym,setConversation:Ec,setConversations:Km,updateConversation:jc,updateConversations:Zm,deleteConversation:Jm,deleteConversations:Xm}=Kt.actions,Zt=t=>t.agentsReducer.instances,Qm=d.createSelector([Zt],t=>Object.values(t)),xm=y(d.createSelector([Zt,(t,e)=>e],(t,e)=>t[e])),qc=Kt.reducer,B=I(t=>t.uuid),Vc=B.getInitialState({}),Jt=d.createSlice({name:"assetAttachments",initialState:Vc,extraReducers:t=>t.addMatcher(d.isAnyOf(F,M,O),e=>Object.assign(e,Vc)),reducers:{initializeAssetAttachments:B.initialize,addAssetAttachment:B.addOne,addAssetAttachments:B.addMany,setAssetAttachment:B.setOne,setAssetAttachments:B.setMany,updateAssetAttachment:B.updateOne,updateAssetAttachments:B.updateMany,deleteAssetAttachment:B.deleteOne,deleteAssetAttachments:B.deleteMany}}),{initializeAssetAttachments:Xt,addAssetAttachment:ep,addAssetAttachments:Qt,setAssetAttachment:zc,setAssetAttachments:tp,updateAssetAttachment:sp,updateAssetAttachments:Uc,deleteAssetAttachment:Dc,deleteAssetAttachments:xt}=Jt.actions,Cc=t=>t.assetAttachmentReducer.instances,kc=d.createSelector([Cc],t=>Object.values(t)),Bc=t=>e=>e.assetAttachmentReducer.instances[t],Gc=y(d.createSelector([kc,(t,e)=>e],(t,e)=>g(t.filter(({asset:i})=>e===i)))),$c=Jt.reducer,G=I(t=>t.uuid),Lc=G.getInitialState({}),es=d.createSlice({name:"assetProcedureAttachments",initialState:Lc,extraReducers:t=>t.addMatcher(d.isAnyOf(F,O),e=>Object.assign(e,Lc)),reducers:{initializeAssetProcedureAttachments:G.initialize,addAssetProcedureAttachment:G.addOne,addAssetProcedureAttachments:G.addMany,setAssetProcedureAttachment:G.setOne,setAssetProcedureAttachments:G.setMany,updateAssetProcedureAttachment:G.updateOne,updateAssetProcedureAttachments:G.updateMany,deleteAssetProcedureAttachment:G.deleteOne,deleteAssetProcedureAttachments:G.deleteMany}}),{initializeAssetProcedureAttachments:Nc,addAssetProcedureAttachment:ip,addAssetProcedureAttachments:Hc,setAssetProcedureAttachment:Wc,setAssetProcedureAttachments:ap,updateAssetProcedureAttachment:cp,updateAssetProcedureAttachments:Yc,deleteAssetProcedureAttachment:Kc,deleteAssetProcedureAttachments:Zc}=es.actions,Jc=es.reducer,Xc=t=>t.assetProcedureAttachmentReducer.instances,Qc=d.createSelector([Xc],t=>Object.values(t)),xc=t=>e=>e.assetProcedureAttachmentReducer.instances[t],np=y(d.createSelector([Qc,(t,e)=>e],(t,e)=>g(t.filter(({asset_procedure:i})=>e===i)))),$=I(t=>t.uuid),en=$.getInitialState({}),ts=d.createSlice({name:"assetProcedureFieldsAttachments",initialState:en,extraReducers:t=>t.addMatcher(d.isAnyOf(F,O),e=>Object.assign(e,en)),reducers:{initializeAssetProcedureFieldsAttachments:$.initialize,addAssetProcedureFieldsAttachment:$.addOne,addAssetProcedureFieldsAttachments:$.addMany,setAssetProcedureFieldsAttachment:$.setOne,setAssetProcedureFieldsAttachments:$.setMany,updateAssetProcedureFieldsAttachment:$.updateOne,updateAssetProcedureFieldsAttachments:$.updateMany,deleteAssetProcedureFieldsAttachment:$.deleteOne,deleteAssetProcedureFieldsAttachments:$.deleteMany}}),{initializeAssetProcedureFieldsAttachments:tn,addAssetProcedureFieldsAttachment:rp,addAssetProcedureFieldsAttachments:sn,setAssetProcedureFieldsAttachment:dp,setAssetProcedureFieldsAttachments:up,updateAssetProcedureFieldsAttachment:op,updateAssetProcedureFieldsAttachments:an,deleteAssetProcedureFieldsAttachment:lp,deleteAssetProcedureFieldsAttachments:cn}=ts.actions,nn=t=>t.assetProcedureFieldsAttachmentReducer.instances,rn=d.createSelector([nn],t=>Object.values(t)),hp=y(d.createSelector([rn,(t,e)=>e],(t,e)=>g(t.filter(i=>i.fields_revision===e)))),mp=t=>e=>e.assetProcedureFieldsAttachmentReducer.instances[t],dn=ts.reducer,L=I(t=>t.uuid),un=L.getInitialState({}),ss=d.createSlice({name:"assetProcedureFields",initialState:un,extraReducers:t=>t.addMatcher(d.isAnyOf(F,O),e=>Object.assign(e,un)),reducers:{initializeAssetProcedureFields:L.initialize,addAssetProcedureFields:L.addOne,addAssetProcedureFieldsMany:L.addMany,setAssetProcedureFields:L.setOne,setAssetProcedureFieldsMany:L.setMany,updateAssetProcedureFields:L.updateOne,updateAssetProcedureFieldsMany:L.updateMany,deleteAssetProcedureFields:L.deleteOne,deleteAssetProcedureFieldsMany:L.deleteMany}}),{initializeAssetProcedureFields:on,addAssetProcedureFields:ln,addAssetProcedureFieldsMany:pp,setAssetProcedureFields:Ap,setAssetProcedureFieldsMany:fp,updateAssetProcedureFields:hn,updateAssetProcedureFieldsMany:yp,deleteAssetProcedureFields:mn,deleteAssetProcedureFieldsMany:Sp}=ss.actions,pn=t=>t.assetProcedureFieldsReducer.instances,is=d.createSelector([pn],t=>Object.values(t)),gp=y(d.createSelector([is,(t,e)=>e],(t,e)=>g(t.filter(i=>i.asset_procedure===e)))),bp=y(d.createSelector([is,(t,e)=>e],(t,e)=>t.filter(i=>i.asset_procedure===e).sort((i,a)=>i.submitted_at>a.submitted_at?-1:1)[0])),Pp=t=>e=>e.assetProcedureFieldsReducer.instances[t],An=ss.reducer,N=I(t=>t.uuid),fn=N.getInitialState({}),as=d.createSlice({name:"assetProcedureFieldValuesAttachments",initialState:fn,extraReducers:t=>t.addMatcher(d.isAnyOf(F,M,O),e=>Object.assign(e,fn)),reducers:{initializeAssetProcedureFieldValuesAttachments:N.initialize,addAssetProcedureFieldValuesAttachment:N.addOne,addAssetProcedureFieldValuesAttachments:N.addMany,setAssetProcedureFieldValuesAttachment:N.setOne,setAssetProcedureFieldValuesAttachments:N.setMany,updateAssetProcedureFieldValuesAttachment:N.updateOne,updateAssetProcedureFieldValuesAttachments:N.updateMany,deleteAssetProcedureFieldValuesAttachment:N.deleteOne,deleteAssetProcedureFieldValuesAttachments:N.deleteMany}}),{initializeAssetProcedureFieldValuesAttachments:yn,addAssetProcedureFieldValuesAttachment:Fp,addAssetProcedureFieldValuesAttachments:mt,setAssetProcedureFieldValuesAttachment:Tp,setAssetProcedureFieldValuesAttachments:Ip,updateAssetProcedureFieldValuesAttachment:Op,updateAssetProcedureFieldValuesAttachments:Sn,deleteAssetProcedureFieldValuesAttachment:_p,deleteAssetProcedureFieldValuesAttachments:pt}=as.actions,cs=t=>t.assetProcedureFieldValuesAttachmentReducer.instances,gn=d.createSelector([cs],t=>Object.values(t)),Rp=t=>e=>e.assetProcedureFieldValuesAttachmentReducer.instances[t],bn=y(d.createSelector([cs,(t,e)=>e],(t,e)=>{const i=new Set(e);return g(Object.values(t).filter(a=>i.has(a.uuid)))})),Pn=y(d.createSelector([gn,(t,e)=>e],(t,e)=>g(t.filter(i=>i.field_values===e)))),Fn=as.reducer,H=I(t=>t.uuid),Tn=H.getInitialState({}),ns=d.createSlice({name:"assetProcedureFieldValues",initialState:Tn,extraReducers:t=>t.addMatcher(d.isAnyOf(F,M,O),e=>Object.assign(e,Tn)),reducers:{initializeAssetProcedureFieldValues:H.initialize,addAssetProcedureFieldValues:H.addOne,addAssetProcedureFieldValuesMany:H.addMany,setAssetProcedureFieldValues:H.setOne,setAssetProcedureFieldValuesMany:H.setMany,updateAssetProcedureFieldValues:H.updateOne,updateAssetProcedureFieldValuesMany:H.updateMany,deleteAssetProcedureFieldValues:H.deleteOne,deleteAssetProcedureFieldValuesMany:H.deleteMany}}),{initializeAssetProcedureFieldValues:In,addAssetProcedureFieldValues:rs,addAssetProcedureFieldValuesMany:On,setAssetProcedureFieldValues:vp,setAssetProcedureFieldValuesMany:wp,updateAssetProcedureFieldValues:Je,updateAssetProcedureFieldValuesMany:_n,deleteAssetProcedureFieldValues:ds,deleteAssetProcedureFieldValuesMany:Rn}=ns.actions,vn=ns.reducer,wn=t=>t.assetProcedureFieldValuesReducer.instances,us=d.createSelector([wn],t=>Object.values(t)),Mp=y(d.createSelector([us,(t,e)=>e],(t,e)=>g(t.filter(i=>i.asset===e)))),Ep=y(d.createSelector([us,(t,e)=>e],(t,e)=>g(t.filter(i=>i.asset_procedure_instance===e)))),os=t=>e=>e.assetProcedureFieldValuesReducer.instances[t],W=I(t=>t.uuid),Mn=W.getInitialState({}),ls=d.createSlice({name:"assetProcedureInstances",initialState:Mn,extraReducers:t=>t.addMatcher(d.isAnyOf(F,M,O),e=>Object.assign(e,Mn)),reducers:{initializeAssetProcedureInstances:W.initialize,addAssetProcedureInstance:W.addOne,addAssetProcedureInstances:W.addMany,setAssetProcedureInstance:W.setOne,setAssetProcedureInstances:W.setMany,updateAssetProcedureInstance:W.updateOne,updateAssetProcedureInstances:W.updateMany,deleteAssetProcedureInstance:W.deleteOne,deleteAssetProcedureInstances:W.deleteMany}}),{initializeAssetProcedureInstances:En,addAssetProcedureInstance:hs,addAssetProcedureInstances:jn,updateAssetProcedureInstance:Xe,updateAssetProcedureInstances:jp,deleteAssetProcedureInstance:ms,deleteAssetProcedureInstances:qn,setAssetProcedureInstance:qp,setAssetProcedureInstances:Vp}=ls.actions,Vn=ls.reducer,ps=t=>t.assetProcedureInstanceReducer.instances,As=d.createSelector([ps],t=>Object.values(t)),zn=y(d.createSelector([As,(t,e)=>e],(t,e)=>g(t.filter(i=>i.asset_procedure===e)))),zp=y(d.createSelector([As,(t,e)=>e],(t,e)=>g(t.filter(i=>i.asset_type===e)))),fs=t=>e=>e.assetProcedureInstanceReducer.instances[t],Up=y(d.createSelector([ps,(t,e)=>e],(t,e)=>{const i=[];for(const a of e){const c=t[a];c&&i.push(c)}return g(i)})),Y=I(t=>t.uuid),Un=Y.getInitialState({}),ys=d.createSlice({name:"assetProcedures",initialState:Un,extraReducers:t=>t.addMatcher(d.isAnyOf(F,O),e=>Object.assign(e,Un)),reducers:{initializeAssetProcedures:Y.initialize,addAssetProcedure:Y.addOne,addAssetProcedures:Y.addMany,setAssetProcedure:Y.setOne,setAssetProcedures:Y.setMany,updateAssetProcedure:Y.updateOne,updateAssetProcedures:Y.updateMany,deleteAssetProcedure:Y.deleteOne,deleteAssetProcedures:Y.deleteMany}}),{initializeAssetProcedures:Dn,addAssetProcedure:Ss,addAssetProcedures:Dp,updateAssetProcedure:Qe,updateAssetProcedures:Cp,deleteAssetProcedure:gs,deleteAssetProcedures:kp,setAssetProcedure:Bp,setAssetProcedures:Gp}=ys.actions,Cn=ys.reducer,bs=t=>t.assetProcedureReducer.instances,kn=d.createSelector([bs],t=>Object.values(t)),Ps=t=>e=>e.assetProcedureReducer.instances[t],$p=y(d.createSelector([bs,(t,e)=>e],(t,e)=>{const i=[];for(const a of e){const c=t[a];c&&i.push(c)}return g(i)})),Lp=y(d.createSelector([kn,(t,e)=>e],(t,e)=>g(t.filter(i=>i.organization===e)))),K=I(t=>t.uuid),Bn=K.getInitialState({}),Fs=d.createSlice({name:"assetProcedureStepFieldsAttachments",initialState:Bn,extraReducers:t=>t.addMatcher(d.isAnyOf(F,O),e=>Object.assign(e,Bn)),reducers:{initializeAssetProcedureStepFieldsAttachments:K.initialize,addAssetProcedureStepFieldsAttachment:K.addOne,addAssetProcedureStepFieldsAttachments:K.addMany,setAssetProcedureStepFieldsAttachment:K.setOne,setAssetProcedureStepFieldsAttachments:K.setMany,updateAssetProcedureStepFieldsAttachment:K.updateOne,updateAssetProcedureStepFieldsAttachments:K.updateMany,deleteAssetProcedureStepFieldsAttachment:K.deleteOne,deleteAssetProcedureStepFieldsAttachments:K.deleteMany}}),{initializeAssetProcedureStepFieldsAttachments:Gn,addAssetProcedureStepFieldsAttachment:Np,addAssetProcedureStepFieldsAttachments:$n,setAssetProcedureStepFieldsAttachment:Hp,setAssetProcedureStepFieldsAttachments:Wp,updateAssetProcedureStepFieldsAttachment:Yp,updateAssetProcedureStepFieldsAttachments:Ln,deleteAssetProcedureStepFieldsAttachment:Kp,deleteAssetProcedureStepFieldsAttachments:Nn}=Fs.actions,Hn=t=>t.assetProcedureStepFieldsAttachmentReducer.instances,Wn=d.createSelector([Hn],t=>Object.values(t)),Zp=y(d.createSelector([Wn,(t,e)=>e],(t,e)=>g(t.filter(i=>i.fields_revision===e)))),Jp=t=>e=>e.assetProcedureStepFieldsAttachmentReducer.instances[t],Yn=Fs.reducer,Z=I(t=>t.uuid),Kn=Z.getInitialState({}),Ts=d.createSlice({name:"assetProcedureStepFields",initialState:Kn,extraReducers:t=>t.addMatcher(d.isAnyOf(F,O),e=>Object.assign(e,Kn)),reducers:{initializeAssetProcedureStepFields:Z.initialize,addAssetProcedureStepFields:Z.addOne,addAssetProcedureStepFieldsMany:Z.addMany,setAssetProcedureStepFields:Z.setOne,setAssetProcedureStepFieldsMany:Z.setMany,updateAssetProcedureStepFields:Z.updateOne,updateAssetProcedureStepFieldsMany:Z.updateMany,deleteAssetProcedureStepFields:Z.deleteOne,deleteAssetProcedureStepFieldsMany:Z.deleteMany}}),{initializeAssetProcedureStepFields:Zn,addAssetProcedureStepFields:Is,addAssetProcedureStepFieldsMany:Xp,setAssetProcedureStepFields:Qp,setAssetProcedureStepFieldsMany:xp,updateAssetProcedureStepFields:xe,updateAssetProcedureStepFieldsMany:eA,deleteAssetProcedureStepFields:Os,deleteAssetProcedureStepFieldsMany:tA}=Ts.actions,_s=t=>t.assetProcedureStepFieldsReducer.instances,Rs=d.createSelector([_s],t=>Object.values(t)),sA=y(d.createSelector([Rs,(t,e)=>e],(t,e)=>g(t.filter(i=>i.asset_procedure_step===e)))),iA=y(d.createSelector([Rs,(t,e)=>e],(t,e)=>t.filter(i=>i.asset_procedure_step===e).sort((i,a)=>i.submitted_at>a.submitted_at?-1:1)[0])),aA=d.createSelector([_s],t=>{const e={};for(const i of Object.values(t)){const a=e[i.asset_procedure_step];(!a||a.submitted_at<i.submitted_at)&&(e[i.asset_procedure_step]=i)}return e}),cA=t=>e=>e.assetProcedureStepFieldsReducer.instances[t],Jn=Ts.reducer,J=I(t=>t.uuid),Xn=J.getInitialState({}),vs=d.createSlice({name:"assetProcedureStepFieldValuesAttachments",initialState:Xn,extraReducers:t=>t.addMatcher(d.isAnyOf(F,M,O),e=>Object.assign(e,Xn)),reducers:{initializeAssetProcedureStepFieldValuesAttachments:J.initialize,addAssetProcedureStepFieldValuesAttachment:J.addOne,addAssetProcedureStepFieldValuesAttachments:J.addMany,setAssetProcedureStepFieldValuesAttachment:J.setOne,setAssetProcedureStepFieldValuesAttachments:J.setMany,updateAssetProcedureStepFieldValuesAttachment:J.updateOne,updateAssetProcedureStepFieldValuesAttachments:J.updateMany,deleteAssetProcedureStepFieldValuesAttachment:J.deleteOne,deleteAssetProcedureStepFieldValuesAttachments:J.deleteMany}}),{initializeAssetProcedureStepFieldValuesAttachments:Qn,addAssetProcedureStepFieldValuesAttachment:nA,addAssetProcedureStepFieldValuesAttachments:At,setAssetProcedureStepFieldValuesAttachment:rA,setAssetProcedureStepFieldValuesAttachments:dA,updateAssetProcedureStepFieldValuesAttachment:uA,updateAssetProcedureStepFieldValuesAttachments:xn,deleteAssetProcedureStepFieldValuesAttachment:oA,deleteAssetProcedureStepFieldValuesAttachments:ft}=vs.actions,ws=t=>t.assetProcedureStepFieldValuesAttachmentReducer.instances,er=d.createSelector([ws],t=>Object.values(t)),lA=t=>e=>e.assetProcedureStepFieldValuesAttachmentReducer.instances[t],tr=y(d.createSelector([ws,(t,e)=>e],(t,e)=>{const i=new Set(e);return g(Object.values(t).filter(a=>i.has(a.uuid)))})),sr=y(d.createSelector([er,(t,e)=>e],(t,e)=>g(t.filter(i=>i.field_values===e)))),ir=vs.reducer,X=I(t=>t.uuid),ar=X.getInitialState({}),Ms=d.createSlice({name:"assetProcedureStepFieldValues",initialState:ar,extraReducers:t=>t.addMatcher(d.isAnyOf(F,M,O),e=>Object.assign(e,ar)),reducers:{initializeAssetProcedureStepFieldValues:X.initialize,addAssetProcedureStepFieldValues:X.addOne,addAssetProcedureStepFieldValuesMany:X.addMany,setAssetProcedureStepFieldValues:X.setOne,setAssetProcedureStepFieldValuesMany:X.setMany,updateAssetProcedureStepFieldValues:X.updateOne,updateAssetProcedureStepFieldValuesMany:X.updateMany,deleteAssetProcedureStepFieldValues:X.deleteOne,deleteAssetProcedureStepFieldValuesMany:X.deleteMany}}),{initializeAssetProcedureStepFieldValues:cr,addAssetProcedureStepFieldValues:Es,addAssetProcedureStepFieldValuesMany:nr,setAssetProcedureStepFieldValues:hA,setAssetProcedureStepFieldValuesMany:mA,updateAssetProcedureStepFieldValues:et,updateAssetProcedureStepFieldValuesMany:rr,deleteAssetProcedureStepFieldValues:js,deleteAssetProcedureStepFieldValuesMany:dr}=Ms.actions,ur=t=>t.assetProcedureStepFieldValuesReducer.instances,yt=d.createSelector([ur],t=>Object.values(t)),pA=y(d.createSelector([yt,(t,e)=>e],(t,e)=>g(t.filter(i=>i.asset===e)))),AA=y(d.createSelector([yt,(t,e)=>e],(t,e)=>g(t.filter(i=>i.asset_procedure_instance===e)))),fA=y(d.createSelector([yt,(t,e)=>e],(t,e)=>g(t.filter(i=>i.asset_procedure_step===e)))),qs=t=>e=>e.assetProcedureStepFieldValuesReducer.instances[t],or=Ms.reducer,Q=I(t=>t.uuid),lr=Q.getInitialState({}),Vs=d.createSlice({name:"assetProcedureSteps",initialState:lr,extraReducers:t=>t.addMatcher(d.isAnyOf(F,O),e=>Object.assign(e,lr)),reducers:{initializeAssetProcedureSteps:Q.initialize,setAssetProcedureStep:Q.setOne,setAssetProcedureSteps:Q.setMany,addAssetProcedureStep:Q.addOne,addAssetProcedureSteps:Q.addMany,updateAssetProcedureStep:Q.updateOne,updateAssetProcedureSteps:Q.updateMany,deleteAssetProcedureStep:Q.deleteOne,deleteAssetProcedureSteps:Q.deleteMany}}),{initializeAssetProcedureSteps:hr,setAssetProcedureStep:mr,setAssetProcedureSteps:yA,addAssetProcedureStep:zs,addAssetProcedureSteps:SA,updateAssetProcedureStep:St,updateAssetProcedureSteps:gA,deleteAssetProcedureStep:Us,deleteAssetProcedureSteps:bA}=Vs.actions,pr=Vs.reducer,gt=t=>t.assetProcedureStepReducer.instances,Ds=t=>e=>e.assetProcedureStepReducer.instances[t],Ar=d.createSelector([gt],t=>Object.values(t)),PA=y(d.createSelector([gt,(t,e)=>e],(t,e)=>{const i={};for(const[a,c]of Object.entries(t))c.asset_procedure===e&&(i[a]=c);return ht(i)})),FA=y(d.createSelector([Ar,(t,e)=>e],(t,e)=>g(t.filter(i=>i.asset_procedure===e)))),TA=y(d.createSelector([gt,(t,e)=>e],(t,e)=>{const i=[];for(const a of e){const c=t[a];c?i.push(c):console.warn("selectAssetProcedureStepsByIds: No step exists with the id",a)}return g(i)})),x=I(t=>t.uuid),fr=x.getInitialState({}),Cs=d.createSlice({name:"assets",initialState:fr,extraReducers:t=>t.addMatcher(d.isAnyOf(F,M,O),e=>Object.assign(e,fr)),reducers:{initializeAssets:x.initialize,addAsset:x.addOne,addAssets:x.addMany,setAsset:x.setOne,setAssets:x.setMany,updateAsset:x.updateOne,updateAssets:x.updateMany,deleteAsset:x.deleteOne,deleteAssets:x.deleteMany}}),{initializeAssets:yr,addAsset:ks,addAssets:bt,updateAsset:tt,updateAssets:IA,deleteAsset:Bs,deleteAssets:Gs,setAsset:OA,setAssets:_A}=Cs.actions,$s=t=>t.assetReducer.instances,Sr=d.createSelector([$s],t=>g(Object.values(t))),Ls=y(d.createSelector([Sr,(t,e)=>e],(t,e)=>g(t.filter(i=>i.asset_type===e)))),Ns=t=>e=>e.assetReducer.instances[t],gr=y(d.createSelector([$s,(t,e)=>e],(t,e)=>{const i=[];for(const a of e){const c=t[a];c&&i.push(c)}return g(i)})),RA=t=>e=>Ls(t)(e).length,br=Cs.reducer,ee=I(t=>t.uuid),Pr=ee.getInitialState({}),Hs=d.createSlice({name:"assetStageCompletions",initialState:Pr,extraReducers:t=>t.addMatcher(d.isAnyOf(F,M,O),e=>Object.assign(e,Pr)),reducers:{initializeAssetStageCompletions:ee.initialize,addAssetStageCompletion:ee.addOne,addAssetStageCompletions:ee.addMany,setAssetStageCompletion:ee.setOne,setAssetStageCompletions:ee.setMany,updateAssetStageCompletion:ee.updateOne,updateAssetStageCompletions:ee.updateMany,deleteAssetStageCompletion:ee.deleteOne,deleteAssetStageCompletions:ee.deleteMany}}),{initializeAssetStageCompletions:Fr,addAssetStageCompletion:Ws,addAssetStageCompletions:Ys,setAssetStageCompletion:vA,setAssetStageCompletions:wA,updateAssetStageCompletion:Tr,updateAssetStageCompletions:Ir,deleteAssetStageCompletion:Ks,deleteAssetStageCompletions:Zs}=Hs.actions,Or=Hs.reducer,Js=t=>t.assetStageCompletionReducer.instances,MA=d.createSelector([Js],t=>Object.values(t)),_r=t=>e=>e.assetStageCompletionReducer.instances[t],Rr=y(d.createSelector([Js,(t,e)=>e],(t,e)=>{const i=new Set(e);return g(Object.values(t).filter(a=>i.has(a.uuid)))})),te=I(t=>t.uuid),vr=te.getInitialState({}),Xs=d.createSlice({name:"assetStages",initialState:vr,extraReducers:t=>t.addMatcher(d.isAnyOf(F,O),e=>Object.assign(e,vr)),reducers:{initializeAssetStages:te.initialize,setAssetStage:te.setOne,setAssetStages:te.setMany,addAssetStage:te.addOne,addAssetStages:te.addMany,updateAssetStage:te.updateOne,updateAssetStages:te.updateMany,deleteAssetStage:te.deleteOne,deleteAssetStages:te.deleteMany}}),{initializeAssetStages:wr,setAssetStage:Mr,setAssetStages:EA,addAssetStage:Qs,addAssetStages:jA,updateAssetStage:Pt,updateAssetStages:qA,deleteAssetStage:xs,deleteAssetStages:VA}=Xs.actions,Er=Xs.reducer,Ft=t=>t.assetStageReducer.instances,ei=t=>e=>e.assetStageReducer.instances[t],jr=d.createSelector([Ft],t=>Object.values(t)),zA=y(d.createSelector([Ft,(t,e)=>e],(t,e)=>{const i={};for(const[a,c]of Object.entries(t))c.asset_procedure===e&&(i[a]=c);return ht(i)})),UA=y(d.createSelector([jr,(t,e)=>e],(t,e)=>g(t.filter(i=>i.asset_procedure===e)))),DA=y(d.createSelector([Ft,(t,e)=>e],(t,e)=>{const i=[];for(const a of e){const c=t[a];c?i.push(c):console.warn("selectStagesFromStageIds: No stage exists with the id",a)}return g(i)})),se=I(t=>t.uuid),qr=se.getInitialState({}),ti=d.createSlice({name:"assetTypeAttachments",initialState:qr,extraReducers:t=>t.addMatcher(d.isAnyOf(F,O),e=>Object.assign(e,qr)),reducers:{initializeAssetTypeAttachments:se.initialize,addAssetTypeAttachment:se.addOne,addAssetTypeAttachments:se.addMany,setAssetTypeAttachment:se.setOne,setAssetTypeAttachments:se.setMany,updateAssetTypeAttachment:se.updateOne,updateAssetTypeAttachments:se.updateMany,deleteAssetTypeAttachment:se.deleteOne,deleteAssetTypeAttachments:se.deleteMany}}),{initializeAssetTypeAttachments:Vr,addAssetTypeAttachment:CA,addAssetTypeAttachments:si,setAssetTypeAttachment:zr,setAssetTypeAttachments:kA,updateAssetTypeAttachment:BA,updateAssetTypeAttachments:Ur,deleteAssetTypeAttachment:Dr,deleteAssetTypeAttachments:ii}=ti.actions,Cr=t=>t.assetTypeAttachmentReducer.instances,kr=d.createSelector([Cr],t=>Object.values(t)),Br=t=>e=>e.assetTypeAttachmentReducer.instances[t],Gr=y(d.createSelector([kr,(t,e)=>e],(t,e)=>g(t.filter(({asset_type:i})=>e===i)))),$r=ti.reducer,ie=I(t=>t.uuid),Lr=ie.getInitialState({}),ai=d.createSlice({name:"assetTypeFieldsAttachments",initialState:Lr,extraReducers:t=>t.addMatcher(d.isAnyOf(F,O),e=>Object.assign(e,Lr)),reducers:{initializeAssetTypeFieldsAttachments:ie.initialize,addAssetTypeFieldsAttachment:ie.addOne,addAssetTypeFieldsAttachments:ie.addMany,setAssetTypeFieldsAttachment:ie.setOne,setAssetTypeFieldsAttachments:ie.setMany,updateAssetTypeFieldsAttachment:ie.updateOne,updateAssetTypeFieldsAttachments:ie.updateMany,deleteAssetTypeFieldsAttachment:ie.deleteOne,deleteAssetTypeFieldsAttachments:ie.deleteMany}}),{initializeAssetTypeFieldsAttachments:Nr,addAssetTypeFieldsAttachment:GA,addAssetTypeFieldsAttachments:Hr,setAssetTypeFieldsAttachment:$A,setAssetTypeFieldsAttachments:LA,updateAssetTypeFieldsAttachment:NA,updateAssetTypeFieldsAttachments:Wr,deleteAssetTypeFieldsAttachment:HA,deleteAssetTypeFieldsAttachments:Yr}=ai.actions,Kr=t=>t.assetTypeFieldsAttachmentReducer.instances,Zr=d.createSelector([Kr],t=>Object.values(t)),WA=y(d.createSelector([Zr,(t,e)=>e],(t,e)=>g(t.filter(i=>i.fields_revision===e)))),YA=t=>e=>e.assetTypeFieldsAttachmentReducer.instances[t],Jr=ai.reducer,ae=I(t=>t.uuid),Xr=ae.getInitialState({}),ci=d.createSlice({name:"assetTypeFields",initialState:Xr,extraReducers:t=>t.addMatcher(d.isAnyOf(F,O),e=>Object.assign(e,Xr)),reducers:{initializeAssetTypeFields:ae.initialize,addAssetTypeFields:ae.addOne,addAssetTypeFieldsMany:ae.addMany,setAssetTypeFields:ae.setOne,setAssetTypeFieldsMany:ae.setMany,updateAssetTypeFields:ae.updateOne,updateAssetTypeFieldsMany:ae.updateMany,deleteAssetTypeFields:ae.deleteOne,deleteAssetTypeFieldsMany:ae.deleteMany}}),{initializeAssetTypeFields:Qr,addAssetTypeFields:xr,addAssetTypeFieldsMany:KA,setAssetTypeFields:ZA,setAssetTypeFieldsMany:JA,updateAssetTypeFields:ed,updateAssetTypeFieldsMany:XA,deleteAssetTypeFields:td,deleteAssetTypeFieldsMany:QA}=ci.actions,sd=t=>t.assetTypeFieldsReducer.instances,Tt=d.createSelector([sd],t=>Object.values(t)),xA=y(d.createSelector([Tt,(t,e)=>e],(t,e)=>g(t.filter(i=>i.asset_type===e)))),ef=y(d.createSelector([Tt,(t,e)=>e],(t,e)=>t.filter(i=>i.asset_type===e).sort((i,a)=>i.submitted_at>a.submitted_at?-1:1)[0])),tf=t=>e=>e.assetTypeFieldsReducer.instances[t],id=ci.reducer,ce=I(t=>t.uuid),ad=ce.getInitialState({}),ni=d.createSlice({name:"assetTypeFieldValuesAttachments",initialState:ad,extraReducers:t=>t.addMatcher(d.isAnyOf(F,M,O),e=>Object.assign(e,ad)),reducers:{initializeAssetTypeFieldValuesAttachments:ce.initialize,addAssetTypeFieldValuesAttachment:ce.addOne,addAssetTypeFieldValuesAttachments:ce.addMany,setAssetTypeFieldValuesAttachment:ce.setOne,setAssetTypeFieldValuesAttachments:ce.setMany,updateAssetTypeFieldValuesAttachment:ce.updateOne,updateAssetTypeFieldValuesAttachments:ce.updateMany,deleteAssetTypeFieldValuesAttachment:ce.deleteOne,deleteAssetTypeFieldValuesAttachments:ce.deleteMany}}),{initializeAssetTypeFieldValuesAttachments:cd,addAssetTypeFieldValuesAttachment:sf,addAssetTypeFieldValuesAttachments:It,setAssetTypeFieldValuesAttachment:af,setAssetTypeFieldValuesAttachments:cf,updateAssetTypeFieldValuesAttachment:nf,updateAssetTypeFieldValuesAttachments:nd,deleteAssetTypeFieldValuesAttachment:rf,deleteAssetTypeFieldValuesAttachments:Ot}=ni.actions,ri=t=>t.assetTypeFieldValuesAttachmentReducer.instances,rd=d.createSelector([ri],t=>Object.values(t)),df=t=>e=>e.assetTypeFieldValuesAttachmentReducer.instances[t],dd=y(d.createSelector([ri,(t,e)=>e],(t,e)=>{const i=new Set(e);return g(Object.values(t).filter(a=>i.has(a.uuid)))})),ud=y(d.createSelector([rd,(t,e)=>e],(t,e)=>g(t.filter(i=>i.field_values===e)))),od=ni.reducer,ne=I(t=>t.uuid),ld=ne.getInitialState({}),di=d.createSlice({name:"assetTypeFieldValues",initialState:ld,extraReducers:t=>t.addMatcher(d.isAnyOf(F,M,O),e=>Object.assign(e,ld)),reducers:{initializeAssetTypeFieldValues:ne.initialize,addAssetTypeFieldValues:ne.addOne,addAssetTypeFieldValuesMany:ne.addMany,setAssetTypeFieldValues:ne.setOne,setAssetTypeFieldValuesMany:ne.setMany,updateAssetTypeFieldValues:ne.updateOne,updateAssetTypeFieldValuesMany:ne.updateMany,deleteAssetTypeFieldValues:ne.deleteOne,deleteAssetTypeFieldValuesMany:ne.deleteMany}}),{initializeAssetTypeFieldValues:hd,addAssetTypeFieldValues:ui,addAssetTypeFieldValuesMany:md,setAssetTypeFieldValues:uf,setAssetTypeFieldValuesMany:of,updateAssetTypeFieldValues:st,updateAssetTypeFieldValuesMany:pd,deleteAssetTypeFieldValues:oi,deleteAssetTypeFieldValuesMany:Ad}=di.actions,fd=t=>t.assetTypeFieldValuesReducer.instances,li=d.createSelector([fd],t=>Object.values(t)),lf=y(d.createSelector([li,(t,e)=>e],(t,e)=>g(t.filter(i=>i.asset===e)))),hf=y(d.createSelector([Tt,li,(t,e)=>e],(t,e,i)=>{const a=new Set(t.filter(c=>c.asset_type===i).map(c=>c.uuid));return g(e.filter(c=>a.has(c.fields_revision)))})),hi=t=>e=>e.assetTypeFieldValuesReducer.instances[t],yd=di.reducer,re=I(t=>t.uuid),Sd=re.getInitialState({}),mi=d.createSlice({name:"assetTypes",initialState:Sd,extraReducers:t=>t.addMatcher(d.isAnyOf(F,O),e=>Object.assign(e,Sd)),reducers:{initializeAssetTypes:re.initialize,setAssetType:re.setOne,setAssetTypes:re.setMany,addAssetType:re.addOne,addAssetTypes:re.addMany,updateAssetType:re.updateOne,updateAssetTypes:re.updateMany,deleteAssetType:re.deleteOne,deleteAssetTypes:re.deleteMany}}),{initializeAssetTypes:gd,setAssetType:mf,setAssetTypes:pf,addAssetType:pi,addAssetTypes:Af,updateAssetType:it,updateAssetTypes:ff,deleteAssetType:Ai,deleteAssetTypes:yf}=mi.actions,fi=t=>t.assetTypeReducer.instances,bd=d.createSelector([fi],t=>Object.values(t)),yi=t=>e=>e.assetTypeReducer.instances[t],Sf=y(d.createSelector([fi,(t,e)=>e],(t,e)=>{const i=[];for(const a of e){const c=t[a];c?i.push(c):console.warn("selectAssetTypesByIds: No assetType exists with the id",a)}return g(i)})),gf=y(d.createSelector([bd,(t,e)=>e],(t,e)=>g(t.filter(i=>i.organization===e)))),Pd=mi.reducer,Fd={accessToken:"",refreshToken:"",isLoggedIn:!1},_t=d.createSlice({name:"auth",initialState:Fd,extraReducers:t=>t.addCase(F,e=>Object.assign(e,Fd)),reducers:{setTokens:(t,e)=>{t.accessToken=e.payload.accessToken,t.refreshToken=e.payload.refreshToken},clearTokens:t=>{t.accessToken="",t.refreshToken=""},setLoggedIn:(t,e)=>{e.payload||_t.caseReducers.clearTokens(t),t.isLoggedIn=e.payload}}}),{setTokens:bf,clearTokens:Pf,setLoggedIn:Td}=_t.actions,Ff=t=>t.authReducer.accessToken,Tf=t=>t.authReducer.isLoggedIn,Id=_t.reducer,de=I(t=>t.uuid),Od=de.getInitialState({}),Si=d.createSlice({name:"categories",initialState:Od,extraReducers:t=>t.addMatcher(d.isAnyOf(F,O),e=>Object.assign(e,Od)),reducers:{initializeCategories:de.initialize,addCategory:de.addOne,addCategories:de.addMany,setCategory:de.setOne,setCategories:de.setMany,updateCategory:de.updateOne,updateCategories:de.updateMany,deleteCategory:de.deleteOne,deleteCategories:de.deleteMany}}),{initializeCategories:_d,addCategory:gi,addCategories:If,setCategory:Of,setCategories:_f,updateCategory:Rd,updateCategories:Rf,deleteCategory:vd,deleteCategories:vf}=Si.actions,bi=t=>t.categoryReducer.instances,wd=d.createSelector([bi],t=>Object.values(t)),Pi=t=>e=>e.categoryReducer.instances[t],wf=y(d.createSelector([bi,(t,e)=>e],(t,e)=>{const i=[];for(const a of e){const c=t[a];c?i.push(c):console.warn("selectCategoryByIds: No category exists with the id",a)}return g(i)})),Mf=y(d.createSelector([wd,(t,e)=>e],(t,e)=>g(t.filter(i=>i.project===e)))),Md=Si.reducer,ue=I(t=>t.uuid),Ed=ue.getInitialState({}),Fi=d.createSlice({name:"documentAttachments",initialState:Ed,extraReducers:t=>t.addCase(F,e=>Object.assign(e,Ed)),reducers:{initializeDocumentAttachments:ue.initialize,addDocumentAttachment:ue.addOne,addDocumentAttachments:ue.addMany,setDocumentAttachment:ue.setOne,setDocumentAttachments:ue.setMany,updateDocumentAttachment:ue.updateOne,updateDocumentAttachments:ue.updateMany,deleteDocumentAttachment:ue.deleteOne,deleteDocumentAttachments:ue.deleteMany}}),{initializeDocumentAttachments:jd,addDocumentAttachment:Ef,addDocumentAttachments:qd,setDocumentAttachment:Vd,setDocumentAttachments:jf,updateDocumentAttachment:qf,updateDocumentAttachments:zd,deleteDocumentAttachment:Ud,deleteDocumentAttachments:Dd}=Fi.actions,Cd=t=>t.documentAttachmentReducer.instances,kd=d.createSelector([Cd],t=>Object.values(t)),Bd=t=>e=>e.documentAttachmentReducer.instances[t],Vf=y(d.createSelector([kd,(t,e)=>e],(t,e)=>g(t.filter(({document:i})=>e===i)))),Gd=Fi.reducer,$d={documents:{}},Ti=d.createSlice({name:"documents",initialState:$d,extraReducers:t=>t.addCase(F,e=>{Object.assign(e,$d)}),reducers:{setDocuments:(t,e)=>{if(e.payload.filter(Rc).length!==e.payload.length)throw new Error("Tried to use setIssues reducer with duplicate ID's");t.documents=_c(e.payload)},addDocuments:(t,e)=>{for(const i of e.payload)if(i.uuid in t.documents)throw new Error(`attempting to add a document with uuid ${i.uuid} which already exists in state.documents.`);for(const i of e.payload){if(i.parent_document&&t.documents[i.parent_document]){const a=t.documents[i.parent_document];t.documents[i.parent_document]={...a,children_documents:[...a.children_documents,i.uuid]}}t.documents[i.uuid]=i}},updateDocuments:(t,e)=>{for(const i of e.payload)if(!(i.uuid in t.documents))throw new Error(`attempting to update a document with uuid ${i.uuid} which doesn't exists in state.documents.`);for(const i of e.payload){const a=t.documents[i.uuid];if(i.organization!==void 0&&i.organization!==a.organization)throw new Error("organization cannot be updated");if(i.project!==void 0&&i.project!==a.project)throw new Error("project cannot be updated");t.documents[i.uuid]={...a,...i}}},removeDocuments:(t,e)=>{for(const i of e.payload)if(!(i in t.documents))throw new Error(`attempting to delete a document with uuid ${i} which doesn't exists in state.documents.`);for(const i of e.payload){const a=t.documents[i];if(a.parent_document&&t.documents[a.parent_document]){const c=t.documents[a.parent_document];t.documents[a.parent_document]={...c,children_documents:c.children_documents.filter(n=>n!==a.uuid)}}delete t.documents[i]}}}}),{setDocuments:Ld,addDocuments:Nd,updateDocuments:We,removeDocuments:Ii}=Ti.actions,Rt=t=>t.documentsReducer.documents,Oi=d.createSelector([Rt],t=>Object.values(t)),Hd=t=>e=>e.documentsReducer.documents[t],zf=y(d.createSelector([Rt,(t,e)=>e],(t,e)=>{const i=[];for(const a of e){const c=t[a];c?i.push(c):console.warn("selectDocumentByIds: No document exists with the id",a)}return g(i)})),Uf=y(d.createSelector([Oi,(t,e)=>e],(t,e)=>t.filter(i=>i.project===e))),Df=y(d.createSelector([Oi,(t,e)=>e],(t,e)=>t.filter(i=>i.organization===e))),Wd=Ti.reducer,oe=I(t=>t.uuid),Yd=oe.getInitialState({}),_i=d.createSlice({name:"emailDomains",initialState:Yd,extraReducers:t=>t.addMatcher(d.isAnyOf(F,O),e=>Object.assign(e,Yd)),reducers:{initializeEmailDomains:oe.initialize,addEmailDomain:oe.addOne,addEmailDomains:oe.addMany,setEmailDomain:oe.setOne,setEmailDomains:oe.setMany,updateEmailDomain:oe.updateOne,updateEmailDomains:oe.updateMany,deleteEmailDomain:oe.deleteOne,deleteEmailDomains:oe.deleteMany}}),{initializeEmailDomains:Kd,addEmailDomain:Zd,addEmailDomains:Cf,setEmailDomain:kf,setEmailDomains:Bf,updateEmailDomain:Gf,updateEmailDomains:$f,deleteEmailDomain:Jd,deleteEmailDomains:Lf}=_i.actions,Xd=t=>t.emailDomainsReducer.instances,Qd=d.createSelector([Xd],t=>Object.values(t)),Nf=y(d.createSelector([Qd,(t,e)=>e],(t,e)=>g(t.filter(i=>i.organization===e)))),xd=_i.reducer,eu={s3Urls:{}},tu=1e3*60*60,Hf=tu*24*7,Ri=d.createSlice({name:"file",initialState:eu,extraReducers:t=>t.addCase(F,e=>Object.assign(e,eu)),reducers:{setUploadUrl:(t,e)=>{const{url:i,fields:a,sha1:c}=e.payload,n=new Date,r=new Date(n.getTime()+Hf);t.s3Urls[c]={url:i,fields:a,exp:r.getTime()}}}}),{setUploadUrl:su}=Ri.actions,iu=t=>e=>{const i=e.fileReducer.s3Urls[t];if(!i)return;const a=new Date().getTime();if(!((i.exp??a)-a<tu))return i},au=Ri.reducer,le=I(t=>t.uuid),cu=le.getInitialState({}),vi=d.createSlice({name:"formRevisionAttachments",initialState:cu,extraReducers:t=>t.addMatcher(d.isAnyOf(F,O),e=>Object.assign(e,cu)),reducers:{initializeFormRevisionAttachments:le.initialize,addFormRevisionAttachment:le.addOne,addFormRevisionAttachments:le.addMany,setFormRevisionAttachment:le.setOne,setFormRevisionAttachments:le.setMany,updateFormRevisionAttachment:le.updateOne,updateFormRevisionAttachments:le.updateMany,deleteFormRevisionAttachment:le.deleteOne,deleteFormRevisionAttachments:le.deleteMany}}),{initializeFormRevisionAttachments:nu,addFormRevisionAttachment:Wf,addFormRevisionAttachments:ru,setFormRevisionAttachment:Yf,setFormRevisionAttachments:Kf,updateFormRevisionAttachment:Zf,updateFormRevisionAttachments:du,deleteFormRevisionAttachment:Jf,deleteFormRevisionAttachments:uu}=vi.actions,ou=t=>t.formRevisionAttachmentReducer.instances,Xf=y(d.createSelector([ou,(t,e)=>e],(t,e)=>g(Object.values(t).filter(i=>i.form_revision===e)))),lu=vi.reducer,he=I(t=>t.uuid),hu=he.getInitialState({}),wi=d.createSlice({name:"formRevisions",initialState:hu,extraReducers:t=>t.addMatcher(d.isAnyOf(F,O),e=>Object.assign(e,hu)),reducers:{initializeFormRevisions:he.initialize,addFormRevision:he.addOne,addFormRevisions:he.addMany,setFormRevision:he.setOne,setFormRevisions:he.setMany,updateFormRevision:he.updateOne,updateFormRevisions:he.updateMany,deleteFormRevision:he.deleteOne,deleteFormRevisions:he.deleteMany}}),{initializeFormRevisions:mu,addFormRevision:Mi,addFormRevisions:pu,setFormRevision:Au,setFormRevisions:Qf,updateFormRevision:xf,updateFormRevisions:ey,deleteFormRevision:Ei,deleteFormRevisions:fu}=wi.actions,ji=t=>t.formRevisionReducer.instances,qi=d.createSelector([ji],t=>Object.values(t)),ty=t=>e=>e.formRevisionReducer.instances[t],sy=y(d.createSelector([qi,(t,e)=>e],(t,e)=>t.filter(i=>i.form===e).sort((i,a)=>i.submitted_at>a.submitted_at?-1:1)[0])),yu=y(d.createSelector([qi,(t,e)=>e],(t,e)=>g(t.filter(i=>i.form===e)))),Su=wi.reducer,me=I(t=>t.uuid),gu=me.getInitialState({}),Vi=d.createSlice({name:"forms",initialState:gu,extraReducers:t=>t.addMatcher(d.isAnyOf(F,O),e=>Object.assign(e,gu)),reducers:{initializeForms:me.initialize,addForm:me.addOne,addForms:me.addMany,setForm:me.setOne,setForms:me.setMany,updateForm:me.updateOne,updateForms:me.updateMany,deleteForm:me.deleteOne,deleteForms:me.deleteMany}}),{initializeForms:bu,addForm:zi,addForms:iy,setForm:ay,setForms:cy,updateForm:ny,updateForms:ry,deleteForm:Ui,deleteForms:dy}=Vi.actions,Pu=Vi.reducer,Fu=t=>t.formReducer.instances,Tu=d.createSelector([Fu],t=>Object.values(t)),Iu=t=>e=>e.formReducer.instances[t],uy=y(d.createSelector([Tu,(t,e)=>e],(t,e)=>g(t.filter(i=>i.organization===e)))),pe=I(t=>t.uuid),Ou=pe.getInitialState({}),Di=d.createSlice({name:"formSubmissionAttachments",initialState:Ou,extraReducers:t=>t.addMatcher(d.isAnyOf(F,M,O),e=>Object.assign(e,Ou)),reducers:{initializeFormSubmissionAttachments:pe.initialize,addFormSubmissionAttachment:pe.addOne,addFormSubmissionAttachments:pe.addMany,setFormSubmissionAttachment:pe.setOne,setFormSubmissionAttachments:pe.setMany,updateFormSubmissionAttachment:pe.updateOne,updateFormSubmissionAttachments:pe.updateMany,deleteFormSubmissionAttachment:pe.deleteOne,deleteFormSubmissionAttachments:pe.deleteMany}}),{initializeFormSubmissionAttachments:_u,addFormSubmissionAttachment:oy,addFormSubmissionAttachments:vt,setFormSubmissionAttachment:ly,setFormSubmissionAttachments:hy,updateFormSubmissionAttachment:my,updateFormSubmissionAttachments:Ru,deleteFormSubmissionAttachment:py,deleteFormSubmissionAttachments:wt}=Di.actions,vu=t=>t.formSubmissionAttachmentReducer.instances,Ci=d.createSelector([vu],t=>Object.values(t)),wu=y(d.createSelector([Ci,(t,e)=>e],(t,e)=>{const i=new Set(e);return g(t.filter(a=>i.has(a.uuid)))})),Mu=y(d.createSelector([Ci,(t,e)=>e],(t,e)=>g(t.filter(i=>i.form_submission===e)))),Eu=Di.reducer,Ae=I(t=>t.uuid),ju=Ae.getInitialState({}),ki=d.createSlice({name:"formSubmissions",initialState:ju,extraReducers:t=>t.addMatcher(d.isAnyOf(F,M,O),e=>Object.assign(e,ju)),reducers:{initializeFormSubmissions:Ae.initialize,setFormSubmission:Ae.setOne,setFormSubmissions:Ae.setMany,addFormSubmission:Ae.addOne,addFormSubmissions:Ae.addMany,updateFormSubmission:Ae.updateOne,updateFormSubmissions:Ae.updateMany,deleteFormSubmission:Ae.deleteOne,deleteFormSubmissions:Ae.deleteMany}}),{initializeFormSubmissions:qu,setFormSubmission:Mt,setFormSubmissions:Ay,addFormSubmission:Bi,addFormSubmissions:Et,updateFormSubmission:Vu,updateFormSubmissions:fy,deleteFormSubmission:Gi,deleteFormSubmissions:jt}=ki.actions,$i=t=>t.formSubmissionReducer.instances,Li=d.createSelector([$i],t=>Object.values(t)),Ni=t=>e=>e.formSubmissionReducer.instances[t],zu=y(d.createSelector([$i,ji,(t,e)=>e],(t,e,i)=>{const a=new Set;for(const c of Object.values(e))c.form===i&&a.add(c.uuid);return Object.values(t).filter(c=>a.has(c.form_revision))})),Uu=y(d.createSelector([Li,(t,e)=>e],(t,e)=>Object.values(t).filter(i=>i.issue===e))),Du=y(d.createSelector([Li,(t,e)=>e],(t,e)=>t.filter(i=>i.asset===e))),Cu=ki.reducer,fe=I(t=>t.uuid),ku=fe.getInitialState({}),Hi=d.createSlice({name:"geoImages",initialState:ku,extraReducers:t=>t.addMatcher(d.isAnyOf(F,M,O),e=>Object.assign(e,ku)),reducers:{initializeGeoImages:fe.initialize,setGeoImage:fe.setOne,setGeoImages:fe.setMany,addGeoImage:fe.addOne,addGeoImages:fe.addMany,updateGeoImage:fe.updateOne,updateGeoImages:fe.updateMany,deleteGeoImage:fe.deleteOne,deleteGeoImages:fe.deleteMany}}),{initializeGeoImages:Bu,setGeoImage:at,setGeoImages:Gu,addGeoImage:$u,addGeoImages:Lu,updateGeoImage:Nu,updateGeoImages:yy,deleteGeoImage:Wi,deleteGeoImages:Hu}=Hi.actions,Wu=t=>t.geoImageReducer.instances,Yu=d.createSelector([Wu],t=>Object.values(t)),Yi=t=>e=>e.geoImageReducer.instances[t],Sy=y(d.createSelector([Yu,(t,e)=>e],(t,e)=>g(t.filter(i=>i.project===e)))),Ku=Hi.reducer,ye=I(t=>t.uuid),Zu=ye.getInitialState({}),Ki=d.createSlice({name:"issueAssociations",initialState:Zu,extraReducers:t=>t.addMatcher(d.isAnyOf(F,M,O),e=>Object.assign(e,Zu)),reducers:{initializeIssueAssociations:ye.initialize,addIssueAssociation:ye.addOne,addIssueAssociations:ye.addMany,setIssueAssociation:ye.setOne,setIssueAssociations:ye.setMany,updateIssueAssociation:ye.updateOne,updateIssueAssociations:ye.updateMany,deleteIssueAssociation:ye.deleteOne,deleteIssueAssociations:ye.deleteMany}}),{initializeIssueAssociations:Ju,setIssueAssociations:gy,setIssueAssociation:by,updateIssueAssociation:Xu,updateIssueAssociations:Py,addIssueAssociation:Zi,addIssueAssociations:Ji,deleteIssueAssociation:Xi,deleteIssueAssociations:Qi}=Ki.actions,ct=t=>t.issueAssociationReducer.instances,Fy=d.createSelector([ct],t=>Object.values(t)),Qu=t=>e=>e.issueAssociationReducer.instances[t],xu=y(d.createSelector([ct,(t,e)=>e],(t,e)=>g(Object.values(t).filter(i=>i.associated_issue===e)))),eo=y(d.createSelector([ct,(t,e)=>e],(t,e)=>g(Object.values(t).filter(i=>i.issue===e)))),to=y(d.createSelector([ct,(t,e)=>e],(t,e)=>g(Object.values(t).filter(i=>i.asset===e)))),so=Ki.reducer,Se=I(t=>t.uuid),io=Se.getInitialState({}),xi=d.createSlice({name:"issueAttachments",initialState:io,extraReducers:t=>t.addMatcher(d.isAnyOf(F,M,O),e=>Object.assign(e,io)),reducers:{initializeIssueAttachments:Se.initialize,addIssueAttachment:Se.addOne,addIssueAttachments:Se.addMany,setIssueAttachment:Se.setOne,setIssueAttachments:Se.setMany,updateIssueAttachment:Se.updateOne,updateIssueAttachments:Se.updateMany,deleteIssueAttachment:Se.deleteOne,deleteIssueAttachments:Se.deleteMany}}),{initializeIssueAttachments:ea,addIssueAttachment:Ty,addIssueAttachments:ta,setIssueAttachment:ao,setIssueAttachments:Iy,updateIssueAttachment:Oy,updateIssueAttachments:co,deleteIssueAttachment:no,deleteIssueAttachments:sa}=xi.actions,ro=t=>t.issueAttachmentReducer.instances,uo=d.createSelector([ro],t=>Object.values(t)),oo=y(d.createSelector([uo,(t,e)=>e],(t,e)=>g(t.filter(({issue:i})=>e===i)))),lo=t=>e=>e.issueAttachmentReducer.instances[t],ho=xi.reducer,ge=I(t=>t.uuid),mo=ge.getInitialState({}),ia=d.createSlice({name:"issueCommentAttachments",initialState:mo,extraReducers:t=>t.addMatcher(d.isAnyOf(F,M,O),e=>Object.assign(e,mo)),reducers:{initializeIssueCommentAttachments:ge.initialize,addIssueCommentAttachment:ge.addOne,addIssueCommentAttachments:ge.addMany,setIssueCommentAttachment:ge.setOne,setIssueCommentAttachments:ge.setMany,updateIssueCommentAttachment:ge.updateOne,updateIssueCommentAttachments:ge.updateMany,deleteIssueCommentAttachment:ge.deleteOne,deleteIssueCommentAttachments:ge.deleteMany}}),{initializeIssueCommentAttachments:aa,addIssueCommentAttachment:_y,addIssueCommentAttachments:po,setIssueCommentAttachment:Ao,setIssueCommentAttachments:Ry,updateIssueCommentAttachment:vy,updateIssueCommentAttachments:fo,deleteIssueCommentAttachment:yo,deleteIssueCommentAttachments:So}=ia.actions,go=t=>t.issueCommentAttachmentReducer.instances,bo=d.createSelector([go],t=>Object.values(t)),Po=t=>e=>e.issueCommentAttachmentReducer.instances[t],wy=y(d.createSelector([bo,(t,e)=>e],(t,e)=>g(t.filter(({issue_comment:i})=>e===i)))),Fo=ia.reducer,be=I(t=>t.uuid),To=be.getInitialState({}),ca=d.createSlice({name:"issueComments",initialState:To,extraReducers:t=>t.addMatcher(d.isAnyOf(F,M,O),e=>Object.assign(e,To)),reducers:{initializeIssueComments:be.initialize,addIssueComment:be.addOne,addIssueComments:be.addMany,setIssueComment:be.setOne,setIssueComments:be.setMany,updateIssueComment:be.updateOne,updateIssueComments:be.updateMany,deleteIssueComment:be.deleteOne,deleteIssueComments:be.deleteMany}}),{initializeIssueComments:My,addIssueComment:na,addIssueComments:Ey,setIssueComment:ra,setIssueComments:Io,updateIssueComment:jy,updateIssueComments:qy,deleteIssueComment:da,deleteIssueComments:Vy}=ca.actions,Oo=t=>t.issueCommentReducer.instances,ua=t=>e=>e.issueCommentReducer.instances[t],zy=y(d.createSelector([Oo,(t,e)=>e],(t,e)=>g(Object.values(t).filter(i=>i.issue===e)))),_o=ca.reducer,Pe=I(t=>t.uuid),Ro=Pe.getInitialState({}),oa=d.createSlice({name:"issues",initialState:Ro,extraReducers:t=>t.addMatcher(d.isAnyOf(F,M,O),e=>Object.assign(e,Ro)),reducers:{initializeIssues:Pe.initialize,addIssue:Pe.addOne,addIssues:Pe.addMany,setIssue:Pe.setOne,setIssues:Pe.setMany,updateIssue:Pe.updateOne,updateIssues:Pe.updateMany,deleteIssue:Pe.deleteOne,deleteIssues:Pe.deleteMany}}),{initializeIssues:vo,addIssue:la,addIssues:wo,setIssue:Uy,setIssues:Dy,updateIssue:qt,updateIssues:Cy,deleteIssue:ha,deleteIssues:Mo}=oa.actions,ma=t=>t.issueReducer.instances,pa=d.createSelector([ma],t=>Object.values(t)),Aa=t=>e=>e.issueReducer.instances[t],ky=y(d.createSelector([ma,(t,e)=>e],(t,e)=>{const i=[];for(const a of e){const c=t[a];c?i.push(c):console.warn("selectIssuesByIds: No issue exists with the id",a)}return g(i)})),By=y(d.createSelector([pa,(t,e)=>e],(t,e)=>t.filter(i=>i.project===e))),Eo=y(d.createSelector([pa,(t,e)=>e],(t,e)=>t.filter(i=>i.issue_type===e))),jo=oa.reducer,Fe=I(t=>t.uuid),qo=Fe.getInitialState({}),fa=d.createSlice({name:"issueTypeAttachments",initialState:qo,extraReducers:t=>t.addMatcher(d.isAnyOf(F,O),e=>Object.assign(e,qo)),reducers:{initializeIssueTypeAttachments:Fe.initialize,addIssueTypeAttachment:Fe.addOne,addIssueTypeAttachments:Fe.addMany,setIssueTypeAttachment:Fe.setOne,setIssueTypeAttachments:Fe.setMany,updateIssueTypeAttachment:Fe.updateOne,updateIssueTypeAttachments:Fe.updateMany,deleteIssueTypeAttachment:Fe.deleteOne,deleteIssueTypeAttachments:Fe.deleteMany}}),{initializeIssueTypeAttachments:ya,addIssueTypeAttachment:Gy,addIssueTypeAttachments:Vo,setIssueTypeAttachment:zo,setIssueTypeAttachments:$y,updateIssueTypeAttachment:Ly,updateIssueTypeAttachments:Uo,deleteIssueTypeAttachment:Do,deleteIssueTypeAttachments:Co}=fa.actions,ko=t=>t.issueTypeAttachmentReducer.instances,Bo=d.createSelector([ko],t=>Object.values(t)),Go=t=>e=>e.issueTypeAttachmentReducer.instances[t],Ny=y(d.createSelector([Bo,(t,e)=>e],(t,e)=>g(t.filter(({issue_type:i})=>e===i)))),$o=fa.reducer,Te=I(t=>t.uuid),Lo=Te.getInitialState({}),Sa=d.createSlice({name:"issueTypeFieldsAttachments",initialState:Lo,extraReducers:t=>t.addMatcher(d.isAnyOf(F,O),e=>Object.assign(e,Lo)),reducers:{initializeIssueTypeFieldsAttachments:Te.initialize,addIssueTypeFieldsAttachment:Te.addOne,addIssueTypeFieldsAttachments:Te.addMany,setIssueTypeFieldsAttachment:Te.setOne,setIssueTypeFieldsAttachments:Te.setMany,updateIssueTypeFieldsAttachment:Te.updateOne,updateIssueTypeFieldsAttachments:Te.updateMany,deleteIssueTypeFieldsAttachment:Te.deleteOne,deleteIssueTypeFieldsAttachments:Te.deleteMany}}),{initializeIssueTypeFieldsAttachments:No,addIssueTypeFieldsAttachment:Hy,addIssueTypeFieldsAttachments:Ho,setIssueTypeFieldsAttachment:Wy,setIssueTypeFieldsAttachments:Yy,updateIssueTypeFieldsAttachment:Ky,updateIssueTypeFieldsAttachments:Wo,deleteIssueTypeFieldsAttachment:Zy,deleteIssueTypeFieldsAttachments:Yo}=Sa.actions,Ko=t=>t.issueTypeFieldsAttachmentReducer.instances,Zo=d.createSelector([Ko],t=>Object.values(t)),Jy=y(d.createSelector([Zo,(t,e)=>e],(t,e)=>g(t.filter(i=>i.fields_revision===e)))),Xy=t=>e=>e.issueTypeFieldsAttachmentReducer.instances[t],Jo=Sa.reducer,Ie=I(t=>t.uuid),Xo=Ie.getInitialState({}),ga=d.createSlice({name:"issueTypeFieldValues",initialState:Xo,extraReducers:t=>t.addMatcher(d.isAnyOf(F,M,O),e=>Object.assign(e,Xo)),reducers:{initializeIssueTypeFieldValues:Ie.initialize,addIssueTypeFieldValues:Ie.addOne,addIssueTypeFieldValuesMany:Ie.addMany,setIssueTypeFieldValues:Ie.setOne,setIssueTypeFieldValuesMany:Ie.setMany,updateIssueTypeFieldValues:Ie.updateOne,updateIssueTypeFieldValuesMany:Ie.updateMany,deleteIssueTypeFieldValues:Ie.deleteOne,deleteIssueTypeFieldValuesMany:Ie.deleteMany}}),{initializeIssueTypeFieldValues:Qo,addIssueTypeFieldValues:ba,addIssueTypeFieldValuesMany:Qy,setIssueTypeFieldValues:xy,setIssueTypeFieldValuesMany:eS,updateIssueTypeFieldValues:nt,updateIssueTypeFieldValuesMany:tS,deleteIssueTypeFieldValues:Pa,deleteIssueTypeFieldValuesMany:sS}=ga.actions,xo=t=>t.issueTypeFieldValuesReducer.instances,Fa=d.createSelector([xo],t=>Object.values(t)),iS=y(d.createSelector([Fa,(t,e)=>e],(t,e)=>g(t.filter(i=>i.issue===e)))),Ta=t=>e=>e.issueTypeFieldValuesReducer.instances[t],el=ga.reducer,Oe=I(t=>t.uuid),tl=Oe.getInitialState({}),Ia=d.createSlice({name:"issueTypeFields",initialState:tl,extraReducers:t=>t.addMatcher(d.isAnyOf(F,O),e=>Object.assign(e,tl)),reducers:{initializeIssueTypeFields:Oe.initialize,addIssueTypeFields:Oe.addOne,addIssueTypeFieldsMany:Oe.addMany,setIssueTypeFields:Oe.setOne,setIssueTypeFieldsMany:Oe.setMany,updateIssueTypeFields:Oe.updateOne,updateIssueTypeFieldsMany:Oe.updateMany,deleteIssueTypeFields:Oe.deleteOne,deleteIssueTypeFieldsMany:Oe.deleteMany}}),{initializeIssueTypeFields:sl,addIssueTypeFields:il,addIssueTypeFieldsMany:aS,setIssueTypeFields:cS,setIssueTypeFieldsMany:nS,updateIssueTypeFields:al,updateIssueTypeFieldsMany:rS,deleteIssueTypeFields:cl,deleteIssueTypeFieldsMany:dS}=Ia.actions,nl=t=>t.issueTypeFieldsReducer.instances,Vt=d.createSelector([nl],t=>Object.values(t)),uS=y(d.createSelector([Vt,(t,e)=>e],(t,e)=>g(t.filter(i=>i.issue_type===e)))),oS=y(d.createSelector([Vt,(t,e)=>e],(t,e)=>t.filter(i=>i.issue_type===e).sort((i,a)=>i.submitted_at>a.submitted_at?-1:1)[0])),lS=y(d.createSelector([Vt,Fa,(t,e)=>e],(t,e,i)=>{const a=new Set(t.filter(c=>c.issue_type===i).map(c=>c.uuid));return g(e.filter(c=>a.has(c.fields_revision)))})),hS=t=>e=>e.issueTypeFieldsReducer.instances[t],rl=Ia.reducer,_e=I(t=>t.uuid),dl=_e.getInitialState({}),Oa=d.createSlice({name:"issueTypeFieldValuesAttachments",initialState:dl,extraReducers:t=>t.addMatcher(d.isAnyOf(F,M,O),e=>Object.assign(e,dl)),reducers:{initializeIssueTypeFieldValuesAttachments:_e.initialize,addIssueTypeFieldValuesAttachment:_e.addOne,addIssueTypeFieldValuesAttachments:_e.addMany,setIssueTypeFieldValuesAttachment:_e.setOne,setIssueTypeFieldValuesAttachments:_e.setMany,updateIssueTypeFieldValuesAttachment:_e.updateOne,updateIssueTypeFieldValuesAttachments:_e.updateMany,deleteIssueTypeFieldValuesAttachment:_e.deleteOne,deleteIssueTypeFieldValuesAttachments:_e.deleteMany}}),{initializeIssueTypeFieldValuesAttachments:ul,addIssueTypeFieldValuesAttachment:mS,addIssueTypeFieldValuesAttachments:zt,setIssueTypeFieldValuesAttachment:pS,setIssueTypeFieldValuesAttachments:AS,updateIssueTypeFieldValuesAttachment:fS,updateIssueTypeFieldValuesAttachments:ol,deleteIssueTypeFieldValuesAttachment:yS,deleteIssueTypeFieldValuesAttachments:Ut}=Oa.actions,ll=t=>t.issueTypeFieldValuesAttachmentReducer.instances,_a=d.createSelector([ll],t=>Object.values(t)),SS=t=>e=>e.issueTypeFieldValuesAttachmentReducer.instances[t],hl=y(d.createSelector([_a,(t,e)=>e],(t,e)=>{const i=new Set(e);return g(t.filter(a=>i.has(a.uuid)))})),ml=y(d.createSelector([_a,(t,e)=>e],(t,e)=>g(t.filter(i=>i.field_values===e)))),pl=Oa.reducer,C=I(t=>t.uuid),Al=C.getInitialState({}),Ra=d.createSlice({name:"issueTypes",initialState:Al,extraReducers:t=>t.addMatcher(d.isAnyOf(F,O),e=>Object.assign(e,Al)),reducers:{initializeIssueTypes:C.initialize,addIssueType:C.addOne,addIssueTypes:C.addMany,setIssueType:C.setOne,setIssueTypes:C.setMany,updateIssueType:C.updateOne,updateIssueTypes:C.updateMany,deleteIssueType:C.deleteOne,deleteIssueTypes:C.deleteMany,removeIssueType:C.deleteOne}}),{initializeIssueTypes:fl,addIssueType:yl,addIssueTypes:gS,setIssueType:rt,setIssueTypes:bS,updateIssueType:Sl,updateIssueTypes:PS,deleteIssueType:FS,deleteIssueTypes:TS,removeIssueType:va}=Ra.actions,wa=t=>t.issueTypeReducer.instances,gl=d.createSelector(wa,t=>Object.values(t)),Ma=t=>e=>e.issueTypeReducer.instances[t],IS=y(d.createSelector([wa,(t,e)=>e],(t,e)=>{const i=[];for(const a of e){const c=t[a];c?i.push(c):console.warn("selectIssueTypesByIds: No issue type exists with the id",a)}return i})),OS=y(d.createSelector([gl,(t,e)=>e],(t,e)=>g(t.filter(i=>i.organization===e)))),bl=Ra.reducer,Re=I(t=>t.uuid),Pl=Re.getInitialState({}),Ea=d.createSlice({name:"issueUpdates",initialState:Pl,extraReducers:t=>t.addMatcher(d.isAnyOf(F,M,O),e=>Object.assign(e,Pl)),reducers:{initializeIssueUpdates:Re.initialize,addIssueUpdate:Re.addOne,addIssueUpdates:Re.addMany,setIssueUpdate:Re.setOne,setIssueUpdates:Re.setMany,updateIssueUpdate:Re.updateOne,updateIssueUpdates:Re.updateMany,deleteIssueUpdate:Re.deleteOne,deleteIssueUpdates:Re.deleteMany}}),{initializeIssueUpdates:Fl,addIssueUpdate:Tl,addIssueUpdates:Il,setIssueUpdate:_S,setIssueUpdates:RS,updateIssueUpdate:vS,updateIssueUpdates:wS,deleteIssueUpdate:Ol,deleteIssueUpdates:_l}=Ea.actions,Rl=t=>t.issueUpdateReducer.instances,vl=d.createSelector([Rl],t=>Object.values(t)),wl=y(d.createSelector([vl,(t,e)=>e],(t,e)=>g(t.filter(i=>i.issue===e)))),Ml=Ea.reducer,ve=I(t=>t.id),El=ve.getInitialState({currentUser:null}),ja=d.createSlice({name:"users",initialState:El,extraReducers:t=>t.addMatcher(d.isAnyOf(F,O),e=>Object.assign(e,El)),reducers:{initializeUsers:ve.initialize,setUsers:ve.setMany,setUser:ve.setOne,addUsers:ve.addMany,addUser:ve.addOne,updateUsers:ve.updateMany,updateUser:ve.updateOne,deleteUser:ve.deleteOne,deleteUsers:ve.deleteMany,setCurrentUser:(t,e)=>{t.currentUser=e.payload},setProfilePicture:(t,e)=>{if(!t.currentUser)return;t.currentUser.profile.file=e.payload.file??null,t.currentUser.profile.file_sha1=e.payload.file_sha1??null;const i=t.instances[t.currentUser.id];if(!i)throw new Error("Unable to find current user in users slice");i.profile.file=e.payload.file??null,i.profile.file_sha1=e.payload.file_sha1??null}}}),{initializeUsers:jl,setUsers:MS,setUser:ES,addUsers:jS,addUser:ql,updateUsers:qS,updateUser:VS,deleteUser:Vl,deleteUsers:zS,setCurrentUser:US,setProfilePicture:DS}=ja.actions,zl=ja.reducer,Ul=t=>t.userReducer.currentUser,Dt=t=>t.userReducer.instances,qa=d.createSelector([Dt],t=>Object.values(t)),Dl=t=>e=>e.userReducer.instances[t],CS=y(d.createSelector([Dt,(t,e)=>e],(t,e)=>{const i=[];for(const a of e){const c=t[a];c?i.push(c):console.warn("selectUsersByIds: No user exists with the id",a)}return g(i)})),we=I(t=>t.uuid),Cl=we.getInitialState({}),Va=d.createSlice({name:"organizationAccess",initialState:Cl,extraReducers:t=>t.addMatcher(d.isAnyOf(F,O),e=>Object.assign(e,Cl)),reducers:{initializeOrganizationAccesses:we.initialize,addOrganizationAccess:we.addOne,addOrganizationAccesses:we.addMany,setOrganizationAccess:we.setOne,setOrganizationAccesses:we.setMany,updateOrganizationAccess:we.updateOne,updateOrganizationAccesses:we.updateMany,deleteOrganizationAccess:we.deleteOne,deleteOrganizationAccesses:we.deleteMany}}),{initializeOrganizationAccesses:kl,addOrganizationAccess:Bl,addOrganizationAccesses:kS,setOrganizationAccess:BS,setOrganizationAccesses:GS,updateOrganizationAccess:Ct,updateOrganizationAccesses:$S,deleteOrganizationAccess:Gl,deleteOrganizationAccesses:LS}=Va.actions,$l=Va.reducer,za=t=>t.organizationAccessReducer.instances,Ua=t=>e=>e.organizationAccessReducer.instances[t],NS=d.createSelector([Ul,za],(t,e)=>Object.values(e).find(a=>a.user===(t==null?void 0:t.id))??null),Ll=d.createSelector([za],t=>{const e={};for(const i of Object.values(t))e[i.user]=i;return ht(e)}),HS=y(d.createSelector([Dt,Ll,(t,e)=>e],(t,e,i)=>g(Object.values(t).filter(a=>{const c=e[a.id];return!!c&&c.organization===i})))),Me=I(t=>t.uuid),Nl=Me.getInitialState({}),Da=d.createSlice({name:"organizations",initialState:Nl,extraReducers:t=>t.addMatcher(d.isAnyOf(F,O),e=>Object.assign(e,Nl)),reducers:{initializeOrganizations:Me.initialize,setOrganizations:Me.setMany,setOrganization:Me.setOne,addOrganizations:Me.addMany,addOrganization:Me.addOne,updateOrganizations:Me.updateMany,updateOrganization:Me.updateOne,deleteOrganization:Me.deleteOne,deleteOrganizations:Me.deleteMany}}),{initializeOrganizations:Hl,setOrganizations:WS,setOrganization:YS,addOrganizations:KS,addOrganization:Wl,updateOrganizations:ZS,updateOrganization:Yl,deleteOrganization:JS,deleteOrganizations:XS}=Da.actions,Kl=t=>t.organizationReducer.instances,QS=d.createSelector([Kl],t=>Object.values(t)),xS=t=>e=>e.organizationReducer.instances[t],Zl=Da.reducer,Jl=(t,e,i)=>{const a=t.uuid?t:{...t,uuid:Ne.v4()};return{payload:a,type:"",meta:{offline:{effect:{timestamp:new Date().toISOString(),request:a,BASE_URL:e,serviceName:i}}}}},Xl={deletedRequests:[],latestRetryTime:0},Ca=d.createSlice({name:"outbox",initialState:Xl,extraReducers:t=>t.addCase(F,e=>Object.assign(e,Xl)),reducers:{enqueueRequest:{reducer:(t,e)=>t,prepare:t=>{console.debug("Preparing to enqueue request",t);const{BASE_URL:e,serviceName:i,...a}=t;return Jl(a,e,i)}},markForDeletion(t,e){t.deletedRequests.push(e.payload)},markAsDeleted(t,e){const i=t.deletedRequests.indexOf(e.payload);i!==-1&&t.deletedRequests.splice(i,1)},_setLatestRetryTime:(t,e)=>{t.latestRetryTime=e.payload}}}),eg=t=>t.outboxReducer.deletedRequests,tg=t=>t.outboxReducer.latestRetryTime,{enqueueRequest:Ql,markForDeletion:sg,markAsDeleted:xl,_setLatestRetryTime:eh}=Ca.actions,th=Ca.reducer,Ee=I(t=>t.uuid),sh=Ee.getInitialState({}),ka=d.createSlice({name:"projectAccess",initialState:sh,extraReducers:t=>t.addMatcher(d.isAnyOf(F,O),e=>Object.assign(e,sh)),reducers:{initializeProjectAccesses:Ee.initialize,addProjectAccess:Ee.addOne,addProjectAccesses:Ee.addMany,setProjectAccess:Ee.setOne,setProjectAccesses:Ee.setMany,updateProjectAccess:Ee.updateOne,updateProjectAccesses:Ee.updateMany,deleteProjectAccess:Ee.deleteOne,deleteProjectAccesses:Ee.deleteMany}}),{initializeProjectAccesses:ih,addProjectAccess:Ba,addProjectAccesses:ah,setProjectAccess:ig,setProjectAccesses:ag,updateProjectAccess:dt,updateProjectAccesses:cg,deleteProjectAccess:Ga,deleteProjectAccesses:ch}=ka.actions,nh=ka.reducer,$a=t=>t.projectAccessReducer.instances,kt=d.createSelector($a,t=>Object.values(t)),La=t=>e=>e.projectAccessReducer.instances[t],rh=y(d.createSelector([$a,(t,e)=>e],(t,e)=>g(Object.values(t).filter(i=>i.project===e)))),ng=y(d.createSelector([kt,(t,e)=>e],(t,e)=>{const i={};for(const a of t.filter(c=>c.project===e))i[a.user]=a;return i})),rg=y(d.createSelector([qa,kt,(t,e)=>e],(t,e,i)=>{const a=new Set(e.filter(c=>c.project===i).map(c=>c.user));return g(t.filter(c=>a.has(c.id)))})),je=I(t=>t.uuid),dh=je.getInitialState({}),Na=d.createSlice({name:"projectAttachments",initialState:dh,extraReducers:t=>t.addMatcher(d.isAnyOf(F,O),e=>Object.assign(e,dh)),reducers:{initializeProjectAttachments:je.initialize,addProjectAttachment:je.addOne,addProjectAttachments:je.addMany,setProjectAttachment:je.setOne,setProjectAttachments:je.setMany,updateProjectAttachment:je.updateOne,updateProjectAttachments:je.updateMany,deleteProjectAttachment:je.deleteOne,deleteProjectAttachments:je.deleteMany}}),{initializeProjectAttachments:uh,addProjectAttachment:dg,addProjectAttachments:oh,setProjectAttachment:lh,setProjectAttachments:hh,updateProjectAttachment:ug,updateProjectAttachments:mh,deleteProjectAttachment:ph,deleteProjectAttachments:Ha}=Na.actions,Ah=t=>t.projectAttachmentReducer.instances,fh=d.createSelector([Ah],t=>Object.values(t)),yh=t=>e=>e.projectAttachmentReducer.instances[t],Sh=y(d.createSelector([fh,(t,e)=>e],(t,e)=>g(t.filter(({project:i})=>e===i)))),gh=Na.reducer,qe=I(t=>t.uuid),bh=qe.getInitialState({activeProjectFileId:null,isImportingProjectFile:!1}),Wa=d.createSlice({name:"projectFiles",initialState:bh,extraReducers:t=>t.addMatcher(d.isAnyOf(F,M,O),e=>Object.assign(e,bh)),reducers:{initializeProjectFiles:qe.initialize,setProjectFile:qe.setOne,setProjectFiles:qe.setMany,addProjectFile:qe.addOne,addProjectFiles:qe.addMany,updateProjectFile:qe.updateOne,updateProjectFiles:qe.updateMany,deleteProjectFile:qe.deleteOne,deleteProjectFiles:qe.deleteMany,setIsImportingProjectFile:(t,e)=>{t.isImportingProjectFile=e.payload},saveActiveProjectFileBounds:(t,e)=>{const i=t.activeProjectFileId;if(!i)throw new Error("Tried to save bounds for active project file, but no active project file was set.");if(!t.instances[i])throw new Error(`Tried to save bounds for active project file, but project file with ID ${i}
2
- doesn't exist.`);t.instances[i].bounds=e.payload},setActiveProjectFileId:(t,e)=>{t.activeProjectFileId=e.payload},resetProjectFileObjectUrls:(t,...e)=>{for(const i in t.instances)delete t.instances[i].objectURL}}}),{initializeProjectFiles:Ph,setProjectFile:og,setProjectFiles:lg,addProjectFile:hg,addProjectFiles:Fh,updateProjectFile:Ya,updateProjectFiles:mg,deleteProjectFile:Th,deleteProjectFiles:Ih,setIsImportingProjectFile:Oh,setActiveProjectFileId:_h,saveActiveProjectFileBounds:Rh,resetProjectFileObjectUrls:pg}=Wa.actions,vh=t=>t.projectFileReducer.instances,wh=d.createSelector([vh],t=>g(Object.values(t).sort((e,i)=>e.z_index-i.z_index))),Ag=t=>e=>e.projectFileReducer.instances[t],fg=t=>t.projectFileReducer.activeProjectFileId,yg=t=>t.projectFileReducer.isImportingProjectFile,Mh=Wa.reducer,Ve=I(t=>t.uuid),Eh=Ve.getInitialState({}),Ka=d.createSlice({name:"projects",initialState:Eh,extraReducers:t=>t.addMatcher(d.isAnyOf(F,O),e=>Object.assign(e,Eh)),reducers:{initializeProjects:Ve.initialize,setProjects:Ve.setMany,setProject:Ve.setOne,addProjects:Ve.addMany,addProject:Ve.addOne,updateProjects:Ve.updateMany,updateProject:Ve.updateOne,deleteProject:Ve.deleteOne,deleteProjects:Ve.deleteMany}}),{initializeProjects:jh,setProjects:Sg,setProject:gg,addProjects:bg,addProject:Za,updateProjects:Pg,updateProject:qh,deleteProject:Ja,deleteProjects:Fg}=Ka.actions,Vh=Ka.reducer,zh=t=>t.projectReducer.instances,Xa=d.createSelector([zh],t=>g(Object.values(t))),Uh=t=>e=>e.projectReducer.instances[t],Tg=y(d.createSelector([Xa,kt,(t,e)=>e],(t,e,i)=>{const a=new Set(e.filter(c=>c.user===i).map(c=>c.project));return g(t.filter(c=>a.has(c.uuid)))})),Ig=y(d.createSelector([Xa,(t,e)=>e],(t,e)=>g(t.filter(i=>i.organization_owner===e)))),Og={isRehydrated:!1},Qa=d.createSlice({name:"rehydrated",initialState:Og,reducers:{setRehydrated:(t,e)=>{t.isRehydrated=e.payload}}}),{setRehydrated:_g}=Qa.actions,Rg=t=>t.rehydratedReducer.isRehydrated,Dh=Qa.reducer,ze=I(t=>t.uuid),Ch=ze.getInitialState({}),xa=d.createSlice({name:"teamMemberships",initialState:Ch,extraReducers:t=>t.addMatcher(d.isAnyOf(F,O),e=>Object.assign(e,Ch)),reducers:{initializeTeamMemberships:ze.initialize,addTeamMembership:ze.addOne,addTeamMemberships:ze.addMany,setTeamMembership:ze.setOne,setTeamMemberships:ze.setMany,updateTeamMembership:ze.updateOne,updateTeamMemberships:ze.updateMany,deleteTeamMembership:ze.deleteOne,deleteTeamMemberships:ze.deleteMany}}),{initializeTeamMemberships:kh,addTeamMembership:Bh,addTeamMemberships:vg,setTeamMembership:ec,setTeamMemberships:wg,updateTeamMembership:Mg,updateTeamMemberships:Eg,deleteTeamMembership:tc,deleteTeamMemberships:jg}=xa.actions,Gh=xa.reducer,$h=t=>t.teamMembershipReducer.instances,sc=d.createSelector([$h],t=>Object.values(t)),Lh=t=>e=>e.teamMembershipReducer.instances[t],qg=y(d.createSelector([sc,(t,e)=>e],(t,e)=>{const i={};for(const a of t.filter(c=>c.team===e))i[a.user]=a;return i})),Vg=y(d.createSelector([qa,sc,(t,e)=>e],(t,e,i)=>{const a=new Set(e.filter(c=>c.team===i).map(c=>c.user));return g(t.filter(c=>a.has(c.id)))})),Ue=I(t=>t.uuid),Nh=Ue.getInitialState({}),ic=d.createSlice({name:"teams",initialState:Nh,extraReducers:t=>t.addMatcher(d.isAnyOf(F,O),e=>Object.assign(e,Nh)),reducers:{initializeTeams:Ue.initialize,addTeam:Ue.addOne,addTeams:Ue.addMany,setTeam:Ue.setOne,setTeams:Ue.setMany,updateTeam:Ue.updateOne,updateTeams:Ue.updateMany,deleteTeam:Ue.deleteOne,deleteTeams:Ue.deleteMany}}),{initializeTeams:Hh,addTeam:Wh,addTeams:zg,setTeam:ut,setTeams:Ug,updateTeam:Yh,updateTeams:Dg,deleteTeam:ac,deleteTeams:Cg}=ic.actions,cc=t=>t.teamReducer.instances,Kh=d.createSelector([cc],t=>Object.values(t)),nc=t=>e=>e.teamReducer.instances[t],kg=y(d.createSelector([cc,(t,e)=>e],(t,e)=>{const i=[];for(const a of e){const c=t[a];c?i.push(c):console.warn("selectTeamsByIds: No team exists with the id",a)}return g(i)})),Bg=y(d.createSelector([Kh,(t,e)=>e],(t,e)=>g(t.filter(i=>i.organization===e)))),Zh=ic.reducer,Gg={version:0},Jh=d.createSlice({name:"versioning",initialState:Gg,reducers:{}}),Xh=Jh.reducer,rc={outboxReducer:th,fileReducer:au,authReducer:Id},$g=d.combineReducers(rc),Qh={...rc,[Ze]:Xh,categoryReducer:Md,assetReducer:br,assetAttachmentReducer:$c,assetStageCompletionReducer:Or,assetStageReducer:Er,assetTypeReducer:Pd,assetTypeAttachmentReducer:$r,issueReducer:jo,issueAttachmentReducer:ho,issueTypeReducer:bl,issueTypeAttachmentReducer:$o,organizationReducer:Zl,projectReducer:Vh,projectAttachmentReducer:gh,projectAccessReducer:nh,organizationAccessReducer:$l,projectFileReducer:Mh,rehydratedReducer:Dh,formReducer:Pu,formRevisionReducer:Su,formRevisionAttachmentReducer:lu,formSubmissionAttachmentReducer:Eu,formSubmissionReducer:Cu,userReducer:zl,emailDomainsReducer:xd,documentsReducer:Wd,documentAttachmentReducer:Gd,teamReducer:Zh,agentsReducer:qc,issueCommentReducer:_o,issueCommentAttachmentReducer:Fo,issueUpdateReducer:Ml,geoImageReducer:Ku,issueAssociationReducer:so,issueTypeFieldsReducer:rl,issueTypeFieldValuesReducer:el,issueTypeFieldsAttachmentReducer:Jo,issueTypeFieldValuesAttachmentReducer:pl,assetTypeFieldsReducer:id,assetTypeFieldValuesReducer:yd,assetTypeFieldsAttachmentReducer:Jr,assetTypeFieldValuesAttachmentReducer:od,assetProcedureReducer:Cn,assetProcedureInstanceReducer:Vn,assetProcedureFieldsReducer:An,assetProcedureFieldValuesReducer:vn,assetProcedureFieldsAttachmentReducer:dn,assetProcedureFieldValuesAttachmentReducer:Fn,assetProcedureAttachmentReducer:Jc,assetProcedureStepFieldsAttachmentReducer:Yn,assetProcedureStepFieldsReducer:Jn,assetProcedureStepFieldValuesAttachmentReducer:ir,assetProcedureStepFieldValuesReducer:or,assetProcedureStepReducer:pr,teamMembershipReducer:Gh},Lg=d.combineReducers(Qh);function Ng(t,e){return Am.useMemo(t,e)}class Hg{constructor(e){S(this,"operations",[]);S(this,"getData");this.getData=e}performOperations(e){let i=e;for(const a of this.operations)i=a(i);return i}filter(e,i){return this.operations.push(a=>a.filter(c=>c[e]===i)),this}exclude(e,i){return this.operations.push(a=>a.filter(c=>c[e]!==i)),this}orderBy(e){return this.operations.push(i=>[...i].sort((a,c)=>a[e]<=c[e]?1:-1)),this}reverse(){return this.operations.push(e=>[...e].reverse()),this}all(){return this.operations.push(e=>e),this}get(e,i){return d.createSelector([this.getData],a=>this.performOperations(a).find(c=>c[e]===i))}count(){return d.createSelector([this.getData],e=>this.performOperations(e).length)}first(){return d.createSelector([this.getData],e=>this.performOperations(e)[0])}last(){return d.createSelector([this.getData],e=>{const i=this.performOperations(e);return i[i.length-1]})}exists(){return d.createSelector([this.getData],e=>this.performOperations(e).length>0)}toSelector(){return d.createSelector([this.getData],e=>g(this.performOperations(e)))}}let xh;function Wg(t){xh=t}function ot(){return xh}let em;function Yg(t){em=t}function Kg(){return em}const tm={};class sm{constructor(e){S(this,"client");tm[this.constructor.name]=this,this.client=e}async enqueueRequest(e,i){return this.client.enqueueRequest(e,this.host,this.constructor.name,i)}async performPagination(e,i,a){const c=[];let n=await this.client.enqueueRequest(e,this.host,this.constructor.name,a);for(c.push(n.results);n.next;)n=await this.client.enqueueRequest(i(n.next),this.host,this.constructor.name,a),c.push(n.results);return c}dispatch(e){this.client.store.dispatch(e)}}const im=()=>nm.length-1,am=t=>(t[Ze]={version:im()},t),cm=()=>am({}),Zg=t=>(t.outboxReducer&&(t.outboxReducer.deletedRequests=[]),t),Jg=t=>e=>{var i;return e===void 0&&(e={}),((i=e[Ze])==null?void 0:i.version)===im()?e:t(e)},nm=[am,cm,cm,Zg],Xg=Object.fromEntries(nm.map((t,e)=>[e,Jg(t)]));let dc=null;function Ge(){const t=ot();if(!t)return console.warn("Client store not set; cannot get outbox coordinator yet."),null;if(dc)return dc;const e=t.getState().offline.outbox,i=Ke._fromOutbox(e);return dc=i,i}const Qg=t=>{if(t)throw t;const e=ot();e?e.dispatch({type:"rehydrated/setRehydrated",payload:!0}):console.error("Client store not set")},rm=(t,e,i)=>{const a=Ge();return a?(a.addRequest(e),a.getQueue()):(console.warn("Outbox coordinator not set; cannot enqueue request yet."),[])},dm=(t,e,i)=>{const a=Ge();if(!a)return console.warn("Outbox coordinator not set; cannot dequeue request yet."),[];const n=e.meta.offlineAction.payload.uuid;return a.remove(n),a.getQueue()};async function xg(t,e){if(!e.payload)throw new Error("Received empty payload");return db(e)}const eb={...pc,effect:xg,discard:oc,returnPromises:!0,persistCallback:Qg,retry:ob,persistOptions:{storage:ym},queue:{...pc.queue,enqueue:rm,dequeue:dm,peek:(...t)=>ub(...t)}},tb=Sm(Xg,Ze),sb=d.compose(fm.offline(eb),tb);function ib(t){function e(i){return typeof i=="object"&&i!==null&&["ok","redirect","clientError","serverError","error"].every(c=>c in i)}if(e(t))return t;if(typeof t=="object"&&t!==null){const i=t;if(e(i.response))return i.response;if(i.response&&e(i.response.response))return i.response.response}}async function uc(t,e,i){const a=tm[t.meta.offline.effect.serviceName];if(!a)throw new Error(`Service ${t.meta.offline.effect.serviceName} not found`);const c=a instanceof v;if(e.store.getState().outboxReducer.deletedRequests.includes(t.payload.uuid))throw new Error("Request was marked for deletion");c&&t.payload.checkAuth!==!1&&await a.auth.prepareAuth();const r={queryParams:"",isAuthNeeded:!0},l=t.meta.offline.effect,{payload:m,headers:u,method:o,queryParams:p,attachmentHash:A,isExternalUrl:f,isAuthNeeded:b,isResponseBlob:P}={...r,...l.request},_=l.request;let R=_.url;const z=A?await e.files.fetchCache(A):void 0;if(A&&!z)throw new Error(`Cannot upload file ${A} because it's not cached.`);!f&&!R.startsWith("http")&&(!R.startsWith("/")&&!R.startsWith("blob:")&&(R="/"+R),R=t.meta.offline.effect.BASE_URL+R);const De=V=>{if(A){const Ce=_.s3url;if(!Ce)throw new Error(`No S3 URL for file ${A}`);if("warning"in Ce)throw new Error(`S3 URL warning for file ${A}`);if(!z)throw new Error(`No file for file ${A}`);const lt=Ce.fields["x-amz-checksum-sha1"];if(!lt)throw new Error(`No checksum for file ${A}`);return V.set("x-amz-checksum-sha1",lt).field({...m,...Ce.fields}).attach("file",z)}return V.send(m)},IP={[h.GET]:()=>P?Le.get(R.toString()).responseType("blob"):Le.get(R.toString()),[h.POST]:()=>{const V=Le.post(R.toString());return De(V)},[h.PATCH]:()=>{const V=Le.patch(R.toString());return De(V)},[h.PUT]:()=>{const V=Le.put(R.toString());return De(V)},[h.DELETE]:()=>{const V=Le.delete(R.toString());return De(V)}}[o];let Be=IP();if(i==null||i.addEventListener("abort",()=>{console.debug("aborting request:",_),Be.abort()}),b&&c){const V=a.auth.getAuthHeader();Be=Be.set("Authorization",V)}u&&(Be=Be.set(u));try{return await Be.query(p)}catch(V){const Ce=ib(V),lt=Ce==null?void 0:Ce.status;if(c&&lt===401)return await a.auth.handleUnauthorized(Be,Ce),Be.query(p);throw new D({response:Ce,innerError:V,discard:om.includes(lt)})}}class ab{constructor(e){S(this,"_all");S(this,"_previous");this._all=[e],this._previous=e,this.then=this.then.bind(this),this.compile=this.compile.bind(this)}then(e){return this._previous&&(this._previous.next=e),this._all.push(e),this._previous=e,{then:this.then,compile:this.compile}}compile(){return this._all}}class um{constructor(){S(this,"next");this.next=null}then(e){return new ab(this).then(e)}async run(e){if(this.next)return this.next.run(e);{if(console.debug("Middleware finished. Performing request:",e),!ot())throw new Error("Client store not set");const a=Kg();if(!a)throw new Error("Client SDK not set");return uc(e,a)}}}class cb extends um{async run(e){return super.run(e)}}class nb extends um{async run(e){return super.run(e)}}const rb=new cb().then(new nb).compile();function db(t){var e;return(e=rb[0])==null?void 0:e.run(t)}const om=[400,409,403,404,405,500];function oc(t,e,i=0){var u;if(console.debug("Considering discarding request due to error:",t,`(${typeof t})`,`
3
- Action:`,e,`
4
- Retries:`,i),!(t instanceof Error))throw console.error("ENCOUNTERED NON-ERROR ERROR:",t,"(throwing immediately, which may lead to unexpected behavior)"),t;const a=ot(),n=a.getState().outboxReducer.deletedRequests,r=e.payload.uuid;function l(){a.dispatch(xl(r));const o=Ge();if(!o)throw new Error("Outbox coordinator not set");o.remove(e.payload.uuid);const p=e.meta.offline.rollback;throw p&&(console.warn("Rolling back request due to SDK error:",e),a.dispatch(p)),t}if(t instanceof D&&t.options.discard)return console.debug("Discarding request due to explicit discard:",e),l();if(n.includes(r))return console.debug("Discarding request due to deletion:",e),l();if(t instanceof D){const o=t.status||((u=t.response)==null?void 0:u.status);if(o||console.warn("Error has no status code:",t),o!==void 0&&om.includes(o)){console.warn("Discarding request due to error:",t,`
5
- Action:`,e);const p=Ge();if(!p)throw new Error("Outbox coordinator not set");p.remove(e.payload.uuid),t.options.discard=!0,l()}}console.debug("Registering a retry for request:",e.payload.uuid);const m=Ge();if(!m)throw new Error("Outbox coordinator not set");return m.registerRetry(e.payload.uuid),!1}function ub(t,e,i){var a;return(a=Ge())==null?void 0:a.peek()}function ob(t,e){return ot().dispatch(eh(new Date().getTime())),gc}const Ye="An unknown error occurred",lb=500,lm=["non_field_errors","detail"];function hb(t,e){let i;if(t!=null&&t.body)if(typeof t.body=="object"){const a=t.body;if(typeof a.error=="string")i=a.error;else if(typeof a.message=="string")i=a.message;else try{i=Object.entries(a).map(([c,n])=>typeof n=="string"?lm.includes(c)?n:`${c}: ${n}`:Array.isArray(n)?lm.includes(c)?n.join(`
6
- `):n.map(r=>`${c}: ${r}`).join(`
7
- `):`${c}: ${JSON.stringify(n)}`).join(`
8
- `)}catch(c){console.error("Failed to extract error message from response body",c)}}else typeof t.body=="string"&&(i=t.body);else t!=null&&t.text?i=t.text:e instanceof Error&&(i=e.message);return!i||i.length>lb?Ye:i}class D extends Error{constructor(i){super(Ye);S(this,"status");S(this,"response");S(this,"message");S(this,"options");const{response:a,innerError:c}=i;this.message=i.message??hb(a,c)??Ye,this.status=(a==null?void 0:a.status)??0,this.response=a,i.discard=i.discard??!1,this.options=i}}class mb extends sm{constructor(e){super(e)}}class v extends sm{constructor(i,a){super(i);S(this,"auth");this.auth=a}}class pb extends v{async startConversation(e,i){return this.enqueueRequest({description:"Start agent conversation",method:h.POST,url:"/agents/prompt/",payload:{prompt:e,active_project:i},blockers:["prompt"],blocks:["prompt"]}).then(a=>(this.dispatch(Mc(a)),a))}async continueConversation(e,i,a){return this.enqueueRequest({description:"Prompt agent",method:h.POST,url:"/agents/prompt/",payload:{prompt:e,active_project:a},blockers:["prompt"],blocks:["prompt"],queryParams:{conversation_id:i}}).then(c=>{this.dispatch(jc(c))})}async fetchDetails(e){return this.enqueueRequest({description:"Get agent conversation",method:h.GET,url:`/agents/conversations/${e}/`,blockers:["conversation"],blocks:["conversation"]}).then(i=>{this.dispatch(Ec(i))})}async rate(e,i){return this.enqueueRequest({description:"Rate agent response",method:h.PUT,url:`/agents/responses/${e}/rate/`,payload:{rating:i},blockers:["rate"],blocks:["rate"]})}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get agent conversation history",method:h.GET,url:"/agents/conversations/",queryParams:{project:e},blockers:["agent-conversations"],blocks:["agent-conversations"]},i);return this.dispatch(wc(a)),a}}const Ab=5e4,E=1e3,fb="limit";class q extends v{getNumberOfAttachmentsWithSha1(e){const{issueAttachmentReducer:i,assetAttachmentReducer:a,assetTypeAttachmentReducer:c,documentAttachmentReducer:n,projectAttachmentReducer:r,formRevisionAttachmentReducer:l,formSubmissionAttachmentReducer:m,geoImageReducer:u,assetTypeFieldsAttachmentReducer:o,assetTypeFieldValuesAttachmentReducer:p,issueTypeFieldsAttachmentReducer:A,issueTypeFieldValuesAttachmentReducer:f}=this.client.store.getState();return[].concat(Object.values(i.instances),Object.values(a.instances),Object.values(c.instances),Object.values(n.instances),Object.values(r.instances),Object.values(l.instances),Object.values(m.instances),Object.values(u.instances),Object.values(o.instances),Object.values(p.instances),Object.values(A.instances),Object.values(f.instances)).filter(P=>P.file_sha1===e).length}processPresignedUrls(e){const i={};for(const[a,c]of Object.entries(e))i[a]=this.enqueueRequest({url:c.url,description:"Upload file to S3",method:h.POST,isExternalUrl:!0,isAuthNeeded:!1,attachmentHash:a,blockers:[`s3-${c.fields.key}`],blocks:[a],s3url:c});return i}async getFilePayload(e){const i=await He(e),a={sha1:i,file_type:e.type,extension:e.name.split(".").pop(),size:e.size};return await this.client.files.addCache(e,i),a}}class ke extends q{async _bulkAdd(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,c=new Date().toISOString(),n=[],r=[],l={};for(const o of e){const{modelUuid:p,file:A}=o,f=await this.getFilePayload(A);f.sha1 in l||(l[f.sha1]=f);const b=this.buildOfflineAttachment({file:A,file_sha1:f.sha1,submitted_at:c,created_by:a,description:"",modelUuid:p});n.push(b),r.push(this.buildAttachmentPayload({uuid:b.uuid,file_name:b.file_name,file_sha1:b.file_sha1,file_extension:f.extension,description:b.description,modelUuid:p}))}this.dispatch(this.addAttachments(n));const m=this.enqueueRequest({description:`Add ${this.name}`,method:h.POST,url:`${this.url}/bulk/`,payload:{submitted_at:c,attachments:r,files:Object.values(l)},blocks:n.map(o=>o.uuid),blockers:n.map(o=>o.file_sha1)});return m.then(({attachments:o,presigned_urls:p})=>{this.dispatch(this.updateAttachments(o)),this.processPresignedUrls(p)}).catch(()=>{this.dispatch(this.removeAttachments(n.map(o=>o.uuid)))}),[n,m.then(({attachments:o})=>o)]}async _delete(e){const{store:i}=this.client,a=this.selectAttachment(e)(i.getState());if(!a)throw new Error(`Attempting to delete attachment with uuid ${e} that does not exist in the store`);this.dispatch(this.removeAttachment(a.uuid));const c=this.enqueueRequest({description:`Delete ${this.name}`,method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]});return c.then(()=>{this.getNumberOfAttachmentsWithSha1(a.file_sha1)===0&&this.client.files.removeCache(a.file_sha1)}).catch(()=>{this.dispatch(this.setAttachment(a))}),c}}class yb extends ke{constructor(){super(...arguments);S(this,"name","Asset Attachment");S(this,"url","/asset-attachments");S(this,"initializeAttachments",Xt);S(this,"addAttachments",Qt);S(this,"updateAttachments",Uc);S(this,"removeAttachments",xt);S(this,"removeAttachment",Dc);S(this,"setAttachment",zc);S(this,"selectAttachment",Bc)}buildOfflineAttachment(i){return T({file:URL.createObjectURL(i.file),file_sha1:i.file_sha1,created_by:i.created_by,file_name:i.file.name,file_type:i.file.type,submitted_at:i.submitted_at,description:i.description,asset:i.modelUuid})}buildAttachmentPayload(i){return{...i,asset:i.modelUuid}}async bulkAdd(i){return this._bulkAdd(i.map(a=>({modelUuid:a.assetUuid,file:a.file})))}async delete(i){return this._delete(i)}async refreshStore(i,a){const n=(await this.performPagination({immediate:!0,description:"Get asset attachments",method:h.GET,url:`${this.url}/`,queryParams:{limit:E,paginate:!0,asset__project:i},blocks:[],blockers:[]},r=>({immediate:!0,description:"Get asset attachments",method:h.GET,url:r,blockers:[],blocks:[]}),a)).flat();return this.dispatch(Xt(n)),n}}class Sb extends ke{constructor(){super(...arguments);S(this,"name","Asset Procedure Attachment");S(this,"url","/asset-procedure-attachments");S(this,"addAttachments",Hc);S(this,"updateAttachments",Yc);S(this,"removeAttachments",Zc);S(this,"removeAttachment",Kc);S(this,"setAttachment",Wc);S(this,"selectAttachment",xc)}buildOfflineAttachment(i){return T({file:URL.createObjectURL(i.file),file_sha1:i.file_sha1,created_by:i.created_by,file_name:i.file.name,file_type:i.file.type,submitted_at:i.submitted_at,description:i.description,asset_procedure:i.modelUuid})}buildAttachmentPayload(i){return{...i,asset_procedure:i.modelUuid}}async bulkAdd(i){return this._bulkAdd(i.map(a=>({modelUuid:a.assetProcedureUuid,file:a.file})))}async delete(i){return this._delete(i)}async refreshStore(i,a){const c=await this.enqueueRequest({immediate:!0,description:"Get asset procedure attachments",method:h.GET,url:`${this.url}/`,queryParams:{asset_procedure__organization:i},blocks:[],blockers:[]},a);return this.dispatch(Nc(c)),c}}class gb extends q{async bulkAdd(e){var m;const i=new Date().toISOString(),a=(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.id,c={},n=[],r=[];for(const u of e){const{fieldsRevisionUuid:o,fieldIdentifier:p,file:A}=u,f=await this.getFilePayload(A);f.sha1 in c||(c[f.sha1]=f);const b=T({file:URL.createObjectURL(A),file_type:A.type,file_name:A.name,file_sha1:f.sha1,created_by:a,fields_revision:o,submitted_at:i,field_identifier:p});n.push(b);const P={uuid:b.uuid,file_name:A.name,field_identifier:p,file_extension:f.extension,file_sha1:f.sha1,fields_revision:o};r.push(P)}this.dispatch(sn(n));const l=this.enqueueRequest({description:"Add asset procedure fields attachments",method:h.POST,url:"/asset-procedure-fields-attachments/bulk/",payload:{submitted_at:i,attachments:r,files:Object.values(c)},blockers:n.map(u=>u.fields_revision),blocks:n.map(u=>u.uuid)});return l.then(u=>{this.processPresignedUrls(u.presigned_urls),this.dispatch(an(u.attachments))}).catch(()=>{this.dispatch(cn(n.map(u=>u.uuid)))}),[n,l.then(({attachments:u})=>u)]}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get asset procedure fields attachments",method:h.GET,url:"/asset-procedure-fields-attachments/",queryParams:{fields_revision__asset_procedure__organization:e},blockers:[],blocks:[]},i);return this.dispatch(tn(a)),a}}class bb extends v{add(e){var l;const{store:i}=this.client,a=(l=i.getState().userReducer.currentUser)==null?void 0:l.id,c=new Date().toISOString(),n=T({...e,created_by:a,submitted_at:c});this.dispatch(ln(n));const r=this.enqueueRequest({description:"Add Asset Procedure Fields",method:h.POST,url:"/asset-procedure-fields/",payload:w(n),blockers:[n.asset_procedure],blocks:[n.uuid]});return r.then(m=>{this.dispatch(hn(m))}).catch(m=>{throw this.dispatch(mn(n.uuid)),m}),[n,r]}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get Asset Procedure Fields",method:h.GET,url:"/asset-procedure-fields/",queryParams:{asset_procedure__organization:e},blockers:[],blocks:[]},i);return this.dispatch(on(a)),a}}function $e(t,e){const i=[];let a=0;const c=t.length;for(;a<c;)i.push(t.slice(a,a+=e));return i}class Pb extends q{async bulkAdd(e,i){var u;const a=new Date().toISOString(),c=(u=this.client.store.getState().userReducer.currentUser)==null?void 0:u.id,n=$e(e,i??e.length),r=[],l=[];for(const o of n){const p={},A=[];for(const f of o){const{fieldValuesUuid:b,fieldIdentifier:P,file:_}=f,R=await this.getFilePayload(_);R.sha1 in p||(p[R.sha1]=R);const z=T({file:URL.createObjectURL(_),file_type:_.type,file_name:_.name,file_sha1:R.sha1,created_by:c,field_values:b,submitted_at:a,field_identifier:P});r.push(z);const De={uuid:z.uuid,file_name:_.name,file_sha1:R.sha1,file_extension:R.extension,field_identifier:P,field_values:b};A.push(De)}l.push({submitted_at:a,attachments:A,files:Object.values(p)})}this.dispatch(mt(r));const m=l.map(o=>this.enqueueRequest({description:"Add asset procedure field values attachments",method:h.POST,url:"/asset-procedure-field-values-attachments/bulk/",payload:o,blockers:o.attachments.map(p=>p.field_values),blocks:o.attachments.map(p=>p.uuid)}));return Promise.all(m).then(o=>{for(const A of o)this.processPresignedUrls(A.presigned_urls);const p=o.flatMap(A=>A.attachments);this.dispatch(Sn(p))}).catch(o=>{throw this.dispatch(pt(r.map(p=>p.uuid))),o}),[r,m.map(o=>o.then(({attachments:p})=>p))]}async bulkDelete(e){const{store:i}=this.client,a=i.getState(),c=bn(e)(a);this.dispatch(pt(e));try{await this.enqueueRequest({description:"Delete asset procedure field values attachments",method:h.DELETE,url:"/asset-procedure-field-values-attachments/bulk/",payload:{uuids:e},blockers:e,blocks:[]})}catch(n){throw this.dispatch(mt(c)),n}}async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Get asset procedure field values attachments",method:h.GET,url:"/asset-procedure-field-values-attachments/",queryParams:{limit:E,paginate:!0,field_values__asset_procedure_instance__project:e},blockers:[],blocks:[]},n=>({immediate:!0,description:"Get asset procedure field values attachments",method:h.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(yn(c)),c}}class Fb extends v{add(e){var r;const{store:i}=this.client,a=i.getState(),c=T({...e,created_by:(r=a.userReducer.currentUser)==null?void 0:r.id,submitted_at:new Date().toISOString()}),n=this.enqueueRequest({description:"Add asset procedure field values",method:h.POST,url:"/asset-procedure-field-values/",payload:w(c),blockers:[e.asset,e.fields_revision,e.asset_procedure_instance],blocks:[c.uuid]});return this.dispatch(rs(c)),n.then(l=>(this.dispatch(Je(l)),l)).catch(()=>{this.dispatch(ds(c.uuid))}),[c,n]}bulkAdd(e,i){var m;const a=new Date().toISOString(),c=[],n=$e(e.payloads,i??e.payloads.length),r=[];for(const u of n){const o=[];for(const p of u){const A=T({...p,values:p.values,created_by:(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.id,submitted_at:a});c.push(A),o.push({uuid:A.uuid,asset:p.asset,fields_revision:p.fields_revision,asset_procedure_instance:p.asset_procedure_instance,published_at:p.published_at,values:A.values})}r.push({submitted_at:a,values:e.values,field_values:o})}this.dispatch(On(c));const l=[];for(const u of r){const o=u.field_values.map(P=>P.asset),p=u.field_values.map(P=>P.fields_revision),A=u.field_values.map(P=>P.asset_procedure_instance),f=u.field_values.map(P=>P.uuid),b=this.enqueueRequest({description:"Bulk add asset procedure field values",method:h.POST,url:"/asset-procedure-field-values/bulk/",payload:u,blockers:[...o,...p,...A],blocks:f});l.push(b)}return Promise.all(l).then(u=>{this.dispatch(_n(u.flat()))}).catch(()=>{this.dispatch(Rn(c.map(u=>u.uuid)))}),[c,l]}update(e){const{store:i}=this.client,a=i.getState(),c=os(e.uuid)(a);if(!c)throw new Error(`Expected AssetProcedureFieldValues with uuid ${e.uuid} to exist`);const n={...c,...e};this.dispatch(Je(n));const r=this.enqueueRequest({description:"Update asset procedure field values",method:h.PATCH,url:`/asset-procedure-field-values/${e.uuid}/`,payload:e,blockers:[n.fields_revision,n.asset,n.asset_procedure_instance],blocks:[n.uuid]});return r.then(l=>{this.dispatch(Je(l))}).catch(()=>{this.dispatch(Je(c))}),[n,r]}async delete(e){const{store:i}=this.client,a=i.getState(),c=os(e)(a);if(!c)throw new Error(`Expected submission with uuid ${e} to exist`);const n=Pn(e)(a);this.dispatch(ds(e)),this.dispatch(pt(n.map(r=>r.uuid)));try{await this.enqueueRequest({description:"Delete asset procedure field values",method:h.DELETE,url:`/asset-procedure-field-values/${e}/`,blockers:[e],blocks:[]})}catch(r){throw this.dispatch(rs(c)),this.dispatch(mt(n)),r}}async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Get asset procedure field values",method:h.GET,url:"/asset-procedure-field-values/",queryParams:{limit:E,paginate:!0,asset_procedure_instance__project:e},blockers:[],blocks:[]},n=>({immediate:!0,description:"Get asset procedure field values",method:h.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(In(c)),c}}class Tb extends v{add(e){var l;const{store:i}=this.client,a=(l=i.getState().userReducer.currentUser)==null?void 0:l.id,c=new Date().toISOString(),n=T({...e,created_by:a,submitted_at:c});this.dispatch(hs(n));const r=this.enqueueRequest({description:"Create asset procedure instance",method:h.POST,url:"/asset-procedure-instances/",payload:w(n),blockers:[e.asset_procedure,e.asset_type],blocks:[n.uuid]});return r.then(m=>{this.dispatch(Xe(m))}).catch(()=>{this.dispatch(ms(n.uuid))}),[n,r]}update(e){const{store:i}=this.client,a=fs(e.uuid)(i.getState());if(!a)throw new Error(`Expected asset procedure instance with uuid ${e.uuid} to exist`);const c={...a,...e};this.dispatch(Xe(c));const n=this.enqueueRequest({description:"Update asset procedure instance",method:h.PATCH,url:`/asset-procedure-instances/${e.uuid}/`,payload:e,blockers:[a.uuid],blocks:[a.uuid]});return n.then(r=>{this.dispatch(Xe(r))}).catch(()=>{this.dispatch(Xe(a))}),[c,n]}async remove(e){const{store:i}=this.client,a=i.getState(),c=fs(e)(a);if(!c)throw new Error(`Expected asset procedure instance with uuid ${e} to exist`);return this.dispatch(ms(e)),this.enqueueRequest({description:"Delete asset procedure instance",method:h.DELETE,url:`/asset-procedure-instances/${e}/`,blockers:[e],blocks:[]}).catch(n=>{throw this.dispatch(hs(c)),n})}async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Get asset procedure instances",method:h.GET,url:"/asset-procedure-instances/",queryParams:{limit:E,paginate:!0,project:e},blockers:[],blocks:[]},n=>({immediate:!0,description:"Get asset procedure instances",method:h.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(En(c)),c}}class Ib extends v{add(e){var l;const{store:i}=this.client,a=(l=i.getState().userReducer.currentUser)==null?void 0:l.id,c=new Date().toISOString(),n=T({...e,created_by:a,submitted_at:c});this.dispatch(Ss(n));const r=this.enqueueRequest({description:"Create asset procedure",method:h.POST,url:"/asset-procedures/",payload:w(n),blockers:[],blocks:[n.uuid]});return r.then(m=>{this.dispatch(Qe(m))}).catch(()=>{this.dispatch(gs(n.uuid))}),[n,r]}update(e){const{store:i}=this.client,a=Ps(e.uuid)(i.getState());if(!a)throw new Error(`Expected asset procedure with uuid ${e.uuid} to exist`);const c={...a,...e};this.dispatch(Qe(c));const n=this.enqueueRequest({description:"Update asset procedure",method:h.PATCH,url:`/asset-procedures/${e.uuid}/`,payload:e,blockers:[a.uuid],blocks:[a.uuid]});return n.then(r=>{this.dispatch(Qe(r))}).catch(()=>{this.dispatch(Qe(a))}),[c,n]}async remove(e){const{store:i}=this.client,a=i.getState(),c=Ps(e)(a);if(!c)throw new Error(`Expected asset procedure with uuid ${e} to exist`);const n=zn(e)(a);return this.dispatch(gs(e)),this.dispatch(qn(n.map(r=>r.uuid))),this.enqueueRequest({description:"Delete asset procedure",method:h.DELETE,url:`/asset-procedures/${e}/`,blockers:[e],blocks:[]}).catch(r=>{throw this.dispatch(Ss(c)),this.dispatch(jn(n)),r})}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get asset procedures",method:h.GET,url:"/asset-procedures/",queryParams:{organization:e},blockers:[],blocks:[]},i);return this.dispatch(Dn(a)),a}}class Ob extends q{async bulkAdd(e){var m;const i=new Date().toISOString(),a=(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.id,c={},n=[],r=[];for(const u of e){const{fieldsRevisionUuid:o,fieldIdentifier:p,file:A}=u,f=await this.getFilePayload(A);f.sha1 in c||(c[f.sha1]=f);const b=T({file:URL.createObjectURL(A),file_type:A.type,file_name:A.name,file_sha1:f.sha1,created_by:a,fields_revision:o,submitted_at:i,field_identifier:p});n.push(b);const P={uuid:b.uuid,file_name:A.name,field_identifier:p,file_extension:f.extension,file_sha1:f.sha1,fields_revision:o};r.push(P)}this.dispatch($n(n));const l=this.enqueueRequest({description:"Add asset procedure step fields attachments",method:h.POST,url:"/asset-procedure-step-fields-attachments/bulk/",payload:{submitted_at:i,attachments:r,files:Object.values(c)},blockers:n.map(u=>u.fields_revision),blocks:n.map(u=>u.uuid)});return l.then(u=>{this.processPresignedUrls(u.presigned_urls),this.dispatch(Ln(u.attachments))}).catch(()=>{this.dispatch(Nn(n.map(u=>u.uuid)))}),[n,l.then(({attachments:u})=>u)]}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get asset procedure step fields attachments",method:h.GET,url:"/asset-procedure-step-fields-attachments/",queryParams:{fields_revision__asset_procedure_step__organization:e},blockers:[],blocks:[]},i);return this.dispatch(Gn(a)),a}}class _b extends v{add(e){var l;const{store:i}=this.client,a=(l=i.getState().userReducer.currentUser)==null?void 0:l.id,c=new Date().toISOString(),n=T({...e,created_by:a,submitted_at:c});this.dispatch(Is(n));const r=this.enqueueRequest({description:"Add Asset Procedure Step Fields",method:h.POST,url:"/asset-procedure-step-fields/",payload:w(n),blockers:[n.asset_procedure_step],blocks:[n.uuid]});return r.then(m=>{this.dispatch(xe(m))}).catch(m=>{throw this.dispatch(Os(n.uuid)),m}),[n,r]}update(e){const{store:i}=this.client,a=i.getState().assetProcedureStepFieldsReducer.instances[e.uuid];if(!a)throw new Error(`AssetProcedureStepFields with uuid ${e.uuid} not found`);const c={...a,...e};this.dispatch(xe(c));const n=this.enqueueRequest({description:"Update Asset Procedure Step Fields",method:h.PATCH,url:`/asset-procedure-step-fields/${a.uuid}/`,payload:e,blockers:[a.uuid],blocks:[a.uuid]});return n.then(r=>{this.dispatch(xe(r))}).catch(r=>{throw this.dispatch(xe(a)),r}),[c,n]}delete(e){const{store:i}=this.client,a=i.getState().assetProcedureStepFieldsReducer.instances[e];if(!a)throw new Error(`AssetProcedureStepFields with uuid ${e} not found`);this.dispatch(Os(e));const c=this.enqueueRequest({description:"Delete Asset Procedure Step Fields",method:h.DELETE,url:`/asset-procedure-step-fields/${e}/`,blockers:[e],blocks:[e]});return c.catch(n=>{throw this.dispatch(Is(a)),n}),c}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get Asset Procedure Step Fields",method:h.GET,url:"/asset-procedure-step-fields/",queryParams:{asset_procedure_step__asset_procedure__organization:e},blockers:[],blocks:[]},i);return this.dispatch(Zn(a)),a}}class Rb extends q{async bulkAdd(e,i){var u;const a=new Date().toISOString(),c=(u=this.client.store.getState().userReducer.currentUser)==null?void 0:u.id,n=$e(e,i??e.length),r=[],l=[];for(const o of n){const p={},A=[];for(const f of o){const{fieldValuesUuid:b,fieldIdentifier:P,file:_}=f,R=await this.getFilePayload(_);R.sha1 in p||(p[R.sha1]=R);const z=T({file:URL.createObjectURL(_),file_type:_.type,file_name:_.name,file_sha1:R.sha1,created_by:c,field_values:b,submitted_at:a,field_identifier:P});r.push(z);const De={uuid:z.uuid,file_name:_.name,file_sha1:R.sha1,file_extension:R.extension,field_identifier:P,field_values:b};A.push(De)}l.push({submitted_at:a,attachments:A,files:Object.values(p)})}this.dispatch(At(r));const m=l.map(o=>this.enqueueRequest({description:"Add asset procedure step field values attachments",method:h.POST,url:"/asset-procedure-step-field-values-attachments/bulk/",payload:o,blockers:o.attachments.map(p=>p.field_values),blocks:o.attachments.map(p=>p.uuid)}));return Promise.all(m).then(o=>{for(const A of o)this.processPresignedUrls(A.presigned_urls);const p=o.flatMap(A=>A.attachments);this.dispatch(xn(p))}).catch(o=>{throw this.dispatch(ft(r.map(p=>p.uuid))),o}),[r,m.map(o=>o.then(({attachments:p})=>p))]}async bulkDelete(e){const{store:i}=this.client,a=i.getState(),c=tr(e)(a);this.dispatch(ft(e));try{await this.enqueueRequest({description:"Delete asset procedure step field values attachments",method:h.DELETE,url:"/asset-procedure-step-field-values-attachments/bulk/",payload:{uuids:e},blockers:e,blocks:[]})}catch(n){throw this.dispatch(At(c)),n}}async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Get asset procedure step field values attachments",method:h.GET,url:"/asset-procedure-step-field-values-attachments/",queryParams:{limit:E,paginate:!0,field_values__asset_procedure_instance__project:e},blockers:[],blocks:[]},n=>({immediate:!0,description:"Get asset procedure step field values attachments",method:h.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(Qn(c)),c}}class vb extends v{add(e){var r;const{store:i}=this.client,a=i.getState(),c=T({...e,created_by:(r=a.userReducer.currentUser)==null?void 0:r.id,submitted_at:new Date().toISOString()}),n=this.enqueueRequest({description:"Add asset procedure step field values",method:h.POST,url:"/asset-procedure-step-field-values/",payload:w(c),blockers:[e.asset,e.fields_revision,e.asset_procedure_instance],blocks:[c.uuid]});return this.dispatch(Es(c)),n.then(l=>(this.dispatch(et(l)),l)).catch(()=>{this.dispatch(js(c.uuid))}),[c,n]}bulkAdd(e,i){var m;const a=new Date().toISOString(),c=[],n=$e(e.payloads,i??e.payloads.length),r=[];for(const u of n){const o=[];for(const p of u){const A=T({...p,values:p.values,created_by:(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.id,submitted_at:a});c.push(A),o.push({uuid:A.uuid,asset:p.asset,fields_revision:p.fields_revision,asset_procedure_instance:p.asset_procedure_instance,asset_procedure_step:p.asset_procedure_step,published_at:p.published_at,values:A.values})}r.push({submitted_at:a,values:e.values,field_values:o})}this.dispatch(nr(c));const l=[];for(const u of r){const o=u.field_values.map(P=>P.asset),p=u.field_values.map(P=>P.fields_revision),A=u.field_values.map(P=>P.asset_procedure_instance),f=u.field_values.map(P=>P.uuid),b=this.enqueueRequest({description:"Bulk add asset procedure step field values",method:h.POST,url:"/asset-procedure-step-field-values/bulk/",payload:u,blockers:[...o,...p,...A],blocks:f});l.push(b)}return Promise.all(l).then(u=>{this.dispatch(rr(u.flat()))}).catch(()=>{this.dispatch(dr(c.map(u=>u.uuid)))}),[c,l]}update(e){const{store:i}=this.client,a=i.getState(),c=qs(e.uuid)(a);if(!c)throw new Error(`Expected AssetProcedureStepFieldValues with uuid ${e.uuid} to exist`);const n={...c,...e};this.dispatch(et(n));const r=this.enqueueRequest({description:"Update asset procedure step field values",method:h.PATCH,url:`/asset-procedure-step-field-values/${e.uuid}/`,payload:e,blockers:[n.fields_revision,n.asset,n.asset_procedure_instance],blocks:[n.uuid]});return r.then(l=>{this.dispatch(et(l))}).catch(()=>{this.dispatch(et(c))}),[n,r]}async delete(e){const{store:i}=this.client,a=i.getState(),c=qs(e)(a);if(!c)throw new Error(`Expected submission with uuid ${e} to exist`);const n=sr(e)(a);this.dispatch(js(e)),this.dispatch(ft(n.map(r=>r.uuid)));try{await this.enqueueRequest({description:"Delete asset procedure step field values",method:h.DELETE,url:`/asset-procedure-step-field-values/${e}/`,blockers:[e],blocks:[]})}catch(r){throw this.dispatch(Es(c)),this.dispatch(At(n)),r}}async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Get asset procedure step field values",method:h.GET,url:"/asset-procedure-step-field-values/",queryParams:{limit:E,paginate:!0,asset_procedure_instance__project:e},blockers:[],blocks:[]},n=>({immediate:!0,description:"Get asset procedure step field values",method:h.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(cr(c)),c}}class wb extends v{add(e){var l;const{store:i}=this.client,a=(l=i.getState().userReducer.currentUser)==null?void 0:l.id,c=new Date().toISOString(),n=T({...e,created_by:a,submitted_at:c});this.dispatch(zs(n));const r=this.enqueueRequest({description:"Create asset procedure step",method:h.POST,url:"/asset-procedure-steps/",payload:w(n),blockers:[n.asset_procedure],blocks:[n.uuid]});return r.then(m=>{this.dispatch(St(m))}).catch(()=>{this.dispatch(Us(n.uuid))}),[n,r]}update(e){const{store:i}=this.client,a=Ds(e.uuid)(i.getState());if(!a)throw new Error(`No asset procedure step with uuid ${e.uuid} found in the store`);const c={...a,...e};this.dispatch(St(c));const n=this.enqueueRequest({description:"Update asset procedure step",method:h.PATCH,url:`/asset-procedure-steps/${a.uuid}/`,payload:{name:e.name,description:e.description,priority:e.order,color:e.color},blockers:[a.uuid],blocks:[a.uuid]});return n.then(r=>{this.dispatch(St(r))}).catch(()=>{this.dispatch(mr(a))}),[c,n]}async delete(e){const{store:i}=this.client,a=i.getState(),c=Ds(e)(a);if(!c)throw new Error(`No asset procedure step with uuid ${e} found in the store`);return this.dispatch(Us(e)),this.enqueueRequest({description:"Delete asset stage",method:h.DELETE,url:`/asset-stages/${e}/`,blockers:[e],blocks:[]}).catch(n=>{throw this.dispatch(zs(c)),n})}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get asset procedure steps",method:h.GET,url:"/asset-procedure-steps/",queryParams:{asset_procedure__organization:e},blockers:[],blocks:[]},i);return this.dispatch(hr(a)),a}}class Mb extends v{add(e){var l;const{store:i}=this.client;if(!e.canvas_marker&&!e.geo_marker)throw new Error("Asset must have either a canvas_marker or geo_marker");const a=(l=i.getState().userReducer.currentUser)==null?void 0:l.id,c=new Date().toISOString(),n=T({...e,created_by:a,submitted_at:c});this.dispatch(ks(n));const r=this.enqueueRequest({description:"Create asset",method:h.POST,url:"/assets/",payload:w(n),blockers:[n.asset_type],blocks:[n.uuid]});return r.then(m=>{this.dispatch(tt(m))}).catch(()=>{this.dispatch(Bs(n.uuid))}),[n,r]}update(e){const{store:i}=this.client,a=Ns(e.uuid)(i.getState());if(!a)throw new Error(`No asset with uuid ${e.uuid} found in the store`);const c={...a,...e};if(!c.canvas_marker&&!c.geo_marker)throw new Error("Asset must have either a canvas_marker or geo_marker");this.dispatch(tt(c));const n=this.enqueueRequest({description:"Edit asset",method:h.PATCH,url:`/assets/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return n.then(r=>{this.dispatch(tt(r))}).catch(()=>{this.dispatch(tt(a))}),[c,n]}async delete(e){const{store:i}=this.client,a=i.getState(),c=Ns(e)(a);if(!c)throw new Error(`No asset with uuid ${e} found in the store`);const n=Gc(e)(a),r=Du(e)(a),l=to(e)(a);if(this.dispatch(Bs(e)),n.length>0){const m=n.map(({uuid:u})=>u);this.dispatch(xt(m))}if(r.length>0){const m=r.map(({uuid:u})=>u);this.dispatch(jt(m))}if(l.length>0){const m=l.map(({uuid:u})=>u);this.dispatch(Qi(m))}return this.enqueueRequest({description:"Delete asset",method:h.DELETE,url:`/assets/${e}/`,blockers:[e],blocks:[]}).catch(m=>{throw this.dispatch(ks(c)),this.dispatch(Qt(n)),this.dispatch(Et(r)),this.dispatch(Ji(l)),m})}bulkAdd(e,i,a,c){const n=new Date().toISOString(),r=Ne.v4(),l=$e(e,c).map(o=>{const p=o.map(A=>T(A));return{batchId:Ne.v4(),payload:{transaction_id:r,submitted_at:n,asset_type:i,project:a,assets:p}}}),m=[];let u=null;for(const o of l){const{batchId:p,payload:A}=o,f=A.assets.map(R=>R.uuid),b=[i];u&&b.push(u);const P=f;P.push(p);const _=this.enqueueRequest({description:"Batch create assets",method:h.POST,url:"/assets/bulk/",payload:A,blockers:b,blocks:P});u=o.batchId,m.push(_)}return Promise.all(m).then(o=>{const p=o.flat();this.dispatch(bt(p))}),m}async bulkDelete(e){const{store:i}=this.client,a=i.getState(),c=gr(e)(a);this.dispatch(Gs(e));try{await this.enqueueRequest({description:"Bulk delete assets",method:h.DELETE,url:"/assets/bulk/",payload:{uuids:e},blockers:e,blocks:[]})}catch(n){throw this.dispatch(bt(c)),n}}async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Get assets",method:h.GET,url:"/assets/",queryParams:{limit:E,paginate:!0,project:e},blockers:[],blocks:[]},n=>({immediate:!0,description:"Get assets",method:h.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(yr(c)),c}}class Eb extends v{add(e){var l;const{store:i}=this.client,a=(l=i.getState().userReducer.currentUser)==null?void 0:l.id,c=new Date().toISOString(),n=T({...e,created_by:a,submitted_at:c});this.dispatch(Ws(n));const r=this.enqueueRequest({description:"Add asset stage completion",method:h.POST,url:"/asset-stage-completions/",payload:w(n),blockers:[e.asset,e.stage],blocks:[n.uuid]});return r.then(m=>{this.dispatch(Tr(m))}).catch(()=>{this.dispatch(Ks(n.uuid))}),[n,r]}delete(e){const{store:i}=this.client,a=_r(e)(i.getState());if(!a)throw new Error(`Expected asset stage completion with uuid ${e} to exist`);this.dispatch(Ks(e));const c=this.enqueueRequest({description:"Delete asset stage completion",method:h.DELETE,url:`/asset-stage-completions/${e}/`,blockers:[e],blocks:[]});return c.catch(()=>{this.dispatch(Ws(a))}),c}bulkAdd(e){var u;const{store:i}=this.client,a=new Date().toISOString(),c=(u=i.getState().userReducer.currentUser)==null?void 0:u.id,n=e.map(o=>T(o)),r=n.map(o=>({...o,created_by:c,submitted_at:a})),l=r.map(({uuid:o})=>o);this.dispatch(Ys(r));const m=this.enqueueRequest({description:"Bulk create asset stage completions",method:h.POST,url:"/asset-stage-completions/bulk/",payload:{submitted_at:a,completions:n},blockers:[...e.map(o=>o.asset_procedure_instance),...e.map(o=>o.stage),...e.map(o=>o.asset)],blocks:l});return m.then(o=>{this.dispatch(Ir(o))}).catch(()=>{this.dispatch(Zs(l))}),[r,m]}bulkDelete(e){const{store:i}=this.client,a=Rr(e)(i.getState());this.dispatch(Zs(e));const c=this.enqueueRequest({description:"Deleting asset stage completions",method:h.DELETE,url:"/asset-stage-completions/bulk/",payload:{uuids:e},blockers:e,blocks:[]});return c.catch(()=>{this.dispatch(Ys(a))}),c}async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Get asset stage completions",method:h.GET,url:"/asset-stage-completions/",queryParams:{limit:E,paginate:!0,asset_procedure_instance__project:e},blockers:[],blocks:[]},n=>({immediate:!0,description:"Get asset stage completions",method:h.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(Fr(c)),c}}class jb extends v{add(e){var l;const{store:i}=this.client,a=(l=i.getState().userReducer.currentUser)==null?void 0:l.id,c=new Date().toISOString(),n=T({...e,created_by:a,submitted_at:c});this.dispatch(Qs(n));const r=this.enqueueRequest({description:"Create asset",method:h.POST,url:"/asset-stages/",payload:w(n),blockers:[n.asset_procedure],blocks:[n.uuid]});return r.then(m=>{this.dispatch(Pt(m))}).catch(()=>{this.dispatch(xs(n.uuid))}),[n,r]}update(e){const{store:i}=this.client,a=ei(e.uuid)(i.getState());if(!a)throw new Error(`No asset stage with uuid ${e.uuid} found in the store`);const c={...a,...e};this.dispatch(Pt(c));const n=this.enqueueRequest({description:"Update asset stage",method:h.PATCH,url:`/asset-stages/${a.uuid}/`,payload:e,blockers:[a.uuid],blocks:[a.uuid]});return n.then(r=>{this.dispatch(Pt(r))}).catch(()=>{this.dispatch(Mr(a))}),[c,n]}async delete(e){const{store:i}=this.client,a=i.getState(),c=ei(e)(a);if(!c)throw new Error(`No asset stage with uuid ${e} found in the store`);return this.dispatch(xs(e)),this.enqueueRequest({description:"Delete asset stage",method:h.DELETE,url:`/asset-stages/${e}/`,blockers:[e],blocks:[]}).catch(n=>{throw this.dispatch(Qs(c)),n})}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get asset stages",method:h.GET,url:"/asset-stages/",queryParams:{asset_procedure__organization:e},blockers:[],blocks:[]},i);return this.dispatch(wr(a)),a}}class qb extends ke{constructor(){super(...arguments);S(this,"name","Asset Type Attachment");S(this,"url","/asset-type-attachments");S(this,"addAttachments",si);S(this,"updateAttachments",Ur);S(this,"removeAttachments",ii);S(this,"removeAttachment",Dr);S(this,"setAttachment",zr);S(this,"selectAttachment",Br)}buildOfflineAttachment(i){return T({file:URL.createObjectURL(i.file),file_sha1:i.file_sha1,created_by:i.created_by,file_name:i.file.name,file_type:i.file.type,submitted_at:i.submitted_at,description:i.description,asset_type:i.modelUuid})}buildAttachmentPayload(i){return{...i,asset_type:i.modelUuid}}async bulkAdd(i){return this._bulkAdd(i.map(a=>({modelUuid:a.assetTypeUuid,file:a.file})))}async delete(i){return this._delete(i)}async refreshStore(i,a){const c=await this.enqueueRequest({immediate:!0,description:"Get asset type attachments",method:h.GET,url:`${this.url}/`,queryParams:{asset_type__organization:i},blocks:[],blockers:[]},a);return this.dispatch(Vr(c)),c}}class Vb extends q{async bulkAdd(e){var m;const i=new Date().toISOString(),a=(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.id,c={},n=[],r=[];for(const u of e){const{fieldsRevisionUuid:o,fieldIdentifier:p,file:A}=u,f=await this.getFilePayload(A);f.sha1 in c||(c[f.sha1]=f);const b=T({file:URL.createObjectURL(A),file_type:A.type,file_name:A.name,file_sha1:f.sha1,created_by:a,fields_revision:o,submitted_at:i,field_identifier:p});n.push(b);const P={uuid:b.uuid,file_name:A.name,field_identifier:p,file_extension:f.extension,file_sha1:f.sha1,fields_revision:o};r.push(P)}this.dispatch(Hr(n));const l=this.enqueueRequest({description:"Add asset type fields attachments",method:h.POST,url:"/asset-type-fields-attachments/bulk/",payload:{submitted_at:i,attachments:r,files:Object.values(c)},blockers:n.map(u=>u.fields_revision),blocks:n.map(u=>u.uuid)});return l.then(u=>{this.processPresignedUrls(u.presigned_urls),this.dispatch(Wr(u.attachments))}).catch(()=>{this.dispatch(Yr(n.map(u=>u.uuid)))}),[n,l.then(({attachments:u})=>u)]}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get asset type fields attachments",method:h.GET,url:"/asset-type-fields-attachments/",queryParams:{fields_revision__asset_type__organization:e},blockers:[e],blocks:[]},i);return this.dispatch(Nr(a)),a}}class zb extends v{add(e){var l;const{store:i}=this.client,a=(l=i.getState().userReducer.currentUser)==null?void 0:l.id,c=new Date().toISOString(),n=T({...e,created_by:a,submitted_at:c});this.dispatch(xr(n));const r=this.enqueueRequest({description:"Add Asset Type Fields",method:h.POST,url:"/asset-type-fields/",payload:w(n),blockers:[n.asset_type],blocks:[n.uuid]});return r.then(m=>{this.dispatch(ed(m))}).catch(m=>{throw this.dispatch(td(n.uuid)),m}),[n,r]}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get Asset Type Fields",method:h.GET,url:"/asset-type-fields/",queryParams:{asset_type__organization:e},blockers:[],blocks:[]},i);return this.dispatch(Qr(a)),a}}class Ub extends q{async bulkAdd(e,i){var u;const a=new Date().toISOString(),c=(u=this.client.store.getState().userReducer.currentUser)==null?void 0:u.id,n=$e(e,i??e.length),r=[],l=[];for(const o of n){const p={},A=[];for(const f of o){const{fieldValuesUuid:b,fieldIdentifier:P,file:_}=f,R=await this.getFilePayload(_);R.sha1 in p||(p[R.sha1]=R);const z=T({file:URL.createObjectURL(_),file_type:_.type,file_name:_.name,file_sha1:R.sha1,created_by:c,field_values:b,submitted_at:a,field_identifier:P});r.push(z);const De={uuid:z.uuid,file_name:_.name,file_sha1:R.sha1,file_extension:R.extension,field_identifier:P,field_values:b};A.push(De)}l.push({submitted_at:a,attachments:A,files:Object.values(p)})}this.dispatch(It(r));const m=l.map(o=>this.enqueueRequest({description:"Add asset type field values attachments",method:h.POST,url:"/asset-type-field-values-attachments/bulk/",payload:o,blockers:o.attachments.map(p=>p.field_values),blocks:o.attachments.map(p=>p.uuid)}));return Promise.all(m).then(o=>{for(const A of o)this.processPresignedUrls(A.presigned_urls);const p=o.flatMap(A=>A.attachments);this.dispatch(nd(p))}).catch(o=>{throw this.dispatch(Ot(r.map(p=>p.uuid))),o}),[r,m.map(o=>o.then(({attachments:p})=>p))]}async bulkDelete(e){const{store:i}=this.client,a=i.getState(),c=dd(e)(a);this.dispatch(Ot(e));try{await this.enqueueRequest({description:"Delete asset type field values attachments",method:h.DELETE,url:"/asset-type-field-values-attachments/bulk/",payload:{uuids:e},blockers:e,blocks:[]})}catch(n){throw this.dispatch(It(c)),n}}async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Get asset type field values attachments",method:h.GET,url:"/asset-type-field-values-attachments/",queryParams:{limit:E,paginate:!0,field_values__asset__project:e},blockers:[],blocks:[]},n=>({immediate:!0,description:"Get asset type field values attachments",method:h.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(cd(c)),c}}class Db extends v{add(e){var r;const{store:i}=this.client,a=i.getState(),c=T({...e,created_by:(r=a.userReducer.currentUser)==null?void 0:r.id,submitted_at:new Date().toISOString()}),n=this.enqueueRequest({description:"Add asset type field values",method:h.POST,url:"/asset-type-field-values/",payload:w(c),blockers:[e.asset,e.fields_revision],blocks:[c.uuid]});return this.dispatch(ui(c)),n.then(l=>(this.dispatch(st(l)),l)).catch(()=>{this.dispatch(oi(c.uuid))}),[c,n]}bulkAdd(e,i){var m;const a=new Date().toISOString(),c=[],n=$e(e.payloads,i??e.payloads.length),r=[];for(const u of n){const o=[];for(const p of u){const A=T({...p,values:p.values,created_by:(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.id,submitted_at:a});c.push(A),o.push({uuid:A.uuid,asset:p.asset,fields_revision:p.fields_revision,published_at:p.published_at,values:A.values})}r.push({submitted_at:a,values:e.values,field_values:o})}this.dispatch(md(c));const l=[];for(const u of r){const o=u.field_values.map(b=>b.asset),p=u.field_values.map(b=>b.fields_revision),A=u.field_values.map(b=>b.uuid),f=this.enqueueRequest({description:"Bulk add asset type field values",method:h.POST,url:"/asset-type-field-values/bulk/",payload:u,blockers:[...o,...p],blocks:A});l.push(f)}return Promise.all(l).then(u=>{this.dispatch(pd(u.flat()))}).catch(()=>{this.dispatch(Ad(c.map(u=>u.uuid)))}),[c,l]}update(e){const{store:i}=this.client,a=i.getState(),c=hi(e.uuid)(a);if(!c)throw new Error(`Expected AssetTypeFieldValues with uuid ${e.uuid} to exist`);const n={...c,...e};this.dispatch(st(n));const r=this.enqueueRequest({description:"Delete asset type field values",method:h.PATCH,url:`/asset-type-field-values/${e.uuid}/`,payload:e,blockers:[n.uuid,n.fields_revision,n.asset],blocks:[n.uuid]});return r.then(l=>{this.dispatch(st(l))}).catch(()=>{this.dispatch(st(c))}),[n,r]}async delete(e){const{store:i}=this.client,a=i.getState(),c=hi(e)(a);if(!c)throw new Error(`Expected submission with uuid ${e} to exist`);const n=ud(e)(a);this.dispatch(oi(e)),this.dispatch(Ot(n.map(r=>r.uuid)));try{await this.enqueueRequest({description:"Delete asset type field values",method:h.DELETE,url:`/asset-type-field-values/${e}/`,blockers:[e],blocks:[]})}catch(r){throw this.dispatch(ui(c)),this.dispatch(It(n)),r}}async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Get asset type field values",method:h.GET,url:"/asset-type-field-values/",queryParams:{limit:E,paginate:!0,asset__project:e},blockers:[],blocks:[]},n=>({immediate:!0,description:"Get asset type field values",method:h.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(hd(c)),c}}class Cb extends v{add(e){var l;const{store:i}=this.client,a=(l=i.getState().userReducer.currentUser)==null?void 0:l.id,c=new Date().toISOString(),n=T({...e,created_by:a,submitted_at:c});this.dispatch(pi(n));const r=this.enqueueRequest({description:"Create asset type",method:h.POST,url:"/asset-types/",payload:w(n),blockers:[],blocks:[n.uuid]});return r.then(m=>{this.dispatch(it(m))}).catch(()=>{this.dispatch(Ai(n.uuid))}),[n,r]}update(e){const{store:i}=this.client,a=yi(e.uuid)(i.getState());if(!a)throw new Error(`Expected asset type with uuid ${e.uuid} to exist`);const c={...a,...e};this.dispatch(it(c));const n=this.enqueueRequest({description:"Update asset type",method:h.PATCH,url:`/asset-types/${e.uuid}/`,payload:{icon:e.icon,color:e.color,name:e.name,description:e.description},blockers:[a.uuid],blocks:[a.uuid]});return n.then(r=>{this.dispatch(it(r))}).catch(()=>{this.dispatch(it(a))}),[c,n]}async delete(e){const{store:i}=this.client,a=i.getState(),c=yi(e)(a);if(!c)throw new Error(`Expected asset type with uuid ${e} to exist`);const n=Ls(e)(a),r=Gr(e)(a);return this.dispatch(Ai(e)),this.dispatch(Gs(n.map(l=>l.uuid))),this.dispatch(ii(r.map(({uuid:l})=>l))),this.enqueueRequest({description:"Delete asset type",method:h.DELETE,url:`/asset-types/${e}/`,blockers:[e],blocks:[]}).catch(l=>{throw this.dispatch(pi(c)),this.dispatch(bt(n)),this.dispatch(si(r)),l})}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get asset types",method:h.GET,url:"/asset-types/",queryParams:{organization:e},blockers:[],blocks:[]},i);return this.dispatch(gd(a)),a}}class kb extends v{add(e){var l;const{store:i}=this.client,a=(l=i.getState().userReducer.currentUser)==null?void 0:l.id,c=new Date().toISOString(),n=T({...e,created_by:a,submitted_at:c});this.dispatch(gi(n));const r=this.enqueueRequest({description:"Create Category",method:h.POST,url:"/categories/",payload:w(n),blockers:[e.project],blocks:[n.uuid]});return[n,r]}update(e){const i=this.client.store.getState(),a=Pi(e.uuid)(i);if(!a)throw new Error(`Expected an existing category with uuid ${e.uuid}`);const c={...a,...e};this.dispatch(Rd(c));const n=this.enqueueRequest({description:"Edit Category",method:h.PATCH,url:`/categories/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return[c,n]}remove(e){const{store:i}=this.client,a=Pi(e)(i.getState());if(!a)throw new Error(`No category with uuid ${e} found in the store`);this.dispatch(vd(e));const c=this.enqueueRequest({description:"Delete Category",method:h.DELETE,url:`/categories/${a.uuid}/`,blockers:[a.uuid],blocks:[]});return c.catch(()=>{this.dispatch(gi(a))}),c}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get categories",method:h.GET,url:"/categories/",queryParams:{project__organization_owner:e},blocks:[],blockers:[]},i);return this.dispatch(_d(a)),a}}class Bb extends ke{constructor(){super(...arguments);S(this,"name","Document Attachment");S(this,"url","/document-attachments");S(this,"addAttachments",qd);S(this,"updateAttachments",zd);S(this,"removeAttachments",Dd);S(this,"removeAttachment",Ud);S(this,"setAttachment",Vd);S(this,"selectAttachment",Bd)}buildOfflineAttachment(i){return T({file:URL.createObjectURL(i.file),file_sha1:i.file_sha1,created_by:i.created_by,file_name:i.file.name,file_type:i.file.type,submitted_at:i.submitted_at,description:i.description,document:i.modelUuid})}buildAttachmentPayload(i){return{...i,document:i.modelUuid}}async bulkAdd(i){var p;const{store:a}=this.client,c=(p=a.getState().userReducer.currentUser)==null?void 0:p.id,n=new Date().toISOString(),r=[],l=[],m={},u={};for(const A of i){const{documentUuid:f,file:b}=A,P=await this.getFilePayload(b);P.sha1 in m||(m[P.sha1]=P,u[P.sha1]=[]);const _=this.buildOfflineAttachment({file:b,file_sha1:P.sha1,submitted_at:n,created_by:c,description:"",modelUuid:f});r.push(_),l.push({uuid:_.uuid,file_name:_.file_name,file_sha1:_.file_sha1,file_extension:P.extension,description:_.description,document:f}),u[P.sha1].push(_.uuid)}this.dispatch(this.addAttachments(r));const o=this.enqueueRequest({description:"Attach files to document",method:h.POST,url:"/document-attachments/bulk/",payload:{submitted_at:n,attachments:l,files:Object.values(m)},blocks:r.map(A=>A.uuid),blockers:r.map(A=>A.file_sha1)});return o.then(({attachments:A,presigned_urls:f})=>{this.dispatch(this.updateAttachments(A));const b=this.processPresignedUrls(f);for(const[P,_]of Object.entries(b))_.then(()=>{const R=u[P];for(const z of R)this.makeReadable(z)})}).catch(()=>{this.dispatch(this.removeAttachments(r.map(A=>A.uuid)))}),[r,o.then(({attachments:A})=>A)]}async delete(i){return this._delete(i)}makeReadable(i){this.enqueueRequest({description:"Add attachment to AI assistant",method:h.PATCH,url:`/document-attachments/${i}/`,payload:{readable_to_assistant:!0},blockers:["index-document-attachment",i],blocks:["index-document-attachment"]})}async refreshStore(i,a){const c=await this.enqueueRequest({immediate:!0,description:"Get document attachments",method:h.GET,url:"/document-attachments/",queryParams:{document__project__organization_owner:i},blocks:[],blockers:[]},a),n=await this.enqueueRequest({immediate:!0,description:"Get document attachments",method:h.GET,url:"/document-attachments/",queryParams:{document__organization:i},blocks:[],blockers:[]},a),r=[...c,...n];return this.dispatch(jd(r)),r}}class Gb extends v{add(e){var l;const{store:i}=this.client,a=(l=i.getState().userReducer.currentUser)==null?void 0:l.id,c=new Date().toISOString(),n=T({...e,created_by:a,submitted_at:c});this.dispatch(Nd([n]));const r=this.enqueueRequest({description:"Create Document",method:h.POST,url:"/documents/",payload:w(n),queryParams:{parent_document:n.parent_document??void 0},blockers:n.parent_document?[n.parent_document]:[],blocks:[n.uuid]});return r.catch(()=>{this.dispatch(Ii([n.uuid]))}),[n,r]}update(e){const{store:i}=this.client,a=i.getState().documentsReducer.documents[e.uuid];if(!a)throw new Error(`attempting to update a document with uuid ${e.uuid} that does not exist in store.documents`);const c={...a,...e};this.dispatch(We([c]));const n=this.enqueueRequest({description:"Update Document",method:h.PATCH,url:`/documents/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return n.catch(()=>{We([a])}),[c,n]}delete(e){const{store:i}=this.client,a=Rt(i.getState()),c=Hd(e)(i.getState());if(!c)throw new Error(`attempting to delete a document with uuid ${e} that does not exist in store.documents`);const n=c.parent_document?a[c.parent_document]:void 0;this.dispatch(Ii([e]));const r=this.enqueueRequest({description:"Delete Document",method:h.DELETE,url:`/documents/${e}/`,blockers:[e],blocks:[]});return r.then(l=>{this.dispatch(We(l))}).catch(()=>{this.dispatch(We([c])),n&&this.dispatch(We([n]))}),r}async refreshStore(e,i){const a=this.enqueueRequest({immediate:!0,description:"Get project documents",method:h.GET,url:"/documents/",queryParams:{project__organization_owner:e},blockers:[],blocks:[]},i),c=this.enqueueRequest({immediate:!0,description:"Get organization documents",method:h.GET,url:"/documents/",queryParams:{organization:e},blockers:[],blocks:[]},i),n=[...await a,...await c];return this.dispatch(Ld(n)),n}}class $b extends v{async add(e,i){return this.enqueueRequest({description:"Add email domain to organization",method:h.POST,url:"/organization-email-domains/",payload:{email:i,organization:e},blockers:[e,"create-org"],blocks:[]})}async remove(e){return this.dispatch(Jd(e.uuid)),this.enqueueRequest({description:"Remove email domain from organization",method:h.DELETE,url:`/organization-email-domains/${e.uuid}/`,blockers:[e.domain],blocks:[]}).catch(i=>{throw this.dispatch(Zd(e)),i})}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Fetch email domains for organization",method:h.GET,url:"/organization-email-domains/",queryParams:{organization:e},blockers:[e],blocks:[]},i);return this.dispatch(Kd(a)),a}}class Lb extends v{async getVerificationCode(e){return this.enqueueRequest({description:"Get verification code",method:h.GET,url:`/verification/email-verification/${e}/`,isAuthNeeded:!1,blockers:[],blocks:[]})}validateVerificationCode(e,i=void 0){return this.enqueueRequest({description:"Validate verification code",method:h.POST,url:`/verification/email-verification/${e}/`,isAuthNeeded:!1,payload:i,blockers:[],blocks:[]})}}const Bt={},lc=new Set;let Gt=0,hc=0,mc=0;const Nb=20;class Hb extends v{constructor(){super(...arguments);S(this,"host");S(this,"_dbPromise",gm.openDB("fileCache",1,{upgrade(i){i.createObjectStore("files")}}))}async renewUploadUrl(i){const a=await this.fetchCache(i);if(!a)throw new Error(`File with sha1 ${i} not found in cache`);const c=await Yt(a,i),n=await this.enqueueRequest({description:"Get S3 URL",method:h.GET,url:"/authentication/files/presigned-upload-url/",queryParams:{sha1:await He(a),file_type:a.type,extension:a.name.split(".").pop(),size:a.size.toString()},blockers:[],blocks:[`s3-${c}`]});return"url"in n&&this.dispatch(su({sha1:i,...n})),n}async addCache(i,a){if(lc.has(a))return;if(!i.type){const r=i.name.split("."),l=r[r.length-1];i=new File([i],i.name,{type:l})}if(!i.name||!i.size||!i.type)throw new Error("Cannot add files to cache that do not have a name, size and type.");const c=await this._dbPromise;!!await c.get("files",a)?(console.error("File already cached (this is unexpected at this point):",i.name,a),Gt++):(await c.put("files",i,a),hc++),lc.add(a),mc++,mc%Nb===0&&console.debug(`File cache summary: ${Gt} hits and ${hc} misses, ${Gt/(Gt+hc)*100}% hit rate over ${mc} calls to addCache.`)}async removeCache(i){await(await this._dbPromise).delete("files",i),lc.delete(i)}async fetchCache(i){return(await this._dbPromise).get("files",i)}async getOrRenewUploadUrl(i){const a=this.client.store.getState();return iu(i)(a)??await this.renewUploadUrl(i)}async uploadFileToS3(i){const a=await this.fetchCache(i);if(!a)throw new Error(`File with sha1 ${i} not found in cache`);const c=await Yt(a,i),n={file_name:a.name,file_sha1:i,file:c},r=await this.getOrRenewUploadUrl(i);if("warning"in r){if(r.warning==="already_uploaded")return[n,Promise.resolve(void 0).then()];throw new Error(r.warning)}const l=r.url,m=this.enqueueRequest({url:l,description:"Upload file",method:h.POST,isExternalUrl:!0,isAuthNeeded:!1,attachmentHash:i,blockers:[`s3-${c}`],blocks:[i],s3url:r});return[n,m]}async fetchFileFromUrl(i,a,c){const n=i.split("?")[0]??i,r=await this.fetchCache(a);if(r){if(!r.name)throw new Error("Cached file unexpectedly has no name.");return r}if(i.startsWith("blob:")){const o=await Tc(i),p=new File([o],c??a,{type:o.type});return await this.addCache(p,a),p}let l=Bt[n],m=!0;l?m=!1:(l=new Promise(o=>{this.enqueueRequest({description:"Download file",method:h.GET,url:i,isExternalUrl:!0,isResponseBlob:!0,isAuthNeeded:!1,blockers:[a],blocks:[a]}).then(p=>{const A=new File([p],c??a,{type:p.type});o(A)})}),Bt[n]=l);let u;try{u=await l}catch(o){throw m&&o instanceof D&&delete Bt[n],o}if(m){const o=await He(u);if(o!==a){const f=`The hash of the file returned from the server (${o}) does not match the
9
- expected hash (${a}). This can happen if you're using a local development server and the
1
+ (function(i,U){typeof exports=="object"&&typeof module<"u"?U(exports,require("@redux-offline/redux-offline/lib/types"),require("@reduxjs/toolkit"),require("superagent"),require("uuid"),require("react"),require("file-saver"),require("fast-tree-builder"),require("ts-tree-lib"),require("@redux-offline/redux-offline"),require("@redux-offline/redux-offline/lib/defaults"),require("localforage"),require("redux-persist-migrate"),require("buffer"),require("@overmap-ai/forms"),require("idb"),require("jwt-decode"),require("dependency-graph"),require("@tiptap/core")):typeof define=="function"&&define.amd?define(["exports","@redux-offline/redux-offline/lib/types","@reduxjs/toolkit","superagent","uuid","react","file-saver","fast-tree-builder","ts-tree-lib","@redux-offline/redux-offline","@redux-offline/redux-offline/lib/defaults","localforage","redux-persist-migrate","buffer","@overmap-ai/forms","idb","jwt-decode","dependency-graph","@tiptap/core"],U):(i=typeof globalThis<"u"?globalThis:i||self,U(i["overmap-core"]={},null,i.toolkit,i.request,i.uuid,i.react,i.fileSaver,i.buildTree,i.tsTreeLib,i.reduxOffline,i.offlineConfig,i.localforage,i.createMigration,null,null,i.idb,i.jwtDecode,i.dependencyGraph))})(this,function(i,U,o,Ft,mt,IP,OP,Na,Gt,FP,Ga,gP,_P,lv,uv,PP,bP,RP){"use strict";var rv=Object.defineProperty;var dv=(i,U,o)=>U in i?rv(i,U,{enumerable:!0,configurable:!0,writable:!0,value:o}):i[U]=o;var m=(i,U,o)=>dv(i,typeof U!="symbol"?U+"":U,o);var wP;const Ha=Object.freeze([]),Ka=Object.freeze({});var Ya=(t=>(t[t.GUEST=0]="GUEST",t[t.BASIC=2]="BASIC",t[t.ADMIN=4]="ADMIN",t))(Ya||{}),h=(t=>(t.GET="GET",t.POST="POST",t.PATCH="PATCH",t.PUT="PUT",t.DELETE="DELETE",t))(h||{}),Ja=(t=>(t[t.PLANNED=0]="PLANNED",t[t.ACTIVE=1]="ACTIVE",t[t.MAINTENANCE=2]="MAINTENANCE",t[t.INACTIVE=3]="INACTIVE",t[t.RETIRED=4]="RETIRED",t[t.DISPOSED=5]="DISPOSED",t))(Ja||{}),Za=(t=>(t.Issue="issue",t.Asset="asset",t.AssetType="asset_type",t.Project="project",t.Document="document",t))(Za||{}),ws=(t=>(t[t.LOWEST=0]="LOWEST",t[t.LOW=2]="LOW",t[t.MEDIUM=4]="MEDIUM",t[t.HIGH=6]="HIGH",t[t.HIGHEST=8]="HIGHEST",t))(ws||{}),$=(t=>(t.STATUS="status",t.PRIORITY="priority",t.DESCRIPTION="description",t.TITLE="title",t.ASSIGNED_TO="assigned_to",t.DUE_DATE="due_date",t))($||{}),Qa=(t=>(t[t.BACKLOG=0]="BACKLOG",t[t.PLANNED=1]="PLANNED",t[t.IN_PROGRESS=2]="IN_PROGRESS",t[t.COMPLETED=3]="COMPLETED",t[t.CANCELLED=4]="CANCELLED",t))(Qa||{}),Xa=(t=>(t[t.ADD_ASSIGNEE=0]="ADD_ASSIGNEE",t[t.REMOVE_ASSIGNEE=2]="REMOVE_ASSIGNEE",t[t.ADD_REVIEWER=4]="ADD_REVIEWER",t[t.REMOVE_REVIEWER=6]="REMOVE_REVIEWER",t[t.ADD_REVIEW_REQUEST=8]="ADD_REVIEW_REQUEST",t[t.REMOVE_REVIEW_REQUEST=10]="REMOVE_REVIEW_REQUEST",t))(Xa||{}),gt=(t=>(t[t.ACTIVE=0]="ACTIVE",t[t.COMPLETED=2]="COMPLETED",t[t.CANCELLED=4]="CANCELLED",t))(gt||{}),vt=(t=>(t[t.APPROVED=0]="APPROVED",t[t.REJECTED=2]="REJECTED",t[t.CHANGES_REQUESTED=4]="CHANGES_REQUESTED",t))(vt||{});const MP=ws.MEDIUM,xa=6e4,kP=[vt.APPROVED,vt.REJECTED,vt.CHANGES_REQUESTED],vP=[gt.ACTIVE,gt.COMPLETED,gt.CANCELLED],EP=gt.ACTIVE;function F(t){return{addOne:(p,f)=>{const y=t(f.payload);p.instances[y]=f.payload},addMany:(p,f)=>{for(const y of f.payload){const T=t(y);p.instances[T]=y}},setOne:(p,f)=>{const y=t(f.payload);p.instances[y]=f.payload},setMany:(p,f)=>{for(const y of f.payload){const T=t(y);p.instances[T]=y}},updateOne:(p,f)=>{const y=t(f.payload);p.instances[y]=f.payload},updateMany:(p,f)=>{for(const y of f.payload){const T=t(y);p.instances[T]=y}},deleteOne:(p,f)=>{delete p.instances[f.payload]},deleteMany:(p,f)=>{for(const y of f.payload)delete p.instances[y]},initialize:(p,f)=>{p.instances={};const y=new Set;for(const T of f.payload){const P=t(T);y.add(P),p.instances[P]=T}y.size!==f.payload.length&&console.warn("duplicate ids detected when initializing model instances.")}}}function VP(){return{initializeSelection:(l,u)=>{l.selection=Array.from(new Set(u.payload))},selectOne:(l,u)=>{new Set(l.selection).has(u.payload)||l.selection.push(u.payload)},selectMany:(l,u)=>{const p=new Set(l.selection);for(const f of u.payload)p.has(f)||p.add(f);l.selection=Array.from(p)},unselectOne:(l,u)=>{const p=new Set(l.selection);p.has(u.payload)&&(p.delete(u.payload),l.selection=Array.from(p))},unselectMany:(l,u)=>{const p=new Set(l.selection);for(const f of u.payload)p.has(f)&&p.delete(f);l.selection=Array.from(p)},toggleOne:(l,u)=>{const p=new Set(l.selection);p.has(u.payload)?p.delete(u.payload):p.add(u.payload),l.selection=Array.from(p)},toggleMany:(l,u)=>{const p=new Set(l.selection);for(const f of u.payload)p.has(f)?p.delete(f):p.add(f);l.selection=Array.from(p)},getInitialState:l=>({...l,selection:[]})}}const Et="versioning",I=o.createAction("RESET"),W=o.createAction("RESET_PROJECT_STATE"),g=o.createAction("RESET_ORGANIZATION_STATE");function WP(t,s){return IP.useMemo(t,s)}wP=Symbol.toStringTag;class Ts{constructor(){m(this,wP,"Promise");m(this,"_promise");m(this,"_resolve");m(this,"_reject");m(this,"_state","pending");this._resolve=null,this._reject=null,this._promise=new Promise((s,e)=>{this._resolve=s,this._reject=e})}get state(){return this._state}then(s,e){return this._promise.then(s,e)}catch(s){return this._promise.catch(s)}resolve(s){if(!this._resolve)throw new Error("No resolve callback");this._resolve(s),this._state="fulfilled"}reject(s){if(!this._reject)throw s;this._reject(s),this._state="rejected"}finally(s){throw new Error("`finally` not implemented")}}let Is=!1;["true","1"].includes("".toLowerCase())&&(Is=!0);function BP(t,s){if(t===s)return!0;if(typeof t!=typeof s)return!1;const e=Object.keys(t),n=Object.keys(s),a=e.length;if(a!==n.length)return!1;for(let c=0;c<a;c++){const r=e[c];if(!Object.prototype.hasOwnProperty.call(s,r)||t[r]!==s[r])return!1}return!0}function Os(t){const s={};return function(){const e=Array.prototype.slice.call(arguments);return e in s?(Is&&console.debug(`Memoization debug: Using memorized return value for ${t.toString()}(`,e,")"),s[e]):(Is&&console.debug(`Memoization debug: Cache miss! Memoizing ${t.toString()}(`,e,")"),s[e]=t.apply(this,e))}}function zP(t,s){if(t.length!==s.length)return!1;for(let e=0;e<t.length;e++)if(t[e]!==s[e])return!1;return!0}const A=t=>t.length===0?Ha:t,Ht=t=>Object.keys(t).length===0?Ka:t,ec=Os(t=>{if(!t)return"";const s=new Date(t),e=s.getFullYear()===Fs.getFullYear(),n={day:"numeric",month:"short"};return e||(n.year="numeric"),s.toLocaleDateString([],n)}),DP=new Intl.RelativeTimeFormat([],{style:"long",numeric:"auto"}),qP=1e3*86400,Fs=new Date,jP=t=>new Date(t).toDateString()===Fs.toDateString(),$P=Os((t,s,e)=>{const n=Math.round((new Date(t).getTime()-Fs.getTime())/qP);return n<s||n>e?ec(t):DP.format(n,"days")});function CP(t){return new Uint8Array(t).reduce((e,n)=>e+n.toString(16).padStart(2,"0"),"")}function Kt(t){return new Promise((s,e)=>{const n=new FileReader;n.onload=()=>{const a=n.result;if(!a){e(new Error("FileReader did not return a valid ArrayBuffer."));return}crypto.subtle.digest("SHA-1",a).then(c=>{const r=CP(c);s(r)})},n.readAsArrayBuffer(t)})}const UP=(t,s)=>`${t}${s?`.${s}`:""}`;function LP(t,s){return new File([t],s,{type:t.type})}function tc(t){const s=t.name;return s.includes(".")?s.split(".").pop():""}const sc=async t=>(await fetch(t)).blob(),ic=async(t,s)=>{const e=await sc(t);return new File([e],s,{type:e.type})};function NP(t){const s=new Blob([t]);OP.saveAs(s,t.name)}function nc(t){return typeof t=="string"&&t.startsWith("blob:")}function GP(t){return t.type.startsWith("image/")}const ac={};function HP(t,s,e,...n){const a=ac[t];let c=!1;a?a[s]||(a[s]=!0,c=!0):(ac[t]={[s]:!0},c=!0),c&&console[e](...n)}const cc=["created_at","updated_at","index","revision"];function O(t){return{...t,uuid:mt.v4()}}function KP(t){const s={};for(const e of t)s[e.uuid]=e;return s}function E(t){return t.map(({uuid:s})=>s)}function Yt(t,s){return t.localeCompare(s)}function gs(t,s){return Yt(t.uuid,s.uuid)}function YP(t,s=void 0,e=255){let n=t.replace(/[^a-z0-9_\-.]/gi,"_").replace(/_{2,}/g,"_");if(!s){const c=t.split(".");c.length>1&&(s=c[c.length-1])}s&&!s.startsWith(".")&&(s="."+s);const a=s?s.length:0;return n.length+a>e&&(n=n.slice(0,e-a)+(s||"")),n}function JP(t){return t.toLowerCase().replace(" ","-")}function ZP(t,s=!1){return t.normalize("NFKD").toLowerCase().replace(/[^\w\s-]/g,"").trim().replace(/[-\s]+/g,s?"_":"-")}function QP(t,s){if(t.length<=s)return t;const e=t.slice(0,s-1);return e.slice(0,e.lastIndexOf(" "))+"…"}const XP=/^.+@.+\..+$/;function b(t){const s={...t};for(const e of[...cc,"created_by"])e in s&&delete s[e];return s}const rc=t=>{const s=t.toSorted((e,n)=>e.order-n.order);return Na(s,{id:e=>e.uuid,parentId:e=>e.parent,includeEmptyChildrenArray:!0,valueKey:!1})},xP=t=>{const{roots:s}=rc(t);return s.map(e=>new Gt.Tree(e))},dc=(t,s)=>{const{nodes:e}=rc(s),n=e.get(t);if(!n)throw new Error(`Node with uuid ${t} does not exist in asset procedure step tree.`);return new Gt.Tree(n)},lc=(t,s)=>t.type!==s.type?t.type-s.type:t.order-s.order,uc=(t,s)=>t.type!==s.type?t.type-s.type:t.order-s.order,oc=t=>Na(t,{id:s=>s.uuid,parentId:s=>s.parent_document,includeEmptyChildrenArray:!0,valueKey:!1}),eb=t=>{const{roots:s}=oc(t);return s.map(e=>new Gt.Tree(e))},hc=(t,s)=>{const{nodes:e}=oc(s),n=e.get(t);if(!n)throw new Error(`Node with uuid ${t} does not exist in document tree.`);return new Gt.Tree(n)};class tb{constructor(s){m(this,"operations",[]);m(this,"getData");this.getData=s}performOperations(s){let e=s;for(const n of this.operations)e=n(e);return e}filter(s,e){return this.operations.push(n=>n.filter(a=>a[s]===e)),this}exclude(s,e){return this.operations.push(n=>n.filter(a=>a[s]!==e)),this}orderBy(s){return this.operations.push(e=>[...e].sort((n,a)=>n[s]<=a[s]?1:-1)),this}reverse(){return this.operations.push(s=>[...s].reverse()),this}all(){return this.operations.push(s=>s),this}get(s,e){return o.createSelector([this.getData],n=>this.performOperations(n).find(a=>a[s]===e))}count(){return o.createSelector([this.getData],s=>this.performOperations(s).length)}first(){return o.createSelector([this.getData],s=>this.performOperations(s)[0])}last(){return o.createSelector([this.getData],s=>{const e=this.performOperations(s);return e[e.length-1]})}exists(){return o.createSelector([this.getData],s=>this.performOperations(s).length>0)}toSelector(){return o.createSelector([this.getData],s=>A(this.performOperations(s)))}}const S=t=>(...s)=>e=>t(e,...s),N=F(t=>t.uuid),pc={instances:{}},_s=o.createSlice({name:"agents",initialState:pc,extraReducers:t=>t.addMatcher(o.isAnyOf(I,W,g),s=>Object.assign(s,pc)),reducers:{initializeConversations:N.initialize,addConversation:N.addOne,addConversations:N.addMany,setConversation:N.setOne,setConversations:N.setMany,updateConversation:N.updateOne,updateConversations:N.updateMany,deleteConversation:N.deleteOne,deleteConversations:N.deleteMany}}),{initializeConversations:mc,addConversation:fc,addConversations:sb,setConversation:yc,setConversations:ib,updateConversation:Sc,updateConversations:nb,deleteConversation:ab,deleteConversations:cb}=_s.actions,Ps=t=>t.agentsReducer.instances,rb=o.createSelector([Ps],t=>Object.values(t)),db=S(o.createSelector([Ps,(t,s)=>s],(t,s)=>t[s])),Ac=_s.reducer,G=F(t=>t.uuid),wc={instances:{}},bs=o.createSlice({name:"assetAttachments",initialState:wc,extraReducers:t=>t.addMatcher(o.isAnyOf(I,W,g),s=>Object.assign(s,wc)),reducers:{initializeAssetAttachments:G.initialize,addAssetAttachment:G.addOne,addAssetAttachments:G.addMany,setAssetAttachment:G.setOne,setAssetAttachments:G.setMany,updateAssetAttachment:G.updateOne,updateAssetAttachments:G.updateMany,deleteAssetAttachment:G.deleteOne,deleteAssetAttachments:G.deleteMany}}),{initializeAssetAttachments:Tc,addAssetAttachment:Ic,addAssetAttachments:Rs,setAssetAttachment:Oc,setAssetAttachments:Fc,updateAssetAttachment:gc,updateAssetAttachments:_c,deleteAssetAttachment:Pc,deleteAssetAttachments:Ms}=bs.actions,bc=t=>t.assetAttachmentReducer.instances,ks=o.createSelector([bc],t=>Object.values(t)),Rc=t=>s=>s.assetAttachmentReducer.instances[t],Mc=S(o.createSelector([ks,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),kc=S(o.createSelector([ks,(t,s)=>s],(t,s)=>A(t.filter(({asset:e})=>s===e)))),vc=bs.reducer,H=F(({uuid:t})=>t),Ec={instances:{}},vs=o.createSlice({name:"assetProcedureTypeAttachments",initialState:Ec,extraReducers:t=>t.addMatcher(o.isAnyOf(I,g),s=>Object.assign(s,Ec)),reducers:{initializeAssetProcedureTypeAttachments:H.initialize,addAssetProcedureTypeAttachment:H.addOne,addAssetProcedureTypeAttachments:H.addMany,setAssetProcedureTypeAttachment:H.setOne,setAssetProcedureTypeAttachments:H.setMany,updateAssetProcedureTypeAttachment:H.updateOne,updateAssetProcedureTypeAttachments:H.updateMany,deleteAssetProcedureTypeAttachment:H.deleteOne,deleteAssetProcedureTypeAttachments:H.deleteMany}}),{initializeAssetProcedureTypeAttachments:Vc,addAssetProcedureTypeAttachment:Wc,addAssetProcedureTypeAttachments:Bc,setAssetProcedureTypeAttachment:zc,setAssetProcedureTypeAttachments:Dc,updateAssetProcedureTypeAttachment:qc,updateAssetProcedureTypeAttachments:jc,deleteAssetProcedureTypeAttachment:$c,deleteAssetProcedureTypeAttachments:Cc}=vs.actions,Uc=vs.reducer,Lc=t=>t.assetProcedureTypeAttachmentReducer.instances,Es=o.createSelector([Lc],t=>Object.values(t)),Nc=t=>s=>s.assetProcedureTypeAttachmentReducer.instances[t],Gc=S(o.createSelector([Es,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),lb=S(o.createSelector([Es,(t,s)=>s],(t,s)=>A(t.filter(({asset_procedure_type:e})=>s===e)))),K=F(({uuid:t})=>t),Hc={instances:{}},Vs=o.createSlice({name:"assetProcedureTypeFieldsAttachments",initialState:Hc,extraReducers:t=>t.addMatcher(o.isAnyOf(I,g),s=>Object.assign(s,Hc)),reducers:{initializeAssetProcedureTypeFieldsAttachments:K.initialize,addAssetProcedureTypeFieldsAttachment:K.addOne,addAssetProcedureTypeFieldsAttachments:K.addMany,setAssetProcedureTypeFieldsAttachment:K.setOne,setAssetProcedureTypeFieldsAttachments:K.setMany,updateAssetProcedureTypeFieldsAttachment:K.updateOne,updateAssetProcedureTypeFieldsAttachments:K.updateMany,deleteAssetProcedureTypeFieldsAttachment:K.deleteOne,deleteAssetProcedureTypeFieldsAttachments:K.deleteMany}}),{initializeAssetProcedureTypeFieldsAttachments:Kc,addAssetProcedureTypeFieldsAttachment:Yc,addAssetProcedureTypeFieldsAttachments:Jc,setAssetProcedureTypeFieldsAttachment:Zc,setAssetProcedureTypeFieldsAttachments:Qc,updateAssetProcedureTypeFieldsAttachment:Xc,updateAssetProcedureTypeFieldsAttachments:xc,deleteAssetProcedureTypeFieldsAttachment:er,deleteAssetProcedureTypeFieldsAttachments:tr}=Vs.actions,sr=Vs.reducer,ir=t=>t.assetProcedureTypeFieldsAttachmentReducer.instances,Ws=o.createSelector([ir],t=>Object.values(t)),ub=S(o.createSelector([Ws,(t,s)=>s],(t,s)=>A(t.filter(e=>e.fields_revision===s)))),nr=t=>s=>s.assetProcedureTypeFieldsAttachmentReducer.instances[t],ar=S(o.createSelector([Ws,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Y=F(({uuid:t})=>t),cr={instances:{}},Bs=o.createSlice({name:"assetProcedureTypeFields",initialState:cr,extraReducers:t=>t.addMatcher(o.isAnyOf(I,g),s=>Object.assign(s,cr)),reducers:{initializeAssetProcedureTypeFields:Y.initialize,addAssetProcedureTypeFields:Y.addOne,addAssetProcedureTypeFieldsMany:Y.addMany,setAssetProcedureTypeFields:Y.setOne,setAssetProcedureTypeFieldsMany:Y.setMany,updateAssetProcedureTypeFields:Y.updateOne,updateAssetProcedureTypeFieldsMany:Y.updateMany,deleteAssetProcedureTypeFields:Y.deleteOne,deleteAssetProcedureTypeFieldsMany:Y.deleteMany}}),{initializeAssetProcedureTypeFields:rr,addAssetProcedureTypeFields:dr,addAssetProcedureTypeFieldsMany:lr,setAssetProcedureTypeFields:ur,setAssetProcedureTypeFieldsMany:or,updateAssetProcedureTypeFields:hr,updateAssetProcedureTypeFieldsMany:pr,deleteAssetProcedureTypeFields:mr,deleteAssetProcedureTypeFieldsMany:fr}=Bs.actions,yr=Bs.reducer,Sr=t=>t.assetProcedureTypeFieldsReducer.instances,Jt=o.createSelector([Sr],t=>Object.values(t)),ob=S(o.createSelector([Jt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure_type===s)))),hb=S(o.createSelector([Jt,(t,s)=>s],(t,s)=>t.filter(e=>e.asset_procedure_type===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),Ar=t=>s=>s.assetProcedureTypeFieldsReducer.instances[t],wr=S(o.createSelector([Jt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),J=F(({uuid:t})=>t),Tr={instances:{}},zs=o.createSlice({name:"assetProcedureTypeFieldValuesAttachments",initialState:Tr,extraReducers:t=>t.addMatcher(o.isAnyOf(I,W,g),s=>Object.assign(s,Tr)),reducers:{initializeAssetProcedureTypeFieldValuesAttachments:J.initialize,addAssetProcedureTypeFieldValuesAttachment:J.addOne,addAssetProcedureTypeFieldValuesAttachments:J.addMany,setAssetProcedureTypeFieldValuesAttachment:J.setOne,setAssetProcedureTypeFieldValuesAttachments:J.setMany,updateAssetProcedureTypeFieldValuesAttachment:J.updateOne,updateAssetProcedureTypeFieldValuesAttachments:J.updateMany,deleteAssetProcedureTypeFieldValuesAttachment:J.deleteOne,deleteAssetProcedureTypeFieldValuesAttachments:J.deleteMany}}),{initializeAssetProcedureTypeFieldValuesAttachments:Ir,addAssetProcedureTypeFieldValuesAttachment:Or,addAssetProcedureTypeFieldValuesAttachments:Ds,setAssetProcedureTypeFieldValuesAttachment:Fr,setAssetProcedureTypeFieldValuesAttachments:gr,updateAssetProcedureTypeFieldValuesAttachment:_r,updateAssetProcedureTypeFieldValuesAttachments:Pr,deleteAssetProcedureTypeFieldValuesAttachment:br,deleteAssetProcedureTypeFieldValuesAttachments:qs}=zs.actions,Rr=zs.reducer,Mr=t=>t.assetProcedureTypeFieldValuesAttachmentReducer.instances,js=o.createSelector([Mr],t=>Object.values(t)),kr=t=>s=>s.assetProcedureTypeFieldValuesAttachmentReducer.instances[t],vr=S(o.createSelector([js,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Er=S(o.createSelector([js,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),Z=F(({uuid:t})=>t),Vr={instances:{}},$s=o.createSlice({name:"assetProcedureTypeFieldValues",initialState:Vr,extraReducers:t=>t.addMatcher(o.isAnyOf(I,W,g),s=>Object.assign(s,Vr)),reducers:{initializeAssetProcedureTypeFieldValues:Z.initialize,addAssetProcedureTypeFieldValues:Z.addOne,addAssetProcedureTypeFieldValuesMany:Z.addMany,setAssetProcedureTypeFieldValues:Z.setOne,setAssetProcedureTypeFieldValuesMany:Z.setMany,updateAssetProcedureTypeFieldValues:Z.updateOne,updateAssetProcedureTypeFieldValuesMany:Z.updateMany,deleteAssetProcedureTypeFieldValues:Z.deleteOne,deleteAssetProcedureTypeFieldValuesMany:Z.deleteMany}}),{initializeAssetProcedureTypeFieldValues:Wr,addAssetProcedureTypeFieldValues:Br,addAssetProcedureTypeFieldValuesMany:zr,setAssetProcedureTypeFieldValues:Dr,setAssetProcedureTypeFieldValuesMany:qr,updateAssetProcedureTypeFieldValues:jr,updateAssetProcedureTypeFieldValuesMany:$r,deleteAssetProcedureTypeFieldValues:Cr,deleteAssetProcedureTypeFieldValuesMany:Ur}=$s.actions,Lr=$s.reducer,Nr=t=>t.assetProcedureTypeFieldValuesReducer.instances,Zt=o.createSelector([Nr],t=>Object.values(t)),pb=S(o.createSelector([Zt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset===s)))),mb=S(o.createSelector([Zt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure===s)))),Gr=t=>s=>s.assetProcedureTypeFieldValuesReducer.instances[t],Hr=S(o.createSelector([Zt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Q=F(({uuid:t})=>t),Kr={instances:{}},Cs=o.createSlice({name:"assetProcedures",initialState:Kr,extraReducers:t=>t.addMatcher(o.isAnyOf(I,W,g),s=>Object.assign(s,Kr)),reducers:{initializeAssetProcedures:Q.initialize,addAssetProcedure:Q.addOne,addAssetProcedures:Q.addMany,setAssetProcedure:Q.setOne,setAssetProcedures:Q.setMany,updateAssetProcedure:Q.updateOne,updateAssetProcedures:Q.updateMany,deleteAssetProcedure:Q.deleteOne,deleteAssetProcedures:Q.deleteMany}}),{initializeAssetProcedures:Yr,addAssetProcedure:Jr,addAssetProcedures:Us,updateAssetProcedure:Zr,updateAssetProcedures:Qr,deleteAssetProcedure:Xr,deleteAssetProcedures:Ls,setAssetProcedure:xr,setAssetProcedures:ed}=Cs.actions,td=Cs.reducer,sd=t=>t.assetProcedureReducer.instances,Qt=o.createSelector([sd],t=>Object.values(t)),id=S(o.createSelector([Qt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure_type===s)))),fb=S(o.createSelector([Qt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_type===s)))),nd=t=>s=>s.assetProcedureReducer.instances[t],ad=S(o.createSelector([Qt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),X=F(t=>t.uuid),cd={instances:{}},Ns=o.createSlice({name:"assetProcedureTypes",initialState:cd,extraReducers:t=>t.addMatcher(o.isAnyOf(I,g),s=>Object.assign(s,cd)),reducers:{initializeAssetProcedureTypes:X.initialize,addAssetProcedureType:X.addOne,addAssetProcedureTypes:X.addMany,setAssetProcedureType:X.setOne,setAssetProcedureTypes:X.setMany,updateAssetProcedureType:X.updateOne,updateAssetProcedureTypes:X.updateMany,deleteAssetProcedureType:X.deleteOne,deleteAssetProcedureTypes:X.deleteMany}}),{initializeAssetProcedureTypes:rd,addAssetProcedureType:dd,addAssetProcedureTypes:ld,updateAssetProcedureType:ud,updateAssetProcedureTypes:od,deleteAssetProcedureType:hd,deleteAssetProcedureTypes:pd,setAssetProcedureType:md,setAssetProcedureTypes:fd}=Ns.actions,yd=Ns.reducer,Sd=t=>t.assetProcedureTypeReducer.instances,Gs=o.createSelector([Sd],t=>Object.values(t)),Ad=t=>s=>s.assetProcedureTypeReducer.instances[t],wd=S(o.createSelector([Gs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),yb=S(o.createSelector([Gs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),x=F(t=>t.uuid),Td={instances:{}},Hs=o.createSlice({name:"assetProcedureStepFieldsAttachments",initialState:Td,extraReducers:t=>t.addMatcher(o.isAnyOf(I,g),s=>Object.assign(s,Td)),reducers:{initializeAssetProcedureStepFieldsAttachments:x.initialize,addAssetProcedureStepFieldsAttachment:x.addOne,addAssetProcedureStepFieldsAttachments:x.addMany,setAssetProcedureStepFieldsAttachment:x.setOne,setAssetProcedureStepFieldsAttachments:x.setMany,updateAssetProcedureStepFieldsAttachment:x.updateOne,updateAssetProcedureStepFieldsAttachments:x.updateMany,deleteAssetProcedureStepFieldsAttachment:x.deleteOne,deleteAssetProcedureStepFieldsAttachments:x.deleteMany}}),{initializeAssetProcedureStepFieldsAttachments:Id,addAssetProcedureStepFieldsAttachment:Od,addAssetProcedureStepFieldsAttachments:Fd,setAssetProcedureStepFieldsAttachment:gd,setAssetProcedureStepFieldsAttachments:_d,updateAssetProcedureStepFieldsAttachment:Pd,updateAssetProcedureStepFieldsAttachments:bd,deleteAssetProcedureStepFieldsAttachment:Rd,deleteAssetProcedureStepFieldsAttachments:Md}=Hs.actions,kd=t=>t.assetProcedureStepFieldsAttachmentReducer.instances,Ks=o.createSelector([kd],t=>Object.values(t)),Sb=S(o.createSelector([Ks,(t,s)=>s],(t,s)=>A(t.filter(e=>e.fields_revision===s)))),vd=t=>s=>s.assetProcedureStepFieldsAttachmentReducer.instances[t],Ed=S(o.createSelector([Ks,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Vd=Hs.reducer,ee=F(t=>t.uuid),Wd={instances:{}},Ys=o.createSlice({name:"assetProcedureStepFields",initialState:Wd,extraReducers:t=>t.addMatcher(o.isAnyOf(I,g),s=>Object.assign(s,Wd)),reducers:{initializeAssetProcedureStepFields:ee.initialize,addAssetProcedureStepFields:ee.addOne,addAssetProcedureStepFieldsMany:ee.addMany,setAssetProcedureStepFields:ee.setOne,setAssetProcedureStepFieldsMany:ee.setMany,updateAssetProcedureStepFields:ee.updateOne,updateAssetProcedureStepFieldsMany:ee.updateMany,deleteAssetProcedureStepFields:ee.deleteOne,deleteAssetProcedureStepFieldsMany:ee.deleteMany}}),{initializeAssetProcedureStepFields:Bd,addAssetProcedureStepFields:zd,addAssetProcedureStepFieldsMany:Dd,setAssetProcedureStepFields:qd,setAssetProcedureStepFieldsMany:jd,updateAssetProcedureStepFields:$d,updateAssetProcedureStepFieldsMany:Cd,deleteAssetProcedureStepFields:Ud,deleteAssetProcedureStepFieldsMany:Ld}=Ys.actions,Js=t=>t.assetProcedureStepFieldsReducer.instances,Xt=o.createSelector([Js],t=>Object.values(t)),Ab=S(o.createSelector([Xt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure_step===s)))),wb=S(o.createSelector([Xt,(t,s)=>s],(t,s)=>t.filter(e=>e.asset_procedure_step===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),Tb=o.createSelector([Js],t=>{const s={};for(const e of Object.values(t)){const n=s[e.asset_procedure_step];(!n||n.submitted_at<e.submitted_at)&&(s[e.asset_procedure_step]=e)}return s}),Nd=t=>s=>s.assetProcedureStepFieldsReducer.instances[t],Gd=S(o.createSelector([Xt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Hd=Ys.reducer,te=F(t=>t.uuid),Kd={instances:{}},Zs=o.createSlice({name:"assetProcedureStepFieldValuesAttachments",initialState:Kd,extraReducers:t=>t.addMatcher(o.isAnyOf(I,W,g),s=>Object.assign(s,Kd)),reducers:{initializeAssetProcedureStepFieldValuesAttachments:te.initialize,addAssetProcedureStepFieldValuesAttachment:te.addOne,addAssetProcedureStepFieldValuesAttachments:te.addMany,setAssetProcedureStepFieldValuesAttachment:te.setOne,setAssetProcedureStepFieldValuesAttachments:te.setMany,updateAssetProcedureStepFieldValuesAttachment:te.updateOne,updateAssetProcedureStepFieldValuesAttachments:te.updateMany,deleteAssetProcedureStepFieldValuesAttachment:te.deleteOne,deleteAssetProcedureStepFieldValuesAttachments:te.deleteMany}}),{initializeAssetProcedureStepFieldValuesAttachments:Yd,addAssetProcedureStepFieldValuesAttachment:Jd,addAssetProcedureStepFieldValuesAttachments:Qs,setAssetProcedureStepFieldValuesAttachment:Zd,setAssetProcedureStepFieldValuesAttachments:Qd,updateAssetProcedureStepFieldValuesAttachment:Xd,updateAssetProcedureStepFieldValuesAttachments:xd,deleteAssetProcedureStepFieldValuesAttachment:el,deleteAssetProcedureStepFieldValuesAttachments:Xs}=Zs.actions,tl=t=>t.assetProcedureStepFieldValuesAttachmentReducer.instances,xs=o.createSelector([tl],t=>Object.values(t)),sl=t=>s=>s.assetProcedureStepFieldValuesAttachmentReducer.instances[t],il=S(o.createSelector([xs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),nl=S(o.createSelector([xs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),al=Zs.reducer,se=F(t=>t.uuid),cl={instances:{}},ei=o.createSlice({name:"assetProcedureStepFieldValues",initialState:cl,extraReducers:t=>t.addMatcher(o.isAnyOf(I,W,g),s=>Object.assign(s,cl)),reducers:{initializeAssetProcedureStepFieldValues:se.initialize,addAssetProcedureStepFieldValues:se.addOne,addAssetProcedureStepFieldValuesMany:se.addMany,setAssetProcedureStepFieldValues:se.setOne,setAssetProcedureStepFieldValuesMany:se.setMany,updateAssetProcedureStepFieldValues:se.updateOne,updateAssetProcedureStepFieldValuesMany:se.updateMany,deleteAssetProcedureStepFieldValues:se.deleteOne,deleteAssetProcedureStepFieldValuesMany:se.deleteMany}}),{initializeAssetProcedureStepFieldValues:rl,addAssetProcedureStepFieldValues:dl,addAssetProcedureStepFieldValuesMany:ll,setAssetProcedureStepFieldValues:ul,setAssetProcedureStepFieldValuesMany:ol,updateAssetProcedureStepFieldValues:hl,updateAssetProcedureStepFieldValuesMany:pl,deleteAssetProcedureStepFieldValues:ml,deleteAssetProcedureStepFieldValuesMany:fl}=ei.actions,yl=t=>t.assetProcedureStepFieldValuesReducer.instances,Vt=o.createSelector([yl],t=>Object.values(t)),Ib=S(o.createSelector([Vt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset===s)))),Ob=S(o.createSelector([Vt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure===s)))),Fb=S(o.createSelector([Vt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure_step===s)))),Sl=t=>s=>s.assetProcedureStepFieldValuesReducer.instances[t],Al=S(o.createSelector([Vt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),wl=ei.reducer,ie=F(t=>t.uuid),Tl={instances:{}},ti=o.createSlice({name:"assetProcedureSteps",initialState:Tl,extraReducers:t=>t.addMatcher(o.isAnyOf(I,g),s=>Object.assign(s,Tl)),reducers:{initializeAssetProcedureSteps:ie.initialize,setAssetProcedureStep:ie.setOne,setAssetProcedureSteps:ie.setMany,addAssetProcedureStep:ie.addOne,addAssetProcedureSteps:ie.addMany,updateAssetProcedureStep:ie.updateOne,updateAssetProcedureSteps:ie.updateMany,deleteAssetProcedureStep:ie.deleteOne,deleteAssetProcedureSteps:ie.deleteMany}}),{initializeAssetProcedureSteps:Il,setAssetProcedureStep:Ol,setAssetProcedureSteps:Fl,addAssetProcedureStep:gl,addAssetProcedureSteps:_l,updateAssetProcedureStep:Pl,updateAssetProcedureSteps:bl,deleteAssetProcedureStep:Rl,deleteAssetProcedureSteps:Ml}=ti.actions,kl=ti.reducer,xt=t=>t.assetProcedureStepReducer.instances,vl=t=>s=>s.assetProcedureStepReducer.instances[t],si=o.createSelector([xt],t=>Object.values(t)),gb=S(o.createSelector([xt,(t,s)=>s],(t,s)=>{const e={};for(const[n,a]of Object.entries(t))a.asset_procedure_type===s&&(e[n]=a);return Ht(e)})),_b=S(o.createSelector([si,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure_type===s)))),El=S(o.createSelector([si,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Vl=S(o.createSelector([xt,(t,s)=>s],(t,s)=>{if(!t[s])return A([]);const a=dc(s,Object.values(t)).all().map(({model:c})=>c);return A(a)})),ne=F(t=>t.uuid),Wl={instances:{}},ii=o.createSlice({name:"assets",initialState:Wl,extraReducers:t=>t.addMatcher(o.isAnyOf(I,W,g),s=>Object.assign(s,Wl)),reducers:{initializeAssets:ne.initialize,addAsset:ne.addOne,addAssets:ne.addMany,setAsset:ne.setOne,setAssets:ne.setMany,updateAsset:ne.updateOne,updateAssets:ne.updateMany,deleteAsset:ne.deleteOne,deleteAssets:ne.deleteMany}}),{initializeAssets:Bl,addAsset:zl,addAssets:ni,updateAsset:Dl,updateAssets:ql,deleteAsset:jl,deleteAssets:ai,setAsset:$l,setAssets:Cl}=ii.actions,Ul=t=>t.assetReducer.instances,es=o.createSelector([Ul],t=>A(Object.values(t))),Pb=S(o.createSelector([es,(t,s)=>s],(t,s)=>A(t.filter(({project:e})=>e===s)))),Ll=S(o.createSelector([es,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_type===s)))),Nl=t=>s=>s.assetReducer.instances[t],Gl=S(o.createSelector([es,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Hl=ii.reducer,ae=F(t=>t.uuid),Kl={instances:{}},ci=o.createSlice({name:"assetStageCompletions",initialState:Kl,extraReducers:t=>t.addMatcher(o.isAnyOf(I,W,g),s=>Object.assign(s,Kl)),reducers:{initializeAssetStageCompletions:ae.initialize,addAssetStageCompletion:ae.addOne,addAssetStageCompletions:ae.addMany,setAssetStageCompletion:ae.setOne,setAssetStageCompletions:ae.setMany,updateAssetStageCompletion:ae.updateOne,updateAssetStageCompletions:ae.updateMany,deleteAssetStageCompletion:ae.deleteOne,deleteAssetStageCompletions:ae.deleteMany}}),{initializeAssetStageCompletions:Yl,addAssetStageCompletion:Jl,addAssetStageCompletions:Zl,setAssetStageCompletion:Ql,setAssetStageCompletions:Xl,updateAssetStageCompletion:xl,updateAssetStageCompletions:eu,deleteAssetStageCompletion:tu,deleteAssetStageCompletions:su}=ci.actions,iu=ci.reducer,nu=t=>t.assetStageCompletionReducer.instances,au=o.createSelector([nu],t=>Object.values(t)),cu=t=>s=>s.assetStageCompletionReducer.instances[t],ru=S(o.createSelector([au,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),ce=F(t=>t.uuid),du={instances:{}},ri=o.createSlice({name:"assetStages",initialState:du,extraReducers:t=>t.addMatcher(o.isAnyOf(I,g),s=>Object.assign(s,du)),reducers:{initializeAssetStages:ce.initialize,setAssetStage:ce.setOne,setAssetStages:ce.setMany,addAssetStage:ce.addOne,addAssetStages:ce.addMany,updateAssetStage:ce.updateOne,updateAssetStages:ce.updateMany,deleteAssetStage:ce.deleteOne,deleteAssetStages:ce.deleteMany}}),{initializeAssetStages:lu,setAssetStage:uu,setAssetStages:ou,addAssetStage:hu,addAssetStages:pu,updateAssetStage:mu,updateAssetStages:fu,deleteAssetStage:yu,deleteAssetStages:Su}=ri.actions,Au=ri.reducer,di=t=>t.assetStageReducer.instances,wu=t=>s=>s.assetStageReducer.instances[t],li=o.createSelector([di],t=>Object.values(t)),bb=S(o.createSelector([di,(t,s)=>s],(t,s)=>{const e={};for(const[n,a]of Object.entries(t))a.asset_procedure_type===s&&(e[n]=a);return Ht(e)})),Rb=S(o.createSelector([li,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure_type===s)))),Tu=S(o.createSelector([li,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),re=F(t=>t.uuid),Iu={instances:{}},ui=o.createSlice({name:"assetTypeAttachments",initialState:Iu,extraReducers:t=>t.addMatcher(o.isAnyOf(I,g),s=>Object.assign(s,Iu)),reducers:{initializeAssetTypeAttachments:re.initialize,addAssetTypeAttachment:re.addOne,addAssetTypeAttachments:re.addMany,setAssetTypeAttachment:re.setOne,setAssetTypeAttachments:re.setMany,updateAssetTypeAttachment:re.updateOne,updateAssetTypeAttachments:re.updateMany,deleteAssetTypeAttachment:re.deleteOne,deleteAssetTypeAttachments:re.deleteMany}}),{initializeAssetTypeAttachments:Ou,addAssetTypeAttachment:Fu,addAssetTypeAttachments:oi,setAssetTypeAttachment:gu,setAssetTypeAttachments:_u,updateAssetTypeAttachment:Pu,updateAssetTypeAttachments:bu,deleteAssetTypeAttachment:Ru,deleteAssetTypeAttachments:hi}=ui.actions,Mu=t=>t.assetTypeAttachmentReducer.instances,pi=o.createSelector([Mu],t=>Object.values(t)),ku=t=>s=>s.assetTypeAttachmentReducer.instances[t],vu=S(o.createSelector([pi,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Eu=S(o.createSelector([pi,(t,s)=>s],(t,s)=>A(t.filter(({asset_type:e})=>s===e)))),Vu=ui.reducer,de=F(t=>t.uuid),Wu={instances:{}},mi=o.createSlice({name:"assetTypeFieldsAttachments",initialState:Wu,extraReducers:t=>t.addMatcher(o.isAnyOf(I,g),s=>Object.assign(s,Wu)),reducers:{initializeAssetTypeFieldsAttachments:de.initialize,addAssetTypeFieldsAttachment:de.addOne,addAssetTypeFieldsAttachments:de.addMany,setAssetTypeFieldsAttachment:de.setOne,setAssetTypeFieldsAttachments:de.setMany,updateAssetTypeFieldsAttachment:de.updateOne,updateAssetTypeFieldsAttachments:de.updateMany,deleteAssetTypeFieldsAttachment:de.deleteOne,deleteAssetTypeFieldsAttachments:de.deleteMany}}),{initializeAssetTypeFieldsAttachments:Bu,addAssetTypeFieldsAttachment:zu,addAssetTypeFieldsAttachments:Du,setAssetTypeFieldsAttachment:qu,setAssetTypeFieldsAttachments:ju,updateAssetTypeFieldsAttachment:$u,updateAssetTypeFieldsAttachments:Cu,deleteAssetTypeFieldsAttachment:Uu,deleteAssetTypeFieldsAttachments:Lu}=mi.actions,Nu=t=>t.assetTypeFieldsAttachmentReducer.instances,fi=o.createSelector([Nu],t=>Object.values(t)),Mb=S(o.createSelector([fi,(t,s)=>s],(t,s)=>A(t.filter(e=>e.fields_revision===s)))),Gu=t=>s=>s.assetTypeFieldsAttachmentReducer.instances[t],Hu=S(o.createSelector([fi,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Ku=mi.reducer,le=F(t=>t.uuid),Yu={instances:{}},yi=o.createSlice({name:"assetTypeFields",initialState:Yu,extraReducers:t=>t.addMatcher(o.isAnyOf(I,g),s=>Object.assign(s,Yu)),reducers:{initializeAssetTypeFields:le.initialize,addAssetTypeFields:le.addOne,addAssetTypeFieldsMany:le.addMany,setAssetTypeFields:le.setOne,setAssetTypeFieldsMany:le.setMany,updateAssetTypeFields:le.updateOne,updateAssetTypeFieldsMany:le.updateMany,deleteAssetTypeFields:le.deleteOne,deleteAssetTypeFieldsMany:le.deleteMany}}),{initializeAssetTypeFields:Ju,addAssetTypeFields:Zu,addAssetTypeFieldsMany:Qu,setAssetTypeFields:Xu,setAssetTypeFieldsMany:xu,updateAssetTypeFields:eo,updateAssetTypeFieldsMany:to,deleteAssetTypeFields:so,deleteAssetTypeFieldsMany:io}=yi.actions,no=t=>t.assetTypeFieldsReducer.instances,Wt=o.createSelector([no],t=>Object.values(t)),kb=S(o.createSelector([Wt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_type===s)))),vb=S(o.createSelector([Wt,(t,s)=>s],(t,s)=>t.filter(e=>e.asset_type===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),ao=t=>s=>s.assetTypeFieldsReducer.instances[t],co=S(o.createSelector([Wt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),ro=yi.reducer,ue=F(t=>t.uuid),lo={instances:{}},Si=o.createSlice({name:"assetTypeFieldValuesAttachments",initialState:lo,extraReducers:t=>t.addMatcher(o.isAnyOf(I,W,g),s=>Object.assign(s,lo)),reducers:{initializeAssetTypeFieldValuesAttachments:ue.initialize,addAssetTypeFieldValuesAttachment:ue.addOne,addAssetTypeFieldValuesAttachments:ue.addMany,setAssetTypeFieldValuesAttachment:ue.setOne,setAssetTypeFieldValuesAttachments:ue.setMany,updateAssetTypeFieldValuesAttachment:ue.updateOne,updateAssetTypeFieldValuesAttachments:ue.updateMany,deleteAssetTypeFieldValuesAttachment:ue.deleteOne,deleteAssetTypeFieldValuesAttachments:ue.deleteMany}}),{initializeAssetTypeFieldValuesAttachments:uo,addAssetTypeFieldValuesAttachment:oo,addAssetTypeFieldValuesAttachments:Ai,setAssetTypeFieldValuesAttachment:ho,setAssetTypeFieldValuesAttachments:po,updateAssetTypeFieldValuesAttachment:mo,updateAssetTypeFieldValuesAttachments:fo,deleteAssetTypeFieldValuesAttachment:yo,deleteAssetTypeFieldValuesAttachments:wi}=Si.actions,So=t=>t.assetTypeFieldValuesAttachmentReducer.instances,Ti=o.createSelector([So],t=>Object.values(t)),Ao=t=>s=>s.assetTypeFieldValuesAttachmentReducer.instances[t],wo=S(o.createSelector([Ti,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),To=S(o.createSelector([Ti,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),Io=Si.reducer,oe=F(t=>t.uuid),Oo={instances:{}},Ii=o.createSlice({name:"assetTypeFieldValues",initialState:Oo,extraReducers:t=>t.addMatcher(o.isAnyOf(I,W,g),s=>Object.assign(s,Oo)),reducers:{initializeAssetTypeFieldValues:oe.initialize,addAssetTypeFieldValues:oe.addOne,addAssetTypeFieldValuesMany:oe.addMany,setAssetTypeFieldValues:oe.setOne,setAssetTypeFieldValuesMany:oe.setMany,updateAssetTypeFieldValues:oe.updateOne,updateAssetTypeFieldValuesMany:oe.updateMany,deleteAssetTypeFieldValues:oe.deleteOne,deleteAssetTypeFieldValuesMany:oe.deleteMany}}),{initializeAssetTypeFieldValues:Fo,addAssetTypeFieldValues:go,addAssetTypeFieldValuesMany:_o,setAssetTypeFieldValues:Po,setAssetTypeFieldValuesMany:bo,updateAssetTypeFieldValues:Ro,updateAssetTypeFieldValuesMany:Mo,deleteAssetTypeFieldValues:ko,deleteAssetTypeFieldValuesMany:vo}=Ii.actions,Eo=t=>t.assetTypeFieldValuesReducer.instances,ts=o.createSelector([Eo],t=>Object.values(t)),Eb=S(o.createSelector([ts,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset===s)))),Vb=S(o.createSelector([Wt,ts,(t,s)=>s],(t,s,e)=>{const n=new Set(t.filter(a=>a.asset_type===e).map(a=>a.uuid));return A(s.filter(a=>n.has(a.fields_revision)))})),Vo=t=>s=>s.assetTypeFieldValuesReducer.instances[t],Wo=S(o.createSelector([ts,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Bo=Ii.reducer,he=F(t=>t.uuid),zo={instances:{}},Oi=o.createSlice({name:"assetTypeIdentifiers",initialState:zo,extraReducers:t=>t.addMatcher(o.isAnyOf(I,g),s=>Object.assign(s,zo)),reducers:{initializeAssetTypeIdentifiers:he.initialize,addAssetTypeIdentifier:he.addOne,addAssetTypeIdentifiers:he.addMany,setAssetTypeIdentifier:he.setOne,setAssetTypeIdentifiers:he.setMany,updateAssetTypeIdentifier:he.updateOne,updateAssetTypeIdentifiers:he.updateMany,deleteAssetTypeIdentifier:he.deleteOne,deleteAssetTypeIdentifiers:he.deleteMany}}),{initializeAssetTypeIdentifiers:Do,addAssetTypeIdentifier:qo,addAssetTypeIdentifiers:jo,setAssetTypeIdentifier:$o,setAssetTypeIdentifiers:Co,updateAssetTypeIdentifier:Uo,updateAssetTypeIdentifiers:Lo,deleteAssetTypeIdentifier:No,deleteAssetTypeIdentifiers:Go}=Oi.actions,Ho=t=>t.assetTypeIdentifierReducer.instances,Fi=o.createSelector([Ho],t=>Object.values(t)),Ko=t=>s=>s.assetTypeIdentifierReducer.instances[t],Yo=S(o.createSelector([Fi,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Wb=S(o.createSelector([Fi,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_type===s)))),Jo=Oi.reducer,pe=F(t=>t.uuid),Zo={instances:{}},gi=o.createSlice({name:"assetTypeIdentifierValues",initialState:Zo,extraReducers:t=>t.addMatcher(o.isAnyOf(I,W,g),s=>Object.assign(s,Zo)),reducers:{initializeAssetTypeIdentifierValues:pe.initialize,addAssetTypeIdentifierValue:pe.addOne,addAssetTypeIdentifierValues:pe.addMany,setAssetTypeIdentifierValue:pe.setOne,setAssetTypeIdentifierValues:pe.setMany,updateAssetTypeIdentifierValue:pe.updateOne,updateAssetTypeIdentifierValues:pe.updateMany,deleteAssetTypeIdentifierValue:pe.deleteOne,deleteAssetTypeIdentifierValues:pe.deleteMany}}),{initializeAssetTypeIdentifierValues:Qo,addAssetTypeIdentifierValue:Xo,addAssetTypeIdentifierValues:xo,setAssetTypeIdentifierValue:eh,setAssetTypeIdentifierValues:th,updateAssetTypeIdentifierValue:sh,updateAssetTypeIdentifierValues:ih,deleteAssetTypeIdentifierValue:nh,deleteAssetTypeIdentifierValues:ah}=gi.actions,ch=t=>t.assetTypeIdentifierValueReducer.instances,ss=o.createSelector([ch],t=>Object.values(t)),rh=t=>s=>s.assetTypeIdentifierValueReducer.instances[t],dh=S(o.createSelector([ss,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Bb=S(o.createSelector([ss,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset===s)))),zb=S(o.createSelector([ss,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_type_identifier===s)))),lh=gi.reducer,me=F(t=>t.uuid),uh={instances:{}},_i=o.createSlice({name:"assetTypes",initialState:uh,extraReducers:t=>t.addMatcher(o.isAnyOf(I,g),s=>Object.assign(s,uh)),reducers:{initializeAssetTypes:me.initialize,setAssetType:me.setOne,setAssetTypes:me.setMany,addAssetType:me.addOne,addAssetTypes:me.addMany,updateAssetType:me.updateOne,updateAssetTypes:me.updateMany,deleteAssetType:me.deleteOne,deleteAssetTypes:me.deleteMany}}),{initializeAssetTypes:oh,setAssetType:hh,setAssetTypes:ph,addAssetType:mh,addAssetTypes:fh,updateAssetType:yh,updateAssetTypes:Sh,deleteAssetType:Ah,deleteAssetTypes:wh}=_i.actions,Th=t=>t.assetTypeReducer.instances,Pi=o.createSelector([Th],t=>Object.values(t)),Ih=t=>s=>s.assetTypeReducer.instances[t],Oh=S(o.createSelector([Pi,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Db=S(o.createSelector([Pi,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),Fh=_i.reducer,fe=F(t=>t.uuid),gh={instances:{}},bi=o.createSlice({name:"assetTypeStatuses",initialState:gh,extraReducers:t=>t.addMatcher(o.isAnyOf(I,g),s=>Object.assign(s,gh)),reducers:{initializeAssetTypeStatuses:fe.initialize,addAssetTypeStatus:fe.addOne,addAssetTypeStatuses:fe.addMany,setAssetTypeStatus:fe.setOne,setAssetTypeStatuses:fe.setMany,updateAssetTypeStatus:fe.updateOne,updateAssetTypeStatuses:fe.updateMany,deleteAssetTypeStatus:fe.deleteOne,deleteAssetTypeStatuses:fe.deleteMany}}),{initializeAssetTypeStatuses:_h,addAssetTypeStatus:Ph,addAssetTypeStatuses:bh,setAssetTypeStatus:Rh,setAssetTypeStatuses:Mh,updateAssetTypeStatus:kh,updateAssetTypeStatuses:vh,deleteAssetTypeStatus:Eh,deleteAssetTypeStatuses:Vh}=bi.actions,Wh=t=>t.assetTypeStatusReducer.instances,Ri=o.createSelector([Wh],t=>A(Object.values(t).toSorted(lc))),Bh=t=>s=>s.assetTypeStatusReducer.instances[t],zh=S(o.createSelector([Ri,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),qb=S(o.createSelector([Ri,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_type===s)))),Dh=bi.reducer,qh={accessToken:"",refreshToken:"",isLoggedIn:!1},is=o.createSlice({name:"auth",initialState:qh,extraReducers:t=>t.addCase(I,s=>Object.assign(s,qh)),reducers:{setTokens:(t,s)=>{t.accessToken=s.payload.accessToken,t.refreshToken=s.payload.refreshToken},clearTokens:t=>{t.accessToken="",t.refreshToken=""},setLoggedIn:(t,s)=>{s.payload||is.caseReducers.clearTokens(t),t.isLoggedIn=s.payload}}}),{setTokens:jb,clearTokens:$b,setLoggedIn:jh}=is.actions,Cb=t=>t.authReducer.accessToken,Ub=t=>t.authReducer.isLoggedIn,$h=is.reducer,ye=F(t=>t.uuid),Ch={instances:{}},Mi=o.createSlice({name:"documentAttachments",initialState:Ch,extraReducers:t=>t.addCase(I,s=>Object.assign(s,Ch)),reducers:{initializeDocumentAttachments:ye.initialize,addDocumentAttachment:ye.addOne,addDocumentAttachments:ye.addMany,setDocumentAttachment:ye.setOne,setDocumentAttachments:ye.setMany,updateDocumentAttachment:ye.updateOne,updateDocumentAttachments:ye.updateMany,deleteDocumentAttachment:ye.deleteOne,deleteDocumentAttachments:ye.deleteMany}}),{initializeDocumentAttachments:Uh,addDocumentAttachment:Lh,addDocumentAttachments:Nh,setDocumentAttachment:Gh,setDocumentAttachments:Hh,updateDocumentAttachment:Kh,updateDocumentAttachments:Yh,deleteDocumentAttachment:Jh,deleteDocumentAttachments:Zh}=Mi.actions,Qh=t=>t.documentAttachmentReducer.instances,ki=o.createSelector([Qh],t=>Object.values(t)),Xh=t=>s=>s.documentAttachmentReducer.instances[t],xh=S(o.createSelector([ki,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Lb=S(o.createSelector([ki,(t,s)=>s],(t,s)=>A(t.filter(({document:e})=>s===e)))),ep=Mi.reducer,Se=F(({uuid:t})=>t),tp={instances:{}},vi=o.createSlice({name:"documents",initialState:tp,extraReducers:t=>t.addMatcher(o.isAnyOf(I,g),s=>{Object.assign(s,tp)}),reducers:{initializeDocuments:Se.initialize,addDocument:Se.addOne,addDocuments:Se.addMany,setDocument:Se.setOne,setDocuments:Se.setMany,updateDocument:Se.updateOne,updateDocuments:Se.updateMany,deleteDocument:Se.deleteOne,deleteDocuments:Se.deleteMany}}),{initializeDocuments:sp,addDocument:ip,addDocuments:np,setDocument:ap,setDocuments:cp,updateDocument:rp,updateDocuments:dp,deleteDocument:lp,deleteDocuments:up}=vi.actions,op=vi.reducer,Ei=t=>t.documentsReducer.instances,ns=o.createSelector([Ei],t=>Object.values(t)),hp=t=>s=>s.documentsReducer.instances[t],pp=S(o.createSelector([ns,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Nb=S(o.createSelector([ns,(t,s)=>s],(t,s)=>t.filter(e=>e.project===s))),Gb=S(o.createSelector([ns,(t,s)=>s],(t,s)=>t.filter(e=>e.organization===s))),mp=S(o.createSelector([Ei,(t,s)=>s],(t,s)=>{if(!t[s])return A([]);const a=hc(s,Object.values(t)).all().map(({model:c})=>c);return A(a)})),Ae=F(t=>t.uuid),fp={instances:{}},Vi=o.createSlice({name:"emailDomains",initialState:fp,extraReducers:t=>t.addMatcher(o.isAnyOf(I,g),s=>Object.assign(s,fp)),reducers:{initializeEmailDomains:Ae.initialize,addEmailDomain:Ae.addOne,addEmailDomains:Ae.addMany,setEmailDomain:Ae.setOne,setEmailDomains:Ae.setMany,updateEmailDomain:Ae.updateOne,updateEmailDomains:Ae.updateMany,deleteEmailDomain:Ae.deleteOne,deleteEmailDomains:Ae.deleteMany}}),{initializeEmailDomains:yp,addEmailDomain:Sp,addEmailDomains:Ap,setEmailDomain:wp,setEmailDomains:Tp,updateEmailDomain:Ip,updateEmailDomains:Op,deleteEmailDomain:Fp,deleteEmailDomains:gp}=Vi.actions,_p=t=>t.emailDomainsReducer.instances,Wi=o.createSelector([_p],t=>Object.values(t)),Pp=t=>s=>s.emailDomainsReducer.instances[t],bp=S(o.createSelector([Wi,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Hb=S(o.createSelector([Wi,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),Rp=Vi.reducer,Mp={s3Urls:{}},kp=1e3*60*60,Kb=kp*24*7,Bi=o.createSlice({name:"file",initialState:Mp,extraReducers:t=>t.addCase(I,s=>Object.assign(s,Mp)),reducers:{setUploadUrl:(t,s)=>{const{url:e,fields:n,sha1:a}=s.payload,c=new Date,r=new Date(c.getTime()+Kb);t.s3Urls[a]={url:e,fields:n,exp:r.getTime()}}}}),{setUploadUrl:Yb}=Bi.actions,Jb=t=>s=>{const e=s.fileReducer.s3Urls[t];if(!e)return;const n=new Date().getTime();if(!((e.exp??n)-n<kp))return e},vp=Bi.reducer,we=F(t=>t.uuid),Ep={instances:{}},zi=o.createSlice({name:"formIdentifiers",initialState:Ep,extraReducers:t=>t.addMatcher(o.isAnyOf(I,g),s=>Object.assign(s,Ep)),reducers:{initializeFormIdentifiers:we.initialize,addFormIdentifier:we.addOne,addFormIdentifiers:we.addMany,setFormIdentifier:we.setOne,setFormIdentifiers:we.setMany,updateFormIdentifier:we.updateOne,updateFormIdentifiers:we.updateMany,deleteFormIdentifier:we.deleteOne,deleteFormIdentifiers:we.deleteMany}}),{initializeFormIdentifiers:Vp,addFormIdentifier:Wp,addFormIdentifiers:Bp,setFormIdentifier:zp,setFormIdentifiers:Dp,updateFormIdentifier:qp,updateFormIdentifiers:jp,deleteFormIdentifier:$p,deleteFormIdentifiers:Cp}=zi.actions,Up=t=>t.formIdentifierReducer.instances,Di=o.createSelector([Up],t=>Object.values(t)),Lp=t=>s=>s.formIdentifierReducer.instances[t],Np=S(o.createSelector([Di,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Zb=S(o.createSelector([Di,(t,s)=>s],(t,s)=>A(t.filter(e=>e.form===s)))),Gp=zi.reducer,Te=F(t=>t.uuid),Hp={instances:{}},qi=o.createSlice({name:"formIdentifierValues",initialState:Hp,extraReducers:t=>t.addMatcher(o.isAnyOf(I,g),s=>Object.assign(s,Hp)),reducers:{initializeFormIdentifierValues:Te.initialize,addFormIdentifierValue:Te.addOne,addFormIdentifierValues:Te.addMany,setFormIdentifierValue:Te.setOne,setFormIdentifierValues:Te.setMany,updateFormIdentifierValue:Te.updateOne,updateFormIdentifierValues:Te.updateMany,deleteFormIdentifierValue:Te.deleteOne,deleteFormIdentifierValues:Te.deleteMany}}),{initializeFormIdentifierValues:Kp,addFormIdentifierValue:Yp,addFormIdentifierValues:Jp,setFormIdentifierValue:Zp,setFormIdentifierValues:Qp,updateFormIdentifierValue:Xp,updateFormIdentifierValues:xp,deleteFormIdentifierValue:em,deleteFormIdentifierValues:tm}=qi.actions,sm=t=>t.formIdentifierValueReducer.instances,as=o.createSelector([sm],t=>Object.values(t)),im=t=>s=>s.formIdentifierValueReducer.instances[t],nm=S(o.createSelector([as,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Qb=S(o.createSelector([as,(t,s)=>s],(t,s)=>A(t.filter(e=>e.form_submission===s)))),Xb=S(o.createSelector([as,(t,s)=>s],(t,s)=>A(t.filter(e=>e.form_identifier===s)))),am=qi.reducer,Ie=F(t=>t.uuid),cm={instances:{}},ji=o.createSlice({name:"formRevisionAttachments",initialState:cm,extraReducers:t=>t.addMatcher(o.isAnyOf(I,g),s=>Object.assign(s,cm)),reducers:{initializeFormRevisionAttachments:Ie.initialize,addFormRevisionAttachment:Ie.addOne,addFormRevisionAttachments:Ie.addMany,setFormRevisionAttachment:Ie.setOne,setFormRevisionAttachments:Ie.setMany,updateFormRevisionAttachment:Ie.updateOne,updateFormRevisionAttachments:Ie.updateMany,deleteFormRevisionAttachment:Ie.deleteOne,deleteFormRevisionAttachments:Ie.deleteMany}}),{initializeFormRevisionAttachments:rm,addFormRevisionAttachment:dm,addFormRevisionAttachments:lm,setFormRevisionAttachment:um,setFormRevisionAttachments:om,updateFormRevisionAttachment:hm,updateFormRevisionAttachments:pm,deleteFormRevisionAttachment:mm,deleteFormRevisionAttachments:fm}=ji.actions,cs=t=>t.formRevisionAttachmentReducer.instances,ym=o.createSelector([cs],t=>Object.values(t)),Sm=S(o.createSelector([cs,(t,s)=>s],(t,s)=>t[s])),Am=S(o.createSelector([ym,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),xb=S(o.createSelector([cs,(t,s)=>s],(t,s)=>A(Object.values(t).filter(e=>e.form_revision===s)))),wm=ji.reducer,Oe=F(t=>t.uuid),Tm={instances:{}},$i=o.createSlice({name:"formRevisions",initialState:Tm,extraReducers:t=>t.addMatcher(o.isAnyOf(I,g),s=>Object.assign(s,Tm)),reducers:{initializeFormRevisions:Oe.initialize,addFormRevision:Oe.addOne,addFormRevisions:Oe.addMany,setFormRevision:Oe.setOne,setFormRevisions:Oe.setMany,updateFormRevision:Oe.updateOne,updateFormRevisions:Oe.updateMany,deleteFormRevision:Oe.deleteOne,deleteFormRevisions:Oe.deleteMany}}),{initializeFormRevisions:Im,addFormRevision:Ci,addFormRevisions:Ui,setFormRevision:Om,setFormRevisions:Fm,updateFormRevision:gm,updateFormRevisions:_m,deleteFormRevision:Li,deleteFormRevisions:Ni}=$i.actions,Gi=t=>t.formRevisionReducer.instances,rs=o.createSelector([Gi],t=>Object.values(t)),Pm=t=>s=>s.formRevisionReducer.instances[t],bm=S(o.createSelector([rs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),eR=S(o.createSelector([rs,(t,s)=>s],(t,s)=>t.filter(e=>e.form===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),Rm=S(o.createSelector([rs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.form===s)))),Mm=$i.reducer,Fe=F(t=>t.uuid),km={instances:{}},Hi=o.createSlice({name:"forms",initialState:km,extraReducers:t=>t.addMatcher(o.isAnyOf(I,g),s=>Object.assign(s,km)),reducers:{initializeForms:Fe.initialize,addForm:Fe.addOne,addForms:Fe.addMany,setForm:Fe.setOne,setForms:Fe.setMany,updateForm:Fe.updateOne,updateForms:Fe.updateMany,deleteForm:Fe.deleteOne,deleteForms:Fe.deleteMany}}),{initializeForms:vm,addForm:Em,addForms:Vm,setForm:Wm,setForms:Bm,updateForm:zm,updateForms:Dm,deleteForm:qm,deleteForms:jm}=Hi.actions,$m=Hi.reducer,Cm=t=>t.formReducer.instances,Ki=o.createSelector([Cm],t=>Object.values(t)),Um=t=>s=>s.formReducer.instances[t],Lm=S(o.createSelector([Ki,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),tR=S(o.createSelector([Ki,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),ge=F(t=>t.uuid),Nm={instances:{}},Yi=o.createSlice({name:"formSubmissionAttachments",initialState:Nm,extraReducers:t=>t.addMatcher(o.isAnyOf(I,g),s=>Object.assign(s,Nm)),reducers:{initializeFormSubmissionAttachments:ge.initialize,addFormSubmissionAttachment:ge.addOne,addFormSubmissionAttachments:ge.addMany,setFormSubmissionAttachment:ge.setOne,setFormSubmissionAttachments:ge.setMany,updateFormSubmissionAttachment:ge.updateOne,updateFormSubmissionAttachments:ge.updateMany,deleteFormSubmissionAttachment:ge.deleteOne,deleteFormSubmissionAttachments:ge.deleteMany}}),{initializeFormSubmissionAttachments:Gm,addFormSubmissionAttachment:Hm,addFormSubmissionAttachments:Ji,setFormSubmissionAttachment:Km,setFormSubmissionAttachments:Ym,updateFormSubmissionAttachment:Jm,updateFormSubmissionAttachments:Zm,deleteFormSubmissionAttachment:Qm,deleteFormSubmissionAttachments:Zi}=Yi.actions,Qi=t=>t.formSubmissionAttachmentReducer.instances,Xi=o.createSelector([Qi],t=>Object.values(t)),Xm=S(o.createSelector([Qi,(t,s)=>s],(t,s)=>t[s])),xi=S(o.createSelector([Xi,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(n=>e.has(n.uuid)))})),xm=xi,ef=S(o.createSelector([Xi,(t,s)=>s],(t,s)=>A(t.filter(e=>e.form_submission===s)))),tf=Yi.reducer,_e=F(t=>t.uuid),sf={instances:{}},en=o.createSlice({name:"formSubmissions",initialState:sf,extraReducers:t=>t.addMatcher(o.isAnyOf(I,g),s=>Object.assign(s,sf)),reducers:{initializeFormSubmissions:_e.initialize,setFormSubmission:_e.setOne,setFormSubmissions:_e.setMany,addFormSubmission:_e.addOne,addFormSubmissions:_e.addMany,updateFormSubmission:_e.updateOne,updateFormSubmissions:_e.updateMany,deleteFormSubmission:_e.deleteOne,deleteFormSubmissions:_e.deleteMany}}),{initializeFormSubmissions:nf,setFormSubmission:af,setFormSubmissions:cf,addFormSubmission:rf,addFormSubmissions:tn,updateFormSubmission:df,updateFormSubmissions:lf,deleteFormSubmission:uf,deleteFormSubmissions:sn}=en.actions,nn=t=>t.formSubmissionReducer.instances,of=o.createSelector([nn],t=>Object.values(t)),hf=t=>s=>s.formSubmissionReducer.instances[t],pf=S(o.createSelector([of,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),mf=S(o.createSelector([nn,Gi,(t,s)=>s],(t,s,e)=>{const n=new Set;for(const a of Object.values(s))a.form===e&&n.add(a.uuid);return Object.values(t).filter(a=>n.has(a.form_revision))})),ff=en.reducer,Pe=F(t=>t.uuid),yf={instances:{}},an=o.createSlice({name:"geoImages",initialState:yf,extraReducers:t=>t.addMatcher(o.isAnyOf(I,W,g),s=>Object.assign(s,yf)),reducers:{initializeGeoImages:Pe.initialize,setGeoImage:Pe.setOne,setGeoImages:Pe.setMany,addGeoImage:Pe.addOne,addGeoImages:Pe.addMany,updateGeoImage:Pe.updateOne,updateGeoImages:Pe.updateMany,deleteGeoImage:Pe.deleteOne,deleteGeoImages:Pe.deleteMany}}),{initializeGeoImages:Sf,setGeoImage:Af,setGeoImages:wf,addGeoImage:Tf,addGeoImages:If,updateGeoImage:Of,updateGeoImages:Ff,deleteGeoImage:gf,deleteGeoImages:_f}=an.actions,Pf=t=>t.geoImageReducer.instances,cn=o.createSelector([Pf],t=>Object.values(t)),bf=t=>s=>s.geoImageReducer.instances[t],Rf=S(o.createSelector([cn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),sR=S(o.createSelector([cn,(t,s)=>s],(t,s)=>A(t.filter(e=>e.project===s)))),Mf=an.reducer,be=F(t=>t.uuid),kf={instances:{}},rn=o.createSlice({name:"issueAssociations",initialState:kf,extraReducers:t=>t.addMatcher(o.isAnyOf(I,W,g),s=>Object.assign(s,kf)),reducers:{initializeIssueAssociations:be.initialize,addIssueAssociation:be.addOne,addIssueAssociations:be.addMany,setIssueAssociation:be.setOne,setIssueAssociations:be.setMany,updateIssueAssociation:be.updateOne,updateIssueAssociations:be.updateMany,deleteIssueAssociation:be.deleteOne,deleteIssueAssociations:be.deleteMany}}),{initializeIssueAssociations:vf,setIssueAssociations:Ef,setIssueAssociation:Vf,updateIssueAssociation:Wf,updateIssueAssociations:Bf,addIssueAssociation:zf,addIssueAssociations:St,deleteIssueAssociation:Df,deleteIssueAssociations:At}=rn.actions,qf=t=>t.issueAssociationReducer.instances,wt=o.createSelector([qf],t=>Object.values(t)),jf=t=>s=>s.issueAssociationReducer.instances[t],$f=S(o.createSelector([wt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Cf=S(o.createSelector([wt,(t,s)=>s],(t,s)=>A(t.filter(({associated_issue:e})=>e===s)))),Uf=S(o.createSelector([wt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({associated_issue:n})=>e.has(n)))})),Lf=S(o.createSelector([wt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({issue:n})=>n&&e.has(n)))})),Nf=S(o.createSelector([wt,(t,s)=>s],(t,s)=>A(t.filter(({issue:e})=>e===s)))),Gf=S(o.createSelector([wt,(t,s)=>s],(t,s)=>A(t.filter(({asset:e})=>e===s)))),Hf=rn.reducer,Re=F(t=>t.uuid),Kf={instances:{}},dn=o.createSlice({name:"issueAttachments",initialState:Kf,extraReducers:t=>t.addMatcher(o.isAnyOf(I,W,g),s=>Object.assign(s,Kf)),reducers:{initializeIssueAttachments:Re.initialize,addIssueAttachment:Re.addOne,addIssueAttachments:Re.addMany,setIssueAttachment:Re.setOne,setIssueAttachments:Re.setMany,updateIssueAttachment:Re.updateOne,updateIssueAttachments:Re.updateMany,deleteIssueAttachment:Re.deleteOne,deleteIssueAttachments:Re.deleteMany}}),{initializeIssueAttachments:Yf,addIssueAttachment:Jf,addIssueAttachments:ln,setIssueAttachment:Zf,setIssueAttachments:Qf,updateIssueAttachment:Xf,updateIssueAttachments:xf,deleteIssueAttachment:ey,deleteIssueAttachments:un}=dn.actions,ty=t=>t.issueAttachmentReducer.instances,on=o.createSelector([ty],t=>Object.values(t)),sy=S(o.createSelector([on,(t,s)=>s],(t,s)=>A(t.filter(({issue:e})=>s===e)))),iy=t=>s=>s.issueAttachmentReducer.instances[t],ny=S(o.createSelector([on,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),ay=dn.reducer,Me=F(t=>t.uuid),cy={instances:{}},hn=o.createSlice({name:"issueCommentAttachments",initialState:cy,extraReducers:t=>t.addMatcher(o.isAnyOf(I,W,g),s=>Object.assign(s,cy)),reducers:{initializeIssueCommentAttachments:Me.initialize,addIssueCommentAttachment:Me.addOne,addIssueCommentAttachments:Me.addMany,setIssueCommentAttachment:Me.setOne,setIssueCommentAttachments:Me.setMany,updateIssueCommentAttachment:Me.updateOne,updateIssueCommentAttachments:Me.updateMany,deleteIssueCommentAttachment:Me.deleteOne,deleteIssueCommentAttachments:Me.deleteMany}}),{initializeIssueCommentAttachments:ry,addIssueCommentAttachment:dy,addIssueCommentAttachments:ly,setIssueCommentAttachment:uy,setIssueCommentAttachments:oy,updateIssueCommentAttachment:hy,updateIssueCommentAttachments:py,deleteIssueCommentAttachment:my,deleteIssueCommentAttachments:fy}=hn.actions,yy=t=>t.issueCommentAttachmentReducer.instances,pn=o.createSelector([yy],t=>Object.values(t)),Sy=t=>s=>s.issueCommentAttachmentReducer.instances[t],Ay=S(o.createSelector([pn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),iR=S(o.createSelector([pn,(t,s)=>s],(t,s)=>A(t.filter(({issue_comment:e})=>s===e)))),wy=hn.reducer,ke=F(t=>t.uuid),Ty={instances:{}},mn=o.createSlice({name:"issueComments",initialState:Ty,extraReducers:t=>t.addMatcher(o.isAnyOf(I,W,g),s=>Object.assign(s,Ty)),reducers:{initializeIssueComments:ke.initialize,addIssueComment:ke.addOne,addIssueComments:ke.addMany,setIssueComment:ke.setOne,setIssueComments:ke.setMany,updateIssueComment:ke.updateOne,updateIssueComments:ke.updateMany,deleteIssueComment:ke.deleteOne,deleteIssueComments:ke.deleteMany}}),{initializeIssueComments:Iy,addIssueComment:Oy,addIssueComments:Fy,setIssueComment:gy,setIssueComments:_y,updateIssueComment:Py,updateIssueComments:by,deleteIssueComment:Ry,deleteIssueComments:My}=mn.actions,fn=t=>t.issueCommentReducer.instances,ky=t=>s=>s.issueCommentReducer.instances[t],vy=S(o.createSelector([fn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(Object.values(t).filter(({uuid:n})=>e.has(n)))})),nR=S(o.createSelector([fn,(t,s)=>s],(t,s)=>A(Object.values(t).filter(e=>e.issue===s)))),Ey=mn.reducer,ve=F(t=>t.uuid),Vy={instances:{}},yn=o.createSlice({name:"issues",initialState:Vy,extraReducers:t=>t.addMatcher(o.isAnyOf(I,W,g),s=>Object.assign(s,Vy)),reducers:{initializeIssues:ve.initialize,addIssue:ve.addOne,addIssues:ve.addMany,setIssue:ve.setOne,setIssues:ve.setMany,updateIssue:ve.updateOne,updateIssues:ve.updateMany,deleteIssue:ve.deleteOne,deleteIssues:ve.deleteMany}}),{initializeIssues:Wy,addIssue:By,addIssues:Sn,setIssue:zy,setIssues:Dy,updateIssue:qy,updateIssues:jy,deleteIssue:$y,deleteIssues:An}=yn.actions,Cy=t=>t.issueReducer.instances,ds=o.createSelector([Cy],t=>Object.values(t)),Uy=t=>s=>s.issueReducer.instances[t],Ly=S(o.createSelector([ds,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),aR=S(o.createSelector([ds,(t,s)=>s],(t,s)=>t.filter(e=>e.project===s))),Ny=S(o.createSelector([ds,(t,s)=>s],(t,s)=>t.filter(e=>e.issue_type===s))),Gy=yn.reducer,Ee=F(t=>t.uuid),Hy={instances:{}},wn=o.createSlice({name:"issueTypeAttachments",initialState:Hy,extraReducers:t=>t.addMatcher(o.isAnyOf(I,g),s=>Object.assign(s,Hy)),reducers:{initializeIssueTypeAttachments:Ee.initialize,addIssueTypeAttachment:Ee.addOne,addIssueTypeAttachments:Ee.addMany,setIssueTypeAttachment:Ee.setOne,setIssueTypeAttachments:Ee.setMany,updateIssueTypeAttachment:Ee.updateOne,updateIssueTypeAttachments:Ee.updateMany,deleteIssueTypeAttachment:Ee.deleteOne,deleteIssueTypeAttachments:Ee.deleteMany}}),{initializeIssueTypeAttachments:Ky,addIssueTypeAttachment:Yy,addIssueTypeAttachments:Jy,setIssueTypeAttachment:Zy,setIssueTypeAttachments:Qy,updateIssueTypeAttachment:Xy,updateIssueTypeAttachments:xy,deleteIssueTypeAttachment:eS,deleteIssueTypeAttachments:tS}=wn.actions,sS=t=>t.issueTypeAttachmentReducer.instances,Tn=o.createSelector([sS],t=>Object.values(t)),iS=t=>s=>s.issueTypeAttachmentReducer.instances[t],nS=S(o.createSelector([Tn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),cR=S(o.createSelector([Tn,(t,s)=>s],(t,s)=>A(t.filter(({issue_type:e})=>s===e)))),aS=wn.reducer,Ve=F(t=>t.uuid),cS={instances:{}},In=o.createSlice({name:"issueTypeFieldsAttachments",initialState:cS,extraReducers:t=>t.addMatcher(o.isAnyOf(I,g),s=>Object.assign(s,cS)),reducers:{initializeIssueTypeFieldsAttachments:Ve.initialize,addIssueTypeFieldsAttachment:Ve.addOne,addIssueTypeFieldsAttachments:Ve.addMany,setIssueTypeFieldsAttachment:Ve.setOne,setIssueTypeFieldsAttachments:Ve.setMany,updateIssueTypeFieldsAttachment:Ve.updateOne,updateIssueTypeFieldsAttachments:Ve.updateMany,deleteIssueTypeFieldsAttachment:Ve.deleteOne,deleteIssueTypeFieldsAttachments:Ve.deleteMany}}),{initializeIssueTypeFieldsAttachments:rS,addIssueTypeFieldsAttachment:dS,addIssueTypeFieldsAttachments:lS,setIssueTypeFieldsAttachment:uS,setIssueTypeFieldsAttachments:oS,updateIssueTypeFieldsAttachment:hS,updateIssueTypeFieldsAttachments:pS,deleteIssueTypeFieldsAttachment:mS,deleteIssueTypeFieldsAttachments:fS}=In.actions,yS=t=>t.issueTypeFieldsAttachmentReducer.instances,On=o.createSelector([yS],t=>Object.values(t)),rR=S(o.createSelector([On,(t,s)=>s],(t,s)=>A(t.filter(e=>e.fields_revision===s)))),SS=t=>s=>s.issueTypeFieldsAttachmentReducer.instances[t],AS=S(o.createSelector([On,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),wS=In.reducer,We=F(t=>t.uuid),TS={instances:{}},Fn=o.createSlice({name:"issueTypeFieldValues",initialState:TS,extraReducers:t=>t.addMatcher(o.isAnyOf(I,W,g),s=>Object.assign(s,TS)),reducers:{initializeIssueTypeFieldValues:We.initialize,addIssueTypeFieldValues:We.addOne,addIssueTypeFieldValuesMany:We.addMany,setIssueTypeFieldValues:We.setOne,setIssueTypeFieldValuesMany:We.setMany,updateIssueTypeFieldValues:We.updateOne,updateIssueTypeFieldValuesMany:We.updateMany,deleteIssueTypeFieldValues:We.deleteOne,deleteIssueTypeFieldValuesMany:We.deleteMany}}),{initializeIssueTypeFieldValues:IS,addIssueTypeFieldValues:OS,addIssueTypeFieldValuesMany:FS,setIssueTypeFieldValues:gS,setIssueTypeFieldValuesMany:_S,updateIssueTypeFieldValues:PS,updateIssueTypeFieldValuesMany:bS,deleteIssueTypeFieldValues:RS,deleteIssueTypeFieldValuesMany:MS}=Fn.actions,kS=t=>t.issueTypeFieldValuesReducer.instances,ls=o.createSelector([kS],t=>Object.values(t)),dR=S(o.createSelector([ls,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue===s)))),vS=t=>s=>s.issueTypeFieldValuesReducer.instances[t],ES=S(o.createSelector([ls,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),VS=Fn.reducer,Be=F(t=>t.uuid),WS={instances:{}},gn=o.createSlice({name:"issueTypeFields",initialState:WS,extraReducers:t=>t.addMatcher(o.isAnyOf(I,g),s=>Object.assign(s,WS)),reducers:{initializeIssueTypeFields:Be.initialize,addIssueTypeFields:Be.addOne,addIssueTypeFieldsMany:Be.addMany,setIssueTypeFields:Be.setOne,setIssueTypeFieldsMany:Be.setMany,updateIssueTypeFields:Be.updateOne,updateIssueTypeFieldsMany:Be.updateMany,deleteIssueTypeFields:Be.deleteOne,deleteIssueTypeFieldsMany:Be.deleteMany}}),{initializeIssueTypeFields:BS,addIssueTypeFields:zS,addIssueTypeFieldsMany:DS,setIssueTypeFields:qS,setIssueTypeFieldsMany:jS,updateIssueTypeFields:$S,updateIssueTypeFieldsMany:CS,deleteIssueTypeFields:US,deleteIssueTypeFieldsMany:LS}=gn.actions,NS=t=>t.issueTypeFieldsReducer.instances,Bt=o.createSelector([NS],t=>Object.values(t)),lR=S(o.createSelector([Bt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue_type===s)))),uR=S(o.createSelector([Bt,(t,s)=>s],(t,s)=>t.filter(e=>e.issue_type===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),oR=S(o.createSelector([Bt,ls,(t,s)=>s],(t,s,e)=>{const n=new Set(t.filter(a=>a.issue_type===e).map(a=>a.uuid));return A(s.filter(a=>n.has(a.fields_revision)))})),GS=t=>s=>s.issueTypeFieldsReducer.instances[t],HS=S(o.createSelector([Bt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),KS=gn.reducer,ze=F(t=>t.uuid),YS={instances:{}},_n=o.createSlice({name:"issueTypeFieldValuesAttachments",initialState:YS,extraReducers:t=>t.addMatcher(o.isAnyOf(I,W,g),s=>Object.assign(s,YS)),reducers:{initializeIssueTypeFieldValuesAttachments:ze.initialize,addIssueTypeFieldValuesAttachment:ze.addOne,addIssueTypeFieldValuesAttachments:ze.addMany,setIssueTypeFieldValuesAttachment:ze.setOne,setIssueTypeFieldValuesAttachments:ze.setMany,updateIssueTypeFieldValuesAttachment:ze.updateOne,updateIssueTypeFieldValuesAttachments:ze.updateMany,deleteIssueTypeFieldValuesAttachment:ze.deleteOne,deleteIssueTypeFieldValuesAttachments:ze.deleteMany}}),{initializeIssueTypeFieldValuesAttachments:JS,addIssueTypeFieldValuesAttachment:ZS,addIssueTypeFieldValuesAttachments:Pn,setIssueTypeFieldValuesAttachment:QS,setIssueTypeFieldValuesAttachments:XS,updateIssueTypeFieldValuesAttachment:xS,updateIssueTypeFieldValuesAttachments:eA,deleteIssueTypeFieldValuesAttachment:tA,deleteIssueTypeFieldValuesAttachments:bn}=_n.actions,sA=t=>t.issueTypeFieldValuesAttachmentReducer.instances,Rn=o.createSelector([sA],t=>Object.values(t)),iA=t=>s=>s.issueTypeFieldValuesAttachmentReducer.instances[t],nA=S(o.createSelector([Rn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),aA=S(o.createSelector([Rn,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),cA=_n.reducer,De=F(t=>t.uuid),rA={instances:{}},Mn=o.createSlice({name:"issueTypeIdentifiers",initialState:rA,extraReducers:t=>t.addMatcher(o.isAnyOf(I,g),s=>Object.assign(s,rA)),reducers:{initializeIssueTypeIdentifiers:De.initialize,addIssueTypeIdentifier:De.addOne,addIssueTypeIdentifiers:De.addMany,setIssueTypeIdentifier:De.setOne,setIssueTypeIdentifiers:De.setMany,updateIssueTypeIdentifier:De.updateOne,updateIssueTypeIdentifiers:De.updateMany,deleteIssueTypeIdentifier:De.deleteOne,deleteIssueTypeIdentifiers:De.deleteMany}}),{initializeIssueTypeIdentifiers:dA,addIssueTypeIdentifier:lA,addIssueTypeIdentifiers:uA,setIssueTypeIdentifier:oA,setIssueTypeIdentifiers:hA,updateIssueTypeIdentifier:pA,updateIssueTypeIdentifiers:mA,deleteIssueTypeIdentifier:fA,deleteIssueTypeIdentifiers:yA}=Mn.actions,SA=t=>t.issueTypeIdentifierReducer.instances,kn=o.createSelector([SA],t=>Object.values(t)),AA=t=>s=>s.issueTypeIdentifierReducer.instances[t],wA=S(o.createSelector([kn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),hR=S(o.createSelector([kn,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue_type===s)))),TA=Mn.reducer,qe=F(t=>t.uuid),IA={instances:{}},vn=o.createSlice({name:"issueTypeIdentifierValues",initialState:IA,extraReducers:t=>t.addMatcher(o.isAnyOf(I,W,g),s=>Object.assign(s,IA)),reducers:{initializeIssueTypeIdentifierValues:qe.initialize,addIssueTypeIdentifierValue:qe.addOne,addIssueTypeIdentifierValues:qe.addMany,setIssueTypeIdentifierValue:qe.setOne,setIssueTypeIdentifierValues:qe.setMany,updateIssueTypeIdentifierValue:qe.updateOne,updateIssueTypeIdentifierValues:qe.updateMany,deleteIssueTypeIdentifierValue:qe.deleteOne,deleteIssueTypeIdentifierValues:qe.deleteMany}}),{initializeIssueTypeIdentifierValues:OA,addIssueTypeIdentifierValue:FA,addIssueTypeIdentifierValues:gA,setIssueTypeIdentifierValue:_A,setIssueTypeIdentifierValues:PA,updateIssueTypeIdentifierValue:bA,updateIssueTypeIdentifierValues:RA,deleteIssueTypeIdentifierValue:MA,deleteIssueTypeIdentifierValues:kA}=vn.actions,vA=t=>t.issueTypeIdentifierValueReducer.instances,us=o.createSelector([vA],t=>Object.values(t)),EA=t=>s=>s.issueTypeIdentifierValueReducer.instances[t],VA=S(o.createSelector([us,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),pR=S(o.createSelector([us,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue===s)))),mR=S(o.createSelector([us,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue_type_identifier===s)))),WA=vn.reducer,je=F(t=>t.uuid),BA={instances:{}},En=o.createSlice({name:"issueTypes",initialState:BA,extraReducers:t=>t.addMatcher(o.isAnyOf(I,g),s=>Object.assign(s,BA)),reducers:{initializeIssueTypes:je.initialize,addIssueType:je.addOne,addIssueTypes:je.addMany,setIssueType:je.setOne,setIssueTypes:je.setMany,updateIssueType:je.updateOne,updateIssueTypes:je.updateMany,deleteIssueType:je.deleteOne,deleteIssueTypes:je.deleteMany}}),{initializeIssueTypes:zA,addIssueType:DA,addIssueTypes:qA,setIssueType:jA,setIssueTypes:$A,updateIssueType:CA,updateIssueTypes:UA,deleteIssueType:LA,deleteIssueTypes:NA}=En.actions,GA=t=>t.issueTypeReducer.instances,Vn=o.createSelector(GA,t=>Object.values(t)),HA=t=>s=>s.issueTypeReducer.instances[t],KA=S(o.createSelector([Vn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),fR=S(o.createSelector([Vn,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),YA=En.reducer,$e=F(t=>t.uuid),JA={instances:{}},Wn=o.createSlice({name:"issueTypeStatuses",initialState:JA,extraReducers:t=>t.addMatcher(o.isAnyOf(I,g),s=>Object.assign(s,JA)),reducers:{initializeIssueTypeStatuses:$e.initialize,addIssueTypeStatus:$e.addOne,addIssueTypeStatuses:$e.addMany,setIssueTypeStatus:$e.setOne,setIssueTypeStatuses:$e.setMany,updateIssueTypeStatus:$e.updateOne,updateIssueTypeStatuses:$e.updateMany,deleteIssueTypeStatus:$e.deleteOne,deleteIssueTypeStatuses:$e.deleteMany}}),{initializeIssueTypeStatuses:ZA,addIssueTypeStatus:QA,addIssueTypeStatuses:XA,setIssueTypeStatus:xA,setIssueTypeStatuses:ew,updateIssueTypeStatus:tw,updateIssueTypeStatuses:sw,deleteIssueTypeStatus:iw,deleteIssueTypeStatuses:nw}=Wn.actions,aw=t=>t.issueTypeStatusReducer.instances,Bn=o.createSelector([aw],t=>A(Object.values(t).toSorted(uc))),zn=t=>s=>s.issueTypeStatusReducer.instances[t],cw=S(o.createSelector([Bn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),yR=S(o.createSelector([Bn,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue_type===s)))),rw=Wn.reducer,Ce=F(t=>t.uuid),dw={instances:{}},Dn=o.createSlice({name:"issueUpdates",initialState:dw,extraReducers:t=>t.addMatcher(o.isAnyOf(I,W,g),s=>Object.assign(s,dw)),reducers:{initializeIssueUpdates:Ce.initialize,addIssueUpdate:Ce.addOne,addIssueUpdates:Ce.addMany,setIssueUpdate:Ce.setOne,setIssueUpdates:Ce.setMany,updateIssueUpdate:Ce.updateOne,updateIssueUpdates:Ce.updateMany,deleteIssueUpdate:Ce.deleteOne,deleteIssueUpdates:Ce.deleteMany}}),{initializeIssueUpdates:lw,addIssueUpdate:qn,addIssueUpdates:jn,setIssueUpdate:uw,setIssueUpdates:ow,updateIssueUpdate:hw,updateIssueUpdates:pw,deleteIssueUpdate:$n,deleteIssueUpdates:Cn}=Dn.actions,Un=t=>t.issueUpdateReducer.instances,Ln=o.createSelector([Un],t=>Object.values(t)),mw=S(o.createSelector([Un,(t,s)=>s],(t,s)=>t[s])),fw=S(o.createSelector([Ln,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),yw=S(o.createSelector([Ln,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue===s)))),Sw=Dn.reducer,Ue=F(t=>t.id),Aw={instances:{},currentUser:null},Nn=o.createSlice({name:"users",initialState:Aw,extraReducers:t=>t.addCase(I,s=>Object.assign(s,Aw)).addCase(g,s=>Object.assign(s,{...s,instances:[]})),reducers:{initializeUsers:Ue.initialize,setUsers:Ue.setMany,setUser:Ue.setOne,addUsers:Ue.addMany,addUser:Ue.addOne,updateUsers:Ue.updateMany,updateUser:Ue.updateOne,deleteUser:Ue.deleteOne,deleteUsers:Ue.deleteMany,setCurrentUser:(t,s)=>{t.currentUser=s.payload},setCurrentUserProfile:(t,s)=>{if(!t.currentUser)return;t.currentUser.profile=s.payload;const e=t.instances[t.currentUser.id];if(!e)throw new Error("Unable to find current user in users slice");e.profile=s.payload}}}),{initializeUsers:ww,setUsers:Tw,setUser:Iw,addUsers:Ow,addUser:Gn,updateUsers:Fw,updateUser:gw,deleteUser:Hn,deleteUsers:_w,setCurrentUser:SR,setCurrentUserProfile:AR}=Nn.actions,Pw=Nn.reducer,bw=t=>t.userReducer.currentUser,Kn=t=>t.userReducer.instances,os=o.createSelector([Kn],t=>Object.values(t)),hs=t=>s=>s.userReducer.instances[t],Rw=S(o.createSelector([os,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({id:n})=>e.has(n)))})),Le=F(t=>t.uuid),Mw={instances:{}},Yn=o.createSlice({name:"organizationAccess",initialState:Mw,extraReducers:t=>t.addMatcher(o.isAnyOf(I,g),s=>Object.assign(s,Mw)),reducers:{initializeOrganizationAccesses:Le.initialize,addOrganizationAccess:Le.addOne,addOrganizationAccesses:Le.addMany,setOrganizationAccess:Le.setOne,setOrganizationAccesses:Le.setMany,updateOrganizationAccess:Le.updateOne,updateOrganizationAccesses:Le.updateMany,deleteOrganizationAccess:Le.deleteOne,deleteOrganizationAccesses:Le.deleteMany}}),{initializeOrganizationAccesses:kw,addOrganizationAccess:vw,addOrganizationAccesses:Ew,setOrganizationAccess:Vw,setOrganizationAccesses:Ww,updateOrganizationAccess:Bw,updateOrganizationAccesses:zw,deleteOrganizationAccess:Dw,deleteOrganizationAccesses:qw}=Yn.actions,jw=Yn.reducer,ps=t=>t.organizationAccessReducer.instances,$w=t=>s=>s.organizationAccessReducer.instances[t],Cw=S(o.createSelector([ps,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(Object.values(t).filter(({uuid:n})=>e.has(n)))})),wR=o.createSelector([bw,ps],(t,s)=>Object.values(s).find(n=>n.user===(t==null?void 0:t.id))??null),Uw=o.createSelector([ps],t=>{const s={};for(const e of Object.values(t))s[e.user]=e;return Ht(s)}),TR=S(o.createSelector([Kn,Uw,(t,s)=>s],(t,s,e)=>A(Object.values(t).filter(n=>{const a=s[n.id];return!!a&&a.organization===e})))),Ne=F(t=>t.uuid),Lw={instances:{}},Jn=o.createSlice({name:"organizations",initialState:Lw,extraReducers:t=>t.addMatcher(o.isAnyOf(I,g),s=>Object.assign(s,Lw)),reducers:{initializeOrganizations:Ne.initialize,setOrganizations:Ne.setMany,setOrganization:Ne.setOne,addOrganizations:Ne.addMany,addOrganization:Ne.addOne,updateOrganizations:Ne.updateMany,updateOrganization:Ne.updateOne,deleteOrganization:Ne.deleteOne,deleteOrganizations:Ne.deleteMany}}),{initializeOrganizations:Nw,setOrganizations:Gw,setOrganization:Hw,addOrganizations:Kw,addOrganization:Yw,updateOrganizations:Jw,updateOrganization:Zw,deleteOrganization:Qw,deleteOrganizations:Xw}=Jn.actions,xw=t=>t.organizationReducer.instances,eT=o.createSelector([xw],t=>Object.values(t)),tT=t=>s=>s.organizationReducer.instances[t],sT=S(o.createSelector([eT,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),iT=Jn.reducer,nT=(t,s,e)=>{const n=t.uuid?t:{...t,uuid:mt.v4()};return{payload:n,type:"",meta:{offline:{effect:{timestamp:new Date().toISOString(),request:n,BASE_URL:s,serviceName:e}}}}},aT={deletedRequests:[],latestRetryTime:0},Zn=o.createSlice({name:"outbox",initialState:aT,extraReducers:t=>t.addCase(I,s=>Object.assign(s,aT)),reducers:{enqueueRequest:{reducer:(t,s)=>t,prepare:t=>{console.debug("Preparing to enqueue request",t.url);const{BASE_URL:s,serviceName:e,...n}=t;return nT(n,s,e)}},markForDeletion(t,s){t.deletedRequests.push(s.payload)},markAsDeleted(t,s){const e=t.deletedRequests.indexOf(s.payload);e!==-1&&t.deletedRequests.splice(e,1)},_setLatestRetryTime:(t,s)=>{t.latestRetryTime=s.payload}}}),IR=t=>t.outboxReducer.deletedRequests,OR=t=>t.outboxReducer.latestRetryTime,{enqueueRequest:cT,markForDeletion:FR,markAsDeleted:rT,_setLatestRetryTime:dT}=Zn.actions,lT=Zn.reducer,Ge=F(t=>t.uuid),uT={instances:{}},Qn=o.createSlice({name:"projectAccess",initialState:uT,extraReducers:t=>t.addMatcher(o.isAnyOf(I,g),s=>Object.assign(s,uT)),reducers:{initializeProjectAccesses:Ge.initialize,addProjectAccess:Ge.addOne,addProjectAccesses:Ge.addMany,setProjectAccess:Ge.setOne,setProjectAccesses:Ge.setMany,updateProjectAccess:Ge.updateOne,updateProjectAccesses:Ge.updateMany,deleteProjectAccess:Ge.deleteOne,deleteProjectAccesses:Ge.deleteMany}}),{initializeProjectAccesses:oT,addProjectAccess:hT,addProjectAccesses:pT,setProjectAccess:mT,setProjectAccesses:fT,updateProjectAccess:yT,updateProjectAccesses:ST,deleteProjectAccess:AT,deleteProjectAccesses:wT}=Qn.actions,TT=Qn.reducer,Xn=t=>t.projectAccessReducer.instances,zt=o.createSelector(Xn,t=>Object.values(t)),IT=t=>s=>s.projectAccessReducer.instances[t],OT=S(o.createSelector([zt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),gR=S(o.createSelector([Xn,(t,s)=>s],(t,s)=>A(Object.values(t).filter(e=>e.project===s)))),_R=S(o.createSelector([zt,(t,s)=>s],(t,s)=>{const e={};for(const n of t.filter(a=>a.project===s))e[n.user]=n;return e})),PR=S(o.createSelector([os,zt,(t,s)=>s],(t,s,e)=>{const n=new Set(s.filter(a=>a.project===e).map(a=>a.user));return A(t.filter(a=>n.has(a.id)))})),He=F(t=>t.uuid),FT={instances:{}},xn=o.createSlice({name:"projectAttachments",initialState:FT,extraReducers:t=>t.addMatcher(o.isAnyOf(I,g),s=>Object.assign(s,FT)),reducers:{initializeProjectAttachments:He.initialize,addProjectAttachment:He.addOne,addProjectAttachments:He.addMany,setProjectAttachment:He.setOne,setProjectAttachments:He.setMany,updateProjectAttachment:He.updateOne,updateProjectAttachments:He.updateMany,deleteProjectAttachment:He.deleteOne,deleteProjectAttachments:He.deleteMany}}),{initializeProjectAttachments:gT,addProjectAttachment:_T,addProjectAttachments:PT,setProjectAttachment:bT,setProjectAttachments:RT,updateProjectAttachment:MT,updateProjectAttachments:kT,deleteProjectAttachment:vT,deleteProjectAttachments:ET}=xn.actions,VT=t=>t.projectAttachmentReducer.instances,ea=o.createSelector([VT],t=>Object.values(t)),WT=t=>s=>s.projectAttachmentReducer.instances[t],BT=S(o.createSelector([ea,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),bR=S(o.createSelector([ea,(t,s)=>s],(t,s)=>A(t.filter(({project:e})=>s===e)))),zT=xn.reducer,Ke=F(t=>t.uuid),DT={instances:{}},ta=o.createSlice({name:"projectFiles",initialState:DT,extraReducers:t=>t.addMatcher(o.isAnyOf(I,W,g),s=>Object.assign(s,DT)),reducers:{initializeProjectFiles:Ke.initialize,setProjectFile:Ke.setOne,setProjectFiles:Ke.setMany,addProjectFile:Ke.addOne,addProjectFiles:Ke.addMany,updateProjectFile:Ke.updateOne,updateProjectFiles:Ke.updateMany,deleteProjectFile:Ke.deleteOne,deleteProjectFiles:Ke.deleteMany}}),{initializeProjectFiles:qT,setProjectFile:jT,setProjectFiles:$T,addProjectFile:CT,addProjectFiles:UT,updateProjectFile:LT,updateProjectFiles:NT,deleteProjectFile:GT,deleteProjectFiles:HT}=ta.actions,KT=t=>t.projectFileReducer.instances,YT=o.createSelector([KT],t=>A(Object.values(t).sort((s,e)=>s.z_index-e.z_index))),JT=t=>s=>s.projectFileReducer.instances[t],ZT=S(o.createSelector([YT,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),QT=ta.reducer,Ye=F(t=>t.uuid),XT={instances:{}},sa=o.createSlice({name:"projects",initialState:XT,extraReducers:t=>t.addMatcher(o.isAnyOf(I,g),s=>Object.assign(s,XT)),reducers:{initializeProjects:Ye.initialize,setProjects:Ye.setMany,setProject:Ye.setOne,addProjects:Ye.addMany,addProject:Ye.addOne,updateProjects:Ye.updateMany,updateProject:Ye.updateOne,deleteProject:Ye.deleteOne,deleteProjects:Ye.deleteMany}}),{initializeProjects:xT,setProjects:eI,setProject:tI,addProjects:sI,addProject:iI,updateProjects:nI,updateProject:aI,deleteProject:cI,deleteProjects:rI}=sa.actions,dI=sa.reducer,lI=t=>t.projectReducer.instances,ms=o.createSelector([lI],t=>Object.values(t)),uI=t=>s=>s.projectReducer.instances[t],oI=S(o.createSelector([ms,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),RR=S(o.createSelector([ms,zt,(t,s)=>s],(t,s,e)=>{const n=new Set(s.filter(a=>a.user===e).map(a=>a.project));return A(t.filter(a=>n.has(a.uuid)))})),MR=S(o.createSelector([ms,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),kR={isRehydrated:!1},ia=o.createSlice({name:"rehydrated",initialState:kR,reducers:{setRehydrated:(t,s)=>{t.isRehydrated=s.payload}}}),{setRehydrated:vR}=ia.actions,ER=t=>t.rehydratedReducer.isRehydrated,hI=ia.reducer,Je=F(t=>t.uuid),pI={instances:{}},na=o.createSlice({name:"teamMemberships",initialState:pI,extraReducers:t=>t.addMatcher(o.isAnyOf(I,g),s=>Object.assign(s,pI)),reducers:{initializeTeamMemberships:Je.initialize,addTeamMembership:Je.addOne,addTeamMemberships:Je.addMany,setTeamMembership:Je.setOne,setTeamMemberships:Je.setMany,updateTeamMembership:Je.updateOne,updateTeamMemberships:Je.updateMany,deleteTeamMembership:Je.deleteOne,deleteTeamMemberships:Je.deleteMany}}),{initializeTeamMemberships:mI,addTeamMembership:fI,addTeamMemberships:yI,setTeamMembership:SI,setTeamMemberships:AI,updateTeamMembership:wI,updateTeamMemberships:TI,deleteTeamMembership:II,deleteTeamMemberships:OI}=na.actions,FI=na.reducer,gI=t=>t.teamMembershipReducer.instances,fs=o.createSelector([gI],t=>Object.values(t)),_I=t=>s=>s.teamMembershipReducer.instances[t],PI=S(o.createSelector([fs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),VR=S(o.createSelector([fs,(t,s)=>s],(t,s)=>{const e={};for(const n of t.filter(a=>a.team===s))e[n.user]=n;return e})),WR=S(o.createSelector([os,fs,(t,s)=>s],(t,s,e)=>{const n=new Set(s.filter(a=>a.team===e).map(a=>a.user));return A(t.filter(a=>n.has(a.id)))})),Ze=F(t=>t.uuid),bI={instances:{}},aa=o.createSlice({name:"teams",initialState:bI,extraReducers:t=>t.addMatcher(o.isAnyOf(I,g),s=>Object.assign(s,bI)),reducers:{initializeTeams:Ze.initialize,addTeam:Ze.addOne,addTeams:Ze.addMany,setTeam:Ze.setOne,setTeams:Ze.setMany,updateTeam:Ze.updateOne,updateTeams:Ze.updateMany,deleteTeam:Ze.deleteOne,deleteTeams:Ze.deleteMany}}),{initializeTeams:RI,addTeam:MI,addTeams:kI,setTeam:vI,setTeams:EI,updateTeam:VI,updateTeams:WI,deleteTeam:BI,deleteTeams:zI}=aa.actions,DI=t=>t.teamReducer.instances,ca=o.createSelector([DI],t=>Object.values(t)),qI=t=>s=>s.teamReducer.instances[t],jI=S(o.createSelector([ca,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),BR=S(o.createSelector([ca,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),$I=aa.reducer,zR={version:0},CI=o.createSlice({name:"versioning",initialState:zR,reducers:{}}),UI=CI.reducer,Qe=F(t=>t.uuid),LI={instances:{}},ra=o.createSlice({name:"workflows",initialState:LI,extraReducers:t=>t.addMatcher(o.isAnyOf(I,W,g),s=>Object.assign(s,LI)),reducers:{initializeWorkflows:Qe.initialize,addWorkflow:Qe.addOne,addWorkflows:Qe.addMany,setWorkflow:Qe.setOne,setWorkflows:Qe.setMany,updateWorkflow:Qe.updateOne,updateWorkflows:Qe.updateMany,deleteWorkflow:Qe.deleteOne,deleteWorkflows:Qe.deleteMany}}),{initializeWorkflows:NI,addWorkflow:GI,addWorkflows:HI,setWorkflow:KI,setWorkflows:YI,updateWorkflow:JI,updateWorkflows:ZI,deleteWorkflow:QI,deleteWorkflows:XI}=ra.actions,xI=t=>t.workflowReducer.instances,ys=o.createSelector([xI],t=>Object.values(t)),eO=t=>s=>s.workflowReducer.instances[t],tO=S(o.createSelector([ys,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),DR=S(o.createSelector([ys,(t,s)=>s],(t,s)=>A(t.filter(e=>e.project===s)))),qR=S(o.createSelector([ys,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_type===s)))),sO=ra.reducer,Xe=F(t=>t.uuid),iO={instances:{}},da=o.createSlice({name:"workflowIssueLinks",initialState:iO,extraReducers:t=>t.addMatcher(o.isAnyOf(I,W,g),s=>Object.assign(s,iO)),reducers:{initializeWorkflowIssueLinks:Xe.initialize,addWorkflowIssueLink:Xe.addOne,addWorkflowIssueLinks:Xe.addMany,setWorkflowIssueLink:Xe.setOne,setWorkflowIssueLinks:Xe.setMany,updateWorkflowIssueLink:Xe.updateOne,updateWorkflowIssueLinks:Xe.updateMany,deleteWorkflowIssueLink:Xe.deleteOne,deleteWorkflowIssueLinks:Xe.deleteMany}}),{initializeWorkflowIssueLinks:nO,addWorkflowIssueLink:aO,addWorkflowIssueLinks:Dt,setWorkflowIssueLink:cO,setWorkflowIssueLinks:rO,updateWorkflowIssueLink:dO,updateWorkflowIssueLinks:lO,deleteWorkflowIssueLink:uO,deleteWorkflowIssueLinks:qt}=da.actions,oO=t=>t.workflowIssueLinkReducer.instances,_t=o.createSelector([oO],t=>Object.values(t)),hO=t=>s=>s.workflowIssueLinkReducer.instances[t],pO=S(o.createSelector([_t,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),mO=S(o.createSelector([_t,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow===s)))),fO=S(o.createSelector([_t,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({workflow:n})=>e.has(n)))})),yO=S(o.createSelector([_t,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue===s)))),jR=S(o.createSelector([_t,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({issue:n})=>e.has(n)))})),SO=da.reducer,xe=F(t=>t.uuid),AO={instances:{}},la=o.createSlice({name:"workflowStepAssignees",initialState:AO,extraReducers:t=>t.addMatcher(o.isAnyOf(I,W,g),s=>Object.assign(s,AO)),reducers:{initializeWorkflowStepAssignees:xe.initialize,addWorkflowStepAssignee:xe.addOne,addWorkflowStepAssignees:xe.addMany,setWorkflowStepAssignee:xe.setOne,setWorkflowStepAssignees:xe.setMany,updateWorkflowStepAssignee:xe.updateOne,updateWorkflowStepAssignees:xe.updateMany,deleteWorkflowStepAssignee:xe.deleteOne,deleteWorkflowStepAssignees:xe.deleteMany}}),{initializeWorkflowStepAssignees:wO,addWorkflowStepAssignee:TO,addWorkflowStepAssignees:IO,setWorkflowStepAssignee:OO,setWorkflowStepAssignees:FO,updateWorkflowStepAssignee:gO,updateWorkflowStepAssignees:_O,deleteWorkflowStepAssignee:PO,deleteWorkflowStepAssignees:bO}=la.actions,RO=t=>t.workflowStepAssigneeReducer.instances,jt=o.createSelector([RO],t=>Object.values(t)),MO=t=>s=>s.workflowStepAssigneeReducer.instances[t],kO=S(o.createSelector([jt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),$R=S(o.createSelector([jt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow===s)))),CR=S(o.createSelector([jt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),UR=S(o.createSelector([jt,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>A(t.filter(({workflow:n,workflow_step:a})=>n===s&&a===e)))),vO=la.reducer,et=F(t=>t.uuid),EO={instances:{}},ua=o.createSlice({name:"workflowStepComments",initialState:EO,extraReducers:t=>t.addMatcher(o.isAnyOf(I,W,g),s=>Object.assign(s,EO)),reducers:{initializeWorkflowStepComments:et.initialize,addWorkflowStepComment:et.addOne,addWorkflowStepComments:et.addMany,setWorkflowStepComment:et.setOne,setWorkflowStepComments:et.setMany,updateWorkflowStepComment:et.updateOne,updateWorkflowStepComments:et.updateMany,deleteWorkflowStepComment:et.deleteOne,deleteWorkflowStepComments:et.deleteMany}}),{initializeWorkflowStepComments:VO,addWorkflowStepComment:WO,addWorkflowStepComments:BO,setWorkflowStepComment:zO,setWorkflowStepComments:DO,updateWorkflowStepComment:qO,updateWorkflowStepComments:jO,deleteWorkflowStepComment:$O,deleteWorkflowStepComments:CO}=ua.actions,UO=t=>t.workflowStepCommentReducer.instances,$t=o.createSelector([UO],t=>Object.values(t)),LO=t=>s=>s.workflowStepCommentReducer.instances[t],NO=S(o.createSelector([$t,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),LR=S(o.createSelector([$t,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow===s)))),NR=S(o.createSelector([$t,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),GR=S(o.createSelector([$t,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>A(t.filter(({workflow:n,workflow_step:a})=>n===s&&a===e)))),GO=ua.reducer,tt=F(t=>t.uuid),HO={instances:{}},oa=o.createSlice({name:"workflowStepDefaultAssignees",initialState:HO,extraReducers:t=>t.addMatcher(o.isAnyOf(I,g),s=>Object.assign(s,HO)),reducers:{initializeWorkflowStepDefaultAssignees:tt.initialize,addWorkflowStepDefaultAssignee:tt.addOne,addWorkflowStepDefaultAssignees:tt.addMany,setWorkflowStepDefaultAssignee:tt.setOne,setWorkflowStepDefaultAssignees:tt.setMany,updateWorkflowStepDefaultAssignee:tt.updateOne,updateWorkflowStepDefaultAssignees:tt.updateMany,deleteWorkflowStepDefaultAssignee:tt.deleteOne,deleteWorkflowStepDefaultAssignees:tt.deleteMany}}),{initializeWorkflowStepDefaultAssignees:KO,addWorkflowStepDefaultAssignee:YO,addWorkflowStepDefaultAssignees:JO,setWorkflowStepDefaultAssignee:ZO,setWorkflowStepDefaultAssignees:QO,updateWorkflowStepDefaultAssignee:XO,updateWorkflowStepDefaultAssignees:xO,deleteWorkflowStepDefaultAssignee:eF,deleteWorkflowStepDefaultAssignees:tF}=oa.actions,sF=t=>t.workflowStepDefaultAssigneeReducer.instances,ha=o.createSelector([sF],t=>Object.values(t)),iF=t=>s=>s.workflowStepDefaultAssigneeReducer.instances[t],nF=S(o.createSelector([ha,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),HR=S(o.createSelector([ha,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),aF=oa.reducer,st=F(t=>t.uuid),cF={instances:{}},pa=o.createSlice({name:"workflowStepDefaultReviewers",initialState:cF,extraReducers:t=>t.addMatcher(o.isAnyOf(I,g),s=>Object.assign(s,cF)),reducers:{initializeWorkflowStepDefaultReviewers:st.initialize,addWorkflowStepDefaultReviewer:st.addOne,addWorkflowStepDefaultReviewers:st.addMany,setWorkflowStepDefaultReviewer:st.setOne,setWorkflowStepDefaultReviewers:st.setMany,updateWorkflowStepDefaultReviewer:st.updateOne,updateWorkflowStepDefaultReviewers:st.updateMany,deleteWorkflowStepDefaultReviewer:st.deleteOne,deleteWorkflowStepDefaultReviewers:st.deleteMany}}),{initializeWorkflowStepDefaultReviewers:rF,addWorkflowStepDefaultReviewer:dF,addWorkflowStepDefaultReviewers:lF,setWorkflowStepDefaultReviewer:uF,setWorkflowStepDefaultReviewers:oF,updateWorkflowStepDefaultReviewer:hF,updateWorkflowStepDefaultReviewers:pF,deleteWorkflowStepDefaultReviewer:mF,deleteWorkflowStepDefaultReviewers:fF}=pa.actions,yF=t=>t.workflowStepDefaultReviewerReducer.instances,ma=o.createSelector([yF],t=>Object.values(t)),SF=t=>s=>s.workflowStepDefaultReviewerReducer.instances[t],AF=S(o.createSelector([ma,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),KR=S(o.createSelector([ma,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),wF=pa.reducer,it=F(t=>t.uuid),TF={instances:{}},fa=o.createSlice({name:"workflowStepEvents",initialState:TF,extraReducers:t=>t.addMatcher(o.isAnyOf(I,W,g),s=>Object.assign(s,TF)),reducers:{initializeWorkflowStepEvents:it.initialize,addWorkflowStepEvent:it.addOne,addWorkflowStepEvents:it.addMany,setWorkflowStepEvent:it.setOne,setWorkflowStepEvents:it.setMany,updateWorkflowStepEvent:it.updateOne,updateWorkflowStepEvents:it.updateMany,deleteWorkflowStepEvent:it.deleteOne,deleteWorkflowStepEvents:it.deleteMany}}),{initializeWorkflowStepEvents:IF,addWorkflowStepEvent:OF,addWorkflowStepEvents:FF,setWorkflowStepEvent:gF,setWorkflowStepEvents:_F,updateWorkflowStepEvent:PF,updateWorkflowStepEvents:bF,deleteWorkflowStepEvent:RF,deleteWorkflowStepEvents:MF}=fa.actions,kF=t=>t.workflowStepEventReducer.instances,Ct=o.createSelector([kF],t=>Object.values(t)),vF=t=>s=>s.workflowStepEventReducer.instances[t],EF=S(o.createSelector([Ct,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),YR=S(o.createSelector([Ct,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow===s)))),JR=S(o.createSelector([Ct,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),ZR=S(o.createSelector([Ct,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>A(t.filter(({workflow:n,workflow_step:a})=>n===s&&a===e)))),VF=fa.reducer,nt=F(t=>t.uuid),WF={instances:{}},ya=o.createSlice({name:"workflowStepFieldsAttachments",initialState:WF,extraReducers:t=>t.addMatcher(o.isAnyOf(I,g),s=>Object.assign(s,WF)),reducers:{initializeWorkflowStepFieldsAttachments:nt.initialize,addWorkflowStepFieldsAttachment:nt.addOne,addWorkflowStepFieldsAttachments:nt.addMany,setWorkflowStepFieldsAttachment:nt.setOne,setWorkflowStepFieldsAttachments:nt.setMany,updateWorkflowStepFieldsAttachment:nt.updateOne,updateWorkflowStepFieldsAttachments:nt.updateMany,deleteWorkflowStepFieldsAttachment:nt.deleteOne,deleteWorkflowStepFieldsAttachments:nt.deleteMany}}),{initializeWorkflowStepFieldsAttachments:BF,addWorkflowStepFieldsAttachment:zF,addWorkflowStepFieldsAttachments:Sa,setWorkflowStepFieldsAttachment:DF,setWorkflowStepFieldsAttachments:qF,updateWorkflowStepFieldsAttachment:jF,updateWorkflowStepFieldsAttachments:$F,deleteWorkflowStepFieldsAttachment:CF,deleteWorkflowStepFieldsAttachments:Aa}=ya.actions,UF=t=>t.workflowStepFieldsAttachmentReducer.instances,wa=o.createSelector([UF],t=>Object.values(t)),LF=S(o.createSelector([wa,(t,s)=>s],(t,s)=>A(t.filter(e=>e.fields_revision===s)))),NF=t=>s=>s.workflowStepFieldsAttachmentReducer.instances[t],GF=S(o.createSelector([wa,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),HF=ya.reducer,at=F(t=>t.uuid),KF={instances:{}},Ta=o.createSlice({name:"workflowStepFields",initialState:KF,extraReducers:t=>t.addMatcher(o.isAnyOf(I,g),s=>Object.assign(s,KF)),reducers:{initializeWorkflowStepFields:at.initialize,addWorkflowStepFields:at.addOne,addWorkflowStepFieldsMany:at.addMany,setWorkflowStepFields:at.setOne,setWorkflowStepFieldsMany:at.setMany,updateWorkflowStepFields:at.updateOne,updateWorkflowStepFieldsMany:at.updateMany,deleteWorkflowStepFields:at.deleteOne,deleteWorkflowStepFieldsMany:at.deleteMany}}),{initializeWorkflowStepFields:YF,addWorkflowStepFields:JF,addWorkflowStepFieldsMany:ZF,setWorkflowStepFields:QF,setWorkflowStepFieldsMany:XF,updateWorkflowStepFields:xF,updateWorkflowStepFieldsMany:eg,deleteWorkflowStepFields:tg,deleteWorkflowStepFieldsMany:sg}=Ta.actions,ig=t=>t.workflowStepFieldsReducer.instances,Ss=o.createSelector([ig],t=>Object.values(t)),QR=S(o.createSelector([Ss,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),XR=S(o.createSelector([Ss,(t,s)=>s],(t,s)=>t.filter(e=>e.workflow_step===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),ng=t=>s=>s.workflowStepFieldsReducer.instances[t],ag=S(o.createSelector([Ss,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),cg=Ta.reducer,ct=F(t=>t.uuid),rg={instances:{}},Ia=o.createSlice({name:"workflowStepFieldValuesAttachments",initialState:rg,extraReducers:t=>t.addMatcher(o.isAnyOf(I,W,g),s=>Object.assign(s,rg)),reducers:{initializeWorkflowStepFieldValuesAttachments:ct.initialize,addWorkflowStepFieldValuesAttachment:ct.addOne,addWorkflowStepFieldValuesAttachments:ct.addMany,setWorkflowStepFieldValuesAttachment:ct.setOne,setWorkflowStepFieldValuesAttachments:ct.setMany,updateWorkflowStepFieldValuesAttachment:ct.updateOne,updateWorkflowStepFieldValuesAttachments:ct.updateMany,deleteWorkflowStepFieldValuesAttachment:ct.deleteOne,deleteWorkflowStepFieldValuesAttachments:ct.deleteMany}}),{initializeWorkflowStepFieldValuesAttachments:dg,addWorkflowStepFieldValuesAttachment:lg,addWorkflowStepFieldValuesAttachments:Oa,setWorkflowStepFieldValuesAttachment:ug,setWorkflowStepFieldValuesAttachments:og,updateWorkflowStepFieldValuesAttachment:hg,updateWorkflowStepFieldValuesAttachments:pg,deleteWorkflowStepFieldValuesAttachment:mg,deleteWorkflowStepFieldValuesAttachments:Fa}=Ia.actions,fg=t=>t.workflowStepFieldValuesAttachmentReducer.instances,ga=o.createSelector([fg],t=>Object.values(t)),yg=t=>s=>s.workflowStepFieldValuesAttachmentReducer.instances[t],Sg=S(o.createSelector([ga,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Ag=S(o.createSelector([ga,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),wg=Ia.reducer,rt=F(t=>t.uuid),Tg={instances:{}},_a=o.createSlice({name:"workflowStepFieldValues",initialState:Tg,extraReducers:t=>t.addMatcher(o.isAnyOf(I,W,g),s=>Object.assign(s,Tg)),reducers:{initializeWorkflowStepFieldValues:rt.initialize,addWorkflowStepFieldValues:rt.addOne,addWorkflowStepFieldValuesMany:rt.addMany,setWorkflowStepFieldValues:rt.setOne,setWorkflowStepFieldValuesMany:rt.setMany,updateWorkflowStepFieldValues:rt.updateOne,updateWorkflowStepFieldValuesMany:rt.updateMany,deleteWorkflowStepFieldValues:rt.deleteOne,deleteWorkflowStepFieldValuesMany:rt.deleteMany}}),{initializeWorkflowStepFieldValues:Ig,addWorkflowStepFieldValues:Og,addWorkflowStepFieldValuesMany:Fg,setWorkflowStepFieldValues:gg,setWorkflowStepFieldValuesMany:_g,updateWorkflowStepFieldValues:Pg,updateWorkflowStepFieldValuesMany:bg,deleteWorkflowStepFieldValues:Rg,deleteWorkflowStepFieldValuesMany:Mg}=_a.actions,kg=t=>t.workflowStepFieldValuesReducer.instances,ft=o.createSelector([kg],t=>Object.values(t)),xR=S(o.createSelector([ft,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow===s)))),eM=S(o.createSelector([ft,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),vg=t=>s=>s.workflowStepFieldValuesReducer.instances[t],Eg=S(o.createSelector([ft,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),tM=S(o.createSelector([ft,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>A(t.filter(({workflow:n,workflow_step:a})=>n===s&&a===e)))),sM=S(o.createSelector([ft,(t,s)=>s],(t,s)=>{const e={};for(const n of t){const{workflow:a,workflow_step:c}=n;if(a!==s)continue;const r=e[c];(!r||r.submitted_at<=n.submitted_at)&&(e[c]=n)}return e})),Vg=_a.reducer,dt=F(t=>t.uuid),Wg={instances:{}},Pa=o.createSlice({name:"workflowStepFieldValuesReviewRequests",initialState:Wg,extraReducers:t=>t.addMatcher(o.isAnyOf(I,W,g),s=>Object.assign(s,Wg)),reducers:{initializeWorkflowStepFieldValuesReviewRequests:dt.initialize,addWorkflowStepFieldValuesReviewRequest:dt.addOne,addWorkflowStepFieldValuesReviewRequests:dt.addMany,setWorkflowStepFieldValuesReviewRequest:dt.setOne,setWorkflowStepFieldValuesReviewRequests:dt.setMany,updateWorkflowStepFieldValuesReviewRequest:dt.updateOne,updateWorkflowStepFieldValuesReviewRequests:dt.updateMany,deleteWorkflowStepFieldValuesReviewRequest:dt.deleteOne,deleteWorkflowStepFieldValuesReviewRequests:dt.deleteMany}}),{initializeWorkflowStepFieldValuesReviewRequests:Bg,addWorkflowStepFieldValuesReviewRequest:zg,addWorkflowStepFieldValuesReviewRequests:ba,setWorkflowStepFieldValuesReviewRequest:Dg,setWorkflowStepFieldValuesReviewRequests:qg,updateWorkflowStepFieldValuesReviewRequest:jg,updateWorkflowStepFieldValuesReviewRequests:$g,deleteWorkflowStepFieldValuesReviewRequest:Cg,deleteWorkflowStepFieldValuesReviewRequests:Ra}=Pa.actions,Ug=t=>t.workflowStepFieldValuesReviewRequestReducer.instances,Ut=o.createSelector([Ug],t=>Object.values(t)),Lg=t=>s=>s.workflowStepFieldValuesReviewRequestReducer.instances[t],Ng=S(o.createSelector([Ut,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Gg=S(o.createSelector([Ut,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),iM=S(o.createSelector([Ut,(t,s)=>s],(t,s)=>{let e;for(const n of t){const{field_values:a}=n;a===s&&(!e||e.submitted_at<=n.submitted_at)&&(e=n)}return e})),nM=S(o.createSelector([ft,Ut,(t,s)=>s,(t,s,e)=>e],(t,s,e,n)=>{const a=new Set(E(t.filter(({workflow_step:c,workflow:r})=>e===r&&c===n)));return A(s.filter(({field_values:c})=>a.has(c)))})),Hg=Pa.reducer,lt=F(t=>t.uuid),Kg={instances:{}},Ma=o.createSlice({name:"workflowStepFieldValuesReviews",initialState:Kg,extraReducers:t=>t.addMatcher(o.isAnyOf(I,W,g),s=>Object.assign(s,Kg)),reducers:{initializeWorkflowStepFieldValuesReviews:lt.initialize,addWorkflowStepFieldValuesReview:lt.addOne,addWorkflowStepFieldValuesReviews:lt.addMany,setWorkflowStepFieldValuesReview:lt.setOne,setWorkflowStepFieldValuesReviews:lt.setMany,updateWorkflowStepFieldValuesReview:lt.updateOne,updateWorkflowStepFieldValuesReviews:lt.updateMany,deleteWorkflowStepFieldValuesReview:lt.deleteOne,deleteWorkflowStepFieldValuesReviews:lt.deleteMany}}),{initializeWorkflowStepFieldValuesReviews:Yg,addWorkflowStepFieldValuesReview:Jg,addWorkflowStepFieldValuesReviews:ka,setWorkflowStepFieldValuesReview:Zg,setWorkflowStepFieldValuesReviews:Qg,updateWorkflowStepFieldValuesReview:Xg,updateWorkflowStepFieldValuesReviews:xg,deleteWorkflowStepFieldValuesReview:e_,deleteWorkflowStepFieldValuesReviews:va}=Ma.actions,t_=t=>t.workflowStepFieldValuesReviewReducer.instances,Pt=o.createSelector([t_],t=>Object.values(t)),s_=t=>s=>s.workflowStepFieldValuesReviewReducer.instances[t],i_=S(o.createSelector([Pt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),n_=S(o.createSelector([Pt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),aM=S(o.createSelector([Pt,(t,s)=>s],(t,s)=>{let e;for(const n of t){const{field_values:a}=n;a===s&&(!e||e.submitted_at<=n.submitted_at)&&(e=n)}return e})),cM=S(o.createSelector([ft,Pt,(t,s)=>s,(t,s,e)=>e],(t,s,e,n)=>{const a=new Set(E(t.filter(({workflow_step:c,workflow:r})=>e===r&&c===n)));return A(s.filter(({field_values:c})=>a.has(c)))})),rM=o.createSelector([Pt],t=>{const s={};for(const e of t){const{field_values:n}=e,a=s[n];(!a||a.submitted_at<=e.submitted_at)&&(s[n]=e)}return s}),a_=Ma.reducer,ut=F(t=>t.uuid),c_={instances:{}},Ea=o.createSlice({name:"workflowStepReviewers",initialState:c_,extraReducers:t=>t.addMatcher(o.isAnyOf(I,W,g),s=>Object.assign(s,c_)),reducers:{initializeWorkflowStepReviewers:ut.initialize,addWorkflowStepReviewer:ut.addOne,addWorkflowStepReviewers:ut.addMany,setWorkflowStepReviewer:ut.setOne,setWorkflowStepReviewers:ut.setMany,updateWorkflowStepReviewer:ut.updateOne,updateWorkflowStepReviewers:ut.updateMany,deleteWorkflowStepReviewer:ut.deleteOne,deleteWorkflowStepReviewers:ut.deleteMany}}),{initializeWorkflowStepReviewers:r_,addWorkflowStepReviewer:d_,addWorkflowStepReviewers:l_,setWorkflowStepReviewer:u_,setWorkflowStepReviewers:o_,updateWorkflowStepReviewer:h_,updateWorkflowStepReviewers:p_,deleteWorkflowStepReviewer:m_,deleteWorkflowStepReviewers:f_}=Ea.actions,y_=t=>t.workflowStepReviewerReducer.instances,Lt=o.createSelector([y_],t=>Object.values(t)),S_=t=>s=>s.workflowStepReviewerReducer.instances[t],A_=S(o.createSelector([Lt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),dM=S(o.createSelector([Lt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow===s)))),lM=S(o.createSelector([Lt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),uM=S(o.createSelector([Lt,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>A(t.filter(({workflow:n,workflow_step:a})=>n===s&&a===e)))),w_=Ea.reducer,ot=F(t=>t.uuid),T_={instances:{}},Va=o.createSlice({name:"workflowSteps",initialState:T_,extraReducers:t=>t.addMatcher(o.isAnyOf(I,g),s=>Object.assign(s,T_)),reducers:{initializeWorkflowSteps:ot.initialize,addWorkflowStep:ot.addOne,addWorkflowSteps:ot.addMany,setWorkflowStep:ot.setOne,setWorkflowSteps:ot.setMany,updateWorkflowStep:ot.updateOne,updateWorkflowSteps:ot.updateMany,deleteWorkflowStep:ot.deleteOne,deleteWorkflowSteps:ot.deleteMany}}),{initializeWorkflowSteps:I_,addWorkflowStep:O_,addWorkflowSteps:F_,setWorkflowStep:g_,setWorkflowSteps:__,updateWorkflowStep:P_,updateWorkflowSteps:b_,deleteWorkflowStep:R_,deleteWorkflowSteps:M_}=Va.actions,k_=t=>t.workflowStepReducer.instances,Wa=o.createSelector([k_],t=>Object.values(t)),v_=t=>s=>s.workflowStepReducer.instances[t],E_=S(o.createSelector([Wa,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),oM=S(o.createSelector([Wa,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_type===s)))),V_=Va.reducer,ht=F(t=>t.uuid),W_={instances:{}},Ba=o.createSlice({name:"workflowTypes",initialState:W_,extraReducers:t=>t.addMatcher(o.isAnyOf(I,g),s=>Object.assign(s,W_)),reducers:{initializeWorkflowTypes:ht.initialize,addWorkflowType:ht.addOne,addWorkflowTypes:ht.addMany,setWorkflowType:ht.setOne,setWorkflowTypes:ht.setMany,updateWorkflowType:ht.updateOne,updateWorkflowTypes:ht.updateMany,deleteWorkflowType:ht.deleteOne,deleteWorkflowTypes:ht.deleteMany}}),{initializeWorkflowTypes:B_,addWorkflowType:z_,addWorkflowTypes:D_,setWorkflowType:q_,setWorkflowTypes:j_,updateWorkflowType:$_,updateWorkflowTypes:C_,deleteWorkflowType:U_,deleteWorkflowTypes:L_}=Ba.actions,N_=t=>t.workflowTypeReducer.instances,za=o.createSelector([N_],t=>Object.values(t)),G_=t=>s=>s.workflowTypeReducer.instances[t],H_=S(o.createSelector([za,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),hM=S(o.createSelector([za,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),K_=Ba.reducer,Da={outboxReducer:lT,fileReducer:vp,authReducer:$h},pM=o.combineReducers(Da),Y_={...Da,[Et]:UI,assetReducer:Hl,assetAttachmentReducer:vc,assetStageCompletionReducer:iu,assetStageReducer:Au,assetTypeReducer:Fh,assetTypeAttachmentReducer:Vu,issueReducer:Gy,issueAttachmentReducer:ay,issueTypeReducer:YA,issueTypeAttachmentReducer:aS,organizationReducer:iT,projectReducer:dI,projectAttachmentReducer:zT,projectAccessReducer:TT,organizationAccessReducer:jw,projectFileReducer:QT,rehydratedReducer:hI,formReducer:$m,formRevisionReducer:Mm,formRevisionAttachmentReducer:wm,formSubmissionAttachmentReducer:tf,formSubmissionReducer:ff,formIdentifierReducer:Gp,formIdentifierValueReducer:am,userReducer:Pw,emailDomainsReducer:Rp,documentsReducer:op,documentAttachmentReducer:ep,teamReducer:$I,agentsReducer:Ac,issueCommentReducer:Ey,issueCommentAttachmentReducer:wy,issueUpdateReducer:Sw,geoImageReducer:Mf,issueAssociationReducer:Hf,issueTypeFieldsReducer:KS,issueTypeFieldValuesReducer:VS,issueTypeFieldsAttachmentReducer:wS,issueTypeFieldValuesAttachmentReducer:cA,issueTypeIdentifierReducer:TA,issueTypeIdentifierValueReducer:WA,issueTypeStatusReducer:rw,assetTypeFieldsReducer:ro,assetTypeFieldValuesReducer:Bo,assetTypeFieldsAttachmentReducer:Ku,assetTypeFieldValuesAttachmentReducer:Io,assetTypeIdentifierReducer:Jo,assetTypeIdentifierValueReducer:lh,assetTypeStatusReducer:Dh,assetProcedureTypeReducer:yd,assetProcedureReducer:td,assetProcedureTypeFieldsReducer:yr,assetProcedureTypeFieldValuesReducer:Lr,assetProcedureTypeFieldsAttachmentReducer:sr,assetProcedureTypeFieldValuesAttachmentReducer:Rr,assetProcedureTypeAttachmentReducer:Uc,assetProcedureStepFieldsAttachmentReducer:Vd,assetProcedureStepFieldsReducer:Hd,assetProcedureStepFieldValuesAttachmentReducer:al,assetProcedureStepFieldValuesReducer:wl,assetProcedureStepReducer:kl,teamMembershipReducer:FI,workflowTypeReducer:K_,workflowStepReducer:V_,workflowStepFieldsReducer:cg,workflowStepFieldsAttachmentReducer:HF,workflowReducer:sO,workflowIssueLinkReducer:SO,workflowStepAssigneeReducer:vO,workflowStepCommentReducer:GO,workflowStepDefaultAssigneeReducer:aF,workflowStepDefaultReviewerReducer:wF,workflowStepEventReducer:VF,workflowStepFieldValuesReducer:Vg,workflowStepFieldValuesAttachmentReducer:wg,workflowStepFieldValuesReviewReducer:a_,workflowStepFieldValuesReviewRequestReducer:Hg,workflowStepReviewerReducer:w_},mM=o.combineReducers(Y_),J_=1e4,Z_=200,qa=[400,409,403,404,405,500],pt=1e4,Q_={};class X_{constructor(s){m(this,"client");m(this,"pageSize",J_);Q_[this.constructor.name]=this,this.client=s}async performRequest(s,e){return this.client.performRequest(this.host,s,this,e)}async enqueueRequest(s){return this.client.enqueueRequest(s,this.host,this.constructor.name)}async performPagination(s,e){return this.client.performPagination(this.host,s,this.pageSize,this,e)}dispatch(s){this.client.store.dispatch(s)}}const x_=()=>sP.length-1,eP=t=>(t[Et]={version:x_()},t),tP=()=>eP({}),fM=t=>(t.outboxReducer&&(t.outboxReducer.deletedRequests=[]),t),yM=t=>s=>{var e;return s===void 0&&(s={}),((e=s[Et])==null?void 0:e.version)===x_()?s:t(s)},sP=[eP,tP,tP,fM],SM=Object.fromEntries(sP.map((t,s)=>[s,yM(t)])),AM=t=>{if(t)throw t;const s=Mt();s?s.dispatch({type:"rehydrated/setRehydrated",payload:!0}):console.error("Client store not set")},iP=(t,s,e)=>{const n=Ot();return n?(n.addRequest(s),n.getQueue()):(console.warn("Outbox coordinator not set; cannot enqueue request yet."),[])},nP=(t,s,e)=>{const n=Ot();if(!n)return console.warn("Outbox coordinator not set; cannot dequeue request yet."),[];const c=s.meta.offlineAction.payload.uuid;return n.remove(c),n.getQueue()};async function wM(t,s){if(!s.payload)throw new Error("Received empty payload");return SP(s)}const TM={...Ga,effect:wM,discard:cP,returnPromises:!0,persistCallback:AM,retry:gM,persistOptions:{storage:gP},queue:{...Ga.queue,enqueue:iP,dequeue:nP,peek:(...t)=>FM(...t)}},IM=_P(SM,Et),OM=o.compose(FP.offline(TM),IM);async function aP(t,s,e){if(s.store.getState().outboxReducer.deletedRequests.includes(t.payload.uuid))throw new Error("Request was marked for deletion");const a=Q_[t.meta.offline.effect.serviceName];if(!a)throw new Error(`Service ${t.meta.offline.effect.serviceName} not found`);return $a(t.meta.offline.effect.BASE_URL,t.meta.offline.effect.request,s,a,e)}function cP(t,s,e=0){var u;if(console.debug("Considering discarding request due to error:",t,`(${typeof t})`,`
2
+ Url:`,s.payload.url,`
3
+ Retries:`,e),!(t instanceof Error))throw console.error("ENCOUNTERED NON-ERROR ERROR:",t,"(throwing immediately, which may lead to unexpected behavior)"),t;const n=Mt(),c=n.getState().outboxReducer.deletedRequests,r=s.payload.uuid;function d(){n.dispatch(rT(r));const p=Ot();if(!p)throw new Error("Outbox coordinator not set");p.remove(s.payload.uuid);const f=s.meta.offline.rollback;throw f&&(console.warn("Rolling back request due to SDK error:",s),n.dispatch(f)),t}if(t instanceof C&&t.options.discard&&(console.debug("Discarding request due to explicit discard:",s.payload.url),d()),c.includes(r)&&(console.debug("Discarding request due to deletion:",s.payload.url),d()),t instanceof C){const p=t.status||((u=t.response)==null?void 0:u.status);if(p||console.warn("Error has no status code:",t),p!==void 0&&qa.includes(p)){console.warn("Discarding request due to error:",t,`
4
+ Action:`,s);const f=Ot();if(!f)throw new Error("Outbox coordinator not set");f.remove(s.payload.uuid),t.options.discard=!0,d()}}console.debug("Registering a retry for request:",s.payload.uuid);const l=Ot();if(!l)throw new Error("Outbox coordinator not set");return l.registerRetry(s.payload.uuid),!1}function FM(t,s,e){var n;return(n=Ot())==null?void 0:n.peek()}function gM(t,s){return Mt().dispatch(dT(new Date().getTime())),xa}const bt="An unknown error occurred",_M=500,rP=["non_field_errors","detail"];function PM(t,s){let e;if(t!=null&&t.body)if(typeof t.body=="object"){const n=t.body;if(typeof n.error=="string")e=n.error;else if(typeof n.message=="string")e=n.message;else try{e=Object.entries(n).map(([a,c])=>typeof c=="string"?rP.includes(a)?c:`${a}: ${c}`:Array.isArray(c)?rP.includes(a)?c.join(`
5
+ `):c.map(r=>`${a}: ${r}`).join(`
6
+ `):`${a}: ${JSON.stringify(c)}`).join(`
7
+ `)}catch(a){console.error("Failed to extract error message from response body",a)}}else typeof t.body=="string"&&(e=t.body);else t!=null&&t.text?e=t.text:s instanceof Error&&(e=s.message);return!e||e.length>_M?bt:e}class C extends Error{constructor(e){super(bt);m(this,"status");m(this,"response");m(this,"message");m(this,"options");const{response:n,innerError:a}=e;this.message=e.message??PM(n,a)??bt,this.status=(n==null?void 0:n.status)??0,this.response=n,e.discard=e.discard??!1,this.options=e}}function dP(t){function s(e){return typeof e=="object"&&e!==null&&["ok","redirect","clientError","serverError","error"].every(a=>a in e)}if(s(t))return t;if(typeof t=="object"&&t!==null){const e=t;if(s(e.response))return e.response;if(e.response&&s(e.response.response))return e.response.response}}class bM extends X_{constructor(s){super(s)}}class Tt extends X_{constructor(e,n){super(e);m(this,"auth");this.auth=n}}class RM extends Tt{async startConversation(s,e){return this.enqueueRequest({description:"Start agent conversation",method:h.POST,url:"/agents/prompt/",payload:{prompt:s,active_project:e},blockers:["prompt"],blocks:["prompt"]}).then(n=>(this.dispatch(fc(n)),n))}async continueConversation(s,e,n){return this.enqueueRequest({description:"Prompt agent",method:h.POST,url:"/agents/prompt/",payload:{prompt:s,active_project:n},blockers:["prompt"],blocks:["prompt"],queryParams:{conversation_id:e}}).then(a=>{this.dispatch(Sc(a))})}async fetchDetails(s){return this.enqueueRequest({description:"Get agent conversation",method:h.GET,url:`/agents/conversations/${s}/`,blockers:["conversation"],blocks:["conversation"]}).then(e=>{this.dispatch(yc(e))})}async rate(s,e){return this.enqueueRequest({description:"Rate agent response",method:h.PUT,url:`/agents/responses/${s}/rate/`,payload:{rating:e},blockers:["rate"],blocks:["rate"]})}async list(s,e){return this.performRequest({method:h.GET,url:"/agents/conversations/",...s},e)}async refreshStore(s,e){const n=await this.list({queryParams:{project:s}},e);return this.dispatch(mc(n)),n}}function yt(t,s){const e=[];let n=0;const a=t.length;for(;n<a;)e.push(t.slice(n,n+=s));return e}function w(t,s,e){const n=`${s}${e?"s":""}`;switch(t){case h.GET:return`Get ${n}`;case h.POST:return`Create ${n}`;case h.PATCH:return`Update ${n}`;case h.PUT:return`Update ${n}`;case h.DELETE:return`Delete ${n}`}}class M extends Tt{async get(s,e){return this.performRequest({url:`${this.url}/${s}/`,method:h.GET},e)}async list(s,e){return this.performRequest({url:`${this.url}/`,method:h.GET,...s},e)}async listPaginated(s,e){return this.performPagination({url:`${this.url}/`,method:h.GET,...s},e)}}class D extends M{constructor(){super(...arguments);m(this,"pageSize",Z_)}async add(e){const{addOne:n,updateOne:a,deleteOne:c}=this.actions;let r,d=null,l=null;if("file"in e){const{file:P,...v}=e;d=await this.client.files.getFilePayload(P),l=URL.createObjectURL(P),r={...v,file_sha1:d.sha1,file_type:d.file_type,file_name:P.name,file_extension:d.extension,file_url:l}}else r=e;const u=this.buildModel(r),p=this.buildPayload(u);this.dispatch(n(u));const f=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:{...p,...d?{file:d}:{}},blockers:this.getBlockers(u),blocks:this.getBlocks(u)});f.then(({instance:P})=>{this.dispatch(a(P))}).catch(P=>{throw this.dispatch(c(this.getId(u))),P}).finally(()=>{l&&URL.revokeObjectURL(l)});const y=f.then(({instance:P})=>P),T=f.then(async({instance:P,presigned_url:v})=>{try{return v&&await this.client.files.processPresignedUrl(P.file_sha1,v),P.file_sha1}catch(_){throw console.error("Upload to s3 using presigned url failed.",_),_}});return[u,y,T]}async bulkAdd(e,n){const{addMany:a,updateMany:c,deleteMany:r}=this.actions,d=new Date().toISOString(),l=[],u=new Set,p=yt(e,Math.min(n??e.length,pt)),f=[];for(const v of p){const _=[],k={},R=[],z=[];for(const B of v){let q;if("file"in B){const{file:La,...cv}=B,kt=await this.client.files.getFilePayload(La);kt.sha1 in k||(k[kt.sha1]=kt);const TP=URL.createObjectURL(La);u.add(TP),q={...cv,file_sha1:kt.sha1,file_type:kt.file_type,file_name:La.name,file_extension:kt.extension,file_url:TP}}else q=B;const V=this.buildModel(q);l.push(V);const L=this.buildBulkPayload(V);_.push(L);const As=this.getBlockers(V);R.push(...As);const av=this.getBlocks(V);z.push(...av)}const j={payloads:_,submittedAt:d,files:Object.values(k),blockers:R,blocks:z};f.push(j)}this.dispatch(a(l));const y=f.map(v=>{const{submittedAt:_,files:k,payloads:R,blocks:z,blockers:j}=v;return this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:{submitted_at:_,files:k,payloads:R},blockers:j,blocks:z})});Promise.all(y).then(v=>{const _=v.flatMap(k=>k.instances);this.dispatch(c(_))}).catch(v=>{throw this.dispatch(r(l.map(_=>this.getId(_)))),console.error(v),v}).finally(()=>{for(const v of u)URL.revokeObjectURL(v)});const T=Promise.all(y).then(v=>v.flatMap(({instances:_})=>_)),P=Promise.all(y).then(async v=>{const _=[];for(const{presigned_urls:k}of v){const R=this.client.files.processPresignedUrls(k);for(const[z,j]of Object.entries(R))try{await j,_.push(z)}catch(B){throw console.error("Upload to s3 using presigned url failed.",B),B}}return _});return[l,T,P]}async delete(e){const{store:n}=this.client,{addOne:a,deleteOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Attempting to delete ${this.name} with pk ${e} that does not exist in the store`);this.dispatch(c(this.getId(d)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(a(d)),l}}}class MM extends D{constructor(){super(...arguments);m(this,"name","Asset attachment");m(this,"url","/asset-attachments");m(this,"actions",{addOne:Ic,addMany:Rs,setOne:Oc,setMany:Fc,updateOne:gc,updateMany:_c,deleteOne:Pc,deleteMany:Ms,initialize:Tc});m(this,"selectors",{selectById:Rc,selectByIds:Mc})}getId(e){return e.uuid}getBlockers(e){const{asset:n}=e;return[n]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,asset:e.asset}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,asset:e.asset}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{asset__project:e}},n)).flat();return this.dispatch(a(r)),r}}class kM extends D{constructor(){super(...arguments);m(this,"name","Asset Procedure Attachment");m(this,"url","/asset-procedure-type-attachments");m(this,"actions",{addOne:Wc,addMany:Bc,setOne:zc,setMany:Dc,updateOne:qc,updateMany:jc,deleteOne:$c,deleteMany:Cc,initialize:Vc});m(this,"selectors",{selectById:Nc,selectByIds:Gc})}getId(e){return e.uuid}getBlockers(e){return[e.asset_procedure_type]}getBlocks(e){return[e.uuid]}buildModel(e){var y;const{store:n}=this.client,{asset_procedure_type:a,file_sha1:c,file_extension:r,file_name:d,file_type:l,file_url:u}=e,p=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,f=new Date().toISOString();return O({file_url:u,file_sha1:c,file_extension:r,file_name:d,file_type:l,created_by:p,submitted_at:f,asset_procedure_type:a})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,asset_procedure_type:e.asset_procedure_type}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,asset_procedure_type:e.asset_procedure_type}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{asset_procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class vM extends D{constructor(){super(...arguments);m(this,"name","Asset Procedure Type Fields Attachment");m(this,"url","/asset-procedure-type-fields-attachments");m(this,"actions",{addOne:Yc,addMany:Jc,setOne:Zc,setMany:Qc,updateOne:Xc,updateMany:xc,deleteOne:er,deleteMany:tr,initialize:Kc});m(this,"selectors",{selectById:nr,selectByIds:ar})}getId(e){return e.uuid}getBlockers(e){return[e.fields_revision]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{fields_revision__asset_procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class EM extends M{constructor(){super(...arguments);m(this,"name","Asset Procedure Type Fields");m(this,"url","/asset-procedure-type-fields");m(this,"actions",{addOne:dr,addMany:lr,setOne:ur,setMany:or,updateOne:hr,updateMany:pr,deleteOne:mr,deleteMany:fr,initialize:rr});m(this,"selectors",{selectById:Ar,selectByIds:wr})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:b(u),blockers:[u.asset_procedure_type],blocks:[u.uuid]});return p.then(y=>{this.dispatch(c(y))}).catch(y=>{throw this.dispatch(r(u.uuid)),y}),[u,p]}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{asset_procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class VM extends D{constructor(){super(...arguments);m(this,"name","Asset Procedure Type Field Values Attachment");m(this,"url","/asset-procedure-type-field-values-attachments");m(this,"actions",{addOne:Or,addMany:Ds,setOne:Fr,setMany:gr,updateOne:_r,updateMany:Pr,deleteOne:br,deleteMany:qs,initialize:Ir});m(this,"selectors",{selectById:kr,selectByIds:vr})}getId(e){return e.uuid}getBlockers(e){return[e.field_values]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,d=n.getState(),l=r(e)(d);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{field_values__asset_procedure__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class WM extends M{constructor(){super(...arguments);m(this,"name","Asset Procedure Type Field Values");m(this,"url","/asset-procedure-type-field-values");m(this,"actions",{addOne:Br,addMany:zr,setOne:Dr,setMany:qr,updateOne:jr,updateMany:$r,deleteOne:Cr,deleteMany:Ur,initialize:Wr});m(this,"selectors",{selectById:Gr,selectByIds:Hr})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,u=new Date().toISOString(),p=O({...e,created_by:l,submitted_at:u}),f=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:b(p),blockers:[e.asset,e.fields_revision,e.asset_procedure],blocks:[p.uuid]});return this.dispatch(a(p)),f.then(T=>{this.dispatch(c(T))}).catch(()=>{this.dispatch(r(p.uuid))}),[p,f]}bulkAdd(e,n){var v;const{values:a,payloads:c}=e,{addMany:r,setMany:d,deleteMany:l}=this.actions,u=new Date().toISOString(),p=((v=this.client.store.getState().userReducer.currentUser)==null?void 0:v.id)??null,f=[],y=yt(c,Math.min(n??c.length,pt)),T=[];for(const _ of y){const k=[];for(const R of _){const z=O({...R,values:R.values,created_by:p,submitted_at:u});f.push(z),k.push({uuid:z.uuid,asset:R.asset,fields_revision:R.fields_revision,asset_procedure:R.asset_procedure,published_at:R.published_at,values:z.values})}T.push({submitted_at:u,values:a,field_values:k})}this.dispatch(r(f));const P=[];for(const _ of T){const{field_values:k}=_,R=k.map(({asset:V})=>V),z=k.map(({fields_revision:V})=>V),j=k.map(({asset_procedure:V})=>V),B=k.map(({uuid:V})=>V),q=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:_,blockers:R.concat(z).concat(j),blocks:B});P.push(q)}return Promise.all(P).then(_=>{this.dispatch(d(_.flat()))}).catch(()=>{this.dispatch(l(E(f)))}),[f,P]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),d=c(e.uuid)(r);if(!d)throw new Error(`Expected AssetProcedureTypeFieldValues with uuid ${e.uuid} to exist`);const l={...d,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[l.fields_revision,l.asset,l.asset_procedure],blocks:[l.uuid]});return u.then(p=>{this.dispatch(a(p))}).catch(()=>{this.dispatch(a(d))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected submission with uuid ${e} to exist`);const u=Er(e)(d);this.dispatch(a(e)),this.dispatch(qs(E(u)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(p){throw this.dispatch(c(l)),this.dispatch(Ds(u)),p}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{asset_procedure__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class BM extends M{constructor(){super(...arguments);m(this,"name","Asset Procedure");m(this,"url","/asset-procedures");m(this,"actions",{addOne:Jr,addMany:Us,setOne:xr,setMany:ed,updateOne:Zr,updateMany:Qr,deleteOne:Xr,deleteMany:Ls,initialize:Yr});m(this,"selectors",{selectById:nd,selectByIds:ad})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:b(u),blockers:[e.asset_procedure_type,e.asset_type],blocks:[u.uuid]});return p.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Expected asset procedure with uuid ${e.uuid} to exist`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[r.uuid],blocks:[r.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected asset procedure with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{project:e}},n)).flat();return this.dispatch(a(r)),r}}class zM extends M{constructor(){super(...arguments);m(this,"name","Asset Procedure Type");m(this,"url","/asset-procedure-types");m(this,"actions",{addOne:dd,addMany:ld,setOne:md,setMany:fd,updateOne:ud,updateMany:od,deleteOne:hd,deleteMany:pd,initialize:rd});m(this,"selectors",{selectById:Ad,selectByIds:wd})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:b(u),blockers:[],blocks:[u.uuid]});return p.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Expected asset procedure type with uuid ${e.uuid} to exist`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[r.uuid],blocks:[r.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected asset procedure type with uuid ${e} to exist`);const u=id(e)(d);this.dispatch(a(e)),this.dispatch(Ls(E(u)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(p){throw this.dispatch(c(l)),this.dispatch(Us(u)),p}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class DM extends D{constructor(){super(...arguments);m(this,"name","Asset Procedure Step Fields Attachment");m(this,"url","/asset-procedure-step-fields-attachments");m(this,"actions",{addOne:Od,addMany:Fd,setOne:gd,setMany:_d,updateOne:Pd,updateMany:bd,deleteOne:Rd,deleteMany:Md,initialize:Id});m(this,"selectors",{selectById:vd,selectByIds:Ed})}getId(e){return e.uuid}getBlockers(e){return[e.fields_revision]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,field_identifier:e.field_identifier,fields_revision:e.fields_revision,file_sha1:e.file_sha1,file_name:e.file_name,file_extension:e.file_extension}}buildBulkPayload(e){return{uuid:e.uuid,field_identifier:e.field_identifier,fields_revision:e.fields_revision,file_sha1:e.file_sha1,file_name:e.file_name,file_extension:e.file_extension}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{fields_revision__asset_procedure_step__organization:e}},n);return this.dispatch(a(c)),c}}class qM extends M{constructor(){super(...arguments);m(this,"name","Asset Procedure Step Fields");m(this,"url","/asset-procedure-step-fields");m(this,"actions",{addOne:zd,addMany:Dd,setOne:qd,setMany:jd,updateOne:$d,updateMany:Cd,deleteOne:Ud,deleteMany:Ld,initialize:Bd});m(this,"selectors",{selectById:Nd,selectByIds:Gd})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:b(u),blockers:[u.asset_procedure_step],blocks:[u.uuid]});return p.then(y=>{this.dispatch(c(y))}).catch(y=>{throw this.dispatch(r(u.uuid)),y}),[u,p]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,c=n.getState().assetProcedureStepFieldsReducer.instances[e.uuid];if(!c)throw new Error(`AssetProcedureStepFields with uuid ${e.uuid} not found`);const r={...c,...e};this.dispatch(a(r));const d=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${c.uuid}/`,payload:e,blockers:[c.uuid],blocks:[c.uuid]});return d.then(l=>{this.dispatch(a(l))}).catch(l=>{throw this.dispatch(a(c)),l}),[r,d]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,r=n.getState().assetProcedureStepFieldsReducer.instances[e];if(!r)throw new Error(`AssetProcedureStepFields with uuid ${e} not found`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(d){throw this.dispatch(c(r)),d}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{asset_procedure_step__asset_procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class jM extends D{constructor(){super(...arguments);m(this,"name","Asset Procedure Step Field Values Attachment");m(this,"url","/asset-procedure-step-field-values-attachments");m(this,"actions",{addOne:Jd,addMany:Qs,setOne:Zd,setMany:Qd,updateOne:Xd,updateMany:xd,deleteOne:el,deleteMany:Xs,initialize:Yd});m(this,"selectors",{selectById:sl,selectByIds:il})}getId(e){return e.uuid}getBlockers(e){return[e.field_values]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,d=n.getState(),l=r(e)(d);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{field_values__asset_procedure__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class $M extends M{constructor(){super(...arguments);m(this,"name","Asset Procedure Step Field Values");m(this,"url","/asset-procedure-step-field-values");m(this,"actions",{addOne:dl,addMany:ll,setOne:ul,setMany:ol,updateOne:hl,updateMany:pl,deleteOne:ml,deleteMany:fl,initialize:rl});m(this,"selectors",{selectById:Sl,selectByIds:Al})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,u=new Date().toISOString(),p=O({...e,created_by:l,submitted_at:u}),f=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:b(p),blockers:[e.asset,e.fields_revision,e.asset_procedure],blocks:[p.uuid]});return this.dispatch(a(p)),f.then(T=>{this.dispatch(c(T))}).catch(()=>{this.dispatch(r(p.uuid))}),[p,f]}bulkAdd(e,n){var v;const{payloads:a,values:c}=e,{addMany:r,setMany:d,deleteMany:l}=this.actions,u=new Date().toISOString(),p=((v=this.client.store.getState().userReducer.currentUser)==null?void 0:v.id)??null,f=[],y=yt(a,Math.min(n??a.length,pt)),T=[];for(const _ of y){const k=[];for(const R of _){const z=O({...R,values:R.values,created_by:p,submitted_at:u});f.push(z),k.push({uuid:z.uuid,asset:R.asset,fields_revision:R.fields_revision,asset_procedure:R.asset_procedure,asset_procedure_step:R.asset_procedure_step,published_at:R.published_at,values:z.values})}T.push({submitted_at:u,values:c,field_values:k})}this.dispatch(r(f));const P=[];for(const _ of T){const{field_values:k}=_,R=k.map(({asset:V})=>V),z=k.map(({fields_revision:V})=>V),j=k.map(({asset_procedure:V})=>V),B=k.map(({uuid:V})=>V),q=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:_,blockers:R.concat(z).concat(j),blocks:B});P.push(q)}return Promise.all(P).then(_=>{this.dispatch(d(_.flat()))}).catch(()=>{this.dispatch(l(E(f)))}),[f,P]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),d=c(e.uuid)(r);if(!d)throw new Error(`Expected AssetProcedureStepFieldValues with uuid ${e.uuid} to exist`);const l={...d,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[l.fields_revision,l.asset,l.asset_procedure],blocks:[l.uuid]});return u.then(p=>{this.dispatch(a(p))}).catch(()=>{this.dispatch(a(d))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected submission with uuid ${e} to exist`);const u=nl(e)(d);this.dispatch(a(e)),this.dispatch(Xs(E(u)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(p){throw this.dispatch(c(l)),this.dispatch(Qs(u)),p}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{asset_procedure__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class CM extends M{constructor(){super(...arguments);m(this,"name","Asset Procedure Step");m(this,"url","/asset-procedure-steps");m(this,"actions",{addOne:gl,addMany:_l,setOne:Ol,setMany:Fl,updateOne:Pl,updateMany:bl,deleteOne:Rl,deleteMany:Ml,initialize:Il});m(this,"selectors",{selectById:vl,selectByIds:El})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:b(u),blockers:[u.asset_procedure_type],blocks:[u.uuid]});return p.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`No asset procedure step with uuid ${e.uuid} found in the store`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${r.uuid}/`,payload:{name:e.name,description:e.description,priority:e.order,color:e.color},blockers:[r.uuid],blocks:[r.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteMany:a,addMany:c,addOne:r,deleteOne:d}=this.actions,{selectById:l}=this.selectors,u=n.getState(),p=l(e)(u);if(!p)throw new Error(`No asset procedure step with uuid ${e} found in the store`);const f=Vl(e)(u);this.dispatch(d(e)),this.dispatch(a(E(f)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(y){throw this.dispatch(r(p)),this.dispatch(c(f)),y}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{asset_procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class UM extends M{constructor(){super(...arguments);m(this,"url","/assets");m(this,"name","Asset");m(this,"actions",{addOne:zl,addMany:ni,setOne:$l,setMany:Cl,updateOne:Dl,updateMany:ql,deleteOne:jl,deleteMany:ai,initialize:Bl});m(this,"selectors",{selectById:Nl,selectByIds:Gl})}add(e){var f;const{store:n}=this.client,{addOne:a,updateOne:c,deleteOne:r}=this.actions,d=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:b(u),blockers:[u.asset_type],blocks:[u.uuid]});return p.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}update(e){const{store:n}=this.client,{updateOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`No asset with uuid ${e.uuid} found in the store`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{addOne:a,deleteOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`No asset with uuid ${e} found in the store`);const u=kc(e)(d),p=Gf(e)(d);this.dispatch(c(e)),this.dispatch(Ms(E(u))),this.dispatch(At(E(p)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(f){throw this.dispatch(a(l)),this.dispatch(Rs(u)),this.dispatch(St(p)),f}}bulkAdd(e,n){const{addMany:a}=this.actions,c=new Date().toISOString(),r=mt.v4(),d=yt(e,Math.min(n??e.length,pt)).map(p=>{const f=p.map(y=>O(y));return{batchId:mt.v4(),payload:{transaction_id:r,submitted_at:c,assets:f}}}),l=[];let u=null;for(const p of d){const{batchId:f,payload:y}=p,T=y.assets.map(({uuid:R})=>R),P=y.assets.map(({asset_type:R})=>R),v=y.assets.map(({project:R})=>R),_=y.assets.map(({status:R})=>R),k=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:y,blockers:(u?[u]:[]).concat(P).concat(v).concat(_),blocks:[f].concat(T)});u=p.batchId,l.push(k)}return Promise.all(l).then(p=>{const f=p.flat();this.dispatch(a(f))}),l}bulkUpdate(e,n){const{store:a}=this.client,{updateMany:c}=this.actions,{selectByIds:r}=this.selectors,d=E(e).toSorted(Yt);if(d.length!==e.length)throw new Error("payloads contains duplicate uuids.");const l=r(d)(a.getState()).toSorted(gs);if(d.length!=l.length)throw new Error(`Attempting to bulk update ${d.length-l.length} assets that dont exist in the store`);const u=[];for(let T=0;T<d.length;T++)u.push({...l[T],...e[T]});this.dispatch(c(u));const p=yt(e,Math.min(n??e.length,pt)),f=[];let y=null;for(const T of p){const P=mt.v4(),v=E(T),_=T.map(({status:R})=>R).filter(Boolean),k=this.enqueueRequest({description:w(h.PATCH,this.name,!0),method:h.PATCH,url:`${this.url}/bulk/`,payload:{payloads:T},blockers:(y?[y]:[]).concat(v).concat(_),blocks:[P].concat(v)});f.push(k),y=P}return Promise.all(f).then(T=>{this.dispatch(c(T.flat()))}).catch(()=>{this.dispatch(c(l))}),[u,f]}async bulkDelete(e){const{store:n}=this.client,{addMany:a,deleteMany:c}=this.actions,{selectByIds:r}=this.selectors,d=n.getState(),l=r(e)(d);this.dispatch(c(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(u){throw this.dispatch(a(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{project:e}},n)).flat();return this.dispatch(a(r)),r}}class LM extends M{constructor(){super(...arguments);m(this,"name","Asset Stage Completion");m(this,"url","/asset-stage-completions");m(this,"actions",{addOne:Jl,addMany:Zl,setOne:Ql,setMany:Xl,updateOne:xl,updateMany:eu,deleteOne:tu,deleteMany:su,initialize:Yl});m(this,"selectors",{selectById:cu,selectByIds:ru})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:b(u),blockers:[e.asset,e.asset_stage],blocks:[u.uuid]});return p.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Expected asset stage completion with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}bulkAdd(e){var T;const{store:n}=this.client,{addMany:a,setMany:c,deleteMany:r}=this.actions,d=new Date().toISOString(),l=((T=n.getState().userReducer.currentUser)==null?void 0:T.id)??null,u=e.map(P=>O(P)),p=u.map(P=>({...P,created_by:l,submitted_at:d})),f=p.map(({uuid:P})=>P);this.dispatch(a(p));const y=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:{submitted_at:d,completions:u},blockers:[...e.map(P=>P.asset_procedure),...e.map(P=>P.asset_stage),...e.map(P=>P.asset)],blocks:f});return y.then(P=>{this.dispatch(c(P))}).catch(()=>{this.dispatch(r(f))}),[p,y]}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,d=r(e)(n.getState());this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{asset_procedure__project:e}},n)).flat();return this.dispatch(a(r)),r}}class NM extends M{constructor(){super(...arguments);m(this,"name","Asset Stage");m(this,"url","/asset-stages");m(this,"actions",{addOne:hu,addMany:pu,setOne:uu,setMany:ou,updateOne:mu,updateMany:fu,deleteOne:yu,deleteMany:Su,initialize:lu});m(this,"selectors",{selectById:wu,selectByIds:Tu})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:b(u),blockers:[u.asset_procedure_type],blocks:[u.uuid]});return p.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`No asset stage with uuid ${e.uuid} found in the store`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${r.uuid}/`,payload:e,blockers:[r.uuid],blocks:[r.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`No asset stage with uuid ${e} found in the store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{asset_procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class GM extends D{constructor(){super(...arguments);m(this,"name","Asset Type Attachment");m(this,"url","/asset-type-attachments");m(this,"actions",{addOne:Fu,addMany:oi,setOne:gu,setMany:_u,updateOne:Pu,updateMany:bu,deleteOne:Ru,deleteMany:hi,initialize:Ou});m(this,"selectors",{selectById:ku,selectByIds:vu})}getId(e){return e.uuid}getBlockers(e){return[e.asset_type]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,asset_type:e.asset_type}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,asset_type:e.asset_type}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{asset_type__organization:e}},n);return this.dispatch(a(c)),c}}class HM extends D{constructor(){super(...arguments);m(this,"name","Asset Type Fields Attachment");m(this,"url","/asset-type-fields-attachments");m(this,"actions",{addOne:zu,addMany:Du,setOne:qu,setMany:ju,updateOne:$u,updateMany:Cu,deleteOne:Uu,deleteMany:Lu,initialize:Bu});m(this,"selectors",{selectById:Gu,selectByIds:Hu})}getId(e){return e.uuid}getBlockers(e){return[e.fields_revision]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{fields_revision__asset_type__organization:e}},n);return this.dispatch(a(c)),c}}class KM extends M{constructor(){super(...arguments);m(this,"name","Asset Type Fields");m(this,"url","/asset-type-fields");m(this,"actions",{addOne:Zu,addMany:Qu,setOne:Xu,setMany:xu,updateOne:eo,updateMany:to,deleteOne:so,deleteMany:io,initialize:Ju});m(this,"selectors",{selectById:ao,selectByIds:co})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:b(u),blockers:[u.asset_type],blocks:[u.uuid]});return p.then(y=>{this.dispatch(c(y))}).catch(y=>{throw this.dispatch(r(u.uuid)),y}),[u,p]}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{asset_type__organization:e}},n);return this.dispatch(a(c)),c}}class YM extends D{constructor(){super(...arguments);m(this,"name","Asset Type Field Values Attachment");m(this,"url","/asset-type-field-values-attachments");m(this,"actions",{addOne:oo,addMany:Ai,setOne:ho,setMany:po,updateOne:mo,updateMany:fo,deleteOne:yo,deleteMany:wi,initialize:uo});m(this,"selectors",{selectById:Ao,selectByIds:wo})}getId(e){return e.uuid}getBlockers(e){return[e.field_values]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,d=n.getState(),l=r(e)(d);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{field_values__asset__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class JM extends M{constructor(){super(...arguments);m(this,"name","Asset Type Field Values");m(this,"url","/asset-type-field-values");m(this,"actions",{addOne:go,addMany:_o,setOne:Po,setMany:bo,updateOne:Ro,updateMany:Mo,deleteOne:ko,deleteMany:vo,initialize:Fo});m(this,"selectors",{selectById:Vo,selectByIds:Wo})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,u=new Date().toISOString(),p=O({...e,created_by:l,submitted_at:u}),f=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:b(p),blockers:[e.asset,e.fields_revision],blocks:[p.uuid]});return this.dispatch(a(p)),f.then(T=>{this.dispatch(c(T))}).catch(()=>{this.dispatch(r(p.uuid))}),[p,f]}bulkAdd(e,n){var P;const{payloads:a,values:c}=e,{addMany:r,setMany:d,deleteMany:l}=this.actions,u=new Date().toISOString(),p=[],f=yt(a,Math.min(n??a.length,pt)),y=[];for(const v of f){const _=[];for(const k of v){const R=O({...k,values:k.values,created_by:((P=this.client.store.getState().userReducer.currentUser)==null?void 0:P.id)??null,submitted_at:u});p.push(R),_.push({uuid:R.uuid,asset:k.asset,fields_revision:k.fields_revision,published_at:k.published_at,values:R.values})}y.push({submitted_at:u,values:c,field_values:_})}this.dispatch(r(p));const T=[];for(const v of y){const{field_values:_}=v,k=_.map(({asset:B})=>B),R=_.map(({fields_revision:B})=>B),z=_.map(({uuid:B})=>B),j=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:v,blockers:k.concat(R),blocks:z});T.push(j)}return Promise.all(T).then(v=>{this.dispatch(d(v.flat()))}).catch(()=>{this.dispatch(l(E(p)))}),[p,T]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),d=c(e.uuid)(r);if(!d)throw new Error(`Expected AssetTypeFieldValues with uuid ${e.uuid} to exist`);const l={...d,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[l.uuid,l.fields_revision,l.asset],blocks:[l.uuid]});return u.then(p=>{this.dispatch(a(p))}).catch(()=>{this.dispatch(a(d))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected submission with uuid ${e} to exist`);const u=To(e)(d);this.dispatch(a(e)),this.dispatch(wi(E(u)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(p){throw this.dispatch(c(l)),this.dispatch(Ai(u)),p}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{asset__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class ZM extends M{constructor(){super(...arguments);m(this,"name","Asset Type Identifier");m(this,"url","/asset-type-identifiers");m(this,"actions",{addOne:qo,addMany:jo,setOne:$o,setMany:Co,updateOne:Uo,updateMany:Lo,deleteOne:No,deleteMany:Go,initialize:Do});m(this,"selectors",{selectById:Ko,selectByIds:Yo})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:b(u),blockers:[u.asset_type],blocks:[u.uuid]});return p.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Expected asset type identifier with uuid ${e.uuid} to exist`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected asset type identifier with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{asset_type__organization:e}},n);return this.dispatch(a(c)),c}}class QM extends M{constructor(){super(...arguments);m(this,"name","Asset Type Identifier Value");m(this,"url","/asset-type-identifier-values");m(this,"actions",{addOne:Xo,addMany:xo,setOne:eh,setMany:th,updateOne:sh,updateMany:ih,deleteOne:nh,deleteMany:ah,initialize:Qo});m(this,"selectors",{selectById:rh,selectByIds:dh})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:b(u),blockers:[e.asset,e.asset_type_identifier],blocks:[u.uuid]});return p.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}bulkAdd(e,n){var v;const{store:a}=this.client,{addMany:c,updateMany:r,deleteMany:d}=this.actions,l=new Date().toISOString(),u=((v=a.getState().userReducer.currentUser)==null?void 0:v.id)??null,p=yt(e,Math.min(n??e.length,pt)),f=[],y=[];for(const _ of p){const k=[],R=[],z=[];for(const B of _){const q=O({...B,submitted_at:l,created_by:u});y.push(q);const V={uuid:q.uuid,asset:q.asset,asset_type_identifier:q.asset_type_identifier,value:q.value};k.push(V),R.push(q.asset),R.push(q.asset_type_identifier),z.push(q.uuid)}const j={payloads:k,submitted_at:l,blockers:R,blocks:z};f.push(j)}this.dispatch(c(y));const T=f.map(_=>{const{payloads:k,submitted_at:R,blockers:z,blocks:j}=_;return this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:{submitted_at:R,payloads:k},blockers:z,blocks:j})});Promise.all(T).then(_=>{this.dispatch(r(_.flat()))}).catch(_=>{throw this.dispatch(d(E(y))),_});const P=Promise.all(T).then(_=>_.flat());return[y,P]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected asset type identifier value with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{asset__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class XM extends M{constructor(){super(...arguments);m(this,"name","Asset Type");m(this,"url","/asset-types");m(this,"actions",{addOne:mh,addMany:fh,setOne:hh,setMany:ph,updateOne:yh,updateMany:Sh,deleteOne:Ah,deleteMany:wh,initialize:oh});m(this,"selectors",{selectById:Ih,selectByIds:Oh})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:b(u),blockers:[],blocks:[u.uuid]});return p.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Expected asset type with uuid ${e.uuid} to exist`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[r.uuid],blocks:[r.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected asset type with uuid ${e} to exist`);const u=Ll(e)(d),p=Eu(e)(d);this.dispatch(a(e)),this.dispatch(ai(E(u))),this.dispatch(hi(E(p)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(f){throw this.dispatch(c(l)),this.dispatch(ni(u)),this.dispatch(oi(p)),f}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class xM extends M{constructor(){super(...arguments);m(this,"name","Asset Type Status");m(this,"url","/asset-type-statuses");m(this,"actions",{addOne:Ph,addMany:bh,setOne:Rh,setMany:Mh,updateOne:kh,updateMany:vh,deleteOne:Eh,deleteMany:Vh,initialize:_h});m(this,"selectors",{selectById:Bh,selectByIds:zh})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:b(u),blockers:[e.asset_type],blocks:[u.uuid]});return p.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}update(e){const{setOne:n}=this.actions,{selectById:a}=this.selectors,c=this.client.store.getState(),r=a(e.uuid)(c);if(!r)throw new Error(`Expected an existing asset type status with uuid ${e.uuid}`);const d={...r,...e};this.dispatch(n(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(n(u))}).catch(()=>{this.dispatch(n(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`No asset type status with uuid ${e} found in the store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{asset_type__organization:e}},n);return this.dispatch(a(c)),c}}class ek extends D{constructor(){super(...arguments);m(this,"name","Document Attachment");m(this,"url","/document-attachments");m(this,"actions",{addOne:Lh,addMany:Nh,setOne:Gh,setMany:Hh,updateOne:Kh,updateMany:Yh,deleteOne:Jh,deleteMany:Zh,initialize:Uh});m(this,"selectors",{selectById:Xh,selectByIds:xh})}getId(e){return e.uuid}getBlockers(e){return[e.document]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,document:e.document}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,document:e.document}}async bulkAdd(e,n){const[a,c,r]=await super.bulkAdd(e,n),d={};for(const{file_sha1:l,uuid:u}of a)l in d||(d[l]=[]),d[l].push(u);return r.then(l=>{const u=l.flatMap(p=>d[p]??[]);for(const p of u)this.makeReadable(p)}),[a,c,r]}makeReadable(e){this.enqueueRequest({description:"Add attachment to AI assistant",method:h.PATCH,url:`${this.url}/${e}/`,payload:{readable_to_assistant:!0},blockers:["index-document-attachment",e],blocks:["index-document-attachment"]})}async refreshStore(e,n){const{initialize:a}=this.actions,c=this.list({queryParams:{document__project__organization:e}},n),r=this.list({queryParams:{document__organization:e}},n),l=(await Promise.all([c,r])).flat();return this.dispatch(a(l)),l}}class tk extends M{constructor(){super(...arguments);m(this,"name","Document");m(this,"url","/documents");m(this,"actions",{addOne:ip,addMany:np,setOne:ap,setMany:cp,updateOne:rp,updateMany:dp,deleteOne:lp,deleteMany:up,initialize:sp});m(this,"selectors",{selectById:hp,selectByIds:pp})}add(e){var f;const{store:n}=this.client,{addOne:a,deleteOne:c,updateOne:r}=this.actions,d=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:b(u),blockers:u.parent_document?[u.parent_document]:[],blocks:[u.uuid]});return p.then(y=>{this.dispatch(r(y))}).catch(()=>{this.dispatch(c(u.uuid))}),[u,p]}update(e){const{store:n}=this.client,{updateOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`attempting to update a document with uuid ${e.uuid} that does not exist in store.documents`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c,addMany:r,deleteMany:d}=this.actions,{selectById:l}=this.selectors,u=n.getState(),p=l(e)(u);if(!p)throw new Error(`attempting to delete a document with uuid ${e} that does not exist in store.documents`);const f=mp(e)(u);this.dispatch(a(e)),this.dispatch(d(E(f)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(y){throw this.dispatch(c(p)),this.dispatch(r(f)),y}}async refreshStore(e,n){const{initialize:a}=this.actions,c=this.list({queryParams:{project__organization:e}},n),r=this.list({queryParams:{organization:e}},n),l=(await Promise.all([c,r])).flat();return this.dispatch(a(l)),l}}class It extends Tt{async get(s,e){return this.performRequest({url:`${this.url}/${s}/`,method:h.GET},e)}async list(s,e){return this.performRequest({url:`${this.url}/`,method:h.GET,...s},e)}async listPaginated(s,e){return this.performPagination({url:`${this.url}/`,method:h.GET,...s},e)}}class sk extends It{constructor(){super(...arguments);m(this,"name","Email Domains");m(this,"url","/organization-email-domains");m(this,"actions",{addOne:Sp,addMany:Ap,setOne:wp,setMany:Tp,updateOne:Ip,updateMany:Op,deleteOne:Fp,deleteMany:gp,initialize:yp});m(this,"selectors",{selectById:Pp,selectByIds:bp})}async add(e,n){return this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:{email:n,organization:e},blockers:[e,"create-org"],blocks:[]})}async delete(e){const{deleteOne:n,addOne:a}=this.actions;this.dispatch(n(e.uuid));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e.uuid}/`,blockers:[e.domain],blocks:[]})}catch(c){throw this.dispatch(a(e)),c}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class ik extends Tt{async getVerificationCode(s){return this.enqueueRequest({description:"Get verification code",method:h.GET,url:`/verification/email-verification/${s}/`,isAuthNeeded:!1,blockers:[],blocks:[]})}validateVerificationCode(s,e=void 0){return this.enqueueRequest({description:"Validate verification code",method:h.POST,url:`/verification/email-verification/${s}/`,isAuthNeeded:!1,payload:e,blockers:[],blocks:[]})}}const Nt={},ja=new Set;class nk extends Tt{constructor(){super(...arguments);m(this,"host");m(this,"dbPromise",PP.openDB("fileCache",1,{upgrade(e){e.createObjectStore("files")}}))}async getDB(){return await this.dbPromise}async addCache(e){if(!e.name)throw new Error(`Cant add a file without a name to cache: ${e.name}`);if(!e.type)throw new Error(`Cant add a file without a type to cache: ${e.name}`);if(!e.size)throw new Error(`Cant add an empty file to cache: ${e.name}`);const n=await Kt(e);if(ja.has(n))return;const a=await this.getDB();!!await a.get("files",n)?console.warn(`Attempting to add a file already cached, ${e.name}`):await a.put("files",e,n),ja.add(n)}async removeCache(e){await(await this.getDB()).delete("files",e),ja.delete(e)}async fetchCache(e){return(await this.getDB()).get("files",e)}async fetchFileFromUrl(e,n,a=n){const c=e.split("?")[0]??e,r=await this.fetchCache(n);if(r)return r;let d;c in Nt?d=Nt[c]:nc(e)?(d=ic(e,a),Nt[c]=d):(d=new Promise(p=>{this.performRequest({method:h.GET,url:e,isExternalUrl:!0,isResponseBlob:!0,isAuthNeeded:!1}).then(f=>{const y=new File([f],a,{type:f.type});p(y)})}),Nt[c]=d);let l;try{l=await d}catch(p){throw p instanceof C&&delete Nt[c],p}const u=await Kt(l);if(u!==n){const p=`The hash of the file returned from the server (${u}) does not match the
8
+ expected hash (${n}). This can happen if you're using a local development server and the
10
9
  isExternalUrl flag in the request details is set to true, because instead of requesting the local
11
10
  REST API, you will be requesting localhost:80 (where this app runs), resulting in a transformed blob
12
11
  (with an uuid attached) being returned. Alternatively, you may be running with
13
12
  import.meta.env.PROD, which will result in some file requests being treated as
14
- external URLs and therefore not prepended with VITE_API_URL.`;throw new Error(f)}const p=u.type.split("/")[1];if(!p)throw new Error("File has no extension");const A=c??o+"."+p;if(u=Fc(u,A),!u.name)throw new Error("Failed to set file's name");await this.addCache(u,o),Bt[n]=new Promise(f=>{f(u)})}return u}}class Wb extends q{async bulkAdd(e){var m;const i=new Date().toISOString(),a=(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.id,c={},n=[],r=[];for(const u of e){const{revisionUuid:o,fieldIdentifier:p,file:A}=u,f=await this.getFilePayload(A);f.sha1 in c||(c[f.sha1]=f);const b=T({file:URL.createObjectURL(A),file_type:A.type,file_name:A.name,file_sha1:f.sha1,created_by:a,form_revision:o,submitted_at:i,field_identifier:p});n.push(b);const P={uuid:b.uuid,file_name:A.name,field_identifier:p,file_extension:f.extension,file_sha1:f.sha1,form_revision:o};r.push(P)}this.dispatch(ru(n));const l=this.enqueueRequest({description:"Attach files to form revision",method:h.POST,url:"/form-revision-attachments/bulk/",payload:{submitted_at:i,attachments:r,files:Object.values(c)},blockers:n.map(u=>u.form_revision),blocks:n.map(u=>u.uuid)});return l.then(u=>{this.processPresignedUrls(u.presigned_urls),this.dispatch(du(u.attachments))}).catch(()=>{this.dispatch(uu(n.map(u=>u.uuid)))}),[n,l.then(({attachments:u})=>u)]}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Fetch organization form revision attachments",method:h.GET,url:"/form-revision-attachments/",queryParams:{form_revision__form__organization:e},blockers:[e],blocks:[]},i);return this.dispatch(nu(a)),a}}class Yb extends q{add(e){var l;const{store:i}=this.client,c=(l=i.getState().userReducer.currentUser)==null?void 0:l.id,n=T({...e,created_by:c,submitted_at:new Date().toISOString()});this.dispatch(Mi(n));const r=this.enqueueRequest({description:"Create form revision",method:h.POST,url:"/form-revisions/",payload:w(n),blockers:[e.form],blocks:[n.uuid]});return r.then(m=>{this.dispatch(Au(m))}).catch(()=>{this.dispatch(Ei(n.uuid))}),[n,r]}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get organization form revisions",method:h.GET,url:"/form-revisions/",queryParams:{form__organization:e},blockers:[e],blocks:[]},i);return this.dispatch(mu(a)),a}}class Kb extends q{add(e,i){var u;const{store:a}=this.client,c=new Date().toISOString(),n=(u=a.getState().userReducer.currentUser)==null?void 0:u.id,r=T({...e,submitted_at:c,created_by:n}),l=T({...i,form:r.uuid,submitted_at:c,created_by:n});this.dispatch(zi(r)),this.dispatch(Mi(l));const m=this.enqueueRequest({description:"Create form",method:h.POST,url:"/forms/",payload:{...w(r),initial_revision:{uuid:l.uuid,submitted_at:l.submitted_at,title:l.title,description:l.description,fields:l.fields}},blockers:[],blocks:[r.uuid,l.uuid]});return m.catch(o=>{throw this.dispatch(Ui(r.uuid)),this.dispatch(Ei(l.uuid)),o}),[r,l,m]}async delete(e){const{store:i}=this.client,a=i.getState(),c=Iu(e)(a);if(!c)throw new Error("Expected form to exist");const n=zu(e)(a);n.length>0&&this.dispatch(jt(n.map(({uuid:l})=>l)));const r=yu(e)(a);r.length>0&&this.dispatch(fu(r.map(({uuid:l})=>l))),this.dispatch(Ui(e));try{return await this.enqueueRequest({description:"Delete form",method:h.DELETE,url:`/forms/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(zi(c)),r.length>0&&this.dispatch(pu(r)),n.length>0&&this.dispatch(Et(n)),l}}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Fetch organization forms",method:h.GET,url:"/forms/",queryParams:{organization:e},blockers:[e],blocks:[]},i);return this.dispatch(bu(a)),a}}class Zb extends q{async bulkAdd(e){var m;const i=new Date().toISOString(),a=(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.id,c={},n=[],r=[];for(const u of e){const{submissionUuid:o,fieldIdentifier:p,file:A}=u,f=await this.getFilePayload(A);f.sha1 in c||(c[f.sha1]=f);const b=T({file:URL.createObjectURL(A),file_type:A.type,file_name:A.name,file_sha1:f.sha1,created_by:a,form_submission:o,submitted_at:i,field_identifier:p});n.push(b);const P={uuid:b.uuid,file_name:A.name,file_sha1:f.sha1,file_extension:f.extension,field_identifier:p,form_submission:o};r.push(P)}this.dispatch(vt(n));const l=this.enqueueRequest({description:"Attach files to form submission",method:h.POST,url:"/form-submission-attachments/bulk/",payload:{submitted_at:i,attachments:r,files:Object.values(c)},blockers:n.map(u=>u.form_submission),blocks:n.map(u=>u.uuid)});return l.then(u=>{this.processPresignedUrls(u.presigned_urls),this.dispatch(Ru(u.attachments))}).catch(u=>{throw this.dispatch(wt(n.map(o=>o.uuid))),u}),[n,l.then(({attachments:u})=>u)]}async bulkDelete(e){const{store:i}=this.client,a=i.getState(),c=wu(e)(a);this.dispatch(wt(e));try{await this.enqueueRequest({description:"Delete form submission attachments",method:h.DELETE,url:"/form-submission-attachments/bulk/",payload:{uuids:e},blockers:e,blocks:[]})}catch(n){throw this.dispatch(vt(c)),n}}async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Get form submission attachments",method:h.GET,url:"/form-submission-attachments/",queryParams:{limit:E,paginate:!0,form_submission__project:e},blockers:[],blocks:[]},n=>({immediate:!0,description:"Get form submission attachments",method:h.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(_u(c)),c}}class Jb extends q{add(e){var r;const{store:i}=this.client,a=i.getState(),c=T({...e,created_by:(r=a.userReducer.currentUser)==null?void 0:r.id,submitted_at:new Date().toISOString()}),n=this.enqueueRequest({description:"Add form submission",method:h.POST,url:"/form-submissions/",payload:w(c),blockers:[e.form_revision,...e.issue?[e.issue]:[],...e.asset?[e.asset]:[]],blocks:[c.uuid]});return this.dispatch(Bi(c)),n.then(l=>(this.dispatch(Mt(l)),l)).catch(()=>{this.dispatch(Gi(c.uuid))}),[c,n]}update(e){const{store:i}=this.client,a=i.getState(),c=Ni(e.uuid)(a);if(!c)throw new Error(`Expected submission with uuid ${e.uuid} to exist`);const n={...c,...e};this.dispatch(Vu(n));const r=this.enqueueRequest({description:"Delete user form submissions",method:h.PATCH,url:`/form-submissions/${n.uuid}/`,payload:e,blockers:[n.uuid],blocks:[n.uuid]});return r.then(l=>{this.dispatch(Mt(l))}).catch(()=>{this.dispatch(Mt(c))}),[n,r]}async delete(e){const{store:i}=this.client,a=i.getState(),c=Ni(e)(a);if(!c)throw new Error(`Expected submission with uuid ${e} to exist`);const n=Mu(e)(a);this.dispatch(Gi(e)),this.dispatch(wt(n.map(r=>r.uuid)));try{return await this.enqueueRequest({description:"Delete user form submissions",method:h.DELETE,url:`/form-submissions/${e}/`,blockers:[e],blocks:[]})}catch(r){throw this.dispatch(Bi(c)),this.dispatch(vt(n)),r}}async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Fetch form submissions",method:h.GET,url:"/form-submissions/",queryParams:{limit:E,paginate:!0,project:e},blockers:[],blocks:[]},n=>({immediate:!0,description:"Fetch form submissions",method:h.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(qu(c)),c}}class Xb extends q{async add(e){var p;const{store:i}=this.client,{file:a,...c}=e,n=new Date().toISOString(),r=(p=i.getState().userReducer.currentUser)==null?void 0:p.id,l=c.project,m=await this.getFilePayload(a),u=T({...c,file_name:a.name,file_sha1:m.sha1,file:URL.createObjectURL(a),submitted_at:n,created_by:r});this.dispatch($u(u));const o=this.enqueueRequest({description:"Add geo image",method:h.POST,url:"/geo-images/",payload:{uuid:u.uuid,submitted_at:n,title:u.title,description:u.description,geo_marker:u.geo_marker,canvas_marker:u.canvas_marker,sha1:u.file_sha1,project:u.project,file_name:u.file_name,direction:u.direction,original_date:u.original_date,file:m},blocks:[l],blockers:[l]});return o.then(A=>{this.processPresignedUrls(A.presigned_urls),this.dispatch(at(A.geo_image))}).catch(()=>{this.dispatch(Wi(u.uuid))}),[u,o.then(A=>A.geo_image)]}async bulkAdd(e,i){var p;const{store:a}=this.client,c=new Date().toISOString(),n=(p=a.getState().userReducer.currentUser)==null?void 0:p.id,r=[],l=[],m=[],u={};for(const A of e){const{file:f,...b}=A,P=await this.getFilePayload(f);P.sha1 in u||(u[P.sha1]=P);const _=T({...b,file_name:f.name,file_sha1:P.sha1,file:URL.createObjectURL(f),submitted_at:c,created_by:n,project:i});r.push(_),l.push(_.uuid),m.push({uuid:_.uuid,sha1:_.file_sha1,file_name:_.file_name,title:_.title,description:_.description,geo_marker:_.geo_marker,canvas_marker:_.canvas_marker,direction:_.direction,original_date:_.original_date})}this.dispatch(Lu(r));const o=this.enqueueRequest({description:"Bulk add geo images",method:h.POST,url:"/geo-images/bulk/",payload:{submitted_at:c,project:i,geo_images:m,files:Object.values(u)},blocks:[i],blockers:l});return o.then(A=>{this.processPresignedUrls(A.presigned_urls),this.dispatch(Gu(A.geo_images))}).catch(()=>{this.dispatch(Hu(l))}),[r,o.then(A=>A.geo_images)]}update(e){const{store:i}=this.client,a=i.getState(),c=Yi(e.uuid)(a);if(!c)throw new Error(`Map image with uuid ${e.uuid} does not exist in the store`);const n={...c,...e};this.dispatch(Nu(n));const r=this.enqueueRequest({description:"Update geo image",method:h.PATCH,url:`/geo-images/${e.uuid}/`,payload:e,blocks:[e.uuid],blockers:[e.uuid]});return r.then(l=>{this.dispatch(at(l))}).catch(()=>{this.dispatch(at(c))}),[n,r]}async delete(e){const{store:i}=this.client,a=i.getState(),c=Yi(e)(a);if(!c)throw new Error(`Map image with uuid ${e} does not exist in the store`);this.dispatch(Wi(e));const n=this.enqueueRequest({description:"Delete geo image",method:h.DELETE,url:`/geo-images/${e}/`,blocks:[e],blockers:[e]});return n.catch(()=>{this.dispatch(at(c))}),n}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get geo images",method:h.GET,url:"/geo-images/",queryParams:{project:e},blocks:[e],blockers:[]},i);return this.dispatch(Bu(a)),a}}class Qb extends v{add(e){var l;const{store:i}=this.client,a=new Date().toISOString(),c=(l=i.getState().userReducer.currentUser)==null?void 0:l.id,n=T({...e,submitted_at:a,created_by:c});this.dispatch(Zi(n));const r=this.enqueueRequest({description:"Add issue association",method:h.POST,url:"/issue-associations/",payload:w(n),blockers:[e.associated_issue,...e.issue?[e.issue]:[],...e.asset?[e.asset]:[]],blocks:[n.uuid]});return r.then(m=>{this.dispatch(Xu(m))}).catch(()=>{this.dispatch(Xi(n.uuid))}),[n,r]}async delete(e){const{store:i}=this.client,a=Qu(e)(i.getState());if(!a)throw new Error(`Issue association with uuid ${e} not found in store.`);this.dispatch(Xi(e));const c=this.enqueueRequest({description:"Delete issue association",method:h.DELETE,url:`/issue-associations/${e}/`,blockers:[e],blocks:[]});return c.catch(()=>{this.dispatch(Zi(a))}),c}async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Fetch issue associations",method:h.GET,url:"/issue-associations/",queryParams:{limit:E,paginate:!0,associated_issue__project:e},blockers:[],blocks:[]},n=>({immediate:!0,description:"Fetch issue associations",method:h.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(Ju(c)),c}}class xb extends ke{constructor(){super(...arguments);S(this,"name","Issue Attachment");S(this,"url","/issue-attachments");S(this,"initializeAttachments",ea);S(this,"addAttachments",ta);S(this,"updateAttachments",co);S(this,"removeAttachments",sa);S(this,"removeAttachment",no);S(this,"setAttachment",ao);S(this,"selectAttachment",lo)}buildOfflineAttachment(i){return T({file:URL.createObjectURL(i.file),file_sha1:i.file_sha1,created_by:i.created_by,file_name:i.file.name,file_type:i.file.type,submitted_at:i.submitted_at,description:i.description,issue:i.modelUuid})}buildAttachmentPayload(i){return{...i,issue:i.modelUuid}}async bulkAdd(i){return this._bulkAdd(i.map(a=>({modelUuid:a.issueUuid,file:a.file})))}async delete(i){return this._delete(i)}async refreshStore(i,a){const n=(await this.performPagination({immediate:!0,description:"Get issue attachments",method:h.GET,url:`${this.url}/`,queryParams:{limit:E,paginate:!0,issue__project:i},blocks:[],blockers:[]},r=>({immediate:!0,description:"Get issue attachments",method:h.GET,url:r,blockers:[],blocks:[]}),a)).flat();return this.dispatch(ea(n)),n}}class eP extends ke{constructor(){super(...arguments);S(this,"name","Issue Comment Attachment");S(this,"url","/issue-comment-attachments");S(this,"initializeAttachments",aa);S(this,"addAttachments",po);S(this,"updateAttachments",fo);S(this,"removeAttachments",So);S(this,"removeAttachment",yo);S(this,"setAttachment",Ao);S(this,"selectAttachment",Po)}buildOfflineAttachment(i){return T({file:URL.createObjectURL(i.file),file_sha1:i.file_sha1,created_by:i.created_by,file_name:i.file.name,file_type:i.file.type,submitted_at:i.submitted_at,description:i.description,issue_comment:i.modelUuid})}buildAttachmentPayload(i){return{...i,issue_comment:i.modelUuid}}async bulkAdd(i){return this._bulkAdd(i.map(a=>({modelUuid:a.issueCommentUuid,file:a.file})))}async delete(i){return this._delete(i)}async refreshStore(i,a){const n=(await this.performPagination({immediate:!0,description:"Get issue comment attachments",method:h.GET,url:`${this.url}/`,queryParams:{limit:E,paginate:!0,issue_comment__issue__project:i},blocks:[],blockers:[]},r=>({immediate:!0,description:"Get issue comment attachments",method:h.GET,url:r,blockers:[],blocks:[]}),a)).flat();return this.dispatch(aa(n)),n}}class tP extends v{add(e){var n;const{store:i}=this.client,a=T({...e,author:(n=i.getState().userReducer.currentUser)==null?void 0:n.id,submitted_at:new Date().toISOString()});this.dispatch(na(a));const c=this.enqueueRequest({description:"Add issue comment",method:h.POST,url:"/issue-comments/",payload:w(a),blockers:[e.issue],blocks:[a.uuid]});return c.catch(()=>{this.dispatch(da(a.uuid))}),[a,c]}update(e){const{store:i}=this.client,a=ua(e.uuid)(i.getState());if(!a)throw new Error(`Comment with uuid ${e.uuid} not found in store`);const c={...a,...e};this.dispatch(ra(c));const n=this.enqueueRequest({description:"Edit issue comment",method:h.PATCH,url:`/issue-comments/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return n.catch(()=>{this.dispatch(ra(a))}),[c,n]}remove(e){const{store:i}=this.client,a=ua(e)(i.getState());if(!a)throw new Error(`Comment with uuid ${e} not found in store`);this.dispatch(da(e));const c=this.enqueueRequest({description:"Delete comment",method:h.DELETE,url:`/issue-comments/${e}/`,blockers:[e],blocks:[]});return c.catch(()=>{this.dispatch(na(a))}),c}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get comments",method:h.GET,url:"/issue-comments/",queryParams:{issue__project:e},blockers:[],blocks:[]},i);return this.dispatch(Io(a)),a}}class sP extends v{add(e){var m;const{store:i}=this.client,a=i.getState(),c=new Date().toISOString(),n=(m=a.userReducer.currentUser)==null?void 0:m.id,r=T({...e,submitted_at:c,created_by:n});this.dispatch(la(r));const l=this.enqueueRequest({description:"Create issue",method:h.POST,url:"/issues/",payload:w(r),blockers:[r.project,r.issue_type,...r.category?[r.category]:[]],blocks:[r.uuid]});return l.then(u=>{this.dispatch(qt(u))}).catch(u=>{throw this.dispatch(ha(r.uuid)),u}),[r,l]}update(e){var m;const i=this.client.store.getState(),a=Aa(e.uuid)(i);if(!a)throw new Error(`Attempting to update an issue with uuid ${e.uuid} that doesn't exist in the store`);const c={...a,...e};this.dispatch(qt(c));const n={};for(const u of[j.TITLE,j.DESCRIPTION,j.STATUS,j.CATEGORY,j.PRIORITY,j.ASSIGNED_TO,j.DUE_DATE])if(u in e&&e[u]!==a[u])switch(u){case j.PRIORITY:case j.STATUS:{const o=e[u];n[u]=o!==void 0?Number(o):null;break}case j.DUE_DATE:case j.DESCRIPTION:case j.TITLE:n[u]=e[u]??null;break;case j.CATEGORY:{let o=null;const p=e[u];if(p&&(o=i.categoryReducer.instances[p]??null,!o))throw new Error(`Trying to update issue category to ${p} which does not exist in store`);n[u]=o?{name:o.name,color:o.color,uuid:o.uuid}:null;break}case j.ASSIGNED_TO:{let o=null;const p=e[u];if(p&&(o=i.userReducer.instances[p]??null,!o))throw new Error(`Trying to update issue assigned_to to ${p} which does not exist in store`);n[u]=o?{full_name:o.username,id:o.id}:null;break}}const r=T({created_by:(m=i.userReducer.currentUser)==null?void 0:m.id,submitted_at:new Date().toISOString(),issue:a.uuid,changes:n});this.dispatch(Tl(r));const l=this.enqueueRequest({description:"Edit issue",method:h.PATCH,url:`/issues/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.catch(()=>{this.dispatch(qt(a)),this.dispatch(Ol(r.uuid))}),[c,l]}async remove(e){const{store:i}=this.client,a=i.getState(),c=Aa(e)(a);if(!c)throw new Error(`No issue with uuid ${e} found in the store`);const n=oo(e)(a),r=wl(e)(a),l=Uu(e)(a),m={};for(const o of xu(e)(a))m[o.uuid]=o;for(const o of eo(e)(a))m[o.uuid]=o;const u=Object.values(m);this.dispatch(ha(e)),n.length>0&&this.dispatch(sa(n.map(({uuid:o})=>o))),r.length>0&&this.dispatch(_l(r.map(({uuid:o})=>o))),l.length>0&&this.dispatch(jt(l.map(({uuid:o})=>o))),u.length>0&&this.dispatch(Qi(u.map(({uuid:o})=>o)));try{return await this.enqueueRequest({description:"Delete issue",method:h.DELETE,url:`/issues/${e}/`,blockers:[e],blocks:[]})}catch(o){throw this.dispatch(la(c)),this.dispatch(ta(n)),this.dispatch(Il(r)),this.dispatch(Et(l)),this.dispatch(Ji(u)),o}}async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Get issues",method:h.GET,url:"/issues/",queryParams:{limit:E,paginate:!0,project:e},blockers:[],blocks:[]},n=>({immediate:!0,description:"Get issues",method:h.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(vo(c)),c}}class iP extends ke{constructor(){super(...arguments);S(this,"name","Issue Type Attachment");S(this,"url","/issue-type-attachments");S(this,"initializeAttachments",ya);S(this,"addAttachments",Vo);S(this,"updateAttachments",Uo);S(this,"removeAttachments",Co);S(this,"removeAttachment",Do);S(this,"setAttachment",zo);S(this,"selectAttachment",Go)}buildOfflineAttachment(i){return T({file:URL.createObjectURL(i.file),file_sha1:i.file_sha1,created_by:i.created_by,file_name:i.file.name,file_type:i.file.type,submitted_at:i.submitted_at,description:i.description,issue_type:i.modelUuid})}buildAttachmentPayload(i){return{...i,issue_type:i.modelUuid}}async bulkAdd(i){return this._bulkAdd(i.map(a=>({modelUuid:a.issueTypeUuid,file:a.file})))}async delete(i){return this._delete(i)}async refreshStore(i,a){const c=await this.enqueueRequest({immediate:!0,description:"Get issue type attachments",method:h.GET,url:`${this.url}/`,queryParams:{issue_type__organization:i},blocks:[],blockers:[]},a);return this.dispatch(ya(c)),c}}class aP extends q{async bulkAdd(e){var m;const i=new Date().toISOString(),a=(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.id,c={},n=[],r=[];for(const u of e){const{fieldsRevisionUuid:o,fieldIdentifier:p,file:A}=u,f=await this.getFilePayload(A);f.sha1 in c||(c[f.sha1]=f);const b=T({file:URL.createObjectURL(A),file_type:A.type,file_name:A.name,file_sha1:f.sha1,created_by:a,fields_revision:o,submitted_at:i,field_identifier:p});n.push(b);const P={uuid:b.uuid,file_name:A.name,file_extension:f.extension,field_identifier:p,file_sha1:f.sha1,fields_revision:o};r.push(P)}this.dispatch(Ho(n));const l=this.enqueueRequest({description:"Add issue type fields attachments",method:h.POST,url:"/issue-type-fields-attachments/bulk/",payload:{submitted_at:i,attachments:r,files:Object.values(c)},blockers:n.map(u=>u.fields_revision),blocks:n.map(u=>u.uuid)});return l.then(u=>{this.processPresignedUrls(u.presigned_urls),this.dispatch(Wo(u.attachments))}).catch(()=>{this.dispatch(Yo(n.map(u=>u.uuid)))}),[n,l.then(({attachments:u})=>u)]}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"get issue type fields attachments",method:h.GET,url:"/issue-type-fields-attachments/",queryParams:{fields_revision__issue_type__organization:e},blockers:[e],blocks:[]},i);return this.dispatch(No(a)),a}}class cP extends v{add(e){var l;const{store:i}=this.client,a=(l=i.getState().userReducer.currentUser)==null?void 0:l.id,c=new Date().toISOString(),n=T({...e,created_by:a,submitted_at:c});this.dispatch(il(n));const r=this.enqueueRequest({description:"Add Issue Type Fields",method:h.POST,url:"/issue-type-fields/",payload:w(n),blockers:[n.issue_type],blocks:[n.uuid]});return r.then(m=>{this.dispatch(al(m))}).catch(m=>{throw this.dispatch(cl(n.uuid)),m}),[n,r]}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get Issue Type Fields",method:h.GET,url:"/issue-type-fields/",queryParams:{issue_type__organization:e},blockers:[],blocks:[]},i);return this.dispatch(sl(a)),a}}class nP extends q{async bulkAdd(e){var m;const i=new Date().toISOString(),a=(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.id,c={},n=[],r=[];for(const u of e){const{fieldValuesUuid:o,fieldIdentifier:p,file:A}=u,f=await this.getFilePayload(A);f.sha1 in c||(c[f.sha1]=f);const b=T({file:URL.createObjectURL(A),file_type:A.type,file_name:A.name,file_sha1:f.sha1,created_by:a,field_values:o,submitted_at:i,field_identifier:p});n.push(b);const P={uuid:b.uuid,file_name:A.name,file_sha1:f.sha1,file_extension:f.extension,field_identifier:p,field_values:o};r.push(P)}this.dispatch(zt(n));const l=this.enqueueRequest({description:"Add issue type field values attachments",method:h.POST,url:"/issue-type-field-values-attachments/bulk/",payload:{submitted_at:i,attachments:r,files:Object.values(c)},blockers:n.map(u=>u.field_values),blocks:n.map(u=>u.uuid)});return l.then(({presigned_urls:u,attachments:o})=>{this.processPresignedUrls(u),this.dispatch(ol(o))}).catch(u=>{throw this.dispatch(Ut(n.map(o=>o.uuid))),u}),[n,l.then(({attachments:u})=>u)]}async bulkDelete(e){const{store:i}=this.client,a=i.getState(),c=hl(e)(a);this.dispatch(Ut(e));try{await this.enqueueRequest({description:"Delete issue type field values attachments",method:h.DELETE,url:"/issue-type-field-values-attachments/bulk/",payload:{uuids:e},blockers:e,blocks:[]})}catch(n){throw this.dispatch(zt(c)),n}}async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Get issue type field values attachments",method:h.GET,url:"/issue-type-field-values-attachments/",queryParams:{limit:E,paginate:!0,field_values__issue__project:e},blockers:[],blocks:[]},n=>({immediate:!0,description:"Get issue type field values attachments",method:h.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(ul(c)),c}}class rP extends v{add(e){var r;const{store:i}=this.client,a=i.getState(),c=T({...e,created_by:(r=a.userReducer.currentUser)==null?void 0:r.id,submitted_at:new Date().toISOString()}),n=this.enqueueRequest({description:"Add issue type field values",method:h.POST,url:"/issue-type-field-values/",payload:w(c),blockers:[e.issue,e.fields_revision],blocks:[c.uuid]});return this.dispatch(ba(c)),n.then(l=>(this.dispatch(nt(l)),l)).catch(()=>{this.dispatch(Pa(c.uuid))}),[c,n]}update(e){const{store:i}=this.client,a=i.getState(),c=Ta(e.uuid)(a);if(!c)throw new Error(`Expected IssueTypeFieldValues with uuid ${e.uuid} to exist`);const n={...c,...e};this.dispatch(nt(n));const r=this.enqueueRequest({description:"Update issue type field values",method:h.PATCH,url:`/issue-type-field-values/${e.uuid}/`,payload:e,blockers:[n.uuid,n.fields_revision,n.issue],blocks:[n.uuid]});return r.then(l=>{this.dispatch(nt(l))}).catch(()=>{this.dispatch(nt(c))}),[n,r]}async delete(e){const{store:i}=this.client,a=i.getState(),c=Ta(e)(a);if(!c)throw new Error(`Expected submission with uuid ${e} to exist`);const n=ml(e)(a);this.dispatch(Pa(e)),this.dispatch(Ut(n.map(r=>r.uuid)));try{await this.enqueueRequest({description:"Delete issue type field values",method:h.DELETE,url:`/issue-type-field-values/${e}/`,blockers:[e],blocks:[]})}catch(r){throw this.dispatch(ba(c)),this.dispatch(zt(n)),r}}async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Get issue type field values",method:h.GET,url:"/issue-type-field-values/",queryParams:{limit:E,paginate:!0,issue__project:e},blockers:[],blocks:[]},n=>({immediate:!0,description:"Get issue type field values",method:h.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(Qo(c)),c}}class dP extends v{add(e){var r;const{store:i}=this.client,a=i.getState(),c=T({...e,submitted_at:new Date().toISOString(),created_by:(r=a.userReducer.currentUser)==null?void 0:r.id});this.dispatch(yl(c));const n=this.enqueueRequest({method:h.POST,url:"/issue-types/",payload:w(c),blockers:[],blocks:[c.uuid]});return n.then(l=>{this.dispatch(rt(l))}).catch(()=>{this.dispatch(va(c.uuid))}),[c,n]}update(e){const{store:i}=this.client,a=i.getState(),c=Ma(e.uuid)(a);if(!c)throw new Error(`IssueType with uuid ${e.uuid} does not exist in the store.`);const n={...c,...e};this.dispatch(Sl(n));const r=this.enqueueRequest({method:h.PATCH,url:`/issue-types/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return r.then(l=>{this.dispatch(rt(l))}).catch(()=>{this.dispatch(rt(c))}),[n,r]}delete(e){const{store:i}=this.client,a=i.getState(),c=Ma(e)(a);if(!c)throw new Error(`IssueType with uuid ${e} does not exist in the store.`);const n=Eo(e)(a);this.dispatch(va(e)),this.dispatch(Mo(n.map(l=>l.uuid)));const r=this.enqueueRequest({method:h.DELETE,url:`/issue-types/${e}/`,blockers:[e],blocks:[]});return r.catch(()=>{this.dispatch(rt(c)),this.dispatch(wo(n))}),r}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,method:h.GET,url:"/issue-types/",queryParams:{organization:e},blockers:[],blocks:[]},i);return this.dispatch(fl(a)),a}}class uP extends v{async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Get issue updates",method:h.GET,url:"/issue-updates/",queryParams:{limit:E,paginate:!0,issue__project:e},blockers:[],blocks:[]},n=>({immediate:!0,description:"Get issue updates",method:h.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(Fl(c)),c}}const oP=1800;function lP(t){if(!t.access)throw new Error("Missing access token");if(!t.refresh)throw new Error("Missing refresh token");return{accessToken:t.access,refreshToken:t.refresh}}class hP extends mb{constructor(){super(...arguments);S(this,"_getRenewedTokens",async i=>{const a=this.enqueueRequest({description:"Get renewed tokens",method:h.POST,url:this.refreshTokensUrl,payload:{refresh:i},isAuthNeeded:!1,blockers:[],blocks:[],checkAuth:!1,immediate:!0});let c;try{c=await a}catch(n){console.error("Could not renew tokens; clearing auth",n),this.clearAuth();return}if(!c.access)throw new Error("Missing access token");return{accessToken:c.access,refreshToken:c.refresh??this.getRefreshToken()}})}clearAuth(){console.debug(this.constructor.name,"clearing auth;"),this.dispatch(Td(!1)),this.clearTokens(),this.dispatch(F()),this.dispatch(F())}async renewTokens(){const i=this.getRefreshToken();if(!i)throw new Error("No refresh token found");console.debug(this.constructor.name,"renewing tokens");try{const a=await this._getRenewedTokens(i);if(!a)return;console.log("Got renewed tokens"),this.setTokens(a)}catch(a){throw console.error("Could not renew tokens; clearing auth",a),this.clearAuth(),a}}tokenIsExpiringSoon(){const i=this.getAccessToken();if(!i)return!1;const a=Date.now()/1e3;let c;try{c=bm(i).exp??a}catch{c=a}return c-a<oP}getAuthHeader(){return`Bearer ${this.getAccessToken()}`}async prepareAuth(){if(this.tokenIsExpiringSoon()){console.debug(this.constructor.name,"preparing auth");try{await this.renewTokens()}catch(i){return i instanceof D&&this.clearAuth(),i instanceof Error?Promise.reject(i):Promise.reject(new Error((i??Ye).toString()))}}}async handleUnauthorized(i,a){const c=this.client.store.getState();if(i.url.endsWith("/token/refresh/"))throw c.authReducer.isLoggedIn&&console.warn("No signed-in user to sign out."),this.clearAuth(),new D({message:"You have been signed out due to inactivity.",response:a,discard:!0});if(c.authReducer.isLoggedIn)await this.renewTokens();else throw console.debug("Forbidden; user is not logged in."),new D({message:"Incorrect username or password.",response:a,discard:!0})}async initAuth(i){const a=Ne.v4();return console.debug(this.constructor.name,"Initiating auth"),this.enqueueRequest({uuid:a,description:"Get token pair",method:h.POST,url:this.initTokensUrl,payload:i,isAuthNeeded:!1,checkAuth:!1,immediate:!0,blockers:[],blocks:[]}).then(c=>{this.setTokens(lP(c))})}}class mP extends v{update(e){const{store:i}=this.client,a=Ua(e.uuid)(i.getState()),c={...a,...e};this.dispatch(Ct(c));const n=this.enqueueRequest({description:"Edit organization access",method:h.PATCH,url:`/organization-accesses/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return n.then(r=>{this.dispatch(Ct(r))}).catch(r=>{throw this.dispatch(Ct(a)),r}),[c,n]}async remove(e){const{store:i}=this.client,a=i.getState(),c=Ua(e)(a),n=Dl(c.user)(a);this.dispatch(Gl(c.uuid)),this.dispatch(Vl(c.user));try{await this.enqueueRequest({description:"Remove organization access",method:h.DELETE,url:`/organization-accesses/${c.uuid}/`,blockers:[c.uuid],blocks:[]})}catch(r){throw this.dispatch(Bl(c)),this.dispatch(ql(n)),r}}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get organization accesses",method:h.GET,url:"/organization-accesses/",queryParams:{organization:e},blockers:[],blocks:[]},i);return this.dispatch(kl(a)),a}}class pP extends v{async add(e){const i=await this.enqueueRequest({description:"Create organization",method:h.POST,url:"/organizations/",payload:e,blockers:[],blocks:[]});return this.dispatch(Wl(i)),i}async update(e){const i=await this.enqueueRequest({description:"Edit organization",method:h.PATCH,url:`/organizations/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return this.dispatch(Yl(i)),i}async invite(e,i){return this.enqueueRequest({description:"Invite user to organization",method:h.POST,url:`/organizations/${e}/invite/${i}/`,blockers:[],blocks:[]})}async refreshStore(e){const i=await this.enqueueRequest({immediate:!0,description:"Fetch organizations",method:h.GET,url:"/organizations/",blockers:[],blocks:[]},e);return this.dispatch(Hl(i)),i}}class AP extends v{add(e){var n;const{store:i}=this.client,a=T({...e,created_by:(n=i.getState().userReducer.currentUser)==null?void 0:n.id});this.dispatch(Ba(a));const c=this.enqueueRequest({description:"Add project access",method:h.POST,url:"/project-accesses/",payload:w(a),blockers:[a.organization_access,a.project],blocks:[a.uuid]});return c.then(r=>{this.dispatch(dt(r))}).catch(r=>{throw this.dispatch(Ga(a.uuid)),r}),[a,c]}update(e){const{store:i}=this.client,a=La(e.uuid)(i.getState()),c={...a,...e};this.dispatch(dt(c));const n=this.enqueueRequest({description:"Edit project access",method:h.PATCH,url:`/project-accesses/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[]});return n.then(r=>{this.dispatch(dt(r))}).catch(r=>{throw this.dispatch(dt(a)),r}),[c,n]}async remove(e){const{store:i}=this.client,a=La(e)(i.getState());this.dispatch(Ga(e));try{await this.enqueueRequest({description:"Delete project access",method:h.DELETE,url:`/project-accesses/${e}/`,blockers:[e],blocks:[]})}catch(c){throw this.dispatch(Ba(a)),c}}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get project accesses",method:h.GET,url:"/project-accesses/",queryParams:{project__organization_owner:e},blockers:[],blocks:[]},i);return this.dispatch(ih(a)),a}}class fP extends ke{constructor(){super(...arguments);S(this,"name","Project Attachment");S(this,"url","/project-attachments");S(this,"addAttachments",oh);S(this,"updateAttachments",mh);S(this,"removeAttachments",Ha);S(this,"removeAttachment",ph);S(this,"setAttachment",lh);S(this,"selectAttachment",yh)}buildOfflineAttachment(i){return T({file:URL.createObjectURL(i.file),file_sha1:i.file_sha1,created_by:i.created_by,file_name:i.file.name,file_type:i.file.type,submitted_at:i.submitted_at,description:i.description,project:i.modelUuid})}buildAttachmentPayload(i){return{...i,project:i.modelUuid}}async bulkAdd(i){return this._bulkAdd(i.map(a=>({modelUuid:a.projectUuid,file:a.file})))}async delete(i){return this._delete(i)}async refreshStore(i,a){const c=await this.enqueueRequest({immediate:!0,description:"Get project attachments",method:h.GET,url:`${this.url}/`,queryParams:{project__organization_owner:i},blockers:[],blocks:[]},a);return this.dispatch(uh(c)),c}}class yP extends v{async saveExisting(e){if(!e.uuid)throw new Error("You can only use this method to save existing project files. The one provided has no uuid.");const i={...e};delete i.file;const a=this.enqueueRequest({method:h.PATCH,url:`/project-files/${e.uuid}/`,payload:i,blockers:[e.uuid],blocks:[e.uuid]});return a.then(c=>{this.dispatch(Ya(c))}),a}saveActive(){const{store:e}=this.client,i=e.getState(),a=i.projectFileReducer.activeProjectFileId;if(!a)throw new Error("No active project file");const c=i.projectFileReducer.instances[a];if(!c)throw new Error("No active project file");if(!c.bounds&&!c.canvas_bounds)throw new Error("Project file must either have bounds or canvas_bounds set");let n;if(typeof c.file=="string"&&!c.file.startsWith("blob:")){const m={...c};delete m.file,n={method:h.PATCH,url:`/project-files/${a}/`,payload:m,blockers:[a],blocks:[a]}}else n=new Promise((m,u)=>{this.client.files.uploadFileToS3(c.file_sha1).then(([o])=>{m({method:h.POST,url:`/project-files${c.project}/`,payload:{...c,...o},blockers:[a],blocks:[a]})}).catch(u)});const l=Promise.resolve(n).then(m=>this.enqueueRequest(m));return l.then(m=>{this.dispatch(Ya(m))}),this.dispatch(Rh),this.dispatch(_h(null)),this.dispatch(Oh(!1)),[c,l]}delete(e){return this.dispatch(Th(e)),this.enqueueRequest({method:h.DELETE,url:`/project-files/${e}`,blockers:[e],blocks:[]})}async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Get project files",method:h.GET,url:"/project-files/",queryParams:{limit:E,paginate:!0,project:e},blockers:[],blocks:[]},n=>({immediate:!0,description:"Get project files",method:h.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(Ph(c)),c}}class SP extends v{async add(e){const i=await this.enqueueRequest({description:"Create project",method:h.POST,url:"/projects/",payload:w(e),blockers:[],blocks:[]});return this.dispatch(Za(i)),i}async update(e){if(!e.bounds&&!e.canvas_bounds)throw new Error("Project must either have bounds or canvas_bounds set");return this.dispatch(qh(e)),await this.enqueueRequest({description:"Update project",method:h.PATCH,url:`/projects/${e.uuid}/`,payload:{name:e.name,bounds:e.bounds},blockers:[e.uuid],blocks:[e.uuid]})}async delete(e){const{store:i}=this.client,a=i.getState(),c=Uh(e)(a);if(!c)throw new Error("Expected project to exist");const n=wh(a).filter(m=>m.project===e);this.dispatch(Ih(n.map(({uuid:m})=>m)));const r=Sh(c.uuid)(a);this.dispatch(Ha(r.map(({uuid:m})=>m)));const l=rh(e)(a);this.dispatch(ch(l.map(({uuid:m})=>m))),this.dispatch(Ja(c.uuid));try{await this.enqueueRequest({description:"Delete project",method:h.DELETE,url:`/projects/${e}/`,blockers:[e],blocks:[]}),this.dispatch(Ja(c.uuid))}catch(m){throw this.dispatch(Za(c)),this.dispatch(ah(Object.values(l))),this.dispatch(Fh(n)),this.dispatch(hh(r)),m}}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Fetch projects",method:h.GET,url:"/projects/",queryParams:{organization_owner:e},blockers:[],blocks:[]},i);return this.dispatch(jh(a)),a}}class gP extends v{add(e){var n;const{store:i}=this.client,a=T({...e,created_by:(n=i.getState().userReducer.currentUser)==null?void 0:n.id});this.dispatch(Bh(a));const c=this.enqueueRequest({description:"Create team membership",method:h.POST,url:"/team-memberships/",payload:w(a),blockers:[e.team],blocks:[a.uuid]});return c.then(r=>{this.dispatch(ec(r))}).catch(()=>{this.dispatch(tc(a.uuid))}),[a,c]}async delete(e){const{store:i}=this.client,a=i.getState(),c=Lh(e)(a);if(!c)throw new Error(`Expected team membership with uuid ${e} to exist`);this.dispatch(tc(e));try{return await this.enqueueRequest({description:"Delete team membership",method:h.DELETE,url:`/team-memberships/${e}/`,blockers:[e],blocks:[e]})}catch(n){throw this.dispatch(ec(c)),n}}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Fetch team memberships",method:h.GET,url:"/team-memberships/",queryParams:{team__organization:e},blockers:[],blocks:[]},i);return this.dispatch(kh(a)),a}}class bP extends v{add(e){var n;const{store:i}=this.client,a=T({...e,submitted_at:new Date().toISOString(),created_by:(n=i.getState().userReducer.currentUser)==null?void 0:n.id});this.dispatch(Wh(a));const c=this.enqueueRequest({description:"Create team",method:h.POST,url:"/teams/",payload:w(a),blockers:[],blocks:[a.uuid]});return c.then(r=>{this.dispatch(ut(r))}).catch(()=>{this.dispatch(ac(a.uuid))}),[a,c]}update(e){const{store:i}=this.client,a=nc(e.uuid)(i.getState());if(!a)throw new Error(`Expected team with uuid ${e.uuid} to exist`);const c={...a,...e};this.dispatch(Yh(c));const n=this.enqueueRequest({description:"Update team",method:h.PATCH,url:`/teams/${e.uuid}/`,payload:w(e),blockers:[e.uuid],blocks:[e.uuid]});return n.then(r=>{this.dispatch(ut(r))}).catch(()=>{this.dispatch(ut(a))}),[c,n]}async delete(e){const{store:i}=this.client,a=i.getState(),c=nc(e)(a);if(!c)throw new Error(`Expected team with uuid ${e} to exist`);this.dispatch(ac(e));try{return await this.enqueueRequest({description:"Delete team",method:h.DELETE,url:`/teams/${e}/`,blockers:[e],blocks:[e]})}catch(n){throw this.dispatch(ut(c)),n}}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Fetch teams",method:h.GET,url:"/teams/",queryParams:{organization:e},blockers:[],blocks:[]},i);return this.dispatch(Hh(a)),a}}class PP extends v{async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Fetch organization users",method:h.GET,url:`/organizations/${e}/users/`,blockers:[],blocks:[]},i);return this.dispatch(jl(a)),a}}class FP{constructor(e){S(this,"store");this.store=e}async enqueueRequest(e,i,a,c){return this._enqueueRequest(e,i,a,c).then(n=>{if(n instanceof D)throw n;return n})}_enqueueRequest(e,i,a,c){const n=new bc,r={...e,BASE_URL:i,serviceName:a};if(e.immediate){const l={...r,uuid:e.uuid??Ne.v4()},m={payload:l,type:"",meta:{offline:{effect:{timestamp:new Date().toISOString(),request:l,BASE_URL:i,serviceName:a}}}};uc(m,this,c).then(u=>{n.resolve(u.body)}).catch(u=>{oc(u,m),u instanceof Error?n.reject(u):n.reject(new Error((u??Ye).toString()))})}else{const l=this.store.dispatch(Ql(r)),m=o=>{if(o)n.resolve(o.body);else{const p=new D({message:"Could not get a response from the server.",response:o,discard:!0});n.reject(p)}},u=o=>{o instanceof D?o.options.discard=!0:(console.error("Received an unexpected error while processing a request:",o,`
15
- Converting error to APIError and discarding.`),o=new D({message:"An error occurred while processing the request.",innerError:o,discard:!0})),n.reject(o)};l.then(m,u)}return n}}class Ke{constructor(){S(this,"graph");S(this,"requestAttemptCounter");this.graph=new Pm.DepGraph,this.requestAttemptCounter={}}static _fromOutbox(e){const i=new Ke;for(let a=0;a<e.length;a++){const c=e[a];if(!c){console.error("Outbox item was undefined");continue}i.sneakRequest(c);for(let n=0;n<a;n++){const r=e[n];if(!r){console.error("Previous outbox item was undefined");continue}r.payload.uuid!==c.payload.uuid&&r.payload.blocks.some(l=>c.payload.blockers.includes(l))&&Ke._addDependency(c.payload.uuid,r.payload.uuid,i.graph)}}return i}_addDependency(e,i){Ke._addDependency(e,i,this.graph)}static _addDependency(e,i,a){if(e===i)throw new Error(`Tried to add dependency from node to itself: ${e}`);if(!a.hasNode(e))throw new Error(`Tried to add dependency from non-existent node: ${e} (to node: ${i})`);if(!a.hasNode(i))throw new Error(`Tried to add dependency to non-existent node: ${i} (from node: ${e})`);a.addDependency(e,i)}addRequest(e){if(this.graph.addNode(e.payload.uuid,e),!(e.payload.blockers.length===0||this.graph.size()===1))for(const i of this.graph.overallOrder()){if(i===e.payload.uuid)continue;const a=this.graph.getNodeData(i);e.payload.blockers.some(c=>a.payload.blocks.includes(c))&&this._addDependency(e.payload.uuid,i)}}insertRequest(e){this.graph.addNode(e.payload.uuid,e);for(const i of this.graph.overallOrder()){if(i===e.payload.uuid)continue;this.graph.getNodeData(i).payload.blockers.some(c=>e.payload.blocks.includes(c))&&this._addDependency(i,e.payload.uuid)}}sneakRequest(e){this.graph.addNode(e.payload.uuid,e)}_getNextNode(){const e=this.graph.overallOrder(!0);let i=1/0,a;for(const c of e){const n=this.requestAttemptCounter[c]||0;n<i&&(i=n,a=c)}return a}peek(){const e=this._getNextNode();if(e)return this.graph.getNodeData(e)}remove(e){this.graph.removeNode(e),delete this.requestAttemptCounter[e]}pop(){const e=this.peek();return e&&this.graph.removeNode(e.payload.uuid),e}getQueue(){const e=this.graph.overallOrder().map(a=>this.graph.getNodeData(a)),i=this._getNextNode();if(i){const a=this.graph.getNodeData(i),c=e.findIndex(n=>n.payload.uuid===a.payload.uuid);c!==-1&&(e.splice(c,1),e.unshift(a))}return e}getReady(){let e=this.graph.overallOrder(!0).map(i=>this.graph.getNodeData(i));return e=e.sort((i,a)=>i.meta.offline.effect.timestamp.localeCompare(a.meta.offline.effect.timestamp)),e=e.sort((i,a)=>{const c=this.requestAttemptCounter[i.payload.uuid]||0,n=this.requestAttemptCounter[a.payload.uuid]||0;return c-n}),e}registerRetry(e){this.requestAttemptCounter[e]=(this.requestAttemptCounter[e]||0)+1}}const TP=(t,e)=>{const i=new e(t);return Yg(i),Wg(t),i};var hm=(t=>(t[t.USER_REGISTRATION=0]="USER_REGISTRATION",t[t.APPLICATION_INVITE=2]="APPLICATION_INVITE",t[t.PROJECT_INVITE=4]="PROJECT_INVITE",t[t.ORGANIZATION_INVITE=6]="ORGANIZATION_INVITE",t[t.ADD_EMAIL_DOMAIN=8]="ADD_EMAIL_DOMAIN",t[t.RESET_PASSWORD=10]="RESET_PASSWORD",t))(hm||{});s.APIError=D,s.AgentService=pb,s.AssetAttachmentService=yb,s.AssetProcedureAttachmentService=Sb,s.AssetProcedureFieldValuesAttachmentService=Pb,s.AssetProcedureFieldValuesService=Fb,s.AssetProcedureFieldsAttachmentService=gb,s.AssetProcedureFieldsService=bb,s.AssetProcedureInstanceService=Tb,s.AssetProcedureService=Ib,s.AssetProcedureStepFieldValuesAttachmentService=Rb,s.AssetProcedureStepFieldValuesService=vb,s.AssetProcedureStepFieldsAttachmentService=Ob,s.AssetProcedureStepFieldsService=_b,s.AssetProcedureStepService=wb,s.AssetService=Mb,s.AssetStageCompletionService=Eb,s.AssetStageService=jb,s.AssetTypeAttachmentService=qb,s.AssetTypeFieldValuesAttachmentService=Ub,s.AssetTypeFieldValuesService=Db,s.AssetTypeFieldsAttachmentService=Vb,s.AssetTypeFieldsService=zb,s.AssetTypeService=Cb,s.AttachmentModel=Sc,s.BaseApiService=v,s.BaseSDK=FP,s.COMMON_AUTO_FIELDS=Oc,s.CategoryService=kb,s.DEFAULT_ISSUE_PRIORITY=Tm,s.DEFAULT_ISSUE_STATUS=Fm,s.DEFAULT_PAGINATION_PAGE_SIZE=E,s.DeferredPromise=bc,s.DocumentAttachmentService=Bb,s.DocumentService=Gb,s.EMPTY_ARRAY=Ac,s.EMPTY_OBJECT=fc,s.EmailDomainsService=$b,s.EmailVerificationService=Lb,s.FileService=Hb,s.FormRevisionAttachmentService=Wb,s.FormRevisionService=Yb,s.FormService=Kb,s.FormSubmissionAttachmentService=Zb,s.FormSubmissionService=Jb,s.GeoImageService=Xb,s.HttpMethod=h,s.IssueAssociationService=Qb,s.IssueAttachmentService=xb,s.IssueCommentAttachmentService=eP,s.IssueCommentService=tP,s.IssuePriority=$t,s.IssueService=sP,s.IssueStatus=Lt,s.IssueTypeAttachmentService=iP,s.IssueTypeFieldValuesAttachmentService=nP,s.IssueTypeFieldValuesService=rP,s.IssueTypeFieldsAttachmentService=aP,s.IssueTypeFieldsService=cP,s.IssueTypeService=dP,s.IssueUpdateChange=j,s.IssueUpdateService=uP,s.JWTService=hP,s.OUTBOX_RETRY_DELAY=gc,s.OrganizationAccessLevel=yc,s.OrganizationAccessService=mP,s.OrganizationService=pP,s.OutboxCoordinator=Ke,s.PAGINATION_MAX_PAGE_SIZE=Ab,s.PAGINATION_PAGE_SIZE_QUERY_PARAM=fb,s.ProjectAccessService=AP,s.ProjectAttachmentService=fP,s.ProjectFileService=yP,s.ProjectService=SP,s.RESET_ORGANIZATION_STATE=O,s.RESET_PROJECT_STATE=M,s.RESET_STATE=F,s.SelectorBuilder=Hg,s.TeamMembershipService=gP,s.TeamService=bP,s.UNKNOWN_ERROR_MESSAGE=Ye,s.UserService=PP,s.VERSION_REDUCER_KEY=Ze,s.VerificationCodeType=hm,s._setLatestRetryTime=eh,s.addAsset=ks,s.addAssetAttachment=ep,s.addAssetAttachments=Qt,s.addAssetProcedure=Ss,s.addAssetProcedureAttachment=ip,s.addAssetProcedureAttachments=Hc,s.addAssetProcedureFieldValues=rs,s.addAssetProcedureFieldValuesAttachment=Fp,s.addAssetProcedureFieldValuesAttachments=mt,s.addAssetProcedureFieldValuesMany=On,s.addAssetProcedureFields=ln,s.addAssetProcedureFieldsAttachment=rp,s.addAssetProcedureFieldsAttachments=sn,s.addAssetProcedureFieldsMany=pp,s.addAssetProcedureInstance=hs,s.addAssetProcedureInstances=jn,s.addAssetProcedureStep=zs,s.addAssetProcedureStepFieldValues=Es,s.addAssetProcedureStepFieldValuesAttachment=nA,s.addAssetProcedureStepFieldValuesAttachments=At,s.addAssetProcedureStepFieldValuesMany=nr,s.addAssetProcedureStepFields=Is,s.addAssetProcedureStepFieldsAttachment=Np,s.addAssetProcedureStepFieldsAttachments=$n,s.addAssetProcedureStepFieldsMany=Xp,s.addAssetProcedureSteps=SA,s.addAssetProcedures=Dp,s.addAssetStage=Qs,s.addAssetStageCompletion=Ws,s.addAssetStageCompletions=Ys,s.addAssetStages=jA,s.addAssetType=pi,s.addAssetTypeAttachment=CA,s.addAssetTypeAttachments=si,s.addAssetTypeFieldValues=ui,s.addAssetTypeFieldValuesAttachment=sf,s.addAssetTypeFieldValuesAttachments=It,s.addAssetTypeFieldValuesMany=md,s.addAssetTypeFields=xr,s.addAssetTypeFieldsAttachment=GA,s.addAssetTypeFieldsAttachments=Hr,s.addAssetTypeFieldsMany=KA,s.addAssetTypes=Af,s.addAssets=bt,s.addCategories=If,s.addCategory=gi,s.addConversation=Mc,s.addConversations=Ym,s.addDocumentAttachment=Ef,s.addDocumentAttachments=qd,s.addDocuments=Nd,s.addEmailDomain=Zd,s.addEmailDomains=Cf,s.addForm=zi,s.addFormRevision=Mi,s.addFormRevisionAttachment=Wf,s.addFormRevisionAttachments=ru,s.addFormRevisions=pu,s.addFormSubmission=Bi,s.addFormSubmissionAttachment=oy,s.addFormSubmissionAttachments=vt,s.addFormSubmissions=Et,s.addForms=iy,s.addGeoImage=$u,s.addGeoImages=Lu,s.addIssue=la,s.addIssueAssociation=Zi,s.addIssueAssociations=Ji,s.addIssueAttachment=Ty,s.addIssueAttachments=ta,s.addIssueComment=na,s.addIssueCommentAttachment=_y,s.addIssueCommentAttachments=po,s.addIssueComments=Ey,s.addIssueType=yl,s.addIssueTypeAttachment=Gy,s.addIssueTypeAttachments=Vo,s.addIssueTypeFieldValues=ba,s.addIssueTypeFieldValuesAttachment=mS,s.addIssueTypeFieldValuesAttachments=zt,s.addIssueTypeFieldValuesMany=Qy,s.addIssueTypeFields=il,s.addIssueTypeFieldsAttachment=Hy,s.addIssueTypeFieldsAttachments=Ho,s.addIssueTypeFieldsMany=aS,s.addIssueTypes=gS,s.addIssueUpdate=Tl,s.addIssueUpdates=Il,s.addIssues=wo,s.addOrganization=Wl,s.addOrganizationAccess=Bl,s.addOrganizationAccesses=kS,s.addOrganizations=KS,s.addProject=Za,s.addProjectAccess=Ba,s.addProjectAccesses=ah,s.addProjectAttachment=dg,s.addProjectAttachments=oh,s.addProjectFile=hg,s.addProjectFiles=Fh,s.addProjects=bg,s.addTeam=Wh,s.addTeamMembership=Bh,s.addTeamMemberships=vg,s.addTeams=zg,s.addUser=ql,s.addUsers=jS,s.agentsReducer=qc,s.agentsSlice=Kt,s.areArraysEqual=wm,s.assetAttachmentReducer=$c,s.assetAttachmentSlice=Jt,s.assetProcedureAttachmentReducer=Jc,s.assetProcedureAttachmentSlice=es,s.assetProcedureFieldValuesAttachmentReducer=Fn,s.assetProcedureFieldValuesAttachmentSlice=as,s.assetProcedureFieldValuesReducer=vn,s.assetProcedureFieldValuesSlice=ns,s.assetProcedureFieldsAttachmentReducer=dn,s.assetProcedureFieldsAttachmentSlice=ts,s.assetProcedureFieldsReducer=An,s.assetProcedureFieldsSlice=ss,s.assetProcedureInstanceReducer=Vn,s.assetProcedureInstanceSlice=ls,s.assetProcedureReducer=Cn,s.assetProcedureSlice=ys,s.assetProcedureStepFieldValuesAttachmentReducer=ir,s.assetProcedureStepFieldValuesAttachmentSlice=vs,s.assetProcedureStepFieldValuesReducer=or,s.assetProcedureStepFieldValuesSlice=Ms,s.assetProcedureStepFieldsAttachmentReducer=Yn,s.assetProcedureStepFieldsAttachmentSlice=Fs,s.assetProcedureStepFieldsReducer=Jn,s.assetProcedureStepFieldsSlice=Ts,s.assetProcedureStepReducer=pr,s.assetProcedureStepSlice=Vs,s.assetReducer=br,s.assetSlice=Cs,s.assetStageCompletionReducer=Or,s.assetStageCompletionSlice=Hs,s.assetStageReducer=Er,s.assetStageSlice=Xs,s.assetTypeAttachmentReducer=$r,s.assetTypeAttachmentSlice=ti,s.assetTypeFieldValuesAttachmentReducer=od,s.assetTypeFieldValuesAttachmentSlice=ni,s.assetTypeFieldValuesReducer=yd,s.assetTypeFieldValuesSlice=di,s.assetTypeFieldsAttachmentReducer=Jr,s.assetTypeFieldsAttachmentSlice=ai,s.assetTypeFieldsReducer=id,s.assetTypeFieldsSlice=ci,s.assetTypeReducer=Pd,s.assetTypeSlice=mi,s.authReducer=Id,s.authSlice=_t,s.baseReducer=$g,s.baseReducers=rc,s.blobToBase64=Cm,s.categoryReducer=Md,s.categorySlice=Si,s.clearTokens=Pf,s.constructUploadedFilePayloads=Dm,s.coordinatesAreEqual=Rm,s.createModelAdapter=I,s.createMultiPointGeometry=_m,s.createOfflineAction=Jl,s.createPayload=w,s.createPointGeometry=Om,s.createSelectionAdapter=Im,s.deleteAsset=Bs,s.deleteAssetAttachment=Dc,s.deleteAssetAttachments=xt,s.deleteAssetProcedure=gs,s.deleteAssetProcedureAttachment=Kc,s.deleteAssetProcedureAttachments=Zc,s.deleteAssetProcedureFieldValues=ds,s.deleteAssetProcedureFieldValuesAttachment=_p,s.deleteAssetProcedureFieldValuesAttachments=pt,s.deleteAssetProcedureFieldValuesMany=Rn,s.deleteAssetProcedureFields=mn,s.deleteAssetProcedureFieldsAttachment=lp,s.deleteAssetProcedureFieldsAttachments=cn,s.deleteAssetProcedureFieldsMany=Sp,s.deleteAssetProcedureInstance=ms,s.deleteAssetProcedureInstances=qn,s.deleteAssetProcedureStep=Us,s.deleteAssetProcedureStepFieldValues=js,s.deleteAssetProcedureStepFieldValuesAttachment=oA,s.deleteAssetProcedureStepFieldValuesAttachments=ft,s.deleteAssetProcedureStepFieldValuesMany=dr,s.deleteAssetProcedureStepFields=Os,s.deleteAssetProcedureStepFieldsAttachment=Kp,s.deleteAssetProcedureStepFieldsAttachments=Nn,s.deleteAssetProcedureStepFieldsMany=tA,s.deleteAssetProcedureSteps=bA,s.deleteAssetProcedures=kp,s.deleteAssetStage=xs,s.deleteAssetStageCompletion=Ks,s.deleteAssetStageCompletions=Zs,s.deleteAssetStages=VA,s.deleteAssetType=Ai,s.deleteAssetTypeAttachment=Dr,s.deleteAssetTypeAttachments=ii,s.deleteAssetTypeFieldValues=oi,s.deleteAssetTypeFieldValuesAttachment=rf,s.deleteAssetTypeFieldValuesAttachments=Ot,s.deleteAssetTypeFieldValuesMany=Ad,s.deleteAssetTypeFields=td,s.deleteAssetTypeFieldsAttachment=HA,s.deleteAssetTypeFieldsAttachments=Yr,s.deleteAssetTypeFieldsMany=QA,s.deleteAssetTypes=yf,s.deleteAssets=Gs,s.deleteCategories=vf,s.deleteCategory=vd,s.deleteConversation=Jm,s.deleteConversations=Xm,s.deleteDocumentAttachment=Ud,s.deleteDocumentAttachments=Dd,s.deleteEmailDomain=Jd,s.deleteEmailDomains=Lf,s.deleteForm=Ui,s.deleteFormRevision=Ei,s.deleteFormRevisionAttachment=Jf,s.deleteFormRevisionAttachments=uu,s.deleteFormRevisions=fu,s.deleteFormSubmission=Gi,s.deleteFormSubmissionAttachment=py,s.deleteFormSubmissionAttachments=wt,s.deleteFormSubmissions=jt,s.deleteForms=dy,s.deleteGeoImage=Wi,s.deleteGeoImages=Hu,s.deleteIssue=ha,s.deleteIssueAssociation=Xi,s.deleteIssueAssociations=Qi,s.deleteIssueAttachment=no,s.deleteIssueAttachments=sa,s.deleteIssueComment=da,s.deleteIssueCommentAttachment=yo,s.deleteIssueCommentAttachments=So,s.deleteIssueComments=Vy,s.deleteIssueType=FS,s.deleteIssueTypeAttachment=Do,s.deleteIssueTypeAttachments=Co,s.deleteIssueTypeFieldValues=Pa,s.deleteIssueTypeFieldValuesAttachment=yS,s.deleteIssueTypeFieldValuesAttachments=Ut,s.deleteIssueTypeFieldValuesMany=sS,s.deleteIssueTypeFields=cl,s.deleteIssueTypeFieldsAttachment=Zy,s.deleteIssueTypeFieldsAttachments=Yo,s.deleteIssueTypeFieldsMany=dS,s.deleteIssueTypes=TS,s.deleteIssueUpdate=Ol,s.deleteIssueUpdates=_l,s.deleteIssues=Mo,s.deleteOrganization=JS,s.deleteOrganizationAccess=Gl,s.deleteOrganizationAccesses=LS,s.deleteOrganizations=XS,s.deleteProject=Ja,s.deleteProjectAccess=Ga,s.deleteProjectAccesses=ch,s.deleteProjectAttachment=ph,s.deleteProjectAttachments=Ha,s.deleteProjectFile=Th,s.deleteProjectFiles=Ih,s.deleteProjects=Fg,s.deleteTeam=ac,s.deleteTeamMembership=tc,s.deleteTeamMemberships=jg,s.deleteTeams=Cg,s.deleteUser=Vl,s.deleteUsers=zS,s.dequeue=dm,s.discard=oc,s.documentAttachmentReducer=Gd,s.documentAttachmentSlice=Fi,s.documentSlice=Ti,s.documentsReducer=Wd,s.downloadFile=km,s.downloadInMemoryFile=Um,s.emailDomainsReducer=xd,s.emailDomainsSlice=_i,s.emailRegex=Wm,s.enqueue=rm,s.enqueueRequest=Ql,s.fallbackToEmptyArray=g,s.fallbackToEmptyObject=ht,s.fileReducer=au,s.fileSlice=Ri,s.fileToBlob=Tc,s.formReducer=Pu,s.formRevisionAttachmentReducer=lu,s.formRevisionAttachmentSlice=vi,s.formRevisionReducer=Su,s.formRevisionsSlice=wi,s.formSlice=Vi,s.formSubmissionAttachmentReducer=Eu,s.formSubmissionAttachmentSlice=Di,s.formSubmissionReducer=Cu,s.formSubmissionSlice=ki,s.geoImageReducer=Ku,s.geoImageSlice=Hi,s.getFileIdentifier=zm,s.getFileS3Key=Yt,s.getLocalDateString=Pc,s.getLocalRelativeDateString=qm,s.getOutboxCoordinator=Ge,s.getRenamedFile=Fc,s.hashFile=He,s.initSDK=TP,s.initializeAssetAttachments=Xt,s.initializeAssetProcedureAttachments=Nc,s.initializeAssetProcedureFieldValues=In,s.initializeAssetProcedureFieldValuesAttachments=yn,s.initializeAssetProcedureFields=on,s.initializeAssetProcedureFieldsAttachments=tn,s.initializeAssetProcedureInstances=En,s.initializeAssetProcedureStepFieldValues=cr,s.initializeAssetProcedureStepFieldValuesAttachments=Qn,s.initializeAssetProcedureStepFields=Zn,s.initializeAssetProcedureStepFieldsAttachments=Gn,s.initializeAssetProcedureSteps=hr,s.initializeAssetProcedures=Dn,s.initializeAssetStageCompletions=Fr,s.initializeAssetStages=wr,s.initializeAssetTypeAttachments=Vr,s.initializeAssetTypeFieldValues=hd,s.initializeAssetTypeFieldValuesAttachments=cd,s.initializeAssetTypeFields=Qr,s.initializeAssetTypeFieldsAttachments=Nr,s.initializeAssetTypes=gd,s.initializeAssets=yr,s.initializeCategories=_d,s.initializeConversations=wc,s.initializeDocumentAttachments=jd,s.initializeEmailDomains=Kd,s.initializeFormRevisionAttachments=nu,s.initializeFormRevisions=mu,s.initializeFormSubmissionAttachments=_u,s.initializeFormSubmissions=qu,s.initializeForms=bu,s.initializeGeoImages=Bu,s.initializeIssueAssociations=Ju,s.initializeIssueAttachments=ea,s.initializeIssueCommentAttachments=aa,s.initializeIssueComments=My,s.initializeIssueTypeAttachments=ya,s.initializeIssueTypeFieldValues=Qo,s.initializeIssueTypeFieldValuesAttachments=ul,s.initializeIssueTypeFields=sl,s.initializeIssueTypeFieldsAttachments=No,s.initializeIssueTypes=fl,s.initializeIssueUpdates=Fl,s.initializeIssues=vo,s.initializeOrganizationAccesses=kl,s.initializeOrganizations=Hl,s.initializeProjectAccesses=ih,s.initializeProjectAttachments=uh,s.initializeProjectFiles=Ph,s.initializeProjects=jh,s.initializeTeamMemberships=kh,s.initializeTeams=Hh,s.initializeUsers=jl,s.isToday=jm,s.issueAssociationReducer=so,s.issueAssociationSlice=Ki,s.issueAttachmentReducer=ho,s.issueAttachmentSlice=xi,s.issueCommentAttachmentReducer=Fo,s.issueCommentAttachmentSlice=ia,s.issueCommentReducer=_o,s.issueCommentSlice=ca,s.issueReducer=jo,s.issueSlice=oa,s.issueTypeAttachmentReducer=$o,s.issueTypeAttachmentSlice=fa,s.issueTypeFieldValuesAttachmentReducer=pl,s.issueTypeFieldValuesAttachmentSlice=Oa,s.issueTypeFieldValuesReducer=el,s.issueTypeFieldValuesSlice=ga,s.issueTypeFieldsAttachmentReducer=Jo,s.issueTypeFieldsAttachmentSlice=Sa,s.issueTypeFieldsReducer=rl,s.issueTypeFieldsSlice=Ia,s.issueTypeReducer=bl,s.issueTypeSlice=Ra,s.issueUpdateReducer=Ml,s.issueUpdateSlice=Ea,s.logOnlyOnce=Bm,s.markAsDeleted=xl,s.markForDeletion=sg,s.memoize=Ht,s.offline=T,s.onlyUniqueHashes=Hm,s.onlyUniqueOfflineIds=Rc,s.organizationAccessReducer=$l,s.organizationAccessSlice=Va,s.organizationReducer=Zl,s.organizationSlice=Da,s.outboxReducer=th,s.outboxSlice=Ca,s.overmapEnhancer=sb,s.overmapReducer=Lg,s.overmapReducers=Qh,s.performRequest=uc,s.projectAccessReducer=nh,s.projectAccessSlice=ka,s.projectAttachmentReducer=gh,s.projectAttachmentSlice=Na,s.projectFileReducer=Mh,s.projectFileSlice=Wa,s.projectReducer=Vh,s.projectSlice=Ka,s.rehydratedReducer=Dh,s.rehydratedSlice=Qa,s.removeDocuments=Ii,s.removeIssueType=va,s.resetProjectFileObjectUrls=pg,s.restructureCreateSelectorWithArgs=y,s.saveActiveProjectFileBounds=Rh,s.selectAccessToken=Ff,s.selectAccessesByUserOfProject=ng,s.selectAccessibleProjects=Tg,s.selectActiveOrganizationAccess=NS,s.selectActiveProjectFileId=fg,s.selectAllDocumentAttachments=kd,s.selectAllProjectAttachments=fh,s.selectAssetAttachmentById=Bc,s.selectAssetAttachmentMapping=Cc,s.selectAssetAttachments=kc,s.selectAssetById=Ns,s.selectAssetProcedureAttachmentById=xc,s.selectAssetProcedureAttachmentMapping=Xc,s.selectAssetProcedureAttachments=Qc,s.selectAssetProcedureById=Ps,s.selectAssetProcedureFieldValues=us,s.selectAssetProcedureFieldValuesAttachmentById=Rp,s.selectAssetProcedureFieldValuesAttachments=gn,s.selectAssetProcedureFieldValuesAttachmentsByIds=bn,s.selectAssetProcedureFieldValuesAttachmentsMapping=cs,s.selectAssetProcedureFieldValuesById=os,s.selectAssetProcedureFieldValuesMapping=wn,s.selectAssetProcedureFieldValuesOfAsset=Mp,s.selectAssetProcedureFields=is,s.selectAssetProcedureFieldsAttachmentById=mp,s.selectAssetProcedureFieldsAttachments=rn,s.selectAssetProcedureFieldsAttachmentsMapping=nn,s.selectAssetProcedureFieldsById=Pp,s.selectAssetProcedureFieldsMapping=pn,s.selectAssetProcedureFieldsOfAssetProcedure=gp,s.selectAssetProcedureInstanceById=fs,s.selectAssetProcedureInstances=As,s.selectAssetProcedureInstancesByIds=Up,s.selectAssetProcedureInstancesMapping=ps,s.selectAssetProcedureInstancesOfAssetProcedure=zn,s.selectAssetProcedureInstancesOfAssetType=zp,s.selectAssetProcedureStepById=Ds,s.selectAssetProcedureStepFieldValues=yt,s.selectAssetProcedureStepFieldValuesAttachmentById=lA,s.selectAssetProcedureStepFieldValuesAttachments=er,s.selectAssetProcedureStepFieldValuesAttachmentsByIds=tr,s.selectAssetProcedureStepFieldValuesAttachmentsMapping=ws,s.selectAssetProcedureStepFieldValuesById=qs,s.selectAssetProcedureStepFieldValuesMapping=ur,s.selectAssetProcedureStepFieldValuesOfAsset=pA,s.selectAssetProcedureStepFieldValuesOfAssetProcedureInstance=AA,s.selectAssetProcedureStepFieldValuesOfAssetProcedureStep=fA,s.selectAssetProcedureStepFields=Rs,s.selectAssetProcedureStepFieldsAttachmentById=Jp,s.selectAssetProcedureStepFieldsAttachments=Wn,s.selectAssetProcedureStepFieldsAttachmentsMapping=Hn,s.selectAssetProcedureStepFieldsById=cA,s.selectAssetProcedureStepFieldsMapping=_s,s.selectAssetProcedureStepFieldsOfAssetProcedureStep=sA,s.selectAssetProcedureStepMapping=gt,s.selectAssetProcedureSteps=Ar,s.selectAssetProcedureStepsByIds=TA,s.selectAssetProcedureStepsMappingOfAssetProcedure=PA,s.selectAssetProcedureStepsOfAssetProcedure=FA,s.selectAssetProcedures=kn,s.selectAssetProceduresByIds=$p,s.selectAssetProceduresMapping=bs,s.selectAssetProceduresOfOrganization=Lp,s.selectAssetStageById=ei,s.selectAssetStageCompletionById=_r,s.selectAssetStageCompletionMapping=Js,s.selectAssetStageCompletions=MA,s.selectAssetStageCompletionsByIds=Rr,s.selectAssetStages=jr,s.selectAssetStagesByIds=DA,s.selectAssetStagesMappingOfAssetProcedure=zA,s.selectAssetStagesOfAssetProcedure=UA,s.selectAssetTypeAttachmentById=Br,s.selectAssetTypeAttachmentMapping=Cr,s.selectAssetTypeAttachments=kr,s.selectAssetTypeById=yi,s.selectAssetTypeFieldValues=li,s.selectAssetTypeFieldValuesAttachmentById=df,s.selectAssetTypeFieldValuesAttachments=rd,s.selectAssetTypeFieldValuesAttachmentsByIds=dd,s.selectAssetTypeFieldValuesAttachmentsMapping=ri,s.selectAssetTypeFieldValuesById=hi,s.selectAssetTypeFieldValuesMapping=fd,s.selectAssetTypeFieldValuesOfAsset=lf,s.selectAssetTypeFields=Tt,s.selectAssetTypeFieldsAttachmentById=YA,s.selectAssetTypeFieldsAttachments=Zr,s.selectAssetTypeFieldsAttachmentsMapping=Kr,s.selectAssetTypeFieldsById=tf,s.selectAssetTypeFieldsMapping=sd,s.selectAssetTypeFieldsOfAssetType=xA,s.selectAssetTypeValuesOfAssetType=hf,s.selectAssetTypes=bd,s.selectAssetTypesByIds=Sf,s.selectAssetTypesMapping=fi,s.selectAssetTypesOfOrganization=gf,s.selectAssets=Sr,s.selectAssetsByIds=gr,s.selectAssetsMapping=$s,s.selectAssetsOfAssetType=Ls,s.selectAttachmentsOfAsset=Gc,s.selectAttachmentsOfAssetProcedure=np,s.selectAttachmentsOfAssetProcedureFieldValues=Pn,s.selectAttachmentsOfAssetProcedureFields=hp,s.selectAttachmentsOfAssetProcedureStepFieldValues=sr,s.selectAttachmentsOfAssetProcedureStepFields=Zp,s.selectAttachmentsOfAssetType=Gr,s.selectAttachmentsOfAssetTypeFieldValues=ud,s.selectAttachmentsOfAssetTypeFields=WA,s.selectAttachmentsOfDocument=Vf,s.selectAttachmentsOfFormRevision=Xf,s.selectAttachmentsOfFormSubmission=Mu,s.selectAttachmentsOfIssue=oo,s.selectAttachmentsOfIssueComment=wy,s.selectAttachmentsOfIssueType=Ny,s.selectAttachmentsOfIssueTypeFieldValues=ml,s.selectAttachmentsOfIssueTypeFields=Jy,s.selectAttachmentsOfProject=Sh,s.selectCategories=wd,s.selectCategoriesByIds=wf,s.selectCategoriesOfProject=Mf,s.selectCategoryById=Pi,s.selectCategoryMapping=bi,s.selectCommentsOfIssue=zy,s.selectConversation=xm,s.selectConversationMapping=Zt,s.selectConversations=Qm,s.selectCurrentUser=Ul,s.selectDeletedRequests=eg,s.selectDocumentAttachmentById=Bd,s.selectDocumentAttachmentMapping=Cd,s.selectDocumentById=Hd,s.selectDocuments=Oi,s.selectDocumentsByIds=zf,s.selectDocumentsMapping=Rt,s.selectEmailDomains=Qd,s.selectEmailDomainsAsMapping=Xd,s.selectEmailDomainsOfOrganization=Nf,s.selectFieldValuesOfAssetProcedureInstance=Ep,s.selectFormById=Iu,s.selectFormMapping=Fu,s.selectFormRevisionAttachmentsMapping=ou,s.selectFormRevisionById=ty,s.selectFormRevisionMapping=ji,s.selectFormRevisions=qi,s.selectFormRevisionsOfForm=yu,s.selectFormSubmissionAttachemntsByIds=wu,s.selectFormSubmissionAttachments=Ci,s.selectFormSubmissionAttachmentsMapping=vu,s.selectFormSubmissionById=Ni,s.selectFormSubmissions=Li,s.selectFormSubmissionsMapping=$i,s.selectFormSubmissionsOfAsset=Du,s.selectFormSubmissionsOfForm=zu,s.selectFormSubmissionsOfIssue=Uu,s.selectForms=Tu,s.selectFormsOfOrganization=uy,s.selectGeoImageById=Yi,s.selectGeoImageMapping=Wu,s.selectGeoImages=Yu,s.selectGeoImagesOfProject=Sy,s.selectIsImportingProjectFile=yg,s.selectIsLoggedIn=Tf,s.selectIssueAssociationById=Qu,s.selectIssueAssociationMapping=ct,s.selectIssueAssociations=Fy,s.selectIssueAssociationsOfAsset=to,s.selectIssueAssociationsOfIssue=eo,s.selectIssueAssociationsToIssue=xu,s.selectIssueAttachmentById=lo,s.selectIssueAttachmentMapping=ro,s.selectIssueAttachments=uo,s.selectIssueById=Aa,s.selectIssueCommentAttachmentById=Po,s.selectIssueCommentAttachmentMapping=go,s.selectIssueCommentAttachments=bo,s.selectIssueCommentById=ua,s.selectIssueCommentMapping=Oo,s.selectIssueMapping=ma,s.selectIssueTypeAttachmentById=Go,s.selectIssueTypeAttachmentMapping=ko,s.selectIssueTypeAttachments=Bo,s.selectIssueTypeById=Ma,s.selectIssueTypeFieldValues=Fa,s.selectIssueTypeFieldValuesAttachmentById=SS,s.selectIssueTypeFieldValuesAttachments=_a,s.selectIssueTypeFieldValuesAttachmentsByIds=hl,s.selectIssueTypeFieldValuesAttachmentsMapping=ll,s.selectIssueTypeFieldValuesById=Ta,s.selectIssueTypeFieldValuesMapping=xo,s.selectIssueTypeFieldValuesOfIssue=iS,s.selectIssueTypeFields=Vt,s.selectIssueTypeFieldsAttachmentById=Xy,s.selectIssueTypeFieldsAttachments=Zo,s.selectIssueTypeFieldsAttachmentsMapping=Ko,s.selectIssueTypeFieldsById=hS,s.selectIssueTypeFieldsMapping=nl,s.selectIssueTypeFieldsOfIssueType=uS,s.selectIssueTypeMapping=wa,s.selectIssueTypeValuesOfIssueType=lS,s.selectIssueTypes=gl,s.selectIssueTypesByIds=IS,s.selectIssueTypesOfOrganization=OS,s.selectIssueUpdateMapping=Rl,s.selectIssueUpdates=vl,s.selectIssueUpdatesOfIssue=wl,s.selectIssues=pa,s.selectIssuesByIds=ky,s.selectIssuesOfIssueType=Eo,s.selectIssuesOfProject=By,s.selectLatestAssetProcedureFieldsOfAssetProcedure=bp,s.selectLatestAssetProcedureStepFieldsOfAssetProcedureStep=iA,s.selectLatestAssetTypeFieldsOfAssetType=ef,s.selectLatestFieldsByAssetProcedureStep=aA,s.selectLatestFormRevisionOfForm=sy,s.selectLatestIssueTypeFieldsOfIssueType=oS,s.selectLatestRetryTime=tg,s.selectMembershipsByUserOfTeam=qg,s.selectNumberOfAssetsOfAssetType=RA,s.selectOrganizationAccessById=Ua,s.selectOrganizationAccessMapping=za,s.selectOrganizationAccessUserMapping=Ll,s.selectOrganizationById=xS,s.selectOrganizationDocuments=Df,s.selectOrganizations=QS,s.selectOrganizationsMapping=Kl,s.selectProjectAccessById=La,s.selectProjectAccessMapping=$a,s.selectProjectAccesses=kt,s.selectProjectAccessesOfProject=rh,s.selectProjectAttachmentById=yh,s.selectProjectAttachmentMapping=Ah,s.selectProjectById=Uh,s.selectProjectDocuments=Uf,s.selectProjectFileById=Ag,s.selectProjectFileMapping=vh,s.selectProjectFiles=wh,s.selectProjectMapping=zh,s.selectProjects=Xa,s.selectProjectsOfOrganization=Ig,s.selectRehydrated=Rg,s.selectStageMapping=Ft,s.selectTeamById=nc,s.selectTeamMembershipById=Lh,s.selectTeamMemberships=sc,s.selectTeamMembershipsMapping=$h,s.selectTeams=Kh,s.selectTeamsByIds=kg,s.selectTeamsMapping=cc,s.selectTeamsOfOrganization=Bg,s.selectUploadUrl=iu,s.selectUserById=Dl,s.selectUsers=qa,s.selectUsersByIds=CS,s.selectUsersMapping=Dt,s.selectUsersOfOrganization=HS,s.selectUsersOfProject=rg,s.selectUsersOfTeam=Vg,s.setActiveProjectFileId=_h,s.setAsset=OA,s.setAssetAttachment=zc,s.setAssetAttachments=tp,s.setAssetProcedure=Bp,s.setAssetProcedureAttachment=Wc,s.setAssetProcedureAttachments=ap,s.setAssetProcedureFieldValues=vp,s.setAssetProcedureFieldValuesAttachment=Tp,s.setAssetProcedureFieldValuesAttachments=Ip,s.setAssetProcedureFieldValuesMany=wp,s.setAssetProcedureFields=Ap,s.setAssetProcedureFieldsAttachment=dp,s.setAssetProcedureFieldsAttachments=up,s.setAssetProcedureFieldsMany=fp,s.setAssetProcedureInstance=qp,s.setAssetProcedureInstances=Vp,s.setAssetProcedureStep=mr,s.setAssetProcedureStepFieldValues=hA,s.setAssetProcedureStepFieldValuesAttachment=rA,s.setAssetProcedureStepFieldValuesAttachments=dA,s.setAssetProcedureStepFieldValuesMany=mA,s.setAssetProcedureStepFields=Qp,s.setAssetProcedureStepFieldsAttachment=Hp,s.setAssetProcedureStepFieldsAttachments=Wp,s.setAssetProcedureStepFieldsMany=xp,s.setAssetProcedureSteps=yA,s.setAssetProcedures=Gp,s.setAssetStage=Mr,s.setAssetStageCompletion=vA,s.setAssetStageCompletions=wA,s.setAssetStages=EA,s.setAssetType=mf,s.setAssetTypeAttachment=zr,s.setAssetTypeAttachments=kA,s.setAssetTypeFieldValues=uf,s.setAssetTypeFieldValuesAttachment=af,s.setAssetTypeFieldValuesAttachments=cf,s.setAssetTypeFieldValuesMany=of,s.setAssetTypeFields=ZA,s.setAssetTypeFieldsAttachment=$A,s.setAssetTypeFieldsAttachments=LA,s.setAssetTypeFieldsMany=JA,s.setAssetTypes=pf,s.setAssets=_A,s.setCategories=_f,s.setCategory=Of,s.setConversation=Ec,s.setConversations=Km,s.setCurrentUser=US,s.setDocumentAttachment=Vd,s.setDocumentAttachments=jf,s.setDocuments=Ld,s.setEmailDomain=kf,s.setEmailDomains=Bf,s.setForm=ay,s.setFormRevision=Au,s.setFormRevisionAttachment=Yf,s.setFormRevisionAttachments=Kf,s.setFormRevisions=Qf,s.setFormSubmission=Mt,s.setFormSubmissionAttachment=ly,s.setFormSubmissionAttachments=hy,s.setFormSubmissions=Ay,s.setForms=cy,s.setGeoImage=at,s.setGeoImages=Gu,s.setIsImportingProjectFile=Oh,s.setIssue=Uy,s.setIssueAssociation=by,s.setIssueAssociations=gy,s.setIssueAttachment=ao,s.setIssueAttachments=Iy,s.setIssueComment=ra,s.setIssueCommentAttachment=Ao,s.setIssueCommentAttachments=Ry,s.setIssueComments=Io,s.setIssueType=rt,s.setIssueTypeAttachment=zo,s.setIssueTypeAttachments=$y,s.setIssueTypeFieldValues=xy,s.setIssueTypeFieldValuesAttachment=pS,s.setIssueTypeFieldValuesAttachments=AS,s.setIssueTypeFieldValuesMany=eS,s.setIssueTypeFields=cS,s.setIssueTypeFieldsAttachment=Wy,s.setIssueTypeFieldsAttachments=Yy,s.setIssueTypeFieldsMany=nS,s.setIssueTypes=bS,s.setIssueUpdate=_S,s.setIssueUpdates=RS,s.setIssues=Dy,s.setLoggedIn=Td,s.setOrganization=YS,s.setOrganizationAccess=BS,s.setOrganizationAccesses=GS,s.setOrganizations=WS,s.setProfilePicture=DS,s.setProject=gg,s.setProjectAccess=ig,s.setProjectAccesses=ag,s.setProjectAttachment=lh,s.setProjectAttachments=hh,s.setProjectFile=og,s.setProjectFiles=lg,s.setProjects=Sg,s.setRehydrated=_g,s.setTeam=ut,s.setTeamMembership=ec,s.setTeamMemberships=wg,s.setTeams=Ug,s.setTokens=bf,s.setUploadUrl=su,s.setUser=ES,s.setUsers=MS,s.shallowEqual=vm,s.slugify=Lm,s.spacesToDashesLower=$m,s.teamMembershipReducer=Gh,s.teamMembershipSlice=xa,s.teamReducer=Zh,s.teamSlice=ic,s.toFileNameSafeString=Gm,s.toOfflineIdRecord=_c,s.truncate=Nm,s.updateAsset=tt,s.updateAssetAttachment=sp,s.updateAssetAttachments=Uc,s.updateAssetProcedure=Qe,s.updateAssetProcedureAttachment=cp,s.updateAssetProcedureAttachments=Yc,s.updateAssetProcedureFieldValues=Je,s.updateAssetProcedureFieldValuesAttachment=Op,s.updateAssetProcedureFieldValuesAttachments=Sn,s.updateAssetProcedureFieldValuesMany=_n,s.updateAssetProcedureFields=hn,s.updateAssetProcedureFieldsAttachment=op,s.updateAssetProcedureFieldsAttachments=an,s.updateAssetProcedureFieldsMany=yp,s.updateAssetProcedureInstance=Xe,s.updateAssetProcedureInstances=jp,s.updateAssetProcedureStep=St,s.updateAssetProcedureStepFieldValues=et,s.updateAssetProcedureStepFieldValuesAttachment=uA,s.updateAssetProcedureStepFieldValuesAttachments=xn,s.updateAssetProcedureStepFieldValuesMany=rr,s.updateAssetProcedureStepFields=xe,s.updateAssetProcedureStepFieldsAttachment=Yp,s.updateAssetProcedureStepFieldsAttachments=Ln,s.updateAssetProcedureStepFieldsMany=eA,s.updateAssetProcedureSteps=gA,s.updateAssetProcedures=Cp,s.updateAssetStage=Pt,s.updateAssetStageCompletion=Tr,s.updateAssetStageCompletions=Ir,s.updateAssetStages=qA,s.updateAssetType=it,s.updateAssetTypeAttachment=BA,s.updateAssetTypeAttachments=Ur,s.updateAssetTypeFieldValues=st,s.updateAssetTypeFieldValuesAttachment=nf,s.updateAssetTypeFieldValuesAttachments=nd,s.updateAssetTypeFieldValuesMany=pd,s.updateAssetTypeFields=ed,s.updateAssetTypeFieldsAttachment=NA,s.updateAssetTypeFieldsAttachments=Wr,s.updateAssetTypeFieldsMany=XA,s.updateAssetTypes=ff,s.updateAssets=IA,s.updateCategories=Rf,s.updateCategory=Rd,s.updateConversation=jc,s.updateConversations=Zm,s.updateDocumentAttachment=qf,s.updateDocumentAttachments=zd,s.updateDocuments=We,s.updateEmailDomain=Gf,s.updateEmailDomains=$f,s.updateForm=ny,s.updateFormRevision=xf,s.updateFormRevisionAttachment=Zf,s.updateFormRevisionAttachments=du,s.updateFormRevisions=ey,s.updateFormSubmission=Vu,s.updateFormSubmissionAttachment=my,s.updateFormSubmissionAttachments=Ru,s.updateFormSubmissions=fy,s.updateForms=ry,s.updateGeoImage=Nu,s.updateGeoImages=yy,s.updateIssue=qt,s.updateIssueAssociation=Xu,s.updateIssueAssociations=Py,s.updateIssueAttachment=Oy,s.updateIssueAttachments=co,s.updateIssueComment=jy,s.updateIssueCommentAttachment=vy,s.updateIssueCommentAttachments=fo,s.updateIssueComments=qy,s.updateIssueType=Sl,s.updateIssueTypeAttachment=Ly,s.updateIssueTypeAttachments=Uo,s.updateIssueTypeFieldValues=nt,s.updateIssueTypeFieldValuesAttachment=fS,s.updateIssueTypeFieldValuesAttachments=ol,s.updateIssueTypeFieldValuesMany=tS,s.updateIssueTypeFields=al,s.updateIssueTypeFieldsAttachment=Ky,s.updateIssueTypeFieldsAttachments=Wo,s.updateIssueTypeFieldsMany=rS,s.updateIssueTypes=PS,s.updateIssueUpdate=vS,s.updateIssueUpdates=wS,s.updateIssues=Cy,s.updateOrganization=Yl,s.updateOrganizationAccess=Ct,s.updateOrganizationAccesses=$S,s.updateOrganizations=ZS,s.updateProject=qh,s.updateProjectAccess=dt,s.updateProjectAccesses=cg,s.updateProjectAttachment=ug,s.updateProjectAttachments=mh,s.updateProjectFile=Ya,s.updateProjectFiles=mg,s.updateProjects=Pg,s.updateTeam=Yh,s.updateTeamMembership=Mg,s.updateTeamMemberships=Eg,s.updateTeams=Dg,s.updateUser=VS,s.updateUsers=qS,s.useSelectorBuilder=Ng,s.userReducer=zl,s.userSlice=ja,s.versioningReducer=Xh,s.versioningSlice=Jh,Object.defineProperty(s,Symbol.toStringTag,{value:"Module"})});
13
+ external URLs and therefore not prepended with VITE_API_URL.`;throw new Error(p)}return await this.addCache(l),l}processPresignedUrl(e,n){if("warning"in n){if(n.warning==="already_uploaded")return Promise.resolve(void 0);throw console.error(n.warning),new Error(n.warning)}return this.enqueueRequest({url:n.url,description:"Upload file to S3",method:h.POST,isExternalUrl:!0,isAuthNeeded:!1,attachmentHash:e,blockers:[`s3-${n.fields.key}`],blocks:[e],s3url:n})}processPresignedUrls(e){const n={};for(const[a,c]of Object.entries(e))n[a]=this.processPresignedUrl(a,c);return n}async getFilePayload(e){const a={sha1:await Kt(e),file_type:e.type,extension:tc(e),size:e.size};return await this.client.files.addCache(e),a}}class ak extends M{constructor(){super(...arguments);m(this,"name","Form Identifier");m(this,"url","/form-identifiers");m(this,"actions",{addOne:Wp,addMany:Bp,setOne:zp,setMany:Dp,updateOne:qp,updateMany:jp,deleteOne:$p,deleteMany:Cp,initialize:Vp});m(this,"selectors",{selectById:Lp,selectByIds:Np})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:b(u),blockers:[u.form],blocks:[u.uuid]});return p.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Expected form identifier with uuid ${e.uuid} to exist`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected form identifier with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{form__organization:e}},n);return this.dispatch(a(c)),c}}class ck extends M{constructor(){super(...arguments);m(this,"name","Form Identifier Value");m(this,"url","/form-identifier-values");m(this,"actions",{addOne:Yp,addMany:Jp,setOne:Zp,setMany:Qp,updateOne:Xp,updateMany:xp,deleteOne:em,deleteMany:tm,initialize:Kp});m(this,"selectors",{selectById:im,selectByIds:nm})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:b(u),blockers:[e.form_submission,e.form_identifier],blocks:[u.uuid]});return p.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected form identifier value with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{form_submission__form_revision__form__organization:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class rk extends D{constructor(){super(...arguments);m(this,"name","Form Revision Attachment");m(this,"url","/form-revision-attachments");m(this,"actions",{addOne:dm,addMany:lm,setOne:um,setMany:om,updateOne:hm,updateMany:pm,deleteOne:mm,deleteMany:fm,initialize:rm});m(this,"selectors",{selectById:Sm,selectByIds:Am})}getId(e){return e.uuid}getBlockers(e){return[e.form_revision]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,form_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,form_revision:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,form_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,form_revision:c,file_sha1:r,file_name:d,file_extension:l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{form_revision__form__organization:e}},n);return this.dispatch(a(c)),c}}class dk extends M{constructor(){super(...arguments);m(this,"name","Form Revision");m(this,"url","/form-revisions");m(this,"actions",{addOne:Ci,addMany:Ui,setOne:Om,setMany:Fm,updateOne:gm,updateMany:_m,deleteOne:Li,deleteMany:Ni,initialize:Im});m(this,"selectors",{selectById:Pm,selectByIds:bm})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,u=new Date().toISOString(),p=O({...e,created_by:l,submitted_at:u});this.dispatch(a(p));const f=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:b(p),blockers:[e.form],blocks:[p.uuid]});return f.then(T=>{this.dispatch(c(T))}).catch(()=>{this.dispatch(r(p.uuid))}),[p,f]}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{form__organization:e}},n);return this.dispatch(a(c)),c}}class lk extends M{constructor(){super(...arguments);m(this,"name","Form");m(this,"url","/forms");m(this,"actions",{addOne:Em,addMany:Vm,setOne:Wm,setMany:Bm,updateOne:zm,updateMany:Dm,deleteOne:qm,deleteMany:jm,initialize:vm});m(this,"selectors",{selectById:Um,selectByIds:Lm})}add(e,n){var y;const{store:a}=this.client,{addOne:c,deleteOne:r}=this.actions,d=new Date().toISOString(),l=((y=a.getState().userReducer.currentUser)==null?void 0:y.id)??null,u=O({...e,submitted_at:d,created_by:l}),p=O({...n,form:u.uuid,submitted_at:d,created_by:l});this.dispatch(c(u)),this.dispatch(Ci(p));const f=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:{...b(u),initial_revision:{uuid:p.uuid,submitted_at:p.submitted_at,title:p.title,description:p.description,fields:p.fields}},blockers:[],blocks:[u.uuid,p.uuid]});return f.catch(T=>{throw this.dispatch(r(u.uuid)),this.dispatch(Li(p.uuid)),T}),[u,p,f]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error("Expected form to exist");const u=mf(e)(d),p=Rm(e)(d);this.dispatch(a(e)),this.dispatch(sn(E(u))),this.dispatch(Ni(E(p)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(f){throw this.dispatch(c(l)),this.dispatch(Ui(p)),this.dispatch(tn(u)),f}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class uk extends D{constructor(){super(...arguments);m(this,"name","Form Submission Attachment");m(this,"url","/form-submission-attachments");m(this,"actions",{addOne:Hm,addMany:Ji,setOne:Km,setMany:Ym,updateOne:Jm,updateMany:Zm,deleteOne:Qm,deleteMany:Zi,initialize:Gm});m(this,"selectors",{selectById:Xm,selectByIds:xm})}getId(e){return e.uuid}getBlockers(e){return[e.form_submission]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,form_submission:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,form_submission:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,form_submission:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,form_submission:c,file_sha1:r,file_name:d,file_extension:l}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,r=n.getState(),d=xi(e)(r);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{form_submission__form_revision__form__organization:e}},n)).flat();return this.dispatch(a(r)),r}}class ok extends M{constructor(){super(...arguments);m(this,"name","Form Submission");m(this,"url","/form-submissions");m(this,"actions",{addOne:rf,addMany:tn,setOne:af,setMany:cf,updateOne:df,updateMany:lf,deleteOne:uf,deleteMany:sn,initialize:nf});m(this,"selectors",{selectById:hf,selectByIds:pf})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,u=new Date().toISOString(),p=O({...e,created_by:l,submitted_at:u}),f=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:b(p),blockers:[e.form_revision],blocks:[p.uuid]});return this.dispatch(a(p)),f.then(T=>{this.dispatch(c(T))}).catch(()=>{this.dispatch(r(p.uuid))}),[p,f]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),d=c(e.uuid)(r);if(!d)throw new Error(`Expected submission with uuid ${e.uuid} to exist`);const l={...d,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${l.uuid}/`,payload:e,blockers:[l.uuid],blocks:[l.uuid]});return u.then(p=>{this.dispatch(a(p))}).catch(()=>{this.dispatch(a(d))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected submission with uuid ${e} to exist`);const u=ef(e)(d);this.dispatch(a(e)),this.dispatch(Zi(E(u)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(p){throw this.dispatch(c(l)),this.dispatch(Ji(u)),p}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{limit:this.pageSize,paginate:!0,form_revision__form_organization:e}},n)).flat();return this.dispatch(a(r)),r}}class hk extends D{constructor(){super(...arguments);m(this,"name","Geo Image");m(this,"url","/geo-images");m(this,"actions",{addOne:Tf,addMany:If,setOne:Af,setMany:wf,updateOne:Of,updateMany:Ff,deleteOne:gf,deleteMany:_f,initialize:Sf});m(this,"selectors",{selectById:bf,selectByIds:Rf})}getId(e){return e.uuid}getBlockers(e){return[e.project]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_sha1:e.file_sha1,file_name:e.file_name,file_extension:e.file_extension,title:e.title,description:e.description,geo_marker:e.geo_marker,canvas_marker:e.canvas_marker,direction:e.direction,original_date:e.original_date,project:e.project}}buildBulkPayload(e){return{uuid:e.uuid,file_sha1:e.file_sha1,file_name:e.file_name,file_extension:e.file_extension,title:e.title,description:e.description,geo_marker:e.geo_marker,canvas_marker:e.canvas_marker,direction:e.direction,original_date:e.original_date,project:e.project}}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),d=c(e.uuid)(r);if(!d)throw new Error(`Geo image with uuid ${e.uuid} does not exist in the store`);const l={...d,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blocks:[e.uuid],blockers:[e.uuid]});return u.then(p=>{this.dispatch(a(p))}).catch(()=>{this.dispatch(a(d))}),[l,u]}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{project:e}},n);return this.dispatch(a(c)),c}}class pk extends M{constructor(){super(...arguments);m(this,"name","Issue Association");m(this,"url","/issue-associations");m(this,"actions",{addOne:zf,addMany:St,setOne:Vf,setMany:Ef,updateOne:Wf,updateMany:Bf,deleteOne:Df,deleteMany:At,initialize:vf});m(this,"selectors",{selectById:jf,selectByIds:$f})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=new Date().toISOString(),l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,u=O({...e,submitted_at:d,created_by:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:b(u),blockers:[e.associated_issue,...e.issue?[e.issue]:[],...e.asset?[e.asset]:[]],blocks:[u.uuid]});return p.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Issue association with uuid ${e} not found in store.`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{associated_issue__project:e}},n)).flat();return this.dispatch(a(r)),r}}class mk extends D{constructor(){super(...arguments);m(this,"name","Issue Attachment");m(this,"url","/issue-attachments");m(this,"actions",{addOne:Jf,addMany:ln,setOne:Zf,setMany:Qf,updateOne:Xf,updateMany:xf,deleteOne:ey,deleteMany:un,initialize:Yf});m(this,"selectors",{selectById:iy,selectByIds:ny})}getId(e){return e.uuid}getBlockers(e){return[e.issue]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,issue:e.issue}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,issue:e.issue}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{issue__project:e}},n)).flat();return this.dispatch(a(r)),r}}class fk extends D{constructor(){super(...arguments);m(this,"name","Issue Comment Attachment");m(this,"url","/issue-comment-attachments");m(this,"actions",{addOne:dy,addMany:ly,setOne:uy,setMany:oy,updateOne:hy,updateMany:py,deleteOne:my,deleteMany:fy,initialize:ry});m(this,"selectors",{selectById:Sy,selectByIds:Ay})}getId(e){return e.uuid}getBlockers(e){return[e.issue_comment]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,issue_comment:e.issue_comment}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,issue_comment:e.issue_comment}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{issue_comment__issue__project:e}},n)).flat();return this.dispatch(a(r)),r}}class yk extends M{constructor(){super(...arguments);m(this,"name","Issue Comment");m(this,"url","/issue-comments");m(this,"actions",{addOne:Oy,addMany:Fy,setOne:gy,setMany:_y,updateOne:Py,updateMany:by,deleteOne:Ry,deleteMany:My,initialize:Iy});m(this,"selectors",{selectById:ky,selectByIds:vy})}add(e){const{store:n}=this.client,{addOne:a,updateOne:c,deleteOne:r}=this.actions,d=O({...e,author:n.getState().userReducer.currentUser.id,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:b(d),blockers:[e.issue],blocks:[d.uuid]});return l.then(u=>{this.dispatch(c(u))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}update(e){const{store:n}=this.client,{updateOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Comment with uuid ${e.uuid} not found in store`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Comment with uuid ${e} not found in store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{setMany:a}=this.actions,r=(await this.listPaginated({queryParams:{issue__project:e}},n)).flat();return this.dispatch(a(r)),r}}class Sk extends M{constructor(){super(...arguments);m(this,"name","Issue");m(this,"url","/issues");m(this,"actions",{addOne:By,addMany:Sn,setOne:zy,setMany:Dy,updateOne:qy,updateMany:jy,deleteOne:$y,deleteMany:An,initialize:Wy});m(this,"selectors",{selectById:Uy,selectByIds:Ly})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=n.getState(),l=new Date().toISOString(),u=((y=d.userReducer.currentUser)==null?void 0:y.id)??null,p=O({...e,submitted_at:l,created_by:u});this.dispatch(a(p));const f=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:b(p),blockers:[p.project,p.issue_type,p.status],blocks:[p.uuid]});return f.then(T=>{this.dispatch(c(T))}).catch(T=>{throw this.dispatch(r(p.uuid)),T}),[p,f]}update(e){var f;const{updateOne:n}=this.actions,{selectById:a}=this.selectors,c=this.client.store.getState(),r=a(e.uuid)(c);if(!r)throw new Error(`Attempting to update an issue with uuid ${e.uuid} that doesn't exist in the store`);const d={...r,...e};this.dispatch(n(d));const l={};for(const y of[$.TITLE,$.DESCRIPTION,$.STATUS,$.PRIORITY,$.ASSIGNED_TO,$.DUE_DATE])if(y in e&&e[y]!==r[y])switch(y){case $.PRIORITY:l[y]=e[y];break;case $.DUE_DATE:l[y]=e[y];break;case $.DESCRIPTION:l[y]=e[y];break;case $.TITLE:l[y]=e[y];break;case $.STATUS:{const T=e[y],P=zn(T)(c);if(!P)throw new Error(`Trying to update issue type status with ${T} which does not exist in store`);l[y]={name:P.name,color:P.color,uuid:P.uuid};break}case $.ASSIGNED_TO:{const T=e[y];if(T===null)l[y]=null;else{const P=hs(T)(c);if(!P)throw new Error(`Trying to update assigned to with ${T} which does not exist in store.`);l[y]={full_name:P.username,id:P.id}}break}}const u=O({created_by:((f=c.userReducer.currentUser)==null?void 0:f.id)??null,submitted_at:new Date().toISOString(),issue:r.uuid,changes:l});this.dispatch(qn(u));const p=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return p.then(y=>{this.dispatch(n(y))}).catch(()=>{this.dispatch(n(r)),this.dispatch($n(u.uuid))}),[d,p]}bulkUpdate(e,n){const{store:a}=this.client,{updateMany:c}=this.actions,{selectByIds:r}=this.selectors,d=E(e).toSorted(Yt);if(d.length!==e.length)throw new Error("payloads contains duplicate uuids.");const l=r(d)(a.getState()).toSorted(gs);if(d.length!=l.length)throw new Error(`Attempting to bulk update ${d.length-l.length} issues that dont exist in the store`);const u=[];for(let T=0;T<d.length;T++)u.push({...l[T],...e[T]});this.dispatch(c(u));const p=yt(e,Math.min(n??e.length,pt)),f=[];let y=null;for(const T of p){const P=mt.v4(),v=E(T),_=T.map(({status:R})=>R).filter(Boolean),k=this.enqueueRequest({description:w(h.PATCH,this.name,!0),method:h.PATCH,url:`${this.url}/bulk/`,payload:{payloads:T},blockers:(y?[y]:[]).concat(v).concat(_),blocks:[P].concat(v)});f.push(k),y=P}return Promise.all(f).then(T=>{this.dispatch(c(T.flat()))}).catch(()=>{this.dispatch(c(l))}),[u,f]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`No issue with uuid ${e} found in the store`);const u=Cf(e)(d),p=Nf(e)(d),f=yO(e)(d),y=sy(e)(d),T=yw(e)(d);this.dispatch(a(e)),this.dispatch(un(E(y))),this.dispatch(Cn(E(T))),this.dispatch(At(E(u))),this.dispatch(At(E(p))),this.dispatch(qt(E(f)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(P){throw this.dispatch(c(l)),this.dispatch(ln(y)),this.dispatch(jn(T)),this.dispatch(St(u)),this.dispatch(St(p)),this.dispatch(Dt(f)),P}}async bulkDelete(e){const{store:n}=this.client,{addMany:a,deleteMany:c}=this.actions,{selectByIds:r}=this.selectors,d=n.getState(),l=r(e)(d),u=Uf(e)(d),p=Lf(e)(d),f=fO(e)(d);this.dispatch(c(e)),this.dispatch(At(E(u))),this.dispatch(At(E(p))),this.dispatch(qt(E(f)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(y){throw this.dispatch(a(l)),this.dispatch(St(u)),this.dispatch(St(p)),this.dispatch(Dt(f)),y}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{project:e}},n)).flat();return this.dispatch(a(r)),r}}class Ak extends D{constructor(){super(...arguments);m(this,"name","Issue Type Attachment");m(this,"url","/issue-type-attachments");m(this,"actions",{addOne:Yy,addMany:Jy,setOne:Zy,setMany:Qy,updateOne:Xy,updateMany:xy,deleteOne:eS,deleteMany:tS,initialize:Ky});m(this,"selectors",{selectById:iS,selectByIds:nS})}getId(e){return e.uuid}getBlockers(e){return[e.issue_type]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,issue_type:e.issue_type}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,issue_type:e.issue_type}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{issue_type__organization:e}},n);return this.dispatch(a(c)),c}}class wk extends D{constructor(){super(...arguments);m(this,"name","Issue Type Fields Attachment");m(this,"url","/issue-type-fields-attachments");m(this,"actions",{addOne:dS,addMany:lS,setOne:uS,setMany:oS,updateOne:hS,updateMany:pS,deleteOne:mS,deleteMany:fS,initialize:rS});m(this,"selectors",{selectById:SS,selectByIds:AS})}getId(e){return e.uuid}getBlockers(e){return[e.fields_revision]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{fields_revision__issue_type__organization:e}},n);return this.dispatch(a(c)),c}}class Tk extends M{constructor(){super(...arguments);m(this,"name","Issue Type Fields");m(this,"url","/issue-type-fields");m(this,"actions",{addOne:zS,addMany:DS,setOne:qS,setMany:jS,updateOne:$S,updateMany:CS,deleteOne:US,deleteMany:LS,initialize:BS});m(this,"selectors",{selectById:GS,selectByIds:HS})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:b(u),blockers:[u.issue_type],blocks:[u.uuid]});return p.then(y=>{this.dispatch(c(y))}).catch(y=>{throw this.dispatch(r(u.uuid)),y}),[u,p]}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{issue_type__organization:e}},n);return this.dispatch(a(c)),c}}class Ik extends D{constructor(){super(...arguments);m(this,"name","Issue Type Field Values Attachment");m(this,"url","/issue-type-field-values-attachments");m(this,"actions",{addOne:ZS,addMany:Pn,setOne:QS,setMany:XS,updateOne:xS,updateMany:eA,deleteOne:tA,deleteMany:bn,initialize:JS});m(this,"selectors",{selectById:iA,selectByIds:nA})}getId(e){return e.uuid}getBlockers(e){return[e.field_values]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,d=n.getState(),l=r(e)(d);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{field_values__issue__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class Ok extends M{constructor(){super(...arguments);m(this,"name","Issue Type Field Values");m(this,"url","/issue-type-field-values");m(this,"actions",{addOne:OS,addMany:FS,setOne:gS,setMany:_S,updateOne:PS,updateMany:bS,deleteOne:RS,deleteMany:MS,initialize:IS});m(this,"selectors",{selectById:vS,selectByIds:ES})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,u=new Date().toISOString(),p=O({...e,created_by:l,submitted_at:u}),f=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:b(p),blockers:[e.issue,e.fields_revision],blocks:[p.uuid]});return this.dispatch(a(p)),f.then(T=>{this.dispatch(c(T))}).catch(()=>{this.dispatch(r(p.uuid))}),[p,f]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),d=c(e.uuid)(r);if(!d)throw new Error(`Expected IssueTypeFieldValues with uuid ${e.uuid} to exist`);const l={...d,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[l.uuid,l.fields_revision,l.issue],blocks:[l.uuid]});return u.then(p=>{this.dispatch(a(p))}).catch(()=>{this.dispatch(a(d))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected submission with uuid ${e} to exist`);const u=aA(e)(d);this.dispatch(a(e)),this.dispatch(bn(E(u)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(p){throw this.dispatch(c(l)),this.dispatch(Pn(u)),p}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{issue__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class Fk extends M{constructor(){super(...arguments);m(this,"name","Issue Type Identifier");m(this,"url","/issue-type-identifiers");m(this,"actions",{addOne:lA,addMany:uA,setOne:oA,setMany:hA,updateOne:pA,updateMany:mA,deleteOne:fA,deleteMany:yA,initialize:dA});m(this,"selectors",{selectById:AA,selectByIds:wA})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:b(u),blockers:[u.issue_type],blocks:[u.uuid]});return p.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Expected issue type identifier with uuid ${e.uuid} to exist`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected issue type identifier with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{issue_type__organization:e}},n);return this.dispatch(a(c)),c}}class gk extends M{constructor(){super(...arguments);m(this,"name","Issue Type Identifier Value");m(this,"url","/issue-type-identifier-values");m(this,"actions",{addOne:FA,addMany:gA,setOne:_A,setMany:PA,updateOne:bA,updateMany:RA,deleteOne:MA,deleteMany:kA,initialize:OA});m(this,"selectors",{selectById:EA,selectByIds:VA})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:b(u),blockers:[e.issue,e.issue_type_identifier],blocks:[u.uuid]});return p.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected issue type identifier value with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{issue__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class _k extends M{constructor(){super(...arguments);m(this,"name","Issue Type");m(this,"url","/issue-types");m(this,"actions",{addOne:DA,addMany:qA,setOne:jA,setMany:$A,updateOne:CA,updateMany:UA,deleteOne:LA,deleteMany:NA,initialize:zA});m(this,"selectors",{selectById:HA,selectByIds:KA})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,u=new Date().toISOString(),p=O({...e,submitted_at:u,created_by:l});this.dispatch(a(p));const f=this.enqueueRequest({method:h.POST,url:`${this.url}/`,payload:b(p),blockers:[],blocks:[p.uuid]});return f.then(T=>{this.dispatch(c(T))}).catch(()=>{this.dispatch(r(p.uuid))}),[p,f]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),d=c(e.uuid)(r);if(!d)throw new Error(`IssueType with uuid ${e.uuid} does not exist in the store.`);const l={...d,...e};this.dispatch(a(l));const u=this.enqueueRequest({method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.then(p=>{this.dispatch(a(p))}).catch(()=>{this.dispatch(a(d))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,setOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`IssueType with uuid ${e} does not exist in the store.`);const u=Ny(e)(d);this.dispatch(a(e)),this.dispatch(An(E(u)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(p){throw this.dispatch(c(l)),this.dispatch(Sn(u)),p}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class Pk extends M{constructor(){super(...arguments);m(this,"name","Issue Type Status");m(this,"url","/issue-type-statuses");m(this,"actions",{addOne:QA,addMany:XA,setOne:xA,setMany:ew,updateOne:tw,updateMany:sw,deleteOne:iw,deleteMany:nw,initialize:ZA});m(this,"selectors",{selectById:zn,selectByIds:cw})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:b(u),blockers:[e.issue_type],blocks:[u.uuid]});return p.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}update(e){const{setOne:n}=this.actions,{selectById:a}=this.selectors,c=this.client.store.getState(),r=a(e.uuid)(c);if(!r)throw new Error(`Expected an existing issue type status with uuid ${e.uuid}`);const d={...r,...e};this.dispatch(n(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(n(u))}).catch(()=>{this.dispatch(n(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`No issue type status with uuid ${e} found in the store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{issue_type__organization:e}},n);return this.dispatch(a(c)),c}}class bk extends M{constructor(){super(...arguments);m(this,"name","Issue Update");m(this,"url","/issue-updates");m(this,"actions",{addOne:qn,addMany:jn,setOne:uw,setMany:ow,updateOne:hw,updateMany:pw,deleteOne:$n,deleteMany:Cn,initialize:lw});m(this,"selectors",{selectById:mw,selectByIds:fw})}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{issue__project:e}},n)).flat();return this.dispatch(a(r)),r}}const Rk=1800;function Mk(t){if(!t.access)throw new Error("Missing access token");if(!t.refresh)throw new Error("Missing refresh token");return{accessToken:t.access,refreshToken:t.refresh}}class kk extends bM{constructor(){super(...arguments);m(this,"_getRenewedTokens",async e=>{const n=this.performRequest({method:h.POST,url:this.refreshTokensUrl,payload:{refresh:e},isAuthNeeded:!1,checkAuth:!1});let a;try{a=await n}catch(c){console.error("Could not renew tokens; clearing auth",c),this.clearAuth();return}if(!a.access)throw new Error("Missing access token");return{accessToken:a.access,refreshToken:a.refresh??this.getRefreshToken()}})}clearAuth(){console.debug(this.constructor.name,"clearing auth;"),this.dispatch(jh(!1)),this.clearTokens(),this.dispatch(I()),this.dispatch(I())}async renewTokens(){const e=this.getRefreshToken();if(!e)throw new Error("No refresh token found");console.debug(this.constructor.name,"renewing tokens");try{const n=await this._getRenewedTokens(e);if(!n)return;console.debug("Got renewed tokens"),this.setTokens(n)}catch(n){throw console.error("Could not renew tokens; clearing auth",n),this.clearAuth(),n}}tokenIsExpiringSoon(){const e=this.getAccessToken();if(!e)return!1;const n=Date.now()/1e3;let a;try{a=bP(e).exp??n}catch{a=n}return a-n<Rk}getAuthHeader(){return`Bearer ${this.getAccessToken()}`}async prepareAuth(){if(this.tokenIsExpiringSoon()){console.debug(this.constructor.name,"preparing auth");try{await this.renewTokens()}catch(e){return e instanceof C&&this.clearAuth(),e instanceof Error?Promise.reject(e):Promise.reject(new Error((e??bt).toString()))}}}async handleUnauthorized(e,n){const a=this.client.store.getState();if(e.url.endsWith("/token/refresh/"))throw a.authReducer.isLoggedIn&&console.warn("No signed-in user to sign out."),this.clearAuth(),new C({message:"You have been signed out due to inactivity.",response:n,discard:!0});if(a.authReducer.isLoggedIn)await this.renewTokens();else throw console.debug("Forbidden; user is not logged in."),new C({message:"Incorrect username or password.",response:n,discard:!0})}async initAuth(e){const n=mt.v4();return console.debug(this.constructor.name,"Initiating auth"),this.performRequest({uuid:n,method:h.POST,url:this.initTokensUrl,payload:e,isAuthNeeded:!1,checkAuth:!1}).then(a=>{this.setTokens(Mk(a))})}}class vk extends It{constructor(){super(...arguments);m(this,"name","Organization Access");m(this,"url","/organization-accesses");m(this,"actions",{addOne:vw,addMany:Ew,setOne:Vw,setMany:Ww,updateOne:Bw,updateMany:zw,deleteOne:Dw,deleteMany:qw,initialize:kw});m(this,"selectors",{selectById:$w,selectByIds:Cw})}update(e){const{store:n}=this.client,{updateOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState()),d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(u=>{throw this.dispatch(a(r)),u}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d),u=hs(l.user)(d);this.dispatch(a(l.uuid)),this.dispatch(Hn(l.user));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${l.uuid}/`,blockers:[l.uuid],blocks:[]})}catch(p){throw this.dispatch(c(l)),this.dispatch(Gn(u)),p}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class Ek extends It{constructor(){super(...arguments);m(this,"name","Organization");m(this,"url","/organizations");m(this,"actions",{addOne:Yw,addMany:Kw,setOne:Hw,setMany:Gw,updateOne:Zw,updateMany:Jw,deleteOne:Qw,deleteMany:Xw,initialize:Nw});m(this,"selectors",{selectById:tT,selectByIds:sT})}async add(e){const{addOne:n}=this.actions,a=await this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:e,blockers:[],blocks:[]});return this.dispatch(n(a)),a}async update(e){const{setOne:n}=this.actions,a=await this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return this.dispatch(n(a)),a}async invite(e,n){return this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/${e}/invite/${n}/`,blockers:[],blocks:[]})}async refreshStore(e){const{initialize:n}=this.actions,a=await this.list({},e);return this.dispatch(n(a)),a}}class Vk extends M{constructor(){super(...arguments);m(this,"name","Project Access");m(this,"url","/project-accesses");m(this,"actions",{addOne:hT,addMany:pT,setOne:mT,setMany:fT,updateOne:yT,updateMany:ST,deleteOne:AT,deleteMany:wT,initialize:oT});m(this,"selectors",{selectById:IT,selectByIds:OT})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:b(d),blockers:[d.organization_access,d.project],blocks:[d.uuid]});return l.then(p=>{this.dispatch(c(p))}).catch(p=>{throw this.dispatch(r(d.uuid)),p}),[d,l]}bulkAdd(e){var p;const{store:n}=this.client,{addMany:a,deleteMany:c,updateMany:r}=this.actions,d=((p=n.getState().userReducer.currentUser)==null?void 0:p.id)??null,l=e.map(f=>O({...f,created_by:d}));this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:{project_accesses:l.map(f=>b(f))},blockers:l.flatMap(f=>[f.project,f.organization_access]),blocks:l.map(f=>f.uuid)});return u.then(f=>{this.dispatch(r(f))}).catch(f=>{throw this.dispatch(c(l.map(y=>y.uuid))),f}),[l,u]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState()),d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[]});return l.then(u=>{this.dispatch(a(u))}).catch(u=>{throw this.dispatch(a(r)),u}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{project__organization:e}},n);return this.dispatch(a(c)),c}}class Wk extends D{constructor(){super(...arguments);m(this,"name","Project Attachment");m(this,"url","/project-attachments");m(this,"actions",{addOne:_T,addMany:PT,setOne:bT,setMany:RT,updateOne:MT,updateMany:kT,deleteOne:vT,deleteMany:ET,initialize:gT});m(this,"selectors",{selectById:WT,selectByIds:BT})}getId(e){return e.uuid}getBlockers(e){return[e.project]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,project:e.project}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,project:e.project}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{project__organization:e}},n);return this.dispatch(a(c)),c}}class Bk extends D{constructor(){super(...arguments);m(this,"name","Project File");m(this,"url","/project-files");m(this,"actions",{addOne:CT,addMany:UT,setOne:jT,setMany:$T,updateOne:LT,updateMany:NT,deleteOne:GT,deleteMany:HT,initialize:qT});m(this,"selectors",{selectById:JT,selectByIds:ZT})}getId(e){return e.uuid}getBlockers(e){return[e.project]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_sha1:e.file_sha1,file_name:e.file_name,file_extension:e.file_extension,project:e.project,z_index:e.z_index,canvas_bounds:e.canvas_bounds,bounds:e.bounds}}buildBulkPayload(e){return{uuid:e.uuid,file_sha1:e.file_sha1,file_name:e.file_name,file_extension:e.file_extension,project:e.project,z_index:e.z_index,canvas_bounds:e.canvas_bounds,bounds:e.bounds}}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),d=c(e.uuid)(r);if(!d)throw new Error(`${this.name} with uuid ${e.uuid} does not exist in the store`);const l={...d,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blocks:[e.uuid],blockers:[e.uuid]});return u.then(p=>{this.dispatch(a(p))}).catch(()=>{this.dispatch(a(d))}),[l,u]}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{project:e}},n)).flat();return this.dispatch(a(r)),r}}class zk extends It{constructor(){super(...arguments);m(this,"name","Project");m(this,"url","/projects");m(this,"actions",{addOne:iI,addMany:sI,setOne:tI,setMany:eI,updateOne:aI,updateMany:nI,deleteOne:cI,deleteMany:rI,initialize:xT});m(this,"selectors",{selectById:uI,selectByIds:oI})}async add(e){const{addOne:n}=this.actions,a=await this.performRequest({method:h.POST,url:`${this.url}/`,payload:b(e)});return this.dispatch(n(a)),a}async update(e){const{updateOne:n}=this.actions,a=await this.performRequest({method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:b(e)});return this.dispatch(n(a)),a}async delete(e){const{deleteOne:n}=this.actions,a=await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]});return this.dispatch(n(e)),a}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class Dk extends M{constructor(){super(...arguments);m(this,"name","Team Membership");m(this,"url","/team-memberships");m(this,"actions",{addOne:fI,addMany:yI,setOne:SI,setMany:AI,updateOne:wI,updateMany:TI,deleteOne:II,deleteMany:OI,initialize:mI});m(this,"selectors",{selectById:_I,selectByIds:PI})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:b(d),blockers:[e.team],blocks:[d.uuid]});return l.then(p=>{this.dispatch(c(p))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}bulkAdd(e){var p;const{store:n}=this.client,{addMany:a,setMany:c,deleteMany:r}=this.actions,d=((p=n.getState().userReducer.currentUser)==null?void 0:p.id)??null,l=e.map(f=>O({...f,created_by:d}));this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:{team_memberships:l.map(f=>b(f))},blockers:l.map(f=>f.team),blocks:l.map(f=>f.uuid)});return u.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(l.map(f=>f.uuid)))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,setOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected team membership with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{team__organization:e}},n);return this.dispatch(a(c)),c}}class qk extends M{constructor(){super(...arguments);m(this,"name","Team");m(this,"url","/teams");m(this,"actions",{addOne:MI,addMany:kI,setOne:vI,setMany:EI,updateOne:VI,updateMany:WI,deleteOne:BI,deleteMany:zI,initialize:RI});m(this,"selectors",{selectById:qI,selectByIds:jI})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...e,submitted_at:new Date().toISOString(),created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:b(d),blockers:[],blocks:[d.uuid]});return l.then(p=>{this.dispatch(c(p))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Expected team with uuid ${e.uuid} to exist`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:b(e),blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,setOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected team with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class jk extends It{constructor(){super(...arguments);m(this,"name","User");m(this,"url","/user");m(this,"actions",{addOne:Gn,addMany:Ow,setOne:Iw,setMany:Tw,updateOne:gw,updateMany:Fw,deleteOne:Hn,deleteMany:_w,initialize:ww});m(this,"selectors",{selectById:hs,selectByIds:Rw})}async list(e,n){const{organizationUuid:a,...c}=e,r=a?`/organizations/${a}${this.url}s/`:`/${this.url}`;return this.performRequest({method:h.GET,url:r,...c},n)}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({organizationUuid:e},n);return this.dispatch(a(c)),c}}class $k extends M{constructor(){super(...arguments);m(this,"name","Workflow");m(this,"url","/workflows");m(this,"actions",{addOne:GI,addMany:HI,setOne:KI,setMany:YI,updateOne:JI,updateMany:ZI,deleteOne:QI,deleteMany:XI,initialize:NI});m(this,"selectors",{selectById:eO,selectByIds:tO})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:b(d),blockers:[d.workflow_type,d.project],blocks:[d.uuid]});return l.then(p=>{this.dispatch(c(p))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}update(e){const{store:n}=this.client,{updateOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Expected workflow with uuid ${e.uuid} to exist`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[r.uuid,d.workflow_type,d.project],blocks:[r.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected workflow with uuid ${e} to exist`);const u=mO(e)(d);this.dispatch(a(e)),this.dispatch(qt(E(u)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(p){throw this.dispatch(c(l)),this.dispatch(Dt(u)),p}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{project:e}},n)).flat();return this.dispatch(a(r)),r}}class Ck extends M{constructor(){super(...arguments);m(this,"name","Workflow Issue Link");m(this,"url","/workflow-issue-links");m(this,"actions",{addOne:aO,addMany:Dt,setOne:cO,setMany:rO,updateOne:dO,updateMany:lO,deleteOne:uO,deleteMany:qt,initialize:nO});m(this,"selectors",{selectById:hO,selectByIds:pO})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=new Date().toISOString(),l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,u=O({...e,submitted_at:d,created_by:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:b(u),blockers:[e.workflow,e.issue],blocks:[u.uuid]});return p.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Workflow issue link with uuid ${e} not found in store.`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{workflow__project:e}},n)).flat();return this.dispatch(a(r)),r}}class Uk extends M{constructor(){super(...arguments);m(this,"name","Workflow Step Assignee");m(this,"url","/workflow-step-assignees");m(this,"actions",{addOne:TO,addMany:IO,setOne:OO,setMany:FO,updateOne:gO,updateMany:_O,deleteOne:PO,deleteMany:bO,initialize:wO});m(this,"selectors",{selectById:MO,selectByIds:kO})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:b(d),blockers:[d.workflow,d.workflow_step],blocks:[d.uuid]});return l.then(p=>{this.dispatch(c(p))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}bulkAdd(e){var f;const{store:n}=this.client,{addMany:a,setMany:c,deleteMany:r}=this.actions,d=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,l=new Date().toISOString(),u=e.map(y=>O({...y,created_by:d,submitted_at:l}));this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:{workflow_step_assignees:u.map(y=>b(y)),submitted_at:l},blockers:u.flatMap(y=>[y.workflow,y.workflow_step]),blocks:u.map(y=>y.uuid)});return p.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(E(u)))}),[u,p]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Expected workflow step assignee with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,d=r(e)(n.getState());this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{workflow__project:e}},n)).flat();return this.dispatch(a(r)),r}}class Lk extends M{constructor(){super(...arguments);m(this,"name","Workflow Step Comment");m(this,"url","/workflow-step-comments");m(this,"actions",{addOne:WO,addMany:BO,setOne:zO,setMany:DO,updateOne:qO,updateMany:jO,deleteOne:$O,deleteMany:CO,initialize:VO});m(this,"selectors",{selectById:LO,selectByIds:NO})}add(e){var u;const{store:n}=this.client,{addOne:a,updateOne:c,deleteOne:r}=this.actions,d=O({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:b(d),blockers:[d.workflow,d.workflow_step],blocks:[d.uuid]});return l.then(p=>{this.dispatch(c(p))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}update(e){const{store:n}=this.client,{updateOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Workflow step comment with uuid ${e.uuid} not found in store`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Workflow step comment with uuid ${e} not found in store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{workflow__project:e}},n)).flat();return this.dispatch(a(r)),r}}class Nk extends M{constructor(){super(...arguments);m(this,"name","Workflow Step Default Assignee");m(this,"url","/workflow-step-default-assignees");m(this,"actions",{addOne:YO,addMany:JO,setOne:ZO,setMany:QO,updateOne:XO,updateMany:xO,deleteOne:eF,deleteMany:tF,initialize:KO});m(this,"selectors",{selectById:iF,selectByIds:nF})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:b(d),blockers:[d.workflow_step],blocks:[d.uuid]});return l.then(p=>{this.dispatch(c(p))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Expected workflow step default assignee with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{workflow_step__workflow_type__organization:e}},n);return this.dispatch(a(c)),c}}class Gk extends M{constructor(){super(...arguments);m(this,"name","Workflow Step Default Reviewer");m(this,"url","/workflow-step-default-reviewers");m(this,"actions",{addOne:dF,addMany:lF,setOne:uF,setMany:oF,updateOne:hF,updateMany:pF,deleteOne:mF,deleteMany:fF,initialize:rF});m(this,"selectors",{selectById:SF,selectByIds:AF})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:b(d),blockers:[d.workflow_step],blocks:[d.uuid]});return l.then(p=>{this.dispatch(c(p))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Expected workflow step default reviewer with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{workflow_step__workflow_type__organization:e}},n);return this.dispatch(a(c)),c}}class Hk extends It{constructor(){super(...arguments);m(this,"name","Workflow Step Event");m(this,"url","/workflow-step-events");m(this,"actions",{addOne:OF,addMany:FF,setOne:gF,setMany:_F,updateOne:PF,updateMany:bF,deleteOne:RF,deleteMany:MF,initialize:IF});m(this,"selectors",{selectById:vF,selectByIds:EF})}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{workflow__project:e}},n)).flat();return this.dispatch(a(r)),r}}class Kk extends D{constructor(){super(...arguments);m(this,"name","Workflow Step Fields Attachment");m(this,"url","/workflow-step-fields-attachments");m(this,"actions",{addOne:zF,addMany:Sa,setOne:DF,setMany:qF,updateOne:jF,updateMany:$F,deleteOne:CF,deleteMany:Aa,initialize:BF});m(this,"selectors",{selectById:NF,selectByIds:GF})}getId(e){return e.uuid}getBlockers(e){return[e.fields_revision]}getBlocks(e){return[e.uuid]}buildModel(e){var a;const{store:n}=this.client;return O({...e,created_by:((a=n.getState().userReducer.currentUser)==null?void 0:a.id)??null,submitted_at:new Date().toISOString()})}buildPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{fields_revision__workflow_step__workflow_type__organization:e}},n);return this.dispatch(a(c)),c}}class Yk extends M{constructor(){super(...arguments);m(this,"name","Workflow Step Fields");m(this,"url","/workflow-step-fields");m(this,"actions",{addOne:JF,addMany:ZF,setOne:QF,setMany:XF,updateOne:xF,updateMany:eg,deleteOne:tg,deleteMany:sg,initialize:YF});m(this,"selectors",{selectById:ng,selectByIds:ag})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:b(d),blockers:[d.workflow_step],blocks:[d.uuid]});return l.then(p=>{this.dispatch(c(p))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected workflow step fields with uuid ${e} to exist`);const u=LF(e)(d);this.dispatch(a(e)),this.dispatch(Aa(E(u)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(p){throw this.dispatch(c(l)),this.dispatch(Sa(u)),p}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{workflow_step__workflow_type__organization:e}},n);return this.dispatch(a(c)),c}}class Jk extends D{constructor(){super(...arguments);m(this,"name","Workflow Step Field Values Attachment");m(this,"url","/workflow-step-field-values-attachments");m(this,"actions",{addOne:lg,addMany:Oa,setOne:ug,setMany:og,updateOne:hg,updateMany:pg,deleteOne:mg,deleteMany:Fa,initialize:dg});m(this,"selectors",{selectById:yg,selectByIds:Sg})}getId(e){return e.uuid}getBlockers(e){return[e.field_values]}getBlocks(e){return[e.uuid]}buildModel(e){var a;const{store:n}=this.client;return O({...e,created_by:((a=n.getState().userReducer.currentUser)==null?void 0:a.id)??null,submitted_at:new Date().toISOString()})}buildPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,d=r(e)(n.getState());this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{field_values__workflow__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class Zk extends M{constructor(){super(...arguments);m(this,"name","Workflow Step Field Values Review Request");m(this,"url","/workflow-step-field-values-review-requests");m(this,"actions",{addOne:zg,addMany:ba,setOne:Dg,setMany:qg,updateOne:jg,updateMany:$g,deleteOne:Cg,deleteMany:Ra,initialize:Bg});m(this,"selectors",{selectById:Lg,selectByIds:Ng})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:b(d),blockers:[d.field_values],blocks:[d.uuid]});return l.then(p=>{this.dispatch(c(p))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Workflow step field values review request with uuid ${e} not found in store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{field_values__workflow__project:e}},n)).flat();return this.dispatch(a(r)),r}}class Qk extends M{constructor(){super(...arguments);m(this,"name","Workflow Step Field Values Review");m(this,"url","/workflow-step-field-values-reviews");m(this,"actions",{addOne:Jg,addMany:ka,setOne:Zg,setMany:Qg,updateOne:Xg,updateMany:xg,deleteOne:e_,deleteMany:va,initialize:Yg});m(this,"selectors",{selectById:s_,selectByIds:i_})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:b(d),blockers:[d.field_values],blocks:[d.uuid]});return l.then(p=>{this.dispatch(c(p))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Workflow step field values review with uuid ${e.uuid} not found in store`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Workflow step field values review with uuid ${e} not found in store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{field_values__workflow__project:e}},n)).flat();return this.dispatch(a(r)),r}}class Xk extends M{constructor(){super(...arguments);m(this,"name","Workflow Step Field Values");m(this,"url","/workflow-step-field-values");m(this,"actions",{addOne:Og,addMany:Fg,setOne:gg,setMany:_g,updateOne:Pg,updateMany:bg,deleteOne:Rg,deleteMany:Mg,initialize:Ig});m(this,"selectors",{selectById:vg,selectByIds:Eg})}add(e){var p;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=n.getState(),l=O({...e,created_by:((p=d.userReducer.currentUser)==null?void 0:p.id)??null,submitted_at:new Date().toISOString()}),u=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:b(l),blockers:[e.workflow,e.workflow_step,e.fields_revision],blocks:[l.uuid]});return this.dispatch(a(l)),u.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(l.uuid))}),[l,u]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),d=c(e.uuid)(r);if(!d)throw new Error(`Expected WorkflowStepFieldValues with uuid ${e.uuid} to exist`);const l={...d,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[l.uuid,l.workflow,l.workflow_step,l.fields_revision],blocks:[l.uuid]});return u.then(p=>{this.dispatch(a(p))}).catch(()=>{this.dispatch(a(d))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected WorkflowStepFieldValues with uuid ${e} to exist`);const u=Ag(e)(d),p=n_(e)(d),f=Gg(e)(d);this.dispatch(a(e)),this.dispatch(Fa(E(u))),this.dispatch(va(E(p))),this.dispatch(Ra(E(f)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(y){throw this.dispatch(c(l)),this.dispatch(Oa(u)),this.dispatch(ka(p)),this.dispatch(ba(f)),y}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{workflow__project:e}},n)).flat();return this.dispatch(a(r)),r}}class xk extends M{constructor(){super(...arguments);m(this,"name","Workflow Step Reviewer");m(this,"url","/workflow-step-reviewers");m(this,"actions",{addOne:d_,addMany:l_,setOne:u_,setMany:o_,updateOne:h_,updateMany:p_,deleteOne:m_,deleteMany:f_,initialize:r_});m(this,"selectors",{selectById:S_,selectByIds:A_})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:b(d),blockers:[d.workflow,d.workflow_step],blocks:[d.uuid]});return l.then(p=>{this.dispatch(c(p))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}bulkAdd(e){var f;const{store:n}=this.client,{addMany:a,setMany:c,deleteMany:r}=this.actions,d=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,l=new Date().toISOString(),u=e.map(y=>O({...y,created_by:d,submitted_at:l}));this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:{workflow_step_reviewers:u.map(y=>b(y)),submitted_at:l},blockers:u.flatMap(y=>[y.workflow,y.workflow_step]),blocks:u.map(y=>y.uuid)});return p.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(u.map(y=>y.uuid)))}),[u,p]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Expected workflow step reviewer with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,d=r(e)(n.getState());this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{workflow__project:e}},n)).flat();return this.dispatch(a(r)),r}}class ev extends M{constructor(){super(...arguments);m(this,"name","Workflow Step");m(this,"url","/workflow-steps");m(this,"actions",{addOne:O_,addMany:F_,setOne:g_,setMany:__,updateOne:P_,updateMany:b_,deleteOne:R_,deleteMany:M_,initialize:I_});m(this,"selectors",{selectById:v_,selectByIds:E_})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:b(d),blockers:[d.workflow_type],blocks:[d.uuid]});return l.then(p=>{this.dispatch(c(p))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Expected workflow step with uuid ${e.uuid} to exist`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[r.uuid,d.workflow_type],blocks:[r.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Expected workflow step with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{workflow_type__organization:e}},n);return this.dispatch(a(c)),c}}class tv extends M{constructor(){super(...arguments);m(this,"name","Workflow Type");m(this,"url","/workflow-types");m(this,"actions",{addOne:z_,addMany:D_,setOne:q_,setMany:j_,updateOne:$_,updateMany:C_,deleteOne:U_,deleteMany:L_,initialize:B_});m(this,"selectors",{selectById:G_,selectByIds:H_})}add(e){var p;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=n.getState(),l=O({...e,created_by:((p=d.userReducer.currentUser)==null?void 0:p.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:b(l),blockers:[],blocks:[l.uuid]});return u.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(l.uuid))}),[l,u]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Expected workflow type with uuid ${e.uuid} to exist`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[r.uuid],blocks:[r.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Expected workflow type with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}async function $a(t,s,e,n,a){const c=n instanceof Tt;c&&s.checkAuth!==!1&&await n.auth.prepareAuth();const r={queryParams:"",isAuthNeeded:!0},{s3url:d,payload:l,headers:u,method:p,queryParams:f,attachmentHash:y,isExternalUrl:T,isAuthNeeded:P,isResponseBlob:v}={...r,...s};let _=s.url;const k=y?await e.files.fetchCache(y):void 0;if(y&&!k)throw new Error(`Cannot upload file ${y} because it's not cached.`);!T&&!_.startsWith("http")&&(!_.startsWith("/")&&!_.startsWith("blob:")&&(_="/"+_),_=t+_);const R=V=>{if(y){if(!d)throw new Error(`No S3 URL for file ${y}`);if("warning"in d)throw new Error(`S3 URL warning for file ${y}`);if(!k)throw new Error(`No file for file ${y}`);const L=d.fields["x-amz-checksum-sha1"];if(!L)throw new Error(`No checksum for file ${y}`);return V.set("x-amz-checksum-sha1",L).field({...l,...d.fields}).attach("file",k)}return V.send(l)},j={[h.GET]:()=>v?Ft.get(_.toString()).responseType("blob"):Ft.get(_.toString()),[h.POST]:()=>{const V=Ft.post(_.toString());return R(V)},[h.PATCH]:()=>{const V=Ft.patch(_.toString());return R(V)},[h.PUT]:()=>{const V=Ft.put(_.toString());return R(V)},[h.DELETE]:()=>{const V=Ft.delete(_.toString());return R(V)}}[p];let B=j();const q=()=>{console.debug("aborting request:",s.url),B.abort()};if(a==null||a.addEventListener("abort",q),P&&c){const V=n.auth.getAuthHeader();B=B.set("Authorization",V)}u&&(B=B.set(u));try{return await B.query(f)}catch(V){const L=dP(V),As=L==null?void 0:L.status;if(c&&As===401)return await n.auth.handleUnauthorized(B,L),B.query(f);throw new C({response:L,innerError:V,discard:qa.includes(As)})}finally{a==null||a.removeEventListener("abort",q)}}class sv{constructor(s){m(this,"store");this.store=s}_performRequest(s,e,n,a){const c=new Ts,r={...e,uuid:e.uuid??mt.v4()};return $a(s,r,this,n,a).then(d=>{c.resolve(d.body)}).catch(d=>{d instanceof Error?c.reject(d):c.reject(new Error((d??bt).toString()))}),c}async performRequest(s,e,n,a){return this._performRequest(s,e,n,a).then(c=>{if(c instanceof C)throw c;return c})}async enqueueRequest(s,e,n){return this._enqueueRequest(s,e,n).then(a=>{if(a instanceof C)throw a;return a})}_enqueueRequest(s,e,n){const a=new Ts,c={...s,BASE_URL:e,serviceName:n},r=this.store.dispatch(cT(c)),d=u=>{if(u)a.resolve(u.body);else{const p=new C({message:"Could not get a response from the server.",response:u,discard:!0});a.reject(p)}},l=u=>{u instanceof C?u.options.discard=!0:(console.error("Received an unexpected error while processing a request:",u,`
14
+ Converting error to APIError and discarding.`),u=new C({message:"An error occurred while processing the request.",innerError:u,discard:!0})),a.reject(u)};return r.then(d,l),a}async performPagination(s,e,n,a,c){const r={...e,queryParams:{...e.queryParams,paginate:!0,limit:n}},{method:d}=r,l=[];let u=await this.performRequest(s,r,a,c);for(l.push(u.results);u.next;)u=await this.performRequest(s,{url:u.next,method:d},a,c),l.push(u.results);return l}}class Rt{constructor(){m(this,"graph");m(this,"requestAttemptCounter");this.graph=new RP.DepGraph,this.requestAttemptCounter={}}static _fromOutbox(s){const e=new Rt;for(let n=0;n<s.length;n++){const a=s[n];if(!a){console.error("Outbox item was undefined");continue}e.sneakRequest(a);for(let c=0;c<n;c++){const r=s[c];if(!r){console.error("Previous outbox item was undefined");continue}r.payload.uuid!==a.payload.uuid&&r.payload.blocks.some(d=>a.payload.blockers.includes(d))&&Rt._addDependency(a.payload.uuid,r.payload.uuid,e.graph)}}return e}_addDependency(s,e){Rt._addDependency(s,e,this.graph)}static _addDependency(s,e,n){if(s===e)throw new Error(`Tried to add dependency from node to itself: ${s}`);if(!n.hasNode(s))throw new Error(`Tried to add dependency from non-existent node: ${s} (to node: ${e})`);if(!n.hasNode(e))throw new Error(`Tried to add dependency to non-existent node: ${e} (from node: ${s})`);n.addDependency(s,e)}addRequest(s){if(this.graph.addNode(s.payload.uuid,s),!(s.payload.blockers.length===0||this.graph.size()===1))for(const e of this.graph.overallOrder()){if(e===s.payload.uuid)continue;const n=this.graph.getNodeData(e),a=new Set(n.payload.blocks);s.payload.blockers.some(c=>a.has(c))&&this._addDependency(s.payload.uuid,e)}}insertRequest(s){this.graph.addNode(s.payload.uuid,s);for(const e of this.graph.overallOrder()){if(e===s.payload.uuid)continue;const n=this.graph.getNodeData(e),a=new Set(s.payload.blocks);n.payload.blockers.some(c=>a.has(c))&&this._addDependency(e,s.payload.uuid)}}sneakRequest(s){this.graph.addNode(s.payload.uuid,s)}_getNextNode(){const s=this.graph.overallOrder(!0);let e=1/0,n;for(const a of s){const c=this.requestAttemptCounter[a]||0;c<e&&(e=c,n=a)}return n}peek(){const s=this._getNextNode();if(s)return this.graph.getNodeData(s)}remove(s){this.graph.removeNode(s),delete this.requestAttemptCounter[s]}pop(){const s=this.peek();return s&&this.graph.removeNode(s.payload.uuid),s}getQueue(){const s=this.graph.overallOrder().map(n=>this.graph.getNodeData(n)),e=this._getNextNode();if(e){const n=this.graph.getNodeData(e),a=s.findIndex(c=>c.payload.uuid===n.payload.uuid);a!==-1&&(s.splice(a,1),s.unshift(n))}return s}getReady(){let s=this.graph.overallOrder(!0).map(e=>this.graph.getNodeData(e));return s=s.sort((e,n)=>e.meta.offline.effect.timestamp.localeCompare(n.meta.offline.effect.timestamp)),s=s.sort((e,n)=>{const a=this.requestAttemptCounter[e.payload.uuid]||0,c=this.requestAttemptCounter[n.payload.uuid]||0;return a-c}),s}registerRetry(s){this.requestAttemptCounter[s]=(this.requestAttemptCounter[s]||0)+1}}let lP;function uP(t){lP=t}function Mt(){return lP}let oP;function hP(t){oP=t}function pP(){return oP}let Ca=null;function Ot(){const t=Mt();if(!t)return console.warn("Client store not set; cannot get outbox coordinator yet."),null;if(Ca)return Ca;const s=t.getState().offline.outbox,e=Rt._fromOutbox(s);return Ca=e,e}const iv=(t,s)=>{const e=new s(t);return hP(e),uP(t),e};class nv{constructor(s){m(this,"_all");m(this,"_previous");this._all=[s],this._previous=s,this.then=this.then.bind(this),this.compile=this.compile.bind(this)}then(s){return this._previous&&(this._previous.next=s),this._all.push(s),this._previous=s,{then:this.then,compile:this.compile}}compile(){return this._all}}class Ua{constructor(){m(this,"next");this.next=null}then(s){return new nv(this).then(s)}async run(s){if(this.next)return this.next.run(s);{if(console.debug("Middleware finished. Performing request:",s.payload.url),!Mt())throw new Error("Client store not set");const n=pP();if(!n)throw new Error("Client SDK not set");return aP(s,n)}}}class mP extends Ua{async run(s){return super.run(s)}}class fP extends Ua{async run(s){return super.run(s)}}const yP=new mP().then(new fP).compile();function SP(t){var s;return(s=yP[0])==null?void 0:s.run(t)}var AP=(t=>(t[t.USER_REGISTRATION=0]="USER_REGISTRATION",t[t.APPLICATION_INVITE=2]="APPLICATION_INVITE",t[t.PROJECT_INVITE=4]="PROJECT_INVITE",t[t.ORGANIZATION_INVITE=6]="ORGANIZATION_INVITE",t[t.ADD_EMAIL_DOMAIN=8]="ADD_EMAIL_DOMAIN",t[t.RESET_PASSWORD=10]="RESET_PASSWORD",t))(AP||{});i.ALL_MIDDLEWARE=yP,i.APIError=C,i.AgentService=RM,i.AssetAttachmentService=MM,i.AssetProcedureService=BM,i.AssetProcedureStepFieldValuesAttachmentService=jM,i.AssetProcedureStepFieldValuesService=$M,i.AssetProcedureStepFieldsAttachmentService=DM,i.AssetProcedureStepFieldsService=qM,i.AssetProcedureStepService=CM,i.AssetProcedureTypeAttachmentService=kM,i.AssetProcedureTypeFieldValuesAttachmentService=VM,i.AssetProcedureTypeFieldValuesService=WM,i.AssetProcedureTypeFieldsAttachmentService=vM,i.AssetProcedureTypeFieldsService=EM,i.AssetProcedureTypeService=zM,i.AssetService=UM,i.AssetStageCompletionService=LM,i.AssetStageService=NM,i.AssetStatusType=Ja,i.AssetTypeAttachmentService=GM,i.AssetTypeFieldValuesAttachmentService=YM,i.AssetTypeFieldValuesService=JM,i.AssetTypeFieldsAttachmentService=HM,i.AssetTypeFieldsService=KM,i.AssetTypeIdentifierService=ZM,i.AssetTypeIdentifierValueService=QM,i.AssetTypeService=XM,i.AssetTypeStatusService=xM,i.AttachmentModel=Za,i.BaseApiService=Tt,i.BaseModelApiService=It,i.BaseOfflineFileModelApiService=D,i.BaseOfflineModelApiService=M,i.BaseSDK=sv,i.COMMON_AUTO_FIELDS=cc,i.DEFAULT_ISSUE_PRIORITY=MP,i.DEFAULT_PAGE_SIZE=J_,i.DEFAULT_WORKFLOW_STATUS=EP,i.DISCARD_HTTP_STATUSES=qa,i.DeferredPromise=Ts,i.DocumentAttachmentService=ek,i.DocumentService=tk,i.EMPTY_ARRAY=Ha,i.EMPTY_OBJECT=Ka,i.EmailDomainsService=sk,i.EmailVerificationService=ik,i.FILE_MODEL_DEFAULT_PAGE_SIZE=Z_,i.FileService=nk,i.FormIdentifierService=ak,i.FormIdentifierValueService=ck,i.FormRevisionAttachmentService=rk,i.FormRevisionService=dk,i.FormService=lk,i.FormSubmissionAttachmentService=uk,i.FormSubmissionService=ok,i.GeoImageService=hk,i.HttpMethod=h,i.IssueAssociationService=pk,i.IssueAttachmentService=mk,i.IssueCommentAttachmentService=fk,i.IssueCommentService=yk,i.IssuePriority=ws,i.IssueService=Sk,i.IssueStatusType=Qa,i.IssueTypeAttachmentService=Ak,i.IssueTypeFieldValuesAttachmentService=Ik,i.IssueTypeFieldValuesService=Ok,i.IssueTypeFieldsAttachmentService=wk,i.IssueTypeFieldsService=Tk,i.IssueTypeIdentifierService=Fk,i.IssueTypeIdentifierValueService=gk,i.IssueTypeService=_k,i.IssueTypeStatusService=Pk,i.IssueUpdateChange=$,i.IssueUpdateService=bk,i.JWTService=kk,i.MAX_SERVICE_BATCH_SIZE=pt,i.OUTBOX_RETRY_DELAY=xa,i.OfflineAnalyticsMiddleware=mP,i.OfflineMiddleware=Ua,i.OrganizationAccessLevel=Ya,i.OrganizationAccessService=vk,i.OrganizationService=Ek,i.OutboxCoordinator=Rt,i.ProjectAccessService=Vk,i.ProjectAttachmentService=Wk,i.ProjectFileService=Bk,i.ProjectService=zk,i.RESET_ORGANIZATION_STATE=g,i.RESET_PROJECT_STATE=W,i.RESET_STATE=I,i.RateLimitingMiddleware=fP,i.SelectorBuilder=tb,i.TeamMembershipService=Dk,i.TeamService=qk,i.UNKNOWN_ERROR_MESSAGE=bt,i.UserService=jk,i.VERSION_REDUCER_KEY=Et,i.VerificationCodeType=AP,i.WORKFLOW_STATUSES=vP,i.WORKFLOW_STEP_FIELD_VALUES_REVIEW_TYPES=kP,i.WorkflowIssueLinkService=Ck,i.WorkflowService=$k,i.WorkflowStatus=gt,i.WorkflowStepAssigneeService=Uk,i.WorkflowStepCommentService=Lk,i.WorkflowStepDefaultAssigneeService=Nk,i.WorkflowStepDefaultReviewerService=Gk,i.WorkflowStepEventService=Hk,i.WorkflowStepEventType=Xa,i.WorkflowStepFieldValuesAttachmentService=Jk,i.WorkflowStepFieldValuesReviewRequestService=Zk,i.WorkflowStepFieldValuesReviewService=Qk,i.WorkflowStepFieldValuesReviewType=vt,i.WorkflowStepFieldValuesService=Xk,i.WorkflowStepFieldsAttachmentService=Kk,i.WorkflowStepFieldsService=Yk,i.WorkflowStepReviewerService=xk,i.WorkflowStepService=ev,i.WorkflowTypeService=tv,i._setLatestRetryTime=dT,i.addAsset=zl,i.addAssetAttachment=Ic,i.addAssetAttachments=Rs,i.addAssetProcedure=Jr,i.addAssetProcedureStep=gl,i.addAssetProcedureStepFieldValues=dl,i.addAssetProcedureStepFieldValuesAttachment=Jd,i.addAssetProcedureStepFieldValuesAttachments=Qs,i.addAssetProcedureStepFieldValuesMany=ll,i.addAssetProcedureStepFields=zd,i.addAssetProcedureStepFieldsAttachment=Od,i.addAssetProcedureStepFieldsAttachments=Fd,i.addAssetProcedureStepFieldsMany=Dd,i.addAssetProcedureSteps=_l,i.addAssetProcedureType=dd,i.addAssetProcedureTypeAttachment=Wc,i.addAssetProcedureTypeAttachments=Bc,i.addAssetProcedureTypeFieldValues=Br,i.addAssetProcedureTypeFieldValuesAttachment=Or,i.addAssetProcedureTypeFieldValuesAttachments=Ds,i.addAssetProcedureTypeFieldValuesMany=zr,i.addAssetProcedureTypeFields=dr,i.addAssetProcedureTypeFieldsAttachment=Yc,i.addAssetProcedureTypeFieldsAttachments=Jc,i.addAssetProcedureTypeFieldsMany=lr,i.addAssetProcedureTypes=ld,i.addAssetProcedures=Us,i.addAssetStage=hu,i.addAssetStageCompletion=Jl,i.addAssetStageCompletions=Zl,i.addAssetStages=pu,i.addAssetType=mh,i.addAssetTypeAttachment=Fu,i.addAssetTypeAttachments=oi,i.addAssetTypeFieldValues=go,i.addAssetTypeFieldValuesAttachment=oo,i.addAssetTypeFieldValuesAttachments=Ai,i.addAssetTypeFieldValuesMany=_o,i.addAssetTypeFields=Zu,i.addAssetTypeFieldsAttachment=zu,i.addAssetTypeFieldsAttachments=Du,i.addAssetTypeFieldsMany=Qu,i.addAssetTypeIdentifier=qo,i.addAssetTypeIdentifierValue=Xo,i.addAssetTypeIdentifierValues=xo,i.addAssetTypeIdentifiers=jo,i.addAssetTypeStatus=Ph,i.addAssetTypeStatuses=bh,i.addAssetTypes=fh,i.addAssets=ni,i.addConversation=fc,i.addConversations=sb,i.addDocument=ip,i.addDocumentAttachment=Lh,i.addDocumentAttachments=Nh,i.addDocuments=np,i.addEmailDomain=Sp,i.addEmailDomains=Ap,i.addForm=Em,i.addFormIdentifier=Wp,i.addFormIdentifierValue=Yp,i.addFormIdentifierValues=Jp,i.addFormIdentifiers=Bp,i.addFormRevision=Ci,i.addFormRevisionAttachment=dm,i.addFormRevisionAttachments=lm,i.addFormRevisions=Ui,i.addFormSubmission=rf,i.addFormSubmissionAttachment=Hm,i.addFormSubmissionAttachments=Ji,i.addFormSubmissions=tn,i.addForms=Vm,i.addGeoImage=Tf,i.addGeoImages=If,i.addIssue=By,i.addIssueAssociation=zf,i.addIssueAssociations=St,i.addIssueAttachment=Jf,i.addIssueAttachments=ln,i.addIssueComment=Oy,i.addIssueCommentAttachment=dy,i.addIssueCommentAttachments=ly,i.addIssueComments=Fy,i.addIssueType=DA,i.addIssueTypeAttachment=Yy,i.addIssueTypeAttachments=Jy,i.addIssueTypeFieldValues=OS,i.addIssueTypeFieldValuesAttachment=ZS,i.addIssueTypeFieldValuesAttachments=Pn,i.addIssueTypeFieldValuesMany=FS,i.addIssueTypeFields=zS,i.addIssueTypeFieldsAttachment=dS,i.addIssueTypeFieldsAttachments=lS,i.addIssueTypeFieldsMany=DS,i.addIssueTypeIdentifier=lA,i.addIssueTypeIdentifierValue=FA,i.addIssueTypeIdentifierValues=gA,i.addIssueTypeIdentifiers=uA,i.addIssueTypeStatus=QA,i.addIssueTypeStatuses=XA,i.addIssueTypes=qA,i.addIssueUpdate=qn,i.addIssueUpdates=jn,i.addIssues=Sn,i.addOrganization=Yw,i.addOrganizationAccess=vw,i.addOrganizationAccesses=Ew,i.addOrganizations=Kw,i.addProject=iI,i.addProjectAccess=hT,i.addProjectAccesses=pT,i.addProjectAttachment=_T,i.addProjectAttachments=PT,i.addProjectFile=CT,i.addProjectFiles=UT,i.addProjects=sI,i.addTeam=MI,i.addTeamMembership=fI,i.addTeamMemberships=yI,i.addTeams=kI,i.addUser=Gn,i.addUsers=Ow,i.addWorkflow=GI,i.addWorkflowIssueLink=aO,i.addWorkflowIssueLinks=Dt,i.addWorkflowStep=O_,i.addWorkflowStepAssignee=TO,i.addWorkflowStepAssignees=IO,i.addWorkflowStepComment=WO,i.addWorkflowStepComments=BO,i.addWorkflowStepDefaultAssignee=YO,i.addWorkflowStepDefaultAssignees=JO,i.addWorkflowStepDefaultReviewer=dF,i.addWorkflowStepDefaultReviewers=lF,i.addWorkflowStepEvent=OF,i.addWorkflowStepEvents=FF,i.addWorkflowStepFieldValues=Og,i.addWorkflowStepFieldValuesAttachment=lg,i.addWorkflowStepFieldValuesAttachments=Oa,i.addWorkflowStepFieldValuesMany=Fg,i.addWorkflowStepFieldValuesReview=Jg,i.addWorkflowStepFieldValuesReviewRequest=zg,i.addWorkflowStepFieldValuesReviewRequests=ba,i.addWorkflowStepFieldValuesReviews=ka,i.addWorkflowStepFields=JF,i.addWorkflowStepFieldsAttachment=zF,i.addWorkflowStepFieldsAttachments=Sa,i.addWorkflowStepFieldsMany=ZF,i.addWorkflowStepReviewer=d_,i.addWorkflowStepReviewers=l_,i.addWorkflowSteps=F_,i.addWorkflowType=z_,i.addWorkflowTypes=D_,i.addWorkflows=HI,i.agentsReducer=Ac,i.agentsSlice=_s,i.areArraysEqual=zP,i.assetAttachmentReducer=vc,i.assetAttachmentSlice=bs,i.assetProcedureReducer=td,i.assetProcedureSlice=Cs,i.assetProcedureStepFieldValuesAttachmentReducer=al,i.assetProcedureStepFieldValuesAttachmentSlice=Zs,i.assetProcedureStepFieldValuesReducer=wl,i.assetProcedureStepFieldValuesSlice=ei,i.assetProcedureStepFieldsAttachmentReducer=Vd,i.assetProcedureStepFieldsAttachmentSlice=Hs,i.assetProcedureStepFieldsReducer=Hd,i.assetProcedureStepFieldsSlice=Ys,i.assetProcedureStepReducer=kl,i.assetProcedureStepSlice=ti,i.assetProcedureTypeAttachmentReducer=Uc,i.assetProcedureTypeAttachmentSlice=vs,i.assetProcedureTypeFieldValuesAttachmentReducer=Rr,i.assetProcedureTypeFieldValuesAttachmentSlice=zs,i.assetProcedureTypeFieldValuesReducer=Lr,i.assetProcedureTypeFieldValuesSlice=$s,i.assetProcedureTypeFieldsAttachmentReducer=sr,i.assetProcedureTypeFieldsAttachmentSlice=Vs,i.assetProcedureTypeFieldsReducer=yr,i.assetProcedureTypeFieldsSlice=Bs,i.assetProcedureTypeReducer=yd,i.assetProcedureTypeSlice=Ns,i.assetReducer=Hl,i.assetSlice=ii,i.assetStageCompletionReducer=iu,i.assetStageCompletionSlice=ci,i.assetStageReducer=Au,i.assetStageSlice=ri,i.assetTypeAttachmentReducer=Vu,i.assetTypeAttachmentSlice=ui,i.assetTypeFieldValuesAttachmentReducer=Io,i.assetTypeFieldValuesAttachmentSlice=Si,i.assetTypeFieldValuesReducer=Bo,i.assetTypeFieldValuesSlice=Ii,i.assetTypeFieldsAttachmentReducer=Ku,i.assetTypeFieldsAttachmentSlice=mi,i.assetTypeFieldsReducer=ro,i.assetTypeFieldsSlice=yi,i.assetTypeIdentifierReducer=Jo,i.assetTypeIdentifierSlice=Oi,i.assetTypeIdentifierValueReducer=lh,i.assetTypeIdentifierValueSlice=gi,i.assetTypeReducer=Fh,i.assetTypeSlice=_i,i.assetTypeStatusReducer=Dh,i.assetTypeStatusSlice=bi,i.assetTypeStatusSortFn=lc,i.authReducer=$h,i.authSlice=is,i.baseReducer=pM,i.baseReducers=Da,i.clearTokens=$b,i.createModelAdapter=F,i.createOfflineAction=nT,i.createPayload=b,i.createSelectionAdapter=VP,i.deleteAsset=jl,i.deleteAssetAttachment=Pc,i.deleteAssetAttachments=Ms,i.deleteAssetProcedure=Xr,i.deleteAssetProcedureStep=Rl,i.deleteAssetProcedureStepFieldValues=ml,i.deleteAssetProcedureStepFieldValuesAttachment=el,i.deleteAssetProcedureStepFieldValuesAttachments=Xs,i.deleteAssetProcedureStepFieldValuesMany=fl,i.deleteAssetProcedureStepFields=Ud,i.deleteAssetProcedureStepFieldsAttachment=Rd,i.deleteAssetProcedureStepFieldsAttachments=Md,i.deleteAssetProcedureStepFieldsMany=Ld,i.deleteAssetProcedureSteps=Ml,i.deleteAssetProcedureType=hd,i.deleteAssetProcedureTypeAttachment=$c,i.deleteAssetProcedureTypeAttachments=Cc,i.deleteAssetProcedureTypeFieldValues=Cr,i.deleteAssetProcedureTypeFieldValuesAttachment=br,i.deleteAssetProcedureTypeFieldValuesAttachments=qs,i.deleteAssetProcedureTypeFieldValuesMany=Ur,i.deleteAssetProcedureTypeFields=mr,i.deleteAssetProcedureTypeFieldsAttachment=er,i.deleteAssetProcedureTypeFieldsAttachments=tr,i.deleteAssetProcedureTypeFieldsMany=fr,i.deleteAssetProcedureTypes=pd,i.deleteAssetProcedures=Ls,i.deleteAssetStage=yu,i.deleteAssetStageCompletion=tu,i.deleteAssetStageCompletions=su,i.deleteAssetStages=Su,i.deleteAssetType=Ah,i.deleteAssetTypeAttachment=Ru,i.deleteAssetTypeAttachments=hi,i.deleteAssetTypeFieldValues=ko,i.deleteAssetTypeFieldValuesAttachment=yo,i.deleteAssetTypeFieldValuesAttachments=wi,i.deleteAssetTypeFieldValuesMany=vo,i.deleteAssetTypeFields=so,i.deleteAssetTypeFieldsAttachment=Uu,i.deleteAssetTypeFieldsAttachments=Lu,i.deleteAssetTypeFieldsMany=io,i.deleteAssetTypeIdentifier=No,i.deleteAssetTypeIdentifierValue=nh,i.deleteAssetTypeIdentifierValues=ah,i.deleteAssetTypeIdentifiers=Go,i.deleteAssetTypeStatus=Eh,i.deleteAssetTypeStatuses=Vh,i.deleteAssetTypes=wh,i.deleteAssets=ai,i.deleteConversation=ab,i.deleteConversations=cb,i.deleteDocument=lp,i.deleteDocumentAttachment=Jh,i.deleteDocumentAttachments=Zh,i.deleteDocuments=up,i.deleteEmailDomain=Fp,i.deleteEmailDomains=gp,i.deleteForm=qm,i.deleteFormIdentifier=$p,i.deleteFormIdentifierValue=em,i.deleteFormIdentifierValues=tm,i.deleteFormIdentifiers=Cp,i.deleteFormRevision=Li,i.deleteFormRevisionAttachment=mm,i.deleteFormRevisionAttachments=fm,i.deleteFormRevisions=Ni,i.deleteFormSubmission=uf,i.deleteFormSubmissionAttachment=Qm,i.deleteFormSubmissionAttachments=Zi,i.deleteFormSubmissions=sn,i.deleteForms=jm,i.deleteGeoImage=gf,i.deleteGeoImages=_f,i.deleteIssue=$y,i.deleteIssueAssociation=Df,i.deleteIssueAssociations=At,i.deleteIssueAttachment=ey,i.deleteIssueAttachments=un,i.deleteIssueComment=Ry,i.deleteIssueCommentAttachment=my,i.deleteIssueCommentAttachments=fy,i.deleteIssueComments=My,i.deleteIssueType=LA,i.deleteIssueTypeAttachment=eS,i.deleteIssueTypeAttachments=tS,i.deleteIssueTypeFieldValues=RS,i.deleteIssueTypeFieldValuesAttachment=tA,i.deleteIssueTypeFieldValuesAttachments=bn,i.deleteIssueTypeFieldValuesMany=MS,i.deleteIssueTypeFields=US,i.deleteIssueTypeFieldsAttachment=mS,i.deleteIssueTypeFieldsAttachments=fS,i.deleteIssueTypeFieldsMany=LS,i.deleteIssueTypeIdentifier=fA,i.deleteIssueTypeIdentifierValue=MA,i.deleteIssueTypeIdentifierValues=kA,i.deleteIssueTypeIdentifiers=yA,i.deleteIssueTypeStatus=iw,i.deleteIssueTypeStatuses=nw,i.deleteIssueTypes=NA,i.deleteIssueUpdate=$n,i.deleteIssueUpdates=Cn,i.deleteIssues=An,i.deleteOrganization=Qw,i.deleteOrganizationAccess=Dw,i.deleteOrganizationAccesses=qw,i.deleteOrganizations=Xw,i.deleteProject=cI,i.deleteProjectAccess=AT,i.deleteProjectAccesses=wT,i.deleteProjectAttachment=vT,i.deleteProjectAttachments=ET,i.deleteProjectFile=GT,i.deleteProjectFiles=HT,i.deleteProjects=rI,i.deleteTeam=BI,i.deleteTeamMembership=II,i.deleteTeamMemberships=OI,i.deleteTeams=zI,i.deleteUser=Hn,i.deleteUsers=_w,i.deleteWorkflow=QI,i.deleteWorkflowIssueLink=uO,i.deleteWorkflowIssueLinks=qt,i.deleteWorkflowStep=R_,i.deleteWorkflowStepAssignee=PO,i.deleteWorkflowStepAssignees=bO,i.deleteWorkflowStepComment=$O,i.deleteWorkflowStepComments=CO,i.deleteWorkflowStepDefaultAssignee=eF,i.deleteWorkflowStepDefaultAssignees=tF,i.deleteWorkflowStepDefaultReviewer=mF,i.deleteWorkflowStepDefaultReviewers=fF,i.deleteWorkflowStepEvent=RF,i.deleteWorkflowStepEvents=MF,i.deleteWorkflowStepFieldValues=Rg,i.deleteWorkflowStepFieldValuesAttachment=mg,i.deleteWorkflowStepFieldValuesAttachments=Fa,i.deleteWorkflowStepFieldValuesMany=Mg,i.deleteWorkflowStepFieldValuesReview=e_,i.deleteWorkflowStepFieldValuesReviewRequest=Cg,i.deleteWorkflowStepFieldValuesReviewRequests=Ra,i.deleteWorkflowStepFieldValuesReviews=va,i.deleteWorkflowStepFields=tg,i.deleteWorkflowStepFieldsAttachment=CF,i.deleteWorkflowStepFieldsAttachments=Aa,i.deleteWorkflowStepFieldsMany=sg,i.deleteWorkflowStepReviewer=m_,i.deleteWorkflowStepReviewers=f_,i.deleteWorkflowSteps=M_,i.deleteWorkflowType=U_,i.deleteWorkflowTypes=L_,i.deleteWorkflows=XI,i.dequeue=nP,i.discard=cP,i.documentAttachmentReducer=ep,i.documentAttachmentSlice=Mi,i.documentSlice=vi,i.documentsReducer=op,i.downloadFile=NP,i.emailDomainsReducer=Rp,i.emailDomainsSlice=Vi,i.emailRegex=XP,i.enqueue=iP,i.enqueueRequest=cT,i.extractResponseFromError=dP,i.fallbackToEmptyArray=A,i.fallbackToEmptyObject=Ht,i.fetchBlobFromObjectUrl=sc,i.fetchFileFromObjectUrl=ic,i.fileReducer=vp,i.fileSlice=Bi,i.formIdentifierReducer=Gp,i.formIdentifierSlice=zi,i.formIdentifierValueReducer=am,i.formIdentifierValueSlice=qi,i.formReducer=$m,i.formRevisionAttachmentReducer=wm,i.formRevisionAttachmentSlice=ji,i.formRevisionReducer=Mm,i.formRevisionsSlice=$i,i.formSlice=Hi,i.formSubmissionAttachmentReducer=tf,i.formSubmissionAttachmentSlice=Yi,i.formSubmissionReducer=ff,i.formSubmissionSlice=en,i.geoImageReducer=Mf,i.geoImageSlice=an,i.getAssetProcedureStepSubTree=dc,i.getAssetProcedureStepTrees=xP,i.getClientSDK=pP,i.getClientStore=Mt,i.getDocumentSubTree=hc,i.getDocumentTrees=eb,i.getFileExtension=tc,i.getLocalDateString=ec,i.getLocalRelativeDateString=$P,i.getOutboxCoordinator=Ot,i.getRenamedFile=LP,i.getRequestDescription=w,i.getS3FileKey=UP,i.hashFile=Kt,i.initSDK=iv,i.initializeAssetAttachments=Tc,i.initializeAssetProcedureStepFieldValues=rl,i.initializeAssetProcedureStepFieldValuesAttachments=Yd,i.initializeAssetProcedureStepFields=Bd,i.initializeAssetProcedureStepFieldsAttachments=Id,i.initializeAssetProcedureSteps=Il,i.initializeAssetProcedureTypeAttachments=Vc,i.initializeAssetProcedureTypeFieldValues=Wr,i.initializeAssetProcedureTypeFieldValuesAttachments=Ir,i.initializeAssetProcedureTypeFields=rr,i.initializeAssetProcedureTypeFieldsAttachments=Kc,i.initializeAssetProcedureTypes=rd,i.initializeAssetProcedures=Yr,i.initializeAssetStageCompletions=Yl,i.initializeAssetStages=lu,i.initializeAssetTypeAttachments=Ou,i.initializeAssetTypeFieldValues=Fo,i.initializeAssetTypeFieldValuesAttachments=uo,i.initializeAssetTypeFields=Ju,i.initializeAssetTypeFieldsAttachments=Bu,i.initializeAssetTypeIdentifierValues=Qo,i.initializeAssetTypeIdentifiers=Do,i.initializeAssetTypeStatuses=_h,i.initializeAssetTypes=oh,i.initializeAssets=Bl,i.initializeConversations=mc,i.initializeDocumentAttachments=Uh,i.initializeDocuments=sp,i.initializeEmailDomains=yp,i.initializeFormIdentifierValues=Kp,i.initializeFormIdentifiers=Vp,i.initializeFormRevisionAttachments=rm,i.initializeFormRevisions=Im,i.initializeFormSubmissionAttachments=Gm,i.initializeFormSubmissions=nf,i.initializeForms=vm,i.initializeGeoImages=Sf,i.initializeIssueAssociations=vf,i.initializeIssueAttachments=Yf,i.initializeIssueCommentAttachments=ry,i.initializeIssueComments=Iy,i.initializeIssueTypeAttachments=Ky,i.initializeIssueTypeFieldValues=IS,i.initializeIssueTypeFieldValuesAttachments=JS,i.initializeIssueTypeFields=BS,i.initializeIssueTypeFieldsAttachments=rS,i.initializeIssueTypeIdentifierValues=OA,i.initializeIssueTypeIdentifiers=dA,i.initializeIssueTypeStatuses=ZA,i.initializeIssueTypes=zA,i.initializeIssueUpdates=lw,i.initializeIssues=Wy,i.initializeOrganizationAccesses=kw,i.initializeOrganizations=Nw,i.initializeProjectAccesses=oT,i.initializeProjectAttachments=gT,i.initializeProjectFiles=qT,i.initializeProjects=xT,i.initializeTeamMemberships=mI,i.initializeTeams=RI,i.initializeUsers=ww,i.initializeWorkflowIssueLinks=nO,i.initializeWorkflowStepAssignees=wO,i.initializeWorkflowStepComments=VO,i.initializeWorkflowStepDefaultAssignees=KO,i.initializeWorkflowStepDefaultReviewers=rF,i.initializeWorkflowStepEvents=IF,i.initializeWorkflowStepFieldValues=Ig,i.initializeWorkflowStepFieldValuesAttachments=dg,i.initializeWorkflowStepFieldValuesReviewRequests=Bg,i.initializeWorkflowStepFieldValuesReviews=Yg,i.initializeWorkflowStepFields=YF,i.initializeWorkflowStepFieldsAttachments=BF,i.initializeWorkflowStepReviewers=r_,i.initializeWorkflowSteps=I_,i.initializeWorkflowTypes=B_,i.initializeWorkflows=NI,i.isImageFile=GP,i.isObjectUrl=nc,i.isToday=jP,i.issueAssociationReducer=Hf,i.issueAssociationSlice=rn,i.issueAttachmentReducer=ay,i.issueAttachmentSlice=dn,i.issueCommentAttachmentReducer=wy,i.issueCommentAttachmentSlice=hn,i.issueCommentReducer=Ey,i.issueCommentSlice=mn,i.issueReducer=Gy,i.issueSlice=yn,i.issueTypeAttachmentReducer=aS,i.issueTypeAttachmentSlice=wn,i.issueTypeFieldValuesAttachmentReducer=cA,i.issueTypeFieldValuesAttachmentSlice=_n,i.issueTypeFieldValuesReducer=VS,i.issueTypeFieldValuesSlice=Fn,i.issueTypeFieldsAttachmentReducer=wS,i.issueTypeFieldsAttachmentSlice=In,i.issueTypeFieldsReducer=KS,i.issueTypeFieldsSlice=gn,i.issueTypeIdentifierReducer=TA,i.issueTypeIdentifierSlice=Mn,i.issueTypeIdentifierValueReducer=WA,i.issueTypeIdentifierValueSlice=vn,i.issueTypeReducer=YA,i.issueTypeSlice=En,i.issueTypeStatusReducer=rw,i.issueTypeStatusSlice=Wn,i.issueTypeStatusSortFn=uc,i.issueUpdateReducer=Sw,i.issueUpdateSlice=Dn,i.logOnlyOnce=HP,i.markAsDeleted=rT,i.markForDeletion=FR,i.memoize=Os,i.organizationAccessReducer=jw,i.organizationAccessSlice=Yn,i.organizationReducer=iT,i.organizationSlice=Jn,i.outboxReducer=lT,i.outboxSlice=Zn,i.overmapEnhancer=OM,i.overmapReducer=mM,i.overmapReducers=Y_,i.performRequest=$a,i.performRequestFromAction=aP,i.projectAccessReducer=TT,i.projectAccessSlice=Qn,i.projectAttachmentReducer=zT,i.projectAttachmentSlice=xn,i.projectFileReducer=QT,i.projectFileSlice=ta,i.projectReducer=dI,i.projectSlice=sa,i.rehydratedReducer=hI,i.rehydratedSlice=ia,i.restructureSelectorWithArgs=S,i.runMiddleware=SP,i.selectAccessToken=Cb,i.selectAccessesByUserOfProject=_R,i.selectAccessibleProjects=RR,i.selectActiveOrganizationAccess=wR,i.selectAllDocumentAttachments=ki,i.selectAssetAttachmentById=Rc,i.selectAssetAttachmentMapping=bc,i.selectAssetAttachments=ks,i.selectAssetAttachmentsByIds=Mc,i.selectAssetById=Nl,i.selectAssetProcedureById=nd,i.selectAssetProcedureStepById=vl,i.selectAssetProcedureStepFieldValues=Vt,i.selectAssetProcedureStepFieldValuesAttachmentById=sl,i.selectAssetProcedureStepFieldValuesAttachments=xs,i.selectAssetProcedureStepFieldValuesAttachmentsByIds=il,i.selectAssetProcedureStepFieldValuesAttachmentsMapping=tl,i.selectAssetProcedureStepFieldValuesById=Sl,i.selectAssetProcedureStepFieldValuesByIds=Al,i.selectAssetProcedureStepFieldValuesMapping=yl,i.selectAssetProcedureStepFieldValuesOfAsset=Ib,i.selectAssetProcedureStepFieldValuesOfAssetProcedure=Ob,i.selectAssetProcedureStepFieldValuesOfAssetProcedureStep=Fb,i.selectAssetProcedureStepFields=Xt,i.selectAssetProcedureStepFieldsAttachmentById=vd,i.selectAssetProcedureStepFieldsAttachments=Ks,i.selectAssetProcedureStepFieldsAttachmentsByIds=Ed,i.selectAssetProcedureStepFieldsAttachmentsMapping=kd,i.selectAssetProcedureStepFieldsById=Nd,i.selectAssetProcedureStepFieldsByIds=Gd,i.selectAssetProcedureStepFieldsMapping=Js,i.selectAssetProcedureStepFieldsOfAssetProcedureStep=Ab,i.selectAssetProcedureStepMapping=xt,i.selectAssetProcedureSteps=si,i.selectAssetProcedureStepsByIds=El,i.selectAssetProcedureStepsMappingOfAssetProcedureType=gb,i.selectAssetProcedureStepsOfAssetProcedureType=_b,i.selectAssetProcedureTypeAttachmentById=Nc,i.selectAssetProcedureTypeAttachmentMapping=Lc,i.selectAssetProcedureTypeAttachments=Es,i.selectAssetProcedureTypeAttachmentsByIds=Gc,i.selectAssetProcedureTypeById=Ad,i.selectAssetProcedureTypeFieldValues=Zt,i.selectAssetProcedureTypeFieldValuesAttachmentById=kr,i.selectAssetProcedureTypeFieldValuesAttachments=js,i.selectAssetProcedureTypeFieldValuesAttachmentsByIds=vr,i.selectAssetProcedureTypeFieldValuesAttachmentsMapping=Mr,i.selectAssetProcedureTypeFieldValuesById=Gr,i.selectAssetProcedureTypeFieldValuesByIds=Hr,i.selectAssetProcedureTypeFieldValuesMapping=Nr,i.selectAssetProcedureTypeFieldValuesOfAsset=pb,i.selectAssetProcedureTypeFields=Jt,i.selectAssetProcedureTypeFieldsAttachmentById=nr,i.selectAssetProcedureTypeFieldsAttachments=Ws,i.selectAssetProcedureTypeFieldsAttachmentsByIds=ar,i.selectAssetProcedureTypeFieldsAttachmentsMapping=ir,i.selectAssetProcedureTypeFieldsById=Ar,i.selectAssetProcedureTypeFieldsByIds=wr,i.selectAssetProcedureTypeFieldsMapping=Sr,i.selectAssetProcedureTypeFieldsOfAssetProcedureType=ob,i.selectAssetProcedureTypes=Gs,i.selectAssetProcedureTypesByIds=wd,i.selectAssetProcedureTypesMapping=Sd,i.selectAssetProcedureTypesOfOrganization=yb,i.selectAssetProcedures=Qt,i.selectAssetProceduresByIds=ad,i.selectAssetProceduresMapping=sd,i.selectAssetProceduresOfAssetProcedureType=id,i.selectAssetProceduresOfAssetType=fb,i.selectAssetStageById=wu,i.selectAssetStageCompletionById=cu,i.selectAssetStageCompletionMapping=nu,i.selectAssetStageCompletions=au,i.selectAssetStageCompletionsByIds=ru,i.selectAssetStages=li,i.selectAssetStagesByIds=Tu,i.selectAssetStagesMappingOfAssetProcedureType=bb,i.selectAssetStagesOfAssetProcedureType=Rb,i.selectAssetTypeAttachmentById=ku,i.selectAssetTypeAttachmentMapping=Mu,i.selectAssetTypeAttachments=pi,i.selectAssetTypeAttachmentsByIds=vu,i.selectAssetTypeById=Ih,i.selectAssetTypeFieldValues=ts,i.selectAssetTypeFieldValuesAttachmentById=Ao,i.selectAssetTypeFieldValuesAttachments=Ti,i.selectAssetTypeFieldValuesAttachmentsByIds=wo,i.selectAssetTypeFieldValuesAttachmentsMapping=So,i.selectAssetTypeFieldValuesById=Vo,i.selectAssetTypeFieldValuesByIds=Wo,i.selectAssetTypeFieldValuesMapping=Eo,i.selectAssetTypeFieldValuesOfAsset=Eb,i.selectAssetTypeFields=Wt,i.selectAssetTypeFieldsAttachmentById=Gu,i.selectAssetTypeFieldsAttachments=fi,i.selectAssetTypeFieldsAttachmentsByIds=Hu,i.selectAssetTypeFieldsAttachmentsMapping=Nu,i.selectAssetTypeFieldsById=ao,i.selectAssetTypeFieldsByIds=co,i.selectAssetTypeFieldsMapping=no,i.selectAssetTypeFieldsOfAssetType=kb,i.selectAssetTypeIdentifierById=Ko,i.selectAssetTypeIdentifierMapping=Ho,i.selectAssetTypeIdentifierValueById=rh,i.selectAssetTypeIdentifierValueMapping=ch,i.selectAssetTypeIdentifierValues=ss,i.selectAssetTypeIdentifierValuesByIds=dh,i.selectAssetTypeIdentifierValuesOfAsset=Bb,i.selectAssetTypeIdentifierValuesOfIdentifier=zb,i.selectAssetTypeIdentifiers=Fi,i.selectAssetTypeIdentifiersByIds=Yo,i.selectAssetTypeIdentifiersOfAssetType=Wb,i.selectAssetTypeStatusById=Bh,i.selectAssetTypeStatusMapping=Wh,i.selectAssetTypeStatuses=Ri,i.selectAssetTypeStatusesByIds=zh,i.selectAssetTypeStatusesOfAssetType=qb,i.selectAssetTypeValuesOfAssetType=Vb,i.selectAssetTypes=Pi,i.selectAssetTypesByIds=Oh,i.selectAssetTypesMapping=Th,i.selectAssetTypesOfOrganization=Db,i.selectAssets=es,i.selectAssetsByIds=Gl,i.selectAssetsMapping=Ul,i.selectAssetsOfAssetType=Ll,i.selectAssetsOfProject=Pb,i.selectAttachmentsOfAsset=kc,i.selectAttachmentsOfAssetProcedureStepFieldValues=nl,i.selectAttachmentsOfAssetProcedureStepFields=Sb,i.selectAttachmentsOfAssetProcedureType=lb,i.selectAttachmentsOfAssetProcedureTypeFieldValues=Er,i.selectAttachmentsOfAssetProcedureTypeFields=ub,i.selectAttachmentsOfAssetType=Eu,i.selectAttachmentsOfAssetTypeFieldValues=To,i.selectAttachmentsOfAssetTypeFields=Mb,i.selectAttachmentsOfDocument=Lb,i.selectAttachmentsOfFormRevision=xb,i.selectAttachmentsOfFormSubmission=ef,i.selectAttachmentsOfIssue=sy,i.selectAttachmentsOfIssueComment=iR,i.selectAttachmentsOfIssueType=cR,i.selectAttachmentsOfIssueTypeFieldValues=aA,i.selectAttachmentsOfIssueTypeFields=rR,i.selectAttachmentsOfProject=bR,i.selectAttachmentsOfWorkflowStepFieldValues=Ag,i.selectAttachmentsOfWorkflowStepFields=LF,i.selectCommentsOfIssue=nR,i.selectConversation=db,i.selectConversationMapping=Ps,i.selectConversations=rb,i.selectCurrentUser=bw,i.selectDeletedRequests=IR,i.selectDescendantsOfAssetProcedureStep=Vl,i.selectDescendantsOfDocument=mp,i.selectDocumentAttachmentById=Xh,i.selectDocumentAttachmentMapping=Qh,i.selectDocumentAttachmentsByIds=xh,i.selectDocumentById=hp,i.selectDocuments=ns,i.selectDocumentsByIds=pp,i.selectDocumentsMapping=Ei,i.selectEmailDomainById=Pp,i.selectEmailDomains=Wi,i.selectEmailDomainsAsMapping=_p,i.selectEmailDomainsByIds=bp,i.selectEmailDomainsOfOrganization=Hb,i.selectFieldValuesOfAssetProcedure=mb,i.selectFormById=Um,i.selectFormIdentifierById=Lp,i.selectFormIdentifierMapping=Up,i.selectFormIdentifierValueById=im,i.selectFormIdentifierValueMapping=sm,i.selectFormIdentifierValues=as,i.selectFormIdentifierValuesByIds=nm,i.selectFormIdentifierValuesOfFormSubmission=Qb,i.selectFormIdentifierValuesOfIdentifier=Xb,i.selectFormIdentifiers=Di,i.selectFormIdentifiersByIds=Np,i.selectFormIdentifiersOfForm=Zb,i.selectFormMapping=Cm,i.selectFormRevisionAttachmentById=Sm,i.selectFormRevisionAttachments=ym,i.selectFormRevisionAttachmentsByIds=Am,i.selectFormRevisionAttachmentsMapping=cs,i.selectFormRevisionById=Pm,i.selectFormRevisionMapping=Gi,i.selectFormRevisions=rs,i.selectFormRevisionsByIds=bm,i.selectFormRevisionsOfForm=Rm,i.selectFormSubmissionAttachemntsByIds=xi,i.selectFormSubmissionAttachmentById=Xm,i.selectFormSubmissionAttachments=Xi,i.selectFormSubmissionAttachmentsByIds=xm,i.selectFormSubmissionAttachmentsMapping=Qi,i.selectFormSubmissionById=hf,i.selectFormSubmissions=of,i.selectFormSubmissionsByIds=pf,i.selectFormSubmissionsMapping=nn,i.selectFormSubmissionsOfForm=mf,i.selectForms=Ki,i.selectFormsByIds=Lm,i.selectFormsOfOrganization=tR,i.selectGeoImageById=bf,i.selectGeoImageMapping=Pf,i.selectGeoImages=cn,i.selectGeoImagesByIds=Rf,i.selectGeoImagesOfProject=sR,i.selectIsLoggedIn=Ub,i.selectIssueAssociationById=jf,i.selectIssueAssociationMapping=qf,i.selectIssueAssociations=wt,i.selectIssueAssociationsByIds=$f,i.selectIssueAssociationsOfAsset=Gf,i.selectIssueAssociationsOfIssue=Nf,i.selectIssueAssociationsOfIssues=Lf,i.selectIssueAssociationsToIssue=Cf,i.selectIssueAssociationsToIssues=Uf,i.selectIssueAttachmentById=iy,i.selectIssueAttachmentMapping=ty,i.selectIssueAttachments=on,i.selectIssueAttachmentsByIds=ny,i.selectIssueById=Uy,i.selectIssueCommentAttachmentById=Sy,i.selectIssueCommentAttachmentMapping=yy,i.selectIssueCommentAttachments=pn,i.selectIssueCommentAttachmentsByIds=Ay,i.selectIssueCommentById=ky,i.selectIssueCommentMapping=fn,i.selectIssueCommentsByIds=vy,i.selectIssueMapping=Cy,i.selectIssueTypeAttachmentById=iS,i.selectIssueTypeAttachmentMapping=sS,i.selectIssueTypeAttachments=Tn,i.selectIssueTypeAttachmentsByIds=nS,i.selectIssueTypeById=HA,i.selectIssueTypeFieldValues=ls,i.selectIssueTypeFieldValuesAttachmentById=iA,i.selectIssueTypeFieldValuesAttachments=Rn,i.selectIssueTypeFieldValuesAttachmentsByIds=nA,i.selectIssueTypeFieldValuesAttachmentsMapping=sA,i.selectIssueTypeFieldValuesById=vS,i.selectIssueTypeFieldValuesByIds=ES,i.selectIssueTypeFieldValuesMapping=kS,i.selectIssueTypeFieldValuesOfIssue=dR,i.selectIssueTypeFields=Bt,i.selectIssueTypeFieldsAttachmentById=SS,i.selectIssueTypeFieldsAttachments=On,i.selectIssueTypeFieldsAttachmentsByIds=AS,i.selectIssueTypeFieldsAttachmentsMapping=yS,i.selectIssueTypeFieldsById=GS,i.selectIssueTypeFieldsByIds=HS,i.selectIssueTypeFieldsMapping=NS,i.selectIssueTypeFieldsOfIssueType=lR,i.selectIssueTypeIdentifierById=AA,i.selectIssueTypeIdentifierMapping=SA,i.selectIssueTypeIdentifierValueById=EA,i.selectIssueTypeIdentifierValueMapping=vA,i.selectIssueTypeIdentifierValues=us,i.selectIssueTypeIdentifierValuesByIds=VA,i.selectIssueTypeIdentifierValuesOfIdentifier=mR,i.selectIssueTypeIdentifierValuesOfIssue=pR,i.selectIssueTypeIdentifiers=kn,i.selectIssueTypeIdentifiersByIds=wA,i.selectIssueTypeIdentifiersOfIssueType=hR,i.selectIssueTypeMapping=GA,i.selectIssueTypeStatusById=zn,i.selectIssueTypeStatusMapping=aw,i.selectIssueTypeStatuses=Bn,i.selectIssueTypeStatusesByIds=cw,i.selectIssueTypeStatusesOfIssueType=yR,i.selectIssueTypeValuesOfIssueType=oR,i.selectIssueTypes=Vn,i.selectIssueTypesByIds=KA,i.selectIssueTypesOfOrganization=fR,i.selectIssueUpdateById=mw,i.selectIssueUpdateMapping=Un,i.selectIssueUpdates=Ln,i.selectIssueUpdatesByIds=fw,i.selectIssueUpdatesOfIssue=yw,i.selectIssues=ds,i.selectIssuesByIds=Ly,i.selectIssuesOfIssueType=Ny,i.selectIssuesOfProject=aR,i.selectLatestAssetProcedureStepFieldsOfAssetProcedureStep=wb,i.selectLatestAssetProcedureTypeFieldsOfAssetProcedureType=hb,i.selectLatestAssetTypeFieldsOfAssetType=vb,i.selectLatestFieldsByAssetProcedureStep=Tb,i.selectLatestFormRevisionOfForm=eR,i.selectLatestIssueTypeFieldsOfIssueType=uR,i.selectLatestRetryTime=OR,i.selectLatestReviewOfWorkflowStepFieldValues=aM,i.selectLatestReviewRequestOfWorkflowStepFieldValues=iM,i.selectLatestWorkflowStepFieldValuesByWorkflowStepOfWorkflow=sM,i.selectLatestWorkflowStepFieldValuesReviewByWorkflowStepFieldValues=rM,i.selectLatestWorkflowStepFieldsOfWorkflowStep=XR,i.selectMembershipsByUserOfTeam=VR,i.selectOrganizationAccessById=$w,i.selectOrganizationAccessMapping=ps,i.selectOrganizationAccessUserMapping=Uw,i.selectOrganizationAccessesByIds=Cw,i.selectOrganizationById=tT,i.selectOrganizationDocuments=Gb,i.selectOrganizations=eT,i.selectOrganizationsByIds=sT,i.selectOrganizationsMapping=xw,i.selectProjectAccessById=IT,i.selectProjectAccessMapping=Xn,i.selectProjectAccesses=zt,i.selectProjectAccessesByIds=OT,i.selectProjectAccessesOfProject=gR,i.selectProjectAttachmentById=WT,i.selectProjectAttachmentMapping=VT,i.selectProjectAttachments=ea,i.selectProjectAttachmentsByIds=BT,i.selectProjectById=uI,i.selectProjectDocuments=Nb,i.selectProjectFileById=JT,i.selectProjectFileMapping=KT,i.selectProjectFiles=YT,i.selectProjectFilesByIds=ZT,i.selectProjectMapping=lI,i.selectProjects=ms,i.selectProjectsByIds=oI,i.selectProjectsOfOrganization=MR,i.selectRehydrated=ER,i.selectReviewRequestsOfWorkflowStepFieldValues=Gg,i.selectReviewsOfWorkflowStepFieldValues=n_,i.selectStageMapping=di,i.selectTeamById=qI,i.selectTeamMembershipById=_I,i.selectTeamMemberships=fs,i.selectTeamMembershipsByIds=PI,i.selectTeamMembershipsMapping=gI,i.selectTeams=ca,i.selectTeamsByIds=jI,i.selectTeamsMapping=DI,i.selectTeamsOfOrganization=BR,i.selectUploadUrl=Jb,i.selectUserById=hs,i.selectUsers=os,i.selectUsersByIds=Rw,i.selectUsersMapping=Kn,i.selectUsersOfOrganization=TR,i.selectUsersOfProject=PR,i.selectUsersOfTeam=WR,i.selectWorkflowById=eO,i.selectWorkflowIssueLinkById=hO,i.selectWorkflowIssueLinks=_t,i.selectWorkflowIssueLinksByIds=pO,i.selectWorkflowIssueLinksMapping=oO,i.selectWorkflowIssueLinksOfIssue=yO,i.selectWorkflowIssueLinksOfIssues=jR,i.selectWorkflowIssueLinksOfWorkflow=mO,i.selectWorkflowIssueLinksOfWorkflows=fO,i.selectWorkflowMapping=xI,i.selectWorkflowStepAssigneeById=MO,i.selectWorkflowStepAssignees=jt,i.selectWorkflowStepAssigneesByIds=kO,i.selectWorkflowStepAssigneesMapping=RO,i.selectWorkflowStepAssigneesOfWorkflow=$R,i.selectWorkflowStepAssigneesOfWorkflowAndWorkflowStep=UR,i.selectWorkflowStepAssigneesOfWorkflowStep=CR,i.selectWorkflowStepById=v_,i.selectWorkflowStepCommentById=LO,i.selectWorkflowStepComments=$t,i.selectWorkflowStepCommentsByIds=NO,i.selectWorkflowStepCommentsMapping=UO,i.selectWorkflowStepCommentsOfWorkflow=LR,i.selectWorkflowStepCommentsOfWorkflowAndWorkflowStep=GR,i.selectWorkflowStepCommentsOfWorkflowStep=NR,i.selectWorkflowStepDefaultAssigneeById=iF,i.selectWorkflowStepDefaultAssignees=ha,i.selectWorkflowStepDefaultAssigneesByIds=nF,i.selectWorkflowStepDefaultAssigneesMapping=sF,i.selectWorkflowStepDefaultAssigneesOfWorkflowStep=HR,i.selectWorkflowStepDefaultReviewerById=SF,i.selectWorkflowStepDefaultReviewers=ma,i.selectWorkflowStepDefaultReviewersByIds=AF,i.selectWorkflowStepDefaultReviewersMapping=yF,i.selectWorkflowStepDefaultReviewersOfWorkflowStep=KR,i.selectWorkflowStepEventById=vF,i.selectWorkflowStepEvents=Ct,i.selectWorkflowStepEventsByIds=EF,i.selectWorkflowStepEventsMapping=kF,i.selectWorkflowStepEventsOfWorkflow=YR,i.selectWorkflowStepEventsOfWorkflowAndWorkflowStep=ZR,i.selectWorkflowStepEventsOfWorkflowStep=JR,i.selectWorkflowStepFieldValues=ft,i.selectWorkflowStepFieldValuesAttachmentById=yg,i.selectWorkflowStepFieldValuesAttachments=ga,i.selectWorkflowStepFieldValuesAttachmentsByIds=Sg,i.selectWorkflowStepFieldValuesAttachmentsMapping=fg,i.selectWorkflowStepFieldValuesById=vg,i.selectWorkflowStepFieldValuesByIds=Eg,i.selectWorkflowStepFieldValuesMapping=kg,i.selectWorkflowStepFieldValuesOfWorkflow=xR,i.selectWorkflowStepFieldValuesOfWorkflowAndWorkflowStep=tM,i.selectWorkflowStepFieldValuesOfWorkflowStep=eM,i.selectWorkflowStepFieldValuesReviewById=s_,i.selectWorkflowStepFieldValuesReviewRequestById=Lg,i.selectWorkflowStepFieldValuesReviewRequests=Ut,i.selectWorkflowStepFieldValuesReviewRequestsByIds=Ng,i.selectWorkflowStepFieldValuesReviewRequestsMapping=Ug,i.selectWorkflowStepFieldValuesReviewRequestsOfWorkflowAndWorkflowStep=nM,i.selectWorkflowStepFieldValuesReviews=Pt,i.selectWorkflowStepFieldValuesReviewsByIds=i_,i.selectWorkflowStepFieldValuesReviewsMapping=t_,i.selectWorkflowStepFieldValuesReviewsOfWorkflowAndWorkflowStep=cM,i.selectWorkflowStepFields=Ss,i.selectWorkflowStepFieldsAttachmentById=NF,i.selectWorkflowStepFieldsAttachments=wa,i.selectWorkflowStepFieldsAttachmentsByIds=GF,i.selectWorkflowStepFieldsAttachmentsMapping=UF,i.selectWorkflowStepFieldsById=ng,i.selectWorkflowStepFieldsByIds=ag,i.selectWorkflowStepFieldsMapping=ig,i.selectWorkflowStepFieldsOfWorkflowStep=QR,i.selectWorkflowStepReviewerById=S_,i.selectWorkflowStepReviewers=Lt,i.selectWorkflowStepReviewersByIds=A_,i.selectWorkflowStepReviewersMapping=y_,i.selectWorkflowStepReviewersOfWorkflow=dM,i.selectWorkflowStepReviewersOfWorkflowAndWorkflowStep=uM,i.selectWorkflowStepReviewersOfWorkflowStep=lM,i.selectWorkflowSteps=Wa,i.selectWorkflowStepsByIds=E_,i.selectWorkflowStepsMapping=k_,i.selectWorkflowStepsOfWorkflowType=oM,i.selectWorkflowTypeById=G_,i.selectWorkflowTypeMapping=N_,i.selectWorkflowTypes=za,i.selectWorkflowTypesByIds=H_,i.selectWorkflowTypesOfOrganization=hM,i.selectWorkflows=ys,i.selectWorkflowsByIds=tO,i.selectWorkflowsOfProject=DR,i.selectWorkflowsOfWorkflowType=qR,i.setAsset=$l,i.setAssetAttachment=Oc,i.setAssetAttachments=Fc,i.setAssetProcedure=xr,i.setAssetProcedureStep=Ol,i.setAssetProcedureStepFieldValues=ul,i.setAssetProcedureStepFieldValuesAttachment=Zd,i.setAssetProcedureStepFieldValuesAttachments=Qd,i.setAssetProcedureStepFieldValuesMany=ol,i.setAssetProcedureStepFields=qd,i.setAssetProcedureStepFieldsAttachment=gd,i.setAssetProcedureStepFieldsAttachments=_d,i.setAssetProcedureStepFieldsMany=jd,i.setAssetProcedureSteps=Fl,i.setAssetProcedureType=md,i.setAssetProcedureTypeAttachment=zc,i.setAssetProcedureTypeAttachments=Dc,i.setAssetProcedureTypeFieldValues=Dr,i.setAssetProcedureTypeFieldValuesAttachment=Fr,i.setAssetProcedureTypeFieldValuesAttachments=gr,i.setAssetProcedureTypeFieldValuesMany=qr,i.setAssetProcedureTypeFields=ur,i.setAssetProcedureTypeFieldsAttachment=Zc,i.setAssetProcedureTypeFieldsAttachments=Qc,i.setAssetProcedureTypeFieldsMany=or,i.setAssetProcedureTypes=fd,i.setAssetProcedures=ed,i.setAssetStage=uu,i.setAssetStageCompletion=Ql,i.setAssetStageCompletions=Xl,i.setAssetStages=ou,i.setAssetType=hh,i.setAssetTypeAttachment=gu,i.setAssetTypeAttachments=_u,i.setAssetTypeFieldValues=Po,i.setAssetTypeFieldValuesAttachment=ho,i.setAssetTypeFieldValuesAttachments=po,i.setAssetTypeFieldValuesMany=bo,i.setAssetTypeFields=Xu,i.setAssetTypeFieldsAttachment=qu,i.setAssetTypeFieldsAttachments=ju,i.setAssetTypeFieldsMany=xu,i.setAssetTypeIdentifier=$o,i.setAssetTypeIdentifierValue=eh,i.setAssetTypeIdentifierValues=th,i.setAssetTypeIdentifiers=Co,i.setAssetTypeStatus=Rh,i.setAssetTypeStatuses=Mh,i.setAssetTypes=ph,i.setAssets=Cl,i.setClientSDK=hP,i.setClientStore=uP,i.setConversation=yc,i.setConversations=ib,i.setCurrentUser=SR,i.setCurrentUserProfile=AR,i.setDocument=ap,i.setDocumentAttachment=Gh,i.setDocumentAttachments=Hh,i.setDocuments=cp,i.setEmailDomain=wp,i.setEmailDomains=Tp,i.setForm=Wm,i.setFormIdentifier=zp,i.setFormIdentifierValue=Zp,i.setFormIdentifierValues=Qp,i.setFormIdentifiers=Dp,i.setFormRevision=Om,i.setFormRevisionAttachment=um,i.setFormRevisionAttachments=om,i.setFormRevisions=Fm,i.setFormSubmission=af,i.setFormSubmissionAttachment=Km,i.setFormSubmissionAttachments=Ym,i.setFormSubmissions=cf,i.setForms=Bm,i.setGeoImage=Af,i.setGeoImages=wf,i.setIssue=zy,i.setIssueAssociation=Vf,i.setIssueAssociations=Ef,i.setIssueAttachment=Zf,i.setIssueAttachments=Qf,i.setIssueComment=gy,i.setIssueCommentAttachment=uy,i.setIssueCommentAttachments=oy,i.setIssueComments=_y,i.setIssueType=jA,i.setIssueTypeAttachment=Zy,i.setIssueTypeAttachments=Qy,i.setIssueTypeFieldValues=gS,i.setIssueTypeFieldValuesAttachment=QS,i.setIssueTypeFieldValuesAttachments=XS,i.setIssueTypeFieldValuesMany=_S,i.setIssueTypeFields=qS,i.setIssueTypeFieldsAttachment=uS,i.setIssueTypeFieldsAttachments=oS,i.setIssueTypeFieldsMany=jS,i.setIssueTypeIdentifier=oA,i.setIssueTypeIdentifierValue=_A,i.setIssueTypeIdentifierValues=PA,i.setIssueTypeIdentifiers=hA,i.setIssueTypeStatus=xA,i.setIssueTypeStatuses=ew,i.setIssueTypes=$A,i.setIssueUpdate=uw,i.setIssueUpdates=ow,i.setIssues=Dy,i.setLoggedIn=jh,i.setOrganization=Hw,i.setOrganizationAccess=Vw,i.setOrganizationAccesses=Ww,i.setOrganizations=Gw,i.setProject=tI,i.setProjectAccess=mT,i.setProjectAccesses=fT,i.setProjectAttachment=bT,i.setProjectAttachments=RT,i.setProjectFile=jT,i.setProjectFiles=$T,i.setProjects=eI,i.setRehydrated=vR,i.setTeam=vI,i.setTeamMembership=SI,i.setTeamMemberships=AI,i.setTeams=EI,i.setTokens=jb,i.setUploadUrl=Yb,i.setUser=Iw,i.setUsers=Tw,i.setWorkflow=KI,i.setWorkflowIssueLink=cO,i.setWorkflowIssueLinks=rO,i.setWorkflowStep=g_,i.setWorkflowStepAssignee=OO,i.setWorkflowStepAssignees=FO,i.setWorkflowStepComment=zO,i.setWorkflowStepComments=DO,i.setWorkflowStepDefaultAssignee=ZO,i.setWorkflowStepDefaultAssignees=QO,i.setWorkflowStepDefaultReviewer=uF,i.setWorkflowStepDefaultReviewers=oF,i.setWorkflowStepEvent=gF,i.setWorkflowStepEvents=_F,i.setWorkflowStepFieldValues=gg,i.setWorkflowStepFieldValuesAttachment=ug,i.setWorkflowStepFieldValuesAttachments=og,i.setWorkflowStepFieldValuesMany=_g,i.setWorkflowStepFieldValuesReview=Zg,i.setWorkflowStepFieldValuesReviewRequest=Dg,i.setWorkflowStepFieldValuesReviewRequests=qg,i.setWorkflowStepFieldValuesReviews=Qg,i.setWorkflowStepFields=QF,i.setWorkflowStepFieldsAttachment=DF,i.setWorkflowStepFieldsAttachments=qF,i.setWorkflowStepFieldsMany=XF,i.setWorkflowStepReviewer=u_,i.setWorkflowStepReviewers=o_,i.setWorkflowSteps=__,i.setWorkflowType=q_,i.setWorkflowTypes=j_,i.setWorkflows=YI,i.shallowEqual=BP,i.slugify=ZP,i.spacesToDashesLower=JP,i.teamMembershipReducer=FI,i.teamMembershipSlice=na,i.teamReducer=$I,i.teamSlice=aa,i.toFileNameSafeString=YP,i.toUuidArray=E,i.toUuidIdRecord=KP,i.truncate=QP,i.updateAsset=Dl,i.updateAssetAttachment=gc,i.updateAssetAttachments=_c,i.updateAssetProcedure=Zr,i.updateAssetProcedureStep=Pl,i.updateAssetProcedureStepFieldValues=hl,i.updateAssetProcedureStepFieldValuesAttachment=Xd,i.updateAssetProcedureStepFieldValuesAttachments=xd,i.updateAssetProcedureStepFieldValuesMany=pl,i.updateAssetProcedureStepFields=$d,i.updateAssetProcedureStepFieldsAttachment=Pd,i.updateAssetProcedureStepFieldsAttachments=bd,i.updateAssetProcedureStepFieldsMany=Cd,i.updateAssetProcedureSteps=bl,i.updateAssetProcedureType=ud,i.updateAssetProcedureTypeAttachment=qc,i.updateAssetProcedureTypeAttachments=jc,i.updateAssetProcedureTypeFieldValues=jr,i.updateAssetProcedureTypeFieldValuesAttachment=_r,i.updateAssetProcedureTypeFieldValuesAttachments=Pr,i.updateAssetProcedureTypeFieldValuesMany=$r,i.updateAssetProcedureTypeFields=hr,i.updateAssetProcedureTypeFieldsAttachment=Xc,i.updateAssetProcedureTypeFieldsAttachments=xc,i.updateAssetProcedureTypeFieldsMany=pr,i.updateAssetProcedureTypes=od,i.updateAssetProcedures=Qr,i.updateAssetStage=mu,i.updateAssetStageCompletion=xl,i.updateAssetStageCompletions=eu,i.updateAssetStages=fu,i.updateAssetType=yh,i.updateAssetTypeAttachment=Pu,i.updateAssetTypeAttachments=bu,i.updateAssetTypeFieldValues=Ro,i.updateAssetTypeFieldValuesAttachment=mo,i.updateAssetTypeFieldValuesAttachments=fo,i.updateAssetTypeFieldValuesMany=Mo,i.updateAssetTypeFields=eo,i.updateAssetTypeFieldsAttachment=$u,i.updateAssetTypeFieldsAttachments=Cu,i.updateAssetTypeFieldsMany=to,i.updateAssetTypeIdentifier=Uo,i.updateAssetTypeIdentifierValue=sh,i.updateAssetTypeIdentifierValues=ih,i.updateAssetTypeIdentifiers=Lo,i.updateAssetTypeStatus=kh,i.updateAssetTypeStatuses=vh,i.updateAssetTypes=Sh,i.updateAssets=ql,i.updateConversation=Sc,i.updateConversations=nb,i.updateDocument=rp,i.updateDocumentAttachment=Kh,i.updateDocumentAttachments=Yh,i.updateDocuments=dp,i.updateEmailDomain=Ip,i.updateEmailDomains=Op,i.updateForm=zm,i.updateFormIdentifier=qp,i.updateFormIdentifierValue=Xp,i.updateFormIdentifierValues=xp,i.updateFormIdentifiers=jp,i.updateFormRevision=gm,i.updateFormRevisionAttachment=hm,i.updateFormRevisionAttachments=pm,i.updateFormRevisions=_m,i.updateFormSubmission=df,i.updateFormSubmissionAttachment=Jm,i.updateFormSubmissionAttachments=Zm,i.updateFormSubmissions=lf,i.updateForms=Dm,i.updateGeoImage=Of,i.updateGeoImages=Ff,i.updateIssue=qy,i.updateIssueAssociation=Wf,i.updateIssueAssociations=Bf,i.updateIssueAttachment=Xf,i.updateIssueAttachments=xf,i.updateIssueComment=Py,i.updateIssueCommentAttachment=hy,i.updateIssueCommentAttachments=py,i.updateIssueComments=by,i.updateIssueType=CA,i.updateIssueTypeAttachment=Xy,i.updateIssueTypeAttachments=xy,i.updateIssueTypeFieldValues=PS,i.updateIssueTypeFieldValuesAttachment=xS,i.updateIssueTypeFieldValuesAttachments=eA,i.updateIssueTypeFieldValuesMany=bS,i.updateIssueTypeFields=$S,i.updateIssueTypeFieldsAttachment=hS,i.updateIssueTypeFieldsAttachments=pS,i.updateIssueTypeFieldsMany=CS,i.updateIssueTypeIdentifier=pA,i.updateIssueTypeIdentifierValue=bA,i.updateIssueTypeIdentifierValues=RA,i.updateIssueTypeIdentifiers=mA,i.updateIssueTypeStatus=tw,i.updateIssueTypeStatuses=sw,i.updateIssueTypes=UA,i.updateIssueUpdate=hw,i.updateIssueUpdates=pw,i.updateIssues=jy,i.updateOrganization=Zw,i.updateOrganizationAccess=Bw,i.updateOrganizationAccesses=zw,i.updateOrganizations=Jw,i.updateProject=aI,i.updateProjectAccess=yT,i.updateProjectAccesses=ST,i.updateProjectAttachment=MT,i.updateProjectAttachments=kT,i.updateProjectFile=LT,i.updateProjectFiles=NT,i.updateProjects=nI,i.updateTeam=VI,i.updateTeamMembership=wI,i.updateTeamMemberships=TI,i.updateTeams=WI,i.updateUser=gw,i.updateUsers=Fw,i.updateWorkflow=JI,i.updateWorkflowIssueLink=dO,i.updateWorkflowIssueLinks=lO,i.updateWorkflowStep=P_,i.updateWorkflowStepAssignee=gO,i.updateWorkflowStepAssignees=_O,i.updateWorkflowStepComment=qO,i.updateWorkflowStepComments=jO,i.updateWorkflowStepDefaultAssignee=XO,i.updateWorkflowStepDefaultAssignees=xO,i.updateWorkflowStepDefaultReviewer=hF,i.updateWorkflowStepDefaultReviewers=pF,i.updateWorkflowStepEvent=PF,i.updateWorkflowStepEvents=bF,i.updateWorkflowStepFieldValues=Pg,i.updateWorkflowStepFieldValuesAttachment=hg,i.updateWorkflowStepFieldValuesAttachments=pg,i.updateWorkflowStepFieldValuesMany=bg,i.updateWorkflowStepFieldValuesReview=Xg,i.updateWorkflowStepFieldValuesReviewRequest=jg,i.updateWorkflowStepFieldValuesReviewRequests=$g,i.updateWorkflowStepFieldValuesReviews=xg,i.updateWorkflowStepFields=xF,i.updateWorkflowStepFieldsAttachment=jF,i.updateWorkflowStepFieldsAttachments=$F,i.updateWorkflowStepFieldsMany=eg,i.updateWorkflowStepReviewer=h_,i.updateWorkflowStepReviewers=p_,i.updateWorkflowSteps=b_,i.updateWorkflowType=$_,i.updateWorkflowTypes=C_,i.updateWorkflows=ZI,i.useSelectorBuilder=WP,i.userReducer=Pw,i.userSlice=Nn,i.uuidObj=O,i.uuidObjSortFn=gs,i.uuidSortFn=Yt,i.versioningReducer=UI,i.versioningSlice=CI,i.workflowIssueLinkReducer=SO,i.workflowIssueLinkSlice=da,i.workflowReducer=sO,i.workflowSlice=ra,i.workflowStepAssigneeReducer=vO,i.workflowStepAssigneeSlice=la,i.workflowStepCommentReducer=GO,i.workflowStepCommentSlice=ua,i.workflowStepDefaultAssigneeReducer=aF,i.workflowStepDefaultAssigneeSlice=oa,i.workflowStepDefaultReviewerReducer=wF,i.workflowStepDefaultReviewerSlice=pa,i.workflowStepEventReducer=VF,i.workflowStepEventSlice=fa,i.workflowStepFieldValuesAttachmentReducer=wg,i.workflowStepFieldValuesAttachmentSlice=Ia,i.workflowStepFieldValuesReducer=Vg,i.workflowStepFieldValuesReviewReducer=a_,i.workflowStepFieldValuesReviewRequestReducer=Hg,i.workflowStepFieldValuesReviewRequestSlice=Pa,i.workflowStepFieldValuesReviewSlice=Ma,i.workflowStepFieldValuesSlice=_a,i.workflowStepFieldsAttachmentReducer=HF,i.workflowStepFieldsAttachmentSlice=ya,i.workflowStepFieldsReducer=cg,i.workflowStepFieldsSlice=Ta,i.workflowStepReducer=V_,i.workflowStepReviewerReducer=w_,i.workflowStepReviewerSlice=Ea,i.workflowStepSlice=Va,i.workflowTypeReducer=K_,i.workflowTypeSlice=Ba,Object.defineProperty(i,Symbol.toStringTag,{value:"Module"})});