import{jsxs as t,jsx as n,Fragment as i}from"react/jsx-runtime";import{ExampleValue as l,FieldLabel as p}from"../common/index.js";import{tryDecodeURIComponent as u,normalizeText as o,serializeParameterValue as c}from"../../utils/index.js";import{ExampleWrap as x,ExamplesList as d,ExampleSummary as f}from"./styled.js";import{useTranslate as h}from"../../hooks/index.js";import{Markdown as E}from"../Markdown/index.js";function b({field:e}){const r=h();return e.examples?t(i,{children:[t(p,{children:[" ",r("openapi.examples","Examples"),": "]}),n(d,{children:Object.entries(e.examples).map(([m,a])=>{const s=o(a.description);return t(x,{children:[t(f,{children:[o(a.summary)||m," "]}),s&&n(E,{source:s}),n(l,{children:j(e,a.value)})]},m)})})]}):null}function j(e,r){return e.in?u(c(e,r)):r}export{b as Examples,j as getSerializedValue};
