@labelbee/lb-components 1.24.0-alpha.39 → 1.24.0-alpha.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var Actions=require("../Actions.js"),reducer=require("./reducer.js"),index=require("../../constant/index.js"),AnnotationSize=require("../../data/enums/AnnotationSize.js"),PageOperator=require("../../utils/PageOperator.js"),index$1=require("../../utils/index.js"),util=require("../../components/predictTracking/previewResult/util.js"),__async=(t,e,n)=>new Promise((a,r)=>{var o=s=>{try{T(n.next(s))}catch(p){r(p)}},i=s=>{try{T(n.throw(s))}catch(p){r(p)}},T=s=>s.done?a(s.value):Promise.resolve(s.value).then(o,i);T((n=n.apply(t,e)).next())});const dispatchTasks=(t,e)=>e.map(n=>t(n)),getSubmitByPageOperation=t=>t===AnnotationSize.EPageTurningOperation.Forward?index.ESubmitType.Forward:t===AnnotationSize.EPageTurningOperation.Backward?index.ESubmitType.Backward:t===AnnotationSize.EPageTurningOperation.Jump?index.ESubmitType.Jump:index.ESubmitType.Forward,getBasicIndex=(t,e)=>{var n,a,r;const{imgList:o,imgIndex:i}=t,{dataSourceStep:T}=reducer.getStepConfig(t.stepList,t.step);return((r=(a=index$1.jsonParser((n=o[i-1])==null?void 0:n.result)[`step_${T}`])==null?void 0:a.result)==null?void 0:r.length)-1||e};function UpdateToolInstance(t){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_TOOL_INSTANCE,payload:{toolInstance:t}}}function SetTaskStepList({stepList:t}){return{type:Actions.ANNOTATION_ACTIONS.SET_TASK_STEP_LIST,payload:{stepList:t}}}function SetTaskConfig({stepList:t,step:e}){return{type:Actions.ANNOTATION_ACTIONS.SET_TASK_CONFIG,payload:{stepList:t,step:e}}}function UpdateOnSubmit(t){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_ON_SUBMIT,payload:{onSubmit:t}}}function UpdateOnSave(t){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_ON_SAVE,payload:{onSave:t}}}function UpdateOnPageChange(t){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_ON_PAGE_CHANGE,payload:{onPageChange:t}}}function UpdateOnStepChange(t){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_ON_STEP_CHANGE,payload:{onStepChange:t}}}function UpdateGetFileData(t){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_GET_FILE_DATA,payload:{getFileData:t}}}function UpdatePageSize(t){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_PAGE_SIZE,payload:{pageSize:t}}}function UpdateGetFileList(t){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_LOAD_FILE_LIST,payload:{loadFileList:t}}}function UpdateRotate(){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_ROTATE}}function UpdateSkipBeforePageTurning(t){return{type:Actions.ANNOTATION_ACTIONS.SKIP_BEFORE_PAGE_TURNING,payload:{skipBeforePageTurning:t}}}function UpdateBeforeRotate(t){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_BEFORE_ROTATE,payload:{beforeRotate:t}}}function UpdatePreDataProcess(t){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_PRE_DATA_PROCESS,payload:{preDataProcess:t}}}function CopyBackWordResult(){return{type:Actions.ANNOTATION_ACTIONS.COPY_BACKWARD_RESULT}}function UpdateImgIndexByExternal(t){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_IMG_INDEX_BY_EXTERNAL,payload:{getImgIndexByExternal:t}}}function BatchUpdateTrackID({id:t,newID:e,rangeIndex:n,imgList:a}){return{type:Actions.ANNOTATION_ACTIONS.BATCH_UPDATE_TRACK_ID,payload:{id:t,newID:e,rangeIndex:n,imgList:a}}}function BatchUpdateResultByTrackID(t,e,n,a){return{type:Actions.ANNOTATION_ACTIONS.BATCH_UPDATE_RESULT_BY_TRACK_ID,payload:{id:t,newData:e,rangeIndex:n,imgList:a}}}function BatchUpdateImgListResultByPredictResult(){return{type:Actions.ANNOTATION_ACTIONS.BATCH_UPDATE_IMG_LIST_RESULT_BY_PREDICT_RESULT,payload:{}}}const UpdateCheckMode=t=>({type:Actions.ANNOTATION_ACTIONS.SET_CHECK_MODE,payload:{checkMode:t}}),UpdateHighlightAttribute=t=>({type:Actions.ANNOTATION_ACTIONS.SET_HIGHLIGHT_ATTRIBUTE,payload:{attribute:t}});function InitTaskData({onSubmit:t,onSave:e,onPageChange:n,onStepChange:a,getFileData:r,pageSize:o,loadFileList:i,step:T,stepList:s,skipBeforePageTurning:p,beforeRotate:N,checkMode:A,highlightAttribute:d,preDataProcess:I,getImgIndexByExternal:l}){const u=[];return t&&u.push(UpdateOnSubmit(t)),e&&u.push(UpdateOnSave(e)),n&&u.push(UpdateOnPageChange(n)),a&&u.push(UpdateOnStepChange(a)),r&&u.push(UpdateGetFileData(r)),i&&u.push(UpdateGetFileList(i)),o&&u.push(UpdatePageSize(o)),p&&u.push(UpdateSkipBeforePageTurning(p)),N&&u.push(UpdateBeforeRotate(N)),I&&u.push(UpdatePreDataProcess(I)),typeof A=="boolean"&&u.push(UpdateCheckMode(A)),l&&u.push(UpdateImgIndexByExternal(l)),u.push(UpdateHighlightAttribute(d)),u.push(SetTaskConfig({stepList:s,step:T})),u.push({type:Actions.ANNOTATION_ACTIONS.CALC_STEP_PROGRESS}),u.push({type:Actions.ANNOTATION_ACTIONS.INIT_TOOL}),O=>dispatchTasks(O,u)}function UpdateInjectFunc({onSubmit:t,onSave:e,onPageChange:n,onStepChange:a,getFileData:r,pageSize:o,loadFileList:i,stepList:T,beforeRotate:s,highlightAttribute:p,preDataProcess:N}){const A=[];return t&&A.push(UpdateOnSubmit(t)),e&&A.push(UpdateOnSave(e)),n&&A.push(UpdateOnPageChange(n)),a&&A.push(UpdateOnStepChange(a)),r&&A.push(UpdateGetFileData(r)),i&&A.push(UpdateGetFileList(i)),o&&A.push(UpdatePageSize(o)),s&&A.push(UpdateBeforeRotate(s)),N&&A.push(UpdatePreDataProcess(N)),A.push(UpdateHighlightAttribute(p)),A.push(SetTaskStepList({stepList:T})),d=>dispatchTasks(d,A)}const getNextStep=(t,e)=>{var n;const a=e==null?void 0:e.findIndex(r=>(r==null?void 0:r.step)===t);return(n=e[a+1])==null?void 0:n.step},ToNextStep=t=>(e,n)=>{const{annotation:a}=n(),{step:r,stepList:o}=a,i=getNextStep(r,o);return[e(UpdateProcessingStep(i,t))]},UpdateProcessingStep=(t,e)=>(n,a)=>{var r,o;const{annotation:i}=a();(r=i==null?void 0:i.onStepChange)==null||r.call(i,t);const T=(o=i==null?void 0:i.imgIndex)!=null?o:0;return[n({type:Actions.ANNOTATION_ACTIONS.SUBMIT_RESULT}),n({type:Actions.ANNOTATION_ACTIONS.SUBMIT_FILE_DATA,payload:{submitType:index.ESubmitType.StepChanged}}),n({type:Actions.ANNOTATION_ACTIONS.SET_STEP,payload:{toStep:t}}),n({type:Actions.ANNOTATION_ACTIONS.CALC_STEP_PROGRESS}),n(reducer.LoadFileAndFileData(e!=null?e:T,0))]},ToSubmitFileData=t=>e=>[e({type:Actions.ANNOTATION_ACTIONS.SUBMIT_RESULT}),e({type:Actions.ANNOTATION_ACTIONS.SUBMIT_FILE_DATA,payload:{submitType:t}})],SubmitAndChangeFileIndex=(t,e,n,a)=>__async(void 0,null,function*(){t(ToSubmitFileData(n)),yield t(SubmitHandler(n)),t(reducer.LoadFileAndFileData(e,a))}),ChangeBasicIndex=(t,e)=>[t({type:Actions.ANNOTATION_ACTIONS.SUBMIT_RESULT}),t({type:Actions.ANNOTATION_ACTIONS.SET_BASIC_INDEX,payload:{basicIndex:e}})],ChangeTriggerEventAfterIndexChanged=(t,e)=>{t({type:Actions.ANNOTATION_ACTIONS.SET_TRIGGER_EVENT_AFTER_INDEX_CHANGED,payload:{triggerEventAfterIndexChanged:e}})},PageBackward=(t=!1)=>(e,n)=>DispatcherTurning(e,n,AnnotationSize.EPageTurningOperation.Backward,t),PageForward=(t=!1)=>(e,n)=>DispatcherTurning(e,n,AnnotationSize.EPageTurningOperation.Forward,t),PageJump=(t,e=!1)=>(n,a)=>{if(t!==a().imgIndex)return DispatcherTurning(n,a,AnnotationSize.EPageTurningOperation.Jump,e,t)},loadImgList=(t,e,n,a)=>__async(void 0,null,function*(){var r;const{loadFileList:o,imgList:i,pageSize:T}=e().annotation,s=Math.floor(n/T);SetAnnotationLoading(t,!0);try{const p=yield o(s,T);if(SetAnnotationLoading(t,!1),!((r=p==null?void 0:p.fileList)==null?void 0:r.length)||!(p==null?void 0:p.total))throw new Error("fileList and total are required");const N=a?new Array(p.total):[...i];return N.splice(s*T,T,...p.fileList),t({type:Actions.ANNOTATION_ACTIONS.UPDATE_IMG_LIST,payload:{imgList:N}}),!0}catch(p){SetAnnotationLoading(t,!1),console.error(p)}}),DispatcherTurning=(t,e,n,a=!1,r)=>__async(void 0,null,function*(){var o,i;const T=e().annotation,s=getSubmitByPageOperation(n);let{fileIndexChanged:p,fileIndex:N,basicIndexChanged:A,basicIndex:d}=PageOperator.getNextPageInfo(n,T,r);const I=(o=T==null?void 0:T.getImgIndexByExternal)==null?void 0:o.call(T,T.imgIndex,s);if(I!==void 0&&(p=!0,N=I),ChangeTriggerEventAfterIndexChanged(t,a),p){if(T.loading||!T.imgList[N]&&!(yield loadImgList(t,e,N)))return;const l=e();(i=T.onPageChange)==null||i.call(T,N);const u=s===index.ESubmitType.Backward?getBasicIndex(l.annotation,d):d;return SubmitAndChangeFileIndex(t,N,s,u)}return A?ChangeBasicIndex(t,d):t(ToSubmitFileData(s))}),ChangeSave=t=>{t(ToSubmitFileData(index.ESubmitType.Save)),t({type:Actions.ANNOTATION_ACTIONS.SAVE_RESULT})},SetAnnotationLoading=(t,e)=>{t({type:Actions.ANNOTATION_ACTIONS.SET_LOADING,payload:{loading:e}})},SetLoadPCDFileLoading=(t,e)=>{t({type:Actions.ANNOTATION_ACTIONS.SET_LOADPCDFILE_LOADING,payload:{loadPCDFileLoading:e}})},InitAnnotationState=t=>{t({type:Actions.ANNOTATION_ACTIONS.INIT_ALL_STATE,payload:{}})},SetPredictResult=(t,e)=>{t({type:Actions.ANNOTATION_ACTIONS.SET_PREDICT_RESULT,payload:{result:e}})},SetPredictResultVisible=(t,e)=>{t({type:Actions.ANNOTATION_ACTIONS.SET_PREDICT_RESULT_VISIBLE,payload:{visible:e}})},GetBoxesByID=(t,e)=>(n,a)=>{const{imgList:r,step:o}=a().annotation;return util.getBoxesByTrackID(r,o,t,e)},PreDataProcess=t=>(e,n)=>{var a,r;const{annotation:o}=n();return(r=(a=o==null?void 0:o.preDataProcess)==null?void 0:a.call(o,t))!=null?r:t.dataList},SubmitHandler=t=>(e,n)=>__async(void 0,null,function*(){const{annotation:a}=n(),{onSubmit:r,imgIndex:o,imgList:i}=a;!r||(yield r([i[o]],t,o,i))});exports.BatchUpdateImgListResultByPredictResult=BatchUpdateImgListResultByPredictResult,exports.BatchUpdateResultByTrackID=BatchUpdateResultByTrackID,exports.BatchUpdateTrackID=BatchUpdateTrackID,exports.ChangeSave=ChangeSave,exports.CopyBackWordResult=CopyBackWordResult,exports.DispatcherTurning=DispatcherTurning,exports.GetBoxesByID=GetBoxesByID,exports.InitAnnotationState=InitAnnotationState,exports.InitTaskData=InitTaskData,exports.PageBackward=PageBackward,exports.PageForward=PageForward,exports.PageJump=PageJump,exports.PreDataProcess=PreDataProcess,exports.SetAnnotationLoading=SetAnnotationLoading,exports.SetLoadPCDFileLoading=SetLoadPCDFileLoading,exports.SetPredictResult=SetPredictResult,exports.SetPredictResultVisible=SetPredictResultVisible,exports.SetTaskConfig=SetTaskConfig,exports.SetTaskStepList=SetTaskStepList,exports.SubmitHandler=SubmitHandler,exports.ToNextStep=ToNextStep,exports.ToSubmitFileData=ToSubmitFileData,exports.UpdateBeforeRotate=UpdateBeforeRotate,exports.UpdateCheckMode=UpdateCheckMode,exports.UpdateGetFileData=UpdateGetFileData,exports.UpdateGetFileList=UpdateGetFileList,exports.UpdateHighlightAttribute=UpdateHighlightAttribute,exports.UpdateImgIndexByExternal=UpdateImgIndexByExternal,exports.UpdateInjectFunc=UpdateInjectFunc,exports.UpdateOnPageChange=UpdateOnPageChange,exports.UpdateOnSave=UpdateOnSave,exports.UpdateOnStepChange=UpdateOnStepChange,exports.UpdateOnSubmit=UpdateOnSubmit,exports.UpdatePageSize=UpdatePageSize,exports.UpdatePreDataProcess=UpdatePreDataProcess,exports.UpdateProcessingStep=UpdateProcessingStep,exports.UpdateRotate=UpdateRotate,exports.UpdateSkipBeforePageTurning=UpdateSkipBeforePageTurning,exports.UpdateToolInstance=UpdateToolInstance,exports.loadImgList=loadImgList;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var Actions=require("../Actions.js"),reducer=require("./reducer.js"),index=require("../../constant/index.js"),AnnotationSize=require("../../data/enums/AnnotationSize.js"),PageOperator=require("../../utils/PageOperator.js"),index$1=require("../../utils/index.js"),util=require("../../components/predictTracking/previewResult/util.js"),__async=(t,e,n)=>new Promise((a,r)=>{var o=s=>{try{T(n.next(s))}catch(p){r(p)}},i=s=>{try{T(n.throw(s))}catch(p){r(p)}},T=s=>s.done?a(s.value):Promise.resolve(s.value).then(o,i);T((n=n.apply(t,e)).next())});const dispatchTasks=(t,e)=>e.map(n=>t(n)),getSubmitByPageOperation=t=>t===AnnotationSize.EPageTurningOperation.Forward?index.ESubmitType.Forward:t===AnnotationSize.EPageTurningOperation.Backward?index.ESubmitType.Backward:t===AnnotationSize.EPageTurningOperation.Jump?index.ESubmitType.Jump:index.ESubmitType.Forward,getBasicIndex=(t,e)=>{var n,a,r;const{imgList:o,imgIndex:i}=t,{dataSourceStep:T}=reducer.getStepConfig(t.stepList,t.step);return((r=(a=index$1.jsonParser((n=o[i-1])==null?void 0:n.result)[`step_${T}`])==null?void 0:a.result)==null?void 0:r.length)-1||e};function UpdateToolInstance(t){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_TOOL_INSTANCE,payload:{toolInstance:t}}}function SetTaskStepList({stepList:t}){return{type:Actions.ANNOTATION_ACTIONS.SET_TASK_STEP_LIST,payload:{stepList:t}}}function SetTaskConfig({stepList:t,step:e}){return{type:Actions.ANNOTATION_ACTIONS.SET_TASK_CONFIG,payload:{stepList:t,step:e}}}function UpdateOnSubmit(t){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_ON_SUBMIT,payload:{onSubmit:t}}}function UpdateOnSave(t){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_ON_SAVE,payload:{onSave:t}}}function UpdateOnPageChange(t){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_ON_PAGE_CHANGE,payload:{onPageChange:t}}}function UpdateOnStepChange(t){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_ON_STEP_CHANGE,payload:{onStepChange:t}}}function UpdateGetFileData(t){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_GET_FILE_DATA,payload:{getFileData:t}}}function UpdatePageSize(t){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_PAGE_SIZE,payload:{pageSize:t}}}function UpdateGetFileList(t){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_LOAD_FILE_LIST,payload:{loadFileList:t}}}function UpdateRotate(){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_ROTATE}}function UpdateSkipBeforePageTurning(t){return{type:Actions.ANNOTATION_ACTIONS.SKIP_BEFORE_PAGE_TURNING,payload:{skipBeforePageTurning:t}}}function UpdateBeforeRotate(t){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_BEFORE_ROTATE,payload:{beforeRotate:t}}}function UpdatePreDataProcess(t){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_PRE_DATA_PROCESS,payload:{preDataProcess:t}}}function CopyBackWordResult(){return{type:Actions.ANNOTATION_ACTIONS.COPY_BACKWARD_RESULT}}function UpdateImgIndexByExternal(t){return{type:Actions.ANNOTATION_ACTIONS.UPDATE_IMG_INDEX_BY_EXTERNAL,payload:{getImgIndexByExternal:t}}}function BatchUpdateTrackID({id:t,newID:e,rangeIndex:n,imgList:a}){return{type:Actions.ANNOTATION_ACTIONS.BATCH_UPDATE_TRACK_ID,payload:{id:t,newID:e,rangeIndex:n,imgList:a}}}function BatchUpdateResultByTrackID(t,e,n,a){return{type:Actions.ANNOTATION_ACTIONS.BATCH_UPDATE_RESULT_BY_TRACK_ID,payload:{id:t,newData:e,rangeIndex:n,imgList:a}}}function BatchUpdateImgListResultByPredictResult(){return{type:Actions.ANNOTATION_ACTIONS.BATCH_UPDATE_IMG_LIST_RESULT_BY_PREDICT_RESULT,payload:{}}}const UpdateCheckMode=t=>({type:Actions.ANNOTATION_ACTIONS.SET_CHECK_MODE,payload:{checkMode:t}}),UpdateHighlightAttribute=t=>({type:Actions.ANNOTATION_ACTIONS.SET_HIGHLIGHT_ATTRIBUTE,payload:{attribute:t}});function InitTaskData({onSubmit:t,onSave:e,onPageChange:n,onStepChange:a,getFileData:r,pageSize:o,loadFileList:i,step:T,stepList:s,skipBeforePageTurning:p,beforeRotate:N,checkMode:A,highlightAttribute:d,preDataProcess:I,getImgIndexByExternal:l}){const u=[];return t&&u.push(UpdateOnSubmit(t)),e&&u.push(UpdateOnSave(e)),n&&u.push(UpdateOnPageChange(n)),a&&u.push(UpdateOnStepChange(a)),r&&u.push(UpdateGetFileData(r)),i&&u.push(UpdateGetFileList(i)),o&&u.push(UpdatePageSize(o)),p&&u.push(UpdateSkipBeforePageTurning(p)),N&&u.push(UpdateBeforeRotate(N)),I&&u.push(UpdatePreDataProcess(I)),typeof A=="boolean"&&u.push(UpdateCheckMode(A)),l&&u.push(UpdateImgIndexByExternal(l)),u.push(UpdateHighlightAttribute(d)),u.push(SetTaskConfig({stepList:s,step:T})),u.push({type:Actions.ANNOTATION_ACTIONS.CALC_STEP_PROGRESS}),u.push({type:Actions.ANNOTATION_ACTIONS.INIT_TOOL}),O=>dispatchTasks(O,u)}function UpdateInjectFunc({onSubmit:t,onSave:e,onPageChange:n,onStepChange:a,getFileData:r,pageSize:o,loadFileList:i,stepList:T,beforeRotate:s,highlightAttribute:p,preDataProcess:N}){const A=[];return t&&A.push(UpdateOnSubmit(t)),e&&A.push(UpdateOnSave(e)),n&&A.push(UpdateOnPageChange(n)),a&&A.push(UpdateOnStepChange(a)),r&&A.push(UpdateGetFileData(r)),i&&A.push(UpdateGetFileList(i)),o&&A.push(UpdatePageSize(o)),s&&A.push(UpdateBeforeRotate(s)),N&&A.push(UpdatePreDataProcess(N)),A.push(UpdateHighlightAttribute(p)),A.push(SetTaskStepList({stepList:T})),d=>dispatchTasks(d,A)}const getNextStep=(t,e)=>{var n;const a=e==null?void 0:e.findIndex(r=>(r==null?void 0:r.step)===t);return(n=e[a+1])==null?void 0:n.step},ToNextStep=t=>(e,n)=>{const{annotation:a}=n(),{step:r,stepList:o}=a,i=getNextStep(r,o);return[e(UpdateProcessingStep(i,t))]},UpdateProcessingStep=(t,e)=>(n,a)=>{var r,o;const{annotation:i}=a();(r=i==null?void 0:i.onStepChange)==null||r.call(i,t);const T=(o=i==null?void 0:i.imgIndex)!=null?o:0;return[n({type:Actions.ANNOTATION_ACTIONS.SUBMIT_RESULT}),n({type:Actions.ANNOTATION_ACTIONS.SUBMIT_FILE_DATA,payload:{submitType:index.ESubmitType.StepChanged}}),n({type:Actions.ANNOTATION_ACTIONS.SET_STEP,payload:{toStep:t}}),n({type:Actions.ANNOTATION_ACTIONS.CALC_STEP_PROGRESS}),n(reducer.LoadFileAndFileData(e!=null?e:T,0))]},ToSubmitFileData=t=>e=>[e({type:Actions.ANNOTATION_ACTIONS.SUBMIT_RESULT}),e({type:Actions.ANNOTATION_ACTIONS.SUBMIT_FILE_DATA,payload:{submitType:t}})],SubmitAndChangeFileIndex=(t,e,n,a)=>__async(void 0,null,function*(){SetAnnotationLoading(t,!0),t(ToSubmitFileData(n)),yield t(SubmitHandler(n)),t(reducer.LoadFileAndFileData(e,a))}),ChangeBasicIndex=(t,e)=>[t({type:Actions.ANNOTATION_ACTIONS.SUBMIT_RESULT}),t({type:Actions.ANNOTATION_ACTIONS.SET_BASIC_INDEX,payload:{basicIndex:e}})],ChangeTriggerEventAfterIndexChanged=(t,e)=>{t({type:Actions.ANNOTATION_ACTIONS.SET_TRIGGER_EVENT_AFTER_INDEX_CHANGED,payload:{triggerEventAfterIndexChanged:e}})},PageBackward=(t=!1)=>(e,n)=>DispatcherTurning(e,n,AnnotationSize.EPageTurningOperation.Backward,t),PageForward=(t=!1)=>(e,n)=>DispatcherTurning(e,n,AnnotationSize.EPageTurningOperation.Forward,t),PageJump=(t,e=!1)=>(n,a)=>{if(t!==a().imgIndex)return DispatcherTurning(n,a,AnnotationSize.EPageTurningOperation.Jump,e,t)},loadImgList=(t,e,n,a)=>__async(void 0,null,function*(){var r;const{loadFileList:o,imgList:i,pageSize:T}=e().annotation,s=Math.floor(n/T);SetAnnotationLoading(t,!0);try{const p=yield o(s,T);if(SetAnnotationLoading(t,!1),!((r=p==null?void 0:p.fileList)==null?void 0:r.length)||!(p==null?void 0:p.total))throw new Error("fileList and total are required");const N=a?new Array(p.total):[...i];return N.splice(s*T,T,...p.fileList),t({type:Actions.ANNOTATION_ACTIONS.UPDATE_IMG_LIST,payload:{imgList:N}}),!0}catch(p){SetAnnotationLoading(t,!1),console.error(p)}}),DispatcherTurning=(t,e,n,a=!1,r)=>__async(void 0,null,function*(){var o,i;const T=e().annotation,s=getSubmitByPageOperation(n);let{fileIndexChanged:p,fileIndex:N,basicIndexChanged:A,basicIndex:d}=PageOperator.getNextPageInfo(n,T,r);const I=(o=T==null?void 0:T.getImgIndexByExternal)==null?void 0:o.call(T,T.imgIndex,s);if(I!==void 0&&(p=!0,N=I),ChangeTriggerEventAfterIndexChanged(t,a),p){if(T.loading||!T.imgList[N]&&!(yield loadImgList(t,e,N)))return;const l=e();(i=T.onPageChange)==null||i.call(T,N);const u=s===index.ESubmitType.Backward?getBasicIndex(l.annotation,d):d;return SubmitAndChangeFileIndex(t,N,s,u)}return A?ChangeBasicIndex(t,d):t(ToSubmitFileData(s))}),ChangeSave=t=>{t(ToSubmitFileData(index.ESubmitType.Save)),t({type:Actions.ANNOTATION_ACTIONS.SAVE_RESULT})},SetAnnotationLoading=(t,e)=>{t({type:Actions.ANNOTATION_ACTIONS.SET_LOADING,payload:{loading:e}})},SetLoadPCDFileLoading=(t,e)=>{t({type:Actions.ANNOTATION_ACTIONS.SET_LOADPCDFILE_LOADING,payload:{loadPCDFileLoading:e}})},InitAnnotationState=t=>{t({type:Actions.ANNOTATION_ACTIONS.INIT_ALL_STATE,payload:{}})},SetPredictResult=(t,e)=>{t({type:Actions.ANNOTATION_ACTIONS.SET_PREDICT_RESULT,payload:{result:e}})},SetPredictResultVisible=(t,e)=>{t({type:Actions.ANNOTATION_ACTIONS.SET_PREDICT_RESULT_VISIBLE,payload:{visible:e}})},GetBoxesByID=(t,e)=>(n,a)=>{const{imgList:r,step:o}=a().annotation;return util.getBoxesByTrackID(r,o,t,e)},PreDataProcess=t=>(e,n)=>{var a,r;const{annotation:o}=n();return(r=(a=o==null?void 0:o.preDataProcess)==null?void 0:a.call(o,t))!=null?r:t.dataList},SubmitHandler=t=>(e,n)=>__async(void 0,null,function*(){const{annotation:a}=n(),{onSubmit:r,imgIndex:o,imgList:i}=a;!r||(yield r([i[o]],t,o,i))});exports.BatchUpdateImgListResultByPredictResult=BatchUpdateImgListResultByPredictResult,exports.BatchUpdateResultByTrackID=BatchUpdateResultByTrackID,exports.BatchUpdateTrackID=BatchUpdateTrackID,exports.ChangeSave=ChangeSave,exports.CopyBackWordResult=CopyBackWordResult,exports.DispatcherTurning=DispatcherTurning,exports.GetBoxesByID=GetBoxesByID,exports.InitAnnotationState=InitAnnotationState,exports.InitTaskData=InitTaskData,exports.PageBackward=PageBackward,exports.PageForward=PageForward,exports.PageJump=PageJump,exports.PreDataProcess=PreDataProcess,exports.SetAnnotationLoading=SetAnnotationLoading,exports.SetLoadPCDFileLoading=SetLoadPCDFileLoading,exports.SetPredictResult=SetPredictResult,exports.SetPredictResultVisible=SetPredictResultVisible,exports.SetTaskConfig=SetTaskConfig,exports.SetTaskStepList=SetTaskStepList,exports.SubmitHandler=SubmitHandler,exports.ToNextStep=ToNextStep,exports.ToSubmitFileData=ToSubmitFileData,exports.UpdateBeforeRotate=UpdateBeforeRotate,exports.UpdateCheckMode=UpdateCheckMode,exports.UpdateGetFileData=UpdateGetFileData,exports.UpdateGetFileList=UpdateGetFileList,exports.UpdateHighlightAttribute=UpdateHighlightAttribute,exports.UpdateImgIndexByExternal=UpdateImgIndexByExternal,exports.UpdateInjectFunc=UpdateInjectFunc,exports.UpdateOnPageChange=UpdateOnPageChange,exports.UpdateOnSave=UpdateOnSave,exports.UpdateOnStepChange=UpdateOnStepChange,exports.UpdateOnSubmit=UpdateOnSubmit,exports.UpdatePageSize=UpdatePageSize,exports.UpdatePreDataProcess=UpdatePreDataProcess,exports.UpdateProcessingStep=UpdateProcessingStep,exports.UpdateRotate=UpdateRotate,exports.UpdateSkipBeforePageTurning=UpdateSkipBeforePageTurning,exports.UpdateToolInstance=UpdateToolInstance,exports.loadImgList=loadImgList;
|