"use strict";(self.webpackChunkflow_web_extension=self.webpackChunkflow_web_extension||[]).push([["91913"],{312587:function(e,t,o){o.r(t),o.d(t,{HandleDocBlockContentChildren:()=>c});var r=o(258018),l=o(575384),n=o(407690),i=e=>{var t="",o=[],r=[],l=0;for(var i of e){if(i.block_type===n.zc.BLOCK_TEXT){var a=i.content_obj.text;t+=a;var{meta_infos:u=[]}=i;u.forEach(e=>{var{info:t}=e;try{var r,n,i=JSON.parse(t);isNaN(null===(r=i.pos_rune)||void 0===r?void 0:r[0])||o.push({endIndex:(null===(n=i.pos_rune)||void 0===n?void 0:n[0])+l,referenceId:i.insert_text})}catch(e){}}),l+=a.length}if(i.block_type===n.zc.BLOCK_IMAGE){var c,d,s,v="![](".concat(null==i?void 0:null===(s=i.content_obj)||void 0===s?void 0:null===(d=s.images)||void 0===d?void 0:null===(c=d[0])||void 0===c?void 0:c.thumb_url,")");t+=v,l+=v.length}if(i.block_type===n.zc.BLOCK_SEARCH_RESULT){var{content_obj:f}=i||{},{results:_=[]}=f||{};_.map(e=>{var{text_card:t}=e;t&&r.push({id:t.id,url:t.url,title:t.title,summary:t.summary,logoUrl:t.logo_url})})}}return{resultText:t,referenceQuoteList:o,referenceList:r}},a=e=>{var{operation:t,contentBlockTree:o}=e;if("update"===t){var{children:n,content_obj:a={}}=o,{artifact:u={}}=a,{resource_id:c,resource_version:d=0}=u,{id:s}=null!=o?o:{},v=i(n);l.i.getState().updateBlockArtifact({type:r.P.Artifact,blockId:s,value:v.resultText}),l.i.getState().updateReferenceAndQuote(c,d,v.referenceList,v.referenceQuoteList)}},u=o(19442);class c{constructor(){this.pluginIdentifier=u.d,this.resolveContentBlock=a}}}}]);
//# sourceMappingURL=91913.js.map