import{isPrimitive as n}from"../../../../../utils/guards/is-primitive.js";import{getNodeAttribute as o}from"./get-node-attribute.js";import{getVariable as p}from"./get-variable.js";import{isNode as a}from"./guards/is-node.js";import{isTag as l}from"./guards/is-tag.js";import{isCodeNode as c}from"./guards/is-code-node.js";import{isConditionalNode as d}from"./guards/is-conditional-node.js";import{isExampleNode as u}from"./guards/is-example-node.js";import{isFenceNode as h}from"./guards/is-fence-node.js";import{isTextNode as N}from"./guards/is-text-node.js";import{isFunction as b}from"./guards/is-function.js";import{isVariable as g}from"./guards/is-variable.js";function t(m,r={}){const{isTrim:s=!0}=r,i=[];for(const e of m){if(n(e))i.push(String(e));else if(a(e))if(e.type==="tr"&&i.push(`
`),N(e)||c(e)||h(e))i.push(t([o(e,"content")],r));else if(u(e))i.push(t(e.children.map(f=>o(f,"content")),r));else{if(d(e)&&r.skipConditionals)continue;i.push(t(e.children,r))}else l(e)&&e.name==="code"?i.push(t(e.children,r)):b(e)&&i.push(t(Object.values(e.parameters),r));g(e)&&i.push(t([p(e,r.variables)],r))}return s?i.map(e=>e.trim()).join(" ").trim():i.join(" ")}export{t as getInnerText};
