import{r,w as E,M as I,q as U,u as j,A as m,B as V,$,F as D,v as e,x as o,G as d,J as N,K as R}from"./vue-0d7ee8e8.js";import{Z as W}from"./inertia-11bf9011.js";import{A as Z,a as q}from"./AppLayout-0a5a7f0f.js";import{F as z}from"./Feedback-c61d8668.js";import{_ as G}from"./_plugin-vue_export-helper-b15b4a05.js";import"./@inertiajs/core-9c117dfe.js";import"./axios-dd1c8fc2.js";import"./recaptcha-v3-f0e7cd4f.js";import"./qs-0fed5bc1.js";import"./get-intrinsic-20bd36cc.js";import"./object-inspect-747fc63f.js";import"./nprogress-f6c1521f.js";import"./lodash.isequal-390c7467.js";import"./inertia-d4e795d3.js";import"./preload-helper-f61836a9.js";import"./userActivity-e849d9de.js";import"./fingerprint-374ab551.js";const J=["content"],K={class:"section"},O={class:"heading"},P=["innerHTML"],Q=["innerHTML"],X={class:"lg:flex"},Y={class:"w-full lg:w-8/12"},ee=["innerHTML"],te={class:"mb-2 text-left"},le=["src","alt"],se=["disabled"],oe=["src","alt"],ae=["disabled"],ne=["src","alt"],re=["innerHTML"],ie=["aria-label"],ce={class:"w-full lg:w-4/12"},de={class:"w-full lg:mx-3"},ue={class:"pl-2 text-left words-count-bg"},he=["src","alt"],ge={class:"bg-gray-200"},me={class:"px-5 border-solid border-b-2 border-gray-400"},be={class:"float-right bg-gray-700 px-2 text-white rounded-full"},pe={class:"px-5 border-solid border-b-2 border-gray-400"},fe={class:"float-right bg-gray-700 px-2 text-white rounded-full"},ve={class:"px-5 border-solid border-b-2 border-gray-400"},we={class:"float-right bg-gray-700 px-2 text-white rounded-full"},_e={class:"px-5 border-solid border-b-2 border-gray-400"},xe={class:"float-right bg-gray-700 px-2 text-white rounded-full"},ye={class:"px-5 border-solid border-b-2 border-gray-400"},Me={class:"float-right bg-gray-700 px-2 text-white rounded-full"},Te={class:"px-5 border-solid border-b-2 border-gray-400"},Ce={class:"float-right bg-gray-700 px-2 text-white rounded-full"},Le={class:"flex items-center justify-center py-6"},Be=["innerHTML"],He={__name:"Countwords",props:["placeholders","ads","images"],setup(t){const a=r(""),b=r(0),p=r(0),y=r(0),M=r(0),T=r(""),C=r(""),f=r(!1),v=r(!1),w=r(!1),_=r(!1);let i=[],c=[];const A=()=>{a.value="",u()},u=()=>{let l=a.value;p.value=l.replace(/\n$/gm,"").length,l=l.replace(/(^\s*)|(\s*$)/gi,""),l=l.replace(/[ ]{2,}/gi," "),l=l.replace(/\n /,`
`),y.value=l.replace(/\n$/gm,"").split(/\n/).length,M.value=l.match(/(\w)*[.?!]+(\w?|$)/g)?l.match(/(\w)*[.?!]+(\w?|$)/g).length:0;let s=0;const n=l.split(" ");for(let x=0;x<n.length;x++){const k=n[x].trim();k!==""&&/[ÄäÖöÜüẞßaâÂàÀæÆçÇéÉêÊèÈëËîÎïÏôÔœŒûÛùÙÿŸÅåa-zA-Z0-9]/g.test(k)&&(s+=1)}b.value=s,T.value=L(Math.round(s/(275/60)))+" Min.",C.value=L(Math.round(s/(180/60)))+" Min.";const g=document==null?void 0:document.getElementById("count-words"),H=document==null?void 0:document.getElementById("count-chars");g&&(g.textContent=b.value),H&&(H.textContent=p.value)},L=l=>{const s=g=>`0${Math.floor(g)}`.slice(-2);return[l%3600/60,l%60].map(s).join(":")},h=l=>{const s=l.toString().split(".");return s[0]=s[0].replace(/\B(?=(\d{3})+(?!\d))/g,"."),s.join(",")},B=()=>{const l=a.value.trim(),s=i[i.length-1]||"",n=c[i.length-1]||"";l!==(s==null?void 0:s.trim())&&i.push(l),(!w.value&&!_.value||n&&n===l&&c.length===1)&&(c.length=[]),f.value=i.length,v.value=c.length,w.value=!1,_.value=!1},F=()=>{const l=a.value;for(;a.value===l;){if(a.value&&!i.length&&(i=[""]),i.length>0){const s=i.pop(),n=a.value;(c.length===0||n!==c[c.length-1])&&c.push(n),a.value=s,v.value=!0,w.value=!0}u()}},S=()=>{if(c.length>0){const l=c.pop();i.push(a.value),a.value=l,f.value=!0,_.value=!0}u()};return E(a,()=>{B(),u()}),I(()=>{B(),u()}),(l,s)=>(U(),j(D,null,[m($(W),null,{default:V(()=>[e("title",null,o(t.placeholders.metaTitle),1),e("meta",{name:"description",content:t.placeholders.metaDescription},null,8,J)]),_:1}),m(Z,null,{default:V(()=>[e("section",K,[e("h1",O,[e("span",{innerHTML:t.placeholders.title},null,8,P),e("span",{class:"subheading",innerHTML:t.placeholders.subtitle},null,8,Q)]),e("div",X,[e("div",Y,[e("div",{class:"mb-2 text-3xl words-count-bg",innerHTML:t.placeholders.headline},null,8,ee),e("div",te,[e("button",{"aria-label":"clear",onClick:A,class:"button button-lg my-1"},[e("img",{class:"inline",src:t.images.clearButton,width:"15.75",height:"18.4",alt:t.placeholders.clearButton},null,8,le),d(" "+o(t.placeholders.clearButton),1)]),e("button",{"aria-label":"undo",onClick:F,class:"button button-lg my-1",disabled:!f.value},[e("img",{class:"inline",src:t.images.backButton,width:"15.75",height:"18.4",alt:t.placeholders.backButton},null,8,oe),d(" "+o(t.placeholders.backButton),1)],8,se),e("button",{"aria-label":"redo",onClick:S,class:"button button-lg my-1",disabled:!v.value},[e("img",{class:"inline",src:t.images.forwardButton,width:"15.75",height:"18.4",alt:t.placeholders.forwardButton},null,8,ne),d(" "+o(t.placeholders.forwardButton),1)],8,ae)]),e("p",{class:"mb-1",innerHTML:t.placeholders.text},null,8,re),N(e("textarea",{"onUpdate:modelValue":s[0]||(s[0]=n=>a.value=n),onInput:u,class:"border border-teal-400 rounded w-full p-1",rows:"10","aria-label":t.placeholders.text},null,40,ie),[[R,a.value]])]),e("div",ce,[e("table",de,[e("thead",null,[e("tr",null,[e("th",ue,[e("img",{class:"inline",src:t.images.toolsHeadline,width:"18",height:"18.4",alt:t.placeholders.toolsHeadline},null,8,he),d(" "+o(t.placeholders.toolsHeadline),1)])])]),e("tbody",ge,[e("tr",null,[e("td",me,[d(o(t.placeholders.wordsLabel)+" ",1),e("span",be,o(h(b.value)),1)])]),e("tr",null,[e("td",pe,[d(o(t.placeholders.lettersLabel)+" ",1),e("span",fe,o(h(p.value)),1)])]),e("tr",null,[e("td",ve,[d(o(t.placeholders.paragraphsLabel)+" ",1),e("span",we,o(h(y.value)),1)])]),e("tr",null,[e("td",_e,[d(o(t.placeholders.sentenceLabel)+" ",1),e("span",xe,o(h(M.value)),1)])]),e("tr",null,[e("td",ye,[d(o(t.placeholders.readingTimeLabel)+" ",1),e("span",Me,o(T.value),1)])]),e("tr",null,[e("td",Te,[d(o(t.placeholders.readingAloudTimeLabel)+" ",1),e("span",Ce,o(C.value),1)])])])])])]),e("div",Le,[m(q,{"ad-key":"ad3"})]),e("div",{class:"py-3",innerHTML:t.placeholders.description},null,8,Be),m($(z))])]),_:1})],64))}},Ge=G(He,[["__scopeId","data-v-e599f421"]]);export{Ge as default};