import{c as m,j as r}from"./wp-chat-chunk-EPOLDU6W-CW-UdKEc.js";import{C as d,F as u}from"./wp-chat-Frontend-CCke662o.js";import{c as h}from"./wp-chat-chatStore-08T9tfVp.js";import{u as n}from"./wp-chat-settingsStore-YpiJPLAf.js";import g from"./wp-chat-ThemePresets-8JGnTzYH.js";import"./wp-chat-index-dVbdFhCm.js";import"./wp-chat-SvgLoader-CQVnyx5u.js";import"./wp-chat-faqsStore-BXpYGz4v.js";import"./wp-chat-useRTL-D0WQWowb.js";import"./wp-chat-useTransitions-Doq_RbVt.js";import"./wp-chat-proxy-CgBBugQb.js";import"./wp-chat-getLocalizeVariables-Od0boKeB.js";import"./wp-chat-index-voulKR72.js";const f=document.documentElement.dir==="rtl";async function l(e){const{fetchSettings:s}=n.getState(),o=e.getState().hydrateFromSettings;await s();const t=n.getState().settings;t!=null&&t.customizerSettings&&(t.customizerSettings.theme&&g(t.customizerSettings.theme,e),o(t.customizerSettings))}function p(e,s){const o=s.getState(),t=e.getAttribute("data-disable-fixed")==="true",i=e.getAttribute("data-show-chat")==="true",c=e.getAttribute("data-disable-chat-toggle")==="true";t&&o.setDisableFixed(!0),i&&o.setShowChat(!0),c&&o.setDisableChatToggle(!0),f&&o.setIsRTL(!0)}async function a(e,s,o){const t=h(s,o);await l(t),p(e,t),m.createRoot(e).render(r.jsx(d,{store:t,children:r.jsx(u,{})}))}async function S(){const e=[],s=document.getElementById("wp-chat-floating");s&&e.push(a(s,"floating","floating")),document.querySelectorAll('[id^="wp-chat-shortcode-"]').forEach(t=>{const i=t.id;e.push(a(t,i,"shortcode"))}),await Promise.all(e)}S();