From 3a91571bbcca4bb1d4e50392fdf0900492b04629 Mon Sep 17 00:00:00 2001 From: Artyom Zankevich Date: Fri, 26 Jul 2019 10:45:51 +0300 Subject: [PATCH] [NEW-UI] Add task filter reducer (#587) * Case sensitive renaming * Update `cvat-js` lib. * Add `.env` file * Add basic redux capabilities * Remove `setTimeout` as it was fixes in `cvat-js` * Remove redundant state field * Add header and footer styles * Remove `Affix` * Add basic styles to task cards * Fix empty component * Pagination fixes * Add modal on task delete * Rename reducers * Add task reducer * Add lib. to parse query strings * Minor refactoring * Update `cvatjs` * Add tasks filter reducer * Do not make request with the same input value * Fix some linter errors * Refactor `dashboard-content` component * Router changes Redirect added. Page not found added. --- cvat-ui/package.json | 1 + cvat-ui/public/cvat.min.js | 8 +- cvat-ui/src/actions/auth.actions.ts | 13 ++ cvat-ui/src/actions/authentication-action.ts | 13 -- cvat-ui/src/actions/tasks-filter.actions.ts | 6 + cvat-ui/src/actions/tasks.actions.ts | 19 +++ cvat-ui/src/components/app/app.tsx | 33 ++-- .../dashboard/content/dashboard-content.tsx | 160 ++++++++---------- .../src/components/dashboard/dashboard.tsx | 98 +++++------ .../dashboard/footer/dashboard-footer.tsx | 39 +++-- .../dashboard/header/dashboard-header.tsx | 80 +++++---- .../src/components/not-found/not-found.scss | 6 + .../components/not-found/not-found.test.tsx | 9 + .../src/components/not-found/not-found.tsx | 19 +++ ...uthenticate-reducer.ts => auth.reducer.ts} | 4 +- cvat-ui/src/reducers/root-reducer.ts | 7 - cvat-ui/src/reducers/root.reducer.ts | 11 ++ cvat-ui/src/reducers/tasks-filter.reducer.ts | 12 ++ cvat-ui/src/reducers/tasks.reducer.ts | 12 ++ cvat-ui/src/store.ts | 2 +- 20 files changed, 308 insertions(+), 244 deletions(-) create mode 100644 cvat-ui/src/actions/auth.actions.ts delete mode 100644 cvat-ui/src/actions/authentication-action.ts create mode 100644 cvat-ui/src/actions/tasks-filter.actions.ts create mode 100644 cvat-ui/src/actions/tasks.actions.ts create mode 100644 cvat-ui/src/components/not-found/not-found.scss create mode 100644 cvat-ui/src/components/not-found/not-found.test.tsx create mode 100644 cvat-ui/src/components/not-found/not-found.tsx rename cvat-ui/src/reducers/{authenticate-reducer.ts => auth.reducer.ts} (55%) delete mode 100644 cvat-ui/src/reducers/root-reducer.ts create mode 100644 cvat-ui/src/reducers/root.reducer.ts create mode 100644 cvat-ui/src/reducers/tasks-filter.reducer.ts create mode 100644 cvat-ui/src/reducers/tasks.reducer.ts diff --git a/cvat-ui/package.json b/cvat-ui/package.json index c5277b39..482e32d3 100644 --- a/cvat-ui/package.json +++ b/cvat-ui/package.json @@ -16,6 +16,7 @@ "less": "^3.9.0", "less-loader": "^5.0.0", "node-sass": "^4.12.0", + "query-string": "^6.8.1", "react": "^16.8.6", "react-app-rewired": "^2.1.3", "react-dom": "^16.8.6", diff --git a/cvat-ui/public/cvat.min.js b/cvat-ui/public/cvat.min.js index 7ec541e7..86d2d35b 100644 --- a/cvat-ui/public/cvat.min.js +++ b/cvat-ui/public/cvat.min.js @@ -1,22 +1,22 @@ -!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=80)}([function(e,t,r){(function(t){var r="object",n=function(e){return e&&e.Math==Math&&e};e.exports=n(typeof globalThis==r&&globalThis)||n(typeof window==r&&window)||n(typeof self==r&&self)||n(typeof t==r&&t)||Function("return this")()}).call(this,r(33))},function(e,t,r){var n=r(0),o=r(27),i=r(49),s=r(86),a=n.Symbol,c=o("wks");e.exports=function(e){return c[e]||(c[e]=s&&a[e]||(s?a:i)("Symbol."+e))}},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t,r){var n=r(9);e.exports=function(e){if(!n(e))throw TypeError(String(e)+" is not an object");return e}},function(e,t,r){"use strict";var n=r(71),o=r(114),i=Object.prototype.toString;function s(e){return"[object Array]"===i.call(e)}function a(e){return null!==e&&"object"==typeof e}function c(e){return"[object Function]"===i.call(e)}function u(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),s(e))for(var r=0,n=e.length;r=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==r?{value:n,done:!1}:"values"==r?{value:t[n],done:!1}:{value:[n,t[n]],done:!1}},"values"),i.Arguments=i.Array,o("keys"),o("values"),o("entries")},function(e,t,r){"use strict";var n,o,i,s=r(12),a=r(18),c=r(0),u=r(51),l=r(55),f=r(19),p=r(87),h=r(9),d=r(20),g=r(41),v=r(14),b=r(88),m=r(90),w=r(91),y=r(58).set,x=r(92),O=r(93),S=r(94),k=r(61),E=r(95),j=r(60),A=r(16),T=r(54),F=r(1)("species"),P="Promise",C=A.get,I=A.set,R=A.getterFor(P),N=c.Promise,L=c.TypeError,_=c.document,$=c.process,M=c.fetch,B=$&&$.versions,D=B&&B.v8||"",z=k.f,U=z,W="process"==v($),G=!!(_&&_.createEvent&&c.dispatchEvent),q=T(P,function(){var e=N.resolve(1),t=function(){},r=(e.constructor={})[F]=function(e){e(t,t)};return!((W||"function"==typeof PromiseRejectionEvent)&&(!a||e.finally)&&e.then(t)instanceof r&&0!==D.indexOf("6.6")&&-1===j.indexOf("Chrome/66"))}),J=q||!m(function(e){N.all(e).catch(function(){})}),V=function(e){var t;return!(!h(e)||"function"!=typeof(t=e.then))&&t},X=function(e,t,r){if(!t.notified){t.notified=!0;var n=t.reactions;x(function(){for(var o=t.value,i=1==t.state,s=0;n.length>s;){var a,c,u,l=n[s++],f=i?l.ok:l.fail,p=l.resolve,h=l.reject,d=l.domain;try{f?(i||(2===t.rejection&&Z(e,t),t.rejection=1),!0===f?a=o:(d&&d.enter(),a=f(o),d&&(d.exit(),u=!0)),a===l.promise?h(L("Promise-chain cycle")):(c=V(a))?c.call(a,p,h):p(a)):h(o)}catch(e){d&&!u&&d.exit(),h(e)}}t.reactions=[],t.notified=!1,r&&!t.rejection&&H(e,t)})}},K=function(e,t,r){var n,o;G?((n=_.createEvent("Event")).promise=t,n.reason=r,n.initEvent(e,!1,!0),c.dispatchEvent(n)):n={promise:t,reason:r},(o=c["on"+e])?o(n):"unhandledrejection"===e&&S("Unhandled promise rejection",r)},H=function(e,t){y.call(c,function(){var r,n=t.value;if(Y(t)&&(r=E(function(){W?$.emit("unhandledRejection",n,e):K("unhandledrejection",e,n)}),t.rejection=W||Y(t)?2:1,r.error))throw r.value})},Y=function(e){return 1!==e.rejection&&!e.parent},Z=function(e,t){y.call(c,function(){W?$.emit("rejectionHandled",e):K("rejectionhandled",e,t.value)})},Q=function(e,t,r,n){return function(o){e(t,r,o,n)}},ee=function(e,t,r,n){t.done||(t.done=!0,n&&(t=n),t.value=r,t.state=2,X(e,t,!0))},te=function(e,t,r,n){if(!t.done){t.done=!0,n&&(t=n);try{if(e===r)throw L("Promise can't be resolved itself");var o=V(r);o?x(function(){var n={done:!1};try{o.call(r,Q(te,e,n,t),Q(ee,e,n,t))}catch(r){ee(e,n,r,t)}}):(t.value=r,t.state=1,X(e,t,!1))}catch(r){ee(e,{done:!1},r,t)}}};q&&(N=function(e){g(this,N,P),d(e),n.call(this);var t=C(this);try{e(Q(te,this,t),Q(ee,this,t))}catch(e){ee(this,t,e)}},(n=function(e){I(this,{type:P,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=l(N.prototype,{then:function(e,t){var r=R(this),n=z(w(this,N));return n.ok="function"!=typeof e||e,n.fail="function"==typeof t&&t,n.domain=W?$.domain:void 0,r.parent=!0,r.reactions.push(n),0!=r.state&&X(this,r,!1),n.promise},catch:function(e){return this.then(void 0,e)}}),o=function(){var e=new n,t=C(e);this.promise=e,this.resolve=Q(te,e,t),this.reject=Q(ee,e,t)},k.f=z=function(e){return e===N||e===i?new o(e):U(e)},a||"function"!=typeof M||s({global:!0,enumerable:!0,forced:!0},{fetch:function(e){return O(N,M.apply(c,arguments))}})),s({global:!0,wrap:!0,forced:q},{Promise:N}),f(N,P,!1,!0),p(P),i=u.Promise,s({target:P,stat:!0,forced:q},{reject:function(e){var t=z(this);return t.reject.call(void 0,e),t.promise}}),s({target:P,stat:!0,forced:a||q},{resolve:function(e){return O(a&&this===i?N:this,e)}}),s({target:P,stat:!0,forced:J},{all:function(e){var t=this,r=z(t),n=r.resolve,o=r.reject,i=E(function(){var r=d(t.resolve),i=[],s=0,a=1;b(e,function(e){var c=s++,u=!1;i.push(void 0),a++,r.call(t,e).then(function(e){u||(u=!0,i[c]=e,--a||n(i))},o)}),--a||n(i)});return i.error&&o(i.value),r.promise},race:function(e){var t=this,r=z(t),n=r.reject,o=E(function(){var o=d(t.resolve);b(e,function(e){o.call(t,e).then(r.resolve,n)})});return o.error&&n(o.value),r.promise}})},function(e,t,r){var n=r(2);e.exports=!n(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,r){var n=r(8),o=r(13),i=r(25);e.exports=n?function(e,t,r){return o.f(e,t,i(1,r))}:function(e,t,r){return e[t]=r,e}},function(e,t,r){var n=r(0),o=r(101),i=r(6),s=r(10),a=r(1),c=a("iterator"),u=a("toStringTag"),l=i.values;for(var f in o){var p=n[f],h=p&&p.prototype;if(h){if(h[c]!==l)try{s(h,c,l)}catch(e){h[c]=l}if(h[u]||s(h,u,f),o[f])for(var d in i)if(h[d]!==i[d])try{s(h,d,i[d])}catch(e){h[d]=i[d]}}}},function(e,t,r){var n=r(0),o=r(34).f,i=r(10),s=r(15),a=r(37),c=r(50),u=r(54);e.exports=function(e,t){var r,l,f,p,h,d=e.target,g=e.global,v=e.stat;if(r=g?n:v?n[d]||a(d,{}):(n[d]||{}).prototype)for(l in t){if(p=t[l],f=e.noTargetGet?(h=o(r,l))&&h.value:r[l],!u(g?l:d+(v?".":"#")+l,e.forced)&&void 0!==f){if(typeof p==typeof f)continue;c(p,f)}(e.sham||f&&f.sham)&&i(p,"sham",!0),s(r,l,p,e)}}},function(e,t,r){var n=r(8),o=r(47),i=r(3),s=r(35),a=Object.defineProperty;t.f=n?a:function(e,t,r){if(i(e),t=s(t,!0),i(r),o)try{return a(e,t,r)}catch(e){}if("get"in r||"set"in r)throw TypeError("Accessors not supported");return"value"in r&&(e[t]=r.value),e}},function(e,t){var r={}.toString;e.exports=function(e){return r.call(e).slice(8,-1)}},function(e,t,r){var n=r(0),o=r(27),i=r(10),s=r(5),a=r(37),c=r(48),u=r(16),l=u.get,f=u.enforce,p=String(c).split("toString");o("inspectSource",function(e){return c.call(e)}),(e.exports=function(e,t,r,o){var c=!!o&&!!o.unsafe,u=!!o&&!!o.enumerable,l=!!o&&!!o.noTargetGet;"function"==typeof r&&("string"!=typeof t||s(r,"name")||i(r,"name",t),f(r).source=p.join("string"==typeof t?t:"")),e!==n?(c?!l&&e[t]&&(u=!0):delete e[t],u?e[t]=r:i(e,t,r)):u?e[t]=r:a(t,r)})(Function.prototype,"toString",function(){return"function"==typeof this&&l(this).source||c.call(this)})},function(e,t,r){var n,o,i,s=r(81),a=r(0),c=r(9),u=r(10),l=r(5),f=r(38),p=r(39),h=a.WeakMap;if(s){var d=new h,g=d.get,v=d.has,b=d.set;n=function(e,t){return b.call(d,e,t),t},o=function(e){return g.call(d,e)||{}},i=function(e){return v.call(d,e)}}else{var m=f("state");p[m]=!0,n=function(e,t){return u(e,m,t),t},o=function(e){return l(e,m)?e[m]:{}},i=function(e){return l(e,m)}}e.exports={set:n,get:o,has:i,enforce:function(e){return i(e)?o(e):n(e,{})},getterFor:function(e){return function(t){var r;if(!c(t)||(r=o(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return r}}}},function(e,t){e.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},function(e,t){e.exports=!1},function(e,t,r){var n=r(13).f,o=r(5),i=r(1)("toStringTag");e.exports=function(e,t,r){e&&!o(e=r?e:e.prototype,i)&&n(e,i,{configurable:!0,value:t})}},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e}},function(e,t){e.exports={}},function(e,t,r){r(96),r(6),r(7),r(11),(()=>{const{PluginError:t}=r(69),n=[];e.exports=class{static async apiWrapper(e,...r){const n=await window.cvat.plugins.list.implementation();for(const o of n){const n=o.functions.filter(t=>t.callback===e)[0];if(n&&n.enter)try{await n.enter.call(this,o,...r)}catch(e){throw e instanceof t?e:new t(`Exception in plugin ${o.name}: ${e.toString()}`)}}let o=await e.implementation.call(this,...r);for(const i of n){const n=i.functions.filter(t=>t.callback===e)[0];if(n&&n.leave)try{o=await n.leave.call(this,i,o,...r)}catch(e){throw e instanceof t?e:new t(`Exception in plugin ${i.name}: ${e.toString()}`)}}return o}static async register(e){const r=[];if("object"!=typeof e)throw new t(`Plugin should be an object, but got "${typeof e}"`);if(!("name"in e)||"string"!=typeof e.name)throw new t('Plugin must contain a "name" field and it must be a string');if(!("description"in e)||"string"!=typeof e.description)throw new t('Plugin must contain a "description" field and it must be a string');if("functions"in e)throw new t('Plugin must not contain a "functions" field');!function e(t,n){const o={};for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&("object"==typeof t[r]?Object.prototype.hasOwnProperty.call(n,r)&&e(t[r],n[r]):["enter","leave"].includes(r)&&"function"==typeof n&&(t[r],1)&&(o.callback=n,o[r]=t[r]));Object.keys(o).length&&r.push(o)}(e,{cvat:window.cvat}),Object.defineProperty(e,"functions",{value:r,writable:!1}),n.push(e)}static async list(){return n}}})()},function(e,t,r){var n=r(17);e.exports=function(e){return Object(n(e))}},function(e,t,r){r(6),r(7),r(106),r(11),(()=>{const t=new class{constructor(){const e=r(111),t=r(112);function n(e){t.defaults.headers.delete["X-CSRFToken"]=e,t.defaults.headers.patch["X-CSRFToken"]=e,t.defaults.headers.post["X-CSRFToken"]=e,t.defaults.headers.put["X-CSRFToken"]=e,t.defaults.withCredentials=!0}async function o(e=""){const{backendAPI:r}=window.cvat.config;let n=null;try{n=await t.get(`${r}/tasks?${e}`,{proxy:window.cvat.config.proxy})}catch(e){const t=e.response?e.response.status:e.code;throw new window.cvat.exceptions.ServerError("Could not get tasks from a server",t)}return n.data.results.count=n.data.count,n.data.results}async function i(e){const{backendAPI:r}=window.cvat.config;try{await t.delete(`${r}/tasks/${e}`)}catch(e){const t=e.response?e.response.status:e.code;throw new window.cvat.exceptions.ServerError("Could not delete the task from the server",t)}}const s=e.get("csrftoken");s&&n(s),Object.defineProperties(this,Object.freeze({server:{value:Object.freeze({about:async function(){const{backendAPI:e}=window.cvat.config;let r=null;try{r=await t.get(`${e}/server/about`,{proxy:window.cvat.config.proxy})}catch(e){const t=e.response?e.response.status:e.code;throw new window.cvat.exceptions.ServerError('Could not get "about" information from the server',t)}return r.data},share:async function(e){const{backendAPI:r}=window.cvat.config;let n=null;try{n=await t.get(`${r}/server/share?directory=${e}`,{proxy:window.cvat.config.proxy})}catch(e){const t=e.response?e.response.status:e.code;throw new window.cvat.exceptions.ServerError('Could not get "share" information from the server',t)}return n.data},exception:async function(e){const{backendAPI:r}=window.cvat.config;try{await t.post(`${r}/server/exception`,JSON.stringify(e),{proxy:window.cvat.config.proxy,headers:{"Content-Type":"application/json"}})}catch(e){const t=e.response?e.response.status:e.code;throw new window.cvat.exceptions.ServerError("Could not send an exception to the server",t)}},login:async function(r,o){function i(r){if(r.headers["set-cookie"]){let o="";for(let t of r.headers["set-cookie"]){[t]=t.split(";");const r=t.split("=")[0],i=t.split("=")[1];"csrftoken"===r&&n(i),e.set(r,i),o+=`${t};`}t.defaults.headers.common.Cookie=o}else{let t=r.data.csrf;if(t)n(t),e.set("csrftoken",t);else{if(!(t=e.get("csrftoken")))throw new window.cvat.exceptions.ScriptingError("An environment has been detected as a browser, but CSRF token has not been found in cookies");n(t)}}}const s=window.cvat.config.backendAPI.slice(0,-7);let a=null;try{a=await t.get(`${s}/auth/csrf`,{proxy:window.cvat.config.proxy})}catch(e){const t=e.response?e.response.status:e.code;throw new window.cvat.exceptions.ServerError("Could not get CSRF token from a server",t)}i(a);const c=[`${encodeURIComponent("username")}=${encodeURIComponent(r)}`,`${encodeURIComponent("password")}=${encodeURIComponent(o)}`].join("&").replace(/%20/g,"+");let u=null;try{u=await t.post(`${s}/auth/login`,c,{"Content-Type":"application/x-www-form-urlencoded",proxy:window.cvat.config.proxy,maxRedirects:0})}catch(e){if(302!==e.response.status){const t=e.response?e.response.status:e.code;throw new window.cvat.exceptions.ServerError("Could not login on a server",t)}u=e.response}if(u.data.includes("didn't match"))throw new window.cvat.exceptions.ServerError("The pair login/password is invalid",403);i(u)},logout:async function(){const e=window.cvat.config.backendAPI.slice(0,-7);try{await t.get(`${e}/auth/logout`,{proxy:window.cvat.config.proxy})}catch(e){const t=e.response?e.response.status:e.code;throw new window.cvat.exceptions.ServerError("Could not logout from the server",t)}}}),writable:!1},tasks:{value:Object.freeze({getTasks:o,saveTask:async function(e,r){const{backendAPI:n}=window.cvat.config;try{await t.patch(`${n}/tasks/${e}`,JSON.stringify(r),{proxy:window.cvat.config.proxy,headers:{"Content-Type":"application/json"}})}catch(e){const t=e.response?e.response.status:e.code;throw new window.cvat.exceptions.ServerError("Could not save the task on the server",t)}},createTask:async function(e,r,n){const{backendAPI:s}=window.cvat.config,a=new window.FormData;for(const e in r)if(Object.prototype.hasOwnProperty.call(r,e))for(let t=0;t{setTimeout(async function i(){try{const a=await t.get(`${s}/tasks/${e}/status`);["Queued","Started"].includes(a.data.state)?(""!==a.data.message&&n(a.data.message),setTimeout(i,1e3)):"Finished"===a.data.state?r():"Failed"===a.data.state?o(new window.cvat.exceptions.ServerError("Could not create the task on the server",400)):o(new window.cvat.exceptions.ServerError(`Unknown task state has been recieved: ${a.data.state}`,500))}catch(e){const t=e.response?e.response.status:e.code;o(new window.cvat.exceptions.ServerError("Data uploading error occured",t))}},1e3)})}(c.data.id)}catch(e){throw await i(c.data.id),e}return(await o(`?id=${c.id}`))[0]},deleteTask:i}),writable:!1},jobs:{value:Object.freeze({getJob:async function(e){const{backendAPI:r}=window.cvat.config;let n=null;try{n=await t.get(`${r}/jobs/${e}`,{proxy:window.cvat.config.proxy})}catch(e){const t=e.response?e.response.status:e.code;throw new window.cvat.exceptions.ServerError("Could not get jobs from a server",t)}return n.data},saveJob:async function(e,r){const{backendAPI:n}=window.cvat.config;try{await t.patch(`${n}/jobs/${e}`,JSON.stringify(r),{proxy:window.cvat.config.proxy,headers:{"Content-Type":"application/json"}})}catch(e){const t=e.response?e.response.status:e.code;throw new window.cvat.exceptions.ServerError("Could not save the job on the server",t)}}}),writable:!1},users:{value:Object.freeze({getUsers:async function(){const{backendAPI:e}=window.cvat.config;let r=null;try{r=await t.get(`${e}/users`,{proxy:window.cvat.config.proxy})}catch(e){const t=e.response?e.response.status:e.code;throw new window.cvat.exceptions.ServerError("Could not get users from the server",t)}return r.data.results},getSelf:async function(){const{backendAPI:e}=window.cvat.config;let r=null;try{r=await t.get(`${e}/users/self`,{proxy:window.cvat.config.proxy})}catch(e){const t=e.response?e.response.status:e.code;throw new window.cvat.exceptions.ServerError("Could not get users from the server",t)}return r.data}}),writable:!1},frames:{value:Object.freeze({getFrame:async function(e,r){const{backendAPI:n}=window.cvat.config;let o=null;try{o=await t.get(`${n}/tasks/${e}/frames/${r}`,{proxy:window.cvat.config.proxy,responseType:"blob"})}catch(t){const n=t.response?t.response.status:t.code;throw new window.cvat.exceptions.ServerError(`Could not get frame ${r} for the task ${e} from the server`,n)}return o.data},getMeta:async function(e){const{backendAPI:r}=window.cvat.config;let n=null;try{n=await t.get(`${r}/tasks/${e}/frames/meta`,{proxy:window.cvat.config.proxy})}catch(t){const r=t.response?t.response.status:t.code;throw new window.cvat.exceptions.ServerError(`Could not get frame meta info for the task ${e} from the server`,r)}return n.data}}),writable:!1},annotations:{value:Object.freeze({getTaskAnnotations:async function(e){const{backendAPI:r}=window.cvat.config;let n=null;try{n=await t.get(`${r}/tasks/${e}/annotations`,{proxy:window.cvat.config.proxy})}catch(t){const r=t.response?t.response.status:t.code;throw new window.cvat.exceptions.ServerError(`Could not get annotations for the task ${e} from the server`,r)}return n.data},getJobAnnotations:async function(e){const{backendAPI:r}=window.cvat.config;let n=null;try{n=await t.get(`${r}/jobs/${e}/annotations`,{proxy:window.cvat.config.proxy})}catch(t){const r=t.response?t.response.status:t.code;throw new window.cvat.exceptions.ServerError(`Could not get annotations for the job ${e} from the server`,r)}return n.data}}),writable:!1}}))}};e.exports=t})()},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,r){var n=r(46),o=r(17);e.exports=function(e){return n(o(e))}},function(e,t,r){var n=r(0),o=r(37),i=r(18),s=n["__core-js_shared__"]||o("__core-js_shared__",{});(e.exports=function(e,t){return s[e]||(s[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.1.3",mode:i?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},function(e,t,r){var n=r(51),o=r(0),i=function(e){return"function"==typeof e?e:void 0};e.exports=function(e,t){return arguments.length<2?i(n[e])||i(o[e]):n[e]&&n[e][t]||o[e]&&o[e][t]}},function(e,t,r){var n=r(30),o=Math.min;e.exports=function(e){return e>0?o(n(e),9007199254740991):0}},function(e,t){var r=Math.ceil,n=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?n:r)(e)}},function(e,t,r){var n=r(20);e.exports=function(e,t,r){if(n(e),void 0===t)return e;switch(r){case 0:return function(){return e.call(t)};case 1:return function(r){return e.call(t,r)};case 2:return function(r,n){return e.call(t,r,n)};case 3:return function(r,n,o){return e.call(t,r,n,o)}}return function(){return e.apply(t,arguments)}}},function(e,t,r){var n=r(89),o=r(21),i=r(1)("iterator");e.exports=function(e){if(null!=e)return e[i]||e["@@iterator"]||o[n(e)]}},function(e,t){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(e){"object"==typeof window&&(r=window)}e.exports=r},function(e,t,r){var n=r(8),o=r(45),i=r(25),s=r(26),a=r(35),c=r(5),u=r(47),l=Object.getOwnPropertyDescriptor;t.f=n?l:function(e,t){if(e=s(e),t=a(t,!0),u)try{return l(e,t)}catch(e){}if(c(e,t))return i(!o.f.call(e,t),e[t])}},function(e,t,r){var n=r(9);e.exports=function(e,t){if(!n(e))return e;var r,o;if(t&&"function"==typeof(r=e.toString)&&!n(o=r.call(e)))return o;if("function"==typeof(r=e.valueOf)&&!n(o=r.call(e)))return o;if(!t&&"function"==typeof(r=e.toString)&&!n(o=r.call(e)))return o;throw TypeError("Can't convert object to primitive value")}},function(e,t,r){var n=r(0),o=r(9),i=n.document,s=o(i)&&o(i.createElement);e.exports=function(e){return s?i.createElement(e):{}}},function(e,t,r){var n=r(0),o=r(10);e.exports=function(e,t){try{o(n,e,t)}catch(r){n[e]=t}return t}},function(e,t,r){var n=r(27),o=r(49),i=n("keys");e.exports=function(e){return i[e]||(i[e]=o(e))}},function(e,t){e.exports={}},function(e,t){e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},function(e,t){e.exports=function(e,t,r){if(!(e instanceof t))throw TypeError("Incorrect "+(r?r+" ":"")+"invocation");return e}},function(e,t,r){var n=r(30),o=r(17),i=function(e){return function(t,r){var i,s,a=String(o(t)),c=n(r),u=a.length;return c<0||c>=u?e?"":void 0:(i=a.charCodeAt(c))<55296||i>56319||c+1===u||(s=a.charCodeAt(c+1))<56320||s>57343?e?a.charAt(c):i:e?a.slice(c,c+2):s-56320+(i-55296<<10)+65536}};e.exports={codeAt:i(!1),charAt:i(!0)}},function(e,t,r){"use strict";(function(t){var n=r(4),o=r(117),i={"Content-Type":"application/x-www-form-urlencoded"};function s(e,t){!n.isUndefined(e)&&n.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var a,c={adapter:("undefined"!=typeof XMLHttpRequest?a=r(72):void 0!==t&&(a=r(72)),a),transformRequest:[function(e,t){return o(t,"Content-Type"),n.isFormData(e)||n.isArrayBuffer(e)||n.isBuffer(e)||n.isStream(e)||n.isFile(e)||n.isBlob(e)?e:n.isArrayBufferView(e)?e.buffer:n.isURLSearchParams(e)?(s(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):n.isObject(e)?(s(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(e){}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,validateStatus:function(e){return e>=200&&e<300}};c.headers={common:{Accept:"application/json, text/plain, */*"}},n.forEach(["delete","get","head"],function(e){c.headers[e]={}}),n.forEach(["post","put","patch"],function(e){c.headers[e]=n.merge(i)}),e.exports=c}).call(this,r(116))},function(e,t,r){"use strict";r(12)({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return URL.prototype.toString.call(this)}})},function(e,t,r){"use strict";var n={}.propertyIsEnumerable,o=Object.getOwnPropertyDescriptor,i=o&&!n.call({1:2},1);t.f=i?function(e){var t=o(this,e);return!!t&&t.enumerable}:n},function(e,t,r){var n=r(2),o=r(14),i="".split;e.exports=n(function(){return!Object("z").propertyIsEnumerable(0)})?function(e){return"String"==o(e)?i.call(e,""):Object(e)}:Object},function(e,t,r){var n=r(8),o=r(2),i=r(36);e.exports=!n&&!o(function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a})},function(e,t,r){var n=r(27);e.exports=n("native-function-to-string",Function.toString)},function(e,t){var r=0,n=Math.random();e.exports=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++r+n).toString(36)}},function(e,t,r){var n=r(5),o=r(82),i=r(34),s=r(13);e.exports=function(e,t){for(var r=o(t),a=s.f,c=i.f,u=0;uc;)n(a,r=t[c++])&&(~i(u,r)||u.push(r));return u}},function(e,t){t.f=Object.getOwnPropertySymbols},function(e,t,r){var n=r(2),o=/#|\.prototype\./,i=function(e,t){var r=a[s(e)];return r==u||r!=c&&("function"==typeof t?n(t):!!t)},s=i.normalize=function(e){return String(e).replace(o,".").toLowerCase()},a=i.data={},c=i.NATIVE="N",u=i.POLYFILL="P";e.exports=i},function(e,t,r){var n=r(15);e.exports=function(e,t,r){for(var o in t)n(e,o,t[o],r);return e}},function(e,t,r){var n=r(1),o=r(21),i=n("iterator"),s=Array.prototype;e.exports=function(e){return void 0!==e&&(o.Array===e||s[i]===e)}},function(e,t,r){var n=r(3);e.exports=function(e,t,r,o){try{return o?t(n(r)[0],r[1]):t(r)}catch(t){var i=e.return;throw void 0!==i&&n(i.call(e)),t}}},function(e,t,r){var n,o,i,s=r(0),a=r(2),c=r(14),u=r(31),l=r(59),f=r(36),p=s.location,h=s.setImmediate,d=s.clearImmediate,g=s.process,v=s.MessageChannel,b=s.Dispatch,m=0,w={},y=function(e){if(w.hasOwnProperty(e)){var t=w[e];delete w[e],t()}},x=function(e){return function(){y(e)}},O=function(e){y(e.data)},S=function(e){s.postMessage(e+"",p.protocol+"//"+p.host)};h&&d||(h=function(e){for(var t=[],r=1;arguments.length>r;)t.push(arguments[r++]);return w[++m]=function(){("function"==typeof e?e:Function(e)).apply(void 0,t)},n(m),m},d=function(e){delete w[e]},"process"==c(g)?n=function(e){g.nextTick(x(e))}:b&&b.now?n=function(e){b.now(x(e))}:v?(i=(o=new v).port2,o.port1.onmessage=O,n=u(i.postMessage,i,1)):!s.addEventListener||"function"!=typeof postMessage||s.importScripts||a(S)?n="onreadystatechange"in f("script")?function(e){l.appendChild(f("script")).onreadystatechange=function(){l.removeChild(this),y(e)}}:function(e){setTimeout(x(e),0)}:(n=S,s.addEventListener("message",O,!1))),e.exports={set:h,clear:d}},function(e,t,r){var n=r(28);e.exports=n("document","documentElement")},function(e,t,r){var n=r(28);e.exports=n("navigator","userAgent")||""},function(e,t,r){"use strict";var n=r(20),o=function(e){var t,r;this.promise=new e(function(e,n){if(void 0!==t||void 0!==r)throw TypeError("Bad Promise constructor");t=e,r=n}),this.resolve=n(t),this.reject=n(r)};e.exports.f=function(e){return new o(e)}},function(e,t,r){var n=r(3),o=r(63),i=r(40),s=r(39),a=r(59),c=r(36),u=r(38)("IE_PROTO"),l=function(){},f=function(){var e,t=c("iframe"),r=i.length;for(t.style.display="none",a.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write("