(function(n){typeof define=="function"&&define.amd?define(["jquery"],n):n(jQuery)})(function(n){function r(n){return t.raw?n:encodeURIComponent(n)}function u(n){return t.raw?n:decodeURIComponent(n)}function o(n){return r(t.json?JSON.stringify(n):String(n))}function f(n){n.indexOf('"')===0&&(n=n.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{n=decodeURIComponent(n.replace(e," "))}catch(i){return}try{return t.json?JSON.parse(n):n}catch(i){}}function i(i,r){var u=t.raw?i:f(i);return n.isFunction(r)?r(u):u}var e=/\+/g,t=n.cookie=function(f,e,s){var p,a,l,v,h,w;if(e!==undefined&&!n.isFunction(e))return s=n.extend({},t.defaults,s),typeof s.expires=="number"&&(p=s.expires,a=s.expires=new Date,a.setDate(a.getDate()+p)),document.cookie=[r(f),"=",o(e),s.expires?"; expires="+s.expires.toUTCString():"",s.path?"; path="+s.path:"",s.domain?"; domain="+s.domain:"",s.secure?"; secure":""].join("");for(l=f?undefined:{},v=document.cookie?document.cookie.split("; "):[],h=0,w=v.length;h<w;h++){var b=v[h].split("="),y=u(b.shift()),c=b.join("=");if(f&&f===y){l=i(c,e);break}f||(c=i(c))===undefined||(l[y]=c)}return l};t.defaults={},n.removeCookie=function(t,i){return n.cookie(t)!==undefined?(n.cookie(t,"",n.extend({},i,{expires:-1})),!0):!1}})