@overmap-ai/core 1.0.78-workflows-2.9 → 1.0.78-workflows-2.10
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.
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
(function(i,U){typeof exports=="object"&&typeof module<"u"?U(exports,require("@redux-offline/redux-offline/lib/types"),require("@reduxjs/toolkit"),require("superagent"),require("uuid"),require("react"),require("file-saver"),require("fast-tree-builder"),require("ts-tree-lib"),require("@redux-offline/redux-offline"),require("@redux-offline/redux-offline/lib/defaults"),require("localforage"),require("redux-persist-migrate"),require("buffer"),require("@overmap-ai/forms"),require("idb"),require("jwt-decode"),require("dependency-graph"),require("@tiptap/core")):typeof define=="function"&&define.amd?define(["exports","@redux-offline/redux-offline/lib/types","@reduxjs/toolkit","superagent","uuid","react","file-saver","fast-tree-builder","ts-tree-lib","@redux-offline/redux-offline","@redux-offline/redux-offline/lib/defaults","localforage","redux-persist-migrate","buffer","@overmap-ai/forms","idb","jwt-decode","dependency-graph","@tiptap/core"],U):(i=typeof globalThis<"u"?globalThis:i||self,U(i["overmap-core"]={},null,i.toolkit,i.request,i.uuid,i.react,i.fileSaver,i.buildTree,i.tsTreeLib,i.reduxOffline,i.offlineConfig,i.localforage,i.createMigration,null,null,i.idb,i.jwtDecode,i.dependencyGraph))})(this,function(i,U,o,wt,ot,Ig,Og,Va,jt,Fg,Ba,_g,gg,sk,ik,Pg,bg,Rg){"use strict";var ek=Object.defineProperty;var tk=(i,U,o)=>U in i?ek(i,U,{enumerable:!0,configurable:!0,writable:!0,value:o}):i[U]=o;var m=(i,U,o)=>tk(i,typeof U!="symbol"?U+"":U,o);var wg;const Wa=Object.freeze([]),za=Object.freeze({});var qa=(t=>(t[t.GUEST=0]="GUEST",t[t.BASIC=2]="BASIC",t[t.ADMIN=4]="ADMIN",t))(qa||{}),h=(t=>(t.GET="GET",t.POST="POST",t.PATCH="PATCH",t.PUT="PUT",t.DELETE="DELETE",t))(h||{}),Da=(t=>(t[t.PLANNED=0]="PLANNED",t[t.ACTIVE=1]="ACTIVE",t[t.MAINTENANCE=2]="MAINTENANCE",t[t.INACTIVE=3]="INACTIVE",t[t.RETIRED=4]="RETIRED",t[t.DISPOSED=5]="DISPOSED",t))(Da||{}),ja=(t=>(t.Issue="issue",t.Asset="asset",t.AssetType="asset_type",t.Project="project",t.Document="document",t))(ja||{}),ps=(t=>(t[t.LOWEST=0]="LOWEST",t[t.LOW=2]="LOW",t[t.MEDIUM=4]="MEDIUM",t[t.HIGH=6]="HIGH",t[t.HIGHEST=8]="HIGHEST",t))(ps||{}),$=(t=>(t.STATUS="status",t.PRIORITY="priority",t.DESCRIPTION="description",t.TITLE="title",t.ASSIGNED_TO="assigned_to",t.DUE_DATE="due_date",t))($||{}),$a=(t=>(t[t.BACKLOG=0]="BACKLOG",t[t.PLANNED=1]="PLANNED",t[t.IN_PROGRESS=2]="IN_PROGRESS",t[t.COMPLETED=3]="COMPLETED",t[t.CANCELLED=4]="CANCELLED",t))($a||{}),Ca=(t=>(t[t.ADD_ASSIGNEE=0]="ADD_ASSIGNEE",t[t.REMOVE_ASSIGNEE=2]="REMOVE_ASSIGNEE",t[t.ADD_REVIEWER=4]="ADD_REVIEWER",t[t.REMOVE_REVIEWER=6]="REMOVE_REVIEWER",t[t.ADD_REVIEW_REQUEST=8]="ADD_REVIEW_REQUEST",t[t.REMOVE_REVIEW_REQUEST=10]="REMOVE_REVIEW_REQUEST",t))(Ca||{}),Pt=(t=>(t[t.ACTIVE=0]="ACTIVE",t[t.COMPLETED=2]="COMPLETED",t[t.CANCELLED=4]="CANCELLED",t))(Pt||{}),bt=(t=>(t[t.APPROVED=0]="APPROVED",t[t.REJECTED=2]="REJECTED",t[t.CHANGES_REQUESTED=4]="CHANGES_REQUESTED",t))(bt||{});const Mg=ps.MEDIUM,Ua=6e4,kg=[bt.APPROVED,bt.REJECTED,bt.CHANGES_REQUESTED],Eg=[Pt.ACTIVE,Pt.COMPLETED,Pt.CANCELLED];function F(t){return{addOne:(p,y)=>{const f=t(y.payload);p.instances[f]=y.payload},addMany:(p,y)=>{for(const f of y.payload){const T=t(f);p.instances[T]=f}},setOne:(p,y)=>{const f=t(y.payload);p.instances[f]=y.payload},setMany:(p,y)=>{for(const f of y.payload){const T=t(f);p.instances[T]=f}},updateOne:(p,y)=>{const f=t(y.payload);p.instances[f]=y.payload},updateMany:(p,y)=>{for(const f of y.payload){const T=t(f);p.instances[T]=f}},deleteOne:(p,y)=>{delete p.instances[y.payload]},deleteMany:(p,y)=>{for(const f of y.payload)delete p.instances[f]},initialize:(p,y)=>{p.instances={};const f=new Set;for(const T of y.payload){const P=t(T);f.add(P),p.instances[P]=T}f.size!==y.payload.length&&console.warn("duplicate ids detected when initializing model instances.")}}}function vg(){return{initializeSelection:(l,u)=>{l.selection=Array.from(new Set(u.payload))},selectOne:(l,u)=>{new Set(l.selection).has(u.payload)||l.selection.push(u.payload)},selectMany:(l,u)=>{const p=new Set(l.selection);for(const y of u.payload)p.has(y)||p.add(y);l.selection=Array.from(p)},unselectOne:(l,u)=>{const p=new Set(l.selection);p.has(u.payload)&&(p.delete(u.payload),l.selection=Array.from(p))},unselectMany:(l,u)=>{const p=new Set(l.selection);for(const y of u.payload)p.has(y)&&p.delete(y);l.selection=Array.from(p)},toggleOne:(l,u)=>{const p=new Set(l.selection);p.has(u.payload)?p.delete(u.payload):p.add(u.payload),l.selection=Array.from(p)},toggleMany:(l,u)=>{const p=new Set(l.selection);for(const y of u.payload)p.has(y)?p.delete(y):p.add(y);l.selection=Array.from(p)},getInitialState:l=>({...l,selection:[]})}}const Rt="versioning",I=o.createAction("RESET"),B=o.createAction("RESET_PROJECT_STATE"),_=o.createAction("RESET_ORGANIZATION_STATE");function Vg(t,s){return Ig.useMemo(t,s)}wg=Symbol.toStringTag;class ms{constructor(){m(this,wg,"Promise");m(this,"_promise");m(this,"_resolve");m(this,"_reject");m(this,"_state","pending");this._resolve=null,this._reject=null,this._promise=new Promise((s,e)=>{this._resolve=s,this._reject=e})}get state(){return this._state}then(s,e){return this._promise.then(s,e)}catch(s){return this._promise.catch(s)}resolve(s){if(!this._resolve)throw new Error("No resolve callback");this._resolve(s),this._state="fulfilled"}reject(s){if(!this._reject)throw s;this._reject(s),this._state="rejected"}finally(s){throw new Error("`finally` not implemented")}}let ys=!1;["true","1"].includes("".toLowerCase())&&(ys=!0);function Bg(t,s){if(t===s)return!0;if(typeof t!=typeof s)return!1;const e=Object.keys(t),n=Object.keys(s),a=e.length;if(a!==n.length)return!1;for(let c=0;c<a;c++){const r=e[c];if(!Object.prototype.hasOwnProperty.call(s,r)||t[r]!==s[r])return!1}return!0}function fs(t){const s={};return function(){const e=Array.prototype.slice.call(arguments);return e in s?(ys&&console.debug(`Memoization debug: Using memorized return value for ${t.toString()}(`,e,")"),s[e]):(ys&&console.debug(`Memoization debug: Cache miss! Memoizing ${t.toString()}(`,e,")"),s[e]=t.apply(this,e))}}function Wg(t,s){if(t.length!==s.length)return!1;for(let e=0;e<t.length;e++)if(t[e]!==s[e])return!1;return!0}const A=t=>t.length===0?Wa:t,$t=t=>Object.keys(t).length===0?za:t,La=fs(t=>{if(!t)return"";const s=new Date(t),e=s.getFullYear()===Ss.getFullYear(),n={day:"numeric",month:"short"};return e||(n.year="numeric"),s.toLocaleDateString([],n)}),zg=new Intl.RelativeTimeFormat([],{style:"long",numeric:"auto"}),qg=1e3*86400,Ss=new Date,Dg=t=>new Date(t).toDateString()===Ss.toDateString(),jg=fs((t,s,e)=>{const n=Math.round((new Date(t).getTime()-Ss.getTime())/qg);return n<s||n>e?La(t):zg.format(n,"days")});function $g(t){return new Uint8Array(t).reduce((e,n)=>e+n.toString(16).padStart(2,"0"),"")}function Ct(t){return new Promise((s,e)=>{const n=new FileReader;n.onload=()=>{const a=n.result;if(!a){e(new Error("FileReader did not return a valid ArrayBuffer."));return}crypto.subtle.digest("SHA-1",a).then(c=>{const r=$g(c);s(r)})},n.readAsArrayBuffer(t)})}const Cg=(t,s)=>`${t}${s?`.${s}`:""}`;function Ug(t,s){return new File([t],s,{type:t.type})}function Na(t){const s=t.name;return s.includes(".")?s.split(".").pop():""}const Ga=async t=>(await fetch(t)).blob(),Ha=async(t,s)=>{const e=await Ga(t);return new File([e],s,{type:e.type})};function Lg(t){const s=new Blob([t]);Og.saveAs(s,t.name)}function Ka(t){return typeof t=="string"&&t.startsWith("blob:")}function Ng(t){return t.type.startsWith("image/")}const Ya={};function Gg(t,s,e,...n){const a=Ya[t];let c=!1;a?a[s]||(a[s]=!0,c=!0):(Ya[t]={[s]:!0},c=!0),c&&console[e](...n)}const Ja=["created_at","updated_at","index","revision"];function O(t){return{...t,uuid:ot.v4()}}function Hg(t){const s={};for(const e of t)s[e.uuid]=e;return s}function V(t){return t.map(({uuid:s})=>s)}function Ut(t,s){return t.localeCompare(s)}function As(t,s){return Ut(t.uuid,s.uuid)}function Kg(t,s=void 0,e=255){let n=t.replace(/[^a-z0-9_\-.]/gi,"_").replace(/_{2,}/g,"_");if(!s){const c=t.split(".");c.length>1&&(s=c[c.length-1])}s&&!s.startsWith(".")&&(s="."+s);const a=s?s.length:0;return n.length+a>e&&(n=n.slice(0,e-a)+(s||"")),n}function Yg(t){return t.toLowerCase().replace(" ","-")}function Jg(t,s=!1){return t.normalize("NFKD").toLowerCase().replace(/[^\w\s-]/g,"").trim().replace(/[-\s]+/g,s?"_":"-")}function Zg(t,s){if(t.length<=s)return t;const e=t.slice(0,s-1);return e.slice(0,e.lastIndexOf(" "))+"…"}const Qg=/^.+@.+\..+$/;function R(t){const s={...t};for(const e of[...Ja,"created_by"])e in s&&delete s[e];return s}const Za=t=>{const s=t.toSorted((e,n)=>e.order-n.order);return Va(s,{id:e=>e.uuid,parentId:e=>e.parent,includeEmptyChildrenArray:!0,valueKey:!1})},Xg=t=>{const{roots:s}=Za(t);return s.map(e=>new jt.Tree(e))},Qa=(t,s)=>{const{nodes:e}=Za(s),n=e.get(t);if(!n)throw new Error(`Node with uuid ${t} does not exist in asset procedure step tree.`);return new jt.Tree(n)},Xa=(t,s)=>t.type!==s.type?t.type-s.type:t.order-s.order,xa=(t,s)=>t.type!==s.type?t.type-s.type:t.order-s.order,ec=t=>Va(t,{id:s=>s.uuid,parentId:s=>s.parent_document,includeEmptyChildrenArray:!0,valueKey:!1}),xg=t=>{const{roots:s}=ec(t);return s.map(e=>new jt.Tree(e))},tc=(t,s)=>{const{nodes:e}=ec(s),n=e.get(t);if(!n)throw new Error(`Node with uuid ${t} does not exist in document tree.`);return new jt.Tree(n)};class eP{constructor(s){m(this,"operations",[]);m(this,"getData");this.getData=s}performOperations(s){let e=s;for(const n of this.operations)e=n(e);return e}filter(s,e){return this.operations.push(n=>n.filter(a=>a[s]===e)),this}exclude(s,e){return this.operations.push(n=>n.filter(a=>a[s]!==e)),this}orderBy(s){return this.operations.push(e=>[...e].sort((n,a)=>n[s]<=a[s]?1:-1)),this}reverse(){return this.operations.push(s=>[...s].reverse()),this}all(){return this.operations.push(s=>s),this}get(s,e){return o.createSelector([this.getData],n=>this.performOperations(n).find(a=>a[s]===e))}count(){return o.createSelector([this.getData],s=>this.performOperations(s).length)}first(){return o.createSelector([this.getData],s=>this.performOperations(s)[0])}last(){return o.createSelector([this.getData],s=>{const e=this.performOperations(s);return e[e.length-1]})}exists(){return o.createSelector([this.getData],s=>this.performOperations(s).length>0)}toSelector(){return o.createSelector([this.getData],s=>A(this.performOperations(s)))}}const S=t=>(...s)=>e=>t(e,...s),N=F(t=>t.uuid),sc={instances:{}},ws=o.createSlice({name:"agents",initialState:sc,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,sc)),reducers:{initializeConversations:N.initialize,addConversation:N.addOne,addConversations:N.addMany,setConversation:N.setOne,setConversations:N.setMany,updateConversation:N.updateOne,updateConversations:N.updateMany,deleteConversation:N.deleteOne,deleteConversations:N.deleteMany}}),{initializeConversations:ic,addConversation:nc,addConversations:tP,setConversation:ac,setConversations:sP,updateConversation:cc,updateConversations:iP,deleteConversation:nP,deleteConversations:aP}=ws.actions,Ts=t=>t.agentsReducer.instances,cP=o.createSelector([Ts],t=>Object.values(t)),rP=S(o.createSelector([Ts,(t,s)=>s],(t,s)=>t[s])),rc=ws.reducer,G=F(t=>t.uuid),dc={instances:{}},Is=o.createSlice({name:"assetAttachments",initialState:dc,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,dc)),reducers:{initializeAssetAttachments:G.initialize,addAssetAttachment:G.addOne,addAssetAttachments:G.addMany,setAssetAttachment:G.setOne,setAssetAttachments:G.setMany,updateAssetAttachment:G.updateOne,updateAssetAttachments:G.updateMany,deleteAssetAttachment:G.deleteOne,deleteAssetAttachments:G.deleteMany}}),{initializeAssetAttachments:lc,addAssetAttachment:uc,addAssetAttachments:Os,setAssetAttachment:oc,setAssetAttachments:hc,updateAssetAttachment:pc,updateAssetAttachments:mc,deleteAssetAttachment:yc,deleteAssetAttachments:Fs}=Is.actions,fc=t=>t.assetAttachmentReducer.instances,_s=o.createSelector([fc],t=>Object.values(t)),Sc=t=>s=>s.assetAttachmentReducer.instances[t],Ac=S(o.createSelector([_s,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),wc=S(o.createSelector([_s,(t,s)=>s],(t,s)=>A(t.filter(({asset:e})=>s===e)))),Tc=Is.reducer,H=F(({uuid:t})=>t),Ic={instances:{}},gs=o.createSlice({name:"assetProcedureTypeAttachments",initialState:Ic,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,Ic)),reducers:{initializeAssetProcedureTypeAttachments:H.initialize,addAssetProcedureTypeAttachment:H.addOne,addAssetProcedureTypeAttachments:H.addMany,setAssetProcedureTypeAttachment:H.setOne,setAssetProcedureTypeAttachments:H.setMany,updateAssetProcedureTypeAttachment:H.updateOne,updateAssetProcedureTypeAttachments:H.updateMany,deleteAssetProcedureTypeAttachment:H.deleteOne,deleteAssetProcedureTypeAttachments:H.deleteMany}}),{initializeAssetProcedureTypeAttachments:Oc,addAssetProcedureTypeAttachment:Fc,addAssetProcedureTypeAttachments:_c,setAssetProcedureTypeAttachment:gc,setAssetProcedureTypeAttachments:Pc,updateAssetProcedureTypeAttachment:bc,updateAssetProcedureTypeAttachments:Rc,deleteAssetProcedureTypeAttachment:Mc,deleteAssetProcedureTypeAttachments:kc}=gs.actions,Ec=gs.reducer,vc=t=>t.assetProcedureTypeAttachmentReducer.instances,Ps=o.createSelector([vc],t=>Object.values(t)),Vc=t=>s=>s.assetProcedureTypeAttachmentReducer.instances[t],Bc=S(o.createSelector([Ps,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),dP=S(o.createSelector([Ps,(t,s)=>s],(t,s)=>A(t.filter(({asset_procedure_type:e})=>s===e)))),K=F(({uuid:t})=>t),Wc={instances:{}},bs=o.createSlice({name:"assetProcedureTypeFieldsAttachments",initialState:Wc,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,Wc)),reducers:{initializeAssetProcedureTypeFieldsAttachments:K.initialize,addAssetProcedureTypeFieldsAttachment:K.addOne,addAssetProcedureTypeFieldsAttachments:K.addMany,setAssetProcedureTypeFieldsAttachment:K.setOne,setAssetProcedureTypeFieldsAttachments:K.setMany,updateAssetProcedureTypeFieldsAttachment:K.updateOne,updateAssetProcedureTypeFieldsAttachments:K.updateMany,deleteAssetProcedureTypeFieldsAttachment:K.deleteOne,deleteAssetProcedureTypeFieldsAttachments:K.deleteMany}}),{initializeAssetProcedureTypeFieldsAttachments:zc,addAssetProcedureTypeFieldsAttachment:qc,addAssetProcedureTypeFieldsAttachments:Dc,setAssetProcedureTypeFieldsAttachment:jc,setAssetProcedureTypeFieldsAttachments:$c,updateAssetProcedureTypeFieldsAttachment:Cc,updateAssetProcedureTypeFieldsAttachments:Uc,deleteAssetProcedureTypeFieldsAttachment:Lc,deleteAssetProcedureTypeFieldsAttachments:Nc}=bs.actions,Gc=bs.reducer,Hc=t=>t.assetProcedureTypeFieldsAttachmentReducer.instances,Rs=o.createSelector([Hc],t=>Object.values(t)),lP=S(o.createSelector([Rs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.fields_revision===s)))),Kc=t=>s=>s.assetProcedureTypeFieldsAttachmentReducer.instances[t],Yc=S(o.createSelector([Rs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Y=F(({uuid:t})=>t),Jc={instances:{}},Ms=o.createSlice({name:"assetProcedureTypeFields",initialState:Jc,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,Jc)),reducers:{initializeAssetProcedureTypeFields:Y.initialize,addAssetProcedureTypeFields:Y.addOne,addAssetProcedureTypeFieldsMany:Y.addMany,setAssetProcedureTypeFields:Y.setOne,setAssetProcedureTypeFieldsMany:Y.setMany,updateAssetProcedureTypeFields:Y.updateOne,updateAssetProcedureTypeFieldsMany:Y.updateMany,deleteAssetProcedureTypeFields:Y.deleteOne,deleteAssetProcedureTypeFieldsMany:Y.deleteMany}}),{initializeAssetProcedureTypeFields:Zc,addAssetProcedureTypeFields:Qc,addAssetProcedureTypeFieldsMany:Xc,setAssetProcedureTypeFields:xc,setAssetProcedureTypeFieldsMany:er,updateAssetProcedureTypeFields:tr,updateAssetProcedureTypeFieldsMany:sr,deleteAssetProcedureTypeFields:ir,deleteAssetProcedureTypeFieldsMany:nr}=Ms.actions,ar=Ms.reducer,cr=t=>t.assetProcedureTypeFieldsReducer.instances,Lt=o.createSelector([cr],t=>Object.values(t)),uP=S(o.createSelector([Lt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure_type===s)))),oP=S(o.createSelector([Lt,(t,s)=>s],(t,s)=>t.filter(e=>e.asset_procedure_type===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),rr=t=>s=>s.assetProcedureTypeFieldsReducer.instances[t],dr=S(o.createSelector([Lt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),J=F(({uuid:t})=>t),lr={instances:{}},ks=o.createSlice({name:"assetProcedureTypeFieldValuesAttachments",initialState:lr,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,lr)),reducers:{initializeAssetProcedureTypeFieldValuesAttachments:J.initialize,addAssetProcedureTypeFieldValuesAttachment:J.addOne,addAssetProcedureTypeFieldValuesAttachments:J.addMany,setAssetProcedureTypeFieldValuesAttachment:J.setOne,setAssetProcedureTypeFieldValuesAttachments:J.setMany,updateAssetProcedureTypeFieldValuesAttachment:J.updateOne,updateAssetProcedureTypeFieldValuesAttachments:J.updateMany,deleteAssetProcedureTypeFieldValuesAttachment:J.deleteOne,deleteAssetProcedureTypeFieldValuesAttachments:J.deleteMany}}),{initializeAssetProcedureTypeFieldValuesAttachments:ur,addAssetProcedureTypeFieldValuesAttachment:or,addAssetProcedureTypeFieldValuesAttachments:Es,setAssetProcedureTypeFieldValuesAttachment:hr,setAssetProcedureTypeFieldValuesAttachments:pr,updateAssetProcedureTypeFieldValuesAttachment:mr,updateAssetProcedureTypeFieldValuesAttachments:yr,deleteAssetProcedureTypeFieldValuesAttachment:fr,deleteAssetProcedureTypeFieldValuesAttachments:vs}=ks.actions,Sr=ks.reducer,Ar=t=>t.assetProcedureTypeFieldValuesAttachmentReducer.instances,Vs=o.createSelector([Ar],t=>Object.values(t)),wr=t=>s=>s.assetProcedureTypeFieldValuesAttachmentReducer.instances[t],Tr=S(o.createSelector([Vs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Ir=S(o.createSelector([Vs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),Z=F(({uuid:t})=>t),Or={instances:{}},Bs=o.createSlice({name:"assetProcedureTypeFieldValues",initialState:Or,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,Or)),reducers:{initializeAssetProcedureTypeFieldValues:Z.initialize,addAssetProcedureTypeFieldValues:Z.addOne,addAssetProcedureTypeFieldValuesMany:Z.addMany,setAssetProcedureTypeFieldValues:Z.setOne,setAssetProcedureTypeFieldValuesMany:Z.setMany,updateAssetProcedureTypeFieldValues:Z.updateOne,updateAssetProcedureTypeFieldValuesMany:Z.updateMany,deleteAssetProcedureTypeFieldValues:Z.deleteOne,deleteAssetProcedureTypeFieldValuesMany:Z.deleteMany}}),{initializeAssetProcedureTypeFieldValues:Fr,addAssetProcedureTypeFieldValues:_r,addAssetProcedureTypeFieldValuesMany:gr,setAssetProcedureTypeFieldValues:Pr,setAssetProcedureTypeFieldValuesMany:br,updateAssetProcedureTypeFieldValues:Rr,updateAssetProcedureTypeFieldValuesMany:Mr,deleteAssetProcedureTypeFieldValues:kr,deleteAssetProcedureTypeFieldValuesMany:Er}=Bs.actions,vr=Bs.reducer,Vr=t=>t.assetProcedureTypeFieldValuesReducer.instances,Nt=o.createSelector([Vr],t=>Object.values(t)),hP=S(o.createSelector([Nt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset===s)))),pP=S(o.createSelector([Nt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure===s)))),Br=t=>s=>s.assetProcedureTypeFieldValuesReducer.instances[t],Wr=S(o.createSelector([Nt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Q=F(({uuid:t})=>t),zr={instances:{}},Ws=o.createSlice({name:"assetProcedures",initialState:zr,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,zr)),reducers:{initializeAssetProcedures:Q.initialize,addAssetProcedure:Q.addOne,addAssetProcedures:Q.addMany,setAssetProcedure:Q.setOne,setAssetProcedures:Q.setMany,updateAssetProcedure:Q.updateOne,updateAssetProcedures:Q.updateMany,deleteAssetProcedure:Q.deleteOne,deleteAssetProcedures:Q.deleteMany}}),{initializeAssetProcedures:qr,addAssetProcedure:Dr,addAssetProcedures:zs,updateAssetProcedure:jr,updateAssetProcedures:$r,deleteAssetProcedure:Cr,deleteAssetProcedures:qs,setAssetProcedure:Ur,setAssetProcedures:Lr}=Ws.actions,Nr=Ws.reducer,Gr=t=>t.assetProcedureReducer.instances,Gt=o.createSelector([Gr],t=>Object.values(t)),Hr=S(o.createSelector([Gt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure_type===s)))),mP=S(o.createSelector([Gt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_type===s)))),Kr=t=>s=>s.assetProcedureReducer.instances[t],Yr=S(o.createSelector([Gt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),X=F(t=>t.uuid),Jr={instances:{}},Ds=o.createSlice({name:"assetProcedureTypes",initialState:Jr,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,Jr)),reducers:{initializeAssetProcedureTypes:X.initialize,addAssetProcedureType:X.addOne,addAssetProcedureTypes:X.addMany,setAssetProcedureType:X.setOne,setAssetProcedureTypes:X.setMany,updateAssetProcedureType:X.updateOne,updateAssetProcedureTypes:X.updateMany,deleteAssetProcedureType:X.deleteOne,deleteAssetProcedureTypes:X.deleteMany}}),{initializeAssetProcedureTypes:Zr,addAssetProcedureType:Qr,addAssetProcedureTypes:Xr,updateAssetProcedureType:xr,updateAssetProcedureTypes:ed,deleteAssetProcedureType:td,deleteAssetProcedureTypes:sd,setAssetProcedureType:id,setAssetProcedureTypes:nd}=Ds.actions,ad=Ds.reducer,cd=t=>t.assetProcedureTypeReducer.instances,js=o.createSelector([cd],t=>Object.values(t)),rd=t=>s=>s.assetProcedureTypeReducer.instances[t],dd=S(o.createSelector([js,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),yP=S(o.createSelector([js,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),x=F(t=>t.uuid),ld={instances:{}},$s=o.createSlice({name:"assetProcedureStepFieldsAttachments",initialState:ld,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,ld)),reducers:{initializeAssetProcedureStepFieldsAttachments:x.initialize,addAssetProcedureStepFieldsAttachment:x.addOne,addAssetProcedureStepFieldsAttachments:x.addMany,setAssetProcedureStepFieldsAttachment:x.setOne,setAssetProcedureStepFieldsAttachments:x.setMany,updateAssetProcedureStepFieldsAttachment:x.updateOne,updateAssetProcedureStepFieldsAttachments:x.updateMany,deleteAssetProcedureStepFieldsAttachment:x.deleteOne,deleteAssetProcedureStepFieldsAttachments:x.deleteMany}}),{initializeAssetProcedureStepFieldsAttachments:ud,addAssetProcedureStepFieldsAttachment:od,addAssetProcedureStepFieldsAttachments:hd,setAssetProcedureStepFieldsAttachment:pd,setAssetProcedureStepFieldsAttachments:md,updateAssetProcedureStepFieldsAttachment:yd,updateAssetProcedureStepFieldsAttachments:fd,deleteAssetProcedureStepFieldsAttachment:Sd,deleteAssetProcedureStepFieldsAttachments:Ad}=$s.actions,wd=t=>t.assetProcedureStepFieldsAttachmentReducer.instances,Cs=o.createSelector([wd],t=>Object.values(t)),fP=S(o.createSelector([Cs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.fields_revision===s)))),Td=t=>s=>s.assetProcedureStepFieldsAttachmentReducer.instances[t],Id=S(o.createSelector([Cs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Od=$s.reducer,ee=F(t=>t.uuid),Fd={instances:{}},Us=o.createSlice({name:"assetProcedureStepFields",initialState:Fd,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,Fd)),reducers:{initializeAssetProcedureStepFields:ee.initialize,addAssetProcedureStepFields:ee.addOne,addAssetProcedureStepFieldsMany:ee.addMany,setAssetProcedureStepFields:ee.setOne,setAssetProcedureStepFieldsMany:ee.setMany,updateAssetProcedureStepFields:ee.updateOne,updateAssetProcedureStepFieldsMany:ee.updateMany,deleteAssetProcedureStepFields:ee.deleteOne,deleteAssetProcedureStepFieldsMany:ee.deleteMany}}),{initializeAssetProcedureStepFields:_d,addAssetProcedureStepFields:gd,addAssetProcedureStepFieldsMany:Pd,setAssetProcedureStepFields:bd,setAssetProcedureStepFieldsMany:Rd,updateAssetProcedureStepFields:Md,updateAssetProcedureStepFieldsMany:kd,deleteAssetProcedureStepFields:Ed,deleteAssetProcedureStepFieldsMany:vd}=Us.actions,Ls=t=>t.assetProcedureStepFieldsReducer.instances,Ht=o.createSelector([Ls],t=>Object.values(t)),SP=S(o.createSelector([Ht,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure_step===s)))),AP=S(o.createSelector([Ht,(t,s)=>s],(t,s)=>t.filter(e=>e.asset_procedure_step===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),wP=o.createSelector([Ls],t=>{const s={};for(const e of Object.values(t)){const n=s[e.asset_procedure_step];(!n||n.submitted_at<e.submitted_at)&&(s[e.asset_procedure_step]=e)}return s}),Vd=t=>s=>s.assetProcedureStepFieldsReducer.instances[t],Bd=S(o.createSelector([Ht,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Wd=Us.reducer,te=F(t=>t.uuid),zd={instances:{}},Ns=o.createSlice({name:"assetProcedureStepFieldValuesAttachments",initialState:zd,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,zd)),reducers:{initializeAssetProcedureStepFieldValuesAttachments:te.initialize,addAssetProcedureStepFieldValuesAttachment:te.addOne,addAssetProcedureStepFieldValuesAttachments:te.addMany,setAssetProcedureStepFieldValuesAttachment:te.setOne,setAssetProcedureStepFieldValuesAttachments:te.setMany,updateAssetProcedureStepFieldValuesAttachment:te.updateOne,updateAssetProcedureStepFieldValuesAttachments:te.updateMany,deleteAssetProcedureStepFieldValuesAttachment:te.deleteOne,deleteAssetProcedureStepFieldValuesAttachments:te.deleteMany}}),{initializeAssetProcedureStepFieldValuesAttachments:qd,addAssetProcedureStepFieldValuesAttachment:Dd,addAssetProcedureStepFieldValuesAttachments:Gs,setAssetProcedureStepFieldValuesAttachment:jd,setAssetProcedureStepFieldValuesAttachments:$d,updateAssetProcedureStepFieldValuesAttachment:Cd,updateAssetProcedureStepFieldValuesAttachments:Ud,deleteAssetProcedureStepFieldValuesAttachment:Ld,deleteAssetProcedureStepFieldValuesAttachments:Hs}=Ns.actions,Nd=t=>t.assetProcedureStepFieldValuesAttachmentReducer.instances,Ks=o.createSelector([Nd],t=>Object.values(t)),Gd=t=>s=>s.assetProcedureStepFieldValuesAttachmentReducer.instances[t],Hd=S(o.createSelector([Ks,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Kd=S(o.createSelector([Ks,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),Yd=Ns.reducer,se=F(t=>t.uuid),Jd={instances:{}},Ys=o.createSlice({name:"assetProcedureStepFieldValues",initialState:Jd,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,Jd)),reducers:{initializeAssetProcedureStepFieldValues:se.initialize,addAssetProcedureStepFieldValues:se.addOne,addAssetProcedureStepFieldValuesMany:se.addMany,setAssetProcedureStepFieldValues:se.setOne,setAssetProcedureStepFieldValuesMany:se.setMany,updateAssetProcedureStepFieldValues:se.updateOne,updateAssetProcedureStepFieldValuesMany:se.updateMany,deleteAssetProcedureStepFieldValues:se.deleteOne,deleteAssetProcedureStepFieldValuesMany:se.deleteMany}}),{initializeAssetProcedureStepFieldValues:Zd,addAssetProcedureStepFieldValues:Qd,addAssetProcedureStepFieldValuesMany:Xd,setAssetProcedureStepFieldValues:xd,setAssetProcedureStepFieldValuesMany:el,updateAssetProcedureStepFieldValues:tl,updateAssetProcedureStepFieldValuesMany:sl,deleteAssetProcedureStepFieldValues:il,deleteAssetProcedureStepFieldValuesMany:nl}=Ys.actions,al=t=>t.assetProcedureStepFieldValuesReducer.instances,Mt=o.createSelector([al],t=>Object.values(t)),TP=S(o.createSelector([Mt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset===s)))),IP=S(o.createSelector([Mt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure===s)))),OP=S(o.createSelector([Mt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure_step===s)))),cl=t=>s=>s.assetProcedureStepFieldValuesReducer.instances[t],rl=S(o.createSelector([Mt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),dl=Ys.reducer,ie=F(t=>t.uuid),ll={instances:{}},Js=o.createSlice({name:"assetProcedureSteps",initialState:ll,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,ll)),reducers:{initializeAssetProcedureSteps:ie.initialize,setAssetProcedureStep:ie.setOne,setAssetProcedureSteps:ie.setMany,addAssetProcedureStep:ie.addOne,addAssetProcedureSteps:ie.addMany,updateAssetProcedureStep:ie.updateOne,updateAssetProcedureSteps:ie.updateMany,deleteAssetProcedureStep:ie.deleteOne,deleteAssetProcedureSteps:ie.deleteMany}}),{initializeAssetProcedureSteps:ul,setAssetProcedureStep:ol,setAssetProcedureSteps:hl,addAssetProcedureStep:pl,addAssetProcedureSteps:ml,updateAssetProcedureStep:yl,updateAssetProcedureSteps:fl,deleteAssetProcedureStep:Sl,deleteAssetProcedureSteps:Al}=Js.actions,wl=Js.reducer,Kt=t=>t.assetProcedureStepReducer.instances,Tl=t=>s=>s.assetProcedureStepReducer.instances[t],Zs=o.createSelector([Kt],t=>Object.values(t)),FP=S(o.createSelector([Kt,(t,s)=>s],(t,s)=>{const e={};for(const[n,a]of Object.entries(t))a.asset_procedure_type===s&&(e[n]=a);return $t(e)})),_P=S(o.createSelector([Zs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure_type===s)))),Il=S(o.createSelector([Zs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Ol=S(o.createSelector([Kt,(t,s)=>s],(t,s)=>{if(!t[s])return A([]);const a=Qa(s,Object.values(t)).all().map(({model:c})=>c);return A(a)})),ne=F(t=>t.uuid),Fl={instances:{}},Qs=o.createSlice({name:"assets",initialState:Fl,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,Fl)),reducers:{initializeAssets:ne.initialize,addAsset:ne.addOne,addAssets:ne.addMany,setAsset:ne.setOne,setAssets:ne.setMany,updateAsset:ne.updateOne,updateAssets:ne.updateMany,deleteAsset:ne.deleteOne,deleteAssets:ne.deleteMany}}),{initializeAssets:_l,addAsset:gl,addAssets:Xs,updateAsset:Pl,updateAssets:bl,deleteAsset:Rl,deleteAssets:xs,setAsset:Ml,setAssets:kl}=Qs.actions,El=t=>t.assetReducer.instances,Yt=o.createSelector([El],t=>A(Object.values(t))),gP=S(o.createSelector([Yt,(t,s)=>s],(t,s)=>A(t.filter(({project:e})=>e===s)))),vl=S(o.createSelector([Yt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_type===s)))),Vl=t=>s=>s.assetReducer.instances[t],Bl=S(o.createSelector([Yt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Wl=Qs.reducer,ae=F(t=>t.uuid),zl={instances:{}},ei=o.createSlice({name:"assetStageCompletions",initialState:zl,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,zl)),reducers:{initializeAssetStageCompletions:ae.initialize,addAssetStageCompletion:ae.addOne,addAssetStageCompletions:ae.addMany,setAssetStageCompletion:ae.setOne,setAssetStageCompletions:ae.setMany,updateAssetStageCompletion:ae.updateOne,updateAssetStageCompletions:ae.updateMany,deleteAssetStageCompletion:ae.deleteOne,deleteAssetStageCompletions:ae.deleteMany}}),{initializeAssetStageCompletions:ql,addAssetStageCompletion:Dl,addAssetStageCompletions:jl,setAssetStageCompletion:$l,setAssetStageCompletions:Cl,updateAssetStageCompletion:Ul,updateAssetStageCompletions:Ll,deleteAssetStageCompletion:Nl,deleteAssetStageCompletions:Gl}=ei.actions,Hl=ei.reducer,Kl=t=>t.assetStageCompletionReducer.instances,Yl=o.createSelector([Kl],t=>Object.values(t)),Jl=t=>s=>s.assetStageCompletionReducer.instances[t],Zl=S(o.createSelector([Yl,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),ce=F(t=>t.uuid),Ql={instances:{}},ti=o.createSlice({name:"assetStages",initialState:Ql,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,Ql)),reducers:{initializeAssetStages:ce.initialize,setAssetStage:ce.setOne,setAssetStages:ce.setMany,addAssetStage:ce.addOne,addAssetStages:ce.addMany,updateAssetStage:ce.updateOne,updateAssetStages:ce.updateMany,deleteAssetStage:ce.deleteOne,deleteAssetStages:ce.deleteMany}}),{initializeAssetStages:Xl,setAssetStage:xl,setAssetStages:eu,addAssetStage:tu,addAssetStages:su,updateAssetStage:iu,updateAssetStages:nu,deleteAssetStage:au,deleteAssetStages:cu}=ti.actions,ru=ti.reducer,si=t=>t.assetStageReducer.instances,du=t=>s=>s.assetStageReducer.instances[t],ii=o.createSelector([si],t=>Object.values(t)),PP=S(o.createSelector([si,(t,s)=>s],(t,s)=>{const e={};for(const[n,a]of Object.entries(t))a.asset_procedure_type===s&&(e[n]=a);return $t(e)})),bP=S(o.createSelector([ii,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure_type===s)))),lu=S(o.createSelector([ii,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),re=F(t=>t.uuid),uu={instances:{}},ni=o.createSlice({name:"assetTypeAttachments",initialState:uu,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,uu)),reducers:{initializeAssetTypeAttachments:re.initialize,addAssetTypeAttachment:re.addOne,addAssetTypeAttachments:re.addMany,setAssetTypeAttachment:re.setOne,setAssetTypeAttachments:re.setMany,updateAssetTypeAttachment:re.updateOne,updateAssetTypeAttachments:re.updateMany,deleteAssetTypeAttachment:re.deleteOne,deleteAssetTypeAttachments:re.deleteMany}}),{initializeAssetTypeAttachments:ou,addAssetTypeAttachment:hu,addAssetTypeAttachments:ai,setAssetTypeAttachment:pu,setAssetTypeAttachments:mu,updateAssetTypeAttachment:yu,updateAssetTypeAttachments:fu,deleteAssetTypeAttachment:Su,deleteAssetTypeAttachments:ci}=ni.actions,Au=t=>t.assetTypeAttachmentReducer.instances,ri=o.createSelector([Au],t=>Object.values(t)),wu=t=>s=>s.assetTypeAttachmentReducer.instances[t],Tu=S(o.createSelector([ri,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Iu=S(o.createSelector([ri,(t,s)=>s],(t,s)=>A(t.filter(({asset_type:e})=>s===e)))),Ou=ni.reducer,de=F(t=>t.uuid),Fu={instances:{}},di=o.createSlice({name:"assetTypeFieldsAttachments",initialState:Fu,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,Fu)),reducers:{initializeAssetTypeFieldsAttachments:de.initialize,addAssetTypeFieldsAttachment:de.addOne,addAssetTypeFieldsAttachments:de.addMany,setAssetTypeFieldsAttachment:de.setOne,setAssetTypeFieldsAttachments:de.setMany,updateAssetTypeFieldsAttachment:de.updateOne,updateAssetTypeFieldsAttachments:de.updateMany,deleteAssetTypeFieldsAttachment:de.deleteOne,deleteAssetTypeFieldsAttachments:de.deleteMany}}),{initializeAssetTypeFieldsAttachments:_u,addAssetTypeFieldsAttachment:gu,addAssetTypeFieldsAttachments:Pu,setAssetTypeFieldsAttachment:bu,setAssetTypeFieldsAttachments:Ru,updateAssetTypeFieldsAttachment:Mu,updateAssetTypeFieldsAttachments:ku,deleteAssetTypeFieldsAttachment:Eu,deleteAssetTypeFieldsAttachments:vu}=di.actions,Vu=t=>t.assetTypeFieldsAttachmentReducer.instances,li=o.createSelector([Vu],t=>Object.values(t)),RP=S(o.createSelector([li,(t,s)=>s],(t,s)=>A(t.filter(e=>e.fields_revision===s)))),Bu=t=>s=>s.assetTypeFieldsAttachmentReducer.instances[t],Wu=S(o.createSelector([li,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),zu=di.reducer,le=F(t=>t.uuid),qu={instances:{}},ui=o.createSlice({name:"assetTypeFields",initialState:qu,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,qu)),reducers:{initializeAssetTypeFields:le.initialize,addAssetTypeFields:le.addOne,addAssetTypeFieldsMany:le.addMany,setAssetTypeFields:le.setOne,setAssetTypeFieldsMany:le.setMany,updateAssetTypeFields:le.updateOne,updateAssetTypeFieldsMany:le.updateMany,deleteAssetTypeFields:le.deleteOne,deleteAssetTypeFieldsMany:le.deleteMany}}),{initializeAssetTypeFields:Du,addAssetTypeFields:ju,addAssetTypeFieldsMany:$u,setAssetTypeFields:Cu,setAssetTypeFieldsMany:Uu,updateAssetTypeFields:Lu,updateAssetTypeFieldsMany:Nu,deleteAssetTypeFields:Gu,deleteAssetTypeFieldsMany:Hu}=ui.actions,Ku=t=>t.assetTypeFieldsReducer.instances,kt=o.createSelector([Ku],t=>Object.values(t)),MP=S(o.createSelector([kt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_type===s)))),kP=S(o.createSelector([kt,(t,s)=>s],(t,s)=>t.filter(e=>e.asset_type===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),Yu=t=>s=>s.assetTypeFieldsReducer.instances[t],Ju=S(o.createSelector([kt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Zu=ui.reducer,ue=F(t=>t.uuid),Qu={instances:{}},oi=o.createSlice({name:"assetTypeFieldValuesAttachments",initialState:Qu,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,Qu)),reducers:{initializeAssetTypeFieldValuesAttachments:ue.initialize,addAssetTypeFieldValuesAttachment:ue.addOne,addAssetTypeFieldValuesAttachments:ue.addMany,setAssetTypeFieldValuesAttachment:ue.setOne,setAssetTypeFieldValuesAttachments:ue.setMany,updateAssetTypeFieldValuesAttachment:ue.updateOne,updateAssetTypeFieldValuesAttachments:ue.updateMany,deleteAssetTypeFieldValuesAttachment:ue.deleteOne,deleteAssetTypeFieldValuesAttachments:ue.deleteMany}}),{initializeAssetTypeFieldValuesAttachments:Xu,addAssetTypeFieldValuesAttachment:xu,addAssetTypeFieldValuesAttachments:hi,setAssetTypeFieldValuesAttachment:eo,setAssetTypeFieldValuesAttachments:to,updateAssetTypeFieldValuesAttachment:so,updateAssetTypeFieldValuesAttachments:io,deleteAssetTypeFieldValuesAttachment:no,deleteAssetTypeFieldValuesAttachments:pi}=oi.actions,ao=t=>t.assetTypeFieldValuesAttachmentReducer.instances,mi=o.createSelector([ao],t=>Object.values(t)),co=t=>s=>s.assetTypeFieldValuesAttachmentReducer.instances[t],ro=S(o.createSelector([mi,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),lo=S(o.createSelector([mi,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),uo=oi.reducer,oe=F(t=>t.uuid),oo={instances:{}},yi=o.createSlice({name:"assetTypeFieldValues",initialState:oo,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,oo)),reducers:{initializeAssetTypeFieldValues:oe.initialize,addAssetTypeFieldValues:oe.addOne,addAssetTypeFieldValuesMany:oe.addMany,setAssetTypeFieldValues:oe.setOne,setAssetTypeFieldValuesMany:oe.setMany,updateAssetTypeFieldValues:oe.updateOne,updateAssetTypeFieldValuesMany:oe.updateMany,deleteAssetTypeFieldValues:oe.deleteOne,deleteAssetTypeFieldValuesMany:oe.deleteMany}}),{initializeAssetTypeFieldValues:ho,addAssetTypeFieldValues:po,addAssetTypeFieldValuesMany:mo,setAssetTypeFieldValues:yo,setAssetTypeFieldValuesMany:fo,updateAssetTypeFieldValues:So,updateAssetTypeFieldValuesMany:Ao,deleteAssetTypeFieldValues:wo,deleteAssetTypeFieldValuesMany:To}=yi.actions,Io=t=>t.assetTypeFieldValuesReducer.instances,Jt=o.createSelector([Io],t=>Object.values(t)),EP=S(o.createSelector([Jt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset===s)))),vP=S(o.createSelector([kt,Jt,(t,s)=>s],(t,s,e)=>{const n=new Set(t.filter(a=>a.asset_type===e).map(a=>a.uuid));return A(s.filter(a=>n.has(a.fields_revision)))})),Oo=t=>s=>s.assetTypeFieldValuesReducer.instances[t],Fo=S(o.createSelector([Jt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),_o=yi.reducer,he=F(t=>t.uuid),go={instances:{}},fi=o.createSlice({name:"assetTypeIdentifiers",initialState:go,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,go)),reducers:{initializeAssetTypeIdentifiers:he.initialize,addAssetTypeIdentifier:he.addOne,addAssetTypeIdentifiers:he.addMany,setAssetTypeIdentifier:he.setOne,setAssetTypeIdentifiers:he.setMany,updateAssetTypeIdentifier:he.updateOne,updateAssetTypeIdentifiers:he.updateMany,deleteAssetTypeIdentifier:he.deleteOne,deleteAssetTypeIdentifiers:he.deleteMany}}),{initializeAssetTypeIdentifiers:Po,addAssetTypeIdentifier:bo,addAssetTypeIdentifiers:Ro,setAssetTypeIdentifier:Mo,setAssetTypeIdentifiers:ko,updateAssetTypeIdentifier:Eo,updateAssetTypeIdentifiers:vo,deleteAssetTypeIdentifier:Vo,deleteAssetTypeIdentifiers:Bo}=fi.actions,Wo=t=>t.assetTypeIdentifierReducer.instances,Si=o.createSelector([Wo],t=>Object.values(t)),zo=t=>s=>s.assetTypeIdentifierReducer.instances[t],qo=S(o.createSelector([Si,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),VP=S(o.createSelector([Si,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_type===s)))),Do=fi.reducer,pe=F(t=>t.uuid),jo={instances:{}},Ai=o.createSlice({name:"assetTypeIdentifierValues",initialState:jo,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,jo)),reducers:{initializeAssetTypeIdentifierValues:pe.initialize,addAssetTypeIdentifierValue:pe.addOne,addAssetTypeIdentifierValues:pe.addMany,setAssetTypeIdentifierValue:pe.setOne,setAssetTypeIdentifierValues:pe.setMany,updateAssetTypeIdentifierValue:pe.updateOne,updateAssetTypeIdentifierValues:pe.updateMany,deleteAssetTypeIdentifierValue:pe.deleteOne,deleteAssetTypeIdentifierValues:pe.deleteMany}}),{initializeAssetTypeIdentifierValues:$o,addAssetTypeIdentifierValue:Co,addAssetTypeIdentifierValues:Uo,setAssetTypeIdentifierValue:Lo,setAssetTypeIdentifierValues:No,updateAssetTypeIdentifierValue:Go,updateAssetTypeIdentifierValues:Ho,deleteAssetTypeIdentifierValue:Ko,deleteAssetTypeIdentifierValues:Yo}=Ai.actions,Jo=t=>t.assetTypeIdentifierValueReducer.instances,Zt=o.createSelector([Jo],t=>Object.values(t)),Zo=t=>s=>s.assetTypeIdentifierValueReducer.instances[t],Qo=S(o.createSelector([Zt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),BP=S(o.createSelector([Zt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset===s)))),WP=S(o.createSelector([Zt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_type_identifier===s)))),Xo=Ai.reducer,me=F(t=>t.uuid),xo={instances:{}},wi=o.createSlice({name:"assetTypes",initialState:xo,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,xo)),reducers:{initializeAssetTypes:me.initialize,setAssetType:me.setOne,setAssetTypes:me.setMany,addAssetType:me.addOne,addAssetTypes:me.addMany,updateAssetType:me.updateOne,updateAssetTypes:me.updateMany,deleteAssetType:me.deleteOne,deleteAssetTypes:me.deleteMany}}),{initializeAssetTypes:eh,setAssetType:th,setAssetTypes:sh,addAssetType:ih,addAssetTypes:nh,updateAssetType:ah,updateAssetTypes:ch,deleteAssetType:rh,deleteAssetTypes:dh}=wi.actions,lh=t=>t.assetTypeReducer.instances,Ti=o.createSelector([lh],t=>Object.values(t)),uh=t=>s=>s.assetTypeReducer.instances[t],oh=S(o.createSelector([Ti,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),zP=S(o.createSelector([Ti,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),hh=wi.reducer,ye=F(t=>t.uuid),ph={instances:{}},Ii=o.createSlice({name:"assetTypeStatuses",initialState:ph,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,ph)),reducers:{initializeAssetTypeStatuses:ye.initialize,addAssetTypeStatus:ye.addOne,addAssetTypeStatuses:ye.addMany,setAssetTypeStatus:ye.setOne,setAssetTypeStatuses:ye.setMany,updateAssetTypeStatus:ye.updateOne,updateAssetTypeStatuses:ye.updateMany,deleteAssetTypeStatus:ye.deleteOne,deleteAssetTypeStatuses:ye.deleteMany}}),{initializeAssetTypeStatuses:mh,addAssetTypeStatus:yh,addAssetTypeStatuses:fh,setAssetTypeStatus:Sh,setAssetTypeStatuses:Ah,updateAssetTypeStatus:wh,updateAssetTypeStatuses:Th,deleteAssetTypeStatus:Ih,deleteAssetTypeStatuses:Oh}=Ii.actions,Fh=t=>t.assetTypeStatusReducer.instances,Oi=o.createSelector([Fh],t=>A(Object.values(t).toSorted(Xa))),_h=t=>s=>s.assetTypeStatusReducer.instances[t],gh=S(o.createSelector([Oi,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),qP=S(o.createSelector([Oi,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_type===s)))),Ph=Ii.reducer,bh={accessToken:"",refreshToken:"",isLoggedIn:!1},Qt=o.createSlice({name:"auth",initialState:bh,extraReducers:t=>t.addCase(I,s=>Object.assign(s,bh)),reducers:{setTokens:(t,s)=>{t.accessToken=s.payload.accessToken,t.refreshToken=s.payload.refreshToken},clearTokens:t=>{t.accessToken="",t.refreshToken=""},setLoggedIn:(t,s)=>{s.payload||Qt.caseReducers.clearTokens(t),t.isLoggedIn=s.payload}}}),{setTokens:DP,clearTokens:jP,setLoggedIn:Rh}=Qt.actions,$P=t=>t.authReducer.accessToken,CP=t=>t.authReducer.isLoggedIn,Mh=Qt.reducer,fe=F(t=>t.uuid),kh={instances:{}},Fi=o.createSlice({name:"documentAttachments",initialState:kh,extraReducers:t=>t.addCase(I,s=>Object.assign(s,kh)),reducers:{initializeDocumentAttachments:fe.initialize,addDocumentAttachment:fe.addOne,addDocumentAttachments:fe.addMany,setDocumentAttachment:fe.setOne,setDocumentAttachments:fe.setMany,updateDocumentAttachment:fe.updateOne,updateDocumentAttachments:fe.updateMany,deleteDocumentAttachment:fe.deleteOne,deleteDocumentAttachments:fe.deleteMany}}),{initializeDocumentAttachments:Eh,addDocumentAttachment:vh,addDocumentAttachments:Vh,setDocumentAttachment:Bh,setDocumentAttachments:Wh,updateDocumentAttachment:zh,updateDocumentAttachments:qh,deleteDocumentAttachment:Dh,deleteDocumentAttachments:jh}=Fi.actions,$h=t=>t.documentAttachmentReducer.instances,_i=o.createSelector([$h],t=>Object.values(t)),Ch=t=>s=>s.documentAttachmentReducer.instances[t],Uh=S(o.createSelector([_i,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),UP=S(o.createSelector([_i,(t,s)=>s],(t,s)=>A(t.filter(({document:e})=>s===e)))),Lh=Fi.reducer,Se=F(({uuid:t})=>t),Nh={instances:{}},gi=o.createSlice({name:"documents",initialState:Nh,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>{Object.assign(s,Nh)}),reducers:{initializeDocuments:Se.initialize,addDocument:Se.addOne,addDocuments:Se.addMany,setDocument:Se.setOne,setDocuments:Se.setMany,updateDocument:Se.updateOne,updateDocuments:Se.updateMany,deleteDocument:Se.deleteOne,deleteDocuments:Se.deleteMany}}),{initializeDocuments:Gh,addDocument:Hh,addDocuments:Kh,setDocument:Yh,setDocuments:Jh,updateDocument:Zh,updateDocuments:Qh,deleteDocument:Xh,deleteDocuments:xh}=gi.actions,ep=gi.reducer,Pi=t=>t.documentsReducer.instances,Xt=o.createSelector([Pi],t=>Object.values(t)),tp=t=>s=>s.documentsReducer.instances[t],sp=S(o.createSelector([Xt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),LP=S(o.createSelector([Xt,(t,s)=>s],(t,s)=>t.filter(e=>e.project===s))),NP=S(o.createSelector([Xt,(t,s)=>s],(t,s)=>t.filter(e=>e.organization===s))),ip=S(o.createSelector([Pi,(t,s)=>s],(t,s)=>{if(!t[s])return A([]);const a=tc(s,Object.values(t)).all().map(({model:c})=>c);return A(a)})),Ae=F(t=>t.uuid),np={instances:{}},bi=o.createSlice({name:"emailDomains",initialState:np,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,np)),reducers:{initializeEmailDomains:Ae.initialize,addEmailDomain:Ae.addOne,addEmailDomains:Ae.addMany,setEmailDomain:Ae.setOne,setEmailDomains:Ae.setMany,updateEmailDomain:Ae.updateOne,updateEmailDomains:Ae.updateMany,deleteEmailDomain:Ae.deleteOne,deleteEmailDomains:Ae.deleteMany}}),{initializeEmailDomains:ap,addEmailDomain:cp,addEmailDomains:rp,setEmailDomain:dp,setEmailDomains:lp,updateEmailDomain:up,updateEmailDomains:op,deleteEmailDomain:hp,deleteEmailDomains:pp}=bi.actions,mp=t=>t.emailDomainsReducer.instances,Ri=o.createSelector([mp],t=>Object.values(t)),yp=t=>s=>s.emailDomainsReducer.instances[t],fp=S(o.createSelector([Ri,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),GP=S(o.createSelector([Ri,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),Sp=bi.reducer,Ap={s3Urls:{}},wp=1e3*60*60,HP=wp*24*7,Mi=o.createSlice({name:"file",initialState:Ap,extraReducers:t=>t.addCase(I,s=>Object.assign(s,Ap)),reducers:{setUploadUrl:(t,s)=>{const{url:e,fields:n,sha1:a}=s.payload,c=new Date,r=new Date(c.getTime()+HP);t.s3Urls[a]={url:e,fields:n,exp:r.getTime()}}}}),{setUploadUrl:KP}=Mi.actions,YP=t=>s=>{const e=s.fileReducer.s3Urls[t];if(!e)return;const n=new Date().getTime();if(!((e.exp??n)-n<wp))return e},Tp=Mi.reducer,we=F(t=>t.uuid),Ip={instances:{}},ki=o.createSlice({name:"formIdentifiers",initialState:Ip,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,Ip)),reducers:{initializeFormIdentifiers:we.initialize,addFormIdentifier:we.addOne,addFormIdentifiers:we.addMany,setFormIdentifier:we.setOne,setFormIdentifiers:we.setMany,updateFormIdentifier:we.updateOne,updateFormIdentifiers:we.updateMany,deleteFormIdentifier:we.deleteOne,deleteFormIdentifiers:we.deleteMany}}),{initializeFormIdentifiers:Op,addFormIdentifier:Fp,addFormIdentifiers:_p,setFormIdentifier:gp,setFormIdentifiers:Pp,updateFormIdentifier:bp,updateFormIdentifiers:Rp,deleteFormIdentifier:Mp,deleteFormIdentifiers:kp}=ki.actions,Ep=t=>t.formIdentifierReducer.instances,Ei=o.createSelector([Ep],t=>Object.values(t)),vp=t=>s=>s.formIdentifierReducer.instances[t],Vp=S(o.createSelector([Ei,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),JP=S(o.createSelector([Ei,(t,s)=>s],(t,s)=>A(t.filter(e=>e.form===s)))),Bp=ki.reducer,Te=F(t=>t.uuid),Wp={instances:{}},vi=o.createSlice({name:"formIdentifierValues",initialState:Wp,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,Wp)),reducers:{initializeFormIdentifierValues:Te.initialize,addFormIdentifierValue:Te.addOne,addFormIdentifierValues:Te.addMany,setFormIdentifierValue:Te.setOne,setFormIdentifierValues:Te.setMany,updateFormIdentifierValue:Te.updateOne,updateFormIdentifierValues:Te.updateMany,deleteFormIdentifierValue:Te.deleteOne,deleteFormIdentifierValues:Te.deleteMany}}),{initializeFormIdentifierValues:zp,addFormIdentifierValue:qp,addFormIdentifierValues:Dp,setFormIdentifierValue:jp,setFormIdentifierValues:$p,updateFormIdentifierValue:Cp,updateFormIdentifierValues:Up,deleteFormIdentifierValue:Lp,deleteFormIdentifierValues:Np}=vi.actions,Gp=t=>t.formIdentifierValueReducer.instances,xt=o.createSelector([Gp],t=>Object.values(t)),Hp=t=>s=>s.formIdentifierValueReducer.instances[t],Kp=S(o.createSelector([xt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),ZP=S(o.createSelector([xt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.form_submission===s)))),QP=S(o.createSelector([xt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.form_identifier===s)))),Yp=vi.reducer,Ie=F(t=>t.uuid),Jp={instances:{}},Vi=o.createSlice({name:"formRevisionAttachments",initialState:Jp,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,Jp)),reducers:{initializeFormRevisionAttachments:Ie.initialize,addFormRevisionAttachment:Ie.addOne,addFormRevisionAttachments:Ie.addMany,setFormRevisionAttachment:Ie.setOne,setFormRevisionAttachments:Ie.setMany,updateFormRevisionAttachment:Ie.updateOne,updateFormRevisionAttachments:Ie.updateMany,deleteFormRevisionAttachment:Ie.deleteOne,deleteFormRevisionAttachments:Ie.deleteMany}}),{initializeFormRevisionAttachments:Zp,addFormRevisionAttachment:Qp,addFormRevisionAttachments:Xp,setFormRevisionAttachment:xp,setFormRevisionAttachments:em,updateFormRevisionAttachment:tm,updateFormRevisionAttachments:sm,deleteFormRevisionAttachment:im,deleteFormRevisionAttachments:nm}=Vi.actions,es=t=>t.formRevisionAttachmentReducer.instances,am=o.createSelector([es],t=>Object.values(t)),cm=S(o.createSelector([es,(t,s)=>s],(t,s)=>t[s])),rm=S(o.createSelector([am,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),XP=S(o.createSelector([es,(t,s)=>s],(t,s)=>A(Object.values(t).filter(e=>e.form_revision===s)))),dm=Vi.reducer,Oe=F(t=>t.uuid),lm={instances:{}},Bi=o.createSlice({name:"formRevisions",initialState:lm,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,lm)),reducers:{initializeFormRevisions:Oe.initialize,addFormRevision:Oe.addOne,addFormRevisions:Oe.addMany,setFormRevision:Oe.setOne,setFormRevisions:Oe.setMany,updateFormRevision:Oe.updateOne,updateFormRevisions:Oe.updateMany,deleteFormRevision:Oe.deleteOne,deleteFormRevisions:Oe.deleteMany}}),{initializeFormRevisions:um,addFormRevision:Wi,addFormRevisions:zi,setFormRevision:om,setFormRevisions:hm,updateFormRevision:pm,updateFormRevisions:mm,deleteFormRevision:qi,deleteFormRevisions:Di}=Bi.actions,ji=t=>t.formRevisionReducer.instances,ts=o.createSelector([ji],t=>Object.values(t)),ym=t=>s=>s.formRevisionReducer.instances[t],fm=S(o.createSelector([ts,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),xP=S(o.createSelector([ts,(t,s)=>s],(t,s)=>t.filter(e=>e.form===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),Sm=S(o.createSelector([ts,(t,s)=>s],(t,s)=>A(t.filter(e=>e.form===s)))),Am=Bi.reducer,Fe=F(t=>t.uuid),wm={instances:{}},$i=o.createSlice({name:"forms",initialState:wm,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,wm)),reducers:{initializeForms:Fe.initialize,addForm:Fe.addOne,addForms:Fe.addMany,setForm:Fe.setOne,setForms:Fe.setMany,updateForm:Fe.updateOne,updateForms:Fe.updateMany,deleteForm:Fe.deleteOne,deleteForms:Fe.deleteMany}}),{initializeForms:Tm,addForm:Im,addForms:Om,setForm:Fm,setForms:_m,updateForm:gm,updateForms:Pm,deleteForm:bm,deleteForms:Rm}=$i.actions,Mm=$i.reducer,km=t=>t.formReducer.instances,Ci=o.createSelector([km],t=>Object.values(t)),Em=t=>s=>s.formReducer.instances[t],vm=S(o.createSelector([Ci,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),eb=S(o.createSelector([Ci,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),_e=F(t=>t.uuid),Vm={instances:{}},Ui=o.createSlice({name:"formSubmissionAttachments",initialState:Vm,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,Vm)),reducers:{initializeFormSubmissionAttachments:_e.initialize,addFormSubmissionAttachment:_e.addOne,addFormSubmissionAttachments:_e.addMany,setFormSubmissionAttachment:_e.setOne,setFormSubmissionAttachments:_e.setMany,updateFormSubmissionAttachment:_e.updateOne,updateFormSubmissionAttachments:_e.updateMany,deleteFormSubmissionAttachment:_e.deleteOne,deleteFormSubmissionAttachments:_e.deleteMany}}),{initializeFormSubmissionAttachments:Bm,addFormSubmissionAttachment:Wm,addFormSubmissionAttachments:Li,setFormSubmissionAttachment:zm,setFormSubmissionAttachments:qm,updateFormSubmissionAttachment:Dm,updateFormSubmissionAttachments:jm,deleteFormSubmissionAttachment:$m,deleteFormSubmissionAttachments:Ni}=Ui.actions,Gi=t=>t.formSubmissionAttachmentReducer.instances,Hi=o.createSelector([Gi],t=>Object.values(t)),Cm=S(o.createSelector([Gi,(t,s)=>s],(t,s)=>t[s])),Ki=S(o.createSelector([Hi,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(n=>e.has(n.uuid)))})),Um=Ki,Lm=S(o.createSelector([Hi,(t,s)=>s],(t,s)=>A(t.filter(e=>e.form_submission===s)))),Nm=Ui.reducer,ge=F(t=>t.uuid),Gm={instances:{}},Yi=o.createSlice({name:"formSubmissions",initialState:Gm,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,Gm)),reducers:{initializeFormSubmissions:ge.initialize,setFormSubmission:ge.setOne,setFormSubmissions:ge.setMany,addFormSubmission:ge.addOne,addFormSubmissions:ge.addMany,updateFormSubmission:ge.updateOne,updateFormSubmissions:ge.updateMany,deleteFormSubmission:ge.deleteOne,deleteFormSubmissions:ge.deleteMany}}),{initializeFormSubmissions:Hm,setFormSubmission:Km,setFormSubmissions:Ym,addFormSubmission:Jm,addFormSubmissions:Ji,updateFormSubmission:Zm,updateFormSubmissions:Qm,deleteFormSubmission:Xm,deleteFormSubmissions:Zi}=Yi.actions,Qi=t=>t.formSubmissionReducer.instances,xm=o.createSelector([Qi],t=>Object.values(t)),ey=t=>s=>s.formSubmissionReducer.instances[t],ty=S(o.createSelector([xm,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),sy=S(o.createSelector([Qi,ji,(t,s)=>s],(t,s,e)=>{const n=new Set;for(const a of Object.values(s))a.form===e&&n.add(a.uuid);return Object.values(t).filter(a=>n.has(a.form_revision))})),iy=Yi.reducer,Pe=F(t=>t.uuid),ny={instances:{}},Xi=o.createSlice({name:"geoImages",initialState:ny,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,ny)),reducers:{initializeGeoImages:Pe.initialize,setGeoImage:Pe.setOne,setGeoImages:Pe.setMany,addGeoImage:Pe.addOne,addGeoImages:Pe.addMany,updateGeoImage:Pe.updateOne,updateGeoImages:Pe.updateMany,deleteGeoImage:Pe.deleteOne,deleteGeoImages:Pe.deleteMany}}),{initializeGeoImages:ay,setGeoImage:cy,setGeoImages:ry,addGeoImage:dy,addGeoImages:ly,updateGeoImage:uy,updateGeoImages:oy,deleteGeoImage:hy,deleteGeoImages:py}=Xi.actions,my=t=>t.geoImageReducer.instances,xi=o.createSelector([my],t=>Object.values(t)),yy=t=>s=>s.geoImageReducer.instances[t],fy=S(o.createSelector([xi,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),tb=S(o.createSelector([xi,(t,s)=>s],(t,s)=>A(t.filter(e=>e.project===s)))),Sy=Xi.reducer,be=F(t=>t.uuid),Ay={instances:{}},en=o.createSlice({name:"issueAssociations",initialState:Ay,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,Ay)),reducers:{initializeIssueAssociations:be.initialize,addIssueAssociation:be.addOne,addIssueAssociations:be.addMany,setIssueAssociation:be.setOne,setIssueAssociations:be.setMany,updateIssueAssociation:be.updateOne,updateIssueAssociations:be.updateMany,deleteIssueAssociation:be.deleteOne,deleteIssueAssociations:be.deleteMany}}),{initializeIssueAssociations:wy,setIssueAssociations:Ty,setIssueAssociation:Iy,updateIssueAssociation:Oy,updateIssueAssociations:Fy,addIssueAssociation:_y,addIssueAssociations:mt,deleteIssueAssociation:gy,deleteIssueAssociations:yt}=en.actions,Py=t=>t.issueAssociationReducer.instances,ft=o.createSelector([Py],t=>Object.values(t)),by=t=>s=>s.issueAssociationReducer.instances[t],Ry=S(o.createSelector([ft,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),My=S(o.createSelector([ft,(t,s)=>s],(t,s)=>A(t.filter(({associated_issue:e})=>e===s)))),ky=S(o.createSelector([ft,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({associated_issue:n})=>e.has(n)))})),Ey=S(o.createSelector([ft,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({issue:n})=>n&&e.has(n)))})),vy=S(o.createSelector([ft,(t,s)=>s],(t,s)=>A(t.filter(({issue:e})=>e===s)))),Vy=S(o.createSelector([ft,(t,s)=>s],(t,s)=>A(t.filter(({asset:e})=>e===s)))),By=en.reducer,Re=F(t=>t.uuid),Wy={instances:{}},tn=o.createSlice({name:"issueAttachments",initialState:Wy,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,Wy)),reducers:{initializeIssueAttachments:Re.initialize,addIssueAttachment:Re.addOne,addIssueAttachments:Re.addMany,setIssueAttachment:Re.setOne,setIssueAttachments:Re.setMany,updateIssueAttachment:Re.updateOne,updateIssueAttachments:Re.updateMany,deleteIssueAttachment:Re.deleteOne,deleteIssueAttachments:Re.deleteMany}}),{initializeIssueAttachments:zy,addIssueAttachment:qy,addIssueAttachments:sn,setIssueAttachment:Dy,setIssueAttachments:jy,updateIssueAttachment:$y,updateIssueAttachments:Cy,deleteIssueAttachment:Uy,deleteIssueAttachments:nn}=tn.actions,Ly=t=>t.issueAttachmentReducer.instances,an=o.createSelector([Ly],t=>Object.values(t)),Ny=S(o.createSelector([an,(t,s)=>s],(t,s)=>A(t.filter(({issue:e})=>s===e)))),Gy=t=>s=>s.issueAttachmentReducer.instances[t],Hy=S(o.createSelector([an,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Ky=tn.reducer,Me=F(t=>t.uuid),Yy={instances:{}},cn=o.createSlice({name:"issueCommentAttachments",initialState:Yy,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,Yy)),reducers:{initializeIssueCommentAttachments:Me.initialize,addIssueCommentAttachment:Me.addOne,addIssueCommentAttachments:Me.addMany,setIssueCommentAttachment:Me.setOne,setIssueCommentAttachments:Me.setMany,updateIssueCommentAttachment:Me.updateOne,updateIssueCommentAttachments:Me.updateMany,deleteIssueCommentAttachment:Me.deleteOne,deleteIssueCommentAttachments:Me.deleteMany}}),{initializeIssueCommentAttachments:Jy,addIssueCommentAttachment:Zy,addIssueCommentAttachments:Qy,setIssueCommentAttachment:Xy,setIssueCommentAttachments:xy,updateIssueCommentAttachment:ef,updateIssueCommentAttachments:tf,deleteIssueCommentAttachment:sf,deleteIssueCommentAttachments:nf}=cn.actions,af=t=>t.issueCommentAttachmentReducer.instances,rn=o.createSelector([af],t=>Object.values(t)),cf=t=>s=>s.issueCommentAttachmentReducer.instances[t],rf=S(o.createSelector([rn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),sb=S(o.createSelector([rn,(t,s)=>s],(t,s)=>A(t.filter(({issue_comment:e})=>s===e)))),df=cn.reducer,ke=F(t=>t.uuid),lf={instances:{}},dn=o.createSlice({name:"issueComments",initialState:lf,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,lf)),reducers:{initializeIssueComments:ke.initialize,addIssueComment:ke.addOne,addIssueComments:ke.addMany,setIssueComment:ke.setOne,setIssueComments:ke.setMany,updateIssueComment:ke.updateOne,updateIssueComments:ke.updateMany,deleteIssueComment:ke.deleteOne,deleteIssueComments:ke.deleteMany}}),{initializeIssueComments:uf,addIssueComment:of,addIssueComments:hf,setIssueComment:pf,setIssueComments:mf,updateIssueComment:yf,updateIssueComments:ff,deleteIssueComment:Sf,deleteIssueComments:Af}=dn.actions,ln=t=>t.issueCommentReducer.instances,wf=t=>s=>s.issueCommentReducer.instances[t],Tf=S(o.createSelector([ln,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(Object.values(t).filter(({uuid:n})=>e.has(n)))})),ib=S(o.createSelector([ln,(t,s)=>s],(t,s)=>A(Object.values(t).filter(e=>e.issue===s)))),If=dn.reducer,Ee=F(t=>t.uuid),Of={instances:{}},un=o.createSlice({name:"issues",initialState:Of,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,Of)),reducers:{initializeIssues:Ee.initialize,addIssue:Ee.addOne,addIssues:Ee.addMany,setIssue:Ee.setOne,setIssues:Ee.setMany,updateIssue:Ee.updateOne,updateIssues:Ee.updateMany,deleteIssue:Ee.deleteOne,deleteIssues:Ee.deleteMany}}),{initializeIssues:Ff,addIssue:_f,addIssues:on,setIssue:gf,setIssues:Pf,updateIssue:bf,updateIssues:Rf,deleteIssue:Mf,deleteIssues:hn}=un.actions,kf=t=>t.issueReducer.instances,ss=o.createSelector([kf],t=>Object.values(t)),Ef=t=>s=>s.issueReducer.instances[t],vf=S(o.createSelector([ss,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),nb=S(o.createSelector([ss,(t,s)=>s],(t,s)=>t.filter(e=>e.project===s))),Vf=S(o.createSelector([ss,(t,s)=>s],(t,s)=>t.filter(e=>e.issue_type===s))),Bf=un.reducer,ve=F(t=>t.uuid),Wf={instances:{}},pn=o.createSlice({name:"issueTypeAttachments",initialState:Wf,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,Wf)),reducers:{initializeIssueTypeAttachments:ve.initialize,addIssueTypeAttachment:ve.addOne,addIssueTypeAttachments:ve.addMany,setIssueTypeAttachment:ve.setOne,setIssueTypeAttachments:ve.setMany,updateIssueTypeAttachment:ve.updateOne,updateIssueTypeAttachments:ve.updateMany,deleteIssueTypeAttachment:ve.deleteOne,deleteIssueTypeAttachments:ve.deleteMany}}),{initializeIssueTypeAttachments:zf,addIssueTypeAttachment:qf,addIssueTypeAttachments:Df,setIssueTypeAttachment:jf,setIssueTypeAttachments:$f,updateIssueTypeAttachment:Cf,updateIssueTypeAttachments:Uf,deleteIssueTypeAttachment:Lf,deleteIssueTypeAttachments:Nf}=pn.actions,Gf=t=>t.issueTypeAttachmentReducer.instances,mn=o.createSelector([Gf],t=>Object.values(t)),Hf=t=>s=>s.issueTypeAttachmentReducer.instances[t],Kf=S(o.createSelector([mn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),ab=S(o.createSelector([mn,(t,s)=>s],(t,s)=>A(t.filter(({issue_type:e})=>s===e)))),Yf=pn.reducer,Ve=F(t=>t.uuid),Jf={instances:{}},yn=o.createSlice({name:"issueTypeFieldsAttachments",initialState:Jf,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,Jf)),reducers:{initializeIssueTypeFieldsAttachments:Ve.initialize,addIssueTypeFieldsAttachment:Ve.addOne,addIssueTypeFieldsAttachments:Ve.addMany,setIssueTypeFieldsAttachment:Ve.setOne,setIssueTypeFieldsAttachments:Ve.setMany,updateIssueTypeFieldsAttachment:Ve.updateOne,updateIssueTypeFieldsAttachments:Ve.updateMany,deleteIssueTypeFieldsAttachment:Ve.deleteOne,deleteIssueTypeFieldsAttachments:Ve.deleteMany}}),{initializeIssueTypeFieldsAttachments:Zf,addIssueTypeFieldsAttachment:Qf,addIssueTypeFieldsAttachments:Xf,setIssueTypeFieldsAttachment:xf,setIssueTypeFieldsAttachments:eS,updateIssueTypeFieldsAttachment:tS,updateIssueTypeFieldsAttachments:sS,deleteIssueTypeFieldsAttachment:iS,deleteIssueTypeFieldsAttachments:nS}=yn.actions,aS=t=>t.issueTypeFieldsAttachmentReducer.instances,fn=o.createSelector([aS],t=>Object.values(t)),cb=S(o.createSelector([fn,(t,s)=>s],(t,s)=>A(t.filter(e=>e.fields_revision===s)))),cS=t=>s=>s.issueTypeFieldsAttachmentReducer.instances[t],rS=S(o.createSelector([fn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),dS=yn.reducer,Be=F(t=>t.uuid),lS={instances:{}},Sn=o.createSlice({name:"issueTypeFieldValues",initialState:lS,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,lS)),reducers:{initializeIssueTypeFieldValues:Be.initialize,addIssueTypeFieldValues:Be.addOne,addIssueTypeFieldValuesMany:Be.addMany,setIssueTypeFieldValues:Be.setOne,setIssueTypeFieldValuesMany:Be.setMany,updateIssueTypeFieldValues:Be.updateOne,updateIssueTypeFieldValuesMany:Be.updateMany,deleteIssueTypeFieldValues:Be.deleteOne,deleteIssueTypeFieldValuesMany:Be.deleteMany}}),{initializeIssueTypeFieldValues:uS,addIssueTypeFieldValues:oS,addIssueTypeFieldValuesMany:hS,setIssueTypeFieldValues:pS,setIssueTypeFieldValuesMany:mS,updateIssueTypeFieldValues:yS,updateIssueTypeFieldValuesMany:fS,deleteIssueTypeFieldValues:SS,deleteIssueTypeFieldValuesMany:AS}=Sn.actions,wS=t=>t.issueTypeFieldValuesReducer.instances,is=o.createSelector([wS],t=>Object.values(t)),rb=S(o.createSelector([is,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue===s)))),TS=t=>s=>s.issueTypeFieldValuesReducer.instances[t],IS=S(o.createSelector([is,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),OS=Sn.reducer,We=F(t=>t.uuid),FS={instances:{}},An=o.createSlice({name:"issueTypeFields",initialState:FS,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,FS)),reducers:{initializeIssueTypeFields:We.initialize,addIssueTypeFields:We.addOne,addIssueTypeFieldsMany:We.addMany,setIssueTypeFields:We.setOne,setIssueTypeFieldsMany:We.setMany,updateIssueTypeFields:We.updateOne,updateIssueTypeFieldsMany:We.updateMany,deleteIssueTypeFields:We.deleteOne,deleteIssueTypeFieldsMany:We.deleteMany}}),{initializeIssueTypeFields:_S,addIssueTypeFields:gS,addIssueTypeFieldsMany:PS,setIssueTypeFields:bS,setIssueTypeFieldsMany:RS,updateIssueTypeFields:MS,updateIssueTypeFieldsMany:kS,deleteIssueTypeFields:ES,deleteIssueTypeFieldsMany:vS}=An.actions,VS=t=>t.issueTypeFieldsReducer.instances,Et=o.createSelector([VS],t=>Object.values(t)),db=S(o.createSelector([Et,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue_type===s)))),lb=S(o.createSelector([Et,(t,s)=>s],(t,s)=>t.filter(e=>e.issue_type===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),ub=S(o.createSelector([Et,is,(t,s)=>s],(t,s,e)=>{const n=new Set(t.filter(a=>a.issue_type===e).map(a=>a.uuid));return A(s.filter(a=>n.has(a.fields_revision)))})),BS=t=>s=>s.issueTypeFieldsReducer.instances[t],WS=S(o.createSelector([Et,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),zS=An.reducer,ze=F(t=>t.uuid),qS={instances:{}},wn=o.createSlice({name:"issueTypeFieldValuesAttachments",initialState:qS,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,qS)),reducers:{initializeIssueTypeFieldValuesAttachments:ze.initialize,addIssueTypeFieldValuesAttachment:ze.addOne,addIssueTypeFieldValuesAttachments:ze.addMany,setIssueTypeFieldValuesAttachment:ze.setOne,setIssueTypeFieldValuesAttachments:ze.setMany,updateIssueTypeFieldValuesAttachment:ze.updateOne,updateIssueTypeFieldValuesAttachments:ze.updateMany,deleteIssueTypeFieldValuesAttachment:ze.deleteOne,deleteIssueTypeFieldValuesAttachments:ze.deleteMany}}),{initializeIssueTypeFieldValuesAttachments:DS,addIssueTypeFieldValuesAttachment:jS,addIssueTypeFieldValuesAttachments:Tn,setIssueTypeFieldValuesAttachment:$S,setIssueTypeFieldValuesAttachments:CS,updateIssueTypeFieldValuesAttachment:US,updateIssueTypeFieldValuesAttachments:LS,deleteIssueTypeFieldValuesAttachment:NS,deleteIssueTypeFieldValuesAttachments:In}=wn.actions,GS=t=>t.issueTypeFieldValuesAttachmentReducer.instances,On=o.createSelector([GS],t=>Object.values(t)),HS=t=>s=>s.issueTypeFieldValuesAttachmentReducer.instances[t],KS=S(o.createSelector([On,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),YS=S(o.createSelector([On,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),JS=wn.reducer,qe=F(t=>t.uuid),ZS={instances:{}},Fn=o.createSlice({name:"issueTypeIdentifiers",initialState:ZS,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,ZS)),reducers:{initializeIssueTypeIdentifiers:qe.initialize,addIssueTypeIdentifier:qe.addOne,addIssueTypeIdentifiers:qe.addMany,setIssueTypeIdentifier:qe.setOne,setIssueTypeIdentifiers:qe.setMany,updateIssueTypeIdentifier:qe.updateOne,updateIssueTypeIdentifiers:qe.updateMany,deleteIssueTypeIdentifier:qe.deleteOne,deleteIssueTypeIdentifiers:qe.deleteMany}}),{initializeIssueTypeIdentifiers:QS,addIssueTypeIdentifier:XS,addIssueTypeIdentifiers:xS,setIssueTypeIdentifier:eA,setIssueTypeIdentifiers:tA,updateIssueTypeIdentifier:sA,updateIssueTypeIdentifiers:iA,deleteIssueTypeIdentifier:nA,deleteIssueTypeIdentifiers:aA}=Fn.actions,cA=t=>t.issueTypeIdentifierReducer.instances,_n=o.createSelector([cA],t=>Object.values(t)),rA=t=>s=>s.issueTypeIdentifierReducer.instances[t],dA=S(o.createSelector([_n,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),ob=S(o.createSelector([_n,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue_type===s)))),lA=Fn.reducer,De=F(t=>t.uuid),uA={instances:{}},gn=o.createSlice({name:"issueTypeIdentifierValues",initialState:uA,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,uA)),reducers:{initializeIssueTypeIdentifierValues:De.initialize,addIssueTypeIdentifierValue:De.addOne,addIssueTypeIdentifierValues:De.addMany,setIssueTypeIdentifierValue:De.setOne,setIssueTypeIdentifierValues:De.setMany,updateIssueTypeIdentifierValue:De.updateOne,updateIssueTypeIdentifierValues:De.updateMany,deleteIssueTypeIdentifierValue:De.deleteOne,deleteIssueTypeIdentifierValues:De.deleteMany}}),{initializeIssueTypeIdentifierValues:oA,addIssueTypeIdentifierValue:hA,addIssueTypeIdentifierValues:pA,setIssueTypeIdentifierValue:mA,setIssueTypeIdentifierValues:yA,updateIssueTypeIdentifierValue:fA,updateIssueTypeIdentifierValues:SA,deleteIssueTypeIdentifierValue:AA,deleteIssueTypeIdentifierValues:wA}=gn.actions,TA=t=>t.issueTypeIdentifierValueReducer.instances,ns=o.createSelector([TA],t=>Object.values(t)),IA=t=>s=>s.issueTypeIdentifierValueReducer.instances[t],OA=S(o.createSelector([ns,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),hb=S(o.createSelector([ns,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue===s)))),pb=S(o.createSelector([ns,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue_type_identifier===s)))),FA=gn.reducer,je=F(t=>t.uuid),_A={instances:{}},Pn=o.createSlice({name:"issueTypes",initialState:_A,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,_A)),reducers:{initializeIssueTypes:je.initialize,addIssueType:je.addOne,addIssueTypes:je.addMany,setIssueType:je.setOne,setIssueTypes:je.setMany,updateIssueType:je.updateOne,updateIssueTypes:je.updateMany,deleteIssueType:je.deleteOne,deleteIssueTypes:je.deleteMany}}),{initializeIssueTypes:gA,addIssueType:PA,addIssueTypes:bA,setIssueType:RA,setIssueTypes:MA,updateIssueType:kA,updateIssueTypes:EA,deleteIssueType:vA,deleteIssueTypes:VA}=Pn.actions,BA=t=>t.issueTypeReducer.instances,bn=o.createSelector(BA,t=>Object.values(t)),WA=t=>s=>s.issueTypeReducer.instances[t],zA=S(o.createSelector([bn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),mb=S(o.createSelector([bn,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),qA=Pn.reducer,$e=F(t=>t.uuid),DA={instances:{}},Rn=o.createSlice({name:"issueTypeStatuses",initialState:DA,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,DA)),reducers:{initializeIssueTypeStatuses:$e.initialize,addIssueTypeStatus:$e.addOne,addIssueTypeStatuses:$e.addMany,setIssueTypeStatus:$e.setOne,setIssueTypeStatuses:$e.setMany,updateIssueTypeStatus:$e.updateOne,updateIssueTypeStatuses:$e.updateMany,deleteIssueTypeStatus:$e.deleteOne,deleteIssueTypeStatuses:$e.deleteMany}}),{initializeIssueTypeStatuses:jA,addIssueTypeStatus:$A,addIssueTypeStatuses:CA,setIssueTypeStatus:UA,setIssueTypeStatuses:LA,updateIssueTypeStatus:NA,updateIssueTypeStatuses:GA,deleteIssueTypeStatus:HA,deleteIssueTypeStatuses:KA}=Rn.actions,YA=t=>t.issueTypeStatusReducer.instances,Mn=o.createSelector([YA],t=>A(Object.values(t).toSorted(xa))),kn=t=>s=>s.issueTypeStatusReducer.instances[t],JA=S(o.createSelector([Mn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),yb=S(o.createSelector([Mn,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue_type===s)))),ZA=Rn.reducer,Ce=F(t=>t.uuid),QA={instances:{}},En=o.createSlice({name:"issueUpdates",initialState:QA,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,QA)),reducers:{initializeIssueUpdates:Ce.initialize,addIssueUpdate:Ce.addOne,addIssueUpdates:Ce.addMany,setIssueUpdate:Ce.setOne,setIssueUpdates:Ce.setMany,updateIssueUpdate:Ce.updateOne,updateIssueUpdates:Ce.updateMany,deleteIssueUpdate:Ce.deleteOne,deleteIssueUpdates:Ce.deleteMany}}),{initializeIssueUpdates:XA,addIssueUpdate:vn,addIssueUpdates:Vn,setIssueUpdate:xA,setIssueUpdates:ew,updateIssueUpdate:tw,updateIssueUpdates:sw,deleteIssueUpdate:Bn,deleteIssueUpdates:Wn}=En.actions,zn=t=>t.issueUpdateReducer.instances,qn=o.createSelector([zn],t=>Object.values(t)),iw=S(o.createSelector([zn,(t,s)=>s],(t,s)=>t[s])),nw=S(o.createSelector([qn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),aw=S(o.createSelector([qn,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue===s)))),cw=En.reducer,Ue=F(t=>t.id),rw={instances:{},currentUser:null},Dn=o.createSlice({name:"users",initialState:rw,extraReducers:t=>t.addCase(I,s=>Object.assign(s,rw)).addCase(_,s=>Object.assign(s,{...s,instances:[]})),reducers:{initializeUsers:Ue.initialize,setUsers:Ue.setMany,setUser:Ue.setOne,addUsers:Ue.addMany,addUser:Ue.addOne,updateUsers:Ue.updateMany,updateUser:Ue.updateOne,deleteUser:Ue.deleteOne,deleteUsers:Ue.deleteMany,setCurrentUser:(t,s)=>{t.currentUser=s.payload},setCurrentUserProfile:(t,s)=>{if(!t.currentUser)return;t.currentUser.profile=s.payload;const e=t.instances[t.currentUser.id];if(!e)throw new Error("Unable to find current user in users slice");e.profile=s.payload}}}),{initializeUsers:dw,setUsers:lw,setUser:uw,addUsers:ow,addUser:jn,updateUsers:hw,updateUser:pw,deleteUser:$n,deleteUsers:mw,setCurrentUser:fb,setCurrentUserProfile:Sb}=Dn.actions,yw=Dn.reducer,fw=t=>t.userReducer.currentUser,Cn=t=>t.userReducer.instances,as=o.createSelector([Cn],t=>Object.values(t)),cs=t=>s=>s.userReducer.instances[t],Sw=S(o.createSelector([as,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({id:n})=>e.has(n)))})),Le=F(t=>t.uuid),Aw={instances:{}},Un=o.createSlice({name:"organizationAccess",initialState:Aw,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,Aw)),reducers:{initializeOrganizationAccesses:Le.initialize,addOrganizationAccess:Le.addOne,addOrganizationAccesses:Le.addMany,setOrganizationAccess:Le.setOne,setOrganizationAccesses:Le.setMany,updateOrganizationAccess:Le.updateOne,updateOrganizationAccesses:Le.updateMany,deleteOrganizationAccess:Le.deleteOne,deleteOrganizationAccesses:Le.deleteMany}}),{initializeOrganizationAccesses:ww,addOrganizationAccess:Tw,addOrganizationAccesses:Iw,setOrganizationAccess:Ow,setOrganizationAccesses:Fw,updateOrganizationAccess:_w,updateOrganizationAccesses:gw,deleteOrganizationAccess:Pw,deleteOrganizationAccesses:bw}=Un.actions,Rw=Un.reducer,rs=t=>t.organizationAccessReducer.instances,Mw=t=>s=>s.organizationAccessReducer.instances[t],kw=S(o.createSelector([rs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(Object.values(t).filter(({uuid:n})=>e.has(n)))})),Ab=o.createSelector([fw,rs],(t,s)=>Object.values(s).find(n=>n.user===(t==null?void 0:t.id))??null),Ew=o.createSelector([rs],t=>{const s={};for(const e of Object.values(t))s[e.user]=e;return $t(s)}),wb=S(o.createSelector([Cn,Ew,(t,s)=>s],(t,s,e)=>A(Object.values(t).filter(n=>{const a=s[n.id];return!!a&&a.organization===e})))),Ne=F(t=>t.uuid),vw={instances:{}},Ln=o.createSlice({name:"organizations",initialState:vw,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,vw)),reducers:{initializeOrganizations:Ne.initialize,setOrganizations:Ne.setMany,setOrganization:Ne.setOne,addOrganizations:Ne.addMany,addOrganization:Ne.addOne,updateOrganizations:Ne.updateMany,updateOrganization:Ne.updateOne,deleteOrganization:Ne.deleteOne,deleteOrganizations:Ne.deleteMany}}),{initializeOrganizations:Vw,setOrganizations:Bw,setOrganization:Ww,addOrganizations:zw,addOrganization:qw,updateOrganizations:Dw,updateOrganization:jw,deleteOrganization:$w,deleteOrganizations:Cw}=Ln.actions,Uw=t=>t.organizationReducer.instances,Lw=o.createSelector([Uw],t=>Object.values(t)),Nw=t=>s=>s.organizationReducer.instances[t],Gw=S(o.createSelector([Lw,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Hw=Ln.reducer,Kw=(t,s,e)=>{const n=t.uuid?t:{...t,uuid:ot.v4()};return{payload:n,type:"",meta:{offline:{effect:{timestamp:new Date().toISOString(),request:n,BASE_URL:s,serviceName:e}}}}},Yw={deletedRequests:[],latestRetryTime:0},Nn=o.createSlice({name:"outbox",initialState:Yw,extraReducers:t=>t.addCase(I,s=>Object.assign(s,Yw)),reducers:{enqueueRequest:{reducer:(t,s)=>t,prepare:t=>{console.debug("Preparing to enqueue request",t.url);const{BASE_URL:s,serviceName:e,...n}=t;return Kw(n,s,e)}},markForDeletion(t,s){t.deletedRequests.push(s.payload)},markAsDeleted(t,s){const e=t.deletedRequests.indexOf(s.payload);e!==-1&&t.deletedRequests.splice(e,1)},_setLatestRetryTime:(t,s)=>{t.latestRetryTime=s.payload}}}),Tb=t=>t.outboxReducer.deletedRequests,Ib=t=>t.outboxReducer.latestRetryTime,{enqueueRequest:Jw,markForDeletion:Ob,markAsDeleted:Zw,_setLatestRetryTime:Qw}=Nn.actions,Xw=Nn.reducer,Ge=F(t=>t.uuid),xw={instances:{}},Gn=o.createSlice({name:"projectAccess",initialState:xw,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,xw)),reducers:{initializeProjectAccesses:Ge.initialize,addProjectAccess:Ge.addOne,addProjectAccesses:Ge.addMany,setProjectAccess:Ge.setOne,setProjectAccesses:Ge.setMany,updateProjectAccess:Ge.updateOne,updateProjectAccesses:Ge.updateMany,deleteProjectAccess:Ge.deleteOne,deleteProjectAccesses:Ge.deleteMany}}),{initializeProjectAccesses:eT,addProjectAccess:tT,addProjectAccesses:sT,setProjectAccess:iT,setProjectAccesses:nT,updateProjectAccess:aT,updateProjectAccesses:cT,deleteProjectAccess:rT,deleteProjectAccesses:dT}=Gn.actions,lT=Gn.reducer,Hn=t=>t.projectAccessReducer.instances,vt=o.createSelector(Hn,t=>Object.values(t)),uT=t=>s=>s.projectAccessReducer.instances[t],oT=S(o.createSelector([vt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Fb=S(o.createSelector([Hn,(t,s)=>s],(t,s)=>A(Object.values(t).filter(e=>e.project===s)))),_b=S(o.createSelector([vt,(t,s)=>s],(t,s)=>{const e={};for(const n of t.filter(a=>a.project===s))e[n.user]=n;return e})),gb=S(o.createSelector([as,vt,(t,s)=>s],(t,s,e)=>{const n=new Set(s.filter(a=>a.project===e).map(a=>a.user));return A(t.filter(a=>n.has(a.id)))})),He=F(t=>t.uuid),hT={instances:{}},Kn=o.createSlice({name:"projectAttachments",initialState:hT,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,hT)),reducers:{initializeProjectAttachments:He.initialize,addProjectAttachment:He.addOne,addProjectAttachments:He.addMany,setProjectAttachment:He.setOne,setProjectAttachments:He.setMany,updateProjectAttachment:He.updateOne,updateProjectAttachments:He.updateMany,deleteProjectAttachment:He.deleteOne,deleteProjectAttachments:He.deleteMany}}),{initializeProjectAttachments:pT,addProjectAttachment:mT,addProjectAttachments:yT,setProjectAttachment:fT,setProjectAttachments:ST,updateProjectAttachment:AT,updateProjectAttachments:wT,deleteProjectAttachment:TT,deleteProjectAttachments:IT}=Kn.actions,OT=t=>t.projectAttachmentReducer.instances,Yn=o.createSelector([OT],t=>Object.values(t)),FT=t=>s=>s.projectAttachmentReducer.instances[t],_T=S(o.createSelector([Yn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Pb=S(o.createSelector([Yn,(t,s)=>s],(t,s)=>A(t.filter(({project:e})=>s===e)))),gT=Kn.reducer,Ke=F(t=>t.uuid),PT={instances:{}},Jn=o.createSlice({name:"projectFiles",initialState:PT,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,PT)),reducers:{initializeProjectFiles:Ke.initialize,setProjectFile:Ke.setOne,setProjectFiles:Ke.setMany,addProjectFile:Ke.addOne,addProjectFiles:Ke.addMany,updateProjectFile:Ke.updateOne,updateProjectFiles:Ke.updateMany,deleteProjectFile:Ke.deleteOne,deleteProjectFiles:Ke.deleteMany}}),{initializeProjectFiles:bT,setProjectFile:RT,setProjectFiles:MT,addProjectFile:kT,addProjectFiles:ET,updateProjectFile:vT,updateProjectFiles:VT,deleteProjectFile:BT,deleteProjectFiles:WT}=Jn.actions,zT=t=>t.projectFileReducer.instances,qT=o.createSelector([zT],t=>A(Object.values(t).sort((s,e)=>s.z_index-e.z_index))),DT=t=>s=>s.projectFileReducer.instances[t],jT=S(o.createSelector([qT,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),$T=Jn.reducer,Ye=F(t=>t.uuid),CT={instances:{}},Zn=o.createSlice({name:"projects",initialState:CT,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,CT)),reducers:{initializeProjects:Ye.initialize,setProjects:Ye.setMany,setProject:Ye.setOne,addProjects:Ye.addMany,addProject:Ye.addOne,updateProjects:Ye.updateMany,updateProject:Ye.updateOne,deleteProject:Ye.deleteOne,deleteProjects:Ye.deleteMany}}),{initializeProjects:UT,setProjects:LT,setProject:NT,addProjects:GT,addProject:HT,updateProjects:KT,updateProject:YT,deleteProject:JT,deleteProjects:ZT}=Zn.actions,QT=Zn.reducer,XT=t=>t.projectReducer.instances,ds=o.createSelector([XT],t=>Object.values(t)),xT=t=>s=>s.projectReducer.instances[t],eI=S(o.createSelector([ds,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),bb=S(o.createSelector([ds,vt,(t,s)=>s],(t,s,e)=>{const n=new Set(s.filter(a=>a.user===e).map(a=>a.project));return A(t.filter(a=>n.has(a.uuid)))})),Rb=S(o.createSelector([ds,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),Mb={isRehydrated:!1},Qn=o.createSlice({name:"rehydrated",initialState:Mb,reducers:{setRehydrated:(t,s)=>{t.isRehydrated=s.payload}}}),{setRehydrated:kb}=Qn.actions,Eb=t=>t.rehydratedReducer.isRehydrated,tI=Qn.reducer,Je=F(t=>t.uuid),sI={instances:{}},Xn=o.createSlice({name:"teamMemberships",initialState:sI,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,sI)),reducers:{initializeTeamMemberships:Je.initialize,addTeamMembership:Je.addOne,addTeamMemberships:Je.addMany,setTeamMembership:Je.setOne,setTeamMemberships:Je.setMany,updateTeamMembership:Je.updateOne,updateTeamMemberships:Je.updateMany,deleteTeamMembership:Je.deleteOne,deleteTeamMemberships:Je.deleteMany}}),{initializeTeamMemberships:iI,addTeamMembership:nI,addTeamMemberships:aI,setTeamMembership:cI,setTeamMemberships:rI,updateTeamMembership:dI,updateTeamMemberships:lI,deleteTeamMembership:uI,deleteTeamMemberships:oI}=Xn.actions,hI=Xn.reducer,pI=t=>t.teamMembershipReducer.instances,ls=o.createSelector([pI],t=>Object.values(t)),mI=t=>s=>s.teamMembershipReducer.instances[t],yI=S(o.createSelector([ls,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),vb=S(o.createSelector([ls,(t,s)=>s],(t,s)=>{const e={};for(const n of t.filter(a=>a.team===s))e[n.user]=n;return e})),Vb=S(o.createSelector([as,ls,(t,s)=>s],(t,s,e)=>{const n=new Set(s.filter(a=>a.team===e).map(a=>a.user));return A(t.filter(a=>n.has(a.id)))})),Ze=F(t=>t.uuid),fI={instances:{}},xn=o.createSlice({name:"teams",initialState:fI,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,fI)),reducers:{initializeTeams:Ze.initialize,addTeam:Ze.addOne,addTeams:Ze.addMany,setTeam:Ze.setOne,setTeams:Ze.setMany,updateTeam:Ze.updateOne,updateTeams:Ze.updateMany,deleteTeam:Ze.deleteOne,deleteTeams:Ze.deleteMany}}),{initializeTeams:SI,addTeam:AI,addTeams:wI,setTeam:TI,setTeams:II,updateTeam:OI,updateTeams:FI,deleteTeam:_I,deleteTeams:gI}=xn.actions,PI=t=>t.teamReducer.instances,ea=o.createSelector([PI],t=>Object.values(t)),bI=t=>s=>s.teamReducer.instances[t],RI=S(o.createSelector([ea,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Bb=S(o.createSelector([ea,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),MI=xn.reducer,Wb={version:0},kI=o.createSlice({name:"versioning",initialState:Wb,reducers:{}}),EI=kI.reducer,Qe=F(t=>t.uuid),vI={instances:{}},ta=o.createSlice({name:"workflows",initialState:vI,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,vI)),reducers:{initializeWorkflows:Qe.initialize,addWorkflow:Qe.addOne,addWorkflows:Qe.addMany,setWorkflow:Qe.setOne,setWorkflows:Qe.setMany,updateWorkflow:Qe.updateOne,updateWorkflows:Qe.updateMany,deleteWorkflow:Qe.deleteOne,deleteWorkflows:Qe.deleteMany}}),{initializeWorkflows:VI,addWorkflow:BI,addWorkflows:WI,setWorkflow:zI,setWorkflows:qI,updateWorkflow:DI,updateWorkflows:jI,deleteWorkflow:$I,deleteWorkflows:CI}=ta.actions,UI=t=>t.workflowReducer.instances,us=o.createSelector([UI],t=>Object.values(t)),LI=t=>s=>s.workflowReducer.instances[t],NI=S(o.createSelector([us,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),zb=S(o.createSelector([us,(t,s)=>s],(t,s)=>A(t.filter(e=>e.project===s)))),qb=S(o.createSelector([us,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_type===s)))),GI=ta.reducer,Xe=F(t=>t.uuid),HI={instances:{}},sa=o.createSlice({name:"workflowStepAssignees",initialState:HI,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,HI)),reducers:{initializeWorkflowStepAssignees:Xe.initialize,addWorkflowStepAssignee:Xe.addOne,addWorkflowStepAssignees:Xe.addMany,setWorkflowStepAssignee:Xe.setOne,setWorkflowStepAssignees:Xe.setMany,updateWorkflowStepAssignee:Xe.updateOne,updateWorkflowStepAssignees:Xe.updateMany,deleteWorkflowStepAssignee:Xe.deleteOne,deleteWorkflowStepAssignees:Xe.deleteMany}}),{initializeWorkflowStepAssignees:KI,addWorkflowStepAssignee:YI,addWorkflowStepAssignees:JI,setWorkflowStepAssignee:ZI,setWorkflowStepAssignees:QI,updateWorkflowStepAssignee:XI,updateWorkflowStepAssignees:xI,deleteWorkflowStepAssignee:eO,deleteWorkflowStepAssignees:tO}=sa.actions,sO=t=>t.workflowStepAssigneeReducer.instances,Vt=o.createSelector([sO],t=>Object.values(t)),iO=t=>s=>s.workflowStepAssigneeReducer.instances[t],nO=S(o.createSelector([Vt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Db=S(o.createSelector([Vt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow===s)))),jb=S(o.createSelector([Vt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),$b=S(o.createSelector([Vt,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>A(t.filter(({workflow:n,workflow_step:a})=>n===s&&a===e)))),aO=sa.reducer,xe=F(t=>t.uuid),cO={instances:{}},ia=o.createSlice({name:"workflowStepComments",initialState:cO,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,cO)),reducers:{initializeWorkflowStepComments:xe.initialize,addWorkflowStepComment:xe.addOne,addWorkflowStepComments:xe.addMany,setWorkflowStepComment:xe.setOne,setWorkflowStepComments:xe.setMany,updateWorkflowStepComment:xe.updateOne,updateWorkflowStepComments:xe.updateMany,deleteWorkflowStepComment:xe.deleteOne,deleteWorkflowStepComments:xe.deleteMany}}),{initializeWorkflowStepComments:rO,addWorkflowStepComment:dO,addWorkflowStepComments:lO,setWorkflowStepComment:uO,setWorkflowStepComments:oO,updateWorkflowStepComment:hO,updateWorkflowStepComments:pO,deleteWorkflowStepComment:mO,deleteWorkflowStepComments:yO}=ia.actions,fO=t=>t.workflowStepCommentReducer.instances,Bt=o.createSelector([fO],t=>Object.values(t)),SO=t=>s=>s.workflowStepCommentReducer.instances[t],AO=S(o.createSelector([Bt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Cb=S(o.createSelector([Bt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow===s)))),Ub=S(o.createSelector([Bt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),Lb=S(o.createSelector([Bt,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>A(t.filter(({workflow:n,workflow_step:a})=>n===s&&a===e)))),wO=ia.reducer,et=F(t=>t.uuid),TO={instances:{}},na=o.createSlice({name:"workflowStepEvents",initialState:TO,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,TO)),reducers:{initializeWorkflowStepEvents:et.initialize,addWorkflowStepEvent:et.addOne,addWorkflowStepEvents:et.addMany,setWorkflowStepEvent:et.setOne,setWorkflowStepEvents:et.setMany,updateWorkflowStepEvent:et.updateOne,updateWorkflowStepEvents:et.updateMany,deleteWorkflowStepEvent:et.deleteOne,deleteWorkflowStepEvents:et.deleteMany}}),{initializeWorkflowStepEvents:IO,addWorkflowStepEvent:OO,addWorkflowStepEvents:FO,setWorkflowStepEvent:_O,setWorkflowStepEvents:gO,updateWorkflowStepEvent:PO,updateWorkflowStepEvents:bO,deleteWorkflowStepEvent:RO,deleteWorkflowStepEvents:MO}=na.actions,kO=t=>t.workflowStepEventReducer.instances,Wt=o.createSelector([kO],t=>Object.values(t)),EO=t=>s=>s.workflowStepEventReducer.instances[t],vO=S(o.createSelector([Wt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Nb=S(o.createSelector([Wt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow===s)))),Gb=S(o.createSelector([Wt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),Hb=S(o.createSelector([Wt,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>A(t.filter(({workflow:n,workflow_step:a})=>n===s&&a===e)))),VO=na.reducer,tt=F(t=>t.uuid),BO={instances:{}},aa=o.createSlice({name:"workflowStepFieldsAttachments",initialState:BO,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,BO)),reducers:{initializeWorkflowStepFieldsAttachments:tt.initialize,addWorkflowStepFieldsAttachment:tt.addOne,addWorkflowStepFieldsAttachments:tt.addMany,setWorkflowStepFieldsAttachment:tt.setOne,setWorkflowStepFieldsAttachments:tt.setMany,updateWorkflowStepFieldsAttachment:tt.updateOne,updateWorkflowStepFieldsAttachments:tt.updateMany,deleteWorkflowStepFieldsAttachment:tt.deleteOne,deleteWorkflowStepFieldsAttachments:tt.deleteMany}}),{initializeWorkflowStepFieldsAttachments:WO,addWorkflowStepFieldsAttachment:zO,addWorkflowStepFieldsAttachments:ca,setWorkflowStepFieldsAttachment:qO,setWorkflowStepFieldsAttachments:DO,updateWorkflowStepFieldsAttachment:jO,updateWorkflowStepFieldsAttachments:$O,deleteWorkflowStepFieldsAttachment:CO,deleteWorkflowStepFieldsAttachments:ra}=aa.actions,UO=t=>t.workflowStepFieldsAttachmentReducer.instances,da=o.createSelector([UO],t=>Object.values(t)),LO=S(o.createSelector([da,(t,s)=>s],(t,s)=>A(t.filter(e=>e.fields_revision===s)))),NO=t=>s=>s.workflowStepFieldsAttachmentReducer.instances[t],GO=S(o.createSelector([da,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),HO=aa.reducer,st=F(t=>t.uuid),KO={instances:{}},la=o.createSlice({name:"workflowStepFields",initialState:KO,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,KO)),reducers:{initializeWorkflowStepFields:st.initialize,addWorkflowStepFields:st.addOne,addWorkflowStepFieldsMany:st.addMany,setWorkflowStepFields:st.setOne,setWorkflowStepFieldsMany:st.setMany,updateWorkflowStepFields:st.updateOne,updateWorkflowStepFieldsMany:st.updateMany,deleteWorkflowStepFields:st.deleteOne,deleteWorkflowStepFieldsMany:st.deleteMany}}),{initializeWorkflowStepFields:YO,addWorkflowStepFields:JO,addWorkflowStepFieldsMany:ZO,setWorkflowStepFields:QO,setWorkflowStepFieldsMany:XO,updateWorkflowStepFields:xO,updateWorkflowStepFieldsMany:eF,deleteWorkflowStepFields:tF,deleteWorkflowStepFieldsMany:sF}=la.actions,iF=t=>t.workflowStepFieldsReducer.instances,os=o.createSelector([iF],t=>Object.values(t)),Kb=S(o.createSelector([os,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),Yb=S(o.createSelector([os,(t,s)=>s],(t,s)=>t.filter(e=>e.workflow_step===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),nF=t=>s=>s.workflowStepFieldsReducer.instances[t],aF=S(o.createSelector([os,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),cF=la.reducer,it=F(t=>t.uuid),rF={instances:{}},ua=o.createSlice({name:"workflowStepFieldValuesAttachments",initialState:rF,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,rF)),reducers:{initializeWorkflowStepFieldValuesAttachments:it.initialize,addWorkflowStepFieldValuesAttachment:it.addOne,addWorkflowStepFieldValuesAttachments:it.addMany,setWorkflowStepFieldValuesAttachment:it.setOne,setWorkflowStepFieldValuesAttachments:it.setMany,updateWorkflowStepFieldValuesAttachment:it.updateOne,updateWorkflowStepFieldValuesAttachments:it.updateMany,deleteWorkflowStepFieldValuesAttachment:it.deleteOne,deleteWorkflowStepFieldValuesAttachments:it.deleteMany}}),{initializeWorkflowStepFieldValuesAttachments:dF,addWorkflowStepFieldValuesAttachment:lF,addWorkflowStepFieldValuesAttachments:oa,setWorkflowStepFieldValuesAttachment:uF,setWorkflowStepFieldValuesAttachments:oF,updateWorkflowStepFieldValuesAttachment:hF,updateWorkflowStepFieldValuesAttachments:pF,deleteWorkflowStepFieldValuesAttachment:mF,deleteWorkflowStepFieldValuesAttachments:ha}=ua.actions,yF=t=>t.workflowStepFieldValuesAttachmentReducer.instances,pa=o.createSelector([yF],t=>Object.values(t)),fF=t=>s=>s.workflowStepFieldValuesAttachmentReducer.instances[t],SF=S(o.createSelector([pa,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),AF=S(o.createSelector([pa,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),wF=ua.reducer,nt=F(t=>t.uuid),TF={instances:{}},ma=o.createSlice({name:"workflowStepFieldValues",initialState:TF,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,TF)),reducers:{initializeWorkflowStepFieldValues:nt.initialize,addWorkflowStepFieldValues:nt.addOne,addWorkflowStepFieldValuesMany:nt.addMany,setWorkflowStepFieldValues:nt.setOne,setWorkflowStepFieldValuesMany:nt.setMany,updateWorkflowStepFieldValues:nt.updateOne,updateWorkflowStepFieldValuesMany:nt.updateMany,deleteWorkflowStepFieldValues:nt.deleteOne,deleteWorkflowStepFieldValuesMany:nt.deleteMany}}),{initializeWorkflowStepFieldValues:IF,addWorkflowStepFieldValues:OF,addWorkflowStepFieldValuesMany:FF,setWorkflowStepFieldValues:_F,setWorkflowStepFieldValuesMany:gF,updateWorkflowStepFieldValues:PF,updateWorkflowStepFieldValuesMany:bF,deleteWorkflowStepFieldValues:RF,deleteWorkflowStepFieldValuesMany:MF}=ma.actions,kF=t=>t.workflowStepFieldValuesReducer.instances,ht=o.createSelector([kF],t=>Object.values(t)),Jb=S(o.createSelector([ht,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow===s)))),Zb=S(o.createSelector([ht,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),EF=t=>s=>s.workflowStepFieldValuesReducer.instances[t],vF=S(o.createSelector([ht,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Qb=S(o.createSelector([ht,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>A(t.filter(({workflow:n,workflow_step:a})=>n===s&&a===e)))),Xb=S(o.createSelector([ht,(t,s)=>s],(t,s)=>{const e={};for(const n of t){const{workflow:a,workflow_step:c}=n;if(a!==s)continue;const r=e[c];(!r||r.submitted_at<=n.submitted_at)&&(e[c]=n)}return e})),VF=ma.reducer,at=F(t=>t.uuid),BF={instances:{}},ya=o.createSlice({name:"workflowStepFieldValuesReviewRequests",initialState:BF,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,BF)),reducers:{initializeWorkflowStepFieldValuesReviewRequests:at.initialize,addWorkflowStepFieldValuesReviewRequest:at.addOne,addWorkflowStepFieldValuesReviewRequests:at.addMany,setWorkflowStepFieldValuesReviewRequest:at.setOne,setWorkflowStepFieldValuesReviewRequests:at.setMany,updateWorkflowStepFieldValuesReviewRequest:at.updateOne,updateWorkflowStepFieldValuesReviewRequests:at.updateMany,deleteWorkflowStepFieldValuesReviewRequest:at.deleteOne,deleteWorkflowStepFieldValuesReviewRequests:at.deleteMany}}),{initializeWorkflowStepFieldValuesReviewRequests:WF,addWorkflowStepFieldValuesReviewRequest:zF,addWorkflowStepFieldValuesReviewRequests:fa,setWorkflowStepFieldValuesReviewRequest:qF,setWorkflowStepFieldValuesReviewRequests:DF,updateWorkflowStepFieldValuesReviewRequest:jF,updateWorkflowStepFieldValuesReviewRequests:$F,deleteWorkflowStepFieldValuesReviewRequest:CF,deleteWorkflowStepFieldValuesReviewRequests:Sa}=ya.actions,UF=t=>t.workflowStepFieldValuesReviewRequestReducer.instances,zt=o.createSelector([UF],t=>Object.values(t)),LF=t=>s=>s.workflowStepFieldValuesReviewRequestReducer.instances[t],NF=S(o.createSelector([zt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),GF=S(o.createSelector([zt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),xb=S(o.createSelector([zt,(t,s)=>s],(t,s)=>{let e;for(const n of t){const{field_values:a}=n;a===s&&(!e||e.submitted_at<=n.submitted_at)&&(e=n)}return e})),eR=S(o.createSelector([ht,zt,(t,s)=>s,(t,s,e)=>e],(t,s,e,n)=>{const a=new Set(V(t.filter(({workflow_step:c,workflow:r})=>e===r&&c===n)));return A(s.filter(({field_values:c})=>a.has(c)))})),HF=ya.reducer,ct=F(t=>t.uuid),KF={instances:{}},Aa=o.createSlice({name:"workflowStepFieldValuesReviews",initialState:KF,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,KF)),reducers:{initializeWorkflowStepFieldValuesReviews:ct.initialize,addWorkflowStepFieldValuesReview:ct.addOne,addWorkflowStepFieldValuesReviews:ct.addMany,setWorkflowStepFieldValuesReview:ct.setOne,setWorkflowStepFieldValuesReviews:ct.setMany,updateWorkflowStepFieldValuesReview:ct.updateOne,updateWorkflowStepFieldValuesReviews:ct.updateMany,deleteWorkflowStepFieldValuesReview:ct.deleteOne,deleteWorkflowStepFieldValuesReviews:ct.deleteMany}}),{initializeWorkflowStepFieldValuesReviews:YF,addWorkflowStepFieldValuesReview:JF,addWorkflowStepFieldValuesReviews:wa,setWorkflowStepFieldValuesReview:ZF,setWorkflowStepFieldValuesReviews:QF,updateWorkflowStepFieldValuesReview:XF,updateWorkflowStepFieldValuesReviews:xF,deleteWorkflowStepFieldValuesReview:e_,deleteWorkflowStepFieldValuesReviews:Ta}=Aa.actions,t_=t=>t.workflowStepFieldValuesReviewReducer.instances,Tt=o.createSelector([t_],t=>Object.values(t)),s_=t=>s=>s.workflowStepFieldValuesReviewReducer.instances[t],i_=S(o.createSelector([Tt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),n_=S(o.createSelector([Tt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),tR=S(o.createSelector([Tt,(t,s)=>s],(t,s)=>{let e;for(const n of t){const{field_values:a}=n;a===s&&(!e||e.submitted_at<=n.submitted_at)&&(e=n)}return e})),sR=S(o.createSelector([ht,Tt,(t,s)=>s,(t,s,e)=>e],(t,s,e,n)=>{const a=new Set(V(t.filter(({workflow_step:c,workflow:r})=>e===r&&c===n)));return A(s.filter(({field_values:c})=>a.has(c)))})),iR=o.createSelector([Tt],t=>{const s={};for(const e of t){const{field_values:n}=e,a=s[n];(!a||a.submitted_at<=e.submitted_at)&&(s[n]=e)}return s}),a_=Aa.reducer,rt=F(t=>t.uuid),c_={instances:{}},Ia=o.createSlice({name:"workflowStepReviewers",initialState:c_,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,c_)),reducers:{initializeWorkflowStepReviewers:rt.initialize,addWorkflowStepReviewer:rt.addOne,addWorkflowStepReviewers:rt.addMany,setWorkflowStepReviewer:rt.setOne,setWorkflowStepReviewers:rt.setMany,updateWorkflowStepReviewer:rt.updateOne,updateWorkflowStepReviewers:rt.updateMany,deleteWorkflowStepReviewer:rt.deleteOne,deleteWorkflowStepReviewers:rt.deleteMany}}),{initializeWorkflowStepReviewers:r_,addWorkflowStepReviewer:d_,addWorkflowStepReviewers:l_,setWorkflowStepReviewer:u_,setWorkflowStepReviewers:o_,updateWorkflowStepReviewer:h_,updateWorkflowStepReviewers:p_,deleteWorkflowStepReviewer:m_,deleteWorkflowStepReviewers:y_}=Ia.actions,f_=t=>t.workflowStepReviewerReducer.instances,qt=o.createSelector([f_],t=>Object.values(t)),S_=t=>s=>s.workflowStepReviewerReducer.instances[t],A_=S(o.createSelector([qt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),nR=S(o.createSelector([qt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow===s)))),aR=S(o.createSelector([qt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),cR=S(o.createSelector([qt,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>A(t.filter(({workflow:n,workflow_step:a})=>n===s&&a===e)))),w_=Ia.reducer,dt=F(t=>t.uuid),T_={instances:{}},Oa=o.createSlice({name:"workflowSteps",initialState:T_,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,T_)),reducers:{initializeWorkflowSteps:dt.initialize,addWorkflowStep:dt.addOne,addWorkflowSteps:dt.addMany,setWorkflowStep:dt.setOne,setWorkflowSteps:dt.setMany,updateWorkflowStep:dt.updateOne,updateWorkflowSteps:dt.updateMany,deleteWorkflowStep:dt.deleteOne,deleteWorkflowSteps:dt.deleteMany}}),{initializeWorkflowSteps:I_,addWorkflowStep:O_,addWorkflowSteps:F_,setWorkflowStep:__,setWorkflowSteps:g_,updateWorkflowStep:P_,updateWorkflowSteps:b_,deleteWorkflowStep:R_,deleteWorkflowSteps:M_}=Oa.actions,k_=t=>t.workflowStepReducer.instances,Fa=o.createSelector([k_],t=>Object.values(t)),E_=t=>s=>s.workflowStepReducer.instances[t],v_=S(o.createSelector([Fa,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),rR=S(o.createSelector([Fa,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_type===s)))),V_=Oa.reducer,lt=F(t=>t.uuid),B_={instances:{}},_a=o.createSlice({name:"workflowTypes",initialState:B_,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,B_)),reducers:{initializeWorkflowTypes:lt.initialize,addWorkflowType:lt.addOne,addWorkflowTypes:lt.addMany,setWorkflowType:lt.setOne,setWorkflowTypes:lt.setMany,updateWorkflowType:lt.updateOne,updateWorkflowTypes:lt.updateMany,deleteWorkflowType:lt.deleteOne,deleteWorkflowTypes:lt.deleteMany}}),{initializeWorkflowTypes:W_,addWorkflowType:z_,addWorkflowTypes:q_,setWorkflowType:D_,setWorkflowTypes:j_,updateWorkflowType:$_,updateWorkflowTypes:C_,deleteWorkflowType:U_,deleteWorkflowTypes:L_}=_a.actions,N_=t=>t.workflowTypeReducer.instances,ga=o.createSelector([N_],t=>Object.values(t)),G_=t=>s=>s.workflowTypeReducer.instances[t],H_=S(o.createSelector([ga,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),dR=S(o.createSelector([ga,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),K_=_a.reducer,Pa={outboxReducer:Xw,fileReducer:Tp,authReducer:Mh},lR=o.combineReducers(Pa),Y_={...Pa,[Rt]:EI,assetReducer:Wl,assetAttachmentReducer:Tc,assetStageCompletionReducer:Hl,assetStageReducer:ru,assetTypeReducer:hh,assetTypeAttachmentReducer:Ou,issueReducer:Bf,issueAttachmentReducer:Ky,issueTypeReducer:qA,issueTypeAttachmentReducer:Yf,organizationReducer:Hw,projectReducer:QT,projectAttachmentReducer:gT,projectAccessReducer:lT,organizationAccessReducer:Rw,projectFileReducer:$T,rehydratedReducer:tI,formReducer:Mm,formRevisionReducer:Am,formRevisionAttachmentReducer:dm,formSubmissionAttachmentReducer:Nm,formSubmissionReducer:iy,formIdentifierReducer:Bp,formIdentifierValueReducer:Yp,userReducer:yw,emailDomainsReducer:Sp,documentsReducer:ep,documentAttachmentReducer:Lh,teamReducer:MI,agentsReducer:rc,issueCommentReducer:If,issueCommentAttachmentReducer:df,issueUpdateReducer:cw,geoImageReducer:Sy,issueAssociationReducer:By,issueTypeFieldsReducer:zS,issueTypeFieldValuesReducer:OS,issueTypeFieldsAttachmentReducer:dS,issueTypeFieldValuesAttachmentReducer:JS,issueTypeIdentifierReducer:lA,issueTypeIdentifierValueReducer:FA,issueTypeStatusReducer:ZA,assetTypeFieldsReducer:Zu,assetTypeFieldValuesReducer:_o,assetTypeFieldsAttachmentReducer:zu,assetTypeFieldValuesAttachmentReducer:uo,assetTypeIdentifierReducer:Do,assetTypeIdentifierValueReducer:Xo,assetTypeStatusReducer:Ph,assetProcedureTypeReducer:ad,assetProcedureReducer:Nr,assetProcedureTypeFieldsReducer:ar,assetProcedureTypeFieldValuesReducer:vr,assetProcedureTypeFieldsAttachmentReducer:Gc,assetProcedureTypeFieldValuesAttachmentReducer:Sr,assetProcedureTypeAttachmentReducer:Ec,assetProcedureStepFieldsAttachmentReducer:Od,assetProcedureStepFieldsReducer:Wd,assetProcedureStepFieldValuesAttachmentReducer:Yd,assetProcedureStepFieldValuesReducer:dl,assetProcedureStepReducer:wl,teamMembershipReducer:hI,workflowTypeReducer:K_,workflowStepReducer:V_,workflowStepFieldsReducer:cF,workflowStepFieldsAttachmentReducer:HO,workflowReducer:GI,workflowStepAssigneeReducer:aO,workflowStepCommentReducer:wO,workflowStepEventReducer:VO,workflowStepFieldValuesReducer:VF,workflowStepFieldValuesAttachmentReducer:wF,workflowStepFieldValuesReviewReducer:a_,workflowStepFieldValuesReviewRequestReducer:HF,workflowStepReviewerReducer:w_},uR=o.combineReducers(Y_),J_=1e4,Z_=200,ba=[400,409,403,404,405,500],ut=1e4,Q_={};class X_{constructor(s){m(this,"client");m(this,"pageSize",J_);Q_[this.constructor.name]=this,this.client=s}async performRequest(s,e){return this.client.performRequest(this.host,s,this,e)}async enqueueRequest(s){return this.client.enqueueRequest(s,this.host,this.constructor.name)}async performPagination(s,e){return this.client.performPagination(this.host,s,this.pageSize,this,e)}dispatch(s){this.client.store.dispatch(s)}}const x_=()=>sg.length-1,eg=t=>(t[Rt]={version:x_()},t),tg=()=>eg({}),oR=t=>(t.outboxReducer&&(t.outboxReducer.deletedRequests=[]),t),hR=t=>s=>{var e;return s===void 0&&(s={}),((e=s[Rt])==null?void 0:e.version)===x_()?s:t(s)},sg=[eg,tg,tg,oR],pR=Object.fromEntries(sg.map((t,s)=>[s,hR(t)])),mR=t=>{if(t)throw t;const s=_t();s?s.dispatch({type:"rehydrated/setRehydrated",payload:!0}):console.error("Client store not set")},ig=(t,s,e)=>{const n=At();return n?(n.addRequest(s),n.getQueue()):(console.warn("Outbox coordinator not set; cannot enqueue request yet."),[])},ng=(t,s,e)=>{const n=At();if(!n)return console.warn("Outbox coordinator not set; cannot dequeue request yet."),[];const c=s.meta.offlineAction.payload.uuid;return n.remove(c),n.getQueue()};async function yR(t,s){if(!s.payload)throw new Error("Received empty payload");return Sg(s)}const fR={...Ba,effect:yR,discard:cg,returnPromises:!0,persistCallback:mR,retry:TR,persistOptions:{storage:_g},queue:{...Ba.queue,enqueue:ig,dequeue:ng,peek:(...t)=>wR(...t)}},SR=gg(pR,Rt),AR=o.compose(Fg.offline(fR),SR);async function ag(t,s,e){if(s.store.getState().outboxReducer.deletedRequests.includes(t.payload.uuid))throw new Error("Request was marked for deletion");const a=Q_[t.meta.offline.effect.serviceName];if(!a)throw new Error(`Service ${t.meta.offline.effect.serviceName} not found`);return Ma(t.meta.offline.effect.BASE_URL,t.meta.offline.effect.request,s,a,e)}function cg(t,s,e=0){var u;if(console.debug("Considering discarding request due to error:",t,`(${typeof t})`,`
|
|
1
|
+
(function(i,U){typeof exports=="object"&&typeof module<"u"?U(exports,require("@redux-offline/redux-offline/lib/types"),require("@reduxjs/toolkit"),require("superagent"),require("uuid"),require("react"),require("file-saver"),require("fast-tree-builder"),require("ts-tree-lib"),require("@redux-offline/redux-offline"),require("@redux-offline/redux-offline/lib/defaults"),require("localforage"),require("redux-persist-migrate"),require("buffer"),require("@overmap-ai/forms"),require("idb"),require("jwt-decode"),require("dependency-graph"),require("@tiptap/core")):typeof define=="function"&&define.amd?define(["exports","@redux-offline/redux-offline/lib/types","@reduxjs/toolkit","superagent","uuid","react","file-saver","fast-tree-builder","ts-tree-lib","@redux-offline/redux-offline","@redux-offline/redux-offline/lib/defaults","localforage","redux-persist-migrate","buffer","@overmap-ai/forms","idb","jwt-decode","dependency-graph","@tiptap/core"],U):(i=typeof globalThis<"u"?globalThis:i||self,U(i["overmap-core"]={},null,i.toolkit,i.request,i.uuid,i.react,i.fileSaver,i.buildTree,i.tsTreeLib,i.reduxOffline,i.offlineConfig,i.localforage,i.createMigration,null,null,i.idb,i.jwtDecode,i.dependencyGraph))})(this,function(i,U,o,Tt,ot,Ig,Og,Va,jt,Fg,Ba,_g,gg,sk,ik,Pg,bg,Rg){"use strict";var ek=Object.defineProperty;var tk=(i,U,o)=>U in i?ek(i,U,{enumerable:!0,configurable:!0,writable:!0,value:o}):i[U]=o;var m=(i,U,o)=>tk(i,typeof U!="symbol"?U+"":U,o);var wg;const Wa=Object.freeze([]),za=Object.freeze({});var qa=(t=>(t[t.GUEST=0]="GUEST",t[t.BASIC=2]="BASIC",t[t.ADMIN=4]="ADMIN",t))(qa||{}),h=(t=>(t.GET="GET",t.POST="POST",t.PATCH="PATCH",t.PUT="PUT",t.DELETE="DELETE",t))(h||{}),Da=(t=>(t[t.PLANNED=0]="PLANNED",t[t.ACTIVE=1]="ACTIVE",t[t.MAINTENANCE=2]="MAINTENANCE",t[t.INACTIVE=3]="INACTIVE",t[t.RETIRED=4]="RETIRED",t[t.DISPOSED=5]="DISPOSED",t))(Da||{}),ja=(t=>(t.Issue="issue",t.Asset="asset",t.AssetType="asset_type",t.Project="project",t.Document="document",t))(ja||{}),ps=(t=>(t[t.LOWEST=0]="LOWEST",t[t.LOW=2]="LOW",t[t.MEDIUM=4]="MEDIUM",t[t.HIGH=6]="HIGH",t[t.HIGHEST=8]="HIGHEST",t))(ps||{}),$=(t=>(t.STATUS="status",t.PRIORITY="priority",t.DESCRIPTION="description",t.TITLE="title",t.ASSIGNED_TO="assigned_to",t.DUE_DATE="due_date",t))($||{}),$a=(t=>(t[t.BACKLOG=0]="BACKLOG",t[t.PLANNED=1]="PLANNED",t[t.IN_PROGRESS=2]="IN_PROGRESS",t[t.COMPLETED=3]="COMPLETED",t[t.CANCELLED=4]="CANCELLED",t))($a||{}),Ca=(t=>(t[t.ADD_ASSIGNEE=0]="ADD_ASSIGNEE",t[t.REMOVE_ASSIGNEE=2]="REMOVE_ASSIGNEE",t[t.ADD_REVIEWER=4]="ADD_REVIEWER",t[t.REMOVE_REVIEWER=6]="REMOVE_REVIEWER",t[t.ADD_REVIEW_REQUEST=8]="ADD_REVIEW_REQUEST",t[t.REMOVE_REVIEW_REQUEST=10]="REMOVE_REVIEW_REQUEST",t))(Ca||{}),Pt=(t=>(t[t.ACTIVE=0]="ACTIVE",t[t.COMPLETED=2]="COMPLETED",t[t.CANCELLED=4]="CANCELLED",t))(Pt||{}),bt=(t=>(t[t.APPROVED=0]="APPROVED",t[t.REJECTED=2]="REJECTED",t[t.CHANGES_REQUESTED=4]="CHANGES_REQUESTED",t))(bt||{});const Mg=ps.MEDIUM,Ua=6e4,kg=[bt.APPROVED,bt.REJECTED,bt.CHANGES_REQUESTED],Eg=[Pt.ACTIVE,Pt.COMPLETED,Pt.CANCELLED];function F(t){return{addOne:(p,y)=>{const f=t(y.payload);p.instances[f]=y.payload},addMany:(p,y)=>{for(const f of y.payload){const T=t(f);p.instances[T]=f}},setOne:(p,y)=>{const f=t(y.payload);p.instances[f]=y.payload},setMany:(p,y)=>{for(const f of y.payload){const T=t(f);p.instances[T]=f}},updateOne:(p,y)=>{const f=t(y.payload);p.instances[f]=y.payload},updateMany:(p,y)=>{for(const f of y.payload){const T=t(f);p.instances[T]=f}},deleteOne:(p,y)=>{delete p.instances[y.payload]},deleteMany:(p,y)=>{for(const f of y.payload)delete p.instances[f]},initialize:(p,y)=>{p.instances={};const f=new Set;for(const T of y.payload){const P=t(T);f.add(P),p.instances[P]=T}f.size!==y.payload.length&&console.warn("duplicate ids detected when initializing model instances.")}}}function vg(){return{initializeSelection:(l,u)=>{l.selection=Array.from(new Set(u.payload))},selectOne:(l,u)=>{new Set(l.selection).has(u.payload)||l.selection.push(u.payload)},selectMany:(l,u)=>{const p=new Set(l.selection);for(const y of u.payload)p.has(y)||p.add(y);l.selection=Array.from(p)},unselectOne:(l,u)=>{const p=new Set(l.selection);p.has(u.payload)&&(p.delete(u.payload),l.selection=Array.from(p))},unselectMany:(l,u)=>{const p=new Set(l.selection);for(const y of u.payload)p.has(y)&&p.delete(y);l.selection=Array.from(p)},toggleOne:(l,u)=>{const p=new Set(l.selection);p.has(u.payload)?p.delete(u.payload):p.add(u.payload),l.selection=Array.from(p)},toggleMany:(l,u)=>{const p=new Set(l.selection);for(const y of u.payload)p.has(y)?p.delete(y):p.add(y);l.selection=Array.from(p)},getInitialState:l=>({...l,selection:[]})}}const Rt="versioning",I=o.createAction("RESET"),B=o.createAction("RESET_PROJECT_STATE"),_=o.createAction("RESET_ORGANIZATION_STATE");function Vg(t,s){return Ig.useMemo(t,s)}wg=Symbol.toStringTag;class ms{constructor(){m(this,wg,"Promise");m(this,"_promise");m(this,"_resolve");m(this,"_reject");m(this,"_state","pending");this._resolve=null,this._reject=null,this._promise=new Promise((s,e)=>{this._resolve=s,this._reject=e})}get state(){return this._state}then(s,e){return this._promise.then(s,e)}catch(s){return this._promise.catch(s)}resolve(s){if(!this._resolve)throw new Error("No resolve callback");this._resolve(s),this._state="fulfilled"}reject(s){if(!this._reject)throw s;this._reject(s),this._state="rejected"}finally(s){throw new Error("`finally` not implemented")}}let ys=!1;["true","1"].includes("".toLowerCase())&&(ys=!0);function Bg(t,s){if(t===s)return!0;if(typeof t!=typeof s)return!1;const e=Object.keys(t),n=Object.keys(s),a=e.length;if(a!==n.length)return!1;for(let c=0;c<a;c++){const r=e[c];if(!Object.prototype.hasOwnProperty.call(s,r)||t[r]!==s[r])return!1}return!0}function fs(t){const s={};return function(){const e=Array.prototype.slice.call(arguments);return e in s?(ys&&console.debug(`Memoization debug: Using memorized return value for ${t.toString()}(`,e,")"),s[e]):(ys&&console.debug(`Memoization debug: Cache miss! Memoizing ${t.toString()}(`,e,")"),s[e]=t.apply(this,e))}}function Wg(t,s){if(t.length!==s.length)return!1;for(let e=0;e<t.length;e++)if(t[e]!==s[e])return!1;return!0}const A=t=>t.length===0?Wa:t,$t=t=>Object.keys(t).length===0?za:t,La=fs(t=>{if(!t)return"";const s=new Date(t),e=s.getFullYear()===Ss.getFullYear(),n={day:"numeric",month:"short"};return e||(n.year="numeric"),s.toLocaleDateString([],n)}),zg=new Intl.RelativeTimeFormat([],{style:"long",numeric:"auto"}),qg=1e3*86400,Ss=new Date,Dg=t=>new Date(t).toDateString()===Ss.toDateString(),jg=fs((t,s,e)=>{const n=Math.round((new Date(t).getTime()-Ss.getTime())/qg);return n<s||n>e?La(t):zg.format(n,"days")});function $g(t){return new Uint8Array(t).reduce((e,n)=>e+n.toString(16).padStart(2,"0"),"")}function Ct(t){return new Promise((s,e)=>{const n=new FileReader;n.onload=()=>{const a=n.result;if(!a){e(new Error("FileReader did not return a valid ArrayBuffer."));return}crypto.subtle.digest("SHA-1",a).then(c=>{const r=$g(c);s(r)})},n.readAsArrayBuffer(t)})}const Cg=(t,s)=>`${t}${s?`.${s}`:""}`;function Ug(t,s){return new File([t],s,{type:t.type})}function Na(t){const s=t.name;return s.includes(".")?s.split(".").pop():""}const Ga=async t=>(await fetch(t)).blob(),Ha=async(t,s)=>{const e=await Ga(t);return new File([e],s,{type:e.type})};function Lg(t){const s=new Blob([t]);Og.saveAs(s,t.name)}function Ka(t){return typeof t=="string"&&t.startsWith("blob:")}function Ng(t){return t.type.startsWith("image/")}const Ya={};function Gg(t,s,e,...n){const a=Ya[t];let c=!1;a?a[s]||(a[s]=!0,c=!0):(Ya[t]={[s]:!0},c=!0),c&&console[e](...n)}const Ja=["created_at","updated_at","index","revision"];function O(t){return{...t,uuid:ot.v4()}}function Hg(t){const s={};for(const e of t)s[e.uuid]=e;return s}function V(t){return t.map(({uuid:s})=>s)}function Ut(t,s){return t.localeCompare(s)}function As(t,s){return Ut(t.uuid,s.uuid)}function Kg(t,s=void 0,e=255){let n=t.replace(/[^a-z0-9_\-.]/gi,"_").replace(/_{2,}/g,"_");if(!s){const c=t.split(".");c.length>1&&(s=c[c.length-1])}s&&!s.startsWith(".")&&(s="."+s);const a=s?s.length:0;return n.length+a>e&&(n=n.slice(0,e-a)+(s||"")),n}function Yg(t){return t.toLowerCase().replace(" ","-")}function Jg(t,s=!1){return t.normalize("NFKD").toLowerCase().replace(/[^\w\s-]/g,"").trim().replace(/[-\s]+/g,s?"_":"-")}function Zg(t,s){if(t.length<=s)return t;const e=t.slice(0,s-1);return e.slice(0,e.lastIndexOf(" "))+"…"}const Qg=/^.+@.+\..+$/;function R(t){const s={...t};for(const e of[...Ja,"created_by"])e in s&&delete s[e];return s}const Za=t=>{const s=t.toSorted((e,n)=>e.order-n.order);return Va(s,{id:e=>e.uuid,parentId:e=>e.parent,includeEmptyChildrenArray:!0,valueKey:!1})},Xg=t=>{const{roots:s}=Za(t);return s.map(e=>new jt.Tree(e))},Qa=(t,s)=>{const{nodes:e}=Za(s),n=e.get(t);if(!n)throw new Error(`Node with uuid ${t} does not exist in asset procedure step tree.`);return new jt.Tree(n)},Xa=(t,s)=>t.type!==s.type?t.type-s.type:t.order-s.order,xa=(t,s)=>t.type!==s.type?t.type-s.type:t.order-s.order,ec=t=>Va(t,{id:s=>s.uuid,parentId:s=>s.parent_document,includeEmptyChildrenArray:!0,valueKey:!1}),xg=t=>{const{roots:s}=ec(t);return s.map(e=>new jt.Tree(e))},tc=(t,s)=>{const{nodes:e}=ec(s),n=e.get(t);if(!n)throw new Error(`Node with uuid ${t} does not exist in document tree.`);return new jt.Tree(n)};class eP{constructor(s){m(this,"operations",[]);m(this,"getData");this.getData=s}performOperations(s){let e=s;for(const n of this.operations)e=n(e);return e}filter(s,e){return this.operations.push(n=>n.filter(a=>a[s]===e)),this}exclude(s,e){return this.operations.push(n=>n.filter(a=>a[s]!==e)),this}orderBy(s){return this.operations.push(e=>[...e].sort((n,a)=>n[s]<=a[s]?1:-1)),this}reverse(){return this.operations.push(s=>[...s].reverse()),this}all(){return this.operations.push(s=>s),this}get(s,e){return o.createSelector([this.getData],n=>this.performOperations(n).find(a=>a[s]===e))}count(){return o.createSelector([this.getData],s=>this.performOperations(s).length)}first(){return o.createSelector([this.getData],s=>this.performOperations(s)[0])}last(){return o.createSelector([this.getData],s=>{const e=this.performOperations(s);return e[e.length-1]})}exists(){return o.createSelector([this.getData],s=>this.performOperations(s).length>0)}toSelector(){return o.createSelector([this.getData],s=>A(this.performOperations(s)))}}const S=t=>(...s)=>e=>t(e,...s),N=F(t=>t.uuid),sc={instances:{}},ws=o.createSlice({name:"agents",initialState:sc,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,sc)),reducers:{initializeConversations:N.initialize,addConversation:N.addOne,addConversations:N.addMany,setConversation:N.setOne,setConversations:N.setMany,updateConversation:N.updateOne,updateConversations:N.updateMany,deleteConversation:N.deleteOne,deleteConversations:N.deleteMany}}),{initializeConversations:ic,addConversation:nc,addConversations:tP,setConversation:ac,setConversations:sP,updateConversation:cc,updateConversations:iP,deleteConversation:nP,deleteConversations:aP}=ws.actions,Ts=t=>t.agentsReducer.instances,cP=o.createSelector([Ts],t=>Object.values(t)),rP=S(o.createSelector([Ts,(t,s)=>s],(t,s)=>t[s])),rc=ws.reducer,G=F(t=>t.uuid),dc={instances:{}},Is=o.createSlice({name:"assetAttachments",initialState:dc,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,dc)),reducers:{initializeAssetAttachments:G.initialize,addAssetAttachment:G.addOne,addAssetAttachments:G.addMany,setAssetAttachment:G.setOne,setAssetAttachments:G.setMany,updateAssetAttachment:G.updateOne,updateAssetAttachments:G.updateMany,deleteAssetAttachment:G.deleteOne,deleteAssetAttachments:G.deleteMany}}),{initializeAssetAttachments:lc,addAssetAttachment:uc,addAssetAttachments:Os,setAssetAttachment:oc,setAssetAttachments:hc,updateAssetAttachment:pc,updateAssetAttachments:mc,deleteAssetAttachment:yc,deleteAssetAttachments:Fs}=Is.actions,fc=t=>t.assetAttachmentReducer.instances,_s=o.createSelector([fc],t=>Object.values(t)),Sc=t=>s=>s.assetAttachmentReducer.instances[t],Ac=S(o.createSelector([_s,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),wc=S(o.createSelector([_s,(t,s)=>s],(t,s)=>A(t.filter(({asset:e})=>s===e)))),Tc=Is.reducer,H=F(({uuid:t})=>t),Ic={instances:{}},gs=o.createSlice({name:"assetProcedureTypeAttachments",initialState:Ic,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,Ic)),reducers:{initializeAssetProcedureTypeAttachments:H.initialize,addAssetProcedureTypeAttachment:H.addOne,addAssetProcedureTypeAttachments:H.addMany,setAssetProcedureTypeAttachment:H.setOne,setAssetProcedureTypeAttachments:H.setMany,updateAssetProcedureTypeAttachment:H.updateOne,updateAssetProcedureTypeAttachments:H.updateMany,deleteAssetProcedureTypeAttachment:H.deleteOne,deleteAssetProcedureTypeAttachments:H.deleteMany}}),{initializeAssetProcedureTypeAttachments:Oc,addAssetProcedureTypeAttachment:Fc,addAssetProcedureTypeAttachments:_c,setAssetProcedureTypeAttachment:gc,setAssetProcedureTypeAttachments:Pc,updateAssetProcedureTypeAttachment:bc,updateAssetProcedureTypeAttachments:Rc,deleteAssetProcedureTypeAttachment:Mc,deleteAssetProcedureTypeAttachments:kc}=gs.actions,Ec=gs.reducer,vc=t=>t.assetProcedureTypeAttachmentReducer.instances,Ps=o.createSelector([vc],t=>Object.values(t)),Vc=t=>s=>s.assetProcedureTypeAttachmentReducer.instances[t],Bc=S(o.createSelector([Ps,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),dP=S(o.createSelector([Ps,(t,s)=>s],(t,s)=>A(t.filter(({asset_procedure_type:e})=>s===e)))),K=F(({uuid:t})=>t),Wc={instances:{}},bs=o.createSlice({name:"assetProcedureTypeFieldsAttachments",initialState:Wc,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,Wc)),reducers:{initializeAssetProcedureTypeFieldsAttachments:K.initialize,addAssetProcedureTypeFieldsAttachment:K.addOne,addAssetProcedureTypeFieldsAttachments:K.addMany,setAssetProcedureTypeFieldsAttachment:K.setOne,setAssetProcedureTypeFieldsAttachments:K.setMany,updateAssetProcedureTypeFieldsAttachment:K.updateOne,updateAssetProcedureTypeFieldsAttachments:K.updateMany,deleteAssetProcedureTypeFieldsAttachment:K.deleteOne,deleteAssetProcedureTypeFieldsAttachments:K.deleteMany}}),{initializeAssetProcedureTypeFieldsAttachments:zc,addAssetProcedureTypeFieldsAttachment:qc,addAssetProcedureTypeFieldsAttachments:Dc,setAssetProcedureTypeFieldsAttachment:jc,setAssetProcedureTypeFieldsAttachments:$c,updateAssetProcedureTypeFieldsAttachment:Cc,updateAssetProcedureTypeFieldsAttachments:Uc,deleteAssetProcedureTypeFieldsAttachment:Lc,deleteAssetProcedureTypeFieldsAttachments:Nc}=bs.actions,Gc=bs.reducer,Hc=t=>t.assetProcedureTypeFieldsAttachmentReducer.instances,Rs=o.createSelector([Hc],t=>Object.values(t)),lP=S(o.createSelector([Rs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.fields_revision===s)))),Kc=t=>s=>s.assetProcedureTypeFieldsAttachmentReducer.instances[t],Yc=S(o.createSelector([Rs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Y=F(({uuid:t})=>t),Jc={instances:{}},Ms=o.createSlice({name:"assetProcedureTypeFields",initialState:Jc,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,Jc)),reducers:{initializeAssetProcedureTypeFields:Y.initialize,addAssetProcedureTypeFields:Y.addOne,addAssetProcedureTypeFieldsMany:Y.addMany,setAssetProcedureTypeFields:Y.setOne,setAssetProcedureTypeFieldsMany:Y.setMany,updateAssetProcedureTypeFields:Y.updateOne,updateAssetProcedureTypeFieldsMany:Y.updateMany,deleteAssetProcedureTypeFields:Y.deleteOne,deleteAssetProcedureTypeFieldsMany:Y.deleteMany}}),{initializeAssetProcedureTypeFields:Zc,addAssetProcedureTypeFields:Qc,addAssetProcedureTypeFieldsMany:Xc,setAssetProcedureTypeFields:xc,setAssetProcedureTypeFieldsMany:er,updateAssetProcedureTypeFields:tr,updateAssetProcedureTypeFieldsMany:sr,deleteAssetProcedureTypeFields:ir,deleteAssetProcedureTypeFieldsMany:nr}=Ms.actions,ar=Ms.reducer,cr=t=>t.assetProcedureTypeFieldsReducer.instances,Lt=o.createSelector([cr],t=>Object.values(t)),uP=S(o.createSelector([Lt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure_type===s)))),oP=S(o.createSelector([Lt,(t,s)=>s],(t,s)=>t.filter(e=>e.asset_procedure_type===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),rr=t=>s=>s.assetProcedureTypeFieldsReducer.instances[t],dr=S(o.createSelector([Lt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),J=F(({uuid:t})=>t),lr={instances:{}},ks=o.createSlice({name:"assetProcedureTypeFieldValuesAttachments",initialState:lr,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,lr)),reducers:{initializeAssetProcedureTypeFieldValuesAttachments:J.initialize,addAssetProcedureTypeFieldValuesAttachment:J.addOne,addAssetProcedureTypeFieldValuesAttachments:J.addMany,setAssetProcedureTypeFieldValuesAttachment:J.setOne,setAssetProcedureTypeFieldValuesAttachments:J.setMany,updateAssetProcedureTypeFieldValuesAttachment:J.updateOne,updateAssetProcedureTypeFieldValuesAttachments:J.updateMany,deleteAssetProcedureTypeFieldValuesAttachment:J.deleteOne,deleteAssetProcedureTypeFieldValuesAttachments:J.deleteMany}}),{initializeAssetProcedureTypeFieldValuesAttachments:ur,addAssetProcedureTypeFieldValuesAttachment:or,addAssetProcedureTypeFieldValuesAttachments:Es,setAssetProcedureTypeFieldValuesAttachment:hr,setAssetProcedureTypeFieldValuesAttachments:pr,updateAssetProcedureTypeFieldValuesAttachment:mr,updateAssetProcedureTypeFieldValuesAttachments:yr,deleteAssetProcedureTypeFieldValuesAttachment:fr,deleteAssetProcedureTypeFieldValuesAttachments:vs}=ks.actions,Sr=ks.reducer,Ar=t=>t.assetProcedureTypeFieldValuesAttachmentReducer.instances,Vs=o.createSelector([Ar],t=>Object.values(t)),wr=t=>s=>s.assetProcedureTypeFieldValuesAttachmentReducer.instances[t],Tr=S(o.createSelector([Vs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Ir=S(o.createSelector([Vs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),Z=F(({uuid:t})=>t),Or={instances:{}},Bs=o.createSlice({name:"assetProcedureTypeFieldValues",initialState:Or,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,Or)),reducers:{initializeAssetProcedureTypeFieldValues:Z.initialize,addAssetProcedureTypeFieldValues:Z.addOne,addAssetProcedureTypeFieldValuesMany:Z.addMany,setAssetProcedureTypeFieldValues:Z.setOne,setAssetProcedureTypeFieldValuesMany:Z.setMany,updateAssetProcedureTypeFieldValues:Z.updateOne,updateAssetProcedureTypeFieldValuesMany:Z.updateMany,deleteAssetProcedureTypeFieldValues:Z.deleteOne,deleteAssetProcedureTypeFieldValuesMany:Z.deleteMany}}),{initializeAssetProcedureTypeFieldValues:Fr,addAssetProcedureTypeFieldValues:_r,addAssetProcedureTypeFieldValuesMany:gr,setAssetProcedureTypeFieldValues:Pr,setAssetProcedureTypeFieldValuesMany:br,updateAssetProcedureTypeFieldValues:Rr,updateAssetProcedureTypeFieldValuesMany:Mr,deleteAssetProcedureTypeFieldValues:kr,deleteAssetProcedureTypeFieldValuesMany:Er}=Bs.actions,vr=Bs.reducer,Vr=t=>t.assetProcedureTypeFieldValuesReducer.instances,Nt=o.createSelector([Vr],t=>Object.values(t)),hP=S(o.createSelector([Nt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset===s)))),pP=S(o.createSelector([Nt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure===s)))),Br=t=>s=>s.assetProcedureTypeFieldValuesReducer.instances[t],Wr=S(o.createSelector([Nt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Q=F(({uuid:t})=>t),zr={instances:{}},Ws=o.createSlice({name:"assetProcedures",initialState:zr,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,zr)),reducers:{initializeAssetProcedures:Q.initialize,addAssetProcedure:Q.addOne,addAssetProcedures:Q.addMany,setAssetProcedure:Q.setOne,setAssetProcedures:Q.setMany,updateAssetProcedure:Q.updateOne,updateAssetProcedures:Q.updateMany,deleteAssetProcedure:Q.deleteOne,deleteAssetProcedures:Q.deleteMany}}),{initializeAssetProcedures:qr,addAssetProcedure:Dr,addAssetProcedures:zs,updateAssetProcedure:jr,updateAssetProcedures:$r,deleteAssetProcedure:Cr,deleteAssetProcedures:qs,setAssetProcedure:Ur,setAssetProcedures:Lr}=Ws.actions,Nr=Ws.reducer,Gr=t=>t.assetProcedureReducer.instances,Gt=o.createSelector([Gr],t=>Object.values(t)),Hr=S(o.createSelector([Gt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure_type===s)))),mP=S(o.createSelector([Gt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_type===s)))),Kr=t=>s=>s.assetProcedureReducer.instances[t],Yr=S(o.createSelector([Gt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),X=F(t=>t.uuid),Jr={instances:{}},Ds=o.createSlice({name:"assetProcedureTypes",initialState:Jr,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,Jr)),reducers:{initializeAssetProcedureTypes:X.initialize,addAssetProcedureType:X.addOne,addAssetProcedureTypes:X.addMany,setAssetProcedureType:X.setOne,setAssetProcedureTypes:X.setMany,updateAssetProcedureType:X.updateOne,updateAssetProcedureTypes:X.updateMany,deleteAssetProcedureType:X.deleteOne,deleteAssetProcedureTypes:X.deleteMany}}),{initializeAssetProcedureTypes:Zr,addAssetProcedureType:Qr,addAssetProcedureTypes:Xr,updateAssetProcedureType:xr,updateAssetProcedureTypes:ed,deleteAssetProcedureType:td,deleteAssetProcedureTypes:sd,setAssetProcedureType:id,setAssetProcedureTypes:nd}=Ds.actions,ad=Ds.reducer,cd=t=>t.assetProcedureTypeReducer.instances,js=o.createSelector([cd],t=>Object.values(t)),rd=t=>s=>s.assetProcedureTypeReducer.instances[t],dd=S(o.createSelector([js,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),yP=S(o.createSelector([js,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),x=F(t=>t.uuid),ld={instances:{}},$s=o.createSlice({name:"assetProcedureStepFieldsAttachments",initialState:ld,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,ld)),reducers:{initializeAssetProcedureStepFieldsAttachments:x.initialize,addAssetProcedureStepFieldsAttachment:x.addOne,addAssetProcedureStepFieldsAttachments:x.addMany,setAssetProcedureStepFieldsAttachment:x.setOne,setAssetProcedureStepFieldsAttachments:x.setMany,updateAssetProcedureStepFieldsAttachment:x.updateOne,updateAssetProcedureStepFieldsAttachments:x.updateMany,deleteAssetProcedureStepFieldsAttachment:x.deleteOne,deleteAssetProcedureStepFieldsAttachments:x.deleteMany}}),{initializeAssetProcedureStepFieldsAttachments:ud,addAssetProcedureStepFieldsAttachment:od,addAssetProcedureStepFieldsAttachments:hd,setAssetProcedureStepFieldsAttachment:pd,setAssetProcedureStepFieldsAttachments:md,updateAssetProcedureStepFieldsAttachment:yd,updateAssetProcedureStepFieldsAttachments:fd,deleteAssetProcedureStepFieldsAttachment:Sd,deleteAssetProcedureStepFieldsAttachments:Ad}=$s.actions,wd=t=>t.assetProcedureStepFieldsAttachmentReducer.instances,Cs=o.createSelector([wd],t=>Object.values(t)),fP=S(o.createSelector([Cs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.fields_revision===s)))),Td=t=>s=>s.assetProcedureStepFieldsAttachmentReducer.instances[t],Id=S(o.createSelector([Cs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Od=$s.reducer,ee=F(t=>t.uuid),Fd={instances:{}},Us=o.createSlice({name:"assetProcedureStepFields",initialState:Fd,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,Fd)),reducers:{initializeAssetProcedureStepFields:ee.initialize,addAssetProcedureStepFields:ee.addOne,addAssetProcedureStepFieldsMany:ee.addMany,setAssetProcedureStepFields:ee.setOne,setAssetProcedureStepFieldsMany:ee.setMany,updateAssetProcedureStepFields:ee.updateOne,updateAssetProcedureStepFieldsMany:ee.updateMany,deleteAssetProcedureStepFields:ee.deleteOne,deleteAssetProcedureStepFieldsMany:ee.deleteMany}}),{initializeAssetProcedureStepFields:_d,addAssetProcedureStepFields:gd,addAssetProcedureStepFieldsMany:Pd,setAssetProcedureStepFields:bd,setAssetProcedureStepFieldsMany:Rd,updateAssetProcedureStepFields:Md,updateAssetProcedureStepFieldsMany:kd,deleteAssetProcedureStepFields:Ed,deleteAssetProcedureStepFieldsMany:vd}=Us.actions,Ls=t=>t.assetProcedureStepFieldsReducer.instances,Ht=o.createSelector([Ls],t=>Object.values(t)),SP=S(o.createSelector([Ht,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure_step===s)))),AP=S(o.createSelector([Ht,(t,s)=>s],(t,s)=>t.filter(e=>e.asset_procedure_step===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),wP=o.createSelector([Ls],t=>{const s={};for(const e of Object.values(t)){const n=s[e.asset_procedure_step];(!n||n.submitted_at<e.submitted_at)&&(s[e.asset_procedure_step]=e)}return s}),Vd=t=>s=>s.assetProcedureStepFieldsReducer.instances[t],Bd=S(o.createSelector([Ht,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Wd=Us.reducer,te=F(t=>t.uuid),zd={instances:{}},Ns=o.createSlice({name:"assetProcedureStepFieldValuesAttachments",initialState:zd,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,zd)),reducers:{initializeAssetProcedureStepFieldValuesAttachments:te.initialize,addAssetProcedureStepFieldValuesAttachment:te.addOne,addAssetProcedureStepFieldValuesAttachments:te.addMany,setAssetProcedureStepFieldValuesAttachment:te.setOne,setAssetProcedureStepFieldValuesAttachments:te.setMany,updateAssetProcedureStepFieldValuesAttachment:te.updateOne,updateAssetProcedureStepFieldValuesAttachments:te.updateMany,deleteAssetProcedureStepFieldValuesAttachment:te.deleteOne,deleteAssetProcedureStepFieldValuesAttachments:te.deleteMany}}),{initializeAssetProcedureStepFieldValuesAttachments:qd,addAssetProcedureStepFieldValuesAttachment:Dd,addAssetProcedureStepFieldValuesAttachments:Gs,setAssetProcedureStepFieldValuesAttachment:jd,setAssetProcedureStepFieldValuesAttachments:$d,updateAssetProcedureStepFieldValuesAttachment:Cd,updateAssetProcedureStepFieldValuesAttachments:Ud,deleteAssetProcedureStepFieldValuesAttachment:Ld,deleteAssetProcedureStepFieldValuesAttachments:Hs}=Ns.actions,Nd=t=>t.assetProcedureStepFieldValuesAttachmentReducer.instances,Ks=o.createSelector([Nd],t=>Object.values(t)),Gd=t=>s=>s.assetProcedureStepFieldValuesAttachmentReducer.instances[t],Hd=S(o.createSelector([Ks,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Kd=S(o.createSelector([Ks,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),Yd=Ns.reducer,se=F(t=>t.uuid),Jd={instances:{}},Ys=o.createSlice({name:"assetProcedureStepFieldValues",initialState:Jd,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,Jd)),reducers:{initializeAssetProcedureStepFieldValues:se.initialize,addAssetProcedureStepFieldValues:se.addOne,addAssetProcedureStepFieldValuesMany:se.addMany,setAssetProcedureStepFieldValues:se.setOne,setAssetProcedureStepFieldValuesMany:se.setMany,updateAssetProcedureStepFieldValues:se.updateOne,updateAssetProcedureStepFieldValuesMany:se.updateMany,deleteAssetProcedureStepFieldValues:se.deleteOne,deleteAssetProcedureStepFieldValuesMany:se.deleteMany}}),{initializeAssetProcedureStepFieldValues:Zd,addAssetProcedureStepFieldValues:Qd,addAssetProcedureStepFieldValuesMany:Xd,setAssetProcedureStepFieldValues:xd,setAssetProcedureStepFieldValuesMany:el,updateAssetProcedureStepFieldValues:tl,updateAssetProcedureStepFieldValuesMany:sl,deleteAssetProcedureStepFieldValues:il,deleteAssetProcedureStepFieldValuesMany:nl}=Ys.actions,al=t=>t.assetProcedureStepFieldValuesReducer.instances,Mt=o.createSelector([al],t=>Object.values(t)),TP=S(o.createSelector([Mt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset===s)))),IP=S(o.createSelector([Mt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure===s)))),OP=S(o.createSelector([Mt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure_step===s)))),cl=t=>s=>s.assetProcedureStepFieldValuesReducer.instances[t],rl=S(o.createSelector([Mt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),dl=Ys.reducer,ie=F(t=>t.uuid),ll={instances:{}},Js=o.createSlice({name:"assetProcedureSteps",initialState:ll,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,ll)),reducers:{initializeAssetProcedureSteps:ie.initialize,setAssetProcedureStep:ie.setOne,setAssetProcedureSteps:ie.setMany,addAssetProcedureStep:ie.addOne,addAssetProcedureSteps:ie.addMany,updateAssetProcedureStep:ie.updateOne,updateAssetProcedureSteps:ie.updateMany,deleteAssetProcedureStep:ie.deleteOne,deleteAssetProcedureSteps:ie.deleteMany}}),{initializeAssetProcedureSteps:ul,setAssetProcedureStep:ol,setAssetProcedureSteps:hl,addAssetProcedureStep:pl,addAssetProcedureSteps:ml,updateAssetProcedureStep:yl,updateAssetProcedureSteps:fl,deleteAssetProcedureStep:Sl,deleteAssetProcedureSteps:Al}=Js.actions,wl=Js.reducer,Kt=t=>t.assetProcedureStepReducer.instances,Tl=t=>s=>s.assetProcedureStepReducer.instances[t],Zs=o.createSelector([Kt],t=>Object.values(t)),FP=S(o.createSelector([Kt,(t,s)=>s],(t,s)=>{const e={};for(const[n,a]of Object.entries(t))a.asset_procedure_type===s&&(e[n]=a);return $t(e)})),_P=S(o.createSelector([Zs,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure_type===s)))),Il=S(o.createSelector([Zs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Ol=S(o.createSelector([Kt,(t,s)=>s],(t,s)=>{if(!t[s])return A([]);const a=Qa(s,Object.values(t)).all().map(({model:c})=>c);return A(a)})),ne=F(t=>t.uuid),Fl={instances:{}},Qs=o.createSlice({name:"assets",initialState:Fl,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,Fl)),reducers:{initializeAssets:ne.initialize,addAsset:ne.addOne,addAssets:ne.addMany,setAsset:ne.setOne,setAssets:ne.setMany,updateAsset:ne.updateOne,updateAssets:ne.updateMany,deleteAsset:ne.deleteOne,deleteAssets:ne.deleteMany}}),{initializeAssets:_l,addAsset:gl,addAssets:Xs,updateAsset:Pl,updateAssets:bl,deleteAsset:Rl,deleteAssets:xs,setAsset:Ml,setAssets:kl}=Qs.actions,El=t=>t.assetReducer.instances,Yt=o.createSelector([El],t=>A(Object.values(t))),gP=S(o.createSelector([Yt,(t,s)=>s],(t,s)=>A(t.filter(({project:e})=>e===s)))),vl=S(o.createSelector([Yt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_type===s)))),Vl=t=>s=>s.assetReducer.instances[t],Bl=S(o.createSelector([Yt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Wl=Qs.reducer,ae=F(t=>t.uuid),zl={instances:{}},ei=o.createSlice({name:"assetStageCompletions",initialState:zl,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,zl)),reducers:{initializeAssetStageCompletions:ae.initialize,addAssetStageCompletion:ae.addOne,addAssetStageCompletions:ae.addMany,setAssetStageCompletion:ae.setOne,setAssetStageCompletions:ae.setMany,updateAssetStageCompletion:ae.updateOne,updateAssetStageCompletions:ae.updateMany,deleteAssetStageCompletion:ae.deleteOne,deleteAssetStageCompletions:ae.deleteMany}}),{initializeAssetStageCompletions:ql,addAssetStageCompletion:Dl,addAssetStageCompletions:jl,setAssetStageCompletion:$l,setAssetStageCompletions:Cl,updateAssetStageCompletion:Ul,updateAssetStageCompletions:Ll,deleteAssetStageCompletion:Nl,deleteAssetStageCompletions:Gl}=ei.actions,Hl=ei.reducer,Kl=t=>t.assetStageCompletionReducer.instances,Yl=o.createSelector([Kl],t=>Object.values(t)),Jl=t=>s=>s.assetStageCompletionReducer.instances[t],Zl=S(o.createSelector([Yl,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),ce=F(t=>t.uuid),Ql={instances:{}},ti=o.createSlice({name:"assetStages",initialState:Ql,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,Ql)),reducers:{initializeAssetStages:ce.initialize,setAssetStage:ce.setOne,setAssetStages:ce.setMany,addAssetStage:ce.addOne,addAssetStages:ce.addMany,updateAssetStage:ce.updateOne,updateAssetStages:ce.updateMany,deleteAssetStage:ce.deleteOne,deleteAssetStages:ce.deleteMany}}),{initializeAssetStages:Xl,setAssetStage:xl,setAssetStages:eu,addAssetStage:tu,addAssetStages:su,updateAssetStage:iu,updateAssetStages:nu,deleteAssetStage:au,deleteAssetStages:cu}=ti.actions,ru=ti.reducer,si=t=>t.assetStageReducer.instances,du=t=>s=>s.assetStageReducer.instances[t],ii=o.createSelector([si],t=>Object.values(t)),PP=S(o.createSelector([si,(t,s)=>s],(t,s)=>{const e={};for(const[n,a]of Object.entries(t))a.asset_procedure_type===s&&(e[n]=a);return $t(e)})),bP=S(o.createSelector([ii,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_procedure_type===s)))),lu=S(o.createSelector([ii,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),re=F(t=>t.uuid),uu={instances:{}},ni=o.createSlice({name:"assetTypeAttachments",initialState:uu,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,uu)),reducers:{initializeAssetTypeAttachments:re.initialize,addAssetTypeAttachment:re.addOne,addAssetTypeAttachments:re.addMany,setAssetTypeAttachment:re.setOne,setAssetTypeAttachments:re.setMany,updateAssetTypeAttachment:re.updateOne,updateAssetTypeAttachments:re.updateMany,deleteAssetTypeAttachment:re.deleteOne,deleteAssetTypeAttachments:re.deleteMany}}),{initializeAssetTypeAttachments:ou,addAssetTypeAttachment:hu,addAssetTypeAttachments:ai,setAssetTypeAttachment:pu,setAssetTypeAttachments:mu,updateAssetTypeAttachment:yu,updateAssetTypeAttachments:fu,deleteAssetTypeAttachment:Su,deleteAssetTypeAttachments:ci}=ni.actions,Au=t=>t.assetTypeAttachmentReducer.instances,ri=o.createSelector([Au],t=>Object.values(t)),wu=t=>s=>s.assetTypeAttachmentReducer.instances[t],Tu=S(o.createSelector([ri,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Iu=S(o.createSelector([ri,(t,s)=>s],(t,s)=>A(t.filter(({asset_type:e})=>s===e)))),Ou=ni.reducer,de=F(t=>t.uuid),Fu={instances:{}},di=o.createSlice({name:"assetTypeFieldsAttachments",initialState:Fu,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,Fu)),reducers:{initializeAssetTypeFieldsAttachments:de.initialize,addAssetTypeFieldsAttachment:de.addOne,addAssetTypeFieldsAttachments:de.addMany,setAssetTypeFieldsAttachment:de.setOne,setAssetTypeFieldsAttachments:de.setMany,updateAssetTypeFieldsAttachment:de.updateOne,updateAssetTypeFieldsAttachments:de.updateMany,deleteAssetTypeFieldsAttachment:de.deleteOne,deleteAssetTypeFieldsAttachments:de.deleteMany}}),{initializeAssetTypeFieldsAttachments:_u,addAssetTypeFieldsAttachment:gu,addAssetTypeFieldsAttachments:Pu,setAssetTypeFieldsAttachment:bu,setAssetTypeFieldsAttachments:Ru,updateAssetTypeFieldsAttachment:Mu,updateAssetTypeFieldsAttachments:ku,deleteAssetTypeFieldsAttachment:Eu,deleteAssetTypeFieldsAttachments:vu}=di.actions,Vu=t=>t.assetTypeFieldsAttachmentReducer.instances,li=o.createSelector([Vu],t=>Object.values(t)),RP=S(o.createSelector([li,(t,s)=>s],(t,s)=>A(t.filter(e=>e.fields_revision===s)))),Bu=t=>s=>s.assetTypeFieldsAttachmentReducer.instances[t],Wu=S(o.createSelector([li,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),zu=di.reducer,le=F(t=>t.uuid),qu={instances:{}},ui=o.createSlice({name:"assetTypeFields",initialState:qu,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,qu)),reducers:{initializeAssetTypeFields:le.initialize,addAssetTypeFields:le.addOne,addAssetTypeFieldsMany:le.addMany,setAssetTypeFields:le.setOne,setAssetTypeFieldsMany:le.setMany,updateAssetTypeFields:le.updateOne,updateAssetTypeFieldsMany:le.updateMany,deleteAssetTypeFields:le.deleteOne,deleteAssetTypeFieldsMany:le.deleteMany}}),{initializeAssetTypeFields:Du,addAssetTypeFields:ju,addAssetTypeFieldsMany:$u,setAssetTypeFields:Cu,setAssetTypeFieldsMany:Uu,updateAssetTypeFields:Lu,updateAssetTypeFieldsMany:Nu,deleteAssetTypeFields:Gu,deleteAssetTypeFieldsMany:Hu}=ui.actions,Ku=t=>t.assetTypeFieldsReducer.instances,kt=o.createSelector([Ku],t=>Object.values(t)),MP=S(o.createSelector([kt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_type===s)))),kP=S(o.createSelector([kt,(t,s)=>s],(t,s)=>t.filter(e=>e.asset_type===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),Yu=t=>s=>s.assetTypeFieldsReducer.instances[t],Ju=S(o.createSelector([kt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Zu=ui.reducer,ue=F(t=>t.uuid),Qu={instances:{}},oi=o.createSlice({name:"assetTypeFieldValuesAttachments",initialState:Qu,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,Qu)),reducers:{initializeAssetTypeFieldValuesAttachments:ue.initialize,addAssetTypeFieldValuesAttachment:ue.addOne,addAssetTypeFieldValuesAttachments:ue.addMany,setAssetTypeFieldValuesAttachment:ue.setOne,setAssetTypeFieldValuesAttachments:ue.setMany,updateAssetTypeFieldValuesAttachment:ue.updateOne,updateAssetTypeFieldValuesAttachments:ue.updateMany,deleteAssetTypeFieldValuesAttachment:ue.deleteOne,deleteAssetTypeFieldValuesAttachments:ue.deleteMany}}),{initializeAssetTypeFieldValuesAttachments:Xu,addAssetTypeFieldValuesAttachment:xu,addAssetTypeFieldValuesAttachments:hi,setAssetTypeFieldValuesAttachment:eo,setAssetTypeFieldValuesAttachments:to,updateAssetTypeFieldValuesAttachment:so,updateAssetTypeFieldValuesAttachments:io,deleteAssetTypeFieldValuesAttachment:no,deleteAssetTypeFieldValuesAttachments:pi}=oi.actions,ao=t=>t.assetTypeFieldValuesAttachmentReducer.instances,mi=o.createSelector([ao],t=>Object.values(t)),co=t=>s=>s.assetTypeFieldValuesAttachmentReducer.instances[t],ro=S(o.createSelector([mi,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),lo=S(o.createSelector([mi,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),uo=oi.reducer,oe=F(t=>t.uuid),oo={instances:{}},yi=o.createSlice({name:"assetTypeFieldValues",initialState:oo,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,oo)),reducers:{initializeAssetTypeFieldValues:oe.initialize,addAssetTypeFieldValues:oe.addOne,addAssetTypeFieldValuesMany:oe.addMany,setAssetTypeFieldValues:oe.setOne,setAssetTypeFieldValuesMany:oe.setMany,updateAssetTypeFieldValues:oe.updateOne,updateAssetTypeFieldValuesMany:oe.updateMany,deleteAssetTypeFieldValues:oe.deleteOne,deleteAssetTypeFieldValuesMany:oe.deleteMany}}),{initializeAssetTypeFieldValues:ho,addAssetTypeFieldValues:po,addAssetTypeFieldValuesMany:mo,setAssetTypeFieldValues:yo,setAssetTypeFieldValuesMany:fo,updateAssetTypeFieldValues:So,updateAssetTypeFieldValuesMany:Ao,deleteAssetTypeFieldValues:wo,deleteAssetTypeFieldValuesMany:To}=yi.actions,Io=t=>t.assetTypeFieldValuesReducer.instances,Jt=o.createSelector([Io],t=>Object.values(t)),EP=S(o.createSelector([Jt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset===s)))),vP=S(o.createSelector([kt,Jt,(t,s)=>s],(t,s,e)=>{const n=new Set(t.filter(a=>a.asset_type===e).map(a=>a.uuid));return A(s.filter(a=>n.has(a.fields_revision)))})),Oo=t=>s=>s.assetTypeFieldValuesReducer.instances[t],Fo=S(o.createSelector([Jt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),_o=yi.reducer,he=F(t=>t.uuid),go={instances:{}},fi=o.createSlice({name:"assetTypeIdentifiers",initialState:go,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,go)),reducers:{initializeAssetTypeIdentifiers:he.initialize,addAssetTypeIdentifier:he.addOne,addAssetTypeIdentifiers:he.addMany,setAssetTypeIdentifier:he.setOne,setAssetTypeIdentifiers:he.setMany,updateAssetTypeIdentifier:he.updateOne,updateAssetTypeIdentifiers:he.updateMany,deleteAssetTypeIdentifier:he.deleteOne,deleteAssetTypeIdentifiers:he.deleteMany}}),{initializeAssetTypeIdentifiers:Po,addAssetTypeIdentifier:bo,addAssetTypeIdentifiers:Ro,setAssetTypeIdentifier:Mo,setAssetTypeIdentifiers:ko,updateAssetTypeIdentifier:Eo,updateAssetTypeIdentifiers:vo,deleteAssetTypeIdentifier:Vo,deleteAssetTypeIdentifiers:Bo}=fi.actions,Wo=t=>t.assetTypeIdentifierReducer.instances,Si=o.createSelector([Wo],t=>Object.values(t)),zo=t=>s=>s.assetTypeIdentifierReducer.instances[t],qo=S(o.createSelector([Si,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),VP=S(o.createSelector([Si,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_type===s)))),Do=fi.reducer,pe=F(t=>t.uuid),jo={instances:{}},Ai=o.createSlice({name:"assetTypeIdentifierValues",initialState:jo,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,jo)),reducers:{initializeAssetTypeIdentifierValues:pe.initialize,addAssetTypeIdentifierValue:pe.addOne,addAssetTypeIdentifierValues:pe.addMany,setAssetTypeIdentifierValue:pe.setOne,setAssetTypeIdentifierValues:pe.setMany,updateAssetTypeIdentifierValue:pe.updateOne,updateAssetTypeIdentifierValues:pe.updateMany,deleteAssetTypeIdentifierValue:pe.deleteOne,deleteAssetTypeIdentifierValues:pe.deleteMany}}),{initializeAssetTypeIdentifierValues:$o,addAssetTypeIdentifierValue:Co,addAssetTypeIdentifierValues:Uo,setAssetTypeIdentifierValue:Lo,setAssetTypeIdentifierValues:No,updateAssetTypeIdentifierValue:Go,updateAssetTypeIdentifierValues:Ho,deleteAssetTypeIdentifierValue:Ko,deleteAssetTypeIdentifierValues:Yo}=Ai.actions,Jo=t=>t.assetTypeIdentifierValueReducer.instances,Zt=o.createSelector([Jo],t=>Object.values(t)),Zo=t=>s=>s.assetTypeIdentifierValueReducer.instances[t],Qo=S(o.createSelector([Zt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),BP=S(o.createSelector([Zt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset===s)))),WP=S(o.createSelector([Zt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_type_identifier===s)))),Xo=Ai.reducer,me=F(t=>t.uuid),xo={instances:{}},wi=o.createSlice({name:"assetTypes",initialState:xo,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,xo)),reducers:{initializeAssetTypes:me.initialize,setAssetType:me.setOne,setAssetTypes:me.setMany,addAssetType:me.addOne,addAssetTypes:me.addMany,updateAssetType:me.updateOne,updateAssetTypes:me.updateMany,deleteAssetType:me.deleteOne,deleteAssetTypes:me.deleteMany}}),{initializeAssetTypes:eh,setAssetType:th,setAssetTypes:sh,addAssetType:ih,addAssetTypes:nh,updateAssetType:ah,updateAssetTypes:ch,deleteAssetType:rh,deleteAssetTypes:dh}=wi.actions,lh=t=>t.assetTypeReducer.instances,Ti=o.createSelector([lh],t=>Object.values(t)),uh=t=>s=>s.assetTypeReducer.instances[t],oh=S(o.createSelector([Ti,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),zP=S(o.createSelector([Ti,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),hh=wi.reducer,ye=F(t=>t.uuid),ph={instances:{}},Ii=o.createSlice({name:"assetTypeStatuses",initialState:ph,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,ph)),reducers:{initializeAssetTypeStatuses:ye.initialize,addAssetTypeStatus:ye.addOne,addAssetTypeStatuses:ye.addMany,setAssetTypeStatus:ye.setOne,setAssetTypeStatuses:ye.setMany,updateAssetTypeStatus:ye.updateOne,updateAssetTypeStatuses:ye.updateMany,deleteAssetTypeStatus:ye.deleteOne,deleteAssetTypeStatuses:ye.deleteMany}}),{initializeAssetTypeStatuses:mh,addAssetTypeStatus:yh,addAssetTypeStatuses:fh,setAssetTypeStatus:Sh,setAssetTypeStatuses:Ah,updateAssetTypeStatus:wh,updateAssetTypeStatuses:Th,deleteAssetTypeStatus:Ih,deleteAssetTypeStatuses:Oh}=Ii.actions,Fh=t=>t.assetTypeStatusReducer.instances,Oi=o.createSelector([Fh],t=>A(Object.values(t).toSorted(Xa))),_h=t=>s=>s.assetTypeStatusReducer.instances[t],gh=S(o.createSelector([Oi,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),qP=S(o.createSelector([Oi,(t,s)=>s],(t,s)=>A(t.filter(e=>e.asset_type===s)))),Ph=Ii.reducer,bh={accessToken:"",refreshToken:"",isLoggedIn:!1},Qt=o.createSlice({name:"auth",initialState:bh,extraReducers:t=>t.addCase(I,s=>Object.assign(s,bh)),reducers:{setTokens:(t,s)=>{t.accessToken=s.payload.accessToken,t.refreshToken=s.payload.refreshToken},clearTokens:t=>{t.accessToken="",t.refreshToken=""},setLoggedIn:(t,s)=>{s.payload||Qt.caseReducers.clearTokens(t),t.isLoggedIn=s.payload}}}),{setTokens:DP,clearTokens:jP,setLoggedIn:Rh}=Qt.actions,$P=t=>t.authReducer.accessToken,CP=t=>t.authReducer.isLoggedIn,Mh=Qt.reducer,fe=F(t=>t.uuid),kh={instances:{}},Fi=o.createSlice({name:"documentAttachments",initialState:kh,extraReducers:t=>t.addCase(I,s=>Object.assign(s,kh)),reducers:{initializeDocumentAttachments:fe.initialize,addDocumentAttachment:fe.addOne,addDocumentAttachments:fe.addMany,setDocumentAttachment:fe.setOne,setDocumentAttachments:fe.setMany,updateDocumentAttachment:fe.updateOne,updateDocumentAttachments:fe.updateMany,deleteDocumentAttachment:fe.deleteOne,deleteDocumentAttachments:fe.deleteMany}}),{initializeDocumentAttachments:Eh,addDocumentAttachment:vh,addDocumentAttachments:Vh,setDocumentAttachment:Bh,setDocumentAttachments:Wh,updateDocumentAttachment:zh,updateDocumentAttachments:qh,deleteDocumentAttachment:Dh,deleteDocumentAttachments:jh}=Fi.actions,$h=t=>t.documentAttachmentReducer.instances,_i=o.createSelector([$h],t=>Object.values(t)),Ch=t=>s=>s.documentAttachmentReducer.instances[t],Uh=S(o.createSelector([_i,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),UP=S(o.createSelector([_i,(t,s)=>s],(t,s)=>A(t.filter(({document:e})=>s===e)))),Lh=Fi.reducer,Se=F(({uuid:t})=>t),Nh={instances:{}},gi=o.createSlice({name:"documents",initialState:Nh,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>{Object.assign(s,Nh)}),reducers:{initializeDocuments:Se.initialize,addDocument:Se.addOne,addDocuments:Se.addMany,setDocument:Se.setOne,setDocuments:Se.setMany,updateDocument:Se.updateOne,updateDocuments:Se.updateMany,deleteDocument:Se.deleteOne,deleteDocuments:Se.deleteMany}}),{initializeDocuments:Gh,addDocument:Hh,addDocuments:Kh,setDocument:Yh,setDocuments:Jh,updateDocument:Zh,updateDocuments:Qh,deleteDocument:Xh,deleteDocuments:xh}=gi.actions,ep=gi.reducer,Pi=t=>t.documentsReducer.instances,Xt=o.createSelector([Pi],t=>Object.values(t)),tp=t=>s=>s.documentsReducer.instances[t],sp=S(o.createSelector([Xt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),LP=S(o.createSelector([Xt,(t,s)=>s],(t,s)=>t.filter(e=>e.project===s))),NP=S(o.createSelector([Xt,(t,s)=>s],(t,s)=>t.filter(e=>e.organization===s))),ip=S(o.createSelector([Pi,(t,s)=>s],(t,s)=>{if(!t[s])return A([]);const a=tc(s,Object.values(t)).all().map(({model:c})=>c);return A(a)})),Ae=F(t=>t.uuid),np={instances:{}},bi=o.createSlice({name:"emailDomains",initialState:np,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,np)),reducers:{initializeEmailDomains:Ae.initialize,addEmailDomain:Ae.addOne,addEmailDomains:Ae.addMany,setEmailDomain:Ae.setOne,setEmailDomains:Ae.setMany,updateEmailDomain:Ae.updateOne,updateEmailDomains:Ae.updateMany,deleteEmailDomain:Ae.deleteOne,deleteEmailDomains:Ae.deleteMany}}),{initializeEmailDomains:ap,addEmailDomain:cp,addEmailDomains:rp,setEmailDomain:dp,setEmailDomains:lp,updateEmailDomain:up,updateEmailDomains:op,deleteEmailDomain:hp,deleteEmailDomains:pp}=bi.actions,mp=t=>t.emailDomainsReducer.instances,Ri=o.createSelector([mp],t=>Object.values(t)),yp=t=>s=>s.emailDomainsReducer.instances[t],fp=S(o.createSelector([Ri,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),GP=S(o.createSelector([Ri,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),Sp=bi.reducer,Ap={s3Urls:{}},wp=1e3*60*60,HP=wp*24*7,Mi=o.createSlice({name:"file",initialState:Ap,extraReducers:t=>t.addCase(I,s=>Object.assign(s,Ap)),reducers:{setUploadUrl:(t,s)=>{const{url:e,fields:n,sha1:a}=s.payload,c=new Date,r=new Date(c.getTime()+HP);t.s3Urls[a]={url:e,fields:n,exp:r.getTime()}}}}),{setUploadUrl:KP}=Mi.actions,YP=t=>s=>{const e=s.fileReducer.s3Urls[t];if(!e)return;const n=new Date().getTime();if(!((e.exp??n)-n<wp))return e},Tp=Mi.reducer,we=F(t=>t.uuid),Ip={instances:{}},ki=o.createSlice({name:"formIdentifiers",initialState:Ip,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,Ip)),reducers:{initializeFormIdentifiers:we.initialize,addFormIdentifier:we.addOne,addFormIdentifiers:we.addMany,setFormIdentifier:we.setOne,setFormIdentifiers:we.setMany,updateFormIdentifier:we.updateOne,updateFormIdentifiers:we.updateMany,deleteFormIdentifier:we.deleteOne,deleteFormIdentifiers:we.deleteMany}}),{initializeFormIdentifiers:Op,addFormIdentifier:Fp,addFormIdentifiers:_p,setFormIdentifier:gp,setFormIdentifiers:Pp,updateFormIdentifier:bp,updateFormIdentifiers:Rp,deleteFormIdentifier:Mp,deleteFormIdentifiers:kp}=ki.actions,Ep=t=>t.formIdentifierReducer.instances,Ei=o.createSelector([Ep],t=>Object.values(t)),vp=t=>s=>s.formIdentifierReducer.instances[t],Vp=S(o.createSelector([Ei,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),JP=S(o.createSelector([Ei,(t,s)=>s],(t,s)=>A(t.filter(e=>e.form===s)))),Bp=ki.reducer,Te=F(t=>t.uuid),Wp={instances:{}},vi=o.createSlice({name:"formIdentifierValues",initialState:Wp,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,Wp)),reducers:{initializeFormIdentifierValues:Te.initialize,addFormIdentifierValue:Te.addOne,addFormIdentifierValues:Te.addMany,setFormIdentifierValue:Te.setOne,setFormIdentifierValues:Te.setMany,updateFormIdentifierValue:Te.updateOne,updateFormIdentifierValues:Te.updateMany,deleteFormIdentifierValue:Te.deleteOne,deleteFormIdentifierValues:Te.deleteMany}}),{initializeFormIdentifierValues:zp,addFormIdentifierValue:qp,addFormIdentifierValues:Dp,setFormIdentifierValue:jp,setFormIdentifierValues:$p,updateFormIdentifierValue:Cp,updateFormIdentifierValues:Up,deleteFormIdentifierValue:Lp,deleteFormIdentifierValues:Np}=vi.actions,Gp=t=>t.formIdentifierValueReducer.instances,xt=o.createSelector([Gp],t=>Object.values(t)),Hp=t=>s=>s.formIdentifierValueReducer.instances[t],Kp=S(o.createSelector([xt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),ZP=S(o.createSelector([xt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.form_submission===s)))),QP=S(o.createSelector([xt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.form_identifier===s)))),Yp=vi.reducer,Ie=F(t=>t.uuid),Jp={instances:{}},Vi=o.createSlice({name:"formRevisionAttachments",initialState:Jp,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,Jp)),reducers:{initializeFormRevisionAttachments:Ie.initialize,addFormRevisionAttachment:Ie.addOne,addFormRevisionAttachments:Ie.addMany,setFormRevisionAttachment:Ie.setOne,setFormRevisionAttachments:Ie.setMany,updateFormRevisionAttachment:Ie.updateOne,updateFormRevisionAttachments:Ie.updateMany,deleteFormRevisionAttachment:Ie.deleteOne,deleteFormRevisionAttachments:Ie.deleteMany}}),{initializeFormRevisionAttachments:Zp,addFormRevisionAttachment:Qp,addFormRevisionAttachments:Xp,setFormRevisionAttachment:xp,setFormRevisionAttachments:em,updateFormRevisionAttachment:tm,updateFormRevisionAttachments:sm,deleteFormRevisionAttachment:im,deleteFormRevisionAttachments:nm}=Vi.actions,es=t=>t.formRevisionAttachmentReducer.instances,am=o.createSelector([es],t=>Object.values(t)),cm=S(o.createSelector([es,(t,s)=>s],(t,s)=>t[s])),rm=S(o.createSelector([am,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),XP=S(o.createSelector([es,(t,s)=>s],(t,s)=>A(Object.values(t).filter(e=>e.form_revision===s)))),dm=Vi.reducer,Oe=F(t=>t.uuid),lm={instances:{}},Bi=o.createSlice({name:"formRevisions",initialState:lm,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,lm)),reducers:{initializeFormRevisions:Oe.initialize,addFormRevision:Oe.addOne,addFormRevisions:Oe.addMany,setFormRevision:Oe.setOne,setFormRevisions:Oe.setMany,updateFormRevision:Oe.updateOne,updateFormRevisions:Oe.updateMany,deleteFormRevision:Oe.deleteOne,deleteFormRevisions:Oe.deleteMany}}),{initializeFormRevisions:um,addFormRevision:Wi,addFormRevisions:zi,setFormRevision:om,setFormRevisions:hm,updateFormRevision:pm,updateFormRevisions:mm,deleteFormRevision:qi,deleteFormRevisions:Di}=Bi.actions,ji=t=>t.formRevisionReducer.instances,ts=o.createSelector([ji],t=>Object.values(t)),ym=t=>s=>s.formRevisionReducer.instances[t],fm=S(o.createSelector([ts,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),xP=S(o.createSelector([ts,(t,s)=>s],(t,s)=>t.filter(e=>e.form===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),Sm=S(o.createSelector([ts,(t,s)=>s],(t,s)=>A(t.filter(e=>e.form===s)))),Am=Bi.reducer,Fe=F(t=>t.uuid),wm={instances:{}},$i=o.createSlice({name:"forms",initialState:wm,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,wm)),reducers:{initializeForms:Fe.initialize,addForm:Fe.addOne,addForms:Fe.addMany,setForm:Fe.setOne,setForms:Fe.setMany,updateForm:Fe.updateOne,updateForms:Fe.updateMany,deleteForm:Fe.deleteOne,deleteForms:Fe.deleteMany}}),{initializeForms:Tm,addForm:Im,addForms:Om,setForm:Fm,setForms:_m,updateForm:gm,updateForms:Pm,deleteForm:bm,deleteForms:Rm}=$i.actions,Mm=$i.reducer,km=t=>t.formReducer.instances,Ci=o.createSelector([km],t=>Object.values(t)),Em=t=>s=>s.formReducer.instances[t],vm=S(o.createSelector([Ci,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),eb=S(o.createSelector([Ci,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),_e=F(t=>t.uuid),Vm={instances:{}},Ui=o.createSlice({name:"formSubmissionAttachments",initialState:Vm,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,Vm)),reducers:{initializeFormSubmissionAttachments:_e.initialize,addFormSubmissionAttachment:_e.addOne,addFormSubmissionAttachments:_e.addMany,setFormSubmissionAttachment:_e.setOne,setFormSubmissionAttachments:_e.setMany,updateFormSubmissionAttachment:_e.updateOne,updateFormSubmissionAttachments:_e.updateMany,deleteFormSubmissionAttachment:_e.deleteOne,deleteFormSubmissionAttachments:_e.deleteMany}}),{initializeFormSubmissionAttachments:Bm,addFormSubmissionAttachment:Wm,addFormSubmissionAttachments:Li,setFormSubmissionAttachment:zm,setFormSubmissionAttachments:qm,updateFormSubmissionAttachment:Dm,updateFormSubmissionAttachments:jm,deleteFormSubmissionAttachment:$m,deleteFormSubmissionAttachments:Ni}=Ui.actions,Gi=t=>t.formSubmissionAttachmentReducer.instances,Hi=o.createSelector([Gi],t=>Object.values(t)),Cm=S(o.createSelector([Gi,(t,s)=>s],(t,s)=>t[s])),Ki=S(o.createSelector([Hi,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(n=>e.has(n.uuid)))})),Um=Ki,Lm=S(o.createSelector([Hi,(t,s)=>s],(t,s)=>A(t.filter(e=>e.form_submission===s)))),Nm=Ui.reducer,ge=F(t=>t.uuid),Gm={instances:{}},Yi=o.createSlice({name:"formSubmissions",initialState:Gm,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,Gm)),reducers:{initializeFormSubmissions:ge.initialize,setFormSubmission:ge.setOne,setFormSubmissions:ge.setMany,addFormSubmission:ge.addOne,addFormSubmissions:ge.addMany,updateFormSubmission:ge.updateOne,updateFormSubmissions:ge.updateMany,deleteFormSubmission:ge.deleteOne,deleteFormSubmissions:ge.deleteMany}}),{initializeFormSubmissions:Hm,setFormSubmission:Km,setFormSubmissions:Ym,addFormSubmission:Jm,addFormSubmissions:Ji,updateFormSubmission:Zm,updateFormSubmissions:Qm,deleteFormSubmission:Xm,deleteFormSubmissions:Zi}=Yi.actions,Qi=t=>t.formSubmissionReducer.instances,xm=o.createSelector([Qi],t=>Object.values(t)),ey=t=>s=>s.formSubmissionReducer.instances[t],ty=S(o.createSelector([xm,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),sy=S(o.createSelector([Qi,ji,(t,s)=>s],(t,s,e)=>{const n=new Set;for(const a of Object.values(s))a.form===e&&n.add(a.uuid);return Object.values(t).filter(a=>n.has(a.form_revision))})),iy=Yi.reducer,Pe=F(t=>t.uuid),ny={instances:{}},Xi=o.createSlice({name:"geoImages",initialState:ny,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,ny)),reducers:{initializeGeoImages:Pe.initialize,setGeoImage:Pe.setOne,setGeoImages:Pe.setMany,addGeoImage:Pe.addOne,addGeoImages:Pe.addMany,updateGeoImage:Pe.updateOne,updateGeoImages:Pe.updateMany,deleteGeoImage:Pe.deleteOne,deleteGeoImages:Pe.deleteMany}}),{initializeGeoImages:ay,setGeoImage:cy,setGeoImages:ry,addGeoImage:dy,addGeoImages:ly,updateGeoImage:uy,updateGeoImages:oy,deleteGeoImage:hy,deleteGeoImages:py}=Xi.actions,my=t=>t.geoImageReducer.instances,xi=o.createSelector([my],t=>Object.values(t)),yy=t=>s=>s.geoImageReducer.instances[t],fy=S(o.createSelector([xi,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),tb=S(o.createSelector([xi,(t,s)=>s],(t,s)=>A(t.filter(e=>e.project===s)))),Sy=Xi.reducer,be=F(t=>t.uuid),Ay={instances:{}},en=o.createSlice({name:"issueAssociations",initialState:Ay,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,Ay)),reducers:{initializeIssueAssociations:be.initialize,addIssueAssociation:be.addOne,addIssueAssociations:be.addMany,setIssueAssociation:be.setOne,setIssueAssociations:be.setMany,updateIssueAssociation:be.updateOne,updateIssueAssociations:be.updateMany,deleteIssueAssociation:be.deleteOne,deleteIssueAssociations:be.deleteMany}}),{initializeIssueAssociations:wy,setIssueAssociations:Ty,setIssueAssociation:Iy,updateIssueAssociation:Oy,updateIssueAssociations:Fy,addIssueAssociation:_y,addIssueAssociations:mt,deleteIssueAssociation:gy,deleteIssueAssociations:yt}=en.actions,Py=t=>t.issueAssociationReducer.instances,ft=o.createSelector([Py],t=>Object.values(t)),by=t=>s=>s.issueAssociationReducer.instances[t],Ry=S(o.createSelector([ft,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),My=S(o.createSelector([ft,(t,s)=>s],(t,s)=>A(t.filter(({associated_issue:e})=>e===s)))),ky=S(o.createSelector([ft,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({associated_issue:n})=>e.has(n)))})),Ey=S(o.createSelector([ft,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({issue:n})=>n&&e.has(n)))})),vy=S(o.createSelector([ft,(t,s)=>s],(t,s)=>A(t.filter(({issue:e})=>e===s)))),Vy=S(o.createSelector([ft,(t,s)=>s],(t,s)=>A(t.filter(({asset:e})=>e===s)))),By=en.reducer,Re=F(t=>t.uuid),Wy={instances:{}},tn=o.createSlice({name:"issueAttachments",initialState:Wy,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,Wy)),reducers:{initializeIssueAttachments:Re.initialize,addIssueAttachment:Re.addOne,addIssueAttachments:Re.addMany,setIssueAttachment:Re.setOne,setIssueAttachments:Re.setMany,updateIssueAttachment:Re.updateOne,updateIssueAttachments:Re.updateMany,deleteIssueAttachment:Re.deleteOne,deleteIssueAttachments:Re.deleteMany}}),{initializeIssueAttachments:zy,addIssueAttachment:qy,addIssueAttachments:sn,setIssueAttachment:Dy,setIssueAttachments:jy,updateIssueAttachment:$y,updateIssueAttachments:Cy,deleteIssueAttachment:Uy,deleteIssueAttachments:nn}=tn.actions,Ly=t=>t.issueAttachmentReducer.instances,an=o.createSelector([Ly],t=>Object.values(t)),Ny=S(o.createSelector([an,(t,s)=>s],(t,s)=>A(t.filter(({issue:e})=>s===e)))),Gy=t=>s=>s.issueAttachmentReducer.instances[t],Hy=S(o.createSelector([an,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Ky=tn.reducer,Me=F(t=>t.uuid),Yy={instances:{}},cn=o.createSlice({name:"issueCommentAttachments",initialState:Yy,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,Yy)),reducers:{initializeIssueCommentAttachments:Me.initialize,addIssueCommentAttachment:Me.addOne,addIssueCommentAttachments:Me.addMany,setIssueCommentAttachment:Me.setOne,setIssueCommentAttachments:Me.setMany,updateIssueCommentAttachment:Me.updateOne,updateIssueCommentAttachments:Me.updateMany,deleteIssueCommentAttachment:Me.deleteOne,deleteIssueCommentAttachments:Me.deleteMany}}),{initializeIssueCommentAttachments:Jy,addIssueCommentAttachment:Zy,addIssueCommentAttachments:Qy,setIssueCommentAttachment:Xy,setIssueCommentAttachments:xy,updateIssueCommentAttachment:ef,updateIssueCommentAttachments:tf,deleteIssueCommentAttachment:sf,deleteIssueCommentAttachments:nf}=cn.actions,af=t=>t.issueCommentAttachmentReducer.instances,rn=o.createSelector([af],t=>Object.values(t)),cf=t=>s=>s.issueCommentAttachmentReducer.instances[t],rf=S(o.createSelector([rn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),sb=S(o.createSelector([rn,(t,s)=>s],(t,s)=>A(t.filter(({issue_comment:e})=>s===e)))),df=cn.reducer,ke=F(t=>t.uuid),lf={instances:{}},dn=o.createSlice({name:"issueComments",initialState:lf,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,lf)),reducers:{initializeIssueComments:ke.initialize,addIssueComment:ke.addOne,addIssueComments:ke.addMany,setIssueComment:ke.setOne,setIssueComments:ke.setMany,updateIssueComment:ke.updateOne,updateIssueComments:ke.updateMany,deleteIssueComment:ke.deleteOne,deleteIssueComments:ke.deleteMany}}),{initializeIssueComments:uf,addIssueComment:of,addIssueComments:hf,setIssueComment:pf,setIssueComments:mf,updateIssueComment:yf,updateIssueComments:ff,deleteIssueComment:Sf,deleteIssueComments:Af}=dn.actions,ln=t=>t.issueCommentReducer.instances,wf=t=>s=>s.issueCommentReducer.instances[t],Tf=S(o.createSelector([ln,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(Object.values(t).filter(({uuid:n})=>e.has(n)))})),ib=S(o.createSelector([ln,(t,s)=>s],(t,s)=>A(Object.values(t).filter(e=>e.issue===s)))),If=dn.reducer,Ee=F(t=>t.uuid),Of={instances:{}},un=o.createSlice({name:"issues",initialState:Of,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,Of)),reducers:{initializeIssues:Ee.initialize,addIssue:Ee.addOne,addIssues:Ee.addMany,setIssue:Ee.setOne,setIssues:Ee.setMany,updateIssue:Ee.updateOne,updateIssues:Ee.updateMany,deleteIssue:Ee.deleteOne,deleteIssues:Ee.deleteMany}}),{initializeIssues:Ff,addIssue:_f,addIssues:on,setIssue:gf,setIssues:Pf,updateIssue:bf,updateIssues:Rf,deleteIssue:Mf,deleteIssues:hn}=un.actions,kf=t=>t.issueReducer.instances,ss=o.createSelector([kf],t=>Object.values(t)),Ef=t=>s=>s.issueReducer.instances[t],vf=S(o.createSelector([ss,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),nb=S(o.createSelector([ss,(t,s)=>s],(t,s)=>t.filter(e=>e.project===s))),Vf=S(o.createSelector([ss,(t,s)=>s],(t,s)=>t.filter(e=>e.issue_type===s))),Bf=un.reducer,ve=F(t=>t.uuid),Wf={instances:{}},pn=o.createSlice({name:"issueTypeAttachments",initialState:Wf,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,Wf)),reducers:{initializeIssueTypeAttachments:ve.initialize,addIssueTypeAttachment:ve.addOne,addIssueTypeAttachments:ve.addMany,setIssueTypeAttachment:ve.setOne,setIssueTypeAttachments:ve.setMany,updateIssueTypeAttachment:ve.updateOne,updateIssueTypeAttachments:ve.updateMany,deleteIssueTypeAttachment:ve.deleteOne,deleteIssueTypeAttachments:ve.deleteMany}}),{initializeIssueTypeAttachments:zf,addIssueTypeAttachment:qf,addIssueTypeAttachments:Df,setIssueTypeAttachment:jf,setIssueTypeAttachments:$f,updateIssueTypeAttachment:Cf,updateIssueTypeAttachments:Uf,deleteIssueTypeAttachment:Lf,deleteIssueTypeAttachments:Nf}=pn.actions,Gf=t=>t.issueTypeAttachmentReducer.instances,mn=o.createSelector([Gf],t=>Object.values(t)),Hf=t=>s=>s.issueTypeAttachmentReducer.instances[t],Kf=S(o.createSelector([mn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),ab=S(o.createSelector([mn,(t,s)=>s],(t,s)=>A(t.filter(({issue_type:e})=>s===e)))),Yf=pn.reducer,Ve=F(t=>t.uuid),Jf={instances:{}},yn=o.createSlice({name:"issueTypeFieldsAttachments",initialState:Jf,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,Jf)),reducers:{initializeIssueTypeFieldsAttachments:Ve.initialize,addIssueTypeFieldsAttachment:Ve.addOne,addIssueTypeFieldsAttachments:Ve.addMany,setIssueTypeFieldsAttachment:Ve.setOne,setIssueTypeFieldsAttachments:Ve.setMany,updateIssueTypeFieldsAttachment:Ve.updateOne,updateIssueTypeFieldsAttachments:Ve.updateMany,deleteIssueTypeFieldsAttachment:Ve.deleteOne,deleteIssueTypeFieldsAttachments:Ve.deleteMany}}),{initializeIssueTypeFieldsAttachments:Zf,addIssueTypeFieldsAttachment:Qf,addIssueTypeFieldsAttachments:Xf,setIssueTypeFieldsAttachment:xf,setIssueTypeFieldsAttachments:eS,updateIssueTypeFieldsAttachment:tS,updateIssueTypeFieldsAttachments:sS,deleteIssueTypeFieldsAttachment:iS,deleteIssueTypeFieldsAttachments:nS}=yn.actions,aS=t=>t.issueTypeFieldsAttachmentReducer.instances,fn=o.createSelector([aS],t=>Object.values(t)),cb=S(o.createSelector([fn,(t,s)=>s],(t,s)=>A(t.filter(e=>e.fields_revision===s)))),cS=t=>s=>s.issueTypeFieldsAttachmentReducer.instances[t],rS=S(o.createSelector([fn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),dS=yn.reducer,Be=F(t=>t.uuid),lS={instances:{}},Sn=o.createSlice({name:"issueTypeFieldValues",initialState:lS,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,lS)),reducers:{initializeIssueTypeFieldValues:Be.initialize,addIssueTypeFieldValues:Be.addOne,addIssueTypeFieldValuesMany:Be.addMany,setIssueTypeFieldValues:Be.setOne,setIssueTypeFieldValuesMany:Be.setMany,updateIssueTypeFieldValues:Be.updateOne,updateIssueTypeFieldValuesMany:Be.updateMany,deleteIssueTypeFieldValues:Be.deleteOne,deleteIssueTypeFieldValuesMany:Be.deleteMany}}),{initializeIssueTypeFieldValues:uS,addIssueTypeFieldValues:oS,addIssueTypeFieldValuesMany:hS,setIssueTypeFieldValues:pS,setIssueTypeFieldValuesMany:mS,updateIssueTypeFieldValues:yS,updateIssueTypeFieldValuesMany:fS,deleteIssueTypeFieldValues:SS,deleteIssueTypeFieldValuesMany:AS}=Sn.actions,wS=t=>t.issueTypeFieldValuesReducer.instances,is=o.createSelector([wS],t=>Object.values(t)),rb=S(o.createSelector([is,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue===s)))),TS=t=>s=>s.issueTypeFieldValuesReducer.instances[t],IS=S(o.createSelector([is,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),OS=Sn.reducer,We=F(t=>t.uuid),FS={instances:{}},An=o.createSlice({name:"issueTypeFields",initialState:FS,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,FS)),reducers:{initializeIssueTypeFields:We.initialize,addIssueTypeFields:We.addOne,addIssueTypeFieldsMany:We.addMany,setIssueTypeFields:We.setOne,setIssueTypeFieldsMany:We.setMany,updateIssueTypeFields:We.updateOne,updateIssueTypeFieldsMany:We.updateMany,deleteIssueTypeFields:We.deleteOne,deleteIssueTypeFieldsMany:We.deleteMany}}),{initializeIssueTypeFields:_S,addIssueTypeFields:gS,addIssueTypeFieldsMany:PS,setIssueTypeFields:bS,setIssueTypeFieldsMany:RS,updateIssueTypeFields:MS,updateIssueTypeFieldsMany:kS,deleteIssueTypeFields:ES,deleteIssueTypeFieldsMany:vS}=An.actions,VS=t=>t.issueTypeFieldsReducer.instances,Et=o.createSelector([VS],t=>Object.values(t)),db=S(o.createSelector([Et,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue_type===s)))),lb=S(o.createSelector([Et,(t,s)=>s],(t,s)=>t.filter(e=>e.issue_type===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),ub=S(o.createSelector([Et,is,(t,s)=>s],(t,s,e)=>{const n=new Set(t.filter(a=>a.issue_type===e).map(a=>a.uuid));return A(s.filter(a=>n.has(a.fields_revision)))})),BS=t=>s=>s.issueTypeFieldsReducer.instances[t],WS=S(o.createSelector([Et,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),zS=An.reducer,ze=F(t=>t.uuid),qS={instances:{}},wn=o.createSlice({name:"issueTypeFieldValuesAttachments",initialState:qS,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,qS)),reducers:{initializeIssueTypeFieldValuesAttachments:ze.initialize,addIssueTypeFieldValuesAttachment:ze.addOne,addIssueTypeFieldValuesAttachments:ze.addMany,setIssueTypeFieldValuesAttachment:ze.setOne,setIssueTypeFieldValuesAttachments:ze.setMany,updateIssueTypeFieldValuesAttachment:ze.updateOne,updateIssueTypeFieldValuesAttachments:ze.updateMany,deleteIssueTypeFieldValuesAttachment:ze.deleteOne,deleteIssueTypeFieldValuesAttachments:ze.deleteMany}}),{initializeIssueTypeFieldValuesAttachments:DS,addIssueTypeFieldValuesAttachment:jS,addIssueTypeFieldValuesAttachments:Tn,setIssueTypeFieldValuesAttachment:$S,setIssueTypeFieldValuesAttachments:CS,updateIssueTypeFieldValuesAttachment:US,updateIssueTypeFieldValuesAttachments:LS,deleteIssueTypeFieldValuesAttachment:NS,deleteIssueTypeFieldValuesAttachments:In}=wn.actions,GS=t=>t.issueTypeFieldValuesAttachmentReducer.instances,On=o.createSelector([GS],t=>Object.values(t)),HS=t=>s=>s.issueTypeFieldValuesAttachmentReducer.instances[t],KS=S(o.createSelector([On,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),YS=S(o.createSelector([On,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),JS=wn.reducer,qe=F(t=>t.uuid),ZS={instances:{}},Fn=o.createSlice({name:"issueTypeIdentifiers",initialState:ZS,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,ZS)),reducers:{initializeIssueTypeIdentifiers:qe.initialize,addIssueTypeIdentifier:qe.addOne,addIssueTypeIdentifiers:qe.addMany,setIssueTypeIdentifier:qe.setOne,setIssueTypeIdentifiers:qe.setMany,updateIssueTypeIdentifier:qe.updateOne,updateIssueTypeIdentifiers:qe.updateMany,deleteIssueTypeIdentifier:qe.deleteOne,deleteIssueTypeIdentifiers:qe.deleteMany}}),{initializeIssueTypeIdentifiers:QS,addIssueTypeIdentifier:XS,addIssueTypeIdentifiers:xS,setIssueTypeIdentifier:eA,setIssueTypeIdentifiers:tA,updateIssueTypeIdentifier:sA,updateIssueTypeIdentifiers:iA,deleteIssueTypeIdentifier:nA,deleteIssueTypeIdentifiers:aA}=Fn.actions,cA=t=>t.issueTypeIdentifierReducer.instances,_n=o.createSelector([cA],t=>Object.values(t)),rA=t=>s=>s.issueTypeIdentifierReducer.instances[t],dA=S(o.createSelector([_n,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),ob=S(o.createSelector([_n,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue_type===s)))),lA=Fn.reducer,De=F(t=>t.uuid),uA={instances:{}},gn=o.createSlice({name:"issueTypeIdentifierValues",initialState:uA,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,uA)),reducers:{initializeIssueTypeIdentifierValues:De.initialize,addIssueTypeIdentifierValue:De.addOne,addIssueTypeIdentifierValues:De.addMany,setIssueTypeIdentifierValue:De.setOne,setIssueTypeIdentifierValues:De.setMany,updateIssueTypeIdentifierValue:De.updateOne,updateIssueTypeIdentifierValues:De.updateMany,deleteIssueTypeIdentifierValue:De.deleteOne,deleteIssueTypeIdentifierValues:De.deleteMany}}),{initializeIssueTypeIdentifierValues:oA,addIssueTypeIdentifierValue:hA,addIssueTypeIdentifierValues:pA,setIssueTypeIdentifierValue:mA,setIssueTypeIdentifierValues:yA,updateIssueTypeIdentifierValue:fA,updateIssueTypeIdentifierValues:SA,deleteIssueTypeIdentifierValue:AA,deleteIssueTypeIdentifierValues:wA}=gn.actions,TA=t=>t.issueTypeIdentifierValueReducer.instances,ns=o.createSelector([TA],t=>Object.values(t)),IA=t=>s=>s.issueTypeIdentifierValueReducer.instances[t],OA=S(o.createSelector([ns,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),hb=S(o.createSelector([ns,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue===s)))),pb=S(o.createSelector([ns,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue_type_identifier===s)))),FA=gn.reducer,je=F(t=>t.uuid),_A={instances:{}},Pn=o.createSlice({name:"issueTypes",initialState:_A,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,_A)),reducers:{initializeIssueTypes:je.initialize,addIssueType:je.addOne,addIssueTypes:je.addMany,setIssueType:je.setOne,setIssueTypes:je.setMany,updateIssueType:je.updateOne,updateIssueTypes:je.updateMany,deleteIssueType:je.deleteOne,deleteIssueTypes:je.deleteMany}}),{initializeIssueTypes:gA,addIssueType:PA,addIssueTypes:bA,setIssueType:RA,setIssueTypes:MA,updateIssueType:kA,updateIssueTypes:EA,deleteIssueType:vA,deleteIssueTypes:VA}=Pn.actions,BA=t=>t.issueTypeReducer.instances,bn=o.createSelector(BA,t=>Object.values(t)),WA=t=>s=>s.issueTypeReducer.instances[t],zA=S(o.createSelector([bn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),mb=S(o.createSelector([bn,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),qA=Pn.reducer,$e=F(t=>t.uuid),DA={instances:{}},Rn=o.createSlice({name:"issueTypeStatuses",initialState:DA,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,DA)),reducers:{initializeIssueTypeStatuses:$e.initialize,addIssueTypeStatus:$e.addOne,addIssueTypeStatuses:$e.addMany,setIssueTypeStatus:$e.setOne,setIssueTypeStatuses:$e.setMany,updateIssueTypeStatus:$e.updateOne,updateIssueTypeStatuses:$e.updateMany,deleteIssueTypeStatus:$e.deleteOne,deleteIssueTypeStatuses:$e.deleteMany}}),{initializeIssueTypeStatuses:jA,addIssueTypeStatus:$A,addIssueTypeStatuses:CA,setIssueTypeStatus:UA,setIssueTypeStatuses:LA,updateIssueTypeStatus:NA,updateIssueTypeStatuses:GA,deleteIssueTypeStatus:HA,deleteIssueTypeStatuses:KA}=Rn.actions,YA=t=>t.issueTypeStatusReducer.instances,Mn=o.createSelector([YA],t=>A(Object.values(t).toSorted(xa))),kn=t=>s=>s.issueTypeStatusReducer.instances[t],JA=S(o.createSelector([Mn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),yb=S(o.createSelector([Mn,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue_type===s)))),ZA=Rn.reducer,Ce=F(t=>t.uuid),QA={instances:{}},En=o.createSlice({name:"issueUpdates",initialState:QA,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,QA)),reducers:{initializeIssueUpdates:Ce.initialize,addIssueUpdate:Ce.addOne,addIssueUpdates:Ce.addMany,setIssueUpdate:Ce.setOne,setIssueUpdates:Ce.setMany,updateIssueUpdate:Ce.updateOne,updateIssueUpdates:Ce.updateMany,deleteIssueUpdate:Ce.deleteOne,deleteIssueUpdates:Ce.deleteMany}}),{initializeIssueUpdates:XA,addIssueUpdate:vn,addIssueUpdates:Vn,setIssueUpdate:xA,setIssueUpdates:ew,updateIssueUpdate:tw,updateIssueUpdates:sw,deleteIssueUpdate:Bn,deleteIssueUpdates:Wn}=En.actions,zn=t=>t.issueUpdateReducer.instances,qn=o.createSelector([zn],t=>Object.values(t)),iw=S(o.createSelector([zn,(t,s)=>s],(t,s)=>t[s])),nw=S(o.createSelector([qn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),aw=S(o.createSelector([qn,(t,s)=>s],(t,s)=>A(t.filter(e=>e.issue===s)))),cw=En.reducer,Ue=F(t=>t.id),rw={instances:{},currentUser:null},Dn=o.createSlice({name:"users",initialState:rw,extraReducers:t=>t.addCase(I,s=>Object.assign(s,rw)).addCase(_,s=>Object.assign(s,{...s,instances:[]})),reducers:{initializeUsers:Ue.initialize,setUsers:Ue.setMany,setUser:Ue.setOne,addUsers:Ue.addMany,addUser:Ue.addOne,updateUsers:Ue.updateMany,updateUser:Ue.updateOne,deleteUser:Ue.deleteOne,deleteUsers:Ue.deleteMany,setCurrentUser:(t,s)=>{t.currentUser=s.payload},setCurrentUserProfile:(t,s)=>{if(!t.currentUser)return;t.currentUser.profile=s.payload;const e=t.instances[t.currentUser.id];if(!e)throw new Error("Unable to find current user in users slice");e.profile=s.payload}}}),{initializeUsers:dw,setUsers:lw,setUser:uw,addUsers:ow,addUser:jn,updateUsers:hw,updateUser:pw,deleteUser:$n,deleteUsers:mw,setCurrentUser:fb,setCurrentUserProfile:Sb}=Dn.actions,yw=Dn.reducer,fw=t=>t.userReducer.currentUser,Cn=t=>t.userReducer.instances,as=o.createSelector([Cn],t=>Object.values(t)),cs=t=>s=>s.userReducer.instances[t],Sw=S(o.createSelector([as,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({id:n})=>e.has(n)))})),Le=F(t=>t.uuid),Aw={instances:{}},Un=o.createSlice({name:"organizationAccess",initialState:Aw,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,Aw)),reducers:{initializeOrganizationAccesses:Le.initialize,addOrganizationAccess:Le.addOne,addOrganizationAccesses:Le.addMany,setOrganizationAccess:Le.setOne,setOrganizationAccesses:Le.setMany,updateOrganizationAccess:Le.updateOne,updateOrganizationAccesses:Le.updateMany,deleteOrganizationAccess:Le.deleteOne,deleteOrganizationAccesses:Le.deleteMany}}),{initializeOrganizationAccesses:ww,addOrganizationAccess:Tw,addOrganizationAccesses:Iw,setOrganizationAccess:Ow,setOrganizationAccesses:Fw,updateOrganizationAccess:_w,updateOrganizationAccesses:gw,deleteOrganizationAccess:Pw,deleteOrganizationAccesses:bw}=Un.actions,Rw=Un.reducer,rs=t=>t.organizationAccessReducer.instances,Mw=t=>s=>s.organizationAccessReducer.instances[t],kw=S(o.createSelector([rs,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(Object.values(t).filter(({uuid:n})=>e.has(n)))})),Ab=o.createSelector([fw,rs],(t,s)=>Object.values(s).find(n=>n.user===(t==null?void 0:t.id))??null),Ew=o.createSelector([rs],t=>{const s={};for(const e of Object.values(t))s[e.user]=e;return $t(s)}),wb=S(o.createSelector([Cn,Ew,(t,s)=>s],(t,s,e)=>A(Object.values(t).filter(n=>{const a=s[n.id];return!!a&&a.organization===e})))),Ne=F(t=>t.uuid),vw={instances:{}},Ln=o.createSlice({name:"organizations",initialState:vw,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,vw)),reducers:{initializeOrganizations:Ne.initialize,setOrganizations:Ne.setMany,setOrganization:Ne.setOne,addOrganizations:Ne.addMany,addOrganization:Ne.addOne,updateOrganizations:Ne.updateMany,updateOrganization:Ne.updateOne,deleteOrganization:Ne.deleteOne,deleteOrganizations:Ne.deleteMany}}),{initializeOrganizations:Vw,setOrganizations:Bw,setOrganization:Ww,addOrganizations:zw,addOrganization:qw,updateOrganizations:Dw,updateOrganization:jw,deleteOrganization:$w,deleteOrganizations:Cw}=Ln.actions,Uw=t=>t.organizationReducer.instances,Lw=o.createSelector([Uw],t=>Object.values(t)),Nw=t=>s=>s.organizationReducer.instances[t],Gw=S(o.createSelector([Lw,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Hw=Ln.reducer,Kw=(t,s,e)=>{const n=t.uuid?t:{...t,uuid:ot.v4()};return{payload:n,type:"",meta:{offline:{effect:{timestamp:new Date().toISOString(),request:n,BASE_URL:s,serviceName:e}}}}},Yw={deletedRequests:[],latestRetryTime:0},Nn=o.createSlice({name:"outbox",initialState:Yw,extraReducers:t=>t.addCase(I,s=>Object.assign(s,Yw)),reducers:{enqueueRequest:{reducer:(t,s)=>t,prepare:t=>{console.debug("Preparing to enqueue request",t.url);const{BASE_URL:s,serviceName:e,...n}=t;return Kw(n,s,e)}},markForDeletion(t,s){t.deletedRequests.push(s.payload)},markAsDeleted(t,s){const e=t.deletedRequests.indexOf(s.payload);e!==-1&&t.deletedRequests.splice(e,1)},_setLatestRetryTime:(t,s)=>{t.latestRetryTime=s.payload}}}),Tb=t=>t.outboxReducer.deletedRequests,Ib=t=>t.outboxReducer.latestRetryTime,{enqueueRequest:Jw,markForDeletion:Ob,markAsDeleted:Zw,_setLatestRetryTime:Qw}=Nn.actions,Xw=Nn.reducer,Ge=F(t=>t.uuid),xw={instances:{}},Gn=o.createSlice({name:"projectAccess",initialState:xw,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,xw)),reducers:{initializeProjectAccesses:Ge.initialize,addProjectAccess:Ge.addOne,addProjectAccesses:Ge.addMany,setProjectAccess:Ge.setOne,setProjectAccesses:Ge.setMany,updateProjectAccess:Ge.updateOne,updateProjectAccesses:Ge.updateMany,deleteProjectAccess:Ge.deleteOne,deleteProjectAccesses:Ge.deleteMany}}),{initializeProjectAccesses:eT,addProjectAccess:tT,addProjectAccesses:sT,setProjectAccess:iT,setProjectAccesses:nT,updateProjectAccess:aT,updateProjectAccesses:cT,deleteProjectAccess:rT,deleteProjectAccesses:dT}=Gn.actions,lT=Gn.reducer,Hn=t=>t.projectAccessReducer.instances,vt=o.createSelector(Hn,t=>Object.values(t)),uT=t=>s=>s.projectAccessReducer.instances[t],oT=S(o.createSelector([vt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Fb=S(o.createSelector([Hn,(t,s)=>s],(t,s)=>A(Object.values(t).filter(e=>e.project===s)))),_b=S(o.createSelector([vt,(t,s)=>s],(t,s)=>{const e={};for(const n of t.filter(a=>a.project===s))e[n.user]=n;return e})),gb=S(o.createSelector([as,vt,(t,s)=>s],(t,s,e)=>{const n=new Set(s.filter(a=>a.project===e).map(a=>a.user));return A(t.filter(a=>n.has(a.id)))})),He=F(t=>t.uuid),hT={instances:{}},Kn=o.createSlice({name:"projectAttachments",initialState:hT,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,hT)),reducers:{initializeProjectAttachments:He.initialize,addProjectAttachment:He.addOne,addProjectAttachments:He.addMany,setProjectAttachment:He.setOne,setProjectAttachments:He.setMany,updateProjectAttachment:He.updateOne,updateProjectAttachments:He.updateMany,deleteProjectAttachment:He.deleteOne,deleteProjectAttachments:He.deleteMany}}),{initializeProjectAttachments:pT,addProjectAttachment:mT,addProjectAttachments:yT,setProjectAttachment:fT,setProjectAttachments:ST,updateProjectAttachment:AT,updateProjectAttachments:wT,deleteProjectAttachment:TT,deleteProjectAttachments:IT}=Kn.actions,OT=t=>t.projectAttachmentReducer.instances,Yn=o.createSelector([OT],t=>Object.values(t)),FT=t=>s=>s.projectAttachmentReducer.instances[t],_T=S(o.createSelector([Yn,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Pb=S(o.createSelector([Yn,(t,s)=>s],(t,s)=>A(t.filter(({project:e})=>s===e)))),gT=Kn.reducer,Ke=F(t=>t.uuid),PT={instances:{}},Jn=o.createSlice({name:"projectFiles",initialState:PT,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,PT)),reducers:{initializeProjectFiles:Ke.initialize,setProjectFile:Ke.setOne,setProjectFiles:Ke.setMany,addProjectFile:Ke.addOne,addProjectFiles:Ke.addMany,updateProjectFile:Ke.updateOne,updateProjectFiles:Ke.updateMany,deleteProjectFile:Ke.deleteOne,deleteProjectFiles:Ke.deleteMany}}),{initializeProjectFiles:bT,setProjectFile:RT,setProjectFiles:MT,addProjectFile:kT,addProjectFiles:ET,updateProjectFile:vT,updateProjectFiles:VT,deleteProjectFile:BT,deleteProjectFiles:WT}=Jn.actions,zT=t=>t.projectFileReducer.instances,qT=o.createSelector([zT],t=>A(Object.values(t).sort((s,e)=>s.z_index-e.z_index))),DT=t=>s=>s.projectFileReducer.instances[t],jT=S(o.createSelector([qT,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),$T=Jn.reducer,Ye=F(t=>t.uuid),CT={instances:{}},Zn=o.createSlice({name:"projects",initialState:CT,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,CT)),reducers:{initializeProjects:Ye.initialize,setProjects:Ye.setMany,setProject:Ye.setOne,addProjects:Ye.addMany,addProject:Ye.addOne,updateProjects:Ye.updateMany,updateProject:Ye.updateOne,deleteProject:Ye.deleteOne,deleteProjects:Ye.deleteMany}}),{initializeProjects:UT,setProjects:LT,setProject:NT,addProjects:GT,addProject:HT,updateProjects:KT,updateProject:YT,deleteProject:JT,deleteProjects:ZT}=Zn.actions,QT=Zn.reducer,XT=t=>t.projectReducer.instances,ds=o.createSelector([XT],t=>Object.values(t)),xT=t=>s=>s.projectReducer.instances[t],eI=S(o.createSelector([ds,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),bb=S(o.createSelector([ds,vt,(t,s)=>s],(t,s,e)=>{const n=new Set(s.filter(a=>a.user===e).map(a=>a.project));return A(t.filter(a=>n.has(a.uuid)))})),Rb=S(o.createSelector([ds,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),Mb={isRehydrated:!1},Qn=o.createSlice({name:"rehydrated",initialState:Mb,reducers:{setRehydrated:(t,s)=>{t.isRehydrated=s.payload}}}),{setRehydrated:kb}=Qn.actions,Eb=t=>t.rehydratedReducer.isRehydrated,tI=Qn.reducer,Je=F(t=>t.uuid),sI={instances:{}},Xn=o.createSlice({name:"teamMemberships",initialState:sI,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,sI)),reducers:{initializeTeamMemberships:Je.initialize,addTeamMembership:Je.addOne,addTeamMemberships:Je.addMany,setTeamMembership:Je.setOne,setTeamMemberships:Je.setMany,updateTeamMembership:Je.updateOne,updateTeamMemberships:Je.updateMany,deleteTeamMembership:Je.deleteOne,deleteTeamMemberships:Je.deleteMany}}),{initializeTeamMemberships:iI,addTeamMembership:nI,addTeamMemberships:aI,setTeamMembership:cI,setTeamMemberships:rI,updateTeamMembership:dI,updateTeamMemberships:lI,deleteTeamMembership:uI,deleteTeamMemberships:oI}=Xn.actions,hI=Xn.reducer,pI=t=>t.teamMembershipReducer.instances,ls=o.createSelector([pI],t=>Object.values(t)),mI=t=>s=>s.teamMembershipReducer.instances[t],yI=S(o.createSelector([ls,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),vb=S(o.createSelector([ls,(t,s)=>s],(t,s)=>{const e={};for(const n of t.filter(a=>a.team===s))e[n.user]=n;return e})),Vb=S(o.createSelector([as,ls,(t,s)=>s],(t,s,e)=>{const n=new Set(s.filter(a=>a.team===e).map(a=>a.user));return A(t.filter(a=>n.has(a.id)))})),Ze=F(t=>t.uuid),fI={instances:{}},xn=o.createSlice({name:"teams",initialState:fI,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,fI)),reducers:{initializeTeams:Ze.initialize,addTeam:Ze.addOne,addTeams:Ze.addMany,setTeam:Ze.setOne,setTeams:Ze.setMany,updateTeam:Ze.updateOne,updateTeams:Ze.updateMany,deleteTeam:Ze.deleteOne,deleteTeams:Ze.deleteMany}}),{initializeTeams:SI,addTeam:AI,addTeams:wI,setTeam:TI,setTeams:II,updateTeam:OI,updateTeams:FI,deleteTeam:_I,deleteTeams:gI}=xn.actions,PI=t=>t.teamReducer.instances,ea=o.createSelector([PI],t=>Object.values(t)),bI=t=>s=>s.teamReducer.instances[t],RI=S(o.createSelector([ea,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Bb=S(o.createSelector([ea,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),MI=xn.reducer,Wb={version:0},kI=o.createSlice({name:"versioning",initialState:Wb,reducers:{}}),EI=kI.reducer,Qe=F(t=>t.uuid),vI={instances:{}},ta=o.createSlice({name:"workflows",initialState:vI,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,vI)),reducers:{initializeWorkflows:Qe.initialize,addWorkflow:Qe.addOne,addWorkflows:Qe.addMany,setWorkflow:Qe.setOne,setWorkflows:Qe.setMany,updateWorkflow:Qe.updateOne,updateWorkflows:Qe.updateMany,deleteWorkflow:Qe.deleteOne,deleteWorkflows:Qe.deleteMany}}),{initializeWorkflows:VI,addWorkflow:BI,addWorkflows:WI,setWorkflow:zI,setWorkflows:qI,updateWorkflow:DI,updateWorkflows:jI,deleteWorkflow:$I,deleteWorkflows:CI}=ta.actions,UI=t=>t.workflowReducer.instances,us=o.createSelector([UI],t=>Object.values(t)),LI=t=>s=>s.workflowReducer.instances[t],NI=S(o.createSelector([us,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),zb=S(o.createSelector([us,(t,s)=>s],(t,s)=>A(t.filter(e=>e.project===s)))),qb=S(o.createSelector([us,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_type===s)))),GI=ta.reducer,Xe=F(t=>t.uuid),HI={instances:{}},sa=o.createSlice({name:"workflowStepAssignees",initialState:HI,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,HI)),reducers:{initializeWorkflowStepAssignees:Xe.initialize,addWorkflowStepAssignee:Xe.addOne,addWorkflowStepAssignees:Xe.addMany,setWorkflowStepAssignee:Xe.setOne,setWorkflowStepAssignees:Xe.setMany,updateWorkflowStepAssignee:Xe.updateOne,updateWorkflowStepAssignees:Xe.updateMany,deleteWorkflowStepAssignee:Xe.deleteOne,deleteWorkflowStepAssignees:Xe.deleteMany}}),{initializeWorkflowStepAssignees:KI,addWorkflowStepAssignee:YI,addWorkflowStepAssignees:JI,setWorkflowStepAssignee:ZI,setWorkflowStepAssignees:QI,updateWorkflowStepAssignee:XI,updateWorkflowStepAssignees:xI,deleteWorkflowStepAssignee:eO,deleteWorkflowStepAssignees:tO}=sa.actions,sO=t=>t.workflowStepAssigneeReducer.instances,Vt=o.createSelector([sO],t=>Object.values(t)),iO=t=>s=>s.workflowStepAssigneeReducer.instances[t],nO=S(o.createSelector([Vt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Db=S(o.createSelector([Vt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow===s)))),jb=S(o.createSelector([Vt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),$b=S(o.createSelector([Vt,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>A(t.filter(({workflow:n,workflow_step:a})=>n===s&&a===e)))),aO=sa.reducer,xe=F(t=>t.uuid),cO={instances:{}},ia=o.createSlice({name:"workflowStepComments",initialState:cO,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,cO)),reducers:{initializeWorkflowStepComments:xe.initialize,addWorkflowStepComment:xe.addOne,addWorkflowStepComments:xe.addMany,setWorkflowStepComment:xe.setOne,setWorkflowStepComments:xe.setMany,updateWorkflowStepComment:xe.updateOne,updateWorkflowStepComments:xe.updateMany,deleteWorkflowStepComment:xe.deleteOne,deleteWorkflowStepComments:xe.deleteMany}}),{initializeWorkflowStepComments:rO,addWorkflowStepComment:dO,addWorkflowStepComments:lO,setWorkflowStepComment:uO,setWorkflowStepComments:oO,updateWorkflowStepComment:hO,updateWorkflowStepComments:pO,deleteWorkflowStepComment:mO,deleteWorkflowStepComments:yO}=ia.actions,fO=t=>t.workflowStepCommentReducer.instances,Bt=o.createSelector([fO],t=>Object.values(t)),SO=t=>s=>s.workflowStepCommentReducer.instances[t],AO=S(o.createSelector([Bt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Cb=S(o.createSelector([Bt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow===s)))),Ub=S(o.createSelector([Bt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),Lb=S(o.createSelector([Bt,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>A(t.filter(({workflow:n,workflow_step:a})=>n===s&&a===e)))),wO=ia.reducer,et=F(t=>t.uuid),TO={instances:{}},na=o.createSlice({name:"workflowStepEvents",initialState:TO,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,TO)),reducers:{initializeWorkflowStepEvents:et.initialize,addWorkflowStepEvent:et.addOne,addWorkflowStepEvents:et.addMany,setWorkflowStepEvent:et.setOne,setWorkflowStepEvents:et.setMany,updateWorkflowStepEvent:et.updateOne,updateWorkflowStepEvents:et.updateMany,deleteWorkflowStepEvent:et.deleteOne,deleteWorkflowStepEvents:et.deleteMany}}),{initializeWorkflowStepEvents:IO,addWorkflowStepEvent:OO,addWorkflowStepEvents:FO,setWorkflowStepEvent:_O,setWorkflowStepEvents:gO,updateWorkflowStepEvent:PO,updateWorkflowStepEvents:bO,deleteWorkflowStepEvent:RO,deleteWorkflowStepEvents:MO}=na.actions,kO=t=>t.workflowStepEventReducer.instances,Wt=o.createSelector([kO],t=>Object.values(t)),EO=t=>s=>s.workflowStepEventReducer.instances[t],vO=S(o.createSelector([Wt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Nb=S(o.createSelector([Wt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow===s)))),Gb=S(o.createSelector([Wt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),Hb=S(o.createSelector([Wt,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>A(t.filter(({workflow:n,workflow_step:a})=>n===s&&a===e)))),VO=na.reducer,tt=F(t=>t.uuid),BO={instances:{}},aa=o.createSlice({name:"workflowStepFieldsAttachments",initialState:BO,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,BO)),reducers:{initializeWorkflowStepFieldsAttachments:tt.initialize,addWorkflowStepFieldsAttachment:tt.addOne,addWorkflowStepFieldsAttachments:tt.addMany,setWorkflowStepFieldsAttachment:tt.setOne,setWorkflowStepFieldsAttachments:tt.setMany,updateWorkflowStepFieldsAttachment:tt.updateOne,updateWorkflowStepFieldsAttachments:tt.updateMany,deleteWorkflowStepFieldsAttachment:tt.deleteOne,deleteWorkflowStepFieldsAttachments:tt.deleteMany}}),{initializeWorkflowStepFieldsAttachments:WO,addWorkflowStepFieldsAttachment:zO,addWorkflowStepFieldsAttachments:ca,setWorkflowStepFieldsAttachment:qO,setWorkflowStepFieldsAttachments:DO,updateWorkflowStepFieldsAttachment:jO,updateWorkflowStepFieldsAttachments:$O,deleteWorkflowStepFieldsAttachment:CO,deleteWorkflowStepFieldsAttachments:ra}=aa.actions,UO=t=>t.workflowStepFieldsAttachmentReducer.instances,da=o.createSelector([UO],t=>Object.values(t)),LO=S(o.createSelector([da,(t,s)=>s],(t,s)=>A(t.filter(e=>e.fields_revision===s)))),NO=t=>s=>s.workflowStepFieldsAttachmentReducer.instances[t],GO=S(o.createSelector([da,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),HO=aa.reducer,st=F(t=>t.uuid),KO={instances:{}},la=o.createSlice({name:"workflowStepFields",initialState:KO,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,KO)),reducers:{initializeWorkflowStepFields:st.initialize,addWorkflowStepFields:st.addOne,addWorkflowStepFieldsMany:st.addMany,setWorkflowStepFields:st.setOne,setWorkflowStepFieldsMany:st.setMany,updateWorkflowStepFields:st.updateOne,updateWorkflowStepFieldsMany:st.updateMany,deleteWorkflowStepFields:st.deleteOne,deleteWorkflowStepFieldsMany:st.deleteMany}}),{initializeWorkflowStepFields:YO,addWorkflowStepFields:JO,addWorkflowStepFieldsMany:ZO,setWorkflowStepFields:QO,setWorkflowStepFieldsMany:XO,updateWorkflowStepFields:xO,updateWorkflowStepFieldsMany:eF,deleteWorkflowStepFields:tF,deleteWorkflowStepFieldsMany:sF}=la.actions,iF=t=>t.workflowStepFieldsReducer.instances,os=o.createSelector([iF],t=>Object.values(t)),Kb=S(o.createSelector([os,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),Yb=S(o.createSelector([os,(t,s)=>s],(t,s)=>t.filter(e=>e.workflow_step===s).sort((e,n)=>e.submitted_at>n.submitted_at?-1:1)[0])),nF=t=>s=>s.workflowStepFieldsReducer.instances[t],aF=S(o.createSelector([os,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),cF=la.reducer,it=F(t=>t.uuid),rF={instances:{}},ua=o.createSlice({name:"workflowStepFieldValuesAttachments",initialState:rF,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,rF)),reducers:{initializeWorkflowStepFieldValuesAttachments:it.initialize,addWorkflowStepFieldValuesAttachment:it.addOne,addWorkflowStepFieldValuesAttachments:it.addMany,setWorkflowStepFieldValuesAttachment:it.setOne,setWorkflowStepFieldValuesAttachments:it.setMany,updateWorkflowStepFieldValuesAttachment:it.updateOne,updateWorkflowStepFieldValuesAttachments:it.updateMany,deleteWorkflowStepFieldValuesAttachment:it.deleteOne,deleteWorkflowStepFieldValuesAttachments:it.deleteMany}}),{initializeWorkflowStepFieldValuesAttachments:dF,addWorkflowStepFieldValuesAttachment:lF,addWorkflowStepFieldValuesAttachments:oa,setWorkflowStepFieldValuesAttachment:uF,setWorkflowStepFieldValuesAttachments:oF,updateWorkflowStepFieldValuesAttachment:hF,updateWorkflowStepFieldValuesAttachments:pF,deleteWorkflowStepFieldValuesAttachment:mF,deleteWorkflowStepFieldValuesAttachments:ha}=ua.actions,yF=t=>t.workflowStepFieldValuesAttachmentReducer.instances,pa=o.createSelector([yF],t=>Object.values(t)),fF=t=>s=>s.workflowStepFieldValuesAttachmentReducer.instances[t],SF=S(o.createSelector([pa,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),AF=S(o.createSelector([pa,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),wF=ua.reducer,nt=F(t=>t.uuid),TF={instances:{}},ma=o.createSlice({name:"workflowStepFieldValues",initialState:TF,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,TF)),reducers:{initializeWorkflowStepFieldValues:nt.initialize,addWorkflowStepFieldValues:nt.addOne,addWorkflowStepFieldValuesMany:nt.addMany,setWorkflowStepFieldValues:nt.setOne,setWorkflowStepFieldValuesMany:nt.setMany,updateWorkflowStepFieldValues:nt.updateOne,updateWorkflowStepFieldValuesMany:nt.updateMany,deleteWorkflowStepFieldValues:nt.deleteOne,deleteWorkflowStepFieldValuesMany:nt.deleteMany}}),{initializeWorkflowStepFieldValues:IF,addWorkflowStepFieldValues:OF,addWorkflowStepFieldValuesMany:FF,setWorkflowStepFieldValues:_F,setWorkflowStepFieldValuesMany:gF,updateWorkflowStepFieldValues:PF,updateWorkflowStepFieldValuesMany:bF,deleteWorkflowStepFieldValues:RF,deleteWorkflowStepFieldValuesMany:MF}=ma.actions,kF=t=>t.workflowStepFieldValuesReducer.instances,ht=o.createSelector([kF],t=>Object.values(t)),Jb=S(o.createSelector([ht,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow===s)))),Zb=S(o.createSelector([ht,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),EF=t=>s=>s.workflowStepFieldValuesReducer.instances[t],vF=S(o.createSelector([ht,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),Qb=S(o.createSelector([ht,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>A(t.filter(({workflow:n,workflow_step:a})=>n===s&&a===e)))),Xb=S(o.createSelector([ht,(t,s)=>s],(t,s)=>{const e={};for(const n of t){const{workflow:a,workflow_step:c}=n;if(a!==s)continue;const r=e[c];(!r||r.submitted_at<=n.submitted_at)&&(e[c]=n)}return e})),VF=ma.reducer,at=F(t=>t.uuid),BF={instances:{}},ya=o.createSlice({name:"workflowStepFieldValuesReviewRequests",initialState:BF,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,BF)),reducers:{initializeWorkflowStepFieldValuesReviewRequests:at.initialize,addWorkflowStepFieldValuesReviewRequest:at.addOne,addWorkflowStepFieldValuesReviewRequests:at.addMany,setWorkflowStepFieldValuesReviewRequest:at.setOne,setWorkflowStepFieldValuesReviewRequests:at.setMany,updateWorkflowStepFieldValuesReviewRequest:at.updateOne,updateWorkflowStepFieldValuesReviewRequests:at.updateMany,deleteWorkflowStepFieldValuesReviewRequest:at.deleteOne,deleteWorkflowStepFieldValuesReviewRequests:at.deleteMany}}),{initializeWorkflowStepFieldValuesReviewRequests:WF,addWorkflowStepFieldValuesReviewRequest:zF,addWorkflowStepFieldValuesReviewRequests:fa,setWorkflowStepFieldValuesReviewRequest:qF,setWorkflowStepFieldValuesReviewRequests:DF,updateWorkflowStepFieldValuesReviewRequest:jF,updateWorkflowStepFieldValuesReviewRequests:$F,deleteWorkflowStepFieldValuesReviewRequest:CF,deleteWorkflowStepFieldValuesReviewRequests:Sa}=ya.actions,UF=t=>t.workflowStepFieldValuesReviewRequestReducer.instances,zt=o.createSelector([UF],t=>Object.values(t)),LF=t=>s=>s.workflowStepFieldValuesReviewRequestReducer.instances[t],NF=S(o.createSelector([zt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),GF=S(o.createSelector([zt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),xb=S(o.createSelector([zt,(t,s)=>s],(t,s)=>{let e;for(const n of t){const{field_values:a}=n;a===s&&(!e||e.submitted_at<=n.submitted_at)&&(e=n)}return e})),eR=S(o.createSelector([ht,zt,(t,s)=>s,(t,s,e)=>e],(t,s,e,n)=>{const a=new Set(V(t.filter(({workflow_step:c,workflow:r})=>e===r&&c===n)));return A(s.filter(({field_values:c})=>a.has(c)))})),HF=ya.reducer,ct=F(t=>t.uuid),KF={instances:{}},Aa=o.createSlice({name:"workflowStepFieldValuesReviews",initialState:KF,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,KF)),reducers:{initializeWorkflowStepFieldValuesReviews:ct.initialize,addWorkflowStepFieldValuesReview:ct.addOne,addWorkflowStepFieldValuesReviews:ct.addMany,setWorkflowStepFieldValuesReview:ct.setOne,setWorkflowStepFieldValuesReviews:ct.setMany,updateWorkflowStepFieldValuesReview:ct.updateOne,updateWorkflowStepFieldValuesReviews:ct.updateMany,deleteWorkflowStepFieldValuesReview:ct.deleteOne,deleteWorkflowStepFieldValuesReviews:ct.deleteMany}}),{initializeWorkflowStepFieldValuesReviews:YF,addWorkflowStepFieldValuesReview:JF,addWorkflowStepFieldValuesReviews:wa,setWorkflowStepFieldValuesReview:ZF,setWorkflowStepFieldValuesReviews:QF,updateWorkflowStepFieldValuesReview:XF,updateWorkflowStepFieldValuesReviews:xF,deleteWorkflowStepFieldValuesReview:e_,deleteWorkflowStepFieldValuesReviews:Ta}=Aa.actions,t_=t=>t.workflowStepFieldValuesReviewReducer.instances,It=o.createSelector([t_],t=>Object.values(t)),s_=t=>s=>s.workflowStepFieldValuesReviewReducer.instances[t],i_=S(o.createSelector([It,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),n_=S(o.createSelector([It,(t,s)=>s],(t,s)=>A(t.filter(e=>e.field_values===s)))),tR=S(o.createSelector([It,(t,s)=>s],(t,s)=>{let e;for(const n of t){const{field_values:a}=n;a===s&&(!e||e.submitted_at<=n.submitted_at)&&(e=n)}return e})),sR=S(o.createSelector([ht,It,(t,s)=>s,(t,s,e)=>e],(t,s,e,n)=>{const a=new Set(V(t.filter(({workflow_step:c,workflow:r})=>e===r&&c===n)));return A(s.filter(({field_values:c})=>a.has(c)))})),iR=o.createSelector([It],t=>{const s={};for(const e of t){const{field_values:n}=e,a=s[n];(!a||a.submitted_at<=e.submitted_at)&&(s[n]=e)}return s}),a_=Aa.reducer,rt=F(t=>t.uuid),c_={instances:{}},Ia=o.createSlice({name:"workflowStepReviewers",initialState:c_,extraReducers:t=>t.addMatcher(o.isAnyOf(I,B,_),s=>Object.assign(s,c_)),reducers:{initializeWorkflowStepReviewers:rt.initialize,addWorkflowStepReviewer:rt.addOne,addWorkflowStepReviewers:rt.addMany,setWorkflowStepReviewer:rt.setOne,setWorkflowStepReviewers:rt.setMany,updateWorkflowStepReviewer:rt.updateOne,updateWorkflowStepReviewers:rt.updateMany,deleteWorkflowStepReviewer:rt.deleteOne,deleteWorkflowStepReviewers:rt.deleteMany}}),{initializeWorkflowStepReviewers:r_,addWorkflowStepReviewer:d_,addWorkflowStepReviewers:l_,setWorkflowStepReviewer:u_,setWorkflowStepReviewers:o_,updateWorkflowStepReviewer:h_,updateWorkflowStepReviewers:p_,deleteWorkflowStepReviewer:m_,deleteWorkflowStepReviewers:y_}=Ia.actions,f_=t=>t.workflowStepReviewerReducer.instances,qt=o.createSelector([f_],t=>Object.values(t)),S_=t=>s=>s.workflowStepReviewerReducer.instances[t],A_=S(o.createSelector([qt,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),nR=S(o.createSelector([qt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow===s)))),aR=S(o.createSelector([qt,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_step===s)))),cR=S(o.createSelector([qt,(t,s)=>s,(t,s,e)=>e],(t,s,e)=>A(t.filter(({workflow:n,workflow_step:a})=>n===s&&a===e)))),w_=Ia.reducer,dt=F(t=>t.uuid),T_={instances:{}},Oa=o.createSlice({name:"workflowSteps",initialState:T_,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,T_)),reducers:{initializeWorkflowSteps:dt.initialize,addWorkflowStep:dt.addOne,addWorkflowSteps:dt.addMany,setWorkflowStep:dt.setOne,setWorkflowSteps:dt.setMany,updateWorkflowStep:dt.updateOne,updateWorkflowSteps:dt.updateMany,deleteWorkflowStep:dt.deleteOne,deleteWorkflowSteps:dt.deleteMany}}),{initializeWorkflowSteps:I_,addWorkflowStep:O_,addWorkflowSteps:F_,setWorkflowStep:__,setWorkflowSteps:g_,updateWorkflowStep:P_,updateWorkflowSteps:b_,deleteWorkflowStep:R_,deleteWorkflowSteps:M_}=Oa.actions,k_=t=>t.workflowStepReducer.instances,Fa=o.createSelector([k_],t=>Object.values(t)),E_=t=>s=>s.workflowStepReducer.instances[t],v_=S(o.createSelector([Fa,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),rR=S(o.createSelector([Fa,(t,s)=>s],(t,s)=>A(t.filter(e=>e.workflow_type===s)))),V_=Oa.reducer,lt=F(t=>t.uuid),B_={instances:{}},_a=o.createSlice({name:"workflowTypes",initialState:B_,extraReducers:t=>t.addMatcher(o.isAnyOf(I,_),s=>Object.assign(s,B_)),reducers:{initializeWorkflowTypes:lt.initialize,addWorkflowType:lt.addOne,addWorkflowTypes:lt.addMany,setWorkflowType:lt.setOne,setWorkflowTypes:lt.setMany,updateWorkflowType:lt.updateOne,updateWorkflowTypes:lt.updateMany,deleteWorkflowType:lt.deleteOne,deleteWorkflowTypes:lt.deleteMany}}),{initializeWorkflowTypes:W_,addWorkflowType:z_,addWorkflowTypes:q_,setWorkflowType:D_,setWorkflowTypes:j_,updateWorkflowType:$_,updateWorkflowTypes:C_,deleteWorkflowType:U_,deleteWorkflowTypes:L_}=_a.actions,N_=t=>t.workflowTypeReducer.instances,ga=o.createSelector([N_],t=>Object.values(t)),G_=t=>s=>s.workflowTypeReducer.instances[t],H_=S(o.createSelector([ga,(t,s)=>s],(t,s)=>{const e=new Set(s);return A(t.filter(({uuid:n})=>e.has(n)))})),dR=S(o.createSelector([ga,(t,s)=>s],(t,s)=>A(t.filter(e=>e.organization===s)))),K_=_a.reducer,Pa={outboxReducer:Xw,fileReducer:Tp,authReducer:Mh},lR=o.combineReducers(Pa),Y_={...Pa,[Rt]:EI,assetReducer:Wl,assetAttachmentReducer:Tc,assetStageCompletionReducer:Hl,assetStageReducer:ru,assetTypeReducer:hh,assetTypeAttachmentReducer:Ou,issueReducer:Bf,issueAttachmentReducer:Ky,issueTypeReducer:qA,issueTypeAttachmentReducer:Yf,organizationReducer:Hw,projectReducer:QT,projectAttachmentReducer:gT,projectAccessReducer:lT,organizationAccessReducer:Rw,projectFileReducer:$T,rehydratedReducer:tI,formReducer:Mm,formRevisionReducer:Am,formRevisionAttachmentReducer:dm,formSubmissionAttachmentReducer:Nm,formSubmissionReducer:iy,formIdentifierReducer:Bp,formIdentifierValueReducer:Yp,userReducer:yw,emailDomainsReducer:Sp,documentsReducer:ep,documentAttachmentReducer:Lh,teamReducer:MI,agentsReducer:rc,issueCommentReducer:If,issueCommentAttachmentReducer:df,issueUpdateReducer:cw,geoImageReducer:Sy,issueAssociationReducer:By,issueTypeFieldsReducer:zS,issueTypeFieldValuesReducer:OS,issueTypeFieldsAttachmentReducer:dS,issueTypeFieldValuesAttachmentReducer:JS,issueTypeIdentifierReducer:lA,issueTypeIdentifierValueReducer:FA,issueTypeStatusReducer:ZA,assetTypeFieldsReducer:Zu,assetTypeFieldValuesReducer:_o,assetTypeFieldsAttachmentReducer:zu,assetTypeFieldValuesAttachmentReducer:uo,assetTypeIdentifierReducer:Do,assetTypeIdentifierValueReducer:Xo,assetTypeStatusReducer:Ph,assetProcedureTypeReducer:ad,assetProcedureReducer:Nr,assetProcedureTypeFieldsReducer:ar,assetProcedureTypeFieldValuesReducer:vr,assetProcedureTypeFieldsAttachmentReducer:Gc,assetProcedureTypeFieldValuesAttachmentReducer:Sr,assetProcedureTypeAttachmentReducer:Ec,assetProcedureStepFieldsAttachmentReducer:Od,assetProcedureStepFieldsReducer:Wd,assetProcedureStepFieldValuesAttachmentReducer:Yd,assetProcedureStepFieldValuesReducer:dl,assetProcedureStepReducer:wl,teamMembershipReducer:hI,workflowTypeReducer:K_,workflowStepReducer:V_,workflowStepFieldsReducer:cF,workflowStepFieldsAttachmentReducer:HO,workflowReducer:GI,workflowStepAssigneeReducer:aO,workflowStepCommentReducer:wO,workflowStepEventReducer:VO,workflowStepFieldValuesReducer:VF,workflowStepFieldValuesAttachmentReducer:wF,workflowStepFieldValuesReviewReducer:a_,workflowStepFieldValuesReviewRequestReducer:HF,workflowStepReviewerReducer:w_},uR=o.combineReducers(Y_),J_=1e4,Z_=200,ba=[400,409,403,404,405,500],ut=1e4,Q_={};class X_{constructor(s){m(this,"client");m(this,"pageSize",J_);Q_[this.constructor.name]=this,this.client=s}async performRequest(s,e){return this.client.performRequest(this.host,s,this,e)}async enqueueRequest(s){return this.client.enqueueRequest(s,this.host,this.constructor.name)}async performPagination(s,e){return this.client.performPagination(this.host,s,this.pageSize,this,e)}dispatch(s){this.client.store.dispatch(s)}}const x_=()=>sg.length-1,eg=t=>(t[Rt]={version:x_()},t),tg=()=>eg({}),oR=t=>(t.outboxReducer&&(t.outboxReducer.deletedRequests=[]),t),hR=t=>s=>{var e;return s===void 0&&(s={}),((e=s[Rt])==null?void 0:e.version)===x_()?s:t(s)},sg=[eg,tg,tg,oR],pR=Object.fromEntries(sg.map((t,s)=>[s,hR(t)])),mR=t=>{if(t)throw t;const s=_t();s?s.dispatch({type:"rehydrated/setRehydrated",payload:!0}):console.error("Client store not set")},ig=(t,s,e)=>{const n=wt();return n?(n.addRequest(s),n.getQueue()):(console.warn("Outbox coordinator not set; cannot enqueue request yet."),[])},ng=(t,s,e)=>{const n=wt();if(!n)return console.warn("Outbox coordinator not set; cannot dequeue request yet."),[];const c=s.meta.offlineAction.payload.uuid;return n.remove(c),n.getQueue()};async function yR(t,s){if(!s.payload)throw new Error("Received empty payload");return Sg(s)}const fR={...Ba,effect:yR,discard:cg,returnPromises:!0,persistCallback:mR,retry:TR,persistOptions:{storage:_g},queue:{...Ba.queue,enqueue:ig,dequeue:ng,peek:(...t)=>wR(...t)}},SR=gg(pR,Rt),AR=o.compose(Fg.offline(fR),SR);async function ag(t,s,e){if(s.store.getState().outboxReducer.deletedRequests.includes(t.payload.uuid))throw new Error("Request was marked for deletion");const a=Q_[t.meta.offline.effect.serviceName];if(!a)throw new Error(`Service ${t.meta.offline.effect.serviceName} not found`);return Ma(t.meta.offline.effect.BASE_URL,t.meta.offline.effect.request,s,a,e)}function cg(t,s,e=0){var u;if(console.debug("Considering discarding request due to error:",t,`(${typeof t})`,`
|
|
2
2
|
Url:`,s.payload.url,`
|
|
3
|
-
Retries:`,e),!(t instanceof Error))throw console.error("ENCOUNTERED NON-ERROR ERROR:",t,"(throwing immediately, which may lead to unexpected behavior)"),t;const n=_t(),c=n.getState().outboxReducer.deletedRequests,r=s.payload.uuid;function d(){n.dispatch(Zw(r));const p=
|
|
4
|
-
Action:`,s);const y=
|
|
3
|
+
Retries:`,e),!(t instanceof Error))throw console.error("ENCOUNTERED NON-ERROR ERROR:",t,"(throwing immediately, which may lead to unexpected behavior)"),t;const n=_t(),c=n.getState().outboxReducer.deletedRequests,r=s.payload.uuid;function d(){n.dispatch(Zw(r));const p=wt();if(!p)throw new Error("Outbox coordinator not set");p.remove(s.payload.uuid);const y=s.meta.offline.rollback;throw y&&(console.warn("Rolling back request due to SDK error:",s),n.dispatch(y)),t}if(t instanceof C&&t.options.discard&&(console.debug("Discarding request due to explicit discard:",s.payload.url),d()),c.includes(r)&&(console.debug("Discarding request due to deletion:",s.payload.url),d()),t instanceof C){const p=t.status||((u=t.response)==null?void 0:u.status);if(p||console.warn("Error has no status code:",t),p!==void 0&&ba.includes(p)){console.warn("Discarding request due to error:",t,`
|
|
4
|
+
Action:`,s);const y=wt();if(!y)throw new Error("Outbox coordinator not set");y.remove(s.payload.uuid),t.options.discard=!0,d()}}console.debug("Registering a retry for request:",s.payload.uuid);const l=wt();if(!l)throw new Error("Outbox coordinator not set");return l.registerRetry(s.payload.uuid),!1}function wR(t,s,e){var n;return(n=wt())==null?void 0:n.peek()}function TR(t,s){return _t().dispatch(Qw(new Date().getTime())),Ua}const Ot="An unknown error occurred",IR=500,rg=["non_field_errors","detail"];function OR(t,s){let e;if(t!=null&&t.body)if(typeof t.body=="object"){const n=t.body;if(typeof n.error=="string")e=n.error;else if(typeof n.message=="string")e=n.message;else try{e=Object.entries(n).map(([a,c])=>typeof c=="string"?rg.includes(a)?c:`${a}: ${c}`:Array.isArray(c)?rg.includes(a)?c.join(`
|
|
5
5
|
`):c.map(r=>`${a}: ${r}`).join(`
|
|
6
6
|
`):`${a}: ${JSON.stringify(c)}`).join(`
|
|
7
|
-
`)}catch(a){console.error("Failed to extract error message from response body",a)}}else typeof t.body=="string"&&(e=t.body);else t!=null&&t.text?e=t.text:s instanceof Error&&(e=s.message);return!e||e.length>IR?It:e}class C extends Error{constructor(e){super(It);m(this,"status");m(this,"response");m(this,"message");m(this,"options");const{response:n,innerError:a}=e;this.message=e.message??OR(n,a)??It,this.status=(n==null?void 0:n.status)??0,this.response=n,e.discard=e.discard??!1,this.options=e}}function dg(t){function s(e){return typeof e=="object"&&e!==null&&["ok","redirect","clientError","serverError","error"].every(a=>a in e)}if(s(t))return t;if(typeof t=="object"&&t!==null){const e=t;if(s(e.response))return e.response;if(e.response&&s(e.response.response))return e.response.response}}class FR extends X_{constructor(s){super(s)}}class St extends X_{constructor(e,n){super(e);m(this,"auth");this.auth=n}}class _R extends St{async startConversation(s,e){return this.enqueueRequest({description:"Start agent conversation",method:h.POST,url:"/agents/prompt/",payload:{prompt:s,active_project:e},blockers:["prompt"],blocks:["prompt"]}).then(n=>(this.dispatch(nc(n)),n))}async continueConversation(s,e,n){return this.enqueueRequest({description:"Prompt agent",method:h.POST,url:"/agents/prompt/",payload:{prompt:s,active_project:n},blockers:["prompt"],blocks:["prompt"],queryParams:{conversation_id:e}}).then(a=>{this.dispatch(cc(a))})}async fetchDetails(s){return this.enqueueRequest({description:"Get agent conversation",method:h.GET,url:`/agents/conversations/${s}/`,blockers:["conversation"],blocks:["conversation"]}).then(e=>{this.dispatch(ac(e))})}async rate(s,e){return this.enqueueRequest({description:"Rate agent response",method:h.PUT,url:`/agents/responses/${s}/rate/`,payload:{rating:e},blockers:["rate"],blocks:["rate"]})}async list(s,e){return this.performRequest({method:h.GET,url:"/agents/conversations/",...s},e)}async refreshStore(s,e){const n=await this.list({queryParams:{project:s}},e);return this.dispatch(ic(n)),n}}function pt(t,s){const e=[];let n=0;const a=t.length;for(;n<a;)e.push(t.slice(n,n+=s));return e}function w(t,s,e){const n=`${s}${e?"s":""}`;switch(t){case h.GET:return`Get ${n}`;case h.POST:return`Create ${n}`;case h.PATCH:return`Update ${n}`;case h.PUT:return`Update ${n}`;case h.DELETE:return`Delete ${n}`}}class M extends St{async get(s,e){return this.performRequest({url:`${this.url}/${s}/`,method:h.GET},e)}async list(s,e){return this.performRequest({url:`${this.url}/`,method:h.GET,...s},e)}async listPaginated(s,e){return this.performPagination({url:`${this.url}/`,method:h.GET,...s},e)}}class q extends M{constructor(){super(...arguments);m(this,"pageSize",Z_)}async add(e){const{addOne:n,updateOne:a,deleteOne:c}=this.actions;let r,d=null,l=null;if("file"in e){const{file:P,...E}=e;d=await this.client.files.getFilePayload(P),l=URL.createObjectURL(P),r={...E,file_sha1:d.sha1,file_type:d.file_type,file_name:P.name,file_extension:d.extension,file_url:l}}else r=e;const u=this.buildModel(r),p=this.buildPayload(u);this.dispatch(n(u));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:{...p,...d?{file:d}:{}},blockers:this.getBlockers(u),blocks:this.getBlocks(u)});y.then(({instance:P})=>{this.dispatch(a(P))}).catch(P=>{throw this.dispatch(c(this.getId(u))),P}).finally(()=>{l&&URL.revokeObjectURL(l)});const f=y.then(({instance:P})=>P),T=y.then(async({instance:P,presigned_url:E})=>{try{return E&&await this.client.files.processPresignedUrl(P.file_sha1,E),P.file_sha1}catch(g){throw console.error("Upload to s3 using presigned url failed.",g),g}});return[u,f,T]}async bulkAdd(e,n){const{addMany:a,updateMany:c,deleteMany:r}=this.actions,d=new Date().toISOString(),l=[],u=new Set,p=pt(e,Math.min(n??e.length,ut)),y=[];for(const E of p){const g=[],k={},b=[],z=[];for(const W of E){let D;if("file"in W){const{file:va,...xM}=W,gt=await this.client.files.getFilePayload(va);gt.sha1 in k||(k[gt.sha1]=gt);const Tg=URL.createObjectURL(va);u.add(Tg),D={...xM,file_sha1:gt.sha1,file_type:gt.file_type,file_name:va.name,file_extension:gt.extension,file_url:Tg}}else D=W;const v=this.buildModel(D);l.push(v);const L=this.buildBulkPayload(v);g.push(L);const hs=this.getBlockers(v);b.push(...hs);const XM=this.getBlocks(v);z.push(...XM)}const j={payloads:g,submittedAt:d,files:Object.values(k),blockers:b,blocks:z};y.push(j)}this.dispatch(a(l));const f=y.map(E=>{const{submittedAt:g,files:k,payloads:b,blocks:z,blockers:j}=E;return this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:{submitted_at:g,files:k,payloads:b},blockers:j,blocks:z})});Promise.all(f).then(E=>{const g=E.flatMap(k=>k.instances);this.dispatch(c(g))}).catch(E=>{throw this.dispatch(r(l.map(g=>this.getId(g)))),console.error(E),E}).finally(()=>{for(const E of u)URL.revokeObjectURL(E)});const T=Promise.all(f).then(E=>E.flatMap(({instances:g})=>g)),P=Promise.all(f).then(async E=>{const g=[];for(const{presigned_urls:k}of E){const b=this.client.files.processPresignedUrls(k);for(const[z,j]of Object.entries(b))try{await j,g.push(z)}catch(W){throw console.error("Upload to s3 using presigned url failed.",W),W}}return g});return[l,T,P]}async delete(e){const{store:n}=this.client,{addOne:a,deleteOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Attempting to delete ${this.name} with pk ${e} that does not exist in the store`);this.dispatch(c(this.getId(d)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(a(d)),l}}}class gR extends q{constructor(){super(...arguments);m(this,"name","Asset attachment");m(this,"url","/asset-attachments");m(this,"actions",{addOne:uc,addMany:Os,setOne:oc,setMany:hc,updateOne:pc,updateMany:mc,deleteOne:yc,deleteMany:Fs,initialize:lc});m(this,"selectors",{selectById:Sc,selectByIds:Ac})}getId(e){return e.uuid}getBlockers(e){const{asset:n}=e;return[n]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,asset:e.asset}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,asset:e.asset}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{asset__project:e}},n)).flat();return this.dispatch(a(r)),r}}class PR extends q{constructor(){super(...arguments);m(this,"name","Asset Procedure Attachment");m(this,"url","/asset-procedure-type-attachments");m(this,"actions",{addOne:Fc,addMany:_c,setOne:gc,setMany:Pc,updateOne:bc,updateMany:Rc,deleteOne:Mc,deleteMany:kc,initialize:Oc});m(this,"selectors",{selectById:Vc,selectByIds:Bc})}getId(e){return e.uuid}getBlockers(e){return[e.asset_procedure_type]}getBlocks(e){return[e.uuid]}buildModel(e){var f;const{store:n}=this.client,{asset_procedure_type:a,file_sha1:c,file_extension:r,file_name:d,file_type:l,file_url:u}=e,p=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,y=new Date().toISOString();return O({file_url:u,file_sha1:c,file_extension:r,file_name:d,file_type:l,created_by:p,submitted_at:y,asset_procedure_type:a})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,asset_procedure_type:e.asset_procedure_type}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,asset_procedure_type:e.asset_procedure_type}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{asset_procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class bR extends q{constructor(){super(...arguments);m(this,"name","Asset Procedure Type Fields Attachment");m(this,"url","/asset-procedure-type-fields-attachments");m(this,"actions",{addOne:qc,addMany:Dc,setOne:jc,setMany:$c,updateOne:Cc,updateMany:Uc,deleteOne:Lc,deleteMany:Nc,initialize:zc});m(this,"selectors",{selectById:Kc,selectByIds:Yc})}getId(e){return e.uuid}getBlockers(e){return[e.fields_revision]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{fields_revision__asset_procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class RR extends M{constructor(){super(...arguments);m(this,"name","Asset Procedure Type Fields");m(this,"url","/asset-procedure-type-fields");m(this,"actions",{addOne:Qc,addMany:Xc,setOne:xc,setMany:er,updateOne:tr,updateMany:sr,deleteOne:ir,deleteMany:nr,initialize:Zc});m(this,"selectors",{selectById:rr,selectByIds:dr})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[u.asset_procedure_type],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(f=>{throw this.dispatch(r(u.uuid)),f}),[u,p]}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{asset_procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class MR extends q{constructor(){super(...arguments);m(this,"name","Asset Procedure Type Field Values Attachment");m(this,"url","/asset-procedure-type-field-values-attachments");m(this,"actions",{addOne:or,addMany:Es,setOne:hr,setMany:pr,updateOne:mr,updateMany:yr,deleteOne:fr,deleteMany:vs,initialize:ur});m(this,"selectors",{selectById:wr,selectByIds:Tr})}getId(e){return e.uuid}getBlockers(e){return[e.field_values]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,d=n.getState(),l=r(e)(d);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{field_values__asset_procedure__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class kR extends M{constructor(){super(...arguments);m(this,"name","Asset Procedure Type Field Values");m(this,"url","/asset-procedure-type-field-values");m(this,"actions",{addOne:_r,addMany:gr,setOne:Pr,setMany:br,updateOne:Rr,updateMany:Mr,deleteOne:kr,deleteMany:Er,initialize:Fr});m(this,"selectors",{selectById:Br,selectByIds:Wr})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,u=new Date().toISOString(),p=O({...e,created_by:l,submitted_at:u}),y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(p),blockers:[e.asset,e.fields_revision,e.asset_procedure],blocks:[p.uuid]});return this.dispatch(a(p)),y.then(T=>{this.dispatch(c(T))}).catch(()=>{this.dispatch(r(p.uuid))}),[p,y]}bulkAdd(e,n){var E;const{values:a,payloads:c}=e,{addMany:r,setMany:d,deleteMany:l}=this.actions,u=new Date().toISOString(),p=((E=this.client.store.getState().userReducer.currentUser)==null?void 0:E.id)??null,y=[],f=pt(c,Math.min(n??c.length,ut)),T=[];for(const g of f){const k=[];for(const b of g){const z=O({...b,values:b.values,created_by:p,submitted_at:u});y.push(z),k.push({uuid:z.uuid,asset:b.asset,fields_revision:b.fields_revision,asset_procedure:b.asset_procedure,published_at:b.published_at,values:z.values})}T.push({submitted_at:u,values:a,field_values:k})}this.dispatch(r(y));const P=[];for(const g of T){const{field_values:k}=g,b=k.map(({asset:v})=>v),z=k.map(({fields_revision:v})=>v),j=k.map(({asset_procedure:v})=>v),W=k.map(({uuid:v})=>v),D=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:g,blockers:b.concat(z).concat(j),blocks:W});P.push(D)}return Promise.all(P).then(g=>{this.dispatch(d(g.flat()))}).catch(()=>{this.dispatch(l(V(y)))}),[y,P]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),d=c(e.uuid)(r);if(!d)throw new Error(`Expected AssetProcedureTypeFieldValues with uuid ${e.uuid} to exist`);const l={...d,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[l.fields_revision,l.asset,l.asset_procedure],blocks:[l.uuid]});return u.then(p=>{this.dispatch(a(p))}).catch(()=>{this.dispatch(a(d))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected submission with uuid ${e} to exist`);const u=Ir(e)(d);this.dispatch(a(e)),this.dispatch(vs(V(u)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(p){throw this.dispatch(c(l)),this.dispatch(Es(u)),p}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{asset_procedure__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class ER extends M{constructor(){super(...arguments);m(this,"name","Asset Procedure");m(this,"url","/asset-procedures");m(this,"actions",{addOne:Dr,addMany:zs,setOne:Ur,setMany:Lr,updateOne:jr,updateMany:$r,deleteOne:Cr,deleteMany:qs,initialize:qr});m(this,"selectors",{selectById:Kr,selectByIds:Yr})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[e.asset_procedure_type,e.asset_type],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Expected asset procedure with uuid ${e.uuid} to exist`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[r.uuid],blocks:[r.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected asset procedure with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{project:e}},n)).flat();return this.dispatch(a(r)),r}}class vR extends M{constructor(){super(...arguments);m(this,"name","Asset Procedure Type");m(this,"url","/asset-procedure-types");m(this,"actions",{addOne:Qr,addMany:Xr,setOne:id,setMany:nd,updateOne:xr,updateMany:ed,deleteOne:td,deleteMany:sd,initialize:Zr});m(this,"selectors",{selectById:rd,selectByIds:dd})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Expected asset procedure type with uuid ${e.uuid} to exist`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[r.uuid],blocks:[r.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected asset procedure type with uuid ${e} to exist`);const u=Hr(e)(d);this.dispatch(a(e)),this.dispatch(qs(V(u)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(p){throw this.dispatch(c(l)),this.dispatch(zs(u)),p}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class VR extends q{constructor(){super(...arguments);m(this,"name","Asset Procedure Step Fields Attachment");m(this,"url","/asset-procedure-step-fields-attachments");m(this,"actions",{addOne:od,addMany:hd,setOne:pd,setMany:md,updateOne:yd,updateMany:fd,deleteOne:Sd,deleteMany:Ad,initialize:ud});m(this,"selectors",{selectById:Td,selectByIds:Id})}getId(e){return e.uuid}getBlockers(e){return[e.fields_revision]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,field_identifier:e.field_identifier,fields_revision:e.fields_revision,file_sha1:e.file_sha1,file_name:e.file_name,file_extension:e.file_extension}}buildBulkPayload(e){return{uuid:e.uuid,field_identifier:e.field_identifier,fields_revision:e.fields_revision,file_sha1:e.file_sha1,file_name:e.file_name,file_extension:e.file_extension}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{fields_revision__asset_procedure_step__organization:e}},n);return this.dispatch(a(c)),c}}class BR extends M{constructor(){super(...arguments);m(this,"name","Asset Procedure Step Fields");m(this,"url","/asset-procedure-step-fields");m(this,"actions",{addOne:gd,addMany:Pd,setOne:bd,setMany:Rd,updateOne:Md,updateMany:kd,deleteOne:Ed,deleteMany:vd,initialize:_d});m(this,"selectors",{selectById:Vd,selectByIds:Bd})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[u.asset_procedure_step],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(f=>{throw this.dispatch(r(u.uuid)),f}),[u,p]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,c=n.getState().assetProcedureStepFieldsReducer.instances[e.uuid];if(!c)throw new Error(`AssetProcedureStepFields with uuid ${e.uuid} not found`);const r={...c,...e};this.dispatch(a(r));const d=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${c.uuid}/`,payload:e,blockers:[c.uuid],blocks:[c.uuid]});return d.then(l=>{this.dispatch(a(l))}).catch(l=>{throw this.dispatch(a(c)),l}),[r,d]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,r=n.getState().assetProcedureStepFieldsReducer.instances[e];if(!r)throw new Error(`AssetProcedureStepFields with uuid ${e} not found`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(d){throw this.dispatch(c(r)),d}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{asset_procedure_step__asset_procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class WR extends q{constructor(){super(...arguments);m(this,"name","Asset Procedure Step Field Values Attachment");m(this,"url","/asset-procedure-step-field-values-attachments");m(this,"actions",{addOne:Dd,addMany:Gs,setOne:jd,setMany:$d,updateOne:Cd,updateMany:Ud,deleteOne:Ld,deleteMany:Hs,initialize:qd});m(this,"selectors",{selectById:Gd,selectByIds:Hd})}getId(e){return e.uuid}getBlockers(e){return[e.field_values]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,d=n.getState(),l=r(e)(d);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{field_values__asset_procedure__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class zR extends M{constructor(){super(...arguments);m(this,"name","Asset Procedure Step Field Values");m(this,"url","/asset-procedure-step-field-values");m(this,"actions",{addOne:Qd,addMany:Xd,setOne:xd,setMany:el,updateOne:tl,updateMany:sl,deleteOne:il,deleteMany:nl,initialize:Zd});m(this,"selectors",{selectById:cl,selectByIds:rl})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,u=new Date().toISOString(),p=O({...e,created_by:l,submitted_at:u}),y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(p),blockers:[e.asset,e.fields_revision,e.asset_procedure],blocks:[p.uuid]});return this.dispatch(a(p)),y.then(T=>{this.dispatch(c(T))}).catch(()=>{this.dispatch(r(p.uuid))}),[p,y]}bulkAdd(e,n){var E;const{payloads:a,values:c}=e,{addMany:r,setMany:d,deleteMany:l}=this.actions,u=new Date().toISOString(),p=((E=this.client.store.getState().userReducer.currentUser)==null?void 0:E.id)??null,y=[],f=pt(a,Math.min(n??a.length,ut)),T=[];for(const g of f){const k=[];for(const b of g){const z=O({...b,values:b.values,created_by:p,submitted_at:u});y.push(z),k.push({uuid:z.uuid,asset:b.asset,fields_revision:b.fields_revision,asset_procedure:b.asset_procedure,asset_procedure_step:b.asset_procedure_step,published_at:b.published_at,values:z.values})}T.push({submitted_at:u,values:c,field_values:k})}this.dispatch(r(y));const P=[];for(const g of T){const{field_values:k}=g,b=k.map(({asset:v})=>v),z=k.map(({fields_revision:v})=>v),j=k.map(({asset_procedure:v})=>v),W=k.map(({uuid:v})=>v),D=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:g,blockers:b.concat(z).concat(j),blocks:W});P.push(D)}return Promise.all(P).then(g=>{this.dispatch(d(g.flat()))}).catch(()=>{this.dispatch(l(V(y)))}),[y,P]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),d=c(e.uuid)(r);if(!d)throw new Error(`Expected AssetProcedureStepFieldValues with uuid ${e.uuid} to exist`);const l={...d,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[l.fields_revision,l.asset,l.asset_procedure],blocks:[l.uuid]});return u.then(p=>{this.dispatch(a(p))}).catch(()=>{this.dispatch(a(d))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected submission with uuid ${e} to exist`);const u=Kd(e)(d);this.dispatch(a(e)),this.dispatch(Hs(V(u)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(p){throw this.dispatch(c(l)),this.dispatch(Gs(u)),p}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{asset_procedure__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class qR extends M{constructor(){super(...arguments);m(this,"name","Asset Procedure Step");m(this,"url","/asset-procedure-steps");m(this,"actions",{addOne:pl,addMany:ml,setOne:ol,setMany:hl,updateOne:yl,updateMany:fl,deleteOne:Sl,deleteMany:Al,initialize:ul});m(this,"selectors",{selectById:Tl,selectByIds:Il})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[u.asset_procedure_type],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`No asset procedure step with uuid ${e.uuid} found in the store`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${r.uuid}/`,payload:{name:e.name,description:e.description,priority:e.order,color:e.color},blockers:[r.uuid],blocks:[r.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteMany:a,addMany:c,addOne:r,deleteOne:d}=this.actions,{selectById:l}=this.selectors,u=n.getState(),p=l(e)(u);if(!p)throw new Error(`No asset procedure step with uuid ${e} found in the store`);const y=Ol(e)(u);this.dispatch(d(e)),this.dispatch(a(V(y)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(f){throw this.dispatch(r(p)),this.dispatch(c(y)),f}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{asset_procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class DR extends M{constructor(){super(...arguments);m(this,"url","/assets");m(this,"name","Asset");m(this,"actions",{addOne:gl,addMany:Xs,setOne:Ml,setMany:kl,updateOne:Pl,updateMany:bl,deleteOne:Rl,deleteMany:xs,initialize:_l});m(this,"selectors",{selectById:Vl,selectByIds:Bl})}add(e){var y;const{store:n}=this.client,{addOne:a,updateOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[u.asset_type],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}update(e){const{store:n}=this.client,{updateOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`No asset with uuid ${e.uuid} found in the store`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{addOne:a,deleteOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`No asset with uuid ${e} found in the store`);const u=wc(e)(d),p=Vy(e)(d);this.dispatch(c(e)),this.dispatch(Fs(V(u))),this.dispatch(yt(V(p)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(y){throw this.dispatch(a(l)),this.dispatch(Os(u)),this.dispatch(mt(p)),y}}bulkAdd(e,n){const{addMany:a}=this.actions,c=new Date().toISOString(),r=ot.v4(),d=pt(e,Math.min(n??e.length,ut)).map(p=>{const y=p.map(f=>O(f));return{batchId:ot.v4(),payload:{transaction_id:r,submitted_at:c,assets:y}}}),l=[];let u=null;for(const p of d){const{batchId:y,payload:f}=p,T=f.assets.map(({uuid:b})=>b),P=f.assets.map(({asset_type:b})=>b),E=f.assets.map(({project:b})=>b),g=f.assets.map(({status:b})=>b),k=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:f,blockers:(u?[u]:[]).concat(P).concat(E).concat(g),blocks:[y].concat(T)});u=p.batchId,l.push(k)}return Promise.all(l).then(p=>{const y=p.flat();this.dispatch(a(y))}),l}bulkUpdate(e,n){const{store:a}=this.client,{updateMany:c}=this.actions,{selectByIds:r}=this.selectors,d=V(e).toSorted(Ut);if(d.length!==e.length)throw new Error("payloads contains duplicate uuids.");const l=r(d)(a.getState()).toSorted(As);if(d.length!=l.length)throw new Error(`Attempting to bulk update ${d.length-l.length} assets that dont exist in the store`);const u=[];for(let T=0;T<d.length;T++)u.push({...l[T],...e[T]});this.dispatch(c(u));const p=pt(e,Math.min(n??e.length,ut)),y=[];let f=null;for(const T of p){const P=ot.v4(),E=V(T),g=T.map(({status:b})=>b).filter(Boolean),k=this.enqueueRequest({description:w(h.PATCH,this.name,!0),method:h.PATCH,url:`${this.url}/bulk/`,payload:{payloads:T},blockers:(f?[f]:[]).concat(E).concat(g),blocks:[P].concat(E)});y.push(k),f=P}return Promise.all(y).then(T=>{this.dispatch(c(T.flat()))}).catch(()=>{this.dispatch(c(l))}),[u,y]}async bulkDelete(e){const{store:n}=this.client,{addMany:a,deleteMany:c}=this.actions,{selectByIds:r}=this.selectors,d=n.getState(),l=r(e)(d);this.dispatch(c(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(u){throw this.dispatch(a(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{project:e}},n)).flat();return this.dispatch(a(r)),r}}class jR extends M{constructor(){super(...arguments);m(this,"name","Asset Stage Completion");m(this,"url","/asset-stage-completions");m(this,"actions",{addOne:Dl,addMany:jl,setOne:$l,setMany:Cl,updateOne:Ul,updateMany:Ll,deleteOne:Nl,deleteMany:Gl,initialize:ql});m(this,"selectors",{selectById:Jl,selectByIds:Zl})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[e.asset,e.asset_stage],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Expected asset stage completion with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}bulkAdd(e){var T;const{store:n}=this.client,{addMany:a,setMany:c,deleteMany:r}=this.actions,d=new Date().toISOString(),l=((T=n.getState().userReducer.currentUser)==null?void 0:T.id)??null,u=e.map(P=>O(P)),p=u.map(P=>({...P,created_by:l,submitted_at:d})),y=p.map(({uuid:P})=>P);this.dispatch(a(p));const f=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:{submitted_at:d,completions:u},blockers:[...e.map(P=>P.asset_procedure),...e.map(P=>P.asset_stage),...e.map(P=>P.asset)],blocks:y});return f.then(P=>{this.dispatch(c(P))}).catch(()=>{this.dispatch(r(y))}),[p,f]}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,d=r(e)(n.getState());this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{asset_procedure__project:e}},n)).flat();return this.dispatch(a(r)),r}}class $R extends M{constructor(){super(...arguments);m(this,"name","Asset Stage");m(this,"url","/asset-stages");m(this,"actions",{addOne:tu,addMany:su,setOne:xl,setMany:eu,updateOne:iu,updateMany:nu,deleteOne:au,deleteMany:cu,initialize:Xl});m(this,"selectors",{selectById:du,selectByIds:lu})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[u.asset_procedure_type],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`No asset stage with uuid ${e.uuid} found in the store`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${r.uuid}/`,payload:e,blockers:[r.uuid],blocks:[r.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`No asset stage with uuid ${e} found in the store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{asset_procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class CR extends q{constructor(){super(...arguments);m(this,"name","Asset Type Attachment");m(this,"url","/asset-type-attachments");m(this,"actions",{addOne:hu,addMany:ai,setOne:pu,setMany:mu,updateOne:yu,updateMany:fu,deleteOne:Su,deleteMany:ci,initialize:ou});m(this,"selectors",{selectById:wu,selectByIds:Tu})}getId(e){return e.uuid}getBlockers(e){return[e.asset_type]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,asset_type:e.asset_type}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,asset_type:e.asset_type}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{asset_type__organization:e}},n);return this.dispatch(a(c)),c}}class UR extends q{constructor(){super(...arguments);m(this,"name","Asset Type Fields Attachment");m(this,"url","/asset-type-fields-attachments");m(this,"actions",{addOne:gu,addMany:Pu,setOne:bu,setMany:Ru,updateOne:Mu,updateMany:ku,deleteOne:Eu,deleteMany:vu,initialize:_u});m(this,"selectors",{selectById:Bu,selectByIds:Wu})}getId(e){return e.uuid}getBlockers(e){return[e.fields_revision]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{fields_revision__asset_type__organization:e}},n);return this.dispatch(a(c)),c}}class LR extends M{constructor(){super(...arguments);m(this,"name","Asset Type Fields");m(this,"url","/asset-type-fields");m(this,"actions",{addOne:ju,addMany:$u,setOne:Cu,setMany:Uu,updateOne:Lu,updateMany:Nu,deleteOne:Gu,deleteMany:Hu,initialize:Du});m(this,"selectors",{selectById:Yu,selectByIds:Ju})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[u.asset_type],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(f=>{throw this.dispatch(r(u.uuid)),f}),[u,p]}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{asset_type__organization:e}},n);return this.dispatch(a(c)),c}}class NR extends q{constructor(){super(...arguments);m(this,"name","Asset Type Field Values Attachment");m(this,"url","/asset-type-field-values-attachments");m(this,"actions",{addOne:xu,addMany:hi,setOne:eo,setMany:to,updateOne:so,updateMany:io,deleteOne:no,deleteMany:pi,initialize:Xu});m(this,"selectors",{selectById:co,selectByIds:ro})}getId(e){return e.uuid}getBlockers(e){return[e.field_values]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,d=n.getState(),l=r(e)(d);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{field_values__asset__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class GR extends M{constructor(){super(...arguments);m(this,"name","Asset Type Field Values");m(this,"url","/asset-type-field-values");m(this,"actions",{addOne:po,addMany:mo,setOne:yo,setMany:fo,updateOne:So,updateMany:Ao,deleteOne:wo,deleteMany:To,initialize:ho});m(this,"selectors",{selectById:Oo,selectByIds:Fo})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,u=new Date().toISOString(),p=O({...e,created_by:l,submitted_at:u}),y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(p),blockers:[e.asset,e.fields_revision],blocks:[p.uuid]});return this.dispatch(a(p)),y.then(T=>{this.dispatch(c(T))}).catch(()=>{this.dispatch(r(p.uuid))}),[p,y]}bulkAdd(e,n){var P;const{payloads:a,values:c}=e,{addMany:r,setMany:d,deleteMany:l}=this.actions,u=new Date().toISOString(),p=[],y=pt(a,Math.min(n??a.length,ut)),f=[];for(const E of y){const g=[];for(const k of E){const b=O({...k,values:k.values,created_by:((P=this.client.store.getState().userReducer.currentUser)==null?void 0:P.id)??null,submitted_at:u});p.push(b),g.push({uuid:b.uuid,asset:k.asset,fields_revision:k.fields_revision,published_at:k.published_at,values:b.values})}f.push({submitted_at:u,values:c,field_values:g})}this.dispatch(r(p));const T=[];for(const E of f){const{field_values:g}=E,k=g.map(({asset:W})=>W),b=g.map(({fields_revision:W})=>W),z=g.map(({uuid:W})=>W),j=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:E,blockers:k.concat(b),blocks:z});T.push(j)}return Promise.all(T).then(E=>{this.dispatch(d(E.flat()))}).catch(()=>{this.dispatch(l(V(p)))}),[p,T]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),d=c(e.uuid)(r);if(!d)throw new Error(`Expected AssetTypeFieldValues with uuid ${e.uuid} to exist`);const l={...d,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[l.uuid,l.fields_revision,l.asset],blocks:[l.uuid]});return u.then(p=>{this.dispatch(a(p))}).catch(()=>{this.dispatch(a(d))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected submission with uuid ${e} to exist`);const u=lo(e)(d);this.dispatch(a(e)),this.dispatch(pi(V(u)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(p){throw this.dispatch(c(l)),this.dispatch(hi(u)),p}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{asset__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class HR extends M{constructor(){super(...arguments);m(this,"name","Asset Type Identifier");m(this,"url","/asset-type-identifiers");m(this,"actions",{addOne:bo,addMany:Ro,setOne:Mo,setMany:ko,updateOne:Eo,updateMany:vo,deleteOne:Vo,deleteMany:Bo,initialize:Po});m(this,"selectors",{selectById:zo,selectByIds:qo})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[u.asset_type],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Expected asset type identifier with uuid ${e.uuid} to exist`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected asset type identifier with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{asset_type__organization:e}},n);return this.dispatch(a(c)),c}}class KR extends M{constructor(){super(...arguments);m(this,"name","Asset Type Identifier Value");m(this,"url","/asset-type-identifier-values");m(this,"actions",{addOne:Co,addMany:Uo,setOne:Lo,setMany:No,updateOne:Go,updateMany:Ho,deleteOne:Ko,deleteMany:Yo,initialize:$o});m(this,"selectors",{selectById:Zo,selectByIds:Qo})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[e.asset,e.asset_type_identifier],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}bulkAdd(e,n){var E;const{store:a}=this.client,{addMany:c,updateMany:r,deleteMany:d}=this.actions,l=new Date().toISOString(),u=((E=a.getState().userReducer.currentUser)==null?void 0:E.id)??null,p=pt(e,Math.min(n??e.length,ut)),y=[],f=[];for(const g of p){const k=[],b=[],z=[];for(const W of g){const D=O({...W,submitted_at:l,created_by:u});f.push(D);const v={uuid:D.uuid,asset:D.asset,asset_type_identifier:D.asset_type_identifier,value:D.value};k.push(v),b.push(D.asset),b.push(D.asset_type_identifier),z.push(D.uuid)}const j={payloads:k,submitted_at:l,blockers:b,blocks:z};y.push(j)}this.dispatch(c(f));const T=y.map(g=>{const{payloads:k,submitted_at:b,blockers:z,blocks:j}=g;return this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:{submitted_at:b,payloads:k},blockers:z,blocks:j})});Promise.all(T).then(g=>{this.dispatch(r(g.flat()))}).catch(g=>{throw this.dispatch(d(V(f))),g});const P=Promise.all(T).then(g=>g.flat());return[f,P]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected asset type identifier value with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{asset__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class YR extends M{constructor(){super(...arguments);m(this,"name","Asset Type");m(this,"url","/asset-types");m(this,"actions",{addOne:ih,addMany:nh,setOne:th,setMany:sh,updateOne:ah,updateMany:ch,deleteOne:rh,deleteMany:dh,initialize:eh});m(this,"selectors",{selectById:uh,selectByIds:oh})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Expected asset type with uuid ${e.uuid} to exist`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[r.uuid],blocks:[r.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected asset type with uuid ${e} to exist`);const u=vl(e)(d),p=Iu(e)(d);this.dispatch(a(e)),this.dispatch(xs(V(u))),this.dispatch(ci(V(p)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(y){throw this.dispatch(c(l)),this.dispatch(Xs(u)),this.dispatch(ai(p)),y}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class JR extends M{constructor(){super(...arguments);m(this,"name","Asset Type Status");m(this,"url","/asset-type-statuses");m(this,"actions",{addOne:yh,addMany:fh,setOne:Sh,setMany:Ah,updateOne:wh,updateMany:Th,deleteOne:Ih,deleteMany:Oh,initialize:mh});m(this,"selectors",{selectById:_h,selectByIds:gh})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[e.asset_type],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}update(e){const{setOne:n}=this.actions,{selectById:a}=this.selectors,c=this.client.store.getState(),r=a(e.uuid)(c);if(!r)throw new Error(`Expected an existing asset type status with uuid ${e.uuid}`);const d={...r,...e};this.dispatch(n(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(n(u))}).catch(()=>{this.dispatch(n(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`No asset type status with uuid ${e} found in the store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{asset_type__organization:e}},n);return this.dispatch(a(c)),c}}class ZR extends q{constructor(){super(...arguments);m(this,"name","Document Attachment");m(this,"url","/document-attachments");m(this,"actions",{addOne:vh,addMany:Vh,setOne:Bh,setMany:Wh,updateOne:zh,updateMany:qh,deleteOne:Dh,deleteMany:jh,initialize:Eh});m(this,"selectors",{selectById:Ch,selectByIds:Uh})}getId(e){return e.uuid}getBlockers(e){return[e.document]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,document:e.document}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,document:e.document}}async bulkAdd(e,n){const[a,c,r]=await super.bulkAdd(e,n),d={};for(const{file_sha1:l,uuid:u}of a)l in d||(d[l]=[]),d[l].push(u);return r.then(l=>{const u=l.flatMap(p=>d[p]??[]);for(const p of u)this.makeReadable(p)}),[a,c,r]}makeReadable(e){this.enqueueRequest({description:"Add attachment to AI assistant",method:h.PATCH,url:`${this.url}/${e}/`,payload:{readable_to_assistant:!0},blockers:["index-document-attachment",e],blocks:["index-document-attachment"]})}async refreshStore(e,n){const{initialize:a}=this.actions,c=this.list({queryParams:{document__project__organization:e}},n),r=this.list({queryParams:{document__organization:e}},n),l=(await Promise.all([c,r])).flat();return this.dispatch(a(l)),l}}class QR extends M{constructor(){super(...arguments);m(this,"name","Document");m(this,"url","/documents");m(this,"actions",{addOne:Hh,addMany:Kh,setOne:Yh,setMany:Jh,updateOne:Zh,updateMany:Qh,deleteOne:Xh,deleteMany:xh,initialize:Gh});m(this,"selectors",{selectById:tp,selectByIds:sp})}add(e){var y;const{store:n}=this.client,{addOne:a,deleteOne:c,updateOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:u.parent_document?[u.parent_document]:[],blocks:[u.uuid]});return p.then(f=>{this.dispatch(r(f))}).catch(()=>{this.dispatch(c(u.uuid))}),[u,p]}update(e){const{store:n}=this.client,{updateOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`attempting to update a document with uuid ${e.uuid} that does not exist in store.documents`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c,addMany:r,deleteMany:d}=this.actions,{selectById:l}=this.selectors,u=n.getState(),p=l(e)(u);if(!p)throw new Error(`attempting to delete a document with uuid ${e} that does not exist in store.documents`);const y=ip(e)(u);this.dispatch(a(e)),this.dispatch(d(V(y)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(f){throw this.dispatch(c(p)),this.dispatch(r(y)),f}}async refreshStore(e,n){const{initialize:a}=this.actions,c=this.list({queryParams:{project__organization:e}},n),r=this.list({queryParams:{organization:e}},n),l=(await Promise.all([c,r])).flat();return this.dispatch(a(l)),l}}class Ot extends St{async get(s,e){return this.performRequest({url:`${this.url}/${s}/`,method:h.GET},e)}async list(s,e){return this.performRequest({url:`${this.url}/`,method:h.GET,...s},e)}async listPaginated(s,e){return this.performPagination({url:`${this.url}/`,method:h.GET,...s},e)}}class XR extends Ot{constructor(){super(...arguments);m(this,"name","Email Domains");m(this,"url","/organization-email-domains");m(this,"actions",{addOne:cp,addMany:rp,setOne:dp,setMany:lp,updateOne:up,updateMany:op,deleteOne:hp,deleteMany:pp,initialize:ap});m(this,"selectors",{selectById:yp,selectByIds:fp})}async add(e,n){return this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:{email:n,organization:e},blockers:[e,"create-org"],blocks:[]})}async delete(e){const{deleteOne:n,addOne:a}=this.actions;this.dispatch(n(e.uuid));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e.uuid}/`,blockers:[e.domain],blocks:[]})}catch(c){throw this.dispatch(a(e)),c}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class xR extends St{async getVerificationCode(s){return this.enqueueRequest({description:"Get verification code",method:h.GET,url:`/verification/email-verification/${s}/`,isAuthNeeded:!1,blockers:[],blocks:[]})}validateVerificationCode(s,e=void 0){return this.enqueueRequest({description:"Validate verification code",method:h.POST,url:`/verification/email-verification/${s}/`,isAuthNeeded:!1,payload:e,blockers:[],blocks:[]})}}const Dt={},Ra=new Set;class eM extends St{constructor(){super(...arguments);m(this,"host");m(this,"dbPromise",Pg.openDB("fileCache",1,{upgrade(e){e.createObjectStore("files")}}))}async getDB(){return await this.dbPromise}async addCache(e){if(!e.name)throw new Error(`Cant add a file without a name to cache: ${e.name}`);if(!e.type)throw new Error(`Cant add a file without a type to cache: ${e.name}`);if(!e.size)throw new Error(`Cant add an empty file to cache: ${e.name}`);const n=await Ct(e);if(Ra.has(n))return;const a=await this.getDB();!!await a.get("files",n)?console.warn(`Attempting to add a file already cached, ${e.name}`):await a.put("files",e,n),Ra.add(n)}async removeCache(e){await(await this.getDB()).delete("files",e),Ra.delete(e)}async fetchCache(e){return(await this.getDB()).get("files",e)}async fetchFileFromUrl(e,n,a=n){const c=e.split("?")[0]??e,r=await this.fetchCache(n);if(r)return r;let d;c in Dt?d=Dt[c]:Ka(e)?(d=Ha(e,a),Dt[c]=d):(d=new Promise(p=>{this.performRequest({method:h.GET,url:e,isExternalUrl:!0,isResponseBlob:!0,isAuthNeeded:!1}).then(y=>{const f=new File([y],a,{type:y.type});p(f)})}),Dt[c]=d);let l;try{l=await d}catch(p){throw p instanceof C&&delete Dt[c],p}const u=await Ct(l);if(u!==n){const p=`The hash of the file returned from the server (${u}) does not match the
|
|
7
|
+
`)}catch(a){console.error("Failed to extract error message from response body",a)}}else typeof t.body=="string"&&(e=t.body);else t!=null&&t.text?e=t.text:s instanceof Error&&(e=s.message);return!e||e.length>IR?Ot:e}class C extends Error{constructor(e){super(Ot);m(this,"status");m(this,"response");m(this,"message");m(this,"options");const{response:n,innerError:a}=e;this.message=e.message??OR(n,a)??Ot,this.status=(n==null?void 0:n.status)??0,this.response=n,e.discard=e.discard??!1,this.options=e}}function dg(t){function s(e){return typeof e=="object"&&e!==null&&["ok","redirect","clientError","serverError","error"].every(a=>a in e)}if(s(t))return t;if(typeof t=="object"&&t!==null){const e=t;if(s(e.response))return e.response;if(e.response&&s(e.response.response))return e.response.response}}class FR extends X_{constructor(s){super(s)}}class St extends X_{constructor(e,n){super(e);m(this,"auth");this.auth=n}}class _R extends St{async startConversation(s,e){return this.enqueueRequest({description:"Start agent conversation",method:h.POST,url:"/agents/prompt/",payload:{prompt:s,active_project:e},blockers:["prompt"],blocks:["prompt"]}).then(n=>(this.dispatch(nc(n)),n))}async continueConversation(s,e,n){return this.enqueueRequest({description:"Prompt agent",method:h.POST,url:"/agents/prompt/",payload:{prompt:s,active_project:n},blockers:["prompt"],blocks:["prompt"],queryParams:{conversation_id:e}}).then(a=>{this.dispatch(cc(a))})}async fetchDetails(s){return this.enqueueRequest({description:"Get agent conversation",method:h.GET,url:`/agents/conversations/${s}/`,blockers:["conversation"],blocks:["conversation"]}).then(e=>{this.dispatch(ac(e))})}async rate(s,e){return this.enqueueRequest({description:"Rate agent response",method:h.PUT,url:`/agents/responses/${s}/rate/`,payload:{rating:e},blockers:["rate"],blocks:["rate"]})}async list(s,e){return this.performRequest({method:h.GET,url:"/agents/conversations/",...s},e)}async refreshStore(s,e){const n=await this.list({queryParams:{project:s}},e);return this.dispatch(ic(n)),n}}function pt(t,s){const e=[];let n=0;const a=t.length;for(;n<a;)e.push(t.slice(n,n+=s));return e}function w(t,s,e){const n=`${s}${e?"s":""}`;switch(t){case h.GET:return`Get ${n}`;case h.POST:return`Create ${n}`;case h.PATCH:return`Update ${n}`;case h.PUT:return`Update ${n}`;case h.DELETE:return`Delete ${n}`}}class k extends St{async get(s,e){return this.performRequest({url:`${this.url}/${s}/`,method:h.GET},e)}async list(s,e){return this.performRequest({url:`${this.url}/`,method:h.GET,...s},e)}async listPaginated(s,e){return this.performPagination({url:`${this.url}/`,method:h.GET,...s},e)}}class q extends k{constructor(){super(...arguments);m(this,"pageSize",Z_)}async add(e){const{addOne:n,updateOne:a,deleteOne:c}=this.actions;let r,d=null,l=null;if("file"in e){const{file:P,...E}=e;d=await this.client.files.getFilePayload(P),l=URL.createObjectURL(P),r={...E,file_sha1:d.sha1,file_type:d.file_type,file_name:P.name,file_extension:d.extension,file_url:l}}else r=e;const u=this.buildModel(r),p=this.buildPayload(u);this.dispatch(n(u));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:{...p,...d?{file:d}:{}},blockers:this.getBlockers(u),blocks:this.getBlocks(u)});y.then(({instance:P})=>{this.dispatch(a(P))}).catch(P=>{throw this.dispatch(c(this.getId(u))),P}).finally(()=>{l&&URL.revokeObjectURL(l)});const f=y.then(({instance:P})=>P),T=y.then(async({instance:P,presigned_url:E})=>{try{return E&&await this.client.files.processPresignedUrl(P.file_sha1,E),P.file_sha1}catch(g){throw console.error("Upload to s3 using presigned url failed.",g),g}});return[u,f,T]}async bulkAdd(e,n){const{addMany:a,updateMany:c,deleteMany:r}=this.actions,d=new Date().toISOString(),l=[],u=new Set,p=pt(e,Math.min(n??e.length,ut)),y=[];for(const E of p){const g=[],M={},b=[],z=[];for(const W of E){let D;if("file"in W){const{file:va,...xM}=W,gt=await this.client.files.getFilePayload(va);gt.sha1 in M||(M[gt.sha1]=gt);const Tg=URL.createObjectURL(va);u.add(Tg),D={...xM,file_sha1:gt.sha1,file_type:gt.file_type,file_name:va.name,file_extension:gt.extension,file_url:Tg}}else D=W;const v=this.buildModel(D);l.push(v);const L=this.buildBulkPayload(v);g.push(L);const hs=this.getBlockers(v);b.push(...hs);const XM=this.getBlocks(v);z.push(...XM)}const j={payloads:g,submittedAt:d,files:Object.values(M),blockers:b,blocks:z};y.push(j)}this.dispatch(a(l));const f=y.map(E=>{const{submittedAt:g,files:M,payloads:b,blocks:z,blockers:j}=E;return this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:{submitted_at:g,files:M,payloads:b},blockers:j,blocks:z})});Promise.all(f).then(E=>{const g=E.flatMap(M=>M.instances);this.dispatch(c(g))}).catch(E=>{throw this.dispatch(r(l.map(g=>this.getId(g)))),console.error(E),E}).finally(()=>{for(const E of u)URL.revokeObjectURL(E)});const T=Promise.all(f).then(E=>E.flatMap(({instances:g})=>g)),P=Promise.all(f).then(async E=>{const g=[];for(const{presigned_urls:M}of E){const b=this.client.files.processPresignedUrls(M);for(const[z,j]of Object.entries(b))try{await j,g.push(z)}catch(W){throw console.error("Upload to s3 using presigned url failed.",W),W}}return g});return[l,T,P]}async delete(e){const{store:n}=this.client,{addOne:a,deleteOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Attempting to delete ${this.name} with pk ${e} that does not exist in the store`);this.dispatch(c(this.getId(d)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(a(d)),l}}}class gR extends q{constructor(){super(...arguments);m(this,"name","Asset attachment");m(this,"url","/asset-attachments");m(this,"actions",{addOne:uc,addMany:Os,setOne:oc,setMany:hc,updateOne:pc,updateMany:mc,deleteOne:yc,deleteMany:Fs,initialize:lc});m(this,"selectors",{selectById:Sc,selectByIds:Ac})}getId(e){return e.uuid}getBlockers(e){const{asset:n}=e;return[n]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,asset:e.asset}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,asset:e.asset}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{asset__project:e}},n)).flat();return this.dispatch(a(r)),r}}class PR extends q{constructor(){super(...arguments);m(this,"name","Asset Procedure Attachment");m(this,"url","/asset-procedure-type-attachments");m(this,"actions",{addOne:Fc,addMany:_c,setOne:gc,setMany:Pc,updateOne:bc,updateMany:Rc,deleteOne:Mc,deleteMany:kc,initialize:Oc});m(this,"selectors",{selectById:Vc,selectByIds:Bc})}getId(e){return e.uuid}getBlockers(e){return[e.asset_procedure_type]}getBlocks(e){return[e.uuid]}buildModel(e){var f;const{store:n}=this.client,{asset_procedure_type:a,file_sha1:c,file_extension:r,file_name:d,file_type:l,file_url:u}=e,p=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,y=new Date().toISOString();return O({file_url:u,file_sha1:c,file_extension:r,file_name:d,file_type:l,created_by:p,submitted_at:y,asset_procedure_type:a})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,asset_procedure_type:e.asset_procedure_type}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,asset_procedure_type:e.asset_procedure_type}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{asset_procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class bR extends q{constructor(){super(...arguments);m(this,"name","Asset Procedure Type Fields Attachment");m(this,"url","/asset-procedure-type-fields-attachments");m(this,"actions",{addOne:qc,addMany:Dc,setOne:jc,setMany:$c,updateOne:Cc,updateMany:Uc,deleteOne:Lc,deleteMany:Nc,initialize:zc});m(this,"selectors",{selectById:Kc,selectByIds:Yc})}getId(e){return e.uuid}getBlockers(e){return[e.fields_revision]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{fields_revision__asset_procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class RR extends k{constructor(){super(...arguments);m(this,"name","Asset Procedure Type Fields");m(this,"url","/asset-procedure-type-fields");m(this,"actions",{addOne:Qc,addMany:Xc,setOne:xc,setMany:er,updateOne:tr,updateMany:sr,deleteOne:ir,deleteMany:nr,initialize:Zc});m(this,"selectors",{selectById:rr,selectByIds:dr})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[u.asset_procedure_type],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(f=>{throw this.dispatch(r(u.uuid)),f}),[u,p]}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{asset_procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class MR extends q{constructor(){super(...arguments);m(this,"name","Asset Procedure Type Field Values Attachment");m(this,"url","/asset-procedure-type-field-values-attachments");m(this,"actions",{addOne:or,addMany:Es,setOne:hr,setMany:pr,updateOne:mr,updateMany:yr,deleteOne:fr,deleteMany:vs,initialize:ur});m(this,"selectors",{selectById:wr,selectByIds:Tr})}getId(e){return e.uuid}getBlockers(e){return[e.field_values]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,d=n.getState(),l=r(e)(d);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{field_values__asset_procedure__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class kR extends k{constructor(){super(...arguments);m(this,"name","Asset Procedure Type Field Values");m(this,"url","/asset-procedure-type-field-values");m(this,"actions",{addOne:_r,addMany:gr,setOne:Pr,setMany:br,updateOne:Rr,updateMany:Mr,deleteOne:kr,deleteMany:Er,initialize:Fr});m(this,"selectors",{selectById:Br,selectByIds:Wr})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,u=new Date().toISOString(),p=O({...e,created_by:l,submitted_at:u}),y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(p),blockers:[e.asset,e.fields_revision,e.asset_procedure],blocks:[p.uuid]});return this.dispatch(a(p)),y.then(T=>{this.dispatch(c(T))}).catch(()=>{this.dispatch(r(p.uuid))}),[p,y]}bulkAdd(e,n){var E;const{values:a,payloads:c}=e,{addMany:r,setMany:d,deleteMany:l}=this.actions,u=new Date().toISOString(),p=((E=this.client.store.getState().userReducer.currentUser)==null?void 0:E.id)??null,y=[],f=pt(c,Math.min(n??c.length,ut)),T=[];for(const g of f){const M=[];for(const b of g){const z=O({...b,values:b.values,created_by:p,submitted_at:u});y.push(z),M.push({uuid:z.uuid,asset:b.asset,fields_revision:b.fields_revision,asset_procedure:b.asset_procedure,published_at:b.published_at,values:z.values})}T.push({submitted_at:u,values:a,field_values:M})}this.dispatch(r(y));const P=[];for(const g of T){const{field_values:M}=g,b=M.map(({asset:v})=>v),z=M.map(({fields_revision:v})=>v),j=M.map(({asset_procedure:v})=>v),W=M.map(({uuid:v})=>v),D=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:g,blockers:b.concat(z).concat(j),blocks:W});P.push(D)}return Promise.all(P).then(g=>{this.dispatch(d(g.flat()))}).catch(()=>{this.dispatch(l(V(y)))}),[y,P]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),d=c(e.uuid)(r);if(!d)throw new Error(`Expected AssetProcedureTypeFieldValues with uuid ${e.uuid} to exist`);const l={...d,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[l.fields_revision,l.asset,l.asset_procedure],blocks:[l.uuid]});return u.then(p=>{this.dispatch(a(p))}).catch(()=>{this.dispatch(a(d))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected submission with uuid ${e} to exist`);const u=Ir(e)(d);this.dispatch(a(e)),this.dispatch(vs(V(u)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(p){throw this.dispatch(c(l)),this.dispatch(Es(u)),p}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{asset_procedure__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class ER extends k{constructor(){super(...arguments);m(this,"name","Asset Procedure");m(this,"url","/asset-procedures");m(this,"actions",{addOne:Dr,addMany:zs,setOne:Ur,setMany:Lr,updateOne:jr,updateMany:$r,deleteOne:Cr,deleteMany:qs,initialize:qr});m(this,"selectors",{selectById:Kr,selectByIds:Yr})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[e.asset_procedure_type,e.asset_type],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Expected asset procedure with uuid ${e.uuid} to exist`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[r.uuid],blocks:[r.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected asset procedure with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{project:e}},n)).flat();return this.dispatch(a(r)),r}}class vR extends k{constructor(){super(...arguments);m(this,"name","Asset Procedure Type");m(this,"url","/asset-procedure-types");m(this,"actions",{addOne:Qr,addMany:Xr,setOne:id,setMany:nd,updateOne:xr,updateMany:ed,deleteOne:td,deleteMany:sd,initialize:Zr});m(this,"selectors",{selectById:rd,selectByIds:dd})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Expected asset procedure type with uuid ${e.uuid} to exist`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[r.uuid],blocks:[r.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected asset procedure type with uuid ${e} to exist`);const u=Hr(e)(d);this.dispatch(a(e)),this.dispatch(qs(V(u)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(p){throw this.dispatch(c(l)),this.dispatch(zs(u)),p}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class VR extends q{constructor(){super(...arguments);m(this,"name","Asset Procedure Step Fields Attachment");m(this,"url","/asset-procedure-step-fields-attachments");m(this,"actions",{addOne:od,addMany:hd,setOne:pd,setMany:md,updateOne:yd,updateMany:fd,deleteOne:Sd,deleteMany:Ad,initialize:ud});m(this,"selectors",{selectById:Td,selectByIds:Id})}getId(e){return e.uuid}getBlockers(e){return[e.fields_revision]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,field_identifier:e.field_identifier,fields_revision:e.fields_revision,file_sha1:e.file_sha1,file_name:e.file_name,file_extension:e.file_extension}}buildBulkPayload(e){return{uuid:e.uuid,field_identifier:e.field_identifier,fields_revision:e.fields_revision,file_sha1:e.file_sha1,file_name:e.file_name,file_extension:e.file_extension}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{fields_revision__asset_procedure_step__organization:e}},n);return this.dispatch(a(c)),c}}class BR extends k{constructor(){super(...arguments);m(this,"name","Asset Procedure Step Fields");m(this,"url","/asset-procedure-step-fields");m(this,"actions",{addOne:gd,addMany:Pd,setOne:bd,setMany:Rd,updateOne:Md,updateMany:kd,deleteOne:Ed,deleteMany:vd,initialize:_d});m(this,"selectors",{selectById:Vd,selectByIds:Bd})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[u.asset_procedure_step],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(f=>{throw this.dispatch(r(u.uuid)),f}),[u,p]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,c=n.getState().assetProcedureStepFieldsReducer.instances[e.uuid];if(!c)throw new Error(`AssetProcedureStepFields with uuid ${e.uuid} not found`);const r={...c,...e};this.dispatch(a(r));const d=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${c.uuid}/`,payload:e,blockers:[c.uuid],blocks:[c.uuid]});return d.then(l=>{this.dispatch(a(l))}).catch(l=>{throw this.dispatch(a(c)),l}),[r,d]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,r=n.getState().assetProcedureStepFieldsReducer.instances[e];if(!r)throw new Error(`AssetProcedureStepFields with uuid ${e} not found`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(d){throw this.dispatch(c(r)),d}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{asset_procedure_step__asset_procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class WR extends q{constructor(){super(...arguments);m(this,"name","Asset Procedure Step Field Values Attachment");m(this,"url","/asset-procedure-step-field-values-attachments");m(this,"actions",{addOne:Dd,addMany:Gs,setOne:jd,setMany:$d,updateOne:Cd,updateMany:Ud,deleteOne:Ld,deleteMany:Hs,initialize:qd});m(this,"selectors",{selectById:Gd,selectByIds:Hd})}getId(e){return e.uuid}getBlockers(e){return[e.field_values]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,d=n.getState(),l=r(e)(d);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{field_values__asset_procedure__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class zR extends k{constructor(){super(...arguments);m(this,"name","Asset Procedure Step Field Values");m(this,"url","/asset-procedure-step-field-values");m(this,"actions",{addOne:Qd,addMany:Xd,setOne:xd,setMany:el,updateOne:tl,updateMany:sl,deleteOne:il,deleteMany:nl,initialize:Zd});m(this,"selectors",{selectById:cl,selectByIds:rl})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,u=new Date().toISOString(),p=O({...e,created_by:l,submitted_at:u}),y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(p),blockers:[e.asset,e.fields_revision,e.asset_procedure],blocks:[p.uuid]});return this.dispatch(a(p)),y.then(T=>{this.dispatch(c(T))}).catch(()=>{this.dispatch(r(p.uuid))}),[p,y]}bulkAdd(e,n){var E;const{payloads:a,values:c}=e,{addMany:r,setMany:d,deleteMany:l}=this.actions,u=new Date().toISOString(),p=((E=this.client.store.getState().userReducer.currentUser)==null?void 0:E.id)??null,y=[],f=pt(a,Math.min(n??a.length,ut)),T=[];for(const g of f){const M=[];for(const b of g){const z=O({...b,values:b.values,created_by:p,submitted_at:u});y.push(z),M.push({uuid:z.uuid,asset:b.asset,fields_revision:b.fields_revision,asset_procedure:b.asset_procedure,asset_procedure_step:b.asset_procedure_step,published_at:b.published_at,values:z.values})}T.push({submitted_at:u,values:c,field_values:M})}this.dispatch(r(y));const P=[];for(const g of T){const{field_values:M}=g,b=M.map(({asset:v})=>v),z=M.map(({fields_revision:v})=>v),j=M.map(({asset_procedure:v})=>v),W=M.map(({uuid:v})=>v),D=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:g,blockers:b.concat(z).concat(j),blocks:W});P.push(D)}return Promise.all(P).then(g=>{this.dispatch(d(g.flat()))}).catch(()=>{this.dispatch(l(V(y)))}),[y,P]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),d=c(e.uuid)(r);if(!d)throw new Error(`Expected AssetProcedureStepFieldValues with uuid ${e.uuid} to exist`);const l={...d,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[l.fields_revision,l.asset,l.asset_procedure],blocks:[l.uuid]});return u.then(p=>{this.dispatch(a(p))}).catch(()=>{this.dispatch(a(d))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected submission with uuid ${e} to exist`);const u=Kd(e)(d);this.dispatch(a(e)),this.dispatch(Hs(V(u)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(p){throw this.dispatch(c(l)),this.dispatch(Gs(u)),p}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{asset_procedure__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class qR extends k{constructor(){super(...arguments);m(this,"name","Asset Procedure Step");m(this,"url","/asset-procedure-steps");m(this,"actions",{addOne:pl,addMany:ml,setOne:ol,setMany:hl,updateOne:yl,updateMany:fl,deleteOne:Sl,deleteMany:Al,initialize:ul});m(this,"selectors",{selectById:Tl,selectByIds:Il})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[u.asset_procedure_type],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`No asset procedure step with uuid ${e.uuid} found in the store`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${r.uuid}/`,payload:{name:e.name,description:e.description,priority:e.order,color:e.color},blockers:[r.uuid],blocks:[r.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteMany:a,addMany:c,addOne:r,deleteOne:d}=this.actions,{selectById:l}=this.selectors,u=n.getState(),p=l(e)(u);if(!p)throw new Error(`No asset procedure step with uuid ${e} found in the store`);const y=Ol(e)(u);this.dispatch(d(e)),this.dispatch(a(V(y)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(f){throw this.dispatch(r(p)),this.dispatch(c(y)),f}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{asset_procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class DR extends k{constructor(){super(...arguments);m(this,"url","/assets");m(this,"name","Asset");m(this,"actions",{addOne:gl,addMany:Xs,setOne:Ml,setMany:kl,updateOne:Pl,updateMany:bl,deleteOne:Rl,deleteMany:xs,initialize:_l});m(this,"selectors",{selectById:Vl,selectByIds:Bl})}add(e){var y;const{store:n}=this.client,{addOne:a,updateOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[u.asset_type],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}update(e){const{store:n}=this.client,{updateOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`No asset with uuid ${e.uuid} found in the store`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{addOne:a,deleteOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`No asset with uuid ${e} found in the store`);const u=wc(e)(d),p=Vy(e)(d);this.dispatch(c(e)),this.dispatch(Fs(V(u))),this.dispatch(yt(V(p)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(y){throw this.dispatch(a(l)),this.dispatch(Os(u)),this.dispatch(mt(p)),y}}bulkAdd(e,n){const{addMany:a}=this.actions,c=new Date().toISOString(),r=ot.v4(),d=pt(e,Math.min(n??e.length,ut)).map(p=>{const y=p.map(f=>O(f));return{batchId:ot.v4(),payload:{transaction_id:r,submitted_at:c,assets:y}}}),l=[];let u=null;for(const p of d){const{batchId:y,payload:f}=p,T=f.assets.map(({uuid:b})=>b),P=f.assets.map(({asset_type:b})=>b),E=f.assets.map(({project:b})=>b),g=f.assets.map(({status:b})=>b),M=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:f,blockers:(u?[u]:[]).concat(P).concat(E).concat(g),blocks:[y].concat(T)});u=p.batchId,l.push(M)}return Promise.all(l).then(p=>{const y=p.flat();this.dispatch(a(y))}),l}bulkUpdate(e,n){const{store:a}=this.client,{updateMany:c}=this.actions,{selectByIds:r}=this.selectors,d=V(e).toSorted(Ut);if(d.length!==e.length)throw new Error("payloads contains duplicate uuids.");const l=r(d)(a.getState()).toSorted(As);if(d.length!=l.length)throw new Error(`Attempting to bulk update ${d.length-l.length} assets that dont exist in the store`);const u=[];for(let T=0;T<d.length;T++)u.push({...l[T],...e[T]});this.dispatch(c(u));const p=pt(e,Math.min(n??e.length,ut)),y=[];let f=null;for(const T of p){const P=ot.v4(),E=V(T),g=T.map(({status:b})=>b).filter(Boolean),M=this.enqueueRequest({description:w(h.PATCH,this.name,!0),method:h.PATCH,url:`${this.url}/bulk/`,payload:{payloads:T},blockers:(f?[f]:[]).concat(E).concat(g),blocks:[P].concat(E)});y.push(M),f=P}return Promise.all(y).then(T=>{this.dispatch(c(T.flat()))}).catch(()=>{this.dispatch(c(l))}),[u,y]}async bulkDelete(e){const{store:n}=this.client,{addMany:a,deleteMany:c}=this.actions,{selectByIds:r}=this.selectors,d=n.getState(),l=r(e)(d);this.dispatch(c(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(u){throw this.dispatch(a(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{project:e}},n)).flat();return this.dispatch(a(r)),r}}class jR extends k{constructor(){super(...arguments);m(this,"name","Asset Stage Completion");m(this,"url","/asset-stage-completions");m(this,"actions",{addOne:Dl,addMany:jl,setOne:$l,setMany:Cl,updateOne:Ul,updateMany:Ll,deleteOne:Nl,deleteMany:Gl,initialize:ql});m(this,"selectors",{selectById:Jl,selectByIds:Zl})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[e.asset,e.asset_stage],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Expected asset stage completion with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}bulkAdd(e){var T;const{store:n}=this.client,{addMany:a,setMany:c,deleteMany:r}=this.actions,d=new Date().toISOString(),l=((T=n.getState().userReducer.currentUser)==null?void 0:T.id)??null,u=e.map(P=>O(P)),p=u.map(P=>({...P,created_by:l,submitted_at:d})),y=p.map(({uuid:P})=>P);this.dispatch(a(p));const f=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:{submitted_at:d,completions:u},blockers:[...e.map(P=>P.asset_procedure),...e.map(P=>P.asset_stage),...e.map(P=>P.asset)],blocks:y});return f.then(P=>{this.dispatch(c(P))}).catch(()=>{this.dispatch(r(y))}),[p,f]}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,d=r(e)(n.getState());this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{asset_procedure__project:e}},n)).flat();return this.dispatch(a(r)),r}}class $R extends k{constructor(){super(...arguments);m(this,"name","Asset Stage");m(this,"url","/asset-stages");m(this,"actions",{addOne:tu,addMany:su,setOne:xl,setMany:eu,updateOne:iu,updateMany:nu,deleteOne:au,deleteMany:cu,initialize:Xl});m(this,"selectors",{selectById:du,selectByIds:lu})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[u.asset_procedure_type],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`No asset stage with uuid ${e.uuid} found in the store`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${r.uuid}/`,payload:e,blockers:[r.uuid],blocks:[r.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`No asset stage with uuid ${e} found in the store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{asset_procedure_type__organization:e}},n);return this.dispatch(a(c)),c}}class CR extends q{constructor(){super(...arguments);m(this,"name","Asset Type Attachment");m(this,"url","/asset-type-attachments");m(this,"actions",{addOne:hu,addMany:ai,setOne:pu,setMany:mu,updateOne:yu,updateMany:fu,deleteOne:Su,deleteMany:ci,initialize:ou});m(this,"selectors",{selectById:wu,selectByIds:Tu})}getId(e){return e.uuid}getBlockers(e){return[e.asset_type]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,asset_type:e.asset_type}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,asset_type:e.asset_type}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{asset_type__organization:e}},n);return this.dispatch(a(c)),c}}class UR extends q{constructor(){super(...arguments);m(this,"name","Asset Type Fields Attachment");m(this,"url","/asset-type-fields-attachments");m(this,"actions",{addOne:gu,addMany:Pu,setOne:bu,setMany:Ru,updateOne:Mu,updateMany:ku,deleteOne:Eu,deleteMany:vu,initialize:_u});m(this,"selectors",{selectById:Bu,selectByIds:Wu})}getId(e){return e.uuid}getBlockers(e){return[e.fields_revision]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{fields_revision__asset_type__organization:e}},n);return this.dispatch(a(c)),c}}class LR extends k{constructor(){super(...arguments);m(this,"name","Asset Type Fields");m(this,"url","/asset-type-fields");m(this,"actions",{addOne:ju,addMany:$u,setOne:Cu,setMany:Uu,updateOne:Lu,updateMany:Nu,deleteOne:Gu,deleteMany:Hu,initialize:Du});m(this,"selectors",{selectById:Yu,selectByIds:Ju})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[u.asset_type],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(f=>{throw this.dispatch(r(u.uuid)),f}),[u,p]}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{asset_type__organization:e}},n);return this.dispatch(a(c)),c}}class NR extends q{constructor(){super(...arguments);m(this,"name","Asset Type Field Values Attachment");m(this,"url","/asset-type-field-values-attachments");m(this,"actions",{addOne:xu,addMany:hi,setOne:eo,setMany:to,updateOne:so,updateMany:io,deleteOne:no,deleteMany:pi,initialize:Xu});m(this,"selectors",{selectById:co,selectByIds:ro})}getId(e){return e.uuid}getBlockers(e){return[e.field_values]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,d=n.getState(),l=r(e)(d);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{field_values__asset__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class GR extends k{constructor(){super(...arguments);m(this,"name","Asset Type Field Values");m(this,"url","/asset-type-field-values");m(this,"actions",{addOne:po,addMany:mo,setOne:yo,setMany:fo,updateOne:So,updateMany:Ao,deleteOne:wo,deleteMany:To,initialize:ho});m(this,"selectors",{selectById:Oo,selectByIds:Fo})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,u=new Date().toISOString(),p=O({...e,created_by:l,submitted_at:u}),y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(p),blockers:[e.asset,e.fields_revision],blocks:[p.uuid]});return this.dispatch(a(p)),y.then(T=>{this.dispatch(c(T))}).catch(()=>{this.dispatch(r(p.uuid))}),[p,y]}bulkAdd(e,n){var P;const{payloads:a,values:c}=e,{addMany:r,setMany:d,deleteMany:l}=this.actions,u=new Date().toISOString(),p=[],y=pt(a,Math.min(n??a.length,ut)),f=[];for(const E of y){const g=[];for(const M of E){const b=O({...M,values:M.values,created_by:((P=this.client.store.getState().userReducer.currentUser)==null?void 0:P.id)??null,submitted_at:u});p.push(b),g.push({uuid:b.uuid,asset:M.asset,fields_revision:M.fields_revision,published_at:M.published_at,values:b.values})}f.push({submitted_at:u,values:c,field_values:g})}this.dispatch(r(p));const T=[];for(const E of f){const{field_values:g}=E,M=g.map(({asset:W})=>W),b=g.map(({fields_revision:W})=>W),z=g.map(({uuid:W})=>W),j=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:E,blockers:M.concat(b),blocks:z});T.push(j)}return Promise.all(T).then(E=>{this.dispatch(d(E.flat()))}).catch(()=>{this.dispatch(l(V(p)))}),[p,T]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),d=c(e.uuid)(r);if(!d)throw new Error(`Expected AssetTypeFieldValues with uuid ${e.uuid} to exist`);const l={...d,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[l.uuid,l.fields_revision,l.asset],blocks:[l.uuid]});return u.then(p=>{this.dispatch(a(p))}).catch(()=>{this.dispatch(a(d))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected submission with uuid ${e} to exist`);const u=lo(e)(d);this.dispatch(a(e)),this.dispatch(pi(V(u)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(p){throw this.dispatch(c(l)),this.dispatch(hi(u)),p}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{asset__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class HR extends k{constructor(){super(...arguments);m(this,"name","Asset Type Identifier");m(this,"url","/asset-type-identifiers");m(this,"actions",{addOne:bo,addMany:Ro,setOne:Mo,setMany:ko,updateOne:Eo,updateMany:vo,deleteOne:Vo,deleteMany:Bo,initialize:Po});m(this,"selectors",{selectById:zo,selectByIds:qo})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[u.asset_type],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Expected asset type identifier with uuid ${e.uuid} to exist`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected asset type identifier with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{asset_type__organization:e}},n);return this.dispatch(a(c)),c}}class KR extends k{constructor(){super(...arguments);m(this,"name","Asset Type Identifier Value");m(this,"url","/asset-type-identifier-values");m(this,"actions",{addOne:Co,addMany:Uo,setOne:Lo,setMany:No,updateOne:Go,updateMany:Ho,deleteOne:Ko,deleteMany:Yo,initialize:$o});m(this,"selectors",{selectById:Zo,selectByIds:Qo})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[e.asset,e.asset_type_identifier],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}bulkAdd(e,n){var E;const{store:a}=this.client,{addMany:c,updateMany:r,deleteMany:d}=this.actions,l=new Date().toISOString(),u=((E=a.getState().userReducer.currentUser)==null?void 0:E.id)??null,p=pt(e,Math.min(n??e.length,ut)),y=[],f=[];for(const g of p){const M=[],b=[],z=[];for(const W of g){const D=O({...W,submitted_at:l,created_by:u});f.push(D);const v={uuid:D.uuid,asset:D.asset,asset_type_identifier:D.asset_type_identifier,value:D.value};M.push(v),b.push(D.asset),b.push(D.asset_type_identifier),z.push(D.uuid)}const j={payloads:M,submitted_at:l,blockers:b,blocks:z};y.push(j)}this.dispatch(c(f));const T=y.map(g=>{const{payloads:M,submitted_at:b,blockers:z,blocks:j}=g;return this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:{submitted_at:b,payloads:M},blockers:z,blocks:j})});Promise.all(T).then(g=>{this.dispatch(r(g.flat()))}).catch(g=>{throw this.dispatch(d(V(f))),g});const P=Promise.all(T).then(g=>g.flat());return[f,P]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected asset type identifier value with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{asset__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class YR extends k{constructor(){super(...arguments);m(this,"name","Asset Type");m(this,"url","/asset-types");m(this,"actions",{addOne:ih,addMany:nh,setOne:th,setMany:sh,updateOne:ah,updateMany:ch,deleteOne:rh,deleteMany:dh,initialize:eh});m(this,"selectors",{selectById:uh,selectByIds:oh})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Expected asset type with uuid ${e.uuid} to exist`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[r.uuid],blocks:[r.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected asset type with uuid ${e} to exist`);const u=vl(e)(d),p=Iu(e)(d);this.dispatch(a(e)),this.dispatch(xs(V(u))),this.dispatch(ci(V(p)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(y){throw this.dispatch(c(l)),this.dispatch(Xs(u)),this.dispatch(ai(p)),y}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class JR extends k{constructor(){super(...arguments);m(this,"name","Asset Type Status");m(this,"url","/asset-type-statuses");m(this,"actions",{addOne:yh,addMany:fh,setOne:Sh,setMany:Ah,updateOne:wh,updateMany:Th,deleteOne:Ih,deleteMany:Oh,initialize:mh});m(this,"selectors",{selectById:_h,selectByIds:gh})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[e.asset_type],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}update(e){const{setOne:n}=this.actions,{selectById:a}=this.selectors,c=this.client.store.getState(),r=a(e.uuid)(c);if(!r)throw new Error(`Expected an existing asset type status with uuid ${e.uuid}`);const d={...r,...e};this.dispatch(n(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(n(u))}).catch(()=>{this.dispatch(n(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`No asset type status with uuid ${e} found in the store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{asset_type__organization:e}},n);return this.dispatch(a(c)),c}}class ZR extends q{constructor(){super(...arguments);m(this,"name","Document Attachment");m(this,"url","/document-attachments");m(this,"actions",{addOne:vh,addMany:Vh,setOne:Bh,setMany:Wh,updateOne:zh,updateMany:qh,deleteOne:Dh,deleteMany:jh,initialize:Eh});m(this,"selectors",{selectById:Ch,selectByIds:Uh})}getId(e){return e.uuid}getBlockers(e){return[e.document]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,document:e.document}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,document:e.document}}async bulkAdd(e,n){const[a,c,r]=await super.bulkAdd(e,n),d={};for(const{file_sha1:l,uuid:u}of a)l in d||(d[l]=[]),d[l].push(u);return r.then(l=>{const u=l.flatMap(p=>d[p]??[]);for(const p of u)this.makeReadable(p)}),[a,c,r]}makeReadable(e){this.enqueueRequest({description:"Add attachment to AI assistant",method:h.PATCH,url:`${this.url}/${e}/`,payload:{readable_to_assistant:!0},blockers:["index-document-attachment",e],blocks:["index-document-attachment"]})}async refreshStore(e,n){const{initialize:a}=this.actions,c=this.list({queryParams:{document__project__organization:e}},n),r=this.list({queryParams:{document__organization:e}},n),l=(await Promise.all([c,r])).flat();return this.dispatch(a(l)),l}}class QR extends k{constructor(){super(...arguments);m(this,"name","Document");m(this,"url","/documents");m(this,"actions",{addOne:Hh,addMany:Kh,setOne:Yh,setMany:Jh,updateOne:Zh,updateMany:Qh,deleteOne:Xh,deleteMany:xh,initialize:Gh});m(this,"selectors",{selectById:tp,selectByIds:sp})}add(e){var y;const{store:n}=this.client,{addOne:a,deleteOne:c,updateOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:u.parent_document?[u.parent_document]:[],blocks:[u.uuid]});return p.then(f=>{this.dispatch(r(f))}).catch(()=>{this.dispatch(c(u.uuid))}),[u,p]}update(e){const{store:n}=this.client,{updateOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`attempting to update a document with uuid ${e.uuid} that does not exist in store.documents`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c,addMany:r,deleteMany:d}=this.actions,{selectById:l}=this.selectors,u=n.getState(),p=l(e)(u);if(!p)throw new Error(`attempting to delete a document with uuid ${e} that does not exist in store.documents`);const y=ip(e)(u);this.dispatch(a(e)),this.dispatch(d(V(y)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(f){throw this.dispatch(c(p)),this.dispatch(r(y)),f}}async refreshStore(e,n){const{initialize:a}=this.actions,c=this.list({queryParams:{project__organization:e}},n),r=this.list({queryParams:{organization:e}},n),l=(await Promise.all([c,r])).flat();return this.dispatch(a(l)),l}}class At extends St{async get(s,e){return this.performRequest({url:`${this.url}/${s}/`,method:h.GET},e)}async list(s,e){return this.performRequest({url:`${this.url}/`,method:h.GET,...s},e)}async listPaginated(s,e){return this.performPagination({url:`${this.url}/`,method:h.GET,...s},e)}}class XR extends At{constructor(){super(...arguments);m(this,"name","Email Domains");m(this,"url","/organization-email-domains");m(this,"actions",{addOne:cp,addMany:rp,setOne:dp,setMany:lp,updateOne:up,updateMany:op,deleteOne:hp,deleteMany:pp,initialize:ap});m(this,"selectors",{selectById:yp,selectByIds:fp})}async add(e,n){return this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:{email:n,organization:e},blockers:[e,"create-org"],blocks:[]})}async delete(e){const{deleteOne:n,addOne:a}=this.actions;this.dispatch(n(e.uuid));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e.uuid}/`,blockers:[e.domain],blocks:[]})}catch(c){throw this.dispatch(a(e)),c}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class xR extends St{async getVerificationCode(s){return this.enqueueRequest({description:"Get verification code",method:h.GET,url:`/verification/email-verification/${s}/`,isAuthNeeded:!1,blockers:[],blocks:[]})}validateVerificationCode(s,e=void 0){return this.enqueueRequest({description:"Validate verification code",method:h.POST,url:`/verification/email-verification/${s}/`,isAuthNeeded:!1,payload:e,blockers:[],blocks:[]})}}const Dt={},Ra=new Set;class eM extends St{constructor(){super(...arguments);m(this,"host");m(this,"dbPromise",Pg.openDB("fileCache",1,{upgrade(e){e.createObjectStore("files")}}))}async getDB(){return await this.dbPromise}async addCache(e){if(!e.name)throw new Error(`Cant add a file without a name to cache: ${e.name}`);if(!e.type)throw new Error(`Cant add a file without a type to cache: ${e.name}`);if(!e.size)throw new Error(`Cant add an empty file to cache: ${e.name}`);const n=await Ct(e);if(Ra.has(n))return;const a=await this.getDB();!!await a.get("files",n)?console.warn(`Attempting to add a file already cached, ${e.name}`):await a.put("files",e,n),Ra.add(n)}async removeCache(e){await(await this.getDB()).delete("files",e),Ra.delete(e)}async fetchCache(e){return(await this.getDB()).get("files",e)}async fetchFileFromUrl(e,n,a=n){const c=e.split("?")[0]??e,r=await this.fetchCache(n);if(r)return r;let d;c in Dt?d=Dt[c]:Ka(e)?(d=Ha(e,a),Dt[c]=d):(d=new Promise(p=>{this.performRequest({method:h.GET,url:e,isExternalUrl:!0,isResponseBlob:!0,isAuthNeeded:!1}).then(y=>{const f=new File([y],a,{type:y.type});p(f)})}),Dt[c]=d);let l;try{l=await d}catch(p){throw p instanceof C&&delete Dt[c],p}const u=await Ct(l);if(u!==n){const p=`The hash of the file returned from the server (${u}) does not match the
|
|
8
8
|
expected hash (${n}). This can happen if you're using a local development server and the
|
|
9
9
|
isExternalUrl flag in the request details is set to true, because instead of requesting the local
|
|
10
10
|
REST API, you will be requesting localhost:80 (where this app runs), resulting in a transformed blob
|
|
11
11
|
(with an uuid attached) being returned. Alternatively, you may be running with
|
|
12
12
|
import.meta.env.PROD, which will result in some file requests being treated as
|
|
13
|
-
external URLs and therefore not prepended with VITE_API_URL.`;throw new Error(p)}return await this.addCache(l),l}processPresignedUrl(e,n){if("warning"in n){if(n.warning==="already_uploaded")return Promise.resolve(void 0);throw console.error(n.warning),new Error(n.warning)}return this.enqueueRequest({url:n.url,description:"Upload file to S3",method:h.POST,isExternalUrl:!0,isAuthNeeded:!1,attachmentHash:e,blockers:[`s3-${n.fields.key}`],blocks:[e],s3url:n})}processPresignedUrls(e){const n={};for(const[a,c]of Object.entries(e))n[a]=this.processPresignedUrl(a,c);return n}async getFilePayload(e){const a={sha1:await Ct(e),file_type:e.type,extension:Na(e),size:e.size};return await this.client.files.addCache(e),a}}class tM extends M{constructor(){super(...arguments);m(this,"name","Form Identifier");m(this,"url","/form-identifiers");m(this,"actions",{addOne:Fp,addMany:_p,setOne:gp,setMany:Pp,updateOne:bp,updateMany:Rp,deleteOne:Mp,deleteMany:kp,initialize:Op});m(this,"selectors",{selectById:vp,selectByIds:Vp})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[u.form],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Expected form identifier with uuid ${e.uuid} to exist`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected form identifier with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{form__organization:e}},n);return this.dispatch(a(c)),c}}class sM extends M{constructor(){super(...arguments);m(this,"name","Form Identifier Value");m(this,"url","/form-identifier-values");m(this,"actions",{addOne:qp,addMany:Dp,setOne:jp,setMany:$p,updateOne:Cp,updateMany:Up,deleteOne:Lp,deleteMany:Np,initialize:zp});m(this,"selectors",{selectById:Hp,selectByIds:Kp})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[e.form_submission,e.form_identifier],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected form identifier value with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{form_submission__form_revision__form__organization:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class iM extends q{constructor(){super(...arguments);m(this,"name","Form Revision Attachment");m(this,"url","/form-revision-attachments");m(this,"actions",{addOne:Qp,addMany:Xp,setOne:xp,setMany:em,updateOne:tm,updateMany:sm,deleteOne:im,deleteMany:nm,initialize:Zp});m(this,"selectors",{selectById:cm,selectByIds:rm})}getId(e){return e.uuid}getBlockers(e){return[e.form_revision]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,form_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,form_revision:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,form_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,form_revision:c,file_sha1:r,file_name:d,file_extension:l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{form_revision__form__organization:e}},n);return this.dispatch(a(c)),c}}class nM extends M{constructor(){super(...arguments);m(this,"name","Form Revision");m(this,"url","/form-revisions");m(this,"actions",{addOne:Wi,addMany:zi,setOne:om,setMany:hm,updateOne:pm,updateMany:mm,deleteOne:qi,deleteMany:Di,initialize:um});m(this,"selectors",{selectById:ym,selectByIds:fm})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,u=new Date().toISOString(),p=O({...e,created_by:l,submitted_at:u});this.dispatch(a(p));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(p),blockers:[e.form],blocks:[p.uuid]});return y.then(T=>{this.dispatch(c(T))}).catch(()=>{this.dispatch(r(p.uuid))}),[p,y]}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{form__organization:e}},n);return this.dispatch(a(c)),c}}class aM extends M{constructor(){super(...arguments);m(this,"name","Form");m(this,"url","/forms");m(this,"actions",{addOne:Im,addMany:Om,setOne:Fm,setMany:_m,updateOne:gm,updateMany:Pm,deleteOne:bm,deleteMany:Rm,initialize:Tm});m(this,"selectors",{selectById:Em,selectByIds:vm})}add(e,n){var f;const{store:a}=this.client,{addOne:c,deleteOne:r}=this.actions,d=new Date().toISOString(),l=((f=a.getState().userReducer.currentUser)==null?void 0:f.id)??null,u=O({...e,submitted_at:d,created_by:l}),p=O({...n,form:u.uuid,submitted_at:d,created_by:l});this.dispatch(c(u)),this.dispatch(Wi(p));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:{...R(u),initial_revision:{uuid:p.uuid,submitted_at:p.submitted_at,title:p.title,description:p.description,fields:p.fields}},blockers:[],blocks:[u.uuid,p.uuid]});return y.catch(T=>{throw this.dispatch(r(u.uuid)),this.dispatch(qi(p.uuid)),T}),[u,p,y]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error("Expected form to exist");const u=sy(e)(d),p=Sm(e)(d);this.dispatch(a(e)),this.dispatch(Zi(V(u))),this.dispatch(Di(V(p)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(y){throw this.dispatch(c(l)),this.dispatch(zi(p)),this.dispatch(Ji(u)),y}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class cM extends q{constructor(){super(...arguments);m(this,"name","Form Submission Attachment");m(this,"url","/form-submission-attachments");m(this,"actions",{addOne:Wm,addMany:Li,setOne:zm,setMany:qm,updateOne:Dm,updateMany:jm,deleteOne:$m,deleteMany:Ni,initialize:Bm});m(this,"selectors",{selectById:Cm,selectByIds:Um})}getId(e){return e.uuid}getBlockers(e){return[e.form_submission]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,form_submission:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,form_submission:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,form_submission:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,form_submission:c,file_sha1:r,file_name:d,file_extension:l}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,r=n.getState(),d=Ki(e)(r);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{form_submission__form_revision__form__organization:e}},n)).flat();return this.dispatch(a(r)),r}}class rM extends M{constructor(){super(...arguments);m(this,"name","Form Submission");m(this,"url","/form-submissions");m(this,"actions",{addOne:Jm,addMany:Ji,setOne:Km,setMany:Ym,updateOne:Zm,updateMany:Qm,deleteOne:Xm,deleteMany:Zi,initialize:Hm});m(this,"selectors",{selectById:ey,selectByIds:ty})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,u=new Date().toISOString(),p=O({...e,created_by:l,submitted_at:u}),y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(p),blockers:[e.form_revision],blocks:[p.uuid]});return this.dispatch(a(p)),y.then(T=>{this.dispatch(c(T))}).catch(()=>{this.dispatch(r(p.uuid))}),[p,y]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),d=c(e.uuid)(r);if(!d)throw new Error(`Expected submission with uuid ${e.uuid} to exist`);const l={...d,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${l.uuid}/`,payload:e,blockers:[l.uuid],blocks:[l.uuid]});return u.then(p=>{this.dispatch(a(p))}).catch(()=>{this.dispatch(a(d))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected submission with uuid ${e} to exist`);const u=Lm(e)(d);this.dispatch(a(e)),this.dispatch(Ni(V(u)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(p){throw this.dispatch(c(l)),this.dispatch(Li(u)),p}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{limit:this.pageSize,paginate:!0,form_revision__form_organization:e}},n)).flat();return this.dispatch(a(r)),r}}class dM extends q{constructor(){super(...arguments);m(this,"name","Geo Image");m(this,"url","/geo-images");m(this,"actions",{addOne:dy,addMany:ly,setOne:cy,setMany:ry,updateOne:uy,updateMany:oy,deleteOne:hy,deleteMany:py,initialize:ay});m(this,"selectors",{selectById:yy,selectByIds:fy})}getId(e){return e.uuid}getBlockers(e){return[e.project]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_sha1:e.file_sha1,file_name:e.file_name,file_extension:e.file_extension,title:e.title,description:e.description,geo_marker:e.geo_marker,canvas_marker:e.canvas_marker,direction:e.direction,original_date:e.original_date,project:e.project}}buildBulkPayload(e){return{uuid:e.uuid,file_sha1:e.file_sha1,file_name:e.file_name,file_extension:e.file_extension,title:e.title,description:e.description,geo_marker:e.geo_marker,canvas_marker:e.canvas_marker,direction:e.direction,original_date:e.original_date,project:e.project}}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),d=c(e.uuid)(r);if(!d)throw new Error(`Geo image with uuid ${e.uuid} does not exist in the store`);const l={...d,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blocks:[e.uuid],blockers:[e.uuid]});return u.then(p=>{this.dispatch(a(p))}).catch(()=>{this.dispatch(a(d))}),[l,u]}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{project:e}},n);return this.dispatch(a(c)),c}}class lM extends M{constructor(){super(...arguments);m(this,"name","Issue Association");m(this,"url","/issue-associations");m(this,"actions",{addOne:_y,addMany:mt,setOne:Iy,setMany:Ty,updateOne:Oy,updateMany:Fy,deleteOne:gy,deleteMany:yt,initialize:wy});m(this,"selectors",{selectById:by,selectByIds:Ry})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=new Date().toISOString(),l=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,u=O({...e,submitted_at:d,created_by:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[e.associated_issue,...e.issue?[e.issue]:[],...e.asset?[e.asset]:[]],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Issue association with uuid ${e} not found in store.`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{associated_issue__project:e}},n)).flat();return this.dispatch(a(r)),r}}class uM extends q{constructor(){super(...arguments);m(this,"name","Issue Attachment");m(this,"url","/issue-attachments");m(this,"actions",{addOne:qy,addMany:sn,setOne:Dy,setMany:jy,updateOne:$y,updateMany:Cy,deleteOne:Uy,deleteMany:nn,initialize:zy});m(this,"selectors",{selectById:Gy,selectByIds:Hy})}getId(e){return e.uuid}getBlockers(e){return[e.issue]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,issue:e.issue}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,issue:e.issue}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{issue__project:e}},n)).flat();return this.dispatch(a(r)),r}}class oM extends q{constructor(){super(...arguments);m(this,"name","Issue Comment Attachment");m(this,"url","/issue-comment-attachments");m(this,"actions",{addOne:Zy,addMany:Qy,setOne:Xy,setMany:xy,updateOne:ef,updateMany:tf,deleteOne:sf,deleteMany:nf,initialize:Jy});m(this,"selectors",{selectById:cf,selectByIds:rf})}getId(e){return e.uuid}getBlockers(e){return[e.issue_comment]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,issue_comment:e.issue_comment}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,issue_comment:e.issue_comment}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{issue_comment__issue__project:e}},n)).flat();return this.dispatch(a(r)),r}}class hM extends M{constructor(){super(...arguments);m(this,"name","Issue Comment");m(this,"url","/issue-comments");m(this,"actions",{addOne:of,addMany:hf,setOne:pf,setMany:mf,updateOne:yf,updateMany:ff,deleteOne:Sf,deleteMany:Af,initialize:uf});m(this,"selectors",{selectById:wf,selectByIds:Tf})}add(e){const{store:n}=this.client,{addOne:a,updateOne:c,deleteOne:r}=this.actions,d=O({...e,author:n.getState().userReducer.currentUser.id,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[e.issue],blocks:[d.uuid]});return l.then(u=>{this.dispatch(c(u))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}update(e){const{store:n}=this.client,{updateOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Comment with uuid ${e.uuid} not found in store`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Comment with uuid ${e} not found in store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{setMany:a}=this.actions,r=(await this.listPaginated({queryParams:{issue__project:e}},n)).flat();return this.dispatch(a(r)),r}}class pM extends M{constructor(){super(...arguments);m(this,"name","Issue");m(this,"url","/issues");m(this,"actions",{addOne:_f,addMany:on,setOne:gf,setMany:Pf,updateOne:bf,updateMany:Rf,deleteOne:Mf,deleteMany:hn,initialize:Ff});m(this,"selectors",{selectById:Ef,selectByIds:vf})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=n.getState(),l=new Date().toISOString(),u=((f=d.userReducer.currentUser)==null?void 0:f.id)??null,p=O({...e,submitted_at:l,created_by:u});this.dispatch(a(p));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(p),blockers:[p.project,p.issue_type,p.status],blocks:[p.uuid]});return y.then(T=>{this.dispatch(c(T))}).catch(T=>{throw this.dispatch(r(p.uuid)),T}),[p,y]}update(e){var y;const{updateOne:n}=this.actions,{selectById:a}=this.selectors,c=this.client.store.getState(),r=a(e.uuid)(c);if(!r)throw new Error(`Attempting to update an issue with uuid ${e.uuid} that doesn't exist in the store`);const d={...r,...e};this.dispatch(n(d));const l={};for(const f of[$.TITLE,$.DESCRIPTION,$.STATUS,$.PRIORITY,$.ASSIGNED_TO,$.DUE_DATE])if(f in e&&e[f]!==r[f])switch(f){case $.PRIORITY:l[f]=e[f];break;case $.DUE_DATE:l[f]=e[f];break;case $.DESCRIPTION:l[f]=e[f];break;case $.TITLE:l[f]=e[f];break;case $.STATUS:{const T=e[f],P=kn(T)(c);if(!P)throw new Error(`Trying to update issue type status with ${T} which does not exist in store`);l[f]={name:P.name,color:P.color,uuid:P.uuid};break}case $.ASSIGNED_TO:{const T=e[f];if(T===null)l[f]=null;else{const P=cs(T)(c);if(!P)throw new Error(`Trying to update assigned to with ${T} which does not exist in store.`);l[f]={full_name:P.username,id:P.id}}break}}const u=O({created_by:((y=c.userReducer.currentUser)==null?void 0:y.id)??null,submitted_at:new Date().toISOString(),issue:r.uuid,changes:l});this.dispatch(vn(u));const p=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return p.then(f=>{this.dispatch(n(f))}).catch(()=>{this.dispatch(n(r)),this.dispatch(Bn(u.uuid))}),[d,p]}bulkUpdate(e,n){const{store:a}=this.client,{updateMany:c}=this.actions,{selectByIds:r}=this.selectors,d=V(e).toSorted(Ut);if(d.length!==e.length)throw new Error("payloads contains duplicate uuids.");const l=r(d)(a.getState()).toSorted(As);if(d.length!=l.length)throw new Error(`Attempting to bulk update ${d.length-l.length} issues that dont exist in the store`);const u=[];for(let T=0;T<d.length;T++)u.push({...l[T],...e[T]});this.dispatch(c(u));const p=pt(e,Math.min(n??e.length,ut)),y=[];let f=null;for(const T of p){const P=ot.v4(),E=V(T),g=T.map(({status:b})=>b).filter(Boolean),k=this.enqueueRequest({description:w(h.PATCH,this.name,!0),method:h.PATCH,url:`${this.url}/bulk/`,payload:{payloads:T},blockers:(f?[f]:[]).concat(E).concat(g),blocks:[P].concat(E)});y.push(k),f=P}return Promise.all(y).then(T=>{this.dispatch(c(T.flat()))}).catch(()=>{this.dispatch(c(l))}),[u,y]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`No issue with uuid ${e} found in the store`);const u=My(e)(d),p=vy(e)(d),y=Ny(e)(d),f=aw(e)(d);this.dispatch(a(e)),this.dispatch(nn(V(y))),this.dispatch(Wn(V(f))),this.dispatch(yt(V(u))),this.dispatch(yt(V(p)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(T){throw this.dispatch(c(l)),this.dispatch(sn(y)),this.dispatch(Vn(f)),this.dispatch(mt(u)),this.dispatch(mt(p)),T}}async bulkDelete(e){const{store:n}=this.client,{addMany:a,deleteMany:c}=this.actions,{selectByIds:r}=this.selectors,d=n.getState(),l=r(e)(d),u=ky(e)(d),p=Ey(e)(d);this.dispatch(c(e)),this.dispatch(yt(V(u))),this.dispatch(yt(V(p)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(y){throw this.dispatch(a(l)),this.dispatch(mt(u)),this.dispatch(mt(p)),y}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{project:e}},n)).flat();return this.dispatch(a(r)),r}}class mM extends q{constructor(){super(...arguments);m(this,"name","Issue Type Attachment");m(this,"url","/issue-type-attachments");m(this,"actions",{addOne:qf,addMany:Df,setOne:jf,setMany:$f,updateOne:Cf,updateMany:Uf,deleteOne:Lf,deleteMany:Nf,initialize:zf});m(this,"selectors",{selectById:Hf,selectByIds:Kf})}getId(e){return e.uuid}getBlockers(e){return[e.issue_type]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,issue_type:e.issue_type}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,issue_type:e.issue_type}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{issue_type__organization:e}},n);return this.dispatch(a(c)),c}}class yM extends q{constructor(){super(...arguments);m(this,"name","Issue Type Fields Attachment");m(this,"url","/issue-type-fields-attachments");m(this,"actions",{addOne:Qf,addMany:Xf,setOne:xf,setMany:eS,updateOne:tS,updateMany:sS,deleteOne:iS,deleteMany:nS,initialize:Zf});m(this,"selectors",{selectById:cS,selectByIds:rS})}getId(e){return e.uuid}getBlockers(e){return[e.fields_revision]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{fields_revision__issue_type__organization:e}},n);return this.dispatch(a(c)),c}}class fM extends M{constructor(){super(...arguments);m(this,"name","Issue Type Fields");m(this,"url","/issue-type-fields");m(this,"actions",{addOne:gS,addMany:PS,setOne:bS,setMany:RS,updateOne:MS,updateMany:kS,deleteOne:ES,deleteMany:vS,initialize:_S});m(this,"selectors",{selectById:BS,selectByIds:WS})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[u.issue_type],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(f=>{throw this.dispatch(r(u.uuid)),f}),[u,p]}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{issue_type__organization:e}},n);return this.dispatch(a(c)),c}}class SM extends q{constructor(){super(...arguments);m(this,"name","Issue Type Field Values Attachment");m(this,"url","/issue-type-field-values-attachments");m(this,"actions",{addOne:jS,addMany:Tn,setOne:$S,setMany:CS,updateOne:US,updateMany:LS,deleteOne:NS,deleteMany:In,initialize:DS});m(this,"selectors",{selectById:HS,selectByIds:KS})}getId(e){return e.uuid}getBlockers(e){return[e.field_values]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,d=n.getState(),l=r(e)(d);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{field_values__issue__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class AM extends M{constructor(){super(...arguments);m(this,"name","Issue Type Field Values");m(this,"url","/issue-type-field-values");m(this,"actions",{addOne:oS,addMany:hS,setOne:pS,setMany:mS,updateOne:yS,updateMany:fS,deleteOne:SS,deleteMany:AS,initialize:uS});m(this,"selectors",{selectById:TS,selectByIds:IS})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,u=new Date().toISOString(),p=O({...e,created_by:l,submitted_at:u}),y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(p),blockers:[e.issue,e.fields_revision],blocks:[p.uuid]});return this.dispatch(a(p)),y.then(T=>{this.dispatch(c(T))}).catch(()=>{this.dispatch(r(p.uuid))}),[p,y]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),d=c(e.uuid)(r);if(!d)throw new Error(`Expected IssueTypeFieldValues with uuid ${e.uuid} to exist`);const l={...d,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[l.uuid,l.fields_revision,l.issue],blocks:[l.uuid]});return u.then(p=>{this.dispatch(a(p))}).catch(()=>{this.dispatch(a(d))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected submission with uuid ${e} to exist`);const u=YS(e)(d);this.dispatch(a(e)),this.dispatch(In(V(u)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(p){throw this.dispatch(c(l)),this.dispatch(Tn(u)),p}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{issue__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class wM extends M{constructor(){super(...arguments);m(this,"name","Issue Type Identifier");m(this,"url","/issue-type-identifiers");m(this,"actions",{addOne:XS,addMany:xS,setOne:eA,setMany:tA,updateOne:sA,updateMany:iA,deleteOne:nA,deleteMany:aA,initialize:QS});m(this,"selectors",{selectById:rA,selectByIds:dA})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[u.issue_type],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Expected issue type identifier with uuid ${e.uuid} to exist`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected issue type identifier with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{issue_type__organization:e}},n);return this.dispatch(a(c)),c}}class TM extends M{constructor(){super(...arguments);m(this,"name","Issue Type Identifier Value");m(this,"url","/issue-type-identifier-values");m(this,"actions",{addOne:hA,addMany:pA,setOne:mA,setMany:yA,updateOne:fA,updateMany:SA,deleteOne:AA,deleteMany:wA,initialize:oA});m(this,"selectors",{selectById:IA,selectByIds:OA})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[e.issue,e.issue_type_identifier],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected issue type identifier value with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{issue__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class IM extends M{constructor(){super(...arguments);m(this,"name","Issue Type");m(this,"url","/issue-types");m(this,"actions",{addOne:PA,addMany:bA,setOne:RA,setMany:MA,updateOne:kA,updateMany:EA,deleteOne:vA,deleteMany:VA,initialize:gA});m(this,"selectors",{selectById:WA,selectByIds:zA})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,u=new Date().toISOString(),p=O({...e,submitted_at:u,created_by:l});this.dispatch(a(p));const y=this.enqueueRequest({method:h.POST,url:`${this.url}/`,payload:R(p),blockers:[],blocks:[p.uuid]});return y.then(T=>{this.dispatch(c(T))}).catch(()=>{this.dispatch(r(p.uuid))}),[p,y]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),d=c(e.uuid)(r);if(!d)throw new Error(`IssueType with uuid ${e.uuid} does not exist in the store.`);const l={...d,...e};this.dispatch(a(l));const u=this.enqueueRequest({method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.then(p=>{this.dispatch(a(p))}).catch(()=>{this.dispatch(a(d))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,setOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`IssueType with uuid ${e} does not exist in the store.`);const u=Vf(e)(d);this.dispatch(a(e)),this.dispatch(hn(V(u)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(p){throw this.dispatch(c(l)),this.dispatch(on(u)),p}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class OM extends M{constructor(){super(...arguments);m(this,"name","Issue Type Status");m(this,"url","/issue-type-statuses");m(this,"actions",{addOne:$A,addMany:CA,setOne:UA,setMany:LA,updateOne:NA,updateMany:GA,deleteOne:HA,deleteMany:KA,initialize:jA});m(this,"selectors",{selectById:kn,selectByIds:JA})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[e.issue_type],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}update(e){const{setOne:n}=this.actions,{selectById:a}=this.selectors,c=this.client.store.getState(),r=a(e.uuid)(c);if(!r)throw new Error(`Expected an existing issue type status with uuid ${e.uuid}`);const d={...r,...e};this.dispatch(n(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(n(u))}).catch(()=>{this.dispatch(n(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`No issue type status with uuid ${e} found in the store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{issue_type__organization:e}},n);return this.dispatch(a(c)),c}}class FM extends M{constructor(){super(...arguments);m(this,"name","Issue Update");m(this,"url","/issue-updates");m(this,"actions",{addOne:vn,addMany:Vn,setOne:xA,setMany:ew,updateOne:tw,updateMany:sw,deleteOne:Bn,deleteMany:Wn,initialize:XA});m(this,"selectors",{selectById:iw,selectByIds:nw})}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{issue__project:e}},n)).flat();return this.dispatch(a(r)),r}}const _M=1800;function gM(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 PM extends FR{constructor(){super(...arguments);m(this,"_getRenewedTokens",async e=>{const n=this.performRequest({method:h.POST,url:this.refreshTokensUrl,payload:{refresh:e},isAuthNeeded:!1,checkAuth:!1});let a;try{a=await n}catch(c){console.error("Could not renew tokens; clearing auth",c),this.clearAuth();return}if(!a.access)throw new Error("Missing access token");return{accessToken:a.access,refreshToken:a.refresh??this.getRefreshToken()}})}clearAuth(){console.debug(this.constructor.name,"clearing auth;"),this.dispatch(Rh(!1)),this.clearTokens(),this.dispatch(I()),this.dispatch(I())}async renewTokens(){const e=this.getRefreshToken();if(!e)throw new Error("No refresh token found");console.debug(this.constructor.name,"renewing tokens");try{const n=await this._getRenewedTokens(e);if(!n)return;console.debug("Got renewed tokens"),this.setTokens(n)}catch(n){throw console.error("Could not renew tokens; clearing auth",n),this.clearAuth(),n}}tokenIsExpiringSoon(){const e=this.getAccessToken();if(!e)return!1;const n=Date.now()/1e3;let a;try{a=bg(e).exp??n}catch{a=n}return a-n<_M}getAuthHeader(){return`Bearer ${this.getAccessToken()}`}async prepareAuth(){if(this.tokenIsExpiringSoon()){console.debug(this.constructor.name,"preparing auth");try{await this.renewTokens()}catch(e){return e instanceof C&&this.clearAuth(),e instanceof Error?Promise.reject(e):Promise.reject(new Error((e??It).toString()))}}}async handleUnauthorized(e,n){const a=this.client.store.getState();if(e.url.endsWith("/token/refresh/"))throw a.authReducer.isLoggedIn&&console.warn("No signed-in user to sign out."),this.clearAuth(),new C({message:"You have been signed out due to inactivity.",response:n,discard:!0});if(a.authReducer.isLoggedIn)await this.renewTokens();else throw console.debug("Forbidden; user is not logged in."),new C({message:"Incorrect username or password.",response:n,discard:!0})}async initAuth(e){const n=ot.v4();return console.debug(this.constructor.name,"Initiating auth"),this.performRequest({uuid:n,method:h.POST,url:this.initTokensUrl,payload:e,isAuthNeeded:!1,checkAuth:!1}).then(a=>{this.setTokens(gM(a))})}}class bM extends Ot{constructor(){super(...arguments);m(this,"name","Organization Access");m(this,"url","/organization-accesses");m(this,"actions",{addOne:Tw,addMany:Iw,setOne:Ow,setMany:Fw,updateOne:_w,updateMany:gw,deleteOne:Pw,deleteMany:bw,initialize:ww});m(this,"selectors",{selectById:Mw,selectByIds:kw})}update(e){const{store:n}=this.client,{updateOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState()),d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(u=>{throw this.dispatch(a(r)),u}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d),u=cs(l.user)(d);this.dispatch(a(l.uuid)),this.dispatch($n(l.user));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${l.uuid}/`,blockers:[l.uuid],blocks:[]})}catch(p){throw this.dispatch(c(l)),this.dispatch(jn(u)),p}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class RM extends Ot{constructor(){super(...arguments);m(this,"name","Organization");m(this,"url","/organizations");m(this,"actions",{addOne:qw,addMany:zw,setOne:Ww,setMany:Bw,updateOne:jw,updateMany:Dw,deleteOne:$w,deleteMany:Cw,initialize:Vw});m(this,"selectors",{selectById:Nw,selectByIds:Gw})}async add(e){const{addOne:n}=this.actions,a=await this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:e,blockers:[],blocks:[]});return this.dispatch(n(a)),a}async update(e){const{setOne:n}=this.actions,a=await this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return this.dispatch(n(a)),a}async invite(e,n){return this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/${e}/invite/${n}/`,blockers:[],blocks:[]})}async refreshStore(e){const{initialize:n}=this.actions,a=await this.list({},e);return this.dispatch(n(a)),a}}class MM extends M{constructor(){super(...arguments);m(this,"name","Project Access");m(this,"url","/project-accesses");m(this,"actions",{addOne:tT,addMany:sT,setOne:iT,setMany:nT,updateOne:aT,updateMany:cT,deleteOne:rT,deleteMany:dT,initialize:eT});m(this,"selectors",{selectById:uT,selectByIds:oT})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.organization_access,d.project],blocks:[d.uuid]});return l.then(p=>{this.dispatch(c(p))}).catch(p=>{throw this.dispatch(r(d.uuid)),p}),[d,l]}bulkAdd(e){var p;const{store:n}=this.client,{addMany:a,deleteMany:c,updateMany:r}=this.actions,d=((p=n.getState().userReducer.currentUser)==null?void 0:p.id)??null,l=e.map(y=>O({...y,created_by:d}));this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:{project_accesses:l.map(y=>R(y))},blockers:l.flatMap(y=>[y.project,y.organization_access]),blocks:l.map(y=>y.uuid)});return u.then(y=>{this.dispatch(r(y))}).catch(y=>{throw this.dispatch(c(l.map(f=>f.uuid))),y}),[l,u]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState()),d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[]});return l.then(u=>{this.dispatch(a(u))}).catch(u=>{throw this.dispatch(a(r)),u}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{project__organization:e}},n);return this.dispatch(a(c)),c}}class kM extends q{constructor(){super(...arguments);m(this,"name","Project Attachment");m(this,"url","/project-attachments");m(this,"actions",{addOne:mT,addMany:yT,setOne:fT,setMany:ST,updateOne:AT,updateMany:wT,deleteOne:TT,deleteMany:IT,initialize:pT});m(this,"selectors",{selectById:FT,selectByIds:_T})}getId(e){return e.uuid}getBlockers(e){return[e.project]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,project:e.project}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,project:e.project}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{project__organization:e}},n);return this.dispatch(a(c)),c}}class EM extends q{constructor(){super(...arguments);m(this,"name","Project File");m(this,"url","/project-files");m(this,"actions",{addOne:kT,addMany:ET,setOne:RT,setMany:MT,updateOne:vT,updateMany:VT,deleteOne:BT,deleteMany:WT,initialize:bT});m(this,"selectors",{selectById:DT,selectByIds:jT})}getId(e){return e.uuid}getBlockers(e){return[e.project]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_sha1:e.file_sha1,file_name:e.file_name,file_extension:e.file_extension,project:e.project,z_index:e.z_index,canvas_bounds:e.canvas_bounds,bounds:e.bounds}}buildBulkPayload(e){return{uuid:e.uuid,file_sha1:e.file_sha1,file_name:e.file_name,file_extension:e.file_extension,project:e.project,z_index:e.z_index,canvas_bounds:e.canvas_bounds,bounds:e.bounds}}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),d=c(e.uuid)(r);if(!d)throw new Error(`${this.name} with uuid ${e.uuid} does not exist in the store`);const l={...d,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blocks:[e.uuid],blockers:[e.uuid]});return u.then(p=>{this.dispatch(a(p))}).catch(()=>{this.dispatch(a(d))}),[l,u]}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{project:e}},n)).flat();return this.dispatch(a(r)),r}}class vM extends Ot{constructor(){super(...arguments);m(this,"name","Project");m(this,"url","/projects");m(this,"actions",{addOne:HT,addMany:GT,setOne:NT,setMany:LT,updateOne:YT,updateMany:KT,deleteOne:JT,deleteMany:ZT,initialize:UT});m(this,"selectors",{selectById:xT,selectByIds:eI})}async add(e){const{addOne:n}=this.actions,a=await this.performRequest({method:h.POST,url:`${this.url}/`,payload:R(e)});return this.dispatch(n(a)),a}async update(e){const{updateOne:n}=this.actions,a=await this.performRequest({method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:R(e)});return this.dispatch(n(a)),a}async delete(e){const{deleteOne:n}=this.actions,a=await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]});return this.dispatch(n(e)),a}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class VM extends M{constructor(){super(...arguments);m(this,"name","Team Membership");m(this,"url","/team-memberships");m(this,"actions",{addOne:nI,addMany:aI,setOne:cI,setMany:rI,updateOne:dI,updateMany:lI,deleteOne:uI,deleteMany:oI,initialize:iI});m(this,"selectors",{selectById:mI,selectByIds:yI})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[e.team],blocks:[d.uuid]});return l.then(p=>{this.dispatch(c(p))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}bulkAdd(e){var p;const{store:n}=this.client,{addMany:a,setMany:c,deleteMany:r}=this.actions,d=((p=n.getState().userReducer.currentUser)==null?void 0:p.id)??null,l=e.map(y=>O({...y,created_by:d}));this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:{team_memberships:l.map(y=>R(y))},blockers:l.map(y=>y.team),blocks:l.map(y=>y.uuid)});return u.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(l.map(y=>y.uuid)))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,setOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected team membership with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{team__organization:e}},n);return this.dispatch(a(c)),c}}class BM extends M{constructor(){super(...arguments);m(this,"name","Team");m(this,"url","/teams");m(this,"actions",{addOne:AI,addMany:wI,setOne:TI,setMany:II,updateOne:OI,updateMany:FI,deleteOne:_I,deleteMany:gI,initialize:SI});m(this,"selectors",{selectById:bI,selectByIds:RI})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...e,submitted_at:new Date().toISOString(),created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[],blocks:[d.uuid]});return l.then(p=>{this.dispatch(c(p))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Expected team with uuid ${e.uuid} to exist`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:R(e),blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,setOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected team with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class WM extends Ot{constructor(){super(...arguments);m(this,"name","User");m(this,"url","/user");m(this,"actions",{addOne:jn,addMany:ow,setOne:uw,setMany:lw,updateOne:pw,updateMany:hw,deleteOne:$n,deleteMany:mw,initialize:dw});m(this,"selectors",{selectById:cs,selectByIds:Sw})}async list(e,n){const{organizationUuid:a,...c}=e,r=a?`/organizations/${a}${this.url}s/`:`/${this.url}`;return this.performRequest({method:h.GET,url:r,...c},n)}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({organizationUuid:e},n);return this.dispatch(a(c)),c}}class zM extends M{constructor(){super(...arguments);m(this,"name","Workflow");m(this,"url","/workflows");m(this,"actions",{addOne:BI,addMany:WI,setOne:zI,setMany:qI,updateOne:DI,updateMany:jI,deleteOne:$I,deleteMany:CI,initialize:VI});m(this,"selectors",{selectById:LI,selectByIds:NI})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.workflow_type,d.project],blocks:[d.uuid]});return l.then(p=>{this.dispatch(c(p))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}update(e){const{store:n}=this.client,{updateOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Expected workflow with uuid ${e.uuid} to exist`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[r.uuid,d.workflow_type,d.project],blocks:[r.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Expected workflow with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{project:e}},n)).flat();return this.dispatch(a(r)),r}}class qM extends M{constructor(){super(...arguments);m(this,"name","Workflow Step Assignee");m(this,"url","/workflow-step-assignees");m(this,"actions",{addOne:YI,addMany:JI,setOne:ZI,setMany:QI,updateOne:XI,updateMany:xI,deleteOne:eO,deleteMany:tO,initialize:KI});m(this,"selectors",{selectById:iO,selectByIds:nO})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.workflow,d.workflow_step],blocks:[d.uuid]});return l.then(p=>{this.dispatch(c(p))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}bulkAdd(e){var y;const{store:n}=this.client,{addMany:a,setMany:c,deleteMany:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=e.map(f=>O({...f,created_by:d,submitted_at:l}));this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:{workflow_step_assignees:u.map(f=>R(f)),submitted_at:l},blockers:u.flatMap(f=>[f.workflow,f.workflow_step]),blocks:u.map(f=>f.uuid)});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(V(u)))}),[u,p]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Expected workflow step assignee with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,d=r(e)(n.getState());this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{workflow__project:e}},n)).flat();return this.dispatch(a(r)),r}}class DM extends M{constructor(){super(...arguments);m(this,"name","Workflow Step Comment");m(this,"url","/workflow-step-comments");m(this,"actions",{addOne:dO,addMany:lO,setOne:uO,setMany:oO,updateOne:hO,updateMany:pO,deleteOne:mO,deleteMany:yO,initialize:rO});m(this,"selectors",{selectById:SO,selectByIds:AO})}add(e){var u;const{store:n}=this.client,{addOne:a,updateOne:c,deleteOne:r}=this.actions,d=O({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.workflow,d.workflow_step],blocks:[d.uuid]});return l.then(p=>{this.dispatch(c(p))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}update(e){const{store:n}=this.client,{updateOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Workflow step comment with uuid ${e.uuid} not found in store`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Workflow step comment with uuid ${e} not found in store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{workflow__project:e}},n)).flat();return this.dispatch(a(r)),r}}class jM extends M{constructor(){super(...arguments);m(this,"name","Workflow Step Event");m(this,"url","/workflow-step-events");m(this,"actions",{addOne:OO,addMany:FO,setOne:_O,setMany:gO,updateOne:PO,updateMany:bO,deleteOne:RO,deleteMany:MO,initialize:IO});m(this,"selectors",{selectById:EO,selectByIds:vO})}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{workflow__project:e}},n)).flat();return this.dispatch(a(r)),r}}class $M extends q{constructor(){super(...arguments);m(this,"name","Workflow Step Fields Attachment");m(this,"url","/workflow-step-fields-attachments");m(this,"actions",{addOne:zO,addMany:ca,setOne:qO,setMany:DO,updateOne:jO,updateMany:$O,deleteOne:CO,deleteMany:ra,initialize:WO});m(this,"selectors",{selectById:NO,selectByIds:GO})}getId(e){return e.uuid}getBlockers(e){return[e.fields_revision]}getBlocks(e){return[e.uuid]}buildModel(e){var a;const{store:n}=this.client;return O({...e,created_by:((a=n.getState().userReducer.currentUser)==null?void 0:a.id)??null,submitted_at:new Date().toISOString()})}buildPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{fields_revision__workflow_step__workflow_type__organization:e}},n);return this.dispatch(a(c)),c}}class CM extends M{constructor(){super(...arguments);m(this,"name","Workflow Step Fields");m(this,"url","/workflow-step-fields");m(this,"actions",{addOne:JO,addMany:ZO,setOne:QO,setMany:XO,updateOne:xO,updateMany:eF,deleteOne:tF,deleteMany:sF,initialize:YO});m(this,"selectors",{selectById:nF,selectByIds:aF})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.workflow_step],blocks:[d.uuid]});return l.then(p=>{this.dispatch(c(p))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected workflow step fields with uuid ${e} to exist`);const u=LO(e)(d);this.dispatch(a(e)),this.dispatch(ra(V(u)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(p){throw this.dispatch(c(l)),this.dispatch(ca(u)),p}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{workflow_step__workflow_type__organization:e}},n);return this.dispatch(a(c)),c}}class UM extends q{constructor(){super(...arguments);m(this,"name","Workflow Step Field Values Attachment");m(this,"url","/workflow-step-field-values-attachments");m(this,"actions",{addOne:lF,addMany:oa,setOne:uF,setMany:oF,updateOne:hF,updateMany:pF,deleteOne:mF,deleteMany:ha,initialize:dF});m(this,"selectors",{selectById:fF,selectByIds:SF})}getId(e){return e.uuid}getBlockers(e){return[e.field_values]}getBlocks(e){return[e.uuid]}buildModel(e){var a;const{store:n}=this.client;return O({...e,created_by:((a=n.getState().userReducer.currentUser)==null?void 0:a.id)??null,submitted_at:new Date().toISOString()})}buildPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,d=r(e)(n.getState());this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{field_values__workflow__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class LM extends M{constructor(){super(...arguments);m(this,"name","Workflow Step Field Values Review Request");m(this,"url","/workflow-step-field-values-review-requests");m(this,"actions",{addOne:zF,addMany:fa,setOne:qF,setMany:DF,updateOne:jF,updateMany:$F,deleteOne:CF,deleteMany:Sa,initialize:WF});m(this,"selectors",{selectById:LF,selectByIds:NF})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.field_values],blocks:[d.uuid]});return l.then(p=>{this.dispatch(c(p))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Workflow step field values review request with uuid ${e} not found in store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{field_values__workflow__project:e}},n)).flat();return this.dispatch(a(r)),r}}class NM extends M{constructor(){super(...arguments);m(this,"name","Workflow Step Field Values Review");m(this,"url","/workflow-step-field-values-reviews");m(this,"actions",{addOne:JF,addMany:wa,setOne:ZF,setMany:QF,updateOne:XF,updateMany:xF,deleteOne:e_,deleteMany:Ta,initialize:YF});m(this,"selectors",{selectById:s_,selectByIds:i_})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.field_values],blocks:[d.uuid]});return l.then(p=>{this.dispatch(c(p))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Workflow step field values review with uuid ${e.uuid} not found in store`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Workflow step field values review with uuid ${e} not found in store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{field_values__workflow__project:e}},n)).flat();return this.dispatch(a(r)),r}}class GM extends M{constructor(){super(...arguments);m(this,"name","Workflow Step Field Values");m(this,"url","/workflow-step-field-values");m(this,"actions",{addOne:OF,addMany:FF,setOne:_F,setMany:gF,updateOne:PF,updateMany:bF,deleteOne:RF,deleteMany:MF,initialize:IF});m(this,"selectors",{selectById:EF,selectByIds:vF})}add(e){var p;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=n.getState(),l=O({...e,created_by:((p=d.userReducer.currentUser)==null?void 0:p.id)??null,submitted_at:new Date().toISOString()}),u=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(l),blockers:[e.workflow,e.workflow_step,e.fields_revision],blocks:[l.uuid]});return this.dispatch(a(l)),u.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(l.uuid))}),[l,u]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),d=c(e.uuid)(r);if(!d)throw new Error(`Expected WorkflowStepFieldValues with uuid ${e.uuid} to exist`);const l={...d,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[l.uuid,l.workflow,l.workflow_step,l.fields_revision],blocks:[l.uuid]});return u.then(p=>{this.dispatch(a(p))}).catch(()=>{this.dispatch(a(d))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected WorkflowStepFieldValues with uuid ${e} to exist`);const u=AF(e)(d),p=n_(e)(d),y=GF(e)(d);this.dispatch(a(e)),this.dispatch(ha(V(u))),this.dispatch(Ta(V(p))),this.dispatch(Sa(V(y)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(f){throw this.dispatch(c(l)),this.dispatch(oa(u)),this.dispatch(wa(p)),this.dispatch(fa(y)),f}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{workflow__project:e}},n)).flat();return this.dispatch(a(r)),r}}class HM extends M{constructor(){super(...arguments);m(this,"name","Workflow Step Reviewer");m(this,"url","/workflow-step-reviewers");m(this,"actions",{addOne:d_,addMany:l_,setOne:u_,setMany:o_,updateOne:h_,updateMany:p_,deleteOne:m_,deleteMany:y_,initialize:r_});m(this,"selectors",{selectById:S_,selectByIds:A_})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.workflow,d.workflow_step],blocks:[d.uuid]});return l.then(p=>{this.dispatch(c(p))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}bulkAdd(e){var y;const{store:n}=this.client,{addMany:a,setMany:c,deleteMany:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=e.map(f=>O({...f,created_by:d,submitted_at:l}));this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:{workflow_step_reviewers:u.map(f=>R(f)),submitted_at:l},blockers:u.flatMap(f=>[f.workflow,f.workflow_step]),blocks:u.map(f=>f.uuid)});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.map(f=>f.uuid)))}),[u,p]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Expected workflow step reviewer with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,d=r(e)(n.getState());this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{workflow__project:e}},n)).flat();return this.dispatch(a(r)),r}}class KM extends M{constructor(){super(...arguments);m(this,"name","Workflow Step");m(this,"url","/workflow-steps");m(this,"actions",{addOne:O_,addMany:F_,setOne:__,setMany:g_,updateOne:P_,updateMany:b_,deleteOne:R_,deleteMany:M_,initialize:I_});m(this,"selectors",{selectById:E_,selectByIds:v_})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.workflow_type],blocks:[d.uuid]});return l.then(p=>{this.dispatch(c(p))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Expected workflow step with uuid ${e.uuid} to exist`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[r.uuid,d.workflow_type],blocks:[r.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Expected workflow step with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{workflow_type__organization:e}},n);return this.dispatch(a(c)),c}}class YM extends M{constructor(){super(...arguments);m(this,"name","Workflow Type");m(this,"url","/workflow-types");m(this,"actions",{addOne:z_,addMany:q_,setOne:D_,setMany:j_,updateOne:$_,updateMany:C_,deleteOne:U_,deleteMany:L_,initialize:W_});m(this,"selectors",{selectById:G_,selectByIds:H_})}add(e){var p;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=n.getState(),l=O({...e,created_by:((p=d.userReducer.currentUser)==null?void 0:p.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(l),blockers:[],blocks:[l.uuid]});return u.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(l.uuid))}),[l,u]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Expected workflow type with uuid ${e.uuid} to exist`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[r.uuid],blocks:[r.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Expected workflow type with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}async function Ma(t,s,e,n,a){const c=n instanceof St;c&&s.checkAuth!==!1&&await n.auth.prepareAuth();const r={queryParams:"",isAuthNeeded:!0},{s3url:d,payload:l,headers:u,method:p,queryParams:y,attachmentHash:f,isExternalUrl:T,isAuthNeeded:P,isResponseBlob:E}={...r,...s};let g=s.url;const k=f?await e.files.fetchCache(f):void 0;if(f&&!k)throw new Error(`Cannot upload file ${f} because it's not cached.`);!T&&!g.startsWith("http")&&(!g.startsWith("/")&&!g.startsWith("blob:")&&(g="/"+g),g=t+g);const b=v=>{if(f){if(!d)throw new Error(`No S3 URL for file ${f}`);if("warning"in d)throw new Error(`S3 URL warning for file ${f}`);if(!k)throw new Error(`No file for file ${f}`);const L=d.fields["x-amz-checksum-sha1"];if(!L)throw new Error(`No checksum for file ${f}`);return v.set("x-amz-checksum-sha1",L).field({...l,...d.fields}).attach("file",k)}return v.send(l)},j={[h.GET]:()=>E?wt.get(g.toString()).responseType("blob"):wt.get(g.toString()),[h.POST]:()=>{const v=wt.post(g.toString());return b(v)},[h.PATCH]:()=>{const v=wt.patch(g.toString());return b(v)},[h.PUT]:()=>{const v=wt.put(g.toString());return b(v)},[h.DELETE]:()=>{const v=wt.delete(g.toString());return b(v)}}[p];let W=j();const D=()=>{console.debug("aborting request:",s.url),W.abort()};if(a==null||a.addEventListener("abort",D),P&&c){const v=n.auth.getAuthHeader();W=W.set("Authorization",v)}u&&(W=W.set(u));try{return await W.query(y)}catch(v){const L=dg(v),hs=L==null?void 0:L.status;if(c&&hs===401)return await n.auth.handleUnauthorized(W,L),W.query(y);throw new C({response:L,innerError:v,discard:ba.includes(hs)})}finally{a==null||a.removeEventListener("abort",D)}}class JM{constructor(s){m(this,"store");this.store=s}_performRequest(s,e,n,a){const c=new ms,r={...e,uuid:e.uuid??ot.v4()};return Ma(s,r,this,n,a).then(d=>{c.resolve(d.body)}).catch(d=>{d instanceof Error?c.reject(d):c.reject(new Error((d??It).toString()))}),c}async performRequest(s,e,n,a){return this._performRequest(s,e,n,a).then(c=>{if(c instanceof C)throw c;return c})}async enqueueRequest(s,e,n){return this._enqueueRequest(s,e,n).then(a=>{if(a instanceof C)throw a;return a})}_enqueueRequest(s,e,n){const a=new ms,c={...s,BASE_URL:e,serviceName:n},r=this.store.dispatch(Jw(c)),d=u=>{if(u)a.resolve(u.body);else{const p=new C({message:"Could not get a response from the server.",response:u,discard:!0});a.reject(p)}},l=u=>{u instanceof C?u.options.discard=!0:(console.error("Received an unexpected error while processing a request:",u,`
|
|
14
|
-
Converting error to APIError and discarding.`),u=new C({message:"An error occurred while processing the request.",innerError:u,discard:!0})),a.reject(u)};return r.then(d,l),a}async performPagination(s,e,n,a,c){const r={...e,queryParams:{...e.queryParams,paginate:!0,limit:n}},{method:d}=r,l=[];let u=await this.performRequest(s,r,a,c);for(l.push(u.results);u.next;)u=await this.performRequest(s,{url:u.next,method:d},a,c),l.push(u.results);return l}}class Ft{constructor(){m(this,"graph");m(this,"requestAttemptCounter");this.graph=new Rg.DepGraph,this.requestAttemptCounter={}}static _fromOutbox(s){const e=new Ft;for(let n=0;n<s.length;n++){const a=s[n];if(!a){console.error("Outbox item was undefined");continue}e.sneakRequest(a);for(let c=0;c<n;c++){const r=s[c];if(!r){console.error("Previous outbox item was undefined");continue}r.payload.uuid!==a.payload.uuid&&r.payload.blocks.some(d=>a.payload.blockers.includes(d))&&Ft._addDependency(a.payload.uuid,r.payload.uuid,e.graph)}}return e}_addDependency(s,e){Ft._addDependency(s,e,this.graph)}static _addDependency(s,e,n){if(s===e)throw new Error(`Tried to add dependency from node to itself: ${s}`);if(!n.hasNode(s))throw new Error(`Tried to add dependency from non-existent node: ${s} (to node: ${e})`);if(!n.hasNode(e))throw new Error(`Tried to add dependency to non-existent node: ${e} (from node: ${s})`);n.addDependency(s,e)}addRequest(s){if(this.graph.addNode(s.payload.uuid,s),!(s.payload.blockers.length===0||this.graph.size()===1))for(const e of this.graph.overallOrder()){if(e===s.payload.uuid)continue;const n=this.graph.getNodeData(e),a=new Set(n.payload.blocks);s.payload.blockers.some(c=>a.has(c))&&this._addDependency(s.payload.uuid,e)}}insertRequest(s){this.graph.addNode(s.payload.uuid,s);for(const e of this.graph.overallOrder()){if(e===s.payload.uuid)continue;const n=this.graph.getNodeData(e),a=new Set(s.payload.blocks);n.payload.blockers.some(c=>a.has(c))&&this._addDependency(e,s.payload.uuid)}}sneakRequest(s){this.graph.addNode(s.payload.uuid,s)}_getNextNode(){const s=this.graph.overallOrder(!0);let e=1/0,n;for(const a of s){const c=this.requestAttemptCounter[a]||0;c<e&&(e=c,n=a)}return n}peek(){const s=this._getNextNode();if(s)return this.graph.getNodeData(s)}remove(s){this.graph.removeNode(s),delete this.requestAttemptCounter[s]}pop(){const s=this.peek();return s&&this.graph.removeNode(s.payload.uuid),s}getQueue(){const s=this.graph.overallOrder().map(n=>this.graph.getNodeData(n)),e=this._getNextNode();if(e){const n=this.graph.getNodeData(e),a=s.findIndex(c=>c.payload.uuid===n.payload.uuid);a!==-1&&(s.splice(a,1),s.unshift(n))}return s}getReady(){let s=this.graph.overallOrder(!0).map(e=>this.graph.getNodeData(e));return s=s.sort((e,n)=>e.meta.offline.effect.timestamp.localeCompare(n.meta.offline.effect.timestamp)),s=s.sort((e,n)=>{const a=this.requestAttemptCounter[e.payload.uuid]||0,c=this.requestAttemptCounter[n.payload.uuid]||0;return a-c}),s}registerRetry(s){this.requestAttemptCounter[s]=(this.requestAttemptCounter[s]||0)+1}}let lg;function ug(t){lg=t}function _t(){return lg}let og;function hg(t){og=t}function pg(){return og}let ka=null;function At(){const t=_t();if(!t)return console.warn("Client store not set; cannot get outbox coordinator yet."),null;if(ka)return ka;const s=t.getState().offline.outbox,e=Ft._fromOutbox(s);return ka=e,e}const ZM=(t,s)=>{const e=new s(t);return hg(e),ug(t),e};class QM{constructor(s){m(this,"_all");m(this,"_previous");this._all=[s],this._previous=s,this.then=this.then.bind(this),this.compile=this.compile.bind(this)}then(s){return this._previous&&(this._previous.next=s),this._all.push(s),this._previous=s,{then:this.then,compile:this.compile}}compile(){return this._all}}class Ea{constructor(){m(this,"next");this.next=null}then(s){return new QM(this).then(s)}async run(s){if(this.next)return this.next.run(s);{if(console.debug("Middleware finished. Performing request:",s.payload.url),!_t())throw new Error("Client store not set");const n=pg();if(!n)throw new Error("Client SDK not set");return ag(s,n)}}}class mg extends Ea{async run(s){return super.run(s)}}class yg extends Ea{async run(s){return super.run(s)}}const fg=new mg().then(new yg).compile();function Sg(t){var s;return(s=fg[0])==null?void 0:s.run(t)}var Ag=(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))(Ag||{});i.ALL_MIDDLEWARE=fg,i.APIError=C,i.AgentService=_R,i.AssetAttachmentService=gR,i.AssetProcedureService=ER,i.AssetProcedureStepFieldValuesAttachmentService=WR,i.AssetProcedureStepFieldValuesService=zR,i.AssetProcedureStepFieldsAttachmentService=VR,i.AssetProcedureStepFieldsService=BR,i.AssetProcedureStepService=qR,i.AssetProcedureTypeAttachmentService=PR,i.AssetProcedureTypeFieldValuesAttachmentService=MR,i.AssetProcedureTypeFieldValuesService=kR,i.AssetProcedureTypeFieldsAttachmentService=bR,i.AssetProcedureTypeFieldsService=RR,i.AssetProcedureTypeService=vR,i.AssetService=DR,i.AssetStageCompletionService=jR,i.AssetStageService=$R,i.AssetStatusType=Da,i.AssetTypeAttachmentService=CR,i.AssetTypeFieldValuesAttachmentService=NR,i.AssetTypeFieldValuesService=GR,i.AssetTypeFieldsAttachmentService=UR,i.AssetTypeFieldsService=LR,i.AssetTypeIdentifierService=HR,i.AssetTypeIdentifierValueService=KR,i.AssetTypeService=YR,i.AssetTypeStatusService=JR,i.AttachmentModel=ja,i.BaseApiService=St,i.BaseModelApiService=Ot,i.BaseOfflineFileModelApiService=q,i.BaseOfflineModelApiService=M,i.BaseSDK=JM,i.COMMON_AUTO_FIELDS=Ja,i.DEFAULT_ISSUE_PRIORITY=Mg,i.DEFAULT_PAGE_SIZE=J_,i.DISCARD_HTTP_STATUSES=ba,i.DeferredPromise=ms,i.DocumentAttachmentService=ZR,i.DocumentService=QR,i.EMPTY_ARRAY=Wa,i.EMPTY_OBJECT=za,i.EmailDomainsService=XR,i.EmailVerificationService=xR,i.FILE_MODEL_DEFAULT_PAGE_SIZE=Z_,i.FileService=eM,i.FormIdentifierService=tM,i.FormIdentifierValueService=sM,i.FormRevisionAttachmentService=iM,i.FormRevisionService=nM,i.FormService=aM,i.FormSubmissionAttachmentService=cM,i.FormSubmissionService=rM,i.GeoImageService=dM,i.HttpMethod=h,i.IssueAssociationService=lM,i.IssueAttachmentService=uM,i.IssueCommentAttachmentService=oM,i.IssueCommentService=hM,i.IssuePriority=ps,i.IssueService=pM,i.IssueStatusType=$a,i.IssueTypeAttachmentService=mM,i.IssueTypeFieldValuesAttachmentService=SM,i.IssueTypeFieldValuesService=AM,i.IssueTypeFieldsAttachmentService=yM,i.IssueTypeFieldsService=fM,i.IssueTypeIdentifierService=wM,i.IssueTypeIdentifierValueService=TM,i.IssueTypeService=IM,i.IssueTypeStatusService=OM,i.IssueUpdateChange=$,i.IssueUpdateService=FM,i.JWTService=PM,i.MAX_SERVICE_BATCH_SIZE=ut,i.OUTBOX_RETRY_DELAY=Ua,i.OfflineAnalyticsMiddleware=mg,i.OfflineMiddleware=Ea,i.OrganizationAccessLevel=qa,i.OrganizationAccessService=bM,i.OrganizationService=RM,i.OutboxCoordinator=Ft,i.ProjectAccessService=MM,i.ProjectAttachmentService=kM,i.ProjectFileService=EM,i.ProjectService=vM,i.RESET_ORGANIZATION_STATE=_,i.RESET_PROJECT_STATE=B,i.RESET_STATE=I,i.RateLimitingMiddleware=yg,i.SelectorBuilder=eP,i.TeamMembershipService=VM,i.TeamService=BM,i.UNKNOWN_ERROR_MESSAGE=It,i.UserService=WM,i.VERSION_REDUCER_KEY=Rt,i.VerificationCodeType=Ag,i.WORKFLOW_STATUSES=Eg,i.WORKFLOW_STEP_FIELD_VALUES_REVIEW_TYPES=kg,i.WorkflowService=zM,i.WorkflowStatus=Pt,i.WorkflowStepAssigneeService=qM,i.WorkflowStepCommentService=DM,i.WorkflowStepEventService=jM,i.WorkflowStepEventType=Ca,i.WorkflowStepFieldValuesAttachmentService=UM,i.WorkflowStepFieldValuesReviewRequestService=LM,i.WorkflowStepFieldValuesReviewService=NM,i.WorkflowStepFieldValuesReviewType=bt,i.WorkflowStepFieldValuesService=GM,i.WorkflowStepFieldsAttachmentService=$M,i.WorkflowStepFieldsService=CM,i.WorkflowStepReviewerService=HM,i.WorkflowStepService=KM,i.WorkflowTypeService=YM,i._setLatestRetryTime=Qw,i.addAsset=gl,i.addAssetAttachment=uc,i.addAssetAttachments=Os,i.addAssetProcedure=Dr,i.addAssetProcedureStep=pl,i.addAssetProcedureStepFieldValues=Qd,i.addAssetProcedureStepFieldValuesAttachment=Dd,i.addAssetProcedureStepFieldValuesAttachments=Gs,i.addAssetProcedureStepFieldValuesMany=Xd,i.addAssetProcedureStepFields=gd,i.addAssetProcedureStepFieldsAttachment=od,i.addAssetProcedureStepFieldsAttachments=hd,i.addAssetProcedureStepFieldsMany=Pd,i.addAssetProcedureSteps=ml,i.addAssetProcedureType=Qr,i.addAssetProcedureTypeAttachment=Fc,i.addAssetProcedureTypeAttachments=_c,i.addAssetProcedureTypeFieldValues=_r,i.addAssetProcedureTypeFieldValuesAttachment=or,i.addAssetProcedureTypeFieldValuesAttachments=Es,i.addAssetProcedureTypeFieldValuesMany=gr,i.addAssetProcedureTypeFields=Qc,i.addAssetProcedureTypeFieldsAttachment=qc,i.addAssetProcedureTypeFieldsAttachments=Dc,i.addAssetProcedureTypeFieldsMany=Xc,i.addAssetProcedureTypes=Xr,i.addAssetProcedures=zs,i.addAssetStage=tu,i.addAssetStageCompletion=Dl,i.addAssetStageCompletions=jl,i.addAssetStages=su,i.addAssetType=ih,i.addAssetTypeAttachment=hu,i.addAssetTypeAttachments=ai,i.addAssetTypeFieldValues=po,i.addAssetTypeFieldValuesAttachment=xu,i.addAssetTypeFieldValuesAttachments=hi,i.addAssetTypeFieldValuesMany=mo,i.addAssetTypeFields=ju,i.addAssetTypeFieldsAttachment=gu,i.addAssetTypeFieldsAttachments=Pu,i.addAssetTypeFieldsMany=$u,i.addAssetTypeIdentifier=bo,i.addAssetTypeIdentifierValue=Co,i.addAssetTypeIdentifierValues=Uo,i.addAssetTypeIdentifiers=Ro,i.addAssetTypeStatus=yh,i.addAssetTypeStatuses=fh,i.addAssetTypes=nh,i.addAssets=Xs,i.addConversation=nc,i.addConversations=tP,i.addDocument=Hh,i.addDocumentAttachment=vh,i.addDocumentAttachments=Vh,i.addDocuments=Kh,i.addEmailDomain=cp,i.addEmailDomains=rp,i.addForm=Im,i.addFormIdentifier=Fp,i.addFormIdentifierValue=qp,i.addFormIdentifierValues=Dp,i.addFormIdentifiers=_p,i.addFormRevision=Wi,i.addFormRevisionAttachment=Qp,i.addFormRevisionAttachments=Xp,i.addFormRevisions=zi,i.addFormSubmission=Jm,i.addFormSubmissionAttachment=Wm,i.addFormSubmissionAttachments=Li,i.addFormSubmissions=Ji,i.addForms=Om,i.addGeoImage=dy,i.addGeoImages=ly,i.addIssue=_f,i.addIssueAssociation=_y,i.addIssueAssociations=mt,i.addIssueAttachment=qy,i.addIssueAttachments=sn,i.addIssueComment=of,i.addIssueCommentAttachment=Zy,i.addIssueCommentAttachments=Qy,i.addIssueComments=hf,i.addIssueType=PA,i.addIssueTypeAttachment=qf,i.addIssueTypeAttachments=Df,i.addIssueTypeFieldValues=oS,i.addIssueTypeFieldValuesAttachment=jS,i.addIssueTypeFieldValuesAttachments=Tn,i.addIssueTypeFieldValuesMany=hS,i.addIssueTypeFields=gS,i.addIssueTypeFieldsAttachment=Qf,i.addIssueTypeFieldsAttachments=Xf,i.addIssueTypeFieldsMany=PS,i.addIssueTypeIdentifier=XS,i.addIssueTypeIdentifierValue=hA,i.addIssueTypeIdentifierValues=pA,i.addIssueTypeIdentifiers=xS,i.addIssueTypeStatus=$A,i.addIssueTypeStatuses=CA,i.addIssueTypes=bA,i.addIssueUpdate=vn,i.addIssueUpdates=Vn,i.addIssues=on,i.addOrganization=qw,i.addOrganizationAccess=Tw,i.addOrganizationAccesses=Iw,i.addOrganizations=zw,i.addProject=HT,i.addProjectAccess=tT,i.addProjectAccesses=sT,i.addProjectAttachment=mT,i.addProjectAttachments=yT,i.addProjectFile=kT,i.addProjectFiles=ET,i.addProjects=GT,i.addTeam=AI,i.addTeamMembership=nI,i.addTeamMemberships=aI,i.addTeams=wI,i.addUser=jn,i.addUsers=ow,i.addWorkflow=BI,i.addWorkflowStep=O_,i.addWorkflowStepAssignee=YI,i.addWorkflowStepAssignees=JI,i.addWorkflowStepComment=dO,i.addWorkflowStepComments=lO,i.addWorkflowStepEvent=OO,i.addWorkflowStepEvents=FO,i.addWorkflowStepFieldValues=OF,i.addWorkflowStepFieldValuesAttachment=lF,i.addWorkflowStepFieldValuesAttachments=oa,i.addWorkflowStepFieldValuesMany=FF,i.addWorkflowStepFieldValuesReview=JF,i.addWorkflowStepFieldValuesReviewRequest=zF,i.addWorkflowStepFieldValuesReviewRequests=fa,i.addWorkflowStepFieldValuesReviews=wa,i.addWorkflowStepFields=JO,i.addWorkflowStepFieldsAttachment=zO,i.addWorkflowStepFieldsAttachments=ca,i.addWorkflowStepFieldsMany=ZO,i.addWorkflowStepReviewer=d_,i.addWorkflowStepReviewers=l_,i.addWorkflowSteps=F_,i.addWorkflowType=z_,i.addWorkflowTypes=q_,i.addWorkflows=WI,i.agentsReducer=rc,i.agentsSlice=ws,i.areArraysEqual=Wg,i.assetAttachmentReducer=Tc,i.assetAttachmentSlice=Is,i.assetProcedureReducer=Nr,i.assetProcedureSlice=Ws,i.assetProcedureStepFieldValuesAttachmentReducer=Yd,i.assetProcedureStepFieldValuesAttachmentSlice=Ns,i.assetProcedureStepFieldValuesReducer=dl,i.assetProcedureStepFieldValuesSlice=Ys,i.assetProcedureStepFieldsAttachmentReducer=Od,i.assetProcedureStepFieldsAttachmentSlice=$s,i.assetProcedureStepFieldsReducer=Wd,i.assetProcedureStepFieldsSlice=Us,i.assetProcedureStepReducer=wl,i.assetProcedureStepSlice=Js,i.assetProcedureTypeAttachmentReducer=Ec,i.assetProcedureTypeAttachmentSlice=gs,i.assetProcedureTypeFieldValuesAttachmentReducer=Sr,i.assetProcedureTypeFieldValuesAttachmentSlice=ks,i.assetProcedureTypeFieldValuesReducer=vr,i.assetProcedureTypeFieldValuesSlice=Bs,i.assetProcedureTypeFieldsAttachmentReducer=Gc,i.assetProcedureTypeFieldsAttachmentSlice=bs,i.assetProcedureTypeFieldsReducer=ar,i.assetProcedureTypeFieldsSlice=Ms,i.assetProcedureTypeReducer=ad,i.assetProcedureTypeSlice=Ds,i.assetReducer=Wl,i.assetSlice=Qs,i.assetStageCompletionReducer=Hl,i.assetStageCompletionSlice=ei,i.assetStageReducer=ru,i.assetStageSlice=ti,i.assetTypeAttachmentReducer=Ou,i.assetTypeAttachmentSlice=ni,i.assetTypeFieldValuesAttachmentReducer=uo,i.assetTypeFieldValuesAttachmentSlice=oi,i.assetTypeFieldValuesReducer=_o,i.assetTypeFieldValuesSlice=yi,i.assetTypeFieldsAttachmentReducer=zu,i.assetTypeFieldsAttachmentSlice=di,i.assetTypeFieldsReducer=Zu,i.assetTypeFieldsSlice=ui,i.assetTypeIdentifierReducer=Do,i.assetTypeIdentifierSlice=fi,i.assetTypeIdentifierValueReducer=Xo,i.assetTypeIdentifierValueSlice=Ai,i.assetTypeReducer=hh,i.assetTypeSlice=wi,i.assetTypeStatusReducer=Ph,i.assetTypeStatusSlice=Ii,i.assetTypeStatusSortFn=Xa,i.authReducer=Mh,i.authSlice=Qt,i.baseReducer=lR,i.baseReducers=Pa,i.clearTokens=jP,i.createModelAdapter=F,i.createOfflineAction=Kw,i.createPayload=R,i.createSelectionAdapter=vg,i.deleteAsset=Rl,i.deleteAssetAttachment=yc,i.deleteAssetAttachments=Fs,i.deleteAssetProcedure=Cr,i.deleteAssetProcedureStep=Sl,i.deleteAssetProcedureStepFieldValues=il,i.deleteAssetProcedureStepFieldValuesAttachment=Ld,i.deleteAssetProcedureStepFieldValuesAttachments=Hs,i.deleteAssetProcedureStepFieldValuesMany=nl,i.deleteAssetProcedureStepFields=Ed,i.deleteAssetProcedureStepFieldsAttachment=Sd,i.deleteAssetProcedureStepFieldsAttachments=Ad,i.deleteAssetProcedureStepFieldsMany=vd,i.deleteAssetProcedureSteps=Al,i.deleteAssetProcedureType=td,i.deleteAssetProcedureTypeAttachment=Mc,i.deleteAssetProcedureTypeAttachments=kc,i.deleteAssetProcedureTypeFieldValues=kr,i.deleteAssetProcedureTypeFieldValuesAttachment=fr,i.deleteAssetProcedureTypeFieldValuesAttachments=vs,i.deleteAssetProcedureTypeFieldValuesMany=Er,i.deleteAssetProcedureTypeFields=ir,i.deleteAssetProcedureTypeFieldsAttachment=Lc,i.deleteAssetProcedureTypeFieldsAttachments=Nc,i.deleteAssetProcedureTypeFieldsMany=nr,i.deleteAssetProcedureTypes=sd,i.deleteAssetProcedures=qs,i.deleteAssetStage=au,i.deleteAssetStageCompletion=Nl,i.deleteAssetStageCompletions=Gl,i.deleteAssetStages=cu,i.deleteAssetType=rh,i.deleteAssetTypeAttachment=Su,i.deleteAssetTypeAttachments=ci,i.deleteAssetTypeFieldValues=wo,i.deleteAssetTypeFieldValuesAttachment=no,i.deleteAssetTypeFieldValuesAttachments=pi,i.deleteAssetTypeFieldValuesMany=To,i.deleteAssetTypeFields=Gu,i.deleteAssetTypeFieldsAttachment=Eu,i.deleteAssetTypeFieldsAttachments=vu,i.deleteAssetTypeFieldsMany=Hu,i.deleteAssetTypeIdentifier=Vo,i.deleteAssetTypeIdentifierValue=Ko,i.deleteAssetTypeIdentifierValues=Yo,i.deleteAssetTypeIdentifiers=Bo,i.deleteAssetTypeStatus=Ih,i.deleteAssetTypeStatuses=Oh,i.deleteAssetTypes=dh,i.deleteAssets=xs,i.deleteConversation=nP,i.deleteConversations=aP,i.deleteDocument=Xh,i.deleteDocumentAttachment=Dh,i.deleteDocumentAttachments=jh,i.deleteDocuments=xh,i.deleteEmailDomain=hp,i.deleteEmailDomains=pp,i.deleteForm=bm,i.deleteFormIdentifier=Mp,i.deleteFormIdentifierValue=Lp,i.deleteFormIdentifierValues=Np,i.deleteFormIdentifiers=kp,i.deleteFormRevision=qi,i.deleteFormRevisionAttachment=im,i.deleteFormRevisionAttachments=nm,i.deleteFormRevisions=Di,i.deleteFormSubmission=Xm,i.deleteFormSubmissionAttachment=$m,i.deleteFormSubmissionAttachments=Ni,i.deleteFormSubmissions=Zi,i.deleteForms=Rm,i.deleteGeoImage=hy,i.deleteGeoImages=py,i.deleteIssue=Mf,i.deleteIssueAssociation=gy,i.deleteIssueAssociations=yt,i.deleteIssueAttachment=Uy,i.deleteIssueAttachments=nn,i.deleteIssueComment=Sf,i.deleteIssueCommentAttachment=sf,i.deleteIssueCommentAttachments=nf,i.deleteIssueComments=Af,i.deleteIssueType=vA,i.deleteIssueTypeAttachment=Lf,i.deleteIssueTypeAttachments=Nf,i.deleteIssueTypeFieldValues=SS,i.deleteIssueTypeFieldValuesAttachment=NS,i.deleteIssueTypeFieldValuesAttachments=In,i.deleteIssueTypeFieldValuesMany=AS,i.deleteIssueTypeFields=ES,i.deleteIssueTypeFieldsAttachment=iS,i.deleteIssueTypeFieldsAttachments=nS,i.deleteIssueTypeFieldsMany=vS,i.deleteIssueTypeIdentifier=nA,i.deleteIssueTypeIdentifierValue=AA,i.deleteIssueTypeIdentifierValues=wA,i.deleteIssueTypeIdentifiers=aA,i.deleteIssueTypeStatus=HA,i.deleteIssueTypeStatuses=KA,i.deleteIssueTypes=VA,i.deleteIssueUpdate=Bn,i.deleteIssueUpdates=Wn,i.deleteIssues=hn,i.deleteOrganization=$w,i.deleteOrganizationAccess=Pw,i.deleteOrganizationAccesses=bw,i.deleteOrganizations=Cw,i.deleteProject=JT,i.deleteProjectAccess=rT,i.deleteProjectAccesses=dT,i.deleteProjectAttachment=TT,i.deleteProjectAttachments=IT,i.deleteProjectFile=BT,i.deleteProjectFiles=WT,i.deleteProjects=ZT,i.deleteTeam=_I,i.deleteTeamMembership=uI,i.deleteTeamMemberships=oI,i.deleteTeams=gI,i.deleteUser=$n,i.deleteUsers=mw,i.deleteWorkflow=$I,i.deleteWorkflowStep=R_,i.deleteWorkflowStepAssignee=eO,i.deleteWorkflowStepAssignees=tO,i.deleteWorkflowStepComment=mO,i.deleteWorkflowStepComments=yO,i.deleteWorkflowStepEvent=RO,i.deleteWorkflowStepEvents=MO,i.deleteWorkflowStepFieldValues=RF,i.deleteWorkflowStepFieldValuesAttachment=mF,i.deleteWorkflowStepFieldValuesAttachments=ha,i.deleteWorkflowStepFieldValuesMany=MF,i.deleteWorkflowStepFieldValuesReview=e_,i.deleteWorkflowStepFieldValuesReviewRequest=CF,i.deleteWorkflowStepFieldValuesReviewRequests=Sa,i.deleteWorkflowStepFieldValuesReviews=Ta,i.deleteWorkflowStepFields=tF,i.deleteWorkflowStepFieldsAttachment=CO,i.deleteWorkflowStepFieldsAttachments=ra,i.deleteWorkflowStepFieldsMany=sF,i.deleteWorkflowStepReviewer=m_,i.deleteWorkflowStepReviewers=y_,i.deleteWorkflowSteps=M_,i.deleteWorkflowType=U_,i.deleteWorkflowTypes=L_,i.deleteWorkflows=CI,i.dequeue=ng,i.discard=cg,i.documentAttachmentReducer=Lh,i.documentAttachmentSlice=Fi,i.documentSlice=gi,i.documentsReducer=ep,i.downloadFile=Lg,i.emailDomainsReducer=Sp,i.emailDomainsSlice=bi,i.emailRegex=Qg,i.enqueue=ig,i.enqueueRequest=Jw,i.extractResponseFromError=dg,i.fallbackToEmptyArray=A,i.fallbackToEmptyObject=$t,i.fetchBlobFromObjectUrl=Ga,i.fetchFileFromObjectUrl=Ha,i.fileReducer=Tp,i.fileSlice=Mi,i.formIdentifierReducer=Bp,i.formIdentifierSlice=ki,i.formIdentifierValueReducer=Yp,i.formIdentifierValueSlice=vi,i.formReducer=Mm,i.formRevisionAttachmentReducer=dm,i.formRevisionAttachmentSlice=Vi,i.formRevisionReducer=Am,i.formRevisionsSlice=Bi,i.formSlice=$i,i.formSubmissionAttachmentReducer=Nm,i.formSubmissionAttachmentSlice=Ui,i.formSubmissionReducer=iy,i.formSubmissionSlice=Yi,i.geoImageReducer=Sy,i.geoImageSlice=Xi,i.getAssetProcedureStepSubTree=Qa,i.getAssetProcedureStepTrees=Xg,i.getClientSDK=pg,i.getClientStore=_t,i.getDocumentSubTree=tc,i.getDocumentTrees=xg,i.getFileExtension=Na,i.getLocalDateString=La,i.getLocalRelativeDateString=jg,i.getOutboxCoordinator=At,i.getRenamedFile=Ug,i.getRequestDescription=w,i.getS3FileKey=Cg,i.hashFile=Ct,i.initSDK=ZM,i.initializeAssetAttachments=lc,i.initializeAssetProcedureStepFieldValues=Zd,i.initializeAssetProcedureStepFieldValuesAttachments=qd,i.initializeAssetProcedureStepFields=_d,i.initializeAssetProcedureStepFieldsAttachments=ud,i.initializeAssetProcedureSteps=ul,i.initializeAssetProcedureTypeAttachments=Oc,i.initializeAssetProcedureTypeFieldValues=Fr,i.initializeAssetProcedureTypeFieldValuesAttachments=ur,i.initializeAssetProcedureTypeFields=Zc,i.initializeAssetProcedureTypeFieldsAttachments=zc,i.initializeAssetProcedureTypes=Zr,i.initializeAssetProcedures=qr,i.initializeAssetStageCompletions=ql,i.initializeAssetStages=Xl,i.initializeAssetTypeAttachments=ou,i.initializeAssetTypeFieldValues=ho,i.initializeAssetTypeFieldValuesAttachments=Xu,i.initializeAssetTypeFields=Du,i.initializeAssetTypeFieldsAttachments=_u,i.initializeAssetTypeIdentifierValues=$o,i.initializeAssetTypeIdentifiers=Po,i.initializeAssetTypeStatuses=mh,i.initializeAssetTypes=eh,i.initializeAssets=_l,i.initializeConversations=ic,i.initializeDocumentAttachments=Eh,i.initializeDocuments=Gh,i.initializeEmailDomains=ap,i.initializeFormIdentifierValues=zp,i.initializeFormIdentifiers=Op,i.initializeFormRevisionAttachments=Zp,i.initializeFormRevisions=um,i.initializeFormSubmissionAttachments=Bm,i.initializeFormSubmissions=Hm,i.initializeForms=Tm,i.initializeGeoImages=ay,i.initializeIssueAssociations=wy,i.initializeIssueAttachments=zy,i.initializeIssueCommentAttachments=Jy,i.initializeIssueComments=uf,i.initializeIssueTypeAttachments=zf,i.initializeIssueTypeFieldValues=uS,i.initializeIssueTypeFieldValuesAttachments=DS,i.initializeIssueTypeFields=_S,i.initializeIssueTypeFieldsAttachments=Zf,i.initializeIssueTypeIdentifierValues=oA,i.initializeIssueTypeIdentifiers=QS,i.initializeIssueTypeStatuses=jA,i.initializeIssueTypes=gA,i.initializeIssueUpdates=XA,i.initializeIssues=Ff,i.initializeOrganizationAccesses=ww,i.initializeOrganizations=Vw,i.initializeProjectAccesses=eT,i.initializeProjectAttachments=pT,i.initializeProjectFiles=bT,i.initializeProjects=UT,i.initializeTeamMemberships=iI,i.initializeTeams=SI,i.initializeUsers=dw,i.initializeWorkflowStepAssignees=KI,i.initializeWorkflowStepComments=rO,i.initializeWorkflowStepEvents=IO,i.initializeWorkflowStepFieldValues=IF,i.initializeWorkflowStepFieldValuesAttachments=dF,i.initializeWorkflowStepFieldValuesReviewRequests=WF,i.initializeWorkflowStepFieldValuesReviews=YF,i.initializeWorkflowStepFields=YO,i.initializeWorkflowStepFieldsAttachments=WO,i.initializeWorkflowStepReviewers=r_,i.initializeWorkflowSteps=I_,i.initializeWorkflowTypes=W_,i.initializeWorkflows=VI,i.isImageFile=Ng,i.isObjectUrl=Ka,i.isToday=Dg,i.issueAssociationReducer=By,i.issueAssociationSlice=en,i.issueAttachmentReducer=Ky,i.issueAttachmentSlice=tn,i.issueCommentAttachmentReducer=df,i.issueCommentAttachmentSlice=cn,i.issueCommentReducer=If,i.issueCommentSlice=dn,i.issueReducer=Bf,i.issueSlice=un,i.issueTypeAttachmentReducer=Yf,i.issueTypeAttachmentSlice=pn,i.issueTypeFieldValuesAttachmentReducer=JS,i.issueTypeFieldValuesAttachmentSlice=wn,i.issueTypeFieldValuesReducer=OS,i.issueTypeFieldValuesSlice=Sn,i.issueTypeFieldsAttachmentReducer=dS,i.issueTypeFieldsAttachmentSlice=yn,i.issueTypeFieldsReducer=zS,i.issueTypeFieldsSlice=An,i.issueTypeIdentifierReducer=lA,i.issueTypeIdentifierSlice=Fn,i.issueTypeIdentifierValueReducer=FA,i.issueTypeIdentifierValueSlice=gn,i.issueTypeReducer=qA,i.issueTypeSlice=Pn,i.issueTypeStatusReducer=ZA,i.issueTypeStatusSlice=Rn,i.issueTypeStatusSortFn=xa,i.issueUpdateReducer=cw,i.issueUpdateSlice=En,i.logOnlyOnce=Gg,i.markAsDeleted=Zw,i.markForDeletion=Ob,i.memoize=fs,i.organizationAccessReducer=Rw,i.organizationAccessSlice=Un,i.organizationReducer=Hw,i.organizationSlice=Ln,i.outboxReducer=Xw,i.outboxSlice=Nn,i.overmapEnhancer=AR,i.overmapReducer=uR,i.overmapReducers=Y_,i.performRequest=Ma,i.performRequestFromAction=ag,i.projectAccessReducer=lT,i.projectAccessSlice=Gn,i.projectAttachmentReducer=gT,i.projectAttachmentSlice=Kn,i.projectFileReducer=$T,i.projectFileSlice=Jn,i.projectReducer=QT,i.projectSlice=Zn,i.rehydratedReducer=tI,i.rehydratedSlice=Qn,i.restructureSelectorWithArgs=S,i.runMiddleware=Sg,i.selectAccessToken=$P,i.selectAccessesByUserOfProject=_b,i.selectAccessibleProjects=bb,i.selectActiveOrganizationAccess=Ab,i.selectAllDocumentAttachments=_i,i.selectAssetAttachmentById=Sc,i.selectAssetAttachmentMapping=fc,i.selectAssetAttachments=_s,i.selectAssetAttachmentsByIds=Ac,i.selectAssetById=Vl,i.selectAssetProcedureById=Kr,i.selectAssetProcedureStepById=Tl,i.selectAssetProcedureStepFieldValues=Mt,i.selectAssetProcedureStepFieldValuesAttachmentById=Gd,i.selectAssetProcedureStepFieldValuesAttachments=Ks,i.selectAssetProcedureStepFieldValuesAttachmentsByIds=Hd,i.selectAssetProcedureStepFieldValuesAttachmentsMapping=Nd,i.selectAssetProcedureStepFieldValuesById=cl,i.selectAssetProcedureStepFieldValuesByIds=rl,i.selectAssetProcedureStepFieldValuesMapping=al,i.selectAssetProcedureStepFieldValuesOfAsset=TP,i.selectAssetProcedureStepFieldValuesOfAssetProcedure=IP,i.selectAssetProcedureStepFieldValuesOfAssetProcedureStep=OP,i.selectAssetProcedureStepFields=Ht,i.selectAssetProcedureStepFieldsAttachmentById=Td,i.selectAssetProcedureStepFieldsAttachments=Cs,i.selectAssetProcedureStepFieldsAttachmentsByIds=Id,i.selectAssetProcedureStepFieldsAttachmentsMapping=wd,i.selectAssetProcedureStepFieldsById=Vd,i.selectAssetProcedureStepFieldsByIds=Bd,i.selectAssetProcedureStepFieldsMapping=Ls,i.selectAssetProcedureStepFieldsOfAssetProcedureStep=SP,i.selectAssetProcedureStepMapping=Kt,i.selectAssetProcedureSteps=Zs,i.selectAssetProcedureStepsByIds=Il,i.selectAssetProcedureStepsMappingOfAssetProcedureType=FP,i.selectAssetProcedureStepsOfAssetProcedureType=_P,i.selectAssetProcedureTypeAttachmentById=Vc,i.selectAssetProcedureTypeAttachmentMapping=vc,i.selectAssetProcedureTypeAttachments=Ps,i.selectAssetProcedureTypeAttachmentsByIds=Bc,i.selectAssetProcedureTypeById=rd,i.selectAssetProcedureTypeFieldValues=Nt,i.selectAssetProcedureTypeFieldValuesAttachmentById=wr,i.selectAssetProcedureTypeFieldValuesAttachments=Vs,i.selectAssetProcedureTypeFieldValuesAttachmentsByIds=Tr,i.selectAssetProcedureTypeFieldValuesAttachmentsMapping=Ar,i.selectAssetProcedureTypeFieldValuesById=Br,i.selectAssetProcedureTypeFieldValuesByIds=Wr,i.selectAssetProcedureTypeFieldValuesMapping=Vr,i.selectAssetProcedureTypeFieldValuesOfAsset=hP,i.selectAssetProcedureTypeFields=Lt,i.selectAssetProcedureTypeFieldsAttachmentById=Kc,i.selectAssetProcedureTypeFieldsAttachments=Rs,i.selectAssetProcedureTypeFieldsAttachmentsByIds=Yc,i.selectAssetProcedureTypeFieldsAttachmentsMapping=Hc,i.selectAssetProcedureTypeFieldsById=rr,i.selectAssetProcedureTypeFieldsByIds=dr,i.selectAssetProcedureTypeFieldsMapping=cr,i.selectAssetProcedureTypeFieldsOfAssetProcedureType=uP,i.selectAssetProcedureTypes=js,i.selectAssetProcedureTypesByIds=dd,i.selectAssetProcedureTypesMapping=cd,i.selectAssetProcedureTypesOfOrganization=yP,i.selectAssetProcedures=Gt,i.selectAssetProceduresByIds=Yr,i.selectAssetProceduresMapping=Gr,i.selectAssetProceduresOfAssetProcedureType=Hr,i.selectAssetProceduresOfAssetType=mP,i.selectAssetStageById=du,i.selectAssetStageCompletionById=Jl,i.selectAssetStageCompletionMapping=Kl,i.selectAssetStageCompletions=Yl,i.selectAssetStageCompletionsByIds=Zl,i.selectAssetStages=ii,i.selectAssetStagesByIds=lu,i.selectAssetStagesMappingOfAssetProcedureType=PP,i.selectAssetStagesOfAssetProcedureType=bP,i.selectAssetTypeAttachmentById=wu,i.selectAssetTypeAttachmentMapping=Au,i.selectAssetTypeAttachments=ri,i.selectAssetTypeAttachmentsByIds=Tu,i.selectAssetTypeById=uh,i.selectAssetTypeFieldValues=Jt,i.selectAssetTypeFieldValuesAttachmentById=co,i.selectAssetTypeFieldValuesAttachments=mi,i.selectAssetTypeFieldValuesAttachmentsByIds=ro,i.selectAssetTypeFieldValuesAttachmentsMapping=ao,i.selectAssetTypeFieldValuesById=Oo,i.selectAssetTypeFieldValuesByIds=Fo,i.selectAssetTypeFieldValuesMapping=Io,i.selectAssetTypeFieldValuesOfAsset=EP,i.selectAssetTypeFields=kt,i.selectAssetTypeFieldsAttachmentById=Bu,i.selectAssetTypeFieldsAttachments=li,i.selectAssetTypeFieldsAttachmentsByIds=Wu,i.selectAssetTypeFieldsAttachmentsMapping=Vu,i.selectAssetTypeFieldsById=Yu,i.selectAssetTypeFieldsByIds=Ju,i.selectAssetTypeFieldsMapping=Ku,i.selectAssetTypeFieldsOfAssetType=MP,i.selectAssetTypeIdentifierById=zo,i.selectAssetTypeIdentifierMapping=Wo,i.selectAssetTypeIdentifierValueById=Zo,i.selectAssetTypeIdentifierValueMapping=Jo,i.selectAssetTypeIdentifierValues=Zt,i.selectAssetTypeIdentifierValuesByIds=Qo,i.selectAssetTypeIdentifierValuesOfAsset=BP,i.selectAssetTypeIdentifierValuesOfIdentifier=WP,i.selectAssetTypeIdentifiers=Si,i.selectAssetTypeIdentifiersByIds=qo,i.selectAssetTypeIdentifiersOfAssetType=VP,i.selectAssetTypeStatusById=_h,i.selectAssetTypeStatusMapping=Fh,i.selectAssetTypeStatuses=Oi,i.selectAssetTypeStatusesByIds=gh,i.selectAssetTypeStatusesOfAssetType=qP,i.selectAssetTypeValuesOfAssetType=vP,i.selectAssetTypes=Ti,i.selectAssetTypesByIds=oh,i.selectAssetTypesMapping=lh,i.selectAssetTypesOfOrganization=zP,i.selectAssets=Yt,i.selectAssetsByIds=Bl,i.selectAssetsMapping=El,i.selectAssetsOfAssetType=vl,i.selectAssetsOfProject=gP,i.selectAttachmentsOfAsset=wc,i.selectAttachmentsOfAssetProcedureStepFieldValues=Kd,i.selectAttachmentsOfAssetProcedureStepFields=fP,i.selectAttachmentsOfAssetProcedureType=dP,i.selectAttachmentsOfAssetProcedureTypeFieldValues=Ir,i.selectAttachmentsOfAssetProcedureTypeFields=lP,i.selectAttachmentsOfAssetType=Iu,i.selectAttachmentsOfAssetTypeFieldValues=lo,i.selectAttachmentsOfAssetTypeFields=RP,i.selectAttachmentsOfDocument=UP,i.selectAttachmentsOfFormRevision=XP,i.selectAttachmentsOfFormSubmission=Lm,i.selectAttachmentsOfIssue=Ny,i.selectAttachmentsOfIssueComment=sb,i.selectAttachmentsOfIssueType=ab,i.selectAttachmentsOfIssueTypeFieldValues=YS,i.selectAttachmentsOfIssueTypeFields=cb,i.selectAttachmentsOfProject=Pb,i.selectAttachmentsOfWorkflowStepFieldValues=AF,i.selectAttachmentsOfWorkflowStepFields=LO,i.selectCommentsOfIssue=ib,i.selectConversation=rP,i.selectConversationMapping=Ts,i.selectConversations=cP,i.selectCurrentUser=fw,i.selectDeletedRequests=Tb,i.selectDescendantsOfAssetProcedureStep=Ol,i.selectDescendantsOfDocument=ip,i.selectDocumentAttachmentById=Ch,i.selectDocumentAttachmentMapping=$h,i.selectDocumentAttachmentsByIds=Uh,i.selectDocumentById=tp,i.selectDocuments=Xt,i.selectDocumentsByIds=sp,i.selectDocumentsMapping=Pi,i.selectEmailDomainById=yp,i.selectEmailDomains=Ri,i.selectEmailDomainsAsMapping=mp,i.selectEmailDomainsByIds=fp,i.selectEmailDomainsOfOrganization=GP,i.selectFieldValuesOfAssetProcedure=pP,i.selectFormById=Em,i.selectFormIdentifierById=vp,i.selectFormIdentifierMapping=Ep,i.selectFormIdentifierValueById=Hp,i.selectFormIdentifierValueMapping=Gp,i.selectFormIdentifierValues=xt,i.selectFormIdentifierValuesByIds=Kp,i.selectFormIdentifierValuesOfFormSubmission=ZP,i.selectFormIdentifierValuesOfIdentifier=QP,i.selectFormIdentifiers=Ei,i.selectFormIdentifiersByIds=Vp,i.selectFormIdentifiersOfForm=JP,i.selectFormMapping=km,i.selectFormRevisionAttachmentById=cm,i.selectFormRevisionAttachments=am,i.selectFormRevisionAttachmentsByIds=rm,i.selectFormRevisionAttachmentsMapping=es,i.selectFormRevisionById=ym,i.selectFormRevisionMapping=ji,i.selectFormRevisions=ts,i.selectFormRevisionsByIds=fm,i.selectFormRevisionsOfForm=Sm,i.selectFormSubmissionAttachemntsByIds=Ki,i.selectFormSubmissionAttachmentById=Cm,i.selectFormSubmissionAttachments=Hi,i.selectFormSubmissionAttachmentsByIds=Um,i.selectFormSubmissionAttachmentsMapping=Gi,i.selectFormSubmissionById=ey,i.selectFormSubmissions=xm,i.selectFormSubmissionsByIds=ty,i.selectFormSubmissionsMapping=Qi,i.selectFormSubmissionsOfForm=sy,i.selectForms=Ci,i.selectFormsByIds=vm,i.selectFormsOfOrganization=eb,i.selectGeoImageById=yy,i.selectGeoImageMapping=my,i.selectGeoImages=xi,i.selectGeoImagesByIds=fy,i.selectGeoImagesOfProject=tb,i.selectIsLoggedIn=CP,i.selectIssueAssociationById=by,i.selectIssueAssociationMapping=Py,i.selectIssueAssociations=ft,i.selectIssueAssociationsByIds=Ry,i.selectIssueAssociationsOfAsset=Vy,i.selectIssueAssociationsOfIssue=vy,i.selectIssueAssociationsOfIssues=Ey,i.selectIssueAssociationsToIssue=My,i.selectIssueAssociationsToIssues=ky,i.selectIssueAttachmentById=Gy,i.selectIssueAttachmentMapping=Ly,i.selectIssueAttachments=an,i.selectIssueAttachmentsByIds=Hy,i.selectIssueById=Ef,i.selectIssueCommentAttachmentById=cf,i.selectIssueCommentAttachmentMapping=af,i.selectIssueCommentAttachments=rn,i.selectIssueCommentAttachmentsByIds=rf,i.selectIssueCommentById=wf,i.selectIssueCommentMapping=ln,i.selectIssueCommentsByIds=Tf,i.selectIssueMapping=kf,i.selectIssueTypeAttachmentById=Hf,i.selectIssueTypeAttachmentMapping=Gf,i.selectIssueTypeAttachments=mn,i.selectIssueTypeAttachmentsByIds=Kf,i.selectIssueTypeById=WA,i.selectIssueTypeFieldValues=is,i.selectIssueTypeFieldValuesAttachmentById=HS,i.selectIssueTypeFieldValuesAttachments=On,i.selectIssueTypeFieldValuesAttachmentsByIds=KS,i.selectIssueTypeFieldValuesAttachmentsMapping=GS,i.selectIssueTypeFieldValuesById=TS,i.selectIssueTypeFieldValuesByIds=IS,i.selectIssueTypeFieldValuesMapping=wS,i.selectIssueTypeFieldValuesOfIssue=rb,i.selectIssueTypeFields=Et,i.selectIssueTypeFieldsAttachmentById=cS,i.selectIssueTypeFieldsAttachments=fn,i.selectIssueTypeFieldsAttachmentsByIds=rS,i.selectIssueTypeFieldsAttachmentsMapping=aS,i.selectIssueTypeFieldsById=BS,i.selectIssueTypeFieldsByIds=WS,i.selectIssueTypeFieldsMapping=VS,i.selectIssueTypeFieldsOfIssueType=db,i.selectIssueTypeIdentifierById=rA,i.selectIssueTypeIdentifierMapping=cA,i.selectIssueTypeIdentifierValueById=IA,i.selectIssueTypeIdentifierValueMapping=TA,i.selectIssueTypeIdentifierValues=ns,i.selectIssueTypeIdentifierValuesByIds=OA,i.selectIssueTypeIdentifierValuesOfIdentifier=pb,i.selectIssueTypeIdentifierValuesOfIssue=hb,i.selectIssueTypeIdentifiers=_n,i.selectIssueTypeIdentifiersByIds=dA,i.selectIssueTypeIdentifiersOfIssueType=ob,i.selectIssueTypeMapping=BA,i.selectIssueTypeStatusById=kn,i.selectIssueTypeStatusMapping=YA,i.selectIssueTypeStatuses=Mn,i.selectIssueTypeStatusesByIds=JA,i.selectIssueTypeStatusesOfIssueType=yb,i.selectIssueTypeValuesOfIssueType=ub,i.selectIssueTypes=bn,i.selectIssueTypesByIds=zA,i.selectIssueTypesOfOrganization=mb,i.selectIssueUpdateById=iw,i.selectIssueUpdateMapping=zn,i.selectIssueUpdates=qn,i.selectIssueUpdatesByIds=nw,i.selectIssueUpdatesOfIssue=aw,i.selectIssues=ss,i.selectIssuesByIds=vf,i.selectIssuesOfIssueType=Vf,i.selectIssuesOfProject=nb,i.selectLatestAssetProcedureStepFieldsOfAssetProcedureStep=AP,i.selectLatestAssetProcedureTypeFieldsOfAssetProcedureType=oP,i.selectLatestAssetTypeFieldsOfAssetType=kP,i.selectLatestFieldsByAssetProcedureStep=wP,i.selectLatestFormRevisionOfForm=xP,i.selectLatestIssueTypeFieldsOfIssueType=lb,i.selectLatestRetryTime=Ib,i.selectLatestReviewOfWorkflowStepFieldValues=tR,i.selectLatestReviewRequestOfWorkflowStepFieldValues=xb,i.selectLatestWorkflowStepFieldValuesByWorkflowStepOfWorkflow=Xb,i.selectLatestWorkflowStepFieldValuesReviewByWorkflowStepFieldValues=iR,i.selectLatestWorkflowStepFieldsOfWorkflowStep=Yb,i.selectMembershipsByUserOfTeam=vb,i.selectOrganizationAccessById=Mw,i.selectOrganizationAccessMapping=rs,i.selectOrganizationAccessUserMapping=Ew,i.selectOrganizationAccessesByIds=kw,i.selectOrganizationById=Nw,i.selectOrganizationDocuments=NP,i.selectOrganizations=Lw,i.selectOrganizationsByIds=Gw,i.selectOrganizationsMapping=Uw,i.selectProjectAccessById=uT,i.selectProjectAccessMapping=Hn,i.selectProjectAccesses=vt,i.selectProjectAccessesByIds=oT,i.selectProjectAccessesOfProject=Fb,i.selectProjectAttachmentById=FT,i.selectProjectAttachmentMapping=OT,i.selectProjectAttachments=Yn,i.selectProjectAttachmentsByIds=_T,i.selectProjectById=xT,i.selectProjectDocuments=LP,i.selectProjectFileById=DT,i.selectProjectFileMapping=zT,i.selectProjectFiles=qT,i.selectProjectFilesByIds=jT,i.selectProjectMapping=XT,i.selectProjects=ds,i.selectProjectsByIds=eI,i.selectProjectsOfOrganization=Rb,i.selectRehydrated=Eb,i.selectReviewRequestsOfWorkflowStepFieldValues=GF,i.selectReviewsOfWorkflowStepFieldValues=n_,i.selectStageMapping=si,i.selectTeamById=bI,i.selectTeamMembershipById=mI,i.selectTeamMemberships=ls,i.selectTeamMembershipsByIds=yI,i.selectTeamMembershipsMapping=pI,i.selectTeams=ea,i.selectTeamsByIds=RI,i.selectTeamsMapping=PI,i.selectTeamsOfOrganization=Bb,i.selectUploadUrl=YP,i.selectUserById=cs,i.selectUsers=as,i.selectUsersByIds=Sw,i.selectUsersMapping=Cn,i.selectUsersOfOrganization=wb,i.selectUsersOfProject=gb,i.selectUsersOfTeam=Vb,i.selectWorkflowById=LI,i.selectWorkflowMapping=UI,i.selectWorkflowStepAssigneeById=iO,i.selectWorkflowStepAssignees=Vt,i.selectWorkflowStepAssigneesByIds=nO,i.selectWorkflowStepAssigneesMapping=sO,i.selectWorkflowStepAssigneesOfWorkflow=Db,i.selectWorkflowStepAssigneesOfWorkflowAndWorkflowStep=$b,i.selectWorkflowStepAssigneesOfWorkflowStep=jb,i.selectWorkflowStepById=E_,i.selectWorkflowStepCommentById=SO,i.selectWorkflowStepComments=Bt,i.selectWorkflowStepCommentsByIds=AO,i.selectWorkflowStepCommentsMapping=fO,i.selectWorkflowStepCommentsOfWorkflow=Cb,i.selectWorkflowStepCommentsOfWorkflowAndWorkflowStep=Lb,i.selectWorkflowStepCommentsOfWorkflowStep=Ub,i.selectWorkflowStepEventById=EO,i.selectWorkflowStepEvents=Wt,i.selectWorkflowStepEventsByIds=vO,i.selectWorkflowStepEventsMapping=kO,i.selectWorkflowStepEventsOfWorkflow=Nb,i.selectWorkflowStepEventsOfWorkflowAndWorkflowStep=Hb,i.selectWorkflowStepEventsOfWorkflowStep=Gb,i.selectWorkflowStepFieldValues=ht,i.selectWorkflowStepFieldValuesAttachmentById=fF,i.selectWorkflowStepFieldValuesAttachments=pa,i.selectWorkflowStepFieldValuesAttachmentsByIds=SF,i.selectWorkflowStepFieldValuesAttachmentsMapping=yF,i.selectWorkflowStepFieldValuesById=EF,i.selectWorkflowStepFieldValuesByIds=vF,i.selectWorkflowStepFieldValuesMapping=kF,i.selectWorkflowStepFieldValuesOfWorkflow=Jb,i.selectWorkflowStepFieldValuesOfWorkflowAndWorkflowStep=Qb,i.selectWorkflowStepFieldValuesOfWorkflowStep=Zb,i.selectWorkflowStepFieldValuesReviewById=s_,i.selectWorkflowStepFieldValuesReviewRequestById=LF,i.selectWorkflowStepFieldValuesReviewRequests=zt,i.selectWorkflowStepFieldValuesReviewRequestsByIds=NF,i.selectWorkflowStepFieldValuesReviewRequestsMapping=UF,i.selectWorkflowStepFieldValuesReviewRequestsOfWorkflowAndWorkflowStep=eR,i.selectWorkflowStepFieldValuesReviews=Tt,i.selectWorkflowStepFieldValuesReviewsByIds=i_,i.selectWorkflowStepFieldValuesReviewsMapping=t_,i.selectWorkflowStepFieldValuesReviewsOfWorkflowAndWorkflowStep=sR,i.selectWorkflowStepFields=os,i.selectWorkflowStepFieldsAttachmentById=NO,i.selectWorkflowStepFieldsAttachments=da,i.selectWorkflowStepFieldsAttachmentsByIds=GO,i.selectWorkflowStepFieldsAttachmentsMapping=UO,i.selectWorkflowStepFieldsById=nF,i.selectWorkflowStepFieldsByIds=aF,i.selectWorkflowStepFieldsMapping=iF,i.selectWorkflowStepFieldsOfWorkflowStep=Kb,i.selectWorkflowStepReviewerById=S_,i.selectWorkflowStepReviewers=qt,i.selectWorkflowStepReviewersByIds=A_,i.selectWorkflowStepReviewersMapping=f_,i.selectWorkflowStepReviewersOfWorkflow=nR,i.selectWorkflowStepReviewersOfWorkflowAndWorkflowStep=cR,i.selectWorkflowStepReviewersOfWorkflowStep=aR,i.selectWorkflowSteps=Fa,i.selectWorkflowStepsByIds=v_,i.selectWorkflowStepsMapping=k_,i.selectWorkflowStepsOfWorkflowType=rR,i.selectWorkflowTypeById=G_,i.selectWorkflowTypeMapping=N_,i.selectWorkflowTypes=ga,i.selectWorkflowTypesByIds=H_,i.selectWorkflowTypesOfOrganization=dR,i.selectWorkflows=us,i.selectWorkflowsByIds=NI,i.selectWorkflowsOfProject=zb,i.selectWorkflowsOfWorkflowType=qb,i.setAsset=Ml,i.setAssetAttachment=oc,i.setAssetAttachments=hc,i.setAssetProcedure=Ur,i.setAssetProcedureStep=ol,i.setAssetProcedureStepFieldValues=xd,i.setAssetProcedureStepFieldValuesAttachment=jd,i.setAssetProcedureStepFieldValuesAttachments=$d,i.setAssetProcedureStepFieldValuesMany=el,i.setAssetProcedureStepFields=bd,i.setAssetProcedureStepFieldsAttachment=pd,i.setAssetProcedureStepFieldsAttachments=md,i.setAssetProcedureStepFieldsMany=Rd,i.setAssetProcedureSteps=hl,i.setAssetProcedureType=id,i.setAssetProcedureTypeAttachment=gc,i.setAssetProcedureTypeAttachments=Pc,i.setAssetProcedureTypeFieldValues=Pr,i.setAssetProcedureTypeFieldValuesAttachment=hr,i.setAssetProcedureTypeFieldValuesAttachments=pr,i.setAssetProcedureTypeFieldValuesMany=br,i.setAssetProcedureTypeFields=xc,i.setAssetProcedureTypeFieldsAttachment=jc,i.setAssetProcedureTypeFieldsAttachments=$c,i.setAssetProcedureTypeFieldsMany=er,i.setAssetProcedureTypes=nd,i.setAssetProcedures=Lr,i.setAssetStage=xl,i.setAssetStageCompletion=$l,i.setAssetStageCompletions=Cl,i.setAssetStages=eu,i.setAssetType=th,i.setAssetTypeAttachment=pu,i.setAssetTypeAttachments=mu,i.setAssetTypeFieldValues=yo,i.setAssetTypeFieldValuesAttachment=eo,i.setAssetTypeFieldValuesAttachments=to,i.setAssetTypeFieldValuesMany=fo,i.setAssetTypeFields=Cu,i.setAssetTypeFieldsAttachment=bu,i.setAssetTypeFieldsAttachments=Ru,i.setAssetTypeFieldsMany=Uu,i.setAssetTypeIdentifier=Mo,i.setAssetTypeIdentifierValue=Lo,i.setAssetTypeIdentifierValues=No,i.setAssetTypeIdentifiers=ko,i.setAssetTypeStatus=Sh,i.setAssetTypeStatuses=Ah,i.setAssetTypes=sh,i.setAssets=kl,i.setClientSDK=hg,i.setClientStore=ug,i.setConversation=ac,i.setConversations=sP,i.setCurrentUser=fb,i.setCurrentUserProfile=Sb,i.setDocument=Yh,i.setDocumentAttachment=Bh,i.setDocumentAttachments=Wh,i.setDocuments=Jh,i.setEmailDomain=dp,i.setEmailDomains=lp,i.setForm=Fm,i.setFormIdentifier=gp,i.setFormIdentifierValue=jp,i.setFormIdentifierValues=$p,i.setFormIdentifiers=Pp,i.setFormRevision=om,i.setFormRevisionAttachment=xp,i.setFormRevisionAttachments=em,i.setFormRevisions=hm,i.setFormSubmission=Km,i.setFormSubmissionAttachment=zm,i.setFormSubmissionAttachments=qm,i.setFormSubmissions=Ym,i.setForms=_m,i.setGeoImage=cy,i.setGeoImages=ry,i.setIssue=gf,i.setIssueAssociation=Iy,i.setIssueAssociations=Ty,i.setIssueAttachment=Dy,i.setIssueAttachments=jy,i.setIssueComment=pf,i.setIssueCommentAttachment=Xy,i.setIssueCommentAttachments=xy,i.setIssueComments=mf,i.setIssueType=RA,i.setIssueTypeAttachment=jf,i.setIssueTypeAttachments=$f,i.setIssueTypeFieldValues=pS,i.setIssueTypeFieldValuesAttachment=$S,i.setIssueTypeFieldValuesAttachments=CS,i.setIssueTypeFieldValuesMany=mS,i.setIssueTypeFields=bS,i.setIssueTypeFieldsAttachment=xf,i.setIssueTypeFieldsAttachments=eS,i.setIssueTypeFieldsMany=RS,i.setIssueTypeIdentifier=eA,i.setIssueTypeIdentifierValue=mA,i.setIssueTypeIdentifierValues=yA,i.setIssueTypeIdentifiers=tA,i.setIssueTypeStatus=UA,i.setIssueTypeStatuses=LA,i.setIssueTypes=MA,i.setIssueUpdate=xA,i.setIssueUpdates=ew,i.setIssues=Pf,i.setLoggedIn=Rh,i.setOrganization=Ww,i.setOrganizationAccess=Ow,i.setOrganizationAccesses=Fw,i.setOrganizations=Bw,i.setProject=NT,i.setProjectAccess=iT,i.setProjectAccesses=nT,i.setProjectAttachment=fT,i.setProjectAttachments=ST,i.setProjectFile=RT,i.setProjectFiles=MT,i.setProjects=LT,i.setRehydrated=kb,i.setTeam=TI,i.setTeamMembership=cI,i.setTeamMemberships=rI,i.setTeams=II,i.setTokens=DP,i.setUploadUrl=KP,i.setUser=uw,i.setUsers=lw,i.setWorkflow=zI,i.setWorkflowStep=__,i.setWorkflowStepAssignee=ZI,i.setWorkflowStepAssignees=QI,i.setWorkflowStepComment=uO,i.setWorkflowStepComments=oO,i.setWorkflowStepEvent=_O,i.setWorkflowStepEvents=gO,i.setWorkflowStepFieldValues=_F,i.setWorkflowStepFieldValuesAttachment=uF,i.setWorkflowStepFieldValuesAttachments=oF,i.setWorkflowStepFieldValuesMany=gF,i.setWorkflowStepFieldValuesReview=ZF,i.setWorkflowStepFieldValuesReviewRequest=qF,i.setWorkflowStepFieldValuesReviewRequests=DF,i.setWorkflowStepFieldValuesReviews=QF,i.setWorkflowStepFields=QO,i.setWorkflowStepFieldsAttachment=qO,i.setWorkflowStepFieldsAttachments=DO,i.setWorkflowStepFieldsMany=XO,i.setWorkflowStepReviewer=u_,i.setWorkflowStepReviewers=o_,i.setWorkflowSteps=g_,i.setWorkflowType=D_,i.setWorkflowTypes=j_,i.setWorkflows=qI,i.shallowEqual=Bg,i.slugify=Jg,i.spacesToDashesLower=Yg,i.teamMembershipReducer=hI,i.teamMembershipSlice=Xn,i.teamReducer=MI,i.teamSlice=xn,i.toFileNameSafeString=Kg,i.toUuidArray=V,i.toUuidIdRecord=Hg,i.truncate=Zg,i.updateAsset=Pl,i.updateAssetAttachment=pc,i.updateAssetAttachments=mc,i.updateAssetProcedure=jr,i.updateAssetProcedureStep=yl,i.updateAssetProcedureStepFieldValues=tl,i.updateAssetProcedureStepFieldValuesAttachment=Cd,i.updateAssetProcedureStepFieldValuesAttachments=Ud,i.updateAssetProcedureStepFieldValuesMany=sl,i.updateAssetProcedureStepFields=Md,i.updateAssetProcedureStepFieldsAttachment=yd,i.updateAssetProcedureStepFieldsAttachments=fd,i.updateAssetProcedureStepFieldsMany=kd,i.updateAssetProcedureSteps=fl,i.updateAssetProcedureType=xr,i.updateAssetProcedureTypeAttachment=bc,i.updateAssetProcedureTypeAttachments=Rc,i.updateAssetProcedureTypeFieldValues=Rr,i.updateAssetProcedureTypeFieldValuesAttachment=mr,i.updateAssetProcedureTypeFieldValuesAttachments=yr,i.updateAssetProcedureTypeFieldValuesMany=Mr,i.updateAssetProcedureTypeFields=tr,i.updateAssetProcedureTypeFieldsAttachment=Cc,i.updateAssetProcedureTypeFieldsAttachments=Uc,i.updateAssetProcedureTypeFieldsMany=sr,i.updateAssetProcedureTypes=ed,i.updateAssetProcedures=$r,i.updateAssetStage=iu,i.updateAssetStageCompletion=Ul,i.updateAssetStageCompletions=Ll,i.updateAssetStages=nu,i.updateAssetType=ah,i.updateAssetTypeAttachment=yu,i.updateAssetTypeAttachments=fu,i.updateAssetTypeFieldValues=So,i.updateAssetTypeFieldValuesAttachment=so,i.updateAssetTypeFieldValuesAttachments=io,i.updateAssetTypeFieldValuesMany=Ao,i.updateAssetTypeFields=Lu,i.updateAssetTypeFieldsAttachment=Mu,i.updateAssetTypeFieldsAttachments=ku,i.updateAssetTypeFieldsMany=Nu,i.updateAssetTypeIdentifier=Eo,i.updateAssetTypeIdentifierValue=Go,i.updateAssetTypeIdentifierValues=Ho,i.updateAssetTypeIdentifiers=vo,i.updateAssetTypeStatus=wh,i.updateAssetTypeStatuses=Th,i.updateAssetTypes=ch,i.updateAssets=bl,i.updateConversation=cc,i.updateConversations=iP,i.updateDocument=Zh,i.updateDocumentAttachment=zh,i.updateDocumentAttachments=qh,i.updateDocuments=Qh,i.updateEmailDomain=up,i.updateEmailDomains=op,i.updateForm=gm,i.updateFormIdentifier=bp,i.updateFormIdentifierValue=Cp,i.updateFormIdentifierValues=Up,i.updateFormIdentifiers=Rp,i.updateFormRevision=pm,i.updateFormRevisionAttachment=tm,i.updateFormRevisionAttachments=sm,i.updateFormRevisions=mm,i.updateFormSubmission=Zm,i.updateFormSubmissionAttachment=Dm,i.updateFormSubmissionAttachments=jm,i.updateFormSubmissions=Qm,i.updateForms=Pm,i.updateGeoImage=uy,i.updateGeoImages=oy,i.updateIssue=bf,i.updateIssueAssociation=Oy,i.updateIssueAssociations=Fy,i.updateIssueAttachment=$y,i.updateIssueAttachments=Cy,i.updateIssueComment=yf,i.updateIssueCommentAttachment=ef,i.updateIssueCommentAttachments=tf,i.updateIssueComments=ff,i.updateIssueType=kA,i.updateIssueTypeAttachment=Cf,i.updateIssueTypeAttachments=Uf,i.updateIssueTypeFieldValues=yS,i.updateIssueTypeFieldValuesAttachment=US,i.updateIssueTypeFieldValuesAttachments=LS,i.updateIssueTypeFieldValuesMany=fS,i.updateIssueTypeFields=MS,i.updateIssueTypeFieldsAttachment=tS,i.updateIssueTypeFieldsAttachments=sS,i.updateIssueTypeFieldsMany=kS,i.updateIssueTypeIdentifier=sA,i.updateIssueTypeIdentifierValue=fA,i.updateIssueTypeIdentifierValues=SA,i.updateIssueTypeIdentifiers=iA,i.updateIssueTypeStatus=NA,i.updateIssueTypeStatuses=GA,i.updateIssueTypes=EA,i.updateIssueUpdate=tw,i.updateIssueUpdates=sw,i.updateIssues=Rf,i.updateOrganization=jw,i.updateOrganizationAccess=_w,i.updateOrganizationAccesses=gw,i.updateOrganizations=Dw,i.updateProject=YT,i.updateProjectAccess=aT,i.updateProjectAccesses=cT,i.updateProjectAttachment=AT,i.updateProjectAttachments=wT,i.updateProjectFile=vT,i.updateProjectFiles=VT,i.updateProjects=KT,i.updateTeam=OI,i.updateTeamMembership=dI,i.updateTeamMemberships=lI,i.updateTeams=FI,i.updateUser=pw,i.updateUsers=hw,i.updateWorkflow=DI,i.updateWorkflowStep=P_,i.updateWorkflowStepAssignee=XI,i.updateWorkflowStepAssignees=xI,i.updateWorkflowStepComment=hO,i.updateWorkflowStepComments=pO,i.updateWorkflowStepEvent=PO,i.updateWorkflowStepEvents=bO,i.updateWorkflowStepFieldValues=PF,i.updateWorkflowStepFieldValuesAttachment=hF,i.updateWorkflowStepFieldValuesAttachments=pF,i.updateWorkflowStepFieldValuesMany=bF,i.updateWorkflowStepFieldValuesReview=XF,i.updateWorkflowStepFieldValuesReviewRequest=jF,i.updateWorkflowStepFieldValuesReviewRequests=$F,i.updateWorkflowStepFieldValuesReviews=xF,i.updateWorkflowStepFields=xO,i.updateWorkflowStepFieldsAttachment=jO,i.updateWorkflowStepFieldsAttachments=$O,i.updateWorkflowStepFieldsMany=eF,i.updateWorkflowStepReviewer=h_,i.updateWorkflowStepReviewers=p_,i.updateWorkflowSteps=b_,i.updateWorkflowType=$_,i.updateWorkflowTypes=C_,i.updateWorkflows=jI,i.useSelectorBuilder=Vg,i.userReducer=yw,i.userSlice=Dn,i.uuidObj=O,i.uuidObjSortFn=As,i.uuidSortFn=Ut,i.versioningReducer=EI,i.versioningSlice=kI,i.workflowReducer=GI,i.workflowSlice=ta,i.workflowStepAssigneeReducer=aO,i.workflowStepAssigneeSlice=sa,i.workflowStepCommentReducer=wO,i.workflowStepCommentSlice=ia,i.workflowStepEventReducer=VO,i.workflowStepEventSlice=na,i.workflowStepFieldValuesAttachmentReducer=wF,i.workflowStepFieldValuesAttachmentSlice=ua,i.workflowStepFieldValuesReducer=VF,i.workflowStepFieldValuesReviewReducer=a_,i.workflowStepFieldValuesReviewRequestReducer=HF,i.workflowStepFieldValuesReviewRequestSlice=ya,i.workflowStepFieldValuesReviewSlice=Aa,i.workflowStepFieldValuesSlice=ma,i.workflowStepFieldsAttachmentReducer=HO,i.workflowStepFieldsAttachmentSlice=aa,i.workflowStepFieldsReducer=cF,i.workflowStepFieldsSlice=la,i.workflowStepReducer=V_,i.workflowStepReviewerReducer=w_,i.workflowStepReviewerSlice=Ia,i.workflowStepSlice=Oa,i.workflowTypeReducer=K_,i.workflowTypeSlice=_a,Object.defineProperty(i,Symbol.toStringTag,{value:"Module"})});
|
|
13
|
+
external URLs and therefore not prepended with VITE_API_URL.`;throw new Error(p)}return await this.addCache(l),l}processPresignedUrl(e,n){if("warning"in n){if(n.warning==="already_uploaded")return Promise.resolve(void 0);throw console.error(n.warning),new Error(n.warning)}return this.enqueueRequest({url:n.url,description:"Upload file to S3",method:h.POST,isExternalUrl:!0,isAuthNeeded:!1,attachmentHash:e,blockers:[`s3-${n.fields.key}`],blocks:[e],s3url:n})}processPresignedUrls(e){const n={};for(const[a,c]of Object.entries(e))n[a]=this.processPresignedUrl(a,c);return n}async getFilePayload(e){const a={sha1:await Ct(e),file_type:e.type,extension:Na(e),size:e.size};return await this.client.files.addCache(e),a}}class tM extends k{constructor(){super(...arguments);m(this,"name","Form Identifier");m(this,"url","/form-identifiers");m(this,"actions",{addOne:Fp,addMany:_p,setOne:gp,setMany:Pp,updateOne:bp,updateMany:Rp,deleteOne:Mp,deleteMany:kp,initialize:Op});m(this,"selectors",{selectById:vp,selectByIds:Vp})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[u.form],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Expected form identifier with uuid ${e.uuid} to exist`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected form identifier with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{form__organization:e}},n);return this.dispatch(a(c)),c}}class sM extends k{constructor(){super(...arguments);m(this,"name","Form Identifier Value");m(this,"url","/form-identifier-values");m(this,"actions",{addOne:qp,addMany:Dp,setOne:jp,setMany:$p,updateOne:Cp,updateMany:Up,deleteOne:Lp,deleteMany:Np,initialize:zp});m(this,"selectors",{selectById:Hp,selectByIds:Kp})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[e.form_submission,e.form_identifier],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected form identifier value with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{form_submission__form_revision__form__organization:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class iM extends q{constructor(){super(...arguments);m(this,"name","Form Revision Attachment");m(this,"url","/form-revision-attachments");m(this,"actions",{addOne:Qp,addMany:Xp,setOne:xp,setMany:em,updateOne:tm,updateMany:sm,deleteOne:im,deleteMany:nm,initialize:Zp});m(this,"selectors",{selectById:cm,selectByIds:rm})}getId(e){return e.uuid}getBlockers(e){return[e.form_revision]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,form_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,form_revision:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,form_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,form_revision:c,file_sha1:r,file_name:d,file_extension:l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{form_revision__form__organization:e}},n);return this.dispatch(a(c)),c}}class nM extends k{constructor(){super(...arguments);m(this,"name","Form Revision");m(this,"url","/form-revisions");m(this,"actions",{addOne:Wi,addMany:zi,setOne:om,setMany:hm,updateOne:pm,updateMany:mm,deleteOne:qi,deleteMany:Di,initialize:um});m(this,"selectors",{selectById:ym,selectByIds:fm})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,u=new Date().toISOString(),p=O({...e,created_by:l,submitted_at:u});this.dispatch(a(p));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(p),blockers:[e.form],blocks:[p.uuid]});return y.then(T=>{this.dispatch(c(T))}).catch(()=>{this.dispatch(r(p.uuid))}),[p,y]}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{form__organization:e}},n);return this.dispatch(a(c)),c}}class aM extends k{constructor(){super(...arguments);m(this,"name","Form");m(this,"url","/forms");m(this,"actions",{addOne:Im,addMany:Om,setOne:Fm,setMany:_m,updateOne:gm,updateMany:Pm,deleteOne:bm,deleteMany:Rm,initialize:Tm});m(this,"selectors",{selectById:Em,selectByIds:vm})}add(e,n){var f;const{store:a}=this.client,{addOne:c,deleteOne:r}=this.actions,d=new Date().toISOString(),l=((f=a.getState().userReducer.currentUser)==null?void 0:f.id)??null,u=O({...e,submitted_at:d,created_by:l}),p=O({...n,form:u.uuid,submitted_at:d,created_by:l});this.dispatch(c(u)),this.dispatch(Wi(p));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:{...R(u),initial_revision:{uuid:p.uuid,submitted_at:p.submitted_at,title:p.title,description:p.description,fields:p.fields}},blockers:[],blocks:[u.uuid,p.uuid]});return y.catch(T=>{throw this.dispatch(r(u.uuid)),this.dispatch(qi(p.uuid)),T}),[u,p,y]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error("Expected form to exist");const u=sy(e)(d),p=Sm(e)(d);this.dispatch(a(e)),this.dispatch(Zi(V(u))),this.dispatch(Di(V(p)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(y){throw this.dispatch(c(l)),this.dispatch(zi(p)),this.dispatch(Ji(u)),y}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class cM extends q{constructor(){super(...arguments);m(this,"name","Form Submission Attachment");m(this,"url","/form-submission-attachments");m(this,"actions",{addOne:Wm,addMany:Li,setOne:zm,setMany:qm,updateOne:Dm,updateMany:jm,deleteOne:$m,deleteMany:Ni,initialize:Bm});m(this,"selectors",{selectById:Cm,selectByIds:Um})}getId(e){return e.uuid}getBlockers(e){return[e.form_submission]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,form_submission:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,form_submission:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,form_submission:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,form_submission:c,file_sha1:r,file_name:d,file_extension:l}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,r=n.getState(),d=Ki(e)(r);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{form_submission__form_revision__form__organization:e}},n)).flat();return this.dispatch(a(r)),r}}class rM extends k{constructor(){super(...arguments);m(this,"name","Form Submission");m(this,"url","/form-submissions");m(this,"actions",{addOne:Jm,addMany:Ji,setOne:Km,setMany:Ym,updateOne:Zm,updateMany:Qm,deleteOne:Xm,deleteMany:Zi,initialize:Hm});m(this,"selectors",{selectById:ey,selectByIds:ty})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,u=new Date().toISOString(),p=O({...e,created_by:l,submitted_at:u}),y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(p),blockers:[e.form_revision],blocks:[p.uuid]});return this.dispatch(a(p)),y.then(T=>{this.dispatch(c(T))}).catch(()=>{this.dispatch(r(p.uuid))}),[p,y]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),d=c(e.uuid)(r);if(!d)throw new Error(`Expected submission with uuid ${e.uuid} to exist`);const l={...d,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${l.uuid}/`,payload:e,blockers:[l.uuid],blocks:[l.uuid]});return u.then(p=>{this.dispatch(a(p))}).catch(()=>{this.dispatch(a(d))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected submission with uuid ${e} to exist`);const u=Lm(e)(d);this.dispatch(a(e)),this.dispatch(Ni(V(u)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(p){throw this.dispatch(c(l)),this.dispatch(Li(u)),p}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{limit:this.pageSize,paginate:!0,form_revision__form_organization:e}},n)).flat();return this.dispatch(a(r)),r}}class dM extends q{constructor(){super(...arguments);m(this,"name","Geo Image");m(this,"url","/geo-images");m(this,"actions",{addOne:dy,addMany:ly,setOne:cy,setMany:ry,updateOne:uy,updateMany:oy,deleteOne:hy,deleteMany:py,initialize:ay});m(this,"selectors",{selectById:yy,selectByIds:fy})}getId(e){return e.uuid}getBlockers(e){return[e.project]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_sha1:e.file_sha1,file_name:e.file_name,file_extension:e.file_extension,title:e.title,description:e.description,geo_marker:e.geo_marker,canvas_marker:e.canvas_marker,direction:e.direction,original_date:e.original_date,project:e.project}}buildBulkPayload(e){return{uuid:e.uuid,file_sha1:e.file_sha1,file_name:e.file_name,file_extension:e.file_extension,title:e.title,description:e.description,geo_marker:e.geo_marker,canvas_marker:e.canvas_marker,direction:e.direction,original_date:e.original_date,project:e.project}}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),d=c(e.uuid)(r);if(!d)throw new Error(`Geo image with uuid ${e.uuid} does not exist in the store`);const l={...d,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blocks:[e.uuid],blockers:[e.uuid]});return u.then(p=>{this.dispatch(a(p))}).catch(()=>{this.dispatch(a(d))}),[l,u]}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{project:e}},n);return this.dispatch(a(c)),c}}class lM extends k{constructor(){super(...arguments);m(this,"name","Issue Association");m(this,"url","/issue-associations");m(this,"actions",{addOne:_y,addMany:mt,setOne:Iy,setMany:Ty,updateOne:Oy,updateMany:Fy,deleteOne:gy,deleteMany:yt,initialize:wy});m(this,"selectors",{selectById:by,selectByIds:Ry})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=new Date().toISOString(),l=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,u=O({...e,submitted_at:d,created_by:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[e.associated_issue,...e.issue?[e.issue]:[],...e.asset?[e.asset]:[]],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Issue association with uuid ${e} not found in store.`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{associated_issue__project:e}},n)).flat();return this.dispatch(a(r)),r}}class uM extends q{constructor(){super(...arguments);m(this,"name","Issue Attachment");m(this,"url","/issue-attachments");m(this,"actions",{addOne:qy,addMany:sn,setOne:Dy,setMany:jy,updateOne:$y,updateMany:Cy,deleteOne:Uy,deleteMany:nn,initialize:zy});m(this,"selectors",{selectById:Gy,selectByIds:Hy})}getId(e){return e.uuid}getBlockers(e){return[e.issue]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,issue:e.issue}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,issue:e.issue}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{issue__project:e}},n)).flat();return this.dispatch(a(r)),r}}class oM extends q{constructor(){super(...arguments);m(this,"name","Issue Comment Attachment");m(this,"url","/issue-comment-attachments");m(this,"actions",{addOne:Zy,addMany:Qy,setOne:Xy,setMany:xy,updateOne:ef,updateMany:tf,deleteOne:sf,deleteMany:nf,initialize:Jy});m(this,"selectors",{selectById:cf,selectByIds:rf})}getId(e){return e.uuid}getBlockers(e){return[e.issue_comment]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,issue_comment:e.issue_comment}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,issue_comment:e.issue_comment}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{issue_comment__issue__project:e}},n)).flat();return this.dispatch(a(r)),r}}class hM extends k{constructor(){super(...arguments);m(this,"name","Issue Comment");m(this,"url","/issue-comments");m(this,"actions",{addOne:of,addMany:hf,setOne:pf,setMany:mf,updateOne:yf,updateMany:ff,deleteOne:Sf,deleteMany:Af,initialize:uf});m(this,"selectors",{selectById:wf,selectByIds:Tf})}add(e){const{store:n}=this.client,{addOne:a,updateOne:c,deleteOne:r}=this.actions,d=O({...e,author:n.getState().userReducer.currentUser.id,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[e.issue],blocks:[d.uuid]});return l.then(u=>{this.dispatch(c(u))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}update(e){const{store:n}=this.client,{updateOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Comment with uuid ${e.uuid} not found in store`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Comment with uuid ${e} not found in store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{setMany:a}=this.actions,r=(await this.listPaginated({queryParams:{issue__project:e}},n)).flat();return this.dispatch(a(r)),r}}class pM extends k{constructor(){super(...arguments);m(this,"name","Issue");m(this,"url","/issues");m(this,"actions",{addOne:_f,addMany:on,setOne:gf,setMany:Pf,updateOne:bf,updateMany:Rf,deleteOne:Mf,deleteMany:hn,initialize:Ff});m(this,"selectors",{selectById:Ef,selectByIds:vf})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=n.getState(),l=new Date().toISOString(),u=((f=d.userReducer.currentUser)==null?void 0:f.id)??null,p=O({...e,submitted_at:l,created_by:u});this.dispatch(a(p));const y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(p),blockers:[p.project,p.issue_type,p.status],blocks:[p.uuid]});return y.then(T=>{this.dispatch(c(T))}).catch(T=>{throw this.dispatch(r(p.uuid)),T}),[p,y]}update(e){var y;const{updateOne:n}=this.actions,{selectById:a}=this.selectors,c=this.client.store.getState(),r=a(e.uuid)(c);if(!r)throw new Error(`Attempting to update an issue with uuid ${e.uuid} that doesn't exist in the store`);const d={...r,...e};this.dispatch(n(d));const l={};for(const f of[$.TITLE,$.DESCRIPTION,$.STATUS,$.PRIORITY,$.ASSIGNED_TO,$.DUE_DATE])if(f in e&&e[f]!==r[f])switch(f){case $.PRIORITY:l[f]=e[f];break;case $.DUE_DATE:l[f]=e[f];break;case $.DESCRIPTION:l[f]=e[f];break;case $.TITLE:l[f]=e[f];break;case $.STATUS:{const T=e[f],P=kn(T)(c);if(!P)throw new Error(`Trying to update issue type status with ${T} which does not exist in store`);l[f]={name:P.name,color:P.color,uuid:P.uuid};break}case $.ASSIGNED_TO:{const T=e[f];if(T===null)l[f]=null;else{const P=cs(T)(c);if(!P)throw new Error(`Trying to update assigned to with ${T} which does not exist in store.`);l[f]={full_name:P.username,id:P.id}}break}}const u=O({created_by:((y=c.userReducer.currentUser)==null?void 0:y.id)??null,submitted_at:new Date().toISOString(),issue:r.uuid,changes:l});this.dispatch(vn(u));const p=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return p.then(f=>{this.dispatch(n(f))}).catch(()=>{this.dispatch(n(r)),this.dispatch(Bn(u.uuid))}),[d,p]}bulkUpdate(e,n){const{store:a}=this.client,{updateMany:c}=this.actions,{selectByIds:r}=this.selectors,d=V(e).toSorted(Ut);if(d.length!==e.length)throw new Error("payloads contains duplicate uuids.");const l=r(d)(a.getState()).toSorted(As);if(d.length!=l.length)throw new Error(`Attempting to bulk update ${d.length-l.length} issues that dont exist in the store`);const u=[];for(let T=0;T<d.length;T++)u.push({...l[T],...e[T]});this.dispatch(c(u));const p=pt(e,Math.min(n??e.length,ut)),y=[];let f=null;for(const T of p){const P=ot.v4(),E=V(T),g=T.map(({status:b})=>b).filter(Boolean),M=this.enqueueRequest({description:w(h.PATCH,this.name,!0),method:h.PATCH,url:`${this.url}/bulk/`,payload:{payloads:T},blockers:(f?[f]:[]).concat(E).concat(g),blocks:[P].concat(E)});y.push(M),f=P}return Promise.all(y).then(T=>{this.dispatch(c(T.flat()))}).catch(()=>{this.dispatch(c(l))}),[u,y]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`No issue with uuid ${e} found in the store`);const u=My(e)(d),p=vy(e)(d),y=Ny(e)(d),f=aw(e)(d);this.dispatch(a(e)),this.dispatch(nn(V(y))),this.dispatch(Wn(V(f))),this.dispatch(yt(V(u))),this.dispatch(yt(V(p)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(T){throw this.dispatch(c(l)),this.dispatch(sn(y)),this.dispatch(Vn(f)),this.dispatch(mt(u)),this.dispatch(mt(p)),T}}async bulkDelete(e){const{store:n}=this.client,{addMany:a,deleteMany:c}=this.actions,{selectByIds:r}=this.selectors,d=n.getState(),l=r(e)(d),u=ky(e)(d),p=Ey(e)(d);this.dispatch(c(e)),this.dispatch(yt(V(u))),this.dispatch(yt(V(p)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(y){throw this.dispatch(a(l)),this.dispatch(mt(u)),this.dispatch(mt(p)),y}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{project:e}},n)).flat();return this.dispatch(a(r)),r}}class mM extends q{constructor(){super(...arguments);m(this,"name","Issue Type Attachment");m(this,"url","/issue-type-attachments");m(this,"actions",{addOne:qf,addMany:Df,setOne:jf,setMany:$f,updateOne:Cf,updateMany:Uf,deleteOne:Lf,deleteMany:Nf,initialize:zf});m(this,"selectors",{selectById:Hf,selectByIds:Kf})}getId(e){return e.uuid}getBlockers(e){return[e.issue_type]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,issue_type:e.issue_type}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,issue_type:e.issue_type}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{issue_type__organization:e}},n);return this.dispatch(a(c)),c}}class yM extends q{constructor(){super(...arguments);m(this,"name","Issue Type Fields Attachment");m(this,"url","/issue-type-fields-attachments");m(this,"actions",{addOne:Qf,addMany:Xf,setOne:xf,setMany:eS,updateOne:tS,updateMany:sS,deleteOne:iS,deleteMany:nS,initialize:Zf});m(this,"selectors",{selectById:cS,selectByIds:rS})}getId(e){return e.uuid}getBlockers(e){return[e.fields_revision]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{fields_revision__issue_type__organization:e}},n);return this.dispatch(a(c)),c}}class fM extends k{constructor(){super(...arguments);m(this,"name","Issue Type Fields");m(this,"url","/issue-type-fields");m(this,"actions",{addOne:gS,addMany:PS,setOne:bS,setMany:RS,updateOne:MS,updateMany:kS,deleteOne:ES,deleteMany:vS,initialize:_S});m(this,"selectors",{selectById:BS,selectByIds:WS})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[u.issue_type],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(f=>{throw this.dispatch(r(u.uuid)),f}),[u,p]}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{issue_type__organization:e}},n);return this.dispatch(a(c)),c}}class SM extends q{constructor(){super(...arguments);m(this,"name","Issue Type Field Values Attachment");m(this,"url","/issue-type-field-values-attachments");m(this,"actions",{addOne:jS,addMany:Tn,setOne:$S,setMany:CS,updateOne:US,updateMany:LS,deleteOne:NS,deleteMany:In,initialize:DS});m(this,"selectors",{selectById:HS,selectByIds:KS})}getId(e){return e.uuid}getBlockers(e){return[e.field_values]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,d=n.getState(),l=r(e)(d);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{field_values__issue__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class AM extends k{constructor(){super(...arguments);m(this,"name","Issue Type Field Values");m(this,"url","/issue-type-field-values");m(this,"actions",{addOne:oS,addMany:hS,setOne:pS,setMany:mS,updateOne:yS,updateMany:fS,deleteOne:SS,deleteMany:AS,initialize:uS});m(this,"selectors",{selectById:TS,selectByIds:IS})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,u=new Date().toISOString(),p=O({...e,created_by:l,submitted_at:u}),y=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(p),blockers:[e.issue,e.fields_revision],blocks:[p.uuid]});return this.dispatch(a(p)),y.then(T=>{this.dispatch(c(T))}).catch(()=>{this.dispatch(r(p.uuid))}),[p,y]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),d=c(e.uuid)(r);if(!d)throw new Error(`Expected IssueTypeFieldValues with uuid ${e.uuid} to exist`);const l={...d,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[l.uuid,l.fields_revision,l.issue],blocks:[l.uuid]});return u.then(p=>{this.dispatch(a(p))}).catch(()=>{this.dispatch(a(d))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected submission with uuid ${e} to exist`);const u=YS(e)(d);this.dispatch(a(e)),this.dispatch(In(V(u)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(p){throw this.dispatch(c(l)),this.dispatch(Tn(u)),p}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{issue__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class wM extends k{constructor(){super(...arguments);m(this,"name","Issue Type Identifier");m(this,"url","/issue-type-identifiers");m(this,"actions",{addOne:XS,addMany:xS,setOne:eA,setMany:tA,updateOne:sA,updateMany:iA,deleteOne:nA,deleteMany:aA,initialize:QS});m(this,"selectors",{selectById:rA,selectByIds:dA})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[u.issue_type],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Expected issue type identifier with uuid ${e.uuid} to exist`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected issue type identifier with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{issue_type__organization:e}},n);return this.dispatch(a(c)),c}}class TM extends k{constructor(){super(...arguments);m(this,"name","Issue Type Identifier Value");m(this,"url","/issue-type-identifier-values");m(this,"actions",{addOne:hA,addMany:pA,setOne:mA,setMany:yA,updateOne:fA,updateMany:SA,deleteOne:AA,deleteMany:wA,initialize:oA});m(this,"selectors",{selectById:IA,selectByIds:OA})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[e.issue,e.issue_type_identifier],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected issue type identifier value with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{issue__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class IM extends k{constructor(){super(...arguments);m(this,"name","Issue Type");m(this,"url","/issue-types");m(this,"actions",{addOne:PA,addMany:bA,setOne:RA,setMany:MA,updateOne:kA,updateMany:EA,deleteOne:vA,deleteMany:VA,initialize:gA});m(this,"selectors",{selectById:WA,selectByIds:zA})}add(e){var f;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,l=((f=n.getState().userReducer.currentUser)==null?void 0:f.id)??null,u=new Date().toISOString(),p=O({...e,submitted_at:u,created_by:l});this.dispatch(a(p));const y=this.enqueueRequest({method:h.POST,url:`${this.url}/`,payload:R(p),blockers:[],blocks:[p.uuid]});return y.then(T=>{this.dispatch(c(T))}).catch(()=>{this.dispatch(r(p.uuid))}),[p,y]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),d=c(e.uuid)(r);if(!d)throw new Error(`IssueType with uuid ${e.uuid} does not exist in the store.`);const l={...d,...e};this.dispatch(a(l));const u=this.enqueueRequest({method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return u.then(p=>{this.dispatch(a(p))}).catch(()=>{this.dispatch(a(d))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,setOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`IssueType with uuid ${e} does not exist in the store.`);const u=Vf(e)(d);this.dispatch(a(e)),this.dispatch(hn(V(u)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(p){throw this.dispatch(c(l)),this.dispatch(on(u)),p}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class OM extends k{constructor(){super(...arguments);m(this,"name","Issue Type Status");m(this,"url","/issue-type-statuses");m(this,"actions",{addOne:$A,addMany:CA,setOne:UA,setMany:LA,updateOne:NA,updateMany:GA,deleteOne:HA,deleteMany:KA,initialize:jA});m(this,"selectors",{selectById:kn,selectByIds:JA})}add(e){var y;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=O({...e,created_by:d,submitted_at:l});this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(u),blockers:[e.issue_type],blocks:[u.uuid]});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.uuid))}),[u,p]}update(e){const{setOne:n}=this.actions,{selectById:a}=this.selectors,c=this.client.store.getState(),r=a(e.uuid)(c);if(!r)throw new Error(`Expected an existing issue type status with uuid ${e.uuid}`);const d={...r,...e};this.dispatch(n(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(n(u))}).catch(()=>{this.dispatch(n(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`No issue type status with uuid ${e} found in the store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{issue_type__organization:e}},n);return this.dispatch(a(c)),c}}class FM extends k{constructor(){super(...arguments);m(this,"name","Issue Update");m(this,"url","/issue-updates");m(this,"actions",{addOne:vn,addMany:Vn,setOne:xA,setMany:ew,updateOne:tw,updateMany:sw,deleteOne:Bn,deleteMany:Wn,initialize:XA});m(this,"selectors",{selectById:iw,selectByIds:nw})}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{issue__project:e}},n)).flat();return this.dispatch(a(r)),r}}const _M=1800;function gM(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 PM extends FR{constructor(){super(...arguments);m(this,"_getRenewedTokens",async e=>{const n=this.performRequest({method:h.POST,url:this.refreshTokensUrl,payload:{refresh:e},isAuthNeeded:!1,checkAuth:!1});let a;try{a=await n}catch(c){console.error("Could not renew tokens; clearing auth",c),this.clearAuth();return}if(!a.access)throw new Error("Missing access token");return{accessToken:a.access,refreshToken:a.refresh??this.getRefreshToken()}})}clearAuth(){console.debug(this.constructor.name,"clearing auth;"),this.dispatch(Rh(!1)),this.clearTokens(),this.dispatch(I()),this.dispatch(I())}async renewTokens(){const e=this.getRefreshToken();if(!e)throw new Error("No refresh token found");console.debug(this.constructor.name,"renewing tokens");try{const n=await this._getRenewedTokens(e);if(!n)return;console.debug("Got renewed tokens"),this.setTokens(n)}catch(n){throw console.error("Could not renew tokens; clearing auth",n),this.clearAuth(),n}}tokenIsExpiringSoon(){const e=this.getAccessToken();if(!e)return!1;const n=Date.now()/1e3;let a;try{a=bg(e).exp??n}catch{a=n}return a-n<_M}getAuthHeader(){return`Bearer ${this.getAccessToken()}`}async prepareAuth(){if(this.tokenIsExpiringSoon()){console.debug(this.constructor.name,"preparing auth");try{await this.renewTokens()}catch(e){return e instanceof C&&this.clearAuth(),e instanceof Error?Promise.reject(e):Promise.reject(new Error((e??Ot).toString()))}}}async handleUnauthorized(e,n){const a=this.client.store.getState();if(e.url.endsWith("/token/refresh/"))throw a.authReducer.isLoggedIn&&console.warn("No signed-in user to sign out."),this.clearAuth(),new C({message:"You have been signed out due to inactivity.",response:n,discard:!0});if(a.authReducer.isLoggedIn)await this.renewTokens();else throw console.debug("Forbidden; user is not logged in."),new C({message:"Incorrect username or password.",response:n,discard:!0})}async initAuth(e){const n=ot.v4();return console.debug(this.constructor.name,"Initiating auth"),this.performRequest({uuid:n,method:h.POST,url:this.initTokensUrl,payload:e,isAuthNeeded:!1,checkAuth:!1}).then(a=>{this.setTokens(gM(a))})}}class bM extends At{constructor(){super(...arguments);m(this,"name","Organization Access");m(this,"url","/organization-accesses");m(this,"actions",{addOne:Tw,addMany:Iw,setOne:Ow,setMany:Fw,updateOne:_w,updateMany:gw,deleteOne:Pw,deleteMany:bw,initialize:ww});m(this,"selectors",{selectById:Mw,selectByIds:kw})}update(e){const{store:n}=this.client,{updateOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState()),d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(u=>{throw this.dispatch(a(r)),u}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d),u=cs(l.user)(d);this.dispatch(a(l.uuid)),this.dispatch($n(l.user));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${l.uuid}/`,blockers:[l.uuid],blocks:[]})}catch(p){throw this.dispatch(c(l)),this.dispatch(jn(u)),p}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class RM extends At{constructor(){super(...arguments);m(this,"name","Organization");m(this,"url","/organizations");m(this,"actions",{addOne:qw,addMany:zw,setOne:Ww,setMany:Bw,updateOne:jw,updateMany:Dw,deleteOne:$w,deleteMany:Cw,initialize:Vw});m(this,"selectors",{selectById:Nw,selectByIds:Gw})}async add(e){const{addOne:n}=this.actions,a=await this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:e,blockers:[],blocks:[]});return this.dispatch(n(a)),a}async update(e){const{setOne:n}=this.actions,a=await this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return this.dispatch(n(a)),a}async invite(e,n){return this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/${e}/invite/${n}/`,blockers:[],blocks:[]})}async refreshStore(e){const{initialize:n}=this.actions,a=await this.list({},e);return this.dispatch(n(a)),a}}class MM extends k{constructor(){super(...arguments);m(this,"name","Project Access");m(this,"url","/project-accesses");m(this,"actions",{addOne:tT,addMany:sT,setOne:iT,setMany:nT,updateOne:aT,updateMany:cT,deleteOne:rT,deleteMany:dT,initialize:eT});m(this,"selectors",{selectById:uT,selectByIds:oT})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.organization_access,d.project],blocks:[d.uuid]});return l.then(p=>{this.dispatch(c(p))}).catch(p=>{throw this.dispatch(r(d.uuid)),p}),[d,l]}bulkAdd(e){var p;const{store:n}=this.client,{addMany:a,deleteMany:c,updateMany:r}=this.actions,d=((p=n.getState().userReducer.currentUser)==null?void 0:p.id)??null,l=e.map(y=>O({...y,created_by:d}));this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:{project_accesses:l.map(y=>R(y))},blockers:l.flatMap(y=>[y.project,y.organization_access]),blocks:l.map(y=>y.uuid)});return u.then(y=>{this.dispatch(r(y))}).catch(y=>{throw this.dispatch(c(l.map(f=>f.uuid))),y}),[l,u]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState()),d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[]});return l.then(u=>{this.dispatch(a(u))}).catch(u=>{throw this.dispatch(a(r)),u}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{project__organization:e}},n);return this.dispatch(a(c)),c}}class kM extends q{constructor(){super(...arguments);m(this,"name","Project Attachment");m(this,"url","/project-attachments");m(this,"actions",{addOne:mT,addMany:yT,setOne:fT,setMany:ST,updateOne:AT,updateMany:wT,deleteOne:TT,deleteMany:IT,initialize:pT});m(this,"selectors",{selectById:FT,selectByIds:_T})}getId(e){return e.uuid}getBlockers(e){return[e.project]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,project:e.project}}buildBulkPayload(e){return{uuid:e.uuid,file_name:e.file_name,file_sha1:e.file_sha1,file_extension:e.file_extension,project:e.project}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{project__organization:e}},n);return this.dispatch(a(c)),c}}class EM extends q{constructor(){super(...arguments);m(this,"name","Project File");m(this,"url","/project-files");m(this,"actions",{addOne:kT,addMany:ET,setOne:RT,setMany:MT,updateOne:vT,updateMany:VT,deleteOne:BT,deleteMany:WT,initialize:bT});m(this,"selectors",{selectById:DT,selectByIds:jT})}getId(e){return e.uuid}getBlockers(e){return[e.project]}getBlocks(e){return[e.uuid]}buildModel(e){var r;const{store:n}=this.client,a=((r=n.getState().userReducer.currentUser)==null?void 0:r.id)??null,c=new Date().toISOString();return O({...e,created_by:a,submitted_at:c})}buildPayload(e){return{uuid:e.uuid,submitted_at:e.submitted_at,file_sha1:e.file_sha1,file_name:e.file_name,file_extension:e.file_extension,project:e.project,z_index:e.z_index,canvas_bounds:e.canvas_bounds,bounds:e.bounds}}buildBulkPayload(e){return{uuid:e.uuid,file_sha1:e.file_sha1,file_name:e.file_name,file_extension:e.file_extension,project:e.project,z_index:e.z_index,canvas_bounds:e.canvas_bounds,bounds:e.bounds}}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),d=c(e.uuid)(r);if(!d)throw new Error(`${this.name} with uuid ${e.uuid} does not exist in the store`);const l={...d,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blocks:[e.uuid],blockers:[e.uuid]});return u.then(p=>{this.dispatch(a(p))}).catch(()=>{this.dispatch(a(d))}),[l,u]}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{project:e}},n)).flat();return this.dispatch(a(r)),r}}class vM extends At{constructor(){super(...arguments);m(this,"name","Project");m(this,"url","/projects");m(this,"actions",{addOne:HT,addMany:GT,setOne:NT,setMany:LT,updateOne:YT,updateMany:KT,deleteOne:JT,deleteMany:ZT,initialize:UT});m(this,"selectors",{selectById:xT,selectByIds:eI})}async add(e){const{addOne:n}=this.actions,a=await this.performRequest({method:h.POST,url:`${this.url}/`,payload:R(e)});return this.dispatch(n(a)),a}async update(e){const{updateOne:n}=this.actions,a=await this.performRequest({method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:R(e)});return this.dispatch(n(a)),a}async delete(e){const{deleteOne:n}=this.actions,a=await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]});return this.dispatch(n(e)),a}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class VM extends k{constructor(){super(...arguments);m(this,"name","Team Membership");m(this,"url","/team-memberships");m(this,"actions",{addOne:nI,addMany:aI,setOne:cI,setMany:rI,updateOne:dI,updateMany:lI,deleteOne:uI,deleteMany:oI,initialize:iI});m(this,"selectors",{selectById:mI,selectByIds:yI})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[e.team],blocks:[d.uuid]});return l.then(p=>{this.dispatch(c(p))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}bulkAdd(e){var p;const{store:n}=this.client,{addMany:a,setMany:c,deleteMany:r}=this.actions,d=((p=n.getState().userReducer.currentUser)==null?void 0:p.id)??null,l=e.map(y=>O({...y,created_by:d}));this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:{team_memberships:l.map(y=>R(y))},blockers:l.map(y=>y.team),blocks:l.map(y=>y.uuid)});return u.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(l.map(y=>y.uuid)))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,setOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected team membership with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{team__organization:e}},n);return this.dispatch(a(c)),c}}class BM extends k{constructor(){super(...arguments);m(this,"name","Team");m(this,"url","/teams");m(this,"actions",{addOne:AI,addMany:wI,setOne:TI,setMany:II,updateOne:OI,updateMany:FI,deleteOne:_I,deleteMany:gI,initialize:SI});m(this,"selectors",{selectById:bI,selectByIds:RI})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...e,submitted_at:new Date().toISOString(),created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[],blocks:[d.uuid]});return l.then(p=>{this.dispatch(c(p))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Expected team with uuid ${e.uuid} to exist`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:R(e),blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,setOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected team with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[e]})}catch(u){throw this.dispatch(c(l)),u}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}class WM extends At{constructor(){super(...arguments);m(this,"name","User");m(this,"url","/user");m(this,"actions",{addOne:jn,addMany:ow,setOne:uw,setMany:lw,updateOne:pw,updateMany:hw,deleteOne:$n,deleteMany:mw,initialize:dw});m(this,"selectors",{selectById:cs,selectByIds:Sw})}async list(e,n){const{organizationUuid:a,...c}=e,r=a?`/organizations/${a}${this.url}s/`:`/${this.url}`;return this.performRequest({method:h.GET,url:r,...c},n)}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({organizationUuid:e},n);return this.dispatch(a(c)),c}}class zM extends k{constructor(){super(...arguments);m(this,"name","Workflow");m(this,"url","/workflows");m(this,"actions",{addOne:BI,addMany:WI,setOne:zI,setMany:qI,updateOne:DI,updateMany:jI,deleteOne:$I,deleteMany:CI,initialize:VI});m(this,"selectors",{selectById:LI,selectByIds:NI})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.workflow_type,d.project],blocks:[d.uuid]});return l.then(p=>{this.dispatch(c(p))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}update(e){const{store:n}=this.client,{updateOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Expected workflow with uuid ${e.uuid} to exist`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[r.uuid,d.workflow_type,d.project],blocks:[r.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Expected workflow with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{project:e}},n)).flat();return this.dispatch(a(r)),r}}class qM extends k{constructor(){super(...arguments);m(this,"name","Workflow Step Assignee");m(this,"url","/workflow-step-assignees");m(this,"actions",{addOne:YI,addMany:JI,setOne:ZI,setMany:QI,updateOne:XI,updateMany:xI,deleteOne:eO,deleteMany:tO,initialize:KI});m(this,"selectors",{selectById:iO,selectByIds:nO})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.workflow,d.workflow_step],blocks:[d.uuid]});return l.then(p=>{this.dispatch(c(p))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}bulkAdd(e){var y;const{store:n}=this.client,{addMany:a,setMany:c,deleteMany:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=e.map(f=>O({...f,created_by:d,submitted_at:l}));this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:{workflow_step_assignees:u.map(f=>R(f)),submitted_at:l},blockers:u.flatMap(f=>[f.workflow,f.workflow_step]),blocks:u.map(f=>f.uuid)});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(V(u)))}),[u,p]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Expected workflow step assignee with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,d=r(e)(n.getState());this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{workflow__project:e}},n)).flat();return this.dispatch(a(r)),r}}class DM extends k{constructor(){super(...arguments);m(this,"name","Workflow Step Comment");m(this,"url","/workflow-step-comments");m(this,"actions",{addOne:dO,addMany:lO,setOne:uO,setMany:oO,updateOne:hO,updateMany:pO,deleteOne:mO,deleteMany:yO,initialize:rO});m(this,"selectors",{selectById:SO,selectByIds:AO})}add(e){var u;const{store:n}=this.client,{addOne:a,updateOne:c,deleteOne:r}=this.actions,d=O({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.workflow,d.workflow_step],blocks:[d.uuid]});return l.then(p=>{this.dispatch(c(p))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}update(e){const{store:n}=this.client,{updateOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Workflow step comment with uuid ${e.uuid} not found in store`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Workflow step comment with uuid ${e} not found in store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{workflow__project:e}},n)).flat();return this.dispatch(a(r)),r}}class jM extends At{constructor(){super(...arguments);m(this,"name","Workflow Step Event");m(this,"url","/workflow-step-events");m(this,"actions",{addOne:OO,addMany:FO,setOne:_O,setMany:gO,updateOne:PO,updateMany:bO,deleteOne:RO,deleteMany:MO,initialize:IO});m(this,"selectors",{selectById:EO,selectByIds:vO})}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{workflow__project:e}},n)).flat();return this.dispatch(a(r)),r}}class $M extends q{constructor(){super(...arguments);m(this,"name","Workflow Step Fields Attachment");m(this,"url","/workflow-step-fields-attachments");m(this,"actions",{addOne:zO,addMany:ca,setOne:qO,setMany:DO,updateOne:jO,updateMany:$O,deleteOne:CO,deleteMany:ra,initialize:WO});m(this,"selectors",{selectById:NO,selectByIds:GO})}getId(e){return e.uuid}getBlockers(e){return[e.fields_revision]}getBlocks(e){return[e.uuid]}buildModel(e){var a;const{store:n}=this.client;return O({...e,created_by:((a=n.getState().userReducer.currentUser)==null?void 0:a.id)??null,submitted_at:new Date().toISOString()})}buildPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,fields_revision:c,file_sha1:r,file_name:d,file_extension:l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{fields_revision__workflow_step__workflow_type__organization:e}},n);return this.dispatch(a(c)),c}}class CM extends k{constructor(){super(...arguments);m(this,"name","Workflow Step Fields");m(this,"url","/workflow-step-fields");m(this,"actions",{addOne:JO,addMany:ZO,setOne:QO,setMany:XO,updateOne:xO,updateMany:eF,deleteOne:tF,deleteMany:sF,initialize:YO});m(this,"selectors",{selectById:nF,selectByIds:aF})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.workflow_step],blocks:[d.uuid]});return l.then(p=>{this.dispatch(c(p))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected workflow step fields with uuid ${e} to exist`);const u=LO(e)(d);this.dispatch(a(e)),this.dispatch(ra(V(u)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(p){throw this.dispatch(c(l)),this.dispatch(ca(u)),p}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{workflow_step__workflow_type__organization:e}},n);return this.dispatch(a(c)),c}}class UM extends q{constructor(){super(...arguments);m(this,"name","Workflow Step Field Values Attachment");m(this,"url","/workflow-step-field-values-attachments");m(this,"actions",{addOne:lF,addMany:oa,setOne:uF,setMany:oF,updateOne:hF,updateMany:pF,deleteOne:mF,deleteMany:ha,initialize:dF});m(this,"selectors",{selectById:fF,selectByIds:SF})}getId(e){return e.uuid}getBlockers(e){return[e.field_values]}getBlocks(e){return[e.uuid]}buildModel(e){var a;const{store:n}=this.client;return O({...e,created_by:((a=n.getState().userReducer.currentUser)==null?void 0:a.id)??null,submitted_at:new Date().toISOString()})}buildPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,submitted_at:e.submitted_at,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}buildBulkPayload(e){const{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}=e;return{uuid:n,field_identifier:a,field_values:c,file_sha1:r,file_name:d,file_extension:l}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,d=r(e)(n.getState());this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{field_values__workflow__project:e,latest:!0}},n)).flat();return this.dispatch(a(r)),r}}class LM extends k{constructor(){super(...arguments);m(this,"name","Workflow Step Field Values Review Request");m(this,"url","/workflow-step-field-values-review-requests");m(this,"actions",{addOne:zF,addMany:fa,setOne:qF,setMany:DF,updateOne:jF,updateMany:$F,deleteOne:CF,deleteMany:Sa,initialize:WF});m(this,"selectors",{selectById:LF,selectByIds:NF})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.field_values],blocks:[d.uuid]});return l.then(p=>{this.dispatch(c(p))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Workflow step field values review request with uuid ${e} not found in store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{field_values__workflow__project:e}},n)).flat();return this.dispatch(a(r)),r}}class NM extends k{constructor(){super(...arguments);m(this,"name","Workflow Step Field Values Review");m(this,"url","/workflow-step-field-values-reviews");m(this,"actions",{addOne:JF,addMany:wa,setOne:ZF,setMany:QF,updateOne:XF,updateMany:xF,deleteOne:e_,deleteMany:Ta,initialize:YF});m(this,"selectors",{selectById:s_,selectByIds:i_})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.field_values],blocks:[d.uuid]});return l.then(p=>{this.dispatch(c(p))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Workflow step field values review with uuid ${e.uuid} not found in store`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[e.uuid],blocks:[e.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Workflow step field values review with uuid ${e} not found in store`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{field_values__workflow__project:e}},n)).flat();return this.dispatch(a(r)),r}}class GM extends k{constructor(){super(...arguments);m(this,"name","Workflow Step Field Values");m(this,"url","/workflow-step-field-values");m(this,"actions",{addOne:OF,addMany:FF,setOne:_F,setMany:gF,updateOne:PF,updateMany:bF,deleteOne:RF,deleteMany:MF,initialize:IF});m(this,"selectors",{selectById:EF,selectByIds:vF})}add(e){var p;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=n.getState(),l=O({...e,created_by:((p=d.userReducer.currentUser)==null?void 0:p.id)??null,submitted_at:new Date().toISOString()}),u=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(l),blockers:[e.workflow,e.workflow_step,e.fields_revision],blocks:[l.uuid]});return this.dispatch(a(l)),u.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(l.uuid))}),[l,u]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=n.getState(),d=c(e.uuid)(r);if(!d)throw new Error(`Expected WorkflowStepFieldValues with uuid ${e.uuid} to exist`);const l={...d,...e};this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[l.uuid,l.workflow,l.workflow_step,l.fields_revision],blocks:[l.uuid]});return u.then(p=>{this.dispatch(a(p))}).catch(()=>{this.dispatch(a(d))}),[l,u]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=n.getState(),l=r(e)(d);if(!l)throw new Error(`Expected WorkflowStepFieldValues with uuid ${e} to exist`);const u=AF(e)(d),p=n_(e)(d),y=GF(e)(d);this.dispatch(a(e)),this.dispatch(ha(V(u))),this.dispatch(Ta(V(p))),this.dispatch(Sa(V(y)));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(f){throw this.dispatch(c(l)),this.dispatch(oa(u)),this.dispatch(wa(p)),this.dispatch(fa(y)),f}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{workflow__project:e}},n)).flat();return this.dispatch(a(r)),r}}class HM extends k{constructor(){super(...arguments);m(this,"name","Workflow Step Reviewer");m(this,"url","/workflow-step-reviewers");m(this,"actions",{addOne:d_,addMany:l_,setOne:u_,setMany:o_,updateOne:h_,updateMany:p_,deleteOne:m_,deleteMany:y_,initialize:r_});m(this,"selectors",{selectById:S_,selectByIds:A_})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.workflow,d.workflow_step],blocks:[d.uuid]});return l.then(p=>{this.dispatch(c(p))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}bulkAdd(e){var y;const{store:n}=this.client,{addMany:a,setMany:c,deleteMany:r}=this.actions,d=((y=n.getState().userReducer.currentUser)==null?void 0:y.id)??null,l=new Date().toISOString(),u=e.map(f=>O({...f,created_by:d,submitted_at:l}));this.dispatch(a(u));const p=this.enqueueRequest({description:w(h.POST,this.name,!0),method:h.POST,url:`${this.url}/bulk/`,payload:{workflow_step_reviewers:u.map(f=>R(f)),submitted_at:l},blockers:u.flatMap(f=>[f.workflow,f.workflow_step]),blocks:u.map(f=>f.uuid)});return p.then(f=>{this.dispatch(c(f))}).catch(()=>{this.dispatch(r(u.map(f=>f.uuid)))}),[u,p]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Expected workflow step reviewer with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async bulkDelete(e){const{store:n}=this.client,{deleteMany:a,addMany:c}=this.actions,{selectByIds:r}=this.selectors,d=r(e)(n.getState());this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!0),method:h.DELETE,url:`${this.url}/bulk/`,payload:{uuids:e},blockers:e,blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,r=(await this.listPaginated({queryParams:{workflow__project:e}},n)).flat();return this.dispatch(a(r)),r}}class KM extends k{constructor(){super(...arguments);m(this,"name","Workflow Step");m(this,"url","/workflow-steps");m(this,"actions",{addOne:O_,addMany:F_,setOne:__,setMany:g_,updateOne:P_,updateMany:b_,deleteOne:R_,deleteMany:M_,initialize:I_});m(this,"selectors",{selectById:E_,selectByIds:v_})}add(e){var u;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=O({...e,created_by:((u=n.getState().userReducer.currentUser)==null?void 0:u.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(d),blockers:[d.workflow_type],blocks:[d.uuid]});return l.then(p=>{this.dispatch(c(p))}).catch(()=>{this.dispatch(r(d.uuid))}),[d,l]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Expected workflow step with uuid ${e.uuid} to exist`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[r.uuid,d.workflow_type],blocks:[r.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Expected workflow step with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{workflow_type__organization:e}},n);return this.dispatch(a(c)),c}}class YM extends k{constructor(){super(...arguments);m(this,"name","Workflow Type");m(this,"url","/workflow-types");m(this,"actions",{addOne:z_,addMany:q_,setOne:D_,setMany:j_,updateOne:$_,updateMany:C_,deleteOne:U_,deleteMany:L_,initialize:W_});m(this,"selectors",{selectById:G_,selectByIds:H_})}add(e){var p;const{store:n}=this.client,{addOne:a,setOne:c,deleteOne:r}=this.actions,d=n.getState(),l=O({...e,created_by:((p=d.userReducer.currentUser)==null?void 0:p.id)??null,submitted_at:new Date().toISOString()});this.dispatch(a(l));const u=this.enqueueRequest({description:w(h.POST,this.name,!1),method:h.POST,url:`${this.url}/`,payload:R(l),blockers:[],blocks:[l.uuid]});return u.then(y=>{this.dispatch(c(y))}).catch(()=>{this.dispatch(r(l.uuid))}),[l,u]}update(e){const{store:n}=this.client,{setOne:a}=this.actions,{selectById:c}=this.selectors,r=c(e.uuid)(n.getState());if(!r)throw new Error(`Expected workflow type with uuid ${e.uuid} to exist`);const d={...r,...e};this.dispatch(a(d));const l=this.enqueueRequest({description:w(h.PATCH,this.name,!1),method:h.PATCH,url:`${this.url}/${e.uuid}/`,payload:e,blockers:[r.uuid],blocks:[r.uuid]});return l.then(u=>{this.dispatch(a(u))}).catch(()=>{this.dispatch(a(r))}),[d,l]}async delete(e){const{store:n}=this.client,{deleteOne:a,addOne:c}=this.actions,{selectById:r}=this.selectors,d=r(e)(n.getState());if(!d)throw new Error(`Expected workflow type with uuid ${e} to exist`);this.dispatch(a(e));try{return await this.enqueueRequest({description:w(h.DELETE,this.name,!1),method:h.DELETE,url:`${this.url}/${e}/`,blockers:[e],blocks:[]})}catch(l){throw this.dispatch(c(d)),l}}async refreshStore(e,n){const{initialize:a}=this.actions,c=await this.list({queryParams:{organization:e}},n);return this.dispatch(a(c)),c}}async function Ma(t,s,e,n,a){const c=n instanceof St;c&&s.checkAuth!==!1&&await n.auth.prepareAuth();const r={queryParams:"",isAuthNeeded:!0},{s3url:d,payload:l,headers:u,method:p,queryParams:y,attachmentHash:f,isExternalUrl:T,isAuthNeeded:P,isResponseBlob:E}={...r,...s};let g=s.url;const M=f?await e.files.fetchCache(f):void 0;if(f&&!M)throw new Error(`Cannot upload file ${f} because it's not cached.`);!T&&!g.startsWith("http")&&(!g.startsWith("/")&&!g.startsWith("blob:")&&(g="/"+g),g=t+g);const b=v=>{if(f){if(!d)throw new Error(`No S3 URL for file ${f}`);if("warning"in d)throw new Error(`S3 URL warning for file ${f}`);if(!M)throw new Error(`No file for file ${f}`);const L=d.fields["x-amz-checksum-sha1"];if(!L)throw new Error(`No checksum for file ${f}`);return v.set("x-amz-checksum-sha1",L).field({...l,...d.fields}).attach("file",M)}return v.send(l)},j={[h.GET]:()=>E?Tt.get(g.toString()).responseType("blob"):Tt.get(g.toString()),[h.POST]:()=>{const v=Tt.post(g.toString());return b(v)},[h.PATCH]:()=>{const v=Tt.patch(g.toString());return b(v)},[h.PUT]:()=>{const v=Tt.put(g.toString());return b(v)},[h.DELETE]:()=>{const v=Tt.delete(g.toString());return b(v)}}[p];let W=j();const D=()=>{console.debug("aborting request:",s.url),W.abort()};if(a==null||a.addEventListener("abort",D),P&&c){const v=n.auth.getAuthHeader();W=W.set("Authorization",v)}u&&(W=W.set(u));try{return await W.query(y)}catch(v){const L=dg(v),hs=L==null?void 0:L.status;if(c&&hs===401)return await n.auth.handleUnauthorized(W,L),W.query(y);throw new C({response:L,innerError:v,discard:ba.includes(hs)})}finally{a==null||a.removeEventListener("abort",D)}}class JM{constructor(s){m(this,"store");this.store=s}_performRequest(s,e,n,a){const c=new ms,r={...e,uuid:e.uuid??ot.v4()};return Ma(s,r,this,n,a).then(d=>{c.resolve(d.body)}).catch(d=>{d instanceof Error?c.reject(d):c.reject(new Error((d??Ot).toString()))}),c}async performRequest(s,e,n,a){return this._performRequest(s,e,n,a).then(c=>{if(c instanceof C)throw c;return c})}async enqueueRequest(s,e,n){return this._enqueueRequest(s,e,n).then(a=>{if(a instanceof C)throw a;return a})}_enqueueRequest(s,e,n){const a=new ms,c={...s,BASE_URL:e,serviceName:n},r=this.store.dispatch(Jw(c)),d=u=>{if(u)a.resolve(u.body);else{const p=new C({message:"Could not get a response from the server.",response:u,discard:!0});a.reject(p)}},l=u=>{u instanceof C?u.options.discard=!0:(console.error("Received an unexpected error while processing a request:",u,`
|
|
14
|
+
Converting error to APIError and discarding.`),u=new C({message:"An error occurred while processing the request.",innerError:u,discard:!0})),a.reject(u)};return r.then(d,l),a}async performPagination(s,e,n,a,c){const r={...e,queryParams:{...e.queryParams,paginate:!0,limit:n}},{method:d}=r,l=[];let u=await this.performRequest(s,r,a,c);for(l.push(u.results);u.next;)u=await this.performRequest(s,{url:u.next,method:d},a,c),l.push(u.results);return l}}class Ft{constructor(){m(this,"graph");m(this,"requestAttemptCounter");this.graph=new Rg.DepGraph,this.requestAttemptCounter={}}static _fromOutbox(s){const e=new Ft;for(let n=0;n<s.length;n++){const a=s[n];if(!a){console.error("Outbox item was undefined");continue}e.sneakRequest(a);for(let c=0;c<n;c++){const r=s[c];if(!r){console.error("Previous outbox item was undefined");continue}r.payload.uuid!==a.payload.uuid&&r.payload.blocks.some(d=>a.payload.blockers.includes(d))&&Ft._addDependency(a.payload.uuid,r.payload.uuid,e.graph)}}return e}_addDependency(s,e){Ft._addDependency(s,e,this.graph)}static _addDependency(s,e,n){if(s===e)throw new Error(`Tried to add dependency from node to itself: ${s}`);if(!n.hasNode(s))throw new Error(`Tried to add dependency from non-existent node: ${s} (to node: ${e})`);if(!n.hasNode(e))throw new Error(`Tried to add dependency to non-existent node: ${e} (from node: ${s})`);n.addDependency(s,e)}addRequest(s){if(this.graph.addNode(s.payload.uuid,s),!(s.payload.blockers.length===0||this.graph.size()===1))for(const e of this.graph.overallOrder()){if(e===s.payload.uuid)continue;const n=this.graph.getNodeData(e),a=new Set(n.payload.blocks);s.payload.blockers.some(c=>a.has(c))&&this._addDependency(s.payload.uuid,e)}}insertRequest(s){this.graph.addNode(s.payload.uuid,s);for(const e of this.graph.overallOrder()){if(e===s.payload.uuid)continue;const n=this.graph.getNodeData(e),a=new Set(s.payload.blocks);n.payload.blockers.some(c=>a.has(c))&&this._addDependency(e,s.payload.uuid)}}sneakRequest(s){this.graph.addNode(s.payload.uuid,s)}_getNextNode(){const s=this.graph.overallOrder(!0);let e=1/0,n;for(const a of s){const c=this.requestAttemptCounter[a]||0;c<e&&(e=c,n=a)}return n}peek(){const s=this._getNextNode();if(s)return this.graph.getNodeData(s)}remove(s){this.graph.removeNode(s),delete this.requestAttemptCounter[s]}pop(){const s=this.peek();return s&&this.graph.removeNode(s.payload.uuid),s}getQueue(){const s=this.graph.overallOrder().map(n=>this.graph.getNodeData(n)),e=this._getNextNode();if(e){const n=this.graph.getNodeData(e),a=s.findIndex(c=>c.payload.uuid===n.payload.uuid);a!==-1&&(s.splice(a,1),s.unshift(n))}return s}getReady(){let s=this.graph.overallOrder(!0).map(e=>this.graph.getNodeData(e));return s=s.sort((e,n)=>e.meta.offline.effect.timestamp.localeCompare(n.meta.offline.effect.timestamp)),s=s.sort((e,n)=>{const a=this.requestAttemptCounter[e.payload.uuid]||0,c=this.requestAttemptCounter[n.payload.uuid]||0;return a-c}),s}registerRetry(s){this.requestAttemptCounter[s]=(this.requestAttemptCounter[s]||0)+1}}let lg;function ug(t){lg=t}function _t(){return lg}let og;function hg(t){og=t}function pg(){return og}let ka=null;function wt(){const t=_t();if(!t)return console.warn("Client store not set; cannot get outbox coordinator yet."),null;if(ka)return ka;const s=t.getState().offline.outbox,e=Ft._fromOutbox(s);return ka=e,e}const ZM=(t,s)=>{const e=new s(t);return hg(e),ug(t),e};class QM{constructor(s){m(this,"_all");m(this,"_previous");this._all=[s],this._previous=s,this.then=this.then.bind(this),this.compile=this.compile.bind(this)}then(s){return this._previous&&(this._previous.next=s),this._all.push(s),this._previous=s,{then:this.then,compile:this.compile}}compile(){return this._all}}class Ea{constructor(){m(this,"next");this.next=null}then(s){return new QM(this).then(s)}async run(s){if(this.next)return this.next.run(s);{if(console.debug("Middleware finished. Performing request:",s.payload.url),!_t())throw new Error("Client store not set");const n=pg();if(!n)throw new Error("Client SDK not set");return ag(s,n)}}}class mg extends Ea{async run(s){return super.run(s)}}class yg extends Ea{async run(s){return super.run(s)}}const fg=new mg().then(new yg).compile();function Sg(t){var s;return(s=fg[0])==null?void 0:s.run(t)}var Ag=(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))(Ag||{});i.ALL_MIDDLEWARE=fg,i.APIError=C,i.AgentService=_R,i.AssetAttachmentService=gR,i.AssetProcedureService=ER,i.AssetProcedureStepFieldValuesAttachmentService=WR,i.AssetProcedureStepFieldValuesService=zR,i.AssetProcedureStepFieldsAttachmentService=VR,i.AssetProcedureStepFieldsService=BR,i.AssetProcedureStepService=qR,i.AssetProcedureTypeAttachmentService=PR,i.AssetProcedureTypeFieldValuesAttachmentService=MR,i.AssetProcedureTypeFieldValuesService=kR,i.AssetProcedureTypeFieldsAttachmentService=bR,i.AssetProcedureTypeFieldsService=RR,i.AssetProcedureTypeService=vR,i.AssetService=DR,i.AssetStageCompletionService=jR,i.AssetStageService=$R,i.AssetStatusType=Da,i.AssetTypeAttachmentService=CR,i.AssetTypeFieldValuesAttachmentService=NR,i.AssetTypeFieldValuesService=GR,i.AssetTypeFieldsAttachmentService=UR,i.AssetTypeFieldsService=LR,i.AssetTypeIdentifierService=HR,i.AssetTypeIdentifierValueService=KR,i.AssetTypeService=YR,i.AssetTypeStatusService=JR,i.AttachmentModel=ja,i.BaseApiService=St,i.BaseModelApiService=At,i.BaseOfflineFileModelApiService=q,i.BaseOfflineModelApiService=k,i.BaseSDK=JM,i.COMMON_AUTO_FIELDS=Ja,i.DEFAULT_ISSUE_PRIORITY=Mg,i.DEFAULT_PAGE_SIZE=J_,i.DISCARD_HTTP_STATUSES=ba,i.DeferredPromise=ms,i.DocumentAttachmentService=ZR,i.DocumentService=QR,i.EMPTY_ARRAY=Wa,i.EMPTY_OBJECT=za,i.EmailDomainsService=XR,i.EmailVerificationService=xR,i.FILE_MODEL_DEFAULT_PAGE_SIZE=Z_,i.FileService=eM,i.FormIdentifierService=tM,i.FormIdentifierValueService=sM,i.FormRevisionAttachmentService=iM,i.FormRevisionService=nM,i.FormService=aM,i.FormSubmissionAttachmentService=cM,i.FormSubmissionService=rM,i.GeoImageService=dM,i.HttpMethod=h,i.IssueAssociationService=lM,i.IssueAttachmentService=uM,i.IssueCommentAttachmentService=oM,i.IssueCommentService=hM,i.IssuePriority=ps,i.IssueService=pM,i.IssueStatusType=$a,i.IssueTypeAttachmentService=mM,i.IssueTypeFieldValuesAttachmentService=SM,i.IssueTypeFieldValuesService=AM,i.IssueTypeFieldsAttachmentService=yM,i.IssueTypeFieldsService=fM,i.IssueTypeIdentifierService=wM,i.IssueTypeIdentifierValueService=TM,i.IssueTypeService=IM,i.IssueTypeStatusService=OM,i.IssueUpdateChange=$,i.IssueUpdateService=FM,i.JWTService=PM,i.MAX_SERVICE_BATCH_SIZE=ut,i.OUTBOX_RETRY_DELAY=Ua,i.OfflineAnalyticsMiddleware=mg,i.OfflineMiddleware=Ea,i.OrganizationAccessLevel=qa,i.OrganizationAccessService=bM,i.OrganizationService=RM,i.OutboxCoordinator=Ft,i.ProjectAccessService=MM,i.ProjectAttachmentService=kM,i.ProjectFileService=EM,i.ProjectService=vM,i.RESET_ORGANIZATION_STATE=_,i.RESET_PROJECT_STATE=B,i.RESET_STATE=I,i.RateLimitingMiddleware=yg,i.SelectorBuilder=eP,i.TeamMembershipService=VM,i.TeamService=BM,i.UNKNOWN_ERROR_MESSAGE=Ot,i.UserService=WM,i.VERSION_REDUCER_KEY=Rt,i.VerificationCodeType=Ag,i.WORKFLOW_STATUSES=Eg,i.WORKFLOW_STEP_FIELD_VALUES_REVIEW_TYPES=kg,i.WorkflowService=zM,i.WorkflowStatus=Pt,i.WorkflowStepAssigneeService=qM,i.WorkflowStepCommentService=DM,i.WorkflowStepEventService=jM,i.WorkflowStepEventType=Ca,i.WorkflowStepFieldValuesAttachmentService=UM,i.WorkflowStepFieldValuesReviewRequestService=LM,i.WorkflowStepFieldValuesReviewService=NM,i.WorkflowStepFieldValuesReviewType=bt,i.WorkflowStepFieldValuesService=GM,i.WorkflowStepFieldsAttachmentService=$M,i.WorkflowStepFieldsService=CM,i.WorkflowStepReviewerService=HM,i.WorkflowStepService=KM,i.WorkflowTypeService=YM,i._setLatestRetryTime=Qw,i.addAsset=gl,i.addAssetAttachment=uc,i.addAssetAttachments=Os,i.addAssetProcedure=Dr,i.addAssetProcedureStep=pl,i.addAssetProcedureStepFieldValues=Qd,i.addAssetProcedureStepFieldValuesAttachment=Dd,i.addAssetProcedureStepFieldValuesAttachments=Gs,i.addAssetProcedureStepFieldValuesMany=Xd,i.addAssetProcedureStepFields=gd,i.addAssetProcedureStepFieldsAttachment=od,i.addAssetProcedureStepFieldsAttachments=hd,i.addAssetProcedureStepFieldsMany=Pd,i.addAssetProcedureSteps=ml,i.addAssetProcedureType=Qr,i.addAssetProcedureTypeAttachment=Fc,i.addAssetProcedureTypeAttachments=_c,i.addAssetProcedureTypeFieldValues=_r,i.addAssetProcedureTypeFieldValuesAttachment=or,i.addAssetProcedureTypeFieldValuesAttachments=Es,i.addAssetProcedureTypeFieldValuesMany=gr,i.addAssetProcedureTypeFields=Qc,i.addAssetProcedureTypeFieldsAttachment=qc,i.addAssetProcedureTypeFieldsAttachments=Dc,i.addAssetProcedureTypeFieldsMany=Xc,i.addAssetProcedureTypes=Xr,i.addAssetProcedures=zs,i.addAssetStage=tu,i.addAssetStageCompletion=Dl,i.addAssetStageCompletions=jl,i.addAssetStages=su,i.addAssetType=ih,i.addAssetTypeAttachment=hu,i.addAssetTypeAttachments=ai,i.addAssetTypeFieldValues=po,i.addAssetTypeFieldValuesAttachment=xu,i.addAssetTypeFieldValuesAttachments=hi,i.addAssetTypeFieldValuesMany=mo,i.addAssetTypeFields=ju,i.addAssetTypeFieldsAttachment=gu,i.addAssetTypeFieldsAttachments=Pu,i.addAssetTypeFieldsMany=$u,i.addAssetTypeIdentifier=bo,i.addAssetTypeIdentifierValue=Co,i.addAssetTypeIdentifierValues=Uo,i.addAssetTypeIdentifiers=Ro,i.addAssetTypeStatus=yh,i.addAssetTypeStatuses=fh,i.addAssetTypes=nh,i.addAssets=Xs,i.addConversation=nc,i.addConversations=tP,i.addDocument=Hh,i.addDocumentAttachment=vh,i.addDocumentAttachments=Vh,i.addDocuments=Kh,i.addEmailDomain=cp,i.addEmailDomains=rp,i.addForm=Im,i.addFormIdentifier=Fp,i.addFormIdentifierValue=qp,i.addFormIdentifierValues=Dp,i.addFormIdentifiers=_p,i.addFormRevision=Wi,i.addFormRevisionAttachment=Qp,i.addFormRevisionAttachments=Xp,i.addFormRevisions=zi,i.addFormSubmission=Jm,i.addFormSubmissionAttachment=Wm,i.addFormSubmissionAttachments=Li,i.addFormSubmissions=Ji,i.addForms=Om,i.addGeoImage=dy,i.addGeoImages=ly,i.addIssue=_f,i.addIssueAssociation=_y,i.addIssueAssociations=mt,i.addIssueAttachment=qy,i.addIssueAttachments=sn,i.addIssueComment=of,i.addIssueCommentAttachment=Zy,i.addIssueCommentAttachments=Qy,i.addIssueComments=hf,i.addIssueType=PA,i.addIssueTypeAttachment=qf,i.addIssueTypeAttachments=Df,i.addIssueTypeFieldValues=oS,i.addIssueTypeFieldValuesAttachment=jS,i.addIssueTypeFieldValuesAttachments=Tn,i.addIssueTypeFieldValuesMany=hS,i.addIssueTypeFields=gS,i.addIssueTypeFieldsAttachment=Qf,i.addIssueTypeFieldsAttachments=Xf,i.addIssueTypeFieldsMany=PS,i.addIssueTypeIdentifier=XS,i.addIssueTypeIdentifierValue=hA,i.addIssueTypeIdentifierValues=pA,i.addIssueTypeIdentifiers=xS,i.addIssueTypeStatus=$A,i.addIssueTypeStatuses=CA,i.addIssueTypes=bA,i.addIssueUpdate=vn,i.addIssueUpdates=Vn,i.addIssues=on,i.addOrganization=qw,i.addOrganizationAccess=Tw,i.addOrganizationAccesses=Iw,i.addOrganizations=zw,i.addProject=HT,i.addProjectAccess=tT,i.addProjectAccesses=sT,i.addProjectAttachment=mT,i.addProjectAttachments=yT,i.addProjectFile=kT,i.addProjectFiles=ET,i.addProjects=GT,i.addTeam=AI,i.addTeamMembership=nI,i.addTeamMemberships=aI,i.addTeams=wI,i.addUser=jn,i.addUsers=ow,i.addWorkflow=BI,i.addWorkflowStep=O_,i.addWorkflowStepAssignee=YI,i.addWorkflowStepAssignees=JI,i.addWorkflowStepComment=dO,i.addWorkflowStepComments=lO,i.addWorkflowStepEvent=OO,i.addWorkflowStepEvents=FO,i.addWorkflowStepFieldValues=OF,i.addWorkflowStepFieldValuesAttachment=lF,i.addWorkflowStepFieldValuesAttachments=oa,i.addWorkflowStepFieldValuesMany=FF,i.addWorkflowStepFieldValuesReview=JF,i.addWorkflowStepFieldValuesReviewRequest=zF,i.addWorkflowStepFieldValuesReviewRequests=fa,i.addWorkflowStepFieldValuesReviews=wa,i.addWorkflowStepFields=JO,i.addWorkflowStepFieldsAttachment=zO,i.addWorkflowStepFieldsAttachments=ca,i.addWorkflowStepFieldsMany=ZO,i.addWorkflowStepReviewer=d_,i.addWorkflowStepReviewers=l_,i.addWorkflowSteps=F_,i.addWorkflowType=z_,i.addWorkflowTypes=q_,i.addWorkflows=WI,i.agentsReducer=rc,i.agentsSlice=ws,i.areArraysEqual=Wg,i.assetAttachmentReducer=Tc,i.assetAttachmentSlice=Is,i.assetProcedureReducer=Nr,i.assetProcedureSlice=Ws,i.assetProcedureStepFieldValuesAttachmentReducer=Yd,i.assetProcedureStepFieldValuesAttachmentSlice=Ns,i.assetProcedureStepFieldValuesReducer=dl,i.assetProcedureStepFieldValuesSlice=Ys,i.assetProcedureStepFieldsAttachmentReducer=Od,i.assetProcedureStepFieldsAttachmentSlice=$s,i.assetProcedureStepFieldsReducer=Wd,i.assetProcedureStepFieldsSlice=Us,i.assetProcedureStepReducer=wl,i.assetProcedureStepSlice=Js,i.assetProcedureTypeAttachmentReducer=Ec,i.assetProcedureTypeAttachmentSlice=gs,i.assetProcedureTypeFieldValuesAttachmentReducer=Sr,i.assetProcedureTypeFieldValuesAttachmentSlice=ks,i.assetProcedureTypeFieldValuesReducer=vr,i.assetProcedureTypeFieldValuesSlice=Bs,i.assetProcedureTypeFieldsAttachmentReducer=Gc,i.assetProcedureTypeFieldsAttachmentSlice=bs,i.assetProcedureTypeFieldsReducer=ar,i.assetProcedureTypeFieldsSlice=Ms,i.assetProcedureTypeReducer=ad,i.assetProcedureTypeSlice=Ds,i.assetReducer=Wl,i.assetSlice=Qs,i.assetStageCompletionReducer=Hl,i.assetStageCompletionSlice=ei,i.assetStageReducer=ru,i.assetStageSlice=ti,i.assetTypeAttachmentReducer=Ou,i.assetTypeAttachmentSlice=ni,i.assetTypeFieldValuesAttachmentReducer=uo,i.assetTypeFieldValuesAttachmentSlice=oi,i.assetTypeFieldValuesReducer=_o,i.assetTypeFieldValuesSlice=yi,i.assetTypeFieldsAttachmentReducer=zu,i.assetTypeFieldsAttachmentSlice=di,i.assetTypeFieldsReducer=Zu,i.assetTypeFieldsSlice=ui,i.assetTypeIdentifierReducer=Do,i.assetTypeIdentifierSlice=fi,i.assetTypeIdentifierValueReducer=Xo,i.assetTypeIdentifierValueSlice=Ai,i.assetTypeReducer=hh,i.assetTypeSlice=wi,i.assetTypeStatusReducer=Ph,i.assetTypeStatusSlice=Ii,i.assetTypeStatusSortFn=Xa,i.authReducer=Mh,i.authSlice=Qt,i.baseReducer=lR,i.baseReducers=Pa,i.clearTokens=jP,i.createModelAdapter=F,i.createOfflineAction=Kw,i.createPayload=R,i.createSelectionAdapter=vg,i.deleteAsset=Rl,i.deleteAssetAttachment=yc,i.deleteAssetAttachments=Fs,i.deleteAssetProcedure=Cr,i.deleteAssetProcedureStep=Sl,i.deleteAssetProcedureStepFieldValues=il,i.deleteAssetProcedureStepFieldValuesAttachment=Ld,i.deleteAssetProcedureStepFieldValuesAttachments=Hs,i.deleteAssetProcedureStepFieldValuesMany=nl,i.deleteAssetProcedureStepFields=Ed,i.deleteAssetProcedureStepFieldsAttachment=Sd,i.deleteAssetProcedureStepFieldsAttachments=Ad,i.deleteAssetProcedureStepFieldsMany=vd,i.deleteAssetProcedureSteps=Al,i.deleteAssetProcedureType=td,i.deleteAssetProcedureTypeAttachment=Mc,i.deleteAssetProcedureTypeAttachments=kc,i.deleteAssetProcedureTypeFieldValues=kr,i.deleteAssetProcedureTypeFieldValuesAttachment=fr,i.deleteAssetProcedureTypeFieldValuesAttachments=vs,i.deleteAssetProcedureTypeFieldValuesMany=Er,i.deleteAssetProcedureTypeFields=ir,i.deleteAssetProcedureTypeFieldsAttachment=Lc,i.deleteAssetProcedureTypeFieldsAttachments=Nc,i.deleteAssetProcedureTypeFieldsMany=nr,i.deleteAssetProcedureTypes=sd,i.deleteAssetProcedures=qs,i.deleteAssetStage=au,i.deleteAssetStageCompletion=Nl,i.deleteAssetStageCompletions=Gl,i.deleteAssetStages=cu,i.deleteAssetType=rh,i.deleteAssetTypeAttachment=Su,i.deleteAssetTypeAttachments=ci,i.deleteAssetTypeFieldValues=wo,i.deleteAssetTypeFieldValuesAttachment=no,i.deleteAssetTypeFieldValuesAttachments=pi,i.deleteAssetTypeFieldValuesMany=To,i.deleteAssetTypeFields=Gu,i.deleteAssetTypeFieldsAttachment=Eu,i.deleteAssetTypeFieldsAttachments=vu,i.deleteAssetTypeFieldsMany=Hu,i.deleteAssetTypeIdentifier=Vo,i.deleteAssetTypeIdentifierValue=Ko,i.deleteAssetTypeIdentifierValues=Yo,i.deleteAssetTypeIdentifiers=Bo,i.deleteAssetTypeStatus=Ih,i.deleteAssetTypeStatuses=Oh,i.deleteAssetTypes=dh,i.deleteAssets=xs,i.deleteConversation=nP,i.deleteConversations=aP,i.deleteDocument=Xh,i.deleteDocumentAttachment=Dh,i.deleteDocumentAttachments=jh,i.deleteDocuments=xh,i.deleteEmailDomain=hp,i.deleteEmailDomains=pp,i.deleteForm=bm,i.deleteFormIdentifier=Mp,i.deleteFormIdentifierValue=Lp,i.deleteFormIdentifierValues=Np,i.deleteFormIdentifiers=kp,i.deleteFormRevision=qi,i.deleteFormRevisionAttachment=im,i.deleteFormRevisionAttachments=nm,i.deleteFormRevisions=Di,i.deleteFormSubmission=Xm,i.deleteFormSubmissionAttachment=$m,i.deleteFormSubmissionAttachments=Ni,i.deleteFormSubmissions=Zi,i.deleteForms=Rm,i.deleteGeoImage=hy,i.deleteGeoImages=py,i.deleteIssue=Mf,i.deleteIssueAssociation=gy,i.deleteIssueAssociations=yt,i.deleteIssueAttachment=Uy,i.deleteIssueAttachments=nn,i.deleteIssueComment=Sf,i.deleteIssueCommentAttachment=sf,i.deleteIssueCommentAttachments=nf,i.deleteIssueComments=Af,i.deleteIssueType=vA,i.deleteIssueTypeAttachment=Lf,i.deleteIssueTypeAttachments=Nf,i.deleteIssueTypeFieldValues=SS,i.deleteIssueTypeFieldValuesAttachment=NS,i.deleteIssueTypeFieldValuesAttachments=In,i.deleteIssueTypeFieldValuesMany=AS,i.deleteIssueTypeFields=ES,i.deleteIssueTypeFieldsAttachment=iS,i.deleteIssueTypeFieldsAttachments=nS,i.deleteIssueTypeFieldsMany=vS,i.deleteIssueTypeIdentifier=nA,i.deleteIssueTypeIdentifierValue=AA,i.deleteIssueTypeIdentifierValues=wA,i.deleteIssueTypeIdentifiers=aA,i.deleteIssueTypeStatus=HA,i.deleteIssueTypeStatuses=KA,i.deleteIssueTypes=VA,i.deleteIssueUpdate=Bn,i.deleteIssueUpdates=Wn,i.deleteIssues=hn,i.deleteOrganization=$w,i.deleteOrganizationAccess=Pw,i.deleteOrganizationAccesses=bw,i.deleteOrganizations=Cw,i.deleteProject=JT,i.deleteProjectAccess=rT,i.deleteProjectAccesses=dT,i.deleteProjectAttachment=TT,i.deleteProjectAttachments=IT,i.deleteProjectFile=BT,i.deleteProjectFiles=WT,i.deleteProjects=ZT,i.deleteTeam=_I,i.deleteTeamMembership=uI,i.deleteTeamMemberships=oI,i.deleteTeams=gI,i.deleteUser=$n,i.deleteUsers=mw,i.deleteWorkflow=$I,i.deleteWorkflowStep=R_,i.deleteWorkflowStepAssignee=eO,i.deleteWorkflowStepAssignees=tO,i.deleteWorkflowStepComment=mO,i.deleteWorkflowStepComments=yO,i.deleteWorkflowStepEvent=RO,i.deleteWorkflowStepEvents=MO,i.deleteWorkflowStepFieldValues=RF,i.deleteWorkflowStepFieldValuesAttachment=mF,i.deleteWorkflowStepFieldValuesAttachments=ha,i.deleteWorkflowStepFieldValuesMany=MF,i.deleteWorkflowStepFieldValuesReview=e_,i.deleteWorkflowStepFieldValuesReviewRequest=CF,i.deleteWorkflowStepFieldValuesReviewRequests=Sa,i.deleteWorkflowStepFieldValuesReviews=Ta,i.deleteWorkflowStepFields=tF,i.deleteWorkflowStepFieldsAttachment=CO,i.deleteWorkflowStepFieldsAttachments=ra,i.deleteWorkflowStepFieldsMany=sF,i.deleteWorkflowStepReviewer=m_,i.deleteWorkflowStepReviewers=y_,i.deleteWorkflowSteps=M_,i.deleteWorkflowType=U_,i.deleteWorkflowTypes=L_,i.deleteWorkflows=CI,i.dequeue=ng,i.discard=cg,i.documentAttachmentReducer=Lh,i.documentAttachmentSlice=Fi,i.documentSlice=gi,i.documentsReducer=ep,i.downloadFile=Lg,i.emailDomainsReducer=Sp,i.emailDomainsSlice=bi,i.emailRegex=Qg,i.enqueue=ig,i.enqueueRequest=Jw,i.extractResponseFromError=dg,i.fallbackToEmptyArray=A,i.fallbackToEmptyObject=$t,i.fetchBlobFromObjectUrl=Ga,i.fetchFileFromObjectUrl=Ha,i.fileReducer=Tp,i.fileSlice=Mi,i.formIdentifierReducer=Bp,i.formIdentifierSlice=ki,i.formIdentifierValueReducer=Yp,i.formIdentifierValueSlice=vi,i.formReducer=Mm,i.formRevisionAttachmentReducer=dm,i.formRevisionAttachmentSlice=Vi,i.formRevisionReducer=Am,i.formRevisionsSlice=Bi,i.formSlice=$i,i.formSubmissionAttachmentReducer=Nm,i.formSubmissionAttachmentSlice=Ui,i.formSubmissionReducer=iy,i.formSubmissionSlice=Yi,i.geoImageReducer=Sy,i.geoImageSlice=Xi,i.getAssetProcedureStepSubTree=Qa,i.getAssetProcedureStepTrees=Xg,i.getClientSDK=pg,i.getClientStore=_t,i.getDocumentSubTree=tc,i.getDocumentTrees=xg,i.getFileExtension=Na,i.getLocalDateString=La,i.getLocalRelativeDateString=jg,i.getOutboxCoordinator=wt,i.getRenamedFile=Ug,i.getRequestDescription=w,i.getS3FileKey=Cg,i.hashFile=Ct,i.initSDK=ZM,i.initializeAssetAttachments=lc,i.initializeAssetProcedureStepFieldValues=Zd,i.initializeAssetProcedureStepFieldValuesAttachments=qd,i.initializeAssetProcedureStepFields=_d,i.initializeAssetProcedureStepFieldsAttachments=ud,i.initializeAssetProcedureSteps=ul,i.initializeAssetProcedureTypeAttachments=Oc,i.initializeAssetProcedureTypeFieldValues=Fr,i.initializeAssetProcedureTypeFieldValuesAttachments=ur,i.initializeAssetProcedureTypeFields=Zc,i.initializeAssetProcedureTypeFieldsAttachments=zc,i.initializeAssetProcedureTypes=Zr,i.initializeAssetProcedures=qr,i.initializeAssetStageCompletions=ql,i.initializeAssetStages=Xl,i.initializeAssetTypeAttachments=ou,i.initializeAssetTypeFieldValues=ho,i.initializeAssetTypeFieldValuesAttachments=Xu,i.initializeAssetTypeFields=Du,i.initializeAssetTypeFieldsAttachments=_u,i.initializeAssetTypeIdentifierValues=$o,i.initializeAssetTypeIdentifiers=Po,i.initializeAssetTypeStatuses=mh,i.initializeAssetTypes=eh,i.initializeAssets=_l,i.initializeConversations=ic,i.initializeDocumentAttachments=Eh,i.initializeDocuments=Gh,i.initializeEmailDomains=ap,i.initializeFormIdentifierValues=zp,i.initializeFormIdentifiers=Op,i.initializeFormRevisionAttachments=Zp,i.initializeFormRevisions=um,i.initializeFormSubmissionAttachments=Bm,i.initializeFormSubmissions=Hm,i.initializeForms=Tm,i.initializeGeoImages=ay,i.initializeIssueAssociations=wy,i.initializeIssueAttachments=zy,i.initializeIssueCommentAttachments=Jy,i.initializeIssueComments=uf,i.initializeIssueTypeAttachments=zf,i.initializeIssueTypeFieldValues=uS,i.initializeIssueTypeFieldValuesAttachments=DS,i.initializeIssueTypeFields=_S,i.initializeIssueTypeFieldsAttachments=Zf,i.initializeIssueTypeIdentifierValues=oA,i.initializeIssueTypeIdentifiers=QS,i.initializeIssueTypeStatuses=jA,i.initializeIssueTypes=gA,i.initializeIssueUpdates=XA,i.initializeIssues=Ff,i.initializeOrganizationAccesses=ww,i.initializeOrganizations=Vw,i.initializeProjectAccesses=eT,i.initializeProjectAttachments=pT,i.initializeProjectFiles=bT,i.initializeProjects=UT,i.initializeTeamMemberships=iI,i.initializeTeams=SI,i.initializeUsers=dw,i.initializeWorkflowStepAssignees=KI,i.initializeWorkflowStepComments=rO,i.initializeWorkflowStepEvents=IO,i.initializeWorkflowStepFieldValues=IF,i.initializeWorkflowStepFieldValuesAttachments=dF,i.initializeWorkflowStepFieldValuesReviewRequests=WF,i.initializeWorkflowStepFieldValuesReviews=YF,i.initializeWorkflowStepFields=YO,i.initializeWorkflowStepFieldsAttachments=WO,i.initializeWorkflowStepReviewers=r_,i.initializeWorkflowSteps=I_,i.initializeWorkflowTypes=W_,i.initializeWorkflows=VI,i.isImageFile=Ng,i.isObjectUrl=Ka,i.isToday=Dg,i.issueAssociationReducer=By,i.issueAssociationSlice=en,i.issueAttachmentReducer=Ky,i.issueAttachmentSlice=tn,i.issueCommentAttachmentReducer=df,i.issueCommentAttachmentSlice=cn,i.issueCommentReducer=If,i.issueCommentSlice=dn,i.issueReducer=Bf,i.issueSlice=un,i.issueTypeAttachmentReducer=Yf,i.issueTypeAttachmentSlice=pn,i.issueTypeFieldValuesAttachmentReducer=JS,i.issueTypeFieldValuesAttachmentSlice=wn,i.issueTypeFieldValuesReducer=OS,i.issueTypeFieldValuesSlice=Sn,i.issueTypeFieldsAttachmentReducer=dS,i.issueTypeFieldsAttachmentSlice=yn,i.issueTypeFieldsReducer=zS,i.issueTypeFieldsSlice=An,i.issueTypeIdentifierReducer=lA,i.issueTypeIdentifierSlice=Fn,i.issueTypeIdentifierValueReducer=FA,i.issueTypeIdentifierValueSlice=gn,i.issueTypeReducer=qA,i.issueTypeSlice=Pn,i.issueTypeStatusReducer=ZA,i.issueTypeStatusSlice=Rn,i.issueTypeStatusSortFn=xa,i.issueUpdateReducer=cw,i.issueUpdateSlice=En,i.logOnlyOnce=Gg,i.markAsDeleted=Zw,i.markForDeletion=Ob,i.memoize=fs,i.organizationAccessReducer=Rw,i.organizationAccessSlice=Un,i.organizationReducer=Hw,i.organizationSlice=Ln,i.outboxReducer=Xw,i.outboxSlice=Nn,i.overmapEnhancer=AR,i.overmapReducer=uR,i.overmapReducers=Y_,i.performRequest=Ma,i.performRequestFromAction=ag,i.projectAccessReducer=lT,i.projectAccessSlice=Gn,i.projectAttachmentReducer=gT,i.projectAttachmentSlice=Kn,i.projectFileReducer=$T,i.projectFileSlice=Jn,i.projectReducer=QT,i.projectSlice=Zn,i.rehydratedReducer=tI,i.rehydratedSlice=Qn,i.restructureSelectorWithArgs=S,i.runMiddleware=Sg,i.selectAccessToken=$P,i.selectAccessesByUserOfProject=_b,i.selectAccessibleProjects=bb,i.selectActiveOrganizationAccess=Ab,i.selectAllDocumentAttachments=_i,i.selectAssetAttachmentById=Sc,i.selectAssetAttachmentMapping=fc,i.selectAssetAttachments=_s,i.selectAssetAttachmentsByIds=Ac,i.selectAssetById=Vl,i.selectAssetProcedureById=Kr,i.selectAssetProcedureStepById=Tl,i.selectAssetProcedureStepFieldValues=Mt,i.selectAssetProcedureStepFieldValuesAttachmentById=Gd,i.selectAssetProcedureStepFieldValuesAttachments=Ks,i.selectAssetProcedureStepFieldValuesAttachmentsByIds=Hd,i.selectAssetProcedureStepFieldValuesAttachmentsMapping=Nd,i.selectAssetProcedureStepFieldValuesById=cl,i.selectAssetProcedureStepFieldValuesByIds=rl,i.selectAssetProcedureStepFieldValuesMapping=al,i.selectAssetProcedureStepFieldValuesOfAsset=TP,i.selectAssetProcedureStepFieldValuesOfAssetProcedure=IP,i.selectAssetProcedureStepFieldValuesOfAssetProcedureStep=OP,i.selectAssetProcedureStepFields=Ht,i.selectAssetProcedureStepFieldsAttachmentById=Td,i.selectAssetProcedureStepFieldsAttachments=Cs,i.selectAssetProcedureStepFieldsAttachmentsByIds=Id,i.selectAssetProcedureStepFieldsAttachmentsMapping=wd,i.selectAssetProcedureStepFieldsById=Vd,i.selectAssetProcedureStepFieldsByIds=Bd,i.selectAssetProcedureStepFieldsMapping=Ls,i.selectAssetProcedureStepFieldsOfAssetProcedureStep=SP,i.selectAssetProcedureStepMapping=Kt,i.selectAssetProcedureSteps=Zs,i.selectAssetProcedureStepsByIds=Il,i.selectAssetProcedureStepsMappingOfAssetProcedureType=FP,i.selectAssetProcedureStepsOfAssetProcedureType=_P,i.selectAssetProcedureTypeAttachmentById=Vc,i.selectAssetProcedureTypeAttachmentMapping=vc,i.selectAssetProcedureTypeAttachments=Ps,i.selectAssetProcedureTypeAttachmentsByIds=Bc,i.selectAssetProcedureTypeById=rd,i.selectAssetProcedureTypeFieldValues=Nt,i.selectAssetProcedureTypeFieldValuesAttachmentById=wr,i.selectAssetProcedureTypeFieldValuesAttachments=Vs,i.selectAssetProcedureTypeFieldValuesAttachmentsByIds=Tr,i.selectAssetProcedureTypeFieldValuesAttachmentsMapping=Ar,i.selectAssetProcedureTypeFieldValuesById=Br,i.selectAssetProcedureTypeFieldValuesByIds=Wr,i.selectAssetProcedureTypeFieldValuesMapping=Vr,i.selectAssetProcedureTypeFieldValuesOfAsset=hP,i.selectAssetProcedureTypeFields=Lt,i.selectAssetProcedureTypeFieldsAttachmentById=Kc,i.selectAssetProcedureTypeFieldsAttachments=Rs,i.selectAssetProcedureTypeFieldsAttachmentsByIds=Yc,i.selectAssetProcedureTypeFieldsAttachmentsMapping=Hc,i.selectAssetProcedureTypeFieldsById=rr,i.selectAssetProcedureTypeFieldsByIds=dr,i.selectAssetProcedureTypeFieldsMapping=cr,i.selectAssetProcedureTypeFieldsOfAssetProcedureType=uP,i.selectAssetProcedureTypes=js,i.selectAssetProcedureTypesByIds=dd,i.selectAssetProcedureTypesMapping=cd,i.selectAssetProcedureTypesOfOrganization=yP,i.selectAssetProcedures=Gt,i.selectAssetProceduresByIds=Yr,i.selectAssetProceduresMapping=Gr,i.selectAssetProceduresOfAssetProcedureType=Hr,i.selectAssetProceduresOfAssetType=mP,i.selectAssetStageById=du,i.selectAssetStageCompletionById=Jl,i.selectAssetStageCompletionMapping=Kl,i.selectAssetStageCompletions=Yl,i.selectAssetStageCompletionsByIds=Zl,i.selectAssetStages=ii,i.selectAssetStagesByIds=lu,i.selectAssetStagesMappingOfAssetProcedureType=PP,i.selectAssetStagesOfAssetProcedureType=bP,i.selectAssetTypeAttachmentById=wu,i.selectAssetTypeAttachmentMapping=Au,i.selectAssetTypeAttachments=ri,i.selectAssetTypeAttachmentsByIds=Tu,i.selectAssetTypeById=uh,i.selectAssetTypeFieldValues=Jt,i.selectAssetTypeFieldValuesAttachmentById=co,i.selectAssetTypeFieldValuesAttachments=mi,i.selectAssetTypeFieldValuesAttachmentsByIds=ro,i.selectAssetTypeFieldValuesAttachmentsMapping=ao,i.selectAssetTypeFieldValuesById=Oo,i.selectAssetTypeFieldValuesByIds=Fo,i.selectAssetTypeFieldValuesMapping=Io,i.selectAssetTypeFieldValuesOfAsset=EP,i.selectAssetTypeFields=kt,i.selectAssetTypeFieldsAttachmentById=Bu,i.selectAssetTypeFieldsAttachments=li,i.selectAssetTypeFieldsAttachmentsByIds=Wu,i.selectAssetTypeFieldsAttachmentsMapping=Vu,i.selectAssetTypeFieldsById=Yu,i.selectAssetTypeFieldsByIds=Ju,i.selectAssetTypeFieldsMapping=Ku,i.selectAssetTypeFieldsOfAssetType=MP,i.selectAssetTypeIdentifierById=zo,i.selectAssetTypeIdentifierMapping=Wo,i.selectAssetTypeIdentifierValueById=Zo,i.selectAssetTypeIdentifierValueMapping=Jo,i.selectAssetTypeIdentifierValues=Zt,i.selectAssetTypeIdentifierValuesByIds=Qo,i.selectAssetTypeIdentifierValuesOfAsset=BP,i.selectAssetTypeIdentifierValuesOfIdentifier=WP,i.selectAssetTypeIdentifiers=Si,i.selectAssetTypeIdentifiersByIds=qo,i.selectAssetTypeIdentifiersOfAssetType=VP,i.selectAssetTypeStatusById=_h,i.selectAssetTypeStatusMapping=Fh,i.selectAssetTypeStatuses=Oi,i.selectAssetTypeStatusesByIds=gh,i.selectAssetTypeStatusesOfAssetType=qP,i.selectAssetTypeValuesOfAssetType=vP,i.selectAssetTypes=Ti,i.selectAssetTypesByIds=oh,i.selectAssetTypesMapping=lh,i.selectAssetTypesOfOrganization=zP,i.selectAssets=Yt,i.selectAssetsByIds=Bl,i.selectAssetsMapping=El,i.selectAssetsOfAssetType=vl,i.selectAssetsOfProject=gP,i.selectAttachmentsOfAsset=wc,i.selectAttachmentsOfAssetProcedureStepFieldValues=Kd,i.selectAttachmentsOfAssetProcedureStepFields=fP,i.selectAttachmentsOfAssetProcedureType=dP,i.selectAttachmentsOfAssetProcedureTypeFieldValues=Ir,i.selectAttachmentsOfAssetProcedureTypeFields=lP,i.selectAttachmentsOfAssetType=Iu,i.selectAttachmentsOfAssetTypeFieldValues=lo,i.selectAttachmentsOfAssetTypeFields=RP,i.selectAttachmentsOfDocument=UP,i.selectAttachmentsOfFormRevision=XP,i.selectAttachmentsOfFormSubmission=Lm,i.selectAttachmentsOfIssue=Ny,i.selectAttachmentsOfIssueComment=sb,i.selectAttachmentsOfIssueType=ab,i.selectAttachmentsOfIssueTypeFieldValues=YS,i.selectAttachmentsOfIssueTypeFields=cb,i.selectAttachmentsOfProject=Pb,i.selectAttachmentsOfWorkflowStepFieldValues=AF,i.selectAttachmentsOfWorkflowStepFields=LO,i.selectCommentsOfIssue=ib,i.selectConversation=rP,i.selectConversationMapping=Ts,i.selectConversations=cP,i.selectCurrentUser=fw,i.selectDeletedRequests=Tb,i.selectDescendantsOfAssetProcedureStep=Ol,i.selectDescendantsOfDocument=ip,i.selectDocumentAttachmentById=Ch,i.selectDocumentAttachmentMapping=$h,i.selectDocumentAttachmentsByIds=Uh,i.selectDocumentById=tp,i.selectDocuments=Xt,i.selectDocumentsByIds=sp,i.selectDocumentsMapping=Pi,i.selectEmailDomainById=yp,i.selectEmailDomains=Ri,i.selectEmailDomainsAsMapping=mp,i.selectEmailDomainsByIds=fp,i.selectEmailDomainsOfOrganization=GP,i.selectFieldValuesOfAssetProcedure=pP,i.selectFormById=Em,i.selectFormIdentifierById=vp,i.selectFormIdentifierMapping=Ep,i.selectFormIdentifierValueById=Hp,i.selectFormIdentifierValueMapping=Gp,i.selectFormIdentifierValues=xt,i.selectFormIdentifierValuesByIds=Kp,i.selectFormIdentifierValuesOfFormSubmission=ZP,i.selectFormIdentifierValuesOfIdentifier=QP,i.selectFormIdentifiers=Ei,i.selectFormIdentifiersByIds=Vp,i.selectFormIdentifiersOfForm=JP,i.selectFormMapping=km,i.selectFormRevisionAttachmentById=cm,i.selectFormRevisionAttachments=am,i.selectFormRevisionAttachmentsByIds=rm,i.selectFormRevisionAttachmentsMapping=es,i.selectFormRevisionById=ym,i.selectFormRevisionMapping=ji,i.selectFormRevisions=ts,i.selectFormRevisionsByIds=fm,i.selectFormRevisionsOfForm=Sm,i.selectFormSubmissionAttachemntsByIds=Ki,i.selectFormSubmissionAttachmentById=Cm,i.selectFormSubmissionAttachments=Hi,i.selectFormSubmissionAttachmentsByIds=Um,i.selectFormSubmissionAttachmentsMapping=Gi,i.selectFormSubmissionById=ey,i.selectFormSubmissions=xm,i.selectFormSubmissionsByIds=ty,i.selectFormSubmissionsMapping=Qi,i.selectFormSubmissionsOfForm=sy,i.selectForms=Ci,i.selectFormsByIds=vm,i.selectFormsOfOrganization=eb,i.selectGeoImageById=yy,i.selectGeoImageMapping=my,i.selectGeoImages=xi,i.selectGeoImagesByIds=fy,i.selectGeoImagesOfProject=tb,i.selectIsLoggedIn=CP,i.selectIssueAssociationById=by,i.selectIssueAssociationMapping=Py,i.selectIssueAssociations=ft,i.selectIssueAssociationsByIds=Ry,i.selectIssueAssociationsOfAsset=Vy,i.selectIssueAssociationsOfIssue=vy,i.selectIssueAssociationsOfIssues=Ey,i.selectIssueAssociationsToIssue=My,i.selectIssueAssociationsToIssues=ky,i.selectIssueAttachmentById=Gy,i.selectIssueAttachmentMapping=Ly,i.selectIssueAttachments=an,i.selectIssueAttachmentsByIds=Hy,i.selectIssueById=Ef,i.selectIssueCommentAttachmentById=cf,i.selectIssueCommentAttachmentMapping=af,i.selectIssueCommentAttachments=rn,i.selectIssueCommentAttachmentsByIds=rf,i.selectIssueCommentById=wf,i.selectIssueCommentMapping=ln,i.selectIssueCommentsByIds=Tf,i.selectIssueMapping=kf,i.selectIssueTypeAttachmentById=Hf,i.selectIssueTypeAttachmentMapping=Gf,i.selectIssueTypeAttachments=mn,i.selectIssueTypeAttachmentsByIds=Kf,i.selectIssueTypeById=WA,i.selectIssueTypeFieldValues=is,i.selectIssueTypeFieldValuesAttachmentById=HS,i.selectIssueTypeFieldValuesAttachments=On,i.selectIssueTypeFieldValuesAttachmentsByIds=KS,i.selectIssueTypeFieldValuesAttachmentsMapping=GS,i.selectIssueTypeFieldValuesById=TS,i.selectIssueTypeFieldValuesByIds=IS,i.selectIssueTypeFieldValuesMapping=wS,i.selectIssueTypeFieldValuesOfIssue=rb,i.selectIssueTypeFields=Et,i.selectIssueTypeFieldsAttachmentById=cS,i.selectIssueTypeFieldsAttachments=fn,i.selectIssueTypeFieldsAttachmentsByIds=rS,i.selectIssueTypeFieldsAttachmentsMapping=aS,i.selectIssueTypeFieldsById=BS,i.selectIssueTypeFieldsByIds=WS,i.selectIssueTypeFieldsMapping=VS,i.selectIssueTypeFieldsOfIssueType=db,i.selectIssueTypeIdentifierById=rA,i.selectIssueTypeIdentifierMapping=cA,i.selectIssueTypeIdentifierValueById=IA,i.selectIssueTypeIdentifierValueMapping=TA,i.selectIssueTypeIdentifierValues=ns,i.selectIssueTypeIdentifierValuesByIds=OA,i.selectIssueTypeIdentifierValuesOfIdentifier=pb,i.selectIssueTypeIdentifierValuesOfIssue=hb,i.selectIssueTypeIdentifiers=_n,i.selectIssueTypeIdentifiersByIds=dA,i.selectIssueTypeIdentifiersOfIssueType=ob,i.selectIssueTypeMapping=BA,i.selectIssueTypeStatusById=kn,i.selectIssueTypeStatusMapping=YA,i.selectIssueTypeStatuses=Mn,i.selectIssueTypeStatusesByIds=JA,i.selectIssueTypeStatusesOfIssueType=yb,i.selectIssueTypeValuesOfIssueType=ub,i.selectIssueTypes=bn,i.selectIssueTypesByIds=zA,i.selectIssueTypesOfOrganization=mb,i.selectIssueUpdateById=iw,i.selectIssueUpdateMapping=zn,i.selectIssueUpdates=qn,i.selectIssueUpdatesByIds=nw,i.selectIssueUpdatesOfIssue=aw,i.selectIssues=ss,i.selectIssuesByIds=vf,i.selectIssuesOfIssueType=Vf,i.selectIssuesOfProject=nb,i.selectLatestAssetProcedureStepFieldsOfAssetProcedureStep=AP,i.selectLatestAssetProcedureTypeFieldsOfAssetProcedureType=oP,i.selectLatestAssetTypeFieldsOfAssetType=kP,i.selectLatestFieldsByAssetProcedureStep=wP,i.selectLatestFormRevisionOfForm=xP,i.selectLatestIssueTypeFieldsOfIssueType=lb,i.selectLatestRetryTime=Ib,i.selectLatestReviewOfWorkflowStepFieldValues=tR,i.selectLatestReviewRequestOfWorkflowStepFieldValues=xb,i.selectLatestWorkflowStepFieldValuesByWorkflowStepOfWorkflow=Xb,i.selectLatestWorkflowStepFieldValuesReviewByWorkflowStepFieldValues=iR,i.selectLatestWorkflowStepFieldsOfWorkflowStep=Yb,i.selectMembershipsByUserOfTeam=vb,i.selectOrganizationAccessById=Mw,i.selectOrganizationAccessMapping=rs,i.selectOrganizationAccessUserMapping=Ew,i.selectOrganizationAccessesByIds=kw,i.selectOrganizationById=Nw,i.selectOrganizationDocuments=NP,i.selectOrganizations=Lw,i.selectOrganizationsByIds=Gw,i.selectOrganizationsMapping=Uw,i.selectProjectAccessById=uT,i.selectProjectAccessMapping=Hn,i.selectProjectAccesses=vt,i.selectProjectAccessesByIds=oT,i.selectProjectAccessesOfProject=Fb,i.selectProjectAttachmentById=FT,i.selectProjectAttachmentMapping=OT,i.selectProjectAttachments=Yn,i.selectProjectAttachmentsByIds=_T,i.selectProjectById=xT,i.selectProjectDocuments=LP,i.selectProjectFileById=DT,i.selectProjectFileMapping=zT,i.selectProjectFiles=qT,i.selectProjectFilesByIds=jT,i.selectProjectMapping=XT,i.selectProjects=ds,i.selectProjectsByIds=eI,i.selectProjectsOfOrganization=Rb,i.selectRehydrated=Eb,i.selectReviewRequestsOfWorkflowStepFieldValues=GF,i.selectReviewsOfWorkflowStepFieldValues=n_,i.selectStageMapping=si,i.selectTeamById=bI,i.selectTeamMembershipById=mI,i.selectTeamMemberships=ls,i.selectTeamMembershipsByIds=yI,i.selectTeamMembershipsMapping=pI,i.selectTeams=ea,i.selectTeamsByIds=RI,i.selectTeamsMapping=PI,i.selectTeamsOfOrganization=Bb,i.selectUploadUrl=YP,i.selectUserById=cs,i.selectUsers=as,i.selectUsersByIds=Sw,i.selectUsersMapping=Cn,i.selectUsersOfOrganization=wb,i.selectUsersOfProject=gb,i.selectUsersOfTeam=Vb,i.selectWorkflowById=LI,i.selectWorkflowMapping=UI,i.selectWorkflowStepAssigneeById=iO,i.selectWorkflowStepAssignees=Vt,i.selectWorkflowStepAssigneesByIds=nO,i.selectWorkflowStepAssigneesMapping=sO,i.selectWorkflowStepAssigneesOfWorkflow=Db,i.selectWorkflowStepAssigneesOfWorkflowAndWorkflowStep=$b,i.selectWorkflowStepAssigneesOfWorkflowStep=jb,i.selectWorkflowStepById=E_,i.selectWorkflowStepCommentById=SO,i.selectWorkflowStepComments=Bt,i.selectWorkflowStepCommentsByIds=AO,i.selectWorkflowStepCommentsMapping=fO,i.selectWorkflowStepCommentsOfWorkflow=Cb,i.selectWorkflowStepCommentsOfWorkflowAndWorkflowStep=Lb,i.selectWorkflowStepCommentsOfWorkflowStep=Ub,i.selectWorkflowStepEventById=EO,i.selectWorkflowStepEvents=Wt,i.selectWorkflowStepEventsByIds=vO,i.selectWorkflowStepEventsMapping=kO,i.selectWorkflowStepEventsOfWorkflow=Nb,i.selectWorkflowStepEventsOfWorkflowAndWorkflowStep=Hb,i.selectWorkflowStepEventsOfWorkflowStep=Gb,i.selectWorkflowStepFieldValues=ht,i.selectWorkflowStepFieldValuesAttachmentById=fF,i.selectWorkflowStepFieldValuesAttachments=pa,i.selectWorkflowStepFieldValuesAttachmentsByIds=SF,i.selectWorkflowStepFieldValuesAttachmentsMapping=yF,i.selectWorkflowStepFieldValuesById=EF,i.selectWorkflowStepFieldValuesByIds=vF,i.selectWorkflowStepFieldValuesMapping=kF,i.selectWorkflowStepFieldValuesOfWorkflow=Jb,i.selectWorkflowStepFieldValuesOfWorkflowAndWorkflowStep=Qb,i.selectWorkflowStepFieldValuesOfWorkflowStep=Zb,i.selectWorkflowStepFieldValuesReviewById=s_,i.selectWorkflowStepFieldValuesReviewRequestById=LF,i.selectWorkflowStepFieldValuesReviewRequests=zt,i.selectWorkflowStepFieldValuesReviewRequestsByIds=NF,i.selectWorkflowStepFieldValuesReviewRequestsMapping=UF,i.selectWorkflowStepFieldValuesReviewRequestsOfWorkflowAndWorkflowStep=eR,i.selectWorkflowStepFieldValuesReviews=It,i.selectWorkflowStepFieldValuesReviewsByIds=i_,i.selectWorkflowStepFieldValuesReviewsMapping=t_,i.selectWorkflowStepFieldValuesReviewsOfWorkflowAndWorkflowStep=sR,i.selectWorkflowStepFields=os,i.selectWorkflowStepFieldsAttachmentById=NO,i.selectWorkflowStepFieldsAttachments=da,i.selectWorkflowStepFieldsAttachmentsByIds=GO,i.selectWorkflowStepFieldsAttachmentsMapping=UO,i.selectWorkflowStepFieldsById=nF,i.selectWorkflowStepFieldsByIds=aF,i.selectWorkflowStepFieldsMapping=iF,i.selectWorkflowStepFieldsOfWorkflowStep=Kb,i.selectWorkflowStepReviewerById=S_,i.selectWorkflowStepReviewers=qt,i.selectWorkflowStepReviewersByIds=A_,i.selectWorkflowStepReviewersMapping=f_,i.selectWorkflowStepReviewersOfWorkflow=nR,i.selectWorkflowStepReviewersOfWorkflowAndWorkflowStep=cR,i.selectWorkflowStepReviewersOfWorkflowStep=aR,i.selectWorkflowSteps=Fa,i.selectWorkflowStepsByIds=v_,i.selectWorkflowStepsMapping=k_,i.selectWorkflowStepsOfWorkflowType=rR,i.selectWorkflowTypeById=G_,i.selectWorkflowTypeMapping=N_,i.selectWorkflowTypes=ga,i.selectWorkflowTypesByIds=H_,i.selectWorkflowTypesOfOrganization=dR,i.selectWorkflows=us,i.selectWorkflowsByIds=NI,i.selectWorkflowsOfProject=zb,i.selectWorkflowsOfWorkflowType=qb,i.setAsset=Ml,i.setAssetAttachment=oc,i.setAssetAttachments=hc,i.setAssetProcedure=Ur,i.setAssetProcedureStep=ol,i.setAssetProcedureStepFieldValues=xd,i.setAssetProcedureStepFieldValuesAttachment=jd,i.setAssetProcedureStepFieldValuesAttachments=$d,i.setAssetProcedureStepFieldValuesMany=el,i.setAssetProcedureStepFields=bd,i.setAssetProcedureStepFieldsAttachment=pd,i.setAssetProcedureStepFieldsAttachments=md,i.setAssetProcedureStepFieldsMany=Rd,i.setAssetProcedureSteps=hl,i.setAssetProcedureType=id,i.setAssetProcedureTypeAttachment=gc,i.setAssetProcedureTypeAttachments=Pc,i.setAssetProcedureTypeFieldValues=Pr,i.setAssetProcedureTypeFieldValuesAttachment=hr,i.setAssetProcedureTypeFieldValuesAttachments=pr,i.setAssetProcedureTypeFieldValuesMany=br,i.setAssetProcedureTypeFields=xc,i.setAssetProcedureTypeFieldsAttachment=jc,i.setAssetProcedureTypeFieldsAttachments=$c,i.setAssetProcedureTypeFieldsMany=er,i.setAssetProcedureTypes=nd,i.setAssetProcedures=Lr,i.setAssetStage=xl,i.setAssetStageCompletion=$l,i.setAssetStageCompletions=Cl,i.setAssetStages=eu,i.setAssetType=th,i.setAssetTypeAttachment=pu,i.setAssetTypeAttachments=mu,i.setAssetTypeFieldValues=yo,i.setAssetTypeFieldValuesAttachment=eo,i.setAssetTypeFieldValuesAttachments=to,i.setAssetTypeFieldValuesMany=fo,i.setAssetTypeFields=Cu,i.setAssetTypeFieldsAttachment=bu,i.setAssetTypeFieldsAttachments=Ru,i.setAssetTypeFieldsMany=Uu,i.setAssetTypeIdentifier=Mo,i.setAssetTypeIdentifierValue=Lo,i.setAssetTypeIdentifierValues=No,i.setAssetTypeIdentifiers=ko,i.setAssetTypeStatus=Sh,i.setAssetTypeStatuses=Ah,i.setAssetTypes=sh,i.setAssets=kl,i.setClientSDK=hg,i.setClientStore=ug,i.setConversation=ac,i.setConversations=sP,i.setCurrentUser=fb,i.setCurrentUserProfile=Sb,i.setDocument=Yh,i.setDocumentAttachment=Bh,i.setDocumentAttachments=Wh,i.setDocuments=Jh,i.setEmailDomain=dp,i.setEmailDomains=lp,i.setForm=Fm,i.setFormIdentifier=gp,i.setFormIdentifierValue=jp,i.setFormIdentifierValues=$p,i.setFormIdentifiers=Pp,i.setFormRevision=om,i.setFormRevisionAttachment=xp,i.setFormRevisionAttachments=em,i.setFormRevisions=hm,i.setFormSubmission=Km,i.setFormSubmissionAttachment=zm,i.setFormSubmissionAttachments=qm,i.setFormSubmissions=Ym,i.setForms=_m,i.setGeoImage=cy,i.setGeoImages=ry,i.setIssue=gf,i.setIssueAssociation=Iy,i.setIssueAssociations=Ty,i.setIssueAttachment=Dy,i.setIssueAttachments=jy,i.setIssueComment=pf,i.setIssueCommentAttachment=Xy,i.setIssueCommentAttachments=xy,i.setIssueComments=mf,i.setIssueType=RA,i.setIssueTypeAttachment=jf,i.setIssueTypeAttachments=$f,i.setIssueTypeFieldValues=pS,i.setIssueTypeFieldValuesAttachment=$S,i.setIssueTypeFieldValuesAttachments=CS,i.setIssueTypeFieldValuesMany=mS,i.setIssueTypeFields=bS,i.setIssueTypeFieldsAttachment=xf,i.setIssueTypeFieldsAttachments=eS,i.setIssueTypeFieldsMany=RS,i.setIssueTypeIdentifier=eA,i.setIssueTypeIdentifierValue=mA,i.setIssueTypeIdentifierValues=yA,i.setIssueTypeIdentifiers=tA,i.setIssueTypeStatus=UA,i.setIssueTypeStatuses=LA,i.setIssueTypes=MA,i.setIssueUpdate=xA,i.setIssueUpdates=ew,i.setIssues=Pf,i.setLoggedIn=Rh,i.setOrganization=Ww,i.setOrganizationAccess=Ow,i.setOrganizationAccesses=Fw,i.setOrganizations=Bw,i.setProject=NT,i.setProjectAccess=iT,i.setProjectAccesses=nT,i.setProjectAttachment=fT,i.setProjectAttachments=ST,i.setProjectFile=RT,i.setProjectFiles=MT,i.setProjects=LT,i.setRehydrated=kb,i.setTeam=TI,i.setTeamMembership=cI,i.setTeamMemberships=rI,i.setTeams=II,i.setTokens=DP,i.setUploadUrl=KP,i.setUser=uw,i.setUsers=lw,i.setWorkflow=zI,i.setWorkflowStep=__,i.setWorkflowStepAssignee=ZI,i.setWorkflowStepAssignees=QI,i.setWorkflowStepComment=uO,i.setWorkflowStepComments=oO,i.setWorkflowStepEvent=_O,i.setWorkflowStepEvents=gO,i.setWorkflowStepFieldValues=_F,i.setWorkflowStepFieldValuesAttachment=uF,i.setWorkflowStepFieldValuesAttachments=oF,i.setWorkflowStepFieldValuesMany=gF,i.setWorkflowStepFieldValuesReview=ZF,i.setWorkflowStepFieldValuesReviewRequest=qF,i.setWorkflowStepFieldValuesReviewRequests=DF,i.setWorkflowStepFieldValuesReviews=QF,i.setWorkflowStepFields=QO,i.setWorkflowStepFieldsAttachment=qO,i.setWorkflowStepFieldsAttachments=DO,i.setWorkflowStepFieldsMany=XO,i.setWorkflowStepReviewer=u_,i.setWorkflowStepReviewers=o_,i.setWorkflowSteps=g_,i.setWorkflowType=D_,i.setWorkflowTypes=j_,i.setWorkflows=qI,i.shallowEqual=Bg,i.slugify=Jg,i.spacesToDashesLower=Yg,i.teamMembershipReducer=hI,i.teamMembershipSlice=Xn,i.teamReducer=MI,i.teamSlice=xn,i.toFileNameSafeString=Kg,i.toUuidArray=V,i.toUuidIdRecord=Hg,i.truncate=Zg,i.updateAsset=Pl,i.updateAssetAttachment=pc,i.updateAssetAttachments=mc,i.updateAssetProcedure=jr,i.updateAssetProcedureStep=yl,i.updateAssetProcedureStepFieldValues=tl,i.updateAssetProcedureStepFieldValuesAttachment=Cd,i.updateAssetProcedureStepFieldValuesAttachments=Ud,i.updateAssetProcedureStepFieldValuesMany=sl,i.updateAssetProcedureStepFields=Md,i.updateAssetProcedureStepFieldsAttachment=yd,i.updateAssetProcedureStepFieldsAttachments=fd,i.updateAssetProcedureStepFieldsMany=kd,i.updateAssetProcedureSteps=fl,i.updateAssetProcedureType=xr,i.updateAssetProcedureTypeAttachment=bc,i.updateAssetProcedureTypeAttachments=Rc,i.updateAssetProcedureTypeFieldValues=Rr,i.updateAssetProcedureTypeFieldValuesAttachment=mr,i.updateAssetProcedureTypeFieldValuesAttachments=yr,i.updateAssetProcedureTypeFieldValuesMany=Mr,i.updateAssetProcedureTypeFields=tr,i.updateAssetProcedureTypeFieldsAttachment=Cc,i.updateAssetProcedureTypeFieldsAttachments=Uc,i.updateAssetProcedureTypeFieldsMany=sr,i.updateAssetProcedureTypes=ed,i.updateAssetProcedures=$r,i.updateAssetStage=iu,i.updateAssetStageCompletion=Ul,i.updateAssetStageCompletions=Ll,i.updateAssetStages=nu,i.updateAssetType=ah,i.updateAssetTypeAttachment=yu,i.updateAssetTypeAttachments=fu,i.updateAssetTypeFieldValues=So,i.updateAssetTypeFieldValuesAttachment=so,i.updateAssetTypeFieldValuesAttachments=io,i.updateAssetTypeFieldValuesMany=Ao,i.updateAssetTypeFields=Lu,i.updateAssetTypeFieldsAttachment=Mu,i.updateAssetTypeFieldsAttachments=ku,i.updateAssetTypeFieldsMany=Nu,i.updateAssetTypeIdentifier=Eo,i.updateAssetTypeIdentifierValue=Go,i.updateAssetTypeIdentifierValues=Ho,i.updateAssetTypeIdentifiers=vo,i.updateAssetTypeStatus=wh,i.updateAssetTypeStatuses=Th,i.updateAssetTypes=ch,i.updateAssets=bl,i.updateConversation=cc,i.updateConversations=iP,i.updateDocument=Zh,i.updateDocumentAttachment=zh,i.updateDocumentAttachments=qh,i.updateDocuments=Qh,i.updateEmailDomain=up,i.updateEmailDomains=op,i.updateForm=gm,i.updateFormIdentifier=bp,i.updateFormIdentifierValue=Cp,i.updateFormIdentifierValues=Up,i.updateFormIdentifiers=Rp,i.updateFormRevision=pm,i.updateFormRevisionAttachment=tm,i.updateFormRevisionAttachments=sm,i.updateFormRevisions=mm,i.updateFormSubmission=Zm,i.updateFormSubmissionAttachment=Dm,i.updateFormSubmissionAttachments=jm,i.updateFormSubmissions=Qm,i.updateForms=Pm,i.updateGeoImage=uy,i.updateGeoImages=oy,i.updateIssue=bf,i.updateIssueAssociation=Oy,i.updateIssueAssociations=Fy,i.updateIssueAttachment=$y,i.updateIssueAttachments=Cy,i.updateIssueComment=yf,i.updateIssueCommentAttachment=ef,i.updateIssueCommentAttachments=tf,i.updateIssueComments=ff,i.updateIssueType=kA,i.updateIssueTypeAttachment=Cf,i.updateIssueTypeAttachments=Uf,i.updateIssueTypeFieldValues=yS,i.updateIssueTypeFieldValuesAttachment=US,i.updateIssueTypeFieldValuesAttachments=LS,i.updateIssueTypeFieldValuesMany=fS,i.updateIssueTypeFields=MS,i.updateIssueTypeFieldsAttachment=tS,i.updateIssueTypeFieldsAttachments=sS,i.updateIssueTypeFieldsMany=kS,i.updateIssueTypeIdentifier=sA,i.updateIssueTypeIdentifierValue=fA,i.updateIssueTypeIdentifierValues=SA,i.updateIssueTypeIdentifiers=iA,i.updateIssueTypeStatus=NA,i.updateIssueTypeStatuses=GA,i.updateIssueTypes=EA,i.updateIssueUpdate=tw,i.updateIssueUpdates=sw,i.updateIssues=Rf,i.updateOrganization=jw,i.updateOrganizationAccess=_w,i.updateOrganizationAccesses=gw,i.updateOrganizations=Dw,i.updateProject=YT,i.updateProjectAccess=aT,i.updateProjectAccesses=cT,i.updateProjectAttachment=AT,i.updateProjectAttachments=wT,i.updateProjectFile=vT,i.updateProjectFiles=VT,i.updateProjects=KT,i.updateTeam=OI,i.updateTeamMembership=dI,i.updateTeamMemberships=lI,i.updateTeams=FI,i.updateUser=pw,i.updateUsers=hw,i.updateWorkflow=DI,i.updateWorkflowStep=P_,i.updateWorkflowStepAssignee=XI,i.updateWorkflowStepAssignees=xI,i.updateWorkflowStepComment=hO,i.updateWorkflowStepComments=pO,i.updateWorkflowStepEvent=PO,i.updateWorkflowStepEvents=bO,i.updateWorkflowStepFieldValues=PF,i.updateWorkflowStepFieldValuesAttachment=hF,i.updateWorkflowStepFieldValuesAttachments=pF,i.updateWorkflowStepFieldValuesMany=bF,i.updateWorkflowStepFieldValuesReview=XF,i.updateWorkflowStepFieldValuesReviewRequest=jF,i.updateWorkflowStepFieldValuesReviewRequests=$F,i.updateWorkflowStepFieldValuesReviews=xF,i.updateWorkflowStepFields=xO,i.updateWorkflowStepFieldsAttachment=jO,i.updateWorkflowStepFieldsAttachments=$O,i.updateWorkflowStepFieldsMany=eF,i.updateWorkflowStepReviewer=h_,i.updateWorkflowStepReviewers=p_,i.updateWorkflowSteps=b_,i.updateWorkflowType=$_,i.updateWorkflowTypes=C_,i.updateWorkflows=jI,i.useSelectorBuilder=Vg,i.userReducer=yw,i.userSlice=Dn,i.uuidObj=O,i.uuidObjSortFn=As,i.uuidSortFn=Ut,i.versioningReducer=EI,i.versioningSlice=kI,i.workflowReducer=GI,i.workflowSlice=ta,i.workflowStepAssigneeReducer=aO,i.workflowStepAssigneeSlice=sa,i.workflowStepCommentReducer=wO,i.workflowStepCommentSlice=ia,i.workflowStepEventReducer=VO,i.workflowStepEventSlice=na,i.workflowStepFieldValuesAttachmentReducer=wF,i.workflowStepFieldValuesAttachmentSlice=ua,i.workflowStepFieldValuesReducer=VF,i.workflowStepFieldValuesReviewReducer=a_,i.workflowStepFieldValuesReviewRequestReducer=HF,i.workflowStepFieldValuesReviewRequestSlice=ya,i.workflowStepFieldValuesReviewSlice=Aa,i.workflowStepFieldValuesSlice=ma,i.workflowStepFieldsAttachmentReducer=HO,i.workflowStepFieldsAttachmentSlice=aa,i.workflowStepFieldsReducer=cF,i.workflowStepFieldsSlice=la,i.workflowStepReducer=V_,i.workflowStepReviewerReducer=w_,i.workflowStepReviewerSlice=Ia,i.workflowStepSlice=Oa,i.workflowTypeReducer=K_,i.workflowTypeSlice=_a,Object.defineProperty(i,Symbol.toStringTag,{value:"Module"})});
|