1import{j as e}from"./vendor-motion-C-Vy0dKP.js";import{r,L as w}from"./vendor-react-BaAVn3DV.js";import{A as C,b as N,a as v}from"./alert-XzGcPdDN.js";import{B as y}from"./badge-LyXHZkTS.js";import{f as k,B as t,C as o}from"./index-DrP1MJKL.js";import{C as p,b as h,c as f,a as u}from"./card-CCk1lWNz.js";import{A}from"./arrow-left-DbI7Hsma.js";import{C as i}from"./copy-MHu547pn.js";import{C as _,a as j}from"./code-xml-CifnVUDk.js";import"./vendor-ui-CQWRReMe.js";import"./vendor-charts-M7m8QV2H.js";import"./vendor-query-CdGXDvSH.js";import"./vendor-supabase-BVsQbp7g.js";/** 2 * @license lucide-react v0.462.0 - ISC 3 * 4 * This source code is licensed under the ISC license. 5 * See the LICENSE file in the root directory of this source tree. 6 */const E=k("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]),g=`{ 7 "observability": { 8 "enabled": false, 9 "head_sampling_rate": 1, 10 "logs": { 11 "enabled": true, 12 "head_sampling_rate": 1, 13 "persist": true, 14 "invocation_logs": true 15 }, 16 "traces": { 17 "enabled": false, 18 "persist": true, 19 "head_sampling_rate": 1 20 } 21 } 22}`,V=()=>{const[l,c]=r.useState("Carregando código do Worker..."),[s,d]=r.useState(!1),[n,m]=r.useState(!1);r.useEffect(()=>{document.title="Código do Cloudflare Worker · MNE Admin",fetch("/cloudflare-worker/worker.js",{cache:"no-store"}).then(a=>{if(!a.ok)throw new Error("Não foi possÃvel carregar o Worker.");return a.text()}).then(c).catch(()=>{c("Erro ao carregar /cloudflare-worker/worker.js. Atualize a página e tente novamente.")})},[]);const x=async()=>{try{await navigator.clipboard.writeText(l),d(!0),setTimeout(()=>d(!1),2e3)}catch{}},b=async()=>{try{await navigator.clipboard.writeText(g),m(!0),setTimeout(()=>m(!1),2e3)}catch{}};return e.jsx("main",{className:"min-h-screen bg-background",children:e.jsxs("div",{className:"max-w-5xl mx-auto px-4 sm:px-6 py-6 sm:py-10",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 mb-6",children:[e.jsxs(w,{to:"/admin/migracao-cloudflare",className:"inline-flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground",children:[e.jsx(A,{className:"w-4 h-4"})," Voltar ao plano de migração"]}),e.jsxs(t,{variant:"outline",size:"sm",onClick:x,children:[s?e.jsx(o,{className:"w-4 h-4 mr-2"}):e.jsx(i,{className:"w-4 h-4 mr-2"}),s?"Copiado!":"Copiar código"]})]}),e.jsxs("div",{className:"mb-6",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx("span",{className:"w-11 h-11 rounded-2xl bg-primary/15 text-primary flex items-center justify-center",children:e.jsx(_,{className:"w-5 h-5"})}),e.jsx(y,{variant:"secondary",className:"uppercase tracking-wider",children:"Deploy"})]}),e.jsx("h1",{className:"text-2xl sm:text-4xl font-serif font-bold leading-tight",children:"Código do Cloudflare Worker"}),e.jsxs("p",{className:"text-muted-foreground mt-2 max-w-3xl",children:["Esta página carrega a mesma versão pública de ",e.jsx("code",{children:"/cloudflare-worker/worker.js"}),", evitando que o código exibido fique diferente do deploy automático."]})]}),e.jsxs(C,{className:"mb-6 border-amber-500/40 bg-amber-500/10",children:[e.jsx(j,{className:"w-4 h-4"}),e.jsx(N,{children:"Status do ajuste atual"}),e.jsxs(v,{children:["A versão atual remove a dependência de ",e.jsx("code",{children:"lovable-origin"}),"/",e.jsx("code",{children:"resolveOverride"})," para evitar o erro 1016 e mantém o tratamento interno de redirects 3xx."]})]}),e.jsxs(p,{children:[e.jsx(h,{className:"pb-3",children:e.jsxs(f,{className:"flex items-center gap-3 text-base sm:text-lg",children:[e.jsx(j,{className:"w-4 h-4 text-primary"}),e.jsx("span",{className:"flex-1",children:"cloudflare-worker/worker.js"}),e.jsxs(t,{variant:"ghost",size:"sm",onClick:x,children:[s?e.jsx(o,{className:"w-4 h-4 mr-2"}):e.jsx(i,{className:"w-4 h-4 mr-2"}),s?"Copiado!":"Copiar"]})]})}),e.jsx(u,{children:e.jsx("pre",{className:"bg-muted rounded-lg p-4 overflow-x-auto text-xs sm:text-sm leading-relaxed font-mono whitespace-pre",children:e.jsx("code",{children:l})})})]}),e.jsxs(p,{className:"mt-6 border-primary/30",children:[e.jsx(h,{className:"pb-3",children:e.jsxs(f,{className:"flex items-center gap-3 text-base sm:text-lg",children:[e.jsx(E,{className:"w-4 h-4 text-primary"}),e.jsx("span",{className:"flex-1",children:"Observability â wrangler.jsonc"}),e.jsxs(t,{variant:"ghost",size:"sm",onClick:b,children:[n?e.jsx(o,{className:"w-4 h-4 mr-2"}):e.jsx(i,{className:"w-4 h-4 mr-2"}),n?"Copiado!":"Copiar"]})]})}),e.jsxs(u,{className:"space-y-3",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Configuração de observability do Worker para logs persistidos no Cloudflare."}),e.jsx("pre",{className:"bg-muted rounded-lg p-4 overflow-x-auto text-xs sm:text-sm leading-relaxed font-mono whitespace-pre",children:e.jsx("code",{children:g})})]})]})]})})};export{V as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.