@overmap-ai/core 1.0.79-gcs.0 → 1.0.79-gcs.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/overmap-core.js
CHANGED
|
@@ -11,5 +11,5 @@ Action:`,e);const p=Ke();if(!p)throw new Error("Outbox coordinator not set");p.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(A)}const p=o.type.split("/")[1];if(!p)throw new Error("File has no extension");const y=c??h+"."+p;if(o=dn(o,y),!o.name)throw new Error("Failed to set file's name");await this.addCache(o,h),Zt[n]=new Promise(A=>{A(o)})}return o}}class Ob extends O{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.uuid,c=new Date().toISOString(),n=F({...e,created_by:a,submitted_at:c});this.dispatch(Ki(n));const r=this.enqueueRequest({description:"Create form identifier",method:l.POST,url:"/form-identifiers/",payload:v(n),blockers:[n.form],blocks:[n.uuid]});return r.then(m=>{this.dispatch(mt(m))}).catch(()=>{this.dispatch(Yi(n.uuid))}),[n,r]}update(e){const{store:i}=this.client,a=Zi(e.uuid)(i.getState());if(!a)throw new Error(`Expected form identifier with uuid ${e.uuid} to exist`);const c={...a,...e};this.dispatch(mt(c));const n=this.enqueueRequest({description:"Update form identifier",method:l.PATCH,url:`/form-identifiers/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return n.then(r=>{this.dispatch(mt(r))}).catch(()=>{this.dispatch(mt(a))}),[c,n]}async delete(e){const{store:i}=this.client,a=i.getState(),c=Zi(e)(a);if(!c)throw new Error(`Expected form identifier with uuid ${e} to exist`);this.dispatch(Yi(e));try{return await this.enqueueRequest({description:"Delete form identifier",method:l.DELETE,url:`/form-identifiers/${e}/`,blockers:[e],blocks:[]})}catch(n){throw this.dispatch(Ki(c)),n}}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get form identifiers",method:l.GET,url:"/form-identifiers/",queryParams:{form__organization:e},blockers:[],blocks:[]},i);return this.dispatch(Qu(a)),a}}class Rb extends O{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.uuid,c=new Date().toISOString(),n=F({...e,created_by:a,submitted_at:c});this.dispatch(Xi(n));const r=this.enqueueRequest({description:"Create form identifier value",method:l.POST,url:"/form-identifier-values/",payload:v(n),blockers:[e.form_submission,e.form_identifier],blocks:[n.uuid]});return r.then(m=>{this.dispatch(pt(m))}).catch(()=>{this.dispatch(Qi(n.uuid))}),[n,r]}update(e){const{store:i}=this.client,a=ea(e.uuid)(i.getState());if(!a)throw new Error(`Expected form identifier value with uuid ${e.uuid} to exist`);const c={...a,...e};this.dispatch(pt(c));const n=this.enqueueRequest({description:"Update form identifier value",method:l.PATCH,url:`/form-identifier-values/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return n.then(r=>{this.dispatch(pt(r))}).catch(()=>{this.dispatch(pt(a))}),[c,n]}async delete(e){const{store:i}=this.client,a=i.getState(),c=ea(e)(a);if(!c)throw new Error(`Expected form identifier value with uuid ${e} to exist`);this.dispatch(Qi(e));try{return await this.enqueueRequest({description:"Delete form identifier value",method:l.DELETE,url:`/form-identifier-values/${e}/`,blockers:[e],blocks:[]})}catch(n){throw this.dispatch(Xi(c)),n}}async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Get form identifier values",method:l.GET,url:"/form-identifier-values/",queryParams:{limit:this.pageSize,paginate:!0,form_submission__form_revision__form__organization:e},blockers:[],blocks:[]},n=>({immediate:!0,description:"Get form identifier values",method:l.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(io(c)),c}}class vb extends E{async bulkAdd(e){var m;const i=new Date().toISOString(),a=(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.uuid,c={},n=[],r=[];for(const o of e){const{revisionUuid:h,fieldIdentifier:p,file:y}=o,A=await this.getFilePayload(y);A.sha1 in c||(c[A.sha1]=A);const I=F({file:URL.createObjectURL(y),file_type:y.type,file_name:y.name,file_sha1:A.sha1,created_by:a,form_revision:h,submitted_at:i,field_identifier:p});n.push(I);const g={uuid:I.uuid,file_name:y.name,field_identifier:p,file_extension:A.extension,file_sha1:A.sha1,form_revision:h};r.push(g)}this.dispatch(uo(n));const u=this.enqueueRequest({description:"Attach files to form revision",method:l.POST,url:"/form-revision-attachments/bulk/",payload:{submitted_at:i,attachments:r,files:Object.values(c)},blockers:n.map(o=>o.form_revision),blocks:n.map(o=>o.uuid)});return u.then(o=>{this.processPresignedUrls(o.presigned_urls),this.dispatch(oo(o.attachments))}).catch(()=>{this.dispatch(lo(n.map(o=>o.uuid)))}),[n,u.then(({attachments:o})=>o)]}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Fetch organization form revision attachments",method:l.GET,url:"/form-revision-attachments/",queryParams:{form_revision__form__organization:e},blockers:[e],blocks:[]},i);return this.dispatch(ro(a)),a}}class wb extends E{add(e){var u;const{store:i}=this.client,c=(u=i.getState().userReducer.currentUser)==null?void 0:u.uuid,n=F({...e,created_by:c,submitted_at:new Date().toISOString()});this.dispatch(ia(n));const r=this.enqueueRequest({description:"Create form revision",method:l.POST,url:"/form-revisions/",payload:v(n),blockers:[e.form],blocks:[n.uuid]});return r.then(m=>{this.dispatch(fo(m))}).catch(()=>{this.dispatch(aa(n.uuid))}),[n,r]}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get organization form revisions",method:l.GET,url:"/form-revisions/",queryParams:{form__organization:e},blockers:[e],blocks:[]},i);return this.dispatch(yo(a)),a}}class Mb extends E{add(e,i){var o;const{store:a}=this.client,c=new Date().toISOString(),n=(o=a.getState().userReducer.currentUser)==null?void 0:o.uuid,r=F({...e,submitted_at:c,created_by:n}),u=F({...i,form:r.uuid,submitted_at:c,created_by:n});this.dispatch(da(r)),this.dispatch(ia(u));const m=this.enqueueRequest({description:"Create form",method:l.POST,url:"/forms/",payload:{...v(r),initial_revision:{uuid:u.uuid,submitted_at:u.submitted_at,title:u.title,description:u.description,fields:u.fields}},blockers:[],blocks:[r.uuid,u.uuid]});return m.catch(h=>{throw this.dispatch(ua(r.uuid)),this.dispatch(aa(u.uuid)),h}),[r,u,m]}async delete(e){const{store:i}=this.client,a=i.getState(),c=Oo(e)(a);if(!c)throw new Error("Expected form to exist");const n=ko(e)(a);n.length>0&&this.dispatch(Do(n.map(({uuid:u})=>u)));const r=To(e)(a);r.length>0&&this.dispatch(So(r.map(({uuid:u})=>u))),this.dispatch(ua(e));try{return await this.enqueueRequest({description:"Delete form",method:l.DELETE,url:`/forms/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(da(c)),r.length>0&&this.dispatch(Ao(r)),n.length>0&&this.dispatch(Uo(n)),u}}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Fetch organization forms",method:l.GET,url:"/forms/",queryParams:{organization:e},blockers:[e],blocks:[]},i);return this.dispatch(bo(a)),a}}class Vb extends E{async bulkAdd(e){var m;const i=new Date().toISOString(),a=(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.uuid,c={},n=[],r=[];for(const o of e){const{submissionUuid:h,fieldIdentifier:p,file:y}=o,A=await this.getFilePayload(y);A.sha1 in c||(c[A.sha1]=A);const I=F({file:URL.createObjectURL(y),file_type:y.type,file_name:y.name,file_sha1:A.sha1,created_by:a,form_submission:h,submitted_at:i,field_identifier:p});n.push(I);const g={uuid:I.uuid,file_name:y.name,file_sha1:A.sha1,file_extension:A.extension,field_identifier:p,form_submission:h};r.push(g)}this.dispatch(kt(n));const u=this.enqueueRequest({description:"Attach files to form submission",method:l.POST,url:"/form-submission-attachments/bulk/",payload:{submitted_at:i,attachments:r,files:Object.values(c)},blockers:n.map(o=>o.form_submission),blocks:n.map(o=>o.uuid)});return u.then(o=>{this.processPresignedUrls(o.presigned_urls),this.dispatch(wo(o.attachments))}).catch(o=>{throw this.dispatch(Bt(n.map(h=>h.uuid))),o}),[n,u.then(({attachments:o})=>o)]}async bulkDelete(e){const{store:i}=this.client,a=i.getState(),c=Vo(e)(a);this.dispatch(Bt(e));try{await this.enqueueRequest({description:"Delete form submission attachments",method:l.DELETE,url:"/form-submission-attachments/bulk/",payload:{uuids:e},blockers:e,blocks:[]})}catch(n){throw this.dispatch(kt(c)),n}}async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Get form submission attachments",method:l.GET,url:"/form-submission-attachments/",queryParams:{limit:$e,paginate:!0,form_submission__form_revision__form__organization:e},blockers:[],blocks:[]},n=>({immediate:!0,description:"Get form submission attachments",method:l.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(vo(c)),c}}class Eb extends E{add(e){var r;const{store:i}=this.client,a=i.getState(),c=F({...e,created_by:(r=a.userReducer.currentUser)==null?void 0:r.uuid,submitted_at:new Date().toISOString()}),n=this.enqueueRequest({description:"Add form submission",method:l.POST,url:"/form-submissions/",payload:v(c),blockers:[e.form_revision],blocks:[c.uuid]});return this.dispatch(ma(c)),n.then(u=>(this.dispatch($t(u)),u)).catch(()=>{this.dispatch(pa(c.uuid))}),[c,n]}update(e){const{store:i}=this.client,a=i.getState(),c=Aa(e.uuid)(a);if(!c)throw new Error(`Expected submission with uuid ${e.uuid} to exist`);const n={...c,...e};this.dispatch(Co(n));const r=this.enqueueRequest({description:"Delete user form submissions",method:l.PATCH,url:`/form-submissions/${n.uuid}/`,payload:e,blockers:[n.uuid],blocks:[n.uuid]});return r.then(u=>{this.dispatch($t(u))}).catch(()=>{this.dispatch($t(c))}),[n,r]}async delete(e){const{store:i}=this.client,a=i.getState(),c=Aa(e)(a);if(!c)throw new Error(`Expected submission with uuid ${e} to exist`);const n=Eo(e)(a);this.dispatch(pa(e)),this.dispatch(Bt(n.map(r=>r.uuid)));try{return await this.enqueueRequest({description:"Delete user form submissions",method:l.DELETE,url:`/form-submissions/${e}/`,blockers:[e],blocks:[]})}catch(r){throw this.dispatch(ma(c)),this.dispatch(kt(n)),r}}async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Fetch form submissions",method:l.GET,url:"/form-submissions/",queryParams:{limit:this.pageSize,paginate:!0,form_revision__form_organization:e},blockers:[],blocks:[]},n=>({immediate:!0,description:"Fetch form submissions",method:l.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(zo(c)),c}}class jb extends E{async add(e){var p;const{store:i}=this.client,{file:a,...c}=e,n=new Date().toISOString(),r=(p=i.getState().userReducer.currentUser)==null?void 0:p.uuid,u=c.project,m=await this.getFilePayload(a),o=F({...c,file_name:a.name,file_sha1:m.sha1,file_type:a.type,file:URL.createObjectURL(a),submitted_at:n,created_by:r});this.dispatch(No(o));const h=this.enqueueRequest({description:"Add geo image",method:l.POST,url:"/geo-images/",payload:{uuid:o.uuid,submitted_at:n,title:o.title,description:o.description,geo_marker:o.geo_marker,canvas_marker:o.canvas_marker,sha1:o.file_sha1,project:o.project,file_name:o.file_name,direction:o.direction,original_date:o.original_date,file:m},blocks:[u],blockers:[u]});return h.then(y=>{this.processPresignedUrls(y.presigned_urls),this.dispatch(yt(y.geo_image))}).catch(()=>{this.dispatch(Sa(o.uuid))}),[o,h.then(y=>y.geo_image)]}async bulkAdd(e,i){var p;const{store:a}=this.client,c=new Date().toISOString(),n=(p=a.getState().userReducer.currentUser)==null?void 0:p.uuid,r=[],u=[],m=[],o={};for(const y of e){const{file:A,...I}=y,g=await this.getFilePayload(A);g.sha1 in o||(o[g.sha1]=g);const R=F({...I,file_name:A.name,file_sha1:g.sha1,file_type:A.type,file:URL.createObjectURL(A),submitted_at:c,created_by:n,project:i});r.push(R),u.push(R.uuid),m.push({uuid:R.uuid,sha1:R.file_sha1,file_name:R.file_name,title:R.title,description:R.description,geo_marker:R.geo_marker,canvas_marker:R.canvas_marker,direction:R.direction,original_date:R.original_date})}this.dispatch(Ho(r));const h=this.enqueueRequest({description:"Bulk add geo images",method:l.POST,url:"/geo-images/bulk/",payload:{submitted_at:c,project:i,geo_images:m,files:Object.values(o)},blocks:[i],blockers:u});return h.then(y=>{this.processPresignedUrls(y.presigned_urls),this.dispatch(Lo(y.geo_images))}).catch(()=>{this.dispatch(Ko(u))}),[r,h.then(y=>y.geo_images)]}update(e){const{store:i}=this.client,a=i.getState(),c=Ta(e.uuid)(a);if(!c)throw new Error(`Map image with uuid ${e.uuid} does not exist in the store`);const n={...c,...e};this.dispatch(Wo(n));const r=this.enqueueRequest({description:"Update geo image",method:l.PATCH,url:`/geo-images/${e.uuid}/`,payload:e,blocks:[e.uuid],blockers:[e.uuid]});return r.then(u=>{this.dispatch(yt(u))}).catch(()=>{this.dispatch(yt(c))}),[n,r]}async delete(e){const{store:i}=this.client,a=i.getState(),c=Ta(e)(a);if(!c)throw new Error(`Map image with uuid ${e} does not exist in the store`);this.dispatch(Sa(e));const n=this.enqueueRequest({description:"Delete geo image",method:l.DELETE,url:`/geo-images/${e}/`,blocks:[e],blockers:[e]});return n.catch(()=>{this.dispatch(yt(c))}),n}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get geo images",method:l.GET,url:"/geo-images/",queryParams:{project:e},blocks:[e],blockers:[]},i);return this.dispatch(Go(a)),a}}class qb extends O{add(e){var u;const{store:i}=this.client,a=new Date().toISOString(),c=(u=i.getState().userReducer.currentUser)==null?void 0:u.uuid,n=F({...e,submitted_at:a,created_by:c});this.dispatch(ga(n));const r=this.enqueueRequest({description:"Add issue association",method:l.POST,url:"/issue-associations/",payload:v(n),blockers:[e.associated_issue,...e.issue?[e.issue]:[],...e.asset?[e.asset]:[]],blocks:[n.uuid]});return r.then(m=>{this.dispatch(xo(m))}).catch(()=>{this.dispatch(Fa(n.uuid))}),[n,r]}async delete(e){const{store:i}=this.client,a=el(e)(i.getState());if(!a)throw new Error(`Issue association with uuid ${e} not found in store.`);this.dispatch(Fa(e));const c=this.enqueueRequest({description:"Delete issue association",method:l.DELETE,url:`/issue-associations/${e}/`,blockers:[e],blocks:[]});return c.catch(()=>{this.dispatch(ga(a))}),c}async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Fetch issue associations",method:l.GET,url:"/issue-associations/",queryParams:{limit:this.pageSize,paginate:!0,associated_issue__project:e},blockers:[],blocks:[]},n=>({immediate:!0,description:"Fetch issue associations",method:l.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(Qo(c)),c}}class zb extends Ne{constructor(){super(...arguments);S(this,"name","Issue Attachment");S(this,"url","/issue-attachments");S(this,"initializeAttachments",Oa);S(this,"addAttachments",Ra);S(this,"updateAttachments",rl);S(this,"removeAttachments",va);S(this,"removeAttachment",dl);S(this,"setAttachment",nl);S(this,"selectAttachment",hl)}getId(i){return i.uuid}buildModel(i){return F({file:URL.createObjectURL(i.file),file_sha1:i.file_sha1,created_by:i.created_by,file_name:i.file.name,file_type:i.file.type,submitted_at:i.submitted_at,issue:i.modelUuid})}buildPayload(i,a){return{uuid:i.uuid,file_name:i.file_name,file_sha1:i.file_sha1,file_extension:a.extension,issue:i.issue}}async bulkAdd(i){return this._bulkAdd(i.map(a=>({modelUuid:a.issueUuid,file:a.file})))}async delete(i){return this._delete(i)}async refreshStore(i,a){const n=(await this.performPagination({immediate:!0,description:"Get issue attachments",method:l.GET,url:`${this.url}/`,queryParams:{limit:$e,paginate:!0,issue__project:i},blocks:[],blockers:[]},r=>({immediate:!0,description:"Get issue attachments",method:l.GET,url:r,blockers:[],blocks:[]}),a)).flat();return this.dispatch(Oa(n)),n}}class Ub extends Ne{constructor(){super(...arguments);S(this,"name","Issue Comment Attachment");S(this,"url","/issue-comment-attachments");S(this,"initializeAttachments",Ma);S(this,"addAttachments",yl);S(this,"updateAttachments",fl);S(this,"removeAttachments",Tl);S(this,"removeAttachment",Sl);S(this,"setAttachment",Al);S(this,"selectAttachment",bl)}getId(i){return i.uuid}buildModel(i){return F({file:URL.createObjectURL(i.file),file_sha1:i.file_sha1,created_by:i.created_by,file_name:i.file.name,file_type:i.file.type,submitted_at:i.submitted_at,issue_comment:i.modelUuid})}buildPayload(i,a){return{uuid:i.uuid,file_name:i.file_name,file_sha1:i.file_sha1,file_extension:a.extension,issue_comment:i.issue_comment}}async bulkAdd(i){return this._bulkAdd(i.map(a=>({modelUuid:a.issueCommentUuid,file:a.file})))}async delete(i){return this._delete(i)}async refreshStore(i,a){const n=(await this.performPagination({immediate:!0,description:"Get issue comment attachments",method:l.GET,url:`${this.url}/`,queryParams:{limit:$e,paginate:!0,issue_comment__issue__project:i},blocks:[],blockers:[]},r=>({immediate:!0,description:"Get issue comment attachments",method:l.GET,url:r,blockers:[],blocks:[]}),a)).flat();return this.dispatch(Ma(n)),n}}class Cb extends O{add(e){var n;const{store:i}=this.client,a=F({...e,author:(n=i.getState().userReducer.currentUser)==null?void 0:n.uuid,submitted_at:new Date().toISOString()});this.dispatch(Ea(a));const c=this.enqueueRequest({description:"Add issue comment",method:l.POST,url:"/issue-comments/",payload:v(a),blockers:[e.issue],blocks:[a.uuid]});return c.catch(()=>{this.dispatch(qa(a.uuid))}),[a,c]}update(e){const{store:i}=this.client,a=za(e.uuid)(i.getState());if(!a)throw new Error(`Comment with uuid ${e.uuid} not found in store`);const c={...a,...e};this.dispatch(ja(c));const n=this.enqueueRequest({description:"Edit issue comment",method:l.PATCH,url:`/issue-comments/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return n.catch(()=>{this.dispatch(ja(a))}),[c,n]}remove(e){const{store:i}=this.client,a=za(e)(i.getState());if(!a)throw new Error(`Comment with uuid ${e} not found in store`);this.dispatch(qa(e));const c=this.enqueueRequest({description:"Delete comment",method:l.DELETE,url:`/issue-comments/${e}/`,blockers:[e],blocks:[]});return c.catch(()=>{this.dispatch(Ea(a))}),c}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get comments",method:l.GET,url:"/issue-comments/",queryParams:{issue__project:e},blockers:[],blocks:[]},i);return this.dispatch(_l(a)),a}}class Db extends O{add(e){var m;const{store:i}=this.client,a=i.getState(),c=new Date().toISOString(),n=(m=a.userReducer.currentUser)==null?void 0:m.uuid,r=F({...e,submitted_at:c,created_by:n});this.dispatch(Ca(r));const u=this.enqueueRequest({description:"Create issue",method:l.POST,url:"/issues/",payload:v(r),blockers:[r.project,r.issue_type,...r.category?[r.category]:[]],blocks:[r.uuid]});return u.then(o=>{this.dispatch(Gt(o))}).catch(o=>{throw this.dispatch(Da(r.uuid)),o}),[r,u]}update(e){var m;const i=this.client.store.getState(),a=$a(e.uuid)(i);if(!a)throw new Error(`Attempting to update an issue with uuid ${e.uuid} that doesn't exist in the store`);const c={...a,...e};this.dispatch(Gt(c));const n={};for(const o of[V.TITLE,V.DESCRIPTION,V.STATUS,V.CATEGORY,V.PRIORITY,V.ASSIGNED_TO,V.DUE_DATE])if(o in e&&e[o]!==a[o])switch(o){case V.PRIORITY:case V.STATUS:{const h=e[o];n[o]=h!==void 0?Number(h):null;break}case V.DUE_DATE:case V.DESCRIPTION:case V.TITLE:n[o]=e[o]??null;break;case V.CATEGORY:{let h=null;const p=e[o];if(p&&(h=i.categoryReducer.instances[p]??null,!h))throw new Error(`Trying to update issue category to ${p} which does not exist in store`);n[o]=h?{name:h.name,color:h.color,uuid:h.uuid}:null;break}case V.ASSIGNED_TO:{let h=null;const p=e[o];if(p&&(h=i.userReducer.instances[p]??null,!h))throw new Error(`Trying to update issue assigned_to to ${p} which does not exist in store`);n[o]=h?{email:h.email,id:h.uuid}:null;break}}const r=F({created_by:(m=i.userReducer.currentUser)==null?void 0:m.uuid,submitted_at:new Date().toISOString(),issue:a.uuid,changes:n});this.dispatch(jh(r));const u=this.enqueueRequest({description:"Edit issue",method:l.PATCH,url:`/issues/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.catch(()=>{this.dispatch(Gt(a)),this.dispatch(zh(r.uuid))}),[c,u]}async remove(e){const{store:i}=this.client,a=i.getState(),c=$a(e)(a);if(!c)throw new Error(`No issue with uuid ${e} found in the store`);const n=ll(e)(a),r=kh(e)(a),u={};for(const o of tl(e)(a))u[o.uuid]=o;for(const o of sl(e)(a))u[o.uuid]=o;const m=Object.values(u);this.dispatch(Da(e)),n.length>0&&this.dispatch(va(n.map(({uuid:o})=>o))),r.length>0&&this.dispatch(Uh(r.map(({uuid:o})=>o))),m.length>0&&this.dispatch(Pa(m.map(({uuid:o})=>o)));try{return await this.enqueueRequest({description:"Delete issue",method:l.DELETE,url:`/issues/${e}/`,blockers:[e],blocks:[]})}catch(o){throw this.dispatch(Ca(c)),this.dispatch(Ra(n)),this.dispatch(qh(r)),this.dispatch(ba(m)),o}}async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Get issues",method:l.GET,url:"/issues/",queryParams:{limit:this.pageSize,paginate:!0,project:e},blockers:[],blocks:[]},n=>({immediate:!0,description:"Get issues",method:l.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(wl(c)),c}}class kb extends Ne{constructor(){super(...arguments);S(this,"name","Issue Type Attachment");S(this,"url","/issue-type-attachments");S(this,"initializeAttachments",La);S(this,"addAttachments",zl);S(this,"updateAttachments",Cl);S(this,"removeAttachments",kl);S(this,"removeAttachment",Dl);S(this,"setAttachment",Ul);S(this,"selectAttachment",Gl)}getId(i){return i.uuid}buildModel(i){return F({file:URL.createObjectURL(i.file),file_sha1:i.file_sha1,created_by:i.created_by,file_name:i.file.name,file_type:i.file.type,submitted_at:i.submitted_at,issue_type:i.modelUuid})}buildPayload(i,a){return{uuid:i.uuid,file_name:i.file_name,file_sha1:i.file_sha1,file_extension:a.extension,issue_type:i.issue_type}}async bulkAdd(i){return this._bulkAdd(i.map(a=>({modelUuid:a.issueTypeUuid,file:a.file})))}async delete(i){return this._delete(i)}async refreshStore(i,a){const c=await this.enqueueRequest({immediate:!0,description:"Get issue type attachments",method:l.GET,url:`${this.url}/`,queryParams:{issue_type__organization:i},blocks:[],blockers:[]},a);return this.dispatch(La(c)),c}}class Bb extends E{async bulkAdd(e){var m;const i=new Date().toISOString(),a=(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.uuid,c={},n=[],r=[];for(const o of e){const{fieldsRevisionUuid:h,fieldIdentifier:p,file:y}=o,A=await this.getFilePayload(y);A.sha1 in c||(c[A.sha1]=A);const I=F({file:URL.createObjectURL(y),file_type:y.type,file_name:y.name,file_sha1:A.sha1,created_by:a,fields_revision:h,submitted_at:i,field_identifier:p});n.push(I);const g={uuid:I.uuid,file_name:y.name,file_extension:A.extension,field_identifier:p,file_sha1:A.sha1,fields_revision:h};r.push(g)}this.dispatch(Wl(n));const u=this.enqueueRequest({description:"Add issue type fields attachments",method:l.POST,url:"/issue-type-fields-attachments/bulk/",payload:{submitted_at:i,attachments:r,files:Object.values(c)},blockers:n.map(o=>o.fields_revision),blocks:n.map(o=>o.uuid)});return u.then(o=>{this.processPresignedUrls(o.presigned_urls),this.dispatch(Kl(o.attachments))}).catch(()=>{this.dispatch(Yl(n.map(o=>o.uuid)))}),[n,u.then(({attachments:o})=>o)]}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"get issue type fields attachments",method:l.GET,url:"/issue-type-fields-attachments/",queryParams:{fields_revision__issue_type__organization:e},blockers:[e],blocks:[]},i);return this.dispatch(Hl(a)),a}}class $b extends O{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.uuid,c=new Date().toISOString(),n=F({...e,created_by:a,submitted_at:c});this.dispatch(ah(n));const r=this.enqueueRequest({description:"Add Issue Type Fields",method:l.POST,url:"/issue-type-fields/",payload:v(n),blockers:[n.issue_type],blocks:[n.uuid]});return r.then(m=>{this.dispatch(ch(m))}).catch(m=>{throw this.dispatch(nh(n.uuid)),m}),[n,r]}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get Issue Type Fields",method:l.GET,url:"/issue-type-fields/",queryParams:{issue_type__organization:e},blockers:[],blocks:[]},i);return this.dispatch(ih(a)),a}}class Gb extends E{async bulkAdd(e){var m;const i=new Date().toISOString(),a=(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.uuid,c={},n=[],r=[];for(const o of e){const{fieldValuesUuid:h,fieldIdentifier:p,file:y}=o,A=await this.getFilePayload(y);A.sha1 in c||(c[A.sha1]=A);const I=F({file:URL.createObjectURL(y),file_type:y.type,file_name:y.name,file_sha1:A.sha1,created_by:a,field_values:h,submitted_at:i,field_identifier:p});n.push(I);const g={uuid:I.uuid,file_name:y.name,file_sha1:A.sha1,file_extension:A.extension,field_identifier:p,field_values:h};r.push(g)}this.dispatch(Nt(n));const u=this.enqueueRequest({description:"Add issue type field values attachments",method:l.POST,url:"/issue-type-field-values-attachments/bulk/",payload:{submitted_at:i,attachments:r,files:Object.values(c)},blockers:n.map(o=>o.field_values),blocks:n.map(o=>o.uuid)});return u.then(({presigned_urls:o,attachments:h})=>{this.processPresignedUrls(o),this.dispatch(lh(h))}).catch(o=>{throw this.dispatch(Ht(n.map(h=>h.uuid))),o}),[n,u.then(({attachments:o})=>o)]}async bulkDelete(e){const{store:i}=this.client,a=i.getState(),c=mh(e)(a);this.dispatch(Ht(e));try{await this.enqueueRequest({description:"Delete issue type field values attachments",method:l.DELETE,url:"/issue-type-field-values-attachments/bulk/",payload:{uuids:e},blockers:e,blocks:[]})}catch(n){throw this.dispatch(Nt(c)),n}}async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Get issue type field values attachments",method:l.GET,url:"/issue-type-field-values-attachments/",queryParams:{limit:$e,paginate:!0,field_values__issue__project:e,latest:!0},blockers:[],blocks:[]},n=>({immediate:!0,description:"Get issue type field values attachments",method:l.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(oh(c)),c}}class Lb extends O{add(e){var r;const{store:i}=this.client,a=i.getState(),c=F({...e,created_by:(r=a.userReducer.currentUser)==null?void 0:r.uuid,submitted_at:new Date().toISOString()}),n=this.enqueueRequest({description:"Add issue type field values",method:l.POST,url:"/issue-type-field-values/",payload:v(c),blockers:[e.issue,e.fields_revision],blocks:[c.uuid]});return this.dispatch(Wa(c)),n.then(u=>(this.dispatch(ft(u)),u)).catch(()=>{this.dispatch(Ka(c.uuid))}),[c,n]}update(e){const{store:i}=this.client,a=i.getState(),c=Za(e.uuid)(a);if(!c)throw new Error(`Expected IssueTypeFieldValues with uuid ${e.uuid} to exist`);const n={...c,...e};this.dispatch(ft(n));const r=this.enqueueRequest({description:"Update issue type field values",method:l.PATCH,url:`/issue-type-field-values/${e.uuid}/`,payload:e,blockers:[n.uuid,n.fields_revision,n.issue],blocks:[n.uuid]});return r.then(u=>{this.dispatch(ft(u))}).catch(()=>{this.dispatch(ft(c))}),[n,r]}async delete(e){const{store:i}=this.client,a=i.getState(),c=Za(e)(a);if(!c)throw new Error(`Expected submission with uuid ${e} to exist`);const n=ph(e)(a);this.dispatch(Ka(e)),this.dispatch(Ht(n.map(r=>r.uuid)));try{await this.enqueueRequest({description:"Delete issue type field values",method:l.DELETE,url:`/issue-type-field-values/${e}/`,blockers:[e],blocks:[]})}catch(r){throw this.dispatch(Wa(c)),this.dispatch(Nt(n)),r}}async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Get issue type field values",method:l.GET,url:"/issue-type-field-values/",queryParams:{limit:this.pageSize,paginate:!0,issue__project:e,latest:!0},blockers:[],blocks:[]},n=>({immediate:!0,description:"Get issue type field values",method:l.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(xl(c)),c}}class Nb extends O{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.uuid,c=new Date().toISOString(),n=F({...e,created_by:a,submitted_at:c});this.dispatch(ec(n));const r=this.enqueueRequest({description:"Create issue type identifier",method:l.POST,url:"/issue-type-identifiers/",payload:v(n),blockers:[n.issue_type],blocks:[n.uuid]});return r.then(m=>{this.dispatch(St(m))}).catch(()=>{this.dispatch(tc(n.uuid))}),[n,r]}update(e){const{store:i}=this.client,a=sc(e.uuid)(i.getState());if(!a)throw new Error(`Expected issue type identifier with uuid ${e.uuid} to exist`);const c={...a,...e};this.dispatch(St(c));const n=this.enqueueRequest({description:"Update issue type identifier",method:l.PATCH,url:`/issue-type-identifiers/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return n.then(r=>{this.dispatch(St(r))}).catch(()=>{this.dispatch(St(a))}),[c,n]}async delete(e){const{store:i}=this.client,a=i.getState(),c=sc(e)(a);if(!c)throw new Error(`Expected issue type identifier with uuid ${e} to exist`);this.dispatch(tc(e));try{return await this.enqueueRequest({description:"Delete issue type identifier",method:l.DELETE,url:`/issue-type-identifiers/${e}/`,blockers:[e],blocks:[]})}catch(n){throw this.dispatch(ec(c)),n}}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get issue type identifiers",method:l.GET,url:"/issue-type-identifiers/",queryParams:{issue_type__organization:e},blockers:[],blocks:[]},i);return this.dispatch(fh(a)),a}}class Hb extends O{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.uuid,c=new Date().toISOString(),n=F({...e,created_by:a,submitted_at:c});this.dispatch(ac(n));const r=this.enqueueRequest({description:"Create issue type identifier value",method:l.POST,url:"/issue-type-identifier-values/",payload:v(n),blockers:[e.issue,e.issue_type_identifier],blocks:[n.uuid]});return r.then(m=>{this.dispatch(Tt(m))}).catch(()=>{this.dispatch(cc(n.uuid))}),[n,r]}update(e){const{store:i}=this.client,a=rc(e.uuid)(i.getState());if(!a)throw new Error(`Expected issue type identifier value with uuid ${e.uuid} to exist`);const c={...a,...e};this.dispatch(Tt(c));const n=this.enqueueRequest({description:"Update issue type identifier value",method:l.PATCH,url:`/issue-type-identifier-values/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return n.then(r=>{this.dispatch(Tt(r))}).catch(()=>{this.dispatch(Tt(a))}),[c,n]}async delete(e){const{store:i}=this.client,a=i.getState(),c=rc(e)(a);if(!c)throw new Error(`Expected issue type identifier value with uuid ${e} to exist`);this.dispatch(cc(e));try{return await this.enqueueRequest({description:"Delete issue type identifier value",method:l.DELETE,url:`/issue-type-identifier-values/${e}/`,blockers:[e],blocks:[]})}catch(n){throw this.dispatch(ac(c)),n}}async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Get issue type identifier values",method:l.GET,url:"/issue-type-identifier-values/",queryParams:{limit:this.pageSize,paginate:!0,issue__project:e},blockers:[],blocks:[]},n=>({immediate:!0,description:"Get issue type identifier values",method:l.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(bh(c)),c}}class Wb extends O{add(e){var r;const{store:i}=this.client,a=i.getState(),c=F({...e,submitted_at:new Date().toISOString(),created_by:(r=a.userReducer.currentUser)==null?void 0:r.uuid});this.dispatch(Rh(c));const n=this.enqueueRequest({method:l.POST,url:"/issue-types/",payload:v(c),blockers:[],blocks:[c.uuid]});return n.then(u=>{this.dispatch(It(u))}).catch(()=>{this.dispatch(uc(c.uuid))}),[c,n]}update(e){const{store:i}=this.client,a=i.getState(),c=lc(e.uuid)(a);if(!c)throw new Error(`IssueType with uuid ${e.uuid} does not exist in the store.`);const n={...c,...e};this.dispatch(vh(n));const r=this.enqueueRequest({method:l.PATCH,url:`/issue-types/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return r.then(u=>{this.dispatch(It(u))}).catch(()=>{this.dispatch(It(c))}),[n,r]}delete(e){const{store:i}=this.client,a=i.getState(),c=lc(e)(a);if(!c)throw new Error(`IssueType with uuid ${e} does not exist in the store.`);const n=El(e)(a);this.dispatch(uc(e)),this.dispatch(Vl(n.map(u=>u.uuid)));const r=this.enqueueRequest({method:l.DELETE,url:`/issue-types/${e}/`,blockers:[e],blocks:[]});return r.catch(()=>{this.dispatch(It(c)),this.dispatch(Ml(n))}),r}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,method:l.GET,url:"/issue-types/",queryParams:{organization:e},blockers:[],blocks:[]},i);return this.dispatch(Oh(a)),a}}class Kb extends O{async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Get issue updates",method:l.GET,url:"/issue-updates/",queryParams:{limit:this.pageSize,paginate:!0,issue__project:e},blockers:[],blocks:[]},n=>({immediate:!0,description:"Get issue updates",method:l.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(Eh(c)),c}}const Yb=1800;function Zb(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 Jb extends Yg{constructor(){super(...arguments);S(this,"_getRenewedTokens",async i=>{const a=this.enqueueRequest({description:"Get renewed tokens",method:l.POST,url:this.refreshTokensUrl,payload:{refresh:i},isAuthNeeded:!1,blockers:[],blocks:[],checkAuth:!1,immediate:!0});let c;try{c=await a}catch(n){console.error("Could not renew tokens; clearing auth",n),this.clearAuth();return}if(!c.access)throw new Error("Missing access token");return{accessToken:c.access,refreshToken:c.refresh??this.getRefreshToken()}})}clearAuth(){console.debug(this.constructor.name,"clearing auth;"),this.dispatch(Fu(!1)),this.clearTokens(),this.dispatch(b()),this.dispatch(b())}async renewTokens(){const i=this.getRefreshToken();if(!i)throw new Error("No refresh token found");console.debug(this.constructor.name,"renewing tokens");try{const a=await this._getRenewedTokens(i);if(!a)return;console.log("Got renewed tokens"),this.setTokens(a)}catch(a){throw console.error("Could not renew tokens; clearing auth",a),this.clearAuth(),a}}tokenIsExpiringSoon(){const i=this.getAccessToken();if(!i)return!1;const a=Date.now()/1e3;let c;try{c=Bp(i).exp??a}catch{c=a}return c-a<Yb}getAuthHeader(){return`Bearer ${this.getAccessToken()}`}async prepareAuth(){if(this.tokenIsExpiringSoon()){console.debug(this.constructor.name,"preparing auth");try{await this.renewTokens()}catch(i){return i instanceof U&&this.clearAuth(),i instanceof Error?Promise.reject(i):Promise.reject(new Error((i??Qe).toString()))}}}async handleUnauthorized(i,a){const c=this.client.store.getState();if(i.url.endsWith("/token/refresh/"))throw c.authReducer.isLoggedIn&&console.warn("No signed-in user to sign out."),this.clearAuth(),new U({message:"You have been signed out due to inactivity.",response:a,discard:!0});if(c.authReducer.isLoggedIn)await this.renewTokens();else throw console.debug("Forbidden; user is not logged in."),new U({message:"Incorrect username or password.",response:a,discard:!0})}async initAuth(i){const a=Ze.v4();return console.debug(this.constructor.name,"Initiating auth"),this.enqueueRequest({uuid:a,description:"Get token pair",method:l.POST,url:this.initTokensUrl,payload:i,isAuthNeeded:!1,checkAuth:!1,immediate:!0,blockers:[],blocks:[]}).then(c=>{this.setTokens(Zb(c))})}}class Xb extends O{update(e){const{store:i}=this.client,a=fc(e.uuid)(i.getState()),c={...a,...e};this.dispatch(Kt(c));const n=this.enqueueRequest({description:"Edit organization access",method:l.PATCH,url:`/organization-accesses/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return n.then(r=>{this.dispatch(Kt(r))}).catch(r=>{throw this.dispatch(Kt(a)),r}),[c,n]}async remove(e){const{store:i}=this.client,a=i.getState(),c=fc(e)(a),n=Kh(c.user)(a);this.dispatch(Xh(c.uuid)),this.dispatch(Nh(c.user));try{await this.enqueueRequest({description:"Remove organization access",method:l.DELETE,url:`/organization-accesses/${c.uuid}/`,blockers:[c.uuid],blocks:[]})}catch(r){throw this.dispatch(Jh(c)),this.dispatch(Lh(n)),r}}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get organization accesses",method:l.GET,url:"/organization-accesses/",queryParams:{organization:e},blockers:[],blocks:[]},i);return this.dispatch(Zh(a)),a}}class Qb extends O{async add(e){const i=await this.enqueueRequest({description:"Create organization",method:l.POST,url:"/organizations/",payload:e,blockers:[],blocks:[]});return this.dispatch(sm(i)),i}async update(e){const i=await this.enqueueRequest({description:"Edit organization",method:l.PATCH,url:`/organizations/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return this.dispatch(im(i)),i}async invite(e,i){return this.enqueueRequest({description:"Invite user to organization",method:l.POST,url:`/organizations/${e}/invite/${i}/`,blockers:[],blocks:[]})}async refreshStore(e){const i=await this.enqueueRequest({immediate:!0,description:"Fetch organizations",method:l.GET,url:"/organizations/",blockers:[],blocks:[]},e);return this.dispatch(tm(i)),i}}class xb extends O{add(e){var n;const{store:i}=this.client,a=F({...e,created_by:(n=i.getState().userReducer.currentUser)==null?void 0:n.uuid});this.dispatch(gc(a));const c=this.enqueueRequest({description:"Add project access",method:l.POST,url:"/project-accesses/",payload:v(a),blockers:[a.organization_access,a.project],blocks:[a.uuid]});return c.then(r=>{this.dispatch(gt(r))}).catch(r=>{throw this.dispatch(Fc(a.uuid)),r}),[a,c]}bulkAdd(e){var r;const{store:i}=this.client,a=(r=i.getState().userReducer.currentUser)==null?void 0:r.uuid,c=e.map(u=>F({...u,created_by:a}));this.dispatch(bc(c));const n=this.enqueueRequest({description:"Add project accesses",method:l.POST,url:"/project-accesses/bulk/",payload:{project_accesses:c.map(u=>v(u))},blockers:c.flatMap(u=>[u.project,u.organization_access]),blocks:c.map(u=>u.uuid)});return n.then(u=>{this.dispatch(pm(u))}).catch(u=>{throw this.dispatch(Pc(c.map(m=>m.uuid))),u}),[c,n]}update(e){const{store:i}=this.client,a=Oc(e.uuid)(i.getState()),c={...a,...e};this.dispatch(gt(c));const n=this.enqueueRequest({description:"Edit project access",method:l.PATCH,url:`/project-accesses/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[]});return n.then(r=>{this.dispatch(gt(r))}).catch(r=>{throw this.dispatch(gt(a)),r}),[c,n]}async remove(e){const{store:i}=this.client,a=Oc(e)(i.getState());this.dispatch(Fc(e));try{await this.enqueueRequest({description:"Delete project access",method:l.DELETE,url:`/project-accesses/${e}/`,blockers:[e],blocks:[]})}catch(c){throw this.dispatch(gc(a)),c}}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get project accesses",method:l.GET,url:"/project-accesses/",queryParams:{project__organization:e},blockers:[],blocks:[]},i);return this.dispatch(mm(a)),a}}class eF extends Ne{constructor(){super(...arguments);S(this,"name","Project Attachment");S(this,"url","/project-attachments");S(this,"initializeAttachments",vc);S(this,"addAttachments",Sm);S(this,"updateAttachments",gm);S(this,"removeAttachments",wc);S(this,"removeAttachment",bm);S(this,"setAttachment",Tm);S(this,"selectAttachment",_m)}getId(i){return i.uuid}buildModel(i){return F({file:URL.createObjectURL(i.file),file_sha1:i.file_sha1,created_by:i.created_by,file_name:i.file.name,file_type:i.file.type,submitted_at:i.submitted_at,project:i.modelUuid})}buildPayload(i,a){return{uuid:i.uuid,file_name:i.file_name,file_sha1:i.file_sha1,file_extension:a.extension,project:i.project}}async bulkAdd(i){return this._bulkAdd(i.map(a=>({modelUuid:a.projectUuid,file:a.file})))}async delete(i){return this._delete(i)}async refreshStore(i,a){const c=await this.enqueueRequest({immediate:!0,description:"Get project attachments",method:l.GET,url:`${this.url}/`,queryParams:{project__organization:i},blockers:[],blocks:[]},a);return this.dispatch(vc(c)),c}}class tF extends O{async saveExisting(e){if(!e.uuid)throw new Error("You can only use this method to save existing project files. The one provided has no uuid.");const i={...e};delete i.file;const a=this.enqueueRequest({method:l.PATCH,url:`/project-files/${e.uuid}/`,payload:i,blockers:[e.uuid],blocks:[e.uuid]});return a.then(c=>{this.dispatch(Vc(c))}),a}saveActive(){const{store:e}=this.client,i=e.getState(),a=i.projectFileReducer.activeProjectFileId;if(!a)throw new Error("No active project file");const c=i.projectFileReducer.instances[a];if(!c)throw new Error("No active project file");if(!c.bounds&&!c.canvas_bounds)throw new Error("Project file must either have bounds or canvas_bounds set");let n;if(typeof c.file=="string"&&!c.file.startsWith("blob:")){const m={...c};delete m.file,n={method:l.PATCH,url:`/project-files/${a}/`,payload:m,blockers:[a],blocks:[a]}}else n=new Promise((m,o)=>{this.client.files.uploadFileToS3(c.file_sha1).then(([h])=>{m({method:l.POST,url:"/project-files/",payload:{...c,...h},blockers:[a],blocks:[a]})}).catch(o)});const u=Promise.resolve(n).then(m=>this.enqueueRequest(m));return u.then(m=>{this.dispatch(Vc(m))}),this.dispatch(zm),this.dispatch(qm(null)),this.dispatch(jm(!1)),[c,u]}delete(e){return this.dispatch(Vm(e)),this.enqueueRequest({method:l.DELETE,url:`/project-files/${e}`,blockers:[e],blocks:[]})}async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Get project files",method:l.GET,url:"/project-files/",queryParams:{limit:this.pageSize,paginate:!0,project:e},blockers:[],blocks:[]},n=>({immediate:!0,description:"Get project files",method:l.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(wm(c)),c}}class sF extends O{async add(e){const i=await this.enqueueRequest({description:"Create project",method:l.POST,url:"/projects/",payload:v(e),blockers:[],blocks:[]});return this.dispatch(jc(i)),i}async update(e){if(!e.bounds&&!e.canvas_bounds)throw new Error("Project must either have bounds or canvas_bounds set");return this.dispatch($m(e)),await this.enqueueRequest({description:"Update project",method:l.PATCH,url:`/projects/${e.uuid}/`,payload:{name:e.name,bounds:e.bounds},blockers:[e.uuid],blocks:[e.uuid]})}async delete(e){const{store:i}=this.client,a=i.getState(),c=Nm(e)(a);if(!c)throw new Error("Expected project to exist");const n=Cm(a).filter(m=>m.project===e);this.dispatch(Em(n.map(({uuid:m})=>m)));const r=Om(c.uuid)(a);this.dispatch(wc(r.map(({uuid:m})=>m)));const u=Am(e)(a);this.dispatch(Pc(u.map(({uuid:m})=>m))),this.dispatch(qc(c.uuid));try{await this.enqueueRequest({description:"Delete project",method:l.DELETE,url:`/projects/${e}/`,blockers:[e],blocks:[]}),this.dispatch(qc(c.uuid))}catch(m){throw this.dispatch(jc(c)),this.dispatch(bc(Object.values(u))),this.dispatch(Mm(n)),this.dispatch(Im(r)),m}}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Fetch projects",method:l.GET,url:"/projects/",queryParams:{organization:e},blockers:[],blocks:[]},i);return this.dispatch(Bm(a)),a}}class iF extends O{add(e){var n;const{store:i}=this.client,a=F({...e,created_by:(n=i.getState().userReducer.currentUser)==null?void 0:n.uuid});this.dispatch(Ym(a));const c=this.enqueueRequest({description:"Create team membership",method:l.POST,url:"/team-memberships/",payload:v(a),blockers:[e.team],blocks:[a.uuid]});return c.then(r=>{this.dispatch(Dc(r))}).catch(()=>{this.dispatch(kc(a.uuid))}),[a,c]}bulkAdd(e){var r;const{store:i}=this.client,a=(r=i.getState().userReducer.currentUser)==null?void 0:r.uuid,c=e.map(u=>F({...u,created_by:a}));this.dispatch(Zm(c));const n=this.enqueueRequest({description:"Create team memberships",method:l.POST,url:"/team-memberships/bulk/",payload:{team_memberships:c.map(u=>v(u))},blockers:c.map(u=>u.team),blocks:c.map(u=>u.uuid)});return n.then(u=>{this.dispatch(Jm(u))}).catch(()=>{this.dispatch(Xm(c.map(u=>u.uuid)))}),[c,n]}async delete(e){const{store:i}=this.client,a=i.getState(),c=ep(e)(a);if(!c)throw new Error(`Expected team membership with uuid ${e} to exist`);this.dispatch(kc(e));try{return await this.enqueueRequest({description:"Delete team membership",method:l.DELETE,url:`/team-memberships/${e}/`,blockers:[e],blocks:[e]})}catch(n){throw this.dispatch(Dc(c)),n}}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Fetch team memberships",method:l.GET,url:"/team-memberships/",queryParams:{team__organization:e},blockers:[],blocks:[]},i);return this.dispatch(Km(a)),a}}class aF extends O{add(e){var n;const{store:i}=this.client,a=F({...e,submitted_at:new Date().toISOString(),created_by:(n=i.getState().userReducer.currentUser)==null?void 0:n.uuid});this.dispatch(ip(a));const c=this.enqueueRequest({description:"Create team",method:l.POST,url:"/teams/",payload:v(a),blockers:[],blocks:[a.uuid]});return c.then(r=>{this.dispatch(bt(r))}).catch(()=>{this.dispatch(Gc(a.uuid))}),[a,c]}update(e){const{store:i}=this.client,a=Nc(e.uuid)(i.getState());if(!a)throw new Error(`Expected team with uuid ${e.uuid} to exist`);const c={...a,...e};this.dispatch(ap(c));const n=this.enqueueRequest({description:"Update team",method:l.PATCH,url:`/teams/${e.uuid}/`,payload:v(e),blockers:[e.uuid],blocks:[e.uuid]});return n.then(r=>{this.dispatch(bt(r))}).catch(()=>{this.dispatch(bt(a))}),[c,n]}async delete(e){const{store:i}=this.client,a=i.getState(),c=Nc(e)(a);if(!c)throw new Error(`Expected team with uuid ${e} to exist`);this.dispatch(Gc(e));try{return await this.enqueueRequest({description:"Delete team",method:l.DELETE,url:`/teams/${e}/`,blockers:[e],blocks:[e]})}catch(n){throw this.dispatch(bt(c)),n}}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Fetch teams",method:l.GET,url:"/teams/",queryParams:{organization:e},blockers:[],blocks:[]},i);return this.dispatch(sp(a)),a}}class cF extends O{async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Fetch organization users",method:l.GET,url:`/organizations/${e}/users/`,blockers:[],blocks:[]},i);return this.dispatch(Gh(a)),a}}class nF{constructor(e){S(this,"store");this.store=e}async enqueueRequest(e,i,a,c){return this._enqueueRequest(e,i,a,c).then(n=>{if(n instanceof U)throw n;return n})}_enqueueRequest(e,i,a,c){const n=new nn,r={...e,BASE_URL:i,serviceName:a};if(e.immediate){const u={...r,uuid:e.uuid??Ze.v4()},m={payload:u,meta:{offline:{effect:{timestamp:new Date().toISOString(),request:u,BASE_URL:i,serviceName:a}}}};Wc(m,this,c).then(o=>{n.resolve(o.body)}).catch(o=>{o instanceof Error?n.reject(o):n.reject(new Error((o??Qe).toString()))})}else{const u=this.store.dispatch(dm(r)),m=h=>{if(h)n.resolve(h.body);else{const p=new U({message:"Could not get a response from the server.",response:h,discard:!0});n.reject(p)}},o=h=>{h instanceof U?h.options.discard=!0:(console.error("Received an unexpected error while processing a request:",h,`
|
|
14
|
+
external URLs and therefore not prepended with VITE_API_URL.`;throw new Error(A)}const p=o.type.split("/")[1];if(!p)throw new Error("File has no extension");const y=c??h+"."+p;if(o=dn(o,y),!o.name)throw new Error("Failed to set file's name");await this.addCache(o,h),Zt[n]=new Promise(A=>{A(o)})}return o}}class Ob extends O{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.uuid,c=new Date().toISOString(),n=F({...e,created_by:a,submitted_at:c});this.dispatch(Ki(n));const r=this.enqueueRequest({description:"Create form identifier",method:l.POST,url:"/form-identifiers/",payload:v(n),blockers:[n.form],blocks:[n.uuid]});return r.then(m=>{this.dispatch(mt(m))}).catch(()=>{this.dispatch(Yi(n.uuid))}),[n,r]}update(e){const{store:i}=this.client,a=Zi(e.uuid)(i.getState());if(!a)throw new Error(`Expected form identifier with uuid ${e.uuid} to exist`);const c={...a,...e};this.dispatch(mt(c));const n=this.enqueueRequest({description:"Update form identifier",method:l.PATCH,url:`/form-identifiers/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return n.then(r=>{this.dispatch(mt(r))}).catch(()=>{this.dispatch(mt(a))}),[c,n]}async delete(e){const{store:i}=this.client,a=i.getState(),c=Zi(e)(a);if(!c)throw new Error(`Expected form identifier with uuid ${e} to exist`);this.dispatch(Yi(e));try{return await this.enqueueRequest({description:"Delete form identifier",method:l.DELETE,url:`/form-identifiers/${e}/`,blockers:[e],blocks:[]})}catch(n){throw this.dispatch(Ki(c)),n}}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get form identifiers",method:l.GET,url:"/form-identifiers/",queryParams:{form__organization:e},blockers:[],blocks:[]},i);return this.dispatch(Qu(a)),a}}class Rb extends O{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.uuid,c=new Date().toISOString(),n=F({...e,created_by:a,submitted_at:c});this.dispatch(Xi(n));const r=this.enqueueRequest({description:"Create form identifier value",method:l.POST,url:"/form-identifier-values/",payload:v(n),blockers:[e.form_submission,e.form_identifier],blocks:[n.uuid]});return r.then(m=>{this.dispatch(pt(m))}).catch(()=>{this.dispatch(Qi(n.uuid))}),[n,r]}update(e){const{store:i}=this.client,a=ea(e.uuid)(i.getState());if(!a)throw new Error(`Expected form identifier value with uuid ${e.uuid} to exist`);const c={...a,...e};this.dispatch(pt(c));const n=this.enqueueRequest({description:"Update form identifier value",method:l.PATCH,url:`/form-identifier-values/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return n.then(r=>{this.dispatch(pt(r))}).catch(()=>{this.dispatch(pt(a))}),[c,n]}async delete(e){const{store:i}=this.client,a=i.getState(),c=ea(e)(a);if(!c)throw new Error(`Expected form identifier value with uuid ${e} to exist`);this.dispatch(Qi(e));try{return await this.enqueueRequest({description:"Delete form identifier value",method:l.DELETE,url:`/form-identifier-values/${e}/`,blockers:[e],blocks:[]})}catch(n){throw this.dispatch(Xi(c)),n}}async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Get form identifier values",method:l.GET,url:"/form-identifier-values/",queryParams:{limit:this.pageSize,paginate:!0,form_submission__form_revision__form__organization:e},blockers:[],blocks:[]},n=>({immediate:!0,description:"Get form identifier values",method:l.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(io(c)),c}}class vb extends E{async bulkAdd(e){var m;const i=new Date().toISOString(),a=(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.uuid,c={},n=[],r=[];for(const o of e){const{revisionUuid:h,fieldIdentifier:p,file:y}=o,A=await this.getFilePayload(y);A.sha1 in c||(c[A.sha1]=A);const I=F({file:URL.createObjectURL(y),file_type:y.type,file_name:y.name,file_sha1:A.sha1,created_by:a,form_revision:h,submitted_at:i,field_identifier:p});n.push(I);const g={uuid:I.uuid,file_name:y.name,field_identifier:p,file_extension:A.extension,file_sha1:A.sha1,form_revision:h};r.push(g)}this.dispatch(uo(n));const u=this.enqueueRequest({description:"Attach files to form revision",method:l.POST,url:"/form-revision-attachments/bulk/",payload:{submitted_at:i,attachments:r,files:Object.values(c)},blockers:n.map(o=>o.form_revision),blocks:n.map(o=>o.uuid)});return u.then(o=>{this.processPresignedUrls(o.presigned_urls),this.dispatch(oo(o.attachments))}).catch(()=>{this.dispatch(lo(n.map(o=>o.uuid)))}),[n,u.then(({attachments:o})=>o)]}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Fetch organization form revision attachments",method:l.GET,url:"/form-revision-attachments/",queryParams:{form_revision__form__organization:e},blockers:[e],blocks:[]},i);return this.dispatch(ro(a)),a}}class wb extends E{add(e){var u;const{store:i}=this.client,c=(u=i.getState().userReducer.currentUser)==null?void 0:u.uuid,n=F({...e,created_by:c,submitted_at:new Date().toISOString()});this.dispatch(ia(n));const r=this.enqueueRequest({description:"Create form revision",method:l.POST,url:"/form-revisions/",payload:v(n),blockers:[e.form],blocks:[n.uuid]});return r.then(m=>{this.dispatch(fo(m))}).catch(()=>{this.dispatch(aa(n.uuid))}),[n,r]}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get organization form revisions",method:l.GET,url:"/form-revisions/",queryParams:{form__organization:e},blockers:[e],blocks:[]},i);return this.dispatch(yo(a)),a}}class Mb extends E{add(e,i){var o;const{store:a}=this.client,c=new Date().toISOString(),n=(o=a.getState().userReducer.currentUser)==null?void 0:o.uuid,r=F({...e,submitted_at:c,created_by:n}),u=F({...i,form:r.uuid,submitted_at:c,created_by:n});this.dispatch(da(r)),this.dispatch(ia(u));const m=this.enqueueRequest({description:"Create form",method:l.POST,url:"/forms/",payload:{...v(r),initial_revision:{uuid:u.uuid,submitted_at:u.submitted_at,title:u.title,description:u.description,fields:u.fields}},blockers:[],blocks:[r.uuid,u.uuid]});return m.catch(h=>{throw this.dispatch(ua(r.uuid)),this.dispatch(aa(u.uuid)),h}),[r,u,m]}async delete(e){const{store:i}=this.client,a=i.getState(),c=Oo(e)(a);if(!c)throw new Error("Expected form to exist");const n=ko(e)(a);n.length>0&&this.dispatch(Do(n.map(({uuid:u})=>u)));const r=To(e)(a);r.length>0&&this.dispatch(So(r.map(({uuid:u})=>u))),this.dispatch(ua(e));try{return await this.enqueueRequest({description:"Delete form",method:l.DELETE,url:`/forms/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(da(c)),r.length>0&&this.dispatch(Ao(r)),n.length>0&&this.dispatch(Uo(n)),u}}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Fetch organization forms",method:l.GET,url:"/forms/",queryParams:{organization:e},blockers:[e],blocks:[]},i);return this.dispatch(bo(a)),a}}class Vb extends E{async bulkAdd(e){var m;const i=new Date().toISOString(),a=(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.uuid,c={},n=[],r=[];for(const o of e){const{submissionUuid:h,fieldIdentifier:p,file:y}=o,A=await this.getFilePayload(y);A.sha1 in c||(c[A.sha1]=A);const I=F({file:URL.createObjectURL(y),file_type:y.type,file_name:y.name,file_sha1:A.sha1,created_by:a,form_submission:h,submitted_at:i,field_identifier:p});n.push(I);const g={uuid:I.uuid,file_name:y.name,file_sha1:A.sha1,file_extension:A.extension,field_identifier:p,form_submission:h};r.push(g)}this.dispatch(kt(n));const u=this.enqueueRequest({description:"Attach files to form submission",method:l.POST,url:"/form-submission-attachments/bulk/",payload:{submitted_at:i,attachments:r,files:Object.values(c)},blockers:n.map(o=>o.form_submission),blocks:n.map(o=>o.uuid)});return u.then(o=>{this.processPresignedUrls(o.presigned_urls),this.dispatch(wo(o.attachments))}).catch(o=>{throw this.dispatch(Bt(n.map(h=>h.uuid))),o}),[n,u.then(({attachments:o})=>o)]}async bulkDelete(e){const{store:i}=this.client,a=i.getState(),c=Vo(e)(a);this.dispatch(Bt(e));try{await this.enqueueRequest({description:"Delete form submission attachments",method:l.DELETE,url:"/form-submission-attachments/bulk/",payload:{uuids:e},blockers:e,blocks:[]})}catch(n){throw this.dispatch(kt(c)),n}}async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Get form submission attachments",method:l.GET,url:"/form-submission-attachments/",queryParams:{limit:$e,paginate:!0,form_submission__form_revision__form__organization:e},blockers:[],blocks:[]},n=>({immediate:!0,description:"Get form submission attachments",method:l.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(vo(c)),c}}class Eb extends E{add(e){var r;const{store:i}=this.client,a=i.getState(),c=F({...e,created_by:(r=a.userReducer.currentUser)==null?void 0:r.uuid,submitted_at:new Date().toISOString()}),n=this.enqueueRequest({description:"Add form submission",method:l.POST,url:"/form-submissions/",payload:v(c),blockers:[e.form_revision],blocks:[c.uuid]});return this.dispatch(ma(c)),n.then(u=>(this.dispatch($t(u)),u)).catch(()=>{this.dispatch(pa(c.uuid))}),[c,n]}update(e){const{store:i}=this.client,a=i.getState(),c=Aa(e.uuid)(a);if(!c)throw new Error(`Expected submission with uuid ${e.uuid} to exist`);const n={...c,...e};this.dispatch(Co(n));const r=this.enqueueRequest({description:"Delete user form submissions",method:l.PATCH,url:`/form-submissions/${n.uuid}/`,payload:e,blockers:[n.uuid],blocks:[n.uuid]});return r.then(u=>{this.dispatch($t(u))}).catch(()=>{this.dispatch($t(c))}),[n,r]}async delete(e){const{store:i}=this.client,a=i.getState(),c=Aa(e)(a);if(!c)throw new Error(`Expected submission with uuid ${e} to exist`);const n=Eo(e)(a);this.dispatch(pa(e)),this.dispatch(Bt(n.map(r=>r.uuid)));try{return await this.enqueueRequest({description:"Delete user form submissions",method:l.DELETE,url:`/form-submissions/${e}/`,blockers:[e],blocks:[]})}catch(r){throw this.dispatch(ma(c)),this.dispatch(kt(n)),r}}async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Fetch form submissions",method:l.GET,url:"/form-submissions/",queryParams:{limit:this.pageSize,paginate:!0,form_revision__form_organization:e},blockers:[],blocks:[]},n=>({immediate:!0,description:"Fetch form submissions",method:l.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(zo(c)),c}}class jb extends E{async add(e){var p;const{store:i}=this.client,{file:a,...c}=e,n=new Date().toISOString(),r=(p=i.getState().userReducer.currentUser)==null?void 0:p.uuid,u=c.project,m=await this.getFilePayload(a),o=F({...c,file_name:a.name,file_sha1:m.sha1,file_type:a.type,file:URL.createObjectURL(a),submitted_at:n,created_by:r});this.dispatch(No(o));const h=this.enqueueRequest({description:"Add geo image",method:l.POST,url:"/geo-images/",payload:{uuid:o.uuid,submitted_at:n,title:o.title,description:o.description,geo_marker:o.geo_marker,canvas_marker:o.canvas_marker,sha1:o.file_sha1,project:o.project,file_name:o.file_name,direction:o.direction,original_date:o.original_date,file:m},blocks:[u],blockers:[u]});return h.then(y=>{this.processPresignedUrls(y.presigned_urls),this.dispatch(yt(y.geo_image))}).catch(()=>{this.dispatch(Sa(o.uuid))}),[o,h.then(y=>y.geo_image)]}async bulkAdd(e,i){var p;const{store:a}=this.client,c=new Date().toISOString(),n=(p=a.getState().userReducer.currentUser)==null?void 0:p.uuid,r=[],u=[],m=[],o={};for(const y of e){const{file:A,...I}=y,g=await this.getFilePayload(A);g.sha1 in o||(o[g.sha1]=g);const R=F({...I,file_name:A.name,file_sha1:g.sha1,file_type:A.type,file:URL.createObjectURL(A),submitted_at:c,created_by:n,project:i});r.push(R),u.push(R.uuid),m.push({uuid:R.uuid,sha1:R.file_sha1,file_name:R.file_name,title:R.title,description:R.description,geo_marker:R.geo_marker,canvas_marker:R.canvas_marker,direction:R.direction,original_date:R.original_date})}this.dispatch(Ho(r));const h=this.enqueueRequest({description:"Bulk add geo images",method:l.POST,url:"/geo-images/bulk/",payload:{submitted_at:c,project:i,geo_images:m,files:Object.values(o)},blocks:[i],blockers:u});return h.then(y=>{this.processPresignedUrls(y.presigned_urls),this.dispatch(Lo(y.geo_images))}).catch(()=>{this.dispatch(Ko(u))}),[r,h.then(y=>y.geo_images)]}update(e){const{store:i}=this.client,a=i.getState(),c=Ta(e.uuid)(a);if(!c)throw new Error(`Map image with uuid ${e.uuid} does not exist in the store`);const n={...c,...e};this.dispatch(Wo(n));const r=this.enqueueRequest({description:"Update geo image",method:l.PATCH,url:`/geo-images/${e.uuid}/`,payload:e,blocks:[e.uuid],blockers:[e.uuid]});return r.then(u=>{this.dispatch(yt(u))}).catch(()=>{this.dispatch(yt(c))}),[n,r]}async delete(e){const{store:i}=this.client,a=i.getState(),c=Ta(e)(a);if(!c)throw new Error(`Map image with uuid ${e} does not exist in the store`);this.dispatch(Sa(e));const n=this.enqueueRequest({description:"Delete geo image",method:l.DELETE,url:`/geo-images/${e}/`,blocks:[e],blockers:[e]});return n.catch(()=>{this.dispatch(yt(c))}),n}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get geo images",method:l.GET,url:"/geo-images/",queryParams:{project:e},blocks:[e],blockers:[]},i);return this.dispatch(Go(a)),a}}class qb extends O{add(e){var u;const{store:i}=this.client,a=new Date().toISOString(),c=(u=i.getState().userReducer.currentUser)==null?void 0:u.uuid,n=F({...e,submitted_at:a,created_by:c});this.dispatch(ga(n));const r=this.enqueueRequest({description:"Add issue association",method:l.POST,url:"/issue-associations/",payload:v(n),blockers:[e.associated_issue,...e.issue?[e.issue]:[],...e.asset?[e.asset]:[]],blocks:[n.uuid]});return r.then(m=>{this.dispatch(xo(m))}).catch(()=>{this.dispatch(Fa(n.uuid))}),[n,r]}async delete(e){const{store:i}=this.client,a=el(e)(i.getState());if(!a)throw new Error(`Issue association with uuid ${e} not found in store.`);this.dispatch(Fa(e));const c=this.enqueueRequest({description:"Delete issue association",method:l.DELETE,url:`/issue-associations/${e}/`,blockers:[e],blocks:[]});return c.catch(()=>{this.dispatch(ga(a))}),c}async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Fetch issue associations",method:l.GET,url:"/issue-associations/",queryParams:{limit:this.pageSize,paginate:!0,associated_issue__project:e},blockers:[],blocks:[]},n=>({immediate:!0,description:"Fetch issue associations",method:l.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(Qo(c)),c}}class zb extends Ne{constructor(){super(...arguments);S(this,"name","Issue Attachment");S(this,"url","/issue-attachments");S(this,"initializeAttachments",Oa);S(this,"addAttachments",Ra);S(this,"updateAttachments",rl);S(this,"removeAttachments",va);S(this,"removeAttachment",dl);S(this,"setAttachment",nl);S(this,"selectAttachment",hl)}getId(i){return i.uuid}buildModel(i){return F({file:URL.createObjectURL(i.file),file_sha1:i.file_sha1,created_by:i.created_by,file_name:i.file.name,file_type:i.file.type,submitted_at:i.submitted_at,issue:i.modelUuid})}buildPayload(i,a){return{uuid:i.uuid,file_name:i.file_name,file_sha1:i.file_sha1,file_extension:a.extension,issue:i.issue}}async bulkAdd(i){return this._bulkAdd(i.map(a=>({modelUuid:a.issueUuid,file:a.file})))}async delete(i){return this._delete(i)}async refreshStore(i,a){const n=(await this.performPagination({immediate:!0,description:"Get issue attachments",method:l.GET,url:`${this.url}/`,queryParams:{limit:$e,paginate:!0,issue__project:i},blocks:[],blockers:[]},r=>({immediate:!0,description:"Get issue attachments",method:l.GET,url:r,blockers:[],blocks:[]}),a)).flat();return this.dispatch(Oa(n)),n}}class Ub extends Ne{constructor(){super(...arguments);S(this,"name","Issue Comment Attachment");S(this,"url","/issue-comment-attachments");S(this,"initializeAttachments",Ma);S(this,"addAttachments",yl);S(this,"updateAttachments",fl);S(this,"removeAttachments",Tl);S(this,"removeAttachment",Sl);S(this,"setAttachment",Al);S(this,"selectAttachment",bl)}getId(i){return i.uuid}buildModel(i){return F({file:URL.createObjectURL(i.file),file_sha1:i.file_sha1,created_by:i.created_by,file_name:i.file.name,file_type:i.file.type,submitted_at:i.submitted_at,issue_comment:i.modelUuid})}buildPayload(i,a){return{uuid:i.uuid,file_name:i.file_name,file_sha1:i.file_sha1,file_extension:a.extension,issue_comment:i.issue_comment}}async bulkAdd(i){return this._bulkAdd(i.map(a=>({modelUuid:a.issueCommentUuid,file:a.file})))}async delete(i){return this._delete(i)}async refreshStore(i,a){const n=(await this.performPagination({immediate:!0,description:"Get issue comment attachments",method:l.GET,url:`${this.url}/`,queryParams:{limit:$e,paginate:!0,issue_comment__issue__project:i},blocks:[],blockers:[]},r=>({immediate:!0,description:"Get issue comment attachments",method:l.GET,url:r,blockers:[],blocks:[]}),a)).flat();return this.dispatch(Ma(n)),n}}class Cb extends O{add(e){var n;const{store:i}=this.client,a=F({...e,author:(n=i.getState().userReducer.currentUser)==null?void 0:n.uuid,submitted_at:new Date().toISOString()});this.dispatch(Ea(a));const c=this.enqueueRequest({description:"Add issue comment",method:l.POST,url:"/issue-comments/",payload:v(a),blockers:[e.issue],blocks:[a.uuid]});return c.catch(()=>{this.dispatch(qa(a.uuid))}),[a,c]}update(e){const{store:i}=this.client,a=za(e.uuid)(i.getState());if(!a)throw new Error(`Comment with uuid ${e.uuid} not found in store`);const c={...a,...e};this.dispatch(ja(c));const n=this.enqueueRequest({description:"Edit issue comment",method:l.PATCH,url:`/issue-comments/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return n.catch(()=>{this.dispatch(ja(a))}),[c,n]}remove(e){const{store:i}=this.client,a=za(e)(i.getState());if(!a)throw new Error(`Comment with uuid ${e} not found in store`);this.dispatch(qa(e));const c=this.enqueueRequest({description:"Delete comment",method:l.DELETE,url:`/issue-comments/${e}/`,blockers:[e],blocks:[]});return c.catch(()=>{this.dispatch(Ea(a))}),c}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get comments",method:l.GET,url:"/issue-comments/",queryParams:{issue__project:e},blockers:[],blocks:[]},i);return this.dispatch(_l(a)),a}}class Db extends O{add(e){var m;const{store:i}=this.client,a=i.getState(),c=new Date().toISOString(),n=(m=a.userReducer.currentUser)==null?void 0:m.uuid,r=F({...e,submitted_at:c,created_by:n});this.dispatch(Ca(r));const u=this.enqueueRequest({description:"Create issue",method:l.POST,url:"/issues/",payload:v(r),blockers:[r.project,r.issue_type,...r.category?[r.category]:[]],blocks:[r.uuid]});return u.then(o=>{this.dispatch(Gt(o))}).catch(o=>{throw this.dispatch(Da(r.uuid)),o}),[r,u]}update(e){var m;const i=this.client.store.getState(),a=$a(e.uuid)(i);if(!a)throw new Error(`Attempting to update an issue with uuid ${e.uuid} that doesn't exist in the store`);const c={...a,...e};this.dispatch(Gt(c));const n={};for(const o of[V.TITLE,V.DESCRIPTION,V.STATUS,V.CATEGORY,V.PRIORITY,V.ASSIGNED_TO,V.DUE_DATE])if(o in e&&e[o]!==a[o])switch(o){case V.PRIORITY:case V.STATUS:{const h=e[o];n[o]=h!==void 0?Number(h):null;break}case V.DUE_DATE:case V.DESCRIPTION:case V.TITLE:n[o]=e[o]??null;break;case V.CATEGORY:{let h=null;const p=e[o];if(p&&(h=i.categoryReducer.instances[p]??null,!h))throw new Error(`Trying to update issue category to ${p} which does not exist in store`);n[o]=h?{name:h.name,color:h.color,uuid:h.uuid}:null;break}case V.ASSIGNED_TO:{let h=null;const p=e[o];if(p&&(h=i.userReducer.instances[p]??null,!h))throw new Error(`Trying to update issue assigned_to to ${p} which does not exist in store`);n[o]=h?{email:h.email,uuid:h.uuid}:null;break}}const r=F({created_by:(m=i.userReducer.currentUser)==null?void 0:m.uuid,submitted_at:new Date().toISOString(),issue:a.uuid,changes:n});this.dispatch(jh(r));const u=this.enqueueRequest({description:"Edit issue",method:l.PATCH,url:`/issues/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.catch(()=>{this.dispatch(Gt(a)),this.dispatch(zh(r.uuid))}),[c,u]}async remove(e){const{store:i}=this.client,a=i.getState(),c=$a(e)(a);if(!c)throw new Error(`No issue with uuid ${e} found in the store`);const n=ll(e)(a),r=kh(e)(a),u={};for(const o of tl(e)(a))u[o.uuid]=o;for(const o of sl(e)(a))u[o.uuid]=o;const m=Object.values(u);this.dispatch(Da(e)),n.length>0&&this.dispatch(va(n.map(({uuid:o})=>o))),r.length>0&&this.dispatch(Uh(r.map(({uuid:o})=>o))),m.length>0&&this.dispatch(Pa(m.map(({uuid:o})=>o)));try{return await this.enqueueRequest({description:"Delete issue",method:l.DELETE,url:`/issues/${e}/`,blockers:[e],blocks:[]})}catch(o){throw this.dispatch(Ca(c)),this.dispatch(Ra(n)),this.dispatch(qh(r)),this.dispatch(ba(m)),o}}async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Get issues",method:l.GET,url:"/issues/",queryParams:{limit:this.pageSize,paginate:!0,project:e},blockers:[],blocks:[]},n=>({immediate:!0,description:"Get issues",method:l.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(wl(c)),c}}class kb extends Ne{constructor(){super(...arguments);S(this,"name","Issue Type Attachment");S(this,"url","/issue-type-attachments");S(this,"initializeAttachments",La);S(this,"addAttachments",zl);S(this,"updateAttachments",Cl);S(this,"removeAttachments",kl);S(this,"removeAttachment",Dl);S(this,"setAttachment",Ul);S(this,"selectAttachment",Gl)}getId(i){return i.uuid}buildModel(i){return F({file:URL.createObjectURL(i.file),file_sha1:i.file_sha1,created_by:i.created_by,file_name:i.file.name,file_type:i.file.type,submitted_at:i.submitted_at,issue_type:i.modelUuid})}buildPayload(i,a){return{uuid:i.uuid,file_name:i.file_name,file_sha1:i.file_sha1,file_extension:a.extension,issue_type:i.issue_type}}async bulkAdd(i){return this._bulkAdd(i.map(a=>({modelUuid:a.issueTypeUuid,file:a.file})))}async delete(i){return this._delete(i)}async refreshStore(i,a){const c=await this.enqueueRequest({immediate:!0,description:"Get issue type attachments",method:l.GET,url:`${this.url}/`,queryParams:{issue_type__organization:i},blocks:[],blockers:[]},a);return this.dispatch(La(c)),c}}class Bb extends E{async bulkAdd(e){var m;const i=new Date().toISOString(),a=(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.uuid,c={},n=[],r=[];for(const o of e){const{fieldsRevisionUuid:h,fieldIdentifier:p,file:y}=o,A=await this.getFilePayload(y);A.sha1 in c||(c[A.sha1]=A);const I=F({file:URL.createObjectURL(y),file_type:y.type,file_name:y.name,file_sha1:A.sha1,created_by:a,fields_revision:h,submitted_at:i,field_identifier:p});n.push(I);const g={uuid:I.uuid,file_name:y.name,file_extension:A.extension,field_identifier:p,file_sha1:A.sha1,fields_revision:h};r.push(g)}this.dispatch(Wl(n));const u=this.enqueueRequest({description:"Add issue type fields attachments",method:l.POST,url:"/issue-type-fields-attachments/bulk/",payload:{submitted_at:i,attachments:r,files:Object.values(c)},blockers:n.map(o=>o.fields_revision),blocks:n.map(o=>o.uuid)});return u.then(o=>{this.processPresignedUrls(o.presigned_urls),this.dispatch(Kl(o.attachments))}).catch(()=>{this.dispatch(Yl(n.map(o=>o.uuid)))}),[n,u.then(({attachments:o})=>o)]}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"get issue type fields attachments",method:l.GET,url:"/issue-type-fields-attachments/",queryParams:{fields_revision__issue_type__organization:e},blockers:[e],blocks:[]},i);return this.dispatch(Hl(a)),a}}class $b extends O{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.uuid,c=new Date().toISOString(),n=F({...e,created_by:a,submitted_at:c});this.dispatch(ah(n));const r=this.enqueueRequest({description:"Add Issue Type Fields",method:l.POST,url:"/issue-type-fields/",payload:v(n),blockers:[n.issue_type],blocks:[n.uuid]});return r.then(m=>{this.dispatch(ch(m))}).catch(m=>{throw this.dispatch(nh(n.uuid)),m}),[n,r]}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get Issue Type Fields",method:l.GET,url:"/issue-type-fields/",queryParams:{issue_type__organization:e},blockers:[],blocks:[]},i);return this.dispatch(ih(a)),a}}class Gb extends E{async bulkAdd(e){var m;const i=new Date().toISOString(),a=(m=this.client.store.getState().userReducer.currentUser)==null?void 0:m.uuid,c={},n=[],r=[];for(const o of e){const{fieldValuesUuid:h,fieldIdentifier:p,file:y}=o,A=await this.getFilePayload(y);A.sha1 in c||(c[A.sha1]=A);const I=F({file:URL.createObjectURL(y),file_type:y.type,file_name:y.name,file_sha1:A.sha1,created_by:a,field_values:h,submitted_at:i,field_identifier:p});n.push(I);const g={uuid:I.uuid,file_name:y.name,file_sha1:A.sha1,file_extension:A.extension,field_identifier:p,field_values:h};r.push(g)}this.dispatch(Nt(n));const u=this.enqueueRequest({description:"Add issue type field values attachments",method:l.POST,url:"/issue-type-field-values-attachments/bulk/",payload:{submitted_at:i,attachments:r,files:Object.values(c)},blockers:n.map(o=>o.field_values),blocks:n.map(o=>o.uuid)});return u.then(({presigned_urls:o,attachments:h})=>{this.processPresignedUrls(o),this.dispatch(lh(h))}).catch(o=>{throw this.dispatch(Ht(n.map(h=>h.uuid))),o}),[n,u.then(({attachments:o})=>o)]}async bulkDelete(e){const{store:i}=this.client,a=i.getState(),c=mh(e)(a);this.dispatch(Ht(e));try{await this.enqueueRequest({description:"Delete issue type field values attachments",method:l.DELETE,url:"/issue-type-field-values-attachments/bulk/",payload:{uuids:e},blockers:e,blocks:[]})}catch(n){throw this.dispatch(Nt(c)),n}}async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Get issue type field values attachments",method:l.GET,url:"/issue-type-field-values-attachments/",queryParams:{limit:$e,paginate:!0,field_values__issue__project:e,latest:!0},blockers:[],blocks:[]},n=>({immediate:!0,description:"Get issue type field values attachments",method:l.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(oh(c)),c}}class Lb extends O{add(e){var r;const{store:i}=this.client,a=i.getState(),c=F({...e,created_by:(r=a.userReducer.currentUser)==null?void 0:r.uuid,submitted_at:new Date().toISOString()}),n=this.enqueueRequest({description:"Add issue type field values",method:l.POST,url:"/issue-type-field-values/",payload:v(c),blockers:[e.issue,e.fields_revision],blocks:[c.uuid]});return this.dispatch(Wa(c)),n.then(u=>(this.dispatch(ft(u)),u)).catch(()=>{this.dispatch(Ka(c.uuid))}),[c,n]}update(e){const{store:i}=this.client,a=i.getState(),c=Za(e.uuid)(a);if(!c)throw new Error(`Expected IssueTypeFieldValues with uuid ${e.uuid} to exist`);const n={...c,...e};this.dispatch(ft(n));const r=this.enqueueRequest({description:"Update issue type field values",method:l.PATCH,url:`/issue-type-field-values/${e.uuid}/`,payload:e,blockers:[n.uuid,n.fields_revision,n.issue],blocks:[n.uuid]});return r.then(u=>{this.dispatch(ft(u))}).catch(()=>{this.dispatch(ft(c))}),[n,r]}async delete(e){const{store:i}=this.client,a=i.getState(),c=Za(e)(a);if(!c)throw new Error(`Expected submission with uuid ${e} to exist`);const n=ph(e)(a);this.dispatch(Ka(e)),this.dispatch(Ht(n.map(r=>r.uuid)));try{await this.enqueueRequest({description:"Delete issue type field values",method:l.DELETE,url:`/issue-type-field-values/${e}/`,blockers:[e],blocks:[]})}catch(r){throw this.dispatch(Wa(c)),this.dispatch(Nt(n)),r}}async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Get issue type field values",method:l.GET,url:"/issue-type-field-values/",queryParams:{limit:this.pageSize,paginate:!0,issue__project:e,latest:!0},blockers:[],blocks:[]},n=>({immediate:!0,description:"Get issue type field values",method:l.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(xl(c)),c}}class Nb extends O{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.uuid,c=new Date().toISOString(),n=F({...e,created_by:a,submitted_at:c});this.dispatch(ec(n));const r=this.enqueueRequest({description:"Create issue type identifier",method:l.POST,url:"/issue-type-identifiers/",payload:v(n),blockers:[n.issue_type],blocks:[n.uuid]});return r.then(m=>{this.dispatch(St(m))}).catch(()=>{this.dispatch(tc(n.uuid))}),[n,r]}update(e){const{store:i}=this.client,a=sc(e.uuid)(i.getState());if(!a)throw new Error(`Expected issue type identifier with uuid ${e.uuid} to exist`);const c={...a,...e};this.dispatch(St(c));const n=this.enqueueRequest({description:"Update issue type identifier",method:l.PATCH,url:`/issue-type-identifiers/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return n.then(r=>{this.dispatch(St(r))}).catch(()=>{this.dispatch(St(a))}),[c,n]}async delete(e){const{store:i}=this.client,a=i.getState(),c=sc(e)(a);if(!c)throw new Error(`Expected issue type identifier with uuid ${e} to exist`);this.dispatch(tc(e));try{return await this.enqueueRequest({description:"Delete issue type identifier",method:l.DELETE,url:`/issue-type-identifiers/${e}/`,blockers:[e],blocks:[]})}catch(n){throw this.dispatch(ec(c)),n}}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get issue type identifiers",method:l.GET,url:"/issue-type-identifiers/",queryParams:{issue_type__organization:e},blockers:[],blocks:[]},i);return this.dispatch(fh(a)),a}}class Hb extends O{add(e){var u;const{store:i}=this.client,a=(u=i.getState().userReducer.currentUser)==null?void 0:u.uuid,c=new Date().toISOString(),n=F({...e,created_by:a,submitted_at:c});this.dispatch(ac(n));const r=this.enqueueRequest({description:"Create issue type identifier value",method:l.POST,url:"/issue-type-identifier-values/",payload:v(n),blockers:[e.issue,e.issue_type_identifier],blocks:[n.uuid]});return r.then(m=>{this.dispatch(Tt(m))}).catch(()=>{this.dispatch(cc(n.uuid))}),[n,r]}update(e){const{store:i}=this.client,a=rc(e.uuid)(i.getState());if(!a)throw new Error(`Expected issue type identifier value with uuid ${e.uuid} to exist`);const c={...a,...e};this.dispatch(Tt(c));const n=this.enqueueRequest({description:"Update issue type identifier value",method:l.PATCH,url:`/issue-type-identifier-values/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return n.then(r=>{this.dispatch(Tt(r))}).catch(()=>{this.dispatch(Tt(a))}),[c,n]}async delete(e){const{store:i}=this.client,a=i.getState(),c=rc(e)(a);if(!c)throw new Error(`Expected issue type identifier value with uuid ${e} to exist`);this.dispatch(cc(e));try{return await this.enqueueRequest({description:"Delete issue type identifier value",method:l.DELETE,url:`/issue-type-identifier-values/${e}/`,blockers:[e],blocks:[]})}catch(n){throw this.dispatch(ac(c)),n}}async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Get issue type identifier values",method:l.GET,url:"/issue-type-identifier-values/",queryParams:{limit:this.pageSize,paginate:!0,issue__project:e},blockers:[],blocks:[]},n=>({immediate:!0,description:"Get issue type identifier values",method:l.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(bh(c)),c}}class Wb extends O{add(e){var r;const{store:i}=this.client,a=i.getState(),c=F({...e,submitted_at:new Date().toISOString(),created_by:(r=a.userReducer.currentUser)==null?void 0:r.uuid});this.dispatch(Rh(c));const n=this.enqueueRequest({method:l.POST,url:"/issue-types/",payload:v(c),blockers:[],blocks:[c.uuid]});return n.then(u=>{this.dispatch(It(u))}).catch(()=>{this.dispatch(uc(c.uuid))}),[c,n]}update(e){const{store:i}=this.client,a=i.getState(),c=lc(e.uuid)(a);if(!c)throw new Error(`IssueType with uuid ${e.uuid} does not exist in the store.`);const n={...c,...e};this.dispatch(vh(n));const r=this.enqueueRequest({method:l.PATCH,url:`/issue-types/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return r.then(u=>{this.dispatch(It(u))}).catch(()=>{this.dispatch(It(c))}),[n,r]}delete(e){const{store:i}=this.client,a=i.getState(),c=lc(e)(a);if(!c)throw new Error(`IssueType with uuid ${e} does not exist in the store.`);const n=El(e)(a);this.dispatch(uc(e)),this.dispatch(Vl(n.map(u=>u.uuid)));const r=this.enqueueRequest({method:l.DELETE,url:`/issue-types/${e}/`,blockers:[e],blocks:[]});return r.catch(()=>{this.dispatch(It(c)),this.dispatch(Ml(n))}),r}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,method:l.GET,url:"/issue-types/",queryParams:{organization:e},blockers:[],blocks:[]},i);return this.dispatch(Oh(a)),a}}class Kb extends O{async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Get issue updates",method:l.GET,url:"/issue-updates/",queryParams:{limit:this.pageSize,paginate:!0,issue__project:e},blockers:[],blocks:[]},n=>({immediate:!0,description:"Get issue updates",method:l.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(Eh(c)),c}}const Yb=1800;function Zb(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 Jb extends Yg{constructor(){super(...arguments);S(this,"_getRenewedTokens",async i=>{const a=this.enqueueRequest({description:"Get renewed tokens",method:l.POST,url:this.refreshTokensUrl,payload:{refresh:i},isAuthNeeded:!1,blockers:[],blocks:[],checkAuth:!1,immediate:!0});let c;try{c=await a}catch(n){console.error("Could not renew tokens; clearing auth",n),this.clearAuth();return}if(!c.access)throw new Error("Missing access token");return{accessToken:c.access,refreshToken:c.refresh??this.getRefreshToken()}})}clearAuth(){console.debug(this.constructor.name,"clearing auth;"),this.dispatch(Fu(!1)),this.clearTokens(),this.dispatch(b()),this.dispatch(b())}async renewTokens(){const i=this.getRefreshToken();if(!i)throw new Error("No refresh token found");console.debug(this.constructor.name,"renewing tokens");try{const a=await this._getRenewedTokens(i);if(!a)return;console.log("Got renewed tokens"),this.setTokens(a)}catch(a){throw console.error("Could not renew tokens; clearing auth",a),this.clearAuth(),a}}tokenIsExpiringSoon(){const i=this.getAccessToken();if(!i)return!1;const a=Date.now()/1e3;let c;try{c=Bp(i).exp??a}catch{c=a}return c-a<Yb}getAuthHeader(){return`Bearer ${this.getAccessToken()}`}async prepareAuth(){if(this.tokenIsExpiringSoon()){console.debug(this.constructor.name,"preparing auth");try{await this.renewTokens()}catch(i){return i instanceof U&&this.clearAuth(),i instanceof Error?Promise.reject(i):Promise.reject(new Error((i??Qe).toString()))}}}async handleUnauthorized(i,a){const c=this.client.store.getState();if(i.url.endsWith("/token/refresh/"))throw c.authReducer.isLoggedIn&&console.warn("No signed-in user to sign out."),this.clearAuth(),new U({message:"You have been signed out due to inactivity.",response:a,discard:!0});if(c.authReducer.isLoggedIn)await this.renewTokens();else throw console.debug("Forbidden; user is not logged in."),new U({message:"Incorrect username or password.",response:a,discard:!0})}async initAuth(i){const a=Ze.v4();return console.debug(this.constructor.name,"Initiating auth"),this.enqueueRequest({uuid:a,description:"Get token pair",method:l.POST,url:this.initTokensUrl,payload:i,isAuthNeeded:!1,checkAuth:!1,immediate:!0,blockers:[],blocks:[]}).then(c=>{this.setTokens(Zb(c))})}}class Xb extends O{update(e){const{store:i}=this.client,a=fc(e.uuid)(i.getState()),c={...a,...e};this.dispatch(Kt(c));const n=this.enqueueRequest({description:"Edit organization access",method:l.PATCH,url:`/organization-accesses/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return n.then(r=>{this.dispatch(Kt(r))}).catch(r=>{throw this.dispatch(Kt(a)),r}),[c,n]}async remove(e){const{store:i}=this.client,a=i.getState(),c=fc(e)(a),n=Kh(c.user)(a);this.dispatch(Xh(c.uuid)),this.dispatch(Nh(c.user));try{await this.enqueueRequest({description:"Remove organization access",method:l.DELETE,url:`/organization-accesses/${c.uuid}/`,blockers:[c.uuid],blocks:[]})}catch(r){throw this.dispatch(Jh(c)),this.dispatch(Lh(n)),r}}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get organization accesses",method:l.GET,url:"/organization-accesses/",queryParams:{organization:e},blockers:[],blocks:[]},i);return this.dispatch(Zh(a)),a}}class Qb extends O{async add(e){const i=await this.enqueueRequest({description:"Create organization",method:l.POST,url:"/organizations/",payload:e,blockers:[],blocks:[]});return this.dispatch(sm(i)),i}async update(e){const i=await this.enqueueRequest({description:"Edit organization",method:l.PATCH,url:`/organizations/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return this.dispatch(im(i)),i}async invite(e,i){return this.enqueueRequest({description:"Invite user to organization",method:l.POST,url:`/organizations/${e}/invite/${i}/`,blockers:[],blocks:[]})}async refreshStore(e){const i=await this.enqueueRequest({immediate:!0,description:"Fetch organizations",method:l.GET,url:"/organizations/",blockers:[],blocks:[]},e);return this.dispatch(tm(i)),i}}class xb extends O{add(e){var n;const{store:i}=this.client,a=F({...e,created_by:(n=i.getState().userReducer.currentUser)==null?void 0:n.uuid});this.dispatch(gc(a));const c=this.enqueueRequest({description:"Add project access",method:l.POST,url:"/project-accesses/",payload:v(a),blockers:[a.organization_access,a.project],blocks:[a.uuid]});return c.then(r=>{this.dispatch(gt(r))}).catch(r=>{throw this.dispatch(Fc(a.uuid)),r}),[a,c]}bulkAdd(e){var r;const{store:i}=this.client,a=(r=i.getState().userReducer.currentUser)==null?void 0:r.uuid,c=e.map(u=>F({...u,created_by:a}));this.dispatch(bc(c));const n=this.enqueueRequest({description:"Add project accesses",method:l.POST,url:"/project-accesses/bulk/",payload:{project_accesses:c.map(u=>v(u))},blockers:c.flatMap(u=>[u.project,u.organization_access]),blocks:c.map(u=>u.uuid)});return n.then(u=>{this.dispatch(pm(u))}).catch(u=>{throw this.dispatch(Pc(c.map(m=>m.uuid))),u}),[c,n]}update(e){const{store:i}=this.client,a=Oc(e.uuid)(i.getState()),c={...a,...e};this.dispatch(gt(c));const n=this.enqueueRequest({description:"Edit project access",method:l.PATCH,url:`/project-accesses/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[]});return n.then(r=>{this.dispatch(gt(r))}).catch(r=>{throw this.dispatch(gt(a)),r}),[c,n]}async remove(e){const{store:i}=this.client,a=Oc(e)(i.getState());this.dispatch(Fc(e));try{await this.enqueueRequest({description:"Delete project access",method:l.DELETE,url:`/project-accesses/${e}/`,blockers:[e],blocks:[]})}catch(c){throw this.dispatch(gc(a)),c}}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Get project accesses",method:l.GET,url:"/project-accesses/",queryParams:{project__organization:e},blockers:[],blocks:[]},i);return this.dispatch(mm(a)),a}}class eF extends Ne{constructor(){super(...arguments);S(this,"name","Project Attachment");S(this,"url","/project-attachments");S(this,"initializeAttachments",vc);S(this,"addAttachments",Sm);S(this,"updateAttachments",gm);S(this,"removeAttachments",wc);S(this,"removeAttachment",bm);S(this,"setAttachment",Tm);S(this,"selectAttachment",_m)}getId(i){return i.uuid}buildModel(i){return F({file:URL.createObjectURL(i.file),file_sha1:i.file_sha1,created_by:i.created_by,file_name:i.file.name,file_type:i.file.type,submitted_at:i.submitted_at,project:i.modelUuid})}buildPayload(i,a){return{uuid:i.uuid,file_name:i.file_name,file_sha1:i.file_sha1,file_extension:a.extension,project:i.project}}async bulkAdd(i){return this._bulkAdd(i.map(a=>({modelUuid:a.projectUuid,file:a.file})))}async delete(i){return this._delete(i)}async refreshStore(i,a){const c=await this.enqueueRequest({immediate:!0,description:"Get project attachments",method:l.GET,url:`${this.url}/`,queryParams:{project__organization:i},blockers:[],blocks:[]},a);return this.dispatch(vc(c)),c}}class tF extends O{async saveExisting(e){if(!e.uuid)throw new Error("You can only use this method to save existing project files. The one provided has no uuid.");const i={...e};delete i.file;const a=this.enqueueRequest({method:l.PATCH,url:`/project-files/${e.uuid}/`,payload:i,blockers:[e.uuid],blocks:[e.uuid]});return a.then(c=>{this.dispatch(Vc(c))}),a}saveActive(){const{store:e}=this.client,i=e.getState(),a=i.projectFileReducer.activeProjectFileId;if(!a)throw new Error("No active project file");const c=i.projectFileReducer.instances[a];if(!c)throw new Error("No active project file");if(!c.bounds&&!c.canvas_bounds)throw new Error("Project file must either have bounds or canvas_bounds set");let n;if(typeof c.file=="string"&&!c.file.startsWith("blob:")){const m={...c};delete m.file,n={method:l.PATCH,url:`/project-files/${a}/`,payload:m,blockers:[a],blocks:[a]}}else n=new Promise((m,o)=>{this.client.files.uploadFileToS3(c.file_sha1).then(([h])=>{m({method:l.POST,url:"/project-files/",payload:{...c,...h},blockers:[a],blocks:[a]})}).catch(o)});const u=Promise.resolve(n).then(m=>this.enqueueRequest(m));return u.then(m=>{this.dispatch(Vc(m))}),this.dispatch(zm),this.dispatch(qm(null)),this.dispatch(jm(!1)),[c,u]}delete(e){return this.dispatch(Vm(e)),this.enqueueRequest({method:l.DELETE,url:`/project-files/${e}`,blockers:[e],blocks:[]})}async refreshStore(e,i){const c=(await this.performPagination({immediate:!0,description:"Get project files",method:l.GET,url:"/project-files/",queryParams:{limit:this.pageSize,paginate:!0,project:e},blockers:[],blocks:[]},n=>({immediate:!0,description:"Get project files",method:l.GET,url:n,blockers:[],blocks:[]}),i)).flat();return this.dispatch(wm(c)),c}}class sF extends O{async add(e){const i=await this.enqueueRequest({description:"Create project",method:l.POST,url:"/projects/",payload:v(e),blockers:[],blocks:[]});return this.dispatch(jc(i)),i}async update(e){if(!e.bounds&&!e.canvas_bounds)throw new Error("Project must either have bounds or canvas_bounds set");return this.dispatch($m(e)),await this.enqueueRequest({description:"Update project",method:l.PATCH,url:`/projects/${e.uuid}/`,payload:{name:e.name,bounds:e.bounds},blockers:[e.uuid],blocks:[e.uuid]})}async delete(e){const{store:i}=this.client,a=i.getState(),c=Nm(e)(a);if(!c)throw new Error("Expected project to exist");const n=Cm(a).filter(m=>m.project===e);this.dispatch(Em(n.map(({uuid:m})=>m)));const r=Om(c.uuid)(a);this.dispatch(wc(r.map(({uuid:m})=>m)));const u=Am(e)(a);this.dispatch(Pc(u.map(({uuid:m})=>m))),this.dispatch(qc(c.uuid));try{await this.enqueueRequest({description:"Delete project",method:l.DELETE,url:`/projects/${e}/`,blockers:[e],blocks:[]}),this.dispatch(qc(c.uuid))}catch(m){throw this.dispatch(jc(c)),this.dispatch(bc(Object.values(u))),this.dispatch(Mm(n)),this.dispatch(Im(r)),m}}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Fetch projects",method:l.GET,url:"/projects/",queryParams:{organization:e},blockers:[],blocks:[]},i);return this.dispatch(Bm(a)),a}}class iF extends O{add(e){var n;const{store:i}=this.client,a=F({...e,created_by:(n=i.getState().userReducer.currentUser)==null?void 0:n.uuid});this.dispatch(Ym(a));const c=this.enqueueRequest({description:"Create team membership",method:l.POST,url:"/team-memberships/",payload:v(a),blockers:[e.team],blocks:[a.uuid]});return c.then(r=>{this.dispatch(Dc(r))}).catch(()=>{this.dispatch(kc(a.uuid))}),[a,c]}bulkAdd(e){var r;const{store:i}=this.client,a=(r=i.getState().userReducer.currentUser)==null?void 0:r.uuid,c=e.map(u=>F({...u,created_by:a}));this.dispatch(Zm(c));const n=this.enqueueRequest({description:"Create team memberships",method:l.POST,url:"/team-memberships/bulk/",payload:{team_memberships:c.map(u=>v(u))},blockers:c.map(u=>u.team),blocks:c.map(u=>u.uuid)});return n.then(u=>{this.dispatch(Jm(u))}).catch(()=>{this.dispatch(Xm(c.map(u=>u.uuid)))}),[c,n]}async delete(e){const{store:i}=this.client,a=i.getState(),c=ep(e)(a);if(!c)throw new Error(`Expected team membership with uuid ${e} to exist`);this.dispatch(kc(e));try{return await this.enqueueRequest({description:"Delete team membership",method:l.DELETE,url:`/team-memberships/${e}/`,blockers:[e],blocks:[e]})}catch(n){throw this.dispatch(Dc(c)),n}}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Fetch team memberships",method:l.GET,url:"/team-memberships/",queryParams:{team__organization:e},blockers:[],blocks:[]},i);return this.dispatch(Km(a)),a}}class aF extends O{add(e){var n;const{store:i}=this.client,a=F({...e,submitted_at:new Date().toISOString(),created_by:(n=i.getState().userReducer.currentUser)==null?void 0:n.uuid});this.dispatch(ip(a));const c=this.enqueueRequest({description:"Create team",method:l.POST,url:"/teams/",payload:v(a),blockers:[],blocks:[a.uuid]});return c.then(r=>{this.dispatch(bt(r))}).catch(()=>{this.dispatch(Gc(a.uuid))}),[a,c]}update(e){const{store:i}=this.client,a=Nc(e.uuid)(i.getState());if(!a)throw new Error(`Expected team with uuid ${e.uuid} to exist`);const c={...a,...e};this.dispatch(ap(c));const n=this.enqueueRequest({description:"Update team",method:l.PATCH,url:`/teams/${e.uuid}/`,payload:v(e),blockers:[e.uuid],blocks:[e.uuid]});return n.then(r=>{this.dispatch(bt(r))}).catch(()=>{this.dispatch(bt(a))}),[c,n]}async delete(e){const{store:i}=this.client,a=i.getState(),c=Nc(e)(a);if(!c)throw new Error(`Expected team with uuid ${e} to exist`);this.dispatch(Gc(e));try{return await this.enqueueRequest({description:"Delete team",method:l.DELETE,url:`/teams/${e}/`,blockers:[e],blocks:[e]})}catch(n){throw this.dispatch(bt(c)),n}}async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Fetch teams",method:l.GET,url:"/teams/",queryParams:{organization:e},blockers:[],blocks:[]},i);return this.dispatch(sp(a)),a}}class cF extends O{async refreshStore(e,i){const a=await this.enqueueRequest({immediate:!0,description:"Fetch organization users",method:l.GET,url:`/organizations/${e}/users/`,blockers:[],blocks:[]},i);return this.dispatch(Gh(a)),a}}class nF{constructor(e){S(this,"store");this.store=e}async enqueueRequest(e,i,a,c){return this._enqueueRequest(e,i,a,c).then(n=>{if(n instanceof U)throw n;return n})}_enqueueRequest(e,i,a,c){const n=new nn,r={...e,BASE_URL:i,serviceName:a};if(e.immediate){const u={...r,uuid:e.uuid??Ze.v4()},m={payload:u,meta:{offline:{effect:{timestamp:new Date().toISOString(),request:u,BASE_URL:i,serviceName:a}}}};Wc(m,this,c).then(o=>{n.resolve(o.body)}).catch(o=>{o instanceof Error?n.reject(o):n.reject(new Error((o??Qe).toString()))})}else{const u=this.store.dispatch(dm(r)),m=h=>{if(h)n.resolve(h.body);else{const p=new U({message:"Could not get a response from the server.",response:h,discard:!0});n.reject(p)}},o=h=>{h instanceof U?h.options.discard=!0:(console.error("Received an unexpected error while processing a request:",h,`
|
|
15
15
|
Converting error to APIError and discarding.`),h=new U({message:"An error occurred while processing the request.",innerError:h,discard:!0})),n.reject(h)};u.then(m,o)}return n}}class xe{constructor(){S(this,"graph");S(this,"requestAttemptCounter");this.graph=new $p.DepGraph,this.requestAttemptCounter={}}static _fromOutbox(e){const i=new xe;for(let a=0;a<e.length;a++){const c=e[a];if(!c){console.error("Outbox item was undefined");continue}i.sneakRequest(c);for(let n=0;n<a;n++){const r=e[n];if(!r){console.error("Previous outbox item was undefined");continue}r.payload.uuid!==c.payload.uuid&&r.payload.blocks.some(u=>c.payload.blockers.includes(u))&&xe._addDependency(c.payload.uuid,r.payload.uuid,i.graph)}}return i}_addDependency(e,i){xe._addDependency(e,i,this.graph)}static _addDependency(e,i,a){if(e===i)throw new Error(`Tried to add dependency from node to itself: ${e}`);if(!a.hasNode(e))throw new Error(`Tried to add dependency from non-existent node: ${e} (to node: ${i})`);if(!a.hasNode(i))throw new Error(`Tried to add dependency to non-existent node: ${i} (from node: ${e})`);a.addDependency(e,i)}addRequest(e){if(this.graph.addNode(e.payload.uuid,e),!(e.payload.blockers.length===0||this.graph.size()===1))for(const i of this.graph.overallOrder()){if(i===e.payload.uuid)continue;const a=this.graph.getNodeData(i);e.payload.blockers.some(c=>a.payload.blocks.includes(c))&&this._addDependency(e.payload.uuid,i)}}insertRequest(e){this.graph.addNode(e.payload.uuid,e);for(const i of this.graph.overallOrder()){if(i===e.payload.uuid)continue;this.graph.getNodeData(i).payload.blockers.some(c=>e.payload.blocks.includes(c))&&this._addDependency(i,e.payload.uuid)}}sneakRequest(e){this.graph.addNode(e.payload.uuid,e)}_getNextNode(){const e=this.graph.overallOrder(!0);let i=1/0,a;for(const c of e){const n=this.requestAttemptCounter[c]||0;n<i&&(i=n,a=c)}return a}peek(){const e=this._getNextNode();if(e)return this.graph.getNodeData(e)}remove(e){this.graph.removeNode(e),delete this.requestAttemptCounter[e]}pop(){const e=this.peek();return e&&this.graph.removeNode(e.payload.uuid),e}getQueue(){const e=this.graph.overallOrder().map(a=>this.graph.getNodeData(a)),i=this._getNextNode();if(i){const a=this.graph.getNodeData(i),c=e.findIndex(n=>n.payload.uuid===a.payload.uuid);c!==-1&&(e.splice(c,1),e.unshift(a))}return e}getReady(){let e=this.graph.overallOrder(!0).map(i=>this.graph.getNodeData(i));return e=e.sort((i,a)=>i.meta.offline.effect.timestamp.localeCompare(a.meta.offline.effect.timestamp)),e=e.sort((i,a)=>{const c=this.requestAttemptCounter[i.payload.uuid]||0,n=this.requestAttemptCounter[a.payload.uuid]||0;return c-n}),e}registerRetry(e){this.requestAttemptCounter[e]=(this.requestAttemptCounter[e]||0)+1}}let bp;function Fp(t){bp=t}function et(){return bp}let Pp;function _p(t){Pp=t}function Op(){return Pp}let Jc=null;function Ke(){const t=et();if(!t)return console.warn("Client store not set; cannot get outbox coordinator yet."),null;if(Jc)return Jc;const e=t.getState().offline.outbox,i=xe._fromOutbox(e);return Jc=i,i}const rF=(t,e)=>{const i=new e(t);return _p(i),Fp(t),i};class dF{constructor(e){S(this,"_all");S(this,"_previous");this._all=[e],this._previous=e,this.then=this.then.bind(this),this.compile=this.compile.bind(this)}then(e){return this._previous&&(this._previous.next=e),this._all.push(e),this._previous=e,{then:this.then,compile:this.compile}}compile(){return this._all}}class Xc{constructor(){S(this,"next");this.next=null}then(e){return new dF(this).then(e)}async run(e){if(this.next)return this.next.run(e);{if(console.debug("Middleware finished. Performing request:",e),!et())throw new Error("Client store not set");const a=Op();if(!a)throw new Error("Client SDK not set");return Wc(e,a)}}}class Rp extends Xc{async run(e){return super.run(e)}}class vp extends Xc{async run(e){return super.run(e)}}const wp=new Rp().then(new vp).compile();function Mp(t){var e;return(e=wp[0])==null?void 0:e.run(t)}var Vp=(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))(Vp||{});s.ALL_MIDDLEWARE=wp,s.APIError=U,s.ATTACHMENT_MODEL_DEFAULT_PAGE_SIZE=$e,s.AgentService=Zg,s.AssetAttachmentService=Jg,s.AssetProcedureService=sb,s.AssetProcedureStepFieldValuesAttachmentService=nb,s.AssetProcedureStepFieldValuesService=rb,s.AssetProcedureStepFieldsAttachmentService=ab,s.AssetProcedureStepFieldsService=cb,s.AssetProcedureStepService=db,s.AssetProcedureTypeAttachmentService=Xg,s.AssetProcedureTypeFieldValuesAttachmentService=eb,s.AssetProcedureTypeFieldValuesService=tb,s.AssetProcedureTypeFieldsAttachmentService=Qg,s.AssetProcedureTypeFieldsService=xg,s.AssetProcedureTypeService=ib,s.AssetService=ub,s.AssetStageCompletionService=ob,s.AssetStageService=lb,s.AssetTypeAttachmentService=hb,s.AssetTypeFieldValuesAttachmentService=yb,s.AssetTypeFieldValuesService=Ab,s.AssetTypeFieldsAttachmentService=mb,s.AssetTypeFieldsService=pb,s.AssetTypeIdentifierService=fb,s.AssetTypeIdentifierValueService=Sb,s.AssetTypeService=Tb,s.AttachmentModel=an,s.BaseApiService=O,s.BaseSDK=nF,s.COMMON_AUTO_FIELDS=ln,s.CategoryService=Ib,s.DEFAULT_ISSUE_PRIORITY=Lp,s.DEFAULT_ISSUE_STATUS=Gp,s.DEFAULT_PAGE_SIZE=op,s.DeferredPromise=nn,s.DocumentAttachmentService=gb,s.DocumentService=bb,s.EMPTY_ARRAY=en,s.EMPTY_OBJECT=tn,s.EmailVerificationService=Fb,s.FileService=_b,s.FormIdentifierService=Ob,s.FormIdentifierValueService=Rb,s.FormRevisionAttachmentService=vb,s.FormRevisionService=wb,s.FormService=Mb,s.FormSubmissionAttachmentService=Vb,s.FormSubmissionService=Eb,s.GeoImageService=jb,s.HttpMethod=l,s.IssueAssociationService=qb,s.IssueAttachmentService=zb,s.IssueCommentAttachmentService=Ub,s.IssueCommentService=Cb,s.IssuePriority=Xt,s.IssueService=Db,s.IssueStatus=Qt,s.IssueTypeAttachmentService=kb,s.IssueTypeFieldValuesAttachmentService=Gb,s.IssueTypeFieldValuesService=Lb,s.IssueTypeFieldsAttachmentService=Bb,s.IssueTypeFieldsService=$b,s.IssueTypeIdentifierService=Nb,s.IssueTypeIdentifierValueService=Hb,s.IssueTypeService=Wb,s.IssueUpdateChange=V,s.IssueUpdateService=Kb,s.JWTService=Jb,s.OUTBOX_RETRY_DELAY=cn,s.OfflineAnalyticsMiddleware=Rp,s.OfflineMiddleware=Xc,s.OrganizationAccessLevel=sn,s.OrganizationAccessService=Xb,s.OrganizationService=Qb,s.OutboxCoordinator=xe,s.ProjectAccessService=xb,s.ProjectAttachmentService=eF,s.ProjectFileService=tF,s.ProjectService=sF,s.RESET_ORGANIZATION_STATE=_,s.RESET_PROJECT_STATE=M,s.RESET_STATE=b,s.RateLimitingMiddleware=vp,s.SelectorBuilder=qg,s.TeamMembershipService=iF,s.TeamService=aF,s.UNKNOWN_ERROR_MESSAGE=Qe,s.UserService=cF,s.VERSION_REDUCER_KEY=tt,s.VerificationCodeType=Vp,s._setLatestRetryTime=om,s.addAsset=Ks,s.addAssetAttachment=Sy,s.addAssetAttachments=rs,s.addAssetProcedure=bs,s.addAssetProcedureStep=td,s.addAssetProcedureStepFieldValues=$s,s.addAssetProcedureStepFieldValuesAttachment=PA,s.addAssetProcedureStepFieldValuesAttachments=Rt,s.addAssetProcedureStepFieldValuesMany=Kr,s.addAssetProcedureStepFields=qs,s.addAssetProcedureStepFieldsAttachment=dA,s.addAssetProcedureStepFieldsAttachments=wr,s.addAssetProcedureStepFieldsMany=yA,s.addAssetProcedureSteps=sd,s.addAssetProcedureType=vs,s.addAssetProcedureTypeAttachment=gy,s.addAssetProcedureTypeAttachments=jn,s.addAssetProcedureTypeFieldValues=fs,s.addAssetProcedureTypeFieldValuesAttachment=By,s.addAssetProcedureTypeFieldValuesAttachments=_t,s.addAssetProcedureTypeFieldValuesMany=hr,s.addAssetProcedureTypeFields=Qn,s.addAssetProcedureTypeFieldsAttachment=_y,s.addAssetProcedureTypeFieldsAttachments=Nn,s.addAssetProcedureTypeFieldsMany=Ey,s.addAssetProcedureTypes=tA,s.addAssetProcedures=Tr,s.addAssetStage=ni,s.addAssetStageCompletion=ei,s.addAssetStageCompletions=ti,s.addAssetStages=YA,s.addAssetType=Ei,s.addAssetTypeAttachment=ef,s.addAssetTypeAttachments=li,s.addAssetTypeFieldValues=Si,s.addAssetTypeFieldValuesAttachment=Tf,s.addAssetTypeFieldValuesAttachments=zt,s.addAssetTypeFieldValuesMany=au,s.addAssetTypeFields=Nd,s.addAssetTypeFieldsAttachment=af,s.addAssetTypeFieldsAttachments=Ud,s.addAssetTypeFieldsMany=lf,s.addAssetTypeIdentifier=Fi,s.addAssetTypeIdentifierValue=Ri,s.addAssetTypeIdentifierValues=zf,s.addAssetTypeIdentifiers=wf,s.addAssetTypes=Nf,s.addAssets=Vt,s.addCategories=xf,s.addCategory=Ci,s.addConversation=Tn,s.addConversations=ly,s.addDocumentAttachment=nS,s.addDocumentAttachments=Eu,s.addDocuments=Lu,s.addForm=da,s.addFormIdentifier=Ki,s.addFormIdentifierValue=Xi,s.addFormIdentifierValues=IS,s.addFormIdentifiers=pS,s.addFormRevision=ia,s.addFormRevisionAttachment=RS,s.addFormRevisionAttachments=uo,s.addFormRevisions=Ao,s.addFormSubmission=ma,s.addFormSubmissionAttachment=HS,s.addFormSubmissionAttachments=kt,s.addFormSubmissions=Uo,s.addForms=DS,s.addGeoImage=No,s.addGeoImages=Ho,s.addIssue=Ca,s.addIssueAssociation=ga,s.addIssueAssociations=ba,s.addIssueAttachment=cT,s.addIssueAttachments=Ra,s.addIssueComment=Ea,s.addIssueCommentAttachment=dT,s.addIssueCommentAttachments=yl,s.addIssueComments=mT,s.addIssueType=Rh,s.addIssueTypeAttachment=FT,s.addIssueTypeAttachments=zl,s.addIssueTypeFieldValues=Wa,s.addIssueTypeFieldValuesAttachment=ZT,s.addIssueTypeFieldValuesAttachments=Nt,s.addIssueTypeFieldValuesMany=qT,s.addIssueTypeFields=ah,s.addIssueTypeFieldsAttachment=RT,s.addIssueTypeFieldsAttachments=Wl,s.addIssueTypeFieldsMany=BT,s.addIssueTypeIdentifier=ec,s.addIssueTypeIdentifierValue=ac,s.addIssueTypeIdentifierValues=rI,s.addIssueTypeIdentifiers=tI,s.addIssueTypes=pI,s.addIssueUpdate=jh,s.addIssueUpdates=qh,s.addIssues=Ml,s.addOrganization=sm,s.addOrganizationAccess=Jh,s.addOrganizationAccesses=jI,s.addOrganizations=GI,s.addProject=jc,s.addProjectAccess=gc,s.addProjectAccesses=bc,s.addProjectAttachment=tg,s.addProjectAttachments=Sm,s.addProjectFile=cg,s.addProjectFiles=Mm,s.addProjects=hg,s.addTeam=ip,s.addTeamMembership=Ym,s.addTeamMemberships=Zm,s.addTeams=Pg,s.addUser=Lh,s.addUsers=RI,s.agentsReducer=bn,s.agentsSlice=is,s.areArraysEqual=Wp,s.assetAttachmentReducer=Vn,s.assetAttachmentSlice=cs,s.assetProcedureReducer=gr,s.assetProcedureSlice=gs,s.assetProcedureStepFieldValuesAttachmentReducer=Nr,s.assetProcedureStepFieldValuesAttachmentSlice=Ds,s.assetProcedureStepFieldValuesReducer=Xr,s.assetProcedureStepFieldValuesSlice=Bs,s.assetProcedureStepFieldsAttachmentReducer=qr,s.assetProcedureStepFieldsAttachmentSlice=Es,s.assetProcedureStepFieldsReducer=Cr,s.assetProcedureStepFieldsSlice=js,s.assetProcedureStepReducer=cd,s.assetProcedureStepSlice=Ns,s.assetProcedureTypeAttachmentReducer=Dn,s.assetProcedureTypeAttachmentSlice=us,s.assetProcedureTypeFieldValuesAttachmentReducer=nr,s.assetProcedureTypeFieldValuesAttachmentSlice=ps,s.assetProcedureTypeFieldValuesReducer=yr,s.assetProcedureTypeFieldValuesSlice=As,s.assetProcedureTypeFieldsAttachmentReducer=Kn,s.assetProcedureTypeFieldsAttachmentSlice=ls,s.assetProcedureTypeFieldsReducer=tr,s.assetProcedureTypeFieldsSlice=hs,s.assetProcedureTypeReducer=_r,s.assetProcedureTypeSlice=Rs,s.assetReducer=hd,s.assetSlice=Ws,s.assetStageCompletionReducer=fd,s.assetStageCompletionSlice=xs,s.assetStageReducer=Fd,s.assetStageSlice=ci,s.assetTypeAttachmentReducer=jd,s.assetTypeAttachmentSlice=ui,s.assetTypeFieldValuesAttachmentReducer=tu,s.assetTypeFieldValuesAttachmentSlice=yi,s.assetTypeFieldValuesReducer=du,s.assetTypeFieldValuesSlice=fi,s.assetTypeFieldsAttachmentReducer=$d,s.assetTypeFieldsAttachmentSlice=mi,s.assetTypeFieldsReducer=Yd,s.assetTypeFieldsSlice=pi,s.assetTypeIdentifierReducer=mu,s.assetTypeIdentifierSlice=bi,s.assetTypeIdentifierValueReducer=fu,s.assetTypeIdentifierValueSlice=Oi,s.assetTypeReducer=gu,s.assetTypeSlice=Vi,s.authReducer=Pu,s.authSlice=Ct,s.baseReducer=Vg,s.baseReducers=Hc,s.blobToBase64=ty,s.categoryReducer=Mu,s.categorySlice=Ui,s.clearTokens=Jf,s.constructUploadedFilePayloads=ey,s.createModelAdapter=P,s.createOfflineAction=nm,s.createPayload=v,s.createSelectionAdapter=Np,s.deleteAsset=Ys,s.deleteAssetAttachment=On,s.deleteAssetAttachments=ds,s.deleteAssetProcedure=Fs,s.deleteAssetProcedureStep=id,s.deleteAssetProcedureStepFieldValues=Gs,s.deleteAssetProcedureStepFieldValuesAttachment=vA,s.deleteAssetProcedureStepFieldValuesAttachments=vt,s.deleteAssetProcedureStepFieldValuesMany=Zr,s.deleteAssetProcedureStepFields=zs,s.deleteAssetProcedureStepFieldsAttachment=hA,s.deleteAssetProcedureStepFieldsAttachments=Vr,s.deleteAssetProcedureStepFieldsMany=TA,s.deleteAssetProcedureSteps=ad,s.deleteAssetProcedureType=ws,s.deleteAssetProcedureTypeAttachment=Un,s.deleteAssetProcedureTypeAttachments=Cn,s.deleteAssetProcedureTypeFieldValues=Ss,s.deleteAssetProcedureTypeFieldValuesAttachment=Ny,s.deleteAssetProcedureTypeFieldValuesAttachments=Ot,s.deleteAssetProcedureTypeFieldValuesMany=pr,s.deleteAssetProcedureTypeFields=er,s.deleteAssetProcedureTypeFieldsAttachment=wy,s.deleteAssetProcedureTypeFieldsAttachments=Wn,s.deleteAssetProcedureTypeFieldsMany=Uy,s.deleteAssetProcedureTypes=iA,s.deleteAssetProcedures=Ir,s.deleteAssetStage=ri,s.deleteAssetStageCompletion=si,s.deleteAssetStageCompletions=ii,s.deleteAssetStages=JA,s.deleteAssetType=ji,s.deleteAssetTypeAttachment=vd,s.deleteAssetTypeAttachments=hi,s.deleteAssetTypeFieldValues=Ti,s.deleteAssetTypeFieldValuesAttachment=Ff,s.deleteAssetTypeFieldValuesAttachments=Ut,s.deleteAssetTypeFieldValuesMany=nu,s.deleteAssetTypeFields=Wd,s.deleteAssetTypeFieldsAttachment=df,s.deleteAssetTypeFieldsAttachments=Dd,s.deleteAssetTypeFieldsMany=yf,s.deleteAssetTypeIdentifier=Pi,s.deleteAssetTypeIdentifierValue=vi,s.deleteAssetTypeIdentifierValues=kf,s.deleteAssetTypeIdentifiers=jf,s.deleteAssetTypes=Wf,s.deleteAssets=Zs,s.deleteCategories=iS,s.deleteCategory=vu,s.deleteConversation=py,s.deleteConversations=yy,s.deleteDocumentAttachment=zu,s.deleteDocumentAttachments=Uu,s.deleteForm=ua,s.deleteFormIdentifier=Yi,s.deleteFormIdentifierValue=Qi,s.deleteFormIdentifierValues=PS,s.deleteFormIdentifiers=SS,s.deleteFormRevision=aa,s.deleteFormRevisionAttachment=VS,s.deleteFormRevisionAttachments=lo,s.deleteFormRevisions=So,s.deleteFormSubmission=pa,s.deleteFormSubmissionAttachment=ZS,s.deleteFormSubmissionAttachments=Bt,s.deleteFormSubmissions=Do,s.deleteForms=LS,s.deleteGeoImage=Sa,s.deleteGeoImages=Ko,s.deleteIssue=Da,s.deleteIssueAssociation=Fa,s.deleteIssueAssociations=Pa,s.deleteIssueAttachment=dl,s.deleteIssueAttachments=va,s.deleteIssueComment=qa,s.deleteIssueCommentAttachment=Sl,s.deleteIssueCommentAttachments=Tl,s.deleteIssueComments=AT,s.deleteIssueType=fI,s.deleteIssueTypeAttachment=Dl,s.deleteIssueTypeAttachments=kl,s.deleteIssueTypeFieldValues=Ka,s.deleteIssueTypeFieldValuesAttachment=xT,s.deleteIssueTypeFieldValuesAttachments=Ht,s.deleteIssueTypeFieldValuesMany=DT,s.deleteIssueTypeFields=nh,s.deleteIssueTypeFieldsAttachment=VT,s.deleteIssueTypeFieldsAttachments=Yl,s.deleteIssueTypeFieldsMany=NT,s.deleteIssueTypeIdentifier=tc,s.deleteIssueTypeIdentifierValue=cc,s.deleteIssueTypeIdentifierValues=lI,s.deleteIssueTypeIdentifiers=cI,s.deleteIssueTypes=SI,s.deleteIssueUpdate=zh,s.deleteIssueUpdates=Uh,s.deleteIssues=Vl,s.deleteOrganization=NI,s.deleteOrganizationAccess=Xh,s.deleteOrganizationAccesses=CI,s.deleteOrganizations=HI,s.deleteProject=qc,s.deleteProjectAccess=Fc,s.deleteProjectAccesses=Pc,s.deleteProjectAttachment=bm,s.deleteProjectAttachments=wc,s.deleteProjectFile=Vm,s.deleteProjectFiles=Em,s.deleteProjects=pg,s.deleteTeam=Gc,s.deleteTeamMembership=kc,s.deleteTeamMemberships=Xm,s.deleteTeams=Rg,s.deleteUser=Nh,s.deleteUsers=MI,s.dequeue=Sp,s.discard=Ip,s.documentAttachmentReducer=Bu,s.documentAttachmentSlice=Bi,s.documentSlice=Gi,s.documentsReducer=Hu,s.downloadFile=sy,s.downloadInMemoryFile=xp,s.emailRegex=uy,s.enqueue=fp,s.enqueueRequest=dm,s.fallbackToEmptyArray=T,s.fallbackToEmptyObject=Pt,s.fileReducer=Ju,s.fileSlice=Hi,s.fileToBlob=un,s.formIdentifierReducer=to,s.formIdentifierSlice=Wi,s.formIdentifierValueReducer=co,s.formIdentifierValueSlice=Ji,s.formReducer=Fo,s.formRevisionAttachmentReducer=mo,s.formRevisionAttachmentSlice=ta,s.formRevisionReducer=Io,s.formRevisionsSlice=sa,s.formSlice=ra,s.formSubmissionAttachmentReducer=jo,s.formSubmissionAttachmentSlice=oa,s.formSubmissionReducer=Bo,s.formSubmissionSlice=ha,s.geoImageReducer=Jo,s.geoImageSlice=fa,s.getAssetProcedureStepSubTree=An,s.getAssetProcedureStepTrees=oy,s.getClientSDK=Op,s.getClientStore=et,s.getFileIdentifier=Qp,s.getFileS3Key=ss,s.getLocalDateString=rn,s.getLocalRelativeDateString=Jp,s.getOutboxCoordinator=Ke,s.getRenamedFile=dn,s.hashFile=Je,s.initSDK=rF,s.initializeAssetAttachments=ns,s.initializeAssetProcedureStepFieldValues=Wr,s.initializeAssetProcedureStepFieldValuesAttachments=kr,s.initializeAssetProcedureStepFields=Ur,s.initializeAssetProcedureStepFieldsAttachments=vr,s.initializeAssetProcedureSteps=xr,s.initializeAssetProcedureTypeAttachments=os,s.initializeAssetProcedureTypeFieldValues=lr,s.initializeAssetProcedureTypeFieldValuesAttachments=ar,s.initializeAssetProcedureTypeFields=Xn,s.initializeAssetProcedureTypeFieldsAttachments=Ln,s.initializeAssetProcedureTypes=Pr,s.initializeAssetProcedures=Sr,s.initializeAssetStageCompletions=pd,s.initializeAssetStages=gd,s.initializeAssetTypeAttachments=oi,s.initializeAssetTypeFieldValues=iu,s.initializeAssetTypeFieldValuesAttachments=Jd,s.initializeAssetTypeFields=Ld,s.initializeAssetTypeFieldsAttachments=zd,s.initializeAssetTypeIdentifierValues=yu,s.initializeAssetTypeIdentifiers=ou,s.initializeAssetTypes=Tu,s.initializeAssets=ud,s.initializeCategories=Ou,s.initializeConversations=Sn,s.initializeDocumentAttachments=$i,s.initializeFormIdentifierValues=io,s.initializeFormIdentifiers=Qu,s.initializeFormRevisionAttachments=ro,s.initializeFormRevisions=yo,s.initializeFormSubmissionAttachments=vo,s.initializeFormSubmissions=zo,s.initializeForms=bo,s.initializeGeoImages=Go,s.initializeIssueAssociations=Qo,s.initializeIssueAttachments=Oa,s.initializeIssueCommentAttachments=Ma,s.initializeIssueComments=hT,s.initializeIssueTypeAttachments=La,s.initializeIssueTypeFieldValues=xl,s.initializeIssueTypeFieldValuesAttachments=oh,s.initializeIssueTypeFields=ih,s.initializeIssueTypeFieldsAttachments=Hl,s.initializeIssueTypeIdentifierValues=bh,s.initializeIssueTypeIdentifiers=fh,s.initializeIssueTypes=Oh,s.initializeIssueUpdates=Eh,s.initializeIssues=wl,s.initializeOrganizationAccesses=Zh,s.initializeOrganizations=tm,s.initializeProjectAccesses=mm,s.initializeProjectAttachments=vc,s.initializeProjectFiles=wm,s.initializeProjects=Bm,s.initializeTeamMemberships=Km,s.initializeTeams=sp,s.initializeUsers=Gh,s.isToday=Zp,s.issueAssociationReducer=al,s.issueAssociationSlice=Ia,s.issueAttachmentReducer=ml,s.issueAttachmentSlice=_a,s.issueCommentAttachmentReducer=Fl,s.issueCommentAttachmentSlice=wa,s.issueCommentReducer=Rl,s.issueCommentSlice=Va,s.issueReducer=jl,s.issueSlice=Ua,s.issueTypeAttachmentReducer=Ll,s.issueTypeAttachmentSlice=Ga,s.issueTypeFieldValuesAttachmentReducer=yh,s.issueTypeFieldValuesAttachmentSlice=Xa,s.issueTypeFieldValuesReducer=th,s.issueTypeFieldValuesSlice=Ha,s.issueTypeFieldsAttachmentReducer=Xl,s.issueTypeFieldsAttachmentSlice=Na,s.issueTypeFieldsReducer=dh,s.issueTypeFieldsSlice=Ja,s.issueTypeIdentifierReducer=Ih,s.issueTypeIdentifierSlice=xa,s.issueTypeIdentifierValueReducer=Ph,s.issueTypeIdentifierValueSlice=ic,s.issueTypeReducer=Mh,s.issueTypeSlice=dc,s.issueUpdateReducer=Bh,s.issueUpdateSlice=hc,s.logOnlyOnce=iy,s.markAsDeleted=um,s.markForDeletion=JI,s.memoize=es,s.onlyUniqueHashes=dy,s.onlyUniqueOfflineIds=pn,s.organizationAccessReducer=Qh,s.organizationAccessSlice=yc,s.organizationReducer=cm,s.organizationSlice=Sc,s.outboxReducer=lm,s.outboxSlice=Tc,s.overmapEnhancer=Gg,s.overmapReducer=Eg,s.overmapReducers=up,s.performRequest=Wc,s.projectAccessReducer=ym,s.projectAccessSlice=Ic,s.projectAttachmentReducer=Rm,s.projectAttachmentSlice=Rc,s.projectFileReducer=Dm,s.projectFileSlice=Mc,s.projectReducer=Gm,s.projectSlice=Ec,s.rehydratedReducer=Hm,s.rehydratedSlice=Uc,s.removeDocuments=Li,s.removeIssueType=uc,s.restructureCreateSelectorWithArgs=f,s.runMiddleware=Mp,s.saveActiveProjectFileBounds=zm,s.selectAccessToken=Xf,s.selectAccessesByUserOfProject=xI,s.selectAccessibleProjects=yg,s.selectActiveOrganizationAccess=DI,s.selectActiveProjectFileId=dg,s.selectAllDocumentAttachments=Du,s.selectAllProjectAttachments=Pm,s.selectAssetAttachmentById=wn,s.selectAssetAttachmentMapping=Rn,s.selectAssetAttachments=vn,s.selectAssetById=Qs,s.selectAssetProcedureById=Os,s.selectAssetProcedureStepById=Hs,s.selectAssetProcedureStepFieldValues=wt,s.selectAssetProcedureStepFieldValuesAttachmentById=wA,s.selectAssetProcedureStepFieldValuesAttachments=$r,s.selectAssetProcedureStepFieldValuesAttachmentsByIds=Gr,s.selectAssetProcedureStepFieldValuesAttachmentsMapping=ks,s.selectAssetProcedureStepFieldValuesById=Ls,s.selectAssetProcedureStepFieldValuesMapping=Jr,s.selectAssetProcedureStepFieldValuesOfAsset=EA,s.selectAssetProcedureStepFieldValuesOfAssetProcedure=jA,s.selectAssetProcedureStepFieldValuesOfAssetProcedureStep=qA,s.selectAssetProcedureStepFields=Cs,s.selectAssetProcedureStepFieldsAttachmentById=pA,s.selectAssetProcedureStepFieldsAttachments=jr,s.selectAssetProcedureStepFieldsAttachmentsMapping=Er,s.selectAssetProcedureStepFieldsById=FA,s.selectAssetProcedureStepFieldsMapping=Us,s.selectAssetProcedureStepFieldsOfAssetProcedureStep=IA,s.selectAssetProcedureStepMapping=rt,s.selectAssetProcedureSteps=nd,s.selectAssetProcedureStepsByIds=kA,s.selectAssetProcedureStepsMappingOfAssetProcedureType=CA,s.selectAssetProcedureStepsOfAssetProcedureType=DA,s.selectAssetProcedureTypeAttachmentById=$n,s.selectAssetProcedureTypeAttachmentMapping=kn,s.selectAssetProcedureTypeAttachments=Bn,s.selectAssetProcedureTypeById=Vs,s.selectAssetProcedureTypeFieldValues=Ts,s.selectAssetProcedureTypeFieldValuesAttachmentById=Hy,s.selectAssetProcedureTypeFieldValuesAttachments=rr,s.selectAssetProcedureTypeFieldValuesAttachmentsByIds=dr,s.selectAssetProcedureTypeFieldValuesAttachmentsMapping=ys,s.selectAssetProcedureTypeFieldValuesById=Is,s.selectAssetProcedureTypeFieldValuesMapping=Ar,s.selectAssetProcedureTypeFieldValuesOfAsset=Yy,s.selectAssetProcedureTypeFields=ms,s.selectAssetProcedureTypeFieldsAttachmentById=Vy,s.selectAssetProcedureTypeFieldsAttachments=Zn,s.selectAssetProcedureTypeFieldsAttachmentsMapping=Yn,s.selectAssetProcedureTypeFieldsById=ky,s.selectAssetProcedureTypeFieldsMapping=sr,s.selectAssetProcedureTypeFieldsOfAssetProcedureType=Cy,s.selectAssetProcedureTypes=Or,s.selectAssetProcedureTypesByIds=nA,s.selectAssetProcedureTypesMapping=Ms,s.selectAssetProcedureTypesOfOrganization=rA,s.selectAssetProcedures=_s,s.selectAssetProceduresByIds=eA,s.selectAssetProceduresMapping=Ps,s.selectAssetProceduresOfAssetProcedureType=br,s.selectAssetProceduresOfAssetType=xy,s.selectAssetStageById=di,s.selectAssetStageCompletionById=Sd,s.selectAssetStageCompletionMapping=ai,s.selectAssetStageCompletions=WA,s.selectAssetStageCompletionsByIds=Td,s.selectAssetStages=Pd,s.selectAssetStagesByIds=xA,s.selectAssetStagesMappingOfAssetProcedureType=XA,s.selectAssetStagesOfAssetProcedureType=QA,s.selectAssetTypeAttachmentById=Vd,s.selectAssetTypeAttachmentMapping=wd,s.selectAssetTypeAttachments=Md,s.selectAssetTypeById=zi,s.selectAssetTypeFieldValues=Ii,s.selectAssetTypeFieldValuesAttachmentById=Pf,s.selectAssetTypeFieldValuesAttachments=Qd,s.selectAssetTypeFieldValuesAttachmentsByIds=xd,s.selectAssetTypeFieldValuesAttachmentsMapping=Ai,s.selectAssetTypeFieldValuesById=gi,s.selectAssetTypeFieldValuesMapping=ru,s.selectAssetTypeFieldValuesOfAsset=Rf,s.selectAssetTypeFields=qt,s.selectAssetTypeFieldsAttachmentById=of,s.selectAssetTypeFieldsAttachments=Bd,s.selectAssetTypeFieldsAttachmentsMapping=kd,s.selectAssetTypeFieldsById=Sf,s.selectAssetTypeFieldsMapping=Kd,s.selectAssetTypeFieldsOfAssetType=Af,s.selectAssetTypeIdentifierById=_i,s.selectAssetTypeIdentifierMapping=lu,s.selectAssetTypeIdentifierValueById=Mi,s.selectAssetTypeIdentifierValueMapping=Au,s.selectAssetTypeIdentifierValues=wi,s.selectAssetTypeIdentifierValuesOfAsset=Bf,s.selectAssetTypeIdentifierValuesOfIdentifier=$f,s.selectAssetTypeIdentifiers=hu,s.selectAssetTypeIdentifiersOfAssetType=qf,s.selectAssetTypeValuesOfAssetType=vf,s.selectAssetTypes=Iu,s.selectAssetTypesByIds=Kf,s.selectAssetTypesMapping=qi,s.selectAssetTypesOfOrganization=Yf,s.selectAssets=od,s.selectAssetsByIds=ld,s.selectAssetsMapping=Js,s.selectAssetsOfAssetType=Xs,s.selectAttachmentsOfAsset=Mn,s.selectAttachmentsOfAssetProcedureStepFieldValues=Lr,s.selectAttachmentsOfAssetProcedureStepFields=mA,s.selectAttachmentsOfAssetProcedureType=Py,s.selectAttachmentsOfAssetProcedureTypeFieldValues=ur,s.selectAttachmentsOfAssetProcedureTypeFields=My,s.selectAttachmentsOfAssetType=Ed,s.selectAttachmentsOfAssetTypeFieldValues=eu,s.selectAttachmentsOfAssetTypeFields=uf,s.selectAttachmentsOfDocument=uS,s.selectAttachmentsOfFormRevision=ES,s.selectAttachmentsOfFormSubmission=Eo,s.selectAttachmentsOfIssue=ll,s.selectAttachmentsOfIssueComment=lT,s.selectAttachmentsOfIssueType=OT,s.selectAttachmentsOfIssueTypeFieldValues=ph,s.selectAttachmentsOfIssueTypeFields=ET,s.selectAttachmentsOfProject=Om,s.selectCategories=wu,s.selectCategoriesByIds=aS,s.selectCategoriesOfProject=cS,s.selectCategoryById=ki,s.selectCategoryMapping=Di,s.selectCommentsOfIssue=fT,s.selectConversation=fy,s.selectConversationMapping=as,s.selectConversations=Ay,s.selectCurrentUser=Wh,s.selectDeletedRequests=YI,s.selectDescendantsOfAssetProcedureStep=rd,s.selectDocumentAttachmentById=ku,s.selectDocumentAttachmentMapping=Cu,s.selectDocumentById=Nu,s.selectDocuments=Ni,s.selectDocumentsByIds=oS,s.selectDocumentsMapping=Dt,s.selectFieldValuesOfAssetProcedure=Zy,s.selectFormById=Oo,s.selectFormIdentifierById=Zi,s.selectFormIdentifierMapping=xu,s.selectFormIdentifierValueById=ea,s.selectFormIdentifierValueMapping=ao,s.selectFormIdentifierValues=xi,s.selectFormIdentifierValuesOfFormSubmission=_S,s.selectFormIdentifierValuesOfIdentifier=OS,s.selectFormIdentifiers=eo,s.selectFormIdentifiersOfForm=TS,s.selectFormMapping=Po,s.selectFormRevisionAttachmentsMapping=ho,s.selectFormRevisionById=US,s.selectFormRevisionMapping=ca,s.selectFormRevisions=na,s.selectFormRevisionsOfForm=To,s.selectFormSubmissionAttachemntsByIds=Vo,s.selectFormSubmissionAttachments=la,s.selectFormSubmissionAttachmentsMapping=Mo,s.selectFormSubmissionById=Aa,s.selectFormSubmissions=QS,s.selectFormSubmissionsMapping=ya,s.selectFormSubmissionsOfForm=ko,s.selectForms=_o,s.selectFormsOfOrganization=NS,s.selectGeoImageById=Ta,s.selectGeoImageMapping=Yo,s.selectGeoImages=Zo,s.selectGeoImagesOfProject=eT,s.selectIsImportingProjectFile=ug,s.selectIsLoggedIn=Qf,s.selectIssueAssociationById=el,s.selectIssueAssociationMapping=At,s.selectIssueAssociations=aT,s.selectIssueAssociationsOfAsset=il,s.selectIssueAssociationsOfIssue=sl,s.selectIssueAssociationsToIssue=tl,s.selectIssueAttachmentById=hl,s.selectIssueAttachmentMapping=ul,s.selectIssueAttachments=ol,s.selectIssueById=$a,s.selectIssueCommentAttachmentById=bl,s.selectIssueCommentAttachmentMapping=Il,s.selectIssueCommentAttachments=gl,s.selectIssueCommentById=za,s.selectIssueCommentMapping=Ol,s.selectIssueMapping=ka,s.selectIssueTypeAttachmentById=Gl,s.selectIssueTypeAttachmentMapping=Bl,s.selectIssueTypeAttachments=$l,s.selectIssueTypeById=lc,s.selectIssueTypeFieldValues=Ya,s.selectIssueTypeFieldValuesAttachmentById=eI,s.selectIssueTypeFieldValuesAttachments=Qa,s.selectIssueTypeFieldValuesAttachmentsByIds=mh,s.selectIssueTypeFieldValuesAttachmentsMapping=hh,s.selectIssueTypeFieldValuesById=Za,s.selectIssueTypeFieldValuesMapping=eh,s.selectIssueTypeFieldValuesOfIssue=kT,s.selectIssueTypeFields=Lt,s.selectIssueTypeFieldsAttachmentById=jT,s.selectIssueTypeFieldsAttachments=Jl,s.selectIssueTypeFieldsAttachmentsMapping=Zl,s.selectIssueTypeFieldsById=YT,s.selectIssueTypeFieldsMapping=rh,s.selectIssueTypeFieldsOfIssueType=HT,s.selectIssueTypeIdentifierById=sc,s.selectIssueTypeIdentifierMapping=Sh,s.selectIssueTypeIdentifierValueById=rc,s.selectIssueTypeIdentifierValueMapping=Fh,s.selectIssueTypeIdentifierValues=nc,s.selectIssueTypeIdentifierValuesOfIdentifier=mI,s.selectIssueTypeIdentifierValuesOfIssue=hI,s.selectIssueTypeIdentifiers=Th,s.selectIssueTypeIdentifiersOfIssueType=nI,s.selectIssueTypeMapping=oc,s.selectIssueTypeValuesOfIssueType=KT,s.selectIssueTypes=wh,s.selectIssueTypesByIds=TI,s.selectIssueTypesOfOrganization=II,s.selectIssueUpdateMapping=Ch,s.selectIssueUpdates=Dh,s.selectIssueUpdatesOfIssue=kh,s.selectIssues=Ba,s.selectIssuesByIds=gT,s.selectIssuesOfIssueType=El,s.selectIssuesOfProject=bT,s.selectLatestAssetProcedureStepFieldsOfAssetProcedureStep=gA,s.selectLatestAssetProcedureTypeFieldsOfAssetProcedureType=Dy,s.selectLatestAssetTypeFieldsOfAssetType=ff,s.selectLatestFieldsByAssetProcedureStep=bA,s.selectLatestFormRevisionOfForm=CS,s.selectLatestIssueTypeFieldsOfIssueType=WT,s.selectLatestRetryTime=ZI,s.selectMembershipsByUserOfTeam=bg,s.selectNumberOfAssetsOfAssetType=LA,s.selectOrganizationAccessById=fc,s.selectOrganizationAccessMapping=Ac,s.selectOrganizationAccessUserMapping=xh,s.selectOrganizationById=KI,s.selectOrganizationDocuments=hS,s.selectOrganizations=WI,s.selectOrganizationsMapping=am,s.selectProjectAccessById=Oc,s.selectProjectAccessMapping=_c,s.selectProjectAccesses=Yt,s.selectProjectAccessesOfProject=Am,s.selectProjectAttachmentById=_m,s.selectProjectAttachmentMapping=Fm,s.selectProjectById=Nm,s.selectProjectDocuments=lS,s.selectProjectFileById=rg,s.selectProjectFileMapping=Um,s.selectProjectFiles=Cm,s.selectProjectMapping=Lm,s.selectProjects=zc,s.selectProjectsOfOrganization=Ag,s.selectRehydrated=Tg,s.selectStageMapping=jt,s.selectTeamById=Nc,s.selectTeamMembershipById=ep,s.selectTeamMemberships=Bc,s.selectTeamMembershipsMapping=xm,s.selectTeams=cp,s.selectTeamsByIds=vg,s.selectTeamsMapping=Lc,s.selectTeamsOfOrganization=wg,s.selectUploadUrl=Zu,s.selectUserById=Kh,s.selectUsers=pc,s.selectUsersByIds=EI,s.selectUsersMapping=Wt,s.selectUsersOfOrganization=kI,s.selectUsersOfProject=eg,s.selectUsersOfTeam=Fg,s.setActiveProjectFileId=qm,s.setAsset=$A,s.setAssetAttachment=Pn,s.setAssetAttachments=Ty,s.setAssetProcedure=Xy,s.setAssetProcedureStep=ed,s.setAssetProcedureStepFieldValues=MA,s.setAssetProcedureStepFieldValuesAttachment=_A,s.setAssetProcedureStepFieldValuesAttachments=OA,s.setAssetProcedureStepFieldValuesMany=VA,s.setAssetProcedureStepFields=AA,s.setAssetProcedureStepFieldsAttachment=uA,s.setAssetProcedureStepFieldsAttachments=oA,s.setAssetProcedureStepFieldsMany=fA,s.setAssetProcedureSteps=zA,s.setAssetProcedureType=aA,s.setAssetProcedureTypeAttachment=qn,s.setAssetProcedureTypeAttachments=by,s.setAssetProcedureTypeFieldValues=Wy,s.setAssetProcedureTypeFieldValuesAttachment=$y,s.setAssetProcedureTypeFieldValuesAttachments=Gy,s.setAssetProcedureTypeFieldValuesMany=Ky,s.setAssetProcedureTypeFields=jy,s.setAssetProcedureTypeFieldsAttachment=Oy,s.setAssetProcedureTypeFieldsAttachments=Ry,s.setAssetProcedureTypeFieldsMany=qy,s.setAssetProcedureTypes=cA,s.setAssetProcedures=Qy,s.setAssetStage=bd,s.setAssetStageCompletion=NA,s.setAssetStageCompletions=HA,s.setAssetStages=KA,s.setAssetType=Gf,s.setAssetTypeAttachment=Od,s.setAssetTypeAttachments=tf,s.setAssetTypeFieldValues=_f,s.setAssetTypeFieldValuesAttachment=If,s.setAssetTypeFieldValuesAttachments=gf,s.setAssetTypeFieldValuesMany=Of,s.setAssetTypeFields=hf,s.setAssetTypeFieldsAttachment=cf,s.setAssetTypeFieldsAttachments=nf,s.setAssetTypeFieldsMany=mf,s.setAssetTypeIdentifier=Mf,s.setAssetTypeIdentifierValue=Uf,s.setAssetTypeIdentifierValues=Cf,s.setAssetTypeIdentifiers=Vf,s.setAssetTypes=Lf,s.setAssets=GA,s.setCategories=tS,s.setCategory=eS,s.setClientSDK=_p,s.setClientStore=Fp,s.setConversation=In,s.setConversations=hy,s.setCurrentUser=VI,s.setDocumentAttachment=ju,s.setDocumentAttachments=rS,s.setDocuments=Gu,s.setForm=kS,s.setFormIdentifier=yS,s.setFormIdentifierValue=gS,s.setFormIdentifierValues=bS,s.setFormIdentifiers=AS,s.setFormRevision=fo,s.setFormRevisionAttachment=vS,s.setFormRevisionAttachments=wS,s.setFormRevisions=jS,s.setFormSubmission=$t,s.setFormSubmissionAttachment=WS,s.setFormSubmissionAttachments=KS,s.setFormSubmissions=JS,s.setForms=BS,s.setGeoImage=yt,s.setGeoImages=Lo,s.setIsImportingProjectFile=jm,s.setIssue=ST,s.setIssueAssociation=sT,s.setIssueAssociations=tT,s.setIssueAttachment=nl,s.setIssueAttachments=nT,s.setIssueComment=ja,s.setIssueCommentAttachment=Al,s.setIssueCommentAttachments=uT,s.setIssueComments=_l,s.setIssueType=It,s.setIssueTypeAttachment=Ul,s.setIssueTypeAttachments=PT,s.setIssueTypeFieldValues=zT,s.setIssueTypeFieldValuesAttachment=JT,s.setIssueTypeFieldValuesAttachments=XT,s.setIssueTypeFieldValuesMany=UT,s.setIssueTypeFields=$T,s.setIssueTypeFieldsAttachment=vT,s.setIssueTypeFieldsAttachments=wT,s.setIssueTypeFieldsMany=GT,s.setIssueTypeIdentifier=sI,s.setIssueTypeIdentifierValue=dI,s.setIssueTypeIdentifierValues=uI,s.setIssueTypeIdentifiers=iI,s.setIssueTypes=yI,s.setIssueUpdate=gI,s.setIssueUpdates=bI,s.setIssues=TT,s.setLoggedIn=Fu,s.setOrganization=$I,s.setOrganizationAccess=qI,s.setOrganizationAccesses=zI,s.setOrganizations=BI,s.setProject=lg,s.setProjectAccess=XI,s.setProjectAccesses=QI,s.setProjectAttachment=Tm,s.setProjectAttachments=Im,s.setProjectFile=ig,s.setProjectFiles=ag,s.setProjects=og,s.setRehydrated=Sg,s.setTeam=bt,s.setTeamMembership=Dc,s.setTeamMemberships=Jm,s.setTeams=_g,s.setTokens=Zf,s.setUploadUrl=Yu,s.setUser=OI,s.setUsers=_I,s.shallowEqual=Hp,s.slugify=ny,s.spacesToDashesLower=cy,s.teamMembershipReducer=Qm,s.teamMembershipSlice=Cc,s.teamReducer=np,s.teamSlice=$c,s.toFileNameSafeString=ay,s.toUuidArray=mn,s.toUuidIdRecord=hn,s.truncate=ry,s.updateAsset=dt,s.updateAssetAttachment=Iy,s.updateAssetAttachments=_n,s.updateAssetProcedure=it,s.updateAssetProcedureStep=Mt,s.updateAssetProcedureStepFieldValues=nt,s.updateAssetProcedureStepFieldValuesAttachment=RA,s.updateAssetProcedureStepFieldValuesAttachments=Br,s.updateAssetProcedureStepFieldValuesMany=Yr,s.updateAssetProcedureStepFields=ct,s.updateAssetProcedureStepFieldsAttachment=lA,s.updateAssetProcedureStepFieldsAttachments=Mr,s.updateAssetProcedureStepFieldsMany=SA,s.updateAssetProcedureSteps=UA,s.updateAssetProcedureType=at,s.updateAssetProcedureTypeAttachment=Fy,s.updateAssetProcedureTypeAttachments=zn,s.updateAssetProcedureTypeFieldValues=st,s.updateAssetProcedureTypeFieldValuesAttachment=Ly,s.updateAssetProcedureTypeFieldValuesAttachments=cr,s.updateAssetProcedureTypeFieldValuesMany=mr,s.updateAssetProcedureTypeFields=xn,s.updateAssetProcedureTypeFieldsAttachment=vy,s.updateAssetProcedureTypeFieldsAttachments=Hn,s.updateAssetProcedureTypeFieldsMany=zy,s.updateAssetProcedureTypes=sA,s.updateAssetProcedures=Jy,s.updateAssetStage=Et,s.updateAssetStageCompletion=yd,s.updateAssetStageCompletions=Ad,s.updateAssetStages=ZA,s.updateAssetType=ht,s.updateAssetTypeAttachment=sf,s.updateAssetTypeAttachments=Rd,s.updateAssetTypeFieldValues=ut,s.updateAssetTypeFieldValuesAttachment=bf,s.updateAssetTypeFieldValuesAttachments=Xd,s.updateAssetTypeFieldValuesMany=cu,s.updateAssetTypeFields=Hd,s.updateAssetTypeFieldsAttachment=rf,s.updateAssetTypeFieldsAttachments=Cd,s.updateAssetTypeFieldsMany=pf,s.updateAssetTypeIdentifier=ot,s.updateAssetTypeIdentifierValue=lt,s.updateAssetTypeIdentifierValues=Df,s.updateAssetTypeIdentifiers=Ef,s.updateAssetTypes=Hf,s.updateAssets=BA,s.updateCategories=sS,s.updateCategory=Ru,s.updateConversation=gn,s.updateConversations=my,s.updateDocumentAttachment=dS,s.updateDocumentAttachments=qu,s.updateDocuments=Xe,s.updateForm=$S,s.updateFormIdentifier=mt,s.updateFormIdentifierValue=pt,s.updateFormIdentifierValues=FS,s.updateFormIdentifiers=fS,s.updateFormRevision=qS,s.updateFormRevisionAttachment=MS,s.updateFormRevisionAttachments=oo,s.updateFormRevisions=zS,s.updateFormSubmission=Co,s.updateFormSubmissionAttachment=YS,s.updateFormSubmissionAttachments=wo,s.updateFormSubmissions=XS,s.updateForms=GS,s.updateGeoImage=Wo,s.updateGeoImages=xS,s.updateIssue=Gt,s.updateIssueAssociation=xo,s.updateIssueAssociations=iT,s.updateIssueAttachment=rT,s.updateIssueAttachments=rl,s.updateIssueComment=pT,s.updateIssueCommentAttachment=oT,s.updateIssueCommentAttachments=fl,s.updateIssueComments=yT,s.updateIssueType=vh,s.updateIssueTypeAttachment=_T,s.updateIssueTypeAttachments=Cl,s.updateIssueTypeFieldValues=ft,s.updateIssueTypeFieldValuesAttachment=QT,s.updateIssueTypeFieldValuesAttachments=lh,s.updateIssueTypeFieldValuesMany=CT,s.updateIssueTypeFields=ch,s.updateIssueTypeFieldsAttachment=MT,s.updateIssueTypeFieldsAttachments=Kl,s.updateIssueTypeFieldsMany=LT,s.updateIssueTypeIdentifier=St,s.updateIssueTypeIdentifierValue=Tt,s.updateIssueTypeIdentifierValues=oI,s.updateIssueTypeIdentifiers=aI,s.updateIssueTypes=AI,s.updateIssueUpdate=FI,s.updateIssueUpdates=PI,s.updateIssues=IT,s.updateOrganization=im,s.updateOrganizationAccess=Kt,s.updateOrganizationAccesses=UI,s.updateOrganizations=LI,s.updateProject=$m,s.updateProjectAccess=gt,s.updateProjectAccesses=pm,s.updateProjectAttachment=sg,s.updateProjectAttachments=gm,s.updateProjectFile=Vc,s.updateProjectFiles=ng,s.updateProjects=mg,s.updateTeam=ap,s.updateTeamMembership=Ig,s.updateTeamMemberships=gg,s.updateTeams=Og,s.updateUser=wI,s.updateUsers=vI,s.useSelectorBuilder=jg,s.userReducer=Hh,s.userSlice=mc,s.uuidObj=F,s.versioningReducer=dp,s.versioningSlice=rp,Object.defineProperty(s,Symbol.toStringTag,{value:"Module"})});
|