(window.webpackJsonp=window.webpackJsonp||[]).push([[239,240],{1051:function(e,t,a){"use strict";a.r(t),a.d(t,"useDatasetViewModel",(function(){return o}));a(17);var n=a(90),s=a(47),r=a(290),o=function useDatasetViewModel(){var e=Object(n.d)(!1),t=Object(n.h)().value.params.id;return{datasetId:t,isLoadingDataset:e,handleError:function handleError(e){var a="";switch(e){case r.a.ERROR_FETCHING_DATASET_INFO:a="Can't get dataset info for dataset_id: ".concat(t);break;case r.a.ERROR_FETCHING_WORKSPACE_INFO:a="Can't get workspace info for dataset_id: ".concat(t);break;default:a="There was an error on fetching dataset info and workspace info. Please try again"}var n={message:a,numberOfChars:a.length,type:"error"};s.a.dispatch("notify",n)},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}]}}}},1408:function(e,t,a){"use strict";a.r(t),a.d(t,"useDatasetSettingViewModel",(function(){return l}));var n=a(35),s=(a(12),a(6),a(34),a(283)),r=a(29),o=a(90),i=a(1051),c=a(311),u=a(304),d=a(284),__awaiter=function(e,t,a,n){return new(a||(a=Promise))((function(s,r){function fulfilled(e){try{step(n.next(e))}catch(e){r(e)}}function rejected(e){try{step(n.throw(e))}catch(e){r(e)}}function step(e){e.done?s(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())}))},l=function useDatasetSettingViewModel(){var e=Object(o.i)(),t=Object(d.c)().isAdminOrOwnerRole,a=Object(u.a)().state,l=Object(r.useResolve)(c.a),f=Object(s.e)([]),p=function configureTabs(e){f.value.push({id:"info",name:"Info",component:"SettingsInfo"}),f.value.push({id:"fields",name:"Fields",component:"SettingsFields"}),f.value.push({id:"questions",name:"Questions",component:"SettingsQuestions"}),e.hasMetadataProperties&&f.value.push({id:"metadata",name:"Metadata",component:"SettingsMetadata"}),e.hasVectors&&f.value.push({id:"vector",name:"Vectors",component:"SettingsVectors"}),f.value.push({id:"danger-zone",name:"Danger zone",component:"settingsDangerZone"})},m=Object(i.useDatasetViewModel)(),h=m.datasetId,v=m.isLoadingDataset,g=m.handleError,b=m.createRootBreadCrumbs,w=Object(s.a)((function(){return[].concat(Object(n.a)(b(a.dataset)),[{link:{},name:"settings"}])}));return Object(s.b)((function(){!function loadDatasetSetting(){__awaiter(void 0,void 0,void 0,regeneratorRuntime.mark((function _callee(){var t;return regeneratorRuntime.wrap((function _callee$(a){for(;;)switch(a.prev=a.next){case 0:return a.prev=0,v.value=!0,a.next=4,l.execute(h);case 4:t=a.sent,p(t),a.next=12;break;case 8:a.prev=8,a.t0=a.catch(0),g(a.t0.response),e.push("/");case 12:return a.prev=12,v.value=!1,a.finish(12);case 15:case"end":return a.stop()}}),_callee,null,[[0,8,12,15]])})))}()})),{isLoadingDataset:v,breadcrumbs:w,tabs:f,isAdminOrOwnerRole:t,datasetId:h,datasetSetting:a}}}}]);