1const u=JSON.parse(document.querySelector("[data-gyn-texts]")?.textContent||"[]"),i=28,g=14;function D(){['[data-event="gyn-ovulation-calculator"]','[data-event="gyn-pregnancy-calculator"]'].forEach(t=>{document.querySelector(t)?.addEventListener("submit",y)})}function d(t,e){const n=e>35?-1:e>=30?2:1;let r;if(n>0){const o=new Date(Date.parse(t)),a=g-(i-e),c=new Date;c.setDate(o.getDate()+a-n);const l=new Date;l.setDate(o.getDate()+a+n),r=s("ovul_inf").replace("{datum1}",c.toLocaleDateString("sk-SK")).replace("{datum2}",l.toLocaleDateString("sk-SK"))}else r=s("ovul_inf");return r+'<br><div style="font-size:13px; line-height: 1.2">'+s("ovul_extra_inf")+"</div>"}function m(t,e){const n=e===1?new Date(Date.parse(t)):new Date(Date.parse(t)-229824e5);let r=u.filter(a=>a.group_key==="preg_calc").map(a=>a.text).join("<br>");return r.match(/\{tyzden\d+}/g)?.map(a=>a.match(/\d+/)?.join(""))?.forEach(a=>{r=r.replace(`{tyzden${a}}`,f(n,parseInt(a??"")))}),r}function y(t){t.preventDefault();const e=t.target,n=new FormData(e),r=n.get("date"),o=n.get("value"),a=e.dataset.event==="gyn-ovulation-calculator"?d(r.toString(),Number(o)):m(r.toString(),Number(o)),c=e.parentElement?.querySelector("[data-result]");c.innerHTML=a,c.classList.remove("hidden")}function f(t,e){const n=new Date;return n.setTime(t.getTime()+e*7*24*60*60*1e3),n.toLocaleDateString("sk-SK")}function s(t){return u.filter(e=>e.key===t)[0].text}D();export{D as initGynCalculators};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.