@overmap-ai/core 1.1.0 → 1.1.1-comment-attachment-improvements.0

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