import{n as e,s as t,t as n}from"./jsx-runtime-Bzw2jH9X.js";import{Ot as r,Pt as i,Qt as a,en as o,lt as s,zt as c}from"./services-Ddh4dHvP.js";import{i as l,t as u}from"./date-CTxYulDo.js";import{t as d}from"./spin-DUmNjrhn.js";import{t as f}from"./pagination-CvIkfoXb.js";import{t as p}from"./createLucideIcon-BkIMvJln.js";import{t as m}from"./arrow-right-BKCuK_oe.js";import{t as h}from"./calendar-CXtwVZ74.js";import{t as g}from"./chart-column-increasing-Btdnamvz.js";import{t as _}from"./chevron-up-Es8-Ld7o.js";import{t as v}from"./circle-check-big-EkF1HrxD.js";import{t as y}from"./InstitutionSelector-CYKTJmBR.js";import{t as ee}from"./rotate-ccw-zNFKfco9.js";import{t as b}from"./x-CkbzgTHo.js";import{t as te}from"./vip-CFqDioag.js";import{n as ne}from"./modalStore-B5-16H5z.js";import{n as re}from"./AuthContext-PSb2BBjo.js";import{$ as ie,B as ae,G as x,U as S,cn as oe,dt as se,et as ce,ft as le,gt as C,ht as ue,i as w,lt as T,q as E,st as D,tt as O,un as de,vt as k,x as fe}from"./index-DkcBoy_T.js";import{t as pe}from"./GeoSEO-CM_kwP_Q.js";import{t as me}from"./HotKeywords-BmcLHP91.js";import{t as he}from"./useCategory-DYXkQcDE.js";import{t as ge}from"./Button-CZzJ734d.js";import{n as A,r as _e,t as ve}from"./icon-pdf-Dqc8I27s.js";import{t as ye}from"./DateRangePicker-Cwwt0a-x.js";import{t as be}from"./useRequireAccess-TbIRdhhn.js";import{t as xe}from"./SearchModeToggle-Cpq-uZeO.js";var Se={name:`tag`,size:24,node:[[`path`,{d:`M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z`,key:`vktsd0`}],[`circle`,{cx:`7.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`kqv944`}]]};Se.node;var Ce=p(Se),we=typeof global==`object`&&global&&global.Object===Object&&global,Te=typeof self==`object`&&self&&self.Object===Object&&self,j=we||Te||Function(`return this`)(),M=j.Symbol,Ee=Object.prototype,De=Ee.hasOwnProperty,Oe=Ee.toString,N=M?M.toStringTag:void 0;function P(e){var t=De.call(e,N),n=e[N];try{e[N]=void 0;var r=!0}catch{}var i=Oe.call(e);return r&&(t?e[N]=n:delete e[N]),i}var ke=Object.prototype.toString;function Ae(e){return ke.call(e)}var je=`[object Null]`,Me=`[object Undefined]`,Ne=M?M.toStringTag:void 0;function F(e){return e==null?e===void 0?Me:je:Ne&&Ne in Object(e)?P(e):Ae(e)}function I(e){return typeof e==`object`&&!!e}var L=Array.isArray;function R(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}var Pe=`[object AsyncFunction]`,Fe=`[object Function]`,Ie=`[object GeneratorFunction]`,Le=`[object Proxy]`;function Re(e){if(!R(e))return!1;var t=F(e);return t==Fe||t==Ie||t==Pe||t==Le}var ze=j[`__core-js_shared__`],Be=function(){var e=/[^.]+$/.exec(ze&&ze.keys&&ze.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}();function Ve(e){return!!Be&&Be in e}var He=Function.prototype.toString;function z(e){if(e!=null){try{return He.call(e)}catch{}try{return e+``}catch{}}return``}var Ue=/[\\^$.*+?()[\]{}|]/g,We=/^\[object .+?Constructor\]$/,Ge=Function.prototype,Ke=Object.prototype,qe=Ge.toString,Je=Ke.hasOwnProperty,Ye=RegExp(`^`+qe.call(Je).replace(Ue,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`);function Xe(e){return!R(e)||Ve(e)?!1:(Re(e)?Ye:We).test(z(e))}function Ze(e,t){return e?.[t]}function B(e,t){var n=Ze(e,t);return Xe(n)?n:void 0}var Qe=B(j,`WeakMap`),$e=9007199254740991,et=/^(?:0|[1-9]\d*)$/;function tt(e,t){var n=typeof e;return t??=$e,!!t&&(n==`number`||n!=`symbol`&&et.test(e))&&e>-1&&e%1==0&&e<t}function nt(e,t){return e===t||e!==e&&t!==t}var rt=9007199254740991;function it(e){return typeof e==`number`&&e>-1&&e%1==0&&e<=rt}function at(e){return e!=null&&it(e.length)&&!Re(e)}var ot=Object.prototype;function st(e){var t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||ot)}function ct(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var lt=`[object Arguments]`;function ut(e){return I(e)&&F(e)==lt}var dt=Object.prototype,ft=dt.hasOwnProperty,pt=dt.propertyIsEnumerable,mt=ut(function(){return arguments}())?ut:function(e){return I(e)&&ft.call(e,`callee`)&&!pt.call(e,`callee`)};function ht(){return!1}var gt=typeof exports==`object`&&exports&&!exports.nodeType&&exports,_t=gt&&typeof module==`object`&&module&&!module.nodeType&&module,vt=_t&&_t.exports===gt?j.Buffer:void 0,yt=(vt?vt.isBuffer:void 0)||ht,bt=`[object Arguments]`,xt=`[object Array]`,St=`[object Boolean]`,Ct=`[object Date]`,wt=`[object Error]`,Tt=`[object Function]`,Et=`[object Map]`,Dt=`[object Number]`,Ot=`[object Object]`,kt=`[object RegExp]`,At=`[object Set]`,jt=`[object String]`,Mt=`[object WeakMap]`,Nt=`[object ArrayBuffer]`,Pt=`[object DataView]`,Ft=`[object Float32Array]`,It=`[object Float64Array]`,Lt=`[object Int8Array]`,Rt=`[object Int16Array]`,zt=`[object Int32Array]`,Bt=`[object Uint8Array]`,Vt=`[object Uint8ClampedArray]`,Ht=`[object Uint16Array]`,Ut=`[object Uint32Array]`,V={};V[Ft]=V[It]=V[Lt]=V[Rt]=V[zt]=V[Bt]=V[Vt]=V[Ht]=V[Ut]=!0,V[bt]=V[xt]=V[Nt]=V[St]=V[Pt]=V[Ct]=V[wt]=V[Tt]=V[Et]=V[Dt]=V[Ot]=V[kt]=V[At]=V[jt]=V[Mt]=!1;function Wt(e){return I(e)&&it(e.length)&&!!V[F(e)]}function Gt(e){return function(t){return e(t)}}var Kt=typeof exports==`object`&&exports&&!exports.nodeType&&exports,H=Kt&&typeof module==`object`&&module&&!module.nodeType&&module,qt=H&&H.exports===Kt&&we.process,Jt=function(){try{return H&&H.require&&H.require(`util`).types||qt&&qt.binding&&qt.binding(`util`)}catch{}}(),Yt=Jt&&Jt.isTypedArray,Xt=Yt?Gt(Yt):Wt,Zt=Object.prototype.hasOwnProperty;function Qt(e,t){var n=L(e),r=!n&&mt(e),i=!n&&!r&&yt(e),a=!n&&!r&&!i&&Xt(e),o=n||r||i||a,s=o?ct(e.length,String):[],c=s.length;for(var l in e)(t||Zt.call(e,l))&&!(o&&(l==`length`||i&&(l==`offset`||l==`parent`)||a&&(l==`buffer`||l==`byteLength`||l==`byteOffset`)||tt(l,c)))&&s.push(l);return s}function $t(e,t){return function(n){return e(t(n))}}var en=$t(Object.keys,Object),tn=Object.prototype.hasOwnProperty;function nn(e){if(!st(e))return en(e);var t=[];for(var n in Object(e))tn.call(e,n)&&n!=`constructor`&&t.push(n);return t}function rn(e){return at(e)?Qt(e):nn(e)}var U=B(Object,`create`);function an(){this.__data__=U?U(null):{},this.size=0}function on(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=+!!t,t}var sn=`__lodash_hash_undefined__`,cn=Object.prototype.hasOwnProperty;function ln(e){var t=this.__data__;if(U){var n=t[e];return n===sn?void 0:n}return cn.call(t,e)?t[e]:void 0}var un=Object.prototype.hasOwnProperty;function dn(e){var t=this.__data__;return U?t[e]!==void 0:un.call(t,e)}var fn=`__lodash_hash_undefined__`;function pn(e,t){var n=this.__data__;return this.size+=+!this.has(e),n[e]=U&&t===void 0?fn:t,this}function W(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}W.prototype.clear=an,W.prototype.delete=on,W.prototype.get=ln,W.prototype.has=dn,W.prototype.set=pn;function mn(){this.__data__=[],this.size=0}function hn(e,t){for(var n=e.length;n--;)if(nt(e[n][0],t))return n;return-1}var gn=Array.prototype.splice;function _n(e){var t=this.__data__,n=hn(t,e);return n<0?!1:(n==t.length-1?t.pop():gn.call(t,n,1),--this.size,!0)}function vn(e){var t=this.__data__,n=hn(t,e);return n<0?void 0:t[n][1]}function yn(e){return hn(this.__data__,e)>-1}function bn(e,t){var n=this.__data__,r=hn(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function G(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}G.prototype.clear=mn,G.prototype.delete=_n,G.prototype.get=vn,G.prototype.has=yn,G.prototype.set=bn;var K=B(j,`Map`);function xn(){this.size=0,this.__data__={hash:new W,map:new(K||G),string:new W}}function Sn(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null}function Cn(e,t){var n=e.__data__;return Sn(t)?n[typeof t==`string`?`string`:`hash`]:n.map}function wn(e){var t=Cn(this,e).delete(e);return this.size-=+!!t,t}function Tn(e){return Cn(this,e).get(e)}function En(e){return Cn(this,e).has(e)}function Dn(e,t){var n=Cn(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function q(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}q.prototype.clear=xn,q.prototype.delete=wn,q.prototype.get=Tn,q.prototype.has=En,q.prototype.set=Dn;function On(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}function kn(){this.__data__=new G,this.size=0}function An(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function jn(e){return this.__data__.get(e)}function Mn(e){return this.__data__.has(e)}var Nn=200;function Pn(e,t){var n=this.__data__;if(n instanceof G){var r=n.__data__;if(!K||r.length<Nn-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new q(r)}return n.set(e,t),this.size=n.size,this}function J(e){var t=this.__data__=new G(e);this.size=t.size}J.prototype.clear=kn,J.prototype.delete=An,J.prototype.get=jn,J.prototype.has=Mn,J.prototype.set=Pn;function Fn(e,t){for(var n=-1,r=e==null?0:e.length,i=0,a=[];++n<r;){var o=e[n];t(o,n,e)&&(a[i++]=o)}return a}function In(){return[]}var Ln=Object.prototype.propertyIsEnumerable,Rn=Object.getOwnPropertySymbols,zn=Rn?function(e){return e==null?[]:(e=Object(e),Fn(Rn(e),function(t){return Ln.call(e,t)}))}:In;function Bn(e,t,n){var r=t(e);return L(e)?r:On(r,n(e))}function Vn(e){return Bn(e,rn,zn)}var Hn=B(j,`DataView`),Un=B(j,`Promise`),Wn=B(j,`Set`),Gn=`[object Map]`,Kn=`[object Object]`,qn=`[object Promise]`,Jn=`[object Set]`,Yn=`[object WeakMap]`,Xn=`[object DataView]`,Zn=z(Hn),Qn=z(K),$n=z(Un),er=z(Wn),tr=z(Qe),Y=F;(Hn&&Y(new Hn(new ArrayBuffer(1)))!=Xn||K&&Y(new K)!=Gn||Un&&Y(Un.resolve())!=qn||Wn&&Y(new Wn)!=Jn||Qe&&Y(new Qe)!=Yn)&&(Y=function(e){var t=F(e),n=t==Kn?e.constructor:void 0,r=n?z(n):``;if(r)switch(r){case Zn:return Xn;case Qn:return Gn;case $n:return qn;case er:return Jn;case tr:return Yn}return t});var nr=Y,rr=j.Uint8Array,ir=`__lodash_hash_undefined__`;function ar(e){return this.__data__.set(e,ir),this}function or(e){return this.__data__.has(e)}function X(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new q;++t<n;)this.add(e[t])}X.prototype.add=X.prototype.push=ar,X.prototype.has=or;function sr(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function cr(e,t){return e.has(t)}var lr=1,ur=2;function dr(e,t,n,r,i,a){var o=n&lr,s=e.length,c=t.length;if(s!=c&&!(o&&c>s))return!1;var l=a.get(e),u=a.get(t);if(l&&u)return l==t&&u==e;var d=-1,f=!0,p=n&ur?new X:void 0;for(a.set(e,t),a.set(t,e);++d<s;){var m=e[d],h=t[d];if(r)var g=o?r(h,m,d,t,e,a):r(m,h,d,e,t,a);if(g!==void 0){if(g)continue;f=!1;break}if(p){if(!sr(t,function(e,t){if(!cr(p,t)&&(m===e||i(m,e,n,r,a)))return p.push(t)})){f=!1;break}}else if(!(m===h||i(m,h,n,r,a))){f=!1;break}}return a.delete(e),a.delete(t),f}function fr(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function pr(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}var mr=1,hr=2,gr=`[object Boolean]`,_r=`[object Date]`,vr=`[object Error]`,yr=`[object Map]`,br=`[object Number]`,xr=`[object RegExp]`,Sr=`[object Set]`,Cr=`[object String]`,wr=`[object Symbol]`,Tr=`[object ArrayBuffer]`,Er=`[object DataView]`,Dr=M?M.prototype:void 0,Or=Dr?Dr.valueOf:void 0;function kr(e,t,n,r,i,a,o){switch(n){case Er:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Tr:return!(e.byteLength!=t.byteLength||!a(new rr(e),new rr(t)));case gr:case _r:case br:return nt(+e,+t);case vr:return e.name==t.name&&e.message==t.message;case xr:case Cr:return e==t+``;case yr:var s=fr;case Sr:var c=r&mr;if(s||=pr,e.size!=t.size&&!c)return!1;var l=o.get(e);if(l)return l==t;r|=hr,o.set(e,t);var u=dr(s(e),s(t),r,i,a,o);return o.delete(e),u;case wr:if(Or)return Or.call(e)==Or.call(t)}return!1}var Ar=1,jr=Object.prototype.hasOwnProperty;function Mr(e,t,n,r,i,a){var o=n&Ar,s=Vn(e),c=s.length;if(c!=Vn(t).length&&!o)return!1;for(var l=c;l--;){var u=s[l];if(!(o?u in t:jr.call(t,u)))return!1}var d=a.get(e),f=a.get(t);if(d&&f)return d==t&&f==e;var p=!0;a.set(e,t),a.set(t,e);for(var m=o;++l<c;){u=s[l];var h=e[u],g=t[u];if(r)var _=o?r(g,h,u,t,e,a):r(h,g,u,e,t,a);if(!(_===void 0?h===g||i(h,g,n,r,a):_)){p=!1;break}m||=u==`constructor`}if(p&&!m){var v=e.constructor,y=t.constructor;v!=y&&`constructor`in e&&`constructor`in t&&!(typeof v==`function`&&v instanceof v&&typeof y==`function`&&y instanceof y)&&(p=!1)}return a.delete(e),a.delete(t),p}var Nr=1,Pr=`[object Arguments]`,Fr=`[object Array]`,Ir=`[object Object]`,Lr=Object.prototype.hasOwnProperty;function Rr(e,t,n,r,i,a){var o=L(e),s=L(t),c=o?Fr:nr(e),l=s?Fr:nr(t);c=c==Pr?Ir:c,l=l==Pr?Ir:l;var u=c==Ir,d=l==Ir,f=c==l;if(f&&yt(e)){if(!yt(t))return!1;o=!0,u=!1}if(f&&!u)return a||=new J,o||Xt(e)?dr(e,t,n,r,i,a):kr(e,t,c,n,r,i,a);if(!(n&Nr)){var p=u&&Lr.call(e,`__wrapped__`),m=d&&Lr.call(t,`__wrapped__`);if(p||m){var h=p?e.value():e,g=m?t.value():t;return a||=new J,i(h,g,n,r,a)}}return f?(a||=new J,Mr(e,t,n,r,i,a)):!1}function zr(e,t,n,r,i){return e===t?!0:e==null||t==null||!I(e)&&!I(t)?e!==e&&t!==t:Rr(e,t,n,r,zr,i)}function Br(e,t){return zr(e,t)}var Z=t(e(),1),Q=n();function Vr({selectedAuthors:e,onAuthorsChange:t}){let[n,r]=(0,Z.useState)(!1),[i,a]=(0,Z.useState)(``),[o,c]=(0,Z.useState)(``),[l,u]=(0,Z.useState)(!1),[d,f]=(0,Z.useState)(1),[p,m]=(0,Z.useState)([]),[h,g]=(0,Z.useState)(0),_=(0,Z.useRef)(null),v=(0,Z.useCallback)(()=>r(!1),[]);ae(_,n,v);let y=d<=1,ee=h===0||d>=h;(0,Z.useEffect)(()=>{n&&(async()=>{try{let e=await s({page:d,limit:12,isGolden:l,q:o||void 0});m(e.data),g(e.meta.itemCount>0?Math.ceil(e.meta.itemCount/12):0)}catch(e){console.error(e),m([]),g(0)}})()},[n,d,o,l]);let te=()=>{f(1),c(i.trim())},ne=e=>{f(1),u(e)},re=()=>{y||f(e=>e-1)},ie=()=>{ee||f(e=>e+1)},x=n=>{t(e.some(e=>e.id===n.id)?e.filter(e=>e.id!==n.id):[...e,n])},S=e=>{e.stopPropagation(),t([])},oe=e.length>0?e.map(e=>e.name).join(`,`):`请选择分æžå¸ˆ`;return(0,Q.jsxs)(`div`,{ref:_,className:`relative w-full`,children:[(0,Q.jsxs)(`div`,{className:`group/trigger w-full bg-slate-50 border border-slate-100 rounded-xl px-3 py-2 text-xs cursor-pointer flex justify-between items-start gap-2`,onClick:()=>r(!n),children:[(0,Q.jsx)(`span`,{className:`flex-1 min-w-0 wrap-break-word leading-relaxed ${e.length>0?`text-slate-700`:`text-slate-500`}`,children:oe}),(0,Q.jsxs)(`div`,{className:`relative mt-0.5 flex h-3.5 w-3.5 shrink-0 items-center justify-center`,children:[e.length>0&&(0,Q.jsx)(`button`,{type:`button`,onClick:S,"aria-label":`清空`,className:`absolute inset-0 hidden items-center justify-center rounded-full text-slate-400 transition-colors hover:bg-slate-200 hover:text-slate-600 cursor-pointer group-hover/trigger:flex`,children:(0,Q.jsx)(b,{size:12,strokeWidth:2.25})}),(0,Q.jsx)(T,{size:14,className:`transition-[opacity,transform] ${n?`rotate-90 opacity-100`:`opacity-0 group-hover/trigger:opacity-100`} ${e.length>0?`group-hover/trigger:hidden`:``}`})]})]}),n&&(0,Q.jsxs)(`div`,{className:`absolute top-full left-0 mt-2 w-150 bg-white border border-slate-200 rounded-xl shadow-xl p-4 z-50`,children:[(0,Q.jsxs)(`div`,{className:`flex gap-2 mb-4 items-center`,children:[(0,Q.jsx)(`input`,{type:`text`,placeholder:`æœç´¢åˆ†æžå¸ˆ`,className:`flex-1 border border-slate-200 rounded px-3 py-1.5 text-xs outline-none focus:ring-1 focus:ring-blue-500`,value:i,onChange:e=>a(e.target.value),onKeyDown:e=>e.key===`Enter`&&te()}),(0,Q.jsxs)(`label`,{className:`flex items-center gap-1 text-xs text-slate-600 shrink-0 cursor-pointer`,children:[(0,Q.jsx)(`input`,{type:`checkbox`,className:`rounded border-slate-300`,checked:l,onChange:e=>ne(e.target.checked)}),`金牌分æžå¸ˆ`]}),(0,Q.jsx)(`button`,{type:`button`,className:`bg-blue-600 text-white px-4 py-1.5 rounded text-xs font-bold cursor-pointer shrink-0`,onClick:te,children:`æœç´¢`}),(0,Q.jsx)(`button`,{type:`button`,disabled:y,className:`border border-slate-200 px-3 py-1.5 rounded text-xs text-slate-600 cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed shrink-0`,onClick:re,children:`上一页`}),(0,Q.jsx)(`button`,{type:`button`,disabled:ee,className:`border border-slate-200 px-3 py-1.5 rounded text-xs text-slate-600 cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed shrink-0`,onClick:ie,children:`下一页`})]}),p.length===0?(0,Q.jsx)(`div`,{className:`py-8 text-center text-xs text-slate-400`,children:`暂未找到相关分æžå¸ˆ`}):(0,Q.jsx)(`div`,{className:`grid grid-cols-4 gap-x-4 gap-y-3`,children:p.map(t=>(0,Q.jsxs)(`label`,{className:`flex items-center gap-1 text-xs cursor-pointer`,children:[(0,Q.jsx)(`input`,{type:`checkbox`,className:`rounded border-slate-300`,checked:e.some(e=>e.id===t.id),onChange:()=>x(t)}),(0,Q.jsxs)(`span`,{className:`text-slate-700`,children:[t.name,`-`,t.orgName]})]},t.id))})]})]})}var Hr=[{label:`大于50页`,value:50},{label:`大于20页`,value:20},{label:`大于10页`,value:10},{label:`大于5页`,value:5}],Ur=[`近三天`,`近一周`,`近一个月`,`è¿‘åŠå¹´`,`近一年`],Wr={近三天:{offset:-2,unit:`day`},近一周:{offset:-6,unit:`day`},近一个月:{offset:-1,unit:`month`},è¿‘åŠå¹´:{offset:-6,unit:`month`},近一年:{offset:-1,unit:`year`}};function Gr(e){let t=new Date,{offset:n,unit:r}=Wr[e];return{publishAtBegin:l(t,n,r),publishAtEnd:u(t)}}function $(e){return e.length>0?e.join(`,`):void 0}var Kr={typeIds:[],labelIds:[],businessIds:[],pageMoreThan:void 0,selectedOrgs:[],excludedOrgs:[],selectedAuthors:[],timeRange:null,customDateRange:{start:null,end:null}};function qr(e){if(e.timeRange)return Gr(e.timeRange);let{start:t,end:n}=e.customDateRange;return t&&n?{publishAtBegin:t,publishAtEnd:n}:{publishAtBegin:void 0,publishAtEnd:void 0}}function Jr(e){let t={},n=$(e.typeIds);n&&(t.typeIds=n);let r=$(e.labelIds);r&&(t.labelIds=r);let i=$(e.businessIds);i&&(t.businessIds=i);let a=$(e.selectedOrgs.map(e=>e.id));a&&(t.orgIds=a);let o=$(e.excludedOrgs.map(e=>e.id));o&&(t.excludeOrgIds=o);let s=e.selectedAuthors.map(e=>e.name).join(`,`);s&&(t.authors=s),e.pageMoreThan&&(t.pageMoreThan=e.pageMoreThan);let{publishAtBegin:c,publishAtEnd:l}=qr(e);return c&&(t.publishAtBegin=c),l&&(t.publishAtEnd=l),t}function Yr(e,t){return t.includes(e)?t.filter(t=>t!==e):[...t,e]}function Xr(e,t,n){let r=e.trim();return r?{...t?{title:r}:{q:r},matchPhrase:n}:{}}function Zr(e){return e?e.q??e.title??``:``}var Qr={search:{},filter:{},sortMode:{type:`hot`},page:1};function $r(e){let t={page:e.page,limit:10,...e.filter,...e.search};return e.sortMode.type===`time`&&(t.sort=`publish_at`,t.order=e.sortMode.order),e.quickAuthors&&(t.authors=e.quickAuthors),e.quickOrg?.ids&&(t.orgIds=e.quickOrg.ids),t}function ei({options:e,selectedIds:t,onChange:n}){return(0,Q.jsx)(`div`,{className:`grid grid-cols-2 gap-2`,children:e.map(e=>{let r=t.includes(e.id);return(0,Q.jsxs)(`label`,{className:`flex items-center gap-2 text-xs text-slate-600 hover:text-blue-600 cursor-pointer`,children:[(0,Q.jsxs)(`div`,{className:`w-4 h-4 rounded border flex items-center justify-center transition-colors ${r?`border-blue-400 bg-blue-50`:`border-slate-200`}`,children:[(0,Q.jsx)(`input`,{type:`checkbox`,className:`hidden`,checked:r,onChange:()=>n(e.id)}),(0,Q.jsx)(le,{size:10,className:`text-blue-600 transition-opacity ${r?`opacity-100`:`opacity-0`}`})]}),e.name]},e.id)})})}function ti({onFilterChange:e}){let{category:t}=he(),{hasActiveVipMembership:n}=fe(),{isAuthenticated:r}=re(),i=ne(e=>e.open),a=t?.typeOptions??[],o=t?.labelOptions??[],s=t?.businessOptions??[],[c,l]=(0,Z.useState)(Kr);(0,Z.useEffect)(()=>{e(Jr(c))},[c,e]),(0,Z.useEffect)(()=>{n||l(e=>!e.pageMoreThan&&e.selectedOrgs.length===0&&e.excludedOrgs.length===0&&e.selectedAuthors.length===0?e:{...e,pageMoreThan:void 0,selectedOrgs:[],excludedOrgs:[],selectedAuthors:[]})},[n]);let u=()=>{if(!r){i(`login`);return}i(`payVip`)},d=(e,t)=>{l(n=>({...n,[e]:Yr(t,n[e])}))},f=()=>{l(Kr)},p=e=>{l(t=>({...t,pageMoreThan:t.pageMoreThan===e?void 0:e}))},m=e=>{l(t=>({...t,selectedOrgs:e}))},_=e=>{l(t=>({...t,excludedOrgs:e}))},v=e=>{l(t=>({...t,selectedAuthors:e}))},b=e=>{l(t=>t.timeRange===e?{...t,timeRange:null}:{...t,timeRange:e,customDateRange:{start:null,end:null}})};return(0,Q.jsxs)(`div`,{className:`bg-white rounded-3xl border border-slate-100 shadow-sm p-6`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between mb-6`,children:[(0,Q.jsxs)(`h2`,{className:`text-lg font-bold text-slate-900 flex items-center gap-2`,children:[(0,Q.jsx)(O,{size:18,className:`text-blue-600`}),` ç›é€‰æ¡ä»¶`]}),(0,Q.jsxs)(`button`,{onClick:f,className:`text-xs text-slate-400 hover:text-blue-600 transition-colors flex items-center gap-1`,children:[` `,(0,Q.jsx)(ee,{size:12}),` é‡ç½®`]})]}),(0,Q.jsxs)(`div`,{className:`space-y-8`,children:[(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[(0,Q.jsxs)(`div`,{className:`text-xs font-bold text-slate-400 uppercase tracking-wider flex items-center gap-2`,children:[(0,Q.jsx)(ce,{size:14,className:`text-slate-300`}),`报告类型`]}),(0,Q.jsx)(ei,{options:a,selectedIds:c.typeIds,onChange:e=>d(`typeIds`,e)})]}),(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[(0,Q.jsxs)(`div`,{className:`text-xs font-bold text-slate-400 uppercase tracking-wider flex items-center gap-2`,children:[(0,Q.jsx)(Ce,{size:14,className:`text-slate-300`}),`ç‰¹è‰²æ ‡ç¾`]}),(0,Q.jsx)(ei,{options:o,selectedIds:c.labelIds,onChange:e=>d(`labelIds`,e)})]}),(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[(0,Q.jsxs)(`div`,{className:`text-xs font-bold text-slate-400 uppercase tracking-wider flex items-center gap-2`,children:[(0,Q.jsx)(ue,{size:14,className:`text-slate-300`}),`行业分类`]}),(0,Q.jsx)(ei,{options:s,selectedIds:c.businessIds,onChange:e=>d(`businessIds`,e)})]}),(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[(0,Q.jsxs)(`div`,{className:`text-xs font-bold text-slate-400 uppercase tracking-wider flex items-center gap-2`,children:[(0,Q.jsx)(h,{size:14,className:`text-slate-300`}),` å‘布时间`]}),(0,Q.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:Ur.map(e=>{let t=c.timeRange===e;return(0,Q.jsx)(`button`,{type:`button`,onClick:()=>b(e),className:`px-3 py-1.5 text-xs rounded-lg transition-colors border ${t?`bg-blue-50 text-blue-600 border-blue-200 font-medium`:`bg-slate-50 text-slate-600 border-slate-100 hover:bg-blue-50 hover:text-blue-600`}`,children:e},e)})}),(0,Q.jsx)(`div`,{className:`flex gap-2 pt-2`,children:(0,Q.jsx)(ye,{startDate:c.customDateRange.start,endDate:c.customDateRange.end,onChange:(e,t)=>{l(n=>({...n,timeRange:e&&t?null:n.timeRange,customDateRange:{start:e,end:t}}))}})})]}),(0,Q.jsxs)(`div`,{className:`relative group -mx-6 -mb-6 space-y-3 border-t border-slate-100 px-6 pb-6 pt-4`,children:[(0,Q.jsxs)(`div`,{className:`text-xs font-bold text-slate-400 uppercase tracking-wider flex items-center gap-2`,children:[(0,Q.jsx)(g,{size:14,className:`text-slate-300`}),` 更多ç›é€‰`]}),(0,Q.jsxs)(`div`,{className:`space-y-4 text-xs text-slate-600`,children:[(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[(0,Q.jsx)(`div`,{className:`text-slate-500 font-medium`,children:`报告页数`}),(0,Q.jsx)(`div`,{className:`grid grid-cols-2 gap-2`,children:Hr.map(({label:e,value:t})=>{let n=c.pageMoreThan===t;return(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>p(t),className:`flex items-center gap-2 cursor-pointer hover:text-blue-600`,children:[(0,Q.jsx)(`div`,{className:`w-4 h-4 rounded-full border flex items-center justify-center ${n?`border-blue-600 bg-blue-600`:`border-slate-200 bg-white`}`,children:n&&(0,Q.jsx)(`div`,{className:`w-1.5 h-1.5 rounded-full bg-white`})}),e]},e)})})]}),(0,Q.jsxs)(`div`,{className:`space-y-1`,children:[(0,Q.jsx)(`div`,{className:`text-slate-500 font-medium`,children:`å‘布机构`}),(0,Q.jsx)(y,{enableExclude:!0,selectedOrgs:c.selectedOrgs,excludedOrgs:c.excludedOrgs,onSelectedOrgsChange:m,onExcludedOrgsChange:_})]}),(0,Q.jsxs)(`div`,{className:`space-y-1`,children:[(0,Q.jsx)(`div`,{className:`text-slate-500 font-medium`,children:`分æžå¸ˆ`}),(0,Q.jsx)(Vr,{selectedAuthors:c.selectedAuthors,onAuthorsChange:v})]})]}),!n&&(0,Q.jsx)(`div`,{onClick:u,className:`absolute inset-0 z-10 cursor-pointer rounded-b-3xl`,children:(0,Q.jsx)(`div`,{className:`absolute inset-0 hidden items-center justify-center rounded-b-3xl bg-white/55 backdrop-blur-[2px] group-hover:flex`,children:(0,Q.jsxs)(`div`,{className:`pointer-events-none mx-3 flex w-full max-w-450 flex-col items-center gap-2.5 rounded-2xl border border-slate-100/90 bg-white px-4 py-3.5 text-center shadow-[0_10px_28px_rgba(15,23,42,0.08)]`,children:[(0,Q.jsx)(`div`,{className:`flex h-8 w-8 items-center justify-center rounded-full bg-linear-to-br from-amber-50 to-orange-50 text-amber-500 ring-1 ring-amber-100`,children:(0,Q.jsx)(D,{size:15})}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`p`,{className:`text-xs font-semibold text-slate-800`,children:`è§£é”æ›´å¤šç›é€‰`}),(0,Q.jsx)(`p`,{className:`mt-0.5 text-[10px] leading-relaxed text-slate-400`,children:`页数 · 机构 · 分æžå¸ˆ`})]}),(0,Q.jsx)(`span`,{className:`rounded-lg bg-slate-900 px-3.5 py-1.5 text-[11px] font-medium text-white`,children:`开通 VIP`})]})})})]})]})]})}function ni({isSearching:e,appliedKeyword:t,onlyTitle:n,exactMatch:r,onSearch:i,onOptionsChange:a}){let o=(0,Z.useRef)(null),[s,c]=(0,Z.useState)(t),[l,u]=(0,Z.useState)(t);t!==l&&(u(t),c(t));let d=(t,n,r)=>{e||i(Xr(t,n,r))},f=e=>{let t=e.onlyTitle??n,i=e.exactMatch??r;a(e);let o=s.trim();o&&d(o,t,i)},p=e=>{let t=e??s;e!==void 0&&c(e),d(t,n,r)};return(0,Q.jsx)(`div`,{className:`relative rounded-3xl p-px bg-linear-to-r from-blue-200/60 via-slate-200 to-blue-200/60 shadow-[0_12px_44px_rgba(37,99,235,0.05)] border border-blue-100 z-30`,children:(0,Q.jsxs)(`div`,{className:`relative bg-linear-to-br from-[#f8fafc] via-white to-blue-50/20 rounded-[22px] px-8 py-5`,children:[(0,Q.jsxs)(`div`,{className:`absolute inset-0 overflow-hidden rounded-[22px] pointer-events-none`,children:[(0,Q.jsx)(`div`,{className:`absolute top-0 right-0 w-100 h-100 bg-blue-100/30 rounded-full blur-[100px] -translate-y-1/3 translate-x-1/3`}),(0,Q.jsx)(`div`,{className:`absolute bottom-0 left-0 w-75 h-75 bg-sky-100/20 rounded-full blur-[80px] translate-y-1/3 -translate-x-1/3`})]}),(0,Q.jsxs)(`div`,{className:`relative z-10 w-full mx-auto`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col items-center mb-6 overflow-hidden`,children:[(0,Q.jsxs)(`h1`,{className:`text-3xl font-extrabold text-[#0f172a] tracking-wide text-center flex flex-wrap items-center justify-center gap-1.5 leading-tight animate-in fade-in slide-in-from-top-3 duration-500`,children:[(0,Q.jsx)(`span`,{children:`æ´žè§æ™ºèƒ½ `}),(0,Q.jsx)(`span`,{className:`bg-linear-to-r from-blue-600 to-sky-500 bg-clip-text text-transparent font-black`,children:`ç»¼åˆæœç´¢`})]}),(0,Q.jsx)(`p`,{className:`text-xs text-slate-400 mt-2 font-medium tracking-normal`,children:`支æŒå¤šæºæ¡ä»¶ç²¾å‡†æ£€ç´¢ï¼Œåƒä¸‡çº§å•†ä¸šç ”报æžé€Ÿå®šä½`})]}),(0,Q.jsxs)(`div`,{className:`relative w-full mx-auto group/search max-w-4xl`,children:[(0,Q.jsx)(`div`,{className:`absolute -inset-0.5 rounded-2xl bg-blue-500/10 opacity-70 group-hover/search:opacity-100 transition duration-300 blur-sm`}),(0,Q.jsxs)(`div`,{className:`relative bg-white rounded-2xl border-2 border-blue-500/90 flex flex-col shadow-lg transition duration-200 focus-within:border-blue-600 focus-within:shadow-[0_10px_35px_rgba(37,99,235,0.12)]`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center p-2`,children:[(0,Q.jsx)(`div`,{className:`ml-3 p-1.5 text-blue-500`,children:(0,Q.jsx)(E,{size:18,className:`stroke-[2.25]`})}),(0,Q.jsx)(`input`,{ref:o,type:`text`,value:s,onChange:e=>c(e.target.value),onKeyDown:e=>e.key===`Enter`&&p(),placeholder:`输入关键è¯ã€æŠ¥å‘Šåç§°ã€è¡Œä¸šæˆ–å‘布机构æœç´¢...`,className:`w-full px-3 py-3 outline-none text-slate-800 placeholder-slate-400/80 text-[17px] bg-transparent font-semibold`}),s?(0,Q.jsx)(`button`,{type:`button`,onClick:()=>{p(``),o.current?.focus()},disabled:e,"aria-label":`清空`,className:`mr-1 flex h-8 w-8 shrink-0 items-center justify-center rounded-full text-slate-400 transition-colors hover:bg-slate-100 hover:text-slate-600 disabled:pointer-events-none disabled:opacity-50`,children:(0,Q.jsx)(b,{size:16,strokeWidth:2.25})}):null,(0,Q.jsx)(ge,{onClick:()=>p(),disabled:e,className:`h-12 px-8 rounded-xl font-bold bg-[#2563eb] hover:bg-[#1d4ed8] active:bg-[#1e40af] text-white tracking-widest shadow-md shadow-blue-500/15 border-none transition-all duration-200 mr-1 shrink-0 flex items-center justify-center min-w-25`,children:e?(0,Q.jsx)(ie,{size:16,className:`animate-spin`}):`æœç´¢`})]}),(0,Q.jsx)(xe,{active:`standard`}),(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-6 gap-y-3 px-5 pb-4 mx-2`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,Q.jsxs)(`label`,{className:`flex items-center gap-2 text-xs text-slate-500 hover:text-slate-800 cursor-pointer group whitespace-nowrap`,children:[(0,Q.jsxs)(`div`,{className:`w-3.5 h-3.5 rounded-full border flex items-center justify-center transition-colors ${n?`border-slate-300 bg-white group-hover:border-blue-400`:`border-blue-600 bg-blue-600`}`,children:[(0,Q.jsx)(`input`,{type:`radio`,name:`searchScope`,className:`hidden`,checked:!n,disabled:e,onChange:()=>f({onlyTitle:!1})}),(0,Q.jsx)(`div`,{className:`w-1.5 h-1.5 rounded-full bg-white transition-transform ${n?`scale-0`:`scale-100`}`})]}),`æœå…¨æ–‡`]}),(0,Q.jsxs)(`label`,{className:`flex items-center gap-2 text-xs text-slate-500 hover:text-slate-800 cursor-pointer group whitespace-nowrap`,children:[(0,Q.jsxs)(`div`,{className:`w-3.5 h-3.5 rounded-full border flex items-center justify-center transition-colors ${n?`border-blue-600 bg-blue-600`:`border-slate-300 bg-white group-hover:border-blue-400`}`,children:[(0,Q.jsx)(`input`,{type:`radio`,name:`searchScope`,className:`hidden`,checked:n,disabled:e,onChange:()=>f({onlyTitle:!0})}),(0,Q.jsx)(`div`,{className:`w-1.5 h-1.5 rounded-full bg-white transition-transform ${n?`scale-100`:`scale-0`}`})]}),`åªæœæ ‡é¢˜`]})]}),(0,Q.jsx)(`div`,{className:`block w-px h-3 bg-slate-200`}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,Q.jsxs)(`label`,{className:`flex items-center gap-2 text-xs text-slate-500 hover:text-slate-800 cursor-pointer group whitespace-nowrap`,children:[(0,Q.jsxs)(`div`,{className:`w-3.5 h-3.5 rounded-full border flex items-center justify-center transition-colors ${r?`border-slate-300 bg-white group-hover:border-blue-400`:`border-blue-600 bg-blue-600`}`,children:[(0,Q.jsx)(`input`,{type:`radio`,name:`matchType`,className:`hidden`,checked:!r,disabled:e,onChange:()=>f({exactMatch:!1})}),(0,Q.jsx)(`div`,{className:`w-1.5 h-1.5 rounded-full bg-white transition-transform ${r?`scale-0`:`scale-100`}`})]}),`关键è¯åˆ†è¯`]}),(0,Q.jsxs)(`label`,{className:`flex items-center gap-2 text-xs text-slate-500 hover:text-slate-800 cursor-pointer group whitespace-nowrap`,children:[(0,Q.jsxs)(`div`,{className:`w-3.5 h-3.5 rounded-full border flex items-center justify-center transition-colors ${r?`border-blue-600 bg-blue-600`:`border-slate-300 bg-white group-hover:border-blue-400`}`,children:[(0,Q.jsx)(`input`,{type:`radio`,name:`matchType`,className:`hidden`,checked:r,disabled:e,onChange:()=>f({exactMatch:!0})}),(0,Q.jsx)(`div`,{className:`w-1.5 h-1.5 rounded-full bg-white transition-transform ${r?`scale-100`:`scale-0`}`})]}),`关键è¯ä¸åˆ†è¯`]})]})]})]})]}),(0,Q.jsx)(me,{onSelect:p})]})]})})}function ri({isOpen:e,onClose:t,onConfirm:n}){let[r,i]=(0,Z.useState)(`once`),o=()=>{i(`once`),t()};return e?(0,Q.jsx)(`div`,{className:`fixed inset-0 bg-slate-900/50 backdrop-blur-sm ${a.overlay} flex items-center justify-center p-4 animate-in fade-in duration-200`,children:(0,Q.jsx)(`div`,{className:`bg-white rounded-2xl shadow-xl w-full max-w-sm overflow-hidden animate-in zoom-in-95 duration-200`,children:(0,Q.jsxs)(`div`,{className:`p-6`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between mb-4`,children:[(0,Q.jsx)(`h3`,{className:`text-lg font-bold text-slate-900`,children:`å…³é—æç¤º`}),(0,Q.jsx)(`button`,{onClick:o,className:`text-slate-400 hover:text-slate-600 p-1`,children:(0,Q.jsx)(b,{size:20})})]}),(0,Q.jsx)(`p`,{className:`text-sm text-slate-600 mb-6`,children:`您确定è¦å…³é— AI 深度æœçš„æ™ºèƒ½æç¤ºå—?`}),(0,Q.jsxs)(`div`,{className:`space-y-3 mb-8`,children:[(0,Q.jsxs)(`label`,{className:`flex items-center gap-3 cursor-pointer group`,children:[(0,Q.jsxs)(`div`,{className:`relative flex items-center justify-center w-5 h-5`,children:[(0,Q.jsx)(`input`,{type:`radio`,name:`closeHookOption`,checked:r===`once`,onChange:()=>i(`once`),className:`appearance-none w-5 h-5 rounded-full border-2 border-slate-300 checked:border-indigo-600 transition-colors peer`}),(0,Q.jsx)(`div`,{className:`absolute w-2.5 h-2.5 rounded-full bg-indigo-600 scale-0 peer-checked:scale-100 transition-transform`})]}),(0,Q.jsx)(`span`,{className:`text-sm text-slate-700 group-hover:text-slate-900`,children:`仅本次关é—`})]}),(0,Q.jsxs)(`label`,{className:`flex items-center gap-3 cursor-pointer group`,children:[(0,Q.jsxs)(`div`,{className:`relative flex items-center justify-center w-5 h-5`,children:[(0,Q.jsx)(`input`,{type:`radio`,name:`closeHookOption`,checked:r===`permanent`,onChange:()=>i(`permanent`),className:`appearance-none w-5 h-5 rounded-full border-2 border-slate-300 checked:border-indigo-600 transition-colors peer`}),(0,Q.jsx)(`div`,{className:`absolute w-2.5 h-2.5 rounded-full bg-indigo-600 scale-0 peer-checked:scale-100 transition-transform`})]}),(0,Q.jsx)(`span`,{className:`text-sm text-slate-700 group-hover:text-slate-900`,children:`永久关é—该æç¤º`})]})]}),(0,Q.jsxs)(`div`,{className:`flex gap-3`,children:[(0,Q.jsx)(`button`,{className:`flex-1 px-4 py-2 bg-slate-100 hover:bg-slate-200 text-slate-700 text-sm font-bold rounded-xl transition-colors`,onClick:o,children:`å–æ¶ˆ`}),(0,Q.jsx)(`button`,{className:`flex-1 px-4 py-2 bg-indigo-600 hover:bg-indigo-700 text-white text-sm font-bold rounded-xl transition-colors shadow-sm shadow-indigo-200`,onClick:()=>{n(r),i(`once`)},children:`确定`})]})]})})}):null}function ii({total:e,searchKeyword:t,onClose:n,onNavigateToAi:r}){return(0,Q.jsxs)(`div`,{className:`bg-[#f2f7fc] rounded-2xl border border-[#d3e3f4] p-5 shadow-sm relative overflow-hidden group`,children:[(0,Q.jsx)(`button`,{type:`button`,"aria-label":`å…³é— AI æç¤º`,onClick:n,className:`absolute top-2 right-2 text-slate-400 hover:text-slate-600 transition-colors z-20`,children:(0,Q.jsx)(b,{size:18,strokeWidth:2})}),(0,Q.jsxs)(`div`,{className:`relative z-10 flex flex-row items-center justify-between gap-4`,children:[(0,Q.jsxs)(`div`,{className:`flex gap-4 items-center`,children:[(0,Q.jsx)(`div`,{className:`shrink-0 w-12 h-12 bg-[#c6dbf4] rounded-full border border-[#adcbf0] flex items-center justify-center text-[#2563eb]`,children:(0,Q.jsxs)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,children:[(0,Q.jsx)(`circle`,{cx:`12`,cy:`12`,r:`2.5`,fill:`currentColor`,fillOpacity:`0.2`,stroke:`currentColor`,strokeWidth:`1`}),(0,Q.jsx)(`circle`,{cx:`6`,cy:`7`,r:`1.5`,fill:`currentColor`}),(0,Q.jsx)(`circle`,{cx:`18`,cy:`7`,r:`1.5`,fill:`currentColor`}),(0,Q.jsx)(`circle`,{cx:`6`,cy:`17`,r:`1.5`,fill:`currentColor`}),(0,Q.jsx)(`circle`,{cx:`18`,cy:`17`,r:`1.5`,fill:`currentColor`}),(0,Q.jsx)(`line`,{x1:`12`,y1:`12`,x2:`6`,y2:`7`,stroke:`currentColor`,strokeWidth:`1`}),(0,Q.jsx)(`line`,{x1:`12`,y1:`12`,x2:`18`,y2:`7`,stroke:`currentColor`,strokeWidth:`1`}),(0,Q.jsx)(`line`,{x1:`12`,y1:`12`,x2:`6`,y2:`17`,stroke:`currentColor`,strokeWidth:`1`}),(0,Q.jsx)(`line`,{x1:`12`,y1:`12`,x2:`18`,y2:`17`,stroke:`currentColor`,strokeWidth:`1`}),(0,Q.jsx)(`line`,{x1:`6`,y1:`7`,x2:`18`,y2:`7`,stroke:`currentColor`,strokeWidth:`1`}),(0,Q.jsx)(`line`,{x1:`6`,y1:`17`,x2:`18`,y2:`17`,stroke:`currentColor`,strokeWidth:`1`}),(0,Q.jsx)(`line`,{x1:`6`,y1:`7`,x2:`6`,y2:`17`,stroke:`currentColor`,strokeWidth:`1`}),(0,Q.jsx)(`line`,{x1:`18`,y1:`7`,x2:`18`,y2:`17`,stroke:`currentColor`,strokeWidth:`1`})]})}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsxs)(`h3`,{className:`font-bold text-[#0c2340] text-base mb-1.5 tracking-tight flex items-center gap-2`,children:[`✨ å‘现 `,e,` 篇高度相关的产业报告`]}),(0,Q.jsxs)(`p`,{className:`text-sm text-slate-500 font-medium flex flex-wrap items-center gap-x-1.5 gap-y-1`,children:[(0,Q.jsx)(`span`,{children:`AI 已准备好为您æå–`}),(0,Q.jsx)(`span`,{className:`inline-flex items-center bg-[#dee8fa] text-[#0c2340] text-[11px] font-bold px-2 py-0.5 rounded-md border border-[#c4daf8]/70`,children:`æ ¸å¿ƒç»“è®º`}),(0,Q.jsx)(`span`,{children:`与`}),(0,Q.jsx)(`span`,{className:`inline-flex items-center bg-[#dee8fa] text-[#0c2340] text-[11px] font-bold px-2 py-0.5 rounded-md border border-[#c4daf8]/70`,children:`关键产业数æ®`}),(0,Q.jsx)(`span`,{children:`。`})]})]})]}),(0,Q.jsx)(ge,{className:`shrink-0 bg-linear-to-r from-blue-600 to-indigo-600 hover:from-blue-500 hover:to-indigo-500 text-white border-none rounded-xl text-xs font-bold px-5 py-3.5 h-auto active:scale-95 transition-all shadow-md shadow-blue-200/50`,onClick:()=>r(t),children:`ä¸€é”®ç”Ÿæˆ AI 深度洞察`})]})]})}function ai({hasSearchKeyword:e,hasActiveFilters:t,searchKeyword:n,onNavigateToAi:r}){return(0,Q.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-24 bg-white rounded-2xl border border-gray-100 border-dashed text-center`,children:[(0,Q.jsx)(`div`,{className:`relative w-20 h-20 flex items-center justify-center text-slate-300/90 mb-6`,children:(0,Q.jsxs)(`svg`,{width:`64`,height:`64`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.25`,children:[(0,Q.jsx)(`circle`,{cx:`11`,cy:`11`,r:`5.5`,stroke:`currentColor`}),(0,Q.jsx)(`path`,{d:`M15 15L20 20`,stroke:`currentColor`,strokeLinecap:`round`}),(0,Q.jsx)(`path`,{d:`M5 5L19 19`,stroke:`currentColor`,strokeLinecap:`round`})]})}),e?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`h3`,{className:`text-xl font-medium text-slate-800 mb-2`,children:`未找到完全匹é…çš„ç ”æŠ¥`}),(0,Q.jsxs)(`p`,{className:`text-sm text-slate-400 font-medium max-w-sm mb-8 leading-relaxed`,children:[`没有找到包å«å…³é”®è¯ã€Œ`,(0,Q.jsx)(`span`,{className:`text-slate-600 font-bold`,children:n}),`ã€çš„ç ”æŠ¥ã€‚å»ºè®®æ‚¨å°è¯•:`]}),(0,Q.jsxs)(`div`,{className:`relative group transition-all mb-4`,children:[(0,Q.jsx)(`div`,{className:`absolute -inset-1.5 bg-linear-to-r from-blue-300/35 via-indigo-300/40 to-purple-300/35 rounded-full blur-md opacity-70 group-hover:opacity-100 group-hover:blur-lg transition duration-300 -z-10`}),(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>r(n),className:`relative flex items-center justify-center gap-2 bg-white/70 backdrop-blur-md hover:bg-white/95 text-indigo-950 px-12 py-3.5 rounded-full font-semibold border border-purple-200/60 shadow-[0_8px_20px_-6px_rgba(168,85,247,0.12)] hover:shadow-[0_12px_24px_-4px_rgba(168,85,247,0.22)] transition-all cursor-pointer active:scale-95 duration-200`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-1 bg-[#ede9fe] pl-1.5 pr-2 py-0.5 rounded-md border border-indigo-100 shadow-sm shrink-0`,children:[(0,Q.jsxs)(`svg`,{width:`10`,height:`10`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`3`,className:`shrink-0 text-indigo-600`,children:[(0,Q.jsx)(`circle`,{cx:`11`,cy:`11`,r:`5`}),(0,Q.jsx)(`path`,{d:`M15 15L19 19`,strokeLinecap:`round`})]}),(0,Q.jsx)(`span`,{className:`text-[10px] font-sans font-extrabold leading-none select-none tracking-tighter`,children:`AI`})]}),(0,Q.jsx)(`span`,{className:`text-sm font-bold text-slate-700 tracking-wide`,children:`试试 AI 深度æœ`})]})]}),(0,Q.jsx)(`div`,{className:`mt-4 text-xs text-slate-400`,children:`AI 能通过高级è¯ä¹‰ç†è§£ã€è·¨ç¯‡é‡ç»„为您生æˆç»¼è¿°å¹¶å›žç”夿‚问题`})]}):t?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`h3`,{className:`text-xl font-medium text-slate-800 mb-2`,children:`当å‰ç›é€‰æ¡ä»¶ä¸‹æš‚æ— ç ”æŠ¥`}),(0,Q.jsx)(`p`,{className:`text-sm text-slate-400 font-medium max-w-sm leading-relaxed`,children:`请å°è¯•放宽左侧ç›é€‰æ¡ä»¶ï¼Œæˆ–清除快æ·ç›é€‰åŽé‡è¯•。`})]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`h3`,{className:`text-xl font-medium text-slate-800 mb-2`,children:`æš‚æ— ç ”æŠ¥`}),(0,Q.jsx)(`p`,{className:`text-sm text-slate-400 font-medium max-w-sm leading-relaxed`,children:`è¾“å…¥å…³é”®è¯æœç´¢ï¼Œæˆ–使用左侧ç›é€‰æ¡ä»¶æµè§ˆç ”报。`})]})]})}function oi({report:e,onNavigateToReport:t,onSelectAnalyst:n,onSelectOrg:r,onDownload:i}){let{category:a}=he(),o=e.highlight?.title?.length?e.highlight.title.join(``):e.title,s=e.highlight?.content?.length?e.highlight.content.join(``):null,c=a?.typeMap[e.typeId]??``,l=e.businessId==null?``:a?.businessMap[e.businessId],d=(e.labelIds??[]).map(e=>a?.labelMap[e]),f=(e.reportScore??0)>=75&&e.pageTotal>=20;return(0,Q.jsxs)(`div`,{className:`py-3 border-b border-gray-100 last:border-0 hover:bg-gray-50/50 transition-colors px-2`,children:[(0,Q.jsxs)(`div`,{className:`flex justify-between items-start gap-4`,children:[(0,Q.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,Q.jsxs)(`button`,{type:`button`,className:`text-[15px] font-semibold text-slate-900 leading-snug mb-1.5 hover:text-blue-700 cursor-pointer text-left w-full [&_em]:text-red-500 [&_em]:not-italic [&_em]:font-semibold`,onClick:()=>t(e.id),children:[e.orgName?`ã€${e.orgName}】`:null,(0,Q.jsx)(`span`,{dangerouslySetInnerHTML:{__html:o}})]}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 mb-2`,children:[f&&(0,Q.jsxs)(`div`,{className:`relative group/tag flex items-center`,children:[(0,Q.jsxs)(`span`,{className:`px-1.5 py-0.5 text-[10px] rounded bg-linear-to-r from-amber-100 to-yellow-100 text-amber-700 font-bold border border-amber-200/50 shadow-sm flex items-center gap-1 cursor-default`,children:[(0,Q.jsx)(k,{size:10,className:`text-amber-500`}),` 优质`]}),(0,Q.jsx)(`div`,{className:`absolute left-0 bottom-full mb-1.5 opacity-0 group-hover/tag:opacity-100 invisible group-hover/tag:visible transition-all duration-200 z-60 pointer-events-none whitespace-nowrap`,children:(0,Q.jsxs)(`div`,{className:`bg-[#f0f7ff]/95 backdrop-blur-sm text-slate-800 px-2.5 py-2 rounded-xl shadow-xl text-xs relative border border-blue-200/80`,children:[(0,Q.jsxs)(`div`,{className:`font-bold text-blue-700 flex items-center gap-1`,children:[(0,Q.jsx)(x,{size:12,className:`text-amber-500 fill-amber-300`}),`AI 评估评分: `,e.reportScore,`/100`]}),(0,Q.jsx)(`div`,{className:`absolute -bottom-1 left-4 w-2 h-2 bg-[#f0f7ff] border-b border-r border-blue-200/80 transform rotate-45`})]})})]}),d.map((e,t)=>(0,Q.jsx)(`span`,{className:`px-1.5 py-0.5 text-[10px] rounded bg-purple-100 text-purple-700 font-medium`,children:e},t))]}),(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-1.5 text-[11px] text-gray-500 leading-none`,children:[c&&(0,Q.jsx)(`span`,{className:`text-red-500 font-bold`,children:c}),l&&(0,Q.jsx)(`span`,{className:`text-red-500 font-bold`,children:l}),(0,Q.jsxs)(`span`,{children:[e.pageTotal,`页·`,w(e.fileSize)]}),(0,Q.jsx)(`span`,{children:u(e.publishAt)}),(0,Q.jsxs)(`button`,{type:`button`,className:`text-slate-600 hover:text-blue-600 cursor-pointer font-bold border-b border-transparent hover:border-blue-300 transition-all`,onClick:()=>n(e.authors),children:[`分æžå¸ˆ: `,e.authors||`—`]}),(0,Q.jsx)(`button`,{type:`button`,className:`text-slate-600 hover:text-blue-600 cursor-pointer font-bold border-b border-transparent hover:border-blue-300 transition-all`,onClick:()=>r({name:e.orgName,ids:e.orgIds.join(`,`)}),children:e.orgName}),(0,Q.jsxs)(`div`,{className:`relative group/sharer inline-flex items-center`,children:[(0,Q.jsx)(`span`,{className:`text-slate-400 hover:text-blue-500 cursor-pointer border-b border-transparent transition-all`,children:`分享者`}),(0,Q.jsxs)(`div`,{className:`absolute left-1/2 -translate-x-1/2 top-full mt-2.5 opacity-0 group-hover/sharer:opacity-100 invisible group-hover/sharer:visible transition-all duration-150 z-60 pointer-events-none whitespace-nowrap bg-white border border-blue-100 text-slate-700 px-3 py-1.5 rounded-xl shadow-lg shadow-blue-100/40 text-[10px] font-medium leading-none flex items-center justify-center`,children:[(0,Q.jsx)(`div`,{className:`absolute -top-1 left-1/2 -translate-x-1/2 w-2 h-2 bg-white border-t border-l border-blue-100 transform rotate-45`}),(0,Q.jsx)(`span`,{children:e.uploaderName||`-`})]})]})]})]}),(0,Q.jsxs)(`button`,{type:`button`,className:`flex items-center justify-center gap-0 w-[120px] py-[7px] px-4 rounded-2xl border border-[#d9d9d9] bg-white text-[#394551] hover:border-blue-400 cursor-pointer transition-colors select-none shrink-0 ${e.hasDownloaded?`opacity-60`:``}`,onClick:t=>{t.stopPropagation(),i(e)},children:[e.hasDownloaded&&(0,Q.jsx)(`span`,{className:`text-[13px] font-normal leading-[18px]`,children:`å·²`}),(0,Q.jsx)(`span`,{className:`text-[13px] font-normal leading-[18px]`,children:`下载`}),(0,Q.jsxs)(`span`,{className:`flex items-center`,children:[(0,Q.jsx)(`img`,{src:ve,alt:`PDF`,className:`w-4 h-4 ml-1.5`}),(0,Q.jsx)(`img`,{src:e.isHorizontal?A:_e,alt:e.isHorizontal?`PPT`:`Word`,className:`w-4 h-4 ml-1.5`})]})]})]}),s&&(0,Q.jsxs)(`div`,{className:`mt-2.5 rounded border border-black/10 bg-[#f5f7f9] overflow-hidden`,children:[(0,Q.jsx)(`div`,{className:`px-2.5 pt-2.5 pb-2`,children:(0,Q.jsx)(`p`,{className:`max-h-[88px] overflow-hidden text-[13px] text-[#394551] leading-[22px] wrap-break-word line-clamp-4 [&_em]:text-red-500 [&_em]:not-italic [&_em]:font-normal`,dangerouslySetInnerHTML:{__html:s}})}),(0,Q.jsxs)(`button`,{type:`button`,className:`flex w-full items-center justify-center gap-0.5 py-2.5 text-[13px] text-[#394551] hover:text-blue-600 border-t border-black/10 transition-colors cursor-pointer`,onClick:()=>t(e.id),children:[`查看全部内容`,(0,Q.jsx)(se,{size:14,className:`opacity-50`})]})]})]})}function si({keyword:e,reports:t,orgIds:n,businessIds:r}){let i=()=>{let t=new URLSearchParams;e&&t.set(`q`,e),n&&t.set(`orgIds`,n),r&&t.set(`businessIds`,r),window.open(`/industry-research/paid-reports?${t.toString()}`,`_blank`,`noopener,noreferrer`)},a=e=>window.open(`/industry-research/paid-report/${e}`,`_blank`,`noopener,noreferrer`);return(0,Q.jsxs)(`div`,{className:`rounded-2xl border border-slate-100 shadow-sm overflow-hidden`,children:[(0,Q.jsxs)(`button`,{type:`button`,onClick:i,className:`flex w-full items-center gap-2.5 px-5 py-3.5 bg-linear-to-r from-blue-50 to-sky-50 hover:from-blue-100 hover:to-sky-100 transition-colors cursor-pointer text-left`,children:[(0,Q.jsx)(`span`,{className:`w-7 h-7 rounded-lg bg-blue-600 text-white flex items-center justify-center shrink-0`,children:(0,Q.jsx)(C,{size:14})}),(0,Q.jsxs)(`span`,{className:`flex-1 text-[13px] font-bold text-slate-800 truncate`,children:[`åˆ°ä»˜è´¹ç ”æŠ¥æŸ¥çœ‹â€œ`,(0,Q.jsx)(`span`,{className:`text-[#FF6262]`,children:e}),`â€ç›¸å…³æŠ¥å‘Š`]}),(0,Q.jsx)(m,{size:14,className:`text-blue-500 shrink-0`})]}),(0,Q.jsx)(`div`,{className:`flex items-start justify-around px-5 py-5`,children:t.map(e=>(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>a(e.id),className:`w-36 shrink-0 text-left cursor-pointer group`,children:[(0,Q.jsx)(`div`,{className:`w-36 h-48 bg-slate-50 rounded-lg overflow-hidden shadow-sm group-hover:shadow-md transition-shadow`,children:(0,Q.jsx)(`img`,{src:e.coverImage,alt:e.title,className:`w-full h-full object-contain`})}),(0,Q.jsxs)(`div`,{className:`mt-2 flex items-center justify-between gap-1 text-[11px]`,children:[(0,Q.jsxs)(`span`,{className:`text-[#FFBC00] font-bold shrink-0`,children:[`ï¿¥`,(e.price/100).toFixed(2)]}),(0,Q.jsx)(`span`,{className:`text-slate-400 truncate`,children:u(e.publishAt)})]}),(0,Q.jsx)(`div`,{className:`mt-1 text-[13px] font-semibold text-slate-800 leading-snug line-clamp-2 group-hover:text-blue-600 transition-colors`,title:e.title,children:e.title})]},e.id))})]})}function ci({onSelectTopic:e}){let[t,n]=(0,Z.useState)(!1),[r,a]=(0,Z.useState)([]),[o,s]=(0,Z.useState)(!0),c=async()=>{s(!0);try{let e=await i({page:1,limit:20,sort:`sort`,order:`DESC`,recommended:!0});a(e.data)}catch(e){console.error(e),a([])}finally{s(!1)}};(0,Z.useEffect)(()=>{c()},[]);let l=t=>{e(t),n(!1)};return(0,Q.jsxs)(`div`,{className:`bg-white rounded-2xl border border-slate-100 shadow-sm p-5 relative`,children:[(0,Q.jsxs)(`h3`,{className:`font-bold text-slate-900 mb-4 flex items-center gap-2 border-b border-slate-50 pb-2`,children:[(0,Q.jsx)(S,{size:18,className:`text-red-500`}),` ç ”æŠ¥çƒåº¦é£™å‡æ¦œ`]}),r.length===0&&o?(0,Q.jsx)(`div`,{className:`flex py-20 items-center justify-center`,children:(0,Q.jsx)(d,{description:`åŠ è½½ä¸...`})}):r.length===0?(0,Q.jsx)(`div`,{className:`py-8 text-center text-sm text-slate-400`,children:`æš‚æ— çƒåº¦è¯é¢˜`}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{className:`space-y-3`,children:r.slice(0,3).map((t,n)=>(0,Q.jsxs)(`div`,{onClick:()=>e(t.hotTopicWord),className:`flex items-center justify-between p-2 hover:bg-slate-50 rounded-lg transition-colors cursor-pointer group`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Q.jsx)(`span`,{className:`text-xs font-bold w-4 text-center ${n===0?`text-red-500`:n===1?`text-orange-500`:`text-yellow-500`}`,children:n+1}),(0,Q.jsx)(`div`,{className:`font-bold text-slate-800 text-sm group-hover:text-blue-600 transition-colors`,children:t.hotTopicWord})]}),(0,Q.jsx)(T,{size:12,className:`text-slate-300 opacity-0 group-hover:opacity-100 group-hover:text-blue-600 transition-all transform group-hover:translate-x-0.5`})]},t.id))}),(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>n(!t),className:`w-full mt-3 text-center text-xs font-semibold text-blue-600 hover:text-blue-700 hover:underline pt-2 border-t border-slate-50 flex items-center justify-center gap-1 cursor-pointer`,children:[`查看更多`,(0,Q.jsx)(T,{size:14,className:`transform transition-transform ${t?`rotate-90`:``}`})]}),t&&(0,Q.jsxs)(`div`,{className:`absolute left-[105%] top-0 w-[320px] bg-white rounded-2xl border border-slate-200 shadow-2xl p-5 z-50 animate-in fade-in slide-in-from-left-2 duration-200`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between mb-4 pb-2 border-b border-slate-100`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 font-bold text-slate-900 text-sm`,children:[(0,Q.jsx)(S,{size:16,className:`text-red-500`}),(0,Q.jsx)(`span`,{children:`ç ”æŠ¥çƒåº¦é£™å‡æ¦œå…¨é›†`})]}),(0,Q.jsx)(`button`,{type:`button`,onClick:()=>n(!1),className:`text-slate-400 hover:text-slate-600 cursor-pointer`,children:(0,Q.jsx)(b,{size:16})})]}),(0,Q.jsx)(`div`,{className:`space-y-2.5 max-h-95 overflow-y-auto pr-1`,children:r.map((e,t)=>(0,Q.jsxs)(`div`,{onClick:()=>l(e.hotTopicWord),className:`flex items-center justify-between p-2 hover:bg-slate-50 rounded-xl transition-all cursor-pointer group`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Q.jsx)(`span`,{className:`text-xs font-bold w-5 h-5 rounded-full flex items-center justify-center ${t<=2?`bg-red-50 text-red-500 font-extrabold`:`bg-slate-50 text-slate-500`}`,children:t+1}),(0,Q.jsx)(`span`,{className:`font-bold text-slate-800 text-sm group-hover:text-blue-600 transition-colors`,children:e.hotTopicWord})]}),(0,Q.jsx)(T,{size:14,className:`text-slate-300 opacity-0 group-hover:opacity-100 group-hover:text-blue-600 transition-all transform group-hover:translate-x-0.5`})]},e.id))})]})]})]})}function li({quickAuthors:e,quickOrg:t,onClearAuthors:n,onClearOrg:r,onClearAll:i}){return(0,Q.jsxs)(`div`,{className:`flex flex-wrap gap-2 items-center px-4 py-3 bg-[#e0f2fe]/45 border border-sky-100 rounded-2xl animate-in fade-in duration-200`,children:[(0,Q.jsx)(`span`,{className:`text-xs font-bold text-sky-700/90 tracking-wide`,children:`当å‰å¿«æ·ç›é€‰:`}),e&&(0,Q.jsxs)(`div`,{className:`inline-flex items-center gap-1 bg-white border border-sky-200/80 pl-2.5 pr-1.5 py-1 rounded-xl text-xs font-bold text-sky-800 shadow-sm animate-in zoom-in-95`,children:[`分æžå¸ˆ: `,e,(0,Q.jsx)(`button`,{onClick:n,className:`w-4.5 h-4.5 rounded-full bg-sky-100 text-sky-700 hover:bg-sky-200 active:bg-sky-300 font-black flex items-center justify-center transition-colors cursor-pointer text-[10px]`,children:`×`})]}),t&&(0,Q.jsxs)(`div`,{className:`inline-flex items-center gap-1 bg-white border border-indigo-100 pl-2.5 pr-1.5 py-1 rounded-xl text-xs font-bold text-indigo-800 shadow-sm animate-in zoom-in-95`,children:[`机构: `,t.name,(0,Q.jsx)(`button`,{onClick:r,className:`w-4.5 h-4.5 rounded-full bg-indigo-50 text-indigo-700 hover:bg-indigo-100 active:bg-indigo-200 font-black flex items-center justify-center transition-colors cursor-pointer text-[10px]`,children:`×`})]}),(0,Q.jsx)(`button`,{onClick:i,className:`ml-auto text-xs text-blue-600 hover:text-blue-800 hover:underline font-bold transition-all`,children:`é‡ç½®å¿«æ·ç›é€‰`})]})}function ui(){let[e,t]=(0,Z.useState)(!1),[n,r]=(0,Z.useState)(!1),[i,a]=(0,Z.useState)(()=>localStorage.getItem(o)===`1`);return{showAiHook:e,setShowAiHook:t,permanentHideHook:i,showCloseHookDialog:n,openCloseHookDialog:()=>r(!0),closeCloseHookDialog:()=>r(!1),handleCloseHookDialog:e=>{e===`permanent`&&(localStorage.setItem(o,`1`),a(!0)),t(!1),r(!1)}}}function di({searchOptions:e,onApplySearch:t}){let[n,r]=de(),i=(0,Z.useRef)(e);(0,Z.useEffect)(()=>{i.current=e},[e]);let a=(0,Z.useCallback)(e=>{t(e);let n=Zr(e).trim();r(e=>{let t=new URLSearchParams(e);return n?t.set(`q`,n):t.delete(`q`),t.toString()===e.toString()?e:t},{replace:!0,flushSync:!0})},[t,r]);return(0,Z.useEffect)(()=>{let e=(n.get(`q`)??``).trim(),{onlyTitle:r,exactMatch:a}=i.current;t(Xr(e,r,a))},[n]),{handleSearch:a}}function fi(e){let t=e?.trim();return t?{...Qr,search:Xr(t,!1,!1)}:Qr}function pi(){let e=oe(),[t]=de(),{category:n,isLoadingCategory:i}=he(),a=ne(e=>e.open),o=be(),[s,l]=(0,Z.useState)(()=>fi(t.get(`q`))),[u,p]=(0,Z.useState)({onlyTitle:!1,exactMatch:!1}),[m,h]=(0,Z.useState)(!1),{showAiHook:g,setShowAiHook:y,permanentHideHook:ee,showCloseHookDialog:b,openCloseHookDialog:re,closeCloseHookDialog:ie,handleCloseHookDialog:ae}=ui(),[x,S]=(0,Z.useState)([]),[ce,le]=(0,Z.useState)([]),[C,ue]=(0,Z.useState)(0),w=(0,Z.useRef)(0),{search:T,filter:E,quickAuthors:D,quickOrg:O,sortMode:k,page:fe}=s,me=t=>{e(`/search/ai${t.trim()?`?q=${encodeURIComponent(t.trim())}`:``}`)},ge=e=>{window.open(`/report/${e}`,`_blank`,`noopener,noreferrer`)},A=e=>l(t=>({...t,...e,page:1})),_e=e=>{A({quickAuthors:e})},ve=e=>{A({quickOrg:e})},ye=e=>{a(`reportDownload`,{report:e,onDownloadSuccess:e=>{S(t=>t.map(t=>t.id===e?{...t,hasDownloaded:!0}:t))}})},xe=e=>{e>5&&!o({levels:te})||(l(t=>({...t,page:e})),scrollTo({top:0,behavior:`smooth`}))},Se=(0,Z.useCallback)(async()=>{if(!n)return;let e=++w.current;h(!0);try{let t=$r(s),n=Zr(s.search),i=n?{...t,q:n,title:void 0,status:`online`,limit:4}:null,[a,o]=await Promise.all(i?[c(t),r(i)]:[c(t)]);if(e!==w.current)return;S(a.data),ue(a.meta.itemCount),le(o?.data??[])}catch(t){if(e!==w.current)return;console.error(t)}e===w.current&&h(!1)},[n,s]),{handleSearch:Ce}=di({searchOptions:u,onApplySearch:(0,Z.useCallback)(e=>{l(t=>t.page===1&&Br(t.search,e)?t:{...t,search:e,page:1}),y(!!Zr(e).trim())},[y])}),we=e=>{let t=e.trim();t&&Ce(Xr(t,u.onlyTitle,u.exactMatch))},Te=e=>{p(t=>({...t,...e}))};(0,Z.useLayoutEffect)(()=>{Se()},[Se]);let j=(0,Z.useCallback)(e=>{l(t=>{let n=Br(t.filter,e)?t.filter:e;return n===t.filter&&t.page===1?t:{...t,filter:n,page:1}})},[]),M=()=>{A({sortMode:{type:`hot`}})},Ee=()=>{l(e=>({...e,page:1,sortMode:e.sortMode.type===`time`?{type:`time`,order:e.sortMode.order===`DESC`?`ASC`:`DESC`}:{type:`time`,order:`DESC`}}))},De=()=>{A({quickAuthors:void 0})},Oe=()=>{A({quickOrg:void 0})},N=()=>{A({quickAuthors:void 0,quickOrg:void 0})},P=Zr(T),ke=P.trim().length>0,Ae=Object.keys(E).length>0||D!=null||O!=null,je=O?.ids||E.orgIds,Me=E.businessIds,Ne=!n||i,F=m&&x.length===0,I=m&&x.length>0,L=ce.length>0?(0,Q.jsx)(si,{keyword:P,reports:ce,orgIds:je,businessIds:Me}):null,R=e=>(0,Q.jsx)(oi,{report:e,onNavigateToReport:ge,onSelectAnalyst:_e,onSelectOrg:ve,onDownload:ye},e.id);return(0,Q.jsxs)(`div`,{className:`min-h-screen bg-gray-50 flex flex-col font-sans`,children:[(0,Q.jsx)(pe,{pageKey:`search`}),(0,Q.jsxs)(`div`,{className:`max-w-7xl mx-auto px-8 py-6 w-full grow`,children:[(0,Q.jsxs)(`div`,{className:`grid grid-cols-12 gap-8`,children:[(0,Q.jsxs)(`div`,{className:`col-span-3 space-y-6`,children:[(0,Q.jsx)(ti,{onFilterChange:j}),(0,Q.jsx)(ci,{onSelectTopic:we}),(0,Q.jsxs)(`div`,{className:`bg-white rounded-2xl border border-slate-100 p-5 shadow-sm`,children:[(0,Q.jsx)(`h3`,{className:`font-bold text-slate-900 mb-3 text-sm flex items-center gap-2`,children:`æ•°æ®æ¥æºè¦†ç›–`}),(0,Q.jsx)(`div`,{className:`grid grid-cols-2 gap-2 text-[11px] text-slate-600 font-medium`,children:[`å…¨è¡Œä¸šç ”ç©¶æŠ¥å‘Š`,`全产业市场分æž`,`上市公å¸ä¼šè®®çºªè¦`,`上市公å¸è´¢æŠ¥å¹´æŠ¥`,`ä¼ä¸šæ‹›è‚¡è¯´æ˜Žä¹¦`,`政ç–ä¿¡æ¯åŠè§£è¯»`,`消费者洞察数æ®`,`电商平å°åˆ†æžæ•°æ®`].map(e=>(0,Q.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,Q.jsx)(v,{size:12,className:`shrink-0 text-blue-500`}),` `,e]},e))})]})]}),(0,Q.jsxs)(`div`,{className:`space-y-6 col-span-9`,children:[(0,Q.jsx)(ni,{isSearching:m,appliedKeyword:P,onlyTitle:u.onlyTitle,exactMatch:u.exactMatch,onSearch:Ce,onOptionsChange:Te}),g&&C>0&&!m&&!ee&&(0,Q.jsx)(ii,{total:C,searchKeyword:P,onClose:re,onNavigateToAi:me}),(0,Q.jsxs)(`div`,{className:`flex items-center justify-between py-4 text-sm text-gray-600 border-b border-gray-100 mb-2`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-6`,children:[(0,Q.jsx)(`button`,{type:`button`,onClick:M,className:`transition-colors cursor-pointer ${k.type===`hot`?`text-blue-600 font-medium`:`text-gray-500 hover:text-gray-900`}`,children:`çƒé—¨æŽ’åº`}),(0,Q.jsxs)(`button`,{type:`button`,onClick:Ee,className:`flex items-center gap-1 transition-colors cursor-pointer ${k.type===`time`?`text-blue-600 font-medium`:`text-gray-500 hover:text-gray-900`}`,children:[`时间排åº`,k.type===`time`&&(k.order===`DESC`?(0,Q.jsx)(se,{size:14}):(0,Q.jsx)(_,{size:14}))]})]}),(0,Q.jsxs)(`div`,{className:`text-gray-500`,children:[`共找到 `,C,` æ¡ç»“æžœ`]})]}),Ne||F?(0,Q.jsx)(`div`,{className:`flex h-48 items-center justify-center`,children:(0,Q.jsx)(d,{description:`åŠ è½½ä¸...`})}):C===0?(0,Q.jsxs)(Q.Fragment,{children:[L,(0,Q.jsx)(ai,{hasSearchKeyword:ke,hasActiveFilters:Ae,searchKeyword:P,onNavigateToAi:me})]}):(0,Q.jsxs)(d,{spinning:I,description:`åŠ è½½ä¸...`,children:[(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[(D||O)&&(0,Q.jsx)(li,{quickAuthors:D,quickOrg:O,onClearAuthors:De,onClearOrg:Oe,onClearAll:N}),x.slice(0,4).map(R),L,x.slice(4).map(R)]}),C>10&&(0,Q.jsx)(`div`,{className:`flex justify-center mt-8 pb-8`,children:(0,Q.jsx)(f,{current:fe,pageSize:10,total:C,onChange:xe,showSizeChanger:!1})})]})]})]}),(0,Q.jsx)(ri,{isOpen:b,onClose:ie,onConfirm:ae})]})]})}export{pi as default};