import{n as e}from"./rolldown-runtime-DaJ6WEGw.js";import{Io as t,Lo as n}from"./control-ui-core-DENrrOFp.js";import{$ as r,J as i,X as a}from"./lit-runtime-DRK0WlLJ.js";import{o,t as s}from"./control-ui-core-DTinBYL8.js";import{$ as c,a as l,c as u,i as d,it as f,l as p,n as m,o as h,r as g,rt as _,s as v,t as y}from"./control-ui-core-DYkQMwnN.js";import{a as b,i as x,l as S,o as C,r as w,s as T,t as E,u as D}from"./control-ui-shared-7wH5xFOU.js";import{a as O,c as k,d as A,n as j,t as M,u as ee}from"./settings-ui-tqfn2bXq.js";function te(e){return Object.keys(e??{}).filter(e=>!W.has(e)).length===0}function N(e){if(e===void 0)return``;try{return JSON.stringify(e,null,2)??``}catch{return``}}function P(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`||typeof e==`bigint`?String(e):null}function ne(e,t){if(Object.is(e,t))return!0;let n=P(e),r=P(t);return n!==null&&n===r}function re(e){if(!e||typeof e!=`object`||Array.isArray(e))return!1;let t=e;return typeof t.source!=`string`||typeof t.id!=`string`?!1:t.provider===void 0||typeof t.provider==`string`}function F(e){let t=x(e.value,e.path,e.hints),n=t&&(e.revealSensitive||(e.isSensitivePathRevealed?.(e.path)??!1));return{isSensitive:t,isRedacted:t&&!n,isRevealed:n,canReveal:t}}function I(e){let{state:t}=e;if(!t.isSensitive||!e.onToggleSensitivePath)return a;let n=t.canReveal?t.isRevealed?o(`configForm.hideValue`):o(`configForm.revealValue`):o(`configForm.disableStreamToReveal`);return r`
    <openclaw-tooltip .content=${n}>
      <button
        type="button"
        class="btn btn--icon ${t.isRevealed?`active`:``}"
        style="width:28px;height:28px;padding:0;"
        aria-label=${n}
        aria-pressed=${t.isRevealed}
        ?disabled=${e.disabled||!t.canReveal}
        @click=${()=>e.onToggleSensitivePath?.(e.path)}
      >
        ${t.isRevealed?_.eye:_.eyeOff}
      </button>
    </openclaw-tooltip>
  `}function L(e){return e.length===0?a:r`
    <div class="cfg-tags">${e.map(e=>r`<span class="cfg-tag">${e}</span>`)}</div>
  `}function R(e){let t=e.showLabel||!!e.help||e.tags.length>0||!!e.error;return r`
    <div class=${e.stacked||!t?`settings-row settings-row--stacked`:`settings-row`}>
      ${t?r`
            <div class="settings-row__text">
              ${e.showLabel?r`<span class="settings-row__title">${e.label}</span>`:a}
              ${e.help?r`<span class="settings-row__desc">${e.help}</span>`:a}
              ${L(e.tags)}
              ${e.error?r`<span class="cfg-field__error">${e.error}</span>`:a}
            </div>
          `:a}
      ${e.control===a?a:r`<div class="settings-row__control">${e.control}</div>`}
    </div>
  `}function z(e){let n=e.options.findIndex(t=>ne(t,e.resolvedValue));return k({value:n<0?``:String(n),options:e.options.map((e,n)=>({value:String(n),label:t(e)})),disabled:e.disabled,ariaLabel:e.ariaLabel,onChange:t=>{let n=e.options[Number(t)];n!==void 0&&e.onSelect(n)}})}function B(e){let{schema:t,value:n,path:i,hints:s,unsupported:c,disabled:l,onPatch:u}=e,f=e.showLabel??!0,p=D(t),{label:m,help:h,tags:g}=v(i,t,s),_=S(i),b=e.searchCriteria;if(c.has(_))return R({label:m,tags:[],showLabel:!0,control:a,error:o(`configForm.unsupportedNode`)});if(b&&y(b)&&!d({schema:t,value:n,path:i,hints:s,criteria:b}))return a;if(t.anyOf||t.oneOf){let r=(t.anyOf??t.oneOf??[]).filter(e=>!(e.type===`null`||Array.isArray(e.type)&&e.type.includes(`null`)));if(r.length===1){let t=r[0];return t?B({...e,schema:t}):a}let o=r.map(e=>{if(e.const!==void 0)return e.const;if(e.enum&&e.enum.length===1)return e.enum[0]}),c=o.every(e=>e!==void 0);if(c&&o.length>0&&o.length<=5)return R({label:m,help:h,tags:g,showLabel:f,control:z({options:o,resolvedValue:n??t.default,disabled:l,ariaLabel:m,onSelect:e=>u(i,e)})});if(c&&o.length>5)return H({...e,options:o,value:n??t.default});let d=new Set(r.map(e=>D(e)).filter(Boolean)),p=new Set([...d].map(e=>e===`integer`?`number`:e));if([...p].every(e=>[`string`,`number`,`boolean`].includes(e))){let n=p.has(`string`),r=p.has(`number`);if(p.has(`boolean`)&&p.size===1)return B({...e,schema:{...t,type:`boolean`,anyOf:void 0,oneOf:void 0}});if(n||r)return V({...e,inputType:r&&!n?`number`:`text`})}return ae({schema:t,value:n,path:i,hints:s,disabled:l,showLabel:f,revealSensitive:e.revealSensitive??!1,isSensitivePathRevealed:e.isSensitivePathRevealed,onToggleSensitivePath:e.onToggleSensitivePath,onPatch:u})}if(t.enum){let r=t.enum;return r.length<=5?R({label:m,help:h,tags:g,showLabel:f,control:z({options:r,resolvedValue:n??t.default,disabled:l,ariaLabel:m,onSelect:e=>u(i,e)})}):H({...e,options:r,value:n??t.default})}if(p===`object`)return oe(e);if(p===`array`)return se(e);if(p===`boolean`){let e=typeof n==`boolean`?n:typeof t.default==`boolean`?t.default:!1,o=e=>u(i,e);return f?A({title:m,description:h||g.length>0?r`${h??a}${L(g)}`:void 0,checked:e,disabled:l,onChange:o}):R({label:m,help:h,tags:g,showLabel:f,control:ee({checked:e,disabled:l,ariaLabel:m,onChange:o})})}return p===`number`||p===`integer`?ie(e):p===`string`?V({...e,inputType:`text`}):R({label:m,tags:[],showLabel:!0,control:a,error:o(`configForm.unsupportedType`,{type:String(p)})})}function V(e){let{schema:n,value:i,path:s,hints:c,disabled:l,onPatch:u,inputType:d}=e,f=e.showLabel??!0,p=b(s,c),{label:m,help:h,tags:g}=v(s,n,c),_=F({path:s,value:i,hints:c,revealSensitive:e.revealSensitive??!1,isSensitivePathRevealed:e.isSensitivePathRevealed}),y=typeof i==`object`&&!!i&&!Array.isArray(i),x=re(i),S=e.rawAvailable??!0,C=_.isRedacted||x,w=C?x?o(S?`configForm.structuredSecretRaw`:`configForm.structuredSecretFile`):E:p?.placeholder??(n.default===void 0?``:o(`configForm.defaultValue`,{value:t(n.default)})),T=C?``:y?N(i):i??``;return R({label:m,help:h,tags:g,showLabel:f,control:r`
    <input
      type=${_.isSensitive&&!C?`text`:d}
      class="settings-input${C?` cfg-redacted`:``}"
      placeholder=${w}
      .value=${t(T)}
      ?disabled=${l}
      ?readonly=${C}
      @click=${()=>{_.isRedacted&&!x&&e.onToggleSensitivePath&&e.onToggleSensitivePath(s)}}
      @input=${e=>{if(C)return;let t=e.target.value;if(d===`number`){if(t.trim()===``){u(s,void 0);return}let e=Number(t);u(s,Number.isNaN(e)?t:e);return}u(s,t)}}
      @change=${e=>{if(d===`number`||C)return;let t=e.target.value;u(s,t.trim())}}
    />
    ${x?a:I({path:s,state:_,disabled:l,onToggleSensitivePath:e.onToggleSensitivePath})}
    ${n.default===void 0?a:r`
          <openclaw-tooltip .content=${o(`configForm.resetToDefault`)}>
            <button
              type="button"
              class="btn btn--icon"
              style="width:28px;height:28px;padding:0;"
              aria-label=${o(`configForm.resetToDefault`)}
              ?disabled=${l||C}
              @click=${()=>u(s,n.default)}
            >
              ↺
            </button>
          </openclaw-tooltip>
        `}
  `})}function ie(e){let{schema:n,value:i,path:a,hints:o,disabled:s,onPatch:c}=e,l=e.showLabel??!0,{label:u,help:d,tags:f}=v(a,n,o),p=i??n.default??``,m=e=>{if(s)return;let t=Number(p);c(a,(Number.isFinite(t)?t:0)+e)};return R({label:u,help:d,tags:f,showLabel:l,control:r`
    <button
      type="button"
      class="btn btn--sm btn--icon"
      aria-label=${`${u}: -1`}
      ?disabled=${s}
      @click=${()=>m(-1)}
    >
      −
    </button>
    <input
      type="number"
      class="settings-input"
      aria-label=${u}
      .value=${t(p)}
      ?disabled=${s}
      @input=${e=>{let t=e.target.value,n=t===``?void 0:Number(t);c(a,n)}}
    />
    <button
      type="button"
      class="btn btn--sm btn--icon"
      aria-label=${`${u}: +1`}
      ?disabled=${s}
      @click=${()=>m(1)}
    >
      +
    </button>
  `})}function H(e){let{schema:t,value:n,path:i,hints:a,disabled:s,options:c,onPatch:l}=e,u=e.showLabel??!0,{label:d,help:f,tags:p}=v(i,t,a),m=n??t.default,h=c.findIndex(e=>e===m||String(e)===String(m)),g=`__unset__`;return R({label:d,help:f,tags:p,showLabel:u,control:r`
    <select
      class="settings-select"
      ?disabled=${s}
      .value=${h>=0?String(h):g}
      @change=${e=>{let t=e.target.value;l(i,t===g?void 0:c[Number(t)])}}
    >
      <option value=${g} ?selected=${h<0}>${o(`configForm.select`)}</option>
      ${c.map((e,t)=>r` <option value=${String(t)} ?selected=${t===h}>
            ${String(e)}
          </option>`)}
    </select>
  `})}function U(e){let{path:t,fallback:n,sensitiveState:i,disabled:a,onPatch:s}=e;return r`
    <textarea
      class="settings-input${i.isRedacted?` cfg-redacted`:``}"
      placeholder=${i.isRedacted?E:o(`configForm.jsonValue`)}
      rows=${e.rows}
      .value=${i.isRedacted?``:n}
      ?disabled=${a}
      ?readonly=${i.isRedacted}
      @click=${()=>{i.isRedacted&&e.onToggleSensitivePath&&e.onToggleSensitivePath(t)}}
      @change=${e=>{if(i.isRedacted)return;let r=e.target,a=r.value.trim();if(!a){s(t,void 0);return}try{s(t,JSON.parse(a))}catch{r.value=n}}}
    ></textarea>
    ${I({path:t,state:i,disabled:a,onToggleSensitivePath:e.onToggleSensitivePath})}
  `}function ae(e){let{schema:t,value:n,path:r,hints:i,disabled:a,onPatch:o}=e,s=e.showLabel??!0,{label:c,help:l,tags:u}=v(r,t,i);return R({label:c,help:l,tags:u,showLabel:s,stacked:!0,control:U({path:r,fallback:N(n),rows:3,sensitiveState:F({path:r,value:n,hints:i,revealSensitive:e.revealSensitive??!1,isSensitivePathRevealed:e.isSensitivePathRevealed}),disabled:a,onToggleSensitivePath:e.onToggleSensitivePath,onPatch:o})})}function oe(e){let{schema:t,value:n,path:i,hints:o,unsupported:s,disabled:c,onPatch:u,searchCriteria:d,rawAvailable:f,revealSensitive:p,isSensitivePathRevealed:m,onToggleSensitivePath:h}=e,g=e.showLabel??!0,{label:x,help:S,tags:C}=v(i,t,o),w=d&&y(d)&&l({schema:t,path:i,hints:o,criteria:d})?void 0:d,T=n??t.default,E=T&&typeof T==`object`&&!Array.isArray(T)?T:{},D=t.properties??{},O=Object.entries(D).toSorted((e,t)=>{let n=b([...i,e[0]],o)?.order??0,r=b([...i,t[0]],o)?.order??0;return n===r?e[0].localeCompare(t[0]):n-r}),k=new Set(Object.keys(D)),A=t.additionalProperties,j=!!A&&typeof A==`object`,M=r`
    ${O.map(([e,t])=>B({schema:t,value:E[e],path:[...i,e],hints:o,rawAvailable:f,unsupported:s,disabled:c,searchCriteria:w,revealSensitive:p,isSensitivePathRevealed:m,onToggleSensitivePath:h,onPatch:u}))}
    ${j?ce({schema:A,value:E,path:i,hints:o,rawAvailable:f,unsupported:s,disabled:c,reservedKeys:k,searchCriteria:w,revealSensitive:p,isSensitivePathRevealed:m,onToggleSensitivePath:h,onPatch:u}):a}
  `;return i.length===1||!g?r`${M}`:r`
    <details class="cfg-object cfg-block" ?open=${i.length<=2}>
      <summary class="settings-row cfg-object__summary">
        <div class="settings-row__text">
          <span class="settings-row__title">${x}</span>
          ${S?r`<span class="settings-row__desc">${S}</span>`:a}
          ${L(C)}
        </div>
        <span class="settings-row__chevron cfg-object__chevron">${_.chevronDown}</span>
      </summary>
      <div class="settings-subrows">${M}</div>
    </details>
  `}function se(e){let{schema:t,value:n,path:i,hints:s,unsupported:c,disabled:u,onPatch:d,searchCriteria:f,rawAvailable:p,revealSensitive:m,isSensitivePathRevealed:h,onToggleSensitivePath:g}=e,b=e.showLabel??!0,{label:x,help:S,tags:C}=v(i,t,s),T=f&&y(f)&&l({schema:t,path:i,hints:s,criteria:f})?void 0:f,E=Array.isArray(t.items)?t.items[0]:t.items;if(!E)return R({label:x,tags:[],showLabel:!0,control:a,error:o(`configForm.unsupportedArray`)});let D=Array.isArray(n)?n:Array.isArray(t.default)?t.default:[];return r`
    <div class="cfg-block cfg-array">
      <div class="settings-row">
        <div class="settings-row__text">
          ${b?r`<span class="settings-row__title">${x}</span>`:a}
          ${S?r`<span class="settings-row__desc">${S}</span>`:a}
          ${L(C)}
        </div>
        <div class="settings-row__control">
          <span class="settings-row__value"
            >${o(D.length===1?`configForm.itemCountOne`:`configForm.itemCount`,{count:String(D.length)})}</span
          >
          <button
            type="button"
            class="btn btn--sm"
            ?disabled=${u}
            @click=${()=>{let e=[...D,w(E)];d(i,e)}}
          >
            ${o(`configForm.add`)}
          </button>
        </div>
      </div>
      ${D.length===0?j(o(`configForm.noItems`)):r`
            <div class="settings-subrows">
              ${D.map((e,t)=>r`
                  <div class="settings-row">
                    <div class="settings-row__text">
                      <span class="settings-row__title">#${t+1}</span>
                    </div>
                    <div class="settings-row__control">
                      <openclaw-tooltip .content=${o(`configForm.removeItem`)}>
                        <button
                          type="button"
                          class="btn btn--icon"
                          style="width:28px;height:28px;padding:0;"
                          aria-label=${o(`configForm.removeItem`)}
                          ?disabled=${u}
                          @click=${()=>{let e=[...D];e.splice(t,1),d(i,e)}}
                        >
                          ${_.trash}
                        </button>
                      </openclaw-tooltip>
                    </div>
                  </div>
                  ${B({schema:E,value:e,path:[...i,t],hints:s,rawAvailable:p,unsupported:c,disabled:u,searchCriteria:T,showLabel:!1,revealSensitive:m,isSensitivePathRevealed:h,onToggleSensitivePath:g,onPatch:d})}
                `)}
            </div>
          `}
    </div>
  `}function ce(e){let{schema:t,value:n,path:i,hints:a,rawAvailable:s,unsupported:c,disabled:l,reservedKeys:u,onPatch:f,searchCriteria:p,revealSensitive:m,isSensitivePathRevealed:h,onToggleSensitivePath:g}=e,v=te(t),b=Object.entries(n??{}).filter(([e])=>!u.has(e)),x=p&&y(p)?b.filter(([e,n])=>d({schema:t,value:n,path:[...i,e],hints:a,criteria:p})):b;return r`
    <div class="cfg-block cfg-map">
      <div class="settings-row">
        <div class="settings-row__text">
          <span class="settings-row__title">${o(`configForm.customEntries`)}</span>
        </div>
        <div class="settings-row__control">
          <button
            type="button"
            class="btn btn--sm"
            ?disabled=${l}
            @click=${()=>{let e={...n},r=1,a=`custom-${r}`;for(;a in e;)r+=1,a=`custom-${r}`;e[a]=v?{}:w(t),f(i,e)}}
          >
            ${o(`configForm.addEntry`)}
          </button>
        </div>
      </div>

      ${x.length===0?j(o(`configForm.noCustomEntries`)):r`
            <div class="settings-subrows">
              ${x.map(([e,u])=>{let d=[...i,e],y=N(u),b=F({path:d,value:u,hints:a,revealSensitive:m??!1,isSensitivePathRevealed:h});return r`
                  <div class="settings-row">
                    <div class="settings-row__text">
                      <input
                        type="text"
                        class="settings-input"
                        placeholder=${o(`configForm.key`)}
                        aria-label=${o(`configForm.key`)}
                        .value=${e}
                        ?disabled=${l}
                        @change=${t=>{let r=t.target.value.trim();if(!r||r===e)return;let a={...n};r in a||(a[r]=a[e],delete a[e],f(i,a))}}
                      />
                    </div>
                    <div class="settings-row__control">
                      <openclaw-tooltip .content=${o(`configForm.removeEntry`)}>
                        <button
                          type="button"
                          class="btn btn--icon"
                          style="width:28px;height:28px;padding:0;"
                          aria-label=${o(`configForm.removeEntry`)}
                          ?disabled=${l}
                          @click=${()=>{let t={...n};delete t[e],f(i,t)}}
                        >
                          ${_.trash}
                        </button>
                      </openclaw-tooltip>
                    </div>
                  </div>
                  ${v?R({label:e,tags:[],showLabel:!1,stacked:!0,control:U({path:d,fallback:y,rows:2,sensitiveState:b,disabled:l,onToggleSensitivePath:g,onPatch:f})}):B({schema:t,value:u,path:d,hints:a,rawAvailable:s,unsupported:c,disabled:l,searchCriteria:p,showLabel:!1,revealSensitive:m,isSensitivePathRevealed:h,onToggleSensitivePath:g,onPatch:f})}
                `})}
            </div>
          `}
    </div>
  `}var W,G=e((()=>{i(),f(),c(),s(),n(),m(),T(),M(),W=new Set([`title`,`description`,`default`,`nullable`,`tags`,`x-tags`])}));function le(e){let t=u[e.key];return g({key:e.key,schema:e.schema,value:e.sectionValue,hints:e.uiHints,query:e.query,label:t?.label,description:t?.description})}function ue(e){if(!e.schema)return r` <div class="muted">${o(`configForm.schemaUnavailable`)}</div> `;let t=e.schema,n=e.value??{};if(D(t)!==`object`||!t.properties)return r` <div class="callout danger">${o(`configForm.unsupportedSchema`)}</div> `;let i=new Set(e.unsupportedPaths??[]),s=t.properties,c=e.searchQuery??``,l=h(c),d=e.activeSection,f=e.activeSubsection??null,p=Object.entries(s).toSorted((t,n)=>{let r=b([t[0]],e.uiHints)?.order??50,i=b([n[0]],e.uiHints)?.order??50;return r===i?t[0].localeCompare(n[0]):r-i}).filter(([t,r])=>!(d&&t!==d||c&&!le({key:t,schema:r,sectionValue:n[t],uiHints:e.uiHints,query:c}))),m=null;if(d&&f&&p.length===1){let e=p[0]?.[1];e&&D(e)===`object`&&e.properties&&e.properties[f]&&(m={sectionKey:d,subsectionKey:f,schema:e.properties[f]})}if(p.length===0)return O(j(c?o(`configForm.noSettingsMatch`,{query:c}):o(`configForm.noSettingsInSection`)));let g=t=>r`
    <section class="settings-section" id=${t.id}>
      <div class="settings-section__header">
        <h2 class="settings-section__heading">${t.label}</h2>
        ${e.sectionActions?r`<div class="settings-section__actions">${e.sectionActions}</div>`:a}
      </div>
      ${t.description?r`<p class="settings-section__desc">${t.description}</p>`:a}
      <div class="settings-group">
        ${B({schema:t.node,value:t.nodeValue,path:t.path,hints:e.uiHints,rawAvailable:e.rawAvailable??!0,unsupported:i,disabled:e.disabled??!1,showLabel:!1,searchCriteria:l,revealSensitive:e.revealSensitive??!1,isSensitivePathRevealed:e.isSensitivePathRevealed,onToggleSensitivePath:e.onToggleSensitivePath,onPatch:e.onPatch})}
      </div>
    </section>
  `;return O(m?(()=>{let{sectionKey:t,subsectionKey:r,schema:i}=m,a=b([t,r],e.uiHints),o=a?.label??i.title??C(r),s=a?.help??i.description??``,c=n[t],l=c&&typeof c==`object`?c[r]:void 0;return g({id:`config-section-${t}-${r}`,label:o,description:s,node:i,nodeValue:l,path:[t,r]})})():p.map(([e,t])=>{let r=u[e]??{label:e.charAt(0).toUpperCase()+e.slice(1),description:t.description??``};return g({id:`config-section-${e}`,label:r.label,description:r.description,node:t,nodeValue:n[e],path:[e]})}))}var K=e((()=>{i(),s(),p(),G(),m(),T(),M()}));function de(e){return Object.keys(e??{}).filter(e=>!Z.has(e)).length===0}function q(e){let t=e.filter(e=>e!=null),n=t.length!==e.length;return{enumValues:J(t),nullable:n}}function J(e){let t=[];for(let n of e)t.some(e=>Object.is(e,n))||t.push(n);return t}function fe(e){return!e||typeof e!=`object`?{schema:null,unsupportedPaths:[`<root>`]}:Y(e,[])}function Y(e,t){let n=new Set,r={...e},i=S(t)||`<root>`;if(e.anyOf||e.oneOf||e.allOf)return he(e,t)||{schema:e,unsupportedPaths:[i]};let a=Array.isArray(e.type)&&e.type.includes(`null`),o=D(e)??(e.properties||e.additionalProperties?`object`:void 0);if(r.type=o??e.type,r.nullable=a||e.nullable,r.enum){let{enumValues:e,nullable:t}=q(r.enum);r.enum=e,t&&(r.nullable=!0),e.length===0&&n.add(i)}if(o===`object`){let a=e.properties??{},o={};for(let[e,r]of Object.entries(a)){let i=Y(r,[...t,e]);i.schema&&(o[e]=i.schema);for(let e of i.unsupportedPaths)n.add(e)}if(r.properties=o,e.additionalProperties===!0)r.additionalProperties={};else if(e.additionalProperties===!1)r.additionalProperties=!1;else if(e.additionalProperties&&typeof e.additionalProperties==`object`&&!de(e.additionalProperties)){let a=Y(e.additionalProperties,[...t,`*`]);r.additionalProperties=a.schema??e.additionalProperties,a.unsupportedPaths.length>0&&n.add(i)}}else if(o===`array`){let a=Array.isArray(e.items)?e.items[0]:e.items;if(!a)n.add(i);else{let e=Y(a,[...t,`*`]);r.items=e.schema??a,e.unsupportedPaths.length>0&&n.add(i)}}else o!==`string`&&o!==`number`&&o!==`integer`&&o!==`boolean`&&!r.enum&&n.add(i);return{schema:r,unsupportedPaths:Array.from(n)}}function pe(e){if(D(e)!==`object`)return!1;let t=e.properties?.source,n=e.properties?.provider,r=e.properties?.id;return!t||!n||!r?!1:typeof t.const==`string`&&D(n)===`string`&&D(r)===`string`}function X(e){let t=e.oneOf??e.anyOf;return!t||t.length===0?!1:t.every(e=>pe(e))}function me(e,t,n,r){let i=n.findIndex(e=>D(e)===`string`);if(i<0)return null;let a=n.filter((e,t)=>t!==i),o=a[0],s=n[i];return a.length!==1||!o||!s||!X(o)?null:Y({...e,...s,nullable:r||s.nullable,anyOf:void 0,oneOf:void 0,allOf:void 0},t)}function he(e,t){if(e.allOf)return null;let n=e.anyOf??e.oneOf;if(!n)return null;let r=[],i=[],a=!1;for(let e of n){if(!e||typeof e!=`object`)return null;if(Array.isArray(e.enum)){let{enumValues:t,nullable:n}=q(e.enum);r.push(...t),n&&(a=!0);continue}if(`const`in e){if(e.const==null){a=!0;continue}r.push(e.const);continue}if(D(e)===`null`){a=!0;continue}i.push(e)}let o=me(e,t,i,a);if(o)return o;if(r.length>0&&i.length===0)return{schema:{...e,enum:J(r),nullable:a,anyOf:void 0,oneOf:void 0,allOf:void 0},unsupportedPaths:[]};if(i.length===1){let n=i[0];return n?Y({...e,...n,nullable:a||n.nullable,anyOf:void 0,oneOf:void 0,allOf:void 0},t):null}return i.length>0&&r.length===0&&i.every(e=>{let t=D(e);return!!t&&Q.has(String(t))})?{schema:{...e,nullable:a},unsupportedPaths:[]}:null}var Z,Q,$=e((()=>{T(),Z=new Set([`title`,`description`,`default`,`nullable`,`tags`,`x-tags`]),Q=new Set([`string`,`number`,`integer`,`boolean`,`object`,`array`])})),ge=e((()=>{K(),$(),G(),T()}));export{ue as a,K as i,fe as n,G as o,$ as r,B as s,ge as t};
//# sourceMappingURL=config-form-B-FFmL7_.js.map