@yuku123/z-task-frontend-component 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/z-task-frontend-component.es.js +3442 -0
- package/dist/z-task-frontend-component.umd.js +51 -0
- package/package.json +5 -5
- package/src/api.js +38 -0
- package/src/components/ProjectList.jsx +291 -0
- package/src/components/TaskApp.jsx +20 -0
- package/src/components/TaskList.jsx +161 -0
- package/src/index.d.ts +7 -0
- package/src/index.js +10 -1
- package/src/services/api.js +76 -0
- package/src/utils/request.js +5 -0
- package/dist/z-task-component.es.js +0 -28951
- package/dist/z-task-component.umd.js +0 -347
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
(function(q,D){typeof exports=="object"&&typeof module<"u"?D(exports,require("react"),require("antd"),require("@ant-design/icons"),require("react-router-dom"),require("@ant-design/pro-components")):typeof define=="function"&&define.amd?define(["exports","react","antd","@ant-design/icons","react-router-dom","@ant-design/pro-components"],D):(q=typeof globalThis<"u"?globalThis:q||self,D(q.z_component={},q.React,q.antd,q.icons,q.ReactRouterDOM))})(this,(function(q,D,u,U,de){"use strict";var De={exports:{}},Te={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var ht;function dr(){if(ht)return Te;ht=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(n,s,o){var i=null;if(o!==void 0&&(i=""+o),s.key!==void 0&&(i=""+s.key),"key"in s){o={};for(var c in s)c!=="key"&&(o[c]=s[c])}else o=s;return s=o.ref,{$$typeof:e,type:n,key:i,ref:s!==void 0?s:null,props:o}}return Te.Fragment=t,Te.jsx=r,Te.jsxs=r,Te}var Oe={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.development.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var mt;function pr(){return mt||(mt=1,process.env.NODE_ENV!=="production"&&(function(){function e(a){if(a==null)return null;if(typeof a=="function")return a.$$typeof===k?null:a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case R:return"Fragment";case b:return"Profiler";case m:return"StrictMode";case v:return"Suspense";case J:return"SuspenseList";case w:return"Activity"}if(typeof a=="object")switch(typeof a.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),a.$$typeof){case A:return"Portal";case N:return a.displayName||"Context";case x:return(a._context.displayName||"Context")+".Consumer";case L:var g=a.render;return a=a.displayName,a||(a=g.displayName||g.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case se:return g=a.displayName||null,g!==null?g:e(a.type)||"Memo";case Y:g=a._payload,a=a._init;try{return e(a(g))}catch{}}return null}function t(a){return""+a}function r(a){try{t(a);var g=!1}catch{g=!0}if(g){g=console;var O=g.error,j=typeof Symbol=="function"&&Symbol.toStringTag&&a[Symbol.toStringTag]||a.constructor.name||"Object";return O.call(g,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",j),t(a)}}function n(a){if(a===R)return"<>";if(typeof a=="object"&&a!==null&&a.$$typeof===Y)return"<...>";try{var g=e(a);return g?"<"+g+">":"<...>"}catch{return"<...>"}}function s(){var a=M.A;return a===null?null:a.getOwner()}function o(){return Error("react-stack-top-frame")}function i(a){if(ce.call(a,"key")){var g=Object.getOwnPropertyDescriptor(a,"key").get;if(g&&g.isReactWarning)return!1}return a.key!==void 0}function c(a,g){function O(){te||(te=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",g))}O.isReactWarning=!0,Object.defineProperty(a,"key",{get:O,configurable:!0})}function f(){var a=e(this.type);return oe[a]||(oe[a]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),a=this.props.ref,a!==void 0?a:null}function d(a,g,O,j,re,I){var _=O.ref;return a={$$typeof:C,type:a,key:g,props:O,_owner:j},(_!==void 0?_:null)!==null?Object.defineProperty(a,"ref",{enumerable:!1,get:f}):Object.defineProperty(a,"ref",{enumerable:!1,value:null}),a._store={},Object.defineProperty(a._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(a,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(a,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:re}),Object.defineProperty(a,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:I}),Object.freeze&&(Object.freeze(a.props),Object.freeze(a)),a}function h(a,g,O,j,re,I){var _=g.children;if(_!==void 0)if(j)if(W(_)){for(j=0;j<_.length;j++)y(_[j]);Object.freeze&&Object.freeze(_)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else y(_);if(ce.call(g,"key")){_=e(a);var B=Object.keys(g).filter(function(Ie){return Ie!=="key"});j=0<B.length?"{key: someKey, "+B.join(": ..., ")+": ...}":"{key: someKey}",K[_+j]||(B=0<B.length?"{"+B.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
18
|
+
let props = %s;
|
|
19
|
+
<%s {...props} />
|
|
20
|
+
React keys must be passed directly to JSX without using spread:
|
|
21
|
+
let props = %s;
|
|
22
|
+
<%s key={someKey} {...props} />`,j,_,B,_),K[_+j]=!0)}if(_=null,O!==void 0&&(r(O),_=""+O),i(g)&&(r(g.key),_=""+g.key),"key"in g){O={};for(var ne in g)ne!=="key"&&(O[ne]=g[ne])}else O=g;return _&&c(O,typeof a=="function"?a.displayName||a.name||"Unknown":a),d(a,_,O,s(),re,I)}function y(a){T(a)?a._store&&(a._store.validated=1):typeof a=="object"&&a!==null&&a.$$typeof===Y&&(a._payload.status==="fulfilled"?T(a._payload.value)&&a._payload.value._store&&(a._payload.value._store.validated=1):a._store&&(a._store.validated=1))}function T(a){return typeof a=="object"&&a!==null&&a.$$typeof===C}var S=D,C=Symbol.for("react.transitional.element"),A=Symbol.for("react.portal"),R=Symbol.for("react.fragment"),m=Symbol.for("react.strict_mode"),b=Symbol.for("react.profiler"),x=Symbol.for("react.consumer"),N=Symbol.for("react.context"),L=Symbol.for("react.forward_ref"),v=Symbol.for("react.suspense"),J=Symbol.for("react.suspense_list"),se=Symbol.for("react.memo"),Y=Symbol.for("react.lazy"),w=Symbol.for("react.activity"),k=Symbol.for("react.client.reference"),M=S.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ce=Object.prototype.hasOwnProperty,W=Array.isArray,Z=console.createTask?console.createTask:function(){return null};S={react_stack_bottom_frame:function(a){return a()}};var te,oe={},be=S.react_stack_bottom_frame.bind(S,o)(),ue=Z(n(o)),K={};Oe.Fragment=R,Oe.jsx=function(a,g,O){var j=1e4>M.recentlyCreatedOwnerStacks++;return h(a,g,O,!1,j?Error("react-stack-top-frame"):be,j?Z(n(a)):ue)},Oe.jsxs=function(a,g,O){var j=1e4>M.recentlyCreatedOwnerStacks++;return h(a,g,O,!0,j?Error("react-stack-top-frame"):be,j?Z(n(a)):ue)}})()),Oe}var yt;function hr(){return yt||(yt=1,process.env.NODE_ENV==="production"?De.exports=dr():De.exports=pr()),De.exports}var p=hr();const mr={high:{color:"red",text:"高"},medium:{color:"orange",text:"中"},low:{color:"green",text:"低"}},yr={pending:{color:"default",text:"待处理"},in_progress:{color:"blue",text:"进行中"},completed:{color:"green",text:"已完成"}};function br({task:e,onEdit:t,onComplete:r}){const n=mr[e.priority]||{color:"default",text:e.priority},s=yr[e.status]||{color:"default",text:e.status};return p.jsx(u.Card,{size:"small",title:e.title,extra:p.jsxs(u.Space,{children:[e.status!=="completed"&&p.jsx(u.Button,{size:"small",icon:p.jsx(U.CheckCircleOutlined,{}),onClick:()=>r==null?void 0:r(e),children:"完成"}),p.jsx(u.Button,{size:"small",icon:p.jsx(U.EditOutlined,{}),onClick:()=>t==null?void 0:t(e),children:"编辑"})]}),children:p.jsxs(u.Space,{direction:"vertical",style:{width:"100%"},children:[p.jsxs("div",{children:["项目:",e.projectName]}),p.jsxs(u.Space,{children:[p.jsx(u.Tag,{color:n.color,children:n.text}),p.jsx(u.Tag,{color:s.color,children:s.text})]}),e.dueDate&&p.jsxs("div",{children:["截止:",e.dueDate]})]})})}const gr={high:"red",medium:"orange",low:"green"},wr={pending:"default",in_progress:"blue",completed:"green"};function xr({dataSource:e,loading:t,onEdit:r,onDelete:n,onComplete:s}){const o=[{title:"任务名称",dataIndex:"title",key:"title"},{title:"项目",dataIndex:"projectName",key:"projectName"},{title:"优先级",dataIndex:"priority",key:"priority",render:i=>p.jsx(u.Tag,{color:gr[i],children:i==="high"?"高":i==="medium"?"中":"低"})},{title:"状态",dataIndex:"status",key:"status",render:i=>{const c={pending:"待处理",in_progress:"进行中",completed:"已完成"};return p.jsx(u.Tag,{color:wr[i],children:c[i]||i})}},{title:"截止日期",dataIndex:"dueDate",key:"dueDate"},{title:"操作",key:"action",render:(i,c)=>p.jsxs(u.Space,{children:[c.status!=="completed"&&p.jsx(u.Button,{size:"small",icon:p.jsx(U.CheckCircleOutlined,{}),onClick:()=>s==null?void 0:s(c),children:"完成"}),p.jsx(u.Button,{size:"small",icon:p.jsx(U.EditOutlined,{}),onClick:()=>r==null?void 0:r(c),children:"编辑"}),p.jsx(u.Button,{size:"small",danger:!0,icon:p.jsx(U.DeleteOutlined,{}),onClick:()=>n==null?void 0:n(c),children:"删除"})]})}];return p.jsx(u.Table,{columns:o,dataSource:e,loading:t,rowKey:"id",pagination:{pageSize:10}})}function Er({value:e,onChange:t,projects:r=[]}){return p.jsx(u.Select,{value:e,onChange:t,placeholder:"请选择项目",style:{width:200},allowClear:!0,children:r.map(n=>p.jsx(u.Select.Option,{value:n.id,children:n.name},n.id))})}function bt(e,t){return function(){return e.apply(t,arguments)}}const{toString:Rr}=Object.prototype,{getPrototypeOf:we}=Object,{iterator:_e,toStringTag:gt}=Symbol,Fe=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),je=(e,t)=>{let r=e;const n=[];for(;r!=null&&r!==Object.prototype;){if(n.indexOf(r)!==-1)return!1;if(n.push(r),Fe(r,t))return!0;r=we(r)}return!1},Sr=(e,t)=>e!=null&&je(e,t)?e[t]:void 0,We=(e=>t=>{const r=Rr.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),ee=e=>(e=e.toLowerCase(),t=>We(t)===e),Le=e=>t=>typeof t===e,{isArray:pe}=Array,xe=Le("undefined");function Ee(e){return e!==null&&!xe(e)&&e.constructor!==null&&!xe(e.constructor)&&V(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const wt=ee("ArrayBuffer");function Tr(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&wt(e.buffer),t}const Or=Le("string"),V=Le("function"),xt=Le("number"),Re=e=>e!==null&&typeof e=="object",_r=e=>e===!0||e===!1,Ue=e=>{if(!Re(e))return!1;const t=we(e);return(t===null||t===Object.prototype||we(t)===null)&&!je(e,gt)&&!je(e,_e)},jr=e=>{if(!Re(e)||Ee(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Ar=ee("Date"),Pr=ee("File"),Cr=e=>!!(e&&typeof e.uri<"u"),kr=e=>e&&typeof e.getParts<"u",Nr=ee("Blob"),Ir=ee("FileList"),vr=e=>Re(e)&&V(e.pipe);function Dr(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const Et=Dr(),Rt=typeof Et.FormData<"u"?Et.FormData:void 0,Fr=e=>{if(!e)return!1;if(Rt&&e instanceof Rt)return!0;const t=we(e);if(!t||t===Object.prototype||!V(e.append))return!1;const r=We(e);return r==="formdata"||r==="object"&&V(e.toString)&&e.toString()==="[object FormData]"},Lr=ee("URLSearchParams"),[Ur,Br,qr,zr]=["ReadableStream","Request","Response","Headers"].map(ee),$r=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Ae(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,s;if(typeof e!="object"&&(e=[e]),pe(e))for(n=0,s=e.length;n<s;n++)t.call(null,e[n],n,e);else{if(Ee(e))return;const o=r?Object.getOwnPropertyNames(e):Object.keys(e),i=o.length;let c;for(n=0;n<i;n++)c=o[n],t.call(null,e[c],c,e)}}function St(e,t){if(Ee(e))return null;t=t.toLowerCase();const r=Object.keys(e);let n=r.length,s;for(;n-- >0;)if(s=r[n],t===s.toLowerCase())return s;return null}const he=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Tt=e=>!xe(e)&&e!==he;function Ke(...e){const{caseless:t,skipUndefined:r}=Tt(this)&&this||{},n={},s=(o,i)=>{if(i==="__proto__"||i==="constructor"||i==="prototype")return;const c=t&&typeof i=="string"&&St(n,i)||i,f=Fe(n,c)?n[c]:void 0;Ue(f)&&Ue(o)?n[c]=Ke(f,o):Ue(o)?n[c]=Ke({},o):pe(o)?n[c]=o.slice():(!r||!xe(o))&&(n[c]=o)};for(let o=0,i=e.length;o<i;o++){const c=e[o];if(!c||Ee(c)||(Ae(c,s),typeof c!="object"||pe(c)))continue;const f=Object.getOwnPropertySymbols(c);for(let d=0;d<f.length;d++){const h=f[d];en.call(c,h)&&s(c[h],h)}}return n}const Hr=(e,t,r,{allOwnKeys:n}={})=>(Ae(t,(s,o)=>{r&&V(s)?Object.defineProperty(e,o,{__proto__:null,value:bt(s,r),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,o,{__proto__:null,value:s,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:n}),e),Mr=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Vr=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),r&&Object.assign(e.prototype,r)},Jr=(e,t,r,n)=>{let s,o,i;const c={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),o=s.length;o-- >0;)i=s[o],(!n||n(i,e,t))&&!c[i]&&(t[i]=e[i],c[i]=!0);e=r!==!1&&we(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},Wr=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return n!==-1&&n===r},Kr=e=>{if(!e)return null;if(pe(e))return e;let t=e.length;if(!xt(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},Xr=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&we(Uint8Array)),Yr=(e,t)=>{const n=(e&&e[_e]).call(e);let s;for(;(s=n.next())&&!s.done;){const o=s.value;t.call(e,o[0],o[1])}},Gr=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},Qr=ee("HTMLFormElement"),Zr=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,s){return n.toUpperCase()+s}),{propertyIsEnumerable:en}=Object.prototype,tn=ee("RegExp"),Ot=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};Ae(r,(s,o)=>{let i;(i=t(s,o,e))!==!1&&(n[o]=i||s)}),Object.defineProperties(e,n)},rn=e=>{Ot(e,(t,r)=>{if(V(e)&&["arguments","caller","callee"].includes(r))return!1;const n=e[r];if(V(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},nn=(e,t)=>{const r={},n=s=>{s.forEach(o=>{r[o]=!0})};return pe(e)?n(e):n(String(e).split(t)),r},sn=()=>{},on=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function an(e){return!!(e&&V(e.append)&&e[gt]==="FormData"&&e[_e])}const ln=e=>{const t=new WeakSet,r=n=>{if(Re(n)){if(t.has(n))return;if(Ee(n))return n;if(!("toJSON"in n)){t.add(n);const s=pe(n)?[]:{};return Ae(n,(o,i)=>{const c=r(o);!xe(c)&&(s[i]=c)}),t.delete(n),s}}return n};return r(e)},cn=ee("AsyncFunction"),un=e=>e&&(Re(e)||V(e))&&V(e.then)&&V(e.catch),_t=((e,t)=>e?setImmediate:t?((r,n)=>(he.addEventListener("message",({source:s,data:o})=>{s===he&&o===r&&n.length&&n.shift()()},!1),s=>{n.push(s),he.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",V(he.postMessage)),fn=typeof queueMicrotask<"u"?queueMicrotask.bind(he):typeof process<"u"&&process.nextTick||_t,jt=e=>e!=null&&V(e[_e]),l={isArray:pe,isArrayBuffer:wt,isBuffer:Ee,isFormData:Fr,isArrayBufferView:Tr,isString:Or,isNumber:xt,isBoolean:_r,isObject:Re,isPlainObject:Ue,isEmptyObject:jr,isReadableStream:Ur,isRequest:Br,isResponse:qr,isHeaders:zr,isUndefined:xe,isDate:Ar,isFile:Pr,isReactNativeBlob:Cr,isReactNative:kr,isBlob:Nr,isRegExp:tn,isFunction:V,isStream:vr,isURLSearchParams:Lr,isTypedArray:Xr,isFileList:Ir,forEach:Ae,merge:Ke,extend:Hr,trim:$r,stripBOM:Mr,inherits:Vr,toFlatObject:Jr,kindOf:We,kindOfTest:ee,endsWith:Wr,toArray:Kr,forEachEntry:Yr,matchAll:Gr,isHTMLForm:Qr,hasOwnProperty:Fe,hasOwnProp:Fe,hasOwnInPrototypeChain:je,getSafeProp:Sr,reduceDescriptors:Ot,freezeMethods:rn,toObjectSet:nn,toCamelCase:Zr,noop:sn,toFiniteNumber:on,findKey:St,global:he,isContextDefined:Tt,isSpecCompliantForm:an,toJSONObject:ln,isAsyncFn:cn,isThenable:un,setImmediate:_t,asap:fn,isIterable:jt,isSafeIterable:e=>e!=null&&je(e,_e)&&jt(e)},dn=l.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),pn=e=>{const t={};let r,n,s;return e&&e.split(`
|
|
23
|
+
`).forEach(function(i){s=i.indexOf(":"),r=i.substring(0,s).trim().toLowerCase(),n=i.substring(s+1).trim(),!(!r||t[r]&&dn[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t};function hn(e){let t=0,r=e.length;for(;t<r;){const n=e.charCodeAt(t);if(n!==9&&n!==32)break;t+=1}for(;r>t;){const n=e.charCodeAt(r-1);if(n!==9&&n!==32)break;r-=1}return t===0&&r===e.length?e:e.slice(t,r)}const mn=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),yn=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function Xe(e,t){return l.isArray(e)?e.map(r=>Xe(r,t)):hn(String(e).replace(t,""))}const bn=e=>Xe(e,mn),gn=e=>Xe(e,yn);function At(e){const t=Object.create(null);return l.forEach(e.toJSON(),(r,n)=>{t[n]=gn(r)}),t}const Pt=Symbol("internals");function Pe(e){return e&&String(e).trim().toLowerCase()}function Be(e){return e===!1||e==null?e:l.isArray(e)?e.map(Be):bn(String(e))}function wn(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}const xn=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Ye(e,t,r,n,s){if(l.isFunction(n))return n.call(this,t,r);if(s&&(t=r),!!l.isString(t)){if(l.isString(n))return t.indexOf(n)!==-1;if(l.isRegExp(n))return n.test(t)}}function En(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function Rn(e,t){const r=l.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{__proto__:null,value:function(s,o,i){return this[n].call(this,t,s,o,i)},configurable:!0})})}let $=class{constructor(t){t&&this.set(t)}set(t,r,n){const s=this;function o(c,f,d){const h=Pe(f);if(!h)return;const y=l.findKey(s,h);(!y||s[y]===void 0||d===!0||d===void 0&&s[y]!==!1)&&(s[y||f]=Be(c))}const i=(c,f)=>l.forEach(c,(d,h)=>o(d,h,f));if(l.isPlainObject(t)||t instanceof this.constructor)i(t,r);else if(l.isString(t)&&(t=t.trim())&&!xn(t))i(pn(t),r);else if(l.isObject(t)&&l.isSafeIterable(t)){let c=Object.create(null),f,d;for(const h of t){if(!l.isArray(h))throw new TypeError("Object iterator must return a key-value pair");d=h[0],l.hasOwnProp(c,d)?(f=c[d],c[d]=l.isArray(f)?[...f,h[1]]:[f,h[1]]):c[d]=h[1]}i(c,r)}else t!=null&&o(r,t,n);return this}get(t,r){if(t=Pe(t),t){const n=l.findKey(this,t);if(n){const s=this[n];if(!r)return s;if(r===!0)return wn(s);if(l.isFunction(r))return r.call(this,s,n);if(l.isRegExp(r))return r.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=Pe(t),t){const n=l.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||Ye(this,this[n],n,r)))}return!1}delete(t,r){const n=this;let s=!1;function o(i){if(i=Pe(i),i){const c=l.findKey(n,i);c&&(!r||Ye(n,n[c],c,r))&&(delete n[c],s=!0)}}return l.isArray(t)?t.forEach(o):o(t),s}clear(t){const r=Object.keys(this);let n=r.length,s=!1;for(;n--;){const o=r[n];(!t||Ye(this,this[o],o,t,!0))&&(delete this[o],s=!0)}return s}normalize(t){const r=this,n={};return l.forEach(this,(s,o)=>{const i=l.findKey(n,o);if(i){r[i]=Be(s),delete r[o];return}const c=t?En(o):String(o).trim();c!==o&&delete r[o],r[c]=Be(s),n[c]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);return l.forEach(this,(n,s)=>{n!=null&&n!==!1&&(r[s]=t&&l.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(`
|
|
24
|
+
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const n=new this(t);return r.forEach(s=>n.set(s)),n}static accessor(t){const n=(this[Pt]=this[Pt]={accessors:{}}).accessors,s=this.prototype;function o(i){const c=Pe(i);n[c]||(Rn(s,i),n[c]=!0)}return l.isArray(t)?t.forEach(o):o(t),this}};$.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),l.reduceDescriptors($.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}}),l.freezeMethods($);const Sn="[REDACTED ****]";function Tn(e){if(l.hasOwnProp(e,"toJSON"))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(l.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}function On(e,t){const r=new Set(t.map(o=>String(o).toLowerCase())),n=[],s=o=>{if(o===null||typeof o!="object"||l.isBuffer(o))return o;if(n.indexOf(o)!==-1)return;o instanceof $&&(o=o.toJSON()),n.push(o);let i;if(l.isArray(o))i=[],o.forEach((c,f)=>{const d=s(c);l.isUndefined(d)||(i[f]=d)});else{if(!l.isPlainObject(o)&&Tn(o))return n.pop(),o;i=Object.create(null);for(const[c,f]of Object.entries(o)){const d=r.has(c.toLowerCase())?Sn:s(f);l.isUndefined(d)||(i[c]=d)}}return n.pop(),i};return s(e)}let E=class ur extends Error{static from(t,r,n,s,o,i){const c=new ur(t.message,r||t.code,n,s,o);return c.cause=t,c.name=t.name,t.status!=null&&c.status==null&&(c.status=t.status),i&&Object.assign(c,i),c}constructor(t,r,n,s,o){super(t),Object.defineProperty(this,"message",{__proto__:null,value:t,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,r&&(this.code=r),n&&(this.config=n),s&&(this.request=s),o&&(this.response=o,this.status=o.status)}toJSON(){const t=this.config,r=t&&l.hasOwnProp(t,"redact")?t.redact:void 0,n=l.isArray(r)&&r.length>0?On(t,r):l.toJSONObject(t);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:n,code:this.code,status:this.status}}};E.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",E.ERR_BAD_OPTION="ERR_BAD_OPTION",E.ECONNABORTED="ECONNABORTED",E.ETIMEDOUT="ETIMEDOUT",E.ECONNREFUSED="ECONNREFUSED",E.ERR_NETWORK="ERR_NETWORK",E.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",E.ERR_DEPRECATED="ERR_DEPRECATED",E.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",E.ERR_BAD_REQUEST="ERR_BAD_REQUEST",E.ERR_CANCELED="ERR_CANCELED",E.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",E.ERR_INVALID_URL="ERR_INVALID_URL",E.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const _n=null,Ct=100;function Ge(e){return l.isPlainObject(e)||l.isArray(e)}function kt(e){return l.endsWith(e,"[]")?e.slice(0,-2):e}function Qe(e,t,r){return e?e.concat(t).map(function(s,o){return s=kt(s),!r&&o?"["+s+"]":s}).join(r?".":""):t}function jn(e){return l.isArray(e)&&!e.some(Ge)}const An=l.toFlatObject(l,{},null,function(t){return/^is[A-Z]/.test(t)});function qe(e,t,r){if(!l.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=l.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(b,x){return!l.isUndefined(x[b])});const n=r.metaTokens,s=r.visitor||C,o=r.dots,i=r.indexes,c=r.Blob||typeof Blob<"u"&&Blob,f=r.maxDepth===void 0?Ct:r.maxDepth,d=c&&l.isSpecCompliantForm(t),h=[];if(!l.isFunction(s))throw new TypeError("visitor must be a function");function y(m){if(m===null)return"";if(l.isDate(m))return m.toISOString();if(l.isBoolean(m))return m.toString();if(!d&&l.isBlob(m))throw new E("Blob is not supported. Use a Buffer instead.");return l.isArrayBuffer(m)||l.isTypedArray(m)?d&&typeof Blob=="function"?new Blob([m]):Buffer.from(m):m}function T(m){if(m>f)throw new E("Object is too deeply nested ("+m+" levels). Max depth: "+f,E.ERR_FORM_DATA_DEPTH_EXCEEDED)}function S(m,b){if(f===1/0)return JSON.stringify(m);const x=[];return JSON.stringify(m,function(L,v){if(!l.isObject(v))return v;for(;x.length&&x[x.length-1]!==this;)x.pop();return x.push(v),T(b+x.length-1),v})}function C(m,b,x){let N=m;if(l.isReactNative(t)&&l.isReactNativeBlob(m))return t.append(Qe(x,b,o),y(m)),!1;if(m&&!x&&typeof m=="object"){if(l.endsWith(b,"{}"))b=n?b:b.slice(0,-2),m=S(m,1);else if(l.isArray(m)&&jn(m)||(l.isFileList(m)||l.endsWith(b,"[]"))&&(N=l.toArray(m)))return b=kt(b),N.forEach(function(v,J){!(l.isUndefined(v)||v===null)&&t.append(i===!0?Qe([b],J,o):i===null?b:b+"[]",y(v))}),!1}return Ge(m)?!0:(t.append(Qe(x,b,o),y(m)),!1)}const A=Object.assign(An,{defaultVisitor:C,convertValue:y,isVisitable:Ge});function R(m,b,x=0){if(!l.isUndefined(m)){if(T(x),h.indexOf(m)!==-1)throw new Error("Circular reference detected in "+b.join("."));h.push(m),l.forEach(m,function(L,v){(!(l.isUndefined(L)||L===null)&&s.call(t,L,l.isString(v)?v.trim():v,b,A))===!0&&R(L,b?b.concat(v):[v],x+1)}),h.pop()}}if(!l.isObject(e))throw new TypeError("data must be an object");return R(e),t}function Nt(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(n){return t[n]})}function Ze(e,t){this._pairs=[],e&&qe(e,this,t)}const It=Ze.prototype;It.append=function(t,r){this._pairs.push([t,r])},It.toString=function(t){const r=t?function(n){return t.call(this,n,Nt)}:Nt;return this._pairs.map(function(s){return r(s[0])+"="+r(s[1])},"").join("&")};function Pn(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function vt(e,t,r){if(!t)return e;const n=l.isFunction(r)?{serialize:r}:r,s=l.getSafeProp(n,"encode")||Pn,o=l.getSafeProp(n,"serialize");let i;if(o?i=o(t,n):i=l.isURLSearchParams(t)?t.toString():new Ze(t,n).toString(s),i){const c=e.indexOf("#");c!==-1&&(e=e.slice(0,c)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class Dt{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){l.forEach(this.handlers,function(n){n!==null&&t(n)})}}const et={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},Cn={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:Ze,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},tt=typeof window<"u"&&typeof document<"u",rt=typeof navigator=="object"&&navigator||void 0,kn=tt&&(!rt||["ReactNative","NativeScript","NS"].indexOf(rt.product)<0),Nn=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",In=tt&&window.location.href||"http://localhost",z={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:tt,hasStandardBrowserEnv:kn,hasStandardBrowserWebWorkerEnv:Nn,navigator:rt,origin:In},Symbol.toStringTag,{value:"Module"})),...Cn};function vn(e,t){return qe(e,new z.classes.URLSearchParams,{visitor:function(r,n,s,o){return z.isNode&&l.isBuffer(r)?(this.append(n,r.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...t})}const Ft=Ct;function Lt(e){if(e>Ft)throw new E("FormData field is too deeply nested ("+e+" levels). Max depth: "+Ft,E.ERR_FORM_DATA_DEPTH_EXCEEDED)}function Dn(e){const t=[],r=/\w+|\[(\w*)]/g;let n;for(;(n=r.exec(e))!==null;)Lt(t.length),t.push(n[0]==="[]"?"":n[1]||n[0]);return t}function Fn(e){const t={},r=Object.keys(e);let n;const s=r.length;let o;for(n=0;n<s;n++)o=r[n],t[o]=e[o];return t}function Ut(e){function t(r,n,s,o){Lt(o);let i=r[o++];if(i==="__proto__")return!0;const c=Number.isFinite(+i),f=o>=r.length;return i=!i&&l.isArray(s)?s.length:i,f?(l.hasOwnProp(s,i)?s[i]=l.isArray(s[i])?s[i].concat(n):[s[i],n]:s[i]=n,!c):((!l.hasOwnProp(s,i)||!l.isObject(s[i]))&&(s[i]=[]),t(r,n,s[i],o)&&l.isArray(s[i])&&(s[i]=Fn(s[i])),!c)}if(l.isFormData(e)&&l.isFunction(e.entries)){const r={};return l.forEachEntry(e,(n,s)=>{t(Dn(n),s,r,0)}),r}return null}const Se=(e,t)=>e!=null&&l.hasOwnProp(e,t)?e[t]:void 0;function Ln(e,t,r){if(l.isString(e))try{return(t||JSON.parse)(e),l.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}const Ce={transitional:et,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const n=r.getContentType()||"",s=n.indexOf("application/json")>-1,o=l.isObject(t);if(o&&l.isHTMLForm(t)&&(t=new FormData(t)),l.isFormData(t))return s?JSON.stringify(Ut(t)):t;if(l.isArrayBuffer(t)||l.isBuffer(t)||l.isStream(t)||l.isFile(t)||l.isBlob(t)||l.isReadableStream(t))return t;if(l.isArrayBufferView(t))return t.buffer;if(l.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(o){const f=Se(this,"formSerializer");if(n.indexOf("application/x-www-form-urlencoded")>-1)return vn(t,f).toString();if((c=l.isFileList(t))||n.indexOf("multipart/form-data")>-1){const d=Se(this,"env"),h=d&&d.FormData;return qe(c?{"files[]":t}:t,h&&new h,f)}}return o||s?(r.setContentType("application/json",!1),Ln(t)):t}],transformResponse:[function(t){const r=Se(this,"transitional")||Ce.transitional,n=r&&r.forcedJSONParsing,s=Se(this,"responseType"),o=s==="json";if(l.isResponse(t)||l.isReadableStream(t))return t;if(t&&l.isString(t)&&(n&&!s||o)){const c=!(r&&r.silentJSONParsing)&&o;try{return JSON.parse(t,Se(this,"parseReviver"))}catch(f){if(c)throw f.name==="SyntaxError"?E.from(f,E.ERR_BAD_RESPONSE,this,null,Se(this,"response")):f}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:z.classes.FormData,Blob:z.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};l.forEach(["delete","get","head","post","put","patch","query"],e=>{Ce.headers[e]={}});function nt(e,t){const r=this||Ce,n=t||r,s=$.from(n.headers);let o=n.data;return l.forEach(e,function(c){o=c.call(r,o,s.normalize(),t?t.status:void 0)}),s.normalize(),o}function Bt(e){return!!(e&&e.__CANCEL__)}let ke=class extends E{constructor(t,r,n){super(t??"canceled",E.ERR_CANCELED,r,n),this.name="CanceledError",this.__CANCEL__=!0}};function qt(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new E("Request failed with status code "+r.status,r.status>=400&&r.status<500?E.ERR_BAD_REQUEST:E.ERR_BAD_RESPONSE,r.config,r.request,r))}function Un(e){const t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1]||""}function Bn(e,t){e=e||10;const r=new Array(e),n=new Array(e);let s=0,o=0,i;return t=t!==void 0?t:1e3,function(f){const d=Date.now(),h=n[o];i||(i=d),r[s]=f,n[s]=d;let y=o,T=0;for(;y!==s;)T+=r[y++],y=y%e;if(s=(s+1)%e,s===o&&(o=(o+1)%e),d-i<t)return;const S=h&&d-h;return S?Math.round(T*1e3/S):void 0}}function qn(e,t){let r=0,n=1e3/t,s,o;const i=(d,h=Date.now())=>{r=h,s=null,o&&(clearTimeout(o),o=null),e(...d)};return[(...d)=>{const h=Date.now(),y=h-r;y>=n?i(d,h):(s=d,o||(o=setTimeout(()=>{o=null,i(s)},n-y)))},()=>s&&i(s)]}const ze=(e,t,r=3)=>{let n=0;const s=Bn(50,250);return qn(o=>{if(!o||typeof o.loaded!="number")return;const i=o.loaded,c=o.lengthComputable?o.total:void 0,f=c!=null?Math.min(i,c):i,d=Math.max(0,f-n),h=s(d);n=Math.max(n,f);const y={loaded:f,total:c,progress:c?f/c:void 0,bytes:d,rate:h||void 0,estimated:h&&c?(c-f)/h:void 0,event:o,lengthComputable:c!=null,[t?"download":"upload"]:!0};e(y)},r)},zt=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},$t=e=>(...t)=>l.asap(()=>e(...t)),zn=z.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,z.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(z.origin),z.navigator&&/(msie|trident)/i.test(z.navigator.userAgent)):()=>!0,$n=z.hasStandardBrowserEnv?{write(e,t,r,n,s,o,i){if(typeof document>"u")return;const c=[`${e}=${encodeURIComponent(t)}`];l.isNumber(r)&&c.push(`expires=${new Date(r).toUTCString()}`),l.isString(n)&&c.push(`path=${n}`),l.isString(s)&&c.push(`domain=${s}`),o===!0&&c.push("secure"),l.isString(i)&&c.push(`SameSite=${i}`),document.cookie=c.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.split(";");for(let r=0;r<t.length;r++){const n=t[r].replace(/^\s+/,""),s=n.indexOf("=");if(s!==-1&&n.slice(0,s)===e)return decodeURIComponent(n.slice(s+1))}return null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function Hn(e){return typeof e!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Mn(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}const Vn=/^https?:(?!\/\/)/i,Jn=/[\t\n\r]/g;function Wn(e){let t=0;for(;t<e.length&&e.charCodeAt(t)<=32;)t++;return e.slice(t)}function Kn(e){return Wn(e).replace(Jn,"")}function Ht(e,t){if(typeof e=="string"&&Vn.test(Kn(e)))throw new E('Invalid URL: missing "//" after protocol',E.ERR_INVALID_URL,t)}function Mt(e,t,r,n){Ht(t,n);let s=!Hn(t);return e&&(s||r===!1)?(Ht(e,n),Mn(e,t)):t}const Vt=e=>e instanceof $?{...e}:e;function me(e,t){t=t||{};const r=Object.create(null);Object.defineProperty(r,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});function n(h,y,T,S){return l.isPlainObject(h)&&l.isPlainObject(y)?l.merge.call({caseless:S},h,y):l.isPlainObject(y)?l.merge({},y):l.isArray(y)?y.slice():y}function s(h,y,T,S){if(l.isUndefined(y)){if(!l.isUndefined(h))return n(void 0,h,T,S)}else return n(h,y,T,S)}function o(h,y){if(!l.isUndefined(y))return n(void 0,y)}function i(h,y){if(l.isUndefined(y)){if(!l.isUndefined(h))return n(void 0,h)}else return n(void 0,y)}function c(h){const y=l.hasOwnProp(t,"transitional")?t.transitional:void 0;if(!l.isUndefined(y))if(l.isPlainObject(y)){if(l.hasOwnProp(y,h))return y[h]}else return;const T=l.hasOwnProp(e,"transitional")?e.transitional:void 0;if(l.isPlainObject(T)&&l.hasOwnProp(T,h))return T[h]}function f(h,y,T){if(l.hasOwnProp(t,T))return n(h,y);if(l.hasOwnProp(e,T))return n(void 0,h)}const d={url:o,method:o,data:o,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,allowedSocketPaths:i,responseEncoding:i,validateStatus:f,headers:(h,y,T)=>s(Vt(h),Vt(y),T,!0)};return l.forEach(Object.keys({...e,...t}),function(y){if(y==="__proto__"||y==="constructor"||y==="prototype")return;const T=l.hasOwnProp(d,y)?d[y]:s,S=l.hasOwnProp(e,y)?e[y]:void 0,C=l.hasOwnProp(t,y)?t[y]:void 0,A=T(S,C,y);l.isUndefined(A)&&T!==f||(r[y]=A)}),l.hasOwnProp(t,"validateStatus")&&l.isUndefined(t.validateStatus)&&c("validateStatusUndefinedResolves")===!1&&(l.hasOwnProp(e,"validateStatus")?r.validateStatus=n(void 0,e.validateStatus):delete r.validateStatus),r}const Xn=["content-type","content-length"];function Yn(e,t,r){if(r!=="content-only"){e.set(t);return}Object.entries(t).forEach(([n,s])=>{Xn.includes(n.toLowerCase())&&e.set(n,s)})}const Gn=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(t,r)=>String.fromCharCode(parseInt(r,16)));function Jt(e){const t=me({},e),r=T=>l.hasOwnProp(t,T)?t[T]:void 0,n=r("data");let s=r("withXSRFToken");const o=r("xsrfHeaderName"),i=r("xsrfCookieName");let c=r("headers");const f=r("auth"),d=r("baseURL"),h=r("allowAbsoluteUrls"),y=r("url");if(t.headers=c=$.from(c),t.url=vt(Mt(d,y,h,t),r("params"),r("paramsSerializer")),f){const T=l.getSafeProp(f,"username")||"",S=l.getSafeProp(f,"password")||"";c.set("Authorization","Basic "+btoa(T+":"+(S?Gn(S):"")))}if(l.isFormData(n)&&(z.hasStandardBrowserEnv||z.hasStandardBrowserWebWorkerEnv||l.isReactNative(n)?c.setContentType(void 0):l.isFunction(n.getHeaders)&&Yn(c,n.getHeaders(),r("formDataHeaderPolicy"))),z.hasStandardBrowserEnv&&(l.isFunction(s)&&(s=s(t)),s===!0||s==null&&zn(t.url))){const S=o&&i&&$n.read(i);S&&c.set(o,S)}return t}const Qn=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(r,n){const s=Jt(e);let o=s.data;const i=$.from(s.headers).normalize();let{responseType:c,onUploadProgress:f,onDownloadProgress:d}=s,h,y,T,S,C;function A(){S&&S(),C&&C(),s.cancelToken&&s.cancelToken.unsubscribe(h),s.signal&&s.signal.removeEventListener("abort",h)}let R=new XMLHttpRequest;R.open(s.method.toUpperCase(),s.url,!0),R.timeout=s.timeout;function m(){if(!R)return;const x=$.from("getAllResponseHeaders"in R&&R.getAllResponseHeaders()),L={data:!c||c==="text"||c==="json"?R.responseText:R.response,status:R.status,statusText:R.statusText,headers:x,config:e,request:R};qt(function(J){r(J),A()},function(J){n(J),A()},L),R=null}"onloadend"in R?R.onloadend=m:R.onreadystatechange=function(){!R||R.readyState!==4||R.status===0&&!(R.responseURL&&R.responseURL.startsWith("file:"))||setTimeout(m)},R.onabort=function(){R&&(n(new E("Request aborted",E.ECONNABORTED,e,R)),A(),R=null)},R.onerror=function(N){const L=N&&N.message?N.message:"Network Error",v=new E(L,E.ERR_NETWORK,e,R);v.event=N||null,n(v),A(),R=null},R.ontimeout=function(){let N=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const L=s.transitional||et;s.timeoutErrorMessage&&(N=s.timeoutErrorMessage),n(new E(N,L.clarifyTimeoutError?E.ETIMEDOUT:E.ECONNABORTED,e,R)),A(),R=null},o===void 0&&i.setContentType(null),"setRequestHeader"in R&&l.forEach(At(i),function(N,L){R.setRequestHeader(L,N)}),l.isUndefined(s.withCredentials)||(R.withCredentials=!!s.withCredentials),c&&c!=="json"&&(R.responseType=s.responseType),d&&([T,C]=ze(d,!0),R.addEventListener("progress",T)),f&&R.upload&&([y,S]=ze(f),R.upload.addEventListener("progress",y),R.upload.addEventListener("loadend",S)),(s.cancelToken||s.signal)&&(h=x=>{R&&(n(!x||x.type?new ke(null,e,R):x),R.abort(),A(),R=null)},s.cancelToken&&s.cancelToken.subscribe(h),s.signal&&(s.signal.aborted?h():s.signal.addEventListener("abort",h)));const b=Un(s.url);if(b&&!z.protocols.includes(b)){n(new E("Unsupported protocol "+b+":",E.ERR_BAD_REQUEST,e));return}R.send(o||null)})},Zn=(e,t)=>{if(e=e?e.filter(Boolean):[],!t&&!e.length)return;const r=new AbortController;let n=!1;const s=function(f){if(!n){n=!0,i();const d=f instanceof Error?f:this.reason;r.abort(d instanceof E?d:new ke(d instanceof Error?d.message:d))}};let o=t&&setTimeout(()=>{o=null,s(new E(`timeout of ${t}ms exceeded`,E.ETIMEDOUT))},t);const i=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(f=>{f.unsubscribe?f.unsubscribe(s):f.removeEventListener("abort",s)}),e=null)};e.forEach(f=>f.addEventListener("abort",s));const{signal:c}=r;return c.unsubscribe=()=>l.asap(i),c},es=function*(e,t){let r=e.byteLength;if(r<t){yield e;return}let n=0,s;for(;n<r;)s=n+t,yield e.slice(n,s),n=s},ts=async function*(e,t){for await(const r of rs(e))yield*es(r,t)},rs=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:r,value:n}=await t.read();if(r)break;yield n}}finally{await t.cancel()}},Wt=(e,t,r,n)=>{const s=ts(e,t);let o=0,i,c=f=>{i||(i=!0,n&&n(f))};return new ReadableStream({async pull(f){try{const{done:d,value:h}=await s.next();if(d){c(),f.close();return}let y=h.byteLength;if(r){let T=o+=y;r(T)}f.enqueue(new Uint8Array(h))}catch(d){throw c(d),d}},cancel(f){return c(f),s.return()}},{highWaterMark:2})},$e=e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102,ns=(e,t,r)=>t+2<r&&$e(e.charCodeAt(t+1))&&$e(e.charCodeAt(t+2));function ss(e){if(!e||typeof e!="string"||!e.startsWith("data:"))return 0;const t=e.indexOf(",");if(t<0)return 0;const r=e.slice(5,t),n=e.slice(t+1);if(/;base64/i.test(r)){let i=n.length;const c=n.length;for(let S=0;S<c;S++)if(n.charCodeAt(S)===37&&S+2<c){const C=n.charCodeAt(S+1),A=n.charCodeAt(S+2);$e(C)&&$e(A)&&(i-=2,S+=2)}let f=0,d=c-1;const h=S=>S>=2&&n.charCodeAt(S-2)===37&&n.charCodeAt(S-1)===51&&(n.charCodeAt(S)===68||n.charCodeAt(S)===100);d>=0&&(n.charCodeAt(d)===61?(f++,d--):h(d)&&(f++,d-=3)),f===1&&d>=0&&(n.charCodeAt(d)===61||h(d))&&f++;const T=Math.floor(i/4)*3-(f||0);return T>0?T:0}let o=0;for(let i=0,c=n.length;i<c;i++){const f=n.charCodeAt(i);if(f===37&&ns(n,i,c))o+=1,i+=2;else if(f<128)o+=1;else if(f<2048)o+=2;else if(f>=55296&&f<=56319&&i+1<c){const d=n.charCodeAt(i+1);d>=56320&&d<=57343?(o+=4,i++):o+=3}else o+=3}return o}const st="1.18.0",Kt=64*1024,{isFunction:He}=l,os=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(t,r)=>String.fromCharCode(parseInt(r,16))),Xt=e=>{if(!l.isString(e))return e;try{return decodeURIComponent(e)}catch{return e}},Yt=(e,...t)=>{try{return!!e(...t)}catch{return!1}},is=e=>{const t=e.indexOf("://");let r=e;return t!==-1&&(r=r.slice(t+3)),r.includes("@")||r.includes(":")},as=e=>{const t=l.global!==void 0&&l.global!==null?l.global:globalThis,{ReadableStream:r,TextEncoder:n}=t;e=l.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},e);const{fetch:s,Request:o,Response:i}=e,c=s?He(s):typeof fetch=="function",f=He(o),d=He(i);if(!c)return!1;const h=c&&He(r),y=c&&(typeof n=="function"?(m=>b=>m.encode(b))(new n):async m=>new Uint8Array(await new o(m).arrayBuffer())),T=f&&h&&Yt(()=>{let m=!1;const b=new o(z.origin,{body:new r,method:"POST",get duplex(){return m=!0,"half"}}),x=b.headers.has("Content-Type");return b.body!=null&&b.body.cancel(),m&&!x}),S=d&&h&&Yt(()=>l.isReadableStream(new i("").body)),C={stream:S&&(m=>m.body)};c&&["text","arrayBuffer","blob","formData","stream"].forEach(m=>{!C[m]&&(C[m]=(b,x)=>{let N=b&&b[m];if(N)return N.call(b);throw new E(`Response type '${m}' is not supported`,E.ERR_NOT_SUPPORT,x)})});const A=async m=>{if(m==null)return 0;if(l.isBlob(m))return m.size;if(l.isSpecCompliantForm(m))return(await new o(z.origin,{method:"POST",body:m}).arrayBuffer()).byteLength;if(l.isArrayBufferView(m)||l.isArrayBuffer(m))return m.byteLength;if(l.isURLSearchParams(m)&&(m=m+""),l.isString(m))return(await y(m)).byteLength},R=async(m,b)=>{const x=l.toFiniteNumber(m.getContentLength());return x??A(b)};return async m=>{let{url:b,method:x,data:N,signal:L,cancelToken:v,timeout:J,onDownloadProgress:se,onUploadProgress:Y,responseType:w,headers:k,withCredentials:M="same-origin",fetchOptions:ce,maxContentLength:W,maxBodyLength:Z}=Jt(m);const te=l.isNumber(W)&&W>-1,oe=l.isNumber(Z)&&Z>-1,be=I=>l.hasOwnProp(m,I)?m[I]:void 0;let ue=s||fetch;w=w?(w+"").toLowerCase():"text";let K=Zn([L,v&&v.toAbortSignal()],J),a=null;const g=K&&K.unsubscribe&&(()=>{K.unsubscribe()});let O,j=null;const re=()=>new E("Request body larger than maxBodyLength limit",E.ERR_BAD_REQUEST,m,a);try{let I;const _=be("auth");if(_){const P=l.getSafeProp(_,"username")||"",G=l.getSafeProp(_,"password")||"";I={username:P,password:G}}if(is(b)){const P=new URL(b,z.origin);if(!I&&(P.username||P.password)){const G=Xt(P.username),fe=Xt(P.password);I={username:G,password:fe}}(P.username||P.password)&&(P.username="",P.password="",b=P.href)}if(I&&(k.delete("authorization"),k.set("Authorization","Basic "+btoa(os((I.username||"")+":"+(I.password||""))))),te&&typeof b=="string"&&b.startsWith("data:")&&ss(b)>W)throw new E("maxContentLength size of "+W+" exceeded",E.ERR_BAD_RESPONSE,m,a);if(oe&&x!=="get"&&x!=="head"){const P=await A(N);if(typeof P=="number"&&isFinite(P)&&(O=P,P>Z))throw re()}const B=oe&&(l.isReadableStream(N)||l.isStream(N)),ne=(P,G,fe)=>Wt(P,Kt,ge=>{if(oe&&ge>Z)throw j=re();G&&G(ge)},fe);if(T&&x!=="get"&&x!=="head"&&(Y||B)){if(O=O??await R(k,N),O!==0||B){let P=new o(b,{method:"POST",body:N,duplex:"half"}),G;if(l.isFormData(N)&&(G=P.headers.get("content-type"))&&k.setContentType(G),P.body){const[fe,ge]=Y&&zt(O,ze($t(Y)))||[];N=ne(P.body,fe,ge)}}}else if(B&&!f&&h&&x!=="get"&&x!=="head")N=ne(N);else if(B&&f&&!T&&x!=="get"&&x!=="head")throw new E("Stream request bodies are not supported by the current fetch implementation",E.ERR_NOT_SUPPORT,m,a);l.isString(M)||(M=M?"include":"omit");const Ie=f&&"credentials"in o.prototype;if(l.isFormData(N)){const P=k.getContentType();P&&/^multipart\/form-data/i.test(P)&&!/boundary=/i.test(P)&&k.delete("content-type")}k.set("User-Agent","axios/"+st,!1);const ar={...ce,signal:K,method:x.toUpperCase(),headers:At(k.normalize()),body:N,duplex:"half",credentials:Ie?M:void 0};a=f&&new o(b,ar);let ie=await(f?ue(a,ce):ue(b,ar));const lr=$.from(ie.headers);if(te){const P=l.toFiniteNumber(lr.getContentLength());if(P!=null&&P>W)throw new E("maxContentLength size of "+W+" exceeded",E.ERR_BAD_RESPONSE,m,a)}const pt=S&&(w==="stream"||w==="response");if(S&&ie.body&&(se||te||pt&&g)){const P={};["status","statusText","headers"].forEach(ve=>{P[ve]=ie[ve]});const G=l.toFiniteNumber(lr.getContentLength()),[fe,ge]=se&&zt(G,ze($t(se),!0))||[];let cr=0;const As=ve=>{if(te&&(cr=ve,cr>W))throw new E("maxContentLength size of "+W+" exceeded",E.ERR_BAD_RESPONSE,m,a);fe&&fe(ve)};ie=new i(Wt(ie.body,Kt,As,()=>{ge&&ge(),g&&g()}),P)}w=w||"text";let ae=await C[l.findKey(C,w)||"text"](ie,m);if(te&&!S&&!pt){let P;if(ae!=null&&(typeof ae.byteLength=="number"?P=ae.byteLength:typeof ae.size=="number"?P=ae.size:typeof ae=="string"&&(P=typeof n=="function"?new n().encode(ae).byteLength:ae.length)),typeof P=="number"&&P>W)throw new E("maxContentLength size of "+W+" exceeded",E.ERR_BAD_RESPONSE,m,a)}return!pt&&g&&g(),await new Promise((P,G)=>{qt(P,G,{data:ae,headers:$.from(ie.headers),status:ie.status,statusText:ie.statusText,config:m,request:a})})}catch(I){if(g&&g(),K&&K.aborted&&K.reason instanceof E){const _=K.reason;throw _.config=m,a&&(_.request=a),I!==_&&(_.cause=I),_}throw j?(a&&!j.request&&(j.request=a),j):I instanceof E?(a&&!I.request&&(I.request=a),I):I&&I.name==="TypeError"&&/Load failed|fetch/i.test(I.message)?Object.assign(new E("Network Error",E.ERR_NETWORK,m,a,I&&I.response),{cause:I.cause||I}):E.from(I,I&&I.code,m,a,I&&I.response)}}},ls=new Map,Gt=e=>{let t=e&&e.env||{};const{fetch:r,Request:n,Response:s}=t,o=[n,s,r];let i=o.length,c=i,f,d,h=ls;for(;c--;)f=o[c],d=h.get(f),d===void 0&&h.set(f,d=c?new Map:as(t)),h=d;return d};Gt();const ot={http:_n,xhr:Qn,fetch:{get:Gt}};l.forEach(ot,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch{}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}});const Qt=e=>`- ${e}`,cs=e=>l.isFunction(e)||e===null||e===!1;function us(e,t){e=l.isArray(e)?e:[e];const{length:r}=e;let n,s;const o={};for(let i=0;i<r;i++){n=e[i];let c;if(s=n,!cs(n)&&(s=ot[(c=String(n)).toLowerCase()],s===void 0))throw new E(`Unknown adapter '${c}'`);if(s&&(l.isFunction(s)||(s=s.get(t))))break;o[c||"#"+i]=s}if(!s){const i=Object.entries(o).map(([f,d])=>`adapter ${f} `+(d===!1?"is not supported by the environment":"is not available in the build"));let c=r?i.length>1?`since :
|
|
25
|
+
`+i.map(Qt).join(`
|
|
26
|
+
`):" "+Qt(i[0]):"as no adapter specified";throw new E("There is no suitable adapter to dispatch the request "+c,"ERR_NOT_SUPPORT")}return s}const Zt={getAdapter:us,adapters:ot};function it(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new ke(null,e)}function er(e){return it(e),e.headers=$.from(e.headers),e.data=nt.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Zt.getAdapter(e.adapter||Ce.adapter,e)(e).then(function(n){it(e),e.response=n;try{n.data=nt.call(e,e.transformResponse,n)}finally{delete e.response}return n.headers=$.from(n.headers),n},function(n){if(!Bt(n)&&(it(e),n&&n.response)){e.response=n.response;try{n.response.data=nt.call(e,e.transformResponse,n.response)}finally{delete e.response}n.response.headers=$.from(n.response.headers)}return Promise.reject(n)})}const Me={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Me[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const tr={};Me.transitional=function(t,r,n){function s(o,i){return"[Axios v"+st+"] Transitional option '"+o+"'"+i+(n?". "+n:"")}return(o,i,c)=>{if(t===!1)throw new E(s(i," has been removed"+(r?" in "+r:"")),E.ERR_DEPRECATED);return r&&!tr[i]&&(tr[i]=!0,console.warn(s(i," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(o,i,c):!0}},Me.spelling=function(t){return(r,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};function fs(e,t,r){if(typeof e!="object")throw new E("options must be an object",E.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let s=n.length;for(;s-- >0;){const o=n[s],i=Object.prototype.hasOwnProperty.call(t,o)?t[o]:void 0;if(i){const c=e[o],f=c===void 0||i(c,o,e);if(f!==!0)throw new E("option "+o+" must be "+f,E.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new E("Unknown option "+o,E.ERR_BAD_OPTION)}}const Ve={assertOptions:fs,validators:Me},H=Ve.validators;let ye=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Dt,response:new Dt}}async request(t,r){try{return await this._request(t,r)}catch(n){if(n instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const o=(()=>{if(!s.stack)return"";const i=s.stack.indexOf(`
|
|
27
|
+
`);return i===-1?"":s.stack.slice(i+1)})();try{if(!n.stack)n.stack=o;else if(o){const i=o.indexOf(`
|
|
28
|
+
`),c=i===-1?-1:o.indexOf(`
|
|
29
|
+
`,i+1),f=c===-1?"":o.slice(c+1);String(n.stack).endsWith(f)||(n.stack+=`
|
|
30
|
+
`+o)}}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=me(this.defaults,r);const{transitional:n,paramsSerializer:s,headers:o}=r;n!==void 0&&Ve.assertOptions(n,{silentJSONParsing:H.transitional(H.boolean),forcedJSONParsing:H.transitional(H.boolean),clarifyTimeoutError:H.transitional(H.boolean),legacyInterceptorReqResOrdering:H.transitional(H.boolean),advertiseZstdAcceptEncoding:H.transitional(H.boolean),validateStatusUndefinedResolves:H.transitional(H.boolean)},!1),s!=null&&(l.isFunction(s)?r.paramsSerializer={serialize:s}:Ve.assertOptions(s,{encode:H.function,serialize:H.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),Ve.assertOptions(r,{baseUrl:H.spelling("baseURL"),withXsrfToken:H.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let i=o&&l.merge(o.common,o[r.method]);o&&l.forEach(["delete","get","head","post","put","patch","query","common"],C=>{delete o[C]}),r.headers=$.concat(i,o);const c=[];let f=!0;this.interceptors.request.forEach(function(A){if(typeof A.runWhen=="function"&&A.runWhen(r)===!1)return;f=f&&A.synchronous;const R=r.transitional||et;R&&R.legacyInterceptorReqResOrdering?c.unshift(A.fulfilled,A.rejected):c.push(A.fulfilled,A.rejected)});const d=[];this.interceptors.response.forEach(function(A){d.push(A.fulfilled,A.rejected)});let h,y=0,T;if(!f){const C=[er.bind(this),void 0];for(C.unshift(...c),C.push(...d),T=C.length,h=Promise.resolve(r);y<T;)h=h.then(C[y++],C[y++]);return h}T=c.length;let S=r;for(;y<T;){const C=c[y++],A=c[y++];try{S=C(S)}catch(R){A.call(this,R);break}}try{h=er.call(this,S)}catch(C){return Promise.reject(C)}for(y=0,T=d.length;y<T;)h=h.then(d[y++],d[y++]);return h}getUri(t){t=me(this.defaults,t);const r=Mt(t.baseURL,t.url,t.allowAbsoluteUrls,t);return vt(r,t.params,t.paramsSerializer)}};l.forEach(["delete","get","head","options"],function(t){ye.prototype[t]=function(r,n){return this.request(me(n||{},{method:t,url:r,data:n&&l.hasOwnProp(n,"data")?n.data:void 0}))}}),l.forEach(["post","put","patch","query"],function(t){function r(n){return function(o,i,c){return this.request(me(c||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:o,data:i}))}}ye.prototype[t]=r(),t!=="query"&&(ye.prototype[t+"Form"]=r(!0))});let ds=class fr{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(o){r=o});const n=this;this.promise.then(s=>{if(!n._listeners)return;let o=n._listeners.length;for(;o-- >0;)n._listeners[o](s);n._listeners=null}),this.promise.then=s=>{let o;const i=new Promise(c=>{n.subscribe(c),o=c}).then(s);return i.cancel=function(){n.unsubscribe(o)},i},t(function(o,i,c){n.reason||(n.reason=new ke(o,i,c),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=n=>{t.abort(n)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new fr(function(s){t=s}),cancel:t}}};function ps(e){return function(r){return e.apply(null,r)}}function hs(e){return l.isObject(e)&&e.isAxiosError===!0}const at={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(at).forEach(([e,t])=>{at[t]=e});function rr(e){const t=new ye(e),r=bt(ye.prototype.request,t);return l.extend(r,ye.prototype,t,{allOwnKeys:!0}),l.extend(r,t,null,{allOwnKeys:!0}),r.create=function(s){return rr(me(e,s))},r}const F=rr(Ce);F.Axios=ye,F.CanceledError=ke,F.CancelToken=ds,F.isCancel=Bt,F.VERSION=st,F.toFormData=qe,F.AxiosError=E,F.Cancel=F.CanceledError,F.all=function(t){return Promise.all(t)},F.spread=ps,F.isAxiosError=hs,F.mergeConfig=me,F.AxiosHeaders=$,F.formToJSON=e=>Ut(l.isHTMLForm(e)?new FormData(e):e),F.getAdapter=Zt.getAdapter,F.HttpStatusCode=at,F.default=F;const{Axios:Ds,AxiosError:Fs,CanceledError:Ls,isCancel:Us,CancelToken:Bs,VERSION:qs,all:zs,Cancel:$s,isAxiosError:Hs,spread:Ms,toFormData:Vs,AxiosHeaders:Js,HttpStatusCode:Ws,formToJSON:Ks,getAdapter:Xs,mergeConfig:Ys,create:Gs}=F;var ms=Object.defineProperty,ys=(e,t,r)=>t in e?ms(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,bs=(e,t,r)=>ys(e,t+"",r),lt={exports:{}},Ne={};/**
|
|
31
|
+
* @license React
|
|
32
|
+
* react-jsx-runtime.production.js
|
|
33
|
+
*
|
|
34
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
35
|
+
*
|
|
36
|
+
* This source code is licensed under the MIT license found in the
|
|
37
|
+
* LICENSE file in the root directory of this source tree.
|
|
38
|
+
*/var nr;function gs(){if(nr)return Ne;nr=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(n,s,o){var i=null;if(o!==void 0&&(i=""+o),s.key!==void 0&&(i=""+s.key),"key"in s){o={};for(var c in s)c!=="key"&&(o[c]=s[c])}else o=s;return s=o.ref,{$$typeof:e,type:n,key:i,ref:s!==void 0?s:null,props:o}}return Ne.Fragment=t,Ne.jsx=r,Ne.jsxs=r,Ne}var Je={};/**
|
|
39
|
+
* @license React
|
|
40
|
+
* react-jsx-runtime.development.js
|
|
41
|
+
*
|
|
42
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
43
|
+
*
|
|
44
|
+
* This source code is licensed under the MIT license found in the
|
|
45
|
+
* LICENSE file in the root directory of this source tree.
|
|
46
|
+
*/var sr;function ws(){return sr||(sr=1,process.env.NODE_ENV!=="production"&&(function(){function e(a){if(a==null)return null;if(typeof a=="function")return a.$$typeof===k?null:a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case R:return"Fragment";case b:return"Profiler";case m:return"StrictMode";case v:return"Suspense";case J:return"SuspenseList";case w:return"Activity"}if(typeof a=="object")switch(typeof a.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),a.$$typeof){case A:return"Portal";case N:return a.displayName||"Context";case x:return(a._context.displayName||"Context")+".Consumer";case L:var g=a.render;return a=a.displayName,a||(a=g.displayName||g.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case se:return g=a.displayName||null,g!==null?g:e(a.type)||"Memo";case Y:g=a._payload,a=a._init;try{return e(a(g))}catch{}}return null}function t(a){return""+a}function r(a){try{t(a);var g=!1}catch{g=!0}if(g){g=console;var O=g.error,j=typeof Symbol=="function"&&Symbol.toStringTag&&a[Symbol.toStringTag]||a.constructor.name||"Object";return O.call(g,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",j),t(a)}}function n(a){if(a===R)return"<>";if(typeof a=="object"&&a!==null&&a.$$typeof===Y)return"<...>";try{var g=e(a);return g?"<"+g+">":"<...>"}catch{return"<...>"}}function s(){var a=M.A;return a===null?null:a.getOwner()}function o(){return Error("react-stack-top-frame")}function i(a){if(ce.call(a,"key")){var g=Object.getOwnPropertyDescriptor(a,"key").get;if(g&&g.isReactWarning)return!1}return a.key!==void 0}function c(a,g){function O(){te||(te=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",g))}O.isReactWarning=!0,Object.defineProperty(a,"key",{get:O,configurable:!0})}function f(){var a=e(this.type);return oe[a]||(oe[a]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),a=this.props.ref,a!==void 0?a:null}function d(a,g,O,j,re,I){var _=O.ref;return a={$$typeof:C,type:a,key:g,props:O,_owner:j},(_!==void 0?_:null)!==null?Object.defineProperty(a,"ref",{enumerable:!1,get:f}):Object.defineProperty(a,"ref",{enumerable:!1,value:null}),a._store={},Object.defineProperty(a._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(a,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(a,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:re}),Object.defineProperty(a,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:I}),Object.freeze&&(Object.freeze(a.props),Object.freeze(a)),a}function h(a,g,O,j,re,I){var _=g.children;if(_!==void 0)if(j)if(W(_)){for(j=0;j<_.length;j++)y(_[j]);Object.freeze&&Object.freeze(_)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else y(_);if(ce.call(g,"key")){_=e(a);var B=Object.keys(g).filter(function(Ie){return Ie!=="key"});j=0<B.length?"{key: someKey, "+B.join(": ..., ")+": ...}":"{key: someKey}",K[_+j]||(B=0<B.length?"{"+B.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
47
|
+
let props = %s;
|
|
48
|
+
<%s {...props} />
|
|
49
|
+
React keys must be passed directly to JSX without using spread:
|
|
50
|
+
let props = %s;
|
|
51
|
+
<%s key={someKey} {...props} />`,j,_,B,_),K[_+j]=!0)}if(_=null,O!==void 0&&(r(O),_=""+O),i(g)&&(r(g.key),_=""+g.key),"key"in g){O={};for(var ne in g)ne!=="key"&&(O[ne]=g[ne])}else O=g;return _&&c(O,typeof a=="function"?a.displayName||a.name||"Unknown":a),d(a,_,O,s(),re,I)}function y(a){T(a)?a._store&&(a._store.validated=1):typeof a=="object"&&a!==null&&a.$$typeof===Y&&(a._payload.status==="fulfilled"?T(a._payload.value)&&a._payload.value._store&&(a._payload.value._store.validated=1):a._store&&(a._store.validated=1))}function T(a){return typeof a=="object"&&a!==null&&a.$$typeof===C}var S=D,C=Symbol.for("react.transitional.element"),A=Symbol.for("react.portal"),R=Symbol.for("react.fragment"),m=Symbol.for("react.strict_mode"),b=Symbol.for("react.profiler"),x=Symbol.for("react.consumer"),N=Symbol.for("react.context"),L=Symbol.for("react.forward_ref"),v=Symbol.for("react.suspense"),J=Symbol.for("react.suspense_list"),se=Symbol.for("react.memo"),Y=Symbol.for("react.lazy"),w=Symbol.for("react.activity"),k=Symbol.for("react.client.reference"),M=S.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ce=Object.prototype.hasOwnProperty,W=Array.isArray,Z=console.createTask?console.createTask:function(){return null};S={react_stack_bottom_frame:function(a){return a()}};var te,oe={},be=S.react_stack_bottom_frame.bind(S,o)(),ue=Z(n(o)),K={};Je.Fragment=R,Je.jsx=function(a,g,O){var j=1e4>M.recentlyCreatedOwnerStacks++;return h(a,g,O,!1,j?Error("react-stack-top-frame"):be,j?Z(n(a)):ue)},Je.jsxs=function(a,g,O){var j=1e4>M.recentlyCreatedOwnerStacks++;return h(a,g,O,!0,j?Error("react-stack-top-frame"):be,j?Z(n(a)):ue)}})()),Je}var or;function xs(){return or||(or=1,process.env.NODE_ENV==="production"?lt.exports=gs():lt.exports=ws()),lt.exports}var Q=xs();const{Header:Qs,Sider:Zs,Content:eo}=u.Layout;function Es(e){if(e&&typeof e=="object"&&"code"in e&&"data"in e){const t=e;return t.code!==200?Promise.reject(new Error(t.message||"请求失败")):t.data}return e}function Rs(e,t={}){const{tokenKey:r="token",userInfoKey:n="userInfo",unauthorizedRedirect:s="/login"}=t;e.interceptors.request.use(o=>{const i=localStorage.getItem(r);return i&&(o.headers.Authorization=`Bearer ${i}`),o}),e.interceptors.response.use(o=>Es(o.data),o=>{var i,c,f;return((i=o.response)==null?void 0:i.status)===401?(localStorage.removeItem(r),localStorage.removeItem(n),window.location.href=s):((c=o.response)==null?void 0:c.status)===403?console.error("没有权限访问该资源"):((f=o.response)==null?void 0:f.status)===500&&console.error("服务器内部错误"),Promise.reject(o)})}function ct(e={}){const t=F.create({baseURL:e.baseURL??"/api",timeout:e.timeout??1e4});return Rs(t,{tokenKey:e.tokenKey,userInfoKey:e.userInfoKey,unauthorizedRedirect:e.unauthorizedRedirect}),t}ct();const Ss=ct();class to extends D.Component{constructor(t){super(t),bs(this,"handleReset",()=>{this.setState({hasError:!1,error:null,errorInfo:null}),typeof this.props.onReset=="function"&&this.props.onReset()}),this.state={hasError:!1,error:null,errorInfo:null}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,r){console.error("[ErrorBoundary] caught error:",t,r),this.setState({errorInfo:r})}render(){if(!this.state.hasError)return this.props.children;const{fallbackTitle:t="组件加载失败",fallbackDescription:r,showReload:n=!0}=this.props,s=this.state.error&&(this.state.error.message||String(this.state.error))||"未知错误";return Q.jsxs("div",{style:{padding:24,background:"#fff2f0",border:"1px solid #ffccc7",borderRadius:8,minHeight:200},children:[Q.jsx(u.Alert,{type:"error",showIcon:!0,icon:Q.jsx(U.BugOutlined,{}),message:t,description:Q.jsxs("div",{children:[Q.jsx("div",{style:{marginBottom:8},children:r||"当前组件发生了异常,已被错误边界捕获。其他功能仍可正常使用。"}),Q.jsx("div",{style:{fontFamily:"Menlo, Monaco, Consolas, monospace",fontSize:12,color:"#cf1322",background:"#fff",padding:8,borderRadius:4,border:"1px solid #ffccc7",wordBreak:"break-word",whiteSpace:"pre-wrap"},children:s})]})}),n&&Q.jsx(u.Space,{style:{marginTop:16},children:Q.jsx(u.Button,{icon:Q.jsx(U.ReloadOutlined,{}),onClick:this.handleReset,children:"重试"})})]})}}const{Title:ro,Text:no,Paragraph:so}=u.Typography;let Ts="/api";function ir(){return F.create({baseURL:Ts,timeout:15e3})}const Os=ir();ir(),Os.interceptors.request.use(e=>{const t=localStorage.getItem("token");return t&&(e.headers.Authorization=`Bearer ${t}`),e});const{Header:oo,Sider:io,Content:ao}=u.Layout,{Text:lo}=u.Typography,{Title:co,Text:uo}=u.Typography,{Option:fo}=u.Select,{TextArea:po}=u.Input,_s=[{type:"STRING",label:"字符串",icon:Q.jsx(U.FileTextOutlined,{}),color:"#1677ff",desc:"短文本 (默认 VARCHAR 255)"},{type:"TEXT",label:"长文本",icon:Q.jsx(U.FileTextOutlined,{}),color:"#13c2c2",desc:"TEXT 类型, 无长度限制"},{type:"INT",label:"整数",icon:"#",color:"#722ed1",desc:"INT 整数"},{type:"LONG",label:"长整数",icon:"#",color:"#722ed1",desc:"BIGINT 长整数"},{type:"DECIMAL",label:"小数",icon:"0.00",color:"#eb2f96",desc:"DECIMAL 精确小数"},{type:"BOOLEAN",label:"布尔",icon:Q.jsx(U.CheckCircleOutlined,{}),color:"#52c41a",desc:"TINYINT(1) 是/否"},{type:"DATE",label:"日期",icon:"📅",color:"#fa8c16",desc:"DATE yyyy-MM-dd"},{type:"DATETIME",label:"日期时间",icon:"🕐",color:"#fa8c16",desc:"DATETIME yyyy-MM-dd HH:mm:ss"},{type:"JSON",label:"JSON",icon:"{}",color:"#2f54eb",desc:"JSON 字符串"},{type:"REF",label:"引用",icon:"🔗",color:"#8c8c8c",desc:"外键引用 BIGINT"}];Object.fromEntries(_s.map(e=>[e.type,e]));const{Option:ho}=u.Select;u.Input.TextArea,u.Input.TextArea;const{Text:mo,Paragraph:yo}=u.Typography,{TextArea:bo}=u.Input,{TextArea:go}=u.Input,{Text:wo,Paragraph:xo}=u.Typography,{TextArea:Eo}=u.Input,{Text:Ro,Paragraph:So}=u.Typography,{Text:To}=u.Typography,{Text:Oo}=u.Typography,{TextArea:_o}=u.Input,{Text:jo,Paragraph:Ao}=u.Typography,{Text:Po}=u.Typography,{Text:Co}=u.Typography,{Text:ko}=u.Typography,{Text:No}=u.Typography;common;const le=ct("task"),X={listMyProjects:()=>Ss.get("/project/user/list").then(e=>e.data),createProject:e=>le.post("/project",e).then(t=>t.data),updateProject:(e,t)=>le.put(`/project/${e}`,t).then(r=>r.data),archiveProject:e=>le.put(`/project/${e}/archive`).then(t=>t.data),listTasksByProject:e=>le.get("/task/project/list",{params:{projectId:e}}).then(t=>t.data),listTasksByList:e=>le.get("/task/list",{params:{listId:e}}).then(t=>t.data),createTask:e=>le.post("/task",e).then(t=>t.data),completeTask:e=>le.post("/task/complete",null,{params:{taskId:e}}).then(t=>t.data),moveTask:(e,t,r)=>le.put("/task/move",null,{params:{taskId:e,targetListId:t,position:r}}).then(n=>n.data)},ut=e=>{if(!e)return"-";const t=String(e),r=t.match(/^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2})/);return r?r[1]:t};function ft({apiBaseURL:e}){const[t,r]=D.useState([]),[n,s]=D.useState(!1),[o,i]=D.useState(!1),[c,f]=D.useState(null),[d,h]=D.useState(null),[y,T]=D.useState([]),[S,C]=D.useState(!1),[A]=u.Form.useForm(),R=async()=>{s(!0);try{const w=await X.listMyProjects();r((w==null?void 0:w.data)||w||[])}catch(w){u.message.error("加载项目失败: "+((w==null?void 0:w.message)||w))}finally{s(!1)}};D.useEffect(()=>{R()},[]);const m=async w=>{h(w),C(!0);try{const k=await X.listTasksByProject(w.id);T((k==null?void 0:k.data)||k||[])}catch(k){u.message.error("加载任务失败: "+((k==null?void 0:k.message)||k))}finally{C(!1)}},b=async()=>{if(d)try{const w=await X.listTasksByProject(d.id);T((w==null?void 0:w.data)||w||[])}catch(w){u.message.error("刷新任务失败: "+((w==null?void 0:w.message)||w))}},x=()=>{f(null),A.resetFields(),A.setFieldsValue({status:1}),i(!0)},N=w=>{f(w),A.setFieldsValue({name:w.name,description:w.description,status:w.status??1}),i(!0)},L=async()=>{try{const w=await A.validateFields();c?(await X.updateProject(c.id,w),u.message.success("项目已更新")):(await X.createProject(w),u.message.success("项目已创建")),i(!1),R()}catch(w){if(w!=null&&w.errorFields)return;u.message.error("保存失败: "+((w==null?void 0:w.message)||w))}},v=async w=>{try{await X.archiveProject(w),u.message.success("项目已归档"),R(),(d==null?void 0:d.id)===w&&(h(null),T([]))}catch(k){u.message.error("归档失败: "+((k==null?void 0:k.message)||k))}},J=async w=>{try{await X.completeTask(w),u.message.success("任务已完成"),b()}catch(k){u.message.error("操作失败: "+((k==null?void 0:k.message)||k))}},se=[{title:"项目名称",dataIndex:"name",render:(w,k)=>p.jsx("a",{onClick:()=>m(k),style:{fontWeight:(d==null?void 0:d.id)===k.id?600:400},children:w})},{title:"状态",dataIndex:"status",width:80,render:w=>w===1?p.jsx(u.Tag,{color:"green",children:"进行中"}):p.jsx(u.Tag,{children:"已归档"})},{title:"创建时间",dataIndex:"createdAt",width:170,render:ut},{title:"操作",width:160,fixed:"right",render:(w,k)=>p.jsxs(u.Space,{children:[p.jsx(u.Button,{size:"small",icon:p.jsx(U.EditOutlined,{}),onClick:()=>N(k),children:"编辑"}),p.jsx(u.Popconfirm,{title:"确定归档该项目?",onConfirm:()=>v(k.id),children:p.jsx(u.Button,{size:"small",danger:!0,icon:p.jsx(U.DeleteOutlined,{}),children:"归档"})})]})}],Y=w=>{const M={0:{text:"待办",color:"default"},1:{text:"进行中",color:"blue"},2:{text:"已完成",color:"green"}}[w]||{text:String(w),color:"default"};return p.jsx(u.Tag,{color:M.color,children:M.text})};return p.jsxs("div",{children:[p.jsx("div",{style:{display:"flex",justifyContent:"flex-end",marginBottom:12},children:p.jsx(u.Button,{type:"primary",icon:p.jsx(U.PlusOutlined,{}),onClick:x,children:"新建项目"})}),p.jsxs("div",{style:{display:"flex",gap:16,height:"calc(100vh - 220px)"},children:[p.jsx(u.Card,{size:"small",title:p.jsxs(u.Space,{children:[p.jsx(U.InboxOutlined,{}),"项目管理"]}),style:{width:520,flexShrink:0},styles:{body:{padding:8,overflow:"auto",height:"calc(100% - 40px)"}},children:p.jsx(u.Table,{rowKey:"id",columns:se,dataSource:t,loading:n,pagination:{pageSize:10,size:"small"},size:"small",rowClassName:w=>(d==null?void 0:d.id)===w.id?"ant-table-row-selected":"",onRow:w=>({onClick:()=>m(w),style:{cursor:"pointer"}}),locale:{emptyText:"暂无项目"}})}),p.jsx(u.Card,{size:"small",style:{flex:1,overflow:"auto"},styles:{body:{padding:16}},title:d?p.jsxs(u.Space,{children:[p.jsx(U.UnorderedListOutlined,{}),d.name," · 任务列表"]}):"项目详情",children:d?p.jsxs(u.Spin,{spinning:S,children:[p.jsxs(u.Descriptions,{size:"small",bordered:!0,column:2,style:{marginBottom:16},children:[p.jsx(u.Descriptions.Item,{label:"项目名称",span:2,children:d.name}),p.jsx(u.Descriptions.Item,{label:"描述",span:2,children:d.description||"无"}),p.jsx(u.Descriptions.Item,{label:"负责人",children:d.ownerId||"未指定"}),p.jsx(u.Descriptions.Item,{label:"状态",children:d.status===1?p.jsx(u.Tag,{color:"green",children:"进行中"}):p.jsx(u.Tag,{children:"已归档"})}),p.jsx(u.Descriptions.Item,{label:"创建时间",children:ut(d.createdAt)}),p.jsx(u.Descriptions.Item,{label:"项目ID",children:d.id})]}),p.jsx(u.List,{size:"small",header:p.jsxs("b",{children:["任务项 (",y.length,")"]}),bordered:!0,dataSource:y,locale:{emptyText:"该项目下暂无任务"},renderItem:w=>p.jsx(u.List.Item,{actions:[p.jsx(u.Button,{size:"small",type:"primary",icon:p.jsx(U.CheckOutlined,{}),disabled:w.status===2,onClick:()=>J(w.id),children:"完成"},"complete")],children:p.jsx(u.List.Item.Meta,{title:p.jsxs(u.Space,{children:[w.title,Y(w.status),p.jsxs(u.Tag,{children:["优先级 ",w.priority??"-"]})]}),description:p.jsxs("span",{style:{color:"#888",fontSize:12},children:["截止: ",ut(w.dueDate)," · ID: ",w.id]})})})})]}):p.jsx(u.Empty,{description:"请从左侧选择一个项目",style:{marginTop:80}})})]}),p.jsx(u.Drawer,{title:c?`编辑项目 - ${c.name}`:"新建项目",width:480,open:o,onClose:()=>i(!1),destroyOnHidden:!0,extra:p.jsxs(u.Space,{children:[p.jsx(u.Button,{onClick:()=>i(!1),children:"取消"}),p.jsx(u.Button,{type:"primary",onClick:L,children:"保存"})]}),children:p.jsxs(u.Form,{form:A,layout:"vertical",preserve:!1,children:[p.jsx(u.Form.Item,{name:"name",label:"项目名称",rules:[{required:!0,message:"请输入项目名称"}],children:p.jsx(u.Input,{placeholder:"例如: 一人公司"})}),p.jsx(u.Form.Item,{name:"description",label:"项目描述",children:p.jsx(u.Input.TextArea,{rows:3,placeholder:"可选"})}),p.jsx(u.Form.Item,{name:"status",label:"状态",initialValue:1,children:p.jsx(u.Select,{options:[{label:"进行中",value:1},{label:"已归档",value:0}]})})]})})]})}function dt({apiBaseURL:e}){const[t,r]=D.useState([]),[n,s]=D.useState(null),[o,i]=D.useState([]),[c,f]=D.useState(!1),[d,h]=D.useState(!1),[y]=u.Form.useForm(),T=async()=>{try{const b=await X.listMyProjects(),x=(b==null?void 0:b.data)||b||[];r(x),x.length>0&&!n&&s(x[0].id)}catch(b){u.message.error("加载项目失败: "+((b==null?void 0:b.message)||b))}},S=async b=>{if(!b){i([]);return}f(!0);try{const x=await X.listTasksByProject(b);i((x==null?void 0:x.data)||x||[])}catch(x){u.message.error("加载任务失败: "+((x==null?void 0:x.message)||x))}finally{f(!1)}};D.useEffect(()=>{T()},[]),D.useEffect(()=>{S(n)},[n]);const C=()=>{if(!n){u.message.warning("请先选择项目");return}y.resetFields(),y.setFieldsValue({projectId:n,listId:1,status:1,priority:1}),h(!0)},A=async()=>{try{const b=await y.validateFields();await X.createTask(b),u.message.success("任务已创建"),h(!1),S(n)}catch(b){if(b!=null&&b.errorFields)return;u.message.error("创建失败: "+((b==null?void 0:b.message)||b))}},R=async b=>{try{await X.completeTask(b),u.message.success("任务已完成"),S(n)}catch(x){u.message.error("操作失败: "+((x==null?void 0:x.message)||x))}},m=[{title:"ID",dataIndex:"id",width:60},{title:"标题",dataIndex:"title"},{title:"项目ID",dataIndex:"projectId",width:80},{title:"状态",dataIndex:"status",width:100,render:b=>{const x={0:"待办",1:"进行中",2:"已完成"},N={0:"default",1:"blue",2:"green"}[b]||"default";return p.jsx(u.Tag,{color:N,children:x[b]||b})}},{title:"优先级",dataIndex:"priority",width:80},{title:"截止时间",dataIndex:"dueDate",width:180},{title:"操作",width:200,fixed:"right",render:(b,x)=>p.jsx(u.Space,{children:p.jsx(u.Button,{size:"small",type:"primary",icon:p.jsx(U.CheckOutlined,{}),onClick:()=>R(x.id),disabled:x.status===2,children:"完成"})})}];return p.jsxs("div",{children:[p.jsx(u.Card,{title:"任务管理",extra:p.jsxs(u.Space,{children:[p.jsx("span",{children:"项目:"}),p.jsx(u.Select,{value:n,onChange:s,style:{width:240},placeholder:"选择项目",options:t.map(b=>({label:b.name,value:b.id}))}),p.jsx(u.Button,{type:"primary",icon:p.jsx(U.PlusOutlined,{}),onClick:C,children:"新建任务"})]}),children:p.jsx(u.Table,{rowKey:"id",columns:m,dataSource:o,loading:c,pagination:{pageSize:10}})}),p.jsx(u.Modal,{title:"新建任务",open:d,onCancel:()=>h(!1),onOk:A,destroyOnHidden:!0,children:p.jsxs(u.Form,{form:y,layout:"vertical",preserve:!1,children:[p.jsx(u.Form.Item,{name:"title",label:"任务标题",rules:[{required:!0,message:"请输入任务标题"}],children:p.jsx(u.Input,{placeholder:"例如: 实现 xx 功能"})}),p.jsx(u.Form.Item,{name:"projectId",label:"所属项目",rules:[{required:!0}],children:p.jsx(u.Select,{options:t.map(b=>({label:b.name,value:b.id})),placeholder:"从数据库捞出的项目列表"})}),p.jsx(u.Form.Item,{name:"listId",label:"列表ID",rules:[{required:!0}],children:p.jsx(u.Input,{type:"number",placeholder:"默认 1"})}),p.jsx(u.Form.Item,{name:"priority",label:"优先级",initialValue:1,children:p.jsx(u.Select,{options:[{label:"低",value:1},{label:"中",value:2},{label:"高",value:3}]})})]})})]})}function js(){return p.jsxs(de.Routes,{children:[p.jsx(de.Route,{index:!0,element:p.jsx(de.Navigate,{to:"project",replace:!0})}),p.jsx(de.Route,{path:"project",element:p.jsx(ft,{})}),p.jsx(de.Route,{path:"project/*",element:p.jsx(ft,{})}),p.jsx(de.Route,{path:"task",element:p.jsx(dt,{})}),p.jsx(de.Route,{path:"task/*",element:p.jsx(dt,{})})]})}q.ProjectList=ft,q.ProjectSelect=Er,q.TaskApp=js,q.TaskCard=br,q.TaskList=dt,q.TaskTable=xr,q.api=X,q.taskApi=X,Object.defineProperty(q,Symbol.toStringTag,{value:"Module"})}));
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yuku123/z-task-frontend-component",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"private": false,
|
|
5
|
-
"description": "z-task
|
|
5
|
+
"description": "z-task 共享前端组件 - TaskCard 等",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"react",
|
|
8
8
|
"antd",
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
"bugs": {
|
|
24
24
|
"url": "https://github.com/yuku123/z-opc-frontend/issues"
|
|
25
25
|
},
|
|
26
|
-
"main": "./dist/
|
|
27
|
-
"module": "./dist/
|
|
26
|
+
"main": "./dist/z-task-frontend-component.umd.js",
|
|
27
|
+
"module": "./dist/z-task-frontend-component.es.js",
|
|
28
28
|
"types": "./dist/index.d.ts",
|
|
29
29
|
"files": [
|
|
30
30
|
"dist",
|
|
@@ -44,4 +44,4 @@
|
|
|
44
44
|
"@vitejs/plugin-react": "^4.2.1",
|
|
45
45
|
"vite": "^6.2.0"
|
|
46
46
|
}
|
|
47
|
-
}
|
|
47
|
+
}
|
package/src/api.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* z-task 任务 / 项目 API (从 z-opc-main-starter-frontend/src/services/api.ts 迁入).
|
|
3
|
+
*
|
|
4
|
+
* 后端端点 (z-task):
|
|
5
|
+
* - GET /api/project/user/list — 我的项目列表
|
|
6
|
+
* - POST /api/project — 创建项目
|
|
7
|
+
* - PUT /api/project/{id} — 更新项目
|
|
8
|
+
* - PUT /api/project/{id}/archive — 归档
|
|
9
|
+
* - GET /api/task/project/list?projectId= — 项目下任务
|
|
10
|
+
* - POST /api/task — 创建任务
|
|
11
|
+
* - PUT /api/task/move — 移动任务
|
|
12
|
+
* - POST /api/task/complete?taskId= — 完成任务
|
|
13
|
+
*
|
|
14
|
+
* 注意: 走 z-frontend-common 的 createRequest (统一拦截 + Result 解包),
|
|
15
|
+
* 而不是裸 axios. 这样后端 Result 包装 {code, data, message} 会被自动解包.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import {createRequest, authRequest} from '@yuku123/z-frontend-common'
|
|
19
|
+
|
|
20
|
+
const request = createRequest('task')
|
|
21
|
+
|
|
22
|
+
export const taskApi = {
|
|
23
|
+
// === 项目 ===
|
|
24
|
+
listMyProjects: () => authRequest.get('/project/user/list').then(r => r.data),
|
|
25
|
+
createProject: (data) => request.post('/project', data).then(r => r.data),
|
|
26
|
+
updateProject: (id, data) => request.put(`/project/${id}`, data).then(r => r.data),
|
|
27
|
+
archiveProject: (id) => request.put(`/project/${id}/archive`).then(r => r.data),
|
|
28
|
+
|
|
29
|
+
// === 任务 ===
|
|
30
|
+
listTasksByProject: (projectId) => request.get('/task/project/list', {params: {projectId}}).then(r => r.data),
|
|
31
|
+
listTasksByList: (listId) => request.get('/task/list', {params: {listId}}).then(r => r.data),
|
|
32
|
+
createTask: (data) => request.post('/task', data).then(r => r.data),
|
|
33
|
+
completeTask: (id) => request.post('/task/complete', null, {params: {taskId: id}}).then(r => r.data),
|
|
34
|
+
moveTask: (taskId, targetListId, position) =>
|
|
35
|
+
request.put('/task/move', null, {params: {taskId, targetListId, position}}).then(r => r.data),
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export default taskApi
|
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
import {useEffect, useState} from 'react'
|
|
2
|
+
import {Card, Table, Button, Drawer, Form, Input, Space, message, Popconfirm, Tag, Select, Empty, List, Descriptions, Spin} from 'antd'
|
|
3
|
+
import {EditOutlined, DeleteOutlined, PlusOutlined, InboxOutlined, UnorderedListOutlined, CheckOutlined} from '@ant-design/icons'
|
|
4
|
+
import {taskApi} from '../api'
|
|
5
|
+
|
|
6
|
+
/** 格式化日期为 2026-06-18T15:27:00 (去掉毫秒/时区) */
|
|
7
|
+
const formatDateTime = (val) => {
|
|
8
|
+
if (!val) return '-'
|
|
9
|
+
const s = String(val)
|
|
10
|
+
const m = s.match(/^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2})/)
|
|
11
|
+
return m ? m[1] : s
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* 项目管理 (从 z-opc-main-starter-frontend/src/pages/task/project/ProjectList.jsx 迁入).
|
|
16
|
+
*
|
|
17
|
+
* Props:
|
|
18
|
+
* - apiBaseURL?: string 后端 baseURL, 默认 '/api'
|
|
19
|
+
*/
|
|
20
|
+
export default function ProjectList({apiBaseURL}) {
|
|
21
|
+
const [projects, setProjects] = useState([])
|
|
22
|
+
const [loading, setLoading] = useState(false)
|
|
23
|
+
const [editDrawerOpen, setEditDrawerOpen] = useState(false)
|
|
24
|
+
const [editing, setEditing] = useState(null)
|
|
25
|
+
const [viewing, setViewing] = useState(null)
|
|
26
|
+
const [tasks, setTasks] = useState([])
|
|
27
|
+
const [tasksLoading, setTasksLoading] = useState(false)
|
|
28
|
+
const [form] = Form.useForm()
|
|
29
|
+
|
|
30
|
+
const load = async () => {
|
|
31
|
+
setLoading(true)
|
|
32
|
+
try {
|
|
33
|
+
const res = await taskApi.listMyProjects()
|
|
34
|
+
setProjects(res?.data || res || [])
|
|
35
|
+
} catch (e) {
|
|
36
|
+
message.error('加载项目失败: ' + (e?.message || e))
|
|
37
|
+
} finally {
|
|
38
|
+
setLoading(false)
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
useEffect(() => { load() }, [])
|
|
43
|
+
|
|
44
|
+
const onViewProject = async (row) => {
|
|
45
|
+
setViewing(row)
|
|
46
|
+
setTasksLoading(true)
|
|
47
|
+
try {
|
|
48
|
+
const res = await taskApi.listTasksByProject(row.id)
|
|
49
|
+
setTasks(res?.data || res || [])
|
|
50
|
+
} catch (e) {
|
|
51
|
+
message.error('加载任务失败: ' + (e?.message || e))
|
|
52
|
+
} finally {
|
|
53
|
+
setTasksLoading(false)
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const refreshTasks = async () => {
|
|
58
|
+
if (!viewing) return
|
|
59
|
+
try {
|
|
60
|
+
const res = await taskApi.listTasksByProject(viewing.id)
|
|
61
|
+
setTasks(res?.data || res || [])
|
|
62
|
+
} catch (e) {
|
|
63
|
+
message.error('刷新任务失败: ' + (e?.message || e))
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
const onCreate = () => {
|
|
68
|
+
setEditing(null)
|
|
69
|
+
form.resetFields()
|
|
70
|
+
form.setFieldsValue({status: 1})
|
|
71
|
+
setEditDrawerOpen(true)
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const onEdit = (row) => {
|
|
75
|
+
setEditing(row)
|
|
76
|
+
form.setFieldsValue({name: row.name, description: row.description, status: row.status ?? 1})
|
|
77
|
+
setEditDrawerOpen(true)
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
const onSubmit = async () => {
|
|
81
|
+
try {
|
|
82
|
+
const values = await form.validateFields()
|
|
83
|
+
if (editing) {
|
|
84
|
+
await taskApi.updateProject(editing.id, values)
|
|
85
|
+
message.success('项目已更新')
|
|
86
|
+
} else {
|
|
87
|
+
await taskApi.createProject(values)
|
|
88
|
+
message.success('项目已创建')
|
|
89
|
+
}
|
|
90
|
+
setEditDrawerOpen(false)
|
|
91
|
+
load()
|
|
92
|
+
} catch (e) {
|
|
93
|
+
if (e?.errorFields) return
|
|
94
|
+
message.error('保存失败: ' + (e?.message || e))
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
const onArchive = async (id) => {
|
|
99
|
+
try {
|
|
100
|
+
await taskApi.archiveProject(id)
|
|
101
|
+
message.success('项目已归档')
|
|
102
|
+
load()
|
|
103
|
+
if (viewing?.id === id) {
|
|
104
|
+
setViewing(null)
|
|
105
|
+
setTasks([])
|
|
106
|
+
}
|
|
107
|
+
} catch (e) {
|
|
108
|
+
message.error('归档失败: ' + (e?.message || e))
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
const onCompleteTask = async (id) => {
|
|
113
|
+
try {
|
|
114
|
+
await taskApi.completeTask(id)
|
|
115
|
+
message.success('任务已完成')
|
|
116
|
+
refreshTasks()
|
|
117
|
+
} catch (e) {
|
|
118
|
+
message.error('操作失败: ' + (e?.message || e))
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
const listColumns = [
|
|
123
|
+
{
|
|
124
|
+
title: '项目名称', dataIndex: 'name',
|
|
125
|
+
render: (text, row) => (
|
|
126
|
+
<a
|
|
127
|
+
onClick={() => onViewProject(row)}
|
|
128
|
+
style={{fontWeight: viewing?.id === row.id ? 600 : 400}}
|
|
129
|
+
>
|
|
130
|
+
{text}
|
|
131
|
+
</a>
|
|
132
|
+
),
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
title: '状态', dataIndex: 'status', width: 80,
|
|
136
|
+
render: (s) => s === 1 ? <Tag color="green">进行中</Tag> : <Tag>已归档</Tag>,
|
|
137
|
+
},
|
|
138
|
+
{title: '创建时间', dataIndex: 'createdAt', width: 170, render: formatDateTime},
|
|
139
|
+
{
|
|
140
|
+
title: '操作', width: 160, fixed: 'right',
|
|
141
|
+
render: (_, row) => (
|
|
142
|
+
<Space>
|
|
143
|
+
<Button size="small" icon={<EditOutlined/>} onClick={() => onEdit(row)}>编辑</Button>
|
|
144
|
+
<Popconfirm title="确定归档该项目?" onConfirm={() => onArchive(row.id)}>
|
|
145
|
+
<Button size="small" danger icon={<DeleteOutlined/>}>归档</Button>
|
|
146
|
+
</Popconfirm>
|
|
147
|
+
</Space>
|
|
148
|
+
),
|
|
149
|
+
},
|
|
150
|
+
]
|
|
151
|
+
|
|
152
|
+
const renderStatusTag = (s) => {
|
|
153
|
+
const map = {0: {text: '待办', color: 'default'}, 1: {text: '进行中', color: 'blue'}, 2: {text: '已完成', color: 'green'}}
|
|
154
|
+
const cfg = map[s] || {text: String(s), color: 'default'}
|
|
155
|
+
return <Tag color={cfg.color}>{cfg.text}</Tag>
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
return (
|
|
159
|
+
<div>
|
|
160
|
+
<div style={{display: 'flex', justifyContent: 'flex-end', marginBottom: 12}}>
|
|
161
|
+
<Button type="primary" icon={<PlusOutlined/>} onClick={onCreate}>新建项目</Button>
|
|
162
|
+
</div>
|
|
163
|
+
|
|
164
|
+
<div style={{display: 'flex', gap: 16, height: 'calc(100vh - 220px)'}}>
|
|
165
|
+
<Card
|
|
166
|
+
size="small"
|
|
167
|
+
title={<Space><InboxOutlined/>项目管理</Space>}
|
|
168
|
+
style={{width: 520, flexShrink: 0}}
|
|
169
|
+
styles={{body: {padding: 8, overflow: 'auto', height: 'calc(100% - 40px)'}}}
|
|
170
|
+
>
|
|
171
|
+
<Table
|
|
172
|
+
rowKey="id"
|
|
173
|
+
columns={listColumns}
|
|
174
|
+
dataSource={projects}
|
|
175
|
+
loading={loading}
|
|
176
|
+
pagination={{pageSize: 10, size: 'small'}}
|
|
177
|
+
size="small"
|
|
178
|
+
rowClassName={(row) => viewing?.id === row.id ? 'ant-table-row-selected' : ''}
|
|
179
|
+
onRow={(row) => ({onClick: () => onViewProject(row), style: {cursor: 'pointer'}})}
|
|
180
|
+
locale={{emptyText: '暂无项目'}}
|
|
181
|
+
/>
|
|
182
|
+
</Card>
|
|
183
|
+
|
|
184
|
+
<Card
|
|
185
|
+
size="small"
|
|
186
|
+
style={{flex: 1, overflow: 'auto'}}
|
|
187
|
+
styles={{body: {padding: 16}}}
|
|
188
|
+
title={
|
|
189
|
+
viewing ? (
|
|
190
|
+
<Space>
|
|
191
|
+
<UnorderedListOutlined/>
|
|
192
|
+
{viewing.name} · 任务列表
|
|
193
|
+
</Space>
|
|
194
|
+
) : '项目详情'
|
|
195
|
+
}
|
|
196
|
+
>
|
|
197
|
+
{!viewing ? (
|
|
198
|
+
<Empty description="请从左侧选择一个项目" style={{marginTop: 80}}/>
|
|
199
|
+
) : (
|
|
200
|
+
<Spin spinning={tasksLoading}>
|
|
201
|
+
<Descriptions size="small" bordered column={2} style={{marginBottom: 16}}>
|
|
202
|
+
<Descriptions.Item label="项目名称" span={2}>{viewing.name}</Descriptions.Item>
|
|
203
|
+
<Descriptions.Item label="描述" span={2}>
|
|
204
|
+
{viewing.description || '无'}
|
|
205
|
+
</Descriptions.Item>
|
|
206
|
+
<Descriptions.Item label="负责人">{viewing.ownerId || '未指定'}</Descriptions.Item>
|
|
207
|
+
<Descriptions.Item label="状态">
|
|
208
|
+
{viewing.status === 1
|
|
209
|
+
? <Tag color="green">进行中</Tag>
|
|
210
|
+
: <Tag>已归档</Tag>}
|
|
211
|
+
</Descriptions.Item>
|
|
212
|
+
<Descriptions.Item label="创建时间">{formatDateTime(viewing.createdAt)}</Descriptions.Item>
|
|
213
|
+
<Descriptions.Item label="项目ID">{viewing.id}</Descriptions.Item>
|
|
214
|
+
</Descriptions>
|
|
215
|
+
|
|
216
|
+
<List
|
|
217
|
+
size="small"
|
|
218
|
+
header={<b>任务项 ({tasks.length})</b>}
|
|
219
|
+
bordered
|
|
220
|
+
dataSource={tasks}
|
|
221
|
+
locale={{emptyText: '该项目下暂无任务'}}
|
|
222
|
+
renderItem={(item) => (
|
|
223
|
+
<List.Item
|
|
224
|
+
actions={[
|
|
225
|
+
<Button
|
|
226
|
+
key="complete"
|
|
227
|
+
size="small"
|
|
228
|
+
type="primary"
|
|
229
|
+
icon={<CheckOutlined/>}
|
|
230
|
+
disabled={item.status === 2}
|
|
231
|
+
onClick={() => onCompleteTask(item.id)}
|
|
232
|
+
>
|
|
233
|
+
完成
|
|
234
|
+
</Button>,
|
|
235
|
+
]}
|
|
236
|
+
>
|
|
237
|
+
<List.Item.Meta
|
|
238
|
+
title={
|
|
239
|
+
<Space>
|
|
240
|
+
{item.title}
|
|
241
|
+
{renderStatusTag(item.status)}
|
|
242
|
+
<Tag>优先级 {item.priority ?? '-'}</Tag>
|
|
243
|
+
</Space>
|
|
244
|
+
}
|
|
245
|
+
description={
|
|
246
|
+
<span style={{color: '#888', fontSize: 12}}>
|
|
247
|
+
截止: {formatDateTime(item.dueDate)} · ID: {item.id}
|
|
248
|
+
</span>
|
|
249
|
+
}
|
|
250
|
+
/>
|
|
251
|
+
</List.Item>
|
|
252
|
+
)}
|
|
253
|
+
/>
|
|
254
|
+
</Spin>
|
|
255
|
+
)}
|
|
256
|
+
</Card>
|
|
257
|
+
</div>
|
|
258
|
+
|
|
259
|
+
<Drawer
|
|
260
|
+
title={editing ? `编辑项目 - ${editing.name}` : '新建项目'}
|
|
261
|
+
width={480}
|
|
262
|
+
open={editDrawerOpen}
|
|
263
|
+
onClose={() => setEditDrawerOpen(false)}
|
|
264
|
+
destroyOnHidden
|
|
265
|
+
extra={
|
|
266
|
+
<Space>
|
|
267
|
+
<Button onClick={() => setEditDrawerOpen(false)}>取消</Button>
|
|
268
|
+
<Button type="primary" onClick={onSubmit}>保存</Button>
|
|
269
|
+
</Space>
|
|
270
|
+
}
|
|
271
|
+
>
|
|
272
|
+
<Form form={form} layout="vertical" preserve={false}>
|
|
273
|
+
<Form.Item name="name" label="项目名称" rules={[{required: true, message: '请输入项目名称'}]}>
|
|
274
|
+
<Input placeholder="例如: 一人公司"/>
|
|
275
|
+
</Form.Item>
|
|
276
|
+
<Form.Item name="description" label="项目描述">
|
|
277
|
+
<Input.TextArea rows={3} placeholder="可选"/>
|
|
278
|
+
</Form.Item>
|
|
279
|
+
<Form.Item name="status" label="状态" initialValue={1}>
|
|
280
|
+
<Select
|
|
281
|
+
options={[
|
|
282
|
+
{label: '进行中', value: 1},
|
|
283
|
+
{label: '已归档', value: 0},
|
|
284
|
+
]}
|
|
285
|
+
/>
|
|
286
|
+
</Form.Item>
|
|
287
|
+
</Form>
|
|
288
|
+
</Drawer>
|
|
289
|
+
</div>
|
|
290
|
+
)
|
|
291
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import {Navigate, Route, Routes} from 'react-router-dom'
|
|
2
|
+
import ProjectList from './ProjectList'
|
|
3
|
+
import TaskList from './TaskList'
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* 任务中心 (从 z-opc-main-starter-frontend/src/pages/task/index.jsx 迁入).
|
|
7
|
+
*
|
|
8
|
+
* 路由: /task/project, /task/task (保持与原前端一致, 兼容菜单 key)
|
|
9
|
+
*/
|
|
10
|
+
export default function TaskApp() {
|
|
11
|
+
return (
|
|
12
|
+
<Routes>
|
|
13
|
+
<Route index element={<Navigate to="project" replace/>}/>
|
|
14
|
+
<Route path="project" element={<ProjectList/>}/>
|
|
15
|
+
<Route path="project/*" element={<ProjectList/>}/>
|
|
16
|
+
<Route path="task" element={<TaskList/>}/>
|
|
17
|
+
<Route path="task/*" element={<TaskList/>}/>
|
|
18
|
+
</Routes>
|
|
19
|
+
)
|
|
20
|
+
}
|