1import{b as L}from"./B1ANI7s_.js";import{d as R}from"./DpSUvzOu.js";import{c as T}from"./DFwrOiIh.js";import{g as x}from"./dQh_cajN.js";import{f as $}from"./DytGS_oV.js";import{d as r}from"./B9BvQYN_.js";import{_ as P}from"./DlAUqK2U.js";import{a as C}from"./CrfJppij.js";import{V as U}from"./6nf4KObW.js";import{r as u,B as z,g as I,o as G,c as J,b as m,w,a as E,H as e,ae as y,aj as K,n as Q}from"./C--HIF4D.js";import{V as X}from"./CEAP_zQ3.js";import"./COzyvX5r.js";const Y=["innerHTML"],Z="width: 150px;",ee={__name:"WariaiRatioFraction",props:{params:Object},emits:["answer"],setup(B,{expose:D,emit:j}){const p=B,l=u(""),o=u({numerator:"",denominator:""}),d=u(""),i=u(""),c=u(null),b=u(null),H={numerator:c,denominator:b},M=z(()=>`${i.value}${d.value}ã¯${l.value}${d.value}ã®ä½åã®ä½ï¼`),_=[t=>!!t||""],g=async()=>{l.value="",o.value.numerator="",o.value.denominator="",d.value="",i.value="",O(),await Q(()=>c.value.focus())},O=()=>{d.value=R.unit[Math.floor(Math.random()*R.unit.length)];const t=()=>{for(let F=0;F<1e4;F++){const h=x.randomNumComfortable(p.params.factor_array,p.params.moto_min,p.params.moto_max),f=x.randomNum(1,4,0),v=x.randomNum(2,12,0);if(h*f/v==Math.floor(h*f/v)&&T.coprime(f,v))return[h,f,v]}},[a,n,k]=t();l.value=a,i.value=Math.round(a*n/k)},S=()=>{const t=T.gcd(l.value,i.value),a=[i.value/t,l.value/t],n=a[0]==o.value.numerator&&a[1]==o.value.denominator;return{question:M.value,true_answer:$.Fraction(a[0],a[1]),your_answer:$.Fraction(o.value.numerator,o.value.denominator),is_correct:n,kuraberu:i.value,moto:l.value,unit:d.value}},N=j,W=t=>{if(t.key=="Enter")return b.value.focus()},q=t=>{if(t.key=="Enter"&&o.value.numerator&&o.value.denominator)return N("answer");if(t.key=="Enter")return c.value.focus()},s=u("numerator"),A=t=>{o.value[s.value]||(o.value[s.value]=""),t=="C"?o.value[s.value]="":t==="answer"?N("answer"):o.value[s.value]+=t,H[s.value].value.focus()},V=L();return D({start:g,checkAnswer:S,onTouchPanelPress:A}),I(()=>g()),(t,a)=>(G(),J("div",null,[m(C,{class:"mb-2 text-center"},{default:w(()=>[E("span",{innerHTML:e(M),class:y(["font-weight-bold",{"text-h3":!e(r).isMobile(),"text-h5":e(r).isMobile()}])},null,10,Y)]),_:1}),m(C,null,{default:w(()=>[m(U,{class:"justify-center pb-6 mb-2"},{default:w(()=>[E("div",{class:"mr-4",style:Z},[m(K,{ref_key:"numeratorRef",ref:c,onFocus:a[0]||(a[0]=n=>s.value="numerator"),onKeydown:W,modelValue:e(o).numerator,"onUpdate:modelValue":a[1]||(a[1]=n=>e(o).numerator=n),label:"çã",class:y(["text-h3 answer",{"text-h3":!e(r).isMobile(),"text-h5":e(r).isMobile()}]),height:e(r).isMobile()?60:100,"hide-spin-buttons":"",variant:"outlined",rules:_,"hide-details":"",readonly:e(r).isMobileOrTablet()&&!e(V).isEnableKeyboard},null,8,["modelValue","class","height","readonly"]),m(X,{style:{"border-bottom":"3px solid #000",margin:"20px -30px","max-width":"200%"}}),m(K,{ref_key:"denominatorRef",ref:b,onFocus:a[2]||(a[2]=n=>s.value="denominator"),onKeydown:q,modelValue:e(o).denominator,"onUpdate:modelValue":a[3]||(a[3]=n=>e(o).denominator=n),label:"çã",class:y(["text-h3 answer",{"text-h3":!e(r).isMobile(),"text-h5":e(r).isMobile()}]),height:e(r).isMobile()?60:100,"hide-spin-buttons":"",variant:"outlined","hide-details":"",rules:_,readonly:e(r).isMobileOrTablet()&&!e(V).isEnableKeyboard},null,8,["modelValue","class","height","readonly"])])]),_:1})]),_:1})]))}},fe=P(ee,[["__scopeId","data-v-5dff08c4"]]);export{fe as default};
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.