1import{e as u}from"./BQdvU8uU.js";import{g as J,r as Q}from"./uXeBF3sE.js";import{r as P}from"./Dc52MYiQ.js";import{N as ee}from"./BQIE75eK.js";import{b as te,I as re}from"./BrDFFC-Q.js";try{let e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="a10c5eb4-a9d5-420d-a737-1b29eee1b838",e._sentryDebugIdIdentifier="sentry-dbid-a10c5eb4-a9d5-420d-a737-1b29eee1b838")}catch{}const ne={quote:({node:e,nodesToHTML:t,providedStyleTag:n})=>{const r=t({nodes:e.children}).join("");return`<blockquote${n}>${r}</blockquote>`}},oe=new Set(["h1","h2","h3","h4","h5","h6"]),le={heading:({node:e,nodesToHTML:t,providedStyleTag:n})=>{const r=t({nodes:e.children}).join(""),l=oe.has(e.tag)?e.tag:"h1";return`<${l}${n}>${r}</${l}>`}},ie={horizontalrule:"<hr />"},ae={linebreak:"<br />"};var f=[];for(var _=0;_<256;++_)f.push((_+256).toString(16).slice(1));function ce(e,t=0){return(f[e[t+0]]+f[e[t+1]]+f[e[t+2]]+f[e[t+3]]+"-"+f[e[t+4]]+f[e[t+5]]+"-"+f[e[t+6]]+f[e[t+7]]+"-"+f[e[t+8]]+f[e[t+9]]+"-"+f[e[t+10]]+f[e[t+11]]+f[e[t+12]]+f[e[t+13]]+f[e[t+14]]+f[e[t+15]]).toLowerCase()}var U,se=new Uint8Array(16);function ue(){if(!U&&(U=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!U))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return U(se)}var de=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const q={randomUUID:de};function he(e,t,n){if(q.randomUUID&&!e)return q.randomUUID();e=e||{};var r=e.random||(e.rng||ue)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,ce(r)}function H(e){if(!e)return"";const n=e.trim().replace(/[\x00-\x1f\x7f]/g,"");if(n.startsWith("#")||n.startsWith("/")||n.startsWith("./")||n.startsWith("../"))return n;const r=n.match(/^([a-z][a-z0-9+\-.]*):(?=.)/i);if(r){const l=r[1].toLowerCase();if(l!=="http"&&l!=="https"&&l!=="mailto"&&l!=="tel")return"#"}return n}const pe=({internalDocToHref:e})=>({autolink:({node:t,nodesToHTML:n,providedStyleTag:r})=>{const l=n({nodes:t.children}).join(""),a=u(H(t.fields.url??""));return`<a${r} href="${a}"${t.fields.newTab?' rel="noopener noreferrer" target="_blank"':""}>${l}</a>`},link:({node:t,nodesToHTML:n,providedStyleTag:r})=>{const l=n({nodes:t.children}).join("");let a=t.fields.url??"";t.fields.linkType==="internal"&&(e?a=e({linkNode:t}):(console.error("Lexical => HTML converter: Link converter: found internal link, but internalDocToHref is not provided"),a="#"));const i=u(H(a));return`<a${r} href="${i}"${t.fields.newTab?' rel="noopener noreferrer" target="_blank"':""}>${l}</a>`}}),fe=new Set(["ol","ul"]),me=new Set(["bullet","check","number"]),ge={list:({node:e,nodesToHTML:t,providedStyleTag:n})=>{const r=t({nodes:e.children}).join(""),l=fe.has(e.tag)?e.tag:"ul",a=me.has(e.listType)?e.listType:"bullet";return`<${l}${n} class="list-${a}">${r}</${l}>`},listitem:({node:e,nodesToHTML:t,parent:n,providedCSSString:r})=>{const l=e.children.some(i=>i.type==="list"),a=t({nodes:e.children}).join("");if("listType"in n&&n?.listType==="check"){const i=he();return`<li 2 aria-checked="${e.checked?"true":"false"}" 3 class="list-item-checkbox${e.checked?" list-item-checkbox-checked":" list-item-checkbox-unchecked"}${l?" nestedListItem":""}" 4 role="checkbox" 5 style="list-style-type: none;${r}" 6 tabIndex="-1" 7 value="${e.value}" 8 > 9 ${l?a:`<input${e.checked?" checked":""} id="${i}" readOnly="true" type="checkbox" /> 10 <label htmlFor="${i}">${a}</label> 11 <br />`} 12 </li>`}else return`<li 13 class="${l?"nestedListItem":""}" 14 style="${l?`list-style-type: none;${r}`:r}" 15 value="${e.value}" 16 >${a}</li>`}},be={paragraph:({node:e,nodesToHTML:t,providedStyleTag:n})=>{const r=t({nodes:e.children});return r?.length?`<p${n}>${r.join("")}</p>`:`<p${n}><br /></p>`}},ye={tab:" "},$e=new Set(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","currentcolor","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","dar
16kviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","green","greenyellow","grey","honeydew","hotpink","indianred","indigo","inherit","initial","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","transparent","turquoise","unset","violet","wheat","white","whitesmoke","yellow","yellowgreen"]),we=/^(?:#[0-9a-fA-F]{3,8}|rgba?\([\d,.\s/%]+\)|hsla?\([\d,.\s/%deg]+\))$/,ke=e=>we.test(e)||$e.has(e.toLowerCase()),Te={table:({node:e,nodesToHTML:t,providedStyleTag:n})=>{const r=t({nodes:e.children}).join("");return`<div${n} class="lexical-table-container"> 17 <table class="lexical-table" style="border-collapse: collapse;"> 18 <tbody>${r}</tbody> 19 </table> 20 </div>`},tablecell:({node:e,nodesToHTML:t,providedCSSString:n})=>{const r=t({nodes:e.children}).join(""),l=e.headerState>0?"th":"td",a=`lexical-table-cell-header-${e.headerState}`;let i="border: 1px solid #ccc; padding: 8px;"+n;e.backgroundColor&&ke(e.backgroundColor)&&(i+=` background-color: ${e.backgroundColor};`);const m=e.colSpan&&e.colSpan>1?` colspan="${e.colSpan}"`:"",o=e.rowSpan&&e.rowSpan>1?` rowspan="${e.rowSpan}"`:"";return`<${l} 21 class="lexical-table-cell ${a}" 22 ${m} 23 ${o} 24 style="${i}" 25 > 26 ${r} 27 </${l}> 28 `},tablerow:({node:e,nodesToHTML:t,providedStyleTag:n})=>{const r=t({nodes:e.children}).join("");return`<tr${n} class="lexical-table-row"> 29 ${r} 30 </tr>`}},k={IS_BOLD:1,IS_ITALIC:2,IS_STRIKETHROUGH:4,IS_UNDERLINE:8,IS_CODE:16,IS_SUBSCRIPT:32,IS_SUPERSCRIPT:64},Se={text:({node:e})=>{let t=u(e.text);return e.format&k.IS_BOLD&&(t=`<strong>${t}</strong>`),e.format&k.IS_ITALIC&&(t=`<em>${t}</em>`),e.format&k.IS_STRIKETHROUGH&&(t=`<span style="text-decoration: line-through;">${t}</span>`),e.format&k.IS_UNDERLINE&&(t=`<span style="text-decoration: underline;">${t}</span>`),e.format&k.IS_CODE&&(t=`<code>${t}</code>`),e.format&k.IS_SUBSCRIPT&&(t=`<sub>${t}</sub>`),e.format&k.IS_SUPERSCRIPT&&(t=`<sup>${t}</sup>`),t}},ve={upload:({node:e,providedStyleTag:t})=>{const n=e;let r;if(typeof n.value!="object"||(r=n.value,!r))return"";const l=u(e.fields?.alt||r?.alt||""),a=u(r.url??"");if(!r.mimeType.startsWith("image"))return`<a${t} href="${a}" rel="noopener noreferrer">${u(r.filename??"")}</a>`;if(!r.sizes||!Object.keys(r.sizes).length)return` 31 <img${t} 32 alt="${l}" 33 height="${u(String(r.height??""))}" 34 src="${a}" 35 width="${u(String(r.width??""))}" 36 /> 37 `;let i="";for(const m in r.sizes){const o=r.sizes[m];!o||!o.width||!o.height||!o.mimeType||!o.filesize||!o.filename||!o.url||(i+=` 38 <source 39 media="(max-width: ${u(String(o.width))}px)" 40 srcset="${u(o.url)}" 41 type="${u(o.mimeType)}" 42 /> 43 `)}return i+=` 44 <img 45 alt="${l}" 46 height="${u(String(r.height??""))}" 47 src="${a}" 48 width="${u(String(r.width??""))}" 49 /> 50 `,`<picture${t}>${i}</picture>`}},E={...be,...Se,...ae,...ne,...Te,...le,...ie,...ge,...pe({}),...ve,...ye};function Le(e){const t=!!e?.root?.children?.length;let n=!1;if(e?.root?.children?.length===1&&e?.root?.children[0]?.type==="paragraph"){const r=e?.root?.children[0];if(!r?.children||r?.children?.length===0)n=!0;else if(r?.children?.length===1){const l=r?.children[0];l?.type==="text"&&(l?.text?.length||(n=!0))}}return!(!t||n)}function Ie({converters:e,disableIndent:t,disableTextAlign:n,node:r,unknownConverter:l}){let a;r.type==="block"?(a=e?.blocks?.[r?.fields?.blockType],!a&&!l&&console.error(`Lexical => HTML converter: Blocks converter: found ${r?.fields?.blockType} block, but no converter is provided`)):r.type==="inlineBlock"?(a=e?.inlineBlocks?.[r?.fields?.blockType],!a&&!l&&console.error(`Lexical => HTML converter: Inline Blocks converter: found ${r?.fields?.blockType} inline block, but no converter is provided`)):a=e[r.type];const i={};
50if(!n&&(!Array.isArray(n)||!n?.includes(r.type))&&"format"in r&&r.format)switch(r.format){case"center":i["text-align"]="center";break;case"end":i["text-align"]="right";break;case"justify":i["text-align"]="justify";break;case"left":break;case"right":i["text-align"]="right";break;case"start":i["text-align"]="left";break}!t&&(!Array.isArray(t)||!t?.includes(r.type))&&"indent"in r&&r.indent&&r.type!=="listitem"&&(i["padding-inline-start"]=`${Number(r.indent)*40}px`);let m="";for(const s of Object.keys(i))m+=`${s}: ${i[s]};`;const o=m?.length?` style="${m}"`:"";return{converterForNode:a??l,providedCSSString:m,providedStyleTag:o}}function Ze({className:e,converters:t,data:n,disableContainer:r,disableIndent:l,disableTextAlign:a}){if(Le(n)){let i={};return t?typeof t=="function"?i=t({defaultConverters:E}):i=t:i=E,V({converters:i,disableIndent:l,disableTextAlign:a,nodes:n?.root?.children,parent:n?.root}).join("")}return""}function V({converters:e,disableIndent:t,disableTextAlign:n,nodes:r,parent:l}){const a=e.unknown,i=[];let m=-1;for(const o of r){m++;const{converterForNode:s,providedCSSString:c,providedStyleTag:d}=Ie({converters:e,disableIndent:t,disableTextAlign:n,node:o,unknownConverter:a});try{let h;s?h=typeof s=="function"?s({childIndex:m,converters:e,node:o,nodesToHTML:g=>V({converters:g.converters??e,disableIndent:g.disableIndent??t,disableTextAlign:g.disableTextAlign??n,nodes:g.nodes,parent:g.parent??{...o,parent:l}}),parent:l,providedCSSString:c,providedStyleTag:d}):s:h="<span>unknown node</span>",i.push(h)}catch(h){console.error("Error converting lexical node to HTML:",h,"node:",o),i.push("")}}return i.filter(Boolean)}const xe="Cointelegraph",y=e=>{const t=typeof e=="string"?e.trim():"";return t.length>0?t:null},F=e=>typeof e=="string"?y(e):e!==null&&typeof e=="object"?y(Be(e)):null,Ce=({nodeCredit:e,fileCredit:t,isCover:n})=>y(e)??y(t)??(n?xe:null),W=e=>{if(e===null)return null;let t;try{t=new URL(e)}catch{return null}return t.protocol==="http:"||t.protocol==="https:"?e:null},Ue=({fields:e,file:t,isCover:n=!1})=>{const r=!!e?.overrideAttribution,l=t?.attributionInLocale!==!1,a=l&&t?.captionInBody===!0,i=a||!l?null:t?.caption,o=(r?F(e?.caption):null)??F(i),s=l?y(t?.creditFromBody):null,c=y(t?.credit),d=a&&s!==null,h=a?c:s??c,p=o??"",g=He(p),w=d||g?null:Ce({nodeCredit:r&&typeof e?.creditOverride=="string"?e.creditOverride:null,fileCredit:h,isCover:n}),S=w!==null&&w===c||A(p)!==null?W(y(t?.creditUrl)):null,L=(w!==null?w===s:s!==null&&A(p)?.name===s)?W(y(t?.creditUrlFromBody)):null,I=S??L;return{altText:y(t?.alt),caption:o,credit:w,creditUrl:I}},Y="(?:source|иÑÑоÑник|fuente|quelle|credit|fonte|kaynak|nguá»n|sumber|åºå
¸|åºæ|ã½ã¼ã¹|è³æä¾æº|便º|æ¥æº|ì¶ì²|اÙÙ
صدر|सà¥à¤°à¥à¤¤)",He=e=>typeof e=="string"&&new RegExp(`(?:^|[^A-Za-z])${Y}\\s*[:ï¼]`,"i").test(e),A=e=>{if(typeof e!="string"||e.length===0)return null;const t=new RegExp(`(?:^|[^A-Za-z])${Y}\\s*[:ï¼]\\s*`,"gi");let n=null;for(let i=t.exec(e);i!==null;i=t.exec(e))n=i;if(!n)return null;const r=n.index+n[0].length,l=e.slice(r),a=l.replace(/[\s.ãï¼!ï¼?ã,;ï¼]+$/,"");return a?{head:e.slice(0,r),name:a,tail:l.slice(a.length)}:null},_e=({credit:e,creditUrl:t})=>t===null?null:e!==null?"credit":"caption",Ee="Source",Ae=/[.!?â¦ãï¼ï¼à¥¤à¥¥:;,ØØÛââ-]$/,Re=/[â"'»ï¼)\]ããã]+$/,Ne=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),Me=e=>Ae.test(e.replace(Re,"")),Be=e=>{if(!e||typeof e!="object")return"";const t=n=>Array.isArray(n)?n.map(r=>{if(typeof r?.text=="string")return r.text;if(r?.type==="linebreak")return" ";const l=t(r?.children);return r?.type==="paragraph"&&l?`${l} `:l}).join(""):"";return t(e.root?.children).replace(/\s+/g," ").trim()},De=({captionText:e,credit:t,sourceLabel:n})=>{const r=y(e)??"",l=y(t)??"",a=y(n)??Ee;if(!l)return{caption:r,separator:"",label:"",credit:""};const i=new RegExp(`^${Ne(a)}(?:\\s*[:ï¼]\\s*|\\s+)`,"i").test(l);return{caption:r,separator:r?Me(r)?" ":". ":"",label:i?"":`${a}: `,credit:l}},je=e=>{if(!e)return null;try{const t=new URL(e),n=t.hostname.replace(/^www\./,"");if(n==="youtu.be")return t.pathname.slice(1).split("/")[0]||null;if(n!=="youtube.com"&&n!=="youtube-nocookie.com"&&n!=="m.youtube.com")return null;const r=t.searchParams.get("v");return r||(t.pathname.match(/^\/(?:embed|shorts|live|v)\/([^/?#]+)/)?.[1]??null)}catch{return null}},Oe=e=>{if(!e)return null;try{const t=new URL(e);return t.hostname.replace(/^www\./,"")!=="x.com"||!/^\/[^/]+\/status\/\d+/.test(t.pathname)?null:`https://x.com${t.pathname}`}catch{return null}},G=e=>typeof e=="object"&&e!==null,ze=e=>{if(!e)return null;try{const t=new URL(e);if(t.hostname.replace(/^www\./,"")!=="instagram.com")return null;const r=t.pathname.match(/^\/(p|reel|tv)\/([^/?#]+)/);return r?`https://www.instagram.com/${r[1]}/${r[2]}/`:null}catch{return null}},Pe=e=>{if(!e)return null;try{return new URL(e)}catch{return null}},Ke=e=>{const t=e.cmsBaseUrl.replace(/\/$/,""),n=J(),r=Pe(e.siteUrl),l=e.site??(()=>{const o=r?.hostname.toLowerCase();if(!o)return null;const s=n.find(c=>c.enabled&&c.hostname===o);return s?{...s,publicOrigin:`https://${s.hostname}`}:null})(),a=l?.hostname??r?.host,i=o=>{const s=Q(o.rawHref,l,n),c=u(s),d=o.newTab?' target="_blank"':"",h=!o.isInternal&&ee(s,a);let p="";h&&(p=e.isSponsored?' rel="noopener noreferrer sponsored"':' rel="nofollow noopener"');const g=o.ariaLabel?` aria-label="${u(o.ariaLabel)}"`:"";return`<a${o.providedStyleTag} href="${c}"${p}${d}${g}>${o.children}</a>`},m=o=>{if(o.fields.linkType!=="internal")return H(o.fields.url??"");const s=o.fields.doc?.value,c=G(s)?s:void 0,d=c?.category;return`/${G(d)?d.slug:void 0}/${c?.slug}`};return{...E,blocks:{youtubeEmbed:({node:o})=>{const s=o.fields?.url??"",c=je(s);return c?`<figure style="aspect-ratio:16/9;margin:1rem 0;"><iframe src="${`https://www.youtube-nocookie.com/embed/${u(c)}`}" title="YouTube video player" loading="lazy" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen style="width:100%;height:100%;border:0;"></iframe></figure>`:""},twitterEmbed:({node:o})=>{const s=o.fields?.url??"",c=Oe(s);return c?`<blockquote class="twitter-tweet" data-dnt="true">${i({providedStyleTag:"",rawHref:c,children:"",isInternal:!1})}</blockquote>`:""},instagramEmbed:({node:o})=>{const s=o.fields?.url??"",c=ze(s);if(!c)return"";const d=u(c),h=i({providedStyleTag:"",rawHref:c,children:"",isInternal:!1});return`<blockquote class="instagram-media" data-instgrm-permalink="${d}" data-instgrm-version="14">${h}</blockquote>`}},upload:({node:o,providedStyleTag:s})=>{const c=typeof o.value=="object"?o.value:void 0;if(!c)return"";const d=b=>typeof b=="string"?b:null,h=c,p=Ue({fields:o.fields,file:{alt:d(c.alt),credit:d(c.credit),caption:c.caption,captionInBody:typeof h.captionInBody=="boolean"?h.captionInBody:null,creditFromBody:d(h.creditFromBody),creditUrlFromBody:d(h.creditUrlFromBody),creditUrl:d(h.creditUrl),attributionInLocale:typeof h.attributionInLocale=="boolean"?h.attributionInLocale:null},isCover:o.relationTo==="article-covers"}),g=u(p.altText??""),w=c.url??"",S=P(t,w);if(!c.mimeType?.startsWith("image"))return`<a${s} href="${u(S)}" rel="nofollow noopener">${u(c.filename??"")}</a>`;const v=c.width??0,L=c.height??0,I=896,x=u(S),R=te(c.sizes,b=>P(t,b)),N=u(R),Z=Math.max(0,...Array.from(R.matchAll(/ (\d+)w/g),b=>Number(b[1]))),C=Math.min(I,Z||v||I),M=v>0?Math.round(C/v*L):L,B=` style="max-width:min(${C}px,100%)"`,T=p.caption?u(p.caption):"",$=De({captionText:p.caption,credit:p.credit,sourceLabel:e.sourceLabel}),K=$.credit?p.creditUrl?i({providedStyleTag:"",rawHref:p.creditUrl,children:u($.credit),isInternal:!1,ariaLabel:$.label?`${$.label}${$.credit}`.trim():void 0}):u($.credit):"",D=$.credit?`${u($.label)}<cite>${K}</cite>`:"",j=(()=>
50{if(_e(p)!=="caption"||p.creditUrl===null)return T;const b=A(p.caption);if(!b)return T;const z=`${u(b.name)}${u(b.tail)}`;if(!T.endsWith(z))return T;const X=i({providedStyleTag:"",rawHref:p.creditUrl,children:u(b.name),isInternal:!1});return`${T.slice(0,T.length-z.length)}${X}${u(b.tail)}`})(),O=j||D?`<figcaption style="text-align: center; font-style: italic">${j}${$.separator}${D}</figcaption>`:"";return N?`<figure${s}><img alt="${g}" src="${x}" srcset="${N}" sizes="${re}"${B} width="${C}" height="${M}" data-original="${x}" loading="lazy" decoding="async" />${O}</figure>`:`<figure${s}><img alt="${g}" src="${x}"${B} width="${C}" height="${M}" data-original="${x}" loading="lazy" decoding="async" />${O}</figure>`},autolink:({node:o,nodesToHTML:s,providedStyleTag:c})=>{const d=s({nodes:o.children}).join("");return i({providedStyleTag:c,rawHref:H(o.fields.url??""),newTab:o.fields.newTab,children:d,isInternal:o.fields.linkType==="internal"})},link:({node:o,nodesToHTML:s,providedStyleTag:c})=>{const d=s({nodes:o.children}).join("");return i({providedStyleTag:c,rawHref:m(o),newTab:o.fields.newTab,children:d,isInternal:o.fields.linkType==="internal"})}}};export{Ke as a,Ze as c};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.