rssany 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.example +1 -1
- package/README.md +5 -1
- package/app/plugins/builtin/rss.rssany.js +107 -24
- package/app/plugins/site.rssany.js +1 -1
- package/dist/index.js +986 -266
- package/dist/index.js.map +1 -1
- package/{config.examples.json → init/config.json} +7 -1
- package/init/sources.json +353 -0
- package/package.json +4 -6
- package/statics/401.html +1 -1
- package/statics/README.md +1 -1
- package/webui/build/200.html +16 -18
- package/webui/build/_app/immutable/assets/0.C6Q_nuW9.css +1 -0
- package/webui/build/_app/immutable/assets/10.Dj8_pmut.css +1 -0
- package/webui/build/_app/immutable/assets/11.qYZMiTb0.css +1 -0
- package/webui/build/_app/immutable/assets/12.Ct59LCqW.css +1 -0
- package/webui/build/_app/immutable/assets/13.BhO9zvFi.css +1 -0
- package/webui/build/_app/immutable/assets/14.CujIhjQK.css +1 -0
- package/webui/build/_app/immutable/assets/15.nNGjXhCQ.css +1 -0
- package/webui/build/_app/immutable/assets/16.PP9XLDf7.css +1 -0
- package/webui/build/_app/immutable/assets/4.9wPHhVwv.css +1 -0
- package/webui/build/_app/immutable/assets/6.DSJfjJwx.css +1 -0
- package/webui/build/_app/immutable/assets/7.CrNxmd8B.css +1 -0
- package/webui/build/_app/immutable/assets/8.Ba5_jYIY.css +1 -0
- package/webui/build/_app/immutable/assets/{9.BZheTlzZ.css → 9.m-LCx_kl.css} +1 -1
- package/webui/build/_app/immutable/assets/BackToParentRoute.DGk-X5ow.css +1 -0
- package/webui/build/_app/immutable/assets/SourcesList.yTBBi3_m.css +1 -0
- package/webui/build/_app/immutable/assets/homeFeedPanelStore.BopJZtHu.css +1 -0
- package/webui/build/_app/immutable/chunks/{V2-VOe88.js → B-OsL1Ct.js} +1 -1
- package/webui/build/_app/immutable/chunks/B2Q1a1-H.js +2 -0
- package/webui/build/_app/immutable/chunks/BK3WtZwv.js +1 -0
- package/webui/build/_app/immutable/chunks/BQqoDzLx.js +1 -0
- package/webui/build/_app/immutable/chunks/BXCWEhUd.js +1 -0
- package/webui/build/_app/immutable/chunks/BbWUOQ_m.js +1 -0
- package/webui/build/_app/immutable/chunks/Bp63qm3L.js +1 -0
- package/webui/build/_app/immutable/chunks/CVzlFH44.js +1 -0
- package/webui/build/_app/immutable/chunks/CWNeClHp.js +6 -0
- package/webui/build/_app/immutable/chunks/Cihqbfi5.js +1 -0
- package/webui/build/_app/immutable/chunks/CkUAV0m0.js +41 -0
- package/webui/build/_app/immutable/chunks/CtijX1u3.js +31 -0
- package/webui/build/_app/immutable/chunks/D5GvRCv7.js +1 -0
- package/webui/build/_app/immutable/chunks/DEDI7Ecm.js +1 -0
- package/webui/build/_app/immutable/chunks/DFuhmi31.js +1 -0
- package/webui/build/_app/immutable/chunks/DMWEh-Ek.js +2 -0
- package/webui/build/_app/immutable/chunks/{CZDFXKiF.js → DcAshVxe.js} +1 -1
- package/webui/build/_app/immutable/chunks/DjNLq3TF.js +1 -0
- package/webui/build/_app/immutable/chunks/Dt2CddFe.js +1 -0
- package/webui/build/_app/immutable/chunks/Dw782Tjs.js +1 -0
- package/webui/build/_app/immutable/chunks/EIZIMsXK.js +1 -0
- package/webui/build/_app/immutable/chunks/Xy_fhzQq.js +1 -0
- package/webui/build/_app/immutable/chunks/lk5LaiqA.js +1 -0
- package/webui/build/_app/immutable/chunks/mW5RwvnK.js +13 -0
- package/webui/build/_app/immutable/chunks/{CtHRh_pJ.js → tB7QMF3U.js} +1 -1
- package/webui/build/_app/immutable/chunks/xtNWTdbD.js +1 -0
- package/webui/build/_app/immutable/entry/app.DdgnooOk.js +2 -0
- package/webui/build/_app/immutable/entry/start.DhJaJZhR.js +1 -0
- package/webui/build/_app/immutable/nodes/0.BE05Cuc4.js +11 -0
- package/webui/build/_app/immutable/nodes/1.5DFDaT4c.js +1 -0
- package/webui/build/_app/immutable/nodes/10.OVK4i9XE.js +1 -0
- package/webui/build/_app/immutable/nodes/11.Dhn_rO4A.js +1 -0
- package/webui/build/_app/immutable/nodes/12.Cg8AeCSH.js +1 -0
- package/webui/build/_app/immutable/nodes/13.nT3SOzEB.js +1 -0
- package/webui/build/_app/immutable/nodes/14.B_KpJLxn.js +1 -0
- package/webui/build/_app/immutable/nodes/15.RaWaA-0I.js +1 -0
- package/webui/build/_app/immutable/nodes/{12.CMcby_lY.js → 16.DSUgqolV.js} +15 -15
- package/webui/build/_app/immutable/nodes/2.BYWOpaxy.js +1 -0
- package/webui/build/_app/immutable/nodes/3.wQvGs9w-.js +1 -0
- package/webui/build/_app/immutable/nodes/4.DTSxpKm7.js +2 -0
- package/webui/build/_app/immutable/nodes/5.CCtn90c0.js +1 -0
- package/webui/build/_app/immutable/nodes/6.C2_mjW1u.js +1 -0
- package/webui/build/_app/immutable/nodes/7.Dwz6W7A1.js +1 -0
- package/webui/build/_app/immutable/nodes/8.DzkEw6rx.js +1 -0
- package/webui/build/_app/immutable/nodes/9.DtlXEwe1.js +1 -0
- package/webui/build/_app/version.json +1 -1
- package/sources.example.json +0 -562
- package/webui/build/_app/immutable/assets/0.BUAXpTm6.css +0 -1
- package/webui/build/_app/immutable/assets/10.I1OuCLrU.css +0 -1
- package/webui/build/_app/immutable/assets/11.CrO9xaki.css +0 -1
- package/webui/build/_app/immutable/assets/12.BEi6fInA.css +0 -1
- package/webui/build/_app/immutable/assets/14.Ctlgn1LZ.css +0 -1
- package/webui/build/_app/immutable/assets/2.eJ80XOGm.css +0 -1
- package/webui/build/_app/immutable/assets/4.B8-jYAVj.css +0 -1
- package/webui/build/_app/immutable/assets/6.Drn-0DON.css +0 -1
- package/webui/build/_app/immutable/assets/7.ms2diq_q.css +0 -1
- package/webui/build/_app/immutable/assets/8.DKymkjjs.css +0 -1
- package/webui/build/_app/immutable/assets/SourcesList.BhtYlRsQ.css +0 -1
- package/webui/build/_app/immutable/chunks/BUngiKFg.js +0 -1
- package/webui/build/_app/immutable/chunks/Bt0fzibd.js +0 -1
- package/webui/build/_app/immutable/chunks/BxHqDcpw.js +0 -1
- package/webui/build/_app/immutable/chunks/ByQRbEUX.js +0 -1
- package/webui/build/_app/immutable/chunks/C12mHcUp.js +0 -6
- package/webui/build/_app/immutable/chunks/C1kQ4pHy.js +0 -1
- package/webui/build/_app/immutable/chunks/C74gbb4Q.js +0 -1
- package/webui/build/_app/immutable/chunks/CAtemnMo.js +0 -1
- package/webui/build/_app/immutable/chunks/CVjCNJia.js +0 -1
- package/webui/build/_app/immutable/chunks/CjQQ9_Q2.js +0 -2
- package/webui/build/_app/immutable/chunks/D-6mYMI1.js +0 -1
- package/webui/build/_app/immutable/chunks/D1Gs8-g3.js +0 -1
- package/webui/build/_app/immutable/chunks/D9dRVKgL.js +0 -1
- package/webui/build/_app/immutable/chunks/DCEY1XiC.js +0 -1
- package/webui/build/_app/immutable/chunks/DI-t-G_K.js +0 -2
- package/webui/build/_app/immutable/chunks/DTUxjyWL.js +0 -1
- package/webui/build/_app/immutable/chunks/DWJZOHke.js +0 -1
- package/webui/build/_app/immutable/chunks/Dgs6d7X5.js +0 -1
- package/webui/build/_app/immutable/chunks/DjpPK99f.js +0 -71
- package/webui/build/_app/immutable/chunks/DjzVVxpy.js +0 -1
- package/webui/build/_app/immutable/chunks/DvtNA-3X.js +0 -1
- package/webui/build/_app/immutable/chunks/LQVMBmDN.js +0 -1
- package/webui/build/_app/immutable/chunks/Qw0Qgx6J.js +0 -1
- package/webui/build/_app/immutable/chunks/bohabpgg.js +0 -1
- package/webui/build/_app/immutable/chunks/c-YfbAB_.js +0 -8
- package/webui/build/_app/immutable/chunks/tpTQfoNn.js +0 -1
- package/webui/build/_app/immutable/entry/app.Cra5Zsz4.js +0 -2
- package/webui/build/_app/immutable/entry/start.ToY0Qh0_.js +0 -1
- package/webui/build/_app/immutable/nodes/0.D2-xzG_8.js +0 -11
- package/webui/build/_app/immutable/nodes/1.CFixzRR6.js +0 -1
- package/webui/build/_app/immutable/nodes/10.ayxWydPr.js +0 -1
- package/webui/build/_app/immutable/nodes/11.B0JS3E2j.js +0 -1
- package/webui/build/_app/immutable/nodes/13.DRpZV72T.js +0 -1
- package/webui/build/_app/immutable/nodes/14.DVeJW6bd.js +0 -1
- package/webui/build/_app/immutable/nodes/2.DIZ4IPNm.js +0 -1
- package/webui/build/_app/immutable/nodes/3.BFSNf0FK.js +0 -1
- package/webui/build/_app/immutable/nodes/4.BSsIjejE.js +0 -2
- package/webui/build/_app/immutable/nodes/5.COxRT9Oe.js +0 -1
- package/webui/build/_app/immutable/nodes/6.CBgQ4YzB.js +0 -1
- package/webui/build/_app/immutable/nodes/7.BbzWOL0V.js +0 -6
- package/webui/build/_app/immutable/nodes/8.C8120200.js +0 -1
- package/webui/build/_app/immutable/nodes/9.BH_BGQQ4.js +0 -1
- /package/webui/build/_app/immutable/nodes/{15.BtYZF6FM.js → 17.BtYZF6FM.js} +0 -0
- /package/webui/build/_app/immutable/nodes/{16.Ba_qJjp6.js → 18.Ba_qJjp6.js} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as y,f as E}from"../chunks/D1Gs8-g3.js";import"../chunks/Dgs6d7X5.js";import{o as e,d as $,au as t,av as l,t as g,O as b,$ as C,ax as o,aw as a}from"../chunks/BUngiKFg.js";import{e as D}from"../chunks/DWJZOHke.js";import{h as O}from"../chunks/D-6mYMI1.js";import{P as R,r as k}from"../chunks/DCEY1XiC.js";import{b as U,a as I}from"../chunks/bohabpgg.js";import{p as L}from"../chunks/Bfc47y5P.js";var M=E('<div class="main svelte-c2ukgn"><div class="hero svelte-c2ukgn"><p class="hero-eyebrow svelte-c2ukgn">开发工具</p> <h1 class="hero-title svelte-c2ukgn">Enrich</h1> <p class="hero-sub svelte-c2ukgn">从详情页提取完整正文,返回 JSON,用于调试插件 Extractor 规则</p></div> <div class="form-wrap svelte-c2ukgn"><form><div class="url-row svelte-c2ukgn"><input type="url" placeholder="输入文章详情页地址…" required="" autocomplete="url" class="svelte-c2ukgn"/> <button type="submit" class="svelte-c2ukgn">提取</button></div> <div class="form-opts svelte-c2ukgn"><label class="svelte-c2ukgn"><input type="checkbox" class="svelte-c2ukgn"/> Headful</label> <span class="hint svelte-c2ukgn">勾选后可观察实际加载过程</span></div></form></div> <div class="info-box svelte-c2ukgn">调用 <code class="svelte-c2ukgn"></code>,优先使用插件自定义 Extractor,其次尝试 Readability,最后回退到 LLM 提取。返回 title、author、summary、content、pubDate 等字段,可用于验证正文提取效果。</div></div>');function S(_){let s=b(""),n=b(!1);function x(){if(!e(s).trim())return;const r=e(s).startsWith("http")?e(s):"https://"+e(s);window.open("/admin/extractor/"+encodeURIComponent(r)+(e(n)?"?headless=false":""),"_blank")}var c=M();O("c2ukgn",r=>{$(()=>{C.title=`Enrich - ${R}`})});var i=l(t(c),2),u=t(i),v=t(u),d=t(v);k(d),o(2),a(v);var p=l(v,2),m=t(p),f=t(m);k(f),o(),a(m),o(2),a(p),a(u),a(i);var h=l(i,2),w=l(t(h));w.textContent="GET /admin/extractor/{url}",o(),a(h),a(c),U(d,()=>e(s),r=>g(s,r)),I(f,()=>e(n),r=>g(n,r)),D("submit",u,L(x)),y(_,c)}export{S as component};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
var Bs=Object.defineProperty;var hs=r=>{throw TypeError(r)};var Us=(r,t,e)=>t in r?Bs(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e;var N=(r,t,e)=>Us(r,typeof t!="symbol"?t+"":t,e),De=(r,t,e)=>t.has(r)||hs("Cannot "+e);var o=(r,t,e)=>(De(r,t,"read from private field"),e?e.call(r):t.get(r)),p=(r,t,e)=>t.has(r)?hs("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(r):t.set(r,e),ct=(r,t,e,i)=>(De(r,t,"write to private field"),i?i.call(r,e):t.set(r,e),e),It=(r,t,e)=>(De(r,t,"access private method"),e);import{c as W,a as w,f as F,p as ke,t as zs}from"../chunks/D1Gs8-g3.js";import"../chunks/Dgs6d7X5.js";import{a as qs}from"../chunks/C1kQ4pHy.js";import{aB as E,az as y,o as s,ak as Pe,u as K,bh as G,q as Js,t as h,as as ht,at as dt,al as Gs,au as b,N as Mt,aw as m,av as L,bi as Ys,bj as js,ay as bt,d as Xs,O as rt,$ as Zs,ax as Qs}from"../chunks/BUngiKFg.js";import{s as Q}from"../chunks/CjQQ9_Q2.js";import{i as Y}from"../chunks/Qw0Qgx6J.js";import{e as We}from"../chunks/DjzVVxpy.js";import{h as $s}from"../chunks/D-6mYMI1.js";import{b as lt,P as tr,r as er,s as sr}from"../chunks/DCEY1XiC.js";import{s as rr}from"../chunks/DI-t-G_K.js";import{o as or,e as wt}from"../chunks/DWJZOHke.js";import{b as gs}from"../chunks/bohabpgg.js";import{i as ir}from"../chunks/CVjCNJia.js";import{a as ds}from"../chunks/CBY2biv-.js";import{s as Le}from"../chunks/CtHRh_pJ.js";import{r as nr,b as P,n as at,m as Nt,C as fs,w as Ct,v as ms,x as Ye,a as lr,c as ar,d as Se,A as Tt,y as Rt,E as us,S as Ve,z as cs,B as bs,H as ws,G as _s,I as ys,e as Ns,g as Cs,J as hr,o as dr,K as ur,L as ps,f as xe,s as X,P as cr}from"../chunks/c-YfbAB_.js";import{l as pr,s as we,p as _,r as ce}from"../chunks/BxHqDcpw.js";import{g as vr,P as gr,a as fr,F as mr,b as br}from"../chunks/Bt0fzibd.js";import{c as wr}from"../chunks/D9dRVKgL.js";import{s as _r}from"../chunks/V2-VOe88.js";import{I as yr}from"../chunks/C12mHcUp.js";function Nr(r,t){const e=pr(t,["children","$$slots","$$events","$$legacy"]);/**
|
|
2
|
-
* @license lucide-svelte v0.460.1 - ISC
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the ISC license.
|
|
5
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const i=[["path",{d:"m6 9 6 6 6-6"}]];yr(r,we({name:"chevron-down"},()=>e,{get iconNode(){return i},children:(n,v)=>{var a=W(),u=E(a);_r(u,t,"default",{}),w(n,a)},$$slots:{default:!0}}))}const Cr={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",transform:"translateX(-100%)"},kr=nr(Cr);var Dt,_e;class Pr{constructor(t,e){p(this,Dt,()=>{});p(this,_e,y(()=>o(this,Dt).call(this)));let i;e!==void 0&&(i=e),ct(this,Dt,()=>{try{return i}finally{i=t()}})}get current(){return s(o(this,_e))}}Dt=new WeakMap,_e=new WeakMap;function Sr(r){Pe(()=>K(()=>r()))}function xr(r,t,e=!0){if(!(r.length===0||t<0||t>=r.length))return r.length===1&&t===0?r[0]:t===r.length-1?e?r[0]:void 0:r[t+1]}function Ir(r,t,e=!0){if(!(r.length===0||t<0||t>=r.length))return r.length===1&&t===0?r[0]:t===0?e?r[r.length-1]:void 0:r[t-1]}function Tr(r,t,e,i=!0){if(r.length===0||t<0||t>=r.length)return;let n=t+e;return i?n=(n%r.length+r.length)%r.length:n=Math.max(0,Math.min(n,r.length-1)),r[n]}function Or(r,t,e,i=!0){if(r.length===0||t<0||t>=r.length)return;let n=t-e;return i?n=(n%r.length+r.length)%r.length:n=Math.max(0,Math.min(n,r.length-1)),r[n]}function je(r,t,e){const i=t.toLowerCase();if(i.endsWith(" ")){const d=i.slice(0,-1);if(r.filter(D=>D.toLowerCase().startsWith(d)).length<=1)return je(r,d,e);const f=e==null?void 0:e.toLowerCase();if(f&&f.startsWith(d)&&f.charAt(d.length)===" "&&t.trim()===d)return e;const R=r.filter(D=>D.toLowerCase().startsWith(i));if(R.length>0){const D=e?r.indexOf(e):-1;return vs(R,Math.max(D,0)).find(V=>V!==e)||e}}const v=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,a=v.toLowerCase(),u=e?r.indexOf(e):-1;let g=vs(r,Math.max(u,0));v.length===1&&(g=g.filter(d=>d!==e));const c=g.find(d=>d==null?void 0:d.toLowerCase().startsWith(a));return c!==e?c:void 0}function vs(r,t){return r.map((e,i)=>r[(t+i)%r.length])}const Mr={afterMs:1e4,onChange:at};function ks(r,t){const{afterMs:e,onChange:i,getWindow:n}={...Mr,...t};let v=null,a=G(Js(r));function u(){return n().setTimeout(()=>{h(a,r,!0),i==null||i(r)},e)}return Pe(()=>()=>{v&&n().clearTimeout(v)}),P(()=>s(a),g=>{h(a,g,!0),i==null||i(g),v&&n().clearTimeout(v),v=u()})}var ot,it,ye,Ne;class Hr{constructor(t){p(this,ot);p(this,it);p(this,ye,y(()=>o(this,ot).onMatch?o(this,ot).onMatch:t=>t.focus()));p(this,Ne,y(()=>o(this,ot).getCurrentItem?o(this,ot).getCurrentItem:o(this,ot).getActiveElement));ct(this,ot,t),ct(this,it,ks("",{afterMs:1e3,getWindow:t.getWindow})),this.handleTypeaheadSearch=this.handleTypeaheadSearch.bind(this),this.resetTypeahead=this.resetTypeahead.bind(this)}handleTypeaheadSearch(t,e){var g,C;if(!e.length)return;o(this,it).current=o(this,it).current+t;const i=s(o(this,Ne))(),n=((C=(g=e.find(c=>c===i))==null?void 0:g.textContent)==null?void 0:C.trim())??"",v=e.map(c=>{var d;return((d=c.textContent)==null?void 0:d.trim())??""}),a=je(v,o(this,it).current,n),u=e.find(c=>{var d;return((d=c.textContent)==null?void 0:d.trim())===a});return u&&s(o(this,ye))(u),u}resetTypeahead(){o(this,it).current=""}get search(){return o(this,it).current}}ot=new WeakMap,it=new WeakMap,ye=new WeakMap,Ne=new WeakMap;var Er=F("<input/>"),Ar=F("<input/>");function Rr(r,t){ht(t,!0);let e=_(t,"value",15),i=ce(t,["$$slots","$$events","$$legacy","value"]);const n=y(()=>Nt(i,{"aria-hidden":"true",tabindex:-1,style:kr}));var v=W(),a=E(v);{var u=C=>{var c=Er();lt(c,()=>({...s(n),value:e()}),void 0,void 0,void 0,void 0,!0),w(C,c)},g=C=>{var c=Ar();lt(c,()=>({...s(n)}),void 0,void 0,void 0,void 0,!0),gs(c,e),w(C,c)};Y(a,C=>{s(n).type==="checkbox"?C(u):C(g,-1)})}w(r,v),dt()}var nt,_t,pt;class Dr{constructor(t){p(this,nt);p(this,_t,y(()=>o(this,nt).candidateValues()));p(this,pt);ct(this,nt,t),ct(this,pt,ks("",{afterMs:1e3,getWindow:o(this,nt).getWindow})),this.handleTypeaheadSearch=this.handleTypeaheadSearch.bind(this),this.resetTypeahead=this.resetTypeahead.bind(this)}handleTypeaheadSearch(t){if(!o(this,nt).enabled()||!s(o(this,_t)).length)return;o(this,pt).current=o(this,pt).current+t;const e=o(this,nt).getCurrentItem(),i=s(o(this,_t)).find(u=>u===e)??"",n=s(o(this,_t)).map(u=>u??""),v=je(n,o(this,pt).current,i),a=s(o(this,_t)).find(u=>u===v);return a&&o(this,nt).onMatch(a),a}resetTypeahead(){o(this,pt).current=""}}nt=new WeakMap,_t=new WeakMap,pt=new WeakMap;const Lr=[Rt,bs,ws],Vr=[Tt,_s,ys],Kr=[...Lr,...Vr],Wr=ar({component:"select",parts:["trigger","content","item","viewport","scroll-up-button","scroll-down-button","group","group-label","separator","arrow","input","content-wrapper","item-text","value"]}),pe=new fs("Select.Root | Combobox.Root"),Ps=new fs("Select.Content | Combobox.Content");var Lt,Vt,Kt,Wt,Ft,Bt,Ut,zt,qt,Jt,Gt;class Ss{constructor(t){N(this,"opts");p(this,Lt,G(!1));p(this,Vt,G(null));p(this,Kt,G(null));N(this,"contentPresence");p(this,Wt,G(null));p(this,Ft,G(null));p(this,Bt,G(""));p(this,Ut,G(null));p(this,zt,y(()=>this.highlightedNode?this.highlightedNode.getAttribute("data-value"):null));p(this,qt,y(()=>{if(this.highlightedNode)return this.highlightedNode.id}));p(this,Jt,y(()=>this.highlightedNode?this.highlightedNode.getAttribute("data-label"):null));p(this,Gt,G(!1));N(this,"isUsingKeyboard",!1);N(this,"isCombobox",!1);N(this,"domContext",new Ye(()=>null));N(this,"getBitsAttr",t=>Wr.getAttr(t,this.isCombobox?"combobox":void 0));this.opts=t,this.isCombobox=t.isCombobox,this.contentPresence=new lr({ref:P(()=>this.contentNode),open:this.opts.open,onComplete:()=>{this.opts.onOpenChangeComplete.current(this.opts.open.current)}}),Gs(()=>{this.opts.open.current||this.setHighlightedNode(null)})}get touchedInput(){return s(o(this,Lt))}set touchedInput(t){h(o(this,Lt),t,!0)}get inputNode(){return s(o(this,Vt))}set inputNode(t){h(o(this,Vt),t,!0)}get contentNode(){return s(o(this,Kt))}set contentNode(t){h(o(this,Kt),t,!0)}get viewportNode(){return s(o(this,Wt))}set viewportNode(t){h(o(this,Wt),t,!0)}get triggerNode(){return s(o(this,Ft))}set triggerNode(t){h(o(this,Ft),t,!0)}get valueId(){return s(o(this,Bt))}set valueId(t){h(o(this,Bt),t,!0)}get highlightedNode(){return s(o(this,Ut))}set highlightedNode(t){h(o(this,Ut),t,!0)}get highlightedValue(){return s(o(this,zt))}set highlightedValue(t){h(o(this,zt),t)}get highlightedId(){return s(o(this,qt))}set highlightedId(t){h(o(this,qt),t)}get highlightedLabel(){return s(o(this,Jt))}set highlightedLabel(t){h(o(this,Jt),t)}get contentIsPositioned(){return s(o(this,Gt))}set contentIsPositioned(t){h(o(this,Gt),t,!0)}setHighlightedNode(t,e=!1){this.highlightedNode=t,t&&(this.isUsingKeyboard||e)&&this.scrollHighlightedNodeIntoView(t)}scrollHighlightedNodeIntoView(t){!this.viewportNode||!this.contentIsPositioned||t.scrollIntoView({block:this.opts.scrollAlignment.current})}getCandidateNodes(){const t=this.contentNode;return t?Array.from(t.querySelectorAll(`[${this.getBitsAttr("item")}]:not([data-disabled])`)):[]}setHighlightedToFirstCandidate(t=!1){this.setHighlightedNode(null);let e=this.getCandidateNodes();if(e.length){if(this.viewportNode){const i=this.viewportNode.getBoundingClientRect();e=e.filter(n=>{if(!this.viewportNode)return!1;const v=n.getBoundingClientRect();return v.right<=i.right&&v.left>=i.left&&v.bottom<=i.bottom&&v.top>=i.top})}this.setHighlightedNode(e[0],t)}}getNodeByValue(t){return this.getCandidateNodes().find(i=>i.dataset.value===t)??null}setOpen(t){this.opts.open.current=t}toggleOpen(){this.opts.open.current=!this.opts.open.current}handleOpen(){this.setOpen(!0)}handleClose(){this.setHighlightedNode(null),this.setOpen(!1)}toggleMenu(){this.toggleOpen()}}Lt=new WeakMap,Vt=new WeakMap,Kt=new WeakMap,Wt=new WeakMap,Ft=new WeakMap,Bt=new WeakMap,Ut=new WeakMap,zt=new WeakMap,qt=new WeakMap,Jt=new WeakMap,Gt=new WeakMap;var Yt,jt,Xt,Zt;class Fr extends Ss{constructor(e){super(e);N(this,"opts");N(this,"isMulti",!1);p(this,Yt,y(()=>this.opts.value.current!==""));p(this,jt,y(()=>{var e;return this.opts.items.current.length?((e=this.opts.items.current.find(i=>i.value===this.opts.value.current))==null?void 0:e.label)??"":""}));p(this,Xt,y(()=>this.opts.items.current.length?this.opts.items.current.filter(i=>!i.disabled).map(i=>i.label):[]));p(this,Zt,y(()=>!(this.isMulti||this.opts.items.current.length===0)));this.opts=e,Pe(()=>{!this.opts.open.current&&this.highlightedNode&&this.setHighlightedNode(null)}),Ct(()=>this.opts.open.current,()=>{this.opts.open.current&&this.setInitialHighlightedNode()})}get hasValue(){return s(o(this,Yt))}set hasValue(e){h(o(this,Yt),e)}get currentLabel(){return s(o(this,jt))}set currentLabel(e){h(o(this,jt),e)}get candidateLabels(){return s(o(this,Xt))}set candidateLabels(e){h(o(this,Xt),e)}get dataTypeaheadEnabled(){return s(o(this,Zt))}set dataTypeaheadEnabled(e){h(o(this,Zt),e)}includesItem(e){return this.opts.value.current===e}toggleItem(e,i=e){const n=this.includesItem(e)?"":e;this.opts.value.current=n,n!==""&&(this.opts.inputValue.current=i)}setInitialHighlightedNode(){ms(()=>{if(!(this.highlightedNode&&this.domContext.getDocument().contains(this.highlightedNode))){if(this.opts.value.current!==""){const e=this.getNodeByValue(this.opts.value.current);if(e){this.setHighlightedNode(e,!0);return}}this.setHighlightedToFirstCandidate(!0)}})}}Yt=new WeakMap,jt=new WeakMap,Xt=new WeakMap,Zt=new WeakMap;var Qt;class Br extends Ss{constructor(e){super(e);N(this,"opts");N(this,"isMulti",!0);p(this,Qt,y(()=>this.opts.value.current.length>0));this.opts=e,Pe(()=>{!this.opts.open.current&&this.highlightedNode&&this.setHighlightedNode(null)}),Ct(()=>this.opts.open.current,()=>{this.opts.open.current&&this.setInitialHighlightedNode()})}get hasValue(){return s(o(this,Qt))}set hasValue(e){h(o(this,Qt),e)}includesItem(e){return this.opts.value.current.includes(e)}toggleItem(e,i=e){this.includesItem(e)?this.opts.value.current=this.opts.value.current.filter(n=>n!==e):this.opts.value.current=[...this.opts.value.current,e],this.opts.inputValue.current=i}setInitialHighlightedNode(){ms(()=>{if(this.domContext&&!(this.highlightedNode&&this.domContext.getDocument().contains(this.highlightedNode))){if(this.opts.value.current.length&&this.opts.value.current[0]!==""){const e=this.getNodeByValue(this.opts.value.current[0]);if(e){this.setHighlightedNode(e,!0);return}}this.setHighlightedToFirstCandidate(!0)}})}}Qt=new WeakMap;class Ur{static create(t){const{type:e,...i}=t,n=e==="single"?new Fr(i):new Br(i);return pe.set(n)}}var yt,Ot,$,xs,Be,Ue,$t;const Xe=class Xe{constructor(t,e){p(this,$);N(this,"opts");N(this,"root");N(this,"attachment");p(this,yt);p(this,Ot);p(this,$t,y(()=>({id:this.opts.id.current,disabled:this.root.opts.disabled.current?!0:void 0,"aria-haspopup":"listbox","aria-expanded":hr(this.root.opts.open.current),"aria-activedescendant":this.root.highlightedId,"data-state":Cs(this.root.opts.open.current),"data-disabled":Ns(this.root.opts.disabled.current),"data-placeholder":this.root.hasValue?void 0:"",[this.root.getBitsAttr("trigger")]:"",onpointerdown:this.onpointerdown,onkeydown:this.onkeydown,onclick:this.onclick,onpointerup:this.onpointerup,...this.attachment})));this.opts=t,this.root=e,this.attachment=Se(t.ref,i=>this.root.triggerNode=i),this.root.domContext=new Ye(t.ref),ct(this,yt,new Hr({getCurrentItem:()=>this.root.highlightedNode,onMatch:i=>{this.root.setHighlightedNode(i)},getActiveElement:()=>this.root.domContext.getActiveElement(),getWindow:()=>this.root.domContext.getWindow()})),ct(this,Ot,new Dr({getCurrentItem:()=>this.root.isMulti?"":this.root.currentLabel,onMatch:i=>{if(this.root.isMulti||!this.root.opts.items.current)return;const n=this.root.opts.items.current.find(v=>v.label===i);n&&(this.root.opts.value.current=n.value)},enabled:()=>!this.root.isMulti&&this.root.dataTypeaheadEnabled,candidateValues:()=>this.root.isMulti?[]:this.root.candidateLabels,getWindow:()=>this.root.domContext.getWindow()})),this.onkeydown=this.onkeydown.bind(this),this.onpointerdown=this.onpointerdown.bind(this),this.onpointerup=this.onpointerup.bind(this),this.onclick=this.onclick.bind(this)}static create(t){return new Xe(t,pe.get())}onkeydown(t){if(this.root.isUsingKeyboard=!0,(t.key===Tt||t.key===Rt)&&t.preventDefault(),!this.root.opts.open.current){if(t.key===us||t.key===Ve||t.key===Rt||t.key===Tt)t.preventDefault(),this.root.handleOpen();else if(!this.root.isMulti&&this.root.dataTypeaheadEnabled){o(this,Ot).handleTypeaheadSearch(t.key);return}if(this.root.hasValue)return;const a=this.root.getCandidateNodes();if(!a.length)return;if(t.key===Rt){const u=a[0];this.root.setHighlightedNode(u)}else if(t.key===Tt){const u=a[a.length-1];this.root.setHighlightedNode(u)}return}if(t.key===cs){this.root.handleClose();return}if((t.key===us||t.key===Ve&&o(this,yt).search==="")&&!t.isComposing&&(t.preventDefault(),It(this,$,Ue).call(this)))return;if(t.key===Tt&&t.altKey&&this.root.handleClose(),Kr.includes(t.key)){t.preventDefault();const a=this.root.getCandidateNodes(),u=this.root.highlightedNode,g=u?a.indexOf(u):-1,C=this.root.opts.loop.current;let c;if(t.key===Rt?c=xr(a,g,C):t.key===Tt?c=Ir(a,g,C):t.key===_s?c=Tr(a,g,10,C):t.key===bs?c=Or(a,g,10,C):t.key===ws?c=a[0]:t.key===ys&&(c=a[a.length-1]),!c)return;this.root.setHighlightedNode(c);return}const e=t.ctrlKey||t.altKey||t.metaKey,i=t.key.length===1,n=t.key===Ve,v=this.root.getCandidateNodes();if(t.key!==cs){if(!e&&(i||n)){!o(this,yt).handleTypeaheadSearch(t.key,v)&&n&&(t.preventDefault(),It(this,$,Ue).call(this));return}this.root.highlightedNode||this.root.setHighlightedToFirstCandidate()}}onclick(t){t.currentTarget.focus()}onpointerdown(t){if(this.root.opts.disabled.current)return;if(t.pointerType==="touch")return t.preventDefault();const e=t.target;e!=null&&e.hasPointerCapture(t.pointerId)&&(e==null||e.releasePointerCapture(t.pointerId)),t.button===0&&t.ctrlKey===!1&&(this.root.opts.open.current===!1?It(this,$,Be).call(this,t):this.root.handleClose())}onpointerup(t){this.root.opts.disabled.current||(t.preventDefault(),t.pointerType==="touch"&&(this.root.opts.open.current===!1?It(this,$,Be).call(this,t):this.root.handleClose()))}get props(){return s(o(this,$t))}set props(t){h(o(this,$t),t)}};yt=new WeakMap,Ot=new WeakMap,$=new WeakSet,xs=function(){this.root.opts.open.current=!0,o(this,Ot).resetTypeahead(),o(this,yt).resetTypeahead()},Be=function(t){It(this,$,xs).call(this)},Ue=function(){const t=this.root.highlightedValue===this.root.opts.value.current;return!this.root.opts.allowDeselect.current&&t&&!this.root.isMulti?(this.root.handleClose(),!0):(this.root.highlightedValue!==null&&this.root.toggleItem(this.root.highlightedValue,this.root.highlightedLabel??void 0),!this.root.isMulti&&!t?(this.root.handleClose(),!0):!1)},$t=new WeakMap;let Fe=Xe;var te,Ce,ee,se;const Ze=class Ze{constructor(t,e){N(this,"opts");N(this,"root");N(this,"attachment");p(this,te,G(!1));N(this,"domContext");p(this,Ce,y(()=>vr(this.root.isCombobox?"combobox":"select")));N(this,"onInteractOutside",t=>{if(t.target===this.root.triggerNode||t.target===this.root.inputNode){t.preventDefault();return}this.opts.onInteractOutside.current(t),!t.defaultPrevented&&this.root.handleClose()});N(this,"onEscapeKeydown",t=>{this.opts.onEscapeKeydown.current(t),!t.defaultPrevented&&this.root.handleClose()});N(this,"onOpenAutoFocus",t=>{t.preventDefault()});N(this,"onCloseAutoFocus",t=>{t.preventDefault()});p(this,ee,y(()=>({open:this.root.opts.open.current})));p(this,se,y(()=>({id:this.opts.id.current,role:"listbox","aria-multiselectable":this.root.isMulti?"true":void 0,"data-state":Cs(this.root.opts.open.current),[this.root.getBitsAttr("content")]:"",style:{display:"flex",flexDirection:"column",outline:"none",boxSizing:"border-box",pointerEvents:"auto",...s(o(this,Ce))},onpointermove:this.onpointermove,...this.attachment})));N(this,"popperProps",{onInteractOutside:this.onInteractOutside,onEscapeKeydown:this.onEscapeKeydown,onOpenAutoFocus:this.onOpenAutoFocus,onCloseAutoFocus:this.onCloseAutoFocus,trapFocus:!1,loop:!1,onPlaced:()=>{this.root.opts.open.current&&(this.root.contentIsPositioned=!0,this.isPositioned=!0)}});this.opts=t,this.root=e,this.attachment=Se(t.ref,i=>this.root.contentNode=i),this.domContext=new Ye(this.opts.ref),this.root.domContext===null&&(this.root.domContext=this.domContext),dr(()=>{this.root.contentNode=null,this.root.contentIsPositioned=!1,this.isPositioned=!1}),Ct(()=>this.root.opts.open.current,()=>{this.root.opts.open.current||(this.root.contentIsPositioned=!1,this.isPositioned=!1)}),Ct([()=>this.isPositioned,()=>this.root.highlightedNode],()=>{!this.isPositioned||!this.root.highlightedNode||this.root.scrollHighlightedNodeIntoView(this.root.highlightedNode)}),this.onpointermove=this.onpointermove.bind(this)}static create(t){return Ps.set(new Ze(t,pe.get()))}get isPositioned(){return s(o(this,te))}set isPositioned(t){h(o(this,te),t,!0)}onpointermove(t){this.root.isUsingKeyboard=!1}get shouldRender(){return this.root.contentPresence.shouldRender}get snippetProps(){return s(o(this,ee))}set snippetProps(t){h(o(this,ee),t)}get props(){return s(o(this,se))}set props(t){h(o(this,se),t)}};te=new WeakMap,Ce=new WeakMap,ee=new WeakMap,se=new WeakMap;let ze=Ze;var re,oe,ie,ne,le;const Qe=class Qe{constructor(t,e){N(this,"opts");N(this,"root");N(this,"attachment");p(this,re,y(()=>this.root.includesItem(this.opts.value.current)));p(this,oe,y(()=>this.root.highlightedValue===this.opts.value.current));N(this,"prevHighlighted",new Pr(()=>this.isHighlighted));p(this,ie,G(!1));p(this,ne,y(()=>({selected:this.isSelected,highlighted:this.isHighlighted})));p(this,le,y(()=>({id:this.opts.id.current,role:"option","aria-selected":this.root.includesItem(this.opts.value.current)?"true":void 0,"data-value":this.opts.value.current,"data-disabled":Ns(this.opts.disabled.current),"data-highlighted":this.root.highlightedValue===this.opts.value.current&&!this.opts.disabled.current?"":void 0,"data-selected":this.root.includesItem(this.opts.value.current)?"":void 0,"data-label":this.opts.label.current,[this.root.getBitsAttr("item")]:"",onpointermove:this.onpointermove,onpointerdown:this.onpointerdown,onpointerup:this.onpointerup,...this.attachment})));this.opts=t,this.root=e,this.attachment=Se(t.ref),Ct([()=>this.isHighlighted,()=>this.prevHighlighted.current],()=>{this.isHighlighted?this.opts.onHighlight.current():this.prevHighlighted.current&&this.opts.onUnhighlight.current()}),Ct(()=>this.mounted,()=>{this.mounted&&this.root.setInitialHighlightedNode()}),this.onpointerdown=this.onpointerdown.bind(this),this.onpointerup=this.onpointerup.bind(this),this.onpointermove=this.onpointermove.bind(this)}static create(t){return new Qe(t,pe.get())}get isSelected(){return s(o(this,re))}set isSelected(t){h(o(this,re),t)}get isHighlighted(){return s(o(this,oe))}set isHighlighted(t){h(o(this,oe),t)}get mounted(){return s(o(this,ie))}set mounted(t){h(o(this,ie),t,!0)}handleSelect(){if(this.opts.disabled.current)return;const t=this.opts.value.current===this.root.opts.value.current;if(!this.root.opts.allowDeselect.current&&t&&!this.root.isMulti){this.root.handleClose();return}this.root.toggleItem(this.opts.value.current,this.opts.label.current),!this.root.isMulti&&!t&&this.root.handleClose()}get snippetProps(){return s(o(this,ne))}set snippetProps(t){h(o(this,ne),t)}onpointerdown(t){t.preventDefault()}onpointerup(t){if(!(t.defaultPrevented||!this.opts.ref.current)){if(t.pointerType==="touch"&&!ur){or(this.opts.ref.current,"click",()=>{this.handleSelect(),this.root.setHighlightedNode(this.opts.ref.current)},{once:!0});return}t.preventDefault(),this.handleSelect(),t.pointerType==="touch"&&this.root.setHighlightedNode(this.opts.ref.current)}}onpointermove(t){t.pointerType!=="touch"&&this.root.highlightedNode!==this.opts.ref.current&&this.root.setHighlightedNode(this.opts.ref.current)}get props(){return s(o(this,le))}set props(t){h(o(this,le),t)}};re=new WeakMap,oe=new WeakMap,ie=new WeakMap,ne=new WeakMap,le=new WeakMap;let qe=Qe;var ae,he;const $e=class $e{constructor(t,e){N(this,"opts");N(this,"root");p(this,ae,y(()=>this.root.opts.name.current!==""));p(this,he,y(()=>({disabled:ps(this.root.opts.disabled.current),required:ps(this.root.opts.required.current),name:this.root.opts.name.current,value:this.opts.value.current,onfocus:this.onfocus})));this.opts=t,this.root=e,this.onfocus=this.onfocus.bind(this)}static create(t){return new $e(t,pe.get())}get shouldRender(){return s(o(this,ae))}set shouldRender(t){h(o(this,ae),t)}onfocus(t){var e,i;t.preventDefault(),this.root.isCombobox?(i=this.root.inputNode)==null||i.focus():(e=this.root.triggerNode)==null||e.focus()}get props(){return s(o(this,he))}set props(t){h(o(this,he),t)}};ae=new WeakMap,he=new WeakMap;let Je=$e;var de,ue;const ts=class ts{constructor(t,e){N(this,"opts");N(this,"content");N(this,"root");N(this,"attachment");p(this,de,G(0));p(this,ue,y(()=>({id:this.opts.id.current,role:"presentation",[this.root.getBitsAttr("viewport")]:"",style:{position:"relative",flex:1,overflow:"auto"},...this.attachment})));this.opts=t,this.content=e,this.root=e.root,this.attachment=Se(t.ref,i=>{this.root.viewportNode=i})}static create(t){return new ts(t,Ps.get())}get prevScrollTop(){return s(o(this,de))}set prevScrollTop(t){h(o(this,de),t,!0)}get props(){return s(o(this,ue))}set props(t){h(o(this,ue),t)}};de=new WeakMap,ue=new WeakMap;let Ge=ts;function Ke(r,t){ht(t,!0);let e=_(t,"value",15);const i=Je.create({value:P(()=>e())});var n=W(),v=E(n);{var a=u=>{Rr(u,we(()=>i.props,{get autocomplete(){return t.autocomplete},get value(){return e()},set value(g){e(g)}}))};Y(v,u=>{i.shouldRender&&u(a)})}w(r,n),dt()}var zr=F("<div><div><!></div></div>"),qr=F("<div><div><!></div></div>");function Jr(r,t){const e=ke();ht(t,!0);let i=_(t,"id",19,()=>xe(e)),n=_(t,"ref",15,null),v=_(t,"forceMount",3,!1),a=_(t,"side",3,"bottom"),u=_(t,"onInteractOutside",3,at),g=_(t,"onEscapeKeydown",3,at),C=_(t,"preventScroll",3,!1),c=ce(t,["$$slots","$$events","$$legacy","id","ref","forceMount","side","onInteractOutside","onEscapeKeydown","children","child","preventScroll","style"]);const d=ze.create({id:P(()=>i()),ref:P(()=>n(),S=>n(S)),onInteractOutside:P(()=>u()),onEscapeKeydown:P(()=>g())}),k=y(()=>Nt(c,d.props));var f=W(),R=E(f);{var D=S=>{gr(S,we(()=>s(k),()=>d.popperProps,{get ref(){return d.opts.ref},get side(){return a()},get enabled(){return d.root.opts.open.current},get id(){return i()},get preventScroll(){return C()},forceMount:!0,get shouldRender(){return d.shouldRender},popper:(H,x)=>{let j=()=>x==null?void 0:x().props,tt=()=>x==null?void 0:x().wrapperProps;const O=y(()=>Nt(j(),{style:d.props.style},{style:t.style}));var J=W(),Z=E(J);{var et=M=>{var A=W(),B=E(A);{let q=y(()=>({props:s(O),wrapperProps:tt(),...d.snippetProps}));X(B,()=>t.child,()=>s(q))}w(M,A)},vt=M=>{var A=zr();lt(A,()=>({...tt()}));var B=b(A);lt(B,()=>({...s(O)}));var q=b(B);X(q,()=>t.children??Mt),m(B),m(A),w(M,A)};Y(Z,M=>{t.child?M(et):M(vt,-1)})}w(H,J)},$$slots:{popper:!0}}))},z=S=>{fr(S,we(()=>s(k),()=>d.popperProps,{get ref(){return d.opts.ref},get side(){return a()},get open(){return d.root.opts.open.current},get id(){return i()},get preventScroll(){return C()},forceMount:!1,get shouldRender(){return d.shouldRender},popper:(H,x)=>{let j=()=>x==null?void 0:x().props,tt=()=>x==null?void 0:x().wrapperProps;const O=y(()=>Nt(j(),{style:d.props.style},{style:t.style}));var J=W(),Z=E(J);{var et=M=>{var A=W(),B=E(A);{let q=y(()=>({props:s(O),wrapperProps:tt(),...d.snippetProps}));X(B,()=>t.child,()=>s(q))}w(M,A)},vt=M=>{var A=qr();lt(A,()=>({...tt()}));var B=b(A);lt(B,()=>({...s(O)}));var q=b(B);X(q,()=>t.children??Mt),m(B),m(A),w(M,A)};Y(Z,M=>{t.child?M(et):M(vt,-1)})}w(H,J)},$$slots:{popper:!0}}))};Y(R,S=>{v()?S(D):v()||S(z,1)})}w(r,f),dt()}function Gr(r,t){ht(t,!0);let e=_(t,"mounted",15,!1),i=_(t,"onMountedChange",3,at);Sr(()=>(e(!0),i()(!0),()=>{e(!1),i()(!1)})),dt()}var Yr=F("<div><!></div>"),jr=F("<!> <!>",1);function Xr(r,t){const e=ke();ht(t,!0);let i=_(t,"id",19,()=>xe(e)),n=_(t,"ref",15,null),v=_(t,"label",19,()=>t.value),a=_(t,"disabled",3,!1),u=_(t,"onHighlight",3,at),g=_(t,"onUnhighlight",3,at),C=ce(t,["$$slots","$$events","$$legacy","id","ref","value","label","disabled","children","child","onHighlight","onUnhighlight"]);const c=qe.create({id:P(()=>i()),ref:P(()=>n(),S=>n(S)),value:P(()=>t.value),disabled:P(()=>a()),label:P(()=>v()),onHighlight:P(()=>u()),onUnhighlight:P(()=>g())}),d=y(()=>Nt(C,c.props));var k=jr(),f=E(k);{var R=S=>{var V=W(),H=E(V);{let x=y(()=>({props:s(d),...c.snippetProps}));X(H,()=>t.child,()=>s(x))}w(S,V)},D=S=>{var V=Yr();lt(V,()=>({...s(d)}));var H=b(V);X(H,()=>t.children??Mt,()=>c.snippetProps),m(V),w(S,V)};Y(f,S=>{t.child?S(R):S(D,-1)})}var z=L(f,2);Gr(z,{get mounted(){return c.mounted},set mounted(S){c.mounted=S}}),w(r,k),dt()}var Zr=F("<div><!></div>");function Qr(r,t){const e=ke();ht(t,!0);let i=_(t,"id",19,()=>xe(e)),n=_(t,"ref",15,null),v=ce(t,["$$slots","$$events","$$legacy","id","ref","children","child"]);const a=Ge.create({id:P(()=>i()),ref:P(()=>n(),k=>n(k))}),u=y(()=>Nt(v,a.props));var g=W(),C=E(g);{var c=k=>{var f=W(),R=E(f);X(R,()=>t.child,()=>({props:s(u)})),w(k,f)},d=k=>{var f=Zr();lt(f,()=>({...s(u)}));var R=b(f);X(R,()=>t.children??Mt),m(f),w(k,f)};Y(C,k=>{t.child?k(c):k(d,-1)})}w(r,g),dt()}var $r=F("<!> <!>",1);function to(r,t){ht(t,!0);let e=_(t,"value",15),i=_(t,"onValueChange",3,at),n=_(t,"name",3,""),v=_(t,"disabled",3,!1),a=_(t,"open",15,!1),u=_(t,"onOpenChange",3,at),g=_(t,"onOpenChangeComplete",3,at),C=_(t,"loop",3,!1),c=_(t,"scrollAlignment",3,"nearest"),d=_(t,"required",3,!1),k=_(t,"items",19,()=>[]),f=_(t,"allowDeselect",3,!1);function R(){e()===void 0&&e(t.type==="single"?"":[])}R(),Ct.pre(()=>e(),()=>{R()});let D=G("");const z=Ur.create({type:t.type,value:P(()=>e(),O=>{e(O),i()(O)}),disabled:P(()=>v()),required:P(()=>d()),open:P(()=>a(),O=>{a(O),u()(O)}),loop:P(()=>C()),scrollAlignment:P(()=>c()),name:P(()=>n()),isCombobox:!1,items:P(()=>k()),allowDeselect:P(()=>f()),inputValue:P(()=>s(D),O=>h(D,O,!0)),onOpenChangeComplete:P(()=>g())});var S=$r(),V=E(S);mr(V,{children:(O,J)=>{var Z=W(),et=E(Z);X(et,()=>t.children??Mt),w(O,Z)},$$slots:{default:!0}});var H=L(V,2);{var x=O=>{var J=W(),Z=E(J);{var et=M=>{Ke(M,{get autocomplete(){return t.autocomplete}})},vt=M=>{var A=W(),B=E(A);We(B,16,()=>z.opts.value.current,q=>q,(q,ve)=>{Ke(q,{get value(){return ve},get autocomplete(){return t.autocomplete}})}),w(M,A)};Y(Z,M=>{z.opts.value.current.length===0?M(et):M(vt,-1)})}w(O,J)},j=y(()=>Array.isArray(z.opts.value.current)),tt=O=>{Ke(O,{get autocomplete(){return t.autocomplete},get value(){return z.opts.value.current},set value(J){z.opts.value.current=J}})};Y(H,O=>{s(j)?O(x):O(tt,-1)})}w(r,S),dt()}var eo=F("<button><!></button>");function so(r,t){const e=ke();ht(t,!0);let i=_(t,"id",19,()=>xe(e)),n=_(t,"ref",15,null),v=_(t,"type",3,"button"),a=ce(t,["$$slots","$$events","$$legacy","id","ref","child","children","type"]);const u=Fe.create({id:P(()=>i()),ref:P(()=>n(),d=>n(d))}),g=y(()=>Nt(a,u.props,{type:v()}));var C=W(),c=E(C);wr(c,()=>br,(d,k)=>{k(d,{get id(){return i()},get ref(){return u.opts.ref},children:(f,R)=>{var D=W(),z=E(D);{var S=H=>{var x=W(),j=E(x);X(j,()=>t.child,()=>({props:s(g)})),w(H,x)},V=H=>{var x=eo();lt(x,()=>({...s(g)}));var j=b(x);X(j,()=>t.children??Mt),m(x),w(H,x)};Y(z,H=>{t.child?H(S):H(V,-1)})}w(f,D)},$$slots:{default:!0}})}),w(r,C),dt()}var ro=F('<span class="level-select-value svelte-1w6l7vk"> </span> <!>',1),oo=F("<!> <!>",1),io=F('<div class="state err svelte-1w6l7vk"> </div>'),no=F('<div class="state svelte-1w6l7vk">加载中…</div>'),lo=F('<div class="state svelte-1w6l7vk">暂无日志</div>'),ao=F('<tr class="payload-row svelte-1w6l7vk"><td colspan="5" class="svelte-1w6l7vk"><pre class="payload-content svelte-1w6l7vk"> </pre></td></tr>'),ho=F('<tr class="log-row svelte-1w6l7vk" role="button" tabindex="0"><td class="td-time svelte-1w6l7vk"> </td><td class="td-level svelte-1w6l7vk"><span> </span></td><td class="td-cat svelte-1w6l7vk"> </td><td class="td-msg svelte-1w6l7vk"> </td><td class="td-detail svelte-1w6l7vk"> </td></tr> <!>',1),uo=F('<div class="log-has-data svelte-1w6l7vk"><div class="log-table-scroll svelte-1w6l7vk"><div class="table-wrap svelte-1w6l7vk"><table class="svelte-1w6l7vk"><thead class="svelte-1w6l7vk"><tr><th class="th-time svelte-1w6l7vk">时间</th><th class="th-level svelte-1w6l7vk">级别</th><th class="th-cat svelte-1w6l7vk">分类</th><th class="th-msg svelte-1w6l7vk">消息</th><th class="th-detail svelte-1w6l7vk">详情</th></tr></thead><tbody class="svelte-1w6l7vk"></tbody></table></div></div> <div class="log-toolbar svelte-1w6l7vk"><span class="pagination-info svelte-1w6l7vk"> </span> <div class="pagination-btns svelte-1w6l7vk"><button class="btn btn-secondary btn-sm svelte-1w6l7vk">上一页</button> <button class="btn btn-secondary btn-sm svelte-1w6l7vk">下一页</button></div></div></div>'),co=F('<div class="page svelte-1w6l7vk"><div class="logs-col svelte-1w6l7vk"><div class="logs-toolbar-block svelte-1w6l7vk"><div class="admin-feed-header"><div class="admin-feed-header__left"><h2>日志</h2> <p class="admin-feed-header__desc">运行与抓取、pipeline 等产生的日志写入本地 logs.db;可按级别与类型筛选,支持刷新与清空。</p></div> <div class="admin-feed-header__actions"><button class="admin-toolbar-btn admin-toolbar-btn--secondary" type="button" title="刷新">刷新</button> <button class="admin-toolbar-btn admin-toolbar-btn--danger" type="button" title="清空全部日志">清空</button></div></div> <div class="filters svelte-1w6l7vk"><div class="filter-row svelte-1w6l7vk"><div class="filter-left svelte-1w6l7vk"><div class="filter-level-field svelte-1w6l7vk"><span class="filter-level-label svelte-1w6l7vk">级别</span> <!></div> <label class="label-category svelte-1w6l7vk"><span class="svelte-1w6l7vk">类型</span> <input type="text" class="filter-category-input svelte-1w6l7vk" placeholder="留空为全部;支持子串匹配" autocomplete="off" spellcheck="false"/></label></div></div></div></div> <div class="log-body-scroll svelte-1w6l7vk"><!></div></div></div>');function Ro(r,t){ht(t,!1);const e=["error","warn","info","debug"],i=350,n=[{value:"",label:"全部"},...e.map(l=>({value:l,label:l}))];function v(l){var I;return((I=n.find(U=>U.value===l))==null?void 0:I.label)??"全部"}let a=rt([]),u=rt(0),g=rt(!1),C=rt(""),c=rt(""),d=rt(""),k=null,f=rt(0),R=rt(null),D=rt(!1);const z=100;function S(){k&&clearTimeout(k),k=setTimeout(()=>{k=null,h(f,0),H()},i)}qs(()=>{k&&clearTimeout(k)});function V(){const l=new URLSearchParams;l.set("limit",String(z)),l.set("offset",String(s(f))),s(c)&&l.set("level",s(c));const I=s(d).trim();return I&&l.set("category",I),"/api/logs?"+l.toString()}async function H(){h(g,!0),h(C,"");try{const l=await ds(V());if(!l.ok)throw new Error(await l.text().catch(()=>`HTTP ${l.status}`));const I=await l.json();h(a,I.items??[]),h(u,I.total??0)}catch(l){h(C,l instanceof Error?l.message:String(l)),h(a,[]),h(u,0)}finally{h(g,!1)}}function x(){k&&(clearTimeout(k),k=null),h(f,0),H()}async function j(){if(confirm("确定清空全部日志?此操作不可恢复。")){h(D,!0);try{const l=await ds("/api/logs",{method:"DELETE"}),I=await l.text();let U={};try{U=I?JSON.parse(I):{}}catch{U={}}if(!l.ok){Le(U.error||I||`HTTP ${l.status}`,"error");return}U.ok&&(Le(U.deleted!=null?`已清空 ${U.deleted} 条`:"已清空日志","success"),h(f,0),h(R,null),await H())}catch(l){Le(l instanceof Error?l.message:String(l),"error")}finally{h(D,!1)}}}function tt(){s(f)<=0||(h(f,Math.max(0,s(f)-z)),H())}function O(){s(f)+s(a).length>=s(u)||(h(f,s(f)+z),H())}function J(l){h(R,s(R)===l?null:l)}function Z(l){try{return new Date(l).toLocaleString("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})}catch{return l}}function et(l){if(!l)return"";try{return JSON.stringify(JSON.parse(l),null,2)}catch{return l}}function vt(l){if(l==null||l.trim()==="")return"—";try{return JSON.stringify(JSON.parse(l))}catch{return l.replace(/\s+/g," ").trim()}}Ys(()=>s(c),()=>{s(c),h(f,0),H()}),js(),ir();var M=co();$s("1w6l7vk",l=>{Xs(()=>{Zs.title=`日志 - ${tr}`})});var A=b(M),B=b(A),q=b(B),ve=L(b(q),2),Ie=b(ve),es=L(Ie,2);m(ve),m(q);var ss=L(q,2),rs=b(ss),os=b(rs),Te=b(os),Is=L(b(Te),2);to(Is,{type:"single",get items(){return n},get value(){return s(c)},set value(l){h(c,l)},children:(l,I)=>{var U=oo(),Ht=E(U);so(Ht,{class:"level-select-trigger",children:(kt,fe)=>{var ut=ro(),Pt=E(ut),St=b(Pt,!0);m(Pt);var xt=L(Pt,2);Nr(xt,{size:14,class:"level-select-chevron","aria-hidden":"true"}),bt(gt=>Q(St,gt),[()=>(s(c),K(()=>v(s(c))))]),w(kt,ut)},$$slots:{default:!0}});var ge=L(Ht,2);cr(ge,{children:(kt,fe)=>{Jr(kt,{class:"level-select-content",sideOffset:6,align:"start",children:(ut,Pt)=>{Qr(ut,{class:"level-select-viewport",children:(St,xt)=>{var gt=W(),Et=E(gt);We(Et,1,()=>n,T=>T.value,(T,st)=>{Xr(T,{get value(){return s(st),K(()=>s(st).value)},get label(){return s(st),K(()=>s(st).label)},class:"level-select-item",children:(ft,me)=>{Qs();var be=zs();bt(()=>Q(be,(s(st),K(()=>s(st).label)))),w(ft,be)},$$slots:{default:!0}})}),w(St,gt)},$$slots:{default:!0}})},$$slots:{default:!0}})},$$slots:{default:!0}}),w(l,U)},$$slots:{default:!0},$$legacy:!0}),m(Te);var is=L(Te,2),Oe=L(b(is),2);er(Oe),m(is),m(os),m(rs),m(ss),m(B);var ns=L(B,2),Ts=b(ns);{var Os=l=>{var I=io(),U=b(I,!0);m(I),bt(()=>Q(U,s(C))),w(l,I)},Ms=l=>{var I=no();w(l,I)},Hs=l=>{var I=lo();w(l,I)},Es=l=>{var I=uo(),U=b(I),Ht=b(U),ge=b(Ht),kt=L(b(ge));We(kt,5,()=>s(a),Et=>Et.id,(Et,T)=>{var st=ho(),ft=E(st),me=b(ft),be=b(me,!0);m(me);var Me=L(me),He=b(Me),As=b(He,!0);m(He),m(Me);var Ee=L(Me),Rs=b(Ee,!0);m(Ee);var Ae=L(Ee),Ds=b(Ae,!0);m(Ae);var Re=L(Ae),Ls=b(Re,!0);m(Re),m(ft);var Vs=L(ft,2);{var Ks=mt=>{var At=ao(),ls=b(At),as=b(ls),Ws=b(as,!0);m(as),m(ls),m(At),bt(Fs=>Q(Ws,Fs),[()=>(s(T),K(()=>et(s(T).payload)))]),w(mt,At)};Y(Vs,mt=>{s(R),s(T),K(()=>s(R)===s(T).id&&s(T).payload)&&mt(Ks)})}bt((mt,At)=>{Q(be,mt),rr(He,1,`badge level-${s(T),K(()=>s(T).level)??""}`,"svelte-1w6l7vk"),Q(As,(s(T),K(()=>s(T).level))),Q(Rs,(s(T),K(()=>s(T).category))),Q(Ds,(s(T),K(()=>s(T).message))),sr(Re,"title",(s(T),K(()=>s(T).payload??void 0))),Q(Ls,At)},[()=>(s(T),K(()=>Z(s(T).created_at))),()=>(s(T),K(()=>vt(s(T).payload)))]),wt("click",ft,()=>J(s(T).id)),wt("keydown",ft,mt=>mt.key==="Enter"&&J(s(T).id)),w(Et,st)}),m(kt),m(ge),m(Ht),m(U);var fe=L(U,2),ut=b(fe),Pt=b(ut);m(ut);var St=L(ut,2),xt=b(St),gt=L(xt,2);m(St),m(fe),m(I),bt(()=>{Q(Pt,`共 ${s(u)??""} 条,当前 ${s(a),s(f),K(()=>s(a).length?`${s(f)+1}–${s(f)+s(a).length}`:"—")??""}`),xt.disabled=s(f)<=0||s(g),gt.disabled=(s(f),s(a),s(u),s(g),K(()=>s(f)+s(a).length>=s(u)||s(g)))}),wt("click",xt,tt),wt("click",gt,O),w(l,I)};Y(Ts,l=>{s(C)?l(Os):(s(g),s(a),K(()=>s(g)&&s(a).length===0)?l(Ms,1):(s(a),K(()=>s(a).length===0)?l(Hs,2):l(Es,-1)))})}m(ns),m(A),m(M),bt(()=>{Ie.disabled=s(g)||s(D),es.disabled=s(g)||s(D)}),wt("click",Ie,x),wt("click",es,j),gs(Oe,()=>s(d),l=>h(d,l)),wt("input",Oe,S),w(r,M),dt()}export{Ro as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as g,f as y}from"../chunks/D1Gs8-g3.js";import"../chunks/Dgs6d7X5.js";import{o as e,d as O,au as s,av as l,t as h,O as b,$ as k,ax as o,aw as a}from"../chunks/BUngiKFg.js";import{e as C}from"../chunks/DWJZOHke.js";import{h as N}from"../chunks/D-6mYMI1.js";import{P as U,r as _}from"../chunks/DCEY1XiC.js";import{b as D,a as E}from"../chunks/bohabpgg.js";import{p as I}from"../chunks/Bfc47y5P.js";var J=y('<div class="main svelte-1x680s0"><div class="hero svelte-1x680s0"><p class="hero-eyebrow svelte-1x680s0">开发工具</p> <h1 class="hero-title svelte-1x680s0">Parse</h1> <p class="hero-sub svelte-1x680s0">从列表页解析条目结构,返回 JSON,用于调试插件 Parser 规则</p></div> <div class="form-wrap svelte-1x680s0"><form><div class="url-row svelte-1x680s0"><input type="url" placeholder="输入列表页地址…" required="" autocomplete="url" class="svelte-1x680s0"/> <button type="submit" class="svelte-1x680s0">解析</button></div> <div class="form-opts svelte-1x680s0"><label class="svelte-1x680s0"><input type="checkbox" class="svelte-1x680s0"/> Headful</label> <span class="hint svelte-1x680s0">勾选后可观察实际加载过程</span></div></form></div> <div class="info-box svelte-1x680s0">调用 <code class="svelte-1x680s0"></code>,使用站点插件的自定义 Parser(若有),否则回退到 LLM 解析。返回条目列表 JSON,可用于验证 Parser 规则是否正确识别标题、链接、摘要等字段。</div></div>');function H(P){let t=b(""),i=b(!1);function w(){if(!e(t).trim())return;const r=e(t).startsWith("http")?e(t):"https://"+e(t);window.open("/admin/parse/"+encodeURIComponent(r)+(e(i)?"?headless=false":""),"_blank")}var v=J();N("1x680s0",r=>{O(()=>{k.title=`Parse - ${U}`})});var p=l(s(v),2),d=s(p),n=s(d),m=s(n);_(m),o(2),a(n);var c=l(n,2),u=s(c),f=s(u);_(f),o(),a(u),o(2),a(c),a(d),a(p);var x=l(p,2),$=l(s(x));$.textContent="GET /admin/parse/{url}",o(),a(x),a(v),D(m,()=>e(t),r=>h(t,r)),E(f,()=>e(i),r=>h(i,r)),C("submit",d,I(w)),g(P,v)}export{H as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as u,f as b}from"../chunks/D1Gs8-g3.js";import"../chunks/Dgs6d7X5.js";import{o as Z}from"../chunks/C1kQ4pHy.js";import{as as ee,at as se,d as te,$ as ae,au as n,av as c,o as s,aw as i,t as r,O as g,ax as re,ay as P,az as le}from"../chunks/BUngiKFg.js";import{s as O}from"../chunks/CjQQ9_Q2.js";import{i as A}from"../chunks/Qw0Qgx6J.js";import{e as ie,i as oe}from"../chunks/DjzVVxpy.js";import{h as ne}from"../chunks/D-6mYMI1.js";import{P as de,r as ve,a as ce}from"../chunks/DCEY1XiC.js";import{s as fe}from"../chunks/DI-t-G_K.js";import{e as f}from"../chunks/DWJZOHke.js";import{i as pe}from"../chunks/CVjCNJia.js";import{b as I}from"../chunks/CBY2biv-.js";import{s as $}from"../chunks/CtHRh_pJ.js";var me=b('<div class="state svelte-jqd85f">加载中…</div>'),ue=b('<div role="listitem" draggable="true"><span class="drag-handle svelte-jqd85f" title="拖拽排序">⋮⋮</span> <label class="toggle-wrap svelte-jqd85f"><input type="checkbox" class="svelte-jqd85f"/> <span class="toggle-slider svelte-jqd85f"></span></label> <span class="step-label svelte-jqd85f"> </span></div>'),ge=b('<button type="button" class="btn-add svelte-jqd85f">+ 添加步骤</button>'),be=b('<div class="body svelte-jqd85f"><section class="pipeline-section svelte-jqd85f"><h3 class="section-title svelte-jqd85f">Pipeline(入库前)</h3> <p class="hint svelte-jqd85f">对每条新入库条目执行,顺序由上到下。</p> <div class="step-list svelte-jqd85f" role="list"></div> <!></section> <div class="save-row svelte-jqd85f"><button type="button" class="btn btn-primary svelte-jqd85f"> </button></div></div>'),he=b('<div class="feed-wrap svelte-jqd85f"><div class="feed-col svelte-jqd85f"><div class="feed-header svelte-jqd85f"><h2 class="svelte-jqd85f">Pipeline</h2> <p class="page-desc svelte-jqd85f">入库前处理(打标签、翻译),可调整顺序与开关。</p></div> <!></div></div>');function Ie(C,F){ee(F,!1);const J={qualityFilter:"质量过滤",tagger:"打标签",translator:"翻译"};let a=g([]),h=g([]),q=g(!0),p=g(!1),m=g(null);async function L(){r(q,!0);try{const e=await I("/api/pipeline");r(a,(e==null?void 0:e.steps)??[]),r(h,(e==null?void 0:e.availableIds)??[])}catch{r(a,[]),r(h,[])}finally{r(q,!1)}}async function M(){r(p,!0);try{const e=await I("/api/pipeline",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({steps:s(a)})});if(!(e!=null&&e.ok))throw new Error((e==null?void 0:e.message)??"保存失败");r(a,(e==null?void 0:e.steps)??s(a)),$("已保存","success")}catch(e){$("保存失败: "+(e instanceof Error?e.message:String(e)),"error")}finally{r(p,!1)}}function N(e){r(a,s(a).map((t,l)=>l===e?{...t,enabled:!t.enabled}:t))}function U(e){r(m,e)}function z(e){e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect="move")}function B(e){if(s(m)==null)return;const t=[...s(a)],[l]=t.splice(s(m),1);t.splice(e,0,l),r(a,t),r(m,null)}function R(){const e=new Set(s(a).map(l=>l.id)),t=s(h).find(l=>!e.has(l));t&&r(a,[...s(a),{id:t,enabled:!1}])}Z(L),pe();var y=he();ne("jqd85f",e=>{te(()=>{ae.title=`Pipeline - ${de}`})});var T=n(y),G=c(n(T),2);{var H=e=>{var t=me();u(e,t)},K=e=>{var t=be(),l=n(t),w=c(n(l),4);ie(w,5,()=>s(a),oe,(d,o,j)=>{var v=ue();let E;var x=c(n(v),2),S=n(x);ve(S),re(2),i(x);var D=c(x,2),Y=n(D,!0);i(D),i(v),P(()=>{E=fe(v,1,"step-row svelte-jqd85f",null,E,{dragging:s(m)===j}),ce(S,s(o).enabled),O(Y,J[s(o).id]??s(o).id)}),f("change",S,()=>N(j)),f("dragstart",v,()=>U(j)),f("dragover",v,z),f("drop",v,()=>B(j)),u(d,v)}),i(w);var Q=c(w,2);{var V=d=>{var o=ge();P(()=>o.disabled=s(p)),f("click",o,R),u(d,o)},W=le(()=>s(h).some(d=>!s(a).some(o=>o.id===d)));A(Q,d=>{s(W)&&d(V)})}i(l);var k=c(l,2),_=n(k),X=n(_,!0);i(_),i(k),i(t),P(()=>{_.disabled=s(p),O(X,s(p)?"保存中…":"保存")}),f("click",_,M),u(e,t)};A(G,e=>{s(q)?e(H):e(K,-1)})}i(T),i(y),u(C,y),se()}export{Ie as component};
|
|
File without changes
|
|
File without changes
|