import{k as et,j as d,t as it,h as nt,m as ot,n as A,p as o,i as D,v as lt,A as at,e as p,x as st,s as rt}from"./web.Os7kOAdY.js";import{c as ct}from"./clipboard.BNxbz_oK.js";import{g as H,t as ut}from"./i18n-runtime._BAkvU05.js";var dt=at('<div class=panel style=display:flex;flex-direction:column;gap:14px><div class=tool-grid-3><div class=tool-field><span class=tool-label></span><div class=tool-tabs><button></button><button></button></div></div><div class=tool-field><span class=tool-label></span><div class=tool-tabs><button></button><button></button><button></button></div></div><div class=tool-field><span class=tool-label></span><input class=tool-input type=number min=1 max=200></div></div><div class=tool-actions><button class="tool-btn is-primary"></button><button class=tool-btn></button><span class=tool-hint><!$><!/> <!$><!/></span></div><pre class=tool-pre style=white-space:pre-wrap;font-family:inherit;font-size:14px;line-height:1.7>');const pt="lorem ipsum dolor sit amet consectetur adipiscing elit sed do eiusmod tempor incididunt ut labore et dolore magna aliqua enim ad minim veniam quis nostrud exercitation ullamco laboris nisi aliquip ex ea commodo consequat duis aute irure reprehenderit voluptate velit esse cillum eu fugiat nulla pariatur excepteur sint occaecat cupidatat non proident sunt culpa qui officia deserunt mollit anim id est laborum".split(/\s+/),$t="风急天高猿啸哀渚清沙白鸟飞回无边落木萧萧下不尽长江滚滚来万里悲秋常作客百年多病独登台艰难苦恨繁霜鬓潦倒新停浊酒杯春眠不觉晓处处闻啼鸟夜来风雨声花落知多少床前明月光疑是地上霜举头望明月低头思故乡千山鸟飞绝万径人踪灭孤舟蓑笠翁独钓寒江雪".split("");function I(l,s){return l+Math.floor(Math.random()*(s-l+1))}function O(l,s){const t=l==="la"?pt:$t,e=[];for(let c=0;c<s;c++)e.push(t[Math.floor(Math.random()*t.length)]);return e}function P(l){const s=I(6,14),t=O(l,s);if(l==="zh")return t.join("")+"。";const e=t.join(" ");return e[0].toUpperCase()+e.slice(1)+"."}function bt(l){const s=I(3,6),t=[];for(let e=0;e<s;e++)t.push(P(l));return l==="zh"?t.join(""):t.join(" ")}function ht(){const[l,s]=d(H(),{equals:!1}),t=a=>ut(a,l());it(()=>{const a=r=>{const i=r.detail?.locale;i&&s(i)};window.addEventListener("taitan:locale-change",a),s(H()),rt(()=>window.removeEventListener("taitan:locale-change",a))});const[e,c]=d("la"),[u,f]=d("paragraph"),[C,U]=d(3),[k,Z]=d(0),m=nt(()=>{k();const a=Math.max(1,Math.min(200,C())),r=[];if(u()==="word"){const i=O(e(),a);return e()==="zh"?i.join(""):i.join(" ")}if(u()==="sentence"){for(let i=0;i<a;i++)r.push(P(e()));return e()==="zh"?r.join(""):r.join(" ")}for(let i=0;i<a;i++)r.push(bt(e()));return r.join(`

`)});return(()=>{var a=ot(dt),r=a.firstChild,i=r.firstChild,w=i.firstChild,B=w.nextSibling,$=B.firstChild,h=$.nextSibling,j=i.nextSibling,y=j.firstChild,F=y.nextSibling,b=F.firstChild,v=b.nextSibling,g=v.nextSibling,G=j.nextSibling,M=G.firstChild,z=M.nextSibling,L=r.nextSibling,x=L.firstChild,_=x.nextSibling,S=_.nextSibling,J=S.firstChild,[q,K]=A(J.nextSibling),Q=q.nextSibling,V=Q.nextSibling,[X,Y]=A(V.nextSibling),tt=L.nextSibling;return o(w,()=>t("语言")),$.$$click=()=>c("la"),o($,()=>t("拉丁")),h.$$click=()=>c("zh"),o(h,()=>t("中文")),o(y,()=>t("单位")),b.$$click=()=>f("word"),o(b,()=>t("词")),v.$$click=()=>f("sentence"),o(v,()=>t("句")),g.$$click=()=>f("paragraph"),o(g,()=>t("段")),o(M,()=>t("数量")),z.$$input=n=>U(parseInt(n.currentTarget.value,10)||1),x.$$click=()=>Z(k()+1),o(x,()=>t("重新生成")),_.$$click=()=>ct(m()),o(_,()=>t("复制")),o(S,()=>m().length,q,K),o(S,()=>t("字符"),X,Y),o(tt,m),D(n=>{var E=`tool-tab ${e()==="la"?"is-active":""}`,N=`tool-tab ${e()==="zh"?"is-active":""}`,T=`tool-tab ${u()==="word"?"is-active":""}`,R=`tool-tab ${u()==="sentence"?"is-active":""}`,W=`tool-tab ${u()==="paragraph"?"is-active":""}`;return E!==n.e&&p($,n.e=E),N!==n.t&&p(h,n.t=N),T!==n.a&&p(b,n.a=T),R!==n.o&&p(v,n.o=R),W!==n.i&&p(g,n.i=W),n},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),D(()=>st(z,"value",C())),lt(),a})()}et(["click","input"]);export{ht as default};
