import{j as e}from"./react-vendor-MPLM8hiW.js";import{a as g,p as f,P as l,C as o}from"./index-saDuzM6I.js";import{n as u,p as d}from"./pluginAdminHelpers-BaIhTGH8.js";import{P as x}from"./PluginConfigForm-BlNoy5Cc.js";import{F as P}from"./vendor-CwCtuXvS.js";import"./tanstack-vendor-Dk_RmDT8.js";import"./radix-vendor-aVdTdbL0.js";import"./icons-vendor-H2PpUqT3.js";function h({src:n,title:r}){return e.jsx("iframe",{src:n,title:r,className:"w-full min-h-[600px] border-0 rounded-lg",sandbox:"allow-scripts allow-forms allow-popups",referrerPolicy:"no-referrer"})}function j({content:n}){return e.jsx(o,{className:"p-6",children:e.jsx("div",{className:"prose dark:prose-invert max-w-none whitespace-pre-wrap",children:n})})}function N({pluginConfig:n,pluginConfigSchema:r,pluginName:s}){return e.jsx(x,{configSchema:r,config:n,pluginDisplayName:s})}function w(n,r){switch(n.type){case"iframe":return n.src?e.jsx(h,{src:n.src,title:n.title}):e.jsx(o,{className:"p-6",children:e.jsx("p",{className:"text-text-secondary",children:r("pluginUi.noSourceUrl")})});case"markdown":return e.jsx(j,{content:n.src??""});case"settings-form":return e.jsx(N,{pluginName:n.pluginDisplayName,pluginConfigSchema:n.pluginConfigSchema,pluginConfig:n.pluginConfig});default:return null}}function v(){const{pluginSlug:n,"*":r}=P(),{t:s}=g(),c=f(t=>t.getAllPages)(),a=u(r),i=c.find(t=>{const m=d(t.pluginName),p=u(t.path);return m===n&&p===a});return i?e.jsx(l,{title:i.title,children:w(i,s)}):e.jsx(l,{title:s("errors.notFound"),children:e.jsx(o,{className:"p-6",children:e.jsxs("p",{className:"text-text-secondary",children:[s("pluginUi.pageNotFound"),": ",n,a]})})})}export{v as PluginPageRenderer};
