"use strict";exports.ids=["809"],exports.modules={65248:function(e,t,s){t.ImportPagesController=void 0;var a=s(73446),r=s(5351);t.ImportPagesController=class{async execute(e){let{response:t,isAborted:s,input:i}=e;if(s())return t.aborted();if(i.processing){let t=new a.ImportPagesProcessPagesChecker;return await t.execute(e)}return new r.ImportPagesProcessZipFile().execute(e)}}},73446:function(e,t,s){Object.defineProperty(t,"__esModule",{value:!0}),t.PROCESS_PAGES_WAIT_TIME=t.ImportPagesProcessPagesChecker=void 0;var a=s(30395),r=s(97227);let i=t.PROCESS_PAGES_WAIT_TIME=5;t.ImportPagesProcessPagesChecker=class{async execute(e){let{response:t,context:s,store:o}=e,{items:n}=await s.tasks.listTasks({where:{parentId:o.getTask().id,definitionId:a.PageImportTask.Process,taskStatus_in:[r.TaskDataStatus.RUNNING,r.TaskDataStatus.PENDING]},limit:1});return n.length>0?t.continue({...e.input},{seconds:i}):t.done()}}},5351:function(e,t,s){var a=s(15755).default;Object.defineProperty(t,"__esModule",{value:!0}),t.ImportPagesProcessZipFile=void 0;var r=s(30395),i=s(28277),o=a(s(93586));t.ImportPagesProcessZipFile=class{async execute(e){let{response:t,input:s,trigger:a,store:n}=e,{zipFileUrl:c}=s;if(!c)return t.error({message:'Missing "zipFileUrl" in the input.'});let l=await (0,i.extractAndUploadZipFileContents)(c);if(0===l.length)return t.error({message:"No pages found in the provided zip file."});for(let e of(0,o.default)(l,5))await a({definition:r.PageImportTask.Process,input:{category:s.category,meta:s.meta,identity:s.identity,items:e,done:[],failed:[],pageIdList:[]}});return await n.updateOutput({total:l.length},{save:!1}),t.continue({...s,processing:!0},{seconds:10})}}}};
//# sourceMappingURL=ImportPagesController.08f67044.chunk.js.map