@overmap-ai/core 1.0.78-bulk-identifier-value-support.1 → 1.0.78-bulk-issue-links.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/constants/index.d.ts +1 -0
- package/dist/constants/workflows.d.ts +4 -0
- package/dist/enums/index.d.ts +1 -0
- package/dist/enums/workflows.d.ts +18 -0
- package/dist/overmap-core.js +9084 -6512
- package/dist/overmap-core.umd.cjs +7 -7
- package/dist/sdk/services/FormService.d.ts +4 -2
- package/dist/sdk/services/IssueAssociationService.d.ts +2 -1
- package/dist/sdk/services/IssueUpdateService.d.ts +32 -0
- package/dist/sdk/services/WorkflowIssueLinkService.d.ts +27 -0
- package/dist/sdk/services/WorkflowService.d.ts +28 -0
- package/dist/sdk/services/WorkflowStepAssigneeService.d.ts +29 -0
- package/dist/sdk/services/WorkflowStepCommentService.d.ts +28 -0
- package/dist/sdk/services/WorkflowStepDefaultAssigneeService.d.ts +27 -0
- package/dist/sdk/services/WorkflowStepDefaultReviewerService.d.ts +27 -0
- package/dist/sdk/services/WorkflowStepEventService.d.ts +24 -0
- package/dist/sdk/services/WorkflowStepFieldValuesAttachmentService.d.ts +31 -0
- package/dist/sdk/services/WorkflowStepFieldValuesReviewRequestService.d.ts +27 -0
- package/dist/sdk/services/WorkflowStepFieldValuesReviewService.d.ts +28 -0
- package/dist/sdk/services/WorkflowStepFieldValuesService.d.ts +28 -0
- package/dist/sdk/services/WorkflowStepFieldsAttachmentService.d.ts +30 -0
- package/dist/sdk/services/WorkflowStepFieldsService.d.ts +27 -0
- package/dist/sdk/services/WorkflowStepReviewerService.d.ts +29 -0
- package/dist/sdk/services/WorkflowStepService.d.ts +28 -0
- package/dist/sdk/services/WorkflowTypeService.d.ts +28 -0
- package/dist/sdk/services/index.d.ts +16 -0
- package/dist/store/reducers.d.ts +48 -0
- package/dist/store/slices/assetProcedureSlice.d.ts +16 -0
- package/dist/store/slices/assetProcedureStepFieldValuesAttachmentSlice.d.ts +16 -0
- package/dist/store/slices/assetProcedureStepFieldValuesSlice.d.ts +16 -0
- package/dist/store/slices/assetProcedureStepFieldsAttachmentSlice.d.ts +16 -0
- package/dist/store/slices/assetProcedureStepFieldsSlice.d.ts +32 -0
- package/dist/store/slices/assetProcedureStepSlice.d.ts +16 -0
- package/dist/store/slices/assetProcedureTypeAttachmentSlice.d.ts +16 -0
- package/dist/store/slices/assetProcedureTypeFieldValuesAttachmentSlice.d.ts +16 -0
- package/dist/store/slices/assetProcedureTypeFieldValuesSlice.d.ts +16 -0
- package/dist/store/slices/assetProcedureTypeFieldsAttachmentSlice.d.ts +16 -0
- package/dist/store/slices/assetSlice.d.ts +16 -0
- package/dist/store/slices/assetStageCompletionSlice.d.ts +16 -0
- package/dist/store/slices/assetStageSlice.d.ts +16 -0
- package/dist/store/slices/assetTypeFieldValuesAttachmentSlice.d.ts +16 -0
- package/dist/store/slices/assetTypeFieldValuesSlice.d.ts +16 -0
- package/dist/store/slices/assetTypeFieldsAttachmentSlice.d.ts +16 -0
- package/dist/store/slices/assetTypeFieldsSlice.d.ts +16 -0
- package/dist/store/slices/assetTypeStatusSlice.d.ts +16 -0
- package/dist/store/slices/emailDomainsSlice.d.ts +16 -0
- package/dist/store/slices/formRevisionAttachmentSlice.d.ts +16 -0
- package/dist/store/slices/formRevisionSlice.d.ts +16 -0
- package/dist/store/slices/formSlice.d.ts +16 -0
- package/dist/store/slices/geoImageSlice.d.ts +16 -0
- package/dist/store/slices/index.d.ts +16 -0
- package/dist/store/slices/issueAssociationSlice.d.ts +16 -0
- package/dist/store/slices/issueTypeFieldValuesAttachmentSlice.d.ts +16 -0
- package/dist/store/slices/issueTypeFieldValuesSlice.d.ts +16 -0
- package/dist/store/slices/issueTypeFieldsAttachmentSlice.d.ts +16 -0
- package/dist/store/slices/issueTypeFieldsSlice.d.ts +16 -0
- package/dist/store/slices/issueTypeStatusSlice.d.ts +16 -0
- package/dist/store/slices/issueUpdateSlice.d.ts +48 -0
- package/dist/store/slices/organizationSlice.d.ts +16 -0
- package/dist/store/slices/projectFileSlice.d.ts +16 -0
- package/dist/store/slices/projectSlice.d.ts +16 -0
- package/dist/store/slices/userSlice.d.ts +16 -0
- package/dist/store/slices/workflowIssueLinkSlice.d.ts +130 -0
- package/dist/store/slices/workflowSlice.d.ts +23 -0
- package/dist/store/slices/workflowStepAssigneeSlice.d.ts +129 -0
- package/dist/store/slices/workflowStepCommentSlice.d.ts +129 -0
- package/dist/store/slices/workflowStepDefaultAssigneeSlice.d.ts +127 -0
- package/dist/store/slices/workflowStepDefaultReviewerSlice.d.ts +127 -0
- package/dist/store/slices/workflowStepEventSlice.d.ts +129 -0
- package/dist/store/slices/workflowStepFieldValuesAttachmentSlice.d.ts +127 -0
- package/dist/store/slices/workflowStepFieldValuesReviewRequestSlice.d.ts +129 -0
- package/dist/store/slices/workflowStepFieldValuesReviewSlice.d.ts +130 -0
- package/dist/store/slices/workflowStepFieldValuesSlice.d.ts +130 -0
- package/dist/store/slices/workflowStepFieldsAttachmentSlice.d.ts +127 -0
- package/dist/store/slices/workflowStepFieldsSlice.d.ts +128 -0
- package/dist/store/slices/workflowStepReviewerSlice.d.ts +129 -0
- package/dist/store/slices/workflowStepSlice.d.ts +22 -0
- package/dist/store/slices/workflowTypeSlice.d.ts +22 -0
- package/dist/typings/models/forms.d.ts +3 -2
- package/dist/typings/models/index.d.ts +1 -0
- package/dist/typings/models/workflows.d.ts +91 -0
- package/package.json +1 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
(function(i,k){typeof exports=="object"&&typeof module<"u"?k(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"],k):(i=typeof globalThis<"u"?globalThis:i||self,k(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,k,o,at,Qe,uO,lO,$n,ft,oO,Cn,hO,mO,s_,i_,yO,pO,AO){"use strict";var e_=Object.defineProperty;var t_=(i,k,o)=>k in i?e_(i,k,{enumerable:!0,configurable:!0,writable:!0,value:o}):i[k]=o;var y=(i,k,o)=>t_(i,typeof k!="symbol"?k+"":k,o);var dO;const Un=Object.freeze([]),Ln=Object.freeze({});var kn=(t=>(t[t.GUEST=0]="GUEST",t[t.BASIC=2]="BASIC",t[t.ADMIN=4]="ADMIN",t))(kn||{}),m=(t=>(t.GET="GET",t.POST="POST",t.PATCH="PATCH",t.PUT="PUT",t.DELETE="DELETE",t))(m||{}),Nn=(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))(Nn||{}),Gn=(t=>(t.Issue="issue",t.Asset="asset",t.AssetType="asset_type",t.Project="project",t.Document="document",t))(Gn||{}),Nt=(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))(Nt||{}),U=(t=>(t.STATUS="status",t.PRIORITY="priority",t.DESCRIPTION="description",t.TITLE="title",t.ASSIGNED_TO="assigned_to",t.DUE_DATE="due_date",t))(U||{}),Hn=(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))(Hn||{});const fO=Nt.MEDIUM,Wn=6e4;function _(t){return{addOne:(h,p)=>{const A=t(p.payload);h.instances[A]=p.payload},addMany:(h,p)=>{for(const A of p.payload){const I=t(A);h.instances[I]=A}},setOne:(h,p)=>{const A=t(p.payload);h.instances[A]=p.payload},setMany:(h,p)=>{for(const A of p.payload){const I=t(A);h.instances[I]=A}},updateOne:(h,p)=>{const A=t(p.payload);h.instances[A]=p.payload},updateMany:(h,p)=>{for(const A of p.payload){const I=t(A);h.instances[I]=A}},deleteOne:(h,p)=>{delete h.instances[p.payload]},deleteMany:(h,p)=>{for(const A of p.payload)delete h.instances[A]},initialize:(h,p)=>{h.instances={};const A=new Set;for(const I of p.payload){const g=t(I);A.add(g),h.instances[g]=I}A.size!==p.payload.length&&console.warn("duplicate ids detected when initializing model instances.")}}}function SO(){return{initializeSelection:(r,u)=>{r.selection=Array.from(new Set(u.payload))},selectOne:(r,u)=>{new Set(r.selection).has(u.payload)||r.selection.push(u.payload)},selectMany:(r,u)=>{const h=new Set(r.selection);for(const p of u.payload)h.has(p)||h.add(p);r.selection=Array.from(h)},unselectOne:(r,u)=>{const h=new Set(r.selection);h.has(u.payload)&&(h.delete(u.payload),r.selection=Array.from(h))},unselectMany:(r,u)=>{const h=new Set(r.selection);for(const p of u.payload)h.has(p)&&h.delete(p);r.selection=Array.from(h)},toggleOne:(r,u)=>{const h=new Set(r.selection);h.has(u.payload)?h.delete(u.payload):h.add(u.payload),r.selection=Array.from(h)},toggleMany:(r,u)=>{const h=new Set(r.selection);for(const p of u.payload)h.has(p)?h.delete(p):h.add(p);r.selection=Array.from(h)},getInitialState:r=>({...r,selection:[]})}}const ot="versioning",O=o.createAction("RESET"),D=o.createAction("RESET_PROJECT_STATE"),b=o.createAction("RESET_ORGANIZATION_STATE");function TO(t,s){return uO.useMemo(t,s)}dO=Symbol.toStringTag;class Gt{constructor(){y(this,dO,"Promise");y(this,"_promise");y(this,"_resolve");y(this,"_reject");y(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 Ht=!1;["true","1"].includes("".toLowerCase())&&(Ht=!0);function IO(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 d=e[c];if(!Object.prototype.hasOwnProperty.call(s,d)||t[d]!==s[d])return!1}return!0}function Wt(t){const s={};return function(){const e=Array.prototype.slice.call(arguments);return e in s?(Ht&&console.debug(`Memoization debug: Using memorized return value for ${t.toString()}(`,e,")"),s[e]):(Ht&&console.debug(`Memoization debug: Cache miss! Memoizing ${t.toString()}(`,e,")"),s[e]=t.apply(this,e))}}function OO(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 S=t=>t.length===0?Un:t,St=t=>Object.keys(t).length===0?Ln:t,Kn=Wt(t=>{if(!t)return"";const s=new Date(t),e=s.getFullYear()===Kt.getFullYear(),n={day:"numeric",month:"short"};return e||(n.year="numeric"),s.toLocaleDateString([],n)}),PO=new Intl.RelativeTimeFormat([],{style:"long",numeric:"auto"}),FO=1e3*86400,Kt=new Date,gO=t=>new Date(t).toDateString()===Kt.toDateString(),_O=Wt((t,s,e)=>{const n=Math.round((new Date(t).getTime()-Kt.getTime())/FO);return n<s||n>e?Kn(t):PO.format(n,"days")});function bO(t){return new Uint8Array(t).reduce((e,n)=>e+n.toString(16).padStart(2,"0"),"")}function Tt(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 d=bO(c);s(d)})},n.readAsArrayBuffer(t)})}const MO=(t,s)=>`${t}${s?`.${s}`:""}`;function RO(t,s){return new File([t],s,{type:t.type})}function Yn(t){const s=t.name;return s.includes(".")?s.split(".").pop():""}const Zn=async t=>(await fetch(t)).blob(),Jn=async(t,s)=>{const e=await Zn(t);return new File([e],s,{type:e.type})};function wO(t){const s=new Blob([t]);lO.saveAs(s,t.name)}function Xn(t){return typeof t=="string"&&t.startsWith("blob:")}function EO(t){return t.type.startsWith("image/")}const Qn={};function BO(t,s,e,...n){const a=Qn[t];let c=!1;a?a[s]||(a[s]=!0,c=!0):(Qn[t]={[s]:!0},c=!0),c&&console[e](...n)}const xn=["created_at","updated_at","index","revision"];function F(t){return{...t,uuid:Qe.v4()}}function vO(t){const s={};for(const e of t)s[e.uuid]=e;return s}function V(t){return t.map(({uuid:s})=>s)}function It(t,s){return t.localeCompare(s)}function Yt(t,s){return It(t.uuid,s.uuid)}function VO(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 zO(t){return t.toLowerCase().replace(" ","-")}function jO(t,s=!1){return t.normalize("NFKD").toLowerCase().replace(/[^\w\s-]/g,"").trim().replace(/[-\s]+/g,s?"_":"-")}function DO(t,s){if(t.length<=s)return t;const e=t.slice(0,s-1);return e.slice(0,e.lastIndexOf(" "))+"…"}const qO=/^.+@.+\..+$/;function E(t){const s={...t};for(const e of[...xn,"created_by"])e in s&&delete s[e];return s}const ea=t=>{const s=t.toSorted((e,n)=>e.order-n.order);return $n(s,{id:e=>e.uuid,parentId:e=>e.parent,includeEmptyChildrenArray:!0,valueKey:!1})},$O=t=>{const{roots:s}=ea(t);return s.map(e=>new ft.Tree(e))},ta=(t,s)=>{const{nodes:e}=ea(s),n=e.get(t);if(!n)throw new Error(`Node with uuid ${t} does not exist in asset procedure step tree.`);return new ft.Tree(n)},sa=(t,s)=>t.type!==s.type?t.type-s.type:t.order-s.order,ia=(t,s)=>t.type!==s.type?t.type-s.type:t.order-s.order,na=t=>$n(t,{id:s=>s.uuid,parentId:s=>s.parent_document,includeEmptyChildrenArray:!0,valueKey:!1}),CO=t=>{const{roots:s}=na(t);return s.map(e=>new ft.Tree(e))},aa=(t,s)=>{const{nodes:e}=na(s),n=e.get(t);if(!n)throw new Error(`Node with uuid ${t} does not exist in document tree.`);return new ft.Tree(n)};class UO{constructor(s){y(this,"operations",[]);y(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=>S(this.performOperations(s)))}}const f=t=>(...s)=>e=>t(e,...s),G=_(t=>t.uuid),ca={instances:{}},Zt=o.createSlice({name:"agents",initialState:ca,extraReducers:t=>t.addMatcher(o.isAnyOf(O,D,b),s=>Object.assign(s,ca)),reducers:{initializeConversations:G.initialize,addConversation:G.addOne,addConversations:G.addMany,setConversation:G.setOne,setConversations:G.setMany,updateConversation:G.updateOne,updateConversations:G.updateMany,deleteConversation:G.deleteOne,deleteConversations:G.deleteMany}}),{initializeConversations:da,addConversation:ra,addConversations:LO,setConversation:ua,setConversations:kO,updateConversation:la,updateConversations:NO,deleteConversation:GO,deleteConversations:HO}=Zt.actions,Jt=t=>t.agentsReducer.instances,WO=o.createSelector([Jt],t=>Object.values(t)),KO=f(o.createSelector([Jt,(t,s)=>s],(t,s)=>t[s])),oa=Zt.reducer,H=_(t=>t.uuid),ha={instances:{}},Xt=o.createSlice({name:"assetAttachments",initialState:ha,extraReducers:t=>t.addMatcher(o.isAnyOf(O,D,b),s=>Object.assign(s,ha)),reducers:{initializeAssetAttachments:H.initialize,addAssetAttachment:H.addOne,addAssetAttachments:H.addMany,setAssetAttachment:H.setOne,setAssetAttachments:H.setMany,updateAssetAttachment:H.updateOne,updateAssetAttachments:H.updateMany,deleteAssetAttachment:H.deleteOne,deleteAssetAttachments:H.deleteMany}}),{initializeAssetAttachments:ma,addAssetAttachment:ya,addAssetAttachments:Qt,setAssetAttachment:pa,setAssetAttachments:Aa,updateAssetAttachment:fa,updateAssetAttachments:Sa,deleteAssetAttachment:Ta,deleteAssetAttachments:xt}=Xt.actions,Ia=t=>t.assetAttachmentReducer.instances,es=o.createSelector([Ia],t=>Object.values(t)),Oa=t=>s=>s.assetAttachmentReducer.instances[t],Pa=f(o.createSelector([es,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),Fa=f(o.createSelector([es,(t,s)=>s],(t,s)=>S(t.filter(({asset:e})=>s===e)))),ga=Xt.reducer,W=_(({uuid:t})=>t),_a={instances:{}},ts=o.createSlice({name:"assetProcedureTypeAttachments",initialState:_a,extraReducers:t=>t.addMatcher(o.isAnyOf(O,b),s=>Object.assign(s,_a)),reducers:{initializeAssetProcedureTypeAttachments:W.initialize,addAssetProcedureTypeAttachment:W.addOne,addAssetProcedureTypeAttachments:W.addMany,setAssetProcedureTypeAttachment:W.setOne,setAssetProcedureTypeAttachments:W.setMany,updateAssetProcedureTypeAttachment:W.updateOne,updateAssetProcedureTypeAttachments:W.updateMany,deleteAssetProcedureTypeAttachment:W.deleteOne,deleteAssetProcedureTypeAttachments:W.deleteMany}}),{initializeAssetProcedureTypeAttachments:ba,addAssetProcedureTypeAttachment:Ma,addAssetProcedureTypeAttachments:Ra,setAssetProcedureTypeAttachment:wa,setAssetProcedureTypeAttachments:Ea,updateAssetProcedureTypeAttachment:Ba,updateAssetProcedureTypeAttachments:va,deleteAssetProcedureTypeAttachment:Va,deleteAssetProcedureTypeAttachments:za}=ts.actions,ja=ts.reducer,Da=t=>t.assetProcedureTypeAttachmentReducer.instances,ss=o.createSelector([Da],t=>Object.values(t)),qa=t=>s=>s.assetProcedureTypeAttachmentReducer.instances[t],$a=f(o.createSelector([ss,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),YO=f(o.createSelector([ss,(t,s)=>s],(t,s)=>S(t.filter(({asset_procedure_type:e})=>s===e)))),K=_(({uuid:t})=>t),Ca={instances:{}},is=o.createSlice({name:"assetProcedureTypeFieldsAttachments",initialState:Ca,extraReducers:t=>t.addMatcher(o.isAnyOf(O,b),s=>Object.assign(s,Ca)),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:Ua,addAssetProcedureTypeFieldsAttachment:La,addAssetProcedureTypeFieldsAttachments:ka,setAssetProcedureTypeFieldsAttachment:Na,setAssetProcedureTypeFieldsAttachments:Ga,updateAssetProcedureTypeFieldsAttachment:Ha,updateAssetProcedureTypeFieldsAttachments:Wa,deleteAssetProcedureTypeFieldsAttachment:Ka,deleteAssetProcedureTypeFieldsAttachments:Ya}=is.actions,Za=is.reducer,Ja=t=>t.assetProcedureTypeFieldsAttachmentReducer.instances,ns=o.createSelector([Ja],t=>Object.values(t)),ZO=f(o.createSelector([ns,(t,s)=>s],(t,s)=>S(t.filter(e=>e.fields_revision===s)))),Xa=t=>s=>s.assetProcedureTypeFieldsAttachmentReducer.instances[t],Qa=f(o.createSelector([ns,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),Y=_(({uuid:t})=>t),xa={instances:{}},as=o.createSlice({name:"assetProcedureTypeFields",initialState:xa,extraReducers:t=>t.addMatcher(o.isAnyOf(O,b),s=>Object.assign(s,xa)),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:ec,addAssetProcedureTypeFields:tc,addAssetProcedureTypeFieldsMany:sc,setAssetProcedureTypeFields:ic,setAssetProcedureTypeFieldsMany:nc,updateAssetProcedureTypeFields:ac,updateAssetProcedureTypeFieldsMany:cc,deleteAssetProcedureTypeFields:dc,deleteAssetProcedureTypeFieldsMany:rc}=as.actions,uc=as.reducer,lc=t=>t.assetProcedureTypeFieldsReducer.instances,Ot=o.createSelector([lc],t=>Object.values(t)),JO=f(o.createSelector([Ot,(t,s)=>s],(t,s)=>S(t.filter(e=>e.asset_procedure_type===s)))),XO=f(o.createSelector([Ot,(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])),oc=t=>s=>s.assetProcedureTypeFieldsReducer.instances[t],hc=f(o.createSelector([Ot,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),Z=_(({uuid:t})=>t),mc={instances:{}},cs=o.createSlice({name:"assetProcedureTypeFieldValuesAttachments",initialState:mc,extraReducers:t=>t.addMatcher(o.isAnyOf(O,D,b),s=>Object.assign(s,mc)),reducers:{initializeAssetProcedureTypeFieldValuesAttachments:Z.initialize,addAssetProcedureTypeFieldValuesAttachment:Z.addOne,addAssetProcedureTypeFieldValuesAttachments:Z.addMany,setAssetProcedureTypeFieldValuesAttachment:Z.setOne,setAssetProcedureTypeFieldValuesAttachments:Z.setMany,updateAssetProcedureTypeFieldValuesAttachment:Z.updateOne,updateAssetProcedureTypeFieldValuesAttachments:Z.updateMany,deleteAssetProcedureTypeFieldValuesAttachment:Z.deleteOne,deleteAssetProcedureTypeFieldValuesAttachments:Z.deleteMany}}),{initializeAssetProcedureTypeFieldValuesAttachments:yc,addAssetProcedureTypeFieldValuesAttachment:pc,addAssetProcedureTypeFieldValuesAttachments:ds,setAssetProcedureTypeFieldValuesAttachment:Ac,setAssetProcedureTypeFieldValuesAttachments:fc,updateAssetProcedureTypeFieldValuesAttachment:Sc,updateAssetProcedureTypeFieldValuesAttachments:Tc,deleteAssetProcedureTypeFieldValuesAttachment:Ic,deleteAssetProcedureTypeFieldValuesAttachments:rs}=cs.actions,Oc=cs.reducer,Pc=t=>t.assetProcedureTypeFieldValuesAttachmentReducer.instances,us=o.createSelector([Pc],t=>Object.values(t)),Fc=t=>s=>s.assetProcedureTypeFieldValuesAttachmentReducer.instances[t],gc=f(o.createSelector([us,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),_c=f(o.createSelector([us,(t,s)=>s],(t,s)=>S(t.filter(e=>e.field_values===s)))),J=_(({uuid:t})=>t),bc={instances:{}},ls=o.createSlice({name:"assetProcedureTypeFieldValues",initialState:bc,extraReducers:t=>t.addMatcher(o.isAnyOf(O,D,b),s=>Object.assign(s,bc)),reducers:{initializeAssetProcedureTypeFieldValues:J.initialize,addAssetProcedureTypeFieldValues:J.addOne,addAssetProcedureTypeFieldValuesMany:J.addMany,setAssetProcedureTypeFieldValues:J.setOne,setAssetProcedureTypeFieldValuesMany:J.setMany,updateAssetProcedureTypeFieldValues:J.updateOne,updateAssetProcedureTypeFieldValuesMany:J.updateMany,deleteAssetProcedureTypeFieldValues:J.deleteOne,deleteAssetProcedureTypeFieldValuesMany:J.deleteMany}}),{initializeAssetProcedureTypeFieldValues:Mc,addAssetProcedureTypeFieldValues:Rc,addAssetProcedureTypeFieldValuesMany:wc,setAssetProcedureTypeFieldValues:Ec,setAssetProcedureTypeFieldValuesMany:Bc,updateAssetProcedureTypeFieldValues:vc,updateAssetProcedureTypeFieldValuesMany:Vc,deleteAssetProcedureTypeFieldValues:zc,deleteAssetProcedureTypeFieldValuesMany:jc}=ls.actions,Dc=ls.reducer,qc=t=>t.assetProcedureTypeFieldValuesReducer.instances,Pt=o.createSelector([qc],t=>Object.values(t)),QO=f(o.createSelector([Pt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.asset===s)))),xO=f(o.createSelector([Pt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.asset_procedure===s)))),$c=t=>s=>s.assetProcedureTypeFieldValuesReducer.instances[t],Cc=f(o.createSelector([Pt,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),X=_(({uuid:t})=>t),Uc={instances:{}},os=o.createSlice({name:"assetProcedures",initialState:Uc,extraReducers:t=>t.addMatcher(o.isAnyOf(O,D,b),s=>Object.assign(s,Uc)),reducers:{initializeAssetProcedures:X.initialize,addAssetProcedure:X.addOne,addAssetProcedures:X.addMany,setAssetProcedure:X.setOne,setAssetProcedures:X.setMany,updateAssetProcedure:X.updateOne,updateAssetProcedures:X.updateMany,deleteAssetProcedure:X.deleteOne,deleteAssetProcedures:X.deleteMany}}),{initializeAssetProcedures:Lc,addAssetProcedure:kc,addAssetProcedures:hs,updateAssetProcedure:Nc,updateAssetProcedures:Gc,deleteAssetProcedure:Hc,deleteAssetProcedures:ms,setAssetProcedure:Wc,setAssetProcedures:Kc}=os.actions,Yc=os.reducer,Zc=t=>t.assetProcedureReducer.instances,Ft=o.createSelector([Zc],t=>Object.values(t)),Jc=f(o.createSelector([Ft,(t,s)=>s],(t,s)=>S(t.filter(e=>e.asset_procedure_type===s)))),eP=f(o.createSelector([Ft,(t,s)=>s],(t,s)=>S(t.filter(e=>e.asset_type===s)))),Xc=t=>s=>s.assetProcedureReducer.instances[t],Qc=f(o.createSelector([Ft,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),Q=_(t=>t.uuid),xc={instances:{}},ys=o.createSlice({name:"assetProcedureTypes",initialState:xc,extraReducers:t=>t.addMatcher(o.isAnyOf(O,b),s=>Object.assign(s,xc)),reducers:{initializeAssetProcedureTypes:Q.initialize,addAssetProcedureType:Q.addOne,addAssetProcedureTypes:Q.addMany,setAssetProcedureType:Q.setOne,setAssetProcedureTypes:Q.setMany,updateAssetProcedureType:Q.updateOne,updateAssetProcedureTypes:Q.updateMany,deleteAssetProcedureType:Q.deleteOne,deleteAssetProcedureTypes:Q.deleteMany}}),{initializeAssetProcedureTypes:ed,addAssetProcedureType:td,addAssetProcedureTypes:sd,updateAssetProcedureType:id,updateAssetProcedureTypes:nd,deleteAssetProcedureType:ad,deleteAssetProcedureTypes:cd,setAssetProcedureType:dd,setAssetProcedureTypes:rd}=ys.actions,ud=ys.reducer,ld=t=>t.assetProcedureTypeReducer.instances,ps=o.createSelector([ld],t=>Object.values(t)),od=t=>s=>s.assetProcedureTypeReducer.instances[t],hd=f(o.createSelector([ps,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),tP=f(o.createSelector([ps,(t,s)=>s],(t,s)=>S(t.filter(e=>e.organization===s)))),x=_(t=>t.uuid),md={instances:{}},As=o.createSlice({name:"assetProcedureStepFieldsAttachments",initialState:md,extraReducers:t=>t.addMatcher(o.isAnyOf(O,b),s=>Object.assign(s,md)),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:yd,addAssetProcedureStepFieldsAttachment:pd,addAssetProcedureStepFieldsAttachments:Ad,setAssetProcedureStepFieldsAttachment:fd,setAssetProcedureStepFieldsAttachments:Sd,updateAssetProcedureStepFieldsAttachment:Td,updateAssetProcedureStepFieldsAttachments:Id,deleteAssetProcedureStepFieldsAttachment:Od,deleteAssetProcedureStepFieldsAttachments:Pd}=As.actions,Fd=t=>t.assetProcedureStepFieldsAttachmentReducer.instances,fs=o.createSelector([Fd],t=>Object.values(t)),sP=f(o.createSelector([fs,(t,s)=>s],(t,s)=>S(t.filter(e=>e.fields_revision===s)))),gd=t=>s=>s.assetProcedureStepFieldsAttachmentReducer.instances[t],_d=f(o.createSelector([fs,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),bd=As.reducer,ee=_(t=>t.uuid),Md={instances:{}},Ss=o.createSlice({name:"assetProcedureStepFields",initialState:Md,extraReducers:t=>t.addMatcher(o.isAnyOf(O,b),s=>Object.assign(s,Md)),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:Rd,addAssetProcedureStepFields:wd,addAssetProcedureStepFieldsMany:Ed,setAssetProcedureStepFields:Bd,setAssetProcedureStepFieldsMany:vd,updateAssetProcedureStepFields:Vd,updateAssetProcedureStepFieldsMany:zd,deleteAssetProcedureStepFields:jd,deleteAssetProcedureStepFieldsMany:Dd}=Ss.actions,Ts=t=>t.assetProcedureStepFieldsReducer.instances,gt=o.createSelector([Ts],t=>Object.values(t)),iP=f(o.createSelector([gt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.asset_procedure_step===s)))),nP=f(o.createSelector([gt,(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])),aP=o.createSelector([Ts],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}),qd=t=>s=>s.assetProcedureStepFieldsReducer.instances[t],$d=f(o.createSelector([gt,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),Cd=Ss.reducer,te=_(t=>t.uuid),Ud={instances:{}},Is=o.createSlice({name:"assetProcedureStepFieldValuesAttachments",initialState:Ud,extraReducers:t=>t.addMatcher(o.isAnyOf(O,D,b),s=>Object.assign(s,Ud)),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:Ld,addAssetProcedureStepFieldValuesAttachment:kd,addAssetProcedureStepFieldValuesAttachments:Os,setAssetProcedureStepFieldValuesAttachment:Nd,setAssetProcedureStepFieldValuesAttachments:Gd,updateAssetProcedureStepFieldValuesAttachment:Hd,updateAssetProcedureStepFieldValuesAttachments:Wd,deleteAssetProcedureStepFieldValuesAttachment:Kd,deleteAssetProcedureStepFieldValuesAttachments:Ps}=Is.actions,Yd=t=>t.assetProcedureStepFieldValuesAttachmentReducer.instances,Fs=o.createSelector([Yd],t=>Object.values(t)),Zd=t=>s=>s.assetProcedureStepFieldValuesAttachmentReducer.instances[t],Jd=f(o.createSelector([Fs,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),Xd=f(o.createSelector([Fs,(t,s)=>s],(t,s)=>S(t.filter(e=>e.field_values===s)))),Qd=Is.reducer,se=_(t=>t.uuid),xd={instances:{}},gs=o.createSlice({name:"assetProcedureStepFieldValues",initialState:xd,extraReducers:t=>t.addMatcher(o.isAnyOf(O,D,b),s=>Object.assign(s,xd)),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:er,addAssetProcedureStepFieldValues:tr,addAssetProcedureStepFieldValuesMany:sr,setAssetProcedureStepFieldValues:ir,setAssetProcedureStepFieldValuesMany:nr,updateAssetProcedureStepFieldValues:ar,updateAssetProcedureStepFieldValuesMany:cr,deleteAssetProcedureStepFieldValues:dr,deleteAssetProcedureStepFieldValuesMany:rr}=gs.actions,ur=t=>t.assetProcedureStepFieldValuesReducer.instances,ht=o.createSelector([ur],t=>Object.values(t)),cP=f(o.createSelector([ht,(t,s)=>s],(t,s)=>S(t.filter(e=>e.asset===s)))),dP=f(o.createSelector([ht,(t,s)=>s],(t,s)=>S(t.filter(e=>e.asset_procedure===s)))),rP=f(o.createSelector([ht,(t,s)=>s],(t,s)=>S(t.filter(e=>e.asset_procedure_step===s)))),lr=t=>s=>s.assetProcedureStepFieldValuesReducer.instances[t],or=f(o.createSelector([ht,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),hr=gs.reducer,ie=_(t=>t.uuid),mr={instances:{}},_s=o.createSlice({name:"assetProcedureSteps",initialState:mr,extraReducers:t=>t.addMatcher(o.isAnyOf(O,b),s=>Object.assign(s,mr)),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:yr,setAssetProcedureStep:pr,setAssetProcedureSteps:Ar,addAssetProcedureStep:fr,addAssetProcedureSteps:Sr,updateAssetProcedureStep:Tr,updateAssetProcedureSteps:Ir,deleteAssetProcedureStep:Or,deleteAssetProcedureSteps:Pr}=_s.actions,Fr=_s.reducer,_t=t=>t.assetProcedureStepReducer.instances,gr=t=>s=>s.assetProcedureStepReducer.instances[t],bs=o.createSelector([_t],t=>Object.values(t)),uP=f(o.createSelector([_t,(t,s)=>s],(t,s)=>{const e={};for(const[n,a]of Object.entries(t))a.asset_procedure_type===s&&(e[n]=a);return St(e)})),lP=f(o.createSelector([bs,(t,s)=>s],(t,s)=>S(t.filter(e=>e.asset_procedure_type===s)))),_r=f(o.createSelector([bs,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),br=f(o.createSelector([_t,(t,s)=>s],(t,s)=>{if(!t[s])return S([]);const a=ta(s,Object.values(t)).all().map(({model:c})=>c);return S(a)})),ne=_(t=>t.uuid),Mr={instances:{}},Ms=o.createSlice({name:"assets",initialState:Mr,extraReducers:t=>t.addMatcher(o.isAnyOf(O,D,b),s=>Object.assign(s,Mr)),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:Rr,addAsset:wr,addAssets:Rs,updateAsset:Er,updateAssets:Br,deleteAsset:vr,deleteAssets:ws,setAsset:Vr,setAssets:zr}=Ms.actions,jr=t=>t.assetReducer.instances,bt=o.createSelector([jr],t=>S(Object.values(t))),oP=f(o.createSelector([bt,(t,s)=>s],(t,s)=>S(t.filter(({project:e})=>e===s)))),Dr=f(o.createSelector([bt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.asset_type===s)))),qr=t=>s=>s.assetReducer.instances[t],$r=f(o.createSelector([bt,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),Cr=Ms.reducer,ae=_(t=>t.uuid),Ur={instances:{}},Es=o.createSlice({name:"assetStageCompletions",initialState:Ur,extraReducers:t=>t.addMatcher(o.isAnyOf(O,D,b),s=>Object.assign(s,Ur)),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:Lr,addAssetStageCompletion:kr,addAssetStageCompletions:Nr,setAssetStageCompletion:Gr,setAssetStageCompletions:Hr,updateAssetStageCompletion:Wr,updateAssetStageCompletions:Kr,deleteAssetStageCompletion:Yr,deleteAssetStageCompletions:Zr}=Es.actions,Jr=Es.reducer,Xr=t=>t.assetStageCompletionReducer.instances,Qr=o.createSelector([Xr],t=>Object.values(t)),xr=t=>s=>s.assetStageCompletionReducer.instances[t],eu=f(o.createSelector([Qr,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),ce=_(t=>t.uuid),tu={instances:{}},Bs=o.createSlice({name:"assetStages",initialState:tu,extraReducers:t=>t.addMatcher(o.isAnyOf(O,b),s=>Object.assign(s,tu)),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:su,setAssetStage:iu,setAssetStages:nu,addAssetStage:au,addAssetStages:cu,updateAssetStage:du,updateAssetStages:ru,deleteAssetStage:uu,deleteAssetStages:lu}=Bs.actions,ou=Bs.reducer,vs=t=>t.assetStageReducer.instances,hu=t=>s=>s.assetStageReducer.instances[t],Vs=o.createSelector([vs],t=>Object.values(t)),hP=f(o.createSelector([vs,(t,s)=>s],(t,s)=>{const e={};for(const[n,a]of Object.entries(t))a.asset_procedure_type===s&&(e[n]=a);return St(e)})),mP=f(o.createSelector([Vs,(t,s)=>s],(t,s)=>S(t.filter(e=>e.asset_procedure_type===s)))),mu=f(o.createSelector([Vs,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),de=_(t=>t.uuid),yu={instances:{}},zs=o.createSlice({name:"assetTypeAttachments",initialState:yu,extraReducers:t=>t.addMatcher(o.isAnyOf(O,b),s=>Object.assign(s,yu)),reducers:{initializeAssetTypeAttachments:de.initialize,addAssetTypeAttachment:de.addOne,addAssetTypeAttachments:de.addMany,setAssetTypeAttachment:de.setOne,setAssetTypeAttachments:de.setMany,updateAssetTypeAttachment:de.updateOne,updateAssetTypeAttachments:de.updateMany,deleteAssetTypeAttachment:de.deleteOne,deleteAssetTypeAttachments:de.deleteMany}}),{initializeAssetTypeAttachments:pu,addAssetTypeAttachment:Au,addAssetTypeAttachments:js,setAssetTypeAttachment:fu,setAssetTypeAttachments:Su,updateAssetTypeAttachment:Tu,updateAssetTypeAttachments:Iu,deleteAssetTypeAttachment:Ou,deleteAssetTypeAttachments:Ds}=zs.actions,Pu=t=>t.assetTypeAttachmentReducer.instances,qs=o.createSelector([Pu],t=>Object.values(t)),Fu=t=>s=>s.assetTypeAttachmentReducer.instances[t],gu=f(o.createSelector([qs,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),_u=f(o.createSelector([qs,(t,s)=>s],(t,s)=>S(t.filter(({asset_type:e})=>s===e)))),bu=zs.reducer,re=_(t=>t.uuid),Mu={instances:{}},$s=o.createSlice({name:"assetTypeFieldsAttachments",initialState:Mu,extraReducers:t=>t.addMatcher(o.isAnyOf(O,b),s=>Object.assign(s,Mu)),reducers:{initializeAssetTypeFieldsAttachments:re.initialize,addAssetTypeFieldsAttachment:re.addOne,addAssetTypeFieldsAttachments:re.addMany,setAssetTypeFieldsAttachment:re.setOne,setAssetTypeFieldsAttachments:re.setMany,updateAssetTypeFieldsAttachment:re.updateOne,updateAssetTypeFieldsAttachments:re.updateMany,deleteAssetTypeFieldsAttachment:re.deleteOne,deleteAssetTypeFieldsAttachments:re.deleteMany}}),{initializeAssetTypeFieldsAttachments:Ru,addAssetTypeFieldsAttachment:wu,addAssetTypeFieldsAttachments:Eu,setAssetTypeFieldsAttachment:Bu,setAssetTypeFieldsAttachments:vu,updateAssetTypeFieldsAttachment:Vu,updateAssetTypeFieldsAttachments:zu,deleteAssetTypeFieldsAttachment:ju,deleteAssetTypeFieldsAttachments:Du}=$s.actions,qu=t=>t.assetTypeFieldsAttachmentReducer.instances,Cs=o.createSelector([qu],t=>Object.values(t)),yP=f(o.createSelector([Cs,(t,s)=>s],(t,s)=>S(t.filter(e=>e.fields_revision===s)))),$u=t=>s=>s.assetTypeFieldsAttachmentReducer.instances[t],Cu=f(o.createSelector([Cs,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),Uu=$s.reducer,ue=_(t=>t.uuid),Lu={instances:{}},Us=o.createSlice({name:"assetTypeFields",initialState:Lu,extraReducers:t=>t.addMatcher(o.isAnyOf(O,b),s=>Object.assign(s,Lu)),reducers:{initializeAssetTypeFields:ue.initialize,addAssetTypeFields:ue.addOne,addAssetTypeFieldsMany:ue.addMany,setAssetTypeFields:ue.setOne,setAssetTypeFieldsMany:ue.setMany,updateAssetTypeFields:ue.updateOne,updateAssetTypeFieldsMany:ue.updateMany,deleteAssetTypeFields:ue.deleteOne,deleteAssetTypeFieldsMany:ue.deleteMany}}),{initializeAssetTypeFields:ku,addAssetTypeFields:Nu,addAssetTypeFieldsMany:Gu,setAssetTypeFields:Hu,setAssetTypeFieldsMany:Wu,updateAssetTypeFields:Ku,updateAssetTypeFieldsMany:Yu,deleteAssetTypeFields:Zu,deleteAssetTypeFieldsMany:Ju}=Us.actions,Xu=t=>t.assetTypeFieldsReducer.instances,mt=o.createSelector([Xu],t=>Object.values(t)),pP=f(o.createSelector([mt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.asset_type===s)))),AP=f(o.createSelector([mt,(t,s)=>s],(t,s)=>t.filter(e=>e.asset_type===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),Qu=t=>s=>s.assetTypeFieldsReducer.instances[t],xu=f(o.createSelector([mt,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),el=Us.reducer,le=_(t=>t.uuid),tl={instances:{}},Ls=o.createSlice({name:"assetTypeFieldValuesAttachments",initialState:tl,extraReducers:t=>t.addMatcher(o.isAnyOf(O,D,b),s=>Object.assign(s,tl)),reducers:{initializeAssetTypeFieldValuesAttachments:le.initialize,addAssetTypeFieldValuesAttachment:le.addOne,addAssetTypeFieldValuesAttachments:le.addMany,setAssetTypeFieldValuesAttachment:le.setOne,setAssetTypeFieldValuesAttachments:le.setMany,updateAssetTypeFieldValuesAttachment:le.updateOne,updateAssetTypeFieldValuesAttachments:le.updateMany,deleteAssetTypeFieldValuesAttachment:le.deleteOne,deleteAssetTypeFieldValuesAttachments:le.deleteMany}}),{initializeAssetTypeFieldValuesAttachments:sl,addAssetTypeFieldValuesAttachment:il,addAssetTypeFieldValuesAttachments:ks,setAssetTypeFieldValuesAttachment:nl,setAssetTypeFieldValuesAttachments:al,updateAssetTypeFieldValuesAttachment:cl,updateAssetTypeFieldValuesAttachments:dl,deleteAssetTypeFieldValuesAttachment:rl,deleteAssetTypeFieldValuesAttachments:Ns}=Ls.actions,ul=t=>t.assetTypeFieldValuesAttachmentReducer.instances,Gs=o.createSelector([ul],t=>Object.values(t)),ll=t=>s=>s.assetTypeFieldValuesAttachmentReducer.instances[t],ol=f(o.createSelector([Gs,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),hl=f(o.createSelector([Gs,(t,s)=>s],(t,s)=>S(t.filter(e=>e.field_values===s)))),ml=Ls.reducer,oe=_(t=>t.uuid),yl={instances:{}},Hs=o.createSlice({name:"assetTypeFieldValues",initialState:yl,extraReducers:t=>t.addMatcher(o.isAnyOf(O,D,b),s=>Object.assign(s,yl)),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:pl,addAssetTypeFieldValues:Al,addAssetTypeFieldValuesMany:fl,setAssetTypeFieldValues:Sl,setAssetTypeFieldValuesMany:Tl,updateAssetTypeFieldValues:Il,updateAssetTypeFieldValuesMany:Ol,deleteAssetTypeFieldValues:Pl,deleteAssetTypeFieldValuesMany:Fl}=Hs.actions,gl=t=>t.assetTypeFieldValuesReducer.instances,Mt=o.createSelector([gl],t=>Object.values(t)),fP=f(o.createSelector([Mt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.asset===s)))),SP=f(o.createSelector([mt,Mt,(t,s)=>s],(t,s,e)=>{const n=new Set(t.filter(a=>a.asset_type===e).map(a=>a.uuid));return S(s.filter(a=>n.has(a.fields_revision)))})),_l=t=>s=>s.assetTypeFieldValuesReducer.instances[t],bl=f(o.createSelector([Mt,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),Ml=Hs.reducer,he=_(t=>t.uuid),Rl={instances:{}},Ws=o.createSlice({name:"assetTypeIdentifiers",initialState:Rl,extraReducers:t=>t.addMatcher(o.isAnyOf(O,b),s=>Object.assign(s,Rl)),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:wl,addAssetTypeIdentifier:El,addAssetTypeIdentifiers:Bl,setAssetTypeIdentifier:vl,setAssetTypeIdentifiers:Vl,updateAssetTypeIdentifier:zl,updateAssetTypeIdentifiers:jl,deleteAssetTypeIdentifier:Dl,deleteAssetTypeIdentifiers:ql}=Ws.actions,$l=t=>t.assetTypeIdentifierReducer.instances,Ks=o.createSelector([$l],t=>Object.values(t)),Cl=t=>s=>s.assetTypeIdentifierReducer.instances[t],Ul=f(o.createSelector([Ks,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),TP=f(o.createSelector([Ks,(t,s)=>s],(t,s)=>S(t.filter(e=>e.asset_type===s)))),Ll=Ws.reducer,me=_(t=>t.uuid),kl={instances:{}},Ys=o.createSlice({name:"assetTypeIdentifierValues",initialState:kl,extraReducers:t=>t.addMatcher(o.isAnyOf(O,D,b),s=>Object.assign(s,kl)),reducers:{initializeAssetTypeIdentifierValues:me.initialize,addAssetTypeIdentifierValue:me.addOne,addAssetTypeIdentifierValues:me.addMany,setAssetTypeIdentifierValue:me.setOne,setAssetTypeIdentifierValues:me.setMany,updateAssetTypeIdentifierValue:me.updateOne,updateAssetTypeIdentifierValues:me.updateMany,deleteAssetTypeIdentifierValue:me.deleteOne,deleteAssetTypeIdentifierValues:me.deleteMany}}),{initializeAssetTypeIdentifierValues:Nl,addAssetTypeIdentifierValue:Gl,addAssetTypeIdentifierValues:Hl,setAssetTypeIdentifierValue:Wl,setAssetTypeIdentifierValues:Kl,updateAssetTypeIdentifierValue:Yl,updateAssetTypeIdentifierValues:Zl,deleteAssetTypeIdentifierValue:Jl,deleteAssetTypeIdentifierValues:Xl}=Ys.actions,Ql=t=>t.assetTypeIdentifierValueReducer.instances,Rt=o.createSelector([Ql],t=>Object.values(t)),xl=t=>s=>s.assetTypeIdentifierValueReducer.instances[t],eo=f(o.createSelector([Rt,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),IP=f(o.createSelector([Rt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.asset===s)))),OP=f(o.createSelector([Rt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.asset_type_identifier===s)))),to=Ys.reducer,ye=_(t=>t.uuid),so={instances:{}},Zs=o.createSlice({name:"assetTypes",initialState:so,extraReducers:t=>t.addMatcher(o.isAnyOf(O,b),s=>Object.assign(s,so)),reducers:{initializeAssetTypes:ye.initialize,setAssetType:ye.setOne,setAssetTypes:ye.setMany,addAssetType:ye.addOne,addAssetTypes:ye.addMany,updateAssetType:ye.updateOne,updateAssetTypes:ye.updateMany,deleteAssetType:ye.deleteOne,deleteAssetTypes:ye.deleteMany}}),{initializeAssetTypes:io,setAssetType:no,setAssetTypes:ao,addAssetType:co,addAssetTypes:ro,updateAssetType:uo,updateAssetTypes:lo,deleteAssetType:oo,deleteAssetTypes:ho}=Zs.actions,mo=t=>t.assetTypeReducer.instances,Js=o.createSelector([mo],t=>Object.values(t)),yo=t=>s=>s.assetTypeReducer.instances[t],po=f(o.createSelector([Js,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),PP=f(o.createSelector([Js,(t,s)=>s],(t,s)=>S(t.filter(e=>e.organization===s)))),Ao=Zs.reducer,pe=_(t=>t.uuid),fo={instances:{}},Xs=o.createSlice({name:"assetTypeStatuses",initialState:fo,extraReducers:t=>t.addMatcher(o.isAnyOf(O,b),s=>Object.assign(s,fo)),reducers:{initializeAssetTypeStatuses:pe.initialize,addAssetTypeStatus:pe.addOne,addAssetTypeStatuses:pe.addMany,setAssetTypeStatus:pe.setOne,setAssetTypeStatuses:pe.setMany,updateAssetTypeStatus:pe.updateOne,updateAssetTypeStatuses:pe.updateMany,deleteAssetTypeStatus:pe.deleteOne,deleteAssetTypeStatuses:pe.deleteMany}}),{initializeAssetTypeStatuses:So,addAssetTypeStatus:To,addAssetTypeStatuses:Io,setAssetTypeStatus:Oo,setAssetTypeStatuses:Po,updateAssetTypeStatus:Fo,updateAssetTypeStatuses:go,deleteAssetTypeStatus:_o,deleteAssetTypeStatuses:bo}=Xs.actions,Mo=t=>t.assetTypeStatusReducer.instances,Qs=o.createSelector([Mo],t=>S(Object.values(t).toSorted(sa))),Ro=t=>s=>s.assetTypeStatusReducer.instances[t],wo=f(o.createSelector([Qs,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),FP=f(o.createSelector([Qs,(t,s)=>s],(t,s)=>S(t.filter(e=>e.asset_type===s)))),Eo=Xs.reducer,Bo={accessToken:"",refreshToken:"",isLoggedIn:!1},wt=o.createSlice({name:"auth",initialState:Bo,extraReducers:t=>t.addCase(O,s=>Object.assign(s,Bo)),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||wt.caseReducers.clearTokens(t),t.isLoggedIn=s.payload}}}),{setTokens:gP,clearTokens:_P,setLoggedIn:vo}=wt.actions,bP=t=>t.authReducer.accessToken,MP=t=>t.authReducer.isLoggedIn,Vo=wt.reducer,Ae=_(t=>t.uuid),zo={instances:{}},xs=o.createSlice({name:"documentAttachments",initialState:zo,extraReducers:t=>t.addCase(O,s=>Object.assign(s,zo)),reducers:{initializeDocumentAttachments:Ae.initialize,addDocumentAttachment:Ae.addOne,addDocumentAttachments:Ae.addMany,setDocumentAttachment:Ae.setOne,setDocumentAttachments:Ae.setMany,updateDocumentAttachment:Ae.updateOne,updateDocumentAttachments:Ae.updateMany,deleteDocumentAttachment:Ae.deleteOne,deleteDocumentAttachments:Ae.deleteMany}}),{initializeDocumentAttachments:jo,addDocumentAttachment:Do,addDocumentAttachments:qo,setDocumentAttachment:$o,setDocumentAttachments:Co,updateDocumentAttachment:Uo,updateDocumentAttachments:Lo,deleteDocumentAttachment:ko,deleteDocumentAttachments:No}=xs.actions,Go=t=>t.documentAttachmentReducer.instances,ei=o.createSelector([Go],t=>Object.values(t)),Ho=t=>s=>s.documentAttachmentReducer.instances[t],Wo=f(o.createSelector([ei,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),RP=f(o.createSelector([ei,(t,s)=>s],(t,s)=>S(t.filter(({document:e})=>s===e)))),Ko=xs.reducer,fe=_(({uuid:t})=>t),Yo={instances:{}},ti=o.createSlice({name:"documents",initialState:Yo,extraReducers:t=>t.addMatcher(o.isAnyOf(O,b),s=>{Object.assign(s,Yo)}),reducers:{initializeDocuments:fe.initialize,addDocument:fe.addOne,addDocuments:fe.addMany,setDocument:fe.setOne,setDocuments:fe.setMany,updateDocument:fe.updateOne,updateDocuments:fe.updateMany,deleteDocument:fe.deleteOne,deleteDocuments:fe.deleteMany}}),{initializeDocuments:Zo,addDocument:Jo,addDocuments:Xo,setDocument:Qo,setDocuments:xo,updateDocument:eh,updateDocuments:th,deleteDocument:sh,deleteDocuments:ih}=ti.actions,nh=ti.reducer,si=t=>t.documentsReducer.instances,Et=o.createSelector([si],t=>Object.values(t)),ah=t=>s=>s.documentsReducer.instances[t],ch=f(o.createSelector([Et,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),wP=f(o.createSelector([Et,(t,s)=>s],(t,s)=>t.filter(e=>e.project===s))),EP=f(o.createSelector([Et,(t,s)=>s],(t,s)=>t.filter(e=>e.organization===s))),dh=f(o.createSelector([si,(t,s)=>s],(t,s)=>{if(!t[s])return S([]);const a=aa(s,Object.values(t)).all().map(({model:c})=>c);return S(a)})),Se=_(t=>t.uuid),rh={instances:{}},ii=o.createSlice({name:"emailDomains",initialState:rh,extraReducers:t=>t.addMatcher(o.isAnyOf(O,b),s=>Object.assign(s,rh)),reducers:{initializeEmailDomains:Se.initialize,addEmailDomain:Se.addOne,addEmailDomains:Se.addMany,setEmailDomain:Se.setOne,setEmailDomains:Se.setMany,updateEmailDomain:Se.updateOne,updateEmailDomains:Se.updateMany,deleteEmailDomain:Se.deleteOne,deleteEmailDomains:Se.deleteMany}}),{initializeEmailDomains:uh,addEmailDomain:lh,addEmailDomains:oh,setEmailDomain:hh,setEmailDomains:mh,updateEmailDomain:yh,updateEmailDomains:ph,deleteEmailDomain:Ah,deleteEmailDomains:fh}=ii.actions,Sh=t=>t.emailDomainsReducer.instances,ni=o.createSelector([Sh],t=>Object.values(t)),Th=t=>s=>s.emailDomainsReducer.instances[t],Ih=f(o.createSelector([ni,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),BP=f(o.createSelector([ni,(t,s)=>s],(t,s)=>S(t.filter(e=>e.organization===s)))),Oh=ii.reducer,Ph={s3Urls:{}},Fh=1e3*60*60,vP=Fh*24*7,ai=o.createSlice({name:"file",initialState:Ph,extraReducers:t=>t.addCase(O,s=>Object.assign(s,Ph)),reducers:{setUploadUrl:(t,s)=>{const{url:e,fields:n,sha1:a}=s.payload,c=new Date,d=new Date(c.getTime()+vP);t.s3Urls[a]={url:e,fields:n,exp:d.getTime()}}}}),{setUploadUrl:VP}=ai.actions,zP=t=>s=>{const e=s.fileReducer.s3Urls[t];if(!e)return;const n=new Date().getTime();if(!((e.exp??n)-n<Fh))return e},gh=ai.reducer,Te=_(t=>t.uuid),_h={instances:{}},ci=o.createSlice({name:"formIdentifiers",initialState:_h,extraReducers:t=>t.addMatcher(o.isAnyOf(O,b),s=>Object.assign(s,_h)),reducers:{initializeFormIdentifiers:Te.initialize,addFormIdentifier:Te.addOne,addFormIdentifiers:Te.addMany,setFormIdentifier:Te.setOne,setFormIdentifiers:Te.setMany,updateFormIdentifier:Te.updateOne,updateFormIdentifiers:Te.updateMany,deleteFormIdentifier:Te.deleteOne,deleteFormIdentifiers:Te.deleteMany}}),{initializeFormIdentifiers:bh,addFormIdentifier:Mh,addFormIdentifiers:Rh,setFormIdentifier:wh,setFormIdentifiers:Eh,updateFormIdentifier:Bh,updateFormIdentifiers:vh,deleteFormIdentifier:Vh,deleteFormIdentifiers:zh}=ci.actions,jh=t=>t.formIdentifierReducer.instances,di=o.createSelector([jh],t=>Object.values(t)),Dh=t=>s=>s.formIdentifierReducer.instances[t],qh=f(o.createSelector([di,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),jP=f(o.createSelector([di,(t,s)=>s],(t,s)=>S(t.filter(e=>e.form===s)))),$h=ci.reducer,Ie=_(t=>t.uuid),Ch={instances:{}},ri=o.createSlice({name:"formIdentifierValues",initialState:Ch,extraReducers:t=>t.addMatcher(o.isAnyOf(O,b),s=>Object.assign(s,Ch)),reducers:{initializeFormIdentifierValues:Ie.initialize,addFormIdentifierValue:Ie.addOne,addFormIdentifierValues:Ie.addMany,setFormIdentifierValue:Ie.setOne,setFormIdentifierValues:Ie.setMany,updateFormIdentifierValue:Ie.updateOne,updateFormIdentifierValues:Ie.updateMany,deleteFormIdentifierValue:Ie.deleteOne,deleteFormIdentifierValues:Ie.deleteMany}}),{initializeFormIdentifierValues:Uh,addFormIdentifierValue:Lh,addFormIdentifierValues:kh,setFormIdentifierValue:Nh,setFormIdentifierValues:Gh,updateFormIdentifierValue:Hh,updateFormIdentifierValues:Wh,deleteFormIdentifierValue:Kh,deleteFormIdentifierValues:Yh}=ri.actions,Zh=t=>t.formIdentifierValueReducer.instances,Bt=o.createSelector([Zh],t=>Object.values(t)),Jh=t=>s=>s.formIdentifierValueReducer.instances[t],Xh=f(o.createSelector([Bt,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),DP=f(o.createSelector([Bt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.form_submission===s)))),qP=f(o.createSelector([Bt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.form_identifier===s)))),Qh=ri.reducer,Oe=_(t=>t.uuid),xh={instances:{}},ui=o.createSlice({name:"formRevisionAttachments",initialState:xh,extraReducers:t=>t.addMatcher(o.isAnyOf(O,b),s=>Object.assign(s,xh)),reducers:{initializeFormRevisionAttachments:Oe.initialize,addFormRevisionAttachment:Oe.addOne,addFormRevisionAttachments:Oe.addMany,setFormRevisionAttachment:Oe.setOne,setFormRevisionAttachments:Oe.setMany,updateFormRevisionAttachment:Oe.updateOne,updateFormRevisionAttachments:Oe.updateMany,deleteFormRevisionAttachment:Oe.deleteOne,deleteFormRevisionAttachments:Oe.deleteMany}}),{initializeFormRevisionAttachments:em,addFormRevisionAttachment:tm,addFormRevisionAttachments:sm,setFormRevisionAttachment:im,setFormRevisionAttachments:nm,updateFormRevisionAttachment:am,updateFormRevisionAttachments:cm,deleteFormRevisionAttachment:dm,deleteFormRevisionAttachments:rm}=ui.actions,vt=t=>t.formRevisionAttachmentReducer.instances,um=o.createSelector([vt],t=>Object.values(t)),lm=f(o.createSelector([vt,(t,s)=>s],(t,s)=>t[s])),om=f(o.createSelector([um,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),$P=f(o.createSelector([vt,(t,s)=>s],(t,s)=>S(Object.values(t).filter(e=>e.form_revision===s)))),hm=ui.reducer,Pe=_(t=>t.uuid),mm={instances:{}},li=o.createSlice({name:"formRevisions",initialState:mm,extraReducers:t=>t.addMatcher(o.isAnyOf(O,b),s=>Object.assign(s,mm)),reducers:{initializeFormRevisions:Pe.initialize,addFormRevision:Pe.addOne,addFormRevisions:Pe.addMany,setFormRevision:Pe.setOne,setFormRevisions:Pe.setMany,updateFormRevision:Pe.updateOne,updateFormRevisions:Pe.updateMany,deleteFormRevision:Pe.deleteOne,deleteFormRevisions:Pe.deleteMany}}),{initializeFormRevisions:ym,addFormRevision:oi,addFormRevisions:hi,setFormRevision:pm,setFormRevisions:Am,updateFormRevision:fm,updateFormRevisions:Sm,deleteFormRevision:mi,deleteFormRevisions:yi}=li.actions,pi=t=>t.formRevisionReducer.instances,Vt=o.createSelector([pi],t=>Object.values(t)),Tm=t=>s=>s.formRevisionReducer.instances[t],Im=f(o.createSelector([Vt,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),CP=f(o.createSelector([Vt,(t,s)=>s],(t,s)=>t.filter(e=>e.form===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),Om=f(o.createSelector([Vt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.form===s)))),Pm=li.reducer,Fe=_(t=>t.uuid),Fm={instances:{}},Ai=o.createSlice({name:"forms",initialState:Fm,extraReducers:t=>t.addMatcher(o.isAnyOf(O,b),s=>Object.assign(s,Fm)),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:gm,addForm:_m,addForms:bm,setForm:Mm,setForms:Rm,updateForm:wm,updateForms:Em,deleteForm:Bm,deleteForms:vm}=Ai.actions,Vm=Ai.reducer,zm=t=>t.formReducer.instances,fi=o.createSelector([zm],t=>Object.values(t)),jm=t=>s=>s.formReducer.instances[t],Dm=f(o.createSelector([fi,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),UP=f(o.createSelector([fi,(t,s)=>s],(t,s)=>S(t.filter(e=>e.organization===s)))),ge=_(t=>t.uuid),qm={instances:{}},Si=o.createSlice({name:"formSubmissionAttachments",initialState:qm,extraReducers:t=>t.addMatcher(o.isAnyOf(O,b),s=>Object.assign(s,qm)),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:$m,addFormSubmissionAttachment:Cm,addFormSubmissionAttachments:Ti,setFormSubmissionAttachment:Um,setFormSubmissionAttachments:Lm,updateFormSubmissionAttachment:km,updateFormSubmissionAttachments:Nm,deleteFormSubmissionAttachment:Gm,deleteFormSubmissionAttachments:Ii}=Si.actions,Oi=t=>t.formSubmissionAttachmentReducer.instances,Pi=o.createSelector([Oi],t=>Object.values(t)),Hm=f(o.createSelector([Oi,(t,s)=>s],(t,s)=>t[s])),Fi=f(o.createSelector([Pi,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(n=>e.has(n.uuid)))})),Wm=Fi,Km=f(o.createSelector([Pi,(t,s)=>s],(t,s)=>S(t.filter(e=>e.form_submission===s)))),Ym=Si.reducer,_e=_(t=>t.uuid),Zm={instances:{}},gi=o.createSlice({name:"formSubmissions",initialState:Zm,extraReducers:t=>t.addMatcher(o.isAnyOf(O,b),s=>Object.assign(s,Zm)),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:Jm,setFormSubmission:Xm,setFormSubmissions:Qm,addFormSubmission:xm,addFormSubmissions:_i,updateFormSubmission:ey,updateFormSubmissions:ty,deleteFormSubmission:sy,deleteFormSubmissions:bi}=gi.actions,Mi=t=>t.formSubmissionReducer.instances,iy=o.createSelector([Mi],t=>Object.values(t)),ny=t=>s=>s.formSubmissionReducer.instances[t],ay=f(o.createSelector([iy,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),cy=f(o.createSelector([Mi,pi,(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))})),dy=gi.reducer,be=_(t=>t.uuid),ry={instances:{}},Ri=o.createSlice({name:"geoImages",initialState:ry,extraReducers:t=>t.addMatcher(o.isAnyOf(O,D,b),s=>Object.assign(s,ry)),reducers:{initializeGeoImages:be.initialize,setGeoImage:be.setOne,setGeoImages:be.setMany,addGeoImage:be.addOne,addGeoImages:be.addMany,updateGeoImage:be.updateOne,updateGeoImages:be.updateMany,deleteGeoImage:be.deleteOne,deleteGeoImages:be.deleteMany}}),{initializeGeoImages:uy,setGeoImage:ly,setGeoImages:oy,addGeoImage:hy,addGeoImages:my,updateGeoImage:yy,updateGeoImages:py,deleteGeoImage:Ay,deleteGeoImages:fy}=Ri.actions,Sy=t=>t.geoImageReducer.instances,wi=o.createSelector([Sy],t=>Object.values(t)),Ty=t=>s=>s.geoImageReducer.instances[t],Iy=f(o.createSelector([wi,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),LP=f(o.createSelector([wi,(t,s)=>s],(t,s)=>S(t.filter(e=>e.project===s)))),Oy=Ri.reducer,Me=_(t=>t.uuid),Py={instances:{}},Ei=o.createSlice({name:"issueAssociations",initialState:Py,extraReducers:t=>t.addMatcher(o.isAnyOf(O,D,b),s=>Object.assign(s,Py)),reducers:{initializeIssueAssociations:Me.initialize,addIssueAssociation:Me.addOne,addIssueAssociations:Me.addMany,setIssueAssociation:Me.setOne,setIssueAssociations:Me.setMany,updateIssueAssociation:Me.updateOne,updateIssueAssociations:Me.updateMany,deleteIssueAssociation:Me.deleteOne,deleteIssueAssociations:Me.deleteMany}}),{initializeIssueAssociations:Fy,setIssueAssociations:gy,setIssueAssociation:_y,updateIssueAssociation:by,updateIssueAssociations:My,addIssueAssociation:Ry,addIssueAssociations:et,deleteIssueAssociation:wy,deleteIssueAssociations:tt}=Ei.actions,Ey=t=>t.issueAssociationReducer.instances,st=o.createSelector([Ey],t=>Object.values(t)),By=t=>s=>s.issueAssociationReducer.instances[t],vy=f(o.createSelector([st,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),Vy=f(o.createSelector([st,(t,s)=>s],(t,s)=>S(t.filter(({associated_issue:e})=>e===s)))),zy=f(o.createSelector([st,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({associated_issue:n})=>e.has(n)))})),jy=f(o.createSelector([st,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({issue:n})=>n&&e.has(n)))})),Dy=f(o.createSelector([st,(t,s)=>s],(t,s)=>S(t.filter(({issue:e})=>e===s)))),qy=f(o.createSelector([st,(t,s)=>s],(t,s)=>S(t.filter(({asset:e})=>e===s)))),$y=Ei.reducer,Re=_(t=>t.uuid),Cy={instances:{}},Bi=o.createSlice({name:"issueAttachments",initialState:Cy,extraReducers:t=>t.addMatcher(o.isAnyOf(O,D,b),s=>Object.assign(s,Cy)),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:Uy,addIssueAttachment:Ly,addIssueAttachments:vi,setIssueAttachment:ky,setIssueAttachments:Ny,updateIssueAttachment:Gy,updateIssueAttachments:Hy,deleteIssueAttachment:Wy,deleteIssueAttachments:Vi}=Bi.actions,Ky=t=>t.issueAttachmentReducer.instances,zi=o.createSelector([Ky],t=>Object.values(t)),Yy=f(o.createSelector([zi,(t,s)=>s],(t,s)=>S(t.filter(({issue:e})=>s===e)))),Zy=t=>s=>s.issueAttachmentReducer.instances[t],Jy=f(o.createSelector([zi,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),Xy=Bi.reducer,we=_(t=>t.uuid),Qy={instances:{}},ji=o.createSlice({name:"issueCommentAttachments",initialState:Qy,extraReducers:t=>t.addMatcher(o.isAnyOf(O,D,b),s=>Object.assign(s,Qy)),reducers:{initializeIssueCommentAttachments:we.initialize,addIssueCommentAttachment:we.addOne,addIssueCommentAttachments:we.addMany,setIssueCommentAttachment:we.setOne,setIssueCommentAttachments:we.setMany,updateIssueCommentAttachment:we.updateOne,updateIssueCommentAttachments:we.updateMany,deleteIssueCommentAttachment:we.deleteOne,deleteIssueCommentAttachments:we.deleteMany}}),{initializeIssueCommentAttachments:xy,addIssueCommentAttachment:ep,addIssueCommentAttachments:tp,setIssueCommentAttachment:sp,setIssueCommentAttachments:ip,updateIssueCommentAttachment:np,updateIssueCommentAttachments:ap,deleteIssueCommentAttachment:cp,deleteIssueCommentAttachments:dp}=ji.actions,rp=t=>t.issueCommentAttachmentReducer.instances,Di=o.createSelector([rp],t=>Object.values(t)),up=t=>s=>s.issueCommentAttachmentReducer.instances[t],lp=f(o.createSelector([Di,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),kP=f(o.createSelector([Di,(t,s)=>s],(t,s)=>S(t.filter(({issue_comment:e})=>s===e)))),op=ji.reducer,Ee=_(t=>t.uuid),hp={instances:{}},qi=o.createSlice({name:"issueComments",initialState:hp,extraReducers:t=>t.addMatcher(o.isAnyOf(O,D,b),s=>Object.assign(s,hp)),reducers:{initializeIssueComments:Ee.initialize,addIssueComment:Ee.addOne,addIssueComments:Ee.addMany,setIssueComment:Ee.setOne,setIssueComments:Ee.setMany,updateIssueComment:Ee.updateOne,updateIssueComments:Ee.updateMany,deleteIssueComment:Ee.deleteOne,deleteIssueComments:Ee.deleteMany}}),{initializeIssueComments:mp,addIssueComment:yp,addIssueComments:pp,setIssueComment:Ap,setIssueComments:fp,updateIssueComment:Sp,updateIssueComments:Tp,deleteIssueComment:Ip,deleteIssueComments:Op}=qi.actions,$i=t=>t.issueCommentReducer.instances,Pp=t=>s=>s.issueCommentReducer.instances[t],Fp=f(o.createSelector([$i,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(Object.values(t).filter(({uuid:n})=>e.has(n)))})),NP=f(o.createSelector([$i,(t,s)=>s],(t,s)=>S(Object.values(t).filter(e=>e.issue===s)))),gp=qi.reducer,Be=_(t=>t.uuid),_p={instances:{}},Ci=o.createSlice({name:"issues",initialState:_p,extraReducers:t=>t.addMatcher(o.isAnyOf(O,D,b),s=>Object.assign(s,_p)),reducers:{initializeIssues:Be.initialize,addIssue:Be.addOne,addIssues:Be.addMany,setIssue:Be.setOne,setIssues:Be.setMany,updateIssue:Be.updateOne,updateIssues:Be.updateMany,deleteIssue:Be.deleteOne,deleteIssues:Be.deleteMany}}),{initializeIssues:bp,addIssue:Mp,addIssues:Ui,setIssue:Rp,setIssues:wp,updateIssue:Ep,updateIssues:Bp,deleteIssue:vp,deleteIssues:Li}=Ci.actions,Vp=t=>t.issueReducer.instances,zt=o.createSelector([Vp],t=>Object.values(t)),zp=t=>s=>s.issueReducer.instances[t],jp=f(o.createSelector([zt,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),GP=f(o.createSelector([zt,(t,s)=>s],(t,s)=>t.filter(e=>e.project===s))),Dp=f(o.createSelector([zt,(t,s)=>s],(t,s)=>t.filter(e=>e.issue_type===s))),qp=Ci.reducer,ve=_(t=>t.uuid),$p={instances:{}},ki=o.createSlice({name:"issueTypeAttachments",initialState:$p,extraReducers:t=>t.addMatcher(o.isAnyOf(O,b),s=>Object.assign(s,$p)),reducers:{initializeIssueTypeAttachments:ve.initialize,addIssueTypeAttachment:ve.addOne,addIssueTypeAttachments:ve.addMany,setIssueTypeAttachment:ve.setOne,setIssueTypeAttachments:ve.setMany,updateIssueTypeAttachment:ve.updateOne,updateIssueTypeAttachments:ve.updateMany,deleteIssueTypeAttachment:ve.deleteOne,deleteIssueTypeAttachments:ve.deleteMany}}),{initializeIssueTypeAttachments:Cp,addIssueTypeAttachment:Up,addIssueTypeAttachments:Lp,setIssueTypeAttachment:kp,setIssueTypeAttachments:Np,updateIssueTypeAttachment:Gp,updateIssueTypeAttachments:Hp,deleteIssueTypeAttachment:Wp,deleteIssueTypeAttachments:Kp}=ki.actions,Yp=t=>t.issueTypeAttachmentReducer.instances,Ni=o.createSelector([Yp],t=>Object.values(t)),Zp=t=>s=>s.issueTypeAttachmentReducer.instances[t],Jp=f(o.createSelector([Ni,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),HP=f(o.createSelector([Ni,(t,s)=>s],(t,s)=>S(t.filter(({issue_type:e})=>s===e)))),Xp=ki.reducer,Ve=_(t=>t.uuid),Qp={instances:{}},Gi=o.createSlice({name:"issueTypeFieldsAttachments",initialState:Qp,extraReducers:t=>t.addMatcher(o.isAnyOf(O,b),s=>Object.assign(s,Qp)),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:xp,addIssueTypeFieldsAttachment:eA,addIssueTypeFieldsAttachments:tA,setIssueTypeFieldsAttachment:sA,setIssueTypeFieldsAttachments:iA,updateIssueTypeFieldsAttachment:nA,updateIssueTypeFieldsAttachments:aA,deleteIssueTypeFieldsAttachment:cA,deleteIssueTypeFieldsAttachments:dA}=Gi.actions,rA=t=>t.issueTypeFieldsAttachmentReducer.instances,Hi=o.createSelector([rA],t=>Object.values(t)),WP=f(o.createSelector([Hi,(t,s)=>s],(t,s)=>S(t.filter(e=>e.fields_revision===s)))),uA=t=>s=>s.issueTypeFieldsAttachmentReducer.instances[t],lA=f(o.createSelector([Hi,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),oA=Gi.reducer,ze=_(t=>t.uuid),hA={instances:{}},Wi=o.createSlice({name:"issueTypeFieldValues",initialState:hA,extraReducers:t=>t.addMatcher(o.isAnyOf(O,D,b),s=>Object.assign(s,hA)),reducers:{initializeIssueTypeFieldValues:ze.initialize,addIssueTypeFieldValues:ze.addOne,addIssueTypeFieldValuesMany:ze.addMany,setIssueTypeFieldValues:ze.setOne,setIssueTypeFieldValuesMany:ze.setMany,updateIssueTypeFieldValues:ze.updateOne,updateIssueTypeFieldValuesMany:ze.updateMany,deleteIssueTypeFieldValues:ze.deleteOne,deleteIssueTypeFieldValuesMany:ze.deleteMany}}),{initializeIssueTypeFieldValues:mA,addIssueTypeFieldValues:yA,addIssueTypeFieldValuesMany:pA,setIssueTypeFieldValues:AA,setIssueTypeFieldValuesMany:fA,updateIssueTypeFieldValues:SA,updateIssueTypeFieldValuesMany:TA,deleteIssueTypeFieldValues:IA,deleteIssueTypeFieldValuesMany:OA}=Wi.actions,PA=t=>t.issueTypeFieldValuesReducer.instances,jt=o.createSelector([PA],t=>Object.values(t)),KP=f(o.createSelector([jt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.issue===s)))),FA=t=>s=>s.issueTypeFieldValuesReducer.instances[t],gA=f(o.createSelector([jt,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),_A=Wi.reducer,je=_(t=>t.uuid),bA={instances:{}},Ki=o.createSlice({name:"issueTypeFields",initialState:bA,extraReducers:t=>t.addMatcher(o.isAnyOf(O,b),s=>Object.assign(s,bA)),reducers:{initializeIssueTypeFields:je.initialize,addIssueTypeFields:je.addOne,addIssueTypeFieldsMany:je.addMany,setIssueTypeFields:je.setOne,setIssueTypeFieldsMany:je.setMany,updateIssueTypeFields:je.updateOne,updateIssueTypeFieldsMany:je.updateMany,deleteIssueTypeFields:je.deleteOne,deleteIssueTypeFieldsMany:je.deleteMany}}),{initializeIssueTypeFields:MA,addIssueTypeFields:RA,addIssueTypeFieldsMany:wA,setIssueTypeFields:EA,setIssueTypeFieldsMany:BA,updateIssueTypeFields:vA,updateIssueTypeFieldsMany:VA,deleteIssueTypeFields:zA,deleteIssueTypeFieldsMany:jA}=Ki.actions,DA=t=>t.issueTypeFieldsReducer.instances,yt=o.createSelector([DA],t=>Object.values(t)),YP=f(o.createSelector([yt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.issue_type===s)))),ZP=f(o.createSelector([yt,(t,s)=>s],(t,s)=>t.filter(e=>e.issue_type===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),JP=f(o.createSelector([yt,jt,(t,s)=>s],(t,s,e)=>{const n=new Set(t.filter(a=>a.issue_type===e).map(a=>a.uuid));return S(s.filter(a=>n.has(a.fields_revision)))})),qA=t=>s=>s.issueTypeFieldsReducer.instances[t],$A=f(o.createSelector([yt,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),CA=Ki.reducer,De=_(t=>t.uuid),UA={instances:{}},Yi=o.createSlice({name:"issueTypeFieldValuesAttachments",initialState:UA,extraReducers:t=>t.addMatcher(o.isAnyOf(O,D,b),s=>Object.assign(s,UA)),reducers:{initializeIssueTypeFieldValuesAttachments:De.initialize,addIssueTypeFieldValuesAttachment:De.addOne,addIssueTypeFieldValuesAttachments:De.addMany,setIssueTypeFieldValuesAttachment:De.setOne,setIssueTypeFieldValuesAttachments:De.setMany,updateIssueTypeFieldValuesAttachment:De.updateOne,updateIssueTypeFieldValuesAttachments:De.updateMany,deleteIssueTypeFieldValuesAttachment:De.deleteOne,deleteIssueTypeFieldValuesAttachments:De.deleteMany}}),{initializeIssueTypeFieldValuesAttachments:LA,addIssueTypeFieldValuesAttachment:kA,addIssueTypeFieldValuesAttachments:Zi,setIssueTypeFieldValuesAttachment:NA,setIssueTypeFieldValuesAttachments:GA,updateIssueTypeFieldValuesAttachment:HA,updateIssueTypeFieldValuesAttachments:WA,deleteIssueTypeFieldValuesAttachment:KA,deleteIssueTypeFieldValuesAttachments:Ji}=Yi.actions,YA=t=>t.issueTypeFieldValuesAttachmentReducer.instances,Xi=o.createSelector([YA],t=>Object.values(t)),ZA=t=>s=>s.issueTypeFieldValuesAttachmentReducer.instances[t],JA=f(o.createSelector([Xi,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),XA=f(o.createSelector([Xi,(t,s)=>s],(t,s)=>S(t.filter(e=>e.field_values===s)))),QA=Yi.reducer,qe=_(t=>t.uuid),xA={instances:{}},Qi=o.createSlice({name:"issueTypeIdentifiers",initialState:xA,extraReducers:t=>t.addMatcher(o.isAnyOf(O,b),s=>Object.assign(s,xA)),reducers:{initializeIssueTypeIdentifiers:qe.initialize,addIssueTypeIdentifier:qe.addOne,addIssueTypeIdentifiers:qe.addMany,setIssueTypeIdentifier:qe.setOne,setIssueTypeIdentifiers:qe.setMany,updateIssueTypeIdentifier:qe.updateOne,updateIssueTypeIdentifiers:qe.updateMany,deleteIssueTypeIdentifier:qe.deleteOne,deleteIssueTypeIdentifiers:qe.deleteMany}}),{initializeIssueTypeIdentifiers:ef,addIssueTypeIdentifier:tf,addIssueTypeIdentifiers:sf,setIssueTypeIdentifier:nf,setIssueTypeIdentifiers:af,updateIssueTypeIdentifier:cf,updateIssueTypeIdentifiers:df,deleteIssueTypeIdentifier:rf,deleteIssueTypeIdentifiers:uf}=Qi.actions,lf=t=>t.issueTypeIdentifierReducer.instances,xi=o.createSelector([lf],t=>Object.values(t)),of=t=>s=>s.issueTypeIdentifierReducer.instances[t],hf=f(o.createSelector([xi,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),XP=f(o.createSelector([xi,(t,s)=>s],(t,s)=>S(t.filter(e=>e.issue_type===s)))),mf=Qi.reducer,$e=_(t=>t.uuid),yf={instances:{}},en=o.createSlice({name:"issueTypeIdentifierValues",initialState:yf,extraReducers:t=>t.addMatcher(o.isAnyOf(O,D,b),s=>Object.assign(s,yf)),reducers:{initializeIssueTypeIdentifierValues:$e.initialize,addIssueTypeIdentifierValue:$e.addOne,addIssueTypeIdentifierValues:$e.addMany,setIssueTypeIdentifierValue:$e.setOne,setIssueTypeIdentifierValues:$e.setMany,updateIssueTypeIdentifierValue:$e.updateOne,updateIssueTypeIdentifierValues:$e.updateMany,deleteIssueTypeIdentifierValue:$e.deleteOne,deleteIssueTypeIdentifierValues:$e.deleteMany}}),{initializeIssueTypeIdentifierValues:pf,addIssueTypeIdentifierValue:Af,addIssueTypeIdentifierValues:ff,setIssueTypeIdentifierValue:Sf,setIssueTypeIdentifierValues:Tf,updateIssueTypeIdentifierValue:If,updateIssueTypeIdentifierValues:Of,deleteIssueTypeIdentifierValue:Pf,deleteIssueTypeIdentifierValues:Ff}=en.actions,gf=t=>t.issueTypeIdentifierValueReducer.instances,Dt=o.createSelector([gf],t=>Object.values(t)),_f=t=>s=>s.issueTypeIdentifierValueReducer.instances[t],bf=f(o.createSelector([Dt,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),QP=f(o.createSelector([Dt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.issue===s)))),xP=f(o.createSelector([Dt,(t,s)=>s],(t,s)=>S(t.filter(e=>e.issue_type_identifier===s)))),Mf=en.reducer,Ce=_(t=>t.uuid),Rf={instances:{}},tn=o.createSlice({name:"issueTypes",initialState:Rf,extraReducers:t=>t.addMatcher(o.isAnyOf(O,b),s=>Object.assign(s,Rf)),reducers:{initializeIssueTypes:Ce.initialize,addIssueType:Ce.addOne,addIssueTypes:Ce.addMany,setIssueType:Ce.setOne,setIssueTypes:Ce.setMany,updateIssueType:Ce.updateOne,updateIssueTypes:Ce.updateMany,deleteIssueType:Ce.deleteOne,deleteIssueTypes:Ce.deleteMany}}),{initializeIssueTypes:wf,addIssueType:Ef,addIssueTypes:Bf,setIssueType:vf,setIssueTypes:Vf,updateIssueType:zf,updateIssueTypes:jf,deleteIssueType:Df,deleteIssueTypes:qf}=tn.actions,$f=t=>t.issueTypeReducer.instances,sn=o.createSelector($f,t=>Object.values(t)),Cf=t=>s=>s.issueTypeReducer.instances[t],Uf=f(o.createSelector([sn,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),eF=f(o.createSelector([sn,(t,s)=>s],(t,s)=>S(t.filter(e=>e.organization===s)))),Lf=tn.reducer,Ue=_(t=>t.uuid),kf={instances:{}},nn=o.createSlice({name:"issueTypeStatuses",initialState:kf,extraReducers:t=>t.addMatcher(o.isAnyOf(O,b),s=>Object.assign(s,kf)),reducers:{initializeIssueTypeStatuses:Ue.initialize,addIssueTypeStatus:Ue.addOne,addIssueTypeStatuses:Ue.addMany,setIssueTypeStatus:Ue.setOne,setIssueTypeStatuses:Ue.setMany,updateIssueTypeStatus:Ue.updateOne,updateIssueTypeStatuses:Ue.updateMany,deleteIssueTypeStatus:Ue.deleteOne,deleteIssueTypeStatuses:Ue.deleteMany}}),{initializeIssueTypeStatuses:Nf,addIssueTypeStatus:Gf,addIssueTypeStatuses:Hf,setIssueTypeStatus:Wf,setIssueTypeStatuses:Kf,updateIssueTypeStatus:Yf,updateIssueTypeStatuses:Zf,deleteIssueTypeStatus:Jf,deleteIssueTypeStatuses:Xf}=nn.actions,Qf=t=>t.issueTypeStatusReducer.instances,an=o.createSelector([Qf],t=>S(Object.values(t).toSorted(ia))),cn=t=>s=>s.issueTypeStatusReducer.instances[t],xf=f(o.createSelector([an,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),tF=f(o.createSelector([an,(t,s)=>s],(t,s)=>S(t.filter(e=>e.issue_type===s)))),eS=nn.reducer,Le=_(t=>t.uuid),tS={instances:{}},dn=o.createSlice({name:"issueUpdates",initialState:tS,extraReducers:t=>t.addMatcher(o.isAnyOf(O,D,b),s=>Object.assign(s,tS)),reducers:{initializeIssueUpdates:Le.initialize,addIssueUpdate:Le.addOne,addIssueUpdates:Le.addMany,setIssueUpdate:Le.setOne,setIssueUpdates:Le.setMany,updateIssueUpdate:Le.updateOne,updateIssueUpdates:Le.updateMany,deleteIssueUpdate:Le.deleteOne,deleteIssueUpdates:Le.deleteMany}}),{initializeIssueUpdates:sS,addIssueUpdate:rn,addIssueUpdates:un,setIssueUpdate:iS,setIssueUpdates:nS,updateIssueUpdate:aS,updateIssueUpdates:cS,deleteIssueUpdate:ln,deleteIssueUpdates:on}=dn.actions,hn=t=>t.issueUpdateReducer.instances,mn=o.createSelector([hn],t=>Object.values(t)),dS=f(o.createSelector([hn,(t,s)=>s],(t,s)=>t[s])),rS=f(o.createSelector([mn,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),uS=f(o.createSelector([mn,(t,s)=>s],(t,s)=>S(t.filter(e=>e.issue===s)))),lS=dn.reducer,ke=_(t=>t.id),oS={instances:{},currentUser:null},yn=o.createSlice({name:"users",initialState:oS,extraReducers:t=>t.addCase(O,s=>Object.assign(s,oS)).addCase(b,s=>Object.assign(s,{...s,instances:[]})),reducers:{initializeUsers:ke.initialize,setUsers:ke.setMany,setUser:ke.setOne,addUsers:ke.addMany,addUser:ke.addOne,updateUsers:ke.updateMany,updateUser:ke.updateOne,deleteUser:ke.deleteOne,deleteUsers:ke.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:hS,setUsers:mS,setUser:yS,addUsers:pS,addUser:pn,updateUsers:AS,updateUser:fS,deleteUser:An,deleteUsers:SS,setCurrentUser:sF,setCurrentUserProfile:iF}=yn.actions,TS=yn.reducer,IS=t=>t.userReducer.currentUser,fn=t=>t.userReducer.instances,qt=o.createSelector([fn],t=>Object.values(t)),$t=t=>s=>s.userReducer.instances[t],OS=f(o.createSelector([qt,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({id:n})=>e.has(n)))})),Ne=_(t=>t.uuid),PS={instances:{}},Sn=o.createSlice({name:"organizationAccess",initialState:PS,extraReducers:t=>t.addMatcher(o.isAnyOf(O,b),s=>Object.assign(s,PS)),reducers:{initializeOrganizationAccesses:Ne.initialize,addOrganizationAccess:Ne.addOne,addOrganizationAccesses:Ne.addMany,setOrganizationAccess:Ne.setOne,setOrganizationAccesses:Ne.setMany,updateOrganizationAccess:Ne.updateOne,updateOrganizationAccesses:Ne.updateMany,deleteOrganizationAccess:Ne.deleteOne,deleteOrganizationAccesses:Ne.deleteMany}}),{initializeOrganizationAccesses:FS,addOrganizationAccess:gS,addOrganizationAccesses:_S,setOrganizationAccess:bS,setOrganizationAccesses:MS,updateOrganizationAccess:RS,updateOrganizationAccesses:wS,deleteOrganizationAccess:ES,deleteOrganizationAccesses:BS}=Sn.actions,vS=Sn.reducer,Ct=t=>t.organizationAccessReducer.instances,VS=t=>s=>s.organizationAccessReducer.instances[t],zS=f(o.createSelector([Ct,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(Object.values(t).filter(({uuid:n})=>e.has(n)))})),nF=o.createSelector([IS,Ct],(t,s)=>Object.values(s).find(n=>n.user===(t==null?void 0:t.id))??null),jS=o.createSelector([Ct],t=>{const s={};for(const e of Object.values(t))s[e.user]=e;return St(s)}),aF=f(o.createSelector([fn,jS,(t,s)=>s],(t,s,e)=>S(Object.values(t).filter(n=>{const a=s[n.id];return!!a&&a.organization===e})))),Ge=_(t=>t.uuid),DS={instances:{}},Tn=o.createSlice({name:"organizations",initialState:DS,extraReducers:t=>t.addMatcher(o.isAnyOf(O,b),s=>Object.assign(s,DS)),reducers:{initializeOrganizations:Ge.initialize,setOrganizations:Ge.setMany,setOrganization:Ge.setOne,addOrganizations:Ge.addMany,addOrganization:Ge.addOne,updateOrganizations:Ge.updateMany,updateOrganization:Ge.updateOne,deleteOrganization:Ge.deleteOne,deleteOrganizations:Ge.deleteMany}}),{initializeOrganizations:qS,setOrganizations:$S,setOrganization:CS,addOrganizations:US,addOrganization:LS,updateOrganizations:kS,updateOrganization:NS,deleteOrganization:GS,deleteOrganizations:HS}=Tn.actions,WS=t=>t.organizationReducer.instances,KS=o.createSelector([WS],t=>Object.values(t)),YS=t=>s=>s.organizationReducer.instances[t],ZS=f(o.createSelector([KS,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),JS=Tn.reducer,XS=(t,s,e)=>{const n=t.uuid?t:{...t,uuid:Qe.v4()};return{payload:n,type:"",meta:{offline:{effect:{timestamp:new Date().toISOString(),request:n,BASE_URL:s,serviceName:e}}}}},QS={deletedRequests:[],latestRetryTime:0},In=o.createSlice({name:"outbox",initialState:QS,extraReducers:t=>t.addCase(O,s=>Object.assign(s,QS)),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 XS(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}}}),cF=t=>t.outboxReducer.deletedRequests,dF=t=>t.outboxReducer.latestRetryTime,{enqueueRequest:xS,markForDeletion:rF,markAsDeleted:eT,_setLatestRetryTime:tT}=In.actions,sT=In.reducer,He=_(t=>t.uuid),iT={instances:{}},On=o.createSlice({name:"projectAccess",initialState:iT,extraReducers:t=>t.addMatcher(o.isAnyOf(O,b),s=>Object.assign(s,iT)),reducers:{initializeProjectAccesses:He.initialize,addProjectAccess:He.addOne,addProjectAccesses:He.addMany,setProjectAccess:He.setOne,setProjectAccesses:He.setMany,updateProjectAccess:He.updateOne,updateProjectAccesses:He.updateMany,deleteProjectAccess:He.deleteOne,deleteProjectAccesses:He.deleteMany}}),{initializeProjectAccesses:nT,addProjectAccess:aT,addProjectAccesses:cT,setProjectAccess:dT,setProjectAccesses:rT,updateProjectAccess:uT,updateProjectAccesses:lT,deleteProjectAccess:oT,deleteProjectAccesses:hT}=On.actions,mT=On.reducer,Pn=t=>t.projectAccessReducer.instances,pt=o.createSelector(Pn,t=>Object.values(t)),yT=t=>s=>s.projectAccessReducer.instances[t],pT=f(o.createSelector([pt,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),uF=f(o.createSelector([Pn,(t,s)=>s],(t,s)=>S(Object.values(t).filter(e=>e.project===s)))),lF=f(o.createSelector([pt,(t,s)=>s],(t,s)=>{const e={};for(const n of t.filter(a=>a.project===s))e[n.user]=n;return e})),oF=f(o.createSelector([qt,pt,(t,s)=>s],(t,s,e)=>{const n=new Set(s.filter(a=>a.project===e).map(a=>a.user));return S(t.filter(a=>n.has(a.id)))})),We=_(t=>t.uuid),AT={instances:{}},Fn=o.createSlice({name:"projectAttachments",initialState:AT,extraReducers:t=>t.addMatcher(o.isAnyOf(O,b),s=>Object.assign(s,AT)),reducers:{initializeProjectAttachments:We.initialize,addProjectAttachment:We.addOne,addProjectAttachments:We.addMany,setProjectAttachment:We.setOne,setProjectAttachments:We.setMany,updateProjectAttachment:We.updateOne,updateProjectAttachments:We.updateMany,deleteProjectAttachment:We.deleteOne,deleteProjectAttachments:We.deleteMany}}),{initializeProjectAttachments:fT,addProjectAttachment:ST,addProjectAttachments:TT,setProjectAttachment:IT,setProjectAttachments:OT,updateProjectAttachment:PT,updateProjectAttachments:FT,deleteProjectAttachment:gT,deleteProjectAttachments:_T}=Fn.actions,bT=t=>t.projectAttachmentReducer.instances,gn=o.createSelector([bT],t=>Object.values(t)),MT=t=>s=>s.projectAttachmentReducer.instances[t],RT=f(o.createSelector([gn,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),hF=f(o.createSelector([gn,(t,s)=>s],(t,s)=>S(t.filter(({project:e})=>s===e)))),wT=Fn.reducer,Ke=_(t=>t.uuid),ET={instances:{}},_n=o.createSlice({name:"projectFiles",initialState:ET,extraReducers:t=>t.addMatcher(o.isAnyOf(O,D,b),s=>Object.assign(s,ET)),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:BT,setProjectFile:vT,setProjectFiles:VT,addProjectFile:zT,addProjectFiles:jT,updateProjectFile:DT,updateProjectFiles:qT,deleteProjectFile:$T,deleteProjectFiles:CT}=_n.actions,UT=t=>t.projectFileReducer.instances,LT=o.createSelector([UT],t=>S(Object.values(t).sort((s,e)=>s.z_index-e.z_index))),kT=t=>s=>s.projectFileReducer.instances[t],NT=f(o.createSelector([LT,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),GT=_n.reducer,Ye=_(t=>t.uuid),HT={instances:{}},bn=o.createSlice({name:"projects",initialState:HT,extraReducers:t=>t.addMatcher(o.isAnyOf(O,b),s=>Object.assign(s,HT)),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:WT,setProjects:KT,setProject:YT,addProjects:ZT,addProject:JT,updateProjects:XT,updateProject:QT,deleteProject:xT,deleteProjects:eI}=bn.actions,tI=bn.reducer,sI=t=>t.projectReducer.instances,Ut=o.createSelector([sI],t=>Object.values(t)),iI=t=>s=>s.projectReducer.instances[t],nI=f(o.createSelector([Ut,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),mF=f(o.createSelector([Ut,pt,(t,s)=>s],(t,s,e)=>{const n=new Set(s.filter(a=>a.user===e).map(a=>a.project));return S(t.filter(a=>n.has(a.uuid)))})),yF=f(o.createSelector([Ut,(t,s)=>s],(t,s)=>S(t.filter(e=>e.organization===s)))),pF={isRehydrated:!1},Mn=o.createSlice({name:"rehydrated",initialState:pF,reducers:{setRehydrated:(t,s)=>{t.isRehydrated=s.payload}}}),{setRehydrated:AF}=Mn.actions,fF=t=>t.rehydratedReducer.isRehydrated,aI=Mn.reducer,Ze=_(t=>t.uuid),cI={instances:{}},Rn=o.createSlice({name:"teamMemberships",initialState:cI,extraReducers:t=>t.addMatcher(o.isAnyOf(O,b),s=>Object.assign(s,cI)),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:dI,addTeamMembership:rI,addTeamMemberships:uI,setTeamMembership:lI,setTeamMemberships:oI,updateTeamMembership:hI,updateTeamMemberships:mI,deleteTeamMembership:yI,deleteTeamMemberships:pI}=Rn.actions,AI=Rn.reducer,fI=t=>t.teamMembershipReducer.instances,Lt=o.createSelector([fI],t=>Object.values(t)),SI=t=>s=>s.teamMembershipReducer.instances[t],TI=f(o.createSelector([Lt,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),SF=f(o.createSelector([Lt,(t,s)=>s],(t,s)=>{const e={};for(const n of t.filter(a=>a.team===s))e[n.user]=n;return e})),TF=f(o.createSelector([qt,Lt,(t,s)=>s],(t,s,e)=>{const n=new Set(s.filter(a=>a.team===e).map(a=>a.user));return S(t.filter(a=>n.has(a.id)))})),Je=_(t=>t.uuid),II={instances:{}},wn=o.createSlice({name:"teams",initialState:II,extraReducers:t=>t.addMatcher(o.isAnyOf(O,b),s=>Object.assign(s,II)),reducers:{initializeTeams:Je.initialize,addTeam:Je.addOne,addTeams:Je.addMany,setTeam:Je.setOne,setTeams:Je.setMany,updateTeam:Je.updateOne,updateTeams:Je.updateMany,deleteTeam:Je.deleteOne,deleteTeams:Je.deleteMany}}),{initializeTeams:OI,addTeam:PI,addTeams:FI,setTeam:gI,setTeams:_I,updateTeam:bI,updateTeams:MI,deleteTeam:RI,deleteTeams:wI}=wn.actions,EI=t=>t.teamReducer.instances,En=o.createSelector([EI],t=>Object.values(t)),BI=t=>s=>s.teamReducer.instances[t],vI=f(o.createSelector([En,(t,s)=>s],(t,s)=>{const e=new Set(s);return S(t.filter(({uuid:n})=>e.has(n)))})),IF=f(o.createSelector([En,(t,s)=>s],(t,s)=>S(t.filter(e=>e.organization===s)))),VI=wn.reducer,OF={version:0},zI=o.createSlice({name:"versioning",initialState:OF,reducers:{}}),jI=zI.reducer,Bn={outboxReducer:sT,fileReducer:gh,authReducer:Vo},PF=o.combineReducers(Bn),DI={...Bn,[ot]:jI,assetReducer:Cr,assetAttachmentReducer:ga,assetStageCompletionReducer:Jr,assetStageReducer:ou,assetTypeReducer:Ao,assetTypeAttachmentReducer:bu,issueReducer:qp,issueAttachmentReducer:Xy,issueTypeReducer:Lf,issueTypeAttachmentReducer:Xp,organizationReducer:JS,projectReducer:tI,projectAttachmentReducer:wT,projectAccessReducer:mT,organizationAccessReducer:vS,projectFileReducer:GT,rehydratedReducer:aI,formReducer:Vm,formRevisionReducer:Pm,formRevisionAttachmentReducer:hm,formSubmissionAttachmentReducer:Ym,formSubmissionReducer:dy,formIdentifierReducer:$h,formIdentifierValueReducer:Qh,userReducer:TS,emailDomainsReducer:Oh,documentsReducer:nh,documentAttachmentReducer:Ko,teamReducer:VI,agentsReducer:oa,issueCommentReducer:gp,issueCommentAttachmentReducer:op,issueUpdateReducer:lS,geoImageReducer:Oy,issueAssociationReducer:$y,issueTypeFieldsReducer:CA,issueTypeFieldValuesReducer:_A,issueTypeFieldsAttachmentReducer:oA,issueTypeFieldValuesAttachmentReducer:QA,issueTypeIdentifierReducer:mf,issueTypeIdentifierValueReducer:Mf,issueTypeStatusReducer:eS,assetTypeFieldsReducer:el,assetTypeFieldValuesReducer:Ml,assetTypeFieldsAttachmentReducer:Uu,assetTypeFieldValuesAttachmentReducer:ml,assetTypeIdentifierReducer:Ll,assetTypeIdentifierValueReducer:to,assetTypeStatusReducer:Eo,assetProcedureTypeReducer:ud,assetProcedureReducer:Yc,assetProcedureTypeFieldsReducer:uc,assetProcedureTypeFieldValuesReducer:Dc,assetProcedureTypeFieldsAttachmentReducer:Za,assetProcedureTypeFieldValuesAttachmentReducer:Oc,assetProcedureTypeAttachmentReducer:ja,assetProcedureStepFieldsAttachmentReducer:bd,assetProcedureStepFieldsReducer:Cd,assetProcedureStepFieldValuesAttachmentReducer:Qd,assetProcedureStepFieldValuesReducer:hr,assetProcedureStepReducer:Fr,teamMembershipReducer:AI},FF=o.combineReducers(DI),qI=1e4,$I=200,vn=[400,409,403,404,405,500],Xe=1e4,CI={};class UI{constructor(s){y(this,"client");y(this,"pageSize",qI);CI[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 LI=()=>GI.length-1,kI=t=>(t[ot]={version:LI()},t),NI=()=>kI({}),gF=t=>(t.outboxReducer&&(t.outboxReducer.deletedRequests=[]),t),_F=t=>s=>{var e;return s===void 0&&(s={}),((e=s[ot])==null?void 0:e.version)===LI()?s:t(s)},GI=[kI,NI,NI,gF],bF=Object.fromEntries(GI.map((t,s)=>[s,_F(t)])),MF=t=>{if(t)throw t;const s=ut();s?s.dispatch({type:"rehydrated/setRehydrated",payload:!0}):console.error("Client store not set")},HI=(t,s,e)=>{const n=nt();return n?(n.addRequest(s),n.getQueue()):(console.warn("Outbox coordinator not set; cannot enqueue request yet."),[])},WI=(t,s,e)=>{const n=nt();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 RF(t,s){if(!s.payload)throw new Error("Received empty payload");return aO(s)}const wF={...Cn,effect:RF,discard:YI,returnPromises:!0,persistCallback:MF,retry:VF,persistOptions:{storage:hO},queue:{...Cn.queue,enqueue:HI,dequeue:WI,peek:(...t)=>vF(...t)}},EF=mO(bF,ot),BF=o.compose(oO.offline(wF),EF);async function KI(t,s,e){if(s.store.getState().outboxReducer.deletedRequests.includes(t.payload.uuid))throw new Error("Request was marked for deletion");const a=CI[t.meta.offline.effect.serviceName];if(!a)throw new Error(`Service ${t.meta.offline.effect.serviceName} not found`);return zn(t.meta.offline.effect.BASE_URL,t.meta.offline.effect.request,s,a,e)}function YI(t,s,e=0){var u;if(console.debug("Considering discarding request due to error:",t,`(${typeof t})`,`
|
|
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,Ca,Ht,FP,Ua,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 p=(i,U,o)=>dv(i,typeof U!="symbol"?U+"":U,o);var wP;const La=Object.freeze([]),Na=Object.freeze({});var Ha=(t=>(t[t.GUEST=0]="GUEST",t[t.BASIC=2]="BASIC",t[t.ADMIN=4]="ADMIN",t))(Ha||{}),h=(t=>(t.GET="GET",t.POST="POST",t.PATCH="PATCH",t.PUT="PUT",t.DELETE="DELETE",t))(h||{}),Ga=(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))(Ga||{}),Ka=(t=>(t.Issue="issue",t.Asset="asset",t.AssetType="asset_type",t.Project="project",t.Document="document",t))(Ka||{}),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))($||{}),Ya=(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))(Ya||{}),Ja=(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))(Ja||{}),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,Za=6e4,kP=[vt.APPROVED,vt.REJECTED,vt.CHANGES_REQUESTED],vP=[gt.ACTIVE,gt.COMPLETED,gt.CANCELLED],EP=gt.ACTIVE;function F(t){return{addOne:(m,f)=>{const y=t(f.payload);m.instances[y]=f.payload},addMany:(m,f)=>{for(const y of f.payload){const O=t(y);m.instances[O]=y}},setOne:(m,f)=>{const y=t(f.payload);m.instances[y]=f.payload},setMany:(m,f)=>{for(const y of f.payload){const O=t(y);m.instances[O]=y}},updateOne:(m,f)=>{const y=t(f.payload);m.instances[y]=f.payload},updateMany:(m,f)=>{for(const y of f.payload){const O=t(y);m.instances[O]=y}},deleteOne:(m,f)=>{delete m.instances[f.payload]},deleteMany:(m,f)=>{for(const y of f.payload)delete m.instances[y]},initialize:(m,f)=>{m.instances={};const y=new Set;for(const O of f.payload){const P=t(O);y.add(P),m.instances[P]=O}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 m=new Set(l.selection);for(const f of u.payload)m.has(f)||m.add(f);l.selection=Array.from(m)},unselectOne:(l,u)=>{const m=new Set(l.selection);m.has(u.payload)&&(m.delete(u.payload),l.selection=Array.from(m))},unselectMany:(l,u)=>{const m=new Set(l.selection);for(const f of u.payload)m.has(f)&&m.delete(f);l.selection=Array.from(m)},toggleOne:(l,u)=>{const m=new Set(l.selection);m.has(u.payload)?m.delete(u.payload):m.add(u.payload),l.selection=Array.from(m)},toggleMany:(l,u)=>{const m=new Set(l.selection);for(const f of u.payload)m.has(f)?m.delete(f):m.add(f);l.selection=Array.from(m)},getInitialState:l=>({...l,selection:[]})}}const Et="versioning",T=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(){p(this,wP,"Promise");p(this,"_promise");p(this,"_resolve");p(this,"_reject");p(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?La:t,Gt=t=>Object.keys(t).length===0?Na:t,Qa=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?Qa(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 Xa(t){const s=t.name;return s.includes(".")?s.split(".").pop():""}const xa=async t=>(await fetch(t)).blob(),ec=async(t,s)=>{const e=await xa(t);return new File([e],s,{type:e.type})};function NP(t){const s=new Blob([t]);OP.saveAs(s,t.name)}function tc(t){return typeof t=="string"&&t.startsWith("blob:")}function HP(t){return t.type.startsWith("image/")}const sc={};function GP(t,s,e,...n){const a=sc[t];let c=!1;a?a[s]||(a[s]=!0,c=!0):(sc[t]={[s]:!0},c=!0),c&&console[e](...n)}const ic=["created_at","updated_at","index","revision"];function I(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[...ic,"created_by"])e in s&&delete s[e];return s}const nc=t=>{const s=t.toSorted((e,n)=>e.order-n.order);return Ca(s,{id:e=>e.uuid,parentId:e=>e.parent,includeEmptyChildrenArray:!0,valueKey:!1})},xP=t=>{const{roots:s}=nc(t);return s.map(e=>new Ht.Tree(e))},ac=(t,s)=>{const{nodes:e}=nc(s),n=e.get(t);if(!n)throw new Error(`Node with uuid ${t} does not exist in asset procedure step tree.`);return new Ht.Tree(n)},cc=(t,s)=>t.type!==s.type?t.type-s.type:t.order-s.order,rc=(t,s)=>t.type!==s.type?t.type-s.type:t.order-s.order,dc=t=>Ca(t,{id:s=>s.uuid,parentId:s=>s.parent_document,includeEmptyChildrenArray:!0,valueKey:!1}),eb=t=>{const{roots:s}=dc(t);return s.map(e=>new Ht.Tree(e))},lc=(t,s)=>{const{nodes:e}=dc(s),n=e.get(t);if(!n)throw new Error(`Node with uuid ${t} does not exist in document tree.`);return new Ht.Tree(n)};class tb{constructor(s){p(this,"operations",[]);p(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),uc={instances:{}},_s=o.createSlice({name:"agents",initialState:uc,extraReducers:t=>t.addMatcher(o.isAnyOf(T,W,g),s=>Object.assign(s,uc)),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:oc,addConversation:hc,addConversations:sb,setConversation:pc,setConversations:ib,updateConversation:mc,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])),fc=_s.reducer,H=F(t=>t.uuid),yc={instances:{}},bs=o.createSlice({name:"assetAttachments",initialState:yc,extraReducers:t=>t.addMatcher(o.isAnyOf(T,W,g),s=>Object.assign(s,yc)),reducers:{initializeAssetAttachments:H.initialize,addAssetAttachment:H.addOne,addAssetAttachments:H.addMany,setAssetAttachment:H.setOne,setAssetAttachments:H.setMany,updateAssetAttachment:H.updateOne,updateAssetAttachments:H.updateMany,deleteAssetAttachment:H.deleteOne,deleteAssetAttachments:H.deleteMany}}),{initializeAssetAttachments:Sc,addAssetAttachment:Ac,addAssetAttachments:Rs,setAssetAttachment:wc,setAssetAttachments:Tc,updateAssetAttachment:Ic,updateAssetAttachments:Oc,deleteAssetAttachment:Fc,deleteAssetAttachments:Ms}=bs.actions,gc=t=>t.assetAttachmentReducer.instances,ks=o.createSelector([gc],t=>Object.values(t)),_c=t=>s=>s.assetAttachmentReducer.instances[t],Pc=S(o.createSelector([ks,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),bc=S(o.createSelector([ks,(t,s)=>s],(t,s)=>A(t.filter(({asset:e})=>s===e)))),Rc=bs.reducer,G=F(({uuid:t})=>t),Mc={instances:{}},vs=o.createSlice({name:"assetProcedureTypeAttachments",initialState:Mc,extraReducers:t=>t.addMatcher(o.isAnyOf(T,g),s=>Object.assign(s,Mc)),reducers:{initializeAssetProcedureTypeAttachments:G.initialize,addAssetProcedureTypeAttachment:G.addOne,addAssetProcedureTypeAttachments:G.addMany,setAssetProcedureTypeAttachment:G.setOne,setAssetProcedureTypeAttachments:G.setMany,updateAssetProcedureTypeAttachment:G.updateOne,updateAssetProcedureTypeAttachments:G.updateMany,deleteAssetProcedureTypeAttachment:G.deleteOne,deleteAssetProcedureTypeAttachments:G.deleteMany}}),{initializeAssetProcedureTypeAttachments:kc,addAssetProcedureTypeAttachment:vc,addAssetProcedureTypeAttachments:Ec,setAssetProcedureTypeAttachment:Vc,setAssetProcedureTypeAttachments:Wc,updateAssetProcedureTypeAttachment:Bc,updateAssetProcedureTypeAttachments:zc,deleteAssetProcedureTypeAttachment:Dc,deleteAssetProcedureTypeAttachments:qc}=vs.actions,jc=vs.reducer,$c=t=>t.assetProcedureTypeAttachmentReducer.instances,Es=o.createSelector([$c],t=>Object.values(t)),Cc=t=>s=>s.assetProcedureTypeAttachmentReducer.instances[t],Uc=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),Lc={instances:{}},Vs=o.createSlice({name:"assetProcedureTypeFieldsAttachments",initialState:Lc,extraReducers:t=>t.addMatcher(o.isAnyOf(T,g),s=>Object.assign(s,Lc)),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:Nc,addAssetProcedureTypeFieldsAttachment:Hc,addAssetProcedureTypeFieldsAttachments:Gc,setAssetProcedureTypeFieldsAttachment:Kc,setAssetProcedureTypeFieldsAttachments:Yc,updateAssetProcedureTypeFieldsAttachment:Jc,updateAssetProcedureTypeFieldsAttachments:Zc,deleteAssetProcedureTypeFieldsAttachment:Qc,deleteAssetProcedureTypeFieldsAttachments:Xc}=Vs.actions,xc=Vs.reducer,er=t=>t.assetProcedureTypeFieldsAttachmentReducer.instances,Ws=o.createSelector([er],t=>Object.values(t)),ub=S(o.createSelector([Ws,(t,s)=>s],(t,s)=>A(t.filter(e=>e.fields_revision===s)))),tr=t=>s=>s.assetProcedureTypeFieldsAttachmentReducer.instances[t],sr=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),ir={instances:{}},Bs=o.createSlice({name:"assetProcedureTypeFields",initialState:ir,extraReducers:t=>t.addMatcher(o.isAnyOf(T,g),s=>Object.assign(s,ir)),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:nr,addAssetProcedureTypeFields:ar,addAssetProcedureTypeFieldsMany:cr,setAssetProcedureTypeFields:rr,setAssetProcedureTypeFieldsMany:dr,updateAssetProcedureTypeFields:lr,updateAssetProcedureTypeFieldsMany:ur,deleteAssetProcedureTypeFields:or,deleteAssetProcedureTypeFieldsMany:hr}=Bs.actions,pr=Bs.reducer,mr=t=>t.assetProcedureTypeFieldsReducer.instances,Jt=o.createSelector([mr],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])),fr=t=>s=>s.assetProcedureTypeFieldsReducer.instances[t],yr=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),Sr={instances:{}},zs=o.createSlice({name:"assetProcedureTypeFieldValuesAttachments",initialState:Sr,extraReducers:t=>t.addMatcher(o.isAnyOf(T,W,g),s=>Object.assign(s,Sr)),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:Ar,addAssetProcedureTypeFieldValuesAttachment:wr,addAssetProcedureTypeFieldValuesAttachments:Ds,setAssetProcedureTypeFieldValuesAttachment:Tr,setAssetProcedureTypeFieldValuesAttachments:Ir,updateAssetProcedureTypeFieldValuesAttachment:Or,updateAssetProcedureTypeFieldValuesAttachments:Fr,deleteAssetProcedureTypeFieldValuesAttachment:gr,deleteAssetProcedureTypeFieldValuesAttachments:qs}=zs.actions,_r=zs.reducer,Pr=t=>t.assetProcedureTypeFieldValuesAttachmentReducer.instances,js=o.createSelector([Pr],t=>Object.values(t)),br=t=>s=>s.assetProcedureTypeFieldValuesAttachmentReducer.instances[t],Rr=S(o.createSelector([js,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Mr=S(o.createSelector([js,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),Z=F(({uuid:t})=>t),kr={instances:{}},$s=o.createSlice({name:"assetProcedureTypeFieldValues",initialState:kr,extraReducers:t=>t.addMatcher(o.isAnyOf(T,W,g),s=>Object.assign(s,kr)),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:vr,addAssetProcedureTypeFieldValues:Er,addAssetProcedureTypeFieldValuesMany:Vr,setAssetProcedureTypeFieldValues:Wr,setAssetProcedureTypeFieldValuesMany:Br,updateAssetProcedureTypeFieldValues:zr,updateAssetProcedureTypeFieldValuesMany:Dr,deleteAssetProcedureTypeFieldValues:qr,deleteAssetProcedureTypeFieldValuesMany:jr}=$s.actions,$r=$s.reducer,Cr=t=>t.assetProcedureTypeFieldValuesReducer.instances,Zt=o.createSelector([Cr],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)))),Ur=t=>s=>s.assetProcedureTypeFieldValuesReducer.instances[t],Lr=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),Nr={instances:{}},Cs=o.createSlice({name:"assetProcedures",initialState:Nr,extraReducers:t=>t.addMatcher(o.isAnyOf(T,W,g),s=>Object.assign(s,Nr)),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:Hr,addAssetProcedure:Gr,addAssetProcedures:Us,updateAssetProcedure:Kr,updateAssetProcedures:Yr,deleteAssetProcedure:Jr,deleteAssetProcedures:Ls,setAssetProcedure:Zr,setAssetProcedures:Qr}=Cs.actions,Xr=Cs.reducer,xr=t=>t.assetProcedureReducer.instances,Qt=o.createSelector([xr],t=>Object.values(t)),ed=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)))),td=t=>s=>s.assetProcedureReducer.instances[t],sd=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),id={instances:{}},Ns=o.createSlice({name:"assetProcedureTypes",initialState:id,extraReducers:t=>t.addMatcher(o.isAnyOf(T,g),s=>Object.assign(s,id)),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:nd,addAssetProcedureType:ad,addAssetProcedureTypes:cd,updateAssetProcedureType:rd,updateAssetProcedureTypes:dd,deleteAssetProcedureType:ld,deleteAssetProcedureTypes:ud,setAssetProcedureType:od,setAssetProcedureTypes:hd}=Ns.actions,pd=Ns.reducer,md=t=>t.assetProcedureTypeReducer.instances,Hs=o.createSelector([md],t=>Object.values(t)),fd=t=>s=>s.assetProcedureTypeReducer.instances[t],yd=S(o.createSelector([Hs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),yb=S(o.createSelector([Hs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),x=F(t=>t.uuid),Sd={instances:{}},Gs=o.createSlice({name:"assetProcedureStepFieldsAttachments",initialState:Sd,extraReducers:t=>t.addMatcher(o.isAnyOf(T,g),s=>Object.assign(s,Sd)),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:Ad,addAssetProcedureStepFieldsAttachment:wd,addAssetProcedureStepFieldsAttachments:Td,setAssetProcedureStepFieldsAttachment:Id,setAssetProcedureStepFieldsAttachments:Od,updateAssetProcedureStepFieldsAttachment:Fd,updateAssetProcedureStepFieldsAttachments:gd,deleteAssetProcedureStepFieldsAttachment:_d,deleteAssetProcedureStepFieldsAttachments:Pd}=Gs.actions,bd=t=>t.assetProcedureStepFieldsAttachmentReducer.instances,Ks=o.createSelector([bd],t=>Object.values(t)),Sb=S(o.createSelector([Ks,(t,s)=>s],(t,s)=>A(t.filter(e=>e.fields_revision===s)))),Rd=t=>s=>s.assetProcedureStepFieldsAttachmentReducer.instances[t],Md=S(o.createSelector([Ks,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),kd=Gs.reducer,ee=F(t=>t.uuid),vd={instances:{}},Ys=o.createSlice({name:"assetProcedureStepFields",initialState:vd,extraReducers:t=>t.addMatcher(o.isAnyOf(T,g),s=>Object.assign(s,vd)),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:Ed,addAssetProcedureStepFields:Vd,addAssetProcedureStepFieldsMany:Wd,setAssetProcedureStepFields:Bd,setAssetProcedureStepFieldsMany:zd,updateAssetProcedureStepFields:Dd,updateAssetProcedureStepFieldsMany:qd,deleteAssetProcedureStepFields:jd,deleteAssetProcedureStepFieldsMany:$d}=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}),Cd=t=>s=>s.assetProcedureStepFieldsReducer.instances[t],Ud=S(o.createSelector([Xt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Ld=Ys.reducer,te=F(t=>t.uuid),Nd={instances:{}},Zs=o.createSlice({name:"assetProcedureStepFieldValuesAttachments",initialState:Nd,extraReducers:t=>t.addMatcher(o.isAnyOf(T,W,g),s=>Object.assign(s,Nd)),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:Hd,addAssetProcedureStepFieldValuesAttachment:Gd,addAssetProcedureStepFieldValuesAttachments:Qs,setAssetProcedureStepFieldValuesAttachment:Kd,setAssetProcedureStepFieldValuesAttachments:Yd,updateAssetProcedureStepFieldValuesAttachment:Jd,updateAssetProcedureStepFieldValuesAttachments:Zd,deleteAssetProcedureStepFieldValuesAttachment:Qd,deleteAssetProcedureStepFieldValuesAttachments:Xs}=Zs.actions,Xd=t=>t.assetProcedureStepFieldValuesAttachmentReducer.instances,xs=o.createSelector([Xd],t=>Object.values(t)),xd=t=>s=>s.assetProcedureStepFieldValuesAttachmentReducer.instances[t],el=S(o.createSelector([xs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),tl=S(o.createSelector([xs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),sl=Zs.reducer,se=F(t=>t.uuid),il={instances:{}},ei=o.createSlice({name:"assetProcedureStepFieldValues",initialState:il,extraReducers:t=>t.addMatcher(o.isAnyOf(T,W,g),s=>Object.assign(s,il)),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:nl,addAssetProcedureStepFieldValues:al,addAssetProcedureStepFieldValuesMany:cl,setAssetProcedureStepFieldValues:rl,setAssetProcedureStepFieldValuesMany:dl,updateAssetProcedureStepFieldValues:ll,updateAssetProcedureStepFieldValuesMany:ul,deleteAssetProcedureStepFieldValues:ol,deleteAssetProcedureStepFieldValuesMany:hl}=ei.actions,pl=t=>t.assetProcedureStepFieldValuesReducer.instances,Vt=o.createSelector([pl],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)))),ml=t=>s=>s.assetProcedureStepFieldValuesReducer.instances[t],fl=S(o.createSelector([Vt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),yl=ei.reducer,ie=F(t=>t.uuid),Sl={instances:{}},ti=o.createSlice({name:"assetProcedureSteps",initialState:Sl,extraReducers:t=>t.addMatcher(o.isAnyOf(T,g),s=>Object.assign(s,Sl)),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:Al,setAssetProcedureStep:wl,setAssetProcedureSteps:Tl,addAssetProcedureStep:Il,addAssetProcedureSteps:Ol,updateAssetProcedureStep:Fl,updateAssetProcedureSteps:gl,deleteAssetProcedureStep:_l,deleteAssetProcedureSteps:Pl}=ti.actions,bl=ti.reducer,xt=t=>t.assetProcedureStepReducer.instances,Rl=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 Gt(e)})),_b=S(o.createSelector([si,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure_type===s)))),Ml=S(o.createSelector([si,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),kl=S(o.createSelector([xt,(t,s)=>s],(t,s)=>{if(!t[s])return A([]);const a=ac(s,Object.values(t)).all().map(({model:c})=>c);return A(a)})),ne=F(t=>t.uuid),vl={instances:{}},ii=o.createSlice({name:"assets",initialState:vl,extraReducers:t=>t.addMatcher(o.isAnyOf(T,W,g),s=>Object.assign(s,vl)),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:El,addAsset:Vl,addAssets:ni,updateAsset:Wl,updateAssets:Bl,deleteAsset:zl,deleteAssets:ai,setAsset:Dl,setAssets:ql}=ii.actions,jl=t=>t.assetReducer.instances,es=o.createSelector([jl],t=>A(Object.values(t))),Pb=S(o.createSelector([es,(t,s)=>s],(t,s)=>A(t.filter(({project:e})=>e===s)))),$l=S(o.createSelector([es,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_type===s)))),Cl=t=>s=>s.assetReducer.instances[t],Ul=S(o.createSelector([es,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Ll=ii.reducer,ae=F(t=>t.uuid),Nl={instances:{}},ci=o.createSlice({name:"assetStageCompletions",initialState:Nl,extraReducers:t=>t.addMatcher(o.isAnyOf(T,W,g),s=>Object.assign(s,Nl)),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:Hl,addAssetStageCompletion:Gl,addAssetStageCompletions:Kl,setAssetStageCompletion:Yl,setAssetStageCompletions:Jl,updateAssetStageCompletion:Zl,updateAssetStageCompletions:Ql,deleteAssetStageCompletion:Xl,deleteAssetStageCompletions:xl}=ci.actions,eu=ci.reducer,tu=t=>t.assetStageCompletionReducer.instances,su=o.createSelector([tu],t=>Object.values(t)),iu=t=>s=>s.assetStageCompletionReducer.instances[t],nu=S(o.createSelector([su,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),ce=F(t=>t.uuid),au={instances:{}},ri=o.createSlice({name:"assetStages",initialState:au,extraReducers:t=>t.addMatcher(o.isAnyOf(T,g),s=>Object.assign(s,au)),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:cu,setAssetStage:ru,setAssetStages:du,addAssetStage:lu,addAssetStages:uu,updateAssetStage:ou,updateAssetStages:hu,deleteAssetStage:pu,deleteAssetStages:mu}=ri.actions,fu=ri.reducer,di=t=>t.assetStageReducer.instances,yu=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 Gt(e)})),Rb=S(o.createSelector([li,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure_type===s)))),Su=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),Au={instances:{}},ui=o.createSlice({name:"assetTypeAttachments",initialState:Au,extraReducers:t=>t.addMatcher(o.isAnyOf(T,g),s=>Object.assign(s,Au)),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:wu,addAssetTypeAttachment:Tu,addAssetTypeAttachments:oi,setAssetTypeAttachment:Iu,setAssetTypeAttachments:Ou,updateAssetTypeAttachment:Fu,updateAssetTypeAttachments:gu,deleteAssetTypeAttachment:_u,deleteAssetTypeAttachments:hi}=ui.actions,Pu=t=>t.assetTypeAttachmentReducer.instances,pi=o.createSelector([Pu],t=>Object.values(t)),bu=t=>s=>s.assetTypeAttachmentReducer.instances[t],Ru=S(o.createSelector([pi,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Mu=S(o.createSelector([pi,(t,s)=>s],(t,s)=>A(t.filter(({asset_type:e})=>s===e)))),ku=ui.reducer,de=F(t=>t.uuid),vu={instances:{}},mi=o.createSlice({name:"assetTypeFieldsAttachments",initialState:vu,extraReducers:t=>t.addMatcher(o.isAnyOf(T,g),s=>Object.assign(s,vu)),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:Eu,addAssetTypeFieldsAttachment:Vu,addAssetTypeFieldsAttachments:Wu,setAssetTypeFieldsAttachment:Bu,setAssetTypeFieldsAttachments:zu,updateAssetTypeFieldsAttachment:Du,updateAssetTypeFieldsAttachments:qu,deleteAssetTypeFieldsAttachment:ju,deleteAssetTypeFieldsAttachments:$u}=mi.actions,Cu=t=>t.assetTypeFieldsAttachmentReducer.instances,fi=o.createSelector([Cu],t=>Object.values(t)),Mb=S(o.createSelector([fi,(t,s)=>s],(t,s)=>A(t.filter(e=>e.fields_revision===s)))),Uu=t=>s=>s.assetTypeFieldsAttachmentReducer.instances[t],Lu=S(o.createSelector([fi,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Nu=mi.reducer,le=F(t=>t.uuid),Hu={instances:{}},yi=o.createSlice({name:"assetTypeFields",initialState:Hu,extraReducers:t=>t.addMatcher(o.isAnyOf(T,g),s=>Object.assign(s,Hu)),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:Gu,addAssetTypeFields:Ku,addAssetTypeFieldsMany:Yu,setAssetTypeFields:Ju,setAssetTypeFieldsMany:Zu,updateAssetTypeFields:Qu,updateAssetTypeFieldsMany:Xu,deleteAssetTypeFields:xu,deleteAssetTypeFieldsMany:eo}=yi.actions,to=t=>t.assetTypeFieldsReducer.instances,Wt=o.createSelector([to],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])),so=t=>s=>s.assetTypeFieldsReducer.instances[t],io=S(o.createSelector([Wt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),no=yi.reducer,ue=F(t=>t.uuid),ao={instances:{}},Si=o.createSlice({name:"assetTypeFieldValuesAttachments",initialState:ao,extraReducers:t=>t.addMatcher(o.isAnyOf(T,W,g),s=>Object.assign(s,ao)),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:co,addAssetTypeFieldValuesAttachment:ro,addAssetTypeFieldValuesAttachments:Ai,setAssetTypeFieldValuesAttachment:lo,setAssetTypeFieldValuesAttachments:uo,updateAssetTypeFieldValuesAttachment:oo,updateAssetTypeFieldValuesAttachments:ho,deleteAssetTypeFieldValuesAttachment:po,deleteAssetTypeFieldValuesAttachments:wi}=Si.actions,mo=t=>t.assetTypeFieldValuesAttachmentReducer.instances,Ti=o.createSelector([mo],t=>Object.values(t)),fo=t=>s=>s.assetTypeFieldValuesAttachmentReducer.instances[t],yo=S(o.createSelector([Ti,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),So=S(o.createSelector([Ti,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),Ao=Si.reducer,oe=F(t=>t.uuid),wo={instances:{}},Ii=o.createSlice({name:"assetTypeFieldValues",initialState:wo,extraReducers:t=>t.addMatcher(o.isAnyOf(T,W,g),s=>Object.assign(s,wo)),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:To,addAssetTypeFieldValues:Io,addAssetTypeFieldValuesMany:Oo,setAssetTypeFieldValues:Fo,setAssetTypeFieldValuesMany:go,updateAssetTypeFieldValues:_o,updateAssetTypeFieldValuesMany:Po,deleteAssetTypeFieldValues:bo,deleteAssetTypeFieldValuesMany:Ro}=Ii.actions,Mo=t=>t.assetTypeFieldValuesReducer.instances,ts=o.createSelector([Mo],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)))})),ko=t=>s=>s.assetTypeFieldValuesReducer.instances[t],vo=S(o.createSelector([ts,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Eo=Ii.reducer,he=F(t=>t.uuid),Vo={instances:{}},Oi=o.createSlice({name:"assetTypeIdentifiers",initialState:Vo,extraReducers:t=>t.addMatcher(o.isAnyOf(T,g),s=>Object.assign(s,Vo)),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:Wo,addAssetTypeIdentifier:Bo,addAssetTypeIdentifiers:zo,setAssetTypeIdentifier:Do,setAssetTypeIdentifiers:qo,updateAssetTypeIdentifier:jo,updateAssetTypeIdentifiers:$o,deleteAssetTypeIdentifier:Co,deleteAssetTypeIdentifiers:Uo}=Oi.actions,Lo=t=>t.assetTypeIdentifierReducer.instances,Fi=o.createSelector([Lo],t=>Object.values(t)),No=t=>s=>s.assetTypeIdentifierReducer.instances[t],Ho=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)))),Go=Oi.reducer,pe=F(t=>t.uuid),Ko={instances:{}},gi=o.createSlice({name:"assetTypeIdentifierValues",initialState:Ko,extraReducers:t=>t.addMatcher(o.isAnyOf(T,W,g),s=>Object.assign(s,Ko)),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:Yo,addAssetTypeIdentifierValue:Jo,addAssetTypeIdentifierValues:Zo,setAssetTypeIdentifierValue:Qo,setAssetTypeIdentifierValues:Xo,updateAssetTypeIdentifierValue:xo,updateAssetTypeIdentifierValues:eh,deleteAssetTypeIdentifierValue:th,deleteAssetTypeIdentifierValues:sh}=gi.actions,ih=t=>t.assetTypeIdentifierValueReducer.instances,ss=o.createSelector([ih],t=>Object.values(t)),nh=t=>s=>s.assetTypeIdentifierValueReducer.instances[t],ah=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)))),ch=gi.reducer,me=F(t=>t.uuid),rh={instances:{}},_i=o.createSlice({name:"assetTypes",initialState:rh,extraReducers:t=>t.addMatcher(o.isAnyOf(T,g),s=>Object.assign(s,rh)),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:dh,setAssetType:lh,setAssetTypes:uh,addAssetType:oh,addAssetTypes:hh,updateAssetType:ph,updateAssetTypes:mh,deleteAssetType:fh,deleteAssetTypes:yh}=_i.actions,Sh=t=>t.assetTypeReducer.instances,Pi=o.createSelector([Sh],t=>Object.values(t)),Ah=t=>s=>s.assetTypeReducer.instances[t],wh=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)))),Th=_i.reducer,fe=F(t=>t.uuid),Ih={instances:{}},bi=o.createSlice({name:"assetTypeStatuses",initialState:Ih,extraReducers:t=>t.addMatcher(o.isAnyOf(T,g),s=>Object.assign(s,Ih)),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:Oh,addAssetTypeStatus:Fh,addAssetTypeStatuses:gh,setAssetTypeStatus:_h,setAssetTypeStatuses:Ph,updateAssetTypeStatus:bh,updateAssetTypeStatuses:Rh,deleteAssetTypeStatus:Mh,deleteAssetTypeStatuses:kh}=bi.actions,vh=t=>t.assetTypeStatusReducer.instances,Ri=o.createSelector([vh],t=>A(Object.values(t).toSorted(cc))),Eh=t=>s=>s.assetTypeStatusReducer.instances[t],Vh=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)))),Wh=bi.reducer,Bh={accessToken:"",refreshToken:"",isLoggedIn:!1},is=o.createSlice({name:"auth",initialState:Bh,extraReducers:t=>t.addCase(T,s=>Object.assign(s,Bh)),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:zh}=is.actions,Cb=t=>t.authReducer.accessToken,Ub=t=>t.authReducer.isLoggedIn,Dh=is.reducer,ye=F(t=>t.uuid),qh={instances:{}},Mi=o.createSlice({name:"documentAttachments",initialState:qh,extraReducers:t=>t.addCase(T,s=>Object.assign(s,qh)),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:jh,addDocumentAttachment:$h,addDocumentAttachments:Ch,setDocumentAttachment:Uh,setDocumentAttachments:Lh,updateDocumentAttachment:Nh,updateDocumentAttachments:Hh,deleteDocumentAttachment:Gh,deleteDocumentAttachments:Kh}=Mi.actions,Yh=t=>t.documentAttachmentReducer.instances,ki=o.createSelector([Yh],t=>Object.values(t)),Jh=t=>s=>s.documentAttachmentReducer.instances[t],Zh=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)))),Qh=Mi.reducer,Se=F(({uuid:t})=>t),Xh={instances:{}},vi=o.createSlice({name:"documents",initialState:Xh,extraReducers:t=>t.addMatcher(o.isAnyOf(T,g),s=>{Object.assign(s,Xh)}),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:xh,addDocument:ep,addDocuments:tp,setDocument:sp,setDocuments:ip,updateDocument:np,updateDocuments:ap,deleteDocument:cp,deleteDocuments:rp}=vi.actions,dp=vi.reducer,Ei=t=>t.documentsReducer.instances,ns=o.createSelector([Ei],t=>Object.values(t)),lp=t=>s=>s.documentsReducer.instances[t],up=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))),Hb=S(o.createSelector([ns,(t,s)=>s],(t,s)=>t.filter(e=>e.organization===s))),op=S(o.createSelector([Ei,(t,s)=>s],(t,s)=>{if(!t[s])return A([]);const a=lc(s,Object.values(t)).all().map(({model:c})=>c);return A(a)})),Ae=F(t=>t.uuid),hp={instances:{}},Vi=o.createSlice({name:"emailDomains",initialState:hp,extraReducers:t=>t.addMatcher(o.isAnyOf(T,g),s=>Object.assign(s,hp)),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:pp,addEmailDomain:mp,addEmailDomains:fp,setEmailDomain:yp,setEmailDomains:Sp,updateEmailDomain:Ap,updateEmailDomains:wp,deleteEmailDomain:Tp,deleteEmailDomains:Ip}=Vi.actions,Op=t=>t.emailDomainsReducer.instances,Wi=o.createSelector([Op],t=>Object.values(t)),Fp=t=>s=>s.emailDomainsReducer.instances[t],gp=S(o.createSelector([Wi,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Gb=S(o.createSelector([Wi,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),_p=Vi.reducer,Pp={s3Urls:{}},bp=1e3*60*60,Kb=bp*24*7,Bi=o.createSlice({name:"file",initialState:Pp,extraReducers:t=>t.addCase(T,s=>Object.assign(s,Pp)),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<bp))return e},Rp=Bi.reducer,we=F(t=>t.uuid),Mp={instances:{}},zi=o.createSlice({name:"formIdentifiers",initialState:Mp,extraReducers:t=>t.addMatcher(o.isAnyOf(T,g),s=>Object.assign(s,Mp)),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:kp,addFormIdentifier:vp,addFormIdentifiers:Ep,setFormIdentifier:Vp,setFormIdentifiers:Wp,updateFormIdentifier:Bp,updateFormIdentifiers:zp,deleteFormIdentifier:Dp,deleteFormIdentifiers:qp}=zi.actions,jp=t=>t.formIdentifierReducer.instances,Di=o.createSelector([jp],t=>Object.values(t)),$p=t=>s=>s.formIdentifierReducer.instances[t],Cp=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)))),Up=zi.reducer,Te=F(t=>t.uuid),Lp={instances:{}},qi=o.createSlice({name:"formIdentifierValues",initialState:Lp,extraReducers:t=>t.addMatcher(o.isAnyOf(T,g),s=>Object.assign(s,Lp)),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:Np,addFormIdentifierValue:Hp,addFormIdentifierValues:Gp,setFormIdentifierValue:Kp,setFormIdentifierValues:Yp,updateFormIdentifierValue:Jp,updateFormIdentifierValues:Zp,deleteFormIdentifierValue:Qp,deleteFormIdentifierValues:Xp}=qi.actions,xp=t=>t.formIdentifierValueReducer.instances,as=o.createSelector([xp],t=>Object.values(t)),em=t=>s=>s.formIdentifierValueReducer.instances[t],tm=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)))),sm=qi.reducer,Ie=F(t=>t.uuid),im={instances:{}},ji=o.createSlice({name:"formRevisionAttachments",initialState:im,extraReducers:t=>t.addMatcher(o.isAnyOf(T,g),s=>Object.assign(s,im)),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:nm,addFormRevisionAttachment:am,addFormRevisionAttachments:cm,setFormRevisionAttachment:rm,setFormRevisionAttachments:dm,updateFormRevisionAttachment:lm,updateFormRevisionAttachments:um,deleteFormRevisionAttachment:om,deleteFormRevisionAttachments:hm}=ji.actions,cs=t=>t.formRevisionAttachmentReducer.instances,pm=o.createSelector([cs],t=>Object.values(t)),mm=S(o.createSelector([cs,(t,s)=>s],(t,s)=>t[s])),fm=S(o.createSelector([pm,(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)))),ym=ji.reducer,Oe=F(t=>t.uuid),Sm={instances:{}},$i=o.createSlice({name:"formRevisions",initialState:Sm,extraReducers:t=>t.addMatcher(o.isAnyOf(T,g),s=>Object.assign(s,Sm)),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:Am,addFormRevision:wm,addFormRevisions:Ci,setFormRevision:Tm,setFormRevisions:Im,updateFormRevision:Om,updateFormRevisions:Fm,deleteFormRevision:gm,deleteFormRevisions:Ui}=$i.actions,_m=t=>t.formRevisionReducer.instances,rs=o.createSelector([_m],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:{}},Li=o.createSlice({name:"forms",initialState:km,extraReducers:t=>t.addMatcher(o.isAnyOf(T,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}=Li.actions,$m=Li.reducer,Cm=t=>t.formReducer.instances,Ni=o.createSelector([Cm],t=>Object.values(t)),Um=t=>s=>s.formReducer.instances[t],Lm=S(o.createSelector([Ni,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),tR=S(o.createSelector([Ni,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),ge=F(t=>t.uuid),Nm={instances:{}},Hi=o.createSlice({name:"formSubmissionAttachments",initialState:Nm,extraReducers:t=>t.addMatcher(o.isAnyOf(T,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:Hm,addFormSubmissionAttachment:Gm,addFormSubmissionAttachments:Gi,setFormSubmissionAttachment:Km,setFormSubmissionAttachments:Ym,updateFormSubmissionAttachment:Jm,updateFormSubmissionAttachments:Zm,deleteFormSubmissionAttachment:Qm,deleteFormSubmissionAttachments:Ki}=Hi.actions,Yi=t=>t.formSubmissionAttachmentReducer.instances,Ji=o.createSelector([Yi],t=>Object.values(t)),Xm=S(o.createSelector([Yi,(t,s)=>s],(t,s)=>t[s])),Zi=S(o.createSelector([Ji,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(n=>e.has(n.uuid)))})),xm=Zi,ef=S(o.createSelector([Ji,(t,s)=>s],(t,s)=>A(t.filter(e=>e.form_submission===s)))),tf=Hi.reducer,_e=F(t=>t.uuid),sf={instances:{}},Qi=o.createSlice({name:"formSubmissions",initialState:sf,extraReducers:t=>t.addMatcher(o.isAnyOf(T,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:Xi,updateFormSubmission:df,updateFormSubmissions:lf,deleteFormSubmission:uf,deleteFormSubmissions:xi}=Qi.actions,of=t=>t.formSubmissionReducer.instances,en=o.createSelector([of],t=>Object.values(t)),hf=t=>s=>s.formSubmissionReducer.instances[t],pf=S(o.createSelector([en,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),mf=S(o.createSelector([en,(t,s)=>s],(t,s)=>t.filter(e=>e.form===s))),ff=Qi.reducer,Pe=F(t=>t.uuid),yf={instances:{}},tn=o.createSlice({name:"geoImages",initialState:yf,extraReducers:t=>t.addMatcher(o.isAnyOf(T,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}=tn.actions,Pf=t=>t.geoImageReducer.instances,sn=o.createSelector([Pf],t=>Object.values(t)),bf=t=>s=>s.geoImageReducer.instances[t],Rf=S(o.createSelector([sn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),sR=S(o.createSelector([sn,(t,s)=>s],(t,s)=>A(t.filter(e=>e.project===s)))),Mf=tn.reducer,be=F(t=>t.uuid),kf={instances:{}},nn=o.createSlice({name:"issueAssociations",initialState:kf,extraReducers:t=>t.addMatcher(o.isAnyOf(T,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}=nn.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)))),Hf=S(o.createSelector([wt,(t,s)=>s],(t,s)=>A(t.filter(({asset:e})=>e===s)))),Gf=nn.reducer,Re=F(t=>t.uuid),Kf={instances:{}},an=o.createSlice({name:"issueAttachments",initialState:Kf,extraReducers:t=>t.addMatcher(o.isAnyOf(T,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:cn,setIssueAttachment:Zf,setIssueAttachments:Qf,updateIssueAttachment:Xf,updateIssueAttachments:xf,deleteIssueAttachment:ey,deleteIssueAttachments:rn}=an.actions,ty=t=>t.issueAttachmentReducer.instances,dn=o.createSelector([ty],t=>Object.values(t)),sy=S(o.createSelector([dn,(t,s)=>s],(t,s)=>A(t.filter(({issue:e})=>s===e)))),iy=t=>s=>s.issueAttachmentReducer.instances[t],ny=S(o.createSelector([dn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),ay=an.reducer,Me=F(t=>t.uuid),cy={instances:{}},ln=o.createSlice({name:"issueCommentAttachments",initialState:cy,extraReducers:t=>t.addMatcher(o.isAnyOf(T,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}=ln.actions,yy=t=>t.issueCommentAttachmentReducer.instances,un=o.createSelector([yy],t=>Object.values(t)),Sy=t=>s=>s.issueCommentAttachmentReducer.instances[t],Ay=S(o.createSelector([un,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),iR=S(o.createSelector([un,(t,s)=>s],(t,s)=>A(t.filter(({issue_comment:e})=>s===e)))),wy=ln.reducer,ke=F(t=>t.uuid),Ty={instances:{}},on=o.createSlice({name:"issueComments",initialState:Ty,extraReducers:t=>t.addMatcher(o.isAnyOf(T,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}=on.actions,hn=t=>t.issueCommentReducer.instances,ky=t=>s=>s.issueCommentReducer.instances[t],vy=S(o.createSelector([hn,(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([hn,(t,s)=>s],(t,s)=>A(Object.values(t).filter(e=>e.issue===s)))),Ey=on.reducer,ve=F(t=>t.uuid),Vy={instances:{}},pn=o.createSlice({name:"issues",initialState:Vy,extraReducers:t=>t.addMatcher(o.isAnyOf(T,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:mn,setIssue:zy,setIssues:Dy,updateIssue:qy,updateIssues:jy,deleteIssue:$y,deleteIssues:fn}=pn.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))),Hy=pn.reducer,Ee=F(t=>t.uuid),Gy={instances:{}},yn=o.createSlice({name:"issueTypeAttachments",initialState:Gy,extraReducers:t=>t.addMatcher(o.isAnyOf(T,g),s=>Object.assign(s,Gy)),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}=yn.actions,sS=t=>t.issueTypeAttachmentReducer.instances,Sn=o.createSelector([sS],t=>Object.values(t)),iS=t=>s=>s.issueTypeAttachmentReducer.instances[t],nS=S(o.createSelector([Sn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),cR=S(o.createSelector([Sn,(t,s)=>s],(t,s)=>A(t.filter(({issue_type:e})=>s===e)))),aS=yn.reducer,Ve=F(t=>t.uuid),cS={instances:{}},An=o.createSlice({name:"issueTypeFieldsAttachments",initialState:cS,extraReducers:t=>t.addMatcher(o.isAnyOf(T,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}=An.actions,yS=t=>t.issueTypeFieldsAttachmentReducer.instances,wn=o.createSelector([yS],t=>Object.values(t)),rR=S(o.createSelector([wn,(t,s)=>s],(t,s)=>A(t.filter(e=>e.fields_revision===s)))),SS=t=>s=>s.issueTypeFieldsAttachmentReducer.instances[t],AS=S(o.createSelector([wn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),wS=An.reducer,We=F(t=>t.uuid),TS={instances:{}},Tn=o.createSlice({name:"issueTypeFieldValues",initialState:TS,extraReducers:t=>t.addMatcher(o.isAnyOf(T,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}=Tn.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=Tn.reducer,Be=F(t=>t.uuid),WS={instances:{}},In=o.createSlice({name:"issueTypeFields",initialState:WS,extraReducers:t=>t.addMatcher(o.isAnyOf(T,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}=In.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)))})),HS=t=>s=>s.issueTypeFieldsReducer.instances[t],GS=S(o.createSelector([Bt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),KS=In.reducer,ze=F(t=>t.uuid),YS={instances:{}},On=o.createSlice({name:"issueTypeFieldValuesAttachments",initialState:YS,extraReducers:t=>t.addMatcher(o.isAnyOf(T,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:Fn,setIssueTypeFieldValuesAttachment:QS,setIssueTypeFieldValuesAttachments:XS,updateIssueTypeFieldValuesAttachment:xS,updateIssueTypeFieldValuesAttachments:eA,deleteIssueTypeFieldValuesAttachment:tA,deleteIssueTypeFieldValuesAttachments:gn}=On.actions,sA=t=>t.issueTypeFieldValuesAttachmentReducer.instances,_n=o.createSelector([sA],t=>Object.values(t)),iA=t=>s=>s.issueTypeFieldValuesAttachmentReducer.instances[t],nA=S(o.createSelector([_n,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),aA=S(o.createSelector([_n,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),cA=On.reducer,De=F(t=>t.uuid),rA={instances:{}},Pn=o.createSlice({name:"issueTypeIdentifiers",initialState:rA,extraReducers:t=>t.addMatcher(o.isAnyOf(T,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}=Pn.actions,SA=t=>t.issueTypeIdentifierReducer.instances,bn=o.createSelector([SA],t=>Object.values(t)),AA=t=>s=>s.issueTypeIdentifierReducer.instances[t],wA=S(o.createSelector([bn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),hR=S(o.createSelector([bn,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue_type===s)))),TA=Pn.reducer,qe=F(t=>t.uuid),IA={instances:{}},Rn=o.createSlice({name:"issueTypeIdentifierValues",initialState:IA,extraReducers:t=>t.addMatcher(o.isAnyOf(T,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}=Rn.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=Rn.reducer,je=F(t=>t.uuid),BA={instances:{}},Mn=o.createSlice({name:"issueTypes",initialState:BA,extraReducers:t=>t.addMatcher(o.isAnyOf(T,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}=Mn.actions,HA=t=>t.issueTypeReducer.instances,kn=o.createSelector(HA,t=>Object.values(t)),GA=t=>s=>s.issueTypeReducer.instances[t],KA=S(o.createSelector([kn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),fR=S(o.createSelector([kn,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),YA=Mn.reducer,$e=F(t=>t.uuid),JA={instances:{}},vn=o.createSlice({name:"issueTypeStatuses",initialState:JA,extraReducers:t=>t.addMatcher(o.isAnyOf(T,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}=vn.actions,aw=t=>t.issueTypeStatusReducer.instances,En=o.createSelector([aw],t=>A(Object.values(t).toSorted(rc))),Vn=t=>s=>s.issueTypeStatusReducer.instances[t],cw=S(o.createSelector([En,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),yR=S(o.createSelector([En,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue_type===s)))),rw=vn.reducer,Ce=F(t=>t.uuid),dw={instances:{}},Wn=o.createSlice({name:"issueUpdates",initialState:dw,extraReducers:t=>t.addMatcher(o.isAnyOf(T,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:Bn,addIssueUpdates:zn,setIssueUpdate:uw,setIssueUpdates:ow,updateIssueUpdate:hw,updateIssueUpdates:pw,deleteIssueUpdate:Dn,deleteIssueUpdates:qn}=Wn.actions,jn=t=>t.issueUpdateReducer.instances,$n=o.createSelector([jn],t=>Object.values(t)),mw=S(o.createSelector([jn,(t,s)=>s],(t,s)=>t[s])),fw=S(o.createSelector([$n,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),yw=S(o.createSelector([$n,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue===s)))),Sw=Wn.reducer,Ue=F(t=>t.id),Aw={instances:{},currentUser:null},Cn=o.createSlice({name:"users",initialState:Aw,extraReducers:t=>t.addCase(T,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:Un,updateUsers:Fw,updateUser:gw,deleteUser:Ln,deleteUsers:_w,setCurrentUser:SR,setCurrentUserProfile:AR}=Cn.actions,Pw=Cn.reducer,bw=t=>t.userReducer.currentUser,Nn=t=>t.userReducer.instances,os=o.createSelector([Nn],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:{}},Hn=o.createSlice({name:"organizationAccess",initialState:Mw,extraReducers:t=>t.addMatcher(o.isAnyOf(T,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}=Hn.actions,jw=Hn.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 Gt(s)}),TR=S(o.createSelector([Nn,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:{}},Gn=o.createSlice({name:"organizations",initialState:Lw,extraReducers:t=>t.addMatcher(o.isAnyOf(T,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:Hw,setOrganization:Gw,addOrganizations:Kw,addOrganization:Yw,updateOrganizations:Jw,updateOrganization:Zw,deleteOrganization:Qw,deleteOrganizations:Xw}=Gn.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=Gn.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},Kn=o.createSlice({name:"outbox",initialState:aT,extraReducers:t=>t.addCase(T,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}=Kn.actions,lT=Kn.reducer,He=F(t=>t.uuid),uT={instances:{}},Yn=o.createSlice({name:"projectAccess",initialState:uT,extraReducers:t=>t.addMatcher(o.isAnyOf(T,g),s=>Object.assign(s,uT)),reducers:{initializeProjectAccesses:He.initialize,addProjectAccess:He.addOne,addProjectAccesses:He.addMany,setProjectAccess:He.setOne,setProjectAccesses:He.setMany,updateProjectAccess:He.updateOne,updateProjectAccesses:He.updateMany,deleteProjectAccess:He.deleteOne,deleteProjectAccesses:He.deleteMany}}),{initializeProjectAccesses:oT,addProjectAccess:hT,addProjectAccesses:pT,setProjectAccess:mT,setProjectAccesses:fT,updateProjectAccess:yT,updateProjectAccesses:ST,deleteProjectAccess:AT,deleteProjectAccesses:wT}=Yn.actions,TT=Yn.reducer,Jn=t=>t.projectAccessReducer.instances,zt=o.createSelector(Jn,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([Jn,(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)))})),Ge=F(t=>t.uuid),FT={instances:{}},Zn=o.createSlice({name:"projectAttachments",initialState:FT,extraReducers:t=>t.addMatcher(o.isAnyOf(T,g),s=>Object.assign(s,FT)),reducers:{initializeProjectAttachments:Ge.initialize,addProjectAttachment:Ge.addOne,addProjectAttachments:Ge.addMany,setProjectAttachment:Ge.setOne,setProjectAttachments:Ge.setMany,updateProjectAttachment:Ge.updateOne,updateProjectAttachments:Ge.updateMany,deleteProjectAttachment:Ge.deleteOne,deleteProjectAttachments:Ge.deleteMany}}),{initializeProjectAttachments:gT,addProjectAttachment:_T,addProjectAttachments:PT,setProjectAttachment:bT,setProjectAttachments:RT,updateProjectAttachment:MT,updateProjectAttachments:kT,deleteProjectAttachment:vT,deleteProjectAttachments:ET}=Zn.actions,VT=t=>t.projectAttachmentReducer.instances,Qn=o.createSelector([VT],t=>Object.values(t)),WT=t=>s=>s.projectAttachmentReducer.instances[t],BT=S(o.createSelector([Qn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),bR=S(o.createSelector([Qn,(t,s)=>s],(t,s)=>A(t.filter(({project:e})=>s===e)))),zT=Zn.reducer,Ke=F(t=>t.uuid),DT={instances:{}},Xn=o.createSlice({name:"projectFiles",initialState:DT,extraReducers:t=>t.addMatcher(o.isAnyOf(T,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:HT,deleteProjectFiles:GT}=Xn.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=Xn.reducer,Ye=F(t=>t.uuid),XT={instances:{}},xn=o.createSlice({name:"projects",initialState:XT,extraReducers:t=>t.addMatcher(o.isAnyOf(T,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}=xn.actions,dI=xn.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},ea=o.createSlice({name:"rehydrated",initialState:kR,reducers:{setRehydrated:(t,s)=>{t.isRehydrated=s.payload}}}),{setRehydrated:vR}=ea.actions,ER=t=>t.rehydratedReducer.isRehydrated,hI=ea.reducer,Je=F(t=>t.uuid),pI={instances:{}},ta=o.createSlice({name:"teamMemberships",initialState:pI,extraReducers:t=>t.addMatcher(o.isAnyOf(T,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}=ta.actions,FI=ta.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:{}},sa=o.createSlice({name:"teams",initialState:bI,extraReducers:t=>t.addMatcher(o.isAnyOf(T,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}=sa.actions,DI=t=>t.teamReducer.instances,ia=o.createSelector([DI],t=>Object.values(t)),qI=t=>s=>s.teamReducer.instances[t],jI=S(o.createSelector([ia,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),BR=S(o.createSelector([ia,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),$I=sa.reducer,zR={version:0},CI=o.createSlice({name:"versioning",initialState:zR,reducers:{}}),UI=CI.reducer,Qe=F(t=>t.uuid),LI={instances:{}},na=o.createSlice({name:"workflows",initialState:LI,extraReducers:t=>t.addMatcher(o.isAnyOf(T,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:HI,addWorkflows:GI,setWorkflow:KI,setWorkflows:YI,updateWorkflow:JI,updateWorkflows:ZI,deleteWorkflow:QI,deleteWorkflows:XI}=na.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=na.reducer,Xe=F(t=>t.uuid),iO={instances:{}},aa=o.createSlice({name:"workflowIssueLinks",initialState:iO,extraReducers:t=>t.addMatcher(o.isAnyOf(T,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}=aa.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=aa.reducer,xe=F(t=>t.uuid),AO={instances:{}},ca=o.createSlice({name:"workflowStepAssignees",initialState:AO,extraReducers:t=>t.addMatcher(o.isAnyOf(T,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}=ca.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=ca.reducer,et=F(t=>t.uuid),EO={instances:{}},ra=o.createSlice({name:"workflowStepComments",initialState:EO,extraReducers:t=>t.addMatcher(o.isAnyOf(T,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}=ra.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)))),HR=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)))),HO=ra.reducer,tt=F(t=>t.uuid),GO={instances:{}},da=o.createSlice({name:"workflowStepDefaultAssignees",initialState:GO,extraReducers:t=>t.addMatcher(o.isAnyOf(T,g),s=>Object.assign(s,GO)),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}=da.actions,sF=t=>t.workflowStepDefaultAssigneeReducer.instances,la=o.createSelector([sF],t=>Object.values(t)),iF=t=>s=>s.workflowStepDefaultAssigneeReducer.instances[t],nF=S(o.createSelector([la,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),GR=S(o.createSelector([la,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),aF=da.reducer,st=F(t=>t.uuid),cF={instances:{}},ua=o.createSlice({name:"workflowStepDefaultReviewers",initialState:cF,extraReducers:t=>t.addMatcher(o.isAnyOf(T,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}=ua.actions,yF=t=>t.workflowStepDefaultReviewerReducer.instances,oa=o.createSelector([yF],t=>Object.values(t)),SF=t=>s=>s.workflowStepDefaultReviewerReducer.instances[t],AF=S(o.createSelector([oa,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),KR=S(o.createSelector([oa,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),wF=ua.reducer,it=F(t=>t.uuid),TF={instances:{}},ha=o.createSlice({name:"workflowStepEvents",initialState:TF,extraReducers:t=>t.addMatcher(o.isAnyOf(T,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}=ha.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=ha.reducer,nt=F(t=>t.uuid),WF={instances:{}},pa=o.createSlice({name:"workflowStepFieldsAttachments",initialState:WF,extraReducers:t=>t.addMatcher(o.isAnyOf(T,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:ma,setWorkflowStepFieldsAttachment:DF,setWorkflowStepFieldsAttachments:qF,updateWorkflowStepFieldsAttachment:jF,updateWorkflowStepFieldsAttachments:$F,deleteWorkflowStepFieldsAttachment:CF,deleteWorkflowStepFieldsAttachments:fa}=pa.actions,UF=t=>t.workflowStepFieldsAttachmentReducer.instances,ya=o.createSelector([UF],t=>Object.values(t)),LF=S(o.createSelector([ya,(t,s)=>s],(t,s)=>A(t.filter(e=>e.fields_revision===s)))),NF=t=>s=>s.workflowStepFieldsAttachmentReducer.instances[t],HF=S(o.createSelector([ya,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),GF=pa.reducer,at=F(t=>t.uuid),KF={instances:{}},Sa=o.createSlice({name:"workflowStepFields",initialState:KF,extraReducers:t=>t.addMatcher(o.isAnyOf(T,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}=Sa.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=Sa.reducer,ct=F(t=>t.uuid),rg={instances:{}},Aa=o.createSlice({name:"workflowStepFieldValuesAttachments",initialState:rg,extraReducers:t=>t.addMatcher(o.isAnyOf(T,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:wa,setWorkflowStepFieldValuesAttachment:ug,setWorkflowStepFieldValuesAttachments:og,updateWorkflowStepFieldValuesAttachment:hg,updateWorkflowStepFieldValuesAttachments:pg,deleteWorkflowStepFieldValuesAttachment:mg,deleteWorkflowStepFieldValuesAttachments:Ta}=Aa.actions,fg=t=>t.workflowStepFieldValuesAttachmentReducer.instances,Ia=o.createSelector([fg],t=>Object.values(t)),yg=t=>s=>s.workflowStepFieldValuesAttachmentReducer.instances[t],Sg=S(o.createSelector([Ia,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Ag=S(o.createSelector([Ia,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),wg=Aa.reducer,rt=F(t=>t.uuid),Tg={instances:{}},Oa=o.createSlice({name:"workflowStepFieldValues",initialState:Tg,extraReducers:t=>t.addMatcher(o.isAnyOf(T,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}=Oa.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=Oa.reducer,dt=F(t=>t.uuid),Wg={instances:{}},Fa=o.createSlice({name:"workflowStepFieldValuesReviewRequests",initialState:Wg,extraReducers:t=>t.addMatcher(o.isAnyOf(T,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:ga,setWorkflowStepFieldValuesReviewRequest:Dg,setWorkflowStepFieldValuesReviewRequests:qg,updateWorkflowStepFieldValuesReviewRequest:jg,updateWorkflowStepFieldValuesReviewRequests:$g,deleteWorkflowStepFieldValuesReviewRequest:Cg,deleteWorkflowStepFieldValuesReviewRequests:_a}=Fa.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)))})),Hg=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)))})),Gg=Fa.reducer,lt=F(t=>t.uuid),Kg={instances:{}},Pa=o.createSlice({name:"workflowStepFieldValuesReviews",initialState:Kg,extraReducers:t=>t.addMatcher(o.isAnyOf(T,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:ba,setWorkflowStepFieldValuesReview:Zg,setWorkflowStepFieldValuesReviews:Qg,updateWorkflowStepFieldValuesReview:Xg,updateWorkflowStepFieldValuesReviews:xg,deleteWorkflowStepFieldValuesReview:e_,deleteWorkflowStepFieldValuesReviews:Ra}=Pa.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_=Pa.reducer,ut=F(t=>t.uuid),c_={instances:{}},Ma=o.createSlice({name:"workflowStepReviewers",initialState:c_,extraReducers:t=>t.addMatcher(o.isAnyOf(T,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_}=Ma.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_=Ma.reducer,ot=F(t=>t.uuid),T_={instances:{}},ka=o.createSlice({name:"workflowSteps",initialState:T_,extraReducers:t=>t.addMatcher(o.isAnyOf(T,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_}=ka.actions,k_=t=>t.workflowStepReducer.instances,va=o.createSelector([k_],t=>Object.values(t)),v_=t=>s=>s.workflowStepReducer.instances[t],E_=S(o.createSelector([va,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),oM=S(o.createSelector([va,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_type===s)))),V_=ka.reducer,ht=F(t=>t.uuid),W_={instances:{}},Ea=o.createSlice({name:"workflowTypes",initialState:W_,extraReducers:t=>t.addMatcher(o.isAnyOf(T,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_}=Ea.actions,N_=t=>t.workflowTypeReducer.instances,Va=o.createSelector([N_],t=>Object.values(t)),H_=t=>s=>s.workflowTypeReducer.instances[t],G_=S(o.createSelector([Va,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),hM=S(o.createSelector([Va,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),K_=Ea.reducer,Wa={outboxReducer:lT,fileReducer:Rp,authReducer:Dh},pM=o.combineReducers(Wa),Y_={...Wa,[Et]:UI,assetReducer:Ll,assetAttachmentReducer:Rc,assetStageCompletionReducer:eu,assetStageReducer:fu,assetTypeReducer:Th,assetTypeAttachmentReducer:ku,issueReducer:Hy,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:ym,formSubmissionAttachmentReducer:tf,formSubmissionReducer:ff,formIdentifierReducer:Up,formIdentifierValueReducer:sm,userReducer:Pw,emailDomainsReducer:_p,documentsReducer:dp,documentAttachmentReducer:Qh,teamReducer:$I,agentsReducer:fc,issueCommentReducer:Ey,issueCommentAttachmentReducer:wy,issueUpdateReducer:Sw,geoImageReducer:Mf,issueAssociationReducer:Gf,issueTypeFieldsReducer:KS,issueTypeFieldValuesReducer:VS,issueTypeFieldsAttachmentReducer:wS,issueTypeFieldValuesAttachmentReducer:cA,issueTypeIdentifierReducer:TA,issueTypeIdentifierValueReducer:WA,issueTypeStatusReducer:rw,assetTypeFieldsReducer:no,assetTypeFieldValuesReducer:Eo,assetTypeFieldsAttachmentReducer:Nu,assetTypeFieldValuesAttachmentReducer:Ao,assetTypeIdentifierReducer:Go,assetTypeIdentifierValueReducer:ch,assetTypeStatusReducer:Wh,assetProcedureTypeReducer:pd,assetProcedureReducer:Xr,assetProcedureTypeFieldsReducer:pr,assetProcedureTypeFieldValuesReducer:$r,assetProcedureTypeFieldsAttachmentReducer:xc,assetProcedureTypeFieldValuesAttachmentReducer:_r,assetProcedureTypeAttachmentReducer:jc,assetProcedureStepFieldsAttachmentReducer:kd,assetProcedureStepFieldsReducer:Ld,assetProcedureStepFieldValuesAttachmentReducer:sl,assetProcedureStepFieldValuesReducer:yl,assetProcedureStepReducer:bl,teamMembershipReducer:FI,workflowTypeReducer:K_,workflowStepReducer:V_,workflowStepFieldsReducer:cg,workflowStepFieldsAttachmentReducer:GF,workflowReducer:sO,workflowIssueLinkReducer:SO,workflowStepAssigneeReducer:vO,workflowStepCommentReducer:HO,workflowStepDefaultAssigneeReducer:aF,workflowStepDefaultReviewerReducer:wF,workflowStepEventReducer:VF,workflowStepFieldValuesReducer:Vg,workflowStepFieldValuesAttachmentReducer:wg,workflowStepFieldValuesReviewReducer:a_,workflowStepFieldValuesReviewRequestReducer:Gg,workflowStepReviewerReducer:w_},mM=o.combineReducers(Y_),J_=1e4,Z_=200,Ba=[400,409,403,404,405,500],pt=1e4,Q_={};class X_{constructor(s){p(this,"client");p(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={...Ua,effect:wM,discard:cP,returnPromises:!0,persistCallback:AM,retry:gM,persistOptions:{storage:gP},queue:{...Ua.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 Da(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
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=
|
|
4
|
-
Action:`,s);const
|
|
5
|
-
`):c.map(
|
|
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 m=Ot();if(!m)throw new Error("Outbox coordinator not set");m.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 m=t.status||((u=t.response)==null?void 0:u.status);if(m||console.warn("Error has no status code:",t),m!==void 0&&Ba.includes(m)){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())),Za}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
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>zF?ct:e}class L extends Error{constructor(e){super(ct);y(this,"status");y(this,"response");y(this,"message");y(this,"options");const{response:n,innerError:a}=e;this.message=e.message??jF(n,a)??ct,this.status=(n==null?void 0:n.status)??0,this.response=n,e.discard=e.discard??!1,this.options=e}}function JI(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 DF extends UI{constructor(s){super(s)}}class it extends UI{constructor(e,n){super(e);y(this,"auth");this.auth=n}}class qF extends it{async startConversation(s,e){return this.enqueueRequest({description:"Start agent conversation",method:m.POST,url:"/agents/prompt/",payload:{prompt:s,active_project:e},blockers:["prompt"],blocks:["prompt"]}).then(n=>(this.dispatch(ra(n)),n))}async continueConversation(s,e,n){return this.enqueueRequest({description:"Prompt agent",method:m.POST,url:"/agents/prompt/",payload:{prompt:s,active_project:n},blockers:["prompt"],blocks:["prompt"],queryParams:{conversation_id:e}}).then(a=>{this.dispatch(la(a))})}async fetchDetails(s){return this.enqueueRequest({description:"Get agent conversation",method:m.GET,url:`/agents/conversations/${s}/`,blockers:["conversation"],blocks:["conversation"]}).then(e=>{this.dispatch(ua(e))})}async rate(s,e){return this.enqueueRequest({description:"Rate agent response",method:m.PUT,url:`/agents/responses/${s}/rate/`,payload:{rating:e},blockers:["rate"],blocks:["rate"]})}async list(s,e){return this.performRequest({method:m.GET,url:"/agents/conversations/",...s},e)}async refreshStore(s,e){const n=await this.list({queryParams:{project:s}},e);return this.dispatch(da(n)),n}}function xe(t,s){const e=[];let n=0;const a=t.length;for(;n<a;)e.push(t.slice(n,n+=s));return e}function T(t,s,e){const n=`${s}${e?"s":""}`;switch(t){case m.GET:return`Get ${n}`;case m.POST:return`Create ${n}`;case m.PATCH:return`Update ${n}`;case m.PUT:return`Update ${n}`;case m.DELETE:return`Delete ${n}`}}class v extends it{async get(s,e){return this.performRequest({url:`${this.url}/${s}/`,method:m.GET},e)}async list(s,e){return this.performRequest({url:`${this.url}/`,method:m.GET,...s},e)}async listPaginated(s,e){return this.performPagination({url:`${this.url}/`,method:m.GET,...s},e)}}class q extends v{constructor(){super(...arguments);y(this,"pageSize",$I)}async add(e){const{addOne:n,updateOne:a,deleteOne:c}=this.actions;let d,l=null,r=null;if("file"in e){const{file:g,...w}=e;l=await this.client.files.getFilePayload(g),r=URL.createObjectURL(g),d={...w,file_sha1:l.sha1,file_type:l.file_type,file_name:g.name,file_extension:l.extension,file_url:r}}else d=e;const u=this.buildModel(d),h=this.buildPayload(u);this.dispatch(n(u));const p=this.enqueueRequest({description:T(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:{...h,...l?{file:l}:{}},blockers:this.getBlockers(u),blocks:this.getBlocks(u)});p.then(({instance:g})=>{this.dispatch(a(g))}).catch(g=>{throw this.dispatch(c(this.getId(u))),g}).finally(()=>{r&&URL.revokeObjectURL(r)});const A=p.then(({instance:g})=>g),I=p.then(async({instance:g,presigned_url:w})=>{try{return w&&await this.client.files.processPresignedUrl(g.file_sha1,w),g.file_sha1}catch(P){throw console.error("Upload to s3 using presigned url failed.",P),P}});return[u,A,I]}async bulkAdd(e,n){const{addMany:a,updateMany:c,deleteMany:d}=this.actions,l=new Date().toISOString(),r=[],u=new Set,h=xe(e,Math.min(n??e.length,Xe)),p=[];for(const w of h){const P=[],R={},M=[],j=[];for(const z of w){let $;if("file"in z){const{file:qn,...xg}=z,lt=await this.client.files.getFilePayload(qn);lt.sha1 in R||(R[lt.sha1]=lt);const rO=URL.createObjectURL(qn);u.add(rO),$={...xg,file_sha1:lt.sha1,file_type:lt.file_type,file_name:qn.name,file_extension:lt.extension,file_url:rO}}else $=z;const B=this.buildModel($);r.push(B);const N=this.buildBulkPayload(B);P.push(N);const kt=this.getBlockers(B);M.push(...kt);const Qg=this.getBlocks(B);j.push(...Qg)}const C={payloads:P,submittedAt:l,files:Object.values(R),blockers:M,blocks:j};p.push(C)}this.dispatch(a(r));const A=p.map(w=>{const{submittedAt:P,files:R,payloads:M,blocks:j,blockers:C}=w;return this.enqueueRequest({description:T(m.POST,this.name,!0),method:m.POST,url:`${this.url}/bulk/`,payload:{submitted_at:P,files:R,payloads:M},blockers:C,blocks:j})});Promise.all(A).then(w=>{const P=w.flatMap(R=>R.instances);this.dispatch(c(P))}).catch(w=>{throw this.dispatch(d(r.map(P=>this.getId(P)))),console.error(w),w}).finally(()=>{for(const w of u)URL.revokeObjectURL(w)});const I=Promise.all(A).then(w=>w.flatMap(({instances:P})=>P)),g=Promise.all(A).then(async w=>{const P=[];for(const{presigned_urls:R}of w){const M=this.client.files.processPresignedUrls(R);for(const[j,C]of Object.entries(M))try{await C,P.push(j)}catch(z){throw console.error("Upload to s3 using presigned url failed.",z),z}}return P});return[r,I,g]}async delete(e){const{store:n}=this.client,{addOne:a,deleteOne:c}=this.actions,{selectById:d}=this.selectors,l=d(e)(n.getState());if(!l)throw new Error(`Attempting to delete ${this.name} with pk ${e} that does not exist in the store`);this.dispatch(c(this.getId(l)));try{return await this.enqueueRequest({description:T(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(r){throw this.dispatch(a(l)),r}}}class $F extends q{constructor(){super(...arguments);y(this,"name","Asset attachment");y(this,"url","/asset-attachments");y(this,"actions",{addOne:ya,addMany:Qt,setOne:pa,setMany:Aa,updateOne:fa,updateMany:Sa,deleteOne:Ta,deleteMany:xt,initialize:ma});y(this,"selectors",{selectById:Oa,selectByIds:Pa})}getId(e){return e.uuid}getBlockers(e){const{asset:n}=e;return[n]}getBlocks(e){return[e.uuid]}buildModel(e){var d;const{store:n}=this.client,a=((d=n.getState().userReducer.currentUser)==null?void 0:d.id)??null,c=new Date().toISOString();return F({...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,d=(await this.listPaginated({queryParams:{asset__project:e}},n)).flat();return this.dispatch(a(d)),d}}class CF extends q{constructor(){super(...arguments);y(this,"name","Asset Procedure Attachment");y(this,"url","/asset-procedure-type-attachments");y(this,"actions",{addOne:Ma,addMany:Ra,setOne:wa,setMany:Ea,updateOne:Ba,updateMany:va,deleteOne:Va,deleteMany:za,initialize:ba});y(this,"selectors",{selectById:qa,selectByIds:$a})}getId(e){return e.uuid}getBlockers(e){return[e.asset_procedure_type]}getBlocks(e){return[e.uuid]}buildModel(e){var A;const{store:n}=this.client,{asset_procedure_type:a,file_sha1:c,file_extension:d,file_name:l,file_type:r,file_url:u}=e,h=((A=n.getState().userReducer.currentUser)==null?void 0:A.id)??null,p=new Date().toISOString();return F({file_url:u,file_sha1:c,file_extension:d,file_name:l,file_type:r,created_by:h,submitted_at:p,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 UF extends q{constructor(){super(...arguments);y(this,"name","Asset Procedure Type Fields Attachment");y(this,"url","/asset-procedure-type-fields-attachments");y(this,"actions",{addOne:La,addMany:ka,setOne:Na,setMany:Ga,updateOne:Ha,updateMany:Wa,deleteOne:Ka,deleteMany:Ya,initialize:Ua});y(this,"selectors",{selectById:Xa,selectByIds:Qa})}getId(e){return e.uuid}getBlockers(e){return[e.fields_revision]}getBlocks(e){return[e.uuid]}buildModel(e){var d;const{store:n}=this.client,a=((d=n.getState().userReducer.currentUser)==null?void 0:d.id)??null,c=new Date().toISOString();return F({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:d,file_name:l,file_extension:r}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,fields_revision:c,file_sha1:d,file_name:l,file_extension:r}}buildBulkPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:d,file_name:l,file_extension:r}=e;return{uuid:n,field_identifier:a,fields_revision:c,file_sha1:d,file_name:l,file_extension:r}}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 LF extends v{constructor(){super(...arguments);y(this,"name","Asset Procedure Type Fields");y(this,"url","/asset-procedure-type-fields");y(this,"actions",{addOne:tc,addMany:sc,setOne:ic,setMany:nc,updateOne:ac,updateMany:cc,deleteOne:dc,deleteMany:rc,initialize:ec});y(this,"selectors",{selectById:oc,selectByIds:hc})}add(e){var p;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,l=((p=n.getState().userReducer.currentUser)==null?void 0:p.id)??null,r=new Date().toISOString(),u=F({...e,created_by:l,submitted_at:r});this.dispatch(a(u));const h=this.enqueueRequest({description:T(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(u),blockers:[u.asset_procedure_type],blocks:[u.uuid]});return h.then(A=>{this.dispatch(c(A))}).catch(A=>{throw this.dispatch(d(u.uuid)),A}),[u,h]}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 kF extends q{constructor(){super(...arguments);y(this,"name","Asset Procedure Type Field Values Attachment");y(this,"url","/asset-procedure-type-field-values-attachments");y(this,"actions",{addOne:pc,addMany:ds,setOne:Ac,setMany:fc,updateOne:Sc,updateMany:Tc,deleteOne:Ic,deleteMany:rs,initialize:yc});y(this,"selectors",{selectById:Fc,selectByIds:gc})}getId(e){return e.uuid}getBlockers(e){return[e.field_values]}getBlocks(e){return[e.uuid]}buildModel(e){var d;const{store:n}=this.client,a=((d=n.getState().userReducer.currentUser)==null?void 0:d.id)??null,c=new Date().toISOString();return F({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:d,file_name:l,file_extension:r}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,field_values:c,file_sha1:d,file_name:l,file_extension:r}}buildBulkPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:d,file_name:l,file_extension:r}=e;return{uuid:n,field_identifier:a,field_values:c,file_sha1:d,file_name:l,file_extension:r}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:d}=this.selectors,l=n.getState(),r=d(e)(l);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(m.DELETE,this.name,!0),method:m.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(u){throw this.dispatch(c(r)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{field_values__asset_procedure__project:e,latest:!0}},n)).flat();return this.dispatch(a(d)),d}}class NF extends v{constructor(){super(...arguments);y(this,"name","Asset Procedure Type Field Values");y(this,"url","/asset-procedure-type-field-values");y(this,"actions",{addOne:Rc,addMany:wc,setOne:Ec,setMany:Bc,updateOne:vc,updateMany:Vc,deleteOne:zc,deleteMany:jc,initialize:Mc});y(this,"selectors",{selectById:$c,selectByIds:Cc})}add(e){var A;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,r=((A=n.getState().userReducer.currentUser)==null?void 0:A.id)??null,u=new Date().toISOString(),h=F({...e,created_by:r,submitted_at:u}),p=this.enqueueRequest({description:T(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(h),blockers:[e.asset,e.fields_revision,e.asset_procedure],blocks:[h.uuid]});return this.dispatch(a(h)),p.then(I=>{this.dispatch(c(I))}).catch(()=>{this.dispatch(d(h.uuid))}),[h,p]}bulkAdd(e,n){var w;const{values:a,payloads:c}=e,{addMany:d,setMany:l,deleteMany:r}=this.actions,u=new Date().toISOString(),h=((w=this.client.store.getState().userReducer.currentUser)==null?void 0:w.id)??null,p=[],A=xe(c,Math.min(n??c.length,Xe)),I=[];for(const P of A){const R=[];for(const M of P){const j=F({...M,values:M.values,created_by:h,submitted_at:u});p.push(j),R.push({uuid:j.uuid,asset:M.asset,fields_revision:M.fields_revision,asset_procedure:M.asset_procedure,published_at:M.published_at,values:j.values})}I.push({submitted_at:u,values:a,field_values:R})}this.dispatch(d(p));const g=[];for(const P of I){const{field_values:R}=P,M=R.map(({asset:B})=>B),j=R.map(({fields_revision:B})=>B),C=R.map(({asset_procedure:B})=>B),z=R.map(({uuid:B})=>B),$=this.enqueueRequest({description:T(m.POST,this.name,!0),method:m.POST,url:`${this.url}/bulk/`,payload:P,blockers:M.concat(j).concat(C),blocks:z});g.push($)}return Promise.all(g).then(P=>{this.dispatch(l(P.flat()))}).catch(()=>{this.dispatch(r(V(p)))}),[p,g]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=n.getState(),l=c(e.uuid)(d);if(!l)throw new Error(`Expected AssetProcedureTypeFieldValues with uuid ${e.uuid} to exist`);const r={...l,...e};this.dispatch(a(r));const u=this.enqueueRequest({description:T(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[r.fields_revision,r.asset,r.asset_procedure],blocks:[r.uuid]});return u.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(a(l))}),[r,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,l=n.getState(),r=d(e)(l);if(!r)throw new Error(`Expected submission with uuid ${e} to exist`);const u=_c(e)(l);this.dispatch(a(e)),this.dispatch(rs(V(u)));try{return await this.enqueueRequest({description:T(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(h){throw this.dispatch(c(r)),this.dispatch(ds(u)),h}}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{asset_procedure__project:e,latest:!0}},n)).flat();return this.dispatch(a(d)),d}}class GF extends v{constructor(){super(...arguments);y(this,"name","Asset Procedure");y(this,"url","/asset-procedures");y(this,"actions",{addOne:kc,addMany:hs,setOne:Wc,setMany:Kc,updateOne:Nc,updateMany:Gc,deleteOne:Hc,deleteMany:ms,initialize:Lc});y(this,"selectors",{selectById:Xc,selectByIds:Qc})}add(e){var p;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,l=((p=n.getState().userReducer.currentUser)==null?void 0:p.id)??null,r=new Date().toISOString(),u=F({...e,created_by:l,submitted_at:r});this.dispatch(a(u));const h=this.enqueueRequest({description:T(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(u),blockers:[e.asset_procedure_type,e.asset_type],blocks:[u.uuid]});return h.then(A=>{this.dispatch(c(A))}).catch(()=>{this.dispatch(d(u.uuid))}),[u,h]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=c(e.uuid)(n.getState());if(!d)throw new Error(`Expected asset procedure with uuid ${e.uuid} to exist`);const l={...d,...e};this.dispatch(a(l));const r=this.enqueueRequest({description:T(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[d.uuid],blocks:[d.uuid]});return r.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(d))}),[l,r]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,l=n.getState(),r=d(e)(l);if(!r)throw new Error(`Expected asset procedure with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(r)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{project:e}},n)).flat();return this.dispatch(a(d)),d}}class HF extends v{constructor(){super(...arguments);y(this,"name","Asset Procedure Type");y(this,"url","/asset-procedure-types");y(this,"actions",{addOne:td,addMany:sd,setOne:dd,setMany:rd,updateOne:id,updateMany:nd,deleteOne:ad,deleteMany:cd,initialize:ed});y(this,"selectors",{selectById:od,selectByIds:hd})}add(e){var p;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,l=((p=n.getState().userReducer.currentUser)==null?void 0:p.id)??null,r=new Date().toISOString(),u=F({...e,created_by:l,submitted_at:r});this.dispatch(a(u));const h=this.enqueueRequest({description:T(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(u),blockers:[],blocks:[u.uuid]});return h.then(A=>{this.dispatch(c(A))}).catch(()=>{this.dispatch(d(u.uuid))}),[u,h]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=c(e.uuid)(n.getState());if(!d)throw new Error(`Expected asset procedure type with uuid ${e.uuid} to exist`);const l={...d,...e};this.dispatch(a(l));const r=this.enqueueRequest({description:T(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[d.uuid],blocks:[d.uuid]});return r.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(d))}),[l,r]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,l=n.getState(),r=d(e)(l);if(!r)throw new Error(`Expected asset procedure type with uuid ${e} to exist`);const u=Jc(e)(l);this.dispatch(a(e)),this.dispatch(ms(V(u)));try{return await this.enqueueRequest({description:T(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(h){throw this.dispatch(c(r)),this.dispatch(hs(u)),h}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class WF extends q{constructor(){super(...arguments);y(this,"name","Asset Procedure Step Fields Attachment");y(this,"url","/asset-procedure-step-fields-attachments");y(this,"actions",{addOne:pd,addMany:Ad,setOne:fd,setMany:Sd,updateOne:Td,updateMany:Id,deleteOne:Od,deleteMany:Pd,initialize:yd});y(this,"selectors",{selectById:gd,selectByIds:_d})}getId(e){return e.uuid}getBlockers(e){return[e.fields_revision]}getBlocks(e){return[e.uuid]}buildModel(e){var d;const{store:n}=this.client,a=((d=n.getState().userReducer.currentUser)==null?void 0:d.id)??null,c=new Date().toISOString();return F({...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 KF extends v{constructor(){super(...arguments);y(this,"name","Asset Procedure Step Fields");y(this,"url","/asset-procedure-step-fields");y(this,"actions",{addOne:wd,addMany:Ed,setOne:Bd,setMany:vd,updateOne:Vd,updateMany:zd,deleteOne:jd,deleteMany:Dd,initialize:Rd});y(this,"selectors",{selectById:qd,selectByIds:$d})}add(e){var p;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,l=((p=n.getState().userReducer.currentUser)==null?void 0:p.id)??null,r=new Date().toISOString(),u=F({...e,created_by:l,submitted_at:r});this.dispatch(a(u));const h=this.enqueueRequest({description:T(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(u),blockers:[u.asset_procedure_step],blocks:[u.uuid]});return h.then(A=>{this.dispatch(c(A))}).catch(A=>{throw this.dispatch(d(u.uuid)),A}),[u,h]}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 d={...c,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:T(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${c.uuid}/`,payload:e,blockers:[c.uuid],blocks:[c.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(r=>{throw this.dispatch(a(c)),r}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,d=n.getState().assetProcedureStepFieldsReducer.instances[e];if(!d)throw new Error(`AssetProcedureStepFields with uuid ${e} not found`);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(l){throw this.dispatch(c(d)),l}}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 YF extends q{constructor(){super(...arguments);y(this,"name","Asset Procedure Step Field Values Attachment");y(this,"url","/asset-procedure-step-field-values-attachments");y(this,"actions",{addOne:kd,addMany:Os,setOne:Nd,setMany:Gd,updateOne:Hd,updateMany:Wd,deleteOne:Kd,deleteMany:Ps,initialize:Ld});y(this,"selectors",{selectById:Zd,selectByIds:Jd})}getId(e){return e.uuid}getBlockers(e){return[e.field_values]}getBlocks(e){return[e.uuid]}buildModel(e){var d;const{store:n}=this.client,a=((d=n.getState().userReducer.currentUser)==null?void 0:d.id)??null,c=new Date().toISOString();return F({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:d,file_name:l,file_extension:r}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,field_values:c,file_sha1:d,file_name:l,file_extension:r}}buildBulkPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:d,file_name:l,file_extension:r}=e;return{uuid:n,field_identifier:a,field_values:c,file_sha1:d,file_name:l,file_extension:r}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:d}=this.selectors,l=n.getState(),r=d(e)(l);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(m.DELETE,this.name,!0),method:m.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(u){throw this.dispatch(c(r)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{field_values__asset_procedure__project:e,latest:!0}},n)).flat();return this.dispatch(a(d)),d}}class ZF extends v{constructor(){super(...arguments);y(this,"name","Asset Procedure Step Field Values");y(this,"url","/asset-procedure-step-field-values");y(this,"actions",{addOne:tr,addMany:sr,setOne:ir,setMany:nr,updateOne:ar,updateMany:cr,deleteOne:dr,deleteMany:rr,initialize:er});y(this,"selectors",{selectById:lr,selectByIds:or})}add(e){var A;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,r=((A=n.getState().userReducer.currentUser)==null?void 0:A.id)??null,u=new Date().toISOString(),h=F({...e,created_by:r,submitted_at:u}),p=this.enqueueRequest({description:T(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(h),blockers:[e.asset,e.fields_revision,e.asset_procedure],blocks:[h.uuid]});return this.dispatch(a(h)),p.then(I=>{this.dispatch(c(I))}).catch(()=>{this.dispatch(d(h.uuid))}),[h,p]}bulkAdd(e,n){var w;const{payloads:a,values:c}=e,{addMany:d,setMany:l,deleteMany:r}=this.actions,u=new Date().toISOString(),h=((w=this.client.store.getState().userReducer.currentUser)==null?void 0:w.id)??null,p=[],A=xe(a,Math.min(n??a.length,Xe)),I=[];for(const P of A){const R=[];for(const M of P){const j=F({...M,values:M.values,created_by:h,submitted_at:u});p.push(j),R.push({uuid:j.uuid,asset:M.asset,fields_revision:M.fields_revision,asset_procedure:M.asset_procedure,asset_procedure_step:M.asset_procedure_step,published_at:M.published_at,values:j.values})}I.push({submitted_at:u,values:c,field_values:R})}this.dispatch(d(p));const g=[];for(const P of I){const{field_values:R}=P,M=R.map(({asset:B})=>B),j=R.map(({fields_revision:B})=>B),C=R.map(({asset_procedure:B})=>B),z=R.map(({uuid:B})=>B),$=this.enqueueRequest({description:T(m.POST,this.name,!0),method:m.POST,url:`${this.url}/bulk/`,payload:P,blockers:M.concat(j).concat(C),blocks:z});g.push($)}return Promise.all(g).then(P=>{this.dispatch(l(P.flat()))}).catch(()=>{this.dispatch(r(V(p)))}),[p,g]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=n.getState(),l=c(e.uuid)(d);if(!l)throw new Error(`Expected AssetProcedureStepFieldValues with uuid ${e.uuid} to exist`);const r={...l,...e};this.dispatch(a(r));const u=this.enqueueRequest({description:T(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[r.fields_revision,r.asset,r.asset_procedure],blocks:[r.uuid]});return u.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(a(l))}),[r,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,l=n.getState(),r=d(e)(l);if(!r)throw new Error(`Expected submission with uuid ${e} to exist`);const u=Xd(e)(l);this.dispatch(a(e)),this.dispatch(Ps(V(u)));try{return await this.enqueueRequest({description:T(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(h){throw this.dispatch(c(r)),this.dispatch(Os(u)),h}}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{asset_procedure__project:e,latest:!0}},n)).flat();return this.dispatch(a(d)),d}}class JF extends v{constructor(){super(...arguments);y(this,"name","Asset Procedure Step");y(this,"url","/asset-procedure-steps");y(this,"actions",{addOne:fr,addMany:Sr,setOne:pr,setMany:Ar,updateOne:Tr,updateMany:Ir,deleteOne:Or,deleteMany:Pr,initialize:yr});y(this,"selectors",{selectById:gr,selectByIds:_r})}add(e){var p;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,l=((p=n.getState().userReducer.currentUser)==null?void 0:p.id)??null,r=new Date().toISOString(),u=F({...e,created_by:l,submitted_at:r});this.dispatch(a(u));const h=this.enqueueRequest({description:T(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(u),blockers:[u.asset_procedure_type],blocks:[u.uuid]});return h.then(A=>{this.dispatch(c(A))}).catch(()=>{this.dispatch(d(u.uuid))}),[u,h]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=c(e.uuid)(n.getState());if(!d)throw new Error(`No asset procedure step with uuid ${e.uuid} found in the store`);const l={...d,...e};this.dispatch(a(l));const r=this.enqueueRequest({description:T(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${d.uuid}/`,payload:{name:e.name,description:e.description,priority:e.order,color:e.color},blockers:[d.uuid],blocks:[d.uuid]});return r.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(d))}),[l,r]}async delete(e){const{store:n}=this.client,{deleteMany:a,addMany:c,addOne:d,deleteOne:l}=this.actions,{selectById:r}=this.selectors,u=n.getState(),h=r(e)(u);if(!h)throw new Error(`No asset procedure step with uuid ${e} found in the store`);const p=br(e)(u);this.dispatch(l(e)),this.dispatch(a(V(p)));try{return await this.enqueueRequest({description:T(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(A){throw this.dispatch(d(h)),this.dispatch(c(p)),A}}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 XF extends v{constructor(){super(...arguments);y(this,"url","/assets");y(this,"name","Asset");y(this,"actions",{addOne:wr,addMany:Rs,setOne:Vr,setMany:zr,updateOne:Er,updateMany:Br,deleteOne:vr,deleteMany:ws,initialize:Rr});y(this,"selectors",{selectById:qr,selectByIds:$r})}add(e){var p;const{store:n}=this.client,{addOne:a,updateOne:c,deleteOne:d}=this.actions,l=((p=n.getState().userReducer.currentUser)==null?void 0:p.id)??null,r=new Date().toISOString(),u=F({...e,created_by:l,submitted_at:r});this.dispatch(a(u));const h=this.enqueueRequest({description:T(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(u),blockers:[u.asset_type],blocks:[u.uuid]});return h.then(A=>{this.dispatch(c(A))}).catch(()=>{this.dispatch(d(u.uuid))}),[u,h]}update(e){const{store:n}=this.client,{updateOne:a}=this.actions,{selectById:c}=this.selectors,d=c(e.uuid)(n.getState());if(!d)throw new Error(`No asset with uuid ${e.uuid} found in the store`);const l={...d,...e};this.dispatch(a(l));const r=this.enqueueRequest({description:T(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return r.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(d))}),[l,r]}async delete(e){const{store:n}=this.client,{addOne:a,deleteOne:c}=this.actions,{selectById:d}=this.selectors,l=n.getState(),r=d(e)(l);if(!r)throw new Error(`No asset with uuid ${e} found in the store`);const u=Fa(e)(l),h=qy(e)(l);this.dispatch(c(e)),this.dispatch(xt(V(u))),this.dispatch(tt(V(h)));try{return await this.enqueueRequest({description:T(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(p){throw this.dispatch(a(r)),this.dispatch(Qt(u)),this.dispatch(et(h)),p}}bulkAdd(e,n){const{addMany:a}=this.actions,c=new Date().toISOString(),d=Qe.v4(),l=xe(e,Math.min(n??e.length,Xe)).map(h=>{const p=h.map(A=>F(A));return{batchId:Qe.v4(),payload:{transaction_id:d,submitted_at:c,assets:p}}}),r=[];let u=null;for(const h of l){const{batchId:p,payload:A}=h,I=A.assets.map(({uuid:M})=>M),g=A.assets.map(({asset_type:M})=>M),w=A.assets.map(({project:M})=>M),P=A.assets.map(({status:M})=>M),R=this.enqueueRequest({description:T(m.POST,this.name,!0),method:m.POST,url:`${this.url}/bulk/`,payload:A,blockers:(u?[u]:[]).concat(g).concat(w).concat(P),blocks:[p].concat(I)});u=h.batchId,r.push(R)}return Promise.all(r).then(h=>{const p=h.flat();this.dispatch(a(p))}),r}bulkUpdate(e,n){const{store:a}=this.client,{updateMany:c}=this.actions,{selectByIds:d}=this.selectors,l=V(e).toSorted(It);if(l.length!==e.length)throw new Error("payloads contains duplicate uuids.");const r=d(l)(a.getState()).toSorted(Yt);if(l.length!=r.length)throw new Error(`Attempting to bulk update ${l.length-r.length} assets that dont exist in the store`);const u=[];for(let I=0;I<l.length;I++)u.push({...r[I],...e[I]});this.dispatch(c(u));const h=xe(e,Math.min(n??e.length,Xe)),p=[];let A=null;for(const I of h){const g=Qe.v4(),w=V(I),P=I.map(({status:M})=>M).filter(Boolean),R=this.enqueueRequest({description:T(m.PATCH,this.name,!0),method:m.PATCH,url:`${this.url}/bulk/`,payload:{payloads:I},blockers:(A?[A]:[]).concat(w).concat(P),blocks:[g].concat(w)});p.push(R),A=g}return Promise.all(p).then(I=>{this.dispatch(c(I.flat()))}).catch(()=>{this.dispatch(c(r))}),[u,p]}async bulkDelete(e){const{store:n}=this.client,{addMany:a,deleteMany:c}=this.actions,{selectByIds:d}=this.selectors,l=n.getState(),r=d(e)(l);this.dispatch(c(e));try{return await this.enqueueRequest({description:T(m.DELETE,this.name,!0),method:m.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(u){throw this.dispatch(a(r)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{project:e}},n)).flat();return this.dispatch(a(d)),d}}class QF extends v{constructor(){super(...arguments);y(this,"name","Asset Stage Completion");y(this,"url","/asset-stage-completions");y(this,"actions",{addOne:kr,addMany:Nr,setOne:Gr,setMany:Hr,updateOne:Wr,updateMany:Kr,deleteOne:Yr,deleteMany:Zr,initialize:Lr});y(this,"selectors",{selectById:xr,selectByIds:eu})}add(e){var p;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,l=((p=n.getState().userReducer.currentUser)==null?void 0:p.id)??null,r=new Date().toISOString(),u=F({...e,created_by:l,submitted_at:r});this.dispatch(a(u));const h=this.enqueueRequest({description:T(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(u),blockers:[e.asset,e.asset_stage],blocks:[u.uuid]});return h.then(A=>{this.dispatch(c(A))}).catch(()=>{this.dispatch(d(u.uuid))}),[u,h]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,l=d(e)(n.getState());if(!l)throw new Error(`Expected asset stage completion with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(r){throw this.dispatch(c(l)),r}}bulkAdd(e){var I;const{store:n}=this.client,{addMany:a,setMany:c,deleteMany:d}=this.actions,l=new Date().toISOString(),r=((I=n.getState().userReducer.currentUser)==null?void 0:I.id)??null,u=e.map(g=>F(g)),h=u.map(g=>({...g,created_by:r,submitted_at:l})),p=h.map(({uuid:g})=>g);this.dispatch(a(h));const A=this.enqueueRequest({description:T(m.POST,this.name,!0),method:m.POST,url:`${this.url}/bulk/`,payload:{submitted_at:l,completions:u},blockers:[...e.map(g=>g.asset_procedure),...e.map(g=>g.asset_stage),...e.map(g=>g.asset)],blocks:p});return A.then(g=>{this.dispatch(c(g))}).catch(()=>{this.dispatch(d(p))}),[h,A]}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:d}=this.selectors,l=d(e)(n.getState());this.dispatch(a(e));try{return await this.enqueueRequest({description:T(m.DELETE,this.name,!0),method:m.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(r){throw this.dispatch(c(l)),r}}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{asset_procedure__project:e}},n)).flat();return this.dispatch(a(d)),d}}class xF extends v{constructor(){super(...arguments);y(this,"name","Asset Stage");y(this,"url","/asset-stages");y(this,"actions",{addOne:au,addMany:cu,setOne:iu,setMany:nu,updateOne:du,updateMany:ru,deleteOne:uu,deleteMany:lu,initialize:su});y(this,"selectors",{selectById:hu,selectByIds:mu})}add(e){var p;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,l=((p=n.getState().userReducer.currentUser)==null?void 0:p.id)??null,r=new Date().toISOString(),u=F({...e,created_by:l,submitted_at:r});this.dispatch(a(u));const h=this.enqueueRequest({description:T(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(u),blockers:[u.asset_procedure_type],blocks:[u.uuid]});return h.then(A=>{this.dispatch(c(A))}).catch(()=>{this.dispatch(d(u.uuid))}),[u,h]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=c(e.uuid)(n.getState());if(!d)throw new Error(`No asset stage with uuid ${e.uuid} found in the store`);const l={...d,...e};this.dispatch(a(l));const r=this.enqueueRequest({description:T(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${d.uuid}/`,payload:e,blockers:[d.uuid],blocks:[d.uuid]});return r.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(d))}),[l,r]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,l=n.getState(),r=d(e)(l);if(!r)throw new Error(`No asset stage with uuid ${e} found in the store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(r)),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 eg extends q{constructor(){super(...arguments);y(this,"name","Asset Type Attachment");y(this,"url","/asset-type-attachments");y(this,"actions",{addOne:Au,addMany:js,setOne:fu,setMany:Su,updateOne:Tu,updateMany:Iu,deleteOne:Ou,deleteMany:Ds,initialize:pu});y(this,"selectors",{selectById:Fu,selectByIds:gu})}getId(e){return e.uuid}getBlockers(e){return[e.asset_type]}getBlocks(e){return[e.uuid]}buildModel(e){var d;const{store:n}=this.client,a=((d=n.getState().userReducer.currentUser)==null?void 0:d.id)??null,c=new Date().toISOString();return F({...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 tg extends q{constructor(){super(...arguments);y(this,"name","Asset Type Fields Attachment");y(this,"url","/asset-type-fields-attachments");y(this,"actions",{addOne:wu,addMany:Eu,setOne:Bu,setMany:vu,updateOne:Vu,updateMany:zu,deleteOne:ju,deleteMany:Du,initialize:Ru});y(this,"selectors",{selectById:$u,selectByIds:Cu})}getId(e){return e.uuid}getBlockers(e){return[e.fields_revision]}getBlocks(e){return[e.uuid]}buildModel(e){var d;const{store:n}=this.client,a=((d=n.getState().userReducer.currentUser)==null?void 0:d.id)??null,c=new Date().toISOString();return F({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:d,file_name:l,file_extension:r}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,fields_revision:c,file_sha1:d,file_name:l,file_extension:r}}buildBulkPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:d,file_name:l,file_extension:r}=e;return{uuid:n,field_identifier:a,fields_revision:c,file_sha1:d,file_name:l,file_extension:r}}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 sg extends v{constructor(){super(...arguments);y(this,"name","Asset Type Fields");y(this,"url","/asset-type-fields");y(this,"actions",{addOne:Nu,addMany:Gu,setOne:Hu,setMany:Wu,updateOne:Ku,updateMany:Yu,deleteOne:Zu,deleteMany:Ju,initialize:ku});y(this,"selectors",{selectById:Qu,selectByIds:xu})}add(e){var p;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,l=((p=n.getState().userReducer.currentUser)==null?void 0:p.id)??null,r=new Date().toISOString(),u=F({...e,created_by:l,submitted_at:r});this.dispatch(a(u));const h=this.enqueueRequest({description:T(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(u),blockers:[u.asset_type],blocks:[u.uuid]});return h.then(A=>{this.dispatch(c(A))}).catch(A=>{throw this.dispatch(d(u.uuid)),A}),[u,h]}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 ig extends q{constructor(){super(...arguments);y(this,"name","Asset Type Field Values Attachment");y(this,"url","/asset-type-field-values-attachments");y(this,"actions",{addOne:il,addMany:ks,setOne:nl,setMany:al,updateOne:cl,updateMany:dl,deleteOne:rl,deleteMany:Ns,initialize:sl});y(this,"selectors",{selectById:ll,selectByIds:ol})}getId(e){return e.uuid}getBlockers(e){return[e.field_values]}getBlocks(e){return[e.uuid]}buildModel(e){var d;const{store:n}=this.client,a=((d=n.getState().userReducer.currentUser)==null?void 0:d.id)??null,c=new Date().toISOString();return F({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:d,file_name:l,file_extension:r}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,field_values:c,file_sha1:d,file_name:l,file_extension:r}}buildBulkPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:d,file_name:l,file_extension:r}=e;return{uuid:n,field_identifier:a,field_values:c,file_sha1:d,file_name:l,file_extension:r}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:d}=this.selectors,l=n.getState(),r=d(e)(l);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(m.DELETE,this.name,!0),method:m.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(u){throw this.dispatch(c(r)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{field_values__asset__project:e,latest:!0}},n)).flat();return this.dispatch(a(d)),d}}class ng extends v{constructor(){super(...arguments);y(this,"name","Asset Type Field Values");y(this,"url","/asset-type-field-values");y(this,"actions",{addOne:Al,addMany:fl,setOne:Sl,setMany:Tl,updateOne:Il,updateMany:Ol,deleteOne:Pl,deleteMany:Fl,initialize:pl});y(this,"selectors",{selectById:_l,selectByIds:bl})}add(e){var A;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,r=((A=n.getState().userReducer.currentUser)==null?void 0:A.id)??null,u=new Date().toISOString(),h=F({...e,created_by:r,submitted_at:u}),p=this.enqueueRequest({description:T(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(h),blockers:[e.asset,e.fields_revision],blocks:[h.uuid]});return this.dispatch(a(h)),p.then(I=>{this.dispatch(c(I))}).catch(()=>{this.dispatch(d(h.uuid))}),[h,p]}bulkAdd(e,n){var g;const{payloads:a,values:c}=e,{addMany:d,setMany:l,deleteMany:r}=this.actions,u=new Date().toISOString(),h=[],p=xe(a,Math.min(n??a.length,Xe)),A=[];for(const w of p){const P=[];for(const R of w){const M=F({...R,values:R.values,created_by:((g=this.client.store.getState().userReducer.currentUser)==null?void 0:g.id)??null,submitted_at:u});h.push(M),P.push({uuid:M.uuid,asset:R.asset,fields_revision:R.fields_revision,published_at:R.published_at,values:M.values})}A.push({submitted_at:u,values:c,field_values:P})}this.dispatch(d(h));const I=[];for(const w of A){const{field_values:P}=w,R=P.map(({asset:z})=>z),M=P.map(({fields_revision:z})=>z),j=P.map(({uuid:z})=>z),C=this.enqueueRequest({description:T(m.POST,this.name,!0),method:m.POST,url:`${this.url}/bulk/`,payload:w,blockers:R.concat(M),blocks:j});I.push(C)}return Promise.all(I).then(w=>{this.dispatch(l(w.flat()))}).catch(()=>{this.dispatch(r(V(h)))}),[h,I]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=n.getState(),l=c(e.uuid)(d);if(!l)throw new Error(`Expected AssetTypeFieldValues with uuid ${e.uuid} to exist`);const r={...l,...e};this.dispatch(a(r));const u=this.enqueueRequest({description:T(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[r.uuid,r.fields_revision,r.asset],blocks:[r.uuid]});return u.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(a(l))}),[r,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,l=n.getState(),r=d(e)(l);if(!r)throw new Error(`Expected submission with uuid ${e} to exist`);const u=hl(e)(l);this.dispatch(a(e)),this.dispatch(Ns(V(u)));try{return await this.enqueueRequest({description:T(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(h){throw this.dispatch(c(r)),this.dispatch(ks(u)),h}}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{asset__project:e,latest:!0}},n)).flat();return this.dispatch(a(d)),d}}class ag extends v{constructor(){super(...arguments);y(this,"name","Asset Type Identifier");y(this,"url","/asset-type-identifiers");y(this,"actions",{addOne:El,addMany:Bl,setOne:vl,setMany:Vl,updateOne:zl,updateMany:jl,deleteOne:Dl,deleteMany:ql,initialize:wl});y(this,"selectors",{selectById:Cl,selectByIds:Ul})}add(e){var p;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,l=((p=n.getState().userReducer.currentUser)==null?void 0:p.id)??null,r=new Date().toISOString(),u=F({...e,created_by:l,submitted_at:r});this.dispatch(a(u));const h=this.enqueueRequest({description:T(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(u),blockers:[u.asset_type],blocks:[u.uuid]});return h.then(A=>{this.dispatch(c(A))}).catch(()=>{this.dispatch(d(u.uuid))}),[u,h]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=c(e.uuid)(n.getState());if(!d)throw new Error(`Expected asset type identifier with uuid ${e.uuid} to exist`);const l={...d,...e};this.dispatch(a(l));const r=this.enqueueRequest({description:T(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return r.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(d))}),[l,r]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,l=n.getState(),r=d(e)(l);if(!r)throw new Error(`Expected asset type identifier with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(r)),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 cg extends v{constructor(){super(...arguments);y(this,"name","Asset Type Identifier Value");y(this,"url","/asset-type-identifier-values");y(this,"actions",{addOne:Gl,addMany:Hl,setOne:Wl,setMany:Kl,updateOne:Yl,updateMany:Zl,deleteOne:Jl,deleteMany:Xl,initialize:Nl});y(this,"selectors",{selectById:xl,selectByIds:eo})}add(e){var p;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,l=((p=n.getState().userReducer.currentUser)==null?void 0:p.id)??null,r=new Date().toISOString(),u=F({...e,created_by:l,submitted_at:r});this.dispatch(a(u));const h=this.enqueueRequest({description:T(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(u),blockers:[e.asset,e.asset_type_identifier],blocks:[u.uuid]});return h.then(A=>{this.dispatch(c(A))}).catch(()=>{this.dispatch(d(u.uuid))}),[u,h]}bulkAdd(e,n){var w;const{store:a}=this.client,{addMany:c,updateMany:d,deleteMany:l}=this.actions,r=new Date().toISOString(),u=((w=a.getState().userReducer.currentUser)==null?void 0:w.id)??null,h=xe(e,Math.min(n??e.length,Xe)),p=[],A=[];for(const P of h){const R=[],M=[],j=[];for(const z of P){const $=F({...z,submitted_at:r,created_by:u});A.push($);const B={uuid:$.uuid,asset:$.asset,asset_type_identifier:$.asset_type_identifier,value:$.value};R.push(B),M.push($.asset),M.push($.asset_type_identifier),j.push($.uuid)}const C={payloads:R,submitted_at:r,blockers:M,blocks:j};p.push(C)}this.dispatch(c(A));const I=p.map(P=>{const{payloads:R,submitted_at:M,blockers:j,blocks:C}=P;return this.enqueueRequest({description:T(m.POST,this.name,!0),method:m.POST,url:`${this.url}/bulk/`,payload:{submitted_at:M,payloads:R},blockers:j,blocks:C})});Promise.all(I).then(P=>{this.dispatch(d(P.flat()))}).catch(P=>{throw this.dispatch(l(V(A))),P});const g=Promise.all(I).then(P=>P.flat());return[A,g]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,l=n.getState(),r=d(e)(l);if(!r)throw new Error(`Expected asset type identifier value with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(r)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{asset__project:e,latest:!0}},n)).flat();return this.dispatch(a(d)),d}}class dg extends v{constructor(){super(...arguments);y(this,"name","Asset Type");y(this,"url","/asset-types");y(this,"actions",{addOne:co,addMany:ro,setOne:no,setMany:ao,updateOne:uo,updateMany:lo,deleteOne:oo,deleteMany:ho,initialize:io});y(this,"selectors",{selectById:yo,selectByIds:po})}add(e){var p;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,l=((p=n.getState().userReducer.currentUser)==null?void 0:p.id)??null,r=new Date().toISOString(),u=F({...e,created_by:l,submitted_at:r});this.dispatch(a(u));const h=this.enqueueRequest({description:T(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(u),blockers:[],blocks:[u.uuid]});return h.then(A=>{this.dispatch(c(A))}).catch(()=>{this.dispatch(d(u.uuid))}),[u,h]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=c(e.uuid)(n.getState());if(!d)throw new Error(`Expected asset type with uuid ${e.uuid} to exist`);const l={...d,...e};this.dispatch(a(l));const r=this.enqueueRequest({description:T(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[d.uuid],blocks:[d.uuid]});return r.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(d))}),[l,r]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,l=n.getState(),r=d(e)(l);if(!r)throw new Error(`Expected asset type with uuid ${e} to exist`);const u=Dr(e)(l),h=_u(e)(l);this.dispatch(a(e)),this.dispatch(ws(V(u))),this.dispatch(Ds(V(h)));try{return await this.enqueueRequest({description:T(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(p){throw this.dispatch(c(r)),this.dispatch(Rs(u)),this.dispatch(js(h)),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 rg extends v{constructor(){super(...arguments);y(this,"name","Asset Type Status");y(this,"url","/asset-type-statuses");y(this,"actions",{addOne:To,addMany:Io,setOne:Oo,setMany:Po,updateOne:Fo,updateMany:go,deleteOne:_o,deleteMany:bo,initialize:So});y(this,"selectors",{selectById:Ro,selectByIds:wo})}add(e){var p;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,l=((p=n.getState().userReducer.currentUser)==null?void 0:p.id)??null,r=new Date().toISOString(),u=F({...e,created_by:l,submitted_at:r});this.dispatch(a(u));const h=this.enqueueRequest({description:T(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(u),blockers:[e.asset_type],blocks:[u.uuid]});return h.then(A=>{this.dispatch(c(A))}).catch(()=>{this.dispatch(d(u.uuid))}),[u,h]}update(e){const{setOne:n}=this.actions,{selectById:a}=this.selectors,c=this.client.store.getState(),d=a(e.uuid)(c);if(!d)throw new Error(`Expected an existing asset type status with uuid ${e.uuid}`);const l={...d,...e};this.dispatch(n(l));const r=this.enqueueRequest({description:T(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return r.then(u=>{this.dispatch(n(u))}).catch(()=>{this.dispatch(n(d))}),[l,r]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,l=d(e)(n.getState());if(!l)throw new Error(`No asset type status with uuid ${e} found in the store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(r){throw this.dispatch(c(l)),r}}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 ug extends q{constructor(){super(...arguments);y(this,"name","Document Attachment");y(this,"url","/document-attachments");y(this,"actions",{addOne:Do,addMany:qo,setOne:$o,setMany:Co,updateOne:Uo,updateMany:Lo,deleteOne:ko,deleteMany:No,initialize:jo});y(this,"selectors",{selectById:Ho,selectByIds:Wo})}getId(e){return e.uuid}getBlockers(e){return[e.document]}getBlocks(e){return[e.uuid]}buildModel(e){var d;const{store:n}=this.client,a=((d=n.getState().userReducer.currentUser)==null?void 0:d.id)??null,c=new Date().toISOString();return F({...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,d]=await super.bulkAdd(e,n),l={};for(const{file_sha1:r,uuid:u}of a)r in l||(l[r]=[]),l[r].push(u);return d.then(r=>{const u=r.flatMap(h=>l[h]??[]);for(const h of u)this.makeReadable(h)}),[a,c,d]}makeReadable(e){this.enqueueRequest({description:"Add attachment to AI assistant",method:m.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),d=this.list({queryParams:{document__organization:e}},n),r=(await Promise.all([c,d])).flat();return this.dispatch(a(r)),r}}class lg extends v{constructor(){super(...arguments);y(this,"name","Document");y(this,"url","/documents");y(this,"actions",{addOne:Jo,addMany:Xo,setOne:Qo,setMany:xo,updateOne:eh,updateMany:th,deleteOne:sh,deleteMany:ih,initialize:Zo});y(this,"selectors",{selectById:ah,selectByIds:ch})}add(e){var p;const{store:n}=this.client,{addOne:a,deleteOne:c,updateOne:d}=this.actions,l=((p=n.getState().userReducer.currentUser)==null?void 0:p.id)??null,r=new Date().toISOString(),u=F({...e,created_by:l,submitted_at:r});this.dispatch(a(u));const h=this.enqueueRequest({description:T(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(u),blockers:u.parent_document?[u.parent_document]:[],blocks:[u.uuid]});return h.then(A=>{this.dispatch(d(A))}).catch(()=>{this.dispatch(c(u.uuid))}),[u,h]}update(e){const{store:n}=this.client,{updateOne:a}=this.actions,{selectById:c}=this.selectors,d=c(e.uuid)(n.getState());if(!d)throw new Error(`attempting to update a document with uuid ${e.uuid} that does not exist in store.documents`);const l={...d,...e};this.dispatch(a(l));const r=this.enqueueRequest({description:T(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return r.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(d))}),[l,r]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c,addMany:d,deleteMany:l}=this.actions,{selectById:r}=this.selectors,u=n.getState(),h=r(e)(u);if(!h)throw new Error(`attempting to delete a document with uuid ${e} that does not exist in store.documents`);const p=dh(e)(u);this.dispatch(a(e)),this.dispatch(l(V(p)));try{return await this.enqueueRequest({description:T(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(A){throw this.dispatch(c(h)),this.dispatch(d(p)),A}}async refreshStore(e,n){const{initialize:a}=this.actions,c=this.list({queryParams:{project__organization:e}},n),d=this.list({queryParams:{organization:e}},n),r=(await Promise.all([c,d])).flat();return this.dispatch(a(r)),r}}class dt extends it{async get(s,e){return this.performRequest({url:`${this.url}/${s}/`,method:m.GET},e)}async list(s,e){return this.performRequest({url:`${this.url}/`,method:m.GET,...s},e)}async listPaginated(s,e){return this.performPagination({url:`${this.url}/`,method:m.GET,...s},e)}}class og extends dt{constructor(){super(...arguments);y(this,"name","Email Domains");y(this,"url","/organization-email-domains");y(this,"actions",{addOne:lh,addMany:oh,setOne:hh,setMany:mh,updateOne:yh,updateMany:ph,deleteOne:Ah,deleteMany:fh,initialize:uh});y(this,"selectors",{selectById:Th,selectByIds:Ih})}async add(e,n){return this.enqueueRequest({description:T(m.POST,this.name,!1),method:m.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:T(m.DELETE,this.name,!1),method:m.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 hg extends it{async getVerificationCode(s){return this.enqueueRequest({description:"Get verification code",method:m.GET,url:`/verification/email-verification/${s}/`,isAuthNeeded:!1,blockers:[],blocks:[]})}validateVerificationCode(s,e=void 0){return this.enqueueRequest({description:"Validate verification code",method:m.POST,url:`/verification/email-verification/${s}/`,isAuthNeeded:!1,payload:e,blockers:[],blocks:[]})}}const At={},Vn=new Set;class mg extends it{constructor(){super(...arguments);y(this,"host");y(this,"dbPromise",yO.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 Tt(e);if(Vn.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),Vn.add(n)}async removeCache(e){await(await this.getDB()).delete("files",e),Vn.delete(e)}async fetchCache(e){return(await this.getDB()).get("files",e)}async fetchFileFromUrl(e,n,a=n){const c=e.split("?")[0]??e,d=await this.fetchCache(n);if(d)return d;let l;c in At?l=At[c]:Xn(e)?(l=Jn(e,a),At[c]=l):(l=new Promise(h=>{this.performRequest({method:m.GET,url:e,isExternalUrl:!0,isResponseBlob:!0,isAuthNeeded:!1}).then(p=>{const A=new File([p],a,{type:p.type});h(A)})}),At[c]=l);let r;try{r=await l}catch(h){throw h instanceof L&&delete At[c],h}const u=await Tt(r);if(u!==n){const h=`The hash of the file returned from the server (${u}) does not match the
|
|
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);p(this,"status");p(this,"response");p(this,"message");p(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);p(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(hc(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(mc(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(pc(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(oc(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);p(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),m=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:{...m,...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),O=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,O]}async bulkAdd(e,n){const{addMany:a,updateMany:c,deleteMany:r}=this.actions,d=new Date().toISOString(),l=[],u=new Set,m=yt(e,Math.min(n??e.length,pt)),f=[];for(const v of m){const _=[],k={},R=[],z=[];for(const B of v){let q;if("file"in B){const{file:$a,...cv}=B,kt=await this.client.files.getFilePayload($a);kt.sha1 in k||(k[kt.sha1]=kt);const TP=URL.createObjectURL($a);u.add(TP),q={...cv,file_sha1:kt.sha1,file_type:kt.file_type,file_name:$a.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 O=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,O,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);p(this,"name","Asset attachment");p(this,"url","/asset-attachments");p(this,"actions",{addOne:Ac,addMany:Rs,setOne:wc,setMany:Tc,updateOne:Ic,updateMany:Oc,deleteOne:Fc,deleteMany:Ms,initialize:Sc});p(this,"selectors",{selectById:_c,selectByIds:Pc})}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 I({...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);p(this,"name","Asset Procedure Attachment");p(this,"url","/asset-procedure-type-attachments");p(this,"actions",{addOne:vc,addMany:Ec,setOne:Vc,setMany:Wc,updateOne:Bc,updateMany:zc,deleteOne:Dc,deleteMany:qc,initialize:kc});p(this,"selectors",{selectById:Cc,selectByIds:Uc})}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,m=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,f=new Date().toISOString();return I({file_url:u,file_sha1:c,file_extension:r,file_name:d,file_type:l,created_by:m,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);p(this,"name","Asset Procedure Type Fields Attachment");p(this,"url","/asset-procedure-type-fields-attachments");p(this,"actions",{addOne:Hc,addMany:Gc,setOne:Kc,setMany:Yc,updateOne:Jc,updateMany:Zc,deleteOne:Qc,deleteMany:Xc,initialize:Nc});p(this,"selectors",{selectById:tr,selectByIds:sr})}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 I({...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);p(this,"name","Asset Procedure Type Fields");p(this,"url","/asset-procedure-type-fields");p(this,"actions",{addOne:ar,addMany:cr,setOne:rr,setMany:dr,updateOne:lr,updateMany:ur,deleteOne:or,deleteMany:hr,initialize:nr});p(this,"selectors",{selectById:fr,selectByIds:yr})}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=I({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const m=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 m.then(y=>{this.dispatch(c(y))}).catch(y=>{throw this.dispatch(r(u.uuid)),y}),[u,m]}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);p(this,"name","Asset Procedure Type Field Values Attachment");p(this,"url","/asset-procedure-type-field-values-attachments");p(this,"actions",{addOne:wr,addMany:Ds,setOne:Tr,setMany:Ir,updateOne:Or,updateMany:Fr,deleteOne:gr,deleteMany:qs,initialize:Ar});p(this,"selectors",{selectById:br,selectByIds:Rr})}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 I({...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);p(this,"name","Asset Procedure Type Field Values");p(this,"url","/asset-procedure-type-field-values");p(this,"actions",{addOne:Er,addMany:Vr,setOne:Wr,setMany:Br,updateOne:zr,updateMany:Dr,deleteOne:qr,deleteMany:jr,initialize:vr});p(this,"selectors",{selectById:Ur,selectByIds:Lr})}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(),m=I({...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(m),blockers:[e.asset,e.fields_revision,e.asset_procedure],blocks:[m.uuid]});return this.dispatch(a(m)),f.then(O=>{this.dispatch(c(O))}).catch(()=>{this.dispatch(r(m.uuid))}),[m,f]}bulkAdd(e,n){var v;const{values:a,payloads:c}=e,{addMany:r,setMany:d,deleteMany:l}=this.actions,u=new Date().toISOString(),m=((v=this.client.store.getState().userReducer.currentUser)==null?void 0:v.id)??null,f=[],y=yt(c,Math.min(n??c.length,pt)),O=[];for(const _ of y){const k=[];for(const R of _){const z=I({...R,values:R.values,created_by:m,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})}O.push({submitted_at:u,values:a,field_values:k})}this.dispatch(r(f));const P=[];for(const _ of O){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(m=>{this.dispatch(a(m))}).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=Mr(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(m){throw this.dispatch(c(l)),this.dispatch(Ds(u)),m}}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);p(this,"name","Asset Procedure");p(this,"url","/asset-procedures");p(this,"actions",{addOne:Gr,addMany:Us,setOne:Zr,setMany:Qr,updateOne:Kr,updateMany:Yr,deleteOne:Jr,deleteMany:Ls,initialize:Hr});p(this,"selectors",{selectById:td,selectByIds:sd})}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=I({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const m=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 m.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,m]}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);p(this,"name","Asset Procedure Type");p(this,"url","/asset-procedure-types");p(this,"actions",{addOne:ad,addMany:cd,setOne:od,setMany:hd,updateOne:rd,updateMany:dd,deleteOne:ld,deleteMany:ud,initialize:nd});p(this,"selectors",{selectById:fd,selectByIds:yd})}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=I({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const m=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:b(u),blockers:[],blocks:[u.uuid]});return m.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,m]}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=ed(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(m){throw this.dispatch(c(l)),this.dispatch(Us(u)),m}}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);p(this,"name","Asset Procedure Step Fields Attachment");p(this,"url","/asset-procedure-step-fields-attachments");p(this,"actions",{addOne:wd,addMany:Td,setOne:Id,setMany:Od,updateOne:Fd,updateMany:gd,deleteOne:_d,deleteMany:Pd,initialize:Ad});p(this,"selectors",{selectById:Rd,selectByIds:Md})}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 I({...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);p(this,"name","Asset Procedure Step Fields");p(this,"url","/asset-procedure-step-fields");p(this,"actions",{addOne:Vd,addMany:Wd,setOne:Bd,setMany:zd,updateOne:Dd,updateMany:qd,deleteOne:jd,deleteMany:$d,initialize:Ed});p(this,"selectors",{selectById:Cd,selectByIds:Ud})}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=I({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const m=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 m.then(y=>{this.dispatch(c(y))}).catch(y=>{throw this.dispatch(r(u.uuid)),y}),[u,m]}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);p(this,"name","Asset Procedure Step Field Values Attachment");p(this,"url","/asset-procedure-step-field-values-attachments");p(this,"actions",{addOne:Gd,addMany:Qs,setOne:Kd,setMany:Yd,updateOne:Jd,updateMany:Zd,deleteOne:Qd,deleteMany:Xs,initialize:Hd});p(this,"selectors",{selectById:xd,selectByIds:el})}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 I({...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);p(this,"name","Asset Procedure Step Field Values");p(this,"url","/asset-procedure-step-field-values");p(this,"actions",{addOne:al,addMany:cl,setOne:rl,setMany:dl,updateOne:ll,updateMany:ul,deleteOne:ol,deleteMany:hl,initialize:nl});p(this,"selectors",{selectById:ml,selectByIds:fl})}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(),m=I({...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(m),blockers:[e.asset,e.fields_revision,e.asset_procedure],blocks:[m.uuid]});return this.dispatch(a(m)),f.then(O=>{this.dispatch(c(O))}).catch(()=>{this.dispatch(r(m.uuid))}),[m,f]}bulkAdd(e,n){var v;const{payloads:a,values:c}=e,{addMany:r,setMany:d,deleteMany:l}=this.actions,u=new Date().toISOString(),m=((v=this.client.store.getState().userReducer.currentUser)==null?void 0:v.id)??null,f=[],y=yt(a,Math.min(n??a.length,pt)),O=[];for(const _ of y){const k=[];for(const R of _){const z=I({...R,values:R.values,created_by:m,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})}O.push({submitted_at:u,values:c,field_values:k})}this.dispatch(r(f));const P=[];for(const _ of O){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(m=>{this.dispatch(a(m))}).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=tl(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(m){throw this.dispatch(c(l)),this.dispatch(Qs(u)),m}}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);p(this,"name","Asset Procedure Step");p(this,"url","/asset-procedure-steps");p(this,"actions",{addOne:Il,addMany:Ol,setOne:wl,setMany:Tl,updateOne:Fl,updateMany:gl,deleteOne:_l,deleteMany:Pl,initialize:Al});p(this,"selectors",{selectById:Rl,selectByIds:Ml})}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=I({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const m=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 m.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,m]}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(),m=l(e)(u);if(!m)throw new Error(`No asset procedure step with uuid ${e} found in the store`);const f=kl(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(m)),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);p(this,"url","/assets");p(this,"name","Asset");p(this,"actions",{addOne:Vl,addMany:ni,setOne:Dl,setMany:ql,updateOne:Wl,updateMany:Bl,deleteOne:zl,deleteMany:ai,initialize:El});p(this,"selectors",{selectById:Cl,selectByIds:Ul})}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=I({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const m=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 m.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,m]}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=bc(e)(d),m=Hf(e)(d);this.dispatch(c(e)),this.dispatch(Ms(E(u))),this.dispatch(At(E(m)));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(m)),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(m=>{const f=m.map(y=>I(y));return{batchId:mt.v4(),payload:{transaction_id:r,submitted_at:c,assets:f}}}),l=[];let u=null;for(const m of d){const{batchId:f,payload:y}=m,O=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(O)});u=m.batchId,l.push(k)}return Promise.all(l).then(m=>{const f=m.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 O=0;O<d.length;O++)u.push({...l[O],...e[O]});this.dispatch(c(u));const m=yt(e,Math.min(n??e.length,pt)),f=[];let y=null;for(const O of m){const P=mt.v4(),v=E(O),_=O.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:O},blockers:(y?[y]:[]).concat(v).concat(_),blocks:[P].concat(v)});f.push(k),y=P}return Promise.all(f).then(O=>{this.dispatch(c(O.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);p(this,"name","Asset Stage Completion");p(this,"url","/asset-stage-completions");p(this,"actions",{addOne:Gl,addMany:Kl,setOne:Yl,setMany:Jl,updateOne:Zl,updateMany:Ql,deleteOne:Xl,deleteMany:xl,initialize:Hl});p(this,"selectors",{selectById:iu,selectByIds:nu})}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=I({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const m=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 m.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,m]}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 O;const{store:n}=this.client,{addMany:a,setMany:c,deleteMany:r}=this.actions,d=new Date().toISOString(),l=((O=n.getState().userReducer.currentUser)==null?void 0:O.id)??null,u=e.map(P=>I(P)),m=u.map(P=>({...P,created_by:l,submitted_at:d})),f=m.map(({uuid:P})=>P);this.dispatch(a(m));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))}),[m,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);p(this,"name","Asset Stage");p(this,"url","/asset-stages");p(this,"actions",{addOne:lu,addMany:uu,setOne:ru,setMany:du,updateOne:ou,updateMany:hu,deleteOne:pu,deleteMany:mu,initialize:cu});p(this,"selectors",{selectById:yu,selectByIds:Su})}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=I({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const m=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 m.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,m]}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 HM extends D{constructor(){super(...arguments);p(this,"name","Asset Type Attachment");p(this,"url","/asset-type-attachments");p(this,"actions",{addOne:Tu,addMany:oi,setOne:Iu,setMany:Ou,updateOne:Fu,updateMany:gu,deleteOne:_u,deleteMany:hi,initialize:wu});p(this,"selectors",{selectById:bu,selectByIds:Ru})}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 I({...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 GM extends D{constructor(){super(...arguments);p(this,"name","Asset Type Fields Attachment");p(this,"url","/asset-type-fields-attachments");p(this,"actions",{addOne:Vu,addMany:Wu,setOne:Bu,setMany:zu,updateOne:Du,updateMany:qu,deleteOne:ju,deleteMany:$u,initialize:Eu});p(this,"selectors",{selectById:Uu,selectByIds:Lu})}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 I({...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);p(this,"name","Asset Type Fields");p(this,"url","/asset-type-fields");p(this,"actions",{addOne:Ku,addMany:Yu,setOne:Ju,setMany:Zu,updateOne:Qu,updateMany:Xu,deleteOne:xu,deleteMany:eo,initialize:Gu});p(this,"selectors",{selectById:so,selectByIds:io})}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=I({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const m=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 m.then(y=>{this.dispatch(c(y))}).catch(y=>{throw this.dispatch(r(u.uuid)),y}),[u,m]}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);p(this,"name","Asset Type Field Values Attachment");p(this,"url","/asset-type-field-values-attachments");p(this,"actions",{addOne:ro,addMany:Ai,setOne:lo,setMany:uo,updateOne:oo,updateMany:ho,deleteOne:po,deleteMany:wi,initialize:co});p(this,"selectors",{selectById:fo,selectByIds:yo})}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 I({...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);p(this,"name","Asset Type Field Values");p(this,"url","/asset-type-field-values");p(this,"actions",{addOne:Io,addMany:Oo,setOne:Fo,setMany:go,updateOne:_o,updateMany:Po,deleteOne:bo,deleteMany:Ro,initialize:To});p(this,"selectors",{selectById:ko,selectByIds:vo})}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(),m=I({...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(m),blockers:[e.asset,e.fields_revision],blocks:[m.uuid]});return this.dispatch(a(m)),f.then(O=>{this.dispatch(c(O))}).catch(()=>{this.dispatch(r(m.uuid))}),[m,f]}bulkAdd(e,n){var P;const{payloads:a,values:c}=e,{addMany:r,setMany:d,deleteMany:l}=this.actions,u=new Date().toISOString(),m=[],f=yt(a,Math.min(n??a.length,pt)),y=[];for(const v of f){const _=[];for(const k of v){const R=I({...k,values:k.values,created_by:((P=this.client.store.getState().userReducer.currentUser)==null?void 0:P.id)??null,submitted_at:u});m.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(m));const O=[];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});O.push(j)}return Promise.all(O).then(v=>{this.dispatch(d(v.flat()))}).catch(()=>{this.dispatch(l(E(m)))}),[m,O]}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(m=>{this.dispatch(a(m))}).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=So(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(m){throw this.dispatch(c(l)),this.dispatch(Ai(u)),m}}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);p(this,"name","Asset Type Identifier");p(this,"url","/asset-type-identifiers");p(this,"actions",{addOne:Bo,addMany:zo,setOne:Do,setMany:qo,updateOne:jo,updateMany:$o,deleteOne:Co,deleteMany:Uo,initialize:Wo});p(this,"selectors",{selectById:No,selectByIds:Ho})}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=I({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const m=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 m.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,m]}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);p(this,"name","Asset Type Identifier Value");p(this,"url","/asset-type-identifier-values");p(this,"actions",{addOne:Jo,addMany:Zo,setOne:Qo,setMany:Xo,updateOne:xo,updateMany:eh,deleteOne:th,deleteMany:sh,initialize:Yo});p(this,"selectors",{selectById:nh,selectByIds:ah})}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=I({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const m=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 m.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,m]}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,m=yt(e,Math.min(n??e.length,pt)),f=[],y=[];for(const _ of m){const k=[],R=[],z=[];for(const B of _){const q=I({...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 O=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(O).then(_=>{this.dispatch(r(_.flat()))}).catch(_=>{throw this.dispatch(d(E(y))),_});const P=Promise.all(O).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);p(this,"name","Asset Type");p(this,"url","/asset-types");p(this,"actions",{addOne:oh,addMany:hh,setOne:lh,setMany:uh,updateOne:ph,updateMany:mh,deleteOne:fh,deleteMany:yh,initialize:dh});p(this,"selectors",{selectById:Ah,selectByIds:wh})}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=I({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const m=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:b(u),blockers:[],blocks:[u.uuid]});return m.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,m]}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=$l(e)(d),m=Mu(e)(d);this.dispatch(a(e)),this.dispatch(ai(E(u))),this.dispatch(hi(E(m)));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(m)),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);p(this,"name","Asset Type Status");p(this,"url","/asset-type-statuses");p(this,"actions",{addOne:Fh,addMany:gh,setOne:_h,setMany:Ph,updateOne:bh,updateMany:Rh,deleteOne:Mh,deleteMany:kh,initialize:Oh});p(this,"selectors",{selectById:Eh,selectByIds:Vh})}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=I({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const m=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 m.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,m]}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);p(this,"name","Document Attachment");p(this,"url","/document-attachments");p(this,"actions",{addOne:$h,addMany:Ch,setOne:Uh,setMany:Lh,updateOne:Nh,updateMany:Hh,deleteOne:Gh,deleteMany:Kh,initialize:jh});p(this,"selectors",{selectById:Jh,selectByIds:Zh})}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 I({...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(m=>d[m]??[]);for(const m of u)this.makeReadable(m)}),[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);p(this,"name","Document");p(this,"url","/documents");p(this,"actions",{addOne:ep,addMany:tp,setOne:sp,setMany:ip,updateOne:np,updateMany:ap,deleteOne:cp,deleteMany:rp,initialize:xh});p(this,"selectors",{selectById:lp,selectByIds:up})}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=I({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const m=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 m.then(y=>{this.dispatch(r(y))}).catch(()=>{this.dispatch(c(u.uuid))}),[u,m]}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(),m=l(e)(u);if(!m)throw new Error(`attempting to delete a document with uuid ${e} that does not exist in store.documents`);const f=op(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(m)),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);p(this,"name","Email Domains");p(this,"url","/organization-email-domains");p(this,"actions",{addOne:mp,addMany:fp,setOne:yp,setMany:Sp,updateOne:Ap,updateMany:wp,deleteOne:Tp,deleteMany:Ip,initialize:pp});p(this,"selectors",{selectById:Fp,selectByIds:gp})}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={},za=new Set;class nk extends Tt{constructor(){super(...arguments);p(this,"host");p(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(za.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),za.add(n)}async removeCache(e){await(await this.getDB()).delete("files",e),za.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]:tc(e)?(d=ec(e,a),Nt[c]=d):(d=new Promise(m=>{this.performRequest({method:h.GET,url:e,isExternalUrl:!0,isResponseBlob:!0,isAuthNeeded:!1}).then(f=>{const y=new File([f],a,{type:f.type});m(y)})}),Nt[c]=d);let l;try{l=await d}catch(m){throw m instanceof C&&delete Nt[c],m}const u=await Kt(l);if(u!==n){const m=`The hash of the file returned from the server (${u}) does not match the
|
|
8
8
|
expected hash (${n}). This can happen if you're using a local development server and the
|
|
9
9
|
isExternalUrl flag in the request details is set to true, because instead of requesting the local
|
|
10
10
|
REST API, you will be requesting localhost:80 (where this app runs), resulting in a transformed blob
|
|
11
11
|
(with an uuid attached) being returned. Alternatively, you may be running with
|
|
12
12
|
import.meta.env.PROD, which will result in some file requests being treated as
|
|
13
|
-
external URLs and therefore not prepended with VITE_API_URL.`;throw new Error(h)}return await this.addCache(r),r}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:m.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 Tt(e),file_type:e.type,extension:Yn(e),size:e.size};return await this.client.files.addCache(e),a}}class yg extends v{constructor(){super(...arguments);y(this,"name","Form Identifier");y(this,"url","/form-identifiers");y(this,"actions",{addOne:Mh,addMany:Rh,setOne:wh,setMany:Eh,updateOne:Bh,updateMany:vh,deleteOne:Vh,deleteMany:zh,initialize:bh});y(this,"selectors",{selectById:Dh,selectByIds:qh})}add(e){var p;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,l=((p=n.getState().userReducer.currentUser)==null?void 0:p.id)??null,r=new Date().toISOString(),u=F({...e,created_by:l,submitted_at:r});this.dispatch(a(u));const h=this.enqueueRequest({description:T(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(u),blockers:[u.form],blocks:[u.uuid]});return h.then(A=>{this.dispatch(c(A))}).catch(()=>{this.dispatch(d(u.uuid))}),[u,h]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=c(e.uuid)(n.getState());if(!d)throw new Error(`Expected form identifier with uuid ${e.uuid} to exist`);const l={...d,...e};this.dispatch(a(l));const r=this.enqueueRequest({description:T(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return r.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(d))}),[l,r]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,l=n.getState(),r=d(e)(l);if(!r)throw new Error(`Expected form identifier with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(r)),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 pg extends v{constructor(){super(...arguments);y(this,"name","Form Identifier Value");y(this,"url","/form-identifier-values");y(this,"actions",{addOne:Lh,addMany:kh,setOne:Nh,setMany:Gh,updateOne:Hh,updateMany:Wh,deleteOne:Kh,deleteMany:Yh,initialize:Uh});y(this,"selectors",{selectById:Jh,selectByIds:Xh})}add(e){var p;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,l=((p=n.getState().userReducer.currentUser)==null?void 0:p.id)??null,r=new Date().toISOString(),u=F({...e,created_by:l,submitted_at:r});this.dispatch(a(u));const h=this.enqueueRequest({description:T(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(u),blockers:[e.form_submission,e.form_identifier],blocks:[u.uuid]});return h.then(A=>{this.dispatch(c(A))}).catch(()=>{this.dispatch(d(u.uuid))}),[u,h]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,l=n.getState(),r=d(e)(l);if(!r)throw new Error(`Expected form identifier value with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(r)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{form_submission__form_revision__form__organization:e,latest:!0}},n)).flat();return this.dispatch(a(d)),d}}class Ag extends q{constructor(){super(...arguments);y(this,"name","Form Revision Attachment");y(this,"url","/form-revision-attachments");y(this,"actions",{addOne:tm,addMany:sm,setOne:im,setMany:nm,updateOne:am,updateMany:cm,deleteOne:dm,deleteMany:rm,initialize:em});y(this,"selectors",{selectById:lm,selectByIds:om})}getId(e){return e.uuid}getBlockers(e){return[e.form_revision]}getBlocks(e){return[e.uuid]}buildModel(e){var d;const{store:n}=this.client,a=((d=n.getState().userReducer.currentUser)==null?void 0:d.id)??null,c=new Date().toISOString();return F({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,form_revision:c,file_sha1:d,file_name:l,file_extension:r}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,form_revision:c,file_sha1:d,file_name:l,file_extension:r}}buildBulkPayload(e){const{uuid:n,field_identifier:a,form_revision:c,file_sha1:d,file_name:l,file_extension:r}=e;return{uuid:n,field_identifier:a,form_revision:c,file_sha1:d,file_name:l,file_extension:r}}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 fg extends v{constructor(){super(...arguments);y(this,"name","Form Revision");y(this,"url","/form-revisions");y(this,"actions",{addOne:oi,addMany:hi,setOne:pm,setMany:Am,updateOne:fm,updateMany:Sm,deleteOne:mi,deleteMany:yi,initialize:ym});y(this,"selectors",{selectById:Tm,selectByIds:Im})}add(e){var A;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,r=((A=n.getState().userReducer.currentUser)==null?void 0:A.id)??null,u=new Date().toISOString(),h=F({...e,created_by:r,submitted_at:u});this.dispatch(a(h));const p=this.enqueueRequest({description:T(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(h),blockers:[e.form],blocks:[h.uuid]});return p.then(I=>{this.dispatch(c(I))}).catch(()=>{this.dispatch(d(h.uuid))}),[h,p]}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 Sg extends v{constructor(){super(...arguments);y(this,"name","Form");y(this,"url","/forms");y(this,"actions",{addOne:_m,addMany:bm,setOne:Mm,setMany:Rm,updateOne:wm,updateMany:Em,deleteOne:Bm,deleteMany:vm,initialize:gm});y(this,"selectors",{selectById:jm,selectByIds:Dm})}add(e,n){var A;const{store:a}=this.client,{addOne:c,deleteOne:d}=this.actions,l=new Date().toISOString(),r=((A=a.getState().userReducer.currentUser)==null?void 0:A.id)??null,u=F({...e,submitted_at:l,created_by:r}),h=F({...n,form:u.uuid,submitted_at:l,created_by:r});this.dispatch(c(u)),this.dispatch(oi(h));const p=this.enqueueRequest({description:T(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:{...E(u),initial_revision:{uuid:h.uuid,submitted_at:h.submitted_at,title:h.title,description:h.description,fields:h.fields}},blockers:[],blocks:[u.uuid,h.uuid]});return p.catch(I=>{throw this.dispatch(d(u.uuid)),this.dispatch(mi(h.uuid)),I}),[u,h,p]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,l=n.getState(),r=d(e)(l);if(!r)throw new Error("Expected form to exist");const u=cy(e)(l),h=Om(e)(l);this.dispatch(a(e)),this.dispatch(bi(V(u))),this.dispatch(yi(V(h)));try{return await this.enqueueRequest({description:T(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(p){throw this.dispatch(c(r)),this.dispatch(hi(h)),this.dispatch(_i(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 Tg extends q{constructor(){super(...arguments);y(this,"name","Form Submission Attachment");y(this,"url","/form-submission-attachments");y(this,"actions",{addOne:Cm,addMany:Ti,setOne:Um,setMany:Lm,updateOne:km,updateMany:Nm,deleteOne:Gm,deleteMany:Ii,initialize:$m});y(this,"selectors",{selectById:Hm,selectByIds:Wm})}getId(e){return e.uuid}getBlockers(e){return[e.form_submission]}getBlocks(e){return[e.uuid]}buildModel(e){var d;const{store:n}=this.client,a=((d=n.getState().userReducer.currentUser)==null?void 0:d.id)??null,c=new Date().toISOString();return F({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,form_submission:c,file_sha1:d,file_name:l,file_extension:r}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,form_submission:c,file_sha1:d,file_name:l,file_extension:r}}buildBulkPayload(e){const{uuid:n,field_identifier:a,form_submission:c,file_sha1:d,file_name:l,file_extension:r}=e;return{uuid:n,field_identifier:a,form_submission:c,file_sha1:d,file_name:l,file_extension:r}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,d=n.getState(),l=Fi(e)(d);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(m.DELETE,this.name,!0),method:m.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(r){throw this.dispatch(c(l)),r}}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{form_submission__form_revision__form__organization:e}},n)).flat();return this.dispatch(a(d)),d}}class Ig extends v{constructor(){super(...arguments);y(this,"name","Form Submission");y(this,"url","/form-submissions");y(this,"actions",{addOne:xm,addMany:_i,setOne:Xm,setMany:Qm,updateOne:ey,updateMany:ty,deleteOne:sy,deleteMany:bi,initialize:Jm});y(this,"selectors",{selectById:ny,selectByIds:ay})}add(e){var A;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,r=((A=n.getState().userReducer.currentUser)==null?void 0:A.id)??null,u=new Date().toISOString(),h=F({...e,created_by:r,submitted_at:u}),p=this.enqueueRequest({description:T(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(h),blockers:[e.form_revision],blocks:[h.uuid]});return this.dispatch(a(h)),p.then(I=>{this.dispatch(c(I))}).catch(()=>{this.dispatch(d(h.uuid))}),[h,p]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=n.getState(),l=c(e.uuid)(d);if(!l)throw new Error(`Expected submission with uuid ${e.uuid} to exist`);const r={...l,...e};this.dispatch(a(r));const u=this.enqueueRequest({description:T(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${r.uuid}/`,payload:e,blockers:[r.uuid],blocks:[r.uuid]});return u.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(a(l))}),[r,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,l=n.getState(),r=d(e)(l);if(!r)throw new Error(`Expected submission with uuid ${e} to exist`);const u=Km(e)(l);this.dispatch(a(e)),this.dispatch(Ii(V(u)));try{return await this.enqueueRequest({description:T(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(h){throw this.dispatch(c(r)),this.dispatch(Ti(u)),h}}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{limit:this.pageSize,paginate:!0,form_revision__form_organization:e}},n)).flat();return this.dispatch(a(d)),d}}class Og extends q{constructor(){super(...arguments);y(this,"name","Geo Image");y(this,"url","/geo-images");y(this,"actions",{addOne:hy,addMany:my,setOne:ly,setMany:oy,updateOne:yy,updateMany:py,deleteOne:Ay,deleteMany:fy,initialize:uy});y(this,"selectors",{selectById:Ty,selectByIds:Iy})}getId(e){return e.uuid}getBlockers(e){return[e.project]}getBlocks(e){return[e.uuid]}buildModel(e){var d;const{store:n}=this.client,a=((d=n.getState().userReducer.currentUser)==null?void 0:d.id)??null,c=new Date().toISOString();return F({...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,d=n.getState(),l=c(e.uuid)(d);if(!l)throw new Error(`Geo image with uuid ${e.uuid} does not exist in the store`);const r={...l,...e};this.dispatch(a(r));const u=this.enqueueRequest({description:T(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blocks:[e.uuid],blockers:[e.uuid]});return u.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(a(l))}),[r,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 Pg extends v{constructor(){super(...arguments);y(this,"name","Issue Association");y(this,"url","/issue-associations");y(this,"actions",{addOne:Ry,addMany:et,setOne:_y,setMany:gy,updateOne:by,updateMany:My,deleteOne:wy,deleteMany:tt,initialize:Fy});y(this,"selectors",{selectById:By,selectByIds:vy})}add(e){var p;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,l=new Date().toISOString(),r=((p=n.getState().userReducer.currentUser)==null?void 0:p.id)??null,u=F({...e,submitted_at:l,created_by:r});this.dispatch(a(u));const h=this.enqueueRequest({description:T(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(u),blockers:[e.associated_issue,...e.issue?[e.issue]:[],...e.asset?[e.asset]:[]],blocks:[u.uuid]});return h.then(A=>{this.dispatch(c(A))}).catch(()=>{this.dispatch(d(u.uuid))}),[u,h]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,l=d(e)(n.getState());if(!l)throw new Error(`Issue association with uuid ${e} not found in store.`);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(r){throw this.dispatch(c(l)),r}}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{associated_issue__project:e}},n)).flat();return this.dispatch(a(d)),d}}class Fg extends q{constructor(){super(...arguments);y(this,"name","Issue Attachment");y(this,"url","/issue-attachments");y(this,"actions",{addOne:Ly,addMany:vi,setOne:ky,setMany:Ny,updateOne:Gy,updateMany:Hy,deleteOne:Wy,deleteMany:Vi,initialize:Uy});y(this,"selectors",{selectById:Zy,selectByIds:Jy})}getId(e){return e.uuid}getBlockers(e){return[e.issue]}getBlocks(e){return[e.uuid]}buildModel(e){var d;const{store:n}=this.client,a=((d=n.getState().userReducer.currentUser)==null?void 0:d.id)??null,c=new Date().toISOString();return F({...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,d=(await this.listPaginated({queryParams:{issue__project:e}},n)).flat();return this.dispatch(a(d)),d}}class gg extends q{constructor(){super(...arguments);y(this,"name","Issue Comment Attachment");y(this,"url","/issue-comment-attachments");y(this,"actions",{addOne:ep,addMany:tp,setOne:sp,setMany:ip,updateOne:np,updateMany:ap,deleteOne:cp,deleteMany:dp,initialize:xy});y(this,"selectors",{selectById:up,selectByIds:lp})}getId(e){return e.uuid}getBlockers(e){return[e.issue_comment]}getBlocks(e){return[e.uuid]}buildModel(e){var d;const{store:n}=this.client,a=((d=n.getState().userReducer.currentUser)==null?void 0:d.id)??null,c=new Date().toISOString();return F({...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,d=(await this.listPaginated({queryParams:{issue_comment__issue__project:e}},n)).flat();return this.dispatch(a(d)),d}}class _g extends v{constructor(){super(...arguments);y(this,"name","Issue Comment");y(this,"url","/issue-comments");y(this,"actions",{addOne:yp,addMany:pp,setOne:Ap,setMany:fp,updateOne:Sp,updateMany:Tp,deleteOne:Ip,deleteMany:Op,initialize:mp});y(this,"selectors",{selectById:Pp,selectByIds:Fp})}add(e){const{store:n}=this.client,{addOne:a,updateOne:c,deleteOne:d}=this.actions,l=F({...e,author:n.getState().userReducer.currentUser.id,submitted_at:new Date().toISOString()});this.dispatch(a(l));const r=this.enqueueRequest({description:T(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(l),blockers:[e.issue],blocks:[l.uuid]});return r.then(u=>{this.dispatch(c(u))}).catch(()=>{this.dispatch(d(l.uuid))}),[l,r]}update(e){const{store:n}=this.client,{updateOne:a}=this.actions,{selectById:c}=this.selectors,d=c(e.uuid)(n.getState());if(!d)throw new Error(`Comment with uuid ${e.uuid} not found in store`);const l={...d,...e};this.dispatch(a(l));const r=this.enqueueRequest({description:T(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return r.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(d))}),[l,r]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,l=d(e)(n.getState());if(!l)throw new Error(`Comment with uuid ${e} not found in store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(r){throw this.dispatch(c(l)),r}}async refreshStore(e,n){const{setMany:a}=this.actions,d=(await this.listPaginated({queryParams:{issue__project:e}},n)).flat();return this.dispatch(a(d)),d}}class bg extends v{constructor(){super(...arguments);y(this,"name","Issue");y(this,"url","/issues");y(this,"actions",{addOne:Mp,addMany:Ui,setOne:Rp,setMany:wp,updateOne:Ep,updateMany:Bp,deleteOne:vp,deleteMany:Li,initialize:bp});y(this,"selectors",{selectById:zp,selectByIds:jp})}add(e){var A;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,l=n.getState(),r=new Date().toISOString(),u=((A=l.userReducer.currentUser)==null?void 0:A.id)??null,h=F({...e,submitted_at:r,created_by:u});this.dispatch(a(h));const p=this.enqueueRequest({description:T(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(h),blockers:[h.project,h.issue_type,h.status],blocks:[h.uuid]});return p.then(I=>{this.dispatch(c(I))}).catch(I=>{throw this.dispatch(d(h.uuid)),I}),[h,p]}update(e){var p;const{updateOne:n}=this.actions,{selectById:a}=this.selectors,c=this.client.store.getState(),d=a(e.uuid)(c);if(!d)throw new Error(`Attempting to update an issue with uuid ${e.uuid} that doesn't exist in the store`);const l={...d,...e};this.dispatch(n(l));const r={};for(const A of[U.TITLE,U.DESCRIPTION,U.STATUS,U.PRIORITY,U.ASSIGNED_TO,U.DUE_DATE])if(A in e&&e[A]!==d[A])switch(A){case U.PRIORITY:r[A]=e[A];break;case U.DUE_DATE:r[A]=e[A];break;case U.DESCRIPTION:r[A]=e[A];break;case U.TITLE:r[A]=e[A];break;case U.STATUS:{const I=e[A],g=cn(I)(c);if(!g)throw new Error(`Trying to update issue type status with ${I} which does not exist in store`);r[A]={name:g.name,color:g.color,uuid:g.uuid};break}case U.ASSIGNED_TO:{const I=e[A];if(I===null)r[A]=null;else{const g=$t(I)(c);if(!g)throw new Error(`Trying to update assigned to with ${I} which does not exist in store.`);r[A]={full_name:g.username,id:g.id}}break}}const u=F({created_by:((p=c.userReducer.currentUser)==null?void 0:p.id)??null,submitted_at:new Date().toISOString(),issue:d.uuid,changes:r});this.dispatch(rn(u));const h=this.enqueueRequest({description:T(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return h.then(A=>{this.dispatch(n(A))}).catch(()=>{this.dispatch(n(d)),this.dispatch(ln(u.uuid))}),[l,h]}bulkUpdate(e,n){const{store:a}=this.client,{updateMany:c}=this.actions,{selectByIds:d}=this.selectors,l=V(e).toSorted(It);if(l.length!==e.length)throw new Error("payloads contains duplicate uuids.");const r=d(l)(a.getState()).toSorted(Yt);if(l.length!=r.length)throw new Error(`Attempting to bulk update ${l.length-r.length} issues that dont exist in the store`);const u=[];for(let I=0;I<l.length;I++)u.push({...r[I],...e[I]});this.dispatch(c(u));const h=xe(e,Math.min(n??e.length,Xe)),p=[];let A=null;for(const I of h){const g=Qe.v4(),w=V(I),P=I.map(({status:M})=>M).filter(Boolean),R=this.enqueueRequest({description:T(m.PATCH,this.name,!0),method:m.PATCH,url:`${this.url}/bulk/`,payload:{payloads:I},blockers:(A?[A]:[]).concat(w).concat(P),blocks:[g].concat(w)});p.push(R),A=g}return Promise.all(p).then(I=>{this.dispatch(c(I.flat()))}).catch(()=>{this.dispatch(c(r))}),[u,p]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,l=n.getState(),r=d(e)(l);if(!r)throw new Error(`No issue with uuid ${e} found in the store`);const u=Vy(e)(l),h=Dy(e)(l),p=Yy(e)(l),A=uS(e)(l);this.dispatch(a(e)),this.dispatch(Vi(V(p))),this.dispatch(on(V(A))),this.dispatch(tt(V(u))),this.dispatch(tt(V(h)));try{return await this.enqueueRequest({description:T(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(I){throw this.dispatch(c(r)),this.dispatch(vi(p)),this.dispatch(un(A)),this.dispatch(et(u)),this.dispatch(et(h)),I}}async bulkDelete(e){const{store:n}=this.client,{addMany:a,deleteMany:c}=this.actions,{selectByIds:d}=this.selectors,l=n.getState(),r=d(e)(l),u=zy(e)(l),h=jy(e)(l);this.dispatch(c(e)),this.dispatch(tt(V(u))),this.dispatch(tt(V(h)));try{return await this.enqueueRequest({description:T(m.DELETE,this.name,!0),method:m.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(p){throw this.dispatch(a(r)),this.dispatch(et(u)),this.dispatch(et(h)),p}}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{project:e}},n)).flat();return this.dispatch(a(d)),d}}class Mg extends q{constructor(){super(...arguments);y(this,"name","Issue Type Attachment");y(this,"url","/issue-type-attachments");y(this,"actions",{addOne:Up,addMany:Lp,setOne:kp,setMany:Np,updateOne:Gp,updateMany:Hp,deleteOne:Wp,deleteMany:Kp,initialize:Cp});y(this,"selectors",{selectById:Zp,selectByIds:Jp})}getId(e){return e.uuid}getBlockers(e){return[e.issue_type]}getBlocks(e){return[e.uuid]}buildModel(e){var d;const{store:n}=this.client,a=((d=n.getState().userReducer.currentUser)==null?void 0:d.id)??null,c=new Date().toISOString();return F({...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 Rg extends q{constructor(){super(...arguments);y(this,"name","Issue Type Fields Attachment");y(this,"url","/issue-type-fields-attachments");y(this,"actions",{addOne:eA,addMany:tA,setOne:sA,setMany:iA,updateOne:nA,updateMany:aA,deleteOne:cA,deleteMany:dA,initialize:xp});y(this,"selectors",{selectById:uA,selectByIds:lA})}getId(e){return e.uuid}getBlockers(e){return[e.fields_revision]}getBlocks(e){return[e.uuid]}buildModel(e){var d;const{store:n}=this.client,a=((d=n.getState().userReducer.currentUser)==null?void 0:d.id)??null,c=new Date().toISOString();return F({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:d,file_name:l,file_extension:r}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,fields_revision:c,file_sha1:d,file_name:l,file_extension:r}}buildBulkPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:d,file_name:l,file_extension:r}=e;return{uuid:n,field_identifier:a,fields_revision:c,file_sha1:d,file_name:l,file_extension:r}}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 wg extends v{constructor(){super(...arguments);y(this,"name","Issue Type Fields");y(this,"url","/issue-type-fields");y(this,"actions",{addOne:RA,addMany:wA,setOne:EA,setMany:BA,updateOne:vA,updateMany:VA,deleteOne:zA,deleteMany:jA,initialize:MA});y(this,"selectors",{selectById:qA,selectByIds:$A})}add(e){var p;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,l=((p=n.getState().userReducer.currentUser)==null?void 0:p.id)??null,r=new Date().toISOString(),u=F({...e,created_by:l,submitted_at:r});this.dispatch(a(u));const h=this.enqueueRequest({description:T(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(u),blockers:[u.issue_type],blocks:[u.uuid]});return h.then(A=>{this.dispatch(c(A))}).catch(A=>{throw this.dispatch(d(u.uuid)),A}),[u,h]}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 Eg extends q{constructor(){super(...arguments);y(this,"name","Issue Type Field Values Attachment");y(this,"url","/issue-type-field-values-attachments");y(this,"actions",{addOne:kA,addMany:Zi,setOne:NA,setMany:GA,updateOne:HA,updateMany:WA,deleteOne:KA,deleteMany:Ji,initialize:LA});y(this,"selectors",{selectById:ZA,selectByIds:JA})}getId(e){return e.uuid}getBlockers(e){return[e.field_values]}getBlocks(e){return[e.uuid]}buildModel(e){var d;const{store:n}=this.client,a=((d=n.getState().userReducer.currentUser)==null?void 0:d.id)??null,c=new Date().toISOString();return F({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:d,file_name:l,file_extension:r}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,field_values:c,file_sha1:d,file_name:l,file_extension:r}}buildBulkPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:d,file_name:l,file_extension:r}=e;return{uuid:n,field_identifier:a,field_values:c,file_sha1:d,file_name:l,file_extension:r}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:d}=this.selectors,l=n.getState(),r=d(e)(l);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(m.DELETE,this.name,!0),method:m.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(u){throw this.dispatch(c(r)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{field_values__issue__project:e,latest:!0}},n)).flat();return this.dispatch(a(d)),d}}class Bg extends v{constructor(){super(...arguments);y(this,"name","Issue Type Field Values");y(this,"url","/issue-type-field-values");y(this,"actions",{addOne:yA,addMany:pA,setOne:AA,setMany:fA,updateOne:SA,updateMany:TA,deleteOne:IA,deleteMany:OA,initialize:mA});y(this,"selectors",{selectById:FA,selectByIds:gA})}add(e){var A;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,r=((A=n.getState().userReducer.currentUser)==null?void 0:A.id)??null,u=new Date().toISOString(),h=F({...e,created_by:r,submitted_at:u}),p=this.enqueueRequest({description:T(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(h),blockers:[e.issue,e.fields_revision],blocks:[h.uuid]});return this.dispatch(a(h)),p.then(I=>{this.dispatch(c(I))}).catch(()=>{this.dispatch(d(h.uuid))}),[h,p]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=n.getState(),l=c(e.uuid)(d);if(!l)throw new Error(`Expected IssueTypeFieldValues with uuid ${e.uuid} to exist`);const r={...l,...e};this.dispatch(a(r));const u=this.enqueueRequest({description:T(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[r.uuid,r.fields_revision,r.issue],blocks:[r.uuid]});return u.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(a(l))}),[r,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,l=n.getState(),r=d(e)(l);if(!r)throw new Error(`Expected submission with uuid ${e} to exist`);const u=XA(e)(l);this.dispatch(a(e)),this.dispatch(Ji(V(u)));try{return await this.enqueueRequest({description:T(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(h){throw this.dispatch(c(r)),this.dispatch(Zi(u)),h}}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{issue__project:e,latest:!0}},n)).flat();return this.dispatch(a(d)),d}}class vg extends v{constructor(){super(...arguments);y(this,"name","Issue Type Identifier");y(this,"url","/issue-type-identifiers");y(this,"actions",{addOne:tf,addMany:sf,setOne:nf,setMany:af,updateOne:cf,updateMany:df,deleteOne:rf,deleteMany:uf,initialize:ef});y(this,"selectors",{selectById:of,selectByIds:hf})}add(e){var p;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,l=((p=n.getState().userReducer.currentUser)==null?void 0:p.id)??null,r=new Date().toISOString(),u=F({...e,created_by:l,submitted_at:r});this.dispatch(a(u));const h=this.enqueueRequest({description:T(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(u),blockers:[u.issue_type],blocks:[u.uuid]});return h.then(A=>{this.dispatch(c(A))}).catch(()=>{this.dispatch(d(u.uuid))}),[u,h]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=c(e.uuid)(n.getState());if(!d)throw new Error(`Expected issue type identifier with uuid ${e.uuid} to exist`);const l={...d,...e};this.dispatch(a(l));const r=this.enqueueRequest({description:T(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return r.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(d))}),[l,r]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,l=n.getState(),r=d(e)(l);if(!r)throw new Error(`Expected issue type identifier with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(r)),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 Vg extends v{constructor(){super(...arguments);y(this,"name","Issue Type Identifier Value");y(this,"url","/issue-type-identifier-values");y(this,"actions",{addOne:Af,addMany:ff,setOne:Sf,setMany:Tf,updateOne:If,updateMany:Of,deleteOne:Pf,deleteMany:Ff,initialize:pf});y(this,"selectors",{selectById:_f,selectByIds:bf})}add(e){var p;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,l=((p=n.getState().userReducer.currentUser)==null?void 0:p.id)??null,r=new Date().toISOString(),u=F({...e,created_by:l,submitted_at:r});this.dispatch(a(u));const h=this.enqueueRequest({description:T(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(u),blockers:[e.issue,e.issue_type_identifier],blocks:[u.uuid]});return h.then(A=>{this.dispatch(c(A))}).catch(()=>{this.dispatch(d(u.uuid))}),[u,h]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,l=n.getState(),r=d(e)(l);if(!r)throw new Error(`Expected issue type identifier value with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(r)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{issue__project:e,latest:!0}},n)).flat();return this.dispatch(a(d)),d}}class zg extends v{constructor(){super(...arguments);y(this,"name","Issue Type");y(this,"url","/issue-types");y(this,"actions",{addOne:Ef,addMany:Bf,setOne:vf,setMany:Vf,updateOne:zf,updateMany:jf,deleteOne:Df,deleteMany:qf,initialize:wf});y(this,"selectors",{selectById:Cf,selectByIds:Uf})}add(e){var A;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,r=((A=n.getState().userReducer.currentUser)==null?void 0:A.id)??null,u=new Date().toISOString(),h=F({...e,submitted_at:u,created_by:r});this.dispatch(a(h));const p=this.enqueueRequest({method:m.POST,url:`${this.url}/`,payload:E(h),blockers:[],blocks:[h.uuid]});return p.then(I=>{this.dispatch(c(I))}).catch(()=>{this.dispatch(d(h.uuid))}),[h,p]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=n.getState(),l=c(e.uuid)(d);if(!l)throw new Error(`IssueType with uuid ${e.uuid} does not exist in the store.`);const r={...l,...e};this.dispatch(a(r));const u=this.enqueueRequest({method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(a(l))}),[r,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,setOne:c}=this.actions,{selectById:d}=this.selectors,l=n.getState(),r=d(e)(l);if(!r)throw new Error(`IssueType with uuid ${e} does not exist in the store.`);const u=Dp(e)(l);this.dispatch(a(e)),this.dispatch(Li(V(u)));try{return await this.enqueueRequest({description:T(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(h){throw this.dispatch(c(r)),this.dispatch(Ui(u)),h}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class jg extends v{constructor(){super(...arguments);y(this,"name","Issue Type Status");y(this,"url","/issue-type-statuses");y(this,"actions",{addOne:Gf,addMany:Hf,setOne:Wf,setMany:Kf,updateOne:Yf,updateMany:Zf,deleteOne:Jf,deleteMany:Xf,initialize:Nf});y(this,"selectors",{selectById:cn,selectByIds:xf})}add(e){var p;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,l=((p=n.getState().userReducer.currentUser)==null?void 0:p.id)??null,r=new Date().toISOString(),u=F({...e,created_by:l,submitted_at:r});this.dispatch(a(u));const h=this.enqueueRequest({description:T(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(u),blockers:[e.issue_type],blocks:[u.uuid]});return h.then(A=>{this.dispatch(c(A))}).catch(()=>{this.dispatch(d(u.uuid))}),[u,h]}update(e){const{setOne:n}=this.actions,{selectById:a}=this.selectors,c=this.client.store.getState(),d=a(e.uuid)(c);if(!d)throw new Error(`Expected an existing issue type status with uuid ${e.uuid}`);const l={...d,...e};this.dispatch(n(l));const r=this.enqueueRequest({description:T(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return r.then(u=>{this.dispatch(n(u))}).catch(()=>{this.dispatch(n(d))}),[l,r]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,l=d(e)(n.getState());if(!l)throw new Error(`No issue type status with uuid ${e} found in the store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(r){throw this.dispatch(c(l)),r}}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 Dg extends v{constructor(){super(...arguments);y(this,"name","Issue Update");y(this,"url","/issue-updates");y(this,"actions",{addOne:rn,addMany:un,setOne:iS,setMany:nS,updateOne:aS,updateMany:cS,deleteOne:ln,deleteMany:on,initialize:sS});y(this,"selectors",{selectById:dS,selectByIds:rS})}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{issue__project:e}},n)).flat();return this.dispatch(a(d)),d}}const qg=1800;function $g(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 Cg extends DF{constructor(){super(...arguments);y(this,"_getRenewedTokens",async e=>{const n=this.performRequest({method:m.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(vo(!1)),this.clearTokens(),this.dispatch(O()),this.dispatch(O())}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=pO(e).exp??n}catch{a=n}return a-n<qg}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 L&&this.clearAuth(),e instanceof Error?Promise.reject(e):Promise.reject(new Error((e??ct).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 L({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 L({message:"Incorrect username or password.",response:n,discard:!0})}async initAuth(e){const n=Qe.v4();return console.debug(this.constructor.name,"Initiating auth"),this.performRequest({uuid:n,method:m.POST,url:this.initTokensUrl,payload:e,isAuthNeeded:!1,checkAuth:!1}).then(a=>{this.setTokens($g(a))})}}class Ug extends dt{constructor(){super(...arguments);y(this,"name","Organization Access");y(this,"url","/organization-accesses");y(this,"actions",{addOne:gS,addMany:_S,setOne:bS,setMany:MS,updateOne:RS,updateMany:wS,deleteOne:ES,deleteMany:BS,initialize:FS});y(this,"selectors",{selectById:VS,selectByIds:zS})}update(e){const{store:n}=this.client,{updateOne:a}=this.actions,{selectById:c}=this.selectors,d=c(e.uuid)(n.getState()),l={...d,...e};this.dispatch(a(l));const r=this.enqueueRequest({description:T(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return r.then(u=>{this.dispatch(a(u))}).catch(u=>{throw this.dispatch(a(d)),u}),[l,r]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,l=n.getState(),r=d(e)(l),u=$t(r.user)(l);this.dispatch(a(r.uuid)),this.dispatch(An(r.user));try{return await this.enqueueRequest({description:T(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${r.uuid}/`,blockers:[r.uuid],blocks:[]})}catch(h){throw this.dispatch(c(r)),this.dispatch(pn(u)),h}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class Lg extends dt{constructor(){super(...arguments);y(this,"name","Organization");y(this,"url","/organizations");y(this,"actions",{addOne:LS,addMany:US,setOne:CS,setMany:$S,updateOne:NS,updateMany:kS,deleteOne:GS,deleteMany:HS,initialize:qS});y(this,"selectors",{selectById:YS,selectByIds:ZS})}async add(e){const{addOne:n}=this.actions,a=await this.enqueueRequest({description:T(m.POST,this.name,!1),method:m.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:T(m.PATCH,this.name,!1),method:m.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:T(m.POST,this.name,!1),method:m.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 kg extends v{constructor(){super(...arguments);y(this,"name","Project Access");y(this,"url","/project-accesses");y(this,"actions",{addOne:aT,addMany:cT,setOne:dT,setMany:rT,updateOne:uT,updateMany:lT,deleteOne:oT,deleteMany:hT,initialize:nT});y(this,"selectors",{selectById:yT,selectByIds:pT})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,l=F({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null});this.dispatch(a(l));const r=this.enqueueRequest({description:T(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(l),blockers:[l.organization_access,l.project],blocks:[l.uuid]});return r.then(h=>{this.dispatch(c(h))}).catch(h=>{throw this.dispatch(d(l.uuid)),h}),[l,r]}bulkAdd(e){var h;const{store:n}=this.client,{addMany:a,deleteMany:c,updateMany:d}=this.actions,l=((h=n.getState().userReducer.currentUser)==null?void 0:h.id)??null,r=e.map(p=>F({...p,created_by:l}));this.dispatch(a(r));const u=this.enqueueRequest({description:T(m.POST,this.name,!0),method:m.POST,url:`${this.url}/bulk/`,payload:{project_accesses:r.map(p=>E(p))},blockers:r.flatMap(p=>[p.project,p.organization_access]),blocks:r.map(p=>p.uuid)});return u.then(p=>{this.dispatch(d(p))}).catch(p=>{throw this.dispatch(c(r.map(A=>A.uuid))),p}),[r,u]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=c(e.uuid)(n.getState()),l={...d,...e};this.dispatch(a(l));const r=this.enqueueRequest({description:T(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[]});return r.then(u=>{this.dispatch(a(u))}).catch(u=>{throw this.dispatch(a(d)),u}),[l,r]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,l=d(e)(n.getState());this.dispatch(a(e));try{return await this.enqueueRequest({description:T(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(r){throw this.dispatch(c(l)),r}}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 Ng extends q{constructor(){super(...arguments);y(this,"name","Project Attachment");y(this,"url","/project-attachments");y(this,"actions",{addOne:ST,addMany:TT,setOne:IT,setMany:OT,updateOne:PT,updateMany:FT,deleteOne:gT,deleteMany:_T,initialize:fT});y(this,"selectors",{selectById:MT,selectByIds:RT})}getId(e){return e.uuid}getBlockers(e){return[e.project]}getBlocks(e){return[e.uuid]}buildModel(e){var d;const{store:n}=this.client,a=((d=n.getState().userReducer.currentUser)==null?void 0:d.id)??null,c=new Date().toISOString();return F({...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 Gg extends q{constructor(){super(...arguments);y(this,"name","Project File");y(this,"url","/project-files");y(this,"actions",{addOne:zT,addMany:jT,setOne:vT,setMany:VT,updateOne:DT,updateMany:qT,deleteOne:$T,deleteMany:CT,initialize:BT});y(this,"selectors",{selectById:kT,selectByIds:NT})}getId(e){return e.uuid}getBlockers(e){return[e.project]}getBlocks(e){return[e.uuid]}buildModel(e){var d;const{store:n}=this.client,a=((d=n.getState().userReducer.currentUser)==null?void 0:d.id)??null,c=new Date().toISOString();return F({...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,d=n.getState(),l=c(e.uuid)(d);if(!l)throw new Error(`${this.name} with uuid ${e.uuid} does not exist in the store`);const r={...l,...e};this.dispatch(a(r));const u=this.enqueueRequest({description:T(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blocks:[e.uuid],blockers:[e.uuid]});return u.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(a(l))}),[r,u]}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{project:e}},n)).flat();return this.dispatch(a(d)),d}}class Hg extends dt{constructor(){super(...arguments);y(this,"name","Project");y(this,"url","/projects");y(this,"actions",{addOne:JT,addMany:ZT,setOne:YT,setMany:KT,updateOne:QT,updateMany:XT,deleteOne:xT,deleteMany:eI,initialize:WT});y(this,"selectors",{selectById:iI,selectByIds:nI})}async add(e){const{addOne:n}=this.actions,a=await this.performRequest({method:m.POST,url:`${this.url}/`,payload:E(e)});return this.dispatch(n(a)),a}async update(e){const{updateOne:n}=this.actions,a=await this.performRequest({method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:E(e)});return this.dispatch(n(a)),a}async delete(e){const{deleteOne:n}=this.actions,a=await this.enqueueRequest({description:T(m.DELETE,this.name,!1),method:m.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 Wg extends v{constructor(){super(...arguments);y(this,"name","Team Membership");y(this,"url","/team-memberships");y(this,"actions",{addOne:rI,addMany:uI,setOne:lI,setMany:oI,updateOne:hI,updateMany:mI,deleteOne:yI,deleteMany:pI,initialize:dI});y(this,"selectors",{selectById:SI,selectByIds:TI})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,l=F({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null});this.dispatch(a(l));const r=this.enqueueRequest({description:T(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(l),blockers:[e.team],blocks:[l.uuid]});return r.then(h=>{this.dispatch(c(h))}).catch(()=>{this.dispatch(d(l.uuid))}),[l,r]}bulkAdd(e){var h;const{store:n}=this.client,{addMany:a,setMany:c,deleteMany:d}=this.actions,l=((h=n.getState().userReducer.currentUser)==null?void 0:h.id)??null,r=e.map(p=>F({...p,created_by:l}));this.dispatch(a(r));const u=this.enqueueRequest({description:T(m.POST,this.name,!0),method:m.POST,url:`${this.url}/bulk/`,payload:{team_memberships:r.map(p=>E(p))},blockers:r.map(p=>p.team),blocks:r.map(p=>p.uuid)});return u.then(p=>{this.dispatch(c(p))}).catch(()=>{this.dispatch(d(r.map(p=>p.uuid)))}),[r,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,setOne:c}=this.actions,{selectById:d}=this.selectors,l=n.getState(),r=d(e)(l);if(!r)throw new Error(`Expected team membership with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(u){throw this.dispatch(c(r)),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 Kg extends v{constructor(){super(...arguments);y(this,"name","Team");y(this,"url","/teams");y(this,"actions",{addOne:PI,addMany:FI,setOne:gI,setMany:_I,updateOne:bI,updateMany:MI,deleteOne:RI,deleteMany:wI,initialize:OI});y(this,"selectors",{selectById:BI,selectByIds:vI})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,l=F({...e,submitted_at:new Date().toISOString(),created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null});this.dispatch(a(l));const r=this.enqueueRequest({description:T(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(l),blockers:[],blocks:[l.uuid]});return r.then(h=>{this.dispatch(c(h))}).catch(()=>{this.dispatch(d(l.uuid))}),[l,r]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=c(e.uuid)(n.getState());if(!d)throw new Error(`Expected team with uuid ${e.uuid} to exist`);const l={...d,...e};this.dispatch(a(l));const r=this.enqueueRequest({description:T(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:E(e),blockers:[e.uuid],blocks:[e.uuid]});return r.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(d))}),[l,r]}async delete(e){const{store:n}=this.client,{deleteOne:a,setOne:c}=this.actions,{selectById:d}=this.selectors,l=n.getState(),r=d(e)(l);if(!r)throw new Error(`Expected team with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(u){throw this.dispatch(c(r)),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 Yg extends dt{constructor(){super(...arguments);y(this,"name","User");y(this,"url","/user");y(this,"actions",{addOne:pn,addMany:pS,setOne:yS,setMany:mS,updateOne:fS,updateMany:AS,deleteOne:An,deleteMany:SS,initialize:hS});y(this,"selectors",{selectById:$t,selectByIds:OS})}async list(e,n){const{organizationUuid:a,...c}=e,d=a?`/organizations/${a}${this.url}s/`:`/${this.url}`;return this.performRequest({method:m.GET,url:d,...c},n)}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({organizationUuid:e},n);return this.dispatch(a(c)),c}}async function zn(t,s,e,n,a){const c=n instanceof it;c&&s.checkAuth!==!1&&await n.auth.prepareAuth();const d={queryParams:"",isAuthNeeded:!0},{s3url:l,payload:r,headers:u,method:h,queryParams:p,attachmentHash:A,isExternalUrl:I,isAuthNeeded:g,isResponseBlob:w}={...d,...s};let P=s.url;const R=A?await e.files.fetchCache(A):void 0;if(A&&!R)throw new Error(`Cannot upload file ${A} because it's not cached.`);!I&&!P.startsWith("http")&&(!P.startsWith("/")&&!P.startsWith("blob:")&&(P="/"+P),P=t+P);const M=B=>{if(A){if(!l)throw new Error(`No S3 URL for file ${A}`);if("warning"in l)throw new Error(`S3 URL warning for file ${A}`);if(!R)throw new Error(`No file for file ${A}`);const N=l.fields["x-amz-checksum-sha1"];if(!N)throw new Error(`No checksum for file ${A}`);return B.set("x-amz-checksum-sha1",N).field({...r,...l.fields}).attach("file",R)}return B.send(r)},C={[m.GET]:()=>w?at.get(P.toString()).responseType("blob"):at.get(P.toString()),[m.POST]:()=>{const B=at.post(P.toString());return M(B)},[m.PATCH]:()=>{const B=at.patch(P.toString());return M(B)},[m.PUT]:()=>{const B=at.put(P.toString());return M(B)},[m.DELETE]:()=>{const B=at.delete(P.toString());return M(B)}}[h];let z=C();const $=()=>{console.debug("aborting request:",s.url),z.abort()};if(a==null||a.addEventListener("abort",$),g&&c){const B=n.auth.getAuthHeader();z=z.set("Authorization",B)}u&&(z=z.set(u));try{return await z.query(p)}catch(B){const N=JI(B),kt=N==null?void 0:N.status;if(c&&kt===401)return await n.auth.handleUnauthorized(z,N),z.query(p);throw new L({response:N,innerError:B,discard:vn.includes(kt)})}finally{a==null||a.removeEventListener("abort",$)}}class Zg{constructor(s){y(this,"store");this.store=s}_performRequest(s,e,n,a){const c=new Gt,d={...e,uuid:e.uuid??Qe.v4()};return zn(s,d,this,n,a).then(l=>{c.resolve(l.body)}).catch(l=>{l instanceof Error?c.reject(l):c.reject(new Error((l??ct).toString()))}),c}async performRequest(s,e,n,a){return this._performRequest(s,e,n,a).then(c=>{if(c instanceof L)throw c;return c})}async enqueueRequest(s,e,n){return this._enqueueRequest(s,e,n).then(a=>{if(a instanceof L)throw a;return a})}_enqueueRequest(s,e,n){const a=new Gt,c={...s,BASE_URL:e,serviceName:n},d=this.store.dispatch(xS(c)),l=u=>{if(u)a.resolve(u.body);else{const h=new L({message:"Could not get a response from the server.",response:u,discard:!0});a.reject(h)}},r=u=>{u instanceof L?u.options.discard=!0:(console.error("Received an unexpected error while processing a request:",u,`
|
|
14
|
-
Converting error to APIError and discarding.`),u=new L({message:"An error occurred while processing the request.",innerError:u,discard:!0})),a.reject(u)};return d.then(l,r),a}async performPagination(s,e,n,a,c){const d={...e,queryParams:{...e.queryParams,paginate:!0,limit:n}},{method:l}=d,r=[];let u=await this.performRequest(s,d,a,c);for(r.push(u.results);u.next;)u=await this.performRequest(s,{url:u.next,method:l},a,c),r.push(u.results);return r}}class rt{constructor(){y(this,"graph");y(this,"requestAttemptCounter");this.graph=new AO.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 d=s[c];if(!d){console.error("Previous outbox item was undefined");continue}d.payload.uuid!==a.payload.uuid&&d.payload.blocks.some(l=>a.payload.blockers.includes(l))&&rt._addDependency(a.payload.uuid,d.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 XI;function QI(t){XI=t}function ut(){return XI}let xI;function eO(t){xI=t}function tO(){return xI}let jn=null;function nt(){const t=ut();if(!t)return console.warn("Client store not set; cannot get outbox coordinator yet."),null;if(jn)return jn;const s=t.getState().offline.outbox,e=rt._fromOutbox(s);return jn=e,e}const Jg=(t,s)=>{const e=new s(t);return eO(e),QI(t),e};class Xg{constructor(s){y(this,"_all");y(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 Dn{constructor(){y(this,"next");this.next=null}then(s){return new Xg(this).then(s)}async run(s){if(this.next)return this.next.run(s);{if(console.debug("Middleware finished. Performing request:",s.payload.url),!ut())throw new Error("Client store not set");const n=tO();if(!n)throw new Error("Client SDK not set");return KI(s,n)}}}class sO extends Dn{async run(s){return super.run(s)}}class iO extends Dn{async run(s){return super.run(s)}}const nO=new sO().then(new iO).compile();function aO(t){var s;return(s=nO[0])==null?void 0:s.run(t)}var cO=(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))(cO||{});i.ALL_MIDDLEWARE=nO,i.APIError=L,i.AgentService=qF,i.AssetAttachmentService=$F,i.AssetProcedureService=GF,i.AssetProcedureStepFieldValuesAttachmentService=YF,i.AssetProcedureStepFieldValuesService=ZF,i.AssetProcedureStepFieldsAttachmentService=WF,i.AssetProcedureStepFieldsService=KF,i.AssetProcedureStepService=JF,i.AssetProcedureTypeAttachmentService=CF,i.AssetProcedureTypeFieldValuesAttachmentService=kF,i.AssetProcedureTypeFieldValuesService=NF,i.AssetProcedureTypeFieldsAttachmentService=UF,i.AssetProcedureTypeFieldsService=LF,i.AssetProcedureTypeService=HF,i.AssetService=XF,i.AssetStageCompletionService=QF,i.AssetStageService=xF,i.AssetStatusType=Nn,i.AssetTypeAttachmentService=eg,i.AssetTypeFieldValuesAttachmentService=ig,i.AssetTypeFieldValuesService=ng,i.AssetTypeFieldsAttachmentService=tg,i.AssetTypeFieldsService=sg,i.AssetTypeIdentifierService=ag,i.AssetTypeIdentifierValueService=cg,i.AssetTypeService=dg,i.AssetTypeStatusService=rg,i.AttachmentModel=Gn,i.BaseApiService=it,i.BaseModelApiService=dt,i.BaseOfflineFileModelApiService=q,i.BaseOfflineModelApiService=v,i.BaseSDK=Zg,i.COMMON_AUTO_FIELDS=xn,i.DEFAULT_ISSUE_PRIORITY=fO,i.DEFAULT_PAGE_SIZE=qI,i.DISCARD_HTTP_STATUSES=vn,i.DeferredPromise=Gt,i.DocumentAttachmentService=ug,i.DocumentService=lg,i.EMPTY_ARRAY=Un,i.EMPTY_OBJECT=Ln,i.EmailDomainsService=og,i.EmailVerificationService=hg,i.FILE_MODEL_DEFAULT_PAGE_SIZE=$I,i.FileService=mg,i.FormIdentifierService=yg,i.FormIdentifierValueService=pg,i.FormRevisionAttachmentService=Ag,i.FormRevisionService=fg,i.FormService=Sg,i.FormSubmissionAttachmentService=Tg,i.FormSubmissionService=Ig,i.GeoImageService=Og,i.HttpMethod=m,i.IssueAssociationService=Pg,i.IssueAttachmentService=Fg,i.IssueCommentAttachmentService=gg,i.IssueCommentService=_g,i.IssuePriority=Nt,i.IssueService=bg,i.IssueStatusType=Hn,i.IssueTypeAttachmentService=Mg,i.IssueTypeFieldValuesAttachmentService=Eg,i.IssueTypeFieldValuesService=Bg,i.IssueTypeFieldsAttachmentService=Rg,i.IssueTypeFieldsService=wg,i.IssueTypeIdentifierService=vg,i.IssueTypeIdentifierValueService=Vg,i.IssueTypeService=zg,i.IssueTypeStatusService=jg,i.IssueUpdateChange=U,i.IssueUpdateService=Dg,i.JWTService=Cg,i.MAX_SERVICE_BATCH_SIZE=Xe,i.OUTBOX_RETRY_DELAY=Wn,i.OfflineAnalyticsMiddleware=sO,i.OfflineMiddleware=Dn,i.OrganizationAccessLevel=kn,i.OrganizationAccessService=Ug,i.OrganizationService=Lg,i.OutboxCoordinator=rt,i.ProjectAccessService=kg,i.ProjectAttachmentService=Ng,i.ProjectFileService=Gg,i.ProjectService=Hg,i.RESET_ORGANIZATION_STATE=b,i.RESET_PROJECT_STATE=D,i.RESET_STATE=O,i.RateLimitingMiddleware=iO,i.SelectorBuilder=UO,i.TeamMembershipService=Wg,i.TeamService=Kg,i.UNKNOWN_ERROR_MESSAGE=ct,i.UserService=Yg,i.VERSION_REDUCER_KEY=ot,i.VerificationCodeType=cO,i._setLatestRetryTime=tT,i.addAsset=wr,i.addAssetAttachment=ya,i.addAssetAttachments=Qt,i.addAssetProcedure=kc,i.addAssetProcedureStep=fr,i.addAssetProcedureStepFieldValues=tr,i.addAssetProcedureStepFieldValuesAttachment=kd,i.addAssetProcedureStepFieldValuesAttachments=Os,i.addAssetProcedureStepFieldValuesMany=sr,i.addAssetProcedureStepFields=wd,i.addAssetProcedureStepFieldsAttachment=pd,i.addAssetProcedureStepFieldsAttachments=Ad,i.addAssetProcedureStepFieldsMany=Ed,i.addAssetProcedureSteps=Sr,i.addAssetProcedureType=td,i.addAssetProcedureTypeAttachment=Ma,i.addAssetProcedureTypeAttachments=Ra,i.addAssetProcedureTypeFieldValues=Rc,i.addAssetProcedureTypeFieldValuesAttachment=pc,i.addAssetProcedureTypeFieldValuesAttachments=ds,i.addAssetProcedureTypeFieldValuesMany=wc,i.addAssetProcedureTypeFields=tc,i.addAssetProcedureTypeFieldsAttachment=La,i.addAssetProcedureTypeFieldsAttachments=ka,i.addAssetProcedureTypeFieldsMany=sc,i.addAssetProcedureTypes=sd,i.addAssetProcedures=hs,i.addAssetStage=au,i.addAssetStageCompletion=kr,i.addAssetStageCompletions=Nr,i.addAssetStages=cu,i.addAssetType=co,i.addAssetTypeAttachment=Au,i.addAssetTypeAttachments=js,i.addAssetTypeFieldValues=Al,i.addAssetTypeFieldValuesAttachment=il,i.addAssetTypeFieldValuesAttachments=ks,i.addAssetTypeFieldValuesMany=fl,i.addAssetTypeFields=Nu,i.addAssetTypeFieldsAttachment=wu,i.addAssetTypeFieldsAttachments=Eu,i.addAssetTypeFieldsMany=Gu,i.addAssetTypeIdentifier=El,i.addAssetTypeIdentifierValue=Gl,i.addAssetTypeIdentifierValues=Hl,i.addAssetTypeIdentifiers=Bl,i.addAssetTypeStatus=To,i.addAssetTypeStatuses=Io,i.addAssetTypes=ro,i.addAssets=Rs,i.addConversation=ra,i.addConversations=LO,i.addDocument=Jo,i.addDocumentAttachment=Do,i.addDocumentAttachments=qo,i.addDocuments=Xo,i.addEmailDomain=lh,i.addEmailDomains=oh,i.addForm=_m,i.addFormIdentifier=Mh,i.addFormIdentifierValue=Lh,i.addFormIdentifierValues=kh,i.addFormIdentifiers=Rh,i.addFormRevision=oi,i.addFormRevisionAttachment=tm,i.addFormRevisionAttachments=sm,i.addFormRevisions=hi,i.addFormSubmission=xm,i.addFormSubmissionAttachment=Cm,i.addFormSubmissionAttachments=Ti,i.addFormSubmissions=_i,i.addForms=bm,i.addGeoImage=hy,i.addGeoImages=my,i.addIssue=Mp,i.addIssueAssociation=Ry,i.addIssueAssociations=et,i.addIssueAttachment=Ly,i.addIssueAttachments=vi,i.addIssueComment=yp,i.addIssueCommentAttachment=ep,i.addIssueCommentAttachments=tp,i.addIssueComments=pp,i.addIssueType=Ef,i.addIssueTypeAttachment=Up,i.addIssueTypeAttachments=Lp,i.addIssueTypeFieldValues=yA,i.addIssueTypeFieldValuesAttachment=kA,i.addIssueTypeFieldValuesAttachments=Zi,i.addIssueTypeFieldValuesMany=pA,i.addIssueTypeFields=RA,i.addIssueTypeFieldsAttachment=eA,i.addIssueTypeFieldsAttachments=tA,i.addIssueTypeFieldsMany=wA,i.addIssueTypeIdentifier=tf,i.addIssueTypeIdentifierValue=Af,i.addIssueTypeIdentifierValues=ff,i.addIssueTypeIdentifiers=sf,i.addIssueTypeStatus=Gf,i.addIssueTypeStatuses=Hf,i.addIssueTypes=Bf,i.addIssueUpdate=rn,i.addIssueUpdates=un,i.addIssues=Ui,i.addOrganization=LS,i.addOrganizationAccess=gS,i.addOrganizationAccesses=_S,i.addOrganizations=US,i.addProject=JT,i.addProjectAccess=aT,i.addProjectAccesses=cT,i.addProjectAttachment=ST,i.addProjectAttachments=TT,i.addProjectFile=zT,i.addProjectFiles=jT,i.addProjects=ZT,i.addTeam=PI,i.addTeamMembership=rI,i.addTeamMemberships=uI,i.addTeams=FI,i.addUser=pn,i.addUsers=pS,i.agentsReducer=oa,i.agentsSlice=Zt,i.areArraysEqual=OO,i.assetAttachmentReducer=ga,i.assetAttachmentSlice=Xt,i.assetProcedureReducer=Yc,i.assetProcedureSlice=os,i.assetProcedureStepFieldValuesAttachmentReducer=Qd,i.assetProcedureStepFieldValuesAttachmentSlice=Is,i.assetProcedureStepFieldValuesReducer=hr,i.assetProcedureStepFieldValuesSlice=gs,i.assetProcedureStepFieldsAttachmentReducer=bd,i.assetProcedureStepFieldsAttachmentSlice=As,i.assetProcedureStepFieldsReducer=Cd,i.assetProcedureStepFieldsSlice=Ss,i.assetProcedureStepReducer=Fr,i.assetProcedureStepSlice=_s,i.assetProcedureTypeAttachmentReducer=ja,i.assetProcedureTypeAttachmentSlice=ts,i.assetProcedureTypeFieldValuesAttachmentReducer=Oc,i.assetProcedureTypeFieldValuesAttachmentSlice=cs,i.assetProcedureTypeFieldValuesReducer=Dc,i.assetProcedureTypeFieldValuesSlice=ls,i.assetProcedureTypeFieldsAttachmentReducer=Za,i.assetProcedureTypeFieldsAttachmentSlice=is,i.assetProcedureTypeFieldsReducer=uc,i.assetProcedureTypeFieldsSlice=as,i.assetProcedureTypeReducer=ud,i.assetProcedureTypeSlice=ys,i.assetReducer=Cr,i.assetSlice=Ms,i.assetStageCompletionReducer=Jr,i.assetStageCompletionSlice=Es,i.assetStageReducer=ou,i.assetStageSlice=Bs,i.assetTypeAttachmentReducer=bu,i.assetTypeAttachmentSlice=zs,i.assetTypeFieldValuesAttachmentReducer=ml,i.assetTypeFieldValuesAttachmentSlice=Ls,i.assetTypeFieldValuesReducer=Ml,i.assetTypeFieldValuesSlice=Hs,i.assetTypeFieldsAttachmentReducer=Uu,i.assetTypeFieldsAttachmentSlice=$s,i.assetTypeFieldsReducer=el,i.assetTypeFieldsSlice=Us,i.assetTypeIdentifierReducer=Ll,i.assetTypeIdentifierSlice=Ws,i.assetTypeIdentifierValueReducer=to,i.assetTypeIdentifierValueSlice=Ys,i.assetTypeReducer=Ao,i.assetTypeSlice=Zs,i.assetTypeStatusReducer=Eo,i.assetTypeStatusSlice=Xs,i.assetTypeStatusSortFn=sa,i.authReducer=Vo,i.authSlice=wt,i.baseReducer=PF,i.baseReducers=Bn,i.clearTokens=_P,i.createModelAdapter=_,i.createOfflineAction=XS,i.createPayload=E,i.createSelectionAdapter=SO,i.deleteAsset=vr,i.deleteAssetAttachment=Ta,i.deleteAssetAttachments=xt,i.deleteAssetProcedure=Hc,i.deleteAssetProcedureStep=Or,i.deleteAssetProcedureStepFieldValues=dr,i.deleteAssetProcedureStepFieldValuesAttachment=Kd,i.deleteAssetProcedureStepFieldValuesAttachments=Ps,i.deleteAssetProcedureStepFieldValuesMany=rr,i.deleteAssetProcedureStepFields=jd,i.deleteAssetProcedureStepFieldsAttachment=Od,i.deleteAssetProcedureStepFieldsAttachments=Pd,i.deleteAssetProcedureStepFieldsMany=Dd,i.deleteAssetProcedureSteps=Pr,i.deleteAssetProcedureType=ad,i.deleteAssetProcedureTypeAttachment=Va,i.deleteAssetProcedureTypeAttachments=za,i.deleteAssetProcedureTypeFieldValues=zc,i.deleteAssetProcedureTypeFieldValuesAttachment=Ic,i.deleteAssetProcedureTypeFieldValuesAttachments=rs,i.deleteAssetProcedureTypeFieldValuesMany=jc,i.deleteAssetProcedureTypeFields=dc,i.deleteAssetProcedureTypeFieldsAttachment=Ka,i.deleteAssetProcedureTypeFieldsAttachments=Ya,i.deleteAssetProcedureTypeFieldsMany=rc,i.deleteAssetProcedureTypes=cd,i.deleteAssetProcedures=ms,i.deleteAssetStage=uu,i.deleteAssetStageCompletion=Yr,i.deleteAssetStageCompletions=Zr,i.deleteAssetStages=lu,i.deleteAssetType=oo,i.deleteAssetTypeAttachment=Ou,i.deleteAssetTypeAttachments=Ds,i.deleteAssetTypeFieldValues=Pl,i.deleteAssetTypeFieldValuesAttachment=rl,i.deleteAssetTypeFieldValuesAttachments=Ns,i.deleteAssetTypeFieldValuesMany=Fl,i.deleteAssetTypeFields=Zu,i.deleteAssetTypeFieldsAttachment=ju,i.deleteAssetTypeFieldsAttachments=Du,i.deleteAssetTypeFieldsMany=Ju,i.deleteAssetTypeIdentifier=Dl,i.deleteAssetTypeIdentifierValue=Jl,i.deleteAssetTypeIdentifierValues=Xl,i.deleteAssetTypeIdentifiers=ql,i.deleteAssetTypeStatus=_o,i.deleteAssetTypeStatuses=bo,i.deleteAssetTypes=ho,i.deleteAssets=ws,i.deleteConversation=GO,i.deleteConversations=HO,i.deleteDocument=sh,i.deleteDocumentAttachment=ko,i.deleteDocumentAttachments=No,i.deleteDocuments=ih,i.deleteEmailDomain=Ah,i.deleteEmailDomains=fh,i.deleteForm=Bm,i.deleteFormIdentifier=Vh,i.deleteFormIdentifierValue=Kh,i.deleteFormIdentifierValues=Yh,i.deleteFormIdentifiers=zh,i.deleteFormRevision=mi,i.deleteFormRevisionAttachment=dm,i.deleteFormRevisionAttachments=rm,i.deleteFormRevisions=yi,i.deleteFormSubmission=sy,i.deleteFormSubmissionAttachment=Gm,i.deleteFormSubmissionAttachments=Ii,i.deleteFormSubmissions=bi,i.deleteForms=vm,i.deleteGeoImage=Ay,i.deleteGeoImages=fy,i.deleteIssue=vp,i.deleteIssueAssociation=wy,i.deleteIssueAssociations=tt,i.deleteIssueAttachment=Wy,i.deleteIssueAttachments=Vi,i.deleteIssueComment=Ip,i.deleteIssueCommentAttachment=cp,i.deleteIssueCommentAttachments=dp,i.deleteIssueComments=Op,i.deleteIssueType=Df,i.deleteIssueTypeAttachment=Wp,i.deleteIssueTypeAttachments=Kp,i.deleteIssueTypeFieldValues=IA,i.deleteIssueTypeFieldValuesAttachment=KA,i.deleteIssueTypeFieldValuesAttachments=Ji,i.deleteIssueTypeFieldValuesMany=OA,i.deleteIssueTypeFields=zA,i.deleteIssueTypeFieldsAttachment=cA,i.deleteIssueTypeFieldsAttachments=dA,i.deleteIssueTypeFieldsMany=jA,i.deleteIssueTypeIdentifier=rf,i.deleteIssueTypeIdentifierValue=Pf,i.deleteIssueTypeIdentifierValues=Ff,i.deleteIssueTypeIdentifiers=uf,i.deleteIssueTypeStatus=Jf,i.deleteIssueTypeStatuses=Xf,i.deleteIssueTypes=qf,i.deleteIssueUpdate=ln,i.deleteIssueUpdates=on,i.deleteIssues=Li,i.deleteOrganization=GS,i.deleteOrganizationAccess=ES,i.deleteOrganizationAccesses=BS,i.deleteOrganizations=HS,i.deleteProject=xT,i.deleteProjectAccess=oT,i.deleteProjectAccesses=hT,i.deleteProjectAttachment=gT,i.deleteProjectAttachments=_T,i.deleteProjectFile=$T,i.deleteProjectFiles=CT,i.deleteProjects=eI,i.deleteTeam=RI,i.deleteTeamMembership=yI,i.deleteTeamMemberships=pI,i.deleteTeams=wI,i.deleteUser=An,i.deleteUsers=SS,i.dequeue=WI,i.discard=YI,i.documentAttachmentReducer=Ko,i.documentAttachmentSlice=xs,i.documentSlice=ti,i.documentsReducer=nh,i.downloadFile=wO,i.emailDomainsReducer=Oh,i.emailDomainsSlice=ii,i.emailRegex=qO,i.enqueue=HI,i.enqueueRequest=xS,i.extractResponseFromError=JI,i.fallbackToEmptyArray=S,i.fallbackToEmptyObject=St,i.fetchBlobFromObjectUrl=Zn,i.fetchFileFromObjectUrl=Jn,i.fileReducer=gh,i.fileSlice=ai,i.formIdentifierReducer=$h,i.formIdentifierSlice=ci,i.formIdentifierValueReducer=Qh,i.formIdentifierValueSlice=ri,i.formReducer=Vm,i.formRevisionAttachmentReducer=hm,i.formRevisionAttachmentSlice=ui,i.formRevisionReducer=Pm,i.formRevisionsSlice=li,i.formSlice=Ai,i.formSubmissionAttachmentReducer=Ym,i.formSubmissionAttachmentSlice=Si,i.formSubmissionReducer=dy,i.formSubmissionSlice=gi,i.geoImageReducer=Oy,i.geoImageSlice=Ri,i.getAssetProcedureStepSubTree=ta,i.getAssetProcedureStepTrees=$O,i.getClientSDK=tO,i.getClientStore=ut,i.getDocumentSubTree=aa,i.getDocumentTrees=CO,i.getFileExtension=Yn,i.getLocalDateString=Kn,i.getLocalRelativeDateString=_O,i.getOutboxCoordinator=nt,i.getRenamedFile=RO,i.getRequestDescription=T,i.getS3FileKey=MO,i.hashFile=Tt,i.initSDK=Jg,i.initializeAssetAttachments=ma,i.initializeAssetProcedureStepFieldValues=er,i.initializeAssetProcedureStepFieldValuesAttachments=Ld,i.initializeAssetProcedureStepFields=Rd,i.initializeAssetProcedureStepFieldsAttachments=yd,i.initializeAssetProcedureSteps=yr,i.initializeAssetProcedureTypeAttachments=ba,i.initializeAssetProcedureTypeFieldValues=Mc,i.initializeAssetProcedureTypeFieldValuesAttachments=yc,i.initializeAssetProcedureTypeFields=ec,i.initializeAssetProcedureTypeFieldsAttachments=Ua,i.initializeAssetProcedureTypes=ed,i.initializeAssetProcedures=Lc,i.initializeAssetStageCompletions=Lr,i.initializeAssetStages=su,i.initializeAssetTypeAttachments=pu,i.initializeAssetTypeFieldValues=pl,i.initializeAssetTypeFieldValuesAttachments=sl,i.initializeAssetTypeFields=ku,i.initializeAssetTypeFieldsAttachments=Ru,i.initializeAssetTypeIdentifierValues=Nl,i.initializeAssetTypeIdentifiers=wl,i.initializeAssetTypeStatuses=So,i.initializeAssetTypes=io,i.initializeAssets=Rr,i.initializeConversations=da,i.initializeDocumentAttachments=jo,i.initializeDocuments=Zo,i.initializeEmailDomains=uh,i.initializeFormIdentifierValues=Uh,i.initializeFormIdentifiers=bh,i.initializeFormRevisionAttachments=em,i.initializeFormRevisions=ym,i.initializeFormSubmissionAttachments=$m,i.initializeFormSubmissions=Jm,i.initializeForms=gm,i.initializeGeoImages=uy,i.initializeIssueAssociations=Fy,i.initializeIssueAttachments=Uy,i.initializeIssueCommentAttachments=xy,i.initializeIssueComments=mp,i.initializeIssueTypeAttachments=Cp,i.initializeIssueTypeFieldValues=mA,i.initializeIssueTypeFieldValuesAttachments=LA,i.initializeIssueTypeFields=MA,i.initializeIssueTypeFieldsAttachments=xp,i.initializeIssueTypeIdentifierValues=pf,i.initializeIssueTypeIdentifiers=ef,i.initializeIssueTypeStatuses=Nf,i.initializeIssueTypes=wf,i.initializeIssueUpdates=sS,i.initializeIssues=bp,i.initializeOrganizationAccesses=FS,i.initializeOrganizations=qS,i.initializeProjectAccesses=nT,i.initializeProjectAttachments=fT,i.initializeProjectFiles=BT,i.initializeProjects=WT,i.initializeTeamMemberships=dI,i.initializeTeams=OI,i.initializeUsers=hS,i.isImageFile=EO,i.isObjectUrl=Xn,i.isToday=gO,i.issueAssociationReducer=$y,i.issueAssociationSlice=Ei,i.issueAttachmentReducer=Xy,i.issueAttachmentSlice=Bi,i.issueCommentAttachmentReducer=op,i.issueCommentAttachmentSlice=ji,i.issueCommentReducer=gp,i.issueCommentSlice=qi,i.issueReducer=qp,i.issueSlice=Ci,i.issueTypeAttachmentReducer=Xp,i.issueTypeAttachmentSlice=ki,i.issueTypeFieldValuesAttachmentReducer=QA,i.issueTypeFieldValuesAttachmentSlice=Yi,i.issueTypeFieldValuesReducer=_A,i.issueTypeFieldValuesSlice=Wi,i.issueTypeFieldsAttachmentReducer=oA,i.issueTypeFieldsAttachmentSlice=Gi,i.issueTypeFieldsReducer=CA,i.issueTypeFieldsSlice=Ki,i.issueTypeIdentifierReducer=mf,i.issueTypeIdentifierSlice=Qi,i.issueTypeIdentifierValueReducer=Mf,i.issueTypeIdentifierValueSlice=en,i.issueTypeReducer=Lf,i.issueTypeSlice=tn,i.issueTypeStatusReducer=eS,i.issueTypeStatusSlice=nn,i.issueTypeStatusSortFn=ia,i.issueUpdateReducer=lS,i.issueUpdateSlice=dn,i.logOnlyOnce=BO,i.markAsDeleted=eT,i.markForDeletion=rF,i.memoize=Wt,i.organizationAccessReducer=vS,i.organizationAccessSlice=Sn,i.organizationReducer=JS,i.organizationSlice=Tn,i.outboxReducer=sT,i.outboxSlice=In,i.overmapEnhancer=BF,i.overmapReducer=FF,i.overmapReducers=DI,i.performRequest=zn,i.performRequestFromAction=KI,i.projectAccessReducer=mT,i.projectAccessSlice=On,i.projectAttachmentReducer=wT,i.projectAttachmentSlice=Fn,i.projectFileReducer=GT,i.projectFileSlice=_n,i.projectReducer=tI,i.projectSlice=bn,i.rehydratedReducer=aI,i.rehydratedSlice=Mn,i.restructureSelectorWithArgs=f,i.runMiddleware=aO,i.selectAccessToken=bP,i.selectAccessesByUserOfProject=lF,i.selectAccessibleProjects=mF,i.selectActiveOrganizationAccess=nF,i.selectAllDocumentAttachments=ei,i.selectAssetAttachmentById=Oa,i.selectAssetAttachmentMapping=Ia,i.selectAssetAttachments=es,i.selectAssetAttachmentsByIds=Pa,i.selectAssetById=qr,i.selectAssetProcedureById=Xc,i.selectAssetProcedureStepById=gr,i.selectAssetProcedureStepFieldValues=ht,i.selectAssetProcedureStepFieldValuesAttachmentById=Zd,i.selectAssetProcedureStepFieldValuesAttachments=Fs,i.selectAssetProcedureStepFieldValuesAttachmentsByIds=Jd,i.selectAssetProcedureStepFieldValuesAttachmentsMapping=Yd,i.selectAssetProcedureStepFieldValuesById=lr,i.selectAssetProcedureStepFieldValuesByIds=or,i.selectAssetProcedureStepFieldValuesMapping=ur,i.selectAssetProcedureStepFieldValuesOfAsset=cP,i.selectAssetProcedureStepFieldValuesOfAssetProcedure=dP,i.selectAssetProcedureStepFieldValuesOfAssetProcedureStep=rP,i.selectAssetProcedureStepFields=gt,i.selectAssetProcedureStepFieldsAttachmentById=gd,i.selectAssetProcedureStepFieldsAttachments=fs,i.selectAssetProcedureStepFieldsAttachmentsByIds=_d,i.selectAssetProcedureStepFieldsAttachmentsMapping=Fd,i.selectAssetProcedureStepFieldsById=qd,i.selectAssetProcedureStepFieldsByIds=$d,i.selectAssetProcedureStepFieldsMapping=Ts,i.selectAssetProcedureStepFieldsOfAssetProcedureStep=iP,i.selectAssetProcedureStepMapping=_t,i.selectAssetProcedureSteps=bs,i.selectAssetProcedureStepsByIds=_r,i.selectAssetProcedureStepsMappingOfAssetProcedureType=uP,i.selectAssetProcedureStepsOfAssetProcedureType=lP,i.selectAssetProcedureTypeAttachmentById=qa,i.selectAssetProcedureTypeAttachmentMapping=Da,i.selectAssetProcedureTypeAttachments=ss,i.selectAssetProcedureTypeAttachmentsByIds=$a,i.selectAssetProcedureTypeById=od,i.selectAssetProcedureTypeFieldValues=Pt,i.selectAssetProcedureTypeFieldValuesAttachmentById=Fc,i.selectAssetProcedureTypeFieldValuesAttachments=us,i.selectAssetProcedureTypeFieldValuesAttachmentsByIds=gc,i.selectAssetProcedureTypeFieldValuesAttachmentsMapping=Pc,i.selectAssetProcedureTypeFieldValuesById=$c,i.selectAssetProcedureTypeFieldValuesByIds=Cc,i.selectAssetProcedureTypeFieldValuesMapping=qc,i.selectAssetProcedureTypeFieldValuesOfAsset=QO,i.selectAssetProcedureTypeFields=Ot,i.selectAssetProcedureTypeFieldsAttachmentById=Xa,i.selectAssetProcedureTypeFieldsAttachments=ns,i.selectAssetProcedureTypeFieldsAttachmentsByIds=Qa,i.selectAssetProcedureTypeFieldsAttachmentsMapping=Ja,i.selectAssetProcedureTypeFieldsById=oc,i.selectAssetProcedureTypeFieldsByIds=hc,i.selectAssetProcedureTypeFieldsMapping=lc,i.selectAssetProcedureTypeFieldsOfAssetProcedureType=JO,i.selectAssetProcedureTypes=ps,i.selectAssetProcedureTypesByIds=hd,i.selectAssetProcedureTypesMapping=ld,i.selectAssetProcedureTypesOfOrganization=tP,i.selectAssetProcedures=Ft,i.selectAssetProceduresByIds=Qc,i.selectAssetProceduresMapping=Zc,i.selectAssetProceduresOfAssetProcedureType=Jc,i.selectAssetProceduresOfAssetType=eP,i.selectAssetStageById=hu,i.selectAssetStageCompletionById=xr,i.selectAssetStageCompletionMapping=Xr,i.selectAssetStageCompletions=Qr,i.selectAssetStageCompletionsByIds=eu,i.selectAssetStages=Vs,i.selectAssetStagesByIds=mu,i.selectAssetStagesMappingOfAssetProcedureType=hP,i.selectAssetStagesOfAssetProcedureType=mP,i.selectAssetTypeAttachmentById=Fu,i.selectAssetTypeAttachmentMapping=Pu,i.selectAssetTypeAttachments=qs,i.selectAssetTypeAttachmentsByIds=gu,i.selectAssetTypeById=yo,i.selectAssetTypeFieldValues=Mt,i.selectAssetTypeFieldValuesAttachmentById=ll,i.selectAssetTypeFieldValuesAttachments=Gs,i.selectAssetTypeFieldValuesAttachmentsByIds=ol,i.selectAssetTypeFieldValuesAttachmentsMapping=ul,i.selectAssetTypeFieldValuesById=_l,i.selectAssetTypeFieldValuesByIds=bl,i.selectAssetTypeFieldValuesMapping=gl,i.selectAssetTypeFieldValuesOfAsset=fP,i.selectAssetTypeFields=mt,i.selectAssetTypeFieldsAttachmentById=$u,i.selectAssetTypeFieldsAttachments=Cs,i.selectAssetTypeFieldsAttachmentsByIds=Cu,i.selectAssetTypeFieldsAttachmentsMapping=qu,i.selectAssetTypeFieldsById=Qu,i.selectAssetTypeFieldsByIds=xu,i.selectAssetTypeFieldsMapping=Xu,i.selectAssetTypeFieldsOfAssetType=pP,i.selectAssetTypeIdentifierById=Cl,i.selectAssetTypeIdentifierMapping=$l,i.selectAssetTypeIdentifierValueById=xl,i.selectAssetTypeIdentifierValueMapping=Ql,i.selectAssetTypeIdentifierValues=Rt,i.selectAssetTypeIdentifierValuesByIds=eo,i.selectAssetTypeIdentifierValuesOfAsset=IP,i.selectAssetTypeIdentifierValuesOfIdentifier=OP,i.selectAssetTypeIdentifiers=Ks,i.selectAssetTypeIdentifiersByIds=Ul,i.selectAssetTypeIdentifiersOfAssetType=TP,i.selectAssetTypeStatusById=Ro,i.selectAssetTypeStatusMapping=Mo,i.selectAssetTypeStatuses=Qs,i.selectAssetTypeStatusesByIds=wo,i.selectAssetTypeStatusesOfAssetType=FP,i.selectAssetTypeValuesOfAssetType=SP,i.selectAssetTypes=Js,i.selectAssetTypesByIds=po,i.selectAssetTypesMapping=mo,i.selectAssetTypesOfOrganization=PP,i.selectAssets=bt,i.selectAssetsByIds=$r,i.selectAssetsMapping=jr,i.selectAssetsOfAssetType=Dr,i.selectAssetsOfProject=oP,i.selectAttachmentsOfAsset=Fa,i.selectAttachmentsOfAssetProcedureStepFieldValues=Xd,i.selectAttachmentsOfAssetProcedureStepFields=sP,i.selectAttachmentsOfAssetProcedureType=YO,i.selectAttachmentsOfAssetProcedureTypeFieldValues=_c,i.selectAttachmentsOfAssetProcedureTypeFields=ZO,i.selectAttachmentsOfAssetType=_u,i.selectAttachmentsOfAssetTypeFieldValues=hl,i.selectAttachmentsOfAssetTypeFields=yP,i.selectAttachmentsOfDocument=RP,i.selectAttachmentsOfFormRevision=$P,i.selectAttachmentsOfFormSubmission=Km,i.selectAttachmentsOfIssue=Yy,i.selectAttachmentsOfIssueComment=kP,i.selectAttachmentsOfIssueType=HP,i.selectAttachmentsOfIssueTypeFieldValues=XA,i.selectAttachmentsOfIssueTypeFields=WP,i.selectAttachmentsOfProject=hF,i.selectCommentsOfIssue=NP,i.selectConversation=KO,i.selectConversationMapping=Jt,i.selectConversations=WO,i.selectCurrentUser=IS,i.selectDeletedRequests=cF,i.selectDescendantsOfAssetProcedureStep=br,i.selectDescendantsOfDocument=dh,i.selectDocumentAttachmentById=Ho,i.selectDocumentAttachmentMapping=Go,i.selectDocumentAttachmentsByIds=Wo,i.selectDocumentById=ah,i.selectDocuments=Et,i.selectDocumentsByIds=ch,i.selectDocumentsMapping=si,i.selectEmailDomainById=Th,i.selectEmailDomains=ni,i.selectEmailDomainsAsMapping=Sh,i.selectEmailDomainsByIds=Ih,i.selectEmailDomainsOfOrganization=BP,i.selectFieldValuesOfAssetProcedure=xO,i.selectFormById=jm,i.selectFormIdentifierById=Dh,i.selectFormIdentifierMapping=jh,i.selectFormIdentifierValueById=Jh,i.selectFormIdentifierValueMapping=Zh,i.selectFormIdentifierValues=Bt,i.selectFormIdentifierValuesByIds=Xh,i.selectFormIdentifierValuesOfFormSubmission=DP,i.selectFormIdentifierValuesOfIdentifier=qP,i.selectFormIdentifiers=di,i.selectFormIdentifiersByIds=qh,i.selectFormIdentifiersOfForm=jP,i.selectFormMapping=zm,i.selectFormRevisionAttachmentById=lm,i.selectFormRevisionAttachments=um,i.selectFormRevisionAttachmentsByIds=om,i.selectFormRevisionAttachmentsMapping=vt,i.selectFormRevisionById=Tm,i.selectFormRevisionMapping=pi,i.selectFormRevisions=Vt,i.selectFormRevisionsByIds=Im,i.selectFormRevisionsOfForm=Om,i.selectFormSubmissionAttachemntsByIds=Fi,i.selectFormSubmissionAttachmentById=Hm,i.selectFormSubmissionAttachments=Pi,i.selectFormSubmissionAttachmentsByIds=Wm,i.selectFormSubmissionAttachmentsMapping=Oi,i.selectFormSubmissionById=ny,i.selectFormSubmissions=iy,i.selectFormSubmissionsByIds=ay,i.selectFormSubmissionsMapping=Mi,i.selectFormSubmissionsOfForm=cy,i.selectForms=fi,i.selectFormsByIds=Dm,i.selectFormsOfOrganization=UP,i.selectGeoImageById=Ty,i.selectGeoImageMapping=Sy,i.selectGeoImages=wi,i.selectGeoImagesByIds=Iy,i.selectGeoImagesOfProject=LP,i.selectIsLoggedIn=MP,i.selectIssueAssociationById=By,i.selectIssueAssociationMapping=Ey,i.selectIssueAssociations=st,i.selectIssueAssociationsByIds=vy,i.selectIssueAssociationsOfAsset=qy,i.selectIssueAssociationsOfIssue=Dy,i.selectIssueAssociationsOfIssues=jy,i.selectIssueAssociationsToIssue=Vy,i.selectIssueAssociationsToIssues=zy,i.selectIssueAttachmentById=Zy,i.selectIssueAttachmentMapping=Ky,i.selectIssueAttachments=zi,i.selectIssueAttachmentsByIds=Jy,i.selectIssueById=zp,i.selectIssueCommentAttachmentById=up,i.selectIssueCommentAttachmentMapping=rp,i.selectIssueCommentAttachments=Di,i.selectIssueCommentAttachmentsByIds=lp,i.selectIssueCommentById=Pp,i.selectIssueCommentMapping=$i,i.selectIssueCommentsByIds=Fp,i.selectIssueMapping=Vp,i.selectIssueTypeAttachmentById=Zp,i.selectIssueTypeAttachmentMapping=Yp,i.selectIssueTypeAttachments=Ni,i.selectIssueTypeAttachmentsByIds=Jp,i.selectIssueTypeById=Cf,i.selectIssueTypeFieldValues=jt,i.selectIssueTypeFieldValuesAttachmentById=ZA,i.selectIssueTypeFieldValuesAttachments=Xi,i.selectIssueTypeFieldValuesAttachmentsByIds=JA,i.selectIssueTypeFieldValuesAttachmentsMapping=YA,i.selectIssueTypeFieldValuesById=FA,i.selectIssueTypeFieldValuesByIds=gA,i.selectIssueTypeFieldValuesMapping=PA,i.selectIssueTypeFieldValuesOfIssue=KP,i.selectIssueTypeFields=yt,i.selectIssueTypeFieldsAttachmentById=uA,i.selectIssueTypeFieldsAttachments=Hi,i.selectIssueTypeFieldsAttachmentsByIds=lA,i.selectIssueTypeFieldsAttachmentsMapping=rA,i.selectIssueTypeFieldsById=qA,i.selectIssueTypeFieldsByIds=$A,i.selectIssueTypeFieldsMapping=DA,i.selectIssueTypeFieldsOfIssueType=YP,i.selectIssueTypeIdentifierById=of,i.selectIssueTypeIdentifierMapping=lf,i.selectIssueTypeIdentifierValueById=_f,i.selectIssueTypeIdentifierValueMapping=gf,i.selectIssueTypeIdentifierValues=Dt,i.selectIssueTypeIdentifierValuesByIds=bf,i.selectIssueTypeIdentifierValuesOfIdentifier=xP,i.selectIssueTypeIdentifierValuesOfIssue=QP,i.selectIssueTypeIdentifiers=xi,i.selectIssueTypeIdentifiersByIds=hf,i.selectIssueTypeIdentifiersOfIssueType=XP,i.selectIssueTypeMapping=$f,i.selectIssueTypeStatusById=cn,i.selectIssueTypeStatusMapping=Qf,i.selectIssueTypeStatuses=an,i.selectIssueTypeStatusesByIds=xf,i.selectIssueTypeStatusesOfIssueType=tF,i.selectIssueTypeValuesOfIssueType=JP,i.selectIssueTypes=sn,i.selectIssueTypesByIds=Uf,i.selectIssueTypesOfOrganization=eF,i.selectIssueUpdateById=dS,i.selectIssueUpdateMapping=hn,i.selectIssueUpdates=mn,i.selectIssueUpdatesByIds=rS,i.selectIssueUpdatesOfIssue=uS,i.selectIssues=zt,i.selectIssuesByIds=jp,i.selectIssuesOfIssueType=Dp,i.selectIssuesOfProject=GP,i.selectLatestAssetProcedureStepFieldsOfAssetProcedureStep=nP,i.selectLatestAssetProcedureTypeFieldsOfAssetProcedureType=XO,i.selectLatestAssetTypeFieldsOfAssetType=AP,i.selectLatestFieldsByAssetProcedureStep=aP,i.selectLatestFormRevisionOfForm=CP,i.selectLatestIssueTypeFieldsOfIssueType=ZP,i.selectLatestRetryTime=dF,i.selectMembershipsByUserOfTeam=SF,i.selectOrganizationAccessById=VS,i.selectOrganizationAccessMapping=Ct,i.selectOrganizationAccessUserMapping=jS,i.selectOrganizationAccessesByIds=zS,i.selectOrganizationById=YS,i.selectOrganizationDocuments=EP,i.selectOrganizations=KS,i.selectOrganizationsByIds=ZS,i.selectOrganizationsMapping=WS,i.selectProjectAccessById=yT,i.selectProjectAccessMapping=Pn,i.selectProjectAccesses=pt,i.selectProjectAccessesByIds=pT,i.selectProjectAccessesOfProject=uF,i.selectProjectAttachmentById=MT,i.selectProjectAttachmentMapping=bT,i.selectProjectAttachments=gn,i.selectProjectAttachmentsByIds=RT,i.selectProjectById=iI,i.selectProjectDocuments=wP,i.selectProjectFileById=kT,i.selectProjectFileMapping=UT,i.selectProjectFiles=LT,i.selectProjectFilesByIds=NT,i.selectProjectMapping=sI,i.selectProjects=Ut,i.selectProjectsByIds=nI,i.selectProjectsOfOrganization=yF,i.selectRehydrated=fF,i.selectStageMapping=vs,i.selectTeamById=BI,i.selectTeamMembershipById=SI,i.selectTeamMemberships=Lt,i.selectTeamMembershipsByIds=TI,i.selectTeamMembershipsMapping=fI,i.selectTeams=En,i.selectTeamsByIds=vI,i.selectTeamsMapping=EI,i.selectTeamsOfOrganization=IF,i.selectUploadUrl=zP,i.selectUserById=$t,i.selectUsers=qt,i.selectUsersByIds=OS,i.selectUsersMapping=fn,i.selectUsersOfOrganization=aF,i.selectUsersOfProject=oF,i.selectUsersOfTeam=TF,i.setAsset=Vr,i.setAssetAttachment=pa,i.setAssetAttachments=Aa,i.setAssetProcedure=Wc,i.setAssetProcedureStep=pr,i.setAssetProcedureStepFieldValues=ir,i.setAssetProcedureStepFieldValuesAttachment=Nd,i.setAssetProcedureStepFieldValuesAttachments=Gd,i.setAssetProcedureStepFieldValuesMany=nr,i.setAssetProcedureStepFields=Bd,i.setAssetProcedureStepFieldsAttachment=fd,i.setAssetProcedureStepFieldsAttachments=Sd,i.setAssetProcedureStepFieldsMany=vd,i.setAssetProcedureSteps=Ar,i.setAssetProcedureType=dd,i.setAssetProcedureTypeAttachment=wa,i.setAssetProcedureTypeAttachments=Ea,i.setAssetProcedureTypeFieldValues=Ec,i.setAssetProcedureTypeFieldValuesAttachment=Ac,i.setAssetProcedureTypeFieldValuesAttachments=fc,i.setAssetProcedureTypeFieldValuesMany=Bc,i.setAssetProcedureTypeFields=ic,i.setAssetProcedureTypeFieldsAttachment=Na,i.setAssetProcedureTypeFieldsAttachments=Ga,i.setAssetProcedureTypeFieldsMany=nc,i.setAssetProcedureTypes=rd,i.setAssetProcedures=Kc,i.setAssetStage=iu,i.setAssetStageCompletion=Gr,i.setAssetStageCompletions=Hr,i.setAssetStages=nu,i.setAssetType=no,i.setAssetTypeAttachment=fu,i.setAssetTypeAttachments=Su,i.setAssetTypeFieldValues=Sl,i.setAssetTypeFieldValuesAttachment=nl,i.setAssetTypeFieldValuesAttachments=al,i.setAssetTypeFieldValuesMany=Tl,i.setAssetTypeFields=Hu,i.setAssetTypeFieldsAttachment=Bu,i.setAssetTypeFieldsAttachments=vu,i.setAssetTypeFieldsMany=Wu,i.setAssetTypeIdentifier=vl,i.setAssetTypeIdentifierValue=Wl,i.setAssetTypeIdentifierValues=Kl,i.setAssetTypeIdentifiers=Vl,i.setAssetTypeStatus=Oo,i.setAssetTypeStatuses=Po,i.setAssetTypes=ao,i.setAssets=zr,i.setClientSDK=eO,i.setClientStore=QI,i.setConversation=ua,i.setConversations=kO,i.setCurrentUser=sF,i.setCurrentUserProfile=iF,i.setDocument=Qo,i.setDocumentAttachment=$o,i.setDocumentAttachments=Co,i.setDocuments=xo,i.setEmailDomain=hh,i.setEmailDomains=mh,i.setForm=Mm,i.setFormIdentifier=wh,i.setFormIdentifierValue=Nh,i.setFormIdentifierValues=Gh,i.setFormIdentifiers=Eh,i.setFormRevision=pm,i.setFormRevisionAttachment=im,i.setFormRevisionAttachments=nm,i.setFormRevisions=Am,i.setFormSubmission=Xm,i.setFormSubmissionAttachment=Um,i.setFormSubmissionAttachments=Lm,i.setFormSubmissions=Qm,i.setForms=Rm,i.setGeoImage=ly,i.setGeoImages=oy,i.setIssue=Rp,i.setIssueAssociation=_y,i.setIssueAssociations=gy,i.setIssueAttachment=ky,i.setIssueAttachments=Ny,i.setIssueComment=Ap,i.setIssueCommentAttachment=sp,i.setIssueCommentAttachments=ip,i.setIssueComments=fp,i.setIssueType=vf,i.setIssueTypeAttachment=kp,i.setIssueTypeAttachments=Np,i.setIssueTypeFieldValues=AA,i.setIssueTypeFieldValuesAttachment=NA,i.setIssueTypeFieldValuesAttachments=GA,i.setIssueTypeFieldValuesMany=fA,i.setIssueTypeFields=EA,i.setIssueTypeFieldsAttachment=sA,i.setIssueTypeFieldsAttachments=iA,i.setIssueTypeFieldsMany=BA,i.setIssueTypeIdentifier=nf,i.setIssueTypeIdentifierValue=Sf,i.setIssueTypeIdentifierValues=Tf,i.setIssueTypeIdentifiers=af,i.setIssueTypeStatus=Wf,i.setIssueTypeStatuses=Kf,i.setIssueTypes=Vf,i.setIssueUpdate=iS,i.setIssueUpdates=nS,i.setIssues=wp,i.setLoggedIn=vo,i.setOrganization=CS,i.setOrganizationAccess=bS,i.setOrganizationAccesses=MS,i.setOrganizations=$S,i.setProject=YT,i.setProjectAccess=dT,i.setProjectAccesses=rT,i.setProjectAttachment=IT,i.setProjectAttachments=OT,i.setProjectFile=vT,i.setProjectFiles=VT,i.setProjects=KT,i.setRehydrated=AF,i.setTeam=gI,i.setTeamMembership=lI,i.setTeamMemberships=oI,i.setTeams=_I,i.setTokens=gP,i.setUploadUrl=VP,i.setUser=yS,i.setUsers=mS,i.shallowEqual=IO,i.slugify=jO,i.spacesToDashesLower=zO,i.teamMembershipReducer=AI,i.teamMembershipSlice=Rn,i.teamReducer=VI,i.teamSlice=wn,i.toFileNameSafeString=VO,i.toUuidArray=V,i.toUuidIdRecord=vO,i.truncate=DO,i.updateAsset=Er,i.updateAssetAttachment=fa,i.updateAssetAttachments=Sa,i.updateAssetProcedure=Nc,i.updateAssetProcedureStep=Tr,i.updateAssetProcedureStepFieldValues=ar,i.updateAssetProcedureStepFieldValuesAttachment=Hd,i.updateAssetProcedureStepFieldValuesAttachments=Wd,i.updateAssetProcedureStepFieldValuesMany=cr,i.updateAssetProcedureStepFields=Vd,i.updateAssetProcedureStepFieldsAttachment=Td,i.updateAssetProcedureStepFieldsAttachments=Id,i.updateAssetProcedureStepFieldsMany=zd,i.updateAssetProcedureSteps=Ir,i.updateAssetProcedureType=id,i.updateAssetProcedureTypeAttachment=Ba,i.updateAssetProcedureTypeAttachments=va,i.updateAssetProcedureTypeFieldValues=vc,i.updateAssetProcedureTypeFieldValuesAttachment=Sc,i.updateAssetProcedureTypeFieldValuesAttachments=Tc,i.updateAssetProcedureTypeFieldValuesMany=Vc,i.updateAssetProcedureTypeFields=ac,i.updateAssetProcedureTypeFieldsAttachment=Ha,i.updateAssetProcedureTypeFieldsAttachments=Wa,i.updateAssetProcedureTypeFieldsMany=cc,i.updateAssetProcedureTypes=nd,i.updateAssetProcedures=Gc,i.updateAssetStage=du,i.updateAssetStageCompletion=Wr,i.updateAssetStageCompletions=Kr,i.updateAssetStages=ru,i.updateAssetType=uo,i.updateAssetTypeAttachment=Tu,i.updateAssetTypeAttachments=Iu,i.updateAssetTypeFieldValues=Il,i.updateAssetTypeFieldValuesAttachment=cl,i.updateAssetTypeFieldValuesAttachments=dl,i.updateAssetTypeFieldValuesMany=Ol,i.updateAssetTypeFields=Ku,i.updateAssetTypeFieldsAttachment=Vu,i.updateAssetTypeFieldsAttachments=zu,i.updateAssetTypeFieldsMany=Yu,i.updateAssetTypeIdentifier=zl,i.updateAssetTypeIdentifierValue=Yl,i.updateAssetTypeIdentifierValues=Zl,i.updateAssetTypeIdentifiers=jl,i.updateAssetTypeStatus=Fo,i.updateAssetTypeStatuses=go,i.updateAssetTypes=lo,i.updateAssets=Br,i.updateConversation=la,i.updateConversations=NO,i.updateDocument=eh,i.updateDocumentAttachment=Uo,i.updateDocumentAttachments=Lo,i.updateDocuments=th,i.updateEmailDomain=yh,i.updateEmailDomains=ph,i.updateForm=wm,i.updateFormIdentifier=Bh,i.updateFormIdentifierValue=Hh,i.updateFormIdentifierValues=Wh,i.updateFormIdentifiers=vh,i.updateFormRevision=fm,i.updateFormRevisionAttachment=am,i.updateFormRevisionAttachments=cm,i.updateFormRevisions=Sm,i.updateFormSubmission=ey,i.updateFormSubmissionAttachment=km,i.updateFormSubmissionAttachments=Nm,i.updateFormSubmissions=ty,i.updateForms=Em,i.updateGeoImage=yy,i.updateGeoImages=py,i.updateIssue=Ep,i.updateIssueAssociation=by,i.updateIssueAssociations=My,i.updateIssueAttachment=Gy,i.updateIssueAttachments=Hy,i.updateIssueComment=Sp,i.updateIssueCommentAttachment=np,i.updateIssueCommentAttachments=ap,i.updateIssueComments=Tp,i.updateIssueType=zf,i.updateIssueTypeAttachment=Gp,i.updateIssueTypeAttachments=Hp,i.updateIssueTypeFieldValues=SA,i.updateIssueTypeFieldValuesAttachment=HA,i.updateIssueTypeFieldValuesAttachments=WA,i.updateIssueTypeFieldValuesMany=TA,i.updateIssueTypeFields=vA,i.updateIssueTypeFieldsAttachment=nA,i.updateIssueTypeFieldsAttachments=aA,i.updateIssueTypeFieldsMany=VA,i.updateIssueTypeIdentifier=cf,i.updateIssueTypeIdentifierValue=If,i.updateIssueTypeIdentifierValues=Of,i.updateIssueTypeIdentifiers=df,i.updateIssueTypeStatus=Yf,i.updateIssueTypeStatuses=Zf,i.updateIssueTypes=jf,i.updateIssueUpdate=aS,i.updateIssueUpdates=cS,i.updateIssues=Bp,i.updateOrganization=NS,i.updateOrganizationAccess=RS,i.updateOrganizationAccesses=wS,i.updateOrganizations=kS,i.updateProject=QT,i.updateProjectAccess=uT,i.updateProjectAccesses=lT,i.updateProjectAttachment=PT,i.updateProjectAttachments=FT,i.updateProjectFile=DT,i.updateProjectFiles=qT,i.updateProjects=XT,i.updateTeam=bI,i.updateTeamMembership=hI,i.updateTeamMemberships=mI,i.updateTeams=MI,i.updateUser=fS,i.updateUsers=AS,i.useSelectorBuilder=TO,i.userReducer=TS,i.userSlice=yn,i.uuidObj=F,i.uuidObjSortFn=Yt,i.uuidSortFn=It,i.versioningReducer=jI,i.versioningSlice=zI,Object.defineProperty(i,Symbol.toStringTag,{value:"Module"})});
|
|
13
|
+
external URLs and therefore not prepended with VITE_API_URL.`;throw new Error(m)}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:Xa(e),size:e.size};return await this.client.files.addCache(e),a}}class ak extends M{constructor(){super(...arguments);p(this,"name","Form Identifier");p(this,"url","/form-identifiers");p(this,"actions",{addOne:vp,addMany:Ep,setOne:Vp,setMany:Wp,updateOne:Bp,updateMany:zp,deleteOne:Dp,deleteMany:qp,initialize:kp});p(this,"selectors",{selectById:$p,selectByIds:Cp})}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=I({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const m=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 m.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,m]}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);p(this,"name","Form Identifier Value");p(this,"url","/form-identifier-values");p(this,"actions",{addOne:Hp,addMany:Gp,setOne:Kp,setMany:Yp,updateOne:Jp,updateMany:Zp,deleteOne:Qp,deleteMany:Xp,initialize:Np});p(this,"selectors",{selectById:em,selectByIds:tm})}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=I({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const m=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 m.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,m]}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);p(this,"name","Form Revision Attachment");p(this,"url","/form-revision-attachments");p(this,"actions",{addOne:am,addMany:cm,setOne:rm,setMany:dm,updateOne:lm,updateMany:um,deleteOne:om,deleteMany:hm,initialize:nm});p(this,"selectors",{selectById:mm,selectByIds:fm})}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 I({...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);p(this,"name","Form Revision");p(this,"url","/form-revisions");p(this,"actions",{addOne:wm,addMany:Ci,setOne:Tm,setMany:Im,updateOne:Om,updateMany:Fm,deleteOne:gm,deleteMany:Ui,initialize:Am});p(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(),m=I({...e,created_by:l,submitted_at:u});this.dispatch(a(m));const f=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:b(m),blockers:[e.form],blocks:[m.uuid]});return f.then(O=>{this.dispatch(c(O))}).catch(()=>{this.dispatch(r(m.uuid))}),[m,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);p(this,"name","Form");p(this,"url","/forms");p(this,"actions",{addOne:Em,addMany:Vm,setOne:Wm,setMany:Bm,updateOne:zm,updateMany:Dm,deleteOne:qm,deleteMany:jm,initialize:vm});p(this,"selectors",{selectById:Um,selectByIds:Lm})}add(e){var f;const{store:n}=this.client,{addOne:a,updateOne:c,deleteOne:r}=this.actions,d=new Date().toISOString(),l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,u=I({...e,submitted_at:d,created_by:l});this.dispatch(a(u));const m=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:b(u),blockers:[],blocks:[u.uuid]});return m.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,m]}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 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 form to exist");const u=mf(e)(d),m=Rm(e)(d);this.dispatch(a(e)),this.dispatch(xi(E(u))),this.dispatch(Ui(E(m)));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(Ci(m)),this.dispatch(Xi(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);p(this,"name","Form Submission Attachment");p(this,"url","/form-submission-attachments");p(this,"actions",{addOne:Gm,addMany:Gi,setOne:Km,setMany:Ym,updateOne:Jm,updateMany:Zm,deleteOne:Qm,deleteMany:Ki,initialize:Hm});p(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 I({...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=Zi(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);p(this,"name","Form Submission");p(this,"url","/form-submissions");p(this,"actions",{addOne:rf,addMany:Xi,setOne:af,setMany:cf,updateOne:df,updateMany:lf,deleteOne:uf,deleteMany:xi,initialize:nf});p(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(),m=I({...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(m),blockers:[e.form_revision],blocks:[m.uuid]});return this.dispatch(a(m)),f.then(O=>{this.dispatch(c(O))}).catch(()=>{this.dispatch(r(m.uuid))}),[m,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(m=>{this.dispatch(a(m))}).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(Ki(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(m){throw this.dispatch(c(l)),this.dispatch(Gi(u)),m}}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);p(this,"name","Geo Image");p(this,"url","/geo-images");p(this,"actions",{addOne:Tf,addMany:If,setOne:Af,setMany:wf,updateOne:Of,updateMany:Ff,deleteOne:gf,deleteMany:_f,initialize:Sf});p(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 I({...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(m=>{this.dispatch(a(m))}).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);p(this,"name","Issue Association");p(this,"url","/issue-associations");p(this,"actions",{addOne:zf,addMany:St,setOne:Vf,setMany:Ef,updateOne:Wf,updateMany:Bf,deleteOne:Df,deleteMany:At,initialize:vf});p(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=I({...e,submitted_at:d,created_by:l});this.dispatch(a(u));const m=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 m.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,m]}bulkAdd(e){var f;const{store:n}=this.client,{addMany:a,deleteMany:c,updateMany:r}=this.actions,d=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,l=new Date().toISOString(),u=e.map(y=>I({...y,submitted_at:l,created_by:d}));this.dispatch(a(u));const m=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:{payloads:u.map(y=>b(y)),submitted_at:l},blockers:u.flatMap(y=>[y.associated_issue,...y.issue?[y.issue]:[],...y.asset?[y.asset]:[]]),blocks:E(u)});return m.then(y=>{this.dispatch(r(y))}).catch(()=>{this.dispatch(c(E(u)))}),[u,m]}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);p(this,"name","Issue Attachment");p(this,"url","/issue-attachments");p(this,"actions",{addOne:Jf,addMany:cn,setOne:Zf,setMany:Qf,updateOne:Xf,updateMany:xf,deleteOne:ey,deleteMany:rn,initialize:Yf});p(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 I({...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);p(this,"name","Issue Comment Attachment");p(this,"url","/issue-comment-attachments");p(this,"actions",{addOne:dy,addMany:ly,setOne:uy,setMany:oy,updateOne:hy,updateMany:py,deleteOne:my,deleteMany:fy,initialize:ry});p(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 I({...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);p(this,"name","Issue Comment");p(this,"url","/issue-comments");p(this,"actions",{addOne:Oy,addMany:Fy,setOne:gy,setMany:_y,updateOne:Py,updateMany:by,deleteOne:Ry,deleteMany:My,initialize:Iy});p(this,"selectors",{selectById:ky,selectByIds:vy})}add(e){const{store:n}=this.client,{addOne:a,updateOne:c,deleteOne:r}=this.actions,d=I({...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);p(this,"name","Issue");p(this,"url","/issues");p(this,"actions",{addOne:By,addMany:mn,setOne:zy,setMany:Dy,updateOne:qy,updateMany:jy,deleteOne:$y,deleteMany:fn,initialize:Wy});p(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,m=I({...e,submitted_at:l,created_by:u});this.dispatch(a(m));const f=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:b(m),blockers:[m.project,m.issue_type,m.status],blocks:[m.uuid]});return f.then(O=>{this.dispatch(c(O))}).catch(O=>{throw this.dispatch(r(m.uuid)),O}),[m,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 O=e[y],P=Vn(O)(c);if(!P)throw new Error(`Trying to update issue type status with ${O} which does not exist in store`);l[y]={name:P.name,color:P.color,uuid:P.uuid};break}case $.ASSIGNED_TO:{const O=e[y];if(O===null)l[y]=null;else{const P=hs(O)(c);if(!P)throw new Error(`Trying to update assigned to with ${O} which does not exist in store.`);l[y]={full_name:P.username,id:P.id}}break}}const u=I({created_by:((f=c.userReducer.currentUser)==null?void 0:f.id)??null,submitted_at:new Date().toISOString(),issue:r.uuid,changes:l});this.dispatch(Bn(u));const m=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 m.then(y=>{this.dispatch(n(y))}).catch(()=>{this.dispatch(n(r)),this.dispatch(Dn(u.uuid))}),[d,m]}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 O=0;O<d.length;O++)u.push({...l[O],...e[O]});this.dispatch(c(u));const m=yt(e,Math.min(n??e.length,pt)),f=[];let y=null;for(const O of m){const P=mt.v4(),v=E(O),_=O.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:O},blockers:(y?[y]:[]).concat(v).concat(_),blocks:[P].concat(v)});f.push(k),y=P}return Promise.all(f).then(O=>{this.dispatch(c(O.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),m=Nf(e)(d),f=yO(e)(d),y=sy(e)(d),O=yw(e)(d);this.dispatch(a(e)),this.dispatch(rn(E(y))),this.dispatch(qn(E(O))),this.dispatch(At(E(u))),this.dispatch(At(E(m))),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(cn(y)),this.dispatch(zn(O)),this.dispatch(St(u)),this.dispatch(St(m)),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),m=Lf(e)(d),f=fO(e)(d);this.dispatch(c(e)),this.dispatch(At(E(u))),this.dispatch(At(E(m))),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(m)),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);p(this,"name","Issue Type Attachment");p(this,"url","/issue-type-attachments");p(this,"actions",{addOne:Yy,addMany:Jy,setOne:Zy,setMany:Qy,updateOne:Xy,updateMany:xy,deleteOne:eS,deleteMany:tS,initialize:Ky});p(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 I({...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);p(this,"name","Issue Type Fields Attachment");p(this,"url","/issue-type-fields-attachments");p(this,"actions",{addOne:dS,addMany:lS,setOne:uS,setMany:oS,updateOne:hS,updateMany:pS,deleteOne:mS,deleteMany:fS,initialize:rS});p(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 I({...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);p(this,"name","Issue Type Fields");p(this,"url","/issue-type-fields");p(this,"actions",{addOne:zS,addMany:DS,setOne:qS,setMany:jS,updateOne:$S,updateMany:CS,deleteOne:US,deleteMany:LS,initialize:BS});p(this,"selectors",{selectById:HS,selectByIds:GS})}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=I({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const m=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 m.then(y=>{this.dispatch(c(y))}).catch(y=>{throw this.dispatch(r(u.uuid)),y}),[u,m]}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);p(this,"name","Issue Type Field Values Attachment");p(this,"url","/issue-type-field-values-attachments");p(this,"actions",{addOne:ZS,addMany:Fn,setOne:QS,setMany:XS,updateOne:xS,updateMany:eA,deleteOne:tA,deleteMany:gn,initialize:JS});p(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 I({...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);p(this,"name","Issue Type Field Values");p(this,"url","/issue-type-field-values");p(this,"actions",{addOne:OS,addMany:FS,setOne:gS,setMany:_S,updateOne:PS,updateMany:bS,deleteOne:RS,deleteMany:MS,initialize:IS});p(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(),m=I({...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(m),blockers:[e.issue,e.fields_revision],blocks:[m.uuid]});return this.dispatch(a(m)),f.then(O=>{this.dispatch(c(O))}).catch(()=>{this.dispatch(r(m.uuid))}),[m,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(m=>{this.dispatch(a(m))}).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(gn(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(m){throw this.dispatch(c(l)),this.dispatch(Fn(u)),m}}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);p(this,"name","Issue Type Identifier");p(this,"url","/issue-type-identifiers");p(this,"actions",{addOne:lA,addMany:uA,setOne:oA,setMany:hA,updateOne:pA,updateMany:mA,deleteOne:fA,deleteMany:yA,initialize:dA});p(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=I({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const m=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 m.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,m]}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);p(this,"name","Issue Type Identifier Value");p(this,"url","/issue-type-identifier-values");p(this,"actions",{addOne:FA,addMany:gA,setOne:_A,setMany:PA,updateOne:bA,updateMany:RA,deleteOne:MA,deleteMany:kA,initialize:OA});p(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=I({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const m=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 m.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,m]}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);p(this,"name","Issue Type");p(this,"url","/issue-types");p(this,"actions",{addOne:DA,addMany:qA,setOne:jA,setMany:$A,updateOne:CA,updateMany:UA,deleteOne:LA,deleteMany:NA,initialize:zA});p(this,"selectors",{selectById:GA,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(),m=I({...e,submitted_at:u,created_by:l});this.dispatch(a(m));const f=this.enqueueRequest({method:h.POST,url:`${this.url}/`,payload:b(m),blockers:[],blocks:[m.uuid]});return f.then(O=>{this.dispatch(c(O))}).catch(()=>{this.dispatch(r(m.uuid))}),[m,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(m=>{this.dispatch(a(m))}).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(fn(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(m){throw this.dispatch(c(l)),this.dispatch(mn(u)),m}}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);p(this,"name","Issue Type Status");p(this,"url","/issue-type-statuses");p(this,"actions",{addOne:QA,addMany:XA,setOne:xA,setMany:ew,updateOne:tw,updateMany:sw,deleteOne:iw,deleteMany:nw,initialize:ZA});p(this,"selectors",{selectById:Vn,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=I({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const m=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 m.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,m]}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);p(this,"name","Issue Update");p(this,"url","/issue-updates");p(this,"actions",{addOne:Bn,addMany:zn,setOne:uw,setMany:ow,updateOne:hw,updateMany:pw,deleteOne:Dn,deleteMany:qn,initialize:lw});p(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);p(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(zh(!1)),this.clearTokens(),this.dispatch(T()),this.dispatch(T())}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);p(this,"name","Organization Access");p(this,"url","/organization-accesses");p(this,"actions",{addOne:vw,addMany:Ew,setOne:Vw,setMany:Ww,updateOne:Bw,updateMany:zw,deleteOne:Dw,deleteMany:qw,initialize:kw});p(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(Ln(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(m){throw this.dispatch(c(l)),this.dispatch(Un(u)),m}}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);p(this,"name","Organization");p(this,"url","/organizations");p(this,"actions",{addOne:Yw,addMany:Kw,setOne:Gw,setMany:Hw,updateOne:Zw,updateMany:Jw,deleteOne:Qw,deleteMany:Xw,initialize:Nw});p(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);p(this,"name","Project Access");p(this,"url","/project-accesses");p(this,"actions",{addOne:hT,addMany:pT,setOne:mT,setMany:fT,updateOne:yT,updateMany:ST,deleteOne:AT,deleteMany:wT,initialize:oT});p(this,"selectors",{selectById:IT,selectByIds:OT})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=I({...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(m=>{this.dispatch(c(m))}).catch(m=>{throw this.dispatch(r(d.uuid)),m}),[d,l]}bulkAdd(e){var m;const{store:n}=this.client,{addMany:a,deleteMany:c,updateMany:r}=this.actions,d=((m=n.getState().userReducer.currentUser)==null?void 0:m.id)??null,l=e.map(f=>I({...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);p(this,"name","Project Attachment");p(this,"url","/project-attachments");p(this,"actions",{addOne:_T,addMany:PT,setOne:bT,setMany:RT,updateOne:MT,updateMany:kT,deleteOne:vT,deleteMany:ET,initialize:gT});p(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 I({...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);p(this,"name","Project File");p(this,"url","/project-files");p(this,"actions",{addOne:CT,addMany:UT,setOne:jT,setMany:$T,updateOne:LT,updateMany:NT,deleteOne:HT,deleteMany:GT,initialize:qT});p(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 I({...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(m=>{this.dispatch(a(m))}).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);p(this,"name","Project");p(this,"url","/projects");p(this,"actions",{addOne:iI,addMany:sI,setOne:tI,setMany:eI,updateOne:aI,updateMany:nI,deleteOne:cI,deleteMany:rI,initialize:xT});p(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);p(this,"name","Team Membership");p(this,"url","/team-memberships");p(this,"actions",{addOne:fI,addMany:yI,setOne:SI,setMany:AI,updateOne:wI,updateMany:TI,deleteOne:II,deleteMany:OI,initialize:mI});p(this,"selectors",{selectById:_I,selectByIds:PI})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=I({...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(m=>{this.dispatch(c(m))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}bulkAdd(e){var m;const{store:n}=this.client,{addMany:a,setMany:c,deleteMany:r}=this.actions,d=((m=n.getState().userReducer.currentUser)==null?void 0:m.id)??null,l=e.map(f=>I({...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);p(this,"name","Team");p(this,"url","/teams");p(this,"actions",{addOne:MI,addMany:kI,setOne:vI,setMany:EI,updateOne:VI,updateMany:WI,deleteOne:BI,deleteMany:zI,initialize:RI});p(this,"selectors",{selectById:qI,selectByIds:jI})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=I({...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(m=>{this.dispatch(c(m))}).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);p(this,"name","User");p(this,"url","/user");p(this,"actions",{addOne:Un,addMany:Ow,setOne:Iw,setMany:Tw,updateOne:gw,updateMany:Fw,deleteOne:Ln,deleteMany:_w,initialize:ww});p(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);p(this,"name","Workflow");p(this,"url","/workflows");p(this,"actions",{addOne:HI,addMany:GI,setOne:KI,setMany:YI,updateOne:JI,updateMany:ZI,deleteOne:QI,deleteMany:XI,initialize:NI});p(this,"selectors",{selectById:eO,selectByIds:tO})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=I({...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(m=>{this.dispatch(c(m))}).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(m){throw this.dispatch(c(l)),this.dispatch(Dt(u)),m}}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);p(this,"name","Workflow Issue Link");p(this,"url","/workflow-issue-links");p(this,"actions",{addOne:aO,addMany:Dt,setOne:cO,setMany:rO,updateOne:dO,updateMany:lO,deleteOne:uO,deleteMany:qt,initialize:nO});p(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=I({...e,submitted_at:d,created_by:l});this.dispatch(a(u));const m=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 m.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,m]}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);p(this,"name","Workflow Step Assignee");p(this,"url","/workflow-step-assignees");p(this,"actions",{addOne:TO,addMany:IO,setOne:OO,setMany:FO,updateOne:gO,updateMany:_O,deleteOne:PO,deleteMany:bO,initialize:wO});p(this,"selectors",{selectById:MO,selectByIds:kO})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=I({...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(m=>{this.dispatch(c(m))}).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=>I({...y,created_by:d,submitted_at:l}));this.dispatch(a(u));const m=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 m.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(E(u)))}),[u,m]}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);p(this,"name","Workflow Step Comment");p(this,"url","/workflow-step-comments");p(this,"actions",{addOne:WO,addMany:BO,setOne:zO,setMany:DO,updateOne:qO,updateMany:jO,deleteOne:$O,deleteMany:CO,initialize:VO});p(this,"selectors",{selectById:LO,selectByIds:NO})}add(e){var u;const{store:n}=this.client,{addOne:a,updateOne:c,deleteOne:r}=this.actions,d=I({...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(m=>{this.dispatch(c(m))}).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);p(this,"name","Workflow Step Default Assignee");p(this,"url","/workflow-step-default-assignees");p(this,"actions",{addOne:YO,addMany:JO,setOne:ZO,setMany:QO,updateOne:XO,updateMany:xO,deleteOne:eF,deleteMany:tF,initialize:KO});p(this,"selectors",{selectById:iF,selectByIds:nF})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=I({...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(m=>{this.dispatch(c(m))}).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 Hk extends M{constructor(){super(...arguments);p(this,"name","Workflow Step Default Reviewer");p(this,"url","/workflow-step-default-reviewers");p(this,"actions",{addOne:dF,addMany:lF,setOne:uF,setMany:oF,updateOne:hF,updateMany:pF,deleteOne:mF,deleteMany:fF,initialize:rF});p(this,"selectors",{selectById:SF,selectByIds:AF})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=I({...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(m=>{this.dispatch(c(m))}).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 Gk extends It{constructor(){super(...arguments);p(this,"name","Workflow Step Event");p(this,"url","/workflow-step-events");p(this,"actions",{addOne:OF,addMany:FF,setOne:gF,setMany:_F,updateOne:PF,updateMany:bF,deleteOne:RF,deleteMany:MF,initialize:IF});p(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);p(this,"name","Workflow Step Fields Attachment");p(this,"url","/workflow-step-fields-attachments");p(this,"actions",{addOne:zF,addMany:ma,setOne:DF,setMany:qF,updateOne:jF,updateMany:$F,deleteOne:CF,deleteMany:fa,initialize:BF});p(this,"selectors",{selectById:NF,selectByIds:HF})}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 I({...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);p(this,"name","Workflow Step Fields");p(this,"url","/workflow-step-fields");p(this,"actions",{addOne:JF,addMany:ZF,setOne:QF,setMany:XF,updateOne:xF,updateMany:eg,deleteOne:tg,deleteMany:sg,initialize:YF});p(this,"selectors",{selectById:ng,selectByIds:ag})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=I({...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(m=>{this.dispatch(c(m))}).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(fa(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(m){throw this.dispatch(c(l)),this.dispatch(ma(u)),m}}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);p(this,"name","Workflow Step Field Values Attachment");p(this,"url","/workflow-step-field-values-attachments");p(this,"actions",{addOne:lg,addMany:wa,setOne:ug,setMany:og,updateOne:hg,updateMany:pg,deleteOne:mg,deleteMany:Ta,initialize:dg});p(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 I({...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);p(this,"name","Workflow Step Field Values Review Request");p(this,"url","/workflow-step-field-values-review-requests");p(this,"actions",{addOne:zg,addMany:ga,setOne:Dg,setMany:qg,updateOne:jg,updateMany:$g,deleteOne:Cg,deleteMany:_a,initialize:Bg});p(this,"selectors",{selectById:Lg,selectByIds:Ng})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=I({...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(m=>{this.dispatch(c(m))}).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);p(this,"name","Workflow Step Field Values Review");p(this,"url","/workflow-step-field-values-reviews");p(this,"actions",{addOne:Jg,addMany:ba,setOne:Zg,setMany:Qg,updateOne:Xg,updateMany:xg,deleteOne:e_,deleteMany:Ra,initialize:Yg});p(this,"selectors",{selectById:s_,selectByIds:i_})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=I({...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(m=>{this.dispatch(c(m))}).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);p(this,"name","Workflow Step Field Values");p(this,"url","/workflow-step-field-values");p(this,"actions",{addOne:Og,addMany:Fg,setOne:gg,setMany:_g,updateOne:Pg,updateMany:bg,deleteOne:Rg,deleteMany:Mg,initialize:Ig});p(this,"selectors",{selectById:vg,selectByIds:Eg})}add(e){var m;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=n.getState(),l=I({...e,created_by:((m=d.userReducer.currentUser)==null?void 0:m.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(m=>{this.dispatch(a(m))}).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),m=n_(e)(d),f=Hg(e)(d);this.dispatch(a(e)),this.dispatch(Ta(E(u))),this.dispatch(Ra(E(m))),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(c(l)),this.dispatch(wa(u)),this.dispatch(ba(m)),this.dispatch(ga(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);p(this,"name","Workflow Step Reviewer");p(this,"url","/workflow-step-reviewers");p(this,"actions",{addOne:d_,addMany:l_,setOne:u_,setMany:o_,updateOne:h_,updateMany:p_,deleteOne:m_,deleteMany:f_,initialize:r_});p(this,"selectors",{selectById:S_,selectByIds:A_})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=I({...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(m=>{this.dispatch(c(m))}).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=>I({...y,created_by:d,submitted_at:l}));this.dispatch(a(u));const m=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 m.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(u.map(y=>y.uuid)))}),[u,m]}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);p(this,"name","Workflow Step");p(this,"url","/workflow-steps");p(this,"actions",{addOne:O_,addMany:F_,setOne:g_,setMany:__,updateOne:P_,updateMany:b_,deleteOne:R_,deleteMany:M_,initialize:I_});p(this,"selectors",{selectById:v_,selectByIds:E_})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=I({...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(m=>{this.dispatch(c(m))}).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);p(this,"name","Workflow Type");p(this,"url","/workflow-types");p(this,"actions",{addOne:z_,addMany:D_,setOne:q_,setMany:j_,updateOne:$_,updateMany:C_,deleteOne:U_,deleteMany:L_,initialize:B_});p(this,"selectors",{selectById:H_,selectByIds:G_})}add(e){var m;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=n.getState(),l=I({...e,created_by:((m=d.userReducer.currentUser)==null?void 0:m.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 Da(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:m,queryParams:f,attachmentHash:y,isExternalUrl:O,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.`);!O&&!_.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)}}[m];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:Ba.includes(As)})}finally{a==null||a.removeEventListener("abort",q)}}class sv{constructor(s){p(this,"store");this.store=s}_performRequest(s,e,n,a){const c=new Ts,r={...e,uuid:e.uuid??mt.v4()};return Da(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 m=new C({message:"Could not get a response from the server.",response:u,discard:!0});a.reject(m)}},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(){p(this,"graph");p(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 qa=null;function Ot(){const t=Mt();if(!t)return console.warn("Client store not set; cannot get outbox coordinator yet."),null;if(qa)return qa;const s=t.getState().offline.outbox,e=Rt._fromOutbox(s);return qa=e,e}const iv=(t,s)=>{const e=new s(t);return hP(e),uP(t),e};class nv{constructor(s){p(this,"_all");p(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 ja{constructor(){p(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 ja{async run(s){return super.run(s)}}class fP extends ja{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=Ga,i.AssetTypeAttachmentService=HM,i.AssetTypeFieldValuesAttachmentService=YM,i.AssetTypeFieldValuesService=JM,i.AssetTypeFieldsAttachmentService=GM,i.AssetTypeFieldsService=KM,i.AssetTypeIdentifierService=ZM,i.AssetTypeIdentifierValueService=QM,i.AssetTypeService=XM,i.AssetTypeStatusService=xM,i.AttachmentModel=Ka,i.BaseApiService=Tt,i.BaseModelApiService=It,i.BaseOfflineFileModelApiService=D,i.BaseOfflineModelApiService=M,i.BaseSDK=sv,i.COMMON_AUTO_FIELDS=ic,i.DEFAULT_ISSUE_PRIORITY=MP,i.DEFAULT_PAGE_SIZE=J_,i.DEFAULT_WORKFLOW_STATUS=EP,i.DISCARD_HTTP_STATUSES=Ba,i.DeferredPromise=Ts,i.DocumentAttachmentService=ek,i.DocumentService=tk,i.EMPTY_ARRAY=La,i.EMPTY_OBJECT=Na,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=Ya,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=Za,i.OfflineAnalyticsMiddleware=mP,i.OfflineMiddleware=ja,i.OrganizationAccessLevel=Ha,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=T,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=Hk,i.WorkflowStepEventService=Gk,i.WorkflowStepEventType=Ja,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=Vl,i.addAssetAttachment=Ac,i.addAssetAttachments=Rs,i.addAssetProcedure=Gr,i.addAssetProcedureStep=Il,i.addAssetProcedureStepFieldValues=al,i.addAssetProcedureStepFieldValuesAttachment=Gd,i.addAssetProcedureStepFieldValuesAttachments=Qs,i.addAssetProcedureStepFieldValuesMany=cl,i.addAssetProcedureStepFields=Vd,i.addAssetProcedureStepFieldsAttachment=wd,i.addAssetProcedureStepFieldsAttachments=Td,i.addAssetProcedureStepFieldsMany=Wd,i.addAssetProcedureSteps=Ol,i.addAssetProcedureType=ad,i.addAssetProcedureTypeAttachment=vc,i.addAssetProcedureTypeAttachments=Ec,i.addAssetProcedureTypeFieldValues=Er,i.addAssetProcedureTypeFieldValuesAttachment=wr,i.addAssetProcedureTypeFieldValuesAttachments=Ds,i.addAssetProcedureTypeFieldValuesMany=Vr,i.addAssetProcedureTypeFields=ar,i.addAssetProcedureTypeFieldsAttachment=Hc,i.addAssetProcedureTypeFieldsAttachments=Gc,i.addAssetProcedureTypeFieldsMany=cr,i.addAssetProcedureTypes=cd,i.addAssetProcedures=Us,i.addAssetStage=lu,i.addAssetStageCompletion=Gl,i.addAssetStageCompletions=Kl,i.addAssetStages=uu,i.addAssetType=oh,i.addAssetTypeAttachment=Tu,i.addAssetTypeAttachments=oi,i.addAssetTypeFieldValues=Io,i.addAssetTypeFieldValuesAttachment=ro,i.addAssetTypeFieldValuesAttachments=Ai,i.addAssetTypeFieldValuesMany=Oo,i.addAssetTypeFields=Ku,i.addAssetTypeFieldsAttachment=Vu,i.addAssetTypeFieldsAttachments=Wu,i.addAssetTypeFieldsMany=Yu,i.addAssetTypeIdentifier=Bo,i.addAssetTypeIdentifierValue=Jo,i.addAssetTypeIdentifierValues=Zo,i.addAssetTypeIdentifiers=zo,i.addAssetTypeStatus=Fh,i.addAssetTypeStatuses=gh,i.addAssetTypes=hh,i.addAssets=ni,i.addConversation=hc,i.addConversations=sb,i.addDocument=ep,i.addDocumentAttachment=$h,i.addDocumentAttachments=Ch,i.addDocuments=tp,i.addEmailDomain=mp,i.addEmailDomains=fp,i.addForm=Em,i.addFormIdentifier=vp,i.addFormIdentifierValue=Hp,i.addFormIdentifierValues=Gp,i.addFormIdentifiers=Ep,i.addFormRevision=wm,i.addFormRevisionAttachment=am,i.addFormRevisionAttachments=cm,i.addFormRevisions=Ci,i.addFormSubmission=rf,i.addFormSubmissionAttachment=Gm,i.addFormSubmissionAttachments=Gi,i.addFormSubmissions=Xi,i.addForms=Vm,i.addGeoImage=Tf,i.addGeoImages=If,i.addIssue=By,i.addIssueAssociation=zf,i.addIssueAssociations=St,i.addIssueAttachment=Jf,i.addIssueAttachments=cn,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=Fn,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=Bn,i.addIssueUpdates=zn,i.addIssues=mn,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=Un,i.addUsers=Ow,i.addWorkflow=HI,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=wa,i.addWorkflowStepFieldValuesMany=Fg,i.addWorkflowStepFieldValuesReview=Jg,i.addWorkflowStepFieldValuesReviewRequest=zg,i.addWorkflowStepFieldValuesReviewRequests=ga,i.addWorkflowStepFieldValuesReviews=ba,i.addWorkflowStepFields=JF,i.addWorkflowStepFieldsAttachment=zF,i.addWorkflowStepFieldsAttachments=ma,i.addWorkflowStepFieldsMany=ZF,i.addWorkflowStepReviewer=d_,i.addWorkflowStepReviewers=l_,i.addWorkflowSteps=F_,i.addWorkflowType=z_,i.addWorkflowTypes=D_,i.addWorkflows=GI,i.agentsReducer=fc,i.agentsSlice=_s,i.areArraysEqual=zP,i.assetAttachmentReducer=Rc,i.assetAttachmentSlice=bs,i.assetProcedureReducer=Xr,i.assetProcedureSlice=Cs,i.assetProcedureStepFieldValuesAttachmentReducer=sl,i.assetProcedureStepFieldValuesAttachmentSlice=Zs,i.assetProcedureStepFieldValuesReducer=yl,i.assetProcedureStepFieldValuesSlice=ei,i.assetProcedureStepFieldsAttachmentReducer=kd,i.assetProcedureStepFieldsAttachmentSlice=Gs,i.assetProcedureStepFieldsReducer=Ld,i.assetProcedureStepFieldsSlice=Ys,i.assetProcedureStepReducer=bl,i.assetProcedureStepSlice=ti,i.assetProcedureTypeAttachmentReducer=jc,i.assetProcedureTypeAttachmentSlice=vs,i.assetProcedureTypeFieldValuesAttachmentReducer=_r,i.assetProcedureTypeFieldValuesAttachmentSlice=zs,i.assetProcedureTypeFieldValuesReducer=$r,i.assetProcedureTypeFieldValuesSlice=$s,i.assetProcedureTypeFieldsAttachmentReducer=xc,i.assetProcedureTypeFieldsAttachmentSlice=Vs,i.assetProcedureTypeFieldsReducer=pr,i.assetProcedureTypeFieldsSlice=Bs,i.assetProcedureTypeReducer=pd,i.assetProcedureTypeSlice=Ns,i.assetReducer=Ll,i.assetSlice=ii,i.assetStageCompletionReducer=eu,i.assetStageCompletionSlice=ci,i.assetStageReducer=fu,i.assetStageSlice=ri,i.assetTypeAttachmentReducer=ku,i.assetTypeAttachmentSlice=ui,i.assetTypeFieldValuesAttachmentReducer=Ao,i.assetTypeFieldValuesAttachmentSlice=Si,i.assetTypeFieldValuesReducer=Eo,i.assetTypeFieldValuesSlice=Ii,i.assetTypeFieldsAttachmentReducer=Nu,i.assetTypeFieldsAttachmentSlice=mi,i.assetTypeFieldsReducer=no,i.assetTypeFieldsSlice=yi,i.assetTypeIdentifierReducer=Go,i.assetTypeIdentifierSlice=Oi,i.assetTypeIdentifierValueReducer=ch,i.assetTypeIdentifierValueSlice=gi,i.assetTypeReducer=Th,i.assetTypeSlice=_i,i.assetTypeStatusReducer=Wh,i.assetTypeStatusSlice=bi,i.assetTypeStatusSortFn=cc,i.authReducer=Dh,i.authSlice=is,i.baseReducer=pM,i.baseReducers=Wa,i.clearTokens=$b,i.createModelAdapter=F,i.createOfflineAction=nT,i.createPayload=b,i.createSelectionAdapter=VP,i.deleteAsset=zl,i.deleteAssetAttachment=Fc,i.deleteAssetAttachments=Ms,i.deleteAssetProcedure=Jr,i.deleteAssetProcedureStep=_l,i.deleteAssetProcedureStepFieldValues=ol,i.deleteAssetProcedureStepFieldValuesAttachment=Qd,i.deleteAssetProcedureStepFieldValuesAttachments=Xs,i.deleteAssetProcedureStepFieldValuesMany=hl,i.deleteAssetProcedureStepFields=jd,i.deleteAssetProcedureStepFieldsAttachment=_d,i.deleteAssetProcedureStepFieldsAttachments=Pd,i.deleteAssetProcedureStepFieldsMany=$d,i.deleteAssetProcedureSteps=Pl,i.deleteAssetProcedureType=ld,i.deleteAssetProcedureTypeAttachment=Dc,i.deleteAssetProcedureTypeAttachments=qc,i.deleteAssetProcedureTypeFieldValues=qr,i.deleteAssetProcedureTypeFieldValuesAttachment=gr,i.deleteAssetProcedureTypeFieldValuesAttachments=qs,i.deleteAssetProcedureTypeFieldValuesMany=jr,i.deleteAssetProcedureTypeFields=or,i.deleteAssetProcedureTypeFieldsAttachment=Qc,i.deleteAssetProcedureTypeFieldsAttachments=Xc,i.deleteAssetProcedureTypeFieldsMany=hr,i.deleteAssetProcedureTypes=ud,i.deleteAssetProcedures=Ls,i.deleteAssetStage=pu,i.deleteAssetStageCompletion=Xl,i.deleteAssetStageCompletions=xl,i.deleteAssetStages=mu,i.deleteAssetType=fh,i.deleteAssetTypeAttachment=_u,i.deleteAssetTypeAttachments=hi,i.deleteAssetTypeFieldValues=bo,i.deleteAssetTypeFieldValuesAttachment=po,i.deleteAssetTypeFieldValuesAttachments=wi,i.deleteAssetTypeFieldValuesMany=Ro,i.deleteAssetTypeFields=xu,i.deleteAssetTypeFieldsAttachment=ju,i.deleteAssetTypeFieldsAttachments=$u,i.deleteAssetTypeFieldsMany=eo,i.deleteAssetTypeIdentifier=Co,i.deleteAssetTypeIdentifierValue=th,i.deleteAssetTypeIdentifierValues=sh,i.deleteAssetTypeIdentifiers=Uo,i.deleteAssetTypeStatus=Mh,i.deleteAssetTypeStatuses=kh,i.deleteAssetTypes=yh,i.deleteAssets=ai,i.deleteConversation=ab,i.deleteConversations=cb,i.deleteDocument=cp,i.deleteDocumentAttachment=Gh,i.deleteDocumentAttachments=Kh,i.deleteDocuments=rp,i.deleteEmailDomain=Tp,i.deleteEmailDomains=Ip,i.deleteForm=qm,i.deleteFormIdentifier=Dp,i.deleteFormIdentifierValue=Qp,i.deleteFormIdentifierValues=Xp,i.deleteFormIdentifiers=qp,i.deleteFormRevision=gm,i.deleteFormRevisionAttachment=om,i.deleteFormRevisionAttachments=hm,i.deleteFormRevisions=Ui,i.deleteFormSubmission=uf,i.deleteFormSubmissionAttachment=Qm,i.deleteFormSubmissionAttachments=Ki,i.deleteFormSubmissions=xi,i.deleteForms=jm,i.deleteGeoImage=gf,i.deleteGeoImages=_f,i.deleteIssue=$y,i.deleteIssueAssociation=Df,i.deleteIssueAssociations=At,i.deleteIssueAttachment=ey,i.deleteIssueAttachments=rn,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=gn,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=Dn,i.deleteIssueUpdates=qn,i.deleteIssues=fn,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=HT,i.deleteProjectFiles=GT,i.deleteProjects=rI,i.deleteTeam=BI,i.deleteTeamMembership=II,i.deleteTeamMemberships=OI,i.deleteTeams=zI,i.deleteUser=Ln,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=Ta,i.deleteWorkflowStepFieldValuesMany=Mg,i.deleteWorkflowStepFieldValuesReview=e_,i.deleteWorkflowStepFieldValuesReviewRequest=Cg,i.deleteWorkflowStepFieldValuesReviewRequests=_a,i.deleteWorkflowStepFieldValuesReviews=Ra,i.deleteWorkflowStepFields=tg,i.deleteWorkflowStepFieldsAttachment=CF,i.deleteWorkflowStepFieldsAttachments=fa,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=Qh,i.documentAttachmentSlice=Mi,i.documentSlice=vi,i.documentsReducer=dp,i.downloadFile=NP,i.emailDomainsReducer=_p,i.emailDomainsSlice=Vi,i.emailRegex=XP,i.enqueue=iP,i.enqueueRequest=cT,i.extractResponseFromError=dP,i.fallbackToEmptyArray=A,i.fallbackToEmptyObject=Gt,i.fetchBlobFromObjectUrl=xa,i.fetchFileFromObjectUrl=ec,i.fileReducer=Rp,i.fileSlice=Bi,i.formIdentifierReducer=Up,i.formIdentifierSlice=zi,i.formIdentifierValueReducer=sm,i.formIdentifierValueSlice=qi,i.formReducer=$m,i.formRevisionAttachmentReducer=ym,i.formRevisionAttachmentSlice=ji,i.formRevisionReducer=Mm,i.formRevisionsSlice=$i,i.formSlice=Li,i.formSubmissionAttachmentReducer=tf,i.formSubmissionAttachmentSlice=Hi,i.formSubmissionReducer=ff,i.formSubmissionSlice=Qi,i.geoImageReducer=Mf,i.geoImageSlice=tn,i.getAssetProcedureStepSubTree=ac,i.getAssetProcedureStepTrees=xP,i.getClientSDK=pP,i.getClientStore=Mt,i.getDocumentSubTree=lc,i.getDocumentTrees=eb,i.getFileExtension=Xa,i.getLocalDateString=Qa,i.getLocalRelativeDateString=$P,i.getOutboxCoordinator=Ot,i.getRenamedFile=LP,i.getRequestDescription=w,i.getS3FileKey=UP,i.hashFile=Kt,i.initSDK=iv,i.initializeAssetAttachments=Sc,i.initializeAssetProcedureStepFieldValues=nl,i.initializeAssetProcedureStepFieldValuesAttachments=Hd,i.initializeAssetProcedureStepFields=Ed,i.initializeAssetProcedureStepFieldsAttachments=Ad,i.initializeAssetProcedureSteps=Al,i.initializeAssetProcedureTypeAttachments=kc,i.initializeAssetProcedureTypeFieldValues=vr,i.initializeAssetProcedureTypeFieldValuesAttachments=Ar,i.initializeAssetProcedureTypeFields=nr,i.initializeAssetProcedureTypeFieldsAttachments=Nc,i.initializeAssetProcedureTypes=nd,i.initializeAssetProcedures=Hr,i.initializeAssetStageCompletions=Hl,i.initializeAssetStages=cu,i.initializeAssetTypeAttachments=wu,i.initializeAssetTypeFieldValues=To,i.initializeAssetTypeFieldValuesAttachments=co,i.initializeAssetTypeFields=Gu,i.initializeAssetTypeFieldsAttachments=Eu,i.initializeAssetTypeIdentifierValues=Yo,i.initializeAssetTypeIdentifiers=Wo,i.initializeAssetTypeStatuses=Oh,i.initializeAssetTypes=dh,i.initializeAssets=El,i.initializeConversations=oc,i.initializeDocumentAttachments=jh,i.initializeDocuments=xh,i.initializeEmailDomains=pp,i.initializeFormIdentifierValues=Np,i.initializeFormIdentifiers=kp,i.initializeFormRevisionAttachments=nm,i.initializeFormRevisions=Am,i.initializeFormSubmissionAttachments=Hm,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=HP,i.isObjectUrl=tc,i.isToday=jP,i.issueAssociationReducer=Gf,i.issueAssociationSlice=nn,i.issueAttachmentReducer=ay,i.issueAttachmentSlice=an,i.issueCommentAttachmentReducer=wy,i.issueCommentAttachmentSlice=ln,i.issueCommentReducer=Ey,i.issueCommentSlice=on,i.issueReducer=Hy,i.issueSlice=pn,i.issueTypeAttachmentReducer=aS,i.issueTypeAttachmentSlice=yn,i.issueTypeFieldValuesAttachmentReducer=cA,i.issueTypeFieldValuesAttachmentSlice=On,i.issueTypeFieldValuesReducer=VS,i.issueTypeFieldValuesSlice=Tn,i.issueTypeFieldsAttachmentReducer=wS,i.issueTypeFieldsAttachmentSlice=An,i.issueTypeFieldsReducer=KS,i.issueTypeFieldsSlice=In,i.issueTypeIdentifierReducer=TA,i.issueTypeIdentifierSlice=Pn,i.issueTypeIdentifierValueReducer=WA,i.issueTypeIdentifierValueSlice=Rn,i.issueTypeReducer=YA,i.issueTypeSlice=Mn,i.issueTypeStatusReducer=rw,i.issueTypeStatusSlice=vn,i.issueTypeStatusSortFn=rc,i.issueUpdateReducer=Sw,i.issueUpdateSlice=Wn,i.logOnlyOnce=GP,i.markAsDeleted=rT,i.markForDeletion=FR,i.memoize=Os,i.organizationAccessReducer=jw,i.organizationAccessSlice=Hn,i.organizationReducer=iT,i.organizationSlice=Gn,i.outboxReducer=lT,i.outboxSlice=Kn,i.overmapEnhancer=OM,i.overmapReducer=mM,i.overmapReducers=Y_,i.performRequest=Da,i.performRequestFromAction=aP,i.projectAccessReducer=TT,i.projectAccessSlice=Yn,i.projectAttachmentReducer=zT,i.projectAttachmentSlice=Zn,i.projectFileReducer=QT,i.projectFileSlice=Xn,i.projectReducer=dI,i.projectSlice=xn,i.rehydratedReducer=hI,i.rehydratedSlice=ea,i.restructureSelectorWithArgs=S,i.runMiddleware=SP,i.selectAccessToken=Cb,i.selectAccessesByUserOfProject=_R,i.selectAccessibleProjects=RR,i.selectActiveOrganizationAccess=wR,i.selectAllDocumentAttachments=ki,i.selectAssetAttachmentById=_c,i.selectAssetAttachmentMapping=gc,i.selectAssetAttachments=ks,i.selectAssetAttachmentsByIds=Pc,i.selectAssetById=Cl,i.selectAssetProcedureById=td,i.selectAssetProcedureStepById=Rl,i.selectAssetProcedureStepFieldValues=Vt,i.selectAssetProcedureStepFieldValuesAttachmentById=xd,i.selectAssetProcedureStepFieldValuesAttachments=xs,i.selectAssetProcedureStepFieldValuesAttachmentsByIds=el,i.selectAssetProcedureStepFieldValuesAttachmentsMapping=Xd,i.selectAssetProcedureStepFieldValuesById=ml,i.selectAssetProcedureStepFieldValuesByIds=fl,i.selectAssetProcedureStepFieldValuesMapping=pl,i.selectAssetProcedureStepFieldValuesOfAsset=Ib,i.selectAssetProcedureStepFieldValuesOfAssetProcedure=Ob,i.selectAssetProcedureStepFieldValuesOfAssetProcedureStep=Fb,i.selectAssetProcedureStepFields=Xt,i.selectAssetProcedureStepFieldsAttachmentById=Rd,i.selectAssetProcedureStepFieldsAttachments=Ks,i.selectAssetProcedureStepFieldsAttachmentsByIds=Md,i.selectAssetProcedureStepFieldsAttachmentsMapping=bd,i.selectAssetProcedureStepFieldsById=Cd,i.selectAssetProcedureStepFieldsByIds=Ud,i.selectAssetProcedureStepFieldsMapping=Js,i.selectAssetProcedureStepFieldsOfAssetProcedureStep=Ab,i.selectAssetProcedureStepMapping=xt,i.selectAssetProcedureSteps=si,i.selectAssetProcedureStepsByIds=Ml,i.selectAssetProcedureStepsMappingOfAssetProcedureType=gb,i.selectAssetProcedureStepsOfAssetProcedureType=_b,i.selectAssetProcedureTypeAttachmentById=Cc,i.selectAssetProcedureTypeAttachmentMapping=$c,i.selectAssetProcedureTypeAttachments=Es,i.selectAssetProcedureTypeAttachmentsByIds=Uc,i.selectAssetProcedureTypeById=fd,i.selectAssetProcedureTypeFieldValues=Zt,i.selectAssetProcedureTypeFieldValuesAttachmentById=br,i.selectAssetProcedureTypeFieldValuesAttachments=js,i.selectAssetProcedureTypeFieldValuesAttachmentsByIds=Rr,i.selectAssetProcedureTypeFieldValuesAttachmentsMapping=Pr,i.selectAssetProcedureTypeFieldValuesById=Ur,i.selectAssetProcedureTypeFieldValuesByIds=Lr,i.selectAssetProcedureTypeFieldValuesMapping=Cr,i.selectAssetProcedureTypeFieldValuesOfAsset=pb,i.selectAssetProcedureTypeFields=Jt,i.selectAssetProcedureTypeFieldsAttachmentById=tr,i.selectAssetProcedureTypeFieldsAttachments=Ws,i.selectAssetProcedureTypeFieldsAttachmentsByIds=sr,i.selectAssetProcedureTypeFieldsAttachmentsMapping=er,i.selectAssetProcedureTypeFieldsById=fr,i.selectAssetProcedureTypeFieldsByIds=yr,i.selectAssetProcedureTypeFieldsMapping=mr,i.selectAssetProcedureTypeFieldsOfAssetProcedureType=ob,i.selectAssetProcedureTypes=Hs,i.selectAssetProcedureTypesByIds=yd,i.selectAssetProcedureTypesMapping=md,i.selectAssetProcedureTypesOfOrganization=yb,i.selectAssetProcedures=Qt,i.selectAssetProceduresByIds=sd,i.selectAssetProceduresMapping=xr,i.selectAssetProceduresOfAssetProcedureType=ed,i.selectAssetProceduresOfAssetType=fb,i.selectAssetStageById=yu,i.selectAssetStageCompletionById=iu,i.selectAssetStageCompletionMapping=tu,i.selectAssetStageCompletions=su,i.selectAssetStageCompletionsByIds=nu,i.selectAssetStages=li,i.selectAssetStagesByIds=Su,i.selectAssetStagesMappingOfAssetProcedureType=bb,i.selectAssetStagesOfAssetProcedureType=Rb,i.selectAssetTypeAttachmentById=bu,i.selectAssetTypeAttachmentMapping=Pu,i.selectAssetTypeAttachments=pi,i.selectAssetTypeAttachmentsByIds=Ru,i.selectAssetTypeById=Ah,i.selectAssetTypeFieldValues=ts,i.selectAssetTypeFieldValuesAttachmentById=fo,i.selectAssetTypeFieldValuesAttachments=Ti,i.selectAssetTypeFieldValuesAttachmentsByIds=yo,i.selectAssetTypeFieldValuesAttachmentsMapping=mo,i.selectAssetTypeFieldValuesById=ko,i.selectAssetTypeFieldValuesByIds=vo,i.selectAssetTypeFieldValuesMapping=Mo,i.selectAssetTypeFieldValuesOfAsset=Eb,i.selectAssetTypeFields=Wt,i.selectAssetTypeFieldsAttachmentById=Uu,i.selectAssetTypeFieldsAttachments=fi,i.selectAssetTypeFieldsAttachmentsByIds=Lu,i.selectAssetTypeFieldsAttachmentsMapping=Cu,i.selectAssetTypeFieldsById=so,i.selectAssetTypeFieldsByIds=io,i.selectAssetTypeFieldsMapping=to,i.selectAssetTypeFieldsOfAssetType=kb,i.selectAssetTypeIdentifierById=No,i.selectAssetTypeIdentifierMapping=Lo,i.selectAssetTypeIdentifierValueById=nh,i.selectAssetTypeIdentifierValueMapping=ih,i.selectAssetTypeIdentifierValues=ss,i.selectAssetTypeIdentifierValuesByIds=ah,i.selectAssetTypeIdentifierValuesOfAsset=Bb,i.selectAssetTypeIdentifierValuesOfIdentifier=zb,i.selectAssetTypeIdentifiers=Fi,i.selectAssetTypeIdentifiersByIds=Ho,i.selectAssetTypeIdentifiersOfAssetType=Wb,i.selectAssetTypeStatusById=Eh,i.selectAssetTypeStatusMapping=vh,i.selectAssetTypeStatuses=Ri,i.selectAssetTypeStatusesByIds=Vh,i.selectAssetTypeStatusesOfAssetType=qb,i.selectAssetTypeValuesOfAssetType=Vb,i.selectAssetTypes=Pi,i.selectAssetTypesByIds=wh,i.selectAssetTypesMapping=Sh,i.selectAssetTypesOfOrganization=Db,i.selectAssets=es,i.selectAssetsByIds=Ul,i.selectAssetsMapping=jl,i.selectAssetsOfAssetType=$l,i.selectAssetsOfProject=Pb,i.selectAttachmentsOfAsset=bc,i.selectAttachmentsOfAssetProcedureStepFieldValues=tl,i.selectAttachmentsOfAssetProcedureStepFields=Sb,i.selectAttachmentsOfAssetProcedureType=lb,i.selectAttachmentsOfAssetProcedureTypeFieldValues=Mr,i.selectAttachmentsOfAssetProcedureTypeFields=ub,i.selectAttachmentsOfAssetType=Mu,i.selectAttachmentsOfAssetTypeFieldValues=So,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=kl,i.selectDescendantsOfDocument=op,i.selectDocumentAttachmentById=Jh,i.selectDocumentAttachmentMapping=Yh,i.selectDocumentAttachmentsByIds=Zh,i.selectDocumentById=lp,i.selectDocuments=ns,i.selectDocumentsByIds=up,i.selectDocumentsMapping=Ei,i.selectEmailDomainById=Fp,i.selectEmailDomains=Wi,i.selectEmailDomainsAsMapping=Op,i.selectEmailDomainsByIds=gp,i.selectEmailDomainsOfOrganization=Gb,i.selectFieldValuesOfAssetProcedure=mb,i.selectFormById=Um,i.selectFormIdentifierById=$p,i.selectFormIdentifierMapping=jp,i.selectFormIdentifierValueById=em,i.selectFormIdentifierValueMapping=xp,i.selectFormIdentifierValues=as,i.selectFormIdentifierValuesByIds=tm,i.selectFormIdentifierValuesOfFormSubmission=Qb,i.selectFormIdentifierValuesOfIdentifier=Xb,i.selectFormIdentifiers=Di,i.selectFormIdentifiersByIds=Cp,i.selectFormIdentifiersOfForm=Zb,i.selectFormMapping=Cm,i.selectFormRevisionAttachmentById=mm,i.selectFormRevisionAttachments=pm,i.selectFormRevisionAttachmentsByIds=fm,i.selectFormRevisionAttachmentsMapping=cs,i.selectFormRevisionById=Pm,i.selectFormRevisionMapping=_m,i.selectFormRevisions=rs,i.selectFormRevisionsByIds=bm,i.selectFormRevisionsOfForm=Rm,i.selectFormSubmissionAttachemntsByIds=Zi,i.selectFormSubmissionAttachmentById=Xm,i.selectFormSubmissionAttachments=Ji,i.selectFormSubmissionAttachmentsByIds=xm,i.selectFormSubmissionAttachmentsMapping=Yi,i.selectFormSubmissionById=hf,i.selectFormSubmissions=en,i.selectFormSubmissionsByIds=pf,i.selectFormSubmissionsMapping=of,i.selectFormSubmissionsOfForm=mf,i.selectForms=Ni,i.selectFormsByIds=Lm,i.selectFormsOfOrganization=tR,i.selectGeoImageById=bf,i.selectGeoImageMapping=Pf,i.selectGeoImages=sn,i.selectGeoImagesByIds=Rf,i.selectGeoImagesOfProject=sR,i.selectIsLoggedIn=Ub,i.selectIssueAssociationById=jf,i.selectIssueAssociationMapping=qf,i.selectIssueAssociations=wt,i.selectIssueAssociationsByIds=$f,i.selectIssueAssociationsOfAsset=Hf,i.selectIssueAssociationsOfIssue=Nf,i.selectIssueAssociationsOfIssues=Lf,i.selectIssueAssociationsToIssue=Cf,i.selectIssueAssociationsToIssues=Uf,i.selectIssueAttachmentById=iy,i.selectIssueAttachmentMapping=ty,i.selectIssueAttachments=dn,i.selectIssueAttachmentsByIds=ny,i.selectIssueById=Uy,i.selectIssueCommentAttachmentById=Sy,i.selectIssueCommentAttachmentMapping=yy,i.selectIssueCommentAttachments=un,i.selectIssueCommentAttachmentsByIds=Ay,i.selectIssueCommentById=ky,i.selectIssueCommentMapping=hn,i.selectIssueCommentsByIds=vy,i.selectIssueMapping=Cy,i.selectIssueTypeAttachmentById=iS,i.selectIssueTypeAttachmentMapping=sS,i.selectIssueTypeAttachments=Sn,i.selectIssueTypeAttachmentsByIds=nS,i.selectIssueTypeById=GA,i.selectIssueTypeFieldValues=ls,i.selectIssueTypeFieldValuesAttachmentById=iA,i.selectIssueTypeFieldValuesAttachments=_n,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=wn,i.selectIssueTypeFieldsAttachmentsByIds=AS,i.selectIssueTypeFieldsAttachmentsMapping=yS,i.selectIssueTypeFieldsById=HS,i.selectIssueTypeFieldsByIds=GS,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=bn,i.selectIssueTypeIdentifiersByIds=wA,i.selectIssueTypeIdentifiersOfIssueType=hR,i.selectIssueTypeMapping=HA,i.selectIssueTypeStatusById=Vn,i.selectIssueTypeStatusMapping=aw,i.selectIssueTypeStatuses=En,i.selectIssueTypeStatusesByIds=cw,i.selectIssueTypeStatusesOfIssueType=yR,i.selectIssueTypeValuesOfIssueType=oR,i.selectIssueTypes=kn,i.selectIssueTypesByIds=KA,i.selectIssueTypesOfOrganization=fR,i.selectIssueUpdateById=mw,i.selectIssueUpdateMapping=jn,i.selectIssueUpdates=$n,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=Hb,i.selectOrganizations=eT,i.selectOrganizationsByIds=sT,i.selectOrganizationsMapping=xw,i.selectProjectAccessById=IT,i.selectProjectAccessMapping=Jn,i.selectProjectAccesses=zt,i.selectProjectAccessesByIds=OT,i.selectProjectAccessesOfProject=gR,i.selectProjectAttachmentById=WT,i.selectProjectAttachmentMapping=VT,i.selectProjectAttachments=Qn,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=Hg,i.selectReviewsOfWorkflowStepFieldValues=n_,i.selectStageMapping=di,i.selectTeamById=qI,i.selectTeamMembershipById=_I,i.selectTeamMemberships=fs,i.selectTeamMembershipsByIds=PI,i.selectTeamMembershipsMapping=gI,i.selectTeams=ia,i.selectTeamsByIds=jI,i.selectTeamsMapping=DI,i.selectTeamsOfOrganization=BR,i.selectUploadUrl=Jb,i.selectUserById=hs,i.selectUsers=os,i.selectUsersByIds=Rw,i.selectUsersMapping=Nn,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=HR,i.selectWorkflowStepCommentsOfWorkflowStep=NR,i.selectWorkflowStepDefaultAssigneeById=iF,i.selectWorkflowStepDefaultAssignees=la,i.selectWorkflowStepDefaultAssigneesByIds=nF,i.selectWorkflowStepDefaultAssigneesMapping=sF,i.selectWorkflowStepDefaultAssigneesOfWorkflowStep=GR,i.selectWorkflowStepDefaultReviewerById=SF,i.selectWorkflowStepDefaultReviewers=oa,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=Ia,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=ya,i.selectWorkflowStepFieldsAttachmentsByIds=HF,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=va,i.selectWorkflowStepsByIds=E_,i.selectWorkflowStepsMapping=k_,i.selectWorkflowStepsOfWorkflowType=oM,i.selectWorkflowTypeById=H_,i.selectWorkflowTypeMapping=N_,i.selectWorkflowTypes=Va,i.selectWorkflowTypesByIds=G_,i.selectWorkflowTypesOfOrganization=hM,i.selectWorkflows=ys,i.selectWorkflowsByIds=tO,i.selectWorkflowsOfProject=DR,i.selectWorkflowsOfWorkflowType=qR,i.setAsset=Dl,i.setAssetAttachment=wc,i.setAssetAttachments=Tc,i.setAssetProcedure=Zr,i.setAssetProcedureStep=wl,i.setAssetProcedureStepFieldValues=rl,i.setAssetProcedureStepFieldValuesAttachment=Kd,i.setAssetProcedureStepFieldValuesAttachments=Yd,i.setAssetProcedureStepFieldValuesMany=dl,i.setAssetProcedureStepFields=Bd,i.setAssetProcedureStepFieldsAttachment=Id,i.setAssetProcedureStepFieldsAttachments=Od,i.setAssetProcedureStepFieldsMany=zd,i.setAssetProcedureSteps=Tl,i.setAssetProcedureType=od,i.setAssetProcedureTypeAttachment=Vc,i.setAssetProcedureTypeAttachments=Wc,i.setAssetProcedureTypeFieldValues=Wr,i.setAssetProcedureTypeFieldValuesAttachment=Tr,i.setAssetProcedureTypeFieldValuesAttachments=Ir,i.setAssetProcedureTypeFieldValuesMany=Br,i.setAssetProcedureTypeFields=rr,i.setAssetProcedureTypeFieldsAttachment=Kc,i.setAssetProcedureTypeFieldsAttachments=Yc,i.setAssetProcedureTypeFieldsMany=dr,i.setAssetProcedureTypes=hd,i.setAssetProcedures=Qr,i.setAssetStage=ru,i.setAssetStageCompletion=Yl,i.setAssetStageCompletions=Jl,i.setAssetStages=du,i.setAssetType=lh,i.setAssetTypeAttachment=Iu,i.setAssetTypeAttachments=Ou,i.setAssetTypeFieldValues=Fo,i.setAssetTypeFieldValuesAttachment=lo,i.setAssetTypeFieldValuesAttachments=uo,i.setAssetTypeFieldValuesMany=go,i.setAssetTypeFields=Ju,i.setAssetTypeFieldsAttachment=Bu,i.setAssetTypeFieldsAttachments=zu,i.setAssetTypeFieldsMany=Zu,i.setAssetTypeIdentifier=Do,i.setAssetTypeIdentifierValue=Qo,i.setAssetTypeIdentifierValues=Xo,i.setAssetTypeIdentifiers=qo,i.setAssetTypeStatus=_h,i.setAssetTypeStatuses=Ph,i.setAssetTypes=uh,i.setAssets=ql,i.setClientSDK=hP,i.setClientStore=uP,i.setConversation=pc,i.setConversations=ib,i.setCurrentUser=SR,i.setCurrentUserProfile=AR,i.setDocument=sp,i.setDocumentAttachment=Uh,i.setDocumentAttachments=Lh,i.setDocuments=ip,i.setEmailDomain=yp,i.setEmailDomains=Sp,i.setForm=Wm,i.setFormIdentifier=Vp,i.setFormIdentifierValue=Kp,i.setFormIdentifierValues=Yp,i.setFormIdentifiers=Wp,i.setFormRevision=Tm,i.setFormRevisionAttachment=rm,i.setFormRevisionAttachments=dm,i.setFormRevisions=Im,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=zh,i.setOrganization=Gw,i.setOrganizationAccess=Vw,i.setOrganizationAccesses=Ww,i.setOrganizations=Hw,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=ta,i.teamReducer=$I,i.teamSlice=sa,i.toFileNameSafeString=YP,i.toUuidArray=E,i.toUuidIdRecord=KP,i.truncate=QP,i.updateAsset=Wl,i.updateAssetAttachment=Ic,i.updateAssetAttachments=Oc,i.updateAssetProcedure=Kr,i.updateAssetProcedureStep=Fl,i.updateAssetProcedureStepFieldValues=ll,i.updateAssetProcedureStepFieldValuesAttachment=Jd,i.updateAssetProcedureStepFieldValuesAttachments=Zd,i.updateAssetProcedureStepFieldValuesMany=ul,i.updateAssetProcedureStepFields=Dd,i.updateAssetProcedureStepFieldsAttachment=Fd,i.updateAssetProcedureStepFieldsAttachments=gd,i.updateAssetProcedureStepFieldsMany=qd,i.updateAssetProcedureSteps=gl,i.updateAssetProcedureType=rd,i.updateAssetProcedureTypeAttachment=Bc,i.updateAssetProcedureTypeAttachments=zc,i.updateAssetProcedureTypeFieldValues=zr,i.updateAssetProcedureTypeFieldValuesAttachment=Or,i.updateAssetProcedureTypeFieldValuesAttachments=Fr,i.updateAssetProcedureTypeFieldValuesMany=Dr,i.updateAssetProcedureTypeFields=lr,i.updateAssetProcedureTypeFieldsAttachment=Jc,i.updateAssetProcedureTypeFieldsAttachments=Zc,i.updateAssetProcedureTypeFieldsMany=ur,i.updateAssetProcedureTypes=dd,i.updateAssetProcedures=Yr,i.updateAssetStage=ou,i.updateAssetStageCompletion=Zl,i.updateAssetStageCompletions=Ql,i.updateAssetStages=hu,i.updateAssetType=ph,i.updateAssetTypeAttachment=Fu,i.updateAssetTypeAttachments=gu,i.updateAssetTypeFieldValues=_o,i.updateAssetTypeFieldValuesAttachment=oo,i.updateAssetTypeFieldValuesAttachments=ho,i.updateAssetTypeFieldValuesMany=Po,i.updateAssetTypeFields=Qu,i.updateAssetTypeFieldsAttachment=Du,i.updateAssetTypeFieldsAttachments=qu,i.updateAssetTypeFieldsMany=Xu,i.updateAssetTypeIdentifier=jo,i.updateAssetTypeIdentifierValue=xo,i.updateAssetTypeIdentifierValues=eh,i.updateAssetTypeIdentifiers=$o,i.updateAssetTypeStatus=bh,i.updateAssetTypeStatuses=Rh,i.updateAssetTypes=mh,i.updateAssets=Bl,i.updateConversation=mc,i.updateConversations=nb,i.updateDocument=np,i.updateDocumentAttachment=Nh,i.updateDocumentAttachments=Hh,i.updateDocuments=ap,i.updateEmailDomain=Ap,i.updateEmailDomains=wp,i.updateForm=zm,i.updateFormIdentifier=Bp,i.updateFormIdentifierValue=Jp,i.updateFormIdentifierValues=Zp,i.updateFormIdentifiers=zp,i.updateFormRevision=Om,i.updateFormRevisionAttachment=lm,i.updateFormRevisionAttachments=um,i.updateFormRevisions=Fm,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=Cn,i.uuidObj=I,i.uuidObjSortFn=gs,i.uuidSortFn=Yt,i.versioningReducer=UI,i.versioningSlice=CI,i.workflowIssueLinkReducer=SO,i.workflowIssueLinkSlice=aa,i.workflowReducer=sO,i.workflowSlice=na,i.workflowStepAssigneeReducer=vO,i.workflowStepAssigneeSlice=ca,i.workflowStepCommentReducer=HO,i.workflowStepCommentSlice=ra,i.workflowStepDefaultAssigneeReducer=aF,i.workflowStepDefaultAssigneeSlice=da,i.workflowStepDefaultReviewerReducer=wF,i.workflowStepDefaultReviewerSlice=ua,i.workflowStepEventReducer=VF,i.workflowStepEventSlice=ha,i.workflowStepFieldValuesAttachmentReducer=wg,i.workflowStepFieldValuesAttachmentSlice=Aa,i.workflowStepFieldValuesReducer=Vg,i.workflowStepFieldValuesReviewReducer=a_,i.workflowStepFieldValuesReviewRequestReducer=Gg,i.workflowStepFieldValuesReviewRequestSlice=Fa,i.workflowStepFieldValuesReviewSlice=Pa,i.workflowStepFieldValuesSlice=Oa,i.workflowStepFieldsAttachmentReducer=GF,i.workflowStepFieldsAttachmentSlice=pa,i.workflowStepFieldsReducer=cg,i.workflowStepFieldsSlice=Sa,i.workflowStepReducer=V_,i.workflowStepReviewerReducer=w_,i.workflowStepReviewerSlice=Ma,i.workflowStepSlice=ka,i.workflowTypeReducer=K_,i.workflowTypeSlice=Ea,Object.defineProperty(i,Symbol.toStringTag,{value:"Module"})});
|