@overmap-ai/core 1.0.78-workflows.2 → 1.0.78-workflows.3

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.
@@ -10580,9 +10580,8 @@ class rE extends E {
10580
10580
  method: u.POST,
10581
10581
  url: `${this.url}/bulk/`,
10582
10582
  payload: {
10583
- workflow_step_assignees: r.map(
10584
- (f) => q(f)
10585
- )
10583
+ // TODO: should just be payloads
10584
+ assignees: r.map((f) => q(f))
10586
10585
  },
10587
10586
  blockers: r.flatMap((f) => [
10588
10587
  f.workflow,
@@ -10593,7 +10592,9 @@ class rE extends E {
10593
10592
  return l.then((f) => {
10594
10593
  this.dispatch(a(f));
10595
10594
  }).catch(() => {
10596
- this.dispatch(c(r.map((f) => f.uuid)));
10595
+ this.dispatch(
10596
+ c(r.map((f) => f.uuid))
10597
+ );
10597
10598
  }), [r, l];
10598
10599
  }
10599
10600
  update(e) {
@@ -11375,9 +11376,8 @@ class fE extends E {
11375
11376
  method: u.POST,
11376
11377
  url: `${this.url}/bulk/`,
11377
11378
  payload: {
11378
- workflow_step_reviewers: r.map(
11379
- (f) => q(f)
11380
- )
11379
+ // TODO: should just be payloads
11380
+ reviewers: r.map((f) => q(f))
11381
11381
  },
11382
11382
  blockers: r.flatMap((f) => [
11383
11383
  f.workflow,
@@ -11388,7 +11388,9 @@ class fE extends E {
11388
11388
  return l.then((f) => {
11389
11389
  this.dispatch(a(f));
11390
11390
  }).catch(() => {
11391
- this.dispatch(c(r.map((f) => f.uuid)));
11391
+ this.dispatch(
11392
+ c(r.map((f) => f.uuid))
11393
+ );
11392
11394
  }), [r, l];
11393
11395
  }
11394
11396
  update(e) {
@@ -11,5 +11,5 @@ Action:`,s);const y=ft();if(!y)throw new Error("Outbox coordinator not set");y.r
11
11
  REST API, you will be requesting localhost:80 (where this app runs), resulting in a transformed blob
12
12
  (with an uuid attached) being returned. Alternatively, you may be running with
13
13
  import.meta.env.PROD, which will result in some file requests being treated as
14
- external URLs and therefore not prepended with VITE_API_URL.`;throw new Error(S)}const y=r.type.split("/")[1];if(!y)throw new Error("File has no extension");const f=a??h+"."+y;if(r=Tc(r,f),!r.name)throw new Error("Failed to set file's name");await this.addCache(r,h),ps[c]=new Promise(S=>{S(r)})}return r}processPresignedUrls(e){const n={};for(const[a,c]of Object.entries(e))n[a]=this.enqueueRequest({url:c.url,description:"Upload file to S3",method:p.POST,isExternalUrl:!0,isAuthNeeded:!1,attachmentHash:a,blockers:[`s3-${c.fields.key}`],blocks:[a],s3url:c});return n}async getFilePayload(e){const n=await At(e),a={sha1:n,file_type:e.type,extension:e.name.split(".").pop(),size:e.size};return await this.client.files.addCache(e,n),a}}class XM extends k{constructor(){super(...arguments);m(this,"name","Form Identifier");m(this,"url","/form-identifiers");m(this,"actions",{addOne:hm,addMany:pm,setOne:mm,setMany:ym,updateOne:fm,updateMany:Sm,deleteOne:Am,deleteMany:wm,initialize:um});m(this,"selectors",{selectById:Om,selectByIds:Im})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(r),blockers:[r.form],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,h]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=c(e.uuid)(n.getState());if(!d)throw new Error(`Expected form identifier with uuid ${e.uuid} to exist`);const o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected form identifier with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(r){throw this.dispatch(c(l)),r}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{form__organization:e}},n);return this.dispatch(a(c)),c}}class xM extends k{constructor(){super(...arguments);m(this,"name","Form Identifier Value");m(this,"url","/form-identifier-values");m(this,"actions",{addOne:bm,addMany:_m,setOne:Rm,setMany:Mm,updateOne:km,updateMany:vm,deleteOne:Em,deleteMany:Vm,initialize:gm});m(this,"selectors",{selectById:Bm,selectByIds:zm})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(r),blockers:[e.form_submission,e.form_identifier],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,h]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=c(e.uuid)(n.getState());if(!d)throw new Error(`Expected form identifier value with uuid ${e.uuid} to exist`);const o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected form identifier value with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(r){throw this.dispatch(c(l)),r}}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{form_submission__form_revision__form__organization:e}},n)).flat();return this.dispatch(a(d)),d}}class ek extends k{constructor(){super(...arguments);m(this,"name","Form Revision Attachment");m(this,"url","/form-revision-attachments");m(this,"actions",{addOne:Dm,addMany:$m,setOne:Um,setMany:Lm,updateOne:Nm,updateMany:Hm,deleteOne:Gm,deleteMany:Km,initialize:jm});m(this,"selectors",{selectById:Zm,selectByIds:Jm})}async bulkAdd(e){var f;const{addMany:n,setMany:a,deleteMany:c}=this.actions,d=new Date().toISOString(),o=((f=this.client.store.getState().userReducer.currentUser)==null?void 0:f.id)??null,l={},r=[],h=[];for(const S of e){const{revisionUuid:O,fieldIdentifier:P,file:I}=S,F=await this.client.files.getFilePayload(I);F.sha1 in l||(l[F.sha1]=F);const g=_({file:URL.createObjectURL(I),file_type:I.type,file_name:I.name,file_sha1:F.sha1,created_by:o,form_revision:O,submitted_at:d,field_identifier:P});r.push(g);const v={uuid:g.uuid,file_name:I.name,field_identifier:P,file_extension:F.extension,file_sha1:F.sha1,form_revision:O};h.push(v)}this.dispatch(n(r));const y=this.enqueueRequest({description:T(p.POST,this.name,!0),method:p.POST,url:`${this.url}/bulk/`,payload:{submitted_at:d,attachments:h,files:Object.values(l)},blockers:r.map(S=>S.form_revision),blocks:r.map(S=>S.uuid)});return y.then(S=>{this.client.files.processPresignedUrls(S.presigned_urls),this.dispatch(a(S.attachments))}).catch(()=>{this.dispatch(c(r.map(S=>S.uuid)))}),[r,y.then(({attachments:S})=>S)]}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{form_revision__form__organization:e}},n);return this.dispatch(a(c)),c}}class tk extends k{constructor(){super(...arguments);m(this,"name","Form Revision");m(this,"url","/form-revisions");m(this,"actions",{addOne:$i,addMany:Ui,setOne:ey,setMany:ty,updateOne:sy,updateMany:iy,deleteOne:Li,deleteMany:Ni,initialize:xm});m(this,"selectors",{selectById:ny,selectByIds:ay})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,r=new Date().toISOString(),h=_({...e,created_by:l,submitted_at:r});this.dispatch(a(h));const y=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(h),blockers:[e.form],blocks:[h.uuid]});return y.then(S=>{this.dispatch(c(S))}).catch(()=>{this.dispatch(d(h.uuid))}),[h,y]}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{form__organization:e}},n);return this.dispatch(a(c)),c}}class sk extends k{constructor(){super(...arguments);m(this,"name","Form");m(this,"url","/forms");m(this,"actions",{addOne:oy,addMany:uy,setOne:hy,setMany:py,updateOne:my,updateMany:yy,deleteOne:fy,deleteMany:Sy,initialize:ly});m(this,"selectors",{selectById:Ty,selectByIds:Oy})}add(e,n){var f;const{store:a}=this.client,{addOne:c,deleteOne:d}=this.actions,o=new Date().toISOString(),l=((f=a.getState().userReducer.currentUser)==null?void 0:f.id)??null,r=_({...e,submitted_at:o,created_by:l}),h=_({...n,form:r.uuid,submitted_at:o,created_by:l});this.dispatch(c(r)),this.dispatch($i(h));const y=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:{...E(r),initial_revision:{uuid:h.uuid,submitted_at:h.submitted_at,title:h.title,description:h.description,fields:h.fields}},blockers:[],blocks:[r.uuid,h.uuid]});return y.catch(S=>{throw this.dispatch(d(r.uuid)),this.dispatch(Li(h.uuid)),S}),[r,h,y]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error("Expected form to exist");const r=Hy(e)(o),h=cy(e)(o);this.dispatch(a(e)),this.dispatch(sn(B(r))),this.dispatch(Ni(B(h)));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(y){throw this.dispatch(c(l)),this.dispatch(Ui(h)),this.dispatch(tn(r)),y}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class ik extends k{constructor(){super(...arguments);m(this,"name","Form Submission Attachment");m(this,"url","/form-submission-attachments");m(this,"actions",{addOne:Py,addMany:Zi,setOne:gy,setMany:by,updateOne:_y,updateMany:Ry,deleteOne:My,deleteMany:Ji,initialize:Fy});m(this,"selectors",{selectById:ky,selectByIds:vy})}async bulkAdd(e){var f;const{addMany:n,setMany:a,deleteMany:c}=this.actions,d=new Date().toISOString(),o=((f=this.client.store.getState().userReducer.currentUser)==null?void 0:f.id)??null,l={},r=[],h=[];for(const S of e){const{submissionUuid:O,fieldIdentifier:P,file:I}=S,F=await this.client.files.getFilePayload(I);F.sha1 in l||(l[F.sha1]=F);const g=_({file:URL.createObjectURL(I),file_type:I.type,file_name:I.name,file_sha1:F.sha1,created_by:o,form_submission:O,submitted_at:d,field_identifier:P});r.push(g);const v={uuid:g.uuid,file_name:I.name,file_sha1:F.sha1,file_extension:F.extension,field_identifier:P,form_submission:O};h.push(v)}this.dispatch(n(r));const y=this.enqueueRequest({description:T(p.POST,this.name,!0),method:p.POST,url:`${this.url}/bulk/`,payload:{submitted_at:d,attachments:h,files:Object.values(l)},blockers:r.map(S=>S.form_submission),blocks:r.map(S=>S.uuid)});return y.then(S=>{this.client.files.processPresignedUrls(S.presigned_urls),this.dispatch(a(S.attachments))}).catch(S=>{throw this.dispatch(c(r.map(O=>O.uuid))),S}),[r,y.then(({attachments:S})=>S)]}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,d=n.getState(),o=xi(e)(d);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!0),method:p.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(l){throw this.dispatch(c(o)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{form_submission__form_revision__form__organization:e}},n)).flat();return this.dispatch(a(d)),d}}class nk extends k{constructor(){super(...arguments);m(this,"name","Form Submission");m(this,"url","/form-submissions");m(this,"actions",{addOne:Cy,addMany:tn,setOne:zy,setMany:qy,updateOne:jy,updateMany:Dy,deleteOne:$y,deleteMany:sn,initialize:By});m(this,"selectors",{selectById:Ly,selectByIds:Ny})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,r=new Date().toISOString(),h=_({...e,created_by:l,submitted_at:r}),y=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(h),blockers:[e.form_revision],blocks:[h.uuid]});return this.dispatch(a(h)),y.then(S=>{this.dispatch(c(S))}).catch(()=>{this.dispatch(d(h.uuid))}),[h,y]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=n.getState(),o=c(e.uuid)(d);if(!o)throw new Error(`Expected submission with uuid ${e.uuid} to exist`);const l={...o,...e};this.dispatch(a(l));const r=this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.PATCH,url:`${this.url}/${l.uuid}/`,payload:e,blockers:[l.uuid],blocks:[l.uuid]});return r.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(a(o))}),[l,r]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected submission with uuid ${e} to exist`);const r=Ey(e)(o);this.dispatch(a(e)),this.dispatch(Ji(B(r)));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(h){throw this.dispatch(c(l)),this.dispatch(Zi(r)),h}}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{limit:this.pageSize,paginate:!0,form_revision__form_organization:e}},n)).flat();return this.dispatch(a(d)),d}}class ak extends k{constructor(){super(...arguments);m(this,"name","Geo Image");m(this,"url","/geo-images");m(this,"actions",{addOne:Qy,addMany:Xy,setOne:Zy,setMany:Jy,updateOne:xy,updateMany:ef,deleteOne:tf,deleteMany:sf,initialize:Yy});m(this,"selectors",{selectById:af,selectByIds:cf})}async add(e){var P;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,{file:o,...l}=e,r=new Date().toISOString(),h=((P=n.getState().userReducer.currentUser)==null?void 0:P.id)??null,y=l.project,f=await this.client.files.getFilePayload(o),S=_({...l,file_name:o.name,file_sha1:f.sha1,file_type:o.type,file:URL.createObjectURL(o),submitted_at:r,created_by:h});this.dispatch(a(S));const O=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:{uuid:S.uuid,submitted_at:r,title:S.title,description:S.description,geo_marker:S.geo_marker,canvas_marker:S.canvas_marker,sha1:S.file_sha1,project:S.project,file_name:S.file_name,direction:S.direction,original_date:S.original_date,file:f},blocks:[y],blockers:[y]});return O.then(I=>{this.client.files.processPresignedUrls(I.presigned_urls),this.dispatch(c(I.geo_image))}).catch(()=>{this.dispatch(d(S.uuid))}),[S,O.then(I=>I.geo_image)]}async bulkAdd(e,n){var P;const{store:a}=this.client,{addMany:c,setMany:d,deleteMany:o}=this.actions,l=new Date().toISOString(),r=((P=a.getState().userReducer.currentUser)==null?void 0:P.id)??null,h=[],y=[],f=[],S={};for(const I of e){const{file:F,...g}=I,v=await this.client.files.getFilePayload(F);v.sha1 in S||(S[v.sha1]=v);const V=_({...g,file_name:F.name,file_sha1:v.sha1,file_type:F.type,file:URL.createObjectURL(F),submitted_at:l,created_by:r,project:n});h.push(V),y.push(V.uuid),f.push({uuid:V.uuid,sha1:V.file_sha1,file_name:V.file_name,title:V.title,description:V.description,geo_marker:V.geo_marker,canvas_marker:V.canvas_marker,direction:V.direction,original_date:V.original_date})}this.dispatch(c(h));const O=this.enqueueRequest({description:T(p.POST,this.name,!0),method:p.POST,url:`${this.url}/bulk/`,payload:{submitted_at:l,project:n,geo_images:f,files:Object.values(S)},blocks:[n],blockers:y});return O.then(I=>{this.client.files.processPresignedUrls(I.presigned_urls),this.dispatch(d(I.geo_images))}).catch(()=>{this.dispatch(o(y))}),[h,O.then(I=>I.geo_images)]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=n.getState(),o=c(e.uuid)(d);if(!o)throw new Error(`Map image with uuid ${e.uuid} does not exist in the store`);const l={...o,...e};this.dispatch(a(l));const r=this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blocks:[e.uuid],blockers:[e.uuid]});return r.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(a(o))}),[l,r]}async delete(e){const{store:n}=this.client,{deleteOne:a,setOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Map image with uuid ${e} does not exist in the store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blocks:[e],blockers:[e]})}catch(r){throw this.dispatch(c(l)),r}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{project:e}},n);return this.dispatch(a(c)),c}}class ck extends k{constructor(){super(...arguments);m(this,"name","Issue Association");m(this,"url","/issue-associations");m(this,"actions",{addOne:mf,addMany:Yt,setOne:uf,setMany:of,updateOne:hf,updateMany:pf,deleteOne:yf,deleteMany:Zt,initialize:lf});m(this,"selectors",{selectById:Sf,selectByIds:Af})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=new Date().toISOString(),l=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,r=_({...e,submitted_at:o,created_by:l});this.dispatch(a(r));const h=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(r),blockers:[e.associated_issue,...e.issue?[e.issue]:[],...e.asset?[e.asset]:[]],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,h]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=d(e)(n.getState());if(!o)throw new Error(`Issue association with uuid ${e} not found in store.`);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(o)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{associated_issue__project:e}},n)).flat();return this.dispatch(a(d)),d}}class rk extends L{constructor(){super(...arguments);m(this,"name","Issue Attachment");m(this,"url","/issue-attachments");m(this,"actions",{addOne:gf,addMany:ln,setOne:bf,setMany:_f,updateOne:Rf,updateMany:Mf,deleteOne:kf,deleteMany:on,initialize:Pf});m(this,"selectors",{selectById:Vf,selectByIds:Wf})}getId(e){return e.uuid}buildModel(e){return _({file:URL.createObjectURL(e.file),file_sha1:e.file_sha1,created_by:e.created_by,file_name:e.file.name,file_type:e.file.type,submitted_at:e.submitted_at,issue:e.modelUuid})}buildPayload(e,n){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:n.extension,issue:e.issue}}async bulkAdd(e){return this._bulkAdd(e.map(n=>({modelUuid:n.issueUuid,file:n.file})))}async delete(e){return this._delete(e)}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{issue__project:e}},n)).flat();return this.dispatch(a(d)),d}}class dk extends L{constructor(){super(...arguments);m(this,"name","Issue Comment Attachment");m(this,"url","/issue-comment-attachments");m(this,"actions",{addOne:Cf,addMany:jf,setOne:Df,setMany:$f,updateOne:Uf,updateMany:Lf,deleteOne:Nf,deleteMany:Hf,initialize:qf});m(this,"selectors",{selectById:Kf,selectByIds:Yf})}getId(e){return e.uuid}buildModel(e){return _({file:URL.createObjectURL(e.file),file_sha1:e.file_sha1,created_by:e.created_by,file_name:e.file.name,file_type:e.file.type,submitted_at:e.submitted_at,issue_comment:e.modelUuid})}buildPayload(e,n){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:n.extension,issue_comment:e.issue_comment}}async bulkAdd(e){return this._bulkAdd(e.map(n=>({modelUuid:n.issueCommentUuid,file:n.file})))}async delete(e){return this._delete(e)}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{issue_comment__issue__project:e}},n)).flat();return this.dispatch(a(d)),d}}class lk extends k{constructor(){super(...arguments);m(this,"name","Issue Comment");m(this,"url","/issue-comments");m(this,"actions",{addOne:Xf,addMany:xf,setOne:eS,setMany:tS,updateOne:sS,updateMany:iS,deleteOne:nS,deleteMany:aS,initialize:Qf});m(this,"selectors",{selectById:cS,selectByIds:rS})}add(e){const{store:n}=this.client,{addOne:a,updateOne:c,deleteOne:d}=this.actions,o=_({...e,author:n.getState().userReducer.currentUser.id,submitted_at:new Date().toISOString()});this.dispatch(a(o));const l=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(o),blockers:[e.issue],blocks:[o.uuid]});return l.then(r=>{this.dispatch(c(r))}).catch(()=>{this.dispatch(d(o.uuid))}),[o,l]}update(e){const{store:n}=this.client,{updateOne:a}=this.actions,{selectById:c}=this.selectors,d=c(e.uuid)(n.getState());if(!d)throw new Error(`Comment with uuid ${e.uuid} not found in store`);const o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=d(e)(n.getState());if(!o)throw new Error(`Comment with uuid ${e} not found in store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(o)),l}}async refreshStore(e,n){const{setMany:a}=this.actions,d=(await this.listPaginated({queryParams:{issue__project:e}},n)).flat();return this.dispatch(a(d)),d}}class ok extends k{constructor(){super(...arguments);m(this,"name","Issue");m(this,"url","/issues");m(this,"actions",{addOne:uS,addMany:Sn,setOne:hS,setMany:pS,updateOne:mS,updateMany:yS,deleteOne:fS,deleteMany:An,initialize:oS});m(this,"selectors",{selectById:AS,selectByIds:wS})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=n.getState(),l=new Date().toISOString(),r=((f=o.userReducer.currentUser)==null?void 0:f.id)??null,h=_({...e,submitted_at:l,created_by:r});this.dispatch(a(h));const y=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(h),blockers:[h.project,h.issue_type,...h.category?[h.category]:[]],blocks:[h.uuid]});return y.then(S=>{this.dispatch(c(S))}).catch(S=>{throw this.dispatch(d(h.uuid)),S}),[h,y]}update(e){var y;const{updateOne:n}=this.actions,{selectById:a}=this.selectors,c=this.client.store.getState(),d=a(e.uuid)(c);if(!d)throw new Error(`Attempting to update an issue with uuid ${e.uuid} that doesn't exist in the store`);const o={...d,...e};this.dispatch(n(o));const l={};for(const f of[j.TITLE,j.DESCRIPTION,j.STATUS,j.CATEGORY,j.PRIORITY,j.ASSIGNED_TO,j.DUE_DATE])if(f in e&&e[f]!==d[f])switch(f){case j.PRIORITY:l[f]=e[f];break;case j.DUE_DATE:l[f]=e[f];break;case j.DESCRIPTION:l[f]=e[f];break;case j.TITLE:l[f]=e[f];break;case j.STATUS:{const S=e[f],O=zn(S)(c);if(!O)throw new Error(`Trying to update issue type status with ${S} which does not exist in store`);l[f]={name:O.name,color:O.color,uuid:O.uuid};break}case j.CATEGORY:{const S=e[f];if(S===null)l[f]=null;else{const O=Ri(S)(c);if(!O)throw new Error(`Trying to update category with ${S} which does not exist in store.`);l[f]={name:O.name,color:O.color,uuid:O.uuid}}break}case j.ASSIGNED_TO:{const S=e[f];if(S===null)l[f]=null;else{const O=es(S)(c);if(!O)throw new Error(`Trying to update assigned to with ${S} which does not exist in store.`);l[f]={full_name:O.username,id:O.id}}break}}const r=_({created_by:((y=c.userReducer.currentUser)==null?void 0:y.id)??null,submitted_at:new Date().toISOString(),issue:d.uuid,changes:l});this.dispatch(Cn(r));const h=this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return h.then(f=>{this.dispatch(n(f))}).catch(()=>{this.dispatch(n(d)),this.dispatch(Dn(r.uuid))}),[o,h]}bulkUpdate(e,n){const{store:a}=this.client,{updateMany:c}=this.actions,{selectByIds:d}=this.selectors,o=B(e).toSorted(Wt);if(o.length!==e.length)throw new Error("payloads contains duplicate uuids.");const l=d(o)(a.getState()).toSorted(Os);if(o.length!=l.length)throw new Error(`Attempting to bulk update ${o.length-l.length} issues that dont exist in the store`);const r=[];for(let S=0;S<o.length;S++)r.push({...l[S],...e[S]});this.dispatch(c(r));const h=pt(e,Math.min(n??e.length,U)),y=[];let f=null;for(const S of h){const O=mt.v4(),P=B(S),I=S.map(({status:v})=>v).filter(Boolean),F=S.map(({category:v})=>v).filter(Boolean),g=this.enqueueRequest({description:T(p.PATCH,this.name,!0),method:p.PATCH,url:`${this.url}/bulk/`,payload:{payloads:S},blockers:(f?[f]:[]).concat(P).concat(I).concat(F),blocks:[O].concat(P)});y.push(g),f=O}return Promise.all(y).then(S=>{this.dispatch(c(S.flat()))}).catch(()=>{this.dispatch(c(l))}),[r,y]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`No issue with uuid ${e} found in the store`);const r=Ef(e)(o),h=Gw(e)(o),y={};for(const S of wf(e)(o))y[S.uuid]=S;for(const S of Tf(e)(o))y[S.uuid]=S;const f=Object.values(y);this.dispatch(a(e)),this.dispatch(on(B(r))),this.dispatch($n(B(h))),this.dispatch(Zt(B(f)));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(S){throw this.dispatch(c(l)),this.dispatch(ln(r)),this.dispatch(jn(h)),this.dispatch(Yt(f)),S}}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{project:e}},n)).flat();return this.dispatch(a(d)),d}}class uk extends L{constructor(){super(...arguments);m(this,"name","Issue Type Attachment");m(this,"url","/issue-type-attachments");m(this,"actions",{addOne:PS,addMany:gS,setOne:bS,setMany:_S,updateOne:RS,updateMany:MS,deleteOne:kS,deleteMany:vS,initialize:FS});m(this,"selectors",{selectById:VS,selectByIds:WS})}getId(e){return e.uuid}buildModel(e){return _({file:URL.createObjectURL(e.file),file_sha1:e.file_sha1,created_by:e.created_by,file_name:e.file.name,file_type:e.file.type,submitted_at:e.submitted_at,issue_type:e.modelUuid})}buildPayload(e,n){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:n.extension,issue_type:e.issue_type}}async bulkAdd(e){return this._bulkAdd(e.map(n=>({modelUuid:n.issueTypeUuid,file:n.file})))}async delete(e){return this._delete(e)}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{issue_type__organization:e}},n);return this.dispatch(a(c)),c}}class hk extends k{constructor(){super(...arguments);m(this,"name","Issue Type Fields Attachment");m(this,"url","/issue-type-fields-attachments");m(this,"actions",{addOne:CS,addMany:jS,setOne:DS,setMany:$S,updateOne:US,updateMany:LS,deleteOne:NS,deleteMany:HS,initialize:qS});m(this,"selectors",{selectById:KS,selectByIds:YS})}async bulkAdd(e){var f;const{addMany:n,setMany:a,deleteMany:c}=this.actions,d=new Date().toISOString(),o=((f=this.client.store.getState().userReducer.currentUser)==null?void 0:f.id)??null,l={},r=[],h=[];for(const S of e){const{fieldsRevisionUuid:O,fieldIdentifier:P,file:I}=S,F=await this.client.files.getFilePayload(I);F.sha1 in l||(l[F.sha1]=F);const g=_({file:URL.createObjectURL(I),file_type:I.type,file_name:I.name,file_sha1:F.sha1,created_by:o,fields_revision:O,submitted_at:d,field_identifier:P});r.push(g);const v={uuid:g.uuid,file_name:I.name,file_extension:F.extension,field_identifier:P,file_sha1:F.sha1,fields_revision:O};h.push(v)}this.dispatch(n(r));const y=this.enqueueRequest({description:T(p.POST,this.name,!0),method:p.POST,url:`${this.url}/bulk/`,payload:{submitted_at:d,attachments:h,files:Object.values(l)},blockers:r.map(S=>S.fields_revision),blocks:r.map(S=>S.uuid)});return y.then(S=>{this.client.files.processPresignedUrls(S.presigned_urls),this.dispatch(a(S.attachments))}).catch(()=>{this.dispatch(c(r.map(S=>S.uuid)))}),[r,y.then(({attachments:S})=>S)]}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{fields_revision__issue_type__organization:e}},n);return this.dispatch(a(c)),c}}class pk extends k{constructor(){super(...arguments);m(this,"name","Issue Type Fields");m(this,"url","/issue-type-fields");m(this,"actions",{addOne:hA,addMany:pA,setOne:mA,setMany:yA,updateOne:fA,updateMany:SA,deleteOne:AA,deleteMany:wA,initialize:uA});m(this,"selectors",{selectById:OA,selectByIds:IA})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(r),blockers:[r.issue_type],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(f=>{throw this.dispatch(d(r.uuid)),f}),[r,h]}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{issue_type__organization:e}},n);return this.dispatch(a(c)),c}}class mk extends k{constructor(){super(...arguments);m(this,"name","Issue Type Field Values Attachment");m(this,"url","/issue-type-field-values-attachments");m(this,"actions",{addOne:bA,addMany:bn,setOne:_A,setMany:RA,updateOne:MA,updateMany:kA,deleteOne:vA,deleteMany:_n,initialize:gA});m(this,"selectors",{selectById:VA,selectByIds:WA})}async bulkAdd(e){var f;const{addMany:n,setMany:a,deleteMany:c}=this.actions,d=new Date().toISOString(),o=((f=this.client.store.getState().userReducer.currentUser)==null?void 0:f.id)??null,l={},r=[],h=[];for(const S of e){const{fieldValuesUuid:O,fieldIdentifier:P,file:I}=S,F=await this.client.files.getFilePayload(I);F.sha1 in l||(l[F.sha1]=F);const g=_({file:URL.createObjectURL(I),file_type:I.type,file_name:I.name,file_sha1:F.sha1,created_by:o,field_values:O,submitted_at:d,field_identifier:P});r.push(g);const v={uuid:g.uuid,file_name:I.name,file_sha1:F.sha1,file_extension:F.extension,field_identifier:P,field_values:O};h.push(v)}this.dispatch(n(r));const y=this.enqueueRequest({description:T(p.POST,this.name,!0),method:p.POST,url:`${this.url}/bulk/`,payload:{submitted_at:d,attachments:h,files:Object.values(l)},blockers:r.map(S=>S.field_values),blocks:r.map(S=>S.uuid)});return y.then(({presigned_urls:S,attachments:O})=>{this.client.files.processPresignedUrls(S),this.dispatch(a(O))}).catch(S=>{throw this.dispatch(c(r.map(O=>O.uuid))),S}),[r,y.then(({attachments:S})=>S)]}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:d}=this.selectors,o=n.getState(),l=d(e)(o);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!0),method:p.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(r){throw this.dispatch(c(l)),r}}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{field_values__issue__project:e,latest:!0}},n)).flat();return this.dispatch(a(d)),d}}class yk extends k{constructor(){super(...arguments);m(this,"name","Issue Type Field Values");m(this,"url","/issue-type-field-values");m(this,"actions",{addOne:XS,addMany:xS,setOne:eA,setMany:tA,updateOne:sA,updateMany:iA,deleteOne:nA,deleteMany:aA,initialize:QS});m(this,"selectors",{selectById:rA,selectByIds:dA})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,r=new Date().toISOString(),h=_({...e,created_by:l,submitted_at:r}),y=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(h),blockers:[e.issue,e.fields_revision],blocks:[h.uuid]});return this.dispatch(a(h)),y.then(S=>{this.dispatch(c(S))}).catch(()=>{this.dispatch(d(h.uuid))}),[h,y]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=n.getState(),o=c(e.uuid)(d);if(!o)throw new Error(`Expected IssueTypeFieldValues with uuid ${e.uuid} to exist`);const l={...o,...e};this.dispatch(a(l));const r=this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[l.uuid,l.fields_revision,l.issue],blocks:[l.uuid]});return r.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(a(o))}),[l,r]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected submission with uuid ${e} to exist`);const r=BA(e)(o);this.dispatch(a(e)),this.dispatch(_n(B(r)));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(h){throw this.dispatch(c(l)),this.dispatch(bn(r)),h}}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{issue__project:e,latest:!0}},n)).flat();return this.dispatch(a(d)),d}}class fk extends k{constructor(){super(...arguments);m(this,"name","Issue Type Identifier");m(this,"url","/issue-type-identifiers");m(this,"actions",{addOne:jA,addMany:DA,setOne:$A,setMany:UA,updateOne:LA,updateMany:NA,deleteOne:HA,deleteMany:GA,initialize:CA});m(this,"selectors",{selectById:YA,selectByIds:ZA})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(r),blockers:[r.issue_type],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,h]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=c(e.uuid)(n.getState());if(!d)throw new Error(`Expected issue type identifier with uuid ${e.uuid} to exist`);const o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected issue type identifier with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(r){throw this.dispatch(c(l)),r}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{issue_type__organization:e}},n);return this.dispatch(a(c)),c}}class Sk extends k{constructor(){super(...arguments);m(this,"name","Issue Type Identifier Value");m(this,"url","/issue-type-identifier-values");m(this,"actions",{addOne:xA,addMany:ew,setOne:tw,setMany:sw,updateOne:iw,updateMany:nw,deleteOne:aw,deleteMany:cw,initialize:XA});m(this,"selectors",{selectById:dw,selectByIds:lw})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(r),blockers:[e.issue,e.issue_type_identifier],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,h]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=c(e.uuid)(n.getState());if(!d)throw new Error(`Expected issue type identifier value with uuid ${e.uuid} to exist`);const o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected issue type identifier value with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(r){throw this.dispatch(c(l)),r}}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{issue__project:e}},n)).flat();return this.dispatch(a(d)),d}}class Ak extends k{constructor(){super(...arguments);m(this,"name","Issue Type");m(this,"url","/issue-types");m(this,"actions",{addOne:pw,addMany:mw,setOne:yw,setMany:fw,updateOne:Sw,updateMany:Aw,deleteOne:ww,deleteMany:Tw,initialize:hw});m(this,"selectors",{selectById:Iw,selectByIds:Fw})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,r=new Date().toISOString(),h=_({...e,submitted_at:r,created_by:l});this.dispatch(a(h));const y=this.enqueueRequest({method:p.POST,url:`${this.url}/`,payload:E(h),blockers:[],blocks:[h.uuid]});return y.then(S=>{this.dispatch(c(S))}).catch(()=>{this.dispatch(d(h.uuid))}),[h,y]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=n.getState(),o=c(e.uuid)(d);if(!o)throw new Error(`IssueType with uuid ${e.uuid} does not exist in the store.`);const l={...o,...e};this.dispatch(a(l));const r=this.enqueueRequest({method:p.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return r.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(a(o))}),[l,r]}async delete(e){const{store:n}=this.client,{deleteOne:a,setOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`IssueType with uuid ${e} does not exist in the store.`);const r=TS(e)(o);this.dispatch(a(e)),this.dispatch(An(B(r)));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(h){throw this.dispatch(c(l)),this.dispatch(Sn(r)),h}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class wk extends k{constructor(){super(...arguments);m(this,"name","Issue Type Status");m(this,"url","/issue-type-statuses");m(this,"actions",{addOne:_w,addMany:Rw,setOne:Mw,setMany:kw,updateOne:vw,updateMany:Ew,deleteOne:Vw,deleteMany:Ww,initialize:bw});m(this,"selectors",{selectById:zn,selectByIds:zw})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(r),blockers:[e.issue_type],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,h]}update(e){const{setOne:n}=this.actions,{selectById:a}=this.selectors,c=this.client.store.getState(),d=a(e.uuid)(c);if(!d)throw new Error(`Expected an existing issue type status with uuid ${e.uuid}`);const o={...d,...e};this.dispatch(n(o));const l=this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(r=>{this.dispatch(n(r))}).catch(()=>{this.dispatch(n(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=d(e)(n.getState());if(!o)throw new Error(`No issue type status with uuid ${e} found in the store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(o)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{issue_type__organization:e}},n);return this.dispatch(a(c)),c}}class Tk extends k{constructor(){super(...arguments);m(this,"name","Issue Update");m(this,"url","/issue-updates");m(this,"actions",{addOne:Cn,addMany:jn,setOne:Dw,setMany:$w,updateOne:Uw,updateMany:Lw,deleteOne:Dn,deleteMany:$n,initialize:jw});m(this,"selectors",{selectById:Nw,selectByIds:Hw})}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{issue__project:e}},n)).flat();return this.dispatch(a(d)),d}}const Ok=1800;function Ik(t){if(!t.access)throw new Error("Missing access token");if(!t.refresh)throw new Error("Missing refresh token");return{accessToken:t.access,refreshToken:t.refresh}}class Fk extends AM{constructor(){super(...arguments);m(this,"_getRenewedTokens",async e=>{const n=this.performRequest({method:p.POST,url:this.refreshTokensUrl,payload:{refresh:e},isAuthNeeded:!1,checkAuth:!1});let a;try{a=await n}catch(c){console.error("Could not renew tokens; clearing auth",c),this.clearAuth();return}if(!a.access)throw new Error("Missing access token");return{accessToken:a.access,refreshToken:a.refresh??this.getRefreshToken()}})}clearAuth(){console.debug(this.constructor.name,"clearing auth;"),this.dispatch(sp(!1)),this.clearTokens(),this.dispatch(b()),this.dispatch(b())}async renewTokens(){const e=this.getRefreshToken();if(!e)throw new Error("No refresh token found");console.debug(this.constructor.name,"renewing tokens");try{const n=await this._getRenewedTokens(e);if(!n)return;console.log("Got renewed tokens"),this.setTokens(n)}catch(n){throw console.error("Could not renew tokens; clearing auth",n),this.clearAuth(),n}}tokenIsExpiringSoon(){const e=this.getAccessToken();if(!e)return!1;const n=Date.now()/1e3;let a;try{a=Vb(e).exp??n}catch{a=n}return a-n<Ok}getAuthHeader(){return`Bearer ${this.getAccessToken()}`}async prepareAuth(){if(this.tokenIsExpiringSoon()){console.debug(this.constructor.name,"preparing auth");try{await this.renewTokens()}catch(e){return e instanceof D&&this.clearAuth(),e instanceof Error?Promise.reject(e):Promise.reject(new Error((e??wt).toString()))}}}async handleUnauthorized(e,n){const a=this.client.store.getState();if(e.url.endsWith("/token/refresh/"))throw a.authReducer.isLoggedIn&&console.warn("No signed-in user to sign out."),this.clearAuth(),new D({message:"You have been signed out due to inactivity.",response:n,discard:!0});if(a.authReducer.isLoggedIn)await this.renewTokens();else throw console.debug("Forbidden; user is not logged in."),new D({message:"Incorrect username or password.",response:n,discard:!0})}async initAuth(e){const n=mt.v4();return console.debug(this.constructor.name,"Initiating auth"),this.performRequest({uuid:n,method:p.POST,url:this.initTokensUrl,payload:e,isAuthNeeded:!1,checkAuth:!1}).then(a=>{this.setTokens(Ik(a))})}}class Pk extends Tt{constructor(){super(...arguments);m(this,"name","Organization Access");m(this,"url","/organization-accesses");m(this,"actions",{addOne:rT,addMany:dT,setOne:lT,setMany:oT,updateOne:uT,updateMany:hT,deleteOne:pT,deleteMany:mT,initialize:cT});m(this,"selectors",{selectById:fT,selectByIds:ST})}update(e){const{store:n}=this.client,{updateOne:a}=this.actions,{selectById:c}=this.selectors,d=c(e.uuid)(n.getState()),o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(r=>{throw this.dispatch(a(d)),r}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o),r=es(l.user)(o);this.dispatch(a(l.uuid)),this.dispatch(Gn(l.user));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${l.uuid}/`,blockers:[l.uuid],blocks:[]})}catch(h){throw this.dispatch(c(l)),this.dispatch(Hn(r)),h}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class gk extends Tt{constructor(){super(...arguments);m(this,"name","Organization");m(this,"url","/organizations");m(this,"actions",{addOne:PT,addMany:FT,setOne:IT,setMany:OT,updateOne:bT,updateMany:gT,deleteOne:_T,deleteMany:RT,initialize:TT});m(this,"selectors",{selectById:vT,selectByIds:ET})}async add(e){const{addOne:n}=this.actions,a=await this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:e,blockers:[],blocks:[]});return this.dispatch(n(a)),a}async update(e){const{setOne:n}=this.actions,a=await this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return this.dispatch(n(a)),a}async invite(e,n){return this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/${e}/invite/${n}/`,blockers:[],blocks:[]})}async refreshStore(e){const{initialize:n}=this.actions,a=await this.list({},e);return this.dispatch(n(a)),a}}class bk extends k{constructor(){super(...arguments);m(this,"name","Project Access");m(this,"url","/project-accesses");m(this,"actions",{addOne:UT,addMany:LT,setOne:NT,setMany:HT,updateOne:GT,updateMany:KT,deleteOne:YT,deleteMany:ZT,initialize:$T});m(this,"selectors",{selectById:QT,selectByIds:XT})}add(e){var r;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=_({...e,created_by:((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null});this.dispatch(a(o));const l=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(o),blockers:[o.organization_access,o.project],blocks:[o.uuid]});return l.then(h=>{this.dispatch(c(h))}).catch(h=>{throw this.dispatch(d(o.uuid)),h}),[o,l]}bulkAdd(e){var h;const{store:n}=this.client,{addMany:a,deleteMany:c,updateMany:d}=this.actions,o=((h=n.getState().userReducer.currentUser)==null?void 0:h.id)??null,l=e.map(y=>_({...y,created_by:o}));this.dispatch(a(l));const r=this.enqueueRequest({description:T(p.POST,this.name,!0),method:p.POST,url:`${this.url}/bulk/`,payload:{project_accesses:l.map(y=>E(y))},blockers:l.flatMap(y=>[y.project,y.organization_access]),blocks:l.map(y=>y.uuid)});return r.then(y=>{this.dispatch(d(y))}).catch(y=>{throw this.dispatch(c(l.map(f=>f.uuid))),y}),[l,r]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=c(e.uuid)(n.getState()),o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[]});return l.then(r=>{this.dispatch(a(r))}).catch(r=>{throw this.dispatch(a(d)),r}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=d(e)(n.getState());this.dispatch(a(e));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(o)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{project__organization:e}},n);return this.dispatch(a(c)),c}}class _k extends L{constructor(){super(...arguments);m(this,"name","Project Attachment");m(this,"url","/project-attachments");m(this,"actions",{addOne:tO,addMany:sO,setOne:iO,setMany:nO,updateOne:aO,updateMany:cO,deleteOne:rO,deleteMany:dO,initialize:eO});m(this,"selectors",{selectById:oO,selectByIds:uO})}getId(e){return e.uuid}buildModel(e){return _({file:URL.createObjectURL(e.file),file_sha1:e.file_sha1,created_by:e.created_by,file_name:e.file.name,file_type:e.file.type,submitted_at:e.submitted_at,project:e.modelUuid})}buildPayload(e,n){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:n.extension,project:e.project}}async bulkAdd(e){return this._bulkAdd(e.map(n=>({modelUuid:n.projectUuid,file:n.file})))}async delete(e){return this._delete(e)}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{project__organization:e}},n);return this.dispatch(a(c)),c}}class Rk extends k{constructor(){super(...arguments);m(this,"name","Project File");m(this,"url","/project-files");m(this,"actions",{addOne:SO,addMany:AO,setOne:yO,setMany:fO,updateOne:wO,updateMany:TO,deleteOne:OO,deleteMany:IO,initialize:mO});m(this,"selectors",{selectById:RO,selectByIds:MO})}async saveExisting(e){const{setOne:n}=this.actions;if(!e.uuid)throw new Error("You can only use this method to save existing project files. The one provided has no uuid.");const a={...e};delete a.file;const c=this.enqueueRequest({method:p.PATCH,url:`${this.url}/${e.uuid}/`,payload:a,blockers:[e.uuid],blocks:[e.uuid]});return c.then(d=>{this.dispatch(n(d))}),c}saveActive(){const{store:e}=this.client,{setOne:n}=this.actions,a=e.getState(),c=a.projectFileReducer.activeProjectFileId;if(!c)throw new Error("No active project file");const d=a.projectFileReducer.instances[c];if(!d)throw new Error("No active project file");if(!d.bounds&&!d.canvas_bounds)throw new Error("Project file must either have bounds or canvas_bounds set");let o;if(typeof d.file=="string"&&!d.file.startsWith("blob:")){const h={...d};delete h.file,o={method:p.PATCH,url:`${this.url}/${c}/`,payload:h,blockers:[c],blocks:[c]}}else o=new Promise((h,y)=>{this.client.files.uploadFileToS3(d.file_sha1).then(([f])=>{h({method:p.POST,url:`${this.url}/`,payload:{...d,...f},blockers:[c],blocks:[c]})}).catch(y)});const r=Promise.resolve(o).then(h=>this.enqueueRequest(h));return r.then(h=>{this.dispatch(n(h))}),this.dispatch(gO),this.dispatch(PO(null)),this.dispatch(FO(!1)),[d,r]}async delete(e){const{store:n}=this.client,{addOne:a,deleteOne:c}=this.actions,{selectById:d}=this.selectors,o=d(e)(n.getState());if(!o)throw new Error(`Expected project file with uuid ${e} to exist in the store.`);this.dispatch(c(e));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(a(o)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{project:e}},n)).flat();return this.dispatch(a(d)),d}}class Mk extends Tt{constructor(){super(...arguments);m(this,"name","Project");m(this,"url","/projects");m(this,"actions",{addOne:zO,addMany:BO,setOne:WO,setMany:VO,updateOne:CO,updateMany:qO,deleteOne:jO,deleteMany:DO,initialize:EO});m(this,"selectors",{selectById:LO,selectByIds:NO})}async add(e){const{addOne:n}=this.actions,a=await this.performRequest({method:p.POST,url:`${this.url}/`,payload:E(e)});return this.dispatch(n(a)),a}async update(e){const{updateOne:n}=this.actions,a=await this.performRequest({method:p.PATCH,url:`${this.url}/${e.uuid}/`,payload:E(e)});return this.dispatch(n(a)),a}async delete(e){const{deleteOne:n}=this.actions,a=await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]});return this.dispatch(n(e)),a}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class kk extends k{constructor(){super(...arguments);m(this,"name","Team Membership");m(this,"url","/team-memberships");m(this,"actions",{addOne:YO,addMany:ZO,setOne:JO,setMany:QO,updateOne:XO,updateMany:xO,deleteOne:eI,deleteMany:tI,initialize:KO});m(this,"selectors",{selectById:nI,selectByIds:aI})}add(e){var r;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=_({...e,created_by:((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null});this.dispatch(a(o));const l=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(o),blockers:[e.team],blocks:[o.uuid]});return l.then(h=>{this.dispatch(c(h))}).catch(()=>{this.dispatch(d(o.uuid))}),[o,l]}bulkAdd(e){var h;const{store:n}=this.client,{addMany:a,setMany:c,deleteMany:d}=this.actions,o=((h=n.getState().userReducer.currentUser)==null?void 0:h.id)??null,l=e.map(y=>_({...y,created_by:o}));this.dispatch(a(l));const r=this.enqueueRequest({description:T(p.POST,this.name,!0),method:p.POST,url:`${this.url}/bulk/`,payload:{team_memberships:l.map(y=>E(y))},blockers:l.map(y=>y.team),blocks:l.map(y=>y.uuid)});return r.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(d(l.map(y=>y.uuid)))}),[l,r]}async delete(e){const{store:n}=this.client,{deleteOne:a,setOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected team membership with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(r){throw this.dispatch(c(l)),r}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{team__organization:e}},n);return this.dispatch(a(c)),c}}class vk extends k{constructor(){super(...arguments);m(this,"name","Team");m(this,"url","/teams");m(this,"actions",{addOne:dI,addMany:lI,setOne:oI,setMany:uI,updateOne:hI,updateMany:pI,deleteOne:mI,deleteMany:yI,initialize:rI});m(this,"selectors",{selectById:SI,selectByIds:AI})}add(e){var r;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=_({...e,submitted_at:new Date().toISOString(),created_by:((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null});this.dispatch(a(o));const l=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(o),blockers:[],blocks:[o.uuid]});return l.then(h=>{this.dispatch(c(h))}).catch(()=>{this.dispatch(d(o.uuid))}),[o,l]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=c(e.uuid)(n.getState());if(!d)throw new Error(`Expected team with uuid ${e.uuid} to exist`);const o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.PATCH,url:`${this.url}/${e.uuid}/`,payload:E(e),blockers:[e.uuid],blocks:[e.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,setOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected team with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(r){throw this.dispatch(c(l)),r}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class Ek extends Tt{constructor(){super(...arguments);m(this,"name","User");m(this,"url","/user");m(this,"actions",{addOne:Hn,addMany:Xw,setOne:Qw,setMany:Jw,updateOne:eT,updateMany:xw,deleteOne:Gn,deleteMany:tT,initialize:Zw});m(this,"selectors",{selectById:es,selectByIds:nT})}async list(e,n){const{organizationUuid:a,...c}=e,d=a?`/organizations/${a}${this.url}s/`:`/${this.url}`;return this.performRequest({method:p.GET,url:d,...c},n)}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({organizationUuid:e},n);return this.dispatch(a(c)),c}}class Vk extends k{constructor(){super(...arguments);m(this,"name","Workflow");m(this,"url","/workflows");m(this,"actions",{addOne:II,addMany:da,setOne:FI,setMany:PI,updateOne:gI,updateMany:bI,deleteOne:_I,deleteMany:la,initialize:OI});m(this,"selectors",{selectById:MI,selectByIds:kI})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,r=new Date().toISOString(),h=_({...e,created_by:l,submitted_at:r});this.dispatch(a(h));const y=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(h),blockers:[h.project,h.workflow_type],blocks:[h.uuid]});return y.then(S=>{this.dispatch(c(S))}).catch(()=>{this.dispatch(d(h.uuid))}),[h,y]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=c(e.uuid)(n.getState());if(!d)throw new Error(`Expected workflow with uuid ${e.uuid} to exist`);const o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[d.uuid],blocks:[d.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected workflow with uuid ${e} to exist`);const r=oP(e)(o),h=NI(e)(o),y=QP(e)(o),f=og(e)(o),S=Fg(e)(o),O=RF(e)(o),P=yF(e)(o),I=DF(e)(o),F={};for(const v of P)for(const V of ya(v.uuid)(o))F[V.uuid]=V;const g=Object.values(F);this.dispatch(a(e)),this.dispatch(Ea(B(r))),this.dispatch(ha(B(h))),this.dispatch($a(B(y))),this.dispatch(Na(B(f))),this.dispatch(Ka(B(S))),this.dispatch(Oa(B(O))),this.dispatch(Pa(B(I))),this.dispatch(Aa(B(P))),this.dispatch(cs(B(g)));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(v){throw this.dispatch(c(l)),this.dispatch(va(r)),this.dispatch(ua(h)),this.dispatch(Da(y)),this.dispatch(La(f)),this.dispatch(Ga(S)),this.dispatch(Ta(O)),this.dispatch(Fa(I)),this.dispatch(Sa(P)),this.dispatch(as(g)),v}}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{project:e}},n)).flat();return this.dispatch(a(d)),d}}class Wk extends k{constructor(){super(...arguments);m(this,"name","Workflow Step Assignee");m(this,"url","/workflow-step-assignees");m(this,"actions",{addOne:BI,addMany:ua,setOne:zI,setMany:qI,updateOne:CI,updateMany:jI,deleteOne:DI,deleteMany:ha,initialize:WI});m(this,"selectors",{selectById:UI,selectByIds:LI})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=new Date().toISOString(),l=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,r=_({...e,submitted_at:o,created_by:l});this.dispatch(a(r));const h=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(r),blockers:[e.workflow,e.workflow_step],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,h]}bulkAdd(e){var y;const{store:n}=this.client,{addMany:a,setMany:c,deleteMany:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=e.map(f=>_({...f,submitted_at:l,created_by:o}));this.dispatch(a(r));const h=this.enqueueRequest({description:T(p.POST,this.name,!0),method:p.POST,url:`${this.url}/bulk/`,payload:{workflow_step_assignees:r.map(f=>E(f))},blockers:r.flatMap(f=>[f.workflow,f.workflow_step]),blocks:r.map(f=>f.uuid)});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.map(f=>f.uuid)))}),[r,h]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=c(e.uuid)(n.getState());if(!d)throw new Error(`Expected workflow step assignee with uuid ${e.uuid} to exist`);const o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,setOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected workflow step assignee with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(r){throw this.dispatch(c(l)),r}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:d}=this.selectors,o=n.getState(),l=d(e)(o);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!0),method:p.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(r){throw this.dispatch(c(l)),r}}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{workflow__project:e}},n)).flat();return this.dispatch(a(d)),d}}class Bk extends L{constructor(){super(...arguments);m(this,"name","Workflow Step Comment Attachment");m(this,"url","/workflow-step-comment-attachments");m(this,"actions",{addOne:YI,addMany:as,setOne:ZI,setMany:JI,updateOne:QI,updateMany:XI,deleteOne:xI,deleteMany:cs,initialize:KI});m(this,"selectors",{selectById:tF,selectByIds:sF})}getId(e){return e.uuid}buildModel(e){return _({file:URL.createObjectURL(e.file),file_sha1:e.file_sha1,created_by:e.created_by,file_name:e.file.name,file_type:e.file.type,submitted_at:e.submitted_at,workflow_step_comment:e.modelUuid})}buildPayload(e,n){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:n.extension,workflow_step_comment:e.workflow_step_comment}}async bulkAdd(e){return this._bulkAdd(e.map(n=>({modelUuid:n.workflowStepCommentUuid,file:n.file})))}async delete(e){return this._delete(e)}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{workflow_step_comment__workflow__project:e}},n)).flat();return this.dispatch(a(d)),d}}class zk extends k{constructor(){super(...arguments);m(this,"name","Workflow Step Comment");m(this,"url","/workflow-step-comments");m(this,"actions",{addOne:cF,addMany:Sa,setOne:rF,setMany:dF,updateOne:lF,updateMany:oF,deleteOne:uF,deleteMany:Aa,initialize:aF});m(this,"selectors",{selectById:pF,selectByIds:mF})}add(e){var r;const{store:n}=this.client,{addOne:a,updateOne:c,deleteOne:d}=this.actions,o=_({...e,created_by:((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(o));const l=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(o),blockers:[e.workflow,e.workflow_step],blocks:[o.uuid]});return l.then(h=>{this.dispatch(c(h))}).catch(()=>{this.dispatch(d(o.uuid))}),[o,l]}update(e){const{store:n}=this.client,{updateOne:a}=this.actions,{selectById:c}=this.selectors,d=c(e.uuid)(n.getState());if(!d)throw new Error(`Comment with uuid ${e.uuid} not found in store`);const o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=d(e)(n.getState());if(!o)throw new Error(`Comment with uuid ${e} not found in store`);const l=ya(e)(n.getState());this.dispatch(a(e)),this.dispatch(cs(B(l)));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(r){throw this.dispatch(c(o)),this.dispatch(as(l)),r}}async refreshStore(e,n){const{setMany:a}=this.actions,d=(await this.listPaginated({queryParams:{workflow__project:e}},n)).flat();return this.dispatch(a(d)),d}}class qk extends k{constructor(){super(...arguments);m(this,"name","Workflow Step Completion");m(this,"url","/workflow-step-completions");m(this,"actions",{addOne:wF,addMany:Ta,setOne:TF,setMany:OF,updateOne:IF,updateMany:FF,deleteOne:PF,deleteMany:Oa,initialize:AF});m(this,"selectors",{selectById:bF,selectByIds:_F})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=new Date().toISOString(),l=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,r=_({...e,submitted_at:o,created_by:l});this.dispatch(a(r));const h=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(r),blockers:[e.workflow,e.workflow_step],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,h]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=c(e.uuid)(n.getState());if(!d)throw new Error(`Expected workflow step completion with uuid ${e.uuid} to exist`);const o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,setOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected workflow step completion with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(r){throw this.dispatch(c(l)),r}}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{workflow__project:e}},n)).flat();return this.dispatch(a(d)),d}}class Ck extends k{constructor(){super(...arguments);m(this,"name","Workflow Step Event");m(this,"url","/workflow-step-events");m(this,"actions",{addOne:EF,addMany:Fa,setOne:VF,setMany:WF,updateOne:BF,updateMany:zF,deleteOne:qF,deleteMany:Pa,initialize:vF});m(this,"selectors",{selectById:CF,selectByIds:jF})}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{workflow__project:e}},n)).flat();return this.dispatch(a(d)),d}}class jk extends k{constructor(){super(...arguments);m(this,"name","Workflow Step Field Values Attachment");m(this,"url","/workflow-step-field-values-attachments");m(this,"actions",{addOne:NF,addMany:_a,setOne:HF,setMany:GF,updateOne:KF,updateMany:YF,deleteOne:ZF,deleteMany:Ra,initialize:LF});m(this,"selectors",{selectById:QF,selectByIds:XF})}async bulkAdd(e){var f;const{addMany:n,setMany:a,deleteMany:c}=this.actions,d=new Date().toISOString(),o=((f=this.client.store.getState().userReducer.currentUser)==null?void 0:f.id)??null,l={},r=[],h=[];for(const S of e){const{fieldValuesUuid:O,fieldIdentifier:P,file:I}=S,F=await this.client.files.getFilePayload(I);F.sha1 in l||(l[F.sha1]=F);const g=_({file:URL.createObjectURL(I),file_type:I.type,file_name:I.name,file_sha1:F.sha1,created_by:o,field_values:O,submitted_at:d,field_identifier:P});r.push(g);const v={uuid:g.uuid,file_name:I.name,file_sha1:F.sha1,file_extension:F.extension,field_identifier:P,field_values:O};h.push(v)}this.dispatch(n(r));const y=this.enqueueRequest({description:T(p.POST,this.name,!0),method:p.POST,url:`${this.url}/bulk/`,payload:{submitted_at:d,attachments:h,files:Object.values(l)},blockers:r.map(S=>S.field_values),blocks:r.map(S=>S.uuid)});return y.then(({presigned_urls:S,attachments:O})=>{this.client.files.processPresignedUrls(S),this.dispatch(a(O))}).catch(S=>{throw this.dispatch(c(r.map(O=>O.uuid))),S}),[r,y.then(({attachments:S})=>S)]}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:d}=this.selectors,o=n.getState(),l=d(e)(o);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!0),method:p.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(r){throw this.dispatch(c(l)),r}}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{field_values__workflow__project:e,latest:!0}},n)).flat();return this.dispatch(a(d)),d}}class Dk extends k{constructor(){super(...arguments);m(this,"name","Workflow Step Field Values");m(this,"url","/workflow-step-field-values");m(this,"actions",{addOne:iP,addMany:va,setOne:nP,setMany:aP,updateOne:cP,updateMany:rP,deleteOne:dP,deleteMany:Ea,initialize:sP});m(this,"selectors",{selectById:uP,selectByIds:hP})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,r=new Date().toISOString(),h=_({...e,created_by:l,submitted_at:r}),y=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(h),blockers:[e.workflow,e.workflow_step,e.fields_revision],blocks:[h.uuid]});return this.dispatch(a(h)),y.then(S=>{this.dispatch(c(S))}).catch(()=>{this.dispatch(d(h.uuid))}),[h,y]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=n.getState(),o=c(e.uuid)(d);if(!o)throw new Error(`Expected WorkflowStepFieldValues with uuid ${e.uuid} to exist`);const l={...o,...e};this.dispatch(a(l));const r=this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[l.uuid,l.fields_revision,l.workflow,l.workflow_step],blocks:[l.uuid]});return r.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(a(o))}),[l,r]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected submission with uuid ${e} to exist`);const r=xF(e)(o);this.dispatch(a(e)),this.dispatch(Ra(B(r)));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(h){throw this.dispatch(c(l)),this.dispatch(_a(r)),h}}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{workflow__project:e,latest:!0}},n)).flat();return this.dispatch(a(d)),d}}class $k extends k{constructor(){super(...arguments);m(this,"name","Workflow Step Fields Attachment");m(this,"url","/workflow-step-fields-attachments");m(this,"actions",{addOne:fP,addMany:Wa,setOne:SP,setMany:AP,updateOne:wP,updateMany:TP,deleteOne:OP,deleteMany:Ba,initialize:yP});m(this,"selectors",{selectById:PP,selectByIds:gP})}async bulkAdd(e){var f;const{addMany:n,setMany:a,deleteMany:c}=this.actions,d=new Date().toISOString(),o=((f=this.client.store.getState().userReducer.currentUser)==null?void 0:f.id)??null,l={},r=[],h=[];for(const S of e){const{fieldsRevisionUuid:O,fieldIdentifier:P,file:I}=S,F=await this.client.files.getFilePayload(I);F.sha1 in l||(l[F.sha1]=F);const g=_({file:URL.createObjectURL(I),file_type:I.type,file_name:I.name,file_sha1:F.sha1,created_by:o,fields_revision:O,submitted_at:d,field_identifier:P});r.push(g);const v={uuid:g.uuid,file_name:I.name,field_identifier:P,file_extension:F.extension,file_sha1:F.sha1,fields_revision:O};h.push(v)}this.dispatch(n(r));const y=this.enqueueRequest({description:T(p.POST,this.name,!0),method:p.POST,url:`${this.url}/bulk/`,payload:{submitted_at:d,attachments:h,files:Object.values(l)},blockers:r.map(S=>S.fields_revision),blocks:r.map(S=>S.uuid)});return y.then(S=>{this.client.files.processPresignedUrls(S.presigned_urls),this.dispatch(a(S.attachments))}).catch(()=>{this.dispatch(c(r.map(S=>S.uuid)))}),[r,y.then(({attachments:S})=>S)]}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{fields_revision__workflow_step__workflow_type__organization:e}},n);return this.dispatch(a(c)),c}}class Uk extends k{constructor(){super(...arguments);m(this,"name","Workflow Step Fields");m(this,"url","/workflow-step-fields");m(this,"actions",{addOne:MP,addMany:kP,setOne:vP,setMany:EP,updateOne:VP,updateMany:WP,deleteOne:BP,deleteMany:zP,initialize:RP});m(this,"selectors",{selectById:qP,selectByIds:CP})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(r),blockers:[r.workflow_step],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(f=>{throw this.dispatch(d(r.uuid)),f}),[r,h]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,c=n.getState().workflowStepFieldsReducer.instances[e.uuid];if(!c)throw new Error(`WorkflowStepFields with uuid ${e.uuid} not found`);const d={...c,...e};this.dispatch(a(d));const o=this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.PATCH,url:`${this.url}/${c.uuid}/`,payload:e,blockers:[c.uuid],blocks:[c.uuid]});return o.then(l=>{this.dispatch(a(l))}).catch(l=>{throw this.dispatch(a(c)),l}),[d,o]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,d=n.getState().workflowStepFieldsReducer.instances[e];if(!d)throw new Error(`WorkflowStepFields with uuid ${e} not found`);const o=FP(e)(n.getState());this.dispatch(a(e)),this.dispatch(Ba(B(o)));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(l){throw this.dispatch(c(d)),this.dispatch(Wa(o)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{workflow_step__workflow_type__organization:e}},n);return this.dispatch(a(c)),c}}class Lk extends k{constructor(){super(...arguments);m(this,"name","Workflow Step Reviewer");m(this,"url","/workflow-step-reviewers");m(this,"actions",{addOne:UP,addMany:Da,setOne:LP,setMany:NP,updateOne:HP,updateMany:GP,deleteOne:KP,deleteMany:$a,initialize:$P});m(this,"selectors",{selectById:ZP,selectByIds:JP})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=new Date().toISOString(),l=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,r=_({...e,submitted_at:o,created_by:l});this.dispatch(a(r));const h=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(r),blockers:[e.workflow,e.workflow_step],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,h]}bulkAdd(e){var y;const{store:n}=this.client,{addMany:a,setMany:c,deleteMany:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=e.map(f=>_({...f,submitted_at:l,created_by:o}));this.dispatch(a(r));const h=this.enqueueRequest({description:T(p.POST,this.name,!0),method:p.POST,url:`${this.url}/bulk/`,payload:{workflow_step_reviewers:r.map(f=>E(f))},blockers:r.flatMap(f=>[f.workflow,f.workflow_step]),blocks:r.map(f=>f.uuid)});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.map(f=>f.uuid)))}),[r,h]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=c(e.uuid)(n.getState());if(!d)throw new Error(`Expected workflow step reviewer with uuid ${e.uuid} to exist`);const o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,setOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected workflow step reviewer with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(r){throw this.dispatch(c(l)),r}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:d}=this.selectors,o=n.getState(),l=d(e)(o);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!0),method:p.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(r){throw this.dispatch(c(l)),r}}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{workflow__project:e}},n)).flat();return this.dispatch(a(d)),d}}class Nk extends k{constructor(){super(...arguments);m(this,"name","Workflow Step Review Request");m(this,"url","/workflow-step-review-requests");m(this,"actions",{addOne:tg,addMany:La,setOne:sg,setMany:ig,updateOne:ng,updateMany:ag,deleteOne:cg,deleteMany:Na,initialize:eg});m(this,"selectors",{selectById:dg,selectByIds:lg})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=new Date().toISOString(),l=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,r=_({...e,submitted_at:o,created_by:l});this.dispatch(a(r));const h=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(r),blockers:[e.workflow,e.workflow_step],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,h]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=c(e.uuid)(n.getState());if(!d)throw new Error(`Expected workflow step review request with uuid ${e.uuid} to exist`);const o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,setOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected workflow step review request with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(r){throw this.dispatch(c(l)),r}}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{workflow__project:e}},n)).flat();return this.dispatch(a(d)),d}}class Hk extends k{constructor(){super(...arguments);m(this,"name","Workflow Step Review");m(this,"url","/workflow-step-reviews");m(this,"actions",{addOne:mg,addMany:Ga,setOne:yg,setMany:fg,updateOne:Sg,updateMany:Ag,deleteOne:wg,deleteMany:Ka,initialize:pg});m(this,"selectors",{selectById:Og,selectByIds:Ig})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=new Date().toISOString(),l=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,r=_({...e,submitted_at:o,created_by:l});this.dispatch(a(r));const h=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(r),blockers:[e.workflow,e.workflow_step],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,h]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=c(e.uuid)(n.getState());if(!d)throw new Error(`Expected workflow step review with uuid ${e.uuid} to exist`);const o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,setOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected workflow step review with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(r){throw this.dispatch(c(l)),r}}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{workflow__project:e}},n)).flat();return this.dispatch(a(d)),d}}class Gk extends k{constructor(){super(...arguments);m(this,"name","Workflow Step");m(this,"url","/workflow-steps");m(this,"actions",{addOne:_g,addMany:Za,setOne:Rg,setMany:Mg,updateOne:kg,updateMany:vg,deleteOne:Eg,deleteMany:Ja,initialize:bg});m(this,"selectors",{selectById:Bg,selectByIds:qg})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(r),blockers:[r.workflow_type],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,h]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=c(e.uuid)(n.getState());if(!d)throw new Error(`No workflow step with uuid ${e.uuid} found in the store`);const o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.PATCH,url:`${this.url}/${d.uuid}/`,payload:{name:e.name,order:e.order},blockers:[d.uuid],blocks:[d.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`No workflow step with uuid ${e} found in the store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(r){throw this.dispatch(c(l)),r}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{workflow_type__organization:e}},n);return this.dispatch(a(c)),c}}class Kk extends k{constructor(){super(...arguments);m(this,"name","Workflow Type");m(this,"url","/workflow-types");m(this,"actions",{addOne:Dg,addMany:$g,setOne:Ug,setMany:Lg,updateOne:Ng,updateMany:Hg,deleteOne:Gg,deleteMany:Kg,initialize:jg});m(this,"selectors",{selectById:Zg,selectByIds:Jg})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(r),blockers:[],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,h]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=c(e.uuid)(n.getState());if(!d)throw new Error(`Expected workflow type with uuid ${e.uuid} to exist`);const o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[d.uuid],blocks:[d.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected workflow type with uuid ${e} to exist`);const r=vI(e)(o),h=zg(e)(o);this.dispatch(a(e)),this.dispatch(la(B(r))),this.dispatch(Ja(B(h)));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(y){throw this.dispatch(c(l)),this.dispatch(da(r)),this.dispatch(Za(h)),y}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}async function ac(t,s,e,n,a){const c=n instanceof yt;c&&s.checkAuth!==!1&&await n.auth.prepareAuth();const d={queryParams:"",isAuthNeeded:!0},{s3url:o,payload:l,headers:r,method:h,queryParams:y,attachmentHash:f,isExternalUrl:S,isAuthNeeded:O,isResponseBlob:P}={...d,...s};let I=s.url;const F=f?await e.files.fetchCache(f):void 0;if(f&&!F)throw new Error(`Cannot upload file ${f} because it's not cached.`);!S&&!I.startsWith("http")&&(!I.startsWith("/")&&!I.startsWith("blob:")&&(I="/"+I),I=t+I);const g=C=>{if(f){if(!o)throw new Error(`No S3 URL for file ${f}`);if("warning"in o)throw new Error(`S3 URL warning for file ${f}`);if(!F)throw new Error(`No file for file ${f}`);const q=o.fields["x-amz-checksum-sha1"];if(!q)throw new Error(`No checksum for file ${f}`);return C.set("x-amz-checksum-sha1",q).field({...l,...o.fields}).attach("file",F)}return C.send(l)},V={[p.GET]:()=>P?St.get(I.toString()).responseType("blob"):St.get(I.toString()),[p.POST]:()=>{const C=St.post(I.toString());return g(C)},[p.PATCH]:()=>{const C=St.patch(I.toString());return g(C)},[p.PUT]:()=>{const C=St.put(I.toString());return g(C)},[p.DELETE]:()=>{const C=St.delete(I.toString());return g(C)}}[h];let W=V();if(a==null||a.addEventListener("abort",()=>{console.debug("aborting request:",s.url),W.abort()}),O&&c){const C=n.auth.getAuthHeader();W=W.set("Authorization",C)}r&&(W=W.set(r));try{return await W.query(y)}catch(C){const q=mb(C),bb=q==null?void 0:q.status;if(c&&bb===401)return await n.auth.handleUnauthorized(W,q),W.query(y);throw new D({response:q,innerError:C,discard:tc.includes(bb)})}}class Yk{constructor(s){m(this,"store");this.store=s}_performRequest(s,e,n,a){const c=new fs,d={...e,uuid:e.uuid??mt.v4()};return ac(s,d,this,n,a).then(o=>{c.resolve(o.body)}).catch(o=>{o instanceof Error?c.reject(o):c.reject(new Error((o??wt).toString()))}),c}async performRequest(s,e,n,a){return this._performRequest(s,e,n,a).then(c=>{if(c instanceof D)throw c;return c})}async enqueueRequest(s,e,n){return this._enqueueRequest(s,e,n).then(a=>{if(a instanceof D)throw a;return a})}_enqueueRequest(s,e,n){const a=new fs,c={...s,BASE_URL:e,serviceName:n},d=this.store.dispatch(zT(c)),o=r=>{if(r)a.resolve(r.body);else{const h=new D({message:"Could not get a response from the server.",response:r,discard:!0});a.reject(h)}},l=r=>{r instanceof D?r.options.discard=!0:(console.error("Received an unexpected error while processing a request:",r,`
14
+ external URLs and therefore not prepended with VITE_API_URL.`;throw new Error(S)}const y=r.type.split("/")[1];if(!y)throw new Error("File has no extension");const f=a??h+"."+y;if(r=Tc(r,f),!r.name)throw new Error("Failed to set file's name");await this.addCache(r,h),ps[c]=new Promise(S=>{S(r)})}return r}processPresignedUrls(e){const n={};for(const[a,c]of Object.entries(e))n[a]=this.enqueueRequest({url:c.url,description:"Upload file to S3",method:p.POST,isExternalUrl:!0,isAuthNeeded:!1,attachmentHash:a,blockers:[`s3-${c.fields.key}`],blocks:[a],s3url:c});return n}async getFilePayload(e){const n=await At(e),a={sha1:n,file_type:e.type,extension:e.name.split(".").pop(),size:e.size};return await this.client.files.addCache(e,n),a}}class XM extends k{constructor(){super(...arguments);m(this,"name","Form Identifier");m(this,"url","/form-identifiers");m(this,"actions",{addOne:hm,addMany:pm,setOne:mm,setMany:ym,updateOne:fm,updateMany:Sm,deleteOne:Am,deleteMany:wm,initialize:um});m(this,"selectors",{selectById:Om,selectByIds:Im})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(r),blockers:[r.form],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,h]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=c(e.uuid)(n.getState());if(!d)throw new Error(`Expected form identifier with uuid ${e.uuid} to exist`);const o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected form identifier with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(r){throw this.dispatch(c(l)),r}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{form__organization:e}},n);return this.dispatch(a(c)),c}}class xM extends k{constructor(){super(...arguments);m(this,"name","Form Identifier Value");m(this,"url","/form-identifier-values");m(this,"actions",{addOne:bm,addMany:_m,setOne:Rm,setMany:Mm,updateOne:km,updateMany:vm,deleteOne:Em,deleteMany:Vm,initialize:gm});m(this,"selectors",{selectById:Bm,selectByIds:zm})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(r),blockers:[e.form_submission,e.form_identifier],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,h]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=c(e.uuid)(n.getState());if(!d)throw new Error(`Expected form identifier value with uuid ${e.uuid} to exist`);const o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected form identifier value with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(r){throw this.dispatch(c(l)),r}}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{form_submission__form_revision__form__organization:e}},n)).flat();return this.dispatch(a(d)),d}}class ek extends k{constructor(){super(...arguments);m(this,"name","Form Revision Attachment");m(this,"url","/form-revision-attachments");m(this,"actions",{addOne:Dm,addMany:$m,setOne:Um,setMany:Lm,updateOne:Nm,updateMany:Hm,deleteOne:Gm,deleteMany:Km,initialize:jm});m(this,"selectors",{selectById:Zm,selectByIds:Jm})}async bulkAdd(e){var f;const{addMany:n,setMany:a,deleteMany:c}=this.actions,d=new Date().toISOString(),o=((f=this.client.store.getState().userReducer.currentUser)==null?void 0:f.id)??null,l={},r=[],h=[];for(const S of e){const{revisionUuid:O,fieldIdentifier:P,file:I}=S,F=await this.client.files.getFilePayload(I);F.sha1 in l||(l[F.sha1]=F);const g=_({file:URL.createObjectURL(I),file_type:I.type,file_name:I.name,file_sha1:F.sha1,created_by:o,form_revision:O,submitted_at:d,field_identifier:P});r.push(g);const v={uuid:g.uuid,file_name:I.name,field_identifier:P,file_extension:F.extension,file_sha1:F.sha1,form_revision:O};h.push(v)}this.dispatch(n(r));const y=this.enqueueRequest({description:T(p.POST,this.name,!0),method:p.POST,url:`${this.url}/bulk/`,payload:{submitted_at:d,attachments:h,files:Object.values(l)},blockers:r.map(S=>S.form_revision),blocks:r.map(S=>S.uuid)});return y.then(S=>{this.client.files.processPresignedUrls(S.presigned_urls),this.dispatch(a(S.attachments))}).catch(()=>{this.dispatch(c(r.map(S=>S.uuid)))}),[r,y.then(({attachments:S})=>S)]}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{form_revision__form__organization:e}},n);return this.dispatch(a(c)),c}}class tk extends k{constructor(){super(...arguments);m(this,"name","Form Revision");m(this,"url","/form-revisions");m(this,"actions",{addOne:$i,addMany:Ui,setOne:ey,setMany:ty,updateOne:sy,updateMany:iy,deleteOne:Li,deleteMany:Ni,initialize:xm});m(this,"selectors",{selectById:ny,selectByIds:ay})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,r=new Date().toISOString(),h=_({...e,created_by:l,submitted_at:r});this.dispatch(a(h));const y=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(h),blockers:[e.form],blocks:[h.uuid]});return y.then(S=>{this.dispatch(c(S))}).catch(()=>{this.dispatch(d(h.uuid))}),[h,y]}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{form__organization:e}},n);return this.dispatch(a(c)),c}}class sk extends k{constructor(){super(...arguments);m(this,"name","Form");m(this,"url","/forms");m(this,"actions",{addOne:oy,addMany:uy,setOne:hy,setMany:py,updateOne:my,updateMany:yy,deleteOne:fy,deleteMany:Sy,initialize:ly});m(this,"selectors",{selectById:Ty,selectByIds:Oy})}add(e,n){var f;const{store:a}=this.client,{addOne:c,deleteOne:d}=this.actions,o=new Date().toISOString(),l=((f=a.getState().userReducer.currentUser)==null?void 0:f.id)??null,r=_({...e,submitted_at:o,created_by:l}),h=_({...n,form:r.uuid,submitted_at:o,created_by:l});this.dispatch(c(r)),this.dispatch($i(h));const y=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:{...E(r),initial_revision:{uuid:h.uuid,submitted_at:h.submitted_at,title:h.title,description:h.description,fields:h.fields}},blockers:[],blocks:[r.uuid,h.uuid]});return y.catch(S=>{throw this.dispatch(d(r.uuid)),this.dispatch(Li(h.uuid)),S}),[r,h,y]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error("Expected form to exist");const r=Hy(e)(o),h=cy(e)(o);this.dispatch(a(e)),this.dispatch(sn(B(r))),this.dispatch(Ni(B(h)));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(y){throw this.dispatch(c(l)),this.dispatch(Ui(h)),this.dispatch(tn(r)),y}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class ik extends k{constructor(){super(...arguments);m(this,"name","Form Submission Attachment");m(this,"url","/form-submission-attachments");m(this,"actions",{addOne:Py,addMany:Zi,setOne:gy,setMany:by,updateOne:_y,updateMany:Ry,deleteOne:My,deleteMany:Ji,initialize:Fy});m(this,"selectors",{selectById:ky,selectByIds:vy})}async bulkAdd(e){var f;const{addMany:n,setMany:a,deleteMany:c}=this.actions,d=new Date().toISOString(),o=((f=this.client.store.getState().userReducer.currentUser)==null?void 0:f.id)??null,l={},r=[],h=[];for(const S of e){const{submissionUuid:O,fieldIdentifier:P,file:I}=S,F=await this.client.files.getFilePayload(I);F.sha1 in l||(l[F.sha1]=F);const g=_({file:URL.createObjectURL(I),file_type:I.type,file_name:I.name,file_sha1:F.sha1,created_by:o,form_submission:O,submitted_at:d,field_identifier:P});r.push(g);const v={uuid:g.uuid,file_name:I.name,file_sha1:F.sha1,file_extension:F.extension,field_identifier:P,form_submission:O};h.push(v)}this.dispatch(n(r));const y=this.enqueueRequest({description:T(p.POST,this.name,!0),method:p.POST,url:`${this.url}/bulk/`,payload:{submitted_at:d,attachments:h,files:Object.values(l)},blockers:r.map(S=>S.form_submission),blocks:r.map(S=>S.uuid)});return y.then(S=>{this.client.files.processPresignedUrls(S.presigned_urls),this.dispatch(a(S.attachments))}).catch(S=>{throw this.dispatch(c(r.map(O=>O.uuid))),S}),[r,y.then(({attachments:S})=>S)]}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,d=n.getState(),o=xi(e)(d);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!0),method:p.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(l){throw this.dispatch(c(o)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{form_submission__form_revision__form__organization:e}},n)).flat();return this.dispatch(a(d)),d}}class nk extends k{constructor(){super(...arguments);m(this,"name","Form Submission");m(this,"url","/form-submissions");m(this,"actions",{addOne:Cy,addMany:tn,setOne:zy,setMany:qy,updateOne:jy,updateMany:Dy,deleteOne:$y,deleteMany:sn,initialize:By});m(this,"selectors",{selectById:Ly,selectByIds:Ny})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,r=new Date().toISOString(),h=_({...e,created_by:l,submitted_at:r}),y=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(h),blockers:[e.form_revision],blocks:[h.uuid]});return this.dispatch(a(h)),y.then(S=>{this.dispatch(c(S))}).catch(()=>{this.dispatch(d(h.uuid))}),[h,y]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=n.getState(),o=c(e.uuid)(d);if(!o)throw new Error(`Expected submission with uuid ${e.uuid} to exist`);const l={...o,...e};this.dispatch(a(l));const r=this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.PATCH,url:`${this.url}/${l.uuid}/`,payload:e,blockers:[l.uuid],blocks:[l.uuid]});return r.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(a(o))}),[l,r]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected submission with uuid ${e} to exist`);const r=Ey(e)(o);this.dispatch(a(e)),this.dispatch(Ji(B(r)));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(h){throw this.dispatch(c(l)),this.dispatch(Zi(r)),h}}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{limit:this.pageSize,paginate:!0,form_revision__form_organization:e}},n)).flat();return this.dispatch(a(d)),d}}class ak extends k{constructor(){super(...arguments);m(this,"name","Geo Image");m(this,"url","/geo-images");m(this,"actions",{addOne:Qy,addMany:Xy,setOne:Zy,setMany:Jy,updateOne:xy,updateMany:ef,deleteOne:tf,deleteMany:sf,initialize:Yy});m(this,"selectors",{selectById:af,selectByIds:cf})}async add(e){var P;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,{file:o,...l}=e,r=new Date().toISOString(),h=((P=n.getState().userReducer.currentUser)==null?void 0:P.id)??null,y=l.project,f=await this.client.files.getFilePayload(o),S=_({...l,file_name:o.name,file_sha1:f.sha1,file_type:o.type,file:URL.createObjectURL(o),submitted_at:r,created_by:h});this.dispatch(a(S));const O=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:{uuid:S.uuid,submitted_at:r,title:S.title,description:S.description,geo_marker:S.geo_marker,canvas_marker:S.canvas_marker,sha1:S.file_sha1,project:S.project,file_name:S.file_name,direction:S.direction,original_date:S.original_date,file:f},blocks:[y],blockers:[y]});return O.then(I=>{this.client.files.processPresignedUrls(I.presigned_urls),this.dispatch(c(I.geo_image))}).catch(()=>{this.dispatch(d(S.uuid))}),[S,O.then(I=>I.geo_image)]}async bulkAdd(e,n){var P;const{store:a}=this.client,{addMany:c,setMany:d,deleteMany:o}=this.actions,l=new Date().toISOString(),r=((P=a.getState().userReducer.currentUser)==null?void 0:P.id)??null,h=[],y=[],f=[],S={};for(const I of e){const{file:F,...g}=I,v=await this.client.files.getFilePayload(F);v.sha1 in S||(S[v.sha1]=v);const V=_({...g,file_name:F.name,file_sha1:v.sha1,file_type:F.type,file:URL.createObjectURL(F),submitted_at:l,created_by:r,project:n});h.push(V),y.push(V.uuid),f.push({uuid:V.uuid,sha1:V.file_sha1,file_name:V.file_name,title:V.title,description:V.description,geo_marker:V.geo_marker,canvas_marker:V.canvas_marker,direction:V.direction,original_date:V.original_date})}this.dispatch(c(h));const O=this.enqueueRequest({description:T(p.POST,this.name,!0),method:p.POST,url:`${this.url}/bulk/`,payload:{submitted_at:l,project:n,geo_images:f,files:Object.values(S)},blocks:[n],blockers:y});return O.then(I=>{this.client.files.processPresignedUrls(I.presigned_urls),this.dispatch(d(I.geo_images))}).catch(()=>{this.dispatch(o(y))}),[h,O.then(I=>I.geo_images)]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=n.getState(),o=c(e.uuid)(d);if(!o)throw new Error(`Map image with uuid ${e.uuid} does not exist in the store`);const l={...o,...e};this.dispatch(a(l));const r=this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blocks:[e.uuid],blockers:[e.uuid]});return r.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(a(o))}),[l,r]}async delete(e){const{store:n}=this.client,{deleteOne:a,setOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Map image with uuid ${e} does not exist in the store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blocks:[e],blockers:[e]})}catch(r){throw this.dispatch(c(l)),r}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{project:e}},n);return this.dispatch(a(c)),c}}class ck extends k{constructor(){super(...arguments);m(this,"name","Issue Association");m(this,"url","/issue-associations");m(this,"actions",{addOne:mf,addMany:Yt,setOne:uf,setMany:of,updateOne:hf,updateMany:pf,deleteOne:yf,deleteMany:Zt,initialize:lf});m(this,"selectors",{selectById:Sf,selectByIds:Af})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=new Date().toISOString(),l=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,r=_({...e,submitted_at:o,created_by:l});this.dispatch(a(r));const h=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(r),blockers:[e.associated_issue,...e.issue?[e.issue]:[],...e.asset?[e.asset]:[]],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,h]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=d(e)(n.getState());if(!o)throw new Error(`Issue association with uuid ${e} not found in store.`);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(o)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{associated_issue__project:e}},n)).flat();return this.dispatch(a(d)),d}}class rk extends L{constructor(){super(...arguments);m(this,"name","Issue Attachment");m(this,"url","/issue-attachments");m(this,"actions",{addOne:gf,addMany:ln,setOne:bf,setMany:_f,updateOne:Rf,updateMany:Mf,deleteOne:kf,deleteMany:on,initialize:Pf});m(this,"selectors",{selectById:Vf,selectByIds:Wf})}getId(e){return e.uuid}buildModel(e){return _({file:URL.createObjectURL(e.file),file_sha1:e.file_sha1,created_by:e.created_by,file_name:e.file.name,file_type:e.file.type,submitted_at:e.submitted_at,issue:e.modelUuid})}buildPayload(e,n){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:n.extension,issue:e.issue}}async bulkAdd(e){return this._bulkAdd(e.map(n=>({modelUuid:n.issueUuid,file:n.file})))}async delete(e){return this._delete(e)}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{issue__project:e}},n)).flat();return this.dispatch(a(d)),d}}class dk extends L{constructor(){super(...arguments);m(this,"name","Issue Comment Attachment");m(this,"url","/issue-comment-attachments");m(this,"actions",{addOne:Cf,addMany:jf,setOne:Df,setMany:$f,updateOne:Uf,updateMany:Lf,deleteOne:Nf,deleteMany:Hf,initialize:qf});m(this,"selectors",{selectById:Kf,selectByIds:Yf})}getId(e){return e.uuid}buildModel(e){return _({file:URL.createObjectURL(e.file),file_sha1:e.file_sha1,created_by:e.created_by,file_name:e.file.name,file_type:e.file.type,submitted_at:e.submitted_at,issue_comment:e.modelUuid})}buildPayload(e,n){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:n.extension,issue_comment:e.issue_comment}}async bulkAdd(e){return this._bulkAdd(e.map(n=>({modelUuid:n.issueCommentUuid,file:n.file})))}async delete(e){return this._delete(e)}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{issue_comment__issue__project:e}},n)).flat();return this.dispatch(a(d)),d}}class lk extends k{constructor(){super(...arguments);m(this,"name","Issue Comment");m(this,"url","/issue-comments");m(this,"actions",{addOne:Xf,addMany:xf,setOne:eS,setMany:tS,updateOne:sS,updateMany:iS,deleteOne:nS,deleteMany:aS,initialize:Qf});m(this,"selectors",{selectById:cS,selectByIds:rS})}add(e){const{store:n}=this.client,{addOne:a,updateOne:c,deleteOne:d}=this.actions,o=_({...e,author:n.getState().userReducer.currentUser.id,submitted_at:new Date().toISOString()});this.dispatch(a(o));const l=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(o),blockers:[e.issue],blocks:[o.uuid]});return l.then(r=>{this.dispatch(c(r))}).catch(()=>{this.dispatch(d(o.uuid))}),[o,l]}update(e){const{store:n}=this.client,{updateOne:a}=this.actions,{selectById:c}=this.selectors,d=c(e.uuid)(n.getState());if(!d)throw new Error(`Comment with uuid ${e.uuid} not found in store`);const o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=d(e)(n.getState());if(!o)throw new Error(`Comment with uuid ${e} not found in store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(o)),l}}async refreshStore(e,n){const{setMany:a}=this.actions,d=(await this.listPaginated({queryParams:{issue__project:e}},n)).flat();return this.dispatch(a(d)),d}}class ok extends k{constructor(){super(...arguments);m(this,"name","Issue");m(this,"url","/issues");m(this,"actions",{addOne:uS,addMany:Sn,setOne:hS,setMany:pS,updateOne:mS,updateMany:yS,deleteOne:fS,deleteMany:An,initialize:oS});m(this,"selectors",{selectById:AS,selectByIds:wS})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=n.getState(),l=new Date().toISOString(),r=((f=o.userReducer.currentUser)==null?void 0:f.id)??null,h=_({...e,submitted_at:l,created_by:r});this.dispatch(a(h));const y=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(h),blockers:[h.project,h.issue_type,...h.category?[h.category]:[]],blocks:[h.uuid]});return y.then(S=>{this.dispatch(c(S))}).catch(S=>{throw this.dispatch(d(h.uuid)),S}),[h,y]}update(e){var y;const{updateOne:n}=this.actions,{selectById:a}=this.selectors,c=this.client.store.getState(),d=a(e.uuid)(c);if(!d)throw new Error(`Attempting to update an issue with uuid ${e.uuid} that doesn't exist in the store`);const o={...d,...e};this.dispatch(n(o));const l={};for(const f of[j.TITLE,j.DESCRIPTION,j.STATUS,j.CATEGORY,j.PRIORITY,j.ASSIGNED_TO,j.DUE_DATE])if(f in e&&e[f]!==d[f])switch(f){case j.PRIORITY:l[f]=e[f];break;case j.DUE_DATE:l[f]=e[f];break;case j.DESCRIPTION:l[f]=e[f];break;case j.TITLE:l[f]=e[f];break;case j.STATUS:{const S=e[f],O=zn(S)(c);if(!O)throw new Error(`Trying to update issue type status with ${S} which does not exist in store`);l[f]={name:O.name,color:O.color,uuid:O.uuid};break}case j.CATEGORY:{const S=e[f];if(S===null)l[f]=null;else{const O=Ri(S)(c);if(!O)throw new Error(`Trying to update category with ${S} which does not exist in store.`);l[f]={name:O.name,color:O.color,uuid:O.uuid}}break}case j.ASSIGNED_TO:{const S=e[f];if(S===null)l[f]=null;else{const O=es(S)(c);if(!O)throw new Error(`Trying to update assigned to with ${S} which does not exist in store.`);l[f]={full_name:O.username,id:O.id}}break}}const r=_({created_by:((y=c.userReducer.currentUser)==null?void 0:y.id)??null,submitted_at:new Date().toISOString(),issue:d.uuid,changes:l});this.dispatch(Cn(r));const h=this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return h.then(f=>{this.dispatch(n(f))}).catch(()=>{this.dispatch(n(d)),this.dispatch(Dn(r.uuid))}),[o,h]}bulkUpdate(e,n){const{store:a}=this.client,{updateMany:c}=this.actions,{selectByIds:d}=this.selectors,o=B(e).toSorted(Wt);if(o.length!==e.length)throw new Error("payloads contains duplicate uuids.");const l=d(o)(a.getState()).toSorted(Os);if(o.length!=l.length)throw new Error(`Attempting to bulk update ${o.length-l.length} issues that dont exist in the store`);const r=[];for(let S=0;S<o.length;S++)r.push({...l[S],...e[S]});this.dispatch(c(r));const h=pt(e,Math.min(n??e.length,U)),y=[];let f=null;for(const S of h){const O=mt.v4(),P=B(S),I=S.map(({status:v})=>v).filter(Boolean),F=S.map(({category:v})=>v).filter(Boolean),g=this.enqueueRequest({description:T(p.PATCH,this.name,!0),method:p.PATCH,url:`${this.url}/bulk/`,payload:{payloads:S},blockers:(f?[f]:[]).concat(P).concat(I).concat(F),blocks:[O].concat(P)});y.push(g),f=O}return Promise.all(y).then(S=>{this.dispatch(c(S.flat()))}).catch(()=>{this.dispatch(c(l))}),[r,y]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`No issue with uuid ${e} found in the store`);const r=Ef(e)(o),h=Gw(e)(o),y={};for(const S of wf(e)(o))y[S.uuid]=S;for(const S of Tf(e)(o))y[S.uuid]=S;const f=Object.values(y);this.dispatch(a(e)),this.dispatch(on(B(r))),this.dispatch($n(B(h))),this.dispatch(Zt(B(f)));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(S){throw this.dispatch(c(l)),this.dispatch(ln(r)),this.dispatch(jn(h)),this.dispatch(Yt(f)),S}}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{project:e}},n)).flat();return this.dispatch(a(d)),d}}class uk extends L{constructor(){super(...arguments);m(this,"name","Issue Type Attachment");m(this,"url","/issue-type-attachments");m(this,"actions",{addOne:PS,addMany:gS,setOne:bS,setMany:_S,updateOne:RS,updateMany:MS,deleteOne:kS,deleteMany:vS,initialize:FS});m(this,"selectors",{selectById:VS,selectByIds:WS})}getId(e){return e.uuid}buildModel(e){return _({file:URL.createObjectURL(e.file),file_sha1:e.file_sha1,created_by:e.created_by,file_name:e.file.name,file_type:e.file.type,submitted_at:e.submitted_at,issue_type:e.modelUuid})}buildPayload(e,n){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:n.extension,issue_type:e.issue_type}}async bulkAdd(e){return this._bulkAdd(e.map(n=>({modelUuid:n.issueTypeUuid,file:n.file})))}async delete(e){return this._delete(e)}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{issue_type__organization:e}},n);return this.dispatch(a(c)),c}}class hk extends k{constructor(){super(...arguments);m(this,"name","Issue Type Fields Attachment");m(this,"url","/issue-type-fields-attachments");m(this,"actions",{addOne:CS,addMany:jS,setOne:DS,setMany:$S,updateOne:US,updateMany:LS,deleteOne:NS,deleteMany:HS,initialize:qS});m(this,"selectors",{selectById:KS,selectByIds:YS})}async bulkAdd(e){var f;const{addMany:n,setMany:a,deleteMany:c}=this.actions,d=new Date().toISOString(),o=((f=this.client.store.getState().userReducer.currentUser)==null?void 0:f.id)??null,l={},r=[],h=[];for(const S of e){const{fieldsRevisionUuid:O,fieldIdentifier:P,file:I}=S,F=await this.client.files.getFilePayload(I);F.sha1 in l||(l[F.sha1]=F);const g=_({file:URL.createObjectURL(I),file_type:I.type,file_name:I.name,file_sha1:F.sha1,created_by:o,fields_revision:O,submitted_at:d,field_identifier:P});r.push(g);const v={uuid:g.uuid,file_name:I.name,file_extension:F.extension,field_identifier:P,file_sha1:F.sha1,fields_revision:O};h.push(v)}this.dispatch(n(r));const y=this.enqueueRequest({description:T(p.POST,this.name,!0),method:p.POST,url:`${this.url}/bulk/`,payload:{submitted_at:d,attachments:h,files:Object.values(l)},blockers:r.map(S=>S.fields_revision),blocks:r.map(S=>S.uuid)});return y.then(S=>{this.client.files.processPresignedUrls(S.presigned_urls),this.dispatch(a(S.attachments))}).catch(()=>{this.dispatch(c(r.map(S=>S.uuid)))}),[r,y.then(({attachments:S})=>S)]}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{fields_revision__issue_type__organization:e}},n);return this.dispatch(a(c)),c}}class pk extends k{constructor(){super(...arguments);m(this,"name","Issue Type Fields");m(this,"url","/issue-type-fields");m(this,"actions",{addOne:hA,addMany:pA,setOne:mA,setMany:yA,updateOne:fA,updateMany:SA,deleteOne:AA,deleteMany:wA,initialize:uA});m(this,"selectors",{selectById:OA,selectByIds:IA})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(r),blockers:[r.issue_type],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(f=>{throw this.dispatch(d(r.uuid)),f}),[r,h]}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{issue_type__organization:e}},n);return this.dispatch(a(c)),c}}class mk extends k{constructor(){super(...arguments);m(this,"name","Issue Type Field Values Attachment");m(this,"url","/issue-type-field-values-attachments");m(this,"actions",{addOne:bA,addMany:bn,setOne:_A,setMany:RA,updateOne:MA,updateMany:kA,deleteOne:vA,deleteMany:_n,initialize:gA});m(this,"selectors",{selectById:VA,selectByIds:WA})}async bulkAdd(e){var f;const{addMany:n,setMany:a,deleteMany:c}=this.actions,d=new Date().toISOString(),o=((f=this.client.store.getState().userReducer.currentUser)==null?void 0:f.id)??null,l={},r=[],h=[];for(const S of e){const{fieldValuesUuid:O,fieldIdentifier:P,file:I}=S,F=await this.client.files.getFilePayload(I);F.sha1 in l||(l[F.sha1]=F);const g=_({file:URL.createObjectURL(I),file_type:I.type,file_name:I.name,file_sha1:F.sha1,created_by:o,field_values:O,submitted_at:d,field_identifier:P});r.push(g);const v={uuid:g.uuid,file_name:I.name,file_sha1:F.sha1,file_extension:F.extension,field_identifier:P,field_values:O};h.push(v)}this.dispatch(n(r));const y=this.enqueueRequest({description:T(p.POST,this.name,!0),method:p.POST,url:`${this.url}/bulk/`,payload:{submitted_at:d,attachments:h,files:Object.values(l)},blockers:r.map(S=>S.field_values),blocks:r.map(S=>S.uuid)});return y.then(({presigned_urls:S,attachments:O})=>{this.client.files.processPresignedUrls(S),this.dispatch(a(O))}).catch(S=>{throw this.dispatch(c(r.map(O=>O.uuid))),S}),[r,y.then(({attachments:S})=>S)]}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:d}=this.selectors,o=n.getState(),l=d(e)(o);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!0),method:p.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(r){throw this.dispatch(c(l)),r}}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{field_values__issue__project:e,latest:!0}},n)).flat();return this.dispatch(a(d)),d}}class yk extends k{constructor(){super(...arguments);m(this,"name","Issue Type Field Values");m(this,"url","/issue-type-field-values");m(this,"actions",{addOne:XS,addMany:xS,setOne:eA,setMany:tA,updateOne:sA,updateMany:iA,deleteOne:nA,deleteMany:aA,initialize:QS});m(this,"selectors",{selectById:rA,selectByIds:dA})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,r=new Date().toISOString(),h=_({...e,created_by:l,submitted_at:r}),y=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(h),blockers:[e.issue,e.fields_revision],blocks:[h.uuid]});return this.dispatch(a(h)),y.then(S=>{this.dispatch(c(S))}).catch(()=>{this.dispatch(d(h.uuid))}),[h,y]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=n.getState(),o=c(e.uuid)(d);if(!o)throw new Error(`Expected IssueTypeFieldValues with uuid ${e.uuid} to exist`);const l={...o,...e};this.dispatch(a(l));const r=this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[l.uuid,l.fields_revision,l.issue],blocks:[l.uuid]});return r.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(a(o))}),[l,r]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected submission with uuid ${e} to exist`);const r=BA(e)(o);this.dispatch(a(e)),this.dispatch(_n(B(r)));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(h){throw this.dispatch(c(l)),this.dispatch(bn(r)),h}}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{issue__project:e,latest:!0}},n)).flat();return this.dispatch(a(d)),d}}class fk extends k{constructor(){super(...arguments);m(this,"name","Issue Type Identifier");m(this,"url","/issue-type-identifiers");m(this,"actions",{addOne:jA,addMany:DA,setOne:$A,setMany:UA,updateOne:LA,updateMany:NA,deleteOne:HA,deleteMany:GA,initialize:CA});m(this,"selectors",{selectById:YA,selectByIds:ZA})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(r),blockers:[r.issue_type],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,h]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=c(e.uuid)(n.getState());if(!d)throw new Error(`Expected issue type identifier with uuid ${e.uuid} to exist`);const o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected issue type identifier with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(r){throw this.dispatch(c(l)),r}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{issue_type__organization:e}},n);return this.dispatch(a(c)),c}}class Sk extends k{constructor(){super(...arguments);m(this,"name","Issue Type Identifier Value");m(this,"url","/issue-type-identifier-values");m(this,"actions",{addOne:xA,addMany:ew,setOne:tw,setMany:sw,updateOne:iw,updateMany:nw,deleteOne:aw,deleteMany:cw,initialize:XA});m(this,"selectors",{selectById:dw,selectByIds:lw})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(r),blockers:[e.issue,e.issue_type_identifier],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,h]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=c(e.uuid)(n.getState());if(!d)throw new Error(`Expected issue type identifier value with uuid ${e.uuid} to exist`);const o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected issue type identifier value with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(r){throw this.dispatch(c(l)),r}}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{issue__project:e}},n)).flat();return this.dispatch(a(d)),d}}class Ak extends k{constructor(){super(...arguments);m(this,"name","Issue Type");m(this,"url","/issue-types");m(this,"actions",{addOne:pw,addMany:mw,setOne:yw,setMany:fw,updateOne:Sw,updateMany:Aw,deleteOne:ww,deleteMany:Tw,initialize:hw});m(this,"selectors",{selectById:Iw,selectByIds:Fw})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,r=new Date().toISOString(),h=_({...e,submitted_at:r,created_by:l});this.dispatch(a(h));const y=this.enqueueRequest({method:p.POST,url:`${this.url}/`,payload:E(h),blockers:[],blocks:[h.uuid]});return y.then(S=>{this.dispatch(c(S))}).catch(()=>{this.dispatch(d(h.uuid))}),[h,y]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=n.getState(),o=c(e.uuid)(d);if(!o)throw new Error(`IssueType with uuid ${e.uuid} does not exist in the store.`);const l={...o,...e};this.dispatch(a(l));const r=this.enqueueRequest({method:p.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return r.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(a(o))}),[l,r]}async delete(e){const{store:n}=this.client,{deleteOne:a,setOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`IssueType with uuid ${e} does not exist in the store.`);const r=TS(e)(o);this.dispatch(a(e)),this.dispatch(An(B(r)));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(h){throw this.dispatch(c(l)),this.dispatch(Sn(r)),h}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class wk extends k{constructor(){super(...arguments);m(this,"name","Issue Type Status");m(this,"url","/issue-type-statuses");m(this,"actions",{addOne:_w,addMany:Rw,setOne:Mw,setMany:kw,updateOne:vw,updateMany:Ew,deleteOne:Vw,deleteMany:Ww,initialize:bw});m(this,"selectors",{selectById:zn,selectByIds:zw})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(r),blockers:[e.issue_type],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,h]}update(e){const{setOne:n}=this.actions,{selectById:a}=this.selectors,c=this.client.store.getState(),d=a(e.uuid)(c);if(!d)throw new Error(`Expected an existing issue type status with uuid ${e.uuid}`);const o={...d,...e};this.dispatch(n(o));const l=this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(r=>{this.dispatch(n(r))}).catch(()=>{this.dispatch(n(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=d(e)(n.getState());if(!o)throw new Error(`No issue type status with uuid ${e} found in the store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(o)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{issue_type__organization:e}},n);return this.dispatch(a(c)),c}}class Tk extends k{constructor(){super(...arguments);m(this,"name","Issue Update");m(this,"url","/issue-updates");m(this,"actions",{addOne:Cn,addMany:jn,setOne:Dw,setMany:$w,updateOne:Uw,updateMany:Lw,deleteOne:Dn,deleteMany:$n,initialize:jw});m(this,"selectors",{selectById:Nw,selectByIds:Hw})}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{issue__project:e}},n)).flat();return this.dispatch(a(d)),d}}const Ok=1800;function Ik(t){if(!t.access)throw new Error("Missing access token");if(!t.refresh)throw new Error("Missing refresh token");return{accessToken:t.access,refreshToken:t.refresh}}class Fk extends AM{constructor(){super(...arguments);m(this,"_getRenewedTokens",async e=>{const n=this.performRequest({method:p.POST,url:this.refreshTokensUrl,payload:{refresh:e},isAuthNeeded:!1,checkAuth:!1});let a;try{a=await n}catch(c){console.error("Could not renew tokens; clearing auth",c),this.clearAuth();return}if(!a.access)throw new Error("Missing access token");return{accessToken:a.access,refreshToken:a.refresh??this.getRefreshToken()}})}clearAuth(){console.debug(this.constructor.name,"clearing auth;"),this.dispatch(sp(!1)),this.clearTokens(),this.dispatch(b()),this.dispatch(b())}async renewTokens(){const e=this.getRefreshToken();if(!e)throw new Error("No refresh token found");console.debug(this.constructor.name,"renewing tokens");try{const n=await this._getRenewedTokens(e);if(!n)return;console.log("Got renewed tokens"),this.setTokens(n)}catch(n){throw console.error("Could not renew tokens; clearing auth",n),this.clearAuth(),n}}tokenIsExpiringSoon(){const e=this.getAccessToken();if(!e)return!1;const n=Date.now()/1e3;let a;try{a=Vb(e).exp??n}catch{a=n}return a-n<Ok}getAuthHeader(){return`Bearer ${this.getAccessToken()}`}async prepareAuth(){if(this.tokenIsExpiringSoon()){console.debug(this.constructor.name,"preparing auth");try{await this.renewTokens()}catch(e){return e instanceof D&&this.clearAuth(),e instanceof Error?Promise.reject(e):Promise.reject(new Error((e??wt).toString()))}}}async handleUnauthorized(e,n){const a=this.client.store.getState();if(e.url.endsWith("/token/refresh/"))throw a.authReducer.isLoggedIn&&console.warn("No signed-in user to sign out."),this.clearAuth(),new D({message:"You have been signed out due to inactivity.",response:n,discard:!0});if(a.authReducer.isLoggedIn)await this.renewTokens();else throw console.debug("Forbidden; user is not logged in."),new D({message:"Incorrect username or password.",response:n,discard:!0})}async initAuth(e){const n=mt.v4();return console.debug(this.constructor.name,"Initiating auth"),this.performRequest({uuid:n,method:p.POST,url:this.initTokensUrl,payload:e,isAuthNeeded:!1,checkAuth:!1}).then(a=>{this.setTokens(Ik(a))})}}class Pk extends Tt{constructor(){super(...arguments);m(this,"name","Organization Access");m(this,"url","/organization-accesses");m(this,"actions",{addOne:rT,addMany:dT,setOne:lT,setMany:oT,updateOne:uT,updateMany:hT,deleteOne:pT,deleteMany:mT,initialize:cT});m(this,"selectors",{selectById:fT,selectByIds:ST})}update(e){const{store:n}=this.client,{updateOne:a}=this.actions,{selectById:c}=this.selectors,d=c(e.uuid)(n.getState()),o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(r=>{throw this.dispatch(a(d)),r}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o),r=es(l.user)(o);this.dispatch(a(l.uuid)),this.dispatch(Gn(l.user));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${l.uuid}/`,blockers:[l.uuid],blocks:[]})}catch(h){throw this.dispatch(c(l)),this.dispatch(Hn(r)),h}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class gk extends Tt{constructor(){super(...arguments);m(this,"name","Organization");m(this,"url","/organizations");m(this,"actions",{addOne:PT,addMany:FT,setOne:IT,setMany:OT,updateOne:bT,updateMany:gT,deleteOne:_T,deleteMany:RT,initialize:TT});m(this,"selectors",{selectById:vT,selectByIds:ET})}async add(e){const{addOne:n}=this.actions,a=await this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:e,blockers:[],blocks:[]});return this.dispatch(n(a)),a}async update(e){const{setOne:n}=this.actions,a=await this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return this.dispatch(n(a)),a}async invite(e,n){return this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/${e}/invite/${n}/`,blockers:[],blocks:[]})}async refreshStore(e){const{initialize:n}=this.actions,a=await this.list({},e);return this.dispatch(n(a)),a}}class bk extends k{constructor(){super(...arguments);m(this,"name","Project Access");m(this,"url","/project-accesses");m(this,"actions",{addOne:UT,addMany:LT,setOne:NT,setMany:HT,updateOne:GT,updateMany:KT,deleteOne:YT,deleteMany:ZT,initialize:$T});m(this,"selectors",{selectById:QT,selectByIds:XT})}add(e){var r;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=_({...e,created_by:((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null});this.dispatch(a(o));const l=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(o),blockers:[o.organization_access,o.project],blocks:[o.uuid]});return l.then(h=>{this.dispatch(c(h))}).catch(h=>{throw this.dispatch(d(o.uuid)),h}),[o,l]}bulkAdd(e){var h;const{store:n}=this.client,{addMany:a,deleteMany:c,updateMany:d}=this.actions,o=((h=n.getState().userReducer.currentUser)==null?void 0:h.id)??null,l=e.map(y=>_({...y,created_by:o}));this.dispatch(a(l));const r=this.enqueueRequest({description:T(p.POST,this.name,!0),method:p.POST,url:`${this.url}/bulk/`,payload:{project_accesses:l.map(y=>E(y))},blockers:l.flatMap(y=>[y.project,y.organization_access]),blocks:l.map(y=>y.uuid)});return r.then(y=>{this.dispatch(d(y))}).catch(y=>{throw this.dispatch(c(l.map(f=>f.uuid))),y}),[l,r]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=c(e.uuid)(n.getState()),o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[]});return l.then(r=>{this.dispatch(a(r))}).catch(r=>{throw this.dispatch(a(d)),r}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=d(e)(n.getState());this.dispatch(a(e));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(o)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{project__organization:e}},n);return this.dispatch(a(c)),c}}class _k extends L{constructor(){super(...arguments);m(this,"name","Project Attachment");m(this,"url","/project-attachments");m(this,"actions",{addOne:tO,addMany:sO,setOne:iO,setMany:nO,updateOne:aO,updateMany:cO,deleteOne:rO,deleteMany:dO,initialize:eO});m(this,"selectors",{selectById:oO,selectByIds:uO})}getId(e){return e.uuid}buildModel(e){return _({file:URL.createObjectURL(e.file),file_sha1:e.file_sha1,created_by:e.created_by,file_name:e.file.name,file_type:e.file.type,submitted_at:e.submitted_at,project:e.modelUuid})}buildPayload(e,n){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:n.extension,project:e.project}}async bulkAdd(e){return this._bulkAdd(e.map(n=>({modelUuid:n.projectUuid,file:n.file})))}async delete(e){return this._delete(e)}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{project__organization:e}},n);return this.dispatch(a(c)),c}}class Rk extends k{constructor(){super(...arguments);m(this,"name","Project File");m(this,"url","/project-files");m(this,"actions",{addOne:SO,addMany:AO,setOne:yO,setMany:fO,updateOne:wO,updateMany:TO,deleteOne:OO,deleteMany:IO,initialize:mO});m(this,"selectors",{selectById:RO,selectByIds:MO})}async saveExisting(e){const{setOne:n}=this.actions;if(!e.uuid)throw new Error("You can only use this method to save existing project files. The one provided has no uuid.");const a={...e};delete a.file;const c=this.enqueueRequest({method:p.PATCH,url:`${this.url}/${e.uuid}/`,payload:a,blockers:[e.uuid],blocks:[e.uuid]});return c.then(d=>{this.dispatch(n(d))}),c}saveActive(){const{store:e}=this.client,{setOne:n}=this.actions,a=e.getState(),c=a.projectFileReducer.activeProjectFileId;if(!c)throw new Error("No active project file");const d=a.projectFileReducer.instances[c];if(!d)throw new Error("No active project file");if(!d.bounds&&!d.canvas_bounds)throw new Error("Project file must either have bounds or canvas_bounds set");let o;if(typeof d.file=="string"&&!d.file.startsWith("blob:")){const h={...d};delete h.file,o={method:p.PATCH,url:`${this.url}/${c}/`,payload:h,blockers:[c],blocks:[c]}}else o=new Promise((h,y)=>{this.client.files.uploadFileToS3(d.file_sha1).then(([f])=>{h({method:p.POST,url:`${this.url}/`,payload:{...d,...f},blockers:[c],blocks:[c]})}).catch(y)});const r=Promise.resolve(o).then(h=>this.enqueueRequest(h));return r.then(h=>{this.dispatch(n(h))}),this.dispatch(gO),this.dispatch(PO(null)),this.dispatch(FO(!1)),[d,r]}async delete(e){const{store:n}=this.client,{addOne:a,deleteOne:c}=this.actions,{selectById:d}=this.selectors,o=d(e)(n.getState());if(!o)throw new Error(`Expected project file with uuid ${e} to exist in the store.`);this.dispatch(c(e));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(a(o)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{project:e}},n)).flat();return this.dispatch(a(d)),d}}class Mk extends Tt{constructor(){super(...arguments);m(this,"name","Project");m(this,"url","/projects");m(this,"actions",{addOne:zO,addMany:BO,setOne:WO,setMany:VO,updateOne:CO,updateMany:qO,deleteOne:jO,deleteMany:DO,initialize:EO});m(this,"selectors",{selectById:LO,selectByIds:NO})}async add(e){const{addOne:n}=this.actions,a=await this.performRequest({method:p.POST,url:`${this.url}/`,payload:E(e)});return this.dispatch(n(a)),a}async update(e){const{updateOne:n}=this.actions,a=await this.performRequest({method:p.PATCH,url:`${this.url}/${e.uuid}/`,payload:E(e)});return this.dispatch(n(a)),a}async delete(e){const{deleteOne:n}=this.actions,a=await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]});return this.dispatch(n(e)),a}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class kk extends k{constructor(){super(...arguments);m(this,"name","Team Membership");m(this,"url","/team-memberships");m(this,"actions",{addOne:YO,addMany:ZO,setOne:JO,setMany:QO,updateOne:XO,updateMany:xO,deleteOne:eI,deleteMany:tI,initialize:KO});m(this,"selectors",{selectById:nI,selectByIds:aI})}add(e){var r;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=_({...e,created_by:((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null});this.dispatch(a(o));const l=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(o),blockers:[e.team],blocks:[o.uuid]});return l.then(h=>{this.dispatch(c(h))}).catch(()=>{this.dispatch(d(o.uuid))}),[o,l]}bulkAdd(e){var h;const{store:n}=this.client,{addMany:a,setMany:c,deleteMany:d}=this.actions,o=((h=n.getState().userReducer.currentUser)==null?void 0:h.id)??null,l=e.map(y=>_({...y,created_by:o}));this.dispatch(a(l));const r=this.enqueueRequest({description:T(p.POST,this.name,!0),method:p.POST,url:`${this.url}/bulk/`,payload:{team_memberships:l.map(y=>E(y))},blockers:l.map(y=>y.team),blocks:l.map(y=>y.uuid)});return r.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(d(l.map(y=>y.uuid)))}),[l,r]}async delete(e){const{store:n}=this.client,{deleteOne:a,setOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected team membership with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(r){throw this.dispatch(c(l)),r}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{team__organization:e}},n);return this.dispatch(a(c)),c}}class vk extends k{constructor(){super(...arguments);m(this,"name","Team");m(this,"url","/teams");m(this,"actions",{addOne:dI,addMany:lI,setOne:oI,setMany:uI,updateOne:hI,updateMany:pI,deleteOne:mI,deleteMany:yI,initialize:rI});m(this,"selectors",{selectById:SI,selectByIds:AI})}add(e){var r;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=_({...e,submitted_at:new Date().toISOString(),created_by:((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null});this.dispatch(a(o));const l=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(o),blockers:[],blocks:[o.uuid]});return l.then(h=>{this.dispatch(c(h))}).catch(()=>{this.dispatch(d(o.uuid))}),[o,l]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=c(e.uuid)(n.getState());if(!d)throw new Error(`Expected team with uuid ${e.uuid} to exist`);const o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.PATCH,url:`${this.url}/${e.uuid}/`,payload:E(e),blockers:[e.uuid],blocks:[e.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,setOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected team with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(r){throw this.dispatch(c(l)),r}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class Ek extends Tt{constructor(){super(...arguments);m(this,"name","User");m(this,"url","/user");m(this,"actions",{addOne:Hn,addMany:Xw,setOne:Qw,setMany:Jw,updateOne:eT,updateMany:xw,deleteOne:Gn,deleteMany:tT,initialize:Zw});m(this,"selectors",{selectById:es,selectByIds:nT})}async list(e,n){const{organizationUuid:a,...c}=e,d=a?`/organizations/${a}${this.url}s/`:`/${this.url}`;return this.performRequest({method:p.GET,url:d,...c},n)}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({organizationUuid:e},n);return this.dispatch(a(c)),c}}class Vk extends k{constructor(){super(...arguments);m(this,"name","Workflow");m(this,"url","/workflows");m(this,"actions",{addOne:II,addMany:da,setOne:FI,setMany:PI,updateOne:gI,updateMany:bI,deleteOne:_I,deleteMany:la,initialize:OI});m(this,"selectors",{selectById:MI,selectByIds:kI})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,r=new Date().toISOString(),h=_({...e,created_by:l,submitted_at:r});this.dispatch(a(h));const y=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(h),blockers:[h.project,h.workflow_type],blocks:[h.uuid]});return y.then(S=>{this.dispatch(c(S))}).catch(()=>{this.dispatch(d(h.uuid))}),[h,y]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=c(e.uuid)(n.getState());if(!d)throw new Error(`Expected workflow with uuid ${e.uuid} to exist`);const o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[d.uuid],blocks:[d.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected workflow with uuid ${e} to exist`);const r=oP(e)(o),h=NI(e)(o),y=QP(e)(o),f=og(e)(o),S=Fg(e)(o),O=RF(e)(o),P=yF(e)(o),I=DF(e)(o),F={};for(const v of P)for(const V of ya(v.uuid)(o))F[V.uuid]=V;const g=Object.values(F);this.dispatch(a(e)),this.dispatch(Ea(B(r))),this.dispatch(ha(B(h))),this.dispatch($a(B(y))),this.dispatch(Na(B(f))),this.dispatch(Ka(B(S))),this.dispatch(Oa(B(O))),this.dispatch(Pa(B(I))),this.dispatch(Aa(B(P))),this.dispatch(cs(B(g)));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(v){throw this.dispatch(c(l)),this.dispatch(va(r)),this.dispatch(ua(h)),this.dispatch(Da(y)),this.dispatch(La(f)),this.dispatch(Ga(S)),this.dispatch(Ta(O)),this.dispatch(Fa(I)),this.dispatch(Sa(P)),this.dispatch(as(g)),v}}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{project:e}},n)).flat();return this.dispatch(a(d)),d}}class Wk extends k{constructor(){super(...arguments);m(this,"name","Workflow Step Assignee");m(this,"url","/workflow-step-assignees");m(this,"actions",{addOne:BI,addMany:ua,setOne:zI,setMany:qI,updateOne:CI,updateMany:jI,deleteOne:DI,deleteMany:ha,initialize:WI});m(this,"selectors",{selectById:UI,selectByIds:LI})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=new Date().toISOString(),l=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,r=_({...e,submitted_at:o,created_by:l});this.dispatch(a(r));const h=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(r),blockers:[e.workflow,e.workflow_step],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,h]}bulkAdd(e){var y;const{store:n}=this.client,{addMany:a,setMany:c,deleteMany:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=e.map(f=>_({...f,submitted_at:l,created_by:o}));this.dispatch(a(r));const h=this.enqueueRequest({description:T(p.POST,this.name,!0),method:p.POST,url:`${this.url}/bulk/`,payload:{assignees:r.map(f=>E(f))},blockers:r.flatMap(f=>[f.workflow,f.workflow_step]),blocks:r.map(f=>f.uuid)});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.map(f=>f.uuid)))}),[r,h]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=c(e.uuid)(n.getState());if(!d)throw new Error(`Expected workflow step assignee with uuid ${e.uuid} to exist`);const o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,setOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected workflow step assignee with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(r){throw this.dispatch(c(l)),r}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:d}=this.selectors,o=n.getState(),l=d(e)(o);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!0),method:p.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(r){throw this.dispatch(c(l)),r}}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{workflow__project:e}},n)).flat();return this.dispatch(a(d)),d}}class Bk extends L{constructor(){super(...arguments);m(this,"name","Workflow Step Comment Attachment");m(this,"url","/workflow-step-comment-attachments");m(this,"actions",{addOne:YI,addMany:as,setOne:ZI,setMany:JI,updateOne:QI,updateMany:XI,deleteOne:xI,deleteMany:cs,initialize:KI});m(this,"selectors",{selectById:tF,selectByIds:sF})}getId(e){return e.uuid}buildModel(e){return _({file:URL.createObjectURL(e.file),file_sha1:e.file_sha1,created_by:e.created_by,file_name:e.file.name,file_type:e.file.type,submitted_at:e.submitted_at,workflow_step_comment:e.modelUuid})}buildPayload(e,n){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:n.extension,workflow_step_comment:e.workflow_step_comment}}async bulkAdd(e){return this._bulkAdd(e.map(n=>({modelUuid:n.workflowStepCommentUuid,file:n.file})))}async delete(e){return this._delete(e)}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{workflow_step_comment__workflow__project:e}},n)).flat();return this.dispatch(a(d)),d}}class zk extends k{constructor(){super(...arguments);m(this,"name","Workflow Step Comment");m(this,"url","/workflow-step-comments");m(this,"actions",{addOne:cF,addMany:Sa,setOne:rF,setMany:dF,updateOne:lF,updateMany:oF,deleteOne:uF,deleteMany:Aa,initialize:aF});m(this,"selectors",{selectById:pF,selectByIds:mF})}add(e){var r;const{store:n}=this.client,{addOne:a,updateOne:c,deleteOne:d}=this.actions,o=_({...e,created_by:((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(o));const l=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(o),blockers:[e.workflow,e.workflow_step],blocks:[o.uuid]});return l.then(h=>{this.dispatch(c(h))}).catch(()=>{this.dispatch(d(o.uuid))}),[o,l]}update(e){const{store:n}=this.client,{updateOne:a}=this.actions,{selectById:c}=this.selectors,d=c(e.uuid)(n.getState());if(!d)throw new Error(`Comment with uuid ${e.uuid} not found in store`);const o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=d(e)(n.getState());if(!o)throw new Error(`Comment with uuid ${e} not found in store`);const l=ya(e)(n.getState());this.dispatch(a(e)),this.dispatch(cs(B(l)));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(r){throw this.dispatch(c(o)),this.dispatch(as(l)),r}}async refreshStore(e,n){const{setMany:a}=this.actions,d=(await this.listPaginated({queryParams:{workflow__project:e}},n)).flat();return this.dispatch(a(d)),d}}class qk extends k{constructor(){super(...arguments);m(this,"name","Workflow Step Completion");m(this,"url","/workflow-step-completions");m(this,"actions",{addOne:wF,addMany:Ta,setOne:TF,setMany:OF,updateOne:IF,updateMany:FF,deleteOne:PF,deleteMany:Oa,initialize:AF});m(this,"selectors",{selectById:bF,selectByIds:_F})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=new Date().toISOString(),l=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,r=_({...e,submitted_at:o,created_by:l});this.dispatch(a(r));const h=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(r),blockers:[e.workflow,e.workflow_step],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,h]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=c(e.uuid)(n.getState());if(!d)throw new Error(`Expected workflow step completion with uuid ${e.uuid} to exist`);const o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,setOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected workflow step completion with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(r){throw this.dispatch(c(l)),r}}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{workflow__project:e}},n)).flat();return this.dispatch(a(d)),d}}class Ck extends k{constructor(){super(...arguments);m(this,"name","Workflow Step Event");m(this,"url","/workflow-step-events");m(this,"actions",{addOne:EF,addMany:Fa,setOne:VF,setMany:WF,updateOne:BF,updateMany:zF,deleteOne:qF,deleteMany:Pa,initialize:vF});m(this,"selectors",{selectById:CF,selectByIds:jF})}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{workflow__project:e}},n)).flat();return this.dispatch(a(d)),d}}class jk extends k{constructor(){super(...arguments);m(this,"name","Workflow Step Field Values Attachment");m(this,"url","/workflow-step-field-values-attachments");m(this,"actions",{addOne:NF,addMany:_a,setOne:HF,setMany:GF,updateOne:KF,updateMany:YF,deleteOne:ZF,deleteMany:Ra,initialize:LF});m(this,"selectors",{selectById:QF,selectByIds:XF})}async bulkAdd(e){var f;const{addMany:n,setMany:a,deleteMany:c}=this.actions,d=new Date().toISOString(),o=((f=this.client.store.getState().userReducer.currentUser)==null?void 0:f.id)??null,l={},r=[],h=[];for(const S of e){const{fieldValuesUuid:O,fieldIdentifier:P,file:I}=S,F=await this.client.files.getFilePayload(I);F.sha1 in l||(l[F.sha1]=F);const g=_({file:URL.createObjectURL(I),file_type:I.type,file_name:I.name,file_sha1:F.sha1,created_by:o,field_values:O,submitted_at:d,field_identifier:P});r.push(g);const v={uuid:g.uuid,file_name:I.name,file_sha1:F.sha1,file_extension:F.extension,field_identifier:P,field_values:O};h.push(v)}this.dispatch(n(r));const y=this.enqueueRequest({description:T(p.POST,this.name,!0),method:p.POST,url:`${this.url}/bulk/`,payload:{submitted_at:d,attachments:h,files:Object.values(l)},blockers:r.map(S=>S.field_values),blocks:r.map(S=>S.uuid)});return y.then(({presigned_urls:S,attachments:O})=>{this.client.files.processPresignedUrls(S),this.dispatch(a(O))}).catch(S=>{throw this.dispatch(c(r.map(O=>O.uuid))),S}),[r,y.then(({attachments:S})=>S)]}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:d}=this.selectors,o=n.getState(),l=d(e)(o);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!0),method:p.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(r){throw this.dispatch(c(l)),r}}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{field_values__workflow__project:e,latest:!0}},n)).flat();return this.dispatch(a(d)),d}}class Dk extends k{constructor(){super(...arguments);m(this,"name","Workflow Step Field Values");m(this,"url","/workflow-step-field-values");m(this,"actions",{addOne:iP,addMany:va,setOne:nP,setMany:aP,updateOne:cP,updateMany:rP,deleteOne:dP,deleteMany:Ea,initialize:sP});m(this,"selectors",{selectById:uP,selectByIds:hP})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,r=new Date().toISOString(),h=_({...e,created_by:l,submitted_at:r}),y=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(h),blockers:[e.workflow,e.workflow_step,e.fields_revision],blocks:[h.uuid]});return this.dispatch(a(h)),y.then(S=>{this.dispatch(c(S))}).catch(()=>{this.dispatch(d(h.uuid))}),[h,y]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=n.getState(),o=c(e.uuid)(d);if(!o)throw new Error(`Expected WorkflowStepFieldValues with uuid ${e.uuid} to exist`);const l={...o,...e};this.dispatch(a(l));const r=this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[l.uuid,l.fields_revision,l.workflow,l.workflow_step],blocks:[l.uuid]});return r.then(h=>{this.dispatch(a(h))}).catch(()=>{this.dispatch(a(o))}),[l,r]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected submission with uuid ${e} to exist`);const r=xF(e)(o);this.dispatch(a(e)),this.dispatch(Ra(B(r)));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(h){throw this.dispatch(c(l)),this.dispatch(_a(r)),h}}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{workflow__project:e,latest:!0}},n)).flat();return this.dispatch(a(d)),d}}class $k extends k{constructor(){super(...arguments);m(this,"name","Workflow Step Fields Attachment");m(this,"url","/workflow-step-fields-attachments");m(this,"actions",{addOne:fP,addMany:Wa,setOne:SP,setMany:AP,updateOne:wP,updateMany:TP,deleteOne:OP,deleteMany:Ba,initialize:yP});m(this,"selectors",{selectById:PP,selectByIds:gP})}async bulkAdd(e){var f;const{addMany:n,setMany:a,deleteMany:c}=this.actions,d=new Date().toISOString(),o=((f=this.client.store.getState().userReducer.currentUser)==null?void 0:f.id)??null,l={},r=[],h=[];for(const S of e){const{fieldsRevisionUuid:O,fieldIdentifier:P,file:I}=S,F=await this.client.files.getFilePayload(I);F.sha1 in l||(l[F.sha1]=F);const g=_({file:URL.createObjectURL(I),file_type:I.type,file_name:I.name,file_sha1:F.sha1,created_by:o,fields_revision:O,submitted_at:d,field_identifier:P});r.push(g);const v={uuid:g.uuid,file_name:I.name,field_identifier:P,file_extension:F.extension,file_sha1:F.sha1,fields_revision:O};h.push(v)}this.dispatch(n(r));const y=this.enqueueRequest({description:T(p.POST,this.name,!0),method:p.POST,url:`${this.url}/bulk/`,payload:{submitted_at:d,attachments:h,files:Object.values(l)},blockers:r.map(S=>S.fields_revision),blocks:r.map(S=>S.uuid)});return y.then(S=>{this.client.files.processPresignedUrls(S.presigned_urls),this.dispatch(a(S.attachments))}).catch(()=>{this.dispatch(c(r.map(S=>S.uuid)))}),[r,y.then(({attachments:S})=>S)]}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{fields_revision__workflow_step__workflow_type__organization:e}},n);return this.dispatch(a(c)),c}}class Uk extends k{constructor(){super(...arguments);m(this,"name","Workflow Step Fields");m(this,"url","/workflow-step-fields");m(this,"actions",{addOne:MP,addMany:kP,setOne:vP,setMany:EP,updateOne:VP,updateMany:WP,deleteOne:BP,deleteMany:zP,initialize:RP});m(this,"selectors",{selectById:qP,selectByIds:CP})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(r),blockers:[r.workflow_step],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(f=>{throw this.dispatch(d(r.uuid)),f}),[r,h]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,c=n.getState().workflowStepFieldsReducer.instances[e.uuid];if(!c)throw new Error(`WorkflowStepFields with uuid ${e.uuid} not found`);const d={...c,...e};this.dispatch(a(d));const o=this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.PATCH,url:`${this.url}/${c.uuid}/`,payload:e,blockers:[c.uuid],blocks:[c.uuid]});return o.then(l=>{this.dispatch(a(l))}).catch(l=>{throw this.dispatch(a(c)),l}),[d,o]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,d=n.getState().workflowStepFieldsReducer.instances[e];if(!d)throw new Error(`WorkflowStepFields with uuid ${e} not found`);const o=FP(e)(n.getState());this.dispatch(a(e)),this.dispatch(Ba(B(o)));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(l){throw this.dispatch(c(d)),this.dispatch(Wa(o)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{workflow_step__workflow_type__organization:e}},n);return this.dispatch(a(c)),c}}class Lk extends k{constructor(){super(...arguments);m(this,"name","Workflow Step Reviewer");m(this,"url","/workflow-step-reviewers");m(this,"actions",{addOne:UP,addMany:Da,setOne:LP,setMany:NP,updateOne:HP,updateMany:GP,deleteOne:KP,deleteMany:$a,initialize:$P});m(this,"selectors",{selectById:ZP,selectByIds:JP})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=new Date().toISOString(),l=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,r=_({...e,submitted_at:o,created_by:l});this.dispatch(a(r));const h=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(r),blockers:[e.workflow,e.workflow_step],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,h]}bulkAdd(e){var y;const{store:n}=this.client,{addMany:a,setMany:c,deleteMany:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=e.map(f=>_({...f,submitted_at:l,created_by:o}));this.dispatch(a(r));const h=this.enqueueRequest({description:T(p.POST,this.name,!0),method:p.POST,url:`${this.url}/bulk/`,payload:{reviewers:r.map(f=>E(f))},blockers:r.flatMap(f=>[f.workflow,f.workflow_step]),blocks:r.map(f=>f.uuid)});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.map(f=>f.uuid)))}),[r,h]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=c(e.uuid)(n.getState());if(!d)throw new Error(`Expected workflow step reviewer with uuid ${e.uuid} to exist`);const o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,setOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected workflow step reviewer with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(r){throw this.dispatch(c(l)),r}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:d}=this.selectors,o=n.getState(),l=d(e)(o);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!0),method:p.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(r){throw this.dispatch(c(l)),r}}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{workflow__project:e}},n)).flat();return this.dispatch(a(d)),d}}class Nk extends k{constructor(){super(...arguments);m(this,"name","Workflow Step Review Request");m(this,"url","/workflow-step-review-requests");m(this,"actions",{addOne:tg,addMany:La,setOne:sg,setMany:ig,updateOne:ng,updateMany:ag,deleteOne:cg,deleteMany:Na,initialize:eg});m(this,"selectors",{selectById:dg,selectByIds:lg})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=new Date().toISOString(),l=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,r=_({...e,submitted_at:o,created_by:l});this.dispatch(a(r));const h=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(r),blockers:[e.workflow,e.workflow_step],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,h]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=c(e.uuid)(n.getState());if(!d)throw new Error(`Expected workflow step review request with uuid ${e.uuid} to exist`);const o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,setOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected workflow step review request with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(r){throw this.dispatch(c(l)),r}}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{workflow__project:e}},n)).flat();return this.dispatch(a(d)),d}}class Hk extends k{constructor(){super(...arguments);m(this,"name","Workflow Step Review");m(this,"url","/workflow-step-reviews");m(this,"actions",{addOne:mg,addMany:Ga,setOne:yg,setMany:fg,updateOne:Sg,updateMany:Ag,deleteOne:wg,deleteMany:Ka,initialize:pg});m(this,"selectors",{selectById:Og,selectByIds:Ig})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=new Date().toISOString(),l=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,r=_({...e,submitted_at:o,created_by:l});this.dispatch(a(r));const h=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(r),blockers:[e.workflow,e.workflow_step],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,h]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=c(e.uuid)(n.getState());if(!d)throw new Error(`Expected workflow step review with uuid ${e.uuid} to exist`);const o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,setOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected workflow step review with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(r){throw this.dispatch(c(l)),r}}async refreshStore(e,n){const{initialize:a}=this.actions,d=(await this.listPaginated({queryParams:{workflow__project:e}},n)).flat();return this.dispatch(a(d)),d}}class Gk extends k{constructor(){super(...arguments);m(this,"name","Workflow Step");m(this,"url","/workflow-steps");m(this,"actions",{addOne:_g,addMany:Za,setOne:Rg,setMany:Mg,updateOne:kg,updateMany:vg,deleteOne:Eg,deleteMany:Ja,initialize:bg});m(this,"selectors",{selectById:Bg,selectByIds:qg})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(r),blockers:[r.workflow_type],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,h]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=c(e.uuid)(n.getState());if(!d)throw new Error(`No workflow step with uuid ${e.uuid} found in the store`);const o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.PATCH,url:`${this.url}/${d.uuid}/`,payload:{name:e.name,order:e.order},blockers:[d.uuid],blocks:[d.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`No workflow step with uuid ${e} found in the store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(r){throw this.dispatch(c(l)),r}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{workflow_type__organization:e}},n);return this.dispatch(a(c)),c}}class Kk extends k{constructor(){super(...arguments);m(this,"name","Workflow Type");m(this,"url","/workflow-types");m(this,"actions",{addOne:Dg,addMany:$g,setOne:Ug,setMany:Lg,updateOne:Ng,updateMany:Hg,deleteOne:Gg,deleteMany:Kg,initialize:jg});m(this,"selectors",{selectById:Zg,selectByIds:Jg})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:d}=this.actions,o=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),r=_({...e,created_by:o,submitted_at:l});this.dispatch(a(r));const h=this.enqueueRequest({description:T(p.POST,this.name,!1),method:p.POST,url:`${this.url}/`,payload:E(r),blockers:[],blocks:[r.uuid]});return h.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(d(r.uuid))}),[r,h]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,d=c(e.uuid)(n.getState());if(!d)throw new Error(`Expected workflow type with uuid ${e.uuid} to exist`);const o={...d,...e};this.dispatch(a(o));const l=this.enqueueRequest({description:T(p.PATCH,this.name,!1),method:p.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[d.uuid],blocks:[d.uuid]});return l.then(r=>{this.dispatch(a(r))}).catch(()=>{this.dispatch(a(d))}),[o,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:d}=this.selectors,o=n.getState(),l=d(e)(o);if(!l)throw new Error(`Expected workflow type with uuid ${e} to exist`);const r=vI(e)(o),h=zg(e)(o);this.dispatch(a(e)),this.dispatch(la(B(r))),this.dispatch(Ja(B(h)));try{return await this.enqueueRequest({description:T(p.DELETE,this.name,!1),method:p.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(y){throw this.dispatch(c(l)),this.dispatch(da(r)),this.dispatch(Za(h)),y}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}async function ac(t,s,e,n,a){const c=n instanceof yt;c&&s.checkAuth!==!1&&await n.auth.prepareAuth();const d={queryParams:"",isAuthNeeded:!0},{s3url:o,payload:l,headers:r,method:h,queryParams:y,attachmentHash:f,isExternalUrl:S,isAuthNeeded:O,isResponseBlob:P}={...d,...s};let I=s.url;const F=f?await e.files.fetchCache(f):void 0;if(f&&!F)throw new Error(`Cannot upload file ${f} because it's not cached.`);!S&&!I.startsWith("http")&&(!I.startsWith("/")&&!I.startsWith("blob:")&&(I="/"+I),I=t+I);const g=C=>{if(f){if(!o)throw new Error(`No S3 URL for file ${f}`);if("warning"in o)throw new Error(`S3 URL warning for file ${f}`);if(!F)throw new Error(`No file for file ${f}`);const q=o.fields["x-amz-checksum-sha1"];if(!q)throw new Error(`No checksum for file ${f}`);return C.set("x-amz-checksum-sha1",q).field({...l,...o.fields}).attach("file",F)}return C.send(l)},V={[p.GET]:()=>P?St.get(I.toString()).responseType("blob"):St.get(I.toString()),[p.POST]:()=>{const C=St.post(I.toString());return g(C)},[p.PATCH]:()=>{const C=St.patch(I.toString());return g(C)},[p.PUT]:()=>{const C=St.put(I.toString());return g(C)},[p.DELETE]:()=>{const C=St.delete(I.toString());return g(C)}}[h];let W=V();if(a==null||a.addEventListener("abort",()=>{console.debug("aborting request:",s.url),W.abort()}),O&&c){const C=n.auth.getAuthHeader();W=W.set("Authorization",C)}r&&(W=W.set(r));try{return await W.query(y)}catch(C){const q=mb(C),bb=q==null?void 0:q.status;if(c&&bb===401)return await n.auth.handleUnauthorized(W,q),W.query(y);throw new D({response:q,innerError:C,discard:tc.includes(bb)})}}class Yk{constructor(s){m(this,"store");this.store=s}_performRequest(s,e,n,a){const c=new fs,d={...e,uuid:e.uuid??mt.v4()};return ac(s,d,this,n,a).then(o=>{c.resolve(o.body)}).catch(o=>{o instanceof Error?c.reject(o):c.reject(new Error((o??wt).toString()))}),c}async performRequest(s,e,n,a){return this._performRequest(s,e,n,a).then(c=>{if(c instanceof D)throw c;return c})}async enqueueRequest(s,e,n){return this._enqueueRequest(s,e,n).then(a=>{if(a instanceof D)throw a;return a})}_enqueueRequest(s,e,n){const a=new fs,c={...s,BASE_URL:e,serviceName:n},d=this.store.dispatch(zT(c)),o=r=>{if(r)a.resolve(r.body);else{const h=new D({message:"Could not get a response from the server.",response:r,discard:!0});a.reject(h)}},l=r=>{r instanceof D?r.options.discard=!0:(console.error("Received an unexpected error while processing a request:",r,`
15
15
  Converting error to APIError and discarding.`),r=new D({message:"An error occurred while processing the request.",innerError:r,discard:!0})),a.reject(r)};return d.then(o,l),a}async performPagination(s,e,n,a,c){const d={...e,queryParams:{...e.queryParams,paginate:!0,limit:n}},{method:o}=d,l=[];let r=await this.performRequest(s,d,a,c);for(l.push(r.results);r.next;)r=await this.performRequest(s,{url:r.next,method:o},a,c),l.push(r.results);return l}}class Ot{constructor(){m(this,"graph");m(this,"requestAttemptCounter");this.graph=new Wb.DepGraph,this.requestAttemptCounter={}}static _fromOutbox(s){const e=new Ot;for(let n=0;n<s.length;n++){const a=s[n];if(!a){console.error("Outbox item was undefined");continue}e.sneakRequest(a);for(let c=0;c<n;c++){const d=s[c];if(!d){console.error("Previous outbox item was undefined");continue}d.payload.uuid!==a.payload.uuid&&d.payload.blocks.some(o=>a.payload.blockers.includes(o))&&Ot._addDependency(a.payload.uuid,d.payload.uuid,e.graph)}}return e}_addDependency(s,e){Ot._addDependency(s,e,this.graph)}static _addDependency(s,e,n){if(s===e)throw new Error(`Tried to add dependency from node to itself: ${s}`);if(!n.hasNode(s))throw new Error(`Tried to add dependency from non-existent node: ${s} (to node: ${e})`);if(!n.hasNode(e))throw new Error(`Tried to add dependency to non-existent node: ${e} (from node: ${s})`);n.addDependency(s,e)}addRequest(s){if(this.graph.addNode(s.payload.uuid,s),!(s.payload.blockers.length===0||this.graph.size()===1))for(const e of this.graph.overallOrder()){if(e===s.payload.uuid)continue;const n=this.graph.getNodeData(e),a=new Set(n.payload.blocks);s.payload.blockers.some(c=>a.has(c))&&this._addDependency(s.payload.uuid,e)}}insertRequest(s){this.graph.addNode(s.payload.uuid,s);for(const e of this.graph.overallOrder()){if(e===s.payload.uuid)continue;const n=this.graph.getNodeData(e),a=new Set(s.payload.blocks);n.payload.blockers.some(c=>a.has(c))&&this._addDependency(e,s.payload.uuid)}}sneakRequest(s){this.graph.addNode(s.payload.uuid,s)}_getNextNode(){const s=this.graph.overallOrder(!0);let e=1/0,n;for(const a of s){const c=this.requestAttemptCounter[a]||0;c<e&&(e=c,n=a)}return n}peek(){const s=this._getNextNode();if(s)return this.graph.getNodeData(s)}remove(s){this.graph.removeNode(s),delete this.requestAttemptCounter[s]}pop(){const s=this.peek();return s&&this.graph.removeNode(s.payload.uuid),s}getQueue(){const s=this.graph.overallOrder().map(n=>this.graph.getNodeData(n)),e=this._getNextNode();if(e){const n=this.graph.getNodeData(e),a=s.findIndex(c=>c.payload.uuid===n.payload.uuid);a!==-1&&(s.splice(a,1),s.unshift(n))}return s}getReady(){let s=this.graph.overallOrder(!0).map(e=>this.graph.getNodeData(e));return s=s.sort((e,n)=>e.meta.offline.effect.timestamp.localeCompare(n.meta.offline.effect.timestamp)),s=s.sort((e,n)=>{const a=this.requestAttemptCounter[e.payload.uuid]||0,c=this.requestAttemptCounter[n.payload.uuid]||0;return a-c}),s}registerRetry(s){this.requestAttemptCounter[s]=(this.requestAttemptCounter[s]||0)+1}}let yb;function fb(t){yb=t}function It(){return yb}let Sb;function Ab(t){Sb=t}function wb(){return Sb}let cc=null;function ft(){const t=It();if(!t)return console.warn("Client store not set; cannot get outbox coordinator yet."),null;if(cc)return cc;const s=t.getState().offline.outbox,e=Ot._fromOutbox(s);return cc=e,e}const Zk=(t,s)=>{const e=new s(t);return Ab(e),fb(t),e};class Jk{constructor(s){m(this,"_all");m(this,"_previous");this._all=[s],this._previous=s,this.then=this.then.bind(this),this.compile=this.compile.bind(this)}then(s){return this._previous&&(this._previous.next=s),this._all.push(s),this._previous=s,{then:this.then,compile:this.compile}}compile(){return this._all}}class rc{constructor(){m(this,"next");this.next=null}then(s){return new Jk(this).then(s)}async run(s){if(this.next)return this.next.run(s);{if(console.debug("Middleware finished. Performing request:",s.payload.url),!It())throw new Error("Client store not set");const n=wb();if(!n)throw new Error("Client SDK not set");return ub(s,n)}}}class Tb extends rc{async run(s){return super.run(s)}}class Ob extends rc{async run(s){return super.run(s)}}const Ib=new Tb().then(new Ob).compile();function Fb(t){var s;return(s=Ib[0])==null?void 0:s.run(t)}var Pb=(t=>(t[t.USER_REGISTRATION=0]="USER_REGISTRATION",t[t.APPLICATION_INVITE=2]="APPLICATION_INVITE",t[t.PROJECT_INVITE=4]="PROJECT_INVITE",t[t.ORGANIZATION_INVITE=6]="ORGANIZATION_INVITE",t[t.ADD_EMAIL_DOMAIN=8]="ADD_EMAIL_DOMAIN",t[t.RESET_PASSWORD=10]="RESET_PASSWORD",t))(Pb||{});i.ALL_MIDDLEWARE=Ib,i.APIError=D,i.ATTACHMENT_MODEL_DEFAULT_PAGE_SIZE=sb,i.AgentService=wM,i.AssetAttachmentService=TM,i.AssetProcedureService=bM,i.AssetProcedureStepFieldValuesAttachmentService=kM,i.AssetProcedureStepFieldValuesService=vM,i.AssetProcedureStepFieldsAttachmentService=RM,i.AssetProcedureStepFieldsService=MM,i.AssetProcedureStepService=EM,i.AssetProcedureTypeAttachmentService=OM,i.AssetProcedureTypeFieldValuesAttachmentService=PM,i.AssetProcedureTypeFieldValuesService=gM,i.AssetProcedureTypeFieldsAttachmentService=IM,i.AssetProcedureTypeFieldsService=FM,i.AssetProcedureTypeService=_M,i.AssetService=VM,i.AssetStageCompletionService=WM,i.AssetStageService=BM,i.AssetStatusType=pc,i.AssetTypeAttachmentService=zM,i.AssetTypeFieldValuesAttachmentService=jM,i.AssetTypeFieldValuesService=DM,i.AssetTypeFieldsAttachmentService=qM,i.AssetTypeFieldsService=CM,i.AssetTypeIdentifierService=$M,i.AssetTypeIdentifierValueService=UM,i.AssetTypeService=LM,i.AssetTypeStatusService=NM,i.AttachmentModel=mc,i.BaseApiService=yt,i.BaseModelApiService=Tt,i.BaseOfflineAttachmentModelService=L,i.BaseOfflineModelApiService=k,i.BaseSDK=Yk,i.COMMON_AUTO_FIELDS=Fc,i.CategoryService=HM,i.DEFAULT_ISSUE_PRIORITY=Bb,i.DEFAULT_PAGE_SIZE=tb,i.DISCARD_HTTP_STATUSES=tc,i.DeferredPromise=fs,i.DocumentAttachmentService=GM,i.DocumentService=KM,i.EMPTY_ARRAY=oc,i.EMPTY_OBJECT=uc,i.EmailDomainsService=YM,i.EmailVerificationService=ZM,i.FileService=QM,i.FormIdentifierService=XM,i.FormIdentifierValueService=xM,i.FormRevisionAttachmentService=ek,i.FormRevisionService=tk,i.FormService=sk,i.FormSubmissionAttachmentService=ik,i.FormSubmissionService=nk,i.GeoImageService=ak,i.HttpMethod=p,i.IssueAssociationService=ck,i.IssueAttachmentService=rk,i.IssueCommentAttachmentService=dk,i.IssueCommentService=lk,i.IssuePriority=ys,i.IssueService=ok,i.IssueStatusType=yc,i.IssueTypeAttachmentService=uk,i.IssueTypeFieldValuesAttachmentService=mk,i.IssueTypeFieldValuesService=yk,i.IssueTypeFieldsAttachmentService=hk,i.IssueTypeFieldsService=pk,i.IssueTypeIdentifierService=fk,i.IssueTypeIdentifierValueService=Sk,i.IssueTypeService=Ak,i.IssueTypeStatusService=wk,i.IssueUpdateChange=j,i.IssueUpdateService=Tk,i.JWTService=Fk,i.MAX_SERVICE_BATCH_SIZE=U,i.OUTBOX_RETRY_DELAY=Ac,i.OfflineAnalyticsMiddleware=Tb,i.OfflineMiddleware=rc,i.OrganizationAccessLevel=hc,i.OrganizationAccessService=Pk,i.OrganizationService=gk,i.OutboxCoordinator=Ot,i.ProjectAccessService=bk,i.ProjectAttachmentService=_k,i.ProjectFileService=Rk,i.ProjectService=Mk,i.RESET_ORGANIZATION_STATE=M,i.RESET_PROJECT_STATE=z,i.RESET_STATE=b,i.RateLimitingMiddleware=Ob,i.SelectorBuilder=a_,i.TeamMembershipService=kk,i.TeamService=vk,i.UNKNOWN_ERROR_MESSAGE=wt,i.UserService=Ek,i.VERSION_REDUCER_KEY=Ft,i.VerificationCodeType=Pb,i.WorkflowReviewType=fc,i.WorkflowService=Vk,i.WorkflowStepAssigneeService=Wk,i.WorkflowStepCommentAttachmentService=Bk,i.WorkflowStepCommentService=zk,i.WorkflowStepCompletionService=qk,i.WorkflowStepEventService=Ck,i.WorkflowStepEventType=Sc,i.WorkflowStepFieldValuesAttachmentService=jk,i.WorkflowStepFieldValuesService=Dk,i.WorkflowStepFieldsAttachmentService=$k,i.WorkflowStepFieldsService=Uk,i.WorkflowStepReviewRequestService=Nk,i.WorkflowStepReviewService=Hk,i.WorkflowStepReviewerService=Lk,i.WorkflowStepService=Gk,i.WorkflowTypeService=Kk,i._setLatestRetryTime=CT,i.addAsset=xl,i.addAssetAttachment=Cc,i.addAssetAttachments=gs,i.addAssetProcedure=hd,i.addAssetProcedureStep=$l,i.addAssetProcedureStepFieldValues=gl,i.addAssetProcedureStepFieldValuesAttachment=hl,i.addAssetProcedureStepFieldValuesAttachments=Ys,i.addAssetProcedureStepFieldValuesMany=bl,i.addAssetProcedureStepFields=xd,i.addAssetProcedureStepFieldsAttachment=jd,i.addAssetProcedureStepFieldsAttachments=Dd,i.addAssetProcedureStepFieldsMany=el,i.addAssetProcedureSteps=Ul,i.addAssetProcedureType=gd,i.addAssetProcedureTypeAttachment=Qc,i.addAssetProcedureTypeAttachments=Xc,i.addAssetProcedureTypeFieldValues=Xr,i.addAssetProcedureTypeFieldValuesAttachment=jr,i.addAssetProcedureTypeFieldValuesAttachments=Ws,i.addAssetProcedureTypeFieldValuesMany=xr,i.addAssetProcedureTypeFields=gr,i.addAssetProcedureTypeFieldsAttachment=ur,i.addAssetProcedureTypeFieldsAttachments=hr,i.addAssetProcedureTypeFieldsMany=br,i.addAssetProcedureTypes=bd,i.addAssetProcedures=js,i.addAssetStage=ko,i.addAssetStageCompletion=po,i.addAssetStageCompletions=mo,i.addAssetStages=vo,i.addAssetType=vh,i.addAssetTypeAttachment=$o,i.addAssetTypeAttachments=di,i.addAssetTypeFieldValues=$u,i.addAssetTypeFieldValuesAttachment=Ru,i.addAssetTypeFieldValuesAttachments=yi,i.addAssetTypeFieldValuesMany=Uu,i.addAssetTypeFields=mu,i.addAssetTypeFieldsAttachment=eu,i.addAssetTypeFieldsAttachments=tu,i.addAssetTypeFieldsMany=yu,i.addAssetTypeIdentifier=th,i.addAssetTypeIdentifierValue=yh,i.addAssetTypeIdentifierValues=fh,i.addAssetTypeIdentifiers=sh,i.addAssetTypeStatus=Lh,i.addAssetTypeStatuses=Nh,i.addAssetTypes=Eh,i.addAssets=ti,i.addCategories=rp,i.addCategory=cp,i.addConversation=Ec,i.addConversations=c_,i.addDocument=Vp,i.addDocumentAttachment=wp,i.addDocumentAttachments=Tp,i.addDocuments=Wp,i.addEmailDomain=Kp,i.addEmailDomains=Yp,i.addForm=oy,i.addFormIdentifier=hm,i.addFormIdentifierValue=bm,i.addFormIdentifierValues=_m,i.addFormIdentifiers=pm,i.addFormRevision=$i,i.addFormRevisionAttachment=Dm,i.addFormRevisionAttachments=$m,i.addFormRevisions=Ui,i.addFormSubmission=Cy,i.addFormSubmissionAttachment=Py,i.addFormSubmissionAttachments=Zi,i.addFormSubmissions=tn,i.addForms=uy,i.addGeoImage=Qy,i.addGeoImages=Xy,i.addIssue=uS,i.addIssueAssociation=mf,i.addIssueAssociations=Yt,i.addIssueAttachment=gf,i.addIssueAttachments=ln,i.addIssueComment=Xf,i.addIssueCommentAttachment=Cf,i.addIssueCommentAttachments=jf,i.addIssueComments=xf,i.addIssueType=pw,i.addIssueTypeAttachment=PS,i.addIssueTypeAttachments=gS,i.addIssueTypeFieldValues=XS,i.addIssueTypeFieldValuesAttachment=bA,i.addIssueTypeFieldValuesAttachments=bn,i.addIssueTypeFieldValuesMany=xS,i.addIssueTypeFields=hA,i.addIssueTypeFieldsAttachment=CS,i.addIssueTypeFieldsAttachments=jS,i.addIssueTypeFieldsMany=pA,i.addIssueTypeIdentifier=jA,i.addIssueTypeIdentifierValue=xA,i.addIssueTypeIdentifierValues=ew,i.addIssueTypeIdentifiers=DA,i.addIssueTypeStatus=_w,i.addIssueTypeStatuses=Rw,i.addIssueTypes=mw,i.addIssueUpdate=Cn,i.addIssueUpdates=jn,i.addIssues=Sn,i.addOrganization=PT,i.addOrganizationAccess=rT,i.addOrganizationAccesses=dT,i.addOrganizations=FT,i.addProject=zO,i.addProjectAccess=UT,i.addProjectAccesses=LT,i.addProjectAttachment=tO,i.addProjectAttachments=sO,i.addProjectFile=SO,i.addProjectFiles=AO,i.addProjects=BO,i.addTeam=dI,i.addTeamMembership=YO,i.addTeamMemberships=ZO,i.addTeams=lI,i.addUser=Hn,i.addUsers=Xw,i.addWorkflow=II,i.addWorkflowStep=_g,i.addWorkflowStepAssignee=BI,i.addWorkflowStepAssignees=ua,i.addWorkflowStepComment=cF,i.addWorkflowStepCommentAttachment=YI,i.addWorkflowStepCommentAttachments=as,i.addWorkflowStepComments=Sa,i.addWorkflowStepCompletion=wF,i.addWorkflowStepCompletions=Ta,i.addWorkflowStepEvent=EF,i.addWorkflowStepEvents=Fa,i.addWorkflowStepFieldValues=iP,i.addWorkflowStepFieldValuesAttachment=NF,i.addWorkflowStepFieldValuesAttachments=_a,i.addWorkflowStepFieldValuesMany=va,i.addWorkflowStepFields=MP,i.addWorkflowStepFieldsAttachment=fP,i.addWorkflowStepFieldsAttachments=Wa,i.addWorkflowStepFieldsMany=kP,i.addWorkflowStepReview=mg,i.addWorkflowStepReviewRequest=tg,i.addWorkflowStepReviewRequests=La,i.addWorkflowStepReviewer=UP,i.addWorkflowStepReviewers=Da,i.addWorkflowStepReviews=Ga,i.addWorkflowSteps=Za,i.addWorkflowType=Dg,i.addWorkflowTypes=$g,i.addWorkflows=da,i.agentsReducer=Bc,i.agentsSlice=Is,i.areArraysEqual=jb,i.assetAttachmentReducer=Yc,i.assetAttachmentSlice=Ps,i.assetProcedureReducer=Ad,i.assetProcedureSlice=Cs,i.assetProcedureStepFieldValuesAttachmentReducer=Il,i.assetProcedureStepFieldValuesAttachmentSlice=Ks,i.assetProcedureStepFieldValuesReducer=zl,i.assetProcedureStepFieldValuesSlice=Qs,i.assetProcedureStepFieldsAttachmentReducer=Jd,i.assetProcedureStepFieldsAttachmentSlice=Ls,i.assetProcedureStepFieldsReducer=ll,i.assetProcedureStepFieldsSlice=Hs,i.assetProcedureStepReducer=Kl,i.assetProcedureStepSlice=Xs,i.assetProcedureTypeAttachmentReducer=ar,i.assetProcedureTypeAttachmentSlice=Rs,i.assetProcedureTypeFieldValuesAttachmentReducer=Hr,i.assetProcedureTypeFieldValuesAttachmentSlice=Vs,i.assetProcedureTypeFieldValuesReducer=cd,i.assetProcedureTypeFieldValuesSlice=qs,i.assetProcedureTypeFieldsAttachmentReducer=wr,i.assetProcedureTypeFieldsAttachmentSlice=ks,i.assetProcedureTypeFieldsReducer=Vr,i.assetProcedureTypeFieldsSlice=Es,i.assetProcedureTypeReducer=Vd,i.assetProcedureTypeSlice=$s,i.assetReducer=oo,i.assetSlice=ei,i.assetStageCompletionReducer=Oo,i.assetStageCompletionSlice=ii,i.assetStageReducer=zo,i.assetStageSlice=ni,i.assetTypeAttachmentReducer=Qo,i.assetTypeAttachmentSlice=ri,i.assetTypeFieldValuesAttachmentReducer=Cu,i.assetTypeFieldValuesAttachmentSlice=mi,i.assetTypeFieldValuesReducer=Xu,i.assetTypeFieldValuesSlice=Ai,i.assetTypeFieldsAttachmentReducer=uu,i.assetTypeFieldsAttachmentSlice=ui,i.assetTypeFieldsReducer=gu,i.assetTypeFieldsSlice=pi,i.assetTypeIdentifierReducer=hh,i.assetTypeIdentifierSlice=wi,i.assetTypeIdentifierValueReducer=bh,i.assetTypeIdentifierValueSlice=Oi,i.assetTypeReducer=Dh,i.assetTypeSlice=Ii,i.assetTypeStatusReducer=ep,i.assetTypeStatusSlice=Pi,i.assetTypeStatusSortFn=bc,i.authReducer=ip,i.authSlice=Lt,i.baseReducer=nM,i.baseReducers=ec,i.blobToBase64=Yb,i.categoryReducer=fp,i.categorySlice=bi,i.clearTokens=N_,i.constructUploadedFilePayloads=Kb,i.createModelAdapter=R,i.createOfflineAction=WT,i.createPayload=E,i.createSelectionAdapter=zb,i.deleteAsset=so,i.deleteAssetAttachment=Lc,i.deleteAssetAttachments=bs,i.deleteAssetProcedure=yd,i.deleteAssetProcedureStep=Hl,i.deleteAssetProcedureStepFieldValues=vl,i.deleteAssetProcedureStepFieldValuesAttachment=Sl,i.deleteAssetProcedureStepFieldValuesAttachments=Zs,i.deleteAssetProcedureStepFieldValuesMany=El,i.deleteAssetProcedureStepFields=al,i.deleteAssetProcedureStepFieldsAttachment=Hd,i.deleteAssetProcedureStepFieldsAttachments=Gd,i.deleteAssetProcedureStepFieldsMany=cl,i.deleteAssetProcedureSteps=Gl,i.deleteAssetProcedureType=Md,i.deleteAssetProcedureTypeAttachment=ir,i.deleteAssetProcedureTypeAttachments=nr,i.deleteAssetProcedureTypeFieldValues=nd,i.deleteAssetProcedureTypeFieldValuesAttachment=Nr,i.deleteAssetProcedureTypeFieldValuesAttachments=Bs,i.deleteAssetProcedureTypeFieldValuesMany=ad,i.deleteAssetProcedureTypeFields=vr,i.deleteAssetProcedureTypeFieldsAttachment=Sr,i.deleteAssetProcedureTypeFieldsAttachments=Ar,i.deleteAssetProcedureTypeFieldsMany=Er,i.deleteAssetProcedureTypes=kd,i.deleteAssetProcedures=Ds,i.deleteAssetStage=Wo,i.deleteAssetStageCompletion=wo,i.deleteAssetStageCompletions=To,i.deleteAssetStages=Bo,i.deleteAssetType=Bh,i.deleteAssetTypeAttachment=Go,i.deleteAssetTypeAttachments=li,i.deleteAssetTypeFieldValues=Ku,i.deleteAssetTypeFieldValuesAttachment=Vu,i.deleteAssetTypeFieldValuesAttachments=fi,i.deleteAssetTypeFieldValuesMany=Yu,i.deleteAssetTypeFields=Tu,i.deleteAssetTypeFieldsAttachment=cu,i.deleteAssetTypeFieldsAttachments=ru,i.deleteAssetTypeFieldsMany=Ou,i.deleteAssetTypeIdentifier=rh,i.deleteAssetTypeIdentifierValue=Oh,i.deleteAssetTypeIdentifierValues=Ih,i.deleteAssetTypeIdentifiers=dh,i.deleteAssetTypeStatus=Zh,i.deleteAssetTypeStatuses=Jh,i.deleteAssetTypes=zh,i.deleteAssets=si,i.deleteCategories=pp,i.deleteCategory=hp,i.deleteConversation=l_,i.deleteConversations=o_,i.deleteDocument=jp,i.deleteDocumentAttachment=gp,i.deleteDocumentAttachments=bp,i.deleteDocuments=Dp,i.deleteEmailDomain=xp,i.deleteEmailDomains=em,i.deleteForm=fy,i.deleteFormIdentifier=Am,i.deleteFormIdentifierValue=Em,i.deleteFormIdentifierValues=Vm,i.deleteFormIdentifiers=wm,i.deleteFormRevision=Li,i.deleteFormRevisionAttachment=Gm,i.deleteFormRevisionAttachments=Km,i.deleteFormRevisions=Ni,i.deleteFormSubmission=$y,i.deleteFormSubmissionAttachment=My,i.deleteFormSubmissionAttachments=Ji,i.deleteFormSubmissions=sn,i.deleteForms=Sy,i.deleteGeoImage=tf,i.deleteGeoImages=sf,i.deleteIssue=fS,i.deleteIssueAssociation=yf,i.deleteIssueAssociations=Zt,i.deleteIssueAttachment=kf,i.deleteIssueAttachments=on,i.deleteIssueComment=nS,i.deleteIssueCommentAttachment=Nf,i.deleteIssueCommentAttachments=Hf,i.deleteIssueComments=aS,i.deleteIssueType=ww,i.deleteIssueTypeAttachment=kS,i.deleteIssueTypeAttachments=vS,i.deleteIssueTypeFieldValues=nA,i.deleteIssueTypeFieldValuesAttachment=vA,i.deleteIssueTypeFieldValuesAttachments=_n,i.deleteIssueTypeFieldValuesMany=aA,i.deleteIssueTypeFields=AA,i.deleteIssueTypeFieldsAttachment=NS,i.deleteIssueTypeFieldsAttachments=HS,i.deleteIssueTypeFieldsMany=wA,i.deleteIssueTypeIdentifier=HA,i.deleteIssueTypeIdentifierValue=aw,i.deleteIssueTypeIdentifierValues=cw,i.deleteIssueTypeIdentifiers=GA,i.deleteIssueTypeStatus=Vw,i.deleteIssueTypeStatuses=Ww,i.deleteIssueTypes=Tw,i.deleteIssueUpdate=Dn,i.deleteIssueUpdates=$n,i.deleteIssues=An,i.deleteOrganization=_T,i.deleteOrganizationAccess=pT,i.deleteOrganizationAccesses=mT,i.deleteOrganizations=RT,i.deleteProject=jO,i.deleteProjectAccess=YT,i.deleteProjectAccesses=ZT,i.deleteProjectAttachment=rO,i.deleteProjectAttachments=dO,i.deleteProjectFile=OO,i.deleteProjectFiles=IO,i.deleteProjects=DO,i.deleteTeam=mI,i.deleteTeamMembership=eI,i.deleteTeamMemberships=tI,i.deleteTeams=yI,i.deleteUser=Gn,i.deleteUsers=tT,i.deleteWorkflow=_I,i.deleteWorkflowStep=Eg,i.deleteWorkflowStepAssignee=DI,i.deleteWorkflowStepAssignees=ha,i.deleteWorkflowStepComment=uF,i.deleteWorkflowStepCommentAttachment=xI,i.deleteWorkflowStepCommentAttachments=cs,i.deleteWorkflowStepComments=Aa,i.deleteWorkflowStepCompletion=PF,i.deleteWorkflowStepCompletions=Oa,i.deleteWorkflowStepEvent=qF,i.deleteWorkflowStepEvents=Pa,i.deleteWorkflowStepFieldValues=dP,i.deleteWorkflowStepFieldValuesAttachment=ZF,i.deleteWorkflowStepFieldValuesAttachments=Ra,i.deleteWorkflowStepFieldValuesMany=Ea,i.deleteWorkflowStepFields=BP,i.deleteWorkflowStepFieldsAttachment=OP,i.deleteWorkflowStepFieldsAttachments=Ba,i.deleteWorkflowStepFieldsMany=zP,i.deleteWorkflowStepReview=wg,i.deleteWorkflowStepReviewRequest=cg,i.deleteWorkflowStepReviewRequests=Na,i.deleteWorkflowStepReviewer=KP,i.deleteWorkflowStepReviewers=$a,i.deleteWorkflowStepReviews=Ka,i.deleteWorkflowSteps=Ja,i.deleteWorkflowType=Gg,i.deleteWorkflowTypes=Kg,i.deleteWorkflows=la,i.dequeue=ob,i.discard=hb,i.documentAttachmentReducer=kp,i.documentAttachmentSlice=Mi,i.documentSlice=vi,i.documentsReducer=$p,i.downloadFile=Zb,i.downloadInMemoryFile=Gb,i.emailDomainsReducer=nm,i.emailDomainsSlice=Vi,i.emailRegex=s_,i.enqueue=lb,i.enqueueRequest=zT,i.extractResponseFromError=mb,i.fallbackToEmptyArray=w,i.fallbackToEmptyObject=Vt,i.fileReducer=lm,i.fileSlice=Bi,i.fileToBlob=Oc,i.formIdentifierReducer=Fm,i.formIdentifierSlice=zi,i.formIdentifierValueReducer=qm,i.formIdentifierValueSlice=Ci,i.formReducer=Ay,i.formRevisionAttachmentReducer=Qm,i.formRevisionAttachmentSlice=ji,i.formRevisionReducer=ry,i.formRevisionsSlice=Di,i.formSlice=Gi,i.formSubmissionAttachmentReducer=Vy,i.formSubmissionAttachmentSlice=Yi,i.formSubmissionReducer=Gy,i.formSubmissionSlice=en,i.geoImageReducer=rf,i.geoImageSlice=an,i.getAssetProcedureStepSubTree=gc,i.getAssetProcedureStepTrees=i_,i.getClientSDK=wb,i.getClientStore=It,i.getDocumentSubTree=Mc,i.getDocumentTrees=n_,i.getFileIdentifier=Hb,i.getFileS3Key=Ts,i.getLocalDateString=wc,i.getLocalRelativeDateString=Lb,i.getOutboxCoordinator=ft,i.getRenamedFile=Tc,i.getRequestDescription=T,i.hashFile=At,i.initSDK=Zk,i.initializeAssetAttachments=qc,i.initializeAssetProcedureStepFieldValues=Pl,i.initializeAssetProcedureStepFieldValuesAttachments=ul,i.initializeAssetProcedureStepFields=Xd,i.initializeAssetProcedureStepFieldsAttachments=Cd,i.initializeAssetProcedureSteps=Cl,i.initializeAssetProcedureTypeAttachments=Jc,i.initializeAssetProcedureTypeFieldValues=Qr,i.initializeAssetProcedureTypeFieldValuesAttachments=Cr,i.initializeAssetProcedureTypeFields=Pr,i.initializeAssetProcedureTypeFieldsAttachments=or,i.initializeAssetProcedureTypes=Pd,i.initializeAssetProcedures=ud,i.initializeAssetStageCompletions=ho,i.initializeAssetStages=_o,i.initializeAssetTypeAttachments=Do,i.initializeAssetTypeFieldValues=Du,i.initializeAssetTypeFieldValuesAttachments=_u,i.initializeAssetTypeFields=pu,i.initializeAssetTypeFieldsAttachments=xo,i.initializeAssetTypeIdentifierValues=mh,i.initializeAssetTypeIdentifiers=eh,i.initializeAssetTypeStatuses=Uh,i.initializeAssetTypes=Rh,i.initializeAssets=Xl,i.initializeCategories=ap,i.initializeConversations=vc,i.initializeDocumentAttachments=Ap,i.initializeDocuments=Ep,i.initializeEmailDomains=Gp,i.initializeFormIdentifierValues=gm,i.initializeFormIdentifiers=um,i.initializeFormRevisionAttachments=jm,i.initializeFormRevisions=xm,i.initializeFormSubmissionAttachments=Fy,i.initializeFormSubmissions=By,i.initializeForms=ly,i.initializeGeoImages=Yy,i.initializeIssueAssociations=lf,i.initializeIssueAttachments=Pf,i.initializeIssueCommentAttachments=qf,i.initializeIssueComments=Qf,i.initializeIssueTypeAttachments=FS,i.initializeIssueTypeFieldValues=QS,i.initializeIssueTypeFieldValuesAttachments=gA,i.initializeIssueTypeFields=uA,i.initializeIssueTypeFieldsAttachments=qS,i.initializeIssueTypeIdentifierValues=XA,i.initializeIssueTypeIdentifiers=CA,i.initializeIssueTypeStatuses=bw,i.initializeIssueTypes=hw,i.initializeIssueUpdates=jw,i.initializeIssues=oS,i.initializeOrganizationAccesses=cT,i.initializeOrganizations=TT,i.initializeProjectAccesses=$T,i.initializeProjectAttachments=eO,i.initializeProjectFiles=mO,i.initializeProjects=EO,i.initializeTeamMemberships=KO,i.initializeTeams=rI,i.initializeUsers=Zw,i.initializeWorkflowStepAssignees=WI,i.initializeWorkflowStepCommentAttachments=KI,i.initializeWorkflowStepComments=aF,i.initializeWorkflowStepCompletions=AF,i.initializeWorkflowStepEvents=vF,i.initializeWorkflowStepFieldValues=sP,i.initializeWorkflowStepFieldValuesAttachments=LF,i.initializeWorkflowStepFields=RP,i.initializeWorkflowStepFieldsAttachments=yP,i.initializeWorkflowStepReviewRequests=eg,i.initializeWorkflowStepReviewers=$P,i.initializeWorkflowStepReviews=pg,i.initializeWorkflowSteps=bg,i.initializeWorkflowTypes=jg,i.initializeWorkflows=OI,i.isToday=Ub,i.issueAssociationReducer=If,i.issueAssociationSlice=rn,i.issueAttachmentReducer=Bf,i.issueAttachmentSlice=dn,i.issueCommentAttachmentReducer=Zf,i.issueCommentAttachmentSlice=hn,i.issueCommentReducer=dS,i.issueCommentSlice=mn,i.issueReducer=OS,i.issueSlice=fn,i.issueTypeAttachmentReducer=BS,i.issueTypeAttachmentSlice=wn,i.issueTypeFieldValuesAttachmentReducer=zA,i.issueTypeFieldValuesAttachmentSlice=gn,i.issueTypeFieldValuesReducer=lA,i.issueTypeFieldValuesSlice=Fn,i.issueTypeFieldsAttachmentReducer=ZS,i.issueTypeFieldsAttachmentSlice=On,i.issueTypeFieldsReducer=FA,i.issueTypeFieldsSlice=Pn,i.issueTypeIdentifierReducer=JA,i.issueTypeIdentifierSlice=Mn,i.issueTypeIdentifierValueReducer=ow,i.issueTypeIdentifierValueSlice=vn,i.issueTypeReducer=Pw,i.issueTypeSlice=En,i.issueTypeStatusReducer=qw,i.issueTypeStatusSlice=Wn,i.issueTypeStatusSortFn=_c,i.issueUpdateReducer=Kw,i.issueUpdateSlice=qn,i.logOnlyOnce=Jb,i.markAsDeleted=qT,i.markForDeletion=bR,i.memoize=As,i.organizationAccessReducer=yT,i.organizationAccessSlice=Yn,i.organizationReducer=VT,i.organizationSlice=Zn,i.outboxReducer=jT,i.outboxSlice=Jn,i.overmapEnhancer=pM,i.overmapReducer=aM,i.overmapReducers=eb,i.performRequest=ac,i.performRequestFromAction=ub,i.projectAccessReducer=JT,i.projectAccessSlice=Qn,i.projectAttachmentReducer=hO,i.projectAttachmentSlice=xn,i.projectFileReducer=kO,i.projectFileSlice=ta,i.projectReducer=$O,i.projectSlice=sa,i.rehydratedReducer=HO,i.rehydratedSlice=ia,i.restructureSelectorWithArgs=A,i.runMiddleware=Fb,i.saveActiveProjectFileBounds=gO,i.selectAccessToken=H_,i.selectAccessesByUserOfProject=RR,i.selectAccessibleProjects=VR,i.selectActiveOrganizationAccess=IR,i.selectActiveProjectFileId=vR,i.selectAllDocumentAttachments=ki,i.selectAssetAttachmentById=Hc,i.selectAssetAttachmentMapping=Nc,i.selectAssetAttachments=_s,i.selectAssetAttachmentsByIds=Gc,i.selectAssetById=ro,i.selectAssetProcedureById=Od,i.selectAssetProcedureStepById=Yl,i.selectAssetProcedureStepFieldValues=Pt,i.selectAssetProcedureStepFieldValuesAttachmentById=wl,i.selectAssetProcedureStepFieldValuesAttachments=Js,i.selectAssetProcedureStepFieldValuesAttachmentsByIds=Tl,i.selectAssetProcedureStepFieldValuesAttachmentsMapping=Al,i.selectAssetProcedureStepFieldValuesById=Wl,i.selectAssetProcedureStepFieldValuesByIds=Bl,i.selectAssetProcedureStepFieldValuesMapping=Vl,i.selectAssetProcedureStepFieldValuesOfAsset=g_,i.selectAssetProcedureStepFieldValuesOfAssetProcedure=b_,i.selectAssetProcedureStepFieldValuesOfAssetProcedureStep=__,i.selectAssetProcedureStepFields=Ct,i.selectAssetProcedureStepFieldsAttachmentById=Yd,i.selectAssetProcedureStepFieldsAttachments=Ns,i.selectAssetProcedureStepFieldsAttachmentsByIds=Zd,i.selectAssetProcedureStepFieldsAttachmentsMapping=Kd,i.selectAssetProcedureStepFieldsById=rl,i.selectAssetProcedureStepFieldsByIds=dl,i.selectAssetProcedureStepFieldsMapping=Gs,i.selectAssetProcedureStepFieldsOfAssetProcedureStep=I_,i.selectAssetProcedureStepMapping=jt,i.selectAssetProcedureSteps=xs,i.selectAssetProcedureStepsByIds=Zl,i.selectAssetProcedureStepsMappingOfAssetProcedureType=R_,i.selectAssetProcedureStepsOfAssetProcedureType=M_,i.selectAssetProcedureTypeAttachmentById=rr,i.selectAssetProcedureTypeAttachmentMapping=cr,i.selectAssetProcedureTypeAttachments=Ms,i.selectAssetProcedureTypeAttachmentsByIds=dr,i.selectAssetProcedureTypeById=Bd,i.selectAssetProcedureTypeFieldValues=zt,i.selectAssetProcedureTypeFieldValuesAttachmentById=Kr,i.selectAssetProcedureTypeFieldValuesAttachments=zs,i.selectAssetProcedureTypeFieldValuesAttachmentsByIds=Yr,i.selectAssetProcedureTypeFieldValuesAttachmentsMapping=Gr,i.selectAssetProcedureTypeFieldValuesById=dd,i.selectAssetProcedureTypeFieldValuesByIds=ld,i.selectAssetProcedureTypeFieldValuesMapping=rd,i.selectAssetProcedureTypeFieldValuesOfAsset=S_,i.selectAssetProcedureTypeFields=Bt,i.selectAssetProcedureTypeFieldsAttachmentById=Or,i.selectAssetProcedureTypeFieldsAttachments=vs,i.selectAssetProcedureTypeFieldsAttachmentsByIds=Ir,i.selectAssetProcedureTypeFieldsAttachmentsMapping=Tr,i.selectAssetProcedureTypeFieldsById=Br,i.selectAssetProcedureTypeFieldsByIds=zr,i.selectAssetProcedureTypeFieldsMapping=Wr,i.selectAssetProcedureTypeFieldsOfAssetProcedureType=y_,i.selectAssetProcedureTypes=Us,i.selectAssetProcedureTypesByIds=zd,i.selectAssetProcedureTypesMapping=Wd,i.selectAssetProcedureTypesOfOrganization=T_,i.selectAssetProcedures=qt,i.selectAssetProceduresByIds=Id,i.selectAssetProceduresMapping=wd,i.selectAssetProceduresOfAssetProcedureType=Td,i.selectAssetProceduresOfAssetType=w_,i.selectAssetStageById=qo,i.selectAssetStageCompletionById=Po,i.selectAssetStageCompletionMapping=Io,i.selectAssetStageCompletions=Fo,i.selectAssetStageCompletionsByIds=go,i.selectAssetStages=ci,i.selectAssetStagesByIds=Co,i.selectAssetStagesMappingOfAssetProcedureType=v_,i.selectAssetStagesOfAssetProcedureType=E_,i.selectAssetTypeAttachmentById=Yo,i.selectAssetTypeAttachmentMapping=Ko,i.selectAssetTypeAttachments=oi,i.selectAssetTypeAttachmentsByIds=Zo,i.selectAssetTypeById=Ch,i.selectAssetTypeFieldValues=$t,i.selectAssetTypeFieldValuesAttachmentById=Bu,i.selectAssetTypeFieldValuesAttachments=Si,i.selectAssetTypeFieldValuesAttachmentsByIds=zu,i.selectAssetTypeFieldValuesAttachmentsMapping=Wu,i.selectAssetTypeFieldValuesById=Ju,i.selectAssetTypeFieldValuesByIds=Qu,i.selectAssetTypeFieldValuesMapping=Zu,i.selectAssetTypeFieldValuesOfAsset=z_,i.selectAssetTypeFields=gt,i.selectAssetTypeFieldsAttachmentById=lu,i.selectAssetTypeFieldsAttachments=hi,i.selectAssetTypeFieldsAttachmentsByIds=ou,i.selectAssetTypeFieldsAttachmentsMapping=du,i.selectAssetTypeFieldsById=Fu,i.selectAssetTypeFieldsByIds=Pu,i.selectAssetTypeFieldsMapping=Iu,i.selectAssetTypeFieldsOfAssetType=W_,i.selectAssetTypeIdentifierById=oh,i.selectAssetTypeIdentifierMapping=lh,i.selectAssetTypeIdentifierValueById=Ph,i.selectAssetTypeIdentifierValueMapping=Fh,i.selectAssetTypeIdentifierValues=Ut,i.selectAssetTypeIdentifierValuesByIds=gh,i.selectAssetTypeIdentifierValuesOfAsset=j_,i.selectAssetTypeIdentifierValuesOfIdentifier=D_,i.selectAssetTypeIdentifiers=Ti,i.selectAssetTypeIdentifiersByIds=uh,i.selectAssetTypeIdentifiersOfAssetType=C_,i.selectAssetTypeStatusById=Xh,i.selectAssetTypeStatusMapping=Qh,i.selectAssetTypeStatuses=gi,i.selectAssetTypeStatusesByIds=xh,i.selectAssetTypeStatusesOfAssetType=U_,i.selectAssetTypeValuesOfAssetType=q_,i.selectAssetTypes=Fi,i.selectAssetTypesByIds=jh,i.selectAssetTypesMapping=qh,i.selectAssetTypesOfOrganization=$_,i.selectAssets=Dt,i.selectAssetsByIds=lo,i.selectAssetsMapping=ao,i.selectAssetsOfAssetType=co,i.selectAssetsOfProject=k_,i.selectAttachmentsOfAsset=Kc,i.selectAttachmentsOfAssetProcedureStepFieldValues=Ol,i.selectAttachmentsOfAssetProcedureStepFields=O_,i.selectAttachmentsOfAssetProcedureType=p_,i.selectAttachmentsOfAssetProcedureTypeFieldValues=Zr,i.selectAttachmentsOfAssetProcedureTypeFields=m_,i.selectAttachmentsOfAssetType=Jo,i.selectAttachmentsOfAssetTypeFieldValues=qu,i.selectAttachmentsOfAssetTypeFields=V_,i.selectAttachmentsOfDocument=Y_,i.selectAttachmentsOfFormRevision=sR,i.selectAttachmentsOfFormSubmission=Ey,i.selectAttachmentsOfIssue=Ef,i.selectAttachmentsOfIssueComment=cR,i.selectAttachmentsOfIssueType=lR,i.selectAttachmentsOfIssueTypeFieldValues=BA,i.selectAttachmentsOfIssueTypeFields=oR,i.selectAttachmentsOfProject=kR,i.selectAttachmentsOfWorkflowStepComment=ya,i.selectAttachmentsOfWorkflowStepFieldValues=xF,i.selectAttachmentsOfWorkflowStepFields=FP,i.selectCategories=_i,i.selectCategoriesByIds=yp,i.selectCategoriesOfProject=K_,i.selectCategoryById=Ri,i.selectCategoryMapping=mp,i.selectCommentsOfIssue=rR,i.selectCommentsOfWorkflow=yF,i.selectCommentsOfWorkflowStep=NR,i.selectConversation=h_,i.selectConversationMapping=Fs,i.selectConversations=u_,i.selectCurrentUser=iT,i.selectDeletedRequests=PR,i.selectDescendantsOfAssetProcedureStep=Jl,i.selectDescendantsOfDocument=Np,i.selectDocumentAttachmentById=Rp,i.selectDocumentAttachmentMapping=_p,i.selectDocumentAttachmentsByIds=Mp,i.selectDocumentById=Up,i.selectDocuments=Nt,i.selectDocumentsByIds=Lp,i.selectDocumentsMapping=Ei,i.selectEmailDomainById=sm,i.selectEmailDomains=Wi,i.selectEmailDomainsAsMapping=tm,i.selectEmailDomainsByIds=im,i.selectEmailDomainsOfOrganization=Q_,i.selectFieldValuesOfAssetProcedure=A_,i.selectFormById=Ty,i.selectFormIdentifierById=Om,i.selectFormIdentifierMapping=Tm,i.selectFormIdentifierValueById=Bm,i.selectFormIdentifierValueMapping=Wm,i.selectFormIdentifierValues=Ht,i.selectFormIdentifierValuesByIds=zm,i.selectFormIdentifierValuesOfFormSubmission=eR,i.selectFormIdentifierValuesOfIdentifier=tR,i.selectFormIdentifiers=qi,i.selectFormIdentifiersByIds=Im,i.selectFormIdentifiersOfForm=x_,i.selectFormMapping=wy,i.selectFormRevisionAttachmentById=Zm,i.selectFormRevisionAttachments=Ym,i.selectFormRevisionAttachmentsByIds=Jm,i.selectFormRevisionAttachmentsMapping=Gt,i.selectFormRevisionById=ny,i.selectFormRevisionMapping=Hi,i.selectFormRevisions=Kt,i.selectFormRevisionsByIds=ay,i.selectFormRevisionsOfForm=cy,i.selectFormSubmissionAttachemntsByIds=xi,i.selectFormSubmissionAttachmentById=ky,i.selectFormSubmissionAttachments=Xi,i.selectFormSubmissionAttachmentsByIds=vy,i.selectFormSubmissionAttachmentsMapping=Qi,i.selectFormSubmissionById=Ly,i.selectFormSubmissions=Uy,i.selectFormSubmissionsByIds=Ny,i.selectFormSubmissionsMapping=nn,i.selectFormSubmissionsOfForm=Hy,i.selectForms=Ki,i.selectFormsByIds=Oy,i.selectFormsOfOrganization=nR,i.selectGeoImageById=af,i.selectGeoImageMapping=nf,i.selectGeoImages=cn,i.selectGeoImagesByIds=cf,i.selectGeoImagesOfProject=aR,i.selectIsImportingProjectFile=ER,i.selectIsLoggedIn=G_,i.selectIssueAssociationById=Sf,i.selectIssueAssociationMapping=bt,i.selectIssueAssociations=ff,i.selectIssueAssociationsByIds=Af,i.selectIssueAssociationsOfAsset=Of,i.selectIssueAssociationsOfIssue=Tf,i.selectIssueAssociationsToIssue=wf,i.selectIssueAttachmentById=Vf,i.selectIssueAttachmentMapping=vf,i.selectIssueAttachments=un,i.selectIssueAttachmentsByIds=Wf,i.selectIssueById=AS,i.selectIssueCommentAttachmentById=Kf,i.selectIssueCommentAttachmentMapping=Gf,i.selectIssueCommentAttachments=pn,i.selectIssueCommentAttachmentsByIds=Yf,i.selectIssueCommentById=cS,i.selectIssueCommentMapping=yn,i.selectIssueCommentsByIds=rS,i.selectIssueMapping=SS,i.selectIssueTypeAttachmentById=VS,i.selectIssueTypeAttachmentMapping=ES,i.selectIssueTypeAttachments=Tn,i.selectIssueTypeAttachmentsByIds=WS,i.selectIssueTypeById=Iw,i.selectIssueTypeFieldValues=Qt,i.selectIssueTypeFieldValuesAttachmentById=VA,i.selectIssueTypeFieldValuesAttachments=Rn,i.selectIssueTypeFieldValuesAttachmentsByIds=WA,i.selectIssueTypeFieldValuesAttachmentsMapping=EA,i.selectIssueTypeFieldValuesById=rA,i.selectIssueTypeFieldValuesByIds=dA,i.selectIssueTypeFieldValuesMapping=cA,i.selectIssueTypeFieldValuesOfIssue=uR,i.selectIssueTypeFields=_t,i.selectIssueTypeFieldsAttachmentById=KS,i.selectIssueTypeFieldsAttachments=In,i.selectIssueTypeFieldsAttachmentsByIds=YS,i.selectIssueTypeFieldsAttachmentsMapping=GS,i.selectIssueTypeFieldsById=OA,i.selectIssueTypeFieldsByIds=IA,i.selectIssueTypeFieldsMapping=TA,i.selectIssueTypeFieldsOfIssueType=hR,i.selectIssueTypeIdentifierById=YA,i.selectIssueTypeIdentifierMapping=KA,i.selectIssueTypeIdentifierValueById=dw,i.selectIssueTypeIdentifierValueMapping=rw,i.selectIssueTypeIdentifierValues=Xt,i.selectIssueTypeIdentifierValuesByIds=lw,i.selectIssueTypeIdentifierValuesOfIdentifier=SR,i.selectIssueTypeIdentifierValuesOfIssue=fR,i.selectIssueTypeIdentifiers=kn,i.selectIssueTypeIdentifiersByIds=ZA,i.selectIssueTypeIdentifiersOfIssueType=yR,i.selectIssueTypeMapping=Ow,i.selectIssueTypeStatusById=zn,i.selectIssueTypeStatusMapping=Bw,i.selectIssueTypeStatuses=Bn,i.selectIssueTypeStatusesByIds=zw,i.selectIssueTypeStatusesOfIssueType=wR,i.selectIssueTypeValuesOfIssueType=mR,i.selectIssueTypes=Vn,i.selectIssueTypesByIds=Fw,i.selectIssueTypesOfOrganization=AR,i.selectIssueUpdateById=Nw,i.selectIssueUpdateMapping=Un,i.selectIssueUpdates=Ln,i.selectIssueUpdatesByIds=Hw,i.selectIssueUpdatesOfIssue=Gw,i.selectIssues=Jt,i.selectIssuesByIds=wS,i.selectIssuesOfIssueType=TS,i.selectIssuesOfProject=dR,i.selectLatestAssetProcedureStepFieldsOfAssetProcedureStep=F_,i.selectLatestAssetProcedureTypeFieldsOfAssetProcedureType=f_,i.selectLatestAssetTypeFieldsOfAssetType=B_,i.selectLatestFieldsByAssetProcedureStep=P_,i.selectLatestFieldsByWorkflowStep=QR,i.selectLatestFormRevisionOfForm=iR,i.selectLatestIssueTypeFieldsOfIssueType=pR,i.selectLatestRetryTime=gR,i.selectLatestWorkflowStepFieldsOfWorkflowStep=JR,i.selectMembershipsByUserOfTeam=CR,i.selectOrganizationAccessById=fT,i.selectOrganizationAccessMapping=ts,i.selectOrganizationAccessUserMapping=AT,i.selectOrganizationAccessesByIds=ST,i.selectOrganizationById=vT,i.selectOrganizationDocuments=J_,i.selectOrganizations=kT,i.selectOrganizationsByIds=ET,i.selectOrganizationsMapping=MT,i.selectProjectAccessById=QT,i.selectProjectAccessMapping=Xn,i.selectProjectAccesses=Rt,i.selectProjectAccessesByIds=XT,i.selectProjectAccessesOfProject=_R,i.selectProjectAttachmentById=oO,i.selectProjectAttachmentMapping=lO,i.selectProjectAttachments=ea,i.selectProjectAttachmentsByIds=uO,i.selectProjectById=LO,i.selectProjectDocuments=Z_,i.selectProjectFileById=RO,i.selectProjectFileMapping=bO,i.selectProjectFiles=_O,i.selectProjectFilesByIds=MO,i.selectProjectMapping=UO,i.selectProjects=ss,i.selectProjectsByIds=NO,i.selectProjectsOfOrganization=WR,i.selectRehydrated=qR,i.selectStageMapping=ai,i.selectTeamById=SI,i.selectTeamMembershipById=nI,i.selectTeamMemberships=is,i.selectTeamMembershipsByIds=aI,i.selectTeamMembershipsMapping=iI,i.selectTeams=ca,i.selectTeamsByIds=AI,i.selectTeamsMapping=fI,i.selectTeamsOfOrganization=DR,i.selectUploadUrl=dm,i.selectUserById=es,i.selectUsers=xt,i.selectUsersByIds=nT,i.selectUsersMapping=Kn,i.selectUsersOfOrganization=FR,i.selectUsersOfProject=MR,i.selectUsersOfTeam=jR,i.selectWorkflowById=MI,i.selectWorkflowMapping=RI,i.selectWorkflowStepAssigneeById=UI,i.selectWorkflowStepAssigneeMapping=$I,i.selectWorkflowStepAssignees=Mt,i.selectWorkflowStepAssigneesByIds=LI,i.selectWorkflowStepAssigneesOfUser=LR,i.selectWorkflowStepAssigneesOfWorkflow=NI,i.selectWorkflowStepAssigneesOfWorkflowStep=UR,i.selectWorkflowStepById=Bg,i.selectWorkflowStepCommentAttachmentById=tF,i.selectWorkflowStepCommentAttachmentMapping=eF,i.selectWorkflowStepCommentAttachments=ma,i.selectWorkflowStepCommentAttachmentsByIds=sF,i.selectWorkflowStepCommentById=pF,i.selectWorkflowStepCommentMapping=hF,i.selectWorkflowStepComments=rs,i.selectWorkflowStepCommentsByIds=mF,i.selectWorkflowStepCompletionById=bF,i.selectWorkflowStepCompletionMapping=gF,i.selectWorkflowStepCompletions=ds,i.selectWorkflowStepCompletionsByIds=_F,i.selectWorkflowStepCompletionsOfWorkflow=RF,i.selectWorkflowStepCompletionsOfWorkflowStep=HR,i.selectWorkflowStepEventById=CF,i.selectWorkflowStepEventMapping=ga,i.selectWorkflowStepEvents=ls,i.selectWorkflowStepEventsByIds=jF,i.selectWorkflowStepEventsOfWorkflow=DF,i.selectWorkflowStepEventsOfWorkflowStep=GR,i.selectWorkflowStepFieldValues=kt,i.selectWorkflowStepFieldValuesAttachmentById=QF,i.selectWorkflowStepFieldValuesAttachments=Ma,i.selectWorkflowStepFieldValuesAttachmentsByIds=XF,i.selectWorkflowStepFieldValuesAttachmentsMapping=JF,i.selectWorkflowStepFieldValuesById=uP,i.selectWorkflowStepFieldValuesByIds=hP,i.selectWorkflowStepFieldValuesMapping=lP,i.selectWorkflowStepFieldValuesOfFieldsRevision=YR,i.selectWorkflowStepFieldValuesOfWorkflow=oP,i.selectWorkflowStepFieldValuesOfWorkflowStep=KR,i.selectWorkflowStepFields=os,i.selectWorkflowStepFieldsAttachmentById=PP,i.selectWorkflowStepFieldsAttachments=za,i.selectWorkflowStepFieldsAttachmentsByIds=gP,i.selectWorkflowStepFieldsAttachmentsMapping=IP,i.selectWorkflowStepFieldsById=qP,i.selectWorkflowStepFieldsByIds=CP,i.selectWorkflowStepFieldsMapping=Ca,i.selectWorkflowStepFieldsOfWorkflowStep=ZR,i.selectWorkflowStepMapping=Wg,i.selectWorkflowStepReviewById=Og,i.selectWorkflowStepReviewMapping=Tg,i.selectWorkflowStepReviewRequestById=dg,i.selectWorkflowStepReviewRequestMapping=rg,i.selectWorkflowStepReviewRequests=us,i.selectWorkflowStepReviewRequestsByIds=lg,i.selectWorkflowStepReviewRequestsOfWorkflow=og,i.selectWorkflowStepReviewRequestsOfWorkflowStep=eM,i.selectWorkflowStepReviewerById=ZP,i.selectWorkflowStepReviewerMapping=YP,i.selectWorkflowStepReviewers=vt,i.selectWorkflowStepReviewersByIds=JP,i.selectWorkflowStepReviewersOfUser=xR,i.selectWorkflowStepReviewersOfWorkflow=QP,i.selectWorkflowStepReviewersOfWorkflowStep=XR,i.selectWorkflowStepReviews=hs,i.selectWorkflowStepReviewsByIds=Ig,i.selectWorkflowStepReviewsOfWorkflow=Fg,i.selectWorkflowStepReviewsOfWorkflowStep=tM,i.selectWorkflowSteps=Qa,i.selectWorkflowStepsByIds=qg,i.selectWorkflowStepsOfWorkflowType=zg,i.selectWorkflowTypeById=Zg,i.selectWorkflowTypeMapping=Yg,i.selectWorkflowTypes=xa,i.selectWorkflowTypesByIds=Jg,i.selectWorkflowTypesOfOrganization=sM,i.selectWorkflows=ns,i.selectWorkflowsByIds=kI,i.selectWorkflowsOfProject=$R,i.selectWorkflowsOfWorkflowType=vI,i.setActiveProjectFileId=PO,i.setAsset=io,i.setAssetAttachment=jc,i.setAssetAttachments=Dc,i.setAssetProcedure=fd,i.setAssetProcedureStep=jl,i.setAssetProcedureStepFieldValues=_l,i.setAssetProcedureStepFieldValuesAttachment=pl,i.setAssetProcedureStepFieldValuesAttachments=ml,i.setAssetProcedureStepFieldValuesMany=Rl,i.setAssetProcedureStepFields=tl,i.setAssetProcedureStepFieldsAttachment=$d,i.setAssetProcedureStepFieldsAttachments=Ud,i.setAssetProcedureStepFieldsMany=sl,i.setAssetProcedureSteps=Dl,i.setAssetProcedureType=vd,i.setAssetProcedureTypeAttachment=xc,i.setAssetProcedureTypeAttachments=er,i.setAssetProcedureTypeFieldValues=ed,i.setAssetProcedureTypeFieldValuesAttachment=Dr,i.setAssetProcedureTypeFieldValuesAttachments=$r,i.setAssetProcedureTypeFieldValuesMany=td,i.setAssetProcedureTypeFields=_r,i.setAssetProcedureTypeFieldsAttachment=pr,i.setAssetProcedureTypeFieldsAttachments=mr,i.setAssetProcedureTypeFieldsMany=Rr,i.setAssetProcedureTypes=Ed,i.setAssetProcedures=Sd,i.setAssetStage=Ro,i.setAssetStageCompletion=yo,i.setAssetStageCompletions=fo,i.setAssetStages=Mo,i.setAssetType=Mh,i.setAssetTypeAttachment=Uo,i.setAssetTypeAttachments=Lo,i.setAssetTypeFieldValues=Lu,i.setAssetTypeFieldValuesAttachment=Mu,i.setAssetTypeFieldValuesAttachments=ku,i.setAssetTypeFieldValuesMany=Nu,i.setAssetTypeFields=fu,i.setAssetTypeFieldsAttachment=su,i.setAssetTypeFieldsAttachments=iu,i.setAssetTypeFieldsMany=Su,i.setAssetTypeIdentifier=ih,i.setAssetTypeIdentifierValue=Sh,i.setAssetTypeIdentifierValues=Ah,i.setAssetTypeIdentifiers=nh,i.setAssetTypeStatus=Hh,i.setAssetTypeStatuses=Gh,i.setAssetTypes=kh,i.setAssets=no,i.setCategories=lp,i.setCategory=dp,i.setClientSDK=Ab,i.setClientStore=fb,i.setConversation=Vc,i.setConversations=r_,i.setCurrentUser=TR,i.setDocument=Bp,i.setDocumentAttachment=Op,i.setDocumentAttachments=Ip,i.setDocuments=zp,i.setEmailDomain=Zp,i.setEmailDomains=Jp,i.setForm=hy,i.setFormIdentifier=mm,i.setFormIdentifierValue=Rm,i.setFormIdentifierValues=Mm,i.setFormIdentifiers=ym,i.setFormRevision=ey,i.setFormRevisionAttachment=Um,i.setFormRevisionAttachments=Lm,i.setFormRevisions=ty,i.setFormSubmission=zy,i.setFormSubmissionAttachment=gy,i.setFormSubmissionAttachments=by,i.setFormSubmissions=qy,i.setForms=py,i.setGeoImage=Zy,i.setGeoImages=Jy,i.setIsImportingProjectFile=FO,i.setIssue=hS,i.setIssueAssociation=uf,i.setIssueAssociations=of,i.setIssueAttachment=bf,i.setIssueAttachments=_f,i.setIssueComment=eS,i.setIssueCommentAttachment=Df,i.setIssueCommentAttachments=$f,i.setIssueComments=tS,i.setIssueType=yw,i.setIssueTypeAttachment=bS,i.setIssueTypeAttachments=_S,i.setIssueTypeFieldValues=eA,i.setIssueTypeFieldValuesAttachment=_A,i.setIssueTypeFieldValuesAttachments=RA,i.setIssueTypeFieldValuesMany=tA,i.setIssueTypeFields=mA,i.setIssueTypeFieldsAttachment=DS,i.setIssueTypeFieldsAttachments=$S,i.setIssueTypeFieldsMany=yA,i.setIssueTypeIdentifier=$A,i.setIssueTypeIdentifierValue=tw,i.setIssueTypeIdentifierValues=sw,i.setIssueTypeIdentifiers=UA,i.setIssueTypeStatus=Mw,i.setIssueTypeStatuses=kw,i.setIssueTypes=fw,i.setIssueUpdate=Dw,i.setIssueUpdates=$w,i.setIssues=pS,i.setLoggedIn=sp,i.setOrganization=IT,i.setOrganizationAccess=lT,i.setOrganizationAccesses=oT,i.setOrganizations=OT,i.setProfilePicture=OR,i.setProject=WO,i.setProjectAccess=NT,i.setProjectAccesses=HT,i.setProjectAttachment=iO,i.setProjectAttachments=nO,i.setProjectFile=yO,i.setProjectFiles=fO,i.setProjects=VO,i.setRehydrated=zR,i.setTeam=oI,i.setTeamMembership=JO,i.setTeamMemberships=QO,i.setTeams=uI,i.setTokens=L_,i.setUploadUrl=rm,i.setUser=Qw,i.setUsers=Jw,i.setWorkflow=FI,i.setWorkflowStep=Rg,i.setWorkflowStepAssignee=zI,i.setWorkflowStepAssignees=qI,i.setWorkflowStepComment=rF,i.setWorkflowStepCommentAttachment=ZI,i.setWorkflowStepCommentAttachments=JI,i.setWorkflowStepComments=dF,i.setWorkflowStepCompletion=TF,i.setWorkflowStepCompletions=OF,i.setWorkflowStepEvent=VF,i.setWorkflowStepEvents=WF,i.setWorkflowStepFieldValues=nP,i.setWorkflowStepFieldValuesAttachment=HF,i.setWorkflowStepFieldValuesAttachments=GF,i.setWorkflowStepFieldValuesMany=aP,i.setWorkflowStepFields=vP,i.setWorkflowStepFieldsAttachment=SP,i.setWorkflowStepFieldsAttachments=AP,i.setWorkflowStepFieldsMany=EP,i.setWorkflowStepReview=yg,i.setWorkflowStepReviewRequest=sg,i.setWorkflowStepReviewRequests=ig,i.setWorkflowStepReviewer=LP,i.setWorkflowStepReviewers=NP,i.setWorkflowStepReviews=fg,i.setWorkflowSteps=Mg,i.setWorkflowType=Ug,i.setWorkflowTypes=Lg,i.setWorkflows=PI,i.shallowEqual=Cb,i.slugify=e_,i.spacesToDashesLower=xb,i.teamMembershipReducer=sI,i.teamMembershipSlice=na,i.teamReducer=wI,i.teamSlice=aa,i.toFileNameSafeString=Xb,i.toUuidArray=B,i.toUuidIdRecord=Qb,i.truncate=t_,i.updateAsset=eo,i.updateAssetAttachment=$c,i.updateAssetAttachments=Uc,i.updateAssetProcedure=pd,i.updateAssetProcedureStep=Ll,i.updateAssetProcedureStepFieldValues=Ml,i.updateAssetProcedureStepFieldValuesAttachment=yl,i.updateAssetProcedureStepFieldValuesAttachments=fl,i.updateAssetProcedureStepFieldValuesMany=kl,i.updateAssetProcedureStepFields=il,i.updateAssetProcedureStepFieldsAttachment=Ld,i.updateAssetProcedureStepFieldsAttachments=Nd,i.updateAssetProcedureStepFieldsMany=nl,i.updateAssetProcedureSteps=Nl,i.updateAssetProcedureType=_d,i.updateAssetProcedureTypeAttachment=tr,i.updateAssetProcedureTypeAttachments=sr,i.updateAssetProcedureTypeFieldValues=sd,i.updateAssetProcedureTypeFieldValuesAttachment=Ur,i.updateAssetProcedureTypeFieldValuesAttachments=Lr,i.updateAssetProcedureTypeFieldValuesMany=id,i.updateAssetProcedureTypeFields=Mr,i.updateAssetProcedureTypeFieldsAttachment=yr,i.updateAssetProcedureTypeFieldsAttachments=fr,i.updateAssetProcedureTypeFieldsMany=kr,i.updateAssetProcedureTypes=Rd,i.updateAssetProcedures=md,i.updateAssetStage=Eo,i.updateAssetStageCompletion=So,i.updateAssetStageCompletions=Ao,i.updateAssetStages=Vo,i.updateAssetType=Vh,i.updateAssetTypeAttachment=No,i.updateAssetTypeAttachments=Ho,i.updateAssetTypeFieldValues=Hu,i.updateAssetTypeFieldValuesAttachment=vu,i.updateAssetTypeFieldValuesAttachments=Eu,i.updateAssetTypeFieldValuesMany=Gu,i.updateAssetTypeFields=Au,i.updateAssetTypeFieldsAttachment=nu,i.updateAssetTypeFieldsAttachments=au,i.updateAssetTypeFieldsMany=wu,i.updateAssetTypeIdentifier=ah,i.updateAssetTypeIdentifierValue=wh,i.updateAssetTypeIdentifierValues=Th,i.updateAssetTypeIdentifiers=ch,i.updateAssetTypeStatus=Kh,i.updateAssetTypeStatuses=Yh,i.updateAssetTypes=Wh,i.updateAssets=to,i.updateCategories=up,i.updateCategory=op,i.updateConversation=Wc,i.updateConversations=d_,i.updateDocument=qp,i.updateDocumentAttachment=Fp,i.updateDocumentAttachments=Pp,i.updateDocuments=Cp,i.updateEmailDomain=Qp,i.updateEmailDomains=Xp,i.updateForm=my,i.updateFormIdentifier=fm,i.updateFormIdentifierValue=km,i.updateFormIdentifierValues=vm,i.updateFormIdentifiers=Sm,i.updateFormRevision=sy,i.updateFormRevisionAttachment=Nm,i.updateFormRevisionAttachments=Hm,i.updateFormRevisions=iy,i.updateFormSubmission=jy,i.updateFormSubmissionAttachment=_y,i.updateFormSubmissionAttachments=Ry,i.updateFormSubmissions=Dy,i.updateForms=yy,i.updateGeoImage=xy,i.updateGeoImages=ef,i.updateIssue=mS,i.updateIssueAssociation=hf,i.updateIssueAssociations=pf,i.updateIssueAttachment=Rf,i.updateIssueAttachments=Mf,i.updateIssueComment=sS,i.updateIssueCommentAttachment=Uf,i.updateIssueCommentAttachments=Lf,i.updateIssueComments=iS,i.updateIssueType=Sw,i.updateIssueTypeAttachment=RS,i.updateIssueTypeAttachments=MS,i.updateIssueTypeFieldValues=sA,i.updateIssueTypeFieldValuesAttachment=MA,i.updateIssueTypeFieldValuesAttachments=kA,i.updateIssueTypeFieldValuesMany=iA,i.updateIssueTypeFields=fA,i.updateIssueTypeFieldsAttachment=US,i.updateIssueTypeFieldsAttachments=LS,i.updateIssueTypeFieldsMany=SA,i.updateIssueTypeIdentifier=LA,i.updateIssueTypeIdentifierValue=iw,i.updateIssueTypeIdentifierValues=nw,i.updateIssueTypeIdentifiers=NA,i.updateIssueTypeStatus=vw,i.updateIssueTypeStatuses=Ew,i.updateIssueTypes=Aw,i.updateIssueUpdate=Uw,i.updateIssueUpdates=Lw,i.updateIssues=yS,i.updateOrganization=bT,i.updateOrganizationAccess=uT,i.updateOrganizationAccesses=hT,i.updateOrganizations=gT,i.updateProject=CO,i.updateProjectAccess=GT,i.updateProjectAccesses=KT,i.updateProjectAttachment=aO,i.updateProjectAttachments=cO,i.updateProjectFile=wO,i.updateProjectFiles=TO,i.updateProjects=qO,i.updateTeam=hI,i.updateTeamMembership=XO,i.updateTeamMemberships=xO,i.updateTeams=pI,i.updateUser=eT,i.updateUsers=xw,i.updateWorkflow=gI,i.updateWorkflowStep=kg,i.updateWorkflowStepAssignee=CI,i.updateWorkflowStepAssignees=jI,i.updateWorkflowStepComment=lF,i.updateWorkflowStepCommentAttachment=QI,i.updateWorkflowStepCommentAttachments=XI,i.updateWorkflowStepComments=oF,i.updateWorkflowStepCompletion=IF,i.updateWorkflowStepCompletions=FF,i.updateWorkflowStepEvent=BF,i.updateWorkflowStepEvents=zF,i.updateWorkflowStepFieldValues=cP,i.updateWorkflowStepFieldValuesAttachment=KF,i.updateWorkflowStepFieldValuesAttachments=YF,i.updateWorkflowStepFieldValuesMany=rP,i.updateWorkflowStepFields=VP,i.updateWorkflowStepFieldsAttachment=wP,i.updateWorkflowStepFieldsAttachments=TP,i.updateWorkflowStepFieldsMany=WP,i.updateWorkflowStepReview=Sg,i.updateWorkflowStepReviewRequest=ng,i.updateWorkflowStepReviewRequests=ag,i.updateWorkflowStepReviewer=HP,i.updateWorkflowStepReviewers=GP,i.updateWorkflowStepReviews=Ag,i.updateWorkflowSteps=vg,i.updateWorkflowType=Ng,i.updateWorkflowTypes=Hg,i.updateWorkflows=bI,i.useSelectorBuilder=qb,i.userReducer=sT,i.userSlice=Nn,i.uuidObj=_,i.uuidObjSortFn=Os,i.uuidSortFn=Wt,i.versioningReducer=xg,i.versioningSlice=Xg,i.workflowReducer=EI,i.workflowSlice=ra,i.workflowStepAssigneeReducer=HI,i.workflowStepAssigneeSlice=oa,i.workflowStepCommentAttachmentReducer=iF,i.workflowStepCommentAttachmentSlice=pa,i.workflowStepCommentReducer=fF,i.workflowStepCommentSlice=fa,i.workflowStepCompletionReducer=MF,i.workflowStepCompletionSlice=wa,i.workflowStepEventReducer=$F,i.workflowStepEventSlice=Ia,i.workflowStepFieldValuesAttachmentReducer=eP,i.workflowStepFieldValuesAttachmentSlice=ba,i.workflowStepFieldValuesReducer=pP,i.workflowStepFieldValuesSlice=ka,i.workflowStepFieldsAttachmentReducer=bP,i.workflowStepFieldsAttachmentSlice=Va,i.workflowStepFieldsReducer=jP,i.workflowStepFieldsSlice=qa,i.workflowStepReducer=Vg,i.workflowStepReviewReducer=Pg,i.workflowStepReviewRequestReducer=ug,i.workflowStepReviewRequestSlice=Ua,i.workflowStepReviewSlice=Ha,i.workflowStepReviewerReducer=XP,i.workflowStepReviewerSlice=ja,i.workflowStepSlice=Ya,i.workflowTypeReducer=Qg,i.workflowTypeSlice=Xa,Object.defineProperty(i,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@overmap-ai/core",
3
- "version": "1.0.78-workflows.2",
3
+ "version": "1.0.78-workflows.3",
4
4
  "description": "Core functionality for Overmap",
5
5
  "keywords": [
6
6
  "components",