text: "use strict";function _createForOfIteratorHelper(a,b){var c;if("undefined"==typeof Symbol||null==a[Symbol.iterator]){if(Array.isArray(a)||(c=_unsupportedIterableToArray(a))||b&&a&&"number"==typeof a.length){c&&(a=c);var d=0,e=function(){};return{s:e,n:function n(){return d>=a.length?{done:!0}:{done:!1,value:a[d++]}},e:function e(a){throw a},f:e}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var f,g=!0,h=!1;return{s:function s(){c=a[Symbol.iterator]()},n:function n(){var a=c.next();return g=a.done,a},e:function e(a){h=!0,f=a},f:function f(){try{g||null==c["return"]||c["return"]()}finally{if(h)throw f}}}}function _unsupportedIterableToArray(a,b){if(a){if("string"==typeof a)return _arrayLikeToArray(a,b);var c=Object.prototype.toString.call(a).slice(8,-1);return"Object"===c&&a.constructor&&(c=a.constructor.name),"Map"===c||"Set"===c?Array.from(a):"Arguments"===c||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c)?_arrayLikeToArray(a,b):void 0}}function _arrayLikeToArray(a,b){(null==b||b>a.length)&&(b=a.length);for(var c=0,d=Array(b);c<b;c++)d[c]=a[c];return d}var offset=0,limit=100,sortBy=1,total=0,isLoading=!1,areMoreAvailable=!0,profileId=parseInt($("#profiledata").attr("data-userid"),10),loadGames=function(){isLoading||(isLoading=!0,request("/game/search?genre=1&sortBy="+sortBy+"&limit="+limit+"&offset="+offset+"&creatorType=0&creatorId="+profileId).then(function(a){if(isLoading=!1,0===a.data.length&&0===a.total)return void $("#UserGamesDiv").empty().append("<div class=\"col-12\"><p style=\"margin-top:1rem;text-align:center;font-weight:600;\">This user has not created any games.</p></div>");total=a.total,total>offset+a.data.length?(areMoreAvailable=!0,$("#load-more-games").removeAttr("disabled")):(areMoreAvailable=!1,$("#load-more-games").attr("disabled","disabled"));var b,c=[],d=_createForOfIteratorHelper(a.data);try{for(d.s();!(b=d.n()).done;){var e=b.value;c.push(e.gameId);var f="<img class=\"card-img-top\" data-gameid=\"".concat(e.gameId,"\" style=\"width:100%;object-fit: fill;display:block;margin: 0 auto;height: 150px;\" />");$("#UserGamesDiv").append("\n            <div class=\"col-6 col-md-4 col-lg-3 on-hover-show-game-info-tooltip\" style=\"padding: 0 0.25rem  0.25rem 0.25rem;\">\n                <div class=\"card\">\n                    <a href=\"/game/".concat(e.gameId,"\" class=\"normal\">\n                        ").concat(f,"\n                        <div class=\"card-body\" style=\"cursor:pointer;\">\n                            <div class=\"row\">\n                                <div class=\"col-12\">\n                                    <h1 style=\"overflow: hidden;\n                                    font-size:0.85rem;\n                                    margin-bottom:0;\n                                    line-height:1rem;\n                                    height: 2rem;\n                                    \">").concat(filterXSS(e.gameName),"</h1>\n                                </div>\n\n                            </div>\n                            <div class=\"row\" style=\"padding-top:0.5rem;\">\n                                <div class=\"col-12\">\n                                    <p style=\"font-size:0.75rem;\"><span class=\"font-weight-bold\">").concat(number_format(e.playerCount),"</span> People Playing</p>\n                                </div>\n                            </div>\n                        </div>\n                    </a>\n                </div>\n                <div class=\"game-info-tooltip\">\n                    <div class=\"card\" style=\"width:100%;padding:0;\">\n                        <div class=\"card-body\" style=\"width:100%;padding:0 1rem 1rem 1rem;\">\n                            <div style=\"padding-left:0.25rem;\">\n                                <p style=\"line-height:1;font-size:0.65rem;margin-top:0.25rem;\">\n                                    <span class=\"font-weight-bold\">Last Updated</span>: ").concat(moment(e.updatedAt).fromNow(),"</a>\n                                </p>\n                            </div>\n                            <a href=\"/game/").concat(e.gameId,"\" class=\"btn btn-success\" style=\"margin-top:1rem;width:100%;\"><i class=\"fas fa-play\"></i></a>\n                        </div>\n                    </div>\n                </div>\n            </div>\n            \n            "))}}catch(a){d.e(a)}finally{d.f()}setGameThumbs(c)})["catch"](function(a){void 0,isLoading=!1,warning(a.responseJSON.message)}))};loadGames(),$("#sort-by").change(function(a){a.preventDefault();isLoading||(sortBy=parseInt($(this).val(),10),offset=0,$("#UserGamesDiv").empty(),loadGames())}),$(document).on("click","#load-more-games",function(){areMoreAvailable&&!isLoading&&($(this).attr("disabled","disabled"),offset+=limit,loadGames())});