PageSourceSearch

https://fluxapi.ai/_next/static/chunks/pages/edit-281f59a5035b7082.js

js fluxapi.ai collected 2026-10-05 12:00:10 UTC 21,382 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4637],{40440:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/edit",function(){return n(93603)}])},69479:function(e,t,n){"use strict";n.d(t,{$N:function(){return x},Be:function(){return g},Vq:function(){return i},cN:function(){return h},cZ:function(){return u},fK:function(){return m}});var a=n(39696),s=n(90170),r=n(81689),l=n(53070),o=n(10929);let i=r.fC;r.xz;let c=r.h_;r.x8;let d=s.forwardRef((e,t)=>{let{className:n,...s}=e;return(0,a.jsx)(r.aV,{ref:t,className:(0,o.cn)("fixed inset-0 z-50 bg-white/10 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",n),...s})});d.displayName=r.aV.displayName;let u=s.forwardRef((e,t)=>{let{className:n,children:s,...i}=e;return(0,a.jsxs)(c,{children:[(0,a.jsx)(d,{}),(0,a.jsxs)(r.VY,{ref:t,className:(0,o.cn)("fixed left-[50%] top-[50%] z-50 grid w-[90%] translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg md:max-w-lg",n),...i,children:[s,(0,a.jsxs)(r.x8,{className:"absolute right-4 top-4 roun
1ded-sm opacity-70 outline-none ring-offset-background transition-opacity hover:opacity-100 focus:outline-none disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[(0,a.jsx)(l.Z,{className:"h-4 w-4 text-default-700"}),(0,a.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})});u.displayName=r.VY.displayName;let m=e=>{let{className:t,...n}=e;return(0,a.jsx)("div",{className:(0,o.cn)("flex flex-col space-y-1.5 text-center sm:text-left",t),...n})};m.displayName="DialogHeader";let h=e=>{let{className:t,...n}=e;return(0,a.jsx)("div",{className:(0,o.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...n})};h.displayName="DialogFooter";let x=s.forwardRef((e,t)=>{let{className:n,...s}=e;return(0,a.jsx)(r.Dx,{ref:t,className:(0,o.cn)("text-lg font-semibold leading-none tracking-tight",n),...s})});x.displayName=r.Dx.displayName;let g=s.forwardRef((e,t)=>{let{className:n,...s}=e;return(0,a.jsx)(r.dk,{ref:t,className:(0,o.cn)("text-sm text-muted-foreground",n),...s})});g.displayName=r.dk.displayName},93603:function(e,t,n){"use strict";n.r(t),n.d(t,{__N_SSG:function(){return S},default:function(){return C}});var a=n(39696),s=n(3944),r=n(90866),l=n(90170);n(44695),n(595);var o=n(86170),i=n(12472),c=n(17398),d=n(68237);n(49517),n(95777),n(37452),n(34611),n(23236);var u=n(679);let m=(e,t)=>{var n,a,s,r,l,o;console.log(t);let i=[],c=[],d=u.zD(t),m=d("h1").length;if(0===m)i.push("页面缺少 <h1> 主标题标签");else if(m>1){let e=d("h1").map((e,t)=>d(t).text().trim()).get().join('", "');i.push("页面存在 ".concat(m,' 个 H1 标签 ("').concat(e,'"),SEO 建议每个页面只保留 1 个'))}d("img").each((e,t)=>{let n=d(t).attr("src")||"未知路径",a=d(t).attr("alt");n.includes("icon")||a&&""!==a.trim()||c.push("存在未设置 Alt 属性的图片 (路径: ...".concat(n.slice(-20),")"))}),d("a").each((e,t)=>{d(t).attr("href")||c.push("存在空的链接标签 <a>")});let h=(null===(s=e.root)||void 0===s?void 0:null===(a=s.props)||void 0===a?void 0:null===(n=a.title)||void 0===n?void 0:n.trim().replace("Page Title",""))||"",x=(null===(o=e.root)||void 0===o?void 0:null===(l=o.props)||void 0===l?void 0:null===(r=l.description)||void 0===r?void 0:r.trim().replace("Page Description",""))||"";return h||i.push("页面设置中缺少标题 (Page Title)"),x||i.push("页面设置中缺少描述 (Meta Description)"),{passed:0===i.length,errors:i,warnings:c}};var h=n(69479),x=n(91653),g=n(22122),p=n(94721),f=n(67629),w=n(53070);let b=[{code:"ar",name:"العربية",nativeName:"Arabic"},{code:"de",name:"Deutsch",nativeName:"German"},{code:"en",name:"English",nativeName:"English"},{code:"es",name:"Espa\xf1ol",nativeName:"Spanish"},{code:"fa",name:"فارسی",nativeName:"Persian"},{code:"fr",name:"Fran\xe7ais",nativeName:"French"},{code:"hi",name:"हिन्दी",nativeName:"Hindi"},{code:"id",name:"Bahasa Indonesia",nativeName:"Indonesian"},{code:"it",name:"Italiano",nativeName:"Italian"},{code:"ja",name:"日本語",nativeName:"Japanese"},{code:"ko",name:"한국어",nativeName:"Korean"},{code:"nl",name:"Nederlands",nativeName:"Dutch"},{code:"pt",name:"Portugu\xeas",nativeName:"Portuguese"},{code:"ru",name:"Русский",nativeName:"Russian"},{code:"tr",name:"T\xfcrk\xe7e",nativeName:"Turkish"},{code:"vi",name:"Tiếng Việt",nativeName:"Vietnamese"},{code:"zh-CN",name:"简体中文",nativeName:"Chinese (Simplified)"}];var v=e=>{let{open:t,onOpenChange:n,supportLanguages:s=[],currentLanguage:r="en",onPublishCurrent:o,onPublishSync:i}=e,[c,d]=(0,l.useState)([]),[u,m]=(0,l.useState)(!1),v=(0,l.useRef)(null),j=b.filter(e=>s.includes(e.code)&&e.code!==r);(0,l.useEffect)(()=>{let e=e=>{v.current&&!v.current.contains(e.target)&&m(!1)};return u&&document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[u]);let N=e=>{d(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},y=(e,t)=>{t.stopPropagation(),d(t=>t.filter(t=>t!==e))},k=j.length>0&&c.length===j.length,S=e=>{e.stopPropagation(),k?d([]):d(j.map(e=>e.code))};return(0,a.jsx)(h.Vq,{open:t,onOpenChange:e=>{e||(d([]),m(!1)),n(e)},children:(0,a.jsxs)(h.cZ,{className:"max-w-md border-none bg-white",children:[(0,a.jsxs)(h.fK,{children:[(0,a.jsxs)(h.$N,{className:"flex items-center gap-2 text-xl text-gray-700",children:[(0,a.jsx)(g.Z,{className:"h-5 w-5 text-blue-600"}),"选择发布方式"]}),(0,a.jsx)(h.Be,{className:"pt-4",children:(0,a.jsx)("div",{className:"space-y-4",children:(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("label",{className:"text-sm font-medium text-gray-700",children:"选择要翻译的语言(可选)"}),(0,a.jsxs)("div",{className:"relative",ref:v,children:[(0,a.jsxs)("button",{type:"button",onClick:e=>{e.stopPropagation(),m(!u)},className:"flex w-full items-center justify-between rounded-md border border-gray-300 bg-white px-3 py-2 text-left text-sm text-gray-700 transition-colors hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2",children:[(0,a.jsx)("span",{className:"truncate",children:(()=>
1{if(0===c.length)return"请选择要翻译的语言";if(1===c.length){let e=b.find(e=>e.code===c[0]);return(null==e?void 0:e.name)||c[0]}return"已选择 ".concat(c.length," 种语言")})()}),(0,a.jsx)(p.Z,{className:"h-4 w-4 transition-transform ".concat(u?"rotate-180":"")})]}),u&&(0,a.jsx)("div",{className:"absolute z-[60] mt-1 w-full rounded-md border border-gray-300 bg-white shadow-lg",onClick:e=>e.stopPropagation(),children:(0,a.jsx)("div",{className:"max-h-60 overflow-y-auto py-1",children:0===j.length?(0,a.jsx)("div",{className:"px-3 py-2 text-sm text-default-500",children:"没有可用的语言"}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{onClick:e=>{e.stopPropagation(),S(e)},className:"flex cursor-pointer items-center justify-between border-b border-gray-200 px-3 py-2 text-sm font-medium transition-colors hover:bg-gray-50",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("div",{className:"flex h-4 w-4 items-center justify-center rounded border ".concat(k?"border-blue-600 bg-blue-600":"border-gray-300 bg-white"),children:k&&(0,a.jsx)(f.Z,{className:"h-3 w-3 text-white"})}),(0,a.jsx)("span",{className:k?"text-blue-700":"text-gray-700",children:k?"取消全选":"全选"})]}),(0,a.jsxs)("span",{className:"text-xs text-gray-400",children:[c.length,"/",j.length]})]}),j.map(e=>{let t=c.includes(e.code);return(0,a.jsxs)("div",{onClick:t=>{t.stopPropagation(),N(e.code)},className:"flex cursor-pointer items-center justify-between px-3 py-2 text-sm transition-colors ".concat(t?"bg-blue-50 text-blue-700":"text-gray-700 hover:bg-gray-50"),children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("div",{className:"flex h-4 w-4 items-center justify-center rounded border ".concat(t?"border-blue-600 bg-blue-600":"border-gray-300 bg-white"),children:t&&(0,a.jsx)(f.Z,{className:"h-3 w-3 text-white"})}),(0,a.jsx)("span",{children:e.name})]}),(0,a.jsx)("span",{className:"text-xs text-gray-400",children:e.code})]},e.code)})]})})})]}),(0,a.jsxs)("div",{className:"flex min-h-[32px] flex-wrap items-center gap-2 pt-2",children:[j.length>0&&(0,a.jsxs)("button",{type:"button",onClick:e=>{e.stopPropagation(),S(e)},className:"inline-flex items-center gap-1 rounded-md px-2 py-1 text-xs font-medium transition-colors ".concat(k?"bg-green-100 text-green-700 hover:bg-green-200":"bg-gray-100 text-gray-700 hover:bg-gray-200"),children:[(0,a.jsx)(f.Z,{className:"h-3 w-3 ".concat(k?"text-green-600":"text-gray-400")}),k?"取消全选":"全选"]}),c.length>0&&c.map(e=>(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-md bg-blue-100 px-2 py-1 text-xs text-blue-700",children:[e,(0,a.jsx)("button",{type:"button",onClick:t=>y(e,t),className:"ml-1 rounded-full hover:bg-blue-200",children:(0,a.jsx)(w.Z,{className:"h-3 w-3"})})]},e))]})]})})})]}),(0,a.jsxs)(h.cN,{className:"flex-col gap-2 sm:flex-row",children:[(0,a.jsx)(x.A,{type:"button",onClick:()=>{d([]),m(!1),n(!1),o&&o()},className:"w-full rounded-md bg-blue-600 px-4 py-2 text-sm font-semibold text-white shadow-sm transition-colors hover:bg-blue-500 sm:w-auto",children:"仅发布当前语言"}),(0,a.jsx)(x.A,{type:"button",onClick:()=>{if(0===c.length)return;let e=[...c];d([]),m(!1),n(!1),i&&i(e)},disabled:0===c.length,className:"w-full rounded-md px-4 py-2 text-sm font-semibold text-white shadow-sm transition-colors sm:w-auto ".concat(0===c.length?"cursor-not-allowed bg-gray-400 opacity-50":"bg-green-600 hover:bg-green-500"),children:"同步其他语言"})]})]})})};let j={content:[],root:{}};function N(e){let{pageInfo:t,id:n,language:u,authorization:x,navigationData:g,onDataChange:p,supportLanguages:f}=e;console.log("pageInfo",t);let w=(0,d.useRouter)(),[b,N]=(0,l.useState)("edit"),[y,k]=(0,l.useState)(u||"en"),[S,C]=(0,l.useState)(null),L=(0,l.useRef)(null),[P,E]=(0,l.useState)(!1),[D,z]=(0,l.useState)(null),[_,O]=(0,l.useState)(null),[Z,B]=(0,l.useState)(null),[I,q]=(0,l.useState)(!1),[T,V]=(0,l.useState)(null);(0,l.useEffect)(()=>{w.query.language&&w.query.language!==y&&k(w.query.language)},[w.query.language,y]),(0,l.useEffect)(()=>
1{if(t){if(t.content)try{let e=JSON.parse(t.content);C(e||j)}catch(e){console.error("Failed to parse pageInfo.content:",e),C(j)}else C(j)}},[t]);let F=e=>{let t=new URL(window.location.href);t.searchParams.set("language",e),k(e),window.location.href=t.toString()},M=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;R(e);let a=i.ZP.loading("发布中...");try{let s={id:parseInt(n),content:JSON.stringify(e)};t&&t.length>0&&(s.syncLanguageList=t);let r=await fetch("".concat("https://aiadmin.nanosail.app","/api/aiplatform/editPageContent"),{method:"POST",headers:{Authorization:x,"Content-Type":"application/json"},body:JSON.stringify(s)}),l=await r.json();200===l.code?(i.ZP.success("✓ 页面发布成功!",{id:a}),p&&p(!1)):i.ZP.error(l.msg||"发布失败",{id:a})}catch(e){console.error("发布失败:",e),i.ZP.error("发布失败,请稍后重试",{id:a})}},R=e=>{L.current=e,p&&p(!0)},A=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=G(e);console.log("SEO检测结果:",n),(n.passed&&(!n.warnings||!(n.warnings.length>0))||(z(n),O(e),B(t),E(!0),n.passed))&&await M(e,t)},W=async e=>{if(f&&1===f.length&&"en"===f[0]||"en"!==y&&f&&f.length>1){await A(e);return}V(e),console.log("publishedData",e),q(!0)},H=async()=>{T&&(V(null),await A(T))},U=async e=>{T&&(V(null),await A(T,e))},J=async()=>{_&&(E(!1),await M(_,Z),O(null),B(null))},K=()=>{N("preview"),L.current&&C(L.current)},G=e=>{let t=document.querySelector('iframe[data-rfd-iframe="true"]')||document.querySelector("iframe")||document.querySelector('[class*="Puck"] iframe');return t&&t.contentDocument?m(e,t.contentDocument.body.innerHTML):(console.error("未找到iframe或无法访问iframe内容"),[])},$=()=>{let e=G(L.current||S);e.passed&&(!e.warnings||0===e.warnings.length)?i.ZP.success("✓ SEO检查通过!",{duration:3e3}):(O(null),B(null),z(e),E(!0))};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"flex h-screen flex-col",children:(0,a.jsx)("div",{className:"flex h-screen flex-col",children:S&&(0,a.jsx)("div",{className:"flex-1 overflow-hidden",children:"edit"===b?(0,a.jsx)(s._W,{config:o.Z0,data:S,onPublish:W,onChange:R,headerPath:null==t?void 0:t.path,ui:{rightSideBarVisible:!0,leftSideBarVisible:!0},overrides:{componentItem:e=>{let{children:t,name:n}=e;return(0,a.jsx)(o.Ln,{previewSrc:"https://static.aiquickdraw.com/akr/component-preview/".concat(n,".webp"),children:t})},headerActions:e=>{let{children:t}=e;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o.Bc,{}),(0,a.jsx)(o.Sf,{locales:f||["en"],language:y,handleLanguageChange:F}),(0,a.jsx)(o.D_,{onPreview:K}),(0,a.jsxs)("button",{onClick:$,className:"flex items-center gap-2 rounded-md bg-gradient-to-r from-purple-600 to-blue-600 px-4 py-2 text-sm font-medium text-white shadow-sm transition-all hover:from-purple-700 hover:to-blue-700 hover:shadow-md active:scale-95",title:"检测页面SEO优化问题",children:[(0,a.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})}),(0,a.jsx)("span",{children:"SEO检测"})]}),t]})}},plugins:[r.Z],metadata:{pageData:t,language:y,siteConfig:{domain:"fluxapi.ai",apiUrl:"https://platform.fluxapi.ai",logoUrl:"/logo.png"}}}):(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)("div",{className:"h-full overflow-y-auto",children:[(0,a.jsx)(o.Fu,{onBackToEdit:()=>N("edit")}),(0,a.jsx)(c.c,{pageInfo:{id:n,path:null==t?void 0:t.path,source:null==t?void 0:t.source,content:S,successLanguages:(null==t?void 0:t.successLanguages)||["en"],realLanguage:y},pricingInfo:null,siteConfig:{domain:"fluxapi.ai",apiUrl:"https://platform.fluxapi.ai",logoUrl:"/logo.png"},navigationData:g})]})})})})}),(0,a.jsx)(v,{open:I,onOpenChange:e=>{q(e),!e&&T&&V(null)},supportLanguages:f||[],currentLanguage:y,onPublishCurrent:H,onPublishSync:U}),(0,a.jsx)(h.Vq,{open:P,onOpenChange:E,children:(0,a.jsxs)(h.cZ,{className:"max-w-2xl overflow-y-auto",children:[(0,a.jsxs)(h.fK,{children:[(0,a.jsx)(h.$N,{className:"flex items-center gap-2 text-xl",children:(null==D?void 0:D.passed)?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6 text-yellow-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})}),"SEO 警告"]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6 text-red-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),"SEO 检测发现问题"]})}),(0,a.jsx)(h.Be,{className:"pt-4",children:(0,a.jsxs)("div",{className:"space-y-4",children:[(null==D?void 0:D.errors)&&D.errors.length>0&&(0,a.jsxs)("div",{className:"rounded-lg border border-red-200 bg-red-50 p-4",children:[(0,a.jsxs)("h3",{className:"mb-3 flex items-center gap-2 font-semibold text-red-800",children:[(0,a.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),"错误 (",D.errors.length,")"]}),(0,a.jsx)("ul",{className:"space-y-2",children:D.errors.map((e,t)=>(0,a.jsxs)("li",{className:"flex items-start gap-2 text-sm text-red-700",children:[(0,a.jsxs)("span",{className:"mt-0.5 flex-shrink-0 font-semibold text-red-600",children:[t+1,"."]}),(0,a.jsx)("span",{children:e})]},t))})]}),(null==D?void 0:D.warnings)&&D.warnings.length>0&&(0,a.jsxs)("div",{className:"rounded-lg border border-yellow-200 bg-yellow-50 p-4",children:[(0,a.jsxs)("h3",{className:"mb-3 flex items-center gap-2 font-semibold text-yellow-800",children:[(0,a.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})}),"警告 (",D.warnings.length,")"]}),(0,a.jsx)("ul",{className:"space-y-2",children:D.warnings.map((e,t)=>(0,a.jsxs)("li",{className:"flex items-start gap-2 text-sm text-yellow-700",children:[(0,a.jsxs)("span",{className:"mt-0.5 flex-shrink-0 font-semibold text-yellow-600",children:[t+1,"."]}),(0,a.jsx)("span",{children:e})]},t))})]}),!(null==D?void 0:D.passed)&&(0,a.jsxs)("div",{className:"rounded-lg border border-blue-200 bg-blue-50 p-3 text-sm text-blue-800",children:[(0,a.jsx)("p",{className:"font-medium",children:"\uD83D\uDCA1 提示:"}),(0,a.jsx)("p",{className:"mt-1",children:"请修复上述错误后再发布。警告信息不会阻止发布,但建议修复以提升 SEO 效果。"})]})]})})]}),(0,a.jsxs)(h.cN,{children:[!(null==D?void 0:D.passed)&&_&&(0,a.jsx)("button",{type:"button",onClick:J,className:"inline-flex w-full justify-center rounded-md bg-red-600 px-4 py-2 text-sm font-semibold text-white shadow-sm transition-colors hover:bg-red-500 sm:ml-3 sm:w-auto",children:"仍要发布"}),(0,a.jsx)("button",{type:"button",onClick:()=>{E(!1),O(null),B(null)},className:"mt-3 inline-flex w-full justify-center rounded-md bg-white px-4 py-2 text-sm font-semibold text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 transition-colors hover:bg-gray-50 sm:mt-0 sm:w-auto",children:"我知道了"})]})]})})]})}let y=async e=>{try{let t=await fetch("".concat("https://aiadmin.nanosail.app","/api/aiplatform/getContentByLocate?pageId=").concat(parseInt(e.id),"&locate=").concat(e.language),{method:"GET",headers:{Authorization:e.authorization}}),n=await t.json();if(200===n.code)return n.data;return null}catch(e){return null}};var k=n(30034),S=!0;function C(){let{id:e,language:t,authorization:n}=(0,d.useRouter)().query,[s,r]=(0,l.useState)(null),[o,i]=(0,l.useState)(!0),[c,u]=(0,l.useState)(null),[m,h]=(0,l.useState)(null),[x,g]=(0,l.useState)(!1),[p,f]=(0,l.useState)(["en"]);return((0,l.useEffect)(()=>{let e=e=>{if(x){let t="您有未保存的数据,确定要离开吗?";return e.returnValue=t,t}};return window.addEventListener("beforeunload",e),()=>{window.removeEventListener("beforeunload",e)}},[x]),(0,l.useEffect)(()=>{s&&(0,k.Hc)({source:s.source}).then(e=>{h(e)})},[s]),(0,l.useEffect)(()=>
1{if(!e){u("缺少页面 ID 参数"),i(!1);return}if(!n){u("缺少授权信息"),i(!1);return}i(!0),u(null),y({id:e,language:t,authorization:n}).then(e=>{e?r(e):u("页面信息不存在或加载失败"),f(e.successLanguages||["en"])}).catch(e=>{console.log("err",e),u("加载页面信息时发生错误,请稍后重试")}).finally(()=>{i(!1)})},[e,t,n]),o)?(0,a.jsx)("div",{className:"flex h-screen items-center justify-center bg-gray-50",children:(0,a.jsxs)("div",{className:"text-center",children:[(0,a.jsx)("div",{className:"mx-auto mb-4 h-12 w-12 animate-spin rounded-full border-4 border-blue-500 border-t-transparent"}),(0,a.jsx)("p",{className:"text-lg text-gray-600",children:"正在加载页面编辑器..."})]})}):c?(0,a.jsx)("div",{className:"flex h-screen items-center justify-center bg-gray-50",children:(0,a.jsxs)("div",{className:"max-w-md text-center",children:[(0,a.jsx)("div",{className:"mx-auto mb-4 h-16 w-16 rounded-full bg-red-100 p-4",children:(0,a.jsx)("svg",{className:"h-8 w-8 text-red-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L3.732 16.5c-.77.833.192 2.5 1.732 2.5z"})})}),(0,a.jsx)("h2",{className:"mb-2 text-xl font-semibold text-gray-800",children:"无法加载编辑器"}),(0,a.jsx)("p",{className:"mb-4 text-gray-600",children:c}),(0,a.jsx)("button",{onClick:()=>window.location.reload(),className:"rounded bg-blue-500 px-4 py-2 text-white transition-colors hover:bg-blue-600",children:"重新加载"})]})}):(0,a.jsx)(N,{pageInfo:s,id:null==s?void 0:s.id,language:t,supportLanguages:p,authorization:n,navigationData:m,onDataChange:g})}}},function(e){e.O(0,[6981,768,268,4546,5834,49,8205,5857,9958,1689,9210,2024,4385,7398,2888,9774,179],function(){return e(e.s=40440)}),_N_E=e.O()}]);

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.