@overmap-ai/core 1.0.78-workflows.0 → 1.0.78-workflows.2
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/enums/workflows.d.ts +8 -0
- package/dist/overmap-core.js +5140 -4787
- package/dist/overmap-core.umd.cjs +7 -7
- package/dist/sdk/services/IssueUpdateService.d.ts +4 -0
- package/dist/sdk/services/WorkflowStepAssigneeService.d.ts +3 -1
- package/dist/sdk/services/WorkflowStepEventService.d.ts +109 -0
- package/dist/sdk/services/WorkflowStepReviewerService.d.ts +30 -0
- package/dist/sdk/services/index.d.ts +2 -0
- package/dist/store/reducers.d.ts +6 -0
- package/dist/store/slices/assetProcedureSlice.d.ts +2 -0
- package/dist/store/slices/assetProcedureStepFieldValuesAttachmentSlice.d.ts +2 -0
- package/dist/store/slices/assetProcedureStepFieldValuesSlice.d.ts +2 -0
- package/dist/store/slices/assetProcedureStepFieldsAttachmentSlice.d.ts +2 -0
- package/dist/store/slices/assetProcedureStepFieldsSlice.d.ts +4 -0
- package/dist/store/slices/assetProcedureStepSlice.d.ts +2 -0
- package/dist/store/slices/assetProcedureTypeAttachmentSlice.d.ts +2 -0
- package/dist/store/slices/assetProcedureTypeFieldValuesAttachmentSlice.d.ts +2 -0
- package/dist/store/slices/assetProcedureTypeFieldValuesSlice.d.ts +2 -0
- package/dist/store/slices/assetProcedureTypeFieldsAttachmentSlice.d.ts +2 -0
- package/dist/store/slices/assetSlice.d.ts +2 -0
- package/dist/store/slices/assetStageCompletionSlice.d.ts +2 -0
- package/dist/store/slices/assetStageSlice.d.ts +2 -0
- package/dist/store/slices/assetTypeFieldValuesAttachmentSlice.d.ts +2 -0
- package/dist/store/slices/assetTypeFieldValuesSlice.d.ts +2 -0
- package/dist/store/slices/assetTypeFieldsAttachmentSlice.d.ts +2 -0
- package/dist/store/slices/assetTypeFieldsSlice.d.ts +2 -0
- package/dist/store/slices/assetTypeStatusSlice.d.ts +2 -0
- package/dist/store/slices/categorySlice.d.ts +2 -0
- package/dist/store/slices/emailDomainsSlice.d.ts +2 -0
- package/dist/store/slices/formRevisionAttachmentSlice.d.ts +2 -0
- package/dist/store/slices/formRevisionSlice.d.ts +2 -0
- package/dist/store/slices/formSlice.d.ts +2 -0
- package/dist/store/slices/geoImageSlice.d.ts +2 -0
- package/dist/store/slices/index.d.ts +2 -0
- package/dist/store/slices/issueAssociationSlice.d.ts +2 -0
- package/dist/store/slices/issueTypeFieldValuesAttachmentSlice.d.ts +2 -0
- package/dist/store/slices/issueTypeFieldValuesSlice.d.ts +2 -0
- package/dist/store/slices/issueTypeFieldsAttachmentSlice.d.ts +2 -0
- package/dist/store/slices/issueTypeFieldsSlice.d.ts +2 -0
- package/dist/store/slices/issueTypeStatusSlice.d.ts +2 -0
- package/dist/store/slices/issueUpdateSlice.d.ts +6 -0
- package/dist/store/slices/organizationSlice.d.ts +2 -0
- package/dist/store/slices/projectFileSlice.d.ts +2 -0
- package/dist/store/slices/projectSlice.d.ts +2 -0
- package/dist/store/slices/userSlice.d.ts +2 -0
- package/dist/store/slices/workflowStepAssigneeSlice.d.ts +2 -0
- package/dist/store/slices/workflowStepCommentSlice.d.ts +2 -0
- package/dist/store/slices/workflowStepCompletionSlice.d.ts +2 -0
- package/dist/store/slices/workflowStepEventSlice.d.ts +108 -0
- package/dist/store/slices/workflowStepFieldValuesAttachmentSlice.d.ts +2 -0
- package/dist/store/slices/workflowStepFieldValuesSlice.d.ts +2 -0
- package/dist/store/slices/workflowStepFieldsAttachmentSlice.d.ts +2 -0
- package/dist/store/slices/workflowStepFieldsSlice.d.ts +4 -0
- package/dist/store/slices/workflowStepReviewRequestSlice.d.ts +2 -0
- package/dist/store/slices/workflowStepReviewSlice.d.ts +2 -0
- package/dist/store/slices/workflowStepReviewerSlice.d.ts +129 -0
- package/dist/store/slices/workflowStepSlice.d.ts +2 -0
- package/dist/typings/models/workflows.d.ts +23 -2
- package/package.json +1 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
(function(i,D){typeof exports=="object"&&typeof module<"u"?D(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"],D):(i=typeof globalThis<"u"?globalThis:i||self,D(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,D,u,yt,ht,Ng,Hg,Xa,Rt,Gg,Qa,Kg,Yg,uk,hk,Zg,Jg,Xg){"use strict";var lk=Object.defineProperty;var ok=(i,D,u)=>D in i?lk(i,D,{enumerable:!0,configurable:!0,writable:!0,value:u}):i[D]=u;var p=(i,D,u)=>ok(i,typeof D!="symbol"?D+"":D,u);var Ug;const xa=Object.freeze([]),ec=Object.freeze({});var tc=(t=>(t[t.GUEST=0]="GUEST",t[t.BASIC=2]="BASIC",t[t.ADMIN=4]="ADMIN",t))(tc||{}),m=(t=>(t.GET="GET",t.POST="POST",t.PATCH="PATCH",t.PUT="PUT",t.DELETE="DELETE",t))(m||{}),sc=(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))(sc||{}),ic=(t=>(t.Issue="issue",t.Asset="asset",t.AssetType="asset_type",t.Project="project",t.Document="document",t))(ic||{}),us=(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))(us||{}),j=(t=>(t.STATUS="status",t.PRIORITY="priority",t.CATEGORY="category",t.DESCRIPTION="description",t.TITLE="title",t.ASSIGNED_TO="assigned_to",t.DUE_DATE="due_date",t))(j||{}),nc=(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))(nc||{}),ac=(t=>(t[t.COMMENT=0]="COMMENT",t[t.APPROVE=2]="APPROVE",t[t.DENY=4]="DENY",t))(ac||{});const Qg=us.MEDIUM,cc=6e4;function M(t){return{addOne:(h,y)=>{const f=t(y.payload);h.instances[f]=y.payload},addMany:(h,y)=>{for(const f of y.payload){const A=t(f);h.instances[A]=f}},setOne:(h,y)=>{const f=t(y.payload);h.instances[f]=y.payload},setMany:(h,y)=>{for(const f of y.payload){const A=t(f);h.instances[A]=f}},updateOne:(h,y)=>{const f=t(y.payload);h.instances[f]=y.payload},updateMany:(h,y)=>{for(const f of y.payload){const A=t(f);h.instances[A]=f}},deleteOne:(h,y)=>{delete h.instances[y.payload]},deleteMany:(h,y)=>{for(const f of y.payload)delete h.instances[f]},initialize:(h,y)=>{h.instances={};const f=new Set;for(const A of y.payload){const O=t(A);f.add(O),h.instances[O]=A}f.size!==y.payload.length&&console.warn("duplicate ids detected when initializing model instances.")}}}function xg(){return{initializeSelection:(l,r)=>{l.selection=Array.from(new Set(r.payload))},selectOne:(l,r)=>{new Set(l.selection).has(r.payload)||l.selection.push(r.payload)},selectMany:(l,r)=>{const h=new Set(l.selection);for(const y of r.payload)h.has(y)||h.add(y);l.selection=Array.from(h)},unselectOne:(l,r)=>{const h=new Set(l.selection);h.has(r.payload)&&(h.delete(r.payload),l.selection=Array.from(h))},unselectMany:(l,r)=>{const h=new Set(l.selection);for(const y of r.payload)h.has(y)&&h.delete(y);l.selection=Array.from(h)},toggleOne:(l,r)=>{const h=new Set(l.selection);h.has(r.payload)?h.delete(r.payload):h.add(r.payload),l.selection=Array.from(h)},toggleMany:(l,r)=>{const h=new Set(l.selection);for(const y of r.payload)h.has(y)?h.delete(y):h.add(y);l.selection=Array.from(h)},getInitialState:l=>({...l,selection:[]})}}const Ot="versioning",b=u.createAction("RESET"),W=u.createAction("RESET_PROJECT_STATE"),R=u.createAction("RESET_ORGANIZATION_STATE");function eb(t,s){return Ng.useMemo(t,s)}Ug=Symbol.toStringTag;class hs{constructor(){p(this,Ug,"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 ms=!1;["true","1"].includes("".toLowerCase())&&(ms=!0);function tb(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 ps(t){const s={};return function(){const e=Array.prototype.slice.call(arguments);return e in s?(ms&&console.debug(`Memoization debug: Using memorized return value for ${t.toString()}(`,e,")"),s[e]):(ms&&console.debug(`Memoization debug: Cache miss! Memoizing ${t.toString()}(`,e,")"),s[e]=t.apply(this,e))}}function sb(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 T=t=>t.length===0?xa:t,kt=t=>Object.keys(t).length===0?ec:t,rc=ps(t=>{if(!t)return"";const s=new Date(t),e=s.getFullYear()===ys.getFullYear(),n={day:"numeric",month:"short"};return e||(n.year="numeric"),s.toLocaleDateString([],n)}),ib=new Intl.RelativeTimeFormat([],{style:"long",numeric:"auto"}),nb=1e3*86400,ys=new Date,ab=t=>new Date(t).toDateString()===ys.toDateString(),cb=ps((t,s,e)=>{const n=Math.round((new Date(t).getTime()-ys.getTime())/nb);return n<s||n>e?rc(t):ib.format(n,"days")});function rb(t){return new Uint8Array(t).reduce((e,n)=>e+n.toString(16).padStart(2,"0"),"")}const fs=async(t,s)=>{s||(s=await ft(t));let e=t.type;if(e.includes("/")&&(e=e.split("/")[1]),!e)throw new Error(`Could not extract file type from ${t.type}`);return`${s}.${e}`};function ft(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=rb(c);s(d)})},n.readAsArrayBuffer(t)})}function db(t){if(!t.name||!t.type||!t.size){const s="File has no name, type, and/or size";throw new Error(s)}return`${t.name}&${t.type}${t.size}`}function dc(t,s){return new File([t],s,{type:t.type})}function lb(t,s){const e=document.createElement("a");e.setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(s)),e.setAttribute("download",t),e.style.display="none",document.body.appendChild(e),e.click(),document.body.removeChild(e)}const ob=async t=>{const s={};for(const e of t){const n=await ft(e);s[n]={sha1:n,extension:e.name.split(".").pop()||"",file_type:e.type,size:e.size}}return Object.values(s)},lc=async t=>(await fetch(t)).blob(),ub=t=>new Promise((s,e)=>{const n=new FileReader;n.onloadend=()=>{var a;s(((a=n.result)==null?void 0:a.toString())||"")},n.readAsDataURL(t)});function hb(t){const s=new Blob([t]);Hg.saveAs(s,t.name)}const oc={};function mb(t,s,e,...n){const a=oc[t];let c=!1;a?a[s]||(a[s]=!0,c=!0):(oc[t]={[s]:!0},c=!0),c&&console[e](...n)}const uc=["created_at","updated_at","index","revision"];function _(t){return{...t,uuid:ht.v4()}}function pb(t){const s={};for(const e of t)s[e.uuid]=e;return s}function z(t){return t.map(({uuid:s})=>s)}function vt(t,s){return t.localeCompare(s)}function As(t,s){return vt(t.uuid,s.uuid)}function yb(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 fb(t){return t.toLowerCase().replace(" ","-")}function Ab(t,s=!1){return t.normalize("NFKD").toLowerCase().replace(/[^\w\s-]/g,"").trim().replace(/[-\s]+/g,s?"_":"-")}function Sb(t,s){if(t.length<=s)return t;const e=t.slice(0,s-1);return e.slice(0,e.lastIndexOf(" "))+"…"}const Tb=/^.+@.+\..+$/;function E(t){const s={...t};for(const e of[...uc,"created_by"])e in s&&delete s[e];return s}const hc=t=>{const s=t.toSorted((e,n)=>e.order-n.order);return Xa(s,{id:e=>e.uuid,parentId:e=>e.parent,includeEmptyChildrenArray:!0,valueKey:!1})},wb=t=>{const{roots:s}=hc(t);return s.map(e=>new Rt.Tree(e))},mc=(t,s)=>{const{nodes:e}=hc(s),n=e.get(t);if(!n)throw new Error(`Node with uuid ${t} does not exist in asset procedure step tree.`);return new Rt.Tree(n)},pc=(t,s)=>t.type!==s.type?t.type-s.type:t.order-s.order,yc=(t,s)=>t.type!==s.type?t.type-s.type:t.order-s.order,fc=t=>Xa(t,{id:s=>s.uuid,parentId:s=>s.parent_document,includeEmptyChildrenArray:!0,valueKey:!1}),Ob=t=>{const{roots:s}=fc(t);return s.map(e=>new Rt.Tree(e))},Ac=(t,s)=>{const{nodes:e}=fc(s),n=e.get(t);if(!n)throw new Error(`Node with uuid ${t} does not exist in document tree.`);return new Rt.Tree(n)};class Ib{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 u.createSelector([this.getData],n=>this.performOperations(n).find(a=>a[s]===e))}count(){return u.createSelector([this.getData],s=>this.performOperations(s).length)}first(){return u.createSelector([this.getData],s=>this.performOperations(s)[0])}last(){return u.createSelector([this.getData],s=>{const e=this.performOperations(s);return e[e.length-1]})}exists(){return u.createSelector([this.getData],s=>this.performOperations(s).length>0)}toSelector(){return u.createSelector([this.getData],s=>T(this.performOperations(s)))}}const S=t=>(...s)=>e=>t(e,...s),N=M(t=>t.uuid),Sc={instances:{}},Ss=u.createSlice({name:"agents",initialState:Sc,extraReducers:t=>t.addMatcher(u.isAnyOf(b,W,R),s=>Object.assign(s,Sc)),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:Tc,addConversation:wc,addConversations:Fb,setConversation:Oc,setConversations:Pb,updateConversation:Ic,updateConversations:gb,deleteConversation:bb,deleteConversations:_b}=Ss.actions,Ts=t=>t.agentsReducer.instances,Mb=u.createSelector([Ts],t=>Object.values(t)),Rb=S(u.createSelector([Ts,(t,s)=>s],(t,s)=>t[s])),Fc=Ss.reducer,H=M(t=>t.uuid),Pc={instances:{}},ws=u.createSlice({name:"assetAttachments",initialState:Pc,extraReducers:t=>t.addMatcher(u.isAnyOf(b,W,R),s=>Object.assign(s,Pc)),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:gc,addAssetAttachment:bc,addAssetAttachments:Os,setAssetAttachment:_c,setAssetAttachments:Mc,updateAssetAttachment:Rc,updateAssetAttachments:kc,deleteAssetAttachment:vc,deleteAssetAttachments:Is}=ws.actions,Ec=t=>t.assetAttachmentReducer.instances,Fs=u.createSelector([Ec],t=>Object.values(t)),Vc=t=>s=>s.assetAttachmentReducer.instances[t],Bc=S(u.createSelector([Fs,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),zc=S(u.createSelector([Fs,(t,s)=>s],(t,s)=>T(t.filter(({asset:e})=>s===e)))),Wc=ws.reducer,G=M(({uuid:t})=>t),qc={instances:{}},Ps=u.createSlice({name:"assetProcedureTypeAttachments",initialState:qc,extraReducers:t=>t.addMatcher(u.isAnyOf(b,R),s=>Object.assign(s,qc)),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:Cc,addAssetProcedureTypeAttachment:jc,addAssetProcedureTypeAttachments:$c,setAssetProcedureTypeAttachment:Dc,setAssetProcedureTypeAttachments:Uc,updateAssetProcedureTypeAttachment:Lc,updateAssetProcedureTypeAttachments:Nc,deleteAssetProcedureTypeAttachment:Hc,deleteAssetProcedureTypeAttachments:Gc}=Ps.actions,Kc=Ps.reducer,Yc=t=>t.assetProcedureTypeAttachmentReducer.instances,gs=u.createSelector([Yc],t=>Object.values(t)),Zc=t=>s=>s.assetProcedureTypeAttachmentReducer.instances[t],Jc=S(u.createSelector([gs,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),kb=S(u.createSelector([gs,(t,s)=>s],(t,s)=>T(t.filter(({asset_procedure_type:e})=>s===e)))),K=M(({uuid:t})=>t),Xc={instances:{}},bs=u.createSlice({name:"assetProcedureTypeFieldsAttachments",initialState:Xc,extraReducers:t=>t.addMatcher(u.isAnyOf(b,R),s=>Object.assign(s,Xc)),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:Qc,addAssetProcedureTypeFieldsAttachment:xc,addAssetProcedureTypeFieldsAttachments:er,setAssetProcedureTypeFieldsAttachment:tr,setAssetProcedureTypeFieldsAttachments:sr,updateAssetProcedureTypeFieldsAttachment:ir,updateAssetProcedureTypeFieldsAttachments:nr,deleteAssetProcedureTypeFieldsAttachment:ar,deleteAssetProcedureTypeFieldsAttachments:cr}=bs.actions,rr=bs.reducer,dr=t=>t.assetProcedureTypeFieldsAttachmentReducer.instances,_s=u.createSelector([dr],t=>Object.values(t)),vb=S(u.createSelector([_s,(t,s)=>s],(t,s)=>T(t.filter(e=>e.fields_revision===s)))),lr=t=>s=>s.assetProcedureTypeFieldsAttachmentReducer.instances[t],or=S(u.createSelector([_s,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),Y=M(({uuid:t})=>t),ur={instances:{}},Ms=u.createSlice({name:"assetProcedureTypeFields",initialState:ur,extraReducers:t=>t.addMatcher(u.isAnyOf(b,R),s=>Object.assign(s,ur)),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:hr,addAssetProcedureTypeFields:mr,addAssetProcedureTypeFieldsMany:pr,setAssetProcedureTypeFields:yr,setAssetProcedureTypeFieldsMany:fr,updateAssetProcedureTypeFields:Ar,updateAssetProcedureTypeFieldsMany:Sr,deleteAssetProcedureTypeFields:Tr,deleteAssetProcedureTypeFieldsMany:wr}=Ms.actions,Or=Ms.reducer,Ir=t=>t.assetProcedureTypeFieldsReducer.instances,Et=u.createSelector([Ir],t=>Object.values(t)),Eb=S(u.createSelector([Et,(t,s)=>s],(t,s)=>T(t.filter(e=>e.asset_procedure_type===s)))),Vb=S(u.createSelector([Et,(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],Pr=S(u.createSelector([Et,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),Z=M(({uuid:t})=>t),gr={instances:{}},Rs=u.createSlice({name:"assetProcedureTypeFieldValuesAttachments",initialState:gr,extraReducers:t=>t.addMatcher(u.isAnyOf(b,W,R),s=>Object.assign(s,gr)),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:br,addAssetProcedureTypeFieldValuesAttachment:_r,addAssetProcedureTypeFieldValuesAttachments:ks,setAssetProcedureTypeFieldValuesAttachment:Mr,setAssetProcedureTypeFieldValuesAttachments:Rr,updateAssetProcedureTypeFieldValuesAttachment:kr,updateAssetProcedureTypeFieldValuesAttachments:vr,deleteAssetProcedureTypeFieldValuesAttachment:Er,deleteAssetProcedureTypeFieldValuesAttachments:vs}=Rs.actions,Vr=Rs.reducer,Br=t=>t.assetProcedureTypeFieldValuesAttachmentReducer.instances,Es=u.createSelector([Br],t=>Object.values(t)),zr=t=>s=>s.assetProcedureTypeFieldValuesAttachmentReducer.instances[t],Wr=S(u.createSelector([Es,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),qr=S(u.createSelector([Es,(t,s)=>s],(t,s)=>T(t.filter(e=>e.field_values===s)))),J=M(({uuid:t})=>t),Cr={instances:{}},Vs=u.createSlice({name:"assetProcedureTypeFieldValues",initialState:Cr,extraReducers:t=>t.addMatcher(u.isAnyOf(b,W,R),s=>Object.assign(s,Cr)),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:jr,addAssetProcedureTypeFieldValues:$r,addAssetProcedureTypeFieldValuesMany:Dr,setAssetProcedureTypeFieldValues:Ur,setAssetProcedureTypeFieldValuesMany:Lr,updateAssetProcedureTypeFieldValues:Nr,updateAssetProcedureTypeFieldValuesMany:Hr,deleteAssetProcedureTypeFieldValues:Gr,deleteAssetProcedureTypeFieldValuesMany:Kr}=Vs.actions,Yr=Vs.reducer,Zr=t=>t.assetProcedureTypeFieldValuesReducer.instances,Vt=u.createSelector([Zr],t=>Object.values(t)),Bb=S(u.createSelector([Vt,(t,s)=>s],(t,s)=>T(t.filter(e=>e.asset===s)))),zb=S(u.createSelector([Vt,(t,s)=>s],(t,s)=>T(t.filter(e=>e.asset_procedure===s)))),Jr=t=>s=>s.assetProcedureTypeFieldValuesReducer.instances[t],Xr=S(u.createSelector([Vt,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),X=M(({uuid:t})=>t),Qr={instances:{}},Bs=u.createSlice({name:"assetProcedures",initialState:Qr,extraReducers:t=>t.addMatcher(u.isAnyOf(b,W,R),s=>Object.assign(s,Qr)),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:xr,addAssetProcedure:ed,addAssetProcedures:zs,updateAssetProcedure:td,updateAssetProcedures:sd,deleteAssetProcedure:id,deleteAssetProcedures:Ws,setAssetProcedure:nd,setAssetProcedures:ad}=Bs.actions,cd=Bs.reducer,rd=t=>t.assetProcedureReducer.instances,Bt=u.createSelector([rd],t=>Object.values(t)),dd=S(u.createSelector([Bt,(t,s)=>s],(t,s)=>T(t.filter(e=>e.asset_procedure_type===s)))),Wb=S(u.createSelector([Bt,(t,s)=>s],(t,s)=>T(t.filter(e=>e.asset_type===s)))),ld=t=>s=>s.assetProcedureReducer.instances[t],od=S(u.createSelector([Bt,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),Q=M(t=>t.uuid),ud={instances:{}},qs=u.createSlice({name:"assetProcedureTypes",initialState:ud,extraReducers:t=>t.addMatcher(u.isAnyOf(b,R),s=>Object.assign(s,ud)),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:hd,addAssetProcedureType:md,addAssetProcedureTypes:pd,updateAssetProcedureType:yd,updateAssetProcedureTypes:fd,deleteAssetProcedureType:Ad,deleteAssetProcedureTypes:Sd,setAssetProcedureType:Td,setAssetProcedureTypes:wd}=qs.actions,Od=qs.reducer,Id=t=>t.assetProcedureTypeReducer.instances,Cs=u.createSelector([Id],t=>Object.values(t)),Fd=t=>s=>s.assetProcedureTypeReducer.instances[t],Pd=S(u.createSelector([Cs,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),qb=S(u.createSelector([Cs,(t,s)=>s],(t,s)=>T(t.filter(e=>e.organization===s)))),x=M(t=>t.uuid),gd={instances:{}},js=u.createSlice({name:"assetProcedureStepFieldsAttachments",initialState:gd,extraReducers:t=>t.addMatcher(u.isAnyOf(b,R),s=>Object.assign(s,gd)),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:bd,addAssetProcedureStepFieldsAttachment:_d,addAssetProcedureStepFieldsAttachments:Md,setAssetProcedureStepFieldsAttachment:Rd,setAssetProcedureStepFieldsAttachments:kd,updateAssetProcedureStepFieldsAttachment:vd,updateAssetProcedureStepFieldsAttachments:Ed,deleteAssetProcedureStepFieldsAttachment:Vd,deleteAssetProcedureStepFieldsAttachments:Bd}=js.actions,zd=t=>t.assetProcedureStepFieldsAttachmentReducer.instances,$s=u.createSelector([zd],t=>Object.values(t)),Cb=S(u.createSelector([$s,(t,s)=>s],(t,s)=>T(t.filter(e=>e.fields_revision===s)))),Wd=t=>s=>s.assetProcedureStepFieldsAttachmentReducer.instances[t],qd=S(u.createSelector([$s,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),Cd=js.reducer,ee=M(t=>t.uuid),jd={instances:{}},Ds=u.createSlice({name:"assetProcedureStepFields",initialState:jd,extraReducers:t=>t.addMatcher(u.isAnyOf(b,R),s=>Object.assign(s,jd)),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:$d,addAssetProcedureStepFields:Dd,addAssetProcedureStepFieldsMany:Ud,setAssetProcedureStepFields:Ld,setAssetProcedureStepFieldsMany:Nd,updateAssetProcedureStepFields:Hd,updateAssetProcedureStepFieldsMany:Gd,deleteAssetProcedureStepFields:Kd,deleteAssetProcedureStepFieldsMany:Yd}=Ds.actions,Us=t=>t.assetProcedureStepFieldsReducer.instances,zt=u.createSelector([Us],t=>Object.values(t)),jb=S(u.createSelector([zt,(t,s)=>s],(t,s)=>T(t.filter(e=>e.asset_procedure_step===s)))),$b=S(u.createSelector([zt,(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])),Db=u.createSelector([Us],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}),Zd=t=>s=>s.assetProcedureStepFieldsReducer.instances[t],Jd=S(u.createSelector([zt,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),Xd=Ds.reducer,te=M(t=>t.uuid),Qd={instances:{}},Ls=u.createSlice({name:"assetProcedureStepFieldValuesAttachments",initialState:Qd,extraReducers:t=>t.addMatcher(u.isAnyOf(b,W,R),s=>Object.assign(s,Qd)),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:xd,addAssetProcedureStepFieldValuesAttachment:el,addAssetProcedureStepFieldValuesAttachments:Ns,setAssetProcedureStepFieldValuesAttachment:tl,setAssetProcedureStepFieldValuesAttachments:sl,updateAssetProcedureStepFieldValuesAttachment:il,updateAssetProcedureStepFieldValuesAttachments:nl,deleteAssetProcedureStepFieldValuesAttachment:al,deleteAssetProcedureStepFieldValuesAttachments:Hs}=Ls.actions,cl=t=>t.assetProcedureStepFieldValuesAttachmentReducer.instances,Gs=u.createSelector([cl],t=>Object.values(t)),rl=t=>s=>s.assetProcedureStepFieldValuesAttachmentReducer.instances[t],dl=S(u.createSelector([Gs,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),ll=S(u.createSelector([Gs,(t,s)=>s],(t,s)=>T(t.filter(e=>e.field_values===s)))),ol=Ls.reducer,se=M(t=>t.uuid),ul={instances:{}},Ks=u.createSlice({name:"assetProcedureStepFieldValues",initialState:ul,extraReducers:t=>t.addMatcher(u.isAnyOf(b,W,R),s=>Object.assign(s,ul)),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:hl,addAssetProcedureStepFieldValues:ml,addAssetProcedureStepFieldValuesMany:pl,setAssetProcedureStepFieldValues:yl,setAssetProcedureStepFieldValuesMany:fl,updateAssetProcedureStepFieldValues:Al,updateAssetProcedureStepFieldValuesMany:Sl,deleteAssetProcedureStepFieldValues:Tl,deleteAssetProcedureStepFieldValuesMany:wl}=Ks.actions,Ol=t=>t.assetProcedureStepFieldValuesReducer.instances,It=u.createSelector([Ol],t=>Object.values(t)),Ub=S(u.createSelector([It,(t,s)=>s],(t,s)=>T(t.filter(e=>e.asset===s)))),Lb=S(u.createSelector([It,(t,s)=>s],(t,s)=>T(t.filter(e=>e.asset_procedure===s)))),Nb=S(u.createSelector([It,(t,s)=>s],(t,s)=>T(t.filter(e=>e.asset_procedure_step===s)))),Il=t=>s=>s.assetProcedureStepFieldValuesReducer.instances[t],Fl=S(u.createSelector([It,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),Pl=Ks.reducer,ie=M(t=>t.uuid),gl={instances:{}},Ys=u.createSlice({name:"assetProcedureSteps",initialState:gl,extraReducers:t=>t.addMatcher(u.isAnyOf(b,R),s=>Object.assign(s,gl)),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:bl,setAssetProcedureStep:_l,setAssetProcedureSteps:Ml,addAssetProcedureStep:Rl,addAssetProcedureSteps:kl,updateAssetProcedureStep:vl,updateAssetProcedureSteps:El,deleteAssetProcedureStep:Vl,deleteAssetProcedureSteps:Bl}=Ys.actions,zl=Ys.reducer,Wt=t=>t.assetProcedureStepReducer.instances,Wl=t=>s=>s.assetProcedureStepReducer.instances[t],Zs=u.createSelector([Wt],t=>Object.values(t)),Hb=S(u.createSelector([Wt,(t,s)=>s],(t,s)=>{const e={};for(const[n,a]of Object.entries(t))a.asset_procedure_type===s&&(e[n]=a);return kt(e)})),Gb=S(u.createSelector([Zs,(t,s)=>s],(t,s)=>T(t.filter(e=>e.asset_procedure_type===s)))),ql=S(u.createSelector([Zs,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),Cl=S(u.createSelector([Wt,(t,s)=>s],(t,s)=>{if(!t[s])return T([]);const a=mc(s,Object.values(t)).all().map(({model:c})=>c);return T(a)})),ne=M(t=>t.uuid),jl={instances:{}},Js=u.createSlice({name:"assets",initialState:jl,extraReducers:t=>t.addMatcher(u.isAnyOf(b,W,R),s=>Object.assign(s,jl)),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:$l,addAsset:Dl,addAssets:Xs,updateAsset:Ul,updateAssets:Ll,deleteAsset:Nl,deleteAssets:Qs,setAsset:Hl,setAssets:Gl}=Js.actions,Kl=t=>t.assetReducer.instances,qt=u.createSelector([Kl],t=>T(Object.values(t))),Kb=S(u.createSelector([qt,(t,s)=>s],(t,s)=>T(t.filter(({project:e})=>e===s)))),Yl=S(u.createSelector([qt,(t,s)=>s],(t,s)=>T(t.filter(e=>e.asset_type===s)))),Zl=t=>s=>s.assetReducer.instances[t],Jl=S(u.createSelector([qt,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),Xl=Js.reducer,ae=M(t=>t.uuid),Ql={instances:{}},xs=u.createSlice({name:"assetStageCompletions",initialState:Ql,extraReducers:t=>t.addMatcher(u.isAnyOf(b,W,R),s=>Object.assign(s,Ql)),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:xl,addAssetStageCompletion:eo,addAssetStageCompletions:to,setAssetStageCompletion:so,setAssetStageCompletions:io,updateAssetStageCompletion:no,updateAssetStageCompletions:ao,deleteAssetStageCompletion:co,deleteAssetStageCompletions:ro}=xs.actions,lo=xs.reducer,oo=t=>t.assetStageCompletionReducer.instances,uo=u.createSelector([oo],t=>Object.values(t)),ho=t=>s=>s.assetStageCompletionReducer.instances[t],mo=S(u.createSelector([uo,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),ce=M(t=>t.uuid),po={instances:{}},ei=u.createSlice({name:"assetStages",initialState:po,extraReducers:t=>t.addMatcher(u.isAnyOf(b,R),s=>Object.assign(s,po)),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:yo,setAssetStage:fo,setAssetStages:Ao,addAssetStage:So,addAssetStages:To,updateAssetStage:wo,updateAssetStages:Oo,deleteAssetStage:Io,deleteAssetStages:Fo}=ei.actions,Po=ei.reducer,ti=t=>t.assetStageReducer.instances,go=t=>s=>s.assetStageReducer.instances[t],si=u.createSelector([ti],t=>Object.values(t)),Yb=S(u.createSelector([ti,(t,s)=>s],(t,s)=>{const e={};for(const[n,a]of Object.entries(t))a.asset_procedure_type===s&&(e[n]=a);return kt(e)})),Zb=S(u.createSelector([si,(t,s)=>s],(t,s)=>T(t.filter(e=>e.asset_procedure_type===s)))),bo=S(u.createSelector([si,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),re=M(t=>t.uuid),_o={instances:{}},ii=u.createSlice({name:"assetTypeAttachments",initialState:_o,extraReducers:t=>t.addMatcher(u.isAnyOf(b,R),s=>Object.assign(s,_o)),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:Mo,addAssetTypeAttachment:Ro,addAssetTypeAttachments:ni,setAssetTypeAttachment:ko,setAssetTypeAttachments:vo,updateAssetTypeAttachment:Eo,updateAssetTypeAttachments:Vo,deleteAssetTypeAttachment:Bo,deleteAssetTypeAttachments:ai}=ii.actions,zo=t=>t.assetTypeAttachmentReducer.instances,ci=u.createSelector([zo],t=>Object.values(t)),Wo=t=>s=>s.assetTypeAttachmentReducer.instances[t],qo=S(u.createSelector([ci,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),Co=S(u.createSelector([ci,(t,s)=>s],(t,s)=>T(t.filter(({asset_type:e})=>s===e)))),jo=ii.reducer,de=M(t=>t.uuid),$o={instances:{}},ri=u.createSlice({name:"assetTypeFieldsAttachments",initialState:$o,extraReducers:t=>t.addMatcher(u.isAnyOf(b,R),s=>Object.assign(s,$o)),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:Do,addAssetTypeFieldsAttachment:Uo,addAssetTypeFieldsAttachments:Lo,setAssetTypeFieldsAttachment:No,setAssetTypeFieldsAttachments:Ho,updateAssetTypeFieldsAttachment:Go,updateAssetTypeFieldsAttachments:Ko,deleteAssetTypeFieldsAttachment:Yo,deleteAssetTypeFieldsAttachments:Zo}=ri.actions,Jo=t=>t.assetTypeFieldsAttachmentReducer.instances,di=u.createSelector([Jo],t=>Object.values(t)),Jb=S(u.createSelector([di,(t,s)=>s],(t,s)=>T(t.filter(e=>e.fields_revision===s)))),Xo=t=>s=>s.assetTypeFieldsAttachmentReducer.instances[t],Qo=S(u.createSelector([di,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),xo=ri.reducer,le=M(t=>t.uuid),eu={instances:{}},li=u.createSlice({name:"assetTypeFields",initialState:eu,extraReducers:t=>t.addMatcher(u.isAnyOf(b,R),s=>Object.assign(s,eu)),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:tu,addAssetTypeFields:su,addAssetTypeFieldsMany:iu,setAssetTypeFields:nu,setAssetTypeFieldsMany:au,updateAssetTypeFields:cu,updateAssetTypeFieldsMany:ru,deleteAssetTypeFields:du,deleteAssetTypeFieldsMany:lu}=li.actions,ou=t=>t.assetTypeFieldsReducer.instances,Ft=u.createSelector([ou],t=>Object.values(t)),Xb=S(u.createSelector([Ft,(t,s)=>s],(t,s)=>T(t.filter(e=>e.asset_type===s)))),Qb=S(u.createSelector([Ft,(t,s)=>s],(t,s)=>t.filter(e=>e.asset_type===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),uu=t=>s=>s.assetTypeFieldsReducer.instances[t],hu=S(u.createSelector([Ft,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),mu=li.reducer,oe=M(t=>t.uuid),pu={instances:{}},oi=u.createSlice({name:"assetTypeFieldValuesAttachments",initialState:pu,extraReducers:t=>t.addMatcher(u.isAnyOf(b,W,R),s=>Object.assign(s,pu)),reducers:{initializeAssetTypeFieldValuesAttachments:oe.initialize,addAssetTypeFieldValuesAttachment:oe.addOne,addAssetTypeFieldValuesAttachments:oe.addMany,setAssetTypeFieldValuesAttachment:oe.setOne,setAssetTypeFieldValuesAttachments:oe.setMany,updateAssetTypeFieldValuesAttachment:oe.updateOne,updateAssetTypeFieldValuesAttachments:oe.updateMany,deleteAssetTypeFieldValuesAttachment:oe.deleteOne,deleteAssetTypeFieldValuesAttachments:oe.deleteMany}}),{initializeAssetTypeFieldValuesAttachments:yu,addAssetTypeFieldValuesAttachment:fu,addAssetTypeFieldValuesAttachments:ui,setAssetTypeFieldValuesAttachment:Au,setAssetTypeFieldValuesAttachments:Su,updateAssetTypeFieldValuesAttachment:Tu,updateAssetTypeFieldValuesAttachments:wu,deleteAssetTypeFieldValuesAttachment:Ou,deleteAssetTypeFieldValuesAttachments:hi}=oi.actions,Iu=t=>t.assetTypeFieldValuesAttachmentReducer.instances,mi=u.createSelector([Iu],t=>Object.values(t)),Fu=t=>s=>s.assetTypeFieldValuesAttachmentReducer.instances[t],Pu=S(u.createSelector([mi,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),gu=S(u.createSelector([mi,(t,s)=>s],(t,s)=>T(t.filter(e=>e.field_values===s)))),bu=oi.reducer,ue=M(t=>t.uuid),_u={instances:{}},pi=u.createSlice({name:"assetTypeFieldValues",initialState:_u,extraReducers:t=>t.addMatcher(u.isAnyOf(b,W,R),s=>Object.assign(s,_u)),reducers:{initializeAssetTypeFieldValues:ue.initialize,addAssetTypeFieldValues:ue.addOne,addAssetTypeFieldValuesMany:ue.addMany,setAssetTypeFieldValues:ue.setOne,setAssetTypeFieldValuesMany:ue.setMany,updateAssetTypeFieldValues:ue.updateOne,updateAssetTypeFieldValuesMany:ue.updateMany,deleteAssetTypeFieldValues:ue.deleteOne,deleteAssetTypeFieldValuesMany:ue.deleteMany}}),{initializeAssetTypeFieldValues:Mu,addAssetTypeFieldValues:Ru,addAssetTypeFieldValuesMany:ku,setAssetTypeFieldValues:vu,setAssetTypeFieldValuesMany:Eu,updateAssetTypeFieldValues:Vu,updateAssetTypeFieldValuesMany:Bu,deleteAssetTypeFieldValues:zu,deleteAssetTypeFieldValuesMany:Wu}=pi.actions,qu=t=>t.assetTypeFieldValuesReducer.instances,Ct=u.createSelector([qu],t=>Object.values(t)),xb=S(u.createSelector([Ct,(t,s)=>s],(t,s)=>T(t.filter(e=>e.asset===s)))),e_=S(u.createSelector([Ft,Ct,(t,s)=>s],(t,s,e)=>{const n=new Set(t.filter(a=>a.asset_type===e).map(a=>a.uuid));return T(s.filter(a=>n.has(a.fields_revision)))})),Cu=t=>s=>s.assetTypeFieldValuesReducer.instances[t],ju=S(u.createSelector([Ct,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),$u=pi.reducer,he=M(t=>t.uuid),Du={instances:{}},yi=u.createSlice({name:"assetTypeIdentifiers",initialState:Du,extraReducers:t=>t.addMatcher(u.isAnyOf(b,R),s=>Object.assign(s,Du)),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:Uu,addAssetTypeIdentifier:Lu,addAssetTypeIdentifiers:Nu,setAssetTypeIdentifier:Hu,setAssetTypeIdentifiers:Gu,updateAssetTypeIdentifier:Ku,updateAssetTypeIdentifiers:Yu,deleteAssetTypeIdentifier:Zu,deleteAssetTypeIdentifiers:Ju}=yi.actions,Xu=t=>t.assetTypeIdentifierReducer.instances,fi=u.createSelector([Xu],t=>Object.values(t)),Qu=t=>s=>s.assetTypeIdentifierReducer.instances[t],xu=S(u.createSelector([fi,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),t_=S(u.createSelector([fi,(t,s)=>s],(t,s)=>T(t.filter(e=>e.asset_type===s)))),eh=yi.reducer,me=M(t=>t.uuid),th={instances:{}},Ai=u.createSlice({name:"assetTypeIdentifierValues",initialState:th,extraReducers:t=>t.addMatcher(u.isAnyOf(b,W,R),s=>Object.assign(s,th)),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:sh,addAssetTypeIdentifierValue:ih,addAssetTypeIdentifierValues:nh,setAssetTypeIdentifierValue:ah,setAssetTypeIdentifierValues:ch,updateAssetTypeIdentifierValue:rh,updateAssetTypeIdentifierValues:dh,deleteAssetTypeIdentifierValue:lh,deleteAssetTypeIdentifierValues:oh}=Ai.actions,uh=t=>t.assetTypeIdentifierValueReducer.instances,jt=u.createSelector([uh],t=>Object.values(t)),hh=t=>s=>s.assetTypeIdentifierValueReducer.instances[t],mh=S(u.createSelector([jt,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),s_=S(u.createSelector([jt,(t,s)=>s],(t,s)=>T(t.filter(e=>e.asset===s)))),i_=S(u.createSelector([jt,(t,s)=>s],(t,s)=>T(t.filter(e=>e.asset_type_identifier===s)))),ph=Ai.reducer,pe=M(t=>t.uuid),yh={instances:{}},Si=u.createSlice({name:"assetTypes",initialState:yh,extraReducers:t=>t.addMatcher(u.isAnyOf(b,R),s=>Object.assign(s,yh)),reducers:{initializeAssetTypes:pe.initialize,setAssetType:pe.setOne,setAssetTypes:pe.setMany,addAssetType:pe.addOne,addAssetTypes:pe.addMany,updateAssetType:pe.updateOne,updateAssetTypes:pe.updateMany,deleteAssetType:pe.deleteOne,deleteAssetTypes:pe.deleteMany}}),{initializeAssetTypes:fh,setAssetType:Ah,setAssetTypes:Sh,addAssetType:Th,addAssetTypes:wh,updateAssetType:Oh,updateAssetTypes:Ih,deleteAssetType:Fh,deleteAssetTypes:Ph}=Si.actions,gh=t=>t.assetTypeReducer.instances,Ti=u.createSelector([gh],t=>Object.values(t)),bh=t=>s=>s.assetTypeReducer.instances[t],_h=S(u.createSelector([Ti,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),n_=S(u.createSelector([Ti,(t,s)=>s],(t,s)=>T(t.filter(e=>e.organization===s)))),Mh=Si.reducer,ye=M(t=>t.uuid),Rh={instances:{}},wi=u.createSlice({name:"assetTypeStatuses",initialState:Rh,extraReducers:t=>t.addMatcher(u.isAnyOf(b,R),s=>Object.assign(s,Rh)),reducers:{initializeAssetTypeStatuses:ye.initialize,addAssetTypeStatus:ye.addOne,addAssetTypeStatuses:ye.addMany,setAssetTypeStatus:ye.setOne,setAssetTypeStatuses:ye.setMany,updateAssetTypeStatus:ye.updateOne,updateAssetTypeStatuses:ye.updateMany,deleteAssetTypeStatus:ye.deleteOne,deleteAssetTypeStatuses:ye.deleteMany}}),{initializeAssetTypeStatuses:kh,addAssetTypeStatus:vh,addAssetTypeStatuses:Eh,setAssetTypeStatus:Vh,setAssetTypeStatuses:Bh,updateAssetTypeStatus:zh,updateAssetTypeStatuses:Wh,deleteAssetTypeStatus:qh,deleteAssetTypeStatuses:Ch}=wi.actions,jh=t=>t.assetTypeStatusReducer.instances,Oi=u.createSelector([jh],t=>T(Object.values(t).toSorted(pc))),$h=t=>s=>s.assetTypeStatusReducer.instances[t],Dh=S(u.createSelector([Oi,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),a_=S(u.createSelector([Oi,(t,s)=>s],(t,s)=>T(t.filter(e=>e.asset_type===s)))),Uh=wi.reducer,Lh={accessToken:"",refreshToken:"",isLoggedIn:!1},$t=u.createSlice({name:"auth",initialState:Lh,extraReducers:t=>t.addCase(b,s=>Object.assign(s,Lh)),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||$t.caseReducers.clearTokens(t),t.isLoggedIn=s.payload}}}),{setTokens:c_,clearTokens:r_,setLoggedIn:Nh}=$t.actions,d_=t=>t.authReducer.accessToken,l_=t=>t.authReducer.isLoggedIn,Hh=$t.reducer,fe=M(t=>t.uuid),Gh={instances:{}},Ii=u.createSlice({name:"categories",initialState:Gh,extraReducers:t=>t.addMatcher(u.isAnyOf(b,R),s=>Object.assign(s,Gh)),reducers:{initializeCategories:fe.initialize,addCategory:fe.addOne,addCategories:fe.addMany,setCategory:fe.setOne,setCategories:fe.setMany,updateCategory:fe.updateOne,updateCategories:fe.updateMany,deleteCategory:fe.deleteOne,deleteCategories:fe.deleteMany}}),{initializeCategories:Kh,addCategory:Yh,addCategories:Zh,setCategory:Jh,setCategories:Xh,updateCategory:Qh,updateCategories:xh,deleteCategory:em,deleteCategories:tm}=Ii.actions,sm=t=>t.categoryReducer.instances,Fi=u.createSelector([sm],t=>Object.values(t)),Pi=t=>s=>s.categoryReducer.instances[t],im=S(u.createSelector([Fi,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),o_=S(u.createSelector([Fi,(t,s)=>s],(t,s)=>T(t.filter(e=>e.project===s)))),nm=Ii.reducer,Ae=M(t=>t.uuid),am={instances:{}},gi=u.createSlice({name:"documentAttachments",initialState:am,extraReducers:t=>t.addCase(b,s=>Object.assign(s,am)),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:cm,addDocumentAttachment:rm,addDocumentAttachments:dm,setDocumentAttachment:lm,setDocumentAttachments:om,updateDocumentAttachment:um,updateDocumentAttachments:hm,deleteDocumentAttachment:mm,deleteDocumentAttachments:pm}=gi.actions,ym=t=>t.documentAttachmentReducer.instances,bi=u.createSelector([ym],t=>Object.values(t)),fm=t=>s=>s.documentAttachmentReducer.instances[t],Am=S(u.createSelector([bi,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),u_=S(u.createSelector([bi,(t,s)=>s],(t,s)=>T(t.filter(({document:e})=>s===e)))),Sm=gi.reducer,Se=M(({uuid:t})=>t),Tm={instances:{}},_i=u.createSlice({name:"documents",initialState:Tm,extraReducers:t=>t.addMatcher(u.isAnyOf(b,R),s=>{Object.assign(s,Tm)}),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:wm,addDocument:Om,addDocuments:Im,setDocument:Fm,setDocuments:Pm,updateDocument:gm,updateDocuments:bm,deleteDocument:_m,deleteDocuments:Mm}=_i.actions,Rm=_i.reducer,Mi=t=>t.documentsReducer.instances,Dt=u.createSelector([Mi],t=>Object.values(t)),km=t=>s=>s.documentsReducer.instances[t],vm=S(u.createSelector([Dt,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),h_=S(u.createSelector([Dt,(t,s)=>s],(t,s)=>t.filter(e=>e.project===s))),m_=S(u.createSelector([Dt,(t,s)=>s],(t,s)=>t.filter(e=>e.organization===s))),Em=S(u.createSelector([Mi,(t,s)=>s],(t,s)=>{if(!t[s])return T([]);const a=Ac(s,Object.values(t)).all().map(({model:c})=>c);return T(a)})),Te=M(t=>t.uuid),Vm={instances:{}},Ri=u.createSlice({name:"emailDomains",initialState:Vm,extraReducers:t=>t.addMatcher(u.isAnyOf(b,R),s=>Object.assign(s,Vm)),reducers:{initializeEmailDomains:Te.initialize,addEmailDomain:Te.addOne,addEmailDomains:Te.addMany,setEmailDomain:Te.setOne,setEmailDomains:Te.setMany,updateEmailDomain:Te.updateOne,updateEmailDomains:Te.updateMany,deleteEmailDomain:Te.deleteOne,deleteEmailDomains:Te.deleteMany}}),{initializeEmailDomains:Bm,addEmailDomain:zm,addEmailDomains:Wm,setEmailDomain:qm,setEmailDomains:Cm,updateEmailDomain:jm,updateEmailDomains:$m,deleteEmailDomain:Dm,deleteEmailDomains:Um}=Ri.actions,Lm=t=>t.emailDomainsReducer.instances,ki=u.createSelector([Lm],t=>Object.values(t)),Nm=t=>s=>s.emailDomainsReducer.instances[t],Hm=S(u.createSelector([ki,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),p_=S(u.createSelector([ki,(t,s)=>s],(t,s)=>T(t.filter(e=>e.organization===s)))),Gm=Ri.reducer,Km={s3Urls:{}},Ym=1e3*60*60,y_=Ym*24*7,vi=u.createSlice({name:"file",initialState:Km,extraReducers:t=>t.addCase(b,s=>Object.assign(s,Km)),reducers:{setUploadUrl:(t,s)=>{const{url:e,fields:n,sha1:a}=s.payload,c=new Date,d=new Date(c.getTime()+y_);t.s3Urls[a]={url:e,fields:n,exp:d.getTime()}}}}),{setUploadUrl:Zm}=vi.actions,Jm=t=>s=>{const e=s.fileReducer.s3Urls[t];if(!e)return;const n=new Date().getTime();if(!((e.exp??n)-n<Ym))return e},Xm=vi.reducer,we=M(t=>t.uuid),Qm={instances:{}},Ei=u.createSlice({name:"formIdentifiers",initialState:Qm,extraReducers:t=>t.addMatcher(u.isAnyOf(b,R),s=>Object.assign(s,Qm)),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:xm,addFormIdentifier:ep,addFormIdentifiers:tp,setFormIdentifier:sp,setFormIdentifiers:ip,updateFormIdentifier:np,updateFormIdentifiers:ap,deleteFormIdentifier:cp,deleteFormIdentifiers:rp}=Ei.actions,dp=t=>t.formIdentifierReducer.instances,Vi=u.createSelector([dp],t=>Object.values(t)),lp=t=>s=>s.formIdentifierReducer.instances[t],op=S(u.createSelector([Vi,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),f_=S(u.createSelector([Vi,(t,s)=>s],(t,s)=>T(t.filter(e=>e.form===s)))),up=Ei.reducer,Oe=M(t=>t.uuid),hp={instances:{}},Bi=u.createSlice({name:"formIdentifierValues",initialState:hp,extraReducers:t=>t.addMatcher(u.isAnyOf(b,R),s=>Object.assign(s,hp)),reducers:{initializeFormIdentifierValues:Oe.initialize,addFormIdentifierValue:Oe.addOne,addFormIdentifierValues:Oe.addMany,setFormIdentifierValue:Oe.setOne,setFormIdentifierValues:Oe.setMany,updateFormIdentifierValue:Oe.updateOne,updateFormIdentifierValues:Oe.updateMany,deleteFormIdentifierValue:Oe.deleteOne,deleteFormIdentifierValues:Oe.deleteMany}}),{initializeFormIdentifierValues:mp,addFormIdentifierValue:pp,addFormIdentifierValues:yp,setFormIdentifierValue:fp,setFormIdentifierValues:Ap,updateFormIdentifierValue:Sp,updateFormIdentifierValues:Tp,deleteFormIdentifierValue:wp,deleteFormIdentifierValues:Op}=Bi.actions,Ip=t=>t.formIdentifierValueReducer.instances,Ut=u.createSelector([Ip],t=>Object.values(t)),Fp=t=>s=>s.formIdentifierValueReducer.instances[t],Pp=S(u.createSelector([Ut,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),A_=S(u.createSelector([Ut,(t,s)=>s],(t,s)=>T(t.filter(e=>e.form_submission===s)))),S_=S(u.createSelector([Ut,(t,s)=>s],(t,s)=>T(t.filter(e=>e.form_identifier===s)))),gp=Bi.reducer,Ie=M(t=>t.uuid),bp={instances:{}},zi=u.createSlice({name:"formRevisionAttachments",initialState:bp,extraReducers:t=>t.addMatcher(u.isAnyOf(b,R),s=>Object.assign(s,bp)),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:_p,addFormRevisionAttachment:Mp,addFormRevisionAttachments:Rp,setFormRevisionAttachment:kp,setFormRevisionAttachments:vp,updateFormRevisionAttachment:Ep,updateFormRevisionAttachments:Vp,deleteFormRevisionAttachment:Bp,deleteFormRevisionAttachments:zp}=zi.actions,Lt=t=>t.formRevisionAttachmentReducer.instances,Wp=u.createSelector([Lt],t=>Object.values(t)),qp=S(u.createSelector([Lt,(t,s)=>s],(t,s)=>t[s])),Cp=S(u.createSelector([Wp,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),T_=S(u.createSelector([Lt,(t,s)=>s],(t,s)=>T(Object.values(t).filter(e=>e.form_revision===s)))),jp=zi.reducer,Fe=M(t=>t.uuid),$p={instances:{}},Wi=u.createSlice({name:"formRevisions",initialState:$p,extraReducers:t=>t.addMatcher(u.isAnyOf(b,R),s=>Object.assign(s,$p)),reducers:{initializeFormRevisions:Fe.initialize,addFormRevision:Fe.addOne,addFormRevisions:Fe.addMany,setFormRevision:Fe.setOne,setFormRevisions:Fe.setMany,updateFormRevision:Fe.updateOne,updateFormRevisions:Fe.updateMany,deleteFormRevision:Fe.deleteOne,deleteFormRevisions:Fe.deleteMany}}),{initializeFormRevisions:Dp,addFormRevision:qi,addFormRevisions:Ci,setFormRevision:Up,setFormRevisions:Lp,updateFormRevision:Np,updateFormRevisions:Hp,deleteFormRevision:ji,deleteFormRevisions:$i}=Wi.actions,Di=t=>t.formRevisionReducer.instances,Nt=u.createSelector([Di],t=>Object.values(t)),Gp=t=>s=>s.formRevisionReducer.instances[t],Kp=S(u.createSelector([Nt,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),w_=S(u.createSelector([Nt,(t,s)=>s],(t,s)=>t.filter(e=>e.form===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),Yp=S(u.createSelector([Nt,(t,s)=>s],(t,s)=>T(t.filter(e=>e.form===s)))),Zp=Wi.reducer,Pe=M(t=>t.uuid),Jp={instances:{}},Ui=u.createSlice({name:"forms",initialState:Jp,extraReducers:t=>t.addMatcher(u.isAnyOf(b,R),s=>Object.assign(s,Jp)),reducers:{initializeForms:Pe.initialize,addForm:Pe.addOne,addForms:Pe.addMany,setForm:Pe.setOne,setForms:Pe.setMany,updateForm:Pe.updateOne,updateForms:Pe.updateMany,deleteForm:Pe.deleteOne,deleteForms:Pe.deleteMany}}),{initializeForms:Xp,addForm:Qp,addForms:xp,setForm:ey,setForms:ty,updateForm:sy,updateForms:iy,deleteForm:ny,deleteForms:ay}=Ui.actions,cy=Ui.reducer,ry=t=>t.formReducer.instances,Li=u.createSelector([ry],t=>Object.values(t)),dy=t=>s=>s.formReducer.instances[t],ly=S(u.createSelector([Li,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),O_=S(u.createSelector([Li,(t,s)=>s],(t,s)=>T(t.filter(e=>e.organization===s)))),ge=M(t=>t.uuid),oy={instances:{}},Ni=u.createSlice({name:"formSubmissionAttachments",initialState:oy,extraReducers:t=>t.addMatcher(u.isAnyOf(b,R),s=>Object.assign(s,oy)),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:uy,addFormSubmissionAttachment:hy,addFormSubmissionAttachments:Hi,setFormSubmissionAttachment:my,setFormSubmissionAttachments:py,updateFormSubmissionAttachment:yy,updateFormSubmissionAttachments:fy,deleteFormSubmissionAttachment:Ay,deleteFormSubmissionAttachments:Gi}=Ni.actions,Ki=t=>t.formSubmissionAttachmentReducer.instances,Yi=u.createSelector([Ki],t=>Object.values(t)),Sy=S(u.createSelector([Ki,(t,s)=>s],(t,s)=>t[s])),Zi=S(u.createSelector([Yi,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(n=>e.has(n.uuid)))})),Ty=Zi,wy=S(u.createSelector([Yi,(t,s)=>s],(t,s)=>T(t.filter(e=>e.form_submission===s)))),Oy=Ni.reducer,be=M(t=>t.uuid),Iy={instances:{}},Ji=u.createSlice({name:"formSubmissions",initialState:Iy,extraReducers:t=>t.addMatcher(u.isAnyOf(b,R),s=>Object.assign(s,Iy)),reducers:{initializeFormSubmissions:be.initialize,setFormSubmission:be.setOne,setFormSubmissions:be.setMany,addFormSubmission:be.addOne,addFormSubmissions:be.addMany,updateFormSubmission:be.updateOne,updateFormSubmissions:be.updateMany,deleteFormSubmission:be.deleteOne,deleteFormSubmissions:be.deleteMany}}),{initializeFormSubmissions:Fy,setFormSubmission:Py,setFormSubmissions:gy,addFormSubmission:by,addFormSubmissions:Xi,updateFormSubmission:_y,updateFormSubmissions:My,deleteFormSubmission:Ry,deleteFormSubmissions:Qi}=Ji.actions,xi=t=>t.formSubmissionReducer.instances,ky=u.createSelector([xi],t=>Object.values(t)),vy=t=>s=>s.formSubmissionReducer.instances[t],Ey=S(u.createSelector([ky,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),Vy=S(u.createSelector([xi,Di,(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))})),By=Ji.reducer,_e=M(t=>t.uuid),zy={instances:{}},en=u.createSlice({name:"geoImages",initialState:zy,extraReducers:t=>t.addMatcher(u.isAnyOf(b,W,R),s=>Object.assign(s,zy)),reducers:{initializeGeoImages:_e.initialize,setGeoImage:_e.setOne,setGeoImages:_e.setMany,addGeoImage:_e.addOne,addGeoImages:_e.addMany,updateGeoImage:_e.updateOne,updateGeoImages:_e.updateMany,deleteGeoImage:_e.deleteOne,deleteGeoImages:_e.deleteMany}}),{initializeGeoImages:Wy,setGeoImage:qy,setGeoImages:Cy,addGeoImage:jy,addGeoImages:$y,updateGeoImage:Dy,updateGeoImages:Uy,deleteGeoImage:Ly,deleteGeoImages:Ny}=en.actions,Hy=t=>t.geoImageReducer.instances,tn=u.createSelector([Hy],t=>Object.values(t)),Gy=t=>s=>s.geoImageReducer.instances[t],Ky=S(u.createSelector([tn,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),I_=S(u.createSelector([tn,(t,s)=>s],(t,s)=>T(t.filter(e=>e.project===s)))),Yy=en.reducer,Me=M(t=>t.uuid),Zy={instances:{}},sn=u.createSlice({name:"issueAssociations",initialState:Zy,extraReducers:t=>t.addMatcher(u.isAnyOf(b,W,R),s=>Object.assign(s,Zy)),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:Jy,setIssueAssociations:Xy,setIssueAssociation:Qy,updateIssueAssociation:xy,updateIssueAssociations:ef,addIssueAssociation:tf,addIssueAssociations:Ht,deleteIssueAssociation:sf,deleteIssueAssociations:Gt}=sn.actions,Pt=t=>t.issueAssociationReducer.instances,nf=u.createSelector([Pt],t=>Object.values(t)),af=t=>s=>s.issueAssociationReducer.instances[t],cf=S(u.createSelector([nf,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),rf=S(u.createSelector([Pt,(t,s)=>s],(t,s)=>T(Object.values(t).filter(e=>e.associated_issue===s)))),df=S(u.createSelector([Pt,(t,s)=>s],(t,s)=>T(Object.values(t).filter(e=>e.issue===s)))),lf=S(u.createSelector([Pt,(t,s)=>s],(t,s)=>T(Object.values(t).filter(e=>e.asset===s)))),of=sn.reducer,Re=M(t=>t.uuid),uf={instances:{}},nn=u.createSlice({name:"issueAttachments",initialState:uf,extraReducers:t=>t.addMatcher(u.isAnyOf(b,W,R),s=>Object.assign(s,uf)),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:hf,addIssueAttachment:mf,addIssueAttachments:an,setIssueAttachment:pf,setIssueAttachments:yf,updateIssueAttachment:ff,updateIssueAttachments:Af,deleteIssueAttachment:Sf,deleteIssueAttachments:cn}=nn.actions,Tf=t=>t.issueAttachmentReducer.instances,rn=u.createSelector([Tf],t=>Object.values(t)),wf=S(u.createSelector([rn,(t,s)=>s],(t,s)=>T(t.filter(({issue:e})=>s===e)))),Of=t=>s=>s.issueAttachmentReducer.instances[t],If=S(u.createSelector([rn,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),Ff=nn.reducer,ke=M(t=>t.uuid),Pf={instances:{}},dn=u.createSlice({name:"issueCommentAttachments",initialState:Pf,extraReducers:t=>t.addMatcher(u.isAnyOf(b,W,R),s=>Object.assign(s,Pf)),reducers:{initializeIssueCommentAttachments:ke.initialize,addIssueCommentAttachment:ke.addOne,addIssueCommentAttachments:ke.addMany,setIssueCommentAttachment:ke.setOne,setIssueCommentAttachments:ke.setMany,updateIssueCommentAttachment:ke.updateOne,updateIssueCommentAttachments:ke.updateMany,deleteIssueCommentAttachment:ke.deleteOne,deleteIssueCommentAttachments:ke.deleteMany}}),{initializeIssueCommentAttachments:gf,addIssueCommentAttachment:bf,addIssueCommentAttachments:_f,setIssueCommentAttachment:Mf,setIssueCommentAttachments:Rf,updateIssueCommentAttachment:kf,updateIssueCommentAttachments:vf,deleteIssueCommentAttachment:Ef,deleteIssueCommentAttachments:Vf}=dn.actions,Bf=t=>t.issueCommentAttachmentReducer.instances,ln=u.createSelector([Bf],t=>Object.values(t)),zf=t=>s=>s.issueCommentAttachmentReducer.instances[t],Wf=S(u.createSelector([ln,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),F_=S(u.createSelector([ln,(t,s)=>s],(t,s)=>T(t.filter(({issue_comment:e})=>s===e)))),qf=dn.reducer,ve=M(t=>t.uuid),Cf={instances:{}},on=u.createSlice({name:"issueComments",initialState:Cf,extraReducers:t=>t.addMatcher(u.isAnyOf(b,W,R),s=>Object.assign(s,Cf)),reducers:{initializeIssueComments:ve.initialize,addIssueComment:ve.addOne,addIssueComments:ve.addMany,setIssueComment:ve.setOne,setIssueComments:ve.setMany,updateIssueComment:ve.updateOne,updateIssueComments:ve.updateMany,deleteIssueComment:ve.deleteOne,deleteIssueComments:ve.deleteMany}}),{initializeIssueComments:jf,addIssueComment:$f,addIssueComments:Df,setIssueComment:Uf,setIssueComments:Lf,updateIssueComment:Nf,updateIssueComments:Hf,deleteIssueComment:Gf,deleteIssueComments:Kf}=on.actions,un=t=>t.issueCommentReducer.instances,Yf=t=>s=>s.issueCommentReducer.instances[t],Zf=S(u.createSelector([un,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(Object.values(t).filter(({uuid:n})=>e.has(n)))})),P_=S(u.createSelector([un,(t,s)=>s],(t,s)=>T(Object.values(t).filter(e=>e.issue===s)))),Jf=on.reducer,Ee=M(t=>t.uuid),Xf={instances:{}},hn=u.createSlice({name:"issues",initialState:Xf,extraReducers:t=>t.addMatcher(u.isAnyOf(b,W,R),s=>Object.assign(s,Xf)),reducers:{initializeIssues:Ee.initialize,addIssue:Ee.addOne,addIssues:Ee.addMany,setIssue:Ee.setOne,setIssues:Ee.setMany,updateIssue:Ee.updateOne,updateIssues:Ee.updateMany,deleteIssue:Ee.deleteOne,deleteIssues:Ee.deleteMany}}),{initializeIssues:Qf,addIssue:xf,addIssues:mn,setIssue:eA,setIssues:tA,updateIssue:sA,updateIssues:iA,deleteIssue:nA,deleteIssues:pn}=hn.actions,aA=t=>t.issueReducer.instances,Kt=u.createSelector([aA],t=>Object.values(t)),cA=t=>s=>s.issueReducer.instances[t],rA=S(u.createSelector([Kt,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),g_=S(u.createSelector([Kt,(t,s)=>s],(t,s)=>t.filter(e=>e.project===s))),dA=S(u.createSelector([Kt,(t,s)=>s],(t,s)=>t.filter(e=>e.issue_type===s))),lA=hn.reducer,Ve=M(t=>t.uuid),oA={instances:{}},yn=u.createSlice({name:"issueTypeAttachments",initialState:oA,extraReducers:t=>t.addMatcher(u.isAnyOf(b,R),s=>Object.assign(s,oA)),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:uA,addIssueTypeAttachment:hA,addIssueTypeAttachments:mA,setIssueTypeAttachment:pA,setIssueTypeAttachments:yA,updateIssueTypeAttachment:fA,updateIssueTypeAttachments:AA,deleteIssueTypeAttachment:SA,deleteIssueTypeAttachments:TA}=yn.actions,wA=t=>t.issueTypeAttachmentReducer.instances,fn=u.createSelector([wA],t=>Object.values(t)),OA=t=>s=>s.issueTypeAttachmentReducer.instances[t],IA=S(u.createSelector([fn,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),b_=S(u.createSelector([fn,(t,s)=>s],(t,s)=>T(t.filter(({issue_type:e})=>s===e)))),FA=yn.reducer,Be=M(t=>t.uuid),PA={instances:{}},An=u.createSlice({name:"issueTypeFieldsAttachments",initialState:PA,extraReducers:t=>t.addMatcher(u.isAnyOf(b,R),s=>Object.assign(s,PA)),reducers:{initializeIssueTypeFieldsAttachments:Be.initialize,addIssueTypeFieldsAttachment:Be.addOne,addIssueTypeFieldsAttachments:Be.addMany,setIssueTypeFieldsAttachment:Be.setOne,setIssueTypeFieldsAttachments:Be.setMany,updateIssueTypeFieldsAttachment:Be.updateOne,updateIssueTypeFieldsAttachments:Be.updateMany,deleteIssueTypeFieldsAttachment:Be.deleteOne,deleteIssueTypeFieldsAttachments:Be.deleteMany}}),{initializeIssueTypeFieldsAttachments:gA,addIssueTypeFieldsAttachment:bA,addIssueTypeFieldsAttachments:_A,setIssueTypeFieldsAttachment:MA,setIssueTypeFieldsAttachments:RA,updateIssueTypeFieldsAttachment:kA,updateIssueTypeFieldsAttachments:vA,deleteIssueTypeFieldsAttachment:EA,deleteIssueTypeFieldsAttachments:VA}=An.actions,BA=t=>t.issueTypeFieldsAttachmentReducer.instances,Sn=u.createSelector([BA],t=>Object.values(t)),__=S(u.createSelector([Sn,(t,s)=>s],(t,s)=>T(t.filter(e=>e.fields_revision===s)))),zA=t=>s=>s.issueTypeFieldsAttachmentReducer.instances[t],WA=S(u.createSelector([Sn,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),qA=An.reducer,ze=M(t=>t.uuid),CA={instances:{}},Tn=u.createSlice({name:"issueTypeFieldValues",initialState:CA,extraReducers:t=>t.addMatcher(u.isAnyOf(b,W,R),s=>Object.assign(s,CA)),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:jA,addIssueTypeFieldValues:$A,addIssueTypeFieldValuesMany:DA,setIssueTypeFieldValues:UA,setIssueTypeFieldValuesMany:LA,updateIssueTypeFieldValues:NA,updateIssueTypeFieldValuesMany:HA,deleteIssueTypeFieldValues:GA,deleteIssueTypeFieldValuesMany:KA}=Tn.actions,YA=t=>t.issueTypeFieldValuesReducer.instances,Yt=u.createSelector([YA],t=>Object.values(t)),M_=S(u.createSelector([Yt,(t,s)=>s],(t,s)=>T(t.filter(e=>e.issue===s)))),ZA=t=>s=>s.issueTypeFieldValuesReducer.instances[t],JA=S(u.createSelector([Yt,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),XA=Tn.reducer,We=M(t=>t.uuid),QA={instances:{}},wn=u.createSlice({name:"issueTypeFields",initialState:QA,extraReducers:t=>t.addMatcher(u.isAnyOf(b,R),s=>Object.assign(s,QA)),reducers:{initializeIssueTypeFields:We.initialize,addIssueTypeFields:We.addOne,addIssueTypeFieldsMany:We.addMany,setIssueTypeFields:We.setOne,setIssueTypeFieldsMany:We.setMany,updateIssueTypeFields:We.updateOne,updateIssueTypeFieldsMany:We.updateMany,deleteIssueTypeFields:We.deleteOne,deleteIssueTypeFieldsMany:We.deleteMany}}),{initializeIssueTypeFields:xA,addIssueTypeFields:eS,addIssueTypeFieldsMany:tS,setIssueTypeFields:sS,setIssueTypeFieldsMany:iS,updateIssueTypeFields:nS,updateIssueTypeFieldsMany:aS,deleteIssueTypeFields:cS,deleteIssueTypeFieldsMany:rS}=wn.actions,dS=t=>t.issueTypeFieldsReducer.instances,gt=u.createSelector([dS],t=>Object.values(t)),R_=S(u.createSelector([gt,(t,s)=>s],(t,s)=>T(t.filter(e=>e.issue_type===s)))),k_=S(u.createSelector([gt,(t,s)=>s],(t,s)=>t.filter(e=>e.issue_type===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),v_=S(u.createSelector([gt,Yt,(t,s)=>s],(t,s,e)=>{const n=new Set(t.filter(a=>a.issue_type===e).map(a=>a.uuid));return T(s.filter(a=>n.has(a.fields_revision)))})),lS=t=>s=>s.issueTypeFieldsReducer.instances[t],oS=S(u.createSelector([gt,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),uS=wn.reducer,qe=M(t=>t.uuid),hS={instances:{}},On=u.createSlice({name:"issueTypeFieldValuesAttachments",initialState:hS,extraReducers:t=>t.addMatcher(u.isAnyOf(b,W,R),s=>Object.assign(s,hS)),reducers:{initializeIssueTypeFieldValuesAttachments:qe.initialize,addIssueTypeFieldValuesAttachment:qe.addOne,addIssueTypeFieldValuesAttachments:qe.addMany,setIssueTypeFieldValuesAttachment:qe.setOne,setIssueTypeFieldValuesAttachments:qe.setMany,updateIssueTypeFieldValuesAttachment:qe.updateOne,updateIssueTypeFieldValuesAttachments:qe.updateMany,deleteIssueTypeFieldValuesAttachment:qe.deleteOne,deleteIssueTypeFieldValuesAttachments:qe.deleteMany}}),{initializeIssueTypeFieldValuesAttachments:mS,addIssueTypeFieldValuesAttachment:pS,addIssueTypeFieldValuesAttachments:In,setIssueTypeFieldValuesAttachment:yS,setIssueTypeFieldValuesAttachments:fS,updateIssueTypeFieldValuesAttachment:AS,updateIssueTypeFieldValuesAttachments:SS,deleteIssueTypeFieldValuesAttachment:TS,deleteIssueTypeFieldValuesAttachments:Fn}=On.actions,wS=t=>t.issueTypeFieldValuesAttachmentReducer.instances,Pn=u.createSelector([wS],t=>Object.values(t)),OS=t=>s=>s.issueTypeFieldValuesAttachmentReducer.instances[t],IS=S(u.createSelector([Pn,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),FS=S(u.createSelector([Pn,(t,s)=>s],(t,s)=>T(t.filter(e=>e.field_values===s)))),PS=On.reducer,Ce=M(t=>t.uuid),gS={instances:{}},gn=u.createSlice({name:"issueTypeIdentifiers",initialState:gS,extraReducers:t=>t.addMatcher(u.isAnyOf(b,R),s=>Object.assign(s,gS)),reducers:{initializeIssueTypeIdentifiers:Ce.initialize,addIssueTypeIdentifier:Ce.addOne,addIssueTypeIdentifiers:Ce.addMany,setIssueTypeIdentifier:Ce.setOne,setIssueTypeIdentifiers:Ce.setMany,updateIssueTypeIdentifier:Ce.updateOne,updateIssueTypeIdentifiers:Ce.updateMany,deleteIssueTypeIdentifier:Ce.deleteOne,deleteIssueTypeIdentifiers:Ce.deleteMany}}),{initializeIssueTypeIdentifiers:bS,addIssueTypeIdentifier:_S,addIssueTypeIdentifiers:MS,setIssueTypeIdentifier:RS,setIssueTypeIdentifiers:kS,updateIssueTypeIdentifier:vS,updateIssueTypeIdentifiers:ES,deleteIssueTypeIdentifier:VS,deleteIssueTypeIdentifiers:BS}=gn.actions,zS=t=>t.issueTypeIdentifierReducer.instances,bn=u.createSelector([zS],t=>Object.values(t)),WS=t=>s=>s.issueTypeIdentifierReducer.instances[t],qS=S(u.createSelector([bn,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),E_=S(u.createSelector([bn,(t,s)=>s],(t,s)=>T(t.filter(e=>e.issue_type===s)))),CS=gn.reducer,je=M(t=>t.uuid),jS={instances:{}},_n=u.createSlice({name:"issueTypeIdentifierValues",initialState:jS,extraReducers:t=>t.addMatcher(u.isAnyOf(b,W,R),s=>Object.assign(s,jS)),reducers:{initializeIssueTypeIdentifierValues:je.initialize,addIssueTypeIdentifierValue:je.addOne,addIssueTypeIdentifierValues:je.addMany,setIssueTypeIdentifierValue:je.setOne,setIssueTypeIdentifierValues:je.setMany,updateIssueTypeIdentifierValue:je.updateOne,updateIssueTypeIdentifierValues:je.updateMany,deleteIssueTypeIdentifierValue:je.deleteOne,deleteIssueTypeIdentifierValues:je.deleteMany}}),{initializeIssueTypeIdentifierValues:$S,addIssueTypeIdentifierValue:DS,addIssueTypeIdentifierValues:US,setIssueTypeIdentifierValue:LS,setIssueTypeIdentifierValues:NS,updateIssueTypeIdentifierValue:HS,updateIssueTypeIdentifierValues:GS,deleteIssueTypeIdentifierValue:KS,deleteIssueTypeIdentifierValues:YS}=_n.actions,ZS=t=>t.issueTypeIdentifierValueReducer.instances,Zt=u.createSelector([ZS],t=>Object.values(t)),JS=t=>s=>s.issueTypeIdentifierValueReducer.instances[t],XS=S(u.createSelector([Zt,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),V_=S(u.createSelector([Zt,(t,s)=>s],(t,s)=>T(t.filter(e=>e.issue===s)))),B_=S(u.createSelector([Zt,(t,s)=>s],(t,s)=>T(t.filter(e=>e.issue_type_identifier===s)))),QS=_n.reducer,$e=M(t=>t.uuid),xS={instances:{}},Mn=u.createSlice({name:"issueTypes",initialState:xS,extraReducers:t=>t.addMatcher(u.isAnyOf(b,R),s=>Object.assign(s,xS)),reducers:{initializeIssueTypes:$e.initialize,addIssueType:$e.addOne,addIssueTypes:$e.addMany,setIssueType:$e.setOne,setIssueTypes:$e.setMany,updateIssueType:$e.updateOne,updateIssueTypes:$e.updateMany,deleteIssueType:$e.deleteOne,deleteIssueTypes:$e.deleteMany}}),{initializeIssueTypes:eT,addIssueType:tT,addIssueTypes:sT,setIssueType:iT,setIssueTypes:nT,updateIssueType:aT,updateIssueTypes:cT,deleteIssueType:rT,deleteIssueTypes:dT}=Mn.actions,lT=t=>t.issueTypeReducer.instances,Rn=u.createSelector(lT,t=>Object.values(t)),oT=t=>s=>s.issueTypeReducer.instances[t],uT=S(u.createSelector([Rn,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),z_=S(u.createSelector([Rn,(t,s)=>s],(t,s)=>T(t.filter(e=>e.organization===s)))),hT=Mn.reducer,De=M(t=>t.uuid),mT={instances:{}},kn=u.createSlice({name:"issueTypeStatuses",initialState:mT,extraReducers:t=>t.addMatcher(u.isAnyOf(b,R),s=>Object.assign(s,mT)),reducers:{initializeIssueTypeStatuses:De.initialize,addIssueTypeStatus:De.addOne,addIssueTypeStatuses:De.addMany,setIssueTypeStatus:De.setOne,setIssueTypeStatuses:De.setMany,updateIssueTypeStatus:De.updateOne,updateIssueTypeStatuses:De.updateMany,deleteIssueTypeStatus:De.deleteOne,deleteIssueTypeStatuses:De.deleteMany}}),{initializeIssueTypeStatuses:pT,addIssueTypeStatus:yT,addIssueTypeStatuses:fT,setIssueTypeStatus:AT,setIssueTypeStatuses:ST,updateIssueTypeStatus:TT,updateIssueTypeStatuses:wT,deleteIssueTypeStatus:OT,deleteIssueTypeStatuses:IT}=kn.actions,FT=t=>t.issueTypeStatusReducer.instances,vn=u.createSelector([FT],t=>T(Object.values(t).toSorted(yc))),En=t=>s=>s.issueTypeStatusReducer.instances[t],PT=S(u.createSelector([vn,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),W_=S(u.createSelector([vn,(t,s)=>s],(t,s)=>T(t.filter(e=>e.issue_type===s)))),gT=kn.reducer,Ue=M(t=>t.uuid),bT={instances:{}},Vn=u.createSlice({name:"issueUpdates",initialState:bT,extraReducers:t=>t.addMatcher(u.isAnyOf(b,W,R),s=>Object.assign(s,bT)),reducers:{initializeIssueUpdates:Ue.initialize,addIssueUpdate:Ue.addOne,addIssueUpdates:Ue.addMany,setIssueUpdate:Ue.setOne,setIssueUpdates:Ue.setMany,updateIssueUpdate:Ue.updateOne,updateIssueUpdates:Ue.updateMany,deleteIssueUpdate:Ue.deleteOne,deleteIssueUpdates:Ue.deleteMany}}),{initializeIssueUpdates:_T,addIssueUpdate:Bn,addIssueUpdates:zn,setIssueUpdate:MT,setIssueUpdates:RT,updateIssueUpdate:kT,updateIssueUpdates:vT,deleteIssueUpdate:Wn,deleteIssueUpdates:qn}=Vn.actions,Cn=t=>t.issueUpdateReducer.instances,jn=u.createSelector([Cn],t=>Object.values(t)),ET=S(u.createSelector([Cn,(t,s)=>s],(t,s)=>t[s])),VT=S(u.createSelector([jn,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),BT=S(u.createSelector([jn,(t,s)=>s],(t,s)=>T(t.filter(e=>e.issue===s)))),zT=Vn.reducer,Le=M(t=>t.id),WT={instances:{},currentUser:null},$n=u.createSlice({name:"users",initialState:WT,extraReducers:t=>t.addMatcher(u.isAnyOf(b,R),s=>Object.assign(s,WT)),reducers:{initializeUsers:Le.initialize,setUsers:Le.setMany,setUser:Le.setOne,addUsers:Le.addMany,addUser:Le.addOne,updateUsers:Le.updateMany,updateUser:Le.updateOne,deleteUser:Le.deleteOne,deleteUsers:Le.deleteMany,setCurrentUser:(t,s)=>{t.currentUser=s.payload},setProfilePicture:(t,s)=>{if(!t.currentUser)return;t.currentUser.profile.file=s.payload.file??null,t.currentUser.profile.file_sha1=s.payload.file_sha1??null;const e=t.instances[t.currentUser.id];if(!e)throw new Error("Unable to find current user in users slice");e.profile.file=s.payload.file??null,e.profile.file_sha1=s.payload.file_sha1??null}}}),{initializeUsers:qT,setUsers:CT,setUser:jT,addUsers:$T,addUser:Dn,updateUsers:DT,updateUser:UT,deleteUser:Un,deleteUsers:LT,setCurrentUser:q_,setProfilePicture:C_}=$n.actions,NT=$n.reducer,HT=t=>t.userReducer.currentUser,Ln=t=>t.userReducer.instances,Jt=u.createSelector([Ln],t=>Object.values(t)),Xt=t=>s=>s.userReducer.instances[t],GT=S(u.createSelector([Jt,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({id:n})=>e.has(n)))})),Ne=M(t=>t.uuid),KT={instances:{}},Nn=u.createSlice({name:"organizationAccess",initialState:KT,extraReducers:t=>t.addMatcher(u.isAnyOf(b,R),s=>Object.assign(s,KT)),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:YT,addOrganizationAccess:ZT,addOrganizationAccesses:JT,setOrganizationAccess:XT,setOrganizationAccesses:QT,updateOrganizationAccess:xT,updateOrganizationAccesses:ew,deleteOrganizationAccess:tw,deleteOrganizationAccesses:sw}=Nn.actions,iw=Nn.reducer,Qt=t=>t.organizationAccessReducer.instances,nw=t=>s=>s.organizationAccessReducer.instances[t],aw=S(u.createSelector([Qt,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(Object.values(t).filter(({uuid:n})=>e.has(n)))})),j_=u.createSelector([HT,Qt],(t,s)=>Object.values(s).find(n=>n.user===(t==null?void 0:t.id))??null),cw=u.createSelector([Qt],t=>{const s={};for(const e of Object.values(t))s[e.user]=e;return kt(s)}),$_=S(u.createSelector([Ln,cw,(t,s)=>s],(t,s,e)=>T(Object.values(t).filter(n=>{const a=s[n.id];return!!a&&a.organization===e})))),He=M(t=>t.uuid),rw={instances:{}},Hn=u.createSlice({name:"organizations",initialState:rw,extraReducers:t=>t.addMatcher(u.isAnyOf(b,R),s=>Object.assign(s,rw)),reducers:{initializeOrganizations:He.initialize,setOrganizations:He.setMany,setOrganization:He.setOne,addOrganizations:He.addMany,addOrganization:He.addOne,updateOrganizations:He.updateMany,updateOrganization:He.updateOne,deleteOrganization:He.deleteOne,deleteOrganizations:He.deleteMany}}),{initializeOrganizations:dw,setOrganizations:lw,setOrganization:ow,addOrganizations:uw,addOrganization:hw,updateOrganizations:mw,updateOrganization:pw,deleteOrganization:yw,deleteOrganizations:fw}=Hn.actions,Aw=t=>t.organizationReducer.instances,Sw=u.createSelector([Aw],t=>Object.values(t)),Tw=t=>s=>s.organizationReducer.instances[t],ww=S(u.createSelector([Sw,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),Ow=Hn.reducer,Iw=(t,s,e)=>{const n=t.uuid?t:{...t,uuid:ht.v4()};return{payload:n,type:"",meta:{offline:{effect:{timestamp:new Date().toISOString(),request:n,BASE_URL:s,serviceName:e}}}}},Fw={deletedRequests:[],latestRetryTime:0},Gn=u.createSlice({name:"outbox",initialState:Fw,extraReducers:t=>t.addCase(b,s=>Object.assign(s,Fw)),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 Iw(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}}}),D_=t=>t.outboxReducer.deletedRequests,U_=t=>t.outboxReducer.latestRetryTime,{enqueueRequest:Pw,markForDeletion:L_,markAsDeleted:gw,_setLatestRetryTime:bw}=Gn.actions,_w=Gn.reducer,Ge=M(t=>t.uuid),Mw={instances:{}},Kn=u.createSlice({name:"projectAccess",initialState:Mw,extraReducers:t=>t.addMatcher(u.isAnyOf(b,R),s=>Object.assign(s,Mw)),reducers:{initializeProjectAccesses:Ge.initialize,addProjectAccess:Ge.addOne,addProjectAccesses:Ge.addMany,setProjectAccess:Ge.setOne,setProjectAccesses:Ge.setMany,updateProjectAccess:Ge.updateOne,updateProjectAccesses:Ge.updateMany,deleteProjectAccess:Ge.deleteOne,deleteProjectAccesses:Ge.deleteMany}}),{initializeProjectAccesses:Rw,addProjectAccess:kw,addProjectAccesses:vw,setProjectAccess:Ew,setProjectAccesses:Vw,updateProjectAccess:Bw,updateProjectAccesses:zw,deleteProjectAccess:Ww,deleteProjectAccesses:qw}=Kn.actions,Cw=Kn.reducer,Yn=t=>t.projectAccessReducer.instances,bt=u.createSelector(Yn,t=>Object.values(t)),jw=t=>s=>s.projectAccessReducer.instances[t],$w=S(u.createSelector([bt,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),N_=S(u.createSelector([Yn,(t,s)=>s],(t,s)=>T(Object.values(t).filter(e=>e.project===s)))),H_=S(u.createSelector([bt,(t,s)=>s],(t,s)=>{const e={};for(const n of t.filter(a=>a.project===s))e[n.user]=n;return e})),G_=S(u.createSelector([Jt,bt,(t,s)=>s],(t,s,e)=>{const n=new Set(s.filter(a=>a.project===e).map(a=>a.user));return T(t.filter(a=>n.has(a.id)))})),Ke=M(t=>t.uuid),Dw={instances:{}},Zn=u.createSlice({name:"projectAttachments",initialState:Dw,extraReducers:t=>t.addMatcher(u.isAnyOf(b,R),s=>Object.assign(s,Dw)),reducers:{initializeProjectAttachments:Ke.initialize,addProjectAttachment:Ke.addOne,addProjectAttachments:Ke.addMany,setProjectAttachment:Ke.setOne,setProjectAttachments:Ke.setMany,updateProjectAttachment:Ke.updateOne,updateProjectAttachments:Ke.updateMany,deleteProjectAttachment:Ke.deleteOne,deleteProjectAttachments:Ke.deleteMany}}),{initializeProjectAttachments:Uw,addProjectAttachment:Lw,addProjectAttachments:Nw,setProjectAttachment:Hw,setProjectAttachments:Gw,updateProjectAttachment:Kw,updateProjectAttachments:Yw,deleteProjectAttachment:Zw,deleteProjectAttachments:Jw}=Zn.actions,Xw=t=>t.projectAttachmentReducer.instances,Jn=u.createSelector([Xw],t=>Object.values(t)),Qw=t=>s=>s.projectAttachmentReducer.instances[t],xw=S(u.createSelector([Jn,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),K_=S(u.createSelector([Jn,(t,s)=>s],(t,s)=>T(t.filter(({project:e})=>s===e)))),eO=Zn.reducer,Ye=M(t=>t.uuid),tO={instances:{},activeProjectFileId:null,isImportingProjectFile:!1},Xn=u.createSlice({name:"projectFiles",initialState:tO,extraReducers:t=>t.addMatcher(u.isAnyOf(b,W,R),s=>Object.assign(s,tO)),reducers:{initializeProjectFiles:Ye.initialize,setProjectFile:Ye.setOne,setProjectFiles:Ye.setMany,addProjectFile:Ye.addOne,addProjectFiles:Ye.addMany,updateProjectFile:Ye.updateOne,updateProjectFiles:Ye.updateMany,deleteProjectFile:Ye.deleteOne,deleteProjectFiles:Ye.deleteMany,setIsImportingProjectFile:(t,s)=>{t.isImportingProjectFile=s.payload},saveActiveProjectFileBounds:(t,s)=>{const e=t.activeProjectFileId;if(!e)throw new Error("Tried to save bounds for active project file, but no active project file was set.");if(!t.instances[e])throw new Error(`Tried to save bounds for active project file, but project file with ID ${e}
|
|
2
|
-
doesn't exist.`);t.instances[e].bounds=s.payload},setActiveProjectFileId:(t,s)=>{t.activeProjectFileId=s.payload}}}),{initializeProjectFiles:sO,setProjectFile:iO,setProjectFiles:nO,addProjectFile:aO,addProjectFiles:cO,updateProjectFile:rO,updateProjectFiles:dO,deleteProjectFile:lO,deleteProjectFiles:oO,setIsImportingProjectFile:uO,setActiveProjectFileId:hO,saveActiveProjectFileBounds:mO}=Xn.actions,pO=t=>t.projectFileReducer.instances,yO=u.createSelector([pO],t=>T(Object.values(t).sort((s,e)=>s.z_index-e.z_index))),fO=t=>s=>s.projectFileReducer.instances[t],AO=S(u.createSelector([yO,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),Y_=t=>t.projectFileReducer.activeProjectFileId,Z_=t=>t.projectFileReducer.isImportingProjectFile,SO=Xn.reducer,Ze=M(t=>t.uuid),TO={instances:{}},Qn=u.createSlice({name:"projects",initialState:TO,extraReducers:t=>t.addMatcher(u.isAnyOf(b,R),s=>Object.assign(s,TO)),reducers:{initializeProjects:Ze.initialize,setProjects:Ze.setMany,setProject:Ze.setOne,addProjects:Ze.addMany,addProject:Ze.addOne,updateProjects:Ze.updateMany,updateProject:Ze.updateOne,deleteProject:Ze.deleteOne,deleteProjects:Ze.deleteMany}}),{initializeProjects:wO,setProjects:OO,setProject:IO,addProjects:FO,addProject:PO,updateProjects:gO,updateProject:bO,deleteProject:_O,deleteProjects:MO}=Qn.actions,RO=Qn.reducer,kO=t=>t.projectReducer.instances,xt=u.createSelector([kO],t=>Object.values(t)),vO=t=>s=>s.projectReducer.instances[t],EO=S(u.createSelector([xt,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),J_=S(u.createSelector([xt,bt,(t,s)=>s],(t,s,e)=>{const n=new Set(s.filter(a=>a.user===e).map(a=>a.project));return T(t.filter(a=>n.has(a.uuid)))})),X_=S(u.createSelector([xt,(t,s)=>s],(t,s)=>T(t.filter(e=>e.organization===s)))),Q_={isRehydrated:!1},xn=u.createSlice({name:"rehydrated",initialState:Q_,reducers:{setRehydrated:(t,s)=>{t.isRehydrated=s.payload}}}),{setRehydrated:x_}=xn.actions,eM=t=>t.rehydratedReducer.isRehydrated,VO=xn.reducer,Je=M(t=>t.uuid),BO={instances:{}},ea=u.createSlice({name:"teamMemberships",initialState:BO,extraReducers:t=>t.addMatcher(u.isAnyOf(b,R),s=>Object.assign(s,BO)),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:zO,addTeamMembership:WO,addTeamMemberships:qO,setTeamMembership:CO,setTeamMemberships:jO,updateTeamMembership:$O,updateTeamMemberships:DO,deleteTeamMembership:UO,deleteTeamMemberships:LO}=ea.actions,NO=ea.reducer,HO=t=>t.teamMembershipReducer.instances,es=u.createSelector([HO],t=>Object.values(t)),GO=t=>s=>s.teamMembershipReducer.instances[t],KO=S(u.createSelector([es,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),tM=S(u.createSelector([es,(t,s)=>s],(t,s)=>{const e={};for(const n of t.filter(a=>a.team===s))e[n.user]=n;return e})),sM=S(u.createSelector([Jt,es,(t,s)=>s],(t,s,e)=>{const n=new Set(s.filter(a=>a.team===e).map(a=>a.user));return T(t.filter(a=>n.has(a.id)))})),Xe=M(t=>t.uuid),YO={instances:{}},ta=u.createSlice({name:"teams",initialState:YO,extraReducers:t=>t.addMatcher(u.isAnyOf(b,R),s=>Object.assign(s,YO)),reducers:{initializeTeams:Xe.initialize,addTeam:Xe.addOne,addTeams:Xe.addMany,setTeam:Xe.setOne,setTeams:Xe.setMany,updateTeam:Xe.updateOne,updateTeams:Xe.updateMany,deleteTeam:Xe.deleteOne,deleteTeams:Xe.deleteMany}}),{initializeTeams:ZO,addTeam:JO,addTeams:XO,setTeam:QO,setTeams:xO,updateTeam:eI,updateTeams:tI,deleteTeam:sI,deleteTeams:iI}=ta.actions,nI=t=>t.teamReducer.instances,sa=u.createSelector([nI],t=>Object.values(t)),aI=t=>s=>s.teamReducer.instances[t],cI=S(u.createSelector([sa,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),iM=S(u.createSelector([sa,(t,s)=>s],(t,s)=>T(t.filter(e=>e.organization===s)))),rI=ta.reducer,Qe=M(t=>t.uuid),dI={instances:{}},ia=u.createSlice({name:"workflows",initialState:dI,extraReducers:t=>t.addMatcher(u.isAnyOf(b,W,R),s=>Object.assign(s,dI)),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:lI,addWorkflow:oI,addWorkflows:na,setWorkflow:uI,setWorkflows:hI,updateWorkflow:mI,updateWorkflows:pI,deleteWorkflow:yI,deleteWorkflows:aa}=ia.actions,fI=t=>t.workflowReducer.instances,ts=u.createSelector([fI],t=>Object.values(t)),AI=t=>s=>s.workflowReducer.instances[t],SI=S(u.createSelector([ts,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),nM=S(u.createSelector([ts,(t,s)=>s],(t,s)=>T(t.filter(e=>e.project===s)))),TI=S(u.createSelector([ts,(t,s)=>s],(t,s)=>T(t.filter(e=>e.workflow_type===s)))),wI=ia.reducer,xe=M(t=>t.uuid),OI={instances:{}},ca=u.createSlice({name:"workflowStepAssignees",initialState:OI,extraReducers:t=>t.addMatcher(u.isAnyOf(b,W,R),s=>Object.assign(s,OI)),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:II,addWorkflowStepAssignee:FI,addWorkflowStepAssignees:ra,setWorkflowStepAssignee:PI,setWorkflowStepAssignees:gI,updateWorkflowStepAssignee:bI,updateWorkflowStepAssignees:_I,deleteWorkflowStepAssignee:MI,deleteWorkflowStepAssignees:da}=ca.actions,RI=t=>t.workflowStepAssigneeReducer.instances,_t=u.createSelector([RI],t=>Object.values(t)),kI=t=>s=>s.workflowStepAssigneeReducer.instances[t],vI=S(u.createSelector([_t,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),EI=S(u.createSelector([_t,(t,s)=>s],(t,s)=>T(t.filter(e=>e.workflow===s)))),aM=S(u.createSelector([_t,(t,s)=>s],(t,s)=>T(t.filter(e=>e.workflow_step===s)))),cM=S(u.createSelector([_t,(t,s)=>s],(t,s)=>T(t.filter(e=>e.user===s)))),VI=ca.reducer,et=M(t=>t.uuid),BI={instances:{}},la=u.createSlice({name:"workflowStepCommentAttachments",initialState:BI,extraReducers:t=>t.addMatcher(u.isAnyOf(b,W,R),s=>Object.assign(s,BI)),reducers:{initializeWorkflowStepCommentAttachments:et.initialize,addWorkflowStepCommentAttachment:et.addOne,addWorkflowStepCommentAttachments:et.addMany,setWorkflowStepCommentAttachment:et.setOne,setWorkflowStepCommentAttachments:et.setMany,updateWorkflowStepCommentAttachment:et.updateOne,updateWorkflowStepCommentAttachments:et.updateMany,deleteWorkflowStepCommentAttachment:et.deleteOne,deleteWorkflowStepCommentAttachments:et.deleteMany}}),{initializeWorkflowStepCommentAttachments:zI,addWorkflowStepCommentAttachment:WI,addWorkflowStepCommentAttachments:ss,setWorkflowStepCommentAttachment:qI,setWorkflowStepCommentAttachments:CI,updateWorkflowStepCommentAttachment:jI,updateWorkflowStepCommentAttachments:$I,deleteWorkflowStepCommentAttachment:DI,deleteWorkflowStepCommentAttachments:is}=la.actions,UI=t=>t.workflowStepCommentAttachmentReducer.instances,oa=u.createSelector([UI],t=>Object.values(t)),LI=t=>s=>s.workflowStepCommentAttachmentReducer.instances[t],NI=S(u.createSelector([oa,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),ua=S(u.createSelector([oa,(t,s)=>s],(t,s)=>T(t.filter(e=>e.workflow_step_comment===s)))),HI=la.reducer,tt=M(t=>t.uuid),GI={instances:{}},ha=u.createSlice({name:"workflowStepComments",initialState:GI,extraReducers:t=>t.addMatcher(u.isAnyOf(b,W,R),s=>Object.assign(s,GI)),reducers:{initializeWorkflowStepComments:tt.initialize,addWorkflowStepComment:tt.addOne,addWorkflowStepComments:tt.addMany,setWorkflowStepComment:tt.setOne,setWorkflowStepComments:tt.setMany,updateWorkflowStepComment:tt.updateOne,updateWorkflowStepComments:tt.updateMany,deleteWorkflowStepComment:tt.deleteOne,deleteWorkflowStepComments:tt.deleteMany}}),{initializeWorkflowStepComments:KI,addWorkflowStepComment:YI,addWorkflowStepComments:ma,setWorkflowStepComment:ZI,setWorkflowStepComments:JI,updateWorkflowStepComment:XI,updateWorkflowStepComments:QI,deleteWorkflowStepComment:xI,deleteWorkflowStepComments:pa}=ha.actions,eF=t=>t.workflowStepCommentReducer.instances,ns=u.createSelector([eF],t=>Object.values(t)),tF=t=>s=>s.workflowStepCommentReducer.instances[t],sF=S(u.createSelector([ns,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),iF=S(u.createSelector([ns,(t,s)=>s],(t,s)=>T(t.filter(e=>e.workflow===s)))),rM=S(u.createSelector([ns,(t,s)=>s],(t,s)=>T(t.filter(e=>e.workflow_step===s)))),nF=ha.reducer,st=M(t=>t.uuid),aF={instances:{}},ya=u.createSlice({name:"workflowStepCompletions",initialState:aF,extraReducers:t=>t.addMatcher(u.isAnyOf(b,W,R),s=>Object.assign(s,aF)),reducers:{initializeWorkflowStepCompletions:st.initialize,addWorkflowStepCompletion:st.addOne,addWorkflowStepCompletions:st.addMany,setWorkflowStepCompletion:st.setOne,setWorkflowStepCompletions:st.setMany,updateWorkflowStepCompletion:st.updateOne,updateWorkflowStepCompletions:st.updateMany,deleteWorkflowStepCompletion:st.deleteOne,deleteWorkflowStepCompletions:st.deleteMany}}),{initializeWorkflowStepCompletions:cF,addWorkflowStepCompletion:rF,addWorkflowStepCompletions:fa,setWorkflowStepCompletion:dF,setWorkflowStepCompletions:lF,updateWorkflowStepCompletion:oF,updateWorkflowStepCompletions:uF,deleteWorkflowStepCompletion:hF,deleteWorkflowStepCompletions:Aa}=ya.actions,mF=t=>t.workflowStepCompletionReducer.instances,as=u.createSelector([mF],t=>Object.values(t)),pF=t=>s=>s.workflowStepCompletionReducer.instances[t],yF=S(u.createSelector([as,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),fF=S(u.createSelector([as,(t,s)=>s],(t,s)=>T(t.filter(e=>e.workflow===s)))),dM=S(u.createSelector([as,(t,s)=>s],(t,s)=>T(t.filter(e=>e.workflow_step===s)))),AF=ya.reducer,it=M(t=>t.uuid),SF={instances:{}},Sa=u.createSlice({name:"workflowStepFieldValuesAttachments",initialState:SF,extraReducers:t=>t.addMatcher(u.isAnyOf(b,W,R),s=>Object.assign(s,SF)),reducers:{initializeWorkflowStepFieldValuesAttachments:it.initialize,addWorkflowStepFieldValuesAttachment:it.addOne,addWorkflowStepFieldValuesAttachments:it.addMany,setWorkflowStepFieldValuesAttachment:it.setOne,setWorkflowStepFieldValuesAttachments:it.setMany,updateWorkflowStepFieldValuesAttachment:it.updateOne,updateWorkflowStepFieldValuesAttachments:it.updateMany,deleteWorkflowStepFieldValuesAttachment:it.deleteOne,deleteWorkflowStepFieldValuesAttachments:it.deleteMany}}),{initializeWorkflowStepFieldValuesAttachments:TF,addWorkflowStepFieldValuesAttachment:wF,addWorkflowStepFieldValuesAttachments:Ta,setWorkflowStepFieldValuesAttachment:OF,setWorkflowStepFieldValuesAttachments:IF,updateWorkflowStepFieldValuesAttachment:FF,updateWorkflowStepFieldValuesAttachments:PF,deleteWorkflowStepFieldValuesAttachment:gF,deleteWorkflowStepFieldValuesAttachments:wa}=Sa.actions,bF=t=>t.workflowStepFieldValuesAttachmentReducer.instances,Oa=u.createSelector([bF],t=>Object.values(t)),_F=t=>s=>s.workflowStepFieldValuesAttachmentReducer.instances[t],MF=S(u.createSelector([Oa,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),RF=S(u.createSelector([Oa,(t,s)=>s],(t,s)=>T(t.filter(e=>e.field_values===s)))),kF=Sa.reducer,nt=M(t=>t.uuid),vF={instances:{}},Ia=u.createSlice({name:"workflowStepFieldValues",initialState:vF,extraReducers:t=>t.addMatcher(u.isAnyOf(b,W,R),s=>Object.assign(s,vF)),reducers:{initializeWorkflowStepFieldValues:nt.initialize,addWorkflowStepFieldValues:nt.addOne,addWorkflowStepFieldValuesMany:nt.addMany,setWorkflowStepFieldValues:nt.setOne,setWorkflowStepFieldValuesMany:nt.setMany,updateWorkflowStepFieldValues:nt.updateOne,updateWorkflowStepFieldValuesMany:nt.updateMany,deleteWorkflowStepFieldValues:nt.deleteOne,deleteWorkflowStepFieldValuesMany:nt.deleteMany}}),{initializeWorkflowStepFieldValues:EF,addWorkflowStepFieldValues:VF,addWorkflowStepFieldValuesMany:Fa,setWorkflowStepFieldValues:BF,setWorkflowStepFieldValuesMany:zF,updateWorkflowStepFieldValues:WF,updateWorkflowStepFieldValuesMany:qF,deleteWorkflowStepFieldValues:CF,deleteWorkflowStepFieldValuesMany:Pa}=Ia.actions,jF=t=>t.workflowStepFieldValuesReducer.instances,Mt=u.createSelector([jF],t=>Object.values(t)),$F=S(u.createSelector([Mt,(t,s)=>s],(t,s)=>T(t.filter(e=>e.workflow===s)))),lM=S(u.createSelector([Mt,(t,s)=>s],(t,s)=>T(t.filter(e=>e.workflow_step===s)))),oM=S(u.createSelector([Mt,(t,s)=>s],(t,s)=>T(t.filter(e=>e.fields_revision===s)))),DF=t=>s=>s.workflowStepFieldValuesReducer.instances[t],UF=S(u.createSelector([Mt,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),LF=Ia.reducer,at=M(t=>t.uuid),NF={instances:{}},ga=u.createSlice({name:"workflowStepFieldsAttachments",initialState:NF,extraReducers:t=>t.addMatcher(u.isAnyOf(b,R),s=>Object.assign(s,NF)),reducers:{initializeWorkflowStepFieldsAttachments:at.initialize,addWorkflowStepFieldsAttachment:at.addOne,addWorkflowStepFieldsAttachments:at.addMany,setWorkflowStepFieldsAttachment:at.setOne,setWorkflowStepFieldsAttachments:at.setMany,updateWorkflowStepFieldsAttachment:at.updateOne,updateWorkflowStepFieldsAttachments:at.updateMany,deleteWorkflowStepFieldsAttachment:at.deleteOne,deleteWorkflowStepFieldsAttachments:at.deleteMany}}),{initializeWorkflowStepFieldsAttachments:HF,addWorkflowStepFieldsAttachment:GF,addWorkflowStepFieldsAttachments:ba,setWorkflowStepFieldsAttachment:KF,setWorkflowStepFieldsAttachments:YF,updateWorkflowStepFieldsAttachment:ZF,updateWorkflowStepFieldsAttachments:JF,deleteWorkflowStepFieldsAttachment:XF,deleteWorkflowStepFieldsAttachments:_a}=ga.actions,QF=t=>t.workflowStepFieldsAttachmentReducer.instances,Ma=u.createSelector([QF],t=>Object.values(t)),xF=S(u.createSelector([Ma,(t,s)=>s],(t,s)=>T(t.filter(e=>e.fields_revision===s)))),eP=t=>s=>s.workflowStepFieldsAttachmentReducer.instances[t],tP=S(u.createSelector([Ma,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),sP=ga.reducer,ct=M(t=>t.uuid),iP={instances:{}},Ra=u.createSlice({name:"workflowStepFields",initialState:iP,extraReducers:t=>t.addMatcher(u.isAnyOf(b,R),s=>Object.assign(s,iP)),reducers:{initializeWorkflowStepFields:ct.initialize,addWorkflowStepFields:ct.addOne,addWorkflowStepFieldsMany:ct.addMany,setWorkflowStepFields:ct.setOne,setWorkflowStepFieldsMany:ct.setMany,updateWorkflowStepFields:ct.updateOne,updateWorkflowStepFieldsMany:ct.updateMany,deleteWorkflowStepFields:ct.deleteOne,deleteWorkflowStepFieldsMany:ct.deleteMany}}),{initializeWorkflowStepFields:nP,addWorkflowStepFields:aP,addWorkflowStepFieldsMany:cP,setWorkflowStepFields:rP,setWorkflowStepFieldsMany:dP,updateWorkflowStepFields:lP,updateWorkflowStepFieldsMany:oP,deleteWorkflowStepFields:uP,deleteWorkflowStepFieldsMany:hP}=Ra.actions,ka=t=>t.workflowStepFieldsReducer.instances,cs=u.createSelector([ka],t=>Object.values(t)),uM=S(u.createSelector([cs,(t,s)=>s],(t,s)=>T(t.filter(e=>e.workflow_step===s)))),hM=S(u.createSelector([cs,(t,s)=>s],(t,s)=>t.filter(e=>e.workflow_step===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),mM=u.createSelector([ka],t=>{const s={};for(const e of Object.values(t)){const n=s[e.workflow_step];(!n||n.submitted_at<e.submitted_at)&&(s[e.workflow_step]=e)}return s}),mP=t=>s=>s.workflowStepFieldsReducer.instances[t],pP=S(u.createSelector([cs,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),yP=Ra.reducer,rt=M(t=>t.uuid),fP={instances:{}},va=u.createSlice({name:"workflowStepReviewRequests",initialState:fP,extraReducers:t=>t.addMatcher(u.isAnyOf(b,W,R),s=>Object.assign(s,fP)),reducers:{initializeWorkflowStepReviewRequests:rt.initialize,addWorkflowStepReviewRequest:rt.addOne,addWorkflowStepReviewRequests:rt.addMany,setWorkflowStepReviewRequest:rt.setOne,setWorkflowStepReviewRequests:rt.setMany,updateWorkflowStepReviewRequest:rt.updateOne,updateWorkflowStepReviewRequests:rt.updateMany,deleteWorkflowStepReviewRequest:rt.deleteOne,deleteWorkflowStepReviewRequests:rt.deleteMany}}),{initializeWorkflowStepReviewRequests:AP,addWorkflowStepReviewRequest:SP,addWorkflowStepReviewRequests:Ea,setWorkflowStepReviewRequest:TP,setWorkflowStepReviewRequests:wP,updateWorkflowStepReviewRequest:OP,updateWorkflowStepReviewRequests:IP,deleteWorkflowStepReviewRequest:FP,deleteWorkflowStepReviewRequests:Va}=va.actions,PP=t=>t.workflowStepReviewRequestReducer.instances,rs=u.createSelector([PP],t=>Object.values(t)),gP=t=>s=>s.workflowStepReviewRequestReducer.instances[t],bP=S(u.createSelector([rs,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),_P=S(u.createSelector([rs,(t,s)=>s],(t,s)=>T(t.filter(e=>e.workflow===s)))),pM=S(u.createSelector([rs,(t,s)=>s],(t,s)=>T(t.filter(e=>e.workflow_step===s)))),MP=va.reducer,dt=M(t=>t.uuid),RP={instances:{}},Ba=u.createSlice({name:"workflowStepReviews",initialState:RP,extraReducers:t=>t.addMatcher(u.isAnyOf(b,W,R),s=>Object.assign(s,RP)),reducers:{initializeWorkflowStepReviews:dt.initialize,addWorkflowStepReview:dt.addOne,addWorkflowStepReviews:dt.addMany,setWorkflowStepReview:dt.setOne,setWorkflowStepReviews:dt.setMany,updateWorkflowStepReview:dt.updateOne,updateWorkflowStepReviews:dt.updateMany,deleteWorkflowStepReview:dt.deleteOne,deleteWorkflowStepReviews:dt.deleteMany}}),{initializeWorkflowStepReviews:kP,addWorkflowStepReview:vP,addWorkflowStepReviews:za,setWorkflowStepReview:EP,setWorkflowStepReviews:VP,updateWorkflowStepReview:BP,updateWorkflowStepReviews:zP,deleteWorkflowStepReview:WP,deleteWorkflowStepReviews:Wa}=Ba.actions,qP=t=>t.workflowStepReviewReducer.instances,ds=u.createSelector([qP],t=>Object.values(t)),CP=t=>s=>s.workflowStepReviewReducer.instances[t],jP=S(u.createSelector([ds,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),$P=S(u.createSelector([ds,(t,s)=>s],(t,s)=>T(t.filter(e=>e.workflow===s)))),yM=S(u.createSelector([ds,(t,s)=>s],(t,s)=>T(t.filter(e=>e.workflow_step===s)))),DP=Ba.reducer,lt=M(t=>t.uuid),UP={instances:{}},qa=u.createSlice({name:"workflowSteps",initialState:UP,extraReducers:t=>t.addMatcher(u.isAnyOf(b,R),s=>Object.assign(s,UP)),reducers:{initializeWorkflowSteps:lt.initialize,addWorkflowStep:lt.addOne,addWorkflowSteps:lt.addMany,setWorkflowStep:lt.setOne,setWorkflowSteps:lt.setMany,updateWorkflowStep:lt.updateOne,updateWorkflowSteps:lt.updateMany,deleteWorkflowStep:lt.deleteOne,deleteWorkflowSteps:lt.deleteMany}}),{initializeWorkflowSteps:LP,addWorkflowStep:NP,addWorkflowSteps:Ca,setWorkflowStep:HP,setWorkflowSteps:GP,updateWorkflowStep:KP,updateWorkflowSteps:YP,deleteWorkflowStep:ZP,deleteWorkflowSteps:ja}=qa.actions,JP=qa.reducer,XP=t=>t.workflowStepReducer.instances,$a=u.createSelector([XP],t=>Object.values(t)),QP=t=>s=>s.workflowStepReducer.instances[t],xP=S(u.createSelector([$a,(t,s)=>s],(t,s)=>T(t.filter(e=>e.workflow_type===s)))),eg=S(u.createSelector([$a,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),ot=M(t=>t.uuid),tg={instances:{}},Da=u.createSlice({name:"workflowTypes",initialState:tg,extraReducers:t=>t.addMatcher(u.isAnyOf(b,R),s=>Object.assign(s,tg)),reducers:{initializeWorkflowTypes:ot.initialize,addWorkflowType:ot.addOne,addWorkflowTypes:ot.addMany,setWorkflowType:ot.setOne,setWorkflowTypes:ot.setMany,updateWorkflowType:ot.updateOne,updateWorkflowTypes:ot.updateMany,deleteWorkflowType:ot.deleteOne,deleteWorkflowTypes:ot.deleteMany}}),{initializeWorkflowTypes:sg,addWorkflowType:ig,addWorkflowTypes:ng,setWorkflowType:ag,setWorkflowTypes:cg,updateWorkflowType:rg,updateWorkflowTypes:dg,deleteWorkflowType:lg,deleteWorkflowTypes:og}=Da.actions,ug=t=>t.workflowTypeReducer.instances,Ua=u.createSelector([ug],t=>Object.values(t)),hg=t=>s=>s.workflowTypeReducer.instances[t],mg=S(u.createSelector([Ua,(t,s)=>s],(t,s)=>{const e=new Set(s);return T(t.filter(({uuid:n})=>e.has(n)))})),fM=S(u.createSelector([Ua,(t,s)=>s],(t,s)=>T(t.filter(e=>e.organization===s)))),pg=Da.reducer,AM={version:0},yg=u.createSlice({name:"versioning",initialState:AM,reducers:{}}),fg=yg.reducer,La={outboxReducer:_w,fileReducer:Xm,authReducer:Hh},SM=u.combineReducers(La),Ag={...La,[Ot]:fg,categoryReducer:nm,assetReducer:Xl,assetAttachmentReducer:Wc,assetStageCompletionReducer:lo,assetStageReducer:Po,assetTypeReducer:Mh,assetTypeAttachmentReducer:jo,issueReducer:lA,issueAttachmentReducer:Ff,issueTypeReducer:hT,issueTypeAttachmentReducer:FA,organizationReducer:Ow,projectReducer:RO,projectAttachmentReducer:eO,projectAccessReducer:Cw,organizationAccessReducer:iw,projectFileReducer:SO,rehydratedReducer:VO,formReducer:cy,formRevisionReducer:Zp,formRevisionAttachmentReducer:jp,formSubmissionAttachmentReducer:Oy,formSubmissionReducer:By,formIdentifierReducer:up,formIdentifierValueReducer:gp,userReducer:NT,emailDomainsReducer:Gm,documentsReducer:Rm,documentAttachmentReducer:Sm,teamReducer:rI,agentsReducer:Fc,issueCommentReducer:Jf,issueCommentAttachmentReducer:qf,issueUpdateReducer:zT,geoImageReducer:Yy,issueAssociationReducer:of,issueTypeFieldsReducer:uS,issueTypeFieldValuesReducer:XA,issueTypeFieldsAttachmentReducer:qA,issueTypeFieldValuesAttachmentReducer:PS,issueTypeIdentifierReducer:CS,issueTypeIdentifierValueReducer:QS,issueTypeStatusReducer:gT,assetTypeFieldsReducer:mu,assetTypeFieldValuesReducer:$u,assetTypeFieldsAttachmentReducer:xo,assetTypeFieldValuesAttachmentReducer:bu,assetTypeIdentifierReducer:eh,assetTypeIdentifierValueReducer:ph,assetTypeStatusReducer:Uh,assetProcedureTypeReducer:Od,assetProcedureReducer:cd,assetProcedureTypeFieldsReducer:Or,assetProcedureTypeFieldValuesReducer:Yr,assetProcedureTypeFieldsAttachmentReducer:rr,assetProcedureTypeFieldValuesAttachmentReducer:Vr,assetProcedureTypeAttachmentReducer:Kc,assetProcedureStepFieldsAttachmentReducer:Cd,assetProcedureStepFieldsReducer:Xd,assetProcedureStepFieldValuesAttachmentReducer:ol,assetProcedureStepFieldValuesReducer:Pl,assetProcedureStepReducer:zl,teamMembershipReducer:NO,workflowTypeReducer:pg,workflowStepReducer:JP,workflowReducer:wI,workflowStepFieldsReducer:yP,workflowStepFieldsAttachmentReducer:sP,workflowStepFieldValuesReducer:LF,workflowStepFieldValuesAttachmentReducer:kF,workflowStepAssigneeReducer:VI,workflowStepReviewRequestReducer:MP,workflowStepReviewReducer:DP,workflowStepCompletionReducer:AF,workflowStepCommentReducer:nF,workflowStepCommentAttachmentReducer:HI},TM=u.combineReducers(Ag),Sg=1e4,Tg=200,Na=[400,409,403,404,405,500],U=1e4,wg={};class Og{constructor(s){p(this,"client");p(this,"pageSize",Sg);wg[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 Ig=()=>gg.length-1,Fg=t=>(t[Ot]={version:Ig()},t),Pg=()=>Fg({}),wM=t=>(t.outboxReducer&&(t.outboxReducer.deletedRequests=[]),t),OM=t=>s=>{var e;return s===void 0&&(s={}),((e=s[Ot])==null?void 0:e.version)===Ig()?s:t(s)},gg=[Fg,Pg,Pg,wM],IM=Object.fromEntries(gg.map((t,s)=>[s,OM(t)])),FM=t=>{if(t)throw t;const s=wt();s?s.dispatch({type:"rehydrated/setRehydrated",payload:!0}):console.error("Client store not set")},bg=(t,s,e)=>{const n=pt();return n?(n.addRequest(s),n.getQueue()):(console.warn("Outbox coordinator not set; cannot enqueue request yet."),[])},_g=(t,s,e)=>{const n=pt();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 PM(t,s){if(!s.payload)throw new Error("Received empty payload");return $g(s)}const gM={...Qa,effect:PM,discard:Rg,returnPromises:!0,persistCallback:FM,retry:RM,persistOptions:{storage:Kg},queue:{...Qa.queue,enqueue:bg,dequeue:_g,peek:(...t)=>MM(...t)}},bM=Yg(IM,Ot),_M=u.compose(Gg.offline(gM),bM);async function Mg(t,s,e){if(s.store.getState().outboxReducer.deletedRequests.includes(t.payload.uuid))throw new Error("Request was marked for deletion");const a=wg[t.meta.offline.effect.serviceName];if(!a)throw new Error(`Service ${t.meta.offline.effect.serviceName} not found`);return Ya(t.meta.offline.effect.BASE_URL,t.meta.offline.effect.request,s,a,e)}function Rg(t,s,e=0){var r;if(console.debug("Considering discarding request due to error:",t,`(${typeof t})`,`
|
|
1
|
+
(function(i,$){typeof exports=="object"&&typeof module<"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"],$):(i=typeof globalThis<"u"?globalThis:i||self,$(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,St,mt,_b,Rb,dc,Et,Mb,lc,kb,vb,xk,ev,Eb,Vb,Wb){"use strict";var Qk=Object.defineProperty;var Xk=(i,$,u)=>$ in i?Qk(i,$,{enumerable:!0,configurable:!0,writable:!0,value:u}):i[$]=u;var m=(i,$,u)=>Xk(i,typeof $!="symbol"?$+"":$,u);var gb;const oc=Object.freeze([]),uc=Object.freeze({});var hc=(t=>(t[t.GUEST=0]="GUEST",t[t.BASIC=2]="BASIC",t[t.ADMIN=4]="ADMIN",t))(hc||{}),p=(t=>(t.GET="GET",t.POST="POST",t.PATCH="PATCH",t.PUT="PUT",t.DELETE="DELETE",t))(p||{}),pc=(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))(pc||{}),mc=(t=>(t.Issue="issue",t.Asset="asset",t.AssetType="asset_type",t.Project="project",t.Document="document",t))(mc||{}),ys=(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))(ys||{}),j=(t=>(t.STATUS="status",t.PRIORITY="priority",t.CATEGORY="category",t.DESCRIPTION="description",t.TITLE="title",t.ASSIGNED_TO="assigned_to",t.DUE_DATE="due_date",t))(j||{}),yc=(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))(yc||{}),fc=(t=>(t[t.COMMENT=0]="COMMENT",t[t.APPROVE=2]="APPROVE",t[t.DENY=4]="DENY",t))(fc||{}),Sc=(t=>(t[t.ADD_ASSIGNEE=0]="ADD_ASSIGNEE",t[t.REMOVE_ASSIGNEE=1]="REMOVE_ASSIGNEE",t[t.ADD_REVIEWER=2]="ADD_REVIEWER",t[t.REMOVE_REVIEWER=3]="REMOVE_REVIEWER",t[t.ADD_REVIEW_REQUEST=4]="ADD_REVIEW_REQUEST",t[t.REMOVE_REVIEW_REQUEST=5]="REMOVE_REVIEW_REQUEST",t))(Sc||{});const Bb=ys.MEDIUM,Ac=6e4;function R(t){return{addOne:(h,y)=>{const f=t(y.payload);h.instances[f]=y.payload},addMany:(h,y)=>{for(const f of y.payload){const S=t(f);h.instances[S]=f}},setOne:(h,y)=>{const f=t(y.payload);h.instances[f]=y.payload},setMany:(h,y)=>{for(const f of y.payload){const S=t(f);h.instances[S]=f}},updateOne:(h,y)=>{const f=t(y.payload);h.instances[f]=y.payload},updateMany:(h,y)=>{for(const f of y.payload){const S=t(f);h.instances[S]=f}},deleteOne:(h,y)=>{delete h.instances[y.payload]},deleteMany:(h,y)=>{for(const f of y.payload)delete h.instances[f]},initialize:(h,y)=>{h.instances={};const f=new Set;for(const S of y.payload){const O=t(S);f.add(O),h.instances[O]=S}f.size!==y.payload.length&&console.warn("duplicate ids detected when initializing model instances.")}}}function zb(){return{initializeSelection:(l,r)=>{l.selection=Array.from(new Set(r.payload))},selectOne:(l,r)=>{new Set(l.selection).has(r.payload)||l.selection.push(r.payload)},selectMany:(l,r)=>{const h=new Set(l.selection);for(const y of r.payload)h.has(y)||h.add(y);l.selection=Array.from(h)},unselectOne:(l,r)=>{const h=new Set(l.selection);h.has(r.payload)&&(h.delete(r.payload),l.selection=Array.from(h))},unselectMany:(l,r)=>{const h=new Set(l.selection);for(const y of r.payload)h.has(y)&&h.delete(y);l.selection=Array.from(h)},toggleOne:(l,r)=>{const h=new Set(l.selection);h.has(r.payload)?h.delete(r.payload):h.add(r.payload),l.selection=Array.from(h)},toggleMany:(l,r)=>{const h=new Set(l.selection);for(const y of r.payload)h.has(y)?h.delete(y):h.add(y);l.selection=Array.from(h)},getInitialState:l=>({...l,selection:[]})}}const Ft="versioning",b=u.createAction("RESET"),z=u.createAction("RESET_PROJECT_STATE"),M=u.createAction("RESET_ORGANIZATION_STATE");function qb(t,s){return _b.useMemo(t,s)}gb=Symbol.toStringTag;class fs{constructor(){m(this,gb,"Promise");m(this,"_promise");m(this,"_resolve");m(this,"_reject");m(this,"_state","pending");this._resolve=null,this._reject=null,this._promise=new Promise((s,e)=>{this._resolve=s,this._reject=e})}get state(){return this._state}then(s,e){return this._promise.then(s,e)}catch(s){return this._promise.catch(s)}resolve(s){if(!this._resolve)throw new Error("No resolve callback");this._resolve(s),this._state="fulfilled"}reject(s){if(!this._reject)throw s;this._reject(s),this._state="rejected"}finally(s){throw new Error("`finally` not implemented")}}let Ss=!1;["true","1"].includes("".toLowerCase())&&(Ss=!0);function Cb(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 As(t){const s={};return function(){const e=Array.prototype.slice.call(arguments);return e in s?(Ss&&console.debug(`Memoization debug: Using memorized return value for ${t.toString()}(`,e,")"),s[e]):(Ss&&console.debug(`Memoization debug: Cache miss! Memoizing ${t.toString()}(`,e,")"),s[e]=t.apply(this,e))}}function jb(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 w=t=>t.length===0?oc:t,Vt=t=>Object.keys(t).length===0?uc:t,wc=As(t=>{if(!t)return"";const s=new Date(t),e=s.getFullYear()===ws.getFullYear(),n={day:"numeric",month:"short"};return e||(n.year="numeric"),s.toLocaleDateString([],n)}),Db=new Intl.RelativeTimeFormat([],{style:"long",numeric:"auto"}),$b=1e3*86400,ws=new Date,Ub=t=>new Date(t).toDateString()===ws.toDateString(),Lb=As((t,s,e)=>{const n=Math.round((new Date(t).getTime()-ws.getTime())/$b);return n<s||n>e?wc(t):Db.format(n,"days")});function Nb(t){return new Uint8Array(t).reduce((e,n)=>e+n.toString(16).padStart(2,"0"),"")}const Ts=async(t,s)=>{s||(s=await At(t));let e=t.type;if(e.includes("/")&&(e=e.split("/")[1]),!e)throw new Error(`Could not extract file type from ${t.type}`);return`${s}.${e}`};function At(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=Nb(c);s(d)})},n.readAsArrayBuffer(t)})}function Hb(t){if(!t.name||!t.type||!t.size){const s="File has no name, type, and/or size";throw new Error(s)}return`${t.name}&${t.type}${t.size}`}function Tc(t,s){return new File([t],s,{type:t.type})}function Gb(t,s){const e=document.createElement("a");e.setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(s)),e.setAttribute("download",t),e.style.display="none",document.body.appendChild(e),e.click(),document.body.removeChild(e)}const Kb=async t=>{const s={};for(const e of t){const n=await At(e);s[n]={sha1:n,extension:e.name.split(".").pop()||"",file_type:e.type,size:e.size}}return Object.values(s)},Oc=async t=>(await fetch(t)).blob(),Yb=t=>new Promise((s,e)=>{const n=new FileReader;n.onloadend=()=>{var a;s(((a=n.result)==null?void 0:a.toString())||"")},n.readAsDataURL(t)});function Zb(t){const s=new Blob([t]);Rb.saveAs(s,t.name)}const Ic={};function Jb(t,s,e,...n){const a=Ic[t];let c=!1;a?a[s]||(a[s]=!0,c=!0):(Ic[t]={[s]:!0},c=!0),c&&console[e](...n)}const Fc=["created_at","updated_at","index","revision"];function _(t){return{...t,uuid:mt.v4()}}function Qb(t){const s={};for(const e of t)s[e.uuid]=e;return s}function B(t){return t.map(({uuid:s})=>s)}function Wt(t,s){return t.localeCompare(s)}function Os(t,s){return Wt(t.uuid,s.uuid)}function Xb(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 xb(t){return t.toLowerCase().replace(" ","-")}function e_(t,s=!1){return t.normalize("NFKD").toLowerCase().replace(/[^\w\s-]/g,"").trim().replace(/[-\s]+/g,s?"_":"-")}function t_(t,s){if(t.length<=s)return t;const e=t.slice(0,s-1);return e.slice(0,e.lastIndexOf(" "))+"…"}const s_=/^.+@.+\..+$/;function E(t){const s={...t};for(const e of[...Fc,"created_by"])e in s&&delete s[e];return s}const Pc=t=>{const s=t.toSorted((e,n)=>e.order-n.order);return dc(s,{id:e=>e.uuid,parentId:e=>e.parent,includeEmptyChildrenArray:!0,valueKey:!1})},i_=t=>{const{roots:s}=Pc(t);return s.map(e=>new Et.Tree(e))},gc=(t,s)=>{const{nodes:e}=Pc(s),n=e.get(t);if(!n)throw new Error(`Node with uuid ${t} does not exist in asset procedure step tree.`);return new Et.Tree(n)},bc=(t,s)=>t.type!==s.type?t.type-s.type:t.order-s.order,_c=(t,s)=>t.type!==s.type?t.type-s.type:t.order-s.order,Rc=t=>dc(t,{id:s=>s.uuid,parentId:s=>s.parent_document,includeEmptyChildrenArray:!0,valueKey:!1}),n_=t=>{const{roots:s}=Rc(t);return s.map(e=>new Et.Tree(e))},Mc=(t,s)=>{const{nodes:e}=Rc(s),n=e.get(t);if(!n)throw new Error(`Node with uuid ${t} does not exist in document tree.`);return new Et.Tree(n)};class a_{constructor(s){m(this,"operations",[]);m(this,"getData");this.getData=s}performOperations(s){let e=s;for(const n of this.operations)e=n(e);return e}filter(s,e){return this.operations.push(n=>n.filter(a=>a[s]===e)),this}exclude(s,e){return this.operations.push(n=>n.filter(a=>a[s]!==e)),this}orderBy(s){return this.operations.push(e=>[...e].sort((n,a)=>n[s]<=a[s]?1:-1)),this}reverse(){return this.operations.push(s=>[...s].reverse()),this}all(){return this.operations.push(s=>s),this}get(s,e){return u.createSelector([this.getData],n=>this.performOperations(n).find(a=>a[s]===e))}count(){return u.createSelector([this.getData],s=>this.performOperations(s).length)}first(){return u.createSelector([this.getData],s=>this.performOperations(s)[0])}last(){return u.createSelector([this.getData],s=>{const e=this.performOperations(s);return e[e.length-1]})}exists(){return u.createSelector([this.getData],s=>this.performOperations(s).length>0)}toSelector(){return u.createSelector([this.getData],s=>w(this.performOperations(s)))}}const A=t=>(...s)=>e=>t(e,...s),N=R(t=>t.uuid),kc={instances:{}},Is=u.createSlice({name:"agents",initialState:kc,extraReducers:t=>t.addMatcher(u.isAnyOf(b,z,M),s=>Object.assign(s,kc)),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:vc,addConversation:Ec,addConversations:c_,setConversation:Vc,setConversations:r_,updateConversation:Wc,updateConversations:d_,deleteConversation:l_,deleteConversations:o_}=Is.actions,Fs=t=>t.agentsReducer.instances,u_=u.createSelector([Fs],t=>Object.values(t)),h_=A(u.createSelector([Fs,(t,s)=>s],(t,s)=>t[s])),Bc=Is.reducer,H=R(t=>t.uuid),zc={instances:{}},Ps=u.createSlice({name:"assetAttachments",initialState:zc,extraReducers:t=>t.addMatcher(u.isAnyOf(b,z,M),s=>Object.assign(s,zc)),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:qc,addAssetAttachment:Cc,addAssetAttachments:gs,setAssetAttachment:jc,setAssetAttachments:Dc,updateAssetAttachment:$c,updateAssetAttachments:Uc,deleteAssetAttachment:Lc,deleteAssetAttachments:bs}=Ps.actions,Nc=t=>t.assetAttachmentReducer.instances,_s=u.createSelector([Nc],t=>Object.values(t)),Hc=t=>s=>s.assetAttachmentReducer.instances[t],Gc=A(u.createSelector([_s,(t,s)=>s],(t,s)=>{const e=new Set(s);return w(t.filter(({uuid:n})=>e.has(n)))})),Kc=A(u.createSelector([_s,(t,s)=>s],(t,s)=>w(t.filter(({asset:e})=>s===e)))),Yc=Ps.reducer,G=R(({uuid:t})=>t),Zc={instances:{}},Rs=u.createSlice({name:"assetProcedureTypeAttachments",initialState:Zc,extraReducers:t=>t.addMatcher(u.isAnyOf(b,M),s=>Object.assign(s,Zc)),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:Jc,addAssetProcedureTypeAttachment:Qc,addAssetProcedureTypeAttachments:Xc,setAssetProcedureTypeAttachment:xc,setAssetProcedureTypeAttachments:er,updateAssetProcedureTypeAttachment:tr,updateAssetProcedureTypeAttachments:sr,deleteAssetProcedureTypeAttachment:ir,deleteAssetProcedureTypeAttachments:nr}=Rs.actions,ar=Rs.reducer,cr=t=>t.assetProcedureTypeAttachmentReducer.instances,Ms=u.createSelector([cr],t=>Object.values(t)),rr=t=>s=>s.assetProcedureTypeAttachmentReducer.instances[t],dr=A(u.createSelector([Ms,(t,s)=>s],(t,s)=>{const e=new Set(s);return w(t.filter(({uuid:n})=>e.has(n)))})),p_=A(u.createSelector([Ms,(t,s)=>s],(t,s)=>w(t.filter(({asset_procedure_type:e})=>s===e)))),K=R(({uuid:t})=>t),lr={instances:{}},ks=u.createSlice({name:"assetProcedureTypeFieldsAttachments",initialState:lr,extraReducers:t=>t.addMatcher(u.isAnyOf(b,M),s=>Object.assign(s,lr)),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:or,addAssetProcedureTypeFieldsAttachment:ur,addAssetProcedureTypeFieldsAttachments:hr,setAssetProcedureTypeFieldsAttachment:pr,setAssetProcedureTypeFieldsAttachments:mr,updateAssetProcedureTypeFieldsAttachment:yr,updateAssetProcedureTypeFieldsAttachments:fr,deleteAssetProcedureTypeFieldsAttachment:Sr,deleteAssetProcedureTypeFieldsAttachments:Ar}=ks.actions,wr=ks.reducer,Tr=t=>t.assetProcedureTypeFieldsAttachmentReducer.instances,vs=u.createSelector([Tr],t=>Object.values(t)),m_=A(u.createSelector([vs,(t,s)=>s],(t,s)=>w(t.filter(e=>e.fields_revision===s)))),Or=t=>s=>s.assetProcedureTypeFieldsAttachmentReducer.instances[t],Ir=A(u.createSelector([vs,(t,s)=>s],(t,s)=>{const e=new Set(s);return w(t.filter(({uuid:n})=>e.has(n)))})),Y=R(({uuid:t})=>t),Fr={instances:{}},Es=u.createSlice({name:"assetProcedureTypeFields",initialState:Fr,extraReducers:t=>t.addMatcher(u.isAnyOf(b,M),s=>Object.assign(s,Fr)),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:Pr,addAssetProcedureTypeFields:gr,addAssetProcedureTypeFieldsMany:br,setAssetProcedureTypeFields:_r,setAssetProcedureTypeFieldsMany:Rr,updateAssetProcedureTypeFields:Mr,updateAssetProcedureTypeFieldsMany:kr,deleteAssetProcedureTypeFields:vr,deleteAssetProcedureTypeFieldsMany:Er}=Es.actions,Vr=Es.reducer,Wr=t=>t.assetProcedureTypeFieldsReducer.instances,Bt=u.createSelector([Wr],t=>Object.values(t)),y_=A(u.createSelector([Bt,(t,s)=>s],(t,s)=>w(t.filter(e=>e.asset_procedure_type===s)))),f_=A(u.createSelector([Bt,(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])),Br=t=>s=>s.assetProcedureTypeFieldsReducer.instances[t],zr=A(u.createSelector([Bt,(t,s)=>s],(t,s)=>{const e=new Set(s);return w(t.filter(({uuid:n})=>e.has(n)))})),Z=R(({uuid:t})=>t),qr={instances:{}},Vs=u.createSlice({name:"assetProcedureTypeFieldValuesAttachments",initialState:qr,extraReducers:t=>t.addMatcher(u.isAnyOf(b,z,M),s=>Object.assign(s,qr)),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:Cr,addAssetProcedureTypeFieldValuesAttachment:jr,addAssetProcedureTypeFieldValuesAttachments:Ws,setAssetProcedureTypeFieldValuesAttachment:Dr,setAssetProcedureTypeFieldValuesAttachments:$r,updateAssetProcedureTypeFieldValuesAttachment:Ur,updateAssetProcedureTypeFieldValuesAttachments:Lr,deleteAssetProcedureTypeFieldValuesAttachment:Nr,deleteAssetProcedureTypeFieldValuesAttachments:Bs}=Vs.actions,Hr=Vs.reducer,Gr=t=>t.assetProcedureTypeFieldValuesAttachmentReducer.instances,zs=u.createSelector([Gr],t=>Object.values(t)),Kr=t=>s=>s.assetProcedureTypeFieldValuesAttachmentReducer.instances[t],Yr=A(u.createSelector([zs,(t,s)=>s],(t,s)=>{const e=new Set(s);return w(t.filter(({uuid:n})=>e.has(n)))})),Zr=A(u.createSelector([zs,(t,s)=>s],(t,s)=>w(t.filter(e=>e.field_values===s)))),J=R(({uuid:t})=>t),Jr={instances:{}},qs=u.createSlice({name:"assetProcedureTypeFieldValues",initialState:Jr,extraReducers:t=>t.addMatcher(u.isAnyOf(b,z,M),s=>Object.assign(s,Jr)),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:Qr,addAssetProcedureTypeFieldValues:Xr,addAssetProcedureTypeFieldValuesMany:xr,setAssetProcedureTypeFieldValues:ed,setAssetProcedureTypeFieldValuesMany:td,updateAssetProcedureTypeFieldValues:sd,updateAssetProcedureTypeFieldValuesMany:id,deleteAssetProcedureTypeFieldValues:nd,deleteAssetProcedureTypeFieldValuesMany:ad}=qs.actions,cd=qs.reducer,rd=t=>t.assetProcedureTypeFieldValuesReducer.instances,zt=u.createSelector([rd],t=>Object.values(t)),S_=A(u.createSelector([zt,(t,s)=>s],(t,s)=>w(t.filter(e=>e.asset===s)))),A_=A(u.createSelector([zt,(t,s)=>s],(t,s)=>w(t.filter(e=>e.asset_procedure===s)))),dd=t=>s=>s.assetProcedureTypeFieldValuesReducer.instances[t],ld=A(u.createSelector([zt,(t,s)=>s],(t,s)=>{const e=new Set(s);return w(t.filter(({uuid:n})=>e.has(n)))})),Q=R(({uuid:t})=>t),od={instances:{}},Cs=u.createSlice({name:"assetProcedures",initialState:od,extraReducers:t=>t.addMatcher(u.isAnyOf(b,z,M),s=>Object.assign(s,od)),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:ud,addAssetProcedure:hd,addAssetProcedures:js,updateAssetProcedure:pd,updateAssetProcedures:md,deleteAssetProcedure:yd,deleteAssetProcedures:Ds,setAssetProcedure:fd,setAssetProcedures:Sd}=Cs.actions,Ad=Cs.reducer,wd=t=>t.assetProcedureReducer.instances,qt=u.createSelector([wd],t=>Object.values(t)),Td=A(u.createSelector([qt,(t,s)=>s],(t,s)=>w(t.filter(e=>e.asset_procedure_type===s)))),w_=A(u.createSelector([qt,(t,s)=>s],(t,s)=>w(t.filter(e=>e.asset_type===s)))),Od=t=>s=>s.assetProcedureReducer.instances[t],Id=A(u.createSelector([qt,(t,s)=>s],(t,s)=>{const e=new Set(s);return w(t.filter(({uuid:n})=>e.has(n)))})),X=R(t=>t.uuid),Fd={instances:{}},$s=u.createSlice({name:"assetProcedureTypes",initialState:Fd,extraReducers:t=>t.addMatcher(u.isAnyOf(b,M),s=>Object.assign(s,Fd)),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:Pd,addAssetProcedureType:gd,addAssetProcedureTypes:bd,updateAssetProcedureType:_d,updateAssetProcedureTypes:Rd,deleteAssetProcedureType:Md,deleteAssetProcedureTypes:kd,setAssetProcedureType:vd,setAssetProcedureTypes:Ed}=$s.actions,Vd=$s.reducer,Wd=t=>t.assetProcedureTypeReducer.instances,Us=u.createSelector([Wd],t=>Object.values(t)),Bd=t=>s=>s.assetProcedureTypeReducer.instances[t],zd=A(u.createSelector([Us,(t,s)=>s],(t,s)=>{const e=new Set(s);return w(t.filter(({uuid:n})=>e.has(n)))})),T_=A(u.createSelector([Us,(t,s)=>s],(t,s)=>w(t.filter(e=>e.organization===s)))),x=R(t=>t.uuid),qd={instances:{}},Ls=u.createSlice({name:"assetProcedureStepFieldsAttachments",initialState:qd,extraReducers:t=>t.addMatcher(u.isAnyOf(b,M),s=>Object.assign(s,qd)),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:Cd,addAssetProcedureStepFieldsAttachment:jd,addAssetProcedureStepFieldsAttachments:Dd,setAssetProcedureStepFieldsAttachment:$d,setAssetProcedureStepFieldsAttachments:Ud,updateAssetProcedureStepFieldsAttachment:Ld,updateAssetProcedureStepFieldsAttachments:Nd,deleteAssetProcedureStepFieldsAttachment:Hd,deleteAssetProcedureStepFieldsAttachments:Gd}=Ls.actions,Kd=t=>t.assetProcedureStepFieldsAttachmentReducer.instances,Ns=u.createSelector([Kd],t=>Object.values(t)),O_=A(u.createSelector([Ns,(t,s)=>s],(t,s)=>w(t.filter(e=>e.fields_revision===s)))),Yd=t=>s=>s.assetProcedureStepFieldsAttachmentReducer.instances[t],Zd=A(u.createSelector([Ns,(t,s)=>s],(t,s)=>{const e=new Set(s);return w(t.filter(({uuid:n})=>e.has(n)))})),Jd=Ls.reducer,ee=R(t=>t.uuid),Qd={instances:{}},Hs=u.createSlice({name:"assetProcedureStepFields",initialState:Qd,extraReducers:t=>t.addMatcher(u.isAnyOf(b,M),s=>Object.assign(s,Qd)),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:Xd,addAssetProcedureStepFields:xd,addAssetProcedureStepFieldsMany:el,setAssetProcedureStepFields:tl,setAssetProcedureStepFieldsMany:sl,updateAssetProcedureStepFields:il,updateAssetProcedureStepFieldsMany:nl,deleteAssetProcedureStepFields:al,deleteAssetProcedureStepFieldsMany:cl}=Hs.actions,Gs=t=>t.assetProcedureStepFieldsReducer.instances,Ct=u.createSelector([Gs],t=>Object.values(t)),I_=A(u.createSelector([Ct,(t,s)=>s],(t,s)=>w(t.filter(e=>e.asset_procedure_step===s)))),F_=A(u.createSelector([Ct,(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])),P_=u.createSelector([Gs],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}),rl=t=>s=>s.assetProcedureStepFieldsReducer.instances[t],dl=A(u.createSelector([Ct,(t,s)=>s],(t,s)=>{const e=new Set(s);return w(t.filter(({uuid:n})=>e.has(n)))})),ll=Hs.reducer,te=R(t=>t.uuid),ol={instances:{}},Ks=u.createSlice({name:"assetProcedureStepFieldValuesAttachments",initialState:ol,extraReducers:t=>t.addMatcher(u.isAnyOf(b,z,M),s=>Object.assign(s,ol)),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:ul,addAssetProcedureStepFieldValuesAttachment:hl,addAssetProcedureStepFieldValuesAttachments:Ys,setAssetProcedureStepFieldValuesAttachment:pl,setAssetProcedureStepFieldValuesAttachments:ml,updateAssetProcedureStepFieldValuesAttachment:yl,updateAssetProcedureStepFieldValuesAttachments:fl,deleteAssetProcedureStepFieldValuesAttachment:Sl,deleteAssetProcedureStepFieldValuesAttachments:Zs}=Ks.actions,Al=t=>t.assetProcedureStepFieldValuesAttachmentReducer.instances,Js=u.createSelector([Al],t=>Object.values(t)),wl=t=>s=>s.assetProcedureStepFieldValuesAttachmentReducer.instances[t],Tl=A(u.createSelector([Js,(t,s)=>s],(t,s)=>{const e=new Set(s);return w(t.filter(({uuid:n})=>e.has(n)))})),Ol=A(u.createSelector([Js,(t,s)=>s],(t,s)=>w(t.filter(e=>e.field_values===s)))),Il=Ks.reducer,se=R(t=>t.uuid),Fl={instances:{}},Qs=u.createSlice({name:"assetProcedureStepFieldValues",initialState:Fl,extraReducers:t=>t.addMatcher(u.isAnyOf(b,z,M),s=>Object.assign(s,Fl)),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:Pl,addAssetProcedureStepFieldValues:gl,addAssetProcedureStepFieldValuesMany:bl,setAssetProcedureStepFieldValues:_l,setAssetProcedureStepFieldValuesMany:Rl,updateAssetProcedureStepFieldValues:Ml,updateAssetProcedureStepFieldValuesMany:kl,deleteAssetProcedureStepFieldValues:vl,deleteAssetProcedureStepFieldValuesMany:El}=Qs.actions,Vl=t=>t.assetProcedureStepFieldValuesReducer.instances,Pt=u.createSelector([Vl],t=>Object.values(t)),g_=A(u.createSelector([Pt,(t,s)=>s],(t,s)=>w(t.filter(e=>e.asset===s)))),b_=A(u.createSelector([Pt,(t,s)=>s],(t,s)=>w(t.filter(e=>e.asset_procedure===s)))),__=A(u.createSelector([Pt,(t,s)=>s],(t,s)=>w(t.filter(e=>e.asset_procedure_step===s)))),Wl=t=>s=>s.assetProcedureStepFieldValuesReducer.instances[t],Bl=A(u.createSelector([Pt,(t,s)=>s],(t,s)=>{const e=new Set(s);return w(t.filter(({uuid:n})=>e.has(n)))})),zl=Qs.reducer,ie=R(t=>t.uuid),ql={instances:{}},Xs=u.createSlice({name:"assetProcedureSteps",initialState:ql,extraReducers:t=>t.addMatcher(u.isAnyOf(b,M),s=>Object.assign(s,ql)),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:Cl,setAssetProcedureStep:jl,setAssetProcedureSteps:Dl,addAssetProcedureStep:$l,addAssetProcedureSteps:Ul,updateAssetProcedureStep:Ll,updateAssetProcedureSteps:Nl,deleteAssetProcedureStep:Hl,deleteAssetProcedureSteps:Gl}=Xs.actions,Kl=Xs.reducer,jt=t=>t.assetProcedureStepReducer.instances,Yl=t=>s=>s.assetProcedureStepReducer.instances[t],xs=u.createSelector([jt],t=>Object.values(t)),R_=A(u.createSelector([jt,(t,s)=>s],(t,s)=>{const e={};for(const[n,a]of Object.entries(t))a.asset_procedure_type===s&&(e[n]=a);return Vt(e)})),M_=A(u.createSelector([xs,(t,s)=>s],(t,s)=>w(t.filter(e=>e.asset_procedure_type===s)))),Zl=A(u.createSelector([xs,(t,s)=>s],(t,s)=>{const e=new Set(s);return w(t.filter(({uuid:n})=>e.has(n)))})),Jl=A(u.createSelector([jt,(t,s)=>s],(t,s)=>{if(!t[s])return w([]);const a=gc(s,Object.values(t)).all().map(({model:c})=>c);return w(a)})),ne=R(t=>t.uuid),Ql={instances:{}},ei=u.createSlice({name:"assets",initialState:Ql,extraReducers:t=>t.addMatcher(u.isAnyOf(b,z,M),s=>Object.assign(s,Ql)),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:Xl,addAsset:xl,addAssets:ti,updateAsset:eo,updateAssets:to,deleteAsset:so,deleteAssets:si,setAsset:io,setAssets:no}=ei.actions,ao=t=>t.assetReducer.instances,Dt=u.createSelector([ao],t=>w(Object.values(t))),k_=A(u.createSelector([Dt,(t,s)=>s],(t,s)=>w(t.filter(({project:e})=>e===s)))),co=A(u.createSelector([Dt,(t,s)=>s],(t,s)=>w(t.filter(e=>e.asset_type===s)))),ro=t=>s=>s.assetReducer.instances[t],lo=A(u.createSelector([Dt,(t,s)=>s],(t,s)=>{const e=new Set(s);return w(t.filter(({uuid:n})=>e.has(n)))})),oo=ei.reducer,ae=R(t=>t.uuid),uo={instances:{}},ii=u.createSlice({name:"assetStageCompletions",initialState:uo,extraReducers:t=>t.addMatcher(u.isAnyOf(b,z,M),s=>Object.assign(s,uo)),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:ho,addAssetStageCompletion:po,addAssetStageCompletions:mo,setAssetStageCompletion:yo,setAssetStageCompletions:fo,updateAssetStageCompletion:So,updateAssetStageCompletions:Ao,deleteAssetStageCompletion:wo,deleteAssetStageCompletions:To}=ii.actions,Oo=ii.reducer,Io=t=>t.assetStageCompletionReducer.instances,Fo=u.createSelector([Io],t=>Object.values(t)),Po=t=>s=>s.assetStageCompletionReducer.instances[t],go=A(u.createSelector([Fo,(t,s)=>s],(t,s)=>{const e=new Set(s);return w(t.filter(({uuid:n})=>e.has(n)))})),ce=R(t=>t.uuid),bo={instances:{}},ni=u.createSlice({name:"assetStages",initialState:bo,extraReducers:t=>t.addMatcher(u.isAnyOf(b,M),s=>Object.assign(s,bo)),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:_o,setAssetStage:Ro,setAssetStages:Mo,addAssetStage:ko,addAssetStages:vo,updateAssetStage:Eo,updateAssetStages:Vo,deleteAssetStage:Wo,deleteAssetStages:Bo}=ni.actions,zo=ni.reducer,ai=t=>t.assetStageReducer.instances,qo=t=>s=>s.assetStageReducer.instances[t],ci=u.createSelector([ai],t=>Object.values(t)),v_=A(u.createSelector([ai,(t,s)=>s],(t,s)=>{const e={};for(const[n,a]of Object.entries(t))a.asset_procedure_type===s&&(e[n]=a);return Vt(e)})),E_=A(u.createSelector([ci,(t,s)=>s],(t,s)=>w(t.filter(e=>e.asset_procedure_type===s)))),Co=A(u.createSelector([ci,(t,s)=>s],(t,s)=>{const e=new Set(s);return w(t.filter(({uuid:n})=>e.has(n)))})),re=R(t=>t.uuid),jo={instances:{}},ri=u.createSlice({name:"assetTypeAttachments",initialState:jo,extraReducers:t=>t.addMatcher(u.isAnyOf(b,M),s=>Object.assign(s,jo)),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:Do,addAssetTypeAttachment:$o,addAssetTypeAttachments:di,setAssetTypeAttachment:Uo,setAssetTypeAttachments:Lo,updateAssetTypeAttachment:No,updateAssetTypeAttachments:Ho,deleteAssetTypeAttachment:Go,deleteAssetTypeAttachments:li}=ri.actions,Ko=t=>t.assetTypeAttachmentReducer.instances,oi=u.createSelector([Ko],t=>Object.values(t)),Yo=t=>s=>s.assetTypeAttachmentReducer.instances[t],Zo=A(u.createSelector([oi,(t,s)=>s],(t,s)=>{const e=new Set(s);return w(t.filter(({uuid:n})=>e.has(n)))})),Jo=A(u.createSelector([oi,(t,s)=>s],(t,s)=>w(t.filter(({asset_type:e})=>s===e)))),Qo=ri.reducer,de=R(t=>t.uuid),Xo={instances:{}},ui=u.createSlice({name:"assetTypeFieldsAttachments",initialState:Xo,extraReducers:t=>t.addMatcher(u.isAnyOf(b,M),s=>Object.assign(s,Xo)),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:xo,addAssetTypeFieldsAttachment:eu,addAssetTypeFieldsAttachments:tu,setAssetTypeFieldsAttachment:su,setAssetTypeFieldsAttachments:iu,updateAssetTypeFieldsAttachment:nu,updateAssetTypeFieldsAttachments:au,deleteAssetTypeFieldsAttachment:cu,deleteAssetTypeFieldsAttachments:ru}=ui.actions,du=t=>t.assetTypeFieldsAttachmentReducer.instances,hi=u.createSelector([du],t=>Object.values(t)),V_=A(u.createSelector([hi,(t,s)=>s],(t,s)=>w(t.filter(e=>e.fields_revision===s)))),lu=t=>s=>s.assetTypeFieldsAttachmentReducer.instances[t],ou=A(u.createSelector([hi,(t,s)=>s],(t,s)=>{const e=new Set(s);return w(t.filter(({uuid:n})=>e.has(n)))})),uu=ui.reducer,le=R(t=>t.uuid),hu={instances:{}},pi=u.createSlice({name:"assetTypeFields",initialState:hu,extraReducers:t=>t.addMatcher(u.isAnyOf(b,M),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:pu,addAssetTypeFields:mu,addAssetTypeFieldsMany:yu,setAssetTypeFields:fu,setAssetTypeFieldsMany:Su,updateAssetTypeFields:Au,updateAssetTypeFieldsMany:wu,deleteAssetTypeFields:Tu,deleteAssetTypeFieldsMany:Ou}=pi.actions,Iu=t=>t.assetTypeFieldsReducer.instances,gt=u.createSelector([Iu],t=>Object.values(t)),W_=A(u.createSelector([gt,(t,s)=>s],(t,s)=>w(t.filter(e=>e.asset_type===s)))),B_=A(u.createSelector([gt,(t,s)=>s],(t,s)=>t.filter(e=>e.asset_type===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),Fu=t=>s=>s.assetTypeFieldsReducer.instances[t],Pu=A(u.createSelector([gt,(t,s)=>s],(t,s)=>{const e=new Set(s);return w(t.filter(({uuid:n})=>e.has(n)))})),gu=pi.reducer,oe=R(t=>t.uuid),bu={instances:{}},mi=u.createSlice({name:"assetTypeFieldValuesAttachments",initialState:bu,extraReducers:t=>t.addMatcher(u.isAnyOf(b,z,M),s=>Object.assign(s,bu)),reducers:{initializeAssetTypeFieldValuesAttachments:oe.initialize,addAssetTypeFieldValuesAttachment:oe.addOne,addAssetTypeFieldValuesAttachments:oe.addMany,setAssetTypeFieldValuesAttachment:oe.setOne,setAssetTypeFieldValuesAttachments:oe.setMany,updateAssetTypeFieldValuesAttachment:oe.updateOne,updateAssetTypeFieldValuesAttachments:oe.updateMany,deleteAssetTypeFieldValuesAttachment:oe.deleteOne,deleteAssetTypeFieldValuesAttachments:oe.deleteMany}}),{initializeAssetTypeFieldValuesAttachments:_u,addAssetTypeFieldValuesAttachment:Ru,addAssetTypeFieldValuesAttachments:yi,setAssetTypeFieldValuesAttachment:Mu,setAssetTypeFieldValuesAttachments:ku,updateAssetTypeFieldValuesAttachment:vu,updateAssetTypeFieldValuesAttachments:Eu,deleteAssetTypeFieldValuesAttachment:Vu,deleteAssetTypeFieldValuesAttachments:fi}=mi.actions,Wu=t=>t.assetTypeFieldValuesAttachmentReducer.instances,Si=u.createSelector([Wu],t=>Object.values(t)),Bu=t=>s=>s.assetTypeFieldValuesAttachmentReducer.instances[t],zu=A(u.createSelector([Si,(t,s)=>s],(t,s)=>{const e=new Set(s);return w(t.filter(({uuid:n})=>e.has(n)))})),qu=A(u.createSelector([Si,(t,s)=>s],(t,s)=>w(t.filter(e=>e.field_values===s)))),Cu=mi.reducer,ue=R(t=>t.uuid),ju={instances:{}},Ai=u.createSlice({name:"assetTypeFieldValues",initialState:ju,extraReducers:t=>t.addMatcher(u.isAnyOf(b,z,M),s=>Object.assign(s,ju)),reducers:{initializeAssetTypeFieldValues:ue.initialize,addAssetTypeFieldValues:ue.addOne,addAssetTypeFieldValuesMany:ue.addMany,setAssetTypeFieldValues:ue.setOne,setAssetTypeFieldValuesMany:ue.setMany,updateAssetTypeFieldValues:ue.updateOne,updateAssetTypeFieldValuesMany:ue.updateMany,deleteAssetTypeFieldValues:ue.deleteOne,deleteAssetTypeFieldValuesMany:ue.deleteMany}}),{initializeAssetTypeFieldValues:Du,addAssetTypeFieldValues:$u,addAssetTypeFieldValuesMany:Uu,setAssetTypeFieldValues:Lu,setAssetTypeFieldValuesMany:Nu,updateAssetTypeFieldValues:Hu,updateAssetTypeFieldValuesMany:Gu,deleteAssetTypeFieldValues:Ku,deleteAssetTypeFieldValuesMany:Yu}=Ai.actions,Zu=t=>t.assetTypeFieldValuesReducer.instances,$t=u.createSelector([Zu],t=>Object.values(t)),z_=A(u.createSelector([$t,(t,s)=>s],(t,s)=>w(t.filter(e=>e.asset===s)))),q_=A(u.createSelector([gt,$t,(t,s)=>s],(t,s,e)=>{const n=new Set(t.filter(a=>a.asset_type===e).map(a=>a.uuid));return w(s.filter(a=>n.has(a.fields_revision)))})),Ju=t=>s=>s.assetTypeFieldValuesReducer.instances[t],Qu=A(u.createSelector([$t,(t,s)=>s],(t,s)=>{const e=new Set(s);return w(t.filter(({uuid:n})=>e.has(n)))})),Xu=Ai.reducer,he=R(t=>t.uuid),xu={instances:{}},wi=u.createSlice({name:"assetTypeIdentifiers",initialState:xu,extraReducers:t=>t.addMatcher(u.isAnyOf(b,M),s=>Object.assign(s,xu)),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:eh,addAssetTypeIdentifier:th,addAssetTypeIdentifiers:sh,setAssetTypeIdentifier:ih,setAssetTypeIdentifiers:nh,updateAssetTypeIdentifier:ah,updateAssetTypeIdentifiers:ch,deleteAssetTypeIdentifier:rh,deleteAssetTypeIdentifiers:dh}=wi.actions,lh=t=>t.assetTypeIdentifierReducer.instances,Ti=u.createSelector([lh],t=>Object.values(t)),oh=t=>s=>s.assetTypeIdentifierReducer.instances[t],uh=A(u.createSelector([Ti,(t,s)=>s],(t,s)=>{const e=new Set(s);return w(t.filter(({uuid:n})=>e.has(n)))})),C_=A(u.createSelector([Ti,(t,s)=>s],(t,s)=>w(t.filter(e=>e.asset_type===s)))),hh=wi.reducer,pe=R(t=>t.uuid),ph={instances:{}},Oi=u.createSlice({name:"assetTypeIdentifierValues",initialState:ph,extraReducers:t=>t.addMatcher(u.isAnyOf(b,z,M),s=>Object.assign(s,ph)),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:mh,addAssetTypeIdentifierValue:yh,addAssetTypeIdentifierValues:fh,setAssetTypeIdentifierValue:Sh,setAssetTypeIdentifierValues:Ah,updateAssetTypeIdentifierValue:wh,updateAssetTypeIdentifierValues:Th,deleteAssetTypeIdentifierValue:Oh,deleteAssetTypeIdentifierValues:Ih}=Oi.actions,Fh=t=>t.assetTypeIdentifierValueReducer.instances,Ut=u.createSelector([Fh],t=>Object.values(t)),Ph=t=>s=>s.assetTypeIdentifierValueReducer.instances[t],gh=A(u.createSelector([Ut,(t,s)=>s],(t,s)=>{const e=new Set(s);return w(t.filter(({uuid:n})=>e.has(n)))})),j_=A(u.createSelector([Ut,(t,s)=>s],(t,s)=>w(t.filter(e=>e.asset===s)))),D_=A(u.createSelector([Ut,(t,s)=>s],(t,s)=>w(t.filter(e=>e.asset_type_identifier===s)))),bh=Oi.reducer,me=R(t=>t.uuid),_h={instances:{}},Ii=u.createSlice({name:"assetTypes",initialState:_h,extraReducers:t=>t.addMatcher(u.isAnyOf(b,M),s=>Object.assign(s,_h)),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:Rh,setAssetType:Mh,setAssetTypes:kh,addAssetType:vh,addAssetTypes:Eh,updateAssetType:Vh,updateAssetTypes:Wh,deleteAssetType:Bh,deleteAssetTypes:zh}=Ii.actions,qh=t=>t.assetTypeReducer.instances,Fi=u.createSelector([qh],t=>Object.values(t)),Ch=t=>s=>s.assetTypeReducer.instances[t],jh=A(u.createSelector([Fi,(t,s)=>s],(t,s)=>{const e=new Set(s);return w(t.filter(({uuid:n})=>e.has(n)))})),$_=A(u.createSelector([Fi,(t,s)=>s],(t,s)=>w(t.filter(e=>e.organization===s)))),Dh=Ii.reducer,ye=R(t=>t.uuid),$h={instances:{}},Pi=u.createSlice({name:"assetTypeStatuses",initialState:$h,extraReducers:t=>t.addMatcher(u.isAnyOf(b,M),s=>Object.assign(s,$h)),reducers:{initializeAssetTypeStatuses:ye.initialize,addAssetTypeStatus:ye.addOne,addAssetTypeStatuses:ye.addMany,setAssetTypeStatus:ye.setOne,setAssetTypeStatuses:ye.setMany,updateAssetTypeStatus:ye.updateOne,updateAssetTypeStatuses:ye.updateMany,deleteAssetTypeStatus:ye.deleteOne,deleteAssetTypeStatuses:ye.deleteMany}}),{initializeAssetTypeStatuses:Uh,addAssetTypeStatus:Lh,addAssetTypeStatuses:Nh,setAssetTypeStatus:Hh,setAssetTypeStatuses:Gh,updateAssetTypeStatus:Kh,updateAssetTypeStatuses:Yh,deleteAssetTypeStatus:Zh,deleteAssetTypeStatuses:Jh}=Pi.actions,Qh=t=>t.assetTypeStatusReducer.instances,gi=u.createSelector([Qh],t=>w(Object.values(t).toSorted(bc))),Xh=t=>s=>s.assetTypeStatusReducer.instances[t],xh=A(u.createSelector([gi,(t,s)=>s],(t,s)=>{const e=new Set(s);return w(t.filter(({uuid:n})=>e.has(n)))})),U_=A(u.createSelector([gi,(t,s)=>s],(t,s)=>w(t.filter(e=>e.asset_type===s)))),ep=Pi.reducer,tp={accessToken:"",refreshToken:"",isLoggedIn:!1},Lt=u.createSlice({name:"auth",initialState:tp,extraReducers:t=>t.addCase(b,s=>Object.assign(s,tp)),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||Lt.caseReducers.clearTokens(t),t.isLoggedIn=s.payload}}}),{setTokens:L_,clearTokens:N_,setLoggedIn:sp}=Lt.actions,H_=t=>t.authReducer.accessToken,G_=t=>t.authReducer.isLoggedIn,ip=Lt.reducer,fe=R(t=>t.uuid),np={instances:{}},bi=u.createSlice({name:"categories",initialState:np,extraReducers:t=>t.addMatcher(u.isAnyOf(b,M),s=>Object.assign(s,np)),reducers:{initializeCategories:fe.initialize,addCategory:fe.addOne,addCategories:fe.addMany,setCategory:fe.setOne,setCategories:fe.setMany,updateCategory:fe.updateOne,updateCategories:fe.updateMany,deleteCategory:fe.deleteOne,deleteCategories:fe.deleteMany}}),{initializeCategories:ap,addCategory:cp,addCategories:rp,setCategory:dp,setCategories:lp,updateCategory:op,updateCategories:up,deleteCategory:hp,deleteCategories:pp}=bi.actions,mp=t=>t.categoryReducer.instances,_i=u.createSelector([mp],t=>Object.values(t)),Ri=t=>s=>s.categoryReducer.instances[t],yp=A(u.createSelector([_i,(t,s)=>s],(t,s)=>{const e=new Set(s);return w(t.filter(({uuid:n})=>e.has(n)))})),K_=A(u.createSelector([_i,(t,s)=>s],(t,s)=>w(t.filter(e=>e.project===s)))),fp=bi.reducer,Se=R(t=>t.uuid),Sp={instances:{}},Mi=u.createSlice({name:"documentAttachments",initialState:Sp,extraReducers:t=>t.addCase(b,s=>Object.assign(s,Sp)),reducers:{initializeDocumentAttachments:Se.initialize,addDocumentAttachment:Se.addOne,addDocumentAttachments:Se.addMany,setDocumentAttachment:Se.setOne,setDocumentAttachments:Se.setMany,updateDocumentAttachment:Se.updateOne,updateDocumentAttachments:Se.updateMany,deleteDocumentAttachment:Se.deleteOne,deleteDocumentAttachments:Se.deleteMany}}),{initializeDocumentAttachments:Ap,addDocumentAttachment:wp,addDocumentAttachments:Tp,setDocumentAttachment:Op,setDocumentAttachments:Ip,updateDocumentAttachment:Fp,updateDocumentAttachments:Pp,deleteDocumentAttachment:gp,deleteDocumentAttachments:bp}=Mi.actions,_p=t=>t.documentAttachmentReducer.instances,ki=u.createSelector([_p],t=>Object.values(t)),Rp=t=>s=>s.documentAttachmentReducer.instances[t],Mp=A(u.createSelector([ki,(t,s)=>s],(t,s)=>{const e=new Set(s);return w(t.filter(({uuid:n})=>e.has(n)))})),Y_=A(u.createSelector([ki,(t,s)=>s],(t,s)=>w(t.filter(({document:e})=>s===e)))),kp=Mi.reducer,Ae=R(({uuid:t})=>t),vp={instances:{}},vi=u.createSlice({name:"documents",initialState:vp,extraReducers:t=>t.addMatcher(u.isAnyOf(b,M),s=>{Object.assign(s,vp)}),reducers:{initializeDocuments:Ae.initialize,addDocument:Ae.addOne,addDocuments:Ae.addMany,setDocument:Ae.setOne,setDocuments:Ae.setMany,updateDocument:Ae.updateOne,updateDocuments:Ae.updateMany,deleteDocument:Ae.deleteOne,deleteDocuments:Ae.deleteMany}}),{initializeDocuments:Ep,addDocument:Vp,addDocuments:Wp,setDocument:Bp,setDocuments:zp,updateDocument:qp,updateDocuments:Cp,deleteDocument:jp,deleteDocuments:Dp}=vi.actions,$p=vi.reducer,Ei=t=>t.documentsReducer.instances,Nt=u.createSelector([Ei],t=>Object.values(t)),Up=t=>s=>s.documentsReducer.instances[t],Lp=A(u.createSelector([Nt,(t,s)=>s],(t,s)=>{const e=new Set(s);return w(t.filter(({uuid:n})=>e.has(n)))})),Z_=A(u.createSelector([Nt,(t,s)=>s],(t,s)=>t.filter(e=>e.project===s))),J_=A(u.createSelector([Nt,(t,s)=>s],(t,s)=>t.filter(e=>e.organization===s))),Np=A(u.createSelector([Ei,(t,s)=>s],(t,s)=>{if(!t[s])return w([]);const a=Mc(s,Object.values(t)).all().map(({model:c})=>c);return w(a)})),we=R(t=>t.uuid),Hp={instances:{}},Vi=u.createSlice({name:"emailDomains",initialState:Hp,extraReducers:t=>t.addMatcher(u.isAnyOf(b,M),s=>Object.assign(s,Hp)),reducers:{initializeEmailDomains:we.initialize,addEmailDomain:we.addOne,addEmailDomains:we.addMany,setEmailDomain:we.setOne,setEmailDomains:we.setMany,updateEmailDomain:we.updateOne,updateEmailDomains:we.updateMany,deleteEmailDomain:we.deleteOne,deleteEmailDomains:we.deleteMany}}),{initializeEmailDomains:Gp,addEmailDomain:Kp,addEmailDomains:Yp,setEmailDomain:Zp,setEmailDomains:Jp,updateEmailDomain:Qp,updateEmailDomains:Xp,deleteEmailDomain:xp,deleteEmailDomains:em}=Vi.actions,tm=t=>t.emailDomainsReducer.instances,Wi=u.createSelector([tm],t=>Object.values(t)),sm=t=>s=>s.emailDomainsReducer.instances[t],im=A(u.createSelector([Wi,(t,s)=>s],(t,s)=>{const e=new Set(s);return w(t.filter(({uuid:n})=>e.has(n)))})),Q_=A(u.createSelector([Wi,(t,s)=>s],(t,s)=>w(t.filter(e=>e.organization===s)))),nm=Vi.reducer,am={s3Urls:{}},cm=1e3*60*60,X_=cm*24*7,Bi=u.createSlice({name:"file",initialState:am,extraReducers:t=>t.addCase(b,s=>Object.assign(s,am)),reducers:{setUploadUrl:(t,s)=>{const{url:e,fields:n,sha1:a}=s.payload,c=new Date,d=new Date(c.getTime()+X_);t.s3Urls[a]={url:e,fields:n,exp:d.getTime()}}}}),{setUploadUrl:rm}=Bi.actions,dm=t=>s=>{const e=s.fileReducer.s3Urls[t];if(!e)return;const n=new Date().getTime();if(!((e.exp??n)-n<cm))return e},lm=Bi.reducer,Te=R(t=>t.uuid),om={instances:{}},zi=u.createSlice({name:"formIdentifiers",initialState:om,extraReducers:t=>t.addMatcher(u.isAnyOf(b,M),s=>Object.assign(s,om)),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:um,addFormIdentifier:hm,addFormIdentifiers:pm,setFormIdentifier:mm,setFormIdentifiers:ym,updateFormIdentifier:fm,updateFormIdentifiers:Sm,deleteFormIdentifier:Am,deleteFormIdentifiers:wm}=zi.actions,Tm=t=>t.formIdentifierReducer.instances,qi=u.createSelector([Tm],t=>Object.values(t)),Om=t=>s=>s.formIdentifierReducer.instances[t],Im=A(u.createSelector([qi,(t,s)=>s],(t,s)=>{const e=new Set(s);return w(t.filter(({uuid:n})=>e.has(n)))})),x_=A(u.createSelector([qi,(t,s)=>s],(t,s)=>w(t.filter(e=>e.form===s)))),Fm=zi.reducer,Oe=R(t=>t.uuid),Pm={instances:{}},Ci=u.createSlice({name:"formIdentifierValues",initialState:Pm,extraReducers:t=>t.addMatcher(u.isAnyOf(b,M),s=>Object.assign(s,Pm)),reducers:{initializeFormIdentifierValues:Oe.initialize,addFormIdentifierValue:Oe.addOne,addFormIdentifierValues:Oe.addMany,setFormIdentifierValue:Oe.setOne,setFormIdentifierValues:Oe.setMany,updateFormIdentifierValue:Oe.updateOne,updateFormIdentifierValues:Oe.updateMany,deleteFormIdentifierValue:Oe.deleteOne,deleteFormIdentifierValues:Oe.deleteMany}}),{initializeFormIdentifierValues:gm,addFormIdentifierValue:bm,addFormIdentifierValues:_m,setFormIdentifierValue:Rm,setFormIdentifierValues:Mm,updateFormIdentifierValue:km,updateFormIdentifierValues:vm,deleteFormIdentifierValue:Em,deleteFormIdentifierValues:Vm}=Ci.actions,Wm=t=>t.formIdentifierValueReducer.instances,Ht=u.createSelector([Wm],t=>Object.values(t)),Bm=t=>s=>s.formIdentifierValueReducer.instances[t],zm=A(u.createSelector([Ht,(t,s)=>s],(t,s)=>{const e=new Set(s);return w(t.filter(({uuid:n})=>e.has(n)))})),eR=A(u.createSelector([Ht,(t,s)=>s],(t,s)=>w(t.filter(e=>e.form_submission===s)))),tR=A(u.createSelector([Ht,(t,s)=>s],(t,s)=>w(t.filter(e=>e.form_identifier===s)))),qm=Ci.reducer,Ie=R(t=>t.uuid),Cm={instances:{}},ji=u.createSlice({name:"formRevisionAttachments",initialState:Cm,extraReducers:t=>t.addMatcher(u.isAnyOf(b,M),s=>Object.assign(s,Cm)),reducers:{initializeFormRevisionAttachments:Ie.initialize,addFormRevisionAttachment:Ie.addOne,addFormRevisionAttachments:Ie.addMany,setFormRevisionAttachment:Ie.setOne,setFormRevisionAttachments:Ie.setMany,updateFormRevisionAttachment:Ie.updateOne,updateFormRevisionAttachments:Ie.updateMany,deleteFormRevisionAttachment:Ie.deleteOne,deleteFormRevisionAttachments:Ie.deleteMany}}),{initializeFormRevisionAttachments:jm,addFormRevisionAttachment:Dm,addFormRevisionAttachments:$m,setFormRevisionAttachment:Um,setFormRevisionAttachments:Lm,updateFormRevisionAttachment:Nm,updateFormRevisionAttachments:Hm,deleteFormRevisionAttachment:Gm,deleteFormRevisionAttachments:Km}=ji.actions,Gt=t=>t.formRevisionAttachmentReducer.instances,Ym=u.createSelector([Gt],t=>Object.values(t)),Zm=A(u.createSelector([Gt,(t,s)=>s],(t,s)=>t[s])),Jm=A(u.createSelector([Ym,(t,s)=>s],(t,s)=>{const e=new Set(s);return w(t.filter(({uuid:n})=>e.has(n)))})),sR=A(u.createSelector([Gt,(t,s)=>s],(t,s)=>w(Object.values(t).filter(e=>e.form_revision===s)))),Qm=ji.reducer,Fe=R(t=>t.uuid),Xm={instances:{}},Di=u.createSlice({name:"formRevisions",initialState:Xm,extraReducers:t=>t.addMatcher(u.isAnyOf(b,M),s=>Object.assign(s,Xm)),reducers:{initializeFormRevisions:Fe.initialize,addFormRevision:Fe.addOne,addFormRevisions:Fe.addMany,setFormRevision:Fe.setOne,setFormRevisions:Fe.setMany,updateFormRevision:Fe.updateOne,updateFormRevisions:Fe.updateMany,deleteFormRevision:Fe.deleteOne,deleteFormRevisions:Fe.deleteMany}}),{initializeFormRevisions:xm,addFormRevision:$i,addFormRevisions:Ui,setFormRevision:ey,setFormRevisions:ty,updateFormRevision:sy,updateFormRevisions:iy,deleteFormRevision:Li,deleteFormRevisions:Ni}=Di.actions,Hi=t=>t.formRevisionReducer.instances,Kt=u.createSelector([Hi],t=>Object.values(t)),ny=t=>s=>s.formRevisionReducer.instances[t],ay=A(u.createSelector([Kt,(t,s)=>s],(t,s)=>{const e=new Set(s);return w(t.filter(({uuid:n})=>e.has(n)))})),iR=A(u.createSelector([Kt,(t,s)=>s],(t,s)=>t.filter(e=>e.form===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),cy=A(u.createSelector([Kt,(t,s)=>s],(t,s)=>w(t.filter(e=>e.form===s)))),ry=Di.reducer,Pe=R(t=>t.uuid),dy={instances:{}},Gi=u.createSlice({name:"forms",initialState:dy,extraReducers:t=>t.addMatcher(u.isAnyOf(b,M),s=>Object.assign(s,dy)),reducers:{initializeForms:Pe.initialize,addForm:Pe.addOne,addForms:Pe.addMany,setForm:Pe.setOne,setForms:Pe.setMany,updateForm:Pe.updateOne,updateForms:Pe.updateMany,deleteForm:Pe.deleteOne,deleteForms:Pe.deleteMany}}),{initializeForms:ly,addForm:oy,addForms:uy,setForm:hy,setForms:py,updateForm:my,updateForms:yy,deleteForm:fy,deleteForms:Sy}=Gi.actions,Ay=Gi.reducer,wy=t=>t.formReducer.instances,Ki=u.createSelector([wy],t=>Object.values(t)),Ty=t=>s=>s.formReducer.instances[t],Oy=A(u.createSelector([Ki,(t,s)=>s],(t,s)=>{const e=new Set(s);return w(t.filter(({uuid:n})=>e.has(n)))})),nR=A(u.createSelector([Ki,(t,s)=>s],(t,s)=>w(t.filter(e=>e.organization===s)))),ge=R(t=>t.uuid),Iy={instances:{}},Yi=u.createSlice({name:"formSubmissionAttachments",initialState:Iy,extraReducers:t=>t.addMatcher(u.isAnyOf(b,M),s=>Object.assign(s,Iy)),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:Fy,addFormSubmissionAttachment:Py,addFormSubmissionAttachments:Zi,setFormSubmissionAttachment:gy,setFormSubmissionAttachments:by,updateFormSubmissionAttachment:_y,updateFormSubmissionAttachments:Ry,deleteFormSubmissionAttachment:My,deleteFormSubmissionAttachments:Ji}=Yi.actions,Qi=t=>t.formSubmissionAttachmentReducer.instances,Xi=u.createSelector([Qi],t=>Object.values(t)),ky=A(u.createSelector([Qi,(t,s)=>s],(t,s)=>t[s])),xi=A(u.createSelector([Xi,(t,s)=>s],(t,s)=>{const e=new Set(s);return w(t.filter(n=>e.has(n.uuid)))})),vy=xi,Ey=A(u.createSelector([Xi,(t,s)=>s],(t,s)=>w(t.filter(e=>e.form_submission===s)))),Vy=Yi.reducer,be=R(t=>t.uuid),Wy={instances:{}},en=u.createSlice({name:"formSubmissions",initialState:Wy,extraReducers:t=>t.addMatcher(u.isAnyOf(b,M),s=>Object.assign(s,Wy)),reducers:{initializeFormSubmissions:be.initialize,setFormSubmission:be.setOne,setFormSubmissions:be.setMany,addFormSubmission:be.addOne,addFormSubmissions:be.addMany,updateFormSubmission:be.updateOne,updateFormSubmissions:be.updateMany,deleteFormSubmission:be.deleteOne,deleteFormSubmissions:be.deleteMany}}),{initializeFormSubmissions:By,setFormSubmission:zy,setFormSubmissions:qy,addFormSubmission:Cy,addFormSubmissions:tn,updateFormSubmission:jy,updateFormSubmissions:Dy,deleteFormSubmission:$y,deleteFormSubmissions:sn}=en.actions,nn=t=>t.formSubmissionReducer.instances,Uy=u.createSelector([nn],t=>Object.values(t)),Ly=t=>s=>s.formSubmissionReducer.instances[t],Ny=A(u.createSelector([Uy,(t,s)=>s],(t,s)=>{const e=new Set(s);return w(t.filter(({uuid:n})=>e.has(n)))})),Hy=A(u.createSelector([nn,Hi,(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))})),Gy=en.reducer,_e=R(t=>t.uuid),Ky={instances:{}},an=u.createSlice({name:"geoImages",initialState:Ky,extraReducers:t=>t.addMatcher(u.isAnyOf(b,z,M),s=>Object.assign(s,Ky)),reducers:{initializeGeoImages:_e.initialize,setGeoImage:_e.setOne,setGeoImages:_e.setMany,addGeoImage:_e.addOne,addGeoImages:_e.addMany,updateGeoImage:_e.updateOne,updateGeoImages:_e.updateMany,deleteGeoImage:_e.deleteOne,deleteGeoImages:_e.deleteMany}}),{initializeGeoImages:Yy,setGeoImage:Zy,setGeoImages:Jy,addGeoImage:Qy,addGeoImages:Xy,updateGeoImage:xy,updateGeoImages:ef,deleteGeoImage:tf,deleteGeoImages:sf}=an.actions,nf=t=>t.geoImageReducer.instances,cn=u.createSelector([nf],t=>Object.values(t)),af=t=>s=>s.geoImageReducer.instances[t],cf=A(u.createSelector([cn,(t,s)=>s],(t,s)=>{const e=new Set(s);return w(t.filter(({uuid:n})=>e.has(n)))})),aR=A(u.createSelector([cn,(t,s)=>s],(t,s)=>w(t.filter(e=>e.project===s)))),rf=an.reducer,Re=R(t=>t.uuid),df={instances:{}},rn=u.createSlice({name:"issueAssociations",initialState:df,extraReducers:t=>t.addMatcher(u.isAnyOf(b,z,M),s=>Object.assign(s,df)),reducers:{initializeIssueAssociations:Re.initialize,addIssueAssociation:Re.addOne,addIssueAssociations:Re.addMany,setIssueAssociation:Re.setOne,setIssueAssociations:Re.setMany,updateIssueAssociation:Re.updateOne,updateIssueAssociations:Re.updateMany,deleteIssueAssociation:Re.deleteOne,deleteIssueAssociations:Re.deleteMany}}),{initializeIssueAssociations:lf,setIssueAssociations:of,setIssueAssociation:uf,updateIssueAssociation:hf,updateIssueAssociations:pf,addIssueAssociation:mf,addIssueAssociations:Yt,deleteIssueAssociation:yf,deleteIssueAssociations:Zt}=rn.actions,bt=t=>t.issueAssociationReducer.instances,ff=u.createSelector([bt],t=>Object.values(t)),Sf=t=>s=>s.issueAssociationReducer.instances[t],Af=A(u.createSelector([ff,(t,s)=>s],(t,s)=>{const e=new Set(s);return w(t.filter(({uuid:n})=>e.has(n)))})),wf=A(u.createSelector([bt,(t,s)=>s],(t,s)=>w(Object.values(t).filter(e=>e.associated_issue===s)))),Tf=A(u.createSelector([bt,(t,s)=>s],(t,s)=>w(Object.values(t).filter(e=>e.issue===s)))),Of=A(u.createSelector([bt,(t,s)=>s],(t,s)=>w(Object.values(t).filter(e=>e.asset===s)))),If=rn.reducer,Me=R(t=>t.uuid),Ff={instances:{}},dn=u.createSlice({name:"issueAttachments",initialState:Ff,extraReducers:t=>t.addMatcher(u.isAnyOf(b,z,M),s=>Object.assign(s,Ff)),reducers:{initializeIssueAttachments:Me.initialize,addIssueAttachment:Me.addOne,addIssueAttachments:Me.addMany,setIssueAttachment:Me.setOne,setIssueAttachments:Me.setMany,updateIssueAttachment:Me.updateOne,updateIssueAttachments:Me.updateMany,deleteIssueAttachment:Me.deleteOne,deleteIssueAttachments:Me.deleteMany}}),{initializeIssueAttachments:Pf,addIssueAttachment:gf,addIssueAttachments:ln,setIssueAttachment:bf,setIssueAttachments:_f,updateIssueAttachment:Rf,updateIssueAttachments:Mf,deleteIssueAttachment:kf,deleteIssueAttachments:on}=dn.actions,vf=t=>t.issueAttachmentReducer.instances,un=u.createSelector([vf],t=>Object.values(t)),Ef=A(u.createSelector([un,(t,s)=>s],(t,s)=>w(t.filter(({issue:e})=>s===e)))),Vf=t=>s=>s.issueAttachmentReducer.instances[t],Wf=A(u.createSelector([un,(t,s)=>s],(t,s)=>{const e=new Set(s);return w(t.filter(({uuid:n})=>e.has(n)))})),Bf=dn.reducer,ke=R(t=>t.uuid),zf={instances:{}},hn=u.createSlice({name:"issueCommentAttachments",initialState:zf,extraReducers:t=>t.addMatcher(u.isAnyOf(b,z,M),s=>Object.assign(s,zf)),reducers:{initializeIssueCommentAttachments:ke.initialize,addIssueCommentAttachment:ke.addOne,addIssueCommentAttachments:ke.addMany,setIssueCommentAttachment:ke.setOne,setIssueCommentAttachments:ke.setMany,updateIssueCommentAttachment:ke.updateOne,updateIssueCommentAttachments:ke.updateMany,deleteIssueCommentAttachment:ke.deleteOne,deleteIssueCommentAttachments:ke.deleteMany}}),{initializeIssueCommentAttachments:qf,addIssueCommentAttachment:Cf,addIssueCommentAttachments:jf,setIssueCommentAttachment:Df,setIssueCommentAttachments:$f,updateIssueCommentAttachment:Uf,updateIssueCommentAttachments:Lf,deleteIssueCommentAttachment:Nf,deleteIssueCommentAttachments:Hf}=hn.actions,Gf=t=>t.issueCommentAttachmentReducer.instances,pn=u.createSelector([Gf],t=>Object.values(t)),Kf=t=>s=>s.issueCommentAttachmentReducer.instances[t],Yf=A(u.createSelector([pn,(t,s)=>s],(t,s)=>{const e=new Set(s);return w(t.filter(({uuid:n})=>e.has(n)))})),cR=A(u.createSelector([pn,(t,s)=>s],(t,s)=>w(t.filter(({issue_comment:e})=>s===e)))),Zf=hn.reducer,ve=R(t=>t.uuid),Jf={instances:{}},mn=u.createSlice({name:"issueComments",initialState:Jf,extraReducers:t=>t.addMatcher(u.isAnyOf(b,z,M),s=>Object.assign(s,Jf)),reducers:{initializeIssueComments:ve.initialize,addIssueComment:ve.addOne,addIssueComments:ve.addMany,setIssueComment:ve.setOne,setIssueComments:ve.setMany,updateIssueComment:ve.updateOne,updateIssueComments:ve.updateMany,deleteIssueComment:ve.deleteOne,deleteIssueComments:ve.deleteMany}}),{initializeIssueComments:Qf,addIssueComment:Xf,addIssueComments:xf,setIssueComment:eS,setIssueComments:tS,updateIssueComment:sS,updateIssueComments:iS,deleteIssueComment:nS,deleteIssueComments:aS}=mn.actions,yn=t=>t.issueCommentReducer.instances,cS=t=>s=>s.issueCommentReducer.instances[t],rS=A(u.createSelector([yn,(t,s)=>s],(t,s)=>{const e=new Set(s);return w(Object.values(t).filter(({uuid:n})=>e.has(n)))})),rR=A(u.createSelector([yn,(t,s)=>s],(t,s)=>w(Object.values(t).filter(e=>e.issue===s)))),dS=mn.reducer,Ee=R(t=>t.uuid),lS={instances:{}},fn=u.createSlice({name:"issues",initialState:lS,extraReducers:t=>t.addMatcher(u.isAnyOf(b,z,M),s=>Object.assign(s,lS)),reducers:{initializeIssues:Ee.initialize,addIssue:Ee.addOne,addIssues:Ee.addMany,setIssue:Ee.setOne,setIssues:Ee.setMany,updateIssue:Ee.updateOne,updateIssues:Ee.updateMany,deleteIssue:Ee.deleteOne,deleteIssues:Ee.deleteMany}}),{initializeIssues:oS,addIssue:uS,addIssues:Sn,setIssue:hS,setIssues:pS,updateIssue:mS,updateIssues:yS,deleteIssue:fS,deleteIssues:An}=fn.actions,SS=t=>t.issueReducer.instances,Jt=u.createSelector([SS],t=>Object.values(t)),AS=t=>s=>s.issueReducer.instances[t],wS=A(u.createSelector([Jt,(t,s)=>s],(t,s)=>{const e=new Set(s);return w(t.filter(({uuid:n})=>e.has(n)))})),dR=A(u.createSelector([Jt,(t,s)=>s],(t,s)=>t.filter(e=>e.project===s))),TS=A(u.createSelector([Jt,(t,s)=>s],(t,s)=>t.filter(e=>e.issue_type===s))),OS=fn.reducer,Ve=R(t=>t.uuid),IS={instances:{}},wn=u.createSlice({name:"issueTypeAttachments",initialState:IS,extraReducers:t=>t.addMatcher(u.isAnyOf(b,M),s=>Object.assign(s,IS)),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:FS,addIssueTypeAttachment:PS,addIssueTypeAttachments:gS,setIssueTypeAttachment:bS,setIssueTypeAttachments:_S,updateIssueTypeAttachment:RS,updateIssueTypeAttachments:MS,deleteIssueTypeAttachment:kS,deleteIssueTypeAttachments:vS}=wn.actions,ES=t=>t.issueTypeAttachmentReducer.instances,Tn=u.createSelector([ES],t=>Object.values(t)),VS=t=>s=>s.issueTypeAttachmentReducer.instances[t],WS=A(u.createSelector([Tn,(t,s)=>s],(t,s)=>{const e=new Set(s);return w(t.filter(({uuid:n})=>e.has(n)))})),lR=A(u.createSelector([Tn,(t,s)=>s],(t,s)=>w(t.filter(({issue_type:e})=>s===e)))),BS=wn.reducer,We=R(t=>t.uuid),zS={instances:{}},On=u.createSlice({name:"issueTypeFieldsAttachments",initialState:zS,extraReducers:t=>t.addMatcher(u.isAnyOf(b,M),s=>Object.assign(s,zS)),reducers:{initializeIssueTypeFieldsAttachments:We.initialize,addIssueTypeFieldsAttachment:We.addOne,addIssueTypeFieldsAttachments:We.addMany,setIssueTypeFieldsAttachment:We.setOne,setIssueTypeFieldsAttachments:We.setMany,updateIssueTypeFieldsAttachment:We.updateOne,updateIssueTypeFieldsAttachments:We.updateMany,deleteIssueTypeFieldsAttachment:We.deleteOne,deleteIssueTypeFieldsAttachments:We.deleteMany}}),{initializeIssueTypeFieldsAttachments:qS,addIssueTypeFieldsAttachment:CS,addIssueTypeFieldsAttachments:jS,setIssueTypeFieldsAttachment:DS,setIssueTypeFieldsAttachments:$S,updateIssueTypeFieldsAttachment:US,updateIssueTypeFieldsAttachments:LS,deleteIssueTypeFieldsAttachment:NS,deleteIssueTypeFieldsAttachments:HS}=On.actions,GS=t=>t.issueTypeFieldsAttachmentReducer.instances,In=u.createSelector([GS],t=>Object.values(t)),oR=A(u.createSelector([In,(t,s)=>s],(t,s)=>w(t.filter(e=>e.fields_revision===s)))),KS=t=>s=>s.issueTypeFieldsAttachmentReducer.instances[t],YS=A(u.createSelector([In,(t,s)=>s],(t,s)=>{const e=new Set(s);return w(t.filter(({uuid:n})=>e.has(n)))})),ZS=On.reducer,Be=R(t=>t.uuid),JS={instances:{}},Fn=u.createSlice({name:"issueTypeFieldValues",initialState:JS,extraReducers:t=>t.addMatcher(u.isAnyOf(b,z,M),s=>Object.assign(s,JS)),reducers:{initializeIssueTypeFieldValues:Be.initialize,addIssueTypeFieldValues:Be.addOne,addIssueTypeFieldValuesMany:Be.addMany,setIssueTypeFieldValues:Be.setOne,setIssueTypeFieldValuesMany:Be.setMany,updateIssueTypeFieldValues:Be.updateOne,updateIssueTypeFieldValuesMany:Be.updateMany,deleteIssueTypeFieldValues:Be.deleteOne,deleteIssueTypeFieldValuesMany:Be.deleteMany}}),{initializeIssueTypeFieldValues:QS,addIssueTypeFieldValues:XS,addIssueTypeFieldValuesMany:xS,setIssueTypeFieldValues:eA,setIssueTypeFieldValuesMany:tA,updateIssueTypeFieldValues:sA,updateIssueTypeFieldValuesMany:iA,deleteIssueTypeFieldValues:nA,deleteIssueTypeFieldValuesMany:aA}=Fn.actions,cA=t=>t.issueTypeFieldValuesReducer.instances,Qt=u.createSelector([cA],t=>Object.values(t)),uR=A(u.createSelector([Qt,(t,s)=>s],(t,s)=>w(t.filter(e=>e.issue===s)))),rA=t=>s=>s.issueTypeFieldValuesReducer.instances[t],dA=A(u.createSelector([Qt,(t,s)=>s],(t,s)=>{const e=new Set(s);return w(t.filter(({uuid:n})=>e.has(n)))})),lA=Fn.reducer,ze=R(t=>t.uuid),oA={instances:{}},Pn=u.createSlice({name:"issueTypeFields",initialState:oA,extraReducers:t=>t.addMatcher(u.isAnyOf(b,M),s=>Object.assign(s,oA)),reducers:{initializeIssueTypeFields:ze.initialize,addIssueTypeFields:ze.addOne,addIssueTypeFieldsMany:ze.addMany,setIssueTypeFields:ze.setOne,setIssueTypeFieldsMany:ze.setMany,updateIssueTypeFields:ze.updateOne,updateIssueTypeFieldsMany:ze.updateMany,deleteIssueTypeFields:ze.deleteOne,deleteIssueTypeFieldsMany:ze.deleteMany}}),{initializeIssueTypeFields:uA,addIssueTypeFields:hA,addIssueTypeFieldsMany:pA,setIssueTypeFields:mA,setIssueTypeFieldsMany:yA,updateIssueTypeFields:fA,updateIssueTypeFieldsMany:SA,deleteIssueTypeFields:AA,deleteIssueTypeFieldsMany:wA}=Pn.actions,TA=t=>t.issueTypeFieldsReducer.instances,_t=u.createSelector([TA],t=>Object.values(t)),hR=A(u.createSelector([_t,(t,s)=>s],(t,s)=>w(t.filter(e=>e.issue_type===s)))),pR=A(u.createSelector([_t,(t,s)=>s],(t,s)=>t.filter(e=>e.issue_type===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),mR=A(u.createSelector([_t,Qt,(t,s)=>s],(t,s,e)=>{const n=new Set(t.filter(a=>a.issue_type===e).map(a=>a.uuid));return w(s.filter(a=>n.has(a.fields_revision)))})),OA=t=>s=>s.issueTypeFieldsReducer.instances[t],IA=A(u.createSelector([_t,(t,s)=>s],(t,s)=>{const e=new Set(s);return w(t.filter(({uuid:n})=>e.has(n)))})),FA=Pn.reducer,qe=R(t=>t.uuid),PA={instances:{}},gn=u.createSlice({name:"issueTypeFieldValuesAttachments",initialState:PA,extraReducers:t=>t.addMatcher(u.isAnyOf(b,z,M),s=>Object.assign(s,PA)),reducers:{initializeIssueTypeFieldValuesAttachments:qe.initialize,addIssueTypeFieldValuesAttachment:qe.addOne,addIssueTypeFieldValuesAttachments:qe.addMany,setIssueTypeFieldValuesAttachment:qe.setOne,setIssueTypeFieldValuesAttachments:qe.setMany,updateIssueTypeFieldValuesAttachment:qe.updateOne,updateIssueTypeFieldValuesAttachments:qe.updateMany,deleteIssueTypeFieldValuesAttachment:qe.deleteOne,deleteIssueTypeFieldValuesAttachments:qe.deleteMany}}),{initializeIssueTypeFieldValuesAttachments:gA,addIssueTypeFieldValuesAttachment:bA,addIssueTypeFieldValuesAttachments:bn,setIssueTypeFieldValuesAttachment:_A,setIssueTypeFieldValuesAttachments:RA,updateIssueTypeFieldValuesAttachment:MA,updateIssueTypeFieldValuesAttachments:kA,deleteIssueTypeFieldValuesAttachment:vA,deleteIssueTypeFieldValuesAttachments:_n}=gn.actions,EA=t=>t.issueTypeFieldValuesAttachmentReducer.instances,Rn=u.createSelector([EA],t=>Object.values(t)),VA=t=>s=>s.issueTypeFieldValuesAttachmentReducer.instances[t],WA=A(u.createSelector([Rn,(t,s)=>s],(t,s)=>{const e=new Set(s);return w(t.filter(({uuid:n})=>e.has(n)))})),BA=A(u.createSelector([Rn,(t,s)=>s],(t,s)=>w(t.filter(e=>e.field_values===s)))),zA=gn.reducer,Ce=R(t=>t.uuid),qA={instances:{}},Mn=u.createSlice({name:"issueTypeIdentifiers",initialState:qA,extraReducers:t=>t.addMatcher(u.isAnyOf(b,M),s=>Object.assign(s,qA)),reducers:{initializeIssueTypeIdentifiers:Ce.initialize,addIssueTypeIdentifier:Ce.addOne,addIssueTypeIdentifiers:Ce.addMany,setIssueTypeIdentifier:Ce.setOne,setIssueTypeIdentifiers:Ce.setMany,updateIssueTypeIdentifier:Ce.updateOne,updateIssueTypeIdentifiers:Ce.updateMany,deleteIssueTypeIdentifier:Ce.deleteOne,deleteIssueTypeIdentifiers:Ce.deleteMany}}),{initializeIssueTypeIdentifiers:CA,addIssueTypeIdentifier:jA,addIssueTypeIdentifiers:DA,setIssueTypeIdentifier:$A,setIssueTypeIdentifiers:UA,updateIssueTypeIdentifier:LA,updateIssueTypeIdentifiers:NA,deleteIssueTypeIdentifier:HA,deleteIssueTypeIdentifiers:GA}=Mn.actions,KA=t=>t.issueTypeIdentifierReducer.instances,kn=u.createSelector([KA],t=>Object.values(t)),YA=t=>s=>s.issueTypeIdentifierReducer.instances[t],ZA=A(u.createSelector([kn,(t,s)=>s],(t,s)=>{const e=new Set(s);return w(t.filter(({uuid:n})=>e.has(n)))})),yR=A(u.createSelector([kn,(t,s)=>s],(t,s)=>w(t.filter(e=>e.issue_type===s)))),JA=Mn.reducer,je=R(t=>t.uuid),QA={instances:{}},vn=u.createSlice({name:"issueTypeIdentifierValues",initialState:QA,extraReducers:t=>t.addMatcher(u.isAnyOf(b,z,M),s=>Object.assign(s,QA)),reducers:{initializeIssueTypeIdentifierValues:je.initialize,addIssueTypeIdentifierValue:je.addOne,addIssueTypeIdentifierValues:je.addMany,setIssueTypeIdentifierValue:je.setOne,setIssueTypeIdentifierValues:je.setMany,updateIssueTypeIdentifierValue:je.updateOne,updateIssueTypeIdentifierValues:je.updateMany,deleteIssueTypeIdentifierValue:je.deleteOne,deleteIssueTypeIdentifierValues:je.deleteMany}}),{initializeIssueTypeIdentifierValues:XA,addIssueTypeIdentifierValue:xA,addIssueTypeIdentifierValues:ew,setIssueTypeIdentifierValue:tw,setIssueTypeIdentifierValues:sw,updateIssueTypeIdentifierValue:iw,updateIssueTypeIdentifierValues:nw,deleteIssueTypeIdentifierValue:aw,deleteIssueTypeIdentifierValues:cw}=vn.actions,rw=t=>t.issueTypeIdentifierValueReducer.instances,Xt=u.createSelector([rw],t=>Object.values(t)),dw=t=>s=>s.issueTypeIdentifierValueReducer.instances[t],lw=A(u.createSelector([Xt,(t,s)=>s],(t,s)=>{const e=new Set(s);return w(t.filter(({uuid:n})=>e.has(n)))})),fR=A(u.createSelector([Xt,(t,s)=>s],(t,s)=>w(t.filter(e=>e.issue===s)))),SR=A(u.createSelector([Xt,(t,s)=>s],(t,s)=>w(t.filter(e=>e.issue_type_identifier===s)))),ow=vn.reducer,De=R(t=>t.uuid),uw={instances:{}},En=u.createSlice({name:"issueTypes",initialState:uw,extraReducers:t=>t.addMatcher(u.isAnyOf(b,M),s=>Object.assign(s,uw)),reducers:{initializeIssueTypes:De.initialize,addIssueType:De.addOne,addIssueTypes:De.addMany,setIssueType:De.setOne,setIssueTypes:De.setMany,updateIssueType:De.updateOne,updateIssueTypes:De.updateMany,deleteIssueType:De.deleteOne,deleteIssueTypes:De.deleteMany}}),{initializeIssueTypes:hw,addIssueType:pw,addIssueTypes:mw,setIssueType:yw,setIssueTypes:fw,updateIssueType:Sw,updateIssueTypes:Aw,deleteIssueType:ww,deleteIssueTypes:Tw}=En.actions,Ow=t=>t.issueTypeReducer.instances,Vn=u.createSelector(Ow,t=>Object.values(t)),Iw=t=>s=>s.issueTypeReducer.instances[t],Fw=A(u.createSelector([Vn,(t,s)=>s],(t,s)=>{const e=new Set(s);return w(t.filter(({uuid:n})=>e.has(n)))})),AR=A(u.createSelector([Vn,(t,s)=>s],(t,s)=>w(t.filter(e=>e.organization===s)))),Pw=En.reducer,$e=R(t=>t.uuid),gw={instances:{}},Wn=u.createSlice({name:"issueTypeStatuses",initialState:gw,extraReducers:t=>t.addMatcher(u.isAnyOf(b,M),s=>Object.assign(s,gw)),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:bw,addIssueTypeStatus:_w,addIssueTypeStatuses:Rw,setIssueTypeStatus:Mw,setIssueTypeStatuses:kw,updateIssueTypeStatus:vw,updateIssueTypeStatuses:Ew,deleteIssueTypeStatus:Vw,deleteIssueTypeStatuses:Ww}=Wn.actions,Bw=t=>t.issueTypeStatusReducer.instances,Bn=u.createSelector([Bw],t=>w(Object.values(t).toSorted(_c))),zn=t=>s=>s.issueTypeStatusReducer.instances[t],zw=A(u.createSelector([Bn,(t,s)=>s],(t,s)=>{const e=new Set(s);return w(t.filter(({uuid:n})=>e.has(n)))})),wR=A(u.createSelector([Bn,(t,s)=>s],(t,s)=>w(t.filter(e=>e.issue_type===s)))),qw=Wn.reducer,Ue=R(t=>t.uuid),Cw={instances:{}},qn=u.createSlice({name:"issueUpdates",initialState:Cw,extraReducers:t=>t.addMatcher(u.isAnyOf(b,z,M),s=>Object.assign(s,Cw)),reducers:{initializeIssueUpdates:Ue.initialize,addIssueUpdate:Ue.addOne,addIssueUpdates:Ue.addMany,setIssueUpdate:Ue.setOne,setIssueUpdates:Ue.setMany,updateIssueUpdate:Ue.updateOne,updateIssueUpdates:Ue.updateMany,deleteIssueUpdate:Ue.deleteOne,deleteIssueUpdates:Ue.deleteMany}}),{initializeIssueUpdates:jw,addIssueUpdate:Cn,addIssueUpdates:jn,setIssueUpdate:Dw,setIssueUpdates:$w,updateIssueUpdate:Uw,updateIssueUpdates:Lw,deleteIssueUpdate:Dn,deleteIssueUpdates:$n}=qn.actions,Un=t=>t.issueUpdateReducer.instances,Ln=u.createSelector([Un],t=>Object.values(t)),Nw=A(u.createSelector([Un,(t,s)=>s],(t,s)=>t[s])),Hw=A(u.createSelector([Ln,(t,s)=>s],(t,s)=>{const e=new Set(s);return w(t.filter(({uuid:n})=>e.has(n)))})),Gw=A(u.createSelector([Ln,(t,s)=>s],(t,s)=>w(t.filter(e=>e.issue===s)))),Kw=qn.reducer,Le=R(t=>t.id),Yw={instances:{},currentUser:null},Nn=u.createSlice({name:"users",initialState:Yw,extraReducers:t=>t.addMatcher(u.isAnyOf(b,M),s=>Object.assign(s,Yw)),reducers:{initializeUsers:Le.initialize,setUsers:Le.setMany,setUser:Le.setOne,addUsers:Le.addMany,addUser:Le.addOne,updateUsers:Le.updateMany,updateUser:Le.updateOne,deleteUser:Le.deleteOne,deleteUsers:Le.deleteMany,setCurrentUser:(t,s)=>{t.currentUser=s.payload},setProfilePicture:(t,s)=>{if(!t.currentUser)return;t.currentUser.profile.file=s.payload.file??null,t.currentUser.profile.file_sha1=s.payload.file_sha1??null;const e=t.instances[t.currentUser.id];if(!e)throw new Error("Unable to find current user in users slice");e.profile.file=s.payload.file??null,e.profile.file_sha1=s.payload.file_sha1??null}}}),{initializeUsers:Zw,setUsers:Jw,setUser:Qw,addUsers:Xw,addUser:Hn,updateUsers:xw,updateUser:eT,deleteUser:Gn,deleteUsers:tT,setCurrentUser:TR,setProfilePicture:OR}=Nn.actions,sT=Nn.reducer,iT=t=>t.userReducer.currentUser,Kn=t=>t.userReducer.instances,xt=u.createSelector([Kn],t=>Object.values(t)),es=t=>s=>s.userReducer.instances[t],nT=A(u.createSelector([xt,(t,s)=>s],(t,s)=>{const e=new Set(s);return w(t.filter(({id:n})=>e.has(n)))})),Ne=R(t=>t.uuid),aT={instances:{}},Yn=u.createSlice({name:"organizationAccess",initialState:aT,extraReducers:t=>t.addMatcher(u.isAnyOf(b,M),s=>Object.assign(s,aT)),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:cT,addOrganizationAccess:rT,addOrganizationAccesses:dT,setOrganizationAccess:lT,setOrganizationAccesses:oT,updateOrganizationAccess:uT,updateOrganizationAccesses:hT,deleteOrganizationAccess:pT,deleteOrganizationAccesses:mT}=Yn.actions,yT=Yn.reducer,ts=t=>t.organizationAccessReducer.instances,fT=t=>s=>s.organizationAccessReducer.instances[t],ST=A(u.createSelector([ts,(t,s)=>s],(t,s)=>{const e=new Set(s);return w(Object.values(t).filter(({uuid:n})=>e.has(n)))})),IR=u.createSelector([iT,ts],(t,s)=>Object.values(s).find(n=>n.user===(t==null?void 0:t.id))??null),AT=u.createSelector([ts],t=>{const s={};for(const e of Object.values(t))s[e.user]=e;return Vt(s)}),FR=A(u.createSelector([Kn,AT,(t,s)=>s],(t,s,e)=>w(Object.values(t).filter(n=>{const a=s[n.id];return!!a&&a.organization===e})))),He=R(t=>t.uuid),wT={instances:{}},Zn=u.createSlice({name:"organizations",initialState:wT,extraReducers:t=>t.addMatcher(u.isAnyOf(b,M),s=>Object.assign(s,wT)),reducers:{initializeOrganizations:He.initialize,setOrganizations:He.setMany,setOrganization:He.setOne,addOrganizations:He.addMany,addOrganization:He.addOne,updateOrganizations:He.updateMany,updateOrganization:He.updateOne,deleteOrganization:He.deleteOne,deleteOrganizations:He.deleteMany}}),{initializeOrganizations:TT,setOrganizations:OT,setOrganization:IT,addOrganizations:FT,addOrganization:PT,updateOrganizations:gT,updateOrganization:bT,deleteOrganization:_T,deleteOrganizations:RT}=Zn.actions,MT=t=>t.organizationReducer.instances,kT=u.createSelector([MT],t=>Object.values(t)),vT=t=>s=>s.organizationReducer.instances[t],ET=A(u.createSelector([kT,(t,s)=>s],(t,s)=>{const e=new Set(s);return w(t.filter(({uuid:n})=>e.has(n)))})),VT=Zn.reducer,WT=(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}}}}},BT={deletedRequests:[],latestRetryTime:0},Jn=u.createSlice({name:"outbox",initialState:BT,extraReducers:t=>t.addCase(b,s=>Object.assign(s,BT)),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 WT(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}}}),PR=t=>t.outboxReducer.deletedRequests,gR=t=>t.outboxReducer.latestRetryTime,{enqueueRequest:zT,markForDeletion:bR,markAsDeleted:qT,_setLatestRetryTime:CT}=Jn.actions,jT=Jn.reducer,Ge=R(t=>t.uuid),DT={instances:{}},Qn=u.createSlice({name:"projectAccess",initialState:DT,extraReducers:t=>t.addMatcher(u.isAnyOf(b,M),s=>Object.assign(s,DT)),reducers:{initializeProjectAccesses:Ge.initialize,addProjectAccess:Ge.addOne,addProjectAccesses:Ge.addMany,setProjectAccess:Ge.setOne,setProjectAccesses:Ge.setMany,updateProjectAccess:Ge.updateOne,updateProjectAccesses:Ge.updateMany,deleteProjectAccess:Ge.deleteOne,deleteProjectAccesses:Ge.deleteMany}}),{initializeProjectAccesses:$T,addProjectAccess:UT,addProjectAccesses:LT,setProjectAccess:NT,setProjectAccesses:HT,updateProjectAccess:GT,updateProjectAccesses:KT,deleteProjectAccess:YT,deleteProjectAccesses:ZT}=Qn.actions,JT=Qn.reducer,Xn=t=>t.projectAccessReducer.instances,Rt=u.createSelector(Xn,t=>Object.values(t)),QT=t=>s=>s.projectAccessReducer.instances[t],XT=A(u.createSelector([Rt,(t,s)=>s],(t,s)=>{const e=new Set(s);return w(t.filter(({uuid:n})=>e.has(n)))})),_R=A(u.createSelector([Xn,(t,s)=>s],(t,s)=>w(Object.values(t).filter(e=>e.project===s)))),RR=A(u.createSelector([Rt,(t,s)=>s],(t,s)=>{const e={};for(const n of t.filter(a=>a.project===s))e[n.user]=n;return e})),MR=A(u.createSelector([xt,Rt,(t,s)=>s],(t,s,e)=>{const n=new Set(s.filter(a=>a.project===e).map(a=>a.user));return w(t.filter(a=>n.has(a.id)))})),Ke=R(t=>t.uuid),xT={instances:{}},xn=u.createSlice({name:"projectAttachments",initialState:xT,extraReducers:t=>t.addMatcher(u.isAnyOf(b,M),s=>Object.assign(s,xT)),reducers:{initializeProjectAttachments:Ke.initialize,addProjectAttachment:Ke.addOne,addProjectAttachments:Ke.addMany,setProjectAttachment:Ke.setOne,setProjectAttachments:Ke.setMany,updateProjectAttachment:Ke.updateOne,updateProjectAttachments:Ke.updateMany,deleteProjectAttachment:Ke.deleteOne,deleteProjectAttachments:Ke.deleteMany}}),{initializeProjectAttachments:eO,addProjectAttachment:tO,addProjectAttachments:sO,setProjectAttachment:iO,setProjectAttachments:nO,updateProjectAttachment:aO,updateProjectAttachments:cO,deleteProjectAttachment:rO,deleteProjectAttachments:dO}=xn.actions,lO=t=>t.projectAttachmentReducer.instances,ea=u.createSelector([lO],t=>Object.values(t)),oO=t=>s=>s.projectAttachmentReducer.instances[t],uO=A(u.createSelector([ea,(t,s)=>s],(t,s)=>{const e=new Set(s);return w(t.filter(({uuid:n})=>e.has(n)))})),kR=A(u.createSelector([ea,(t,s)=>s],(t,s)=>w(t.filter(({project:e})=>s===e)))),hO=xn.reducer,Ye=R(t=>t.uuid),pO={instances:{},activeProjectFileId:null,isImportingProjectFile:!1},ta=u.createSlice({name:"projectFiles",initialState:pO,extraReducers:t=>t.addMatcher(u.isAnyOf(b,z,M),s=>Object.assign(s,pO)),reducers:{initializeProjectFiles:Ye.initialize,setProjectFile:Ye.setOne,setProjectFiles:Ye.setMany,addProjectFile:Ye.addOne,addProjectFiles:Ye.addMany,updateProjectFile:Ye.updateOne,updateProjectFiles:Ye.updateMany,deleteProjectFile:Ye.deleteOne,deleteProjectFiles:Ye.deleteMany,setIsImportingProjectFile:(t,s)=>{t.isImportingProjectFile=s.payload},saveActiveProjectFileBounds:(t,s)=>{const e=t.activeProjectFileId;if(!e)throw new Error("Tried to save bounds for active project file, but no active project file was set.");if(!t.instances[e])throw new Error(`Tried to save bounds for active project file, but project file with ID ${e}
|
|
2
|
+
doesn't exist.`);t.instances[e].bounds=s.payload},setActiveProjectFileId:(t,s)=>{t.activeProjectFileId=s.payload}}}),{initializeProjectFiles:mO,setProjectFile:yO,setProjectFiles:fO,addProjectFile:SO,addProjectFiles:AO,updateProjectFile:wO,updateProjectFiles:TO,deleteProjectFile:OO,deleteProjectFiles:IO,setIsImportingProjectFile:FO,setActiveProjectFileId:PO,saveActiveProjectFileBounds:gO}=ta.actions,bO=t=>t.projectFileReducer.instances,_O=u.createSelector([bO],t=>w(Object.values(t).sort((s,e)=>s.z_index-e.z_index))),RO=t=>s=>s.projectFileReducer.instances[t],MO=A(u.createSelector([_O,(t,s)=>s],(t,s)=>{const e=new Set(s);return w(t.filter(({uuid:n})=>e.has(n)))})),vR=t=>t.projectFileReducer.activeProjectFileId,ER=t=>t.projectFileReducer.isImportingProjectFile,kO=ta.reducer,Ze=R(t=>t.uuid),vO={instances:{}},sa=u.createSlice({name:"projects",initialState:vO,extraReducers:t=>t.addMatcher(u.isAnyOf(b,M),s=>Object.assign(s,vO)),reducers:{initializeProjects:Ze.initialize,setProjects:Ze.setMany,setProject:Ze.setOne,addProjects:Ze.addMany,addProject:Ze.addOne,updateProjects:Ze.updateMany,updateProject:Ze.updateOne,deleteProject:Ze.deleteOne,deleteProjects:Ze.deleteMany}}),{initializeProjects:EO,setProjects:VO,setProject:WO,addProjects:BO,addProject:zO,updateProjects:qO,updateProject:CO,deleteProject:jO,deleteProjects:DO}=sa.actions,$O=sa.reducer,UO=t=>t.projectReducer.instances,ss=u.createSelector([UO],t=>Object.values(t)),LO=t=>s=>s.projectReducer.instances[t],NO=A(u.createSelector([ss,(t,s)=>s],(t,s)=>{const e=new Set(s);return w(t.filter(({uuid:n})=>e.has(n)))})),VR=A(u.createSelector([ss,Rt,(t,s)=>s],(t,s,e)=>{const n=new Set(s.filter(a=>a.user===e).map(a=>a.project));return w(t.filter(a=>n.has(a.uuid)))})),WR=A(u.createSelector([ss,(t,s)=>s],(t,s)=>w(t.filter(e=>e.organization===s)))),BR={isRehydrated:!1},ia=u.createSlice({name:"rehydrated",initialState:BR,reducers:{setRehydrated:(t,s)=>{t.isRehydrated=s.payload}}}),{setRehydrated:zR}=ia.actions,qR=t=>t.rehydratedReducer.isRehydrated,HO=ia.reducer,Je=R(t=>t.uuid),GO={instances:{}},na=u.createSlice({name:"teamMemberships",initialState:GO,extraReducers:t=>t.addMatcher(u.isAnyOf(b,M),s=>Object.assign(s,GO)),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:KO,addTeamMembership:YO,addTeamMemberships:ZO,setTeamMembership:JO,setTeamMemberships:QO,updateTeamMembership:XO,updateTeamMemberships:xO,deleteTeamMembership:eI,deleteTeamMemberships:tI}=na.actions,sI=na.reducer,iI=t=>t.teamMembershipReducer.instances,is=u.createSelector([iI],t=>Object.values(t)),nI=t=>s=>s.teamMembershipReducer.instances[t],aI=A(u.createSelector([is,(t,s)=>s],(t,s)=>{const e=new Set(s);return w(t.filter(({uuid:n})=>e.has(n)))})),CR=A(u.createSelector([is,(t,s)=>s],(t,s)=>{const e={};for(const n of t.filter(a=>a.team===s))e[n.user]=n;return e})),jR=A(u.createSelector([xt,is,(t,s)=>s],(t,s,e)=>{const n=new Set(s.filter(a=>a.team===e).map(a=>a.user));return w(t.filter(a=>n.has(a.id)))})),Qe=R(t=>t.uuid),cI={instances:{}},aa=u.createSlice({name:"teams",initialState:cI,extraReducers:t=>t.addMatcher(u.isAnyOf(b,M),s=>Object.assign(s,cI)),reducers:{initializeTeams:Qe.initialize,addTeam:Qe.addOne,addTeams:Qe.addMany,setTeam:Qe.setOne,setTeams:Qe.setMany,updateTeam:Qe.updateOne,updateTeams:Qe.updateMany,deleteTeam:Qe.deleteOne,deleteTeams:Qe.deleteMany}}),{initializeTeams:rI,addTeam:dI,addTeams:lI,setTeam:oI,setTeams:uI,updateTeam:hI,updateTeams:pI,deleteTeam:mI,deleteTeams:yI}=aa.actions,fI=t=>t.teamReducer.instances,ca=u.createSelector([fI],t=>Object.values(t)),SI=t=>s=>s.teamReducer.instances[t],AI=A(u.createSelector([ca,(t,s)=>s],(t,s)=>{const e=new Set(s);return w(t.filter(({uuid:n})=>e.has(n)))})),DR=A(u.createSelector([ca,(t,s)=>s],(t,s)=>w(t.filter(e=>e.organization===s)))),wI=aa.reducer,Xe=R(t=>t.uuid),TI={instances:{}},ra=u.createSlice({name:"workflows",initialState:TI,extraReducers:t=>t.addMatcher(u.isAnyOf(b,z,M),s=>Object.assign(s,TI)),reducers:{initializeWorkflows:Xe.initialize,addWorkflow:Xe.addOne,addWorkflows:Xe.addMany,setWorkflow:Xe.setOne,setWorkflows:Xe.setMany,updateWorkflow:Xe.updateOne,updateWorkflows:Xe.updateMany,deleteWorkflow:Xe.deleteOne,deleteWorkflows:Xe.deleteMany}}),{initializeWorkflows:OI,addWorkflow:II,addWorkflows:da,setWorkflow:FI,setWorkflows:PI,updateWorkflow:gI,updateWorkflows:bI,deleteWorkflow:_I,deleteWorkflows:la}=ra.actions,RI=t=>t.workflowReducer.instances,ns=u.createSelector([RI],t=>Object.values(t)),MI=t=>s=>s.workflowReducer.instances[t],kI=A(u.createSelector([ns,(t,s)=>s],(t,s)=>{const e=new Set(s);return w(t.filter(({uuid:n})=>e.has(n)))})),$R=A(u.createSelector([ns,(t,s)=>s],(t,s)=>w(t.filter(e=>e.project===s)))),vI=A(u.createSelector([ns,(t,s)=>s],(t,s)=>w(t.filter(e=>e.workflow_type===s)))),EI=ra.reducer,xe=R(t=>t.uuid),VI={instances:{}},oa=u.createSlice({name:"workflowStepAssignees",initialState:VI,extraReducers:t=>t.addMatcher(u.isAnyOf(b,z,M),s=>Object.assign(s,VI)),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:WI,addWorkflowStepAssignee:BI,addWorkflowStepAssignees:ua,setWorkflowStepAssignee:zI,setWorkflowStepAssignees:qI,updateWorkflowStepAssignee:CI,updateWorkflowStepAssignees:jI,deleteWorkflowStepAssignee:DI,deleteWorkflowStepAssignees:ha}=oa.actions,$I=t=>t.workflowStepAssigneeReducer.instances,Mt=u.createSelector([$I],t=>Object.values(t)),UI=t=>s=>s.workflowStepAssigneeReducer.instances[t],LI=A(u.createSelector([Mt,(t,s)=>s],(t,s)=>{const e=new Set(s);return w(t.filter(({uuid:n})=>e.has(n)))})),NI=A(u.createSelector([Mt,(t,s)=>s],(t,s)=>w(t.filter(e=>e.workflow===s)))),UR=A(u.createSelector([Mt,(t,s)=>s],(t,s)=>w(t.filter(e=>e.workflow_step===s)))),LR=A(u.createSelector([Mt,(t,s)=>s],(t,s)=>w(t.filter(e=>e.user===s)))),HI=oa.reducer,et=R(t=>t.uuid),GI={instances:{}},pa=u.createSlice({name:"workflowStepCommentAttachments",initialState:GI,extraReducers:t=>t.addMatcher(u.isAnyOf(b,z,M),s=>Object.assign(s,GI)),reducers:{initializeWorkflowStepCommentAttachments:et.initialize,addWorkflowStepCommentAttachment:et.addOne,addWorkflowStepCommentAttachments:et.addMany,setWorkflowStepCommentAttachment:et.setOne,setWorkflowStepCommentAttachments:et.setMany,updateWorkflowStepCommentAttachment:et.updateOne,updateWorkflowStepCommentAttachments:et.updateMany,deleteWorkflowStepCommentAttachment:et.deleteOne,deleteWorkflowStepCommentAttachments:et.deleteMany}}),{initializeWorkflowStepCommentAttachments:KI,addWorkflowStepCommentAttachment:YI,addWorkflowStepCommentAttachments:as,setWorkflowStepCommentAttachment:ZI,setWorkflowStepCommentAttachments:JI,updateWorkflowStepCommentAttachment:QI,updateWorkflowStepCommentAttachments:XI,deleteWorkflowStepCommentAttachment:xI,deleteWorkflowStepCommentAttachments:cs}=pa.actions,eF=t=>t.workflowStepCommentAttachmentReducer.instances,ma=u.createSelector([eF],t=>Object.values(t)),tF=t=>s=>s.workflowStepCommentAttachmentReducer.instances[t],sF=A(u.createSelector([ma,(t,s)=>s],(t,s)=>{const e=new Set(s);return w(t.filter(({uuid:n})=>e.has(n)))})),ya=A(u.createSelector([ma,(t,s)=>s],(t,s)=>w(t.filter(e=>e.workflow_step_comment===s)))),iF=pa.reducer,tt=R(t=>t.uuid),nF={instances:{}},fa=u.createSlice({name:"workflowStepComments",initialState:nF,extraReducers:t=>t.addMatcher(u.isAnyOf(b,z,M),s=>Object.assign(s,nF)),reducers:{initializeWorkflowStepComments:tt.initialize,addWorkflowStepComment:tt.addOne,addWorkflowStepComments:tt.addMany,setWorkflowStepComment:tt.setOne,setWorkflowStepComments:tt.setMany,updateWorkflowStepComment:tt.updateOne,updateWorkflowStepComments:tt.updateMany,deleteWorkflowStepComment:tt.deleteOne,deleteWorkflowStepComments:tt.deleteMany}}),{initializeWorkflowStepComments:aF,addWorkflowStepComment:cF,addWorkflowStepComments:Sa,setWorkflowStepComment:rF,setWorkflowStepComments:dF,updateWorkflowStepComment:lF,updateWorkflowStepComments:oF,deleteWorkflowStepComment:uF,deleteWorkflowStepComments:Aa}=fa.actions,hF=t=>t.workflowStepCommentReducer.instances,rs=u.createSelector([hF],t=>Object.values(t)),pF=t=>s=>s.workflowStepCommentReducer.instances[t],mF=A(u.createSelector([rs,(t,s)=>s],(t,s)=>{const e=new Set(s);return w(t.filter(({uuid:n})=>e.has(n)))})),yF=A(u.createSelector([rs,(t,s)=>s],(t,s)=>w(t.filter(e=>e.workflow===s)))),NR=A(u.createSelector([rs,(t,s)=>s],(t,s)=>w(t.filter(e=>e.workflow_step===s)))),fF=fa.reducer,st=R(t=>t.uuid),SF={instances:{}},wa=u.createSlice({name:"workflowStepCompletions",initialState:SF,extraReducers:t=>t.addMatcher(u.isAnyOf(b,z,M),s=>Object.assign(s,SF)),reducers:{initializeWorkflowStepCompletions:st.initialize,addWorkflowStepCompletion:st.addOne,addWorkflowStepCompletions:st.addMany,setWorkflowStepCompletion:st.setOne,setWorkflowStepCompletions:st.setMany,updateWorkflowStepCompletion:st.updateOne,updateWorkflowStepCompletions:st.updateMany,deleteWorkflowStepCompletion:st.deleteOne,deleteWorkflowStepCompletions:st.deleteMany}}),{initializeWorkflowStepCompletions:AF,addWorkflowStepCompletion:wF,addWorkflowStepCompletions:Ta,setWorkflowStepCompletion:TF,setWorkflowStepCompletions:OF,updateWorkflowStepCompletion:IF,updateWorkflowStepCompletions:FF,deleteWorkflowStepCompletion:PF,deleteWorkflowStepCompletions:Oa}=wa.actions,gF=t=>t.workflowStepCompletionReducer.instances,ds=u.createSelector([gF],t=>Object.values(t)),bF=t=>s=>s.workflowStepCompletionReducer.instances[t],_F=A(u.createSelector([ds,(t,s)=>s],(t,s)=>{const e=new Set(s);return w(t.filter(({uuid:n})=>e.has(n)))})),RF=A(u.createSelector([ds,(t,s)=>s],(t,s)=>w(t.filter(e=>e.workflow===s)))),HR=A(u.createSelector([ds,(t,s)=>s],(t,s)=>w(t.filter(e=>e.workflow_step===s)))),MF=wa.reducer,it=R(t=>t.uuid),kF={instances:{}},Ia=u.createSlice({name:"workflowStepEvents",initialState:kF,extraReducers:t=>t.addMatcher(u.isAnyOf(b,z,M),s=>Object.assign(s,kF)),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:vF,addWorkflowStepEvent:EF,addWorkflowStepEvents:Fa,setWorkflowStepEvent:VF,setWorkflowStepEvents:WF,updateWorkflowStepEvent:BF,updateWorkflowStepEvents:zF,deleteWorkflowStepEvent:qF,deleteWorkflowStepEvents:Pa}=Ia.actions,ga=t=>t.workflowStepEventReducer.instances,ls=u.createSelector([ga],t=>Object.values(t)),CF=A(u.createSelector([ga,(t,s)=>s],(t,s)=>t[s])),jF=A(u.createSelector([ls,(t,s)=>s],(t,s)=>{const e=new Set(s);return w(t.filter(({uuid:n})=>e.has(n)))})),DF=A(u.createSelector([ls,(t,s)=>s],(t,s)=>w(t.filter(e=>e.workflow===s)))),GR=A(u.createSelector([ls,(t,s)=>s],(t,s)=>w(t.filter(e=>e.workflow_step===s)))),$F=Ia.reducer,nt=R(t=>t.uuid),UF={instances:{}},ba=u.createSlice({name:"workflowStepFieldValuesAttachments",initialState:UF,extraReducers:t=>t.addMatcher(u.isAnyOf(b,z,M),s=>Object.assign(s,UF)),reducers:{initializeWorkflowStepFieldValuesAttachments:nt.initialize,addWorkflowStepFieldValuesAttachment:nt.addOne,addWorkflowStepFieldValuesAttachments:nt.addMany,setWorkflowStepFieldValuesAttachment:nt.setOne,setWorkflowStepFieldValuesAttachments:nt.setMany,updateWorkflowStepFieldValuesAttachment:nt.updateOne,updateWorkflowStepFieldValuesAttachments:nt.updateMany,deleteWorkflowStepFieldValuesAttachment:nt.deleteOne,deleteWorkflowStepFieldValuesAttachments:nt.deleteMany}}),{initializeWorkflowStepFieldValuesAttachments:LF,addWorkflowStepFieldValuesAttachment:NF,addWorkflowStepFieldValuesAttachments:_a,setWorkflowStepFieldValuesAttachment:HF,setWorkflowStepFieldValuesAttachments:GF,updateWorkflowStepFieldValuesAttachment:KF,updateWorkflowStepFieldValuesAttachments:YF,deleteWorkflowStepFieldValuesAttachment:ZF,deleteWorkflowStepFieldValuesAttachments:Ra}=ba.actions,JF=t=>t.workflowStepFieldValuesAttachmentReducer.instances,Ma=u.createSelector([JF],t=>Object.values(t)),QF=t=>s=>s.workflowStepFieldValuesAttachmentReducer.instances[t],XF=A(u.createSelector([Ma,(t,s)=>s],(t,s)=>{const e=new Set(s);return w(t.filter(({uuid:n})=>e.has(n)))})),xF=A(u.createSelector([Ma,(t,s)=>s],(t,s)=>w(t.filter(e=>e.field_values===s)))),eP=ba.reducer,at=R(t=>t.uuid),tP={instances:{}},ka=u.createSlice({name:"workflowStepFieldValues",initialState:tP,extraReducers:t=>t.addMatcher(u.isAnyOf(b,z,M),s=>Object.assign(s,tP)),reducers:{initializeWorkflowStepFieldValues:at.initialize,addWorkflowStepFieldValues:at.addOne,addWorkflowStepFieldValuesMany:at.addMany,setWorkflowStepFieldValues:at.setOne,setWorkflowStepFieldValuesMany:at.setMany,updateWorkflowStepFieldValues:at.updateOne,updateWorkflowStepFieldValuesMany:at.updateMany,deleteWorkflowStepFieldValues:at.deleteOne,deleteWorkflowStepFieldValuesMany:at.deleteMany}}),{initializeWorkflowStepFieldValues:sP,addWorkflowStepFieldValues:iP,addWorkflowStepFieldValuesMany:va,setWorkflowStepFieldValues:nP,setWorkflowStepFieldValuesMany:aP,updateWorkflowStepFieldValues:cP,updateWorkflowStepFieldValuesMany:rP,deleteWorkflowStepFieldValues:dP,deleteWorkflowStepFieldValuesMany:Ea}=ka.actions,lP=t=>t.workflowStepFieldValuesReducer.instances,kt=u.createSelector([lP],t=>Object.values(t)),oP=A(u.createSelector([kt,(t,s)=>s],(t,s)=>w(t.filter(e=>e.workflow===s)))),KR=A(u.createSelector([kt,(t,s)=>s],(t,s)=>w(t.filter(e=>e.workflow_step===s)))),YR=A(u.createSelector([kt,(t,s)=>s],(t,s)=>w(t.filter(e=>e.fields_revision===s)))),uP=t=>s=>s.workflowStepFieldValuesReducer.instances[t],hP=A(u.createSelector([kt,(t,s)=>s],(t,s)=>{const e=new Set(s);return w(t.filter(({uuid:n})=>e.has(n)))})),pP=ka.reducer,ct=R(t=>t.uuid),mP={instances:{}},Va=u.createSlice({name:"workflowStepFieldsAttachments",initialState:mP,extraReducers:t=>t.addMatcher(u.isAnyOf(b,M),s=>Object.assign(s,mP)),reducers:{initializeWorkflowStepFieldsAttachments:ct.initialize,addWorkflowStepFieldsAttachment:ct.addOne,addWorkflowStepFieldsAttachments:ct.addMany,setWorkflowStepFieldsAttachment:ct.setOne,setWorkflowStepFieldsAttachments:ct.setMany,updateWorkflowStepFieldsAttachment:ct.updateOne,updateWorkflowStepFieldsAttachments:ct.updateMany,deleteWorkflowStepFieldsAttachment:ct.deleteOne,deleteWorkflowStepFieldsAttachments:ct.deleteMany}}),{initializeWorkflowStepFieldsAttachments:yP,addWorkflowStepFieldsAttachment:fP,addWorkflowStepFieldsAttachments:Wa,setWorkflowStepFieldsAttachment:SP,setWorkflowStepFieldsAttachments:AP,updateWorkflowStepFieldsAttachment:wP,updateWorkflowStepFieldsAttachments:TP,deleteWorkflowStepFieldsAttachment:OP,deleteWorkflowStepFieldsAttachments:Ba}=Va.actions,IP=t=>t.workflowStepFieldsAttachmentReducer.instances,za=u.createSelector([IP],t=>Object.values(t)),FP=A(u.createSelector([za,(t,s)=>s],(t,s)=>w(t.filter(e=>e.fields_revision===s)))),PP=t=>s=>s.workflowStepFieldsAttachmentReducer.instances[t],gP=A(u.createSelector([za,(t,s)=>s],(t,s)=>{const e=new Set(s);return w(t.filter(({uuid:n})=>e.has(n)))})),bP=Va.reducer,rt=R(t=>t.uuid),_P={instances:{}},qa=u.createSlice({name:"workflowStepFields",initialState:_P,extraReducers:t=>t.addMatcher(u.isAnyOf(b,M),s=>Object.assign(s,_P)),reducers:{initializeWorkflowStepFields:rt.initialize,addWorkflowStepFields:rt.addOne,addWorkflowStepFieldsMany:rt.addMany,setWorkflowStepFields:rt.setOne,setWorkflowStepFieldsMany:rt.setMany,updateWorkflowStepFields:rt.updateOne,updateWorkflowStepFieldsMany:rt.updateMany,deleteWorkflowStepFields:rt.deleteOne,deleteWorkflowStepFieldsMany:rt.deleteMany}}),{initializeWorkflowStepFields:RP,addWorkflowStepFields:MP,addWorkflowStepFieldsMany:kP,setWorkflowStepFields:vP,setWorkflowStepFieldsMany:EP,updateWorkflowStepFields:VP,updateWorkflowStepFieldsMany:WP,deleteWorkflowStepFields:BP,deleteWorkflowStepFieldsMany:zP}=qa.actions,Ca=t=>t.workflowStepFieldsReducer.instances,os=u.createSelector([Ca],t=>Object.values(t)),ZR=A(u.createSelector([os,(t,s)=>s],(t,s)=>w(t.filter(e=>e.workflow_step===s)))),JR=A(u.createSelector([os,(t,s)=>s],(t,s)=>t.filter(e=>e.workflow_step===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),QR=u.createSelector([Ca],t=>{const s={};for(const e of Object.values(t)){const n=s[e.workflow_step];(!n||n.submitted_at<e.submitted_at)&&(s[e.workflow_step]=e)}return s}),qP=t=>s=>s.workflowStepFieldsReducer.instances[t],CP=A(u.createSelector([os,(t,s)=>s],(t,s)=>{const e=new Set(s);return w(t.filter(({uuid:n})=>e.has(n)))})),jP=qa.reducer,dt=R(t=>t.uuid),DP={instances:{}},ja=u.createSlice({name:"workflowStepReviewers",initialState:DP,extraReducers:t=>t.addMatcher(u.isAnyOf(b,z,M),s=>Object.assign(s,DP)),reducers:{initializeWorkflowStepReviewers:dt.initialize,addWorkflowStepReviewer:dt.addOne,addWorkflowStepReviewers:dt.addMany,setWorkflowStepReviewer:dt.setOne,setWorkflowStepReviewers:dt.setMany,updateWorkflowStepReviewer:dt.updateOne,updateWorkflowStepReviewers:dt.updateMany,deleteWorkflowStepReviewer:dt.deleteOne,deleteWorkflowStepReviewers:dt.deleteMany}}),{initializeWorkflowStepReviewers:$P,addWorkflowStepReviewer:UP,addWorkflowStepReviewers:Da,setWorkflowStepReviewer:LP,setWorkflowStepReviewers:NP,updateWorkflowStepReviewer:HP,updateWorkflowStepReviewers:GP,deleteWorkflowStepReviewer:KP,deleteWorkflowStepReviewers:$a}=ja.actions,YP=t=>t.workflowStepReviewerReducer.instances,vt=u.createSelector([YP],t=>Object.values(t)),ZP=t=>s=>s.workflowStepReviewerReducer.instances[t],JP=A(u.createSelector([vt,(t,s)=>s],(t,s)=>{const e=new Set(s);return w(t.filter(({uuid:n})=>e.has(n)))})),QP=A(u.createSelector([vt,(t,s)=>s],(t,s)=>w(t.filter(e=>e.workflow===s)))),XR=A(u.createSelector([vt,(t,s)=>s],(t,s)=>w(t.filter(e=>e.workflow_step===s)))),xR=A(u.createSelector([vt,(t,s)=>s],(t,s)=>w(t.filter(e=>e.user===s)))),XP=ja.reducer,lt=R(t=>t.uuid),xP={instances:{}},Ua=u.createSlice({name:"workflowStepReviewRequests",initialState:xP,extraReducers:t=>t.addMatcher(u.isAnyOf(b,z,M),s=>Object.assign(s,xP)),reducers:{initializeWorkflowStepReviewRequests:lt.initialize,addWorkflowStepReviewRequest:lt.addOne,addWorkflowStepReviewRequests:lt.addMany,setWorkflowStepReviewRequest:lt.setOne,setWorkflowStepReviewRequests:lt.setMany,updateWorkflowStepReviewRequest:lt.updateOne,updateWorkflowStepReviewRequests:lt.updateMany,deleteWorkflowStepReviewRequest:lt.deleteOne,deleteWorkflowStepReviewRequests:lt.deleteMany}}),{initializeWorkflowStepReviewRequests:eg,addWorkflowStepReviewRequest:tg,addWorkflowStepReviewRequests:La,setWorkflowStepReviewRequest:sg,setWorkflowStepReviewRequests:ig,updateWorkflowStepReviewRequest:ng,updateWorkflowStepReviewRequests:ag,deleteWorkflowStepReviewRequest:cg,deleteWorkflowStepReviewRequests:Na}=Ua.actions,rg=t=>t.workflowStepReviewRequestReducer.instances,us=u.createSelector([rg],t=>Object.values(t)),dg=t=>s=>s.workflowStepReviewRequestReducer.instances[t],lg=A(u.createSelector([us,(t,s)=>s],(t,s)=>{const e=new Set(s);return w(t.filter(({uuid:n})=>e.has(n)))})),og=A(u.createSelector([us,(t,s)=>s],(t,s)=>w(t.filter(e=>e.workflow===s)))),eM=A(u.createSelector([us,(t,s)=>s],(t,s)=>w(t.filter(e=>e.workflow_step===s)))),ug=Ua.reducer,ot=R(t=>t.uuid),hg={instances:{}},Ha=u.createSlice({name:"workflowStepReviews",initialState:hg,extraReducers:t=>t.addMatcher(u.isAnyOf(b,z,M),s=>Object.assign(s,hg)),reducers:{initializeWorkflowStepReviews:ot.initialize,addWorkflowStepReview:ot.addOne,addWorkflowStepReviews:ot.addMany,setWorkflowStepReview:ot.setOne,setWorkflowStepReviews:ot.setMany,updateWorkflowStepReview:ot.updateOne,updateWorkflowStepReviews:ot.updateMany,deleteWorkflowStepReview:ot.deleteOne,deleteWorkflowStepReviews:ot.deleteMany}}),{initializeWorkflowStepReviews:pg,addWorkflowStepReview:mg,addWorkflowStepReviews:Ga,setWorkflowStepReview:yg,setWorkflowStepReviews:fg,updateWorkflowStepReview:Sg,updateWorkflowStepReviews:Ag,deleteWorkflowStepReview:wg,deleteWorkflowStepReviews:Ka}=Ha.actions,Tg=t=>t.workflowStepReviewReducer.instances,hs=u.createSelector([Tg],t=>Object.values(t)),Og=t=>s=>s.workflowStepReviewReducer.instances[t],Ig=A(u.createSelector([hs,(t,s)=>s],(t,s)=>{const e=new Set(s);return w(t.filter(({uuid:n})=>e.has(n)))})),Fg=A(u.createSelector([hs,(t,s)=>s],(t,s)=>w(t.filter(e=>e.workflow===s)))),tM=A(u.createSelector([hs,(t,s)=>s],(t,s)=>w(t.filter(e=>e.workflow_step===s)))),Pg=Ha.reducer,ut=R(t=>t.uuid),gg={instances:{}},Ya=u.createSlice({name:"workflowSteps",initialState:gg,extraReducers:t=>t.addMatcher(u.isAnyOf(b,M),s=>Object.assign(s,gg)),reducers:{initializeWorkflowSteps:ut.initialize,addWorkflowStep:ut.addOne,addWorkflowSteps:ut.addMany,setWorkflowStep:ut.setOne,setWorkflowSteps:ut.setMany,updateWorkflowStep:ut.updateOne,updateWorkflowSteps:ut.updateMany,deleteWorkflowStep:ut.deleteOne,deleteWorkflowSteps:ut.deleteMany}}),{initializeWorkflowSteps:bg,addWorkflowStep:_g,addWorkflowSteps:Za,setWorkflowStep:Rg,setWorkflowSteps:Mg,updateWorkflowStep:kg,updateWorkflowSteps:vg,deleteWorkflowStep:Eg,deleteWorkflowSteps:Ja}=Ya.actions,Vg=Ya.reducer,Wg=t=>t.workflowStepReducer.instances,Qa=u.createSelector([Wg],t=>Object.values(t)),Bg=t=>s=>s.workflowStepReducer.instances[t],zg=A(u.createSelector([Qa,(t,s)=>s],(t,s)=>w(t.filter(e=>e.workflow_type===s)))),qg=A(u.createSelector([Qa,(t,s)=>s],(t,s)=>{const e=new Set(s);return w(t.filter(({uuid:n})=>e.has(n)))})),ht=R(t=>t.uuid),Cg={instances:{}},Xa=u.createSlice({name:"workflowTypes",initialState:Cg,extraReducers:t=>t.addMatcher(u.isAnyOf(b,M),s=>Object.assign(s,Cg)),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:jg,addWorkflowType:Dg,addWorkflowTypes:$g,setWorkflowType:Ug,setWorkflowTypes:Lg,updateWorkflowType:Ng,updateWorkflowTypes:Hg,deleteWorkflowType:Gg,deleteWorkflowTypes:Kg}=Xa.actions,Yg=t=>t.workflowTypeReducer.instances,xa=u.createSelector([Yg],t=>Object.values(t)),Zg=t=>s=>s.workflowTypeReducer.instances[t],Jg=A(u.createSelector([xa,(t,s)=>s],(t,s)=>{const e=new Set(s);return w(t.filter(({uuid:n})=>e.has(n)))})),sM=A(u.createSelector([xa,(t,s)=>s],(t,s)=>w(t.filter(e=>e.organization===s)))),Qg=Xa.reducer,iM={version:0},Xg=u.createSlice({name:"versioning",initialState:iM,reducers:{}}),xg=Xg.reducer,ec={outboxReducer:jT,fileReducer:lm,authReducer:ip},nM=u.combineReducers(ec),eb={...ec,[Ft]:xg,categoryReducer:fp,assetReducer:oo,assetAttachmentReducer:Yc,assetStageCompletionReducer:Oo,assetStageReducer:zo,assetTypeReducer:Dh,assetTypeAttachmentReducer:Qo,issueReducer:OS,issueAttachmentReducer:Bf,issueTypeReducer:Pw,issueTypeAttachmentReducer:BS,organizationReducer:VT,projectReducer:$O,projectAttachmentReducer:hO,projectAccessReducer:JT,organizationAccessReducer:yT,projectFileReducer:kO,rehydratedReducer:HO,formReducer:Ay,formRevisionReducer:ry,formRevisionAttachmentReducer:Qm,formSubmissionAttachmentReducer:Vy,formSubmissionReducer:Gy,formIdentifierReducer:Fm,formIdentifierValueReducer:qm,userReducer:sT,emailDomainsReducer:nm,documentsReducer:$p,documentAttachmentReducer:kp,teamReducer:wI,agentsReducer:Bc,issueCommentReducer:dS,issueCommentAttachmentReducer:Zf,issueUpdateReducer:Kw,geoImageReducer:rf,issueAssociationReducer:If,issueTypeFieldsReducer:FA,issueTypeFieldValuesReducer:lA,issueTypeFieldsAttachmentReducer:ZS,issueTypeFieldValuesAttachmentReducer:zA,issueTypeIdentifierReducer:JA,issueTypeIdentifierValueReducer:ow,issueTypeStatusReducer:qw,assetTypeFieldsReducer:gu,assetTypeFieldValuesReducer:Xu,assetTypeFieldsAttachmentReducer:uu,assetTypeFieldValuesAttachmentReducer:Cu,assetTypeIdentifierReducer:hh,assetTypeIdentifierValueReducer:bh,assetTypeStatusReducer:ep,assetProcedureTypeReducer:Vd,assetProcedureReducer:Ad,assetProcedureTypeFieldsReducer:Vr,assetProcedureTypeFieldValuesReducer:cd,assetProcedureTypeFieldsAttachmentReducer:wr,assetProcedureTypeFieldValuesAttachmentReducer:Hr,assetProcedureTypeAttachmentReducer:ar,assetProcedureStepFieldsAttachmentReducer:Jd,assetProcedureStepFieldsReducer:ll,assetProcedureStepFieldValuesAttachmentReducer:Il,assetProcedureStepFieldValuesReducer:zl,assetProcedureStepReducer:Kl,teamMembershipReducer:sI,workflowTypeReducer:Qg,workflowStepReducer:Vg,workflowReducer:EI,workflowStepFieldsReducer:jP,workflowStepFieldsAttachmentReducer:bP,workflowStepFieldValuesReducer:pP,workflowStepFieldValuesAttachmentReducer:eP,workflowStepAssigneeReducer:HI,workflowStepReviewRequestReducer:ug,workflowStepReviewReducer:Pg,workflowStepCompletionReducer:MF,workflowStepCommentReducer:fF,workflowStepCommentAttachmentReducer:iF,workflowStepReviewerReducer:XP,workflowStepEventReducer:$F},aM=u.combineReducers(eb),tb=1e4,sb=200,tc=[400,409,403,404,405,500],U=1e4,ib={};class nb{constructor(s){m(this,"client");m(this,"pageSize",tb);ib[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 ab=()=>db.length-1,cb=t=>(t[Ft]={version:ab()},t),rb=()=>cb({}),cM=t=>(t.outboxReducer&&(t.outboxReducer.deletedRequests=[]),t),rM=t=>s=>{var e;return s===void 0&&(s={}),((e=s[Ft])==null?void 0:e.version)===ab()?s:t(s)},db=[cb,rb,rb,cM],dM=Object.fromEntries(db.map((t,s)=>[s,rM(t)])),lM=t=>{if(t)throw t;const s=It();s?s.dispatch({type:"rehydrated/setRehydrated",payload:!0}):console.error("Client store not set")},lb=(t,s,e)=>{const n=ft();return n?(n.addRequest(s),n.getQueue()):(console.warn("Outbox coordinator not set; cannot enqueue request yet."),[])},ob=(t,s,e)=>{const n=ft();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 oM(t,s){if(!s.payload)throw new Error("Received empty payload");return Fb(s)}const uM={...lc,effect:oM,discard:hb,returnPromises:!0,persistCallback:lM,retry:yM,persistOptions:{storage:kb},queue:{...lc.queue,enqueue:lb,dequeue:ob,peek:(...t)=>mM(...t)}},hM=vb(dM,Ft),pM=u.compose(Mb.offline(uM),hM);async function ub(t,s,e){if(s.store.getState().outboxReducer.deletedRequests.includes(t.payload.uuid))throw new Error("Request was marked for deletion");const a=ib[t.meta.offline.effect.serviceName];if(!a)throw new Error(`Service ${t.meta.offline.effect.serviceName} not found`);return ac(t.meta.offline.effect.BASE_URL,t.meta.offline.effect.request,s,a,e)}function hb(t,s,e=0){var r;if(console.debug("Considering discarding request due to error:",t,`(${typeof t})`,`
|
|
3
3
|
Url:`,s.payload.url,`
|
|
4
|
-
Retries:`,e),!(t instanceof Error))throw console.error("ENCOUNTERED NON-ERROR ERROR:",t,"(throwing immediately, which may lead to unexpected behavior)"),t;const n=
|
|
5
|
-
Action:`,s);const y=
|
|
4
|
+
Retries:`,e),!(t instanceof Error))throw console.error("ENCOUNTERED NON-ERROR ERROR:",t,"(throwing immediately, which may lead to unexpected behavior)"),t;const n=It(),c=n.getState().outboxReducer.deletedRequests,d=s.payload.uuid;function o(){n.dispatch(qT(d));const h=ft();if(!h)throw new Error("Outbox coordinator not set");h.remove(s.payload.uuid);const y=s.meta.offline.rollback;throw y&&(console.warn("Rolling back request due to SDK error:",s),n.dispatch(y)),t}if(t instanceof D&&t.options.discard&&(console.debug("Discarding request due to explicit discard:",s.payload.url),o()),c.includes(d)&&(console.debug("Discarding request due to deletion:",s.payload.url),o()),t instanceof D){const h=t.status||((r=t.response)==null?void 0:r.status);if(h||console.warn("Error has no status code:",t),h!==void 0&&tc.includes(h)){console.warn("Discarding request due to error:",t,`
|
|
5
|
+
Action:`,s);const y=ft();if(!y)throw new Error("Outbox coordinator not set");y.remove(s.payload.uuid),t.options.discard=!0,o()}}console.debug("Registering a retry for request:",s.payload.uuid);const l=ft();if(!l)throw new Error("Outbox coordinator not set");return l.registerRetry(s.payload.uuid),!1}function mM(t,s,e){var n;return(n=ft())==null?void 0:n.peek()}function yM(t,s){return It().dispatch(CT(new Date().getTime())),Ac}const wt="An unknown error occurred",fM=500,pb=["non_field_errors","detail"];function SM(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"?pb.includes(a)?c:`${a}: ${c}`:Array.isArray(c)?pb.includes(a)?c.join(`
|
|
6
6
|
`):c.map(d=>`${a}: ${d}`).join(`
|
|
7
7
|
`):`${a}: ${JSON.stringify(c)}`).join(`
|
|
8
|
-
`)}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>kM?At:e}class $ extends Error{constructor(e){super(At);p(this,"status");p(this,"response");p(this,"message");p(this,"options");const{response:n,innerError:a}=e;this.message=e.message??vM(n,a)??At,this.status=(n==null?void 0:n.status)??0,this.response=n,e.discard=e.discard??!1,this.options=e}}function vg(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 EM extends Og{constructor(s){super(s)}}class mt extends Og{constructor(e,n){super(e);p(this,"auth");this.auth=n}}class VM extends mt{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(wc(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(Ic(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(Oc(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(Tc(n)),n}}function w(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 k extends mt{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 L extends k{constructor(){super(...arguments);p(this,"pageSize",Tg)}async _bulkAdd(e){var A;const{store:n}=this.client,{addMany:a,updateMany:c,deleteMany:d}=this.actions,o=((A=n.getState().userReducer.currentUser)==null?void 0:A.id)??null,l=new Date().toISOString(),r=[],h=[],y={};for(const O of e){const{modelUuid:P,file:I}=O,F=await this.client.files.getFilePayload(I);F.sha1 in y||(y[F.sha1]=F);const g=this.buildModel({file:I,file_sha1:F.sha1,submitted_at:l,created_by:o,modelUuid:P});r.push(g),h.push(this.buildPayload(g,F))}this.dispatch(a(r));const f=this.enqueueRequest({description:w(m.POST,this.name,!0),method:m.POST,url:`${this.url}/bulk/`,payload:{submitted_at:l,attachments:h,files:Object.values(y)},blocks:r.map(O=>this.getId(O)),blockers:r.map(O=>O.file_sha1)});return f.then(({attachments:O,presigned_urls:P})=>{this.dispatch(c(O)),this.client.files.processPresignedUrls(P)}).catch(()=>{this.dispatch(d(r.map(O=>this.getId(O))))}),[r,f.then(({attachments:O})=>O)]}async _delete(e){const{store:n}=this.client,{addOne:a,deleteOne:c}=this.actions,{selectById:d}=this.selectors,o=d(e)(n.getState());if(!o)throw new Error(`Attempting to delete attachment with uuid ${e} that does not exist in the store`);this.dispatch(c(this.getId(o)));const l=this.enqueueRequest({description:w(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]});return l.then(()=>{this.client.files.removeCache(o.file_sha1)}).catch(()=>{this.dispatch(a(o))}),l}}class BM extends L{constructor(){super(...arguments);p(this,"name","Asset attachment");p(this,"url","/asset-attachments");p(this,"actions",{addOne:bc,addMany:Os,setOne:_c,setMany:Mc,updateOne:Rc,updateMany:kc,deleteOne:vc,deleteMany:Is,initialize:gc});p(this,"selectors",{selectById:Vc,selectByIds:Bc})}getId(e){return e.uuid}buildModel(e){return _({file:URL.createObjectURL(e.file),file_sha1:e.file_sha1,created_by:e.created_by,file_name:e.file.name,file_type:e.file.type,submitted_at:e.submitted_at,asset:e.modelUuid})}buildPayload(e,n){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:n.extension,asset:e.asset}}async bulkAdd(e){return this._bulkAdd(e.map(n=>({modelUuid:n.assetUuid,file:n.file})))}async delete(e){return this._delete(e)}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 zM extends L{constructor(){super(...arguments);p(this,"name","Asset Procedure Attachment");p(this,"url","/asset-procedure-type-attachments");p(this,"actions",{addOne:jc,addMany:$c,setOne:Dc,setMany:Uc,updateOne:Lc,updateMany:Nc,deleteOne:Hc,deleteMany:Gc,initialize:Cc});p(this,"selectors",{selectById:Zc,selectByIds:Jc})}getId(e){return e.uuid}buildModel(e){return _({file:URL.createObjectURL(e.file),file_sha1:e.file_sha1,created_by:e.created_by,file_name:e.file.name,file_type:e.file.type,submitted_at:e.submitted_at,asset_procedure_type:e.modelUuid})}buildPayload(e,n){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:n.extension,asset_procedure_type:e.asset_procedure_type}}async bulkAdd(e){return this._bulkAdd(e.map(n=>({modelUuid:n.assetProcedureTypeUuid,file:n.file})))}async delete(e){return this._delete(e)}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 WM extends k{constructor(){super(...arguments);p(this,"name","Asset Procedure Type Fields Attachment");p(this,"url","/asset-procedure-type-fields-attachments");p(this,"actions",{addOne:xc,addMany:er,setOne:tr,setMany:sr,updateOne:ir,updateMany:nr,deleteOne:ar,deleteMany:cr,initialize:Qc});p(this,"selectors",{selectById:lr,selectByIds:or})}async bulkAdd(e){var f;const{addMany:n,setMany:a,deleteMany:c}=this.actions,d=new Date().toISOString(),o=((f=this.client.store.getState().userReducer.currentUser)==null?void 0:f.id)??null,l={},r=[],h=[];for(const A of e){const{fieldsRevisionUuid:O,fieldIdentifier:P,file:I}=A,F=await this.client.files.getFilePayload(I);F.sha1 in l||(l[F.sha1]=F);const g=_({file:URL.createObjectURL(I),file_type:I.type,file_name:I.name,file_sha1:F.sha1,created_by:o,fields_revision:O,submitted_at:d,field_identifier:P});r.push(g);const v={uuid:g.uuid,file_name:I.name,field_identifier:P,file_extension:F.extension,file_sha1:F.sha1,fields_revision:O};h.push(v)}this.dispatch(n(r));const y=this.enqueueRequest({description:w(m.POST,this.name,!0),method:m.POST,url:`${this.url}/bulk/`,payload:{submitted_at:d,attachments:h,files:Object.values(l)},blockers:r.map(A=>A.fields_revision),blocks:r.map(A=>A.uuid)});return y.then(A=>{this.client.files.processPresignedUrls(A.presigned_urls),this.dispatch(a(A.attachments))}).catch(()=>{this.dispatch(c(r.map(A=>A.uuid)))}),[r,y.then(({attachments:A})=>A)]}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 qM extends k{constructor(){super(...arguments);p(this,"name","Asset Procedure Type Fields");p(this,"url","/asset-procedure-type-fields");p(this,"actions",{addOne:mr,addMany:pr,setOne:yr,setMany:fr,updateOne:Ar,updateMany:Sr,deleteOne:Tr,deleteMany:wr,initialize:hr});p(this,"selectors",{selectById:Fr,selectByIds:Pr})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:w(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(r),blockers:[r.asset_procedure_type],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(f=>{throw this.dispatch(d(r.uuid)),f}),[r,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}}function ut(t,s){const e=[];let n=0;const a=t.length;for(;n<a;)e.push(t.slice(n,n+=s));return e}class CM extends k{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:_r,addMany:ks,setOne:Mr,setMany:Rr,updateOne:kr,updateMany:vr,deleteOne:Er,deleteMany:vs,initialize:br});p(this,"selectors",{selectById:zr,selectByIds:Wr})}async bulkAdd(e,n){var A;const{addMany:a,setMany:c,deleteMany:d}=this.actions,o=new Date().toISOString(),l=((A=this.client.store.getState().userReducer.currentUser)==null?void 0:A.id)??null,r=ut(e,Math.min(n??e.length,U)),h=[],y=[];for(const O of r){const P={},I=[];for(const F of O){const{fieldValuesUuid:g,fieldIdentifier:v,file:B}=F,V=await this.client.files.getFilePayload(B);V.sha1 in P||(P[V.sha1]=V);const C=_({file:URL.createObjectURL(B),file_type:B.type,file_name:B.name,file_sha1:V.sha1,created_by:l,field_values:g,submitted_at:o,field_identifier:v});h.push(C);const q={uuid:C.uuid,file_name:B.name,file_sha1:V.sha1,file_extension:V.extension,field_identifier:v,field_values:g};I.push(q)}y.push({submitted_at:o,attachments:I,files:Object.values(P)})}this.dispatch(a(h));const f=y.map(O=>this.enqueueRequest({description:w(m.POST,this.name,!0),method:m.POST,url:`${this.url}/bulk/`,payload:O,blockers:O.attachments.map(P=>P.field_values),blocks:O.attachments.map(P=>P.uuid)}));return Promise.all(f).then(O=>{for(const I of O)this.client.files.processPresignedUrls(I.presigned_urls);const P=O.flatMap(I=>I.attachments);this.dispatch(c(P))}).catch(O=>{throw this.dispatch(d(h.map(P=>P.uuid))),O}),[h,f.map(O=>O.then(({attachments:P})=>P))]}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:d}=this.selectors,o=n.getState(),l=d(e)(o);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(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:{field_values__asset_procedure__project:e,latest:!0}},n)).flat();return this.dispatch(a(d)),d}}class jM extends k{constructor(){super(...arguments);p(this,"name","Asset Procedure Type Field Values");p(this,"url","/asset-procedure-type-field-values");p(this,"actions",{addOne:$r,addMany:Dr,setOne:Ur,setMany:Lr,updateOne:Nr,updateMany:Hr,deleteOne:Gr,deleteMany:Kr,initialize:jr});p(this,"selectors",{selectById:Jr,selectByIds:Xr})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,r=new Date().toISOString(),h=_({...e,created_by:l,submitted_at:r}),y=this.enqueueRequest({description:w(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)),y.then(A=>{this.dispatch(c(A))}).catch(()=>{this.dispatch(d(h.uuid))}),[h,y]}bulkAdd(e,n){var P;const{values:a,payloads:c}=e,{addMany:d,setMany:o,deleteMany:l}=this.actions,r=new Date().toISOString(),h=((P=this.client.store.getState().userReducer.currentUser)==null?void 0:P.id)??null,y=[],f=ut(c,Math.min(n??c.length,U)),A=[];for(const I of f){const F=[];for(const g of I){const v=_({...g,values:g.values,created_by:h,submitted_at:r});y.push(v),F.push({uuid:v.uuid,asset:g.asset,fields_revision:g.fields_revision,asset_procedure:g.asset_procedure,published_at:g.published_at,values:v.values})}A.push({submitted_at:r,values:a,field_values:F})}this.dispatch(d(y));const O=[];for(const I of A){const{field_values:F}=I,g=F.map(({asset:q})=>q),v=F.map(({fields_revision:q})=>q),B=F.map(({asset_procedure:q})=>q),V=F.map(({uuid:q})=>q),C=this.enqueueRequest({description:w(m.POST,this.name,!0),method:m.POST,url:`${this.url}/bulk/`,payload:I,blockers:g.concat(v).concat(B),blocks:V});O.push(C)}return Promise.all(O).then(I=>{this.dispatch(o(I.flat()))}).catch(()=>{this.dispatch(l(z(y)))}),[y,O]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=n.getState(),o=c(e.uuid)(d);if(!o)throw new Error(`Expected AssetProcedureTypeFieldValues with uuid ${e.uuid} to exist`);const l={...o,...e};this.dispatch(a(l));const r=this.enqueueRequest({description:w(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[l.fields_revision,l.asset,l.asset_procedure],blocks:[l.uuid]});return r.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(a(o))}),[l,r]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected submission with uuid ${e} to exist`);const r=qr(e)(o);this.dispatch(a(e)),this.dispatch(vs(z(r)));try{return await this.enqueueRequest({description:w(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(h){throw this.dispatch(c(l)),this.dispatch(ks(r)),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 $M extends k{constructor(){super(...arguments);p(this,"name","Asset Procedure");p(this,"url","/asset-procedures");p(this,"actions",{addOne:ed,addMany:zs,setOne:nd,setMany:ad,updateOne:td,updateMany:sd,deleteOne:id,deleteMany:Ws,initialize:xr});p(this,"selectors",{selectById:ld,selectByIds:od})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:w(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(r),blockers:[e.asset_procedure_type,e.asset_type],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,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 o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:w(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[d.uuid],blocks:[d.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected asset procedure with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(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:{project:e}},n)).flat();return this.dispatch(a(d)),d}}class DM extends k{constructor(){super(...arguments);p(this,"name","Asset Procedure Type");p(this,"url","/asset-procedure-types");p(this,"actions",{addOne:md,addMany:pd,setOne:Td,setMany:wd,updateOne:yd,updateMany:fd,deleteOne:Ad,deleteMany:Sd,initialize:hd});p(this,"selectors",{selectById:Fd,selectByIds:Pd})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:w(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(r),blockers:[],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,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 o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:w(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[d.uuid],blocks:[d.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected asset procedure type with uuid ${e} to exist`);const r=dd(e)(o);this.dispatch(a(e)),this.dispatch(Ws(z(r)));try{return await this.enqueueRequest({description:w(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(h){throw this.dispatch(c(l)),this.dispatch(zs(r)),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 UM extends k{constructor(){super(...arguments);p(this,"name","Asset Procedure Step Fields Attachment");p(this,"url","/asset-procedure-step-fields-attachments");p(this,"actions",{addOne:_d,addMany:Md,setOne:Rd,setMany:kd,updateOne:vd,updateMany:Ed,deleteOne:Vd,deleteMany:Bd,initialize:bd});p(this,"selectors",{selectById:Wd,selectByIds:qd})}async bulkAdd(e){var f;const{addMany:n,setMany:a,deleteMany:c}=this.actions,d=new Date().toISOString(),o=((f=this.client.store.getState().userReducer.currentUser)==null?void 0:f.id)??null,l={},r=[],h=[];for(const A of e){const{fieldsRevisionUuid:O,fieldIdentifier:P,file:I}=A,F=await this.client.files.getFilePayload(I);F.sha1 in l||(l[F.sha1]=F);const g=_({file:URL.createObjectURL(I),file_type:I.type,file_name:I.name,file_sha1:F.sha1,created_by:o,fields_revision:O,submitted_at:d,field_identifier:P});r.push(g);const v={uuid:g.uuid,file_name:I.name,field_identifier:P,file_extension:F.extension,file_sha1:F.sha1,fields_revision:O};h.push(v)}this.dispatch(n(r));const y=this.enqueueRequest({description:w(m.POST,this.name,!0),method:m.POST,url:`${this.url}/bulk/`,payload:{submitted_at:d,attachments:h,files:Object.values(l)},blockers:r.map(A=>A.fields_revision),blocks:r.map(A=>A.uuid)});return y.then(A=>{this.client.files.processPresignedUrls(A.presigned_urls),this.dispatch(a(A.attachments))}).catch(()=>{this.dispatch(c(r.map(A=>A.uuid)))}),[r,y.then(({attachments:A})=>A)]}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 LM extends k{constructor(){super(...arguments);p(this,"name","Asset Procedure Step Fields");p(this,"url","/asset-procedure-step-fields");p(this,"actions",{addOne:Dd,addMany:Ud,setOne:Ld,setMany:Nd,updateOne:Hd,updateMany:Gd,deleteOne:Kd,deleteMany:Yd,initialize:$d});p(this,"selectors",{selectById:Zd,selectByIds:Jd})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:w(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(r),blockers:[r.asset_procedure_step],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(f=>{throw this.dispatch(d(r.uuid)),f}),[r,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 o=this.enqueueRequest({description:w(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${c.uuid}/`,payload:e,blockers:[c.uuid],blocks:[c.uuid]});return o.then(l=>{this.dispatch(a(l))}).catch(l=>{throw this.dispatch(a(c)),l}),[d,o]}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:w(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(o){throw this.dispatch(c(d)),o}}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 NM extends k{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:el,addMany:Ns,setOne:tl,setMany:sl,updateOne:il,updateMany:nl,deleteOne:al,deleteMany:Hs,initialize:xd});p(this,"selectors",{selectById:rl,selectByIds:dl})}async bulkAdd(e,n){var A;const{addMany:a,setMany:c,deleteMany:d}=this.actions,o=new Date().toISOString(),l=((A=this.client.store.getState().userReducer.currentUser)==null?void 0:A.id)??null,r=ut(e,Math.min(n??e.length,U)),h=[],y=[];for(const O of r){const P={},I=[];for(const F of O){const{fieldValuesUuid:g,fieldIdentifier:v,file:B}=F,V=await this.client.files.getFilePayload(B);V.sha1 in P||(P[V.sha1]=V);const C=_({file:URL.createObjectURL(B),file_type:B.type,file_name:B.name,file_sha1:V.sha1,created_by:l,field_values:g,submitted_at:o,field_identifier:v});h.push(C);const q={uuid:C.uuid,file_name:B.name,file_sha1:V.sha1,file_extension:V.extension,field_identifier:v,field_values:g};I.push(q)}y.push({submitted_at:o,attachments:I,files:Object.values(P)})}this.dispatch(a(h));const f=y.map(O=>this.enqueueRequest({description:w(m.POST,this.name,!0),method:m.POST,url:`${this.url}/bulk/`,payload:O,blockers:O.attachments.map(P=>P.field_values),blocks:O.attachments.map(P=>P.uuid)}));return Promise.all(f).then(O=>{for(const I of O)this.client.files.processPresignedUrls(I.presigned_urls);const P=O.flatMap(I=>I.attachments);this.dispatch(c(P))}).catch(O=>{throw this.dispatch(d(h.map(P=>P.uuid))),O}),[h,f.map(O=>O.then(({attachments:P})=>P))]}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:d}=this.selectors,o=n.getState(),l=d(e)(o);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(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:{field_values__asset_procedure__project:e,latest:!0}},n)).flat();return this.dispatch(a(d)),d}}class HM extends k{constructor(){super(...arguments);p(this,"name","Asset Procedure Step Field Values");p(this,"url","/asset-procedure-step-field-values");p(this,"actions",{addOne:ml,addMany:pl,setOne:yl,setMany:fl,updateOne:Al,updateMany:Sl,deleteOne:Tl,deleteMany:wl,initialize:hl});p(this,"selectors",{selectById:Il,selectByIds:Fl})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,r=new Date().toISOString(),h=_({...e,created_by:l,submitted_at:r}),y=this.enqueueRequest({description:w(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)),y.then(A=>{this.dispatch(c(A))}).catch(()=>{this.dispatch(d(h.uuid))}),[h,y]}bulkAdd(e,n){var P;const{payloads:a,values:c}=e,{addMany:d,setMany:o,deleteMany:l}=this.actions,r=new Date().toISOString(),h=((P=this.client.store.getState().userReducer.currentUser)==null?void 0:P.id)??null,y=[],f=ut(a,Math.min(n??a.length,U)),A=[];for(const I of f){const F=[];for(const g of I){const v=_({...g,values:g.values,created_by:h,submitted_at:r});y.push(v),F.push({uuid:v.uuid,asset:g.asset,fields_revision:g.fields_revision,asset_procedure:g.asset_procedure,asset_procedure_step:g.asset_procedure_step,published_at:g.published_at,values:v.values})}A.push({submitted_at:r,values:c,field_values:F})}this.dispatch(d(y));const O=[];for(const I of A){const{field_values:F}=I,g=F.map(({asset:q})=>q),v=F.map(({fields_revision:q})=>q),B=F.map(({asset_procedure:q})=>q),V=F.map(({uuid:q})=>q),C=this.enqueueRequest({description:w(m.POST,this.name,!0),method:m.POST,url:`${this.url}/bulk/`,payload:I,blockers:g.concat(v).concat(B),blocks:V});O.push(C)}return Promise.all(O).then(I=>{this.dispatch(o(I.flat()))}).catch(()=>{this.dispatch(l(z(y)))}),[y,O]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=n.getState(),o=c(e.uuid)(d);if(!o)throw new Error(`Expected AssetProcedureStepFieldValues with uuid ${e.uuid} to exist`);const l={...o,...e};this.dispatch(a(l));const r=this.enqueueRequest({description:w(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[l.fields_revision,l.asset,l.asset_procedure],blocks:[l.uuid]});return r.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(a(o))}),[l,r]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected submission with uuid ${e} to exist`);const r=ll(e)(o);this.dispatch(a(e)),this.dispatch(Hs(z(r)));try{return await this.enqueueRequest({description:w(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(h){throw this.dispatch(c(l)),this.dispatch(Ns(r)),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 GM extends k{constructor(){super(...arguments);p(this,"name","Asset Procedure Step");p(this,"url","/asset-procedure-steps");p(this,"actions",{addOne:Rl,addMany:kl,setOne:_l,setMany:Ml,updateOne:vl,updateMany:El,deleteOne:Vl,deleteMany:Bl,initialize:bl});p(this,"selectors",{selectById:Wl,selectByIds:ql})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:w(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(r),blockers:[r.asset_procedure_type],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,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 o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:w(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 l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteMany:a,addMany:c,addOne:d,deleteOne:o}=this.actions,{selectById:l}=this.selectors,r=n.getState(),h=l(e)(r);if(!h)throw new Error(`No asset procedure step with uuid ${e} found in the store`);const y=Cl(e)(r);this.dispatch(o(e)),this.dispatch(a(z(y)));try{return await this.enqueueRequest({description:w(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(f){throw this.dispatch(d(h)),this.dispatch(c(y)),f}}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 KM extends k{constructor(){super(...arguments);p(this,"url","/assets");p(this,"name","Asset");p(this,"actions",{addOne:Dl,addMany:Xs,setOne:Hl,setMany:Gl,updateOne:Ul,updateMany:Ll,deleteOne:Nl,deleteMany:Qs,initialize:$l});p(this,"selectors",{selectById:Zl,selectByIds:Jl})}add(e){var y;const{store:n}=this.client,{addOne:a,updateOne:c,deleteOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:w(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(r),blockers:[r.asset_type],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,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 o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:w(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{addOne:a,deleteOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`No asset with uuid ${e} found in the store`);const r=zc(e)(o),h=lf(e)(o);this.dispatch(c(e)),this.dispatch(Is(z(r))),this.dispatch(Gt(z(h)));try{return await this.enqueueRequest({description:w(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(y){throw this.dispatch(a(l)),this.dispatch(Os(r)),this.dispatch(Ht(h)),y}}bulkAdd(e,n){const{addMany:a}=this.actions,c=new Date().toISOString(),d=ht.v4(),o=ut(e,Math.min(n??e.length,U)).map(h=>{const y=h.map(f=>_(f));return{batchId:ht.v4(),payload:{transaction_id:d,submitted_at:c,assets:y}}}),l=[];let r=null;for(const h of o){const{batchId:y,payload:f}=h,A=f.assets.map(({uuid:g})=>g),O=f.assets.map(({asset_type:g})=>g),P=f.assets.map(({project:g})=>g),I=f.assets.map(({status:g})=>g),F=this.enqueueRequest({description:w(m.POST,this.name,!0),method:m.POST,url:`${this.url}/bulk/`,payload:f,blockers:(r?[r]:[]).concat(O).concat(P).concat(I),blocks:[y].concat(A)});r=h.batchId,l.push(F)}return Promise.all(l).then(h=>{const y=h.flat();this.dispatch(a(y))}),l}bulkUpdate(e,n){const{store:a}=this.client,{updateMany:c}=this.actions,{selectByIds:d}=this.selectors,o=z(e).toSorted(vt);if(o.length!==e.length)throw new Error("payloads contains duplicate uuids.");const l=d(o)(a.getState()).toSorted(As);if(o.length!=l.length)throw new Error(`Attempting to bulk update ${o.length-l.length} assets that dont exist in the store`);const r=[];for(let A=0;A<o.length;A++)r.push({...l[A],...e[A]});this.dispatch(c(r));const h=ut(e,Math.min(n??e.length,U)),y=[];let f=null;for(const A of h){const O=ht.v4(),P=z(A),I=A.map(({status:g})=>g).filter(Boolean),F=this.enqueueRequest({description:w(m.PATCH,this.name,!0),method:m.PATCH,url:`${this.url}/bulk/`,payload:{payloads:A},blockers:(f?[f]:[]).concat(P).concat(I),blocks:[O].concat(P)});y.push(F),f=O}return Promise.all(y).then(A=>{this.dispatch(c(A.flat()))}).catch(()=>{this.dispatch(c(l))}),[r,y]}async bulkDelete(e){const{store:n}=this.client,{addMany:a,deleteMany:c}=this.actions,{selectByIds:d}=this.selectors,o=n.getState(),l=d(e)(o);this.dispatch(c(e));try{return await this.enqueueRequest({description:w(m.DELETE,this.name,!0),method:m.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(r){throw this.dispatch(a(l)),r}}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 YM extends k{constructor(){super(...arguments);p(this,"name","Asset Stage Completion");p(this,"url","/asset-stage-completions");p(this,"actions",{addOne:eo,addMany:to,setOne:so,setMany:io,updateOne:no,updateMany:ao,deleteOne:co,deleteMany:ro,initialize:xl});p(this,"selectors",{selectById:ho,selectByIds:mo})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:w(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(r),blockers:[e.asset,e.asset_stage],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,h]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=d(e)(n.getState());if(!o)throw new Error(`Expected asset stage completion with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(o)),l}}bulkAdd(e){var A;const{store:n}=this.client,{addMany:a,setMany:c,deleteMany:d}=this.actions,o=new Date().toISOString(),l=((A=n.getState().userReducer.currentUser)==null?void 0:A.id)??null,r=e.map(O=>_(O)),h=r.map(O=>({...O,created_by:l,submitted_at:o})),y=h.map(({uuid:O})=>O);this.dispatch(a(h));const f=this.enqueueRequest({description:w(m.POST,this.name,!0),method:m.POST,url:`${this.url}/bulk/`,payload:{submitted_at:o,completions:r},blockers:[...e.map(O=>O.asset_procedure),...e.map(O=>O.asset_stage),...e.map(O=>O.asset)],blocks:y});return f.then(O=>{this.dispatch(c(O))}).catch(()=>{this.dispatch(d(y))}),[h,f]}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:d}=this.selectors,o=d(e)(n.getState());this.dispatch(a(e));try{return await this.enqueueRequest({description:w(m.DELETE,this.name,!0),method:m.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(l){throw this.dispatch(c(o)),l}}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 ZM extends k{constructor(){super(...arguments);p(this,"name","Asset Stage");p(this,"url","/asset-stages");p(this,"actions",{addOne:So,addMany:To,setOne:fo,setMany:Ao,updateOne:wo,updateMany:Oo,deleteOne:Io,deleteMany:Fo,initialize:yo});p(this,"selectors",{selectById:go,selectByIds:bo})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:w(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(r),blockers:[r.asset_procedure_type],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,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 o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:w(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${d.uuid}/`,payload:e,blockers:[d.uuid],blocks:[d.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);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(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_procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class JM extends L{constructor(){super(...arguments);p(this,"name","Asset Type Attachment");p(this,"url","/asset-type-attachments");p(this,"actions",{addOne:Ro,addMany:ni,setOne:ko,setMany:vo,updateOne:Eo,updateMany:Vo,deleteOne:Bo,deleteMany:ai,initialize:Mo});p(this,"selectors",{selectById:Wo,selectByIds:qo})}getId(e){return e.uuid}buildModel(e){return _({file:URL.createObjectURL(e.file),file_sha1:e.file_sha1,created_by:e.created_by,file_name:e.file.name,file_type:e.file.type,submitted_at:e.submitted_at,asset_type:e.modelUuid})}buildPayload(e,n){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:n.extension,asset_type:e.asset_type}}async bulkAdd(e){return this._bulkAdd(e.map(n=>({modelUuid:n.assetTypeUuid,file:n.file})))}async delete(e){return this._delete(e)}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 XM extends k{constructor(){super(...arguments);p(this,"name","Asset Type Fields Attachment");p(this,"url","/asset-type-fields-attachments");p(this,"actions",{addOne:Uo,addMany:Lo,setOne:No,setMany:Ho,updateOne:Go,updateMany:Ko,deleteOne:Yo,deleteMany:Zo,initialize:Do});p(this,"selectors",{selectById:Xo,selectByIds:Qo})}async bulkAdd(e){var f;const{addMany:n,setMany:a,deleteMany:c}=this.actions,d=new Date().toISOString(),o=((f=this.client.store.getState().userReducer.currentUser)==null?void 0:f.id)??null,l={},r=[],h=[];for(const A of e){const{fieldsRevisionUuid:O,fieldIdentifier:P,file:I}=A,F=await this.client.files.getFilePayload(I);F.sha1 in l||(l[F.sha1]=F);const g=_({file:URL.createObjectURL(I),file_type:I.type,file_name:I.name,file_sha1:F.sha1,created_by:o,fields_revision:O,submitted_at:d,field_identifier:P});r.push(g);const v={uuid:g.uuid,file_name:I.name,field_identifier:P,file_extension:F.extension,file_sha1:F.sha1,fields_revision:O};h.push(v)}this.dispatch(n(r));const y=this.enqueueRequest({description:w(m.POST,this.name,!0),method:m.POST,url:`${this.url}/bulk/`,payload:{submitted_at:d,attachments:h,files:Object.values(l)},blockers:r.map(A=>A.fields_revision),blocks:r.map(A=>A.uuid)});return y.then(A=>{this.client.files.processPresignedUrls(A.presigned_urls),this.dispatch(a(A.attachments))}).catch(()=>{this.dispatch(c(r.map(A=>A.uuid)))}),[r,y.then(({attachments:A})=>A)]}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 QM extends k{constructor(){super(...arguments);p(this,"name","Asset Type Fields");p(this,"url","/asset-type-fields");p(this,"actions",{addOne:su,addMany:iu,setOne:nu,setMany:au,updateOne:cu,updateMany:ru,deleteOne:du,deleteMany:lu,initialize:tu});p(this,"selectors",{selectById:uu,selectByIds:hu})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:w(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(r),blockers:[r.asset_type],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(f=>{throw this.dispatch(d(r.uuid)),f}),[r,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 xM extends k{constructor(){super(...arguments);p(this,"name","Asset Type Field Values Attachment");p(this,"url","/asset-type-field-values-attachments");p(this,"actions",{addOne:fu,addMany:ui,setOne:Au,setMany:Su,updateOne:Tu,updateMany:wu,deleteOne:Ou,deleteMany:hi,initialize:yu});p(this,"selectors",{selectById:Fu,selectByIds:Pu})}async bulkAdd(e,n){var A;const{addMany:a,setMany:c,deleteMany:d}=this.actions,o=new Date().toISOString(),l=((A=this.client.store.getState().userReducer.currentUser)==null?void 0:A.id)??null,r=ut(e,Math.min(n??e.length,U)),h=[],y=[];for(const O of r){const P={},I=[];for(const F of O){const{fieldValuesUuid:g,fieldIdentifier:v,file:B}=F,V=await this.client.files.getFilePayload(B);V.sha1 in P||(P[V.sha1]=V);const C=_({file:URL.createObjectURL(B),file_type:B.type,file_name:B.name,file_sha1:V.sha1,created_by:l,field_values:g,submitted_at:o,field_identifier:v});h.push(C);const q={uuid:C.uuid,file_name:B.name,file_sha1:V.sha1,file_extension:V.extension,field_identifier:v,field_values:g};I.push(q)}y.push({submitted_at:o,attachments:I,files:Object.values(P)})}this.dispatch(a(h));const f=y.map(O=>this.enqueueRequest({description:w(m.POST,this.name,!0),method:m.POST,url:`${this.url}/bulk/`,payload:O,blockers:O.attachments.map(P=>P.field_values),blocks:O.attachments.map(P=>P.uuid)}));return Promise.all(f).then(O=>{for(const I of O)this.client.files.processPresignedUrls(I.presigned_urls);const P=O.flatMap(I=>I.attachments);this.dispatch(c(P))}).catch(O=>{throw this.dispatch(d(h.map(P=>P.uuid))),O}),[h,f.map(O=>O.then(({attachments:P})=>P))]}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:d}=this.selectors,o=n.getState(),l=d(e)(o);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(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:{field_values__asset__project:e,latest:!0}},n)).flat();return this.dispatch(a(d)),d}}class eR extends k{constructor(){super(...arguments);p(this,"name","Asset Type Field Values");p(this,"url","/asset-type-field-values");p(this,"actions",{addOne:Ru,addMany:ku,setOne:vu,setMany:Eu,updateOne:Vu,updateMany:Bu,deleteOne:zu,deleteMany:Wu,initialize:Mu});p(this,"selectors",{selectById:Cu,selectByIds:ju})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,r=new Date().toISOString(),h=_({...e,created_by:l,submitted_at:r}),y=this.enqueueRequest({description:w(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)),y.then(A=>{this.dispatch(c(A))}).catch(()=>{this.dispatch(d(h.uuid))}),[h,y]}bulkAdd(e,n){var O;const{payloads:a,values:c}=e,{addMany:d,setMany:o,deleteMany:l}=this.actions,r=new Date().toISOString(),h=[],y=ut(a,Math.min(n??a.length,U)),f=[];for(const P of y){const I=[];for(const F of P){const g=_({...F,values:F.values,created_by:((O=this.client.store.getState().userReducer.currentUser)==null?void 0:O.id)??null,submitted_at:r});h.push(g),I.push({uuid:g.uuid,asset:F.asset,fields_revision:F.fields_revision,published_at:F.published_at,values:g.values})}f.push({submitted_at:r,values:c,field_values:I})}this.dispatch(d(h));const A=[];for(const P of f){const{field_values:I}=P,F=I.map(({asset:V})=>V),g=I.map(({fields_revision:V})=>V),v=I.map(({uuid:V})=>V),B=this.enqueueRequest({description:w(m.POST,this.name,!0),method:m.POST,url:`${this.url}/bulk/`,payload:P,blockers:F.concat(g),blocks:v});A.push(B)}return Promise.all(A).then(P=>{this.dispatch(o(P.flat()))}).catch(()=>{this.dispatch(l(z(h)))}),[h,A]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=n.getState(),o=c(e.uuid)(d);if(!o)throw new Error(`Expected AssetTypeFieldValues with uuid ${e.uuid} to exist`);const l={...o,...e};this.dispatch(a(l));const r=this.enqueueRequest({description:w(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[l.uuid,l.fields_revision,l.asset],blocks:[l.uuid]});return r.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(a(o))}),[l,r]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected submission with uuid ${e} to exist`);const r=gu(e)(o);this.dispatch(a(e)),this.dispatch(hi(z(r)));try{return await this.enqueueRequest({description:w(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(h){throw this.dispatch(c(l)),this.dispatch(ui(r)),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 tR extends k{constructor(){super(...arguments);p(this,"name","Asset Type Identifier");p(this,"url","/asset-type-identifiers");p(this,"actions",{addOne:Lu,addMany:Nu,setOne:Hu,setMany:Gu,updateOne:Ku,updateMany:Yu,deleteOne:Zu,deleteMany:Ju,initialize:Uu});p(this,"selectors",{selectById:Qu,selectByIds:xu})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:w(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(r),blockers:[r.asset_type],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,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 o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:w(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);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(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 sR extends k{constructor(){super(...arguments);p(this,"name","Asset Type Identifier Value");p(this,"url","/asset-type-identifier-values");p(this,"actions",{addOne:ih,addMany:nh,setOne:ah,setMany:ch,updateOne:rh,updateMany:dh,deleteOne:lh,deleteMany:oh,initialize:sh});p(this,"selectors",{selectById:hh,selectByIds:mh})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:w(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(r),blockers:[e.asset,e.asset_type_identifier],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,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 value with uuid ${e.uuid} to exist`);const o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:w(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);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(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:{asset__project:e}},n)).flat();return this.dispatch(a(d)),d}}class iR extends k{constructor(){super(...arguments);p(this,"name","Asset Type");p(this,"url","/asset-types");p(this,"actions",{addOne:Th,addMany:wh,setOne:Ah,setMany:Sh,updateOne:Oh,updateMany:Ih,deleteOne:Fh,deleteMany:Ph,initialize:fh});p(this,"selectors",{selectById:bh,selectByIds:_h})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:w(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(r),blockers:[],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,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 o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:w(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[d.uuid],blocks:[d.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected asset type with uuid ${e} to exist`);const r=Yl(e)(o),h=Co(e)(o);this.dispatch(a(e)),this.dispatch(Qs(z(r))),this.dispatch(ai(z(h)));try{return await this.enqueueRequest({description:w(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(y){throw this.dispatch(c(l)),this.dispatch(Xs(r)),this.dispatch(ni(h)),y}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class nR extends k{constructor(){super(...arguments);p(this,"name","Asset Type Status");p(this,"url","/asset-type-statuses");p(this,"actions",{addOne:vh,addMany:Eh,setOne:Vh,setMany:Bh,updateOne:zh,updateMany:Wh,deleteOne:qh,deleteMany:Ch,initialize:kh});p(this,"selectors",{selectById:$h,selectByIds:Dh})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:w(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(r),blockers:[e.asset_type],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,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 o={...d,...e};this.dispatch(n(o));const l=this.enqueueRequest({description:w(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(r=>{this.dispatch(n(r))}).catch(()=>{this.dispatch(n(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=d(e)(n.getState());if(!o)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(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(o)),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 aR extends k{constructor(){super(...arguments);p(this,"name","Category");p(this,"url","/categories");p(this,"actions",{addOne:Yh,addMany:Zh,setOne:Jh,setMany:Xh,updateOne:Qh,updateMany:xh,deleteOne:em,deleteMany:tm,initialize:Kh});p(this,"selectors",{selectById:Pi,selectByIds:im})}add(e){var y;const{store:n}=this.client,{addOne:a,updateOne:c,deleteOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:w(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(r),blockers:[e.project],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,h]}update(e){const{updateOne: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 category with uuid ${e.uuid}`);const o={...d,...e};this.dispatch(n(o));const l=this.enqueueRequest({description:w(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(r=>{this.dispatch(n(r))}).catch(()=>{this.dispatch(n(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=d(e)(n.getState());if(!o)throw new Error(`No category with uuid ${e} found in the store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${o.uuid}/`,blockers:[o.uuid],blocks:[]})}catch(l){throw this.dispatch(c(o)),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 cR extends L{constructor(){super(...arguments);p(this,"name","Document Attachment");p(this,"url","/document-attachments");p(this,"actions",{addOne:rm,addMany:dm,setOne:lm,setMany:om,updateOne:um,updateMany:hm,deleteOne:mm,deleteMany:pm,initialize:cm});p(this,"selectors",{selectById:fm,selectByIds:Am})}getId(e){return e.uuid}buildModel(e){return _({file:URL.createObjectURL(e.file),file_sha1:e.file_sha1,created_by:e.created_by,file_name:e.file.name,file_type:e.file.type,submitted_at:e.submitted_at,document:e.modelUuid})}buildPayload(e,n){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:n.extension,document:e.document}}async bulkAdd(e){var O;const{store:n}=this.client,{addMany:a,updateMany:c,deleteMany:d}=this.actions,o=((O=n.getState().userReducer.currentUser)==null?void 0:O.id)??null,l=new Date().toISOString(),r=[],h=[],y={},f={};for(const P of e){const{documentUuid:I,file:F}=P,g=await this.client.files.getFilePayload(F);g.sha1 in y||(y[g.sha1]=g,f[g.sha1]=[]);const v=this.buildModel({file:F,file_sha1:g.sha1,submitted_at:l,created_by:o,modelUuid:I});r.push(v),h.push(this.buildPayload(v,g)),f[g.sha1].push(v.uuid)}this.dispatch(a(r));const A=this.enqueueRequest({description:w(m.POST,this.name,!0),method:m.POST,url:`${this.url}/bulk/`,payload:{submitted_at:l,attachments:h,files:Object.values(y)},blocks:r.map(P=>P.uuid),blockers:r.map(P=>P.file_sha1)});return A.then(({attachments:P,presigned_urls:I})=>{this.dispatch(c(P));const F=this.client.files.processPresignedUrls(I);for(const[g,v]of Object.entries(F))v.then(()=>{const B=f[g];for(const V of B)this.makeReadable(V)})}).catch(()=>{this.dispatch(d(r.map(P=>P.uuid)))}),[r,A.then(({attachments:P})=>P)]}async delete(e){return this._delete(e)}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),l=(await Promise.all([c,d])).flat();return this.dispatch(a(l)),l}}class rR extends k{constructor(){super(...arguments);p(this,"name","Document");p(this,"url","/documents");p(this,"actions",{addOne:Om,addMany:Im,setOne:Fm,setMany:Pm,updateOne:gm,updateMany:bm,deleteOne:_m,deleteMany:Mm,initialize:wm});p(this,"selectors",{selectById:km,selectByIds:vm})}add(e){var y;const{store:n}=this.client,{addOne:a,deleteOne:c,updateOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:w(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(r),blockers:r.parent_document?[r.parent_document]:[],blocks:[r.uuid]});return h.then(f=>{this.dispatch(d(f))}).catch(()=>{this.dispatch(c(r.uuid))}),[r,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 o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:w(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c,addMany:d,deleteMany:o}=this.actions,{selectById:l}=this.selectors,r=n.getState(),h=l(e)(r);if(!h)throw new Error(`attempting to delete a document with uuid ${e} that does not exist in store.documents`);const y=Em(e)(r);this.dispatch(a(e)),this.dispatch(o(z(y)));try{return await this.enqueueRequest({description:w(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(f){throw this.dispatch(c(h)),this.dispatch(d(y)),f}}async refreshStore(e,n){const{initialize:a}=this.actions,c=this.list({queryParams:{project__organization:e}},n),d=this.list({queryParams:{organization:e}},n),l=(await Promise.all([c,d])).flat();return this.dispatch(a(l)),l}}class St extends mt{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 dR extends St{constructor(){super(...arguments);p(this,"name","Email Domains");p(this,"url","/organization-email-domains");p(this,"actions",{addOne:zm,addMany:Wm,setOne:qm,setMany:Cm,updateOne:jm,updateMany:$m,deleteOne:Dm,deleteMany:Um,initialize:Bm});p(this,"selectors",{selectById:Nm,selectByIds:Hm})}async add(e,n){return this.enqueueRequest({description:w(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:w(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 lR extends mt{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 ls={},Ha=new Set;let os=0,Ga=0,Ka=0;const oR=20;class uR extends mt{constructor(){super(...arguments);p(this,"host");p(this,"_dbPromise",Zg.openDB("fileCache",1,{upgrade(e){e.createObjectStore("files")}}))}async renewUploadUrl(e){const n=await this.fetchCache(e);if(!n)throw new Error(`File with sha1 ${e} not found in cache`);const a=await fs(n,e),c=await this.enqueueRequest({description:"Get S3 URL",method:m.GET,url:"/authentication/files/presigned-upload-url/",queryParams:{sha1:await ft(n),file_type:n.type,extension:n.name.split(".").pop(),size:n.size.toString()},blockers:[],blocks:[`s3-${a}`]});return"url"in c&&this.dispatch(Zm({sha1:e,...c})),c}async addCache(e,n){if(Ha.has(n))return;if(!e.type){const d=e.name.split("."),o=d[d.length-1];e=new File([e],e.name,{type:o})}if(!e.name||!e.size||!e.type)throw new Error("Cannot add files to cache that do not have a name, size and type.");const a=await this._dbPromise;!!await a.get("files",n)?(console.error("File already cached (this is unexpected at this point):",e.name,n),os++):(await a.put("files",e,n),Ga++),Ha.add(n),Ka++,Ka%oR===0&&console.debug(`File cache summary: ${os} hits and ${Ga} misses, ${os/(os+Ga)*100}% hit rate over ${Ka} calls to addCache.`)}async removeCache(e){await(await this._dbPromise).delete("files",e),Ha.delete(e)}async fetchCache(e){return(await this._dbPromise).get("files",e)}async getOrRenewUploadUrl(e){const n=this.client.store.getState();return Jm(e)(n)??await this.renewUploadUrl(e)}async uploadFileToS3(e){const n=await this.fetchCache(e);if(!n)throw new Error(`File with sha1 ${e} not found in cache`);const a=await fs(n,e),c={file_name:n.name,file_sha1:e,file:a},d=await this.getOrRenewUploadUrl(e);if("warning"in d){if(d.warning==="already_uploaded")return[c,Promise.resolve(void 0)];throw new Error(d.warning)}const o=d.url,l=this.enqueueRequest({url:o,description:"Upload file",method:m.POST,isExternalUrl:!0,isAuthNeeded:!1,attachmentHash:e,blockers:[`s3-${a}`],blocks:[e],s3url:d});return[c,l]}async fetchFileFromUrl(e,n,a){const c=e.split("?")[0]??e,d=await this.fetchCache(n);if(d){if(!d.name)throw new Error("Cached file unexpectedly has no name.");return d}if(e.startsWith("blob:")){const h=await lc(e),y=new File([h],a??n,{type:h.type});return await this.addCache(y,n),y}let o=ls[c],l=!0;o?l=!1:(o=new Promise(h=>{this.enqueueRequest({description:"Download file",method:m.GET,url:e,isExternalUrl:!0,isResponseBlob:!0,isAuthNeeded:!1,blockers:[n],blocks:[n]}).then(y=>{const f=new File([y],a??n,{type:y.type});h(f)})}),ls[c]=o);let r;try{r=await o}catch(h){throw l&&h instanceof $&&delete ls[c],h}if(l){const h=await ft(r);if(h!==n){const A=`The hash of the file returned from the server (${h}) does not match the
|
|
8
|
+
`)}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>fM?wt:e}class D extends Error{constructor(e){super(wt);m(this,"status");m(this,"response");m(this,"message");m(this,"options");const{response:n,innerError:a}=e;this.message=e.message??SM(n,a)??wt,this.status=(n==null?void 0:n.status)??0,this.response=n,e.discard=e.discard??!1,this.options=e}}function mb(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 AM extends nb{constructor(s){super(s)}}class yt extends nb{constructor(e,n){super(e);m(this,"auth");this.auth=n}}class wM extends yt{async startConversation(s,e){return this.enqueueRequest({description:"Start agent conversation",method:p.POST,url:"/agents/prompt/",payload:{prompt:s,active_project:e},blockers:["prompt"],blocks:["prompt"]}).then(n=>(this.dispatch(Ec(n)),n))}async continueConversation(s,e,n){return this.enqueueRequest({description:"Prompt agent",method:p.POST,url:"/agents/prompt/",payload:{prompt:s,active_project:n},blockers:["prompt"],blocks:["prompt"],queryParams:{conversation_id:e}}).then(a=>{this.dispatch(Wc(a))})}async fetchDetails(s){return this.enqueueRequest({description:"Get agent conversation",method:p.GET,url:`/agents/conversations/${s}/`,blockers:["conversation"],blocks:["conversation"]}).then(e=>{this.dispatch(Vc(e))})}async rate(s,e){return this.enqueueRequest({description:"Rate agent response",method:p.PUT,url:`/agents/responses/${s}/rate/`,payload:{rating:e},blockers:["rate"],blocks:["rate"]})}async list(s,e){return this.performRequest({method:p.GET,url:"/agents/conversations/",...s},e)}async refreshStore(s,e){const n=await this.list({queryParams:{project:s}},e);return this.dispatch(vc(n)),n}}function T(t,s,e){const n=`${s}${e?"s":""}`;switch(t){case p.GET:return`Get ${n}`;case p.POST:return`Create ${n}`;case p.PATCH:return`Update ${n}`;case p.PUT:return`Update ${n}`;case p.DELETE:return`Delete ${n}`}}class k extends yt{async get(s,e){return this.performRequest({url:`${this.url}/${s}/`,method:p.GET},e)}async list(s,e){return this.performRequest({url:`${this.url}/`,method:p.GET,...s},e)}async listPaginated(s,e){return this.performPagination({url:`${this.url}/`,method:p.GET,...s},e)}}class L extends k{constructor(){super(...arguments);m(this,"pageSize",sb)}async _bulkAdd(e){var S;const{store:n}=this.client,{addMany:a,updateMany:c,deleteMany:d}=this.actions,o=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,l=new Date().toISOString(),r=[],h=[],y={};for(const O of e){const{modelUuid:P,file:I}=O,F=await this.client.files.getFilePayload(I);F.sha1 in y||(y[F.sha1]=F);const g=this.buildModel({file:I,file_sha1:F.sha1,submitted_at:l,created_by:o,modelUuid:P});r.push(g),h.push(this.buildPayload(g,F))}this.dispatch(a(r));const f=this.enqueueRequest({description:T(p.POST,this.name,!0),method:p.POST,url:`${this.url}/bulk/`,payload:{submitted_at:l,attachments:h,files:Object.values(y)},blocks:r.map(O=>this.getId(O)),blockers:r.map(O=>O.file_sha1)});return f.then(({attachments:O,presigned_urls:P})=>{this.dispatch(c(O)),this.client.files.processPresignedUrls(P)}).catch(()=>{this.dispatch(d(r.map(O=>this.getId(O))))}),[r,f.then(({attachments:O})=>O)]}async _delete(e){const{store:n}=this.client,{addOne:a,deleteOne:c}=this.actions,{selectById:d}=this.selectors,o=d(e)(n.getState());if(!o)throw new Error(`Attempting to delete attachment with uuid ${e} that does not exist in the store`);this.dispatch(c(this.getId(o)));const l=this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]});return l.then(()=>{this.client.files.removeCache(o.file_sha1)}).catch(()=>{this.dispatch(a(o))}),l}}class TM extends L{constructor(){super(...arguments);m(this,"name","Asset attachment");m(this,"url","/asset-attachments");m(this,"actions",{addOne:Cc,addMany:gs,setOne:jc,setMany:Dc,updateOne:$c,updateMany:Uc,deleteOne:Lc,deleteMany:bs,initialize:qc});m(this,"selectors",{selectById:Hc,selectByIds:Gc})}getId(e){return e.uuid}buildModel(e){return _({file:URL.createObjectURL(e.file),file_sha1:e.file_sha1,created_by:e.created_by,file_name:e.file.name,file_type:e.file.type,submitted_at:e.submitted_at,asset:e.modelUuid})}buildPayload(e,n){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:n.extension,asset:e.asset}}async bulkAdd(e){return this._bulkAdd(e.map(n=>({modelUuid:n.assetUuid,file:n.file})))}async delete(e){return this._delete(e)}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 OM extends L{constructor(){super(...arguments);m(this,"name","Asset Procedure Attachment");m(this,"url","/asset-procedure-type-attachments");m(this,"actions",{addOne:Qc,addMany:Xc,setOne:xc,setMany:er,updateOne:tr,updateMany:sr,deleteOne:ir,deleteMany:nr,initialize:Jc});m(this,"selectors",{selectById:rr,selectByIds:dr})}getId(e){return e.uuid}buildModel(e){return _({file:URL.createObjectURL(e.file),file_sha1:e.file_sha1,created_by:e.created_by,file_name:e.file.name,file_type:e.file.type,submitted_at:e.submitted_at,asset_procedure_type:e.modelUuid})}buildPayload(e,n){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:n.extension,asset_procedure_type:e.asset_procedure_type}}async bulkAdd(e){return this._bulkAdd(e.map(n=>({modelUuid:n.assetProcedureTypeUuid,file:n.file})))}async delete(e){return this._delete(e)}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 IM extends k{constructor(){super(...arguments);m(this,"name","Asset Procedure Type Fields Attachment");m(this,"url","/asset-procedure-type-fields-attachments");m(this,"actions",{addOne:ur,addMany:hr,setOne:pr,setMany:mr,updateOne:yr,updateMany:fr,deleteOne:Sr,deleteMany:Ar,initialize:or});m(this,"selectors",{selectById:Or,selectByIds:Ir})}async bulkAdd(e){var f;const{addMany:n,setMany:a,deleteMany:c}=this.actions,d=new Date().toISOString(),o=((f=this.client.store.getState().userReducer.currentUser)==null?void 0:f.id)??null,l={},r=[],h=[];for(const S of e){const{fieldsRevisionUuid:O,fieldIdentifier:P,file:I}=S,F=await this.client.files.getFilePayload(I);F.sha1 in l||(l[F.sha1]=F);const g=_({file:URL.createObjectURL(I),file_type:I.type,file_name:I.name,file_sha1:F.sha1,created_by:o,fields_revision:O,submitted_at:d,field_identifier:P});r.push(g);const v={uuid:g.uuid,file_name:I.name,field_identifier:P,file_extension:F.extension,file_sha1:F.sha1,fields_revision:O};h.push(v)}this.dispatch(n(r));const y=this.enqueueRequest({description:T(p.POST,this.name,!0),method:p.POST,url:`${this.url}/bulk/`,payload:{submitted_at:d,attachments:h,files:Object.values(l)},blockers:r.map(S=>S.fields_revision),blocks:r.map(S=>S.uuid)});return y.then(S=>{this.client.files.processPresignedUrls(S.presigned_urls),this.dispatch(a(S.attachments))}).catch(()=>{this.dispatch(c(r.map(S=>S.uuid)))}),[r,y.then(({attachments:S})=>S)]}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 FM extends k{constructor(){super(...arguments);m(this,"name","Asset Procedure Type Fields");m(this,"url","/asset-procedure-type-fields");m(this,"actions",{addOne:gr,addMany:br,setOne:_r,setMany:Rr,updateOne:Mr,updateMany:kr,deleteOne:vr,deleteMany:Er,initialize:Pr});m(this,"selectors",{selectById:Br,selectByIds:zr})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(r),blockers:[r.asset_procedure_type],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(f=>{throw this.dispatch(d(r.uuid)),f}),[r,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}}function pt(t,s){const e=[];let n=0;const a=t.length;for(;n<a;)e.push(t.slice(n,n+=s));return e}class PM extends k{constructor(){super(...arguments);m(this,"name","Asset Procedure Type Field Values Attachment");m(this,"url","/asset-procedure-type-field-values-attachments");m(this,"actions",{addOne:jr,addMany:Ws,setOne:Dr,setMany:$r,updateOne:Ur,updateMany:Lr,deleteOne:Nr,deleteMany:Bs,initialize:Cr});m(this,"selectors",{selectById:Kr,selectByIds:Yr})}async bulkAdd(e,n){var S;const{addMany:a,setMany:c,deleteMany:d}=this.actions,o=new Date().toISOString(),l=((S=this.client.store.getState().userReducer.currentUser)==null?void 0:S.id)??null,r=pt(e,Math.min(n??e.length,U)),h=[],y=[];for(const O of r){const P={},I=[];for(const F of O){const{fieldValuesUuid:g,fieldIdentifier:v,file:V}=F,W=await this.client.files.getFilePayload(V);W.sha1 in P||(P[W.sha1]=W);const C=_({file:URL.createObjectURL(V),file_type:V.type,file_name:V.name,file_sha1:W.sha1,created_by:l,field_values:g,submitted_at:o,field_identifier:v});h.push(C);const q={uuid:C.uuid,file_name:V.name,file_sha1:W.sha1,file_extension:W.extension,field_identifier:v,field_values:g};I.push(q)}y.push({submitted_at:o,attachments:I,files:Object.values(P)})}this.dispatch(a(h));const f=y.map(O=>this.enqueueRequest({description:T(p.POST,this.name,!0),method:p.POST,url:`${this.url}/bulk/`,payload:O,blockers:O.attachments.map(P=>P.field_values),blocks:O.attachments.map(P=>P.uuid)}));return Promise.all(f).then(O=>{for(const I of O)this.client.files.processPresignedUrls(I.presigned_urls);const P=O.flatMap(I=>I.attachments);this.dispatch(c(P))}).catch(O=>{throw this.dispatch(d(h.map(P=>P.uuid))),O}),[h,f.map(O=>O.then(({attachments:P})=>P))]}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:d}=this.selectors,o=n.getState(),l=d(e)(o);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!0),method:p.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:{field_values__asset_procedure__project:e,latest:!0}},n)).flat();return this.dispatch(a(d)),d}}class gM extends k{constructor(){super(...arguments);m(this,"name","Asset Procedure Type Field Values");m(this,"url","/asset-procedure-type-field-values");m(this,"actions",{addOne:Xr,addMany:xr,setOne:ed,setMany:td,updateOne:sd,updateMany:id,deleteOne:nd,deleteMany:ad,initialize:Qr});m(this,"selectors",{selectById:dd,selectByIds:ld})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,r=new Date().toISOString(),h=_({...e,created_by:l,submitted_at:r}),y=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(h),blockers:[e.asset,e.fields_revision,e.asset_procedure],blocks:[h.uuid]});return this.dispatch(a(h)),y.then(S=>{this.dispatch(c(S))}).catch(()=>{this.dispatch(d(h.uuid))}),[h,y]}bulkAdd(e,n){var P;const{values:a,payloads:c}=e,{addMany:d,setMany:o,deleteMany:l}=this.actions,r=new Date().toISOString(),h=((P=this.client.store.getState().userReducer.currentUser)==null?void 0:P.id)??null,y=[],f=pt(c,Math.min(n??c.length,U)),S=[];for(const I of f){const F=[];for(const g of I){const v=_({...g,values:g.values,created_by:h,submitted_at:r});y.push(v),F.push({uuid:v.uuid,asset:g.asset,fields_revision:g.fields_revision,asset_procedure:g.asset_procedure,published_at:g.published_at,values:v.values})}S.push({submitted_at:r,values:a,field_values:F})}this.dispatch(d(y));const O=[];for(const I of S){const{field_values:F}=I,g=F.map(({asset:q})=>q),v=F.map(({fields_revision:q})=>q),V=F.map(({asset_procedure:q})=>q),W=F.map(({uuid:q})=>q),C=this.enqueueRequest({description:T(p.POST,this.name,!0),method:p.POST,url:`${this.url}/bulk/`,payload:I,blockers:g.concat(v).concat(V),blocks:W});O.push(C)}return Promise.all(O).then(I=>{this.dispatch(o(I.flat()))}).catch(()=>{this.dispatch(l(B(y)))}),[y,O]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=n.getState(),o=c(e.uuid)(d);if(!o)throw new Error(`Expected AssetProcedureTypeFieldValues with uuid ${e.uuid} to exist`);const l={...o,...e};this.dispatch(a(l));const r=this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[l.fields_revision,l.asset,l.asset_procedure],blocks:[l.uuid]});return r.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(a(o))}),[l,r]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected submission with uuid ${e} to exist`);const r=Zr(e)(o);this.dispatch(a(e)),this.dispatch(Bs(B(r)));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(h){throw this.dispatch(c(l)),this.dispatch(Ws(r)),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 bM extends k{constructor(){super(...arguments);m(this,"name","Asset Procedure");m(this,"url","/asset-procedures");m(this,"actions",{addOne:hd,addMany:js,setOne:fd,setMany:Sd,updateOne:pd,updateMany:md,deleteOne:yd,deleteMany:Ds,initialize:ud});m(this,"selectors",{selectById:Od,selectByIds:Id})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(r),blockers:[e.asset_procedure_type,e.asset_type],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,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 o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[d.uuid],blocks:[d.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected asset procedure with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.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:{project:e}},n)).flat();return this.dispatch(a(d)),d}}class _M extends k{constructor(){super(...arguments);m(this,"name","Asset Procedure Type");m(this,"url","/asset-procedure-types");m(this,"actions",{addOne:gd,addMany:bd,setOne:vd,setMany:Ed,updateOne:_d,updateMany:Rd,deleteOne:Md,deleteMany:kd,initialize:Pd});m(this,"selectors",{selectById:Bd,selectByIds:zd})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(r),blockers:[],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,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 o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[d.uuid],blocks:[d.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected asset procedure type with uuid ${e} to exist`);const r=Td(e)(o);this.dispatch(a(e)),this.dispatch(Ds(B(r)));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(h){throw this.dispatch(c(l)),this.dispatch(js(r)),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 RM extends k{constructor(){super(...arguments);m(this,"name","Asset Procedure Step Fields Attachment");m(this,"url","/asset-procedure-step-fields-attachments");m(this,"actions",{addOne:jd,addMany:Dd,setOne:$d,setMany:Ud,updateOne:Ld,updateMany:Nd,deleteOne:Hd,deleteMany:Gd,initialize:Cd});m(this,"selectors",{selectById:Yd,selectByIds:Zd})}async bulkAdd(e){var f;const{addMany:n,setMany:a,deleteMany:c}=this.actions,d=new Date().toISOString(),o=((f=this.client.store.getState().userReducer.currentUser)==null?void 0:f.id)??null,l={},r=[],h=[];for(const S of e){const{fieldsRevisionUuid:O,fieldIdentifier:P,file:I}=S,F=await this.client.files.getFilePayload(I);F.sha1 in l||(l[F.sha1]=F);const g=_({file:URL.createObjectURL(I),file_type:I.type,file_name:I.name,file_sha1:F.sha1,created_by:o,fields_revision:O,submitted_at:d,field_identifier:P});r.push(g);const v={uuid:g.uuid,file_name:I.name,field_identifier:P,file_extension:F.extension,file_sha1:F.sha1,fields_revision:O};h.push(v)}this.dispatch(n(r));const y=this.enqueueRequest({description:T(p.POST,this.name,!0),method:p.POST,url:`${this.url}/bulk/`,payload:{submitted_at:d,attachments:h,files:Object.values(l)},blockers:r.map(S=>S.fields_revision),blocks:r.map(S=>S.uuid)});return y.then(S=>{this.client.files.processPresignedUrls(S.presigned_urls),this.dispatch(a(S.attachments))}).catch(()=>{this.dispatch(c(r.map(S=>S.uuid)))}),[r,y.then(({attachments:S})=>S)]}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 MM extends k{constructor(){super(...arguments);m(this,"name","Asset Procedure Step Fields");m(this,"url","/asset-procedure-step-fields");m(this,"actions",{addOne:xd,addMany:el,setOne:tl,setMany:sl,updateOne:il,updateMany:nl,deleteOne:al,deleteMany:cl,initialize:Xd});m(this,"selectors",{selectById:rl,selectByIds:dl})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(r),blockers:[r.asset_procedure_step],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(f=>{throw this.dispatch(d(r.uuid)),f}),[r,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 o=this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.PATCH,url:`${this.url}/${c.uuid}/`,payload:e,blockers:[c.uuid],blocks:[c.uuid]});return o.then(l=>{this.dispatch(a(l))}).catch(l=>{throw this.dispatch(a(c)),l}),[d,o]}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(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(o){throw this.dispatch(c(d)),o}}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 kM extends k{constructor(){super(...arguments);m(this,"name","Asset Procedure Step Field Values Attachment");m(this,"url","/asset-procedure-step-field-values-attachments");m(this,"actions",{addOne:hl,addMany:Ys,setOne:pl,setMany:ml,updateOne:yl,updateMany:fl,deleteOne:Sl,deleteMany:Zs,initialize:ul});m(this,"selectors",{selectById:wl,selectByIds:Tl})}async bulkAdd(e,n){var S;const{addMany:a,setMany:c,deleteMany:d}=this.actions,o=new Date().toISOString(),l=((S=this.client.store.getState().userReducer.currentUser)==null?void 0:S.id)??null,r=pt(e,Math.min(n??e.length,U)),h=[],y=[];for(const O of r){const P={},I=[];for(const F of O){const{fieldValuesUuid:g,fieldIdentifier:v,file:V}=F,W=await this.client.files.getFilePayload(V);W.sha1 in P||(P[W.sha1]=W);const C=_({file:URL.createObjectURL(V),file_type:V.type,file_name:V.name,file_sha1:W.sha1,created_by:l,field_values:g,submitted_at:o,field_identifier:v});h.push(C);const q={uuid:C.uuid,file_name:V.name,file_sha1:W.sha1,file_extension:W.extension,field_identifier:v,field_values:g};I.push(q)}y.push({submitted_at:o,attachments:I,files:Object.values(P)})}this.dispatch(a(h));const f=y.map(O=>this.enqueueRequest({description:T(p.POST,this.name,!0),method:p.POST,url:`${this.url}/bulk/`,payload:O,blockers:O.attachments.map(P=>P.field_values),blocks:O.attachments.map(P=>P.uuid)}));return Promise.all(f).then(O=>{for(const I of O)this.client.files.processPresignedUrls(I.presigned_urls);const P=O.flatMap(I=>I.attachments);this.dispatch(c(P))}).catch(O=>{throw this.dispatch(d(h.map(P=>P.uuid))),O}),[h,f.map(O=>O.then(({attachments:P})=>P))]}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:d}=this.selectors,o=n.getState(),l=d(e)(o);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!0),method:p.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:{field_values__asset_procedure__project:e,latest:!0}},n)).flat();return this.dispatch(a(d)),d}}class vM extends k{constructor(){super(...arguments);m(this,"name","Asset Procedure Step Field Values");m(this,"url","/asset-procedure-step-field-values");m(this,"actions",{addOne:gl,addMany:bl,setOne:_l,setMany:Rl,updateOne:Ml,updateMany:kl,deleteOne:vl,deleteMany:El,initialize:Pl});m(this,"selectors",{selectById:Wl,selectByIds:Bl})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,r=new Date().toISOString(),h=_({...e,created_by:l,submitted_at:r}),y=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(h),blockers:[e.asset,e.fields_revision,e.asset_procedure],blocks:[h.uuid]});return this.dispatch(a(h)),y.then(S=>{this.dispatch(c(S))}).catch(()=>{this.dispatch(d(h.uuid))}),[h,y]}bulkAdd(e,n){var P;const{payloads:a,values:c}=e,{addMany:d,setMany:o,deleteMany:l}=this.actions,r=new Date().toISOString(),h=((P=this.client.store.getState().userReducer.currentUser)==null?void 0:P.id)??null,y=[],f=pt(a,Math.min(n??a.length,U)),S=[];for(const I of f){const F=[];for(const g of I){const v=_({...g,values:g.values,created_by:h,submitted_at:r});y.push(v),F.push({uuid:v.uuid,asset:g.asset,fields_revision:g.fields_revision,asset_procedure:g.asset_procedure,asset_procedure_step:g.asset_procedure_step,published_at:g.published_at,values:v.values})}S.push({submitted_at:r,values:c,field_values:F})}this.dispatch(d(y));const O=[];for(const I of S){const{field_values:F}=I,g=F.map(({asset:q})=>q),v=F.map(({fields_revision:q})=>q),V=F.map(({asset_procedure:q})=>q),W=F.map(({uuid:q})=>q),C=this.enqueueRequest({description:T(p.POST,this.name,!0),method:p.POST,url:`${this.url}/bulk/`,payload:I,blockers:g.concat(v).concat(V),blocks:W});O.push(C)}return Promise.all(O).then(I=>{this.dispatch(o(I.flat()))}).catch(()=>{this.dispatch(l(B(y)))}),[y,O]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=n.getState(),o=c(e.uuid)(d);if(!o)throw new Error(`Expected AssetProcedureStepFieldValues with uuid ${e.uuid} to exist`);const l={...o,...e};this.dispatch(a(l));const r=this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[l.fields_revision,l.asset,l.asset_procedure],blocks:[l.uuid]});return r.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(a(o))}),[l,r]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected submission with uuid ${e} to exist`);const r=Ol(e)(o);this.dispatch(a(e)),this.dispatch(Zs(B(r)));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(h){throw this.dispatch(c(l)),this.dispatch(Ys(r)),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 EM extends k{constructor(){super(...arguments);m(this,"name","Asset Procedure Step");m(this,"url","/asset-procedure-steps");m(this,"actions",{addOne:$l,addMany:Ul,setOne:jl,setMany:Dl,updateOne:Ll,updateMany:Nl,deleteOne:Hl,deleteMany:Gl,initialize:Cl});m(this,"selectors",{selectById:Yl,selectByIds:Zl})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(r),blockers:[r.asset_procedure_type],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,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 o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.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 l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteMany:a,addMany:c,addOne:d,deleteOne:o}=this.actions,{selectById:l}=this.selectors,r=n.getState(),h=l(e)(r);if(!h)throw new Error(`No asset procedure step with uuid ${e} found in the store`);const y=Jl(e)(r);this.dispatch(o(e)),this.dispatch(a(B(y)));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(f){throw this.dispatch(d(h)),this.dispatch(c(y)),f}}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 k{constructor(){super(...arguments);m(this,"url","/assets");m(this,"name","Asset");m(this,"actions",{addOne:xl,addMany:ti,setOne:io,setMany:no,updateOne:eo,updateMany:to,deleteOne:so,deleteMany:si,initialize:Xl});m(this,"selectors",{selectById:ro,selectByIds:lo})}add(e){var y;const{store:n}=this.client,{addOne:a,updateOne:c,deleteOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(r),blockers:[r.asset_type],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,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 o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{addOne:a,deleteOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`No asset with uuid ${e} found in the store`);const r=Kc(e)(o),h=Of(e)(o);this.dispatch(c(e)),this.dispatch(bs(B(r))),this.dispatch(Zt(B(h)));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(y){throw this.dispatch(a(l)),this.dispatch(gs(r)),this.dispatch(Yt(h)),y}}bulkAdd(e,n){const{addMany:a}=this.actions,c=new Date().toISOString(),d=mt.v4(),o=pt(e,Math.min(n??e.length,U)).map(h=>{const y=h.map(f=>_(f));return{batchId:mt.v4(),payload:{transaction_id:d,submitted_at:c,assets:y}}}),l=[];let r=null;for(const h of o){const{batchId:y,payload:f}=h,S=f.assets.map(({uuid:g})=>g),O=f.assets.map(({asset_type:g})=>g),P=f.assets.map(({project:g})=>g),I=f.assets.map(({status:g})=>g),F=this.enqueueRequest({description:T(p.POST,this.name,!0),method:p.POST,url:`${this.url}/bulk/`,payload:f,blockers:(r?[r]:[]).concat(O).concat(P).concat(I),blocks:[y].concat(S)});r=h.batchId,l.push(F)}return Promise.all(l).then(h=>{const y=h.flat();this.dispatch(a(y))}),l}bulkUpdate(e,n){const{store:a}=this.client,{updateMany:c}=this.actions,{selectByIds:d}=this.selectors,o=B(e).toSorted(Wt);if(o.length!==e.length)throw new Error("payloads contains duplicate uuids.");const l=d(o)(a.getState()).toSorted(Os);if(o.length!=l.length)throw new Error(`Attempting to bulk update ${o.length-l.length} assets that dont exist in the store`);const r=[];for(let S=0;S<o.length;S++)r.push({...l[S],...e[S]});this.dispatch(c(r));const h=pt(e,Math.min(n??e.length,U)),y=[];let f=null;for(const S of h){const O=mt.v4(),P=B(S),I=S.map(({status:g})=>g).filter(Boolean),F=this.enqueueRequest({description:T(p.PATCH,this.name,!0),method:p.PATCH,url:`${this.url}/bulk/`,payload:{payloads:S},blockers:(f?[f]:[]).concat(P).concat(I),blocks:[O].concat(P)});y.push(F),f=O}return Promise.all(y).then(S=>{this.dispatch(c(S.flat()))}).catch(()=>{this.dispatch(c(l))}),[r,y]}async bulkDelete(e){const{store:n}=this.client,{addMany:a,deleteMany:c}=this.actions,{selectByIds:d}=this.selectors,o=n.getState(),l=d(e)(o);this.dispatch(c(e));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!0),method:p.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(r){throw this.dispatch(a(l)),r}}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 WM extends k{constructor(){super(...arguments);m(this,"name","Asset Stage Completion");m(this,"url","/asset-stage-completions");m(this,"actions",{addOne:po,addMany:mo,setOne:yo,setMany:fo,updateOne:So,updateMany:Ao,deleteOne:wo,deleteMany:To,initialize:ho});m(this,"selectors",{selectById:Po,selectByIds:go})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(r),blockers:[e.asset,e.asset_stage],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,h]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=d(e)(n.getState());if(!o)throw new Error(`Expected asset stage completion with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(o)),l}}bulkAdd(e){var S;const{store:n}=this.client,{addMany:a,setMany:c,deleteMany:d}=this.actions,o=new Date().toISOString(),l=((S=n.getState().userReducer.currentUser)==null?void 0:S.id)??null,r=e.map(O=>_(O)),h=r.map(O=>({...O,created_by:l,submitted_at:o})),y=h.map(({uuid:O})=>O);this.dispatch(a(h));const f=this.enqueueRequest({description:T(p.POST,this.name,!0),method:p.POST,url:`${this.url}/bulk/`,payload:{submitted_at:o,completions:r},blockers:[...e.map(O=>O.asset_procedure),...e.map(O=>O.asset_stage),...e.map(O=>O.asset)],blocks:y});return f.then(O=>{this.dispatch(c(O))}).catch(()=>{this.dispatch(d(y))}),[h,f]}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:d}=this.selectors,o=d(e)(n.getState());this.dispatch(a(e));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!0),method:p.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(l){throw this.dispatch(c(o)),l}}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 BM extends k{constructor(){super(...arguments);m(this,"name","Asset Stage");m(this,"url","/asset-stages");m(this,"actions",{addOne:ko,addMany:vo,setOne:Ro,setMany:Mo,updateOne:Eo,updateMany:Vo,deleteOne:Wo,deleteMany:Bo,initialize:_o});m(this,"selectors",{selectById:qo,selectByIds:Co})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(r),blockers:[r.asset_procedure_type],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,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 o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.PATCH,url:`${this.url}/${d.uuid}/`,payload:e,blockers:[d.uuid],blocks:[d.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);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:T(p.DELETE,this.name,!1),method:p.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_procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class zM extends L{constructor(){super(...arguments);m(this,"name","Asset Type Attachment");m(this,"url","/asset-type-attachments");m(this,"actions",{addOne:$o,addMany:di,setOne:Uo,setMany:Lo,updateOne:No,updateMany:Ho,deleteOne:Go,deleteMany:li,initialize:Do});m(this,"selectors",{selectById:Yo,selectByIds:Zo})}getId(e){return e.uuid}buildModel(e){return _({file:URL.createObjectURL(e.file),file_sha1:e.file_sha1,created_by:e.created_by,file_name:e.file.name,file_type:e.file.type,submitted_at:e.submitted_at,asset_type:e.modelUuid})}buildPayload(e,n){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:n.extension,asset_type:e.asset_type}}async bulkAdd(e){return this._bulkAdd(e.map(n=>({modelUuid:n.assetTypeUuid,file:n.file})))}async delete(e){return this._delete(e)}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 k{constructor(){super(...arguments);m(this,"name","Asset Type Fields Attachment");m(this,"url","/asset-type-fields-attachments");m(this,"actions",{addOne:eu,addMany:tu,setOne:su,setMany:iu,updateOne:nu,updateMany:au,deleteOne:cu,deleteMany:ru,initialize:xo});m(this,"selectors",{selectById:lu,selectByIds:ou})}async bulkAdd(e){var f;const{addMany:n,setMany:a,deleteMany:c}=this.actions,d=new Date().toISOString(),o=((f=this.client.store.getState().userReducer.currentUser)==null?void 0:f.id)??null,l={},r=[],h=[];for(const S of e){const{fieldsRevisionUuid:O,fieldIdentifier:P,file:I}=S,F=await this.client.files.getFilePayload(I);F.sha1 in l||(l[F.sha1]=F);const g=_({file:URL.createObjectURL(I),file_type:I.type,file_name:I.name,file_sha1:F.sha1,created_by:o,fields_revision:O,submitted_at:d,field_identifier:P});r.push(g);const v={uuid:g.uuid,file_name:I.name,field_identifier:P,file_extension:F.extension,file_sha1:F.sha1,fields_revision:O};h.push(v)}this.dispatch(n(r));const y=this.enqueueRequest({description:T(p.POST,this.name,!0),method:p.POST,url:`${this.url}/bulk/`,payload:{submitted_at:d,attachments:h,files:Object.values(l)},blockers:r.map(S=>S.fields_revision),blocks:r.map(S=>S.uuid)});return y.then(S=>{this.client.files.processPresignedUrls(S.presigned_urls),this.dispatch(a(S.attachments))}).catch(()=>{this.dispatch(c(r.map(S=>S.uuid)))}),[r,y.then(({attachments:S})=>S)]}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 CM extends k{constructor(){super(...arguments);m(this,"name","Asset Type Fields");m(this,"url","/asset-type-fields");m(this,"actions",{addOne:mu,addMany:yu,setOne:fu,setMany:Su,updateOne:Au,updateMany:wu,deleteOne:Tu,deleteMany:Ou,initialize:pu});m(this,"selectors",{selectById:Fu,selectByIds:Pu})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(r),blockers:[r.asset_type],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(f=>{throw this.dispatch(d(r.uuid)),f}),[r,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 jM extends k{constructor(){super(...arguments);m(this,"name","Asset Type Field Values Attachment");m(this,"url","/asset-type-field-values-attachments");m(this,"actions",{addOne:Ru,addMany:yi,setOne:Mu,setMany:ku,updateOne:vu,updateMany:Eu,deleteOne:Vu,deleteMany:fi,initialize:_u});m(this,"selectors",{selectById:Bu,selectByIds:zu})}async bulkAdd(e,n){var S;const{addMany:a,setMany:c,deleteMany:d}=this.actions,o=new Date().toISOString(),l=((S=this.client.store.getState().userReducer.currentUser)==null?void 0:S.id)??null,r=pt(e,Math.min(n??e.length,U)),h=[],y=[];for(const O of r){const P={},I=[];for(const F of O){const{fieldValuesUuid:g,fieldIdentifier:v,file:V}=F,W=await this.client.files.getFilePayload(V);W.sha1 in P||(P[W.sha1]=W);const C=_({file:URL.createObjectURL(V),file_type:V.type,file_name:V.name,file_sha1:W.sha1,created_by:l,field_values:g,submitted_at:o,field_identifier:v});h.push(C);const q={uuid:C.uuid,file_name:V.name,file_sha1:W.sha1,file_extension:W.extension,field_identifier:v,field_values:g};I.push(q)}y.push({submitted_at:o,attachments:I,files:Object.values(P)})}this.dispatch(a(h));const f=y.map(O=>this.enqueueRequest({description:T(p.POST,this.name,!0),method:p.POST,url:`${this.url}/bulk/`,payload:O,blockers:O.attachments.map(P=>P.field_values),blocks:O.attachments.map(P=>P.uuid)}));return Promise.all(f).then(O=>{for(const I of O)this.client.files.processPresignedUrls(I.presigned_urls);const P=O.flatMap(I=>I.attachments);this.dispatch(c(P))}).catch(O=>{throw this.dispatch(d(h.map(P=>P.uuid))),O}),[h,f.map(O=>O.then(({attachments:P})=>P))]}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:d}=this.selectors,o=n.getState(),l=d(e)(o);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!0),method:p.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:{field_values__asset__project:e,latest:!0}},n)).flat();return this.dispatch(a(d)),d}}class DM extends k{constructor(){super(...arguments);m(this,"name","Asset Type Field Values");m(this,"url","/asset-type-field-values");m(this,"actions",{addOne:$u,addMany:Uu,setOne:Lu,setMany:Nu,updateOne:Hu,updateMany:Gu,deleteOne:Ku,deleteMany:Yu,initialize:Du});m(this,"selectors",{selectById:Ju,selectByIds:Qu})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,r=new Date().toISOString(),h=_({...e,created_by:l,submitted_at:r}),y=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(h),blockers:[e.asset,e.fields_revision],blocks:[h.uuid]});return this.dispatch(a(h)),y.then(S=>{this.dispatch(c(S))}).catch(()=>{this.dispatch(d(h.uuid))}),[h,y]}bulkAdd(e,n){var O;const{payloads:a,values:c}=e,{addMany:d,setMany:o,deleteMany:l}=this.actions,r=new Date().toISOString(),h=[],y=pt(a,Math.min(n??a.length,U)),f=[];for(const P of y){const I=[];for(const F of P){const g=_({...F,values:F.values,created_by:((O=this.client.store.getState().userReducer.currentUser)==null?void 0:O.id)??null,submitted_at:r});h.push(g),I.push({uuid:g.uuid,asset:F.asset,fields_revision:F.fields_revision,published_at:F.published_at,values:g.values})}f.push({submitted_at:r,values:c,field_values:I})}this.dispatch(d(h));const S=[];for(const P of f){const{field_values:I}=P,F=I.map(({asset:W})=>W),g=I.map(({fields_revision:W})=>W),v=I.map(({uuid:W})=>W),V=this.enqueueRequest({description:T(p.POST,this.name,!0),method:p.POST,url:`${this.url}/bulk/`,payload:P,blockers:F.concat(g),blocks:v});S.push(V)}return Promise.all(S).then(P=>{this.dispatch(o(P.flat()))}).catch(()=>{this.dispatch(l(B(h)))}),[h,S]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=n.getState(),o=c(e.uuid)(d);if(!o)throw new Error(`Expected AssetTypeFieldValues with uuid ${e.uuid} to exist`);const l={...o,...e};this.dispatch(a(l));const r=this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[l.uuid,l.fields_revision,l.asset],blocks:[l.uuid]});return r.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(a(o))}),[l,r]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected submission with uuid ${e} to exist`);const r=qu(e)(o);this.dispatch(a(e)),this.dispatch(fi(B(r)));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(h){throw this.dispatch(c(l)),this.dispatch(yi(r)),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 $M extends k{constructor(){super(...arguments);m(this,"name","Asset Type Identifier");m(this,"url","/asset-type-identifiers");m(this,"actions",{addOne:th,addMany:sh,setOne:ih,setMany:nh,updateOne:ah,updateMany:ch,deleteOne:rh,deleteMany:dh,initialize:eh});m(this,"selectors",{selectById:oh,selectByIds:uh})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(r),blockers:[r.asset_type],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,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 o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected asset type identifier with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.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 UM extends k{constructor(){super(...arguments);m(this,"name","Asset Type Identifier Value");m(this,"url","/asset-type-identifier-values");m(this,"actions",{addOne:yh,addMany:fh,setOne:Sh,setMany:Ah,updateOne:wh,updateMany:Th,deleteOne:Oh,deleteMany:Ih,initialize:mh});m(this,"selectors",{selectById:Ph,selectByIds:gh})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(r),blockers:[e.asset,e.asset_type_identifier],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,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 value with uuid ${e.uuid} to exist`);const o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);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:T(p.DELETE,this.name,!1),method:p.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:{asset__project:e}},n)).flat();return this.dispatch(a(d)),d}}class LM extends k{constructor(){super(...arguments);m(this,"name","Asset Type");m(this,"url","/asset-types");m(this,"actions",{addOne:vh,addMany:Eh,setOne:Mh,setMany:kh,updateOne:Vh,updateMany:Wh,deleteOne:Bh,deleteMany:zh,initialize:Rh});m(this,"selectors",{selectById:Ch,selectByIds:jh})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(r),blockers:[],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,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 o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[d.uuid],blocks:[d.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected asset type with uuid ${e} to exist`);const r=co(e)(o),h=Jo(e)(o);this.dispatch(a(e)),this.dispatch(si(B(r))),this.dispatch(li(B(h)));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(y){throw this.dispatch(c(l)),this.dispatch(ti(r)),this.dispatch(di(h)),y}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class NM extends k{constructor(){super(...arguments);m(this,"name","Asset Type Status");m(this,"url","/asset-type-statuses");m(this,"actions",{addOne:Lh,addMany:Nh,setOne:Hh,setMany:Gh,updateOne:Kh,updateMany:Yh,deleteOne:Zh,deleteMany:Jh,initialize:Uh});m(this,"selectors",{selectById:Xh,selectByIds:xh})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(r),blockers:[e.asset_type],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,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 o={...d,...e};this.dispatch(n(o));const l=this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(r=>{this.dispatch(n(r))}).catch(()=>{this.dispatch(n(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=d(e)(n.getState());if(!o)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(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(o)),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 HM extends k{constructor(){super(...arguments);m(this,"name","Category");m(this,"url","/categories");m(this,"actions",{addOne:cp,addMany:rp,setOne:dp,setMany:lp,updateOne:op,updateMany:up,deleteOne:hp,deleteMany:pp,initialize:ap});m(this,"selectors",{selectById:Ri,selectByIds:yp})}add(e){var y;const{store:n}=this.client,{addOne:a,updateOne:c,deleteOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(r),blockers:[e.project],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,h]}update(e){const{updateOne: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 category with uuid ${e.uuid}`);const o={...d,...e};this.dispatch(n(o));const l=this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(r=>{this.dispatch(n(r))}).catch(()=>{this.dispatch(n(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=d(e)(n.getState());if(!o)throw new Error(`No category with uuid ${e} found in the store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${o.uuid}/`,blockers:[o.uuid],blocks:[]})}catch(l){throw this.dispatch(c(o)),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 GM extends L{constructor(){super(...arguments);m(this,"name","Document Attachment");m(this,"url","/document-attachments");m(this,"actions",{addOne:wp,addMany:Tp,setOne:Op,setMany:Ip,updateOne:Fp,updateMany:Pp,deleteOne:gp,deleteMany:bp,initialize:Ap});m(this,"selectors",{selectById:Rp,selectByIds:Mp})}getId(e){return e.uuid}buildModel(e){return _({file:URL.createObjectURL(e.file),file_sha1:e.file_sha1,created_by:e.created_by,file_name:e.file.name,file_type:e.file.type,submitted_at:e.submitted_at,document:e.modelUuid})}buildPayload(e,n){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:n.extension,document:e.document}}async bulkAdd(e){var O;const{store:n}=this.client,{addMany:a,updateMany:c,deleteMany:d}=this.actions,o=((O=n.getState().userReducer.currentUser)==null?void 0:O.id)??null,l=new Date().toISOString(),r=[],h=[],y={},f={};for(const P of e){const{documentUuid:I,file:F}=P,g=await this.client.files.getFilePayload(F);g.sha1 in y||(y[g.sha1]=g,f[g.sha1]=[]);const v=this.buildModel({file:F,file_sha1:g.sha1,submitted_at:l,created_by:o,modelUuid:I});r.push(v),h.push(this.buildPayload(v,g)),f[g.sha1].push(v.uuid)}this.dispatch(a(r));const S=this.enqueueRequest({description:T(p.POST,this.name,!0),method:p.POST,url:`${this.url}/bulk/`,payload:{submitted_at:l,attachments:h,files:Object.values(y)},blocks:r.map(P=>P.uuid),blockers:r.map(P=>P.file_sha1)});return S.then(({attachments:P,presigned_urls:I})=>{this.dispatch(c(P));const F=this.client.files.processPresignedUrls(I);for(const[g,v]of Object.entries(F))v.then(()=>{const V=f[g];for(const W of V)this.makeReadable(W)})}).catch(()=>{this.dispatch(d(r.map(P=>P.uuid)))}),[r,S.then(({attachments:P})=>P)]}async delete(e){return this._delete(e)}makeReadable(e){this.enqueueRequest({description:"Add attachment to AI assistant",method:p.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),l=(await Promise.all([c,d])).flat();return this.dispatch(a(l)),l}}class KM extends k{constructor(){super(...arguments);m(this,"name","Document");m(this,"url","/documents");m(this,"actions",{addOne:Vp,addMany:Wp,setOne:Bp,setMany:zp,updateOne:qp,updateMany:Cp,deleteOne:jp,deleteMany:Dp,initialize:Ep});m(this,"selectors",{selectById:Up,selectByIds:Lp})}add(e){var y;const{store:n}=this.client,{addOne:a,deleteOne:c,updateOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(r),blockers:r.parent_document?[r.parent_document]:[],blocks:[r.uuid]});return h.then(f=>{this.dispatch(d(f))}).catch(()=>{this.dispatch(c(r.uuid))}),[r,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 o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c,addMany:d,deleteMany:o}=this.actions,{selectById:l}=this.selectors,r=n.getState(),h=l(e)(r);if(!h)throw new Error(`attempting to delete a document with uuid ${e} that does not exist in store.documents`);const y=Np(e)(r);this.dispatch(a(e)),this.dispatch(o(B(y)));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(f){throw this.dispatch(c(h)),this.dispatch(d(y)),f}}async refreshStore(e,n){const{initialize:a}=this.actions,c=this.list({queryParams:{project__organization:e}},n),d=this.list({queryParams:{organization:e}},n),l=(await Promise.all([c,d])).flat();return this.dispatch(a(l)),l}}class Tt extends yt{async get(s,e){return this.performRequest({url:`${this.url}/${s}/`,method:p.GET},e)}async list(s,e){return this.performRequest({url:`${this.url}/`,method:p.GET,...s},e)}async listPaginated(s,e){return this.performPagination({url:`${this.url}/`,method:p.GET,...s},e)}}class YM extends Tt{constructor(){super(...arguments);m(this,"name","Email Domains");m(this,"url","/organization-email-domains");m(this,"actions",{addOne:Kp,addMany:Yp,setOne:Zp,setMany:Jp,updateOne:Qp,updateMany:Xp,deleteOne:xp,deleteMany:em,initialize:Gp});m(this,"selectors",{selectById:sm,selectByIds:im})}async add(e,n){return this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.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(p.DELETE,this.name,!1),method:p.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 ZM extends yt{async getVerificationCode(s){return this.enqueueRequest({description:"Get verification code",method:p.GET,url:`/verification/email-verification/${s}/`,isAuthNeeded:!1,blockers:[],blocks:[]})}validateVerificationCode(s,e=void 0){return this.enqueueRequest({description:"Validate verification code",method:p.POST,url:`/verification/email-verification/${s}/`,isAuthNeeded:!1,payload:e,blockers:[],blocks:[]})}}const ps={},sc=new Set;let ms=0,ic=0,nc=0;const JM=20;class QM extends yt{constructor(){super(...arguments);m(this,"host");m(this,"_dbPromise",Eb.openDB("fileCache",1,{upgrade(e){e.createObjectStore("files")}}))}async renewUploadUrl(e){const n=await this.fetchCache(e);if(!n)throw new Error(`File with sha1 ${e} not found in cache`);const a=await Ts(n,e),c=await this.enqueueRequest({description:"Get S3 URL",method:p.GET,url:"/authentication/files/presigned-upload-url/",queryParams:{sha1:await At(n),file_type:n.type,extension:n.name.split(".").pop(),size:n.size.toString()},blockers:[],blocks:[`s3-${a}`]});return"url"in c&&this.dispatch(rm({sha1:e,...c})),c}async addCache(e,n){if(sc.has(n))return;if(!e.type){const d=e.name.split("."),o=d[d.length-1];e=new File([e],e.name,{type:o})}if(!e.name||!e.size||!e.type)throw new Error("Cannot add files to cache that do not have a name, size and type.");const a=await this._dbPromise;!!await a.get("files",n)?(console.error("File already cached (this is unexpected at this point):",e.name,n),ms++):(await a.put("files",e,n),ic++),sc.add(n),nc++,nc%JM===0&&console.debug(`File cache summary: ${ms} hits and ${ic} misses, ${ms/(ms+ic)*100}% hit rate over ${nc} calls to addCache.`)}async removeCache(e){await(await this._dbPromise).delete("files",e),sc.delete(e)}async fetchCache(e){return(await this._dbPromise).get("files",e)}async getOrRenewUploadUrl(e){const n=this.client.store.getState();return dm(e)(n)??await this.renewUploadUrl(e)}async uploadFileToS3(e){const n=await this.fetchCache(e);if(!n)throw new Error(`File with sha1 ${e} not found in cache`);const a=await Ts(n,e),c={file_name:n.name,file_sha1:e,file:a},d=await this.getOrRenewUploadUrl(e);if("warning"in d){if(d.warning==="already_uploaded")return[c,Promise.resolve(void 0)];throw new Error(d.warning)}const o=d.url,l=this.enqueueRequest({url:o,description:"Upload file",method:p.POST,isExternalUrl:!0,isAuthNeeded:!1,attachmentHash:e,blockers:[`s3-${a}`],blocks:[e],s3url:d});return[c,l]}async fetchFileFromUrl(e,n,a){const c=e.split("?")[0]??e,d=await this.fetchCache(n);if(d){if(!d.name)throw new Error("Cached file unexpectedly has no name.");return d}if(e.startsWith("blob:")){const h=await Oc(e),y=new File([h],a??n,{type:h.type});return await this.addCache(y,n),y}let o=ps[c],l=!0;o?l=!1:(o=new Promise(h=>{this.enqueueRequest({description:"Download file",method:p.GET,url:e,isExternalUrl:!0,isResponseBlob:!0,isAuthNeeded:!1,blockers:[n],blocks:[n]}).then(y=>{const f=new File([y],a??n,{type:y.type});h(f)})}),ps[c]=o);let r;try{r=await o}catch(h){throw l&&h instanceof D&&delete ps[c],h}if(l){const h=await At(r);if(h!==n){const S=`The hash of the file returned from the server (${h}) does not match the
|
|
9
9
|
expected hash (${n}). This can happen if you're using a local development server and the
|
|
10
10
|
isExternalUrl flag in the request details is set to true, because instead of requesting the local
|
|
11
11
|
REST API, you will be requesting localhost:80 (where this app runs), resulting in a transformed blob
|
|
12
12
|
(with an uuid attached) being returned. Alternatively, you may be running with
|
|
13
13
|
import.meta.env.PROD, which will result in some file requests being treated as
|
|
14
|
-
external URLs and therefore not prepended with VITE_API_URL.`;throw new Error(A)}const y=r.type.split("/")[1];if(!y)throw new Error("File has no extension");const f=a??h+"."+y;if(r=dc(r,f),!r.name)throw new Error("Failed to set file's name");await this.addCache(r,h),ls[c]=new Promise(A=>{A(r)})}return r}processPresignedUrls(e){const n={};for(const[a,c]of Object.entries(e))n[a]=this.enqueueRequest({url:c.url,description:"Upload file to S3",method:m.POST,isExternalUrl:!0,isAuthNeeded:!1,attachmentHash:a,blockers:[`s3-${c.fields.key}`],blocks:[a],s3url:c});return n}async getFilePayload(e){const n=await ft(e),a={sha1:n,file_type:e.type,extension:e.name.split(".").pop(),size:e.size};return await this.client.files.addCache(e,n),a}}class hR extends k{constructor(){super(...arguments);p(this,"name","Form Identifier");p(this,"url","/form-identifiers");p(this,"actions",{addOne:ep,addMany:tp,setOne:sp,setMany:ip,updateOne:np,updateMany:ap,deleteOne:cp,deleteMany:rp,initialize:xm});p(this,"selectors",{selectById:lp,selectByIds:op})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:w(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(r),blockers:[r.form],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,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 o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:w(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected form identifier with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(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:{form__organization:e}},n);return this.dispatch(a(c)),c}}class mR extends k{constructor(){super(...arguments);p(this,"name","Form Identifier Value");p(this,"url","/form-identifier-values");p(this,"actions",{addOne:pp,addMany:yp,setOne:fp,setMany:Ap,updateOne:Sp,updateMany:Tp,deleteOne:wp,deleteMany:Op,initialize:mp});p(this,"selectors",{selectById:Fp,selectByIds:Pp})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:w(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(r),blockers:[e.form_submission,e.form_identifier],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,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 value with uuid ${e.uuid} to exist`);const o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:w(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);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(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:{form_submission__form_revision__form__organization:e}},n)).flat();return this.dispatch(a(d)),d}}class pR extends k{constructor(){super(...arguments);p(this,"name","Form Revision Attachment");p(this,"url","/form-revision-attachments");p(this,"actions",{addOne:Mp,addMany:Rp,setOne:kp,setMany:vp,updateOne:Ep,updateMany:Vp,deleteOne:Bp,deleteMany:zp,initialize:_p});p(this,"selectors",{selectById:qp,selectByIds:Cp})}async bulkAdd(e){var f;const{addMany:n,setMany:a,deleteMany:c}=this.actions,d=new Date().toISOString(),o=((f=this.client.store.getState().userReducer.currentUser)==null?void 0:f.id)??null,l={},r=[],h=[];for(const A of e){const{revisionUuid:O,fieldIdentifier:P,file:I}=A,F=await this.client.files.getFilePayload(I);F.sha1 in l||(l[F.sha1]=F);const g=_({file:URL.createObjectURL(I),file_type:I.type,file_name:I.name,file_sha1:F.sha1,created_by:o,form_revision:O,submitted_at:d,field_identifier:P});r.push(g);const v={uuid:g.uuid,file_name:I.name,field_identifier:P,file_extension:F.extension,file_sha1:F.sha1,form_revision:O};h.push(v)}this.dispatch(n(r));const y=this.enqueueRequest({description:w(m.POST,this.name,!0),method:m.POST,url:`${this.url}/bulk/`,payload:{submitted_at:d,attachments:h,files:Object.values(l)},blockers:r.map(A=>A.form_revision),blocks:r.map(A=>A.uuid)});return y.then(A=>{this.client.files.processPresignedUrls(A.presigned_urls),this.dispatch(a(A.attachments))}).catch(()=>{this.dispatch(c(r.map(A=>A.uuid)))}),[r,y.then(({attachments:A})=>A)]}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 yR extends k{constructor(){super(...arguments);p(this,"name","Form Revision");p(this,"url","/form-revisions");p(this,"actions",{addOne:qi,addMany:Ci,setOne:Up,setMany:Lp,updateOne:Np,updateMany:Hp,deleteOne:ji,deleteMany:$i,initialize:Dp});p(this,"selectors",{selectById:Gp,selectByIds:Kp})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,r=new Date().toISOString(),h=_({...e,created_by:l,submitted_at:r});this.dispatch(a(h));const y=this.enqueueRequest({description:w(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(h),blockers:[e.form],blocks:[h.uuid]});return y.then(A=>{this.dispatch(c(A))}).catch(()=>{this.dispatch(d(h.uuid))}),[h,y]}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 fR extends k{constructor(){super(...arguments);p(this,"name","Form");p(this,"url","/forms");p(this,"actions",{addOne:Qp,addMany:xp,setOne:ey,setMany:ty,updateOne:sy,updateMany:iy,deleteOne:ny,deleteMany:ay,initialize:Xp});p(this,"selectors",{selectById:dy,selectByIds:ly})}add(e,n){var f;const{store:a}=this.client,{addOne:c,deleteOne:d}=this.actions,o=new Date().toISOString(),l=((f=a.getState().userReducer.currentUser)==null?void 0:f.id)??null,r=_({...e,submitted_at:o,created_by:l}),h=_({...n,form:r.uuid,submitted_at:o,created_by:l});this.dispatch(c(r)),this.dispatch(qi(h));const y=this.enqueueRequest({description:w(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:{...E(r),initial_revision:{uuid:h.uuid,submitted_at:h.submitted_at,title:h.title,description:h.description,fields:h.fields}},blockers:[],blocks:[r.uuid,h.uuid]});return y.catch(A=>{throw this.dispatch(d(r.uuid)),this.dispatch(ji(h.uuid)),A}),[r,h,y]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error("Expected form to exist");const r=Vy(e)(o),h=Yp(e)(o);this.dispatch(a(e)),this.dispatch(Qi(z(r))),this.dispatch($i(z(h)));try{return await this.enqueueRequest({description:w(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(y){throw this.dispatch(c(l)),this.dispatch(Ci(h)),this.dispatch(Xi(r)),y}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class AR extends k{constructor(){super(...arguments);p(this,"name","Form Submission Attachment");p(this,"url","/form-submission-attachments");p(this,"actions",{addOne:hy,addMany:Hi,setOne:my,setMany:py,updateOne:yy,updateMany:fy,deleteOne:Ay,deleteMany:Gi,initialize:uy});p(this,"selectors",{selectById:Sy,selectByIds:Ty})}async bulkAdd(e){var f;const{addMany:n,setMany:a,deleteMany:c}=this.actions,d=new Date().toISOString(),o=((f=this.client.store.getState().userReducer.currentUser)==null?void 0:f.id)??null,l={},r=[],h=[];for(const A of e){const{submissionUuid:O,fieldIdentifier:P,file:I}=A,F=await this.client.files.getFilePayload(I);F.sha1 in l||(l[F.sha1]=F);const g=_({file:URL.createObjectURL(I),file_type:I.type,file_name:I.name,file_sha1:F.sha1,created_by:o,form_submission:O,submitted_at:d,field_identifier:P});r.push(g);const v={uuid:g.uuid,file_name:I.name,file_sha1:F.sha1,file_extension:F.extension,field_identifier:P,form_submission:O};h.push(v)}this.dispatch(n(r));const y=this.enqueueRequest({description:w(m.POST,this.name,!0),method:m.POST,url:`${this.url}/bulk/`,payload:{submitted_at:d,attachments:h,files:Object.values(l)},blockers:r.map(A=>A.form_submission),blocks:r.map(A=>A.uuid)});return y.then(A=>{this.client.files.processPresignedUrls(A.presigned_urls),this.dispatch(a(A.attachments))}).catch(A=>{throw this.dispatch(c(r.map(O=>O.uuid))),A}),[r,y.then(({attachments:A})=>A)]}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,d=n.getState(),o=Zi(e)(d);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(m.DELETE,this.name,!0),method:m.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(l){throw this.dispatch(c(o)),l}}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 SR extends k{constructor(){super(...arguments);p(this,"name","Form Submission");p(this,"url","/form-submissions");p(this,"actions",{addOne:by,addMany:Xi,setOne:Py,setMany:gy,updateOne:_y,updateMany:My,deleteOne:Ry,deleteMany:Qi,initialize:Fy});p(this,"selectors",{selectById:vy,selectByIds:Ey})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,r=new Date().toISOString(),h=_({...e,created_by:l,submitted_at:r}),y=this.enqueueRequest({description:w(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)),y.then(A=>{this.dispatch(c(A))}).catch(()=>{this.dispatch(d(h.uuid))}),[h,y]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=n.getState(),o=c(e.uuid)(d);if(!o)throw new Error(`Expected submission with uuid ${e.uuid} to exist`);const l={...o,...e};this.dispatch(a(l));const r=this.enqueueRequest({description:w(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${l.uuid}/`,payload:e,blockers:[l.uuid],blocks:[l.uuid]});return r.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(a(o))}),[l,r]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected submission with uuid ${e} to exist`);const r=wy(e)(o);this.dispatch(a(e)),this.dispatch(Gi(z(r)));try{return await this.enqueueRequest({description:w(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(h){throw this.dispatch(c(l)),this.dispatch(Hi(r)),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 TR extends k{constructor(){super(...arguments);p(this,"name","Geo Image");p(this,"url","/geo-images");p(this,"actions",{addOne:jy,addMany:$y,setOne:qy,setMany:Cy,updateOne:Dy,updateMany:Uy,deleteOne:Ly,deleteMany:Ny,initialize:Wy});p(this,"selectors",{selectById:Gy,selectByIds:Ky})}async add(e){var P;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,{file:o,...l}=e,r=new Date().toISOString(),h=((P=n.getState().userReducer.currentUser)==null?void 0:P.id)??null,y=l.project,f=await this.client.files.getFilePayload(o),A=_({...l,file_name:o.name,file_sha1:f.sha1,file_type:o.type,file:URL.createObjectURL(o),submitted_at:r,created_by:h});this.dispatch(a(A));const O=this.enqueueRequest({description:w(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:{uuid:A.uuid,submitted_at:r,title:A.title,description:A.description,geo_marker:A.geo_marker,canvas_marker:A.canvas_marker,sha1:A.file_sha1,project:A.project,file_name:A.file_name,direction:A.direction,original_date:A.original_date,file:f},blocks:[y],blockers:[y]});return O.then(I=>{this.client.files.processPresignedUrls(I.presigned_urls),this.dispatch(c(I.geo_image))}).catch(()=>{this.dispatch(d(A.uuid))}),[A,O.then(I=>I.geo_image)]}async bulkAdd(e,n){var P;const{store:a}=this.client,{addMany:c,setMany:d,deleteMany:o}=this.actions,l=new Date().toISOString(),r=((P=a.getState().userReducer.currentUser)==null?void 0:P.id)??null,h=[],y=[],f=[],A={};for(const I of e){const{file:F,...g}=I,v=await this.client.files.getFilePayload(F);v.sha1 in A||(A[v.sha1]=v);const B=_({...g,file_name:F.name,file_sha1:v.sha1,file_type:F.type,file:URL.createObjectURL(F),submitted_at:l,created_by:r,project:n});h.push(B),y.push(B.uuid),f.push({uuid:B.uuid,sha1:B.file_sha1,file_name:B.file_name,title:B.title,description:B.description,geo_marker:B.geo_marker,canvas_marker:B.canvas_marker,direction:B.direction,original_date:B.original_date})}this.dispatch(c(h));const O=this.enqueueRequest({description:w(m.POST,this.name,!0),method:m.POST,url:`${this.url}/bulk/`,payload:{submitted_at:l,project:n,geo_images:f,files:Object.values(A)},blocks:[n],blockers:y});return O.then(I=>{this.client.files.processPresignedUrls(I.presigned_urls),this.dispatch(d(I.geo_images))}).catch(()=>{this.dispatch(o(y))}),[h,O.then(I=>I.geo_images)]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=n.getState(),o=c(e.uuid)(d);if(!o)throw new Error(`Map image with uuid ${e.uuid} does not exist in the store`);const l={...o,...e};this.dispatch(a(l));const r=this.enqueueRequest({description:w(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blocks:[e.uuid],blockers:[e.uuid]});return r.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(a(o))}),[l,r]}async delete(e){const{store:n}=this.client,{deleteOne:a,setOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Map image with uuid ${e} does not exist in the store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blocks:[e],blockers:[e]})}catch(r){throw this.dispatch(c(l)),r}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{project:e}},n);return this.dispatch(a(c)),c}}class wR extends k{constructor(){super(...arguments);p(this,"name","Issue Association");p(this,"url","/issue-associations");p(this,"actions",{addOne:tf,addMany:Ht,setOne:Qy,setMany:Xy,updateOne:xy,updateMany:ef,deleteOne:sf,deleteMany:Gt,initialize:Jy});p(this,"selectors",{selectById:af,selectByIds:cf})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=new Date().toISOString(),l=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,r=_({...e,submitted_at:o,created_by:l});this.dispatch(a(r));const h=this.enqueueRequest({description:w(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(r),blockers:[e.associated_issue,...e.issue?[e.issue]:[],...e.asset?[e.asset]:[]],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,h]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=d(e)(n.getState());if(!o)throw new Error(`Issue association with uuid ${e} not found in store.`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(o)),l}}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 OR extends L{constructor(){super(...arguments);p(this,"name","Issue Attachment");p(this,"url","/issue-attachments");p(this,"actions",{addOne:mf,addMany:an,setOne:pf,setMany:yf,updateOne:ff,updateMany:Af,deleteOne:Sf,deleteMany:cn,initialize:hf});p(this,"selectors",{selectById:Of,selectByIds:If})}getId(e){return e.uuid}buildModel(e){return _({file:URL.createObjectURL(e.file),file_sha1:e.file_sha1,created_by:e.created_by,file_name:e.file.name,file_type:e.file.type,submitted_at:e.submitted_at,issue:e.modelUuid})}buildPayload(e,n){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:n.extension,issue:e.issue}}async bulkAdd(e){return this._bulkAdd(e.map(n=>({modelUuid:n.issueUuid,file:n.file})))}async delete(e){return this._delete(e)}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 IR extends L{constructor(){super(...arguments);p(this,"name","Issue Comment Attachment");p(this,"url","/issue-comment-attachments");p(this,"actions",{addOne:bf,addMany:_f,setOne:Mf,setMany:Rf,updateOne:kf,updateMany:vf,deleteOne:Ef,deleteMany:Vf,initialize:gf});p(this,"selectors",{selectById:zf,selectByIds:Wf})}getId(e){return e.uuid}buildModel(e){return _({file:URL.createObjectURL(e.file),file_sha1:e.file_sha1,created_by:e.created_by,file_name:e.file.name,file_type:e.file.type,submitted_at:e.submitted_at,issue_comment:e.modelUuid})}buildPayload(e,n){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:n.extension,issue_comment:e.issue_comment}}async bulkAdd(e){return this._bulkAdd(e.map(n=>({modelUuid:n.issueCommentUuid,file:n.file})))}async delete(e){return this._delete(e)}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 FR extends k{constructor(){super(...arguments);p(this,"name","Issue Comment");p(this,"url","/issue-comments");p(this,"actions",{addOne:$f,addMany:Df,setOne:Uf,setMany:Lf,updateOne:Nf,updateMany:Hf,deleteOne:Gf,deleteMany:Kf,initialize:jf});p(this,"selectors",{selectById:Yf,selectByIds:Zf})}add(e){const{store:n}=this.client,{addOne:a,updateOne:c,deleteOne:d}=this.actions,o=_({...e,author:n.getState().userReducer.currentUser.id,submitted_at:new Date().toISOString()});this.dispatch(a(o));const l=this.enqueueRequest({description:w(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(o),blockers:[e.issue],blocks:[o.uuid]});return l.then(r=>{this.dispatch(c(r))}).catch(()=>{this.dispatch(d(o.uuid))}),[o,l]}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 o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:w(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=d(e)(n.getState());if(!o)throw new Error(`Comment with uuid ${e} not found in store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(o)),l}}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 PR extends k{constructor(){super(...arguments);p(this,"name","Issue");p(this,"url","/issues");p(this,"actions",{addOne:xf,addMany:mn,setOne:eA,setMany:tA,updateOne:sA,updateMany:iA,deleteOne:nA,deleteMany:pn,initialize:Qf});p(this,"selectors",{selectById:cA,selectByIds:rA})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=n.getState(),l=new Date().toISOString(),r=((f=o.userReducer.currentUser)==null?void 0:f.id)??null,h=_({...e,submitted_at:l,created_by:r});this.dispatch(a(h));const y=this.enqueueRequest({description:w(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(h),blockers:[h.project,h.issue_type,...h.category?[h.category]:[]],blocks:[h.uuid]});return y.then(A=>{this.dispatch(c(A))}).catch(A=>{throw this.dispatch(d(h.uuid)),A}),[h,y]}update(e){var y;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 o={...d,...e};this.dispatch(n(o));const l={};for(const f of[j.TITLE,j.DESCRIPTION,j.STATUS,j.CATEGORY,j.PRIORITY,j.ASSIGNED_TO,j.DUE_DATE])if(f in e&&e[f]!==d[f])switch(f){case j.PRIORITY:l[f]=e[f];break;case j.DUE_DATE:l[f]=e[f];break;case j.DESCRIPTION:l[f]=e[f];break;case j.TITLE:l[f]=e[f];break;case j.STATUS:{const A=e[f],O=En(A)(c);if(!O)throw new Error(`Trying to update issue type status with ${A} which does not exist in store`);l[f]={name:O.name,color:O.color,uuid:O.uuid};break}case j.CATEGORY:{const A=e[f];if(A===null)l[f]=null;else{const O=Pi(A)(c);if(!O)throw new Error(`Trying to update category with ${A} which does not exist in store.`);l[f]={name:O.name,color:O.color,uuid:O.uuid}}break}case j.ASSIGNED_TO:{const A=e[f];if(A===null)l[f]=null;else{const O=Xt(A)(c);if(!O)throw new Error(`Trying to update assigned to with ${A} which does not exist in store.`);l[f]={full_name:O.username,id:O.id}}break}}const r=_({created_by:((y=c.userReducer.currentUser)==null?void 0:y.id)??null,submitted_at:new Date().toISOString(),issue:d.uuid,changes:l});this.dispatch(Bn(r));const h=this.enqueueRequest({description:w(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return h.then(f=>{this.dispatch(n(f))}).catch(()=>{this.dispatch(n(d)),this.dispatch(Wn(r.uuid))}),[o,h]}bulkUpdate(e,n){const{store:a}=this.client,{updateMany:c}=this.actions,{selectByIds:d}=this.selectors,o=z(e).toSorted(vt);if(o.length!==e.length)throw new Error("payloads contains duplicate uuids.");const l=d(o)(a.getState()).toSorted(As);if(o.length!=l.length)throw new Error(`Attempting to bulk update ${o.length-l.length} issues that dont exist in the store`);const r=[];for(let A=0;A<o.length;A++)r.push({...l[A],...e[A]});this.dispatch(c(r));const h=ut(e,Math.min(n??e.length,U)),y=[];let f=null;for(const A of h){const O=ht.v4(),P=z(A),I=A.map(({status:v})=>v).filter(Boolean),F=A.map(({category:v})=>v).filter(Boolean),g=this.enqueueRequest({description:w(m.PATCH,this.name,!0),method:m.PATCH,url:`${this.url}/bulk/`,payload:{payloads:A},blockers:(f?[f]:[]).concat(P).concat(I).concat(F),blocks:[O].concat(P)});y.push(g),f=O}return Promise.all(y).then(A=>{this.dispatch(c(A.flat()))}).catch(()=>{this.dispatch(c(l))}),[r,y]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`No issue with uuid ${e} found in the store`);const r=wf(e)(o),h=BT(e)(o),y={};for(const A of rf(e)(o))y[A.uuid]=A;for(const A of df(e)(o))y[A.uuid]=A;const f=Object.values(y);this.dispatch(a(e)),this.dispatch(cn(z(r))),this.dispatch(qn(z(h))),this.dispatch(Gt(z(f)));try{return await this.enqueueRequest({description:w(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(A){throw this.dispatch(c(l)),this.dispatch(an(r)),this.dispatch(zn(h)),this.dispatch(Ht(f)),A}}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 gR extends L{constructor(){super(...arguments);p(this,"name","Issue Type Attachment");p(this,"url","/issue-type-attachments");p(this,"actions",{addOne:hA,addMany:mA,setOne:pA,setMany:yA,updateOne:fA,updateMany:AA,deleteOne:SA,deleteMany:TA,initialize:uA});p(this,"selectors",{selectById:OA,selectByIds:IA})}getId(e){return e.uuid}buildModel(e){return _({file:URL.createObjectURL(e.file),file_sha1:e.file_sha1,created_by:e.created_by,file_name:e.file.name,file_type:e.file.type,submitted_at:e.submitted_at,issue_type:e.modelUuid})}buildPayload(e,n){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:n.extension,issue_type:e.issue_type}}async bulkAdd(e){return this._bulkAdd(e.map(n=>({modelUuid:n.issueTypeUuid,file:n.file})))}async delete(e){return this._delete(e)}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 bR extends k{constructor(){super(...arguments);p(this,"name","Issue Type Fields Attachment");p(this,"url","/issue-type-fields-attachments");p(this,"actions",{addOne:bA,addMany:_A,setOne:MA,setMany:RA,updateOne:kA,updateMany:vA,deleteOne:EA,deleteMany:VA,initialize:gA});p(this,"selectors",{selectById:zA,selectByIds:WA})}async bulkAdd(e){var f;const{addMany:n,setMany:a,deleteMany:c}=this.actions,d=new Date().toISOString(),o=((f=this.client.store.getState().userReducer.currentUser)==null?void 0:f.id)??null,l={},r=[],h=[];for(const A of e){const{fieldsRevisionUuid:O,fieldIdentifier:P,file:I}=A,F=await this.client.files.getFilePayload(I);F.sha1 in l||(l[F.sha1]=F);const g=_({file:URL.createObjectURL(I),file_type:I.type,file_name:I.name,file_sha1:F.sha1,created_by:o,fields_revision:O,submitted_at:d,field_identifier:P});r.push(g);const v={uuid:g.uuid,file_name:I.name,file_extension:F.extension,field_identifier:P,file_sha1:F.sha1,fields_revision:O};h.push(v)}this.dispatch(n(r));const y=this.enqueueRequest({description:w(m.POST,this.name,!0),method:m.POST,url:`${this.url}/bulk/`,payload:{submitted_at:d,attachments:h,files:Object.values(l)},blockers:r.map(A=>A.fields_revision),blocks:r.map(A=>A.uuid)});return y.then(A=>{this.client.files.processPresignedUrls(A.presigned_urls),this.dispatch(a(A.attachments))}).catch(()=>{this.dispatch(c(r.map(A=>A.uuid)))}),[r,y.then(({attachments:A})=>A)]}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 _R extends k{constructor(){super(...arguments);p(this,"name","Issue Type Fields");p(this,"url","/issue-type-fields");p(this,"actions",{addOne:eS,addMany:tS,setOne:sS,setMany:iS,updateOne:nS,updateMany:aS,deleteOne:cS,deleteMany:rS,initialize:xA});p(this,"selectors",{selectById:lS,selectByIds:oS})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:w(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(r),blockers:[r.issue_type],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(f=>{throw this.dispatch(d(r.uuid)),f}),[r,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 MR extends k{constructor(){super(...arguments);p(this,"name","Issue Type Field Values Attachment");p(this,"url","/issue-type-field-values-attachments");p(this,"actions",{addOne:pS,addMany:In,setOne:yS,setMany:fS,updateOne:AS,updateMany:SS,deleteOne:TS,deleteMany:Fn,initialize:mS});p(this,"selectors",{selectById:OS,selectByIds:IS})}async bulkAdd(e){var f;const{addMany:n,setMany:a,deleteMany:c}=this.actions,d=new Date().toISOString(),o=((f=this.client.store.getState().userReducer.currentUser)==null?void 0:f.id)??null,l={},r=[],h=[];for(const A of e){const{fieldValuesUuid:O,fieldIdentifier:P,file:I}=A,F=await this.client.files.getFilePayload(I);F.sha1 in l||(l[F.sha1]=F);const g=_({file:URL.createObjectURL(I),file_type:I.type,file_name:I.name,file_sha1:F.sha1,created_by:o,field_values:O,submitted_at:d,field_identifier:P});r.push(g);const v={uuid:g.uuid,file_name:I.name,file_sha1:F.sha1,file_extension:F.extension,field_identifier:P,field_values:O};h.push(v)}this.dispatch(n(r));const y=this.enqueueRequest({description:w(m.POST,this.name,!0),method:m.POST,url:`${this.url}/bulk/`,payload:{submitted_at:d,attachments:h,files:Object.values(l)},blockers:r.map(A=>A.field_values),blocks:r.map(A=>A.uuid)});return y.then(({presigned_urls:A,attachments:O})=>{this.client.files.processPresignedUrls(A),this.dispatch(a(O))}).catch(A=>{throw this.dispatch(c(r.map(O=>O.uuid))),A}),[r,y.then(({attachments:A})=>A)]}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:d}=this.selectors,o=n.getState(),l=d(e)(o);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(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:{field_values__issue__project:e,latest:!0}},n)).flat();return this.dispatch(a(d)),d}}class RR extends k{constructor(){super(...arguments);p(this,"name","Issue Type Field Values");p(this,"url","/issue-type-field-values");p(this,"actions",{addOne:$A,addMany:DA,setOne:UA,setMany:LA,updateOne:NA,updateMany:HA,deleteOne:GA,deleteMany:KA,initialize:jA});p(this,"selectors",{selectById:ZA,selectByIds:JA})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,r=new Date().toISOString(),h=_({...e,created_by:l,submitted_at:r}),y=this.enqueueRequest({description:w(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)),y.then(A=>{this.dispatch(c(A))}).catch(()=>{this.dispatch(d(h.uuid))}),[h,y]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=n.getState(),o=c(e.uuid)(d);if(!o)throw new Error(`Expected IssueTypeFieldValues with uuid ${e.uuid} to exist`);const l={...o,...e};this.dispatch(a(l));const r=this.enqueueRequest({description:w(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[l.uuid,l.fields_revision,l.issue],blocks:[l.uuid]});return r.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(a(o))}),[l,r]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected submission with uuid ${e} to exist`);const r=FS(e)(o);this.dispatch(a(e)),this.dispatch(Fn(z(r)));try{return await this.enqueueRequest({description:w(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(h){throw this.dispatch(c(l)),this.dispatch(In(r)),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 kR extends k{constructor(){super(...arguments);p(this,"name","Issue Type Identifier");p(this,"url","/issue-type-identifiers");p(this,"actions",{addOne:_S,addMany:MS,setOne:RS,setMany:kS,updateOne:vS,updateMany:ES,deleteOne:VS,deleteMany:BS,initialize:bS});p(this,"selectors",{selectById:WS,selectByIds:qS})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:w(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(r),blockers:[r.issue_type],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,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 o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:w(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);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(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 vR extends k{constructor(){super(...arguments);p(this,"name","Issue Type Identifier Value");p(this,"url","/issue-type-identifier-values");p(this,"actions",{addOne:DS,addMany:US,setOne:LS,setMany:NS,updateOne:HS,updateMany:GS,deleteOne:KS,deleteMany:YS,initialize:$S});p(this,"selectors",{selectById:JS,selectByIds:XS})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:w(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(r),blockers:[e.issue,e.issue_type_identifier],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,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 value with uuid ${e.uuid} to exist`);const o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:w(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);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(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:{issue__project:e}},n)).flat();return this.dispatch(a(d)),d}}class ER extends k{constructor(){super(...arguments);p(this,"name","Issue Type");p(this,"url","/issue-types");p(this,"actions",{addOne:tT,addMany:sT,setOne:iT,setMany:nT,updateOne:aT,updateMany:cT,deleteOne:rT,deleteMany:dT,initialize:eT});p(this,"selectors",{selectById:oT,selectByIds:uT})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,r=new Date().toISOString(),h=_({...e,submitted_at:r,created_by:l});this.dispatch(a(h));const y=this.enqueueRequest({method:m.POST,url:`${this.url}/`,payload:E(h),blockers:[],blocks:[h.uuid]});return y.then(A=>{this.dispatch(c(A))}).catch(()=>{this.dispatch(d(h.uuid))}),[h,y]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=n.getState(),o=c(e.uuid)(d);if(!o)throw new Error(`IssueType with uuid ${e.uuid} does not exist in the store.`);const l={...o,...e};this.dispatch(a(l));const r=this.enqueueRequest({method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return r.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(a(o))}),[l,r]}async delete(e){const{store:n}=this.client,{deleteOne:a,setOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`IssueType with uuid ${e} does not exist in the store.`);const r=dA(e)(o);this.dispatch(a(e)),this.dispatch(pn(z(r)));try{return await this.enqueueRequest({description:w(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(h){throw this.dispatch(c(l)),this.dispatch(mn(r)),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 VR extends k{constructor(){super(...arguments);p(this,"name","Issue Type Status");p(this,"url","/issue-type-statuses");p(this,"actions",{addOne:yT,addMany:fT,setOne:AT,setMany:ST,updateOne:TT,updateMany:wT,deleteOne:OT,deleteMany:IT,initialize:pT});p(this,"selectors",{selectById:En,selectByIds:PT})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:w(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(r),blockers:[e.issue_type],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,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 o={...d,...e};this.dispatch(n(o));const l=this.enqueueRequest({description:w(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(r=>{this.dispatch(n(r))}).catch(()=>{this.dispatch(n(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=d(e)(n.getState());if(!o)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(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(o)),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 BR extends k{constructor(){super(...arguments);p(this,"name","Issue Update");p(this,"url","/issue-updates");p(this,"actions",{addOne:Bn,addMany:zn,setOne:MT,setMany:RT,updateOne:kT,updateMany:vT,deleteOne:Wn,deleteMany:qn,initialize:_T});p(this,"selectors",{selectById:ET,selectByIds:VT})}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 zR=1800;function WR(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 qR extends EM{constructor(){super(...arguments);p(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(Nh(!1)),this.clearTokens(),this.dispatch(b()),this.dispatch(b())}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.log("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=Jg(e).exp??n}catch{a=n}return a-n<zR}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 $&&this.clearAuth(),e instanceof Error?Promise.reject(e):Promise.reject(new Error((e??At).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 $({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 $({message:"Incorrect username or password.",response:n,discard:!0})}async initAuth(e){const n=ht.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(WR(a))})}}class CR extends St{constructor(){super(...arguments);p(this,"name","Organization Access");p(this,"url","/organization-accesses");p(this,"actions",{addOne:ZT,addMany:JT,setOne:XT,setMany:QT,updateOne:xT,updateMany:ew,deleteOne:tw,deleteMany:sw,initialize:YT});p(this,"selectors",{selectById:nw,selectByIds:aw})}update(e){const{store:n}=this.client,{updateOne:a}=this.actions,{selectById:c}=this.selectors,d=c(e.uuid)(n.getState()),o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:w(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(r=>{throw this.dispatch(a(d)),r}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o),r=Xt(l.user)(o);this.dispatch(a(l.uuid)),this.dispatch(Un(l.user));try{return await this.enqueueRequest({description:w(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${l.uuid}/`,blockers:[l.uuid],blocks:[]})}catch(h){throw this.dispatch(c(l)),this.dispatch(Dn(r)),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 jR extends St{constructor(){super(...arguments);p(this,"name","Organization");p(this,"url","/organizations");p(this,"actions",{addOne:hw,addMany:uw,setOne:ow,setMany:lw,updateOne:pw,updateMany:mw,deleteOne:yw,deleteMany:fw,initialize:dw});p(this,"selectors",{selectById:Tw,selectByIds:ww})}async add(e){const{addOne:n}=this.actions,a=await this.enqueueRequest({description:w(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:w(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:w(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 $R extends k{constructor(){super(...arguments);p(this,"name","Project Access");p(this,"url","/project-accesses");p(this,"actions",{addOne:kw,addMany:vw,setOne:Ew,setMany:Vw,updateOne:Bw,updateMany:zw,deleteOne:Ww,deleteMany:qw,initialize:Rw});p(this,"selectors",{selectById:jw,selectByIds:$w})}add(e){var r;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=_({...e,created_by:((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null});this.dispatch(a(o));const l=this.enqueueRequest({description:w(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(o),blockers:[o.organization_access,o.project],blocks:[o.uuid]});return l.then(h=>{this.dispatch(c(h))}).catch(h=>{throw this.dispatch(d(o.uuid)),h}),[o,l]}bulkAdd(e){var h;const{store:n}=this.client,{addMany:a,deleteMany:c,updateMany:d}=this.actions,o=((h=n.getState().userReducer.currentUser)==null?void 0:h.id)??null,l=e.map(y=>_({...y,created_by:o}));this.dispatch(a(l));const r=this.enqueueRequest({description:w(m.POST,this.name,!0),method:m.POST,url:`${this.url}/bulk/`,payload:{project_accesses:l.map(y=>E(y))},blockers:l.flatMap(y=>[y.project,y.organization_access]),blocks:l.map(y=>y.uuid)});return r.then(y=>{this.dispatch(d(y))}).catch(y=>{throw this.dispatch(c(l.map(f=>f.uuid))),y}),[l,r]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=c(e.uuid)(n.getState()),o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:w(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[]});return l.then(r=>{this.dispatch(a(r))}).catch(r=>{throw this.dispatch(a(d)),r}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=d(e)(n.getState());this.dispatch(a(e));try{return await this.enqueueRequest({description:w(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(o)),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 DR extends L{constructor(){super(...arguments);p(this,"name","Project Attachment");p(this,"url","/project-attachments");p(this,"actions",{addOne:Lw,addMany:Nw,setOne:Hw,setMany:Gw,updateOne:Kw,updateMany:Yw,deleteOne:Zw,deleteMany:Jw,initialize:Uw});p(this,"selectors",{selectById:Qw,selectByIds:xw})}getId(e){return e.uuid}buildModel(e){return _({file:URL.createObjectURL(e.file),file_sha1:e.file_sha1,created_by:e.created_by,file_name:e.file.name,file_type:e.file.type,submitted_at:e.submitted_at,project:e.modelUuid})}buildPayload(e,n){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:n.extension,project:e.project}}async bulkAdd(e){return this._bulkAdd(e.map(n=>({modelUuid:n.projectUuid,file:n.file})))}async delete(e){return this._delete(e)}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 UR extends k{constructor(){super(...arguments);p(this,"name","Project File");p(this,"url","/project-files");p(this,"actions",{addOne:aO,addMany:cO,setOne:iO,setMany:nO,updateOne:rO,updateMany:dO,deleteOne:lO,deleteMany:oO,initialize:sO});p(this,"selectors",{selectById:fO,selectByIds:AO})}async saveExisting(e){const{setOne:n}=this.actions;if(!e.uuid)throw new Error("You can only use this method to save existing project files. The one provided has no uuid.");const a={...e};delete a.file;const c=this.enqueueRequest({method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:a,blockers:[e.uuid],blocks:[e.uuid]});return c.then(d=>{this.dispatch(n(d))}),c}saveActive(){const{store:e}=this.client,{setOne:n}=this.actions,a=e.getState(),c=a.projectFileReducer.activeProjectFileId;if(!c)throw new Error("No active project file");const d=a.projectFileReducer.instances[c];if(!d)throw new Error("No active project file");if(!d.bounds&&!d.canvas_bounds)throw new Error("Project file must either have bounds or canvas_bounds set");let o;if(typeof d.file=="string"&&!d.file.startsWith("blob:")){const h={...d};delete h.file,o={method:m.PATCH,url:`${this.url}/${c}/`,payload:h,blockers:[c],blocks:[c]}}else o=new Promise((h,y)=>{this.client.files.uploadFileToS3(d.file_sha1).then(([f])=>{h({method:m.POST,url:`${this.url}/`,payload:{...d,...f},blockers:[c],blocks:[c]})}).catch(y)});const r=Promise.resolve(o).then(h=>this.enqueueRequest(h));return r.then(h=>{this.dispatch(n(h))}),this.dispatch(mO),this.dispatch(hO(null)),this.dispatch(uO(!1)),[d,r]}async delete(e){const{store:n}=this.client,{addOne:a,deleteOne:c}=this.actions,{selectById:d}=this.selectors,o=d(e)(n.getState());if(!o)throw new Error(`Expected project file with uuid ${e} to exist in the store.`);this.dispatch(c(e));try{return await this.enqueueRequest({description:w(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(a(o)),l}}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 LR extends St{constructor(){super(...arguments);p(this,"name","Project");p(this,"url","/projects");p(this,"actions",{addOne:PO,addMany:FO,setOne:IO,setMany:OO,updateOne:bO,updateMany:gO,deleteOne:_O,deleteMany:MO,initialize:wO});p(this,"selectors",{selectById:vO,selectByIds:EO})}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:w(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 NR extends k{constructor(){super(...arguments);p(this,"name","Team Membership");p(this,"url","/team-memberships");p(this,"actions",{addOne:WO,addMany:qO,setOne:CO,setMany:jO,updateOne:$O,updateMany:DO,deleteOne:UO,deleteMany:LO,initialize:zO});p(this,"selectors",{selectById:GO,selectByIds:KO})}add(e){var r;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=_({...e,created_by:((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null});this.dispatch(a(o));const l=this.enqueueRequest({description:w(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(o),blockers:[e.team],blocks:[o.uuid]});return l.then(h=>{this.dispatch(c(h))}).catch(()=>{this.dispatch(d(o.uuid))}),[o,l]}bulkAdd(e){var h;const{store:n}=this.client,{addMany:a,setMany:c,deleteMany:d}=this.actions,o=((h=n.getState().userReducer.currentUser)==null?void 0:h.id)??null,l=e.map(y=>_({...y,created_by:o}));this.dispatch(a(l));const r=this.enqueueRequest({description:w(m.POST,this.name,!0),method:m.POST,url:`${this.url}/bulk/`,payload:{team_memberships:l.map(y=>E(y))},blockers:l.map(y=>y.team),blocks:l.map(y=>y.uuid)});return r.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(d(l.map(y=>y.uuid)))}),[l,r]}async delete(e){const{store:n}=this.client,{deleteOne:a,setOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected team membership with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(r){throw this.dispatch(c(l)),r}}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 HR extends k{constructor(){super(...arguments);p(this,"name","Team");p(this,"url","/teams");p(this,"actions",{addOne:JO,addMany:XO,setOne:QO,setMany:xO,updateOne:eI,updateMany:tI,deleteOne:sI,deleteMany:iI,initialize:ZO});p(this,"selectors",{selectById:aI,selectByIds:cI})}add(e){var r;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=_({...e,submitted_at:new Date().toISOString(),created_by:((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null});this.dispatch(a(o));const l=this.enqueueRequest({description:w(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(o),blockers:[],blocks:[o.uuid]});return l.then(h=>{this.dispatch(c(h))}).catch(()=>{this.dispatch(d(o.uuid))}),[o,l]}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 o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:w(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:E(e),blockers:[e.uuid],blocks:[e.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,setOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected team with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(r){throw this.dispatch(c(l)),r}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class GR extends St{constructor(){super(...arguments);p(this,"name","User");p(this,"url","/user");p(this,"actions",{addOne:Dn,addMany:$T,setOne:jT,setMany:CT,updateOne:UT,updateMany:DT,deleteOne:Un,deleteMany:LT,initialize:qT});p(this,"selectors",{selectById:Xt,selectByIds:GT})}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}}class KR extends k{constructor(){super(...arguments);p(this,"name","Workflow");p(this,"url","/workflows");p(this,"actions",{addOne:oI,addMany:na,setOne:uI,setMany:hI,updateOne:mI,updateMany:pI,deleteOne:yI,deleteMany:aa,initialize:lI});p(this,"selectors",{selectById:AI,selectByIds:SI})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,r=new Date().toISOString(),h=_({...e,created_by:l,submitted_at:r});this.dispatch(a(h));const y=this.enqueueRequest({description:w(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(h),blockers:[h.project,h.workflow_type],blocks:[h.uuid]});return y.then(A=>{this.dispatch(c(A))}).catch(()=>{this.dispatch(d(h.uuid))}),[h,y]}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 workflow with uuid ${e.uuid} to exist`);const o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:w(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[d.uuid],blocks:[d.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected workflow with uuid ${e} to exist`);const r=$F(e)(o),h=EI(e)(o),y=_P(e)(o),f=$P(e)(o),A=fF(e)(o),O=iF(e)(o),P={};for(const F of O)for(const g of ua(F.uuid)(o))P[g.uuid]=g;const I=Object.values(P);this.dispatch(a(e)),this.dispatch(Pa(z(r))),this.dispatch(da(z(h))),this.dispatch(Va(z(y))),this.dispatch(Wa(z(f))),this.dispatch(Aa(z(A))),this.dispatch(pa(z(O))),this.dispatch(is(z(I)));try{return await this.enqueueRequest({description:w(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(F){throw this.dispatch(c(l)),this.dispatch(Fa(r)),this.dispatch(ra(h)),this.dispatch(Ea(y)),this.dispatch(za(f)),this.dispatch(fa(A)),this.dispatch(ma(O)),this.dispatch(ss(I)),F}}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 YR extends k{constructor(){super(...arguments);p(this,"name","Workflow Step Assignee");p(this,"url","/workflow-step-assignees");p(this,"actions",{addOne:FI,addMany:ra,setOne:PI,setMany:gI,updateOne:bI,updateMany:_I,deleteOne:MI,deleteMany:da,initialize:II});p(this,"selectors",{selectById:kI,selectByIds:vI})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=new Date().toISOString(),l=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,r=_({...e,submitted_at:o,created_by:l});this.dispatch(a(r));const h=this.enqueueRequest({description:w(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(r),blockers:[e.workflow,e.workflow_step],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,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 workflow step assignee with uuid ${e.uuid} to exist`);const o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:w(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,setOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected workflow step assignee with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(r){throw this.dispatch(c(l)),r}}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{workflow__project:e}},n)).flat();return this.dispatch(a(d)),d}}class ZR extends L{constructor(){super(...arguments);p(this,"name","Workflow Step Comment Attachment");p(this,"url","/workflow-step-comment-attachments");p(this,"actions",{addOne:WI,addMany:ss,setOne:qI,setMany:CI,updateOne:jI,updateMany:$I,deleteOne:DI,deleteMany:is,initialize:zI});p(this,"selectors",{selectById:LI,selectByIds:NI})}getId(e){return e.uuid}buildModel(e){return _({file:URL.createObjectURL(e.file),file_sha1:e.file_sha1,created_by:e.created_by,file_name:e.file.name,file_type:e.file.type,submitted_at:e.submitted_at,workflow_step_comment:e.modelUuid})}buildPayload(e,n){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:n.extension,workflow_step_comment:e.workflow_step_comment}}async bulkAdd(e){return this._bulkAdd(e.map(n=>({modelUuid:n.workflowStepCommentUuid,file:n.file})))}async delete(e){return this._delete(e)}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{workflow_step_comment__workflow__project:e}},n)).flat();return this.dispatch(a(d)),d}}class JR extends k{constructor(){super(...arguments);p(this,"name","Workflow Step Comment");p(this,"url","/workflow-step-comments");p(this,"actions",{addOne:YI,addMany:ma,setOne:ZI,setMany:JI,updateOne:XI,updateMany:QI,deleteOne:xI,deleteMany:pa,initialize:KI});p(this,"selectors",{selectById:tF,selectByIds:sF})}add(e){var r;const{store:n}=this.client,{addOne:a,updateOne:c,deleteOne:d}=this.actions,o=_({...e,created_by:((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(o));const l=this.enqueueRequest({description:w(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(o),blockers:[e.workflow,e.workflow_step],blocks:[o.uuid]});return l.then(h=>{this.dispatch(c(h))}).catch(()=>{this.dispatch(d(o.uuid))}),[o,l]}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 o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:w(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=d(e)(n.getState());if(!o)throw new Error(`Comment with uuid ${e} not found in store`);const l=ua(e)(n.getState());this.dispatch(a(e)),this.dispatch(is(z(l)));try{return await this.enqueueRequest({description:w(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(r){throw this.dispatch(c(o)),this.dispatch(ss(l)),r}}async refreshStore(e,n){const{setMany:a}=this.actions,d=(await this.listPaginated({queryParams:{workflow__project:e}},n)).flat();return this.dispatch(a(d)),d}}class XR extends k{constructor(){super(...arguments);p(this,"name","Workflow Step Completion");p(this,"url","/workflow-step-completions");p(this,"actions",{addOne:rF,addMany:fa,setOne:dF,setMany:lF,updateOne:oF,updateMany:uF,deleteOne:hF,deleteMany:Aa,initialize:cF});p(this,"selectors",{selectById:pF,selectByIds:yF})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=new Date().toISOString(),l=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,r=_({...e,submitted_at:o,created_by:l});this.dispatch(a(r));const h=this.enqueueRequest({description:w(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(r),blockers:[e.workflow,e.workflow_step],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,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 workflow step completion with uuid ${e.uuid} to exist`);const o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:w(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,setOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected workflow step completion with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(r){throw this.dispatch(c(l)),r}}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{workflow__project:e}},n)).flat();return this.dispatch(a(d)),d}}class QR extends k{constructor(){super(...arguments);p(this,"name","Workflow Step Field Values Attachment");p(this,"url","/workflow-step-field-values-attachments");p(this,"actions",{addOne:wF,addMany:Ta,setOne:OF,setMany:IF,updateOne:FF,updateMany:PF,deleteOne:gF,deleteMany:wa,initialize:TF});p(this,"selectors",{selectById:_F,selectByIds:MF})}async bulkAdd(e){var f;const{addMany:n,setMany:a,deleteMany:c}=this.actions,d=new Date().toISOString(),o=((f=this.client.store.getState().userReducer.currentUser)==null?void 0:f.id)??null,l={},r=[],h=[];for(const A of e){const{fieldValuesUuid:O,fieldIdentifier:P,file:I}=A,F=await this.client.files.getFilePayload(I);F.sha1 in l||(l[F.sha1]=F);const g=_({file:URL.createObjectURL(I),file_type:I.type,file_name:I.name,file_sha1:F.sha1,created_by:o,field_values:O,submitted_at:d,field_identifier:P});r.push(g);const v={uuid:g.uuid,file_name:I.name,file_sha1:F.sha1,file_extension:F.extension,field_identifier:P,field_values:O};h.push(v)}this.dispatch(n(r));const y=this.enqueueRequest({description:w(m.POST,this.name,!0),method:m.POST,url:`${this.url}/bulk/`,payload:{submitted_at:d,attachments:h,files:Object.values(l)},blockers:r.map(A=>A.field_values),blocks:r.map(A=>A.uuid)});return y.then(({presigned_urls:A,attachments:O})=>{this.client.files.processPresignedUrls(A),this.dispatch(a(O))}).catch(A=>{throw this.dispatch(c(r.map(O=>O.uuid))),A}),[r,y.then(({attachments:A})=>A)]}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:d}=this.selectors,o=n.getState(),l=d(e)(o);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(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:{field_values__workflow__project:e,latest:!0}},n)).flat();return this.dispatch(a(d)),d}}class xR extends k{constructor(){super(...arguments);p(this,"name","Workflow Step Field Values");p(this,"url","/workflow-step-field-values");p(this,"actions",{addOne:VF,addMany:Fa,setOne:BF,setMany:zF,updateOne:WF,updateMany:qF,deleteOne:CF,deleteMany:Pa,initialize:EF});p(this,"selectors",{selectById:DF,selectByIds:UF})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,r=new Date().toISOString(),h=_({...e,created_by:l,submitted_at:r}),y=this.enqueueRequest({description:w(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(h),blockers:[e.workflow,e.workflow_step,e.fields_revision],blocks:[h.uuid]});return this.dispatch(a(h)),y.then(A=>{this.dispatch(c(A))}).catch(()=>{this.dispatch(d(h.uuid))}),[h,y]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=n.getState(),o=c(e.uuid)(d);if(!o)throw new Error(`Expected WorkflowStepFieldValues with uuid ${e.uuid} to exist`);const l={...o,...e};this.dispatch(a(l));const r=this.enqueueRequest({description:w(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[l.uuid,l.fields_revision,l.workflow,l.workflow_step],blocks:[l.uuid]});return r.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(a(o))}),[l,r]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected submission with uuid ${e} to exist`);const r=RF(e)(o);this.dispatch(a(e)),this.dispatch(wa(z(r)));try{return await this.enqueueRequest({description:w(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(h){throw this.dispatch(c(l)),this.dispatch(Ta(r)),h}}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{workflow__project:e,latest:!0}},n)).flat();return this.dispatch(a(d)),d}}class ek extends k{constructor(){super(...arguments);p(this,"name","Workflow Step Fields Attachment");p(this,"url","/workflow-step-fields-attachments");p(this,"actions",{addOne:GF,addMany:ba,setOne:KF,setMany:YF,updateOne:ZF,updateMany:JF,deleteOne:XF,deleteMany:_a,initialize:HF});p(this,"selectors",{selectById:eP,selectByIds:tP})}async bulkAdd(e){var f;const{addMany:n,setMany:a,deleteMany:c}=this.actions,d=new Date().toISOString(),o=((f=this.client.store.getState().userReducer.currentUser)==null?void 0:f.id)??null,l={},r=[],h=[];for(const A of e){const{fieldsRevisionUuid:O,fieldIdentifier:P,file:I}=A,F=await this.client.files.getFilePayload(I);F.sha1 in l||(l[F.sha1]=F);const g=_({file:URL.createObjectURL(I),file_type:I.type,file_name:I.name,file_sha1:F.sha1,created_by:o,fields_revision:O,submitted_at:d,field_identifier:P});r.push(g);const v={uuid:g.uuid,file_name:I.name,field_identifier:P,file_extension:F.extension,file_sha1:F.sha1,fields_revision:O};h.push(v)}this.dispatch(n(r));const y=this.enqueueRequest({description:w(m.POST,this.name,!0),method:m.POST,url:`${this.url}/bulk/`,payload:{submitted_at:d,attachments:h,files:Object.values(l)},blockers:r.map(A=>A.fields_revision),blocks:r.map(A=>A.uuid)});return y.then(A=>{this.client.files.processPresignedUrls(A.presigned_urls),this.dispatch(a(A.attachments))}).catch(()=>{this.dispatch(c(r.map(A=>A.uuid)))}),[r,y.then(({attachments:A})=>A)]}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 tk extends k{constructor(){super(...arguments);p(this,"name","Workflow Step Fields");p(this,"url","/workflow-step-fields");p(this,"actions",{addOne:aP,addMany:cP,setOne:rP,setMany:dP,updateOne:lP,updateMany:oP,deleteOne:uP,deleteMany:hP,initialize:nP});p(this,"selectors",{selectById:mP,selectByIds:pP})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:w(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(r),blockers:[r.workflow_step],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(f=>{throw this.dispatch(d(r.uuid)),f}),[r,h]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,c=n.getState().workflowStepFieldsReducer.instances[e.uuid];if(!c)throw new Error(`WorkflowStepFields with uuid ${e.uuid} not found`);const d={...c,...e};this.dispatch(a(d));const o=this.enqueueRequest({description:w(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${c.uuid}/`,payload:e,blockers:[c.uuid],blocks:[c.uuid]});return o.then(l=>{this.dispatch(a(l))}).catch(l=>{throw this.dispatch(a(c)),l}),[d,o]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,d=n.getState().workflowStepFieldsReducer.instances[e];if(!d)throw new Error(`WorkflowStepFields with uuid ${e} not found`);const o=xF(e)(n.getState());this.dispatch(a(e)),this.dispatch(_a(z(o)));try{return await this.enqueueRequest({description:w(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(l){throw this.dispatch(c(d)),this.dispatch(ba(o)),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 sk extends k{constructor(){super(...arguments);p(this,"name","Workflow Step Review Request");p(this,"url","/workflow-step-review-requests");p(this,"actions",{addOne:SP,addMany:Ea,setOne:TP,setMany:wP,updateOne:OP,updateMany:IP,deleteOne:FP,deleteMany:Va,initialize:AP});p(this,"selectors",{selectById:gP,selectByIds:bP})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=new Date().toISOString(),l=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,r=_({...e,submitted_at:o,created_by:l});this.dispatch(a(r));const h=this.enqueueRequest({description:w(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(r),blockers:[e.workflow,e.workflow_step],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,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 workflow step review request with uuid ${e.uuid} to exist`);const o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:w(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,setOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected workflow step review request with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(r){throw this.dispatch(c(l)),r}}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{workflow__project:e}},n)).flat();return this.dispatch(a(d)),d}}class ik extends k{constructor(){super(...arguments);p(this,"name","Workflow Step Review");p(this,"url","/workflow-step-reviews");p(this,"actions",{addOne:vP,addMany:za,setOne:EP,setMany:VP,updateOne:BP,updateMany:zP,deleteOne:WP,deleteMany:Wa,initialize:kP});p(this,"selectors",{selectById:CP,selectByIds:jP})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=new Date().toISOString(),l=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,r=_({...e,submitted_at:o,created_by:l});this.dispatch(a(r));const h=this.enqueueRequest({description:w(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(r),blockers:[e.workflow,e.workflow_step],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,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 workflow step review with uuid ${e.uuid} to exist`);const o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:w(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,setOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected workflow step review with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(r){throw this.dispatch(c(l)),r}}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{workflow__project:e}},n)).flat();return this.dispatch(a(d)),d}}class nk extends k{constructor(){super(...arguments);p(this,"name","Workflow Step");p(this,"url","/workflow-steps");p(this,"actions",{addOne:NP,addMany:Ca,setOne:HP,setMany:GP,updateOne:KP,updateMany:YP,deleteOne:ZP,deleteMany:ja,initialize:LP});p(this,"selectors",{selectById:QP,selectByIds:eg})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:w(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(r),blockers:[r.workflow_type],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,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 workflow step with uuid ${e.uuid} found in the store`);const o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:w(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${d.uuid}/`,payload:{name:e.name,order:e.order},blockers:[d.uuid],blocks:[d.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`No workflow step with uuid ${e} found in the store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(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:{workflow_type__organization:e}},n);return this.dispatch(a(c)),c}}class ak extends k{constructor(){super(...arguments);p(this,"name","Workflow Type");p(this,"url","/workflow-types");p(this,"actions",{addOne:ig,addMany:ng,setOne:ag,setMany:cg,updateOne:rg,updateMany:dg,deleteOne:lg,deleteMany:og,initialize:sg});p(this,"selectors",{selectById:hg,selectByIds:mg})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:w(m.POST,this.name,!1),method:m.POST,url:`${this.url}/`,payload:E(r),blockers:[],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,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 workflow type with uuid ${e.uuid} to exist`);const o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:w(m.PATCH,this.name,!1),method:m.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[d.uuid],blocks:[d.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected workflow type with uuid ${e} to exist`);const r=TI(e)(o),h=xP(e)(o);this.dispatch(a(e)),this.dispatch(aa(z(r))),this.dispatch(ja(z(h)));try{return await this.enqueueRequest({description:w(m.DELETE,this.name,!1),method:m.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(y){throw this.dispatch(c(l)),this.dispatch(na(r)),this.dispatch(Ca(h)),y}}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 Ya(t,s,e,n,a){const c=n instanceof mt;c&&s.checkAuth!==!1&&await n.auth.prepareAuth();const d={queryParams:"",isAuthNeeded:!0},{s3url:o,payload:l,headers:r,method:h,queryParams:y,attachmentHash:f,isExternalUrl:A,isAuthNeeded:O,isResponseBlob:P}={...d,...s};let I=s.url;const F=f?await e.files.fetchCache(f):void 0;if(f&&!F)throw new Error(`Cannot upload file ${f} because it's not cached.`);!A&&!I.startsWith("http")&&(!I.startsWith("/")&&!I.startsWith("blob:")&&(I="/"+I),I=t+I);const g=C=>{if(f){if(!o)throw new Error(`No S3 URL for file ${f}`);if("warning"in o)throw new Error(`S3 URL warning for file ${f}`);if(!F)throw new Error(`No file for file ${f}`);const q=o.fields["x-amz-checksum-sha1"];if(!q)throw new Error(`No checksum for file ${f}`);return C.set("x-amz-checksum-sha1",q).field({...l,...o.fields}).attach("file",F)}return C.send(l)},B={[m.GET]:()=>P?yt.get(I.toString()).responseType("blob"):yt.get(I.toString()),[m.POST]:()=>{const C=yt.post(I.toString());return g(C)},[m.PATCH]:()=>{const C=yt.patch(I.toString());return g(C)},[m.PUT]:()=>{const C=yt.put(I.toString());return g(C)},[m.DELETE]:()=>{const C=yt.delete(I.toString());return g(C)}}[h];let V=B();if(a==null||a.addEventListener("abort",()=>{console.debug("aborting request:",s.url),V.abort()}),O&&c){const C=n.auth.getAuthHeader();V=V.set("Authorization",C)}r&&(V=V.set(r));try{return await V.query(y)}catch(C){const q=vg(C),Lg=q==null?void 0:q.status;if(c&&Lg===401)return await n.auth.handleUnauthorized(V,q),V.query(y);throw new $({response:q,innerError:C,discard:Na.includes(Lg)})}}class ck{constructor(s){p(this,"store");this.store=s}_performRequest(s,e,n,a){const c=new hs,d={...e,uuid:e.uuid??ht.v4()};return Ya(s,d,this,n,a).then(o=>{c.resolve(o.body)}).catch(o=>{o instanceof Error?c.reject(o):c.reject(new Error((o??At).toString()))}),c}async performRequest(s,e,n,a){return this._performRequest(s,e,n,a).then(c=>{if(c instanceof $)throw c;return c})}async enqueueRequest(s,e,n){return this._enqueueRequest(s,e,n).then(a=>{if(a instanceof $)throw a;return a})}_enqueueRequest(s,e,n){const a=new hs,c={...s,BASE_URL:e,serviceName:n},d=this.store.dispatch(Pw(c)),o=r=>{if(r)a.resolve(r.body);else{const h=new $({message:"Could not get a response from the server.",response:r,discard:!0});a.reject(h)}},l=r=>{r instanceof $?r.options.discard=!0:(console.error("Received an unexpected error while processing a request:",r,`
|
|
15
|
-
Converting error to APIError and discarding.`),r=new $({message:"An error occurred while processing the request.",innerError:r,discard:!0})),a.reject(r)};return d.then(o,l),a}async performPagination(s,e,n,a,c){const d={...e,queryParams:{...e.queryParams,paginate:!0,limit:n}},{method:o}=d,l=[];let r=await this.performRequest(s,d,a,c);for(l.push(r.results);r.next;)r=await this.performRequest(s,{url:r.next,method:o},a,c),l.push(r.results);return l}}class Tt{constructor(){p(this,"graph");p(this,"requestAttemptCounter");this.graph=new Xg.DepGraph,this.requestAttemptCounter={}}static _fromOutbox(s){const e=new Tt;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(o=>a.payload.blockers.includes(o))&&Tt._addDependency(a.payload.uuid,d.payload.uuid,e.graph)}}return e}_addDependency(s,e){Tt._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 Eg;function Vg(t){Eg=t}function wt(){return Eg}let Bg;function zg(t){Bg=t}function Wg(){return Bg}let Za=null;function pt(){const t=wt();if(!t)return console.warn("Client store not set; cannot get outbox coordinator yet."),null;if(Za)return Za;const s=t.getState().offline.outbox,e=Tt._fromOutbox(s);return Za=e,e}const rk=(t,s)=>{const e=new s(t);return zg(e),Vg(t),e};class dk{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 dk(this).then(s)}async run(s){if(this.next)return this.next.run(s);{if(console.debug("Middleware finished. Performing request:",s.payload.url),!wt())throw new Error("Client store not set");const n=Wg();if(!n)throw new Error("Client SDK not set");return Mg(s,n)}}}class qg extends Ja{async run(s){return super.run(s)}}class Cg extends Ja{async run(s){return super.run(s)}}const jg=new qg().then(new Cg).compile();function $g(t){var s;return(s=jg[0])==null?void 0:s.run(t)}var Dg=(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))(Dg||{});i.ALL_MIDDLEWARE=jg,i.APIError=$,i.ATTACHMENT_MODEL_DEFAULT_PAGE_SIZE=Tg,i.AgentService=VM,i.AssetAttachmentService=BM,i.AssetProcedureService=$M,i.AssetProcedureStepFieldValuesAttachmentService=NM,i.AssetProcedureStepFieldValuesService=HM,i.AssetProcedureStepFieldsAttachmentService=UM,i.AssetProcedureStepFieldsService=LM,i.AssetProcedureStepService=GM,i.AssetProcedureTypeAttachmentService=zM,i.AssetProcedureTypeFieldValuesAttachmentService=CM,i.AssetProcedureTypeFieldValuesService=jM,i.AssetProcedureTypeFieldsAttachmentService=WM,i.AssetProcedureTypeFieldsService=qM,i.AssetProcedureTypeService=DM,i.AssetService=KM,i.AssetStageCompletionService=YM,i.AssetStageService=ZM,i.AssetStatusType=sc,i.AssetTypeAttachmentService=JM,i.AssetTypeFieldValuesAttachmentService=xM,i.AssetTypeFieldValuesService=eR,i.AssetTypeFieldsAttachmentService=XM,i.AssetTypeFieldsService=QM,i.AssetTypeIdentifierService=tR,i.AssetTypeIdentifierValueService=sR,i.AssetTypeService=iR,i.AssetTypeStatusService=nR,i.AttachmentModel=ic,i.BaseApiService=mt,i.BaseModelApiService=St,i.BaseOfflineAttachmentModelService=L,i.BaseOfflineModelApiService=k,i.BaseSDK=ck,i.COMMON_AUTO_FIELDS=uc,i.CategoryService=aR,i.DEFAULT_ISSUE_PRIORITY=Qg,i.DEFAULT_PAGE_SIZE=Sg,i.DISCARD_HTTP_STATUSES=Na,i.DeferredPromise=hs,i.DocumentAttachmentService=cR,i.DocumentService=rR,i.EMPTY_ARRAY=xa,i.EMPTY_OBJECT=ec,i.EmailDomainsService=dR,i.EmailVerificationService=lR,i.FileService=uR,i.FormIdentifierService=hR,i.FormIdentifierValueService=mR,i.FormRevisionAttachmentService=pR,i.FormRevisionService=yR,i.FormService=fR,i.FormSubmissionAttachmentService=AR,i.FormSubmissionService=SR,i.GeoImageService=TR,i.HttpMethod=m,i.IssueAssociationService=wR,i.IssueAttachmentService=OR,i.IssueCommentAttachmentService=IR,i.IssueCommentService=FR,i.IssuePriority=us,i.IssueService=PR,i.IssueStatusType=nc,i.IssueTypeAttachmentService=gR,i.IssueTypeFieldValuesAttachmentService=MR,i.IssueTypeFieldValuesService=RR,i.IssueTypeFieldsAttachmentService=bR,i.IssueTypeFieldsService=_R,i.IssueTypeIdentifierService=kR,i.IssueTypeIdentifierValueService=vR,i.IssueTypeService=ER,i.IssueTypeStatusService=VR,i.IssueUpdateChange=j,i.IssueUpdateService=BR,i.JWTService=qR,i.MAX_SERVICE_BATCH_SIZE=U,i.OUTBOX_RETRY_DELAY=cc,i.OfflineAnalyticsMiddleware=qg,i.OfflineMiddleware=Ja,i.OrganizationAccessLevel=tc,i.OrganizationAccessService=CR,i.OrganizationService=jR,i.OutboxCoordinator=Tt,i.ProjectAccessService=$R,i.ProjectAttachmentService=DR,i.ProjectFileService=UR,i.ProjectService=LR,i.RESET_ORGANIZATION_STATE=R,i.RESET_PROJECT_STATE=W,i.RESET_STATE=b,i.RateLimitingMiddleware=Cg,i.SelectorBuilder=Ib,i.TeamMembershipService=NR,i.TeamService=HR,i.UNKNOWN_ERROR_MESSAGE=At,i.UserService=GR,i.VERSION_REDUCER_KEY=Ot,i.VerificationCodeType=Dg,i.WorkflowReviewType=ac,i.WorkflowService=KR,i.WorkflowStepAssigneeService=YR,i.WorkflowStepCommentAttachmentService=ZR,i.WorkflowStepCommentService=JR,i.WorkflowStepCompletionService=XR,i.WorkflowStepFieldValuesAttachmentService=QR,i.WorkflowStepFieldValuesService=xR,i.WorkflowStepFieldsAttachmentService=ek,i.WorkflowStepFieldsService=tk,i.WorkflowStepReviewRequestService=sk,i.WorkflowStepReviewService=ik,i.WorkflowStepService=nk,i.WorkflowTypeService=ak,i._setLatestRetryTime=bw,i.addAsset=Dl,i.addAssetAttachment=bc,i.addAssetAttachments=Os,i.addAssetProcedure=ed,i.addAssetProcedureStep=Rl,i.addAssetProcedureStepFieldValues=ml,i.addAssetProcedureStepFieldValuesAttachment=el,i.addAssetProcedureStepFieldValuesAttachments=Ns,i.addAssetProcedureStepFieldValuesMany=pl,i.addAssetProcedureStepFields=Dd,i.addAssetProcedureStepFieldsAttachment=_d,i.addAssetProcedureStepFieldsAttachments=Md,i.addAssetProcedureStepFieldsMany=Ud,i.addAssetProcedureSteps=kl,i.addAssetProcedureType=md,i.addAssetProcedureTypeAttachment=jc,i.addAssetProcedureTypeAttachments=$c,i.addAssetProcedureTypeFieldValues=$r,i.addAssetProcedureTypeFieldValuesAttachment=_r,i.addAssetProcedureTypeFieldValuesAttachments=ks,i.addAssetProcedureTypeFieldValuesMany=Dr,i.addAssetProcedureTypeFields=mr,i.addAssetProcedureTypeFieldsAttachment=xc,i.addAssetProcedureTypeFieldsAttachments=er,i.addAssetProcedureTypeFieldsMany=pr,i.addAssetProcedureTypes=pd,i.addAssetProcedures=zs,i.addAssetStage=So,i.addAssetStageCompletion=eo,i.addAssetStageCompletions=to,i.addAssetStages=To,i.addAssetType=Th,i.addAssetTypeAttachment=Ro,i.addAssetTypeAttachments=ni,i.addAssetTypeFieldValues=Ru,i.addAssetTypeFieldValuesAttachment=fu,i.addAssetTypeFieldValuesAttachments=ui,i.addAssetTypeFieldValuesMany=ku,i.addAssetTypeFields=su,i.addAssetTypeFieldsAttachment=Uo,i.addAssetTypeFieldsAttachments=Lo,i.addAssetTypeFieldsMany=iu,i.addAssetTypeIdentifier=Lu,i.addAssetTypeIdentifierValue=ih,i.addAssetTypeIdentifierValues=nh,i.addAssetTypeIdentifiers=Nu,i.addAssetTypeStatus=vh,i.addAssetTypeStatuses=Eh,i.addAssetTypes=wh,i.addAssets=Xs,i.addCategories=Zh,i.addCategory=Yh,i.addConversation=wc,i.addConversations=Fb,i.addDocument=Om,i.addDocumentAttachment=rm,i.addDocumentAttachments=dm,i.addDocuments=Im,i.addEmailDomain=zm,i.addEmailDomains=Wm,i.addForm=Qp,i.addFormIdentifier=ep,i.addFormIdentifierValue=pp,i.addFormIdentifierValues=yp,i.addFormIdentifiers=tp,i.addFormRevision=qi,i.addFormRevisionAttachment=Mp,i.addFormRevisionAttachments=Rp,i.addFormRevisions=Ci,i.addFormSubmission=by,i.addFormSubmissionAttachment=hy,i.addFormSubmissionAttachments=Hi,i.addFormSubmissions=Xi,i.addForms=xp,i.addGeoImage=jy,i.addGeoImages=$y,i.addIssue=xf,i.addIssueAssociation=tf,i.addIssueAssociations=Ht,i.addIssueAttachment=mf,i.addIssueAttachments=an,i.addIssueComment=$f,i.addIssueCommentAttachment=bf,i.addIssueCommentAttachments=_f,i.addIssueComments=Df,i.addIssueType=tT,i.addIssueTypeAttachment=hA,i.addIssueTypeAttachments=mA,i.addIssueTypeFieldValues=$A,i.addIssueTypeFieldValuesAttachment=pS,i.addIssueTypeFieldValuesAttachments=In,i.addIssueTypeFieldValuesMany=DA,i.addIssueTypeFields=eS,i.addIssueTypeFieldsAttachment=bA,i.addIssueTypeFieldsAttachments=_A,i.addIssueTypeFieldsMany=tS,i.addIssueTypeIdentifier=_S,i.addIssueTypeIdentifierValue=DS,i.addIssueTypeIdentifierValues=US,i.addIssueTypeIdentifiers=MS,i.addIssueTypeStatus=yT,i.addIssueTypeStatuses=fT,i.addIssueTypes=sT,i.addIssueUpdate=Bn,i.addIssueUpdates=zn,i.addIssues=mn,i.addOrganization=hw,i.addOrganizationAccess=ZT,i.addOrganizationAccesses=JT,i.addOrganizations=uw,i.addProject=PO,i.addProjectAccess=kw,i.addProjectAccesses=vw,i.addProjectAttachment=Lw,i.addProjectAttachments=Nw,i.addProjectFile=aO,i.addProjectFiles=cO,i.addProjects=FO,i.addTeam=JO,i.addTeamMembership=WO,i.addTeamMemberships=qO,i.addTeams=XO,i.addUser=Dn,i.addUsers=$T,i.addWorkflow=oI,i.addWorkflowStep=NP,i.addWorkflowStepAssignee=FI,i.addWorkflowStepAssignees=ra,i.addWorkflowStepComment=YI,i.addWorkflowStepCommentAttachment=WI,i.addWorkflowStepCommentAttachments=ss,i.addWorkflowStepComments=ma,i.addWorkflowStepCompletion=rF,i.addWorkflowStepCompletions=fa,i.addWorkflowStepFieldValues=VF,i.addWorkflowStepFieldValuesAttachment=wF,i.addWorkflowStepFieldValuesAttachments=Ta,i.addWorkflowStepFieldValuesMany=Fa,i.addWorkflowStepFields=aP,i.addWorkflowStepFieldsAttachment=GF,i.addWorkflowStepFieldsAttachments=ba,i.addWorkflowStepFieldsMany=cP,i.addWorkflowStepReview=vP,i.addWorkflowStepReviewRequest=SP,i.addWorkflowStepReviewRequests=Ea,i.addWorkflowStepReviews=za,i.addWorkflowSteps=Ca,i.addWorkflowType=ig,i.addWorkflowTypes=ng,i.addWorkflows=na,i.agentsReducer=Fc,i.agentsSlice=Ss,i.areArraysEqual=sb,i.assetAttachmentReducer=Wc,i.assetAttachmentSlice=ws,i.assetProcedureReducer=cd,i.assetProcedureSlice=Bs,i.assetProcedureStepFieldValuesAttachmentReducer=ol,i.assetProcedureStepFieldValuesAttachmentSlice=Ls,i.assetProcedureStepFieldValuesReducer=Pl,i.assetProcedureStepFieldValuesSlice=Ks,i.assetProcedureStepFieldsAttachmentReducer=Cd,i.assetProcedureStepFieldsAttachmentSlice=js,i.assetProcedureStepFieldsReducer=Xd,i.assetProcedureStepFieldsSlice=Ds,i.assetProcedureStepReducer=zl,i.assetProcedureStepSlice=Ys,i.assetProcedureTypeAttachmentReducer=Kc,i.assetProcedureTypeAttachmentSlice=Ps,i.assetProcedureTypeFieldValuesAttachmentReducer=Vr,i.assetProcedureTypeFieldValuesAttachmentSlice=Rs,i.assetProcedureTypeFieldValuesReducer=Yr,i.assetProcedureTypeFieldValuesSlice=Vs,i.assetProcedureTypeFieldsAttachmentReducer=rr,i.assetProcedureTypeFieldsAttachmentSlice=bs,i.assetProcedureTypeFieldsReducer=Or,i.assetProcedureTypeFieldsSlice=Ms,i.assetProcedureTypeReducer=Od,i.assetProcedureTypeSlice=qs,i.assetReducer=Xl,i.assetSlice=Js,i.assetStageCompletionReducer=lo,i.assetStageCompletionSlice=xs,i.assetStageReducer=Po,i.assetStageSlice=ei,i.assetTypeAttachmentReducer=jo,i.assetTypeAttachmentSlice=ii,i.assetTypeFieldValuesAttachmentReducer=bu,i.assetTypeFieldValuesAttachmentSlice=oi,i.assetTypeFieldValuesReducer=$u,i.assetTypeFieldValuesSlice=pi,i.assetTypeFieldsAttachmentReducer=xo,i.assetTypeFieldsAttachmentSlice=ri,i.assetTypeFieldsReducer=mu,i.assetTypeFieldsSlice=li,i.assetTypeIdentifierReducer=eh,i.assetTypeIdentifierSlice=yi,i.assetTypeIdentifierValueReducer=ph,i.assetTypeIdentifierValueSlice=Ai,i.assetTypeReducer=Mh,i.assetTypeSlice=Si,i.assetTypeStatusReducer=Uh,i.assetTypeStatusSlice=wi,i.assetTypeStatusSortFn=pc,i.authReducer=Hh,i.authSlice=$t,i.baseReducer=SM,i.baseReducers=La,i.blobToBase64=ub,i.categoryReducer=nm,i.categorySlice=Ii,i.clearTokens=r_,i.constructUploadedFilePayloads=ob,i.createModelAdapter=M,i.createOfflineAction=Iw,i.createPayload=E,i.createSelectionAdapter=xg,i.deleteAsset=Nl,i.deleteAssetAttachment=vc,i.deleteAssetAttachments=Is,i.deleteAssetProcedure=id,i.deleteAssetProcedureStep=Vl,i.deleteAssetProcedureStepFieldValues=Tl,i.deleteAssetProcedureStepFieldValuesAttachment=al,i.deleteAssetProcedureStepFieldValuesAttachments=Hs,i.deleteAssetProcedureStepFieldValuesMany=wl,i.deleteAssetProcedureStepFields=Kd,i.deleteAssetProcedureStepFieldsAttachment=Vd,i.deleteAssetProcedureStepFieldsAttachments=Bd,i.deleteAssetProcedureStepFieldsMany=Yd,i.deleteAssetProcedureSteps=Bl,i.deleteAssetProcedureType=Ad,i.deleteAssetProcedureTypeAttachment=Hc,i.deleteAssetProcedureTypeAttachments=Gc,i.deleteAssetProcedureTypeFieldValues=Gr,i.deleteAssetProcedureTypeFieldValuesAttachment=Er,i.deleteAssetProcedureTypeFieldValuesAttachments=vs,i.deleteAssetProcedureTypeFieldValuesMany=Kr,i.deleteAssetProcedureTypeFields=Tr,i.deleteAssetProcedureTypeFieldsAttachment=ar,i.deleteAssetProcedureTypeFieldsAttachments=cr,i.deleteAssetProcedureTypeFieldsMany=wr,i.deleteAssetProcedureTypes=Sd,i.deleteAssetProcedures=Ws,i.deleteAssetStage=Io,i.deleteAssetStageCompletion=co,i.deleteAssetStageCompletions=ro,i.deleteAssetStages=Fo,i.deleteAssetType=Fh,i.deleteAssetTypeAttachment=Bo,i.deleteAssetTypeAttachments=ai,i.deleteAssetTypeFieldValues=zu,i.deleteAssetTypeFieldValuesAttachment=Ou,i.deleteAssetTypeFieldValuesAttachments=hi,i.deleteAssetTypeFieldValuesMany=Wu,i.deleteAssetTypeFields=du,i.deleteAssetTypeFieldsAttachment=Yo,i.deleteAssetTypeFieldsAttachments=Zo,i.deleteAssetTypeFieldsMany=lu,i.deleteAssetTypeIdentifier=Zu,i.deleteAssetTypeIdentifierValue=lh,i.deleteAssetTypeIdentifierValues=oh,i.deleteAssetTypeIdentifiers=Ju,i.deleteAssetTypeStatus=qh,i.deleteAssetTypeStatuses=Ch,i.deleteAssetTypes=Ph,i.deleteAssets=Qs,i.deleteCategories=tm,i.deleteCategory=em,i.deleteConversation=bb,i.deleteConversations=_b,i.deleteDocument=_m,i.deleteDocumentAttachment=mm,i.deleteDocumentAttachments=pm,i.deleteDocuments=Mm,i.deleteEmailDomain=Dm,i.deleteEmailDomains=Um,i.deleteForm=ny,i.deleteFormIdentifier=cp,i.deleteFormIdentifierValue=wp,i.deleteFormIdentifierValues=Op,i.deleteFormIdentifiers=rp,i.deleteFormRevision=ji,i.deleteFormRevisionAttachment=Bp,i.deleteFormRevisionAttachments=zp,i.deleteFormRevisions=$i,i.deleteFormSubmission=Ry,i.deleteFormSubmissionAttachment=Ay,i.deleteFormSubmissionAttachments=Gi,i.deleteFormSubmissions=Qi,i.deleteForms=ay,i.deleteGeoImage=Ly,i.deleteGeoImages=Ny,i.deleteIssue=nA,i.deleteIssueAssociation=sf,i.deleteIssueAssociations=Gt,i.deleteIssueAttachment=Sf,i.deleteIssueAttachments=cn,i.deleteIssueComment=Gf,i.deleteIssueCommentAttachment=Ef,i.deleteIssueCommentAttachments=Vf,i.deleteIssueComments=Kf,i.deleteIssueType=rT,i.deleteIssueTypeAttachment=SA,i.deleteIssueTypeAttachments=TA,i.deleteIssueTypeFieldValues=GA,i.deleteIssueTypeFieldValuesAttachment=TS,i.deleteIssueTypeFieldValuesAttachments=Fn,i.deleteIssueTypeFieldValuesMany=KA,i.deleteIssueTypeFields=cS,i.deleteIssueTypeFieldsAttachment=EA,i.deleteIssueTypeFieldsAttachments=VA,i.deleteIssueTypeFieldsMany=rS,i.deleteIssueTypeIdentifier=VS,i.deleteIssueTypeIdentifierValue=KS,i.deleteIssueTypeIdentifierValues=YS,i.deleteIssueTypeIdentifiers=BS,i.deleteIssueTypeStatus=OT,i.deleteIssueTypeStatuses=IT,i.deleteIssueTypes=dT,i.deleteIssueUpdate=Wn,i.deleteIssueUpdates=qn,i.deleteIssues=pn,i.deleteOrganization=yw,i.deleteOrganizationAccess=tw,i.deleteOrganizationAccesses=sw,i.deleteOrganizations=fw,i.deleteProject=_O,i.deleteProjectAccess=Ww,i.deleteProjectAccesses=qw,i.deleteProjectAttachment=Zw,i.deleteProjectAttachments=Jw,i.deleteProjectFile=lO,i.deleteProjectFiles=oO,i.deleteProjects=MO,i.deleteTeam=sI,i.deleteTeamMembership=UO,i.deleteTeamMemberships=LO,i.deleteTeams=iI,i.deleteUser=Un,i.deleteUsers=LT,i.deleteWorkflow=yI,i.deleteWorkflowStep=ZP,i.deleteWorkflowStepAssignee=MI,i.deleteWorkflowStepAssignees=da,i.deleteWorkflowStepComment=xI,i.deleteWorkflowStepCommentAttachment=DI,i.deleteWorkflowStepCommentAttachments=is,i.deleteWorkflowStepComments=pa,i.deleteWorkflowStepCompletion=hF,i.deleteWorkflowStepCompletions=Aa,i.deleteWorkflowStepFieldValues=CF,i.deleteWorkflowStepFieldValuesAttachment=gF,i.deleteWorkflowStepFieldValuesAttachments=wa,i.deleteWorkflowStepFieldValuesMany=Pa,i.deleteWorkflowStepFields=uP,i.deleteWorkflowStepFieldsAttachment=XF,i.deleteWorkflowStepFieldsAttachments=_a,i.deleteWorkflowStepFieldsMany=hP,i.deleteWorkflowStepReview=WP,i.deleteWorkflowStepReviewRequest=FP,i.deleteWorkflowStepReviewRequests=Va,i.deleteWorkflowStepReviews=Wa,i.deleteWorkflowSteps=ja,i.deleteWorkflowType=lg,i.deleteWorkflowTypes=og,i.deleteWorkflows=aa,i.dequeue=_g,i.discard=Rg,i.documentAttachmentReducer=Sm,i.documentAttachmentSlice=gi,i.documentSlice=_i,i.documentsReducer=Rm,i.downloadFile=hb,i.downloadInMemoryFile=lb,i.emailDomainsReducer=Gm,i.emailDomainsSlice=Ri,i.emailRegex=Tb,i.enqueue=bg,i.enqueueRequest=Pw,i.extractResponseFromError=vg,i.fallbackToEmptyArray=T,i.fallbackToEmptyObject=kt,i.fileReducer=Xm,i.fileSlice=vi,i.fileToBlob=lc,i.formIdentifierReducer=up,i.formIdentifierSlice=Ei,i.formIdentifierValueReducer=gp,i.formIdentifierValueSlice=Bi,i.formReducer=cy,i.formRevisionAttachmentReducer=jp,i.formRevisionAttachmentSlice=zi,i.formRevisionReducer=Zp,i.formRevisionsSlice=Wi,i.formSlice=Ui,i.formSubmissionAttachmentReducer=Oy,i.formSubmissionAttachmentSlice=Ni,i.formSubmissionReducer=By,i.formSubmissionSlice=Ji,i.geoImageReducer=Yy,i.geoImageSlice=en,i.getAssetProcedureStepSubTree=mc,i.getAssetProcedureStepTrees=wb,i.getClientSDK=Wg,i.getClientStore=wt,i.getDocumentSubTree=Ac,i.getDocumentTrees=Ob,i.getFileIdentifier=db,i.getFileS3Key=fs,i.getLocalDateString=rc,i.getLocalRelativeDateString=cb,i.getOutboxCoordinator=pt,i.getRenamedFile=dc,i.getRequestDescription=w,i.hashFile=ft,i.initSDK=rk,i.initializeAssetAttachments=gc,i.initializeAssetProcedureStepFieldValues=hl,i.initializeAssetProcedureStepFieldValuesAttachments=xd,i.initializeAssetProcedureStepFields=$d,i.initializeAssetProcedureStepFieldsAttachments=bd,i.initializeAssetProcedureSteps=bl,i.initializeAssetProcedureTypeAttachments=Cc,i.initializeAssetProcedureTypeFieldValues=jr,i.initializeAssetProcedureTypeFieldValuesAttachments=br,i.initializeAssetProcedureTypeFields=hr,i.initializeAssetProcedureTypeFieldsAttachments=Qc,i.initializeAssetProcedureTypes=hd,i.initializeAssetProcedures=xr,i.initializeAssetStageCompletions=xl,i.initializeAssetStages=yo,i.initializeAssetTypeAttachments=Mo,i.initializeAssetTypeFieldValues=Mu,i.initializeAssetTypeFieldValuesAttachments=yu,i.initializeAssetTypeFields=tu,i.initializeAssetTypeFieldsAttachments=Do,i.initializeAssetTypeIdentifierValues=sh,i.initializeAssetTypeIdentifiers=Uu,i.initializeAssetTypeStatuses=kh,i.initializeAssetTypes=fh,i.initializeAssets=$l,i.initializeCategories=Kh,i.initializeConversations=Tc,i.initializeDocumentAttachments=cm,i.initializeDocuments=wm,i.initializeEmailDomains=Bm,i.initializeFormIdentifierValues=mp,i.initializeFormIdentifiers=xm,i.initializeFormRevisionAttachments=_p,i.initializeFormRevisions=Dp,i.initializeFormSubmissionAttachments=uy,i.initializeFormSubmissions=Fy,i.initializeForms=Xp,i.initializeGeoImages=Wy,i.initializeIssueAssociations=Jy,i.initializeIssueAttachments=hf,i.initializeIssueCommentAttachments=gf,i.initializeIssueComments=jf,i.initializeIssueTypeAttachments=uA,i.initializeIssueTypeFieldValues=jA,i.initializeIssueTypeFieldValuesAttachments=mS,i.initializeIssueTypeFields=xA,i.initializeIssueTypeFieldsAttachments=gA,i.initializeIssueTypeIdentifierValues=$S,i.initializeIssueTypeIdentifiers=bS,i.initializeIssueTypeStatuses=pT,i.initializeIssueTypes=eT,i.initializeIssueUpdates=_T,i.initializeIssues=Qf,i.initializeOrganizationAccesses=YT,i.initializeOrganizations=dw,i.initializeProjectAccesses=Rw,i.initializeProjectAttachments=Uw,i.initializeProjectFiles=sO,i.initializeProjects=wO,i.initializeTeamMemberships=zO,i.initializeTeams=ZO,i.initializeUsers=qT,i.initializeWorkflowStepAssignees=II,i.initializeWorkflowStepCommentAttachments=zI,i.initializeWorkflowStepComments=KI,i.initializeWorkflowStepCompletions=cF,i.initializeWorkflowStepFieldValues=EF,i.initializeWorkflowStepFieldValuesAttachments=TF,i.initializeWorkflowStepFields=nP,i.initializeWorkflowStepFieldsAttachments=HF,i.initializeWorkflowStepReviewRequests=AP,i.initializeWorkflowStepReviews=kP,i.initializeWorkflowSteps=LP,i.initializeWorkflowTypes=sg,i.initializeWorkflows=lI,i.isToday=ab,i.issueAssociationReducer=of,i.issueAssociationSlice=sn,i.issueAttachmentReducer=Ff,i.issueAttachmentSlice=nn,i.issueCommentAttachmentReducer=qf,i.issueCommentAttachmentSlice=dn,i.issueCommentReducer=Jf,i.issueCommentSlice=on,i.issueReducer=lA,i.issueSlice=hn,i.issueTypeAttachmentReducer=FA,i.issueTypeAttachmentSlice=yn,i.issueTypeFieldValuesAttachmentReducer=PS,i.issueTypeFieldValuesAttachmentSlice=On,i.issueTypeFieldValuesReducer=XA,i.issueTypeFieldValuesSlice=Tn,i.issueTypeFieldsAttachmentReducer=qA,i.issueTypeFieldsAttachmentSlice=An,i.issueTypeFieldsReducer=uS,i.issueTypeFieldsSlice=wn,i.issueTypeIdentifierReducer=CS,i.issueTypeIdentifierSlice=gn,i.issueTypeIdentifierValueReducer=QS,i.issueTypeIdentifierValueSlice=_n,i.issueTypeReducer=hT,i.issueTypeSlice=Mn,i.issueTypeStatusReducer=gT,i.issueTypeStatusSlice=kn,i.issueTypeStatusSortFn=yc,i.issueUpdateReducer=zT,i.issueUpdateSlice=Vn,i.logOnlyOnce=mb,i.markAsDeleted=gw,i.markForDeletion=L_,i.memoize=ps,i.organizationAccessReducer=iw,i.organizationAccessSlice=Nn,i.organizationReducer=Ow,i.organizationSlice=Hn,i.outboxReducer=_w,i.outboxSlice=Gn,i.overmapEnhancer=_M,i.overmapReducer=TM,i.overmapReducers=Ag,i.performRequest=Ya,i.performRequestFromAction=Mg,i.projectAccessReducer=Cw,i.projectAccessSlice=Kn,i.projectAttachmentReducer=eO,i.projectAttachmentSlice=Zn,i.projectFileReducer=SO,i.projectFileSlice=Xn,i.projectReducer=RO,i.projectSlice=Qn,i.rehydratedReducer=VO,i.rehydratedSlice=xn,i.restructureSelectorWithArgs=S,i.runMiddleware=$g,i.saveActiveProjectFileBounds=mO,i.selectAccessToken=d_,i.selectAccessesByUserOfProject=H_,i.selectAccessibleProjects=J_,i.selectActiveOrganizationAccess=j_,i.selectActiveProjectFileId=Y_,i.selectAllDocumentAttachments=bi,i.selectAssetAttachmentById=Vc,i.selectAssetAttachmentMapping=Ec,i.selectAssetAttachments=Fs,i.selectAssetAttachmentsByIds=Bc,i.selectAssetById=Zl,i.selectAssetProcedureById=ld,i.selectAssetProcedureStepById=Wl,i.selectAssetProcedureStepFieldValues=It,i.selectAssetProcedureStepFieldValuesAttachmentById=rl,i.selectAssetProcedureStepFieldValuesAttachments=Gs,i.selectAssetProcedureStepFieldValuesAttachmentsByIds=dl,i.selectAssetProcedureStepFieldValuesAttachmentsMapping=cl,i.selectAssetProcedureStepFieldValuesById=Il,i.selectAssetProcedureStepFieldValuesByIds=Fl,i.selectAssetProcedureStepFieldValuesMapping=Ol,i.selectAssetProcedureStepFieldValuesOfAsset=Ub,i.selectAssetProcedureStepFieldValuesOfAssetProcedure=Lb,i.selectAssetProcedureStepFieldValuesOfAssetProcedureStep=Nb,i.selectAssetProcedureStepFields=zt,i.selectAssetProcedureStepFieldsAttachmentById=Wd,i.selectAssetProcedureStepFieldsAttachments=$s,i.selectAssetProcedureStepFieldsAttachmentsByIds=qd,i.selectAssetProcedureStepFieldsAttachmentsMapping=zd,i.selectAssetProcedureStepFieldsById=Zd,i.selectAssetProcedureStepFieldsByIds=Jd,i.selectAssetProcedureStepFieldsMapping=Us,i.selectAssetProcedureStepFieldsOfAssetProcedureStep=jb,i.selectAssetProcedureStepMapping=Wt,i.selectAssetProcedureSteps=Zs,i.selectAssetProcedureStepsByIds=ql,i.selectAssetProcedureStepsMappingOfAssetProcedureType=Hb,i.selectAssetProcedureStepsOfAssetProcedureType=Gb,i.selectAssetProcedureTypeAttachmentById=Zc,i.selectAssetProcedureTypeAttachmentMapping=Yc,i.selectAssetProcedureTypeAttachments=gs,i.selectAssetProcedureTypeAttachmentsByIds=Jc,i.selectAssetProcedureTypeById=Fd,i.selectAssetProcedureTypeFieldValues=Vt,i.selectAssetProcedureTypeFieldValuesAttachmentById=zr,i.selectAssetProcedureTypeFieldValuesAttachments=Es,i.selectAssetProcedureTypeFieldValuesAttachmentsByIds=Wr,i.selectAssetProcedureTypeFieldValuesAttachmentsMapping=Br,i.selectAssetProcedureTypeFieldValuesById=Jr,i.selectAssetProcedureTypeFieldValuesByIds=Xr,i.selectAssetProcedureTypeFieldValuesMapping=Zr,i.selectAssetProcedureTypeFieldValuesOfAsset=Bb,i.selectAssetProcedureTypeFields=Et,i.selectAssetProcedureTypeFieldsAttachmentById=lr,i.selectAssetProcedureTypeFieldsAttachments=_s,i.selectAssetProcedureTypeFieldsAttachmentsByIds=or,i.selectAssetProcedureTypeFieldsAttachmentsMapping=dr,i.selectAssetProcedureTypeFieldsById=Fr,i.selectAssetProcedureTypeFieldsByIds=Pr,i.selectAssetProcedureTypeFieldsMapping=Ir,i.selectAssetProcedureTypeFieldsOfAssetProcedureType=Eb,i.selectAssetProcedureTypes=Cs,i.selectAssetProcedureTypesByIds=Pd,i.selectAssetProcedureTypesMapping=Id,i.selectAssetProcedureTypesOfOrganization=qb,i.selectAssetProcedures=Bt,i.selectAssetProceduresByIds=od,i.selectAssetProceduresMapping=rd,i.selectAssetProceduresOfAssetProcedureType=dd,i.selectAssetProceduresOfAssetType=Wb,i.selectAssetStageById=go,i.selectAssetStageCompletionById=ho,i.selectAssetStageCompletionMapping=oo,i.selectAssetStageCompletions=uo,i.selectAssetStageCompletionsByIds=mo,i.selectAssetStages=si,i.selectAssetStagesByIds=bo,i.selectAssetStagesMappingOfAssetProcedureType=Yb,i.selectAssetStagesOfAssetProcedureType=Zb,i.selectAssetTypeAttachmentById=Wo,i.selectAssetTypeAttachmentMapping=zo,i.selectAssetTypeAttachments=ci,i.selectAssetTypeAttachmentsByIds=qo,i.selectAssetTypeById=bh,i.selectAssetTypeFieldValues=Ct,i.selectAssetTypeFieldValuesAttachmentById=Fu,i.selectAssetTypeFieldValuesAttachments=mi,i.selectAssetTypeFieldValuesAttachmentsByIds=Pu,i.selectAssetTypeFieldValuesAttachmentsMapping=Iu,i.selectAssetTypeFieldValuesById=Cu,i.selectAssetTypeFieldValuesByIds=ju,i.selectAssetTypeFieldValuesMapping=qu,i.selectAssetTypeFieldValuesOfAsset=xb,i.selectAssetTypeFields=Ft,i.selectAssetTypeFieldsAttachmentById=Xo,i.selectAssetTypeFieldsAttachments=di,i.selectAssetTypeFieldsAttachmentsByIds=Qo,i.selectAssetTypeFieldsAttachmentsMapping=Jo,i.selectAssetTypeFieldsById=uu,i.selectAssetTypeFieldsByIds=hu,i.selectAssetTypeFieldsMapping=ou,i.selectAssetTypeFieldsOfAssetType=Xb,i.selectAssetTypeIdentifierById=Qu,i.selectAssetTypeIdentifierMapping=Xu,i.selectAssetTypeIdentifierValueById=hh,i.selectAssetTypeIdentifierValueMapping=uh,i.selectAssetTypeIdentifierValues=jt,i.selectAssetTypeIdentifierValuesByIds=mh,i.selectAssetTypeIdentifierValuesOfAsset=s_,i.selectAssetTypeIdentifierValuesOfIdentifier=i_,i.selectAssetTypeIdentifiers=fi,i.selectAssetTypeIdentifiersByIds=xu,i.selectAssetTypeIdentifiersOfAssetType=t_,i.selectAssetTypeStatusById=$h,i.selectAssetTypeStatusMapping=jh,i.selectAssetTypeStatuses=Oi,i.selectAssetTypeStatusesByIds=Dh,i.selectAssetTypeStatusesOfAssetType=a_,i.selectAssetTypeValuesOfAssetType=e_,i.selectAssetTypes=Ti,i.selectAssetTypesByIds=_h,i.selectAssetTypesMapping=gh,i.selectAssetTypesOfOrganization=n_,i.selectAssets=qt,i.selectAssetsByIds=Jl,i.selectAssetsMapping=Kl,i.selectAssetsOfAssetType=Yl,i.selectAssetsOfProject=Kb,i.selectAttachmentsOfAsset=zc,i.selectAttachmentsOfAssetProcedureStepFieldValues=ll,i.selectAttachmentsOfAssetProcedureStepFields=Cb,i.selectAttachmentsOfAssetProcedureType=kb,i.selectAttachmentsOfAssetProcedureTypeFieldValues=qr,i.selectAttachmentsOfAssetProcedureTypeFields=vb,i.selectAttachmentsOfAssetType=Co,i.selectAttachmentsOfAssetTypeFieldValues=gu,i.selectAttachmentsOfAssetTypeFields=Jb,i.selectAttachmentsOfDocument=u_,i.selectAttachmentsOfFormRevision=T_,i.selectAttachmentsOfFormSubmission=wy,i.selectAttachmentsOfIssue=wf,i.selectAttachmentsOfIssueComment=F_,i.selectAttachmentsOfIssueType=b_,i.selectAttachmentsOfIssueTypeFieldValues=FS,i.selectAttachmentsOfIssueTypeFields=__,i.selectAttachmentsOfProject=K_,i.selectAttachmentsOfWorkflowStepComment=ua,i.selectAttachmentsOfWorkflowStepFieldValues=RF,i.selectAttachmentsOfWorkflowStepFields=xF,i.selectCategories=Fi,i.selectCategoriesByIds=im,i.selectCategoriesOfProject=o_,i.selectCategoryById=Pi,i.selectCategoryMapping=sm,i.selectCommentsOfIssue=P_,i.selectCommentsOfWorkflow=iF,i.selectCommentsOfWorkflowStep=rM,i.selectConversation=Rb,i.selectConversationMapping=Ts,i.selectConversations=Mb,i.selectCurrentUser=HT,i.selectDeletedRequests=D_,i.selectDescendantsOfAssetProcedureStep=Cl,i.selectDescendantsOfDocument=Em,i.selectDocumentAttachmentById=fm,i.selectDocumentAttachmentMapping=ym,i.selectDocumentAttachmentsByIds=Am,i.selectDocumentById=km,i.selectDocuments=Dt,i.selectDocumentsByIds=vm,i.selectDocumentsMapping=Mi,i.selectEmailDomainById=Nm,i.selectEmailDomains=ki,i.selectEmailDomainsAsMapping=Lm,i.selectEmailDomainsByIds=Hm,i.selectEmailDomainsOfOrganization=p_,i.selectFieldValuesOfAssetProcedure=zb,i.selectFormById=dy,i.selectFormIdentifierById=lp,i.selectFormIdentifierMapping=dp,i.selectFormIdentifierValueById=Fp,i.selectFormIdentifierValueMapping=Ip,i.selectFormIdentifierValues=Ut,i.selectFormIdentifierValuesByIds=Pp,i.selectFormIdentifierValuesOfFormSubmission=A_,i.selectFormIdentifierValuesOfIdentifier=S_,i.selectFormIdentifiers=Vi,i.selectFormIdentifiersByIds=op,i.selectFormIdentifiersOfForm=f_,i.selectFormMapping=ry,i.selectFormRevisionAttachmentById=qp,i.selectFormRevisionAttachments=Wp,i.selectFormRevisionAttachmentsByIds=Cp,i.selectFormRevisionAttachmentsMapping=Lt,i.selectFormRevisionById=Gp,i.selectFormRevisionMapping=Di,i.selectFormRevisions=Nt,i.selectFormRevisionsByIds=Kp,i.selectFormRevisionsOfForm=Yp,i.selectFormSubmissionAttachemntsByIds=Zi,i.selectFormSubmissionAttachmentById=Sy,i.selectFormSubmissionAttachments=Yi,i.selectFormSubmissionAttachmentsByIds=Ty,i.selectFormSubmissionAttachmentsMapping=Ki,i.selectFormSubmissionById=vy,i.selectFormSubmissions=ky,i.selectFormSubmissionsByIds=Ey,i.selectFormSubmissionsMapping=xi,i.selectFormSubmissionsOfForm=Vy,i.selectForms=Li,i.selectFormsByIds=ly,i.selectFormsOfOrganization=O_,i.selectGeoImageById=Gy,i.selectGeoImageMapping=Hy,i.selectGeoImages=tn,i.selectGeoImagesByIds=Ky,i.selectGeoImagesOfProject=I_,i.selectIsImportingProjectFile=Z_,i.selectIsLoggedIn=l_,i.selectIssueAssociationById=af,i.selectIssueAssociationMapping=Pt,i.selectIssueAssociations=nf,i.selectIssueAssociationsByIds=cf,i.selectIssueAssociationsOfAsset=lf,i.selectIssueAssociationsOfIssue=df,i.selectIssueAssociationsToIssue=rf,i.selectIssueAttachmentById=Of,i.selectIssueAttachmentMapping=Tf,i.selectIssueAttachments=rn,i.selectIssueAttachmentsByIds=If,i.selectIssueById=cA,i.selectIssueCommentAttachmentById=zf,i.selectIssueCommentAttachmentMapping=Bf,i.selectIssueCommentAttachments=ln,i.selectIssueCommentAttachmentsByIds=Wf,i.selectIssueCommentById=Yf,i.selectIssueCommentMapping=un,i.selectIssueCommentsByIds=Zf,i.selectIssueMapping=aA,i.selectIssueTypeAttachmentById=OA,i.selectIssueTypeAttachmentMapping=wA,i.selectIssueTypeAttachments=fn,i.selectIssueTypeAttachmentsByIds=IA,i.selectIssueTypeById=oT,i.selectIssueTypeFieldValues=Yt,i.selectIssueTypeFieldValuesAttachmentById=OS,i.selectIssueTypeFieldValuesAttachments=Pn,i.selectIssueTypeFieldValuesAttachmentsByIds=IS,i.selectIssueTypeFieldValuesAttachmentsMapping=wS,i.selectIssueTypeFieldValuesById=ZA,i.selectIssueTypeFieldValuesByIds=JA,i.selectIssueTypeFieldValuesMapping=YA,i.selectIssueTypeFieldValuesOfIssue=M_,i.selectIssueTypeFields=gt,i.selectIssueTypeFieldsAttachmentById=zA,i.selectIssueTypeFieldsAttachments=Sn,i.selectIssueTypeFieldsAttachmentsByIds=WA,i.selectIssueTypeFieldsAttachmentsMapping=BA,i.selectIssueTypeFieldsById=lS,i.selectIssueTypeFieldsByIds=oS,i.selectIssueTypeFieldsMapping=dS,i.selectIssueTypeFieldsOfIssueType=R_,i.selectIssueTypeIdentifierById=WS,i.selectIssueTypeIdentifierMapping=zS,i.selectIssueTypeIdentifierValueById=JS,i.selectIssueTypeIdentifierValueMapping=ZS,i.selectIssueTypeIdentifierValues=Zt,i.selectIssueTypeIdentifierValuesByIds=XS,i.selectIssueTypeIdentifierValuesOfIdentifier=B_,i.selectIssueTypeIdentifierValuesOfIssue=V_,i.selectIssueTypeIdentifiers=bn,i.selectIssueTypeIdentifiersByIds=qS,i.selectIssueTypeIdentifiersOfIssueType=E_,i.selectIssueTypeMapping=lT,i.selectIssueTypeStatusById=En,i.selectIssueTypeStatusMapping=FT,i.selectIssueTypeStatuses=vn,i.selectIssueTypeStatusesByIds=PT,i.selectIssueTypeStatusesOfIssueType=W_,i.selectIssueTypeValuesOfIssueType=v_,i.selectIssueTypes=Rn,i.selectIssueTypesByIds=uT,i.selectIssueTypesOfOrganization=z_,i.selectIssueUpdateById=ET,i.selectIssueUpdateMapping=Cn,i.selectIssueUpdates=jn,i.selectIssueUpdatesByIds=VT,i.selectIssueUpdatesOfIssue=BT,i.selectIssues=Kt,i.selectIssuesByIds=rA,i.selectIssuesOfIssueType=dA,i.selectIssuesOfProject=g_,i.selectLatestAssetProcedureStepFieldsOfAssetProcedureStep=$b,i.selectLatestAssetProcedureTypeFieldsOfAssetProcedureType=Vb,i.selectLatestAssetTypeFieldsOfAssetType=Qb,i.selectLatestFieldsByAssetProcedureStep=Db,i.selectLatestFieldsByWorkflowStep=mM,i.selectLatestFormRevisionOfForm=w_,i.selectLatestIssueTypeFieldsOfIssueType=k_,i.selectLatestRetryTime=U_,i.selectLatestWorkflowStepFieldsOfWorkflowStep=hM,i.selectMembershipsByUserOfTeam=tM,i.selectOrganizationAccessById=nw,i.selectOrganizationAccessMapping=Qt,i.selectOrganizationAccessUserMapping=cw,i.selectOrganizationAccessesByIds=aw,i.selectOrganizationById=Tw,i.selectOrganizationDocuments=m_,i.selectOrganizations=Sw,i.selectOrganizationsByIds=ww,i.selectOrganizationsMapping=Aw,i.selectProjectAccessById=jw,i.selectProjectAccessMapping=Yn,i.selectProjectAccesses=bt,i.selectProjectAccessesByIds=$w,i.selectProjectAccessesOfProject=N_,i.selectProjectAttachmentById=Qw,i.selectProjectAttachmentMapping=Xw,i.selectProjectAttachments=Jn,i.selectProjectAttachmentsByIds=xw,i.selectProjectById=vO,i.selectProjectDocuments=h_,i.selectProjectFileById=fO,i.selectProjectFileMapping=pO,i.selectProjectFiles=yO,i.selectProjectFilesByIds=AO,i.selectProjectMapping=kO,i.selectProjects=xt,i.selectProjectsByIds=EO,i.selectProjectsOfOrganization=X_,i.selectRehydrated=eM,i.selectStageMapping=ti,i.selectTeamById=aI,i.selectTeamMembershipById=GO,i.selectTeamMemberships=es,i.selectTeamMembershipsByIds=KO,i.selectTeamMembershipsMapping=HO,i.selectTeams=sa,i.selectTeamsByIds=cI,i.selectTeamsMapping=nI,i.selectTeamsOfOrganization=iM,i.selectUploadUrl=Jm,i.selectUserById=Xt,i.selectUsers=Jt,i.selectUsersByIds=GT,i.selectUsersMapping=Ln,i.selectUsersOfOrganization=$_,i.selectUsersOfProject=G_,i.selectUsersOfTeam=sM,i.selectWorkflowById=AI,i.selectWorkflowMapping=fI,i.selectWorkflowStepAssigneeById=kI,i.selectWorkflowStepAssigneeMapping=RI,i.selectWorkflowStepAssignees=_t,i.selectWorkflowStepAssigneesByIds=vI,i.selectWorkflowStepAssigneesOfUser=cM,i.selectWorkflowStepAssigneesOfWorkflow=EI,i.selectWorkflowStepAssigneesOfWorkflowStep=aM,i.selectWorkflowStepById=QP,i.selectWorkflowStepCommentAttachmentById=LI,i.selectWorkflowStepCommentAttachmentMapping=UI,i.selectWorkflowStepCommentAttachments=oa,i.selectWorkflowStepCommentAttachmentsByIds=NI,i.selectWorkflowStepCommentById=tF,i.selectWorkflowStepCommentMapping=eF,i.selectWorkflowStepComments=ns,i.selectWorkflowStepCommentsByIds=sF,i.selectWorkflowStepCompletionById=pF,i.selectWorkflowStepCompletionMapping=mF,i.selectWorkflowStepCompletions=as,i.selectWorkflowStepCompletionsByIds=yF,i.selectWorkflowStepCompletionsOfWorkflow=fF,i.selectWorkflowStepCompletionsOfWorkflowStep=dM,i.selectWorkflowStepFieldValues=Mt,i.selectWorkflowStepFieldValuesAttachmentById=_F,i.selectWorkflowStepFieldValuesAttachments=Oa,i.selectWorkflowStepFieldValuesAttachmentsByIds=MF,i.selectWorkflowStepFieldValuesAttachmentsMapping=bF,i.selectWorkflowStepFieldValuesById=DF,i.selectWorkflowStepFieldValuesByIds=UF,i.selectWorkflowStepFieldValuesMapping=jF,i.selectWorkflowStepFieldValuesOfFieldsRevision=oM,i.selectWorkflowStepFieldValuesOfWorkflow=$F,i.selectWorkflowStepFieldValuesOfWorkflowStep=lM,i.selectWorkflowStepFields=cs,i.selectWorkflowStepFieldsAttachmentById=eP,i.selectWorkflowStepFieldsAttachments=Ma,i.selectWorkflowStepFieldsAttachmentsByIds=tP,i.selectWorkflowStepFieldsAttachmentsMapping=QF,i.selectWorkflowStepFieldsById=mP,i.selectWorkflowStepFieldsByIds=pP,i.selectWorkflowStepFieldsMapping=ka,i.selectWorkflowStepFieldsOfWorkflowStep=uM,i.selectWorkflowStepMapping=XP,i.selectWorkflowStepReviewById=CP,i.selectWorkflowStepReviewMapping=qP,i.selectWorkflowStepReviewRequestById=gP,i.selectWorkflowStepReviewRequestMapping=PP,i.selectWorkflowStepReviewRequests=rs,i.selectWorkflowStepReviewRequestsByIds=bP,i.selectWorkflowStepReviewRequestsOfWorkflow=_P,i.selectWorkflowStepReviewRequestsOfWorkflowStep=pM,i.selectWorkflowStepReviews=ds,i.selectWorkflowStepReviewsByIds=jP,i.selectWorkflowStepReviewsOfWorkflow=$P,i.selectWorkflowStepReviewsOfWorkflowStep=yM,i.selectWorkflowSteps=$a,i.selectWorkflowStepsByIds=eg,i.selectWorkflowStepsOfWorkflowType=xP,i.selectWorkflowTypeById=hg,i.selectWorkflowTypeMapping=ug,i.selectWorkflowTypes=Ua,i.selectWorkflowTypesByIds=mg,i.selectWorkflowTypesOfOrganization=fM,i.selectWorkflows=ts,i.selectWorkflowsByIds=SI,i.selectWorkflowsOfProject=nM,i.selectWorkflowsOfWorkflowType=TI,i.setActiveProjectFileId=hO,i.setAsset=Hl,i.setAssetAttachment=_c,i.setAssetAttachments=Mc,i.setAssetProcedure=nd,i.setAssetProcedureStep=_l,i.setAssetProcedureStepFieldValues=yl,i.setAssetProcedureStepFieldValuesAttachment=tl,i.setAssetProcedureStepFieldValuesAttachments=sl,i.setAssetProcedureStepFieldValuesMany=fl,i.setAssetProcedureStepFields=Ld,i.setAssetProcedureStepFieldsAttachment=Rd,i.setAssetProcedureStepFieldsAttachments=kd,i.setAssetProcedureStepFieldsMany=Nd,i.setAssetProcedureSteps=Ml,i.setAssetProcedureType=Td,i.setAssetProcedureTypeAttachment=Dc,i.setAssetProcedureTypeAttachments=Uc,i.setAssetProcedureTypeFieldValues=Ur,i.setAssetProcedureTypeFieldValuesAttachment=Mr,i.setAssetProcedureTypeFieldValuesAttachments=Rr,i.setAssetProcedureTypeFieldValuesMany=Lr,i.setAssetProcedureTypeFields=yr,i.setAssetProcedureTypeFieldsAttachment=tr,i.setAssetProcedureTypeFieldsAttachments=sr,i.setAssetProcedureTypeFieldsMany=fr,i.setAssetProcedureTypes=wd,i.setAssetProcedures=ad,i.setAssetStage=fo,i.setAssetStageCompletion=so,i.setAssetStageCompletions=io,i.setAssetStages=Ao,i.setAssetType=Ah,i.setAssetTypeAttachment=ko,i.setAssetTypeAttachments=vo,i.setAssetTypeFieldValues=vu,i.setAssetTypeFieldValuesAttachment=Au,i.setAssetTypeFieldValuesAttachments=Su,i.setAssetTypeFieldValuesMany=Eu,i.setAssetTypeFields=nu,i.setAssetTypeFieldsAttachment=No,i.setAssetTypeFieldsAttachments=Ho,i.setAssetTypeFieldsMany=au,i.setAssetTypeIdentifier=Hu,i.setAssetTypeIdentifierValue=ah,i.setAssetTypeIdentifierValues=ch,i.setAssetTypeIdentifiers=Gu,i.setAssetTypeStatus=Vh,i.setAssetTypeStatuses=Bh,i.setAssetTypes=Sh,i.setAssets=Gl,i.setCategories=Xh,i.setCategory=Jh,i.setClientSDK=zg,i.setClientStore=Vg,i.setConversation=Oc,i.setConversations=Pb,i.setCurrentUser=q_,i.setDocument=Fm,i.setDocumentAttachment=lm,i.setDocumentAttachments=om,i.setDocuments=Pm,i.setEmailDomain=qm,i.setEmailDomains=Cm,i.setForm=ey,i.setFormIdentifier=sp,i.setFormIdentifierValue=fp,i.setFormIdentifierValues=Ap,i.setFormIdentifiers=ip,i.setFormRevision=Up,i.setFormRevisionAttachment=kp,i.setFormRevisionAttachments=vp,i.setFormRevisions=Lp,i.setFormSubmission=Py,i.setFormSubmissionAttachment=my,i.setFormSubmissionAttachments=py,i.setFormSubmissions=gy,i.setForms=ty,i.setGeoImage=qy,i.setGeoImages=Cy,i.setIsImportingProjectFile=uO,i.setIssue=eA,i.setIssueAssociation=Qy,i.setIssueAssociations=Xy,i.setIssueAttachment=pf,i.setIssueAttachments=yf,i.setIssueComment=Uf,i.setIssueCommentAttachment=Mf,i.setIssueCommentAttachments=Rf,i.setIssueComments=Lf,i.setIssueType=iT,i.setIssueTypeAttachment=pA,i.setIssueTypeAttachments=yA,i.setIssueTypeFieldValues=UA,i.setIssueTypeFieldValuesAttachment=yS,i.setIssueTypeFieldValuesAttachments=fS,i.setIssueTypeFieldValuesMany=LA,i.setIssueTypeFields=sS,i.setIssueTypeFieldsAttachment=MA,i.setIssueTypeFieldsAttachments=RA,i.setIssueTypeFieldsMany=iS,i.setIssueTypeIdentifier=RS,i.setIssueTypeIdentifierValue=LS,i.setIssueTypeIdentifierValues=NS,i.setIssueTypeIdentifiers=kS,i.setIssueTypeStatus=AT,i.setIssueTypeStatuses=ST,i.setIssueTypes=nT,i.setIssueUpdate=MT,i.setIssueUpdates=RT,i.setIssues=tA,i.setLoggedIn=Nh,i.setOrganization=ow,i.setOrganizationAccess=XT,i.setOrganizationAccesses=QT,i.setOrganizations=lw,i.setProfilePicture=C_,i.setProject=IO,i.setProjectAccess=Ew,i.setProjectAccesses=Vw,i.setProjectAttachment=Hw,i.setProjectAttachments=Gw,i.setProjectFile=iO,i.setProjectFiles=nO,i.setProjects=OO,i.setRehydrated=x_,i.setTeam=QO,i.setTeamMembership=CO,i.setTeamMemberships=jO,i.setTeams=xO,i.setTokens=c_,i.setUploadUrl=Zm,i.setUser=jT,i.setUsers=CT,i.setWorkflow=uI,i.setWorkflowStep=HP,i.setWorkflowStepAssignee=PI,i.setWorkflowStepAssignees=gI,i.setWorkflowStepComment=ZI,i.setWorkflowStepCommentAttachment=qI,i.setWorkflowStepCommentAttachments=CI,i.setWorkflowStepComments=JI,i.setWorkflowStepCompletion=dF,i.setWorkflowStepCompletions=lF,i.setWorkflowStepFieldValues=BF,i.setWorkflowStepFieldValuesAttachment=OF,i.setWorkflowStepFieldValuesAttachments=IF,i.setWorkflowStepFieldValuesMany=zF,i.setWorkflowStepFields=rP,i.setWorkflowStepFieldsAttachment=KF,i.setWorkflowStepFieldsAttachments=YF,i.setWorkflowStepFieldsMany=dP,i.setWorkflowStepReview=EP,i.setWorkflowStepReviewRequest=TP,i.setWorkflowStepReviewRequests=wP,i.setWorkflowStepReviews=VP,i.setWorkflowSteps=GP,i.setWorkflowType=ag,i.setWorkflowTypes=cg,i.setWorkflows=hI,i.shallowEqual=tb,i.slugify=Ab,i.spacesToDashesLower=fb,i.teamMembershipReducer=NO,i.teamMembershipSlice=ea,i.teamReducer=rI,i.teamSlice=ta,i.toFileNameSafeString=yb,i.toUuidArray=z,i.toUuidIdRecord=pb,i.truncate=Sb,i.updateAsset=Ul,i.updateAssetAttachment=Rc,i.updateAssetAttachments=kc,i.updateAssetProcedure=td,i.updateAssetProcedureStep=vl,i.updateAssetProcedureStepFieldValues=Al,i.updateAssetProcedureStepFieldValuesAttachment=il,i.updateAssetProcedureStepFieldValuesAttachments=nl,i.updateAssetProcedureStepFieldValuesMany=Sl,i.updateAssetProcedureStepFields=Hd,i.updateAssetProcedureStepFieldsAttachment=vd,i.updateAssetProcedureStepFieldsAttachments=Ed,i.updateAssetProcedureStepFieldsMany=Gd,i.updateAssetProcedureSteps=El,i.updateAssetProcedureType=yd,i.updateAssetProcedureTypeAttachment=Lc,i.updateAssetProcedureTypeAttachments=Nc,i.updateAssetProcedureTypeFieldValues=Nr,i.updateAssetProcedureTypeFieldValuesAttachment=kr,i.updateAssetProcedureTypeFieldValuesAttachments=vr,i.updateAssetProcedureTypeFieldValuesMany=Hr,i.updateAssetProcedureTypeFields=Ar,i.updateAssetProcedureTypeFieldsAttachment=ir,i.updateAssetProcedureTypeFieldsAttachments=nr,i.updateAssetProcedureTypeFieldsMany=Sr,i.updateAssetProcedureTypes=fd,i.updateAssetProcedures=sd,i.updateAssetStage=wo,i.updateAssetStageCompletion=no,i.updateAssetStageCompletions=ao,i.updateAssetStages=Oo,i.updateAssetType=Oh,i.updateAssetTypeAttachment=Eo,i.updateAssetTypeAttachments=Vo,i.updateAssetTypeFieldValues=Vu,i.updateAssetTypeFieldValuesAttachment=Tu,i.updateAssetTypeFieldValuesAttachments=wu,i.updateAssetTypeFieldValuesMany=Bu,i.updateAssetTypeFields=cu,i.updateAssetTypeFieldsAttachment=Go,i.updateAssetTypeFieldsAttachments=Ko,i.updateAssetTypeFieldsMany=ru,i.updateAssetTypeIdentifier=Ku,i.updateAssetTypeIdentifierValue=rh,i.updateAssetTypeIdentifierValues=dh,i.updateAssetTypeIdentifiers=Yu,i.updateAssetTypeStatus=zh,i.updateAssetTypeStatuses=Wh,i.updateAssetTypes=Ih,i.updateAssets=Ll,i.updateCategories=xh,i.updateCategory=Qh,i.updateConversation=Ic,i.updateConversations=gb,i.updateDocument=gm,i.updateDocumentAttachment=um,i.updateDocumentAttachments=hm,i.updateDocuments=bm,i.updateEmailDomain=jm,i.updateEmailDomains=$m,i.updateForm=sy,i.updateFormIdentifier=np,i.updateFormIdentifierValue=Sp,i.updateFormIdentifierValues=Tp,i.updateFormIdentifiers=ap,i.updateFormRevision=Np,i.updateFormRevisionAttachment=Ep,i.updateFormRevisionAttachments=Vp,i.updateFormRevisions=Hp,i.updateFormSubmission=_y,i.updateFormSubmissionAttachment=yy,i.updateFormSubmissionAttachments=fy,i.updateFormSubmissions=My,i.updateForms=iy,i.updateGeoImage=Dy,i.updateGeoImages=Uy,i.updateIssue=sA,i.updateIssueAssociation=xy,i.updateIssueAssociations=ef,i.updateIssueAttachment=ff,i.updateIssueAttachments=Af,i.updateIssueComment=Nf,i.updateIssueCommentAttachment=kf,i.updateIssueCommentAttachments=vf,i.updateIssueComments=Hf,i.updateIssueType=aT,i.updateIssueTypeAttachment=fA,i.updateIssueTypeAttachments=AA,i.updateIssueTypeFieldValues=NA,i.updateIssueTypeFieldValuesAttachment=AS,i.updateIssueTypeFieldValuesAttachments=SS,i.updateIssueTypeFieldValuesMany=HA,i.updateIssueTypeFields=nS,i.updateIssueTypeFieldsAttachment=kA,i.updateIssueTypeFieldsAttachments=vA,i.updateIssueTypeFieldsMany=aS,i.updateIssueTypeIdentifier=vS,i.updateIssueTypeIdentifierValue=HS,i.updateIssueTypeIdentifierValues=GS,i.updateIssueTypeIdentifiers=ES,i.updateIssueTypeStatus=TT,i.updateIssueTypeStatuses=wT,i.updateIssueTypes=cT,i.updateIssueUpdate=kT,i.updateIssueUpdates=vT,i.updateIssues=iA,i.updateOrganization=pw,i.updateOrganizationAccess=xT,i.updateOrganizationAccesses=ew,i.updateOrganizations=mw,i.updateProject=bO,i.updateProjectAccess=Bw,i.updateProjectAccesses=zw,i.updateProjectAttachment=Kw,i.updateProjectAttachments=Yw,i.updateProjectFile=rO,i.updateProjectFiles=dO,i.updateProjects=gO,i.updateTeam=eI,i.updateTeamMembership=$O,i.updateTeamMemberships=DO,i.updateTeams=tI,i.updateUser=UT,i.updateUsers=DT,i.updateWorkflow=mI,i.updateWorkflowStep=KP,i.updateWorkflowStepAssignee=bI,i.updateWorkflowStepAssignees=_I,i.updateWorkflowStepComment=XI,i.updateWorkflowStepCommentAttachment=jI,i.updateWorkflowStepCommentAttachments=$I,i.updateWorkflowStepComments=QI,i.updateWorkflowStepCompletion=oF,i.updateWorkflowStepCompletions=uF,i.updateWorkflowStepFieldValues=WF,i.updateWorkflowStepFieldValuesAttachment=FF,i.updateWorkflowStepFieldValuesAttachments=PF,i.updateWorkflowStepFieldValuesMany=qF,i.updateWorkflowStepFields=lP,i.updateWorkflowStepFieldsAttachment=ZF,i.updateWorkflowStepFieldsAttachments=JF,i.updateWorkflowStepFieldsMany=oP,i.updateWorkflowStepReview=BP,i.updateWorkflowStepReviewRequest=OP,i.updateWorkflowStepReviewRequests=IP,i.updateWorkflowStepReviews=zP,i.updateWorkflowSteps=YP,i.updateWorkflowType=rg,i.updateWorkflowTypes=dg,i.updateWorkflows=pI,i.useSelectorBuilder=eb,i.userReducer=NT,i.userSlice=$n,i.uuidObj=_,i.uuidObjSortFn=As,i.uuidSortFn=vt,i.versioningReducer=fg,i.versioningSlice=yg,i.workflowReducer=wI,i.workflowSlice=ia,i.workflowStepAssigneeReducer=VI,i.workflowStepAssigneeSlice=ca,i.workflowStepCommentAttachmentReducer=HI,i.workflowStepCommentAttachmentSlice=la,i.workflowStepCommentReducer=nF,i.workflowStepCommentSlice=ha,i.workflowStepCompletionReducer=AF,i.workflowStepCompletionSlice=ya,i.workflowStepFieldValuesAttachmentReducer=kF,i.workflowStepFieldValuesAttachmentSlice=Sa,i.workflowStepFieldValuesReducer=LF,i.workflowStepFieldValuesSlice=Ia,i.workflowStepFieldsAttachmentReducer=sP,i.workflowStepFieldsAttachmentSlice=ga,i.workflowStepFieldsReducer=yP,i.workflowStepFieldsSlice=Ra,i.workflowStepReducer=JP,i.workflowStepReviewReducer=DP,i.workflowStepReviewRequestReducer=MP,i.workflowStepReviewRequestSlice=va,i.workflowStepReviewSlice=Ba,i.workflowStepSlice=qa,i.workflowTypeReducer=pg,i.workflowTypeSlice=Da,Object.defineProperty(i,Symbol.toStringTag,{value:"Module"})});
|
|
14
|
+
external URLs and therefore not prepended with VITE_API_URL.`;throw new Error(S)}const y=r.type.split("/")[1];if(!y)throw new Error("File has no extension");const f=a??h+"."+y;if(r=Tc(r,f),!r.name)throw new Error("Failed to set file's name");await this.addCache(r,h),ps[c]=new Promise(S=>{S(r)})}return r}processPresignedUrls(e){const n={};for(const[a,c]of Object.entries(e))n[a]=this.enqueueRequest({url:c.url,description:"Upload file to S3",method:p.POST,isExternalUrl:!0,isAuthNeeded:!1,attachmentHash:a,blockers:[`s3-${c.fields.key}`],blocks:[a],s3url:c});return n}async getFilePayload(e){const n=await At(e),a={sha1:n,file_type:e.type,extension:e.name.split(".").pop(),size:e.size};return await this.client.files.addCache(e,n),a}}class XM extends k{constructor(){super(...arguments);m(this,"name","Form Identifier");m(this,"url","/form-identifiers");m(this,"actions",{addOne:hm,addMany:pm,setOne:mm,setMany:ym,updateOne:fm,updateMany:Sm,deleteOne:Am,deleteMany:wm,initialize:um});m(this,"selectors",{selectById:Om,selectByIds:Im})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(r),blockers:[r.form],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,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 o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected form identifier with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.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:{form__organization:e}},n);return this.dispatch(a(c)),c}}class xM extends k{constructor(){super(...arguments);m(this,"name","Form Identifier Value");m(this,"url","/form-identifier-values");m(this,"actions",{addOne:bm,addMany:_m,setOne:Rm,setMany:Mm,updateOne:km,updateMany:vm,deleteOne:Em,deleteMany:Vm,initialize:gm});m(this,"selectors",{selectById:Bm,selectByIds:zm})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(r),blockers:[e.form_submission,e.form_identifier],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,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 value with uuid ${e.uuid} to exist`);const o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected form identifier value with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.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:{form_submission__form_revision__form__organization:e}},n)).flat();return this.dispatch(a(d)),d}}class ek extends k{constructor(){super(...arguments);m(this,"name","Form Revision Attachment");m(this,"url","/form-revision-attachments");m(this,"actions",{addOne:Dm,addMany:$m,setOne:Um,setMany:Lm,updateOne:Nm,updateMany:Hm,deleteOne:Gm,deleteMany:Km,initialize:jm});m(this,"selectors",{selectById:Zm,selectByIds:Jm})}async bulkAdd(e){var f;const{addMany:n,setMany:a,deleteMany:c}=this.actions,d=new Date().toISOString(),o=((f=this.client.store.getState().userReducer.currentUser)==null?void 0:f.id)??null,l={},r=[],h=[];for(const S of e){const{revisionUuid:O,fieldIdentifier:P,file:I}=S,F=await this.client.files.getFilePayload(I);F.sha1 in l||(l[F.sha1]=F);const g=_({file:URL.createObjectURL(I),file_type:I.type,file_name:I.name,file_sha1:F.sha1,created_by:o,form_revision:O,submitted_at:d,field_identifier:P});r.push(g);const v={uuid:g.uuid,file_name:I.name,field_identifier:P,file_extension:F.extension,file_sha1:F.sha1,form_revision:O};h.push(v)}this.dispatch(n(r));const y=this.enqueueRequest({description:T(p.POST,this.name,!0),method:p.POST,url:`${this.url}/bulk/`,payload:{submitted_at:d,attachments:h,files:Object.values(l)},blockers:r.map(S=>S.form_revision),blocks:r.map(S=>S.uuid)});return y.then(S=>{this.client.files.processPresignedUrls(S.presigned_urls),this.dispatch(a(S.attachments))}).catch(()=>{this.dispatch(c(r.map(S=>S.uuid)))}),[r,y.then(({attachments:S})=>S)]}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 tk extends k{constructor(){super(...arguments);m(this,"name","Form Revision");m(this,"url","/form-revisions");m(this,"actions",{addOne:$i,addMany:Ui,setOne:ey,setMany:ty,updateOne:sy,updateMany:iy,deleteOne:Li,deleteMany:Ni,initialize:xm});m(this,"selectors",{selectById:ny,selectByIds:ay})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,r=new Date().toISOString(),h=_({...e,created_by:l,submitted_at:r});this.dispatch(a(h));const y=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(h),blockers:[e.form],blocks:[h.uuid]});return y.then(S=>{this.dispatch(c(S))}).catch(()=>{this.dispatch(d(h.uuid))}),[h,y]}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 sk extends k{constructor(){super(...arguments);m(this,"name","Form");m(this,"url","/forms");m(this,"actions",{addOne:oy,addMany:uy,setOne:hy,setMany:py,updateOne:my,updateMany:yy,deleteOne:fy,deleteMany:Sy,initialize:ly});m(this,"selectors",{selectById:Ty,selectByIds:Oy})}add(e,n){var f;const{store:a}=this.client,{addOne:c,deleteOne:d}=this.actions,o=new Date().toISOString(),l=((f=a.getState().userReducer.currentUser)==null?void 0:f.id)??null,r=_({...e,submitted_at:o,created_by:l}),h=_({...n,form:r.uuid,submitted_at:o,created_by:l});this.dispatch(c(r)),this.dispatch($i(h));const y=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:{...E(r),initial_revision:{uuid:h.uuid,submitted_at:h.submitted_at,title:h.title,description:h.description,fields:h.fields}},blockers:[],blocks:[r.uuid,h.uuid]});return y.catch(S=>{throw this.dispatch(d(r.uuid)),this.dispatch(Li(h.uuid)),S}),[r,h,y]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error("Expected form to exist");const r=Hy(e)(o),h=cy(e)(o);this.dispatch(a(e)),this.dispatch(sn(B(r))),this.dispatch(Ni(B(h)));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(y){throw this.dispatch(c(l)),this.dispatch(Ui(h)),this.dispatch(tn(r)),y}}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 k{constructor(){super(...arguments);m(this,"name","Form Submission Attachment");m(this,"url","/form-submission-attachments");m(this,"actions",{addOne:Py,addMany:Zi,setOne:gy,setMany:by,updateOne:_y,updateMany:Ry,deleteOne:My,deleteMany:Ji,initialize:Fy});m(this,"selectors",{selectById:ky,selectByIds:vy})}async bulkAdd(e){var f;const{addMany:n,setMany:a,deleteMany:c}=this.actions,d=new Date().toISOString(),o=((f=this.client.store.getState().userReducer.currentUser)==null?void 0:f.id)??null,l={},r=[],h=[];for(const S of e){const{submissionUuid:O,fieldIdentifier:P,file:I}=S,F=await this.client.files.getFilePayload(I);F.sha1 in l||(l[F.sha1]=F);const g=_({file:URL.createObjectURL(I),file_type:I.type,file_name:I.name,file_sha1:F.sha1,created_by:o,form_submission:O,submitted_at:d,field_identifier:P});r.push(g);const v={uuid:g.uuid,file_name:I.name,file_sha1:F.sha1,file_extension:F.extension,field_identifier:P,form_submission:O};h.push(v)}this.dispatch(n(r));const y=this.enqueueRequest({description:T(p.POST,this.name,!0),method:p.POST,url:`${this.url}/bulk/`,payload:{submitted_at:d,attachments:h,files:Object.values(l)},blockers:r.map(S=>S.form_submission),blocks:r.map(S=>S.uuid)});return y.then(S=>{this.client.files.processPresignedUrls(S.presigned_urls),this.dispatch(a(S.attachments))}).catch(S=>{throw this.dispatch(c(r.map(O=>O.uuid))),S}),[r,y.then(({attachments:S})=>S)]}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,d=n.getState(),o=xi(e)(d);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!0),method:p.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(l){throw this.dispatch(c(o)),l}}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 nk extends k{constructor(){super(...arguments);m(this,"name","Form Submission");m(this,"url","/form-submissions");m(this,"actions",{addOne:Cy,addMany:tn,setOne:zy,setMany:qy,updateOne:jy,updateMany:Dy,deleteOne:$y,deleteMany:sn,initialize:By});m(this,"selectors",{selectById:Ly,selectByIds:Ny})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,r=new Date().toISOString(),h=_({...e,created_by:l,submitted_at:r}),y=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(h),blockers:[e.form_revision],blocks:[h.uuid]});return this.dispatch(a(h)),y.then(S=>{this.dispatch(c(S))}).catch(()=>{this.dispatch(d(h.uuid))}),[h,y]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=n.getState(),o=c(e.uuid)(d);if(!o)throw new Error(`Expected submission with uuid ${e.uuid} to exist`);const l={...o,...e};this.dispatch(a(l));const r=this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.PATCH,url:`${this.url}/${l.uuid}/`,payload:e,blockers:[l.uuid],blocks:[l.uuid]});return r.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(a(o))}),[l,r]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected submission with uuid ${e} to exist`);const r=Ey(e)(o);this.dispatch(a(e)),this.dispatch(Ji(B(r)));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(h){throw this.dispatch(c(l)),this.dispatch(Zi(r)),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 ak extends k{constructor(){super(...arguments);m(this,"name","Geo Image");m(this,"url","/geo-images");m(this,"actions",{addOne:Qy,addMany:Xy,setOne:Zy,setMany:Jy,updateOne:xy,updateMany:ef,deleteOne:tf,deleteMany:sf,initialize:Yy});m(this,"selectors",{selectById:af,selectByIds:cf})}async add(e){var P;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,{file:o,...l}=e,r=new Date().toISOString(),h=((P=n.getState().userReducer.currentUser)==null?void 0:P.id)??null,y=l.project,f=await this.client.files.getFilePayload(o),S=_({...l,file_name:o.name,file_sha1:f.sha1,file_type:o.type,file:URL.createObjectURL(o),submitted_at:r,created_by:h});this.dispatch(a(S));const O=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:{uuid:S.uuid,submitted_at:r,title:S.title,description:S.description,geo_marker:S.geo_marker,canvas_marker:S.canvas_marker,sha1:S.file_sha1,project:S.project,file_name:S.file_name,direction:S.direction,original_date:S.original_date,file:f},blocks:[y],blockers:[y]});return O.then(I=>{this.client.files.processPresignedUrls(I.presigned_urls),this.dispatch(c(I.geo_image))}).catch(()=>{this.dispatch(d(S.uuid))}),[S,O.then(I=>I.geo_image)]}async bulkAdd(e,n){var P;const{store:a}=this.client,{addMany:c,setMany:d,deleteMany:o}=this.actions,l=new Date().toISOString(),r=((P=a.getState().userReducer.currentUser)==null?void 0:P.id)??null,h=[],y=[],f=[],S={};for(const I of e){const{file:F,...g}=I,v=await this.client.files.getFilePayload(F);v.sha1 in S||(S[v.sha1]=v);const V=_({...g,file_name:F.name,file_sha1:v.sha1,file_type:F.type,file:URL.createObjectURL(F),submitted_at:l,created_by:r,project:n});h.push(V),y.push(V.uuid),f.push({uuid:V.uuid,sha1:V.file_sha1,file_name:V.file_name,title:V.title,description:V.description,geo_marker:V.geo_marker,canvas_marker:V.canvas_marker,direction:V.direction,original_date:V.original_date})}this.dispatch(c(h));const O=this.enqueueRequest({description:T(p.POST,this.name,!0),method:p.POST,url:`${this.url}/bulk/`,payload:{submitted_at:l,project:n,geo_images:f,files:Object.values(S)},blocks:[n],blockers:y});return O.then(I=>{this.client.files.processPresignedUrls(I.presigned_urls),this.dispatch(d(I.geo_images))}).catch(()=>{this.dispatch(o(y))}),[h,O.then(I=>I.geo_images)]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=n.getState(),o=c(e.uuid)(d);if(!o)throw new Error(`Map image with uuid ${e.uuid} does not exist in the store`);const l={...o,...e};this.dispatch(a(l));const r=this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blocks:[e.uuid],blockers:[e.uuid]});return r.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(a(o))}),[l,r]}async delete(e){const{store:n}=this.client,{deleteOne:a,setOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Map image with uuid ${e} does not exist in the store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blocks:[e],blockers:[e]})}catch(r){throw this.dispatch(c(l)),r}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{project:e}},n);return this.dispatch(a(c)),c}}class ck extends k{constructor(){super(...arguments);m(this,"name","Issue Association");m(this,"url","/issue-associations");m(this,"actions",{addOne:mf,addMany:Yt,setOne:uf,setMany:of,updateOne:hf,updateMany:pf,deleteOne:yf,deleteMany:Zt,initialize:lf});m(this,"selectors",{selectById:Sf,selectByIds:Af})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=new Date().toISOString(),l=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,r=_({...e,submitted_at:o,created_by:l});this.dispatch(a(r));const h=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(r),blockers:[e.associated_issue,...e.issue?[e.issue]:[],...e.asset?[e.asset]:[]],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,h]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=d(e)(n.getState());if(!o)throw new Error(`Issue association with uuid ${e} not found in store.`);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(o)),l}}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 rk extends L{constructor(){super(...arguments);m(this,"name","Issue Attachment");m(this,"url","/issue-attachments");m(this,"actions",{addOne:gf,addMany:ln,setOne:bf,setMany:_f,updateOne:Rf,updateMany:Mf,deleteOne:kf,deleteMany:on,initialize:Pf});m(this,"selectors",{selectById:Vf,selectByIds:Wf})}getId(e){return e.uuid}buildModel(e){return _({file:URL.createObjectURL(e.file),file_sha1:e.file_sha1,created_by:e.created_by,file_name:e.file.name,file_type:e.file.type,submitted_at:e.submitted_at,issue:e.modelUuid})}buildPayload(e,n){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:n.extension,issue:e.issue}}async bulkAdd(e){return this._bulkAdd(e.map(n=>({modelUuid:n.issueUuid,file:n.file})))}async delete(e){return this._delete(e)}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 dk extends L{constructor(){super(...arguments);m(this,"name","Issue Comment Attachment");m(this,"url","/issue-comment-attachments");m(this,"actions",{addOne:Cf,addMany:jf,setOne:Df,setMany:$f,updateOne:Uf,updateMany:Lf,deleteOne:Nf,deleteMany:Hf,initialize:qf});m(this,"selectors",{selectById:Kf,selectByIds:Yf})}getId(e){return e.uuid}buildModel(e){return _({file:URL.createObjectURL(e.file),file_sha1:e.file_sha1,created_by:e.created_by,file_name:e.file.name,file_type:e.file.type,submitted_at:e.submitted_at,issue_comment:e.modelUuid})}buildPayload(e,n){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:n.extension,issue_comment:e.issue_comment}}async bulkAdd(e){return this._bulkAdd(e.map(n=>({modelUuid:n.issueCommentUuid,file:n.file})))}async delete(e){return this._delete(e)}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 lk extends k{constructor(){super(...arguments);m(this,"name","Issue Comment");m(this,"url","/issue-comments");m(this,"actions",{addOne:Xf,addMany:xf,setOne:eS,setMany:tS,updateOne:sS,updateMany:iS,deleteOne:nS,deleteMany:aS,initialize:Qf});m(this,"selectors",{selectById:cS,selectByIds:rS})}add(e){const{store:n}=this.client,{addOne:a,updateOne:c,deleteOne:d}=this.actions,o=_({...e,author:n.getState().userReducer.currentUser.id,submitted_at:new Date().toISOString()});this.dispatch(a(o));const l=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(o),blockers:[e.issue],blocks:[o.uuid]});return l.then(r=>{this.dispatch(c(r))}).catch(()=>{this.dispatch(d(o.uuid))}),[o,l]}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 o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=d(e)(n.getState());if(!o)throw new Error(`Comment with uuid ${e} not found in store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(o)),l}}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 ok extends k{constructor(){super(...arguments);m(this,"name","Issue");m(this,"url","/issues");m(this,"actions",{addOne:uS,addMany:Sn,setOne:hS,setMany:pS,updateOne:mS,updateMany:yS,deleteOne:fS,deleteMany:An,initialize:oS});m(this,"selectors",{selectById:AS,selectByIds:wS})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=n.getState(),l=new Date().toISOString(),r=((f=o.userReducer.currentUser)==null?void 0:f.id)??null,h=_({...e,submitted_at:l,created_by:r});this.dispatch(a(h));const y=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(h),blockers:[h.project,h.issue_type,...h.category?[h.category]:[]],blocks:[h.uuid]});return y.then(S=>{this.dispatch(c(S))}).catch(S=>{throw this.dispatch(d(h.uuid)),S}),[h,y]}update(e){var y;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 o={...d,...e};this.dispatch(n(o));const l={};for(const f of[j.TITLE,j.DESCRIPTION,j.STATUS,j.CATEGORY,j.PRIORITY,j.ASSIGNED_TO,j.DUE_DATE])if(f in e&&e[f]!==d[f])switch(f){case j.PRIORITY:l[f]=e[f];break;case j.DUE_DATE:l[f]=e[f];break;case j.DESCRIPTION:l[f]=e[f];break;case j.TITLE:l[f]=e[f];break;case j.STATUS:{const S=e[f],O=zn(S)(c);if(!O)throw new Error(`Trying to update issue type status with ${S} which does not exist in store`);l[f]={name:O.name,color:O.color,uuid:O.uuid};break}case j.CATEGORY:{const S=e[f];if(S===null)l[f]=null;else{const O=Ri(S)(c);if(!O)throw new Error(`Trying to update category with ${S} which does not exist in store.`);l[f]={name:O.name,color:O.color,uuid:O.uuid}}break}case j.ASSIGNED_TO:{const S=e[f];if(S===null)l[f]=null;else{const O=es(S)(c);if(!O)throw new Error(`Trying to update assigned to with ${S} which does not exist in store.`);l[f]={full_name:O.username,id:O.id}}break}}const r=_({created_by:((y=c.userReducer.currentUser)==null?void 0:y.id)??null,submitted_at:new Date().toISOString(),issue:d.uuid,changes:l});this.dispatch(Cn(r));const h=this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return h.then(f=>{this.dispatch(n(f))}).catch(()=>{this.dispatch(n(d)),this.dispatch(Dn(r.uuid))}),[o,h]}bulkUpdate(e,n){const{store:a}=this.client,{updateMany:c}=this.actions,{selectByIds:d}=this.selectors,o=B(e).toSorted(Wt);if(o.length!==e.length)throw new Error("payloads contains duplicate uuids.");const l=d(o)(a.getState()).toSorted(Os);if(o.length!=l.length)throw new Error(`Attempting to bulk update ${o.length-l.length} issues that dont exist in the store`);const r=[];for(let S=0;S<o.length;S++)r.push({...l[S],...e[S]});this.dispatch(c(r));const h=pt(e,Math.min(n??e.length,U)),y=[];let f=null;for(const S of h){const O=mt.v4(),P=B(S),I=S.map(({status:v})=>v).filter(Boolean),F=S.map(({category:v})=>v).filter(Boolean),g=this.enqueueRequest({description:T(p.PATCH,this.name,!0),method:p.PATCH,url:`${this.url}/bulk/`,payload:{payloads:S},blockers:(f?[f]:[]).concat(P).concat(I).concat(F),blocks:[O].concat(P)});y.push(g),f=O}return Promise.all(y).then(S=>{this.dispatch(c(S.flat()))}).catch(()=>{this.dispatch(c(l))}),[r,y]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`No issue with uuid ${e} found in the store`);const r=Ef(e)(o),h=Gw(e)(o),y={};for(const S of wf(e)(o))y[S.uuid]=S;for(const S of Tf(e)(o))y[S.uuid]=S;const f=Object.values(y);this.dispatch(a(e)),this.dispatch(on(B(r))),this.dispatch($n(B(h))),this.dispatch(Zt(B(f)));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(S){throw this.dispatch(c(l)),this.dispatch(ln(r)),this.dispatch(jn(h)),this.dispatch(Yt(f)),S}}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 uk extends L{constructor(){super(...arguments);m(this,"name","Issue Type Attachment");m(this,"url","/issue-type-attachments");m(this,"actions",{addOne:PS,addMany:gS,setOne:bS,setMany:_S,updateOne:RS,updateMany:MS,deleteOne:kS,deleteMany:vS,initialize:FS});m(this,"selectors",{selectById:VS,selectByIds:WS})}getId(e){return e.uuid}buildModel(e){return _({file:URL.createObjectURL(e.file),file_sha1:e.file_sha1,created_by:e.created_by,file_name:e.file.name,file_type:e.file.type,submitted_at:e.submitted_at,issue_type:e.modelUuid})}buildPayload(e,n){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:n.extension,issue_type:e.issue_type}}async bulkAdd(e){return this._bulkAdd(e.map(n=>({modelUuid:n.issueTypeUuid,file:n.file})))}async delete(e){return this._delete(e)}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 hk extends k{constructor(){super(...arguments);m(this,"name","Issue Type Fields Attachment");m(this,"url","/issue-type-fields-attachments");m(this,"actions",{addOne:CS,addMany:jS,setOne:DS,setMany:$S,updateOne:US,updateMany:LS,deleteOne:NS,deleteMany:HS,initialize:qS});m(this,"selectors",{selectById:KS,selectByIds:YS})}async bulkAdd(e){var f;const{addMany:n,setMany:a,deleteMany:c}=this.actions,d=new Date().toISOString(),o=((f=this.client.store.getState().userReducer.currentUser)==null?void 0:f.id)??null,l={},r=[],h=[];for(const S of e){const{fieldsRevisionUuid:O,fieldIdentifier:P,file:I}=S,F=await this.client.files.getFilePayload(I);F.sha1 in l||(l[F.sha1]=F);const g=_({file:URL.createObjectURL(I),file_type:I.type,file_name:I.name,file_sha1:F.sha1,created_by:o,fields_revision:O,submitted_at:d,field_identifier:P});r.push(g);const v={uuid:g.uuid,file_name:I.name,file_extension:F.extension,field_identifier:P,file_sha1:F.sha1,fields_revision:O};h.push(v)}this.dispatch(n(r));const y=this.enqueueRequest({description:T(p.POST,this.name,!0),method:p.POST,url:`${this.url}/bulk/`,payload:{submitted_at:d,attachments:h,files:Object.values(l)},blockers:r.map(S=>S.fields_revision),blocks:r.map(S=>S.uuid)});return y.then(S=>{this.client.files.processPresignedUrls(S.presigned_urls),this.dispatch(a(S.attachments))}).catch(()=>{this.dispatch(c(r.map(S=>S.uuid)))}),[r,y.then(({attachments:S})=>S)]}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 pk extends k{constructor(){super(...arguments);m(this,"name","Issue Type Fields");m(this,"url","/issue-type-fields");m(this,"actions",{addOne:hA,addMany:pA,setOne:mA,setMany:yA,updateOne:fA,updateMany:SA,deleteOne:AA,deleteMany:wA,initialize:uA});m(this,"selectors",{selectById:OA,selectByIds:IA})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(r),blockers:[r.issue_type],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(f=>{throw this.dispatch(d(r.uuid)),f}),[r,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 mk extends k{constructor(){super(...arguments);m(this,"name","Issue Type Field Values Attachment");m(this,"url","/issue-type-field-values-attachments");m(this,"actions",{addOne:bA,addMany:bn,setOne:_A,setMany:RA,updateOne:MA,updateMany:kA,deleteOne:vA,deleteMany:_n,initialize:gA});m(this,"selectors",{selectById:VA,selectByIds:WA})}async bulkAdd(e){var f;const{addMany:n,setMany:a,deleteMany:c}=this.actions,d=new Date().toISOString(),o=((f=this.client.store.getState().userReducer.currentUser)==null?void 0:f.id)??null,l={},r=[],h=[];for(const S of e){const{fieldValuesUuid:O,fieldIdentifier:P,file:I}=S,F=await this.client.files.getFilePayload(I);F.sha1 in l||(l[F.sha1]=F);const g=_({file:URL.createObjectURL(I),file_type:I.type,file_name:I.name,file_sha1:F.sha1,created_by:o,field_values:O,submitted_at:d,field_identifier:P});r.push(g);const v={uuid:g.uuid,file_name:I.name,file_sha1:F.sha1,file_extension:F.extension,field_identifier:P,field_values:O};h.push(v)}this.dispatch(n(r));const y=this.enqueueRequest({description:T(p.POST,this.name,!0),method:p.POST,url:`${this.url}/bulk/`,payload:{submitted_at:d,attachments:h,files:Object.values(l)},blockers:r.map(S=>S.field_values),blocks:r.map(S=>S.uuid)});return y.then(({presigned_urls:S,attachments:O})=>{this.client.files.processPresignedUrls(S),this.dispatch(a(O))}).catch(S=>{throw this.dispatch(c(r.map(O=>O.uuid))),S}),[r,y.then(({attachments:S})=>S)]}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:d}=this.selectors,o=n.getState(),l=d(e)(o);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!0),method:p.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:{field_values__issue__project:e,latest:!0}},n)).flat();return this.dispatch(a(d)),d}}class yk extends k{constructor(){super(...arguments);m(this,"name","Issue Type Field Values");m(this,"url","/issue-type-field-values");m(this,"actions",{addOne:XS,addMany:xS,setOne:eA,setMany:tA,updateOne:sA,updateMany:iA,deleteOne:nA,deleteMany:aA,initialize:QS});m(this,"selectors",{selectById:rA,selectByIds:dA})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,r=new Date().toISOString(),h=_({...e,created_by:l,submitted_at:r}),y=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(h),blockers:[e.issue,e.fields_revision],blocks:[h.uuid]});return this.dispatch(a(h)),y.then(S=>{this.dispatch(c(S))}).catch(()=>{this.dispatch(d(h.uuid))}),[h,y]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=n.getState(),o=c(e.uuid)(d);if(!o)throw new Error(`Expected IssueTypeFieldValues with uuid ${e.uuid} to exist`);const l={...o,...e};this.dispatch(a(l));const r=this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[l.uuid,l.fields_revision,l.issue],blocks:[l.uuid]});return r.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(a(o))}),[l,r]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected submission with uuid ${e} to exist`);const r=BA(e)(o);this.dispatch(a(e)),this.dispatch(_n(B(r)));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(h){throw this.dispatch(c(l)),this.dispatch(bn(r)),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 fk extends k{constructor(){super(...arguments);m(this,"name","Issue Type Identifier");m(this,"url","/issue-type-identifiers");m(this,"actions",{addOne:jA,addMany:DA,setOne:$A,setMany:UA,updateOne:LA,updateMany:NA,deleteOne:HA,deleteMany:GA,initialize:CA});m(this,"selectors",{selectById:YA,selectByIds:ZA})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(r),blockers:[r.issue_type],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,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 o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected issue type identifier with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.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 Sk extends k{constructor(){super(...arguments);m(this,"name","Issue Type Identifier Value");m(this,"url","/issue-type-identifier-values");m(this,"actions",{addOne:xA,addMany:ew,setOne:tw,setMany:sw,updateOne:iw,updateMany:nw,deleteOne:aw,deleteMany:cw,initialize:XA});m(this,"selectors",{selectById:dw,selectByIds:lw})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(r),blockers:[e.issue,e.issue_type_identifier],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,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 value with uuid ${e.uuid} to exist`);const o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);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:T(p.DELETE,this.name,!1),method:p.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:{issue__project:e}},n)).flat();return this.dispatch(a(d)),d}}class Ak extends k{constructor(){super(...arguments);m(this,"name","Issue Type");m(this,"url","/issue-types");m(this,"actions",{addOne:pw,addMany:mw,setOne:yw,setMany:fw,updateOne:Sw,updateMany:Aw,deleteOne:ww,deleteMany:Tw,initialize:hw});m(this,"selectors",{selectById:Iw,selectByIds:Fw})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,r=new Date().toISOString(),h=_({...e,submitted_at:r,created_by:l});this.dispatch(a(h));const y=this.enqueueRequest({method:p.POST,url:`${this.url}/`,payload:E(h),blockers:[],blocks:[h.uuid]});return y.then(S=>{this.dispatch(c(S))}).catch(()=>{this.dispatch(d(h.uuid))}),[h,y]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=n.getState(),o=c(e.uuid)(d);if(!o)throw new Error(`IssueType with uuid ${e.uuid} does not exist in the store.`);const l={...o,...e};this.dispatch(a(l));const r=this.enqueueRequest({method:p.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return r.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(a(o))}),[l,r]}async delete(e){const{store:n}=this.client,{deleteOne:a,setOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`IssueType with uuid ${e} does not exist in the store.`);const r=TS(e)(o);this.dispatch(a(e)),this.dispatch(An(B(r)));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(h){throw this.dispatch(c(l)),this.dispatch(Sn(r)),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 wk extends k{constructor(){super(...arguments);m(this,"name","Issue Type Status");m(this,"url","/issue-type-statuses");m(this,"actions",{addOne:_w,addMany:Rw,setOne:Mw,setMany:kw,updateOne:vw,updateMany:Ew,deleteOne:Vw,deleteMany:Ww,initialize:bw});m(this,"selectors",{selectById:zn,selectByIds:zw})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(r),blockers:[e.issue_type],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,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 o={...d,...e};this.dispatch(n(o));const l=this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(r=>{this.dispatch(n(r))}).catch(()=>{this.dispatch(n(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=d(e)(n.getState());if(!o)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(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(o)),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 Tk extends k{constructor(){super(...arguments);m(this,"name","Issue Update");m(this,"url","/issue-updates");m(this,"actions",{addOne:Cn,addMany:jn,setOne:Dw,setMany:$w,updateOne:Uw,updateMany:Lw,deleteOne:Dn,deleteMany:$n,initialize:jw});m(this,"selectors",{selectById:Nw,selectByIds:Hw})}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 Ok=1800;function Ik(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 Fk extends AM{constructor(){super(...arguments);m(this,"_getRenewedTokens",async e=>{const n=this.performRequest({method:p.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(sp(!1)),this.clearTokens(),this.dispatch(b()),this.dispatch(b())}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.log("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=Vb(e).exp??n}catch{a=n}return a-n<Ok}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 D&&this.clearAuth(),e instanceof Error?Promise.reject(e):Promise.reject(new Error((e??wt).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 D({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 D({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:p.POST,url:this.initTokensUrl,payload:e,isAuthNeeded:!1,checkAuth:!1}).then(a=>{this.setTokens(Ik(a))})}}class Pk extends Tt{constructor(){super(...arguments);m(this,"name","Organization Access");m(this,"url","/organization-accesses");m(this,"actions",{addOne:rT,addMany:dT,setOne:lT,setMany:oT,updateOne:uT,updateMany:hT,deleteOne:pT,deleteMany:mT,initialize:cT});m(this,"selectors",{selectById:fT,selectByIds:ST})}update(e){const{store:n}=this.client,{updateOne:a}=this.actions,{selectById:c}=this.selectors,d=c(e.uuid)(n.getState()),o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(r=>{throw this.dispatch(a(d)),r}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o),r=es(l.user)(o);this.dispatch(a(l.uuid)),this.dispatch(Gn(l.user));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${l.uuid}/`,blockers:[l.uuid],blocks:[]})}catch(h){throw this.dispatch(c(l)),this.dispatch(Hn(r)),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 gk extends Tt{constructor(){super(...arguments);m(this,"name","Organization");m(this,"url","/organizations");m(this,"actions",{addOne:PT,addMany:FT,setOne:IT,setMany:OT,updateOne:bT,updateMany:gT,deleteOne:_T,deleteMany:RT,initialize:TT});m(this,"selectors",{selectById:vT,selectByIds:ET})}async add(e){const{addOne:n}=this.actions,a=await this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.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(p.PATCH,this.name,!1),method:p.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(p.POST,this.name,!1),method:p.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 bk extends k{constructor(){super(...arguments);m(this,"name","Project Access");m(this,"url","/project-accesses");m(this,"actions",{addOne:UT,addMany:LT,setOne:NT,setMany:HT,updateOne:GT,updateMany:KT,deleteOne:YT,deleteMany:ZT,initialize:$T});m(this,"selectors",{selectById:QT,selectByIds:XT})}add(e){var r;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=_({...e,created_by:((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null});this.dispatch(a(o));const l=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(o),blockers:[o.organization_access,o.project],blocks:[o.uuid]});return l.then(h=>{this.dispatch(c(h))}).catch(h=>{throw this.dispatch(d(o.uuid)),h}),[o,l]}bulkAdd(e){var h;const{store:n}=this.client,{addMany:a,deleteMany:c,updateMany:d}=this.actions,o=((h=n.getState().userReducer.currentUser)==null?void 0:h.id)??null,l=e.map(y=>_({...y,created_by:o}));this.dispatch(a(l));const r=this.enqueueRequest({description:T(p.POST,this.name,!0),method:p.POST,url:`${this.url}/bulk/`,payload:{project_accesses:l.map(y=>E(y))},blockers:l.flatMap(y=>[y.project,y.organization_access]),blocks:l.map(y=>y.uuid)});return r.then(y=>{this.dispatch(d(y))}).catch(y=>{throw this.dispatch(c(l.map(f=>f.uuid))),y}),[l,r]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=c(e.uuid)(n.getState()),o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[]});return l.then(r=>{this.dispatch(a(r))}).catch(r=>{throw this.dispatch(a(d)),r}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=d(e)(n.getState());this.dispatch(a(e));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(o)),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 _k extends L{constructor(){super(...arguments);m(this,"name","Project Attachment");m(this,"url","/project-attachments");m(this,"actions",{addOne:tO,addMany:sO,setOne:iO,setMany:nO,updateOne:aO,updateMany:cO,deleteOne:rO,deleteMany:dO,initialize:eO});m(this,"selectors",{selectById:oO,selectByIds:uO})}getId(e){return e.uuid}buildModel(e){return _({file:URL.createObjectURL(e.file),file_sha1:e.file_sha1,created_by:e.created_by,file_name:e.file.name,file_type:e.file.type,submitted_at:e.submitted_at,project:e.modelUuid})}buildPayload(e,n){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:n.extension,project:e.project}}async bulkAdd(e){return this._bulkAdd(e.map(n=>({modelUuid:n.projectUuid,file:n.file})))}async delete(e){return this._delete(e)}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 Rk extends k{constructor(){super(...arguments);m(this,"name","Project File");m(this,"url","/project-files");m(this,"actions",{addOne:SO,addMany:AO,setOne:yO,setMany:fO,updateOne:wO,updateMany:TO,deleteOne:OO,deleteMany:IO,initialize:mO});m(this,"selectors",{selectById:RO,selectByIds:MO})}async saveExisting(e){const{setOne:n}=this.actions;if(!e.uuid)throw new Error("You can only use this method to save existing project files. The one provided has no uuid.");const a={...e};delete a.file;const c=this.enqueueRequest({method:p.PATCH,url:`${this.url}/${e.uuid}/`,payload:a,blockers:[e.uuid],blocks:[e.uuid]});return c.then(d=>{this.dispatch(n(d))}),c}saveActive(){const{store:e}=this.client,{setOne:n}=this.actions,a=e.getState(),c=a.projectFileReducer.activeProjectFileId;if(!c)throw new Error("No active project file");const d=a.projectFileReducer.instances[c];if(!d)throw new Error("No active project file");if(!d.bounds&&!d.canvas_bounds)throw new Error("Project file must either have bounds or canvas_bounds set");let o;if(typeof d.file=="string"&&!d.file.startsWith("blob:")){const h={...d};delete h.file,o={method:p.PATCH,url:`${this.url}/${c}/`,payload:h,blockers:[c],blocks:[c]}}else o=new Promise((h,y)=>{this.client.files.uploadFileToS3(d.file_sha1).then(([f])=>{h({method:p.POST,url:`${this.url}/`,payload:{...d,...f},blockers:[c],blocks:[c]})}).catch(y)});const r=Promise.resolve(o).then(h=>this.enqueueRequest(h));return r.then(h=>{this.dispatch(n(h))}),this.dispatch(gO),this.dispatch(PO(null)),this.dispatch(FO(!1)),[d,r]}async delete(e){const{store:n}=this.client,{addOne:a,deleteOne:c}=this.actions,{selectById:d}=this.selectors,o=d(e)(n.getState());if(!o)throw new Error(`Expected project file with uuid ${e} to exist in the store.`);this.dispatch(c(e));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(a(o)),l}}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 Mk extends Tt{constructor(){super(...arguments);m(this,"name","Project");m(this,"url","/projects");m(this,"actions",{addOne:zO,addMany:BO,setOne:WO,setMany:VO,updateOne:CO,updateMany:qO,deleteOne:jO,deleteMany:DO,initialize:EO});m(this,"selectors",{selectById:LO,selectByIds:NO})}async add(e){const{addOne:n}=this.actions,a=await this.performRequest({method:p.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:p.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(p.DELETE,this.name,!1),method:p.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 kk extends k{constructor(){super(...arguments);m(this,"name","Team Membership");m(this,"url","/team-memberships");m(this,"actions",{addOne:YO,addMany:ZO,setOne:JO,setMany:QO,updateOne:XO,updateMany:xO,deleteOne:eI,deleteMany:tI,initialize:KO});m(this,"selectors",{selectById:nI,selectByIds:aI})}add(e){var r;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=_({...e,created_by:((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null});this.dispatch(a(o));const l=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(o),blockers:[e.team],blocks:[o.uuid]});return l.then(h=>{this.dispatch(c(h))}).catch(()=>{this.dispatch(d(o.uuid))}),[o,l]}bulkAdd(e){var h;const{store:n}=this.client,{addMany:a,setMany:c,deleteMany:d}=this.actions,o=((h=n.getState().userReducer.currentUser)==null?void 0:h.id)??null,l=e.map(y=>_({...y,created_by:o}));this.dispatch(a(l));const r=this.enqueueRequest({description:T(p.POST,this.name,!0),method:p.POST,url:`${this.url}/bulk/`,payload:{team_memberships:l.map(y=>E(y))},blockers:l.map(y=>y.team),blocks:l.map(y=>y.uuid)});return r.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(d(l.map(y=>y.uuid)))}),[l,r]}async delete(e){const{store:n}=this.client,{deleteOne:a,setOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected team membership with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(r){throw this.dispatch(c(l)),r}}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 vk extends k{constructor(){super(...arguments);m(this,"name","Team");m(this,"url","/teams");m(this,"actions",{addOne:dI,addMany:lI,setOne:oI,setMany:uI,updateOne:hI,updateMany:pI,deleteOne:mI,deleteMany:yI,initialize:rI});m(this,"selectors",{selectById:SI,selectByIds:AI})}add(e){var r;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=_({...e,submitted_at:new Date().toISOString(),created_by:((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null});this.dispatch(a(o));const l=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(o),blockers:[],blocks:[o.uuid]});return l.then(h=>{this.dispatch(c(h))}).catch(()=>{this.dispatch(d(o.uuid))}),[o,l]}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 o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.PATCH,url:`${this.url}/${e.uuid}/`,payload:E(e),blockers:[e.uuid],blocks:[e.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,setOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected team with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(r){throw this.dispatch(c(l)),r}}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 Tt{constructor(){super(...arguments);m(this,"name","User");m(this,"url","/user");m(this,"actions",{addOne:Hn,addMany:Xw,setOne:Qw,setMany:Jw,updateOne:eT,updateMany:xw,deleteOne:Gn,deleteMany:tT,initialize:Zw});m(this,"selectors",{selectById:es,selectByIds:nT})}async list(e,n){const{organizationUuid:a,...c}=e,d=a?`/organizations/${a}${this.url}s/`:`/${this.url}`;return this.performRequest({method:p.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}}class Vk extends k{constructor(){super(...arguments);m(this,"name","Workflow");m(this,"url","/workflows");m(this,"actions",{addOne:II,addMany:da,setOne:FI,setMany:PI,updateOne:gI,updateMany:bI,deleteOne:_I,deleteMany:la,initialize:OI});m(this,"selectors",{selectById:MI,selectByIds:kI})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,r=new Date().toISOString(),h=_({...e,created_by:l,submitted_at:r});this.dispatch(a(h));const y=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(h),blockers:[h.project,h.workflow_type],blocks:[h.uuid]});return y.then(S=>{this.dispatch(c(S))}).catch(()=>{this.dispatch(d(h.uuid))}),[h,y]}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 workflow with uuid ${e.uuid} to exist`);const o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[d.uuid],blocks:[d.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected workflow with uuid ${e} to exist`);const r=oP(e)(o),h=NI(e)(o),y=QP(e)(o),f=og(e)(o),S=Fg(e)(o),O=RF(e)(o),P=yF(e)(o),I=DF(e)(o),F={};for(const v of P)for(const V of ya(v.uuid)(o))F[V.uuid]=V;const g=Object.values(F);this.dispatch(a(e)),this.dispatch(Ea(B(r))),this.dispatch(ha(B(h))),this.dispatch($a(B(y))),this.dispatch(Na(B(f))),this.dispatch(Ka(B(S))),this.dispatch(Oa(B(O))),this.dispatch(Pa(B(I))),this.dispatch(Aa(B(P))),this.dispatch(cs(B(g)));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(v){throw this.dispatch(c(l)),this.dispatch(va(r)),this.dispatch(ua(h)),this.dispatch(Da(y)),this.dispatch(La(f)),this.dispatch(Ga(S)),this.dispatch(Ta(O)),this.dispatch(Fa(I)),this.dispatch(Sa(P)),this.dispatch(as(g)),v}}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 Wk extends k{constructor(){super(...arguments);m(this,"name","Workflow Step Assignee");m(this,"url","/workflow-step-assignees");m(this,"actions",{addOne:BI,addMany:ua,setOne:zI,setMany:qI,updateOne:CI,updateMany:jI,deleteOne:DI,deleteMany:ha,initialize:WI});m(this,"selectors",{selectById:UI,selectByIds:LI})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=new Date().toISOString(),l=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,r=_({...e,submitted_at:o,created_by:l});this.dispatch(a(r));const h=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(r),blockers:[e.workflow,e.workflow_step],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,h]}bulkAdd(e){var y;const{store:n}=this.client,{addMany:a,setMany:c,deleteMany:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=e.map(f=>_({...f,submitted_at:l,created_by:o}));this.dispatch(a(r));const h=this.enqueueRequest({description:T(p.POST,this.name,!0),method:p.POST,url:`${this.url}/bulk/`,payload:{workflow_step_assignees:r.map(f=>E(f))},blockers:r.flatMap(f=>[f.workflow,f.workflow_step]),blocks:r.map(f=>f.uuid)});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.map(f=>f.uuid)))}),[r,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 workflow step assignee with uuid ${e.uuid} to exist`);const o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,setOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected workflow step assignee with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(r){throw this.dispatch(c(l)),r}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:d}=this.selectors,o=n.getState(),l=d(e)(o);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!0),method:p.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:{workflow__project:e}},n)).flat();return this.dispatch(a(d)),d}}class Bk extends L{constructor(){super(...arguments);m(this,"name","Workflow Step Comment Attachment");m(this,"url","/workflow-step-comment-attachments");m(this,"actions",{addOne:YI,addMany:as,setOne:ZI,setMany:JI,updateOne:QI,updateMany:XI,deleteOne:xI,deleteMany:cs,initialize:KI});m(this,"selectors",{selectById:tF,selectByIds:sF})}getId(e){return e.uuid}buildModel(e){return _({file:URL.createObjectURL(e.file),file_sha1:e.file_sha1,created_by:e.created_by,file_name:e.file.name,file_type:e.file.type,submitted_at:e.submitted_at,workflow_step_comment:e.modelUuid})}buildPayload(e,n){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:n.extension,workflow_step_comment:e.workflow_step_comment}}async bulkAdd(e){return this._bulkAdd(e.map(n=>({modelUuid:n.workflowStepCommentUuid,file:n.file})))}async delete(e){return this._delete(e)}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{workflow_step_comment__workflow__project:e}},n)).flat();return this.dispatch(a(d)),d}}class zk extends k{constructor(){super(...arguments);m(this,"name","Workflow Step Comment");m(this,"url","/workflow-step-comments");m(this,"actions",{addOne:cF,addMany:Sa,setOne:rF,setMany:dF,updateOne:lF,updateMany:oF,deleteOne:uF,deleteMany:Aa,initialize:aF});m(this,"selectors",{selectById:pF,selectByIds:mF})}add(e){var r;const{store:n}=this.client,{addOne:a,updateOne:c,deleteOne:d}=this.actions,o=_({...e,created_by:((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(o));const l=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(o),blockers:[e.workflow,e.workflow_step],blocks:[o.uuid]});return l.then(h=>{this.dispatch(c(h))}).catch(()=>{this.dispatch(d(o.uuid))}),[o,l]}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 o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=d(e)(n.getState());if(!o)throw new Error(`Comment with uuid ${e} not found in store`);const l=ya(e)(n.getState());this.dispatch(a(e)),this.dispatch(cs(B(l)));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(r){throw this.dispatch(c(o)),this.dispatch(as(l)),r}}async refreshStore(e,n){const{setMany:a}=this.actions,d=(await this.listPaginated({queryParams:{workflow__project:e}},n)).flat();return this.dispatch(a(d)),d}}class qk extends k{constructor(){super(...arguments);m(this,"name","Workflow Step Completion");m(this,"url","/workflow-step-completions");m(this,"actions",{addOne:wF,addMany:Ta,setOne:TF,setMany:OF,updateOne:IF,updateMany:FF,deleteOne:PF,deleteMany:Oa,initialize:AF});m(this,"selectors",{selectById:bF,selectByIds:_F})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=new Date().toISOString(),l=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,r=_({...e,submitted_at:o,created_by:l});this.dispatch(a(r));const h=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(r),blockers:[e.workflow,e.workflow_step],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,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 workflow step completion with uuid ${e.uuid} to exist`);const o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,setOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected workflow step completion with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(r){throw this.dispatch(c(l)),r}}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{workflow__project:e}},n)).flat();return this.dispatch(a(d)),d}}class Ck extends k{constructor(){super(...arguments);m(this,"name","Workflow Step Event");m(this,"url","/workflow-step-events");m(this,"actions",{addOne:EF,addMany:Fa,setOne:VF,setMany:WF,updateOne:BF,updateMany:zF,deleteOne:qF,deleteMany:Pa,initialize:vF});m(this,"selectors",{selectById:CF,selectByIds:jF})}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{workflow__project:e}},n)).flat();return this.dispatch(a(d)),d}}class jk extends k{constructor(){super(...arguments);m(this,"name","Workflow Step Field Values Attachment");m(this,"url","/workflow-step-field-values-attachments");m(this,"actions",{addOne:NF,addMany:_a,setOne:HF,setMany:GF,updateOne:KF,updateMany:YF,deleteOne:ZF,deleteMany:Ra,initialize:LF});m(this,"selectors",{selectById:QF,selectByIds:XF})}async bulkAdd(e){var f;const{addMany:n,setMany:a,deleteMany:c}=this.actions,d=new Date().toISOString(),o=((f=this.client.store.getState().userReducer.currentUser)==null?void 0:f.id)??null,l={},r=[],h=[];for(const S of e){const{fieldValuesUuid:O,fieldIdentifier:P,file:I}=S,F=await this.client.files.getFilePayload(I);F.sha1 in l||(l[F.sha1]=F);const g=_({file:URL.createObjectURL(I),file_type:I.type,file_name:I.name,file_sha1:F.sha1,created_by:o,field_values:O,submitted_at:d,field_identifier:P});r.push(g);const v={uuid:g.uuid,file_name:I.name,file_sha1:F.sha1,file_extension:F.extension,field_identifier:P,field_values:O};h.push(v)}this.dispatch(n(r));const y=this.enqueueRequest({description:T(p.POST,this.name,!0),method:p.POST,url:`${this.url}/bulk/`,payload:{submitted_at:d,attachments:h,files:Object.values(l)},blockers:r.map(S=>S.field_values),blocks:r.map(S=>S.uuid)});return y.then(({presigned_urls:S,attachments:O})=>{this.client.files.processPresignedUrls(S),this.dispatch(a(O))}).catch(S=>{throw this.dispatch(c(r.map(O=>O.uuid))),S}),[r,y.then(({attachments:S})=>S)]}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:d}=this.selectors,o=n.getState(),l=d(e)(o);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!0),method:p.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:{field_values__workflow__project:e,latest:!0}},n)).flat();return this.dispatch(a(d)),d}}class Dk extends k{constructor(){super(...arguments);m(this,"name","Workflow Step Field Values");m(this,"url","/workflow-step-field-values");m(this,"actions",{addOne:iP,addMany:va,setOne:nP,setMany:aP,updateOne:cP,updateMany:rP,deleteOne:dP,deleteMany:Ea,initialize:sP});m(this,"selectors",{selectById:uP,selectByIds:hP})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,r=new Date().toISOString(),h=_({...e,created_by:l,submitted_at:r}),y=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(h),blockers:[e.workflow,e.workflow_step,e.fields_revision],blocks:[h.uuid]});return this.dispatch(a(h)),y.then(S=>{this.dispatch(c(S))}).catch(()=>{this.dispatch(d(h.uuid))}),[h,y]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=n.getState(),o=c(e.uuid)(d);if(!o)throw new Error(`Expected WorkflowStepFieldValues with uuid ${e.uuid} to exist`);const l={...o,...e};this.dispatch(a(l));const r=this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[l.uuid,l.fields_revision,l.workflow,l.workflow_step],blocks:[l.uuid]});return r.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(a(o))}),[l,r]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected submission with uuid ${e} to exist`);const r=xF(e)(o);this.dispatch(a(e)),this.dispatch(Ra(B(r)));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(h){throw this.dispatch(c(l)),this.dispatch(_a(r)),h}}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{workflow__project:e,latest:!0}},n)).flat();return this.dispatch(a(d)),d}}class $k extends k{constructor(){super(...arguments);m(this,"name","Workflow Step Fields Attachment");m(this,"url","/workflow-step-fields-attachments");m(this,"actions",{addOne:fP,addMany:Wa,setOne:SP,setMany:AP,updateOne:wP,updateMany:TP,deleteOne:OP,deleteMany:Ba,initialize:yP});m(this,"selectors",{selectById:PP,selectByIds:gP})}async bulkAdd(e){var f;const{addMany:n,setMany:a,deleteMany:c}=this.actions,d=new Date().toISOString(),o=((f=this.client.store.getState().userReducer.currentUser)==null?void 0:f.id)??null,l={},r=[],h=[];for(const S of e){const{fieldsRevisionUuid:O,fieldIdentifier:P,file:I}=S,F=await this.client.files.getFilePayload(I);F.sha1 in l||(l[F.sha1]=F);const g=_({file:URL.createObjectURL(I),file_type:I.type,file_name:I.name,file_sha1:F.sha1,created_by:o,fields_revision:O,submitted_at:d,field_identifier:P});r.push(g);const v={uuid:g.uuid,file_name:I.name,field_identifier:P,file_extension:F.extension,file_sha1:F.sha1,fields_revision:O};h.push(v)}this.dispatch(n(r));const y=this.enqueueRequest({description:T(p.POST,this.name,!0),method:p.POST,url:`${this.url}/bulk/`,payload:{submitted_at:d,attachments:h,files:Object.values(l)},blockers:r.map(S=>S.fields_revision),blocks:r.map(S=>S.uuid)});return y.then(S=>{this.client.files.processPresignedUrls(S.presigned_urls),this.dispatch(a(S.attachments))}).catch(()=>{this.dispatch(c(r.map(S=>S.uuid)))}),[r,y.then(({attachments:S})=>S)]}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 Uk extends k{constructor(){super(...arguments);m(this,"name","Workflow Step Fields");m(this,"url","/workflow-step-fields");m(this,"actions",{addOne:MP,addMany:kP,setOne:vP,setMany:EP,updateOne:VP,updateMany:WP,deleteOne:BP,deleteMany:zP,initialize:RP});m(this,"selectors",{selectById:qP,selectByIds:CP})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(r),blockers:[r.workflow_step],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(f=>{throw this.dispatch(d(r.uuid)),f}),[r,h]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,c=n.getState().workflowStepFieldsReducer.instances[e.uuid];if(!c)throw new Error(`WorkflowStepFields with uuid ${e.uuid} not found`);const d={...c,...e};this.dispatch(a(d));const o=this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.PATCH,url:`${this.url}/${c.uuid}/`,payload:e,blockers:[c.uuid],blocks:[c.uuid]});return o.then(l=>{this.dispatch(a(l))}).catch(l=>{throw this.dispatch(a(c)),l}),[d,o]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,d=n.getState().workflowStepFieldsReducer.instances[e];if(!d)throw new Error(`WorkflowStepFields with uuid ${e} not found`);const o=FP(e)(n.getState());this.dispatch(a(e)),this.dispatch(Ba(B(o)));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(l){throw this.dispatch(c(d)),this.dispatch(Wa(o)),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 Lk extends k{constructor(){super(...arguments);m(this,"name","Workflow Step Reviewer");m(this,"url","/workflow-step-reviewers");m(this,"actions",{addOne:UP,addMany:Da,setOne:LP,setMany:NP,updateOne:HP,updateMany:GP,deleteOne:KP,deleteMany:$a,initialize:$P});m(this,"selectors",{selectById:ZP,selectByIds:JP})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=new Date().toISOString(),l=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,r=_({...e,submitted_at:o,created_by:l});this.dispatch(a(r));const h=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(r),blockers:[e.workflow,e.workflow_step],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,h]}bulkAdd(e){var y;const{store:n}=this.client,{addMany:a,setMany:c,deleteMany:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=e.map(f=>_({...f,submitted_at:l,created_by:o}));this.dispatch(a(r));const h=this.enqueueRequest({description:T(p.POST,this.name,!0),method:p.POST,url:`${this.url}/bulk/`,payload:{workflow_step_reviewers:r.map(f=>E(f))},blockers:r.flatMap(f=>[f.workflow,f.workflow_step]),blocks:r.map(f=>f.uuid)});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.map(f=>f.uuid)))}),[r,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 workflow step reviewer with uuid ${e.uuid} to exist`);const o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,setOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected workflow step reviewer with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(r){throw this.dispatch(c(l)),r}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:d}=this.selectors,o=n.getState(),l=d(e)(o);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!0),method:p.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:{workflow__project:e}},n)).flat();return this.dispatch(a(d)),d}}class Nk extends k{constructor(){super(...arguments);m(this,"name","Workflow Step Review Request");m(this,"url","/workflow-step-review-requests");m(this,"actions",{addOne:tg,addMany:La,setOne:sg,setMany:ig,updateOne:ng,updateMany:ag,deleteOne:cg,deleteMany:Na,initialize:eg});m(this,"selectors",{selectById:dg,selectByIds:lg})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=new Date().toISOString(),l=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,r=_({...e,submitted_at:o,created_by:l});this.dispatch(a(r));const h=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(r),blockers:[e.workflow,e.workflow_step],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,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 workflow step review request with uuid ${e.uuid} to exist`);const o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,setOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected workflow step review request with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(r){throw this.dispatch(c(l)),r}}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{workflow__project:e}},n)).flat();return this.dispatch(a(d)),d}}class Hk extends k{constructor(){super(...arguments);m(this,"name","Workflow Step Review");m(this,"url","/workflow-step-reviews");m(this,"actions",{addOne:mg,addMany:Ga,setOne:yg,setMany:fg,updateOne:Sg,updateMany:Ag,deleteOne:wg,deleteMany:Ka,initialize:pg});m(this,"selectors",{selectById:Og,selectByIds:Ig})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=new Date().toISOString(),l=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,r=_({...e,submitted_at:o,created_by:l});this.dispatch(a(r));const h=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(r),blockers:[e.workflow,e.workflow_step],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,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 workflow step review with uuid ${e.uuid} to exist`);const o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,setOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected workflow step review with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(r){throw this.dispatch(c(l)),r}}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{workflow__project:e}},n)).flat();return this.dispatch(a(d)),d}}class Gk extends k{constructor(){super(...arguments);m(this,"name","Workflow Step");m(this,"url","/workflow-steps");m(this,"actions",{addOne:_g,addMany:Za,setOne:Rg,setMany:Mg,updateOne:kg,updateMany:vg,deleteOne:Eg,deleteMany:Ja,initialize:bg});m(this,"selectors",{selectById:Bg,selectByIds:qg})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(r),blockers:[r.workflow_type],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,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 workflow step with uuid ${e.uuid} found in the store`);const o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.PATCH,url:`${this.url}/${d.uuid}/`,payload:{name:e.name,order:e.order},blockers:[d.uuid],blocks:[d.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`No workflow step with uuid ${e} found in the store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.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:{workflow_type__organization:e}},n);return this.dispatch(a(c)),c}}class Kk extends k{constructor(){super(...arguments);m(this,"name","Workflow Type");m(this,"url","/workflow-types");m(this,"actions",{addOne:Dg,addMany:$g,setOne:Ug,setMany:Lg,updateOne:Ng,updateMany:Hg,deleteOne:Gg,deleteMany:Kg,initialize:jg});m(this,"selectors",{selectById:Zg,selectByIds:Jg})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(r),blockers:[],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,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 workflow type with uuid ${e.uuid} to exist`);const o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[d.uuid],blocks:[d.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected workflow type with uuid ${e} to exist`);const r=vI(e)(o),h=zg(e)(o);this.dispatch(a(e)),this.dispatch(la(B(r))),this.dispatch(Ja(B(h)));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(y){throw this.dispatch(c(l)),this.dispatch(da(r)),this.dispatch(Za(h)),y}}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 ac(t,s,e,n,a){const c=n instanceof yt;c&&s.checkAuth!==!1&&await n.auth.prepareAuth();const d={queryParams:"",isAuthNeeded:!0},{s3url:o,payload:l,headers:r,method:h,queryParams:y,attachmentHash:f,isExternalUrl:S,isAuthNeeded:O,isResponseBlob:P}={...d,...s};let I=s.url;const F=f?await e.files.fetchCache(f):void 0;if(f&&!F)throw new Error(`Cannot upload file ${f} because it's not cached.`);!S&&!I.startsWith("http")&&(!I.startsWith("/")&&!I.startsWith("blob:")&&(I="/"+I),I=t+I);const g=C=>{if(f){if(!o)throw new Error(`No S3 URL for file ${f}`);if("warning"in o)throw new Error(`S3 URL warning for file ${f}`);if(!F)throw new Error(`No file for file ${f}`);const q=o.fields["x-amz-checksum-sha1"];if(!q)throw new Error(`No checksum for file ${f}`);return C.set("x-amz-checksum-sha1",q).field({...l,...o.fields}).attach("file",F)}return C.send(l)},V={[p.GET]:()=>P?St.get(I.toString()).responseType("blob"):St.get(I.toString()),[p.POST]:()=>{const C=St.post(I.toString());return g(C)},[p.PATCH]:()=>{const C=St.patch(I.toString());return g(C)},[p.PUT]:()=>{const C=St.put(I.toString());return g(C)},[p.DELETE]:()=>{const C=St.delete(I.toString());return g(C)}}[h];let W=V();if(a==null||a.addEventListener("abort",()=>{console.debug("aborting request:",s.url),W.abort()}),O&&c){const C=n.auth.getAuthHeader();W=W.set("Authorization",C)}r&&(W=W.set(r));try{return await W.query(y)}catch(C){const q=mb(C),bb=q==null?void 0:q.status;if(c&&bb===401)return await n.auth.handleUnauthorized(W,q),W.query(y);throw new D({response:q,innerError:C,discard:tc.includes(bb)})}}class Yk{constructor(s){m(this,"store");this.store=s}_performRequest(s,e,n,a){const c=new fs,d={...e,uuid:e.uuid??mt.v4()};return ac(s,d,this,n,a).then(o=>{c.resolve(o.body)}).catch(o=>{o instanceof Error?c.reject(o):c.reject(new Error((o??wt).toString()))}),c}async performRequest(s,e,n,a){return this._performRequest(s,e,n,a).then(c=>{if(c instanceof D)throw c;return c})}async enqueueRequest(s,e,n){return this._enqueueRequest(s,e,n).then(a=>{if(a instanceof D)throw a;return a})}_enqueueRequest(s,e,n){const a=new fs,c={...s,BASE_URL:e,serviceName:n},d=this.store.dispatch(zT(c)),o=r=>{if(r)a.resolve(r.body);else{const h=new D({message:"Could not get a response from the server.",response:r,discard:!0});a.reject(h)}},l=r=>{r instanceof D?r.options.discard=!0:(console.error("Received an unexpected error while processing a request:",r,`
|
|
15
|
+
Converting error to APIError and discarding.`),r=new D({message:"An error occurred while processing the request.",innerError:r,discard:!0})),a.reject(r)};return d.then(o,l),a}async performPagination(s,e,n,a,c){const d={...e,queryParams:{...e.queryParams,paginate:!0,limit:n}},{method:o}=d,l=[];let r=await this.performRequest(s,d,a,c);for(l.push(r.results);r.next;)r=await this.performRequest(s,{url:r.next,method:o},a,c),l.push(r.results);return l}}class Ot{constructor(){m(this,"graph");m(this,"requestAttemptCounter");this.graph=new Wb.DepGraph,this.requestAttemptCounter={}}static _fromOutbox(s){const e=new Ot;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(o=>a.payload.blockers.includes(o))&&Ot._addDependency(a.payload.uuid,d.payload.uuid,e.graph)}}return e}_addDependency(s,e){Ot._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 yb;function fb(t){yb=t}function It(){return yb}let Sb;function Ab(t){Sb=t}function wb(){return Sb}let cc=null;function ft(){const t=It();if(!t)return console.warn("Client store not set; cannot get outbox coordinator yet."),null;if(cc)return cc;const s=t.getState().offline.outbox,e=Ot._fromOutbox(s);return cc=e,e}const Zk=(t,s)=>{const e=new s(t);return Ab(e),fb(t),e};class Jk{constructor(s){m(this,"_all");m(this,"_previous");this._all=[s],this._previous=s,this.then=this.then.bind(this),this.compile=this.compile.bind(this)}then(s){return this._previous&&(this._previous.next=s),this._all.push(s),this._previous=s,{then:this.then,compile:this.compile}}compile(){return this._all}}class rc{constructor(){m(this,"next");this.next=null}then(s){return new Jk(this).then(s)}async run(s){if(this.next)return this.next.run(s);{if(console.debug("Middleware finished. Performing request:",s.payload.url),!It())throw new Error("Client store not set");const n=wb();if(!n)throw new Error("Client SDK not set");return ub(s,n)}}}class Tb extends rc{async run(s){return super.run(s)}}class Ob extends rc{async run(s){return super.run(s)}}const Ib=new Tb().then(new Ob).compile();function Fb(t){var s;return(s=Ib[0])==null?void 0:s.run(t)}var Pb=(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))(Pb||{});i.ALL_MIDDLEWARE=Ib,i.APIError=D,i.ATTACHMENT_MODEL_DEFAULT_PAGE_SIZE=sb,i.AgentService=wM,i.AssetAttachmentService=TM,i.AssetProcedureService=bM,i.AssetProcedureStepFieldValuesAttachmentService=kM,i.AssetProcedureStepFieldValuesService=vM,i.AssetProcedureStepFieldsAttachmentService=RM,i.AssetProcedureStepFieldsService=MM,i.AssetProcedureStepService=EM,i.AssetProcedureTypeAttachmentService=OM,i.AssetProcedureTypeFieldValuesAttachmentService=PM,i.AssetProcedureTypeFieldValuesService=gM,i.AssetProcedureTypeFieldsAttachmentService=IM,i.AssetProcedureTypeFieldsService=FM,i.AssetProcedureTypeService=_M,i.AssetService=VM,i.AssetStageCompletionService=WM,i.AssetStageService=BM,i.AssetStatusType=pc,i.AssetTypeAttachmentService=zM,i.AssetTypeFieldValuesAttachmentService=jM,i.AssetTypeFieldValuesService=DM,i.AssetTypeFieldsAttachmentService=qM,i.AssetTypeFieldsService=CM,i.AssetTypeIdentifierService=$M,i.AssetTypeIdentifierValueService=UM,i.AssetTypeService=LM,i.AssetTypeStatusService=NM,i.AttachmentModel=mc,i.BaseApiService=yt,i.BaseModelApiService=Tt,i.BaseOfflineAttachmentModelService=L,i.BaseOfflineModelApiService=k,i.BaseSDK=Yk,i.COMMON_AUTO_FIELDS=Fc,i.CategoryService=HM,i.DEFAULT_ISSUE_PRIORITY=Bb,i.DEFAULT_PAGE_SIZE=tb,i.DISCARD_HTTP_STATUSES=tc,i.DeferredPromise=fs,i.DocumentAttachmentService=GM,i.DocumentService=KM,i.EMPTY_ARRAY=oc,i.EMPTY_OBJECT=uc,i.EmailDomainsService=YM,i.EmailVerificationService=ZM,i.FileService=QM,i.FormIdentifierService=XM,i.FormIdentifierValueService=xM,i.FormRevisionAttachmentService=ek,i.FormRevisionService=tk,i.FormService=sk,i.FormSubmissionAttachmentService=ik,i.FormSubmissionService=nk,i.GeoImageService=ak,i.HttpMethod=p,i.IssueAssociationService=ck,i.IssueAttachmentService=rk,i.IssueCommentAttachmentService=dk,i.IssueCommentService=lk,i.IssuePriority=ys,i.IssueService=ok,i.IssueStatusType=yc,i.IssueTypeAttachmentService=uk,i.IssueTypeFieldValuesAttachmentService=mk,i.IssueTypeFieldValuesService=yk,i.IssueTypeFieldsAttachmentService=hk,i.IssueTypeFieldsService=pk,i.IssueTypeIdentifierService=fk,i.IssueTypeIdentifierValueService=Sk,i.IssueTypeService=Ak,i.IssueTypeStatusService=wk,i.IssueUpdateChange=j,i.IssueUpdateService=Tk,i.JWTService=Fk,i.MAX_SERVICE_BATCH_SIZE=U,i.OUTBOX_RETRY_DELAY=Ac,i.OfflineAnalyticsMiddleware=Tb,i.OfflineMiddleware=rc,i.OrganizationAccessLevel=hc,i.OrganizationAccessService=Pk,i.OrganizationService=gk,i.OutboxCoordinator=Ot,i.ProjectAccessService=bk,i.ProjectAttachmentService=_k,i.ProjectFileService=Rk,i.ProjectService=Mk,i.RESET_ORGANIZATION_STATE=M,i.RESET_PROJECT_STATE=z,i.RESET_STATE=b,i.RateLimitingMiddleware=Ob,i.SelectorBuilder=a_,i.TeamMembershipService=kk,i.TeamService=vk,i.UNKNOWN_ERROR_MESSAGE=wt,i.UserService=Ek,i.VERSION_REDUCER_KEY=Ft,i.VerificationCodeType=Pb,i.WorkflowReviewType=fc,i.WorkflowService=Vk,i.WorkflowStepAssigneeService=Wk,i.WorkflowStepCommentAttachmentService=Bk,i.WorkflowStepCommentService=zk,i.WorkflowStepCompletionService=qk,i.WorkflowStepEventService=Ck,i.WorkflowStepEventType=Sc,i.WorkflowStepFieldValuesAttachmentService=jk,i.WorkflowStepFieldValuesService=Dk,i.WorkflowStepFieldsAttachmentService=$k,i.WorkflowStepFieldsService=Uk,i.WorkflowStepReviewRequestService=Nk,i.WorkflowStepReviewService=Hk,i.WorkflowStepReviewerService=Lk,i.WorkflowStepService=Gk,i.WorkflowTypeService=Kk,i._setLatestRetryTime=CT,i.addAsset=xl,i.addAssetAttachment=Cc,i.addAssetAttachments=gs,i.addAssetProcedure=hd,i.addAssetProcedureStep=$l,i.addAssetProcedureStepFieldValues=gl,i.addAssetProcedureStepFieldValuesAttachment=hl,i.addAssetProcedureStepFieldValuesAttachments=Ys,i.addAssetProcedureStepFieldValuesMany=bl,i.addAssetProcedureStepFields=xd,i.addAssetProcedureStepFieldsAttachment=jd,i.addAssetProcedureStepFieldsAttachments=Dd,i.addAssetProcedureStepFieldsMany=el,i.addAssetProcedureSteps=Ul,i.addAssetProcedureType=gd,i.addAssetProcedureTypeAttachment=Qc,i.addAssetProcedureTypeAttachments=Xc,i.addAssetProcedureTypeFieldValues=Xr,i.addAssetProcedureTypeFieldValuesAttachment=jr,i.addAssetProcedureTypeFieldValuesAttachments=Ws,i.addAssetProcedureTypeFieldValuesMany=xr,i.addAssetProcedureTypeFields=gr,i.addAssetProcedureTypeFieldsAttachment=ur,i.addAssetProcedureTypeFieldsAttachments=hr,i.addAssetProcedureTypeFieldsMany=br,i.addAssetProcedureTypes=bd,i.addAssetProcedures=js,i.addAssetStage=ko,i.addAssetStageCompletion=po,i.addAssetStageCompletions=mo,i.addAssetStages=vo,i.addAssetType=vh,i.addAssetTypeAttachment=$o,i.addAssetTypeAttachments=di,i.addAssetTypeFieldValues=$u,i.addAssetTypeFieldValuesAttachment=Ru,i.addAssetTypeFieldValuesAttachments=yi,i.addAssetTypeFieldValuesMany=Uu,i.addAssetTypeFields=mu,i.addAssetTypeFieldsAttachment=eu,i.addAssetTypeFieldsAttachments=tu,i.addAssetTypeFieldsMany=yu,i.addAssetTypeIdentifier=th,i.addAssetTypeIdentifierValue=yh,i.addAssetTypeIdentifierValues=fh,i.addAssetTypeIdentifiers=sh,i.addAssetTypeStatus=Lh,i.addAssetTypeStatuses=Nh,i.addAssetTypes=Eh,i.addAssets=ti,i.addCategories=rp,i.addCategory=cp,i.addConversation=Ec,i.addConversations=c_,i.addDocument=Vp,i.addDocumentAttachment=wp,i.addDocumentAttachments=Tp,i.addDocuments=Wp,i.addEmailDomain=Kp,i.addEmailDomains=Yp,i.addForm=oy,i.addFormIdentifier=hm,i.addFormIdentifierValue=bm,i.addFormIdentifierValues=_m,i.addFormIdentifiers=pm,i.addFormRevision=$i,i.addFormRevisionAttachment=Dm,i.addFormRevisionAttachments=$m,i.addFormRevisions=Ui,i.addFormSubmission=Cy,i.addFormSubmissionAttachment=Py,i.addFormSubmissionAttachments=Zi,i.addFormSubmissions=tn,i.addForms=uy,i.addGeoImage=Qy,i.addGeoImages=Xy,i.addIssue=uS,i.addIssueAssociation=mf,i.addIssueAssociations=Yt,i.addIssueAttachment=gf,i.addIssueAttachments=ln,i.addIssueComment=Xf,i.addIssueCommentAttachment=Cf,i.addIssueCommentAttachments=jf,i.addIssueComments=xf,i.addIssueType=pw,i.addIssueTypeAttachment=PS,i.addIssueTypeAttachments=gS,i.addIssueTypeFieldValues=XS,i.addIssueTypeFieldValuesAttachment=bA,i.addIssueTypeFieldValuesAttachments=bn,i.addIssueTypeFieldValuesMany=xS,i.addIssueTypeFields=hA,i.addIssueTypeFieldsAttachment=CS,i.addIssueTypeFieldsAttachments=jS,i.addIssueTypeFieldsMany=pA,i.addIssueTypeIdentifier=jA,i.addIssueTypeIdentifierValue=xA,i.addIssueTypeIdentifierValues=ew,i.addIssueTypeIdentifiers=DA,i.addIssueTypeStatus=_w,i.addIssueTypeStatuses=Rw,i.addIssueTypes=mw,i.addIssueUpdate=Cn,i.addIssueUpdates=jn,i.addIssues=Sn,i.addOrganization=PT,i.addOrganizationAccess=rT,i.addOrganizationAccesses=dT,i.addOrganizations=FT,i.addProject=zO,i.addProjectAccess=UT,i.addProjectAccesses=LT,i.addProjectAttachment=tO,i.addProjectAttachments=sO,i.addProjectFile=SO,i.addProjectFiles=AO,i.addProjects=BO,i.addTeam=dI,i.addTeamMembership=YO,i.addTeamMemberships=ZO,i.addTeams=lI,i.addUser=Hn,i.addUsers=Xw,i.addWorkflow=II,i.addWorkflowStep=_g,i.addWorkflowStepAssignee=BI,i.addWorkflowStepAssignees=ua,i.addWorkflowStepComment=cF,i.addWorkflowStepCommentAttachment=YI,i.addWorkflowStepCommentAttachments=as,i.addWorkflowStepComments=Sa,i.addWorkflowStepCompletion=wF,i.addWorkflowStepCompletions=Ta,i.addWorkflowStepEvent=EF,i.addWorkflowStepEvents=Fa,i.addWorkflowStepFieldValues=iP,i.addWorkflowStepFieldValuesAttachment=NF,i.addWorkflowStepFieldValuesAttachments=_a,i.addWorkflowStepFieldValuesMany=va,i.addWorkflowStepFields=MP,i.addWorkflowStepFieldsAttachment=fP,i.addWorkflowStepFieldsAttachments=Wa,i.addWorkflowStepFieldsMany=kP,i.addWorkflowStepReview=mg,i.addWorkflowStepReviewRequest=tg,i.addWorkflowStepReviewRequests=La,i.addWorkflowStepReviewer=UP,i.addWorkflowStepReviewers=Da,i.addWorkflowStepReviews=Ga,i.addWorkflowSteps=Za,i.addWorkflowType=Dg,i.addWorkflowTypes=$g,i.addWorkflows=da,i.agentsReducer=Bc,i.agentsSlice=Is,i.areArraysEqual=jb,i.assetAttachmentReducer=Yc,i.assetAttachmentSlice=Ps,i.assetProcedureReducer=Ad,i.assetProcedureSlice=Cs,i.assetProcedureStepFieldValuesAttachmentReducer=Il,i.assetProcedureStepFieldValuesAttachmentSlice=Ks,i.assetProcedureStepFieldValuesReducer=zl,i.assetProcedureStepFieldValuesSlice=Qs,i.assetProcedureStepFieldsAttachmentReducer=Jd,i.assetProcedureStepFieldsAttachmentSlice=Ls,i.assetProcedureStepFieldsReducer=ll,i.assetProcedureStepFieldsSlice=Hs,i.assetProcedureStepReducer=Kl,i.assetProcedureStepSlice=Xs,i.assetProcedureTypeAttachmentReducer=ar,i.assetProcedureTypeAttachmentSlice=Rs,i.assetProcedureTypeFieldValuesAttachmentReducer=Hr,i.assetProcedureTypeFieldValuesAttachmentSlice=Vs,i.assetProcedureTypeFieldValuesReducer=cd,i.assetProcedureTypeFieldValuesSlice=qs,i.assetProcedureTypeFieldsAttachmentReducer=wr,i.assetProcedureTypeFieldsAttachmentSlice=ks,i.assetProcedureTypeFieldsReducer=Vr,i.assetProcedureTypeFieldsSlice=Es,i.assetProcedureTypeReducer=Vd,i.assetProcedureTypeSlice=$s,i.assetReducer=oo,i.assetSlice=ei,i.assetStageCompletionReducer=Oo,i.assetStageCompletionSlice=ii,i.assetStageReducer=zo,i.assetStageSlice=ni,i.assetTypeAttachmentReducer=Qo,i.assetTypeAttachmentSlice=ri,i.assetTypeFieldValuesAttachmentReducer=Cu,i.assetTypeFieldValuesAttachmentSlice=mi,i.assetTypeFieldValuesReducer=Xu,i.assetTypeFieldValuesSlice=Ai,i.assetTypeFieldsAttachmentReducer=uu,i.assetTypeFieldsAttachmentSlice=ui,i.assetTypeFieldsReducer=gu,i.assetTypeFieldsSlice=pi,i.assetTypeIdentifierReducer=hh,i.assetTypeIdentifierSlice=wi,i.assetTypeIdentifierValueReducer=bh,i.assetTypeIdentifierValueSlice=Oi,i.assetTypeReducer=Dh,i.assetTypeSlice=Ii,i.assetTypeStatusReducer=ep,i.assetTypeStatusSlice=Pi,i.assetTypeStatusSortFn=bc,i.authReducer=ip,i.authSlice=Lt,i.baseReducer=nM,i.baseReducers=ec,i.blobToBase64=Yb,i.categoryReducer=fp,i.categorySlice=bi,i.clearTokens=N_,i.constructUploadedFilePayloads=Kb,i.createModelAdapter=R,i.createOfflineAction=WT,i.createPayload=E,i.createSelectionAdapter=zb,i.deleteAsset=so,i.deleteAssetAttachment=Lc,i.deleteAssetAttachments=bs,i.deleteAssetProcedure=yd,i.deleteAssetProcedureStep=Hl,i.deleteAssetProcedureStepFieldValues=vl,i.deleteAssetProcedureStepFieldValuesAttachment=Sl,i.deleteAssetProcedureStepFieldValuesAttachments=Zs,i.deleteAssetProcedureStepFieldValuesMany=El,i.deleteAssetProcedureStepFields=al,i.deleteAssetProcedureStepFieldsAttachment=Hd,i.deleteAssetProcedureStepFieldsAttachments=Gd,i.deleteAssetProcedureStepFieldsMany=cl,i.deleteAssetProcedureSteps=Gl,i.deleteAssetProcedureType=Md,i.deleteAssetProcedureTypeAttachment=ir,i.deleteAssetProcedureTypeAttachments=nr,i.deleteAssetProcedureTypeFieldValues=nd,i.deleteAssetProcedureTypeFieldValuesAttachment=Nr,i.deleteAssetProcedureTypeFieldValuesAttachments=Bs,i.deleteAssetProcedureTypeFieldValuesMany=ad,i.deleteAssetProcedureTypeFields=vr,i.deleteAssetProcedureTypeFieldsAttachment=Sr,i.deleteAssetProcedureTypeFieldsAttachments=Ar,i.deleteAssetProcedureTypeFieldsMany=Er,i.deleteAssetProcedureTypes=kd,i.deleteAssetProcedures=Ds,i.deleteAssetStage=Wo,i.deleteAssetStageCompletion=wo,i.deleteAssetStageCompletions=To,i.deleteAssetStages=Bo,i.deleteAssetType=Bh,i.deleteAssetTypeAttachment=Go,i.deleteAssetTypeAttachments=li,i.deleteAssetTypeFieldValues=Ku,i.deleteAssetTypeFieldValuesAttachment=Vu,i.deleteAssetTypeFieldValuesAttachments=fi,i.deleteAssetTypeFieldValuesMany=Yu,i.deleteAssetTypeFields=Tu,i.deleteAssetTypeFieldsAttachment=cu,i.deleteAssetTypeFieldsAttachments=ru,i.deleteAssetTypeFieldsMany=Ou,i.deleteAssetTypeIdentifier=rh,i.deleteAssetTypeIdentifierValue=Oh,i.deleteAssetTypeIdentifierValues=Ih,i.deleteAssetTypeIdentifiers=dh,i.deleteAssetTypeStatus=Zh,i.deleteAssetTypeStatuses=Jh,i.deleteAssetTypes=zh,i.deleteAssets=si,i.deleteCategories=pp,i.deleteCategory=hp,i.deleteConversation=l_,i.deleteConversations=o_,i.deleteDocument=jp,i.deleteDocumentAttachment=gp,i.deleteDocumentAttachments=bp,i.deleteDocuments=Dp,i.deleteEmailDomain=xp,i.deleteEmailDomains=em,i.deleteForm=fy,i.deleteFormIdentifier=Am,i.deleteFormIdentifierValue=Em,i.deleteFormIdentifierValues=Vm,i.deleteFormIdentifiers=wm,i.deleteFormRevision=Li,i.deleteFormRevisionAttachment=Gm,i.deleteFormRevisionAttachments=Km,i.deleteFormRevisions=Ni,i.deleteFormSubmission=$y,i.deleteFormSubmissionAttachment=My,i.deleteFormSubmissionAttachments=Ji,i.deleteFormSubmissions=sn,i.deleteForms=Sy,i.deleteGeoImage=tf,i.deleteGeoImages=sf,i.deleteIssue=fS,i.deleteIssueAssociation=yf,i.deleteIssueAssociations=Zt,i.deleteIssueAttachment=kf,i.deleteIssueAttachments=on,i.deleteIssueComment=nS,i.deleteIssueCommentAttachment=Nf,i.deleteIssueCommentAttachments=Hf,i.deleteIssueComments=aS,i.deleteIssueType=ww,i.deleteIssueTypeAttachment=kS,i.deleteIssueTypeAttachments=vS,i.deleteIssueTypeFieldValues=nA,i.deleteIssueTypeFieldValuesAttachment=vA,i.deleteIssueTypeFieldValuesAttachments=_n,i.deleteIssueTypeFieldValuesMany=aA,i.deleteIssueTypeFields=AA,i.deleteIssueTypeFieldsAttachment=NS,i.deleteIssueTypeFieldsAttachments=HS,i.deleteIssueTypeFieldsMany=wA,i.deleteIssueTypeIdentifier=HA,i.deleteIssueTypeIdentifierValue=aw,i.deleteIssueTypeIdentifierValues=cw,i.deleteIssueTypeIdentifiers=GA,i.deleteIssueTypeStatus=Vw,i.deleteIssueTypeStatuses=Ww,i.deleteIssueTypes=Tw,i.deleteIssueUpdate=Dn,i.deleteIssueUpdates=$n,i.deleteIssues=An,i.deleteOrganization=_T,i.deleteOrganizationAccess=pT,i.deleteOrganizationAccesses=mT,i.deleteOrganizations=RT,i.deleteProject=jO,i.deleteProjectAccess=YT,i.deleteProjectAccesses=ZT,i.deleteProjectAttachment=rO,i.deleteProjectAttachments=dO,i.deleteProjectFile=OO,i.deleteProjectFiles=IO,i.deleteProjects=DO,i.deleteTeam=mI,i.deleteTeamMembership=eI,i.deleteTeamMemberships=tI,i.deleteTeams=yI,i.deleteUser=Gn,i.deleteUsers=tT,i.deleteWorkflow=_I,i.deleteWorkflowStep=Eg,i.deleteWorkflowStepAssignee=DI,i.deleteWorkflowStepAssignees=ha,i.deleteWorkflowStepComment=uF,i.deleteWorkflowStepCommentAttachment=xI,i.deleteWorkflowStepCommentAttachments=cs,i.deleteWorkflowStepComments=Aa,i.deleteWorkflowStepCompletion=PF,i.deleteWorkflowStepCompletions=Oa,i.deleteWorkflowStepEvent=qF,i.deleteWorkflowStepEvents=Pa,i.deleteWorkflowStepFieldValues=dP,i.deleteWorkflowStepFieldValuesAttachment=ZF,i.deleteWorkflowStepFieldValuesAttachments=Ra,i.deleteWorkflowStepFieldValuesMany=Ea,i.deleteWorkflowStepFields=BP,i.deleteWorkflowStepFieldsAttachment=OP,i.deleteWorkflowStepFieldsAttachments=Ba,i.deleteWorkflowStepFieldsMany=zP,i.deleteWorkflowStepReview=wg,i.deleteWorkflowStepReviewRequest=cg,i.deleteWorkflowStepReviewRequests=Na,i.deleteWorkflowStepReviewer=KP,i.deleteWorkflowStepReviewers=$a,i.deleteWorkflowStepReviews=Ka,i.deleteWorkflowSteps=Ja,i.deleteWorkflowType=Gg,i.deleteWorkflowTypes=Kg,i.deleteWorkflows=la,i.dequeue=ob,i.discard=hb,i.documentAttachmentReducer=kp,i.documentAttachmentSlice=Mi,i.documentSlice=vi,i.documentsReducer=$p,i.downloadFile=Zb,i.downloadInMemoryFile=Gb,i.emailDomainsReducer=nm,i.emailDomainsSlice=Vi,i.emailRegex=s_,i.enqueue=lb,i.enqueueRequest=zT,i.extractResponseFromError=mb,i.fallbackToEmptyArray=w,i.fallbackToEmptyObject=Vt,i.fileReducer=lm,i.fileSlice=Bi,i.fileToBlob=Oc,i.formIdentifierReducer=Fm,i.formIdentifierSlice=zi,i.formIdentifierValueReducer=qm,i.formIdentifierValueSlice=Ci,i.formReducer=Ay,i.formRevisionAttachmentReducer=Qm,i.formRevisionAttachmentSlice=ji,i.formRevisionReducer=ry,i.formRevisionsSlice=Di,i.formSlice=Gi,i.formSubmissionAttachmentReducer=Vy,i.formSubmissionAttachmentSlice=Yi,i.formSubmissionReducer=Gy,i.formSubmissionSlice=en,i.geoImageReducer=rf,i.geoImageSlice=an,i.getAssetProcedureStepSubTree=gc,i.getAssetProcedureStepTrees=i_,i.getClientSDK=wb,i.getClientStore=It,i.getDocumentSubTree=Mc,i.getDocumentTrees=n_,i.getFileIdentifier=Hb,i.getFileS3Key=Ts,i.getLocalDateString=wc,i.getLocalRelativeDateString=Lb,i.getOutboxCoordinator=ft,i.getRenamedFile=Tc,i.getRequestDescription=T,i.hashFile=At,i.initSDK=Zk,i.initializeAssetAttachments=qc,i.initializeAssetProcedureStepFieldValues=Pl,i.initializeAssetProcedureStepFieldValuesAttachments=ul,i.initializeAssetProcedureStepFields=Xd,i.initializeAssetProcedureStepFieldsAttachments=Cd,i.initializeAssetProcedureSteps=Cl,i.initializeAssetProcedureTypeAttachments=Jc,i.initializeAssetProcedureTypeFieldValues=Qr,i.initializeAssetProcedureTypeFieldValuesAttachments=Cr,i.initializeAssetProcedureTypeFields=Pr,i.initializeAssetProcedureTypeFieldsAttachments=or,i.initializeAssetProcedureTypes=Pd,i.initializeAssetProcedures=ud,i.initializeAssetStageCompletions=ho,i.initializeAssetStages=_o,i.initializeAssetTypeAttachments=Do,i.initializeAssetTypeFieldValues=Du,i.initializeAssetTypeFieldValuesAttachments=_u,i.initializeAssetTypeFields=pu,i.initializeAssetTypeFieldsAttachments=xo,i.initializeAssetTypeIdentifierValues=mh,i.initializeAssetTypeIdentifiers=eh,i.initializeAssetTypeStatuses=Uh,i.initializeAssetTypes=Rh,i.initializeAssets=Xl,i.initializeCategories=ap,i.initializeConversations=vc,i.initializeDocumentAttachments=Ap,i.initializeDocuments=Ep,i.initializeEmailDomains=Gp,i.initializeFormIdentifierValues=gm,i.initializeFormIdentifiers=um,i.initializeFormRevisionAttachments=jm,i.initializeFormRevisions=xm,i.initializeFormSubmissionAttachments=Fy,i.initializeFormSubmissions=By,i.initializeForms=ly,i.initializeGeoImages=Yy,i.initializeIssueAssociations=lf,i.initializeIssueAttachments=Pf,i.initializeIssueCommentAttachments=qf,i.initializeIssueComments=Qf,i.initializeIssueTypeAttachments=FS,i.initializeIssueTypeFieldValues=QS,i.initializeIssueTypeFieldValuesAttachments=gA,i.initializeIssueTypeFields=uA,i.initializeIssueTypeFieldsAttachments=qS,i.initializeIssueTypeIdentifierValues=XA,i.initializeIssueTypeIdentifiers=CA,i.initializeIssueTypeStatuses=bw,i.initializeIssueTypes=hw,i.initializeIssueUpdates=jw,i.initializeIssues=oS,i.initializeOrganizationAccesses=cT,i.initializeOrganizations=TT,i.initializeProjectAccesses=$T,i.initializeProjectAttachments=eO,i.initializeProjectFiles=mO,i.initializeProjects=EO,i.initializeTeamMemberships=KO,i.initializeTeams=rI,i.initializeUsers=Zw,i.initializeWorkflowStepAssignees=WI,i.initializeWorkflowStepCommentAttachments=KI,i.initializeWorkflowStepComments=aF,i.initializeWorkflowStepCompletions=AF,i.initializeWorkflowStepEvents=vF,i.initializeWorkflowStepFieldValues=sP,i.initializeWorkflowStepFieldValuesAttachments=LF,i.initializeWorkflowStepFields=RP,i.initializeWorkflowStepFieldsAttachments=yP,i.initializeWorkflowStepReviewRequests=eg,i.initializeWorkflowStepReviewers=$P,i.initializeWorkflowStepReviews=pg,i.initializeWorkflowSteps=bg,i.initializeWorkflowTypes=jg,i.initializeWorkflows=OI,i.isToday=Ub,i.issueAssociationReducer=If,i.issueAssociationSlice=rn,i.issueAttachmentReducer=Bf,i.issueAttachmentSlice=dn,i.issueCommentAttachmentReducer=Zf,i.issueCommentAttachmentSlice=hn,i.issueCommentReducer=dS,i.issueCommentSlice=mn,i.issueReducer=OS,i.issueSlice=fn,i.issueTypeAttachmentReducer=BS,i.issueTypeAttachmentSlice=wn,i.issueTypeFieldValuesAttachmentReducer=zA,i.issueTypeFieldValuesAttachmentSlice=gn,i.issueTypeFieldValuesReducer=lA,i.issueTypeFieldValuesSlice=Fn,i.issueTypeFieldsAttachmentReducer=ZS,i.issueTypeFieldsAttachmentSlice=On,i.issueTypeFieldsReducer=FA,i.issueTypeFieldsSlice=Pn,i.issueTypeIdentifierReducer=JA,i.issueTypeIdentifierSlice=Mn,i.issueTypeIdentifierValueReducer=ow,i.issueTypeIdentifierValueSlice=vn,i.issueTypeReducer=Pw,i.issueTypeSlice=En,i.issueTypeStatusReducer=qw,i.issueTypeStatusSlice=Wn,i.issueTypeStatusSortFn=_c,i.issueUpdateReducer=Kw,i.issueUpdateSlice=qn,i.logOnlyOnce=Jb,i.markAsDeleted=qT,i.markForDeletion=bR,i.memoize=As,i.organizationAccessReducer=yT,i.organizationAccessSlice=Yn,i.organizationReducer=VT,i.organizationSlice=Zn,i.outboxReducer=jT,i.outboxSlice=Jn,i.overmapEnhancer=pM,i.overmapReducer=aM,i.overmapReducers=eb,i.performRequest=ac,i.performRequestFromAction=ub,i.projectAccessReducer=JT,i.projectAccessSlice=Qn,i.projectAttachmentReducer=hO,i.projectAttachmentSlice=xn,i.projectFileReducer=kO,i.projectFileSlice=ta,i.projectReducer=$O,i.projectSlice=sa,i.rehydratedReducer=HO,i.rehydratedSlice=ia,i.restructureSelectorWithArgs=A,i.runMiddleware=Fb,i.saveActiveProjectFileBounds=gO,i.selectAccessToken=H_,i.selectAccessesByUserOfProject=RR,i.selectAccessibleProjects=VR,i.selectActiveOrganizationAccess=IR,i.selectActiveProjectFileId=vR,i.selectAllDocumentAttachments=ki,i.selectAssetAttachmentById=Hc,i.selectAssetAttachmentMapping=Nc,i.selectAssetAttachments=_s,i.selectAssetAttachmentsByIds=Gc,i.selectAssetById=ro,i.selectAssetProcedureById=Od,i.selectAssetProcedureStepById=Yl,i.selectAssetProcedureStepFieldValues=Pt,i.selectAssetProcedureStepFieldValuesAttachmentById=wl,i.selectAssetProcedureStepFieldValuesAttachments=Js,i.selectAssetProcedureStepFieldValuesAttachmentsByIds=Tl,i.selectAssetProcedureStepFieldValuesAttachmentsMapping=Al,i.selectAssetProcedureStepFieldValuesById=Wl,i.selectAssetProcedureStepFieldValuesByIds=Bl,i.selectAssetProcedureStepFieldValuesMapping=Vl,i.selectAssetProcedureStepFieldValuesOfAsset=g_,i.selectAssetProcedureStepFieldValuesOfAssetProcedure=b_,i.selectAssetProcedureStepFieldValuesOfAssetProcedureStep=__,i.selectAssetProcedureStepFields=Ct,i.selectAssetProcedureStepFieldsAttachmentById=Yd,i.selectAssetProcedureStepFieldsAttachments=Ns,i.selectAssetProcedureStepFieldsAttachmentsByIds=Zd,i.selectAssetProcedureStepFieldsAttachmentsMapping=Kd,i.selectAssetProcedureStepFieldsById=rl,i.selectAssetProcedureStepFieldsByIds=dl,i.selectAssetProcedureStepFieldsMapping=Gs,i.selectAssetProcedureStepFieldsOfAssetProcedureStep=I_,i.selectAssetProcedureStepMapping=jt,i.selectAssetProcedureSteps=xs,i.selectAssetProcedureStepsByIds=Zl,i.selectAssetProcedureStepsMappingOfAssetProcedureType=R_,i.selectAssetProcedureStepsOfAssetProcedureType=M_,i.selectAssetProcedureTypeAttachmentById=rr,i.selectAssetProcedureTypeAttachmentMapping=cr,i.selectAssetProcedureTypeAttachments=Ms,i.selectAssetProcedureTypeAttachmentsByIds=dr,i.selectAssetProcedureTypeById=Bd,i.selectAssetProcedureTypeFieldValues=zt,i.selectAssetProcedureTypeFieldValuesAttachmentById=Kr,i.selectAssetProcedureTypeFieldValuesAttachments=zs,i.selectAssetProcedureTypeFieldValuesAttachmentsByIds=Yr,i.selectAssetProcedureTypeFieldValuesAttachmentsMapping=Gr,i.selectAssetProcedureTypeFieldValuesById=dd,i.selectAssetProcedureTypeFieldValuesByIds=ld,i.selectAssetProcedureTypeFieldValuesMapping=rd,i.selectAssetProcedureTypeFieldValuesOfAsset=S_,i.selectAssetProcedureTypeFields=Bt,i.selectAssetProcedureTypeFieldsAttachmentById=Or,i.selectAssetProcedureTypeFieldsAttachments=vs,i.selectAssetProcedureTypeFieldsAttachmentsByIds=Ir,i.selectAssetProcedureTypeFieldsAttachmentsMapping=Tr,i.selectAssetProcedureTypeFieldsById=Br,i.selectAssetProcedureTypeFieldsByIds=zr,i.selectAssetProcedureTypeFieldsMapping=Wr,i.selectAssetProcedureTypeFieldsOfAssetProcedureType=y_,i.selectAssetProcedureTypes=Us,i.selectAssetProcedureTypesByIds=zd,i.selectAssetProcedureTypesMapping=Wd,i.selectAssetProcedureTypesOfOrganization=T_,i.selectAssetProcedures=qt,i.selectAssetProceduresByIds=Id,i.selectAssetProceduresMapping=wd,i.selectAssetProceduresOfAssetProcedureType=Td,i.selectAssetProceduresOfAssetType=w_,i.selectAssetStageById=qo,i.selectAssetStageCompletionById=Po,i.selectAssetStageCompletionMapping=Io,i.selectAssetStageCompletions=Fo,i.selectAssetStageCompletionsByIds=go,i.selectAssetStages=ci,i.selectAssetStagesByIds=Co,i.selectAssetStagesMappingOfAssetProcedureType=v_,i.selectAssetStagesOfAssetProcedureType=E_,i.selectAssetTypeAttachmentById=Yo,i.selectAssetTypeAttachmentMapping=Ko,i.selectAssetTypeAttachments=oi,i.selectAssetTypeAttachmentsByIds=Zo,i.selectAssetTypeById=Ch,i.selectAssetTypeFieldValues=$t,i.selectAssetTypeFieldValuesAttachmentById=Bu,i.selectAssetTypeFieldValuesAttachments=Si,i.selectAssetTypeFieldValuesAttachmentsByIds=zu,i.selectAssetTypeFieldValuesAttachmentsMapping=Wu,i.selectAssetTypeFieldValuesById=Ju,i.selectAssetTypeFieldValuesByIds=Qu,i.selectAssetTypeFieldValuesMapping=Zu,i.selectAssetTypeFieldValuesOfAsset=z_,i.selectAssetTypeFields=gt,i.selectAssetTypeFieldsAttachmentById=lu,i.selectAssetTypeFieldsAttachments=hi,i.selectAssetTypeFieldsAttachmentsByIds=ou,i.selectAssetTypeFieldsAttachmentsMapping=du,i.selectAssetTypeFieldsById=Fu,i.selectAssetTypeFieldsByIds=Pu,i.selectAssetTypeFieldsMapping=Iu,i.selectAssetTypeFieldsOfAssetType=W_,i.selectAssetTypeIdentifierById=oh,i.selectAssetTypeIdentifierMapping=lh,i.selectAssetTypeIdentifierValueById=Ph,i.selectAssetTypeIdentifierValueMapping=Fh,i.selectAssetTypeIdentifierValues=Ut,i.selectAssetTypeIdentifierValuesByIds=gh,i.selectAssetTypeIdentifierValuesOfAsset=j_,i.selectAssetTypeIdentifierValuesOfIdentifier=D_,i.selectAssetTypeIdentifiers=Ti,i.selectAssetTypeIdentifiersByIds=uh,i.selectAssetTypeIdentifiersOfAssetType=C_,i.selectAssetTypeStatusById=Xh,i.selectAssetTypeStatusMapping=Qh,i.selectAssetTypeStatuses=gi,i.selectAssetTypeStatusesByIds=xh,i.selectAssetTypeStatusesOfAssetType=U_,i.selectAssetTypeValuesOfAssetType=q_,i.selectAssetTypes=Fi,i.selectAssetTypesByIds=jh,i.selectAssetTypesMapping=qh,i.selectAssetTypesOfOrganization=$_,i.selectAssets=Dt,i.selectAssetsByIds=lo,i.selectAssetsMapping=ao,i.selectAssetsOfAssetType=co,i.selectAssetsOfProject=k_,i.selectAttachmentsOfAsset=Kc,i.selectAttachmentsOfAssetProcedureStepFieldValues=Ol,i.selectAttachmentsOfAssetProcedureStepFields=O_,i.selectAttachmentsOfAssetProcedureType=p_,i.selectAttachmentsOfAssetProcedureTypeFieldValues=Zr,i.selectAttachmentsOfAssetProcedureTypeFields=m_,i.selectAttachmentsOfAssetType=Jo,i.selectAttachmentsOfAssetTypeFieldValues=qu,i.selectAttachmentsOfAssetTypeFields=V_,i.selectAttachmentsOfDocument=Y_,i.selectAttachmentsOfFormRevision=sR,i.selectAttachmentsOfFormSubmission=Ey,i.selectAttachmentsOfIssue=Ef,i.selectAttachmentsOfIssueComment=cR,i.selectAttachmentsOfIssueType=lR,i.selectAttachmentsOfIssueTypeFieldValues=BA,i.selectAttachmentsOfIssueTypeFields=oR,i.selectAttachmentsOfProject=kR,i.selectAttachmentsOfWorkflowStepComment=ya,i.selectAttachmentsOfWorkflowStepFieldValues=xF,i.selectAttachmentsOfWorkflowStepFields=FP,i.selectCategories=_i,i.selectCategoriesByIds=yp,i.selectCategoriesOfProject=K_,i.selectCategoryById=Ri,i.selectCategoryMapping=mp,i.selectCommentsOfIssue=rR,i.selectCommentsOfWorkflow=yF,i.selectCommentsOfWorkflowStep=NR,i.selectConversation=h_,i.selectConversationMapping=Fs,i.selectConversations=u_,i.selectCurrentUser=iT,i.selectDeletedRequests=PR,i.selectDescendantsOfAssetProcedureStep=Jl,i.selectDescendantsOfDocument=Np,i.selectDocumentAttachmentById=Rp,i.selectDocumentAttachmentMapping=_p,i.selectDocumentAttachmentsByIds=Mp,i.selectDocumentById=Up,i.selectDocuments=Nt,i.selectDocumentsByIds=Lp,i.selectDocumentsMapping=Ei,i.selectEmailDomainById=sm,i.selectEmailDomains=Wi,i.selectEmailDomainsAsMapping=tm,i.selectEmailDomainsByIds=im,i.selectEmailDomainsOfOrganization=Q_,i.selectFieldValuesOfAssetProcedure=A_,i.selectFormById=Ty,i.selectFormIdentifierById=Om,i.selectFormIdentifierMapping=Tm,i.selectFormIdentifierValueById=Bm,i.selectFormIdentifierValueMapping=Wm,i.selectFormIdentifierValues=Ht,i.selectFormIdentifierValuesByIds=zm,i.selectFormIdentifierValuesOfFormSubmission=eR,i.selectFormIdentifierValuesOfIdentifier=tR,i.selectFormIdentifiers=qi,i.selectFormIdentifiersByIds=Im,i.selectFormIdentifiersOfForm=x_,i.selectFormMapping=wy,i.selectFormRevisionAttachmentById=Zm,i.selectFormRevisionAttachments=Ym,i.selectFormRevisionAttachmentsByIds=Jm,i.selectFormRevisionAttachmentsMapping=Gt,i.selectFormRevisionById=ny,i.selectFormRevisionMapping=Hi,i.selectFormRevisions=Kt,i.selectFormRevisionsByIds=ay,i.selectFormRevisionsOfForm=cy,i.selectFormSubmissionAttachemntsByIds=xi,i.selectFormSubmissionAttachmentById=ky,i.selectFormSubmissionAttachments=Xi,i.selectFormSubmissionAttachmentsByIds=vy,i.selectFormSubmissionAttachmentsMapping=Qi,i.selectFormSubmissionById=Ly,i.selectFormSubmissions=Uy,i.selectFormSubmissionsByIds=Ny,i.selectFormSubmissionsMapping=nn,i.selectFormSubmissionsOfForm=Hy,i.selectForms=Ki,i.selectFormsByIds=Oy,i.selectFormsOfOrganization=nR,i.selectGeoImageById=af,i.selectGeoImageMapping=nf,i.selectGeoImages=cn,i.selectGeoImagesByIds=cf,i.selectGeoImagesOfProject=aR,i.selectIsImportingProjectFile=ER,i.selectIsLoggedIn=G_,i.selectIssueAssociationById=Sf,i.selectIssueAssociationMapping=bt,i.selectIssueAssociations=ff,i.selectIssueAssociationsByIds=Af,i.selectIssueAssociationsOfAsset=Of,i.selectIssueAssociationsOfIssue=Tf,i.selectIssueAssociationsToIssue=wf,i.selectIssueAttachmentById=Vf,i.selectIssueAttachmentMapping=vf,i.selectIssueAttachments=un,i.selectIssueAttachmentsByIds=Wf,i.selectIssueById=AS,i.selectIssueCommentAttachmentById=Kf,i.selectIssueCommentAttachmentMapping=Gf,i.selectIssueCommentAttachments=pn,i.selectIssueCommentAttachmentsByIds=Yf,i.selectIssueCommentById=cS,i.selectIssueCommentMapping=yn,i.selectIssueCommentsByIds=rS,i.selectIssueMapping=SS,i.selectIssueTypeAttachmentById=VS,i.selectIssueTypeAttachmentMapping=ES,i.selectIssueTypeAttachments=Tn,i.selectIssueTypeAttachmentsByIds=WS,i.selectIssueTypeById=Iw,i.selectIssueTypeFieldValues=Qt,i.selectIssueTypeFieldValuesAttachmentById=VA,i.selectIssueTypeFieldValuesAttachments=Rn,i.selectIssueTypeFieldValuesAttachmentsByIds=WA,i.selectIssueTypeFieldValuesAttachmentsMapping=EA,i.selectIssueTypeFieldValuesById=rA,i.selectIssueTypeFieldValuesByIds=dA,i.selectIssueTypeFieldValuesMapping=cA,i.selectIssueTypeFieldValuesOfIssue=uR,i.selectIssueTypeFields=_t,i.selectIssueTypeFieldsAttachmentById=KS,i.selectIssueTypeFieldsAttachments=In,i.selectIssueTypeFieldsAttachmentsByIds=YS,i.selectIssueTypeFieldsAttachmentsMapping=GS,i.selectIssueTypeFieldsById=OA,i.selectIssueTypeFieldsByIds=IA,i.selectIssueTypeFieldsMapping=TA,i.selectIssueTypeFieldsOfIssueType=hR,i.selectIssueTypeIdentifierById=YA,i.selectIssueTypeIdentifierMapping=KA,i.selectIssueTypeIdentifierValueById=dw,i.selectIssueTypeIdentifierValueMapping=rw,i.selectIssueTypeIdentifierValues=Xt,i.selectIssueTypeIdentifierValuesByIds=lw,i.selectIssueTypeIdentifierValuesOfIdentifier=SR,i.selectIssueTypeIdentifierValuesOfIssue=fR,i.selectIssueTypeIdentifiers=kn,i.selectIssueTypeIdentifiersByIds=ZA,i.selectIssueTypeIdentifiersOfIssueType=yR,i.selectIssueTypeMapping=Ow,i.selectIssueTypeStatusById=zn,i.selectIssueTypeStatusMapping=Bw,i.selectIssueTypeStatuses=Bn,i.selectIssueTypeStatusesByIds=zw,i.selectIssueTypeStatusesOfIssueType=wR,i.selectIssueTypeValuesOfIssueType=mR,i.selectIssueTypes=Vn,i.selectIssueTypesByIds=Fw,i.selectIssueTypesOfOrganization=AR,i.selectIssueUpdateById=Nw,i.selectIssueUpdateMapping=Un,i.selectIssueUpdates=Ln,i.selectIssueUpdatesByIds=Hw,i.selectIssueUpdatesOfIssue=Gw,i.selectIssues=Jt,i.selectIssuesByIds=wS,i.selectIssuesOfIssueType=TS,i.selectIssuesOfProject=dR,i.selectLatestAssetProcedureStepFieldsOfAssetProcedureStep=F_,i.selectLatestAssetProcedureTypeFieldsOfAssetProcedureType=f_,i.selectLatestAssetTypeFieldsOfAssetType=B_,i.selectLatestFieldsByAssetProcedureStep=P_,i.selectLatestFieldsByWorkflowStep=QR,i.selectLatestFormRevisionOfForm=iR,i.selectLatestIssueTypeFieldsOfIssueType=pR,i.selectLatestRetryTime=gR,i.selectLatestWorkflowStepFieldsOfWorkflowStep=JR,i.selectMembershipsByUserOfTeam=CR,i.selectOrganizationAccessById=fT,i.selectOrganizationAccessMapping=ts,i.selectOrganizationAccessUserMapping=AT,i.selectOrganizationAccessesByIds=ST,i.selectOrganizationById=vT,i.selectOrganizationDocuments=J_,i.selectOrganizations=kT,i.selectOrganizationsByIds=ET,i.selectOrganizationsMapping=MT,i.selectProjectAccessById=QT,i.selectProjectAccessMapping=Xn,i.selectProjectAccesses=Rt,i.selectProjectAccessesByIds=XT,i.selectProjectAccessesOfProject=_R,i.selectProjectAttachmentById=oO,i.selectProjectAttachmentMapping=lO,i.selectProjectAttachments=ea,i.selectProjectAttachmentsByIds=uO,i.selectProjectById=LO,i.selectProjectDocuments=Z_,i.selectProjectFileById=RO,i.selectProjectFileMapping=bO,i.selectProjectFiles=_O,i.selectProjectFilesByIds=MO,i.selectProjectMapping=UO,i.selectProjects=ss,i.selectProjectsByIds=NO,i.selectProjectsOfOrganization=WR,i.selectRehydrated=qR,i.selectStageMapping=ai,i.selectTeamById=SI,i.selectTeamMembershipById=nI,i.selectTeamMemberships=is,i.selectTeamMembershipsByIds=aI,i.selectTeamMembershipsMapping=iI,i.selectTeams=ca,i.selectTeamsByIds=AI,i.selectTeamsMapping=fI,i.selectTeamsOfOrganization=DR,i.selectUploadUrl=dm,i.selectUserById=es,i.selectUsers=xt,i.selectUsersByIds=nT,i.selectUsersMapping=Kn,i.selectUsersOfOrganization=FR,i.selectUsersOfProject=MR,i.selectUsersOfTeam=jR,i.selectWorkflowById=MI,i.selectWorkflowMapping=RI,i.selectWorkflowStepAssigneeById=UI,i.selectWorkflowStepAssigneeMapping=$I,i.selectWorkflowStepAssignees=Mt,i.selectWorkflowStepAssigneesByIds=LI,i.selectWorkflowStepAssigneesOfUser=LR,i.selectWorkflowStepAssigneesOfWorkflow=NI,i.selectWorkflowStepAssigneesOfWorkflowStep=UR,i.selectWorkflowStepById=Bg,i.selectWorkflowStepCommentAttachmentById=tF,i.selectWorkflowStepCommentAttachmentMapping=eF,i.selectWorkflowStepCommentAttachments=ma,i.selectWorkflowStepCommentAttachmentsByIds=sF,i.selectWorkflowStepCommentById=pF,i.selectWorkflowStepCommentMapping=hF,i.selectWorkflowStepComments=rs,i.selectWorkflowStepCommentsByIds=mF,i.selectWorkflowStepCompletionById=bF,i.selectWorkflowStepCompletionMapping=gF,i.selectWorkflowStepCompletions=ds,i.selectWorkflowStepCompletionsByIds=_F,i.selectWorkflowStepCompletionsOfWorkflow=RF,i.selectWorkflowStepCompletionsOfWorkflowStep=HR,i.selectWorkflowStepEventById=CF,i.selectWorkflowStepEventMapping=ga,i.selectWorkflowStepEvents=ls,i.selectWorkflowStepEventsByIds=jF,i.selectWorkflowStepEventsOfWorkflow=DF,i.selectWorkflowStepEventsOfWorkflowStep=GR,i.selectWorkflowStepFieldValues=kt,i.selectWorkflowStepFieldValuesAttachmentById=QF,i.selectWorkflowStepFieldValuesAttachments=Ma,i.selectWorkflowStepFieldValuesAttachmentsByIds=XF,i.selectWorkflowStepFieldValuesAttachmentsMapping=JF,i.selectWorkflowStepFieldValuesById=uP,i.selectWorkflowStepFieldValuesByIds=hP,i.selectWorkflowStepFieldValuesMapping=lP,i.selectWorkflowStepFieldValuesOfFieldsRevision=YR,i.selectWorkflowStepFieldValuesOfWorkflow=oP,i.selectWorkflowStepFieldValuesOfWorkflowStep=KR,i.selectWorkflowStepFields=os,i.selectWorkflowStepFieldsAttachmentById=PP,i.selectWorkflowStepFieldsAttachments=za,i.selectWorkflowStepFieldsAttachmentsByIds=gP,i.selectWorkflowStepFieldsAttachmentsMapping=IP,i.selectWorkflowStepFieldsById=qP,i.selectWorkflowStepFieldsByIds=CP,i.selectWorkflowStepFieldsMapping=Ca,i.selectWorkflowStepFieldsOfWorkflowStep=ZR,i.selectWorkflowStepMapping=Wg,i.selectWorkflowStepReviewById=Og,i.selectWorkflowStepReviewMapping=Tg,i.selectWorkflowStepReviewRequestById=dg,i.selectWorkflowStepReviewRequestMapping=rg,i.selectWorkflowStepReviewRequests=us,i.selectWorkflowStepReviewRequestsByIds=lg,i.selectWorkflowStepReviewRequestsOfWorkflow=og,i.selectWorkflowStepReviewRequestsOfWorkflowStep=eM,i.selectWorkflowStepReviewerById=ZP,i.selectWorkflowStepReviewerMapping=YP,i.selectWorkflowStepReviewers=vt,i.selectWorkflowStepReviewersByIds=JP,i.selectWorkflowStepReviewersOfUser=xR,i.selectWorkflowStepReviewersOfWorkflow=QP,i.selectWorkflowStepReviewersOfWorkflowStep=XR,i.selectWorkflowStepReviews=hs,i.selectWorkflowStepReviewsByIds=Ig,i.selectWorkflowStepReviewsOfWorkflow=Fg,i.selectWorkflowStepReviewsOfWorkflowStep=tM,i.selectWorkflowSteps=Qa,i.selectWorkflowStepsByIds=qg,i.selectWorkflowStepsOfWorkflowType=zg,i.selectWorkflowTypeById=Zg,i.selectWorkflowTypeMapping=Yg,i.selectWorkflowTypes=xa,i.selectWorkflowTypesByIds=Jg,i.selectWorkflowTypesOfOrganization=sM,i.selectWorkflows=ns,i.selectWorkflowsByIds=kI,i.selectWorkflowsOfProject=$R,i.selectWorkflowsOfWorkflowType=vI,i.setActiveProjectFileId=PO,i.setAsset=io,i.setAssetAttachment=jc,i.setAssetAttachments=Dc,i.setAssetProcedure=fd,i.setAssetProcedureStep=jl,i.setAssetProcedureStepFieldValues=_l,i.setAssetProcedureStepFieldValuesAttachment=pl,i.setAssetProcedureStepFieldValuesAttachments=ml,i.setAssetProcedureStepFieldValuesMany=Rl,i.setAssetProcedureStepFields=tl,i.setAssetProcedureStepFieldsAttachment=$d,i.setAssetProcedureStepFieldsAttachments=Ud,i.setAssetProcedureStepFieldsMany=sl,i.setAssetProcedureSteps=Dl,i.setAssetProcedureType=vd,i.setAssetProcedureTypeAttachment=xc,i.setAssetProcedureTypeAttachments=er,i.setAssetProcedureTypeFieldValues=ed,i.setAssetProcedureTypeFieldValuesAttachment=Dr,i.setAssetProcedureTypeFieldValuesAttachments=$r,i.setAssetProcedureTypeFieldValuesMany=td,i.setAssetProcedureTypeFields=_r,i.setAssetProcedureTypeFieldsAttachment=pr,i.setAssetProcedureTypeFieldsAttachments=mr,i.setAssetProcedureTypeFieldsMany=Rr,i.setAssetProcedureTypes=Ed,i.setAssetProcedures=Sd,i.setAssetStage=Ro,i.setAssetStageCompletion=yo,i.setAssetStageCompletions=fo,i.setAssetStages=Mo,i.setAssetType=Mh,i.setAssetTypeAttachment=Uo,i.setAssetTypeAttachments=Lo,i.setAssetTypeFieldValues=Lu,i.setAssetTypeFieldValuesAttachment=Mu,i.setAssetTypeFieldValuesAttachments=ku,i.setAssetTypeFieldValuesMany=Nu,i.setAssetTypeFields=fu,i.setAssetTypeFieldsAttachment=su,i.setAssetTypeFieldsAttachments=iu,i.setAssetTypeFieldsMany=Su,i.setAssetTypeIdentifier=ih,i.setAssetTypeIdentifierValue=Sh,i.setAssetTypeIdentifierValues=Ah,i.setAssetTypeIdentifiers=nh,i.setAssetTypeStatus=Hh,i.setAssetTypeStatuses=Gh,i.setAssetTypes=kh,i.setAssets=no,i.setCategories=lp,i.setCategory=dp,i.setClientSDK=Ab,i.setClientStore=fb,i.setConversation=Vc,i.setConversations=r_,i.setCurrentUser=TR,i.setDocument=Bp,i.setDocumentAttachment=Op,i.setDocumentAttachments=Ip,i.setDocuments=zp,i.setEmailDomain=Zp,i.setEmailDomains=Jp,i.setForm=hy,i.setFormIdentifier=mm,i.setFormIdentifierValue=Rm,i.setFormIdentifierValues=Mm,i.setFormIdentifiers=ym,i.setFormRevision=ey,i.setFormRevisionAttachment=Um,i.setFormRevisionAttachments=Lm,i.setFormRevisions=ty,i.setFormSubmission=zy,i.setFormSubmissionAttachment=gy,i.setFormSubmissionAttachments=by,i.setFormSubmissions=qy,i.setForms=py,i.setGeoImage=Zy,i.setGeoImages=Jy,i.setIsImportingProjectFile=FO,i.setIssue=hS,i.setIssueAssociation=uf,i.setIssueAssociations=of,i.setIssueAttachment=bf,i.setIssueAttachments=_f,i.setIssueComment=eS,i.setIssueCommentAttachment=Df,i.setIssueCommentAttachments=$f,i.setIssueComments=tS,i.setIssueType=yw,i.setIssueTypeAttachment=bS,i.setIssueTypeAttachments=_S,i.setIssueTypeFieldValues=eA,i.setIssueTypeFieldValuesAttachment=_A,i.setIssueTypeFieldValuesAttachments=RA,i.setIssueTypeFieldValuesMany=tA,i.setIssueTypeFields=mA,i.setIssueTypeFieldsAttachment=DS,i.setIssueTypeFieldsAttachments=$S,i.setIssueTypeFieldsMany=yA,i.setIssueTypeIdentifier=$A,i.setIssueTypeIdentifierValue=tw,i.setIssueTypeIdentifierValues=sw,i.setIssueTypeIdentifiers=UA,i.setIssueTypeStatus=Mw,i.setIssueTypeStatuses=kw,i.setIssueTypes=fw,i.setIssueUpdate=Dw,i.setIssueUpdates=$w,i.setIssues=pS,i.setLoggedIn=sp,i.setOrganization=IT,i.setOrganizationAccess=lT,i.setOrganizationAccesses=oT,i.setOrganizations=OT,i.setProfilePicture=OR,i.setProject=WO,i.setProjectAccess=NT,i.setProjectAccesses=HT,i.setProjectAttachment=iO,i.setProjectAttachments=nO,i.setProjectFile=yO,i.setProjectFiles=fO,i.setProjects=VO,i.setRehydrated=zR,i.setTeam=oI,i.setTeamMembership=JO,i.setTeamMemberships=QO,i.setTeams=uI,i.setTokens=L_,i.setUploadUrl=rm,i.setUser=Qw,i.setUsers=Jw,i.setWorkflow=FI,i.setWorkflowStep=Rg,i.setWorkflowStepAssignee=zI,i.setWorkflowStepAssignees=qI,i.setWorkflowStepComment=rF,i.setWorkflowStepCommentAttachment=ZI,i.setWorkflowStepCommentAttachments=JI,i.setWorkflowStepComments=dF,i.setWorkflowStepCompletion=TF,i.setWorkflowStepCompletions=OF,i.setWorkflowStepEvent=VF,i.setWorkflowStepEvents=WF,i.setWorkflowStepFieldValues=nP,i.setWorkflowStepFieldValuesAttachment=HF,i.setWorkflowStepFieldValuesAttachments=GF,i.setWorkflowStepFieldValuesMany=aP,i.setWorkflowStepFields=vP,i.setWorkflowStepFieldsAttachment=SP,i.setWorkflowStepFieldsAttachments=AP,i.setWorkflowStepFieldsMany=EP,i.setWorkflowStepReview=yg,i.setWorkflowStepReviewRequest=sg,i.setWorkflowStepReviewRequests=ig,i.setWorkflowStepReviewer=LP,i.setWorkflowStepReviewers=NP,i.setWorkflowStepReviews=fg,i.setWorkflowSteps=Mg,i.setWorkflowType=Ug,i.setWorkflowTypes=Lg,i.setWorkflows=PI,i.shallowEqual=Cb,i.slugify=e_,i.spacesToDashesLower=xb,i.teamMembershipReducer=sI,i.teamMembershipSlice=na,i.teamReducer=wI,i.teamSlice=aa,i.toFileNameSafeString=Xb,i.toUuidArray=B,i.toUuidIdRecord=Qb,i.truncate=t_,i.updateAsset=eo,i.updateAssetAttachment=$c,i.updateAssetAttachments=Uc,i.updateAssetProcedure=pd,i.updateAssetProcedureStep=Ll,i.updateAssetProcedureStepFieldValues=Ml,i.updateAssetProcedureStepFieldValuesAttachment=yl,i.updateAssetProcedureStepFieldValuesAttachments=fl,i.updateAssetProcedureStepFieldValuesMany=kl,i.updateAssetProcedureStepFields=il,i.updateAssetProcedureStepFieldsAttachment=Ld,i.updateAssetProcedureStepFieldsAttachments=Nd,i.updateAssetProcedureStepFieldsMany=nl,i.updateAssetProcedureSteps=Nl,i.updateAssetProcedureType=_d,i.updateAssetProcedureTypeAttachment=tr,i.updateAssetProcedureTypeAttachments=sr,i.updateAssetProcedureTypeFieldValues=sd,i.updateAssetProcedureTypeFieldValuesAttachment=Ur,i.updateAssetProcedureTypeFieldValuesAttachments=Lr,i.updateAssetProcedureTypeFieldValuesMany=id,i.updateAssetProcedureTypeFields=Mr,i.updateAssetProcedureTypeFieldsAttachment=yr,i.updateAssetProcedureTypeFieldsAttachments=fr,i.updateAssetProcedureTypeFieldsMany=kr,i.updateAssetProcedureTypes=Rd,i.updateAssetProcedures=md,i.updateAssetStage=Eo,i.updateAssetStageCompletion=So,i.updateAssetStageCompletions=Ao,i.updateAssetStages=Vo,i.updateAssetType=Vh,i.updateAssetTypeAttachment=No,i.updateAssetTypeAttachments=Ho,i.updateAssetTypeFieldValues=Hu,i.updateAssetTypeFieldValuesAttachment=vu,i.updateAssetTypeFieldValuesAttachments=Eu,i.updateAssetTypeFieldValuesMany=Gu,i.updateAssetTypeFields=Au,i.updateAssetTypeFieldsAttachment=nu,i.updateAssetTypeFieldsAttachments=au,i.updateAssetTypeFieldsMany=wu,i.updateAssetTypeIdentifier=ah,i.updateAssetTypeIdentifierValue=wh,i.updateAssetTypeIdentifierValues=Th,i.updateAssetTypeIdentifiers=ch,i.updateAssetTypeStatus=Kh,i.updateAssetTypeStatuses=Yh,i.updateAssetTypes=Wh,i.updateAssets=to,i.updateCategories=up,i.updateCategory=op,i.updateConversation=Wc,i.updateConversations=d_,i.updateDocument=qp,i.updateDocumentAttachment=Fp,i.updateDocumentAttachments=Pp,i.updateDocuments=Cp,i.updateEmailDomain=Qp,i.updateEmailDomains=Xp,i.updateForm=my,i.updateFormIdentifier=fm,i.updateFormIdentifierValue=km,i.updateFormIdentifierValues=vm,i.updateFormIdentifiers=Sm,i.updateFormRevision=sy,i.updateFormRevisionAttachment=Nm,i.updateFormRevisionAttachments=Hm,i.updateFormRevisions=iy,i.updateFormSubmission=jy,i.updateFormSubmissionAttachment=_y,i.updateFormSubmissionAttachments=Ry,i.updateFormSubmissions=Dy,i.updateForms=yy,i.updateGeoImage=xy,i.updateGeoImages=ef,i.updateIssue=mS,i.updateIssueAssociation=hf,i.updateIssueAssociations=pf,i.updateIssueAttachment=Rf,i.updateIssueAttachments=Mf,i.updateIssueComment=sS,i.updateIssueCommentAttachment=Uf,i.updateIssueCommentAttachments=Lf,i.updateIssueComments=iS,i.updateIssueType=Sw,i.updateIssueTypeAttachment=RS,i.updateIssueTypeAttachments=MS,i.updateIssueTypeFieldValues=sA,i.updateIssueTypeFieldValuesAttachment=MA,i.updateIssueTypeFieldValuesAttachments=kA,i.updateIssueTypeFieldValuesMany=iA,i.updateIssueTypeFields=fA,i.updateIssueTypeFieldsAttachment=US,i.updateIssueTypeFieldsAttachments=LS,i.updateIssueTypeFieldsMany=SA,i.updateIssueTypeIdentifier=LA,i.updateIssueTypeIdentifierValue=iw,i.updateIssueTypeIdentifierValues=nw,i.updateIssueTypeIdentifiers=NA,i.updateIssueTypeStatus=vw,i.updateIssueTypeStatuses=Ew,i.updateIssueTypes=Aw,i.updateIssueUpdate=Uw,i.updateIssueUpdates=Lw,i.updateIssues=yS,i.updateOrganization=bT,i.updateOrganizationAccess=uT,i.updateOrganizationAccesses=hT,i.updateOrganizations=gT,i.updateProject=CO,i.updateProjectAccess=GT,i.updateProjectAccesses=KT,i.updateProjectAttachment=aO,i.updateProjectAttachments=cO,i.updateProjectFile=wO,i.updateProjectFiles=TO,i.updateProjects=qO,i.updateTeam=hI,i.updateTeamMembership=XO,i.updateTeamMemberships=xO,i.updateTeams=pI,i.updateUser=eT,i.updateUsers=xw,i.updateWorkflow=gI,i.updateWorkflowStep=kg,i.updateWorkflowStepAssignee=CI,i.updateWorkflowStepAssignees=jI,i.updateWorkflowStepComment=lF,i.updateWorkflowStepCommentAttachment=QI,i.updateWorkflowStepCommentAttachments=XI,i.updateWorkflowStepComments=oF,i.updateWorkflowStepCompletion=IF,i.updateWorkflowStepCompletions=FF,i.updateWorkflowStepEvent=BF,i.updateWorkflowStepEvents=zF,i.updateWorkflowStepFieldValues=cP,i.updateWorkflowStepFieldValuesAttachment=KF,i.updateWorkflowStepFieldValuesAttachments=YF,i.updateWorkflowStepFieldValuesMany=rP,i.updateWorkflowStepFields=VP,i.updateWorkflowStepFieldsAttachment=wP,i.updateWorkflowStepFieldsAttachments=TP,i.updateWorkflowStepFieldsMany=WP,i.updateWorkflowStepReview=Sg,i.updateWorkflowStepReviewRequest=ng,i.updateWorkflowStepReviewRequests=ag,i.updateWorkflowStepReviewer=HP,i.updateWorkflowStepReviewers=GP,i.updateWorkflowStepReviews=Ag,i.updateWorkflowSteps=vg,i.updateWorkflowType=Ng,i.updateWorkflowTypes=Hg,i.updateWorkflows=bI,i.useSelectorBuilder=qb,i.userReducer=sT,i.userSlice=Nn,i.uuidObj=_,i.uuidObjSortFn=Os,i.uuidSortFn=Wt,i.versioningReducer=xg,i.versioningSlice=Xg,i.workflowReducer=EI,i.workflowSlice=ra,i.workflowStepAssigneeReducer=HI,i.workflowStepAssigneeSlice=oa,i.workflowStepCommentAttachmentReducer=iF,i.workflowStepCommentAttachmentSlice=pa,i.workflowStepCommentReducer=fF,i.workflowStepCommentSlice=fa,i.workflowStepCompletionReducer=MF,i.workflowStepCompletionSlice=wa,i.workflowStepEventReducer=$F,i.workflowStepEventSlice=Ia,i.workflowStepFieldValuesAttachmentReducer=eP,i.workflowStepFieldValuesAttachmentSlice=ba,i.workflowStepFieldValuesReducer=pP,i.workflowStepFieldValuesSlice=ka,i.workflowStepFieldsAttachmentReducer=bP,i.workflowStepFieldsAttachmentSlice=Va,i.workflowStepFieldsReducer=jP,i.workflowStepFieldsSlice=qa,i.workflowStepReducer=Vg,i.workflowStepReviewReducer=Pg,i.workflowStepReviewRequestReducer=ug,i.workflowStepReviewRequestSlice=Ua,i.workflowStepReviewSlice=Ha,i.workflowStepReviewerReducer=XP,i.workflowStepReviewerSlice=ja,i.workflowStepSlice=Ya,i.workflowTypeReducer=Qg,i.workflowTypeSlice=Xa,Object.defineProperty(i,Symbol.toStringTag,{value:"Module"})});
|