@petercjl/omni-desktop-app 0.1.8 → 0.1.10

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.
Files changed (104) hide show
  1. package/INSTALL.md +9 -0
  2. package/README.md +4 -4
  3. package/UPDATE.md +7 -0
  4. package/app/assets/{CartesianChart-Bwf4u0Tg.js → CartesianChart-CP7p2vlm.js} +2 -2
  5. package/app/assets/{CollaborationWorkspace-Bd6Sjj31.js → CollaborationWorkspace-Cnp5PNn_.js} +3 -3
  6. package/app/assets/CompetitorAnalysis-Cujy_a2L.js +1 -0
  7. package/app/assets/CompetitorAnalysis-h1zdt0F2.css +1 -0
  8. package/app/assets/EmptyState-CUHuNsaV.js +1 -0
  9. package/app/assets/ErrorBarContext-BJE5-ljg.js +1 -0
  10. package/app/assets/{EvidenceSourceGuide-CwfB7Z6T.js → EvidenceSourceGuide-B1AJCZm2.js} +1 -1
  11. package/app/assets/FavoritePicker-XD1a_uOa.js +1 -0
  12. package/app/assets/Favorites-B5_fdEvZ.js +1 -0
  13. package/app/assets/{HelpTip-CX2LFdwD.js → HelpTip-BqRBO41J.js} +1 -1
  14. package/app/assets/LineChart-Ckvg5wfQ.js +4 -0
  15. package/app/assets/{Opportunities-a5IpRN6k.js → Opportunities-BvH64-dz.js} +1 -1
  16. package/app/assets/{ProgressiveRows-ByxDeTyy.js → ProgressiveRows-NojOUgmr.js} +1 -1
  17. package/app/assets/ShopLayoutPage-CCrRwaAx.js +1 -0
  18. package/app/assets/TrendChart-BF4JgwxH.js +1 -0
  19. package/app/assets/arrow-down-B1nil3T4.js +1 -0
  20. package/app/assets/arrow-left-BhFSpYzK.js +1 -0
  21. package/app/assets/arrow-up-right-IBQoN72x.js +1 -0
  22. package/app/assets/{book-open-C0B9Pao9.js → book-open-Cqdn6s-H.js} +1 -1
  23. package/app/assets/chart-column-DCwNhXki.js +1 -0
  24. package/app/assets/{chart-no-axes-combined-XDy9u9SV.js → chart-no-axes-combined-DVgKs36j.js} +1 -1
  25. package/app/assets/check-DBnlZFEo.js +1 -0
  26. package/app/assets/chevron-down-DO6RUQm8.js +1 -0
  27. package/app/assets/chevron-right-e65CaeL6.js +1 -0
  28. package/app/assets/{clock-3-TH35nOP-.js → clock-3-CDHtQwAe.js} +1 -1
  29. package/app/assets/competitor-analysis-D6eM9ugQ.js +1 -0
  30. package/app/assets/{components-C2-vHJtu.js → components-B5Xyjfpi.js} +2 -2
  31. package/app/assets/{download-BlJN0Lg8.js → download-DfM49VvV.js} +1 -1
  32. package/app/assets/entry-Bq7tA83b.js +1 -0
  33. package/app/assets/{entry-OcErMaMp.css → entry-CMur_AE7.css} +1 -1
  34. package/app/assets/entry-DC4oDjzU.js +2 -0
  35. package/app/assets/{entry-DM3aLe2I.js → entry-DM64sJfS.js} +1 -1
  36. package/app/assets/entry-DbqMDIJi.js +1 -0
  37. package/app/assets/{entry-CdLi3Z9F.js → entry-N8bfKXTF.js} +2 -2
  38. package/app/assets/{entry-CYGrMJuR.js → entry-kAWoaIsV.js} +2 -2
  39. package/app/assets/favorites.module-CHYv-Z8y.js +1 -0
  40. package/app/assets/{file-text-Hd45wNTe.js → file-text-DKAT5fzJ.js} +1 -1
  41. package/app/assets/getRadiusAndStrokeWidthFromDot-bv_ksZ7y.js +1 -0
  42. package/app/assets/{grid-2x2-C0aJVeyS.js → grid-2x2-DB6zRPIV.js} +1 -1
  43. package/app/assets/index-BgJNmU0Z.css +1 -0
  44. package/app/assets/{index-BguiS02-.js → index-DLSVWUSu.js} +2 -2
  45. package/app/assets/{layers-Dj9z2et6.js → layers-CjsT_HGi.js} +1 -1
  46. package/app/assets/{layout-dashboard-DS537D8b.js → layout-dashboard-sgUrlApv.js} +1 -1
  47. package/app/assets/{link-2-CCKUDMV6.js → link-2-VLti-YG9.js} +1 -1
  48. package/app/assets/{list-LZcXKWKD.js → list-Dfzc0sXQ.js} +1 -1
  49. package/app/assets/market-SuD7x_Hf.css +1 -0
  50. package/app/assets/market.module-VpU4XmGg.js +1 -0
  51. package/app/assets/{module-host-C4vqZw2y.js → module-host-DNtiV4gZ.js} +1 -1
  52. package/app/assets/{orbit-G4ZspWKB.js → orbit-CrQs6cpl.js} +1 -1
  53. package/app/assets/play-BxTFlaQX.js +1 -0
  54. package/app/assets/plus-D78h7lrw.js +1 -0
  55. package/app/assets/{products-BAKFF--e.js → products-B5vjXM_b.js} +1 -1
  56. package/app/assets/{project-public-HdtYycKS.js → project-public-CgW1u7BI.js} +1 -1
  57. package/app/assets/{project-public-BCoD2Anq.js → project-public-DWTt808B.js} +1 -1
  58. package/app/assets/public-C-PBMVOQ.js +1 -0
  59. package/app/assets/{refresh-cw-dsQ_f-9j.js → refresh-cw-CxbRf97c.js} +1 -1
  60. package/app/assets/search-DFdSppzm.js +1 -0
  61. package/app/assets/{triangle-alert-l-Mfj0iE.js → triangle-alert-C7qiylOf.js} +1 -1
  62. package/app/assets/{ui-public-BPe2GJZ-.css → ui-public-DHoRDp5_.css} +1 -1
  63. package/app/assets/{ui-public-DWkIf658.js → ui-public-Dt5dHt-8.js} +1 -1
  64. package/app/assets/workbench-DIKJZNJQ.js +2 -0
  65. package/app/assets/{workspace-view-state-BJMX6vWb.js → workspace-view-state-D0ujRczW.js} +1 -1
  66. package/app/desktop/main.mjs +7719 -0
  67. package/app/desktop/preload.cjs +30 -0
  68. package/app/index.html +2 -2
  69. package/app/package.json +1 -0
  70. package/app/public/omni-icon.png +0 -0
  71. package/app/tools/bootstrap.bin +0 -0
  72. package/app/tools/omni-desktop.mjs +526 -0
  73. package/package.json +7 -2
  74. package/release.json +1 -1
  75. package/release.sig +1 -1
  76. package/app/assets/EmptyState-CE7obISq.js +0 -1
  77. package/app/assets/Favorites-4oU1mgEb.js +0 -1
  78. package/app/assets/LineChart-B6igYupv.js +0 -4
  79. package/app/assets/ShopLayoutPage-D7KKJVEq.js +0 -1
  80. package/app/assets/TrendChart-BdRXaz4z.js +0 -1
  81. package/app/assets/arrow-down-DSjucZgz.js +0 -1
  82. package/app/assets/arrow-left-DmIga4jN.js +0 -1
  83. package/app/assets/arrow-up-right-DzAKT3cL.js +0 -1
  84. package/app/assets/check-BB89tIU6.js +0 -1
  85. package/app/assets/chevron-down-BiokgLxD.js +0 -1
  86. package/app/assets/chevron-right-CZlQQ5gV.js +0 -1
  87. package/app/assets/entry-Bxc-KNuY.js +0 -1
  88. package/app/assets/entry-ZwyGbRek.js +0 -1
  89. package/app/assets/entry-ffP7X21A.js +0 -2
  90. package/app/assets/index-D1qZkLPg.css +0 -1
  91. package/app/assets/market-DqV9l-vR.css +0 -1
  92. package/app/assets/market.module-BSrEp5Ak.js +0 -1
  93. package/app/assets/package-BFlv-jYw.js +0 -1
  94. package/app/assets/play-DxbesM66.js +0 -1
  95. package/app/assets/plus-QakkcxdA.js +0 -1
  96. package/app/assets/public-JUGpS2z7.js +0 -1
  97. package/app/assets/search-Cisx0wBF.js +0 -1
  98. package/app/assets/use-favorites-ALxrDxDW.js +0 -1
  99. package/app/assets/workbench-DZTf1DRZ.js +0 -2
  100. /package/app/assets/{api-hjUd9Skg.js → api-KZa8CR8X.js} +0 -0
  101. /package/app/assets/{use-favorites-_eKBQGeF.css → favorites-_eKBQGeF.css} +0 -0
  102. /package/app/assets/{format-BCxMsVJh.js → format-DL7i7_eV.js} +0 -0
  103. /package/app/assets/{graphicalItemSelectors-Hc730Dd1.js → graphicalItemSelectors-CJfZ6cht.js} +0 -0
  104. /package/app/assets/{group-CjIFQYrJ.js → group-Ed305HyG.js} +0 -0
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./project-public-BCoD2Anq.js","./index-BguiS02-.js","./index-D1qZkLPg.css","./CartesianChart-Bwf4u0Tg.js","./LineChart-B6igYupv.js","./EvidenceSourceGuide-CwfB7Z6T.js","./HelpTip-CX2LFdwD.js","./HelpTip-BsHPhMNf.css"])))=>i.map(i=>d[i]);
2
- import{n as e}from"./clock-3-TH35nOP-.js";import{t}from"./chevron-right-CZlQQ5gV.js";import{i as n,n as r,r as i,t as a}from"./products-BAKFF--e.js";import{t as o}from"./layers-Dj9z2et6.js";import{t as s}from"./refresh-cw-dsQ_f-9j.js";import{t as c}from"./search-Cisx0wBF.js";import{a as l,g as u,o as d,p as f,s as p,t as m,y as h}from"./index-BguiS02-.js";import{n as g}from"./module-host-C4vqZw2y.js";import{n as _}from"./workspace-view-state-BJMX6vWb.js";import"./public-JUGpS2z7.js";import{t as v}from"./group-CjIFQYrJ.js";var y=f(`settings-2`,[[`path`,{d:`M14 17H5`,key:`gfn3mx`}],[`path`,{d:`M19 7h-9`,key:`6i9tg`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}],[`circle`,{cx:`7`,cy:`7`,r:`3`,key:`dfmy0x`}]]),b=h(u(),1);async function x(e){let t=await e(`/growth-center`);if(!t||!Array.isArray(t.products)||typeof t.updatedAt!=`string`||t.products.some(e=>!e||typeof e.key!=`string`||typeof e.itemId!=`string`||typeof e.project!=`string`||!Array.isArray(e.series)||e.series.some(e=>!e||!Array.isArray(e.points))))throw Error(`商品资料返回格式异常`);return t}function S(e){let[t,n]=(0,b.useState)(null),[r,i]=(0,b.useState)(``),[a,o]=(0,b.useState)(!0),s=(0,b.useRef)(0),c=(0,b.useRef)(!1),l=(0,b.useCallback)(()=>{let t=++s.current;return x(e).then(e=>c.current&&s.current===t?(n(e),i(``),!0):!1).catch(e=>(c.current&&s.current===t&&(n(null),i(e instanceof Error?e.message:`商品资料读取失败`)),!1)).finally(()=>{c.current&&s.current===t&&o(!1)})},[e]),u=(0,b.useCallback)(()=>(o(!0),i(``),l()),[l]);return(0,b.useEffect)(()=>(c.current=!0,l(),()=>{c.current=!1}),[l]),{data:t,error:r,loading:a,refresh:u}}var C=[{id:`test`,n:`03`,name:`新品测试`,caption:`运营策略 · 测试`,color:`var(--omni-chart-primary,#6fa7ff)`,goal:`少量投入,找到有人喜欢的商品`,cadence:`推广每天看 · 商品每5天看`,rule:`同品类、同属性、同材质一起测。对照店里第二梯队头部商品:低的继续跑,中的进入孵化候选,高的进一步评估。`,action:`查看点击、加购表现,筛选候选商品。`},{id:`incubate`,n:`02`,name:`持续孵化`,caption:`运营策略 · 培养`,color:`var(--omni-chart-secondary,#b99aff)`,goal:`培养潜力款,让成熟商品赚钱`,cadence:`新品每5天看 · 老品每7天看`,rule:`新商品看加购率与转化率;成熟商品看付费占比。低的放大,高的调整计划或暂停,同时优化主图、视频等。`,action:`区分赚钱款与潜力款,安排下一轮优化。`},{id:`scale`,n:`01`,name:`重点推广`,caption:`运营策略 · 放大`,color:`var(--omni-chart-teal,#44cdb5)`,goal:`集中资源,持续增加付款人数`,cadence:`推广每30–60分钟看 · 商品每天看`,rule:`拉新看点击成本、加购成本;收割看点击成本、成交成本。调整差计划,把预算分配给同类好计划;没有合适计划就新建测试。`,action:`查看广告计划,按老师给企业制定的标准处理。`}],w={unassigned:`待分组`,test:`新品测试`,incubate:`持续孵化`,scale:`重点推广`},T=e=>typeof e==`number`?e.toLocaleString(`zh-CN`,{maximumFractionDigits:2}):`—`;function E(e,t){return e.filter(e=>t===`stored-demo`?e.mode===`simulated`:e.mode!==`simulated`)}function D(e,t,n){let r=n.trim().toLowerCase();return e.filter(e=>(t===`all`||e.tier===t)&&`${e.itemId} ${e.projectName} ${e.title||``} ${e.shopName||``}`.toLowerCase().includes(r))}function O(e,t){return e.find(e=>e.key===t)||e[0]}var k=d();function A({series:e}){if(!e?.points.length)return(0,k.jsx)(`div`,{className:`gw-chart-empty`,children:`选择商品后,查看已有数据趋势。`});let t=e.points.slice(-30),n=t.flatMap(e=>e.value===null?[]:[e.value]),r=n.length?Math.min(...n):0,i=n.length?Math.max(...n):1,a=(e,n)=>[32+n*636/Math.max(1,t.length-1),150-((e.value??r)-r)/(i-r||1)*115],o=null,s=[];return t.forEach((t,n)=>{if(t.value===null){o=null;return}let[r,i]=a(t,n);o&&Date.parse(t.date)-Date.parse(o.date)===864e5&&s.push((0,k.jsx)(`line`,{x1:o.x,y1:o.y,x2:r,y2:i},`l`+n)),s.push((0,k.jsx)(`circle`,{cx:r,cy:i,r:`3`,children:(0,k.jsxs)(`title`,{children:[t.date,`:`,T(t.value),` `,e.unit]})},`p`+n)),o={x:r,y:i,date:t.date}}),(0,k.jsxs)(`div`,{className:`gw-chart`,children:[(0,k.jsxs)(`svg`,{viewBox:`0 0 700 185`,role:`img`,"aria-label":`${e.name}最近${t.length}个归档日期的趋势,缺失日期不连线`,children:[(0,k.jsx)(`defs`,{children:(0,k.jsxs)(`linearGradient`,{id:`product-chart-bg`,x1:`0`,x2:`0`,y1:`0`,y2:`1`,children:[(0,k.jsx)(`stop`,{stopColor:`var(--omni-chart-teal,#4cd5af)`,stopOpacity:`.1`}),(0,k.jsx)(`stop`,{offset:`1`,stopColor:`var(--omni-chart-teal,#4cd5af)`,stopOpacity:`0`})]})}),(0,k.jsx)(`rect`,{x:`30`,y:`20`,width:`640`,height:`145`,fill:`url(#product-chart-bg)`}),[35,92,150].map(e=>(0,k.jsx)(`line`,{x1:`30`,x2:`670`,y1:e,y2:e,className:`grid`},e)),(0,k.jsx)(`g`,{className:`plot`,children:s}),(0,k.jsx)(`text`,{x:`32`,y:`178`,children:t[0]?.date}),(0,k.jsx)(`text`,{x:`668`,y:`178`,textAnchor:`end`,children:t.at(-1)?.date}),(0,k.jsxs)(`text`,{x:`32`,y:`16`,children:[T(i),` `,e.unit]})]}),(0,k.jsx)(`span`,{children:`最近最多30个归档日期 · 缺失不补零 · 不同日期不汇总`})]})}function j({product:t,metricKey:n,onMetric:r,onGroup:i,onTask:o,onOpen:s}){if(!t)return(0,k.jsx)(`div`,{className:`gw-empty`,children:`选择商品查看趋势与后续操作。`});let c=t.series.find(e=>e.key===n)||t.series.find(e=>e.metric===`buyers`)||t.series[0],l=C.find(e=>e.id===t.tier);return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)(`div`,{className:`gw-selected-product`,children:[(0,k.jsxs)(`div`,{children:[(0,k.jsx)(a,{product:t}),(0,k.jsx)(`span`,{className:`gw-tag `+t.tier,children:w[t.tier]})]}),(0,k.jsxs)(`button`,{onClick:()=>i(t),children:[(0,k.jsx)(y,{size:14}),`分组`]})]}),(0,k.jsxs)(`div`,{className:`gw-metric-selector`,children:[(0,k.jsx)(`select`,{"aria-label":`商品趋势指标`,value:c?.key||``,onChange:e=>r(e.target.value),children:t.series.map(e=>(0,k.jsxs)(`option`,{value:e.key,children:[e.name,` · `,e.unit||`原始单位`]},e.key))}),(0,k.jsxs)(`strong`,{children:[T(c?.points.at(-1)?.value),(0,k.jsx)(`small`,{children:c?.unit})]}),(0,k.jsxs)(`span`,{children:[`最后统计日:`,c?.points.at(-1)?.date||`—`]})]}),(0,k.jsx)(A,{series:c}),(0,k.jsxs)(`details`,{className:`gw-points`,children:[(0,k.jsx)(`summary`,{children:`查看每日原值与来源`}),(0,k.jsx)(`div`,{className:`gw-table-scroll`,children:(0,k.jsxs)(`table`,{children:[(0,k.jsx)(`thead`,{children:(0,k.jsxs)(`tr`,{children:[(0,k.jsx)(`th`,{children:`日期`}),(0,k.jsx)(`th`,{children:`原值`}),(0,k.jsx)(`th`,{children:`来源`})]})}),(0,k.jsx)(`tbody`,{children:c?.points.slice(-30).map(e=>(0,k.jsxs)(`tr`,{children:[(0,k.jsx)(`td`,{children:e.date}),(0,k.jsx)(`td`,{children:T(e.value)}),(0,k.jsx)(`td`,{children:(0,k.jsx)(`a`,{href:`/api/workbench/`+t.project+`/file/`+e.fileId,children:`原始归档`})})]},e.date))})]})})]}),(0,k.jsxs)(`div`,{className:`gw-next`,children:[(0,k.jsx)(`span`,{children:`NEXT / 下一步`}),(0,k.jsx)(`h3`,{children:l?.action||`先选择这个商品的运营策略`}),(0,k.jsxs)(`p`,{children:[l?.cadence||`分组后查看对应检查频率和处理办法。`,t.note&&` · `+t.note]}),(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`button`,{onClick:()=>o(t),children:`查看当前任务`}),(0,k.jsxs)(`button`,{className:`gw-primary`,onClick:()=>s(t.project,{tab:`monitor`,itemId:t.itemId}),children:[`查看监控与取数 `,(0,k.jsx)(e,{size:13})]}),(0,k.jsx)(`button`,{onClick:()=>s(t.project,{tab:`optimization`,itemId:t.itemId}),children:`商品优化`})]})]}),(0,k.jsx)(`p`,{className:`gw-detail-note`,children:`展示本项目归档的商品指标。点击率、加购率、计划成本等尚未汇入此表;请到来源数据中核对。`})]})}function M({section:e,onSection:l}){let u=g(),{data:d,error:f,loading:p,refresh:m}=S(u.api),h=u.archiveScope||`real`,[y,x]=_(`products.query`,``),[T,A]=_(`products.key`,``),[M,N]=_(`products.metric`,``),[P,F]=(0,b.useState)(``),[I,L]=(0,b.useState)(null),[R,z]=(0,b.useState)(null),B=(0,b.useRef)(null),V=e===`all`||w[e]?e:`all`,H=E(d?.products||[],h),U=D(H,V,y),W=O(U,T);function G(e){A(e.key),N(``),F(``)}function K(e,t){if(t===`work`){z(e);return}t===`data`?(l(`all`),x(``),G(e),requestAnimationFrame(()=>{B.current?.scrollIntoView({behavior:`smooth`,block:`start`}),B.current?.focus({preventScroll:!0})})):u.onOpen(e.project,{tab:t,itemId:e.itemId})}return(0,k.jsx)(`div`,{className:`products-module`,children:(0,k.jsx)(`div`,{className:`gw`,children:(0,k.jsxs)(`div`,{className:`gw-body`,children:[(0,k.jsxs)(`header`,{className:`gw-header`,children:[(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`small`,{children:`商品 / 商品看板`}),(0,k.jsx)(`h1`,{children:`从测试到重点推广`})]}),(0,k.jsxs)(`div`,{className:`gw-header-actions`,children:[(0,k.jsxs)(`span`,{children:[(0,k.jsx)(`i`,{className:`gw-dot`}),`归档数据 · 非实时`]}),(0,k.jsxs)(`button`,{onClick:()=>void m(),disabled:p,children:[(0,k.jsx)(s,{size:14}),p?`读取中`:`刷新数据`]})]})]}),(0,k.jsx)(`div`,{className:`gw-scope`,children:(0,k.jsx)(`span`,{children:d?`${new Date(d.updatedAt).toLocaleString(`zh-CN`)} 读取归档`:p?`正在读取归档…`:`商品资料未就绪`})}),f&&(0,k.jsxs)(`p`,{role:`alert`,className:`gw-message`,children:[f,` `,(0,k.jsx)(`button`,{onClick:()=>void m(),children:`重试`})]}),P&&(0,k.jsx)(`p`,{role:`status`,className:`gw-message`,children:P}),(0,k.jsx)(n,{products:H,tiers:C,ready:!!d&&!p,onAction:K,onAssign:(e,t)=>L({product:e,suggestedTier:t})}),R&&(0,k.jsx)(i,{product:R,onOpen:u.onOpen,onClose:()=>z(null)}),I&&(0,k.jsx)(r,{...I,products:H,onDirty:u.onDirty,onBusy:u.onBusy,onClose:()=>L(null),onSave:async(e,t,n,r)=>{await v(u.api,e,t,n,r),F(await m()?`分组已保存,看板已更新。`:`分组已保存,但看板读取失败,请刷新后查看。`)}}),(0,k.jsxs)(`div`,{className:`gw-operating`,children:[(0,k.jsxs)(`section`,{className:`gw-panel gw-products`,children:[(0,k.jsxs)(`div`,{className:`gw-section-title`,children:[(0,k.jsx)(`h2`,{children:`商品工作清单`}),(0,k.jsxs)(`span`,{children:[U.length,` 个观察对象`]})]}),(0,k.jsxs)(`div`,{className:`gw-filters`,children:[(0,k.jsxs)(`label`,{children:[(0,k.jsx)(c,{size:14}),(0,k.jsx)(`input`,{"aria-label":`搜索经营商品`,placeholder:`搜索商品ID或项目`,value:y,onChange:e=>x(e.target.value)})]}),(0,k.jsxs)(`select`,{"aria-label":`商品运营分组`,value:V,onChange:e=>{l(e.target.value),A(``)},children:[(0,k.jsx)(`option`,{value:`all`,children:`全部运营分组`}),Object.entries(w).map(([e,t])=>(0,k.jsx)(`option`,{value:e,children:t},e))]})]}),V!==`all`&&(0,k.jsxs)(`div`,{className:`gw-rule`,children:[(0,k.jsx)(`b`,{children:w[V]}),(0,k.jsx)(`p`,{children:C.find(e=>e.id===V)?.rule||`选择商品后确认分组。归档记录不能直接证明商品属于哪个梯队。`})]}),(0,k.jsx)(`div`,{className:`gw-table-scroll`,children:(0,k.jsxs)(`table`,{children:[(0,k.jsx)(`thead`,{children:(0,k.jsxs)(`tr`,{children:[(0,k.jsx)(`th`,{children:`商品 / 所属项目`}),(0,k.jsx)(`th`,{children:`当前运营分组`}),(0,k.jsx)(`th`,{children:`已有指标`}),(0,k.jsx)(`th`,{children:`操作`})]})}),(0,k.jsx)(`tbody`,{children:U.map(e=>(0,k.jsxs)(`tr`,{className:W?.key===e.key?`selected`:``,children:[(0,k.jsx)(`td`,{children:(0,k.jsx)(a,{product:e})}),(0,k.jsx)(`td`,{children:(0,k.jsx)(`span`,{className:`gw-tag `+e.tier,children:w[e.tier]})}),(0,k.jsxs)(`td`,{children:[e.series.length,` 项`,(0,k.jsx)(`small`,{children:e.series.map(e=>e.name).slice(0,2).join(` / `)})]}),(0,k.jsx)(`td`,{children:(0,k.jsxs)(`button`,{"aria-label":`查看商品 `+e.itemId+` `+e.projectName,onClick:()=>G(e),children:[`查看 `,(0,k.jsx)(t,{size:12})]})})]},e.key))})]})}),!U.length&&(0,k.jsxs)(`div`,{className:`gw-empty`,children:[(0,k.jsx)(o,{size:29}),(0,k.jsx)(`b`,{children:f?`商品资料读取失败`:p?`正在读取商品…`:y?`没有匹配的商品`:`这个分组还没有商品`}),(0,k.jsx)(`p`,{children:`切换到“待分组”确认商品运营分组,或从项目监控中归档商品数据。`}),(0,k.jsx)(`button`,{onClick:()=>{x(``),l(`unassigned`)},children:`查看待分组`}),(0,k.jsx)(`button`,{onClick:()=>u.onModule(`projects`),children:`进入项目执行`})]})]}),(0,k.jsxs)(`section`,{ref:B,tabIndex:-1,className:`gw-panel gw-product-detail`,children:[(0,k.jsxs)(`div`,{className:`gw-section-title`,children:[(0,k.jsx)(`h2`,{children:`商品数据与下一步`}),(0,k.jsx)(`span`,{children:`点表格切换`})]}),(0,k.jsx)(j,{product:W,metricKey:M,onMetric:N,onGroup:e=>L({product:e}),onTask:z,onOpen:u.onOpen})]})]}),(0,k.jsx)(`p`,{className:`gw-detail-note`,children:`这里的“新品测试、持续孵化、重点推广”是人工保存的运营策略,不是按全店支付销售额贡献、访客和支付买家核验的第一、二、三梯队。切换分组不会自动投放或改变经营梯队。`}),(0,k.jsxs)(`footer`,{className:`gw-footer`,children:[(0,k.jsx)(`span`,{children:`规则来源:店铺链接 AI 自动化孵化与打爆`}),(0,k.jsxs)(`details`,{children:[(0,k.jsx)(`summary`,{children:`检查频率与执行状态说明`}),(0,k.jsx)(`p`,{children:`运营策略卡片展示原方案的建议检查频率,不表示调度已启用。老师结合企业数据制定具体判断标准;本页支持归档查询、趋势查看和分组保存。广告计划的建立、暂停及预算调整尚未在本页接通。`})]})]})]})})})}function N(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function P(e){return typeof e==`string`&&!!e.trim()}function F(e){if(e==null||e===``)return null;let t=typeof e==`number`?e:typeof e==`string`?Number(e):NaN;if(!Number.isFinite(t)||t<0)throw Error(`商品价格格式异常`);return t}async function I(e){async function t(t){let n=await fetch(`/v1/enterprise/`+t,{signal:e,cache:`no-store`});if(!n.ok)throw Error(n.status===401?`登录已失效,请重新登录`:n.status===403?`当前账号没有店铺商品读取权限`:`店铺商品读取失败,请重试`);if(!n.headers.get(`content-type`)?.includes(`application/json`))throw Error(`店铺商品服务尚未接入`);return n.json()}let[n,r]=await Promise.all([t(`products`),t(`shops`)]);if(!N(n)||!Array.isArray(n.products)||!Array.isArray(n.listings)||!N(r)||!Array.isArray(r.shops))throw Error(`店铺商品返回格式异常`);let i=new Map;for(let e of n.products){if(!N(e)||!P(e.product_id)||!P(e.project_id)||!P(e.name))throw Error(`商品关联项目格式异常`);i.set(e.product_id,{id:e.project_id,name:e.name})}let a=new Map;for(let e of r.shops){if(!N(e)||!P(e.id)||!P(e.name)||![`real`,`simulated`,`unverified`].includes(String(e.mode)))throw Error(`店铺资料格式异常`);a.set(e.id,{name:e.name,mode:e.mode===`real`?`declared-real`:e.mode})}let o=[],s=new Set;for(let e of n.listings){if(!N(e)||!P(e.id)||!P(e.product_id)||!P(e.shop_id)||!P(e.platform_item_id)||typeof e.title!=`string`)throw Error(`店铺商品记录不完整`);let t=a.get(e.shop_id),n=i.get(e.product_id);if(!t)continue;if(!n)throw Error(`店铺商品关联项目缺失,请刷新重试`);let r=JSON.stringify([e.shop_id,e.platform_item_id]);if(s.has(r))throw Error(`店铺商品身份重复,请核对资料`);s.add(r),o.push({key:e.id,itemId:e.platform_item_id,title:e.title,image:typeof e.image_data_url==`string`?e.image_data_url:void 0,shopId:e.shop_id,shopName:t.name,project:n.id,projectName:n.name,mode:t.mode,category:typeof e.category==`string`?e.category:void 0,price:F(e.price)})}return o}function L(){let[e,t]=(0,b.useState)(null),[n,r]=(0,b.useState)(``),[i,a]=(0,b.useState)(!0),o=(0,b.useRef)(null),s=(0,b.useCallback)(()=>{o.current?.abort();let e=new AbortController;return o.current=e,I(e.signal).then(n=>{e.signal.aborted||(t(n),r(``))}).catch(n=>{e.signal.aborted||(t(null),r(n instanceof Error?n.message:`店铺商品读取失败`))}).finally(()=>{e.signal.aborted||a(!1)})},[]),c=(0,b.useCallback)(()=>(a(!0),r(``),s()),[s]);return(0,b.useEffect)(()=>(s(),()=>o.current?.abort()),[s]),{data:e,error:n,loading:i,refresh:c}}function R(e,t,n,r=``){return e.filter(e=>(!r||e.shopId===r)&&(n===`stored-demo`?e.mode===`simulated`:e.mode!==`simulated`)).map(e=>({...e,archives:t.filter(t=>t.project===e.project&&t.itemId===e.itemId&&t.shopIds?.length===1&&t.shopIds[0]===e.shopId&&(n===`stored-demo`?t.mode===`simulated`:t.mode!==`simulated`))}))}function z(e){let t=e.archives.length===1?e.archives[0]:void 0,n=t?.series.flatMap(e=>e.points.map(e=>e.date)).sort().at(-1)||``;function r(e,r){let i=t?.series.filter(t=>e.includes(t.metric)&&r.includes(t.unit))||[];if(i.length!==1)return null;let a=i[0].points.find(e=>e.date===n);return typeof a?.value==`number`&&Number.isFinite(a.value)?a.value:null}return{date:n,paid:r([`paid`,`revenue`],[`元`,`CNY`]),uv:r([`visitors`,`uv`],[`人`]),buyers:r([`buyers`],[`人`])}}function B(e,t,n){let r=t.trim().toLowerCase();return e.filter(e=>`${e.itemId} ${e.title} ${e.shopName} ${e.projectName} ${e.category||``}`.toLowerCase().includes(r)&&(n===`all`||(e.archives.length===1?e.archives[0].tier:e.archives.length===0?`unassigned`:``)===n))}var V=20;function H(){let e=g(),n=l(),u=L(),d=S(e.api),f=e.archiveScope||`real`,[m,h]=_(`products.query`,``),[y,x]=_(`products.shopTier`,`all`),[C,E]=_(`products.key`,``),[D,O]=_(`products.metric`,``),[A,M]=(0,b.useState)(1),[N,P]=(0,b.useState)(``),[F,I]=(0,b.useState)(null),[H,U]=(0,b.useState)(null),W=(0,b.useRef)(null),G=R(u.data||[],d.data?.products||[],f,n?.selected),K=d.error||d.loading?`all`:y,q=B(G,m,K),J=Math.max(1,Math.ceil(q.length/V)),Y=Math.min(A,J),X=d.data?.products.find(e=>e.key===C&&(f===`stored-demo`?e.mode===`simulated`:e.mode!==`simulated`)),Z=G.filter(e=>e.archives.some(e=>e.series.some(e=>e.points.length))).length,Q=u.loading||d.loading;function $(e){E(e.key),O(``),requestAnimationFrame(()=>{W.current?.scrollIntoView({behavior:`smooth`,block:`start`}),W.current?.focus({preventScroll:!0})})}return(0,k.jsx)(`div`,{className:`products-module`,children:(0,k.jsx)(`div`,{className:`gw shop-catalog`,children:(0,k.jsxs)(`div`,{className:`gw-body`,children:[(0,k.jsxs)(`header`,{className:`gw-header`,children:[(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`small`,{children:`商品 / 全部商品`}),(0,k.jsx)(`h1`,{children:`店铺商品`}),(0,k.jsx)(`p`,{children:`查看店铺内已建档的商品与经营数据,再安排测试、孵化和推广。`})]}),(0,k.jsxs)(`div`,{className:`gw-header-actions`,children:[(0,k.jsxs)(`span`,{children:[(0,k.jsx)(`i`,{className:`gw-dot`}),`店铺建档与归档数据 · 非实时`]}),(0,k.jsxs)(`button`,{disabled:Q,onClick:()=>{u.refresh(),d.refresh()},children:[(0,k.jsx)(s,{size:14}),Q?`读取中`:`刷新数据`]})]})]}),(0,k.jsx)(`div`,{className:`gw-scope`,children:(0,k.jsx)(`span`,{children:n?.shops.find(e=>e.id===n.selected)?.name||`全部授权店铺`})}),u.error&&(0,k.jsxs)(`p`,{className:`gw-message`,role:`alert`,children:[u.error,` `,(0,k.jsx)(`button`,{onClick:()=>void u.refresh(),children:`重试店铺商品`})]}),d.error&&(0,k.jsxs)(`p`,{className:`gw-message`,role:`alert`,children:[`经营指标暂不可用:`,d.error,` `,(0,k.jsx)(`button`,{onClick:()=>void d.refresh(),children:`重试经营指标`})]}),N&&(0,k.jsx)(`p`,{className:`gw-message`,role:`status`,children:N}),(0,k.jsxs)(`section`,{className:`gw-panel shop-catalog-list`,"aria-label":`店铺商品列表`,children:[(0,k.jsxs)(`div`,{className:`gw-section-title`,children:[(0,k.jsx)(`h2`,{children:`全部商品`}),(0,k.jsx)(`span`,{children:u.loading?`正在读取商品…`:u.error?`商品总数暂不可用`:`当前范围 ${G.length} 个已建档商品`})]}),!u.error&&u.data&&(0,k.jsxs)(`div`,{className:`shop-catalog-summary`,children:[(0,k.jsxs)(`span`,{children:[`已有经营归档 `,(0,k.jsx)(`b`,{children:d.error||d.loading?`—`:Z})]}),(0,k.jsxs)(`span`,{children:[`待补充经营数据 `,(0,k.jsx)(`b`,{children:d.error||d.loading?`—`:G.length-Z})]}),(0,k.jsx)(`span`,{children:`未归档的指标显示“—”`})]}),(0,k.jsxs)(`div`,{className:`gw-filters`,children:[(0,k.jsxs)(`label`,{children:[(0,k.jsx)(c,{size:15}),(0,k.jsx)(`input`,{"aria-label":`搜索店铺商品`,placeholder:`搜索商品名称、ID、店铺、类目或项目`,value:m,onChange:e=>{h(e.target.value),M(1)}})]}),(0,k.jsxs)(`select`,{"aria-label":`筛选店铺商品分组`,value:K,disabled:d.loading||!!d.error,onChange:e=>{x(e.target.value),M(1)},children:[(0,k.jsx)(`option`,{value:`all`,children:`全部运营分组`}),Object.entries(w).map(([e,t])=>(0,k.jsx)(`option`,{value:e,children:t},e))]})]}),(0,k.jsx)(`div`,{className:`gw-table-scroll`,children:(0,k.jsxs)(`table`,{children:[(0,k.jsx)(`thead`,{children:(0,k.jsxs)(`tr`,{children:[(0,k.jsx)(`th`,{children:`商品 / 店铺`}),(0,k.jsx)(`th`,{children:`建档价格(元)`}),(0,k.jsx)(`th`,{children:`访客数`}),(0,k.jsx)(`th`,{children:`支付买家数`}),(0,k.jsx)(`th`,{children:`支付销售额(元)`}),(0,k.jsx)(`th`,{children:`统计日期`}),(0,k.jsx)(`th`,{children:`运营分组`}),(0,k.jsx)(`th`,{children:`操作`})]})}),(0,k.jsx)(`tbody`,{children:q.slice((Y-1)*V,Y*V).map(n=>{let r=z(n),i=n.archives.length===1?n.archives[0]:void 0;return(0,k.jsxs)(`tr`,{className:i?.key===X?.key&&i?`selected`:``,children:[(0,k.jsxs)(`td`,{children:[(0,k.jsx)(a,{product:n}),(0,k.jsxs)(`small`,{children:[n.category||`类目未录入`,` · `,n.projectName]})]}),(0,k.jsx)(`td`,{children:T(n.price)}),(0,k.jsx)(`td`,{children:T(r.uv)}),(0,k.jsx)(`td`,{children:T(r.buyers)}),(0,k.jsx)(`td`,{children:T(r.paid)}),(0,k.jsxs)(`td`,{children:[r.date||`—`,(0,k.jsx)(`small`,{children:d.loading?`读取指标中`:d.error?`指标读取失败`:n.archives.length>1?`多份归档,分别查看`:r.date?`已归档`:`暂无经营数据`})]}),(0,k.jsx)(`td`,{children:d.error||d.loading?`—`:n.archives.length>1?`分组待核对`:(0,k.jsx)(`span`,{className:`gw-tag `+(i?.tier||`unassigned`),children:w[i?.tier||`unassigned`]})}),(0,k.jsx)(`td`,{children:n.archives.length?n.archives.map((e,r)=>(0,k.jsxs)(`button`,{"aria-label":`查看商品 ${n.itemId} ${n.shopName} 归档 ${r+1}`,onClick:()=>$(e),children:[n.archives.length>1?`查看归档 ${r+1}`:`查看数据`,(0,k.jsx)(t,{size:12})]},e.key)):(0,k.jsxs)(`button`,{disabled:d.loading||!!d.error,onClick:()=>e.onOpen(n.project,{tab:`monitor`,itemId:n.itemId}),children:[d.loading?`读取中`:d.error?`指标不可用`:`补充数据`,(0,k.jsx)(t,{size:12})]})})]},n.key)})})]})}),!q.length&&(0,k.jsxs)(`div`,{className:`gw-empty`,role:`status`,children:[(0,k.jsx)(o,{size:29}),(0,k.jsx)(`b`,{children:u.error?`店铺商品读取失败`:u.loading?`正在读取店铺商品…`:m||K!==`all`?`没有匹配的商品`:`当前范围还没有已建档商品`}),(0,k.jsx)(`p`,{children:u.error?`请重试,或检查账号与数据服务连接。`:u.loading?`正在读取当前授权范围的商品目录。`:m||K!==`all`?`调整搜索或运营分组筛选后再查看。`:`请先关联店铺商品。已关联商品即使没有经营归档,也会显示在这里。`}),!u.loading&&!u.error&&(m||K!==`all`)&&(0,k.jsx)(`button`,{onClick:()=>{h(``),x(`all`),M(1)},children:`清除筛选`})]}),q.length>0&&(0,k.jsxs)(`div`,{className:`shop-catalog-pagination`,children:[(0,k.jsxs)(`span`,{children:[`筛选结果 `,q.length,` 个 · 第 `,Y,` / `,J,` 页`]}),(0,k.jsx)(`button`,{disabled:Y<=1,onClick:()=>M(Y-1),children:`上一页`}),(0,k.jsx)(`button`,{disabled:Y>=J,onClick:()=>M(Y+1),children:`下一页`})]})]}),(0,k.jsx)(`p`,{className:`gw-detail-note`,children:`仅显示当前授权店铺已建档商品,尚不代表平台全店商品已同步。经营指标按每个商品的最新归档统计日展示,不同商品日期可能不同;缺值不补零,多店合并归档不分摊到单店。`}),X&&(0,k.jsxs)(`section`,{ref:W,tabIndex:-1,className:`gw-panel gw-product-detail shop-catalog-detail`,children:[(0,k.jsxs)(`div`,{className:`gw-section-title`,children:[(0,k.jsx)(`h2`,{children:`商品数据与下一步`}),(0,k.jsx)(`button`,{"aria-label":`关闭商品详情`,onClick:()=>E(``),children:(0,k.jsx)(p,{size:15})})]}),(0,k.jsx)(j,{product:X,metricKey:D,onMetric:O,onGroup:I,onTask:U,onOpen:e.onOpen})]}),H&&(0,k.jsx)(i,{product:H,onOpen:e.onOpen,onClose:()=>U(null)}),F&&(0,k.jsx)(r,{product:F,products:(d.data?.products||[]).filter(e=>f===`stored-demo`?e.mode===`simulated`:e.mode!==`simulated`),onDirty:e.onDirty,onBusy:e.onBusy,onClose:()=>I(null),onSave:async(t,n,r,i)=>{await v(e.api,t,n,r,i),P(await d.refresh()?`分组已保存,商品数据已更新。`:`分组已保存,但数据读取失败,请刷新后查看。`)}})]})})})}var U=(0,b.lazy)(()=>m(()=>import(`./project-public-BCoD2Anq.js`),__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url));function W({section:e,onSection:t,project:n}){return n?(0,k.jsx)(b.Suspense,{fallback:(0,k.jsx)(`p`,{role:`status`,children:`正在打开商品工具…`}),children:(0,k.jsx)(U,{section:e,project:n})}):e===`all`?(0,k.jsx)(H,{}):(0,k.jsx)(M,{section:e,onSection:t})}export{W as default};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./project-public-DWTt808B.js","./index-DLSVWUSu.js","./index-BgJNmU0Z.css","./CartesianChart-CP7p2vlm.js","./LineChart-Ckvg5wfQ.js","./ErrorBarContext-BJE5-ljg.js","./getRadiusAndStrokeWidthFromDot-bv_ksZ7y.js","./EvidenceSourceGuide-B1AJCZm2.js","./HelpTip-BqRBO41J.js","./HelpTip-BsHPhMNf.css"])))=>i.map(i=>d[i]);
2
+ import{n as e}from"./clock-3-CDHtQwAe.js";import{t}from"./chevron-right-e65CaeL6.js";import{i as n,n as r,r as i,t as a}from"./products-B5vjXM_b.js";import{t as o}from"./layers-CjsT_HGi.js";import{t as s}from"./refresh-cw-CxbRf97c.js";import{t as c}from"./search-DFdSppzm.js";import{a as l,g as u,o as d,p as f,s as p,t as m,y as h}from"./index-DLSVWUSu.js";import{n as g}from"./module-host-DNtiV4gZ.js";import{n as _}from"./workspace-view-state-D0ujRczW.js";import"./public-C-PBMVOQ.js";import{t as v}from"./group-Ed305HyG.js";var y=f(`settings-2`,[[`path`,{d:`M14 17H5`,key:`gfn3mx`}],[`path`,{d:`M19 7h-9`,key:`6i9tg`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}],[`circle`,{cx:`7`,cy:`7`,r:`3`,key:`dfmy0x`}]]),b=h(u(),1);async function x(e){let t=await e(`/growth-center`);if(!t||!Array.isArray(t.products)||typeof t.updatedAt!=`string`||t.products.some(e=>!e||typeof e.key!=`string`||typeof e.itemId!=`string`||typeof e.project!=`string`||!Array.isArray(e.series)||e.series.some(e=>!e||!Array.isArray(e.points))))throw Error(`商品资料返回格式异常`);return t}function S(e){let[t,n]=(0,b.useState)(null),[r,i]=(0,b.useState)(``),[a,o]=(0,b.useState)(!0),s=(0,b.useRef)(0),c=(0,b.useRef)(!1),l=(0,b.useCallback)(()=>{let t=++s.current;return x(e).then(e=>c.current&&s.current===t?(n(e),i(``),!0):!1).catch(e=>(c.current&&s.current===t&&(n(null),i(e instanceof Error?e.message:`商品资料读取失败`)),!1)).finally(()=>{c.current&&s.current===t&&o(!1)})},[e]),u=(0,b.useCallback)(()=>(o(!0),i(``),l()),[l]);return(0,b.useEffect)(()=>(c.current=!0,l(),()=>{c.current=!1}),[l]),{data:t,error:r,loading:a,refresh:u}}var C=[{id:`test`,n:`03`,name:`新品测试`,caption:`运营策略 · 测试`,color:`var(--omni-chart-primary,#6fa7ff)`,goal:`少量投入,找到有人喜欢的商品`,cadence:`推广每天看 · 商品每5天看`,rule:`同品类、同属性、同材质一起测。对照店里第二梯队头部商品:低的继续跑,中的进入孵化候选,高的进一步评估。`,action:`查看点击、加购表现,筛选候选商品。`},{id:`incubate`,n:`02`,name:`持续孵化`,caption:`运营策略 · 培养`,color:`var(--omni-chart-secondary,#b99aff)`,goal:`培养潜力款,让成熟商品赚钱`,cadence:`新品每5天看 · 老品每7天看`,rule:`新商品看加购率与转化率;成熟商品看付费占比。低的放大,高的调整计划或暂停,同时优化主图、视频等。`,action:`区分赚钱款与潜力款,安排下一轮优化。`},{id:`scale`,n:`01`,name:`重点推广`,caption:`运营策略 · 放大`,color:`var(--omni-chart-teal,#44cdb5)`,goal:`集中资源,持续增加付款人数`,cadence:`推广每30–60分钟看 · 商品每天看`,rule:`拉新看点击成本、加购成本;收割看点击成本、成交成本。调整差计划,把预算分配给同类好计划;没有合适计划就新建测试。`,action:`查看广告计划,按老师给企业制定的标准处理。`}],w={unassigned:`待分组`,test:`新品测试`,incubate:`持续孵化`,scale:`重点推广`},T=e=>typeof e==`number`?e.toLocaleString(`zh-CN`,{maximumFractionDigits:2}):`—`;function E(e,t){return e.filter(e=>t===`stored-demo`?e.mode===`simulated`:e.mode!==`simulated`)}function D(e,t,n){let r=n.trim().toLowerCase();return e.filter(e=>(t===`all`||e.tier===t)&&`${e.itemId} ${e.projectName} ${e.title||``} ${e.shopName||``}`.toLowerCase().includes(r))}function O(e,t){return e.find(e=>e.key===t)||e[0]}var k=d();function A({series:e}){if(!e?.points.length)return(0,k.jsx)(`div`,{className:`gw-chart-empty`,children:`选择商品后,查看已有数据趋势。`});let t=e.points.slice(-30),n=t.flatMap(e=>e.value===null?[]:[e.value]),r=n.length?Math.min(...n):0,i=n.length?Math.max(...n):1,a=(e,n)=>[32+n*636/Math.max(1,t.length-1),150-((e.value??r)-r)/(i-r||1)*115],o=null,s=[];return t.forEach((t,n)=>{if(t.value===null){o=null;return}let[r,i]=a(t,n);o&&Date.parse(t.date)-Date.parse(o.date)===864e5&&s.push((0,k.jsx)(`line`,{x1:o.x,y1:o.y,x2:r,y2:i},`l`+n)),s.push((0,k.jsx)(`circle`,{cx:r,cy:i,r:`3`,children:(0,k.jsxs)(`title`,{children:[t.date,`:`,T(t.value),` `,e.unit]})},`p`+n)),o={x:r,y:i,date:t.date}}),(0,k.jsxs)(`div`,{className:`gw-chart`,children:[(0,k.jsxs)(`svg`,{viewBox:`0 0 700 185`,role:`img`,"aria-label":`${e.name}最近${t.length}个归档日期的趋势,缺失日期不连线`,children:[(0,k.jsx)(`defs`,{children:(0,k.jsxs)(`linearGradient`,{id:`product-chart-bg`,x1:`0`,x2:`0`,y1:`0`,y2:`1`,children:[(0,k.jsx)(`stop`,{stopColor:`var(--omni-chart-teal,#4cd5af)`,stopOpacity:`.1`}),(0,k.jsx)(`stop`,{offset:`1`,stopColor:`var(--omni-chart-teal,#4cd5af)`,stopOpacity:`0`})]})}),(0,k.jsx)(`rect`,{x:`30`,y:`20`,width:`640`,height:`145`,fill:`url(#product-chart-bg)`}),[35,92,150].map(e=>(0,k.jsx)(`line`,{x1:`30`,x2:`670`,y1:e,y2:e,className:`grid`},e)),(0,k.jsx)(`g`,{className:`plot`,children:s}),(0,k.jsx)(`text`,{x:`32`,y:`178`,children:t[0]?.date}),(0,k.jsx)(`text`,{x:`668`,y:`178`,textAnchor:`end`,children:t.at(-1)?.date}),(0,k.jsxs)(`text`,{x:`32`,y:`16`,children:[T(i),` `,e.unit]})]}),(0,k.jsx)(`span`,{children:`最近最多30个归档日期 · 缺失不补零 · 不同日期不汇总`})]})}function j({product:t,metricKey:n,onMetric:r,onGroup:i,onTask:o,onOpen:s}){if(!t)return(0,k.jsx)(`div`,{className:`gw-empty`,children:`选择商品查看趋势与后续操作。`});let c=t.series.find(e=>e.key===n)||t.series.find(e=>e.metric===`buyers`)||t.series[0],l=C.find(e=>e.id===t.tier);return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)(`div`,{className:`gw-selected-product`,children:[(0,k.jsxs)(`div`,{children:[(0,k.jsx)(a,{product:t}),(0,k.jsx)(`span`,{className:`gw-tag `+t.tier,children:w[t.tier]})]}),(0,k.jsxs)(`button`,{onClick:()=>i(t),children:[(0,k.jsx)(y,{size:14}),`分组`]})]}),(0,k.jsxs)(`div`,{className:`gw-metric-selector`,children:[(0,k.jsx)(`select`,{"aria-label":`商品趋势指标`,value:c?.key||``,onChange:e=>r(e.target.value),children:t.series.map(e=>(0,k.jsxs)(`option`,{value:e.key,children:[e.name,` · `,e.unit||`原始单位`]},e.key))}),(0,k.jsxs)(`strong`,{children:[T(c?.points.at(-1)?.value),(0,k.jsx)(`small`,{children:c?.unit})]}),(0,k.jsxs)(`span`,{children:[`最后统计日:`,c?.points.at(-1)?.date||`—`]})]}),(0,k.jsx)(A,{series:c}),(0,k.jsxs)(`details`,{className:`gw-points`,children:[(0,k.jsx)(`summary`,{children:`查看每日原值与来源`}),(0,k.jsx)(`div`,{className:`gw-table-scroll`,children:(0,k.jsxs)(`table`,{children:[(0,k.jsx)(`thead`,{children:(0,k.jsxs)(`tr`,{children:[(0,k.jsx)(`th`,{children:`日期`}),(0,k.jsx)(`th`,{children:`原值`}),(0,k.jsx)(`th`,{children:`来源`})]})}),(0,k.jsx)(`tbody`,{children:c?.points.slice(-30).map(e=>(0,k.jsxs)(`tr`,{children:[(0,k.jsx)(`td`,{children:e.date}),(0,k.jsx)(`td`,{children:T(e.value)}),(0,k.jsx)(`td`,{children:(0,k.jsx)(`a`,{href:`/api/workbench/`+t.project+`/file/`+e.fileId,children:`原始归档`})})]},e.date))})]})})]}),(0,k.jsxs)(`div`,{className:`gw-next`,children:[(0,k.jsx)(`span`,{children:`NEXT / 下一步`}),(0,k.jsx)(`h3`,{children:l?.action||`先选择这个商品的运营策略`}),(0,k.jsxs)(`p`,{children:[l?.cadence||`分组后查看对应检查频率和处理办法。`,t.note&&` · `+t.note]}),(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`button`,{onClick:()=>o(t),children:`查看当前任务`}),(0,k.jsxs)(`button`,{className:`gw-primary`,onClick:()=>s(t.project,{tab:`monitor`,itemId:t.itemId}),children:[`查看监控与取数 `,(0,k.jsx)(e,{size:13})]}),(0,k.jsx)(`button`,{onClick:()=>s(t.project,{tab:`optimization`,itemId:t.itemId}),children:`商品优化`})]})]}),(0,k.jsx)(`p`,{className:`gw-detail-note`,children:`展示本项目归档的商品指标。点击率、加购率、计划成本等尚未汇入此表;请到来源数据中核对。`})]})}function M({section:e,onSection:l}){let u=g(),{data:d,error:f,loading:p,refresh:m}=S(u.api),h=u.archiveScope||`real`,[y,x]=_(`products.query`,``),[T,A]=_(`products.key`,``),[M,N]=_(`products.metric`,``),[P,F]=(0,b.useState)(``),[I,L]=(0,b.useState)(null),[R,z]=(0,b.useState)(null),B=(0,b.useRef)(null),V=e===`all`||w[e]?e:`all`,H=E(d?.products||[],h),U=D(H,V,y),W=O(U,T);function G(e){A(e.key),N(``),F(``)}function K(e,t){if(t===`work`){z(e);return}t===`data`?(l(`all`),x(``),G(e),requestAnimationFrame(()=>{B.current?.scrollIntoView({behavior:`smooth`,block:`start`}),B.current?.focus({preventScroll:!0})})):u.onOpen(e.project,{tab:t,itemId:e.itemId})}return(0,k.jsx)(`div`,{className:`products-module`,children:(0,k.jsx)(`div`,{className:`gw`,children:(0,k.jsxs)(`div`,{className:`gw-body`,children:[(0,k.jsxs)(`header`,{className:`gw-header`,children:[(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`small`,{children:`商品 / 商品看板`}),(0,k.jsx)(`h1`,{children:`从测试到重点推广`})]}),(0,k.jsxs)(`div`,{className:`gw-header-actions`,children:[(0,k.jsxs)(`span`,{children:[(0,k.jsx)(`i`,{className:`gw-dot`}),`归档数据 · 非实时`]}),(0,k.jsxs)(`button`,{onClick:()=>void m(),disabled:p,children:[(0,k.jsx)(s,{size:14}),p?`读取中`:`刷新数据`]})]})]}),(0,k.jsx)(`div`,{className:`gw-scope`,children:(0,k.jsx)(`span`,{children:d?`${new Date(d.updatedAt).toLocaleString(`zh-CN`)} 读取归档`:p?`正在读取归档…`:`商品资料未就绪`})}),f&&(0,k.jsxs)(`p`,{role:`alert`,className:`gw-message`,children:[f,` `,(0,k.jsx)(`button`,{onClick:()=>void m(),children:`重试`})]}),P&&(0,k.jsx)(`p`,{role:`status`,className:`gw-message`,children:P}),(0,k.jsx)(n,{products:H,tiers:C,ready:!!d&&!p,onAction:K,onAssign:(e,t)=>L({product:e,suggestedTier:t})}),R&&(0,k.jsx)(i,{product:R,onOpen:u.onOpen,onClose:()=>z(null)}),I&&(0,k.jsx)(r,{...I,products:H,onDirty:u.onDirty,onBusy:u.onBusy,onClose:()=>L(null),onSave:async(e,t,n,r)=>{await v(u.api,e,t,n,r),F(await m()?`分组已保存,看板已更新。`:`分组已保存,但看板读取失败,请刷新后查看。`)}}),(0,k.jsxs)(`div`,{className:`gw-operating`,children:[(0,k.jsxs)(`section`,{className:`gw-panel gw-products`,children:[(0,k.jsxs)(`div`,{className:`gw-section-title`,children:[(0,k.jsx)(`h2`,{children:`商品工作清单`}),(0,k.jsxs)(`span`,{children:[U.length,` 个观察对象`]})]}),(0,k.jsxs)(`div`,{className:`gw-filters`,children:[(0,k.jsxs)(`label`,{children:[(0,k.jsx)(c,{size:14}),(0,k.jsx)(`input`,{"aria-label":`搜索经营商品`,placeholder:`搜索商品ID或项目`,value:y,onChange:e=>x(e.target.value)})]}),(0,k.jsxs)(`select`,{"aria-label":`商品运营分组`,value:V,onChange:e=>{l(e.target.value),A(``)},children:[(0,k.jsx)(`option`,{value:`all`,children:`全部运营分组`}),Object.entries(w).map(([e,t])=>(0,k.jsx)(`option`,{value:e,children:t},e))]})]}),V!==`all`&&(0,k.jsxs)(`div`,{className:`gw-rule`,children:[(0,k.jsx)(`b`,{children:w[V]}),(0,k.jsx)(`p`,{children:C.find(e=>e.id===V)?.rule||`选择商品后确认分组。归档记录不能直接证明商品属于哪个梯队。`})]}),(0,k.jsx)(`div`,{className:`gw-table-scroll`,children:(0,k.jsxs)(`table`,{children:[(0,k.jsx)(`thead`,{children:(0,k.jsxs)(`tr`,{children:[(0,k.jsx)(`th`,{children:`商品 / 所属项目`}),(0,k.jsx)(`th`,{children:`当前运营分组`}),(0,k.jsx)(`th`,{children:`已有指标`}),(0,k.jsx)(`th`,{children:`操作`})]})}),(0,k.jsx)(`tbody`,{children:U.map(e=>(0,k.jsxs)(`tr`,{className:W?.key===e.key?`selected`:``,children:[(0,k.jsx)(`td`,{children:(0,k.jsx)(a,{product:e})}),(0,k.jsx)(`td`,{children:(0,k.jsx)(`span`,{className:`gw-tag `+e.tier,children:w[e.tier]})}),(0,k.jsxs)(`td`,{children:[e.series.length,` 项`,(0,k.jsx)(`small`,{children:e.series.map(e=>e.name).slice(0,2).join(` / `)})]}),(0,k.jsx)(`td`,{children:(0,k.jsxs)(`button`,{"aria-label":`查看商品 `+e.itemId+` `+e.projectName,onClick:()=>G(e),children:[`查看 `,(0,k.jsx)(t,{size:12})]})})]},e.key))})]})}),!U.length&&(0,k.jsxs)(`div`,{className:`gw-empty`,children:[(0,k.jsx)(o,{size:29}),(0,k.jsx)(`b`,{children:f?`商品资料读取失败`:p?`正在读取商品…`:y?`没有匹配的商品`:`这个分组还没有商品`}),(0,k.jsx)(`p`,{children:`切换到“待分组”确认商品运营分组,或从项目监控中归档商品数据。`}),(0,k.jsx)(`button`,{onClick:()=>{x(``),l(`unassigned`)},children:`查看待分组`}),(0,k.jsx)(`button`,{onClick:()=>u.onModule(`projects`),children:`进入项目执行`})]})]}),(0,k.jsxs)(`section`,{ref:B,tabIndex:-1,className:`gw-panel gw-product-detail`,children:[(0,k.jsxs)(`div`,{className:`gw-section-title`,children:[(0,k.jsx)(`h2`,{children:`商品数据与下一步`}),(0,k.jsx)(`span`,{children:`点表格切换`})]}),(0,k.jsx)(j,{product:W,metricKey:M,onMetric:N,onGroup:e=>L({product:e}),onTask:z,onOpen:u.onOpen})]})]}),(0,k.jsx)(`p`,{className:`gw-detail-note`,children:`这里的“新品测试、持续孵化、重点推广”是人工保存的运营策略,不是按全店支付销售额贡献、访客和支付买家核验的第一、二、三梯队。切换分组不会自动投放或改变经营梯队。`}),(0,k.jsxs)(`footer`,{className:`gw-footer`,children:[(0,k.jsx)(`span`,{children:`规则来源:店铺链接 AI 自动化孵化与打爆`}),(0,k.jsxs)(`details`,{children:[(0,k.jsx)(`summary`,{children:`检查频率与执行状态说明`}),(0,k.jsx)(`p`,{children:`运营策略卡片展示原方案的建议检查频率,不表示调度已启用。老师结合企业数据制定具体判断标准;本页支持归档查询、趋势查看和分组保存。广告计划的建立、暂停及预算调整尚未在本页接通。`})]})]})]})})})}function N(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function P(e){return typeof e==`string`&&!!e.trim()}function F(e){if(e==null||e===``)return null;let t=typeof e==`number`?e:typeof e==`string`?Number(e):NaN;if(!Number.isFinite(t)||t<0)throw Error(`商品价格格式异常`);return t}async function I(e){async function t(t){let n=await fetch(`/v1/enterprise/`+t,{signal:e,cache:`no-store`});if(!n.ok)throw Error(n.status===401?`登录已失效,请重新登录`:n.status===403?`当前账号没有店铺商品读取权限`:`店铺商品读取失败,请重试`);if(!n.headers.get(`content-type`)?.includes(`application/json`))throw Error(`店铺商品服务尚未接入`);return n.json()}let[n,r]=await Promise.all([t(`products`),t(`shops`)]);if(!N(n)||!Array.isArray(n.products)||!Array.isArray(n.listings)||!N(r)||!Array.isArray(r.shops))throw Error(`店铺商品返回格式异常`);let i=new Map;for(let e of n.products){if(!N(e)||!P(e.product_id)||!P(e.project_id)||!P(e.name))throw Error(`商品关联项目格式异常`);i.set(e.product_id,{id:e.project_id,name:e.name})}let a=new Map;for(let e of r.shops){if(!N(e)||!P(e.id)||!P(e.name)||![`real`,`simulated`,`unverified`].includes(String(e.mode)))throw Error(`店铺资料格式异常`);a.set(e.id,{name:e.name,mode:e.mode===`real`?`declared-real`:e.mode})}let o=[],s=new Set;for(let e of n.listings){if(!N(e)||!P(e.id)||!P(e.product_id)||!P(e.shop_id)||!P(e.platform_item_id)||typeof e.title!=`string`)throw Error(`店铺商品记录不完整`);let t=a.get(e.shop_id),n=i.get(e.product_id);if(!t)continue;if(!n)throw Error(`店铺商品关联项目缺失,请刷新重试`);let r=JSON.stringify([e.shop_id,e.platform_item_id]);if(s.has(r))throw Error(`店铺商品身份重复,请核对资料`);s.add(r),o.push({key:e.id,itemId:e.platform_item_id,title:e.title,image:typeof e.image_data_url==`string`?e.image_data_url:void 0,shopId:e.shop_id,shopName:t.name,project:n.id,projectName:n.name,mode:t.mode,category:typeof e.category==`string`?e.category:void 0,price:F(e.price)})}return o}function L(){let[e,t]=(0,b.useState)(null),[n,r]=(0,b.useState)(``),[i,a]=(0,b.useState)(!0),o=(0,b.useRef)(null),s=(0,b.useCallback)(()=>{o.current?.abort();let e=new AbortController;return o.current=e,I(e.signal).then(n=>{e.signal.aborted||(t(n),r(``))}).catch(n=>{e.signal.aborted||(t(null),r(n instanceof Error?n.message:`店铺商品读取失败`))}).finally(()=>{e.signal.aborted||a(!1)})},[]),c=(0,b.useCallback)(()=>(a(!0),r(``),s()),[s]);return(0,b.useEffect)(()=>(s(),()=>o.current?.abort()),[s]),{data:e,error:n,loading:i,refresh:c}}function R(e,t,n,r=``){return e.filter(e=>(!r||e.shopId===r)&&(n===`stored-demo`?e.mode===`simulated`:e.mode!==`simulated`)).map(e=>({...e,archives:t.filter(t=>t.project===e.project&&t.itemId===e.itemId&&t.shopIds?.length===1&&t.shopIds[0]===e.shopId&&(n===`stored-demo`?t.mode===`simulated`:t.mode!==`simulated`))}))}function z(e){let t=e.archives.length===1?e.archives[0]:void 0,n=t?.series.flatMap(e=>e.points.map(e=>e.date)).sort().at(-1)||``;function r(e,r){let i=t?.series.filter(t=>e.includes(t.metric)&&r.includes(t.unit))||[];if(i.length!==1)return null;let a=i[0].points.find(e=>e.date===n);return typeof a?.value==`number`&&Number.isFinite(a.value)?a.value:null}return{date:n,paid:r([`paid`,`revenue`],[`元`,`CNY`]),uv:r([`visitors`,`uv`],[`人`]),buyers:r([`buyers`],[`人`])}}function B(e,t,n){let r=t.trim().toLowerCase();return e.filter(e=>`${e.itemId} ${e.title} ${e.shopName} ${e.projectName} ${e.category||``}`.toLowerCase().includes(r)&&(n===`all`||(e.archives.length===1?e.archives[0].tier:e.archives.length===0?`unassigned`:``)===n))}var V=20;function H(){let e=g(),n=l(),u=L(),d=S(e.api),f=e.archiveScope||`real`,[m,h]=_(`products.query`,``),[y,x]=_(`products.shopTier`,`all`),[C,E]=_(`products.key`,``),[D,O]=_(`products.metric`,``),[A,M]=(0,b.useState)(1),[N,P]=(0,b.useState)(``),[F,I]=(0,b.useState)(null),[H,U]=(0,b.useState)(null),W=(0,b.useRef)(null),G=R(u.data||[],d.data?.products||[],f,n?.selected),K=d.error||d.loading?`all`:y,q=B(G,m,K),J=Math.max(1,Math.ceil(q.length/V)),Y=Math.min(A,J),X=d.data?.products.find(e=>e.key===C&&(f===`stored-demo`?e.mode===`simulated`:e.mode!==`simulated`)),Z=G.filter(e=>e.archives.some(e=>e.series.some(e=>e.points.length))).length,Q=u.loading||d.loading;function $(e){E(e.key),O(``),requestAnimationFrame(()=>{W.current?.scrollIntoView({behavior:`smooth`,block:`start`}),W.current?.focus({preventScroll:!0})})}return(0,k.jsx)(`div`,{className:`products-module`,children:(0,k.jsx)(`div`,{className:`gw shop-catalog`,children:(0,k.jsxs)(`div`,{className:`gw-body`,children:[(0,k.jsxs)(`header`,{className:`gw-header`,children:[(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`small`,{children:`商品 / 全部商品`}),(0,k.jsx)(`h1`,{children:`店铺商品`}),(0,k.jsx)(`p`,{children:`查看店铺内已建档的商品与经营数据,再安排测试、孵化和推广。`})]}),(0,k.jsxs)(`div`,{className:`gw-header-actions`,children:[(0,k.jsxs)(`span`,{children:[(0,k.jsx)(`i`,{className:`gw-dot`}),`店铺建档与归档数据 · 非实时`]}),(0,k.jsxs)(`button`,{disabled:Q,onClick:()=>{u.refresh(),d.refresh()},children:[(0,k.jsx)(s,{size:14}),Q?`读取中`:`刷新数据`]})]})]}),(0,k.jsx)(`div`,{className:`gw-scope`,children:(0,k.jsx)(`span`,{children:n?.shops.find(e=>e.id===n.selected)?.name||`全部授权店铺`})}),u.error&&(0,k.jsxs)(`p`,{className:`gw-message`,role:`alert`,children:[u.error,` `,(0,k.jsx)(`button`,{onClick:()=>void u.refresh(),children:`重试店铺商品`})]}),d.error&&(0,k.jsxs)(`p`,{className:`gw-message`,role:`alert`,children:[`经营指标暂不可用:`,d.error,` `,(0,k.jsx)(`button`,{onClick:()=>void d.refresh(),children:`重试经营指标`})]}),N&&(0,k.jsx)(`p`,{className:`gw-message`,role:`status`,children:N}),(0,k.jsxs)(`section`,{className:`gw-panel shop-catalog-list`,"aria-label":`店铺商品列表`,children:[(0,k.jsxs)(`div`,{className:`gw-section-title`,children:[(0,k.jsx)(`h2`,{children:`全部商品`}),(0,k.jsx)(`span`,{children:u.loading?`正在读取商品…`:u.error?`商品总数暂不可用`:`当前范围 ${G.length} 个已建档商品`})]}),!u.error&&u.data&&(0,k.jsxs)(`div`,{className:`shop-catalog-summary`,children:[(0,k.jsxs)(`span`,{children:[`已有经营归档 `,(0,k.jsx)(`b`,{children:d.error||d.loading?`—`:Z})]}),(0,k.jsxs)(`span`,{children:[`待补充经营数据 `,(0,k.jsx)(`b`,{children:d.error||d.loading?`—`:G.length-Z})]}),(0,k.jsx)(`span`,{children:`未归档的指标显示“—”`})]}),(0,k.jsxs)(`div`,{className:`gw-filters`,children:[(0,k.jsxs)(`label`,{children:[(0,k.jsx)(c,{size:15}),(0,k.jsx)(`input`,{"aria-label":`搜索店铺商品`,placeholder:`搜索商品名称、ID、店铺、类目或项目`,value:m,onChange:e=>{h(e.target.value),M(1)}})]}),(0,k.jsxs)(`select`,{"aria-label":`筛选店铺商品分组`,value:K,disabled:d.loading||!!d.error,onChange:e=>{x(e.target.value),M(1)},children:[(0,k.jsx)(`option`,{value:`all`,children:`全部运营分组`}),Object.entries(w).map(([e,t])=>(0,k.jsx)(`option`,{value:e,children:t},e))]})]}),(0,k.jsx)(`div`,{className:`gw-table-scroll`,children:(0,k.jsxs)(`table`,{children:[(0,k.jsx)(`thead`,{children:(0,k.jsxs)(`tr`,{children:[(0,k.jsx)(`th`,{children:`商品 / 店铺`}),(0,k.jsx)(`th`,{children:`建档价格(元)`}),(0,k.jsx)(`th`,{children:`访客数`}),(0,k.jsx)(`th`,{children:`支付买家数`}),(0,k.jsx)(`th`,{children:`支付销售额(元)`}),(0,k.jsx)(`th`,{children:`统计日期`}),(0,k.jsx)(`th`,{children:`运营分组`}),(0,k.jsx)(`th`,{children:`操作`})]})}),(0,k.jsx)(`tbody`,{children:q.slice((Y-1)*V,Y*V).map(n=>{let r=z(n),i=n.archives.length===1?n.archives[0]:void 0;return(0,k.jsxs)(`tr`,{className:i?.key===X?.key&&i?`selected`:``,children:[(0,k.jsxs)(`td`,{children:[(0,k.jsx)(a,{product:n}),(0,k.jsxs)(`small`,{children:[n.category||`类目未录入`,` · `,n.projectName]})]}),(0,k.jsx)(`td`,{children:T(n.price)}),(0,k.jsx)(`td`,{children:T(r.uv)}),(0,k.jsx)(`td`,{children:T(r.buyers)}),(0,k.jsx)(`td`,{children:T(r.paid)}),(0,k.jsxs)(`td`,{children:[r.date||`—`,(0,k.jsx)(`small`,{children:d.loading?`读取指标中`:d.error?`指标读取失败`:n.archives.length>1?`多份归档,分别查看`:r.date?`已归档`:`暂无经营数据`})]}),(0,k.jsx)(`td`,{children:d.error||d.loading?`—`:n.archives.length>1?`分组待核对`:(0,k.jsx)(`span`,{className:`gw-tag `+(i?.tier||`unassigned`),children:w[i?.tier||`unassigned`]})}),(0,k.jsx)(`td`,{children:n.archives.length?n.archives.map((e,r)=>(0,k.jsxs)(`button`,{"aria-label":`查看商品 ${n.itemId} ${n.shopName} 归档 ${r+1}`,onClick:()=>$(e),children:[n.archives.length>1?`查看归档 ${r+1}`:`查看数据`,(0,k.jsx)(t,{size:12})]},e.key)):(0,k.jsxs)(`button`,{disabled:d.loading||!!d.error,onClick:()=>e.onOpen(n.project,{tab:`monitor`,itemId:n.itemId}),children:[d.loading?`读取中`:d.error?`指标不可用`:`补充数据`,(0,k.jsx)(t,{size:12})]})})]},n.key)})})]})}),!q.length&&(0,k.jsxs)(`div`,{className:`gw-empty`,role:`status`,children:[(0,k.jsx)(o,{size:29}),(0,k.jsx)(`b`,{children:u.error?`店铺商品读取失败`:u.loading?`正在读取店铺商品…`:m||K!==`all`?`没有匹配的商品`:`当前范围还没有已建档商品`}),(0,k.jsx)(`p`,{children:u.error?`请重试,或检查账号与数据服务连接。`:u.loading?`正在读取当前授权范围的商品目录。`:m||K!==`all`?`调整搜索或运营分组筛选后再查看。`:`请先关联店铺商品。已关联商品即使没有经营归档,也会显示在这里。`}),!u.loading&&!u.error&&(m||K!==`all`)&&(0,k.jsx)(`button`,{onClick:()=>{h(``),x(`all`),M(1)},children:`清除筛选`})]}),q.length>0&&(0,k.jsxs)(`div`,{className:`shop-catalog-pagination`,children:[(0,k.jsxs)(`span`,{children:[`筛选结果 `,q.length,` 个 · 第 `,Y,` / `,J,` 页`]}),(0,k.jsx)(`button`,{disabled:Y<=1,onClick:()=>M(Y-1),children:`上一页`}),(0,k.jsx)(`button`,{disabled:Y>=J,onClick:()=>M(Y+1),children:`下一页`})]})]}),(0,k.jsx)(`p`,{className:`gw-detail-note`,children:`仅显示当前授权店铺已建档商品,尚不代表平台全店商品已同步。经营指标按每个商品的最新归档统计日展示,不同商品日期可能不同;缺值不补零,多店合并归档不分摊到单店。`}),X&&(0,k.jsxs)(`section`,{ref:W,tabIndex:-1,className:`gw-panel gw-product-detail shop-catalog-detail`,children:[(0,k.jsxs)(`div`,{className:`gw-section-title`,children:[(0,k.jsx)(`h2`,{children:`商品数据与下一步`}),(0,k.jsx)(`button`,{"aria-label":`关闭商品详情`,onClick:()=>E(``),children:(0,k.jsx)(p,{size:15})})]}),(0,k.jsx)(j,{product:X,metricKey:D,onMetric:O,onGroup:I,onTask:U,onOpen:e.onOpen})]}),H&&(0,k.jsx)(i,{product:H,onOpen:e.onOpen,onClose:()=>U(null)}),F&&(0,k.jsx)(r,{product:F,products:(d.data?.products||[]).filter(e=>f===`stored-demo`?e.mode===`simulated`:e.mode!==`simulated`),onDirty:e.onDirty,onBusy:e.onBusy,onClose:()=>I(null),onSave:async(t,n,r,i)=>{await v(e.api,t,n,r,i),P(await d.refresh()?`分组已保存,商品数据已更新。`:`分组已保存,但数据读取失败,请刷新后查看。`)}})]})})})}var U=(0,b.lazy)(()=>m(()=>import(`./project-public-DWTt808B.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]),import.meta.url));function W({section:e,onSection:t,project:n}){return n?(0,k.jsx)(b.Suspense,{fallback:(0,k.jsx)(`p`,{role:`status`,children:`正在打开商品工具…`}),children:(0,k.jsx)(U,{section:e,project:n})}):e===`all`?(0,k.jsx)(H,{}):(0,k.jsx)(M,{section:e,onSection:t})}export{W as default};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./project-public-HdtYycKS.js","./index-BguiS02-.js","./index-D1qZkLPg.css","./arrow-up-right-DzAKT3cL.js","./book-open-C0B9Pao9.js","./link-2-CCKUDMV6.js","./chevron-right-CZlQQ5gV.js","./download-BlJN0Lg8.js","./file-text-Hd45wNTe.js","./plus-QakkcxdA.js","./search-Cisx0wBF.js","./workspace-view-state-BJMX6vWb.js","./EmptyState-CE7obISq.js","./layers-Dj9z2et6.js","./HelpTip-CX2LFdwD.js","./HelpTip-BsHPhMNf.css","./project-public-IxjCdnaB.css"])))=>i.map(i=>d[i]);
2
- import{t as e}from"./refresh-cw-dsQ_f-9j.js";import{t}from"./search-Cisx0wBF.js";import{g as n,o as r,t as i,y as a}from"./index-BguiS02-.js";import{n as o}from"./module-host-C4vqZw2y.js";import{n as s}from"./workspace-view-state-BJMX6vWb.js";import"./public-JUGpS2z7.js";var c=a(n(),1);function l(e){let[t,n]=(0,c.useState)(null),[r,i]=(0,c.useState)(``),[a,o]=(0,c.useState)(!0),s=(0,c.useRef)(0),l=(0,c.useCallback)(()=>{let t=++s.current;return e().then(e=>{s.current===t&&(n(e),i(``))}).catch(e=>{s.current===t&&i(e instanceof Error?e.message:`资料读取失败`)}).finally(()=>{s.current===t&&o(!1)})},[e]),u=(0,c.useCallback)(()=>{s.current++},[]);return(0,c.useEffect)(()=>(l(),u),[l,u]),{data:t,error:r,busy:a,refresh:(0,c.useCallback)(()=>{o(!0),i(``),l()},[l])}}async function u(e){let t=await e(`/growth-center?view=catalog`);if(!t||typeof t!=`object`||!(`catalog`in t)||!Array.isArray(t.catalog)||!(`updatedAt`in t)||typeof t.updatedAt!=`string`)throw Error(`资料目录格式异常,请刷新重试`);if(!t.catalog.every(e=>e&&typeof e.id==`string`&&typeof e.project==`string`&&typeof e.title==`string`&&typeof e.created==`string`&&typeof e.mode==`string`))throw Error(`资料目录记录不完整`);return t}var d=r();function f(){let{api:n,onOpen:r}=o(),{data:i,error:a,busy:f,refresh:p}=l((0,c.useCallback)(()=>u(n),[n])),[m,h]=s(`resources.scope`,`real`),[g,_]=s(`resources.query`,``),v=(i?.catalog||[]).filter(e=>m===`stored-demo`?e.mode===`simulated`:e.mode!==`simulated`),y=[...v].reverse().filter(e=>`${e.title} ${e.projectName} ${e.source}`.toLowerCase().includes(g.toLowerCase())),b={simulated:`模拟数据`,"declared-real":`来源标注真实`,unverified:`来源待核实`};return(0,d.jsx)(`div`,{className:`resources-module gw`,children:(0,d.jsxs)(`div`,{className:`gw-body`,children:[(0,d.jsxs)(`header`,{className:`gw-header`,children:[(0,d.jsxs)(`div`,{children:[(0,d.jsx)(`small`,{children:`工作台 / 数据中心`}),(0,d.jsx)(`h1`,{children:`经营数据中心`})]}),(0,d.jsxs)(`div`,{className:`gw-header-actions`,children:[(0,d.jsxs)(`span`,{children:[(0,d.jsx)(`i`,{className:`gw-dot`}),m===`stored-demo`?`模拟归档 · 非真实经营`:`归档数据 · 非实时`]}),(0,d.jsxs)(`button`,{onClick:()=>p(),disabled:f,children:[(0,d.jsx)(e,{size:14}),f?`读取中`:`刷新数据`]})]})]}),(0,d.jsxs)(`div`,{className:`gw-scope`,children:[(0,d.jsx)(`div`,{children:[[`real`,`非模拟资料`],[`stored-demo`,`模拟资料`]].map(([e,t])=>(0,d.jsx)(`button`,{"aria-pressed":m===e,onClick:()=>h(e),children:t},e))}),(0,d.jsx)(`span`,{children:i?`${new Date(i.updatedAt).toLocaleString(`zh-CN`)} 读取归档`:`正在读取归档…`})]}),a&&(0,d.jsxs)(`p`,{role:`alert`,className:`gw-message`,children:[a,` `,(0,d.jsx)(`button`,{onClick:()=>p(),children:`重试`})]}),(0,d.jsxs)(`section`,{className:`gw-panel`,children:[(0,d.jsxs)(`div`,{className:`gw-section-title`,children:[(0,d.jsxs)(`div`,{children:[(0,d.jsx)(`h2`,{children:`数据资产目录`}),(0,d.jsx)(`p`,{children:`按项目保存原件,每份资料都有来源和日期。`})]}),(0,d.jsxs)(`span`,{children:[v.length,` 个数据集`]})]}),(0,d.jsx)(`div`,{className:`gw-filters`,children:(0,d.jsxs)(`label`,{children:[(0,d.jsx)(t,{size:14}),(0,d.jsx)(`input`,{"aria-label":`搜索经营数据集`,value:g,onChange:e=>_(e.target.value),placeholder:`搜索数据集、项目或来源`})]})}),(0,d.jsx)(`div`,{className:`gw-table-scroll`,children:(0,d.jsxs)(`table`,{children:[(0,d.jsx)(`thead`,{children:(0,d.jsxs)(`tr`,{children:[(0,d.jsx)(`th`,{children:`数据集`}),(0,d.jsx)(`th`,{children:`所属项目`}),(0,d.jsx)(`th`,{children:`统计时间`}),(0,d.jsx)(`th`,{children:`数据状态`}),(0,d.jsx)(`th`,{children:`记录数`}),(0,d.jsx)(`th`,{children:`查看`})]})}),(0,d.jsx)(`tbody`,{children:y.map(e=>(0,d.jsxs)(`tr`,{children:[(0,d.jsxs)(`td`,{children:[(0,d.jsx)(`b`,{children:e.title}),(0,d.jsx)(`small`,{children:e.source||`未提供来源`})]}),(0,d.jsx)(`td`,{children:e.projectName}),(0,d.jsxs)(`td`,{children:[e.period||`未标注统计窗口`,(0,d.jsxs)(`small`,{children:[`归档 `,e.created.slice(0,10)]})]}),(0,d.jsx)(`td`,{children:b[e.mode]}),(0,d.jsx)(`td`,{children:e.rowCount}),(0,d.jsxs)(`td`,{children:[(0,d.jsx)(`a`,{href:`/api/workbench/`+e.project+`/file/`+e.id,children:`原件`}),(0,d.jsx)(`button`,{onClick:()=>r(e.project,{tab:`data`,datasetId:e.id}),children:`项目数据`})]})]},e.id))})]})}),!y.length&&!a&&(0,d.jsx)(`p`,{role:`status`,children:f?`正在读取资料…`:g?`没有匹配的数据集,请调整搜索。`:`当前资料范围没有数据集。`})]})]})})}var p=(0,c.lazy)(()=>i(()=>import(`./project-public-HdtYycKS.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]),import.meta.url));function m({section:e,project:t}){return t?(0,d.jsx)(c.Suspense,{fallback:(0,d.jsx)(`p`,{role:`status`,children:`正在打开项目资料…`}),children:(0,d.jsx)(p,{section:e,project:t})}):(0,d.jsx)(f,{})}export{m as default};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./project-public-CgW1u7BI.js","./index-DLSVWUSu.js","./index-BgJNmU0Z.css","./arrow-up-right-IBQoN72x.js","./book-open-Cqdn6s-H.js","./link-2-VLti-YG9.js","./chevron-right-e65CaeL6.js","./download-DfM49VvV.js","./file-text-DKAT5fzJ.js","./plus-D78h7lrw.js","./search-DFdSppzm.js","./workspace-view-state-D0ujRczW.js","./EmptyState-CUHuNsaV.js","./layers-CjsT_HGi.js","./HelpTip-BqRBO41J.js","./HelpTip-BsHPhMNf.css","./project-public-IxjCdnaB.css"])))=>i.map(i=>d[i]);
2
+ import{t as e}from"./refresh-cw-CxbRf97c.js";import{t}from"./search-DFdSppzm.js";import{g as n,o as r,t as i,y as a}from"./index-DLSVWUSu.js";import{n as o}from"./module-host-DNtiV4gZ.js";import{n as s}from"./workspace-view-state-D0ujRczW.js";import"./public-C-PBMVOQ.js";var c=a(n(),1);function l(e){let[t,n]=(0,c.useState)(null),[r,i]=(0,c.useState)(``),[a,o]=(0,c.useState)(!0),s=(0,c.useRef)(0),l=(0,c.useCallback)(()=>{let t=++s.current;return e().then(e=>{s.current===t&&(n(e),i(``))}).catch(e=>{s.current===t&&i(e instanceof Error?e.message:`资料读取失败`)}).finally(()=>{s.current===t&&o(!1)})},[e]),u=(0,c.useCallback)(()=>{s.current++},[]);return(0,c.useEffect)(()=>(l(),u),[l,u]),{data:t,error:r,busy:a,refresh:(0,c.useCallback)(()=>{o(!0),i(``),l()},[l])}}async function u(e){let t=await e(`/growth-center?view=catalog`);if(!t||typeof t!=`object`||!(`catalog`in t)||!Array.isArray(t.catalog)||!(`updatedAt`in t)||typeof t.updatedAt!=`string`)throw Error(`资料目录格式异常,请刷新重试`);if(!t.catalog.every(e=>e&&typeof e.id==`string`&&typeof e.project==`string`&&typeof e.title==`string`&&typeof e.created==`string`&&typeof e.mode==`string`))throw Error(`资料目录记录不完整`);return t}var d=r();function f(){let{api:n,onOpen:r}=o(),{data:i,error:a,busy:f,refresh:p}=l((0,c.useCallback)(()=>u(n),[n])),[m,h]=s(`resources.scope`,`real`),[g,_]=s(`resources.query`,``),v=(i?.catalog||[]).filter(e=>m===`stored-demo`?e.mode===`simulated`:e.mode!==`simulated`),y=[...v].reverse().filter(e=>`${e.title} ${e.projectName} ${e.source}`.toLowerCase().includes(g.toLowerCase())),b={simulated:`模拟数据`,"declared-real":`来源标注真实`,unverified:`来源待核实`};return(0,d.jsx)(`div`,{className:`resources-module gw`,children:(0,d.jsxs)(`div`,{className:`gw-body`,children:[(0,d.jsxs)(`header`,{className:`gw-header`,children:[(0,d.jsxs)(`div`,{children:[(0,d.jsx)(`small`,{children:`工作台 / 数据中心`}),(0,d.jsx)(`h1`,{children:`经营数据中心`})]}),(0,d.jsxs)(`div`,{className:`gw-header-actions`,children:[(0,d.jsxs)(`span`,{children:[(0,d.jsx)(`i`,{className:`gw-dot`}),m===`stored-demo`?`模拟归档 · 非真实经营`:`归档数据 · 非实时`]}),(0,d.jsxs)(`button`,{onClick:()=>p(),disabled:f,children:[(0,d.jsx)(e,{size:14}),f?`读取中`:`刷新数据`]})]})]}),(0,d.jsxs)(`div`,{className:`gw-scope`,children:[(0,d.jsx)(`div`,{children:[[`real`,`非模拟资料`],[`stored-demo`,`模拟资料`]].map(([e,t])=>(0,d.jsx)(`button`,{"aria-pressed":m===e,onClick:()=>h(e),children:t},e))}),(0,d.jsx)(`span`,{children:i?`${new Date(i.updatedAt).toLocaleString(`zh-CN`)} 读取归档`:`正在读取归档…`})]}),a&&(0,d.jsxs)(`p`,{role:`alert`,className:`gw-message`,children:[a,` `,(0,d.jsx)(`button`,{onClick:()=>p(),children:`重试`})]}),(0,d.jsxs)(`section`,{className:`gw-panel`,children:[(0,d.jsxs)(`div`,{className:`gw-section-title`,children:[(0,d.jsxs)(`div`,{children:[(0,d.jsx)(`h2`,{children:`数据资产目录`}),(0,d.jsx)(`p`,{children:`按项目保存原件,每份资料都有来源和日期。`})]}),(0,d.jsxs)(`span`,{children:[v.length,` 个数据集`]})]}),(0,d.jsx)(`div`,{className:`gw-filters`,children:(0,d.jsxs)(`label`,{children:[(0,d.jsx)(t,{size:14}),(0,d.jsx)(`input`,{"aria-label":`搜索经营数据集`,value:g,onChange:e=>_(e.target.value),placeholder:`搜索数据集、项目或来源`})]})}),(0,d.jsx)(`div`,{className:`gw-table-scroll`,children:(0,d.jsxs)(`table`,{children:[(0,d.jsx)(`thead`,{children:(0,d.jsxs)(`tr`,{children:[(0,d.jsx)(`th`,{children:`数据集`}),(0,d.jsx)(`th`,{children:`所属项目`}),(0,d.jsx)(`th`,{children:`统计时间`}),(0,d.jsx)(`th`,{children:`数据状态`}),(0,d.jsx)(`th`,{children:`记录数`}),(0,d.jsx)(`th`,{children:`查看`})]})}),(0,d.jsx)(`tbody`,{children:y.map(e=>(0,d.jsxs)(`tr`,{children:[(0,d.jsxs)(`td`,{children:[(0,d.jsx)(`b`,{children:e.title}),(0,d.jsx)(`small`,{children:e.source||`未提供来源`})]}),(0,d.jsx)(`td`,{children:e.projectName}),(0,d.jsxs)(`td`,{children:[e.period||`未标注统计窗口`,(0,d.jsxs)(`small`,{children:[`归档 `,e.created.slice(0,10)]})]}),(0,d.jsx)(`td`,{children:b[e.mode]}),(0,d.jsx)(`td`,{children:e.rowCount}),(0,d.jsxs)(`td`,{children:[(0,d.jsx)(`a`,{href:`/api/workbench/`+e.project+`/file/`+e.id,children:`原件`}),(0,d.jsx)(`button`,{onClick:()=>r(e.project,{tab:`data`,datasetId:e.id}),children:`项目数据`})]})]},e.id))})]})}),!y.length&&!a&&(0,d.jsx)(`p`,{role:`status`,children:f?`正在读取资料…`:g?`没有匹配的数据集,请调整搜索。`:`当前资料范围没有数据集。`})]})]})})}var p=(0,c.lazy)(()=>i(()=>import(`./project-public-CgW1u7BI.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]),import.meta.url));function m({section:e,project:t}){return t?(0,d.jsx)(c.Suspense,{fallback:(0,d.jsx)(`p`,{role:`status`,children:`正在打开项目资料…`}),children:(0,d.jsx)(p,{section:e,project:t})}):(0,d.jsx)(f,{})}export{m as default};
@@ -0,0 +1 @@
1
+ import{g as e,y as t}from"./index-DLSVWUSu.js";import{n}from"./workspace-view-state-D0ujRczW.js";import"./public-C-PBMVOQ.js";import{t as r}from"./api-KZa8CR8X.js";var i=t(e(),1),a={category:`类目`,shop:`店铺`,product:`商品`};function o(e){let[t,a]=n(`market.favorites.collection`,null),[o,s]=(0,i.useState)(``),[c,l]=(0,i.useState)(``),[u,d]=(0,i.useState)(!0),[f,p]=(0,i.useState)(null),[m,h]=(0,i.useState)(0),[g,_]=(0,i.useState)(``),[v,y]=(0,i.useState)({kind:e,count:24}),b=(0,i.useRef)(!1),x=(0,i.useRef)(new Set),S=(0,i.useCallback)(()=>h(e=>e+1),[]),C=(0,i.useCallback)(()=>{b.current=!0,S()},[S]),w=(0,i.useCallback)(t=>y(n=>n.kind===e&&n.count===t?n:{kind:e,count:t}),[e]),T=(0,i.useMemo)(()=>(t?.entries||[]).filter(t=>t.kind===e),[t,e]),E=v.kind===e?v.count:24;(0,i.useEffect)(()=>(window.addEventListener(`omni:market-favorites-changed`,S),()=>window.removeEventListener(`omni:market-favorites-changed`,S)),[S]),(0,i.useEffect)(()=>{let e=new AbortController;return Promise.resolve().then(async()=>{if(!e.signal.aborted){d(!0),s(``),l(``);try{let t=await r.favorites(e.signal);if(t.contractVersion!==1||!Array.isArray(t.entries))throw Error(`收藏数据契约版本不兼容`);e.signal.aborted||(x.current.clear(),b.current&&(t.entries=t.entries.map(e=>({...e,needsRefresh:!0}))),b.current=!1,a(t))}catch(t){e.signal.aborted||(t&&typeof t==`object`&&`status`in t&&[401,403].includes(Number(t.status))&&a(null),s(t instanceof Error?t.message:`收藏读取失败`))}finally{e.signal.aborted||d(!1)}}}),()=>e.abort()},[m,a]),(0,i.useEffect)(()=>{let t=T.slice(0,E).filter(e=>e.needsRefresh&&!x.current.has(e.kind+`:`+e.key)).slice(0,6);if(!t.length)return;let n=new AbortController;return Promise.resolve().then(async()=>{if(!n.signal.aborted){p(e);try{let e=await r.refreshFavorites(t.map(e=>({kind:e.kind,key:e.key})),n.signal);if(n.signal.aborted)return;t.forEach(e=>x.current.add(e.kind+`:`+e.key));let i=new Map(e.entries.map(e=>[e.kind+`:`+e.key,e]));a(e=>e&&{...e,entries:e.entries.map(e=>i.get(e.kind+`:`+e.key)||e)}),e.failed.length&&l(`部分收藏暂时无法更新,已保存的资料仍可使用。`)}catch(e){if(!n.signal.aborted){t.forEach(e=>x.current.add(e.kind+`:`+e.key));let n=e&&typeof e==`object`&&`status`in e?e.status:void 0;n===401||n===403?(a(null),s(`访问授权已变化,请重新检查收藏。`)):l(`资料更新暂未完成,可稍后点击刷新收藏。`)}}finally{n.signal.aborted||p(t=>t===e?null:t)}}}),()=>{n.abort(),p(t=>t===e?null:t)}},[T,e,E,a]);async function D(e,t,n){_(e+`:`+t),s(``);try{return await r.favorite(e,t,n),S(),!0}catch(e){return s(e instanceof Error?e.message:`收藏操作失败`),!1}finally{_(``)}}function O(t){let n=T.find(e=>e.key===t);return{kind:e,key:t,category:n?.snapshot.category,record:n?.snapshot.record,categoryPath:n?.snapshot.categoryPath}}return{collection:t,items:T,error:o,syncError:c,loading:u&&!t,syncing:f===e,busy:g,refresh:C,onVisibleCount:w,save:D,resolve:O}}var s={home:`_home_176h4_1`,top:`_top_176h4_2`,panel:`_panel_176h4_6`,row:`_row_176h4_7`,empty:`_empty_176h4_9`,recordInfo:`_recordInfo_176h4_10`,recordText:`_recordText_176h4_10`,metadata:`_metadata_176h4_10`,thumbnail:`_thumbnail_176h4_10`,actions:`_actions_176h4_11`,tabs:`_tabs_176h4_11`,adder:`_adder_176h4_15`,picker:`_picker_176h4_17`,pickRow:`_pickRow_176h4_18`};export{a as n,o as r,s as t};
@@ -1 +1 @@
1
- import{p as e}from"./index-BguiS02-.js";var t=e(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]);export{t};
1
+ import{p as e}from"./index-DLSVWUSu.js";var t=e(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]);export{t};
@@ -0,0 +1 @@
1
+ import{g as e,y as t}from"./index-DLSVWUSu.js";import{Bt as n,Ct as r,Ht as i,Lt as a,N as o,Ot as s,S as c,Ut as l,Vt as u,bt as d,kt as f,m as p,s as m,y as h}from"./CartesianChart-CP7p2vlm.js";var g=t(e());function _(){return _=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_.apply(null,arguments)}var v=e=>{var{cx:t,cy:n,r:i,className:a}=e,o=l(`recharts-dot`,a);return f(t)&&f(n)&&f(i)?g.createElement(`circle`,_({},u(e),r(e),{className:o,cx:t,cy:n,r:i})):null},y=[`points`];function b(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function x(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?b(Object(n),!0).forEach(function(t){S(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):b(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function S(e,t,n){return(t=C(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function C(e){var t=w(e,`string`);return typeof t==`symbol`?t:t+``}function w(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function T(){return T=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},T.apply(null,arguments)}function E(e,t){if(e==null)return{};var n,r,i=D(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function D(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function O(e){var{option:t,dotProps:n,className:r}=e;if((0,g.isValidElement)(t))return(0,g.cloneElement)(t,n);if(typeof t==`function`)return t(n);var i=l(r,typeof t==`boolean`?``:t.className),a=n??{},{points:o}=a,s=E(a,y);return g.createElement(v,T({},s,{className:i}))}function k(e,t){return e==null?!1:t?!0:e.length===1}function A(e){var{points:t,dot:r,className:i,dotClassName:s,dataKey:c,baseProps:l,needClip:u,clipPathId:d,zIndex:f=o.scatter}=e;if(!k(t,r))return null;var m=p(r),_=n(r),v=t.map((e,n)=>{var i=x(x(x({r:3},l),_),{},{index:n,cx:e.x??void 0,cy:e.y??void 0,dataKey:c,value:e.value,payload:e.payload,points:t});return g.createElement(O,{key:`dot-${n}`,option:r,dotProps:i,className:s})}),y={};return u&&d!=null&&(y.clipPath=`url(#clipPath-${m?``:`dots-`}${d})`),g.createElement(h,{zIndex:f},g.createElement(a,T({className:i},y),v))}function j(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function M(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?j(Object(n),!0).forEach(function(t){N(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):j(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function N(e,t,n){return(t=P(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function P(e){var t=F(e,`string`);return typeof t==`symbol`?t:t+``}function F(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var I=e=>{var{point:t,childIndex:n,mainColor:o,activeDot:s,dataKey:c,clipPath:l}=e;if(s===!1||t.x==null||t.y==null)return null;var u=M(M(M({},{index:n,dataKey:c,cx:t.x,cy:t.y,r:4,fill:o??`none`,strokeWidth:2,stroke:`#fff`,payload:t.payload,value:t.value}),i(s)),r(s)),d=(0,g.isValidElement)(s)?(0,g.cloneElement)(s,u):typeof s==`function`?s(u):g.createElement(v,u);return g.createElement(a,{className:`recharts-active-dot`,clipPath:l},d)};function L(e){var{points:t,mainColor:n,activeDot:r,itemDataKey:i,clipPath:a,zIndex:l=o.activeDot}=e,u=d(c),f=m();if(t==null||f==null)return null;var p=t.find(e=>f.includes(e.payload));return s(p)?null:g.createElement(h,{zIndex:l},g.createElement(I,{point:p,childIndex:Number(u),mainColor:n,dataKey:i,activeDot:r,clipPath:a}))}function R(e){var t=i(e),n=3,r=2;if(t!=null){var{r:a,strokeWidth:o}=t,s=Number(a),c=Number(o);return(Number.isNaN(s)||s<0)&&(s=n),(Number.isNaN(c)||c<0)&&(c=r),{r:s,strokeWidth:c}}return{r:n,strokeWidth:r}}export{L as n,A as r,R as t};
@@ -1 +1 @@
1
- import{p as e}from"./index-BguiS02-.js";var t=e(`grid-2x2`,[[`path`,{d:`M12 3v18`,key:`108xh3`}],[`path`,{d:`M3 12h18`,key:`1i2n21`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}]]);export{t};
1
+ import{p as e}from"./index-DLSVWUSu.js";var t=e(`grid-2x2`,[[`path`,{d:`M12 3v18`,key:`108xh3`}],[`path`,{d:`M3 12h18`,key:`1i2n21`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}]]);export{t};