(window.webpackJsonp=window.webpackJsonp||[]).push([[203,206],{1008:function(e,t,n){"use strict";n.r(t),n.d(t,"useDatasetViewModel",(function(){return o}));n(19);var a=n(175),r=n(47),c=n(283),o=function useDatasetViewModel(){var e=Object(a.d)(!1),t=Object(a.h)().value.params.id;return{datasetId:t,isLoadingDataset:e,handleError:function handleError(e){var n="";switch(e){case c.a.ERROR_FETCHING_DATASET_INFO:n="Can't get dataset info for dataset_id: ".concat(t);break;case c.a.ERROR_FETCHING_WORKSPACE_INFO:n="Can't get workspace info for dataset_id: ".concat(t);break;default:n="There was an error on fetching dataset info and workspace info. Please try again"}var a={message:n,numberOfChars:n.length,type:"error"};r.a.dispatch("notify",a)},createRootBreadCrumbs:function createRootBreadCrumbs(e){return[{link:{name:"datasets"},name:"Home"},{link:{path:"/datasets?workspaces=".concat(e.workspace)},name:e.workspace},{link:{path:"annotation-mode"},name:e.name}]}}}},1363:function(e,t,n){"use strict";n.r(t),n.d(t,"useAnnotationModeViewModel",(function(){return O}));n(16),n(8);var a=n(175),r=n(48),c=n(1008),o=n(298),u=n(294),i=(n(63),n(3)),s=n(4),d=n(13),f=n(26),l=n(11),p=n(131),v=n(132),h=n(286);function _createSuper(e){var t=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var n,a=Object(l.a)(e);if(t){var r=Object(l.a)(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return Object(f.a)(this,n)}}var b=function(e){Object(d.a)(UpdateMetricsEventHandler,e);var t=_createSuper(UpdateMetricsEventHandler);function UpdateMetricsEventHandler(){return Object(i.a)(this,UpdateMetricsEventHandler),t.call(this,v.a)}return Object(s.a)(UpdateMetricsEventHandler,[{key:"handle",value:function handle(e){Object(r.useResolve)(h.a).execute(e.record.datasetId)}}]),UpdateMetricsEventHandler}(p.Handler),w=n(789),__awaiter=function(e,t,n,a){return new(n||(n=Promise))((function(r,c){function fulfilled(e){try{step(a.next(e))}catch(e){c(e)}}function rejected(e){try{step(a.throw(e))}catch(e){c(e)}}function step(e){e.done?r(e.value):function adopt(e){return e instanceof n?e:new n((function(t){t(e)}))}(e.value).then(fulfilled,rejected)}step((a=a.apply(e,t||[])).next())}))},O=function useAnnotationModeViewModel(){var e=Object(a.i)(),t=Object(u.a)().state,n=Object(r.useResolve)(o.a),i=Object(c.useDatasetViewModel)(),s=i.datasetId,d=i.isLoadingDataset,f=i.handleError,l=i.createRootBreadCrumbs,v=Object(a.a)((function(){return l(t)})),h=function loadDataset(){return __awaiter(void 0,void 0,void 0,regeneratorRuntime.mark((function _callee(){return regeneratorRuntime.wrap((function _callee$(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,d.value=!0,t.next=4,n.execute(s);case 4:t.next=10;break;case 6:t.prev=6,t.t0=t.catch(0),f(t.t0.response),e.push("/");case 10:return t.prev=10,d.value=!1,t.finish(10);case 13:case"end":return t.stop()}}),_callee,null,[[0,6,10,13]])})))};return Object(a.c)((function(){!function useEvents(e){Object(w.c)((function(){e()})),Object(w.d)((function(){p.DomainEvents.clear()}))}((function(){new b})),h()})),{dataset:t,datasetId:s,isLoadingDataset:d,loadDataset:h,breadcrumbs:v}}},789:function(e,t,n){"use strict";var a=n(0);n.d(t,"a",(function(){return a.computed})),n.d(t,"b",(function(){return a.onBeforeMount})),n.d(t,"c",(function(){return a.onMounted})),n.d(t,"d",(function(){return a.onUnmounted})),n.d(t,"e",(function(){return a.ref}));a.default,a.default.util.warn}}]);