(function(e){if(typeof define==="function"&&define.amd){define(["jquery"],e)}else if(typeof exports==="object"){module.exports=e}else{e(jQuery)}})(function(e){window.sprintfWrapper={init:function(){if(typeof arguments=="undefined"){return null}if(arguments.length<1){return null}if(typeof arguments[0]!="string"){return null}if(typeof RegExp=="undefined"){return null}var e=arguments[0];var t=new RegExp(/(%([%]|(\-)?(\+|\x20)?(0)?(\d+)?(\.(\d)?)?([bcdfosxX])))/g);var n=new Array;var r=new Array;var i=0;var s=0;var a=0;var u=0;var g="";var o=null;while(o=t.exec(e)){if(o[9]){i+=1}s=u;a=t.lastIndex-o[0].length;r[r.length]=e.substring(s,a);u=t.lastIndex;n[n.length]={match:o[0],left:o[3]?true:false,sign:o[4]||"",pad:o[5]||" ",min:o[6]||0,precision:o[8],code:o[9]||"%",negative:parseInt(arguments[i])<0?true:false,argument:String(arguments[i])}}r[r.length]=e.substring(u);if(n.length==0){return e}if(arguments.length-1<i){return null}var o=null;var p=null;for(p=0;p<n.length;p++){if(n[p].code=="%"){substitution="%"}else if(n[p].code=="b"){n[p].argument=String(Math.abs(parseInt(n[p].argument)).toString(2));substitution=sprintfWrapper.convert(n[p],true)}else if(n[p].code=="c"){n[p].argument=String(String.fromCharCode(parseInt(Math.abs(parseInt(n[p].argument)))));substitution=sprintfWrapper.convert(n[p],true)}else if(n[p].code=="d"){n[p].argument=String(Math.abs(parseInt(n[p].argument)));substitution=sprintfWrapper.convert(n[p])}else if(n[p].code=="f"){n[p].argument=String(Math.abs(parseFloat(n[p].argument)).toFixed(n[p].precision?n[p].precision:6));substitution=sprintfWrapper.convert(n[p])}else if(n[p].code=="o"){n[p].argument=String(Math.abs(parseInt(n[p].argument)).toString(8));substitution=sprintfWrapper.convert(n[p])}else if(n[p].code=="s"){n[p].argument=n[p].argument.substring(0,n[p].precision?n[p].precision:n[p].argument.length);substitution=sprintfWrapper.convert(n[p],true)}else if(n[p].code=="x"){n[p].argument=String(Math.abs(parseInt(n[p].argument)).toString(16));substitution=sprintfWrapper.convert(n[p])}else if(n[p].code=="X"){n[p].argument=String(Math.abs(parseInt(n[p].argument)).toString(16));substitution=sprintfWrapper.convert(n[p]).toUpperCase()}else{substitution=n[p].match}g+=r[p];g+=substitution}g+=r[p];return g},convert:function(e,t){if(t){e.sign=""}else{e.sign=e.negative?"-":e.sign}var n=e.min-e.argument.length+1-e.sign.length;var r=new Array(n<0?0:n).join(e.pad);if(!e.left){if(e.pad=="0"||t){return e.sign+r+e.argument}else{return r+e.sign+e.argument}}else{if(e.pad=="0"||t){return e.sign+e.argument+r.replace(/0/g," ")}else{return e.sign+e.argument+r}}}};return window.sprintfWrapper});