30 lines
292 KiB
JavaScript
30 lines
292 KiB
JavaScript
|
|
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,a)=>(a=n==null?{}:e(i(n)),c(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var u=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},ee=Object.prototype.hasOwnProperty;function T(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function E(e,t){return T(e.type,t,e.props)}function te(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function ne(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var re=/\/+/g;function ie(e,t){return typeof e==`object`&&e&&e.key!=null?ne(``+e.key):t.toString(36)}function ae(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function oe(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,oe(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+ie(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(re,`$&/`)+`/`),oe(o,r,i,``,function(e){return e})):o!=null&&(te(o)&&(o=E(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(re,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var
|
|||
|
|
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|||
|
|
`+Se+e+Ce}var Te=!1;function Ee(e,t){if(!e||Te)return``;Te=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,`props`,{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,`name`,{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
|
|||
|
|
`),l=s.split(`
|
|||
|
|
`);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
|
|||
|
|
`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{Te=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?we(n):``}function De(e,t){switch(e.tag){case 26:case 27:case 5:return we(e.type);case 16:return we(`Lazy`);case 13:return e.child!==t&&t!==null?we(`Suspense Fallback`):we(`Suspense`);case 19:return we(`SuspenseList`);case 0:case 15:return Ee(e.type,!1);case 11:return Ee(e.type.render,!1);case 1:return Ee(e.type,!0);case 31:return we(`Activity`);default:return``}}function Oe(e){try{var t=``,n=null;do t+=De(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|||
|
|
Error generating stack: `+e.message+`
|
|||
|
|
`+e.stack}}var ke=Object.prototype.hasOwnProperty,Ae=t.unstable_scheduleCallback,je=t.unstable_cancelCallback,Me=t.unstable_shouldYield,Ne=t.unstable_requestPaint,Pe=t.unstable_now,Fe=t.unstable_getCurrentPriorityLevel,Ie=t.unstable_ImmediatePriority,Le=t.unstable_UserBlockingPriority,Re=t.unstable_NormalPriority,ze=t.unstable_LowPriority,Be=t.unstable_IdlePriority,Ve=t.log,He=t.unstable_setDisableYieldValue,Ue=null,We=null;function Ge(e){if(typeof Ve==`function`&&He(e),We&&typeof We.setStrictMode==`function`)try{We.setStrictMode(Ue,e)}catch{}}var Ke=Math.clz32?Math.clz32:Ye,qe=Math.log,Je=Math.LN2;function Ye(e){return e>>>=0,e===0?32:31-(qe(e)/Je|0)|0}var Xe=256,Ze=262144,Qe=4194304;function $e(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function et(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=$e(n))):i=$e(o):i=$e(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=$e(n))):i=$e(o)):i=$e(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function tt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function nt(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function rt(){var e=Qe;return Qe<<=1,!(Qe&62914560)&&(Qe=4194304),e}function it(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function at(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ot(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Ke(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&st(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function st(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Ke(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function ct(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ke(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function lt(e,t){var n=t&-t;return n=n&42?1:ut(n),(n&(e.suspendedLanes|t))===0?n:0}function ut(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function dt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function ft(){var e=O.p;return e===0?(e=window.event,e===void 0?32:mp(e.type)):e}function pt(e,t){var n=O.p;try{return O.p=e,t()}finally{O.p=n}}var mt=Math.random().toString(36).slice(2),ht=`__reactFiber$`+mt,gt=`__reactProps$`+mt,_t=`__reactContainer$`+mt,vt=`__reactEvents$`+mt,yt=`__reactListeners$`+mt,bt=`__reactHandles$`+mt,xt=`__reactResources$`+mt,St=`__reactMarker$`+mt;function Ct(e){delete e[ht],d
|
|||
|
|
`).replace(Ad,``)}function Md(e,t){return t=jd(t),jd(e)===t}function $(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||en(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&en(e,``+r);break;case`className`:Rt(e,`class`,r);break;case`tabIndex`:Rt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Rt(e,n,r);break;case`style`:rn(e,r,o);break;case`data`:if(t!==`object`){Rt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=cn(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}else typeof o==`function`&&(n===`formAction`?(t!==`input`&&$(e,t,`name`,a.name,a,null),$(e,t,`formEncType`,a.formEncType,a,null),$(e,t,`formMethod`,a.formMethod,a,null),$(e,t,`formTarget`,a.formTarget,a,null)):($(e,t,`encType`,a.encType,a,null),$(e,t,`method`,a.method,a,null),$(e,t,`target`,a.target,a,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=cn(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=ln);break;case`onScroll`:r!=null&&Q(`scroll`,e);break;case`onScrollEnd`:r!=null&&Q(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=cn(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Q(`beforetoggle`,e),Q(`toggle`,e),Lt(e,`popover`,r);break;case`xlinkActuate`:zt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:zt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:zt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:zt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:zt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:zt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:zt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break
|
|||
|
|
|
|||
|
|
Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let u=ot(),d;if(t){let e=typeof t==`string`?ae(t):t;T(c===`/`||e.pathname?.startsWith(c),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${e.pathname}" was given in the \`location\` prop.`),d=e}else d=u;let f=d.pathname||`/`,p=f;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);p=`/`+f.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let m=ce(e,{pathname:p});E(l||m!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),E(m==null||m[m.length-1].route.element!==void 0||m[m.length-1].route.Component!==void 0||m[m.length-1].route.lazy!==void 0,`Matched leaf route at location "${d.pathname}${d.search}${d.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let h=bt(m&&m.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:Me([c,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:Me([c,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&h?S.createElement(Xe.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,unstable_mask:void 0,...d},navigationType:`POP`}},h):h}function mt(){let e=kt(),t=Le(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=S.createElement(S.Fragment,null,S.createElement(`p`,null,`💿 Hey developer 👋`),S.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,S.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,S.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),S.createElement(S.Fragment,null,S.createElement(`h2`,null,`Unexpected Application Error!`),S.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?S.createElement(`pre`,{style:i},n):null,o)}var ht=S.createElement(mt,null),gt=class extends S.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=rt(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:S.createElement(Ze.Provider,{value:this.props.routeContext},S.createElement(Qe.Provider,{value:e,children:this.props.component}));return this.context?S.createElement(vt,{error:e},t):t}};gt.contextType=Ge;var _t=new WeakMap;function vt({children:e,error:t}){let{basename:n}=S.useContext(Ye);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=nt(t.digest);if(e){let r=_t.get(t);if(r)throw r;let i=Be(e.location,n);if(ze&&!_t.get(t))if(i.isExternal||e.reloadDocument)window.location.href=i.absoluteURL||i.to;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:e.replace}));throw _t.set(t,n),n}return S.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${i.absoluteURL||i.to}`})}}return e}function yt(
|
|||
|
|
${{sm:`w-16 h-16 text-3xl`,md:`w-24 h-24 text-5xl`,lg:`w-32 h-32 text-6xl`}[t]}
|
|||
|
|
rounded-full bg-gradient-to-br from-brand-400 via-brand-500 to-brand-700
|
|||
|
|
flex items-center justify-center
|
|||
|
|
animate-breathing
|
|||
|
|
shadow-glow
|
|||
|
|
`,children:(0,A.jsx)(`span`,{className:`drop-shadow-lg`,children:`🤖`})}),(0,A.jsx)(`div`,{className:`
|
|||
|
|
absolute inset-0 rounded-full
|
|||
|
|
bg-brand-400/20
|
|||
|
|
animate-ping-slow
|
|||
|
|
`})]}),n&&(0,A.jsx)(`span`,{className:`text-brand-600 font-semibold text-lg`,children:e})]})}var wr=`你好!我是你的AI创作伙伴。
|
|||
|
|
无论你是作者、编辑还是运营,
|
|||
|
|
我都能陪你一起工作。`;function Tr(e,t=60){let[n,r]=(0,S.useState)(``),[i,a]=(0,S.useState)(!1);return(0,S.useEffect)(()=>{r(``),a(!1);let n=0,i=setInterval(()=>{n++,r(e.slice(0,n)),n>=e.length&&(clearInterval(i),a(!0))},t);return()=>clearInterval(i)},[e,t]),{displayed:n,done:i}}var Er=[{icon:_r,title:`AI码字`,sub:`AI陪你写`,desc:`不代替你写`,color:`from-brand-400 to-brand-600`},{icon:dr,title:`透明追踪`,sub:`全程留痕`,desc:`创意归你`,color:`from-emerald-400 to-emerald-600`},{icon:fr,title:`跨平台`,sub:`自由合作`,desc:`信誉说话`,color:`from-amber-400 to-amber-600`}];function Dr(){let e=lt(),{displayed:t,done:n}=Tr(wr,50),r=t=>{e(`/register?role=${t}`)};return(0,A.jsxs)(`div`,{className:`min-h-screen pt-16`,children:[(0,A.jsxs)(`section`,{className:`relative px-4 py-16 sm:py-24 flex flex-col items-center text-center overflow-hidden`,children:[(0,A.jsx)(`div`,{className:`absolute inset-0 bg-gradient-to-b from-brand-50/60 via-white to-white -z-10`}),(0,A.jsx)(Cr,{name:`AI创作伙伴`,size:`lg`}),(0,A.jsx)(`div`,{className:`mt-8 mb-10 min-h-[5rem]`,children:(0,A.jsxs)(`p`,{className:`text-lg sm:text-xl text-ink-700 leading-relaxed whitespace-pre-line`,children:[`"`,t,!n&&(0,A.jsx)(`span`,{className:`animate-pulse`,children:`|`}),`"`]})}),(0,A.jsx)(`div`,{className:`flex flex-col sm:flex-row gap-3`,children:[{key:`author`,label:`我是作者`,emoji:`🖊️`},{key:`editor`,label:`我是编辑`,emoji:`📊`},{key:`operator`,label:`我是运营`,emoji:`🤝`}].map(e=>(0,A.jsxs)(`button`,{onClick:()=>r(e.key),className:`px-8 py-3 bg-white border-2 border-ink-200 hover:border-brand-400 hover:shadow-soft rounded-2xl text-ink-700 hover:text-brand-600 transition-all duration-200 font-medium`,children:[(0,A.jsx)(`span`,{className:`mr-2`,children:e.emoji}),e.label]},e.key))})]}),(0,A.jsx)(`section`,{className:`px-4 py-16 bg-white`,children:(0,A.jsxs)(`div`,{className:`max-w-4xl mx-auto`,children:[(0,A.jsx)(`h2`,{className:`text-center text-2xl font-bold text-ink-800 mb-10`,children:`✨ 三大核心能力`}),(0,A.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-3 gap-6`,children:Er.map(e=>(0,A.jsxs)(`div`,{className:`flex flex-col items-center text-center p-6 rounded-2xl border border-ink-100 hover:shadow-soft transition-shadow`,children:[(0,A.jsx)(`div`,{className:`w-14 h-14 rounded-xl bg-gradient-to-br ${e.color} flex items-center justify-center text-white mb-4`,children:(0,A.jsx)(e.icon,{size:28})}),(0,A.jsx)(`h3`,{className:`font-bold text-ink-800 text-lg`,children:e.title}),(0,A.jsx)(`p`,{className:`text-sm text-ink-500 mt-1`,children:e.sub}),(0,A.jsx)(`p`,{className:`text-xs text-ink-400 mt-0.5`,children:e.desc})]},e.title))})]})}),(0,A.jsx)(`section`,{className:`px-4 py-12 bg-ink-50`,children:(0,A.jsxs)(`div`,{className:`max-w-4xl mx-auto text-center`,children:[(0,A.jsx)(`h2`,{className:`text-lg font-semibold text-ink-600 mb-6`,children:`📈 平台数据`}),(0,A.jsx)(`div`,{className:`flex flex-col sm:flex-row justify-center gap-8 sm:gap-16`,children:[{label:`注册作者`,value:`--`},{label:`今日新作`,value:`--`},{label:`AI使用透明度`,value:`100%`}].map(e=>(0,A.jsxs)(`div`,{className:`flex flex-col items-center`,children:[(0,A.jsx)(`span`,{className:`text-3xl font-bold text-brand-600`,children:e.value}),(0,A.jsx)(`span`,{className:`text-sm text-ink-500 mt-1`,children:e.label})]},e.label))})]})}),(0,A.jsx)(`footer`,{className:`px-4 py-8 text-center text-sm text-ink-400 border-t border-ink-100`,children:`© 2026 光湖纪元 · 国作登字-2026-A-00037559`})]})}var Or=`/api/writing`;async function kr(e,t={}){let n=localStorage.getItem(`writing_token`),r={"Content-Type":`application/json`,...t.headers||{}};n&&(r.Authorization=`Bearer ${n}`);let i=await fetch(`${Or}${e}`,{...t,headers:r}),a=await i.json();if(!i.ok)throw Error(a.message||`请求失败`);return a}var Ar={sendCode:e=>kr(`/auth/send-code`,{method:`POST`,body:JSON.stringify({phone:e})}),register:e=>kr(`/auth/register`,{method:`POST`,body:JSON.stringify(e)}),login:(e,t)=>kr(`/auth/login`,{method:`POST`,body:JSON
|
|||
|
|
flex-1 flex flex-col items-center gap-1.5 px-4 py-4 rounded-2xl border-2 transition-all duration-200
|
|||
|
|
${e===i.key?`border-brand-500 bg-brand-50 shadow-glow`:`border-ink-200 bg-white hover:border-brand-300 hover:shadow-soft`}
|
|||
|
|
`,children:[(0,A.jsx)(`span`,{className:`text-2xl`,children:i.emoji}),(0,A.jsx)(`span`,{className:`font-semibold text-ink-800`,children:i.label}),(0,A.jsx)(`span`,{className:`text-xs text-ink-500`,children:i.desc}),(e===i.key||n===i.key)&&(0,A.jsxs)(`span`,{className:`text-xs text-brand-600 mt-1`,children:[`AI伙伴:`,i.companion]})]},i.key))})}function Fr(){let e=lt(),[t]=In(),{setAuth:n}=er(),[r,i]=(0,S.useState)(t.get(`role`)||`author`),[a,o]=(0,S.useState)(``),[s,c]=(0,S.useState)(``),[l,u]=(0,S.useState)(``),[d,f]=(0,S.useState)(``),[p,m]=(0,S.useState)(0),[h,g]=(0,S.useState)(!1),[_,v]=(0,S.useState)(``),[y,b]=(0,S.useState)(!1);return(0,A.jsx)(`div`,{className:`min-h-screen pt-16 flex items-center justify-center px-4 py-8`,children:(0,A.jsxs)(`div`,{className:`w-full max-w-lg`,children:[(0,A.jsxs)(`div`,{className:`text-center mb-8`,children:[(0,A.jsx)(`span`,{className:`text-4xl`,children:`🌟`}),(0,A.jsx)(`h1`,{className:`text-2xl font-bold text-ink-800 mt-3`,children:`加入光湖码字`}),(0,A.jsx)(`p`,{className:`text-ink-500 text-sm mt-1`,children:`选择你的角色,开始AI创作之旅`})]}),(0,A.jsx)(`div`,{className:`bg-white rounded-2xl shadow-soft p-8 border border-ink-100`,children:(0,A.jsxs)(`form`,{onSubmit:async t=>{if(t.preventDefault(),!a||!s||!l){v(`请填写所有必填字段`);return}if((r===`editor`||r===`operator`)&&!d){v(`编辑和运营角色需要填写真实姓名`);return}v(``),b(!0);try{let t=await Ar.register({phone:a,code:s,nickname:l,realName:d,role:r});n(t.token,t.user),e(`/dashboard`)}catch(e){v(e.message||`注册失败`)}finally{b(!1)}},className:`space-y-6`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`label`,{className:`block text-sm text-ink-600 mb-3 text-center`,children:`选择角色`}),(0,A.jsx)(Pr,{value:r,onChange:i})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`label`,{className:`block text-sm text-ink-600 mb-1`,children:`手机号 *`}),(0,A.jsx)(`input`,{type:`tel`,value:a,onChange:e=>o(e.target.value),placeholder:`请输入手机号`,maxLength:11,className:`w-full px-4 py-2.5 rounded-xl border border-ink-200 focus:border-brand-400 focus:ring-2 focus:ring-brand-100 outline-none transition-all text-ink-800`})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`label`,{className:`block text-sm text-ink-600 mb-1`,children:`验证码 *`}),(0,A.jsxs)(`div`,{className:`flex gap-2`,children:[(0,A.jsx)(`input`,{type:`text`,value:s,onChange:e=>c(e.target.value),placeholder:`6位验证码`,maxLength:6,className:`flex-1 px-4 py-2.5 rounded-xl border border-ink-200 focus:border-brand-400 focus:ring-2 focus:ring-brand-100 outline-none transition-all text-ink-800`}),(0,A.jsx)(`button`,{type:`button`,onClick:async()=>{if(!/^1\d{10}$/.test(a)){v(`请输入正确的手机号`);return}v(``);try{await Ar.sendCode(a),g(!0),m(60);let e=setInterval(()=>{m(t=>t<=1?(clearInterval(e),0):t-1)},1e3)}catch(e){v(e.message||`验证码发送失败`)}},disabled:p>0,className:`px-4 py-2.5 text-sm bg-brand-50 text-brand-600 hover:bg-brand-100 disabled:opacity-50 disabled:cursor-not-allowed rounded-xl transition-colors whitespace-nowrap`,children:p>0?`${p}s`:h?`重发`:`获取验证码`})]})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`label`,{className:`block text-sm text-ink-600 mb-1`,children:`笔名/昵称 *`}),(0,A.jsx)(`input`,{type:`text`,value:l,onChange:e=>u(e.target.value),placeholder:`输入你的笔名`,maxLength:20,className:`w-full px-4 py-2.5 rounded-xl border border-ink-200 focus:border-brand-400 focus:ring-2 focus:ring-brand-100 outline-none transition-all text-ink-800`})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsxs)(`label`,{className:`block text-sm text-ink-600 mb-1`,children:[`真实姓名 `,r===`author`?`(选填)`:`*`]}),(0,A.jsx)(`input`,{type:`text`,value:d,onChange:e=>f(e.target.value),placeholder:`输入真实姓名`,maxLength:20,className:`w-full px-4 py-2.5 rounded-xl border border-ink-200 focus:border-brand-400 focus:ring-2 focus:ring-brand-100 outline-none transition-all text-ink-800`})]}),_&&(0,A.jsx)(`p`,{className:`text-sm text-red-500 text-center`,children:_}),(0,A.jsx
|
|||
|
|
${i?`bg-brand-100 text-brand-700`:`bg-gradient-to-br from-brand-400 to-brand-600 text-white`}
|
|||
|
|
`,children:i?r.charAt(0):`🤖`}),(0,A.jsxs)(`div`,{className:`max-w-[75%] px-4 py-3 rounded-2xl text-sm leading-relaxed whitespace-pre-wrap
|
|||
|
|
${i?`bg-brand-600 text-white rounded-tr-md`:`bg-ink-50 text-ink-800 rounded-tl-md`}
|
|||
|
|
`,children:[!i&&(0,A.jsx)(`span`,{className:`text-xs text-brand-500 font-medium block mb-1`,children:n}),t]})]})}function wa(){let e=lt(),{user:t,token:n,isAuthenticated:r,logout:i}=er(),{messages:a,sendMessage:o,connected:s}=Sa(n),[c,l]=(0,S.useState)(``),u=(0,S.useRef)(null);(0,S.useEffect)(()=>{r||e(`/login`)},[r,e]),(0,S.useEffect)(()=>{u.current?.scrollIntoView({behavior:`smooth`})},[a]);let d=e=>{e.preventDefault(),c.trim()&&(o(c.trim()),l(``))},f=()=>{i(),e(`/`)};if(!t)return null;let p=t.aiCompanion?.name||`AI伙伴`,m=t.role===`author`?`作者`:t.role===`editor`?`编辑`:`运营`;return(0,A.jsxs)(`div`,{className:`min-h-screen pt-16 flex flex-col bg-ink-50`,children:[(0,A.jsx)(`header`,{className:`fixed top-0 left-0 right-0 z-50 bg-white/90 backdrop-blur-md border-b border-ink-100`,children:(0,A.jsxs)(`div`,{className:`max-w-4xl mx-auto px-4 h-16 flex items-center justify-between`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2 text-lg font-bold text-brand-700`,children:[(0,A.jsx)(`span`,{className:`text-2xl`,children:`🌟`}),(0,A.jsx)(`span`,{children:`光湖码字`})]}),(0,A.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,A.jsxs)(`span`,{className:`text-sm text-ink-600`,children:[t.nickname,`(`,m,`)`]}),(0,A.jsx)(`button`,{onClick:()=>{},className:`p-2 text-ink-400 hover:text-ink-600 transition-colors`,title:`设置`,children:(0,A.jsx)(yr,{size:18})}),(0,A.jsx)(`button`,{onClick:f,className:`p-2 text-ink-400 hover:text-red-500 transition-colors`,title:`退出`,children:(0,A.jsx)(pr,{size:18})})]})]})}),(0,A.jsxs)(`main`,{className:`flex-1 flex flex-col max-w-4xl w-full mx-auto px-4 pb-4`,children:[(0,A.jsxs)(`div`,{className:`flex flex-col items-center py-6`,children:[(0,A.jsx)(Cr,{name:p,size:`md`}),s?(0,A.jsx)(`span`,{className:`text-xs text-emerald-500 mt-2`,children:`● 已连接`}):(0,A.jsx)(`span`,{className:`text-xs text-ink-400 mt-2`,children:`○ 连接中...`})]}),(0,A.jsxs)(`div`,{className:`flex-1 overflow-y-auto space-y-4 mb-4 min-h-[300px]`,children:[a.map((e,n)=>(0,A.jsx)(Ca,{role:e.role,content:e.content,companionName:p,userNickname:t.nickname},n)),(0,A.jsx)(`div`,{ref:u})]}),(0,A.jsxs)(`form`,{onSubmit:d,className:`flex gap-2 bg-white rounded-2xl border border-ink-200 p-2 shadow-soft`,children:[(0,A.jsx)(`input`,{type:`text`,value:c,onChange:e=>l(e.target.value),placeholder:`和${p}说点什么...`,className:`flex-1 px-4 py-2.5 outline-none text-ink-800 text-sm bg-transparent`}),(0,A.jsx)(`button`,{type:`submit`,disabled:!c.trim()||!s,className:`px-4 py-2.5 bg-brand-600 text-white hover:bg-brand-700 disabled:opacity-50 disabled:cursor-not-allowed rounded-xl transition-colors`,children:(0,A.jsx)(vr,{size:18})})]}),(0,A.jsx)(`div`,{className:`mt-4 flex flex-wrap gap-2 justify-center`,children:[{icon:gr,label:`开始写作`},{icon:dr,label:`查看数据`},{icon:mr,label:`看定制书需求`},{icon:hr,label:`讨论区`}].map(e=>(0,A.jsxs)(`button`,{className:`flex items-center gap-1.5 px-4 py-2 text-sm text-ink-600 bg-white border border-ink-200 hover:border-brand-300 hover:text-brand-600 rounded-full transition-all`,children:[(0,A.jsx)(e.icon,{size:14}),e.label]},e.label))})]})]})}function Ta(){return(0,A.jsx)(A.Fragment,{children:(0,A.jsxs)(It,{children:[(0,A.jsx)(Pt,{path:`/dashboard`,element:(0,A.jsx)(wa,{})}),(0,A.jsx)(Pt,{path:`*`,element:(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(Sr,{}),(0,A.jsxs)(It,{children:[(0,A.jsx)(Pt,{path:`/`,element:(0,A.jsx)(Dr,{})}),(0,A.jsx)(Pt,{path:`/login`,element:(0,A.jsx)(Mr,{})}),(0,A.jsx)(Pt,{path:`/register`,element:(0,A.jsx)(Fr,{})})]})]})})]})})}(0,qn.createRoot)(document.getElementById(`root`)).render((0,A.jsx)(S.StrictMode,{children:(0,A.jsx)(Tn,{children:(0,A.jsx)(Ta,{})})}));
|