import{u as a,j as s}from"./fields-wnm5Jtc6.js";import{a as n}from"./vendor-D21mNUGX.js";import{L as f,b as v}from"./Layout-CFk9FOHT.js";import{m as j,L as w,w as b}from"./index-pmrLY__j.js";const A=()=>{const[i,d]=n.useState([]),[m,h]=n.useState(null),[u,l]=n.useState(!1),p=()=>{l(!0),b("fetchChangelogAction").then(e=>{h(e.changelog),d(e.versions),l(!1)}).catch(e=>{l(!1),console.error(e.message)})},x=e=>{const t=["added","changed","removed","fixed"];if(e===""){t.map(o=>{document.querySelectorAll(`.${o}`).forEach(r=>{r.classList.remove("hidden")})});return}const c=t.indexOf(e);c>-1&&t.splice(c,1),document.querySelectorAll(`.${e}`).forEach(o=>{o.classList.remove("hidden")}),t.map(o=>{document.querySelectorAll(`.${o}`).forEach(r=>{r.classList.add("hidden")})})};return n.useEffect(()=>{j(a("Changelog")),p()},[]),u?s.jsx(w,{}):s.jsxs(f,{title:a("Changelog"),crumbs:[],children:[s.jsxs("div",{className:"changelog-version-selector i-flex-center for-xs s-8 py-24 bg-base-gray z-11 sticky w-100",style:{top:"98px",boxShadow:"-5px 0px 0px 0px var(--acpt-bg-color), 5px 0px 0px 0px  var(--acpt-bg-color)"},children:[s.jsxs("select",{className:"form-control sm w-auto w-full-mobile",onChange:e=>{e.preventDefault(),v(e.target.value)},children:[s.jsx("option",{value:"",children:a("Jump to version")}),i.map(e=>s.jsx("option",{value:e.value,children:e.label}))]}),s.jsxs("select",{className:"form-control sm w-auto w-full-mobile",onChange:e=>{e.preventDefault(),x(e.target.value)},children:[s.jsx("option",{value:"",children:a("Show only")}),s.jsx("option",{value:"added",children:"Added"}),s.jsx("option",{value:"changed",children:"Changed"}),s.jsx("option",{value:"fixed",children:"Fixed"}),s.jsx("option",{value:"removed",children:"Removed"})]})]}),s.jsx("div",{className:"bg-white with-shadow p-24 b-rounded",children:s.jsx("div",{className:"changelog",dangerouslySetInnerHTML:{__html:m}})})]})};export{A as default};
