(window.webpackJsonp=window.webpackJsonp||[]).push([[194],{975:function(e,t,a){"use strict";a.r(t),a.d(t,"useDatasetViewModel",(function(){return u}));a(21),a(9),a(27);var n=a(186),r=a(55),c=a(39),s=a(284),o=a(279),i=a(283),__awaiter=function(e,t,a,n){return new(a||(a=Promise))((function(r,c){function fulfilled(e){try{step(n.next(e))}catch(e){c(e)}}function rejected(e){try{step(n.throw(e))}catch(e){c(e)}}function step(e){e.done?r(e.value):function adopt(e){return e instanceof a?e:new a((function(t){t(e)}))}(e.value).then(fulfilled,rejected)}step((n=n.apply(e,t||[])).next())}))},u=function useDatasetViewModel(){var e=Object(n.c)(!1),t=Object(n.g)(),a=Object(n.f)().value.params.id,u=Object(i.a)().state,d=Object(r.useResolve)(s.a),f=Object(n.a)((function(){return p(u)})),l=function handleError(e){var t="";switch(e){case o.a.ERROR_FETCHING_DATASET_INFO:t="Can't get dataset info for dataset_id: ".concat(a);break;case o.a.ERROR_FETCHING_WORKSPACE_INFO:t="Can't get workspace info for dataset_id: ".concat(a);break;default:t="There was an error on fetching dataset info and workspace info. Please try again"}var n={message:t,numberOfChars:t.length,type:"error"};c.a.dispatch("notify",n)},p=function createBreadcrumbs(e){return[{link:{name:"datasets"},name:"Home"},{link:{path:"/datasets?workspace=".concat(e.workspace)},name:e.workspace},{link:{name:null},name:e.name}]};return{dataset:u,datasetId:a,isLoadingDataset:e,loadDataset:function loadDataset(){return __awaiter(void 0,void 0,void 0,regeneratorRuntime.mark((function _callee(){return regeneratorRuntime.wrap((function _callee$(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,e.value=!0,n.next=4,d.execute(a);case 4:n.next=10;break;case 6:n.prev=6,n.t0=n.catch(0),l(n.t0.response),t.push("/");case 10:return n.prev=10,e.value=!1,n.finish(10);case 13:case"end":return n.stop()}}),_callee,null,[[0,6,10,13]])})))},breadcrumbs:f}}}}]);