@overmap-ai/core 1.0.80-implement-issueassignee-service.1 → 1.0.80-implement-issueassignee-service.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/overmap-core.js
CHANGED
|
@@ -10,5 +10,5 @@ Action:`,s);const S=ft();if(!S)throw new Error("Outbox coordinator not set");S.r
|
|
|
10
10
|
REST API, you will be requesting localhost:80 (where this app runs), resulting in a transformed blob
|
|
11
11
|
(with an uuid attached) being returned. Alternatively, you may be running with
|
|
12
12
|
import.meta.env.PROD, which will result in some file requests being treated as
|
|
13
|
-
external URLs and therefore not prepended with VITE_API_URL.`;throw new Error(S)}return await this.cacheFile(p),p}processPresignedUrl(e,n){if("warning"in n){if(n.warning==="already_uploaded")return Promise.resolve(void 0);throw console.error(n.warning),new Error(n.warning)}return this.enqueueRequest({url:n.url,description:"Upload file to S3",method:o.POST,isExternalUrl:!0,isAuthNeeded:!1,attachmentHash:e,blockers:[`s3-${n.fields.key}`],blocks:[e],s3url:n})}processPresignedUrls(e){const n={};for(const[c,r]of Object.entries(e))n[c]=this.processPresignedUrl(c,r);return n}async getFilePayload(e){const c={sha1:await Ct(e),file_type:e.type,extension:Rc(e),size:e.size};return await this.client.files.cacheFile(e),c}async cachePresignedUrl(e,n){if(uc.has(e))return;const c=await this.getDB();!!await c.get("presignedUrls",e)?console.warn(`Attempting to add a presigned url already cached, ${n}`):await c.put("presignedUrls",n,e),uc.add(e)}async uncachePresignedUrl(e){await(await this.getDB()).delete("presignedUrls",e),uc.delete(e)}async getPresignedUrlFromCache(e){const n=await(await this.getDB()).get("presignedUrls",e);if(!n)return;if(Dc(n)){await this.uncachePresignedUrl(e);return}return n}}class VM extends v{constructor(){super(...arguments);h(this,"name","Form Identifier");h(this,"url","/form-identifiers");h(this,"actions",{addOne:Wu,addMany:Ku,setOne:Yu,setMany:Zu,updateOne:Ju,updateMany:Xu,deleteOne:Qu,deleteMany:xu,initialize:Hu});h(this,"selectors",{selectById:tl,selectByIds:sl})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=this.select(m=>{var S;return((S=m.userReducer.currentUser)==null?void 0:S.id)??null}),u=new Date().toISOString(),d=O({...e,created_by:a,submitted_at:u});this.dispatch(n(d));const p=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:R(d),blockers:[d.form],blocks:[d.uuid]});return p.then(m=>{this.dispatch(c(m))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,p]}update(e){const{setOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`Expected form identifier with uuid ${e.uuid} to exist`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Expected form identifier with uuid ${e} to exist`);this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{form__organization:e}},n);return this.dispatch(c(r)),r}}class zM extends v{constructor(){super(...arguments);h(this,"name","Form Identifier Value");h(this,"url","/form-identifier-values");h(this,"actions",{addOne:al,addMany:rl,setOne:dl,setMany:ul,updateOne:ll,updateMany:ol,deleteOne:hl,deleteMany:ml,initialize:cl});h(this,"selectors",{selectById:yl,selectByIds:fl})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=this.select(m=>{var S;return((S=m.userReducer.currentUser)==null?void 0:S.id)??null}),u=new Date().toISOString(),d=O({...e,created_by:a,submitted_at:u});this.dispatch(n(d));const p=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:R(d),blockers:[e.form_submission,e.form_identifier],blocks:[d.uuid]});return p.then(m=>{this.dispatch(c(m))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,p]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Expected form identifier value with uuid ${e} to exist`);this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await Promise.all([this.listPaginated({queryParams:{limit:this.pageSize,paginate:!0,form_submission__organization:e}},n),this.listPaginated({queryParams:{limit:this.pageSize,paginate:!0,form_submission__project__organization:e}},n)])).flatMap(u=>u.flat());return this.dispatch(c(a)),a}}class DM extends j{constructor(){super(...arguments);h(this,"name","Form Revision Attachment");h(this,"url","/form-revision-attachments");h(this,"actions",{addOne:Tl,addMany:Ol,setOne:Pl,setMany:Fl,updateOne:bl,updateMany:gl,deleteOne:_l,deleteMany:Ml,initialize:Il});h(this,"selectors",{selectById:wl,selectByIds:vl})}getId(e){return e.uuid}getBlockers(e){return[e.form_revision]}getBlocks(e){return[e.uuid]}buildModel(e){const n=this.select(r=>{var a;return((a=r.userReducer.currentUser)==null?void 0:a.id)??null}),c=new Date().toISOString();return O({...e,created_by:n,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:c,form_revision:r,file_sha1:a,file_name:u,file_extension:d}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:c,form_revision:r,file_sha1:a,file_name:u,file_extension:d}}buildBulkPayload(e){const{uuid:n,field_identifier:c,form_revision:r,file_sha1:a,file_name:u,file_extension:d}=e;return{uuid:n,field_identifier:c,form_revision:r,file_sha1:a,file_name:u,file_extension:d}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{form_revision__form__organization:e}},n);return this.dispatch(c(r)),r}}class jM extends v{constructor(){super(...arguments);h(this,"name","Form Revision");h(this,"url","/form-revisions");h(this,"actions",{addOne:zl,addMany:ni,setOne:Dl,setMany:jl,updateOne:ql,updateMany:Cl,deleteOne:$l,deleteMany:ci,initialize:Vl});h(this,"selectors",{selectById:Ll,selectByIds:kl})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=this.select(m=>{var S;return((S=m.userReducer.currentUser)==null?void 0:S.id)??null}),u=new Date().toISOString(),d=O({...e,created_by:a,submitted_at:u});this.dispatch(n(d));const p=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:R(d),blockers:[e.form],blocks:[d.uuid]});return p.then(m=>{this.dispatch(c(m))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,p]}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{form__organization:e}},n);return this.dispatch(c(r)),r}}class qM extends v{constructor(){super(...arguments);h(this,"name","Form");h(this,"url","/forms");h(this,"actions",{addOne:Kl,addMany:Yl,setOne:Zl,setMany:Jl,updateOne:Xl,updateMany:Ql,deleteOne:xl,deleteMany:eo,initialize:Wl});h(this,"selectors",{selectById:io,selectByIds:no})}add(e){const{addOne:n,updateOne:c,deleteOne:r}=this.actions,a=new Date().toISOString(),u=this.select(m=>{var S;return((S=m.userReducer.currentUser)==null?void 0:S.id)??null}),d=O({...e,submitted_at:a,created_by:u});this.dispatch(n(d));const p=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:R(d),blockers:[],blocks:[d.uuid]});return p.then(m=>{this.dispatch(c(m))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,p]}update(e){const{setOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`Expected form with uuid ${e.uuid} to exist`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[r.uuid],blocks:[r.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error("Expected form to exist");const u=this.select(wo(e)),d=this.select(Nl(e));this.dispatch(n(e)),this.dispatch(ot(w(u))),this.dispatch(ci(w(d)));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(p){throw this.dispatch(c(a)),this.dispatch(ni(d)),this.dispatch(lt(u)),p}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{organization:e}},n);return this.dispatch(c(r)),r}}class CM extends j{constructor(){super(...arguments);h(this,"name","Form Submission Attachment");h(this,"url","/form-submission-attachments");h(this,"actions",{addOne:ro,addMany:ui,setOne:uo,setMany:lo,updateOne:oo,updateMany:ho,deleteOne:mo,deleteMany:li,initialize:ao});h(this,"selectors",{selectById:po,selectByIds:yo})}getId(e){return e.uuid}getBlockers(e){return[e.form_submission]}getBlocks(e){return[e.uuid]}buildModel(e){const n=this.select(r=>{var a;return((a=r.userReducer.currentUser)==null?void 0:a.id)??null}),c=new Date().toISOString();return O({...e,created_by:n,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:c,form_submission:r,file_sha1:a,file_name:u,file_extension:d}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:c,form_submission:r,file_sha1:a,file_name:u,file_extension:d}}buildBulkPayload(e){const{uuid:n,field_identifier:c,form_submission:r,file_sha1:a,file_name:u,file_extension:d}=e;return{uuid:n,field_identifier:c,form_submission:r,file_sha1:a,file_name:u,file_extension:d}}async bulkDelete(e){const{deleteMany:n,addMany:c}=this.actions,r=this.select(mi(e));this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!0),method:o.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(a){throw this.dispatch(c(r)),a}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await Promise.all([this.listPaginated({queryParams:{limit:this.pageSize,paginate:!0,form_submission__organization:e}},n),this.listPaginated({queryParams:{limit:this.pageSize,paginate:!0,form_submission__project__organization:e}},n)])).flatMap(u=>u.flat());return this.dispatch(c(a)),a}}class $M extends v{constructor(){super(...arguments);h(this,"name","Form Submission");h(this,"url","/form-submissions");h(this,"actions",{addOne:Po,addMany:lt,setOne:To,setMany:Oo,updateOne:Fo,updateMany:bo,deleteOne:go,deleteMany:ot,initialize:Io});h(this,"selectors",{selectById:Mo,selectByIds:Ro})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=this.select(m=>{var S;return((S=m.userReducer.currentUser)==null?void 0:S.id)??null}),u=new Date().toISOString(),d=O({...e,created_by:a,submitted_at:u}),p=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:R(d),blockers:[e.form_revision],blocks:[d.uuid]});return this.dispatch(n(d)),p.then(m=>{this.dispatch(c(m))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,p]}update(e){const{setOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`Expected submission with uuid ${e.uuid} to exist`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${a.uuid}/`,payload:e,blockers:[a.uuid],blocks:[a.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Expected submission with uuid ${e} to exist`);const u=this.select(fo(e));this.dispatch(n(e)),this.dispatch(li(w(u)));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(d){throw this.dispatch(c(a)),this.dispatch(ui(u)),d}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await Promise.all([this.listPaginated({queryParams:{limit:this.pageSize,paginate:!0,organization:e}},n),this.listPaginated({queryParams:{limit:this.pageSize,paginate:!0,project__organization:e}},n)])).flatMap(u=>u.flat());return this.dispatch(c(a)),a}}class UM extends j{constructor(){super(...arguments);h(this,"name","Geo Image");h(this,"url","/geo-images");h(this,"actions",{addOne:$o,addMany:Uo,setOne:qo,setMany:Co,updateOne:Lo,updateMany:ko,deleteOne:No,deleteMany:Go,initialize:jo});h(this,"selectors",{selectById:Wo,selectByIds:Ko})}getId(e){return e.uuid}getBlockers(e){return[e.project]}getBlocks(e){return[e.uuid]}buildModel(e){const n=this.select(r=>{var a;return((a=r.userReducer.currentUser)==null?void 0:a.id)??null}),c=new Date().toISOString();return O({...e,created_by:n,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_sha1:e.file_sha1,file_name:e.file_name,file_extension:e.file_extension,title:e.title,description:e.description,geo_marker:e.geo_marker,canvas_marker:e.canvas_marker,direction:e.direction,original_date:e.original_date,project:e.project}}buildBulkPayload(e){return{uuid:e.uuid,file_sha1:e.file_sha1,file_name:e.file_name,file_extension:e.file_extension,title:e.title,description:e.description,geo_marker:e.geo_marker,canvas_marker:e.canvas_marker,direction:e.direction,original_date:e.original_date,project:e.project}}update(e){const{setOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`Geo image with uuid ${e.uuid} does not exist in the store`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blocks:[e.uuid],blockers:[e.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{project:e}},n);return this.dispatch(c(r)),r}}class LM extends v{constructor(){super(...arguments);h(this,"name","Issue Association");h(this,"url","/issue-associations");h(this,"actions",{addOne:th,addMany:Tt,setOne:Qo,setMany:Xo,updateOne:xo,updateMany:eh,deleteOne:sh,deleteMany:Ot,initialize:Jo});h(this,"selectors",{selectById:nh,selectByIds:ch})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=new Date().toISOString(),u=this.select(m=>{var S;return((S=m.userReducer.currentUser)==null?void 0:S.id)??null}),d=O({...e,submitted_at:a,created_by:u});this.dispatch(n(d));const p=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:R(d),blockers:[e.issue,e.asset],blocks:[d.uuid]});return p.then(m=>{this.dispatch(c(m))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,p]}bulkAdd(e){const{addMany:n,deleteMany:c,updateMany:r}=this.actions,a=this.select(m=>{var S;return((S=m.userReducer.currentUser)==null?void 0:S.id)??null}),u=new Date().toISOString(),d=e.map(m=>O({...m,submitted_at:u,created_by:a}));this.dispatch(n(d));const p=this.enqueueRequest({description:A(o.POST,this.name,!0),method:o.POST,url:`${this.url}/bulk/`,payload:{payloads:d.map(m=>R(m)),submitted_at:u},blockers:d.flatMap(m=>[m.issue,m.asset]),blocks:w(d)});return p.then(m=>{this.dispatch(r(m))}).catch(()=>{this.dispatch(c(w(d)))}),[d,p]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Issue association with uuid ${e} not found in store.`);this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{issue__project:e}},n)).flat();return this.dispatch(c(a)),a}}class kM extends v{constructor(){super(...arguments);h(this,"name","Issue Assignee");h(this,"url","/issue-assignees");h(this,"actions",{addOne:mh,addMany:Xt,setOne:ph,setMany:yh,updateOne:fh,updateMany:Sh,deleteOne:Ah,deleteMany:Qt,initialize:hh});h(this,"selectors",{selectById:Th,selectByIds:Oh})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=O({...e,created_by:this.select(d=>{var p;return((p=d.userReducer.currentUser)==null?void 0:p.id)??null}),submitted_at:new Date().toISOString()});this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:R(a),blockers:[a.issue],blocks:[a.uuid]});return u.then(d=>{this.dispatch(c(d))}).catch(()=>{this.dispatch(r(a.uuid))}),[a,u]}bulkAdd(e){const{addMany:n,setMany:c,deleteMany:r}=this.actions,a=this.select(m=>{var S;return((S=m.userReducer.currentUser)==null?void 0:S.id)??null}),u=new Date().toISOString(),d=e.map(m=>O({...m,created_by:a,submitted_at:u}));this.dispatch(n(d));const p=this.enqueueRequest({description:A(o.POST,this.name,!0),method:o.POST,url:`${this.url}/bulk/`,payload:{issue_assignees:d.map(m=>R(m)),submitted_at:u},blockers:d.map(m=>m.issue),blocks:w(d)});return p.then(m=>{this.dispatch(c(m))}).catch(()=>{this.dispatch(r(w(d)))}),[d,p]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Expected issue assignee with uuid ${e} to exist`);this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async bulkDelete(e){const{deleteMany:n,addMany:c}=this.actions,{selectByIds:r}=this.selectors,a=this.select(r(e));this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!0),method:o.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{issue__project:e}},n)).flat();return this.dispatch(c(a)),a}}class NM extends j{constructor(){super(...arguments);h(this,"name","Issue Attachment");h(this,"url","/issue-attachments");h(this,"actions",{addOne:Mh,addMany:Ti,setOne:Rh,setMany:wh,updateOne:vh,updateMany:Eh,deleteOne:Bh,deleteMany:Oi,initialize:_h});h(this,"selectors",{selectById:Dh,selectByIds:jh})}getId(e){return e.uuid}getBlockers(e){return[e.issue]}getBlocks(e){return[e.uuid]}buildModel(e){const n=this.select(r=>{var a;return((a=r.userReducer.currentUser)==null?void 0:a.id)??null}),c=new Date().toISOString();return O({...e,created_by:n,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,issue:e.issue}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,issue:e.issue}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{issue__project:e}},n)).flat();return this.dispatch(c(a)),a}}class GM extends j{constructor(){super(...arguments);h(this,"name","Issue Comment Attachment");h(this,"url","/issue-comment-attachments");h(this,"actions",{addOne:Uh,addMany:Lh,setOne:kh,setMany:Nh,updateOne:Gh,updateMany:Hh,deleteOne:Wh,deleteMany:Kh,initialize:$h});h(this,"selectors",{selectById:Zh,selectByIds:Jh})}getId(e){return e.uuid}getBlockers(e){return[e.issue_comment]}getBlocks(e){return[e.uuid]}buildModel(e){const n=this.select(r=>{var a;return((a=r.userReducer.currentUser)==null?void 0:a.id)??null}),c=new Date().toISOString();return O({...e,created_by:n,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,issue_comment:e.issue_comment}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,issue_comment:e.issue_comment}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{issue_comment__issue__project:e}},n)).flat();return this.dispatch(c(a)),a}}class HM extends v{constructor(){super(...arguments);h(this,"name","Issue Comment");h(this,"url","/issue-comments");h(this,"actions",{addOne:em,addMany:tm,setOne:sm,setMany:im,updateOne:nm,updateMany:cm,deleteOne:am,deleteMany:rm,initialize:xh});h(this,"selectors",{selectById:dm,selectByIds:um})}add(e){const{addOne:n,updateOne:c,deleteOne:r}=this.actions,a=O({...e,created_by:this.select(d=>d.userReducer.currentUser.id),submitted_at:new Date().toISOString()});this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:R(a),blockers:[e.issue],blocks:[a.uuid]});return u.then(d=>{this.dispatch(c(d))}).catch(()=>{this.dispatch(r(a.uuid))}),[a,u]}update(e){const{updateOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`Comment with uuid ${e.uuid} not found in store`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Comment with uuid ${e} not found in store`);this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{setMany:c}=this.actions,a=(await this.listPaginated({queryParams:{issue__project:e}},n)).flat();return this.dispatch(c(a)),a}}class WM extends v{constructor(){super(...arguments);h(this,"name","Issue");h(this,"url","/issues");h(this,"actions",{addOne:mm,addMany:Ri,setOne:pm,setMany:ym,updateOne:fm,updateMany:Sm,deleteOne:Am,deleteMany:wi,initialize:hm});h(this,"selectors",{selectById:Tm,selectByIds:Om})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=new Date().toISOString(),u=this.select(m=>{var S;return((S=m.userReducer.currentUser)==null?void 0:S.id)??null}),d=O({...e,submitted_at:a,created_by:u});this.dispatch(n(d));const p=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:R(d),blockers:[d.project,d.issue_type,d.status,d.priority],blocks:[d.uuid]});return p.then(m=>{this.dispatch(c(m))}).catch(m=>{throw this.dispatch(r(d.uuid)),m}),[d,p]}update(e){const{updateOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`Attempting to update an issue with uuid ${e.uuid} that doesn't exist in the store`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}bulkUpdate(e,n){const{updateMany:c}=this.actions,{selectByIds:r}=this.selectors,a=w(e).toSorted($t);if(a.length!==e.length)throw new Error("payloads contains duplicate uuids.");const u=this.select(r(a)).toSorted(fs);if(a.length!=u.length)throw new Error(`Attempting to bulk update ${a.length-u.length} issues that dont exist in the store`);const d=[];for(let I=0;I<a.length;I++)d.push({...u[I],...e[I]});this.dispatch(c(d));const p=rt(e,Math.min(n??e.length,k)),m=[];let S=null;for(const I of p){const g=ut.v4(),b=w(I),M=I.map(({status:B})=>B).filter(Boolean),_=I.map(({priority:B})=>B).filter(Boolean),E=this.enqueueRequest({description:A(o.PATCH,this.name,!0),method:o.PATCH,url:`${this.url}/bulk/`,payload:{payloads:I},blockers:(S?[S]:[]).concat(b).concat(M).concat(_),blocks:[g].concat(b)});m.push(E),S=g}return Promise.all(m).then(I=>{this.dispatch(c(I.flat()))}).catch(()=>{this.dispatch(c(u))}),[d,m]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`No issue with uuid ${e} found in the store`);const u=this.select(rh(e)),d=this.select(Ph(e)),p=this.select(zh(e)),m=this.select(hf(e)),S=this.select(vo(e));this.dispatch(n(e)),this.dispatch(Oi(w(p))),this.dispatch(Xi(w(m))),this.dispatch(Ot(w(u))),this.dispatch(Qt(w(d))),this.dispatch(ot(w(S)));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(I){throw this.dispatch(c(a)),this.dispatch(Ti(p)),this.dispatch(Ji(m)),this.dispatch(Tt(u)),this.dispatch(Xt(d)),this.dispatch(lt(S)),I}}async bulkDelete(e){const{addMany:n,deleteMany:c}=this.actions,{selectByIds:r}=this.selectors,a=this.select(r(e)),u=this.select(ah(e)),d=this.select(Fh(e)),p=this.select(Eo(e));this.dispatch(c(e)),this.dispatch(Ot(w(u))),this.dispatch(Qt(w(d))),this.dispatch(ot(w(p)));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!0),method:o.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(m){throw this.dispatch(n(a)),this.dispatch(Tt(u)),this.dispatch(Xt(d)),this.dispatch(lt(p)),m}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{project:e}},n)).flat();return this.dispatch(c(a)),a}}class KM extends j{constructor(){super(...arguments);h(this,"name","Issue Type Attachment");h(this,"url","/issue-type-attachments");h(this,"actions",{addOne:_m,addMany:Mm,setOne:Rm,setMany:wm,updateOne:vm,updateMany:Em,deleteOne:Bm,deleteMany:Vm,initialize:gm});h(this,"selectors",{selectById:Dm,selectByIds:jm})}getId(e){return e.uuid}getBlockers(e){return[e.issue_type]}getBlocks(e){return[e.uuid]}buildModel(e){const n=this.select(r=>{var a;return((a=r.userReducer.currentUser)==null?void 0:a.id)??null}),c=new Date().toISOString();return O({...e,created_by:n,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,issue_type:e.issue_type}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,issue_type:e.issue_type}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{issue_type__organization:e}},n);return this.dispatch(c(r)),r}}class YM extends j{constructor(){super(...arguments);h(this,"name","Issue Type Fields Attachment");h(this,"url","/issue-type-fields-attachments");h(this,"actions",{addOne:Um,addMany:Lm,setOne:km,setMany:Nm,updateOne:Gm,updateMany:Hm,deleteOne:Wm,deleteMany:Km,initialize:$m});h(this,"selectors",{selectById:Zm,selectByIds:Jm})}getId(e){return e.uuid}getBlockers(e){return[e.fields_revision]}getBlocks(e){return[e.uuid]}buildModel(e){const n=this.select(r=>{var a;return((a=r.userReducer.currentUser)==null?void 0:a.id)??null}),c=new Date().toISOString();return O({...e,created_by:n,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:c,fields_revision:r,file_sha1:a,file_name:u,file_extension:d}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:c,fields_revision:r,file_sha1:a,file_name:u,file_extension:d}}buildBulkPayload(e){const{uuid:n,field_identifier:c,fields_revision:r,file_sha1:a,file_name:u,file_extension:d}=e;return{uuid:n,field_identifier:c,fields_revision:r,file_sha1:a,file_name:u,file_extension:d}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{fields_revision__issue_type__organization:e}},n);return this.dispatch(c(r)),r}}class ZM extends v{constructor(){super(...arguments);h(this,"name","Issue Type Fields");h(this,"url","/issue-type-fields");h(this,"actions",{addOne:pp,addMany:yp,setOne:fp,setMany:Sp,updateOne:Ap,updateMany:Ip,deleteOne:Tp,deleteMany:Op,initialize:mp});h(this,"selectors",{selectById:Fp,selectByIds:bp})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=this.select(m=>{var S;return((S=m.userReducer.currentUser)==null?void 0:S.id)??null}),u=new Date().toISOString(),d=O({...e,created_by:a,submitted_at:u});this.dispatch(n(d));const p=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:R(d),blockers:[d.issue_type],blocks:[d.uuid]});return p.then(m=>{this.dispatch(c(m))}).catch(m=>{throw this.dispatch(r(d.uuid)),m}),[d,p]}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{issue_type__organization:e}},n);return this.dispatch(c(r)),r}}class JM extends j{constructor(){super(...arguments);h(this,"name","Issue Type Field Values Attachment");h(this,"url","/issue-type-field-values-attachments");h(this,"actions",{addOne:Rp,addMany:qi,setOne:wp,setMany:vp,updateOne:Ep,updateMany:Bp,deleteOne:Vp,deleteMany:Ci,initialize:Mp});h(this,"selectors",{selectById:Dp,selectByIds:jp})}getId(e){return e.uuid}getBlockers(e){return[e.field_values]}getBlocks(e){return[e.uuid]}buildModel(e){const n=this.select(r=>{var a;return((a=r.userReducer.currentUser)==null?void 0:a.id)??null}),c=new Date().toISOString();return O({...e,created_by:n,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:c,field_values:r,file_sha1:a,file_name:u,file_extension:d}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:c,field_values:r,file_sha1:a,file_name:u,file_extension:d}}buildBulkPayload(e){const{uuid:n,field_identifier:c,field_values:r,file_sha1:a,file_name:u,file_extension:d}=e;return{uuid:n,field_identifier:c,field_values:r,file_sha1:a,file_name:u,file_extension:d}}async bulkDelete(e){const{deleteMany:n,addMany:c}=this.actions,{selectByIds:r}=this.selectors,a=this.select(r(e));this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!0),method:o.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{field_values__issue__project:e,latest:!0}},n)).flat();return this.dispatch(c(a)),a}}class XM extends v{constructor(){super(...arguments);h(this,"name","Issue Type Field Values");h(this,"url","/issue-type-field-values");h(this,"actions",{addOne:ep,addMany:tp,setOne:sp,setMany:ip,updateOne:np,updateMany:cp,deleteOne:ap,deleteMany:rp,initialize:xm});h(this,"selectors",{selectById:up,selectByIds:lp})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=this.select(m=>{var S;return((S=m.userReducer.currentUser)==null?void 0:S.id)??null}),u=new Date().toISOString(),d=O({...e,created_by:a,submitted_at:u}),p=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:R(d),blockers:[e.issue,e.fields_revision],blocks:[d.uuid]});return this.dispatch(n(d)),p.then(m=>{this.dispatch(c(m))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,p]}update(e){const{setOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`Expected IssueTypeFieldValues with uuid ${e.uuid} to exist`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[a.uuid,a.fields_revision,a.issue],blocks:[a.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Expected submission with uuid ${e} to exist`);const u=this.select(qp(e));this.dispatch(n(e)),this.dispatch(Ci(w(u)));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(d){throw this.dispatch(c(a)),this.dispatch(qi(u)),d}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{issue__project:e,latest:!0}},n)).flat();return this.dispatch(c(a)),a}}class QM extends v{constructor(){super(...arguments);h(this,"name","Issue Type Identifier");h(this,"url","/issue-type-identifiers");h(this,"actions",{addOne:Lp,addMany:kp,setOne:Np,setMany:Gp,updateOne:Hp,updateMany:Wp,deleteOne:Kp,deleteMany:Yp,initialize:Up});h(this,"selectors",{selectById:Jp,selectByIds:Xp})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=this.select(m=>{var S;return((S=m.userReducer.currentUser)==null?void 0:S.id)??null}),u=new Date().toISOString(),d=O({...e,created_by:a,submitted_at:u});this.dispatch(n(d));const p=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:R(d),blockers:[d.issue_type],blocks:[d.uuid]});return p.then(m=>{this.dispatch(c(m))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,p]}update(e){const{setOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`Expected issue type identifier with uuid ${e.uuid} to exist`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Expected issue type identifier with uuid ${e} to exist`);this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{issue_type__organization:e}},n);return this.dispatch(c(r)),r}}class xM extends v{constructor(){super(...arguments);h(this,"name","Issue Type Identifier Value");h(this,"url","/issue-type-identifier-values");h(this,"actions",{addOne:ty,addMany:sy,setOne:iy,setMany:ny,updateOne:cy,updateMany:ay,deleteOne:ry,deleteMany:dy,initialize:ey});h(this,"selectors",{selectById:ly,selectByIds:oy})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=this.select(m=>{var S;return((S=m.userReducer.currentUser)==null?void 0:S.id)??null}),u=new Date().toISOString(),d=O({...e,created_by:a,submitted_at:u});this.dispatch(n(d));const p=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:R(d),blockers:[e.issue,e.issue_type_identifier],blocks:[d.uuid]});return p.then(m=>{this.dispatch(c(m))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,p]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Expected issue type identifier value with uuid ${e} to exist`);this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{issue__project:e,latest:!0}},n)).flat();return this.dispatch(c(a)),a}}class eR extends v{constructor(){super(...arguments);h(this,"name","Issue Type Priority");h(this,"url","/issue-type-priorities");h(this,"actions",{addOne:yy,addMany:fy,setOne:Sy,setMany:Ay,updateOne:Iy,updateMany:Ty,deleteOne:Oy,deleteMany:Py,initialize:py});h(this,"selectors",{selectById:by,selectByIds:gy})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=this.select(m=>{var S;return((S=m.userReducer.currentUser)==null?void 0:S.id)??null}),u=new Date().toISOString(),d=O({...e,created_by:a,submitted_at:u});this.dispatch(n(d));const p=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:R(d),blockers:[e.issue_type],blocks:[d.uuid]});return p.then(m=>{this.dispatch(c(m))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,p]}update(e){const{setOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`Expected an existing issue type priority with uuid ${e.uuid}`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`No issue type priority with uuid ${e} found in the store`);this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{issue_type__organization:e}},n);return this.dispatch(c(r)),r}}class tR extends v{constructor(){super(...arguments);h(this,"name","Issue Type");h(this,"url","/issue-types");h(this,"actions",{addOne:wy,addMany:vy,setOne:Ey,setMany:By,updateOne:Vy,updateMany:zy,deleteOne:Dy,deleteMany:jy,initialize:Ry});h(this,"selectors",{selectById:Cy,selectByIds:$y})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=this.select(m=>{var S;return((S=m.userReducer.currentUser)==null?void 0:S.id)??null}),u=new Date().toISOString(),d=O({...e,submitted_at:u,created_by:a});this.dispatch(n(d));const p=this.enqueueRequest({method:o.POST,url:`${this.url}/`,payload:R(d),blockers:[],blocks:[d.uuid]});return p.then(m=>{this.dispatch(c(m))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,p]}update(e){const{setOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`IssueType with uuid ${e.uuid} does not exist in the store.`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{deleteOne:n,setOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`IssueType with uuid ${e} does not exist in the store.`);const u=this.select(Pm(e));this.dispatch(n(e)),this.dispatch(wi(w(u)));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(d){throw this.dispatch(c(a)),this.dispatch(Ri(u)),d}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{organization:e}},n);return this.dispatch(c(r)),r}}class sR extends v{constructor(){super(...arguments);h(this,"name","Issue Type Status");h(this,"url","/issue-type-statuses");h(this,"actions",{addOne:Ny,addMany:Gy,setOne:Hy,setMany:Wy,updateOne:Ky,updateMany:Yy,deleteOne:Zy,deleteMany:Jy,initialize:ky});h(this,"selectors",{selectById:Qy,selectByIds:xy})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=this.select(m=>{var S;return((S=m.userReducer.currentUser)==null?void 0:S.id)??null}),u=new Date().toISOString(),d=O({...e,created_by:a,submitted_at:u});this.dispatch(n(d));const p=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:R(d),blockers:[e.issue_type],blocks:[d.uuid]});return p.then(m=>{this.dispatch(c(m))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,p]}update(e){const{setOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`Expected an existing issue type status with uuid ${e.uuid}`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`No issue type status with uuid ${e} found in the store`);this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{issue_type__organization:e}},n);return this.dispatch(c(r)),r}}class iR extends dt{constructor(){super(...arguments);h(this,"name","Issue Update");h(this,"url","/issue-updates");h(this,"actions",{addOne:nf,addMany:Ji,setOne:cf,setMany:af,updateOne:rf,updateMany:df,deleteOne:uf,deleteMany:Xi,initialize:sf});h(this,"selectors",{selectById:lf,selectByIds:of})}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{issue__project:e}},n)).flat();return this.dispatch(c(a)),a}}const nR=1800;function cR(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 aR extends pM{constructor(){super(...arguments);h(this,"_getRenewedTokens",async e=>{const n=this.performRequest({method:o.POST,url:this.refreshTokensUrl,payload:{refresh:e},isAuthNeeded:!1,checkAuth:!1});let c;try{c=await n}catch(r){console.error("Could not renew tokens; clearing auth",r),this.clearAuth();return}if(!c.access)throw new Error("Missing access token");return{accessToken:c.access,refreshToken:c.refresh??this.getRefreshToken()}})}clearAuth(){console.debug(this.constructor.name,"clearing auth;"),this.dispatch(Xd(!1)),this.clearTokens(),this.dispatch(T()),this.dispatch(T())}async renewTokens(){const e=this.getRefreshToken();if(!e)throw new Error("No refresh token found");console.debug(this.constructor.name,"renewing tokens");try{const n=await this._getRenewedTokens(e);if(!n)return;console.debug("Got renewed tokens"),this.setTokens(n)}catch(n){throw console.error("Could not renew tokens; clearing auth",n),this.clearAuth(),n}}tokenIsExpiringSoon(){const e=this.getAccessToken();if(!e)return!1;const n=Date.now()/1e3;let c;try{c=vb(e).exp??n}catch{c=n}return c-n<nR}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??_t).toString()))}}}async handleUnauthorized(e,n){if(e.url.endsWith("/token/refresh/"))throw this.select(c=>c.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(this.select(c=>c.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=ut.v4();return console.debug(this.constructor.name,"Initiating auth"),this.performRequest({uuid:n,method:o.POST,url:this.initTokensUrl,payload:e,isAuthNeeded:!1,checkAuth:!1}).then(c=>{this.setTokens(cR(c))})}}class rR extends dt{constructor(){super(...arguments);h(this,"name","Organization Access");h(this,"url","/organization-accesses");h(this,"actions",{addOne:Mf,addMany:Rf,setOne:wf,setMany:vf,updateOne:Ef,updateMany:Bf,deleteOne:Vf,deleteMany:zf,initialize:_f});h(this,"selectors",{selectById:jf,selectByIds:qf})}update(e){const{updateOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid)),a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(d=>{throw this.dispatch(n(r)),d}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e)),u=this.select(cn(a.user));this.dispatch(n(a.uuid)),this.dispatch(sn(a.user));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${a.uuid}/`,blockers:[a.uuid],blocks:[]})}catch(d){throw this.dispatch(c(a)),this.dispatch(tn(u)),d}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{organization:e}},n);return this.dispatch(c(r)),r}}class dR extends dt{constructor(){super(...arguments);h(this,"name","Organization");h(this,"url","/organizations");h(this,"actions",{addOne:Gf,addMany:Nf,setOne:kf,setMany:Lf,updateOne:Wf,updateMany:Hf,deleteOne:Kf,deleteMany:Yf,initialize:Uf});h(this,"selectors",{selectById:Xf,selectByIds:Qf})}async add(e){const{addOne:n}=this.actions,c=await this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:e,blockers:[],blocks:[]});return this.dispatch(n(c)),c}async update(e){const{setOne:n}=this.actions,c=await this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return this.dispatch(n(c)),c}async invite(e,n){return this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/${e}/invite/${n}/`,blockers:[],blocks:[]})}async refreshStore(e){const{initialize:n}=this.actions,c=await this.list({},e);return this.dispatch(n(c)),c}}class uR extends v{constructor(){super(...arguments);h(this,"name","Project Access");h(this,"url","/project-accesses");h(this,"actions",{addOne:dS,addMany:uS,setOne:lS,setMany:oS,updateOne:hS,updateMany:mS,deleteOne:pS,deleteMany:yS,initialize:rS});h(this,"selectors",{selectById:SS,selectByIds:AS})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=O({...e,created_by:this.select(d=>{var p;return((p=d.userReducer.currentUser)==null?void 0:p.id)??null})});this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:R(a),blockers:[a.organization_access,a.project],blocks:[a.uuid]});return u.then(d=>{this.dispatch(c(d))}).catch(d=>{throw this.dispatch(r(a.uuid)),d}),[a,u]}bulkAdd(e){const{addMany:n,deleteMany:c,updateMany:r}=this.actions,a=this.select(p=>{var m;return((m=p.userReducer.currentUser)==null?void 0:m.id)??null}),u=e.map(p=>O({...p,created_by:a}));this.dispatch(n(u));const d=this.enqueueRequest({description:A(o.POST,this.name,!0),method:o.POST,url:`${this.url}/bulk/`,payload:{project_accesses:u.map(p=>R(p))},blockers:u.flatMap(p=>[p.project,p.organization_access]),blocks:u.map(p=>p.uuid)});return d.then(p=>{this.dispatch(r(p))}).catch(p=>{throw this.dispatch(c(u.map(m=>m.uuid))),p}),[u,d]}update(e){const{setOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid)),a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[]});return u.then(d=>{this.dispatch(n(d))}).catch(d=>{throw this.dispatch(n(r)),d}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{project__organization:e}},n);return this.dispatch(c(r)),r}}class lR extends j{constructor(){super(...arguments);h(this,"name","Project Attachment");h(this,"url","/project-attachments");h(this,"actions",{addOne:OS,addMany:PS,setOne:FS,setMany:bS,updateOne:gS,updateMany:_S,deleteOne:MS,deleteMany:RS,initialize:TS});h(this,"selectors",{selectById:vS,selectByIds:ES})}getId(e){return e.uuid}getBlockers(e){return[e.project]}getBlocks(e){return[e.uuid]}buildModel(e){const n=this.select(r=>{var a;return((a=r.userReducer.currentUser)==null?void 0:a.id)??null}),c=new Date().toISOString();return O({...e,created_by:n,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,project:e.project}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,project:e.project}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{project__organization:e}},n);return this.dispatch(c(r)),r}}class oR extends v{constructor(){super(...arguments);h(this,"name","Project Comment");h(this,"url","/project-comments");h(this,"actions",{addOne:DS,addMany:jS,setOne:qS,setMany:CS,updateOne:$S,updateMany:US,deleteOne:LS,deleteMany:kS,initialize:zS});h(this,"selectors",{selectById:GS,selectByIds:HS})}add(e){const{addOne:n,updateOne:c,deleteOne:r}=this.actions,a=O({...e,created_by:this.select(d=>{var p;return((p=d.userReducer.currentUser)==null?void 0:p.id)??null}),submitted_at:new Date().toISOString()});this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:R(a),blockers:[a.project],blocks:[a.uuid]});return u.then(d=>{this.dispatch(c(d))}).catch(()=>{this.dispatch(r(a.uuid))}),[a,u]}update(e){const{updateOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`Project comment with uuid ${e.uuid} not found in store`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Project comment with uuid ${e} not found in store`);this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{project:e}},n)).flat();return this.dispatch(c(a)),a}}class hR extends j{constructor(){super(...arguments);h(this,"name","Project File");h(this,"url","/project-files");h(this,"actions",{addOne:XS,addMany:QS,setOne:ZS,setMany:JS,updateOne:xS,updateMany:eA,deleteOne:tA,deleteMany:sA,initialize:YS});h(this,"selectors",{selectById:cA,selectByIds:aA})}getId(e){return e.uuid}getBlockers(e){return[e.project]}getBlocks(e){return[e.uuid]}buildModel(e){const n=this.select(r=>{var a;return((a=r.userReducer.currentUser)==null?void 0:a.id)??null}),c=new Date().toISOString();return O({...e,created_by:n,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_sha1:e.file_sha1,file_name:e.file_name,file_extension:e.file_extension,project:e.project,z_index:e.z_index,canvas_bounds:e.canvas_bounds,bounds:e.bounds}}buildBulkPayload(e){return{uuid:e.uuid,file_sha1:e.file_sha1,file_name:e.file_name,file_extension:e.file_extension,project:e.project,z_index:e.z_index,canvas_bounds:e.canvas_bounds,bounds:e.bounds}}update(e){const{setOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`${this.name} with uuid ${e.uuid} does not exist in the store`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blocks:[e.uuid],blockers:[e.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{project:e}},n)).flat();return this.dispatch(c(a)),a}}class mR extends dt{constructor(){super(...arguments);h(this,"name","Project");h(this,"url","/projects");h(this,"actions",{addOne:mA,addMany:hA,setOne:oA,setMany:lA,updateOne:yA,updateMany:pA,deleteOne:fA,deleteMany:SA,initialize:uA});h(this,"selectors",{selectById:TA,selectByIds:OA})}async add(e){const{addOne:n}=this.actions,c=await this.performRequest({method:o.POST,url:`${this.url}/`,payload:R(e)});return this.dispatch(n(c)),c}async update(e){const{updateOne:n}=this.actions,c=await this.performRequest({method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:R(e)});return this.dispatch(n(c)),c}async delete(e){const{deleteOne:n}=this.actions,c=await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]});return this.dispatch(n(e)),c}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{organization:e}},n);return this.dispatch(c(r)),r}}class pR extends v{constructor(){super(...arguments);h(this,"name","Procedure");h(this,"url","/procedures");h(this,"actions",{addOne:CA,addMany:bt,setOne:$A,setMany:UA,updateOne:LA,updateMany:kA,deleteOne:NA,deleteMany:gt,initialize:qA});h(this,"selectors",{selectById:WA,selectByIds:KA})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=O({...e,created_by:this.select(d=>{var p;return((p=d.userReducer.currentUser)==null?void 0:p.id)??null}),submitted_at:new Date().toISOString()});this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:R(a),blockers:[a.procedure_type,a.project,a.asset,...a.procedure_initiative?[a.procedure_initiative]:[]],blocks:[a.uuid]});return u.then(d=>{this.dispatch(c(d))}).catch(()=>{this.dispatch(r(a.uuid))}),[a,u]}bulkAdd(e,n){var b;const{store:c}=this.client,{addMany:r,updateMany:a,deleteMany:u}=this.actions,d=new Date().toISOString(),p=((b=c.getState().userReducer.currentUser)==null?void 0:b.id)??null,m=[],S=rt(e,Math.min(n??e.length,k)),I=[];for(const M of S){const _=[],E=[],B=[];for(const z of M){const D=O({...z,submitted_at:d,created_by:p});m.push(D),_.push(R(D)),E.push(D.procedure_type,D.project,D.asset,...D.procedure_initiative?[D.procedure_initiative]:[]),B.push(D.uuid)}const C={payload:{submitted_at:d,payloads:_},blockers:E,blocks:B};I.push(C)}this.dispatch(r(m));const g=I.map(M=>{const{payload:_,blocks:E,blockers:B}=M;return this.enqueueRequest({description:A(o.POST,this.name,!0),method:o.POST,url:`${this.url}/bulk/`,payload:_,blockers:B,blocks:E})});return Promise.all(g).then(M=>{this.dispatch(a(M.flat()))}).catch(()=>{this.dispatch(u(w(m)))}),[m,Promise.all(g).then(M=>M.flat())]}update(e){const{updateOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`Expected procedure with uuid ${e.uuid} to exist`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[r.uuid],blocks:[r.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Expected procedure with uuid ${e} to exist`);this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async bulkDelete(e){const{addMany:n,deleteMany:c}=this.actions,{selectByIds:r}=this.selectors,a=this.select(r(e));this.dispatch(c(w(a)));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!0),method:o.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(u){throw this.dispatch(n(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{project:e}},n)).flat();return this.dispatch(c(a)),a}}class yR extends v{constructor(){super(...arguments);h(this,"name","Procedure Step Assignee");h(this,"url","/procedure-step-assignees");h(this,"actions",{addOne:eI,addMany:tI,setOne:sI,setMany:iI,updateOne:nI,updateMany:cI,deleteOne:aI,deleteMany:rI,initialize:xA});h(this,"selectors",{selectById:uI,selectByIds:lI})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=O({...e,created_by:this.select(d=>{var p;return((p=d.userReducer.currentUser)==null?void 0:p.id)??null}),submitted_at:new Date().toISOString()});this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:R(a),blockers:[a.procedure,a.procedure_step],blocks:[a.uuid]});return u.then(d=>{this.dispatch(c(d))}).catch(()=>{this.dispatch(r(a.uuid))}),[a,u]}bulkAdd(e){const{addMany:n,setMany:c,deleteMany:r}=this.actions,a=this.select(m=>{var S;return((S=m.userReducer.currentUser)==null?void 0:S.id)??null}),u=new Date().toISOString(),d=e.map(m=>O({...m,created_by:a,submitted_at:u}));this.dispatch(n(d));const p=this.enqueueRequest({description:A(o.POST,this.name,!0),method:o.POST,url:`${this.url}/bulk/`,payload:{procedure_step_assignees:d.map(m=>R(m)),submitted_at:u},blockers:d.flatMap(m=>[m.procedure,m.procedure_step]),blocks:w(d)});return p.then(m=>{this.dispatch(c(m))}).catch(()=>{this.dispatch(r(w(d)))}),[d,p]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Expected procedure step assignee with uuid ${e} to exist`);this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async bulkDelete(e){const{deleteMany:n,addMany:c}=this.actions,{selectByIds:r}=this.selectors,a=this.select(r(e));this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!0),method:o.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{procedure__project:e}},n)).flat();return this.dispatch(c(a)),a}}class fR extends v{constructor(){super(...arguments);h(this,"name","Procedure Step Comment");h(this,"url","/procedure-step-comments");h(this,"actions",{addOne:pI,addMany:yI,setOne:fI,setMany:SI,updateOne:AI,updateMany:II,deleteOne:TI,deleteMany:OI,initialize:mI});h(this,"selectors",{selectById:FI,selectByIds:bI})}add(e){const{addOne:n,updateOne:c,deleteOne:r}=this.actions,a=O({...e,created_by:this.select(d=>{var p;return((p=d.userReducer.currentUser)==null?void 0:p.id)??null}),submitted_at:new Date().toISOString()});this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:R(a),blockers:[a.procedure,a.procedure_step],blocks:[a.uuid]});return u.then(d=>{this.dispatch(c(d))}).catch(()=>{this.dispatch(r(a.uuid))}),[a,u]}update(e){const{updateOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`Procedure step comment with uuid ${e.uuid} not found in store`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Procedure step comment with uuid ${e} not found in store`);this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{procedure__project:e}},n)).flat();return this.dispatch(c(a)),a}}class SR extends v{constructor(){super(...arguments);h(this,"name","Procedure Step Default Assignee");h(this,"url","/procedure-step-default-assignees");h(this,"actions",{addOne:RI,addMany:wI,setOne:vI,setMany:EI,updateOne:BI,updateMany:VI,deleteOne:zI,deleteMany:DI,initialize:MI});h(this,"selectors",{selectById:qI,selectByIds:CI})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=O({...e,created_by:this.select(d=>{var p;return((p=d.userReducer.currentUser)==null?void 0:p.id)??null}),submitted_at:new Date().toISOString()});this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:R(a),blockers:[a.procedure_step],blocks:[a.uuid]});return u.then(d=>{this.dispatch(c(d))}).catch(()=>{this.dispatch(r(a.uuid))}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Expected procedure step default assignee with uuid ${e} to exist`);this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{procedure_step__procedure_type__organization:e}},n);return this.dispatch(c(r)),r}}class AR extends v{constructor(){super(...arguments);h(this,"name","Procedure Step Default Reviewer");h(this,"url","/procedure-step-default-reviewers");h(this,"actions",{addOne:kI,addMany:NI,setOne:GI,setMany:HI,updateOne:WI,updateMany:KI,deleteOne:YI,deleteMany:ZI,initialize:LI});h(this,"selectors",{selectById:XI,selectByIds:QI})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=O({...e,created_by:this.select(d=>{var p;return((p=d.userReducer.currentUser)==null?void 0:p.id)??null}),submitted_at:new Date().toISOString()});this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:R(a),blockers:[a.procedure_step],blocks:[a.uuid]});return u.then(d=>{this.dispatch(c(d))}).catch(()=>{this.dispatch(r(a.uuid))}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Expected procedure step default reviewer with uuid ${e} to exist`);this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{procedure_step__procedure_type__organization:e}},n);return this.dispatch(c(r)),r}}class IR extends dt{constructor(){super(...arguments);h(this,"name","Procedure Step Event");h(this,"url","/procedure-step-events");h(this,"actions",{addOne:sT,addMany:iT,setOne:nT,setMany:cT,updateOne:aT,updateMany:rT,deleteOne:dT,deleteMany:uT,initialize:tT});h(this,"selectors",{selectById:oT,selectByIds:hT})}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{procedure__project:e}},n)).flat();return this.dispatch(c(a)),a}}class TR extends j{constructor(){super(...arguments);h(this,"name","Procedure Step Fields Attachment");h(this,"url","/procedure-step-fields-attachments");h(this,"actions",{addOne:fT,addMany:_n,setOne:ST,setMany:AT,updateOne:IT,updateMany:TT,deleteOne:OT,deleteMany:Mn,initialize:yT});h(this,"selectors",{selectById:bT,selectByIds:gT})}getId(e){return e.uuid}getBlockers(e){return[e.fields_revision]}getBlocks(e){return[e.uuid]}buildModel(e){return O({...e,created_by:this.select(n=>{var c;return((c=n.userReducer.currentUser)==null?void 0:c.id)??null}),submitted_at:new Date().toISOString()})}buildPayload(e){const{uuid:n,field_identifier:c,fields_revision:r,file_sha1:a,file_name:u,file_extension:d}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:c,fields_revision:r,file_sha1:a,file_name:u,file_extension:d}}buildBulkPayload(e){const{uuid:n,field_identifier:c,fields_revision:r,file_sha1:a,file_name:u,file_extension:d}=e;return{uuid:n,field_identifier:c,fields_revision:r,file_sha1:a,file_name:u,file_extension:d}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{fields_revision__procedure_step__procedure_type__organization:e}},n);return this.dispatch(c(r)),r}}class OR extends v{constructor(){super(...arguments);h(this,"name","Procedure Step Fields");h(this,"url","/procedure-step-fields");h(this,"actions",{addOne:wT,addMany:vT,setOne:ET,setMany:BT,updateOne:VT,updateMany:zT,deleteOne:DT,deleteMany:jT,initialize:RT});h(this,"selectors",{selectById:qT,selectByIds:CT})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=O({...e,created_by:this.select(d=>{var p;return((p=d.userReducer.currentUser)==null?void 0:p.id)??null}),submitted_at:new Date().toISOString()});this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:R(a),blockers:[a.procedure_step],blocks:[a.uuid]});return u.then(d=>{this.dispatch(c(d))}).catch(()=>{this.dispatch(r(a.uuid))}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Expected procedure step fields with uuid ${e} to exist`);const u=this.select(FT(e));this.dispatch(n(e)),this.dispatch(Mn(w(u)));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(d){throw this.dispatch(c(a)),this.dispatch(_n(u)),d}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{procedure_step__procedure_type__organization:e}},n);return this.dispatch(c(r)),r}}class PR extends j{constructor(){super(...arguments);h(this,"name","Procedure Step Field Values Attachment");h(this,"url","/procedure-step-field-values-attachments");h(this,"actions",{addOne:kT,addMany:Bn,setOne:NT,setMany:GT,updateOne:HT,updateMany:WT,deleteOne:KT,deleteMany:Vn,initialize:LT});h(this,"selectors",{selectById:ZT,selectByIds:JT})}getId(e){return e.uuid}getBlockers(e){return[e.field_values]}getBlocks(e){return[e.uuid]}buildModel(e){const n=this.select(r=>{var a;return((a=r.userReducer.currentUser)==null?void 0:a.id)??null}),c=new Date().toISOString();return O({...e,created_by:n,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:c,field_values:r,file_sha1:a,file_name:u,file_extension:d}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:c,field_values:r,file_sha1:a,file_name:u,file_extension:d}}buildBulkPayload(e){const{uuid:n,field_identifier:c,field_values:r,file_sha1:a,file_name:u,file_extension:d}=e;return{uuid:n,field_identifier:c,field_values:r,file_sha1:a,file_name:u,file_extension:d}}async bulkDelete(e){const{deleteMany:n,addMany:c}=this.actions,{selectByIds:r}=this.selectors,a=this.select(r(e));this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!0),method:o.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{field_values__procedure__project:e,latest:!0}},n)).flat();return this.dispatch(c(a)),a}}class FR extends v{constructor(){super(...arguments);h(this,"name","Procedure Step Field Values Review");h(this,"url","/procedure-step-field-values-reviews");h(this,"actions",{addOne:yO,addMany:qn,setOne:fO,setMany:SO,updateOne:AO,updateMany:IO,deleteOne:TO,deleteMany:Cn,initialize:pO});h(this,"selectors",{selectById:PO,selectByIds:FO})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=O({...e,created_by:this.select(d=>{var p;return((p=d.userReducer.currentUser)==null?void 0:p.id)??null}),submitted_at:new Date().toISOString()});this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:R(a),blockers:[a.field_values],blocks:[a.uuid]});return u.then(d=>{this.dispatch(c(d))}).catch(()=>{this.dispatch(r(a.uuid))}),[a,u]}update(e){const{setOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`Procedure step field values review with uuid ${e.uuid} not found in store`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Procedure step field values review with uuid ${e} not found in store`);this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{field_values__procedure__project:e}},n)).flat();return this.dispatch(c(a)),a}}class bR extends v{constructor(){super(...arguments);h(this,"name","Procedure Step Field Values");h(this,"url","/procedure-step-field-values");h(this,"actions",{addOne:tO,addMany:sO,setOne:iO,setMany:nO,updateOne:cO,updateMany:aO,deleteOne:rO,deleteMany:dO,initialize:eO});h(this,"selectors",{selectById:oO,selectByIds:hO})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=this.select(m=>{var S;return((S=m.userReducer.currentUser)==null?void 0:S.id)??null}),u=new Date().toISOString(),d=O({...e,created_by:a,submitted_at:u}),p=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:R(d),blockers:[e.procedure,e.procedure_step,e.fields_revision],blocks:[d.uuid]});return this.dispatch(n(d)),p.then(m=>{this.dispatch(c(m))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,p]}bulkAdd(e,n){const{addMany:c,updateMany:r,deleteMany:a}=this.actions,u=new Date().toISOString(),d=this.select(g=>{var b;return((b=g.userReducer.currentUser)==null?void 0:b.id)??null}),p=[],m=rt(e,Math.min(n??e.length,k)),S=[];for(const g of m){const b=[],M=[],_=[];for(const E of g){const B=O({...E,values:E.values,created_by:d,submitted_at:u});p.push(B),b.push(R(B)),M.push(B.procedure_step,B.procedure,B.fields_revision),_.push(B.uuid)}S.push({payload:{payloads:b,submitted_at:u},blockers:M,blocks:_})}this.dispatch(c(p));const I=S.map(g=>{const{payload:b,blocks:M,blockers:_}=g;return this.enqueueRequest({description:A(o.POST,this.name,!0),method:o.POST,url:`${this.url}/bulk/`,payload:b,blockers:_,blocks:M})});return Promise.all(I).then(g=>{this.dispatch(r(g.flat()))}).catch(()=>{this.dispatch(a(w(p)))}),[p,Promise.all(I).then(g=>g.flat())]}update(e){const{setOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`Expected ProcedureStepFieldValues with uuid ${e.uuid} to exist`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[a.uuid,a.procedure,a.procedure_step,a.fields_revision],blocks:[a.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Expected ProcedureStepFieldValues with uuid ${e} to exist`);const u=this.select(XT(e)),d=this.select(bO(e));this.dispatch(n(e)),this.dispatch(Vn(w(u))),this.dispatch(Cn(w(d)));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(p){throw this.dispatch(c(a)),this.dispatch(Bn(u)),this.dispatch(qn(d)),p}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{procedure__project:e}},n)).flat();return this.dispatch(c(a)),a}}class gR extends v{constructor(){super(...arguments);h(this,"name","Procedure Step Reviewer");h(this,"url","/procedure-step-reviewers");h(this,"actions",{addOne:RO,addMany:wO,setOne:vO,setMany:EO,updateOne:BO,updateMany:VO,deleteOne:zO,deleteMany:DO,initialize:MO});h(this,"selectors",{selectById:qO,selectByIds:CO})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=O({...e,created_by:this.select(d=>{var p;return((p=d.userReducer.currentUser)==null?void 0:p.id)??null}),submitted_at:new Date().toISOString()});this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:R(a),blockers:[a.procedure,a.procedure_step],blocks:[a.uuid]});return u.then(d=>{this.dispatch(c(d))}).catch(()=>{this.dispatch(r(a.uuid))}),[a,u]}bulkAdd(e){const{addMany:n,setMany:c,deleteMany:r}=this.actions,a=this.select(m=>{var S;return((S=m.userReducer.currentUser)==null?void 0:S.id)??null}),u=new Date().toISOString(),d=e.map(m=>O({...m,created_by:a,submitted_at:u}));this.dispatch(n(d));const p=this.enqueueRequest({description:A(o.POST,this.name,!0),method:o.POST,url:`${this.url}/bulk/`,payload:{procedure_step_reviewers:d.map(m=>R(m)),submitted_at:u},blockers:d.flatMap(m=>[m.procedure,m.procedure_step]),blocks:d.map(m=>m.uuid)});return p.then(m=>{this.dispatch(c(m))}).catch(()=>{this.dispatch(r(d.map(m=>m.uuid)))}),[d,p]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Expected procedure step reviewer with uuid ${e} to exist`);this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async bulkDelete(e){const{deleteMany:n,addMany:c}=this.actions,{selectByIds:r}=this.selectors,a=this.select(r(e));this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!0),method:o.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{procedure__project:e}},n)).flat();return this.dispatch(c(a)),a}}class _R extends v{constructor(){super(...arguments);h(this,"name","Procedure Initiative");h(this,"url","/procedure-initiatives");h(this,"actions",{addOne:bA,addMany:gA,setOne:_A,setMany:MA,updateOne:RA,updateMany:wA,deleteOne:vA,deleteMany:EA,initialize:FA});h(this,"selectors",{selectById:zA,selectByIds:DA})}add(e){var p;const{store:n}=this.client,{addOne:c,setOne:r,deleteOne:a}=this.actions,u=O({...e,created_by:((p=n.getState().userReducer.currentUser)==null?void 0:p.id)??null,submitted_at:new Date().toISOString()});this.dispatch(c(u));const d=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:R(u),blockers:[u.procedure_type,u.project],blocks:[u.uuid]});return d.then(m=>{this.dispatch(r(m))}).catch(()=>{this.dispatch(a(u.uuid))}),[u,d]}update(e){const{updateOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`Expected ${this.name} with uuid ${e.uuid} to exist`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[r.uuid],blocks:[r.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Expected ${this.name} with uuid ${e} to exist`);const u=this.select(XA(e));this.dispatch(n(e)),this.dispatch(gt(w(u)));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(d){throw this.dispatch(c(a)),this.dispatch(bt(u)),d}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{project:e}},n)).flat();return this.dispatch(c(a)),a}}class MR extends v{constructor(){super(...arguments);h(this,"name","Procedure Step");h(this,"url","/procedure-steps");h(this,"actions",{addOne:GO,addMany:HO,setOne:kO,setMany:NO,updateOne:WO,updateMany:KO,deleteOne:YO,deleteMany:ZO,initialize:LO});h(this,"selectors",{selectById:XO,selectByIds:QO})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=O({...e,created_by:this.select(d=>{var p;return((p=d.userReducer.currentUser)==null?void 0:p.id)??null}),submitted_at:new Date().toISOString()});this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:R(a),blockers:[a.procedure_type],blocks:[a.uuid]});return u.then(d=>{this.dispatch(c(d))}).catch(()=>{this.dispatch(r(a.uuid))}),[a,u]}update(e){const{setOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`No procedure step with uuid ${e.uuid} found in the store`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${r.uuid}/`,payload:e,blockers:[r.uuid],blocks:[r.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{addOne:n,deleteOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`No procedure step with uuid ${e} found in the store`);this.dispatch(c(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(n(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{procedure_type__organization:e}},n);return this.dispatch(c(r)),r}}class RR extends j{constructor(){super(...arguments);h(this,"name","Procedure Type Attachment");h(this,"url","/procedure-type-attachments");h(this,"actions",{addOne:tP,addMany:sP,setOne:iP,setMany:nP,updateOne:cP,updateMany:aP,deleteOne:rP,deleteMany:dP,initialize:eP});h(this,"selectors",{selectById:oP,selectByIds:hP})}getId(e){return e.uuid}getBlockers(e){return[e.procedure_type]}getBlocks(e){return[e.uuid]}buildModel(e){const n=this.select(r=>{var a;return((a=r.userReducer.currentUser)==null?void 0:a.id)??null}),c=new Date().toISOString();return O({...e,created_by:n,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,procedure_type:e.procedure_type}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,procedure_type:e.procedure_type}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{procedure_type__organization:e}},n);return this.dispatch(c(r)),r}}class wR extends j{constructor(){super(...arguments);h(this,"name","Procedure Type Fields Attachment");h(this,"url","/procedure-type-fields-attachments");h(this,"actions",{addOne:yP,addMany:fP,setOne:SP,setMany:AP,updateOne:IP,updateMany:TP,deleteOne:OP,deleteMany:PP,initialize:pP});h(this,"selectors",{selectById:gP,selectByIds:_P})}getId(e){return e.uuid}getBlockers(e){return[e.fields_revision]}getBlocks(e){return[e.uuid]}buildModel(e){const n=this.select(r=>{var a;return((a=r.userReducer.currentUser)==null?void 0:a.id)??null}),c=new Date().toISOString();return O({...e,created_by:n,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:c,fields_revision:r,file_sha1:a,file_name:u,file_extension:d}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:c,fields_revision:r,file_sha1:a,file_name:u,file_extension:d}}buildBulkPayload(e){const{uuid:n,field_identifier:c,fields_revision:r,file_sha1:a,file_name:u,file_extension:d}=e;return{uuid:n,field_identifier:c,fields_revision:r,file_sha1:a,file_name:u,file_extension:d}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{fields_revision__procedure_type__organization:e}},n);return this.dispatch(c(r)),r}}class vR extends v{constructor(){super(...arguments);h(this,"name","Procedure Type Fields");h(this,"url","/procedure-type-fields");h(this,"actions",{addOne:wP,addMany:vP,setOne:EP,setMany:BP,updateOne:VP,updateMany:zP,deleteOne:DP,deleteMany:jP,initialize:RP});h(this,"selectors",{selectById:$P,selectByIds:UP})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=this.select(m=>{var S;return((S=m.userReducer.currentUser)==null?void 0:S.id)??null}),u=new Date().toISOString(),d=O({...e,created_by:a,submitted_at:u});this.dispatch(n(d));const p=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:R(d),blockers:[d.procedure_type],blocks:[d.uuid]});return p.then(m=>{this.dispatch(c(m))}).catch(m=>{throw this.dispatch(r(d.uuid)),m}),[d,p]}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{procedure_type__organization:e}},n);return this.dispatch(c(r)),r}}class ER extends j{constructor(){super(...arguments);h(this,"name","Procedure Field Values Attachment");h(this,"url","/procedure-field-values-attachments");h(this,"actions",{addOne:NP,addMany:Zn,setOne:GP,setMany:HP,updateOne:WP,updateMany:KP,deleteOne:YP,deleteMany:Jn,initialize:kP});h(this,"selectors",{selectById:XP,selectByIds:QP})}getId(e){return e.uuid}getBlockers(e){return[e.field_values]}getBlocks(e){return[e.uuid]}buildModel(e){const n=this.select(r=>{var a;return((a=r.userReducer.currentUser)==null?void 0:a.id)??null}),c=new Date().toISOString();return O({...e,created_by:n,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:c,field_values:r,file_sha1:a,file_name:u,file_extension:d}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:c,field_values:r,file_sha1:a,file_name:u,file_extension:d}}buildBulkPayload(e){const{uuid:n,field_identifier:c,field_values:r,file_sha1:a,file_name:u,file_extension:d}=e;return{uuid:n,field_identifier:c,field_values:r,file_sha1:a,file_name:u,file_extension:d}}async bulkDelete(e){const{deleteMany:n,addMany:c}=this.actions,{selectByIds:r}=this.selectors,a=this.select(r(e));this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!0),method:o.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{field_values__procedure__project:e,latest:!0}},n)).flat();return this.dispatch(c(a)),a}}class BR extends v{constructor(){super(...arguments);h(this,"name","Procedure Field Values");h(this,"url","/procedure-field-values");h(this,"actions",{addOne:sF,addMany:iF,setOne:nF,setMany:cF,updateOne:aF,updateMany:rF,deleteOne:dF,deleteMany:uF,initialize:tF});h(this,"selectors",{selectById:hF,selectByIds:mF})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=this.select(m=>{var S;return((S=m.userReducer.currentUser)==null?void 0:S.id)??null}),u=new Date().toISOString(),d=O({...e,created_by:a,submitted_at:u}),p=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:R(d),blockers:[e.fields_revision,e.procedure],blocks:[d.uuid]});return this.dispatch(n(d)),p.then(m=>{this.dispatch(c(m))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,p]}bulkAdd(e,n){const{addMany:c,updateMany:r,deleteMany:a}=this.actions,u=new Date().toISOString(),d=this.select(g=>{var b;return((b=g.userReducer.currentUser)==null?void 0:b.id)??null}),p=[],m=rt(e,Math.min(n??e.length,k)),S=[];for(const g of m){const b=[],M=[],_=[];for(const E of g){const B=O({...E,values:E.values,created_by:d,submitted_at:u});p.push(B),b.push(R(B)),M.push(B.procedure,B.fields_revision),_.push(B.uuid)}S.push({payload:{payloads:b,submitted_at:u},blockers:M,blocks:_})}this.dispatch(c(p));const I=S.map(g=>{const{payload:b,blocks:M,blockers:_}=g;return this.enqueueRequest({description:A(o.POST,this.name,!0),method:o.POST,url:`${this.url}/bulk/`,payload:b,blockers:_,blocks:M})});return Promise.all(I).then(g=>{this.dispatch(r(g.flat()))}).catch(()=>{this.dispatch(a(w(p)))}),[p,Promise.all(I).then(g=>g.flat())]}update(e){const{setOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`Expected ProcedureFieldValues with uuid ${e.uuid} to exist`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[a.fields_revision,a.procedure],blocks:[a.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Expected submission with uuid ${e} to exist`);const u=this.select(xP(e));this.dispatch(n(e)),this.dispatch(Jn(w(u)));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(d){throw this.dispatch(c(a)),this.dispatch(Zn(u)),d}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{procedure__project:e,latest:!0}},n)).flat();return this.dispatch(c(a)),a}}class VR extends v{constructor(){super(...arguments);h(this,"name","Procedure Type");h(this,"url","/procedure-types");h(this,"actions",{addOne:fF,addMany:SF,setOne:AF,setMany:IF,updateOne:TF,updateMany:OF,deleteOne:PF,deleteMany:FF,initialize:yF});h(this,"selectors",{selectById:_F,selectByIds:MF})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=O({...e,created_by:this.select(d=>{var p;return((p=d.userReducer.currentUser)==null?void 0:p.id)??null}),submitted_at:new Date().toISOString()});this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:R(a),blockers:[],blocks:[a.uuid]});return u.then(d=>{this.dispatch(c(d))}).catch(()=>{this.dispatch(r(a.uuid))}),[a,u]}update(e){const{setOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`Expected procedure type with uuid ${e.uuid} to exist`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[r.uuid],blocks:[r.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Expected procedure type with uuid ${e} to exist`);const u=this.select(YA(e));this.dispatch(n(e)),this.dispatch(gt(w(u)));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(d){throw this.dispatch(c(a)),this.dispatch(bt(u)),d}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{organization:e}},n);return this.dispatch(c(r)),r}}class zR extends v{constructor(){super(...arguments);h(this,"name","Team Membership");h(this,"url","/team-memberships");h(this,"actions",{addOne:EF,addMany:BF,setOne:VF,setMany:zF,updateOne:DF,updateMany:jF,deleteOne:qF,deleteMany:CF,initialize:vF});h(this,"selectors",{selectById:LF,selectByIds:kF})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=O({...e,created_by:this.select(d=>{var p;return((p=d.userReducer.currentUser)==null?void 0:p.id)??null})});this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:R(a),blockers:[e.team],blocks:[a.uuid]});return u.then(d=>{this.dispatch(c(d))}).catch(()=>{this.dispatch(r(a.uuid))}),[a,u]}bulkAdd(e){const{addMany:n,setMany:c,deleteMany:r}=this.actions,a=this.select(p=>{var m;return((m=p.userReducer.currentUser)==null?void 0:m.id)??null}),u=e.map(p=>O({...p,created_by:a}));this.dispatch(n(u));const d=this.enqueueRequest({description:A(o.POST,this.name,!0),method:o.POST,url:`${this.url}/bulk/`,payload:{team_memberships:u.map(p=>R(p))},blockers:u.map(p=>p.team),blocks:u.map(p=>p.uuid)});return d.then(p=>{this.dispatch(c(p))}).catch(()=>{this.dispatch(r(u.map(p=>p.uuid)))}),[u,d]}async delete(e){const{deleteOne:n,setOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Expected team membership with uuid ${e} to exist`);this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{team__organization:e}},n);return this.dispatch(c(r)),r}}class DR extends v{constructor(){super(...arguments);h(this,"name","Team");h(this,"url","/teams");h(this,"actions",{addOne:HF,addMany:WF,setOne:KF,setMany:YF,updateOne:ZF,updateMany:JF,deleteOne:XF,deleteMany:QF,initialize:GF});h(this,"selectors",{selectById:eb,selectByIds:tb})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=O({...e,submitted_at:new Date().toISOString(),created_by:this.select(d=>{var p;return((p=d.userReducer.currentUser)==null?void 0:p.id)??null})});this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:R(a),blockers:[],blocks:[a.uuid]});return u.then(d=>{this.dispatch(c(d))}).catch(()=>{this.dispatch(r(a.uuid))}),[a,u]}update(e){const{setOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`Expected team with uuid ${e.uuid} to exist`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:R(e),blockers:[e.uuid],blocks:[e.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{deleteOne:n,setOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Expected team with uuid ${e} to exist`);this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{organization:e}},n);return this.dispatch(c(r)),r}}class jR extends dt{constructor(){super(...arguments);h(this,"name","User");h(this,"url","/user");h(this,"actions",{addOne:tn,addMany:Af,setOne:Sf,setMany:ff,updateOne:Tf,updateMany:If,deleteOne:sn,deleteMany:Of,initialize:yf});h(this,"selectors",{selectById:cn,selectByIds:bf})}async list(e,n){const{organizationUuid:c,...r}=e,a=c?`/organizations/${c}${this.url}s/`:`/${this.url}`;return this.performRequest({method:o.GET,url:a,...r},n)}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({organizationUuid:e},n);return this.dispatch(c(r)),r}}async function lc(t,s,e,n,c){const r=n instanceof yt;r&&s.checkAuth!==!1&&await n.auth.prepareAuth();const a={queryParams:"",isAuthNeeded:!0},{s3url:u,payload:d,headers:p,method:m,queryParams:S,attachmentHash:I,isExternalUrl:g,isAuthNeeded:b,isResponseBlob:M}={...a,...s};let _=s.url;const E=I?await e.files.getFileFromCache(I):void 0;if(I&&!E)throw new Error(`Cannot upload file ${I} because it's not cached.`);!g&&!_.startsWith("http")&&(!_.startsWith("/")&&!_.startsWith("blob:")&&(_="/"+_),_=t+_);const B=q=>{if(I){if(!u)throw new Error(`No S3 URL for file ${I}`);if("warning"in u)throw new Error(`S3 URL warning for file ${I}`);if(!E)throw new Error(`No file for file ${I}`);const N=u.fields["x-amz-checksum-sha1"];if(!N)throw new Error(`No checksum for file ${I}`);return q.set("x-amz-checksum-sha1",N).field({...d,...u.fields}).attach("file",E)}return q.send(d)},z={[o.GET]:()=>M?At.get(_.toString()).responseType("blob"):At.get(_.toString()),[o.POST]:()=>{const q=At.post(_.toString());return B(q)},[o.PATCH]:()=>{const q=At.patch(_.toString());return B(q)},[o.PUT]:()=>{const q=At.put(_.toString());return B(q)},[o.DELETE]:()=>{const q=At.delete(_.toString());return B(q)}}[m];let D=z();const St=()=>{console.debug("aborting request:",s.url),D.abort()};if(c==null||c.addEventListener("abort",St),b&&r){const q=n.auth.getAuthHeader();D=D.set("Authorization",q)}p&&(D=D.set(p));try{return await D.query(S)}catch(q){const N=hb(q),ls=N==null?void 0:N.status;if(r&&ls===401)return await n.auth.handleUnauthorized(D,N),D.query(S);throw new $({response:N,innerError:q,discard:rc.includes(ls)})}finally{c==null||c.removeEventListener("abort",St)}}class qR{constructor(s){h(this,"store");this.store=s}_performRequest(s,e,n,c){const r=new os,a={...e,uuid:e.uuid??ut.v4()};return lc(s,a,this,n,c).then(u=>{r.resolve(u.body)}).catch(u=>{u instanceof Error?r.reject(u):r.reject(new Error((u??_t).toString()))}),r}async performRequest(s,e,n,c){return this._performRequest(s,e,n,c).then(r=>{if(r instanceof $)throw r;return r})}async enqueueRequest(s,e,n){return this._enqueueRequest(s,e,n).then(c=>{if(c instanceof $)throw c;return c})}_enqueueRequest(s,e,n){const c=new os,r={...s,BASE_URL:e,serviceName:n},a=this.store.dispatch(sS(r)),u=p=>{if(p)c.resolve(p.body);else{const m=new $({message:"Could not get a response from the server.",response:p,discard:!0});c.reject(m)}},d=p=>{p instanceof $?p.options.discard=!0:(console.error("Received an unexpected error while processing a request:",p,`
|
|
13
|
+
external URLs and therefore not prepended with VITE_API_URL.`;throw new Error(S)}return await this.cacheFile(p),p}processPresignedUrl(e,n){if("warning"in n){if(n.warning==="already_uploaded")return Promise.resolve(void 0);throw console.error(n.warning),new Error(n.warning)}return this.enqueueRequest({url:n.url,description:"Upload file to S3",method:o.POST,isExternalUrl:!0,isAuthNeeded:!1,attachmentHash:e,blockers:[`s3-${n.fields.key}`],blocks:[e],s3url:n})}processPresignedUrls(e){const n={};for(const[c,r]of Object.entries(e))n[c]=this.processPresignedUrl(c,r);return n}async getFilePayload(e){const c={sha1:await Ct(e),file_type:e.type,extension:Rc(e),size:e.size};return await this.client.files.cacheFile(e),c}async cachePresignedUrl(e,n){if(uc.has(e))return;const c=await this.getDB();!!await c.get("presignedUrls",e)?console.warn(`Attempting to add a presigned url already cached, ${n}`):await c.put("presignedUrls",n,e),uc.add(e)}async uncachePresignedUrl(e){await(await this.getDB()).delete("presignedUrls",e),uc.delete(e)}async getPresignedUrlFromCache(e){const n=await(await this.getDB()).get("presignedUrls",e);if(!n)return;if(Dc(n)){await this.uncachePresignedUrl(e);return}return n}}class VM extends v{constructor(){super(...arguments);h(this,"name","Form Identifier");h(this,"url","/form-identifiers");h(this,"actions",{addOne:Wu,addMany:Ku,setOne:Yu,setMany:Zu,updateOne:Ju,updateMany:Xu,deleteOne:Qu,deleteMany:xu,initialize:Hu});h(this,"selectors",{selectById:tl,selectByIds:sl})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=this.select(m=>{var S;return((S=m.userReducer.currentUser)==null?void 0:S.id)??null}),u=new Date().toISOString(),d=O({...e,created_by:a,submitted_at:u});this.dispatch(n(d));const p=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:R(d),blockers:[d.form],blocks:[d.uuid]});return p.then(m=>{this.dispatch(c(m))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,p]}update(e){const{setOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`Expected form identifier with uuid ${e.uuid} to exist`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Expected form identifier with uuid ${e} to exist`);this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{form__organization:e}},n);return this.dispatch(c(r)),r}}class zM extends v{constructor(){super(...arguments);h(this,"name","Form Identifier Value");h(this,"url","/form-identifier-values");h(this,"actions",{addOne:al,addMany:rl,setOne:dl,setMany:ul,updateOne:ll,updateMany:ol,deleteOne:hl,deleteMany:ml,initialize:cl});h(this,"selectors",{selectById:yl,selectByIds:fl})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=this.select(m=>{var S;return((S=m.userReducer.currentUser)==null?void 0:S.id)??null}),u=new Date().toISOString(),d=O({...e,created_by:a,submitted_at:u});this.dispatch(n(d));const p=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:R(d),blockers:[e.form_submission,e.form_identifier],blocks:[d.uuid]});return p.then(m=>{this.dispatch(c(m))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,p]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Expected form identifier value with uuid ${e} to exist`);this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await Promise.all([this.listPaginated({queryParams:{limit:this.pageSize,paginate:!0,form_submission__organization:e}},n),this.listPaginated({queryParams:{limit:this.pageSize,paginate:!0,form_submission__project__organization:e}},n)])).flatMap(u=>u.flat());return this.dispatch(c(a)),a}}class DM extends j{constructor(){super(...arguments);h(this,"name","Form Revision Attachment");h(this,"url","/form-revision-attachments");h(this,"actions",{addOne:Tl,addMany:Ol,setOne:Pl,setMany:Fl,updateOne:bl,updateMany:gl,deleteOne:_l,deleteMany:Ml,initialize:Il});h(this,"selectors",{selectById:wl,selectByIds:vl})}getId(e){return e.uuid}getBlockers(e){return[e.form_revision]}getBlocks(e){return[e.uuid]}buildModel(e){const n=this.select(r=>{var a;return((a=r.userReducer.currentUser)==null?void 0:a.id)??null}),c=new Date().toISOString();return O({...e,created_by:n,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:c,form_revision:r,file_sha1:a,file_name:u,file_extension:d}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:c,form_revision:r,file_sha1:a,file_name:u,file_extension:d}}buildBulkPayload(e){const{uuid:n,field_identifier:c,form_revision:r,file_sha1:a,file_name:u,file_extension:d}=e;return{uuid:n,field_identifier:c,form_revision:r,file_sha1:a,file_name:u,file_extension:d}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{form_revision__form__organization:e}},n);return this.dispatch(c(r)),r}}class jM extends v{constructor(){super(...arguments);h(this,"name","Form Revision");h(this,"url","/form-revisions");h(this,"actions",{addOne:zl,addMany:ni,setOne:Dl,setMany:jl,updateOne:ql,updateMany:Cl,deleteOne:$l,deleteMany:ci,initialize:Vl});h(this,"selectors",{selectById:Ll,selectByIds:kl})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=this.select(m=>{var S;return((S=m.userReducer.currentUser)==null?void 0:S.id)??null}),u=new Date().toISOString(),d=O({...e,created_by:a,submitted_at:u});this.dispatch(n(d));const p=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:R(d),blockers:[e.form],blocks:[d.uuid]});return p.then(m=>{this.dispatch(c(m))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,p]}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{form__organization:e}},n);return this.dispatch(c(r)),r}}class qM extends v{constructor(){super(...arguments);h(this,"name","Form");h(this,"url","/forms");h(this,"actions",{addOne:Kl,addMany:Yl,setOne:Zl,setMany:Jl,updateOne:Xl,updateMany:Ql,deleteOne:xl,deleteMany:eo,initialize:Wl});h(this,"selectors",{selectById:io,selectByIds:no})}add(e){const{addOne:n,updateOne:c,deleteOne:r}=this.actions,a=new Date().toISOString(),u=this.select(m=>{var S;return((S=m.userReducer.currentUser)==null?void 0:S.id)??null}),d=O({...e,submitted_at:a,created_by:u});this.dispatch(n(d));const p=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:R(d),blockers:[],blocks:[d.uuid]});return p.then(m=>{this.dispatch(c(m))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,p]}update(e){const{setOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`Expected form with uuid ${e.uuid} to exist`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[r.uuid],blocks:[r.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error("Expected form to exist");const u=this.select(wo(e)),d=this.select(Nl(e));this.dispatch(n(e)),this.dispatch(ot(w(u))),this.dispatch(ci(w(d)));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(p){throw this.dispatch(c(a)),this.dispatch(ni(d)),this.dispatch(lt(u)),p}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{organization:e}},n);return this.dispatch(c(r)),r}}class CM extends j{constructor(){super(...arguments);h(this,"name","Form Submission Attachment");h(this,"url","/form-submission-attachments");h(this,"actions",{addOne:ro,addMany:ui,setOne:uo,setMany:lo,updateOne:oo,updateMany:ho,deleteOne:mo,deleteMany:li,initialize:ao});h(this,"selectors",{selectById:po,selectByIds:yo})}getId(e){return e.uuid}getBlockers(e){return[e.form_submission]}getBlocks(e){return[e.uuid]}buildModel(e){const n=this.select(r=>{var a;return((a=r.userReducer.currentUser)==null?void 0:a.id)??null}),c=new Date().toISOString();return O({...e,created_by:n,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:c,form_submission:r,file_sha1:a,file_name:u,file_extension:d}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:c,form_submission:r,file_sha1:a,file_name:u,file_extension:d}}buildBulkPayload(e){const{uuid:n,field_identifier:c,form_submission:r,file_sha1:a,file_name:u,file_extension:d}=e;return{uuid:n,field_identifier:c,form_submission:r,file_sha1:a,file_name:u,file_extension:d}}async bulkDelete(e){const{deleteMany:n,addMany:c}=this.actions,r=this.select(mi(e));this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!0),method:o.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(a){throw this.dispatch(c(r)),a}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await Promise.all([this.listPaginated({queryParams:{limit:this.pageSize,paginate:!0,form_submission__organization:e}},n),this.listPaginated({queryParams:{limit:this.pageSize,paginate:!0,form_submission__project__organization:e}},n)])).flatMap(u=>u.flat());return this.dispatch(c(a)),a}}class $M extends v{constructor(){super(...arguments);h(this,"name","Form Submission");h(this,"url","/form-submissions");h(this,"actions",{addOne:Po,addMany:lt,setOne:To,setMany:Oo,updateOne:Fo,updateMany:bo,deleteOne:go,deleteMany:ot,initialize:Io});h(this,"selectors",{selectById:Mo,selectByIds:Ro})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=this.select(m=>{var S;return((S=m.userReducer.currentUser)==null?void 0:S.id)??null}),u=new Date().toISOString(),d=O({...e,created_by:a,submitted_at:u}),p=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:R(d),blockers:[e.form_revision],blocks:[d.uuid]});return this.dispatch(n(d)),p.then(m=>{this.dispatch(c(m))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,p]}update(e){const{setOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`Expected submission with uuid ${e.uuid} to exist`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${a.uuid}/`,payload:e,blockers:[a.uuid],blocks:[a.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Expected submission with uuid ${e} to exist`);const u=this.select(fo(e));this.dispatch(n(e)),this.dispatch(li(w(u)));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(d){throw this.dispatch(c(a)),this.dispatch(ui(u)),d}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await Promise.all([this.listPaginated({queryParams:{limit:this.pageSize,paginate:!0,organization:e}},n),this.listPaginated({queryParams:{limit:this.pageSize,paginate:!0,project__organization:e}},n)])).flatMap(u=>u.flat());return this.dispatch(c(a)),a}}class UM extends j{constructor(){super(...arguments);h(this,"name","Geo Image");h(this,"url","/geo-images");h(this,"actions",{addOne:$o,addMany:Uo,setOne:qo,setMany:Co,updateOne:Lo,updateMany:ko,deleteOne:No,deleteMany:Go,initialize:jo});h(this,"selectors",{selectById:Wo,selectByIds:Ko})}getId(e){return e.uuid}getBlockers(e){return[e.project]}getBlocks(e){return[e.uuid]}buildModel(e){const n=this.select(r=>{var a;return((a=r.userReducer.currentUser)==null?void 0:a.id)??null}),c=new Date().toISOString();return O({...e,created_by:n,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_sha1:e.file_sha1,file_name:e.file_name,file_extension:e.file_extension,title:e.title,description:e.description,geo_marker:e.geo_marker,canvas_marker:e.canvas_marker,direction:e.direction,original_date:e.original_date,project:e.project}}buildBulkPayload(e){return{uuid:e.uuid,file_sha1:e.file_sha1,file_name:e.file_name,file_extension:e.file_extension,title:e.title,description:e.description,geo_marker:e.geo_marker,canvas_marker:e.canvas_marker,direction:e.direction,original_date:e.original_date,project:e.project}}update(e){const{setOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`Geo image with uuid ${e.uuid} does not exist in the store`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blocks:[e.uuid],blockers:[e.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{project:e}},n);return this.dispatch(c(r)),r}}class LM extends v{constructor(){super(...arguments);h(this,"name","Issue Association");h(this,"url","/issue-associations");h(this,"actions",{addOne:th,addMany:Tt,setOne:Qo,setMany:Xo,updateOne:xo,updateMany:eh,deleteOne:sh,deleteMany:Ot,initialize:Jo});h(this,"selectors",{selectById:nh,selectByIds:ch})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=new Date().toISOString(),u=this.select(m=>{var S;return((S=m.userReducer.currentUser)==null?void 0:S.id)??null}),d=O({...e,submitted_at:a,created_by:u});this.dispatch(n(d));const p=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:R(d),blockers:[e.issue,e.asset],blocks:[d.uuid]});return p.then(m=>{this.dispatch(c(m))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,p]}bulkAdd(e){const{addMany:n,deleteMany:c,updateMany:r}=this.actions,a=this.select(m=>{var S;return((S=m.userReducer.currentUser)==null?void 0:S.id)??null}),u=new Date().toISOString(),d=e.map(m=>O({...m,submitted_at:u,created_by:a}));this.dispatch(n(d));const p=this.enqueueRequest({description:A(o.POST,this.name,!0),method:o.POST,url:`${this.url}/bulk/`,payload:{payloads:d.map(m=>R(m)),submitted_at:u},blockers:d.flatMap(m=>[m.issue,m.asset]),blocks:w(d)});return p.then(m=>{this.dispatch(r(m))}).catch(()=>{this.dispatch(c(w(d)))}),[d,p]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Issue association with uuid ${e} not found in store.`);this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{issue__project:e}},n)).flat();return this.dispatch(c(a)),a}}class kM extends v{constructor(){super(...arguments);h(this,"name","Issue Assignee");h(this,"url","/issue-assignees");h(this,"actions",{addOne:mh,addMany:Xt,setOne:ph,setMany:yh,updateOne:fh,updateMany:Sh,deleteOne:Ah,deleteMany:Qt,initialize:hh});h(this,"selectors",{selectById:Th,selectByIds:Oh})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=O({...e,created_by:this.select(d=>{var p;return((p=d.userReducer.currentUser)==null?void 0:p.id)??null}),submitted_at:new Date().toISOString()});this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:R(a),blockers:[a.issue],blocks:[a.uuid]});return u.then(d=>{this.dispatch(c(d))}).catch(()=>{this.dispatch(r(a.uuid))}),[a,u]}bulkAdd(e){const{addMany:n,setMany:c,deleteMany:r}=this.actions,a=this.select(m=>{var S;return((S=m.userReducer.currentUser)==null?void 0:S.id)??null}),u=new Date().toISOString(),d=e.map(m=>O({...m,created_by:a,submitted_at:u}));this.dispatch(n(d));const p=this.enqueueRequest({description:A(o.POST,this.name,!0),method:o.POST,url:`${this.url}/bulk/`,payload:{payloads:d.map(m=>R(m)),submitted_at:u},blockers:d.map(m=>m.issue),blocks:w(d)});return p.then(m=>{this.dispatch(c(m))}).catch(()=>{this.dispatch(r(w(d)))}),[d,p]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Expected issue assignee with uuid ${e} to exist`);this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async bulkDelete(e){const{deleteMany:n,addMany:c}=this.actions,{selectByIds:r}=this.selectors,a=this.select(r(e));this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!0),method:o.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{issue__project:e}},n)).flat();return this.dispatch(c(a)),a}}class NM extends j{constructor(){super(...arguments);h(this,"name","Issue Attachment");h(this,"url","/issue-attachments");h(this,"actions",{addOne:Mh,addMany:Ti,setOne:Rh,setMany:wh,updateOne:vh,updateMany:Eh,deleteOne:Bh,deleteMany:Oi,initialize:_h});h(this,"selectors",{selectById:Dh,selectByIds:jh})}getId(e){return e.uuid}getBlockers(e){return[e.issue]}getBlocks(e){return[e.uuid]}buildModel(e){const n=this.select(r=>{var a;return((a=r.userReducer.currentUser)==null?void 0:a.id)??null}),c=new Date().toISOString();return O({...e,created_by:n,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,issue:e.issue}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,issue:e.issue}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{issue__project:e}},n)).flat();return this.dispatch(c(a)),a}}class GM extends j{constructor(){super(...arguments);h(this,"name","Issue Comment Attachment");h(this,"url","/issue-comment-attachments");h(this,"actions",{addOne:Uh,addMany:Lh,setOne:kh,setMany:Nh,updateOne:Gh,updateMany:Hh,deleteOne:Wh,deleteMany:Kh,initialize:$h});h(this,"selectors",{selectById:Zh,selectByIds:Jh})}getId(e){return e.uuid}getBlockers(e){return[e.issue_comment]}getBlocks(e){return[e.uuid]}buildModel(e){const n=this.select(r=>{var a;return((a=r.userReducer.currentUser)==null?void 0:a.id)??null}),c=new Date().toISOString();return O({...e,created_by:n,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,issue_comment:e.issue_comment}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,issue_comment:e.issue_comment}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{issue_comment__issue__project:e}},n)).flat();return this.dispatch(c(a)),a}}class HM extends v{constructor(){super(...arguments);h(this,"name","Issue Comment");h(this,"url","/issue-comments");h(this,"actions",{addOne:em,addMany:tm,setOne:sm,setMany:im,updateOne:nm,updateMany:cm,deleteOne:am,deleteMany:rm,initialize:xh});h(this,"selectors",{selectById:dm,selectByIds:um})}add(e){const{addOne:n,updateOne:c,deleteOne:r}=this.actions,a=O({...e,created_by:this.select(d=>d.userReducer.currentUser.id),submitted_at:new Date().toISOString()});this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:R(a),blockers:[e.issue],blocks:[a.uuid]});return u.then(d=>{this.dispatch(c(d))}).catch(()=>{this.dispatch(r(a.uuid))}),[a,u]}update(e){const{updateOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`Comment with uuid ${e.uuid} not found in store`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Comment with uuid ${e} not found in store`);this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{setMany:c}=this.actions,a=(await this.listPaginated({queryParams:{issue__project:e}},n)).flat();return this.dispatch(c(a)),a}}class WM extends v{constructor(){super(...arguments);h(this,"name","Issue");h(this,"url","/issues");h(this,"actions",{addOne:mm,addMany:Ri,setOne:pm,setMany:ym,updateOne:fm,updateMany:Sm,deleteOne:Am,deleteMany:wi,initialize:hm});h(this,"selectors",{selectById:Tm,selectByIds:Om})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=new Date().toISOString(),u=this.select(m=>{var S;return((S=m.userReducer.currentUser)==null?void 0:S.id)??null}),d=O({...e,submitted_at:a,created_by:u});this.dispatch(n(d));const p=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:R(d),blockers:[d.project,d.issue_type,d.status,d.priority],blocks:[d.uuid]});return p.then(m=>{this.dispatch(c(m))}).catch(m=>{throw this.dispatch(r(d.uuid)),m}),[d,p]}update(e){const{updateOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`Attempting to update an issue with uuid ${e.uuid} that doesn't exist in the store`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}bulkUpdate(e,n){const{updateMany:c}=this.actions,{selectByIds:r}=this.selectors,a=w(e).toSorted($t);if(a.length!==e.length)throw new Error("payloads contains duplicate uuids.");const u=this.select(r(a)).toSorted(fs);if(a.length!=u.length)throw new Error(`Attempting to bulk update ${a.length-u.length} issues that dont exist in the store`);const d=[];for(let I=0;I<a.length;I++)d.push({...u[I],...e[I]});this.dispatch(c(d));const p=rt(e,Math.min(n??e.length,k)),m=[];let S=null;for(const I of p){const g=ut.v4(),b=w(I),M=I.map(({status:B})=>B).filter(Boolean),_=I.map(({priority:B})=>B).filter(Boolean),E=this.enqueueRequest({description:A(o.PATCH,this.name,!0),method:o.PATCH,url:`${this.url}/bulk/`,payload:{payloads:I},blockers:(S?[S]:[]).concat(b).concat(M).concat(_),blocks:[g].concat(b)});m.push(E),S=g}return Promise.all(m).then(I=>{this.dispatch(c(I.flat()))}).catch(()=>{this.dispatch(c(u))}),[d,m]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`No issue with uuid ${e} found in the store`);const u=this.select(rh(e)),d=this.select(Ph(e)),p=this.select(zh(e)),m=this.select(hf(e)),S=this.select(vo(e));this.dispatch(n(e)),this.dispatch(Oi(w(p))),this.dispatch(Xi(w(m))),this.dispatch(Ot(w(u))),this.dispatch(Qt(w(d))),this.dispatch(ot(w(S)));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(I){throw this.dispatch(c(a)),this.dispatch(Ti(p)),this.dispatch(Ji(m)),this.dispatch(Tt(u)),this.dispatch(Xt(d)),this.dispatch(lt(S)),I}}async bulkDelete(e){const{addMany:n,deleteMany:c}=this.actions,{selectByIds:r}=this.selectors,a=this.select(r(e)),u=this.select(ah(e)),d=this.select(Fh(e)),p=this.select(Eo(e));this.dispatch(c(e)),this.dispatch(Ot(w(u))),this.dispatch(Qt(w(d))),this.dispatch(ot(w(p)));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!0),method:o.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(m){throw this.dispatch(n(a)),this.dispatch(Tt(u)),this.dispatch(Xt(d)),this.dispatch(lt(p)),m}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{project:e}},n)).flat();return this.dispatch(c(a)),a}}class KM extends j{constructor(){super(...arguments);h(this,"name","Issue Type Attachment");h(this,"url","/issue-type-attachments");h(this,"actions",{addOne:_m,addMany:Mm,setOne:Rm,setMany:wm,updateOne:vm,updateMany:Em,deleteOne:Bm,deleteMany:Vm,initialize:gm});h(this,"selectors",{selectById:Dm,selectByIds:jm})}getId(e){return e.uuid}getBlockers(e){return[e.issue_type]}getBlocks(e){return[e.uuid]}buildModel(e){const n=this.select(r=>{var a;return((a=r.userReducer.currentUser)==null?void 0:a.id)??null}),c=new Date().toISOString();return O({...e,created_by:n,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,issue_type:e.issue_type}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,issue_type:e.issue_type}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{issue_type__organization:e}},n);return this.dispatch(c(r)),r}}class YM extends j{constructor(){super(...arguments);h(this,"name","Issue Type Fields Attachment");h(this,"url","/issue-type-fields-attachments");h(this,"actions",{addOne:Um,addMany:Lm,setOne:km,setMany:Nm,updateOne:Gm,updateMany:Hm,deleteOne:Wm,deleteMany:Km,initialize:$m});h(this,"selectors",{selectById:Zm,selectByIds:Jm})}getId(e){return e.uuid}getBlockers(e){return[e.fields_revision]}getBlocks(e){return[e.uuid]}buildModel(e){const n=this.select(r=>{var a;return((a=r.userReducer.currentUser)==null?void 0:a.id)??null}),c=new Date().toISOString();return O({...e,created_by:n,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:c,fields_revision:r,file_sha1:a,file_name:u,file_extension:d}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:c,fields_revision:r,file_sha1:a,file_name:u,file_extension:d}}buildBulkPayload(e){const{uuid:n,field_identifier:c,fields_revision:r,file_sha1:a,file_name:u,file_extension:d}=e;return{uuid:n,field_identifier:c,fields_revision:r,file_sha1:a,file_name:u,file_extension:d}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{fields_revision__issue_type__organization:e}},n);return this.dispatch(c(r)),r}}class ZM extends v{constructor(){super(...arguments);h(this,"name","Issue Type Fields");h(this,"url","/issue-type-fields");h(this,"actions",{addOne:pp,addMany:yp,setOne:fp,setMany:Sp,updateOne:Ap,updateMany:Ip,deleteOne:Tp,deleteMany:Op,initialize:mp});h(this,"selectors",{selectById:Fp,selectByIds:bp})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=this.select(m=>{var S;return((S=m.userReducer.currentUser)==null?void 0:S.id)??null}),u=new Date().toISOString(),d=O({...e,created_by:a,submitted_at:u});this.dispatch(n(d));const p=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:R(d),blockers:[d.issue_type],blocks:[d.uuid]});return p.then(m=>{this.dispatch(c(m))}).catch(m=>{throw this.dispatch(r(d.uuid)),m}),[d,p]}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{issue_type__organization:e}},n);return this.dispatch(c(r)),r}}class JM extends j{constructor(){super(...arguments);h(this,"name","Issue Type Field Values Attachment");h(this,"url","/issue-type-field-values-attachments");h(this,"actions",{addOne:Rp,addMany:qi,setOne:wp,setMany:vp,updateOne:Ep,updateMany:Bp,deleteOne:Vp,deleteMany:Ci,initialize:Mp});h(this,"selectors",{selectById:Dp,selectByIds:jp})}getId(e){return e.uuid}getBlockers(e){return[e.field_values]}getBlocks(e){return[e.uuid]}buildModel(e){const n=this.select(r=>{var a;return((a=r.userReducer.currentUser)==null?void 0:a.id)??null}),c=new Date().toISOString();return O({...e,created_by:n,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:c,field_values:r,file_sha1:a,file_name:u,file_extension:d}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:c,field_values:r,file_sha1:a,file_name:u,file_extension:d}}buildBulkPayload(e){const{uuid:n,field_identifier:c,field_values:r,file_sha1:a,file_name:u,file_extension:d}=e;return{uuid:n,field_identifier:c,field_values:r,file_sha1:a,file_name:u,file_extension:d}}async bulkDelete(e){const{deleteMany:n,addMany:c}=this.actions,{selectByIds:r}=this.selectors,a=this.select(r(e));this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!0),method:o.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{field_values__issue__project:e,latest:!0}},n)).flat();return this.dispatch(c(a)),a}}class XM extends v{constructor(){super(...arguments);h(this,"name","Issue Type Field Values");h(this,"url","/issue-type-field-values");h(this,"actions",{addOne:ep,addMany:tp,setOne:sp,setMany:ip,updateOne:np,updateMany:cp,deleteOne:ap,deleteMany:rp,initialize:xm});h(this,"selectors",{selectById:up,selectByIds:lp})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=this.select(m=>{var S;return((S=m.userReducer.currentUser)==null?void 0:S.id)??null}),u=new Date().toISOString(),d=O({...e,created_by:a,submitted_at:u}),p=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:R(d),blockers:[e.issue,e.fields_revision],blocks:[d.uuid]});return this.dispatch(n(d)),p.then(m=>{this.dispatch(c(m))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,p]}update(e){const{setOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`Expected IssueTypeFieldValues with uuid ${e.uuid} to exist`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[a.uuid,a.fields_revision,a.issue],blocks:[a.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Expected submission with uuid ${e} to exist`);const u=this.select(qp(e));this.dispatch(n(e)),this.dispatch(Ci(w(u)));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(d){throw this.dispatch(c(a)),this.dispatch(qi(u)),d}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{issue__project:e,latest:!0}},n)).flat();return this.dispatch(c(a)),a}}class QM extends v{constructor(){super(...arguments);h(this,"name","Issue Type Identifier");h(this,"url","/issue-type-identifiers");h(this,"actions",{addOne:Lp,addMany:kp,setOne:Np,setMany:Gp,updateOne:Hp,updateMany:Wp,deleteOne:Kp,deleteMany:Yp,initialize:Up});h(this,"selectors",{selectById:Jp,selectByIds:Xp})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=this.select(m=>{var S;return((S=m.userReducer.currentUser)==null?void 0:S.id)??null}),u=new Date().toISOString(),d=O({...e,created_by:a,submitted_at:u});this.dispatch(n(d));const p=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:R(d),blockers:[d.issue_type],blocks:[d.uuid]});return p.then(m=>{this.dispatch(c(m))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,p]}update(e){const{setOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`Expected issue type identifier with uuid ${e.uuid} to exist`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Expected issue type identifier with uuid ${e} to exist`);this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{issue_type__organization:e}},n);return this.dispatch(c(r)),r}}class xM extends v{constructor(){super(...arguments);h(this,"name","Issue Type Identifier Value");h(this,"url","/issue-type-identifier-values");h(this,"actions",{addOne:ty,addMany:sy,setOne:iy,setMany:ny,updateOne:cy,updateMany:ay,deleteOne:ry,deleteMany:dy,initialize:ey});h(this,"selectors",{selectById:ly,selectByIds:oy})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=this.select(m=>{var S;return((S=m.userReducer.currentUser)==null?void 0:S.id)??null}),u=new Date().toISOString(),d=O({...e,created_by:a,submitted_at:u});this.dispatch(n(d));const p=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:R(d),blockers:[e.issue,e.issue_type_identifier],blocks:[d.uuid]});return p.then(m=>{this.dispatch(c(m))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,p]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Expected issue type identifier value with uuid ${e} to exist`);this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{issue__project:e,latest:!0}},n)).flat();return this.dispatch(c(a)),a}}class eR extends v{constructor(){super(...arguments);h(this,"name","Issue Type Priority");h(this,"url","/issue-type-priorities");h(this,"actions",{addOne:yy,addMany:fy,setOne:Sy,setMany:Ay,updateOne:Iy,updateMany:Ty,deleteOne:Oy,deleteMany:Py,initialize:py});h(this,"selectors",{selectById:by,selectByIds:gy})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=this.select(m=>{var S;return((S=m.userReducer.currentUser)==null?void 0:S.id)??null}),u=new Date().toISOString(),d=O({...e,created_by:a,submitted_at:u});this.dispatch(n(d));const p=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:R(d),blockers:[e.issue_type],blocks:[d.uuid]});return p.then(m=>{this.dispatch(c(m))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,p]}update(e){const{setOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`Expected an existing issue type priority with uuid ${e.uuid}`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`No issue type priority with uuid ${e} found in the store`);this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{issue_type__organization:e}},n);return this.dispatch(c(r)),r}}class tR extends v{constructor(){super(...arguments);h(this,"name","Issue Type");h(this,"url","/issue-types");h(this,"actions",{addOne:wy,addMany:vy,setOne:Ey,setMany:By,updateOne:Vy,updateMany:zy,deleteOne:Dy,deleteMany:jy,initialize:Ry});h(this,"selectors",{selectById:Cy,selectByIds:$y})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=this.select(m=>{var S;return((S=m.userReducer.currentUser)==null?void 0:S.id)??null}),u=new Date().toISOString(),d=O({...e,submitted_at:u,created_by:a});this.dispatch(n(d));const p=this.enqueueRequest({method:o.POST,url:`${this.url}/`,payload:R(d),blockers:[],blocks:[d.uuid]});return p.then(m=>{this.dispatch(c(m))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,p]}update(e){const{setOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`IssueType with uuid ${e.uuid} does not exist in the store.`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{deleteOne:n,setOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`IssueType with uuid ${e} does not exist in the store.`);const u=this.select(Pm(e));this.dispatch(n(e)),this.dispatch(wi(w(u)));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(d){throw this.dispatch(c(a)),this.dispatch(Ri(u)),d}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{organization:e}},n);return this.dispatch(c(r)),r}}class sR extends v{constructor(){super(...arguments);h(this,"name","Issue Type Status");h(this,"url","/issue-type-statuses");h(this,"actions",{addOne:Ny,addMany:Gy,setOne:Hy,setMany:Wy,updateOne:Ky,updateMany:Yy,deleteOne:Zy,deleteMany:Jy,initialize:ky});h(this,"selectors",{selectById:Qy,selectByIds:xy})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=this.select(m=>{var S;return((S=m.userReducer.currentUser)==null?void 0:S.id)??null}),u=new Date().toISOString(),d=O({...e,created_by:a,submitted_at:u});this.dispatch(n(d));const p=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:R(d),blockers:[e.issue_type],blocks:[d.uuid]});return p.then(m=>{this.dispatch(c(m))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,p]}update(e){const{setOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`Expected an existing issue type status with uuid ${e.uuid}`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`No issue type status with uuid ${e} found in the store`);this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{issue_type__organization:e}},n);return this.dispatch(c(r)),r}}class iR extends dt{constructor(){super(...arguments);h(this,"name","Issue Update");h(this,"url","/issue-updates");h(this,"actions",{addOne:nf,addMany:Ji,setOne:cf,setMany:af,updateOne:rf,updateMany:df,deleteOne:uf,deleteMany:Xi,initialize:sf});h(this,"selectors",{selectById:lf,selectByIds:of})}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{issue__project:e}},n)).flat();return this.dispatch(c(a)),a}}const nR=1800;function cR(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 aR extends pM{constructor(){super(...arguments);h(this,"_getRenewedTokens",async e=>{const n=this.performRequest({method:o.POST,url:this.refreshTokensUrl,payload:{refresh:e},isAuthNeeded:!1,checkAuth:!1});let c;try{c=await n}catch(r){console.error("Could not renew tokens; clearing auth",r),this.clearAuth();return}if(!c.access)throw new Error("Missing access token");return{accessToken:c.access,refreshToken:c.refresh??this.getRefreshToken()}})}clearAuth(){console.debug(this.constructor.name,"clearing auth;"),this.dispatch(Xd(!1)),this.clearTokens(),this.dispatch(T()),this.dispatch(T())}async renewTokens(){const e=this.getRefreshToken();if(!e)throw new Error("No refresh token found");console.debug(this.constructor.name,"renewing tokens");try{const n=await this._getRenewedTokens(e);if(!n)return;console.debug("Got renewed tokens"),this.setTokens(n)}catch(n){throw console.error("Could not renew tokens; clearing auth",n),this.clearAuth(),n}}tokenIsExpiringSoon(){const e=this.getAccessToken();if(!e)return!1;const n=Date.now()/1e3;let c;try{c=vb(e).exp??n}catch{c=n}return c-n<nR}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??_t).toString()))}}}async handleUnauthorized(e,n){if(e.url.endsWith("/token/refresh/"))throw this.select(c=>c.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(this.select(c=>c.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=ut.v4();return console.debug(this.constructor.name,"Initiating auth"),this.performRequest({uuid:n,method:o.POST,url:this.initTokensUrl,payload:e,isAuthNeeded:!1,checkAuth:!1}).then(c=>{this.setTokens(cR(c))})}}class rR extends dt{constructor(){super(...arguments);h(this,"name","Organization Access");h(this,"url","/organization-accesses");h(this,"actions",{addOne:Mf,addMany:Rf,setOne:wf,setMany:vf,updateOne:Ef,updateMany:Bf,deleteOne:Vf,deleteMany:zf,initialize:_f});h(this,"selectors",{selectById:jf,selectByIds:qf})}update(e){const{updateOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid)),a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(d=>{throw this.dispatch(n(r)),d}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e)),u=this.select(cn(a.user));this.dispatch(n(a.uuid)),this.dispatch(sn(a.user));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${a.uuid}/`,blockers:[a.uuid],blocks:[]})}catch(d){throw this.dispatch(c(a)),this.dispatch(tn(u)),d}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{organization:e}},n);return this.dispatch(c(r)),r}}class dR extends dt{constructor(){super(...arguments);h(this,"name","Organization");h(this,"url","/organizations");h(this,"actions",{addOne:Gf,addMany:Nf,setOne:kf,setMany:Lf,updateOne:Wf,updateMany:Hf,deleteOne:Kf,deleteMany:Yf,initialize:Uf});h(this,"selectors",{selectById:Xf,selectByIds:Qf})}async add(e){const{addOne:n}=this.actions,c=await this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:e,blockers:[],blocks:[]});return this.dispatch(n(c)),c}async update(e){const{setOne:n}=this.actions,c=await this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return this.dispatch(n(c)),c}async invite(e,n){return this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/${e}/invite/${n}/`,blockers:[],blocks:[]})}async refreshStore(e){const{initialize:n}=this.actions,c=await this.list({},e);return this.dispatch(n(c)),c}}class uR extends v{constructor(){super(...arguments);h(this,"name","Project Access");h(this,"url","/project-accesses");h(this,"actions",{addOne:dS,addMany:uS,setOne:lS,setMany:oS,updateOne:hS,updateMany:mS,deleteOne:pS,deleteMany:yS,initialize:rS});h(this,"selectors",{selectById:SS,selectByIds:AS})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=O({...e,created_by:this.select(d=>{var p;return((p=d.userReducer.currentUser)==null?void 0:p.id)??null})});this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:R(a),blockers:[a.organization_access,a.project],blocks:[a.uuid]});return u.then(d=>{this.dispatch(c(d))}).catch(d=>{throw this.dispatch(r(a.uuid)),d}),[a,u]}bulkAdd(e){const{addMany:n,deleteMany:c,updateMany:r}=this.actions,a=this.select(p=>{var m;return((m=p.userReducer.currentUser)==null?void 0:m.id)??null}),u=e.map(p=>O({...p,created_by:a}));this.dispatch(n(u));const d=this.enqueueRequest({description:A(o.POST,this.name,!0),method:o.POST,url:`${this.url}/bulk/`,payload:{project_accesses:u.map(p=>R(p))},blockers:u.flatMap(p=>[p.project,p.organization_access]),blocks:u.map(p=>p.uuid)});return d.then(p=>{this.dispatch(r(p))}).catch(p=>{throw this.dispatch(c(u.map(m=>m.uuid))),p}),[u,d]}update(e){const{setOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid)),a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[]});return u.then(d=>{this.dispatch(n(d))}).catch(d=>{throw this.dispatch(n(r)),d}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{project__organization:e}},n);return this.dispatch(c(r)),r}}class lR extends j{constructor(){super(...arguments);h(this,"name","Project Attachment");h(this,"url","/project-attachments");h(this,"actions",{addOne:OS,addMany:PS,setOne:FS,setMany:bS,updateOne:gS,updateMany:_S,deleteOne:MS,deleteMany:RS,initialize:TS});h(this,"selectors",{selectById:vS,selectByIds:ES})}getId(e){return e.uuid}getBlockers(e){return[e.project]}getBlocks(e){return[e.uuid]}buildModel(e){const n=this.select(r=>{var a;return((a=r.userReducer.currentUser)==null?void 0:a.id)??null}),c=new Date().toISOString();return O({...e,created_by:n,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,project:e.project}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,project:e.project}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{project__organization:e}},n);return this.dispatch(c(r)),r}}class oR extends v{constructor(){super(...arguments);h(this,"name","Project Comment");h(this,"url","/project-comments");h(this,"actions",{addOne:DS,addMany:jS,setOne:qS,setMany:CS,updateOne:$S,updateMany:US,deleteOne:LS,deleteMany:kS,initialize:zS});h(this,"selectors",{selectById:GS,selectByIds:HS})}add(e){const{addOne:n,updateOne:c,deleteOne:r}=this.actions,a=O({...e,created_by:this.select(d=>{var p;return((p=d.userReducer.currentUser)==null?void 0:p.id)??null}),submitted_at:new Date().toISOString()});this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:R(a),blockers:[a.project],blocks:[a.uuid]});return u.then(d=>{this.dispatch(c(d))}).catch(()=>{this.dispatch(r(a.uuid))}),[a,u]}update(e){const{updateOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`Project comment with uuid ${e.uuid} not found in store`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Project comment with uuid ${e} not found in store`);this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{project:e}},n)).flat();return this.dispatch(c(a)),a}}class hR extends j{constructor(){super(...arguments);h(this,"name","Project File");h(this,"url","/project-files");h(this,"actions",{addOne:XS,addMany:QS,setOne:ZS,setMany:JS,updateOne:xS,updateMany:eA,deleteOne:tA,deleteMany:sA,initialize:YS});h(this,"selectors",{selectById:cA,selectByIds:aA})}getId(e){return e.uuid}getBlockers(e){return[e.project]}getBlocks(e){return[e.uuid]}buildModel(e){const n=this.select(r=>{var a;return((a=r.userReducer.currentUser)==null?void 0:a.id)??null}),c=new Date().toISOString();return O({...e,created_by:n,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_sha1:e.file_sha1,file_name:e.file_name,file_extension:e.file_extension,project:e.project,z_index:e.z_index,canvas_bounds:e.canvas_bounds,bounds:e.bounds}}buildBulkPayload(e){return{uuid:e.uuid,file_sha1:e.file_sha1,file_name:e.file_name,file_extension:e.file_extension,project:e.project,z_index:e.z_index,canvas_bounds:e.canvas_bounds,bounds:e.bounds}}update(e){const{setOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`${this.name} with uuid ${e.uuid} does not exist in the store`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blocks:[e.uuid],blockers:[e.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{project:e}},n)).flat();return this.dispatch(c(a)),a}}class mR extends dt{constructor(){super(...arguments);h(this,"name","Project");h(this,"url","/projects");h(this,"actions",{addOne:mA,addMany:hA,setOne:oA,setMany:lA,updateOne:yA,updateMany:pA,deleteOne:fA,deleteMany:SA,initialize:uA});h(this,"selectors",{selectById:TA,selectByIds:OA})}async add(e){const{addOne:n}=this.actions,c=await this.performRequest({method:o.POST,url:`${this.url}/`,payload:R(e)});return this.dispatch(n(c)),c}async update(e){const{updateOne:n}=this.actions,c=await this.performRequest({method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:R(e)});return this.dispatch(n(c)),c}async delete(e){const{deleteOne:n}=this.actions,c=await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]});return this.dispatch(n(e)),c}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{organization:e}},n);return this.dispatch(c(r)),r}}class pR extends v{constructor(){super(...arguments);h(this,"name","Procedure");h(this,"url","/procedures");h(this,"actions",{addOne:CA,addMany:bt,setOne:$A,setMany:UA,updateOne:LA,updateMany:kA,deleteOne:NA,deleteMany:gt,initialize:qA});h(this,"selectors",{selectById:WA,selectByIds:KA})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=O({...e,created_by:this.select(d=>{var p;return((p=d.userReducer.currentUser)==null?void 0:p.id)??null}),submitted_at:new Date().toISOString()});this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:R(a),blockers:[a.procedure_type,a.project,a.asset,...a.procedure_initiative?[a.procedure_initiative]:[]],blocks:[a.uuid]});return u.then(d=>{this.dispatch(c(d))}).catch(()=>{this.dispatch(r(a.uuid))}),[a,u]}bulkAdd(e,n){var b;const{store:c}=this.client,{addMany:r,updateMany:a,deleteMany:u}=this.actions,d=new Date().toISOString(),p=((b=c.getState().userReducer.currentUser)==null?void 0:b.id)??null,m=[],S=rt(e,Math.min(n??e.length,k)),I=[];for(const M of S){const _=[],E=[],B=[];for(const z of M){const D=O({...z,submitted_at:d,created_by:p});m.push(D),_.push(R(D)),E.push(D.procedure_type,D.project,D.asset,...D.procedure_initiative?[D.procedure_initiative]:[]),B.push(D.uuid)}const C={payload:{submitted_at:d,payloads:_},blockers:E,blocks:B};I.push(C)}this.dispatch(r(m));const g=I.map(M=>{const{payload:_,blocks:E,blockers:B}=M;return this.enqueueRequest({description:A(o.POST,this.name,!0),method:o.POST,url:`${this.url}/bulk/`,payload:_,blockers:B,blocks:E})});return Promise.all(g).then(M=>{this.dispatch(a(M.flat()))}).catch(()=>{this.dispatch(u(w(m)))}),[m,Promise.all(g).then(M=>M.flat())]}update(e){const{updateOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`Expected procedure with uuid ${e.uuid} to exist`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[r.uuid],blocks:[r.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Expected procedure with uuid ${e} to exist`);this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async bulkDelete(e){const{addMany:n,deleteMany:c}=this.actions,{selectByIds:r}=this.selectors,a=this.select(r(e));this.dispatch(c(w(a)));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!0),method:o.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(u){throw this.dispatch(n(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{project:e}},n)).flat();return this.dispatch(c(a)),a}}class yR extends v{constructor(){super(...arguments);h(this,"name","Procedure Step Assignee");h(this,"url","/procedure-step-assignees");h(this,"actions",{addOne:eI,addMany:tI,setOne:sI,setMany:iI,updateOne:nI,updateMany:cI,deleteOne:aI,deleteMany:rI,initialize:xA});h(this,"selectors",{selectById:uI,selectByIds:lI})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=O({...e,created_by:this.select(d=>{var p;return((p=d.userReducer.currentUser)==null?void 0:p.id)??null}),submitted_at:new Date().toISOString()});this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:R(a),blockers:[a.procedure,a.procedure_step],blocks:[a.uuid]});return u.then(d=>{this.dispatch(c(d))}).catch(()=>{this.dispatch(r(a.uuid))}),[a,u]}bulkAdd(e){const{addMany:n,setMany:c,deleteMany:r}=this.actions,a=this.select(m=>{var S;return((S=m.userReducer.currentUser)==null?void 0:S.id)??null}),u=new Date().toISOString(),d=e.map(m=>O({...m,created_by:a,submitted_at:u}));this.dispatch(n(d));const p=this.enqueueRequest({description:A(o.POST,this.name,!0),method:o.POST,url:`${this.url}/bulk/`,payload:{procedure_step_assignees:d.map(m=>R(m)),submitted_at:u},blockers:d.flatMap(m=>[m.procedure,m.procedure_step]),blocks:w(d)});return p.then(m=>{this.dispatch(c(m))}).catch(()=>{this.dispatch(r(w(d)))}),[d,p]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Expected procedure step assignee with uuid ${e} to exist`);this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async bulkDelete(e){const{deleteMany:n,addMany:c}=this.actions,{selectByIds:r}=this.selectors,a=this.select(r(e));this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!0),method:o.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{procedure__project:e}},n)).flat();return this.dispatch(c(a)),a}}class fR extends v{constructor(){super(...arguments);h(this,"name","Procedure Step Comment");h(this,"url","/procedure-step-comments");h(this,"actions",{addOne:pI,addMany:yI,setOne:fI,setMany:SI,updateOne:AI,updateMany:II,deleteOne:TI,deleteMany:OI,initialize:mI});h(this,"selectors",{selectById:FI,selectByIds:bI})}add(e){const{addOne:n,updateOne:c,deleteOne:r}=this.actions,a=O({...e,created_by:this.select(d=>{var p;return((p=d.userReducer.currentUser)==null?void 0:p.id)??null}),submitted_at:new Date().toISOString()});this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:R(a),blockers:[a.procedure,a.procedure_step],blocks:[a.uuid]});return u.then(d=>{this.dispatch(c(d))}).catch(()=>{this.dispatch(r(a.uuid))}),[a,u]}update(e){const{updateOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`Procedure step comment with uuid ${e.uuid} not found in store`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Procedure step comment with uuid ${e} not found in store`);this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{procedure__project:e}},n)).flat();return this.dispatch(c(a)),a}}class SR extends v{constructor(){super(...arguments);h(this,"name","Procedure Step Default Assignee");h(this,"url","/procedure-step-default-assignees");h(this,"actions",{addOne:RI,addMany:wI,setOne:vI,setMany:EI,updateOne:BI,updateMany:VI,deleteOne:zI,deleteMany:DI,initialize:MI});h(this,"selectors",{selectById:qI,selectByIds:CI})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=O({...e,created_by:this.select(d=>{var p;return((p=d.userReducer.currentUser)==null?void 0:p.id)??null}),submitted_at:new Date().toISOString()});this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:R(a),blockers:[a.procedure_step],blocks:[a.uuid]});return u.then(d=>{this.dispatch(c(d))}).catch(()=>{this.dispatch(r(a.uuid))}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Expected procedure step default assignee with uuid ${e} to exist`);this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{procedure_step__procedure_type__organization:e}},n);return this.dispatch(c(r)),r}}class AR extends v{constructor(){super(...arguments);h(this,"name","Procedure Step Default Reviewer");h(this,"url","/procedure-step-default-reviewers");h(this,"actions",{addOne:kI,addMany:NI,setOne:GI,setMany:HI,updateOne:WI,updateMany:KI,deleteOne:YI,deleteMany:ZI,initialize:LI});h(this,"selectors",{selectById:XI,selectByIds:QI})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=O({...e,created_by:this.select(d=>{var p;return((p=d.userReducer.currentUser)==null?void 0:p.id)??null}),submitted_at:new Date().toISOString()});this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:R(a),blockers:[a.procedure_step],blocks:[a.uuid]});return u.then(d=>{this.dispatch(c(d))}).catch(()=>{this.dispatch(r(a.uuid))}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Expected procedure step default reviewer with uuid ${e} to exist`);this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{procedure_step__procedure_type__organization:e}},n);return this.dispatch(c(r)),r}}class IR extends dt{constructor(){super(...arguments);h(this,"name","Procedure Step Event");h(this,"url","/procedure-step-events");h(this,"actions",{addOne:sT,addMany:iT,setOne:nT,setMany:cT,updateOne:aT,updateMany:rT,deleteOne:dT,deleteMany:uT,initialize:tT});h(this,"selectors",{selectById:oT,selectByIds:hT})}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{procedure__project:e}},n)).flat();return this.dispatch(c(a)),a}}class TR extends j{constructor(){super(...arguments);h(this,"name","Procedure Step Fields Attachment");h(this,"url","/procedure-step-fields-attachments");h(this,"actions",{addOne:fT,addMany:_n,setOne:ST,setMany:AT,updateOne:IT,updateMany:TT,deleteOne:OT,deleteMany:Mn,initialize:yT});h(this,"selectors",{selectById:bT,selectByIds:gT})}getId(e){return e.uuid}getBlockers(e){return[e.fields_revision]}getBlocks(e){return[e.uuid]}buildModel(e){return O({...e,created_by:this.select(n=>{var c;return((c=n.userReducer.currentUser)==null?void 0:c.id)??null}),submitted_at:new Date().toISOString()})}buildPayload(e){const{uuid:n,field_identifier:c,fields_revision:r,file_sha1:a,file_name:u,file_extension:d}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:c,fields_revision:r,file_sha1:a,file_name:u,file_extension:d}}buildBulkPayload(e){const{uuid:n,field_identifier:c,fields_revision:r,file_sha1:a,file_name:u,file_extension:d}=e;return{uuid:n,field_identifier:c,fields_revision:r,file_sha1:a,file_name:u,file_extension:d}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{fields_revision__procedure_step__procedure_type__organization:e}},n);return this.dispatch(c(r)),r}}class OR extends v{constructor(){super(...arguments);h(this,"name","Procedure Step Fields");h(this,"url","/procedure-step-fields");h(this,"actions",{addOne:wT,addMany:vT,setOne:ET,setMany:BT,updateOne:VT,updateMany:zT,deleteOne:DT,deleteMany:jT,initialize:RT});h(this,"selectors",{selectById:qT,selectByIds:CT})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=O({...e,created_by:this.select(d=>{var p;return((p=d.userReducer.currentUser)==null?void 0:p.id)??null}),submitted_at:new Date().toISOString()});this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:R(a),blockers:[a.procedure_step],blocks:[a.uuid]});return u.then(d=>{this.dispatch(c(d))}).catch(()=>{this.dispatch(r(a.uuid))}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Expected procedure step fields with uuid ${e} to exist`);const u=this.select(FT(e));this.dispatch(n(e)),this.dispatch(Mn(w(u)));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(d){throw this.dispatch(c(a)),this.dispatch(_n(u)),d}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{procedure_step__procedure_type__organization:e}},n);return this.dispatch(c(r)),r}}class PR extends j{constructor(){super(...arguments);h(this,"name","Procedure Step Field Values Attachment");h(this,"url","/procedure-step-field-values-attachments");h(this,"actions",{addOne:kT,addMany:Bn,setOne:NT,setMany:GT,updateOne:HT,updateMany:WT,deleteOne:KT,deleteMany:Vn,initialize:LT});h(this,"selectors",{selectById:ZT,selectByIds:JT})}getId(e){return e.uuid}getBlockers(e){return[e.field_values]}getBlocks(e){return[e.uuid]}buildModel(e){const n=this.select(r=>{var a;return((a=r.userReducer.currentUser)==null?void 0:a.id)??null}),c=new Date().toISOString();return O({...e,created_by:n,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:c,field_values:r,file_sha1:a,file_name:u,file_extension:d}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:c,field_values:r,file_sha1:a,file_name:u,file_extension:d}}buildBulkPayload(e){const{uuid:n,field_identifier:c,field_values:r,file_sha1:a,file_name:u,file_extension:d}=e;return{uuid:n,field_identifier:c,field_values:r,file_sha1:a,file_name:u,file_extension:d}}async bulkDelete(e){const{deleteMany:n,addMany:c}=this.actions,{selectByIds:r}=this.selectors,a=this.select(r(e));this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!0),method:o.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{field_values__procedure__project:e,latest:!0}},n)).flat();return this.dispatch(c(a)),a}}class FR extends v{constructor(){super(...arguments);h(this,"name","Procedure Step Field Values Review");h(this,"url","/procedure-step-field-values-reviews");h(this,"actions",{addOne:yO,addMany:qn,setOne:fO,setMany:SO,updateOne:AO,updateMany:IO,deleteOne:TO,deleteMany:Cn,initialize:pO});h(this,"selectors",{selectById:PO,selectByIds:FO})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=O({...e,created_by:this.select(d=>{var p;return((p=d.userReducer.currentUser)==null?void 0:p.id)??null}),submitted_at:new Date().toISOString()});this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:R(a),blockers:[a.field_values],blocks:[a.uuid]});return u.then(d=>{this.dispatch(c(d))}).catch(()=>{this.dispatch(r(a.uuid))}),[a,u]}update(e){const{setOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`Procedure step field values review with uuid ${e.uuid} not found in store`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Procedure step field values review with uuid ${e} not found in store`);this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{field_values__procedure__project:e}},n)).flat();return this.dispatch(c(a)),a}}class bR extends v{constructor(){super(...arguments);h(this,"name","Procedure Step Field Values");h(this,"url","/procedure-step-field-values");h(this,"actions",{addOne:tO,addMany:sO,setOne:iO,setMany:nO,updateOne:cO,updateMany:aO,deleteOne:rO,deleteMany:dO,initialize:eO});h(this,"selectors",{selectById:oO,selectByIds:hO})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=this.select(m=>{var S;return((S=m.userReducer.currentUser)==null?void 0:S.id)??null}),u=new Date().toISOString(),d=O({...e,created_by:a,submitted_at:u}),p=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:R(d),blockers:[e.procedure,e.procedure_step,e.fields_revision],blocks:[d.uuid]});return this.dispatch(n(d)),p.then(m=>{this.dispatch(c(m))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,p]}bulkAdd(e,n){const{addMany:c,updateMany:r,deleteMany:a}=this.actions,u=new Date().toISOString(),d=this.select(g=>{var b;return((b=g.userReducer.currentUser)==null?void 0:b.id)??null}),p=[],m=rt(e,Math.min(n??e.length,k)),S=[];for(const g of m){const b=[],M=[],_=[];for(const E of g){const B=O({...E,values:E.values,created_by:d,submitted_at:u});p.push(B),b.push(R(B)),M.push(B.procedure_step,B.procedure,B.fields_revision),_.push(B.uuid)}S.push({payload:{payloads:b,submitted_at:u},blockers:M,blocks:_})}this.dispatch(c(p));const I=S.map(g=>{const{payload:b,blocks:M,blockers:_}=g;return this.enqueueRequest({description:A(o.POST,this.name,!0),method:o.POST,url:`${this.url}/bulk/`,payload:b,blockers:_,blocks:M})});return Promise.all(I).then(g=>{this.dispatch(r(g.flat()))}).catch(()=>{this.dispatch(a(w(p)))}),[p,Promise.all(I).then(g=>g.flat())]}update(e){const{setOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`Expected ProcedureStepFieldValues with uuid ${e.uuid} to exist`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[a.uuid,a.procedure,a.procedure_step,a.fields_revision],blocks:[a.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Expected ProcedureStepFieldValues with uuid ${e} to exist`);const u=this.select(XT(e)),d=this.select(bO(e));this.dispatch(n(e)),this.dispatch(Vn(w(u))),this.dispatch(Cn(w(d)));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(p){throw this.dispatch(c(a)),this.dispatch(Bn(u)),this.dispatch(qn(d)),p}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{procedure__project:e}},n)).flat();return this.dispatch(c(a)),a}}class gR extends v{constructor(){super(...arguments);h(this,"name","Procedure Step Reviewer");h(this,"url","/procedure-step-reviewers");h(this,"actions",{addOne:RO,addMany:wO,setOne:vO,setMany:EO,updateOne:BO,updateMany:VO,deleteOne:zO,deleteMany:DO,initialize:MO});h(this,"selectors",{selectById:qO,selectByIds:CO})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=O({...e,created_by:this.select(d=>{var p;return((p=d.userReducer.currentUser)==null?void 0:p.id)??null}),submitted_at:new Date().toISOString()});this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:R(a),blockers:[a.procedure,a.procedure_step],blocks:[a.uuid]});return u.then(d=>{this.dispatch(c(d))}).catch(()=>{this.dispatch(r(a.uuid))}),[a,u]}bulkAdd(e){const{addMany:n,setMany:c,deleteMany:r}=this.actions,a=this.select(m=>{var S;return((S=m.userReducer.currentUser)==null?void 0:S.id)??null}),u=new Date().toISOString(),d=e.map(m=>O({...m,created_by:a,submitted_at:u}));this.dispatch(n(d));const p=this.enqueueRequest({description:A(o.POST,this.name,!0),method:o.POST,url:`${this.url}/bulk/`,payload:{procedure_step_reviewers:d.map(m=>R(m)),submitted_at:u},blockers:d.flatMap(m=>[m.procedure,m.procedure_step]),blocks:d.map(m=>m.uuid)});return p.then(m=>{this.dispatch(c(m))}).catch(()=>{this.dispatch(r(d.map(m=>m.uuid)))}),[d,p]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Expected procedure step reviewer with uuid ${e} to exist`);this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async bulkDelete(e){const{deleteMany:n,addMany:c}=this.actions,{selectByIds:r}=this.selectors,a=this.select(r(e));this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!0),method:o.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{procedure__project:e}},n)).flat();return this.dispatch(c(a)),a}}class _R extends v{constructor(){super(...arguments);h(this,"name","Procedure Initiative");h(this,"url","/procedure-initiatives");h(this,"actions",{addOne:bA,addMany:gA,setOne:_A,setMany:MA,updateOne:RA,updateMany:wA,deleteOne:vA,deleteMany:EA,initialize:FA});h(this,"selectors",{selectById:zA,selectByIds:DA})}add(e){var p;const{store:n}=this.client,{addOne:c,setOne:r,deleteOne:a}=this.actions,u=O({...e,created_by:((p=n.getState().userReducer.currentUser)==null?void 0:p.id)??null,submitted_at:new Date().toISOString()});this.dispatch(c(u));const d=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:R(u),blockers:[u.procedure_type,u.project],blocks:[u.uuid]});return d.then(m=>{this.dispatch(r(m))}).catch(()=>{this.dispatch(a(u.uuid))}),[u,d]}update(e){const{updateOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`Expected ${this.name} with uuid ${e.uuid} to exist`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[r.uuid],blocks:[r.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Expected ${this.name} with uuid ${e} to exist`);const u=this.select(XA(e));this.dispatch(n(e)),this.dispatch(gt(w(u)));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(d){throw this.dispatch(c(a)),this.dispatch(bt(u)),d}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{project:e}},n)).flat();return this.dispatch(c(a)),a}}class MR extends v{constructor(){super(...arguments);h(this,"name","Procedure Step");h(this,"url","/procedure-steps");h(this,"actions",{addOne:GO,addMany:HO,setOne:kO,setMany:NO,updateOne:WO,updateMany:KO,deleteOne:YO,deleteMany:ZO,initialize:LO});h(this,"selectors",{selectById:XO,selectByIds:QO})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=O({...e,created_by:this.select(d=>{var p;return((p=d.userReducer.currentUser)==null?void 0:p.id)??null}),submitted_at:new Date().toISOString()});this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:R(a),blockers:[a.procedure_type],blocks:[a.uuid]});return u.then(d=>{this.dispatch(c(d))}).catch(()=>{this.dispatch(r(a.uuid))}),[a,u]}update(e){const{setOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`No procedure step with uuid ${e.uuid} found in the store`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${r.uuid}/`,payload:e,blockers:[r.uuid],blocks:[r.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{addOne:n,deleteOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`No procedure step with uuid ${e} found in the store`);this.dispatch(c(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(n(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{procedure_type__organization:e}},n);return this.dispatch(c(r)),r}}class RR extends j{constructor(){super(...arguments);h(this,"name","Procedure Type Attachment");h(this,"url","/procedure-type-attachments");h(this,"actions",{addOne:tP,addMany:sP,setOne:iP,setMany:nP,updateOne:cP,updateMany:aP,deleteOne:rP,deleteMany:dP,initialize:eP});h(this,"selectors",{selectById:oP,selectByIds:hP})}getId(e){return e.uuid}getBlockers(e){return[e.procedure_type]}getBlocks(e){return[e.uuid]}buildModel(e){const n=this.select(r=>{var a;return((a=r.userReducer.currentUser)==null?void 0:a.id)??null}),c=new Date().toISOString();return O({...e,created_by:n,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,procedure_type:e.procedure_type}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,procedure_type:e.procedure_type}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{procedure_type__organization:e}},n);return this.dispatch(c(r)),r}}class wR extends j{constructor(){super(...arguments);h(this,"name","Procedure Type Fields Attachment");h(this,"url","/procedure-type-fields-attachments");h(this,"actions",{addOne:yP,addMany:fP,setOne:SP,setMany:AP,updateOne:IP,updateMany:TP,deleteOne:OP,deleteMany:PP,initialize:pP});h(this,"selectors",{selectById:gP,selectByIds:_P})}getId(e){return e.uuid}getBlockers(e){return[e.fields_revision]}getBlocks(e){return[e.uuid]}buildModel(e){const n=this.select(r=>{var a;return((a=r.userReducer.currentUser)==null?void 0:a.id)??null}),c=new Date().toISOString();return O({...e,created_by:n,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:c,fields_revision:r,file_sha1:a,file_name:u,file_extension:d}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:c,fields_revision:r,file_sha1:a,file_name:u,file_extension:d}}buildBulkPayload(e){const{uuid:n,field_identifier:c,fields_revision:r,file_sha1:a,file_name:u,file_extension:d}=e;return{uuid:n,field_identifier:c,fields_revision:r,file_sha1:a,file_name:u,file_extension:d}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{fields_revision__procedure_type__organization:e}},n);return this.dispatch(c(r)),r}}class vR extends v{constructor(){super(...arguments);h(this,"name","Procedure Type Fields");h(this,"url","/procedure-type-fields");h(this,"actions",{addOne:wP,addMany:vP,setOne:EP,setMany:BP,updateOne:VP,updateMany:zP,deleteOne:DP,deleteMany:jP,initialize:RP});h(this,"selectors",{selectById:$P,selectByIds:UP})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=this.select(m=>{var S;return((S=m.userReducer.currentUser)==null?void 0:S.id)??null}),u=new Date().toISOString(),d=O({...e,created_by:a,submitted_at:u});this.dispatch(n(d));const p=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:R(d),blockers:[d.procedure_type],blocks:[d.uuid]});return p.then(m=>{this.dispatch(c(m))}).catch(m=>{throw this.dispatch(r(d.uuid)),m}),[d,p]}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{procedure_type__organization:e}},n);return this.dispatch(c(r)),r}}class ER extends j{constructor(){super(...arguments);h(this,"name","Procedure Field Values Attachment");h(this,"url","/procedure-field-values-attachments");h(this,"actions",{addOne:NP,addMany:Zn,setOne:GP,setMany:HP,updateOne:WP,updateMany:KP,deleteOne:YP,deleteMany:Jn,initialize:kP});h(this,"selectors",{selectById:XP,selectByIds:QP})}getId(e){return e.uuid}getBlockers(e){return[e.field_values]}getBlocks(e){return[e.uuid]}buildModel(e){const n=this.select(r=>{var a;return((a=r.userReducer.currentUser)==null?void 0:a.id)??null}),c=new Date().toISOString();return O({...e,created_by:n,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:c,field_values:r,file_sha1:a,file_name:u,file_extension:d}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:c,field_values:r,file_sha1:a,file_name:u,file_extension:d}}buildBulkPayload(e){const{uuid:n,field_identifier:c,field_values:r,file_sha1:a,file_name:u,file_extension:d}=e;return{uuid:n,field_identifier:c,field_values:r,file_sha1:a,file_name:u,file_extension:d}}async bulkDelete(e){const{deleteMany:n,addMany:c}=this.actions,{selectByIds:r}=this.selectors,a=this.select(r(e));this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!0),method:o.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{field_values__procedure__project:e,latest:!0}},n)).flat();return this.dispatch(c(a)),a}}class BR extends v{constructor(){super(...arguments);h(this,"name","Procedure Field Values");h(this,"url","/procedure-field-values");h(this,"actions",{addOne:sF,addMany:iF,setOne:nF,setMany:cF,updateOne:aF,updateMany:rF,deleteOne:dF,deleteMany:uF,initialize:tF});h(this,"selectors",{selectById:hF,selectByIds:mF})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=this.select(m=>{var S;return((S=m.userReducer.currentUser)==null?void 0:S.id)??null}),u=new Date().toISOString(),d=O({...e,created_by:a,submitted_at:u}),p=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:R(d),blockers:[e.fields_revision,e.procedure],blocks:[d.uuid]});return this.dispatch(n(d)),p.then(m=>{this.dispatch(c(m))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,p]}bulkAdd(e,n){const{addMany:c,updateMany:r,deleteMany:a}=this.actions,u=new Date().toISOString(),d=this.select(g=>{var b;return((b=g.userReducer.currentUser)==null?void 0:b.id)??null}),p=[],m=rt(e,Math.min(n??e.length,k)),S=[];for(const g of m){const b=[],M=[],_=[];for(const E of g){const B=O({...E,values:E.values,created_by:d,submitted_at:u});p.push(B),b.push(R(B)),M.push(B.procedure,B.fields_revision),_.push(B.uuid)}S.push({payload:{payloads:b,submitted_at:u},blockers:M,blocks:_})}this.dispatch(c(p));const I=S.map(g=>{const{payload:b,blocks:M,blockers:_}=g;return this.enqueueRequest({description:A(o.POST,this.name,!0),method:o.POST,url:`${this.url}/bulk/`,payload:b,blockers:_,blocks:M})});return Promise.all(I).then(g=>{this.dispatch(r(g.flat()))}).catch(()=>{this.dispatch(a(w(p)))}),[p,Promise.all(I).then(g=>g.flat())]}update(e){const{setOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`Expected ProcedureFieldValues with uuid ${e.uuid} to exist`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[a.fields_revision,a.procedure],blocks:[a.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Expected submission with uuid ${e} to exist`);const u=this.select(xP(e));this.dispatch(n(e)),this.dispatch(Jn(w(u)));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(d){throw this.dispatch(c(a)),this.dispatch(Zn(u)),d}}async refreshStore(e,n){const{initialize:c}=this.actions,a=(await this.listPaginated({queryParams:{procedure__project:e,latest:!0}},n)).flat();return this.dispatch(c(a)),a}}class VR extends v{constructor(){super(...arguments);h(this,"name","Procedure Type");h(this,"url","/procedure-types");h(this,"actions",{addOne:fF,addMany:SF,setOne:AF,setMany:IF,updateOne:TF,updateMany:OF,deleteOne:PF,deleteMany:FF,initialize:yF});h(this,"selectors",{selectById:_F,selectByIds:MF})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=O({...e,created_by:this.select(d=>{var p;return((p=d.userReducer.currentUser)==null?void 0:p.id)??null}),submitted_at:new Date().toISOString()});this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:R(a),blockers:[],blocks:[a.uuid]});return u.then(d=>{this.dispatch(c(d))}).catch(()=>{this.dispatch(r(a.uuid))}),[a,u]}update(e){const{setOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`Expected procedure type with uuid ${e.uuid} to exist`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[r.uuid],blocks:[r.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{deleteOne:n,addOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Expected procedure type with uuid ${e} to exist`);const u=this.select(YA(e));this.dispatch(n(e)),this.dispatch(gt(w(u)));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(d){throw this.dispatch(c(a)),this.dispatch(bt(u)),d}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{organization:e}},n);return this.dispatch(c(r)),r}}class zR extends v{constructor(){super(...arguments);h(this,"name","Team Membership");h(this,"url","/team-memberships");h(this,"actions",{addOne:EF,addMany:BF,setOne:VF,setMany:zF,updateOne:DF,updateMany:jF,deleteOne:qF,deleteMany:CF,initialize:vF});h(this,"selectors",{selectById:LF,selectByIds:kF})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=O({...e,created_by:this.select(d=>{var p;return((p=d.userReducer.currentUser)==null?void 0:p.id)??null})});this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:R(a),blockers:[e.team],blocks:[a.uuid]});return u.then(d=>{this.dispatch(c(d))}).catch(()=>{this.dispatch(r(a.uuid))}),[a,u]}bulkAdd(e){const{addMany:n,setMany:c,deleteMany:r}=this.actions,a=this.select(p=>{var m;return((m=p.userReducer.currentUser)==null?void 0:m.id)??null}),u=e.map(p=>O({...p,created_by:a}));this.dispatch(n(u));const d=this.enqueueRequest({description:A(o.POST,this.name,!0),method:o.POST,url:`${this.url}/bulk/`,payload:{team_memberships:u.map(p=>R(p))},blockers:u.map(p=>p.team),blocks:u.map(p=>p.uuid)});return d.then(p=>{this.dispatch(c(p))}).catch(()=>{this.dispatch(r(u.map(p=>p.uuid)))}),[u,d]}async delete(e){const{deleteOne:n,setOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Expected team membership with uuid ${e} to exist`);this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{team__organization:e}},n);return this.dispatch(c(r)),r}}class DR extends v{constructor(){super(...arguments);h(this,"name","Team");h(this,"url","/teams");h(this,"actions",{addOne:HF,addMany:WF,setOne:KF,setMany:YF,updateOne:ZF,updateMany:JF,deleteOne:XF,deleteMany:QF,initialize:GF});h(this,"selectors",{selectById:eb,selectByIds:tb})}add(e){const{addOne:n,setOne:c,deleteOne:r}=this.actions,a=O({...e,submitted_at:new Date().toISOString(),created_by:this.select(d=>{var p;return((p=d.userReducer.currentUser)==null?void 0:p.id)??null})});this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.POST,this.name,!1),method:o.POST,url:`${this.url}/`,payload:R(a),blockers:[],blocks:[a.uuid]});return u.then(d=>{this.dispatch(c(d))}).catch(()=>{this.dispatch(r(a.uuid))}),[a,u]}update(e){const{setOne:n}=this.actions,{selectById:c}=this.selectors,r=this.select(c(e.uuid));if(!r)throw new Error(`Expected team with uuid ${e.uuid} to exist`);const a={...r,...e};this.dispatch(n(a));const u=this.enqueueRequest({description:A(o.PATCH,this.name,!1),method:o.PATCH,url:`${this.url}/${e.uuid}/`,payload:R(e),blockers:[e.uuid],blocks:[e.uuid]});return u.then(d=>{this.dispatch(n(d))}).catch(()=>{this.dispatch(n(r))}),[a,u]}async delete(e){const{deleteOne:n,setOne:c}=this.actions,{selectById:r}=this.selectors,a=this.select(r(e));if(!a)throw new Error(`Expected team with uuid ${e} to exist`);this.dispatch(n(e));try{return await this.enqueueRequest({description:A(o.DELETE,this.name,!1),method:o.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(u){throw this.dispatch(c(a)),u}}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({queryParams:{organization:e}},n);return this.dispatch(c(r)),r}}class jR extends dt{constructor(){super(...arguments);h(this,"name","User");h(this,"url","/user");h(this,"actions",{addOne:tn,addMany:Af,setOne:Sf,setMany:ff,updateOne:Tf,updateMany:If,deleteOne:sn,deleteMany:Of,initialize:yf});h(this,"selectors",{selectById:cn,selectByIds:bf})}async list(e,n){const{organizationUuid:c,...r}=e,a=c?`/organizations/${c}${this.url}s/`:`/${this.url}`;return this.performRequest({method:o.GET,url:a,...r},n)}async refreshStore(e,n){const{initialize:c}=this.actions,r=await this.list({organizationUuid:e},n);return this.dispatch(c(r)),r}}async function lc(t,s,e,n,c){const r=n instanceof yt;r&&s.checkAuth!==!1&&await n.auth.prepareAuth();const a={queryParams:"",isAuthNeeded:!0},{s3url:u,payload:d,headers:p,method:m,queryParams:S,attachmentHash:I,isExternalUrl:g,isAuthNeeded:b,isResponseBlob:M}={...a,...s};let _=s.url;const E=I?await e.files.getFileFromCache(I):void 0;if(I&&!E)throw new Error(`Cannot upload file ${I} because it's not cached.`);!g&&!_.startsWith("http")&&(!_.startsWith("/")&&!_.startsWith("blob:")&&(_="/"+_),_=t+_);const B=q=>{if(I){if(!u)throw new Error(`No S3 URL for file ${I}`);if("warning"in u)throw new Error(`S3 URL warning for file ${I}`);if(!E)throw new Error(`No file for file ${I}`);const N=u.fields["x-amz-checksum-sha1"];if(!N)throw new Error(`No checksum for file ${I}`);return q.set("x-amz-checksum-sha1",N).field({...d,...u.fields}).attach("file",E)}return q.send(d)},z={[o.GET]:()=>M?At.get(_.toString()).responseType("blob"):At.get(_.toString()),[o.POST]:()=>{const q=At.post(_.toString());return B(q)},[o.PATCH]:()=>{const q=At.patch(_.toString());return B(q)},[o.PUT]:()=>{const q=At.put(_.toString());return B(q)},[o.DELETE]:()=>{const q=At.delete(_.toString());return B(q)}}[m];let D=z();const St=()=>{console.debug("aborting request:",s.url),D.abort()};if(c==null||c.addEventListener("abort",St),b&&r){const q=n.auth.getAuthHeader();D=D.set("Authorization",q)}p&&(D=D.set(p));try{return await D.query(S)}catch(q){const N=hb(q),ls=N==null?void 0:N.status;if(r&&ls===401)return await n.auth.handleUnauthorized(D,N),D.query(S);throw new $({response:N,innerError:q,discard:rc.includes(ls)})}finally{c==null||c.removeEventListener("abort",St)}}class qR{constructor(s){h(this,"store");this.store=s}_performRequest(s,e,n,c){const r=new os,a={...e,uuid:e.uuid??ut.v4()};return lc(s,a,this,n,c).then(u=>{r.resolve(u.body)}).catch(u=>{u instanceof Error?r.reject(u):r.reject(new Error((u??_t).toString()))}),r}async performRequest(s,e,n,c){return this._performRequest(s,e,n,c).then(r=>{if(r instanceof $)throw r;return r})}async enqueueRequest(s,e,n){return this._enqueueRequest(s,e,n).then(c=>{if(c instanceof $)throw c;return c})}_enqueueRequest(s,e,n){const c=new os,r={...s,BASE_URL:e,serviceName:n},a=this.store.dispatch(sS(r)),u=p=>{if(p)c.resolve(p.body);else{const m=new $({message:"Could not get a response from the server.",response:p,discard:!0});c.reject(m)}},d=p=>{p instanceof $?p.options.discard=!0:(console.error("Received an unexpected error while processing a request:",p,`
|
|
14
14
|
Converting error to APIError and discarding.`),p=new $({message:"An error occurred while processing the request.",innerError:p,discard:!0})),c.reject(p)};return a.then(u,d),c}async performPagination(s,e,n,c,r){const a={...e,queryParams:{...e.queryParams,paginate:!0,limit:n}},{method:u}=a,d=[];let p=await this.performRequest(s,a,c,r);for(d.push(p.results);p.next;)p=await this.performRequest(s,{url:p.next,method:u},c,r),d.push(p.results);return d}}class Mt{constructor(){h(this,"graph");h(this,"requestAttemptCounter");this.graph=new Eb.DepGraph,this.requestAttemptCounter={}}static _fromOutbox(s){const e=new Mt;for(let n=0;n<s.length;n++){const c=s[n];if(!c){console.error("Outbox item was undefined");continue}e.sneakRequest(c);for(let r=0;r<n;r++){const a=s[r];if(!a){console.error("Previous outbox item was undefined");continue}a.payload.uuid!==c.payload.uuid&&a.payload.blocks.some(u=>c.payload.blockers.includes(u))&&Mt._addDependency(c.payload.uuid,a.payload.uuid,e.graph)}}return e}_addDependency(s,e){Mt._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),c=new Set(n.payload.blocks);s.payload.blockers.some(r=>c.has(r))&&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),c=new Set(s.payload.blocks);n.payload.blockers.some(r=>c.has(r))&&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 c of s){const r=this.requestAttemptCounter[c]||0;r<e&&(e=r,n=c)}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),c=s.findIndex(r=>r.payload.uuid===n.payload.uuid);c!==-1&&(s.splice(c,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 c=this.requestAttemptCounter[e.payload.uuid]||0,r=this.requestAttemptCounter[n.payload.uuid]||0;return c-r}),s}registerRetry(s){this.requestAttemptCounter[s]=(this.requestAttemptCounter[s]||0)+1}}let mb;function pb(t){mb=t}function Rt(){return mb}let yb;function fb(t){yb=t}function Sb(){return yb}let oc=null;function ft(){const t=Rt();if(!t)return console.warn("Client store not set; cannot get outbox coordinator yet."),null;if(oc)return oc;const s=t.getState().offline.outbox,e=Mt._fromOutbox(s);return oc=e,e}const CR=(t,s)=>{const e=new s(t);return fb(e),pb(t),e};class $R{constructor(s){h(this,"_all");h(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 hc{constructor(){h(this,"next");this.next=null}then(s){return new $R(this).then(s)}async run(s){if(this.next)return this.next.run(s);{if(console.debug("Middleware finished. Performing request:",s.payload.url),!Rt())throw new Error("Client store not set");const n=Sb();if(!n)throw new Error("Client SDK not set");return ub(s,n)}}}class Ab extends hc{async run(s){return super.run(s)}}class Ib extends hc{async run(s){return super.run(s)}}const Tb=new Ab().then(new Ib).compile();function Ob(t){var s;return(s=Tb[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=Tb,i.APIError=$,i.AgentService=yM,i.AssetAttachmentService=fM,i.AssetCommentService=SM,i.AssetService=AM,i.AssetStatusType=Oc,i.AssetTypeAttachmentService=IM,i.AssetTypeFieldValuesAttachmentService=PM,i.AssetTypeFieldValuesService=FM,i.AssetTypeFieldsAttachmentService=TM,i.AssetTypeFieldsService=OM,i.AssetTypeIdentifierService=bM,i.AssetTypeIdentifierValueService=gM,i.AssetTypeService=_M,i.AssetTypeStatusService=MM,i.BaseApiService=yt,i.BaseModelApiService=dt,i.BaseOfflineFileModelApiService=j,i.BaseOfflineModelApiService=v,i.BaseSDK=qR,i.COMMON_AUTO_FIELDS=Ic,i.DEFAULT_PAGE_SIZE=nb,i.DISCARD_HTTP_STATUSES=rc,i.DeferredPromise=os,i.DocumentAttachmentService=RM,i.DocumentService=wM,i.EMPTY_ARRAY=fc,i.EMPTY_OBJECT=Sc,i.EmailDomainsService=vM,i.EmailVerificationService=EM,i.FileService=BM,i.FormIdentifierService=VM,i.FormIdentifierValueService=zM,i.FormRevisionAttachmentService=DM,i.FormRevisionService=jM,i.FormService=qM,i.FormSubmissionAttachmentService=CM,i.FormSubmissionService=$M,i.GeoImageService=UM,i.HttpMethod=o,i.IssueAssigneeService=kM,i.IssueAssociationService=LM,i.IssueAttachmentService=NM,i.IssueCommentAttachmentService=GM,i.IssueCommentService=HM,i.IssuePriorityType=bc,i.IssueService=WM,i.IssueStatusType=Fc,i.IssueTypeAttachmentService=KM,i.IssueTypeFieldValuesAttachmentService=JM,i.IssueTypeFieldValuesService=XM,i.IssueTypeFieldsAttachmentService=YM,i.IssueTypeFieldsService=ZM,i.IssueTypeIdentifierService=QM,i.IssueTypeIdentifierValueService=xM,i.IssueTypePriorityService=eR,i.IssueTypeService=tR,i.IssueTypeStatusService=sR,i.IssueUpdateChange=Pc,i.IssueUpdateService=iR,i.JWTService=aR,i.MAX_SERVICE_BATCH_SIZE=k,i.OUTBOX_RETRY_DELAY=Ac,i.OfflineAnalyticsMiddleware=Ab,i.OfflineMiddleware=hc,i.OrganizationAccessLevel=Tc,i.OrganizationAccessService=rR,i.OrganizationService=dR,i.OutboxCoordinator=Mt,i.ProcdureInitiativeService=_R,i.ProcedureFieldValuesAttachmentService=ER,i.ProcedureFieldValuesService=BR,i.ProcedureService=pR,i.ProcedureStepAssigneeService=yR,i.ProcedureStepCommentService=fR,i.ProcedureStepDefaultAssigneeService=SR,i.ProcedureStepDefaultReviewerService=AR,i.ProcedureStepEventService=IR,i.ProcedureStepEventType=gc,i.ProcedureStepFieldValuesAttachmentService=PR,i.ProcedureStepFieldValuesReviewService=FR,i.ProcedureStepFieldValuesReviewType=_c,i.ProcedureStepFieldValuesService=bR,i.ProcedureStepFieldsAttachmentService=TR,i.ProcedureStepFieldsService=OR,i.ProcedureStepReviewerService=gR,i.ProcedureStepService=MR,i.ProcedureTypeAttachmentService=RR,i.ProcedureTypeFieldsAttachmentService=wR,i.ProcedureTypeFieldsService=vR,i.ProcedureTypeService=VR,i.ProjectAccessService=uR,i.ProjectAttachmentService=lR,i.ProjectCommentService=oR,i.ProjectFileService=hR,i.ProjectService=mR,i.RESET_ORGANIZATION_STATE=F,i.RESET_PROJECT_STATE=V,i.RESET_STATE=T,i.RateLimitingMiddleware=Ib,i.SelectorBuilder=Qb,i.TeamMembershipService=zR,i.TeamService=DR,i.UNKNOWN_ERROR_MESSAGE=_t,i.UserService=jR,i.VerificationCodeType=Pb,i._setLatestRetryTime=nS,i.addAsset=Fa,i.addAssetAttachment=Jc,i.addAssetAttachments=Ts,i.addAssetComment=ua,i.addAssetComments=Ut,i.addAssetType=_d,i.addAssetTypeAttachment=ja,i.addAssetTypeAttachments=Rs,i.addAssetTypeFieldValues=jr,i.addAssetTypeFieldValuesAttachment=Fr,i.addAssetTypeFieldValuesAttachments=Ds,i.addAssetTypeFieldValuesMany=qr,i.addAssetTypeFields=ur,i.addAssetTypeFieldsAttachment=Za,i.addAssetTypeFieldsAttachments=Ja,i.addAssetTypeFieldsMany=lr,i.addAssetTypeIdentifier=Jr,i.addAssetTypeIdentifierValue=ld,i.addAssetTypeIdentifierValues=od,i.addAssetTypeIdentifiers=Xr,i.addAssetTypeStatus=Cd,i.addAssetTypeStatuses=$d,i.addAssetTypes=Md,i.addAssets=gs,i.addConversation=Gc,i.addConversations=xb,i.addDocument=yu,i.addDocumentAttachment=tu,i.addDocumentAttachments=su,i.addDocuments=fu,i.addEmailDomain=wu,i.addEmailDomains=vu,i.addForm=Kl,i.addFormIdentifier=Wu,i.addFormIdentifierValue=al,i.addFormIdentifierValues=rl,i.addFormIdentifiers=Ku,i.addFormRevision=zl,i.addFormRevisionAttachment=Tl,i.addFormRevisionAttachments=Ol,i.addFormRevisions=ni,i.addFormSubmission=Po,i.addFormSubmissionAttachment=ro,i.addFormSubmissionAttachments=ui,i.addFormSubmissions=lt,i.addForms=Yl,i.addGeoImage=$o,i.addGeoImages=Uo,i.addIssue=mm,i.addIssueAssignee=mh,i.addIssueAssignees=Xt,i.addIssueAssociation=th,i.addIssueAssociations=Tt,i.addIssueAttachment=Mh,i.addIssueAttachments=Ti,i.addIssueComment=em,i.addIssueCommentAttachment=Uh,i.addIssueCommentAttachments=Lh,i.addIssueComments=tm,i.addIssueType=wy,i.addIssueTypeAttachment=_m,i.addIssueTypeAttachments=Mm,i.addIssueTypeFieldValues=ep,i.addIssueTypeFieldValuesAttachment=Rp,i.addIssueTypeFieldValuesAttachments=qi,i.addIssueTypeFieldValuesMany=tp,i.addIssueTypeFields=pp,i.addIssueTypeFieldsAttachment=Um,i.addIssueTypeFieldsAttachments=Lm,i.addIssueTypeFieldsMany=yp,i.addIssueTypeIdentifier=Lp,i.addIssueTypeIdentifierValue=ty,i.addIssueTypeIdentifierValues=sy,i.addIssueTypeIdentifiers=kp,i.addIssueTypePriorities=fy,i.addIssueTypePriority=yy,i.addIssueTypeStatus=Ny,i.addIssueTypeStatuses=Gy,i.addIssueTypes=vy,i.addIssueUpdate=nf,i.addIssueUpdates=Ji,i.addIssues=Ri,i.addOrganization=Gf,i.addOrganizationAccess=Mf,i.addOrganizationAccesses=Rf,i.addOrganizations=Nf,i.addProcedure=CA,i.addProcedureFieldValues=sF,i.addProcedureFieldValuesAttachment=NP,i.addProcedureFieldValuesAttachments=Zn,i.addProcedureFieldValuesMany=iF,i.addProcedureInitiative=bA,i.addProcedureInitiatives=gA,i.addProcedureStep=GO,i.addProcedureStepAssignee=eI,i.addProcedureStepAssignees=tI,i.addProcedureStepComment=pI,i.addProcedureStepComments=yI,i.addProcedureStepDefaultAssignee=RI,i.addProcedureStepDefaultAssignees=wI,i.addProcedureStepDefaultReviewer=kI,i.addProcedureStepDefaultReviewers=NI,i.addProcedureStepEvent=sT,i.addProcedureStepEvents=iT,i.addProcedureStepFieldValues=tO,i.addProcedureStepFieldValuesAttachment=kT,i.addProcedureStepFieldValuesAttachments=Bn,i.addProcedureStepFieldValuesMany=sO,i.addProcedureStepFieldValuesReview=yO,i.addProcedureStepFieldValuesReviews=qn,i.addProcedureStepFields=wT,i.addProcedureStepFieldsAttachment=fT,i.addProcedureStepFieldsAttachments=_n,i.addProcedureStepFieldsMany=vT,i.addProcedureStepReviewer=RO,i.addProcedureStepReviewers=wO,i.addProcedureSteps=HO,i.addProcedureType=fF,i.addProcedureTypeAttachment=tP,i.addProcedureTypeAttachments=sP,i.addProcedureTypeFields=wP,i.addProcedureTypeFieldsAttachment=yP,i.addProcedureTypeFieldsAttachments=fP,i.addProcedureTypeFieldsMany=vP,i.addProcedureTypes=SF,i.addProcedures=bt,i.addProject=mA,i.addProjectAccess=dS,i.addProjectAccesses=uS,i.addProjectAttachment=OS,i.addProjectAttachments=PS,i.addProjectComment=DS,i.addProjectComments=jS,i.addProjectFile=XS,i.addProjectFiles=QS,i.addProjects=hA,i.addTeam=HF,i.addTeamMembership=EF,i.addTeamMemberships=BF,i.addTeams=WF,i.addUser=tn,i.addUsers=Af,i.agentsReducer=Kc,i.agentsSlice=Ss,i.areArraysEqual=Db,i.assetAttachmentReducer=aa,i.assetAttachmentSlice=Is,i.assetCommentReducer=Ta,i.assetCommentSlice=Fs,i.assetReducer=Va,i.assetSlice=bs,i.assetTypeAttachmentReducer=Wa,i.assetTypeAttachmentSlice=Ms,i.assetTypeFieldValuesAttachmentReducer=Vr,i.assetTypeFieldValuesAttachmentSlice=zs,i.assetTypeFieldValuesReducer=Kr,i.assetTypeFieldValuesSlice=Cs,i.assetTypeFieldsAttachmentReducer=ar,i.assetTypeFieldsAttachmentSlice=Es,i.assetTypeFieldsReducer=Tr,i.assetTypeFieldsSlice=Vs,i.assetTypeIdentifierReducer=rd,i.assetTypeIdentifierSlice=$s,i.assetTypeIdentifierValueReducer=Od,i.assetTypeIdentifierValueSlice=Ls,i.assetTypeReducer=Dd,i.assetTypeSlice=ks,i.assetTypeStatusReducer=Zd,i.assetTypeStatusSlice=Gs,i.assetTypeStatusSortFn=qc,i.authReducer=Qd,i.authSlice=Wt,i.baseReducer=nM,i.baseReducers=ac,i.clearTokens=Ag,i.createModelAdapter=P,i.createOfflineAction=eS,i.createPayload=R,i.createSelectionAdapter=Bb,i.deleteAsset=_a,i.deleteAssetAttachment=ta,i.deleteAssetAttachments=Os,i.deleteAssetComment=pa,i.deleteAssetComments=Lt,i.deleteAssetType=vd,i.deleteAssetTypeAttachment=La,i.deleteAssetTypeAttachments=ws,i.deleteAssetTypeFieldValues=kr,i.deleteAssetTypeFieldValuesAttachment=Rr,i.deleteAssetTypeFieldValuesAttachments=js,i.deleteAssetTypeFieldValuesMany=Nr,i.deleteAssetTypeFields=yr,i.deleteAssetTypeFieldsAttachment=tr,i.deleteAssetTypeFieldsAttachments=sr,i.deleteAssetTypeFieldsMany=fr,i.deleteAssetTypeIdentifier=sd,i.deleteAssetTypeIdentifierValue=fd,i.deleteAssetTypeIdentifierValues=Sd,i.deleteAssetTypeIdentifiers=id,i.deleteAssetTypeStatus=Gd,i.deleteAssetTypeStatuses=Hd,i.deleteAssetTypes=Ed,i.deleteAssets=_s,i.deleteConversation=sg,i.deleteConversations=ig,i.deleteDocument=Ou,i.deleteDocumentAttachment=ru,i.deleteDocumentAttachments=du,i.deleteDocuments=Pu,i.deleteEmailDomain=Du,i.deleteEmailDomains=ju,i.deleteForm=xl,i.deleteFormIdentifier=Qu,i.deleteFormIdentifierValue=hl,i.deleteFormIdentifierValues=ml,i.deleteFormIdentifiers=xu,i.deleteFormRevision=$l,i.deleteFormRevisionAttachment=_l,i.deleteFormRevisionAttachments=Ml,i.deleteFormRevisions=ci,i.deleteFormSubmission=go,i.deleteFormSubmissionAttachment=mo,i.deleteFormSubmissionAttachments=li,i.deleteFormSubmissions=ot,i.deleteForms=eo,i.deleteGeoImage=No,i.deleteGeoImages=Go,i.deleteIssue=Am,i.deleteIssueAssignee=Ah,i.deleteIssueAssignees=Qt,i.deleteIssueAssociation=sh,i.deleteIssueAssociations=Ot,i.deleteIssueAttachment=Bh,i.deleteIssueAttachments=Oi,i.deleteIssueComment=am,i.deleteIssueCommentAttachment=Wh,i.deleteIssueCommentAttachments=Kh,i.deleteIssueComments=rm,i.deleteIssueType=Dy,i.deleteIssueTypeAttachment=Bm,i.deleteIssueTypeAttachments=Vm,i.deleteIssueTypeFieldValues=ap,i.deleteIssueTypeFieldValuesAttachment=Vp,i.deleteIssueTypeFieldValuesAttachments=Ci,i.deleteIssueTypeFieldValuesMany=rp,i.deleteIssueTypeFields=Tp,i.deleteIssueTypeFieldsAttachment=Wm,i.deleteIssueTypeFieldsAttachments=Km,i.deleteIssueTypeFieldsMany=Op,i.deleteIssueTypeIdentifier=Kp,i.deleteIssueTypeIdentifierValue=ry,i.deleteIssueTypeIdentifierValues=dy,i.deleteIssueTypeIdentifiers=Yp,i.deleteIssueTypePriorities=Py,i.deleteIssueTypePriority=Oy,i.deleteIssueTypeStatus=Zy,i.deleteIssueTypeStatuses=Jy,i.deleteIssueTypes=jy,i.deleteIssueUpdate=uf,i.deleteIssueUpdates=Xi,i.deleteIssues=wi,i.deleteOrganization=Kf,i.deleteOrganizationAccess=Vf,i.deleteOrganizationAccesses=zf,i.deleteOrganizations=Yf,i.deleteProcedure=NA,i.deleteProcedureFieldValues=dF,i.deleteProcedureFieldValuesAttachment=YP,i.deleteProcedureFieldValuesAttachments=Jn,i.deleteProcedureFieldValuesMany=uF,i.deleteProcedureInitiative=vA,i.deleteProcedureInitiatives=EA,i.deleteProcedureStep=YO,i.deleteProcedureStepAssignee=aI,i.deleteProcedureStepAssignees=rI,i.deleteProcedureStepComment=TI,i.deleteProcedureStepComments=OI,i.deleteProcedureStepDefaultAssignee=zI,i.deleteProcedureStepDefaultAssignees=DI,i.deleteProcedureStepDefaultReviewer=YI,i.deleteProcedureStepDefaultReviewers=ZI,i.deleteProcedureStepEvent=dT,i.deleteProcedureStepEvents=uT,i.deleteProcedureStepFieldValues=rO,i.deleteProcedureStepFieldValuesAttachment=KT,i.deleteProcedureStepFieldValuesAttachments=Vn,i.deleteProcedureStepFieldValuesMany=dO,i.deleteProcedureStepFieldValuesReview=TO,i.deleteProcedureStepFieldValuesReviews=Cn,i.deleteProcedureStepFields=DT,i.deleteProcedureStepFieldsAttachment=OT,i.deleteProcedureStepFieldsAttachments=Mn,i.deleteProcedureStepFieldsMany=jT,i.deleteProcedureStepReviewer=zO,i.deleteProcedureStepReviewers=DO,i.deleteProcedureSteps=ZO,i.deleteProcedureType=PF,i.deleteProcedureTypeAttachment=rP,i.deleteProcedureTypeAttachments=dP,i.deleteProcedureTypeFields=DP,i.deleteProcedureTypeFieldsAttachment=OP,i.deleteProcedureTypeFieldsAttachments=PP,i.deleteProcedureTypeFieldsMany=jP,i.deleteProcedureTypes=FF,i.deleteProcedures=gt,i.deleteProject=fA,i.deleteProjectAccess=pS,i.deleteProjectAccesses=yS,i.deleteProjectAttachment=MS,i.deleteProjectAttachments=RS,i.deleteProjectComment=LS,i.deleteProjectComments=kS,i.deleteProjectFile=tA,i.deleteProjectFiles=sA,i.deleteProjects=SA,i.deleteTeam=XF,i.deleteTeamMembership=qF,i.deleteTeamMemberships=CF,i.deleteTeams=QF,i.deleteUser=sn,i.deleteUsers=Of,i.dequeue=db,i.discard=lb,i.documentAttachmentReducer=hu,i.documentAttachmentSlice=Ws,i.documentSlice=Ys,i.documentsReducer=Fu,i.emailDomainsReducer=Uu,i.emailDomainsSlice=Js,i.emailRegex=Jb,i.enqueue=rb,i.enqueueRequest=sS,i.extractResponseFromError=hb,i.fallbackToEmptyArray=f,i.fallbackToEmptyObject=ps,i.fetchBlobFromObjectUrl=wc,i.fetchFileFromObjectUrl=vc,i.fileReducer=Nu,i.fileSlice=Qs,i.formIdentifierReducer=il,i.formIdentifierSlice=xs,i.formIdentifierValueReducer=Sl,i.formIdentifierValueSlice=ti,i.formReducer=to,i.formRevisionAttachmentReducer=El,i.formRevisionAttachmentSlice=si,i.formRevisionReducer=Gl,i.formRevisionsSlice=ii,i.formSlice=ai,i.formSubmissionAttachmentReducer=So,i.formSubmissionAttachmentSlice=di,i.formSubmissionReducer=zo,i.formSubmissionSlice=pi,i.geoImageReducer=Yo,i.geoImageSlice=yi,i.getClientSDK=Sb,i.getClientStore=Rt,i.getDocumentSubTree=Lc,i.getDocumentTrees=Xb,i.getFileExtension=Rc,i.getLocalDateString=Mc,i.getLocalRelativeDateString=$b,i.getOutboxCoordinator=ft,i.getPresignedUrlExpiryDate=zc,i.getRenamedFile=kb,i.getRequestDescription=A,i.getS3FileKey=Lb,i.hashFile=Ct,i.initSDK=CR,i.initializeAssetAttachments=Zc,i.initializeAssetComments=da,i.initializeAssetTypeAttachments=Da,i.initializeAssetTypeFieldValues=Dr,i.initializeAssetTypeFieldValuesAttachments=Pr,i.initializeAssetTypeFields=dr,i.initializeAssetTypeFieldsAttachments=Ya,i.initializeAssetTypeIdentifierValues=ud,i.initializeAssetTypeIdentifiers=Zr,i.initializeAssetTypeStatuses=qd,i.initializeAssetTypes=Fd,i.initializeAssets=Pa,i.initializeConversations=Nc,i.initializeDocumentAttachments=eu,i.initializeDocuments=pu,i.initializeEmailDomains=Ru,i.initializeFormIdentifierValues=cl,i.initializeFormIdentifiers=Hu,i.initializeFormRevisionAttachments=Il,i.initializeFormRevisions=Vl,i.initializeFormSubmissionAttachments=ao,i.initializeFormSubmissions=Io,i.initializeForms=Wl,i.initializeGeoImages=jo,i.initializeIssueAssignees=hh,i.initializeIssueAssociations=Jo,i.initializeIssueAttachments=_h,i.initializeIssueCommentAttachments=$h,i.initializeIssueComments=xh,i.initializeIssueTypeAttachments=gm,i.initializeIssueTypeFieldValues=xm,i.initializeIssueTypeFieldValuesAttachments=Mp,i.initializeIssueTypeFields=mp,i.initializeIssueTypeFieldsAttachments=$m,i.initializeIssueTypeIdentifierValues=ey,i.initializeIssueTypeIdentifiers=Up,i.initializeIssueTypePriorities=py,i.initializeIssueTypeStatuses=ky,i.initializeIssueTypes=Ry,i.initializeIssueUpdates=sf,i.initializeIssues=hm,i.initializeOrganizationAccesses=_f,i.initializeOrganizations=Uf,i.initializeProcedureFieldValues=tF,i.initializeProcedureFieldValuesAttachments=kP,i.initializeProcedureInitiatives=FA,i.initializeProcedureStepAssignees=xA,i.initializeProcedureStepComments=mI,i.initializeProcedureStepDefaultAssignees=MI,i.initializeProcedureStepDefaultReviewers=LI,i.initializeProcedureStepEvents=tT,i.initializeProcedureStepFieldValues=eO,i.initializeProcedureStepFieldValuesAttachments=LT,i.initializeProcedureStepFieldValuesReviews=pO,i.initializeProcedureStepFields=RT,i.initializeProcedureStepFieldsAttachments=yT,i.initializeProcedureStepReviewers=MO,i.initializeProcedureSteps=LO,i.initializeProcedureTypeAttachments=eP,i.initializeProcedureTypeFields=RP,i.initializeProcedureTypeFieldsAttachments=pP,i.initializeProcedureTypes=yF,i.initializeProcedures=qA,i.initializeProjectAccesses=rS,i.initializeProjectAttachments=TS,i.initializeProjectComments=zS,i.initializeProjectFiles=YS,i.initializeProjects=uA,i.initializeTeamMemberships=vF,i.initializeTeams=GF,i.initializeUsers=yf,i.isCloudfrontUrl=Bc,i.isImageFile=Nb,i.isObjectUrl=Ec,i.isPresignedUrlExpired=Dc,i.isS3Url=Vc,i.isToday=Cb,i.issueAssigneeReducer=bh,i.issueAssigneeSlice=Ai,i.issueAssociationReducer=lh,i.issueAssociationSlice=Si,i.issueAttachmentReducer=qh,i.issueAttachmentSlice=Ii,i.issueCommentAttachmentReducer=Xh,i.issueCommentAttachmentSlice=Fi,i.issueCommentReducer=lm,i.issueCommentSlice=gi,i.issueReducer=Fm,i.issueSlice=Mi,i.issueTypeAttachmentReducer=qm,i.issueTypeAttachmentSlice=vi,i.issueTypeFieldValuesAttachmentReducer=Cp,i.issueTypeFieldValuesAttachmentSlice=ji,i.issueTypeFieldValuesReducer=op,i.issueTypeFieldValuesSlice=zi,i.issueTypeFieldsAttachmentReducer=Xm,i.issueTypeFieldsAttachmentSlice=Bi,i.issueTypeFieldsReducer=gp,i.issueTypeFieldsSlice=Di,i.issueTypeIdentifierReducer=Qp,i.issueTypeIdentifierSlice=Ui,i.issueTypeIdentifierValueReducer=hy,i.issueTypeIdentifierValueSlice=ki,i.issueTypePriorityReducer=_y,i.issueTypePrioritySlice=Ni,i.issueTypePrioritySortFn=$c,i.issueTypeReducer=Uy,i.issueTypeSlice=Hi,i.issueTypeStatusReducer=ef,i.issueTypeStatusSlice=Ki,i.issueTypeStatusSortFn=Cc,i.issueUpdateReducer=mf,i.issueUpdateSlice=Zi,i.logOnlyOnce=Gb,i.markAsDeleted=iS,i.markForDeletion=d_,i.memoize=ms,i.organizationAccessReducer=Df,i.organizationAccessSlice=an,i.organizationReducer=xf,i.organizationSlice=rn,i.outboxReducer=cS,i.outboxSlice=dn,i.overmapEnhancer=uM,i.overmapReducer=cM,i.overmapReducers=ib,i.performRequest=lc,i.performRequestFromAction=ub,i.procedureFieldValuesAttachmentReducer=ZP,i.procedureFieldValuesAttachmentSlice=Yn,i.procedureFieldValuesReducer=lF,i.procedureFieldValuesSlice=Qn,i.procedureInitiativeReducer=BA,i.procedureInitiativeSlice=fn,i.procedureReducer=GA,i.procedureSlice=Sn,i.procedureStepAssigneeReducer=oI,i.procedureStepAssigneeSlice=An,i.procedureStepCommentReducer=gI,i.procedureStepCommentSlice=In,i.procedureStepDefaultAssigneeReducer=$I,i.procedureStepDefaultAssigneeSlice=Tn,i.procedureStepDefaultReviewerReducer=xI,i.procedureStepDefaultReviewerSlice=Pn,i.procedureStepEventReducer=mT,i.procedureStepEventSlice=bn,i.procedureStepFieldValuesAttachmentReducer=QT,i.procedureStepFieldValuesAttachmentSlice=En,i.procedureStepFieldValuesReducer=uO,i.procedureStepFieldValuesReviewReducer=gO,i.procedureStepFieldValuesReviewSlice=jn,i.procedureStepFieldValuesSlice=Dn,i.procedureStepFieldsAttachmentReducer=_T,i.procedureStepFieldsAttachmentSlice=gn,i.procedureStepFieldsReducer=$T,i.procedureStepFieldsSlice=wn,i.procedureStepReducer=JO,i.procedureStepReviewerReducer=$O,i.procedureStepReviewerSlice=$n,i.procedureStepSlice=Un,i.procedureTypeAttachmentReducer=uP,i.procedureTypeAttachmentSlice=Nn,i.procedureTypeFieldsAttachmentReducer=FP,i.procedureTypeFieldsAttachmentSlice=Hn,i.procedureTypeFieldsReducer=qP,i.procedureTypeFieldsSlice=Kn,i.procedureTypeReducer=bF,i.procedureTypeSlice=ec,i.projectAccessReducer=fS,i.projectAccessSlice=un,i.projectAttachmentReducer=BS,i.projectAttachmentSlice=on,i.projectCommentReducer=WS,i.projectCommentSlice=mn,i.projectFileReducer=rA,i.projectFileSlice=pn,i.projectReducer=AA,i.projectSlice=yn,i.rehydratedReducer=RF,i.rehydratedSlice=sc,i.restructureSelectorWithArgs=y,i.runMiddleware=Ob,i.selectAccessToken=Ig,i.selectAccessesByUserOfProject=l_,i.selectAccessibleProjects=y_,i.selectActiveOrganizationAccess=n_,i.selectAllDocumentAttachments=Ks,i.selectAssetAttachmentById=ia,i.selectAssetAttachmentMapping=sa,i.selectAssetAttachments=Ps,i.selectAssetAttachmentsByIds=na,i.selectAssetById=Ea,i.selectAssetCommentById=fa,i.selectAssetCommentMapping=ya,i.selectAssetComments=kt,i.selectAssetCommentsByIds=Sa,i.selectAssetTypeAttachmentById=Na,i.selectAssetTypeAttachmentMapping=ka,i.selectAssetTypeAttachments=vs,i.selectAssetTypeAttachmentsByIds=Ga,i.selectAssetTypeById=Vd,i.selectAssetTypeFieldValues=Gt,i.selectAssetTypeFieldValuesAttachmentById=vr,i.selectAssetTypeFieldValuesAttachments=qs,i.selectAssetTypeFieldValuesAttachmentsByIds=Er,i.selectAssetTypeFieldValuesAttachmentsMapping=wr,i.selectAssetTypeFieldValuesById=Hr,i.selectAssetTypeFieldValuesByIds=Wr,i.selectAssetTypeFieldValuesMapping=Gr,i.selectAssetTypeFieldValuesOfAsset=lg,i.selectAssetTypeFields=vt,i.selectAssetTypeFieldsAttachmentById=nr,i.selectAssetTypeFieldsAttachments=Bs,i.selectAssetTypeFieldsAttachmentsByIds=cr,i.selectAssetTypeFieldsAttachmentsMapping=ir,i.selectAssetTypeFieldsById=Ar,i.selectAssetTypeFieldsByIds=Ir,i.selectAssetTypeFieldsMapping=Sr,i.selectAssetTypeFieldsOfAssetType=dg,i.selectAssetTypeIdentifierById=cd,i.selectAssetTypeIdentifierMapping=nd,i.selectAssetTypeIdentifierValueById=Id,i.selectAssetTypeIdentifierValueMapping=Ad,i.selectAssetTypeIdentifierValues=Ht,i.selectAssetTypeIdentifierValuesByIds=Td,i.selectAssetTypeIdentifierValuesOfAsset=mg,i.selectAssetTypeIdentifierValuesOfIdentifier=pg,i.selectAssetTypeIdentifiers=Us,i.selectAssetTypeIdentifiersByIds=ad,i.selectAssetTypeIdentifiersOfAssetType=hg,i.selectAssetTypeStatusById=Kd,i.selectAssetTypeStatusMapping=Wd,i.selectAssetTypeStatuses=Hs,i.selectAssetTypeStatusesByIds=Yd,i.selectAssetTypeStatusesOfAssetType=fg,i.selectAssetTypeValuesOfAssetType=og,i.selectAssetTypes=Ns,i.selectAssetTypesByIds=zd,i.selectAssetTypesMapping=Bd,i.selectAssetTypesOfOrganization=yg,i.selectAssets=Nt,i.selectAssetsByIds=Ba,i.selectAssetsMapping=wa,i.selectAssetsOfAssetType=va,i.selectAssetsOfProject=ag,i.selectAttachmentsOfAsset=ca,i.selectAttachmentsOfAssetType=Ha,i.selectAttachmentsOfAssetTypeFieldValues=Br,i.selectAttachmentsOfAssetTypeFields=rg,i.selectAttachmentsOfDocument=Og,i.selectAttachmentsOfFormRevision=Eg,i.selectAttachmentsOfFormSubmission=fo,i.selectAttachmentsOfIssue=zh,i.selectAttachmentsOfIssueComment=Lg,i.selectAttachmentsOfIssueType=Gg,i.selectAttachmentsOfIssueTypeFieldValues=qp,i.selectAttachmentsOfIssueTypeFields=Hg,i.selectAttachmentsOfProcedureFieldValues=xP,i.selectAttachmentsOfProcedureStepFieldValues=XT,i.selectAttachmentsOfProcedureStepFields=FT,i.selectAttachmentsOfProcedureType=W_,i.selectAttachmentsOfProcedureTypeFields=K_,i.selectAttachmentsOfProject=h_,i.selectCommentsOfAsset=Aa,i.selectCommentsOfAssets=Ia,i.selectCommentsOfIssue=kg,i.selectCommentsOfProject=m_,i.selectCommentsOfProjects=p_,i.selectConversation=cg,i.selectConversationMapping=As,i.selectConversations=ng,i.selectCurrentUser=Ff,i.selectDeletedRequests=a_,i.selectDescendantsOfDocument=_u,i.selectDocumentAttachmentById=lu,i.selectDocumentAttachmentMapping=uu,i.selectDocumentAttachmentsByIds=ou,i.selectDocumentById=bu,i.selectDocuments=Kt,i.selectDocumentsByIds=gu,i.selectDocumentsMapping=Zs,i.selectEmailDomainById=Cu,i.selectEmailDomains=Xs,i.selectEmailDomainsAsMapping=qu,i.selectEmailDomainsByIds=$u,i.selectEmailDomainsOfOrganization=bg,i.selectFieldValuesOfProcedure=J_,i.selectFormById=io,i.selectFormIdentifierById=tl,i.selectFormIdentifierMapping=el,i.selectFormIdentifierValueById=yl,i.selectFormIdentifierValueMapping=pl,i.selectFormIdentifierValues=Yt,i.selectFormIdentifierValuesByIds=fl,i.selectFormIdentifierValuesOfFormSubmission=wg,i.selectFormIdentifierValuesOfIdentifier=vg,i.selectFormIdentifiers=ei,i.selectFormIdentifiersByIds=sl,i.selectFormIdentifiersOfForm=Rg,i.selectFormMapping=so,i.selectFormRevisionAttachmentById=wl,i.selectFormRevisionAttachments=Rl,i.selectFormRevisionAttachmentsByIds=vl,i.selectFormRevisionAttachmentsMapping=Zt,i.selectFormRevisionById=Ll,i.selectFormRevisionMapping=Ul,i.selectFormRevisions=Jt,i.selectFormRevisionsByIds=kl,i.selectFormRevisionsOfForm=Nl,i.selectFormSubmissionAttachemntsByIds=mi,i.selectFormSubmissionAttachmentById=po,i.selectFormSubmissionAttachments=hi,i.selectFormSubmissionAttachmentsByIds=yo,i.selectFormSubmissionAttachmentsMapping=oi,i.selectFormSubmissionById=Mo,i.selectFormSubmissions=L,i.selectFormSubmissionsByIds=Ro,i.selectFormSubmissionsMapping=_o,i.selectFormSubmissionsOfAsset=Bo,i.selectFormSubmissionsOfAssets=Vo,i.selectFormSubmissionsOfForm=wo,i.selectFormSubmissionsOfIssue=vo,i.selectFormSubmissionsOfIssues=Eo,i.selectFormSubmissionsOfOrganization=zg,i.selectFormSubmissionsOfOrganizationAndForm=qg,i.selectFormSubmissionsOfProject=Dg,i.selectFormSubmissionsOfProjectAndForm=jg,i.selectForms=ri,i.selectFormsByIds=no,i.selectFormsOfOrganization=Vg,i.selectGeoImageById=Wo,i.selectGeoImageMapping=Ho,i.selectGeoImages=fi,i.selectGeoImagesByIds=Ko,i.selectGeoImagesOfProject=Cg,i.selectIsLoggedIn=Tg,i.selectIssueAssigneeById=Th,i.selectIssueAssignees=Ft,i.selectIssueAssigneesByIds=Oh,i.selectIssueAssigneesMapping=Ih,i.selectIssueAssigneesOfIssue=Ph,i.selectIssueAssigneesOfIssues=Fh,i.selectIssueAssigneesOfUser=$g,i.selectIssueAssigneesOfUsers=Ug,i.selectIssueAssociationById=nh,i.selectIssueAssociationMapping=ih,i.selectIssueAssociations=Pt,i.selectIssueAssociationsByIds=ch,i.selectIssueAssociationsOfAsset=dh,i.selectIssueAssociationsOfAssets=uh,i.selectIssueAssociationsOfIssue=rh,i.selectIssueAssociationsOfIssues=ah,i.selectIssueAttachmentById=Dh,i.selectIssueAttachmentMapping=Vh,i.selectIssueAttachments=Pi,i.selectIssueAttachmentsByIds=jh,i.selectIssueById=Tm,i.selectIssueCommentAttachmentById=Zh,i.selectIssueCommentAttachmentMapping=Yh,i.selectIssueCommentAttachments=bi,i.selectIssueCommentAttachmentsByIds=Jh,i.selectIssueCommentById=dm,i.selectIssueCommentMapping=_i,i.selectIssueCommentsByIds=um,i.selectIssueMapping=Im,i.selectIssueTypeAttachmentById=Dm,i.selectIssueTypeAttachmentMapping=zm,i.selectIssueTypeAttachments=Ei,i.selectIssueTypeAttachmentsByIds=jm,i.selectIssueTypeById=Cy,i.selectIssueTypeFieldValues=es,i.selectIssueTypeFieldValuesAttachmentById=Dp,i.selectIssueTypeFieldValuesAttachments=$i,i.selectIssueTypeFieldValuesAttachmentsByIds=jp,i.selectIssueTypeFieldValuesAttachmentsMapping=zp,i.selectIssueTypeFieldValuesById=up,i.selectIssueTypeFieldValuesByIds=lp,i.selectIssueTypeFieldValuesMapping=dp,i.selectIssueTypeFieldValuesOfIssue=Wg,i.selectIssueTypeFields=Et,i.selectIssueTypeFieldsAttachmentById=Zm,i.selectIssueTypeFieldsAttachments=Vi,i.selectIssueTypeFieldsAttachmentsByIds=Jm,i.selectIssueTypeFieldsAttachmentsMapping=Ym,i.selectIssueTypeFieldsById=Fp,i.selectIssueTypeFieldsByIds=bp,i.selectIssueTypeFieldsMapping=Pp,i.selectIssueTypeFieldsOfIssueType=Kg,i.selectIssueTypeIdentifierById=Jp,i.selectIssueTypeIdentifierMapping=Zp,i.selectIssueTypeIdentifierValueById=ly,i.selectIssueTypeIdentifierValueMapping=uy,i.selectIssueTypeIdentifierValues=ts,i.selectIssueTypeIdentifierValuesByIds=oy,i.selectIssueTypeIdentifierValuesOfIdentifier=Qg,i.selectIssueTypeIdentifierValuesOfIssue=Xg,i.selectIssueTypeIdentifiers=Li,i.selectIssueTypeIdentifiersByIds=Xp,i.selectIssueTypeIdentifiersOfIssueType=Jg,i.selectIssueTypeMapping=qy,i.selectIssueTypePriorities=Gi,i.selectIssueTypePrioritiesByIds=gy,i.selectIssueTypePrioritiesOfIssueType=xg,i.selectIssueTypePriorityById=by,i.selectIssueTypePriorityMapping=Fy,i.selectIssueTypeStatusById=Qy,i.selectIssueTypeStatusMapping=Xy,i.selectIssueTypeStatuses=Yi,i.selectIssueTypeStatusesByIds=xy,i.selectIssueTypeStatusesOfIssueType=t_,i.selectIssueTypeValuesOfIssueType=Zg,i.selectIssueTypes=Wi,i.selectIssueTypesByIds=$y,i.selectIssueTypesOfOrganization=e_,i.selectIssueUpdateById=lf,i.selectIssueUpdateMapping=Qi,i.selectIssueUpdates=xi,i.selectIssueUpdatesByIds=of,i.selectIssueUpdatesOfIssue=hf,i.selectIssues=xt,i.selectIssuesByIds=Om,i.selectIssuesOfIssueType=Pm,i.selectIssuesOfProject=Ng,i.selectLatestAssetTypeFieldsOfAssetType=ug,i.selectLatestFieldsByProcedureStep=V_,i.selectLatestFormRevisionOfForm=Bg,i.selectLatestIssueTypeFieldsOfIssueType=Yg,i.selectLatestProcedureStepFieldValuesReviewByProcedureStepFieldValues=U_,i.selectLatestProcedureStepFieldsOfProcedureStep=B_,i.selectLatestProcedureTypeFieldsOfProcedureType=Z_,i.selectLatestRetryTime=r_,i.selectLatestReviewOfProcedureStepFieldValues=q_,i.selectMembershipsByUserOfTeam=tM,i.selectOrganizationAccessById=jf,i.selectOrganizationAccessMapping=is,i.selectOrganizationAccessUserMapping=Cf,i.selectOrganizationAccessesByIds=qf,i.selectOrganizationById=Xf,i.selectOrganizationDocuments=Fg,i.selectOrganizations=Jf,i.selectOrganizationsByIds=Qf,i.selectOrganizationsMapping=Zf,i.selectProcedureById=WA,i.selectProcedureFieldValues=xn,i.selectProcedureFieldValuesAttachmentById=XP,i.selectProcedureFieldValuesAttachments=Xn,i.selectProcedureFieldValuesAttachmentsByIds=QP,i.selectProcedureFieldValuesAttachmentsMapping=JP,i.selectProcedureFieldValuesById=hF,i.selectProcedureFieldValuesByIds=mF,i.selectProcedureFieldValuesMapping=oF,i.selectProcedureInitiativeById=zA,i.selectProcedureInitiatives=as,i.selectProcedureInitiativesByIds=DA,i.selectProcedureInitiativesMapping=VA,i.selectProcedureInitiativesOfProcedureType=A_,i.selectProcedureInitiativesOfProject=S_,i.selectProcedureStepAssigneeById=uI,i.selectProcedureStepAssignees=Vt,i.selectProcedureStepAssigneesByIds=lI,i.selectProcedureStepAssigneesMapping=dI,i.selectProcedureStepAssigneesOfProcedure=T_,i.selectProcedureStepAssigneesOfProcedureAndProcedureStep=P_,i.selectProcedureStepAssigneesOfProcedureStep=O_,i.selectProcedureStepById=XO,i.selectProcedureStepCommentById=FI,i.selectProcedureStepComments=zt,i.selectProcedureStepCommentsByIds=bI,i.selectProcedureStepCommentsMapping=PI,i.selectProcedureStepCommentsOfProcedure=F_,i.selectProcedureStepCommentsOfProcedureAndProcedureStep=g_,i.selectProcedureStepCommentsOfProcedureStep=b_,i.selectProcedureStepDefaultAssigneeById=qI,i.selectProcedureStepDefaultAssignees=On,i.selectProcedureStepDefaultAssigneesByIds=CI,i.selectProcedureStepDefaultAssigneesMapping=jI,i.selectProcedureStepDefaultAssigneesOfProcedureStep=__,i.selectProcedureStepDefaultReviewerById=XI,i.selectProcedureStepDefaultReviewers=Fn,i.selectProcedureStepDefaultReviewersByIds=QI,i.selectProcedureStepDefaultReviewersMapping=JI,i.selectProcedureStepDefaultReviewersOfProcedureStep=M_,i.selectProcedureStepEventById=oT,i.selectProcedureStepEvents=Dt,i.selectProcedureStepEventsByIds=hT,i.selectProcedureStepEventsMapping=lT,i.selectProcedureStepEventsOfProcedure=R_,i.selectProcedureStepEventsOfProcedureAndProcedureStep=v_,i.selectProcedureStepEventsOfProcedureStep=w_,i.selectProcedureStepFieldValues=mt,i.selectProcedureStepFieldValuesAttachmentById=ZT,i.selectProcedureStepFieldValuesAttachments=zn,i.selectProcedureStepFieldValuesAttachmentsByIds=JT,i.selectProcedureStepFieldValuesAttachmentsMapping=YT,i.selectProcedureStepFieldValuesById=oO,i.selectProcedureStepFieldValuesByIds=hO,i.selectProcedureStepFieldValuesMapping=lO,i.selectProcedureStepFieldValuesOfProcedure=z_,i.selectProcedureStepFieldValuesOfProcedureAndProcedureStep=j_,i.selectProcedureStepFieldValuesOfProcedureStep=D_,i.selectProcedureStepFieldValuesReviewById=PO,i.selectProcedureStepFieldValuesReviews=pt,i.selectProcedureStepFieldValuesReviewsByIds=FO,i.selectProcedureStepFieldValuesReviewsMapping=OO,i.selectProcedureStepFieldValuesReviewsOfProcedure=C_,i.selectProcedureStepFieldValuesReviewsOfProcedureAndProcedureStep=$_,i.selectProcedureStepFields=rs,i.selectProcedureStepFieldsAttachmentById=bT,i.selectProcedureStepFieldsAttachments=Rn,i.selectProcedureStepFieldsAttachmentsByIds=gT,i.selectProcedureStepFieldsAttachmentsMapping=PT,i.selectProcedureStepFieldsById=qT,i.selectProcedureStepFieldsByIds=CT,i.selectProcedureStepFieldsMapping=vn,i.selectProcedureStepFieldsOfProcedureStep=E_,i.selectProcedureStepReviewerById=qO,i.selectProcedureStepReviewers=jt,i.selectProcedureStepReviewersByIds=CO,i.selectProcedureStepReviewersMapping=jO,i.selectProcedureStepReviewersOfProcedure=L_,i.selectProcedureStepReviewersOfProcedureAndProcedureStep=N_,i.selectProcedureStepReviewersOfProcedureStep=k_,i.selectProcedureSteps=kn,i.selectProcedureStepsByIds=QO,i.selectProcedureStepsMapping=Ln,i.selectProcedureStepsMappingOfProcedureType=G_,i.selectProcedureStepsOfProcedureType=H_,i.selectProcedureTypeAttachmentById=oP,i.selectProcedureTypeAttachmentMapping=lP,i.selectProcedureTypeAttachments=Gn,i.selectProcedureTypeAttachmentsByIds=hP,i.selectProcedureTypeById=_F,i.selectProcedureTypeFields=ds,i.selectProcedureTypeFieldsAttachmentById=gP,i.selectProcedureTypeFieldsAttachments=Wn,i.selectProcedureTypeFieldsAttachmentsByIds=_P,i.selectProcedureTypeFieldsAttachmentsMapping=bP,i.selectProcedureTypeFieldsById=$P,i.selectProcedureTypeFieldsByIds=UP,i.selectProcedureTypeFieldsMapping=CP,i.selectProcedureTypeFieldsOfProcedureType=Y_,i.selectProcedureTypes=tc,i.selectProcedureTypesByIds=MF,i.selectProcedureTypesMapping=gF,i.selectProcedureTypesOfOrganization=X_,i.selectProcedures=ht,i.selectProceduresByIds=KA,i.selectProceduresMapping=HA,i.selectProceduresOfAsset=ZA,i.selectProceduresOfAssets=JA,i.selectProceduresOfProcedureInitiative=XA,i.selectProceduresOfProcedureType=YA,i.selectProceduresOfProject=I_,i.selectProjectAccessById=SS,i.selectProjectAccessMapping=ln,i.selectProjectAccesses=Bt,i.selectProjectAccessesByIds=AS,i.selectProjectAccessesOfProject=u_,i.selectProjectAttachmentById=vS,i.selectProjectAttachmentMapping=wS,i.selectProjectAttachments=hn,i.selectProjectAttachmentsByIds=ES,i.selectProjectById=TA,i.selectProjectCommentById=GS,i.selectProjectCommentMapping=NS,i.selectProjectComments=ns,i.selectProjectCommentsByIds=HS,i.selectProjectDocuments=Pg,i.selectProjectFileById=cA,i.selectProjectFileMapping=iA,i.selectProjectFiles=nA,i.selectProjectFilesByIds=aA,i.selectProjectMapping=IA,i.selectProjects=cs,i.selectProjectsByIds=OA,i.selectProjectsOfOrganization=f_,i.selectRehydrated=eM,i.selectReviewsOfProcedureStepFieldValues=bO,i.selectTeamById=eb,i.selectTeamMembershipById=LF,i.selectTeamMemberships=us,i.selectTeamMembershipsByIds=kF,i.selectTeamMembershipsMapping=UF,i.selectTeams=cc,i.selectTeamsByIds=tb,i.selectTeamsMapping=xF,i.selectTeamsOfOrganization=iM,i.selectUploadUrl=Mg,i.selectUserById=cn,i.selectUsers=ss,i.selectUsersByIds=bf,i.selectUsersMapping=nn,i.selectUsersOfOrganization=c_,i.selectUsersOfProject=o_,i.selectUsersOfTeam=sM,i.setAsset=Ma,i.setAssetAttachment=Xc,i.setAssetAttachments=Qc,i.setAssetComment=la,i.setAssetComments=oa,i.setAssetType=bd,i.setAssetTypeAttachment=qa,i.setAssetTypeAttachments=Ca,i.setAssetTypeFieldValues=Cr,i.setAssetTypeFieldValuesAttachment=br,i.setAssetTypeFieldValuesAttachments=gr,i.setAssetTypeFieldValuesMany=$r,i.setAssetTypeFields=or,i.setAssetTypeFieldsAttachment=Xa,i.setAssetTypeFieldsAttachments=Qa,i.setAssetTypeFieldsMany=hr,i.setAssetTypeIdentifier=Qr,i.setAssetTypeIdentifierValue=hd,i.setAssetTypeIdentifierValues=md,i.setAssetTypeIdentifiers=xr,i.setAssetTypeStatus=Ud,i.setAssetTypeStatuses=Ld,i.setAssetTypes=gd,i.setAssets=Ra,i.setClientSDK=fb,i.setClientStore=pb,i.setConversation=Hc,i.setConversations=eg,i.setCurrentUser=s_,i.setCurrentUserProfile=i_,i.setDocument=Su,i.setDocumentAttachment=iu,i.setDocumentAttachments=nu,i.setDocuments=Au,i.setEmailDomain=Eu,i.setEmailDomains=Bu,i.setForm=Zl,i.setFormIdentifier=Yu,i.setFormIdentifierValue=dl,i.setFormIdentifierValues=ul,i.setFormIdentifiers=Zu,i.setFormRevision=Dl,i.setFormRevisionAttachment=Pl,i.setFormRevisionAttachments=Fl,i.setFormRevisions=jl,i.setFormSubmission=To,i.setFormSubmissionAttachment=uo,i.setFormSubmissionAttachments=lo,i.setFormSubmissions=Oo,i.setForms=Jl,i.setGeoImage=qo,i.setGeoImages=Co,i.setIssue=pm,i.setIssueAssignee=ph,i.setIssueAssignees=yh,i.setIssueAssociation=Qo,i.setIssueAssociations=Xo,i.setIssueAttachment=Rh,i.setIssueAttachments=wh,i.setIssueComment=sm,i.setIssueCommentAttachment=kh,i.setIssueCommentAttachments=Nh,i.setIssueComments=im,i.setIssueType=Ey,i.setIssueTypeAttachment=Rm,i.setIssueTypeAttachments=wm,i.setIssueTypeFieldValues=sp,i.setIssueTypeFieldValuesAttachment=wp,i.setIssueTypeFieldValuesAttachments=vp,i.setIssueTypeFieldValuesMany=ip,i.setIssueTypeFields=fp,i.setIssueTypeFieldsAttachment=km,i.setIssueTypeFieldsAttachments=Nm,i.setIssueTypeFieldsMany=Sp,i.setIssueTypeIdentifier=Np,i.setIssueTypeIdentifierValue=iy,i.setIssueTypeIdentifierValues=ny,i.setIssueTypeIdentifiers=Gp,i.setIssueTypePriorities=Ay,i.setIssueTypePriority=Sy,i.setIssueTypeStatus=Hy,i.setIssueTypeStatuses=Wy,i.setIssueTypes=By,i.setIssueUpdate=cf,i.setIssueUpdates=af,i.setIssues=ym,i.setLoggedIn=Xd,i.setOrganization=kf,i.setOrganizationAccess=wf,i.setOrganizationAccesses=vf,i.setOrganizations=Lf,i.setProcedure=$A,i.setProcedureFieldValues=nF,i.setProcedureFieldValuesAttachment=GP,i.setProcedureFieldValuesAttachments=HP,i.setProcedureFieldValuesMany=cF,i.setProcedureInitiative=_A,i.setProcedureInitiatives=MA,i.setProcedureStep=kO,i.setProcedureStepAssignee=sI,i.setProcedureStepAssignees=iI,i.setProcedureStepComment=fI,i.setProcedureStepComments=SI,i.setProcedureStepDefaultAssignee=vI,i.setProcedureStepDefaultAssignees=EI,i.setProcedureStepDefaultReviewer=GI,i.setProcedureStepDefaultReviewers=HI,i.setProcedureStepEvent=nT,i.setProcedureStepEvents=cT,i.setProcedureStepFieldValues=iO,i.setProcedureStepFieldValuesAttachment=NT,i.setProcedureStepFieldValuesAttachments=GT,i.setProcedureStepFieldValuesMany=nO,i.setProcedureStepFieldValuesReview=fO,i.setProcedureStepFieldValuesReviews=SO,i.setProcedureStepFields=ET,i.setProcedureStepFieldsAttachment=ST,i.setProcedureStepFieldsAttachments=AT,i.setProcedureStepFieldsMany=BT,i.setProcedureStepReviewer=vO,i.setProcedureStepReviewers=EO,i.setProcedureSteps=NO,i.setProcedureType=AF,i.setProcedureTypeAttachment=iP,i.setProcedureTypeAttachments=nP,i.setProcedureTypeFields=EP,i.setProcedureTypeFieldsAttachment=SP,i.setProcedureTypeFieldsAttachments=AP,i.setProcedureTypeFieldsMany=BP,i.setProcedureTypes=IF,i.setProcedures=UA,i.setProject=oA,i.setProjectAccess=lS,i.setProjectAccesses=oS,i.setProjectAttachment=FS,i.setProjectAttachments=bS,i.setProjectComment=qS,i.setProjectComments=CS,i.setProjectFile=ZS,i.setProjectFiles=JS,i.setProjects=lA,i.setRehydrated=x_,i.setTeam=KF,i.setTeamMembership=VF,i.setTeamMemberships=zF,i.setTeams=YF,i.setTokens=Sg,i.setUploadUrl=_g,i.setUser=Sf,i.setUsers=ff,i.shallowEqual=zb,i.slugify=Yb,i.spacesToDashesLower=Kb,i.submittedAtModelSortFn=It,i.teamMembershipReducer=$F,i.teamMembershipSlice=ic,i.teamReducer=sb,i.teamSlice=nc,i.toFileNameSafeString=Wb,i.toUuidArray=w,i.toUuidIdRecord=Hb,i.truncate=Zb,i.updateAsset=ba,i.updateAssetAttachment=xc,i.updateAssetAttachments=ea,i.updateAssetComment=ha,i.updateAssetComments=ma,i.updateAssetType=Rd,i.updateAssetTypeAttachment=$a,i.updateAssetTypeAttachments=Ua,i.updateAssetTypeFieldValues=Ur,i.updateAssetTypeFieldValuesAttachment=_r,i.updateAssetTypeFieldValuesAttachments=Mr,i.updateAssetTypeFieldValuesMany=Lr,i.updateAssetTypeFields=mr,i.updateAssetTypeFieldsAttachment=xa,i.updateAssetTypeFieldsAttachments=er,i.updateAssetTypeFieldsMany=pr,i.updateAssetTypeIdentifier=ed,i.updateAssetTypeIdentifierValue=pd,i.updateAssetTypeIdentifierValues=yd,i.updateAssetTypeIdentifiers=td,i.updateAssetTypeStatus=kd,i.updateAssetTypeStatuses=Nd,i.updateAssetTypes=wd,i.updateAssets=ga,i.updateConversation=Wc,i.updateConversations=tg,i.updateDocument=Iu,i.updateDocumentAttachment=cu,i.updateDocumentAttachments=au,i.updateDocuments=Tu,i.updateEmailDomain=Vu,i.updateEmailDomains=zu,i.updateForm=Xl,i.updateFormIdentifier=Ju,i.updateFormIdentifierValue=ll,i.updateFormIdentifierValues=ol,i.updateFormIdentifiers=Xu,i.updateFormRevision=ql,i.updateFormRevisionAttachment=bl,i.updateFormRevisionAttachments=gl,i.updateFormRevisions=Cl,i.updateFormSubmission=Fo,i.updateFormSubmissionAttachment=oo,i.updateFormSubmissionAttachments=ho,i.updateFormSubmissions=bo,i.updateForms=Ql,i.updateGeoImage=Lo,i.updateGeoImages=ko,i.updateIssue=fm,i.updateIssueAssignee=fh,i.updateIssueAssignees=Sh,i.updateIssueAssociation=xo,i.updateIssueAssociations=eh,i.updateIssueAttachment=vh,i.updateIssueAttachments=Eh,i.updateIssueComment=nm,i.updateIssueCommentAttachment=Gh,i.updateIssueCommentAttachments=Hh,i.updateIssueComments=cm,i.updateIssueType=Vy,i.updateIssueTypeAttachment=vm,i.updateIssueTypeAttachments=Em,i.updateIssueTypeFieldValues=np,i.updateIssueTypeFieldValuesAttachment=Ep,i.updateIssueTypeFieldValuesAttachments=Bp,i.updateIssueTypeFieldValuesMany=cp,i.updateIssueTypeFields=Ap,i.updateIssueTypeFieldsAttachment=Gm,i.updateIssueTypeFieldsAttachments=Hm,i.updateIssueTypeFieldsMany=Ip,i.updateIssueTypeIdentifier=Hp,i.updateIssueTypeIdentifierValue=cy,i.updateIssueTypeIdentifierValues=ay,i.updateIssueTypeIdentifiers=Wp,i.updateIssueTypePriorities=Ty,i.updateIssueTypePriority=Iy,i.updateIssueTypeStatus=Ky,i.updateIssueTypeStatuses=Yy,i.updateIssueTypes=zy,i.updateIssueUpdate=rf,i.updateIssueUpdates=df,i.updateIssues=Sm,i.updateOrganization=Wf,i.updateOrganizationAccess=Ef,i.updateOrganizationAccesses=Bf,i.updateOrganizations=Hf,i.updateProcedure=LA,i.updateProcedureFieldValues=aF,i.updateProcedureFieldValuesAttachment=WP,i.updateProcedureFieldValuesAttachments=KP,i.updateProcedureFieldValuesMany=rF,i.updateProcedureInitiative=RA,i.updateProcedureInitiatives=wA,i.updateProcedureStep=WO,i.updateProcedureStepAssignee=nI,i.updateProcedureStepAssignees=cI,i.updateProcedureStepComment=AI,i.updateProcedureStepComments=II,i.updateProcedureStepDefaultAssignee=BI,i.updateProcedureStepDefaultAssignees=VI,i.updateProcedureStepDefaultReviewer=WI,i.updateProcedureStepDefaultReviewers=KI,i.updateProcedureStepEvent=aT,i.updateProcedureStepEvents=rT,i.updateProcedureStepFieldValues=cO,i.updateProcedureStepFieldValuesAttachment=HT,i.updateProcedureStepFieldValuesAttachments=WT,i.updateProcedureStepFieldValuesMany=aO,i.updateProcedureStepFieldValuesReview=AO,i.updateProcedureStepFieldValuesReviews=IO,i.updateProcedureStepFields=VT,i.updateProcedureStepFieldsAttachment=IT,i.updateProcedureStepFieldsAttachments=TT,i.updateProcedureStepFieldsMany=zT,i.updateProcedureStepReviewer=BO,i.updateProcedureStepReviewers=VO,i.updateProcedureSteps=KO,i.updateProcedureType=TF,i.updateProcedureTypeAttachment=cP,i.updateProcedureTypeAttachments=aP,i.updateProcedureTypeFields=VP,i.updateProcedureTypeFieldsAttachment=IP,i.updateProcedureTypeFieldsAttachments=TP,i.updateProcedureTypeFieldsMany=zP,i.updateProcedureTypes=OF,i.updateProcedures=kA,i.updateProject=yA,i.updateProjectAccess=hS,i.updateProjectAccesses=mS,i.updateProjectAttachment=gS,i.updateProjectAttachments=_S,i.updateProjectComment=$S,i.updateProjectComments=US,i.updateProjectFile=xS,i.updateProjectFiles=eA,i.updateProjects=pA,i.updateTeam=ZF,i.updateTeamMembership=DF,i.updateTeamMemberships=jF,i.updateTeams=JF,i.updateUser=Tf,i.updateUsers=If,i.useSelectorBuilder=Vb,i.userReducer=Pf,i.userSlice=en,i.uuidObj=O,i.uuidObjSortFn=fs,i.uuidSortFn=$t,Object.defineProperty(i,Symbol.toStringTag,{value:"Module"})});
|