From 423510af007db1f6e05cb7d685b53e2c72ba2786 Mon Sep 17 00:00:00 2001 From: Boris Sekachev <40690378+bsekachev@users.noreply.github.com> Date: Tue, 23 Jul 2019 13:31:20 +0300 Subject: [PATCH] Added encodeURIComponent for directory name in cvat.server.share() (#585) --- cvat/apps/engine/static/engine/js/cvat.js | 8 ++++---- cvatjs/src/server-proxy.js | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/cvat/apps/engine/static/engine/js/cvat.js b/cvat/apps/engine/static/engine/js/cvat.js index f1cc1321..911e86d6 100644 --- a/cvat/apps/engine/static/engine/js/cvat.js +++ b/cvat/apps/engine/static/engine/js/cvat.js @@ -1,22 +1,22 @@ -!function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=82)}([function(t,e){t.exports="object"==typeof window&&window&&window.Math==Math?window:"object"==typeof self&&self&&self.Math==Math?self:Function("return this")()},function(t,e,n){var r=n(27)("wks"),o=n(48),i=n(0).Symbol,s=n(89);t.exports=function(t){return r[t]||(r[t]=s&&i[t]||(s?i:o)("Symbol."+t))}},function(t,e,n){var r=n(9);t.exports=function(t){if(!r(t))throw TypeError(String(t)+" is not an object");return t}},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e,n){"use strict";var r=n(26),o=n(100),i=n(21),s=n(16),a=n(64),c=s.set,u=s.getterFor("Array Iterator");t.exports=a(Array,"Array",function(t,e){c(this,{type:"Array Iterator",target:r(t),index:0,kind:e})},function(){var t=u(this),e=t.target,n=t.kind,r=t.index++;return!e||r>=e.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:r,done:!1}:"values"==n?{value:e[r],done:!1}:{value:[r,e[r]],done:!1}},"values"),i.Arguments=i.Array,o("keys"),o("values"),o("entries")},function(t,e,n){"use strict";var r=n(71),o=n(117),i=Object.prototype.toString;function s(t){return"[object Array]"===i.call(t)}function a(t){return null!==t&&"object"==typeof t}function c(t){return"[object Function]"===i.call(t)}function u(t,e){if(null!=t)if("object"!=typeof t&&(t=[t]),s(t))for(var n=0,r=t.length;ns;)a(r[s++]);e.reactions=[],e.notified=!1,n&&!e.rejection&&G(t,e)})}},J=function(t,e,n){var r,o;B?((r=F.createEvent("Event")).promise=e,r.reason=n,r.initEvent(t,!1,!0),c.dispatchEvent(r)):r={promise:e,reason:n},(o=c["on"+t])?o(r):"unhandledrejection"===t&&y("Unhandled promise rejection",n)},G=function(t,e){m.call(c,function(){var n,r=e.value;if(V(e)&&(n=O(function(){L?_.emit("unhandledRejection",r,t):J("unhandledrejection",t,r)}),e.rejection=L||V(e)?2:1,n.error))throw n.value})},V=function(t){return 1!==t.rejection&&!t.parent},X=function(t,e){m.call(c,function(){L?_.emit("rejectionHandled",t):J("rejectionhandled",t,e.value)})},H=function(t,e,n,r){return function(o){t(e,n,o,r)}},K=function(t,e,n,r){e.done||(e.done=!0,r&&(e=r),e.value=n,e.state=2,q(t,e,!0))},Z=function(t,e,n,r){if(!e.done){e.done=!0,r&&(e=r);try{if(t===n)throw C("Promise can't be resolved itself");var o=W(n);o?v(function(){var r={done:!1};try{o.call(n,H(Z,t,r,e),H(K,t,r,e))}catch(n){K(t,r,n,e)}}):(e.value=n,e.state=1,q(t,e,!1))}catch(n){K(t,{done:!1},n,e)}}};z&&(I=function(t){f(this,I,s),p(t),r.call(this);var e=A(this);try{t(H(Z,this,e),H(K,this,e))}catch(t){K(this,e,t)}},(r=function(t){T(this,{type:s,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=n(59)(I.prototype,{then:function(t,e){var n=P(this),r=$(g(this,I));return r.ok="function"!=typeof t||t,r.fail="function"==typeof e&&e,r.domain=L?_.domain:void 0,n.parent=!0,n.reactions.push(r),0!=n.state&&q(this,n,!1),r.promise},catch:function(t){return this.then(void 0,t)}}),o=function(){var t=new r,e=A(t);this.promise=t,this.resolve=H(Z,t,e),this.reject=H(K,t,e)},x.f=$=function(t){return t===I||t===i?new o(t):D(t)},a||"function"!=typeof N||u({global:!0,enumerable:!0,forced:!0},{fetch:function(t){return w(I,N.apply(c,arguments))}})),u({global:!0,wrap:!0,forced:z},{Promise:I}),n(22)(I,s,!1,!0),n(97)(s),i=n(60).Promise,u({target:s,stat:!0,forced:z},{reject:function(t){var e=$(this);return e.reject.call(void 0,t),e.promise}}),u({target:s,stat:!0,forced:a||z},{resolve:function(t){return w(a&&this===i?I:this,t)}}),u({target:s,stat:!0,forced:U},{all:function(t){var e=this,n=$(e),r=n.resolve,o=n.reject,i=O(function(){var n=[],i=0,s=1;d(t,function(t){var a=i++,c=!1;n.push(void 0),s++,e.resolve(t).then(function(t){c||(c=!0,n[a]=t,--s||r(n))},o)}),--s||r(n)});return i.error&&o(i.value),n.promise},race:function(t){var e=this,n=$(e),r=n.reject,o=O(function(){d(t,function(t){e.resolve(t).then(n.resolve,r)})});return o.error&&r(o.value),n.promise}})},function(t,e,n){var r=n(104),o=n(4),i=n(0),s=n(10),a=n(1),c=a("iterator"),u=a("toStringTag"),l=o.values;for(var p in r){var f=i[p],h=f&&f.prototype;if(h){if(h[c]!==l)try{s(h,c,l)}catch(t){h[c]=l}if(h[u]||s(h,u,p),r[p])for(var d in o)if(h[d]!==o[d])try{s(h,d,o[d])}catch(t){h[d]=o[d]}}}},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,n){var r=n(13),o=n(25);t.exports=n(12)?function(t,e,n){return r.f(t,e,o(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e,n){var r=n(0),o=n(32).f,i=n(10),s=n(15),a=n(35),c=n(49),u=n(52);t.exports=function(t,e){var n,l,p,f,h,d=t.target,b=t.global,g=t.stat;if(n=b?r:g?r[d]||a(d,{}):(r[d]||{}).prototype)for(l in e){if(f=e[l],p=t.noTargetGet?(h=o(n,l))&&h.value:n[l],!u(b?l:d+(g?".":"#")+l,t.forced)&&void 0!==p){if(typeof f==typeof p)continue;c(f,p)}(t.sham||p&&p.sham)&&i(f,"sham",!0),s(n,l,f,t)}}},function(t,e,n){t.exports=!n(3)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e,n){var r=n(12),o=n(46),i=n(2),s=n(33),a=Object.defineProperty;e.f=r?a:function(t,e,n){if(i(t),e=s(e,!0),i(n),o)try{return a(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},function(t,e,n){var r=n(0),o=n(10),i=n(6),s=n(35),a=n(47),c=n(16),u=c.get,l=c.enforce,p=String(a).split("toString");n(27)("inspectSource",function(t){return a.call(t)}),(t.exports=function(t,e,n,a){var c=!!a&&!!a.unsafe,u=!!a&&!!a.enumerable,f=!!a&&!!a.noTargetGet;"function"==typeof n&&("string"!=typeof e||i(n,"name")||o(n,"name",e),l(n).source=p.join("string"==typeof e?e:"")),t!==r?(c?!f&&t[e]&&(u=!0):delete t[e],u?t[e]=n:o(t,e,n)):u?t[e]=n:s(e,n)})(Function.prototype,"toString",function(){return"function"==typeof this&&u(this).source||a.call(this)})},function(t,e,n){var r,o,i,s=n(83),a=n(9),c=n(10),u=n(6),l=n(36),p=n(37),f=n(0).WeakMap;if(s){var h=new f,d=h.get,b=h.has,g=h.set;r=function(t,e){return g.call(h,t,e),e},o=function(t){return d.call(h,t)||{}},i=function(t){return b.call(h,t)}}else{var m=l("state");p[m]=!0,r=function(t,e){return c(t,m,e),e},o=function(t){return u(t,m)?t[m]:{}},i=function(t){return u(t,m)}}t.exports={set:r,get:o,has:i,enforce:function(t){return i(t)?o(t):r(t,{})},getterFor:function(t){return function(e){var n;if(!a(e)||(n=o(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return n}}}},function(t,e,n){n(4),n(7),n(109),n(8),(()=>{const e=new class{constructor(){const t=n(114),e=n(115);function r(t){e.defaults.headers.delete["X-CSRFToken"]=t,e.defaults.headers.patch["X-CSRFToken"]=t,e.defaults.headers.post["X-CSRFToken"]=t,e.defaults.headers.put["X-CSRFToken"]=t,e.defaults.withCredentials=!0}async function o(t=""){const{backendAPI:n}=window.cvat.config;let r=null;try{r=await e.get(`${n}/tasks?${t}`,{proxy:window.cvat.config.proxy})}catch(t){const e=t.response?t.response.status:t.code;throw new window.cvat.exceptions.ServerError("Could not get tasks from a server",e)}return r.data.results.count=r.data.count,r.data.results}async function i(t){const{backendAPI:n}=window.cvat.config;try{await e.delete(`${n}/tasks/${t}`)}catch(t){const e=t.response?t.response.status:t.code;throw new window.cvat.exceptions.ServerError("Could not delete the task from the server",e)}}const s=t.get("csrftoken");s&&r(s),Object.defineProperties(this,Object.freeze({server:{value:Object.freeze({about:async function(){const{backendAPI:t}=window.cvat.config;let n=null;try{n=await e.get(`${t}/server/about`,{proxy:window.cvat.config.proxy})}catch(t){const e=t.response?t.response.status:t.code;throw new window.cvat.exceptions.ServerError('Could not get "about" information from the server',e)}return n.data},share:async function(t){const{backendAPI:n}=window.cvat.config;let r=null;try{r=await e.get(`${n}/server/share?directory=${t}`,{proxy:window.cvat.config.proxy})}catch(t){const e=t.response?t.response.status:t.code;throw new window.cvat.exceptions.ServerError('Could not get "share" information from the server',e)}return r.data},exception:async function(t){const{backendAPI:n}=window.cvat.config;try{await e.post(`${n}/server/exception`,JSON.stringify(t),{proxy:window.cvat.config.proxy,headers:{"Content-Type":"application/json"}})}catch(t){const e=t.response?t.response.status:t.code;throw new window.cvat.exceptions.ServerError("Could not send an exception to the server",e)}},login:async function(n,o){function i(n){if(n.headers["set-cookie"]){let o="";for(let e of n.headers["set-cookie"]){[e]=e.split(";");const n=e.split("=")[0],i=e.split("=")[1];"csrftoken"===n&&r(i),t.set(n,i),o+=`${e};`}e.defaults.headers.common.Cookie=o}else{let e=n.data.csrf;if(e)r(e),t.set("csrftoken",e);else{if(!(e=t.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");r(e)}}}const s=window.cvat.config.backendAPI.slice(0,-7);let a=null;try{a=await e.get(`${s}/auth/csrf`,{proxy:window.cvat.config.proxy})}catch(t){const e=t.response?t.response.status:t.code;throw new window.cvat.exceptions.ServerError("Could not get CSRF token from a server",e)}i(a);const c=[`${encodeURIComponent("username")}=${encodeURIComponent(n)}`,`${encodeURIComponent("password")}=${encodeURIComponent(o)}`].join("&").replace(/%20/g,"+");let u=null;try{u=await e.post(`${s}/auth/login`,c,{"Content-Type":"application/x-www-form-urlencoded",proxy:window.cvat.config.proxy,maxRedirects:0})}catch(t){if(302!==t.response.status){const e=t.response?t.response.status:t.code;throw new window.cvat.exceptions.ServerError("Could not login on a server",e)}u=t.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 t=window.cvat.config.backendAPI.slice(0,-7);try{await e.get(`${t}/auth/logout`,{proxy:window.cvat.config.proxy})}catch(t){const e=t.response?t.response.status:t.code;throw new window.cvat.exceptions.ServerError("Could not logout from the server",e)}}}),writable:!1},tasks:{value:Object.freeze({getTasks:o,saveTask:async function(t,n){const{backendAPI:r}=window.cvat.config;try{await e.patch(`${r}/tasks/${t}`,JSON.stringify(n),{proxy:window.cvat.config.proxy,headers:{"Content-Type":"application/json"}})}catch(t){const e=t.response?t.response.status:t.code;throw new window.cvat.exceptions.ServerError("Could not save the task on the server",e)}},createTask:async function(t,n,r){const{backendAPI:s}=window.cvat.config,a=new window.FormData;for(const t in n)if(Object.prototype.hasOwnProperty.call(n,t))for(let e=0;e{setTimeout(async function i(){try{const a=await e.get(`${s}/tasks/${t}/status`);["Queued","Started"].includes(a.data.state)?(""!==a.data.message&&r(a.data.message),setTimeout(i,1e3)):"Finished"===a.data.state?n():"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(t){const e=t.response?t.response.status:t.code;o(new window.cvat.exceptions.ServerError("Data uploading error occured",e))}},1e3)})}(c.data.id)}catch(t){throw await i(c.data.id),t}return(await o(`?id=${c.id}`))[0]},deleteTask:i}),writable:!1},jobs:{value:Object.freeze({getJob:async function(t){const{backendAPI:n}=window.cvat.config;let r=null;try{r=await e.get(`${n}/jobs/${t}`,{proxy:window.cvat.config.proxy})}catch(t){const e=t.response?t.response.status:t.code;throw new window.cvat.exceptions.ServerError("Could not get jobs from a server",e)}return r.data},saveJob:async function(t,n){const{backendAPI:r}=window.cvat.config;try{await e.patch(`${r}/jobs/${t}`,JSON.stringify(n),{proxy:window.cvat.config.proxy,headers:{"Content-Type":"application/json"}})}catch(t){const e=t.response?t.response.status:t.code;throw new window.cvat.exceptions.ServerError("Could not save the job on the server",e)}}}),writable:!1},users:{value:Object.freeze({getUsers:async function(){const{backendAPI:t}=window.cvat.config;let n=null;try{n=await e.get(`${t}/users`,{proxy:window.cvat.config.proxy})}catch(t){const e=t.response?t.response.status:t.code;throw new window.cvat.exceptions.ServerError("Could not get users from the server",e)}return n.data.results},getSelf:async function(){const{backendAPI:t}=window.cvat.config;let n=null;try{n=await e.get(`${t}/users/self`,{proxy:window.cvat.config.proxy})}catch(t){const e=t.response?t.response.status:t.code;throw new window.cvat.exceptions.ServerError("Could not get users from the server",e)}return n.data}}),writable:!1},frames:{value:Object.freeze({getFrame:async function(t,n){const{backendAPI:r}=window.cvat.config;let o=null;try{o=await e.get(`${r}/tasks/${t}/frames/${n}`,{proxy:window.cvat.config.proxy,responseType:"blob"})}catch(e){const r=e.response?e.response.status:e.code;throw new window.cvat.exceptions.ServerError(`Could not get frame ${n} for the task ${t} from the server`,r)}return o.data},getMeta:async function(t){const{backendAPI:n}=window.cvat.config;let r=null;try{r=await e.get(`${n}/tasks/${t}/frames/meta`,{proxy:window.cvat.config.proxy})}catch(e){const n=e.response?e.response.status:e.code;throw new window.cvat.exceptions.ServerError(`Could not get frame meta info for the task ${t} from the server`,n)}return r.data}}),writable:!1},annotations:{value:Object.freeze({updateAnnotations:async function(t,n,r,o){const{backendAPI:i}=window.cvat.config;let s=null,a=null;"PUT"===o.toUpperCase()?(s=e.put.bind(e),a=`${i}/${t}s/${n}/annotations`):(s=e.patch.bind(e),a=`${i}/${t}s/${n}/annotations?action=${o}`);let c=null;try{c=await s(a,JSON.stringify(r),{proxy:window.cvat.config.proxy,headers:{"Content-Type":"application/json"}})}catch(e){const r=e.response?e.response.status:e.code;throw new window.cvat.exceptions.ServerError(`Could not updated annotations for the ${t} ${n} on the server`,r)}return c.data},getAnnotations:async function(t,n){const{backendAPI:r}=window.cvat.config;let o=null;try{o=await e.get(`${r}/${t}s/${n}/annotations`,{proxy:window.cvat.config.proxy})}catch(e){const r=e.response?e.response.status:e.code;throw new window.cvat.exceptions.ServerError(`Could not get annotations for the ${t} ${n} from the server`,r)}return o.data},dumpAnnotations:async function(t,n,r){const{backendAPI:o}=window.cvat.config,i=n.replace(/\//g,"_");let s=`${o}/tasks/${t}/annotations/${i}?dump_format=${r}`;return new Promise((n,r)=>{setTimeout(async function o(){try{202===(await e.get(`${s}`,{proxy:window.cvat.config.proxy})).status?setTimeout(o,3e3):n(s=`${s}&action=download`)}catch(e){const n=e.response?e.response.status:e.code,o=new window.cvat.exceptions.ServerError(`Could not dump annotations for the task ${t} from the server`,n);r(o)}})})},uploadAnnotations:async function(t,n,r,o){const{backendAPI:i}=window.cvat.config;let s=new FormData;return s.append("annotation_file",r),new Promise((r,a)=>{setTimeout(async function c(){try{202===(await e.post(`${i}/${t}s/${n}/annotations?upload_format=${o}`,s,{proxy:window.cvat.config.proxy})).status?(s=new FormData,setTimeout(c,3e3)):r()}catch(e){const r=e.response?e.response.status:e.code,o=new window.cvat.exceptions.ServerError(`Could not upload annotations for the ${t} ${n}`,r);a(o)}})})}}),writable:!1}}))}};t.exports=e})()},function(t,e){t.exports=!1},function(t,e){t.exports=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t}},function(t,e){t.exports={}},function(t,e,n){var r=n(13).f,o=n(6),i=n(1)("toStringTag");t.exports=function(t,e,n){t&&!o(t=n?t:t.prototype,i)&&r(t,i,{configurable:!0,value:e})}},function(t,e,n){n(99),n(4),n(7),n(8),(()=>{const{PluginError:e}=n(68),r=[];t.exports=class{static async apiWrapper(t,...n){const r=await window.cvat.plugins.list.implementation();for(const o of r){const r=o.functions.filter(e=>e.callback===t)[0];if(r&&r.enter)try{await r.enter.call(this,o,...n)}catch(t){throw t instanceof e?t:new e(`Exception in plugin ${o.name}: ${t.toString()}`)}}let o=await t.implementation.call(this,...n);for(const i of r){const r=i.functions.filter(e=>e.callback===t)[0];if(r&&r.leave)try{o=await r.leave.call(this,i,o,...n)}catch(t){throw t instanceof e?t:new e(`Exception in plugin ${i.name}: ${t.toString()}`)}}return o}static async register(t){const n=[];if("object"!=typeof t)throw new e(`Plugin should be an object, but got "${typeof t}"`);if(!("name"in t)||"string"!=typeof t.name)throw new e('Plugin must contain a "name" field and it must be a string');if(!("description"in t)||"string"!=typeof t.description)throw new e('Plugin must contain a "description" field and it must be a string');if("functions"in t)throw new e('Plugin must not contain a "functions" field');!function t(e,r){const o={};for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&("object"==typeof e[n]?Object.prototype.hasOwnProperty.call(r,n)&&t(e[n],r[n]):["enter","leave"].includes(n)&&"function"==typeof r&&(e[n],1)&&(o.callback=r,o[n]=e[n]));Object.keys(o).length&&n.push(o)}(t,{cvat:window.cvat}),Object.defineProperty(t,"functions",{value:n,writable:!1}),r.push(t)}static async list(){return r}}})()},function(t,e,n){var r=n(19);t.exports=function(t){return Object(r(t))}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e,n){var r=n(45),o=n(19);t.exports=function(t){return r(o(t))}},function(t,e,n){var r=n(0),o=n(35),i=r["__core-js_shared__"]||o("__core-js_shared__",{});(t.exports=function(t,e){return i[t]||(i[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.0.1",mode:n(18)?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},function(t,e,n){var r=n(29),o=Math.min;t.exports=function(t){return t>0?o(r(t),9007199254740991):0}},function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t)}},function(t,e,n){var r=n(20);t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 0:return function(){return t.call(e)};case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,o){return t.call(e,n,r,o)}}return function(){return t.apply(e,arguments)}}},function(t,e,n){var r=n(90),o=n(1)("iterator"),i=n(21);t.exports=function(t){if(null!=t)return t[o]||t["@@iterator"]||i[r(t)]}},function(t,e,n){var r=n(12),o=n(44),i=n(25),s=n(26),a=n(33),c=n(6),u=n(46),l=Object.getOwnPropertyDescriptor;e.f=r?l:function(t,e){if(t=s(t),e=a(e,!0),u)try{return l(t,e)}catch(t){}if(c(t,e))return i(!o.f.call(t,e),t[e])}},function(t,e,n){var r=n(9);t.exports=function(t,e){if(!r(t))return t;var n,o;if(e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;if("function"==typeof(n=t.valueOf)&&!r(o=n.call(t)))return o;if(!e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},function(t,e,n){var r=n(9),o=n(0).document,i=r(o)&&r(o.createElement);t.exports=function(t){return i?o.createElement(t):{}}},function(t,e,n){var r=n(0),o=n(10);t.exports=function(t,e){try{o(r,t,e)}catch(n){r[t]=e}return e}},function(t,e,n){var r=n(27)("keys"),o=n(48);t.exports=function(t){return r[t]||(r[t]=o(t))}},function(t,e){t.exports={}},function(t,e){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},function(t,e){t.exports=function(t,e,n){if(!(t instanceof e))throw TypeError("Incorrect "+(n?n+" ":"")+"invocation");return t}},function(t,e,n){var r=n(29),o=n(19);t.exports=function(t,e,n){var i,s,a=String(o(t)),c=r(e),u=a.length;return c<0||c>=u?n?"":void 0:(i=a.charCodeAt(c))<55296||i>56319||c+1===u||(s=a.charCodeAt(c+1))<56320||s>57343?n?a.charAt(c):i:n?a.slice(c,c+2):s-56320+(i-55296<<10)+65536}},function(t,e,n){"use strict";(function(e){var r=n(5),o=n(120),i={"Content-Type":"application/x-www-form-urlencoded"};function s(t,e){!r.isUndefined(t)&&r.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}var a,c={adapter:("undefined"!=typeof XMLHttpRequest?a=n(72):void 0!==e&&(a=n(72)),a),transformRequest:[function(t,e){return o(e,"Content-Type"),r.isFormData(t)||r.isArrayBuffer(t)||r.isBuffer(t)||r.isStream(t)||r.isFile(t)||r.isBlob(t)?t:r.isArrayBufferView(t)?t.buffer:r.isURLSearchParams(t)?(s(e,"application/x-www-form-urlencoded;charset=utf-8"),t.toString()):r.isObject(t)?(s(e,"application/json;charset=utf-8"),JSON.stringify(t)):t}],transformResponse:[function(t){if("string"==typeof t)try{t=JSON.parse(t)}catch(t){}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,validateStatus:function(t){return t>=200&&t<300}};c.headers={common:{Accept:"application/json, text/plain, */*"}},r.forEach(["delete","get","head"],function(t){c.headers[t]={}}),r.forEach(["post","put","patch"],function(t){c.headers[t]=r.merge(i)}),t.exports=c}).call(this,n(119))},function(t,e,n){"use strict";n(11)({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return URL.prototype.toString.call(this)}})},function(t,e){(()=>{t.exports={isBoolean:function(t){return"boolean"==typeof t},isInteger:function(t){return"number"==typeof t&&Number.isInteger(t)},isEnum:function(t){for(const e in this)if(Object.prototype.hasOwnProperty.call(this,e)&&this[e]===t)return!0;return!1},isString:function(t){return"string"==typeof t},checkFilter:function(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(!(n in e))throw new window.cvat.exceptions.ArgumentError(`Unsupported filter property has been recieved: "${n}"`);if(!e[n](t[n]))throw new window.cvat.exceptions.ArgumentError(`Received filter property ${n} is not satisfied for checker`)}},checkObjectType:function(t,e,n,r){if(n){if(typeof e!==n){if("integer"===n&&Number.isInteger(e))return;throw new window.cvat.exceptions.ArgumentError(`"${t}" is expected to be "${n}", but "${typeof e}" has been got.`)}}else if(r&&!(e instanceof r)){if(void 0!==e)throw new window.cvat.exceptions.ArgumentError(`${t} is expected to be ${r.name}, but `+`"${e.constructor.name}" has been got`);throw new window.cvat.exceptions.ArgumentError(`"${t}" is expected to be ${r.name}, but "undefined" has been got.`)}}}})()},function(t,e,n){"use strict";var r={}.propertyIsEnumerable,o=Object.getOwnPropertyDescriptor,i=o&&!r.call({1:2},1);e.f=i?function(t){var e=o(this,t);return!!e&&e.enumerable}:r},function(t,e,n){var r=n(3),o=n(14),i="".split;t.exports=r(function(){return!Object("z").propertyIsEnumerable(0)})?function(t){return"String"==o(t)?i.call(t,""):Object(t)}:Object},function(t,e,n){t.exports=!n(12)&&!n(3)(function(){return 7!=Object.defineProperty(n(34)("div"),"a",{get:function(){return 7}}).a})},function(t,e,n){t.exports=n(27)("native-function-to-string",Function.toString)},function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+r).toString(36))}},function(t,e,n){var r=n(6),o=n(84),i=n(32),s=n(13);t.exports=function(t,e){for(var n=o(e),a=s.f,c=i.f,u=0;uc;)r(a,n=e[c++])&&(~i(u,n)||u.push(n));return u}},function(t,e){e.f=Object.getOwnPropertySymbols},function(t,e,n){var r=n(3),o=/#|\.prototype\./,i=function(t,e){var n=a[s(t)];return n==u||n!=c&&("function"==typeof e?r(e):!!e)},s=i.normalize=function(t){return String(t).replace(o,".").toLowerCase()},a=i.data={},c=i.NATIVE="N",u=i.POLYFILL="P";t.exports=i},function(t,e,n){var r=n(21),o=n(1)("iterator"),i=Array.prototype;t.exports=function(t){return void 0!==t&&(r.Array===t||i[o]===t)}},function(t,e,n){var r=n(2);t.exports=function(t,e,n,o){try{return o?e(r(n)[0],n[1]):e(n)}catch(e){var i=t.return;throw void 0!==i&&r(i.call(t)),e}}},function(t,e,n){var r,o,i,s=n(0),a=n(14),c=n(30),u=n(56),l=n(34),p=s.setImmediate,f=s.clearImmediate,h=s.process,d=s.MessageChannel,b=s.Dispatch,g=0,m={},v=function(){var t=+this;if(m.hasOwnProperty(t)){var e=m[t];delete m[t],e()}},w=function(t){v.call(t.data)};p&&f||(p=function(t){for(var e=[],n=1;arguments.length>n;)e.push(arguments[n++]);return m[++g]=function(){("function"==typeof t?t:Function(t)).apply(void 0,e)},r(g),g},f=function(t){delete m[t]},"process"==a(h)?r=function(t){h.nextTick(c(v,t,1))}:b&&b.now?r=function(t){b.now(c(v,t,1))}:d?(i=(o=new d).port2,o.port1.onmessage=w,r=c(i.postMessage,i,1)):s.addEventListener&&"function"==typeof postMessage&&!s.importScripts?(r=function(t){s.postMessage(t+"","*")},s.addEventListener("message",w,!1)):r="onreadystatechange"in l("script")?function(t){u.appendChild(l("script")).onreadystatechange=function(){u.removeChild(this),v.call(t)}}:function(t){setTimeout(c(v,t,1),0)}),t.exports={set:p,clear:f}},function(t,e,n){var r=n(0).document;t.exports=r&&r.documentElement},function(t,e,n){var r=n(0).navigator;t.exports=r&&r.userAgent||""},function(t,e,n){"use strict";var r=n(20),o=function(t){var e,n;this.promise=new t(function(t,r){if(void 0!==e||void 0!==n)throw TypeError("Bad Promise constructor");e=t,n=r}),this.resolve=r(e),this.reject=r(n)};t.exports.f=function(t){return new o(t)}},function(t,e,n){var r=n(15);t.exports=function(t,e,n){for(var o in e)r(t,o,e[o],n);return t}},function(t,e,n){t.exports=n(0)},function(t,e,n){var r=n(2),o=n(62),i=n(38),s=n(56),a=n(34),c=n(36)("IE_PROTO"),u=function(){},l=function(){var t,e=a("iframe"),n=i.length;for(e.style.display="none",s.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write("