PageSourceSearch

https://app.memrise.com/_next/static/chunks/pages/aprender/vocab-check-8339615b50c9bad8.js

js memrise.com collected 2026-10-01 08:37:57 UTC 30,287 bytes, 2 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4992],{3033:(e,t,r)=>{"use strict";r.d(t,{VY:()=>a,hE:()=>i,mc:()=>o,yp:()=>c});var n=r(5646),o=n.Ay.div.withConfig({componentId:"sc-1ap8rmq-0"})(function(e){var t=e.theme;return(0,n.AH)(["display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:",";padding:"," ",";min-height:60vh;"],t.sz.s4,t.sz.s6,t.sz.s4)}),i=n.Ay.h1.withConfig({componentId:"sc-1ap8rmq-1"})(function(e){var t=e.theme;return(0,n.AH)(["",";color:",";margin:0;@media (max-width:","){",";}"],t.typography.heading.desktop.m,t.co.neutral10,t.sz.lg,t.typography.heading.mobile.m)}),a=n.Ay.p.withConfig({componentId:"sc-1ap8rmq-2"})(function(e){var t=e.theme;return(0,n.AH)(["",";color:",";margin:0;max-width:28rem;"],t.typography.paragraph.m,t.co.neutral40)}),c=n.Ay.div.withConfig({componentId:"sc-1ap8rmq-3"})(function(e){var t=e.theme;return(0,n.AH)(["display:flex;flex-direction:column;gap:",";width:100%;max-width:20rem;margin-top:",";"],t.sz.s3,t.sz.s2)})},11916:(e,t,r)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/aprender/vocab-check",function(){return r(34961)}])},14135:(e,t,r)=>{"use strict";r.d(t,{O:()=>o,Z:()=>i});var n=r(70610),o=function(e,t){void 0!==t&&t>0&&(e.future_learnables_offset=t)},i=function(e){if("string"==typeof e){var t=(0,n.oV)(e);if(!(t instanceof n.XR)&&!(t<0))return t}}},15785:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n="/_next/static/audios/be633aa1d63996dba16fba6c21d35297.mp3"},23292:(e,t,r)=>{"use strict";r.d(t,{A:()=>v});var n=r(14232),o=r(75784),i=r(81840),a=r(42969),c=r(98068),s=r(5646),d=r(37876);function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?l(Object(r),!0).forEach(function(t){(0,a.A)(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var f={initial:{translateY:0},exit:{transition:{duration:.5},translateY:-30,opacity:0},animate:{scale:[.8,1,.8,1],opacity:[.8,1,.8,1],translateY:0}},h=(0,s.Ay)(function(e){return(0,d.jsx)(c.PY1.svg,u(u(u({"data-testid":"fullHeart",viewBox:"0 0 37 36",fill:"none",xmlns:"http://www.w3.org/2000/svg"},f),e),{},{children:(0,d.jsx)("path",{d:"M36.9647 10.1928C36.9307 9.88191 36.9647 9.57097 36.8967 9.29458C36.3866 6.73795 35.2643 4.52682 33.2919 2.79937C31.9996 1.65926 30.6053 0.726437 28.905 0.311849C26.8985 -0.206385 24.9601 -0.102738 23.1237 1.00283C21.0493 2.24659 19.621 4.14678 18.6688 6.42701C18.6007 6.59976 18.5667 6.7725 18.5667 6.9107C18.0566 5.52874 17.3425 4.21588 16.3562 3.07576C14.7919 1.24467 12.9215 0.0354578 10.0649 0.0354578C9.62279 0.000908846 8.84062 0.173654 8.05846 0.380947C5.54191 1.10648 3.6375 2.73028 2.10717 4.76866C0.168749 7.39438 -0.341362 10.4347 0.168749 13.5786C0.508822 15.8934 1.63107 18.0355 3.22941 19.7629C4.75974 21.4213 6.35809 23.0105 7.88842 24.7034C9.01066 25.9472 10.2009 27.1564 11.2892 28.4001C12.0373 29.2639 12.8535 30.0585 13.6017 30.9222C14.5879 32.0278 16.6963 34.4117 17.7846 35.69C18.1586 36.1046 18.8048 36.1391 19.1789 35.7245C20.4031 34.3771 22.8857 31.6477 23.9739 30.4385C26.0824 28.1583 28.2248 25.8435 30.3333 23.5633C31.5575 22.2504 32.7818 20.9721 33.9721 19.6938C34.2441 19.3829 34.5162 19.0719 34.7542 18.7264C35.9785 16.9299 36.8287 15.0297 36.9647 12.8186C36.9987 12.6113 36.9987 10.331 36.9647 10.1928Z"})}))}).withConfig({componentId:"sc-xxjfnv-0"})(function(e){var t=e.theme;return(0,s.AH)(["position:absolute;z-index:",";& *{fill:",";}"],t.zi.z2,t.co.error60)}),g=(0,s.Ay)(function(e){return(0,d.jsx)("svg",u(u({"data-testid":"emptyHeart",viewBox:"0 0 37 36",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{},{children:(0,d.jsx)("path",{d:"M36.9647 10.1928C36.9307 9.88191 36.9647 9.57097 36.8967 9.29458C36.3866 6.73795 35.2643 4.52682 33.2919 2.79937C31.9996 1.65926 30.6053 0.726437 28.905 0.311849C26.8985 -0.206385 24.9601 -0.102738 23.1237 1.00283C21.0493 2.24659 19.621 4.14678 18.6688 6.42701C18.6007 6.59976 18.5667 6.7725 18.5667 6.9107C18.0566 5.52874 17.3425 4.21588 16.3562 3.07576C14.7919 1.24467 12.9215 0.0354578 10.0649 0.0354578C9.62279 0.000908846 8.84062 0.173654 8.05846 0.380947C5.54191 1.10648 3.6375 2.73028 2.10717 4.76866C0.168749 7.39438 -0.341362 10.4347 0.168749 13.5786C0.508822 15.8934 1.63107 18.0355 3.22941 19.7629C4.75974 21.4213 6.35809 23.0105 7.88842 24.7034C9.01066 25.9472 10.2009 27.1564 11.2892 28.4001C12.0373 29.2639 12.8535 30.0585 13.6017 30.9222C14.5879 32.0278 16.6963 34.4117 17.7846 35.69C18.1586 36.1046 18.8048 36.1391 19.1789 35.7245C20.4031 34.3771 22.8857 31.6477 23.9739 30.4385C26.0824 28.1583 28.2248 25.8435 30.3333 23.5633C31.5575 22.2504 32.7818 20.9721 33.9721 19.6938C34.2441 19.3829 34.5162 19.0719 34.7542 18.7264C35.9785 16.9299 36.8287 15.0297 36.9647 12.8186C36.9987 12.6113 36.9987 10.331 36.9647 10.1928Z"})}))}).withConfig({componentId:"sc-xxjfnv-1"})(function(e){var t=e.theme;return(0,s.AH)(["position:absolute;& *{fill:",";}"],t.co.neutral90)}),p=s.Ay.div.withConfig({componentId:"sc-xxjfnv-2"})(function(e){var t=e.theme;return(0,s.AH)(["position:relative;width:",";margin-bottom:",";"],t.sz.s8,t.sz.s8)}),m=function(e){var t=e.lost;return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(o.N,{children:!t&&(0,d.jsx)(h,{})}),t&&(0,d.jsx)(g,{})]})};let v=(0,n.memo)(function(e){var t=e.numLives,r=e.className;return(0,d.jsxs)(i.A,{$direction:"horizontal",$spacing:"s1","data-testid":"heartLivesLeftIndicator",className:r,children:[(0,d.jsx)(p,{children:(0,d.jsx)(m,{lost:t<1})}),(0,d.jsx)(p,{children:(0,d.jsx)(m,{lost:t<2})}),(0,d.jsx)(p,{children:(0,d.jsx)(m,{lost:t<3})})]})})},25022:(e,t,r)=>{"use strict";r.d(t,{K:()=>d});var n=r(61542),o=r(2553),i=r(5646),a=i.Ay.div.withConfig({componentId:"sc-zjxmey-0"})(function(e){var t=e.theme,r=e.$disabled;return(0,i.AH)(["padding:0;display:flex;align-items:center;gap:",";",";cursor:pointer;color:",";"],t.sz.s2,t.typography.paragraph.m,r?t.co.secondary50:t.co.secondary0)}),c=i.Ay.button.withConfig({componentId:"sc-zjxmey-1"})(function(e){var t=e.theme,r=e.$disabled,n=e.$inverseColors,o=e.$pressed,a=e.$textInside;return(0,i.AH)(["cursor:pointer;border-radius:50%;border:none;width:",";height:",";padding:0;background-color:",";color:",";text-align:-webkit-center;&:hover{background-color:",";}"," ",";",";& svg{font-size:",";}
1"],t.sz.s8,t.sz.s8,t.co.neutral98,r?t.co.secondary50:t.co.secondary0,t.co.neutral95,n&&(0,i.AH)(["background-color:",";&:hover{background-color:",";}"],r?t.co.neutral98:t.co.primary20,r?t.co.neutral95:t.co.primary40),o&&(0,i.AH)(["background-color:",";border:"," solid ",";&:hover{background-color:",";}"],t.co.primary90,t.bo.thinWidth,t.co.primary20,t.co.primary90),a&&(0,i.AH)(["display:flex;align-items:center;width:auto;padding:",";gap:",";border-radius:",";border:"," solid ",";",";"],t.sz.s2,t.sz.s2,t.bo.medium,t.bo.thinWidth,o?t.co.primary20:t.co.neutral95,t.typography.paragraph.base),t.sz.s5)}),s=r(37876),d=function(e){var t=e.disabled,r=void 0!==t&&t,i=e.handleClick,d=e.ariaLabel,l=e.icon,u=e.text,f=e.className,h=e.inverseColors,g=e.pressed,p=void 0!==g&&g,m=e.children,v=function(){r||i()};return(0,s.jsxs)(a,{$disabled:r,onClick:v,children:[(0,s.jsxs)(c,{onClick:function(){return!u&&v},onKeyDown:function(e){r||("Enter"===e.key||" "===e.key)&&(e.preventDefault(),i())},"aria-label":d,"aria-disabled":r,"aria-pressed":p,disabled:r,className:f,$disabled:r,$inverseColors:void 0!==h&&h,$pressed:p,$textInside:!!m,children:[(0,n.Ay)(l)?(0,s.jsx)(o.A,{name:l}):l,m]}),u]})}},34961:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>eD});var n=r(5720),o=r(77328),i=r.n(o),a=r(64191),c=r(63857),s=r(60180),d=r.n(s),l=r(14232),u=r(89099),f=r(15785),h=r(9098),g=r(91561),p=r(68567),m=r(47019),v=r(53403),b=r(48278),y=r(14135),x=r(70610),w=r(61542),C=r(3033),k=r(37876),j=(0,n.YK)({title:{id:"vocab_check_session_failure_title",defaultMessage:"Out of hearts"},description:{id:"vocab_check_session_failure_description",defaultMessage:"You ran out of hearts. Try again when you are ready."},retry:{id:"vocab_check_session_failure_retry",defaultMessage:"Retry"},exit:{id:"vocab_check_session_failure_exit",defaultMessage:"Exit"}}),O=function(e){var t=e.onRetry,r=e.onExit,o=(0,n.tz)();return(0,k.jsxs)(C.mc,{"data-testid":"vocab-check-failure",children:[(0,k.jsx)(C.hE,{children:o.formatMessage(j.title)}),(0,k.jsx)(C.VY,{children:o.formatMessage(j.description)}),(0,k.jsxs)(C.yp,{children:[(0,k.jsx)(w.$n,{wide:!0,buttonType:"primary",buttonSize:"large",onClick:t,"data-testid":"vocab-check-failure-retry",children:o.formatMessage(j.retry)}),(0,k.jsx)(w.$n,{wide:!0,buttonType:"secondary",buttonSize:"large",onClick:r,"data-testid":"vocab-check-failure-exit",children:o.formatMessage(j.exit)})]})]})},_=r(53590),A=["1","2","3","4","5"],I=["6","7","8","9","0"],z={6:0,7:1,8:2,9:3,0:4},S=function(e){var t=e.enabled,r=e.targetOrder,n=e.sourceOrder,o=e.onSelectTarget,i=e.onSelectSource,a=(0,l.useCallback)(function(e,t){var n=r[Number(t)-1];void 0!==n&&o(n)},[o,r]),c=(0,l.useCallback)(function(e,t){var r=z[t];if(void 0!==r){var o=n[r];void 0!==o&&i(o)}},[i,n]);(0,_.fy)([].concat(A),t?a:void 0),(0,_.fy)([].concat(I),t?c:void 0)},E=r(5646),T=E.Ay.button.withConfig({componentId:"sc-es8v7i-0"})(function(e){var t=e.theme,r=e.$state,n=e.$shortcutSide;return(0,E.AH)(["position:relative;display:flex;align-items:center;justify-content:center;width:100%;min-height:",";padding:"," "," "," ",";border-radius:",";border:"," solid ",";background-color:",";color:",";",";font-weight:",";text-align:center;word-break:break-word;cursor:pointer;transition:background-color 0.15s ease,border-color 0.15s ease,color 0.15s ease,transform 0.15s ease;&:disabled{cursor:default;}"," "," "," @media (max-width:","){min-height:",";padding:"," "," "," ",";",";}"],t.sz.s12,t.sz.s3,"right"===n?t.sz.s8:t.sz.s3,t.sz.s3,"left"===n?t.sz.s8:t.sz.s3,t.bo.medium,t.bo.mediumWidth,t.co.neutral90,t.co.neutral99,t.co.neutral10,t.typography.paragraph.m,t.DEPRECATED_ty.semiBold,"selected"===r&&(0,E.AH)(["border-color:",";background-color:",";color:",";"],t.co.secondary30,t.co.secondary95,t.co.secondary20),"correct"===r&&(0,E.AH)(["border-color:",";background-color:",";color:",";"],t.co.success40,t.co.success95,t.co.success20),"wrong"===r&&(0,E.AH)(["border-color:",";background-color:",";color:",";"],t.co.error40,t.co.error95,t.co.error20),t.sz.lg,t.sz.s10,t.sz.s2,"right"===n?t.sz.s6:t.sz.s2,t.sz.s2,"left"===n?t.sz.s6:t.sz.s2,t.typography.paragraph.s)}),M=E.Ay.span.withConfig({componentId:"sc-es8v7i-1"})(function(e){var t=e.theme,r=e.$side;return(0,E.AH)(["position:absolute;top:50%;transform:translateY(-50%);"," color:",";",";font-weight:",";line-height:1;pointer-events:none;user-select:none;@media (max-width:","){"," font-size:",";}"],"left"===r?"left: ".concat(t.sz.s2,";"):"right: ".concat(t.sz.s2,";"),t.co.neutral60,t.typography.paragraph.s,t.DEPRECATED_ty.mediumWeight,t.sz.lg,"left"===r?"left: ".concat(t.sz.s1,";"):"right: ".concat(t.sz.s1,";"),t.DEPRECATED_ty.small)}),P=function(e){var t=e.label,r=e.state,n=e.onClick,o=e.disabled,i=e.testId,a=e.shortcutKey,c=e.shortcutSide,s=void 0===c?"left":c;return(0,k.jsxs)(T,{type:"button",$state:r,$shortcutSide:a?s:void 0,onClick:n,disabled:void 0!==o&&o,"data-testid":i,"data-state":r,children:[a&&(0,k.jsx)(M,{$side:s,"aria-hidden":"true","data-testid":"".concat(i,"-shortcut"),children:a}),t]})},H=E.Ay.div.withConfig({componentId:"sc-1rdzz6-0"})(function(e){var t=e.theme;return(0,E.AH)(["display:grid;grid-template-columns:1fr 1fr;gap:",";width:100%;align-items:start;@media (max-width:","){gap:",";}
1"],t.sz.s4,t.sz.lg,t.sz.s3)}),D=E.Ay.div.withConfig({componentId:"sc-1rdzz6-1"})(function(e){var t=e.theme;return(0,E.AH)(["display:flex;flex-direction:column;gap:",";width:100%;@media (max-width:","){gap:",";}"],t.sz.s3,t.sz.lg,t.sz.s2)}),$=function(e){var t=e.id,r=e.selectedId,n=e.feedback,o=e.side;return n&&("target"===o?n.targetId:n.sourceId)===t?n.type:r===t?"selected":"idle"},R=function(e){var t=e.remaining,r=e.targetOrder,n=e.sourceOrder,o=e.selectedTargetId,i=e.selectedSourceId,a=e.feedback,c=e.onSelectTarget,s=e.onSelectSource,d=(0,l.useMemo)(function(){return new Map(t.map(function(e){return[e.id,e]}))},[t]),u=null!==a;return S({enabled:!u,targetOrder:r,sourceOrder:n,onSelectTarget:c,onSelectSource:s}),(0,k.jsxs)(H,{"data-testid":"vocab-check-match-board",children:[(0,k.jsx)(D,{"data-testid":"vocab-check-target-column",children:r.map(function(e,t){var r=d.get(e);return r?(0,k.jsx)(P,{label:r.targetText,state:$({id:e,selectedId:o,feedback:a,side:"target"}),onClick:function(){return c(e)},disabled:u,testId:"vocab-check-target-".concat(e),shortcutKey:A[t],shortcutSide:"left"},"target-".concat(e)):null})}),(0,k.jsx)(D,{"data-testid":"vocab-check-source-column",children:n.map(function(e,t){var r=d.get(e);return r?(0,k.jsx)(P,{label:r.sourceText,state:$({id:e,selectedId:i,feedback:a,side:"source"}),onClick:function(){return s(e)},disabled:u,testId:"vocab-check-source-".concat(e),shortcutKey:I[t],shortcutSide:"right"},"source-".concat(e)):null})})]})},Y=r(25022),K=r(23292),N=r(94295),q=(0,n.YK)({label:{id:"vocab_check_session_progress",defaultMessage:"Progress: {completed} of {total} pairs matched"}}),L=function(e){var t=e.completed,r=e.total,o=(0,n.tz)(),i=Math.max(r,0),a=Math.min(Math.max(t,0),i);return(0,k.jsx)(N.C,{role:"progressbar","aria-valuemin":0,"aria-valuemax":i,"aria-valuenow":a,"aria-label":o.formatMessage(q.label,{completed:a,total:i}),"data-testid":"vocab-check-progress",children:Array.from({length:i},function(e,t){var r=t<a;return(0,k.jsx)(N.Y,{$filled:r,"data-testid":"vocab-check-progress-segment-".concat(t),"data-filled":r?"true":"false"},t)})})},F=E.Ay.header.withConfig({componentId:"sc-5xa5po-0"})(function(e){var t=e.theme;return(0,E.AH)(["display:flex;align-items:center;justify-content:space-between;width:100%;gap:",";padding:"," 0;"],t.sz.s3,t.sz.s3)}),V=E.Ay.div.withConfig({componentId:"sc-5xa5po-1"})(function(e){var t=e.theme,r=e.$align;return(0,E.AH)(["display:flex;align-items:center;justify-content:",";gap:",";min-width:",";flex-shrink:0;"],"end"===(void 0===r?"start":r)?"flex-end":"flex-start",t.sz.s2,t.sz.s10)}),W=(0,n.YK)({exit:{id:"vocab_check_session_exit",defaultMessage:"Exit session"}}),B=function(e){var t=e.hearts,r=e.completedCount,o=e.totalCount,i=e.onExit,a=(0,n.tz)();return(0,k.jsxs)(F,{"data-testid":"vocab-check-session-header",children:[(0,k.jsx)(V,{children:(0,k.jsx)(Y.K,{icon:"close",ariaLabel:a.formatMessage(W.exit),handleClick:i})}),(0,k.jsx)(L,{completed:r,total:o}),(0,k.jsx)(V,{$align:"end",children:(0,k.jsx)(K.A,{numLives:t})})]})},Z=r(79407),X=(0,n.YK)({loadingTitle:{id:"vocab_check_session_loading_title",defaultMessage:"Loading exercise…"},insufficientTitle:{id:"vocab_check_session_insufficient_title",defaultMessage:"Not enough words yet"},insufficientDescription:{id:"vocab_check_session_insufficient_description",defaultMessage:"You need more fully grown words in this language before you can start a vocab check."},errorTitle:{id:"vocab_check_session_error_title",defaultMessage:"Something went wrong"},errorDescription:{id:"vocab_check_session_error_description",defaultMessage:"We couldn’t start the vocab check. Please try again later."},completionFailedTitle:{id:"vocab_check_session_completion_failed_title",defaultMessage:"Your progress didn’t save"},completionFailedDescription:{id:"vocab_check_session_completion_failed_description",defaultMessage:"Something went wrong saving your result. Please try again later."},exit:{id:"vocab_check_session_status_exit",defaultMessage:"Exit"}}),U={insufficient:{title:X.insufficientTitle,description:X.insufficientDescription},generic:{title:X.errorTitle,description:X.errorDescription}
1,completionFailed:{title:X.completionFailedTitle,description:X.completionFailedDescription}},G=function(){var e=(0,n.tz)();return(0,k.jsxs)(Z.mc,{"data-testid":"vocab-check-loading",children:[(0,k.jsx)(Z.aH,{"data-testid":"vocab-check-loader"}),(0,k.jsx)(Z.hE,{children:e.formatMessage(X.loadingTitle)})]})},J=function(e){var t=e.variant,r=e.onExit,o=(0,n.tz)(),i=U[t],a=i.title,c=i.description;return(0,k.jsxs)(Z.mc,{"data-testid":"vocab-check-error-".concat(t),children:[(0,k.jsx)(Z.hE,{children:o.formatMessage(a)}),(0,k.jsx)(Z.VY,{children:o.formatMessage(c)}),(0,k.jsx)(Z.yp,{children:(0,k.jsx)(w.$n,{wide:!0,buttonType:"primary",buttonSize:"large",onClick:r,"data-testid":"vocab-check-error-exit",children:o.formatMessage(X.exit)})})]})},Q=r(46424),ee=(0,n.YK)({title:{id:"vocab_check_session_success_title",defaultMessage:"Well done!"},description:{id:"vocab_check_session_success_description",defaultMessage:"You matched all the words."},continue:{id:"vocab_check_session_success_continue",defaultMessage:"Continue"}}),et=function(e){var t=e.onContinue,r=e.isContinuing,o=void 0!==r&&r,i=(0,n.tz)();return(0,k.jsxs)(Q.mc,{"data-testid":"vocab-check-success",children:[(0,k.jsx)(Q.hE,{children:i.formatMessage(ee.title)}),(0,k.jsx)(Q.VY,{children:i.formatMessage(ee.description)}),(0,k.jsx)(Q.yp,{children:(0,k.jsx)(w.$n,{wide:!0,buttonType:"primary",buttonSize:"large",onClick:function(){t()},loading:o,disabled:o,"data-testid":"vocab-check-success-continue",children:i.formatMessage(ee.continue)})})]})},er=r(42969),en=r(44478),eo=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Math.random,r=(0,en.A)(e),n=r.length-1;n>0;n-=1){var o=Math.floor(t()*(n+1)),i=r[n],a=r[o];void 0!==i&&void 0!==a&&(r[n]=a,r[o]=i)}return r};function ei(e,t){var r="u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e){if(e){if("string"==typeof e)return ea(e,void 0);var t=({}).toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?ea(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){c=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw i}}}}function ea(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var ec=function(e,t){var r=Math.floor(t()*e.length);return e[r]},es=function(e,t,r){var n=(0,en.A)(e),o=Math.floor(r()*(n.length+1));return n.splice(o,0,t),n},ed=function(e,t){var r=new Set(e),n=new Set(t);return{targetOnly:e.filter(function(e){return!n.has(e)}),sourceOnly:t.filter(function(e){return!r.has(e)})}},el=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=null!=(n=t.random)?n:Math.random;if(t.targetOrder&&t.sourceOrder){var n,o,i=new Set([].concat((0,en.A)(t.targetOrder),(0,en.A)(t.sourceOrder)));return{targetOrder:t.targetOrder,sourceOrder:t.sourceOrder,pool:null!=(o=t.pool)?o:e.filter(function(e){return!i.has(e)})}}var a=eo(e,r),c=Math.min(5,a.length);if(a.length<=c)return{targetOrder:eo(a,r),sourceOrder:eo(a,r),pool:[]};var s=c-1,d=a.slice(0,s),l=a[s],u=a[s+1],f=a.slice(s+2);return{targetOrder:eo([].concat((0,en.A)(d),[l]),r),sourceOrder:eo([].concat((0,en.A)(d),[u]),r),pool:f}},eu=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Math.random,r=e.targetOrder,n=e.sourceOrder,o=e.pool;if(r.length>=5&&n.length>=5)return e;var i=ed(r,n),a=i.targetOnly,c=i.sourceOnly;if(o.length>0&&(a.length>0||c.length>0)){var s=ec([].concat((0,en.A)(a.map(function(e){return{id:e,missing:"source"}})),(0,en.A)(c.map(function(e){return{id:e,missing:"target"}}))),t),d=ec(o,t);return o=o.filter(function(e){return e!==d}),"source"===s.missing?(n=es(n,s.id,t),r=es(r,d,t)):(r=es(r,s.id,t),n=es(n,d,t)),{targetOrder:r,sourceOrder:n,pool:o}}if(0===o.length&&(a.length>0||c.length>0)){var l,u=ei(a);try{for(u.s();!(l=u.n()).done;){var f=l.value;n=es(n,f,t)}}catch(e){u.e(e)}finally{u.f()}var h,g=ei(c);try{for(g.s();!(h=g.n()).done;){var p=h.value;r=es(r,p,t)}}catch(e){g.e(e)}finally{g.f()}}return{targetOrder:r,sourceOrder:n,pool:o}};function ef(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function eh(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};
1t%2?ef(Object(r),!0).forEach(function(t){(0,er.A)(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ef(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var eg=function(e,t,r){if(t===r)return eh(eh({},e),{},{selectedTargetId:t,selectedSourceId:r,feedback:{type:"correct",targetId:t,sourceId:r}});var n=e.hearts-1;return eh(eh({},e),{},{selectedTargetId:t,selectedSourceId:r,hearts:n,feedback:{type:"wrong",targetId:t,sourceId:r},stage:n<=0?"failure":e.stage})},ep=function(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=null!=(t=r.random)?t:Math.random,o=el(e.map(function(e){return e.id}),{targetOrder:r.targetOrder,sourceOrder:r.sourceOrder,pool:r.pool,random:n});return{stage:"playing",hearts:3,pairs:e,remaining:e,targetOrder:o.targetOrder,sourceOrder:o.sourceOrder,pool:o.pool,selectedTargetId:null,selectedSourceId:null,feedback:null,random:n}},em=function(e,t){switch(t.type){case"RETRY":return ep(e.pairs,{random:e.random});case"RESOLVE_FEEDBACK":if(!e.feedback)return e;if("wrong"===e.feedback.type)return eh(eh({},e),{},{selectedTargetId:null,selectedSourceId:null,feedback:null});var r=e.feedback.targetId,n=e.remaining.filter(function(e){return e.id!==r}),o=eu({targetOrder:e.targetOrder.filter(function(e){return e!==r}),sourceOrder:e.sourceOrder.filter(function(e){return e!==r}),pool:e.pool.filter(function(e){return e!==r})},e.random);return eh(eh({},e),{},{remaining:n,targetOrder:o.targetOrder,sourceOrder:o.sourceOrder,pool:o.pool,selectedTargetId:null,selectedSourceId:null,feedback:null,stage:0===n.length?"success":"playing"});case"SELECT_TARGET":if("playing"!==e.stage||e.feedback)return e;if(e.selectedTargetId===t.id)return eh(eh({},e),{},{selectedTargetId:null});var i=t.id;if(null!==e.selectedSourceId)return eg(e,i,e.selectedSourceId);return eh(eh({},e),{},{selectedTargetId:i});case"SELECT_SOURCE":if("playing"!==e.stage||e.feedback)return e;if(e.selectedSourceId===t.id)return eh(eh({},e),{},{selectedSourceId:null});var a=t.id;if(null!==e.selectedTargetId)return eg(e,e.selectedTargetId,a);return eh(eh({},e),{},{selectedSourceId:a});default:return e}},ev=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=(0,l.useReducer)(em,e,function(e){return ep(e,t)}),n=r[0],o=r[1];return(0,l.useEffect)(function(){if(n.feedback){var e=window.setTimeout(function(){o({type:"RESOLVE_FEEDBACK"})},500);return function(){window.clearTimeout(e)}}},[n.feedback]),eh(eh({},n),{},{matchedCount:n.pairs.length-n.remaining.length,totalPairs:n.pairs.length,selectTarget:function(e){return o({type:"SELECT_TARGET",id:e})},selectSource:function(e){return o({type:"SELECT_SOURCE",id:e})},retry:function(){return o({type:"RETRY"})}})},eb=r(74359),ey=r(26900);function ex(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}var ew=function(e,t){var r;return(0,eb.I)({queryKey:["vocabCheckSession",e,t],enabled:!!e,retry:!1,queryFn:(r=(0,c.A)(d().mark(function r(){return d().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(e){r.next=2;break}throw Error("languagePairId is required");case 2:return r.abrupt("return",ey.Tv.getSession(function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ex(Object(r),!0).forEach(function(t){(0,er.A)(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ex(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({languagePairId:e},null!=t?{futureLearnablesOffset:t}:{})));case 3:case"end":return r.stop()}},r)})),function(){return r.apply(this,arguments)})})},eC=function(e){e&&(e.pause(),e.currentTime=0)},ek=function(e,t){var r,n,o=(0,l.useRef)(null),i=null===e?null:null!=(r=null==(n=t.find(function(t){return t.id===e}))?void 0:n.audio)?r:null;(0,l.useEffect)(function(){if(eC(o.current),o.current=null,i){var e=new Audio(i);return o.current=e,e.play().catch(function(){}),function(){eC(e),o.current===e&&(o.current=null)}}},[i])},ej=E.Ay.div.withConfig({componentId:"sc-c09oh9-0"})(function(e){var t=e.theme;return(0,E.AH)(["display:flex;flex-direction:column;align-items:center;min-height:100%;min-width:100vw;width:100%;background-color:",";color:",";"],t.co.neutral99,t.co.neutral20)}),eO=E.Ay.div.withConfig({componentId:"sc-c09oh9-1"})(function(e){var t=e.theme;return(0,E.AH)(["display:flex;flex-direction:column;align-items:center;width:100%;max-width:",";padding:",";gap:",";@media (min-width:","){padding:",";gap:",";}"],t.sz.xl,t.sz.s4,t.sz.s4,t.sz.ml,t.sz.s8,t.sz.s6)}),e_=E.Ay.h1.withConfig({componentId:"sc-c09oh9-2"})(function(e){var t=e.theme;return(0,E.AH)(["",";color:",";margin:0;text-align:center;width:100%;@media (max-width:","){",";}"],t.typography.heading.desktop.s,t.co.neutral10,t.sz.lg,t.typography.heading.mobile.s)}),eA=E.Ay.div.withConfig({componentId:"sc-c09oh9-3"})(function(e){var t=e.theme;return(0,E.AH)(["width:100%;margin-top:",";"],t.sz.s2)}),eI=(0,n.YK)({title:{id:"vocab_check_session_title",defaultMessage:"Match the words with their translations"}}),ez=function(e){if("string"!=typeof e)return null;var t=(0,x.oV)(e);return t instanceof x.XR?null:t},eS=function(){var e=ez((0,u.useRouter)().query.language_pair_id);return null!=e?e:(0,b.S)()},eE=function(){var e=(0,u.useRouter)();return{pathwayNodeId:ez(e.query.pathway_node_id),pathwayCheckpointId:ez(e.query.pathway_checkpoint_id)}},eT=function(e){return"string"==typeof e&&e.startsWith("/")?e:v.b.path},eM=function(e){var t=e.pairs,r=e.sessionOptions,o=e.onExit,i=e.onSuccessContinue,a=e.isCompletingPathway,c=void 0!==a&&a,s=e.isPathCheckpoint,d=e.onReachedSuccess,u=(0,n.tz)(),p=ev(t,r),m=p.stage,v=p.hearts,b=p.remaining,y=p.targetOrder,x=p.sourceOrder,w=p.selectedTargetId,C=p.selectedSourceId,j=p.feedback,_=p.matchedCount,A=p.totalPairs,I=p.selectTarget,z=p.selectSource,S=p.retry;ek(j?null:w,t);var E=(0,l.useState)(null),T=E[0],M=E[1];(0,l.useEffect)(function(){(null==j?void 0:j.type)==="correct"&&M(j.targetId)},[j]),(0,l.useEffect)(function(){"success"===m&&(null==d||d())},[d,m]);var P=_+ +((null==j?void 0:j.type)==="correct");return(0,k.jsxs)(k.Fragment,{children:[null!==T&&(0,k.jsx)("audio",{autoPlay:!0,preload:"auto",src:f.A,"data-testid":"vocab-check-correct-sound"},"correct-".concat(T)),"success"===m?void 0!==s&&s?(0,k.jsx)(h.Z,{icon:(0,g.C_)("vocabularyCheck"),onContinue:i,isContinuing:c}):(0,k.jsx)(et,{onContinue:i,isContinuing:c}):"failure"===m?(0,k.jsx)(O,{onRetry:S,onExit:o}):(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(B,{hearts:v,completedCount:P,totalCount:A,onExit:o}),(0,k.jsx)(e_,{"data-testid":"vocab-check-title",children:u.formatMessage(eI.title)}),(0,k.jsx)(eA,{children:(0,k.jsx)(R,{remaining:b,targetOrder:y,sourceOrder:x,selectedTargetId:w,selectedSourceId:C,feedback:j,onSelectTarget:I,onSelectSource:z})})]})]})},eP=function(){var e=(0,u.useRouter)(),t=(0,p.A)().safePush,r=eS(),n=eE(),o=n.pathwayNodeId,i=n.pathwayCheckpointId,a=ew(r,(0,y.Z)(e.query.future_learnables_offset)),s=a.data,f=
1a.isPending,h=a.isError,g=(0,m.a)({languagePairId:r,pathwayNodeId:o,pathwayCheckpointId:i,celebratesCheckpointInSession:!0}).completePathwayProgress,v=(0,l.useState)(!1),b=v[0],x=v[1],w=(0,l.useState)(!1),C=w[0],j=w[1],O=(0,l.useMemo)(function(){return s?s.learnables.map(function(e){return{id:e.learnableId,targetText:e.targetValue,sourceText:e.sourceValue,audio:e.audio}}):null},[s]),_=function(){t(eT(e.query.back))},A=(0,l.useCallback)(function(){g().catch(function(){})},[g]),I=(0,l.useCallback)((0,c.A)(d().mark(function r(){return d().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return x(!0),r.prev=1,r.next=4,g();case 4:t(eT(e.query.back)),r.next=10;break;case 7:r.prev=7,r.t0=r.catch(1),j(!0);case 10:return r.prev=10,x(!1),r.finish(10);case 13:case"end":return r.stop()}},r,null,[[1,7,10,13]])})),[g,e.query.back,t]),z=!!O&&0===O.length;return(0,k.jsx)(ej,{"data-testid":"vocab-check-session",children:(0,k.jsx)(eO,{children:C?(0,k.jsx)(J,{variant:"completionFailed",onExit:_}):!r||h?(0,k.jsx)(J,{variant:"generic",onExit:_}):f||!O?(0,k.jsx)(G,{}):z?(0,k.jsx)(J,{variant:"insufficient",onExit:_}):(0,k.jsx)(eM,{pairs:O,onExit:_,onSuccessContinue:I,isCompletingPathway:b,isPathCheckpoint:null!==i,onReachedSuccess:A})})})},eH=(0,n.YK)({pageTitle:{id:"vocab_check_session_page_title",defaultMessage:"Vocab check"}});let eD=function(){var e=(0,n.tz)();return(0,k.jsxs)(a.co,{children:[(0,k.jsx)(i(),{children:(0,k.jsx)("title",{children:e.formatMessage(eH.pageTitle)})}),(0,k.jsx)(eP,{})]})}},94295:(e,t,r)=>{"use strict";r.d(t,{C:()=>o,Y:()=>i});var n=r(5646),o=n.Ay.div.withConfig({componentId:"sc-1s1j3bx-0"})(function(e){var t=e.theme;return(0,n.AH)(["display:flex;align-items:center;flex:1;min-width:0;gap:",";height:",";"],t.sz.s1,t.sz.s2)}),i=n.Ay.div.withConfig({componentId:"sc-1s1j3bx-1"})(function(e){var t=e.theme,r=e.$filled;return(0,n.AH)(["flex:1;min-width:0;height:100%;border-radius:",";background-color:",";transition:background-color 0.2s ease;"],t.bo.round,r?t.co.success40:t.co.neutral90)})}},e=>{e.O(0,[5687,7474,6593,636,8792],()=>e(e.s=11916)),_N_E=e.O()}]);
2//# sourceMappingURL=vocab-check-8339615b50c9bad8.js.map

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.