{"version":3,"sources":["jquery.urldecoder.js"],"names":["jQuery","url","decode","string","window","location","toString","utftext","i","c","c2","length","charCodeAt","String","fromCharCode","c3","utf8_decode","unescape","replace","encode","encodeURIComponent","parse","url_str","params","coerce","obj","coerce_types","keys","m","exec","uri","query","true","false","null","$","each","split","j","v","val","param","key","cur","keys_last","test","shift","concat","isNaN","undefined","isArray","push","build","url_obj","source","encodeURI","resultArr","protocol","authority","userInfo","user","password","host","port","path","directory","file","anchor","join"],"mappings":"AAsEAA,OAAOC,IAAM,WA2SZ,SAASC,EAAOC,GAEf,OADAA,EAASA,GAAWC,OAAOC,SAASC,WApQrC,SAAqBC,GAMpB,IALA,IAAIJ,EAAS,GACTK,EAAI,EACJC,EAAI,EACJC,EAAK,EAEDF,EAAID,EAAQI,SAEnBF,EAAIF,EAAQK,WAAWJ,IAEf,KACPL,GAAUU,OAAOC,aAAaL,GAC9BD,KAEQC,EAAI,KAASA,EAAI,KACzBC,EAAKH,EAAQK,WAAWJ,EAAE,GAC1BL,GAAUU,OAAOC,cAAmB,GAAJL,IAAW,EAAW,GAALC,GACjDF,GAAK,IAGLE,EAAKH,EAAQK,WAAWJ,EAAE,GAC1BO,GAAKR,EAAQK,WAAWJ,EAAE,GAC1BL,GAAUU,OAAOC,cAAmB,GAAJL,IAAW,IAAa,GAALC,IAAY,EAAW,GAALK,IACrEP,GAAK,GAKP,OAAOL,EAyOAa,CAAYC,SAASd,EAAOe,QAAQ,MAAO,OAanD,MAAO,CACNC,OA5BD,SAAgBhB,GAGf,OAAOiB,mBAAmBjB,IA0B1BD,OAAQA,EACRmB,MA5ID,SAAeC,GACdA,EAAUA,GAAWlB,OAAOC,SAa5B,IARA,IAtGgBkB,EAAQC,EACpBC,EACHC,EAsGGC,EAAO,CAAC,SAAS,WAAW,YAAY,WAAW,OAAO,WAAW,OAAO,OAAO,WAAW,OAAO,YAAY,OAAO,QAAQ,UAEhIC,EAJK,+LAIEC,KAAMP,GACbQ,EAAM,GACNtB,EAAImB,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yB,EAAY,OAI3BxB,IAuCAK,GA+GPsB,MArGD,SAAeC,GAEd,GAAIA,EAAQC,OACX,OAAOC,UAAUF,EAAQC,QAG1B,IAAIE,EAAY,GAuDhB,OArDIH,EAAQI,WACa,QAApBJ,EAAQI,SACXD,EAAUL,KAAK,YACe,UAApBE,EAAQI,SAClBD,EAAUL,KAAK,WAEfK,EAAUL,KAAKE,EAAQI,SAAW,QAIhCJ,EAAQK,UACXF,EAAUL,KAAKE,EAAQK,YAEnBL,EAAQM,SACXH,EAAUL,KAAKE,EAAQM,SAAW,KACzBN,EAAQO,OACjBJ,EAAUL,KAAKE,EAAQO,MACpBP,EAAQQ,UACVL,EAAUL,KAAK,IAAME,EAAQQ,UAE9BL,EAAUL,KAAK,MAGZE,EAAQS,OACXN,EAAUL,KAAKE,EAAQS,MACpBT,EAAQU,MACVP,EAAUL,KAAK,IAAME,EAAQU,QAK5BV,EAAQW,KACXR,EAAUL,KAAKE,EAAQW,OAEpBX,EAAQY,WACVT,EAAUL,KAAKE,EAAQY,WAErBZ,EAAQa,MACVV,EAAUL,KAAKE,EAAQa,OAKrBb,EAAQtB,MACXyB,EAAUL,KAAK,IAAME,EAAQtB,OACnBsB,EAAQ9B,QAClBiC,EAAUL,KAAK,IAAMhB,EAAEM,MAAMY,EAAQ9B,SAGlC8B,EAAQc,QACXX,EAAUL,KAAK,IAAME,EAAQc,QAGvBX,EAAUY,KAAK,MAtRX","file":"jquery.urldecoder.min.js","sourcesContent":["/** --------------------------------------------------------------------------\n *\tjQuery URL Decoder\n *\tVersion 1.0\n *\tParses URL and return its components. Can also build URL from components\n *\t\n * ---------------------------------------------------------------------------\n *\tHOW TO USE:\n *\n *\t$.url.decode('http://username:password@hostname/path?arg1=value%40+1&arg2=touch%C3%A9#anchor')\n *\t// returns\n *\t// http://username:password@hostname/path?arg1=value@ 1&arg2=touché#anchor\n *\t// Note: \"%40\" is replaced with \"@\", \"+\" is replaced with \" \" and \"%C3%A9\" is replaced with \"é\"\n *\t\n *\t$.url.encode('file.htm?arg1=value1 @#456&arg2=value2 touché')\n *\t// returns\n *\t// file.htm%3Farg1%3Dvalue1%20%40%23456%26arg2%3Dvalue2%20touch%C3%A9\n *\t// Note: \"@\" is replaced with \"%40\" and \"é\" is replaced with \"%C3%A9\"\n *\t\n *\t$.url.parse('http://username:password@hostname/path?arg1=value%40+1&arg2=touch%C3%A9#anchor')\n *\t// returns\n *\t{\n *\t\tsource: 'http://username:password@hostname/path?arg1=value%40+1&arg2=touch%C3%A9#anchor',\n *\t\tprotocol: 'http',\n *\t\tauthority: 'username:password@hostname',\n *\t\tuserInfo: 'username:password',\n *\t\tuser: 'username',\n *\t\tpassword: 'password',\n *\t\thost: 'hostname',\n *\t\tport: '',\n *\t\tpath: '/path',\n *\t\tdirectory: '/path',\n *\t\tfile: '',\n *\t\trelative: '/path?arg1=value%40+1&arg2=touch%C3%A9#anchor',\n *\t\tquery: 'arg1=value%40+1&arg2=touch%C3%A9',\n *\t\tanchor: 'anchor',\n *\t\tparams: {\n *\t\t\t'arg1': 'value@ 1',\n *\t\t\t'arg2': 'touché'\n *\t\t}\n *\t}\n *\t\n *\t$.url.build({\n *\t\tprotocol: 'http',\n *\t\tusername: 'username',\n *\t\tpassword: 'password',\n *\t\thost: 'hostname',\n *\t\tpath: '/path',\n *\t\tquery: 'arg1=value%40+1&arg2=touch%C3%A9',\n *\t\t// or \n *\t\t//params: {\n *\t\t//\t'arg1': 'value@ 1',\n *\t\t//\t'arg2': 'touché'\n *\t\t//}\n *\t\tanchor: 'anchor',\n *\t})\n *\t// returns\n *\t// http://username:password@hostname/path?arg1=value%40+1&arg2=touch%C3%A9#anchor\t\n *\t\n * ---------------------------------------------------------------------------\n * OTHER PARTIES' CODE:\n *\n * Parser based on the Regex-based URI parser by Steven Levithan.\n * For more information visit http://blog.stevenlevithan.com/archives/parseuri\n *\n * Deparam taken from jQuery BBQ by Ben Alman. Dual licensed under the MIT and GPL licenses (http://benalman.com/about/license/)\n * http://benalman.com/projects/jquery-bbq-plugin/\n * \n * ---------------------------------------------------------------------------\n\t\n*/\njQuery.url = function(){ \n\t\n /**\n\t * private function to encode URL\n \t * \n\t * @param {String} string //required\n\t * @return {String}\n */\n\tfunction utf8_encode(string) { \n\t\tstring = string.replace(/\\r\\n/g,\"\\n\"); \n\t\tvar utftext = \"\"; \n \n\t\tfor (var n = 0; n < string.length; n++) { \n \n\t\t\tvar c = string.charCodeAt(n); \n \n\t\t\tif (c < 128) { \n\t\t\t\tutftext += String.fromCharCode(c); \n\t\t\t} \n\t\t\telse if((c > 127) && (c < 2048)) { \n\t\t\t\tutftext += String.fromCharCode((c >> 6) | 192); \n\t\t\t\tutftext += String.fromCharCode((c & 63) | 128); \n\t\t\t} \n\t\t\telse { \n\t\t\t\tutftext += String.fromCharCode((c >> 12) | 224); \n\t\t\t\tutftext += String.fromCharCode(((c >> 6) & 63) | 128); \n\t\t\t\tutftext += String.fromCharCode((c & 63) | 128); \n\t\t\t} \n \n\t\t} \n \n\t\treturn utftext; \n\t}\n \n /**\n * private function to decode URL\n \t * \n\t * @param {String} utftext //required\n\t * @return {String}\n */\n\tfunction utf8_decode(utftext) { \n\t\tvar string = \"\"; \n\t\tvar i = 0; \n\t\tvar c = 0;\n\t\tvar c2 = 0; \n \n\t\twhile ( i < utftext.length ) { \n \n\t\t\tc = utftext.charCodeAt(i); \n \n\t\t\tif (c < 128) { \n\t\t\t\tstring += String.fromCharCode(c); \n\t\t\t\ti++; \n\t\t\t} \n\t\t\telse if((c > 191) && (c < 224)) { \n\t\t\t\tc2 = utftext.charCodeAt(i+1); \n\t\t\t\tstring += String.fromCharCode(((c & 31) << 6) | (c2 & 63)); \n\t\t\t\ti += 2; \n\t\t\t} \n\t\t\telse { \n\t\t\t\tc2 = utftext.charCodeAt(i+1); \n\t\t\t\tc3 = utftext.charCodeAt(i+2); \n\t\t\t\tstring += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63)); \n\t\t\t\ti += 3; \n\t\t\t} \n \n\t\t} \n \n\t\treturn string; \n\t} \n \n \n /**\n * private function to convert urlencoded query string to javascript object\n \t * \n\t * @param {String} params //required\n\t * @param {Boolean} coerce //optional\n\t * @return {Object}\n\t *\n\t * @author Ben Alman\n */\t\t\n\tfunction deparam(params, coerce) {\n\t\tvar obj = {},\n\t\t\tcoerce_types = {\n\t\t\t'true': !0,\n\t\t\t'false': !1,\n\t\t\t'null': null\n\t\t};\n\t\n\t\t// Iterate over all name=value pairs.\n\t\t$.each(params.replace(/\\+/g, ' ').split('&'), function (j, v) {\n\t\t\tvar param = v.split('='),\n\t\t\t\tkey = decode(param[0]),\n\t\t\t\tval, cur = obj,\n\t\t\t\ti = 0,\n\t\n\t\t\t// If key is more complex than 'foo', like 'a[]' or 'a[b][c]', split it\n\t\t\t// into its component parts.\n\t\t\tkeys = key.split(']['),\n\t\t\t\tkeys_last = keys.length - 1;\n\t\n\t\t\t// If the first keys part contains [ and the last ends with ], then []\n\t\t\t// are correctly balanced.\n\t\t\tif (/\\[/.test(keys[0]) && /\\]$/.test(keys[keys_last])) {\n\t\t\t\t// Remove the trailing ] from the last keys part.\n\t\t\t\tkeys[keys_last] = keys[keys_last].replace(/\\]$/, '');\n\t\n\t\t\t\t// Split first keys part into two parts on the [ and add them back onto\n\t\t\t\t// the beginning of the keys array.\n\t\t\t\tkeys = keys.shift().split('[').concat(keys);\n\t\n\t\t\t\tkeys_last = keys.length - 1;\n\t\t\t} else {\n\t\t\t\t// Basic 'foo' style key.\n\t\t\t\tkeys_last = 0;\n\t\t\t}\n\t\n\t\t\t// Are we dealing with a name=value pair, or just a name?\n\t\t\tif (param.length === 2) {\n\t\t\t\tval = decode(param[1]);\n\t\n\t\t\t\t// Coerce values.\n\t\t\t\tif (coerce) {\n\t\t\t\t\tval = val && !isNaN(val) ? +val // number\n\t\t\t\t\t: val === 'undefined' ? undefined // undefined\n\t\t\t\t\t: coerce_types[val] !== undefined ? coerce_types[val] // true, false, null\n\t\t\t\t\t: val; // string\n\t\t\t\t}\n\t\n\t\t\t\tif (keys_last) {\n\t\t\t\t\t// Complex key, build deep object structure based on a few rules:\n\t\t\t\t\t// * The 'cur' pointer starts at the object top-level.\n\t\t\t\t\t// * [] = array push (n is set to array length), [n] = array if n is \n\t\t\t\t\t// numeric, otherwise object.\n\t\t\t\t\t// * If at the last keys part, set the value.\n\t\t\t\t\t// * For each keys part, if the current level is undefined create an\n\t\t\t\t\t// object or array based on the type of the next keys part.\n\t\t\t\t\t// * Move the 'cur' pointer to the next level.\n\t\t\t\t\t// * Rinse & repeat.\n\t\t\t\t\tfor (; i <= keys_last; i++) {\n\t\t\t\t\t\tkey = keys[i] === '' ? cur.length : keys[i];\n\t\t\t\t\t\tcur = cur[key] = i < keys_last ? cur[key] || (keys[i + 1] && isNaN(keys[i + 1]) ? {} : []) : val;\n\t\t\t\t\t}\n\t\n\t\t\t\t} else {\n\t\t\t\t\t// Simple key, even simpler rules, since only scalars and shallow\n\t\t\t\t\t// arrays are allowed.\n\t\t\t\t\tif ($.isArray(obj[key])) {\n\t\t\t\t\t\t// val is already an array, so push on the next value.\n\t\t\t\t\t\tobj[key].push(val);\n\t\n\t\t\t\t\t} else if (obj[key] !== undefined) {\n\t\t\t\t\t\t// val isn't an array, but since a second value has been specified,\n\t\t\t\t\t\t// convert val into an array.\n\t\t\t\t\t\tobj[key] = [obj[key], val];\n\t\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// val is a scalar.\n\t\t\t\t\t\tobj[key] = val;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\n\t\t\t} else if (key) {\n\t\t\t\t// No value was defined, so set something meaningful.\n\t\t\t\tobj[key] = coerce ? undefined : '';\n\t\t\t}\n\t\t});\n\t\n\t\treturn obj;\n\t}\n\t\n /**\n * private function to parse URL to components\n \t * \n\t * @param {String} url_str //optional, if omited using current location\n\t * @return {Object}\n */\t\t\n\tfunction parse(url_str) {\n\t\turl_str = url_str || window.location;\n\t\t\n\t\t/**\n\t\t* @author of RegExp Steven Levithan \n\t\t*/\n\t\tvar re = /^(?:(?![^:@]+:[^:@\\/]*@)([^:\\/?#.]+):)?(?:\\/\\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\\/?#]*)(?::(\\d*))?)(((\\/(?:[^?#](?![^?#\\/]*\\.[^?#\\/.]+(?:[?#]|$)))*\\/?)?([^?#\\/]*))(?:\\?([^#]*))?(?:#(.*))?)/;\n\t\t\n\t\tvar keys = [\"source\",\"protocol\",\"authority\",\"userInfo\",\"user\",\"password\",\"host\",\"port\",\"relative\",\"path\",\"directory\",\"file\",\"query\",\"anchor\"];\n\t\t\n\t\tvar m = re.exec( url_str );\n\t\tvar uri = {};\n\t\tvar i = keys.length;\n\t\t\n\t\twhile ( i-- ) {\n\t\t\turi[ keys[i] ] = m[i] || \"\";\n\t\t}\n\t\t/*\n\t\turi.params = {};\n\t\t\n\t\turi.query.replace( /(?:^|&)([^&=]*)=?([^&]*)/g, function ( $0, $1, $2 ) {\n\t\t\tif ($1) {\n\t\t\t\turi.params[decode($1)] = decode($2);\n\t\t\t}\n\t\t});\n\t\t*/\n\t\tif(uri.query){\n\t\t\turi.params = deparam(uri.query,true);\n\t\t}\n\t\t\n\t\treturn uri;\n\t}\n\n\n /**\n * private function to build URL string from components\n \t * \n\t * @param {Object} url_obj //required\n\t * @return {String}\n */\t\t\n\tfunction build(url_obj) {\n\t\t\n\t\tif (url_obj.source){\n\t\t\treturn encodeURI(url_obj.source);\n\t\t}\n\t\t\n\t\tvar resultArr = [];\n\t\t\n\t\tif (url_obj.protocol){\n\t\t\tif (url_obj.protocol == 'file'){\n\t\t\t\tresultArr.push('file:///');\n\t\t\t} else if (url_obj.protocol == 'mailto'){\n\t\t\t\tresultArr.push('mailto:');\n\t\t\t} else {\n\t\t\t\tresultArr.push(url_obj.protocol + '://');\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (url_obj.authority){\n\t\t\tresultArr.push(url_obj.authority);\n\t\t} else {\n\t\t\tif (url_obj.userInfo){\n\t\t\t\tresultArr.push(url_obj.userInfo + '@');\n\t\t\t} else if(url_obj.user){\n\t\t\t\tresultArr.push(url_obj.user);\n\t\t\t\tif(url_obj.password){\n\t\t\t\t\tresultArr.push(':' + url_obj.password);\n\t\t\t\t}\n\t\t\t\tresultArr.push('@');\n\t\t\t}\n\t\t\t\n\t\t\tif (url_obj.host){\n\t\t\t\tresultArr.push(url_obj.host);\n\t\t\t\tif(url_obj.port){\n\t\t\t\t\tresultArr.push(':' + url_obj.port);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (url_obj.path){\n\t\t\tresultArr.push(url_obj.path);\n\t\t} else {\n\t\t\tif(url_obj.directory){\n\t\t\t\tresultArr.push(url_obj.directory);\n\t\t\t}\n\t\t\tif(url_obj.file){\n\t\t\t\tresultArr.push(url_obj.file);\n\t\t\t}\n\t\t\t\n\t\t}\n\n\t\tif (url_obj.query){\n\t\t\tresultArr.push('?' + url_obj.query);\n\t\t} else if(url_obj.params){\n\t\t\tresultArr.push('?' + $.param(url_obj.params));\n\t\t}\n\t\t\n\t\tif (url_obj.anchor){\n\t\t\tresultArr.push('#' + url_obj.anchor);\n\t\t}\n\t\t\n\t\treturn resultArr.join('');\n\t}\n\n\t/**\n * wrapper around encoder\n \t * \n\t * @param {String} string //required\n\t * @return {String}\n */\t\t\n\tfunction encode(string) { \n\t\t//return build(parse(string));\n\t\t//return escape(utf8_encode(string));\n\t\treturn encodeURIComponent(string);\n\t} \n\n\t/**\n * wrapper around decoder\n \t * \n\t * @param {String} string //optional, if omited using current location\n\t * @return {String}\n */\t\t\n\tfunction decode(string) { \n\t\tstring = string || window.location.toString();\n\t\treturn utf8_decode(unescape(string.replace(/\\+/g, ' '))); \n\t}\n\n\t/**\n * public functions\n \t * \n\t * @see #encode\n\t * @see #decode\n\t * @see #parse\n\t * @see #build\n\t *\n\t * @return {Object}\n */\t\t\n\treturn {\n\t\tencode: encode,\n\t\tdecode: decode,\n\t\tparse: parse,\n\t\tbuild: build\n\t};\n}();"]}