Spaces:
Running
Running
File size: 22,028 Bytes
b65c314 |
1 2 3 4 5 6 7 8 9 10 |
import{r as u,R as E,j as v,a as M,F as fe,w as $e}from"./index.2b3b4b39.js";import{i as de,a as me,_ as Oe,b as Ae,c as Ie,d as re,e as pe,u as Me,f as _e,g as Te,h as j,m as he,j as Q,k as Re,w as te,l as R,n as I,S as Ne,o as ve,p as je,q as Be,r as We,s as ge,B as Pe,I as ze}from"./index.ece07dcd.js";import{a as De,r as ye,b as Ce}from"./axios.1fa0e28b.js";import"./utils.62547028.js";function ne(e){de&&(me(e)||console.error("useMemoizedFn expected parameter is a function, got ".concat(typeof e)));var r=u.exports.useRef(e);r.current=u.exports.useMemo(function(){return e},[e]);var t=u.exports.useRef();return t.current||(t.current=function(){for(var i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];return r.current.apply(this,i)}),t.current}var Ue=Oe,Ke=function(){return Ue.Date.now()},Ve=Ke,Ze=/\s/;function He(e){for(var r=e.length;r--&&Ze.test(e.charAt(r)););return r}var Xe=He,qe=Xe,Ge=/^\s+/;function Je(e){return e&&e.slice(0,qe(e)+1).replace(Ge,"")}var Qe=Je,Ye=Ae,et=Ie,tt="[object Symbol]";function rt(e){return typeof e=="symbol"||et(e)&&Ye(e)==tt}var nt=rt,it=Qe,se=re,at=nt,le=0/0,ot=/^[-+]0x[0-9a-f]+$/i,st=/^0b[01]+$/i,lt=/^0o[0-7]+$/i,ct=parseInt;function ut(e){if(typeof e=="number")return e;if(at(e))return le;if(se(e)){var r=typeof e.valueOf=="function"?e.valueOf():e;e=se(r)?r+"":r}if(typeof e!="string")return e===0?e:+e;e=it(e);var t=st.test(e);return t||lt.test(e)?ct(e.slice(2),t?2:8):ot.test(e)?le:+e}var ft=ut,dt=re,Y=Ve,ce=ft,mt="Expected a function",pt=Math.max,ht=Math.min;function vt(e,r,t){var i,a,o,g,s,f,y=0,l=!1,C=!1,x=!0;if(typeof e!="function")throw new TypeError(mt);r=ce(r)||0,dt(t)&&(l=!!t.leading,C="maxWait"in t,o=C?pt(ce(t.maxWait)||0,r):o,x="trailing"in t?!!t.trailing:x);function n(m){var b=i,k=a;return i=a=void 0,y=m,g=e.apply(k,b),g}function c(m){return y=m,s=setTimeout(O,r),l?n(m):g}function F(m){var b=m-f,k=m-y,A=r-b;return C?ht(A,o-k):A}function S(m){var b=m-f,k=m-y;return f===void 0||b>=r||b<0||C&&k>=o}function O(){var m=Y();if(S(m))return $(m);s=setTimeout(O,F(m))}function $(m){return s=void 0,x&&i?n(m):(i=a=void 0,g)}function _(){s!==void 0&&clearTimeout(s),y=0,i=f=a=s=void 0}function d(){return s===void 0?g:$(Y())}function h(){var m=Y(),b=S(m);if(i=arguments,a=this,f=m,b){if(s===void 0)return c(f);if(C)return clearTimeout(s),s=setTimeout(O,r),n(f)}return s===void 0&&(s=setTimeout(O,r)),g}return h.cancel=_,h.flush=d,h}var gt=vt,yt=gt,Ct=re,bt="Expected a function";function xt(e,r,t){var i=!0,a=!0;if(typeof e!="function")throw new TypeError(bt);return Ct(t)&&(i="leading"in t?!!t.leading:i,a="trailing"in t?!!t.trailing:a),yt(e,r,{leading:i,maxWait:r,trailing:a})}var wt=xt,Lt=function(){var e=pe(u.exports.useState({}),2),r=e[1];return u.exports.useCallback(function(){return r({})},[])},kt=Lt;function Ft(e,r){var t;de&&(me(e)||console.error("useThrottleFn expected parameter is a function, got ".concat(typeof e)));var i=Me(e),a=(t=r==null?void 0:r.wait)!==null&&t!==void 0?t:1e3,o=u.exports.useMemo(function(){return wt(function(){for(var g=[],s=0;s<arguments.length;s++)g[s]=arguments[s];return i.current.apply(i,Te([],pe(g),!1))},a,r)},[]);return _e(function(){o.cancel()}),{run:o,cancel:o.cancel,flush:o.flush}}function St(e){return u.exports.createElement("svg",Object.assign({width:"1em",height:"1em",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e,{style:Object.assign({verticalAlign:"-0.125em"},e.style),className:["antd-mobile-icon",e.className].filter(Boolean).join(" ")}),u.exports.createElement("g",{id:"ArrowsAltOutline-ArrowsAltOutline",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},u.exports.createElement("g",{id:"ArrowsAltOutline-\u7F16\u7EC4"},u.exports.createElement("rect",{id:"ArrowsAltOutline-\u77E9\u5F62",fill:"#FFFFFF",opacity:0,x:0,y:0,width:48,height:48}),u.exports.createElement("path",{d:"M27.54027,25.4192995 L37.9992424,35.878922 L37.9992424,35.878922 L37.9999293,26.5005854 C37.9999455,26.2796715 38.1790447,26.1005985 38.3999586,26.1006147 C38.506035,26.1006225 38.6077646,26.1427646 38.682772,26.217772 L40.8828427,28.4178427 C40.9578573,28.4928573 41,28.5945988 41,28.7006854 L41,38.0000814 L41,38.0000814 C41,39.5977189 39.7511139,40.9036635 38.1763494,40.9949074 L38.0000214,41 L28.7016885,41 C28.5956001,41 28.4938569,40.9578558 28.4188421,40.882839 L26.2188213,38.6827611 C26.0626136,38.5265493 26.0626169,38.2732833 26.2188286,38.1170756 C26.2938429,38.0420633 26.3955829,37.999922 26.5016677,37.999922 L35.8782424,37.999922 L35.8782424,37.999922 L25.4189935,27.540576 C25.2627863,27.3843648 25.2627869,27.1310998 25.4189948,26.9748893 L26.9745934,25.4192907 C27.1307943,25.2630722 27.3840603,25.2630722 27.54027,25.4192819 C27.5402729,25.4192848 27.5402759,25.4192878 27.54027,25.4192995 Z M19.5801734,7.11717343 L21.78015,9.31715001 C21.9363597,9.47335972 21.9363597,9.72662572 21.78015,9.88283543 C21.7051347,9.95785072 21.6033919,9.99999352 21.4973043,9.99999272 L12.1212424,9.99992204 L12.1212424,9.99992204 L22.5812531,20.4603418 C22.7374521,20.6165579 22.7374496,20.8698197 22.5812476,21.0260328 L21.025649,22.5816313 C20.8694312,22.7378225 20.6161755,22.7378285 20.4599503,22.5816447 L9.9992424,12.121922 L9.9992424,12.121922 L9.99992925,21.4981366 C9.99994543,21.7190505 9.82087245,21.8981497 9.59995855,21.8981659 C9.49386181,21.8981736 9.39210827,21.8560303 9.31708654,21.7810086 L7.11716153,19.5810836 C7.04214447,19.5060665 7.00000153,19.4043208 7.00000424,19.2982306 L7.0002424,10.0009006 L7.0002424,10.0009006 C7.0002424,8.40323116 8.24915346,7.09726047 9.82394948,7.00601469 L10.000221,7.00092204 L19.2972917,7.00001615 C19.4033918,7.00000581 19.5051493,7.04214933 19.5801734,7.11717343 Z",id:"ArrowsAltOutline-\u5F62\u72B6",fill:"currentColor",fillRule:"nonzero"}))))}function Et(e){return u.exports.createElement("svg",Object.assign({width:"1em",height:"1em",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e,{style:Object.assign({verticalAlign:"-0.125em"},e.style),className:["antd-mobile-icon",e.className].filter(Boolean).join(" ")}),u.exports.createElement("g",{id:"CloseCircleFill-CloseCircleFill",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},u.exports.createElement("g",{id:"CloseCircleFill-\u7F16\u7EC4"},u.exports.createElement("rect",{id:"CloseCircleFill-\u77E9\u5F62",fill:"#FFFFFF",opacity:0,x:0,y:0,width:48,height:48}),u.exports.createElement("path",{d:"M24,2 C36.1502645,2 46,11.8497355 46,24 C46,36.1502645 36.1502645,46 24,46 C11.8497355,46 2,36.1502645 2,24 C2,11.8497355 11.8497355,2 24,2 Z M18.6753876,16 L15.5637812,16 C15.4576916,16 15.3559474,16.0421451 15.2809323,16.1171635 C15.124726,16.2733766 15.1247316,16.5266426 15.2809447,16.6828489 L15.2809447,16.6828489 L22.299066,23.7006641 L14.6828159,31.3171619 C14.6078042,31.3921761 14.5656632,31.4939157 14.5656632,31.6 C14.5656632,31.8209139 14.7447493,32 14.9656632,32 L14.9656632,32 L18.0753284,32 C18.1814068,32 18.2831412,31.9578638 18.3581544,31.8828594 L18.3581544,31.8828594 L24.420066,25.8216641 L30.4818451,31.8828564 C30.5568585,31.9578626 30.6585942,32 30.7646741,32 L30.7646741,32 L33.8763476,32 C33.9824309,32 34.0841695,31.9578599 34.1591835,31.8828496 C34.315397,31.7266436 34.3154031,31.4733776 34.1591972,31.3171641 L34.1591972,31.3171641 L26.542066,23.6996641 L33.5591874,16.6828489 C33.6342057,16.6078338 33.6763508,16.5060896 33.6763508,16.4 C33.6763508,16.1790861 33.4972647,16 33.2763508,16 L33.2763508,16 L30.1637654,16 C30.0576705,16 29.9559218,16.0421493 29.8809058,16.1171741 L29.8809058,16.1171741 L24.420066,21.5786641 L18.9582218,16.1171488 C18.883208,16.0421394 18.7814701,16 18.6753876,16 L18.6753876,16 Z",id:"CloseCircleFill-\u5F62\u72B6\u7ED3\u5408",fill:"currentColor",fillRule:"nonzero"}))))}function $t(e){return u.exports.createElement("svg",Object.assign({width:"1em",height:"1em",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e,{style:Object.assign({verticalAlign:"-0.125em"},e.style),className:["antd-mobile-icon",e.className].filter(Boolean).join(" ")}),u.exports.createElement("g",{id:"UpCircleOutline-UpCircleOutline",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},u.exports.createElement("g",{id:"UpCircleOutline-\u7F16\u7EC4"},u.exports.createElement("rect",{id:"UpCircleOutline-\u77E9\u5F62",fill:"#FFFFFF",opacity:0,x:0,y:0,width:48,height:48}),u.exports.createElement("path",{d:"M24,2 C36.1502645,2 46,11.8497355 46,24 C46,36.1502645 36.1502645,46 24,46 C11.8497355,46 2,36.1502645 2,24 C2,11.8497355 11.8497355,2 24,2 Z M24,5 C13.5065898,5 5,13.5065898 5,24 C5,34.4934102 13.5065898,43 24,43 C34.4934102,43 43,34.4934102 43,24 C43,13.5065898 34.4934102,5 24,5 Z M24.6342571,17.9537046 C24.9541516,17.9465077 25.2763361,18.0411018 25.5483174,18.2386679 L25.6798814,18.3460374 L32.8698331,24.9163737 C32.952761,24.992155 33,25.0993153 33,25.2116534 L33,28.1878801 C33,28.408794 32.8209139,28.5878801 32.6,28.5878801 C32.5001308,28.5878801 32.403874,28.5505211 32.3301537,28.4831477 L24.614,21.431323 L24.614,21.431323 L16.6698394,28.6911828 C16.5067641,28.840211 16.2537542,28.8288236 16.1047261,28.6657483 C16.0373566,28.5920287 16,28.4957749 16,28.3959089 L16,25.4196582 C16,25.3073173 16.0472414,25.2001546 16.1301729,25.124373 L23.5480406,18.3460374 L23.5480406,18.3460374 C23.8119743,18.1048436 24.1396674,17.9752317 24.4720765,17.9558732 L24.6342571,17.9537046 Z",id:"UpCircleOutline-\u5F62\u72B6",fill:"currentColor",fillRule:"nonzero"}))))}function be(e){const{value:r,defaultValue:t,onChange:i}=e,a=kt(),o=u.exports.useRef(r!==void 0?r:t);r!==void 0&&(o.current=r);const g=ne((s,f=!1)=>{const y=typeof s=="function"?s(o.current):s;if(!(!f&&y===o.current))return o.current=y,a(),i==null?void 0:i(y)});return[o.current,g]}function Ot(e,r){const t=ne(e);j(()=>{const i=r.current;if(!!i)if(window.ResizeObserver){let a;const o=new ResizeObserver(()=>{a=window.requestAnimationFrame(()=>t(i))});return o.observe(i),()=>{window.cancelAnimationFrame(a),o.disconnect()}}else t(i)},[r])}function At(e,r,t){const i=ne(e);u.exports.useEffect(()=>{const a=new MutationObserver(()=>{i()});if(!!r.current)return a.observe(r.current,t),()=>{a.disconnect()}},[r])}var xe={exports:{}},p={};/**
* @license React
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var ie=Symbol.for("react.element"),ae=Symbol.for("react.portal"),B=Symbol.for("react.fragment"),W=Symbol.for("react.strict_mode"),P=Symbol.for("react.profiler"),z=Symbol.for("react.provider"),D=Symbol.for("react.context"),It=Symbol.for("react.server_context"),U=Symbol.for("react.forward_ref"),K=Symbol.for("react.suspense"),V=Symbol.for("react.suspense_list"),Z=Symbol.for("react.memo"),H=Symbol.for("react.lazy"),Mt=Symbol.for("react.offscreen"),we;we=Symbol.for("react.module.reference");function L(e){if(typeof e=="object"&&e!==null){var r=e.$$typeof;switch(r){case ie:switch(e=e.type,e){case B:case P:case W:case K:case V:return e;default:switch(e=e&&e.$$typeof,e){case It:case D:case U:case H:case Z:case z:return e;default:return r}}case ae:return r}}}p.ContextConsumer=D;p.ContextProvider=z;p.Element=ie;p.ForwardRef=U;p.Fragment=B;p.Lazy=H;p.Memo=Z;p.Portal=ae;p.Profiler=P;p.StrictMode=W;p.Suspense=K;p.SuspenseList=V;p.isAsyncMode=function(){return!1};p.isConcurrentMode=function(){return!1};p.isContextConsumer=function(e){return L(e)===D};p.isContextProvider=function(e){return L(e)===z};p.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===ie};p.isForwardRef=function(e){return L(e)===U};p.isFragment=function(e){return L(e)===B};p.isLazy=function(e){return L(e)===H};p.isMemo=function(e){return L(e)===Z};p.isPortal=function(e){return L(e)===ae};p.isProfiler=function(e){return L(e)===P};p.isStrictMode=function(e){return L(e)===W};p.isSuspense=function(e){return L(e)===K};p.isSuspenseList=function(e){return L(e)===V};p.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===B||e===P||e===W||e===K||e===V||e===Mt||typeof e=="object"&&e!==null&&(e.$$typeof===H||e.$$typeof===Z||e.$$typeof===z||e.$$typeof===D||e.$$typeof===U||e.$$typeof===we||e.getModuleId!==void 0)};p.typeOf=L;xe.exports=p;function _t(e,r){let t=0;function i(a){E.Children.forEach(a,o=>{xe.exports.isFragment(o)?i(o.props.children):(r(o,t),t+=1)})}i(e)}const w="adm-tabs",Tt=()=>null,Rt={activeLineMode:"auto",stretch:!0},Nt=e=>{var r;const t=he(Rt,e),i=u.exports.useRef(null),a=u.exports.useRef(null),o={};let g=null;const s=[];_t(t.children,(d,h)=>{if(!E.isValidElement(d))return;const m=d.key;if(typeof m!="string")return;h===0&&(g=m);const b=s.push(d);o[m]=b-1});const[f,y]=be({value:t.activeKey,defaultValue:(r=t.defaultActiveKey)!==null&&r!==void 0?r:g,onChange:d=>{var h;d!==null&&((h=t.onChange)===null||h===void 0||h.call(t,d))}}),[{x:l,width:C},x]=Q(()=>({x:0,width:0,config:{tension:300,clamp:!0}})),[{scrollLeft:n},c]=Q(()=>({scrollLeft:0,config:{tension:300,clamp:!0}})),[{leftMaskOpacity:F,rightMaskOpacity:S},O]=Q(()=>({leftMaskOpacity:0,rightMaskOpacity:0,config:{clamp:!0}}));function $(d=!1){const h=i.current;if(!h)return;const m=o[f];if(m===void 0){x.start({x:0,width:0,immediate:!0});return}const b=a.current;if(!b)return;const k=h.children.item(m+1),A=k.children.item(0),X=A.offsetLeft,q=A.offsetWidth,Le=k.offsetLeft,ke=k.offsetWidth,G=h.offsetWidth,oe=h.scrollWidth,Fe=h.scrollLeft,Se=b.offsetWidth;let T=0,J=0;if(t.activeLineMode==="auto"?(T=X,J=q):t.activeLineMode==="full"?(T=Le,J=ke):T=X+(q-Se)/2,x.start({x:T,width:J,immediate:d}),oe-G<=0)return;const Ee=ve(X-(G-q)/2,0,oe-G);c.start({scrollLeft:Ee,from:{scrollLeft:Fe},immediate:d})}j(()=>{$(!l.isAnimating)},[]),Re(()=>{$()},[f]),Ot(()=>{$(!l.isAnimating)},i),At(()=>{$(!l.isAnimating)},i,{subtree:!0,childList:!0,characterData:!0});const{run:_}=Ft((d=!1)=>{const h=i.current;if(!h)return;const m=h.scrollLeft,b=m>0,k=m+h.offsetWidth<h.scrollWidth;O.start({leftMaskOpacity:b?1:0,rightMaskOpacity:k?1:0,immediate:d})},{wait:100,trailing:!0,leading:!0});return j(()=>{_(!0)},[]),te(t,E.createElement("div",{className:w},E.createElement("div",{className:`${w}-header`},E.createElement(R.div,{className:I(`${w}-header-mask`,`${w}-header-mask-left`),style:{opacity:F}}),E.createElement(R.div,{className:I(`${w}-header-mask`,`${w}-header-mask-right`),style:{opacity:S}}),E.createElement(R.div,{className:`${w}-tab-list`,ref:i,scrollLeft:n,onScroll:_,role:"tablist"},E.createElement(R.div,{ref:a,className:`${w}-tab-line`,style:{width:t.activeLineMode==="fixed"?"var(--fixed-active-line-width, 30px)":C,x:l}}),s.map(d=>te(d.props,v("div",{className:I(`${w}-tab-wrapper`,{[`${w}-tab-wrapper-stretch`]:t.stretch}),children:v("div",{onClick:()=>{const{key:h}=d;d.props.disabled||h!=null&&y(h.toString())},className:I(`${w}-tab`,{[`${w}-tab-active`]:d.key===f,[`${w}-tab-disabled`]:d.props.disabled}),role:"tab","aria-selected":d.key===f,children:d.props.title})},d.key))))),s.map(d=>{if(d.props.children===void 0)return null;const h=d.key===f;return v(Ne,{active:h,forceRender:d.props.forceRender,destroyOnClose:d.props.destroyOnClose,children:v("div",{className:`${w}-content`,style:{display:h?"block":"none"},children:d.props.children})},d.key)})))};var ee=je(Nt,{Tab:Tt});const N="adm-input",jt={defaultValue:"",onlyShowClearWhenFocus:!0},Bt=u.exports.forwardRef((e,r)=>{const t=he(jt,e),[i,a]=be(t),[o,g]=u.exports.useState(!1),s=u.exports.useRef(!1),f=u.exports.useRef(null),{locale:y}=Be();u.exports.useImperativeHandle(r,()=>({clear:()=>{a("")},focus:()=>{var n;(n=f.current)===null||n===void 0||n.focus()},blur:()=>{var n;(n=f.current)===null||n===void 0||n.blur()},get nativeElement(){return f.current}}));const l=n=>{var c;t.onEnterPress&&(n.code==="Enter"||n.keyCode===13)&&t.onEnterPress(n),(c=t.onKeyDown)===null||c===void 0||c.call(t,n)};j(()=>{var n;if(!!t.enterKeyHint)return(n=f.current)===null||n===void 0||n.setAttribute("enterkeyhint",t.enterKeyHint),()=>{var c;(c=f.current)===null||c===void 0||c.removeAttribute("enterkeyhint")}},[t.enterKeyHint]);function C(){let n=i;t.type==="number"&&(n=n&&ve(parseFloat(n),t.min,t.max).toString()),n!==i&&a(n)}const x=(()=>!t.clearable||!i||t.readOnly?!1:t.onlyShowClearWhenFocus?o:!0)();return te(t,M("div",{className:I(`${N}`,t.disabled&&`${N}-disabled`),children:[v("input",{ref:f,className:`${N}-element`,value:i,onChange:n=>{a(n.target.value)},onFocus:n=>{var c;g(!0),(c=t.onFocus)===null||c===void 0||c.call(t,n)},onBlur:n=>{var c;g(!1),C(),(c=t.onBlur)===null||c===void 0||c.call(t,n)},id:t.id,placeholder:t.placeholder,disabled:t.disabled,readOnly:t.readOnly,maxLength:t.maxLength,minLength:t.minLength,max:t.max,min:t.min,autoComplete:t.autoComplete,autoFocus:t.autoFocus,pattern:t.pattern,inputMode:t.inputMode,type:t.type,name:t.name,autoCapitalize:t.autoCapitalize,autoCorrect:t.autoCorrect,onKeyDown:l,onKeyUp:t.onKeyUp,onCompositionStart:n=>{var c;s.current=!0,(c=t.onCompositionStart)===null||c===void 0||c.call(t,n)},onCompositionEnd:n=>{var c;s.current=!1,(c=t.onCompositionEnd)===null||c===void 0||c.call(t,n)},onClick:t.onClick,step:t.step,role:t.role,"aria-valuenow":t["aria-valuenow"],"aria-valuemax":t["aria-valuemax"],"aria-valuemin":t["aria-valuemin"],"aria-label":t["aria-label"]}),x&&v("div",{className:`${N}-clear`,onMouseDown:n=>{n.preventDefault()},onClick:()=>{var n,c;a(""),(n=t.onClear)===null||n===void 0||n.call(t),We()&&s.current&&(s.current=!1,(c=f.current)===null||c===void 0||c.blur())},"aria-label":y.Input.clear,children:v(Et,{})})]}))});var Wt=Bt;const Pt=e=>{const r={url:"https://wef4y-chat-js-server.hf.space/api/chat",data:{input:e},header:{Authorization:"Bearer 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"}};return De.post(r.url,r.data,{timeout:3e7,headers:{"Content-Type":"application/json;charset=UTF-8","with-credentials":!0,...r.header}})};function zt(){const[e,r]=u.exports.useState([]),[t,i]=u.exports.useState(""),a=()=>{t!==""&&(r([...e,{type:"0",value:t}]),i(""),Pt(t).then(o=>{console.log("chat",o.data),r([...e,{type:"1",value:o.data}])}))};return v(fe,{children:M("div",{className:"chat-container",children:[e&&e.map(o=>v("div",{className:o.type==="0"?"chat-container-msg-content-right":"chat-container-msg-content-left",children:v("div",{className:"chat-container-msg",children:o.value})})),v("div",{className:"chat-container-input",children:M(ge,{wrap:!0,children:[v(Wt,{placeholder:"\u8F93\u5165\u6587\u5B57",value:t,onChange:o=>{i(o)},onEnterPress:a}),v(Pe,{onClick:a,children:v($t,{fontSize:24})})]})})]})})}const Dt=e=>{let r={url:Ce.searchURL,data:{engine:"baidu",q:e,api_key:"83df36ff90429072fcd39b47811df999a8ed942f4f2492225fe6a7f494a07935"}};return ye.get(r)},Ut=e=>{let r={url:`${Ce.itemFilterURL}/output-images/`,data:{populate:"images",["filters[item_id][$eq]"]:e},header:{Authorization:"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MSwiaWF0IjoxNjgwNDU1MTk2LCJleHAiOjE2ODMwNDcxOTZ9.aGgsBDn8uo5pxqINwms6doMU_EfF9rzkm96ZUsXuy0M"}};return ye.get(r)},Kt="A young lady is wearing a beige knit sweater, a black shirt, black suit pants and a black blazer for a professional yet soft look.",Vt="\u8FD9\u5957\u642D\u914D\u5145\u5206\u8003\u8651\u5230\u4E86\u5929\u6C14\u3001\u6E29\u5EA6\u3001\u5DE5\u4F5C\u573A\u666F\u548C\u67D4\u548C\u98CE\u683C\uFF0C\u5C55\u73B0\u4E86\u4F60\u7684\u4E2A\u6027\u548C\u54C1\u5473\u3002\u7C73\u8272\u9488\u7EC7\u6BDB\u8863\u5916\u642D\u767D\u8272\u886C\u886B\uFF0C\u6253\u9020\u6E29\u99A8\u67D4\u548C\u7684\u611F\u89C9\uFF0C\u540C\u65F6\u642D\u914D\u9ED1\u8272\u9AD8\u8170\u5BBD\u817F\u88E4\uFF0C\u5C55\u73B0\u804C\u573A\u4F18\u96C5\u6C14\u8D28\u3002\u5916\u642D\u4E00\u4EF6\u9ED1\u8272\u897F\u88C5\u5916\u5957\uFF0C\u4F7F\u6574\u4F53\u9020\u578B\u66F4\u52A0\u804C\u573A\u6B63\u5F0F\uFF0C\u53C8\u4E0D\u5931\u67D4\u548C\u98CE\u683C\u3002";var ue={description:Kt,explanation:Vt,"item in the closet":[{id:"white-t-shirt",item:"Beige knit sweater"},{id:"white-t-shirt",item:"Black blazer"}],"item not in the closet":["black shirt","black suit pants"]};function Zt(){const[e,r]=u.exports.useState([]),t=()=>new Promise((a,o)=>{const g=ue["item in the closet"].map(s=>Ut(s==null?void 0:s.id));Promise.all(g).then(s=>{const f=s.map(y=>{var x,n,c,F;const l=y==null?void 0:y.data[0],C={id:l==null?void 0:l.id,url:((F=(c=(n=(x=l==null?void 0:l.attributes)==null?void 0:x.images)==null?void 0:n.data[0])==null?void 0:c.attributes)==null?void 0:F.url)||"",from:"closet",link:""};return C.url=`http://106.52.238.44:8080${C.url}`,C});a(f)}).catch(s=>o(s))}),i=()=>{const a=ue["item not in the closet"].map(o=>Dt(o));return new Promise((o,g)=>{Promise.all(a).then(s=>{const f=[];s.forEach(y=>{var C,x,n,c,F;const l=y==null?void 0:y.organic_results[2];if(l){if(l!=null&&l.related_images){const S={id:((x=(C=l==null?void 0:l.related_images)==null?void 0:C[0])==null?void 0:x.link)||"",url:((c=(n=l==null?void 0:l.related_images)==null?void 0:n[0])==null?void 0:c.image)||"",from:"not closet",link:((F=l==null?void 0:l.related_images[0])==null?void 0:F.link)||""};f.push(S)}else if(l!=null&&l.thumbnail){const S={id:(l==null?void 0:l.link)||"",url:(l==null?void 0:l.thumbnail)||"",from:"not closet",link:(l==null?void 0:l.link)||""};f.push(S)}}}),o(f)}).catch(s=>g(s))})};return u.exports.useEffect(()=>{(async()=>{const o=await t(),g=await i();r([...e,...o,...g])})()},[]),v(fe,{children:v("div",{className:"search-container",children:v("div",{className:"search-container-image",children:v(ge,{wrap:!0,children:e.map(a=>v(ze,{src:a.url},a.id))})})})})}var Ht="./assets/defaultImage.6ddd0d30.png";function Xt(e){const[r,t]=u.exports.useState(Ht),[i,a]=u.exports.useState(!1);return u.exports.useEffect(()=>{},[]),M("div",{className:"home",style:{backgroundImage:`url(${r})`},children:[v(St,{fontSize:32,onClick:()=>a(!i)}),!i&&M(ee,{children:[v(ee.Tab,{title:"\u7A7F\u642D",children:v(zt,{})},"chat"),v(ee.Tab,{title:"\u5355\u54C1",children:v(Zt,{})},"recommend")]})]})}var er=$e(Xt);export{er as default};
|