bwdefine("memorygame",["config","pairgame","BWMATH","bw/widget","jquery","bw/zoomableImage"],function(e,a,t,d,i,n){"use strict";i(function(){function c(a,d,c){var o=i(document.createElement("div")).addClass("card").addClass("pair_"+a).attr("pairid",a);if(i('<div class="front"><div class="image"></div></div>').appendTo(o),"image"==c)n.create({img:d,type:"div",disable_click:!0,resize_policy:e["resize-policy"]}).addClass("back").appendTo(o);else{var s=t.prepare(d),r=s!=d?" hasmath":"",l=i(document.createElement("div")).addClass("back").appendTo(o),m=i(document.createElement("div")).addClass("content").appendTo(l);i(document.createElement("div")).addClass("centered textcard "+r).html(s).appendTo(m)}return o}function o(e){setTimeout(function(){e.animate({opacity:"0.2"},500,function(){e.addClass("shadow"),e.css("opacity",""),0==i(".card:not(.done)").length&&(i(".card").css("opacity","0.2"),i(".card").removeClass("shadow"),i(".card").animate({opacity:"1"},500,function(){a.setAllDone()}))})},1e3)}d.makeWidget({layout:"title_toolbar_layout",title:e.title,"no-user-select":!0}),a.create(c,o,"MemoryGame")})}),bwdefine.finalize();