@aiquants/enrichment-react 0.3.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +128 -71
- package/dist/index.cjs +3 -1
- package/dist/index.d.cts +236 -149
- package/dist/index.d.ts +236 -149
- package/dist/index.js +3 -1
- package/package.json +6 -6
package/dist/index.cjs
CHANGED
|
@@ -1 +1,3 @@
|
|
|
1
|
-
"use strict";var ft=Object.defineProperty;var Ia=Object.getOwnPropertyDescriptor;var _a=Object.getOwnPropertyNames;var Ca=Object.prototype.hasOwnProperty;var Pa=(e,t)=>{for(var o in t)ft(e,o,{get:t[o],enumerable:!0})},La=(e,t,o,c)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of _a(t))!Ca.call(e,l)&&l!==o&&ft(e,l,{get:()=>t[l],enumerable:!(c=Ia(t,l))||c.enumerable});return e};var $a=e=>La(ft({},"__esModule",{value:!0}),e);var $s={};Pa($s,{CHUNK_SOURCE_LABELS:()=>ca,DegradedSearchBanner:()=>xt,DocumentIngestConsole:()=>Ba,EnrichmentStrategyBoard:()=>Ua,FLOW_FOCUS_RING:()=>Te,FLOW_GEOMETRY:()=>ia,FLOW_NODE_TEXT:()=>Me,FinishedInstant:()=>Xe,GATE_POLICY_LABELS:()=>Ot,GATE_STATE_PRESENTATION:()=>Mt,InfrastructureHealthMonitor:()=>Va,MetadataSearchWorkbench:()=>Qa,ModelComparisonWorkbench:()=>Xa,NOTHING_TO_READ_LABELS:()=>jt,OntologyStatusCard:()=>Za,PHASE_LABELS:()=>Tt,PIPELINE_RUN_STATUS_PRESENTATION:()=>De,PIPELINE_STEP_STATUS_PRESENTATION:()=>ot,PIPELINE_TRIGGER_LABELS:()=>rt,PipelineFlowViewer:()=>ds,PipelineRunInspector:()=>vs,QdrantStorageCard:()=>Cs,REASON_LABELS:()=>Ut,RecordedInstant:()=>ge,SCORE_DISPLAY_DECIMALS:()=>Pt,SEARCH_MODE_LABELS:()=>It,SEARCH_PRESETS:()=>oa,STEP_CARDS_OPEN_LIMIT:()=>ba,SyncStatusMonitor:()=>Ls,UNFINISHED_LABEL:()=>vt,formatComparisonScore:()=>Ct,gateCaption:()=>ua,gateState:()=>Ft,gateStateOf:()=>wt,ingestRowAction:()=>Yt,layoutFlow:()=>$t,pipelineRunPresentationKey:()=>Le,rankAgreement:()=>ra,skipReasonLabel:()=>ht,stepGatePolicy:()=>At,stepGateState:()=>pa});module.exports=$a($s);var Re=require("react/jsx-runtime"),Ut={empty_query:"\u691C\u7D22\u8A9E\u304C\u7A7A\u306E\u305F\u3081\u3001\u610F\u5473\u691C\u7D22\u306F\u5B9F\u884C\u3057\u3066\u3044\u307E\u305B\u3093\u3002",caller_token_unavailable:"\u8A8D\u8A3C\u60C5\u5831\u3092\u53D6\u5F97\u3067\u304D\u306A\u304B\u3063\u305F\u305F\u3081\u3001\u610F\u5473\u691C\u7D22\u306F\u5B9F\u884C\u3057\u3066\u3044\u307E\u305B\u3093\u3002\u518D\u8AAD\u307F\u8FBC\u307F\u3057\u3066\u304F\u3060\u3055\u3044\u3002",time_window_unsupported:"\u671F\u9593\u306E\u7D5E\u308A\u8FBC\u307F\u306F\u610F\u5473\u691C\u7D22\u3067\u306F\u6307\u5B9A\u3067\u304D\u306A\u3044\u305F\u3081\u3001\u30AD\u30FC\u30EF\u30FC\u30C9\u4E00\u81F4\u306E\u307F\u3067\u8868\u793A\u3057\u3066\u3044\u307E\u3059\u3002",vector_tier_not_configured:"\u30D9\u30AF\u30C8\u30EB\u691C\u7D22\u304C\u3053\u306E\u914D\u5099\u3067\u69CB\u6210\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002",graph_tier_not_configured:"\u30B0\u30E9\u30D5\u691C\u7D22\u304C\u3053\u306E\u914D\u5099\u3067\u69CB\u6210\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002",no_active_vector_collection:"\u6709\u52B9\u306A\u30D9\u30AF\u30C8\u30EB\u30B3\u30EC\u30AF\u30B7\u30E7\u30F3\u304C 1 \u3064\u3082\u306A\u3044\u305F\u3081\u3001\u610F\u5473\u691C\u7D22\u306F\u5B9F\u884C\u3057\u3066\u3044\u307E\u305B\u3093\u3002",vector_collections_missing:"\u30D9\u30AF\u30C8\u30EB\u30B3\u30EC\u30AF\u30B7\u30E7\u30F3\u304C\u672A\u4F5C\u6210\u306E\u305F\u3081\u3001\u610F\u5473\u691C\u7D22\u306F\u5B9F\u884C\u3057\u3066\u3044\u307E\u305B\u3093\u3002\u6587\u66F8\u306E\u6295\u5F71\u304C\u5B8C\u4E86\u3059\u308B\u3068\u89E3\u6D88\u3057\u307E\u3059\u3002",remote_tiers_unavailable:"\u691C\u7D22\u88DC\u52A9\u30B5\u30FC\u30D3\u30B9\u306B\u63A5\u7D9A\u3067\u304D\u306A\u3044\u304B\u3001\u505C\u6B62\u4E2D\u3067\u3059\u3002\u30AD\u30FC\u30EF\u30FC\u30C9\u4E00\u81F4\u306E\u307F\u3067\u8868\u793A\u3057\u3066\u3044\u307E\u3059\u3002",remote_tiers_timed_out:"\u691C\u7D22\u88DC\u52A9\u30B5\u30FC\u30D3\u30B9\u304C\u6642\u9593\u5185\u306B\u7B54\u3048\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u30AD\u30FC\u30EF\u30FC\u30C9\u4E00\u81F4\u306E\u307F\u3067\u8868\u793A\u3057\u3066\u3044\u307E\u3059\u3002\u518D\u8A66\u884C\u3059\u308B\u304B\u6761\u4EF6\u3092\u7D5E\u3063\u3066\u304F\u3060\u3055\u3044\u3002",remote_tiers_refused_caller:"\u691C\u7D22\u88DC\u52A9\u30B5\u30FC\u30D3\u30B9\u304C\u3053\u306E\u5229\u7528\u8005\u306E\u8981\u6C42\u3092\u62D2\u5426\u3057\u307E\u3057\u305F (\u8A8D\u8A3C\u307E\u305F\u306F\u6A29\u9650)\u3002\u518D\u30B5\u30A4\u30F3\u30A4\u30F3\u3059\u308B\u304B\u3001\u6A29\u9650\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002",remote_tiers_rejected_request:"\u691C\u7D22\u88DC\u52A9\u30B5\u30FC\u30D3\u30B9\u304C\u691C\u7D22\u6761\u4EF6\u3092\u53D7\u3051\u4ED8\u3051\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u6761\u4EF6\u3092\u898B\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002",remote_tiers_failed:"\u691C\u7D22\u88DC\u52A9\u30B5\u30FC\u30D3\u30B9\u304C\u51E6\u7406\u4E2D\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002\u30AD\u30FC\u30EF\u30FC\u30C9\u4E00\u81F4\u306E\u307F\u3067\u8868\u793A\u3057\u3066\u3044\u307E\u3059\u3002\u7D9A\u304F\u5834\u5408\u306F\u7BA1\u7406\u8005\u3078\u9023\u7D61\u3057\u3066\u304F\u3060\u3055\u3044\u3002",remote_tiers_not_executed:"\u610F\u5473\u691C\u7D22\u304C\u5B9F\u884C\u3055\u308C\u307E\u305B\u3093\u3067\u3057\u305F (\u7406\u7531\u306F\u5831\u544A\u3055\u308C\u3066\u3044\u307E\u305B\u3093)\u3002",vector_search_disabled:"\u30D9\u30AF\u30C8\u30EB\u691C\u7D22\u304C\u7BA1\u7406\u8005\u306B\u3088\u308A\u7121\u52B9\u5316\u3055\u308C\u3066\u3044\u307E\u3059\u3002",graph_search_disabled:"\u30B0\u30E9\u30D5\u691C\u7D22\u304C\u7BA1\u7406\u8005\u306B\u3088\u308A\u7121\u52B9\u5316\u3055\u308C\u3066\u3044\u307E\u3059\u3002","circuit_breaker_open:vector":"\u30D9\u30AF\u30C8\u30EB\u691C\u7D22\u304C\u4E00\u6642\u7684\u306B\u906E\u65AD\u3055\u308C\u3066\u3044\u307E\u3059\u3002","circuit_breaker_open:graph":"\u30B0\u30E9\u30D5\u691C\u7D22\u304C\u4E00\u6642\u7684\u306B\u906E\u65AD\u3055\u308C\u3066\u3044\u307E\u3059\u3002"};function xt({metadata:e,onDismiss:t}){if(!e.is_degraded)return null;let c=(e.degradation_reason??"").split(",").map(l=>l.trim()).filter(l=>l.length>0);return(0,Re.jsx)("div",{role:"status","data-testid":"degraded-search-banner","data-quality-tier":e.quality_tier,"data-search-mode":e.search_mode,"data-degraded":"true",style:{padding:"12px 16px",borderRadius:"6px",border:"1px solid #f59e0b",backgroundColor:"#fffbeb",color:"#92400e",marginBottom:"12px"},children:(0,Re.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start"},children:[(0,Re.jsxs)("div",{children:[(0,Re.jsxs)("p",{"data-testid":"degraded-mode-message",style:{margin:0,fontWeight:600},children:["\u691C\u7D22\u7D50\u679C\u306F\u7E2E\u9000\u30E2\u30FC\u30C9 (",e.search_mode,") \u3067\u53D6\u5F97\u3055\u308C\u3066\u3044\u307E\u3059\u3002"]}),c.length>0&&(0,Re.jsx)("ul",{"data-testid":"degraded-reason-list",style:{margin:"6px 0 0 0",paddingLeft:"20px"},children:c.map(l=>(0,Re.jsx)("li",{"data-testid":`degraded-reason-${l}`,children:Ut[l]??l},l))})]}),t&&(0,Re.jsx)("button",{type:"button","data-testid":"degraded-banner-dismiss",onClick:t,"aria-label":"\u9589\u3058\u308B",style:{background:"none",border:"none",cursor:"pointer",color:"#92400e",fontWeight:"bold",fontSize:"14px",padding:"2px 6px"},children:"\u2715"})]})})}var Ee=require("@aiquants/enrichment-core"),V=require("react");var qt=require("@aiquants/console-ui/core");function Ae(e,t,o){try{(0,qt.formatCount)(e,o)}catch(c){throw new RangeError(`${t}: ${c.message}`,{cause:c})}return e}var Ht=1024,Ta=[{name:"B",power:0,fractionDigits:0},{name:"KiB",power:1,fractionDigits:1},{name:"MiB",power:2,fractionDigits:1},{name:"GiB",power:3,fractionDigits:2},{name:"TiB",power:4,fractionDigits:2}];function Gt(e,t){return Number((e/Ht**t.power).toFixed(t.fractionDigits))}function st(e,t,o){Ae(e,t,o);let[c,...l]=Ta,p=c,b=Gt(e,p);for(let m of l){if(b<Ht)break;p=m,b=Gt(e,p)}return`${new Intl.NumberFormat(o,{minimumFractionDigits:p.fractionDigits,maximumFractionDigits:p.fractionDigits,useGrouping:!0}).format(b)} ${p.name}`}var qe=require("@aiquants/console-ui"),yt=require("react");var We="ja-JP";function te(){let e=(0,qe.useConsoleUi)();if(e.locale!=="ja"||e.formatLocale!==We)throw new RangeError(`The ConsoleUiRoot must be locale "${"ja"}" and formatLocale "${We}", the language and format of this package's text (got locale "${e.locale}" and formatLocale "${e.formatLocale}")`);return e}function q(e){return te(),(0,yt.createElement)(qe.Measured,e)}function zt(e){return te(),(0,yt.createElement)(qe.RowButton,e)}var je=require("react/jsx-runtime"),Je=/[^\s\x1c-\x1f\x85\ufeff]/,Aa={fontVariantNumeric:"tabular-nums"},Da={fontVariantNumeric:"tabular-nums",whiteSpace:"nowrap"};function Wt({text:e,testId:t,slot:o}){if(te(),e===null)return(0,je.jsx)(q,{value:null,testId:t});if(!Je.test(e))throw new RangeError(`${t}: a measured text must not be empty or only white space (pass null when the value was not measured)`);return(0,je.jsx)("span",{"data-measured":"true","data-testid":t,style:o,children:e})}function Qe({text:e,testId:t}){return(0,je.jsx)(Wt,{text:e,testId:t,slot:Aa})}function Se({text:e,testId:t}){return(0,je.jsx)(Wt,{text:e,testId:t,slot:Da})}var nt=require("@aiquants/enrichment-core"),De={RUNNING:{label:"\u5B9F\u884C\u4E2D",className:"bg-blue-100 text-blue-800"},SUCCEEDED:{label:"\u6210\u529F",className:"bg-emerald-100 text-emerald-800"},FAILED:{label:"\u5931\u6557",className:"bg-red-100 text-red-800"},FAILED_RETRY_SCHEDULED:{label:"\u5931\u6557 (\u518D\u8A66\u884C\u4E88\u5B9A)",className:"bg-amber-100 text-amber-800"}},ot={RUNNING:{label:"\u5B9F\u884C\u4E2D",className:"bg-blue-100 text-blue-800",bar:"bg-blue-400"},SUCCEEDED:{label:"\u6210\u529F",className:"bg-emerald-100 text-emerald-800",bar:"bg-emerald-500"},SKIPPED:{label:"\u7701\u7565",className:"bg-slate-100 text-slate-700",bar:"bg-slate-300"},FAILED:{label:"\u5931\u6557",className:"bg-red-100 text-red-800",bar:"bg-red-500"}},rt={ingest:"\u53D6\u308A\u8FBC\u307F",retry:"\u518D\u8A66\u884C",resync:"\u518D\u540C\u671F"},vt="\u672A\u5B8C\u4E86";function Le(e){return e.status==="FAILED"&&e.retryScheduled?"FAILED_RETRY_SCHEDULED":e.status}var jt={no_pages:"\u8AAD\u3080\u5BFE\u8C61\u306A\u3057 (\u30DA\u30FC\u30B8\u306A\u3057)",no_pages_rendered:"\u8AAD\u3080\u5BFE\u8C61\u306A\u3057 (\u63CF\u753B\u3067\u304D\u305F\u30DA\u30FC\u30B8\u306A\u3057)"};function ht(e){let t=(0,nt.parseSkipReason)(e);if(t===null)return e;switch(t.kind){case"gate_closed":return`${t.featureFlagKey} \u304C\u7121\u52B9`;case"no_children":return"\u5B50\u30A2\u30BB\u30C3\u30C8\u306A\u3057";case"source_skipped":return`${nt.PIPELINE_STEPS[t.stepKey].label} \u304C\u5B9F\u884C\u3055\u308C\u306A\u304B\u3063\u305F`;case"nothing_to_read":return jt[t.token]}}var Jt=require("@aiquants/console-ui/core");function Qt(e,t){return(0,Jt.formatInstant)(e,We,t)}var Nt=require("react/jsx-runtime");function ge({iso:e,testId:t}){let{timeZone:o}=te();return(0,Nt.jsx)(Se,{text:e===null?null:Qt(e,o),testId:t})}function Xe({iso:e,testId:t}){return te(),e===null?vt:(0,Nt.jsx)(ge,{iso:e,testId:t})}var s=require("react/jsx-runtime"),Ma=new Set(Ee.EnrichmentSyncStatusSchema.options.filter(e=>e.startsWith("FAILED"))),Oa=new Set(Ee.EnrichmentSyncStatusSchema.options);function Yt(e){return e.isCurrent===!1?{kind:"blocked",reason:"\u65E7\u7248\u306E\u305F\u3081\u518D\u5B9F\u884C\u4E0D\u53EF"}:e.syncStatus==="SYNCED"?{kind:"resync"}:Ma.has(e.syncStatus)?{kind:"retry"}:Oa.has(e.syncStatus)?{kind:"blocked",reason:"\u51E6\u7406\u4E2D"}:{kind:"blocked",reason:"\u4E0D\u660E\u306A\u72B6\u614B"}}function Xt(e,t,o){let c=e?.find(l=>l.confidentialityLevel===t&&l.capability===o);return c?c.isEnabled:null}var Fa={PUBLIC:"\u5168\u516C\u958B",INTERNAL:"\u793E\u5185\u5171\u6709",DEPARTMENT:"\u90E8\u9580\u9650\u5B9A",CONFIDENTIAL:"\u6A5F\u5BC6 - \u65E2\u5B9A",RESTRICTED:"\u691C\u7D22\u5B8C\u5168\u9664\u5916\u30FB\u4FDD\u8B77"},Ka=["\u5951\u7D04\u66F8","\u6C7A\u7B97\u77ED\u4FE1","\u6280\u8853\u4ED5\u69D8\u66F8","\u793E\u5185\u898F\u7A0B","\u8B70\u4E8B\u9332","\u4EBA\u4E8B\u65B9\u91DD"];function St({field:e}){return(0,s.jsx)("span",{className:"text-red-700","data-testid":`ingest-required-mark-${e}`,children:"*"})}function Ba({policies:e,tenantId:t,domainOptions:o,recentItems:c=[],inspectionResult:l=null,isSubmitting:p=!1,isInspecting:b=!1,onInspectUri:m,onIngestDocument:y,onRetryItem:N,onShowHistory:h}){let{formatLocale:C}=te(),E=(0,V.useId)(),J=(0,V.useId)(),ae=(0,V.useId)(),K=(0,V.useId)(),I=(0,V.useId)(),Q=(0,V.useId)(),R=(0,V.useId)(),O=(0,V.useId)(),[A,L]=(0,V.useState)("gdrive://"),[G,g]=(0,V.useState)(""),[$,B]=(0,V.useState)(""),[D,re]=(0,V.useState)("CONFIDENTIAL"),[Z,be]=(0,V.useState)(null),[fe,_]=(0,V.useState)(""),[ie,H]=(0,V.useState)(""),[X,U]=(0,V.useState)([]),[xe,ne]=(0,V.useState)(""),[he,Ie]=(0,V.useState)("user"),[le,ye]=(0,V.useState)(1),[u,T]=(0,V.useState)(!1),ee=Z!==null&&o.some(r=>r.key===Z)?Z:o.length>0?o[0].key:null,z=(0,V.useMemo)(()=>({vectorEnabled:Xt(e,D,"vector_indexing"),graphEnabled:Xt(e,D,"graph_indexing")}),[e,D]),se=(0,V.useMemo)(()=>{let r=$.trim();if(!r)return{valid:!1,error:null};if(!(r.startsWith("file://")||r.startsWith("gdrive://")||r.startsWith("gcs://")))return{valid:!1,error:"\u8A31\u53EF\u3055\u308C\u305F\u30B9\u30AD\u30FC\u30E0 (file://, gdrive://, gcs://) \u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002"};let W=r.replace(/^(file|gdrive|gcs):\/\//,"");return!W.trim()||W.trim()==="<id>"||W.trim()==="<bucket>/<key>"?{valid:!1,error:"URI \u306E\u30D1\u30B9\u90E8\u5206\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002"}:r.includes("..")?{valid:!1,error:"\u76F8\u5BFE\u30D1\u30B9\u8A18\u53F7 (..) \u306B\u3088\u308B\u30D1\u30B9\u30C8\u30E9\u30D0\u30FC\u30B5\u30EB\u306F\u7981\u6B62\u3055\u308C\u3066\u3044\u307E\u3059\u3002"}:{valid:!0,error:null}},[$]),Fe=r=>{let k=r.trim(),W=k.match(/\/file\/d\/([a-zA-Z0-9_-]+)/);if(W)return W[1];let ve=k.match(/[?&]id=([a-zA-Z0-9_-]+)/);return ve?ve[1]:null},_e=r=>{if(L(r),G.trim()){let k=G.trim().replace(/^(file|gdrive|gcs):\/\//,"");B(`${r}${k}`)}else B("")},Ke=r=>{let k=r.trim();if(!k){g(""),B("");return}let W=Fe(k);if(W){L("gdrive://"),g(W),B(`gdrive://${W}`);return}if(k.startsWith("gdrive://")){L("gdrive://");let ve=k.replace(/^gdrive:\/\//,"");g(ve),B(k);return}if(k.startsWith("file://")){L("file://");let ve=k.replace(/^file:\/\//,"");g(ve),B(k);return}if(k.startsWith("gcs://")){L("gcs://");let ve=k.replace(/^gcs:\/\//,"");g(ve),B(k);return}if(k.includes("://")){g(r),B(k);return}g(r),B(`${A}${k}`)},we=r=>{switch(r){case"gdrive://":return"1EXAMPLEFILEID0000000000000000000 (\u30D5\u30A1\u30A4\u30EB ID \u307E\u305F\u306F\u5171\u6709\u30EA\u30F3\u30AF)";case"file://":return"/srv/documents/specification.md (\u7D76\u5BFE\u30D1\u30B9)";case"gcs://":return"my-bucket/documents/report.pdf (\u30D0\u30B1\u30C3\u30C8\u540D/\u30D1\u30B9)"}},M=()=>{let r=xe.trim();r&&(X.some(k=>k.labelKey===r)||(U(k=>[...k,{labelKey:r,category:he,confidenceScore:Number(le.toFixed(2))}]),ne("")))},Be=r=>{X.some(k=>k.labelKey===r)||U(k=>[...k,{labelKey:r,category:"domain",confidenceScore:1}])},Ne=r=>{U(k=>k.filter(W=>W.labelKey!==r))},at=r=>{if(r.preventDefault(),!se.valid||ee===null)return;let k={fileUri:$.trim(),confidentialityLevel:D,targetDomainKey:ee,departmentId:fe.trim()?Number(fe):null,titleOverride:ie.trim()?ie.trim():null,labels:X};y?.(k)},Ue=r=>{let k=Yt(r);if(k.kind==="blocked")return(0,s.jsx)("span",{className:"font-sans text-[11px] text-slate-500","data-testid":`ingest-action-blocked-${r.id}`,"data-reason":k.reason,children:k.reason});let W=k.kind==="retry";return(0,s.jsx)("button",{type:"button",onClick:()=>N?.(r.id),"aria-label":`${r.fileName} \u3092${W?"\u518D\u8A66\u884C":"\u518D\u540C\u671F"}`,className:W?"rounded-sm border border-red-200 border-solid bg-red-50 px-2 py-1 font-semibold text-red-700 text-xs hover:bg-red-100":"rounded-sm border border-emerald-200 border-solid bg-emerald-50 px-2 py-1 font-semibold text-emerald-700 text-xs hover:bg-emerald-100","data-testid":`ingest-${k.kind}-button-${r.id}`,children:W?"\u518D\u8A66\u884C":"\u518D\u540C\u671F"})},bt=r=>{switch(r){case"SYNCED":return(0,s.jsx)("span",{className:"inline-flex items-center rounded-full bg-emerald-100 px-2.5 py-0.5 font-semibold text-emerald-800 text-xs",children:"\u540C\u671F\u5B8C\u4E86"});case"PENDING":return(0,s.jsx)("span",{className:"inline-flex items-center rounded-full bg-slate-100 px-2.5 py-0.5 font-medium text-slate-800 text-xs",children:"\u5F85\u6A5F\u4E2D"});case"EXTRACTING":return(0,s.jsx)("span",{className:"inline-flex items-center rounded-full bg-blue-100 px-2.5 py-0.5 font-medium text-blue-800 text-xs",children:"\u672C\u6587\u62BD\u51FA\u4E2D"});case"ENRICHING":return(0,s.jsx)("span",{className:"inline-flex items-center rounded-full bg-purple-100 px-2.5 py-0.5 font-medium text-purple-800 text-xs",children:"AI \u8981\u7D04\u30FB\u69CB\u9020\u5316\u4E2D"});case"PROJECTING":return(0,s.jsx)("span",{className:"inline-flex items-center rounded-full bg-indigo-100 px-2.5 py-0.5 font-medium text-indigo-800 text-xs",children:"\u30D9\u30AF\u30C8\u30EB/\u30B0\u30E9\u30D5\u6295\u5F71\u4E2D"});default:return r.startsWith("FAILED")?(0,s.jsxs)("span",{className:"inline-flex items-center rounded-full bg-red-100 px-2.5 py-0.5 font-semibold text-red-800 text-xs",children:["\u5931\u6557: ",r]}):(0,s.jsx)("span",{className:"inline-flex items-center rounded-full bg-slate-100 px-2.5 py-0.5 font-medium text-slate-800 text-xs",children:r})}};return(0,s.jsxs)("div",{className:"space-y-6","data-testid":"document-ingest-console",children:[(0,s.jsxs)("div",{className:"rounded-xl border border-slate-200 border-solid bg-white p-6 shadow-sm",children:[(0,s.jsxs)("div",{className:"flex flex-col justify-between gap-2 md:flex-row md:items-center",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h2",{className:"font-bold text-base text-slate-900",children:"\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u53D6\u308A\u8FBC\u307F & \u30E1\u30BF\u30C7\u30FC\u30BF\u751F\u6210"}),(0,s.jsx)("p",{className:"mt-1 text-slate-500 text-sm",children:"\u5BFE\u8C61 URI \u3092\u6307\u5B9A\u3057\u3066\u672C\u6587\u62BD\u51FA\u30FBAI \u8981\u7D04\u30FB\u69CB\u9020\u5316\u30E1\u30BF\u30C7\u30FC\u30BF\u4ED8\u4E0E\u30FBQdrant \u30D9\u30AF\u30C8\u30EB\u304A\u3088\u3073 Neo4j \u30B0\u30E9\u30D5\u3078\u306E\u6295\u5F71\u3092\u5B9F\u884C\u3057\u307E\u3059\u3002"})]}),(0,s.jsxs)("div",{className:"inline-flex items-center rounded-lg border border-slate-200 border-solid bg-slate-50 px-3 py-1.5 font-medium text-slate-600 text-xs",children:["\u30C6\u30CA\u30F3\u30C8: ",(0,s.jsx)("span",{className:"ml-1.5 font-bold text-slate-800",children:t})]})]}),(0,s.jsxs)("form",{onSubmit:at,className:"mt-6 space-y-6",children:[(0,s.jsxs)("div",{className:"space-y-3","data-testid":"document-uri-input-group",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,s.jsxs)("label",{htmlFor:E,className:"block font-semibold text-slate-800 text-sm",children:["\u30D5\u30A1\u30A4\u30EB URI / \u30EA\u30BD\u30FC\u30B9\u8B58\u5225\u5B50 ",(0,s.jsx)(St,{field:"uri"})]}),(0,s.jsxs)("span",{className:"font-mono text-slate-500 text-xs",children:["\u9078\u629E\u30B9\u30AD\u30FC\u30E0: ",(0,s.jsx)("strong",{className:"font-semibold text-indigo-600",children:A})]})]}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsx)("span",{className:"font-medium text-slate-500 text-xs",children:"\u30B9\u30AD\u30FC\u30E0\u6307\u5B9A:"}),(0,s.jsx)("button",{type:"button",onClick:()=>_e("gdrive://"),className:`rounded-sm border border-solid px-2.5 py-1 font-mono text-xs transition-colors ${A==="gdrive://"?"border-indigo-600 bg-indigo-50 font-semibold text-indigo-700 shadow-sm":"border-slate-200 bg-slate-100 text-slate-700 hover:bg-slate-200"}`,"data-testid":"scheme-select-gdrive",children:"gdrive:// (Google Drive)"}),(0,s.jsx)("button",{type:"button",onClick:()=>_e("file://"),className:`rounded-sm border border-solid px-2.5 py-1 font-mono text-xs transition-colors ${A==="file://"?"border-indigo-600 bg-indigo-50 font-semibold text-indigo-700 shadow-sm":"border-slate-200 bg-slate-100 text-slate-700 hover:bg-slate-200"}`,"data-testid":"scheme-select-file",children:"file:// (\u30ED\u30FC\u30AB\u30EB)"}),(0,s.jsx)("button",{type:"button",onClick:()=>_e("gcs://"),className:`rounded-sm border border-solid px-2.5 py-1 font-mono text-xs transition-colors ${A==="gcs://"?"border-indigo-600 bg-indigo-50 font-semibold text-indigo-700 shadow-sm":"border-slate-200 bg-slate-100 text-slate-700 hover:bg-slate-200"}`,"data-testid":"scheme-select-gcs",children:"gcs:// (GCS)"})]}),(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsxs)("div",{className:"flex flex-wrap gap-2 sm:flex-nowrap",children:[(0,s.jsxs)("div",{className:`flex min-w-0 grow basis-full rounded-lg border border-solid shadow-sm transition-colors focus-within:ring-2 sm:basis-0 ${se.error?"border-red-300 focus-within:border-red-500 focus-within:ring-red-200":"border-slate-300 focus-within:border-indigo-500 focus-within:ring-indigo-100"}`,children:[(0,s.jsx)("span",{className:"inline-flex select-none items-center rounded-l-lg border-slate-200 border-r border-solid bg-slate-50 px-3.5 font-mono font-semibold text-slate-700 text-sm","data-testid":"scheme-prefix-badge",children:A}),(0,s.jsx)("input",{id:E,type:"text",value:G,onChange:r=>Ke(r.target.value),placeholder:we(A),"aria-invalid":!!se.error,"aria-describedby":se.error?"ingest-uri-error":void 0,className:"min-w-0 flex-1 rounded-r-lg px-3.5 py-2 font-mono text-sm focus:outline-none","data-testid":"ingest-file-uri-input",required:!0})]}),(0,s.jsx)("button",{type:"button",onClick:()=>m?.($.trim()),disabled:!se.valid||b,className:"inline-flex items-center justify-center rounded-lg border border-slate-300 border-solid bg-white px-4 py-2 font-medium text-slate-700 text-sm shadow-sm hover:bg-slate-50 disabled:opacity-50","data-testid":"ingest-inspect-uri-button",children:b?"\u691C\u8A3C\u4E2D...":"URI \u4E8B\u524D\u691C\u8A3C"})]}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-1 text-xs",children:[(0,s.jsxs)("p",{className:"text-slate-500",children:[A==="gdrive://"&&"Google Drive \u306E\u30D5\u30A1\u30A4\u30EB ID (\u4F8B: 1EXAMPLEFILEID0000000000000000000) \u307E\u305F\u306F URL \u3092\u8CBC\u308A\u4ED8\u3051\u308B\u3068\u81EA\u52D5\u62BD\u51FA\u3055\u308C\u307E\u3059\u3002",A==="file://"&&"\u30EF\u30FC\u30AF\u30B9\u30DA\u30FC\u30B9\u5185\u306E\u7D76\u5BFE\u30D1\u30B9 (\u4F8B: /srv/documents/sample.md) \u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002",A==="gcs://"&&"GCS \u306E\u30D0\u30B1\u30C3\u30C8\u540D/\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u30D1\u30B9 (\u4F8B: my-bucket/documents/report.pdf) \u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002"]}),$&&(0,s.jsxs)("div",{className:"flex items-center gap-1 font-mono text-slate-500",children:[(0,s.jsx)("span",{children:"\u89E3\u6C7A URI:"}),(0,s.jsx)("code",{className:"rounded-sm bg-slate-100 px-1.5 py-0.5 font-bold text-indigo-700","data-testid":"resolved-uri-code",children:$})]})]})]}),se.error&&(0,s.jsx)("p",{id:"ingest-uri-error",className:"text-red-600 text-xs",role:"alert","data-testid":"ingest-uri-error",children:se.error})]}),l&&l.fileUri===$.trim()&&(0,s.jsxs)("section",{"aria-live":"polite","aria-label":"\u30EA\u30BD\u30FC\u30B9\u691C\u8A3C\u7D50\u679C",className:`rounded-lg border border-solid p-4 text-sm transition-all ${l.exists?"border-emerald-200 bg-emerald-50/60 text-emerald-950":"border-red-200 bg-red-50/60 text-red-950"}`,"data-testid":"inspection-result-card",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("span",{className:"font-semibold",children:l.exists?"\u2713 \u30EA\u30BD\u30FC\u30B9\u78BA\u8A8D\u5B8C\u4E86 (\u30A2\u30AF\u30BB\u30B9\u53EF\u80FD)":"\u26A0 \u30EA\u30BD\u30FC\u30B9\u4E0D\u9054 (\u30D5\u30A1\u30A4\u30EB\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093)"}),(0,s.jsx)("span",{className:"font-mono text-slate-500 text-xs",children:l.fileUri})]}),l.exists&&(0,s.jsxs)("div",{className:"mt-2 grid grid-cols-2 gap-4 font-mono text-xs md:grid-cols-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"block text-slate-500",children:"\u30D5\u30A1\u30A4\u30EB\u540D:"}),(0,s.jsx)("span",{className:"font-semibold text-slate-800",children:l.fileName})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"block text-slate-500",children:"\u30B5\u30A4\u30BA:"}),(0,s.jsx)("span",{className:"font-semibold text-slate-800",children:(0,s.jsx)(Se,{text:st(l.fileSize,"fileSize",C),testId:"inspection-file-size-value"})})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"block text-slate-500",children:"MIME:"}),(0,s.jsx)("span",{className:"font-semibold text-slate-800",children:l.mimeType})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"block text-slate-500",children:"\u30EA\u30D3\u30B8\u30E7\u30F3:"}),(0,s.jsx)("span",{className:"font-semibold text-slate-800",children:l.revisionId?.slice(0,8)??"N/A"})]})]})]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-3",children:[(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsxs)("label",{htmlFor:J,className:"block font-semibold text-slate-700 text-xs",children:["\u6A5F\u5BC6\u533A\u5206 (Confidentiality Level) ",(0,s.jsx)(St,{field:"confidentiality"})]}),(0,s.jsx)("select",{id:J,value:D,onChange:r=>re(r.target.value),className:"w-full rounded-lg border border-slate-300 border-solid bg-white px-3 py-2 text-slate-800 text-sm focus:border-indigo-500 focus:outline-none focus:ring-1 focus:ring-indigo-500","data-testid":"ingest-confidentiality-select",children:Ee.ConfidentialityLevelSchema.options.map(r=>(0,s.jsxs)("option",{value:r,children:[r," (",Fa[r],")"]},r))})]}),(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsxs)("label",{htmlFor:ae,className:"block font-semibold text-slate-700 text-xs",children:["\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3 (Target Domain) ",(0,s.jsx)(St,{field:"domain"})]}),(0,s.jsx)("select",{id:ae,value:ee===null?"":ee,onChange:r=>be(r.target.value),disabled:o.length===0,className:"w-full rounded-lg border border-slate-300 border-solid bg-white px-3 py-2 text-slate-800 text-sm focus:border-indigo-500 focus:outline-none focus:ring-1 focus:ring-indigo-500 disabled:cursor-not-allowed disabled:bg-slate-100","data-testid":"ingest-domain-select",children:o.map(r=>(0,s.jsx)("option",{value:r.key,children:r.label},r.key))}),o.length===0&&(0,s.jsx)("p",{className:"text-[11px] text-amber-800","data-testid":"ingest-domain-empty",children:"\u9078\u3079\u308B\u30C9\u30E1\u30A4\u30F3\u304C\u6E21\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002\u30C9\u30E1\u30A4\u30F3\u304C\u7121\u3044\u3068\u53D6\u308A\u8FBC\u307F\u306F\u6295\u5165\u3067\u304D\u307E\u305B\u3093\u3002"})]})]}),D===Ee.QUARANTINED_CONFIDENTIALITY_LEVEL&&(0,s.jsxs)("div",{className:"rounded-lg border border-amber-300 border-solid bg-amber-50 p-3 text-amber-900 text-xs",role:"alert","data-testid":"restricted-warning-banner",children:[(0,s.jsx)("span",{className:"font-bold",children:"\u3010\u9694\u96E2\u6CE8\u610F\u3011"})," ",Ee.QUARANTINED_CONFIDENTIALITY_LEVEL," \u306B\u8A2D\u5B9A\u3055\u308C\u305F\u6587\u66F8\u306F\u3001\u6CD5\u4EE4\u9075\u5B88\u30FB\u4FC2\u4E89\u4FDD\u5168\u306E\u305F\u3081\u691C\u7D22\u7D50\u679C\u306B\u4E00\u5207\u51FA\u73FE\u3057\u307E\u305B\u3093\u3002\u3053\u308C\u306F\u8A2D\u5B9A\u3067\u306F\u306A\u304F\u4FDD\u8A3C\u3067\u3042\u308A\u3001\u30DD\u30EA\u30B7\u30FC\u306E\u5024\u306B\u4F9D\u3089\u305A\u5E38\u306B\u6210\u7ACB\u3057\u307E\u3059\u3002",(0,s.jsx)("span",{className:"mt-1 block text-amber-800",children:"\u7D22\u5F15\u305D\u306E\u3082\u306E\u3092\u884C\u3046\u304B\u3069\u3046\u304B\u306F\u5225\u306E\u8A2D\u5B9A\u3067\u3059 (\u4E0B\u306E\u6295\u5F71\u5148\u3092\u53C2\u7167)\u3002\u7D22\u5F15\u3055\u308C\u305F\u6587\u66F8\u3082\u691C\u7D22\u7D50\u679C\u306B\u306F\u73FE\u308C\u307E\u305B\u3093\u3002"})]}),(0,s.jsxs)("div",{className:"space-y-2 rounded-lg border border-indigo-100 border-solid bg-indigo-50/30 p-4","data-testid":"projection-capability-card",children:[(0,s.jsx)("span",{className:"block font-semibold text-indigo-950 text-xs",children:"\u3053\u306E\u6A5F\u5BC6\u533A\u5206\u306B\u5BFE\u3059\u308B\u6295\u5F71\u306E\u53EF\u5426 (Projection)"}),(0,s.jsxs)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[(0,s.jsxs)("div",{className:"rounded-sm border border-indigo-200/80 border-solid bg-white p-2.5",children:[(0,s.jsx)("span",{className:"block font-semibold text-slate-600 text-xs",children:"\u30D9\u30AF\u30C8\u30EB\u7D22\u5F15 (Qdrant)"}),(0,s.jsx)("span",{className:"mt-1 block font-bold text-xs","data-testid":"projection-vector-state","data-state":z.vectorEnabled===null?"unknown":String(z.vectorEnabled),children:z.vectorEnabled===null?"\u8A2D\u5B9A\u304C\u6E21\u3055\u308C\u3066\u3044\u306A\u3044\u305F\u3081\u4E0D\u660E":z.vectorEnabled?"\u6709\u52B9":`\u7121\u52B9 (${D} \u306E\u8A2D\u5B9A)`})]}),(0,s.jsxs)("div",{className:"rounded-sm border border-indigo-200/80 border-solid bg-white p-2.5",children:[(0,s.jsx)("span",{className:"block font-semibold text-slate-600 text-xs",children:"\u30B0\u30E9\u30D5\u7D22\u5F15 (Neo4j)"}),(0,s.jsx)("span",{className:"mt-1 block font-bold text-xs","data-testid":"projection-graph-state","data-state":z.graphEnabled===null?"unknown":String(z.graphEnabled),children:z.graphEnabled===null?"\u8A2D\u5B9A\u304C\u6E21\u3055\u308C\u3066\u3044\u306A\u3044\u305F\u3081\u4E0D\u660E":z.graphEnabled?"\u6709\u52B9":`\u7121\u52B9 (${D} \u306E\u8A2D\u5B9A)`})]})]}),(0,s.jsxs)("p",{className:"text-[11px] text-slate-600","data-testid":"projection-destination-note",children:["\u6295\u5F71\u5148\u306E\u30B3\u30EC\u30AF\u30B7\u30E7\u30F3\u540D\u30FB\u30B0\u30E9\u30D5\u30E9\u30D9\u30EB\u30FB\u30C1\u30E3\u30F3\u30AF\u5206\u5272\u65B9\u5F0F\u306F\u3001\u9078\u629E\u3057\u305F\u30C9\u30E1\u30A4\u30F3\u306B\u5BFE\u3059\u308B\u914D\u5099\u306E\u53D6\u308A\u8FBC\u307F\u6226\u7565 (",(0,s.jsx)("code",{className:"font-mono",children:"tm_enrichment_strategy"}),") \u304C\u6C7A\u3081\u307E\u3059\u3002\u3053\u306E\u753B\u9762\u3067\u306F\u63A8\u5B9A\u3057\u307E\u305B\u3093\u3002"]})]}),(0,s.jsxs)("div",{className:"space-y-3 rounded-lg border border-slate-200 border-solid bg-slate-50/50 p-4",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("span",{className:"font-semibold text-slate-800 text-xs",children:"\u4ED8\u52A0\u60C5\u5831 / \u30E9\u30D9\u30EB\u30BF\u30B0 (Labels & Tags)"}),(0,s.jsxs)("span",{className:"text-slate-500 text-xs",children:[X.length," \u4EF6\u8A2D\u5B9A\u4E2D"]})]}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,s.jsx)("span",{className:"text-slate-500 text-xs",children:"\u30AF\u30A4\u30C3\u30AF\u5019\u88DC:"}),Ka.map(r=>(0,s.jsxs)("button",{type:"button",onClick:()=>Be(r),className:"rounded-full border border-slate-200 border-solid bg-white px-2.5 py-0.5 text-slate-700 text-xs transition-colors hover:border-indigo-300 hover:text-indigo-600","data-testid":`preset-tag-${r}`,children:["+ ",r]},r))]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 items-end gap-2 sm:grid-cols-5",children:[(0,s.jsxs)("div",{className:"space-y-1 sm:col-span-2",children:[(0,s.jsx)("label",{htmlFor:Q,className:"block text-slate-600 text-xs",children:"\u30E9\u30D9\u30EB\u540D / \u30AD\u30FC"}),(0,s.jsx)("input",{id:Q,type:"text",value:xe,onChange:r=>ne(r.target.value),onKeyDown:r=>{r.key==="Enter"&&(r.preventDefault(),M())},placeholder:"\u4F8B: \u91CD\u8981\u9867\u5BA2\u5951\u7D04, 2026\u5E74\u5EA6",className:"w-full rounded-sm border border-slate-300 border-solid bg-white px-2.5 py-1.5 text-slate-800 text-xs focus:outline-none focus:ring-1 focus:ring-indigo-500","data-testid":"ingest-label-key-input"})]}),(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)("label",{htmlFor:R,className:"block text-slate-600 text-xs",children:"\u7A2E\u5225"}),(0,s.jsxs)("select",{id:R,value:he,onChange:r=>Ie(r.target.value),className:"w-full rounded-sm border border-slate-300 border-solid bg-white px-2 py-1.5 text-slate-800 text-xs focus:outline-none focus:ring-1 focus:ring-indigo-500","data-testid":"ingest-label-category-select",children:[(0,s.jsx)("option",{value:"user",children:"\u30E6\u30FC\u30B6\u30FC (user)"}),(0,s.jsx)("option",{value:"domain",children:"\u30C9\u30E1\u30A4\u30F3 (domain)"}),(0,s.jsx)("option",{value:"system",children:"\u30B7\u30B9\u30C6\u30E0 (system)"})]})]}),(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsxs)("label",{htmlFor:O,className:"block text-slate-600 text-xs",children:["\u78BA\u4FE1\u5EA6 (",le.toFixed(2),": 0.00\u301C1.00 AI/\u81EA\u52D5\u5224\u5B9A\u306E\u4FE1\u983C\u5EA6\u30B9\u30B3\u30A2\u30020.80 \u4EE5\u4E0A\u3067\u81EA\u52D5\u9069\u7528\u63A8\u5968)"]}),(0,s.jsx)("input",{id:O,type:"range",min:"0.0",max:"1.0",step:"0.05",value:le,"aria-valuenow":le,"aria-valuemin":0,"aria-valuemax":1,"aria-valuetext":`${Math.round(le*100)}%`,onChange:r=>ye(Number.parseFloat(r.target.value)),className:"h-2 w-full cursor-pointer appearance-none rounded-lg bg-slate-200","data-testid":"ingest-label-confidence-slider"})]}),(0,s.jsx)("div",{children:(0,s.jsx)("button",{type:"button",onClick:M,className:"w-full rounded-sm bg-slate-800 px-3 py-1.5 font-semibold text-white text-xs hover:bg-slate-700","data-testid":"ingest-add-label-button",children:"\u30BF\u30B0\u8FFD\u52A0"})})]}),X.length>0&&(0,s.jsx)("div",{className:"flex flex-wrap gap-2 pt-2","data-testid":"active-labels-container",children:X.map(r=>(0,s.jsxs)("span",{className:"inline-flex items-center gap-1.5 rounded-md border border-indigo-200 border-solid bg-indigo-50 px-2.5 py-1 font-medium text-indigo-800 text-xs","data-testid":`active-label-${r.labelKey}`,children:[(0,s.jsx)("span",{className:"font-semibold",children:r.labelKey}),(0,s.jsxs)("span",{className:"text-indigo-400",children:["(",r.category,")"]}),(0,s.jsx)("button",{type:"button",onClick:()=>Ne(r.labelKey),"aria-label":`\u30E9\u30D9\u30EB ${r.labelKey} \u3092\u524A\u9664`,className:"ml-1 font-bold text-indigo-400 hover:text-indigo-900","data-testid":`remove-label-${r.labelKey}`,children:"\xD7"})]},r.labelKey))})]}),(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsx)("button",{id:"advanced-settings-toggle",type:"button","aria-expanded":u,"aria-controls":"advanced-settings-panel",onClick:()=>T(r=>!r),className:"inline-flex items-center gap-1.5 font-semibold text-indigo-600 text-xs hover:text-indigo-800","data-testid":"ingest-toggle-advanced-button",children:(0,s.jsxs)("span",{children:[u?"\u25BC":"\u25B6"," \u30E1\u30BF\u30C7\u30FC\u30BF\u8A73\u7D30\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9 (\u9AD8\u5EA6\u306A\u8A2D\u5B9A)"]})}),u&&(0,s.jsxs)("section",{id:"advanced-settings-panel","aria-labelledby":"advanced-settings-toggle",className:"space-y-4 rounded-lg border border-slate-200 border-solid bg-slate-50/40 p-4","data-testid":"advanced-settings-panel",children:[(0,s.jsx)("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)("label",{htmlFor:I,className:"block font-medium text-slate-700 text-xs",children:"\u6587\u66F8\u30BF\u30A4\u30C8\u30EB (\u4E0A\u66F8\u304D\u6307\u5B9A)"}),(0,s.jsx)("input",{id:I,type:"text",value:ie,onChange:r=>H(r.target.value),placeholder:"\u6307\u5B9A\u3057\u306A\u3044\u5834\u5408\u306F\u30D5\u30A1\u30A4\u30EB\u540D\u307E\u305F\u306F AI \u62BD\u51FA\u30BF\u30A4\u30C8\u30EB\u304C\u4F7F\u7528\u3055\u308C\u307E\u3059",className:"w-full rounded-sm border border-slate-300 border-solid bg-white px-3 py-1.5 text-slate-800 text-xs","data-testid":"ingest-title-override-input"})]})}),(0,s.jsx)("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)("label",{htmlFor:K,className:"block font-medium text-slate-700 text-xs",children:"\u6240\u7BA1\u90E8\u9580 ID (\u4EFB\u610F)"}),(0,s.jsx)("input",{id:K,type:"number",value:fe,onChange:r=>_(r.target.value),placeholder:"\u4F8B: 101",className:"w-full rounded-sm border border-slate-300 border-solid bg-white px-3 py-1.5 text-slate-800 text-xs","data-testid":"ingest-department-input"})]})})]})]}),(0,s.jsx)("div",{className:"flex justify-end pt-2",children:(0,s.jsx)("button",{type:"submit",disabled:!se.valid||ee===null||p||b,"aria-busy":p,className:"inline-flex items-center gap-2 rounded-lg bg-indigo-600 px-6 py-2.5 font-semibold text-sm text-white shadow-sm transition-colors hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-indigo-500 disabled:opacity-50","data-testid":"ingest-submit-button",children:p?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"h-4 w-4 animate-spin rounded-full border-2 border-white border-t-transparent border-solid"}),(0,s.jsx)("span",{children:"\u53D6\u308A\u8FBC\u307F\u6295\u5165\u4E2D..."})]}):(0,s.jsx)("span",{children:"\u30E1\u30BF\u30C7\u30FC\u30BF\u751F\u6210 & \u53D6\u308A\u8FBC\u307F\u5B9F\u884C"})})})]})]}),(0,s.jsxs)("div",{className:"space-y-4 rounded-xl border border-slate-200 border-solid bg-white p-6 shadow-sm",children:[(0,s.jsx)("div",{className:"flex items-center justify-between",children:(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"font-bold text-base text-slate-900",children:"\u6700\u8FD1\u306E\u53D6\u308A\u8FBC\u307F\u30AD\u30E5\u30FC & \u5B9F\u884C\u72B6\u614B"}),(0,s.jsx)("p",{className:"text-slate-500 text-xs",children:"\u76F4\u8FD1\u306B\u6295\u5165\u3055\u308C\u305F\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306E\u540C\u671F\u9032\u6357\u3068\u7D50\u679C"})]})}),c.length===0?(0,s.jsx)("div",{className:"py-8 text-center text-slate-500 text-xs","data-testid":"recent-items-empty",children:"\u53D6\u308A\u8FBC\u307F\u5C65\u6B74\u306F\u3042\u308A\u307E\u305B\u3093\u3002"}):(0,s.jsx)("div",{className:"overflow-x-auto","data-testid":"recent-items-scroll",children:(0,s.jsxs)("table",{className:"min-w-full divide-y divide-solid divide-slate-200 text-left text-xs","aria-label":"\u6700\u8FD1\u306E\u53D6\u308A\u8FBC\u307F\u5C65\u6B74","data-testid":"recent-items-table",children:[(0,s.jsx)("thead",{className:"bg-slate-50 font-semibold text-slate-700",children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{scope:"col",className:"px-3 py-2.5",children:"ID"}),(0,s.jsx)("th",{scope:"col",className:"px-3 py-2.5",children:"\u30D5\u30A1\u30A4\u30EB\u540D / URI"}),(0,s.jsx)("th",{scope:"col",className:"px-3 py-2.5",children:"\u6A5F\u5BC6\u533A\u5206"}),(0,s.jsx)("th",{scope:"col",className:"px-3 py-2.5",children:"\u30EA\u30D3\u30B8\u30E7\u30F3"}),(0,s.jsx)("th",{scope:"col",className:"px-3 py-2.5",children:"\u540C\u671F\u30B9\u30C6\u30FC\u30BF\u30B9"}),(0,s.jsx)("th",{scope:"col",className:"px-3 py-2.5",children:"\u6700\u7D42\u5B9F\u884C"}),(0,s.jsx)("th",{scope:"col",className:"px-3 py-2.5",children:"\u767B\u9332\u65E5\u6642"}),(0,s.jsx)("th",{scope:"col",className:"px-3 py-2.5 text-right",children:"\u30A2\u30AF\u30B7\u30E7\u30F3"})]})}),(0,s.jsx)("tbody",{className:"divide-y divide-solid divide-slate-100 font-mono text-slate-800",children:c.map(r=>(0,s.jsxs)("tr",{className:"transition-colors hover:bg-slate-50/80","data-testid":`recent-item-row-${r.id}`,children:[(0,s.jsx)("td",{className:"px-3 py-2 font-bold",children:r.id}),(0,s.jsxs)("td",{className:"max-w-xs truncate px-3 py-2",title:r.fileUri,children:[(0,s.jsx)("div",{className:"font-sans font-semibold text-slate-900",children:r.fileName}),(0,s.jsx)("div",{className:"truncate text-[11px] text-slate-600",children:r.fileUri})]}),(0,s.jsx)("td",{className:"px-3 py-2",children:(0,s.jsx)("span",{className:"inline-flex rounded-sm bg-slate-100 px-2 py-0.5 font-medium font-sans text-[11px] text-slate-700",children:r.confidentialityLevel})}),(0,s.jsxs)("td",{className:"px-3 py-2 text-slate-600",children:["rev.",r.revision,r.isCurrent===!1&&(0,s.jsx)("span",{className:"ml-1.5 inline-flex items-center rounded-sm bg-slate-100 px-1.5 py-0.5 font-medium font-sans text-[10px] text-slate-600","data-testid":`ingest-item-superseded-${r.id}`,children:"\u65E7\u7248"})]}),(0,s.jsxs)("td",{className:"px-3 py-2 font-sans",children:[bt(r.syncStatus),r.errorMessage!==null&&r.errorMessage!==void 0&&r.errorMessage!==""&&(0,s.jsx)("div",{className:"mt-1 max-w-xs break-words text-[11px] text-red-700","data-testid":`ingest-item-error-${r.id}`,title:r.errorMessage,children:r.errorMessage})]}),(0,s.jsxs)("td",{className:"px-3 py-2 font-sans","data-testid":`ingest-last-run-${r.id}`,children:[r.lastRun===null?(0,s.jsx)("span",{className:"text-[11px] text-slate-500","data-testid":`ingest-last-run-none-${r.id}`,children:"\u8A18\u9332\u306A\u3057"}):(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)("span",{className:`inline-flex items-center rounded-full px-2 py-0.5 font-semibold text-[11px] ${De[Le(r.lastRun)].className}`,"data-testid":`ingest-last-run-status-${r.id}`,"data-status":r.lastRun.status,"data-presentation":Le(r.lastRun),children:De[Le(r.lastRun)].label}),r.lastRun.failedStepKey!==null&&(0,s.jsx)("div",{className:"text-[11px] text-red-700","data-testid":`ingest-last-run-failed-step-${r.id}`,children:Ee.PIPELINE_STEPS[r.lastRun.failedStepKey].label}),(0,s.jsx)("div",{className:"text-[11px] text-slate-500","data-testid":`ingest-last-run-finished-at-${r.id}`,children:(0,s.jsx)(Xe,{iso:r.lastRun.finishedAt,testId:`ingest-last-run-finished-at-value-${r.id}`})})]}),h!==void 0&&(0,s.jsx)("button",{type:"button",onClick:()=>h(r.id),"aria-label":`${r.fileName} \u306E\u5C65\u6B74`,className:"mt-1 rounded-sm border border-slate-300 border-solid bg-white px-2 py-0.5 font-semibold text-[11px] text-slate-700 hover:bg-slate-50","data-testid":`ingest-history-button-${r.id}`,children:"\u5C65\u6B74"})]}),(0,s.jsx)("td",{className:"px-3 py-2 font-sans text-[11px] text-slate-500","data-testid":`ingest-created-at-${r.id}`,children:(0,s.jsx)(ge,{iso:r.createdAt,testId:`ingest-created-at-value-${r.id}`})}),(0,s.jsx)("td",{className:"px-3 py-2 text-right font-sans",children:Ue(r)})]},r.id))})]})})]})]})}var dt=require("@aiquants/enrichment-core"),F=require("react/jsx-runtime"),Zt={open:{label:"\u30D5\u30E9\u30B0\u6709\u52B9",color:"#047857"},closed:{label:"\u30D5\u30E9\u30B0\u7121\u52B9",color:"#b45309"},unmeasured:{label:"\u30D5\u30E9\u30B0\u672A\u6E2C\u5B9A",color:"#64748b"},absent:{label:"\u30C6\u30CA\u30F3\u30C8\u306E\u9580\u306A\u3057",color:"#64748b"}};function wt(e,t){return e===null?"absent":e in t?t[e]?"open":"closed":"unmeasured"}function Ua({strategies:e,featureFlags:t,onToggleStage:o,isUpdating:c=!1}){let l=o===void 0;return(0,F.jsxs)("div",{"data-testid":"enrichment-strategy-board",className:"space-y-4 rounded-xl border border-slate-200 border-solid bg-white p-6 shadow-sm",children:[(0,F.jsxs)("div",{children:[(0,F.jsx)("h2",{className:"font-bold text-base text-slate-900",children:"\u30C9\u30E1\u30A4\u30F3\u5225 \u53D6\u308A\u8FBC\u307F\u6226\u7565"}),(0,F.jsxs)("p",{className:"text-slate-500 text-xs",children:["\u6BB5\u304C\u8D70\u308B\u306E\u306F\u3001\u30C6\u30CA\u30F3\u30C8\u306E\u6A5F\u80FD\u30D5\u30E9\u30B0\u3068\u3001\u3053\u306E\u30C9\u30E1\u30A4\u30F3\u306E\u6226\u7565\u306E",(0,F.jsx)("strong",{children:"\u53CC\u65B9"}),"\u304C\u958B\u3044\u3066\u3044\u308B\u3068\u304D\u3060\u3051\u3067\u3059\u3002\u8868\u306F ",e.length," \u30C9\u30E1\u30A4\u30F3 \xD7 ",dt.ENRICHMENT_STAGES.length," \u6BB5\u3002"]}),l&&(0,F.jsx)("p",{"data-testid":"strategy-read-only-note",className:"mt-1 text-slate-500 text-xs",children:"\u3053\u306E\u914D\u5099\u3067\u306F\u66F8\u304D\u8FBC\u307F\u7D4C\u8DEF\u304C\u7D50\u7DDA\u3055\u308C\u3066\u3044\u306A\u3044\u305F\u3081\u3001\u95B2\u89A7\u306E\u307F\u3067\u3059\u3002"})]}),e.length===0?(0,F.jsx)("p",{"data-testid":"strategy-empty-note",className:"text-slate-500 text-sm",children:"\u767B\u9332\u3055\u308C\u305F\u30C9\u30E1\u30A4\u30F3\u304C\u3042\u308A\u307E\u305B\u3093\u3002"}):(0,F.jsx)("div",{"data-testid":"strategy-grid-scroll",className:"overflow-x-auto",children:(0,F.jsxs)("table",{"data-testid":"strategy-grid","aria-label":"\u30C9\u30E1\u30A4\u30F3\u5225 \u53D6\u308A\u8FBC\u307F\u6226\u7565",className:"w-full border-collapse text-xs",children:[(0,F.jsx)("thead",{children:(0,F.jsxs)("tr",{children:[(0,F.jsx)("th",{scope:"col",className:"border-slate-200 border-b border-solid p-2 text-left font-semibold text-slate-600",children:"\u30C9\u30E1\u30A4\u30F3"}),dt.ENRICHMENT_STAGES.map(p=>{let b=wt(p.featureFlagKey,t);return(0,F.jsxs)("th",{scope:"col",className:"border-slate-200 border-b border-solid p-2 text-center font-semibold text-slate-600",children:[(0,F.jsx)("div",{children:p.label}),(0,F.jsx)("div",{"data-testid":`strategy-gate-${p.key}`,"data-gate":b,className:"mt-0.5 font-normal text-[10px]",style:{color:Zt[b].color},children:Zt[b].label})]},p.key)})]})}),(0,F.jsx)("tbody",{children:e.map(p=>(0,F.jsxs)("tr",{"data-testid":`strategy-row-${p.domainKey}`,"data-provenance":p.provenance,"data-active":String(p.isActive),children:[(0,F.jsxs)("th",{scope:"row",className:"border-slate-100 border-b border-solid p-2 text-left font-normal",children:[(0,F.jsx)("div",{className:"font-semibold text-slate-900",children:p.domainLabel}),(0,F.jsxs)("div",{className:"text-[10px] text-slate-500",children:[(0,F.jsx)("code",{children:p.domainKey})," / ",p.strategyName]}),(0,F.jsx)("div",{"data-testid":`strategy-provenance-${p.domainKey}`,className:"text-[10px] text-slate-500",children:p.provenance==="system"?"\u914D\u5099\u306E\u65E2\u5B9A (SYSTEM) \u3092\u89E3\u6C7A\u4E2D \u2014 \u5909\u66F4\u3059\u308B\u3068\u3053\u306E\u30C6\u30CA\u30F3\u30C8\u5C02\u7528\u306E\u884C\u304C\u4F5C\u3089\u308C\u307E\u3059":"\u3053\u306E\u30C6\u30CA\u30F3\u30C8\u56FA\u6709\u306E\u884C"}),!p.isActive&&(0,F.jsx)("div",{"data-testid":`strategy-inactive-${p.domainKey}`,className:"text-[10px] text-amber-700",children:"\u6226\u7565\u304C\u7121\u52B9\u306E\u305F\u3081\u3001\u6BB5\u3092\u958B\u3044\u3066\u3082\u89E3\u6C7A\u3055\u308C\u307E\u305B\u3093"})]}),dt.ENRICHMENT_STAGES.map(b=>{let m=p.stages[b.key],y=wt(b.featureFlagKey,t);return(0,F.jsxs)("td",{className:"border-slate-100 border-b border-solid p-2 text-center",children:[(0,F.jsx)("button",{type:"button",role:"switch","aria-checked":m,"aria-label":`${p.domainLabel} \u306E ${b.label}`,"data-testid":`strategy-stage-${p.domainKey}-${b.key}`,"data-enabled":String(m),"data-effective":String(m&&(y==="open"||y==="absent")),disabled:l||c,onClick:()=>o?.(p,b.key,!m),className:`rounded-full px-2.5 py-1 font-medium text-[11px] ${m?"bg-emerald-50 text-emerald-700":"bg-slate-100 text-slate-600"} ${l||c?"cursor-not-allowed opacity-60":"cursor-pointer"}`,children:m?"\u958B":"\u9589"}),m&&y==="unmeasured"&&(0,F.jsx)("div",{"data-testid":`strategy-unmeasured-${p.domainKey}-${b.key}`,className:"mt-0.5 text-[10px] text-slate-500",children:"\u30D5\u30E9\u30B0\u3092\u8AAD\u3081\u3066\u3044\u306A\u3044\u305F\u3081\u3001\u8D70\u308B\u304B\u3069\u3046\u304B\u5224\u308A\u307E\u305B\u3093"}),m&&y==="closed"&&(0,F.jsx)("div",{"data-testid":`strategy-blocked-${p.domainKey}-${b.key}`,className:"mt-0.5 text-[10px] text-amber-700",children:"\u30D5\u30E9\u30B0\u304C\u9589\u3058\u3066\u3044\u308B\u305F\u3081\u8D70\u308A\u307E\u305B\u3093"})]},b.key)})]},`${p.domainKey}:${p.strategyName}`))})]})})]})}var Ge={connected:"\u6B63\u5E38\u63A5\u7D9A",error:"\u63A5\u7D9A\u30A8\u30E9\u30FC"},He={connected:{"data-cui-fg":"success-fg","data-cui-surface":"success-tint"},error:{"data-cui-fg":"danger-fg","data-cui-surface":"danger-tint"}};var f=require("react/jsx-runtime"),qa={engine:"\u30A8\u30F3\u30B8\u30F3",edition:"\u30A8\u30C7\u30A3\u30B7\u30E7\u30F3",fullVersion:"\u5B8C\u5168\u30D0\u30FC\u30B8\u30E7\u30F3",title:"\u540D\u79F0",collectionsCount:"\u30B3\u30EC\u30AF\u30B7\u30E7\u30F3",nodeCount:"\u30CE\u30FC\u30C9\u6570 (\u30C6\u30CA\u30F3\u30C8)",totalKeys:"\u30AD\u30FC\u7DCF\u6570",database:"DB",endpointsCount:"\u30A8\u30F3\u30C9\u30DD\u30A4\u30F3\u30C8",port:"\u30DD\u30FC\u30C8",restPort:"REST \u30DD\u30FC\u30C8",boltUri:"Bolt URI",tls:"TLS"},ea=["engine","edition","fullVersion","title","collectionsCount","nodeCount","totalKeys","database","endpointsCount","port","restPort","boltUri","tls"],Ga=new Set(["collectionsCount","nodeCount","totalKeys","endpointsCount"]),it={atomic:{label:"min-w-0 text-muted-foreground",slot:"shrink-0 whitespace-nowrap text-right"},anywhere:{label:"shrink-0 text-muted-foreground",slot:"wrap-anywhere min-w-0 text-right"}};function ta(e){return e.kind==="text"?"anywhere":"atomic"}function sa(e,t){return t===null?{kind:"unmeasured"}:Ga.has(e)&&typeof t=="number"?{kind:"count",count:t}:typeof t=="boolean"?{kind:"word",text:t?"\u6709\u52B9":"\u7121\u52B9"}:typeof t=="number"?{kind:"number",value:t}:{kind:"text",text:t}}function Ha(e){let t=ea.filter(c=>c in e),o=Object.keys(e).filter(c=>!ea.includes(c)).sort();return[...t,...o].map(c=>({key:c,label:qa[c]??c,value:sa(c,e[c])}))}function aa(e,t){switch(e.kind){case"count":return(0,f.jsx)(q,{value:e.count,unit:"\u4EF6",testId:t});case"unmeasured":return(0,f.jsx)(Se,{text:null,testId:t});case"number":if(!Number.isFinite(e.value))throw new RangeError(`${t}: a number the probe read must be finite, got ${e.value} (pass null when the probe could not read it)`);return(0,f.jsx)(Se,{text:String(e.value),testId:t});case"word":return(0,f.jsx)(Se,{text:e.text,testId:t});case"text":return(0,f.jsx)(Qe,{text:e.text,testId:t})}}function Va({health:e,isRefreshing:t=!1,onRefresh:o,className:c=""}){let{services:l,allHealthy:p,checkedAt:b}=e;te();let m=[{key:"qdrant",data:l.qdrant,title:"Qdrant",subtitle:"\u30D9\u30AF\u30C8\u30EB\u691C\u7D22\u30A8\u30F3\u30B8\u30F3 (Vector DB)"},{key:"neo4j",data:l.neo4j,title:"Neo4j",subtitle:"\u30CA\u30EC\u30C3\u30B8\u30B0\u30E9\u30D5 (Graph DB)"},{key:"redis",data:l.redis,title:"Redis",subtitle:"\u30AD\u30E3\u30C3\u30B7\u30E5 & Pub/Sub (Cache)"},{key:"sqlServer",data:l.sqlServer,title:"SQL Server",subtitle:"\u6B63\u6E96\u30C7\u30FC\u30BF\u30B9\u30C8\u30A2 (Single Source of Truth)"},{key:"quantsApi",data:l.quantsApi,title:"AI Quant API",subtitle:"Python \u30D0\u30C3\u30AF\u30A8\u30F3\u30C9\u63A8\u8AD6\u30A8\u30F3\u30B8\u30F3"}];return(0,f.jsxs)("section",{className:`rounded-lg border border-solid bg-card p-5 text-card-foreground shadow-sm ${c}`,"data-testid":"infrastructure-health-monitor","data-healthy":String(p),children:[(0,f.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-4 border-b border-solid pb-4",children:[(0,f.jsxs)("div",{className:"flex items-center gap-3",children:[(0,f.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-lg bg-primary/10 text-primary",children:(0,f.jsxs)("svg",{className:"h-5 w-5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,f.jsx)("rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2"}),(0,f.jsx)("rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2"}),(0,f.jsx)("line",{x1:"6",x2:"6.01",y1:"6",y2:"6"}),(0,f.jsx)("line",{x1:"6",x2:"6.01",y1:"18",y2:"18"})]})}),(0,f.jsxs)("div",{children:[(0,f.jsx)("h2",{className:"font-bold text-base",children:"\u5468\u8FBA\u6A5F\u80FD\u63A5\u7D9A\u72B6\u614B & \u30D0\u30FC\u30B8\u30E7\u30F3"}),(0,f.jsxs)("p",{className:"text-muted-foreground text-xs",children:["\u6700\u7D42\u78BA\u8A8D:"," ",(0,f.jsx)("span",{"data-testid":"health-checked-at",children:(0,f.jsx)(ge,{iso:b,testId:"health-checked-at-value"})})," ","| \u5168 5 \u7CFB\u7D71\u306E\u57FA\u76E4\u30B5\u30FC\u30D3\u30B9\u30EA\u30A2\u30EB\u30BF\u30A4\u30E0\u6B7B\u6D3B\u76E3\u8996"]})]})]}),(0,f.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,f.jsx)("span",{className:"inline-flex shrink-0 items-center gap-1.5 whitespace-nowrap rounded-full px-3 py-1 font-medium text-xs",...He[p?"connected":"error"],"data-testid":"health-overall-status-badge",children:p?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("svg",{className:"h-3.5 w-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,f.jsx)("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}),(0,f.jsx)("polyline",{points:"22 4 12 14.01 9 11.01"})]}),(0,f.jsxs)("span",{children:["\u5168\u30B5\u30FC\u30D3\u30B9",Ge.connected]})]}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("svg",{className:"h-3.5 w-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,f.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,f.jsx)("line",{x1:"12",x2:"12",y1:"8",y2:"12"}),(0,f.jsx)("line",{x1:"12",x2:"12.01",y1:"16",y2:"16"})]}),(0,f.jsxs)("span",{children:["\u4E00\u90E8\u30B5\u30FC\u30D3\u30B9",Ge.error]})]})}),o&&(0,f.jsxs)("button",{type:"button",onClick:o,disabled:t,"data-testid":"health-refresh-button",className:"inline-flex shrink-0 items-center gap-1.5 whitespace-nowrap rounded-md border border-solid bg-background px-3 py-1.5 font-medium text-xs shadow-sm hover:bg-muted focus:outline-none focus:ring-2 focus:ring-ring disabled:opacity-50",children:[(0,f.jsxs)("svg",{className:`h-3.5 w-3.5 ${t?"animate-spin":""}`,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,f.jsx)("path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"}),(0,f.jsx)("path",{d:"M3 3v5h5"}),(0,f.jsx)("path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16"}),(0,f.jsx)("path",{d:"M16 21h5v-5"})]}),(0,f.jsx)("span",{children:"\u518D\u78BA\u8A8D"})]})]})]}),(0,f.jsx)("div",{className:"mt-4 grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-5",children:m.map(({key:y,data:N,title:h,subtitle:C})=>{let E=sa("version",N.version),J=it[ta(E)],ae=aa(E,`service-version-value-${y}`);return(0,f.jsxs)("div",{"data-testid":`service-card-${y}`,className:"flex flex-col justify-between rounded-md border border-border border-solid bg-card/60 p-3.5 transition-colors hover:bg-muted/40",children:[(0,f.jsxs)("div",{children:[(0,f.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-x-2 gap-y-1",children:[(0,f.jsx)("span",{className:"font-semibold text-sm",children:h}),(0,f.jsxs)("span",{className:"inline-flex shrink-0 items-center gap-1 whitespace-nowrap rounded-sm px-1.5 py-0.5 font-medium text-[11px]",...He[N.status],"data-testid":`service-status-${y}`,children:[(0,f.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-current","data-testid":`service-status-dot-${y}`}),Ge[N.status]]})]}),(0,f.jsx)("p",{className:"mt-1 text-[11px] text-muted-foreground",children:C}),(0,f.jsxs)("div",{className:"mt-3 space-y-1.5 border-t border-solid pt-2 text-xs",children:[(0,f.jsxs)("div",{className:"flex items-start justify-between gap-2","data-testid":`service-version-row-${y}`,children:[(0,f.jsx)("span",{className:J.label,children:"\u30D0\u30FC\u30B8\u30E7\u30F3:"}),(0,f.jsx)("span",{className:`${J.slot} font-medium text-[11px]`,"data-testid":`service-version-${y}`,children:E.kind==="text"?(0,f.jsx)("code",{className:"font-mono font-semibold",children:ae}):ae})]}),(0,f.jsxs)("div",{className:"flex items-start justify-between gap-2","data-testid":`health-latency-row-${y}`,children:[(0,f.jsx)("span",{className:it.atomic.label,children:"\u5FDC\u7B54\u6642\u9593:"}),(0,f.jsx)("span",{className:`${it.atomic.slot} font-mono text-[11px] text-muted-foreground`,"data-testid":`health-latency-${y}`,children:(0,f.jsx)(q,{value:N.latencyMs,unit:"ms",testId:`health-latency-value-${y}`})})]}),Ha(N.details).map(K=>{let I=it[ta(K.value)];return(0,f.jsxs)("div",{className:"flex items-start justify-between gap-2","data-testid":`health-detail-row-${y}-${K.key}`,children:[(0,f.jsxs)("span",{className:I.label,children:[K.label,":"]}),(0,f.jsx)("span",{className:`${I.slot} font-medium text-[11px]`,"data-testid":`health-detail-${y}-${K.key}`,children:aa(K.value,`health-detail-value-${y}-${K.key}`)})]},K.key)})]})]}),(0,f.jsxs)("div",{className:"mt-3 border-t border-solid pt-1.5 text-[10px] text-muted-foreground",children:[(0,f.jsx)("span",{className:"wrap-anywhere font-mono","data-testid":`service-endpoint-${y}`,children:N.endpoint}),N.errorMessage!==void 0&&Je.test(N.errorMessage)&&(0,f.jsx)("p",{className:"wrap-anywhere mt-1 rounded-sm px-1.5 py-0.5",...He.error,"data-testid":`service-error-${y}`,children:N.errorMessage})]})]},y)})})]})}var oe=require("@aiquants/enrichment-core"),P=require("react");var a=require("react/jsx-runtime"),It={KEYWORD:{label:"SQL",description:"SQL Server \u306E\u8A9E\u53E5\u4E00\u81F4\u306E\u307F\u3067\u691C\u7D22\u3057\u307E\u3059\u3002\u30D9\u30AF\u30C8\u30EB\u3082\u30B0\u30E9\u30D5\u3082\u547C\u3070\u306A\u3044\u30D5\u30A9\u30FC\u30EB\u30D0\u30C3\u30AF\u7D4C\u8DEF\u3067\u3059\u3002"},SPARSE:{label:"\u758E\u30D9\u30AF\u30C8\u30EB",description:"BM25 \u306E\u8A9E\u5F59\u30D9\u30AF\u30C8\u30EB\u3067\u691C\u7D22\u3057\u307E\u3059\u3002\u56FA\u6709\u540D\u8A5E\u3084\u578B\u756A\u306A\u3069\u306E\u5B8C\u5168\u4E00\u81F4\u306B\u5F37\u3044\u7D4C\u8DEF\u3067\u3059\u3002"},DENSE:{label:"\u5BC6\u30D9\u30AF\u30C8\u30EB",description:"\u57CB\u3081\u8FBC\u307F\u30E2\u30C7\u30EB\u306E\u610F\u5473\u30D9\u30AF\u30C8\u30EB\u3067\u691C\u7D22\u3057\u307E\u3059\u3002\u8A00\u3044\u63DB\u3048\u3084\u6587\u610F\u306E\u8FD1\u3055\u3092\u62FE\u3046\u7D4C\u8DEF\u3067\u3059\u3002"},HYBRID:{label:"\u30CF\u30A4\u30D6\u30EA\u30C3\u30C9",description:"\u758E\u30FB\u5BC6\u30FB\u30B0\u30E9\u30D5\u30FB\u8A9E\u53E5\u4E00\u81F4\u3092\u9806\u4F4D\u878D\u5408\u3057\u307E\u3059\u3002\u65E2\u5B9A\u306E\u691C\u7D22\u7D4C\u8DEF\u3067\u3059\u3002"},GRAPH_TRAVERSE:{label:"\u30CA\u30EC\u30C3\u30B8\u30B0\u30E9\u30D5",description:"\u30CA\u30EC\u30C3\u30B8\u30B0\u30E9\u30D5\u306E\u95A2\u4FC2\u3092\u305F\u3069\u3063\u3066\u691C\u7D22\u3057\u307E\u3059\u3002\u6587\u66F8\u9593\u306E\u3064\u306A\u304C\u308A\u3092\u4E3B\u8EF8\u306B\u3059\u308B\u7D4C\u8DEF\u3067\u3059\u3002"}},Ve="\u672A\u5B9F\u884C",za=(oe.SEARCH_PARAM_LIMITS.threshold.min+oe.SEARCH_PARAM_LIMITS.threshold.max)/2,Wa=2e3;function ja(e){return e.fusion==="rrf"?`RRF (k=${e.rrf_k})`:e.fusion==="linear"?`LINEAR (alpha=${e.alpha})`:"\u878D\u5408\u306A\u3057 (\u5358\u4E00\u9806\u4F4D\u30E2\u30FC\u30C9)"}var Et={cosine:{label:"\u5BC6\u30D9\u30AF\u30C8\u30EB",format:e=>`${(e*100).toFixed(1)}%`,title:"\u30B3\u30B5\u30A4\u30F3\u985E\u4F3C\u5EA6 (0\u301C1)"},bm25:{label:"\u758E\u30D9\u30AF\u30C8\u30EB",format:e=>e.toFixed(3),title:"BM25 \u30B9\u30B3\u30A2 (\u4E0A\u9650\u306A\u3057\u3002\u5272\u5408\u3067\u306F\u306A\u3044)"},mixed:{label:"\u30D9\u30AF\u30C8\u30EB",format:e=>e.toFixed(3),title:"\u5BC6\u3068\u758E\u306E\u53CC\u65B9\u304C\u8D70\u3063\u305F\u305F\u3081\u3001\u3053\u306E\u5024\u304C\u3069\u3061\u3089\u306E\u91CF\u304B\u5B9A\u307E\u3089\u306A\u3044"}},oa=[{id:"balanced-hybrid",title:"\u63A8\u5968\u30CF\u30A4\u30D6\u30EA\u30C3\u30C9 (Balanced Hybrid)",description:"RRF \u878D\u5408 (k=60) \u306B\u3088\u308B\u8A9E\u5F59\u3068\u30BB\u30DE\u30F3\u30C6\u30A3\u30C3\u30AF\u306E\u8ABF\u548C\u30D0\u30E9\u30F3\u30B9\u63A2\u7D22",params:{mode:"HYBRID",limit:20,fusion:"rrf",rrf_k:60}},{id:"high-precision-vector",title:"\u9AD8\u7CBE\u5EA6\u30D9\u30AF\u30C8\u30EB (Dense Dominant)",description:"\u30B3\u30B5\u30A4\u30F3\u985E\u4F3C\u5EA6 0.75 \u4EE5\u4E0A\u306E\u5BC6\u30D9\u30AF\u30C8\u30EB\u63A2\u7D22\u306B\u3088\u308B\u9AD8\u9069\u5408\u7387\u30BB\u30DE\u30F3\u30C6\u30A3\u30C3\u30AF\u691C\u7D22",params:{mode:"DENSE",limit:10,threshold:.75}},{id:"strict-lexical",title:"\u53B3\u683C\u30AD\u30FC\u30EF\u30FC\u30C9 (Strict Lexical)",description:"\u30CF\u30EB\u30B7\u30CD\u30FC\u30B7\u30E7\u30F3\u3092\u6392\u9664\u3059\u308B SQL SoT / \u8A9E\u5F59\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u76F4\u63A5\u691C\u7D22",params:{mode:"KEYWORD",limit:20}},{id:"lexical-sparse",title:"\u8A9E\u5F59\u30D9\u30AF\u30C8\u30EB (Sparse BM25)",description:"BM25 \u306E\u8A9E\u5F59\u30D9\u30AF\u30C8\u30EB\u3067\u56FA\u6709\u540D\u8A5E\u3084\u578B\u756A\u306E\u5B8C\u5168\u4E00\u81F4\u3092\u72D9\u3046\u691C\u7D22",params:{mode:"SPARSE",limit:20}},{id:"graph-reasoning",title:"\u30B0\u30E9\u30D5\u6DF1\u6398\u308A\u63A8\u8AD6 (Graph Deep Reasoning)",description:"\u30CA\u30EC\u30C3\u30B8\u30B0\u30E9\u30D5\u306E\u95A2\u4FC2\u9806\u4F4D\u3092\u4E3B\u8EF8\u306B\u636E\u3048\u305F\u63A8\u8AD6\u691C\u7D22",params:{mode:"GRAPH_TRAVERSE",limit:30}}];function na(e){return e===void 0||Number.isNaN(e)?"N/A":`${(e*100).toFixed(1)}%`}function Ja(e,t){let o=t.trim();if(!(o&&e))return e;let c=o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),l=new RegExp(`(${c})`,"gi");return e.split(l).map((m,y)=>({id:`chunk-${y}-${m.slice(0,8)}`,part:m,isMatch:m.toLowerCase()===o.toLowerCase()})).map(m=>m.isMatch?(0,a.jsx)("mark",{"data-testid":"highlighted-keyword",className:"rounded-sm bg-amber-200 px-1 py-0.5 font-semibold text-amber-950",children:m.part},m.id):m.part)}function kt(e){return e==="OPEN"?"bg-red-100 font-bold text-red-800":e==="HALF_OPEN"?"bg-amber-100 font-bold text-amber-800":"bg-slate-200 text-slate-500"}function Rt(e){return e==="OPEN"?"OPEN":e==="HALF_OPEN"?"HALF":"-"}function Qa({tenantId:e,onSearch:t,initialParams:o,initialResult:c=null,circuitBreakerStatus:l={},isLoading:p=!1}){let b=(0,P.useId)(),m=(0,P.useId)(),y=(0,P.useId)(),N=(0,P.useId)(),h=(0,P.useId)(),C=(0,P.useId)(),E=(0,P.useId)(),J=(0,P.useId)(),ae=(0,P.useId)(),K=(0,P.useId)(),[I,Q]=(0,P.useState)(o?.q??""),[R,O]=(0,P.useState)(o?.mode??"HYBRID"),[A,L]=(0,P.useState)(o?.limit??oe.SEARCH_PARAM_LIMITS.limit.default),[G,g]=(0,P.useState)(o?.threshold??za),[$,B]=(0,P.useState)(o?.fusion??"rrf"),[D,re]=(0,P.useState)(o?.rrf_k??oe.SEARCH_PARAM_LIMITS.rrfK.default),[Z,be]=(0,P.useState)(o?.alpha??oe.SEARCH_PARAM_LIMITS.alpha.default),[fe,_]=(0,P.useState)(o?.confidentiality_level??"ALL"),[ie,H]=(0,P.useState)(o?.department_id?String(o.department_id):""),[X,U]=(0,P.useState)(o?.mime_type??""),[xe,ne]=(0,P.useState)(o?.tag??""),he=(0,P.useRef)(0),[Ie,le]=(0,P.useState)(!1),[ye,u]=(0,P.useState)(!1),[T,ee]=(0,P.useState)("request"),[z,se]=(0,P.useState)(null),[Fe,_e]=(0,P.useState)(new Set),[Ke,we]=(0,P.useState)(!1),[M,Be]=(0,P.useState)(c),[Ne,at]=(0,P.useState)(null),[Ue,bt]=(0,P.useState)(null),r=p||Ke,k=oe.MODE_TIERS[R],W=[k.dense,k.sparse,k.graph,k.lexical].filter(Boolean).length>1,ve=k.dense&&!k.sparse,ke=M?.search_metadata.circuit_breaker_status??l,ce=M?.search_metadata.executed_tiers??{sql:!1,dense:!1,sparse:!1,graph:!1},gt=Ue??{};(0,P.useEffect)(()=>{if(!ye)return;let n=Y=>{Y.key==="Escape"&&u(!1)};return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[ye]);let Sa=n=>{O(n.params.mode),L(n.params.limit),n.params.threshold!==void 0&&g(n.params.threshold),n.params.fusion!==void 0&&B(n.params.fusion),n.params.rrf_k!==void 0&&re(n.params.rrf_k)},wa=async()=>{if(r)return;let n=ie.trim()?Number.parseInt(ie.trim(),10):void 0,Y={q:I.trim(),mode:R,limit:A,threshold:ve?G:void 0,fusion:W?$:void 0,rrf_k:W&&$==="rrf"?D:void 0,alpha:W&&$==="linear"?Z:void 0,department_id:n,confidentiality_level:fe==="ALL"?void 0:fe,mime_type:X.trim()||void 0,tag:xe.trim()||void 0},pe=he.current+1;he.current=pe,at(null),we(!0);try{let Ce=await t(Y);if(pe!==he.current)return;Be(Ce),bt(Y)}catch(Ce){if(pe!==he.current)return;at(Ce instanceof Error?Ce.message:"\u691C\u7D22\u51E6\u7406\u4E2D\u306B\u4E88\u671F\u305B\u306C\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F\u3002")}finally{pe===he.current&&we(!1)}},ze=(0,P.useRef)(void 0);(0,P.useEffect)(()=>()=>{ze.current!==void 0&&clearTimeout(ze.current)},[]);let Ea=async(n,Y)=>{try{await navigator.clipboard.writeText(n),se(Y),ze.current!==void 0&&clearTimeout(ze.current),ze.current=setTimeout(()=>se(null),Wa)}catch{}},ka=n=>{_e(Y=>{let pe=new Set(Y);return pe.has(n)?pe.delete(n):pe.add(n),pe})};return(0,a.jsxs)("div",{"data-testid":"metadata-search-workbench","data-mode":R,"data-loading":String(r),className:"space-y-6",children:[(0,a.jsxs)("div",{className:"rounded-xl border border-slate-200 border-solid bg-white p-6 shadow-sm",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-4 lg:flex-row lg:items-center lg:justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("h2",{className:"font-bold text-base text-slate-900 tracking-tight",children:"\u30E1\u30BF\u30C7\u30FC\u30BF\u691C\u7D22\u30EF\u30FC\u30AF\u30D9\u30F3\u30C1"}),(0,a.jsxs)("span",{"data-testid":"workbench-tenant-badge",className:"rounded-full bg-indigo-50 px-2.5 py-0.5 font-semibold text-indigo-700 text-xs",children:["\u30C6\u30CA\u30F3\u30C8: ",e]})]}),(0,a.jsx)("p",{className:"mt-1 text-slate-500 text-sm",children:"\u30AD\u30FC\u30EF\u30FC\u30C9\u30FB\u5BC6\u30D9\u30AF\u30C8\u30EB\u30FB\u30CA\u30EC\u30C3\u30B8\u30B0\u30E9\u30D5\u306E\u30DE\u30EB\u30C1\u30EC\u30A4\u30E4\u30FC\u691C\u7D22\u30D1\u30E9\u30E1\u30FC\u30BF\u3092\u5FAE\u8ABF\u6574\u3057\u3001\u30EA\u30A2\u30EB\u30BF\u30A4\u30E0\u306B\u53D6\u5F97\u7CBE\u5EA6\u3068\u63A8\u8AD6\u7D50\u679C\u3092\u691C\u8A3C\u3057\u307E\u3059\u3002"})]}),(0,a.jsx)("div",{className:"flex items-center gap-2",children:(0,a.jsxs)("button",{type:"button","data-testid":"toggle-inspector-button","aria-expanded":ye,"aria-controls":K,onClick:()=>u(n=>!n),className:"inline-flex items-center gap-2 rounded-lg border border-slate-300 border-solid bg-slate-50 px-3.5 py-2 font-medium text-slate-700 text-sm shadow-sm transition-colors hover:bg-slate-100",children:[(0,a.jsx)("span",{className:"font-mono text-xs",children:"{ }"}),(0,a.jsx)("span",{children:ye?"\u30A4\u30F3\u30B9\u30DA\u30AF\u30BF\u3092\u9589\u3058\u308B":"\u958B\u767A\u8005\u30A4\u30F3\u30B9\u30DA\u30AF\u30BF"})]})})]}),(0,a.jsxs)("div",{className:"mt-5 border-slate-100 border-t border-solid pt-4",children:[(0,a.jsx)("span",{className:"font-medium text-slate-600 text-xs",children:"\u958B\u767A\u8005\u30D7\u30EA\u30BB\u30C3\u30C8:"}),(0,a.jsx)("div",{className:"mt-2 flex flex-wrap gap-2",children:oa.map(n=>(0,a.jsx)("button",{type:"button","data-testid":`preset-button-${n.id}`,onClick:()=>Sa(n),className:"inline-flex items-center rounded-lg border border-slate-200 border-solid bg-slate-50 px-3 py-1.5 text-left text-xs transition-colors hover:border-indigo-300 hover:bg-indigo-50/50",children:(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"font-semibold text-slate-800",children:n.title}),(0,a.jsxs)("span",{className:"ml-1.5 hidden text-slate-500 xl:inline",children:["(",n.description,")"]})]})},n.id))})]})]}),(0,a.jsx)("div",{className:"rounded-xl border border-slate-200 border-solid bg-white p-6 shadow-sm",children:(0,a.jsxs)("form",{onSubmit:n=>{n.preventDefault(),wa()},className:"space-y-5",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center",children:[(0,a.jsxs)("div",{className:"relative flex-1",children:[(0,a.jsx)("label",{htmlFor:b,className:"sr-only",children:"\u691C\u7D22\u30AF\u30A8\u30EA"}),(0,a.jsx)("input",{id:b,type:"text","data-testid":"search-query-input",value:I,onChange:n=>Q(n.target.value),placeholder:"\u691C\u7D22\u30AF\u30A8\u30EA\u3092\u5165\u529B (\u4F8B: \u300C\u56DB\u534A\u671F \u6C7A\u7B97\u5831\u544A\u66F8\u300D\u300C\u696D\u52D9\u65E5\u5831 \u539F\u4FA1\u6309\u5206\u300D)...",className:"w-full rounded-lg border border-slate-300 border-solid bg-white px-4 py-2.5 text-slate-900 text-sm shadow-sm transition-colors placeholder:text-slate-400 focus:border-indigo-500 focus:outline-none focus:ring-2 focus:ring-indigo-500/20"}),I&&(0,a.jsx)("button",{type:"button","data-testid":"clear-query-button",onClick:()=>Q(""),className:"absolute inset-y-0 right-0 flex items-center pr-3 text-slate-400 hover:text-slate-600",children:"\u2715"})]}),(0,a.jsx)("div",{"data-testid":"search-modes",className:"flex flex-wrap items-center gap-1 rounded-lg border border-slate-200 border-solid bg-slate-100 p-1",children:oe.SEARCH_MODES.map(n=>{let Y=R===n;return(0,a.jsx)("button",{type:"button","aria-pressed":Y,title:It[n].description,"data-testid":`search-mode-${n}`,"data-active":String(Y),onClick:()=>O(n),className:`shrink-0 whitespace-nowrap rounded-md px-3 py-1.5 font-medium text-xs transition-all ${Y?"bg-white text-indigo-700 shadow-sm":"text-slate-600 hover:text-slate-900"}`,children:It[n].label},n)})}),(0,a.jsx)("button",{type:"submit","data-testid":"execute-search-button",disabled:r,className:"inline-flex items-center justify-center rounded-lg bg-indigo-600 px-5 py-2.5 font-semibold text-sm text-white shadow-sm transition-colors hover:bg-indigo-700 disabled:opacity-50",children:r?"\u691C\u7D22\u4E2D...":"\u691C\u7D22\u5B9F\u884C"})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-4 rounded-lg bg-slate-50 p-4 sm:grid-cols-2 lg:grid-cols-4",children:[(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("label",{htmlFor:m,className:"font-medium text-slate-700 text-xs",children:"\u53D6\u5F97\u4EF6\u6570 (Top-K):"}),(0,a.jsx)("span",{"data-testid":"limit-display",className:"font-mono font-semibold text-indigo-600 text-xs",children:A})]}),(0,a.jsx)("input",{id:m,type:"range","data-testid":"limit-slider",min:oe.SEARCH_PARAM_LIMITS.limit.min,max:oe.SEARCH_PARAM_LIMITS.limit.max,step:1,value:A,onChange:n=>L(Number(n.target.value)),className:"h-1.5 w-full cursor-pointer appearance-none rounded-lg bg-slate-200 accent-indigo-600"})]}),(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("label",{htmlFor:y,className:"font-medium text-slate-700 text-xs",title:ve?"\u30B3\u30B5\u30A4\u30F3\u985E\u4F3C\u5EA6\u306E\u4E0B\u9650\u3067\u3059\u3002":"\u3053\u306E\u6226\u7565\u306E\u30B9\u30B3\u30A2\u306F\u30B3\u30B5\u30A4\u30F3\u985E\u4F3C\u5EA6\u3067\u306F\u306A\u3044\u305F\u3081\u9069\u7528\u3057\u307E\u305B\u3093\u3002",children:"\u985E\u4F3C\u5EA6\u95BE\u5024 (Threshold):"}),(0,a.jsx)("span",{"data-testid":"threshold-display",className:"font-mono font-semibold text-indigo-600 text-xs",children:G.toFixed(2)})]}),(0,a.jsx)("input",{id:y,type:"range","data-testid":"threshold-slider",min:oe.SEARCH_PARAM_LIMITS.threshold.min,max:oe.SEARCH_PARAM_LIMITS.threshold.max,step:.01,value:G,disabled:!ve,onChange:n=>g(Number(n.target.value)),className:"h-1.5 w-full cursor-pointer appearance-none rounded-lg bg-slate-200 accent-indigo-600 disabled:opacity-40"})]}),(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("span",{className:"font-medium text-slate-700 text-xs",children:"\u878D\u5408\u30A2\u30EB\u30B4\u30EA\u30BA\u30E0:"}),(0,a.jsx)("span",{className:"font-mono font-semibold text-indigo-600 text-xs",children:$.toUpperCase()})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)("button",{type:"button","data-testid":"fusion-strategy-rrf",onClick:()=>B("rrf"),disabled:!W,className:`flex-1 rounded-sm border border-solid py-1 font-medium text-xs ${$==="rrf"?"border-indigo-300 bg-indigo-50 font-bold text-indigo-700":"border-slate-200 bg-white text-slate-600 hover:bg-slate-50"} disabled:opacity-40`,children:"RRF"}),(0,a.jsx)("button",{type:"button","data-testid":"fusion-strategy-linear",onClick:()=>B("linear"),disabled:!W,className:`flex-1 rounded-sm border border-solid py-1 font-medium text-xs ${$==="linear"?"border-indigo-300 bg-indigo-50 font-bold text-indigo-700":"border-slate-200 bg-white text-slate-600 hover:bg-slate-50"} disabled:opacity-40`,children:"\u7DDA\u5F62\u7D50\u5408 (Alpha)"})]})]}),(0,a.jsx)("div",{className:"space-y-1.5",children:$==="rrf"?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("label",{htmlFor:N,className:"font-medium text-slate-700 text-xs",children:"RRF \u5B9A\u6570 (k):"}),(0,a.jsx)("span",{"data-testid":"rrf-k-display",className:"font-mono font-semibold text-indigo-600 text-xs",children:D})]}),(0,a.jsx)("input",{id:N,type:"range","data-testid":"rrf-k-slider",min:oe.SEARCH_PARAM_LIMITS.rrfK.min,max:oe.SEARCH_PARAM_LIMITS.rrfK.max,step:1,value:D,disabled:!W,onChange:n=>re(Number(n.target.value)),className:"h-1.5 w-full cursor-pointer appearance-none rounded-lg bg-slate-200 accent-indigo-600 disabled:opacity-40"})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("label",{htmlFor:h,className:"font-medium text-slate-700 text-xs",children:"\u30D9\u30AF\u30C8\u30EB\u91CD\u307F (Alpha):"}),(0,a.jsx)("span",{"data-testid":"alpha-display",className:"font-mono font-semibold text-indigo-600 text-xs",children:Z.toFixed(2)})]}),(0,a.jsx)("input",{id:h,type:"range","data-testid":"alpha-slider",min:oe.SEARCH_PARAM_LIMITS.alpha.min,max:oe.SEARCH_PARAM_LIMITS.alpha.max,step:.05,value:Z,disabled:!W,onChange:n=>be(Number(n.target.value)),className:"h-1.5 w-full cursor-pointer appearance-none rounded-lg bg-slate-200 accent-indigo-600 disabled:opacity-40"})]})})]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("button",{type:"button","data-testid":"toggle-advanced-filters",onClick:()=>le(n=>!n),className:"inline-flex items-center gap-1.5 font-medium text-indigo-600 text-xs hover:text-indigo-800",children:[(0,a.jsx)("span",{children:Ie?"\u25BC":"\u25B6"}),(0,a.jsxs)("span",{children:["\u8A73\u7D30\u30E1\u30BF\u30C7\u30FC\u30BF & \u30B0\u30E9\u30D5\u30D5\u30A3\u30EB\u30BF ",Ie?"\u3092\u9589\u3058\u308B":"\u3092\u5C55\u958B"]})]}),Ie&&(0,a.jsxs)("div",{"data-testid":"advanced-filters-panel",className:"mt-3 grid grid-cols-1 gap-4 rounded-lg border border-slate-200 border-solid bg-white p-4 sm:grid-cols-2 lg:grid-cols-4",children:[(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("label",{htmlFor:E,className:"font-medium text-slate-700 text-xs",children:"\u6A5F\u5BC6\u533A\u5206 (Confidentiality):"}),(0,a.jsxs)("select",{id:E,"data-testid":"filter-confidentiality",value:fe,onChange:n=>_(n.target.value),className:"w-full rounded-sm border border-slate-300 border-solid bg-white px-2.5 py-1.5 text-slate-800 text-xs focus:border-indigo-500",children:[(0,a.jsx)("option",{value:"ALL",children:"\u5168\u6A5F\u5BC6\u533A\u5206 (ALL)"}),(0,a.jsx)("option",{value:"PUBLIC",children:"\u516C\u958B (PUBLIC)"}),(0,a.jsx)("option",{value:"INTERNAL",children:"\u793E\u5185\u9650\u5B9A (INTERNAL)"}),(0,a.jsx)("option",{value:"DEPARTMENT",children:"\u90E8\u9580\u9650\u5B9A (DEPARTMENT)"}),(0,a.jsx)("option",{value:"CONFIDENTIAL",children:"\u6A5F\u5BC6 (CONFIDENTIAL)"})]})]}),(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("label",{htmlFor:C,className:"font-medium text-slate-700 text-xs",children:"\u90E8\u9580 ID (Department ID):"}),(0,a.jsx)("input",{id:C,type:"number","data-testid":"filter-department-id",value:ie,onChange:n=>H(n.target.value),placeholder:"\u4F8B: 101",className:"w-full rounded-sm border border-slate-300 border-solid bg-white px-2.5 py-1.5 text-slate-800 text-xs focus:border-indigo-500"})]}),(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("label",{htmlFor:J,className:"font-medium text-slate-700 text-xs",children:"MIME \u30BF\u30A4\u30D7 (MIME Type):"}),(0,a.jsx)("input",{id:J,type:"text","data-testid":"filter-mime-type",value:X,onChange:n=>U(n.target.value),placeholder:"application/pdf, image/...",className:"w-full rounded-sm border border-slate-300 border-solid bg-white px-2.5 py-1.5 text-slate-800 text-xs focus:border-indigo-500"})]}),(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("label",{htmlFor:ae,className:"font-medium text-slate-700 text-xs",children:"\u30BF\u30B0 (Tag):"}),(0,a.jsx)("input",{id:ae,type:"text","data-testid":"filter-tag",value:xe,onChange:n=>ne(n.target.value),placeholder:"\u4F8B: \u6C7A\u7B97, \u5951\u7D04\u66F8...",className:"w-full rounded-sm border border-slate-300 border-solid bg-white px-2.5 py-1.5 text-slate-800 text-xs focus:border-indigo-500"})]})]})]})]})}),Ne&&(0,a.jsx)("div",{role:"alert","data-testid":"search-error-alert",className:"rounded-xl border border-red-200 border-solid bg-red-50 p-4 font-medium text-red-700 text-sm shadow-sm",children:Ne}),M?.search_metadata&&(0,a.jsx)(xt,{metadata:M.search_metadata}),M&&(0,a.jsxs)("div",{"data-testid":"search-summary-bar",className:"flex flex-wrap items-center justify-between gap-3 rounded-lg border border-slate-200 border-solid bg-slate-50 px-4 py-3 text-xs",children:[(0,a.jsxs)("div",{className:"flex items-center gap-4",children:[(0,a.jsxs)("span",{"data-testid":"result-count",className:"font-semibold text-slate-800",children:["\u30D2\u30C3\u30C8\u4EF6\u6570: ",(0,a.jsx)("span",{className:"font-bold text-indigo-600",children:M.count})," \u4EF6"]}),M.search_metadata.execution_time_ms!==void 0&&(0,a.jsxs)("span",{"data-testid":"latency-metric",className:"text-slate-500",children:["\u5B9F\u884C\u30EC\u30A4\u30C6\u30F3\u30B7: ",(0,a.jsxs)("span",{className:"font-mono font-semibold text-slate-700",children:[M.search_metadata.execution_time_ms," ms"]})]}),(0,a.jsxs)("span",{"data-testid":"quality-tier-badge",className:"rounded-full bg-slate-200 px-2 py-0.5 font-medium font-mono text-slate-800",children:["Tier: ",M.search_metadata.quality_tier]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-slate-500",children:"\u30EC\u30A4\u30E4\u30FC\u72B6\u614B:"}),(0,a.jsxs)("span",{"data-testid":"tier-badge-sql","data-active":String(ce.sql),className:`rounded-sm px-1.5 py-0.5 font-mono text-[11px] ${ce.sql?"bg-emerald-100 font-semibold text-emerald-800":"bg-slate-200 text-slate-500"}`,children:["SQL ",ce.sql?"\u2713":"-"]}),(0,a.jsxs)("span",{"data-testid":"tier-badge-sparse","data-active":String(ce.sparse),"data-breaker":ke.vector??"CLOSED",className:`rounded-sm px-1.5 py-0.5 font-mono text-[11px] ${ce.sparse?"bg-emerald-100 font-semibold text-emerald-800":kt(ke.vector)}`,children:["\u758E\u30D9\u30AF\u30C8\u30EB ",ce.sparse?"\u2713":Rt(ke.vector)]}),(0,a.jsxs)("span",{"data-testid":"tier-badge-dense","data-active":String(ce.dense),"data-breaker":ke.vector??"CLOSED",className:`rounded-sm px-1.5 py-0.5 font-mono text-[11px] ${ce.dense?"bg-emerald-100 font-semibold text-emerald-800":kt(ke.vector)}`,children:["\u5BC6\u30D9\u30AF\u30C8\u30EB ",ce.dense?"\u2713":Rt(ke.vector)]}),(0,a.jsxs)("span",{"data-testid":"tier-badge-graph","data-active":String(ce.graph),"data-breaker":ke.graph??"CLOSED",className:`rounded-sm px-1.5 py-0.5 font-mono text-[11px] ${ce.graph?"bg-emerald-100 font-semibold text-emerald-800":kt(ke.graph)}`,children:["\u30B0\u30E9\u30D5 ",ce.graph?"\u2713":Rt(ke.graph)]})]})]}),(0,a.jsxs)("div",{"data-testid":"search-results-container",className:"space-y-4",children:[M&&M.hits.length===0&&(0,a.jsxs)("div",{"data-testid":"empty-search-state",className:"rounded-xl border border-slate-200 border-solid bg-white p-12 text-center",children:[(0,a.jsx)("p",{className:"font-semibold text-base text-slate-700",children:"\u691C\u7D22\u6761\u4EF6\u306B\u4E00\u81F4\u3059\u308B\u30E1\u30BF\u30C7\u30FC\u30BF\u306F\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3067\u3057\u305F"}),(0,a.jsx)("p",{className:"mt-1 text-slate-500 text-sm",children:"\u691C\u7D22\u30AD\u30FC\u30EF\u30FC\u30C9\u3092\u7C21\u6F54\u306B\u3059\u308B\u304B\u3001\u985E\u4F3C\u5EA6\u95BE\u5024\u3092\u4E0B\u3052\u308B\uFF08\u4F8B: 0.30\uFF09\u3001\u307E\u305F\u306F\u300C\u63A8\u5968\u30CF\u30A4\u30D6\u30EA\u30C3\u30C9\u300D\u30D7\u30EA\u30BB\u30C3\u30C8\u3092\u304A\u8A66\u3057\u304F\u3060\u3055\u3044\u3002"})]}),M?.hits.map((n,Y)=>{let pe=Fe.has(n.id),Ce=n.scores?.fused;return(0,a.jsxs)("div",{"data-testid":`search-hit-card-${n.id}`,"data-hit-id":n.id,"data-rank":Y+1,className:"rounded-xl border border-slate-200 border-solid bg-white p-5 shadow-sm transition-all hover:border-slate-300 hover:shadow-md",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-start sm:justify-between",children:[(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsxs)("span",{"data-testid":`hit-rank-${n.id}`,className:"rounded-sm bg-slate-100 px-2 py-0.5 font-bold font-mono text-slate-600 text-xs",children:["#",Y+1]}),(0,a.jsx)("h3",{"data-testid":`hit-filename-${n.id}`,className:"font-bold text-base text-slate-900 tracking-tight",children:n.file_name}),(0,a.jsx)("span",{"data-testid":`hit-confidentiality-${n.id}`,className:`rounded-full px-2 py-0.5 font-semibold text-[11px] ${n.confidentiality_level==="PUBLIC"?"bg-emerald-50 text-emerald-700":n.confidentiality_level==="INTERNAL"?"bg-blue-50 text-blue-700":n.confidentiality_level==="CONFIDENTIAL"?"bg-amber-50 text-amber-700":"bg-red-50 text-red-700"}`,children:n.confidentiality_level}),n.department_id!==null&&(0,a.jsxs)("span",{"data-testid":`hit-department-${n.id}`,className:"rounded-sm bg-slate-100 px-2 py-0.5 text-[11px] text-slate-600",children:["Dept: ",n.department_id]}),(0,a.jsx)("span",{"data-testid":`hit-mimetype-${n.id}`,className:"rounded-sm bg-slate-50 px-2 py-0.5 font-mono text-[11px] text-slate-500",children:n.mime_type})]}),(0,a.jsx)("p",{className:"max-w-xl truncate font-mono text-slate-400 text-xs",children:n.file_uri})]}),Ce!==void 0&&(0,a.jsxs)("div",{className:"flex items-center gap-3 sm:text-right",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"font-medium text-slate-500 text-xs",children:"\u878D\u5408\u9806\u4F4D\u30B9\u30B3\u30A2"}),(0,a.jsx)("div",{"data-testid":`hit-fused-score-${n.id}`,className:"font-bold font-mono text-indigo-600 text-sm",title:"\u5404\u5C64\u3067\u306E\u9806\u4F4D\u304B\u3089\u7D44\u307F\u7ACB\u3066\u305F\u5024 (0\u301C1)\u3002\u985E\u4F3C\u5EA6\u3067\u3082\u78BA\u4FE1\u5EA6\u3067\u3082\u306A\u304F\u3001\u3069\u306E\u5C64\u3067\u3082 1 \u4F4D\u306A\u3089 1.000 \u306B\u306A\u308B",children:Ce.toFixed(3)})]}),(0,a.jsx)("div",{className:"h-2 w-16 overflow-hidden rounded-full bg-slate-200",children:(0,a.jsx)("div",{className:"h-full bg-indigo-600",style:{width:`${Math.min(100,Math.max(0,Ce*100))}%`}})})]})]}),n.ai_summary&&(0,a.jsx)("div",{"data-testid":`hit-summary-${n.id}`,className:"mt-3 rounded-lg bg-slate-50 p-3 text-slate-700 text-sm leading-relaxed",children:Ja(n.ai_summary,Ue?.q??I)}),n.scores&&(0,a.jsxs)("div",{"data-testid":`hit-score-breakdown-${n.id}`,className:"mt-3 flex flex-wrap items-center gap-2 text-xs",children:[(0,a.jsx)("span",{className:"text-[11px] text-slate-400",children:"\u30B9\u30B3\u30A2\u5185\u8A33:"}),n.scores.vector!==void 0&&(0,a.jsxs)("span",{"data-testid":`score-vector-${n.id}`,"data-score-kind":n.scores.vector.kind,title:Et[n.scores.vector.kind].title,className:"rounded-sm bg-blue-50 px-2 py-0.5 font-mono text-blue-700",children:[Et[n.scores.vector.kind].label,": ",Et[n.scores.vector.kind].format(n.scores.vector.value)]}),n.scores.lexicalRank!==void 0&&(0,a.jsxs)("span",{"data-testid":`score-lexical-${n.id}`,title:"\u5B57\u53E5\u5C64\u3067\u306E\u9806\u4F4D\u3092 0\u301C1 \u3078\u5199\u3057\u305F\u5024 (\u30B9\u30B3\u30A2\u3067\u306F\u306A\u3044)",className:"rounded-sm bg-amber-50 px-2 py-0.5 font-mono text-amber-700",children:["\u5B57\u53E5\u9806\u4F4D: ",na(n.scores.lexicalRank)]}),n.scores.graphRank!==void 0&&(0,a.jsxs)("span",{"data-testid":`score-graph-${n.id}`,title:"\u30B0\u30E9\u30D5\u5C64\u3067\u306E\u9806\u4F4D\u3092 0\u301C1 \u3078\u5199\u3057\u305F\u5024 (\u30B9\u30B3\u30A2\u3067\u306F\u306A\u3044)",className:"rounded-sm bg-purple-50 px-2 py-0.5 font-mono text-purple-700",children:["\u30B0\u30E9\u30D5\u9806\u4F4D: ",na(n.scores.graphRank)]})]}),n.tags&&n.tags.length>0&&(0,a.jsx)("div",{"data-testid":`hit-tags-${n.id}`,className:"mt-3 flex flex-wrap items-center gap-1.5",children:n.tags.map(Pe=>(0,a.jsxs)("span",{"data-testid":`hit-tag-${n.id}-${Pe}`,className:"rounded-full bg-slate-100 px-2.5 py-0.5 font-medium text-slate-600 text-xs",children:["#",Pe]},`tag-${n.id}-${Pe}`))}),n.graph_relations&&n.graph_relations.length>0&&(0,a.jsxs)("div",{"data-testid":`hit-graph-relations-${n.id}`,className:"mt-3 flex flex-wrap items-center gap-1.5",children:[(0,a.jsx)("span",{className:"text-slate-400 text-xs",children:"\u30B0\u30E9\u30D5\u63A5\u7D9A:"}),n.graph_relations.map((Pe,Ra)=>(0,a.jsxs)("span",{"data-testid":`hit-relation-${n.id}-${Ra}`,className:"rounded-sm border border-purple-200 border-solid bg-purple-50 px-2 py-0.5 font-mono text-[11px] text-purple-800",children:["-[:",Pe.relation,"]-> ",Pe.target_name]},`rel-${n.id}-${Pe.relation}-${Pe.target_name}`))]}),n.structured_data!==null&&n.structured_data!==void 0&&(0,a.jsxs)("div",{className:"mt-3 border-slate-100 border-t border-solid pt-2",children:[(0,a.jsxs)("button",{type:"button","data-testid":`toggle-structured-data-${n.id}`,onClick:()=>ka(n.id),className:"inline-flex items-center gap-1 font-medium text-indigo-600 text-xs hover:text-indigo-800",children:[(0,a.jsx)("span",{children:pe?"\u25BC":"\u25B6"}),(0,a.jsxs)("span",{children:["\u62BD\u51FA\u69CB\u9020\u5316\u30C7\u30FC\u30BF ",pe?"\u3092\u9589\u3058\u308B":"\u3092\u8868\u793A"]})]}),pe&&(0,a.jsx)("pre",{"data-testid":`structured-data-json-${n.id}`,tabIndex:0,className:"mt-2 max-h-48 overflow-auto rounded-sm bg-slate-900 p-3 font-mono text-slate-200 text-xs",children:JSON.stringify(n.structured_data,null,2)})]})]},n.id)})]}),ye&&(0,a.jsxs)("section",{id:K,"aria-label":"\u958B\u767A\u8005\u30A4\u30F3\u30B9\u30DA\u30AF\u30BF","data-testid":"developer-inspector-drawer",className:"rounded-xl border border-slate-300 border-solid bg-slate-900 p-5 text-slate-200 shadow-xl",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between border-slate-800 border-b border-solid pb-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("span",{className:"font-bold text-base text-white",children:"\u958B\u767A\u8005\u30A4\u30F3\u30B9\u30DA\u30AF\u30BF"}),(0,a.jsx)("span",{className:"rounded-sm bg-slate-800 px-2 py-0.5 font-mono text-slate-400 text-xs",children:"Live Pipeline Inspector"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("button",{type:"button","data-testid":"copy-inspector-payload-button",onClick:()=>{let n=JSON.stringify(T==="request"?Ue??{}:M??{},null,2);Ea(n,"inspector")},className:"rounded-sm bg-slate-800 px-2.5 py-1 font-medium text-slate-300 text-xs transition-colors hover:bg-slate-700",children:z==="inspector"?"\u30B3\u30D4\u30FC\u5B8C\u4E86 \u2713":"JSON \u3092\u30B3\u30D4\u30FC"}),(0,a.jsx)("button",{type:"button","data-testid":"close-inspector-button",onClick:()=>u(!1),className:"text-slate-400 hover:text-white",children:"\u2715"})]})]}),(0,a.jsx)("div",{className:"mt-3 flex gap-2 border-slate-800 border-b border-solid pb-2",children:["request","response","pipeline","graph-trace"].map(n=>{let Y={request:"Request Payload",response:"Response Payload",pipeline:"Pipeline Trace","graph-trace":"Graph Path Trace"},pe=T===n;return(0,a.jsx)("button",{type:"button","data-testid":`inspector-tab-${n}`,"data-active":String(pe),onClick:()=>ee(n),className:`rounded-sm px-3 py-1 font-medium text-xs ${pe?"bg-indigo-600 font-semibold text-white":"text-slate-400 hover:text-white"}`,children:Y[n]},n)})}),(0,a.jsxs)("div",{className:"mt-4",children:[T==="request"&&(0,a.jsx)("pre",{"data-testid":"inspector-request-json",tabIndex:0,className:"max-h-80 overflow-auto rounded-sm bg-slate-950 p-4 font-mono text-emerald-400 text-xs",children:JSON.stringify(Ue??{},null,2)}),T==="response"&&(0,a.jsx)("pre",{"data-testid":"inspector-response-json",tabIndex:0,className:"max-h-80 overflow-auto rounded-sm bg-slate-950 p-4 font-mono text-sky-400 text-xs",children:JSON.stringify(M??{},null,2)}),T==="pipeline"&&(0,a.jsxs)("div",{"data-testid":"inspector-pipeline-trace",className:"space-y-3 p-2 text-xs",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"rounded-full bg-emerald-500/20 px-2 py-0.5 font-bold text-emerald-400",children:"Step 1"}),(0,a.jsx)("span",{className:"font-semibold text-slate-300",children:"\u30AF\u30A8\u30EA\u89E3\u6790 & \u57CB\u3081\u8FBC\u307F (Query Analysis & Tokenization)"})]}),(0,a.jsx)("div",{className:"ml-6 border-slate-700 border-l border-solid pl-4 font-mono text-slate-400","data-testid":"inspector-query-analysis",children:M?(0,a.jsxs)(a.Fragment,{children:["mode: ",gt.mode,' | q: "',gt.q,'"']}):Ve}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"rounded-full bg-emerald-500/20 px-2 py-0.5 font-bold text-emerald-400",children:"Step 2"}),(0,a.jsx)("span",{className:"font-semibold text-slate-300",children:"\u30DE\u30EB\u30C1\u30EC\u30A4\u30E4\u30FC\u4E26\u884C\u53D6\u5F97 (Multi-Tier Retrieval)"})]}),(0,a.jsx)("div",{className:"ml-6 border-slate-700 border-l border-solid pl-4 font-mono text-slate-400","data-testid":"inspector-tier-retrieval",children:M?(0,a.jsxs)(a.Fragment,{children:["SQL SoT: ",ce.sql?"ACTIVE":"SKIPPED"," | Sparse: ",ce.sparse?"ACTIVE":"OFFLINE"," | Dense: ",ce.dense?"ACTIVE":"OFFLINE"," | Graph: ",ce.graph?"ACTIVE":"OFFLINE"]}):Ve}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"rounded-full bg-indigo-500/20 px-2 py-0.5 font-bold text-indigo-400",children:"Step 3"}),(0,a.jsx)("span",{className:"font-semibold text-slate-300",children:"\u30B9\u30B3\u30A2\u878D\u5408 & \u9806\u4F4D\u4ED8\u3051 (Fusion & Ranking)"})]}),(0,a.jsxs)("div",{className:"ml-6 border-slate-700 border-l border-solid pl-4 font-mono text-slate-400",children:[(0,a.jsxs)("span",{"data-testid":"inspector-fusion-strategy",children:["strategy: ",M?ja(gt):Ve]})," | ",(0,a.jsxs)("span",{"data-testid":"inspector-output-count",children:["Output count: ",M?M.count:Ve]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"rounded-full bg-purple-500/20 px-2 py-0.5 font-bold text-purple-400",children:"Step 4"}),(0,a.jsx)("span",{className:"font-semibold text-slate-300",children:"ABAC \u884C\u30FB\u5217\u8A8D\u53EF\u30DE\u30B9\u30AD\u30F3\u30B0 (Security Enforcement)"})]}),(0,a.jsxs)("div",{className:"ml-6 border-slate-700 border-l border-solid pl-4 font-mono text-slate-400",children:[(0,a.jsxs)("span",{"data-testid":"inspector-authz-row",children:["\u884C\u30B9\u30B3\u30FC\u30D7: ",M?M.authzScopes.rowScopeApplied?"\u9069\u7528 (\u4E00\u89A7\u304B\u3089\u6587\u66F8\u304C\u9664\u304B\u308C\u3066\u3044\u308B\u53EF\u80FD\u6027)":"\u672A\u9069\u7528":Ve]})," | ",(0,a.jsxs)("span",{"data-testid":"inspector-authz-column",children:["\u5217\u30B9\u30B3\u30FC\u30D7: ",M?M.authzScopes.columnScopeApplied?"\u9069\u7528 (\u9805\u76EE\u304C\u4F0F\u305B\u3089\u308C\u3066\u3044\u308B)":"\u672A\u9069\u7528":Ve]})," | ","tenant: ",e]})]}),T==="graph-trace"&&(0,a.jsxs)("div",{"data-testid":"inspector-graph-trace",className:"p-2 text-xs",children:[(0,a.jsx)("div",{className:"font-semibold text-purple-300",children:"\u77E5\u8B58\u30B0\u30E9\u30D5 \u30C8\u30E9\u30D0\u30FC\u30B5\u30EB \u30D1\u30B9:"}),M?.hits.some(n=>n.graph_relations&&n.graph_relations.length>0)?(0,a.jsx)("ul",{className:"mt-2 space-y-2 font-mono text-slate-300",children:M.hits.map(n=>n.graph_relations?.map(Y=>(0,a.jsxs)("li",{className:"rounded-sm bg-slate-950 p-2",children:["(:Document {id: ",n.id,', file: "',n.file_name,'"}) -[:',Y.relation,']-> (:Entity {name: "',Y.target_name,'"})']},`gtrace-${n.id}-${Y.relation}-${Y.target_name}`)))}):(0,a.jsx)("p",{className:"mt-2 text-slate-500",children:"\u95A2\u9023\u3059\u308B\u30B0\u30E9\u30D5\u30D1\u30B9\u306F\u691C\u51FA\u3055\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002"})]})]})]})]})}var lt=require("@aiquants/enrichment-core"),me=require("react"),S=require("react/jsx-runtime"),Pt=4;function Ct(e){return e.toFixed(Pt)}function ra(e,t){let o=N=>{let h=new Map;return N.forEach((C,E)=>{h.has(C)||h.set(C,E+1)}),h},c=o(e),l=o(t),p=[...c.keys()].filter(N=>l.has(N)),b=new Set([...c.keys(),...l.keys()]).size,m=b===0?null:p.length/b,y=p.length===0?null:p.reduce((N,h)=>N+Math.abs(c.get(h)-l.get(h)),0)/p.length;return{sharedCount:p.length,overlapRatio:m,meanAbsoluteRankDifference:y}}function _t(e){return`${e.label} (${e.embeddingModel})`}function Xa({variants:e,onCompare:t}){let o=(0,me.useId)(),c=(0,me.useId)(),l=(0,me.useId)(),p=(0,me.useId)(),b=(0,me.useId)(),[m,y]=(0,me.useState)(null),[N,h]=(0,me.useState)(null),[C,E]=(0,me.useState)(""),[J,ae]=(0,me.useState)(lt.SEARCH_PARAM_LIMITS.limit.default),[K,I]=(0,me.useState)(!1),[Q,R]=(0,me.useState)(null),[O,A]=(0,me.useState)(null),L=e.length>=2,G=e.map(_=>_.strategyId),g=m!==null&&G.includes(m)?m:L?G[0]:null,$=N!==null&&G.includes(N)?N:L?G[1]:null,B=g!==null&&g===$,D=C.trim(),re=L&&!B&&D!==""&&!K,Z=async _=>{if(_.preventDefault(),!re||g===null||$===null)return;let ie={query:D,strategyIds:[g,$],limit:J};I(!0),R(null);try{let H=await t(ie);if(!H.ok){A(null),R(H.reason);return}let X=H.results.find(xe=>xe.strategyId===g),U=H.results.find(xe=>xe.strategyId===$);if(X===void 0||U===void 0){A(null),R(`\u5FDC\u7B54\u306B\u6226\u7565 #${X===void 0?g:$} \u306E\u7D50\u679C\u304C\u3042\u308A\u307E\u305B\u3093\u3002`);return}A({input:ie,left:X,right:U})}catch(H){A(null),R(`\u6BD4\u8F03\u3092\u5B9F\u884C\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F: ${H instanceof Error?H.message:String(H)}`)}finally{I(!1)}},be=O===null?null:ra(O.left.hits.map(_=>_.id),O.right.hits.map(_=>_.id)),fe=_=>{let ie=e.find(H=>H.strategyId===_.strategyId);return(0,S.jsxs)("div",{className:"rounded-lg border border-slate-200 border-solid p-4","data-testid":`compare-column-${_.strategyId}`,children:[(0,S.jsx)("h3",{className:"font-bold text-base text-slate-900",children:ie===void 0?`\u6226\u7565 #${_.strategyId}`:_t(ie)}),(0,S.jsx)("p",{className:"mt-1 text-[11px] text-slate-500",children:(0,S.jsxs)("span",{"data-testid":`compare-execution-ms-${_.strategyId}`,children:[_.executionMs," ms"]})}),_.hits.length===0?(0,S.jsx)("p",{className:"mt-3 text-[13px] text-slate-500","data-testid":`compare-empty-${_.strategyId}`,children:"\u30D2\u30C3\u30C8\u306A\u3057"}):(0,S.jsx)("ol",{className:"mt-3 space-y-2",children:_.hits.map((H,X)=>(0,S.jsxs)("li",{"aria-label":`${X+1} \u4F4D ${H.title} (\u30B9\u30B3\u30A2 ${Ct(H.score)})`,className:"flex items-baseline gap-3 text-[13px]","data-testid":`compare-hit-${_.strategyId}-${X+1}`,"data-hit-id":H.id,"data-score":String(H.score),children:[(0,S.jsx)("span",{className:"w-6 text-right font-mono text-slate-500",children:X+1}),(0,S.jsx)("span",{title:H.title,className:"flex-1 truncate text-slate-900","data-testid":`compare-hit-title-${_.strategyId}-${X+1}`,children:H.title}),(0,S.jsx)("span",{title:String(H.score),className:"font-mono text-slate-600","data-testid":`compare-hit-score-${_.strategyId}-${X+1}`,children:Ct(H.score)})]},X))})]})};return(0,S.jsxs)("section",{className:"space-y-6","aria-labelledby":o,"data-testid":"model-comparison-workbench","data-running":K,children:[(0,S.jsxs)("form",{onSubmit:Z,className:"rounded-xl border border-slate-200 border-solid bg-white p-6 shadow-sm",children:[(0,S.jsx)("h2",{id:o,className:"font-bold text-base text-slate-900",children:"\u5909\u7A2E\u306E\u6BD4\u8F03"}),(0,S.jsxs)("p",{className:"mt-2 text-[13px] text-slate-500",children:["\u540C\u3058\u30AF\u30A8\u30EA\u3092 2 \u3064\u306E\u6226\u7565\u5909\u7A2E\u3067\u5B9F\u884C\u3057\u3001\u9806\u4F4D\u3092\u4E26\u3079\u3066\u6BD4\u3079\u307E\u3059\u3002\u30B9\u30B3\u30A2\u306F\u5909\u7A2E\u3054\u3068\u306B\u5225\u306E\u91CF\u306A\u306E\u3067\u6B63\u898F\u5316\u305B\u305A\u3001\u5C0F\u6570\u7B2C ",Pt," \u4F4D\u307E\u3067\u793A\u3057\u307E\u3059 (\u5168\u6841\u306F\u30B9\u30B3\u30A2\u306B\u30DD\u30A4\u30F3\u30BF\u3092\u5F53\u3066\u308B\u3068\u51FA\u307E\u3059)\u3002"]}),!L&&(0,S.jsxs)("p",{className:"mt-4 rounded-lg border border-amber-300 border-solid bg-amber-50 p-3 text-[13px] text-amber-900","data-testid":"compare-variants-insufficient",children:["\u6BD4\u8F03\u306B\u306F 2 \u3064\u4EE5\u4E0A\u306E\u5909\u7A2E\u304C\u5FC5\u8981\u3067\u3059 (\u73FE\u5728 ",e.length," \u4EF6)\u3002"]}),(0,S.jsxs)("div",{className:"mt-4 grid grid-cols-1 gap-4 sm:grid-cols-2",children:[(0,S.jsxs)("div",{className:"space-y-1",children:[(0,S.jsx)("label",{htmlFor:p,className:"block font-semibold text-[13px] text-slate-700",children:"\u5909\u7A2E A"}),(0,S.jsx)("select",{id:p,value:g===null?"":String(g),onChange:_=>y(Number(_.target.value)),disabled:!L,className:"w-full rounded-lg border border-slate-300 border-solid bg-white px-3 py-2 text-[13px] text-slate-800","data-testid":"compare-variant-a",children:e.map(_=>(0,S.jsx)("option",{value:String(_.strategyId),children:_t(_)},_.strategyId))})]}),(0,S.jsxs)("div",{className:"space-y-1",children:[(0,S.jsx)("label",{htmlFor:b,className:"block font-semibold text-[13px] text-slate-700",children:"\u5909\u7A2E B"}),(0,S.jsx)("select",{id:b,value:$===null?"":String($),onChange:_=>h(Number(_.target.value)),disabled:!L,className:"w-full rounded-lg border border-slate-300 border-solid bg-white px-3 py-2 text-[13px] text-slate-800","data-testid":"compare-variant-b",children:e.map(_=>(0,S.jsx)("option",{value:String(_.strategyId),children:_t(_)},_.strategyId))})]})]}),B&&(0,S.jsx)("p",{className:"mt-2 text-[13px] text-amber-800","data-testid":"compare-same-variant-note",children:"\u540C\u3058\u5909\u7A2E\u3069\u3046\u3057\u306F\u6BD4\u8F03\u3067\u304D\u307E\u305B\u3093\u3002\u5225\u306E\u5909\u7A2E\u3092\u9078\u3093\u3067\u304F\u3060\u3055\u3044\u3002"}),(0,S.jsxs)("div",{className:"mt-4 grid grid-cols-1 gap-4 sm:grid-cols-[1fr_auto]",children:[(0,S.jsxs)("div",{className:"space-y-1",children:[(0,S.jsx)("label",{htmlFor:c,className:"block font-semibold text-[13px] text-slate-700",children:"\u30AF\u30A8\u30EA"}),(0,S.jsx)("input",{id:c,type:"text",value:C,onChange:_=>E(_.target.value),disabled:!L,className:"w-full rounded-lg border border-slate-300 border-solid px-3 py-2 text-[13px] text-slate-800","data-testid":"compare-query-input"})]}),(0,S.jsxs)("div",{className:"space-y-1",children:[(0,S.jsx)("label",{htmlFor:l,className:"block font-semibold text-[13px] text-slate-700",children:"\u4EF6\u6570"}),(0,S.jsx)("input",{id:l,type:"number",min:lt.SEARCH_PARAM_LIMITS.limit.min,max:lt.SEARCH_PARAM_LIMITS.limit.max,step:1,value:J,onChange:_=>ae(Number(_.target.value)),disabled:!L,className:"w-24 rounded-lg border border-slate-300 border-solid px-3 py-2 text-[13px] text-slate-800","data-testid":"compare-limit-input"})]})]}),(0,S.jsx)("div",{className:"mt-4",children:(0,S.jsx)("button",{type:"submit",disabled:!re,className:"rounded-lg bg-indigo-600 px-4 py-2 font-semibold text-[13px] text-white hover:bg-indigo-700 disabled:cursor-not-allowed disabled:opacity-50","data-testid":"compare-run-button",children:K?"\u6BD4\u8F03\u4E2D\u2026":"\u6BD4\u8F03\u3092\u5B9F\u884C"})})]}),Q!==null&&(0,S.jsx)("div",{role:"alert",className:"rounded-lg border border-red-200 border-solid bg-red-50 p-4 text-[13px] text-red-800","data-testid":"compare-failure",children:Q}),O!==null&&be!==null&&(0,S.jsxs)("div",{className:"space-y-4 rounded-xl border border-slate-200 border-solid bg-white p-6 shadow-sm","data-testid":"compare-results",children:[(0,S.jsxs)("dl",{className:"grid grid-cols-1 gap-3 text-[13px] sm:grid-cols-3","data-testid":"compare-agreement",children:[(0,S.jsxs)("div",{children:[(0,S.jsx)("dt",{className:"text-slate-500",children:"\u5171\u901A\u30D2\u30C3\u30C8"}),(0,S.jsxs)("dd",{"data-testid":"compare-shared-count",children:[be.sharedCount," \u4EF6 (A ",O.left.hits.length," \u4EF6 / B ",O.right.hits.length," \u4EF6)"]})]}),(0,S.jsxs)("div",{children:[(0,S.jsx)("dt",{className:"text-slate-500",children:"\u91CD\u306A\u308A\u7387 (Jaccard)"}),(0,S.jsx)("dd",{"data-testid":"compare-overlap-ratio",children:be.overlapRatio===null?"\u30D2\u30C3\u30C8\u306A\u3057":`${(be.overlapRatio*100).toFixed(1)}%`})]}),(0,S.jsxs)("div",{children:[(0,S.jsx)("dt",{className:"text-slate-500",children:"\u9806\u4F4D\u5DEE\u306E\u5E73\u5747 (\u5171\u901A\u5206)"}),(0,S.jsx)("dd",{"data-testid":"compare-rank-difference",children:be.meanAbsoluteRankDifference===null?"\u5171\u901A\u30D2\u30C3\u30C8\u306A\u3057":be.meanAbsoluteRankDifference.toFixed(2)})]})]}),(0,S.jsxs)("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[fe(O.left),fe(O.right)]})]})]})}var x=require("react/jsx-runtime");function da(e){return e===null?Ze:`${e.length} \u7A2E`}var Ze="\u672A\u8A2D\u5B9A";function Ye(e,t=""){return e===null?Ze:`${e}${t}`}function ct(e){return e===null?Ze:`${e} \u4EF6`}function Ya(e){if(e.currentVersion===null&&e.lifecyclePhase===null)return`${e.schemaName} (\u79FB\u884C\u53F0\u5E33\u306F\u672A\u8A18\u9332)`;let t=e.currentVersion===null?Ze:`v${e.currentVersion}`;return`${e.schemaName} ${t} (${e.lifecyclePhase??Ze})`}function Za({tenantId:e,ontologyStatus:t}){let o=t.classes,c=t.predicates;return(0,x.jsxs)("div",{className:"space-y-6","data-testid":"ontology-status-card",children:[(0,x.jsxs)("div",{className:"rounded-xl border border-slate-200 border-solid bg-white p-6 shadow-sm",children:[(0,x.jsxs)("div",{className:"flex flex-col justify-between gap-3 md:flex-row md:items-center",children:[(0,x.jsxs)("div",{children:[(0,x.jsxs)("div",{className:"flex items-center gap-2",children:[(0,x.jsx)("h2",{className:"font-bold text-base text-slate-900",children:"\u30AA\u30F3\u30C8\u30ED\u30B8\u30FC & \u30B9\u30AD\u30FC\u30DE\u30AC\u30D0\u30CA\u30F3\u30B9\u72B6\u614B"}),(0,x.jsx)("span",{className:`inline-flex items-center rounded-full px-2.5 py-0.5 font-bold text-xs ${t.autonomousEvolutionEnabled?"bg-emerald-100 text-emerald-800":"bg-slate-100 text-slate-700"}`,"data-testid":"ontology-evolution-badge",children:t.autonomousEvolutionEnabled?"\u81EA\u5F8B\u7684\u30AA\u30F3\u30C8\u30ED\u30B8\u30FC\u9032\u5316: \u6709\u52B9":"\u81EA\u5F8B\u9032\u5316: \u505C\u6B62\u4E2D"}),(0,x.jsx)("span",{className:"inline-flex items-center rounded-sm bg-indigo-100 px-2 py-0.5 font-mono font-semibold text-indigo-800 text-xs","data-testid":"ontology-schema-version",children:Ya(t)})]}),(0,x.jsx)("p",{className:"mt-1 text-slate-500 text-xs",children:"Neo4j \u7269\u7406\u30B0\u30E9\u30D5\u30B9\u30AD\u30FC\u30DE\u5236\u7D04\u3001\u8AD6\u7406\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u30AF\u30E9\u30B9\u4F53\u7CFB\u3001\u304A\u3088\u3073\u4EBA\u9593\u53C2\u52A0\u578B (HITL) \u30AA\u30F3\u30C8\u30ED\u30B8\u30FC\u6607\u683C\u30D1\u30A4\u30D7\u30E9\u30A4\u30F3\u306E\u7A3C\u50CD\u72B6\u6CC1"})]}),(0,x.jsxs)("div",{className:"inline-flex items-center rounded-lg border border-slate-200 border-solid bg-slate-50 px-3 py-1.5 font-medium text-slate-600 text-xs",children:["\u30C6\u30CA\u30F3\u30C8\u540D\u524D\u7A7A\u9593:"," ",(0,x.jsx)("span",{className:"ml-1.5 font-bold text-slate-800","data-testid":"ontology-tenant-id",children:e})]})]}),(0,x.jsxs)("div",{className:"mt-4 grid grid-cols-2 gap-3 sm:grid-cols-4",children:[(0,x.jsxs)("div",{className:"rounded-lg border border-slate-200 border-solid bg-slate-50/70 p-3",children:[(0,x.jsx)("span",{className:"block text-slate-500 text-xs",children:"\u7269\u7406\u4E00\u610F\u5236\u7D04 (Unique)"}),(0,x.jsx)("span",{className:"mt-1 block font-bold font-mono text-base text-slate-900","data-testid":"ontology-constraints-count",children:ct(t.totalConstraints)})]}),(0,x.jsxs)("div",{className:"rounded-lg border border-slate-200 border-solid bg-slate-50/70 p-3",children:[(0,x.jsx)("span",{className:"block text-slate-500 text-xs",children:"\u691C\u7D22\u7D22\u5F15 (DDL \u304C\u4F5C\u308B\u5206)"}),(0,x.jsx)("span",{className:"mt-1 block font-bold font-mono text-base text-slate-900","data-testid":"ontology-indexes-count",children:ct(t.searchIndexes)}),(0,x.jsxs)("span",{className:"block text-slate-500 text-xs","data-testid":"ontology-indexes-total",children:["\u5168\u7D22\u5F15: ",ct(t.totalIndexes)]})]}),(0,x.jsxs)("div",{className:"rounded-lg border border-slate-200 border-solid bg-slate-50/70 p-3",children:[(0,x.jsx)("span",{className:"block text-slate-500 text-xs",children:"\u6607\u683C\u5224\u5B9A\u3057\u304D\u3044\u5024 (\u78BA\u4FE1\u5EA6/\u5171\u8D77)"}),(0,x.jsxs)("span",{className:"mt-1 block font-bold font-mono text-base text-indigo-700","data-testid":"ontology-thresholds-info",children:[Ye(t.promotionThresholds.confidence)," / ",Ye(t.promotionThresholds.cooccurrence," \u56DE")]})]}),(0,x.jsxs)("div",{className:"rounded-lg border border-slate-200 border-solid bg-slate-50/70 p-3",children:[(0,x.jsx)("span",{className:"block text-slate-500 text-xs",children:"HITL \u6607\u683C\u627F\u8A8D\u5F85\u3061\u5019\u88DC"}),(0,x.jsx)("span",{className:"mt-1 block font-bold font-mono text-amber-700 text-base","data-testid":"ontology-unresolved-count",children:ct(t.unresolvedCandidatesCount)})]})]})]}),(0,x.jsxs)("div",{className:"grid grid-cols-1 gap-6 lg:grid-cols-2",children:[(0,x.jsxs)("div",{className:"rounded-xl border border-slate-200 border-solid bg-white p-6 shadow-sm",children:[(0,x.jsxs)("div",{className:"flex items-center justify-between pb-3",children:[(0,x.jsxs)("div",{children:[(0,x.jsx)("h3",{className:"font-bold text-slate-900 text-sm",children:"\u30AA\u30F3\u30C8\u30ED\u30B8\u30FC\u4E3B\u8981\u30AF\u30E9\u30B9\u4F53\u7CFB (Node Labels)"}),(0,x.jsx)("p",{className:"text-slate-500 text-xs",children:"\u30B0\u30E9\u30D5\u5185\u3067\u30E2\u30C7\u30EB\u5316\u3055\u308C\u3066\u3044\u308B\u6B63\u6E96\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u30CE\u30FC\u30C9\u7A2E\u5225"})]}),(0,x.jsx)("span",{className:"rounded-sm bg-indigo-50 px-2 py-0.5 font-semibold text-indigo-700 text-xs","data-testid":"ontology-classes-count",children:da(o)})]}),(0,x.jsxs)("div",{className:"divide-y divide-solid divide-slate-100",children:[o===null&&(0,x.jsx)("p",{className:"py-3 text-slate-500 text-xs","data-testid":"ontology-classes-unsupplied",children:"\u3053\u306E\u914D\u5099\u306E\u30AF\u30E9\u30B9\u8A9E\u5F59\u304C\u4F9B\u7D66\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002\u5B9F\u88C5\u304C\u8A31\u3059\u8A9E\u5F59\u3092\u8FD4\u3059\u7D4C\u8DEF\u304C\u7D50\u7DDA\u3055\u308C\u3066\u3044\u306A\u3044\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059\u3002"}),o?.map(l=>(0,x.jsxs)("div",{className:"flex items-start justify-between py-2.5","data-testid":`ontology-class-${l.name}`,children:[(0,x.jsxs)("div",{children:[(0,x.jsx)("span",{className:"inline-block font-bold font-mono text-indigo-700 text-xs",children:l.name}),(0,x.jsx)("p",{className:"mt-0.5 text-slate-600 text-xs",children:l.description})]}),typeof l.count=="number"&&(0,x.jsx)("span",{className:"rounded-sm bg-slate-100 px-2 py-0.5 font-mono text-slate-600 text-xs",children:l.count.toLocaleString()})]},l.name))]})]}),(0,x.jsxs)("div",{className:"rounded-xl border border-slate-200 border-solid bg-white p-6 shadow-sm",children:[(0,x.jsxs)("div",{className:"flex items-center justify-between pb-3",children:[(0,x.jsxs)("div",{children:[(0,x.jsx)("h3",{className:"font-bold text-slate-900 text-sm",children:"\u30EA\u30EC\u30FC\u30B7\u30E7\u30F3\u30B7\u30C3\u30D7\u8FF0\u8A9E\u4F53\u7CFB (Predicates)"}),(0,x.jsx)("p",{className:"text-slate-500 text-xs",children:"\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u9593\u306E\u30BB\u30DE\u30F3\u30C6\u30A3\u30C3\u30AF\u95A2\u4FC2\u3068\u6709\u5411\u6027"})]}),(0,x.jsx)("span",{className:"rounded-sm bg-amber-50 px-2 py-0.5 font-semibold text-amber-700 text-xs","data-testid":"ontology-predicates-count",children:da(c)})]}),(0,x.jsxs)("div",{className:"divide-y divide-solid divide-slate-100",children:[c===null&&(0,x.jsx)("p",{className:"py-3 text-slate-500 text-xs","data-testid":"ontology-predicates-unsupplied",children:"\u3053\u306E\u914D\u5099\u306E\u8FF0\u8A9E\u8A9E\u5F59\u304C\u4F9B\u7D66\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002\u5B9F\u88C5\u304C\u8A31\u3059\u8A9E\u5F59\u3092\u8FD4\u3059\u7D4C\u8DEF\u304C\u7D50\u7DDA\u3055\u308C\u3066\u3044\u306A\u3044\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059\u3002"}),c?.map(l=>(0,x.jsxs)("div",{className:"flex items-start justify-between py-2.5","data-testid":`ontology-predicate-${l.name}`,children:[(0,x.jsxs)("div",{children:[(0,x.jsx)("span",{className:"inline-block font-bold font-mono text-amber-800 text-xs",children:l.name}),(0,x.jsx)("p",{className:"mt-0.5 text-slate-600 text-xs",children:l.description})]}),(0,x.jsx)("span",{className:"rounded-sm border border-slate-200 border-solid bg-slate-50 px-2 py-0.5 font-mono text-[11px] text-slate-600",children:l.direction})]},l.name))]})]})]}),(0,x.jsxs)("div",{className:"rounded-xl border border-indigo-100 border-solid bg-indigo-50/40 p-5 shadow-sm","data-testid":"ontology-evolution-policy-card",children:[(0,x.jsx)("h3",{className:"font-bold text-indigo-950 text-sm",children:"\u81EA\u5F8B\u7684\u30AA\u30F3\u30C8\u30ED\u30B8\u30FC\u9032\u5316 (Autonomous Ontology Evolution) \u30DD\u30EA\u30B7\u30FC"}),(0,x.jsxs)("div",{className:"mt-2 grid grid-cols-1 gap-3 text-indigo-900 text-xs md:grid-cols-3",children:[(0,x.jsxs)("div",{className:"rounded-lg border border-indigo-200/60 border-solid bg-white p-3",children:[(0,x.jsx)("span",{className:"font-semibold text-slate-700",children:"3 \u6761\u4EF6 AND \u30B2\u30FC\u30C8:"}),(0,x.jsxs)("p",{className:"mt-1 text-slate-600",children:["\u672A\u89E3\u6C7A\u30E1\u30F3\u30B7\u30E7\u30F3\u51FA\u73FE\u6642\u306B\u985E\u4F3C\u5EA6 \u2267 ",Ye(t.promotionThresholds.confidence),"\u3001\u5171\u8D77\u56DE\u6570 \u2267 ",Ye(t.promotionThresholds.cooccurrence),"\u3001\u8B58\u5225\u30E6\u30FC\u30B6\u30FC\u6570 \u2267"," ",Ye(t.promotionThresholds.minDistinctUsers)," \u306E\u5168\u5145\u8DB3\u3092\u8981\u6C42\u3002"]})]}),(0,x.jsxs)("div",{className:"rounded-lg border border-indigo-200/60 border-solid bg-white p-3",children:[(0,x.jsx)("span",{className:"font-semibold text-slate-700",children:"2x \u5171\u8D77\u983B\u5EA6\u518D\u63D0\u6848\u30D0\u30C3\u30AF\u30AA\u30D5:"}),(0,x.jsx)("p",{className:"mt-1 text-slate-600",children:"\u904B\u7528\u8005\u306B\u3088\u308A\u6607\u683C\u3092\u5374\u4E0B\u3055\u308C\u305F\u5019\u88DC\u306F\u3001\u524D\u56DE\u306E\u5171\u8D77\u6570\u306E 2 \u500D\u4EE5\u4E0A\u306E\u983B\u5EA6\u3067\u518D\u8A00\u53CA\u3055\u308C\u308B\u307E\u3067\u6607\u683C\u30AD\u30E5\u30FC\u3078\u306E\u518D\u6D6E\u4E0A\u3092\u81EA\u52D5\u6291\u5236\u3002"})]}),(0,x.jsxs)("div",{className:"rounded-lg border border-indigo-200/60 border-solid bg-white p-3",children:[(0,x.jsx)("span",{className:"font-semibold text-slate-700",children:"Cypher AST ABAC \u8A8D\u53EF\u6CE8\u5165:"}),(0,x.jsxs)("p",{className:"mt-1 text-slate-600",children:["Neo4j \u30AF\u30A8\u30EA\u5B9F\u884C\u6642\u306B ",(0,x.jsx)("code",{className:"font-mono text-indigo-800",children:"tenantId = $tenant_id"})," \u3068\u6A5F\u5BC6\u533A\u5206\u8FF0\u8A9E\u3092\u4E0D\u53EF\u5206\u306B\u5408\u6210\u3057\u3001\u30C6\u30CA\u30F3\u30C8\u5B8C\u5168\u9694\u96E2\u3092\u62C5\u4FDD\u3002"]})]})]})]})]})}var j=require("@aiquants/enrichment-core"),de=require("react");var pt=require("@aiquants/console-ui/core"),ut=require("@aiquants/enrichment-core"),Me={inset:12,labelFontSize:13,captionFontSize:11},Te={offset:3,stroke:2},ia={node:{width:(0,pt.ceil8)(Math.max(...Object.values(ut.PIPELINE_STEPS).map(e=>(0,pt.textWidthEm)(e.label)))*Me.labelFontSize+2*Me.inset),height:56},gap:{column:48,row:24},padding:24};function $e(e){return Math.round(e*1e3)/1e3}function es(e){let t=new Map;for(let o of e){let c=o.dependsOn.reduce((l,p)=>Math.max(l,t.get(p)),-1);t.set(o.step,c+1)}return t}function Lt(e,t){return`${e}->${t}`}function ts(e,t){let o=[],c=new Map;return{slots:[...e.map(p=>{let b=t.get(p.step),m=p.dependsOn.map(y=>{let N=[],h=y;for(let C=t.get(y)+1;C<b;C+=1){let E=`${Lt(y,p.step)}@${C}`;o.push({id:E,rank:C,predecessors:[h]}),N.push(E),h=E}return c.set(Lt(y,p.step),N),h});return{id:p.step,rank:b,predecessors:m}}),...o],chains:c}}function as(e){let t=new Map,o=Math.max(...e.map(c=>c.rank));for(let c=0;c<=o;c+=1){let p=e.filter(b=>b.rank===c).map((b,m)=>{let y=c===0?m:b.predecessors.reduce((N,h)=>N+t.get(h),0)/b.predecessors.length;return{slot:b,barycenter:y}});p.sort((b,m)=>b.barycenter-m.barycenter),p.forEach(({slot:b},m)=>{t.set(b.id,m)})}return t}function $t(e,t=ia){let o=(0,ut.orderedSteps)(e),c=es(o),{slots:l,chains:p}=ts(o,c),b=as(l),{node:m,gap:y,padding:N}=t,h=R=>({x:$e(N+R.rank*(m.width+y.column)),y:$e(N+b.get(R.id)*(m.height+y.row))}),C=new Map(l.map(R=>[R.id,h(R)])),E=o.map(R=>{let O=C.get(R.step);return{key:R.step,x:O.x,y:O.y,rank:c.get(R.step),order:b.get(R.step),width:m.width,height:m.height}}),J=R=>$e(R+m.height/2),ae=o.flatMap(R=>R.dependsOn.map(O=>{let A=C.get(O),L=C.get(R.step),G=$e(A.x+m.width),g=J(A.y),$=`M ${G} ${g}`,B=(D,re)=>{let Z=$e((G+D)/2);$+=` C ${Z} ${g}, ${Z} ${re}, ${D} ${re}`};for(let D of p.get(Lt(O,R.step))){let re=C.get(D),Z=J(re.y);B(re.x,Z),G=$e(re.x+m.width),g=Z,$+=` L ${G} ${g}`}return B(L.x,J(L.y)),{from:O,to:R.step,path:$}})),K=[...C.values()],I=$e(Math.max(...K.map(R=>R.x+m.width))+N),Q=$e(Math.max(...K.map(R=>R.y+m.height))+N);return{width:I,height:Q,steps:E,edges:ae}}var i=require("react/jsx-runtime"),la="\u4F9D\u5B58\u306A\u3057 (\u6D41\u308C\u306E\u6700\u521D\u306B\u8D70\u308B)",Tt={EXTRACTING:"\u62BD\u51FA",ENRICHING:"\u8981\u7D04",PROJECTING:"\u6295\u5F71"},ca={rebuild:"\u672C\u6587\u304B\u3089\u7D44\u307F\u76F4\u3059",existing:"\u524D\u6BB5\u304C\u66F8\u3044\u305F\u884C\u3092\u305D\u306E\u307E\u307E\u4F7F\u3046"},Mt={open:{badge:"\u9580: \u958B",stroke:"stroke-emerald-500",dash:void 0},"closed-skip":{badge:"\u9580: \u9589 (\u7701\u7565)",stroke:"stroke-amber-500",dash:void 0},"closed-fail":{badge:"\u9580: \u9589 (\u5931\u6557)",stroke:"stroke-red-500",dash:void 0},unmeasured:{badge:"\u9580: \u672A\u6E2C\u5B9A",stroke:"stroke-slate-400",dash:"6 4"}},Ot={none:"\u9580\u306A\u3057",skip:"\u9589\u3058\u305F\u3089\u7701\u7565",fail:"\u9589\u3058\u305F\u3089\u5931\u6557",mixed:"\u9589\u3058\u305F\u9580\u3067\u7570\u306A\u308B"},ss={open:"\u958B",closed:"\u9589",unmeasured:"\u672A\u6E2C\u5B9A"},et="rgb(248 250 252)",ns={backgroundColor:et,backgroundImage:`linear-gradient(to right, ${et}, ${et}), linear-gradient(to right, ${et}, ${et}), linear-gradient(to right, rgb(15 23 42 / 0.2), transparent), linear-gradient(to left, rgb(15 23 42 / 0.2), transparent)`,backgroundPosition:"left center, right center, left center, right center",backgroundRepeat:"no-repeat",backgroundSize:"24px 100%, 24px 100%, 12px 100%, 12px 100%",backgroundAttachment:"local, local, scroll, scroll"};function Ft(e,t){let o=t[e.featureFlagKey];return o===void 0?"unmeasured":o?"open":"closed"}function pa(e,t){let o=e.map(c=>({gate:c,state:Ft(c,t)}));return o.some(({gate:c,state:l})=>l==="closed"&&c.whenClosed==="fail")?"closed-fail":o.some(({state:c})=>c==="closed")?"closed-skip":o.some(({state:c})=>c==="unmeasured")?"unmeasured":"open"}function At(e){return e.length===0?"none":e.every(t=>t.whenClosed==="fail")?"fail":e.every(t=>t.whenClosed==="skip")?"skip":"mixed"}function ua(e,t){let{badge:o}=Mt[e];return t==="none"||e==="closed-skip"||e==="closed-fail"?o:`${o}\u30FB${Ot[t]}`}function os(e){return e.whenClosed==="skip"?"\u9589\u3058\u305F\u3068\u304D\u306F\u6BB5\u3092\u7701\u7565":`\u9589\u3058\u305F\u3068\u304D\u306F ${e.failureStatus} \u3067\u5931\u6557`}function Dt(e){return e.map(t=>j.PIPELINE_STEPS[t].label).join("\u3001")}function rs(e){return e.dependsOn.length===0?la:`\u4F9D\u5B58: ${Dt(e.dependsOn)}`}function ds({featureFlags:e,metrics:t,metricSampleWindow:o,selectedKind:c,onSelectKind:l,selectedStepKey:p,onSelectStep:b}){if(!Number.isSafeInteger(o)||o<=0)throw new RangeError(`metricSampleWindow must be a positive integer, got ${o}.`);let m=(0,de.useId)(),y=(0,de.useId)(),N=(0,de.useId)(),h=(0,de.useId)(),C=(0,de.useId)(),[E,J]=(0,de.useState)(j.DOCUMENT_KINDS[0]),[ae,K]=(0,de.useState)(null),[I,Q]=(0,de.useState)(null),R=(0,de.useRef)(new Map),O=(0,de.useRef)(new Map),A=(0,de.useRef)(null),L=(0,de.useRef)(null),{labels:G}=te(),g=c!==void 0?c:E,$=p!==void 0?p:ae,B=(0,j.flowFor)(g),D=$t(B),re=new Map(B.steps.map(u=>[u.step,u])),Z=u=>{K(u),b?.(u)},be=u=>{J(u),l?.(u),Z(null)},fe=(u,T)=>{let ee=j.DOCUMENT_KINDS.length-1,z;switch(u.key){case"ArrowRight":z=T===ee?0:T+1;break;case"ArrowLeft":z=T===0?ee:T-1;break;case"Home":z=0;break;case"End":z=ee;break;default:return}u.preventDefault();let se=j.DOCUMENT_KINDS[z];be(se),R.current.get(se)?.focus()},_=u=>{let T=L.current;if(Z(null),T?.isConnected){T.focus();return}O.current.get(u)?.focus()},ie=u=>{Z(u===$?null:u)},H=(u,T)=>{u.currentTarget.focus(),ie(T)},X=(u,T)=>{u.key==="Enter"||u.key===" "?(u.preventDefault(),ie(T)):u.key==="Escape"&&Z(null)},U=$===null?void 0:re.get($),xe=U===void 0?null:U.step;(0,de.useEffect)(()=>{if(xe===null){L.current=null;return}let u=document.activeElement;(u instanceof HTMLElement||u instanceof SVGElement)&&u!==document.body&&A.current?.contains(u)===!1&&(L.current=u)},[xe]);let ne=U===void 0?void 0:j.PIPELINE_STEPS[U.step],he=U===void 0?[]:(0,j.flowStepGates)(U),Ie=U===void 0?[]:B.steps.filter(u=>u.dependsOn.includes(U.step)).map(u=>u.step),le=ne===void 0?void 0:t.find(u=>u.documentKind===g&&u.stepKey===ne.key),ye=j.DOCUMENT_KIND_LABELS[g];return(0,i.jsxs)("section",{className:"space-y-6","aria-labelledby":m,"data-testid":"pipeline-flow-viewer","data-kind":g,children:[(0,i.jsxs)("div",{className:"rounded-xl border border-slate-200 border-solid bg-white p-6 shadow-sm",children:[(0,i.jsx)("h2",{id:m,className:"font-bold text-base text-slate-900",children:"\u53D6\u308A\u8FBC\u307F\u30D1\u30A4\u30D7\u30E9\u30A4\u30F3"}),(0,i.jsx)("p",{className:"mt-2 text-[13px] text-slate-500",children:"\u6587\u66F8\u306E\u7A2E\u985E\u3054\u3068\u306B\u3001\u5B9F\u969B\u306B\u8D70\u308B\u6BB5\u3068\u305D\u306E\u4F9D\u5B58\u3092\u63CF\u304D\u307E\u3059\u3002\u5404\u6BB5\u304C\u5F85\u3064\u6BB5\u306F\u3001\u6BB5\u306E\u8AAC\u660E\u3068\u8A73\u7D30\u306B\u3082\u6587\u5B57\u3067\u793A\u3057\u307E\u3059\u3002\u9580\u306E\u72B6\u614B\u306F\u30C6\u30CA\u30F3\u30C8\u306E\u6A5F\u80FD\u30D5\u30E9\u30B0\u3092\u91CD\u306D\u305F\u3082\u306E\u3067\u3059\u3002"}),(0,i.jsx)("div",{role:"tablist","aria-label":"\u6587\u66F8\u306E\u7A2E\u985E",className:"mt-4 flex flex-wrap gap-2","data-testid":"flow-kind-tablist",children:j.DOCUMENT_KINDS.map((u,T)=>{let ee=u===g;return(0,i.jsx)("button",{ref:z=>{z===null?R.current.delete(u):R.current.set(u,z)},type:"button",role:"tab","aria-selected":ee,"aria-controls":y,tabIndex:ee?0:-1,onClick:()=>be(u),onKeyDown:z=>fe(z,T),className:ee?"rounded-lg border border-indigo-600 border-solid bg-indigo-600 px-3 py-1.5 font-semibold text-[13px] text-white":"rounded-lg border border-slate-300 border-solid bg-white px-3 py-1.5 font-medium text-[13px] text-slate-700 hover:bg-slate-50","data-testid":`flow-kind-${u}`,children:j.DOCUMENT_KIND_LABELS[u]},u)})}),(0,i.jsx)("div",{id:y,role:"tabpanel","aria-label":`${j.DOCUMENT_KIND_LABELS[g]} \u306E\u6D41\u308C`,"aria-describedby":N,className:"mt-4 overflow-x-auto rounded-lg border border-slate-200 border-solid p-4",style:ns,"data-testid":"flow-scroll",children:(0,i.jsxs)("svg",{viewBox:`0 0 ${D.width} ${D.height}`,width:D.width,height:D.height,role:"group","aria-label":`${j.DOCUMENT_KIND_LABELS[g]} \u306E\u30D1\u30A4\u30D7\u30E9\u30A4\u30F3`,style:{display:"block",maxWidth:"none"},"data-testid":"flow-svg",children:[(0,i.jsx)("title",{children:`${j.DOCUMENT_KIND_LABELS[g]} \u306E\u30D1\u30A4\u30D7\u30E9\u30A4\u30F3`}),(0,i.jsx)("defs",{children:(0,i.jsx)("marker",{id:`${y}-arrow`,viewBox:"0 0 8 8",refX:"8",refY:"4",markerWidth:"8",markerHeight:"8",orient:"auto",children:(0,i.jsx)("path",{d:"M 0 0 L 8 4 L 0 8 z",className:"fill-slate-500","data-testid":"flow-edge-arrowhead"})})}),D.edges.map(u=>(0,i.jsx)("path",{d:u.path,fill:"none",strokeWidth:1.5,markerEnd:`url(#${y}-arrow)`,className:"stroke-slate-500","data-testid":`flow-edge-${u.from}-${u.to}`},`${u.from}-${u.to}`)),D.steps.map(u=>{let T=j.PIPELINE_STEPS[u.key],ee=re.get(u.key),z=(0,j.flowStepGates)(ee),se=pa(z,e),Fe=At(z),_e=Mt[se],Ke=ua(se,Fe),we=u.key===$,M=u.key===I,Be=`${y}-depends-${u.key}`;return(0,i.jsxs)("g",{ref:Ne=>{Ne===null?O.current.delete(u.key):O.current.set(u.key,Ne)},transform:`translate(${u.x} ${u.y})`,role:"button",tabIndex:0,"aria-label":`${T.label} (${Ke})`,"aria-describedby":Be,"aria-expanded":we,"aria-controls":we?C:void 0,onClick:Ne=>H(Ne,u.key),onKeyDown:Ne=>X(Ne,u.key),onFocus:()=>Q(u.key),onBlur:()=>Q(null),className:"cursor-pointer focus:outline-none","data-testid":`flow-node-${u.key}`,"data-step-key":u.key,"data-gate-state":se,"data-gate-policy":Fe,"data-selected":we,"data-focused":M,children:[(0,i.jsx)("desc",{id:Be,"data-testid":`flow-node-dependencies-${u.key}`,children:rs(ee)}),M&&(0,i.jsx)("rect",{x:-Te.offset,y:-Te.offset,width:u.width+2*Te.offset,height:u.height+2*Te.offset,rx:8+Te.offset,fill:"none",strokeWidth:Te.stroke,className:"stroke-indigo-600","data-testid":`flow-node-focus-ring-${u.key}`}),(0,i.jsx)("rect",{width:u.width,height:u.height,rx:8,strokeWidth:we?3:1.5,strokeDasharray:_e.dash,className:`${_e.stroke} ${we?"fill-indigo-50":"fill-white"}`,"data-testid":`flow-node-box-${u.key}`}),(0,i.jsx)("text",{x:Me.inset,y:20,className:"fill-slate-900 font-semibold text-[13px]","data-testid":`flow-node-label-${u.key}`,children:T.label}),(0,i.jsx)("text",{x:Me.inset,y:36,className:"fill-slate-600 text-[11px]","data-testid":`flow-node-phase-${u.key}`,children:Tt[T.phase]}),(0,i.jsx)("text",{x:Me.inset,y:49,className:"fill-slate-700 text-[11px]","data-testid":`flow-gate-badge-${u.key}`,"data-gate-state":se,children:Ke})]},u.key)})]})}),(0,i.jsxs)("p",{id:N,className:"mt-2 text-[11px] text-slate-500","data-testid":"flow-scroll-hint",children:["\u56F3\u306F\u5B9F\u5BF8 (\u5E45 ",D.width," px) \u3067\u63CF\u304D\u307E\u3059\u3002\u8868\u793A\u5E45\u306B\u53CE\u307E\u3089\u306A\u3044\u3068\u304D\u306F\u6A2A\u306B\u30B9\u30AF\u30ED\u30FC\u30EB\u3057\u3066\u304F\u3060\u3055\u3044 (Tab \u3067\u6BB5\u3078\u79FB\u308B\u3068\u3001\u305D\u306E\u6BB5\u304C\u898B\u3048\u308B\u4F4D\u7F6E\u307E\u3067\u52D5\u304D\u307E\u3059)\u3002"]})]}),ne!==void 0&&U!==void 0&&(0,i.jsxs)("section",{id:C,ref:A,className:"rounded-xl border border-slate-200 border-solid bg-white p-6 shadow-sm","aria-labelledby":h,"data-testid":"flow-step-detail","data-step-key":ne.key,children:[(0,i.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,i.jsxs)("div",{children:[(0,i.jsx)("h3",{id:h,className:"font-bold text-base text-slate-900",children:ne.label}),(0,i.jsx)("p",{className:"mt-1 text-[13px] text-slate-600",children:ne.description})]}),(0,i.jsx)("button",{type:"button",onClick:()=>_(ne.key),className:"rounded-lg border border-slate-300 border-solid px-3 py-1.5 text-[13px] text-slate-700 hover:bg-slate-50","data-testid":"flow-step-detail-close",children:"\u9589\u3058\u308B"})]}),(0,i.jsxs)("dl",{className:"mt-4 grid grid-cols-1 gap-3 text-[13px] sm:grid-cols-2",children:[(0,i.jsxs)("div",{children:[(0,i.jsx)("dt",{className:"font-semibold text-slate-500",children:"\u30A8\u30F3\u30C9\u30DD\u30A4\u30F3\u30C8"}),(0,i.jsx)("dd",{children:(0,i.jsx)("code",{className:"font-mono","data-testid":"flow-step-endpoint",children:ne.endpoint})})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)("dt",{className:"font-semibold text-slate-500",children:"\u76F8"}),(0,i.jsxs)("dd",{"data-testid":"flow-step-phase",children:[Tt[ne.phase]," (",ne.phase,")"]})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)("dt",{className:"font-semibold text-slate-500",children:"\u80FD\u529B"}),(0,i.jsx)("dd",{"data-testid":"flow-step-capability",children:ne.capability===null?"\u30E2\u30C7\u30EB\u3078\u9001\u3089\u306A\u3044":ne.capability})]}),U.chunkSource!==void 0&&(0,i.jsxs)("div",{children:[(0,i.jsx)("dt",{className:"font-semibold text-slate-500",children:"\u30C1\u30E3\u30F3\u30AF\u306E\u51FA\u6240"}),(0,i.jsxs)("dd",{"data-testid":"flow-step-chunk-source","data-chunk-source":U.chunkSource,children:[ca[U.chunkSource]," (",U.chunkSource,")"]})]}),(0,i.jsxs)("div",{className:"sm:col-span-2",children:[(0,i.jsx)("dt",{className:"font-semibold text-slate-500",children:"\u4F9D\u5B58 (\u5148\u306B\u7D42\u3048\u308B\u6BB5)"}),(0,i.jsx)("dd",{"data-testid":"flow-step-depends-on",children:U.dependsOn.length===0?la:Dt(U.dependsOn)})]}),(0,i.jsxs)("div",{className:"sm:col-span-2",children:[(0,i.jsx)("dt",{className:"font-semibold text-slate-500",children:"\u5F8C\u7D9A (\u3053\u306E\u6BB5\u3092\u5F85\u3064\u6BB5)"}),(0,i.jsx)("dd",{"data-testid":"flow-step-dependents",children:Ie.length===0?"\u5F8C\u7D9A\u306A\u3057 (\u6D41\u308C\u306E\u6700\u5F8C\u306B\u8D70\u308B)":Dt(Ie)})]}),(0,i.jsxs)("div",{className:"sm:col-span-2",children:[(0,i.jsx)("dt",{className:"font-semibold text-slate-500",children:"\u9580"}),(0,i.jsx)("dd",{children:he.length===0?(0,i.jsx)("span",{"data-testid":"flow-step-no-gates",children:"\u9580\u306A\u3057 (\u5E38\u306B\u8D70\u308B)"}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("ul",{className:"space-y-1",children:he.map(u=>{let T=Ft(u,e);return(0,i.jsxs)("li",{"data-testid":`flow-gate-${u.featureFlagKey}`,"data-gate-state":T,"data-when-closed":u.whenClosed,children:[(0,i.jsx)("code",{className:"font-mono",children:u.featureFlagKey}),": ",ss[T]," \u2014 ",os(u)]},u.featureFlagKey)})}),U.gatePolicy!==void 0&&(0,i.jsxs)("p",{className:"mt-1 text-slate-600","data-testid":"flow-gate-policy-override",children:[ye," \u306E\u6D41\u308C\u3067\u306F\u6BB5\u306E\u5BA3\u8A00 (",Ot[At(ne.gates)],") \u3092\u4E0A\u66F8\u304D\u3057\u3001\u9580\u304C\u9589\u3058\u308B\u3068\u5B9F\u884C\u3092 ",U.gatePolicy.failureStatus," \u3067\u5931\u6557\u3055\u305B\u307E\u3059\u3002"]})]})})]})]}),(0,i.jsxs)("div",{className:"mt-4 rounded-lg border border-slate-200 border-solid bg-slate-50 p-4","data-testid":"flow-step-metric","data-kind":g,children:[(0,i.jsxs)("span",{className:"block font-semibold text-[13px] text-slate-700",children:["\u76F4\u8FD1\u306E\u96C6\u8A08 (",ye,"\u30FB\u76F4\u8FD1 ",o," \u4EF6)"]}),(0,i.jsxs)("p",{className:"mt-1 text-[11px] text-slate-500","data-testid":"flow-metric-scope",children:[ye," \u306E\u5B9F\u884C\u306B\u5C5E\u3059\u308B\u3001\u3053\u306E\u6BB5\u306E\u65B0\u3057\u3044\u8A18\u9332 ",o," \u4EF6\u307E\u3067\u3092\u96C6\u8A08\u3057\u3066\u3044\u307E\u3059\u3002\u4ED6\u306E\u7A2E\u985E\u306E\u5B9F\u884C\u306F\u6570\u3048\u307E\u305B\u3093\u3002"]}),le===void 0?(0,i.jsxs)("p",{className:"mt-1 text-[13px] text-slate-500","data-testid":"flow-step-metric-empty","data-unmeasured-note":!0,children:[G.unmeasured," (",ye," \u306E\u5B9F\u884C\u3067\u3053\u306E\u6BB5\u3092\u8A18\u9332\u3057\u305F\u3082\u306E\u306F\u307E\u3060\u3042\u308A\u307E\u305B\u3093)"]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("dl",{className:"mt-2 grid grid-cols-2 gap-2 text-[13px] sm:grid-cols-4",children:[(0,i.jsxs)("div",{children:[(0,i.jsx)("dt",{className:"text-slate-500",children:"\u6A19\u672C\u6570 (\u7701\u7565\u3092\u9664\u304F)"}),(0,i.jsx)("dd",{"data-testid":"flow-metric-sample-count",children:(0,i.jsx)(q,{value:le.sampleCount,testId:"flow-metric-sample-count-value"})})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)("dt",{className:"text-slate-500",children:"\u6210\u529F"}),(0,i.jsx)("dd",{"data-testid":"flow-metric-succeeded",children:(0,i.jsx)(q,{value:le.succeeded,testId:"flow-metric-succeeded-value"})})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)("dt",{className:"text-slate-500",children:"\u5931\u6557"}),(0,i.jsx)("dd",{"data-testid":"flow-metric-failed",children:(0,i.jsx)(q,{value:le.failed,testId:"flow-metric-failed-value"})})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)("dt",{className:"text-slate-500",children:"\u7701\u7565"}),(0,i.jsx)("dd",{"data-testid":"flow-metric-skipped",children:(0,i.jsx)(q,{value:le.skipped,testId:"flow-metric-skipped-value"})})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)("dt",{className:"text-slate-500",children:"p50"}),(0,i.jsx)("dd",{className:"whitespace-nowrap","data-testid":"flow-metric-p50",children:(0,i.jsx)(q,{value:le.durationP50Ms,unit:"ms",testId:"flow-metric-p50-value"})})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)("dt",{className:"text-slate-500",children:"p95"}),(0,i.jsx)("dd",{className:"whitespace-nowrap","data-testid":"flow-metric-p95",children:(0,i.jsx)(q,{value:le.durationP95Ms,unit:"ms",testId:"flow-metric-p95-value"})})]}),(0,i.jsxs)("div",{className:"col-span-2",children:[(0,i.jsx)("dt",{className:"text-slate-500",children:"\u6700\u5F8C\u306E\u958B\u59CB"}),(0,i.jsx)("dd",{"data-testid":"flow-metric-last-started-at",children:(0,i.jsx)(ge,{iso:le.lastStartedAt,testId:"flow-metric-last-started-at-value"})})]})]}),(0,i.jsxs)("p",{className:"mt-2 text-[11px] text-slate-500","data-testid":"flow-metric-note","data-unmeasured-note":!0,children:["p50 / p95 \u306F\u6240\u8981\u3092\u6E2C\u3063\u305F\u8A18\u9332\u3060\u3051\u304B\u3089\u6C42\u3081\u307E\u3059\u3002\u7701\u7565\u3057\u305F\u6BB5\u306F\u300C\u7701\u7565\u300D\u306B\u3060\u3051\u6570\u3048\u3001\u6A19\u672C\u6570\u306B\u3082\u6240\u8981\u306B\u3082\u5165\u308A\u307E\u305B\u3093\u3002\u4F55\u3082\u547C\u3070\u305A\u306B\u6B62\u307E\u3063\u305F\u5931\u6557 (\u6240\u8981 ",G.unmeasured,") \u306F\u6A19\u672C\u6570\u3068\u300C\u5931\u6557\u300D\u306B\u306F\u5165\u308A\u307E\u3059\u304C\u3001\u6240\u8981\u306B\u306F\u5165\u308A\u307E\u305B\u3093\u3002"]})]})]})]}),(0,i.jsxs)("div",{className:"rounded-xl border border-slate-200 border-solid bg-white p-6 shadow-sm",children:[(0,i.jsx)("h3",{className:"font-bold text-base text-slate-900",children:"MIME \u578B\u304B\u3089\u7A2E\u985E\u3078\u306E\u5206\u985E\u8868"}),(0,i.jsxs)("p",{className:"mt-1 text-[13px] text-slate-500",children:["\u5206\u985E\u5668\u304C\u8AAD\u3080\u8868\u305D\u306E\u3082\u306E\u3067\u3059\u3002",(0,i.jsx)("code",{className:"font-mono",children:"*"})," \u3067\u7D42\u308F\u308B\u898F\u5247\u306F\u524D\u65B9\u4E00\u81F4\u3001\u305D\u308C\u4EE5\u5916\u306F\u5B8C\u5168\u4E00\u81F4\u3067\u3001\u6700\u521D\u306B\u4E00\u81F4\u3057\u305F\u898F\u5247\u304C\u52DD\u3061\u307E\u3059\u3002\u3069\u306E\u898F\u5247\u306B\u3082\u4E00\u81F4\u3057\u306A\u3044\u578B\u306F\u300C",j.DOCUMENT_KIND_LABELS.other,"\u300D\u3067\u3059\u3002"]}),(0,i.jsx)("div",{className:"relative mt-4 overflow-x-auto","data-testid":"flow-mime-scroll",children:(0,i.jsxs)("table",{className:"min-w-full divide-y divide-solid divide-slate-200 text-left text-[13px]","data-testid":"flow-mime-table",children:[(0,i.jsx)("thead",{className:"bg-slate-50 font-semibold text-slate-700",children:(0,i.jsxs)("tr",{children:[(0,i.jsx)("th",{scope:"col",className:"px-3 py-2",children:"MIME \u578B\u306E\u30D1\u30BF\u30FC\u30F3"}),(0,i.jsx)("th",{scope:"col",className:"px-3 py-2",children:"\u7A2E\u985E"})]})}),(0,i.jsx)("tbody",{className:"divide-y divide-solid divide-slate-100",children:j.MIME_KIND_RULES.map(([u,T],ee)=>(0,i.jsxs)("tr",{className:T===g?"bg-indigo-50":void 0,"data-testid":`flow-mime-rule-${ee}`,"data-kind":T,"data-selected":T===g,children:[(0,i.jsx)("td",{className:"px-3 py-2",children:(0,i.jsx)("code",{className:"font-mono",children:u})}),(0,i.jsx)("td",{className:"px-3 py-2",children:j.DOCUMENT_KIND_LABELS[T]})]},u))})]})})]})]})}var Oe=require("@aiquants/enrichment-core"),ue=require("react");var d=require("react/jsx-runtime"),ba=8,is={text_layer:"\u6587\u5B57\u5C64",ocr:"OCR",transcript:"\u8EE2\u5199"},ls={provider:"\u30D7\u30ED\u30D0\u30A4\u30C0",model:"\u30E2\u30C7\u30EB",engine:"\u30A8\u30F3\u30B8\u30F3",prompt_key:"\u30D7\u30ED\u30F3\u30D7\u30C8",prompt_version:"\u7248",duration_ms:"\u51E6\u7406\u6642\u9593",input_chars:"\u5165\u529B\u6587\u5B57\u6570",output_chars:"\u51FA\u529B\u6587\u5B57\u6570",chunk_count:"\u30C1\u30E3\u30F3\u30AF",points_upserted:"\u6295\u5165\u70B9\u6570",collection:"\u30B3\u30EC\u30AF\u30B7\u30E7\u30F3",embedding_model:"\u57CB\u3081\u8FBC\u307F\u30E2\u30C7\u30EB",graph_nodes:"\u30B0\u30E9\u30D5\u30CE\u30FC\u30C9"},ga={duration_ms:"ms",input_chars:void 0,output_chars:void 0,chunk_count:void 0,points_upserted:void 0,graph_nodes:void 0},cs=["provider","model","engine","prompt_key","prompt_version","duration_ms","input_chars","output_chars","chunk_count","points_upserted","collection","embedding_model","graph_nodes"],ps=["FAILED","RUNNING","SUCCEEDED","SKIPPED"],us={atomic:"whitespace-nowrap",anywhere:"wrap-anywhere"};function fa(e){return Object.hasOwn(ga,e)}function tt(e,t){return`run-step-provenance-value-${e}-${t}`}function ms(e,t,o){if(fa(t)){let l=e[t];return l===null?null:(0,d.jsx)(q,{value:l,unit:ga[t],testId:tt(o,t)})}let c=e[t];return c===null?null:(0,d.jsx)(Qe,{text:String(c),testId:tt(o,t)})}function bs(e,t){let o=cs.map(p=>({key:p,label:ls[p],value:ms(e,p,t),breaks:fa(p)?"atomic":"anywhere"})),c=e.pages_read!==null||e.pages_total!==null,l=(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(q,{value:e.pages_read,testId:tt(t,"pages_read")})," / ",(0,d.jsx)(q,{value:e.pages_total,testId:tt(t,"pages_total")})]});return[...o,{key:"pages",label:"\u8AAD\u3093\u3060\u30DA\u30FC\u30B8",value:c?l:null,breaks:"atomic"},{key:"body_source",label:"\u672C\u6587\u306E\u51FA\u6240",value:e.body_source===null?null:(0,d.jsx)(Qe,{text:is[e.body_source],testId:tt(t,"body_source")}),breaks:"anywhere"}]}function gs(e){let t=[],o=new Map;for(let c of[...e.steps].sort((l,p)=>l.sequence-p.sequence)){if(Oe.PIPELINE_STEPS[c.stepKey].fanOut!=="children"||c.targetMetadataId===e.metadataId){t.push({kind:"step",step:c});continue}let l=o.get(c.stepKey);if(l!==void 0){l.push(c);continue}let p=[c];o.set(c.stepKey,p),t.push({kind:"fan_out",stepKey:c.stepKey,steps:p})}return t}function fs(e){if(e.skipReason===null)throw new RangeError(`Step record #${e.id} is SKIPPED without a skip reason, which the pipeline record schema refuses.`);return e.skipReason}function xs({step:e}){let{labels:t}=te();if(e.status==="SKIPPED")return(0,d.jsxs)("p",{className:"text-[13px] text-slate-600","data-testid":`run-step-skip-reason-${e.sequence}`,children:["\u7701\u7565: ",ht(fs(e))]});if(e.provenance===null)return(0,d.jsx)("p",{className:"text-[13px] text-slate-500","data-testid":`run-step-provenance-missing-${e.sequence}`,children:"\u6BB5\u306E\u5831\u544A\u306F\u3042\u308A\u307E\u305B\u3093\u3002"});let o=e.provenance,c=bs(o,e.sequence),l=c.filter(b=>b.value!==null),p=c.filter(b=>b.value===null);return(0,d.jsxs)(d.Fragment,{children:[l.length>0&&(0,d.jsx)("dl",{className:"grid grid-cols-2 gap-x-4 gap-y-1 text-[13px] sm:grid-cols-3","data-testid":`run-step-provenance-${e.sequence}`,children:l.map(b=>(0,d.jsxs)("div",{className:"border-slate-100 border-b border-solid py-0.5",children:[(0,d.jsx)("dt",{className:"text-slate-500",children:b.label}),(0,d.jsx)("dd",{className:`text-slate-800 ${us[b.breaks]}`,"data-provenance-key":b.key,children:b.value})]},b.key))}),p.length>0&&(0,d.jsxs)("p",{className:"mt-1 text-[11px] text-slate-500","data-testid":`run-step-unmeasured-${e.sequence}`,"data-unmeasured-note":!0,children:[t.unmeasured,": ",p.map(b=>b.label).join("\u3001")]}),Object.keys(o.detail).length>0&&(0,d.jsxs)("details",{className:"mt-2 text-[13px]","data-testid":`run-step-detail-${e.sequence}`,children:[(0,d.jsx)("summary",{className:"cursor-pointer text-slate-600",children:"\u8A73\u7D30"}),(0,d.jsx)("pre",{className:"mt-1 overflow-auto rounded-lg bg-slate-900 p-4 font-mono text-[11px] text-slate-100",children:JSON.stringify(o.detail,null,2)})]})]})}function ma(e,t,o,c){let l=ot[e.status];return(0,d.jsx)("li",{className:"rounded-lg border border-slate-200 border-solid","data-testid":`run-step-${e.sequence}`,"data-status":e.status,"data-step-key":e.stepKey,children:(0,d.jsxs)("details",{open:c,className:"group/step","data-testid":`run-step-card-${e.sequence}`,children:[(0,d.jsxs)("summary",{className:"flex cursor-pointer list-none flex-wrap items-center gap-2 p-4 [&::-webkit-details-marker]:hidden",children:[(0,d.jsx)("span",{"aria-hidden":"true",className:"text-[11px] text-slate-500 transition-transform group-open/step:rotate-90",children:"\u25B6"}),(0,d.jsx)("span",{className:"font-semibold text-[13px] text-slate-900",children:t}),e.strategyId!==null&&(0,d.jsxs)("span",{className:"rounded-sm bg-indigo-50 px-1.5 py-0.5 text-[11px] text-indigo-800","data-testid":`run-step-strategy-${e.sequence}`,children:["\u6226\u7565 #",e.strategyId]}),(0,d.jsx)("span",{className:`inline-flex rounded-full px-2 py-0.5 font-semibold text-[11px] ${l.className}`,"data-testid":`run-step-status-${e.sequence}`,"data-status":e.status,children:l.label}),(0,d.jsx)("span",{className:"ml-auto text-[11px] text-slate-600","data-testid":`run-step-duration-${e.sequence}`,children:(0,d.jsx)(q,{value:e.durationMs,unit:"ms",testId:`run-step-duration-value-${e.sequence}`})})]}),(0,d.jsxs)("div",{className:"space-y-2 px-4 pb-4",children:[e.durationMs!==null&&o>0&&(0,d.jsx)("div",{className:"h-2 rounded-full bg-slate-100",children:(0,d.jsx)("div",{className:`h-2 rounded-full ${l.bar}`,style:{width:`${e.durationMs/o*100}%`},"data-testid":`run-step-bar-${e.sequence}`})}),e.errorMessage!==null&&(0,d.jsxs)("p",{className:"wrap-anywhere text-[13px] text-red-700","data-testid":`run-step-error-${e.sequence}`,children:[e.errorCode===null?"":`${e.errorCode}: `,e.errorMessage,e.httpStatus===null?"":` (HTTP ${e.httpStatus})`]}),(0,d.jsx)(xs,{step:e})]})]})},e.id)}function ys(e,t,o){let c=Le(e),l=De[c],p=e.steps.reduce((m,y)=>y.durationMs===null?m:Math.max(m,y.durationMs),0),b=e.steps.length<=ba;return(0,d.jsxs)("section",{className:"space-y-4","aria-labelledby":t,"data-testid":"run-detail","data-run-id":e.id,children:[(0,d.jsxs)("h3",{ref:o,id:t,tabIndex:-1,className:"font-bold text-base text-slate-900 focus:outline-none","data-testid":"run-detail-heading",children:[Oe.DOCUMENT_KIND_LABELS[e.documentKind]," \u306E\u5B9F\u884C #",e.id]}),(0,d.jsxs)("dl",{className:"grid grid-cols-2 gap-3 text-[13px] sm:grid-cols-4","data-testid":"run-inspector-header",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("dt",{className:"text-slate-500",children:"\u304D\u3063\u304B\u3051"}),(0,d.jsx)("dd",{"data-testid":"run-trigger","data-trigger":e.trigger,children:rt[e.trigger]})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("dt",{className:"text-slate-500",children:"\u8A66\u884C"}),(0,d.jsx)("dd",{"data-testid":"run-attempt",children:e.attempt})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("dt",{className:"text-slate-500",children:"\u72B6\u614B"}),(0,d.jsx)("dd",{children:(0,d.jsx)("span",{className:`inline-flex rounded-full px-2.5 py-0.5 font-semibold text-[11px] ${l.className}`,"data-testid":"run-status","data-status":e.status,"data-presentation":c,children:l.label})})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("dt",{className:"text-slate-500",children:"\u8981\u6C42\u8005"}),(0,d.jsx)("dd",{className:"wrap-anywhere","data-testid":"run-requested-by",children:e.requestedBy})]}),(0,d.jsxs)("div",{className:"col-span-2",children:[(0,d.jsx)("dt",{className:"text-slate-500",children:"\u958B\u59CB"}),(0,d.jsx)("dd",{"data-testid":"run-started-at",children:(0,d.jsx)(ge,{iso:e.startedAt,testId:"run-started-at-value"})})]}),(0,d.jsxs)("div",{className:"col-span-2",children:[(0,d.jsx)("dt",{className:"text-slate-500",children:"\u7D42\u4E86"}),(0,d.jsx)("dd",{"data-testid":"run-finished-at",children:(0,d.jsx)(Xe,{iso:e.finishedAt,testId:"run-finished-at-value"})})]}),(0,d.jsxs)("div",{className:"col-span-2",children:[(0,d.jsx)("dt",{className:"text-slate-500",children:"\u30B8\u30E7\u30D6"}),(0,d.jsx)("dd",{children:(0,d.jsx)("code",{className:"wrap-anywhere font-mono","data-testid":"run-job-id",children:e.jobId})})]})]}),e.errorMessage!==null&&(0,d.jsx)("div",{className:"wrap-anywhere rounded-lg border border-red-200 border-solid bg-red-50 p-4 text-[13px] text-red-800","data-testid":"run-error",children:e.errorMessage}),(0,d.jsxs)("div",{children:[(0,d.jsx)("h4",{className:"font-bold text-[13px] text-slate-900",children:"\u6BB5\u306E\u30BF\u30A4\u30E0\u30E9\u30A4\u30F3"}),(0,d.jsx)("ol",{className:"mt-3 space-y-3","data-testid":"run-steps",children:gs(e).map(m=>{if(m.kind==="step"){let h=m.step,C=(0,d.jsxs)(d.Fragment,{children:[Oe.PIPELINE_STEPS[h.stepKey].label,h.targetMetadataId!==e.metadataId&&(0,d.jsxs)("span",{className:"ml-2 rounded-sm bg-slate-100 px-1.5 py-0.5 font-normal text-[11px] text-slate-600","data-testid":`run-step-target-${h.sequence}`,children:["\u5BFE\u8C61 #",h.targetMetadataId]})]});return ma(h,C,p,h.status==="FAILED"||b)}let y=m.steps.some(h=>h.status==="FAILED"),N=ps.map(h=>({status:h,count:m.steps.filter(C=>C.status===h).length})).filter(({count:h})=>h>0);return(0,d.jsx)("li",{className:"rounded-lg border border-slate-200 border-solid","data-testid":`run-step-group-${m.stepKey}`,"data-count":m.steps.length,children:(0,d.jsxs)("details",{open:y||b,className:"group/fanout","data-testid":`run-step-group-card-${m.stepKey}`,children:[(0,d.jsxs)("summary",{className:"flex cursor-pointer list-none flex-wrap items-center gap-2 p-4 [&::-webkit-details-marker]:hidden",children:[(0,d.jsx)("span",{"aria-hidden":"true",className:"text-[11px] text-slate-500 transition-transform group-open/fanout:rotate-90",children:"\u25B6"}),(0,d.jsx)("span",{className:"font-semibold text-[13px] text-slate-900",children:Oe.PIPELINE_STEPS[m.stepKey].label}),(0,d.jsxs)("span",{className:"rounded-sm bg-slate-100 px-1.5 py-0.5 text-[11px] text-slate-600","data-testid":`run-step-group-count-${m.stepKey}`,children:["\u5BFE\u8C61 ",m.steps.length," \u4EF6"]}),(0,d.jsx)("span",{className:"text-[11px] text-slate-600","data-testid":`run-step-group-statuses-${m.stepKey}`,children:N.map(({status:h,count:C})=>`${ot[h].label} ${C}`).join(" \xB7 ")})]}),(0,d.jsx)("ol",{className:"space-y-3 px-4 pb-4",children:m.steps.map(h=>ma(h,(0,d.jsxs)("span",{"data-testid":`run-step-target-${h.sequence}`,children:["\u5BFE\u8C61 #",h.targetMetadataId]}),p,h.status==="FAILED"||b))})]})},`group-${m.stepKey}`)})})]})]})}function vs({metadataId:e,runs:t,selectedRunId:o,onSelectRun:c,isLoading:l,failure:p,onClose:b,openRequest:m,returnFocusFallback:y}){let N=(0,ue.useId)(),h=(0,ue.useId)(),C=(0,ue.useId)(),E=(0,ue.useRef)(null),J=(0,ue.useRef)(null),ae=(0,ue.useRef)(null),K=(0,ue.useRef)(null),I=(0,ue.useRef)(null),Q=(0,ue.useRef)(null),R=(0,ue.useRef)(y);te(),(0,ue.useEffect)(()=>{R.current=y},[y]),(0,ue.useEffect)(()=>{if(I.current!==m){I.current=m,Q.current=null;let g=document.activeElement;E.current?.contains(g)!==!0&&(K.current=(g instanceof HTMLElement||g instanceof SVGElement)&&g!==document.body?g:null),J.current?.focus();return}o!==null&&o===Q.current&&(Q.current=null,ae.current?.focus())},[m,o]),(0,ue.useEffect)(()=>()=>{I.current=null;let g=K.current;if(g?.isConnected){g.focus();return}R.current()?.focus()},[]);let O=g=>{Q.current=g===o?null:g,c(g)},A=g=>{g.key==="Escape"&&(g.stopPropagation(),b())},L=o===null?void 0:t.find(g=>g.id===o),G=()=>t.length===0?(0,d.jsx)("p",{role:"status",className:"rounded-lg border border-slate-200 border-solid bg-slate-50 p-4 text-[13px] text-slate-700","data-testid":"run-inspector-no-runs",children:"\u3053\u306E\u6587\u66F8\u306B\u306F\u307E\u3060\u8A18\u9332\u3055\u308C\u305F\u5B9F\u884C\u304C\u3042\u308A\u307E\u305B\u3093\u3002"}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("section",{"aria-labelledby":h,"data-testid":"run-history",children:[(0,d.jsxs)("h3",{id:h,className:"font-bold text-base text-slate-900",children:["\u5B9F\u884C\u306E\u5C65\u6B74 (",t.length," \u4EF6\u3001\u65B0\u3057\u3044\u9806)"]}),(0,d.jsx)("ol",{className:"mt-3 space-y-1","data-testid":"run-history-list",children:t.map(g=>{let $=g.id===o,B=Le(g),D=De[B];return(0,d.jsx)("li",{children:(0,d.jsxs)("button",{type:"button",onClick:()=>O(g.id),"aria-current":$?"true":void 0,className:`flex w-full flex-wrap items-center gap-x-3 gap-y-1 rounded-lg border border-solid px-3 py-2 text-left text-[13px] ${$?"border-indigo-500 bg-indigo-50":"border-slate-200 bg-white hover:bg-slate-50"}`,"data-testid":`run-history-item-${g.id}`,"data-selected":$,children:[(0,d.jsxs)("span",{className:"font-mono font-semibold text-slate-900",children:["#",g.id]}),(0,d.jsx)("span",{className:"text-slate-700","data-testid":`run-history-trigger-${g.id}`,"data-trigger":g.trigger,children:rt[g.trigger]}),(0,d.jsxs)("span",{className:"text-slate-600","data-testid":`run-history-attempt-${g.id}`,children:["\u8A66\u884C ",g.attempt]}),(0,d.jsx)("span",{className:`inline-flex rounded-full px-2 py-0.5 font-semibold text-[11px] ${D.className}`,"data-testid":`run-history-status-${g.id}`,"data-status":g.status,"data-presentation":B,children:D.label}),(0,d.jsx)("span",{className:"ml-auto text-[11px] text-slate-600","data-testid":`run-history-started-at-${g.id}`,children:(0,d.jsx)(ge,{iso:g.startedAt,testId:`run-history-started-at-value-${g.id}`})})]})},g.id)})})]}),L!==void 0?ys(L,C,ae):o===null?(0,d.jsx)("p",{className:"text-[13px] text-slate-500","data-testid":"run-inspector-select-prompt",children:"\u4E00\u89A7\u304B\u3089\u5B9F\u884C\u3092\u9078\u3076\u3068\u3001\u305D\u306E\u5B9F\u884C\u306E\u6BB5\u306E\u30BF\u30A4\u30E0\u30E9\u30A4\u30F3\u3092\u793A\u3057\u307E\u3059\u3002"}):(0,d.jsxs)("p",{role:"status",className:"text-[13px] text-slate-600","data-testid":"run-inspector-selection-missing",children:["\u5B9F\u884C #",o," \u306F\u3053\u306E\u6587\u66F8\u306E\u5C65\u6B74\u306B\u3042\u308A\u307E\u305B\u3093\u3002\u4E00\u89A7\u304B\u3089\u5B9F\u884C\u3092\u9078\u3093\u3067\u304F\u3060\u3055\u3044\u3002"]})]});return(0,d.jsxs)("section",{ref:E,role:"dialog","aria-labelledby":N,onKeyDown:A,className:"space-y-6 rounded-xl border border-slate-200 border-solid bg-white p-6 shadow-sm","data-testid":"run-inspector","data-metadata-id":e,children:[(0,d.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,d.jsxs)("h2",{ref:J,id:N,tabIndex:-1,className:"font-bold text-base text-slate-900 focus:outline-none","data-testid":"run-inspector-heading",children:["\u6587\u66F8 #",e," \u306E\u51E6\u7406\u5C65\u6B74",L===void 0?"":` (\u5B9F\u884C #${L.id})`]}),(0,d.jsx)("button",{type:"button",onClick:b,className:"rounded-lg border border-slate-300 border-solid px-3 py-1.5 text-[13px] text-slate-700 hover:bg-slate-50","data-testid":"run-inspector-close",children:"\u9589\u3058\u308B"})]}),(0,d.jsxs)("dl",{className:"grid grid-cols-2 gap-3 text-[13px] sm:grid-cols-4","data-testid":"run-inspector-document",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("dt",{className:"text-slate-500",children:"\u6587\u66F8"}),(0,d.jsxs)("dd",{"data-testid":"run-document-id",children:["#",e]})]}),L!==void 0&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("dt",{className:"text-slate-500",children:"\u7248"}),(0,d.jsx)("dd",{"data-testid":"run-document-revision",children:L.revision})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("dt",{className:"text-slate-500",children:"\u7A2E\u985E"}),(0,d.jsx)("dd",{"data-testid":"run-document-kind","data-kind":L.documentKind,children:Oe.DOCUMENT_KIND_LABELS[L.documentKind]})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("dt",{className:"text-slate-500",children:"\u6D41\u308C"}),(0,d.jsx)("dd",{children:(0,d.jsx)("code",{className:"font-mono","data-testid":"run-document-flow",children:L.flowKey})})]})]})]}),p!==null?(0,d.jsx)("div",{role:"alert",className:"wrap-anywhere rounded-lg border border-red-200 border-solid bg-red-50 p-4 text-[13px] text-red-800","data-testid":"run-inspector-failure",children:p}):l?(0,d.jsx)("p",{"aria-busy":"true",className:"text-[13px] text-slate-500","data-testid":"run-inspector-loading",children:"\u51E6\u7406\u5C65\u6B74\u3092\u8AAD\u307F\u8FBC\u3093\u3067\u3044\u307E\u3059\u2026"}):G()]})}var mt=require("@aiquants/console-ui/core"),Na=require("react");var v=require("react/jsx-runtime");function hs(e,t){return e==null?null:Ae(e,"segment_count",t)}function xa(e,t,o){return e==null?null:st(e,t,o)}function Ns(e){let t=e.probe_failure;if(t===null)return null;if(!Je.test(t))throw new RangeError("overview.probe_failure must name why the collections could not be read (pass null when they were measured)");if(e.collections.length>0)throw new RangeError(`overview carries ${e.collections.length} collections and a probe_failure; pass the collections with probe_failure null, or an empty list with the reason`);return t}function ya(e,t,o){return e.reduce((c,l)=>c+Ae(l[t],`${t} of collection ${l.collection_name}`,o),0)}var Ss=(0,mt.cssVar)("space-1"),ws={padding:0,height:"1px",color:"#1e293b"},Es={display:"flex",height:"100%"},ks={fontWeight:500,marginBlock:"auto",overflowWrap:"normal"},Rs={display:"flex",alignItems:"baseline",gap:"12px",marginBottom:"12px"},Is={display:"flex",flexWrap:"wrap",alignItems:"baseline",columnGap:"10px",rowGap:"4px",flex:"1 1 0%",minWidth:0},Kt={whiteSpace:"nowrap"},va=(0,mt.cssVar)("space-3"),_s=(0,mt.cssVar)("info-tint"),Bt={fontSize:"11px",padding:"2px 6px",borderRadius:"4px",whiteSpace:"nowrap"};function ha(e,t){return`vectors_config.${e}.size of collection ${t}`}function Cs({overview:e,health:t,resources:o,onRefresh:c,isRefreshing:l=!1,selection:p}){let{formatLocale:b}=te(),m=(0,Na.useId)(),{collections:y}=e,N=Ns(e),h=N===null,C=h?ya(y,"points_count",b):null,E=h?ya(y,"vectors_count",b):null,J=xa(o?.ram_bytes,"ram_bytes",b),ae=xa(o?.disk_bytes,"disk_bytes",b),K=hs(o?.segment_count,b);return(0,v.jsxs)("div",{"data-testid":"qdrant-storage-card",style:{border:"1px solid #e2e8f0",borderRadius:"8px",padding:"16px",backgroundColor:"#ffffff"},children:[(0,v.jsxs)("div",{"data-testid":"qdrant-card-header",style:Rs,children:[(0,v.jsxs)("div",{"data-testid":"qdrant-card-title-group",style:Is,children:[(0,v.jsx)("h2",{style:{margin:0,fontSize:"16px",fontWeight:700,color:"#1e293b"},children:"Qdrant \u30D9\u30AF\u30C8\u30EB\u30B9\u30C8\u30EC\u30FC\u30B8\u76E3\u8996"}),t!==void 0&&(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)("span",{"data-testid":"qdrant-health-badge","data-healthy":String(t.healthy),...He[t.healthy?"connected":"error"],style:{...Kt,fontSize:"12px",padding:"2px 8px",borderRadius:"12px",fontWeight:600},children:Ge[t.healthy?"connected":"error"]}),(0,v.jsxs)("span",{"data-testid":"qdrant-latency",style:{...Kt,fontSize:"12px",color:"#64748b"},children:["\u5FDC\u7B54\u6642\u9593: ",(0,v.jsx)(q,{value:t.latency_ms,unit:"ms",testId:"qdrant-latency-value"})]})]})]}),c&&(0,v.jsx)("button",{type:"button","data-testid":"qdrant-refresh-button",disabled:l,onClick:c,style:{...Kt,flexShrink:0,padding:"6px 12px",borderRadius:"4px",border:"1px solid #cbd5e1",backgroundColor:"#ffffff",cursor:l?"not-allowed":"pointer",fontSize:"13px"},children:l?"\u66F4\u65B0\u4E2D\u2026":"\u66F4\u65B0"})]}),(0,v.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(140px, 1fr))",gap:"10px",marginBottom:"16px",padding:"10px",backgroundColor:"#f8fafc",borderRadius:"6px"},children:[(0,v.jsxs)("div",{children:[(0,v.jsx)("div",{style:{fontSize:"12px",color:"#64748b"},children:"\u7DCF\u30DD\u30A4\u30F3\u30C8\u6570"}),(0,v.jsx)("div",{"data-testid":"qdrant-total-points",style:{fontSize:"18px",fontWeight:700,color:"#0f172a"},children:(0,v.jsx)(q,{value:C,testId:"qdrant-total-points-value"})})]}),(0,v.jsxs)("div",{children:[(0,v.jsx)("div",{style:{fontSize:"12px",color:"#64748b"},children:"\u7DCF\u30D9\u30AF\u30C8\u30EB\u6570"}),(0,v.jsx)("div",{"data-testid":"qdrant-total-vectors",style:{fontSize:"18px",fontWeight:700,color:"#0f172a"},children:(0,v.jsx)(q,{value:E,testId:"qdrant-total-vectors-value"})})]}),(0,v.jsxs)("div",{children:[(0,v.jsx)("div",{style:{fontSize:"12px",color:"#64748b"},children:"\u30E1\u30E2\u30EA\u6D88\u8CBB (RAM)"}),(0,v.jsx)("div",{"data-testid":"qdrant-ram-usage",style:{fontSize:"18px",fontWeight:700,color:"#0f172a"},children:(0,v.jsx)(Se,{text:J,testId:"qdrant-ram-usage-value"})})]}),(0,v.jsxs)("div",{children:[(0,v.jsx)("div",{style:{fontSize:"12px",color:"#64748b"},children:"\u30C7\u30A3\u30B9\u30AF\u6D88\u8CBB"}),(0,v.jsx)("div",{"data-testid":"qdrant-disk-usage",style:{fontSize:"18px",fontWeight:700,color:"#0f172a"},children:(0,v.jsx)(Se,{text:ae,testId:"qdrant-disk-usage-value"})})]}),(0,v.jsxs)("div",{children:[(0,v.jsx)("div",{style:{fontSize:"12px",color:"#64748b"},children:"\u30BB\u30B0\u30E1\u30F3\u30C8\u7DCF\u6570"}),(0,v.jsx)("div",{"data-testid":"qdrant-segment-count",style:{fontSize:"18px",fontWeight:700,color:"#0f172a"},children:(0,v.jsx)(q,{value:K,testId:"qdrant-segment-count-value"})})]})]}),(0,v.jsxs)("div",{children:[(0,v.jsxs)("h3",{id:m,style:{margin:"0 0 8px 0",fontSize:"14px",color:"#334155"},children:["\u30B3\u30EC\u30AF\u30B7\u30E7\u30F3\u4E00\u89A7 (",(0,v.jsx)(q,{value:h?y.length:null,unit:"\u4EF6",testId:"qdrant-collections-count"}),")"]}),N!==null?(0,v.jsx)("p",{"data-testid":"qdrant-probe-failure",style:{margin:0,fontSize:"13px",color:"#92400e",backgroundColor:"#fffbeb",border:"1px solid #f59e0b",borderRadius:"6px",padding:"8px"},children:N}):y.length===0?(0,v.jsx)("p",{"data-testid":"no-collections-message",style:{margin:0,fontSize:"13px",color:"#64748b"},children:"\u767B\u9332\u3055\u308C\u3066\u3044\u308B\u30B3\u30EC\u30AF\u30B7\u30E7\u30F3\u306F\u3042\u308A\u307E\u305B\u3093\u3002"}):(0,v.jsx)("section",{tabIndex:0,"aria-labelledby":m,"data-testid":"qdrant-collections-scroll",style:{overflowX:"auto",WebkitOverflowScrolling:"touch",padding:Ss},children:(0,v.jsxs)("table",{"aria-labelledby":m,"data-testid":"qdrant-collections-list",style:{width:"100%",borderCollapse:"collapse",fontSize:"13px"},children:[(0,v.jsx)("thead",{children:(0,v.jsxs)("tr",{style:{borderBottom:"1px solid #e2e8f0",color:"#64748b"},children:[(0,v.jsx)("th",{scope:"col","data-testid":"qdrant-collections-name-header",style:{padding:`6px ${va}`,textAlign:"start"},children:"\u30B3\u30EC\u30AF\u30B7\u30E7\u30F3\u540D"}),(0,v.jsx)("th",{scope:"col",style:{padding:"6px 8px",textAlign:"start"},children:"\u30C9\u30E1\u30A4\u30F3"}),(0,v.jsx)("th",{scope:"col","data-testid":"qdrant-collections-points-header",style:{padding:"6px 8px",textAlign:"end"},children:"\u30DD\u30A4\u30F3\u30C8\u6570"}),(0,v.jsx)("th",{scope:"col",style:{padding:"6px 8px",textAlign:"start"},children:"\u30D9\u30AF\u30C8\u30EB\u69CB\u6210"})]})}),(0,v.jsx)("tbody",{children:y.map(I=>{let Q=p!==void 0&&I.collection_name===p.selectedCollectionName,R=(0,v.jsx)("span",{style:ks,children:I.collection_name}),{dense:O,sparse:A,image:L}=I.vectors_config,G=O===void 0?null:Ae(O.size,ha("dense",I.collection_name),b),g=L===void 0?null:Ae(L.size,ha("image",I.collection_name),b);return(0,v.jsxs)("tr",{"data-testid":`collection-row-${I.collection_name}`,"data-collection-name":I.collection_name,"data-selected":String(Q),style:{borderBottom:"1px solid #f1f5f9",backgroundColor:Q?_s:"transparent"},children:[p===void 0?(0,v.jsx)("td",{style:{padding:`8px ${va}`,color:"#1e293b"},children:R}):(0,v.jsx)("td",{style:ws,children:(0,v.jsx)("div",{style:Es,children:(0,v.jsx)(zt,{selected:Q,controls:p.detailId,onSelect:()=>p.onSelectCollection(I.collection_name),testId:`collection-select-${I.collection_name}`,children:R})})}),(0,v.jsx)("td",{style:{padding:"8px",color:"#475569"},children:I.domain_key}),(0,v.jsx)("td",{"data-testid":`collection-points-${I.collection_name}`,style:{padding:"8px",color:"#0f172a",textAlign:"end"},children:(0,v.jsx)(q,{value:I.points_count,testId:`collection-points-value-${I.collection_name}`})}),(0,v.jsx)("td",{style:{padding:"8px"},children:(0,v.jsxs)("div",{style:{display:"flex",gap:"6px",flexWrap:"wrap"},children:[G!==null&&(0,v.jsxs)("span",{"data-testid":`vector-tag-dense-${I.collection_name}`,style:{...Bt,backgroundColor:"#e0e7ff",color:"#3730a3"},children:["Dense: ",(0,v.jsx)(q,{value:G,unit:"\u6B21\u5143",testId:`vector-tag-dense-size-${I.collection_name}`})]}),A!==void 0&&(0,v.jsx)("span",{"data-testid":`vector-tag-sparse-${I.collection_name}`,style:{...Bt,backgroundColor:"#fef3c7",color:"#92400e"},children:A.modifier?`Sparse (${A.modifier.toUpperCase()})`:"Sparse"}),g!==null&&(0,v.jsxs)("span",{"data-testid":`vector-tag-image-${I.collection_name}`,style:{...Bt,backgroundColor:"#f3e8ff",color:"#6b21a8"},children:["Image: ",(0,v.jsx)(q,{value:g,unit:"\u6B21\u5143",testId:`vector-tag-image-size-${I.collection_name}`})]})]})})]},I.collection_name)})})]})})]})]})}var w=require("react/jsx-runtime"),Ps="\u5BFE\u8C61\u306A\u3057";function Ls({counts:e,totalFiles:t,failedItems:o=[],onRetryAll:c,onRetryItem:l,isRetrying:p=!1,onRefresh:b}){te();let m=e.SYNCED??0,y=e.PENDING??0,N=(e.EXTRACTING??0)+(e.ENRICHING??0)+(e.PROJECTING??0),h=(e.FAILED_EXTRACT??0)+(e.FAILED_ENRICH??0)+(e.FAILED_VECTOR??0)+(e.FAILED_GRAPH??0),C=t>0?`${(m/t*100).toFixed(1)}%`:Ps;return(0,w.jsxs)("div",{"data-testid":"sync-status-monitor",style:{border:"1px solid #e2e8f0",borderRadius:"8px",padding:"16px",backgroundColor:"#ffffff"},children:[(0,w.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"16px"},children:[(0,w.jsxs)("div",{children:[(0,w.jsx)("h2",{style:{margin:0,fontSize:"16px",fontWeight:700,color:"#1e293b"},children:"\u30A8\u30F3\u30EA\u30C3\u30C1\u30E1\u30F3\u30C8\u540C\u671F\u30B9\u30C6\u30FC\u30BF\u30B9"}),(0,w.jsxs)("p",{style:{margin:"4px 0 0 0",fontSize:"13px",color:"#64748b"},children:["\u7DCF\u30D5\u30A1\u30A4\u30EB\u6570:"," ",(0,w.jsx)("span",{"data-testid":"total-files-count",style:{fontWeight:600},children:t})," ","\u4EF6 (\u540C\u671F\u5B8C\u4E86\u7387: ",(0,w.jsx)("span",{"data-testid":"success-rate-value",children:C}),")"]})]}),(0,w.jsxs)("div",{style:{display:"flex",gap:"8px"},children:[b&&(0,w.jsx)("button",{type:"button","data-testid":"sync-refresh-button",onClick:b,style:{padding:"6px 12px",borderRadius:"4px",border:"1px solid #cbd5e1",backgroundColor:"#ffffff",cursor:"pointer",fontSize:"13px"},children:"\u66F4\u65B0"}),c&&(0,w.jsx)("button",{type:"button","data-testid":"retry-all-button",disabled:p||h===0,onClick:c,style:{padding:"6px 14px",borderRadius:"4px",border:"none",backgroundColor:p||h===0?"#94a3b8":"#dc2626",color:"#ffffff",cursor:p||h===0?"not-allowed":"pointer",fontSize:"13px",fontWeight:500},children:p?"\u518D\u8A66\u884C\u4E2D...":"\u5931\u6557\u30B8\u30E7\u30D6\u4E00\u62EC\u518D\u8A66\u884C"})]})]}),(0,w.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(130px, 1fr))",gap:"10px",marginBottom:"20px"},children:[(0,w.jsxs)("div",{"data-testid":"status-card-synced","data-count":m,style:{border:"1px solid #10b981",borderRadius:"6px",padding:"10px",backgroundColor:"#ecfdf5"},children:[(0,w.jsx)("div",{style:{fontSize:"12px",color:"#065f46"},children:"\u5B8C\u5168\u540C\u671F (SYNCED)"}),(0,w.jsx)("div",{"data-testid":"synced-count",style:{fontSize:"20px",fontWeight:700,color:"#047857"},children:m})]}),(0,w.jsxs)("div",{"data-testid":"status-card-processing","data-count":N,style:{border:"1px solid #3b82f6",borderRadius:"6px",padding:"10px",backgroundColor:"#eff6ff"},children:[(0,w.jsx)("div",{style:{fontSize:"12px",color:"#1e40af"},children:"\u51E6\u7406\u4E2D (PROCESSING)"}),(0,w.jsx)("div",{"data-testid":"processing-count",style:{fontSize:"20px",fontWeight:700,color:"#1d4ed8"},children:N})]}),(0,w.jsxs)("div",{"data-testid":"status-card-pending","data-count":y,style:{border:"1px solid #64748b",borderRadius:"6px",padding:"10px",backgroundColor:"#f8fafc"},children:[(0,w.jsx)("div",{style:{fontSize:"12px",color:"#334155"},children:"\u5F85\u6A5F\u4E2D (PENDING)"}),(0,w.jsx)("div",{"data-testid":"pending-count",style:{fontSize:"20px",fontWeight:700,color:"#475569"},children:y})]}),(0,w.jsxs)("div",{"data-testid":"status-card-failed","data-count":h,style:{border:"1px solid #ef4444",borderRadius:"6px",padding:"10px",backgroundColor:"#fef2f2"},children:[(0,w.jsx)("div",{style:{fontSize:"12px",color:"#991b1b"},children:"\u5931\u6557 (FAILED)"}),(0,w.jsx)("div",{"data-testid":"failed-count",style:{fontSize:"20px",fontWeight:700,color:"#b91c1c"},children:h})]})]}),(0,w.jsxs)("div",{"data-testid":"failed-items-section",children:[(0,w.jsxs)("h3",{style:{margin:"0 0 8px 0",fontSize:"14px",color:"#334155"},"data-testid":"failed-items-heading",children:["\u540C\u671F\u5931\u6557\u30A2\u30A4\u30C6\u30E0\u4E00\u89A7 (",o.length<h?`\u4E0A\u4F4D ${o.length} \u4EF6 / \u5168 ${h} \u4EF6`:`${o.length} \u4EF6`,")"]}),o.length===0?(0,w.jsx)("p",{"data-testid":"no-failed-items-message",style:{margin:0,fontSize:"13px",color:"#64748b"},children:"\u73FE\u5728\u3001\u540C\u671F\u5931\u6557\u30A2\u30A4\u30C6\u30E0\u306F\u3042\u308A\u307E\u305B\u3093\u3002"}):(0,w.jsx)("div",{style:{overflowX:"auto"},children:(0,w.jsxs)("table",{"data-testid":"failed-items-table",style:{width:"100%",borderCollapse:"collapse",fontSize:"13px"},children:[(0,w.jsx)("thead",{children:(0,w.jsxs)("tr",{style:{borderBottom:"1px solid #e2e8f0",textAlign:"left",color:"#64748b"},children:[(0,w.jsx)("th",{style:{padding:"6px 8px"},children:"\u30D5\u30A1\u30A4\u30EB URI"}),(0,w.jsx)("th",{style:{padding:"6px 8px"},children:"\u72B6\u614B"}),(0,w.jsx)("th",{style:{padding:"6px 8px"},children:"\u30A8\u30E9\u30FC\u5185\u5BB9"}),(0,w.jsx)("th",{style:{padding:"6px 8px"},children:"\u5931\u6557\u65E5\u6642"}),(0,w.jsx)("th",{style:{padding:"6px 8px",textAlign:"right"},children:"\u64CD\u4F5C"})]})}),(0,w.jsx)("tbody",{children:o.map(E=>(0,w.jsxs)("tr",{"data-testid":`failed-item-row-${E.id}`,"data-file-uri":E.file_uri,style:{borderBottom:"1px solid #f1f5f9"},children:[(0,w.jsxs)("td",{"data-testid":`failed-item-uri-${E.id}`,style:{padding:"8px",wordBreak:"break-all"},children:[(0,w.jsx)("div",{style:{fontWeight:600,color:"#0f172a"},children:E.file_name}),(0,w.jsx)("div",{style:{fontSize:"11px",color:"#64748b"},children:E.file_uri})]}),(0,w.jsx)("td",{style:{padding:"8px"},children:(0,w.jsx)("span",{"data-testid":`failed-item-status-${E.id}`,style:{fontSize:"11px",padding:"2px 6px",borderRadius:"4px",backgroundColor:"#fee2e2",color:"#991b1b",fontWeight:500},children:E.sync_status})}),(0,w.jsx)("td",{"data-testid":`failed-item-error-${E.id}`,style:{padding:"8px",color:"#dc2626",maxWidth:"260px",wordBreak:"break-word"},title:E.error_message??"",children:E.error_message??"\u4E0D\u660E\u306A\u30A8\u30E9\u30FC"}),(0,w.jsx)("td",{"data-testid":`failed-item-time-${E.id}`,style:{padding:"8px",color:"#64748b",whiteSpace:"nowrap"},children:E.failed_at===null?"\u8A18\u9332\u306A\u3057":(0,w.jsx)(ge,{iso:E.failed_at,testId:`failed-item-time-value-${E.id}`})}),(0,w.jsx)("td",{style:{padding:"8px",textAlign:"right"},children:l&&(0,w.jsx)("button",{type:"button","data-testid":`retry-item-button-${E.id}`,"aria-label":`${E.file_name} (${E.file_uri}) \u3092\u518D\u8A66\u884C`,disabled:p,onClick:()=>l(E.id,E.file_uri),style:{padding:"4px 8px",borderRadius:"4px",border:"1px solid #dc2626",backgroundColor:"#ffffff",color:"#dc2626",cursor:p?"not-allowed":"pointer",fontSize:"12px"},children:"\u518D\u8A66\u884C"})})]},E.id))})]})})]})]})}0&&(module.exports={CHUNK_SOURCE_LABELS,DegradedSearchBanner,DocumentIngestConsole,EnrichmentStrategyBoard,FLOW_FOCUS_RING,FLOW_GEOMETRY,FLOW_NODE_TEXT,FinishedInstant,GATE_POLICY_LABELS,GATE_STATE_PRESENTATION,InfrastructureHealthMonitor,MetadataSearchWorkbench,ModelComparisonWorkbench,NOTHING_TO_READ_LABELS,OntologyStatusCard,PHASE_LABELS,PIPELINE_RUN_STATUS_PRESENTATION,PIPELINE_STEP_STATUS_PRESENTATION,PIPELINE_TRIGGER_LABELS,PipelineFlowViewer,PipelineRunInspector,QdrantStorageCard,REASON_LABELS,RecordedInstant,SCORE_DISPLAY_DECIMALS,SEARCH_MODE_LABELS,SEARCH_PRESETS,STEP_CARDS_OPEN_LIMIT,SyncStatusMonitor,UNFINISHED_LABEL,formatComparisonScore,gateCaption,gateState,gateStateOf,ingestRowAction,layoutFlow,pipelineRunPresentationKey,rankAgreement,skipReasonLabel,stepGatePolicy,stepGateState});
|
|
1
|
+
"use strict";var $n=Object.defineProperty;var zr=Object.getOwnPropertyDescriptor;var Wr=Object.getOwnPropertyNames;var Yr=Object.prototype.hasOwnProperty;var Xr=(e,t)=>{for(var n in t)$n(e,n,{get:t[n],enumerable:!0})},jr=(e,t,n,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Wr(t))!Yr.call(e,o)&&o!==n&&$n(e,o,{get:()=>t[o],enumerable:!(a=zr(t,o))||a.enumerable});return e};var Jr=e=>jr($n({},"__esModule",{value:!0}),e);var Do={};Xr(Do,{BREAKER_STATE_LABELS:()=>Pt,CHUNKING_ONLY_NOTE:()=>zn,CHUNK_BODY_FIDELITY_LABELS:()=>Vn,CHUNK_CHANGE_KIND_LABELS:()=>fn,CHUNK_SOURCE_LABELS:()=>Fr,CONFIDENTIALITY_LEVEL_LABELS:()=>Lr,DEGRADATION_REASON_LABELS:()=>Dn,DOCUMENT_STATE_CAUSE_LABELS:()=>Et,DegradedSearchBanner:()=>Hn,DocumentChangeFeed:()=>is,DocumentHistoryInspector:()=>Ks,DocumentIngestConsole:()=>Ws,EnrichmentStrategyBoard:()=>Ys,FACET_LABELS:()=>ut,FAILED_RUN_STATE_MARK:()=>Xn,FIELD_LABELS:()=>qt,FLOW_FOCUS_RING:()=>bt,FLOW_GEOMETRY:()=>Mr,FLOW_NODE_TEXT:()=>kt,FinishedInstant:()=>Ct,GATE_POLICY_LABELS:()=>Ia,GATE_STATE_PRESENTATION:()=>_a,HIDDEN_FIELD_TEXT:()=>xt,HISTORY_REFUSAL:()=>st,INERT_STAGE_NOTE:()=>_r,InfrastructureHealthMonitor:()=>Qs,MODEL_ONLY_CHANGE_MARK:()=>jn,MetadataSearchWorkbench:()=>lo,ModelComparisonWorkbench:()=>uo,NOTHING_TO_READ_LABELS:()=>Ya,NO_ENRICHMENT_RECORD_TEXT:()=>Nr,NO_PREVIOUS_RECORD_TEXT:()=>Yn,OntologyStatusCard:()=>mo,PHASE_LABELS:()=>Na,PIPELINE_RUN_STATUS_PRESENTATION:()=>et,PIPELINE_STEP_STATUS_PRESENTATION:()=>xn,PIPELINE_TRIGGER_LABELS:()=>hn,PipelineFlowViewer:()=>So,QUALITY_TIER_LABELS:()=>wt,QdrantStorageCard:()=>Po,RESTRICTED_DOCUMENT_TEXT:()=>Rt,RESTRICTED_RUN_TEXT:()=>zt,RESTRICTED_STATE_TEXT:()=>Wn,RUN_TERMINAL_STEP_LABEL:()=>Wa,RUN_TERMINAL_STEP_OUTCOME_LABELS:()=>na,RecordedInstant:()=>ge,SCORE_DECIMALS:()=>ht,SCORE_DISPLAY_DECIMALS:()=>Dr,SEARCH_FUSION_LABELS:()=>An,SEARCH_MODE_LABELS:()=>rt,SEARCH_PRESETS:()=>Pr,SyncStatusMonitor:()=>$o,UNFINISHED_LABEL:()=>aa,UNRECORDED_RUN_MARK:()=>yn,UNVERIFIED_CHUNK_NOTE:()=>qn,WHITESPACE_NORMALIZED_NOTE:()=>Gn,degradationReasonText:()=>Ht,documentKindLabel:()=>ta,facetCountsText:()=>Wt,fieldLabel:()=>At,gateCaption:()=>Kr,gateState:()=>Ca,gateStateOf:()=>xa,historyFailedSentence:()=>ot,historyFailureSentence:()=>Yt,ingestRowAction:()=>Er,jsonValueText:()=>pt,layoutFlow:()=>Sa,ledgerStepLabel:()=>Ot,pipelineRunPresentationKey:()=>it,rankAgreement:()=>On,revisionLabel:()=>We,revisionTransitionText:()=>gn,skipReasonLabel:()=>ra,stepGatePolicy:()=>Ea,stepGateState:()=>Ur,unrecordedRunsMark:()=>Jn,variantHitKey:()=>sn,vectorScoreText:()=>Mn});module.exports=Jr(Do);var xt="\u975E\u8868\u793A (\u5217\u306E\u30B9\u30B3\u30FC\u30D7)",rt={KEYWORD:{label:"\u30AD\u30FC\u30EF\u30FC\u30C9",description:"SQL Server \u306E\u8A9E\u53E5\u306E\u4E00\u81F4\u3060\u3051\u3067\u63A2\u3057\u307E\u3059\u3002\u30D9\u30AF\u30C8\u30EB\u3082\u30B0\u30E9\u30D5\u3082\u547C\u3070\u306A\u3044\u7D4C\u8DEF\u3067\u3059\u3002"},SPARSE:{label:"\u758E\u30D9\u30AF\u30C8\u30EB",description:"BM25 \u306E\u8A9E\u5F59\u306E\u30D9\u30AF\u30C8\u30EB\u3067\u63A2\u3057\u307E\u3059\u3002\u56FA\u6709\u540D\u8A5E\u3084\u578B\u756A\u306E\u4E00\u81F4\u306B\u5F37\u3044\u7D4C\u8DEF\u3067\u3059\u3002"},DENSE:{label:"\u5BC6\u30D9\u30AF\u30C8\u30EB",description:"\u57CB\u3081\u8FBC\u307F\u306E\u610F\u5473\u306E\u30D9\u30AF\u30C8\u30EB\u3067\u63A2\u3057\u307E\u3059\u3002\u8A00\u3044\u63DB\u3048\u3084\u6587\u610F\u306E\u8FD1\u3055\u3092\u62FE\u3046\u7D4C\u8DEF\u3067\u3059\u3002"},HYBRID:{label:"\u30CF\u30A4\u30D6\u30EA\u30C3\u30C9",description:"\u758E\u30FB\u5BC6\u30FB\u30B0\u30E9\u30D5\u30FB\u8A9E\u53E5\u306E\u4E00\u81F4\u306E\u9806\u4F4D\u3092\u878D\u5408\u3057\u307E\u3059\u3002\u65E2\u5B9A\u306E\u7D4C\u8DEF\u3067\u3059\u3002"},GRAPH_TRAVERSE:{label:"\u30CA\u30EC\u30C3\u30B8\u30B0\u30E9\u30D5",description:"\u30CA\u30EC\u30C3\u30B8\u30B0\u30E9\u30D5\u306E\u95A2\u4FC2\u3092\u305F\u3069\u3063\u3066\u63A2\u3057\u307E\u3059\u3002\u6587\u66F8\u306E\u9593\u306E\u3064\u306A\u304C\u308A\u3092\u4E3B\u306B\u3059\u308B\u7D4C\u8DEF\u3067\u3059\u3002"}},An={rrf:"RRF (\u9806\u4F4D\u306E\u9006\u6570\u306E\u548C)",linear:"\u7DDA\u5F62 (\u03B1 \u3067\u91CD\u307F\u4ED8\u3051)"},wt={FULL:"\u5B8C\u5168",DEGRADED_LEXICAL_ONLY:"\u7E2E\u9000 (\u30D9\u30AF\u30C8\u30EB\u3082\u30B0\u30E9\u30D5\u3082\u8D70\u3089\u305A)",DEGRADED_PARTIAL:"\u7E2E\u9000 (\u4E00\u90E8\u306E\u5C64\u3060\u3051)"},Pt={CLOSED:"\u9589 (\u901A\u5E38)",OPEN:"\u958B (\u906E\u65AD\u4E2D)",HALF_OPEN:"\u534A\u958B (\u8A66\u3057\u306E 1 \u56DE)"},Dn={vector_search_disabled:"\u30D9\u30AF\u30C8\u30EB\u691C\u7D22\u304C\u7BA1\u7406\u8005\u306B\u3088\u308A\u7121\u52B9\u306B\u3055\u308C\u3066\u3044\u307E\u3059\u3002",graph_search_disabled:"\u30B0\u30E9\u30D5\u691C\u7D22\u304C\u7BA1\u7406\u8005\u306B\u3088\u308A\u7121\u52B9\u306B\u3055\u308C\u3066\u3044\u307E\u3059\u3002","circuit_breaker_open:vector":"\u30D9\u30AF\u30C8\u30EB\u691C\u7D22\u306F\u5931\u6557\u304C\u7D9A\u3044\u305F\u305F\u3081\u4E00\u6642\u7684\u306B\u906E\u65AD\u3055\u308C\u3066\u3044\u307E\u3059\u3002","circuit_breaker_open:graph":"\u30B0\u30E9\u30D5\u691C\u7D22\u306F\u5931\u6557\u304C\u7D9A\u3044\u305F\u305F\u3081\u4E00\u6642\u7684\u306B\u906E\u65AD\u3055\u308C\u3066\u3044\u307E\u3059\u3002",vector_tier_not_configured:"\u30D9\u30AF\u30C8\u30EB\u691C\u7D22\u306F\u3053\u306E\u914D\u5099\u3067\u69CB\u6210\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002",graph_tier_not_configured:"\u30B0\u30E9\u30D5\u691C\u7D22\u306F\u3053\u306E\u914D\u5099\u3067\u69CB\u6210\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002",no_active_vector_collection:"\u6709\u52B9\u306A\u7D22\u5F15\u306E\u6226\u7565\u304C 1 \u3064\u3082\u7121\u3044\u305F\u3081\u3001\u30D9\u30AF\u30C8\u30EB\u691C\u7D22\u306F\u5B9F\u884C\u3057\u3066\u3044\u307E\u305B\u3093\u3002",vector_collections_missing:"\u30D9\u30AF\u30C8\u30EB\u306E\u30B3\u30EC\u30AF\u30B7\u30E7\u30F3\u304C\u307E\u3060\u7121\u3044\u305F\u3081\u3001\u30D9\u30AF\u30C8\u30EB\u691C\u7D22\u306F\u5B9F\u884C\u3057\u3066\u3044\u307E\u305B\u3093\u3002\u6587\u66F8\u306E\u6295\u5F71\u304C\u7D42\u308F\u308B\u3068\u89E3\u6D88\u3057\u307E\u3059\u3002",row_scope_permits_no_rows:"\u8AAD\u3081\u308B\u6587\u66F8\u304C 1 \u3064\u3082\u7121\u3044\u6A29\u9650\u306E\u305F\u3081\u3001\u30D9\u30AF\u30C8\u30EB\u3068\u30B0\u30E9\u30D5\u306E\u691C\u7D22\u306F\u5B9F\u884C\u3057\u3066\u3044\u307E\u305B\u3093\u3002",vector_tier_unavailable:"\u30D9\u30AF\u30C8\u30EB\u691C\u7D22\u306E\u57FA\u76E4\u306B\u5C4A\u304B\u306A\u3044\u304B\u3001\u57FA\u76E4\u304C\u5931\u6557\u3057\u307E\u3057\u305F\u3002",graph_tier_unavailable:"\u30B0\u30E9\u30D5\u691C\u7D22\u306E\u57FA\u76E4\u306B\u5C4A\u304B\u306A\u3044\u304B\u3001\u57FA\u76E4\u304C\u5931\u6557\u3057\u307E\u3057\u305F\u3002",vector_tier_timed_out:"\u30D9\u30AF\u30C8\u30EB\u691C\u7D22\u304C\u671F\u9650\u307E\u3067\u306B\u7B54\u3048\u307E\u305B\u3093\u3067\u3057\u305F\u3002",graph_tier_timed_out:"\u30B0\u30E9\u30D5\u691C\u7D22\u304C\u671F\u9650\u307E\u3067\u306B\u7B54\u3048\u307E\u305B\u3093\u3067\u3057\u305F\u3002",tiers_not_executed:"\u30D9\u30AF\u30C8\u30EB\u3068\u30B0\u30E9\u30D5\u306E\u691C\u7D22\u304C\u5B9F\u884C\u3055\u308C\u307E\u305B\u3093\u3067\u3057\u305F (\u7406\u7531\u306F\u5831\u544A\u3055\u308C\u3066\u3044\u307E\u305B\u3093)\u3002"};function Ht(e){return Object.hasOwn(Dn,e)?Dn[e]:e}var ht=3;function Mn(e){return e.kind==="cosine"?`${(e.value*100).toFixed(1)}% (\u30B3\u30B5\u30A4\u30F3)`:`${e.value.toFixed(ht)} (${e.kind==="bm25"?"BM25":"\u5BC6\u3068\u758E\u306E\u6DF7\u3056\u3063\u305F\u5024"})`}function On(e,t){let n=l=>{let i=new Map;return l.forEach((x,O)=>{i.has(x)||i.set(x,O+1)}),i},a=n(e),o=n(t),r=[...a.keys()].filter(l=>o.has(l)),u=new Set([...a.keys(),...o.keys()]).size;return{sharedCount:r.length,overlapRatio:u===0?null:r.length/u,meanAbsoluteRankDifference:r.length===0?null:r.reduce((l,i)=>l+Math.abs(a.get(i)-o.get(i)),0)/r.length}}function sn(e){return`${e.metadata_id}:${e.chunk_index}`}var $=require("@aiquants/console-ui"),ce=require("react");var Vt="ja-JP";function T(){let e=(0,$.useConsoleUi)();if(e.locale!=="ja"||e.formatLocale!==Vt)throw new RangeError(`The ConsoleUiRoot must be locale "${"ja"}" and formatLocale "${Vt}", the language and format of this package's text (got locale "${e.locale}" and formatLocale "${e.formatLocale}")`);return e}function j(e){return T(),(0,ce.createElement)($.Measured,e)}function $a(e){return T(),(0,ce.createElement)($.RowButton,e)}function on(e){return T(),(0,ce.createElement)($.MasterDetail,e)}function dn(e){return T(),(0,ce.createElement)($.ComparisonGrid,e)}function Ge(e){return T(),(0,ce.createElement)($.Pill,e)}function dt(e){return T(),(0,ce.createElement)($.Card,e)}function Ne(e){return T(),(0,ce.createElement)($.Button,e)}function qe(e){return T(),(0,ce.createElement)($.Notice,e)}function ze(e){return T(),(0,ce.createElement)($.AlertMessage,e)}function vt(e){return T(),(0,ce.createElement)($.ResourceFailed,e)}function ln(e){return T(),(0,ce.createElement)($.LoadMore,e)}function Da(e){return T(),(0,ce.createElement)($.VisuallyHidden,e)}function Lt(e){return T(),(0,ce.createElement)($.DataTable,e)}function cn(e){return T(),(0,ce.createElement)($.SelectableList,e)}function Fn(e,t,n){return T(),(0,$.useResource)(e,t,n)}function un(e,t,n){return T(),(0,$.usePagedResource)(e,t,n)}function Ze(e){return T(),(0,$.useFocusRescue)(e)}function Un(e){return T(),(0,ce.createElement)($.CardSection,e)}function Kn(e){return T(),(0,ce.createElement)($.CodeBlock,e)}function $t(e){return T(),(0,ce.createElement)($.DescriptionList,e)}function pn(e){return T(),(0,ce.createElement)($.Disclosure,e)}function Bn(e){return T(),(0,ce.createElement)($.Meter,e)}function mn(e){return T(),(0,ce.createElement)($.SegmentedControl,e)}function Gt(e){return T(),(0,ce.createElement)($.Select,e)}function St(e){return T(),(0,ce.createElement)($.Slider,e)}function Te(e){return T(),(0,ce.createElement)($.Stack,e)}function lt(e){return T(),(0,ce.createElement)($.Cluster,e)}function G(e){return T(),(0,ce.createElement)($.Text,e)}function Nt(e){return T(),(0,ce.createElement)($.TextInput,e)}function Dt(){return T(),(0,$.useAnnounce)()}var ct=require("react/jsx-runtime");function Hn({metadata:e,testId:t}){if(T(),!e.is_degraded)return null;let n=e.executed_tiers,a=rt[e.requested_mode].label,o=wt[e.quality_tier],u=!(n.lexical||n.dense||n.sparse||n.graph)?`\u7E2E\u9000\u3057\u3066\u7B54\u3048\u3066\u3044\u307E\u3059: ${a} \u3092\u6C42\u3081\u307E\u3057\u305F\u304C\u3001\u8D70\u3063\u305F\u5C64\u306F\u3042\u308A\u307E\u305B\u3093 (\u54C1\u8CEA: ${o})\u3002`:`\u7E2E\u9000\u3057\u3066\u7B54\u3048\u3066\u3044\u307E\u3059: ${a} \u3092\u6C42\u3081\u3001${rt[e.search_mode].label} \u3067\u7B54\u3048\u307E\u3057\u305F (\u54C1\u8CEA: ${o})\u3002`;return(0,ct.jsx)(qe,{tone:"warning",testId:t,children:(0,ct.jsxs)(Te,{gap:"space-2",testId:`${t}-body`,children:[(0,ct.jsx)(G,{as:"p",fg:"fg",type:"prose",testId:`${t}-summary`,children:u}),e.degradation_reasons.length>0&&(0,ct.jsx)("ul",{"data-testid":`${t}-reasons`,children:e.degradation_reasons.map((l,i)=>(0,ct.jsx)("li",{"data-reason":l,children:(0,ct.jsx)(G,{fg:"fg",type:"prose",testId:`${t}-reason-${i}`,children:Ht(l)})},`${i}-${l}`))})]})})}var Qt=require("@aiquants/console-ui/core"),Ja=require("@aiquants/enrichment-core"),oa=require("react");var Aa=require("@aiquants/console-ui/core"),ut={classification:"\u5206\u985E",metadata:"\u30E1\u30BF\u30C7\u30FC\u30BF",labels:"\u30E9\u30D9\u30EB",tags:"\u30BF\u30B0",structured_data:"\u69CB\u9020\u5316\u30C7\u30FC\u30BF",text:"\u672C\u6587",summary:"\u8981\u7D04",chunks:"\u30C1\u30E3\u30F3\u30AF",assets:"\u6DFB\u4ED8"},Et={RUN:"\u5B9F\u884C\u306E\u5F8C\u306E\u8A18\u9332",PRE_WRITE:"\u4E0A\u66F8\u304D\u306E\u524D\u306E\u8A18\u9332",MANUAL:"\u624B\u52D5\u306E\u8A18\u9332",BACKFILL:"\u8A18\u9332\u306E\u8D77\u70B9"},fn={ADDED:"\u8FFD\u52A0",REMOVED:"\u524A\u9664",MODIFIED:"\u5909\u66F4",MOVED:"\u79FB\u52D5"},Vn={EXACT:"\u305D\u306E\u307E\u307E\u518D\u73FE",WHITESPACE_NORMALIZED:"\u7A7A\u767D\u3092\u7E4B\u304E\u76F4\u3057\u3066\u518D\u73FE",UNVERIFIED:"\u518D\u73FE\u3067\u304D\u306A\u3044"},Gn="\u30C1\u30E3\u30F3\u30AF\u306E\u672C\u6587\u306F\u3053\u306E\u533A\u9593\u306E\u6587\u3092\u7A7A\u767D\u3067\u7E4B\u304E\u76F4\u3057\u305F\u5F62\u3067\u3059\u3002",qn="\u3053\u306E\u65AD\u7247\u306F\u3053\u306E\u72B6\u614B\u306E\u62BD\u51FA\u672C\u6587\u3068\u5BFE\u5FDC\u3057\u307E\u305B\u3093\u3002",zn="\u672C\u6587\u306F\u540C\u3058\u3067\u3001\u30C1\u30E3\u30F3\u30AF\u306E\u5207\u308A\u65B9\u3060\u3051\u304C\u5909\u308F\u308A\u307E\u3057\u305F\u3002",qt={confidentialityLevel:"\u6A5F\u5BC6\u533A\u5206",departmentId:"\u90E8\u9580",folderPath:"\u30D5\u30A9\u30EB\u30C0",createdBy:"\u4F5C\u6210\u8005",fileName:"\u767B\u9332\u540D",filePath:"\u30D1\u30B9",fileId:"\u30D5\u30A1\u30A4\u30EB ID",revision:"\u7248",revisionId:"\u7248\u306E ID",fileSize:"\u5927\u304D\u3055",mimeType:"MIME",fileHash:"\u30CF\u30C3\u30B7\u30E5",mtime:"\u66F4\u65B0\u6642\u523B",present:"\u672C\u6587\u306E\u6709\u7121",lineEnding:"\u6539\u884C",finalNewline:"\u6700\u5F8C\u306E\u6539\u884C",mime:"\u672C\u6587\u306E MIME",source:"\u672C\u6587\u306E\u51FA\u6240",isTruncated:"\u5207\u308A\u8A70\u3081",pageOffsets:"\u9801\u306E\u533A\u5207\u308A",assignedBy:"\u4ED8\u3051\u305F\u8005",confidenceScore:"\u78BA\u4FE1\u5EA6",textSha256:"\u672C\u6587\u306E\u30CF\u30C3\u30B7\u30E5"};function At(e){return Object.hasOwn(qt,e)?qt[e]:e}var Rt="\u9694\u96E2 (RESTRICTED) \u306E\u6587\u66F8",Wn="\u9694\u96E2\u3055\u308C\u3066\u3044\u305F\u671F\u9593\u306E\u72B6\u614B",zt="\u9694\u96E2\u3055\u308C\u3066\u3044\u305F\u671F\u9593\u306E\u5B9F\u884C",Yn="\u76F4\u524D\u306E\u8A18\u9332\u3068\u306E\u6BD4\u8F03\u306F\u3042\u308A\u307E\u305B\u3093\u3002",Xn="\u5931\u6557\u3057\u305F\u5B9F\u884C\u306E\u5F8C\u306E\u72B6\u614B",yn="\u8A18\u9332\u3055\u308C\u3066\u3044\u307E\u305B\u3093",jn="\u30BD\u30FC\u30B9\u306F\u540C\u3058\u3067\u3001\u30E2\u30C7\u30EB\u306E\u51FA\u529B\u3060\u3051\u304C\u5909\u308F\u308A\u307E\u3057\u305F";function Jn(e){return`\u3053\u306E\u5909\u5316\u306B\u306F\u8A18\u9332\u3055\u308C\u306A\u304B\u3063\u305F\u5B9F\u884C ${e.map(t=>`#${t}`).join("\u3001")} \u306E\u5909\u5316\u3082\u542B\u307E\u308C\u307E\u3059`}function We(e){return`r${e}`}function gn(e,t){return e===t?`${We(t)} (\u540C\u3058\u7248)`:`${We(e)} \u2192 ${We(t)}`}function Wt(e){let t=ut[e.facet];if(e.facet==="classification"||e.facet==="metadata")return`${t} \u5909\u66F4`;let a=[[e.addedCount,"+"],[e.removedCount,"\u2212"],[e.modifiedCount,"~"],[e.movedCount,"\u79FB\u52D5 "]].flatMap(([o,r])=>o===null||o===0?[]:[`${r}${o}`]);return a.length===0?`${t} \u5909\u66F4`:`${t} ${a.join(" ")}`}function pt(e){return e===null?"(\u306A\u3057)":typeof e=="string"?e:JSON.stringify(e)}var st="\u6587\u66F8\u306E\u5C65\u6B74\u3092\u95B2\u89A7\u3059\u308B\u6A29\u9650\u304C\u3042\u308A\u307E\u305B\u3093\u3002";function Yt(e,t,n){return e.failureSentence(t,st,ot(n))}function ot(e){return t=>`${e}\u3092\u8AAD\u3081\u307E\u305B\u3093\u3067\u3057\u305F${(0,Aa.reasonAside)(t)}\u3002`}var Qn=require("@aiquants/enrichment-core"),Ma=(e,t)=>Date.parse(t.time)-Date.parse(e.time);function Oa(e){let t=e.states.flatMap(i=>i.kind==="readable"?[i.item]:[]),n=e.runs.flatMap(i=>i.kind==="readable"?[i.item]:[]),a=new Set(n.map(i=>i.id)),o=[...n.map(i=>({kind:"run",key:`run:${i.id}`,time:i.startedAt,run:i,state:t.find(x=>x.runId===i.id)??null})),...t.filter(i=>i.runId===null||!a.has(i.runId)).map(i=>({kind:"state",key:`state:${i.stateId}`,time:i.settledAt,state:i}))].sort(Ma),u=[...new Set([...e.revisions.map(i=>i.revision),...o.map(i=>i.kind==="run"?i.run.revision:i.state.revision)])].sort((i,x)=>x-i).map(i=>({revision:i,isCurrent:e.revisions.some(x=>x.revision===i&&x.isCurrent),items:o.filter(x=>(x.kind==="run"?x.run.revision:x.state.revision)===i)})),l=[...e.states.flatMap((i,x)=>i.kind==="restricted"?[{key:`restricted:state:${x}`,time:i.settledAt,mark:i}]:[]),...e.runs.flatMap((i,x)=>i.kind==="restricted"?[{key:`restricted:run:${x}`,time:i.startedAt,mark:i}]:[])].sort(Ma);return{groups:u,marks:l,states:t,runs:n}}function Zn(e){if(e.status==="RUNNING")return!1;let t=e.steps.find(n=>n.stepKey===Qn.RUN_TERMINAL_STEP_KEY);return t===void 0||t.status==="FAILED"}function Fa(e,t){let n=t.states.find(r=>r.stateId===e.previousStateId);if(n===void 0)return[];let a=Date.parse(n.settledAt),o=Date.parse(e.settledAt);return t.runs.filter(r=>{let u=Date.parse(r.startedAt);return r.status!=="RUNNING"&&r.id!==e.runId&&u>=a&&u<o&&!t.states.some(l=>l.runId===r.id)&&!r.steps.some(l=>l.stepKey===Qn.RUN_TERMINAL_STEP_KEY&&l.status==="SUCCEEDED")}).map(r=>r.id)}function Ua(e,t){switch(e.kind){case"latest_state":{let n=t.states[0];return n===void 0?null:t.runs.some(a=>a.id===n.runId)?`run:${n.runId}`:`state:${n.stateId}`}case"run":return`run:${e.runId}`;case"state":{let n=t.states.find(a=>a.stateId===e.stateId);return n!==void 0&&t.runs.some(a=>a.id===n.runId)?`run:${n.runId}`:`state:${e.stateId}`}}}function Ka(e,t){return e.kind==="readable"?`readable:${e.item.stateId}`:`restricted:${t}`}var Ba=require("react");function Mt(e){let[t,n]=(0,Ba.useState)({failure:null,count:0});return e!==null&&e!==t.failure?(n({failure:e,count:t.count+1}),t.count+1):t.count}var we=require("@aiquants/console-ui/core"),mt=we.TOKENS.type.body.size,ea=we.TOKENS.space["space-3"],Qr=20,Ha=(0,we.ceil8)(mt*(0,we.textWidthEm)("\u3042".repeat(Qr))+2*ea),Va=448,Zr=40,es=2,ts="+ ",ns=we.TOKENS.space["space-4"];function as(e){if(!(Number.isSafeInteger(e)&&e>=0))throw new RangeError(`A line number is a non-negative safe integer: ${e}`);return String(e).length}function Ga(e){let n=(0,we.monoTextWidthEm)("0".repeat(as(e)+es))+(0,we.monoTextWidthEm)(ts)+(0,we.monoTextWidthEm)("0".repeat(Zr));return(0,we.ceil8)(mt*2*n+ns)}function _t(e){return(0,we.ceil8)(mt*(0,we.textWidthEm)(e)+2*ea)}function It(e){if(e.length===0)throw new RangeError("A column needs at least one sample text");return Math.max(...e.map(_t))}function bn(e){return(0,we.ceil8)(mt*(0,we.textWidthEm)(e)+4*ea)}var qa="0000/00/00 00:00:00",Be=_t("\u3042".repeat(10));var Xt=require("react/jsx-runtime"),jt=/[^\s\x1c-\x1f\x85\ufeff]/,rs={fontVariantNumeric:"tabular-nums"},ss={fontVariantNumeric:"tabular-nums",whiteSpace:"nowrap"};function za({text:e,testId:t,slot:n}){if(T(),e===null)return(0,Xt.jsx)(j,{value:null,testId:t});if(!jt.test(e))throw new RangeError(`${t}: a measured text must not be empty or only white space (pass null when the value was not measured)`);return(0,Xt.jsx)("span",{"data-cui-migration":"pending","data-measured":"true","data-testid":t,style:n,children:e})}function Jt({text:e,testId:t}){return(0,Xt.jsx)(za,{text:e,testId:t,slot:rs})}function He({text:e,testId:t}){return(0,Xt.jsx)(za,{text:e,testId:t,slot:ss})}var Ye=require("@aiquants/enrichment-core"),et={RUNNING:{label:"\u5B9F\u884C\u4E2D",className:"bg-blue-100 text-blue-800"},SUCCEEDED:{label:"\u6210\u529F",className:"bg-emerald-100 text-emerald-800"},FAILED:{label:"\u5931\u6557",className:"bg-red-100 text-red-800"},FAILED_RETRY_SCHEDULED:{label:"\u5931\u6557 (\u518D\u8A66\u884C\u4E88\u5B9A)",className:"bg-amber-100 text-amber-800"}},xn={RUNNING:{label:"\u5B9F\u884C\u4E2D",className:"bg-blue-100 text-blue-800",bar:"bg-blue-400"},SUCCEEDED:{label:"\u6210\u529F",className:"bg-emerald-100 text-emerald-800",bar:"bg-emerald-500"},SKIPPED:{label:"\u7701\u7565",className:"bg-slate-100 text-slate-700",bar:"bg-slate-300"},FAILED:{label:"\u5931\u6557",className:"bg-red-100 text-red-800",bar:"bg-red-500"}},hn={ingest:"\u53D6\u308A\u8FBC\u307F",retry:"\u518D\u8A66\u884C",resync:"\u518D\u540C\u671F"},Wa="\u6587\u66F8\u306E\u72B6\u614B\u306E\u8A18\u9332";function Ot(e){return(0,Ye.isUnknownTerm)(e)?`\u77E5\u3089\u306A\u3044\u6BB5 (${e.raw})`:e===Ye.RUN_TERMINAL_STEP_KEY?Wa:Ye.PIPELINE_STEPS[e].label}function ta(e){return(0,Ye.isUnknownTerm)(e)?`\u77E5\u3089\u306A\u3044\u7A2E\u985E (${e.raw})`:Ye.DOCUMENT_KIND_LABELS[e]}var na={RECORDED:"\u72B6\u614B\u3092\u8A18\u9332\u3057\u307E\u3057\u305F",UNCHANGED:"\u524D\u306E\u8A18\u9332\u304B\u3089\u5909\u5316\u306F\u3042\u308A\u307E\u305B\u3093",ALREADY_RECORDED:"\u3053\u306E\u5B9F\u884C\u306E\u72B6\u614B\u306F\u8A18\u9332\u6E08\u307F\u3067\u3059"},aa="\u672A\u5B8C\u4E86";function it(e){return e.status==="FAILED"&&e.retryScheduled?"FAILED_RETRY_SCHEDULED":e.status}var Ya={no_pages:"\u8AAD\u3080\u5BFE\u8C61\u306A\u3057 (\u30DA\u30FC\u30B8\u306A\u3057)",no_pages_rendered:"\u8AAD\u3080\u5BFE\u8C61\u306A\u3057 (\u63CF\u753B\u3067\u304D\u305F\u30DA\u30FC\u30B8\u306A\u3057)",covered_by_page_recognition:"\u8AAD\u3080\u5BFE\u8C61\u306A\u3057 (\u89AA\u306E\u7248\u9762\u306E\u8A8D\u8B58\u304C\u8AAD\u3093\u3060\u30DA\u30FC\u30B8\u306E\u753B\u50CF)"};function ra(e){let t=(0,Ye.parseSkipReason)(e);if(t===null)return e;switch(t.kind){case"gate_closed":return`${t.featureFlagKey} \u304C\u7121\u52B9`;case"no_children":return"\u5B50\u30A2\u30BB\u30C3\u30C8\u306A\u3057";case"source_skipped":return`${Ye.PIPELINE_STEPS[t.stepKey].label} \u304C\u5B9F\u884C\u3055\u308C\u306A\u304B\u3063\u305F`;case"nothing_to_read":return Ya[t.token];case"superseded":return"\u5B9F\u884C\u306E\u7248\u304C\u73FE\u5728\u306E\u7248\u3067\u306A\u304F\u306A\u3063\u305F";case"recording_disabled":return"\u8A18\u9332\u306E\u5207\u66FF\u304C\u7121\u52B9";case"recording_misconfigured":return"\u8A18\u9332\u306E\u5207\u66FF\u306E\u8A2D\u5B9A\u306E\u8AA4\u308A";case"not_protected":return"\u30D1\u30B9\u30EF\u30FC\u30C9\u304C\u4ED8\u3044\u3066\u3044\u306A\u3044"}}var Xa=require("@aiquants/console-ui/core");function ja(e,t){return(0,Xa.formatInstant)(e,Vt,t)}var sa=require("react/jsx-runtime");function ge({iso:e,testId:t}){let{timeZone:n}=T();return(0,sa.jsx)(He,{text:e===null?null:ja(e,n),testId:t})}function Ct({iso:e,testId:t}){return T(),e===null?aa:(0,sa.jsx)(ge,{iso:e,testId:t})}var Ee=require("react/jsx-runtime"),os="document-changes";function is({host:e,onOpen:t}){let{labels:n}=T(),a=(0,oa.useRef)(null),o=(0,oa.useRef)(null),r=un(os,{first:O=>e.loadChanges(null,O).then(P=>(0,Qt.mapOutcome)(P,p=>({rows:p.rows,next:p.next,meta:null}))),next:(O,P)=>e.loadChanges(O,P).then(p=>(!p.ok&&p.status===Qt.HTTP_FORBIDDEN&&r.reload(),(0,Qt.mapOutcome)(p,D=>({rows:D.rows,next:D.next}))))},0),u=Ze(()=>a.current),l=r.state.kind==="ready"?r.state.refreshFailure:null,i=Mt(l);return(0,Ee.jsx)(dt,{title:"\u76F4\u8FD1\u306E\u6587\u66F8\u306E\u5909\u5316",headingRef:a,testId:"change-feed",children:(()=>{if(r.state.kind==="failed")return(0,Ee.jsx)(vt,{failure:r.state,onReload:r.reload,forbiddenMessage:st,failureMessage:ot("\u76F4\u8FD1\u306E\u6587\u66F8\u306E\u5909\u5316"),rescueRef:u,testId:"change-feed-failed"});if(r.state.kind!=="ready")return(0,Ee.jsx)("p",{"aria-busy":"true","data-testid":"change-feed-loading",children:"\u76F4\u8FD1\u306E\u6587\u66F8\u306E\u5909\u5316\u3092\u8AAD\u307F\u8FBC\u3093\u3067\u3044\u307E\u3059\u2026"});let{value:O}=r.state,P=O.rows.map((p,D)=>({row:p,position:D}));return(0,Ee.jsxs)(Ee.Fragment,{children:[l!==null&&(0,Ee.jsx)(ze,{occurrence:i,testId:"change-feed-refresh-failed",children:Yt(n,l,"\u76F4\u8FD1\u306E\u6587\u66F8\u306E\u5909\u5316")}),(0,Ee.jsx)(Lt,{caption:"\u76F4\u8FD1\u306E\u6587\u66F8\u306E\u5909\u5316",captionHidden:!0,columns:[{key:"time",header:"\u6642\u523B",width:{fixedPx:_t(qa)},align:"start",cell:({row:p,position:D})=>(0,Ee.jsx)(ge,{iso:p.kind==="readable"?p.item.settledAt:p.settledAt,testId:`change-feed-time-value-${D}`})},{key:"document",header:"\u6587\u66F8",width:{minPx:Be},align:"start",cell:({row:p})=>p.kind==="readable"?(0,Ee.jsxs)(Ee.Fragment,{children:[(0,Ee.jsx)("span",{children:p.item.fileName})," ",(0,Ee.jsx)("span",{children:p.item.fileUri})]}):(0,Ee.jsx)("span",{"data-restricted-mark":"change",children:Rt})},{key:"revision",header:"\u7248",width:{fixedPx:_t("r00000 \u2192 r00000")},align:"start",cell:({row:p})=>p.kind==="readable"?gn(p.item.previousRevision,p.item.revision):null},{key:"cause",header:"\u5951\u6A5F",width:{fixedPx:It(Object.values(Et))},align:"start",cell:({row:p})=>p.kind==="readable"?Et[p.item.cause]:null},{key:"actor",header:"\u64CD\u4F5C\u8005",width:{minPx:Be},align:"start",cell:({row:p})=>p.kind==="readable"?p.item.actor:null},{key:"facets",header:"\u5909\u308F\u3063\u305F\u9762",width:{minPx:Be},align:"start",cell:({row:p,position:D})=>p.kind==="readable"?p.item.changes.map(K=>(0,Ee.jsx)(Ge,{tone:"neutral",variant:"tint",testId:`change-feed-badge-${D}-${K.facet}`,children:Wt(K)},K.facet)):null},...t===void 0?[]:[{key:"open",header:"\u958B\u304F",width:{fixedPx:bn("\u958B\u304F")},align:"start",cell:({row:p})=>p.kind==="readable"?(0,Ee.jsxs)(Ne,{variant:"secondary",onClick:()=>t(p.item.metadataId,p.item.stateId),testId:`change-feed-open-${p.item.stateId}`,children:["\u958B\u304F ",(0,Ee.jsx)(Da,{testId:`change-feed-open-name-${p.item.stateId}`,children:`${p.item.fileName} ${gn(p.item.previousRevision,p.item.revision)} \u306E\u5909\u5316`})]}):null}]],rows:P,rowKey:({row:p,position:D})=>Ka(p,D),rowTestId:"change-feed-row",rowData:({row:p})=>({"data-row-kind":p.kind}),rowSize:t===void 0?"row":"row-control",empty:"\u76F4\u8FD1\u306E\u5909\u5316\u306F\u3042\u308A\u307E\u305B\u3093\u3002",testId:"change-feed-table",ref:o}),(0,Ee.jsx)(ln,{onLoad:r.loadMore,busy:O.loadingMore||r.state.refreshing,done:O.next===null,failure:O.moreFailure,limit:Ja.DOCUMENT_CHANGE_FEED_PAGE_SIZE,rows:{count:P.length,ref:o},testId:"change-feed-more"})]})})()})}var Ft=require("@aiquants/console-ui/core"),ie=require("react");var cr=require("@aiquants/console-ui/core"),ur=require("@aiquants/enrichment-core"),tt=require("react");var rr=require("react");var da=require("@aiquants/console-ui/core"),vn=require("@aiquants/enrichment-core"),Pe=require("react");var v=require("react/jsx-runtime"),la="\u5E45\u304C\u8DB3\u308A\u306A\u3044\u305F\u3081 1 \u5217\u3067\u8868\u793A\u3057\u3066\u3044\u307E\u3059",Za={context:"",removed:"\u2212",added:"+"},er={whiteSpace:"pre-wrap",overflowWrap:"anywhere"};function ia(e){let t=e.newLines>0?e.newStart:e.oldStart,n=e.firstPage===null?"":` (p.${e.firstPage})`;return`${t} \u884C\u76EE${n} +${e.linesAdded} \u2212${e.linesRemoved}`}function ds(e){return e.reduce((t,n)=>Math.max(t,n.oldStart+n.oldLines-1,n.newStart+n.newLines-1),0)}function ls(e){return e.reduce((t,{line:n})=>Math.max(t,n.oldNumber??0,n.newNumber??0),0)}function cs(e){let t=[],n=0;for(let a=1;a<=e.length;a++)(a===e.length||e[a].page!==e[n].page)&&(t.push(...us(e.slice(n,a).map(({line:o})=>o))),n=a);return t}function us(e){let t=[],n=[],a=[],o=()=>{for(let r=0;r<Math.max(n.length,a.length);r++)t.push({left:n[r]??null,right:a[r]??null});n=[],a=[]};for(let r of e)r.kind==="context"?(o(),t.push({left:r,right:r})):r.kind==="removed"?(a.length>0&&o(),n.push(r)):a.push(r);return o(),t}function tr(e){return e.segments.map((t,n)=>{let a=`${n}`;return t.kind==="removed"?(0,v.jsx)("del",{"data-cui-surface":"danger-tint","data-cui-fg":"fg","data-segment":"removed",children:t.text},a):t.kind==="added"?(0,v.jsx)("ins",{"data-cui-surface":"success-tint","data-cui-fg":"fg","data-segment":"added",children:t.text},a):(0,v.jsx)("span",{children:t.text},a)})}function Qa(e,t){return(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)("td",{"data-line-number":t,children:e===null?"":t==="old"?e.oldNumber:e.newNumber}),(0,v.jsx)("td",{"data-line-sign":!0,children:e===null?"":Za[e.kind]}),(0,v.jsx)("td",{style:er,"data-line-text":t,children:e===null?null:tr(e)})]})}function ps({states:e,target:t,hunk:n,layout:a,tableLabel:o,readLines:r,rescueTarget:u,onLines:l,testId:i}){let x={...e,...t,hunk:n},O=JSON.stringify([e.fromStateId,e.toStateId,t,n]),P=un(O,{first:N=>r({...x,offset:0,limit:vn.DIFF_LINE_PAGE_MAX},N).then(F=>(0,da.mapOutcome)(F,W=>({rows:W.lines.map(Q=>({line:Q,page:0})),next:W.next,meta:null}))),next:(N,F)=>r({...x,offset:N,limit:vn.DIFF_LINE_PAGE_MAX},F).then(W=>(0,da.mapOutcome)(W,Q=>({rows:Q.lines.map(ue=>({line:ue,page:N})),next:Q.next})))},0),p=Ze(u),D=(0,Pe.useRef)(null),K=P.state.kind==="ready"?P.state.value.rows:null;if((0,Pe.useEffect)(()=>{K!==null&&l(ls(K))},[K,l]),P.state.kind==="failed")return(0,v.jsx)(vt,{failure:P.state,onReload:P.reload,forbiddenMessage:st,failureMessage:ot("\u5DEE\u5206\u306E\u884C"),rescueRef:p,testId:`${i}-failed`});if(P.state.kind!=="ready")return(0,v.jsx)("p",{"aria-busy":"true","data-testid":`${i}-loading`,children:"\u5DEE\u5206\u306E\u884C\u3092\u8AAD\u307F\u8FBC\u3093\u3067\u3044\u307E\u3059\u2026"});let{value:m}=P.state,R=a==="split"?cs(m.rows):null;return(0,v.jsxs)("div",{"data-testid":i,"data-layout":a,children:[(0,v.jsxs)("table",{"aria-label":o,"data-testid":`${i}-lines`,"data-cui-type":"body","data-cui-face":"mono",children:[(0,v.jsx)("thead",{children:a==="split"?(0,v.jsxs)("tr",{children:[(0,v.jsx)("th",{scope:"col",children:"\u65E7"}),(0,v.jsx)("th",{scope:"col",children:"\u7B26\u53F7"}),(0,v.jsx)("th",{scope:"col",children:"\u53E4\u3044\u672C\u6587"}),(0,v.jsx)("th",{scope:"col",children:"\u65B0"}),(0,v.jsx)("th",{scope:"col",children:"\u7B26\u53F7"}),(0,v.jsx)("th",{scope:"col",children:"\u65B0\u3057\u3044\u672C\u6587"})]}):(0,v.jsxs)("tr",{children:[(0,v.jsx)("th",{scope:"col",children:"\u65E7"}),(0,v.jsx)("th",{scope:"col",children:"\u65B0"}),(0,v.jsx)("th",{scope:"col",children:"\u7B26\u53F7"}),(0,v.jsx)("th",{scope:"col",children:"\u672C\u6587"})]})}),(0,v.jsx)("tbody",{ref:D,children:R===null?m.rows.map(({line:N},F)=>(0,v.jsxs)("tr",{tabIndex:-1,"data-cui-row-focus":"","data-line-kind":N.kind,children:[(0,v.jsx)("td",{"data-line-number":"old",children:N.oldNumber}),(0,v.jsx)("td",{"data-line-number":"new",children:N.newNumber}),(0,v.jsx)("td",{"data-line-sign":!0,children:Za[N.kind]}),(0,v.jsx)("td",{style:er,"data-line-text":"unified",children:tr(N)})]},F)):R.map(N=>(0,v.jsxs)("tr",{tabIndex:-1,"data-cui-row-focus":"","data-line-kind":N.left===N.right?"context":"changed",children:[Qa(N.left,"old"),Qa(N.right,"new")]},`${N.left?.oldNumber??""}:${N.right?.newNumber??""}`))})]}),(0,v.jsx)(ln,{onLoad:P.loadMore,busy:m.loadingMore||P.state.refreshing,done:m.next===null,failure:m.moreFailure,limit:vn.DIFF_LINE_PAGE_MAX,rows:{count:R===null?m.rows.length:R.length,ref:D},testId:`${i}-more`})]})}function ms(){let[e,t]=(0,Pe.useState)(null);return[(0,Pe.useCallback)((a=>{let o=new ResizeObserver(r=>{for(let u of r)t(u.contentRect.width)});return o.observe(a),()=>o.disconnect()}),[]),e]}function Sn({states:e,target:t,index:n,readLines:a,label:o,rescueTarget:r,onNarrowChange:u,testId:l}){T();let i=(0,Pe.useId)(),[x,O]=(0,Pe.useState)("split"),[P,p]=(0,Pe.useState)(()=>new Set(n===null?[0]:[])),[D,K]=(0,Pe.useState)(0),[m,R]=ms(),N=(0,Pe.useRef)(new Map),F=(0,Pe.useCallback)(k=>K(Z=>Math.max(Z,k)),[]),W=Ga(Math.max(n===null?0:ds(n.hunks),D)),Q=R!==null&&R>=W,ue=x==="split"&&Q?"split":"unified",te=x==="split"&&R!==null&&!Q;(0,Pe.useEffect)(()=>{u(i,te)},[i,te,u]),(0,Pe.useEffect)(()=>()=>u(i,!1),[i,u]);let q=(k,Z)=>p(Y=>{let _e=new Set(Y);return Z?_e.add(k):_e.delete(k),_e}),de=k=>`${i}-hunk-${k}`,Se=(k,Z)=>(0,v.jsx)(ps,{states:e,target:t,hunk:k,layout:ue,tableLabel:Z,readLines:a,rescueTarget:()=>N.current.get(k)??r(),onLines:F,testId:`${l}-hunk-${k}-body`});return(0,v.jsxs)("div",{"data-cui-migration":"pending",ref:m,"data-testid":l,"data-layout":ue,"data-split-min-px":W,children:[n!==null&&(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)("dl",{"data-testid":`${l}-stats`,children:[(0,v.jsxs)("div",{children:[(0,v.jsx)("dt",{children:"\u8FFD\u52A0\u3057\u305F\u884C"}),(0,v.jsx)("dd",{children:(0,v.jsx)(j,{value:n.stats.linesAdded,testId:`${l}-lines-added`})})]}),(0,v.jsxs)("div",{children:[(0,v.jsx)("dt",{children:"\u524A\u9664\u3057\u305F\u884C"}),(0,v.jsx)("dd",{children:(0,v.jsx)(j,{value:n.stats.linesRemoved,testId:`${l}-lines-removed`})})]}),(0,v.jsxs)("div",{children:[(0,v.jsx)("dt",{children:"\u5909\u308F\u3089\u306A\u3044\u884C"}),(0,v.jsx)("dd",{children:(0,v.jsx)(j,{value:n.stats.linesUnchanged,testId:`${l}-lines-unchanged`})})]}),(0,v.jsxs)("div",{children:[(0,v.jsx)("dt",{children:"\u8FFD\u52A0\u3057\u305F\u5B57"}),(0,v.jsx)("dd",{children:(0,v.jsx)(j,{value:n.stats.charsAdded,testId:`${l}-chars-added`})})]}),(0,v.jsxs)("div",{children:[(0,v.jsx)("dt",{children:"\u524A\u9664\u3057\u305F\u5B57"}),(0,v.jsx)("dd",{children:(0,v.jsx)(j,{value:n.stats.charsRemoved,testId:`${l}-chars-removed`})})]}),(0,v.jsxs)("div",{children:[(0,v.jsx)("dt",{children:"\u985E\u4F3C\u5EA6"}),(0,v.jsx)("dd",{children:(0,v.jsx)(He,{text:n.stats.similarity===null?null:`${(n.stats.similarity*100).toFixed(1)}%`,testId:`${l}-similarity`})})]})]}),n.attributes.length>0&&(0,v.jsx)("ul",{"data-testid":`${l}-attributes`,children:n.attributes.map(k=>(0,v.jsxs)("li",{"data-field":k.field,children:[At(k.field)," ",pt(k.before)," \u2192 ",pt(k.after)]},k.field))}),n.hunks.length>0&&(0,v.jsx)("ol",{"aria-label":"\u5909\u5316\u306E\u584A","data-testid":`${l}-hunk-index`,children:n.hunks.map(k=>(0,v.jsx)("li",{children:(0,v.jsx)("a",{href:`#${de(k.hunk)}`,onClick:()=>q(k.hunk,!0),"data-hunk":k.hunk,children:ia(k)})},k.hunk))})]}),(0,v.jsx)(Ne,{variant:"secondary",onClick:()=>O(x==="split"?"unified":"split"),dataAttributes:{"data-preferred":x},testId:`${l}-layout-toggle`,children:x==="split"?"1 \u5217\u3067\u8868\u793A":"\u4E26\u3079\u3066\u8868\u793A"}),te&&(0,v.jsx)("p",{"data-testid":`${l}-narrow`,children:la}),n===null?Se(0,o):n.hunks.map(k=>{let Z=P.has(k.hunk);return(0,v.jsxs)("div",{id:de(k.hunk),"data-testid":`${l}-hunk-${k.hunk}`,"data-open":Z,children:[(0,v.jsx)(Ne,{variant:"secondary",expanded:Z,controls:`${de(k.hunk)}-body`,onClick:()=>q(k.hunk,!Z),ref:Y=>{Y===null?N.current.delete(k.hunk):N.current.set(k.hunk,Y)},testId:`${l}-hunk-${k.hunk}-toggle`,children:ia(k)}),(0,v.jsx)("div",{id:`${de(k.hunk)}-body`,children:Z&&Se(k.hunk,`${o} ${ia(k)}`)})]},k.hunk)})]})}var Me=require("react/jsx-runtime");function fs(e){let t=[e.page===null?null:`p.${e.page}`,e.sheet===null?null:`\u30B7\u30FC\u30C8 ${e.sheet}`,e.slide===null?null:`\u30B9\u30E9\u30A4\u30C9 ${e.slide}`,e.startSec===null?null:`${e.startSec}${e.endSec===null?"":`\u2013${e.endSec}`} \u79D2`].filter(n=>n!==null);return t.length===0?"\u4F4D\u7F6E\u306A\u3057":t.join("\u30FB")}function nr(e){return e.new??e.old}function ar(e){return e.kind==="MODIFIED"&&e.old?.fidelity!=="UNVERIFIED"&&e.new?.fidelity!=="UNVERIFIED"}function sr({states:e,stats:t,entries:n,textUnchangedChunkingChanged:a,readLines:o,rescueTarget:r,onNarrowChange:u,testId:l}){T();let[i,x]=(0,rr.useState)(()=>new Set),O=p=>x(D=>{let K=new Set(D);return K.delete(p)||K.add(p),K}),P=p=>{let D=[p.old===null?null:["\u65E7",p.old],p.new===null?null:["\u65B0",p.new]].filter(m=>m!==null),K=new Set(D.flatMap(([,m])=>m.fidelity==="UNVERIFIED"?[qn]:m.fidelity==="WHITESPACE_NORMALIZED"?[Gn]:[]));return(0,Me.jsxs)(Me.Fragment,{children:[D.map(([m,R])=>(0,Me.jsxs)("span",{"data-fidelity":R.fidelity,"data-side":m,children:[m," ",Vn[R.fidelity]," "]},m)),[...K].map(m=>(0,Me.jsx)("span",{"data-chunk-note":!0,children:m},m))]})};return(0,Me.jsxs)("div",{"data-testid":l,children:[a&&(0,Me.jsx)(qe,{tone:"info",testId:`${l}-chunking-only`,children:zn}),(0,Me.jsxs)("p",{"data-testid":`${l}-stats`,children:["\u8FFD\u52A0 ",t.added,"\u30FB\u524A\u9664 ",t.removed,"\u30FB\u5909\u66F4 ",t.modified,"\u30FB\u79FB\u52D5 ",t.moved,"\u30FB\u5909\u308F\u3089\u306A\u3044 ",t.unchanged]}),(0,Me.jsx)(Lt,{caption:"\u5909\u308F\u3063\u305F\u30C1\u30E3\u30F3\u30AF",captionHidden:!0,columns:[{key:"kind",header:"\u7A2E\u985E",width:{fixedPx:It(Object.values(fn))},align:"start",cell:p=>fn[p.kind]},{key:"position",header:"\u4F4D\u7F6E",width:{minPx:Be},align:"start",cell:p=>fs(nr(p))},{key:"heading",header:"\u898B\u51FA\u3057",width:{minPx:Be},align:"start",cell:p=>nr(p).breadcrumbs},{key:"numbers",header:"\u65E7 # \u2192 \u65B0 #",width:{fixedPx:_t("#00000 \u2192 #00000")},align:"start",cell:p=>`${p.old===null?"(\u306A\u3057)":`#${p.old.index}`} \u2192 ${p.new===null?"(\u306A\u3057)":`#${p.new.index}`}`},{key:"fidelity",header:"\u672C\u6587\u306E\u518D\u73FE",width:{minPx:Be},align:"start",cell:P},{key:"diff",header:"\u5DEE\u5206",width:{fixedPx:bn("\u5DEE\u5206\u3092\u9589\u3058\u308B")},align:"start",cell:p=>ar(p)?(0,Me.jsx)(Ne,{variant:"secondary",expanded:i.has(p.entry),controls:`${l}-diff-${p.entry}`,onClick:()=>O(p.entry),testId:`${l}-diff-toggle-${p.entry}`,children:i.has(p.entry)?"\u5DEE\u5206\u3092\u9589\u3058\u308B":"\u5DEE\u5206\u3092\u958B\u304F"}):null}],rows:n,rowKey:p=>`${p.entry}`,rowTestId:`${l}-row`,rowData:p=>({"data-entry":p.entry,"data-kind":p.kind}),rowSize:"row-control",empty:"\u5909\u308F\u3063\u305F\u30C1\u30E3\u30F3\u30AF\u306F\u3042\u308A\u307E\u305B\u3093\u3002",testId:`${l}-table`}),n.filter(p=>ar(p)&&i.has(p.entry)).map(p=>{let D=`\u30C1\u30E3\u30F3\u30AF #${p.old?.index} \u2192 #${p.new?.index} \u306E\u5DEE\u5206`;return(0,Me.jsx)("section",{id:`${l}-diff-${p.entry}`,"aria-label":D,"data-testid":`${l}-diff-${p.entry}`,children:(0,Me.jsx)(Sn,{states:e,target:{facet:"chunks",entry:p.entry},index:null,readLines:o,label:D,rescueTarget:r,onNarrowChange:u,testId:`${l}-diff-${p.entry}-view`})},p.entry)})]})}var Nn=require("@aiquants/enrichment-core"),or=require("react");var ca=require("react/jsx-runtime");function ys(e){let t=new Set;for(let{path:n}of e){if(t.has(n))throw new RangeError(`A tree path list holds the path ${JSON.stringify(n)} more than once.`);t.add(n)}return e.map(({path:n,item:a})=>({path:n,label:(0,Nn.treePathLabel)(n),item:a})).sort((n,a)=>(0,Nn.compareTreePaths)(n.path,a.path))}function En({items:e,renderItem:t,testId:n}){T();let a=(0,or.useMemo)(()=>ys(e),[e]);return(0,ca.jsx)("ol",{role:"list","data-testid":n,children:a.map(({path:o,label:r,item:u})=>(0,ca.jsx)("li",{"data-testid":`${n}-item-${o}`,children:t(u,r,o)},o))})}var J=require("react/jsx-runtime"),gs={fontSize:`${mt}px`,fontWeight:cr.TOKENS.weight.bold},ir={whiteSpace:"pre-wrap",overflowWrap:"anywhere",margin:0},dr={add:"\u8FFD\u52A0",remove:"\u524A\u9664",replace:"\u7F6E\u63DB"},bs=It(Object.values(qt));function xs(e,t,n){let a=o=>Object.fromEntries(t.map(r=>[r.field,u=>(0,J.jsx)("span",{"data-testid":`${n}-${r.field}-${o}-${u}`,children:pt(r[o])})]));return(0,J.jsx)(dn,{caption:`${e}\u306E\u5909\u5316`,attributes:t.map(o=>({key:o.field,label:At(o.field)})),columns:[{key:"before",heading:"\u5909\u66F4\u524D",cells:a("before")},{key:"after",heading:"\u5909\u66F4\u5F8C",cells:a("after")}],attributePx:bs,columnMinPx:Be,testId:n})}function Zt(e,t,n){return t.length===0?null:(0,J.jsxs)("div",{"data-testid":n,children:[(0,J.jsxs)("p",{children:[e," (",t.length,")"]}),(0,J.jsx)("ul",{children:t.map(([a,o])=>(0,J.jsx)("li",{children:o},a))})]})}function ua(e,t,n){return t.length===0?null:(0,J.jsxs)("div",{"data-testid":n,children:[(0,J.jsxs)("p",{children:[e," (",t.length,")"]}),(0,J.jsx)(En,{items:t,renderItem:(a,o)=>`${o}: ${a}`,testId:`${n}-tree`})]})}var pa=e=>JSON.stringify(e.value),pr=e=>e.fields.map(t=>`${At(t.field)} ${pt(t.before)} \u2192 ${pt(t.after)}`).join("\u3001"),lr=e=>[e.key,`${e.key}: ${pa(e)}`],hs=e=>[e.key,`${e.key}: ${pr(e)}`];function vs({diff:e,testId:t}){let n=(0,tt.useMemo)(()=>({added:e.added.map(a=>({path:a.key,item:pa(a)})),removed:e.removed.map(a=>({path:a.key,item:pa(a)})),modified:e.modified.map(a=>({path:a.key,item:pr(a)}))}),[e]);return(0,J.jsxs)(J.Fragment,{children:[ua("\u8FFD\u52A0",n.added,`${t}-added`),ua("\u524A\u9664",n.removed,`${t}-removed`),ua("\u5909\u66F4",n.modified,`${t}-modified`)]})}function mr({states:e,comparison:t,readLines:n,rescueTarget:a,testId:o}){let{announce:r}=T(),u=(0,tt.useId)(),[l,i]=(0,tt.useState)(()=>new Set),x=(0,tt.useCallback)((m,R)=>i(N=>{if(N.has(m)===R)return N;let F=new Set(N);return R?F.add(m):F.delete(m),F}),[]),O=l.size>0;(0,tt.useEffect)(()=>{O&&r(la)},[O,r]);let P=t.facets.filter(m=>m.change==="CHANGED"),p=ur.DOCUMENT_FACETS.filter(m=>!P.some(R=>R.facet===m)),D=m=>`${u}-${m}`,K=m=>{let R=`${o}-${m.facet}`;switch(m.facet){case"classification":case"metadata":return xs(ut[m.facet],m.fields,`${R}-grid`);case"labels":return(0,J.jsxs)(J.Fragment,{children:[Zt("\u8FFD\u52A0",m.added.map(lr),`${R}-added`),Zt("\u524A\u9664",m.removed.map(lr),`${R}-removed`),Zt("\u5909\u66F4",m.modified.map(hs),`${R}-modified`)]});case"assets":return(0,J.jsx)(vs,{diff:m,testId:R});case"tags":return(0,J.jsxs)(J.Fragment,{children:[Zt("\u8FFD\u52A0",m.added.map(N=>[N,N]),`${R}-added`),Zt("\u524A\u9664",m.removed.map(N=>[N,N]),`${R}-removed`)]});case"structured_data":return(0,J.jsx)(Lt,{caption:"\u69CB\u9020\u5316\u30C7\u30FC\u30BF\u306E\u64CD\u4F5C",captionHidden:!0,columns:[{key:"op",header:"\u64CD\u4F5C",width:{fixedPx:It(Object.values(dr))},align:"start",cell:({operation:N})=>dr[N.op]},{key:"path",header:"\u9053",width:{minPx:Be},align:"start",cell:({operation:N})=>N.path===""?"(\u6839)":N.path},{key:"before",header:"\u5909\u66F4\u524D",width:{minPx:Be},align:"start",cell:({operation:N})=>N.op==="add"?null:(0,J.jsx)("pre",{style:ir,children:JSON.stringify(N.previous,null,2)})},{key:"after",header:"\u5909\u66F4\u5F8C",width:{minPx:Be},align:"start",cell:({operation:N})=>N.op==="remove"?null:(0,J.jsx)("pre",{style:ir,children:JSON.stringify(N.value,null,2)})}],rows:m.operations.map((N,F)=>({operation:N,position:F})),rowKey:({position:N})=>`${N}`,rowTestId:`${R}-operation`,rowData:({operation:N})=>({"data-op":N.op}),rowSize:"row",empty:"\u64CD\u4F5C\u306F\u3042\u308A\u307E\u305B\u3093\u3002",testId:`${R}-operations`});case"text":case"summary":return(0,J.jsx)(Sn,{states:e,target:{facet:m.facet},index:m,readLines:n,label:ut[m.facet],rescueTarget:a,onNarrowChange:x,testId:`${R}-diff`});case"chunks":return(0,J.jsx)(sr,{states:e,stats:m.stats,entries:m.entries,textUnchangedChunkingChanged:m.textUnchangedChunkingChanged,readLines:n,rescueTarget:a,onNarrowChange:x,testId:`${R}-table`})}};return(0,J.jsxs)("div",{"data-cui-migration":"pending","data-testid":o,children:[P.length>0&&(0,J.jsx)("nav",{"aria-label":"\u5909\u308F\u3063\u305F\u9762","data-testid":`${o}-nav`,children:(0,J.jsx)("ul",{children:P.map(m=>(0,J.jsx)("li",{children:(0,J.jsx)("a",{href:`#${D(m.facet)}`,"data-facet":m.facet,children:ut[m.facet]})},m.facet))})}),P.map(m=>(0,J.jsxs)("section",{id:D(m.facet),"aria-labelledby":`${D(m.facet)}-heading`,"data-testid":`${o}-${m.facet}`,"data-facet":m.facet,children:[(0,J.jsx)("h4",{id:`${D(m.facet)}-heading`,style:gs,children:ut[m.facet]}),K(m)]},m.facet)),p.length>0&&(0,J.jsxs)("p",{"data-testid":`${o}-unchanged`,children:["\u5909\u5316\u306A\u3057: ",p.map(m=>ut[m]).join("\u30FB")]})]})}var je=require("@aiquants/enrichment-core"),fr=require("react");var M=require("react/jsx-runtime"),Ss=8,Ns={text_layer:"\u6587\u5B57\u5C64",ocr:"OCR",transcript:"\u8EE2\u5199"},Es={provider:"\u30D7\u30ED\u30D0\u30A4\u30C0",model:"\u30E2\u30C7\u30EB",engine:"\u30A8\u30F3\u30B8\u30F3",prompt_key:"\u30D7\u30ED\u30F3\u30D7\u30C8",prompt_version:"\u7248",duration_ms:"\u51E6\u7406\u6642\u9593",input_chars:"\u5165\u529B\u6587\u5B57\u6570",output_chars:"\u51FA\u529B\u6587\u5B57\u6570",chunk_count:"\u30C1\u30E3\u30F3\u30AF",points_upserted:"\u6295\u5165\u70B9\u6570",collection:"\u30B3\u30EC\u30AF\u30B7\u30E7\u30F3",embedding_model:"\u57CB\u3081\u8FBC\u307F\u30E2\u30C7\u30EB",graph_nodes:"\u30B0\u30E9\u30D5\u30CE\u30FC\u30C9"},yr={duration_ms:"ms",input_chars:void 0,output_chars:void 0,chunk_count:void 0,points_upserted:void 0,graph_nodes:void 0},Rs=["provider","model","engine","prompt_key","prompt_version","duration_ms","input_chars","output_chars","chunk_count","points_upserted","collection","embedding_model","graph_nodes"],_s=["FAILED","RUNNING","SUCCEEDED","SKIPPED"],Is="\u6728\u306E\u9053\u3092\u6301\u305F\u306A\u3044\u8A18\u9332 (\u79FB\u884C\u306E\u9014\u4E2D)",Cs={atomic:"whitespace-nowrap",anywhere:"wrap-anywhere"};function gr(e){return Object.hasOwn(yr,e)}function en(e,t){return`run-step-provenance-value-${e}-${t}`}function ks(e,t,n){if(gr(t)){let o=e[t];return o===null?null:(0,M.jsx)(j,{value:o,unit:yr[t],testId:en(n,t)})}let a=e[t];return a===null?null:(0,M.jsx)(Jt,{text:String(a),testId:en(n,t)})}function Ts(e,t){let n=Rs.map(r=>({key:r,label:Es[r],value:ks(e,r,t),breaks:gr(r)?"atomic":"anywhere"})),a=e.pages_read!==null||e.pages_total!==null,o=(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(j,{value:e.pages_read,testId:en(t,"pages_read")})," / ",(0,M.jsx)(j,{value:e.pages_total,testId:en(t,"pages_total")})]});return[...n,{key:"pages",label:"\u8AAD\u3093\u3060\u30DA\u30FC\u30B8",value:a?o:null,breaks:"atomic"},{key:"body_source",label:"\u672C\u6587\u306E\u51FA\u6240",value:e.body_source===null?null:(0,M.jsx)(Jt,{text:Ns[e.body_source],testId:en(t,"body_source")}),breaks:"anywhere"}]}function ws(e,t){let n=new Map,a=[];for(let r of t){if(r.targetTreePath===null){a.push(r);continue}let u=n.get(r.targetTreePath);u===void 0?n.set(r.targetTreePath,[r]):u.push(r)}let o=Array.from(n,([r,u])=>({path:r,item:u}));return{kind:"fan_out",stepKey:e,steps:t,placed:o,pathless:a}}function Ps(e){let t=[],n=new Map;for(let a of[...e.steps].sort((o,r)=>o.sequence-r.sequence)){let o=a.stepKey;if(o===je.RUN_TERMINAL_STEP_KEY||(0,je.isUnknownTerm)(o)||je.PIPELINE_STEPS[o].fanOut!=="children"||a.targetMetadataId===e.metadataId){t.push({kind:"step",step:a});continue}let r=n.get(o);if(r!==void 0){r.push(a);continue}let u=[a];n.set(o,u),t.push({kind:"fan_out",stepKey:o,steps:u})}return t.map(a=>a.kind==="step"?a:ws(a.stepKey,a.steps))}function Ls(e){if(e.skipReason===null)throw new RangeError(`Step record #${e.id} is SKIPPED without a skip reason, which the pipeline record schema refuses.`);return e.skipReason}function $s({step:e}){let{labels:t}=T();if(e.status==="SKIPPED")return(0,M.jsxs)("p",{className:"text-[13px] text-slate-600","data-testid":`run-step-skip-reason-${e.sequence}`,children:["\u7701\u7565: ",ra(Ls(e))]});if(e.stepKey===je.RUN_TERMINAL_STEP_KEY&&e.status==="SUCCEEDED"){let{outcome:u}=je.RunTerminalStepDetailSchema.parse(e.provenance?.detail);return(0,M.jsx)("p",{className:"text-[13px] text-slate-700","data-testid":`run-step-terminal-outcome-${e.sequence}`,"data-outcome":u,children:na[u]})}if(e.provenance===null)return(0,M.jsx)("p",{className:"text-[13px] text-slate-500","data-testid":`run-step-provenance-missing-${e.sequence}`,children:"\u6BB5\u306E\u5831\u544A\u306F\u3042\u308A\u307E\u305B\u3093\u3002"});let n=e.provenance,a=Ts(n,e.sequence),o=a.filter(u=>u.value!==null),r=a.filter(u=>u.value===null);return(0,M.jsxs)(M.Fragment,{children:[o.length>0&&(0,M.jsx)("dl",{className:"grid grid-cols-2 gap-x-4 gap-y-1 text-[13px] sm:grid-cols-3","data-testid":`run-step-provenance-${e.sequence}`,children:o.map(u=>(0,M.jsxs)("div",{className:"border-slate-100 border-b border-solid py-0.5",children:[(0,M.jsx)("dt",{className:"text-slate-500",children:u.label}),(0,M.jsx)("dd",{className:`text-slate-800 ${Cs[u.breaks]}`,"data-provenance-key":u.key,children:u.value})]},u.key))}),r.length>0&&(0,M.jsxs)("p",{className:"mt-1 text-[11px] text-slate-500","data-testid":`run-step-unmeasured-${e.sequence}`,"data-unmeasured-note":!0,children:[t.unmeasured,": ",r.map(u=>u.label).join("\u3001")]}),Object.keys(n.detail).length>0&&(0,M.jsxs)("details",{className:"mt-2 text-[13px]","data-testid":`run-step-detail-${e.sequence}`,children:[(0,M.jsx)("summary",{className:"cursor-pointer text-slate-600",children:"\u8A73\u7D30"}),(0,M.jsx)("pre",{className:"mt-1 overflow-auto rounded-lg bg-slate-900 p-4 font-mono text-[11px] text-slate-100",children:JSON.stringify(n.detail,null,2)})]})]})}function ma(e,t,n,a,o){let r=xn[e.status],u=o==="tree"?"div":"li",l=o==="alert"?{"data-cui-surface":"surface","data-cui-fg":"fg"}:void 0;return(0,M.jsx)(u,{className:"rounded-lg border border-slate-200 border-solid","data-testid":`run-step-${e.sequence}`,"data-status":e.status,"data-step-key":(0,je.storedTermText)(e.stepKey),...l,children:(0,M.jsxs)("details",{open:a,className:"group/step","data-testid":`run-step-card-${e.sequence}`,children:[(0,M.jsxs)("summary",{className:"flex cursor-pointer list-none flex-wrap items-center gap-2 p-4 [&::-webkit-details-marker]:hidden",children:[(0,M.jsx)("span",{"aria-hidden":"true",className:"text-[11px] text-slate-500 transition-transform group-open/step:rotate-90",children:"\u25B6"}),(0,M.jsx)("span",{className:"font-semibold text-[13px] text-slate-900",children:t}),e.strategyId!==null&&(0,M.jsxs)("span",{className:"rounded-sm bg-indigo-50 px-1.5 py-0.5 text-[11px] text-indigo-800","data-testid":`run-step-strategy-${e.sequence}`,children:["\u6226\u7565 #",e.strategyId]}),(0,M.jsx)("span",{className:`inline-flex rounded-full px-2 py-0.5 font-semibold text-[11px] ${r.className}`,"data-testid":`run-step-status-${e.sequence}`,"data-status":e.status,children:r.label}),(0,M.jsx)("span",{className:"ml-auto text-[11px] text-slate-600","data-testid":`run-step-duration-${e.sequence}`,children:(0,M.jsx)(j,{value:e.durationMs,unit:"ms",testId:`run-step-duration-value-${e.sequence}`})})]}),(0,M.jsxs)("div",{className:"space-y-2 px-4 pb-4",children:[e.durationMs!==null&&n>0&&(0,M.jsx)("div",{className:"h-2 rounded-full bg-slate-100",children:(0,M.jsx)("div",{className:`h-2 rounded-full ${r.bar}`,style:{width:`${e.durationMs/n*100}%`},"data-testid":`run-step-bar-${e.sequence}`})}),e.errorMessage!==null&&(0,M.jsxs)("p",{className:"wrap-anywhere text-[13px] text-red-700","data-testid":`run-step-error-${e.sequence}`,children:[e.errorCode===null?"":`${e.errorCode}: `,e.errorMessage,e.httpStatus===null?"":` (HTTP ${e.httpStatus})`]}),(0,M.jsx)($s,{step:e})]})]})},e.id)}var Ds=`${Is}: \u6728\u306E\u4E2D\u306E\u5834\u6240\u3092\u793A\u305B\u306A\u3044\u305F\u3081\u3001\u6BB5\u306E\u8A18\u9332\u306E ID \u3068\u5BFE\u8C61\u306E ID (#<\u6BB5\u306E\u8A18\u9332> \u2192 #<\u5BFE\u8C61>) \u3067\u540D\u6307\u3057\u307E\u3059\u3002`;function As({steps:e,longestDuration:t,opensEverything:n,testId:a}){let o=Mt(e);return(0,M.jsx)(ze,{occurrence:o,testId:a,children:(0,M.jsxs)("div",{className:"space-y-3",children:[(0,M.jsx)("p",{"data-testid":`${a}-reason`,children:Ds}),(0,M.jsx)("ol",{role:"list","data-testid":`${a}-list`,children:e.map(r=>ma(r,(0,M.jsx)("span",{"data-testid":`run-step-target-${r.sequence}`,children:`#${r.id} \u2192 #${r.targetMetadataId}`}),t,r.status==="FAILED"||n,"alert"))})]})})}function br({run:e}){T();let t=e.steps.reduce((o,r)=>r.durationMs===null?o:Math.max(o,r.durationMs),0),n=e.steps.length<=Ss,a=(0,fr.useMemo)(()=>Ps(e),[e]);return(0,M.jsx)("ol",{"data-cui-migration":"pending",className:"space-y-3","data-testid":"run-steps",children:a.map(o=>{if(o.kind==="step"){let l=o.step,i=(0,M.jsxs)(M.Fragment,{children:[Ot(l.stepKey),l.targetMetadataId!==e.metadataId&&(0,M.jsxs)("span",{className:"ml-2 rounded-sm bg-slate-100 px-1.5 py-0.5 font-normal text-[11px] text-slate-600","data-testid":`run-step-target-${l.sequence}`,children:["\u5BFE\u8C61 #",l.targetMetadataId]})]});return ma(l,i,t,l.status==="FAILED"||n,"timeline")}let r=o.steps.some(l=>l.status==="FAILED"),u=_s.map(l=>({status:l,count:o.steps.filter(i=>i.status===l).length})).filter(({count:l})=>l>0);return(0,M.jsx)("li",{className:"rounded-lg border border-slate-200 border-solid","data-testid":`run-step-group-${o.stepKey}`,"data-count":o.steps.length,children:(0,M.jsxs)("details",{open:r||o.pathless.length>0||n,className:"group/fanout","data-testid":`run-step-group-card-${o.stepKey}`,children:[(0,M.jsxs)("summary",{className:"flex cursor-pointer list-none flex-wrap items-center gap-2 p-4 [&::-webkit-details-marker]:hidden",children:[(0,M.jsx)("span",{"aria-hidden":"true",className:"text-[11px] text-slate-500 transition-transform group-open/fanout:rotate-90",children:"\u25B6"}),(0,M.jsx)("span",{className:"font-semibold text-[13px] text-slate-900",children:Ot(o.stepKey)}),(0,M.jsxs)("span",{className:"rounded-sm bg-slate-100 px-1.5 py-0.5 text-[11px] text-slate-600","data-testid":`run-step-group-count-${o.stepKey}`,children:["\u5BFE\u8C61 ",o.steps.length," \u4EF6"]}),(0,M.jsx)("span",{className:"text-[11px] text-slate-600","data-testid":`run-step-group-statuses-${o.stepKey}`,children:u.map(({status:l,count:i})=>`${xn[l].label} ${i}`).join(" \xB7 ")})]}),(0,M.jsxs)("div",{className:"space-y-3 px-4 pb-4 [&_li+li]:mt-3 [&_li>div+div]:mt-3",children:[o.pathless.length>0&&(0,M.jsx)(As,{steps:o.pathless,longestDuration:t,opensEverything:n,testId:`run-step-group-pathless-${o.stepKey}`}),o.placed.length>0&&(0,M.jsx)(En,{items:o.placed,renderItem:(l,i)=>l.map(x=>ma(x,(0,M.jsx)("span",{"data-testid":`run-step-target-${x.sequence}`,children:`${i} (#${x.targetMetadataId})`}),t,x.status==="FAILED"||n,"tree")),testId:`run-step-tree-${o.steps[0].sequence}`})]})]})},`group-${o.stepKey}`)})})}var d=require("react/jsx-runtime"),Ms={fontSize:`${Ft.TOKENS.type.title.size}px`,fontWeight:Ft.TOKENS.weight.bold},Os={fontSize:`${mt}px`,fontWeight:Ft.TOKENS.weight.bold},fa={RUNNING:"info",SUCCEEDED:"success",FAILED:"danger",FAILED_RETRY_SCHEDULED:"warning"};function xr({host:e,fromStateId:t,toStateId:n,rescueTarget:a}){let o={fromStateId:t,toStateId:n},r=Fn(`${t}:${n}`,l=>e.compare(o,l),0),u=Ze(a);return r.state.kind==="failed"?(0,d.jsx)(vt,{failure:r.state,onReload:r.reload,forbiddenMessage:st,failureMessage:ot("\u6BD4\u8F03"),rescueRef:u,testId:"history-comparison-failed"}):r.state.kind!=="ready"?(0,d.jsx)("p",{"aria-busy":"true","data-testid":"history-comparison-loading",children:"\u6BD4\u8F03\u3092\u8AAD\u307F\u8FBC\u3093\u3067\u3044\u307E\u3059\u2026"}):(0,d.jsx)(mr,{states:o,comparison:r.state.value,readLines:e.readLines,rescueTarget:a,testId:"history-change"})}function ya(e,t,n){let a=Fa(e,t);return[e.runOutcome==="FAILED"?(0,d.jsx)("span",{"data-testid":`${n}-failed-run`,"data-state-mark":"failed_run",children:Xn},"failed"):null,a.length>0?(0,d.jsx)("span",{"data-testid":`${n}-unrecorded-runs`,"data-state-mark":"unrecorded_runs",children:Jn(a)},"unrecorded"):null,e.modelOnlyChange?(0,d.jsx)("span",{"data-testid":`${n}-model-only`,"data-state-mark":"model_only",children:jn},"model"):null].filter(o=>o!==null)}function Fs(e,t){return e.changes===null?null:(0,d.jsx)("span",{"data-testid":`${t}-badges`,children:e.changes.map(n=>(0,d.jsx)(Ge,{tone:"neutral",variant:"tint",testId:`${t}-badge-${n.facet}`,children:Wt(n)},n.facet))})}function Us({pinned:e,shown:t,onPin:n,onUnpin:a,fallback:o}){let r=(0,ie.useRef)(null),u=(0,ie.useRef)(null),l=Ze(()=>u.current??r.current??o()),i=(0,ie.useCallback)(P=>(p=>{P.current=p;let D=l(p);return()=>{P.current=null,D()}}),[l]),[x]=(0,ie.useState)(()=>i(r)),[O]=(0,ie.useState)(()=>i(u));return e!==null?(0,d.jsxs)("p",{"data-testid":"history-pin",children:[(0,d.jsx)(Ge,{tone:"info",variant:"tint",testId:"history-pin-badge",children:"\u6BD4\u8F03\u306E\u8D77\u70B9"})," ",We(e.revision)," ",(0,d.jsx)(ge,{iso:e.settledAt,testId:"history-pin-settled-at-value"})," ",(0,d.jsx)(Ne,{variant:"secondary",onClick:a,ref:O,testId:"history-unpin",children:"\u5916\u3059"})]}):t===null?null:(0,d.jsx)("p",{"data-testid":"history-pin",children:(0,d.jsx)(Ne,{variant:"secondary",onClick:()=>n(t.stateId),ref:x,testId:"history-pin-button",children:"\u6BD4\u8F03\u306E\u8D77\u70B9\u306B\u3059\u308B"})})}function Ks({host:e,metadataId:t,target:n,openRequest:a,onClose:o,returnFocusFallback:r,captureState:u}){let{labels:l,announce:i}=T(),x=(0,ie.useId)(),O=(0,ie.useId)(),P=(0,ie.useId)(),p=(0,ie.useRef)(null),D=(0,ie.useRef)(null),K=(0,ie.useRef)(null),m=(0,ie.useRef)(null),R=(0,ie.useRef)(null),N=(0,ie.useRef)(null),F=(0,ie.useRef)(r),W=(0,ie.useRef)(0),[Q,ue]=(0,ie.useState)(null),[te,q]=(0,ie.useState)(null),[de,Se]=(0,ie.useState)({metadataId:t,groups:{}});de.metadataId!==t&&Se({metadataId:t,groups:{}});let[k,Z]=(0,ie.useState)(null),Y=Fn(t,b=>e.loadHistory(t,b),a),_e=Ze(()=>D.current),Xe=Ze(()=>D.current),De=Y.state.kind==="ready"?Y.state.refreshFailure:null,Ie=Mt(De),$e=Y.state.kind==="ready"&&Y.state.refreshing,le=Y.state.kind==="ready"?Y.state.value:null,E=le===null?null:Oa(le),X=Q!==null&&Q.request===a?Q.key:E===null?null:Ua(n,E),B=E?.groups.flatMap(b=>b.items).find(b=>b.key===X),se=B===void 0||$e?null:`revision:${B.kind==="run"?B.run.revision:B.state.revision}`,ve=Ze(()=>X===null?D.current:K.current);(0,ie.useEffect)(()=>{F.current=r},[r]),(0,ie.useEffect)(()=>{if(R.current!==a){R.current=a,N.current=null;let b=document.activeElement;p.current?.contains(b)!==!0&&(m.current=(b instanceof HTMLElement||b instanceof SVGElement)&&b!==document.body?b:null),D.current?.focus();return}X!==null&&X===N.current&&(N.current=null,K.current?.focus())},[a,X]),(0,ie.useEffect)(()=>{se!==null&&Se(b=>b.groups[se]===!0?b:{metadataId:b.metadataId,groups:{...b.groups,[se]:!0}})},[se,a]),(0,ie.useEffect)(()=>()=>{R.current=null,W.current+=1;let b=m.current;if(b?.isConnected){b.focus();return}F.current()?.focus()},[]);let oe=b=>{b.key==="Escape"&&(b.stopPropagation(),o())},Fe=b=>{if(b===X){K.current?.focus();return}N.current=b,ue({request:a,key:b})},f=b=>{W.current+=1;let w=W.current,U=k?.metadataId===t?k.failure:null;Z({metadataId:t,busy:!0,failure:U}),b(t).then(z=>{if(W.current===w){if(z.ok){Z({metadataId:t,busy:!1,failure:null}),i(z.value.outcome==="RECORDED"?"\u8A18\u9332\u3057\u307E\u3057\u305F":"\u524D\u306E\u8A18\u9332\u304B\u3089\u5909\u5316\u306F\u3042\u308A\u307E\u305B\u3093"),Y.refresh();return}Z({metadataId:t,busy:!1,failure:{status:z.status,reason:z.reason,occurrence:(U?.occurrence??0)+1}})}})},H=()=>{if(Y.state.kind==="failed")return(0,d.jsx)(vt,{failure:Y.state,onReload:Y.reload,forbiddenMessage:st,failureMessage:ot("\u6587\u66F8\u306E\u5C65\u6B74"),rescueRef:_e,testId:"history-failed"});if(le===null||E===null)return(0,d.jsx)("p",{"aria-busy":"true","data-testid":"history-loading",children:"\u6587\u66F8\u306E\u5C65\u6B74\u3092\u8AAD\u307F\u8FBC\u3093\u3067\u3044\u307E\u3059\u2026"});let b=E.states,w=E.runs[0],U=u!==void 0&&w!==void 0&&!b.some(V=>V.runId===w.id),z=k?.metadataId===t?k:null,ye=b[0];return(0,d.jsxs)("div",{ref:Xe,"data-testid":"history-content",children:[(0,d.jsxs)("dl",{"data-testid":"history-document",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("dt",{children:"URI"}),(0,d.jsx)("dd",{style:{overflowWrap:"anywhere"},"data-testid":"history-document-uri",children:le.document.fileUri})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("dt",{children:"\u73FE\u5728\u306E\u7248"}),(0,d.jsx)("dd",{"data-testid":"history-document-revision",children:We(le.document.revision)})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("dt",{children:"\u6A5F\u5BC6\u533A\u5206"}),(0,d.jsx)("dd",{"data-testid":"history-document-confidentiality",children:le.document.confidentialityLevel})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("dt",{children:"\u7248\u306E\u6570"}),(0,d.jsx)("dd",{"data-testid":"history-document-revisions",children:E.groups.length})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("dt",{children:"\u6700\u5F8C\u306E\u5909\u5316"}),(0,d.jsx)("dd",{"data-testid":"history-document-last-change",children:ye===void 0?"\u8A18\u9332\u306A\u3057":(0,d.jsx)(ge,{iso:ye.settledAt,testId:"history-document-last-change-value"})})]})]}),De!==null&&(0,d.jsx)(ze,{occurrence:Ie,testId:"history-refresh-failed",children:Yt(l,De,"\u6587\u66F8\u306E\u5C65\u6B74")}),U&&(0,d.jsx)("p",{"data-testid":"history-capture",children:(0,d.jsx)(Ne,{variant:"primary",busy:z?.busy===!0,busyLabel:l.loading,onClick:()=>f(u),ref:ve,testId:"history-capture-button",children:"\u4ECA\u306E\u72B6\u614B\u3092\u8A18\u9332"})}),z!==null&&z.failure!==null&&(0,d.jsx)(ze,{occurrence:z.failure.occurrence,testId:"history-capture-failed",children:l.failureSentence(z.failure,"\u6587\u66F8\u306E\u72B6\u614B\u3092\u8A18\u9332\u3059\u308B\u6A29\u9650\u304C\u3042\u308A\u307E\u305B\u3093\u3002",V=>`\u6587\u66F8\u306E\u72B6\u614B\u3092\u8A18\u9332\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F${(0,Ft.reasonAside)(V)}\u3002`)}),b.length===0&&E.runs.length===0&&E.marks.length===0?(0,d.jsx)("p",{role:"status","data-testid":"history-empty",children:"\u3053\u306E\u6587\u66F8\u306B\u306F\u307E\u3060\u8A18\u9332\u304C\u3042\u308A\u307E\u305B\u3093\u3002"}):(0,d.jsx)(on,{master:Ue(E),detail:Ke(E),masterMinPx:Ha,detailMinPx:Va,testId:"history-master-detail"})]})},pe=de.groups,me=(b,w)=>pe[b]??w,Ce=(b,w)=>Se({metadataId:t,groups:{...pe,[b]:!me(b,w)}}),Ve=te!==null&&te.request===a?te.stateId:null,Ue=b=>(0,d.jsxs)("div",{"data-testid":"history-timeline",children:[b.marks.length>0&&(0,d.jsxs)("div",{"data-testid":"history-restricted-group",children:[(0,d.jsxs)(Ne,{variant:"secondary",expanded:me("restricted",!1),controls:`${O}-restricted`,onClick:()=>Ce("restricted",!1),testId:"history-restricted-toggle",children:["\u9694\u96E2\u3055\u308C\u3066\u3044\u305F\u671F\u9593\u306E\u8A18\u9332 (",b.marks.length," \u4EF6)"]}),(0,d.jsx)("ul",{role:"list",id:`${O}-restricted`,hidden:!me("restricted",!1),"aria-label":"\u9694\u96E2\u3055\u308C\u3066\u3044\u305F\u671F\u9593\u306E\u8A18\u9332",children:b.marks.map(({key:w,mark:U})=>(0,d.jsx)("li",{"data-restricted-mark":U.subject,"data-testid":"history-restricted-mark",children:U.subject==="state"?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("span",{children:Wn})," ",(0,d.jsx)(ge,{iso:U.settledAt,testId:`history-${w}-settled-at-value`})]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("span",{children:zt})," ",(0,d.jsx)(Ge,{tone:fa[U.status],variant:"tint",testId:`history-${w}-status`,children:et[U.status].label})," ",(0,d.jsx)(ge,{iso:U.startedAt,testId:`history-${w}-started-at-value`})," \u301C ",(0,d.jsx)(Ct,{iso:U.finishedAt,testId:`history-${w}-finished-at-value`})]})},w))})]}),b.groups.map(w=>{let U=`revision:${w.revision}`,z=me(U,w.isCurrent),ye=`${We(w.revision)}${w.isCurrent?" (\u73FE\u5728\u306E\u7248)":""}`;return(0,d.jsxs)("div",{"data-testid":"history-revision-group","data-revision":w.revision,"data-current":w.isCurrent,children:[(0,d.jsx)(Ne,{variant:"secondary",expanded:z,controls:`${O}-${U}`,onClick:()=>Ce(U,w.isCurrent),testId:`history-revision-toggle-${w.revision}`,children:`${ye} \u2014 ${w.items.length} \u4EF6`}),(0,d.jsx)("div",{id:`${O}-${U}`,hidden:!z,children:(0,d.jsx)(cn,{label:ye,items:w.items,itemKey:V=>V.key,selectedKey:X,onSelect:V=>Fe(V.key),detailId:O,renderRow:V=>nt(V,b),rowTestId:"history-item",rowData:V=>({"data-item-key":V.key,"data-pinned":V.state!==null&&V.state.stateId===Ve}),empty:"\u3053\u306E\u7248\u306E\u8A18\u9332\u306F\u3042\u308A\u307E\u305B\u3093\u3002",testId:`history-revision-list-${w.revision}`})})]},U)})]}),nt=(b,w)=>{let U=b.state,z=`history-row-${b.key}`,ye=U===null?[]:ya(U,w,z);return(0,d.jsxs)(d.Fragment,{children:[b.kind==="run"?(0,d.jsxs)("span",{children:["\u5B9F\u884C #",b.run.id," \xB7 ",hn[b.run.trigger]," ",(0,d.jsx)(Ge,{tone:fa[it(b.run)],variant:"tint",testId:`${z}-status`,children:et[it(b.run)].label})]}):(0,d.jsx)("span",{children:Et[b.state.cause]}),(0,d.jsx)("span",{children:(0,d.jsx)(ge,{iso:b.time,testId:`${z}-time-value`})}),U!==null&&Fs(U,z),b.kind==="run"&&Zn(b.run)&&(0,d.jsx)("span",{"data-testid":`${z}-unrecorded`,children:yn}),ye,U!==null&&U.stateId===Ve&&(0,d.jsx)(Ge,{tone:"info",variant:"tint",testId:`${z}-pinned`,children:"\u6BD4\u8F03\u306E\u8D77\u70B9"})]})},ke=(b,w)=>{let U=w.states.find(he=>he.stateId===Ve)??null,z=(0,d.jsx)(Us,{pinned:U,shown:b,onPin:he=>q({request:a,stateId:he}),onUnpin:()=>q(null),fallback:()=>K.current});if(b===null)return z;let ye=()=>K.current,V;if(U!==null&&U.stateId!==b.stateId){let[he,Tt]=w.states.indexOf(U)>w.states.indexOf(b)?[U,b]:[b,U];V=(0,d.jsx)(xr,{host:e,fromStateId:he.stateId,toStateId:Tt.stateId,rescueTarget:ye})}else b.previousStateId===null?V=(0,d.jsx)("p",{"data-testid":"history-no-previous",children:Yn}):V=(0,d.jsx)(xr,{host:e,fromStateId:b.previousStateId,toStateId:b.stateId,rescueTarget:ye});return(0,d.jsxs)(d.Fragment,{children:[z,V]})},at=b=>{if(B===void 0)return"\u8A18\u9332\u306E\u8A73\u7D30";let w=B.state,U=b.states.find(z=>z.stateId===Ve);if(U!==void 0&&w!==null&&U.stateId!==w.stateId){let[z,ye]=b.states.indexOf(U)>b.states.indexOf(w)?[U,w]:[w,U];return`\u6BD4\u8F03: ${We(z.revision)} \u2192 ${We(ye.revision)}`}return B.kind==="run"?`${We(B.run.revision)} \u306E\u5B9F\u884C #${B.run.id}`:`${We(B.state.revision)} \u306E\u5909\u5316`},Ae=b=>{if(X===null)return b.groups.some(ye=>ye.items.length>0)?(0,d.jsx)("p",{"data-testid":"history-select-prompt",children:"\u6642\u7CFB\u5217\u304B\u3089\u8A18\u9332\u3092\u9078\u3076\u3068\u3001\u305D\u306E\u5909\u5316\u3092\u793A\u3057\u307E\u3059\u3002"}):(0,d.jsx)("p",{role:"status","data-testid":"history-no-selectable",children:"\u9078\u3079\u308B\u8A18\u9332\u306F\u3042\u308A\u307E\u305B\u3093\u3002"});if(B===void 0&&$e)return(0,d.jsx)("p",{"aria-busy":"true","data-testid":"history-detail-loading",children:"\u6587\u66F8\u306E\u5C65\u6B74\u3092\u8AAD\u307F\u8FBC\u3093\u3067\u3044\u307E\u3059\u2026"});if(B===void 0)return(0,d.jsxs)("p",{role:"status","data-testid":"history-selection-missing",children:[X.startsWith("run:")?`\u5B9F\u884C #${X.slice(4)} \u306F`:"\u9078\u3093\u3060\u72B6\u614B\u306F","\u3053\u306E\u6587\u66F8\u306E\u5C65\u6B74\u306B\u3042\u308A\u307E\u305B\u3093\u3002"]});if(B.kind==="state"){let{state:ye}=B;return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("dl",{"data-testid":"history-state-summary",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("dt",{children:"\u5951\u6A5F"}),(0,d.jsx)("dd",{"data-testid":"history-state-cause",children:Et[ye.cause]})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("dt",{children:"\u6642\u523B"}),(0,d.jsx)("dd",{children:(0,d.jsx)(ge,{iso:ye.settledAt,testId:"history-state-settled-at-value"})})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("dt",{children:"\u64CD\u4F5C\u8005"}),(0,d.jsx)("dd",{style:{overflowWrap:"anywhere"},"data-testid":"history-state-actor",children:ye.actor})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("dt",{children:"\u6A5F\u5BC6\u533A\u5206"}),(0,d.jsx)("dd",{"data-testid":"history-state-confidentiality",children:ye.classification.confidentialityLevel})]})]}),ya(ye,b,"history-detail"),ke(ye,b)]})}let{run:w,state:U}=B,z=it(w);return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("dl",{"data-testid":"history-run-summary","data-run-id":w.id,children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("dt",{children:"\u304D\u3063\u304B\u3051"}),(0,d.jsx)("dd",{"data-testid":"history-run-trigger","data-trigger":w.trigger,children:hn[w.trigger]})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("dt",{children:"\u8A66\u884C"}),(0,d.jsx)("dd",{"data-testid":"history-run-attempt",children:w.attempt})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("dt",{children:"\u72B6\u614B"}),(0,d.jsx)("dd",{children:(0,d.jsx)(Ge,{tone:fa[z],variant:"tint",testId:"history-run-status",dataAttributes:{"data-status":w.status,"data-presentation":z},children:et[z].label})})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("dt",{children:"\u7A2E\u985E"}),(0,d.jsx)("dd",{"data-testid":"history-run-kind",children:ta(w.documentKind)})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("dt",{children:"\u8981\u6C42\u8005"}),(0,d.jsx)("dd",{style:{overflowWrap:"anywhere"},"data-testid":"history-run-requested-by",children:w.requestedBy})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("dt",{children:"\u958B\u59CB"}),(0,d.jsx)("dd",{children:(0,d.jsx)(ge,{iso:w.startedAt,testId:"history-run-started-at-value"})})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("dt",{children:"\u7D42\u4E86"}),(0,d.jsx)("dd",{"data-testid":"history-run-finished-at",children:(0,d.jsx)(Ct,{iso:w.finishedAt,testId:"history-run-finished-at-value"})})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("dt",{children:"\u30B8\u30E7\u30D6"}),(0,d.jsx)("dd",{style:{overflowWrap:"anywhere"},"data-testid":"history-run-job-id",children:w.jobId})]})]}),w.errorMessage!==null&&(0,d.jsx)("p",{style:{overflowWrap:"anywhere"},"data-testid":"history-run-error",children:w.errorMessage}),Zn(w)&&(0,d.jsx)("p",{"data-testid":"history-run-unrecorded",children:yn}),U===null?(0,d.jsx)("p",{"data-testid":"history-run-no-state",children:"\u3053\u306E\u5B9F\u884C\u304C\u4F5C\u3063\u305F\u72B6\u614B\u306F\u3042\u308A\u307E\u305B\u3093\u3002"}):ya(U,b,"history-detail"),ke(U,b),(0,d.jsxs)("details",{"data-testid":"history-run-steps",children:[(0,d.jsx)("summary",{children:"\u6BB5\u306E\u6642\u7CFB\u5217"}),(0,d.jsx)(br,{run:w})]})]})},Ke=b=>(0,d.jsxs)("section",{id:O,"aria-labelledby":P,"data-testid":"history-detail","data-selected-key":X??"",children:[(0,d.jsx)("h3",{ref:K,id:P,tabIndex:-1,style:Os,"data-testid":"history-detail-heading",children:at(b)}),Ae(b)]});return(0,d.jsxs)("section",{"data-cui-migration":"pending",ref:p,role:"dialog","aria-labelledby":x,onKeyDown:oe,"data-testid":"history-inspector","data-metadata-id":t,"data-cui-surface":"surface","data-cui-fg":"fg","data-cui-type":"body","data-cui-face":"sans",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("h2",{ref:D,id:x,tabIndex:-1,style:Ms,"data-testid":"history-heading",children:le===null?"\u6587\u66F8\u306E\u5C65\u6B74":`\u6587\u66F8\u306E\u5C65\u6B74 \u2014 ${le.document.fileName}`}),(0,d.jsx)(Ne,{variant:"secondary",onClick:o,testId:"history-close",children:l.close})]}),H()]})}var be=require("@aiquants/enrichment-core"),ne=require("react");var ga=require("@aiquants/console-ui/core");function ft(e,t,n){try{(0,ga.formatCount)(e,n)}catch(a){throw new RangeError(`${t}: ${a.message}`,{cause:a})}return e}function Rn(e,t,n){return(0,ga.formatCount)(ft(e,t,n),n)}var vr=1024,Bs=[{name:"B",power:0,fractionDigits:0},{name:"KiB",power:1,fractionDigits:1},{name:"MiB",power:2,fractionDigits:1},{name:"GiB",power:3,fractionDigits:2},{name:"TiB",power:4,fractionDigits:2}];function hr(e,t){return Number((e/vr**t.power).toFixed(t.fractionDigits))}function _n(e,t,n){ft(e,t,n);let[a,...o]=Bs,r=a,u=hr(e,r);for(let l of o){if(u<vr)break;r=l,u=hr(e,r)}return`${new Intl.NumberFormat(n,{minimumFractionDigits:r.fractionDigits,maximumFractionDigits:r.fractionDigits,useGrouping:!0}).format(u)} ${r.name}`}var s=require("react/jsx-runtime"),Nr="\u53D6\u308A\u8FBC\u307F\u306E\u8A18\u9332\u306A\u3057",Hs=new Set(be.EnrichmentSyncStatusSchema.options.filter(e=>e.startsWith("FAILED"))),Vs=new Set(be.EnrichmentSyncStatusSchema.options);function Er(e){return e.isCurrent===!1?{kind:"blocked",reason:"\u65E7\u7248\u306E\u305F\u3081\u518D\u5B9F\u884C\u4E0D\u53EF"}:e.syncStatus==="SYNCED"?{kind:"resync"}:Hs.has(e.syncStatus)?{kind:"retry"}:Vs.has(e.syncStatus)?{kind:"blocked",reason:"\u51E6\u7406\u4E2D"}:{kind:"blocked",reason:"\u4E0D\u660E\u306A\u72B6\u614B"}}function Sr(e,t,n){let a=e?.find(o=>o.confidentialityLevel===t&&o.capability===n);return a?a.isEnabled:null}var Gs={PUBLIC:"\u5168\u516C\u958B",INTERNAL:"\u793E\u5185\u5171\u6709",DEPARTMENT:"\u90E8\u9580\u9650\u5B9A",CONFIDENTIAL:"\u6A5F\u5BC6 - \u65E2\u5B9A",RESTRICTED:"\u691C\u7D22\u5B8C\u5168\u9664\u5916\u30FB\u4FDD\u8B77"},qs=["\u5951\u7D04\u66F8","\u6C7A\u7B97\u77ED\u4FE1","\u6280\u8853\u4ED5\u69D8\u66F8","\u793E\u5185\u898F\u7A0B","\u8B70\u4E8B\u9332","\u4EBA\u4E8B\u65B9\u91DD"];function zs(e){return/[A-Za-z0-9]$/.test(e)?`${e} `:e}function ba({field:e}){return(0,s.jsx)("span",{className:"text-red-700","data-testid":`ingest-required-mark-${e}`,children:"*"})}function Ws({policies:e,tenantId:t,sources:n,domainOptions:a,recentItems:o=[],inspectionResult:r=null,isSubmitting:u=!1,isInspecting:l=!1,isBusy:i=!1,promotingId:x=null,onInspectUri:O,onIngestDocument:P,onRetryItem:p,onShowHistory:D,onPromoteUnlockedCopy:K,listRefusal:m}){let{formatLocale:R}=T(),N=Dt(),F=(0,ne.useRef)(new Map),W=(0,ne.useRef)(null),Q=(0,ne.useId)(),ue=(0,ne.useId)(),te=(0,ne.useId)(),q=(0,ne.useId)(),de=(0,ne.useId)(),Se=(0,ne.useId)(),k=(0,ne.useId)(),Z=(0,ne.useId)(),[Y,_e]=(0,ne.useState)(null),[Xe,De]=(0,ne.useState)(""),[Ie,$e]=(0,ne.useState)(""),[le,E]=(0,ne.useState)("CONFIDENTIAL"),[X,B]=(0,ne.useState)(null),[se,ve]=(0,ne.useState)(""),[oe,Fe]=(0,ne.useState)(""),[f,H]=(0,ne.useState)([]),[pe,me]=(0,ne.useState)(""),[Ce,Ve]=(0,ne.useState)("user"),[Ue,nt]=(0,ne.useState)(1),[ke,at]=(0,ne.useState)(!1),Ae=X!==null&&a.some(c=>c.key===X)?X:a.length>0?a[0].key:null,Ke=Y===null?void 0:n.find(c=>c.uri_prefix===Y),b=Ke!==void 0?Ke:n.length>0?n[0]:null,w=(0,ne.useMemo)(()=>({vectorEnabled:Sr(e,le,"vector_indexing"),graphEnabled:Sr(e,le,"graph_indexing")}),[e,le]),U=(0,ne.useMemo)(()=>{let c=Ie.trim();if(!c||n.length===0)return{valid:!1,error:null};let _=(0,be.sourceOfUri)(n,c);if(_===void 0)return{valid:!1,error:`\u8A31\u53EF\u3055\u308C\u305F\u30B9\u30AD\u30FC\u30E0 (${n.map(Qe=>Qe.uri_prefix).join(", ")}) \u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002`};let S=c.slice(_.uri_prefix.length);return S.trim()?c.includes("..")?{valid:!1,error:"\u76F8\u5BFE\u30D1\u30B9\u8A18\u53F7 (..) \u306B\u3088\u308B\u30D1\u30B9\u30C8\u30E9\u30D0\u30FC\u30B5\u30EB\u306F\u7981\u6B62\u3055\u308C\u3066\u3044\u307E\u3059\u3002"}:(0,be.identifierMatches)(_,S)?{valid:!0,error:null}:{valid:!1,error:`${zs(_.title.ja)}\u306E\u8B58\u5225\u5B50\u306E\u5F62\u3067\u306F\u3042\u308A\u307E\u305B\u3093 (\u4F8B: ${_.input_example})\u3002`}:{valid:!1,error:"URI \u306E\u30D1\u30B9\u90E8\u5206\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002"}},[Ie,n]),z=c=>{if(_e(c),Xe.trim()){let _=Xe.trim(),S=(0,be.sourceOfUri)(n,_),Qe=S===void 0?_:_.slice(S.uri_prefix.length);$e(`${c}${Qe}`)}else $e("")},ye=c=>{let _=c.trim();if(!_){De(""),$e("");return}let S=(0,be.pastedIdentifier)(n,_);if(S!==void 0){_e(S.source.uri_prefix),De(S.identifier),$e(`${S.source.uri_prefix}${S.identifier}`);return}let Qe=(0,be.sourceOfUri)(n,_);if(Qe!==void 0){_e(Qe.uri_prefix),De(_.slice(Qe.uri_prefix.length)),$e(_);return}if(_.includes("://")){De(c),$e(_);return}De(c),$e(b===null?_:`${b.uri_prefix}${_}`)},V=()=>{let c=pe.trim();c&&(f.some(_=>_.labelKey===c)||(H(_=>[..._,{labelKey:c,category:Ce,confidenceScore:Number(Ue.toFixed(2))}]),me("")))},he=c=>{f.some(_=>_.labelKey===c)||H(_=>[..._,{labelKey:c,category:"domain",confidenceScore:1}])},Tt=c=>{H(_=>_.filter(S=>S.labelKey!==c))},Bt=c=>{if(c.preventDefault(),!U.valid||Ae===null)return;let _={fileUri:Ie.trim(),confidentialityLevel:le,targetDomainKey:Ae,departmentId:se.trim()?Number(se):null,titleOverride:oe.trim()?oe.trim():null,labels:f};P?.(_)};(0,ne.useLayoutEffect)(()=>{let c=W.current;if(c===null)return;let _=o.find(S=>S.kind==="readable"&&S.item.id===c)?.item;_?.unlock?.disposition==="copy_promoted"&&(W.current=null,document.activeElement===document.body&&F.current.get(c)?.focus(),N(`${_.fileName} \u306E\u6E90\u3092\u89E3\u3044\u305F\u5199\u3057\u3067\u4E0A\u66F8\u304D\u3057\u307E\u3057\u305F\u3002`))},[o,N]);let Ln=c=>{let _=c.unlock;if(_===null)return null;let S=_.disposition==="copy_original"&&_.copyReason!==null&&(0,be.isPromotable)(_.copyReason)&&c.isCurrent!==!1,Qe=x===c.id,wa=Qe?"\u6E90\u3092\u5199\u3057\u3067\u4E0A\u66F8\u304D\u4E2D...":"\u6E90\u3092\u5199\u3057\u3067\u4E0A\u66F8\u304D";return(0,s.jsxs)("div",{ref:Pa=>{Pa===null?F.current.delete(c.id):F.current.set(c.id,Pa)},tabIndex:-1,className:"mt-1 max-w-xs space-y-1 text-[11px] text-slate-700","data-testid":`ingest-unlock-${c.id}`,"data-disposition":_.disposition,"data-protection":_.protectionScheme,children:[(0,s.jsxs)("div",{children:["\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u5916\u3057\u305F: ",be.PROTECTION_SCHEME_LABELS[_.protectionScheme]]}),(0,s.jsxs)("div",{"data-testid":`ingest-unlock-disposition-${c.id}`,children:[be.UNLOCK_DISPOSITION_LABELS[_.disposition],_.copyReason!==null&&` (${be.COPY_REASON_LABELS[_.copyReason]})`]}),S&&K!==void 0&&(0,s.jsx)("button",{type:"button",onClick:()=>{W.current=c.id,K(c.id)},disabled:i,"aria-busy":Qe,"aria-label":`${c.fileName} \u306E${wa}`,className:"min-h-11 rounded-sm border border-slate-300 border-solid bg-white px-2 py-0.5 font-semibold text-[11px] text-slate-700 hover:bg-slate-50 disabled:cursor-not-allowed disabled:bg-slate-100","data-testid":`ingest-promote-button-${c.id}`,children:wa})]})},g=c=>{let _=Er(c);if(_.kind==="blocked")return(0,s.jsx)("span",{className:"font-sans text-[11px] text-slate-500","data-testid":`ingest-action-blocked-${c.id}`,"data-reason":_.reason,children:_.reason});let S=_.kind==="retry";return(0,s.jsx)("button",{type:"button",onClick:()=>p?.(c.id),disabled:i,"aria-label":`${c.fileName} \u3092${S?"\u518D\u8A66\u884C":"\u518D\u540C\u671F"}`,className:S?"min-h-11 rounded-sm border border-red-200 border-solid bg-red-50 px-2 py-1 font-semibold text-red-700 text-xs hover:bg-red-100 disabled:cursor-not-allowed":"min-h-11 rounded-sm border border-emerald-200 border-solid bg-emerald-50 px-2 py-1 font-semibold text-emerald-700 text-xs hover:bg-emerald-100 disabled:cursor-not-allowed","data-testid":`ingest-${_.kind}-button-${c.id}`,children:S?"\u518D\u8A66\u884C":"\u518D\u540C\u671F"})},Re=c=>{switch(c){case"SYNCED":return(0,s.jsx)("span",{className:"inline-flex items-center rounded-full bg-emerald-100 px-2.5 py-0.5 font-semibold text-emerald-800 text-xs",children:"\u540C\u671F\u5B8C\u4E86"});case"PENDING":return(0,s.jsx)("span",{className:"inline-flex items-center rounded-full bg-slate-100 px-2.5 py-0.5 font-medium text-slate-800 text-xs",children:"\u5F85\u6A5F\u4E2D"});case"EXTRACTING":return(0,s.jsx)("span",{className:"inline-flex items-center rounded-full bg-blue-100 px-2.5 py-0.5 font-medium text-blue-800 text-xs",children:"\u672C\u6587\u62BD\u51FA\u4E2D"});case"ENRICHING":return(0,s.jsx)("span",{className:"inline-flex items-center rounded-full bg-purple-100 px-2.5 py-0.5 font-medium text-purple-800 text-xs",children:"AI \u8981\u7D04\u30FB\u69CB\u9020\u5316\u4E2D"});case"PROJECTING":return(0,s.jsx)("span",{className:"inline-flex items-center rounded-full bg-indigo-100 px-2.5 py-0.5 font-medium text-indigo-800 text-xs",children:"\u30D9\u30AF\u30C8\u30EB/\u30B0\u30E9\u30D5\u6295\u5F71\u4E2D"});default:return c.startsWith("FAILED")?(0,s.jsxs)("span",{className:"inline-flex items-center rounded-full bg-red-100 px-2.5 py-0.5 font-semibold text-red-800 text-xs",children:["\u5931\u6557: ",c]}):(0,s.jsx)("span",{className:"inline-flex items-center rounded-full bg-slate-100 px-2.5 py-0.5 font-medium text-slate-800 text-xs",children:c})}};return(0,s.jsxs)("div",{"data-cui-migration":"pending",className:"space-y-6","data-testid":"document-ingest-console",children:[(0,s.jsxs)("div",{className:"rounded-xl border border-slate-200 border-solid bg-white p-6 shadow-sm",children:[(0,s.jsxs)("div",{className:"flex flex-col justify-between gap-2 md:flex-row md:items-center",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h2",{className:"font-bold text-base text-slate-900",children:"\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u53D6\u308A\u8FBC\u307F & \u30E1\u30BF\u30C7\u30FC\u30BF\u751F\u6210"}),(0,s.jsx)("p",{className:"mt-1 text-slate-500 text-sm",children:"\u5BFE\u8C61 URI \u3092\u6307\u5B9A\u3057\u3066\u672C\u6587\u62BD\u51FA\u30FBAI \u8981\u7D04\u30FB\u69CB\u9020\u5316\u30E1\u30BF\u30C7\u30FC\u30BF\u4ED8\u4E0E\u30FBQdrant \u30D9\u30AF\u30C8\u30EB\u304A\u3088\u3073 Neo4j \u30B0\u30E9\u30D5\u3078\u306E\u6295\u5F71\u3092\u5B9F\u884C\u3057\u307E\u3059\u3002"})]}),(0,s.jsxs)("div",{className:"inline-flex items-center rounded-lg border border-slate-200 border-solid bg-slate-50 px-3 py-1.5 font-medium text-slate-600 text-xs",children:["\u30C6\u30CA\u30F3\u30C8: ",(0,s.jsx)("span",{className:"ml-1.5 font-bold text-slate-800",children:t})]})]}),(0,s.jsxs)("form",{onSubmit:Bt,className:"mt-6 space-y-6",children:[(0,s.jsxs)("div",{className:"space-y-3","data-testid":"document-uri-input-group",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,s.jsxs)("label",{htmlFor:Q,className:"block font-semibold text-slate-800 text-sm",children:["\u30D5\u30A1\u30A4\u30EB URI / \u30EA\u30BD\u30FC\u30B9\u8B58\u5225\u5B50 ",(0,s.jsx)(ba,{field:"uri"})]}),b!==null&&(0,s.jsxs)("span",{className:"font-mono text-slate-500 text-xs",children:["\u9078\u629E\u30B9\u30AD\u30FC\u30E0: ",(0,s.jsx)("strong",{className:"font-semibold text-indigo-600",children:b.uri_prefix})]})]}),b===null&&(0,s.jsx)(qe,{tone:"warning",testId:"ingest-no-sources",children:"\u53D6\u308A\u8FBC\u3081\u308B\u6E90\u304C\u914D\u5099\u306B\u3042\u308A\u307E\u305B\u3093\u3002"}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsx)("span",{className:"font-medium text-slate-500 text-xs",children:"\u30B9\u30AD\u30FC\u30E0\u6307\u5B9A:"}),n.map(c=>(0,s.jsx)("button",{type:"button",onClick:()=>z(c.uri_prefix),className:`rounded-sm border border-solid px-2.5 py-1 font-mono text-xs transition-colors ${b?.uri_prefix===c.uri_prefix?"border-indigo-600 bg-indigo-50 font-semibold text-indigo-700 shadow-sm":"border-slate-200 bg-slate-100 text-slate-700 hover:bg-slate-200"}`,"data-testid":`scheme-select-${c.scheme}`,children:`${c.scheme}:// (${c.title.ja})`},c.scheme))]}),(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsxs)("div",{className:"flex flex-wrap gap-2 sm:flex-nowrap",children:[(0,s.jsxs)("div",{className:`flex min-w-0 grow basis-full rounded-lg border border-solid shadow-sm transition-colors focus-within:ring-2 sm:basis-0 ${U.error?"border-red-300 focus-within:border-red-500 focus-within:ring-red-200":"border-slate-300 focus-within:border-indigo-500 focus-within:ring-indigo-100"}`,children:[(0,s.jsx)("span",{className:"inline-flex select-none items-center rounded-l-lg border-slate-200 border-r border-solid bg-slate-50 px-3.5 font-mono font-semibold text-slate-700 text-sm","data-testid":"scheme-prefix-badge",children:b?.uri_prefix}),(0,s.jsx)("input",{id:Q,type:"text",value:Xe,onChange:c=>ye(c.target.value),placeholder:b?.input_hint.ja,disabled:b===null,"aria-invalid":!!U.error,"aria-describedby":U.error?"ingest-uri-error":void 0,className:"min-w-0 flex-1 rounded-r-lg px-3.5 py-2 font-mono text-sm focus:outline-none","data-testid":"ingest-file-uri-input",required:!0})]}),(0,s.jsx)("button",{type:"button",onClick:()=>O?.(Ie.trim()),disabled:!U.valid||l||i,className:"inline-flex items-center justify-center rounded-lg border border-slate-300 border-solid bg-white px-4 py-2 font-medium text-slate-700 text-sm shadow-sm hover:bg-slate-50 disabled:opacity-50","data-testid":"ingest-inspect-uri-button",children:l?"\u691C\u8A3C\u4E2D...":"URI \u4E8B\u524D\u691C\u8A3C"})]}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-1 text-xs",children:[b!==null&&(0,s.jsx)("p",{className:"text-slate-500",children:b.guidance.ja}),Ie&&(0,s.jsxs)("div",{className:"flex items-center gap-1 font-mono text-slate-500",children:[(0,s.jsx)("span",{children:"\u89E3\u6C7A URI:"}),(0,s.jsx)("code",{className:"rounded-sm bg-slate-100 px-1.5 py-0.5 font-bold text-indigo-700","data-testid":"resolved-uri-code",children:Ie})]})]})]}),U.error&&(0,s.jsx)("p",{id:"ingest-uri-error",className:"text-red-600 text-xs",role:"alert","data-testid":"ingest-uri-error",children:U.error})]}),r&&r.fileUri===Ie.trim()&&(0,s.jsxs)("section",{"aria-live":"polite","aria-label":"\u30EA\u30BD\u30FC\u30B9\u691C\u8A3C\u7D50\u679C",className:`rounded-lg border border-solid p-4 text-sm transition-all ${r.exists?"border-emerald-200 bg-emerald-50/60 text-emerald-950":"border-red-200 bg-red-50/60 text-red-950"}`,"data-testid":"inspection-result-card",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("span",{className:"font-semibold",children:r.exists?"\u2713 \u30EA\u30BD\u30FC\u30B9\u78BA\u8A8D\u5B8C\u4E86 (\u30A2\u30AF\u30BB\u30B9\u53EF\u80FD)":"\u26A0 \u30EA\u30BD\u30FC\u30B9\u4E0D\u9054 (\u30D5\u30A1\u30A4\u30EB\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093)"}),(0,s.jsx)("span",{className:"font-mono text-slate-500 text-xs",children:r.fileUri})]}),r.exists&&(0,s.jsxs)("div",{className:"mt-2 grid grid-cols-2 gap-4 font-mono text-xs md:grid-cols-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"block text-slate-500",children:"\u30D5\u30A1\u30A4\u30EB\u540D:"}),(0,s.jsx)("span",{className:"font-semibold text-slate-800",children:r.fileName})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"block text-slate-500",children:"\u30B5\u30A4\u30BA:"}),(0,s.jsx)("span",{className:"font-semibold text-slate-800",children:(0,s.jsx)(He,{text:_n(r.fileSize,"fileSize",R),testId:"inspection-file-size-value"})})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"block text-slate-500",children:"MIME:"}),(0,s.jsx)("span",{className:"font-semibold text-slate-800",children:r.mimeType})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"block text-slate-500",children:"\u30EA\u30D3\u30B8\u30E7\u30F3:"}),(0,s.jsx)("span",{className:"font-semibold text-slate-800",children:r.revisionId?.slice(0,8)??"N/A"})]})]})]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-3",children:[(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsxs)("label",{htmlFor:ue,className:"block font-semibold text-slate-700 text-xs",children:["\u6A5F\u5BC6\u533A\u5206 (Confidentiality Level) ",(0,s.jsx)(ba,{field:"confidentiality"})]}),(0,s.jsx)("select",{id:ue,value:le,onChange:c=>E(c.target.value),className:"w-full rounded-lg border border-slate-300 border-solid bg-white px-3 py-2 text-slate-800 text-sm focus:border-indigo-500 focus:outline-none focus:ring-1 focus:ring-indigo-500","data-testid":"ingest-confidentiality-select",children:be.ConfidentialityLevelSchema.options.map(c=>(0,s.jsxs)("option",{value:c,children:[c," (",Gs[c],")"]},c))})]}),(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsxs)("label",{htmlFor:te,className:"block font-semibold text-slate-700 text-xs",children:["\u5BFE\u8C61\u30C9\u30E1\u30A4\u30F3 (Target Domain) ",(0,s.jsx)(ba,{field:"domain"})]}),(0,s.jsx)("select",{id:te,value:Ae===null?"":Ae,onChange:c=>B(c.target.value),disabled:a.length===0,className:"w-full rounded-lg border border-slate-300 border-solid bg-white px-3 py-2 text-slate-800 text-sm focus:border-indigo-500 focus:outline-none focus:ring-1 focus:ring-indigo-500 disabled:cursor-not-allowed disabled:bg-slate-100","data-testid":"ingest-domain-select",children:a.map(c=>(0,s.jsx)("option",{value:c.key,children:c.label},c.key))}),a.length===0&&(0,s.jsx)("p",{className:"text-[11px] text-amber-800","data-testid":"ingest-domain-empty",children:"\u9078\u3079\u308B\u30C9\u30E1\u30A4\u30F3\u304C\u6E21\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002\u30C9\u30E1\u30A4\u30F3\u304C\u7121\u3044\u3068\u53D6\u308A\u8FBC\u307F\u306F\u6295\u5165\u3067\u304D\u307E\u305B\u3093\u3002"})]})]}),le===be.QUARANTINED_CONFIDENTIALITY_LEVEL&&(0,s.jsxs)("div",{className:"rounded-lg border border-amber-300 border-solid bg-amber-50 p-3 text-amber-900 text-xs",role:"alert","data-testid":"restricted-warning-banner",children:[(0,s.jsx)("span",{className:"font-bold",children:"\u3010\u9694\u96E2\u6CE8\u610F\u3011"})," ",be.QUARANTINED_CONFIDENTIALITY_LEVEL," \u306B\u8A2D\u5B9A\u3055\u308C\u305F\u6587\u66F8\u306F\u3001\u6CD5\u4EE4\u9075\u5B88\u30FB\u4FC2\u4E89\u4FDD\u5168\u306E\u305F\u3081\u691C\u7D22\u7D50\u679C\u306B\u4E00\u5207\u51FA\u73FE\u3057\u307E\u305B\u3093\u3002\u3053\u308C\u306F\u8A2D\u5B9A\u3067\u306F\u306A\u304F\u4FDD\u8A3C\u3067\u3042\u308A\u3001\u30DD\u30EA\u30B7\u30FC\u306E\u5024\u306B\u4F9D\u3089\u305A\u5E38\u306B\u6210\u7ACB\u3057\u307E\u3059\u3002",(0,s.jsx)("span",{className:"mt-1 block text-amber-800",children:"\u7D22\u5F15\u305D\u306E\u3082\u306E\u3092\u884C\u3046\u304B\u3069\u3046\u304B\u306F\u5225\u306E\u8A2D\u5B9A\u3067\u3059 (\u4E0B\u306E\u6295\u5F71\u5148\u3092\u53C2\u7167)\u3002\u7D22\u5F15\u3055\u308C\u305F\u6587\u66F8\u3082\u691C\u7D22\u7D50\u679C\u306B\u306F\u73FE\u308C\u307E\u305B\u3093\u3002"})]}),(0,s.jsxs)("div",{className:"space-y-2 rounded-lg border border-indigo-100 border-solid bg-indigo-50/30 p-4","data-testid":"projection-capability-card",children:[(0,s.jsx)("span",{className:"block font-semibold text-indigo-950 text-xs",children:"\u3053\u306E\u6A5F\u5BC6\u533A\u5206\u306B\u5BFE\u3059\u308B\u6295\u5F71\u306E\u53EF\u5426 (Projection)"}),(0,s.jsxs)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[(0,s.jsxs)("div",{className:"rounded-sm border border-indigo-200/80 border-solid bg-white p-2.5",children:[(0,s.jsx)("span",{className:"block font-semibold text-slate-600 text-xs",children:"\u30D9\u30AF\u30C8\u30EB\u7D22\u5F15 (Qdrant)"}),(0,s.jsx)("span",{className:"mt-1 block font-bold text-xs","data-testid":"projection-vector-state","data-state":w.vectorEnabled===null?"unknown":String(w.vectorEnabled),children:w.vectorEnabled===null?"\u8A2D\u5B9A\u304C\u6E21\u3055\u308C\u3066\u3044\u306A\u3044\u305F\u3081\u4E0D\u660E":w.vectorEnabled?"\u6709\u52B9":`\u7121\u52B9 (${le} \u306E\u8A2D\u5B9A)`})]}),(0,s.jsxs)("div",{className:"rounded-sm border border-indigo-200/80 border-solid bg-white p-2.5",children:[(0,s.jsx)("span",{className:"block font-semibold text-slate-600 text-xs",children:"\u30B0\u30E9\u30D5\u7D22\u5F15 (Neo4j)"}),(0,s.jsx)("span",{className:"mt-1 block font-bold text-xs","data-testid":"projection-graph-state","data-state":w.graphEnabled===null?"unknown":String(w.graphEnabled),children:w.graphEnabled===null?"\u8A2D\u5B9A\u304C\u6E21\u3055\u308C\u3066\u3044\u306A\u3044\u305F\u3081\u4E0D\u660E":w.graphEnabled?"\u6709\u52B9":`\u7121\u52B9 (${le} \u306E\u8A2D\u5B9A)`})]})]}),(0,s.jsxs)("p",{className:"text-[11px] text-slate-600","data-testid":"projection-destination-note",children:["\u6295\u5F71\u5148\u306E\u30B3\u30EC\u30AF\u30B7\u30E7\u30F3\u540D\u30FB\u30B0\u30E9\u30D5\u30E9\u30D9\u30EB\u30FB\u30C1\u30E3\u30F3\u30AF\u5206\u5272\u65B9\u5F0F\u306F\u3001\u9078\u629E\u3057\u305F\u30C9\u30E1\u30A4\u30F3\u306B\u5BFE\u3059\u308B\u914D\u5099\u306E\u53D6\u308A\u8FBC\u307F\u6226\u7565 (",(0,s.jsx)("code",{className:"font-mono",children:"tm_enrichment_strategy"}),") \u304C\u6C7A\u3081\u307E\u3059\u3002\u3053\u306E\u753B\u9762\u3067\u306F\u63A8\u5B9A\u3057\u307E\u305B\u3093\u3002"]})]}),(0,s.jsxs)("div",{className:"space-y-3 rounded-lg border border-slate-200 border-solid bg-slate-50/50 p-4",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("span",{className:"font-semibold text-slate-800 text-xs",children:"\u4ED8\u52A0\u60C5\u5831 / \u30E9\u30D9\u30EB\u30BF\u30B0 (Labels & Tags)"}),(0,s.jsxs)("span",{className:"text-slate-500 text-xs",children:[f.length," \u4EF6\u8A2D\u5B9A\u4E2D"]})]}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,s.jsx)("span",{className:"text-slate-500 text-xs",children:"\u30AF\u30A4\u30C3\u30AF\u5019\u88DC:"}),qs.map(c=>(0,s.jsxs)("button",{type:"button",onClick:()=>he(c),className:"rounded-full border border-slate-200 border-solid bg-white px-2.5 py-0.5 text-slate-700 text-xs transition-colors hover:border-indigo-300 hover:text-indigo-600","data-testid":`preset-tag-${c}`,children:["+ ",c]},c))]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 items-end gap-2 sm:grid-cols-5",children:[(0,s.jsxs)("div",{className:"space-y-1 sm:col-span-2",children:[(0,s.jsx)("label",{htmlFor:Se,className:"block text-slate-600 text-xs",children:"\u30E9\u30D9\u30EB\u540D / \u30AD\u30FC"}),(0,s.jsx)("input",{id:Se,type:"text",value:pe,onChange:c=>me(c.target.value),onKeyDown:c=>{c.key==="Enter"&&(c.preventDefault(),V())},placeholder:"\u4F8B: \u91CD\u8981\u9867\u5BA2\u5951\u7D04, 2026\u5E74\u5EA6",className:"w-full rounded-sm border border-slate-300 border-solid bg-white px-2.5 py-1.5 text-slate-800 text-xs focus:outline-none focus:ring-1 focus:ring-indigo-500","data-testid":"ingest-label-key-input"})]}),(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)("label",{htmlFor:k,className:"block text-slate-600 text-xs",children:"\u7A2E\u5225"}),(0,s.jsxs)("select",{id:k,value:Ce,onChange:c=>Ve(c.target.value),className:"w-full rounded-sm border border-slate-300 border-solid bg-white px-2 py-1.5 text-slate-800 text-xs focus:outline-none focus:ring-1 focus:ring-indigo-500","data-testid":"ingest-label-category-select",children:[(0,s.jsx)("option",{value:"user",children:"\u30E6\u30FC\u30B6\u30FC (user)"}),(0,s.jsx)("option",{value:"domain",children:"\u30C9\u30E1\u30A4\u30F3 (domain)"}),(0,s.jsx)("option",{value:"system",children:"\u30B7\u30B9\u30C6\u30E0 (system)"})]})]}),(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsxs)("label",{htmlFor:Z,className:"block text-slate-600 text-xs",children:["\u78BA\u4FE1\u5EA6 (",Ue.toFixed(2),": 0.00\u301C1.00 AI/\u81EA\u52D5\u5224\u5B9A\u306E\u4FE1\u983C\u5EA6\u30B9\u30B3\u30A2\u30020.80 \u4EE5\u4E0A\u3067\u81EA\u52D5\u9069\u7528\u63A8\u5968)"]}),(0,s.jsx)("input",{id:Z,type:"range",min:"0.0",max:"1.0",step:"0.05",value:Ue,"aria-valuenow":Ue,"aria-valuemin":0,"aria-valuemax":1,"aria-valuetext":`${Math.round(Ue*100)}%`,onChange:c=>nt(Number.parseFloat(c.target.value)),className:"h-2 w-full cursor-pointer appearance-none rounded-lg bg-slate-200","data-testid":"ingest-label-confidence-slider"})]}),(0,s.jsx)("div",{children:(0,s.jsx)("button",{type:"button",onClick:V,className:"w-full rounded-sm bg-slate-800 px-3 py-1.5 font-semibold text-white text-xs hover:bg-slate-700","data-testid":"ingest-add-label-button",children:"\u30BF\u30B0\u8FFD\u52A0"})})]}),f.length>0&&(0,s.jsx)("div",{className:"flex flex-wrap gap-2 pt-2","data-testid":"active-labels-container",children:f.map(c=>(0,s.jsxs)("span",{className:"inline-flex items-center gap-1.5 rounded-md border border-indigo-200 border-solid bg-indigo-50 px-2.5 py-1 font-medium text-indigo-800 text-xs","data-testid":`active-label-${c.labelKey}`,children:[(0,s.jsx)("span",{className:"font-semibold",children:c.labelKey}),(0,s.jsxs)("span",{className:"text-indigo-400",children:["(",c.category,")"]}),(0,s.jsx)("button",{type:"button",onClick:()=>Tt(c.labelKey),"aria-label":`\u30E9\u30D9\u30EB ${c.labelKey} \u3092\u524A\u9664`,className:"ml-1 font-bold text-indigo-400 hover:text-indigo-900","data-testid":`remove-label-${c.labelKey}`,children:"\xD7"})]},c.labelKey))})]}),(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsx)("button",{id:"advanced-settings-toggle",type:"button","aria-expanded":ke,"aria-controls":"advanced-settings-panel",onClick:()=>at(c=>!c),className:"inline-flex items-center gap-1.5 font-semibold text-indigo-600 text-xs hover:text-indigo-800","data-testid":"ingest-toggle-advanced-button",children:(0,s.jsxs)("span",{children:[ke?"\u25BC":"\u25B6"," \u30E1\u30BF\u30C7\u30FC\u30BF\u8A73\u7D30\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9 (\u9AD8\u5EA6\u306A\u8A2D\u5B9A)"]})}),ke&&(0,s.jsxs)("section",{id:"advanced-settings-panel","aria-labelledby":"advanced-settings-toggle",className:"space-y-4 rounded-lg border border-slate-200 border-solid bg-slate-50/40 p-4","data-testid":"advanced-settings-panel",children:[(0,s.jsx)("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)("label",{htmlFor:de,className:"block font-medium text-slate-700 text-xs",children:"\u6587\u66F8\u30BF\u30A4\u30C8\u30EB (\u4E0A\u66F8\u304D\u6307\u5B9A)"}),(0,s.jsx)("input",{id:de,type:"text",value:oe,onChange:c=>Fe(c.target.value),placeholder:"\u6307\u5B9A\u3057\u306A\u3044\u5834\u5408\u306F\u30D5\u30A1\u30A4\u30EB\u540D\u307E\u305F\u306F AI \u62BD\u51FA\u30BF\u30A4\u30C8\u30EB\u304C\u4F7F\u7528\u3055\u308C\u307E\u3059",className:"w-full rounded-sm border border-slate-300 border-solid bg-white px-3 py-1.5 text-slate-800 text-xs","data-testid":"ingest-title-override-input"})]})}),(0,s.jsx)("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)("label",{htmlFor:q,className:"block font-medium text-slate-700 text-xs",children:"\u6240\u7BA1\u90E8\u9580 ID (\u4EFB\u610F)"}),(0,s.jsx)("input",{id:q,type:"number",value:se,onChange:c=>ve(c.target.value),placeholder:"\u4F8B: 101",className:"w-full rounded-sm border border-slate-300 border-solid bg-white px-3 py-1.5 text-slate-800 text-xs","data-testid":"ingest-department-input"})]})})]})]}),(0,s.jsx)("div",{className:"flex justify-end pt-2",children:(0,s.jsx)("button",{type:"submit",disabled:!U.valid||Ae===null||u||l||i,"aria-busy":u,className:"inline-flex items-center gap-2 rounded-lg bg-indigo-600 px-6 py-2.5 font-semibold text-sm text-white shadow-sm transition-colors hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-indigo-500 disabled:opacity-50","data-testid":"ingest-submit-button",children:u?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"h-4 w-4 animate-spin rounded-full border-2 border-white border-t-transparent border-solid"}),(0,s.jsx)("span",{children:"\u53D6\u308A\u8FBC\u307F\u6295\u5165\u4E2D..."})]}):(0,s.jsx)("span",{children:"\u30E1\u30BF\u30C7\u30FC\u30BF\u751F\u6210 & \u53D6\u308A\u8FBC\u307F\u5B9F\u884C"})})})]})]}),(0,s.jsxs)("div",{className:"space-y-4 rounded-xl border border-slate-200 border-solid bg-white p-6 shadow-sm",children:[(0,s.jsx)("div",{className:"flex items-center justify-between",children:(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"font-bold text-base text-slate-900",children:"\u6700\u8FD1\u306E\u53D6\u308A\u8FBC\u307F\u30AD\u30E5\u30FC & \u5B9F\u884C\u72B6\u614B"}),(0,s.jsx)("p",{className:"text-slate-500 text-xs",children:"\u76F4\u8FD1\u306B\u6295\u5165\u3055\u308C\u305F\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306E\u540C\u671F\u9032\u6357\u3068\u7D50\u679C"})]})}),m!==void 0?(0,s.jsx)(qe,{tone:"warning",testId:"recent-items-refused",children:m}):o.length===0?(0,s.jsx)("div",{className:"py-8 text-center text-slate-500 text-xs","data-testid":"recent-items-empty",children:"\u53D6\u308A\u8FBC\u307F\u5C65\u6B74\u306F\u3042\u308A\u307E\u305B\u3093\u3002"}):(0,s.jsx)("div",{className:"overflow-x-auto","data-testid":"recent-items-scroll",children:(0,s.jsxs)("table",{className:"min-w-full divide-y divide-solid divide-slate-200 text-left text-xs","aria-label":"\u6700\u8FD1\u306E\u53D6\u308A\u8FBC\u307F\u5C65\u6B74","data-testid":"recent-items-table",children:[(0,s.jsx)("thead",{className:"bg-slate-50 font-semibold text-slate-700",children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{scope:"col",className:"px-3 py-2.5",children:"ID"}),(0,s.jsx)("th",{scope:"col",className:"px-3 py-2.5",children:"\u30D5\u30A1\u30A4\u30EB\u540D / URI"}),(0,s.jsx)("th",{scope:"col",className:"px-3 py-2.5",children:"\u6A5F\u5BC6\u533A\u5206"}),(0,s.jsx)("th",{scope:"col",className:"px-3 py-2.5",children:"\u30EA\u30D3\u30B8\u30E7\u30F3"}),(0,s.jsx)("th",{scope:"col",className:"px-3 py-2.5",children:"\u540C\u671F\u30B9\u30C6\u30FC\u30BF\u30B9"}),(0,s.jsx)("th",{scope:"col",className:"px-3 py-2.5",children:"\u6700\u7D42\u5B9F\u884C"}),(0,s.jsx)("th",{scope:"col",className:"px-3 py-2.5",children:"\u767B\u9332\u65E5\u6642"}),(0,s.jsx)("th",{scope:"col",className:"px-3 py-2.5 text-right",children:"\u30A2\u30AF\u30B7\u30E7\u30F3"})]})}),(0,s.jsx)("tbody",{className:"divide-y divide-solid divide-slate-100 font-mono text-slate-800",children:o.map((c,_)=>{if(c.kind==="restricted")return(0,s.jsxs)("tr",{"data-testid":`recent-item-restricted-${_}`,"data-restricted-mark":"ingest",children:[(0,s.jsx)("td",{className:"px-3 py-2"}),(0,s.jsx)("td",{className:"px-3 py-2 font-sans text-[11px] text-slate-600","data-testid":`recent-item-restricted-text-${_}`,children:Rt}),(0,s.jsx)("td",{className:"px-3 py-2"}),(0,s.jsx)("td",{className:"px-3 py-2"}),(0,s.jsx)("td",{className:"px-3 py-2 font-sans","data-testid":`recent-item-restricted-status-${_}`,children:c.syncStatus===null?(0,s.jsx)("span",{className:"text-[11px] text-slate-600","data-sync-status":"none",children:Nr}):Re(c.syncStatus)}),(0,s.jsx)("td",{className:"px-3 py-2"}),(0,s.jsx)("td",{className:"px-3 py-2 font-sans text-[11px] text-slate-500","data-testid":`recent-item-restricted-created-at-${_}`,children:(0,s.jsx)(ge,{iso:c.createdAt,testId:`recent-item-restricted-created-at-value-${_}`})}),(0,s.jsx)("td",{className:"px-3 py-2"})]},`restricted:${_}`);let S=c.item;return(0,s.jsxs)("tr",{className:"transition-colors hover:bg-slate-50/80","data-testid":`recent-item-row-${S.id}`,children:[(0,s.jsx)("td",{className:"px-3 py-2 font-bold",children:S.id}),(0,s.jsxs)("td",{className:"max-w-xs truncate px-3 py-2",title:S.fileUri,children:[(0,s.jsx)("div",{className:"font-sans font-semibold text-slate-900",children:S.fileName}),(0,s.jsx)("div",{className:"truncate text-[11px] text-slate-600",children:S.fileUri})]}),(0,s.jsx)("td",{className:"px-3 py-2",children:(0,s.jsx)("span",{className:"inline-flex rounded-sm bg-slate-100 px-2 py-0.5 font-medium font-sans text-[11px] text-slate-700",children:S.confidentialityLevel})}),(0,s.jsxs)("td",{className:"px-3 py-2 text-slate-600",children:["rev.",S.revision,S.isCurrent===!1&&(0,s.jsx)("span",{className:"ml-1.5 inline-flex items-center rounded-sm bg-slate-100 px-1.5 py-0.5 font-medium font-sans text-[10px] text-slate-600","data-testid":`ingest-item-superseded-${S.id}`,children:"\u65E7\u7248"})]}),(0,s.jsxs)("td",{className:"px-3 py-2 font-sans",children:[Re(S.syncStatus),S.errorMessage!==null&&S.errorMessage!==void 0&&S.errorMessage!==""&&(0,s.jsx)("div",{className:"mt-1 max-w-xs break-words text-[11px] text-red-700","data-testid":`ingest-item-error-${S.id}`,title:S.errorMessage,children:S.errorMessage}),Ln(S)]}),(0,s.jsxs)("td",{className:"px-3 py-2 font-sans","data-testid":`ingest-last-run-${S.id}`,children:[S.lastRun===null?(0,s.jsx)("span",{className:"text-[11px] text-slate-500","data-testid":`ingest-last-run-none-${S.id}`,children:"\u8A18\u9332\u306A\u3057"}):S.lastRun.kind==="restricted"?(0,s.jsxs)("div",{className:"space-y-1","data-testid":`ingest-last-run-restricted-${S.id}`,"data-restricted-mark":"run",children:[(0,s.jsx)("div",{className:"text-[11px] text-slate-600",children:zt}),(0,s.jsx)("span",{className:`inline-flex items-center rounded-full px-2 py-0.5 font-semibold text-[11px] ${et[S.lastRun.status].className}`,"data-testid":`ingest-last-run-status-${S.id}`,"data-status":S.lastRun.status,children:et[S.lastRun.status].label}),(0,s.jsx)("div",{className:"text-[11px] text-slate-500","data-testid":`ingest-last-run-finished-at-${S.id}`,children:(0,s.jsx)(Ct,{iso:S.lastRun.finishedAt,testId:`ingest-last-run-finished-at-value-${S.id}`})})]}):(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)("span",{className:`inline-flex items-center rounded-full px-2 py-0.5 font-semibold text-[11px] ${et[it(S.lastRun.item)].className}`,"data-testid":`ingest-last-run-status-${S.id}`,"data-status":S.lastRun.item.status,"data-presentation":it(S.lastRun.item),children:et[it(S.lastRun.item)].label}),S.lastRun.item.failedStepKey!==null&&(0,s.jsx)("div",{className:"text-[11px] text-red-700","data-testid":`ingest-last-run-failed-step-${S.id}`,children:Ot(S.lastRun.item.failedStepKey)}),S.lastRun.item.failedStepKey==="unlock_document"&&(0,s.jsx)("div",{className:"max-w-xs text-[11px] text-slate-700","data-testid":`ingest-unlock-hint-${S.id}`,children:"\u3069\u306E\u30D1\u30B9\u30EF\u30FC\u30C9\u3067\u3082\u958B\u3051\u306A\u304B\u3063\u305F\u3068\u304D\u306F\u3001\u3053\u306E\u30D5\u30A1\u30A4\u30EB\u306B\u5F53\u305F\u308B\u30D5\u30A1\u30A4\u30EB\u306E\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u8DB3\u3057\u3066\u304B\u3089\u518D\u8A66\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u3069\u306E\u90E8\u54C1\u3082\u5916\u305B\u306A\u3044\u5B88\u308A (\u8A3C\u660E\u66F8\u30FB\u6A29\u5229\u306E\u7BA1\u7406\u30FBPKWARE \u306E\u5F37\u3044\u6697\u53F7) \u306F\u3001\u30D5\u30A1\u30A4\u30EB\u3092\u4F5C\u3063\u305F\u6240\u3067\u5916\u3057\u3066\u304F\u3060\u3055\u3044\u3002"}),(0,s.jsx)("div",{className:"text-[11px] text-slate-500","data-testid":`ingest-last-run-finished-at-${S.id}`,children:(0,s.jsx)(Ct,{iso:S.lastRun.item.finishedAt,testId:`ingest-last-run-finished-at-value-${S.id}`})})]}),D!==void 0&&(0,s.jsx)("button",{type:"button",onClick:()=>D(S.id),"aria-label":`${S.fileName} \u306E\u5C65\u6B74`,className:"mt-1 min-h-11 rounded-sm border border-slate-300 border-solid bg-white px-2 py-0.5 font-semibold text-[11px] text-slate-700 hover:bg-slate-50","data-testid":`ingest-history-button-${S.id}`,children:"\u5C65\u6B74"})]}),(0,s.jsx)("td",{className:"px-3 py-2 font-sans text-[11px] text-slate-500","data-testid":`ingest-created-at-${S.id}`,children:(0,s.jsx)(ge,{iso:S.createdAt,testId:`ingest-created-at-value-${S.id}`})}),(0,s.jsx)("td",{className:"px-3 py-2 text-right font-sans",children:g(S)})]},`readable:${S.id}`)})})]})})]})]})}var In=require("@aiquants/enrichment-core"),ee=require("react/jsx-runtime"),_r="\u8981\u7D04\u751F\u6210\u30FB\u69CB\u9020\u5316\u62BD\u51FA\u30FB\u30A2\u30BB\u30C3\u30C8\u62BD\u51FA\u306E\u5207\u308A\u66FF\u3048\u306F\u4FDD\u5B58\u3055\u308C\u307E\u3059\u304C\u3001\u4ECA\u306F\u52B9\u304D\u307E\u305B\u3093 (\u30C9\u30E1\u30A4\u30F3\u306F\u30E2\u30C7\u30EB\u304C\u6C7A\u3081\u308B\u306E\u3067\u3001\u6295\u5F71\u306E\u6BB5\u3060\u3051\u304C\u6226\u7565\u3092\u8AAD\u307F\u307E\u3059)\u3002",Rr={open:{label:"\u30D5\u30E9\u30B0\u6709\u52B9",color:"#047857"},closed:{label:"\u30D5\u30E9\u30B0\u7121\u52B9",color:"#b45309"},unmeasured:{label:"\u30D5\u30E9\u30B0\u672A\u6E2C\u5B9A",color:"#64748b"},absent:{label:"\u30C6\u30CA\u30F3\u30C8\u306E\u9580\u306A\u3057",color:"#64748b"}};function xa(e,t){return e===null?"absent":e in t?t[e]?"open":"closed":"unmeasured"}function Ys({strategies:e,featureFlags:t,onToggleStage:n,isUpdating:a=!1}){let o=n===void 0;return(0,ee.jsxs)("div",{"data-cui-migration":"pending","data-testid":"enrichment-strategy-board",className:"space-y-4 rounded-xl border border-slate-200 border-solid bg-white p-6 shadow-sm",children:[(0,ee.jsxs)("div",{children:[(0,ee.jsx)("h2",{className:"font-bold text-base text-slate-900",children:"\u30C9\u30E1\u30A4\u30F3\u5225 \u53D6\u308A\u8FBC\u307F\u6226\u7565"}),(0,ee.jsxs)("p",{className:"text-slate-500 text-xs",children:["\u6295\u5F71\u306E\u6BB5 (\u30D9\u30AF\u30C8\u30EB\u7D22\u5F15\u30FB\u30B0\u30E9\u30D5\u6295\u5F71) \u304C\u8D70\u308B\u306E\u306F\u3001\u30C6\u30CA\u30F3\u30C8\u306E\u6A5F\u80FD\u30D5\u30E9\u30B0\u3068\u3001\u3053\u306E\u30C9\u30E1\u30A4\u30F3\u306E\u6226\u7565\u306E",(0,ee.jsx)("strong",{children:"\u53CC\u65B9"}),"\u304C\u958B\u3044\u3066\u3044\u308B\u3068\u304D\u3060\u3051\u3067\u3059\u3002\u8868\u306F ",e.length," \u30C9\u30E1\u30A4\u30F3 \xD7 ",In.ENRICHMENT_STAGES.length," \u6BB5\u3002"]}),(0,ee.jsx)("p",{"data-testid":"strategy-inert-note",className:"mt-1 text-slate-500 text-xs",children:_r}),o&&(0,ee.jsx)("p",{"data-testid":"strategy-read-only-note",className:"mt-1 text-slate-500 text-xs",children:"\u3053\u306E\u914D\u5099\u3067\u306F\u66F8\u304D\u8FBC\u307F\u7D4C\u8DEF\u304C\u7D50\u7DDA\u3055\u308C\u3066\u3044\u306A\u3044\u305F\u3081\u3001\u95B2\u89A7\u306E\u307F\u3067\u3059\u3002"})]}),e.length===0?(0,ee.jsx)("p",{"data-testid":"strategy-empty-note",className:"text-slate-500 text-sm",children:"\u767B\u9332\u3055\u308C\u305F\u30C9\u30E1\u30A4\u30F3\u304C\u3042\u308A\u307E\u305B\u3093\u3002"}):(0,ee.jsx)("div",{"data-testid":"strategy-grid-scroll",className:"overflow-x-auto",children:(0,ee.jsxs)("table",{"data-testid":"strategy-grid","aria-label":"\u30C9\u30E1\u30A4\u30F3\u5225 \u53D6\u308A\u8FBC\u307F\u6226\u7565",className:"w-full border-collapse text-xs",children:[(0,ee.jsx)("thead",{children:(0,ee.jsxs)("tr",{children:[(0,ee.jsx)("th",{scope:"col",className:"border-slate-200 border-b border-solid p-2 text-left font-semibold text-slate-600",children:"\u30C9\u30E1\u30A4\u30F3"}),In.ENRICHMENT_STAGES.map(r=>{let u=xa(r.featureFlagKey,t);return(0,ee.jsxs)("th",{scope:"col","data-inert":String(!r.readByPipeline),className:"border-slate-200 border-b border-solid p-2 text-center font-semibold text-slate-600",children:[(0,ee.jsx)("div",{children:r.label}),(0,ee.jsx)("div",{"data-testid":`strategy-gate-${r.key}`,"data-gate":u,className:"mt-0.5 font-normal text-[10px]",style:{color:Rr[u].color},children:Rr[u].label}),!r.readByPipeline&&(0,ee.jsx)("div",{"data-testid":`strategy-inert-${r.key}`,className:"mt-0.5 font-normal text-[10px] text-slate-500",children:"\u4ECA\u306F\u52B9\u304B\u306A\u3044"})]},r.key)})]})}),(0,ee.jsx)("tbody",{children:e.map(r=>(0,ee.jsxs)("tr",{"data-testid":`strategy-row-${r.domainKey}`,"data-provenance":r.provenance,"data-active":String(r.isActive),children:[(0,ee.jsxs)("th",{scope:"row",className:"border-slate-100 border-b border-solid p-2 text-left font-normal",children:[(0,ee.jsx)("div",{className:"font-semibold text-slate-900",children:r.domainLabel}),(0,ee.jsxs)("div",{className:"text-[10px] text-slate-500",children:[(0,ee.jsx)("code",{children:r.domainKey})," / ",r.strategyName]}),(0,ee.jsx)("div",{"data-testid":`strategy-provenance-${r.domainKey}`,className:"text-[10px] text-slate-500",children:r.provenance==="system"?"\u914D\u5099\u306E\u65E2\u5B9A (SYSTEM) \u3092\u89E3\u6C7A\u4E2D \u2014 \u5909\u66F4\u3059\u308B\u3068\u3053\u306E\u30C6\u30CA\u30F3\u30C8\u5C02\u7528\u306E\u884C\u304C\u4F5C\u3089\u308C\u307E\u3059":"\u3053\u306E\u30C6\u30CA\u30F3\u30C8\u56FA\u6709\u306E\u884C"}),!r.isActive&&(0,ee.jsx)("div",{"data-testid":`strategy-inactive-${r.domainKey}`,className:"text-[10px] text-amber-700",children:"\u6226\u7565\u304C\u7121\u52B9\u306E\u305F\u3081\u3001\u6BB5\u3092\u958B\u3044\u3066\u3082\u89E3\u6C7A\u3055\u308C\u307E\u305B\u3093"})]}),In.ENRICHMENT_STAGES.map(u=>{let l=r.stages[u.key],i=xa(u.featureFlagKey,t),x=!u.readByPipeline;return(0,ee.jsxs)("td",{className:"border-slate-100 border-b border-solid p-2 text-center",children:[(0,ee.jsx)("button",{type:"button",role:"switch","aria-checked":l,"aria-label":x?`${r.domainLabel} \u306E ${u.label} (\u4ECA\u306F\u52B9\u304B\u306A\u3044)`:`${r.domainLabel} \u306E ${u.label}`,"data-testid":`strategy-stage-${r.domainKey}-${u.key}`,"data-enabled":String(l),"data-effective":String(!x&&l&&(i==="open"||i==="absent")),"data-inert":String(x),disabled:o||a,onClick:()=>n?.(r,u.key,!l),className:`rounded-full px-2.5 py-1 font-medium text-[11px] ${l?"bg-emerald-50 text-emerald-700":"bg-slate-100 text-slate-600"} ${o||a?"cursor-not-allowed opacity-60":"cursor-pointer"}`,children:l?"\u958B":"\u9589"}),!x&&l&&i==="unmeasured"&&(0,ee.jsx)("div",{"data-testid":`strategy-unmeasured-${r.domainKey}-${u.key}`,className:"mt-0.5 text-[10px] text-slate-500",children:"\u30D5\u30E9\u30B0\u3092\u8AAD\u3081\u3066\u3044\u306A\u3044\u305F\u3081\u3001\u8D70\u308B\u304B\u3069\u3046\u304B\u5224\u308A\u307E\u305B\u3093"}),!x&&l&&i==="closed"&&(0,ee.jsx)("div",{"data-testid":`strategy-blocked-${r.domainKey}-${u.key}`,className:"mt-0.5 text-[10px] text-amber-700",children:"\u30D5\u30E9\u30B0\u304C\u9589\u3058\u3066\u3044\u308B\u305F\u3081\u8D70\u308A\u307E\u305B\u3093"})]},u.key)})]},`${r.domainKey}:${r.strategyName}`))})]})})]})}var Ut={connected:"\u6B63\u5E38\u63A5\u7D9A",error:"\u63A5\u7D9A\u30A8\u30E9\u30FC"},Kt={connected:{"data-cui-fg":"success-fg","data-cui-surface":"success-tint"},error:{"data-cui-fg":"danger-fg","data-cui-surface":"danger-tint"}};var I=require("react/jsx-runtime"),Xs={engine:"\u30A8\u30F3\u30B8\u30F3",edition:"\u30A8\u30C7\u30A3\u30B7\u30E7\u30F3",fullVersion:"\u5B8C\u5168\u30D0\u30FC\u30B8\u30E7\u30F3",title:"\u540D\u79F0",collectionsCount:"\u30B3\u30EC\u30AF\u30B7\u30E7\u30F3",nodeCount:"\u30CE\u30FC\u30C9\u6570 (\u30C6\u30CA\u30F3\u30C8)",totalKeys:"\u30AD\u30FC\u7DCF\u6570",database:"DB",endpointsCount:"\u30A8\u30F3\u30C9\u30DD\u30A4\u30F3\u30C8",port:"\u30DD\u30FC\u30C8",restPort:"REST \u30DD\u30FC\u30C8",boltUri:"Bolt URI",tls:"TLS"},Ir=["engine","edition","fullVersion","title","collectionsCount","nodeCount","totalKeys","database","endpointsCount","port","restPort","boltUri","tls"],js=new Set(["collectionsCount","nodeCount","totalKeys","endpointsCount"]),Cn={atomic:{label:"min-w-0 text-muted-foreground",slot:"shrink-0 whitespace-nowrap text-right"},anywhere:{label:"shrink-0 text-muted-foreground",slot:"wrap-anywhere min-w-0 text-right"}};function Cr(e){return e.kind==="text"?"anywhere":"atomic"}function Tr(e,t){return t===null?{kind:"unmeasured"}:js.has(e)&&typeof t=="number"?{kind:"count",count:t}:typeof t=="boolean"?{kind:"word",text:t?"\u6709\u52B9":"\u7121\u52B9"}:typeof t=="number"?{kind:"number",value:t}:{kind:"text",text:t}}function Js(e){let t=Ir.filter(a=>a in e),n=Object.keys(e).filter(a=>!Ir.includes(a)).sort();return[...t,...n].map(a=>({key:a,label:Xs[a]??a,value:Tr(a,e[a])}))}function kr(e,t){switch(e.kind){case"count":return(0,I.jsx)(j,{value:e.count,unit:"\u4EF6",testId:t});case"unmeasured":return(0,I.jsx)(He,{text:null,testId:t});case"number":if(!Number.isFinite(e.value))throw new RangeError(`${t}: a number the probe read must be finite, got ${e.value} (pass null when the probe could not read it)`);return(0,I.jsx)(He,{text:String(e.value),testId:t});case"word":return(0,I.jsx)(He,{text:e.text,testId:t});case"text":return(0,I.jsx)(Jt,{text:e.text,testId:t})}}function Qs({health:e,isRefreshing:t=!1,onRefresh:n,className:a=""}){let{services:o,allHealthy:r,checkedAt:u}=e;T();let l=[{key:"qdrant",data:o.qdrant,title:"Qdrant",subtitle:"\u30D9\u30AF\u30C8\u30EB\u691C\u7D22\u30A8\u30F3\u30B8\u30F3 (Vector DB)"},{key:"neo4j",data:o.neo4j,title:"Neo4j",subtitle:"\u30CA\u30EC\u30C3\u30B8\u30B0\u30E9\u30D5 (Graph DB)"},{key:"redis",data:o.redis,title:"Redis",subtitle:"\u30AD\u30E3\u30C3\u30B7\u30E5 & Pub/Sub (Cache)"},{key:"sqlServer",data:o.sqlServer,title:"SQL Server",subtitle:"\u6B63\u6E96\u30C7\u30FC\u30BF\u30B9\u30C8\u30A2 (Single Source of Truth)"},{key:"quantsApi",data:o.quantsApi,title:"AI Quant API",subtitle:"Python \u30D0\u30C3\u30AF\u30A8\u30F3\u30C9\u63A8\u8AD6\u30A8\u30F3\u30B8\u30F3"}];return(0,I.jsxs)("section",{"data-cui-migration":"pending",className:`rounded-lg border border-solid bg-card p-5 text-card-foreground shadow-sm ${a}`,"data-testid":"infrastructure-health-monitor","data-healthy":String(r),children:[(0,I.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-4 border-b border-solid pb-4",children:[(0,I.jsxs)("div",{className:"flex items-center gap-3",children:[(0,I.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-lg bg-primary/10 text-primary",children:(0,I.jsxs)("svg",{className:"h-5 w-5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,I.jsx)("rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2"}),(0,I.jsx)("rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2"}),(0,I.jsx)("line",{x1:"6",x2:"6.01",y1:"6",y2:"6"}),(0,I.jsx)("line",{x1:"6",x2:"6.01",y1:"18",y2:"18"})]})}),(0,I.jsxs)("div",{children:[(0,I.jsx)("h2",{className:"font-bold text-base",children:"\u5468\u8FBA\u6A5F\u80FD\u63A5\u7D9A\u72B6\u614B & \u30D0\u30FC\u30B8\u30E7\u30F3"}),(0,I.jsxs)("p",{className:"text-muted-foreground text-xs",children:["\u6700\u7D42\u78BA\u8A8D:"," ",(0,I.jsx)("span",{"data-testid":"health-checked-at",children:(0,I.jsx)(ge,{iso:u,testId:"health-checked-at-value"})})," ","| \u5168 5 \u7CFB\u7D71\u306E\u57FA\u76E4\u30B5\u30FC\u30D3\u30B9\u30EA\u30A2\u30EB\u30BF\u30A4\u30E0\u6B7B\u6D3B\u76E3\u8996"]})]})]}),(0,I.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,I.jsx)("span",{className:"inline-flex shrink-0 items-center gap-1.5 whitespace-nowrap rounded-full px-3 py-1 font-medium text-xs",...Kt[r?"connected":"error"],"data-testid":"health-overall-status-badge",children:r?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)("svg",{className:"h-3.5 w-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,I.jsx)("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}),(0,I.jsx)("polyline",{points:"22 4 12 14.01 9 11.01"})]}),(0,I.jsxs)("span",{children:["\u5168\u30B5\u30FC\u30D3\u30B9",Ut.connected]})]}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)("svg",{className:"h-3.5 w-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,I.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,I.jsx)("line",{x1:"12",x2:"12",y1:"8",y2:"12"}),(0,I.jsx)("line",{x1:"12",x2:"12.01",y1:"16",y2:"16"})]}),(0,I.jsxs)("span",{children:["\u4E00\u90E8\u30B5\u30FC\u30D3\u30B9",Ut.error]})]})}),n&&(0,I.jsxs)("button",{type:"button",onClick:n,disabled:t,"data-testid":"health-refresh-button",className:"inline-flex shrink-0 items-center gap-1.5 whitespace-nowrap rounded-md border border-solid bg-background px-3 py-1.5 font-medium text-xs shadow-sm hover:bg-muted focus:outline-none focus:ring-2 focus:ring-ring disabled:opacity-50",children:[(0,I.jsxs)("svg",{className:`h-3.5 w-3.5 ${t?"animate-spin":""}`,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,I.jsx)("path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"}),(0,I.jsx)("path",{d:"M3 3v5h5"}),(0,I.jsx)("path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16"}),(0,I.jsx)("path",{d:"M16 21h5v-5"})]}),(0,I.jsx)("span",{children:"\u518D\u78BA\u8A8D"})]})]})]}),(0,I.jsx)("div",{className:"mt-4 grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-5",children:l.map(({key:i,data:x,title:O,subtitle:P})=>{let p=Tr("version",x.version),D=Cn[Cr(p)],K=kr(p,`service-version-value-${i}`);return(0,I.jsxs)("div",{"data-testid":`service-card-${i}`,className:"flex flex-col justify-between rounded-md border border-border border-solid bg-card/60 p-3.5 transition-colors hover:bg-muted/40",children:[(0,I.jsxs)("div",{children:[(0,I.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-x-2 gap-y-1",children:[(0,I.jsx)("span",{className:"font-semibold text-sm",children:O}),(0,I.jsxs)("span",{className:"inline-flex shrink-0 items-center gap-1 whitespace-nowrap rounded-sm px-1.5 py-0.5 font-medium text-[11px]",...Kt[x.status],"data-testid":`service-status-${i}`,children:[(0,I.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-current","data-testid":`service-status-dot-${i}`}),Ut[x.status]]})]}),(0,I.jsx)("p",{className:"mt-1 text-[11px] text-muted-foreground",children:P}),(0,I.jsxs)("div",{className:"mt-3 space-y-1.5 border-t border-solid pt-2 text-xs",children:[(0,I.jsxs)("div",{className:"flex items-start justify-between gap-2","data-testid":`service-version-row-${i}`,children:[(0,I.jsx)("span",{className:D.label,children:"\u30D0\u30FC\u30B8\u30E7\u30F3:"}),(0,I.jsx)("span",{className:`${D.slot} font-medium text-[11px]`,"data-testid":`service-version-${i}`,children:p.kind==="text"?(0,I.jsx)("code",{className:"font-mono font-semibold",children:K}):K})]}),(0,I.jsxs)("div",{className:"flex items-start justify-between gap-2","data-testid":`health-latency-row-${i}`,children:[(0,I.jsx)("span",{className:Cn.atomic.label,children:"\u5FDC\u7B54\u6642\u9593:"}),(0,I.jsx)("span",{className:`${Cn.atomic.slot} font-mono text-[11px] text-muted-foreground`,"data-testid":`health-latency-${i}`,children:(0,I.jsx)(j,{value:x.latencyMs,unit:"ms",testId:`health-latency-value-${i}`})})]}),Js(x.details).map(m=>{let R=Cn[Cr(m.value)];return(0,I.jsxs)("div",{className:"flex items-start justify-between gap-2","data-testid":`health-detail-row-${i}-${m.key}`,children:[(0,I.jsxs)("span",{className:R.label,children:[m.label,":"]}),(0,I.jsx)("span",{className:`${R.slot} font-medium text-[11px]`,"data-testid":`health-detail-${i}-${m.key}`,children:kr(m.value,`health-detail-value-${i}-${m.key}`)})]},m.key)})]})]}),(0,I.jsxs)("div",{className:"mt-3 border-t border-solid pt-1.5 text-[10px] text-muted-foreground",children:[(0,I.jsx)("span",{className:"wrap-anywhere font-mono","data-testid":`service-endpoint-${i}`,children:x.endpoint}),x.errorMessage!==void 0&&jt.test(x.errorMessage)&&(0,I.jsx)("p",{className:"wrap-anywhere mt-1 rounded-sm px-1.5 py-0.5",...Kt.error,"data-testid":`service-error-${i}`,children:x.errorMessage})]})]},i)})})]})}var fe=require("@aiquants/enrichment-core"),ae=require("react");var h=require("react/jsx-runtime"),Pr=[{id:"balanced-hybrid",title:"\u63A8\u5968\u30CF\u30A4\u30D6\u30EA\u30C3\u30C9",description:"RRF (k=60) \u3067\u8A9E\u5F59\u3068\u610F\u5473\u306E\u9806\u4F4D\u3092\u5408\u308F\u305B\u308B",params:{mode:"HYBRID",limit:20,fusion:"rrf",rrf_k:60}},{id:"high-precision-vector",title:"\u9AD8\u7CBE\u5EA6\u30D9\u30AF\u30C8\u30EB",description:"\u30B3\u30B5\u30A4\u30F3\u985E\u4F3C\u5EA6 0.75 \u4EE5\u4E0A\u306E\u5BC6\u30D9\u30AF\u30C8\u30EB\u3060\u3051",params:{mode:"DENSE",limit:10,threshold:.75}},{id:"strict-lexical",title:"\u53B3\u683C\u30AD\u30FC\u30EF\u30FC\u30C9",description:"SQL \u306E\u8A9E\u53E5\u306E\u4E00\u81F4\u3060\u3051",params:{mode:"KEYWORD",limit:20}},{id:"lexical-sparse",title:"\u8A9E\u5F59\u30D9\u30AF\u30C8\u30EB",description:"BM25 \u3067\u56FA\u6709\u540D\u8A5E\u3084\u578B\u756A\u306E\u4E00\u81F4\u3092\u72D9\u3046",params:{mode:"SPARSE",limit:20}},{id:"graph-reasoning",title:"\u30B0\u30E9\u30D5\u6DF1\u6398\u308A",description:"\u30CA\u30EC\u30C3\u30B8\u30B0\u30E9\u30D5\u306E\u95A2\u4FC2\u306E\u9806\u4F4D\u3092\u4E3B\u306B\u3059\u308B",params:{mode:"GRAPH_TRAVERSE",limit:30}}],Lr={PUBLIC:"\u516C\u958B (PUBLIC)",INTERNAL:"\u793E\u5185 (INTERNAL)",DEPARTMENT:"\u90E8\u7F72 (DEPARTMENT)",CONFIDENTIAL:"\u6A5F\u5BC6 (CONFIDENTIAL)"},ha="ALL",tn={request:"\u8981\u6C42",response:"\u5FDC\u7B54",flow:"\u8D70\u308A",graph:"\u30B0\u30E9\u30D5\u306E\u8DE1"},Zs="\u307E\u3060\u691C\u7D22\u3057\u3066\u3044\u307E\u305B\u3093\u3002",eo=(fe.SEARCH_PARAM_LIMITS.threshold.min+fe.SEARCH_PARAM_LIMITS.threshold.max)/2,to=336,no=544;function ao(e){let t=e.trim().length;return t<fe.SEARCH_PARAM_LIMITS.queryLength.min?"\u691C\u7D22\u8A9E\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044\u3002":t>fe.SEARCH_PARAM_LIMITS.queryLength.max?`\u691C\u7D22\u8A9E\u306F ${fe.SEARCH_PARAM_LIMITS.queryLength.max} \u5B57\u4EE5\u5185\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044\u3002`:void 0}function ro(e){let t=e.trim();if(t!=="")return/^[1-9]\d*$/.test(t)&&Number.isSafeInteger(Number(t))?void 0:"\u90E8\u7F72\u306E ID \u306F 1 \u4EE5\u4E0A\u306E\u6574\u6570\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044\u3002"}function wr(e,t){return t.trim().length>fe.SEARCH_PARAM_LIMITS.filterTextLength.max?`${e}\u306F ${fe.SEARCH_PARAM_LIMITS.filterTextLength.max} \u5B57\u4EE5\u5185\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044\u3002`:void 0}function so(e){return e.fusion==="rrf"?`RRF (k=${e.rrf_k})`:e.fusion==="linear"?`\u7DDA\u5F62 (\u03B1=${e.alpha}, k=${e.rrf_k})`:"\u878D\u5408\u306A\u3057 (1 \u3064\u306E\u9806\u4F4D\u3060\u3051\u306E\u6226\u7565)"}function oo({params:e,answer:t}){let n=t.search_metadata,a=n.executed_tiers,o=r=>r?"\u2713":"\u2013";return[`\u8981\u6C42\u306E\u6226\u7565: ${n.requested_mode} (${rt[n.requested_mode].label})`,`\u8D70\u3063\u305F\u6226\u7565: ${n.search_mode} (${rt[n.search_mode].label})`,`\u8D70\u3063\u305F\u5C64: \u8A9E\u53E5 ${o(a.lexical)} / \u758E ${o(a.sparse)} / \u5BC6 ${o(a.dense)} / \u30B0\u30E9\u30D5 ${o(a.graph)}`,`\u878D\u5408: ${so(e)}`,`\u54C1\u8CEA: ${wt[n.quality_tier]}`,`\u7E2E\u9000\u306E\u7406\u7531: ${n.degradation_reasons.length===0?"\u7121\u3057":n.degradation_reasons.join(", ")}`,`\u906E\u65AD\u5668: \u30D9\u30AF\u30C8\u30EB ${Pt[n.circuit_breaker_status.vector]} / \u30B0\u30E9\u30D5 ${Pt[n.circuit_breaker_status.graph]}`,`\u6240\u8981: ${n.execution_time_ms} ms`,`\u4EF6\u6570: ${t.hits.length}`].join(`
|
|
2
|
+
`)}function io({answer:e}){if(!e.search_metadata.executed_tiers.graph)return"\u30B0\u30E9\u30D5\u306E\u5C64\u306F\u8D70\u3063\u3066\u3044\u307E\u305B\u3093\u3002";if(e.authz_scopes.row_scope_applied)return"\u884C\u306E\u30B9\u30B3\u30FC\u30D7\u304C\u639B\u304B\u308B\u305F\u3081\u3001\u95A2\u4FC2\u306F\u793A\u3057\u307E\u305B\u3093 (\u95A2\u4FC2\u306E\u5148\u306F\u884C\u306E\u8A8D\u53EF\u3092\u901A\u3063\u3066\u3044\u307E\u305B\u3093)\u3002";let t=e.hits.flatMap((n,a)=>(n.graph_relations??[]).map(o=>`#${a+1} ${n.file_name??xt}: ${o.relation} \u2192 ${o.target_name}`));return t.length===0?"\u3069\u306E\u6587\u66F8\u306B\u3082\u95A2\u4FC2\u306F\u3042\u308A\u307E\u305B\u3093\u3002":t.join(`
|
|
3
|
+
`)}function Je(e,t){return e?xt:t===null||t===""?"\u7121\u3057":String(t)}function lo({tenantId:e,onSearch:t,initialParams:n}){let{formatLocale:a}=T(),o=Dt(),r=(0,ae.useId)(),[u,l]=(0,ae.useState)(n?.q??""),[i,x]=(0,ae.useState)(n?.mode??"HYBRID"),[O,P]=(0,ae.useState)(n?.limit??fe.SEARCH_PARAM_LIMITS.limit.default),[p,D]=(0,ae.useState)(n?.threshold??eo),[K,m]=(0,ae.useState)(n?.fusion??"rrf"),[R,N]=(0,ae.useState)(n?.rrf_k??fe.SEARCH_PARAM_LIMITS.rrfK.default),[F,W]=(0,ae.useState)(n?.alpha??fe.SEARCH_PARAM_LIMITS.alpha.default),[Q,ue]=(0,ae.useState)(n?.confidentiality_level??ha),[te,q]=(0,ae.useState)(n?.department_id===void 0?"":String(n.department_id)),[de,Se]=(0,ae.useState)(n?.mime_type??""),[k,Z]=(0,ae.useState)(n?.tag??""),[Y,_e]=(0,ae.useState)(!1),[Xe,De]=(0,ae.useState)(!1),[Ie,$e]=(0,ae.useState)(!1),[le,E]=(0,ae.useState)("request"),[X,B]=(0,ae.useState)(!1),[se,ve]=(0,ae.useState)(!1),[oe,Fe]=(0,ae.useState)(null),[f,H]=(0,ae.useState)(null),[pe,me]=(0,ae.useState)(null),[Ce,Ve]=(0,ae.useState)(null),Ue=(0,ae.useRef)(0),nt=(0,ae.useRef)(0),ke=(0,ae.useRef)(null);(0,ae.useEffect)(()=>()=>ke.current?.abort(),[]);let at={query:ao(u),department:ro(te),mimeType:wr("MIME \u30BF\u30A4\u30D7",de),tag:wr("\u30BF\u30B0",k)},Ae=X?at:{},Ke=()=>{let g=te.trim(),Re=de.trim(),c=k.trim();return{q:u.trim(),mode:i,limit:O,...i==="DENSE"?{threshold:p}:{},...i==="HYBRID"?{fusion:K,rrf_k:R,...K==="linear"?{alpha:F}:{}}:{},...Q===ha?{}:{confidentiality_level:Q},...g===""?{}:{department_id:Number(g)},...Re===""?{}:{mime_type:Re},...c===""?{}:{tag:c}}},b=async g=>{let Re=new AbortController;ke.current=Re,ve(!0);try{let c=await t(g,Re.signal);if(Re.signal.aborted)return;Fe({params:g,answer:c}),H(c.hits.length===0?null:"1"),me(null),o(c.hits.length===0?"\u6761\u4EF6\u306B\u5408\u3046\u6587\u66F8\u306F\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3067\u3057\u305F\u3002":`${c.hits.length} \u4EF6\u306E\u6587\u66F8\u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F\u3002`)}catch(c){if(Re.signal.aborted)return;Ue.current+=1,me({message:c instanceof Error?c.message:"\u691C\u7D22\u3092\u5B9F\u884C\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002",occurrence:Ue.current})}finally{ke.current===Re&&(ke.current=null,ve(!1))}},w=g=>{g.preventDefault(),B(!0),!(se||Object.values(at).some(Re=>Re!==void 0))&&b(Ke())},U=g=>{x(g.params.mode),P(g.params.limit),g.params.threshold!==void 0&&D(g.params.threshold),g.params.fusion!==void 0&&m(g.params.fusion),g.params.rrf_k!==void 0&&N(g.params.rrf_k),o(`\u30D7\u30EA\u30BB\u30C3\u30C8\u300C${g.title}\u300D\u3092\u5F53\u3066\u307E\u3057\u305F\u3002`)},z=g=>{if(oe===null)return Zs;switch(g){case"request":return JSON.stringify(oe.params,null,2);case"response":return JSON.stringify(oe.answer,null,2);case"flow":return oo(oe);case"graph":return io(oe)}},ye=async()=>{try{await navigator.clipboard.writeText(z(le)),Ve(null),o(`${tn[le]}\u3092\u5199\u3057\u307E\u3057\u305F\u3002`)}catch(g){nt.current+=1,Ve({message:`\u5199\u305B\u307E\u305B\u3093\u3067\u3057\u305F: ${g instanceof Error?g.message:String(g)}`,occurrence:nt.current})}},V=oe?.answer??null,he=g=>V?.authz_scopes.hidden_columns.includes(g)===!0,Tt=V===null?[]:V.hits.map((g,Re)=>({hit:g,rank:Re+1})),Bt=Tt.find(g=>String(g.rank)===f)??null,Ln=(g,Re)=>{let c=g.scores;return(0,h.jsx)(Un,{id:r,title:`#${Re} ${Je(he("file_name"),g.file_name)}`,region:!0,testId:"search-hit-detail",children:(0,h.jsxs)(Te,{gap:"space-4",testId:"search-hit-detail-body",children:[(0,h.jsx)($t,{items:[{key:"fused",term:"\u878D\u5408\u306E\u5024",description:(0,h.jsx)(Bn,{label:"\u878D\u5408\u306E\u5024",value:c.fused,min:0,max:1,valueText:c.fused.toFixed(ht),testId:"search-hit-detail-fused"})},{key:"vector",term:"\u30D9\u30AF\u30C8\u30EB\u306E\u5024",description:(0,h.jsx)(G,{fg:"fg",type:"body",children:c.vector===null?"\u30D9\u30AF\u30C8\u30EB\u306E\u5217\u306B\u7121\u3044":Mn(c.vector)})},{key:"lexical",term:"\u8A9E\u53E5\u306E\u9806\u4F4D\u306E\u5024",description:(0,h.jsx)(G,{fg:"fg",type:"body",children:c.lexical_rank===null?"\u8A9E\u53E5\u306E\u5217\u306B\u7121\u3044":c.lexical_rank.toFixed(ht)})},{key:"graph",term:"\u30B0\u30E9\u30D5\u306E\u9806\u4F4D\u306E\u5024",description:(0,h.jsx)(G,{fg:"fg",type:"body",children:c.graph_rank===null?"\u30B0\u30E9\u30D5\u306E\u5217\u306B\u7121\u3044":c.graph_rank.toFixed(ht)})}],testId:"search-hit-scores"}),(0,h.jsx)($t,{items:[{key:"file_uri",term:"URI",description:(0,h.jsx)(G,{fg:"fg",type:"body",face:"mono",children:Je(he("file_uri"),g.file_uri)})},{key:"mime_type",term:"MIME \u30BF\u30A4\u30D7",description:(0,h.jsx)(G,{fg:"fg",type:"body",children:Je(he("mime_type"),g.mime_type)})},{key:"folder_path",term:"\u30D5\u30A9\u30EB\u30C0",description:(0,h.jsx)(G,{fg:"fg",type:"body",children:Je(he("folder_path"),g.folder_path)})},{key:"confidentiality_level",term:"\u6A5F\u5BC6\u533A\u5206",description:(0,h.jsx)(G,{fg:"fg",type:"body",children:Je(he("confidentiality_level"),g.confidentiality_level)})},{key:"department_id",term:"\u90E8\u7F72",description:(0,h.jsx)(G,{fg:"fg",type:"body",children:Je(he("department_id"),g.department_id)})},{key:"created_by",term:"\u767B\u9332\u8005",description:(0,h.jsx)(G,{fg:"fg",type:"body",children:Je(he("created_by"),g.created_by)})},{key:"mtime",term:"\u66F4\u65B0",description:he("mtime")?(0,h.jsx)(G,{fg:"fg",type:"body",children:xt}):(0,h.jsx)(ge,{iso:g.mtime,testId:"search-hit-mtime-value"})},{key:"tags",term:"\u30BF\u30B0",description:he("tags")||g.tags===null||g.tags.length===0?(0,h.jsx)(G,{fg:"fg",type:"body",children:Je(he("tags"),null)}):(0,h.jsx)(lt,{gap:"space-2",testId:"search-hit-tags",children:g.tags.map(_=>(0,h.jsx)(Ge,{tone:"neutral",variant:"tint",testId:`search-hit-tag-${_}`,children:_},_))})},{key:"ai_summary",term:"AI \u306E\u8981\u7D04",description:(0,h.jsx)(G,{fg:"fg",type:"prose",children:Je(he("ai_summary"),g.ai_summary)})}],testId:"search-hit-fields"}),(0,h.jsxs)(Te,{gap:"space-2",testId:"search-hit-relations",children:[(0,h.jsx)(G,{as:"p",fg:"fg-secondary",type:"body",children:"\u30B0\u30E9\u30D5\u306E\u95A2\u4FC2"}),g.graph_relations===null?(0,h.jsx)(G,{as:"p",fg:"fg",type:"prose",children:"\u884C\u306E\u30B9\u30B3\u30FC\u30D7\u304C\u639B\u304B\u308B\u305F\u3081\u793A\u3057\u307E\u305B\u3093 (\u95A2\u4FC2\u306E\u5148\u306F\u884C\u306E\u8A8D\u53EF\u3092\u901A\u3063\u3066\u3044\u307E\u305B\u3093)\u3002"}):g.graph_relations.length===0?(0,h.jsx)(G,{as:"p",fg:"fg",type:"prose",children:"\u7121\u3057"}):(0,h.jsx)("ul",{"data-testid":"search-hit-relation-list",children:g.graph_relations.map(_=>(0,h.jsx)("li",{children:(0,h.jsx)(G,{fg:"fg",type:"body",children:`${_.relation} \u2192 ${_.target_name}`})},`${_.relation}-${_.target_name}`))})]}),he("structured_data")||g.structured_data===null?(0,h.jsx)(G,{as:"p",fg:"fg",type:"prose",testId:"search-hit-structured-absent",children:`\u69CB\u9020\u5316\u30C7\u30FC\u30BF: ${Je(he("structured_data"),null)}`}):(0,h.jsx)(Kn,{label:"\u69CB\u9020\u5316\u30C7\u30FC\u30BF",code:JSON.stringify(g.structured_data,null,2),testId:"search-hit-structured"})]})})};return(0,h.jsxs)(Te,{gap:"space-6",testId:"metadata-search-workbench",children:[(0,h.jsx)(dt,{title:"\u6587\u66F8\u306E\u691C\u7D22",description:`\u30C6\u30CA\u30F3\u30C8 ${e} \u306E\u6587\u66F8\u3092\u3001\u8A9E\u53E5\u30FB\u30D9\u30AF\u30C8\u30EB\u30FB\u30B0\u30E9\u30D5\u306E\u5C64\u3067\u63A2\u3057\u307E\u3059\u3002`,testId:"search-query-card",dataAttributes:{"data-mode":i,"data-running":se},children:(0,h.jsx)("form",{onSubmit:w,noValidate:!0,"data-testid":"search-form",children:(0,h.jsxs)(Te,{gap:"space-4",testId:"search-form-fields",children:[(0,h.jsx)(Nt,{label:"\u691C\u7D22\u8A9E",type:"search",value:u,onValueChange:l,required:!0,description:`1\u301C${fe.SEARCH_PARAM_LIMITS.queryLength.max} \u5B57`,error:Ae.query,testId:"search-query"}),(0,h.jsx)(mn,{label:"\u691C\u7D22\u306E\u6226\u7565",options:fe.SEARCH_MODES.map(g=>({value:g,label:rt[g].label})),value:i,onValueChange:g=>x(g),testId:"search-mode"}),(0,h.jsx)(G,{as:"p",fg:"fg-secondary",type:"prose",testId:"search-mode-description",children:rt[i].description}),(0,h.jsx)(St,{label:"\u4EF6\u6570",value:O,min:fe.SEARCH_PARAM_LIMITS.limit.min,max:fe.SEARCH_PARAM_LIMITS.limit.max,step:1,valueText:g=>`${g} \u4EF6`,onValueChange:P,testId:"search-limit"}),i==="DENSE"&&(0,h.jsx)(St,{label:"\u985E\u4F3C\u5EA6\u306E\u4E0B\u9650",value:p,min:fe.SEARCH_PARAM_LIMITS.threshold.min,max:fe.SEARCH_PARAM_LIMITS.threshold.max,step:.01,valueText:g=>g.toFixed(2),onValueChange:D,testId:"search-threshold"}),i==="HYBRID"&&(0,h.jsxs)(Te,{gap:"space-4",testId:"search-fusion-controls",children:[(0,h.jsx)(mn,{label:"\u878D\u5408",options:fe.SEARCH_FUSIONS.map(g=>({value:g,label:An[g]})),value:K,onValueChange:g=>m(g),testId:"search-fusion"}),(0,h.jsx)(St,{label:"\u9806\u4F4D\u306E\u5024\u306E k",value:R,min:fe.SEARCH_PARAM_LIMITS.rrfK.min,max:fe.SEARCH_PARAM_LIMITS.rrfK.max,step:1,valueText:String,onValueChange:N,testId:"search-rrf-k"}),K==="linear"&&(0,h.jsx)(St,{label:"\u30D9\u30AF\u30C8\u30EB\u306E\u91CD\u307F (\u03B1)",value:F,min:fe.SEARCH_PARAM_LIMITS.alpha.min,max:fe.SEARCH_PARAM_LIMITS.alpha.max,step:.05,valueText:g=>g.toFixed(2),onValueChange:W,testId:"search-alpha"})]}),(0,h.jsx)(pn,{summary:"\u8A73\u3057\u3044\u6761\u4EF6",open:Y,onOpenChange:_e,testId:"search-filters",children:(0,h.jsxs)(Te,{gap:"space-4",testId:"search-filter-fields",children:[(0,h.jsx)(Gt,{label:"\u6A5F\u5BC6\u533A\u5206",value:Q,options:[{value:ha,label:"\u5168\u3066\u306E\u533A\u5206"},...fe.FILTERABLE_CONFIDENTIALITY_LEVELS.map(g=>({value:g,label:Lr[g]}))],onValueChange:ue,testId:"search-confidentiality"}),(0,h.jsx)(Nt,{label:"\u90E8\u7F72\u306E ID",type:"text",value:te,onValueChange:q,description:"1 \u4EE5\u4E0A\u306E\u6574\u6570",error:Ae.department,testId:"search-department"}),(0,h.jsx)(Nt,{label:"MIME \u30BF\u30A4\u30D7 (\u542B\u3080\u4E00\u81F4)",type:"text",value:de,onValueChange:Se,error:Ae.mimeType,testId:"search-mime-type"}),(0,h.jsx)(Nt,{label:"\u30BF\u30B0 (\u5B8C\u5168\u4E00\u81F4)",type:"text",value:k,onValueChange:Z,error:Ae.tag,testId:"search-tag"})]})}),(0,h.jsx)(pn,{summary:"\u958B\u767A\u8005\u306E\u30D7\u30EA\u30BB\u30C3\u30C8",open:Xe,onOpenChange:De,testId:"search-presets",children:(0,h.jsx)(Te,{gap:"space-2",testId:"search-preset-list",children:Pr.map(g=>(0,h.jsxs)(lt,{gap:"space-2",testId:`search-preset-${g.id}`,children:[(0,h.jsx)(Ne,{variant:"secondary",onClick:()=>U(g),testId:`search-preset-${g.id}-apply`,children:g.title}),(0,h.jsx)(G,{fg:"fg-secondary",type:"body",children:g.description})]},g.id))})}),(0,h.jsx)(lt,{gap:"space-2",testId:"search-actions",children:(0,h.jsx)(Ne,{variant:"primary",type:"submit",busy:se,busyLabel:"\u691C\u7D22\u3057\u3066\u3044\u307E\u3059",testId:"search-submit",children:"\u691C\u7D22\u3059\u308B"})})]})})}),pe!==null&&(0,h.jsx)(ze,{occurrence:pe.occurrence,testId:"search-failure",children:pe.message}),V!==null&&(0,h.jsx)(Hn,{metadata:V.search_metadata,testId:"search-degraded"}),V!==null&&(0,h.jsx)(dt,{title:"\u691C\u7D22\u306E\u7D50\u679C",description:`${V.hits.length} \u4EF6 \xB7 ${Rn(V.search_metadata.execution_time_ms,"execution_time_ms",a)} ms \xB7 \u54C1\u8CEA: ${wt[V.search_metadata.quality_tier]}`,testId:"search-results",children:(0,h.jsxs)(Te,{gap:"space-4",testId:"search-results-body",children:[(0,h.jsx)($t,{items:[{key:"tiers",term:"\u8D70\u3063\u305F\u5C64",description:(0,h.jsx)(lt,{gap:"space-2",testId:"search-tiers",children:[["lexical","\u8A9E\u53E5"],["sparse","\u758E\u30D9\u30AF\u30C8\u30EB"],["dense","\u5BC6\u30D9\u30AF\u30C8\u30EB"],["graph","\u30B0\u30E9\u30D5"]].map(([g,Re])=>(0,h.jsx)(Ge,{tone:V.search_metadata.executed_tiers[g]?"success":"neutral",variant:"tint",testId:`search-tier-${g}`,dataAttributes:{"data-ran":V.search_metadata.executed_tiers[g]},children:`${Re} ${V.search_metadata.executed_tiers[g]?"\u8D70\u3063\u305F":"\u8D70\u3089\u306A\u304B\u3063\u305F"}`},g))})},{key:"breakers",term:"\u906E\u65AD\u5668",description:(0,h.jsx)(G,{fg:"fg",type:"body",testId:"search-breakers",children:`\u30D9\u30AF\u30C8\u30EB ${Pt[V.search_metadata.circuit_breaker_status.vector]} \xB7 \u30B0\u30E9\u30D5 ${Pt[V.search_metadata.circuit_breaker_status.graph]}`})},{key:"rows",term:"\u884C\u306E\u30B9\u30B3\u30FC\u30D7",description:(0,h.jsx)(G,{fg:"fg",type:"body",testId:"search-row-scope",children:V.authz_scopes.row_scope_applied?"\u639B\u304B\u3063\u3066\u3044\u307E\u3059 (\u8AAD\u3081\u306A\u3044\u6587\u66F8\u306F\u4E00\u89A7\u306B\u542B\u307F\u307E\u305B\u3093)":"\u639B\u304B\u3063\u3066\u3044\u307E\u305B\u3093"})},{key:"columns",term:"\u5217\u306E\u30B9\u30B3\u30FC\u30D7",description:(0,h.jsx)(G,{fg:"fg",type:"body",testId:"search-column-scope",children:V.authz_scopes.column_scope_applied?V.authz_scopes.hidden_columns.length===0?"\u639B\u304B\u3063\u3066\u3044\u307E\u3059 (\u7B54\u3048\u306E\u6B04\u306B\u4F0F\u305B\u305F\u3082\u306E\u306F\u3042\u308A\u307E\u305B\u3093)":`\u639B\u304B\u3063\u3066\u3044\u307E\u3059 (\u4F0F\u305B\u305F\u6B04: ${V.authz_scopes.hidden_columns.join("\u30FB")})`:"\u639B\u304B\u3063\u3066\u3044\u307E\u305B\u3093"})}],testId:"search-run"}),(0,h.jsx)(on,{master:(0,h.jsx)(cn,{label:"\u898B\u3064\u304B\u3063\u305F\u6587\u66F8",items:Tt,itemKey:g=>String(g.rank),selectedKey:f,onSelect:g=>H(String(g.rank)),detailId:r,renderRow:g=>(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(G,{fg:"fg",type:"body",children:`#${g.rank} ${Je(he("file_name"),g.hit.file_name)}`}),(0,h.jsx)(Bn,{label:`#${g.rank} \u306E\u878D\u5408\u306E\u5024`,value:g.hit.scores.fused,min:0,max:1,valueText:g.hit.scores.fused.toFixed(ht),testId:`search-hit-${g.rank}-fused`})]}),rowTestId:"search-hit-row",rowData:g=>({"data-rank":g.rank}),empty:"\u6761\u4EF6\u306B\u5408\u3046\u6587\u66F8\u306F\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u691C\u7D22\u8A9E\u3092\u77ED\u304F\u3059\u308B\u304B\u3001\u6226\u7565\u3084\u7D5E\u308A\u8FBC\u307F\u3092\u5909\u3048\u3066\u304F\u3060\u3055\u3044\u3002",testId:"search-hits"}),detail:Bt===null?(0,h.jsx)(Un,{id:r,title:"\u6587\u66F8\u306E\u8A73\u7D30",region:!0,testId:"search-hit-detail",children:(0,h.jsx)(G,{as:"p",fg:"fg-secondary",type:"prose",children:"\u4E00\u89A7\u306E\u884C\u3092\u9078\u3076\u3068\u3001\u305D\u306E\u6587\u66F8\u306E\u8A73\u7D30\u3092\u793A\u3057\u307E\u3059\u3002"})}):Ln(Bt.hit,Bt.rank),masterMinPx:to,detailMinPx:no,testId:"search-master-detail"})]})}),(0,h.jsx)(pn,{summary:"\u958B\u767A\u8005\u306E\u70B9\u691C",open:Ie,onOpenChange:$e,testId:"search-inspector",children:(0,h.jsxs)(Te,{gap:"space-4",testId:"search-inspector-body",children:[(0,h.jsx)(mn,{label:"\u70B9\u691C\u306E\u7A93",options:Object.keys(tn).map(g=>({value:g,label:tn[g]})),value:le,onValueChange:g=>E(g),testId:"search-inspector-view"}),(0,h.jsx)(Kn,{label:`\u70B9\u691C\u306E\u7A93: ${tn[le]}`,code:z(le),testId:"search-inspector-code"}),(0,h.jsx)(lt,{gap:"space-2",testId:"search-inspector-actions",children:(0,h.jsx)(Ne,{variant:"secondary",onClick:()=>{ye()},testId:"search-inspector-copy",children:`${tn[le]}\u3092\u5199\u3059`})}),Ce!==null&&(0,h.jsx)(ze,{occurrence:Ce.occurrence,testId:"search-inspector-copy-failure",children:Ce.message})]})})]})}var yt=require("@aiquants/enrichment-core"),Oe=require("react");var re=require("react/jsx-runtime"),Dr=4;function $r(e){return`${e.label} (${e.embeddingModel})`}function co(e){let t=e.trim().length;return t<yt.SEARCH_PARAM_LIMITS.queryLength.min?"\u554F\u3044\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044\u3002":t>yt.SEARCH_PARAM_LIMITS.queryLength.max?`\u554F\u3044\u306F ${yt.SEARCH_PARAM_LIMITS.queryLength.max} \u5B57\u4EE5\u5185\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044\u3002`:void 0}function uo({variants:e,onCompare:t}){let{formatLocale:n}=T(),a=Dt(),[o,r]=(0,Oe.useState)(null),[u,l]=(0,Oe.useState)(null),[i,x]=(0,Oe.useState)(""),[O,P]=(0,Oe.useState)(yt.SEARCH_PARAM_LIMITS.limit.default),[p,D]=(0,Oe.useState)(!1),[K,m]=(0,Oe.useState)(!1),[R,N]=(0,Oe.useState)(null),[F,W]=(0,Oe.useState)(null),Q=(0,Oe.useRef)(0),ue=(0,Oe.useRef)(null);(0,Oe.useEffect)(()=>()=>ue.current?.abort(),[]);let te=e.map(E=>E.strategyId),q=o!==null&&te.includes(o)?o:te[0]??null,de=u!==null&&te.includes(u)?u:te[1]??null,Se=q!==null&&q===de,k={query:co(i),variant:Se?"\u540C\u3058\u5909\u7A2E\u3069\u3046\u3057\u306F\u6BD4\u3079\u3089\u308C\u307E\u305B\u3093\u3002\u5225\u306E\u5909\u7A2E\u3092\u9078\u3093\u3067\u304F\u3060\u3055\u3044\u3002":void 0},Z=p?k.query:void 0,Y=E=>{let X=e.find(B=>B.strategyId===E);return X===void 0?`\u6226\u7565 #${E}`:$r(X)},_e=E=>{Q.current+=1,N(null),W({message:E,occurrence:Q.current})},Xe=async E=>{let X=new AbortController;ue.current=X,m(!0);try{let B=await t(E,X.signal);if(X.signal.aborted)return;let se=B.results.find(oe=>oe.strategy_id===E.strategy_ids[0]),ve=B.results.find(oe=>oe.strategy_id===E.strategy_ids[1]);if(se===void 0||ve===void 0){_e(`\u7B54\u3048\u306B\u6226\u7565 #${se===void 0?E.strategy_ids[0]:E.strategy_ids[1]} \u306E\u7D50\u679C\u304C\u3042\u308A\u307E\u305B\u3093\u3002`);return}N({input:E,answer:B,results:[se,ve]}),W(null),a(`\u5909\u7A2E A \u306F ${se.hits.length} \u4EF6\u3001\u5909\u7A2E B \u306F ${ve.hits.length} \u4EF6\u3092\u8FD4\u3057\u307E\u3057\u305F\u3002`)}catch(B){if(X.signal.aborted)return;_e(B instanceof Error?B.message:"\u6BD4\u3079\u3092\u5B9F\u884C\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002")}finally{ue.current===X&&(ue.current=null,m(!1))}},De=E=>{E.preventDefault(),D(!0),!(K||q===null||de===null||k.query!==void 0||k.variant!==void 0)&&Xe({query:i.trim(),strategy_ids:[q,de],limit:O})},Ie=e.map(E=>({value:String(E.strategyId),label:$r(E)})),$e=(E,X,B,se,ve)=>E===void 0?(0,re.jsx)(G,{fg:"fg-muted",type:"body",testId:`compare-${X}-${B}-${se}`,children:"\u3053\u306E\u9806\u4F4D\u306E\u7D50\u679C\u7121\u3057"}):(0,re.jsxs)(Te,{gap:"space-1",testId:`compare-${X}-${B}-${se}`,children:[(0,re.jsx)(G,{fg:"fg-secondary",type:"body",face:"mono",children:`\u6587\u66F8 ${E.metadata_id} \xB7 \u30C1\u30E3\u30F3\u30AF ${E.chunk_index} \xB7 ${E.score.toFixed(Dr)}`}),(0,re.jsx)(G,{fg:"fg",type:"prose",children:ve||E.text===null?xt:E.text})]}),le=({answer:E,results:X})=>{let[B,se]=X,ve=On(B.hits.map(sn),se.hits.map(sn)),oe=Array.from({length:Math.max(B.hits.length,se.hits.length)},(f,H)=>H+1),Fe=(f,H)=>({key:H,heading:`\u5909\u7A2E ${H.toUpperCase()}: ${Y(f.strategy_id)} \xB7 ${Rn(f.execution_ms,`execution_ms of strategy ${f.strategy_id}`,n)} ms`,cells:Object.fromEntries(oe.map(pe=>[`rank-${pe}`,me=>$e(f.hits[pe-1],H,pe,me,E.text_hidden)]))});return(0,re.jsx)(dt,{title:"\u6BD4\u3079\u306E\u7D50\u679C",testId:"compare-results",children:(0,re.jsxs)(Te,{gap:"space-4",testId:"compare-results-body",children:[(0,re.jsx)($t,{items:[{key:"shared",term:"\u5171\u901A\u306E\u30C1\u30E3\u30F3\u30AF",description:(0,re.jsx)(G,{fg:"fg",type:"body",testId:"compare-shared-count",children:`${ve.sharedCount} \u4EF6 (A ${B.hits.length} \u4EF6 / B ${se.hits.length} \u4EF6)`})},{key:"overlap",term:"\u91CD\u306A\u308A (Jaccard)",description:(0,re.jsx)(G,{fg:"fg",type:"body",testId:"compare-overlap-ratio",children:ve.overlapRatio===null?"\u3069\u3061\u3089\u3082\u7D50\u679C\u7121\u3057":`${(ve.overlapRatio*100).toFixed(1)}%`})},{key:"distance",term:"\u9806\u4F4D\u306E\u5DEE\u306E\u5E73\u5747 (\u5171\u901A\u306E\u5206)",description:(0,re.jsx)(G,{fg:"fg",type:"body",testId:"compare-rank-difference",children:ve.meanAbsoluteRankDifference===null?"\u5171\u901A\u306E\u7D50\u679C\u7121\u3057":ve.meanAbsoluteRankDifference.toFixed(2)})},{key:"body",term:"\u672C\u6587",description:(0,re.jsx)(G,{fg:"fg",type:"body",testId:"compare-text-hidden",children:E.text_hidden?"\u5217\u306E\u30B9\u30B3\u30FC\u30D7\u3067\u4F0F\u305B\u3066\u3044\u307E\u3059":"\u793A\u3057\u3066\u3044\u307E\u3059"})}],testId:"compare-agreement"}),[[B,"A"],[se,"B"]].map(([f,H])=>f.dense_ran?null:(0,re.jsx)(qe,{tone:"warning",testId:`compare-degraded-${H.toLowerCase()}`,children:(0,re.jsx)(G,{as:"p",fg:"fg",type:"prose",children:`\u5909\u7A2E ${H} (${Y(f.strategy_id)}) \u306E\u5BC6\u306E\u5C64\u306F\u8D70\u308A\u307E\u305B\u3093\u3067\u3057\u305F\u3002${f.degradation_reasons.map(Ht).join(" ")}`})},H)),oe.length===0?(0,re.jsx)(G,{as:"p",fg:"fg",type:"prose",testId:"compare-empty",children:"\u3069\u3061\u3089\u306E\u5909\u7A2E\u306B\u3082\u7D50\u679C\u306F\u3042\u308A\u307E\u305B\u3093\u3002"}):(0,re.jsx)(dn,{caption:"\u5909\u7A2E\u3054\u3068\u306E\u9806\u4F4D",attributes:oe.map(f=>({key:`rank-${f}`,label:`${f} \u4F4D`})),columns:[Fe(B,"a"),Fe(se,"b")],attributePx:64,columnMinPx:272,testId:"compare-grid"})]})})};return(0,re.jsxs)(Te,{gap:"space-6",testId:"model-comparison-workbench",children:[(0,re.jsx)(dt,{title:"\u5909\u7A2E\u306E\u6BD4\u3079",description:"\u540C\u3058\u554F\u3044\u3092 2 \u3064\u306E\u6226\u7565\u306E\u5909\u7A2E\u3067\u691C\u7D22\u3057\u3001\u9806\u4F4D\u3092\u4E26\u3079\u307E\u3059\u3002\u5024\u306F\u5909\u7A2E\u3054\u3068\u306B\u5225\u306E\u91CF\u306A\u306E\u3067\u6B63\u898F\u5316\u3057\u307E\u305B\u3093\u3002",testId:"compare-card",dataAttributes:{"data-running":K},children:e.length<2?(0,re.jsx)(qe,{tone:"info",testId:"compare-variants-insufficient",children:(0,re.jsx)(G,{as:"p",fg:"fg",type:"prose",children:`\u6BD4\u3079\u308B\u306B\u306F\u5909\u7A2E\u304C 2 \u3064\u4EE5\u4E0A\u8981\u308A\u307E\u3059 (\u4ECA\u306F ${e.length} \u4EF6)\u3002`})}):(0,re.jsx)("form",{onSubmit:De,noValidate:!0,"data-testid":"compare-form",children:(0,re.jsxs)(Te,{gap:"space-4",testId:"compare-form-fields",children:[(0,re.jsx)(Gt,{label:"\u5909\u7A2E A",value:String(q),options:Ie,onValueChange:E=>r(Number(E)),testId:"compare-variant-a"}),(0,re.jsx)(Gt,{label:"\u5909\u7A2E B",value:String(de),options:Ie,onValueChange:E=>l(Number(E)),error:k.variant,testId:"compare-variant-b"}),(0,re.jsx)(Nt,{label:"\u554F\u3044",type:"search",value:i,onValueChange:x,required:!0,description:`1\u301C${yt.SEARCH_PARAM_LIMITS.queryLength.max} \u5B57`,error:Z,testId:"compare-query"}),(0,re.jsx)(St,{label:"\u4EF6\u6570",value:O,min:yt.SEARCH_PARAM_LIMITS.limit.min,max:yt.SEARCH_PARAM_LIMITS.limit.max,step:1,valueText:E=>`${E} \u4EF6`,onValueChange:P,testId:"compare-limit"}),(0,re.jsx)(lt,{gap:"space-2",testId:"compare-actions",children:(0,re.jsx)(Ne,{variant:"primary",type:"submit",busy:K,busyLabel:"\u6BD4\u3079\u3066\u3044\u307E\u3059",testId:"compare-submit",children:"\u6BD4\u3079\u308B"})})]})})}),F!==null&&(0,re.jsx)(ze,{occurrence:F.occurrence,testId:"compare-failure",children:F.message}),R!==null&&le(R)]})}var C=require("react/jsx-runtime");function Ar(e){return e===null?an:`${e.length} \u7A2E`}var an="\u672A\u8A2D\u5B9A";function nn(e,t=""){return e===null?an:`${e}${t}`}function kn(e){return e===null?an:`${e} \u4EF6`}function po(e){if(e.currentVersion===null&&e.lifecyclePhase===null)return`${e.schemaName} (\u79FB\u884C\u53F0\u5E33\u306F\u672A\u8A18\u9332)`;let t=e.currentVersion===null?an:`v${e.currentVersion}`;return`${e.schemaName} ${t} (${e.lifecyclePhase??an})`}function mo({tenantId:e,ontologyStatus:t}){let n=t.classes,a=t.predicates;return(0,C.jsxs)("div",{"data-cui-migration":"pending",className:"space-y-6","data-testid":"ontology-status-card",children:[(0,C.jsxs)("div",{className:"rounded-xl border border-slate-200 border-solid bg-white p-6 shadow-sm",children:[(0,C.jsxs)("div",{className:"flex flex-col justify-between gap-3 md:flex-row md:items-center",children:[(0,C.jsxs)("div",{children:[(0,C.jsxs)("div",{className:"flex items-center gap-2",children:[(0,C.jsx)("h2",{className:"font-bold text-base text-slate-900",children:"\u30AA\u30F3\u30C8\u30ED\u30B8\u30FC & \u30B9\u30AD\u30FC\u30DE\u30AC\u30D0\u30CA\u30F3\u30B9\u72B6\u614B"}),(0,C.jsx)("span",{className:`inline-flex items-center rounded-full px-2.5 py-0.5 font-bold text-xs ${t.autonomousEvolutionEnabled?"bg-emerald-100 text-emerald-800":"bg-slate-100 text-slate-700"}`,"data-testid":"ontology-evolution-badge",children:t.autonomousEvolutionEnabled?"\u81EA\u5F8B\u7684\u30AA\u30F3\u30C8\u30ED\u30B8\u30FC\u9032\u5316: \u6709\u52B9":"\u81EA\u5F8B\u9032\u5316: \u505C\u6B62\u4E2D"}),(0,C.jsx)("span",{className:"inline-flex items-center rounded-sm bg-indigo-100 px-2 py-0.5 font-mono font-semibold text-indigo-800 text-xs","data-testid":"ontology-schema-version",children:po(t)})]}),(0,C.jsx)("p",{className:"mt-1 text-slate-500 text-xs",children:"Neo4j \u7269\u7406\u30B0\u30E9\u30D5\u30B9\u30AD\u30FC\u30DE\u5236\u7D04\u3001\u8AD6\u7406\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u30AF\u30E9\u30B9\u4F53\u7CFB\u3001\u304A\u3088\u3073\u4EBA\u9593\u53C2\u52A0\u578B (HITL) \u30AA\u30F3\u30C8\u30ED\u30B8\u30FC\u6607\u683C\u30D1\u30A4\u30D7\u30E9\u30A4\u30F3\u306E\u7A3C\u50CD\u72B6\u6CC1"})]}),(0,C.jsxs)("div",{className:"inline-flex items-center rounded-lg border border-slate-200 border-solid bg-slate-50 px-3 py-1.5 font-medium text-slate-600 text-xs",children:["\u30C6\u30CA\u30F3\u30C8\u540D\u524D\u7A7A\u9593:"," ",(0,C.jsx)("span",{className:"ml-1.5 font-bold text-slate-800","data-testid":"ontology-tenant-id",children:e})]})]}),(0,C.jsxs)("div",{className:"mt-4 grid grid-cols-2 gap-3 sm:grid-cols-4",children:[(0,C.jsxs)("div",{className:"rounded-lg border border-slate-200 border-solid bg-slate-50/70 p-3",children:[(0,C.jsx)("span",{className:"block text-slate-500 text-xs",children:"\u7269\u7406\u4E00\u610F\u5236\u7D04 (Unique)"}),(0,C.jsx)("span",{className:"mt-1 block font-bold font-mono text-base text-slate-900","data-testid":"ontology-constraints-count",children:kn(t.totalConstraints)})]}),(0,C.jsxs)("div",{className:"rounded-lg border border-slate-200 border-solid bg-slate-50/70 p-3",children:[(0,C.jsx)("span",{className:"block text-slate-500 text-xs",children:"\u691C\u7D22\u7D22\u5F15 (DDL \u304C\u4F5C\u308B\u5206)"}),(0,C.jsx)("span",{className:"mt-1 block font-bold font-mono text-base text-slate-900","data-testid":"ontology-indexes-count",children:kn(t.searchIndexes)}),(0,C.jsxs)("span",{className:"block text-slate-500 text-xs","data-testid":"ontology-indexes-total",children:["\u5168\u7D22\u5F15: ",kn(t.totalIndexes)]})]}),(0,C.jsxs)("div",{className:"rounded-lg border border-slate-200 border-solid bg-slate-50/70 p-3",children:[(0,C.jsx)("span",{className:"block text-slate-500 text-xs",children:"\u6607\u683C\u5224\u5B9A\u3057\u304D\u3044\u5024 (\u78BA\u4FE1\u5EA6/\u5171\u8D77)"}),(0,C.jsxs)("span",{className:"mt-1 block font-bold font-mono text-base text-indigo-700","data-testid":"ontology-thresholds-info",children:[nn(t.promotionThresholds.confidence)," / ",nn(t.promotionThresholds.cooccurrence," \u56DE")]})]}),(0,C.jsxs)("div",{className:"rounded-lg border border-slate-200 border-solid bg-slate-50/70 p-3",children:[(0,C.jsx)("span",{className:"block text-slate-500 text-xs",children:"HITL \u6607\u683C\u627F\u8A8D\u5F85\u3061\u5019\u88DC"}),(0,C.jsx)("span",{className:"mt-1 block font-bold font-mono text-amber-700 text-base","data-testid":"ontology-unresolved-count",children:kn(t.unresolvedCandidatesCount)})]})]})]}),(0,C.jsxs)("div",{className:"grid grid-cols-1 gap-6 lg:grid-cols-2",children:[(0,C.jsxs)("div",{className:"rounded-xl border border-slate-200 border-solid bg-white p-6 shadow-sm",children:[(0,C.jsxs)("div",{className:"flex items-center justify-between pb-3",children:[(0,C.jsxs)("div",{children:[(0,C.jsx)("h3",{className:"font-bold text-slate-900 text-sm",children:"\u30AA\u30F3\u30C8\u30ED\u30B8\u30FC\u4E3B\u8981\u30AF\u30E9\u30B9\u4F53\u7CFB (Node Labels)"}),(0,C.jsx)("p",{className:"text-slate-500 text-xs",children:"\u30B0\u30E9\u30D5\u5185\u3067\u30E2\u30C7\u30EB\u5316\u3055\u308C\u3066\u3044\u308B\u6B63\u6E96\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u30CE\u30FC\u30C9\u7A2E\u5225"})]}),(0,C.jsx)("span",{className:"rounded-sm bg-indigo-50 px-2 py-0.5 font-semibold text-indigo-700 text-xs","data-testid":"ontology-classes-count",children:Ar(n)})]}),(0,C.jsxs)("div",{className:"divide-y divide-solid divide-slate-100",children:[n===null&&(0,C.jsx)("p",{className:"py-3 text-slate-500 text-xs","data-testid":"ontology-classes-unsupplied",children:"\u3053\u306E\u914D\u5099\u306E\u30AF\u30E9\u30B9\u8A9E\u5F59\u304C\u4F9B\u7D66\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002\u5B9F\u88C5\u304C\u8A31\u3059\u8A9E\u5F59\u3092\u8FD4\u3059\u7D4C\u8DEF\u304C\u7D50\u7DDA\u3055\u308C\u3066\u3044\u306A\u3044\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059\u3002"}),n?.map(o=>(0,C.jsxs)("div",{className:"flex items-start justify-between py-2.5","data-testid":`ontology-class-${o.name}`,children:[(0,C.jsxs)("div",{children:[(0,C.jsx)("span",{className:"inline-block font-bold font-mono text-indigo-700 text-xs",children:o.name}),(0,C.jsx)("p",{className:"mt-0.5 text-slate-600 text-xs",children:o.description})]}),typeof o.count=="number"&&(0,C.jsx)("span",{className:"rounded-sm bg-slate-100 px-2 py-0.5 font-mono text-slate-600 text-xs",children:o.count.toLocaleString()})]},o.name))]})]}),(0,C.jsxs)("div",{className:"rounded-xl border border-slate-200 border-solid bg-white p-6 shadow-sm",children:[(0,C.jsxs)("div",{className:"flex items-center justify-between pb-3",children:[(0,C.jsxs)("div",{children:[(0,C.jsx)("h3",{className:"font-bold text-slate-900 text-sm",children:"\u30EA\u30EC\u30FC\u30B7\u30E7\u30F3\u30B7\u30C3\u30D7\u8FF0\u8A9E\u4F53\u7CFB (Predicates)"}),(0,C.jsx)("p",{className:"text-slate-500 text-xs",children:"\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u9593\u306E\u30BB\u30DE\u30F3\u30C6\u30A3\u30C3\u30AF\u95A2\u4FC2\u3068\u6709\u5411\u6027"})]}),(0,C.jsx)("span",{className:"rounded-sm bg-amber-50 px-2 py-0.5 font-semibold text-amber-700 text-xs","data-testid":"ontology-predicates-count",children:Ar(a)})]}),(0,C.jsxs)("div",{className:"divide-y divide-solid divide-slate-100",children:[a===null&&(0,C.jsx)("p",{className:"py-3 text-slate-500 text-xs","data-testid":"ontology-predicates-unsupplied",children:"\u3053\u306E\u914D\u5099\u306E\u8FF0\u8A9E\u8A9E\u5F59\u304C\u4F9B\u7D66\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002\u5B9F\u88C5\u304C\u8A31\u3059\u8A9E\u5F59\u3092\u8FD4\u3059\u7D4C\u8DEF\u304C\u7D50\u7DDA\u3055\u308C\u3066\u3044\u306A\u3044\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059\u3002"}),a?.map(o=>(0,C.jsxs)("div",{className:"flex items-start justify-between py-2.5","data-testid":`ontology-predicate-${o.name}`,children:[(0,C.jsxs)("div",{children:[(0,C.jsx)("span",{className:"inline-block font-bold font-mono text-amber-800 text-xs",children:o.name}),(0,C.jsx)("p",{className:"mt-0.5 text-slate-600 text-xs",children:o.description})]}),(0,C.jsx)("span",{className:"rounded-sm border border-slate-200 border-solid bg-slate-50 px-2 py-0.5 font-mono text-[11px] text-slate-600",children:o.direction})]},o.name))]})]})]}),(0,C.jsxs)("div",{className:"rounded-xl border border-indigo-100 border-solid bg-indigo-50/40 p-5 shadow-sm","data-testid":"ontology-evolution-policy-card",children:[(0,C.jsx)("h3",{className:"font-bold text-indigo-950 text-sm",children:"\u81EA\u5F8B\u7684\u30AA\u30F3\u30C8\u30ED\u30B8\u30FC\u9032\u5316 (Autonomous Ontology Evolution) \u30DD\u30EA\u30B7\u30FC"}),(0,C.jsxs)("div",{className:"mt-2 grid grid-cols-1 gap-3 text-indigo-900 text-xs md:grid-cols-3",children:[(0,C.jsxs)("div",{className:"rounded-lg border border-indigo-200/60 border-solid bg-white p-3",children:[(0,C.jsx)("span",{className:"font-semibold text-slate-700",children:"3 \u6761\u4EF6 AND \u30B2\u30FC\u30C8:"}),(0,C.jsxs)("p",{className:"mt-1 text-slate-600",children:["\u672A\u89E3\u6C7A\u30E1\u30F3\u30B7\u30E7\u30F3\u51FA\u73FE\u6642\u306B\u985E\u4F3C\u5EA6 \u2267 ",nn(t.promotionThresholds.confidence),"\u3001\u5171\u8D77\u56DE\u6570 \u2267 ",nn(t.promotionThresholds.cooccurrence),"\u3001\u8B58\u5225\u30E6\u30FC\u30B6\u30FC\u6570 \u2267"," ",nn(t.promotionThresholds.minDistinctUsers)," \u306E\u5168\u5145\u8DB3\u3092\u8981\u6C42\u3002"]})]}),(0,C.jsxs)("div",{className:"rounded-lg border border-indigo-200/60 border-solid bg-white p-3",children:[(0,C.jsx)("span",{className:"font-semibold text-slate-700",children:"2x \u5171\u8D77\u983B\u5EA6\u518D\u63D0\u6848\u30D0\u30C3\u30AF\u30AA\u30D5:"}),(0,C.jsx)("p",{className:"mt-1 text-slate-600",children:"\u904B\u7528\u8005\u306B\u3088\u308A\u6607\u683C\u3092\u5374\u4E0B\u3055\u308C\u305F\u5019\u88DC\u306F\u3001\u524D\u56DE\u306E\u5171\u8D77\u6570\u306E 2 \u500D\u4EE5\u4E0A\u306E\u983B\u5EA6\u3067\u518D\u8A00\u53CA\u3055\u308C\u308B\u307E\u3067\u6607\u683C\u30AD\u30E5\u30FC\u3078\u306E\u518D\u6D6E\u4E0A\u3092\u81EA\u52D5\u6291\u5236\u3002"})]}),(0,C.jsxs)("div",{className:"rounded-lg border border-indigo-200/60 border-solid bg-white p-3",children:[(0,C.jsx)("span",{className:"font-semibold text-slate-700",children:"Cypher AST ABAC \u8A8D\u53EF\u6CE8\u5165:"}),(0,C.jsxs)("p",{className:"mt-1 text-slate-600",children:["Neo4j \u30AF\u30A8\u30EA\u5B9F\u884C\u6642\u306B ",(0,C.jsx)("code",{className:"font-mono text-indigo-800",children:"tenantId = $tenant_id"})," \u3068\u6A5F\u5BC6\u533A\u5206\u8FF0\u8A9E\u3092\u4E0D\u53EF\u5206\u306B\u5408\u6210\u3057\u3001\u30C6\u30CA\u30F3\u30C8\u5B8C\u5168\u9694\u96E2\u3092\u62C5\u4FDD\u3002"]})]})]})]})]})}var xe=require("@aiquants/enrichment-core"),Le=require("react");var Tn=require("@aiquants/console-ui/core"),wn=require("@aiquants/enrichment-core"),kt={inset:12,labelFontSize:13,captionFontSize:11},bt={offset:3,stroke:2},Mr={node:{width:(0,Tn.ceil8)(Math.max(...Object.values(wn.PIPELINE_STEPS).map(e=>(0,Tn.textWidthEm)(e.label)))*kt.labelFontSize+2*kt.inset),height:56},gap:{column:48,row:24},padding:24};function gt(e){return Math.round(e*1e3)/1e3}function fo(e){let t=new Map;for(let n of e){let a=n.dependsOn.reduce((o,r)=>Math.max(o,t.get(r)),-1);t.set(n.step,a+1)}return t}function va(e,t){return`${e}->${t}`}function yo(e,t){let n=[],a=new Map;return{slots:[...e.map(r=>{let u=t.get(r.step),l=r.dependsOn.map(i=>{let x=[],O=i;for(let P=t.get(i)+1;P<u;P+=1){let p=`${va(i,r.step)}@${P}`;n.push({id:p,rank:P,predecessors:[O]}),x.push(p),O=p}return a.set(va(i,r.step),x),O});return{id:r.step,rank:u,predecessors:l}}),...n],chains:a}}function go(e){let t=new Map,n=Math.max(...e.map(a=>a.rank));for(let a=0;a<=n;a+=1){let r=e.filter(u=>u.rank===a).map((u,l)=>{let i=a===0?l:u.predecessors.reduce((x,O)=>x+t.get(O),0)/u.predecessors.length;return{slot:u,barycenter:i}});r.sort((u,l)=>u.barycenter-l.barycenter),r.forEach(({slot:u},l)=>{t.set(u.id,l)})}return t}function Sa(e,t=Mr){let n=(0,wn.orderedSteps)(e),a=fo(n),{slots:o,chains:r}=yo(n,a),u=go(o),{node:l,gap:i,padding:x}=t,O=F=>({x:gt(x+F.rank*(l.width+i.column)),y:gt(x+u.get(F.id)*(l.height+i.row))}),P=new Map(o.map(F=>[F.id,O(F)])),p=n.map(F=>{let W=P.get(F.step);return{key:F.step,x:W.x,y:W.y,rank:a.get(F.step),order:u.get(F.step),width:l.width,height:l.height}}),D=F=>gt(F+l.height/2),K=n.flatMap(F=>F.dependsOn.map(W=>{let Q=P.get(W),ue=P.get(F.step),te=gt(Q.x+l.width),q=D(Q.y),de=`M ${te} ${q}`,Se=(k,Z)=>{let Y=gt((te+k)/2);de+=` C ${Y} ${q}, ${Y} ${Z}, ${k} ${Z}`};for(let k of r.get(va(W,F.step))){let Z=P.get(k),Y=D(Z.y);Se(Z.x,Y),te=gt(Z.x+l.width),q=Y,de+=` L ${te} ${q}`}return Se(ue.x,D(ue.y)),{from:W,to:F.step,path:de}})),m=[...P.values()],R=gt(Math.max(...m.map(F=>F.x+l.width))+x),N=gt(Math.max(...m.map(F=>F.y+l.height))+x);return{width:R,height:N,steps:p,edges:K}}var y=require("react/jsx-runtime"),Or="\u4F9D\u5B58\u306A\u3057 (\u6D41\u308C\u306E\u6700\u521D\u306B\u8D70\u308B)",Na={EXTRACTING:"\u62BD\u51FA",ENRICHING:"\u8981\u7D04",PROJECTING:"\u6295\u5F71"},Fr={rebuild:"\u672C\u6587\u304B\u3089\u7D44\u307F\u76F4\u3059",existing:"\u524D\u6BB5\u304C\u66F8\u3044\u305F\u884C\u3092\u305D\u306E\u307E\u307E\u4F7F\u3046"},_a={open:{badge:"\u9580: \u958B",stroke:"stroke-emerald-500",dash:void 0},"closed-skip":{badge:"\u9580: \u9589 (\u7701\u7565)",stroke:"stroke-amber-500",dash:void 0},"closed-fail":{badge:"\u9580: \u9589 (\u5931\u6557)",stroke:"stroke-red-500",dash:void 0},unmeasured:{badge:"\u9580: \u672A\u6E2C\u5B9A",stroke:"stroke-slate-400",dash:"6 4"}},Ia={none:"\u9580\u306A\u3057",skip:"\u9589\u3058\u305F\u3089\u7701\u7565",fail:"\u9589\u3058\u305F\u3089\u5931\u6557",mixed:"\u9589\u3058\u305F\u9580\u3067\u7570\u306A\u308B"},bo={open:"\u958B",closed:"\u9589",unmeasured:"\u672A\u6E2C\u5B9A"},rn="rgb(248 250 252)",xo={backgroundColor:rn,backgroundImage:`linear-gradient(to right, ${rn}, ${rn}), linear-gradient(to right, ${rn}, ${rn}), linear-gradient(to right, rgb(15 23 42 / 0.2), transparent), linear-gradient(to left, rgb(15 23 42 / 0.2), transparent)`,backgroundPosition:"left center, right center, left center, right center",backgroundRepeat:"no-repeat",backgroundSize:"24px 100%, 24px 100%, 12px 100%, 12px 100%",backgroundAttachment:"local, local, scroll, scroll"};function Ca(e,t){let n=t[e.featureFlagKey];return n===void 0?"unmeasured":n?"open":"closed"}function Ur(e,t){let n=e.map(a=>({gate:a,state:Ca(a,t)}));return n.some(({gate:a,state:o})=>o==="closed"&&a.whenClosed==="fail")?"closed-fail":n.some(({state:a})=>a==="closed")?"closed-skip":n.some(({state:a})=>a==="unmeasured")?"unmeasured":"open"}function Ea(e){return e.length===0?"none":e.every(t=>t.whenClosed==="fail")?"fail":e.every(t=>t.whenClosed==="skip")?"skip":"mixed"}function Kr(e,t){let{badge:n}=_a[e];return t==="none"||e==="closed-skip"||e==="closed-fail"?n:`${n}\u30FB${Ia[t]}`}function ho(e){return e.whenClosed==="skip"?"\u9589\u3058\u305F\u3068\u304D\u306F\u6BB5\u3092\u7701\u7565":`\u9589\u3058\u305F\u3068\u304D\u306F ${e.failureStatus} \u3067\u5931\u6557`}function Ra(e){return e.map(t=>xe.PIPELINE_STEPS[t].label).join("\u3001")}function vo(e){return e.dependsOn.length===0?Or:`\u4F9D\u5B58: ${Ra(e.dependsOn)}`}function So({featureFlags:e,metrics:t,metricSampleWindow:n,selectedKind:a,onSelectKind:o,selectedStepKey:r,onSelectStep:u}){if(!Number.isSafeInteger(n)||n<=0)throw new RangeError(`metricSampleWindow must be a positive integer, got ${n}.`);let l=(0,Le.useId)(),i=(0,Le.useId)(),x=(0,Le.useId)(),O=(0,Le.useId)(),P=(0,Le.useId)(),[p,D]=(0,Le.useState)(xe.DOCUMENT_KINDS[0]),[K,m]=(0,Le.useState)(null),[R,N]=(0,Le.useState)(null),F=(0,Le.useRef)(new Map),W=(0,Le.useRef)(new Map),Q=(0,Le.useRef)(null),ue=(0,Le.useRef)(null),{labels:te}=T(),q=a!==void 0?a:p,de=r!==void 0?r:K,Se=(0,xe.flowFor)(q),k=Sa(Se),Z=new Map(Se.steps.map(f=>[f.step,f])),Y=f=>{m(f),u?.(f)},_e=f=>{D(f),o?.(f),Y(null)},Xe=(f,H)=>{let pe=xe.DOCUMENT_KINDS.length-1,me;switch(f.key){case"ArrowRight":me=H===pe?0:H+1;break;case"ArrowLeft":me=H===0?pe:H-1;break;case"Home":me=0;break;case"End":me=pe;break;default:return}f.preventDefault();let Ce=xe.DOCUMENT_KINDS[me];_e(Ce),F.current.get(Ce)?.focus()},De=f=>{let H=ue.current;if(Y(null),H?.isConnected){H.focus();return}W.current.get(f)?.focus()},Ie=f=>{Y(f===de?null:f)},$e=(f,H)=>{f.currentTarget.focus(),Ie(H)},le=(f,H)=>{f.key==="Enter"||f.key===" "?(f.preventDefault(),Ie(H)):f.key==="Escape"&&Y(null)},E=de===null?void 0:Z.get(de),X=E===void 0?null:E.step;(0,Le.useEffect)(()=>{if(X===null){ue.current=null;return}let f=document.activeElement;(f instanceof HTMLElement||f instanceof SVGElement)&&f!==document.body&&Q.current?.contains(f)===!1&&(ue.current=f)},[X]);let B=E===void 0?void 0:xe.PIPELINE_STEPS[E.step],se=E===void 0?[]:(0,xe.flowStepGates)(E),ve=E===void 0?[]:Se.steps.filter(f=>f.dependsOn.includes(E.step)).map(f=>f.step),oe=B===void 0?void 0:t.find(f=>f.documentKind===q&&f.stepKey===B.key),Fe=xe.DOCUMENT_KIND_LABELS[q];return(0,y.jsxs)("section",{"data-cui-migration":"pending",className:"space-y-6","aria-labelledby":l,"data-testid":"pipeline-flow-viewer","data-kind":q,children:[(0,y.jsxs)("div",{className:"rounded-xl border border-slate-200 border-solid bg-white p-6 shadow-sm",children:[(0,y.jsx)("h2",{id:l,className:"font-bold text-base text-slate-900",children:"\u53D6\u308A\u8FBC\u307F\u30D1\u30A4\u30D7\u30E9\u30A4\u30F3"}),(0,y.jsx)("p",{className:"mt-2 text-[13px] text-slate-500",children:"\u6587\u66F8\u306E\u7A2E\u985E\u3054\u3068\u306B\u3001\u5B9F\u969B\u306B\u8D70\u308B\u6BB5\u3068\u305D\u306E\u4F9D\u5B58\u3092\u63CF\u304D\u307E\u3059\u3002\u5404\u6BB5\u304C\u5F85\u3064\u6BB5\u306F\u3001\u6BB5\u306E\u8AAC\u660E\u3068\u8A73\u7D30\u306B\u3082\u6587\u5B57\u3067\u793A\u3057\u307E\u3059\u3002\u9580\u306E\u72B6\u614B\u306F\u30C6\u30CA\u30F3\u30C8\u306E\u6A5F\u80FD\u30D5\u30E9\u30B0\u3092\u91CD\u306D\u305F\u3082\u306E\u3067\u3059\u3002"}),(0,y.jsx)("div",{role:"tablist","aria-label":"\u6587\u66F8\u306E\u7A2E\u985E",className:"mt-4 flex flex-wrap gap-2","data-testid":"flow-kind-tablist",children:xe.DOCUMENT_KINDS.map((f,H)=>{let pe=f===q;return(0,y.jsx)("button",{ref:me=>{me===null?F.current.delete(f):F.current.set(f,me)},type:"button",role:"tab","aria-selected":pe,"aria-controls":i,tabIndex:pe?0:-1,onClick:()=>_e(f),onKeyDown:me=>Xe(me,H),className:pe?"rounded-lg border border-indigo-600 border-solid bg-indigo-600 px-3 py-1.5 font-semibold text-[13px] text-white":"rounded-lg border border-slate-300 border-solid bg-white px-3 py-1.5 font-medium text-[13px] text-slate-700 hover:bg-slate-50","data-testid":`flow-kind-${f}`,children:xe.DOCUMENT_KIND_LABELS[f]},f)})}),(0,y.jsx)("div",{id:i,role:"tabpanel","aria-label":`${xe.DOCUMENT_KIND_LABELS[q]} \u306E\u6D41\u308C`,"aria-describedby":x,className:"mt-4 overflow-x-auto rounded-lg border border-slate-200 border-solid p-4",style:xo,"data-testid":"flow-scroll",children:(0,y.jsxs)("svg",{viewBox:`0 0 ${k.width} ${k.height}`,width:k.width,height:k.height,role:"group","aria-label":`${xe.DOCUMENT_KIND_LABELS[q]} \u306E\u30D1\u30A4\u30D7\u30E9\u30A4\u30F3`,style:{display:"block",maxWidth:"none"},"data-testid":"flow-svg",children:[(0,y.jsx)("title",{children:`${xe.DOCUMENT_KIND_LABELS[q]} \u306E\u30D1\u30A4\u30D7\u30E9\u30A4\u30F3`}),(0,y.jsx)("defs",{children:(0,y.jsx)("marker",{id:`${i}-arrow`,viewBox:"0 0 8 8",refX:"8",refY:"4",markerWidth:"8",markerHeight:"8",orient:"auto",children:(0,y.jsx)("path",{d:"M 0 0 L 8 4 L 0 8 z",className:"fill-slate-500","data-testid":"flow-edge-arrowhead"})})}),k.edges.map(f=>(0,y.jsx)("path",{d:f.path,fill:"none",strokeWidth:1.5,markerEnd:`url(#${i}-arrow)`,className:"stroke-slate-500","data-testid":`flow-edge-${f.from}-${f.to}`},`${f.from}-${f.to}`)),k.steps.map(f=>{let H=xe.PIPELINE_STEPS[f.key],pe=Z.get(f.key),me=(0,xe.flowStepGates)(pe),Ce=Ur(me,e),Ve=Ea(me),Ue=_a[Ce],nt=Kr(Ce,Ve),ke=f.key===de,at=f.key===R,Ae=`${i}-depends-${f.key}`;return(0,y.jsxs)("g",{ref:Ke=>{Ke===null?W.current.delete(f.key):W.current.set(f.key,Ke)},transform:`translate(${f.x} ${f.y})`,role:"button",tabIndex:0,"aria-label":`${H.label} (${nt})`,"aria-describedby":Ae,"aria-expanded":ke,"aria-controls":ke?P:void 0,onClick:Ke=>$e(Ke,f.key),onKeyDown:Ke=>le(Ke,f.key),onFocus:()=>N(f.key),onBlur:()=>N(null),className:"cursor-pointer focus:outline-none","data-testid":`flow-node-${f.key}`,"data-step-key":f.key,"data-gate-state":Ce,"data-gate-policy":Ve,"data-selected":ke,"data-focused":at,children:[(0,y.jsx)("desc",{id:Ae,"data-testid":`flow-node-dependencies-${f.key}`,children:vo(pe)}),at&&(0,y.jsx)("rect",{x:-bt.offset,y:-bt.offset,width:f.width+2*bt.offset,height:f.height+2*bt.offset,rx:8+bt.offset,fill:"none",strokeWidth:bt.stroke,className:"stroke-indigo-600","data-testid":`flow-node-focus-ring-${f.key}`}),(0,y.jsx)("rect",{width:f.width,height:f.height,rx:8,strokeWidth:ke?3:1.5,strokeDasharray:Ue.dash,className:`${Ue.stroke} ${ke?"fill-indigo-50":"fill-white"}`,"data-testid":`flow-node-box-${f.key}`}),(0,y.jsx)("text",{x:kt.inset,y:20,className:"fill-slate-900 font-semibold text-[13px]","data-testid":`flow-node-label-${f.key}`,children:H.label}),(0,y.jsx)("text",{x:kt.inset,y:36,className:"fill-slate-600 text-[11px]","data-testid":`flow-node-phase-${f.key}`,children:Na[H.phase]}),(0,y.jsx)("text",{x:kt.inset,y:49,className:"fill-slate-700 text-[11px]","data-testid":`flow-gate-badge-${f.key}`,"data-gate-state":Ce,children:nt})]},f.key)})]})}),(0,y.jsxs)("p",{id:x,className:"mt-2 text-[11px] text-slate-500","data-testid":"flow-scroll-hint",children:["\u56F3\u306F\u5B9F\u5BF8 (\u5E45 ",k.width," px) \u3067\u63CF\u304D\u307E\u3059\u3002\u8868\u793A\u5E45\u306B\u53CE\u307E\u3089\u306A\u3044\u3068\u304D\u306F\u6A2A\u306B\u30B9\u30AF\u30ED\u30FC\u30EB\u3057\u3066\u304F\u3060\u3055\u3044 (Tab \u3067\u6BB5\u3078\u79FB\u308B\u3068\u3001\u305D\u306E\u6BB5\u304C\u898B\u3048\u308B\u4F4D\u7F6E\u307E\u3067\u52D5\u304D\u307E\u3059)\u3002"]})]}),B!==void 0&&E!==void 0&&(0,y.jsxs)("section",{id:P,ref:Q,className:"rounded-xl border border-slate-200 border-solid bg-white p-6 shadow-sm","aria-labelledby":O,"data-testid":"flow-step-detail","data-step-key":B.key,children:[(0,y.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,y.jsxs)("div",{children:[(0,y.jsx)("h3",{id:O,className:"font-bold text-base text-slate-900",children:B.label}),(0,y.jsx)("p",{className:"mt-1 text-[13px] text-slate-600",children:B.description})]}),(0,y.jsx)("button",{type:"button",onClick:()=>De(B.key),className:"rounded-lg border border-slate-300 border-solid px-3 py-1.5 text-[13px] text-slate-700 hover:bg-slate-50","data-testid":"flow-step-detail-close",children:"\u9589\u3058\u308B"})]}),(0,y.jsxs)("dl",{className:"mt-4 grid grid-cols-1 gap-3 text-[13px] sm:grid-cols-2",children:[(0,y.jsxs)("div",{children:[(0,y.jsx)("dt",{className:"font-semibold text-slate-500",children:"\u30A8\u30F3\u30C9\u30DD\u30A4\u30F3\u30C8"}),(0,y.jsx)("dd",{children:(0,y.jsx)("code",{className:"font-mono","data-testid":"flow-step-endpoint",children:B.endpoint})})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("dt",{className:"font-semibold text-slate-500",children:"\u76F8"}),(0,y.jsxs)("dd",{"data-testid":"flow-step-phase",children:[Na[B.phase]," (",B.phase,")"]})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("dt",{className:"font-semibold text-slate-500",children:"\u80FD\u529B"}),(0,y.jsx)("dd",{"data-testid":"flow-step-capability",children:B.capability===null?"\u30E2\u30C7\u30EB\u3078\u9001\u3089\u306A\u3044":B.capability})]}),E.chunkSource!==void 0&&(0,y.jsxs)("div",{children:[(0,y.jsx)("dt",{className:"font-semibold text-slate-500",children:"\u30C1\u30E3\u30F3\u30AF\u306E\u51FA\u6240"}),(0,y.jsxs)("dd",{"data-testid":"flow-step-chunk-source","data-chunk-source":E.chunkSource,children:[Fr[E.chunkSource]," (",E.chunkSource,")"]})]}),(0,y.jsxs)("div",{className:"sm:col-span-2",children:[(0,y.jsx)("dt",{className:"font-semibold text-slate-500",children:"\u4F9D\u5B58 (\u5148\u306B\u7D42\u3048\u308B\u6BB5)"}),(0,y.jsx)("dd",{"data-testid":"flow-step-depends-on",children:E.dependsOn.length===0?Or:Ra(E.dependsOn)})]}),(0,y.jsxs)("div",{className:"sm:col-span-2",children:[(0,y.jsx)("dt",{className:"font-semibold text-slate-500",children:"\u5F8C\u7D9A (\u3053\u306E\u6BB5\u3092\u5F85\u3064\u6BB5)"}),(0,y.jsx)("dd",{"data-testid":"flow-step-dependents",children:ve.length===0?"\u5F8C\u7D9A\u306A\u3057 (\u6D41\u308C\u306E\u6700\u5F8C\u306B\u8D70\u308B)":Ra(ve)})]}),(0,y.jsxs)("div",{className:"sm:col-span-2",children:[(0,y.jsx)("dt",{className:"font-semibold text-slate-500",children:"\u9580"}),(0,y.jsx)("dd",{children:se.length===0?(0,y.jsx)("span",{"data-testid":"flow-step-no-gates",children:"\u9580\u306A\u3057 (\u5E38\u306B\u8D70\u308B)"}):(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("ul",{className:"space-y-1",children:se.map(f=>{let H=Ca(f,e);return(0,y.jsxs)("li",{"data-testid":`flow-gate-${f.featureFlagKey}`,"data-gate-state":H,"data-when-closed":f.whenClosed,children:[(0,y.jsx)("code",{className:"font-mono",children:f.featureFlagKey}),": ",bo[H]," \u2014 ",ho(f)]},f.featureFlagKey)})}),E.gatePolicy!==void 0&&(0,y.jsxs)("p",{className:"mt-1 text-slate-600","data-testid":"flow-gate-policy-override",children:[Fe," \u306E\u6D41\u308C\u3067\u306F\u6BB5\u306E\u5BA3\u8A00 (",Ia[Ea(B.gates)],") \u3092\u4E0A\u66F8\u304D\u3057\u3001\u9580\u304C\u9589\u3058\u308B\u3068\u5B9F\u884C\u3092 ",E.gatePolicy.failureStatus," \u3067\u5931\u6557\u3055\u305B\u307E\u3059\u3002"]})]})})]})]}),(0,y.jsxs)("div",{className:"mt-4 rounded-lg border border-slate-200 border-solid bg-slate-50 p-4","data-testid":"flow-step-metric","data-kind":q,children:[(0,y.jsxs)("span",{className:"block font-semibold text-[13px] text-slate-700",children:["\u76F4\u8FD1\u306E\u96C6\u8A08 (",Fe,"\u30FB\u76F4\u8FD1 ",n," \u4EF6)"]}),(0,y.jsxs)("p",{className:"mt-1 text-[11px] text-slate-500","data-testid":"flow-metric-scope",children:[Fe," \u306E\u5B9F\u884C\u306B\u5C5E\u3059\u308B\u3001\u3053\u306E\u6BB5\u306E\u65B0\u3057\u3044\u8A18\u9332 ",n," \u4EF6\u307E\u3067\u3092\u96C6\u8A08\u3057\u3066\u3044\u307E\u3059\u3002\u4ED6\u306E\u7A2E\u985E\u306E\u5B9F\u884C\u306F\u6570\u3048\u307E\u305B\u3093\u3002"]}),oe===void 0?(0,y.jsxs)("p",{className:"mt-1 text-[13px] text-slate-500","data-testid":"flow-step-metric-empty","data-unmeasured-note":!0,children:[te.unmeasured," (",Fe," \u306E\u5B9F\u884C\u3067\u3053\u306E\u6BB5\u3092\u8A18\u9332\u3057\u305F\u3082\u306E\u306F\u307E\u3060\u3042\u308A\u307E\u305B\u3093)"]}):(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)("dl",{className:"mt-2 grid grid-cols-2 gap-2 text-[13px] sm:grid-cols-4",children:[(0,y.jsxs)("div",{children:[(0,y.jsx)("dt",{className:"text-slate-500",children:"\u6A19\u672C\u6570 (\u7701\u7565\u3092\u9664\u304F)"}),(0,y.jsx)("dd",{"data-testid":"flow-metric-sample-count",children:(0,y.jsx)(j,{value:oe.sampleCount,testId:"flow-metric-sample-count-value"})})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("dt",{className:"text-slate-500",children:"\u6210\u529F"}),(0,y.jsx)("dd",{"data-testid":"flow-metric-succeeded",children:(0,y.jsx)(j,{value:oe.succeeded,testId:"flow-metric-succeeded-value"})})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("dt",{className:"text-slate-500",children:"\u5931\u6557"}),(0,y.jsx)("dd",{"data-testid":"flow-metric-failed",children:(0,y.jsx)(j,{value:oe.failed,testId:"flow-metric-failed-value"})})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("dt",{className:"text-slate-500",children:"\u7701\u7565"}),(0,y.jsx)("dd",{"data-testid":"flow-metric-skipped",children:(0,y.jsx)(j,{value:oe.skipped,testId:"flow-metric-skipped-value"})})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("dt",{className:"text-slate-500",children:"p50"}),(0,y.jsx)("dd",{className:"whitespace-nowrap","data-testid":"flow-metric-p50",children:(0,y.jsx)(j,{value:oe.durationP50Ms,unit:"ms",testId:"flow-metric-p50-value"})})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("dt",{className:"text-slate-500",children:"p95"}),(0,y.jsx)("dd",{className:"whitespace-nowrap","data-testid":"flow-metric-p95",children:(0,y.jsx)(j,{value:oe.durationP95Ms,unit:"ms",testId:"flow-metric-p95-value"})})]}),(0,y.jsxs)("div",{className:"col-span-2",children:[(0,y.jsx)("dt",{className:"text-slate-500",children:"\u6700\u5F8C\u306E\u958B\u59CB"}),(0,y.jsx)("dd",{"data-testid":"flow-metric-last-started-at",children:(0,y.jsx)(ge,{iso:oe.lastStartedAt,testId:"flow-metric-last-started-at-value"})})]})]}),(0,y.jsxs)("p",{className:"mt-2 text-[11px] text-slate-500","data-testid":"flow-metric-note","data-unmeasured-note":!0,children:["p50 / p95 \u306F\u6240\u8981\u3092\u6E2C\u3063\u305F\u8A18\u9332\u3060\u3051\u304B\u3089\u6C42\u3081\u307E\u3059\u3002\u7701\u7565\u3057\u305F\u6BB5\u306F\u300C\u7701\u7565\u300D\u306B\u3060\u3051\u6570\u3048\u3001\u6A19\u672C\u6570\u306B\u3082\u6240\u8981\u306B\u3082\u5165\u308A\u307E\u305B\u3093\u3002\u4F55\u3082\u547C\u3070\u305A\u306B\u6B62\u307E\u3063\u305F\u5931\u6557 (\u6240\u8981 ",te.unmeasured,") \u306F\u6A19\u672C\u6570\u3068\u300C\u5931\u6557\u300D\u306B\u306F\u5165\u308A\u307E\u3059\u304C\u3001\u6240\u8981\u306B\u306F\u5165\u308A\u307E\u305B\u3093\u3002"]})]})]})]}),(0,y.jsxs)("div",{className:"rounded-xl border border-slate-200 border-solid bg-white p-6 shadow-sm",children:[(0,y.jsx)("h3",{className:"font-bold text-base text-slate-900",children:"MIME \u578B\u304B\u3089\u7A2E\u985E\u3078\u306E\u5206\u985E\u8868"}),(0,y.jsxs)("p",{className:"mt-1 text-[13px] text-slate-500",children:["\u5206\u985E\u5668\u304C\u8AAD\u3080\u8868\u305D\u306E\u3082\u306E\u3067\u3059\u3002",(0,y.jsx)("code",{className:"font-mono",children:"*"})," \u3067\u7D42\u308F\u308B\u898F\u5247\u306F\u524D\u65B9\u4E00\u81F4\u3001\u305D\u308C\u4EE5\u5916\u306F\u5B8C\u5168\u4E00\u81F4\u3067\u3001\u6700\u521D\u306B\u4E00\u81F4\u3057\u305F\u898F\u5247\u304C\u52DD\u3061\u307E\u3059\u3002\u3069\u306E\u898F\u5247\u306B\u3082\u4E00\u81F4\u3057\u306A\u3044\u578B\u306F\u300C",xe.DOCUMENT_KIND_LABELS.other,"\u300D\u3067\u3059\u3002"]}),(0,y.jsx)("div",{className:"relative mt-4 overflow-x-auto","data-testid":"flow-mime-scroll",children:(0,y.jsxs)("table",{className:"min-w-full divide-y divide-solid divide-slate-200 text-left text-[13px]","data-testid":"flow-mime-table",children:[(0,y.jsx)("thead",{className:"bg-slate-50 font-semibold text-slate-700",children:(0,y.jsxs)("tr",{children:[(0,y.jsx)("th",{scope:"col",className:"px-3 py-2",children:"MIME \u578B\u306E\u30D1\u30BF\u30FC\u30F3"}),(0,y.jsx)("th",{scope:"col",className:"px-3 py-2",children:"\u7A2E\u985E"})]})}),(0,y.jsx)("tbody",{className:"divide-y divide-solid divide-slate-100",children:xe.MIME_KIND_RULES.map(([f,H],pe)=>(0,y.jsxs)("tr",{className:H===q?"bg-indigo-50":void 0,"data-testid":`flow-mime-rule-${pe}`,"data-kind":H,"data-selected":H===q,children:[(0,y.jsx)("td",{className:"px-3 py-2",children:(0,y.jsx)("code",{className:"font-mono",children:f})}),(0,y.jsx)("td",{className:"px-3 py-2",children:xe.DOCUMENT_KIND_LABELS[H]})]},f))})]})})]})]})}var Pn=require("@aiquants/console-ui/core"),qr=require("react");var L=require("react/jsx-runtime");function No(e,t){return e==null?null:ft(e,"segment_count",t)}function Br(e,t,n){return e==null?null:_n(e,t,n)}function Eo(e){let t=e.probe_failure;if(t===null)return null;if(!jt.test(t))throw new RangeError("overview.probe_failure must name why the collections could not be read (pass null when they were measured)");if(e.collections.length>0)throw new RangeError(`overview carries ${e.collections.length} collections and a probe_failure; pass the collections with probe_failure null, or an empty list with the reason`);return t}function Hr(e,t,n){return e.reduce((a,o)=>a+ft(o[t],`${t} of collection ${o.collection_name}`,n),0)}var Ro=(0,Pn.cssVar)("space-1"),_o={padding:0,height:"1px",color:"#1e293b"},Io={display:"flex",height:"100%"},Co={fontWeight:500,marginBlock:"auto",overflowWrap:"normal"},ko={display:"flex",alignItems:"baseline",gap:"12px",marginBottom:"12px"},To={display:"flex",flexWrap:"wrap",alignItems:"baseline",columnGap:"10px",rowGap:"4px",flex:"1 1 0%",minWidth:0},ka={whiteSpace:"nowrap"},Vr=(0,Pn.cssVar)("space-3"),wo=(0,Pn.cssVar)("info-tint"),Ta={fontSize:"11px",padding:"2px 6px",borderRadius:"4px",whiteSpace:"nowrap"};function Gr(e,t){return`vectors_config.${e}.size of collection ${t}`}function Po({overview:e,health:t,resources:n,onRefresh:a,isRefreshing:o=!1,selection:r}){let{formatLocale:u}=T(),l=(0,qr.useId)(),{collections:i}=e,x=Eo(e),O=x===null,P=O?Hr(i,"points_count",u):null,p=O?Hr(i,"vectors_count",u):null,D=Br(n?.ram_bytes,"ram_bytes",u),K=Br(n?.disk_bytes,"disk_bytes",u),m=No(n?.segment_count,u);return(0,L.jsxs)("div",{"data-cui-migration":"pending","data-testid":"qdrant-storage-card",style:{border:"1px solid #e2e8f0",borderRadius:"8px",padding:"16px",backgroundColor:"#ffffff"},children:[(0,L.jsxs)("div",{"data-testid":"qdrant-card-header",style:ko,children:[(0,L.jsxs)("div",{"data-testid":"qdrant-card-title-group",style:To,children:[(0,L.jsx)("h2",{style:{margin:0,fontSize:"16px",fontWeight:700,color:"#1e293b"},children:"Qdrant \u30D9\u30AF\u30C8\u30EB\u30B9\u30C8\u30EC\u30FC\u30B8\u76E3\u8996"}),t!==void 0&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)("span",{"data-testid":"qdrant-health-badge","data-healthy":String(t.healthy),...Kt[t.healthy?"connected":"error"],style:{...ka,fontSize:"12px",padding:"2px 8px",borderRadius:"12px",fontWeight:600},children:Ut[t.healthy?"connected":"error"]}),(0,L.jsxs)("span",{"data-testid":"qdrant-latency",style:{...ka,fontSize:"12px",color:"#64748b"},children:["\u5FDC\u7B54\u6642\u9593: ",(0,L.jsx)(j,{value:t.latency_ms,unit:"ms",testId:"qdrant-latency-value"})]})]})]}),a&&(0,L.jsx)("button",{type:"button","data-testid":"qdrant-refresh-button",disabled:o,onClick:a,style:{...ka,flexShrink:0,padding:"6px 12px",borderRadius:"4px",border:"1px solid #cbd5e1",backgroundColor:"#ffffff",cursor:o?"not-allowed":"pointer",fontSize:"13px"},children:o?"\u66F4\u65B0\u4E2D\u2026":"\u66F4\u65B0"})]}),(0,L.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(140px, 1fr))",gap:"10px",marginBottom:"16px",padding:"10px",backgroundColor:"#f8fafc",borderRadius:"6px"},children:[(0,L.jsxs)("div",{children:[(0,L.jsx)("div",{style:{fontSize:"12px",color:"#64748b"},children:"\u7DCF\u30DD\u30A4\u30F3\u30C8\u6570"}),(0,L.jsx)("div",{"data-testid":"qdrant-total-points",style:{fontSize:"18px",fontWeight:700,color:"#0f172a"},children:(0,L.jsx)(j,{value:P,testId:"qdrant-total-points-value"})})]}),(0,L.jsxs)("div",{children:[(0,L.jsx)("div",{style:{fontSize:"12px",color:"#64748b"},children:"\u7DCF\u30D9\u30AF\u30C8\u30EB\u6570"}),(0,L.jsx)("div",{"data-testid":"qdrant-total-vectors",style:{fontSize:"18px",fontWeight:700,color:"#0f172a"},children:(0,L.jsx)(j,{value:p,testId:"qdrant-total-vectors-value"})})]}),(0,L.jsxs)("div",{children:[(0,L.jsx)("div",{style:{fontSize:"12px",color:"#64748b"},children:"\u30E1\u30E2\u30EA\u6D88\u8CBB (RAM)"}),(0,L.jsx)("div",{"data-testid":"qdrant-ram-usage",style:{fontSize:"18px",fontWeight:700,color:"#0f172a"},children:(0,L.jsx)(He,{text:D,testId:"qdrant-ram-usage-value"})})]}),(0,L.jsxs)("div",{children:[(0,L.jsx)("div",{style:{fontSize:"12px",color:"#64748b"},children:"\u30C7\u30A3\u30B9\u30AF\u6D88\u8CBB"}),(0,L.jsx)("div",{"data-testid":"qdrant-disk-usage",style:{fontSize:"18px",fontWeight:700,color:"#0f172a"},children:(0,L.jsx)(He,{text:K,testId:"qdrant-disk-usage-value"})})]}),(0,L.jsxs)("div",{children:[(0,L.jsx)("div",{style:{fontSize:"12px",color:"#64748b"},children:"\u30BB\u30B0\u30E1\u30F3\u30C8\u7DCF\u6570"}),(0,L.jsx)("div",{"data-testid":"qdrant-segment-count",style:{fontSize:"18px",fontWeight:700,color:"#0f172a"},children:(0,L.jsx)(j,{value:m,testId:"qdrant-segment-count-value"})})]})]}),(0,L.jsxs)("div",{children:[(0,L.jsxs)("h3",{id:l,style:{margin:"0 0 8px 0",fontSize:"14px",color:"#334155"},children:["\u30B3\u30EC\u30AF\u30B7\u30E7\u30F3\u4E00\u89A7 (",(0,L.jsx)(j,{value:O?i.length:null,unit:"\u4EF6",testId:"qdrant-collections-count"}),")"]}),x!==null?(0,L.jsx)("p",{"data-testid":"qdrant-probe-failure",style:{margin:0,fontSize:"13px",color:"#92400e",backgroundColor:"#fffbeb",border:"1px solid #f59e0b",borderRadius:"6px",padding:"8px"},children:x}):i.length===0?(0,L.jsx)("p",{"data-testid":"no-collections-message",style:{margin:0,fontSize:"13px",color:"#64748b"},children:"\u767B\u9332\u3055\u308C\u3066\u3044\u308B\u30B3\u30EC\u30AF\u30B7\u30E7\u30F3\u306F\u3042\u308A\u307E\u305B\u3093\u3002"}):(0,L.jsx)("section",{tabIndex:0,"aria-labelledby":l,"data-testid":"qdrant-collections-scroll",style:{overflowX:"auto",WebkitOverflowScrolling:"touch",padding:Ro},children:(0,L.jsxs)("table",{"aria-labelledby":l,"data-testid":"qdrant-collections-list",style:{width:"100%",borderCollapse:"collapse",fontSize:"13px"},children:[(0,L.jsx)("thead",{children:(0,L.jsxs)("tr",{style:{borderBottom:"1px solid #e2e8f0",color:"#64748b"},children:[(0,L.jsx)("th",{scope:"col","data-testid":"qdrant-collections-name-header",style:{padding:`6px ${Vr}`,textAlign:"start"},children:"\u30B3\u30EC\u30AF\u30B7\u30E7\u30F3\u540D"}),(0,L.jsx)("th",{scope:"col",style:{padding:"6px 8px",textAlign:"start"},children:"\u30C9\u30E1\u30A4\u30F3"}),(0,L.jsx)("th",{scope:"col","data-testid":"qdrant-collections-points-header",style:{padding:"6px 8px",textAlign:"end"},children:"\u30DD\u30A4\u30F3\u30C8\u6570"}),(0,L.jsx)("th",{scope:"col",style:{padding:"6px 8px",textAlign:"start"},children:"\u30D9\u30AF\u30C8\u30EB\u69CB\u6210"})]})}),(0,L.jsx)("tbody",{children:i.map(R=>{let N=r!==void 0&&R.collection_name===r.selectedCollectionName,F=(0,L.jsx)("span",{style:Co,children:R.collection_name}),{dense:W,sparse:Q,image:ue}=R.vectors_config,te=W===void 0?null:ft(W.size,Gr("dense",R.collection_name),u),q=ue===void 0?null:ft(ue.size,Gr("image",R.collection_name),u);return(0,L.jsxs)("tr",{"data-testid":`collection-row-${R.collection_name}`,"data-collection-name":R.collection_name,"data-selected":String(N),style:{borderBottom:"1px solid #f1f5f9",backgroundColor:N?wo:"transparent"},children:[r===void 0?(0,L.jsx)("td",{style:{padding:`8px ${Vr}`,color:"#1e293b"},children:F}):(0,L.jsx)("td",{style:_o,children:(0,L.jsx)("div",{style:Io,children:(0,L.jsx)($a,{selected:N,controls:r.detailId,onSelect:()=>r.onSelectCollection(R.collection_name),testId:`collection-select-${R.collection_name}`,children:F})})}),(0,L.jsx)("td",{style:{padding:"8px",color:"#475569"},children:R.domain_key}),(0,L.jsx)("td",{"data-testid":`collection-points-${R.collection_name}`,style:{padding:"8px",color:"#0f172a",textAlign:"end"},children:(0,L.jsx)(j,{value:R.points_count,testId:`collection-points-value-${R.collection_name}`})}),(0,L.jsx)("td",{style:{padding:"8px"},children:(0,L.jsxs)("div",{style:{display:"flex",gap:"6px",flexWrap:"wrap"},children:[te!==null&&(0,L.jsxs)("span",{"data-testid":`vector-tag-dense-${R.collection_name}`,style:{...Ta,backgroundColor:"#e0e7ff",color:"#3730a3"},children:["Dense: ",(0,L.jsx)(j,{value:te,unit:"\u6B21\u5143",testId:`vector-tag-dense-size-${R.collection_name}`})]}),Q!==void 0&&(0,L.jsx)("span",{"data-testid":`vector-tag-sparse-${R.collection_name}`,style:{...Ta,backgroundColor:"#fef3c7",color:"#92400e"},children:Q.modifier?`Sparse (${Q.modifier.toUpperCase()})`:"Sparse"}),q!==null&&(0,L.jsxs)("span",{"data-testid":`vector-tag-image-${R.collection_name}`,style:{...Ta,backgroundColor:"#f3e8ff",color:"#6b21a8"},children:["Image: ",(0,L.jsx)(j,{value:q,unit:"\u6B21\u5143",testId:`vector-tag-image-size-${R.collection_name}`})]})]})})]},R.collection_name)})})]})})]})]})}var A=require("react/jsx-runtime"),Lo="\u5BFE\u8C61\u306A\u3057";function $o({counts:e,totalFiles:t,failedItems:n=[],onRetryAll:a,onRetryItem:o,isRetrying:r=!1,onRefresh:u,listRefusal:l}){T();let i=e.SYNCED??0,x=e.PENDING??0,O=(e.EXTRACTING??0)+(e.ENRICHING??0)+(e.PROJECTING??0),P=(e.FAILED_EXTRACT??0)+(e.FAILED_ENRICH??0)+(e.FAILED_VECTOR??0)+(e.FAILED_GRAPH??0),p=t>0?`${(i/t*100).toFixed(1)}%`:Lo;return(0,A.jsxs)("div",{"data-cui-migration":"pending","data-testid":"sync-status-monitor",style:{border:"1px solid #e2e8f0",borderRadius:"8px",padding:"16px",backgroundColor:"#ffffff"},children:[(0,A.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"16px"},children:[(0,A.jsxs)("div",{children:[(0,A.jsx)("h2",{style:{margin:0,fontSize:"16px",fontWeight:700,color:"#1e293b"},children:"\u30A8\u30F3\u30EA\u30C3\u30C1\u30E1\u30F3\u30C8\u540C\u671F\u30B9\u30C6\u30FC\u30BF\u30B9"}),(0,A.jsxs)("p",{style:{margin:"4px 0 0 0",fontSize:"13px",color:"#64748b"},children:["\u7DCF\u30D5\u30A1\u30A4\u30EB\u6570:"," ",(0,A.jsx)("span",{"data-testid":"total-files-count",style:{fontWeight:600},children:t})," ","\u4EF6 (\u540C\u671F\u5B8C\u4E86\u7387: ",(0,A.jsx)("span",{"data-testid":"success-rate-value",children:p}),")"]})]}),(0,A.jsxs)("div",{style:{display:"flex",gap:"8px"},children:[u&&(0,A.jsx)("button",{type:"button","data-testid":"sync-refresh-button",onClick:u,style:{padding:"6px 12px",borderRadius:"4px",border:"1px solid #cbd5e1",backgroundColor:"#ffffff",cursor:"pointer",fontSize:"13px"},children:"\u66F4\u65B0"}),a&&(0,A.jsx)("button",{type:"button","data-testid":"retry-all-button",disabled:r||P===0,onClick:a,style:{padding:"6px 14px",borderRadius:"4px",border:"none",backgroundColor:r||P===0?"#94a3b8":"#dc2626",color:"#ffffff",cursor:r||P===0?"not-allowed":"pointer",fontSize:"13px",fontWeight:500},children:r?"\u518D\u8A66\u884C\u4E2D...":"\u5931\u6557\u30B8\u30E7\u30D6\u4E00\u62EC\u518D\u8A66\u884C"})]})]}),(0,A.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(130px, 1fr))",gap:"10px",marginBottom:"20px"},children:[(0,A.jsxs)("div",{"data-testid":"status-card-synced","data-count":i,style:{border:"1px solid #10b981",borderRadius:"6px",padding:"10px",backgroundColor:"#ecfdf5"},children:[(0,A.jsx)("div",{style:{fontSize:"12px",color:"#065f46"},children:"\u5B8C\u5168\u540C\u671F (SYNCED)"}),(0,A.jsx)("div",{"data-testid":"synced-count",style:{fontSize:"20px",fontWeight:700,color:"#047857"},children:i})]}),(0,A.jsxs)("div",{"data-testid":"status-card-processing","data-count":O,style:{border:"1px solid #3b82f6",borderRadius:"6px",padding:"10px",backgroundColor:"#eff6ff"},children:[(0,A.jsx)("div",{style:{fontSize:"12px",color:"#1e40af"},children:"\u51E6\u7406\u4E2D (PROCESSING)"}),(0,A.jsx)("div",{"data-testid":"processing-count",style:{fontSize:"20px",fontWeight:700,color:"#1d4ed8"},children:O})]}),(0,A.jsxs)("div",{"data-testid":"status-card-pending","data-count":x,style:{border:"1px solid #64748b",borderRadius:"6px",padding:"10px",backgroundColor:"#f8fafc"},children:[(0,A.jsx)("div",{style:{fontSize:"12px",color:"#334155"},children:"\u5F85\u6A5F\u4E2D (PENDING)"}),(0,A.jsx)("div",{"data-testid":"pending-count",style:{fontSize:"20px",fontWeight:700,color:"#475569"},children:x})]}),(0,A.jsxs)("div",{"data-testid":"status-card-failed","data-count":P,style:{border:"1px solid #ef4444",borderRadius:"6px",padding:"10px",backgroundColor:"#fef2f2"},children:[(0,A.jsx)("div",{style:{fontSize:"12px",color:"#991b1b"},children:"\u5931\u6557 (FAILED)"}),(0,A.jsx)("div",{"data-testid":"failed-count",style:{fontSize:"20px",fontWeight:700,color:"#b91c1c"},children:P})]})]}),(0,A.jsxs)("div",{"data-testid":"failed-items-section",children:[(0,A.jsxs)("h3",{style:{margin:"0 0 8px 0",fontSize:"14px",color:"#334155"},"data-testid":"failed-items-heading",children:["\u540C\u671F\u5931\u6557\u30A2\u30A4\u30C6\u30E0\u4E00\u89A7",l!==void 0?"":` (${n.length<P?`\u4E0A\u4F4D ${n.length} \u4EF6 / \u5168 ${P} \u4EF6`:`${n.length} \u4EF6`})`]}),l!==void 0?(0,A.jsx)(qe,{tone:"warning",testId:"failed-items-refused",children:l}):n.length===0?(0,A.jsx)("p",{"data-testid":"no-failed-items-message",style:{margin:0,fontSize:"13px",color:"#64748b"},children:"\u73FE\u5728\u3001\u540C\u671F\u5931\u6557\u30A2\u30A4\u30C6\u30E0\u306F\u3042\u308A\u307E\u305B\u3093\u3002"}):(0,A.jsx)("div",{style:{overflowX:"auto"},children:(0,A.jsxs)("table",{"data-testid":"failed-items-table",style:{width:"100%",borderCollapse:"collapse",fontSize:"13px"},children:[(0,A.jsx)("thead",{children:(0,A.jsxs)("tr",{style:{borderBottom:"1px solid #e2e8f0",textAlign:"left",color:"#64748b"},children:[(0,A.jsx)("th",{style:{padding:"6px 8px"},children:"\u30D5\u30A1\u30A4\u30EB URI"}),(0,A.jsx)("th",{style:{padding:"6px 8px"},children:"\u72B6\u614B"}),(0,A.jsx)("th",{style:{padding:"6px 8px"},children:"\u30A8\u30E9\u30FC\u5185\u5BB9"}),(0,A.jsx)("th",{style:{padding:"6px 8px"},children:"\u5931\u6557\u65E5\u6642"}),(0,A.jsx)("th",{style:{padding:"6px 8px",textAlign:"right"},children:"\u64CD\u4F5C"})]})}),(0,A.jsx)("tbody",{children:n.map((D,K)=>{if(D.kind==="restricted")return(0,A.jsxs)("tr",{"data-testid":`failed-item-restricted-${K}`,"data-restricted-mark":"failure",children:[(0,A.jsx)("td",{"data-testid":`failed-item-restricted-text-${K}`,style:{padding:"8px"},children:Rt}),(0,A.jsx)("td",{style:{padding:"8px"},children:(0,A.jsx)("span",{"data-testid":`failed-item-restricted-status-${K}`,style:{fontSize:"11px"},children:D.syncStatus})}),(0,A.jsx)("td",{style:{padding:"8px"}}),(0,A.jsx)("td",{"data-testid":`failed-item-restricted-time-${K}`,style:{padding:"8px",whiteSpace:"nowrap"},children:D.failedAt===null?"\u8A18\u9332\u306A\u3057":(0,A.jsx)(ge,{iso:D.failedAt,testId:`failed-item-restricted-time-value-${K}`})}),(0,A.jsx)("td",{style:{padding:"8px"}})]},`restricted:${K}`);let m=D.item;return(0,A.jsxs)("tr",{"data-testid":`failed-item-row-${m.id}`,"data-file-uri":m.file_uri,style:{borderBottom:"1px solid #f1f5f9"},children:[(0,A.jsxs)("td",{"data-testid":`failed-item-uri-${m.id}`,style:{padding:"8px",wordBreak:"break-all"},children:[(0,A.jsx)("div",{style:{fontWeight:600,color:"#0f172a"},children:m.file_name}),(0,A.jsx)("div",{style:{fontSize:"11px",color:"#64748b"},children:m.file_uri})]}),(0,A.jsx)("td",{style:{padding:"8px"},children:(0,A.jsx)("span",{"data-testid":`failed-item-status-${m.id}`,style:{fontSize:"11px",padding:"2px 6px",borderRadius:"4px",backgroundColor:"#fee2e2",color:"#991b1b",fontWeight:500},children:m.sync_status})}),(0,A.jsx)("td",{"data-testid":`failed-item-error-${m.id}`,style:{padding:"8px",color:"#dc2626",maxWidth:"260px",wordBreak:"break-word"},title:m.error_message??"",children:m.error_message??"\u4E0D\u660E\u306A\u30A8\u30E9\u30FC"}),(0,A.jsx)("td",{"data-testid":`failed-item-time-${m.id}`,style:{padding:"8px",color:"#64748b",whiteSpace:"nowrap"},children:m.failed_at===null?"\u8A18\u9332\u306A\u3057":(0,A.jsx)(ge,{iso:m.failed_at,testId:`failed-item-time-value-${m.id}`})}),(0,A.jsx)("td",{style:{padding:"8px",textAlign:"right"},children:o&&(0,A.jsx)("button",{type:"button","data-testid":`retry-item-button-${m.id}`,"aria-label":`${m.file_name} (${m.file_uri}) \u3092\u518D\u8A66\u884C`,disabled:r,onClick:()=>o(m.id,m.file_uri),style:{padding:"4px 8px",borderRadius:"4px",border:"1px solid #dc2626",backgroundColor:"#ffffff",color:"#dc2626",cursor:r?"not-allowed":"pointer",fontSize:"12px"},children:"\u518D\u8A66\u884C"})})]},`readable:${m.id}`)})})]})})]})]})}0&&(module.exports={BREAKER_STATE_LABELS,CHUNKING_ONLY_NOTE,CHUNK_BODY_FIDELITY_LABELS,CHUNK_CHANGE_KIND_LABELS,CHUNK_SOURCE_LABELS,CONFIDENTIALITY_LEVEL_LABELS,DEGRADATION_REASON_LABELS,DOCUMENT_STATE_CAUSE_LABELS,DegradedSearchBanner,DocumentChangeFeed,DocumentHistoryInspector,DocumentIngestConsole,EnrichmentStrategyBoard,FACET_LABELS,FAILED_RUN_STATE_MARK,FIELD_LABELS,FLOW_FOCUS_RING,FLOW_GEOMETRY,FLOW_NODE_TEXT,FinishedInstant,GATE_POLICY_LABELS,GATE_STATE_PRESENTATION,HIDDEN_FIELD_TEXT,HISTORY_REFUSAL,INERT_STAGE_NOTE,InfrastructureHealthMonitor,MODEL_ONLY_CHANGE_MARK,MetadataSearchWorkbench,ModelComparisonWorkbench,NOTHING_TO_READ_LABELS,NO_ENRICHMENT_RECORD_TEXT,NO_PREVIOUS_RECORD_TEXT,OntologyStatusCard,PHASE_LABELS,PIPELINE_RUN_STATUS_PRESENTATION,PIPELINE_STEP_STATUS_PRESENTATION,PIPELINE_TRIGGER_LABELS,PipelineFlowViewer,QUALITY_TIER_LABELS,QdrantStorageCard,RESTRICTED_DOCUMENT_TEXT,RESTRICTED_RUN_TEXT,RESTRICTED_STATE_TEXT,RUN_TERMINAL_STEP_LABEL,RUN_TERMINAL_STEP_OUTCOME_LABELS,RecordedInstant,SCORE_DECIMALS,SCORE_DISPLAY_DECIMALS,SEARCH_FUSION_LABELS,SEARCH_MODE_LABELS,SEARCH_PRESETS,SyncStatusMonitor,UNFINISHED_LABEL,UNRECORDED_RUN_MARK,UNVERIFIED_CHUNK_NOTE,WHITESPACE_NORMALIZED_NOTE,degradationReasonText,documentKindLabel,facetCountsText,fieldLabel,gateCaption,gateState,gateStateOf,historyFailedSentence,historyFailureSentence,ingestRowAction,jsonValueText,layoutFlow,ledgerStepLabel,pipelineRunPresentationKey,rankAgreement,revisionLabel,revisionTransitionText,skipReasonLabel,stepGatePolicy,stepGateState,unrecordedRunsMark,variantHitKey,vectorScoreText});
|