(function(){let t,e;window.SmsCounter=e=function(){function t(){}return t.gsm7bitChars="@£$¥èéùìòÇ\\nØø\\rÅåΔ_ΦΓΛΩΠΨΣΘΞÆæßÉ !\\\"#¤%&'()*+,-./0123456789:;<=>?¡ABCDEFGHIJKLMNOPQRSTUVWXYZÄÖÑÜ§¿abcdefghijklmnopqrstuvwxyzäöñüà",t.gsm7bitExChar="\\^{}\\\\\\[~\\]|€",t.gsm7bitRegExp=RegExp("^["+t.gsm7bitChars+"]*$"),t.gsm7bitExRegExp=RegExp("^["+t.gsm7bitChars+t.gsm7bitExChar+"]*$"),t.gsm7bitExOnlyRegExp=RegExp("^[\\"+t.gsm7bitExChar+"]*$"),t.GSM_7BIT="GSM_7BIT",t.GSM_7BIT_EX="GSM_7BIT_EX",t.UTF16="UTF16",t.messageLength={GSM_7BIT:160,GSM_7BIT_EX:160,UTF16:70},t.multiMessageLength={GSM_7BIT:153,GSM_7BIT_EX:153,UTF16:67},t.count=function(t){let e,n,s,i,g;e=this.detectEncoding(t),n=t.length,e===this.GSM_7BIT_EX&&(n+=this.countGsm7bitEx(t));for(let e=0;e<t.length;e++)switch(t[e]){case"[":case"]":case"\\":case"^":case"{":case"}":case"|":n+=1}return i=this.messageLength[e],n>i&&(i=this.multiMessageLength[e]),s=Math.ceil(n/i),g=i*s-n,0===g&&0===s&&(g=i),{encoding:e,length:n,per_message:i,remaining:g,messages:s}},t.detectEncoding=function(t){switch(!1){case null==t.match(this.gsm7bitRegExp):return this.GSM_7BIT;case null==t.match(this.gsm7bitExRegExp):return this.GSM_7BIT_EX;default:return this.UTF16}},t.countGsm7bitEx=function(t){let e,n;return n=function(){let n,s,i;for(i=[],n=0,s=t.length;n<s;n++)e=t[n],null!=e.match(this.gsm7bitExOnlyRegExp)&&i.push(e);return i}.call(this),n.length},t}(),"undefined"!=typeof jQuery&&null!==jQuery&&(t=jQuery,t.fn.countSms=function(n){let s,i;return i=this,n=t(n),s=function(){let t,s,g,h;for(s in t=e.count(i.val()),h=[],t)g=t[s],h.push(n.find("."+s).text(g));return h},this.on("keyup",s),s()})}).call(this);
