(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Qs=f()}})(function(){var define,module,exports;return(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i=0;--i){var obj;var root=chain[i];if(root==='[]'&&options.parseArrays){obj=[].concat(leaf);}else{obj=options.plainObjects?Object.create(null):{};var cleanRoot=root.charAt(0)==='['&&root.charAt(root.length-1)===']'?root.slice(1,-1):root;var index=parseInt(cleanRoot,10);if(!options.parseArrays&&cleanRoot===''){obj={0:leaf};}else if(!isNaN(index)&&root!==cleanRoot&&String(index)===cleanRoot&&index>=0&&(options.parseArrays&&index<=options.arrayLimit)){obj=[];obj[index]=leaf;}else{obj[cleanRoot]=leaf;}} leaf=obj;} return leaf;};var parseKeys=function parseQueryStringKeys(givenKey,val,options){if(!givenKey){return;} var key=options.allowDots?givenKey.replace(/\.([^.[]+)/g,'[$1]'):givenKey;var brackets=/(\[[^[\]]*])/;var child=/(\[[^[\]]*])/g;var segment=brackets.exec(key);var parent=segment?key.slice(0,segment.index):key;var keys=[];if(parent){if(!options.plainObjects&&has.call(Object.prototype,parent)){if(!options.allowPrototypes){return;}} keys.push(parent);} var i=0;while((segment=child.exec(key))!==null&&i0?prefix+joined:'';};},{"./formats":1,"./utils":5}],5:[function(require,module,exports){'use strict';var has=Object.prototype.hasOwnProperty;var hexTable=(function(){var array=[];for(var i=0;i<256;++i){array.push('%'+((i<16?'0':'')+i.toString(16)).toUpperCase());} return array;}());var compactQueue=function compactQueue(queue){while(queue.length>1){var item=queue.pop();var obj=item.obj[item.prop];if(Array.isArray(obj)){var compacted=[];for(var j=0;j=0x30&&c<=0x39)||(c>=0x41&&c<=0x5A)||(c>=0x61&&c<=0x7A)){out+=string.charAt(i);continue;} if(c<0x80){out=out+hexTable[c];continue;} if(c<0x800){out=out+(hexTable[0xC0|(c>>6)]+hexTable[0x80|(c&0x3F)]);continue;} if(c<0xD800||c>=0xE000){out=out+(hexTable[0xE0|(c>>12)]+hexTable[0x80|((c>>6)&0x3F)]+hexTable[0x80|(c&0x3F)]);continue;} i+=1;c=0x10000+(((c&0x3FF)<<10)|(string.charCodeAt(i)&0x3FF));out+=hexTable[0xF0|(c>>18)] +hexTable[0x80|((c>>12)&0x3F)] +hexTable[0x80|((c>>6)&0x3F)] +hexTable[0x80|(c&0x3F)];} return out;};var compact=function compact(value){var queue=[{obj:{o:value},prop:'o'}];var refs=[];for(var i=0;i