"use strict";(self.webpackChunkdami=self.webpackChunkdami||[]).push([[5885],{65885:(o,t,e)=>{e.r(t),e.d(t,{default:()=>i});var a=e(31791);const i=async function(o,{prevBlockData:t}){const e=this.loopList[o.data.loopId];let i=!1;if(!e)throw new Error(`Can't find a loop with "${o.data.loopId}" loop id`);i="numbers"===e.type||e.index<e.data.length-1;const d=!(e&&e.maxLoop>0)||e.index<e.maxLoop-1;if(!o.data.clearLoop&&i&&d)return{data:"",nextBlockId:[{id:e.blockId}]};if("elements"===e.type){if(e.loadMoreAction&&d){const t="click-link"===e.loadMoreAction.type;let i=await this._sendMessageToTab({id:e.blockId,label:"loop-elements",data:{...e.loadMoreAction,index:e.index,onlyClickLink:t}});if(!i.continue&&t&&(await(0,a.Hh)({tabId:this.activeTab.id,ms:1e3*e.loadMoreAction.actionPageMaxWaitTime}),i=await this._sendMessageToTab({id:e.blockId,label:"loop-elements",data:{...e.loadMoreAction,index:e.index}})),!i.continue&&i.length>0)return this.loopList[o.data.loopId].data.push(...i),{data:"",nextBlockId:[{id:e.blockId}]}}const t=this.loopEls.findIndex((({blockId:o})=>o===e.blockId));-1!==t&&this.loopEls.splice(t,1)}return delete this.loopList[o.data.loopId],delete this.engine.referenceData.loopData[o.data.loopId],{data:t,nextBlockId:this.getBlockConnections(o.id)}}}}]);