import{C as e,d as t,y as n}from"./utils-BakkG8Vx.js";import{d as r,i,m as a,s as o,t as s,y as c}from"./hooks.module-5xe-uC6c.js";import{E as l,wt as u}from"./content_renderer-CoENEE63.js";import{s as d}from"./options-CDt8ZGCW.js";import{p as f}from"./compat.module-PCbCX7TU.js";import{t as p}from"./jsxRuntime.module--xb8gfv5.js";import{B as m,R as h}from"./hooks-CSTgmcXO.js";import{t as g}from"./Icon-rHGhZ_GT.js";r(),f();function _({className:t,helpPage:n,title:r,style:i}){return p(`button`,{class:`${t??``} icon-action bx bx-help-circle`,type:`button`,onClick:()=>e(n),title:r??d(`open-help-page`),style:i})}function v({currentValue:e,helpPage:t,switchOnName:n,switchOnTooltip:r,switchOffName:i,switchOffTooltip:s,onChange:c,disabled:u,afterName:d,id:f}){let[m,h]=o(!0),g=n||i;return a(()=>{let e=setTimeout(()=>{h(!1)},100);return()=>clearTimeout(e)},[]),p(`div`,{className:`switch-widget`,children:[g&&p(`span`,{className:`switch-name`,children:e?i:n}),d,p(`label`,{children:p(`div`,{className:l(`switch-button`,{on:e,disabled:u,"disable-transitions":m}),title:e?s:r,children:p(`input`,{id:f,className:`switch-toggle`,type:`checkbox`,checked:e===!0,onInput:t=>{c(!e),t.preventDefault()},disabled:u})})}),t&&p(_,{className:`switch-help-button`,helpPage:t})]})}function y({children:e,onSelect:t,style:n,fullHeight:r,wrapperClassName:o}){let c=s(null),d=s(null);a(()=>{if(!d.current||!c.current)return;let e=$(c.current),t=u.getOrCreateInstance(d.current);return e.on(`hide.bs.dropdown`,e=>e.preventDefault()),()=>{e.off(`hide.bs.dropdown`),t.dispose()}},[d,c]);let f=i(()=>{let e={};return r&&(e.height=`100%`,e.overflow=`auto`),e},[r]);return p(`div`,{className:l(`dropdownWrapper`,o),ref:c,style:f,children:p(`div`,{className:`dropdown`,style:f,children:[p(`button`,{ref:d,type:`button`,style:`display: none;`,"data-bs-toggle":`dropdown`,"data-bs-display":`static`}),p(`div`,{class:`dropdown-menu static show`,style:{...n??{},...f,position:`relative`},onClick:e=>{let n=e.target.closest(`.dropdown-item`)?.dataset?.value;n&&t&&t(n)},children:e})]})})}var b={placement:t(`right`),fallbackPlacements:[t(`right`)]};function x({className:e,icon:t,value:n,title:r,active:i,disabled:a,checked:o,container:s,onClick:c,selected:l,rtl:u,triggerCommand:d,description:f,itemRef:_,...v}){let y=m(_,null);return o&&(t=`bx bx-check`),h(y,b),p(`li`,{ref:y,class:`dropdown-item ${i?`active`:``} ${a?`disabled`:``} ${l?`selected`:``} ${s?`dropdown-container-item`:``} ${e??``}`,"data-value":n,title:r,tabIndex:s?-1:0,onClick:c,"data-trigger-command":d,dir:u?`rtl`:void 0,children:[p(g,{icon:t}),`\xA0`,f?p(`div`,{children:p(C,{description:f,disabled:a,...v})}):p(C,{description:f,disabled:a,...v})]})}function S({title:t,currentValue:n,onChange:r,disabled:i,helpPage:a,...o}){let l=s(!1);return p(x,{...o,disabled:i,onClick:async e=>{e.target?.classList.contains(`contextual-help`)||(e.stopPropagation(),!i&&!l.current&&(l.current=!0,await r(!n),l.current=!1))},children:p(v,{switchOnName:t,switchOffName:t,currentValue:n,onChange:()=>{},afterName:p(c,{children:[a&&p(`span`,{class:`bx bx-help-circle contextual-help`,onClick:()=>e(a)}),p(`span`,{class:`switch-spacer`})]})})})}function C({children:e,badges:t,description:n,disabled:r,disabledTooltip:i}){return p(c,{children:[e,t&&t.map(({className:e,text:t})=>p(`span`,{className:`badge ${e??``}`,children:t})),r&&i&&p(`span`,{class:`bx bx-info-circle contextual-help`,title:i}),n&&p(`div`,{className:`description`,children:n})]})}function w({text:e}){return p(`li`,{children:p(`h6`,{className:`dropdown-header`,children:e})})}function T(){return p(`div`,{className:`dropdown-divider`,onClick:e=>e.stopPropagation()})}function E({icon:e,title:t,children:r,dropStart:i,onDropdownToggleClicked:a}){let[s,c]=o(!1);return p(`li`,{className:l(`dropdown-item dropdown-submenu`,{"submenu-open":s,dropstart:i}),children:[p(`span`,{className:`dropdown-toggle`,onClick:e=>{e.stopPropagation(),n()?c(!s):a&&a()},children:[p(g,{icon:e}),`\xA0`,t]}),p(`ul`,{className:`dropdown-menu ${s?`show`:``}`,children:r})]})}export{x as a,_ as c,w as i,E as n,S as o,y as r,v as s,T as t};