import"./jquery.e8a081b2.js";import{D as d}from"./dataTables.responsive.8ca70206.js";import{f as c,c as l}from"./utility.35c60188.js";import"./dataTables.fixedColumns.be792f05.js";import"./_commonjsHelpers.b8add541.js";let i=null;u();function u(){let s=[{data:"id"},{data:"player_name",render:function(e,r,a,n){return`<span class="list-profile"><img src="${a.avatar}" /><a href="https://steamcommunity.com/profiles/${a.player_steamid}">${e}</a></span>`}},{data:"admin_steamid",render:function(e,r,a,n){return e!="Console"?`<a href="https://steamcommunity.com/profiles/${e}">${a.admin_name}</a>`:e}},{data:"reason"},{data:"duration"},{data:"ends"},{data:"created",render:function(e,r,a,n){return c(e)}},{data:"server_id"},{data:"status"},{data:"action",width:"200px",render:function(e,r,a,n){return'<div class="action-container">'+e+"</div>"}},{data:"duration",render:function(e,r,a,n){let t=l(a.created,a.ends),o="bg-warning";return a.status.includes("badge badge-primary")?(o="bg-primary",t=100):a.duration.includes("badge badge-danger")?o="bg-danger":t==100&&(o="bg-success"),t=isNaN(t)?100:t,`
            <div class="progress">
                <div class="progress-bar progress-bar-striped progress-bar-animated custom-progress ${o}"
                role="progressbar" style="width:  ${t}%" aria-valuenow="${t}"
                aria-valuemin="0" aria-valuemax="100">
                </div>
            </div>`}}];i=new d("#mutesList",{responsive:!0,processing:!0,serverSide:!0,ajax:{url:mutesListUrl,headers:{"X-CSRF-TOKEN":$('meta[name="csrf-token"]').attr("content")},type:"POST",dataType:"json"},language:{search:window.translations.searchByPlayernameAndSteamid,processing:'<div class="spinner"></div>'},order:[[0,"desc"]],columns:s})}$(document).on("click",".unmute-btn",function(){let s=$(this).data("player-steamid");$.ajax({url:getPlayerUnMuteUrl(s),type:"PUT",dataType:"json",data:{playerSteamid:s},headers:{"X-CSRF-TOKEN":$('meta[name="csrf-token"]').attr("content")},success:function(e){Snackbar.show({text:"Player unmuted successfully",actionTextColor:"#fff",backgroundColor:"#00ab55",pos:"top-center"}),i.ajax.reload()},error:function(e,r,a){Snackbar.show({text:"Failed to unmute player!",actionTextColor:"#fff",backgroundColor:"#e7515a",pos:"top-center"})}})});
